"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-29T15:32:56.203Z",
+ "time": "2022-11-29T16:45:46.059Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-29T15:32:56.203Z",
+ "time": "2022-11-29T16:45:46.059Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
"format-all": "npm run js-beautify && npm run prettier:write",
"test": "mocha server/test --timeout 5000",
"aux-containers": "docker-compose up -d database cache",
- "dc-asterisk:up": "docker-compose -f docker-compose.asterisk.yml up -d",
- "dc-asterisk:down": "docker-compose -f docker-compose.asterisk.yml down",
"db-dump": "docker-compose exec -u root database /xmotion_mysql_bk.sh dump",
"db-restore": "docker-compose exec -u root database /xmotion_mysql_bk.sh restore"
},
"MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully",
"MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform",
"UPDATE_CLIENT_SECRET": "Update Client Secret",
- "FILTER_FULLNAME": "Full Name",
- "FILTERS": "Filters",
"HELP": {
"DEFAULTSCREENRECORDINGPATH": "Enter the path where to store screen recording files on the Agent computer (leave empty for default Video Folder path)",
"RTLSUPPORT": "Enables the RTL Support for Arabic, Persian and Hebrew languages",
"SEARCH_ON_ENTER_KEY": "Start searching only after the agent hits the Enter key",
"INTERACTIONS_RELOAD_TIMEOUT": "Time interval in seconds after which interactions are reloaded (0 = real-time update)",
"CLIENT_SECRET": "The secret will no longer be visible once the configuration is saved. Store it safely if you want to use it elsewhere.",
- "LIMIT_TABS": "Maximum number of possible interaction tabs open",
- "FILTER_FULLNAME": "Enable filter in Full Name field. Only numbers, letters, spaces and specific characters (_,-) will be supported"
+ "LIMIT_TABS": "Maximum number of possible interaction tabs open"
},
"ERRORS": {
"CHATTIMEOUT_REQUIRED": "Mandatory field",
"MICROSOFT_AUTHENTICATION_FAIL": "Si è verificato un errore durante l'autenticazione a Microsoft Identity Platform",
"UPDATE_CLIENT_SECRET": "Aggiorna segreto dell'applicazione",
"DISABLED_COOKIE": "Banner dei cookies",
- "FILTER_FULLNAME": "Nome completo",
- "FILTERS": "Filtri",
"HELP": {
"ADDRESS": "Indirizzo della rete",
"LOCALNETADDRESS": "Indirizzo IP/Subnet mask",
"SEARCH_ON_ENTER_KEY": "Avvia la ricerca soltanto quando l'agente preme il tasto Invio",
"INTERACTIONS_RELOAD_TIMEOUT": "Intervallo di tempo espresso in secondi dopo cui vengono ricaricate le interazioni (0 = aggiornamento real-time)",
"CLIENT_SECRET": "Il segreto non sarà più visibile una votla salvata la configurazione. Conservalo in un posto sicuro se vuoi usarlo altrove.",
- "LIMIT_TABS": "Numero massimo di tab interazione possibili aperte",
- "FILTER_FULLNAME": "Abilita il filtro nel campo Nome Completo. Verranno supportati solo numeri, lettere, spazi e caratteri specifici (_,-)"
+ "LIMIT_TABS": "Numero massimo di tab interazione possibili aperte"
},
"ERRORS": {
"CHATTIMEOUT_REQUIRED": "Campo obbligatorio",
"NOREPLYNUMBER_REQUIRED": "Mandatory field",
"BUSYNUMBER_REQUIRED": "Mandatory field",
"USERNAME_MUST_VALID_PATTERN": "Wrong format {{regex}}",
- "FULLNAME_MUST_VALID_PATTERN": "Wrong format {{regex}}",
- "CALLERID_MUST_VALID_PATTERN": "Wrong format {{regex}}",
"REMOTECONTROLPORT_REQUIRED": "Mandatory field",
"CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to",
"MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to",
"ENABLEAUTOMATICSCREENRECORDING": "The functionality is available only for voice channel",
"MASK_SENSITIVE_DATA": "Mask any sensitive data throughout the application (e.g. phone numbers and email addresses)",
"WSS_PORT": "Default: 8089",
- "AD_SSO_ENABLED": "Login in with your Active Directory credentials",
- "FILTERFULLNAME": "Only numbers, letters, spaces and specific characters (_,-) are supported"
+ "AD_SSO_ENABLED": "Login in with your Active Directory credentials"
},
"NEW_PASSWORD": "New Password",
"CONFIRM_PASSWORD": "Confirm Password",
"NOREPLYNUMBER_REQUIRED": "Campo obbligatorio",
"BUSYNUMBER_REQUIRED": "Campo obbligatorio",
"USERNAME_MUST_VALID_PATTERN": "Il campo deve avere un formato valido {{regex}}",
- "FULLNAME_MUST_VALID_PATTERN": "Il campo deve avere un formato valido {{regex}}",
- "CALLERID_MUST_VALID_PATTERN": "Il campo deve avere un formato valido {{regex}}",
"REMOTECONTROLPORT_REQUIRED": "Campo obbligatorio",
"CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Il valore introdotto deve essere superiore o uguale a",
"MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Il valore introdotto deve essere superiore o uguale a",
"WHATSAPPCAPACITY": "Numero massimo di interazioni di canale simultanee per agente (0 = illimitato)",
"MASK_SENSITIVE_DATA": "Maschera i dati sensibili in tutta l'applicazione (es. numeri di telefono e indirizzi email)",
"WSS_PORT": "Default: 8089",
- "AD_SSO_ENABLED": "Accedi con le tue credenziali di Active Directory",
- "FILTERFULLNAME": "Sono supportati solo numeri, lettere, spazi e caratteri specifici (_,-)"
+ "AD_SSO_ENABLED": "Accedi con le tue credenziali di Active Directory"
},
"NEW_PASSWORD": "Nuova Password",
"CONFIRM_PASSWORD": "Conferma Password",
<script src="assets/plugins/angular-material-form-builder/dist/angular-material-form-builder.min.js"></script>
<!-- ANGULAR-MATERIAL-FORM-BUILDER -->
- <script src="scripts/app.68483bd8.js"></script>
+ <script src="scripts/app.8170ac13.js"></script>
<!-- CKEDITOR -->
<script src="assets/plugins/ckeditor/ckeditor.js"></script>
-!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.client-side-logging",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","ui.router.state.events","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,n){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),n.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),n.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),n.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.realtime","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.motiondialer","app.help","app.jscripty","app.marketplace","app.plugins","app.video","app.whatsapp","app.login","app.forgot","app.reset","app.errors","app.user-setting","app.client-side-logging"])}(),function(){"use strict";function e(e,n){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),n.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Metrics",fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1201})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ExtractedReports",fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1202})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),n.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,n,a,i){var s;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:n.id}).then(function(e){var n=[];if((s=e).joins)try{s.joins=JSON.parse(s.joins);for(var t=0;t<s.joins.length;t+=1)n.push(i.getColumns(s.joins[t].foreignTable))}catch(e){console.log(e)}return a.all(n)}).then(function(e){for(var n=0;n<e.length;n+=1)s.joins[n].foreignTableFields=_.difference(_.keys(e[n]),["$promise","$resolved"]);return s})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1101})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareRecordings",fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadCallySquareRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1102})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),n.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},params:{crudPermissions:void 0},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("squareProject@get",{id:n.id})}],users:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Users",mergeResources:!0,fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",type:"inbound",fields:"id,name",sort:"name",nolimit:!0})}],sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"id,name",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,n){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),n.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:510})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",params:{channel:"chat"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",params:{channel:"chat"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"ChatQueues":void 0,channel:"chat",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadContactManagerLists",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,n){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,n){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver","Auth",function(e,n){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:304})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),n.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","Auth","$stateParams",function(e,n,t){return n.hasRole("admin")?e.resolve("cmContact@get",_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t)):e.resolve("userProfile@getResources",_.merge({id:n.getCurrentUser().userProfileId,section:"Contacts",includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t))}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],listsMap:["lists",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"id,name",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",params:{crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@get",{id:n.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHoppers",{id:n.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperFinals",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperHistories",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getJscriptySessions",{id:n.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get"):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies"})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,n){return n.ListId?e.resolve("cmList@getCustomFields",{id:n.ListId}):null}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{sort:"name"}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),n.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"VoiceQueues",mergeResources:!0,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return t=e,n.resolve("rpc@getVoiceQueues",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)t&&t.id===e.rows[n].id?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged,a.abandoned+=e.rows[n].abandoned):(a=_.find(t.rows,{id:e.rows[n].id}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged","abandoned"]));return t})}],faxAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("faxAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"FaxAccounts",mergeResources:!0,fields:"id,name",channel:"fax",nolimit:!0})).then(function(e){return t=e,n.resolve("faxInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].FaxAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].FaxAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],chatWebsites:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("chatWebsite@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"ChatWebsites",mergeResources:!0,fields:"id,name",channel:"chat",nolimit:!0})).then(function(e){return t=e,n.resolve("chatInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].ChatWebsiteId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.abandoned+=e.rows[n].abandoned,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].ChatWebsiteId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","abandoned","unmanaged"]));return t})}],smsAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("smsAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"SmsAccounts",mergeResources:!0,fields:"id,name",channel:"sms",nolimit:!0})).then(function(e){return t=e,n.resolve("smsInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].SmsAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].SmsAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],openchannelAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("openchannelAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"OpenchannelAccounts",mergeResources:!0,fields:"id,name",channel:"openchannel",nolimit:!0})).then(function(e){return t=e,n.resolve("openchannelInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].OpenchannelAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].OpenchannelAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],mailAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("mailAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"MailAccounts",mergeResources:!0,fields:"id,name",channel:"mail",nolimit:!0})).then(function(e){return t=e,n.resolve("mailInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].MailAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].MailAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],whatsappAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("whatsappAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"WhatsappAccounts",mergeResources:!0,fields:"id,name",channel:"whatsapp",nolimit:!0})).then(function(e){return t=e,n.resolve("whatsappInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].WhatsappAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].WhatsappAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth","$window",function(e,n,t,a){var i=t.getCurrentUser();return null===a.localStorage.getItem("motion2.user:"+i.id)&&a.localStorage.setItem("motion2.user:"+i.id,JSON.stringify({authenticationType:"google"})),t.isAgent()?n.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):n.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){return e.isAgent()?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,n){return e.resolve("user@getLists",{id:n.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver",function(e){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"id,name",type:"inbound",channel:"voice",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"id,name",type:"outbound",channel:"voice",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.chat",{url:"/chat",data:{selectedTab:2},views:{chat:{templateUrl:"app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",controller:"UserChatDashboardGeneralController as vm"}},resolve:{chatInteractions:["apiResolver",function(e){return e.resolve("chatInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,ChatWebsiteId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.mail",{url:"/mail",data:{selectedTab:3},views:{mail:{templateUrl:"app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",controller:"UserMailDashboardGeneralController as vm"}},resolve:{mailInteractions:["apiResolver",function(e){return e.resolve("mailInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,MailAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.sms",{url:"/sms",data:{selectedTab:4},views:{sms:{templateUrl:"app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",controller:"UserSmsDashboardGeneralController as vm"}},resolve:{smsInteractions:["apiResolver",function(e){return e.resolve("smsInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,SmsAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.openchannel",{url:"/openchannel",data:{selectedTab:5},views:{openchannel:{templateUrl:"app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",controller:"UserOpenchannelDashboardGeneralController as vm"}},resolve:{openchannelInteractions:["apiResolver",function(e){return e.resolve("openchannelInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,OpenchannelAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.fax",{url:"/fax",data:{selectedTab:6},views:{fax:{templateUrl:"app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",controller:"UserFaxDashboardGeneralController as vm"}},resolve:{faxInteractions:["apiResolver",function(e){return e.resolve("faxInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,FaxAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.whatsapp",{url:"/whatsapp",data:{selectedTab:7},views:{whatsapp:{templateUrl:"app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",controller:"UserWhatsappDashboardGeneralController as vm"}},resolve:{whatsappInteractions:["apiResolver",function(e){return e.resolve("whatsappInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,WhatsappAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),n.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:910})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",params:{channel:"fax"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",params:{channel:"fax"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"FaxQueues":void 0,channel:"fax",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",sort:"name",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.help",{abstract:!0,url:"/help"}),n.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1600,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZendeskAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SalesforceAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshdeskAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SugarcrmAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"DeskAccounts",fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZohoAccounts",fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts",{url:"/vtigerAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",controller:"VtigerAccountsController as vm"}},resolve:{vtigerAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VtigerAccounts",fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts.edit",{url:"/:id?tab",params:{vtigerAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/view.html",controller:"VtigerAccountController as vm"}},resolve:{vtigerAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts",{url:"/dynamics365Accounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",controller:"Dynamics365AccountsController as vm"}},resolve:{dynamics365Accounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dynamics365Accounts",fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts.edit",{url:"/:id?tab",params:{dynamics365Account:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",controller:"Dynamics365AccountController as vm"}},resolve:{dynamics365Account:["apiResolver","$stateParams",function(e,n){return e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts",{url:"/servicenowAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",controller:"ServicenowAccountsController as vm"}},resolve:{servicenowAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ServicenowAccounts",fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts.edit",{url:"/:id?tab",params:{servicenowAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/view.html",controller:"ServicenowAccountController as vm"}},resolve:{servicenowAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts",{url:"/freshsalesAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",controller:"FreshsalesAccountsController as vm"}},resolve:{freshsalesAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshsalesAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts.edit",{url:"/:id?tab",params:{freshsalesAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",controller:"FreshsalesAccountController as vm"}},resolve:{freshsalesAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}),n.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Projects",fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),n.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,provider,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,key,email,ListId,active,provider,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,provider,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver",function(e){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:603})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),n.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:610})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",params:{channel:"mail"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",params:{channel:"mail"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"MailQueues":void 0,channel:"mail",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",sort:"name",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.marketplace",{abstract:!0,url:"/marketplace"}).state("app.marketplace.plugins",{url:"/plugins",views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/plugins.html",controller:"MarketplacePluginsController as vm"}},resolve:{plugins:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Plugins",fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}).state("app.marketplace.plugins.edit",{url:"/:id?tab",params:{plugin:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/edit/view.html",controller:"MarketplacePluginController as vm"}},resolve:{plugin:["apiResolver","$stateParams",function(e,n){return e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}),n.addPart("app/main/apps/marketplace")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.marketplace",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,callAdditionalPhoneAfterMin,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,callAdditionalPhoneAfterMin,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder,callAdditionalPhoneAfterMin",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),n.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.hopperdate",{url:"/hopperdate",views:{"hopperdate@app":{templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",controller:"HopperdateController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1500,bodyClass:"motiondialer"})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.hopperdate",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1510})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"outbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",params:{channel:"voice",direction:"outbound"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"QueueCampaigns":void 0,channel:"voice",type:"outbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",params:{direction:"outbound"},controller:"QueueCallsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queue-calls/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,fields:"id,name",section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],voiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels",{type:"outbound"})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"name",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),n.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:810})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",params:{channel:"openchannel"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",params:{channel:"openchannel"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"OpenchannelQueues":void 0,channel:"openchannel",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.plugins",{abstract:!0,url:"/plugins"}),n.addPart("app/main/apps/plugins")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.plugins",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.plugins.plugin"]).config(e)}(),function(){"use strict";function e(e){e.state("app.plugins.plugin",{url:"/plugin/:id",views:{"content@app":{templateUrl:"app/main/apps/plugins/views/plugin/plugin.html",controller:"PluginController as vm"}},resolve:{},authenticate:!0,bodyClass:"plugins"})}e.$inject=["$stateProvider"],angular.module("app.plugins.plugin",[]).config(e)}(),function(){"use strict";angular.module("app.realtime",[])}(),function(){"use strict";function e(e,n){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,chatTimeout,phoneBarAutoUpdater,defaultScreenRecordingPath,phoneBarAutoUpdaterUrl,enableEmailPreview,split,splitSizeCsv,splitSizePdf,splitSizeXlsx,searchOnEnterKey,messagesAlignment,phoneBarRememberMeEnabled,rtlSupport,allowedLoginAttempts,blockDuration,loginMailFrequency,language,bucket,transcribe,transcribeRegion,transcribeAccountId,sentiment,sentimentRegion,sentimentAccountId,googleSsoEnabled,enforcePasswordHistory,passwordHistoryLimit,enablePrivacyPolicyEmail,privacyPolicyEmail,enablePrivacyPolicyName,privacyPolicyName,enablePrivacyPolicyNumber,privacyPolicyNumber,chatInteractionsReloadTimeout,mailInteractionsReloadTimeout,openchannelInteractionsReloadTimeout,smsInteractionsReloadTimeout,whatsappInteractionsReloadTimeout,stopRecordingOnTransfer,adSsoEnabled,disabledCookie,previewRecallmeReminderInterval,limitTabs,filterFullName",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,provider,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultFavicon,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle,defaultPreferred",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.cloudProviders",{url:"/cloudProviders",views:{"content@app":{templateUrl:"app/main/apps/settings/views/cloudProviders/cloudProviders.html",controller:"CloudProvidersController as vm"}},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}),n.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1400})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),n.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:710})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",params:{channel:"sms"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",params:{channel:"sms"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"SmsQueues":void 0,channel:"sms",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",role:"admin,user",sort:"-updatedAt",userSetting:!0,limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",role:"agent",sort:"-updatedAt",userSetting:!0,limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",role:"agent",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Teams",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:204})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}).state("app.staff.userProfiles",{url:"/userProfiles",views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/userProfiles.html",controller:"UserProfilesController as vm"}},resolve:{userProfiles:["apiResolver",function(e){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}).state("app.staff.userProfiles.edit",{url:"/:id?tab",params:{userProfile:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/edit/view.html",controller:"UserProfileController as vm"}},resolve:{userProfile:["apiResolver","$stateParams",function(e,n){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}),n.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CannedAnswers",fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1001})}]},authenticate:!0,permissionId:1001,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CustomDashboards",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,n){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,n){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1005})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Scheduler",fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1006})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1007})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1008})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1009})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,n){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1012})}]},authenticate:!0,permissionId:1012,bodyClass:"tools"}).state("app.tools.contact_item_types",{url:"/contact_item_types",views:{"content@app":{templateUrl:"app/main/apps/tools/views/contact_item_types/contact_item_types.html",controller:"ContactItemTypesController as vm"}},resolve:{contact_item_types:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("contactItemType@get",{fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ContactItemType",fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1013})}]},authenticate:!0,permissionId:1013,bodyClass:"tools"}),n.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.tools.dispositions","app.tools.triggers"]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.dispositions",{url:"/dispositions",views:{"content@app":{templateUrl:"app/main/apps/tools/views/dispositions/dispositions.html",controller:"DispositionsController as vm"}},resolve:{dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1002})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.dispositions",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Triggers",fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,n){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.triggers",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.video",{abstract:!0,url:"/video"}).state("app.video.screenRecordings",{url:"/screenRecordings",views:{"content@app":{templateUrl:"app/main/apps/video/views/screenRecordings/screenRecordings.html",controller:"ScreenRecordingsController as vm"}},resolve:{screenRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("screenRecording@get",{fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ScreenRecordings",fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadScreenRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2001})}]},authenticate:!0,permissionId:2001,bodyClass:"video"}),n.addPart("app/main/apps/video")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.video",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.inboundRoutes",{url:"/inboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InboundRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundRoutes.edit",{url:"/:id?tab",params:{inboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.inboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.internalRoutes",{url:"/internalRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/internalRoutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InternalRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalRoutes.edit",{url:"/:id?tab",params:{internalRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.internalRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.outboundRoutes",{url:"/outboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OutboundRoutes",fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundRoutes.edit",{url:"/:id?tab",params:{outboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.outboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:411})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"inbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"fullname",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"id,fullname,userpic,internal",role:"telephone",sort:"fullname",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queues",{url:"/queues",params:{channel:"voice",direction:"inbound"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"VoiceQueues":void 0,channel:"voice",type:"inbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",params:{direction:"inbound"},controller:"QueueCallsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queue-calls/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,fields:"id,name",section:"VoiceQueues",channel:"voice",type:"inbound",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],voiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels",{type:"inbound"})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"name",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:411})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:405})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Voicemails",fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MusicOnHolds",fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceRecordings",fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.voiceRecordings.edit",{url:"/:id?tab",params:{voiceRecording:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/edit/view.html",controller:"VoiceRecordingController as vm"}},resolve:{voiceRecording:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChanSpies",fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:409})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}).state("app.voice.voicePrefixes",{url:"/voicePrefixes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",controller:"VoicePrefixesController as vm"}},resolve:{voicePrefixes:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voicePrefix@get",{fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoicePrefixes",fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:410})}]},authenticate:!0,permissionId:410,bodyClass:"voice"}),n.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.inboundRoutes","app.voice.outboundRoutes","app.voice.internalRoutes","app.voice.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.whatsapp.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/realtime/realtime.html",controller:"WhatsappRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2110})}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.agents",{url:"/agents",params:{channel:"whatsapp"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.queues",{url:"/queues",params:{channel:"whatsapp"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"WhatsappQueues":void 0,channel:"whatsapp",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2110})}e.$inject=["$stateProvider"],angular.module("app.whatsapp.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.whatsapp",{abstract:!0,url:"/whatsapp"}).state("app.whatsapp.whatsappQueues",{url:"/whatsappQueues",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",controller:"WhatsappQueuesController as vm"}},resolve:{whatsappQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappQueues.edit",{url:"/:id?tab",params:{whatsappQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",controller:"WhatsappQueueController as vm"}},resolve:{whatsappQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts",{url:"/whatsappAccounts",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",controller:"WhatsappAccountsController as vm"}},resolve:{whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts.edit",{url:"/:id?tab",params:{whatsappAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",controller:"WhatsappAccountController as vm"}},resolve:{whatsappAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}),n.addPart("app/main/apps/whatsapp")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.whatsapp",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.whatsapp.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,n){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),n.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";angular.module("app.user-setting",[])}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e){e.onBefore({to:function(e){return!0===e.authenticate}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;return n.isLoggedIn()?n.retrieveUser().catch(function(){return t.target("app.login",void 0,{reload:!0})}):t.target("app.login",void 0,{reload:!0})}),e.onStart({to:function(e){return"app.login"!==e.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("agent")&&"app.dashboards.general"!=a.name)return t.target("app.dashboards.general",{redirect:!1},{reload:!0})}),e.onFinish({to:function(e){return"app.help"===e.parent.name}},function(e){var n=e.router.stateService;if("app.help"===e.$to().parent.name){var t=e.injector().get("settingsManager"),a=t?t.get():null;if(!a||!a.viewHelpSection)return n.target("app.dashboards.general",{redirect:!1},{reload:!0})}}),e.onFinish({to:function(e){return e.permissionId}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("user")){if(!n.hasPermission(a.permissionId))return t.target("app.dashboards.general",{redirect:!1},{reload:!0});var i=e.params().id?Number(e.params().id):void 0;if(i)return n.hasResourcePermission(a.permissionId,i).catch(function(){return t.target(a.parent.name,{redirect:!1},{reload:!0})})}}),e.onFinish({to:function(e){return"app.dashboards.general"===e.parent.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;e.$to();if(n.hasRole("user")&&!n.hasPermission(100))return t.target("app.dashboards.general",{redirect:!1},{reload:!0})})}e.$inject=["$transitions"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(a,e,o,i,s,r,l,d,c){var m;return{getToken:n,getCurrentUser:u,getPermissions:A,hasChildrenPermissions:function(e){return!!e&&_.some(e,function(e){return t(e)})},hasModulePermissions:function(i){return o(function(a,n){f()?a(!0):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a(!1);else{var t=_.filter(n,function(e){return e.enabled});a(_.some(t,["category",i]))}}).catch(function(e){n(e)})})},hasModulesPermissions:function(s){return o(function(a,n){var i={};f()?(s.forEach(function(e){i[e]=!0}),a(i)):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a({});else{var t=_(n).filter(function(e){return e.enabled&&_.includes(s,e.category)}).uniqBy(function(e){return e.category}).map(function(e){return e.category}).value();t.forEach(function(e){i[e]=!0}),a(i)}}).catch(function(e){n(e)})})},hasRole:function(e){return!!m&&m.role===e},hasPermission:t,hasResourcePermission:function(e,s){return o(function(a,i){return r.userProfileSection.get({userProfileId:m.userProfileId,sectionId:e}).$promise.then(function(e){var n=e.rows[0];if(n.autoAssociation)return a();var t=l.getActiveItem().node;return t.permissions&&!1===t.permissions.association?a():r.userProfileResource.get({sectionId:n.id,nolimit:!0}).$promise.then(function(e){var n=e.rows;_.some(n,["resourceId",s])?a():i()})}).catch(function(e){i("Error retrieving user profile permissions",e)})})},hasSectionPermissions:function(a){return o(function(e,n){var t={};return E().then(function(){_.includes(m.permissions,a)&&(t[a]=!0),e(t)}).catch(function(e){n(e)})})},hasSectionsPermissions:function(a){return o(function(e,n){var t={};if(!f())return E().then(function(){a.forEach(function(e){_.includes(m.permissions,e)&&(t[e]=!0)}),e(t)}).catch(function(e){n(e)});a.forEach(function(e){t[e]=!0}),e(t)})},isAgent:h,isAdmin:f,isLoggedIn:function(){return!!n()},isTelephone:function(){return"telephone"===m.role},isUser:b,login:function(e){return o(function(n,t){r.auth.local(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("LOCAL_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})},logout:function(t){return o(function(e,n){t?(v(),e()):o.resolve().then(function(){return h()&&0!==m.showWebBar?o(function(e,n){r.user.logout({id:m.id,device:"web"}).$promise.then(function(){e()}).catch(function(e){n(e)})}):f()||b()?g(!1):void 0}).then(function(){v(),e()}).catch(function(e){n(e)})})},parseCrudPermissions:function(e){return f()?{readOnly:!1,canEdit:!0,canDelete:!0}:e?{readOnly:!(!_.includes(e,"r")||1!==e.length),canEdit:!!_.includes(e,"e"),canDelete:!!_.includes(e,"d")}:{readOnly:!0,canEdit:!1,canDelete:!1}},queueLogin:p,reloadPermissions:E,removeCookies:v,retrieveUser:function(){return o(function(n,t){r.user.whoami({userSetting:!0}).$promise.then(function(n){return"user"===n.role?A(n.userProfileId).then(function(e){return n.permissions=e,n}):n}).then(function(e){n(m=e)}).catch(function(e){t(e)})})},setCurrentUser:function(e){m=_.merge(m,e)},getAuthenticationType:function(){var e=u(),n=i.localStorage.getItem("motion2.user:"+e.id);if(n)return JSON.parse(n).authenticationType;return"NONE"},loginSSO:function(e){"google"!==e&&y("SSO_LOGIN");return"/api/auth/"+e},loginAD:function(e){return o(function(n,t){r.auth.activedirectory(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("SSO_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})},setMessengerSoundNotification:function(e){u().messengerSoundNotification=e}};function n(){return e.get("motion.token")}function u(){return m}function p(e){return o(function(n,t){r.user.login({id:m.id,device:"web",intrf:e}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function g(a){return o(function(n,t){var e={online:a,lastLoginAt:a?moment().format("YYYY-MM-DD HH:mm:ss"):void 0};r.user.update({id:m.id},e).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function v(){e.remove("motion.token"),m&&(i.localStorage.removeItem("motion.user:"+m.id),m=null)}function h(){return"agent"===m.role}function f(){return"admin"===m.role}function b(){return"user"===m.role}function t(e){return!!m&&_.includes(m.permissions,e)}function A(e){var a=[];return o(function(n,t){return e||n(a),r.userProfile.getSections({id:e}).$promise.then(function(e){for(var n=0;n<e.length;n++){var t=e[n];a.push(t.sectionId),t.subsections&&(a=_.concat(a,t.subsections))}return a}).then(function(e){n(e)}).catch(function(e){t("Error retrieving user profile permissions",e)})})}function E(){return o(function(n,t){A(m.userProfileId).then(function(e){m.permissions=e,n()}).catch(function(e){t(e)})})}function y(e){var n=u(),t={authenticationType:e};i.localStorage.setItem("motion2.user:"+n.id,JSON.stringify(t))}}e.$inject=["$mdDialog","$cookies","$q","$window","$document","api","msNavigationService","settingsManager","jscookie"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(n,e){this.telephones=e,this.closeDialog=function(e){n.hide(e)},e.count&&(this.name=e.rows[0].name)}e.$inject=["$mdDialog","telephones"],angular.module("app.auth").controller("HotDeskDialogController",e)}(),function(){"use strict";function e(n,t,a,i,s){var o;return{request:function(e){var n=a.get("motion.token");return e.headers=e.headers||{},s.isSameOrigin(e.url)&&n&&(e.headers.Authorization="Bearer "+n),e},responseError:function(e){switch(e.status){case 401:a.remove("motion.token"),n.$broadcast("webrtc::logout"),(o||(o=i.get("$state"))).go("app.login")}return t.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(n){var t={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var n=document.createElement("a");return n.href=e,""===n.host&&(n.href=n.href),n},isSameOrigin:function(i,e){return i=t.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(t.urlParse)).push(n.location),1<=(e=e.filter(function(e){var n=i.hostname===e.hostname,t=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return n&&t&&a})).length}};return t}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";function e(e,n,t){var a={initLogger:function(){return i.init({uri:t.baseUrl+"logs/client-logs",initial_state_name:"client-logs",flushInterval:6e4,debounceInterval:10,sizeLimit:300,silent:!1,autoLog:["error"],heartbeat:!1,logUnload:!1,logPerformance:!1}),i.addHeaderBuilder(function(){return(e=n.get("motion.token"))?{Authorization:"Bearer "+e}:{};var e}),i}},i=e.$logger;if(!i)throw new Error("Beaver Logger not found");return a}function n(d,e,t){var n={getLogger:function(l){var e=function(r){return function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n[0],i=n.slice(1),s="string"!=typeof a||"string"==typeof a&&0===i.length?l:a,o=1<n.length&&"string"==typeof a?i:n;(function(e,n,t){if(!d.isLoggedIn())return;var a=d.getCurrentUser();if(!a||!a.userSetting.clientSideLoggingEnabled)return;if(i=e,!(c.indexOf(i)>=c.indexOf(m)))return;var i;var s=n,o=t;"string"==typeof n&&void 0===t&&(s=e,o=n);u[e].call(u,s,{data:p(o)})}).call(this,r,s,o)}};return{error:e("error"),warn:e("warn"),info:e("info"),debug:e("debug")}},getLoggingColors:function(){return{disabled:{color:"#616161"},debug:{color:"#283593"},info:{color:"#000000"},warning:{color:"#FBC02D"},error:{color:"#FF5252"}}},flush:a},c=["debug","info","warn","error"],m="debug",u=e.initLogger();function p(t){return Array.isArray(t)?t.map(p):null===t||"object"!=typeof t?t:_.isPlainObject(t)?t:t&&"function"==typeof t.toJSON?t.toJSON():t instanceof Error?Object.getOwnPropertyNames(t).reduce(function(e,n){return e[n]=p(t[n]),e},{}):JSON.parse(JSON.stringifyOnce(t))}function a(){return u.flush()}return t.$on("local:user-setting-updated",function(e,n){n.clientSideLoggingEnabled?t.$broadcast("client-side-logging:enabled"):(a(),t.$broadcast("client-side-logging:disabled")),m=n.clientSideLoggingLevel}),t.$on("local:user-logout",function(){m="debug"}),JSON.stringifyOnce=function(i,s,e){var o=[],r=[];return e||(e=2),JSON.stringify(i,function(e,t){if(2e3<o.length)return"object too long";var a=!1;if(o.forEach(function(e,n){e===t&&(a=n)}),""==e)return o.push(i),r.push("root"),t;if(a+""!="false"&&"object"==typeof t)return"root"==r[a]?"(pointer to root)":"(see "+(t&&t.constructor?t.constructor.name.toLowerCase():typeof t)+" with key "+r[a]+")";var n=e||"(empty key)";return o.push(t),r.push(n),s?s(e,t):t},e)},n}e.$inject=["$window","$cookies","api"],n.$inject=["Auth","clientSideLogger","$rootScope"],angular.module("app.client-side-logging").factory("clientSideLogger",e).service("ClientSideLoggingService",n)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var t={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(t[e]))return!1;return t[e]},setConfig:function(e,n){t[e]=n}};return e}})}(),function(){"use strict";function e(e,n,t){n.debugEnabled(!0),e.config({tabindex:!1}),t.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0})}e.$inject=["$ariaProvider","$logProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,n,t){(n.generate(),t.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(n,e,t,a,i,s){var l=this;function o(){var e=_.filter(l.searchOptions.conditions,["disabled",!1]),o=[],r="";if(_(e).groupBy("name").forEach(function(e){var n=e[0],t=1<e.length,a=n.query.column;if(t){var i=_(e).groupBy(function(e){return e.query.operator}).mapValues(function(e){return _.chain(e).map(function(e){return e.query.value}).flattenDeep().value()}).value(),s=[];_.keys(i).forEach(function(e){var n=i[e],t=e;_.includes(["$between","$in","$notIn"],e)?t+="["+n+"]":n.forEach(function(e){t+="["+e+"]"}),s.push(t)}),r+=a+":="+s.join(":=")}else r=a+":="+n.query.operator+"["+n.query.value+"]";o.push(r)}),0!==o.length){var n="["+l.searchOptions.matchType+"]";return n+=o.join("||")}}function r(){var e=n.localStorage.getItem("motion2."+s+":"+l.currentUser.id);return e?JSON.parse(e):{}}function d(e){n.localStorage.setItem("motion2."+s+":"+l.currentUser.id,JSON.stringify(e))}function c(){if(s){var e=r();e.advancedSearch=_.omit(l.searchOptions,"fields"),d(e)}}function m(){return!!r().advancedSearch}l.currentUser=t.getCurrentUser(),l.searchOptions={matchType:"$and",conditions:[],fields:i},l.toolbarColor=a,l.onInit=function(){if(s){var e=r();e.hasOwnProperty("advancedSearch")&&(l.searchOptions=_.merge(l.searchOptions,e.advancedSearch))}},l.applyFilter=function(){c(),e.hide({apply:!0,value:o()})},l.clearConditions=function(){l.searchOptions.conditions=[],function(){if(s){var e=r();delete e.advancedSearch,e.query&&delete e.query.search,d(e)}}()},l.minimize=function(){c(),e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})},l.close=function(){e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})}}e.$inject=["$window","$mdDialog","Auth","color","fields","storagePath"],angular.module("app.core").controller("AdvancedSearchController",e)}(),function(){"use strict";function e(a){return{restrict:"A",link:function(e,n,t){e.$watch(t.focusOn,function(e){a(function(){e?n[0].focus():n[0].blur()})})}}}e.$inject=["$timeout"],angular.module("app.core").directive("focusOn",e)}(),function(){"use strict";function e(o,l,d){return{restrict:"E",compile:function(e,n){var s;return n.code||(s=e.html(),e.empty()),function(t,a,r){r.code&&(s=t.$eval(r.code));var i=t.$eval(r.shouldInterpolate);l.when(s).then(function(e){if(e){i&&(e=d(e)(t));var n=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(n),o(function(){!function(e,n){var t=n.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],s=new RegExp("^"+i);a=a.map(function(e){return e.replace(s,"").replace(/\s+$/,"")});var o=hljs.highlight(r.language||r.lang,a.join("\n"),!0);o.value=o.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),t.append(o.value).addClass("highlight")}(e,n)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";function e(n,a,e,t){var o=this;function i(){var a=o.selectedField.options&&!_.isEmpty(o.selectedField.options.extraOperators),i=o.selectedField.options&&!_.isEmpty(o.selectedField.options.excludedOperators);o.availableOperators=_.filter(o.operators,function(n){var e=!n.applyTo||_.includes(n.applyTo,o.selectedField.type);n.isExtra=a&&_.some(o.selectedField.options.extraOperators,function(e){return e===n.type});var t=_.includes(n.excludeFrom,o.selectedField.type)||i&&_.includes(o.selectedField.options.excludedOperators,n.type);if((e||n.isExtra)&&!t)return n})}function s(n){return e[n.model][n.action](n.params).$promise.then(function(e){return e.rows}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:n.model.toUpperCase()+"."+n.action.toUpperCase(),msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function r(){!o.value||_.isArray(o.value)&&_.isEmpty(o.value)?o.isValidCondition=!1:o.selectedOperator?o.selectedOperator&&"$between"===o.selectedOperator.type?o.isValidCondition=!(!o.endRangeValue||!o.isValidRange):o.isValidCondition=!0:o.isValidCondition=!1}function l(){"number"===o.selectedField.type?_.isNumber(o.endRangeValue)?o.isValidRange=Number(o.endRangeValue)>Number(o.value):o.isValidRange=!0:"date"===o.selectedField.type&&(o.maxDateRange=moment(o.endRangeValue).subtract(1,"day"),o.isValidRange=!0),r()}function d(){var e=m();o.options.conditions.push(e),p()}function c(){var e=m(),n=_.findIndex(o.options.conditions,"style");o.options.conditions.splice(n,1,e),p(),o.pendingCondition.style=null,o.pendingCondition=void 0}function m(){return{name:o.selectedField.name,operator:n.instant("DASHBOARDS."+o.selectedOperator.translate),value:o.value,endValue:o.endRangeValue,displayValue:u(o.value),displayEndValue:u(o.endRangeValue),query:{column:o.selectedField.column,operator:o.selectedOperator.type,value:function(){var e,n=o.value,t=o.endRangeValue;switch(o.selectedField.type){case"date":var a=moment(n).utcOffset(0,!0).format("YYYY-MM-DD");if("$between"===o.selectedOperator.type){var i=moment(t).utcOffset(0,!0).format("YYYY-MM-DD");e=[a,i]}else e=a;break;case"number":e="$between"===o.selectedOperator.type?[n,t]:n;break;case"multiselect":var s=o.selectedField.options.field||"name";e=_.map(n,s);break;case"select":e=n.id;break;case"autocomplete":e=o.selectedOperator.isExtra?n:n.id;break;default:e=n}return e}()},disabled:!1}}function u(e){var n;if(e){switch(o.selectedField.type){case"date":n=moment(e).format("YYYY-MM-DD");break;case"multiselect":var t=_.map(e,function(e){return e.name});n="$eq"===o.selectedOperator.type?t.join(" or "):t.join(" and ");break;case"select":n=e.name;break;case"autocomplete":n=o.selectedOperator.isExtra?e:e.displayValue;break;default:n=e}return n}}function p(){o.value=null,o.endRangeValue=null,o.minDateRange=null,o.maxDateRange=null,o.isValidCondition=!1}o.operators=o.availableOperators=[{type:"$eq",symbol:"=",translate:"EQUALS",excludeFrom:["multiselect"]},{type:"$ne",symbol:"≠",translate:"IS_NOT_EQUAL",excludeFrom:["multiselect"]},{type:"$in",symbol:"∈",translate:"IS_AMONG",applyTo:["multiselect"]},{type:"$notIn",symbol:"∉",translate:"IS_NOT_AMONG",applyTo:["multiselect"]},{type:"$substring",symbol:"⊃",translate:"CONTAINS",applyTo:["text"]},{type:"$startsWith",symbol:"a..",translate:"STARTS_WITH",applyTo:["text"]},{type:"$endsWith",symbol:"..a",translate:"ENDS_WITH",applyTo:["text"]},{type:"$lt",symbol:"<",translate:"IS_LESS_THAN",applyTo:["date","number"]},{type:"$gt",symbol:">",translate:"IS_GREATER_THAN",applyTo:["date","number"]},{type:"$lte",symbol:"≤",translate:"IS_LESS_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$gte",symbol:"≥",translate:"IS_GREATER_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$between",symbol:"≬",translate:"IS_BETWEEN",applyTo:["date","number"]}],o.addCondition=d,o.editCondition=function(e){o.pendingCondition=e,o.pendingCondition.style="md-amber-200-bg",o.selectedField=_.find(o.options.fields,["name",o.pendingCondition.name]),i(),o.selectedOperator=_.find(o.availableOperators,["type",o.pendingCondition.query.operator]),"date"===o.selectedField.type&&"string"==typeof o.pendingCondition.value?(o.value=new Date(o.pendingCondition.value),o.minDateRange=moment(o.value).add(1,"day"),o.endRangeValue=o.pendingCondition.endValue?new Date(o.pendingCondition.endValue):void 0):(o.value=o.pendingCondition.value,o.endRangeValue=o.pendingCondition.endValue);o.isValidRange=!0,o.isValidCondition=!0},o.updateCondition=c,o.cancelUpdateCondition=function(){o.pendingCondition.style=null,o.pendingCondition=void 0},o.setConditionStatus=function(e){e.style=e.disabled?void 0:"chip-disabled",e.disabled=!e.disabled},o.removeCondition=function(){_.isEmpty(o.options.conditions)&&o.clearFilter()},o.getValues=function(){return o.selectedField.options.routes&&Array.isArray(o.selectedField.options.routes)?(e=angular.copy(o.selectedField.options.routes).map(function(e){return s(e)}),a.all(e).then(function(e){o.selectedField.values=_.flatten(e)})):o.selectedField.options.route?function(){var e=angular.copy(o.selectedField.options.route);if("autocomplete"===o.selectedField.type)for(var n=0;n<Object.keys(e.params).length;n++){var t=Object.keys(e.params)[n];"@autocomplete"===e.params[t]&&(e.params[t]=o.searchText,e.params.autocomplete=!0)}return a.resolve().then(function(){if(!o.selectedField.values||!0===e.params.autocomplete)return s(e)}).then(function(e){return e&&(o.selectedField.values=e),"autocomplete"===o.selectedField.type?function(e){var n=[];o.searchText&&(n=e.filter(function(e){e.displayValue="";for(var n=0;n<o.selectedField.options.searchFields.length;n++){var t=o.selectedField.options.searchFields[n],a=e[t]||"";e.displayValue+=a+" "}return _.trimEnd(e.displayValue),e.displayValue.toLowerCase().includes(o.searchText.toLowerCase())}));return n}(o.selectedField.values):o.selectedField.values})}():(o.selectedField.values.forEach(function(e){e.translate&&(e.name=n.instant(e.translate))}),o.selectedField.values);var e},o.onFieldChange=function(){o.value=void 0,o.endRangeValue=void 0,o.searchText=void 0,o.isValidCondition=!1,i(),o.autoSelectOperator=1===o.availableOperators.length,o.autoSelectOperator||(o.selectedOperator=void 0)},o.onOperatorChange=function(e){o.isValidRange=!0,o.selectedOperator&&(e?e.applyTo?0<_.difference(o.selectedOperator.applyTo,e.applyTo).length&&(o.value=null):o.selectedOperator.applyTo&&(o.value=null):o.value||(o.value=null),"between"!=o.selectedOperator.type&&(o.endRangeValue=null),o.selectedField.options&&!_.isEmpty(o.selectedField.options.extraOperators)&&(o.selectedOperator.isExtra=_.some(o.selectedField.options.extraOperators,function(e){return e===o.selectedOperator.type})));r()},o.onValueChange=function(){o.selectedOperator&&"$between"===o.selectedOperator.type?"number"===o.selectedField.type?l():"date"===o.selectedField.type&&(o.minDateRange=moment(o.value).add(1,"day"),r()):r()},o.checkRange=l,o.handleKeyboardAction=function(){o.pendingCondition?c():d()}}e.$inject=["$translate","$q","api","toasty"],angular.module("app.core").directive("msAdvancedSearch",function(){return{restrict:"E",scope:{options:"=",clearFilter:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-advanced-search/ms-advanced-search.html"}})}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,n){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",n)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msChipColor",function(){return{restrict:"A",link:function(e,i,n){n.$observe("msChipColor",function(e){var n=i.parent().parent();if(n.hasClass("md-background-bg md-hue-3")||n.addClass("md-background-bg md-hue-3"),_.isEmpty(e)){var t=n[0].className.split(" "),a=t.indexOf("md-hue-3");t.length=a+1,n[0].className=t.join(" ")}else n.addClass(e)})}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","$document","$mdDialog","Auth","toasty","api",function(t,n,a,i,s,o,e,r,l){function d(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+c(e));case 2:return n.$broadcast("webrtc::call",{target:c(e)})}}function c(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function m(e){return a.get(e).success(function(){r.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){r.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}t.currentUser=e.getCurrentUser(),t.privacy=t.currentUser.privacyEnabled,t.showMenu=function(){return t.target&&t.target.indexOf("@")<0&&t.target!=t.currentUser.internal&&t.target!=t.currentUser.name&&(0==t.currentUser.showWebBar&&t.currentUser.phoneBarRemoteControl||2==t.currentUser.showWebBar&&t.license.webrtc)&&!t.disabled},t.call=function(e){return 2!==t.currentUser.showWebBar?(n=e,l.user.getVoicePrefixes({id:t.currentUser.id}).$promise.then(function(e){if(e.count)return o.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{prefixes:e,required:t.currentUser.phoneBarPrefixRequired}})}).then(function(e){t.currentUser.phoneBarPrefixRequired?e&&-1!==e&&d(e+n):e&&-1!==e?d(e+n):e||d(n)})):d(e);var n},t.transfer=function(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+c(e));case 2:n.$broadcast("webrtc::transfer",{target:c(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";n.$inject=["ClientSideLoggingService","$rootScope","$translate"];var e={bindings:{user:"<"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html"};function n(e,n,t){var a=this,i=e.getLoggingColors();function s(){a.tooltipHTML=a.user.userSetting.clientSideLoggingEnabled?[t.instant("STAFF.CLIENT_LOGS_ENABLED"),t.instant("STAFF.CLIENT_LOGS_LOGLEVEL",{logLevel:a.user.userSetting.clientSideLoggingLevel}),t.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(a.user.userSetting.clientSideLoggingEnabledSince).format("LLLL")})].join("<br>"):t.instant("STAFF.CLIENT_LOGS_DISABLED")}a.tooltipHTML=t.instant("STAFF.CLIENT_LOGS_DISABLED"),a.styleColor=i.disabled,a.styleIcon=a.user.userSetting&&a.user.userSetting.clientSideLoggingEnabled?"icon-checkbox-marked-circle":"icon-close",a.$onInit=function(){if(!a.user.userSetting)return;var e=a.user.userSetting.clientSideLoggingEnabled?a.user.userSetting.clientSideLoggingLevel:"disabled";a.styleColor=i[e],"info"===e&&(a.styleIcon="icon-checkbox-marked-circle-outline");return s()},a.$onDestroy=function(){o()};var o=n.$on("$translateChangeSuccess",s)}angular.module("app.core").component("msClientSideLoggingIcon",e)}(),function(){"use strict";n.$inject=["ClientSideLoggingService","UserSettingService","$q","$translate","$rootScope","$interval"];var e={bindings:{user:"<",onUserUpdate:"&"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging.html"};function n(e,t,n,a,i,s){var o=this,r=e.getLoggingColors(),l=null;function d(){l&&s.cancel(l)}o.styleProperties=r.disabled,o.clientSideLoggingEnabledSince="",o.$onInit=function(){m().then(function(){d(),l=s(u,6e4)})},o.$onChanges=function(e){e&&n.resolve().then(m)},o.$onDestroy=function(){d(),c()},o.onEnabledSwitchChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;return p(e,n)},o.onLogLevelSelectionChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;p(e,n)},o.computeStyleForLoggingLevel=function(e){return r[e]};var c=i.$on("$translateChangeSuccess",u);function m(){o.availableClientSideLoggingLevels=Object.keys(r).filter(function(e){return"disabled"!==e});var e=o.user.userSetting&&o.user.userSetting.clientSideLoggingEnabled?o.user.userSetting.clientSideLoggingLevel:"disabled";return o.styleProperties=r[e],u()}function u(){if(o.user.userSetting)return o.user.userSetting.clientSideLoggingEnabled?void(o.clientSideLoggingEnabledSince=a.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(moment(o.user.userSetting.clientSideLoggingEnabledSince).format()).fromNow()})):o.clientSideLoggingEnabledSince=""}function p(e,n){return t.updateUserSettingById(o.user.userSetting.id,{clientSideLoggingEnabled:e,clientSideLoggingLevel:n}).then(function(){"function"==typeof o.onUserUpdate&&o.onUserUpdate()})}}angular.module("app.core").component("msClientSideLogging",e)}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,n,t,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var n={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){return n}}).directive("msDatepickerFix",e)}(),function(){"use strict";function e(s){return{restrict:"E",scope:{id:"=",model:"=",element:"=",title:"=",path:"="},replace:!0,link:function(n,e){var t=!1,a={};a.id=n.id,_.isNil(n.path)||(a.path=n.path);var i=document.createElement(n.element);i.setAttribute("preload","none"),i.setAttribute("controls","true"),"audio"===n.element&&i.setAttribute("style","width: 265px;"),"video"===n.element&&i.setAttribute("style","max-width: 500px;"),i.setAttribute("title",n.title),i.setAttribute("src"," "),i.onplay=function(e){t||(t=!0,e.preventDefault(),s[n.model].download(a).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});i.setAttribute("type",e.type),i.setAttribute("src",URL.createObjectURL(t)),i.play()}).catch(function(e){console.error(e)}))},e.append(i)}}}e.$inject=["api"],angular.module("app.core").directive("msDialogRecording",e)}(),function(){"use strict";function e(i){return{restrict:"A",link:function(t,a){a.bind("click",function(e){var n=i('<div layout="row" class="spinner-overlay" layout-sm="column" layout-align="center center" aria-label="wait"><md-progress-circular md-mode="indeterminate"></md-progress-circular></div>')(t);a.closest("md-dialog").prepend(n)})}}}e.$inject=["$compile"],angular.module("app.core").directive("msDialogSpinner",e)}(),function(){"use strict";function e(){var o=this;function a(e,n,t,a){var i=[];if(0<=t)i.push(e[t]),n.push(e[t]),e.splice(t,1);else{for(var s=0;s<e.length;s++)void 0!==e[s].isValid&&e[s].isValid&&n.push(e[s]);for(s=e.length-1;0<=s;s--)e[s].isValid&&e.splice(s,1);i=n}o.options.transferCallback&&o.options.transferCallback(i,a)}o.canTransfer=function(e,n,t){if(void 0!==e.isValid&&e.isValid)return t?a(n.selectedItems,n.items,n.selectedItems.indexOf(e),t):a(n.items,n.selectedItems,n.items.indexOf(e),t)},o.transfer=a,o.getLine=function(e,n){var t="";if(_.isNil(n))return t;{if(_.isArray(n)){for(var a=0;a<n.length;a++)t+=" "+(e[n[a]]?e[n[a]]:"");return t}return e[n]?e[n]:""}}}angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"=",readOnly:"=",addDisabled:"<"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(a){return{restrict:"E",replace:!0,scope:{onReply:"&",ngModel:"=",ctrlMethods:"=",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<textarea class="emojionearea"></textarea>',link:function(t,e){var n=e.emojioneArea({pickerPosition:t.pickerPosition,search:t.search,recentEmojis:t.recentEmojis,placeholder:a.instant(t.placeholder||"Type a message"),attributes:{spellcheck:!0},events:{keyup:function(e,n){t.ngModel=this.getText(),t.onReply({event:n,body:this.getText()})},emojibtn_click:function(){t.ngModel=this.getText()}}});t.ngModel&&n[0].emojioneArea.setText(t.ngModel),t.internalControl=t.ctrlMethods||{},t.internalControl.setText=function(e){n[0].emojioneArea.setText(e)},t.internalControl.getText=function(){return n[0].emojioneArea.getText()},t.$watch("ngModel",function(e){e||n[0].emojioneArea.setText("")})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Century Gothic",value:"Century Gothic,Futura,Didact Gothic,san-serif"},{option:"Calibri",value:"Calibri, Verdana, Geneva, sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var n=this;function e(){return n.forms.length}function t(){return 0===n.selectedIndex}function a(){return n.selectedIndex===e()-1}n.forms=[],n.selectedIndex=0,n.registerForm=function(e){n.forms.push(e)},n.previousStep=function(){if(t())return;n.selectedIndex--},n.nextStep=function(){if(a())return;n.selectedIndex++},n.firstStep=function(){n.selectedIndex=0},n.lastStep=function(){n.selectedIndex=e()-1},n.totalSteps=e,n.isFirstStep=t,n.isLastStep=a,n.currentStepInvalid=function(){return angular.isDefined(n.forms[n.selectedIndex])&&n.forms[n.selectedIndex].$invalid},n.previousStepInvalid=function(){return 0<n.selectedIndex&&angular.isDefined(n.forms[n.selectedIndex-1])&&n.forms[n.selectedIndex-1].$invalid},n.formsIncomplete=function(){for(var e=0;e<n.forms.length;e++)if(n.forms[e].$invalid)return!0;return!1},n.resetForm=function(){for(var e=n.selectedIndex=0;e<n.forms.length;e++)n.forms[e].$setPristine(),n.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,n,t,a){var i=a[0],s=a[1];s.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,n){var t=i.find("ms-info-bar-active"),a="ms-info-bar-active";t.addClass(a),e.removeInfoBar=function(){t.removeClass(a),n.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,n={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},t=!0;function i(){t&&e.cancel(t),t=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),n=0;n<d.items.length;n++){var t,a,i,s,o=d.items[n];(o=angular.element(o)).scope()&&o.scope().$broadcast("msMasonryItem:startReLayout"),o.css({width:d.columnWidth}),d.options.respectItemOrder?(i=n%d.columnCount,s=e[i]):(s=Math.min.apply(Math,e),i=e.indexOf(s)),e[i]=s+o[0].getBoundingClientRect().height,t=Math.round(i*d.columnWidth),a=s,o.css({transform:"translate3d("+t+"px,"+a+"px,0px)"}),o.addClass("placed"),o.scope()&&o.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(n,d.options):n,r.$watch(function(){return d.container.width()},function(e,n){e!==n&&i()})},d.waitImagesLoaded=function(e,n){if("undefined"!=typeof imagesLoaded){var t=a.imagesLoaded(e);t.on("done",function(){n()})}else n()},r.$on("msMasonry:relayout",function(){i()})}function n(o){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,s){return{pre:function(e,n,t,a){a.options=angular.fromJson(s.options||"{}"),a.container=i},post:function(e,n,t,a){o(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",n).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,n,t,a){a.waitImagesLoaded(n,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return n.height()},function(e,n){e!==n&&a.reLayout()})}),n.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(t,e,a,i){var s=this;function o(e,n){s.selectedPalette=e,s.selectedHues=n}function r(){o(!(s.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,n){s.selectedColor={palette:e,hue:n,class:"md-"+e+"-"+n+"-bg",bgColorValue:i.rgba(s.palettes[e][n].value),fgColorValue:i.rgba(s.palettes[e][n].contrast)},"obj"!==s.msModelType||angular.equals(s.selectedColor,s.modelCtrl.$viewValue)||d(),o(e,s.palettes[e]),t.$selectedColor=s.selectedColor}function d(){"class"===s.msModelType?s.modelCtrl.$setViewValue(s.selectedColor.class):"obj"===s.msModelType&&s.modelCtrl.$setViewValue(s.selectedColor)}s.palettes=e,s.selectedPalette=!1,s.selectedHues=!1,t.$selectedColor={},s.activateHueSelection=o,s.selectColor=function(e,n){l(e,n),d(),a.hide()},s.removeColor=r,t.$watch("ngModel",function(){if(!s.modelCtrl.$viewValue||""===s.modelCtrl.$viewValue)return void r();var e,n;if("class"===s.msModelType){var t=s.modelCtrl.$viewValue.split("-");n=5<=t.length?(e=t[1]+"-"+t[2],t[3]):(e=t[1],t[2])}else"obj"===s.msModelType&&(e=s.modelCtrl.$viewValue.palette,n=s.modelCtrl.$viewValue.hue||500);l(e,n)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,n,t,a,i){var s=a[0];s.modelCtrl=a[1],s.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,n){return 1===n.nodeType})).length&&n.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,n,t){var a="true"===t.msNavIsFolded,i=!1,s=angular.element(p[0].body),o=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=n.parent();function d(){s.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),s.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(o).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),s.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){s.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),n.off("mouseenter mouseleave")}v.setFoldable(e,n,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){o.off("mouseenter touchstart"),r.off("mouseenter touchstart"),n.off("mouseenter mouseleave")})}}}function n(t,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){t.$broadcast("msNav::expandMatchingToggles");var n=t.$on("$stateChangeSuccess",function(){t.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){n()})}}}}function t(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,n){return e.addClass("ms-nav-toggle"),angular.isUndefined(n.collapsed)&&(n.collapsed=!0),e.attr("collapsed",n.collapsed),function(a,i,e,t){var s={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},n=i.find("a"),o=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var n=angular.element(i.find("ms-nav-toggle-items")[0]);n.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=n[0].offsetHeight;return n.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(n,{display:"block",height:"0px"},{height:t+"px"},s.expandAnimation).then(function(){n.addClass(s.expanded),n.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var n=angular.element(i.find("ms-nav-toggle-items")[0]),t=n[0].offsetHeight;return a.$evalAsync(function(){p.animate(n,{height:t+"px"},{height:"0px"},s.collapseAnimation).then(function(){n.removeClass(s.expanded),n.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(n,function(e){var n=angular.element(e).attr("ui-sref");angular.isUndefined(n)||(n=n.replace(r,""),o.push(n))}),t.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(t.isDisabled())return;t.disable(),l()?(t.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){t.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=t.getLockedItems(),n=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(n=!0)}),n||c().then(function(){t.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){t.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var n=g.current.name,t=!1;angular.forEach(o,function(e){n===e&&(t=!0)}),t?d():c()}),a.$on("msNav::pushToLockedList",function(){t.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],n.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],t.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var t={};return{setFoldable:function(e,n){t={scope:e,element:n}},isNavFoldedOpen:function(){return t.scope.isNavFoldedOpen()},toggleFold:function(){t.scope.toggleFold()},openFolded:function(){t.scope.openFolded()},closeFolded:function(){t.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,n=!1,t=[],a=[];e.isDisabled=function(){return n},e.enable=function(){n=!1},e.disable=function(){n=!0},e.setToggleItem=function(e,n){t.push({element:e,scope:n})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,n){a.push({element:e,scope:n})},e.clearLockedItems=function(){a=[]}}).directive("msNav",n).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",t)}(),function(){"use strict";function e(e,n){e.root?this.navigation=n.getNavigation(e.root):this.navigation=n.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},n.sort()}function n(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,n){var t=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),s=u("navigation");function o(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),t.addClass("ms-navigation-folded"),r();else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){n.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.addClass("ms-navigation-folded-open"),a.remove(),t.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),t.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),t.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return s.isLockedOpen()},function(e,n){if(!angular.isUndefined(e)&&!angular.equals(e,n)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||o(e)}),e.toggleFolded=function(){o(!p.getFolded())},e.$on("$stateChangeStart",function(){s.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function t(t,e,a,i,n,s){var o=this;o.element=e,o.node=t.node,o.hasChildren=void 0,o.collapsed=void 0,o.collapsable=void 0,o.group=void 0,o.animateHeightClass="animate-height",o.toggleCollapsed=function(){o.collapsed?o.expand():o.collapse()},o.collapse=function(){var e=o.element.children("ul"),n=e[0].offsetHeight;t.$evalAsync(function(){o.collapsed=!0,o.element.addClass("collapsing"),i.animate(e,{display:"block",height:n+"px"},{height:"0px"},o.animateHeightClass).then(function(){e.css({display:"",height:""}),o.element.removeClass("collapsing")}),t.$broadcast("msNavigation::collapse")})},o.expand=function(){var e=o.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),t.$evalAsync(function(){o.collapsed=!1,o.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:n+"px"},o.animateHeightClass).then(function(){e.css({height:""}),o.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",o.node._path)})},o.getClass=function(){return o.node.class},o.isHidden=function(){if(angular.isDefined(o.node.hidden)&&angular.isFunction(o.node.hidden))return o.node.hidden();return!1},function(){o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),!o.hasChildren||o.group?o.collapsable=!1:o.collapsable=!(!angular.isUndefined(o.node.collapsable)&&"boolean"==typeof o.node.collapsable&&!0!==o.node.collapsable);o.collapsable?o.collapsed=!(!angular.isUndefined(o.node.collapsed)&&"boolean"==typeof o.node.collapsed&&!0!==o.node.collapsed):o.collapsed=!1;if(o.node.state===n.current.name||n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched"),s.setActiveItem(o.node,t)}t.$on("msNavigation::stateMatched",function(){o.collapsable&&o.collapsed&&t.$evalAsync(function(){o.collapsed=!1})}),t.$on("msNavigation::collapse",function(e,n){if(!o.collapsed&&o.collapsable)if(angular.isUndefined(n))o.collapse();else{var t=n.split("."),a=[],i=s.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<t.indexOf(o.node._id))return;if(-1<a.indexOf(o.node._id))return;o.collapse()}}),t.$on("$stateChangeSuccess",function(){if(o.node.state===n.current.name){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;s.setActiveItem(o.node,t),a.$broadcast("msNavigation::collapse",o.node._path)}if(n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched")}})}()}function a(n){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){n.setNavigationScope(e)}}}}function i(t,e,n,a,i){var s=this;s.element=e,s.node=t.node,s.hasChildren=void 0,s.group=void 0,s.getClass=function(){return s.node.class},function(){if(s.isActive=!1,s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;t.$emit("msNavigation::stateMatched"),i.setActiveItem(s.node,t)}t.$on("msNavigation::stateMatched",function(){s.hasChildren&&t.$evalAsync(function(){s.isActive=!0})}),t.$on("msNavigation::clearActive",function(){if(s.hasChildren){var e=[],n=i.getActiveItem();n&&(e=n.node._path.split(".")),-1<e.indexOf(s.node._id)?t.$evalAsync(function(){s.isActive=!0}):t.$evalAsync(function(){s.isActive=!1})}}),t.$on("$stateChangeSuccess",function(){if(s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;i.setActiveItem(s.node,t),n.$broadcast("msNavigation::clearActive")}})}()}function s(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,n,t,a){n.on("click",function(){if(!a.hasChildren||i("gt-md"))return;n.toggleClass("expanded")}),e.$on("$destroy",function(){n.off("click")})}}}}e.$inject=["$scope","msNavigationService"],n.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],t.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],s.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function d(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=u(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=u(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function c(e){if(angular.isString(e)){for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function m(e){e||(e=l).sort(a);for(var n=0;n<e.length;n++){var t=e[n].children;1<t.length&&t.sort(a),0<t.length&&m(t)}}function a(e,n){return parseInt(e.weight)-parseInt(n.weight)}function u(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=d,this.deleteItem=c,this.sortByWeight=m,this.$get=function(){var t=null,n=null,a=null,i=null,e={saveItem:d,deleteItem:c,sort:m,clearNavigation:function(){l=[],n&&(n.vm.navigation=l)},setActiveItem:function(e,n){t={node:e,scope:n}},getActiveItem:function(){return t},getNavigation:s,getFlatNavigation:o,setNavigationScope:function(e){n=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){n.toggleFolded()},getSectionId:function(n,t){var e=o(),a=_.find(e,function(e){return t?e.route===n&&e.title.toLowerCase()===t.toLowerCase():e.route===n});return a?a.id:0}};return e;function s(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}function o(e){var n=s(e);return function e(n){var t=[];for(var a=0;a<n.length;a++){var i=angular.copy(n[a]);i.children=[],t.push(i),0<n[a].children.length&&(t=t.concat(e(n[a].children)))}return t}(n)}}}).controller("MsNavigationController",e).directive("msNavigation",n).controller("MsNavigationNodeController",t).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,n,t,a){a.collapsable&&n.on("click",a.toggleCollapsed),e.$on("$destroy",function(){n.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationHorizontalItem",s)}(),function(){"use strict";function e(p,t,g,e,a,i,n,u,s,o,v,h,f,b,r,A,l){var E=this,d=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],c=JSON.parse(n.localStorage.getItem("motion2.user:"+E.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};e(function(){},999);var y=l.getLogger("jssip","ms-phonebar");function m(l){var d,c,m;return E.initDeviceInProgress=!0,navigator.mediaDevices.getUserMedia({audio:!0}).then(function(e){return E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/silence.ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}),e.getTracks().forEach(function(e){e.stop()}),navigator.mediaDevices.enumerateDevices()}).then(function(e){var n=_.filter(e,function(e){return"audioinput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<n.length){var t=_.find(e,function(e){return"default"===e.deviceId&&"audioinput"===e.kind});if(m=_.find(n,function(e){return e.groupId===t.groupId}),E.conf.microphoneId&&!l){var a=_.find(n,function(e){return e.deviceId===E.conf.microphoneId});a&&(m=a)}E.conf.microphoneId=m.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_MICROPHONE_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,x("microphone",!1);var i=_.filter(e,function(e){return"audiooutput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<i.length){var s=_.find(e,function(e){return"default"===e.deviceId&&"audiooutput"===e.kind});if(c=d=_.find(i,function(e){return e.groupId===s.groupId}),E.conf.speakerId&&!l){var o=_.find(i,function(e){return e.deviceId===E.conf.speakerId});o&&(c=o)}if(E.conf.speakerId=c.deviceId,E.conf.ringingId&&!l){var r=_.find(i,function(e){return e.deviceId===E.conf.ringingId});r&&(d=r)}E.conf.ringingId=d.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_SPEAKER_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});return x("speaker",!1)}).then(function(){return x("ringing",!1)}).then(function(){if(jabra)return jabra.init().then(function(){return E.isJabraInitialized=!0,jabra.getInstallInfo()}).then(function(){return jabra.getUserDeviceMediaExt()}).then(function(e){m&&c&&d&&e&&_.includes([m.groupId,c.groupId,d.groupId],e.deviceInfo.browserGroupId)&&(y.info("Jabra library correctly initialized and device correctly installed"),E.isJabraEnabled=!0,jabra.onHook(),jabra.addEventListener("acceptcall",function(e){var n=_.last(E.sessions);n?"incoming"===n.direction&&n.isInProgress()?E.answer(n):y.error("Unable to find a valid call to answer",e):y.error("Unable to answer the call",e)}.bind(this)),jabra.addEventListener("mute",function(){x("microphone",E.conf.microphoneMute=!0)}.bind(this)),jabra.addEventListener("unmute",function(){E.conf.microphoneMute=!1,x("microphone",!0)}.bind(this)),jabra.addEventListener("flash",function(){E.jabraSession.localHold?E.unhold(E.jabraSession):E.hold(E.jabraSession)}.bind(this)),jabra.addEventListener("endcall",function(){o(function(e){for(var n=null,t=0;t<E.sessions.length;t++)_.has(E.sessions[t],"localHold")&&E.sessions[t].localHold||(n=E.sessions[t]);e(n)}).then(function(e){null!==e&&E.terminate(e)})}.bind(this)))}).catch(function(e){y.warn("Error initializing Jabra integration",e)})}).catch(function(e){y.error("Unable to init media devices",e),"NotFoundError"===e.name&&v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}).finally(function(){E.initDeviceInProgress=!1,S(),DetectRTC.load(function(){E.conf.hasMicrophone=DetectRTC.hasMicrophone,E.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,E.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,E.conf.osName=DetectRTC.osName,E.conf.osVersion=DetectRTC.osVersion,E.conf.browserName=DetectRTC.browser.name,E.conf.browserVersion=DetectRTC.browser.version,E.conf.license&&E.conf.isWebRTCSupported&&E.conf.hasMicrophone&&E.conf.hasSpeakers&&"https"===E.conf.protocol&&("chrome"===E.conf.browserName.toLowerCase()||"opera"===E.conf.browserName.toLowerCase()||"safari"===E.conf.browserName.toLowerCase())?E.register||E.ua.start():E.conf.license||v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))})}function S(){c.webrtc=_.pick(E.conf,d),n.localStorage.setItem("motion2.user:"+E.conf.id,JSON.stringify(c))}function T(e,n,t){y.debug("addCall -> target, inbound, fullname",e,n,t),E.calls.unshift({target:e,fullname:t||e,inbound:n,time:moment().format("HH:mm")}),50<E.calls.length&&E.calls.pop()}function I(e){y.debug("answer -> session",e._request),e.notification&&(e.notification.close(),e.notification=null),E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,e.answer(E.sessionConf),E.isJabraEnabled&&(jabra.offHook(),E.jabraSession=e)}function O(e,n){y.debug("terminate -> session",e._request),e.notification&&(e.notification.close(),e.notification=null);var t={};if(n?t.status_code=n:e.isEstablished()||(t.status_code=603),e.terminate(t),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var a=_.last(E.sessions);a.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=a):jabra.offHook()}}function C(t){return y.debug("getVoiceChannels -> session",t._request),h.rpc.getVoiceChannels().$promise.then(function(e){var n=_.find(e.rows,function(e){return e.sipcalllinkedid===t.call_id?e:e.sipcalluniqueid===t.call_id?e:null});n&&(t.monitor=n.monitor,t.uniqueid=n.uniqueid,t.monitors=n.monitors)})}function w(e){y.debug("onAddstream -> data",e),this.remotePlayer.srcObject=e.stream,this.remotePlayer.play()}function R(){E.canGoInConference=!1,E.isInConference=!1,E.currentconferenceSessions=[]}function x(e,n){switch(e){case"ringing":E.soundPlayer.muted=E.conf.ringingMute,E.conf.ringingId&&E.soundPlayer.setSinkId(E.conf.ringingId).then(function(){E.soundPlayer.volume=E.conf.ringingVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.ringingId)});break;case"speaker":E.remotePlayer.muted=E.conf.speakerMute,E.conf.speakerId&&E.remotePlayer.setSinkId(E.conf.speakerId).then(function(){E.remotePlayer.volume=E.conf.speakerVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.speakerId)});break;case"microphone":for(var t=0;t<E.sessions.length;t+=1)E.conf.microphoneMute?E.sessions[t].mute():E.sessions[t].unmute();jabra&&E.isJabraEnabled&&(E.conf.microphoneMute?jabra.mute():jabra.unmute()),n&&S();break;default:y.info("unknown device")}}function N(){E.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",p.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function D(n){return h.user.getVoicePrefixes({id:E.conf.id}).$promise.then(function(e){if(e.count)return a.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{prefixes:e,required:E.conf.phoneBarPrefixRequired}})}).then(function(e){if(E.conf.phoneBarPrefixRequired){if(e&&-1!==e)return e+n}else{if(e&&-1!==e)return e+n;if(!e)return n}})}function P(){if(E.isInConference){var e=E.sessions[0].connection.getReceivers()[0],n=E.sessions[1].connection.getReceivers()[0],t=new MediaStream;t.addTrack(e.track),t.addTrack(n.track);var a=document.getElementById("remote-audio");a.srcObject=t;var i=a.play();void 0!==i&&i.then(function(){}).catch(function(e){y.error(e)})}}function L(e,n,t,a){return y.debug("onReferCallback -> session, textContent, position, delay",e._request,n,t,a),function(){i.show(i.simple().textContent(n).position(t).hideDelay(a)),O(e)}}function k(n){return y.debug("findSessionBySessionId -> sessionId, vm_pb.sessions",n,E.sessions),_.find(E.sessions,function(e){return e.call_id==n})}function M(e,n){return y.debug("callCallback -> url, params",e,n),s({url:e,method:"GET",params:n})}E.currentUser=b.getCurrentUser(),E.direction="right",E.selectedMode="md-scale",E.target="",E.showDialpad=!1,E.soundPlayer=document.getElementById(E.conf.soundPlayerId),E.remotePlayer=document.getElementById(E.conf.remotePlayerId),E.soundPlayer.volume=1,E.sessionConf={mediaConstraints:{audio:!0,video:!1},pcConfig:{iceServers:[]}},E.sessions=[],E.calls=[],E.callbackQueue=[],E.canGoInConference=!1,E.isInConference=!1,E.currentConferenceSessions=[],E.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+E.conf.host+":"+E.conf.wssPort+"/ws")],uri:new JsSIP.URI("sip",E.conf.name,E.conf.host,5060,null,null).toString(),authorization_user:E.conf.name,ha1:E.conf.ha1,realm:E.conf.realm,user_agent:E.conf.ua,session_timers_refresh_method:"invite",register_expires:E.conf.phoneBarExpires||60,register:!0}),E.conf=_.merge(c.webrtc,E.conf),E.initDeviceInProgress=!1,E.isJabraEnabled=!1,E.isJabraInitialized=!1,E.jabraSession=null,E.jabraClicked=!1,E.buttonClicked=!1,E.originateInProgress=!1,t.bind("keyup",function(e){switch(e.keyCode){case 27:g(function(){E.showDialpad=!1})}}),E.$onInit=function(){m(!1),navigator.mediaDevices.ondevicechange=function(){E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(!(E.isJabraEnabled=!1))}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!0))};var e=[h.network.get({type:"turn",nolimit:!0}).$promise,h.network.get({type:"stun",nolimit:!0}).$promise];o.all(e).then(function(e){var n=e[0].rows,t=e[1].rows,a=[],i=[];t.forEach(function(e){i.push("stun:"+e.value)}),a.push({urls:i}),n.forEach(function(e){var n={urls:"turn:"+e.value};e.username&&(n.username=e.username),e.password&&(n.credential=e.password),a.push(n)}),E.sessionConf.pcConfig={iceServers:a}}),this.ua.on("registered",function(){this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){this.registered=!1}.bind(this)),this.ua.on("newRTCSession",function(e){y.debug("onNewRTCSession -> data",e);var n,t,a,i,s,o=e.session,r=!0,l="",d=0;switch(e.originator){case"local":o.outgoing=!0,o.name=e.request.ruri.user,o.user=e.request.ruri.user,T(o.user,!1),t=e.request.extraHeaders,a="X-callback-url",s=_.find(t,function(e){return _.startsWith(e,a)}),n=!!s&&_.trim(s.replace(a,"").replace(i||":","")),E.isJabraEnabled&&(E.jabraSession&&jabra.resume(),E.jabraSession=o,jabra.offHook());break;case"remote":var c=b.getCurrentUser();c.voicePause&&c.phoneBarDnd&&(r=!1);var m=e.request.getHeader("Call-Type")||"";if(c.ignorePauseForPreviewCalls&&"PREVIEW"===m&&(r=!0),E.originateInProgress&&(r=!1),r&&(o.incoming=!0,o.name=e.request.from.display_name,o.user=e.request.from.uri.user,l=e.request.getHeader("X-Answer-Mode")||"",d=e.request.getHeader("X-Answer-After")||0,function(n){y.debug("getNotification -> session",n._request);var e=n.name?n.name+" <"+n.user+">":n.user;E.currentUser.privacyEnabled&&(e=A.mask(e)),f.create("Incoming call from: ",e,null,function(){I(n)},function(){O(n)},E.conf.autoAnswer).then(function(e){n.notification=e}).catch(function(e){y.error("Error creating notification for incoming call",e)})}(e.session),T(e.session.user,!0),E.isJabraEnabled&&jabra.ring(),E.conf.autoAnswer&&g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},E.conf.autoAnswerDelay?1e3*E.conf.autoAnswerDelay:0),y.debug("xAnswerMode",l),y.debug("xAnswerAfterSec",d),"auto"==l.toLowerCase())){var u=0==d?500:1e3*d;y.debug("auto answer enabled after:"+u+" ms"),g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},u)}}r?(o.call_id=e.request.call_id,n&&M(E.callbackQueue[o.call_id]=n,{call_id:o.call_id}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}),o.connection&&(o.connection.onaddstream=w.bind(this)),o.iceCandidateTimeout=null,o.on("progress",function(e,n){y.debug("onProgress -> session, data",e._request,n),y.error("onProgress -> session, data",e._request,n);var t=!1;switch(n.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),t=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),t=!0}E.originateInProgress&&(E.originateInProgress=!1),t&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){y.error(e.message)})),C(e).then(function(){var n=E.callbackQueue[e.call_id];n&&M(n,{uniqueid:e.uniqueid,call_id:e.call_id,number_called:e.user}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}).finally(function(){delete E.callbackQueue[e.call_id]})}).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("confirmed",function(e,n){y.debug("onConfirmed -> session, data",e._request,n);var t=document.getElementById("div_session_"+e.id.substr(0,32));t&&$(t).scope().$broadcast("timer-start"),e.confirmed=!0,"remote"===n.originator&&e.connection&&(e.connection.onaddstream=w.bind(this),_.head(e.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(e.connection.getRemoteStreams()),this.remotePlayer.play())),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(e),e.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){y.error("Unable to play autoAnswer notification",e)})),E.canGoInConference=2==E.sessions.length,C(e).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("hold",function(e,n){y.debug("onHold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!0)}.bind(this,o)),o.on("unhold",function(e,n){y.debug("onUnhold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!1)}.bind(this,o)),o.on("ended",function(e,n){if(y.debug("onEnded -> session, data",e._request,n),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&(R(),E.buttonClicked=!0),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}0===E.sessions.length&&E.currentUser.voicePause&&"ACW"!==E.currentUser.pauseType&&h.user.pause({id:E.currentUser.id,type:_.startsWith(E.currentUser.pauseType,"#")?E.currentUser.pauseType.substring(1):E.currentUser.pauseType}).$promise.catch(function(e){v.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})}),E.conf.microphoneMute=!1,E.initDevice("microphone",!0)}.bind(this,o)),o.on("failed",function(e,n){if(y.debug("onFailed -> session, data",e._request,n),this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&R(),E.originateInProgress&&(E.originateInProgress=!1),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}}.bind(this,o)),o.on("icecandidate",function(e,n){y.debug("onIcecandidate -> session, data",e._request,n),null!==e.iceCandidateTimeout&&clearTimeout(e.iceCandidateTimeout),e.iceCandidateTimeout=setTimeout(n.ready,1e3)}.bind(this,o)),E.sessions.push(o),g(function(){p.$apply(),y.debug("onNewRTCSession -> vm_pb.sessions",E.sessions)})):O(o,486)}.bind(this)),r.on("webbar:originate",function(e){y.debug("originateHook -> payload",e);var n=e.callNumber,t=e.callerId,a=e.callbackUrl;E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var i=n.replace(/ /g,"");if(i=(i=i.replace(/\(/g,"")).replace(/\)/g,"")){var s=angular.copy(E.sessionConf);s.extraHeaders=[],t&&s.extraHeaders.push("X-CID: "+t),a&&s.extraHeaders.push("X-callback-url: "+a),E.originateInProgress=!0,E.ua.call(i,s)}}.bind(this)),r.on("webbar:hangup",function(e){y.debug("hangupHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];y.info("hangupHook -> sessionToHangup",a),E.terminate(a)}}.bind(this)),r.on("webbar:answer",function(e){var n;y.debug("answerHook -> payload",e),n=e.sessionId?k(e.sessionId):_.find(E.sessions,function(e){return e.incoming&&!e.confirmed}),e.sessionId&&!n&&y.warn("call with session Id "+e.sessionId+" not found"),n&&E.answer(n)}.bind(this)),r.on("webbar:hold",function(e){y.debug("holdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.hold(a)}}.bind(this)),r.on("webbar:unhold",function(e){y.debug("unholdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.unhold(a)}}.bind(this)),r.on("webbar:transfer",function(e){if(y.debug("transferHook -> payload",e),e.sessionId)if(e.transferNumber){var n=k(e.sessionId);n?n.refer(e.transferNumber,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}}):y.warn("call with session Id "+e.sessionId+" not found")}else y.error("transferNumber required");else y.error("sessionId required")}.bind(this)),r.on("webbar:stopmonitors",function(e){if(e.agentId===E.currentUser.id){var n=_.find(E.sessions,["uniqueid",e.uniqueid]);if(!n)return;n.monitors.forEach(function(e){e.status="pause"}),n.monitor=!1}}.bind(this))}.bind(this),E.type=function(e,n){var t=e;switch(E.target||(E.target=""),n&&(E.target+=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)),e){case"*":t="asterisk";break;case"#":t="pound"}E.conf.enableDtmfTone&&(E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+t+".ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}));for(var a=0;a<E.sessions.length;a+=1)E.sessions[a].isEstablished()&&!E.sessions[a].isOnHold().local&&E.sessions[a].sendDTMF(e)},E.call=function(){if(E.target&&E.target!==E.conf.name&&E.target!==E.conf.internal){E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var e=E.target.replace(/ /g,"");return D(e=(e=e.replace(/\(/g,"")).replace(/\)/g,"")).then(function(e){e&&E.ua.call(e,E.sessionConf)}).then(function(){N()})}},E.hold=function(e){y.debug("hold -> session",e._request),e.hold({useUpdate:!1}),E.isJabraEnabled&&(jabra.hold(),jabra.onHook())},E.refer=function(n){y.debug("refer -> session",n._request);var e=a.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");a.show(e).then(function(e){return D(e.replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,""))}).then(function(e){n.refer(e,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}})})},E.record=function(e){y.debug("record -> session",e._request),a.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:E.sessions}})},E.unhold=function(e){y.debug("unhold -> session",e._request),e.unhold({useUpdate:!1}),E.putOtherCallsOnHold(e),E.isJabraEnabled&&(jabra.offHook(),jabra.resume())},E.answer=I,E.terminate=O,E.selectSession=function(e){y.debug("selectSession -> session",e._request),E.unhold(e)},E.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":E.type(e.key);break;case"enter":E.call()}},E.toggleDialpad=function(){E.showDialpad=!E.showDialpad},E.referAttended=function(e){y.debug("referAttended -> session",e._request),a.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(E.sessions,{id:e.id}),isJabraEnabled:E.isJabraEnabled}})},E.closeDialpad=function(){E.showDialpad=!1},E.initDevice=x,E.putOtherCallsOnHold=function(e){if(y.debug("putOtherCallsOnHold -> session",e._request),1<E.sessions.length)for(var n=0;n<E.sessions.length;n+=1)E.sessions[n].id===e.id||E.sessions[n].isOnHold().remote||E.sessions[n].hold({useUpdate:!1})},E.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|-)*$/.test(e)?(E.target=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)):E.target?p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target):N():N()},E.targetSelected=function(e){e&&(E.target=e.originalObject.target,E.call(),N())},E.start3WayConf=function(){E.isInConference=!0,E.canGoInConference=!1,E.currentConferenceSessions.push(E.sessions[0].id),E.currentConferenceSessions.push(E.sessions[1].id);var e=new AudioContext,n=E.sessions[0].connection.getSenders()[0],t=E.sessions[0].connection.getReceivers()[0];t.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1);var a=E.sessions[1].connection.getSenders()[0],i=E.sessions[1].connection.getReceivers()[0];i.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1),E.sessions[0].unhold({useUpdate:!1}),E.sessions[1].unhold({useUpdate:!1}),t.track.enabled=!0,i.track.enabled=!0;var s=new MediaStream,o=e.createMediaStreamDestination();o=(e=new AudioContext).createMediaStreamDestination();var r=e.createMediaStreamSource(new MediaStream([i.track]));r.connect(o),(r=e.createMediaStreamSource(new MediaStream([n.track]))).connect(o),n.replaceTrack(o.stream.getTracks()[0]).then(function(){}),o=e.createMediaStreamDestination(),(r=e.createMediaStreamSource(new MediaStream([t.track]))).connect(o),(r=e.createMediaStreamSource(new MediaStream([a.track]))).connect(o),a.replaceTrack(o.stream.getTracks()[0]).then(function(){s.addTrack(t.track),s.addTrack(i.track);var e=document.getElementById("remote-audio");e.srcObject=s;var n=e.play();void 0!==n&&n.then(function(){}).catch(function(e){y.error(e)})})},E.patchConference=P,p.$on("webrtc::settings",function(e){a.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:E.conf,activeSessions:E.sessions}}).then(function(e){e&&(E.conf=e,E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(E.isJabraEnabled=!1)}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!1)))})}),p.$on("webrtc::logout",function(){E.ua.stop(),jabra&&E.isJabraInitialized&&jabra.shutdown(),navigator.mediaDevices.ondevicechange=function(){}}),p.$on("webrtc::call",function(e,n){y.debug("onRemoteCall -> evt, data",e,n),n.target&&(E.target=n.target,E.call())}),p.$on("webrtc::transfer",function(e,n){if(y.debug("onRemoteTransfer -> evt, data",e,n),n.target)for(var t=0;t<E.sessions.length;t+=1)if(E.sessions[t].isEstablished()&&!E.sessions[t].isOnHold().local)return D(n.target).then(function(e){e&&E.sessions[t].refer(e,{eventHandlers:{requestSucceeded:L(E.sessions[t],"requestSucceeded","top right",3e3),requestFailed:L(E.sessions[t],"requestFailed","top right",3e3)}})})}),p.$on("$destroy",function(){y.debug("$destroy event fired"),r.removeAllListeners("webbar:originate"),r.removeAllListeners("webbar:hangup"),r.removeAllListeners("webbar:answer"),r.removeAllListeners("webbar:hold"),r.removeAllListeners("webbar:unhold"),r.removeAllListeners("webbar:transfer"),r.removeAllListeners("webbar:stopmonitors")}),n.onbeforeunload=function(){E.sessions.forEach(function(e){E.terminate(e)})}}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","$http","$q","toasty","api","motNotification","Auth","socket","privacyManager","ClientSideLoggingService"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"=",sessions:"=",registered:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(n,e,t){var a=this;a.prefixes=e,a.required=t,a.closeDialog=function(e){n.hide(e)},a.keyPress=function(e){13===e.keyCode&&this.call()},a.call=function(){n.hide(a.prefix)}}e.$inject=["$mdDialog","prefixes","required"],angular.module("app.core").controller("PrefixDialogController",e)}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,n){function t(){n.css("display","inline"),i(a,1e3)}function a(){n.css("display","none"),i(t,1e3)}t()}],replace:!0}}function n(n,i,s,e,t){var o=this;function a(n,e){console.log("startMonitor");var t=i.defer(),a=(e||n.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return s.rpc.startMonitor({uniqueid:o.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){n.filename=a+".wav",n.mixmonitorid=e.mixmonitorid,n.status="rec",o.session.monitor=!0,t.resolve(n)}).catch(function(e){t.reject(e)}),t.promise}o.title="Record",o.sessions=e,o.session=t,o.closeDialog=function(){n.hide()},o.addRecording=function(){var e=n.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");n.show(e).then(function(e){return a({},e)}).then(function(e){o.session.monitors.push(e)})},o.stop=function(n){return console.log("stopMonitor"),s.rpc.stopMonitor({uniqueid:o.session.uniqueid,mixmonitorid:n.mixmonitorid}).$promise.then(function(e){n.status="pause",o.session.monitor=_.includes(o.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},o.start=a}e.$inject=["$timeout"],n.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",n)}(),function(){"use strict";function e(n,i,a,s,o){var r=this;function l(e,n){var t=n?"Transfer Success":"Transfer Failed",a="top right";return console.debug("onTransferCallback -> session, textContent, position, delay",e,t,a,3e3),function(){i.show(i.simple().textContent(t).position(a).hideDelay(3e3))}}function d(e){n.hide(e)}r.title="Refer Attended",r.sessions=a,r.session=s,r.isJabraEnabled=o,r.sessionTarget=null,a.length&&(r.target=a[0].user),r.closeDialog=d,r.transfer=function(){var e,n,t=_.find(a,function(e){if(e.user===r.target)return e});n=t.outgoing?(e=t,r.session):(e=r.session,t);console.debug("session.refer() -> source, target, replaces, callback",n,e.user,e,"onTransferCallback"),n.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:l(s,!0),requestFailed:l(s,!1)}}),function(e,n){e.terminate(),jabra&&n&&jabra.onHook();d()}(s,o)}}e.$inject=["$mdDialog","$mdToast","sessions","session","isJabraEnabled"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,s,n,t,a,i){var o=this;function r(e,n,t){var a;if(s[t]){if(a=_.find(e,function(e){return e.deviceId===s[t]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===n});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===n}))&&(s[t]=a.deviceId);return s[t]||null}o.currentUser=a.getCurrentUser(),o.messengerSoundNotification=o.currentUser.messengerSoundNotification,_.remove(n,function(e){return"audioinput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)||"audiooutput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)}),s.ringingId=r(n,"audiooutput","ringingId"),s.speakerId=r(n,"audiooutput","speakerId"),s.microphoneId=r(n,"audioinput","microphoneId"),s.ringingVolume=s.ringingVolume||.5,s.speakerVolume=s.speakerVolume||.5,s.microphoneVolume=s.microphoneVolume||1,s.ringingMute=s.ringingMute||!1,s.speakerMute=s.speakerMute||!1,s.microphoneMute=s.microphoneMute||!1,o.conf=angular.copy(s),o.devices=n,o.activeSessions=t,o.saveSettings=function(){i.user.messengerSoundNotification({id:o.currentUser.id,enabled:o.messengerSoundNotification}).$promise.then(function(){a.setMessengerSoundNotification(o.messengerSoundNotification),e.hide(o.conf)})},o.closeDialog=function(){e.hide()},o.isCompatibleBrowser=function(){return"chrome"===o.conf.browserName.toLowerCase()||"opera"===o.conf.browserName.toLowerCase()||"safari"===o.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices","activeSessions","Auth","api"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";function e(e,t,a){var i=this;function s(e,n,t){r(e).then(function(){n&&!1!==t&&i.search()})}function o(e){var n=e.key;i.pickerModels[n].dateStart?!0===e.useFromToKeys?i.query[n]={from:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),to:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]={$gte:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),$lte:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]=void 0,i.search()}function r(e){var n=e.key,t={param:i.query[n],resources:e.options,placeholder:e.placeholder,ngValue:e.ngValue};return a.setPlaceholder(t).then(function(e){i.placeholders[n]=e})}i.pickerModels={},i.placeholders={},i.localizationMap=t.localizationMap,i.onMultiselectInit=function(e){r(e)},i.onDateRangeInit=function(e){var n=e.key;i.query[n]?i.pickerModels[n]=t.setSelectedDate(i.query[n]):i.pickerModels[n]={dateStart:null}},i.onMultiselectSelection=s,i.onDateRangeSelection=o,i.clearDate=function(e){var n=e.key;i.pickerModels[n]={dateStart:null},delete i.query[n],i.search()},i.clearSelection=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=!1===e.clearAll?[_.head(e.options)[t]]:[],r(e).then(function(){i.search()})},i.selectAll=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=_.map(e.options,t),r(e).then(function(){i.search()})},e.$on("ms-quick-filter:update",function(e,t){t.filters.forEach(function(e){var n=_.find(i.filters,["name",e]);if(n)switch(n.type){case"date":o(n);break;case"multiselect":s(n,!0,t.update);break;case"select":i.search()}})})}e.$inject=["$scope","dateRangeManager","quickFilterManager"],angular.module("app.core").directive("msQuickFilter",function(){return{restrict:"E",scope:{query:"=",filters:"=",search:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-quick-filter/ms-quick-filter.html"}})}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,n){var t=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];n.addClass(t)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(n,e){var t=!1,a=document.createElement("audio");n.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){t||(t=!0,e.preventDefault(),i[n.model||"voiceRecording"].download({id:n.id}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(t)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,n){var t=angular.element('<div class="ms-responsive-table-wrapper"></div>');n.after(t),t.append(n)}}})}(),function(){"use strict";function e(n,i,s,e){var o=this;function t(){angular.isArray(o.onSearch)?a(o.onSearch):o.onResultClick?(o.resultsLoading=!0,n.$parent.$eval("vm.search(query)",{query:o.query.filter}).then(function(e){a(e)}).catch(function(){a([])}).finally(function(){o.resultsLoading=!1})):o.onSearch()}function a(e){o.expanded&&(void 0===e||angular.isArray(e)||null===e)&&(o.selectedResultIndex=0,o.results=e)}function r(){o.expanded=!0,o.displayOn=!0,n.expand()}function l(e){!1!==e&&(o.query.filter=void 0,o.onResultClick?a(null):t()),o.expanded=!1,n.collapse()}function d(e){o.onResultClick&&o.onResultClick({item:e}),l()}function c(){var e=i.find(".ms-search-bar-results"),n=angular.element(e.find(".result")[o.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;o.ignoreMouseEvents=!0,s.cancel(o.mouseEventIgnoreTimeout),o.mouseEventIgnoreTimeout=s(function(){o.ignoreMouseEvents=!1},250),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}}o.queryOptions={debounce:o.debounce||0},o.searchOnEnterKey=e.get().searchOnEnterKey||!1,o.resultsLoading=!1,o.results=null,o.selectedResultIndex=0,o.ignoreMouseEvents=!1,o.expandBar=r,o.collapseBar=l,o.blurCollapse=function(){if(!o.collapseOnBlur)return;l(!0)},o.onKeyDown=function(e){var n=e.keyCode;-1<[27,38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:if(!o.onResultClick)return t();if(!o.results)return;d(o.results[o.selectedResultIndex]);break;case 27:l(!0);break;case 38:0<=o.selectedResultIndex-1&&(o.selectedResultIndex--,c());break;case 40:if(!o.results)return;o.selectedResultIndex+1<o.results.length&&(o.selectedResultIndex++,c())}},o.absorbEvent=function(e){e.preventDefault()},o.handleMouseenter=function(e){if(o.ignoreMouseEvents)return;o.selectedResultIndex=e},o.handleResultClick=d,n.$watch("vm.displayOn",function(e){angular.isUndefined(e)||(!0!==e||o.expanded?e||!1===o.expanded||l(!1):r())}),n.$watch("vm.query.filter",function(e,n){if(!angular.isUndefined(e)&&0!==e.length&&!angular.equals(e,n)&&!1!==o.displayOn){if(o.expanded){if(!0===o.searchOnEnterKey&&!o.onResultClick)return;if(o.minChars&&o.minChars>e.length)return}else r();t()}})}function n(a){return{restrict:"E",scope:{query:"=?",debounce:"=?",direction:"@",iconColor:"@",onSearch:"&",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"<?",minChars:"<?",displayOn:"=?"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),{post:function(n,t){n.collapse=function(){if(t.removeClass("expanded"),"down"===n.vm.direction){t.removeClass("down");var e=t.closest("md-toolbar");e&&e.removeClass("h-128")}a.find("body").removeClass("ms-search-bar-expanded")},n.expand=function(){if(t.addClass("expanded"),"down"===n.vm.direction){t.addClass("down");var e=t.closest("md-toolbar");e&&e.addClass("h-128")}a.find("body").addClass("ms-search-bar-expanded")}}}}}}e.$inject=["$scope","$element","$timeout","settingsManager"],n.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",n)}(),function(){"use strict";function e(e,t,i,o,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],n=l.getFlatNavigation(),t=r.defer(),a=0;a<n.length;a++)n[a].uisref&&e.push(n[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var s=0;s<d.shortcuts.length;s++)if(d.shortcuts[s]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,o(function(){t.resolve(e)},250),t.promise},d.loadShortcuts=function(){var e=r.defer(),n=angular.fromJson(t.get("motion.shortcuts"));angular.isUndefined(n)&&(n=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],t.put("motion.shortcuts",angular.toJson(n)));return e.resolve(n),e.promise},d.saveShortcuts=function(){var e=r.defer();return t.put("motion.shortcuts",angular.toJson(d.shortcuts)),o(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var n=0;n<d.shortcuts.length;n++)d.shortcuts[n]._id===e._id&&(d.shortcuts.splice(n,1),d.query||(0===d.shortcuts.length?d.results=null:n>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var n=e.keyCode;-1<[38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,o.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=o(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),n=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,n){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,n,t,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(n.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,n){var t=e.$on("msSplashScreen::remove",function(){a.leave(n).then(function(){t(),e=n=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function n(){i.setCurrentStep(1)}function t(e){return o(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return o(e)?!!i.steps[e-1].scope.hideStep:null}function s(e){return o(e)?!!t(e)||i.steps[e-1].form.$valid:null}function o(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,n,t){var a={element:e,scope:n,form:t,stepNumber:n.step||i.steps.length+1,stepTitle:n.stepTitle,stepTitleTranslate:n.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,n){return e.stepNumber-n.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),n()})},i.setCurrentStep=function(e){if(!o(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,n=e;1<=n;n--)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,n=e;n<=i.steps.length;n++)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoFirstStep=n,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){return o(e)?i.currentStepNumber===e:null},i.isStepDisabled=function(e){if(!o(e))return null;for(var n=!1,t=1;t<e;t++)if(!s(t)){n=!0;break}return n},i.isStepOptional=t,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=s,i.isStepNumberValid=o,i.isFormValid=function(){return i.mainForm.$valid}}function n(o){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];o(function(){s.setOrientation("vertical"),s.registerMainForm(i),s.setupSteps()})}}}}e.$inject=["$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];s.setOrientation("horizontal"),s.registerMainForm(i),s.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),s.registerStep(n,e,i),n.hide()}}}}).directive("msVerticalStepper",n).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),e.stepInfo=s.registerStep(n,e,i),e.MsStepper=s,n.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(e){return{restrict:"E",scope:{},transclude:!0,controller:"MsTabScrollController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-tab-scroll/ms-tab-scroll.html",compile:function(e){return e.addClass("ms-tab-scroll"),function(e,n){}}}}e.$inject=["$document"],angular.module("app.core").controller("MsTabScrollController",function(){function n(){var e=document.getElementById("bar-container"),n=document.getElementById("tab-container");return n.scrollWidth>e.scrollWidth&&0==e.scrollLeft&&0==n.scrollLeft?"right":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft>=n.scrollWidth?"left":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft<n.scrollWidth?"both":"none"}this.onTabScroll=function(e){"left"==e?$("#tab-container").stop().animate({scrollLeft:"-=400"},1e3):$("#tab-container").stop().animate({scrollLeft:"+=400"},1e3)},this.canScroll=function(e){switch(n()){case"both":return!0;case"left":return"left"==e;case"right":return"right"==e;case"none":default:return!1}}}).directive("msTabScroll",e)}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,t,n,a){var i=72,s=!1,o=!1,r=a.getScrollEl();!function(){t.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,n){var t=angular.element(n[0]);d(t).then(function(){m(function(){s=!0})})}):d(t).then(function(){m(function(){s=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return s&&o},function(e,n){angular.equals(e,n)||e&&(t.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var n=u.defer(),t=e.find("img");return 0<t.length?t.on("load",function(){n.resolve("Image is loaded")}):n.resolve("No images"),n.promise}function c(){r.scrollTop()+r.height()>t.position().top+i&&(m(function(){o=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var n=this;n.scrollEl=void 0,n.setScrollEl=function(e){n.scrollEl=e},n.getScrollEl=function(){return n.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,n,t,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner"></span></div>');n.append(i);var s={scrollEl:"#content"};s=angular.extend(s,e.msTimeline,{});var o=angular.element(s.scrollEl);a.setScrollEl(o);var r=144;function l(){o.scrollTop()+o.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore&&e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){o.on("scroll",l)}function c(){o.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";function e(e,n,t,a,i){var r=this;function s(){!function(){r.millis=l().diff(moment(r.startingTime));var e=moment.duration(r.millis),n=e.seconds(),t=e.minutes(),a=e.hours(),i=e.days(),s=e.months(),o=e.years();r.seconds=n<10?"0"+n:n,r.minutes=t<10?"0"+t:t,r.hours=a<10?"0"+a:a,r.days=i<10?"0"+i:i,r.months=s<10?"0"+s:s,r.years=o<10?"0"+o:o,r.timer=0<r.days?r.days+"d ":r.hours+":"+r.minutes+":"+r.seconds}(),r.timeoutId=setTimeout(function(){s(),e.$digest()},r.interval)}function l(e){var n=(e||moment()).utcOffset(r.utcOffset).format("YYYY-MM-DD HH:mm:ss");return moment(n)}function o(){t.resolve().then(function(){return null===r.utcOffset||void 0===r.utcOffset?i.getUTCOffset():r.utcOffset}).then(function(e){return r.utcOffset=e,l()}).catch(function(e){throw e}).then(function(e){var n=r.startTime?moment(r.startTime):void 0;r.startTime?n.isAfter(e,"hour")||n.isBefore(e,"hour")?r.startingTime=l(n):r.startingTime=n:r.startingTime=e,s()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.getDate",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}o(),e.$watch("vm.startTime",function(e,n){angular.isUndefined(e)||0!==e.length&&(angular.equals(e,n)||o())}),e.$on("timer-start",function(){r.startTime=void 0,o()}),n.bind("$destroy",function(){r.timeoutId&&clearTimeout(r.timeoutId)})}e.$inject=["$scope","$element","$q","toasty","settingsManager"],angular.module("app.core").directive("timer",function(){return{restrict:"EA",replace:!1,scope:{startTime:"=?",interval:"=?",utcOffset:"=?"},template:"<span ng-cloak>{{ vm.timer }}</span>",compile:function(){return{pre:function(e,n,t){e.interval=t.interval||1e3}}},controller:e,controllerAs:"vm",bindToController:!0}})}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"=",ngChange:"&"},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],link:function(e,n,t,a){e.updateModel=function(e){a.$setViewValue(e)}},templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var i=this;i.filter=[],i.filtered=!1,i.fontSize=20,i.label="",i.getCount=function(e){var n=0;if(e){i.fontSize=e.attrs[r]&&e.attrs[r].value?parseInt(e.attrs[r].value)-parseInt(e.attrs[r].value)%2:20;var t=e.attrs.find(function(e){return"attrChannel"===e.name});if(t||e.attrs.push({name:"attrChannel",value:"voice"}),"voice"!==e.attrs[l].value?"talking"===e.attrs[s].value?i.label="Opened":"answered"===e.attrs[s].value?i.label="Managed":i.label=e.attrs[s].value:i.label=e.attrs[s].value,e.attrs[l].value.toLowerCase().includes("voice")){e.attrs[o].value&&e.attrs[o].value.length?(i.filtered=!0,i.filter=_.intersection(e.voiceQueuesSelected,e.attrs[o].value)):(i.filtered=!1,i.filter=e.voiceQueuesSelected);for(var a=0;a<e.voiceQueues.rows.length;a+=1)_.includes(i.filter,e.voiceQueues.rows[a].id)&&(n+=e.voiceQueues.rows[a][e.attrs[s].value]?parseInt(e.voiceQueues.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("chat")){e.attrs[g].value&&e.attrs[g].value.length?(i.filtered=!0,i.filter=_.intersection(e.chatWebsitesSelected,e.attrs[g].value)):(i.filtered=!1,i.filter=e.chatWebsitesSelected);for(var a=0;a<e.chatWebsites.rows.length;a+=1)_.includes(i.filter,e.chatWebsites.rows[a].id)&&(n+=e.chatWebsites.rows[a][e.attrs[s].value]?parseInt(e.chatWebsites.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("fax")){e.attrs[c].value&&e.attrs[c].value.length?(i.filtered=!0,i.filter=_.intersection(e.faxAccountsSelected,e.attrs[c].value)):(i.filtered=!1,i.filter=e.faxAccountsSelected);for(var a=0;a<e.faxAccounts.rows.length;a+=1)_.includes(i.filter,e.faxAccounts.rows[a].id)&&(n+=e.faxAccounts.rows[a][e.attrs[s].value]?parseInt(e.faxAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("mail")){e.attrs[d].value&&e.attrs[d].value.length?(i.filtered=!0,i.filter=_.intersection(e.mailAccountsSelected,e.attrs[d].value)):(i.filtered=!1,i.filter=e.mailAccountsSelected);for(var a=0;a<e.mailAccounts.rows.length;a+=1)_.includes(i.filter,e.mailAccounts.rows[a].id)&&(n+=e.mailAccounts.rows[a][e.attrs[s].value]?parseInt(e.mailAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("openchannel")){e.attrs[u].value&&e.attrs[u].value.length?(i.filtered=!0,i.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[u].value)):(i.filtered=!1,i.filter=e.openchannelAccountsSelected);for(var a=0;a<e.openchannelAccounts.rows.length;a+=1)_.includes(i.filter,e.openchannelAccounts.rows[a].id)&&(n+=e.openchannelAccounts.rows[a][e.attrs[s].value]?parseInt(e.openchannelAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("whatsapp")){e.attrs[p].value&&e.attrs[p].value.length?(i.filtered=!0,i.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[p].value)):(i.filtered=!1,i.filter=e.whatsappAccountsSelected);for(var a=0;a<e.whatsappAccounts.rows.length;a+=1)_.includes(i.filter,e.whatsappAccounts.rows[a].id)&&(n+=e.whatsappAccounts.rows[a][e.attrs[s].value]?parseInt(e.whatsappAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("sms")){e.attrs[m].value&&e.attrs[m].value.length?(i.filtered=!0,i.filter=_.intersection(e.smsAccountsSelected,e.attrs[m].value)):(i.filtered=!1,i.filter=e.smsAccountsSelected);for(var a=0;a<e.smsAccounts.rows.length;a+=1)_.includes(i.filter,e.smsAccounts.rows[a].id)&&(n+=e.smsAccounts.rows[a][e.attrs[s].value]?parseInt(e.smsAccounts.rows[a][e.attrs[s].value]):0)}}return n};var s=0,o=1,r=2,l=3,d=4,c=5,m=6,u=7,p=8,g=9})}(),function(){"use strict";function e(r,e){var l=this;l.filter=[],l.filtered=!1,l.properties=[],l.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},l.getMultiBarChart=function(e){e&&(e.attrs&&function(e){switch(l.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(l.filtered=!0,l.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(l.filtered=!1,l.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(l.filtered=!0,l.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(l.filtered=!1,l.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(l.filtered=!0,l.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(l.filtered=!1,l.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(l.filtered=!0,l.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(l.filtered=!1,l.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(l.filtered=!0,l.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(l.filtered=!1,l.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(l.filtered=!0,l.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(l.filtered=!1,l.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected)}if(l.multiBarChart.series.length>l.properties.length){var n=l.multiBarChart.series.length-l.properties.length;l.multiBarChart.series.splice(0,n),l.multiBarChart.data.splice(0,n)}for(var t=0;t<l.properties.length;t+=1){var a="";if(a="voice"!==e.attrs[4].value?"talking"===l.properties[t]?"Opened":"answered"===l.properties[t]?"Managed":l.properties[t]:l.properties[t],l.multiBarChart.series[t]=r.instant("TOOLS."+a.toUpperCase()),_.isNil(l.multiBarChart.data[t])&&(l.multiBarChart.data[t]=[]),l.multiBarChart.labels.length>l.filter.length){var i=l.multiBarChart.labels.length-l.filter.length;l.multiBarChart.labels.splice(0,i),l.multiBarChart.data[t].splice(0,i)}switch(e.attrs[4].value){case"voice":for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1);break;case"sms":for(var s=0,o=0;s<e.smsAccounts.rows.length;s+=1)_.includes(l.filter,e.smsAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.smsAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.smsAccounts.rows[s][l.properties[t]]?parseInt(e.smsAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"chat":for(var s=0,o=0;s<e.chatWebsites.rows.length;s+=1)_.includes(l.filter,e.chatWebsites.rows[s].id)&&(l.multiBarChart.labels[o]=e.chatWebsites.rows[s].name,l.multiBarChart.data[t][o]=e.chatWebsites.rows[s][l.properties[t]]?parseInt(e.chatWebsites.rows[s][l.properties[t]]):0,o+=1);break;case"fax":for(var s=0,o=0;s<e.faxAccounts.rows.length;s+=1)_.includes(l.filter,e.faxAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.faxAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.faxAccounts.rows[s][l.properties[t]]?parseInt(e.faxAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"mail":for(var s=0,o=0;s<e.mailAccounts.rows.length;s+=1)_.includes(l.filter,e.mailAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.mailAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.mailAccounts.rows[s][l.properties[t]]?parseInt(e.mailAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"openchannel":for(var s=0,o=0;s<e.openchannelAccounts.rows.length;s+=1)_.includes(l.filter,e.openchannelAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.openchannelAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.openchannelAccounts.rows[s][l.properties[t]]?parseInt(e.openchannelAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"whatsapp":for(var s=0,o=0;s<e.whatsappAccounts.rows.length;s+=1)_.includes(l.filter,e.whatsappAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.whatsappAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.whatsappAccounts.rows[s][l.properties[t]]?parseInt(e.whatsappAccounts.rows[s][l.properties[t]]):0,o+=1);break;default:for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1)}}}(e),e.foreground&&function(e){l.multiBarChart.options.legend.fontColor=e.foreground;for(var n=0;n<l.multiBarChart.options.scales.xAxes.length;n+=1)l.multiBarChart.options.scales.xAxes[n].ticks.fontColor=e.foreground;for(var t=0;t<l.multiBarChart.options.scales.yAxes.length;t+=1)l.multiBarChart.options.scales.yAxes[t].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(s){var o=this;o.filter=[],o.filtered=!1,o.properties=[],o.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},o.getPieChart=function(e){e&&(e.attrs&&function(e){switch(o.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(o.filtered=!0,o.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(o.filtered=!1,o.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(o.filtered=!0,o.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(o.filtered=!1,o.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(o.filtered=!0,o.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(o.filtered=!1,o.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(o.filtered=!0,o.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(o.filtered=!1,o.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(o.filtered=!0,o.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(o.filtered=!1,o.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(o.filtered=!0,o.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(o.filtered=!1,o.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected)}if(o.pieChart.labels.length>o.properties.length){var n=o.pieChart.labels.length-o.properties.length;o.pieChart.labels.splice(0,n),o.pieChart.data.splice(0,n)}for(var t=0,a=0;t<o.properties.length;t+=1){switch("voice"!==e.attrs[4].value?"talking"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.OPENED"):"answered"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.MANAGED"):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()),e.attrs[4].value){case"voice":for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0);break;case"sms":for(var i=0;i<e.smsAccounts.rows.length;i+=1)_.includes(o.filter,e.smsAccounts.rows[i].id)&&(a+=e.smsAccounts.rows[i][o.properties[t]]?parseInt(e.smsAccounts.rows[i][o.properties[t]]):0);break;case"chat":for(var i=0;i<e.chatWebsites.rows.length;i+=1)_.includes(o.filter,e.chatWebsites.rows[i].id)&&(a+=e.chatWebsites.rows[i][o.properties[t]]?parseInt(e.chatWebsites.rows[i][o.properties[t]]):0);break;case"fax":for(var i=0;i<e.faxAccounts.rows.length;i+=1)_.includes(o.filter,e.faxAccounts.rows[i].id)&&(a+=e.faxAccounts.rows[i][o.properties[t]]?parseInt(e.faxAccounts.rows[i][o.properties[t]]):0);break;case"mail":for(var i=0;i<e.mailAccounts.rows.length;i+=1)_.includes(o.filter,e.mailAccounts.rows[i].id)&&(a+=e.mailAccounts.rows[i][o.properties[t]]?parseInt(e.mailAccounts.rows[i][o.properties[t]]):0);break;case"openchannel":for(var i=0;i<e.openchannelAccounts.rows.length;i+=1)_.includes(o.filter,e.openchannelAccounts.rows[i].id)&&(a+=e.openchannelAccounts.rows[i][o.properties[t]]?parseInt(e.openchannelAccounts.rows[i][o.properties[t]]):0);break;case"whatsapp":for(var i=0;i<e.whatsappAccounts.rows.length;i+=1)_.includes(o.filter,e.whatsappAccounts.rows[i].id)&&(a+=e.whatsappAccounts.rows[i][o.properties[t]]?parseInt(e.whatsappAccounts.rows[i][o.properties[t]]):0);break;default:for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0)}o.pieChart.data[t]=a,a=0}}(e),e.foreground&&(n=e,o.pieChart.options.legend.fontColor=n.foreground));var n}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,t,a,i){var s=this;function n(e){s.results=e||{count:0,rows:[]}}function o(){s.query.offset=(s.query.page-1)*s.query.limit,s.promise=i[s.reportRoute].run(s.query,n).$promise}s.countDown=0,s.refresh=0,s.title="",s.columns=[],s.results={rows:[],count:0},s.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},s.onInit=function e(n){n&&n.attrs&&(n.attrs[0]&&n.attrs[0].value&&(s.query.id=n.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,DefaultReportId:"default"===n.attrs[0].type?n.attrs[0].value:void 0,CustomReportId:"custom"===n.attrs[0].type?n.attrs[0].value:void 0}).$promise.then(function(e){switch(e&&e.rows&&(s.columns=e.rows),n.attrs[0].type){case"default":s.reportRoute="analyticDefaultReport";break;case"custom":s.reportRoute="analyticCustomReport"}return i[s.reportRoute].get({id:n.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(s.title=e.name),o()}).catch(function(e){console.log(e)})),n.attrs[1]&&n.attrs[1].value&&(s.refresh=parseInt(n.attrs[1].value),!_.isNaN(s.refresh)&&0<s.refresh?(s.countDown=parseInt(n.attrs[1].value),s.interval=a(function(){s.countDown-=1},1e3,0),s.timeout=t(function(){s.interval&&a.cancel(s.interval),e(n)},1e3*s.refresh)):(s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout))))},s.getResults=o,s.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},e.$on("$destroy",function(){s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,n){this.getTrustedURL=function(e){return n.trustAsResourceUrl(e)}}function n(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],n.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",n)}(),function(){"use strict";function e(e,n){var t=this;t.flipped=!1,t.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;t.flipped=!t.flipped,n.toggleClass("flipped",t.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";function e(s,n,o,r){return{restrict:"A",require:"?ngModel",link:function(t,a,e,i){o.isAdmin()||o.isTelephone()||(""!==e.privacy||o.getCurrentUser().privacyEnabled)&&!1!==t.$eval(e.privacy)&&(i?(i.$formatters.push(function(e){if(!e)return e;var n=r.mask(e);return i.$setViewValue(n),i.$render(),i.$viewValue}),i.$parsers.push(function(){return i.$modelValue}),a[0].disabled=!0):n(function(){s(a.contents())(t);var e=a.text();if(e){var n=r.mask(e);a.text(n)}}))}}}e.$inject=["$compile","$timeout","Auth","privacyManager"],angular.module("app.core").directive("privacy",e)}(),function(){"use strict";function e(d,c,t,h){function f(e,n){return"motion2.home."+e+":"+n}function b(e){return _.capitalize(e)+("chat"===e?"Website":"Account")+"Id"}function A(e){return"chat"===e?"Website":"Account"}function E(e,n,t){var a=f(n,t);h.set(a,e)}return{addAccount:function(r,e){var l=e.accounts,d=e.accountId,c=e.filters,m=e.query,u=e.userId,n="get"+_.capitalize(r)+("chat"===r?"Websites":"Accounts"),p=b(r),g=A(r),v=l.rows.length===m[p].length;return t.user[n]({id:u,nolimit:!0}).$promise.then(function(e){var n,t,a,i,s;if(l.rows=e.rows,l.count=e.count,_.find(c,["name",g]).options=l.rows,v){var o=(t=d,a=f(n=r,u),i=b(n),(s=h.get(a)).query&&s.query[i]&&s.query[i].push(t),s);o&&E(o,r,u),m[p].push(d)}return v})},removeAccount:function(t,e){var n=e.accounts,a=e.accountId,i=e.filters,s=e.query,o=e.userId,r=b(t),l=s[r].includes(a);return c.resolve().then(function(){var e=function(e,n,t){var a=f(e,n),i=b(e),s=h.get(a);if(s.query&&s.query[i]){var o=s.query[i].indexOf(t);-1<o&&s.query[i].splice(o,1)}return s}(t,o,a);e||(e=s),s[r]=e.query[r],_.remove(n.rows,function(e){return e.id===a}),n.count=n.rows.length,_.find(i,function(e){var n=A(t);return e.name===n}).options=n.rows,1===n.count&&(e.query[r]=[n.rows[0].id],s[r]=[n.rows[0].id]),E(e,t,o)}).then(function(){var e=A(t);d.$broadcast("ms-quick-filter:update",{filters:[e],update:l})})}}}e.$inject=["$rootScope","$q","api","localStorageManager"],angular.module("app.core").factory("agentAccountAssociationManager",e)}(),function(){"use strict";function e(o,r,i,l,d){var e={get:function(s,a){return o(function(n,t){0===a.offset&&(s=void 0);var e=_.merge({},a);i.cmContact.getJourney(e).$promise.then(function(e){var a,n=_(e.rows).uniqBy(function(e){return e.channel}).map("channel").value();return(a=n,o(function(e,n){var t=a.map(function(n){if("voice"!==n){var e="get"+_.startCase(n)+("chat"===n?"Websites":"Accounts");return i.user[e]({id:l.getCurrentUser().id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){c[n]=e.rows})}});return o.all(t).then(function(){e()}).catch(function(e){n(e)})})).then(function(){return e.rows.forEach(function(e){var n;e.canOpen=function(e){switch(e.channel){case"chat":return!!c.chat&&_.some(c.chat,["id",e.ChatWebsiteId]);case"fax":return!!c.fax&&_.some(c.fax,["id",e.FaxAccountId]);case"mail":return!!c.mail&&_.some(c.mail,["id",e.MailAccountId]);case"openchannel":return!!c.openchannel&&_.some(c.openchannel,["id",e.OpenchannelAccountId]);case"sms":return!!c.sms&&_.some(c.sms,["id",e.SmsAccountId]);case"voice":return!0;case"whatsapp":return!!c.whatsapp&&_.some(c.whatsapp,["id",e.WhatsappAccountId]);default:return!1}}(e),e.dispositionsValues=(n=e).disposition?"("+_.compact([n.disposition,n.secondDisposition,n.thirdDisposition]).join(" - ")+")":"("+r.instant("DASHBOARDS.NO_DISPOSITION_SET")+")",e.style=function(e){switch(e.channel){case"chat":return{color:"green-A700",icon:"icon-hangouts"};case"fax":return{color:"blue-grey-A200",icon:"icon-deskphone"};case"mail":return{color:"teal",icon:"icon-email"};case"openchannel":return{color:"amber-A200",icon:"icon-google-earth"};case"sms":return{color:"orange",icon:"icon-message-text"};case"voice":return{color:"blue-A700",icon:"icon-phone"};case"whatsapp":return{color:"lime-A700",icon:"icon-whatsapp"}}}(e)}),a=s,i=e,o(function(e,n){try{var t={journey:a?_.union(a,i.rows):i.rows};t.loadMore=0<i.count-t.journey.length,e(t)}catch(e){n(e)}});var a,i})}).then(function(e){n(e)}).catch(function(e){d.error({title:r.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:r.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),t(e)})})},getQuery:function(){return{range:{from:moment().subtract(3,"M").startOf("month").format("YYYY-MM-DD HH:mm:ss"),to:moment().endOf("month").format("YYYY-MM-DD HH:mm:ss")},limit:10,offset:0}},getQuickFilters:function(){return[{name:"Channel",key:"channel",type:"select",label:"INTEGRATIONS.CHANNEL",customOptions:[{value:void 0,translate:"DASHBOARDS.ALL"},{value:"voice",translate:"DASHBOARDS.VOICE"},{value:"chat",translate:"DASHBOARDS.CHAT"},{value:"mail",translate:"DASHBOARDS.MAIL"},{value:"sms",translate:"DASHBOARDS.SMS"},{value:"fax",translate:"DASHBOARDS.FAX"},{value:"openchannel",translate:"DASHBOARDS.OPENCHANNEL"},{value:"whatsapp",translate:"DASHBOARDS.WHATSAPP"}]},{name:"Start Date",key:"range",type:"date",label:"DASHBOARDS.SELECT_DATE",useFromToKeys:!0}]}},c={};return e}e.$inject=["$q","$translate","api","Auth","toasty"],angular.module("app.core").factory("customerJourneyManager",e)}(),function(){"use strict";function e(p,e){var g={localizationMap:e,setSelectedDate:function(e){var n=e.$gte?new Date(moment.utc(e.$gte).format("YYYY-MM-DD")):new Date(moment.utc(e.from).format("YYYY-MM-DD")),t=e.$lte?new Date(moment.utc(e.$lte).format("YYYY-MM-DD")):new Date(moment.utc(e.to).format("YYYY-MM-DD")),a={dateStart:new Date(n.getFullYear(),n.getMonth(),n.getDate()),dateEnd:new Date(t.getFullYear(),t.getMonth(),t.getDate())};return a.selectedTemplateName=(i=a,moment(i.dateStart).isSame(i.dateEnd)?(u=i,moment().startOf("day").isSame(u.dateStart)?g.localizationMap.Today:(m=i,moment().subtract(1,"days").startOf("day").isSame(m.dateStart)?g.localizationMap.Yesterday:p("date")(i.dateStart,"dd MMM yyyy"))):(c=i,moment().startOf("isoWeek").isSame(c.dateStart,"day")&&moment().endOf("isoWeek").isSame(c.dateEnd,"day")?g.localizationMap["This Week"]:(d=i,moment().subtract(1,"weeks").startOf("isoWeek").isSame(d.dateStart,"day")&&moment().subtract(1,"weeks").endOf("isoWeek").isSame(d.dateEnd,"day")?g.localizationMap["Last Week"]:(l=i,moment().startOf("month").isSame(l.dateStart,"day")&&moment().endOf("month").isSame(l.dateEnd,"day")?g.localizationMap["This Month"]:(r=i,moment().subtract(1,"months").startOf("month").isSame(r.dateStart,"day")&&moment().subtract(1,"months").endOf("month").isSame(r.dateEnd,"day")?g.localizationMap["Last Month"]:(o=i,moment().startOf("year").isSame(o.dateStart,"day")&&moment().endOf("year").isSame(o.dateEnd,"day")?g.localizationMap["This Year"]:(s=i,moment().subtract(1,"years").startOf("year").isSame(s.dateStart,"day")&&moment().subtract(1,"years").endOf("year").isSame(s.dateEnd,"day")?g.localizationMap["Last Year"]:p("date")(i.dateStart,"dd"+(i.dateStart.getMonth()!==i.dateEnd.getMonth()||i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" MMM":"")+(i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" yyyy":""))+" - "+p("date")(i.dateEnd,"dd MMM yyyy")))))))),a;var i,s,o,r,l,d,c,m,u}};return g}e.$inject=["$filter","dateFilterLocalizationFactory"],angular.module("app.core").factory("dateRangeManager",e)}(),function(){"use strict";function e(t,a,e,n,i){var s={},o={},r="mail",l={};function d(){if(o=n.getCurrentUser(),e.localStorage.getItem("motion2.home:"+o.id)||(r="dashboard"),l=e.localStorage.getItem("motion2.home."+r+":"+o.id)){var a=JSON.parse(l);a.drafts?o.privacyEnabled&&Object.keys(a.drafts).forEach(function(e){var n=a.drafts[e].title,t=n.split(/-(.+)/)[1].trim();a.drafts[e].title=n.replace(t,i.mask(t))}):a.drafts={},l=a}else l={drafts:{}};return l.drafts}function c(){_.isEmpty(s.drafts)?delete l.drafts:l.drafts=s.drafts,e.localStorage.setItem("motion2.home."+r+":"+o.id,JSON.stringify(l))}return s.init=function(){s.drafts=d()},s.getByInteraction=function(n){return s.drafts=d(),_.find(_.values(s.drafts),function(e){return e.interaction&&e.interaction.id===n})},s.removeByInteraction=function(n){s.drafts=d();var e=_.find(_.values(s.drafts),function(e){return e.interaction&&e.interaction.id===n});e&&(delete s.drafts[e.id],c())},s.add=function(e){s.drafts=d();var n=a.instant("DASHBOARDS.UNTITLED");e.contact?n=e.contact.firstName||e.contact.email:_.isEmpty(e.message.subject)||(n=e.message.subject);var t={type:"draft",title:e.account.key+" - "+n,channel:e.channel,content:e.message,account:e.account,interaction:e.interaction,id:_.random(1e10),openedAt:new Date,saved:!1};s.drafts[t.id]=t,c()},s.update=function(e){s.drafts=d();var n=s.drafts[e.id];n&&(n.content=e.message,s.drafts[e.id]=n,c())},s.open=function(e){s.drafts=d();var n=s.drafts[e];n&&t.$broadcast("open"+_.startCase(r)+"Draft",n)},s.remove=function(e){s.drafts=d(),s.drafts[e]&&(delete s.drafts[e],c())},s}e.$inject=["$rootScope","$translate","$window","Auth","privacyManager"],angular.module("app.core").factory("draftManager",e)}(),function(){"use strict";function e(s){var o=[];return function(n,e){e||(e="global-exception");var t,a=s.get("ClientSideLoggingService").getLogger("global-exception"),i=o.findIndex(function(e){return e===n});-1<i?(t=i,o.splice(t,1)):(!function(e){if(100<=o.length){var n=o.length-100+1;o.splice(0,n)}o.push(e)}(n),a.error(e,n))}}e.$inject=["$injector"],angular.module("app.core").factory("$exceptionHandler",e)}(),function(){"use strict";function e(o,i){function r(e,n){var t=i.localStorage.getItem(e),a=t?JSON.parse(t):{};return n?a[n]:a}function s(e,n){return i.localStorage.setItem(e,JSON.stringify(n))}return{get:r,parseInteractionsKey:function(e,n,t,a){var i="motion2.home."+e+":"+t,s=_.capitalize(e)+("chat"===e?"Website":"Account")+"Id";return o.resolve().then(function(){var e=r(i,"query");return e?((n=_.merge(n,e)).sort&&0<=n.sort.indexOf("lastMessage")&&(n=_.omit(n,"sort")),n.includeAll=!0):n.createdAt={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},1===a.length?n[s]=[a[0].id]:0===a.length&&(n[s]=[]),n}).catch(function(e){throw e})},set:s,update:function(e,n,t){var a=r(e);t?a[t]=n:a=n;return s(e,a)}}}e.$inject=["$q","$window"],angular.module("app.core").factory("localStorageManager",e)}(),function(){"use strict";function e(i){function s(e,n){var t=i.get(),a=0;if(t)switch(n){case"email":a=t.privacyPolicyEmail;break;case"number":a=t.privacyPolicyNumber;break;default:a=t.privacyPolicyName}return _.isNil(a)?e:0===a||a>e.length?e.replace(/./g,"*"):e.substring(0,e.length-a).padEnd(e.length,"*")}function o(e){return _.startsWith(e,"<")&&_.endsWith(e,">")&&(e=e.substring(1,e.length-1)),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function r(e){if(_.startsWith(e,"<")&&_.endsWith(e,">")){var n=!0;e=e.substring(1,e.length-1)}var t=e.split("@")[0],a=e.split("@")[1],i="";return n&&(i+="<"),i+=s(t,"email"),i+="@",i+=s(a,"email"),n&&(i+=">"),i}return{mask:function n(e){t=e,e=t.replace(/\s\s+/g," ").trim();var t;{if(o(e))return r(e);if(/^[+]?[0-9|.|\-|\s]*$/.test(e))return s(e,"number");var a=[],i=e.split(" ");return 1===i.length?s(e):(i.forEach(function(e){a.push(n(e))}),a.join(" "))}}}}e.$inject=["settingsManager"],angular.module("app.core").factory("privacyManager",e)}(),function(){"use strict";function e(n,i){return{setPlaceholder:function(a){var e;return n(function(n){try{if(_.isEmpty(a.resources))e=i.instant("DASHBOARDS.NONE");else if(_.isEmpty(a.param))e=a.placeholder?i.instant(a.placeholder):i.instant("DASHBOARDS.CHOOSE");else if(a.param.length===a.resources.length)e=i.instant("DASHBOARDS.ALL");else{var t=a.ngValue||"id";e=_(a.resources).filter(function(e){return _.includes(a.param,e[t])}).map("name").value().join(", ")}n(e)}catch(e){n(null)}})}}}e.$inject=["$q","$translate"],angular.module("app.core").factory("quickFilterManager",e)}(),function(){"use strict";function e(h,f){var s=["available","loggedIn","paused","waiting"],o=["busy","inUse","invalid","loggedInDb","notInUse","onHold","ringing","ringInUse","talking","unavailable","unknown"],r=["pTalking","originated","message","statusMessage","dialActive","dialMethod","Trunk","startPredictive","startProgressive","erlangCalls","erlangCallToSecond","erlangAbandonmentRate","erlangBusyFactor","dialPredictiveInterval","dialPredictiveIntervalMaxThreshold","dialPredictiveIntervalMinThreshold","predictiveIntervalAvailable","predictiveIntervalTotalCalls","predictiveIntervalAnsweredCalls","predictiveIntervalDroppedCallsTimeout","predictiveIntervalDroppedCallsCallersExit","predictiveIntervalAvgHoldtime","predictiveIntervalAvgTalktime"],n=["idle","unknown","unavailable","ringing"];function t(e,n){var t=[e.chatPause,e.faxPause,e.mailPause,e.openchannelPause,e.smsPause,e.voicePause,e.whatsappPause];if(!n)return _.every(t);var a=_.filter(t);return 0<a.length&&a.length<t.length}function a(e){return!!_.isNil(e)||_.includes(n,e)}function b(e){var n;return t(e,!1)?"pause":t(e,!0)?"*pause":("idle"!==(n=e).voiceStatus&&n.voicePause?n.voiceStatus="pause":!_.every([n.chatStatus,n.faxStatus,n.mailStatus,n.openchannelStatus,n.smsStatus,n.voiceStatus,n.whatsappStatus],a))?"busy":"idle"}function A(){return moment().set("year","0000").format()}return{INCOMING_CALL_STATUS_STYLES:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},OUTGOING_CALL_STATUS_STYLES:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},STATES_STYLES:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},STATUS_STYLES:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},paginateAgents:function(e,n,t){var a={count:0,rows:[]},i=e.filter(function(e){return e.online});if(i.forEach(function(e){var n,t,a;e.globalStatus=b(e),n=e,f.getChannels().forEach(function(e){n[e+"Pause"]&&"idle"===n[e+"Status"]&&(n[e+"Status"]="pause")}),e.globalStatusDisplayValue=(a=(t=e).globalStatus,"pause"===t.globalStatus?a=t.pauseType||h.instant("VOICE.DEFAULT_PAUSE"):"*pause"===t.globalStatus&&(a="*"+(t.pauseType||h.instant("VOICE.DEFAULT_PAUSE"))),a)}),0<t.globalQueueFilter.length){var s=n.filter(function(e){return t.globalQueueFilter.includes(e.id)}),o=_.uniq(s.flatMap(function(e){return _.map(e.Agents,"id")}));i=i.filter(function(e){return o.includes(e.id)})}if(t.globalStatusFilter&&(i=i.filter(function(e){var n=e.globalStatus===t.globalStatusFilter;return"pause"===e.globalStatus&&t.pauseTypeFilter&&(n=e.pauseType===t.pauseTypeFilter),n})),t.filter){var r=t.filter.toLowerCase();i=i.filter(function(e){return(e.fullname+" "+e.internal).toLowerCase().includes(r)})}var l,d,c,m,u="-"===t.sort[0]?"DESC":"ASC",p="DESC"===u?t.sort.substring(1):t.sort;l=i,c=u,i="globalStatus"===(d=p)?(m=c,l.sort(function(e,n){return e.globalStatus===n.globalStatus?"pause"===e.globalStatus?"DESC"===m?(e.pauseType||"")<(n.pauseType||"")||e.fullname.toLowerCase()>n.fullname.toLowerCase()?1:-1:(e.pauseType||"")<(n.pauseType||"")||e.fullname.toLowerCase()>n.fullname.toLowerCase()?-1:1:"DESC"===m?e.fullname.toLowerCase()<n.fullname.toLowerCase()?1:-1:e.fullname.toLowerCase()<n.fullname.toLowerCase()?-1:1:"DESC"===m?e.globalStatus<n.globalStatus?1:-1:e.globalStatus<n.globalStatus?-1:1})):l.sort(function(e,n){var t=e[d],a=n[d];return"fullname"===d?(t=e[d].toLowerCase(),a=n[d].toLowerCase()):"lastPauseAt"===d&&(t=e.globalStatus.includes("pause")?e[d]:A(),a=n.globalStatus.includes("pause")?n[d]:A()),"DESC"===c?t<a?1:-1:t<a?-1:1}),a.count=i.length;var g=t.offset||0,v=g+t.limit;return a.rows=i.slice(g,v),a},updateQueue:function(e,n){var t=!!n.type,a=s;"inbound"===n.type?a=a.concat(o):"outbound"===n.type&&(a=a.concat(o,r));var i=_.pick(e,a);_.merge(n,i),t&&0<n.ringing&&n.available<n.loggedIn&&(n.available+=n.ringing)}}}e.$inject=["$translate","msUtils"],angular.module("app.core").factory("realtimeManager",e)}(),function(){"use strict";function e(e,n){var t={get:function(){return a},getUTCOffset:function(){return null===i?n.setting.getDate().$promise.then(function(e){return i=e.offset}):e.resolve(i)},set:function(e){e&&(a=e.toJSON())}},a={},i=null;return t}e.$inject=["$q","api"],angular.module("app.core").factory("settingsManager",e)}(),function(){"use strict";function e(c,m){function u(e,n,t){if(_.isEmpty(n))return t;for(var a=0;a<n.length;a++){var i=n[a].key,s=_.find(e,function(e){return e[i]===n[a].value});s&&(_.some(t,["id",s.id])||(s.canSelect=!1,t.push(s)))}return t}return{getResources:function(a,i,s,o,r,l,d){return c(function(t,n){o||(o={}),d||(d="get"),a[s][d](o).$promise.then(function(e){var t=e.rows;if("admin"===i.role)return t;var n=m.getSectionId(s,l);return a.userProfileSection.get({userProfileId:i.userProfileId,sectionId:n}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?t:a.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(t,{id:e.resourceId})});return u(t,r,n)}):c.resolve().then(function(){return e=s,_.includes(["voiceContext"],e)?(o.defaultEntry=1,a[s][d](o).$promise.then(function(e){return e.rows})):[];var e}).then(function(e){return u(t,r,e)})})}).then(function(e){var n={rows:_.orderBy(e,[o.sort]),count:e.length};t(n)}).catch(function(e){n(e)})})}}}e.$inject=["$q","msNavigationService"],angular.module("app.core").factory("userProfileManager",e)}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var n=Date.now()-new Date(e);return n<36e5?moment(e).fromNow():n<864e5?moment(e).format("HH:mm"):n<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(n){return function(e){return n.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("capitalize",function(){return function(e){return e?_.capitalize(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,n){if(0===e.length||!n)return e;if(0===n.length)return[];for(var t=[],a=0;a<e.length;a++){for(var i=e[a],s=!1,o=0;o<n.length;o++){var r=n[o];if(i.id===r){s=!0;break}}s&&t.push(i)}return t}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,n,t){if(0===e.length||!t||0===t.length)return e;for(var a=[],i=0;i<e.length;i++){for(var s=e[i],o=!1,r=0;r<t.length;r++){var l=t[r];if(-1<s[n].indexOf(l)){o=!0;break}}o&&a.push(s)}return a}})}(),function(){"use strict";angular.module("app.core").filter("getOptionByValue",function(){return function(n,e,t){if(void 0===n)return"";if(!e)return"";t||(t="option");var a=_.find(e,function(e){return e.value==n});return a?a[t]:""}})}(),function(){"use strict";angular.module("app.core").filter("orderByDate",function(){return function(e){var n=[];return angular.forEach(e,function(e){n.push(e)}),n.sort(function(e,n){return e.hasOwnProperty("openedAt")&&n.hasOwnProperty("openedAt")?e.openedAt>n.openedAt?1:-1:1}),n}})}(),function(){"use strict";angular.module("app.core").filter("secToTime",function(){return function(e){e&&(e=e.toString().replace(",",""));var n=Math.floor(e/86400),t=e%86400,a=new Date(1e3*t).toISOString().substring(11,19);return a.replace(/^(\d+)/,function(e){return(""+(Number(e)+24*n)).padStart(2,"0")})}})}(),function(){"use strict";angular.module("app.core").filter("snakecase",function(){return function(e){return e?_.snakeCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("startcase",function(){return function(e){return e?_.startCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,t){if(0===e.length||0===t.length)return e;var a=[];return e.forEach(function(e){var n=t.every(function(n){var t=!1;return e.tags.forEach(function(e){e.name!==n.name||(t=!0)}),t});n&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,n){if(0!==e.length&&0!==n.length){if(e.length<n.length)return[];var t=[],a=n.every(function(n){var t=!1;return e.forEach(function(e){e.name!==n.name||(t=!0)}),t});return a&&t.push(e),t}}})}(),function(){"use strict";angular.module("app.core").filter("toInteger",function(){return function(e){if(e&&"string"==typeof e)return parseInt(e)}})}(),function(){"use strict";function m(e,n,t,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=n,this.accept=t,this.reject=a,this.close=i}function u(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var t=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var n=_.find(e,function(e){return e.data.id===t.id});n&&n.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var d,t,c=[];"serviceWorker"in navigator&&u()?navigator.serviceWorker.register("notification.js").then(function(e){(d=e).update(),d.installing?t=d.installing:d.waiting?t=d.waiting:d.active&&(t=d.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===t){var n=_.find(c,{id:e.data.id});if(n)switch(e.data.action){case"accept":n.accept&&n.accept();break;case"reject":n.reject&&n.reject()}}}),{create:function(e,i,s,o,r,l){return new Promise(function(t,n){var a;u()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new m(e||"MyTitle",i||"MyBody",o,r),c.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return d.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:s||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){if(l){for(var n=0;n<c.length;n++)c[n].close();t()}else t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,n){var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var o=l.defer(),r=function(e){for(var n=e.split("."),t=c,a=0;a<n.length;a++){if(angular.isUndefined(t[n[a]])){d.error('Resource part "'+n[a]+'" is not defined!'),t=!1;break}t=t[n[a]]}return t||!1}(a);r?r[i](s,function(e){o.resolve(e)},function(e){o.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!'));return o.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";function e(e){return{showLoadingIndicator:function(){e.loadingProgress=!0},hideLoadingIndicator:function(){e.loadingProgress=!1}}}e.$inject=["$rootScope"],angular.module("app.core").factory("LoadingIndicatorService",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var t=angular.injector(["ng"]).get("$log"),a="",v=[];function n(e){a=e}function i(){return a}function s(e,n){angular.isString(e)?angular.isArray(n)?v[e]={url:a+(n[0]||""),paramDefaults:n[1]||[],actions:n[2]||[],options:n[3]||{}}:t.error('"resource" must be an array and it must follow $resource definition'):t.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=n,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=s,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:n,getBaseUrl:i,register:s,resolve:function(e,n){g.$broadcast("msApi::resolveStart");var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var o=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](s,function(e){o.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){o.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!');return o.promise},request:function(e,n,t,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),s=i[0],o=i[1],r=n||{};if(!s||!o)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[s];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[o](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(t)&&angular.isFunction(t)&&t(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+s+'" is not defined in the api service!'),l.reject('Resource "'+s+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,n){return-1<n.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],n=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function t(e){for(var n=0;n<e.length;n++){var t=e[n].string,a=e[n].prop;if(i=e[n].versionSearch||e[n].identity,t){if(-1!==t.indexOf(e[n].subString))return e[n].identity}else if(a)return e[n].identity}}function a(e){var n=e.indexOf(i);if(-1!==n)return parseInt(e.substring(n+i.length+1))}var s=t(e)||"unknown-browser",o=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=t(n)||"unknown-os";return s=s.toLowerCase(),o=s+"-"+o,r=r.toLowerCase(),d={browser:s,version:o,os:r}},getChannels:function(){return["chat","fax","mail","openchannel","sms","voice","whatsapp"]},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,n){-1===n.indexOf(e)?n.push(e):n.splice(n.indexOf(e),1)},firstLastDayMonth:function(){return{$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()}},getEmailProviders:function(){return[{name:"Custom",value:"custom"},{name:"Gmail",value:"gmail"},{name:"Hotmail",value:"hotmail"},{name:"Yahoo",value:"yahoo"},{name:"Outlook365",value:"outlook365"}]}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,n){var t=this;t.themes=n.themes,t.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],t.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],t.layoutMode="wide",t.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",t.setActiveTheme=function(e){n.setActiveTheme(e)},t.getActiveTheme=function(){return n.themes.active},t.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===t.layoutMode)},t.updateLayoutStyle=function(){e.put("motion.layoutStyle",t.layoutStyle),location.reload()}}function n(n){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){n("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],n.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",n)}(),function(){"use strict";function e(i,a,s){var o={};return{generate:function(){var e=angular.copy(s.getRegisteredThemes()),a=angular.copy(s.getRegisteredPalettes());angular.forEach(e,function(t){o[t.name]={},angular.forEach(t.colors,function(e,n){o[t.name][n]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var n=angular.copy(e);angular.forEach(n,function(t){angular.forEach(t,function(e,n){t[n]=e.levels,t[n].color=e.levels.default.color,t[n].contrast1=e.levels.default.contrast1,t[n].contrast2=e.levels.default.contrast2,t[n].contrast3=e.levels.default.contrast3,t[n].contrast4=e.levels.default.contrast4,delete t[n].default})}),s.setThemesList(n);var t=i.get("motion.selectedTheme");t?s.setActiveTheme(t):s.setActiveTheme("default")}(o);var r={};angular.forEach(o,function(e,n){var t,a,i,s,o;(r={})["@themeName"]=n,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,t){angular.forEach(e,function(e,n){r["@"+a+d(t)+d(n)]=e})})}),t=r,a=new RegExp(Object.keys(t).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n color: @backgroundHue1Contrast1;\n background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n color: @backgroundHue2Contrast1;\n background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n color: @backgroundHue3Contrast1;\n background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n background-color: @primaryDefaultColor;\n color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n background-color: @primaryHue1Color;\n color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n background-color: @primaryHue2Color;\n color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n background-color: @primaryHue3Color;\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n background-color: @accentDefaultColor;\n color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n background-color: @accentHue1Color;\n color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n background-color: @accentHue2Color;\n color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n background-color: @accentHue3Color;\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n background-color: @warnDefaultColor;\n color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n background-color: @warnHue1Color;\n color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n background-color: @warnHue2Color;\n color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n background-color: @warnHue3Color;\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n background-color: @backgroundDefaultColor;\n color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n background-color: @backgroundHue1Color;\n color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n background-color: @backgroundHue2Color;\n color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n background-color: @backgroundHue3Color;\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return t[e]}),s=angular.element("head"),(o=angular.element('<style type="text/css"></style>')).html(i),s.append(o)})},rgba:l};function l(e,n){var t=n||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),t&&(e=function(e,n){var t={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=t.white[n]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=t.black[n]);return e}(e,t)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(t,e,n){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(n.custom=i),t.alwaysWatchTheme(!0),angular.forEach(e,function(e){t.definePalette(e.name,e.options)}),angular.forEach(n,function(e,n){t.theme(n).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(n,t,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void t.error('You must have at least one theme named "default"'):(t.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void n.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],n.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(n,s,o,r){this.search=function(n){for(var e=[],t=r.getFlatNavigation(),a=o.defer(),i=0;i<t.length;i+=1)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,n){var t=this;t.code="",t.send=!1,t.error=e.params,t.sendReport=function(){n.post("/api/jira",t.error).then(function(e){t.send=!0,e.data&&(t.code=e.data.id)},function(e){t.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,n,t){var a=this;a.currentUser=e.getCurrentUser(),a.cookieAlertHide=n.get("motion.cookieAlertHide:"+a.currentUser.id)||!1,a.cookieAlertOnClose=function(){n.put("motion.cookieAlertHide:"+a.currentUser.id,!0)},a.onInit=function(){t.setting.get({id:1}).$promise.then(function(e){e&&(a.cookieAlertHide=!e.disabledCookie)})},a.onInit()}e.$inject=["Auth","$cookies","api"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.form={},s.forgotPassword=function(){return i.auth.forgot(s.form).$promise.then(function(){n.success({title:t.instant("FORGOTPASSWORD.LINK_SENT"),msg:t.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&n.error({title:t.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,n){var t=this;t.currentUser=e.getCurrentUser(),t.newsAlertHide=n.get("motion.newsAlertHide:"+t.currentUser.id)||!1,t.newsAlertOnClose=function(){n.put("motion.newsAlertHide:"+t.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e,o){var r={getResourcesByRole:function(e,n,t,a,i,s){return o.getResources(r,e,n,t,a,i,s)}};return r.baseUrl="api/",r.auth=e(r.baseUrl+"auth/local",{},{local:{method:"post",url:r.baseUrl+"auth/local"},forgot:{method:"post",url:r.baseUrl+"auth/local/forgot"},reset:{method:"post",url:r.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},user:{method:"get",url:r.baseUrl+"auth/local/user/:token",params:{token:"@token"}},google:{method:"post",url:r.baseUrl+"auth/google"},activedirectory:{method:"post",url:r.baseUrl+"auth/activedirectory"}}),r.jira=e(r.baseUrl+"jira"),r.rpc=e(r.baseUrl+"rpc",{},{startMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:r.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:r.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:r.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:r.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:r.baseUrl+"rpc/sms/queues"},getWhatsappQueues:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues"},getOpenchannelQueues:{method:"get",url:r.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:r.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:r.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:r.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:r.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:r.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:r.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:r.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:r.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:r.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:r.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:r.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getOpenchannelQueuesIdWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/:id/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/fax/queues/waitinginteractions"},getWhatsappQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues/waitinginteractions"},mailQueueNotify:{method:"post",url:r.baseUrl+"rpc/mail/queues/:id/notify",params:{id:"@id"}},chatQueueNotify:{method:"post",url:r.baseUrl+"rpc/chat/queues/:id/notify",params:{id:"@id"}},faxQueueNotify:{method:"post",url:r.baseUrl+"rpc/fax/queues/:id/notify",params:{id:"@id"}},smsQueueNotify:{method:"post",url:r.baseUrl+"rpc/sms/queues/:id/notify",params:{id:"@id"}},openchannelQueueNotify:{method:"post",url:r.baseUrl+"rpc/openchannel/queues/:id/notify",params:{id:"@id"}},agentNotify:{method:"post",url:r.baseUrl+"rpc/agents/:id/notify",params:{id:"@id"}}}),r.version=e(r.baseUrl+"version",{},{fetch:{method:"get",url:r.baseUrl+"version/fetch"},reset:{method:"get",url:r.baseUrl+"version/reset"},pull:{method:"get",url:r.baseUrl+"version/pull"},restart:{method:"get",url:r.baseUrl+"version/restart"},migrations:{method:"get",url:r.baseUrl+"version/migrations"}}),r.system=e(r.baseUrl+"system",{},{killProcess:{method:"get",url:r.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),r.pm2=e(r.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),r.user=e(r.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"users/describe"},clone:{method:"post",url:r.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/contacts"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"users/create_many"},changePassword:{isArray:!1,method:"put",url:r.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/avatar"},getOpenTabs:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/open_tabs"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/recordings"},getScreenRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/screen_recordings"},getChatInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax/interactions"},getWhatsappInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp/interactions"},login:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/unpause"},messengerSoundNotification:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/messengerSoundNotification"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_interactions"},addWhatsappInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_interactions"},removeWhatsappInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_interactions"},getVoicePrefixes:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/prefixes"},getFaxAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax_accounts"},addFaxAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_accounts"},removeFaxAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_accounts"},getMailAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail_accounts"},addMailAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_accounts"},removeMailAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_accounts"},getOpenchannelAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel_accounts"},addOpenchannelAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_accounts"},removeOpenchannelAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_accounts"},getSmsAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms_accounts"},addSmsAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_accounts"},removeSmsAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_accounts"},getChatWebsites:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat_websites"},addChatWebsites:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_websites"},removeChatWebsites:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_websites"},getWhatsappAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp_accounts"},addWhatsappAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_accounts"},removeWhatsappAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_accounts"},getScheduledCalls:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/scheduled_calls"},getApiKey:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/api_key"},createApiKey:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/api_key"},removeApiKey:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/api_key"},whoami:{isArray:!1,method:"get",url:r.baseUrl+"users/whoami"},getPresence:{isArray:!1,method:"get",url:r.baseUrl+"users/presence"}}),r.voiceChanSpy=e(r.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:r.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceContext=e(r.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:r.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceExtension=e(r.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:r.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"voice/extensions/:id/applications"}}),r.voiceMusicOnHold=e(r.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:r.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:r.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:r.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:r.baseUrl+"voice/mohs/:id/sounds"}}),r.voiceQueue=e(r.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/blacklists"}}),r.voiceRecording=e(r.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:r.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/downloads"},runTranscribe:{isArray:!1,method:"post",url:r.baseUrl+"voice/recordings/:id/transcribe"},downloadTranscribe:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/transcribe",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.screenRecording=e(r.baseUrl+"screen/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"screen/recordings/describe"},clone:{method:"post",url:r.baseUrl+"screen/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"screen/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceMail=e(r.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/:id/messages"}}),r.voiceMailMessage=e(r.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceCallReport=e(r.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceDialReport=e(r.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceAgentReport=e(r.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueueReport=e(r.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/reports/index"}}),r.memberReport=e(r.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"members/reports/describe"},clone:{method:"post",url:r.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.trunk=e(r.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"trunks/describe"},clone:{method:"post",url:r.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceTransferReport=e(r.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailServerOut=e(r.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:r.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailAccount=e(r.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:r.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/applications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/verify"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/users"}}),r.mailQueue=e(r.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/queues/describe"},clone:{method:"post",url:r.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/users"}}),r.mailSubstatus=e(r.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:r.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailInteraction=e(r.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:r.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"mail/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailMessage=e(r.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/messages/describe"},clone:{method:"post",url:r.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailApplication=e(r.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/applications/describe"},clone:{method:"post",url:r.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailQueueReport=e(r.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.dashboard=e(r.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:r.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:r.baseUrl+"dashboards/:id/items"}}),r.dashboardItem=e(r.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxAccount=e(r.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:r.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/applications"},addAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/send"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/users"}}),r.faxApplication=e(r.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/applications/describe"},clone:{method:"post",url:r.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxInteraction=e(r.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:r.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"fax/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxMessage=e(r.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/messages/describe"},clone:{method:"post",url:r.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxQueue=e(r.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/queues/describe"},clone:{method:"post",url:r.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/users"}}),r.faxQueueReport=e(r.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsAccount=e(r.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:r.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/status"},statusGet:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/status"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/users"}}),r.smsApplication=e(r.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/applications/describe"},clone:{method:"post",url:r.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsInteraction=e(r.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:r.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"sms/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.smsMessage=e(r.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/messages/describe"},clone:{method:"post",url:r.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/messages/:id/status"}}),r.smsQueue=e(r.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/queues/describe"},clone:{method:"post",url:r.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/users"}}),r.openchannelAccount=e(r.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/interactions"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/users"},send:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/send"}}),r.openchannelApplication=e(r.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelInteraction=e(r.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.openchannelMessage=e(r.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/reject"}}),r.openchannelQueue=e(r.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/users"}}),r.chatWebsite=e(r.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/websites/describe"},clone:{method:"post",url:r.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/avatar"},addCustomerAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/customer_avatar"},addSystemAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/system_avatar"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/avatar"},getCustomerAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/customer_avatar"},getSystemAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/system_avatar"},notify:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/applications"},addProactiveActions:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/offline_messages"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/websites/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/users"}}),r.openchannelQueueReport=e(r.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatApplication=e(r.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/applications/describe"},clone:{method:"post",url:r.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInteraction=e(r.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:r.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},createVidaooSession:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/vidaoo"},customUpdate:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/custom_update"},abandon:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"chat/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.chatMessage=e(r.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/reject"}}),r.chatOfflineMessage=e(r.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueue=e(r.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/queues/describe"},clone:{method:"post",url:r.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/users"}}),r.chatGroup=e(r.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/groups/describe"},clone:{method:"post",url:r.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:r.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/messages"}}),r.chatProactiveAction=e(r.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:r.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCompany=e(r.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/companies/describe"},clone:{method:"post",url:r.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/companies/:id/contacts"}}),r.cmContact=e(r.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:r.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/create_many"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/tags"},setAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/phones"},getAdditionalPhones:{isArray:!0,method:"get",url:r.baseUrl+"cm/contacts/:id/phones"},duplicateAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/duplicateAdditionalPhones"},rescheduleAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/rescheduleAdditionalPhones"},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload/:id"},importUpdates:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/uploadUpdates/:id"},getJourney:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/journey"}}),r.cmHopper=e(r.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/preview"},getPreviewRecall:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/:id/previewrecall"},getOpenContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/opencontacts"},getTimezones:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/timezones"},getTimezone:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/timezone"}}),r.cmHopperBlack=e(r.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperFinal=e(r.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper_final/checkContactHopper"}}),r.cmHopperHistory=e(r.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCustomField=e(r.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:r.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.action=e(r.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"actions/describe"},clone:{method:"post",url:r.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.automation=e(r.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"automations/describe"},clone:{method:"post",url:r.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/actions"}}),r.cannedAnswer=e(r.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"canned_answers/describe"},clone:{method:"post",url:r.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),r.disposition=e(r.baseUrl+"dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dispositions/describe"},clone:{method:"post",url:r.baseUrl+"dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),r.condition=e(r.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"conditions/describe"},clone:{method:"post",url:r.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),r.interval=e(r.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"intervals/describe"},clone:{method:"post",url:r.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:r.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals/create_many"}}),r.pause=e(r.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"pauses/describe"},clone:{method:"post",url:r.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),r.cdr=e(r.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cdr/describe"},clone:{method:"post",url:r.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueuesLog=e(r.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:r.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),r.schedule=e(r.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"schedules/describe"},clone:{method:"post",url:r.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}},run:{isArray:!1,method:"get",url:r.baseUrl+"schedules/:id/run"}}),r.sound=e(r.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sounds/describe"},clone:{method:"post",url:r.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:r.baseUrl+"sounds/:id"}}),r.tag=e(r.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"tags/describe"},clone:{method:"post",url:r.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),r.contactItemType=e(r.baseUrl+"contact_item_types/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"contact_item_types/describe"},clone:{method:"post",url:r.baseUrl+"contact_item_types/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmContactHasItem=e(r.baseUrl+"cm_contact_has_items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm_contact_has_items/describe"},clone:{method:"post",url:r.baseUrl+"cm_contact_has_items/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperAdditionalPhone=e(r.baseUrl+"cm_hopper_additional_phones/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm_hopper_additional_phones/describe"},clone:{method:"post",url:r.baseUrl+"cm_hopper_additional_phones/:id/clone",params:{includeAll:"@includeAll"}}}),r.template=e(r.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"templates/describe"},clone:{method:"post",url:r.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),r.trigger=e(r.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"triggers/describe"},clone:{method:"post",url:r.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/actions"}}),r.variable=e(r.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"variables/describe"},clone:{method:"post",url:r.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),r.integration=e(r.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.integrationReport=e(r.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:r.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticCustomReport=e(r.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/query"}}),r.analyticDefaultReport=e(r.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/query"}}),r.analyticExtractedReport=e(r.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.analyticMetric=e(r.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:r.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticFieldReport=e(r.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:r.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:r.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:r.baseUrl+"analytics/field_reports/:id/create_many"}}),r.analyticTreeReport=e(r.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSalesforceAccount=e(r.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),r.intSalesforceConfiguration=e(r.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),r.intSalesforceField=e(r.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSugarcrmAccount=e(r.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),r.intSugarcrmConfiguration=e(r.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),r.intSugarcrmField=e(r.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDeskAccount=e(r.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/fields"}}),r.intDeskConfiguration=e(r.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/tags"}}),r.intDeskField=e(r.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZohoAccount=e(r.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/fields"}}),r.intZohoConfiguration=e(r.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),r.intZohoField=e(r.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZendeskAccount=e(r.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),r.intZendeskConfiguration=e(r.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),r.intZendeskField=e(r.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshdeskAccount=e(r.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),r.intFreshdeskConfiguration=e(r.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),r.intFreshdeskField=e(r.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intVtigerAccount=e(r.baseUrl+"integrations/vtiger/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/fields"}}),r.intVtigerConfiguration=e(r.baseUrl+"integrations/vtiger/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/descriptions"}}),r.intVtigerField=e(r.baseUrl+"integrations/vtiger/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intServicenowAccount=e(r.baseUrl+"integrations/servicenow/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/fields"}}),r.intServicenowConfiguration=e(r.baseUrl+"integrations/servicenow/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/descriptions"}}),r.intServicenowField=e(r.baseUrl+"integrations/servicenow/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDynamics365Account=e(r.baseUrl+"integrations/dynamics365/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/fields"}}),r.intDynamics365Configuration=e(r.baseUrl+"integrations/dynamics365/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/descriptions"}}),r.intDynamics365Field=e(r.baseUrl+"integrations/dynamics365/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshsalesAccount=e(r.baseUrl+"integrations/freshsales/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/fields"}}),r.intFreshsalesConfiguration=e(r.baseUrl+"integrations/freshsales/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/configurations/:id/clone",params:{includeAll:"@includeAll"}},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/descriptions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/fields"}}),r.intFreshsalesField=e(r.baseUrl+"integrations/freshsales/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.network=e(r.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"networks/describe"},clone:{method:"post",url:r.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueueReport=e(r.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInternalMessage=e(r.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:r.baseUrl+"chat/internal/messages/users"}}),r.jscriptyAnswerReport=e(r.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyQuestionReport=e(r.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptySessionReport=e(r.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/sessions/reports/:id/questions"}}),r.smsQueueReport=e(r.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReport=e(r.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReportDetail=e(r.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyProject=e(r.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/summary",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.setting=e(r.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"settings/describe"},clone:{method:"post",url:r.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/gdpr"},addPreferred:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/preferred"},getPreferred:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/preferred"},addFavicon:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/favicon"},getFavicon:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/favicon"},getDate:{isArray:!1,method:"get",url:r.baseUrl+"settings/now"}}),r.squareOdbc=e(r.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/odbc/describe"},clone:{method:"post",url:r.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:r.baseUrl+"square/odbc/:id/test"}}),r.squareProject=e(r.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/projects/describe"},clone:{method:"post",url:r.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareRecording=e(r.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/recordings/describe"},clone:{method:"post",url:r.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.squareMessage=e(r.baseUrl+"square/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/messages/describe"},clone:{method:"post",url:r.baseUrl+"square/messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.team=e(r.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"teams/describe"},clone:{method:"post",url:r.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:r.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"teams/:id/users"}}),r.license=e(r.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"license/describe"},clone:{method:"post",url:r.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}},downloadLogFile:{isArray:!1,method:"get",url:r.baseUrl+"license/download_log_file",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.campaign=e(r.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"campaigns/describe"},clone:{method:"post",url:r.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/blacklists"}}),r.migration=e(r.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"migrations/describe"},clone:{method:"post",url:r.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.attachment=e(r.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"attachments/describe"},clone:{method:"post",url:r.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.plugin=e(r.baseUrl+"plugins/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"plugins/describe"},clone:{method:"post",url:r.baseUrl+"plugins/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"plugins/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},upload:{isArray:!1,method:"post",url:r.baseUrl+"plugins/"},delete:{isArray:!1,method:"delete",url:r.baseUrl+"plugins/:id"},webhookGet:{isArray:!1,method:"get",url:r.baseUrl+"plugins/webhook"},webhookPost:{isArray:!1,method:"post",url:r.baseUrl+"plugins/webhook"}}),r.mailTransferReport=e(r.baseUrl+"mail/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatTransferReport=e(r.baseUrl+"chat/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxTransferReport=e(r.baseUrl+"fax/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelTransferReport=e(r.baseUrl+"openchannel/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsTransferReport=e(r.baseUrl+"sms/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmList=e(r.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/lists/describe"},clone:{method:"post",url:r.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:r.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/contacts/csv",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},addCustomField:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/fields"},getGlobalCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/global_fields"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/users"}}),r.voicePrefix=e(r.baseUrl+"voice/prefixes/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/prefixes/describe"},clone:{method:"post",url:r.baseUrl+"voice/prefixes/:id/clone",params:{includeAll:"@includeAll"}},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/users"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/teams"}}),r.userProfile=e(r.baseUrl+"userProfiles/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfiles/describe"},clone:{method:"post",url:r.baseUrl+"userProfiles/:id/clone",params:{includeAll:"@includeAll"}},addSections:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/sections"},removeSections:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/sections"},getSections:{isArray:!0,method:"get",url:r.baseUrl+"userProfiles/:id/sections"},addResources:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/resources"},removeResources:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/resources"},getResources:{isArray:!1,method:"get",url:r.baseUrl+"userProfiles/:id/resources"}}),r.userProfileSection=e(r.baseUrl+"userProfile/sections/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/sections/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/sections/:id/clone",params:{includeAll:"@includeAll"}}}),r.userProfileResource=e(r.baseUrl+"userProfile/resources/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/resources/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/resources/:id/clone",params:{includeAll:"@includeAll"}}}),r.userNotification=e(r.baseUrl+"userNotifications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userNotifications/describe"},clone:{method:"post",url:r.baseUrl+"userNotifications/:id/clone",params:{includeAll:"@includeAll"}},sendUserNotification:{isArray:!1,method:"post",url:r.baseUrl+"userNotifications/"}}),r.whatsappAccount=e(r.baseUrl+"whatsapp/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/accounts/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/users"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/applications"},notify:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/notify"},send:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/send"}}),r.whatsappApplication=e(r.baseUrl+"whatsapp/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/applications/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappInteraction=e(r.baseUrl+"whatsapp/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/interactions/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.whatsappMessage=e(r.baseUrl+"whatsapp/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/messages/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/messages/:id/status"}}),r.whatsappQueueReport=e(r.baseUrl+"whatsapp/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappTransferReport=e(r.baseUrl+"whatsapp/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappQueue=e(r.baseUrl+"whatsapp/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/queues/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/users"}}),r.cloudProvider=e(r.baseUrl+"cloudProviders/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cloudProviders/describe"},clone:{method:"post",url:r.baseUrl+"cloudProviders/:id/clone",params:{includeAll:"@includeAll"}},oauth2MicrosoftAuthorize:{method:"get",url:r.baseUrl+"cloudProviders/:id/oauth2/microsoft/authorize"}}),r.realtime=e(r.baseUrl+"realtime",{},{getAgents:{isArray:!1,method:"get",url:r.baseUrl+"realtime/agents"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"realtime/queues"}}),r.userSetting=e(r.baseUrl+"user-settings/:id",{id:"@id"},{update:{method:"put",isArray:!1}}),r}e.$inject=["$resource","userProfileManager"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,n){n.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.fallbackLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,n,t,a){var i=this;i.themes=e.themes,i.direction="ltr";var s=t.get("motion.language");s&&(n.use(s),0<=["ar","fa","he"].indexOf(s)&&a.setting.get({id:1}).$promise.then(function(e){e&&e.rtlSupport&&(i.direction="rtl")}).catch(function(e){e&&toasty.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})}))}e.$inject=["motionTheming","$translate","$cookies","api"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var n=new Date,t=new Date(e);return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?a("date")(t.getTime(),"shortTime"):t.getDate()===n.getDate()-1&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(t.getTime(),"shortTime"):a("date")(t.getTime(),"MMM d, y h:mm a")}}function n(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],n.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,n,t){var a,i={},s=0;for(a in e)if(t<=s&&(i[a]=e[a]),++s===t+n)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],n=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],t=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];return{getMonthName:function(){return e},getMonthNumber:function(){return n},getDaysOfWeek:function(){return t},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",n).factory("jscookie",function(){return Cookies}).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,n,t){var a;t.html5Mode(!0),n.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",s={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:s[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:s[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:s[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:s[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:s[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver","settingsManager",function(e,n){return e.resolve("setting@get",{id:1}).then(function(e){return n.set(e),e})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,n){e.onStart({},n.showLoadingIndicator),e.onFinish({},n.hideLoadingIndicator)}e.$inject=["$transitions","LoadingIndicatorService"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i,o={};function s(){a.$broadcast("socket:connect"),i&&i.connected||(i=io({query:e.getCurrentUser()?"id="+e.getCurrentUser().id:void 0,transports:["websocket","polling"]})).once("disconnect",n)}function n(e){i.once("connect",s),"logout"===e?i.removeAllListeners():a.$broadcast("socket:disconnect"),i&&i.connected&&i.disconnect()}function r(e,n,t){o[e]||(o[e]=[]),o[e].push({wrapper:n,fn:t})}return{connect:s,disconnect:n,getListeners:function(e){return e?o[e]:o},on:function(e,n){n=n||angular.noop,i||s();var t=function(){var e=arguments;a.$applyAsync(function(){n.apply(i,e)})};r(e,t,n),i.on(e,t)},onWithoutApply:function(e,n){n=n||angular.noop,i||s();var t=function(){n.apply(i,arguments)};r(e,t,n),i.on(e,t)},emit:function(e,n,t){t=t||angular.noop,i||s(),i.emit(e,n,function(){var e=arguments;a.$applyAsync(function(){t.apply(i,e)})})},removeAllListeners:function(e){var n;i||s(),i.removeAllListeners(e),n=e,_.isEmpty(o[n])||delete o[n]},removeListener:function(e,n){i||s();var t=function(e,n){var t=o[e];if(!_.isEmpty(t))for(var a=0;a<t.length;a++){var i=t[a];if(i.fn===n){var s=i.wrapper;return t.splice(a,1),s}}}(e,n);i.removeListener(e,t)}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r){var l=this;l.progresslogin=!1,l.googleSsoEnabled=!1,l.adSsoEnabled=!1,l.login=function(){return l.progresslogin=!0,l.message="",s.login(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.loginOauth=function(e){l.message="",t.location.href=s.loginSSO(e)},l.loginAD=function(){return l.progresslogin=!0,l.message="",s.loginAD(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.onInit=function(){{if(n.params.token&&n.params.userId)return s.removeCookies(),l.progresslogin=!0,o.secureCookieEnabled?r.set("motion.token",n.params.token,{secure:!0,sameSite:"none"}):r.set("motion.token",n.params.token),i.user.get({id:n.params.userId}).$promise.then(function(e){e&&(s.setCurrentUser(e),n.go("app.dashboards.general"))}).finally(function(){l.progresslogin=!1});s.isLoggedIn()&&n.go("app.dashboards.general")}l.googleSsoEnabled=o.googleSsoEnabled,l.adSsoEnabled=o.adSsoEnabled},l.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth","setting","jscookie"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_EXTRACTEDREPORT",g.extractedReport=angular.copy(l),g.extractedReports=r,g.newExtractedReport=!1,g.extractedReport||(g.extractedReport={},g.title="ANALYTICS.NEW_EXTRACTEDREPORT",g.newExtractedReport=!0),g.addNewExtractedReport=function(){g.errors=[],d.analyticExtractedReport.save(g.extractedReport).$promise.then(function(e){g.extractedReports.unshift(e.toJSON()),o.success({title:"ExtractedReport properly created",msg:g.extractedReport.name?g.extractedReport.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveExtractedReport=function(){g.errors=[],d.analyticExtractedReport.update({id:g.extractedReport.id},g.extractedReport).$promise.then(function(e){var n=_.find(g.extractedReports,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ExtractedReport properly saved!",msg:g.extractedReport.name?g.extractedReport.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteExtractedReport=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticExtractedReport.delete({id:g.extractedReport.id}).$promise.then(function(){_.remove(g.extractedReports,{id:g.extractedReport.id}),o.success({title:"ExtractedReport properly deleted!",msg:(g.extractedReport.name||"extractedReport")+" has been deleted!"}),v(g.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","extractedReports","extractedReport","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.extractedReports=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="extractedReports",f.listOrder="",f.listOrderAsc=null,f.selectedExtractedReports=[],f.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:f.extractedReports.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.analyticExtractedReport.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("extractedReport")+"?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getExtractedReports=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticExtractedReport.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ExtractedReports",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditExtractedReport=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:n,extractedReports:f.extractedReports.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteExtractedReport=y,f.exportSelectedExtractedReports=function(){var e=angular.copy(f.selectedExtractedReports);return f.selectedExtractedReports=[],e},f.deleteSelectedExtractedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+f.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedExtractedReports.forEach(function(e){y(e)}),f.selectedExtractedReports=[]})},f.deselectExtractedReports=function(){f.selectedExtractedReports=[]},f.selectAllExtractedReports=function(){f.selectedExtractedReports=f.extractedReports.rows};var b=!0,A=1;function E(e){f.extractedReports=e||{count:0,rows:[]}}function y(e){m.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(f.extractedReports.rows,{id:e.id}),f.extractedReports.count-=1,f.extractedReports.rows.length||f.getExtractedReports(),p.success({title:_.startCase("ExtractedReport")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","extractedReports","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_METRIC",g.metric=angular.copy(l),g.metrics=r,g.newMetric=!1,g.metric||(g.metric={table:"report_agent"},g.title="ANALYTICS.NEW_METRIC",g.newMetric=!0),g.addNewMetric=function(){g.errors=[],d.analyticMetric.save(g.metric).$promise.then(function(e){g.metrics.unshift(e.toJSON()),o.success({title:"Metric properly created",msg:g.metric.name?g.metric.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMetric=function(){g.errors=[],d.analyticMetric.update({id:g.metric.id},g.metric).$promise.then(function(e){var n=_.find(g.metrics,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Metric properly saved!",msg:g.metric.name?g.metric.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMetric=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticMetric.delete({id:g.metric.id}).$promise.then(function(){_.remove(g.metrics,{id:g.metric.id}),o.success({title:"Metric properly deleted!",msg:(g.metric.name||"metric")+" has been deleted!"}),v(g.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","metrics","metric","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.metrics=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="metrics",f.listOrder="",f.listOrderAsc=null,f.selectedMetrics=[],f.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},f.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"CDR",value:"'cdr'"},{option:"Chat Website",value:"'chat_websites'"},{option:"Chat Interaction",value:"'chat_interactions'"},{option:"Chat Messages",value:"'chat_messages'"},{option:"Chat Offline Messages",value:"'chat_offline_messages'"},{option:"Chat Queues",value:"'chat_queues'"},{option:"Chat Report Queue",value:"'report_chat_queue'"},{option:"Chat Report Transfer",value:"'report_chat_transfer'"},{option:"Companies",value:"'cm_companies'"},{option:"Call transfer report",value:"'report_call_transfer'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dial Report",value:"'report_dial'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Email Account",value:"'mail_accounts'"},{option:"Email Interaction",value:"'mail_interactions'"},{option:"Email Messages",value:"'mail_messages'"},{option:"Email Queues",value:"'mail_queues'"},{option:"Email Report Queue",value:"'report_mail_queue'"},{option:"Email Report Transfer",value:"'report_mail_transfer'"},{option:"Fax Account",value:"'fax_accounts'"},{option:"Fax Interaction",value:"'fax_interactions'"},{option:"Fax Messages",value:"'fax_messages'"},{option:"Fax Queues",value:"'fax_queues'"},{option:"Fax Report Queue",value:"'report_fax_queue'"},{option:"Fax Report Transfer",value:"'report_fax_transfer'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Lists",value:"'cm_lists'"},{option:"Member Report",value:"'report_member'"},{option:"Openchannel Account",value:"'openchannel_accounts'"},{option:"Openchannel Interaction",value:"'openchannel_interactions'"},{option:"Openchannel Messages",value:"'openchannel_messages'"},{option:"Openchannel Queues",value:"'openchannel_queues'"},{option:"Openchannel Report Queue",value:"'report_openchannel_queue'"},{option:"Openchannel Report Transfer",value:"'report_openchannel_transfer'"},{option:"Queue Report",value:"'report_queue'"},{option:"SMS Account",value:"'sms_accounts'"},{option:"SMS Interaction",value:"'sms_interactions'"},{option:"SMS Messages",value:"'sms_messages'"},{option:"SMS Queues",value:"'sms_queues'"},{option:"SMS Report Queue",value:"'report_sms_queue'"},{option:"SMS Report Transfer",value:"'report_sms_transfer'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"},{option:"Whatsapp Account",value:"'whatsapp_accounts'"},{option:"Whatsapp Interaction",value:"'whatsapp_interactions'"},{option:"Whatsapp Messages",value:"'whatsapp_messages'"},{option:"Whatsapp Queues",value:"'whatsapp_queues'"},{option:"Whatsapp Report Queue",value:"'report_whatsapp_queue'"},{option:"Whatsapp Report Transfer",value:"'report_whatsapp_transfer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{metric:e,metrics:f.metrics.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("metric")+"?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMetrics=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticMetric.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Metrics",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMetric=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:n,metrics:f.metrics.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMetric=y,f.exportSelectedMetrics=function(){var e=angular.copy(f.selectedMetrics);return f.selectedMetrics=[],e},f.deleteSelectedMetrics=function(e){var n=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+f.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMetrics.forEach(function(e){y(e)}),f.selectedMetrics=[]})},f.deselectMetrics=function(){f.selectedMetrics=[]},f.selectAllMetrics=function(){f.selectedMetrics=f.metrics.rows};var b=!0,A=1;function E(e){f.metrics=e||{count:0,rows:[]}}function y(e){m.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(f.metrics.rows,{id:e.id}),f.metrics.count-=1,f.metrics.rows.length||f.getMetrics(),p.success({title:_.startCase("Metric")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","metrics","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o){var r=this;function l(){n.hide()}r.errors=[],r.report=angular.copy(t),r.report.name+="-copy",r.treeCustomData=o,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,n){r.currentNode=n.node}},r.copyReport=function(){var t;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){t=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(n).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:t.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){n.hide()}c.errors=[],c.joinTables=[],c.title="ANALYTICS.EDIT_REPORT",c.crudPermissions=d,c.report=angular.copy(i),c.reports=a,c.newReport=!1,c.tables=l.getMap(),c.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"cross_join",value:"Cross Join"}],c.report||(c.report={name:"",table:"report_agent",description:"",parent:r.id},c.title="ANALYTICS.NEW_REPORT",c.newReport=!0),c.addNewReport=function(){c.errors=[],c.report.joins=_.map(c.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),c.report.joins=JSON.stringify(c.report.joins),s[o].save(c.report).$promise.then(function(e){c.reports.unshift(e),t.success({title:"Report properly created",msg:c.report.name?c.report.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveReport=function(){c.errors=[],s[o].update({id:c.report.id},c.report).$promise.then(function(e){var n=_.find(c.reports,{id:e.id});n&&_.merge(n,e),t.success({title:"Report properly saved!",msg:c.report.name?c.report.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteReport=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){s[o].delete({id:c.report.id}).$promise.then(function(){_.remove(c.reports,{id:c.report.id}),t.success({title:"Report properly deleted!",msg:c.report.name?c.report.name+" has been deleted!":""}),m()}).catch(function(e){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},c.closeDialog=m,c.selectedTableChange=function(e){e&&(delete c.selectedItem,c.joinTables.push(e))},c.removeJoin=function(e){c.joinTables.splice(e,1)},c.getFields=function(n,t,e){var a=_.find(c.tables,{name:e});a&&a.api&&s[a.api].describe().$promise.then(function(e){n[t]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,s,o,e){var r=this;r.report={},r.conditions=e.getConditions,r.init=function(e,n){r.report=e,r.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}},r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1};for(var t=0;t<r.report.condition.group.rules.length;t++)if(r.report.condition.group.rules[t].field){var a=r.report.condition.group.rules[t].field.split(".");1===a.length&&(r.report.condition.group.rules[t].field=r.report.table+"."+r.report.condition.group.rules[t].field)}s.getColumns(r.report.table).then(function(e){r.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},r.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(n,1)},function(){console.log("CANCEL")})},r.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(a){var i={report_call_transfer:"voiceTransferReport",cm_companies:"cmCompany",cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",cm_lists:"cmList",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",report_chat_transfer:"chatTransferReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",report_mail_transfer:"mailTransferReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",report_openchannel_transfer:"openchannelTransferReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",report_sms_transfer:"smsTransferReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_transfer:"faxTransferReport",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_dial:"voiceDialReport",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording",cdr:"cdr",whatsapp_accounts:"whatsappAccount",whatsapp_queues:"whatsappQueue",whatsapp_interactions:"whatsappInteraction",whatsapp_messages:"whatsappMessage",report_whatsapp_queue:"whatsappQueueReport",report_whatsapp_transfer:"whatsappTransferReport"};return{getMap:function(){var t=[];return _.forIn(i,function(e,n){t.push({name:n,api:e})}),t},getColumns:function(e){var n=i[e],t={};return"cm_contacts"===e&&(t.analytics=!0),a[n].describe(t).$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;(u.errors=[],u.title="Edit Report Field",u.report=i,u.reportField=angular.copy(o),u.reportFields=s,u.metrics=r,u.columns=l,u.sqlUtil=d,u.newReportField=!1,u.crudPermissions=m,u.reportField)?(u.reportField.type=u.reportField.custom?"custom":u.reportField.MetricId?"metric":"column",u.reportField.field&&!u.reportField.custom&&_.isNil(u.reportField.MetricId)&&1===u.reportField.field.split(".").length&&(u.reportField.field=u.report.table+"."+u.reportField.field)):(u.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},u.title="New Report Field",u.newReportField=!0);function p(){t.hide()}u.addNewReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,u.reportField.CustomReportId=u.report.id,c.analyticFieldReport.save(u.reportField).$promise.then(function(e){u.reportFields.push(e),a.success({title:"Report field properly created",msg:u.reportField.field?u.reportField.field+" has been created!":u.reportField.type+" has been created!"}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},u.saveReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,c.analyticFieldReport.update({id:u.reportField.id},u.reportField).$promise.then(function(e){var n=_.find(u.reportFields,{id:e.id});n&&_.merge(n,e),a.success({title:"Report Field properly saved!",msg:u.reportField.field?u.reportField.field+" has been saved!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},u.deleteReportField=function(e){u.errors=[];var n=t.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){c.analyticFieldReport.delete({id:u.reportField.id}).$promise.then(function(){_.remove(u.reportFields,{id:u.reportField.id}),a.success({title:"Report Field properly deleted!",msg:u.reportField.field?u.reportField.field+" has been deleted!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},u.closeDialog=p}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){o.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e,n){c.report=e,c.query.CustomReportId=c.report.id,c.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),o.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=o.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,n){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:n,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null,crudPermissions:c.crudPermissions}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var n=_.find(c.metrics,{id:e});return n?n.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var n=_.find(c.metrics,{id:e});return n?n.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){o.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),s.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}n.$watch("vm_rf.query.filter",function(e,n){m?t(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(e){return _.isArray(e)}o.report=a||{},o.userProfileSection=s&&1==s.count?s.rows[0]:null,o.crudPermissions=i.parseCrudPermissions(o.userProfileSection?o.userProfileSection.crudPermissions:null),o.selectedTab=e.params.tab||0,o.gotoReports=function(){e.go("app.analytics.reports",{},{reload:"app.analytics.reports"})},o.saveReport=function(){o.report.conditions=angular.toJson(o.report.condition),t.analyticCustomReport.update({id:o.report.id},_.omit(o.report,"joins")).$promise.then(function(){n.success({title:"Report updated!",msg:o.report.name?o.report.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.previewReport=function(){o.columns=[],o.rows=[],o.error=!1,t.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:o.report.id}).$promise.then(function(e){return o.columns=e?e.rows:[],t.analyticCustomReport.preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.queryReport=function(){return o.queryResult="Loading...",t.analyticCustomReport.query({id:o.report.id}).$promise.then(function(e){o.queryResult=e.sql}).catch(function(e){o.queryResult="",console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.mapArray=function(e,n){if(r(e))return _.map(e,n).join(",");return""},o.isArray=r,o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$state","toasty","api","report","Auth","userProfileSection"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.errors=[],o.report=angular.copy(a),o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},o.closeDialog=function(){n.hide()},function(){o.columns=[],o.rows=[],o.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=o.report.id,o.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return o.columns=e?e.rows:[],i[s].preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.reports={count:0,rows:[]},p.userProfile=r,p.userProfileSection=l&&1==l.count?l.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.selectedReports=[],p.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},p.apiName=null,p.currentPath="",p.customTree=!0,p.editstate=function(e,n){s.go("app.analytics.reports.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.copydialog=function(e,n){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,treeCustomData:p.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},p.previewdialog=function(e,n){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName}})},p.rundialog=function(e,n){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,currentPath:p.currentPath}})},p.downloadfile=function(a,e){var i;d.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===p.apiName?"CustomReportId":"DefaultReportId"]=a.id,d.analyticFieldReport.get(n).$promise}).then(function(e){for(var n=0;n<e.rows.length;n+=1)e.rows[n].MetricId&&(e.rows[n].field=i[e.rows[n].MetricId].metric,e.rows[n].custom=!0),delete e.rows[n].MetricId;var t=o.document.createElement("a");t.href="data:text/json;charset=utf-8,"+o.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),t.download=a.name+".json",t.target="_self",t.click(),m.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){b(e)},function(){console.log("CANCEL")})},p.success=h,p.getReports=f,p.createOrEditReport=function(e,n){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:n,reports:p.reports.rows,apiName:p.apiName,currentNode:p.currentNode,setting:null,crudPermissions:p.crudPermissions}})},p.importReport=function(e,n,t){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var t=atob(e.target.result.split(",")[1]);t=angular.fromJson(t),d.analyticCustomReport.save({name:t.name,description:t.description,table:t.table,conditions:t.conditions,joins:t.joins,parent:p.currentNode.id}).$promise.then(function(n){p.reports.rows.unshift(n),m.success({title:"Report saved!",msg:n.name?n.name+" has been saved!":""});var e=_.map(t.fields,function(e){return _.extend({},e,{CustomReportId:n.id})});return d.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){m.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),m.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else m.error({title:"Format Error",msg:"Please use only json files"})},p.deleteReport=b,p.exportSelectedReports=function(){var e=angular.copy(p.selectedReports);return p.selectedReports=[],e},p.deleteSelectedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+p.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){p.selectedReports.forEach(function(e){b(e)}),p.selectedReports=[]})},p.deselectReports=function(){p.selectedReports=[]},p.selectAllReports=function(){p.selectedReports=p.reports.rows},p.treeDefaultData=c.rows[0]?angular.fromJson(c.rows[0].tree):[],p.treeCustomData=c.rows[1]?angular.fromJson(c.rows[1].tree):[],p.treeDefaultConfig=S(!1),p.treeCustomConfig=S(!0),p.treeDefaultEvents=T(!1),p.treeCustomEvents=T(!0);var g=!0,v=1;function h(e){p.reports=e||{count:0,rows:[]}}function f(){if(p.query.offset=(p.query.page-1)*p.query.limit,p.apiName)if("admin"===p.currentUser.role||p.userProfileSection.autoAssociation)p.promise=d[p.apiName].get(p.query,h).$promise;else{var a=[];p.promise=d[p.apiName].get(p.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:p.userProfileSection.id,type:"analyticDefaultReport"===p.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),h({count:t.length,rows:t})}return h(null)}):h(null)})}}function b(e){p.apiName&&d[p.apiName].delete({id:e.id}).$promise.then(function(){_.remove(p.reports.rows,{id:e.id}),p.reports.count-=1,p.reports.rows.length||p.getReports(),m.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function A(e,n){p.treeDefaultInstance.jstree(!0).deselect_all(),p.treeDefaultInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!0,p.currentPath=p.treeCustomInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticCustomReport",p.query.parent=n.node.id,f()}function E(e,n){p.treeCustomInstance.jstree(!0).deselect_all(),p.treeCustomInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!1,p.currentPath=p.treeDefaultInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticDefaultReport",p.query.parent=n.node.id,f()}function y(e,n){var t,a,i;"rename_node"===e.type&&(a=(t=n).node.id,i="","custom"===t.node.parent?t.node.id.includes("custom_report_")||(i="custom_report_"+t.text):i=t.node.parent+"_"+t.text,p.treeCustomInstance.jstree(!0).set_id(t.node,"custom_report_"+i.toLowerCase()),t.node.a_attr.id=t.node.a_attr.id.replace(a,t.node.id),t.node.li_attr.id=t.node.id);var s=angular.toJson(p.treeCustomInstance.jstree(!0).get_json("#"));d.analyticTreeReport.update({id:2,tree:s}).$promise.then(function(){c.rows[1]&&(c.rows[1].tree=s),m.success({title:"Node Updated",msg:n.node.text?n.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function S(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(t){var e={};return p.crudPermissions.canEdit&&_.assign(e,{create:{label:n.instant("ANALYTICS.CREATE"),action:function(){t=p.treeCustomInstance.jstree(!0).create_node(t),p.treeCustomInstance.jstree(!0).edit(t)}},rename:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.RENAME"),action:function(){p.treeCustomInstance.jstree(!0).edit(t)}}}),p.crudPermissions.canDelete&&_.assign(e,{remove:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(t.text?t.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n=p.treeCustomInstance.jstree(!0).get_parent(t);n=p.treeCustomInstance.jstree(!0).get_node(n),p.treeCustomInstance.jstree(!0).delete_node(t),e=[t.id].concat(t.children_d||[]),d.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){b(e)})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),p.treeCustomInstance.jstree(!0).select_node(n)})}}}),e}}}}function T(e){return e?{create_node:y,rename_node:y,move_node:y,delete_node:y,select_node:A}:{select_node:E}}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getReports())}),e.$watch("vm.search",function(e,n){p.treeDefaultInstance&&p.treeDefaultInstance.jstree(!0).search(e),p.treeCustomInstance&&p.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","userProfile","userProfileSection","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startTime:new Date(moment().startOf("day")),startDate:new Date(moment().startOf("day")),endTime:new Date(moment().endOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){t.hide()}l.errors=[],l.report=angular.copy(n),l.export={},l.runReport=function(n){l.export.name=l.export.name.replace(/\//g,"_"),l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).set("hour",l.export.startTime.getHours()).set("minute",l.export.startTime.getMinutes()).set("second",l.export.startTime.getSeconds()).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).set("hour",l.export.endTime.getHours()).set("minute",l.export.endTime.getMinutes()).set("second",l.export.endTime.getSeconds()).format("YYYY-MM-DD HH:mm:ss")}),i[s].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?t.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(o.body),targetEvent:n,skipHide:!0,locals:{apiName:s,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var n={fields:"field,alias",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",n)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){o.offset=(r.query.page-1)*r.query.limit,o.limit=r.query.limit,r.promise=t[s].run(o,l).$promise},r.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_ODBC",g.odbc=angular.copy(l),g.odbcs=r,g.newOdbc=!1,g.odbc||(g.odbc={},g.title="CALLYSQUARE.NEW_ODBC",g.newOdbc=!0),g.addNewOdbc=function(){g.errors=[],d.squareOdbc.save(g.odbc).$promise.then(function(e){g.odbcs.unshift(e.toJSON()),o.success({title:"Odbc properly created",msg:g.odbc.name?g.odbc.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOdbc=function(){g.errors=[],d.squareOdbc.update({id:g.odbc.id},g.odbc).$promise.then(function(e){var n=_.find(g.odbcs,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Odbc properly saved!",msg:g.odbc.name?g.odbc.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOdbc=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareOdbc.delete({id:g.odbc.id}).$promise.then(function(){_.remove(g.odbcs,{id:g.odbc.id}),o.success({title:"Odbc properly deleted!",msg:(g.odbc.name||"odbc")+" has been deleted!"}),v(g.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","odbcs","odbc","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.odbcs=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="odbcs",f.listOrder="",f.listOrderAsc=null,f.selectedODBC=[],f.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{odbc:e,odbcs:f.odbcs.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.testtestOdbc=function(e,n){return m.squareOdbc.test({id:e.id}).$promise.then(function(){p.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("odbc")+"?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getODBC=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareOdbc.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ODBC",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOdbc=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:n,odbcs:f.odbcs.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOdbc=y,f.exportSelectedODBC=function(){var e=angular.copy(f.selectedODBC);return f.selectedODBC=[],e},f.deleteSelectedODBC=function(e){var n=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+f.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedODBC.forEach(function(e){y(e)}),f.selectedODBC=[]})},f.deselectODBC=function(){f.selectedODBC=[]},f.selectAllODBC=function(){f.selectedODBC=f.odbcs.rows};var b=!0,A=1;function E(e){f.odbcs=e||{count:0,rows:[]}}function y(e){m.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(f.odbcs.rows,{id:e.id}),f.odbcs.count-=1,f.odbcs.rows.length||f.getODBC(),p.success({title:_.startCase("Odbc")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","odbcs","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o,r,l,d){var c=this;function m(e){n.hide(e)}c.errors=[],c.title="CALLYSQUARE.EDIT_PROJECT",c.crudPermissions=d,c.project=angular.copy(o),c.newWindow=!0,c.projects=s,c.newProject=!1,c.openFromEditor=l,c.project||(c.project={name:"",description:""},c.title="CALLYSQUARE.NEW_PROJECT",c.newProject=!0),c.addNewProject=function(){c.errors=[],r.squareProject.save(c.project).$promise.then(function(e){c.projects.unshift(e),i.success({title:"Project properly created",msg:c.project.name?c.project.name+" has been created!":""}),m(e),c.openFromEditor&&(c.newWindow?t.open("/callysquare/projects/"+e.id,"_blank"):a.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveProject=function(){c.errors=[],r.squareProject.update({id:c.project.id},c.project).$promise.then(function(e){var n=_.find(c.projects,{id:e.id});n&&_.merge(n,e),i.success({title:"Project properly saved!",msg:c.project.name?c.project.name+" has been saved!":""}),m(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteProject=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){r.squareProject.delete({id:c.project.id}).$promise.then(function(){_.remove(c.projects,{id:c.project.id}),i.success({title:"Project properly deleted!",msg:c.project.name?c.project.name+" has been deleted!":""}),m(c.project)}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$window","$state","Auth","toasty","projects","project","api","openFromEditor","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T,I,O,C,w,R,x,N,D){var P=this,L={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],google_cloud_tts:["apiKey","google_cloud_tts_text_type","text"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","text","aws_text_type"],lumenvoxtts:["text"],sestektts:["text"],lumenvoxasr:["grammar"],sestekasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"],dialogflow:["key","text","dialogflow_language"],awslex:["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],sesteknda:["text","ndauth_url","username","password","ndassistant_url"],restapi:["url","method"],mrcpsynth:["text"],mrcprecog:["grammar"],dialogflowV2:["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"]},k={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},M={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function U(e,n,t,a){return _.map(e,function(e){return{value:e[n],option:e[t],group:a?e[a]:void 0,canSelect:void 0===e.canSelect||e.canSelect}})}function F(){var e=Number(_.find(P.attributes,{name:"sip_id"}).value);if(!_.some(d,{id:e})&&0<e)return t.user.get({id:e,fields:"id,fullname,role"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,d.push(n),P.values.sip_id=U(d,"id","fullname","role")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_USER",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sip_id=U(d,"id","fullname","role")}function $(){var e=Number(_.find(P.attributes,{name:"list_id"}).value);if(!_.some(E,{id:e})&&0<e)return t.cmList.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,E.push(n),P.values.list_id=U(E,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_LIST",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.list_id=U(E,"id","name")}function q(){var e=Number(_.find(P.attributes,{name:"trunk_id"}).value);if(!_.some(c,{id:e})&&0<e)return t.trunk.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,c.push(n),P.values.trunk_id=U(c,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_id=U(c,"id","name")}function G(){var e=_.find(P.attributes,{name:"trunk_name"}).value;if(!_.some(c,{name:e})&&e)return t.trunk.get({name:e,fields:"id,name"}).$promise.then(function(e){if(0<e.count&&0<e.rows.length){var n=e.rows[0];n.canSelect=!1,c.push(n),P.values.trunk_name=U(c,"name","name")}}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_name=U(c,"name","name")}function H(){var e=Number(_.find(P.attributes,{name:"queue_id"}).value);if(!_.some(m,{id:e})&&0<e)return t.voiceQueue.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,m.push(n),P.values.queue_id=U(m,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_QUEUE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.queue_id=U(m,"id","name")}function V(){var e=Number(_.find(P.attributes,{name:"file_id"}).value);if(!_.some(u,{id:e})&&0<e)return t.sound.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,u.push(n),P.values.file_id=U(u,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SOUND",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.file_id=U(u,"id","name")}function B(){var e=Number(_.find(P.attributes,{name:"variable_id"}).value);if(!_.some(p,{id:e})&&0<e)return t.variable.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,p.push(n),P.values.variable_id=U(p,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_VARIABLE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.variable_id=U(p,"id","name")}function Q(){var e=Number(_.find(P.attributes,{name:"odbc_id"}).value);if(!_.some(g,{id:e})&&0<e)return t.squareOdbc.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,g.push(n),P.values.odbc_id=U(g,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_ODBC",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.odbc_id=U(g,"id","name")}function W(){var e=Number(_.find(P.attributes,{name:"project_id"}).value);if(!_.some(v,{id:e})&&0<e)return t.squareProject.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,v.push(n),P.values.project_id=U(v,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PROJECT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.project_id=U(v,"id","name")}function j(){var e=Number(_.find(P.attributes,{name:"context"}).value);if(!_.some(h,{id:e})&&0<e)return t.voiceContext.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,h.push(n),P.values.context=U(h,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_CONTEXT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.context=U(h,"id","name")}function Y(){var e=Number(_.find(P.attributes,{name:"interval_id"}).value);if(!_.some(f,{id:e})&&0<e)return t.interval.get({id:e,fields:"id,name,IntervalId"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,f.push(n),P.values.interval_id=U(f,"id","name","IntervalId")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_INTERVAL",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.interval_id=U(f,"id","name","IntervalId")}function z(){var e=Number(_.find(P.attributes,{name:"account_id"}).value);if(!_.some(b,{id:e})&&0<e)return t.mailAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,b.push(n),P.values.account_id=U(b,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_MAIL_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.account_id=U(b,"id","name")}function J(){var e=Number(_.find(P.attributes,{name:"sms_account_id"}).value);if(!_.some(O,{id:e})&&0<e)return t.smsAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,O.push(n),P.values.sms_account_id=U(O,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SMS_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sms_account_id=U(O,"id","name")}function K(){var e=Number(_.find(P.attributes,{name:"template_id"}).value);if(!_.some(A,{id:e})&&0<e)return t.template.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,A.push(n),P.values.template_id=U(A,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TEMPLATE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.template_id=U(A,"id","name")}function X(){var e=Number(_.find(P.attributes,{name:"pause_id"}).value);if(!_.some(C,{id:e})&&0<e)return t.pause.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,C.push(n),P.values.pause_id=U(C,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PAUSE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.pause_id=U(C,"id","name")}P.cellName=y.tagName,P.attributes=_.map(y.attributes,function(e){return{name:e.name,value:e.value,defaultValue:k[P.cellName]&&_.includes(k[P.cellName],e.name),required:L[P.cellName]&&_.includes(L[P.cellName],e.name),help:M[P.cellName]&&_.includes(M[P.cellName],e.name)}}),P.values={authMethod:[{value:"noauth",option:"NO AUTH"},{value:"hmac",option:"HMAC"}],answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],ndagenerate_audio:[{value:1,option:"Yes"},{value:0,option:"No"}],ndaactivity_type:[{value:"message",option:"Message"},{value:"conversationUpdate",option:"Conversation Update"},{value:"contactRelationUpdate",option:"Contact Relation Update"},{value:"endOfConversation",option:"End of Conversation"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:e,ispeech_asr_language:i,ispeech_tts_language:o,languageCode:r,ssmlGender:[{value:"FEMALE",option:"Female"},{value:"MALE",option:"Male"}],google_tts_language:l,google_asr_language:s,google_cloud_tts_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],aws_polly_region:I,aws_polly_voice:T,aws_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}],dialogflow_language:w,dialogflowV2_language:R,aws_lex_region:x,method:[{value:"GET",option:"GET"},{value:"POST",option:"POST"},{value:"PUT",option:"PUT"},{value:"DELETE",option:"DELETE"}]},P.crudPermissions=D,P.onInit=function(){N.hasRole("admin")?(e={sip_id:U(d,"id","fullname","role"),trunk_name:U(c,"name","name"),trunk_id:U(c,"id","name"),queue_id:U(m,"id","name"),file_id:U(u,"id","name"),variable_id:U(p,"id","name"),odbc_id:U(g,"id","name"),project_id:U(v,"id","name"),context:U(h,"id","name"),interval_id:(t=f,a="id",i="name",s="IntervalId",o=_.filter(t,function(e){return null===e[s]}),r=[],_.forEach(o,function(n){r.push({value:n[a],option:n[i]});var e=_.filter(t,function(e){return e[s]===n.id});_.forEach(e,function(e){r.push({value:e[a],option:" - "+e[i]})})}),r),account_id:U(b,"id","name"),template_id:U(A,"id","name"),list_id:U(E,"id","name"),sms_account_id:U(O,"id","name"),pause_id:U(C,"id","name")},n=_.merge(P.values,e),P.values=n):function(){for(var e=["sip_id","trunk_name","trunk_id","queue_id","file_id","variable_id","odbc_id","project_id","context","interval_id","account_id","template_id","list_id","sms_account_id","pause_id"],n=0;n<P.attributes.length;n++)if(_.includes(e,P.attributes[n].name))switch(P.attributes[n].name){case"sip_id":F();break;case"trunk_name":G();break;case"trunk_id":q();break;case"queue_id":H();break;case"file_id":V();break;case"variable_id":B();break;case"odbc_id":Q();break;case"project_id":W();break;case"context":j();break;case"interval_id":Y();break;case"account_id":z();break;case"template_id":K();break;case"list_id":$();break;case"sms_account_id":J();break;case"pause_id":X()}}();var e,n,t,a,i,s,o,r},P.closeDialog=function(e){e&&S(P.attributes),n.hide()},P.getMap=U}e.$inject=["$mdDialog","api","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleCloudTtslanguageCode","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses","dialogFlowLanguage","dialogFlowV2Language","awsLexRegion","Auth","crudPermissions"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,n,t,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleCloudTtslanguageCode",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"ar-XA",option:"Arabic"},{value:"bn-IN",option:"Bengali (India)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"yue-HK",option:"Chinese (Hong Kong)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"nl-BE",option:"Dutch (Belgium)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"en-AU",option:"English (Australian)"},{value:"en-IN",option:"English (India)"},{value:"en-GB",option:"English (UK)"},{value:"en-US",option:"English (US)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"de-DE",option:"German (Germany)"},{value:"el-GR",option:"Greek (Greece)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hi-IN",option:"Hindi (India)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"it-IT",option:"Italian (Italy)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"kn-IN",option:"Kannada (India)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"cmn-CN",option:"Mandarin Chinese"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Cyrillic)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (US)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"te-IN",option:"Telugu (India)\t"},{value:"th-TH",option:"Thai (Thailand)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"bn",option:"Bengali"},{value:"bs",option:"Bosnian"},{value:"bg",option:"Bulgarian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gu",option:"Gujarati"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"ko",option:"Korean"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"mk",option:"Macedonian"},{value:"ml",option:"Malayalam"},{value:"mr",option:"Marathi"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"pl",option:"Polish"},{value:"pt",option:"Portuguese"},{value:"ro",option:"Romanian"},{value:"ru",option:"Russian"},{value:"sr",option:"Serbian"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"ta",option:"Tamil"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"tr",option:"Turkish"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"}]}).factory("googleAsrLanguage",function(){return[{option:"Afrikaans (South Africa)",value:"af-ZA"},{option:"Albanian (Albania)",value:"sq-AL"},{option:"Amharic (Ethiopia)",value:"am-ET"},{option:"Arabic (Algeria)",value:"ar-DZ"},{option:"Arabic (Bahrain)",value:"ar-BH"},{option:"Arabic (Egypt)",value:"ar-EG"},{option:"Arabic (Iraq)",value:"ar-IQ"},{option:"Arabic (Israel)",value:"ar-IL"},{option:"Arabic (Jordan)",value:"ar-JO"},{option:"Arabic (Kuwait)",value:"ar-KW"},{option:"Arabic (Lebanon)",value:"ar-LB"},{option:"Arabic (Morocco)",value:"ar-MA"},{option:"Arabic (Oman)",value:"ar-OM"},{option:"Arabic (Qatar)",value:"ar-QA"},{option:"Arabic (Saudi Arabia)",value:"ar-SA"},{option:"Arabic (State of Palestine)",value:"ar-PS"},{option:"Arabic (Tunisia)",value:"ar-TN"},{option:"Arabic (United Arab Emirates)",value:"ar-AE"},{option:"Arabic (Yemen)",value:"ar-YE"},{option:"Armenian (Armenia)",value:"hy-AM"},{option:"Azerbaijani (Azerbaijan)",value:"az-AZ"},{option:"Basque (Spain)",value:"eu-ES"},{option:"Bengali (Bangladesh)",value:"bn-BD"},{option:"Bengali (India)",value:"bn-IN"},{option:"Bosnian (Bosnia and Herzegovina)",value:"bs-BA"},{option:"Bulgarian (Bulgaria)",value:"bg-BG"},{option:"Burmese (Myanmar)",value:"my-MM"},{option:"Catalan (Spain)",value:"ca-ES"},{option:"Chinese, Cantonese (Traditional Hong Kong)",value:"yue-Hant-HK"},{option:"Chinese, Mandarin (Simplified, China)",value:"cmn-Hans-CN"},{option:"Croatian (Croatia)",value:"hr-HR"},{option:"Czech (Czech Republic)",value:"cs-CZ"},{option:"Danish (Denmark)",value:"da-DK"},{option:"Dutch (Belgium)",value:"nl-BE"},{option:"Dutch (Netherlands)",value:"nl-NL"},{option:"English (Australia)",value:"en-AU"},{option:"English (Canada)",value:"en-CA"},{option:"English (Ghana)",value:"en-GH"},{option:"English (Hong Kong)",value:"en-HK"},{option:"English (India)",value:"en-IN"},{option:"English (Ireland)",value:"en-IE"},{option:"English (Kenya)",value:"en-KE"},{option:"English (New Zealand)",value:"en-NZ"},{option:"English (Nigeria)",value:"en-NG"},{option:"English (Pakistan)",value:"en-PK"},{option:"English (Philippines)",value:"en-PH"},{option:"English (Singapore)",value:"en-SG"},{option:"English (South Africa)",value:"en-ZA"},{option:"English (Tanzania)",value:"en-TZ"},{option:"English (United Kingdom)",value:"en-GB"},{option:"English (United States)",value:"en-US"},{option:"Estonian (Estonia)",value:"et-EE"},{option:"Filipino (Philippines)",value:"fil-PH"},{option:"Finnish (Finland)",value:"fi-FI"},{option:"French (Belgium)",value:"fr-BE"},{option:"French (Canada)",value:"fr-CA"},{option:"French (France)",value:"fr-FR"},{option:"French (Switzerland)",value:"fr-CH"},{option:"Galician (Spain)",value:"gl-ES"},{option:"Georgian (Georgia)",value:"ka-GE"},{option:"German (Austria)",value:"de-AT"},{option:"German (Germany)",value:"de-DE"},{option:"German (Switzerland)",value:"de-CH"},{option:"Greek (Greece)",value:"el-GR"},{option:"Gujarati (India)",value:"gu-IN"},{option:"Hebrew (Israel)",value:"iw-IL"},{option:"Hindi (India)",value:"hi-IN"},{option:"Hungarian (Hungary)",value:"hu-HU"},{option:"Icelandic (Iceland)",value:"is-IS"},{option:"Indonesian (Indonesia)",value:"id-ID"},{option:"Italian (Italy)",value:"it-IT"},{option:"Italian (Switzerland)",value:"it-CH"},{option:"Japanese (Japan)",value:"ja-JP"},{option:"Javanese (Indonesia)",value:"jv-ID"},{option:"Kannada (India)",value:"kn-IN"},{option:"Kazakh (Kazakhstan)",value:"kk-KZ"},{option:"Khmer (Cambodia)",value:"km-KH"},{option:"Korean (South Korea)",value:"ko-KR"},{option:"Lao (Laos)",value:"lo-LA"},{option:"Latvian (Latvia)",value:"lv-LV"},{option:"Lithuanian (Lithuania)",value:"lt-LT"},{option:"Macedonian (North Macedonia)",value:"mk-MK"},{option:"Malay (Malaysia)",value:"ms-MY"},{option:"Malayalam (India)",value:"ml-IN"},{option:"Marathi (India)",value:"mr-IN"},{option:"Mongolian (Mongolia)",value:"mn-MN"},{option:"Nepali (Nepal)",value:"ne-NP"},{option:"Norwegian Bokmål (Norway)",value:"no-NO"},{option:"Persian (Iran)",value:"fa-IR"},{option:"Polish (Poland)",value:"pl-PL"},{option:"Portuguese (Brazil)",value:"pt-BR"},{option:"Portuguese (Portugal)",value:"pt-PT"},{option:"Punjabi (Gurmukhi India)",value:"pa-Guru-IN"},{option:"Romanian (Romania)",value:"ro-RO"},{option:"Russian (Russia)",value:"ru-RU"},{option:"Serbian (Serbia)",value:"sr-RS"},{option:"Sinhala (Sri Lanka)",value:"si-LK"},{option:"Slovak (Slovakia)",value:"sk-SK"},{option:"Slovenian (Slovenia)",value:"sl-SI"},{option:"Spanish (Argentina)",value:"es-AR"},{option:"Spanish (Bolivia)",value:"es-BO"},{option:"Spanish (Chile)",value:"es-CL"},{option:"Spanish (Colombia)",value:"es-CO"},{option:"Spanish (Costa Rica)",value:"es-CR"},{option:"Spanish (Dominican Republic)",value:"es-DO"},{option:"Spanish (Ecuador)",value:"es-EC"},{option:"Spanish (El Salvador)",value:"es-SV"},{option:"Spanish (Guatemala)",value:"es-GT"},{option:"Spanish (Honduras)",value:"es-HN"},{option:"Spanish (Mexico)",value:"es-MX"},{option:"Spanish (Nicaragua)",value:"es-NI"},{option:"Spanish (Panama)",value:"es-PA"},{option:"Spanish (Paraguay)",value:"es-PY"},{option:"Spanish (Peru)",value:"es-PE"},{option:"Spanish (Puerto Rico)",value:"es-PR"},{option:"Spanish (Spain)",value:"es-ES"},{option:"Spanish (United States)",value:"es-US"},{option:"Spanish (Uruguay)",value:"es-UY"},{option:"Spanish (Venezuela)",value:"es-VE"},{option:"Sundanese (Indonesia)",value:"su-ID"},{option:"Swahili (Kenya)",value:"sw-KE"},{option:"Swahili (Tanzania)",value:"sw-TZ"},{option:"Swedish (Sweden)",value:"sv-SE"},{option:"Tamil (India)",value:"ta-IN"},{option:"Tamil (Malaysia)",value:"ta-MY"},{option:"Tamil (Singapore)",value:"ta-SG"},{option:"Tamil (Sri Lanka)",value:"ta-LK"},{option:"Telugu (India)",value:"te-IN"},{option:"Thai (Thailand)",value:"th-TH"},{option:"Turkish (Turkey)",value:"tr-TR"},{option:"Ukrainian (Ukraine)",value:"uk-UA"},{option:"Urdu (India)",value:"ur-IN"},{option:"Urdu (Pakistan)",value:"ur-PK"},{option:"Uzbek (Uzbekistan)",value:"uz-UZ"},{option:"Vietnamese (Vietnam)",value:"vi-VN"},{option:"Zulu (South Africa)",value:"zu-ZA"}]}).factory("awsPollyVoice",function(){return[{value:"Zeina",option:"Zeina (Arabic, Female)"},{value:"Zhiyu",option:"Zhiyu (Chinese, Mandarin, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Nicole",option:"Nicole (English, Australian, Female)"},{value:"Olivia",option:"Olivia (English, Austrialian, Female)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Amy",option:"Amy (English, British, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Aditi",option:"Aditi (English, Indian, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Aria",option:"Aria (English, New Zealand, Female)"},{value:"Ayanda",option:"Ayanda (English, South African, Female)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Kevin",option:"Kevin (English, US, Male)"},{value:"Matthew",option:"Matthew (English, US, Male)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Léa",option:"Léa (French, Male)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Gabrielle",option:"Gabrielle (French, Canadian, Female)"},{value:"Vicki",option:"Vicki (German , Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Aditi",option:"Aditi (Hindi , Female)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Bianca",option:"Bianca (Italian, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Takumi",option:"Takumi (Japanese, Male)"},{value:"Seoyeon",option:"Seoyeon (Korean, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Camila",option:"Camila (Portuguese, Brazilian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Conchita",option:"Conchita (Spanish, European, Female)"},{value:"Lucia",option:"Lucia (Spanish, European, Female)"},{value:"Enrique",option:"Enrique (Spanish, European, Male)"},{value:"Mia",option:"Mia (Spanish, Mexican, Female)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Lupe",option:"Lupe (Spanish, US, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Gwyneth",option:"Gwyneth (Welsh , Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]}).factory("awsLexRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"}]}).factory("dialogFlowLanguage",function(){return[{value:"da",option:"Danish"},{value:"en",option:"English"},{value:"de",option:"German"},{value:"it",option:"Italian"},{value:"es",option:"Spanish"},{value:"fr",option:"French"},{value:"id",option:"Indonesian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean (South Korea)"},{value:"nl",option:"Dutch"},{value:"no",option:"Norwegian"},{value:"pt",option:"Portuguese (European)"},{value:"pt-br",option:"Portuguese (Nrazilian)"},{value:"ru",option:"Russian"},{value:"sv",option:"Swedish"},{value:"th",option:"Thai"},{value:"uk",option:"Ukrainian"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-HK",option:"Chinese (Hong Kong)"},{value:"zh-TW",option:"Chinese (Traditional)"}]}).factory("dialogFlowV2Language",function(){return[{value:"zh-HK",option:"Chinese (Cantonese)"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (Great Britain)"},{value:"en-IN",option:"English (India)"},{value:"en-US",option:"English (US)"},{value:"fr",option:"French"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"France (France)"},{value:"de",option:"German"},{value:"hi",option:"Hindi"},{value:"id",option:"Indonesian"},{value:"it",option:"Italian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean"},{value:"no",option:"Norwegian"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ru",option:"Russian"},{value:"es",option:"Spanish"},{value:"es-419",option:"Spanish (Latin America)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"sw",option:"Swedish"},{value:"th",option:"Thai"},{value:"tr",option:"Turkish"},{value:"uk",option:"Ukrainian"}]})}(),function(){"use strict";function e(n,e,t,a){var i=this;i.project={preproduction:t},i.closeDialog=function(e){e?(a(i.project.preproduction),n.hide(i.project.preproduction)):n.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(n,t){var a=this;function i(e){e?(t(e),n.hide(e)):n.hide()}a.errors=[],a.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:5242880,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[];_.includes(["xml"],e.getExtension())||a.errors.push({message:"The extension "+e.getExtension()+" is not supported!"});5242880<e.size&&a.errors.push({message:"The file is too big. The max allowed size is 5MB"});if(!a.errors.length){var n=new FileReader;n.onload=function(e){i(e.target.result)},n.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(n,t,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){n.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){t.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),n.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.projects=t,s.id="",s.newWindow=!0,s.closeDialog=function(e){s.errors=[],e?(n.hide(),s.newWindow?a.open("/callysquare/projects/"+s.id,"_blank"):i.go("app.callysquare.projects.edit",{id:s.id})):n.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){n.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){t.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),n.hide(e),r.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):o.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T){var I=this;I.currentUser=T.getCurrentUser(),I.project=n||{},I.userProfileSection=S&&1==S.count?S.rows[0]:null,I.crudPermissions=T.parseCrudPermissions(I.userProfileSection?I.userProfileSection.crudPermissions:null),I.onInit=function(){new EditorUi(I,new Editor,document.getElementById("geEditor")).openString(I.project.preproduction,I.project.name,I.project)},I.saveOrPublishProject=function(e,n){var t={preproduction:e};n&&(t.production=e);r.squareProject.update({id:I.project.id},t).$promise.then(function(e){o.success({title:"Project "+(n?"published":"saved")+"!",msg:I.project.name?I.project.name+" has been "+(n?"published":"saved")+"!":""}),I.project.preproduction=e.preproduction}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.openDialog=function(e,n){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{users:l.rows||[],trunks:d.rows||[],queues:c.rows||[],sounds:m.rows||[],variables:u.rows||[],databases:p.rows||[],contexts:g.rows||[],projects:v.rows||[],intervals:h.rows||[],mailAccounts:f.rows||[],smsAccounts:E.rows||[],pauses:y.rows||[],templates:b.rows||[],lists:A.rows||[],cell:e,saveCallback:n,crudPermissions:I.crudPermissions}})},I.newProject=function(e){a.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:e,projects:v.rows,openFromEditor:!0,license:null,setting:null,crudPermissions:I.crudPermissions}})},I.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{projects:v.rows||[]}})},I.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:I.project,currentXML:e}}).then(function(e){e&&v.rows.push(e)})},I.newVariable=function(n){return i(function(a,n){return r.userProfileSection.get({userProfileId:I.currentUser.userProfileId,sectionId:1012}).$promise.then(function(e){var n=e.rows?e.rows[0]:null,t=T.parseCrudPermissions(n?n.crudPermissions:null);a(t)}).catch(function(e){n(e)})}).then(function(e){e.canEdit?a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{variable:n,variables:u.rows,license:null,setting:null,crudPermissions:e}}):o.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE")})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:NEW_VARIABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:I.project}}).then(function(e){e&&_.merge(I.project,e)})},I.editXML=function(e,n){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:n}}).then(function(e){e&&(I.project.preproduction=e)})},I.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(I.project.preproduction=e)})},I.gotoProjects=function(){e.go("app.callysquare.projects",{},{reload:"app.callysquare.projects"})}}e.$inject=["$state","$document","$mdDialog","$q","$translate","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","userProfileSection","Auth"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.projects=a||{count:0,rows:[]},p.userProfile=i,p.userProfileSection=s&&1==s.count?s.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.listOrder="",p.listOrderAsc=null,p.selectedProjects=[],p.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},p.editstate=function(e,n){t.go("app.callysquare.projects.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.deleteconfirm=function(e,n){var t=l.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");l.show(t).then(function(){f(e)},function(){console.log("CANCEL")})},p.success=h,p.getProjects=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=o.squareProject.get(p.query,h).$promise:(p.query.id=p.userProfile.id,p.query.section="SquareProjects",p.promise=o.userProfile.getResources(p.query,h).$promise)},p.createOrEditProject=function(e,n){l.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(d.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:p.projects.rows,openFromEditor:null,setting:null,crudPermissions:p.crudPermissions}})},p.deleteProject=f,p.exportSelectedProjects=function(){var e=angular.copy(p.selectedProjects);return p.selectedProjects=[],e},p.deleteSelectedProjects=function(e){var n=l.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+p.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");l.show(n).then(function(){p.selectedProjects.forEach(function(e){f(e)}),p.selectedProjects=[]})},p.deselectProjects=function(){p.selectedProjects=[]},p.selectAllProjects=function(){p.selectedProjects=p.projects.rows};var g=!0,v=1;function h(e){p.projects=e||{count:0,rows:[]}}function f(e){o.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(p.projects.rows,{id:e.id}),p.projects.count-=1,p.projects.rows.length||p.getProjects(),m.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){g?c(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","userProfile","userProfileSection","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_SQUARERECORDING",g.squareRecording=angular.copy(l),g.squareRecordings=r,g.newSquareRecording=!1,g.squareRecording||(g.squareRecording={},g.title="CALLYSQUARE.NEW_SQUARERECORDING",g.newSquareRecording=!0),g.addNewSquareRecording=function(){g.errors=[],d.squareRecording.save(g.squareRecording).$promise.then(function(e){g.squareRecordings.unshift(e.toJSON()),o.success({title:"SquareRecording properly created",msg:g.squareRecording.name?g.squareRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSquareRecording=function(){g.errors=[],d.squareRecording.update({id:g.squareRecording.id},g.squareRecording).$promise.then(function(e){var n=_.find(g.squareRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SquareRecording properly saved!",msg:g.squareRecording.name?g.squareRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSquareRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareRecording.delete({id:g.squareRecording.id}).$promise.then(function(){_.remove(g.squareRecordings,{id:g.squareRecording.id}),o.success({title:"SquareRecording properly deleted!",msg:(g.squareRecording.name||"squareRecording")+" has been deleted!"}),v(g.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","squareRecordings","squareRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.squareRecordings=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="squareRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedSquareRecordings=[],f.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,page:1},f.downloadfile2=function(s,e){return m.squareRecording.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+s.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("squareRecording")+"?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSquareRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SquareRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSquareRecording=function(e,n){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:n,squareRecordings:f.squareRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSquareRecording=y,f.exportSelectedSquareRecordings=function(){var e=angular.copy(f.selectedSquareRecordings);return f.selectedSquareRecordings=[],e},f.deleteSelectedSquareRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+f.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSquareRecordings.forEach(function(e){y(e)}),f.selectedSquareRecordings=[]})},f.deselectSquareRecordings=function(){f.selectedSquareRecordings=[]},f.selectAllSquareRecordings=function(){f.selectedSquareRecordings=f.squareRecordings.rows};var b=!0,A=1;function E(e){f.squareRecordings=e||{count:0,rows:[]}}function y(e){m.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.squareRecordings.rows,{id:e.id}),f.squareRecordings.count-=1,f.squareRecordings.rows.length||f.getSquareRecordings(),p.success({title:_.startCase("SquareRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","squareRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatQueues",f.listOrder="",f.listOrderAsc=null,f.selectedChatQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatQueue")+"?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.chat.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.chat.realtime.queues",{})}},f.success=E,f.getChatQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatQueue=function(e,n){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:f.chatQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteChatQueue=y,f.exportSelectedChatQueues=function(){var e=angular.copy(f.selectedChatQueues);return f.selectedChatQueues=[],e},f.deleteSelectedChatQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+f.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatQueues.forEach(function(e){y(e)}),f.selectedChatQueues=[]})},f.deselectChatQueues=function(){f.selectedChatQueues=[]},f.selectAllChatQueues=function(){f.selectedChatQueues=f.chatQueues.rows};var b=!0,A=1;function E(e){f.chatQueues=e||{count:0,rows:[]}}function y(e){m.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.chatQueues.rows,{id:e.id}),f.chatQueues.count-=1,f.chatQueues.rows.length||f.getChatQueues(),p.success({title:_.startCase("ChatQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="CHAT.EDIT_CHATQUEUE",r.chatQueue=angular.copy(n),r.chatQueues=e,r.newChatQueue=!1,r.chatQueue||(r.chatQueue={strategy:"beepall",timeout:10},r.title="CHAT.NEW_CHATQUEUE",r.newChatQueue=!0),r.addNewChatQueue=function(){r.errors=[],i.chatQueue.save(r.chatQueue).$promise.then(function(e){r.chatQueues.unshift(e.toJSON()),a.success({title:"ChatQueue properly created",msg:r.chatQueue.name?r.chatQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveChatQueue=function(){r.errors=[],i.chatQueue.update({id:r.chatQueue.id},r.chatQueue).$promise.then(function(e){var n=_.find(r.chatQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"ChatQueue properly saved!",msg:r.chatQueue.name?r.chatQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteChatQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.chatQueue.delete({id:r.chatQueue.id}).$promise.then(function(){_.remove(r.chatQueues,{id:r.chatQueue.id}),a.success({title:"ChatQueue properly deleted!",msg:(r.chatQueue.name||"chatQueue")+" has been deleted!"}),l(r.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","chatQueues","chatQueue","api","Auth","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getAgents({id:c.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getTeams({id:l.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.chatQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("CHAT.ALL_TEAMS"),labelSelected:t.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.chatQueue=c||e.params.chatQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatQueues=function(){e.go("app.chat.chatQueues",{},{reload:"app.chat.chatQueues"})},u.saveChatQueue=function(){r.chatQueue.update({id:u.chatQueue.id},u.chatQueue).$promise.then(function(){l.success({title:"ChatQueue updated!",msg:u.chatQueue.name?u.chatQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatQueue","userProfileSection"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatWebsites=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatWebsites",f.listOrder="",f.listOrderAsc=null,f.selectedChatWebsites=[],f.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,page:1},f.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayalignment=_.keyBy([{option:"bottom_right",value:"'bottom_right'"},{option:"right",value:"'right'"},{option:"left",value:"'left'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymessagesAlignment=_.keyBy([{option:"alternate",value:"'alternate'"},{option:"centered",value:"'centered'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},f.offlinemessagesgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:11})},f.agentadddialog=function(e,n){i.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:f.chatWebsites?f.chatWebsites.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatWebsite")+"?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChatWebsites=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatWebsite.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatWebsites",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatWebsite=function(e,n){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:n,chatWebsites:f.chatWebsites.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteChatWebsite=y,f.exportSelectedChatWebsites=function(){var e=angular.copy(f.selectedChatWebsites);return f.selectedChatWebsites=[],e},f.deleteSelectedChatWebsites=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+f.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatWebsites.forEach(function(e){y(e)}),f.selectedChatWebsites=[]})},f.deselectChatWebsites=function(){f.selectedChatWebsites=[]},f.selectAllChatWebsites=function(){f.selectedChatWebsites=f.chatWebsites.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.lists,{id:Number(f.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.lists,{id:Number(f.chatWebsite.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.chatWebsites=e||{count:0,rows:[]}}function y(e){m.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(f.chatWebsites.rows,{id:e.id}),f.chatWebsites.count-=1,f.chatWebsites.rows.length||f.getChatWebsites(),p.success({title:_.startCase("ChatWebsite")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatWebsites","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATWEBSITE",g.chatWebsite=angular.copy(l),g.chatWebsites=r,g.newChatWebsite=!1,g.chatWebsite||(g.chatWebsite={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),header_shape:"rounded",alignment:"bottom_right",verticalAlignment:30,labelText:"CHAT",messagesAlignment:"alternate",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300,vidaooTopic:"Generated by XCALLY Motion",vidaooNote:"Meeting generated for interaction #{{interaction.id}} by {{agent.name}}"},g.title="CHAT.NEW_CHATWEBSITE",g.newChatWebsite=!0),n.params.id&&(g.chatWebsite.ChatWebsiteId=n.params.id),g.addNewChatWebsite=function(){g.errors=[],d.chatWebsite.save(g.chatWebsite).$promise.then(function(e){g.chatWebsites.unshift(e.toJSON()),o.success({title:"ChatWebsite properly created",msg:g.chatWebsite.name?g.chatWebsite.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatWebsite=function(){g.errors=[],d.chatWebsite.update({id:g.chatWebsite.id},g.chatWebsite).$promise.then(function(e){var n=_.find(g.chatWebsites,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatWebsite properly saved!",msg:g.chatWebsite.name?g.chatWebsite.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatWebsite=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatWebsite.delete({id:g.chatWebsite.id}).$promise.then(function(){_.remove(g.chatWebsites,{id:g.chatWebsite.id}),o.success({title:"ChatWebsite properly deleted!",msg:(g.chatWebsite.name||"chatWebsite")+" has been deleted!"}),v(g.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.lists,{id:Number(g.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.lists,{id:Number(g.chatWebsite.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatWebsites","chatWebsite","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:t,chatWebsite:r.chatWebsite,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[n]=e:r.chatWebsiteApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.chatWebsiteApps.rows.length;t++,0){var a=r.chatWebsiteApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(n,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:501}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"tvox",appType:"tvox",type:"tvox",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"serviceid",name:"serviceid",type:"text",param:0},{title:"channelid",name:"channelid",type:"text",param:1},{title:"tvoxurl",name:"tvoxurl",type:"text",param:2},{title:"tvoxloginurl",name:"tvoxloginurl",type:"text",param:3},{title:"tvoxsessionurl",name:"tvoxsessionurl",type:"text",param:4},{title:"tvoxusername",name:"tvoxusername",type:"text",param:5},{title:"tvoxpasswd",name:"tvoxpasswd",type:"password",param:6},{title:"motionurlonring",name:"motionurlonring",type:"text",param:7},{title:"motionurlonanswer",name:"motionurlonanswer",type:"text",param:8},{title:"motiontitle",name:"motiontitle",type:"text",param:9},{title:"motionurl",name:"motionurl",type:"text",param:10}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.chatWebsite=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=o.chatWebsite.getApplications(r.query,t).$promise},r.editChatWebsiteApp=n,r.editInterval=function(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatWebsite.getAgents({id:c.chatWebsite.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatWebsite?"penalty "+e.UserChatWebsite.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatWebsite=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.removeAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.addAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatWebsite","chatWebsites","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatWebsiteagentaddController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("chat")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:501}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptagDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tvox=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tvox.appdata)switch(l.tvox.appType?l.tvox.appType.toLowerCase():l.tvox.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tvox.appdata.split(",");l.tvox.key=d[0],l.tvox.language=d[1],l.tvox.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tvox.appdata.split(",");l.tvox.projectId=d[0],l.tvox.clientEmail=d[1],l.tvox.privateKey=d[2],l.tvox.language=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tvox.appdata.split(",");l.tvox.accesskeyid=d[0],l.tvox.secretaccesskey=d[1],l.tvox.lexregion=d[2],l.tvox.botname=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tvox.appdata.split(",");l.tvox.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tvox.text=d.slice(1,d.length).join(",");break;case"message":l.tvox.text=l.tvox.appdata;break;case"set":l.tvox.name=l.tvox.appdata.split("=")[0],l.tvox.value=l.tvox.appdata.split("=")[1];break;case"agi":l.tvox.project=l.tvox.appdata;break;default:var c=l.tvox.appdata.split(",");l.tvox.serviceid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.tvox.channelid=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.tvox.tvoxurl=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.tvox.tvoxloginurl=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.tvox.tvoxsessionurl=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.tvox.tvoxusername=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.tvox.tvoxpasswd=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.tvox.motionurlonring=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.tvox.motionurlonanswer=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.tvox.motiontitle=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10),l.tvox.motionurl=_.isEmpty(c[10])?c[10]:isNaN(c[10])?c[10]:parseInt(c[10],10)}function m(e){n.hide(e)}l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outbounddial"===l.tvox.appType.toLowerCase()&&(l.tvox.prefix=l.tvox.phone?l.tvox.phone.split("$")[0]:void 0,l.tvox.callerId=l.tvox.callerID?"CALLERID(all)="+l.tvox.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outboundDial"===l.tvox.appType&&(l.tvox.phone=i.cutdigits?(l.tvox.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tvox.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tvox.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tvox.options+="U(xcally-mixmonitor-context)"):l.tvox.options=l.tvox.options.replace("U(xcally-mixmonitor-context)",""));if(l.tvox.appType&&"custom"===l.tvox.appType);else switch((l.tvox.app||l.tvox.appType).toLowerCase()){case"set":l.tvox.appdata=l.tvox.name+"="+l.tvox.value;break;case"custom":break;default:e[0]=l.tvox.serviceid,e[1]=l.tvox.channelid,e[2]=l.tvox.tvoxurl,e[3]=l.tvox.tvoxloginurl,e[4]=l.tvox.tvoxsessionurl,e[5]=l.tvox.tvoxusername,e[6]=l.tvox.tvoxpasswd,e[7]=l.tvox.motionurlonring,e[8]=l.tvox.motionurlonanswer,e[9]=l.tvox.motiontitle,e[10]=l.tvox.motionurl,l.tvox.appdata=e.join(",")}m(l.tvox)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptvoxDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteChatCannedAnswers.rows,{id:e.id}),m.chatWebsiteChatCannedAnswers.count-=1,m.chatWebsiteChatCannedAnswers.rows.length||p(),l.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteChatCannedAnswers={count:0,rows:[]},m.selectedChatWebsiteChatCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatCannedAnswer #")+e.id||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteChatCannedAnswers=p,m.createOrEditChatWebsiteChatCannedAnswer=function(e,n){o.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatCannedAnswer:n,chatCannedAnswers:m.chatWebsiteChatCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(m.selectedChatWebsiteChatCannedAnswers);return m.selectedChatWebsiteChatCannedAnswers=[],e},m.deleteChatWebsiteChatCannedAnswer=g,m.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+m.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),m.selectedChatWebsiteChatCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATCANNEDANSWER",g.chatCannedAnswer=angular.copy(l),g.chatCannedAnswers=r,g.newChatCannedAnswer=!1,g.chatCannedAnswer||(g.chatCannedAnswer={},g.title="CHAT.NEW_CHATCANNEDANSWER",g.newChatCannedAnswer=!0),n.params.id&&(g.chatCannedAnswer.ChatWebsiteId=n.params.id),g.addNewChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.chatCannedAnswer).$promise.then(function(e){g.chatCannedAnswers.unshift(e.toJSON()),o.success({title:"ChatCannedAnswer properly created",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.chatCannedAnswer.id},g.chatCannedAnswer).$promise.then(function(e){var n=_.find(g.chatCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatCannedAnswer properly saved!",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.chatCannedAnswer.id}).$promise.then(function(){_.remove(g.chatCannedAnswers,{id:g.chatCannedAnswer.id}),o.success({title:"ChatCannedAnswer properly deleted!",msg:(g.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),v(g.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.chatWebsite.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.chatWebsite=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.chatWebsite.id,field:"ChatWebsiteId",route:"chatWebsite"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteDispositionsController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"},{type:"upload",name:"Upload",icon:"icon-upload"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.offlineForm.items[n-1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===n-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.offlineForm.items.length-1){var t=i.chatWebsite.offlineForm.items[n+1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===n+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})},i.card_type="offline",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.onlineForm.items[n-1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===n-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.onlineForm.items.length-1){var t=i.chatWebsite.onlineForm.items[n+1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===n+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})},i.card_type="online",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/customer_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitecustomerAvatarController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:m.chatWebsite.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.chatWebsiteInteractions=e||{count:0,rows:[]};for(var n=0;n<m.chatWebsiteInteractions.rows.length;n+=1){var t=m.chatWebsiteInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatInteraction.get(m.query,p).$promise}function v(e){d.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteInteractions.rows,{id:e.id}),m.chatWebsiteInteractions.count-=1,m.chatWebsiteInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteInteractions={count:0,rows:[]},m.selectedChatWebsiteInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.chatInteractionDownload=function(s,e,n){return d.chatInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="chat-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getChatWebsiteInteractions=g,m.createOrEditChatWebsiteInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,interaction:n,interactions:m.chatWebsiteInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spychatInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"chat",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"chat.chatWebsites"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||ChatWebsiteId:=$eq["+m.chatWebsite.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(m.selectedChatWebsiteInteractions);return m.selectedChatWebsiteInteractions=[],e},m.deleteChatWebsiteInteraction=v,m.deleteSelectedChatWebsiteInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteInteractions.forEach(function(e){v(e)}),m.selectedChatWebsiteInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getOfflineMessages(m.query,u).$promise}function g(e){d.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteOfflineMessages.rows,{id:e.id}),m.chatWebsiteOfflineMessages.count-=1,m.chatWebsiteOfflineMessages.rows.length||p(),l.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteOfflineMessages={count:0,rows:[]},m.selectedChatWebsiteOfflineMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,attachments,Contact.firstName,ContactId,ChatWebsiteId",sort:"-createdAt",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("offlineMessage #")+e.id||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteOfflineMessages=p,m.createOrEditChatWebsiteOfflineMessage=function(e,n){o.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,offlineMessage:n,offlineMessages:m.chatWebsiteOfflineMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showOfflineMessageChatWebsiteOfflineMessage=function(e,t){o.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,n){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:t.id})}],attachments:["apiResolver","$stateParams",function(e,n){return e.resolve("attachment@get",{fields:"id,name",ChatOfflineMessageId:t.id})}]}})},m.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(m.selectedChatWebsiteOfflineMessages);return m.selectedChatWebsiteOfflineMessages=[],e},m.deleteChatWebsiteOfflineMessage=g,m.deleteSelectedChatWebsiteOfflineMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+m.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),m.selectedChatWebsiteOfflineMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.title="CHAT.OFFLINE_MESSAGE",s.message=a,s.attachments=i.rows,s.closeDialog=function(e){n.hide(e)},s.download=function(i){return e.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.isHtml=_.isNil(s.message.body.match(/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i))}e.$inject=["$mdDialog","api","toasty","message","attachments"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getProactiveActions(m.query,u).$promise}function g(e){d.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteProactiveActions.rows,{id:e.id}),m.chatWebsiteProactiveActions.count-=1,m.chatWebsiteProactiveActions.rows.length||p(),l.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteProactiveActions={count:0,rows:[]},m.selectedChatWebsiteProactiveActions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout",limit:10,page:1},m.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatProactiveAction #")+e.id||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteProactiveActions=p,m.createOrEditChatWebsiteChatProactiveAction=function(e,n){o.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatProactiveAction:n,proactive:m.chatWebsiteProactiveActions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(m.selectedChatWebsiteProactiveActions);return m.selectedChatWebsiteProactiveActions=[],e},m.deleteChatWebsiteChatProactiveAction=g,m.deleteSelectedChatWebsiteProactiveActions=function(e){var n=o.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+m.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),m.selectedChatWebsiteProactiveActions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATPROACTIVEACTION",g.chatProactiveAction=angular.copy(l),g.proactive=r,g.newChatProactiveAction=!1,g.chatProactiveAction||(g.chatProactiveAction={type:"mouseOver"},g.title="CHAT.NEW_CHATPROACTIVEACTION",g.newChatProactiveAction=!0),n.params.id&&(g.chatProactiveAction.ChatWebsiteId=n.params.id),g.addNewChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.save(g.chatProactiveAction).$promise.then(function(e){g.proactive.unshift(e.toJSON()),o.success({title:"ChatProactiveAction properly created",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.update({id:g.chatProactiveAction.id},g.chatProactiveAction).$promise.then(function(e){var n=_.find(g.proactive,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatProactiveAction properly saved!",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatProactiveAction=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatProactiveAction.delete({id:g.chatProactiveAction.id}).$promise.then(function(){_.remove(g.proactive,{id:g.chatProactiveAction.id}),o.success({title:"ChatProactiveAction properly deleted!",msg:(g.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),v(g.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","proactive","chatProactiveAction","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var n=this;n.chatWebsite={},n.init=function(e){n.chatWebsite=e,n.start="\n\x3c!-- START Motion Chat Script --\x3e",n.script='\n <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>',n.end="\n\x3c!-- START Motion Chat Script --\x3e"},n.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){n.script='\n <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/system_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitesystemAvatarController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.chatWebsite=c||e.params.chatWebsite||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:p.chatWebsites?p.chatWebsites.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoChatWebsites=function(){e.go("app.chat.chatWebsites",{},{reload:"app.chat.chatWebsites"})},p.saveChatWebsite=function(){r.chatWebsite.update({id:p.chatWebsite.id},p.chatWebsite).$promise.then(function(){l.success({title:"ChatWebsite updated!",msg:p.chatWebsite.name?p.chatWebsite.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.lists,{id:Number(p.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.lists,{id:Number(p.chatWebsite.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.interval,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.interval,{id:t.id});a.canSelect=!1,n.push(a)}p.interval=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)}));for(var i=0;i<p.interval.length;i++)a&&p.interval[i].id===a.id&&(p.interval[i].canSelect=!1,t.push(p.interval[i]));p.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatWebsite","userProfile","userProfileSection"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.chat.realtime.agents");break;case 1:t.go("app.chat.realtime.queues");break;default:t.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.companies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="companies",f.listOrder="",f.listOrderAsc=null,f.selectedCompanies=[],f.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.companies.edit",{id:e.id,company:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("company")+"?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCompanies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCompany.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Companies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCompany=function(e,n){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:n,companies:f.companies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCompany=y,f.exportSelectedCompanies=function(){var e=angular.copy(f.selectedCompanies);return f.selectedCompanies=[],e},f.deleteSelectedCompanies=function(e){var n=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+f.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCompanies.forEach(function(e){y(e)}),f.selectedCompanies=[]})},f.deselectCompanies=function(){f.selectedCompanies=[]},f.selectAllCompanies=function(){f.selectedCompanies=f.companies.rows};var b=!0,A=1;function E(e){f.companies=e||{count:0,rows:[]}}function y(e){m.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(f.companies.rows,{id:e.id}),f.companies.count-=1,f.companies.rows.length||f.getCompanies(),p.success({title:_.startCase("Company")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","companies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_COMPANY",g.company=angular.copy(l),g.companies=r,g.newCompany=!1,g.company||(g.company={},g.title="CONTACTMANAGER.NEW_COMPANY",g.newCompany=!0),g.addNewCompany=function(){g.errors=[],d.cmCompany.save(g.company).$promise.then(function(e){g.companies.unshift(e.toJSON()),o.success({title:"Company properly created",msg:g.company.name?g.company.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCompany=function(){g.errors=[],d.cmCompany.update({id:g.company.id},g.company).$promise.then(function(e){var n=_.find(g.companies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Company properly saved!",msg:g.company.name?g.company.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCompany=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmCompany.delete({id:g.company.id}).$promise.then(function(){_.remove(g.companies,{id:g.company.id}),o.success({title:"Company properly deleted!",msg:(g.company.name||"company")+" has been deleted!"}),v(g.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","companies","company","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.company=c||a.params.company||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):l.info({title:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},u.alert=l.info,u.gotoCompanies=function(){a.go("app.contactmanager.companies",{},{reload:"app.contactmanager.companies"})},u.saveCompany=function(){r.cmCompany.update({id:u.company.id},u.company).$promise.then(function(){l.success({title:"Company updated!",msg:u.company.name?u.company.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","company","userProfileSection"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(n,i,t,a,e,s,o,r,l,d,c,m,u,p,g,v,h,f,b){var A=this;A.currentUser=f.getCurrentUser(),A.license=b,A.userProfile=r,A.userProfileSection=l&&1==l.count?l.rows[0]:null,A.crudPermissions=f.parseCrudPermissions(A.userProfileSection?A.userProfileSection.crudPermissions:null);var E=60,y=1024*E*1024;A.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:y,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},A.contacts=c||{count:0,rows:[]},A.options={hidden:!1,hover:!1,isOpen:!1},A.table="cm_contacts",A.selectedContacts=[],A.lists=m||{rows:[],count:0},A.companies=p||{rows:[],count:0},A.tags=v||{rows:[],count:0},A.listsMap=u,A.companiesMap=g,A.selectedTags=[],A.selectedList=null,A.selectedCompany=null,A.query=_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0,page:1},e),A.editdialog=function(e,n){a.go("app.contactmanager.contacts.edit",{id:e.id,crudPermissions:A.crudPermissions})},A.deleteconfirm=function(e,n){var t=s.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){O(e)})},A.success=I,A.getContacts=function(){A.query.offset=(A.query.page-1)*A.query.limit,f.hasRole("admin")?A.promise=d.cmContact.get(A.query,I).$promise:(A.query.id=A.userProfile.id,A.query.ListId=A.query.ListId?A.query.ListId:_.map(A.lists.rows,"id"),A.query.CompanyId=A.query.CompanyId?A.query.CompanyId:_(A.companies.rows).filter({canSelect:void 0}).map("id").value(),A.query.section="Contacts",A.promise=d.userProfile.getResources(A.query,I).$promise)},A.getAssignedCompanies=function(){if(!f.hasRole("admin")){var e=_(A.contacts.rows).map(function(e){return{id:e.CompanyId}}).uniqBy("id").filter(function(e){return e.id&&0<e.id}).pullAllBy(A.companies.rows,"id").value();if(!_.isEmpty(e)){var n=[];e.forEach(function(e){n.push(d.cmCompany.get({id:e.id,fields:"id,name"}).$promise)}),o.all(n).then(function(e){e.forEach(function(e){var n=e.toJSON();n.canSelect=!1,A.companies.rows.push(n);var t={};t[n.id]=n.name,A.companiesMap=_.assignIn(A.companiesMap,t)})}).catch(function(e){h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}},A.mergeContact=function(e,n){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.duplicateContact=function(e,n){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.createOrEditContact=function(e,n){n&&n.dateOfBirth&&(n.dateOfBirth=new Date(n.dateOfBirth));s.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:A.query.ListId||a.params.ListId,CompanyId:A.query.CompanyId||a.params.CompanyId,contact:n,contacts:A.contacts.rows,companies:A.companies,lists:A.lists,setting:null,crudPermissions:A.crudPermissions}})},A.deleteContact=O,A.exportSelectedContacts=function(){var e=angular.copy(A.selectedContacts);return A.selectedContacts=[],e},A.deleteSelectedContacts=function(e){var n=s.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+A.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(n).then(function(){A.selectedContacts.forEach(function(e){O(e)}),A.selectedContacts=[]})},A.deselectContacts=function(){A.selectedContacts=[]},A.selectAllContacts=function(){A.selectedContacts=A.contacts.rows},A.createTag=function(e){var n=s.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.tag.save({name:e});h.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(A.tags.rows.push(e),h.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},A.createList=function(e){var n=s.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmList.save({name:e});h.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(A.lists.rows.push(e),h.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},A.createCompany=function(e){var n=s.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmCompany.save({name:e});h.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(A.companies.rows.push(e),h.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},A.importContacts=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:A.license}}).then(function(){A.getContacts()}).catch(function(e){console.error()})},A.importContactsUpdates=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsUpdatesDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/importUpdates.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:A.license}}).then(function(){A.getContacts()}).catch(function(e){console.error()})},A.hasPermission=function(){return f.hasPermission(303)||f.hasRole("admin")},A.fileAdded=function(e){var n=["csv"];if(!_.includes(n,e.getExtension()))return h.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>y)return h.error({title:"File too big",msg:"The max allowed size is "+E+"MB"}),!1;return!0},a.params.ListId&&(A.selectedList=a.params.ListId),a.params.CompanyId&&(A.selectedCompany=a.params.CompanyId),n.$watch("vm.options.isOpen",function(e){e?t(function(){n.tooltipVisible=A.options.isOpen},600):n.tooltipVisible=A.options.isOpen});var S=!0,T=1;function I(e){A.contacts=e||{count:0,rows:[]}}function O(e){d.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(A.contacts.rows,{id:e.id}),A.contacts.count-=1,A.contacts.rows.length||A.getContacts(),h.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){A.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var n=0;n<e.data.errors.length;n++)h.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}n.$watch("vm.query.filter",function(e,n){S?t(function(){S=!1}):(n||(T=A.query.page),e!==n&&(A.query.page=1),e||(A.query.page=T),A.getContacts())},!0),n.$watch("vm.selectedList",function(e,n){e!==n&&(A.query.ListId=A.selectedList||void 0,A.getContacts())}),n.$watch("vm.selectedCompany",function(e,n){e!==n&&(A.query.CompanyId=A.selectedCompany||void 0,A.getContacts())}),n.$watch("vm.selectedTags",function(e,n){(e.length||n.length)&&A.getContacts()})}e.$inject=["$scope","$document","$timeout","$state","$stateParams","$mdDialog","$q","userProfile","userProfileSection","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(t,e,a,n,i,s,o,r,l,d,c){var m=this;if(m.errors=[],m.title="CONTACTMANAGER.EDIT_CONTACT",m.crudPermissions=c,m.contact=angular.copy(o),m.additionalItemTypes=[],m.additionalItems=[],m.contacts=n||{rows:[],count:0},m.lists=i||{rows:[],count:0},m.companies=s||{rows:[],count:0},m.customFields={rows:[],count:0},m.newContact=!1,m.newPhone=function(e){return{phone:e,color:"gray"}},m.contactItemTypes=[],m.contact)delete m.contact.List,f(m.contact.ListId),d.cmContact.getAdditionalPhones({id:o.id}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");m.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");m.additionalItems=[];for(var s=0;s<n.length;s++)m.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})}).catch(function(e){console.log(e)});else{m.contact={ListId:r?parseInt(r,10):void 0,CompanyId:l?parseInt(l,10):void 0};var u=_.map(m.contact.Phones,"item"),p=_.map(m.contact.Phones,"description");m.additionalItemTypes=_.map(m.contact.Phones,"ItemTypeId");var g=_.map(m.contact.Phones,"ItemType.rgbBackgroundColor"),v=_.map(m.contact.Phones,"ItemType.name");m.additionalItems=[];for(var h=0;h<u.length;h++)m.additionalItems.push({phone:u[h],type:v[h],color:g[h],description:p[h]});m.title="CONTACTMANAGER.NEW_CONTACT",m.newContact=!0,b()}function f(e){if(e)return d.cmList.getCustomFields({id:e}).$promise.then(function(e){if(e){m.customFields=e;var n=_.map(m.customFields.rows,function(e){return"cf_"+e.id});return d.cmContact.get({id:m.contact.id,attributes:n,raw:!0}).$promise.then(function(e){m.contact=_.merge(m.contact,e)})}}).then(function(){m.customFields.rows.forEach(function(e){"datetime"===e.type&&m.contact["cf_"+e.id]&&(m.contact["cf_"+e.id]=A(m.contact["cf_"+e.id]))}),Object.keys(m.contact).forEach(function(e){if(_.startsWith(e,"cf_")){var n=e.split("_")[1];_.some(m.customFields.rows,["id",Number(n)])||delete m.contact["cf_"+n]}})}).catch(function(e){console.error(e)});m.customFields={rows:[],count:0}}function b(){return d.cmList.getGlobalCustomFields().$promise.then(function(e){if(e){m.customFields=e;_.map(m.customFields.rows,function(e){return"cf_"+e.id})}else;}).catch(function(e){console.error(e)})}function A(e){return null===e?void 0:new Date(e)}function E(){t.hide()}d.contactItemType.get({fields:"id,name,rgbBackgroundColor"}).$promise.then(function(e){m.contactItemTypes=e.rows}),m.addNewContact=function(){m.errors=[],d.cmContact.save(m.contact).$promise.then(function(e){m.contacts.unshift(e),d.cmContact.setAdditionalPhones({id:e.id,items:m.additionalItems,item_types:m.additionalItemTypes}).$promise.then(function(){a.success({title:"Contact properly created",msg:m.contact.name?m.contact.name+" has been created!":""}),E()})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContact=function(){m.errors=[],d.cmContact.update({id:m.contact.id},m.contact).$promise.then(function(e){var n=_.find(m.contacts,{id:e.id});n&&_.merge(n,e)}).then(function(){return d.cmContact.setAdditionalPhones({id:o.id,items:m.additionalItems,item_types:m.additionalItemTypes}).$promise.then(function(){a.success({title:"Contact properly saved!",msg:m.contact.name?m.contact.name+" has been saved!":""}),E()})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteContact=function(e){m.errors=[];var n=t.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmContact.delete({id:m.contact.id}).$promise.then(function(){_.remove(m.contacts,{id:m.contact.id}),a.success({title:"Contact properly deleted!",msg:m.contact.name?m.contact.name+" has been deleted!":""}),E()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},m.closeDialog=E,m.getCustomFields=f,m.getDateFromString=A,e.$watch("vm.contact.ListId",function(e,n){_.isNil(e)&&b()})}e.$inject=["$mdDialog","$scope","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(n),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[];var n=o.contact.id;delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){return a.unshift(e),s.cmContact.duplicateAdditionalPhones({id:n,fromContactId:n,toContactId:e.id}).$promise.then(function(){t.success({title:"Contact properly created",msg:o.contact.name?o.contact.name+" has been created!":""}),r()})}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="CONTACTMANAGER.EDIT_HOPPER",d.hopper=angular.copy(o),d.hoppers=s,d.newHopper=!1,d.crudPermissions=l,d.hopper||(d.hopper={},d.title="CONTACTMANAGER.NEW_HOPPER",d.newHopper=!0),d.saveHopper=function(){d.errors=[],r.cmHopper.update({id:d.hopper.id},d.hopper).$promise.then(function(e){var n=_.find(d.hoppers,{id:e.id});n&&_.merge(n,e),i.success({title:"Hopper properly saved!",msg:d.hopper.name?d.hopper.name+" has been saved!":""}),c(e)}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},d.getDateFromString=function(e){return null===e?void 0:new Date(e)},d.closeDialog=c}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","crudPermissions"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(a,t,e,i,s,n,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y){var S=this;function T(n){return function(e){S[n]=e||{count:0,rows:[]}}}function I(){S.queryHopper.offset=(S.queryHopper.page-1)*S.queryHopper.limit,S.queryHopper.id=S.contact.id,S.promise=r.cmContact.getHoppers(S.queryHopper,T("hoppers")).$promise}function O(){S.queryFinal.offset=(S.queryFinal.page-1)*S.queryFinal.limit,S.queryFinal.id=S.contact.id,S.promise=r.cmContact.getHopperFinals(S.queryFinal,T("finals")).$promise}function C(){S.queryHistory.offset=(S.queryHistory.page-1)*S.queryHistory.limit,S.queryHistory.id=S.contact.id,S.promise=r.cmContact.getHopperHistories(S.queryHistory,T("histories")).$promise}function w(e){S.journeyIsLoading=!0;var n=_.merge(S.journeyOptions,{id:S.contact.id,offset:e||0});return y.get(S.journey,n).then(function(e){S.journey=e.journey,S.canLoadMoreJourney=e.loadMore}).finally(function(){S.journeyIsLoading=!1})}S.currentUser=A.getCurrentUser(),S.license=b,S.journey=[],S.contact=l||{},S.hoppers=d||{rows:[],count:0},S.finals=c||{rows:[],count:0},S.histories=m||{rows:[],count:0},S.companies=p||{rows:[],count:0},S.lists=g||{rows:[],count:0},S.customFields=v||{rows:[],count:0},S.tags=h||{rows:[],count:0},S.jscriptySessions=f||{rows:[],count:0},S.journeyOptions=y.getQuery(),S.quickFilters=y.getQuickFilters(),S.journeyTimelineOptions={scrollEl:"#journey-content"},S.additionalItems=[],S.additionalItemTypes=[],S.contactItemTypes=[],S.firstDayMonth=new Date(moment().startOf("month").subtract(1,"seconds").utcOffset(0,!0).format()),S.lastDayMonth=new Date(moment().endOf("month").subtract(1,"day").utcOffset(0,!0).format()),S.userProfileSection=E&&1==E.count?E.rows[0]:null,S.crudPermissions=A.parseCrudPermissions(S.userProfileSection?S.userProfileSection.crudPermissions:null),S.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),S.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},S.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},S.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},S.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},S.selectedTab=e.params.tab||0,S.onInit=function(){A.hasRole("admin")||(function(){if(!_.some(S.companies.rows,{id:S.contact.CompanyId}))r.cmCompany.get({id:S.contact.CompanyId,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,S.companies.rows.push(n)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}(),function(){var e=_.map(S.contact.Tags,function(e){return{id:e.id,name:e.name}});if(!_.isEmpty(e))for(var n=0;n<e.length;n++)_.some(S.tags.rows,{id:e.id})||(e[n].canSelect=!1,S.tags.rows.push(e[n]))}());return r.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){S.users=e||{count:0,rows:[]},S.usersMap=_.mapValues(_.keyBy(S.users.rows,"id"),"fullname"),S.Tags=_.map(S.contact.Tags,"id");var n=_.map(S.contact.Phones,"item"),t=_.map(S.contact.Phones,"description");S.additionalItemTypes=_.map(S.contact.Phones,"ItemTypeId");var a=_.map(S.contact.Phones,"ItemType.rgbBackgroundColor"),i=_.map(S.contact.Phones,"ItemType.name"),s=_.map(S.contact.Phones,"ItemType.id");S.additionalItems=[];for(var o=0;o<n.length;o++)S.additionalItems.push({phone:n[o],type:i[o],ItemTypeId:s[o],color:a[o],description:t[o]})}).then(function(e){r.contactItemType.get({fields:"id,name,rgbBackgroundColor"}).$promise.then(function(e){S.contactItemTypes=e.rows})}).finally(function(){S.contact&&w()})},S.gotoContacts=function(){e.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},S.duplicateContact=function(e){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:S.currentUser.userProfileId,section:"Lists",fields:"id,name"})}]},locals:{contacts:u.rows,contact:l}})},S.saveContact=function(){r.cmContact.update({id:S.contact.id},S.contact).$promise.then(function(){o.success({title:"Contact updated!",msg:S.contact.name?S.contact.name+" has been updated!":""})}).then(function(){return r.cmContact.setTags({id:S.contact.id,ids:S.Tags}).$promise}).then(function(){return r.cmContact.setAdditionalPhones({id:S.contact.id,items:S.additionalItems}).$promise}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},S.editCompany=function(e,n){var t=_.find(S.companies.rows,{id:n});s.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null,crudPermissions:!1===t.canSelect?{readOnly:!0,canEdit:!1,canDelete:!1}:r.userProfileSection.get({userProfileId:S.currentUser.userProfileId,sectionId:302}).$promise.then(function(e){var n=e.rows?e.rows[0]:null;return A.parseCrudPermissions(n?n.crudPermissions:null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:GET_COMPANY_SECTION",msg:e.data?JSON.stringify(e.data):e.toString()})})},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:n})}]}})},S.onSelectList=function(e){if(S.contact.ListId){var n=s.confirm().title("You are selecting the list number: "+S.contact.ListId).textContent("Warning! You won't select a different list for the contact "+S.contact.firstName||S.contact.lastName||S.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(S.onSelectListSuccess).catch(function(){S.contact.ListId=null})}},S.onSelectListSuccess=function(){return r.cmList.getCustomFields({id:S.contact.ListId}).$promise.then(function(e){S.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},S.getDateFromString=function(e){return null===e?void 0:new Date(e)},S.getHoppers=I,S.getFinals=O,S.getHistories=C,S.getJscriptySessions=function(){S.queryJscriptySession.offset=(S.queryJscriptySession.page-1)*S.queryJscriptySession.limit,S.queryJscriptySession.id=S.contact.id,S.promise=r.cmContact.getJscriptySessions(S.queryJscriptySession,T("jscriptySessions")).$promise},S.deleteconfirm=function(n,e){var t=s.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(n.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(S.hoppers.rows,{id:e.id}),S.hoppers.count--,S.hoppers.rows.length||S.getHoppers(),o.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},S.editHopper=function(e,n){s.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.createOrEditIvrCampaignHopper=function(e,n){s.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.newPhone=function(e){return{phone:e,color:"gray"}},S.getCustomerJourney=w,S.loadMoreJourney=function(){return n(function(e,n){var t=S.journey.length;return e(w(t))})},S.moveUp=function(e){N(e,e-1)},S.moveDown=function(e){N(e,e+1)};var R=!0,x=1;function N(e,n){var t=S.additionalItems[n];S.additionalItems[n]=S.additionalItems[e],S.additionalItems[e]=t,a.additionalPhonesForm.$setDirty()}a.$watch("vm.queryHopper.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHopper.page),e!==n&&(S.queryHopper.page=1),e||(S.queryHopper.page=x),I())}),a.$watch("vm.queryFinal.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryFinal.page),e!==n&&(S.queryFinal.page=1),e||(S.queryFinal.page=x),O())}),a.$watch("vm.queryHistory.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHistory.page),e!==n&&(S.queryHistory.page=1),e||(S.queryHistory.page=x),C())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","$q","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license","Auth","userProfileSection","customerJourneyManager"],angular.module("app.contactmanager.contacts").controller("ContactController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1},{key:"dialTimezone",required:!1}],g.contactItemTypes=[],l.contactItemType.get({fields:"id,name,orderBy"}).$promise.then(function(e){var n=e.rows;console.log(n);for(var t=0;t<n.length;t++)g.contactItemTypes.push({key:n[t].name,required:!1})}),g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),n.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],n=0;n<g.result.errors.length;n+=1){var t=g.result.errors[n].row;t.contact_import_error=g.result.errors[n].message,e.push(t)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(t){i(function(){if(g.result.rows=t.rows,t.errors)for(var e=0;e<t.errors.length;e++)g.result.errors.push(t.errors[e]);if(t.finish){g.result.finish=!0,g.result.affectedRows=t.affectedRows,g.result.failedRows=g.result.errors.length;var n=g.result.rows-g.result.affectedRows-g.result.errors.length;n&&0<n&&(g.duplicates.length?g.result.duplicatedRows=n:g.result.failedRows+=n),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"id",required:!0},{key:"firstName",required:!1},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1}],g.contactItemTypes=[],l.contactItemType.get({fields:"id,name,orderBy"}).$promise.then(function(e){for(var n=e.rows,t=0;t<n.length;t++)g.contactItemTypes.push({key:n[t].name,required:!1})}),g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),n.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.importUpdates({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],n=0;n<g.result.errors.length;n+=1){var t=g.result.errors[n].row;t.contact_import_error=g.result.errors[n].message,e.push(t)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(t){i(function(){if(g.result.rows=t.rows,t.errors)for(var e=0;e<t.errors.length;e++)g.result.errors.push(t.errors[e]);if(t.finish){g.result.finish=!0,g.result.affectedRows=t.affectedRows,g.result.failedRows=g.result.errors.length;var n=g.result.rows-g.result.affectedRows-g.result.errors.length;n&&0<n&&(g.duplicates.length?g.result.duplicatedRows=n:g.result.failedRows+=n),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsUpdatesDialogController",e)}(),function(){"use strict";function e(i,e,s,n,o,t,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(n),a.lists=t||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:n.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,n,t){var a=i.confirm({skipHide:!0}).title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+t.id+" will be overwritten by the fields of the contact #"+n.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:t.id,from:n.id}).$promise}).then(function(e){i.hide({new:e,to:t,from:n}),_.remove(o,{id:t.id}),_.remove(o,{id:n.id}),o.unshift(e)}).then(function(){s.success({title:"Contact properly merged!"})}).catch(function(e){e&&e.status&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},g.globalCustomField=l,g.globalCustomFields=r,g.newGlobalCustomField=!1,g.globalCustomField||(g.globalCustomField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",g.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,n){if(e!==n)switch(e){case"text":g.globalCustomField.values="";break;case"select":g.globalCustomField.values=[]}}),g.addNewGlobalCustomField=function(){g.errors=[],d.cmCustomField.save(g.globalCustomField).$promise.then(function(e){g.globalCustomFields.unshift(e.toJSON()),o.success({title:"GlobalCustomField properly created",msg:g.globalCustomField.name?g.globalCustomField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGlobalCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.globalCustomField.id},g.globalCustomField).$promise.then(function(e){var n=_.find(g.globalCustomFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"GlobalCustomField properly saved!",msg:g.globalCustomField.name?g.globalCustomField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGlobalCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.globalCustomField.id}).$promise.then(function(){_.remove(g.globalCustomFields,{id:g.globalCustomField.id}),o.success({title:"GlobalCustomField properly deleted!",msg:(g.globalCustomField.name||"globalCustomField")+" has been deleted!"}),v(g.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.globalCustomFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.globalCustomFields=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="globalCustomFields",f.listOrder="",f.listOrderAsc=null,f.selectedGlobalCustomFields=[],f.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,page:1},f.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("globalCustomField")+"?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getGlobalCustomFields=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCustomField.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="GlobalCustomFields",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditGlobalCustomField=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:n,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteGlobalCustomField=y,f.exportSelectedGlobalCustomFields=function(){var e=angular.copy(f.selectedGlobalCustomFields);return f.selectedGlobalCustomFields=[],e},f.deleteSelectedGlobalCustomFields=function(e){var n=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+f.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedGlobalCustomFields.forEach(function(e){y(e)}),f.selectedGlobalCustomFields=[]})},f.deselectGlobalCustomFields=function(){f.selectedGlobalCustomFields=[]},f.selectAllGlobalCustomFields=function(){f.selectedGlobalCustomFields=f.globalCustomFields.rows};var b=!0,A=1;function E(e){f.globalCustomFields=e||{count:0,rows:[]}}function y(e){m.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(f.globalCustomFields.rows,{id:e.id}),f.globalCustomFields.count-=1,f.globalCustomFields.rows.length||f.getGlobalCustomFields(),p.success({title:_.startCase("GlobalCustomField")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","globalCustomFields","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_LIST",g.list=angular.copy(l),g.lists=r,g.newList=!1,g.list||(g.list={},g.title="CONTACTMANAGER.NEW_LIST",g.newList=!0),g.addNewList=function(){g.errors=[],d.cmList.save(g.list).$promise.then(function(e){g.lists.unshift(e.toJSON()),o.success({title:"List properly created",msg:g.list.name?g.list.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveList=function(){g.errors=[],d.cmList.update({id:g.list.id},g.list).$promise.then(function(e){var n=_.find(g.lists,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"List properly saved!",msg:g.list.name?g.list.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteList=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmList.delete({id:g.list.id}).$promise.then(function(){_.remove(g.lists,{id:g.list.id}),o.success({title:"List properly deleted!",msg:(g.list.name||"list")+" has been deleted!"}),v(g.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","lists","list","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.cmList.getAgents({id:c.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserList?"penalty "+e.UserList.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.list=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.cmList.removeAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.cmList.addAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:r.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","list","lists","realtime","$translate","Auth","crudPermissions"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.listCustomFields=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.cmList.getCustomFields(m.query,u).$promise}function g(e){d.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(m.listCustomFields.rows,{id:e.id}),m.listCustomFields.count-=1,m.listCustomFields.rows.length||p(),l.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.list={},m.listCustomFields={count:0,rows:[]},m.selectedListCustomFields=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",limit:10,page:1},m.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.list=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("customField #")+e.id||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getListCustomFields=p,m.createOrEditListCustomField=function(e,n){o.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:m.list,customField:n,customFields:m.listCustomFields.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedListCustomFields=function(){var e=angular.copy(m.selectedListCustomFields);return m.selectedListCustomFields=[],e},m.deleteListCustomField=g,m.deleteSelectedListCustomFields=function(e){var n=o.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+m.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedListCustomFields.forEach(function(e){g(e)}),m.selectedListCustomFields=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},g.customField=l,g.customFields=r,g.newCustomField=!1,g.customField||(g.customField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_CUSTOMFIELD",g.newCustomField=!0),e.params.id&&(g.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,n){if(e!==n)switch(e){case"text":g.customField.values="";break;case"select":g.customField.values=[]}}),g.addNewCustomField=function(){g.errors=[],d.cmList.addCustomField({id:e.params.id},g.customField).$promise.then(function(e){g.customFields.unshift(e.toJSON()),o.success({title:"CustomField properly created",msg:g.customField.name?g.customField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.customField.id},g.customField).$promise.then(function(e){var n=_.find(g.customFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomField properly saved!",msg:g.customField.name?g.customField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.customField.id}).$promise.then(function(){_.remove(g.customFields,{id:g.customField.id}),o.success({title:"CustomField properly deleted!",msg:(g.customField.name||"customField")+" has been deleted!"}),v(g.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.customFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.customFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customFields","customField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(a,e,t,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.list=c||a.params.list||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},u.agentadddialog=function(e,n){t.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:u.lists?u.lists.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoLists=function(){a.go("app.contactmanager.lists",{},{reload:"app.contactmanager.lists"})},u.saveList=function(){r.cmList.update({id:u.list.id},u.list).$promise.then(function(){l.success({title:"List updated!",msg:u.list.name?u.list.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","list","userProfileSection"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.cmList.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.list=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.list.id,field:"ListId",route:"cmList"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.contactmanager").controller("ListDispositionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.lists=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="lists",f.listOrder="",f.listOrderAsc=null,f.selectedLists=[],f.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.lists.edit",{id:e.id,list:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},f.exportcsvcontactsexport=function(i,e){return m.cmList.getContactsCsv({id:i.id,nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","exportContacts_"+i.id+".csv"),a.click()}else p.info({title:"EXPORT",msg:"The list is empty"})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.agentadddialog=function(e,n){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:f.lists?f.lists.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("list")+"?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getLists=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmList.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Lists",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditList=function(e,n){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:n,lists:f.lists.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteList=y,f.exportSelectedLists=function(){var e=angular.copy(f.selectedLists);return f.selectedLists=[],e},f.deleteSelectedLists=function(e){var n=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+f.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedLists.forEach(function(e){y(e)}),f.selectedLists=[]})},f.deselectLists=function(){f.selectedLists=[]},f.selectAllLists=function(){f.selectedLists=f.lists.rows};var b=!0,A=1;function E(e){f.lists=e||{count:0,rows:[]}}function y(e){m.cmList.delete({id:e.id}).$promise.then(function(){_.remove(f.lists.rows,{id:e.id}),f.lists.count-=1,f.lists.rows.length||f.getLists(),p.success({title:_.startCase("List")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","lists","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;function b(){return a.smsAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.smsAccounts=e,a.smsInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].SmsAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.smsAccounts.rows,{id:e.rows[t].SmsAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.smsAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.smsAccounts=n})})}function A(){return a.faxAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.faxAccounts=e,a.faxInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].FaxAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.faxAccounts.rows,{id:e.rows[t].FaxAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.faxAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.faxAccounts=n})})}function E(){return a.openchannelAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.openchannelAccounts=e,a.openchannelInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].OpenchannelAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.openchannelAccounts.rows,{id:e.rows[t].OpenchannelAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.openchannelAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.openchannelAccounts=n})})}function y(){return a.whatsappAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.whatsappAccounts=e,a.whatsappInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].WhatsappAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.whatsappAccounts.rows,{id:e.rows[t].WhatsappAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.whatsappAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.whatsappAccounts=n})})}function S(){return a.chatWebsite.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.chatWebsites=e,a.chatInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].ChatWebsiteId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.abandoned+=e.rows[t].abandoned,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.chatWebsites.rows,{id:e.rows[t].ChatWebsiteId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","abandoned","unmanaged"]));return f.chatWebsites}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.chatWebsites=n})})}function T(){return a.mailAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.mailAccounts=e,a.mailInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].MailAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.mailAccounts.rows,{id:e.rows[t].MailAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.mailAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.mailAccounts=n})})}function I(){for(var e=0;e<f.customDashboard.widgets.length;e+=1)f.customDashboard.widgets[e].voiceQueuesSelected=f.voiceQueuesSelected,f.customDashboard.widgets[e].chatWebsitesSelected=f.chatWebsitesSelected,f.customDashboard.widgets[e].smsAccountsSelected=f.smsAccountsSelected,f.customDashboard.widgets[e].faxAccountsSelected=f.faxAccountsSelected,f.customDashboard.widgets[e].mailAccountsSelected=f.mailAccountsSelected,f.customDashboard.widgets[e].openchannelAccountsSelected=f.openchannelAccountsSelected,f.customDashboard.widgets[e].whatsappAccountsSelected=f.whatsappAccountsSelected}f.currentUser=s.getCurrentUser(),f.userProfile=v,f.userProfileSection=h&&1===h.count?h.rows[0]:null,f.crudPermissions=s.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.customDashboard={},f.voiceQueues=l&&l.count?l:{count:0,rows:[]},f.voiceQueuesSelected=l&&l.count?_.map(l.rows,"id"):[],f.faxAccounts=d&&d.count?d:{count:0,rows:[]},f.faxAccountsSelected=d&&d.count?_.map(d.rows,"id"):[],f.chatWebsites=c&&c.count?c:{count:0,rows:[]},f.chatWebsitesSelected=c&&c.count?_.map(c.rows,"id"):[],f.smsAccounts=m&&m.count?m:{count:0,rows:[]},f.smsAccountsSelected=m&&m.count?_.map(m.rows,"id"):[],f.mailAccounts=u&&u.count?u:{count:0,rows:[]},f.mailAccountsSelected=u&&u.count?_.map(u.rows,"id"):[],f.openchannelAccounts=p&&p.count?p:{count:0,rows:[]},f.openchannelAccountsSelected=p&&p.count?_.map(p.rows,"id"):[],f.whatsappAccounts=g&&g.count?g:{count:0,rows:[]},f.whatsappAccountsSelected=g&&g.count?_.map(g.rows,"id"):[],f.interval=n(function(){},1e3),f.goToEdit=function(){e.go("app.tools.customDashboards.edit",{customDashboard:f.customDashboard,id:f.customDashboard.id,tab:1})},f.setFilter=function(e){o.show({controller:"FilterDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/custom/filter/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{vm_parent:f}}).then(function(e){f=e,I()})},f.updateWidget=I,i.onWithoutApply("voice_queue:save",function(e){var n=_.find(f.voiceQueues.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.onWithoutApply("sms_account:save",function(e){var n=_.find(f.smsAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("smsInteraction:update",b),i.on("smsInteraction:save",b),i.onWithoutApply("fax_account:save",function(e){var n=_.find(f.faxAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("faxInteraction:update",A),i.on("faxInteraction:save",A),i.onWithoutApply("mail_account:save",function(e){var n=_.find(f.mailAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("mailInteraction:update",T),i.on("mailInteraction:save",T),i.onWithoutApply("openchannel_account:save",function(e){var n=_.find(f.openchannelAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("openchannelInteraction:update",E),i.on("openchannelInteraction:save",E),i.onWithoutApply("whatsapp_account:save",function(e){var n=_.find(f.whatsappAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("whatsappInteraction:update",y),i.on("whatsappInteraction:save",y),i.onWithoutApply("chat_website:save",function(e){var n=_.find(f.chatWebsites.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("chatInteraction:update",S),i.on("chatInteraction:save",S),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return f.customDashboard=e,f.customDashboard.widgets=[],f.customDashboard.preview=!0,f.customDashboard.draggable={enabled:!1},f.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:f.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",e.rows[n].voiceQueues=f.voiceQueues,e.rows[n].voiceQueuesSelected=f.voiceQueuesSelected,e.rows[n].faxAccounts=f.faxAccounts,e.rows[n].faxAccountsSelected=f.faxAccountsSelected,e.rows[n].mailAccounts=f.mailAccounts,e.rows[n].mailAccountsSelected=f.mailAccountsSelected,e.rows[n].smsAccounts=f.smsAccounts,e.rows[n].smsAccountsSelected=f.smsAccountsSelected,e.rows[n].chatWebsites=f.chatWebsites,e.rows[n].chatWebsitesSelected=f.chatWebsitesSelected,e.rows[n].openchannelAccounts=f.openchannelAccounts,e.rows[n].openchannelAccountsSelected=f.openchannelAccountsSelected,e.rows[n].whatsappAccounts=f.whatsappAccounts,e.rows[n].whatsappAccountsSelected=f.whatsappAccountsSelected,f.customDashboard.widgets.push(e.rows[n])}).catch(function(){f.customDashboard=void 0}),t.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("sms_account:save"),i.removeAllListeners("fax_account:save"),i.removeAllListeners("mail_account:save"),i.removeAllListeners("openchannel_account:save"),i.removeAllListeners("whatsapp_account:save"),i.removeAllListeners("chat_website:save"),i.removeAllListeners("chatInteraction:save"),i.removeAllListeners("chatInteraction:update"),i.removeAllListeners("smsInteraction:save"),i.removeAllListeners("smsInteraction:update"),i.removeAllListeners("openchannelInteraction:save"),i.removeAllListeners("openchannelInteraction:update"),i.removeAllListeners("mailInteraction:save"),i.removeAllListeners("mailInteraction:update"),i.removeAllListeners("faxInteraction:save"),i.removeAllListeners("faxInteraction:update"),i.removeAllListeners("whatsappInteraction:save"),i.removeAllListeners("whatsappInteraction:update"),f.interval&&n.cancel(f.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","$mdDialog","$document","voiceQueues","faxAccounts","chatWebsites","smsAccounts","mailAccounts","openchannelAccounts","whatsappAccounts","userProfile","userProfileSection"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){a.hide(c.parent)}c.title="DASHBOARDS.SETFILTERS",c.currentUser=l.getCurrentUser(),c.parent=d,c.onChangeFilter=function(e){for(var n=0;n<c.parent.customDashboard.widgets.length;n+=1)switch(e){case"voice":c.parent.customDashboard.widgets[n].voiceQueuesSelected=c.parent.voiceQueuesSelected;break;case"sms":c.parent.customDashboard.widgets[n].smsAccountsSelected=c.parent.smsAccountsSelected;break;case"chat":c.parent.customDashboard.widgets[n].chatAccountsSelected=c.parent.chatAccountsSelected;break;case"fax":c.parent.customDashboard.widgets[n].faxAccountsSelected=c.parent.faxAccountsSelected;break;case"mail":c.parent.customDashboard.widgets[n].mailAccountsSelected=c.parent.mailAccountsSelected;break;case"openchannel":c.parent.customDashboard.widgets[n].openchannelAccountsSelected=c.parent.openchannelAccountsSelected;break;case"whatsapp":c.parent.customDashboard.widgets[n].whatsappAccountsSelected=c.parent.whatsappAccountsSelected}},c.confirm=function(){m()},c.closeDialog=m}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","api","Auth","vm_parent"],angular.module("app.tools").controller("FilterDialogController",e)}(),function(){"use strict";function e(e,s,i,c,o,r,m,n,l,t,u,a,d,p,g,v,h,f,b,A,E){var y=this;y.license=v,y.setting=h,y.detectBrowser=b.detectBrowser(),y.user=n.getCurrentUser(),y.currentTab=0,y.notifications={},y.tabs={},y.agentCapacity={},y.autoClose=!1,y.acceptedNotifications=[],y.autoanswerTimeout,y.globalUserLists=a||{count:0,rows:[]},y.globalLists=d||{count:0,rows:[]},y.globalCompanies=p||{count:0,rows:[]},y.globalTags=g||{count:0,rows:[]};var S=E.getLogger("dashboard","agent.general.contact");function T(e){var n={};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&(n[t]=_.pick(y.tabs[t],["type","title","channel","icon","color","autoCreate","id","saved","badges","openedAt"]),_.isNil(y.tabs[t].contact)||(n[t].contact=_.pick(y.tabs[t].contact,["id","ListId"])),_.isNil(y.tabs[t].calls)||(n[t].calls=y.tabs[t].calls),y.tabs[t].interaction&&(n[t].interaction=_.pick(y.tabs[t].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","WhatsappAccountId","closed","draft"])));var a=JSON.parse(i.localStorage.getItem("motion2.user:"+y.user.id));a?(a.tabs=n,a.currentTab=y.currentTab,a.autoClose=y.autoClose):a={tabs:n,currentTab:y.currentTab,autoClose:y.autoClose},i.localStorage.setItem("motion2.user:"+y.user.id,JSON.stringify(a)),e&&I(e)}function I(e){if(_.isNil(e)||e&&"interaction"===e.type){var n={id:y.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,whatsapp:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],whatsapp:[],openchannel:[],chat:[]}};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&n.capacity.hasOwnProperty(y.tabs[t].channel)&&y.tabs[t].interaction&&!y.tabs[t].interaction.closed&&(n.capacity[y.tabs[t].channel]+=1,n.interaction[y.tabs[t].channel].push(y.tabs[t].interaction.id));if(!_.isEqual(y.agentCapacity,n.capacity))return y.agentCapacity=n.capacity,l.rpc.setAgentCapacity(n)}}function O(e){y.tabs[e.id]&&(!function(e){if(e.channel&&e.interaction)l.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:y.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){S.error(e)})}(y.tabs[e.id]),delete y.tabs[e.id],y.currentTab=0,T(e))}function C(e){Object.keys(y.tabs).length!==y.setting.limitTabs?(e.id=_.random(1e10),e.openedAt=(new Date).toISOString(),e.saved=!1,e.badges=0,y.tabs[e.id]=e,y.currentTab=e.id,T(e)):u.warning({title:"",msg:c.instant("DASHBOARD.LIMIT_TABS_REACHED")})}function w(n){return _.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==n.interactionId&&e.channel==n.channel})}function R(n,t){var e,a,i={type:"contact",title:n?(e=n,a="",e&&(e.firstName||e.lastName?(e.firstName&&(a+=e.firstName+" "),e.lastName&&(a+=e.lastName)):e.phone&&(a=e.phone)),a=y.user.privacyEnabled?A.mask(a):a):c.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:n,calls:t?[t]:[],autoCreate:t?t.autoCreate:0};if(t&&(t.answertime||(t.answertime=t.agentconnectAt),(t.agentcompleteAt||t.endtime)&&U(t)),n){var s=_.find(y.tabs,function(e){return e.contact&&e.contact.id?"contact"===e.type&&e.contact&&e.contact.id==n.id:"contact"===e.type&&e.contact&&e.contact.phone==n.phone});if(s){if(t)return l.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){(e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime),s.calls)?_.find(s.calls,function(e){return e.uniqueid===t.uniqueid})||s.calls.push(t):s.calls=[t];y.currentTab=s.id})}else{if(n.ListId)return l.disposition.get({ListId:n.ListId,nolimit:!0}).$promise.then(function(e){return i.dispositions=e,l.cmList.getCustomFields({id:n.ListId,nolimit:!0}).$promise}).then(function(e){i.customFields=e}).catch(F()).finally(function(){C(i)});C(i)}}else C(i)}function x(n,t){var e=_.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===t.id&&e.channel===n});e?(e.isDraft=t.isDraft||!1,y.currentTab=e.id):C(e={type:"interaction",title:n?n.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";case"whatsapp":return"icon-whatsapp";default:return"icon-hangouts"}}(n),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";case"whatsapp":return"lime-A700";default:return"grey"}}(n),channel:n,interaction:t,isDraft:t.isDraft||!1})}function N(e){var n=0;switch(e){case"chat":n=105;break;case"mail":n=106;break;case"sms":n=107;break;case"openchannel":n=108;break;case"fax":n=109;break;case"whatsapp":n=114}return 0<n&&_.includes(y.user.permissions,n)}function D(t){f.isSupported()?f.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=t).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},f.show(e.title,n)},function(e){S.error("Please enable browser notifications!",e)}):S.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}function P(n){u.wait({title:n.title,msg:n.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:n.sound,html:!0,shake:n.shake||!1,onAdd:function(){y.notifications[n.uniqueid]=this.id},onAccept:function(){if(L(n),l[n.channel+"Message"])return l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){y.acceptedNotifications.push(n.id),y.autoanswerTimeout=null,x(e.channel,e.interaction),u.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(F())},onReject:function(){if(L(n),_.isNil(y.autoanswerTimeout)||(r.cancel(y.autoanswerTimeout),y.autoanswerTimeout=null),l[n.channel+"Message"])return l[n.channel+"Message"].reject({id:n.id,UserId:y.user.id}).$promise.then(function(){u.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(F())}})}function L(e){e&&e.uniqueid&&y.notifications[e.uniqueid]&&(u.clear(y.notifications[e.uniqueid]),delete y.notifications[e.uniqueid])}function k(n){var t=n.uniqueid;for(var e in S.debug("onVoiceChannelRemove -> evt",n),y.tabs)if(y.tabs.hasOwnProperty(e)){var a=y.tabs[e];if(a.calls){S.debug("onVoiceChannelRemove -> key, tab, tab.calls",e,a,a.calls);var i=_.findIndex(a.calls,function(e){return e.uniqueid===t});i<0&&0<=(i=_.findIndex(a.calls,function(e){return e.uniqueid===n.linkedid}))&&(t=n.linkedid),0<=i&&!a.calls[i].disposedAt?(S.debug("Allowing disposition for call %s",a.calls[i].uniqueid),U(a.calls[i])):S.debug("Call %s not found or already completed",a.calls[i].uniqueid),a.contact&&a.contact.id&&r(M(t,a.contact.id,a),1e3)}}T()}function M(n,e,t){return function(){if(_.find(t.calls,function(e){return e.uniqueid===n}))return l.voiceCallReport.update({id:n,ContactId:e}).$promise.catch(function(e){S.error(e)})}}function U(e){e.disposedAt=new Date}function F(){return function(e){if(404===e.status)u.warning({title:c.instant("DASHBOARDS.ATTENTION"),msg:c.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){y.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)u.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}function $(e){l.cmHopper.update({id:e,recallmeNotifiedDate:null}).$promise.then(function(e){S.debug(e)}).catch(function(e){S.error(e)}).finally(function(){q(e)})}function q(e){y.toasty.clear(y.notifications[e])}y.onClickTab=function(e){y.currentTab=e,T(y.tabs[e])},y.isActiveTab=function(e){return e===y.currentTab},y.alreadyExistsTab=w,y.addContactTab=R,y.addInteractionTab=x,y.addTab=C,y.removeTab=O,y.updateLocalStorage=T,y.closeTab=function(e){var n=!1,t=s.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved){var a=y.user.voicePause||y.user.chatPause||y.user.mailPause||y.user.openchannelPause||y.user.faxPause;return"interaction"===e.type&&(n=e.interaction.Account.mandatoryDisposition),s.show(t).then(function(){"interaction"===e.type&&s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),onRemoving:function(){y.user&&n&&!a&&l.user.unpause({id:y.user.id}).$promise.catch(function(e){S.error(e)})},clickOutsideToClose:!n,escapeToClose:!n,locals:{user:y.user,channel:e.channel,interaction:e.interaction}}),O(e)}).catch(function(){"interaction"===e.type&&O(e)})}if(_.forEach(e.calls,function(e){e.mandatoryDisposition&&(n=!0)}),"contact"===e.type&&0<e.calls.length){if(!n)return t._options.textContent="There is a call that hasn't been disposed yet.",s.show(t).then(function(){O(e)});var i=s.alert().title("Warning").textContent("There is a call that hasn't been disposed yet.").ok("OK");s.show(i).finally(function(){i=void 0})}else O(e)}},y.dialPreviewRecallReminder=function(e){var n,t,a,i,s;if(e&&e.hopper){if(i=m("formatdate")(e.hopper.scheduledat),s=e.hopper,e.hopper.Contact&&(n=e.hopper.Contact),e.hopper.List&&(t=e.hopper.List),e.hopper.id&&(a=e.hopper.id),a&&n&&t&&n.firstName){var o=n.firstName;n.lastName&&(o=o+" "+n.lastName);var r=s.phone||n.phone;y.user.privacyEnabled&&(o=A.mask(o),r=A.mask(r));var l=c.instant("DASHBOARDS.RECALLME_CALL_REMINDER"),d="<div> <span>"+c.instant("DASHBOARDS.UPCOMING_RECALLME_CALL")+"</span><br> <span>"+c.instant("DASHBOARDS.CONTACT_NAME")+": "+o+"</span><br> <span>"+c.instant("DASHBOARDS.CONTACT_PHONE")+": "+r+"</span><br> <span>"+c.instant("DASHBOARDS.SCHEDULED_TIME")+": "+i+"</span><br> <span>"+c.instant("DASHBOARDS.LIST_NAME")+": "+t.name+"</span><br> </div>";S.debug(e),u.info({title:l,msg:d,showClose:!0,clickToClose:!0,timeout:6e4,html:!0,onAdd:function(){y.notifications[a]=this.id},onAccept:function(){delete y.notifications[a],y.openContactTab(a)},onReject:function(){delete y.notifications[a],$(a)},onRemove:function(){setTimeout(function(){y.notifications[a]&&(delete y.notifications[a],$(a))},1e3)}})}}else S.warn("Response does not contain hopper",e)},y.openContactTab=function(e){y.openPreviewDialog(e),q(e)},y.openPreviewDialog=function(e){l.cmHopper.getPreviewRecall({id:e}).$promise.then(function(e){var n=angular.element("#toolbar").scope();n&&n.vm.openPreviewDialog(e,!0)})},y.toasty=u,function(){var e=i.localStorage.getItem("motion2.user:"+y.user.id);if(e)try{e=JSON.parse(e),y.tabs=e.tabs?e.tabs:{},y.currentTab=e.currentTab?e.currentTab:0,y.autoClose=!!e.autoClose&&e.autoClose,I(y.tabs[y.currentTab]),S.debug("Tabs initiated correctly")}catch(e){S.error(e)}}(),e.$on("$destroy",function(){for(var e in y.notifications)y.notifications.hasOwnProperty(e)&&L({uniqueid:e});t.removeAllListeners("trigger:contactmanager"),t.removeAllListeners("trigger:jscripty"),t.removeAllListeners("trigger:browser:url"),t.removeAllListeners("trigger:browser:popup"),t.removeAllListeners("notification:save"),t.removeAllListeners("notification:remove"),t.removeAllListeners("voice_queue_channel:remove"),t.removeAllListeners("voice_outbound_channel:remove")}),t.on("trigger:contactmanager",function(n){_.isNil(n.contacts)||1!==n.contacts.length?s.show({controller:"ContactSelectionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",parent:angular.element(o.body),locals:{contacts:n.contacts,callNumber:n.evt.routeId?n.evt.destcalleridnum:n.evt.calleridnum}}).then(function(e){R(e,n.evt)}):R(n.contact,n.evt)}),t.on("trigger:jscripty",function(t){return l.jscriptyProject.get({id:t.ProjectId}).$promise.then(function(n){if(n){if(!_.isUndefined(t["xmd-contactid"]))return l.cmContact.get({id:t["xmd-contactid"]}).$promise.then(function(e){try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user,contact:e}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t,contact:e})}).catch(F());try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t})}}).catch(F())}),t.on("trigger:bot",function(n){var t=n.calleridname&&"<unknown>"!==n.calleridname?n.calleridname:n.calleridnum,a=n.calleridnum;return l.squareMessage.get({fields:"id",limit:1,offset:0,uniqueid:n.uniqueid}).$promise.then(function(e){e.count&&C({type:"bot",title:t+" <"+a+">",icon:"fas fa-robot",color:"pink",data:{uniqueid:n.uniqueid}})})}),t.on("trigger:browser:url",function(e){if(e&&e.uri)if(e.uri=_.replace(e.uri,"<%3B",""),e.uri=_.replace(e.uri,"=>%3B=",""),e.uriLocation)switch(e.uriLocation){case"0":i.open(e.uri);break;case"1":i.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;case"2":C({type:"iframe",title:e.uri,icon:"icon-google-earth",color:"blue",src:e.uri});break;default:i.open(e.uri)}else i.open(e.uri)}),t.on("trigger:browser:popup",function(e){e&&e.html&&C({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})}),t.on("notification:save",function(n){if(N(n.channel)&&n&&n.uniqueid){D(n);var e=w(n);if(e){if(l[n.channel+"Message"])return y.currentTab!==e.id&&(e.badges+=1),y.acceptedNotifications.push(n.id),l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id}).$promise.catch(F())}else{var t="mail"==n.channel?"email":n.channel,a=y.user[t+"AutoanswerDelay"]?1e3*y.user[t+"AutoanswerDelay"]:0;if(y.user[t+"Autoanswer"]&&y.license[n.channel]&&N(n.channel)){if(0<a)P(n),y.autoanswerTimeout=r(function(){if(l[n.channel+"Message"]&&!_.includes(y.acceptedNotifications,n.id))return l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){y.acceptedNotifications.push(n.id),x(e.channel,e.interaction),L(n)}).catch(F())},y.user[t+"AutoanswerDelay"]?1e3*y.user[t+"AutoanswerDelay"]:0);else if(l[n.channel+"Message"])return l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){y.acceptedNotifications.push(n.id),x(e.channel,e.interaction)}).catch(F())}else P(n)}}}),t.on("notification:remove",L),t.on("voice_queue_channel:remove",k),t.on("voice_outbound_channel:remove",k),t.on("user:dialPreviewRecallReminder",y.dialPreviewRecallReminder)}e.$inject=["$scope","$mdDialog","$window","$translate","$document","$timeout","$filter","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","setting","desktopNotification","msUtils","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var f={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var n in e)f.hasOwnProperty(n)&&null!=e[n]&&(f[n]=e[n])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,n,p){var g=n.Notification||n.mozNotification||n.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var t=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?t.resolve(e):t.reject(e)}):g.requestPermission(function(e,n){p.GRANTED===e?t.resolve(e):t.reject(e)});return t.promise},show:function(e,n){if(n=n||{},!v()||(t=e,a=n,i=angular.isString(t),s=!a.onClick||angular.isFunction(a.onClick),!i||!s)||function(e){if(e||f.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(n.showOnPageHidden)||h()!==p.GRANTED)return;var t,a,i,s;var o=new g(e,n),r=n.duration||f.duration,l=void 0===n.autoClose?f.autoClose:n.autoClose;o.onclick=function(){n.onClick&&n.onClick(),n.focusOnclick&&window.focus(),n.closeOnClick&&o.close()},l&&(d=o,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return o},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function n(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=d(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=d(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=n,this.deleteItem=function(e){if(!angular.isString(e))return void r.error("path must be a string (eg. `dashboard.project`)");for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1},this.$get=function(){var e={saveItem:n,getNavigation:function(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(t){var a=this;a.setting={},a.messages={count:0,rows:[]},a.showInteraction=!1,a.init=function(e,n){{if(a.setting=n,a.tab=e,a.tab.saved=!0,a.tab&&a.tab.data&&a.tab.data.uniqueid)return t.squareMessage.get({uniqueid:a.tab.data.uniqueid}).$promise.then(function(e){a.messages=e}).finally(function(){a.showInteraction=!0});a.showInteraction=!0}},a.getMessagesAlignment=function(e){switch(a.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}}}e.$inject=["api"],angular.module("app.dashboards").controller("AgentGeneralBotController",e)}(),function(){"use strict";function e(a,d,c,t,m,i,u,p,s,o,e,r,l,n){var g=this;g.user=s.getCurrentUser(),g.detectBrowser=e.detectBrowser(),g.additionalItemTypes=[],g.additionalItems=[],g.contactItemTypes=[],g.newPhone=function(e){return{phone:e,color:"gray"}},g.journey=[],g.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},g.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition,secondDisposition,thirdDisposition",sort:"-updatedAt",limit:10,page:1},g.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},g.hoppers={rows:[],count:0},g.finals={rows:[],count:0},g.histories={rows:[],count:0},g.journeyOptions=r.getQuery(),g.quickFilters=r.getQuickFilters(),g.addNewContact=f,g.saveContact=function(){g.errors=[],u.cmContact.update({id:g.contact.id},g.contact).$promise.then(function(e){var n=h(e);return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,m.$parent.vm.updateLocalStorage(),u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).then(function(){return u.cmContact.setAdditionalPhones({id:g.contact.id,items:g.additionalItems,item_types:g.additionalItemTypes}).$promise.then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly updated!",msg:g.contact.name?g.contact.name+" has been updated!":""})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.getCustomFields=function(e){return u.cmList.getCustomFields({id:e}).$promise.then(function(e){g.tab.customFields=e}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.call=m.$parent.vm.call,g.disposeCall=function(e,i){if(g.newContact)return void p.error({title:"ATTENTION",msg:"Please save the contact before disposing!"});d.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(c.body),targetEvent:i,clickOutsideToClose:!i.mandatoryDisposition,escapeToClose:!i.mandatoryDisposition,resolve:{globalDispositions:["apiResolver",function(e){return e.resolve("disposition@get",{MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}]},onRemoving:function(){g.user&&i.mandatoryDisposition&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{dispositions:g.tab.dispositions,contact:g.contact,call:i,availableCalls:g.tab.calls.length,autoClose:m.$parent.vm.autoClose}}).then(function(e){var n=e[0];for(var t in m.$parent.vm.autoClose=e[1],n&&("BLACKLIST"===n?p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_DISPOSED")+" "+n}):"RECALLME"===n||"RESCHEDULE"===n||p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_SAVED")})),m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(t)){var a=m.$parent.$parent.$parent.vm.tabs[t];_.remove(a.calls,function(e){return e.uniqueid===i.uniqueid})}0===g.tab.calls.length&&m.$parent.vm.autoClose&&m.$parent.vm.removeTab(g.tab),m.$parent.vm.updateLocalStorage()})},g.checkCallStatus=function(n){return g.checkingCallStatus=!0,u.voiceCallReport.get({uniqueid:n.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(n.disposedAt=_.first(e.rows).endtime)}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"VOICE_CALL_REPORT:GET",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){g.checkingCallStatus=!1})},g.duplicateContact=function(e){d.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},g.mergeContact=function(e){d.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}}).then(function(e){if(e){for(var n in m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(n)){var t=m.$parent.$parent.$parent.vm.tabs[n];t&&t.contact&&(e.from&&e.from.id&&e.from.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t),e.to&&e.to.id&&e.to.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t))}e.new&&m.$parent.$parent.$parent.vm.addContactTab(e.new)}})},g.getDateFromString=S,g.addJscriptyTab=function(e){try{e.formData=Mustache.render(e.formData,{contact:g.contact,user:g.user})}catch(e){v.error(e)}try{m.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:g.contact})}catch(e){p.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},g.getHoppers=A,g.getFinals=E,g.getHistories=y,g.getJscriptyProjects=function(){if(g.jscriptyProjects)return;return g.loadingJscriptyProjects=!0,u.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant("JSCRIPTY.JSCRIPTY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.JSCRIPTY_GET_ERROR")})}).finally(function(){g.loadingJscriptyProjects=!1})},g.getAccounts=function(n){if(g[n+"Accounts"])return;var e="get"+_.startCase(n)+"Accounts";return g.loadingAccounts=!0,u.user[e]({id:g.user.id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){g[n+"Accounts"]=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant(n.toUpperCase()+"."+n.toUpperCase()+"ACCOUNTS"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.ACCOUNTS_GET_ERROR",{channel:o.instant("DASHBOARDS."+n.toUpperCase())})})}).finally(function(){g.loadingAccounts=!1})},g.composeInteraction=function(e,o,r,n){var l=o.toLowerCase();d.show({controller:"Compose"+o+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/"+o.toLowerCase()+"/dialog.html",parent:angular.element(c.body),clickOutsideToClose:!1,locals:{account:r,message:{to:"mail"==l?n:n.split(",")},type:"new",interaction:{Contact:g.contact}},fullscreen:!0}).then(function(s){if(!s||_.isNil(s.message)||!s.message.savedAsDraft)return u[l+"Account"].send({id:r.id},s).$promise.then(function(e){if("Mail"===o){var n=e;if(n&&n.Messages&&n.Messages.length){if(s.attachments&&s.attachments.length)for(var t=0;t<s.attachments.length;t+=1)u.attachment.update({id:s.attachments[t].id},{MailMessageId:_.head(n.Messages).id});if(p.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.closed){n.disposition=null;var a=!r.mandatoryDisposition,i=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause;d.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(c.body),onRemoving:function(){g.user&&r.mandatoryDisposition&&!i&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},clickOutsideToClose:a,escapeToClose:a,locals:{user:g.user,channel:"mail",interaction:n}})}else m.$parent.vm.addInteractionTab("mail",n)}}else p.success({title:"Message properly sent!",msg:"Message has been sent!"}),m.$parent.vm.addInteractionTab(l,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"fax"===l?p.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:o.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var e={type:"draft",channel:"mail",account:r,contact:g.contact,id:g.tab.id,openedAt:new Date,saved:!1,title:r.key+" - Untitled",content:s.message},n=a.localStorage.getItem("motion2.home.mail:"+g.user.id);if(n){var t=JSON.parse(n);t.drafts||(t.drafts={}),n=t}else n={drafts:{}};n.drafts[g.tab.id]=e,a.localStorage.setItem("motion2.home.mail:"+g.user.id,JSON.stringify(n))})},g.init=function(n,e){return g.tab=n,m.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e){g.tab.saved=e[0]&&e[1]}),g.license=e,g.contact=g.tab.contact,g.newContact=!1,g.currentTab=0,u.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){g.users=e||{count:0,rows:[]},g.usersMap=_.mapValues(_.keyBy(g.users.rows,"id"),"fullname")}).then(function(){for(var e=[],n=0;n<g.tab.calls.length;n++){var t=g.tab.calls[n];e.push(u.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime)}))}return i.all(e)}).then(function(){return u.user.getLists({id:g.user.id,nolimit:!0}).$promise}).then(function(e){if(g.lists=e||{count:0,rows:[]},g.contact&&g.contact.ListId){if(g.list=_.find(g.lists.rows,{id:g.contact.ListId}),g.list)return;return u.cmList.get({id:g.contact.ListId}).$promise.then(function(e){e&&(g.list=e,g.lists.rows=_.unionBy(g.lists.rows,[g.list]))})}}).then(function(){if(g.contact&&g.contact.id){var e={id:g.contact.id,ListId:g.contact.ListId,limit:1,offset:0,sort:"-updatedAt"};return u.cmContact.get(e).$promise.then(function(e){return g.contact=e,g.tab.contact=e,u.user.addContacts({id:g.user.id,ids:[g.contact.id]})}).then(function(){if(g.contact.ListId)return u.disposition.get({ListId:g.contact.ListId,nolimit:!0}).$promise.then(function(e){return g.tab.dispositions=e,u.cmList.getCustomFields({id:g.contact.ListId,nolimit:!0}).$promise}).then(function(e){g.tab.customFields=e})}).then(function(){try{g.tab.companies=m.$parent.$parent.$parent.vm.globalCompanies,g.tab.tags=m.$parent.$parent.$parent.vm.globalTags,g.tab.autoCreate=0}catch(e){}u.contactItemType.get({}).$promise.then(function(e){g.contactItemTypes=e.rows}).then(function(){u.cmContact.getAdditionalPhones({id:g.contact.id}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");g.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");g.additionalItems=[];for(var s=0;s<n.length;s++)g.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})}).catch(function(e){console.log(e)})}),A(),E(),y()}).then(function(){return u.cmContact.getTags({id:g.contact.id}).$promise.then(function(e){g.tab.Tags=_.map(e.rows,"id")})})}return g.newContact=!0,n.autoCreate?f():void 0}).finally(function(){g.contact&&g.contact.id&&(T(),g.contact.dateOfBirth=S(g.contact.dateOfBirth))})},g.hasPermission=function(e){return s.hasPermission(e)},g.openInteraction=function(e){try{return m.$parent.$parent.$parent.vm.addInteractionTab(e.channel,e)}catch(e){p.error({title:o.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.INTERACTION_OPEN_ERROR")})}},g.getCustomerJourney=T,g.loadMoreJourney=function(){return i(function(e){var n=g.journey.length;return e(T(n))})};var v=n.getLogger("agent.general.contact");function h(e){return e.firstName||e.lastName?(e.firstName+" "+e.lastName).trim():e.phone}function f(){g.errors=[],u.cmContact.save(g.contact).$promise.then(function(e){g.contact.id=e.id,g.newContact=!1;var n=h(e);return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly created",msg:g.contact.firstName?g.contact.firstName+" has been created!":""})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function b(n){return function(e){g[n]=e||{count:0,rows:[]}}}function A(){g.contact&&g.contact.id&&(g.queryHopper.ContactId=g.contact.id,g.queryHopper.offset=(g.queryHopper.page-1)*g.queryHopper.limit,g.promise=u.cmHopper.get(g.queryHopper,b("hoppers")).$promise)}function E(){g.contact&&g.contact.id&&(g.queryFinal.ContactId=g.contact.id,g.queryFinal.offset=(g.queryFinal.page-1)*g.queryFinal.limit,g.promise=u.cmHopperFinal.get(g.queryFinal,b("finals")).$promise)}function y(){g.contact&&g.contact.id&&(g.queryHistory.ContactId=g.contact.id,g.queryHistory.offset=(g.queryHistory.page-1)*g.queryHistory.limit,g.promise=u.cmHopperHistory.get(g.queryHistory,b("histories")).$promise)}function S(e){return null===e?void 0:new Date(e)}function T(e){g.journeyIsLoading=!0;var n=_.merge(g.journeyOptions,{id:g.contact.id,offset:e||0});return r.get(g.journey,n).then(function(e){g.journey=e.journey,g.canLoadMoreJourney=e.loadMore}).finally(function(){g.journeyIsLoading=!1})}m.$on("$destroy",function(){}),m.$watch("currentTab",function(){1===g.currentTab&&(A(),E(),y())});var I=!0,O=1;m.$watch("queryHopper.filter",function(e,n){I?t(function(){I=!1}):(n||(O=g.queryHopper.page),e!==n&&(g.queryHopper.page=1),e||(g.queryHopper.page=O),A())}),m.$watch("queryFinal.filter",function(e,n){I?t(function(){I=!1}):(n||(O=g.queryFinal.page),e!==n&&(g.queryFinal.page=1),e||(g.queryFinal.page=O),E())}),m.$watch("queryHistory.filter",function(e,n){I?t(function(){I=!1}):(n||(O=g.queryHistory.page),e!==n&&(g.queryHistory.page=1),e||(g.queryHistory.page=O),y())})}e.$inject=["$window","$mdDialog","$document","$timeout","$scope","$q","api","toasty","Auth","$translate","msUtils","customerJourneyManager","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(n,t,i,s,o,e,a,r,l,d,c,m,u,p,g){var v=this;v.user=d.getCurrentUser(),v.isReschedule=!1,v.recallme=!1,v.queueCampaign=void 0,v.queueCampaigns={count:0,rows:[]},v.dispositions=_.orderBy(_.concat([],e.rows,a.rows),["name"],["asc"]),v.contact=l,v.call=r,v.note=v.call.note||void 0,v.dialerCall=!1,v.hasBlackLists=!1,v.contactTZTime,v.availableCalls=m,v.autoClose=u,v.recalcTZTime=b,v.hopper={minDate:new Date,dateTime:new Date,scheduledAt:new Date},p.$watch("vm.contact.dialTimezone",function(){b()});var h=g.getLogger("dashboard","agent.general.contact.dispose");function f(){return i(function(n){o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name,dialActive,dialMethod",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){v.queueCampaigns=e||{count:0,rows:[]},n()}).catch(function(e){h.error(e),s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})})}function b(){var e=v.dialerCall?Number(v.call["xmd-voicequeueid"]):v.queueCampaign?v.queueCampaign.id:v.call["xmd-campaignid"]?Number(v.call["xmd-campaignid"]):null;if(e)o.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,_.isNil(v.contact.dialTimezone)&&(v.contact.dialTimezone=v.hopper.dialTimezone),n)o.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}function A(){var e=v.selectedDisposition?v.selectedDisposition.name.toLowerCase():void 0;return{id:v.call.uniqueid,disposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,secondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,thirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?d.getCurrentUser().id:null,OwnerId:d.getCurrentUser().id}}function E(e){t.hide([e,v.autoClose])}v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]?(v.dialerCall=!0,o.voiceQueue.getBlackLists({id:v.call.variables["xmd-voicequeueid"]}).$promise.then(function(e){e&&e.rows&&0<e.rows.length&&(v.hasBlackLists=!0)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})):f(),v.onDispositionChange=function(e){switch(e){case"first":v.selectedDisposition=v.firstLevelDisposition,v.anySecondLevelDisposition=_.some(v.dispositions,["ParentId",v.firstLevelDisposition.id]),v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.anyThirdLevelDisposition=!1;break;case"second":v.selectedDisposition=v.secondLevelDisposition,v.anyThirdLevelDisposition=_.some(v.dispositions,["ParentId",v.secondLevelDisposition.id]);break;case"third":v.selectedDisposition=v.thirdLevelDisposition}},v.clearDispositionSelection=function(e){"second"===e?(v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.selectedDisposition=v.firstLevelDisposition):"third"===e&&(v.thirdLevelDisposition=void 0,v.selectedDisposition=v.secondLevelDisposition)},v.saveDisposition=function(e){v.selectedDisposition=_.isNil(e)?v.selectedDisposition:{name:e},e&&(v.firstLevelDisposition=v.selectedDisposition);v.call.note=v.note,o.voiceCallReport.update({id:v.call.uniqueid,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,note:v.note,UserId:d.getCurrentUser().id,ContactId:v.contact.id}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.voiceRecording.get({uniqueid:v.call.uniqueid}).$promise.then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)o.voiceRecording.update({id:e.rows[n].id,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),v.dialerCall&&(o.cmHopperFinal.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.cmHopperHistory.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}));if(_.isNil(v.selectedDisposition))E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"");else switch(v.selectedDisposition.name.toLowerCase()){case"blacklist":v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]&&function(e){if(e)o.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var n=[];if(e&&0<e.count){for(var t=0;t<e.rows.length;t+=1){var a=angular.copy(v.contact);delete a.id,a.ListId=e.rows[t].id,n.push(o.cmContact.save(a).$promise)}return i.all(n)}s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.NOTAVAILABLE")+" "+v.selectedDisposition}),v.selectedDisposition=void 0}).then(function(e){e&&E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}(v.call.variables["xmd-voicequeueid"]);break;case"reschedule":v.isReschedule=!0,v.recallme=!1;break;case"recallme":v.isReschedule=!0,v.recallme=!0,v.user.selectRecallMeCampaign&&f().then(function(){v.originalCampaign=_.find(v.queueCampaigns.rows,["id",v.call.variables["xmd-voicequeueid"]]);var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));v.queueCampaign=e.previewCampaignId?_.find(v.queueCampaigns.rows,["id",Number(e.previewCampaignId)]):v.originalCampaign});break;default:E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}},v.closeDialog=function(){t.cancel()},v.saveReschedule=function(){v.disable=!0;var e=null;v.queueCampaign?e=v.queueCampaign.id:v.dialerCall&&(e=Number(v.call["xmd-voicequeueid"]));return o.cmHopper.save({phone:v.contact.phone,UserId:v.recallme?d.getCurrentUser().id:null,ContactId:v.contact.id,ListId:v.contact.ListId,VoiceQueueId:e,scheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),dialTimezone:v.contact.dialTimezone,priority:3,recallme:v.recallme,OwnerId:d.getCurrentUser().id}).$promise.then(function(e){o.cmContact.rescheduleAdditionalPhones({id:v.contact.id,hopperId:e.id}).$promise.catch(function(e){console.log(e)})}).then(function(){if(v.dialerCall&&(o.cmHopperFinal.update({id:v.call.uniqueid,rescheduled:!0,rescheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),recallme:v.recallme}).$promise.catch(function(e){h.error(e)}),v.user.selectRecallMeCampaign)){var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));e.previewCampaignId=v.queueCampaign.id,n.localStorage.setItem("motion2.user:"+v.user.id,JSON.stringify(e))}}).then(function(){return o.cmContact.update({id:v.contact.id,dialTimezone:v.contact.dialTimezone})}).then(function(){s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.CALL_DISPOSED")+" "+(v.recallme?c.instant("DASHBOARDS.RECALLME"):c.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){h.error(e),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).finally(function(){v.disable=!1,E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}}e.$inject=["$window","$mdDialog","$q","toasty","api","dispositions","globalDispositions","call","contact","Auth","$translate","availableCalls","autoClose","$scope","ClientSideLoggingService"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,o.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c,OwnerId:d.getCurrentUser().id}).$promise.then(function(){o.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){s.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s){var o=this;o.callNumber=i,o.page=1,o.onInit=function(){n.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){o.lists=_.chain(e.rows).keyBy("id").mapValues("name").value(),n.cmCustomField.get({fields:"id,alias",nolimit:!0}).$promise.then(function(e){o.customFields=e.rows,o.contacts=_.map(t,function(t){return Object.keys(t).forEach(function(e){if(Number(t[e])===Number(o.callNumber))if(e.startsWith("cf_")){var n=_.find(o.customFields,["id",Number(_.trimStart(e,"cf_"))]);t.matchingField=n?n.alias:a.instant("DASHBOARDS.UNKNOWN")}else t.matchingField=e}),t})})}).then(function(){o.paginatedContacts=_.chunk(t,4)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectContact=function(){e.hide(o.selectedContact)}}e.$inject=["$mdDialog","$translate","api","contacts","callNumber","toasty"],angular.module("app.dashboards").controller("ContactSelectionController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition,note",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null,note:e.note||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"outbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(n,t,e,a){var i=this;function s(e,n){switch(e){case"first":i.selectedDisposition=i.firstLevelDisposition,i.anySecondLevelDisposition=_.some(i.dispositions,["ParentId",i.firstLevelDisposition.id]),i.secondLevelDisposition=void 0,i.thirdLevelDisposition=void 0,i.anyThirdLevelDisposition=!1;break;case"second":i.selectedDisposition=i.secondLevelDisposition,i.anyThirdLevelDisposition=_.some(i.dispositions,["ParentId",i.secondLevelDisposition.id]);break;case"third":i.selectedDisposition=i.thirdLevelDisposition}n&&function(e){switch(e){case"first":i.call.secondDisposition&&(i.secondLevelDisposition=_.find(i.dispositions,function(e){return e.name===i.call.secondDisposition&&e.ParentId===i.firstLevelDisposition.id}),i.secondLevelDisposition&&s("second",!0));break;case"second":i.call.thirdDisposition&&(i.thirdLevelDisposition=_.find(i.dispositions,function(e){return e.name===i.call.thirdDisposition&e.ParentId===i.secondLevelDisposition.id}),i.thirdLevelDisposition&&s("third",!0))}}(e)}i.dispositions=e,i.call=a,i.note=i.call.note||void 0,i.onDispositionChange=s,i.clearDispositionSelection=function(e){"second"===e?(i.secondLevelDisposition=void 0,i.thirdLevelDisposition=void 0,i.selectedDisposition=i.firstLevelDisposition):"third"===e&&(i.thirdLevelDisposition=void 0,i.selectedDisposition=i.secondLevelDisposition);n.disposition.$setDirty()},i.saveDisposition=function(){i.call.note=i.note;var e={firstLevel:i.firstLevelDisposition?i.firstLevelDisposition.name:void 0,secondLevel:i.secondLevelDisposition?i.secondLevelDisposition.name:void 0,thirdLevel:i.thirdLevelDisposition?i.thirdLevelDisposition.name:void 0,note:i.note?i.note:void 0};t.hide(e)},i.closeDialog=function(){t.cancel()},i.call.disposition&&(i.firstLevelDisposition=_.find(i.dispositions,function(e){return e.name===i.call.disposition}),i.firstLevelDisposition&&s("first",!0))}e.$inject=["$scope","$mdDialog","dispositions","call"],angular.module("app.dashboards").controller("DisposeAbandonedCallDialogController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition,note",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null,note:e.note||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"inbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(n,a,t,e,i){var s=this;function o(){var e=angular.element(".agent-general-home-navbar button.current")[0];e&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}s.user=t.getCurrentUser(),s.license={},s.plugin={},s.setting={},s.sidebar="dashboard",s.draftManager=i,s.navigation=e.getNavigation(),s.addContactTab=n.$parent.vm.addContactTab,s.addInteractionTab=n.$parent.vm.addInteractionTab,s.init=function(e,n){s.license=e,s.setting=n;var t=a.localStorage.getItem("motion2.home:"+s.user.id);if(t){try{t=JSON.parse(t),s.sidebar=t.currentSidebarTab?t.currentSidebarTab:"dashboard"}catch(e){console.error(e),s.sidebar="dashboard"}"mail"===s.sidebar&&s.draftManager.init()}},s.changeSidebarTab=function(e){s.sidebar=e.view,"plugin"===s.sidebar&&(s.plugin=e.stateParams,s.pluginId=e.id,n.$broadcast("pluginUpdated",{plugin:s.plugin}));a.localStorage.setItem("motion2.home:"+s.user.id,JSON.stringify({currentSidebarTab:e.view}))},s.hasPermission=function(e){return t.hasPermission(e)},angular.element(a).on("resize",o),n.$on("$destroy",function(){angular.element(a).off("resize",o)}),n.$watch("vm_home.sidebar",function(e,n){"mail"===e?s.draftManager.init():s.draftManager.drafts={}})}e.$inject=["$scope","$window","Auth","msNavigationAgentService","draftManager"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(t,n,i,s,a,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.chatInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,ChatWebsiteId:[]},g.sectionColor="green-A700",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getChatWebsites({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.chatAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Website",key:"ChatWebsiteId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.chatAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Website",column:"ChatWebsiteId",type:"multiselect",options:{route:{model:"user",action:"getChatWebsites",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("chat",g.query,g.user.id,g.chatAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("chatInteraction:save",O),d.on("chatInteraction:update",O),d.on("chatInteractionTags:save",C),d.on("chatMessage:save",w),d.on("chatMessage:update",w),d.on("user_has_chat_interactions:save",T),d.on("user_has_chat_interactions:remove",I),d.on("userChatWebsite:save",f),d.on("userChatWebsite:remove",b),0<g.setting.chatInteractionsReloadTimeout&&R()})},g.success=E,g.getChatInteractions=y,g.showChatInteraction=function(e,n){t.$parent.vm.addInteractionTab("chat",n)},g.downloadChatInteraction=function(e,s,n){r.chatInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="chat-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadChatInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"chat",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.chat"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.chat");function h(e){return{accounts:g.chatAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.ChatWebsiteId);u.addAccount("chat",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.ChatWebsiteId);u.removeAccount("chat",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.chatAccounts.rows,function(e){return{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.chatInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.chatInteractions=e||{count:0,rows:[]};for(var n=0;n<g.chatInteractions.rows.length;n+=1)S(g.chatInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=a.localStorage.getItem("motion2.home.chat:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,a.localStorage.setItem("motion2.home.chat:"+g.user.id,JSON.stringify(n)),g.promise=r.chatInteraction.get(g.query,E).$promise}function S(e){"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.chatInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.chatInteractions.rows=_.orderBy(g.chatInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.chatInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.chatInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.chatInteractions.rows,{id:e.ChatInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.chatInteractionsReloadTimeout)}t.$on("$destroy",function(){d.removeAllListeners("chatMessage:save"),d.removeAllListeners("chatMessage:update"),d.removeAllListeners("chatInteraction:save"),d.removeAllListeners("chatInteractionTags:save"),d.removeAllListeners("chatInteraction:update"),d.removeAllListeners("user_has_chat_interactions:save"),d.removeAllListeners("user_has_chat_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(t,n,e,a,i,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,o.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,i.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify(t)),l.promise=o.cmContact.get(l.query,d).$promise}l.currentUser=s.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){a.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){a.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e){return o.cmContact.get({id:e}).$promise.then(function(e){n.$parent.vm.addContactTab(e)})},l.call=n.$parent.vm.call,l.onInit=function(){o.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),o.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.log(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){a.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.contacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","$window","Auth","api","toasty"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,n){c.rpcVoiceQueues[n]&&(c.voiceQueues[n].waiting=c.rpcVoiceQueues[n].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,n){c.rpcChatQueues[n]&&(c.chatQueues[n].waiting=c.rpcChatQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.chatQueues[e.queue_id]&&(c.rpcChatQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveChatQueue),l.onWithoutApply("chatQueue:update",c.onUpdateChatQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveChatQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),o.rpc.getChatQueues().$promise.then(function(e){c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"chat"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,n){c.rpcFaxQueues[n]&&(c.faxQueues[n].waiting=c.rpcFaxQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.faxQueues[e.queue_id]&&(c.rpcFaxQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveFaxQueue),l.onWithoutApply("faxQueue:update",c.onUpdateFaxQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveFaxQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),o.rpc.getFaxQueues().$promise.then(function(e){c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"fax"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,n){c.rpcMailQueues[n]&&(c.mailQueues[n].waiting=c.rpcMailQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.mailQueues[e.queue_id]&&(c.rpcMailQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveMailQueue),l.onWithoutApply("mailQueue:update",c.onUpdateMailQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveMailQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),o.rpc.getMailQueues().$promise.then(function(e){c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"mail"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,n){c.rpcOpenchannelQueues[n]&&(c.openchannelQueues[n].waiting=c.rpcOpenchannelQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.openchannelQueues[e.queue_id]&&(c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveOpenchannelQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateOpenchannelQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),o.rpc.getOpenchannelQueues().$promise.then(function(e){c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"openchannel"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,n){c.rpcSmsQueues[n]&&(c.smsQueues[n].waiting=c.rpcSmsQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.smsQueues[e.queue_id]&&(c.rpcSmsQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveSmsQueue),l.onWithoutApply("smsQueue:update",c.onUpdateSmsQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveSmsQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),o.rpc.getSmsQueues().$promise.then(function(e){c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"sms"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this,c=["type","waiting","dialMethod","dialActive"];function m(e){d.voiceQueuesTotal=e.count?e.count:0,d.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(d.voiceQueues,function(e,n){d.rpcVoiceQueues[n]&&(d.voiceQueues[n].waiting=d.rpcVoiceQueues[n].waiting||0)})}d.voiceQueues={},d.voiceQueuesTotal=0,d.rpcVoiceQueues={},d.getVoiceQueues={},d.rpcVoiceQueuesChannels={},d.addVoiceQueuesChannels={},d.deleteVoiceQueuesChannels=[],d.load=!0,d.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},d.queryChannels={limit:10,page:1},d.success=m,d.getVoiceQueues=function(){d.query.offset=(d.query.page-1)*d.query.limit,d.promise=o.user.getQueues(d.query,m).$promise},d.getSize=function(e){return _.size(e)},d.onSaveQueue=function(e){d.voiceQueues[e.id]&&d.rpcVoiceQueues[e.id]&&(d.rpcVoiceQueues[e.id]=e,_.merge(d.voiceQueues[e.id],_.pick(e,c)))},d.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete d.rpcVoiceQueuesChannels[e.uniqueid],d.load&&d.deleteVoiceQueuesChannels.push(e.uniqueid)):(d.rpcVoiceQueuesChannels[e.uniqueid]=e,d.load&&(d.addVoiceQueuesChannels[e.uniqueid]=e)))},d.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&d.getVoiceQueues()},d.onSaveVoiceQueue=function(e){_.isNil(e)||(d.rpcVoiceQueues[e.id]=_.pick(e,c))},d.onUpdateVoiceQueue=function(e){_.isNil(e)||(d.rpcVoiceQueues[e.id]&&_.merge(d.rpcVoiceQueues[e.id],_.pick(e,c)),d.voiceQueues[e.id]&&_.merge(d.voiceQueues[e.id],_.pick(e,c)))},d.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete d.rpcVoiceQueues[e.id],delete d.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",d.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",d.onSaveChannel),l.onWithoutApply("voice_queue_channel:remove",function(e){"inbound"===e.type&&delete d.rpcVoiceQueuesChannels[e.uniqueid]}),l.onWithoutApply("userVoiceQueue:save",d.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",d.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",d.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",d.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",d.onUpdateVoiceQueue),o.user.getQueues(d.query).$promise.then(function(e){return d.myQueues=e,d.myQueues.count=e.rows.length,o.rpc.getVoiceQueues().$promise}).then(function(e){for(var n=e.rows,t=_.keyBy(n,"id"),a=0;a<d.myQueues.count;a++){var i=d.myQueues.rows[a];d.rpcVoiceQueues[i.id]=t[i.id]}return o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){d.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,function(e){return!("inbound"!==e.type||e.queuecallerleaveAt||!_.find(d.myQueues.rows,{name:e.queue}))}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(d.rpcVoiceQueuesChannels,d.addVoiceQueuesChannels);for(var e=0;e<d.deleteVoiceQueuesChannels.length;e+=1)delete d.rpcVoiceQueuesChannels[d.deleteVoiceQueuesChannels[e]];d.load=!1,d.addVoiceQueuesChannels={},d.deleteVoiceQueuesChannels=[],d.getVoiceQueues()});var u=!0,p=1;e.$watch("vm_dc.query.filter",function(e,n){u?t(function(){u=!1}):(n||(p=d.query.page),e!==n&&(d.query.page=1),e||(d.query.page=p),d.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcWhatsappQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.whatsappQueuesTotal=e.count?e.count:0,c.whatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.whatsappQueues,function(e,n){c.rpcWhatsappQueues[n]&&(c.whatsappQueues[n].waiting=c.rpcWhatsappQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.whatsappQueues={},c.whatsappQueuesTotal=0,c.rpcWhatsappQueues={},c.paginatedInteractions=[],c.deleteWhatsappQueuesWaitingInteractions=[],c.rpcWhatsappQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"whatsapp",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getWhatsappQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.whatsappQueues[e.id]&&c.rpcWhatsappQueues[e.id]&&(_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onSaveWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]=_.pick(e,m))},c.onUpdateWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]&&_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),c.whatsappQueues[e.id]&&_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onRemoveWhatsappQueue=function(e){_.isNil(e)||(delete c.rpcWhatsappQueues[e.id],delete c.whatsappQueues[e.id])},c.onSaveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onRemoveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onSaveWhatsappQueueChannel=function(e){c.whatsappQueues[e.queue_id]&&(c.rpcWhatsappQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveWhatsappQueueChannel=function(e){delete c.rpcWhatsappQueuesWaitingInteractions[e.id],u&&c.deleteWhatsappQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("whatsapp_queue:save",c.onSaveQueue),l.onWithoutApply("whatsappQueue:save",c.onSaveWhatsappQueue),l.onWithoutApply("whatsappQueue:update",c.onUpdateWhatsappQueue),l.onWithoutApply("whatsappQueue:remove",c.onRemoveWhatsappQueue),l.onWithoutApply("userWhatsappQueue:save",c.onSaveUserWhatsappQueue),l.onWithoutApply("userWhatsappQueue:remove",c.onRemoveUserWhatsappQueue),l.onWithoutApply("whatsapp_queue_waiting_interaction:save",c.onSaveWhatsappQueueChannel),l.onWithoutApply("whatsapp_queue_waiting_interaction:remove",c.onRemoveWhatsappQueueChannel),o.rpc.getWhatsappQueues().$promise.then(function(e){c.rpcWhatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"whatsapp"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getWhatsappQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcWhatsappQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteWhatsappQueuesWaitingInteractions.length;e+=1)delete c.rpcWhatsappQueuesWaitingInteractions[c.deleteWhatsappQueuesWaitingInteractions[e]];u=!1,c.deleteWhatsappQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getWhatsappQueues())}),e.$on("$destroy",function(){l.removeAllListeners("whatsapp_queue:save"),l.removeAllListeners("whatsappQueue:save"),l.removeAllListeners("whatsappQueue:update"),l.removeAllListeners("whatsappQueue:remove"),l.removeAllListeners("userWhatsappQueue:save"),l.removeAllListeners("userWhatsappQueue:remove"),l.removeAllListeners("whatsapp_queue_waiting_interaction:save"),l.removeAllListeners("whatsapp_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelWhatsappController",e)}(),function(){"use strict";function e(a,t,i,s,o,n,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.faxInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,FaxAccountId:[]},g.sectionColor="blue-grey",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getFaxAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.faxAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"FaxAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.faxAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"FaxAccountId",type:"multiselect",options:{route:{model:"user",action:"getFaxAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("fax",g.query,g.user.id,g.faxAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("faxInteraction:save",O),d.on("faxInteraction:update",O),d.on("faxInteractionTags:save",C),d.on("faxMessage:save",w),d.on("faxMessage:update",w),d.on("user_has_fax_interactions:save",T),d.on("user_has_fax_interactions:remove",I),d.on("userFaxAccount:save",f),d.on("userFaxAccount:remove",b)})},g.success=E,g.getFaxInteractions=y,g.showFaxInteraction=function(e,n){a.$parent.vm.addInteractionTab("fax",n)},g.downloadFaxInteraction=function(e,s,n){r.faxInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="fax-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadFaxInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"fax",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?n.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return n.instant("DASHBOARDS.NOT_ASSIGNED")},g.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return n.instant("DASHBOARDS.UNKNOWN")},g.composeFaxInteraction=function(e,t){i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.faxAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.fax"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.fax");function h(e){return{accounts:g.faxAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.FaxAccountId);u.addAccount("fax",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.FaxAccountId);u.removeAccount("fax",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.faxAccounts.rows,function(e){return{model:"faxAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.faxInteractionsReloadTimeout&&function(e){e&&g.interactionsInterval&&t.cancel(g.interactionsInterval);g.interactionsInterval=t(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.faxInteractionsReloadTimeout)}(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.faxInteractions=e||{count:0,rows:[]};for(var n=0;n<g.faxInteractions.rows.length;n+=1)S(g.faxInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=o.localStorage.getItem("motion2.home.fax:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,o.localStorage.setItem("motion2.home.fax:"+g.user.id,JSON.stringify(n)),g.promise=r.faxInteraction.get(g.query,E).$promise}function S(e){e.contactInfo=e.Contact?e.Contact.fax:void 0,"Unknown"===e.contactName&&(e.contactName=n.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.faxInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.faxInteractions.rows=_.orderBy(g.faxInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else y(g.query.page)}}function C(e){if(e){var n=_.find(g.faxInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.faxInteractions.rows,{id:e.FaxInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}a.$on("$destroy",function(){d.removeAllListeners("faxMessage:save"),d.removeAllListeners("faxMessage:update"),d.removeAllListeners("faxInteraction:save"),d.removeAllListeners("faxInteractionTags:save"),d.removeAllListeners("faxInteraction:update"),d.removeAllListeners("user_has_fax_interactions:save"),d.removeAllListeners("user_has_fax_interactions:remove"),g.interactionsInterval&&t.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(o,n,r,l,m,t,e,d,a,i,c,u,s,p,g){var v=this;v.user=a.getCurrentUser(),v.license={},v.setting={},v.tags={count:0,rows:[]},v.mailInteractions={count:0,rows:[]},v.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,MailAccountId:[]},v.sectionColor="teal",v.onInit=function(e,n){return v.license=e,v.setting=n,d.user.getMailAccounts({id:v.user.id,nolimit:!0}).$promise.then(function(e){return v.mailAccounts=e||{count:0,rows:[]},d.tag.get({sort:"name"}).$promise}).then(function(e){v.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){v.subStatuses=e||{count:0,rows:[]}}).then(function(){v.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:v.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Account",key:"MailAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:v.mailAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:v.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:v.tags.rows,placeholder:"DASHBOARDS.TAGS"}],v.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"MailAccountId",type:"multiselect",options:{route:{model:"user",action:"getMailAccounts",params:{id:v.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:E("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:E("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:E("third")}}]}}).catch(function(e){h.error(e)}).finally(function(){s.parseInteractionsKey("mail",v.query,v.user.id,v.mailAccounts.rows).then(function(){v.isSearchBarVisible=!(v.query.search||!v.query.filter),S(v.query.page)}),i.on("mailInteraction:save",w),i.on("mailInteraction:update",w),i.on("mailInteractionTags:save",R),i.on("mailMessage:save",x),i.on("mailMessage:update",x),i.on("user_has_mail_interactions:save",O),i.on("user_has_mail_interactions:remove",C),i.on("userMailAccount:save",b),i.on("userMailAccount:remove",A),0<v.setting.mailInteractionsReloadTimeout&&N()})},v.success=y,v.getMailInteractions=S,v.showMailInteraction=T,v.downloadMailInteraction=function(e,s,n){d.mailInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mail-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadMailInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.disposeInteraction=function(e,n){var t=v.user.voicePause||v.user.chatPause||v.user.mailPause||v.user.openchannelPause||v.user.faxPause,a=!n.Account.mandatoryDisposition;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){v.user&&n.Account.mandatoryDisposition&&!t&&d.user.unpause({id:v.user.id}).$promise.catch(function(e){h.error(e)})},locals:{user:v.user,channel:"mail",interaction:n}})},v.getContactLabel=I,v.getAgentLabel=function(e){if(e.UserId)return e.UserId===v.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},v.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},v.composeMailInteraction=function(e,s){r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.id},i).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.mandatoryDisposition,a=v.user.voicePause||v.user.chatPause||v.user.mailPause||v.user.openchannelPause||v.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(){v.user&&s.mandatoryDisposition&&!a&&d.user.unpause({id:v.user.id}).$promise.catch(function(e){h.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:v.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={channel:"mail",account:s,message:e.message,contact:e.contact};u.add(n)}})},v.openAdvancedSearch=function(){r.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{color:v.sectionColor,fields:v.advancedSearch.fields,storagePath:"home.mail"},fullscreen:!0}).then(function(e){v.isSearchBarVisible=!(e.value||!v.query.filter),e.apply&&(v.query.search=e.value,S())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var h=g.getLogger("agent.general.mail");function f(e){return{accounts:v.mailAccounts,accountId:e,filters:v.quickFilters,query:v.query,userId:v.user.id}}function b(e){if(e.UserId===v.user.id){var n=f(e.MailAccountId);p.addAccount("mail",n).then(function(e){e&&S()}).catch(function(e){h.error(e)})}}function A(e){if(e.UserId===v.user.id){var n=f(e.MailAccountId);p.removeAccount("mail",n).catch(function(e){h.error(e)})}}function E(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(v.mailAccounts.rows,function(e){return{model:"mailAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function y(e){!v.reloadingInteractions&&0<v.setting.mailInteractionsReloadTimeout&&N(!0),v.searchInProgress=!1,v.reloadingInteractions=!1,v.mailInteractions=e||{count:0,rows:[]};for(var n=0;n<v.mailInteractions.rows.length;n+=1)I(v.mailInteractions.rows[n])}function S(e){v.searchInProgress=!0,e||(v.query.page=1),(void 0===v.query.closed||null===v.query.closed||v.query.closed)&&delete v.query.substatus,v.query.offset=(v.query.page-1)*v.query.limit;var n=m.localStorage.getItem("motion2.home.mail:"+v.user.id);(n=n?JSON.parse(n):{}).query=v.query,m.localStorage.setItem("motion2.home.mail:"+v.user.id,JSON.stringify(n)),v.promise=d.mailInteraction.get(v.query,y).$promise}function T(e,n){o.$parent.vm.addInteractionTab("mail",n)}function I(e){_.isEmpty(e.to)||!e.Account||_.includes(e.to,e.Account.email)?e.contactInfo=e.Contact?e.Contact.email:void 0:e.contactInfo=e.to.split("<").pop().split(">")[0],"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function O(e){var n=_.find(v.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function C(e){var n=_.find(v.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function w(e){if(e){var n=_.find(v.mailInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),v.query.sort){var t=_.startsWith(v.query.sort,"-")?"desc":"asc";v.mailInteractions.rows=_.orderBy(v.mailInteractions.rows,_.trimStart(v.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===v.setting.mailInteractionsReloadTimeout&&S(v.query.page)}}function R(e){if(e){var n=_.find(v.mailInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function x(e){if(e&&!e.secret){var n=_.find(v.mailInteractions.rows,{id:e.MailInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function N(e){e&&v.interactionsInterval&&n.cancel(v.interactionsInterval),v.interactionsInterval=n(function(){v.reloadingInteractions=!0,v.searchInProgress||S()},1e3*v.setting.mailInteractionsReloadTimeout)}o.$on("openMailDraft",function(e,s){s.interaction?(s.interaction.isDraft=!0,T(null,s.interaction)):r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s.account,message:s.content,type:"draft",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.account.id},i).$promise.then(function(e){if(u.remove(s.id),e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.account.mandatoryDisposition,a=v.user.voicePause||v.user.chatPause||v.user.mailPause||v.user.openchannelPause||v.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(){v.user&&s.account.mandatoryDisposition&&!a&&d.user.unpause({id:v.user.id}).$promise.catch(function(e){h.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:v.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={id:s.id,channel:"mail",account:e.account,message:e.message};u.update(n)}})}),v.resetTooltipPosition=function(e){var n=angular.element(e.currentTarget).children()[1],t=angular.element(n);t.css("top",""),t.css("left",""),t.css("bottom","")},v.adjustTooltipPosition=function(e){var n=angular.element(e.currentTarget).children(),t=n[0],a=n[1],i=angular.element(t),s=angular.element(a),o=m.innerHeight,r=i.offset(),l=r.top,d=r.left,c=o<216+l;s.css("left",d),c?(s.css("top",""),s.css("bottom",o-l)):(s.css("bottom",""),s.css("top",l))},o.$on("$destroy",function(){i.removeAllListeners("mailMessage:save"),i.removeAllListeners("mailMessage:update"),i.removeAllListeners("mailInteraction:save"),i.removeAllListeners("mailInteractionTags:save"),i.removeAllListeners("mailInteraction:update"),i.removeAllListeners("user_has_mail_interactions:save"),i.removeAllListeners("user_has_mail_interactions:remove"),v.interactionsInterval&&n.cancel(v.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","draftManager","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(t,a,e,i,n,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,s.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,o.localStorage.setItem("motion2.home.mycontacts:"+l.currentUser.id,JSON.stringify(t)),l.query.search&&(l.advancedQuery=_.omit(l.query,"id")),l.promise=l.query.search?s.cmContact.get(l.advancedQuery,d).$promise:s.user.getContacts(l.query,d).$promise}l.currentUser=n.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,id:l.currentUser.id,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){i.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e,n){a.$parent.vm.addContactTab(n)},l.call=a.$parent.vm.call,l.onInit=function(){s.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),s.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.error(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.mycontacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value?e.value+="||User:=$eq["+l.currentUser.id+"]":e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window","toasty"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(a,n,i,s,t,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.openchannelInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,OpenchannelAccountId:[]},g.sectionColor="amber",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getOpenchannelAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.openchannelAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"OpenchannelAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.openchannelAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"OpenchannelAccountId",type:"multiselect",options:{route:{model:"user",action:"getOpenchannelAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("openchannel",g.query,g.user.id,g.openchannelAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("openchannelInteraction:save",O),d.on("openchannelInteraction:update",O),d.on("openchannelInteractionTags:save",C),d.on("openchannelMessage:save",w),d.on("openchannelMessage:update",w),d.on("user_has_openchannel_interactions:save",T),d.on("user_has_openchannel_interactions:remove",I),d.on("userOpenchannelAccount:save",f),d.on("userOpenchannelAccount:remove",b),0<g.setting.openchannelInteractionsReloadTimeout&&R()})},g.success=E,g.getOpenchannelInteractions=y,g.showOpenchannelInteraction=function(e,n){a.$parent.vm.addInteractionTab("openchannel",n)},g.downloadOpenchannelInteraction=function(e,s,n){r.openchannelInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="openchannel-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadOpenchannelInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"openchannel",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.composeOpenchannelInteraction=function(e,t){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.openchannelAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("openchannel",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"OPENCHANNELACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.openchannel"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.openchannel");function h(e){return{accounts:g.openchannelAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.OpenchannelAccountId);u.addAccount("openchannel",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.OpenchannelAccountId);u.removeAccount("openchannel",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.openchannelAccounts.rows,function(e){return{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.openchannelInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.openchannelInteractions=e||{count:0,rows:[]};for(var n=0;n<g.openchannelInteractions.rows.length;n+=1)S(g.openchannelInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=t.localStorage.getItem("motion2.home.openchannel:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,t.localStorage.setItem("motion2.home.openchannel:"+g.user.id,JSON.stringify(n)),g.promise=r.openchannelInteraction.get(g.query,E).$promise}function S(e){"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.openchannelInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.openchannelInteractions.rows=_.orderBy(g.openchannelInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.openchannelInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.openchannelInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.openchannelInteractionsReloadTimeout)}a.$on("$destroy",function(){d.removeAllListeners("openchannelMessage:save"),d.removeAllListeners("openchannelMessage:update"),d.removeAllListeners("openchannelInteraction:save"),d.removeAllListeners("openchannelInteractionTags:save"),d.removeAllListeners("openchannelInteraction:update"),d.removeAllListeners("user_has_openchannel_interactions:save"),d.removeAllListeners("user_has_openchannel_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e,n,t){d.license=e,d.setting=n,d.plugin=t}d.currentUser=o.getCurrentUser(),d.plugin={},d.onInit=c,d.getTrustedURL=function(){return s.trustAsResourceUrl(d.plugin.agentUrl)},c(),n.$on("pluginUpdated",function(e,n){d.plugin=n.plugin})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","$sce","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(){d.agentsQuery.offset=(d.agentsQuery.page-1)*d.agentsQuery.limit,l.update("motion2.home.presence.agents:"+d.currentUser.id,d.agentsQuery,"query"),i.user.getPresence(d.agentsQuery).$promise.then(function(e){d.agents={count:e.count,rows:_.filter(e.rows,function(e){return e.id!==d.currentUser.id})}}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function m(){d.queuesQuery.offset=(d.queuesQuery.page-1)*d.queuesQuery.limit,l.update("motion2.home.presence.queues:"+d.currentUser.id,d.queuesQuery,"query"),i.voiceQueue.get(d.queuesQuery).$promise.then(function(e){return d.voiceQueues=e||{rows:[],count:0},i.rpc.getVoiceQueuesChannels().$promise.then(function(e){e.rows.forEach(function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);n&&(n.calls||(n.calls=[]),n.calls.push(e))})})}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function u(e){return 0===d.selectedTab?e:"xcallyQueueExtension"+e}function p(e,n,t,a){var i=_.find(d.agents.rows,["id",e]);i&&(i.status=!1===n?"offline":a?"pause":"unavailable"===t?t:_.includes(["idle","unknown","ringing",null,void 0],t)?"online":"busy")}function g(e){e.id!==d.currentUser.id&&p(e.id,e.online,e.voiceStatus,e.voicePause)}d.currentUser=s.getCurrentUser(),d.agents={count:0,rows:[]},d.agentsQuery={fields:"id,name,internal,online",role:"agent",sort:"name",limit:10,page:1},d.queuesQuery={fields:"id,name",type:"inbound",sort:"name",limit:10,page:1},d.onAgentsTabSelection=function(){if(d.agentsQuery.filter||d.agentsQuery.teams||d.agentsQuery.queues)return;_.merge(d.agentsQuery,l.get("motion2.home.presence.agents:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.agentsQuery.filter,a.all([a(function(n,e){i.team.get({fields:"id,name",sort:"name",nolimit:!0}).$promise.then(function(e){d.teams=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("STAFF.TEAMS"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})}),a(function(n,e){i.voiceQueue.get({fields:"id,name",type:"inbound",sort:"name",nolimit:!0}).$promise.then(function(e){d.queues=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})})]).then(function(){d.quickFilters=[{name:"Team",key:"teams",type:"multiselect",label:"DASHBOARDS.SELECT_TEAM",options:d.teams.rows},{name:"Queue",key:"queues",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:d.queues.rows}],c()}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("DASHBOARDS.ERRORS.FAILED_INITIALIZATION")})})},d.onQueuesTabSelection=function(){if(d.queuesQuery.filter)return;_.merge(d.queuesQuery,l.get("motion2.home.presence.queues:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.queuesQuery.filter,m()},d.getAgents=c,d.getVoiceQueues=m,d.originateCall=function(e){n.$broadcast("webrtc::call",{target:u(e)})},d.transferCall=function(e){n.$broadcast("webrtc::transfer",{target:u(e)})},o.on("user:presence",function(e){if(e.id===d.currentUser.id)return;p(e.id,e.online,e.voiceStatus,e.voicePause)}),o.on("user:update",g),o.on("voice_queue_presence:save",function(e){if(!d.voiceQueues&&d.voiceQueues.rows)return;var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;n.calls||(n.calls=[]);if(_.some(n.calls,["uniqueid",e.uniqueid]))return;n.calls.push(e)}),o.on("voice_queue_presence:remove",function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;_.remove(n.calls,["uniqueid",e.uniqueid])}),e.$on("$destroy",function(){o.removeListener("user:update",g),o.removeAllListeners("user:presence"),o.removeAllListeners("voice_queue_presence:save"),o.removeAllListeners("voice_queue_presence:remove")})}e.$inject=["$scope","$rootScope","$translate","$q","api","Auth","socket","toasty","localStorageManager"],angular.module("app.dashboards").controller("AgentHomePresenceController",e)}(),function(){"use strict";function e(e,t,n,a,o,i){var s=this;function r(e){s.searchInProgress=!1,s.voiceRecordings=e||{count:0,rows:[]}}function l(){s.searchInProgress=!0,s.query.offset=(s.query.page-1)*s.query.limit;var e={query:s.query};t.localStorage.setItem("motion2.home.recordings:"+s.currentUser.id,JSON.stringify(e)),s.promise=a.voiceRecording.get(s.query,r).$promise}s.currentUser=i.getCurrentUser(),s.voiceRecordings={},s.table="voiceRecordings",s.query={UserId:s.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,transcribeStatus,UserId",sort:"-updatedAt",limit:10,page:1,type:null},s.downloadfile=function(i,e){return a.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.downloadtranscribe=function(s,e){return a.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.success=r,s.getVoiceRecordings=l,s.onInit=function(){s.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}];var e=t.localStorage.getItem("motion2.home.recordings:"+s.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(s.query=_.merge(s.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};s.query.createdAt=n}s.isSearchBarVisible=!!s.query.filter,l()}}e.$inject=["$scope","$window","$timeout","api","toasty","Auth"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n){var l=this;function d(e){l.searchInProgress=!1,l.scheduledCalls=e||{count:0,rows:[]}}l.currentUser=n.getCurrentUser(),l.priorities=["Lowest","Low","Medium","High","Highest"],l.crudPermissions={readOnly:!1,canEdit:!0,canDelete:!0},l.scheduledCalls={},l.query={id:l.currentUser.id,fields:"id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone",sort:"scheduledat",limit:10,page:1},l.queueCampaigns={rows:[],count:0},l.success=d,l.getScheduledCalls=function(){l.searchInProgress=!0,l.query.id=l.currentUser.id,l.query.includeAll=!0,l.query.offset=(l.query.page-1)*l.query.limit,l.query.fields="id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone";var e={query:l.query};t.localStorage.setItem("motion2.home.scheduled:"+l.currentUser.id,JSON.stringify(e)),l.promise=r.user.getScheduledCalls(l.query,d).$promise},l.onInit=function(){r.user.getQueues({id:n.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){l.queueCampaigns=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"scheduledat",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Campaigns",key:"VoiceQueueId",type:"multiselect",label:"MOTIONDIALER.SELECT_CAMPAIGN",options:l.queueCampaigns.rows}]}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.scheduled:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.omit(e.query,["filter"]))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.scheduledat=n}l.getScheduledCalls()})},l.isDateBeforeToday=function(e){return moment(e).isBefore(moment())},l.createOrEditQueueCampaignHopper=function(e,n){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:null,hopper:n,hoppers:l.scheduledCalls.rows,license:null,setting:null,crudPermissions:l.crudPermissions}})},l.deleteConfirm=function(n,e){var t=i.confirm().title("Are you sure want to delete the scheduled call?").htmlContent("<b>Scheduled call</b> will be deleted.").ariaLabel("delete scheduled call").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(l.scheduledCalls.rows,{id:e.id}),l.scheduledCalls.count-=1,l.scheduledCalls.rows.length||l.getScheduledCalls(),o.success({title:"Scheduled call deleted!",msg:e.name?"Scheduled call has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE_HOPPER"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETE_HOPPER",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})};var c=!0,m=1;e.$watch("vm.query.filter",function(e,n){c?a(function(){c=!1}):(n||(m=l.query.page),e!==n&&(l.query.page=1),e||(l.query.page=m),l.getScheduledCalls())})}e.$inject=["$scope","$window","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.dashboards").controller("AgentHomeScheduledCallsController",e)}(),function(){"use strict";function e(a,n,i,s,t,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.smsInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,SmsAccountId:[]},g.sectionColor="orange",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getSmsAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.smsAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"SmsAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.smsAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"SmsAccountId",type:"multiselect",options:{route:{model:"user",action:"getSmsAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("sms",g.query,g.user.id,g.smsAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("smsInteraction:save",O),d.on("smsInteraction:update",O),d.on("smsInteractionTags:save",C),d.on("smsMessage:save",w),d.on("smsMessage:update",w),d.on("user_has_sms_interactions:save",T),d.on("user_has_sms_interactions:remove",I),d.on("userSmsAccount:save",f),d.on("userSmsAccount:remove",b),0<g.setting.smsInteractionsReloadTimeout&&R()})},g.success=E,g.getSmsInteractions=y,g.showSmsInteraction=function(e,n){a.$parent.vm.addInteractionTab("sms",n)},g.downloadSmsInteraction=function(e,s,n){r.smsInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="sms-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadSmsInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"sms",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.smsAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.sms"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.sms");function h(e){return{accounts:g.smsAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.SmsAccountId);u.addAccount("sms",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.SmsAccountId);u.removeAccount("sms",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.smsAccounts.rows,function(e){return{model:"smsAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.smsInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.smsInteractions=e||{count:0,rows:[]};for(var n=0;n<g.smsInteractions.rows.length;n+=1)S(g.smsInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=t.localStorage.getItem("motion2.home.sms:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,t.localStorage.setItem("motion2.home.sms:"+g.user.id,JSON.stringify(n)),g.promise=r.smsInteraction.get(g.query,E).$promise}function S(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.smsInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.smsInteractions.rows=_.orderBy(g.smsInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.smsInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.smsInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.smsInteractions.rows,{id:e.SmsInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.smsInteractionsReloadTimeout)}a.$on("$destroy",function(){d.removeAllListeners("smsMessage:save"),d.removeAllListeners("smsMessage:update"),d.removeAllListeners("smsInteraction:save"),d.removeAllListeners("smsInteractionTags:save"),d.removeAllListeners("smsInteraction:update"),d.removeAllListeners("user_has_sms_interactions:save"),d.removeAllListeners("user_has_sms_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.voiceCalls=e||{count:0,rows:[]}}function c(){l.searchInProgress=!0,l.query.offset=(l.query.page-1)*l.query.limit;var e={query:l.query};s.localStorage.setItem("motion2.home.voice:"+l.currentUser.id,JSON.stringify(e)),l.promise=a.voiceCallReport.get(l.query,d).$promise}l.currentUser=e.getCurrentUser(),l.voiceCalls={},l.table="voiceCalls",l.query={UserId:l.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,userSecondDisposition,userThirdDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},l.success=d,l.getVoiceCalls=c,l.onInit=function(){return a.tag.get({sort:"name"}).$promise.then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}]}).catch(function(e){i.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),l.tags={count:0,rows:[]}}).finally(function(){var e=s.localStorage.getItem("motion2.home.voice:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.createdAt=n}l.isSearchBarVisible=!!l.query.filter,c()})},l.showDetails=function(e){n.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{call:e}})}}e.$inject=["$mdDialog","$document","api","toasty","Auth","$window","$scope","$timeout"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,n){this.call=n,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(a,n,i,s,t,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.whatsappInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,WhatsappAccountId:[]},g.sectionColor="lime-A700",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getWhatsappAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.whatsappAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"WhatsappAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.whatsappAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"WhatsappAccountId",type:"multiselect",options:{route:{model:"user",action:"getWhatsappAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("whatsapp",g.query,g.user.id,g.whatsappAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("whatsappInteraction:save",O),d.on("whatsappInteraction:update",O),d.on("whatsappInteractionTags:save",C),d.on("whatsappMessage:save",w),d.on("whatsappMessage:update",w),d.on("user_has_whatsapp_interactions:save",T),d.on("user_has_whatsapp_interactions:remove",I),d.on("userWhatsappAccount:save",f),d.on("userWhatsappAccount:remove",b),0<g.setting.whatsappInteractionsReloadTimeout&&R()})},g.success=E,g.getWhatsappInteractions=y,g.showWhatsappInteraction=function(e,n){a.$parent.vm.addInteractionTab("whatsapp",n)},g.downloadWhatsappInteraction=function(e,s,n){r.whatsappInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="whatsapp-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadWhatsappInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"whatsapp",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getWhatsappAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.composeWhatsappInteraction=function(e,t){i.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.whatsappAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("whatsapp",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"WHATSAPPACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.whatsapp"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.whatsapp");function h(e){return{accounts:g.whatsappAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.WhatsappAccountId);u.addAccount("whatsapp",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.WhatsappAccountId);u.removeAccount("whatsapp",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.whatsappAccounts.rows,function(e){return{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.whatsappInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.whatsappInteractions=e||{count:0,rows:[]};for(var n=0;n<g.whatsappInteractions.rows.length;n+=1)S(g.whatsappInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=t.localStorage.getItem("motion2.home.whatsapp:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,t.localStorage.setItem("motion2.home.whatsapp:"+g.user.id,JSON.stringify(n)),g.promise=r.whatsappInteraction.get(g.query,E).$promise}function S(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.whatsappInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.whatsappInteractions.rows=_.orderBy(g.whatsappInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.whatsappInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.whatsappInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.whatsappInteractions.rows,{id:e.WhatsappInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.whatsappInteractionsReloadTimeout)}a.$on("$destroy",function(){d.removeAllListeners("whatsappMessage:save"),d.removeAllListeners("whatsappMessage:update"),d.removeAllListeners("whatsappInteraction:save"),d.removeAllListeners("whatsappInteractionTags:save"),d.removeAllListeners("whatsappInteraction:update"),d.removeAllListeners("user_has_whatsapp_interactions:save"),d.removeAllListeners("user_has_whatsapp_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeWhatsappController",e)}(),function(){"use strict";function e(e,n){var t=this;t.setting={},t.messages={count:0,rows:[]},t.showInteraction=!1,t.init=function(e,n){t.setting=n,t.tab=e,t.tab.saved=!0},t.getTrustedURL=function(){return n.trustAsResourceUrl(t.tab.src)}}e.$inject=["$scope","$sce"],angular.module("app.dashboards").controller("AgentGeneralIframeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this,f=16,b=1024*f*1024;function A(){var e=h.user.voicePause||h.user.chatPause||h.user.mailPause||h.user.openchannelPause||h.user.faxPause,n=!h.tab.interaction.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(t.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(){h.user&&h.interaction.Account.mandatoryDisposition&&!e&&l.user.unpause({id:h.user.id}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},locals:{user:h.user,channel:h.tab.channel,interaction:h.tab.interaction}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)})}function E(e,n){h.tab.message=n,i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:h.tab.message,type:e,interaction:h.interaction},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){if(e)if(e.message&&e.message.savedAsDraft)h.draft?p.update({id:h.draft.id,channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}):p.add({channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}),h.draft=p.getByInteraction(h.tab.interaction.id);else{var n=e;n&&S(n),n.Interaction&&h.interaction&&h.interaction.id&&(n.Interaction.id=h.interaction.id,l.mailInteraction.update(n.Interaction).$promise.then(function(e){e&&e.closed?(h.tab.saved=!0,h.interaction.closed=!0,A()):null!==n.Interaction.substatus&&(h.tab.saved=!0,h.tab.interaction.substatus=n.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(h.tab))}).catch(function(e){d.error(e.data?e.data.message:e.toString())}))}}).finally(function(){h.tab.isDraft=!1})}function y(){"mail"!==h.tab.channel&&n(function(){var e=angular.element(t.find("md-content[name*='interaction-content-"+h.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function S(i){if(i)return i["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]=h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"],i[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,i.UserId=h.user.id,i.ContactId=h.interaction.ContactId,i.direction="out",i.secret=Boolean(h.tab.spy||i.secret),l[h.tab.channel+"Message"].save(i).$promise.then(function(e){if(e&&e.id&&!_.isEmpty(i.attachments)){for(var n=[],t=0;t<i.attachments.length;t++){var a=i.attachments[t];a.MailMessageId?n.push(l.attachment.clone({id:a.id},{name:a.name,basename:a.basename,type:a.type,MailMessageId:e.id}).$promise):n.push(l.attachment.update({id:a.id},{MailMessageId:e.id}).$promise)}return s.all(n)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){"mail"===h.tab.channel&&i.isDraft&&(p.removeByInteraction(h.interaction.id),h.draft=null),h.tab.areaText="",y()})}function T(e){switch(h.tab.channel){case"mail":h.draft.content.originalMessage=e?_.find(h.interaction.Messages,["id",e]):_.findLast(h.interaction.Messages,["secret",!1]),E(h.draft.type,h.draft.content)}}function I(e){h.journeyIsLoading=!0;var n=_.merge(h.journeyOptions,{id:h.contact.id,offset:e||0});return g.get(h.journey,n).then(function(e){h.journey=e.journey,h.canLoadMoreJourney=e.loadMore}).finally(function(){h.journeyIsLoading=!1})}h.showFooter=!1,h.BTNLoadMore=0,h.showInteraction=!1,h.user=c.getCurrentUser(),h.detectBrowser=u.detectBrowser(),h.journey=[],h.acceptedMessages=[],h.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:b,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},h.ngFlow={flow:{}},h.selectedMailShowDetails={},h.selectedMailShowSystemMessage={},h.setting={},h.ctrlMethods={},h.embedOptions={fontSmiley:!0,sanitizeHtml:!0,emoji:!0,link:!0,linkTarget:"_blank"},h.journeyOptions=g.getQuery(),h.quickFilters=g.getQuickFilters(),h.init=function(e,n){h.tab=e,h.tab.saved=!0,h.tab.badges=0,h.setting=n||{},h.tab&&h.tab.channel&&h.tab.interaction&&(h.interaction=h.tab.interaction,l[h.tab.channel+"Interaction"].get({id:h.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(h.interaction=e,h.tab.interaction=e),h.tab.saved=h.interaction.closed,h.queryMessage={id:h.interaction.id,includeAll:!0},"mail"===h.tab.channel?(h.queryMessage.sort="-id",h.queryMessage.offset=0,h.queryMessage.limit=3,h.queryMessage.inlineCss=!0):(h.queryMessage.sort="id",h.queryMessage.nolimit=!0),l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise}).then(function(e){return e&&(h.BTNLoadMore=e.count-h.queryMessage.limit),h.messages=e||{count:0,rows:[]},l["chat"===h.tab.channel?"chatWebsite":h.tab.channel+"Account"].get({id:h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]}).$promise}).then(function(e){if(h.account=e,h.tab.title=h.account.key||h.account.name,h.interaction.ContactId)return l.cmContact.get({id:h.interaction.ContactId}).$promise}).then(function(e){return e&&(h.contact=e),h.showInteraction=!0,h.contact?h.tab.title+=" - "+(h.user.privacyEnabled?v.mask(h.contact.firstName):h.contact.firstName):h.tab.title+=" - "+r.instant(h.tab.channel.toUpperCase()+".UNKNOWN"),l.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){h.users=e||{count:0,rows:[]},h.usersMap=_.mapValues(_.keyBy(h.users.rows,"id"),"fullname")}).then(function(){if(h.tab.channel&&h.interaction)return l.user["add"+_.upperFirst(h.tab.channel)+"Interactions"]({id:h.user.id,ids:[h.interaction.id]})}).then(function(){return l.mailSubstatus.get({sort:"name",nolimit:!0}).$promise}).then(function(e){h.subStatuses=e||{count:0,rows:[]}}).catch(function(){h.showInteraction=!0}).finally(function(){h.contact&&I(),function(){switch(h.user.role){case"admin":return h.downloadPermissions={attachments:!0,interactions:!0};case"agent":return h.downloadPermissions={attachments:h.user.downloadAttachments,interactions:h.user.downloadOmnichannelInteractions};case"user":l.userProfile.get({id:h.user.userProfileId,fields:"downloadAttachments,downloadOmnichannelInteractions"}).$promise.then(function(e){h.downloadPermissions={attachments:e.downloadAttachments,interactions:e.downloadOmnichannelInteractions}}).catch(function(){h.downloadPermissions={attachments:!1,interactions:!1}})}}(),function(){if(!h.tab.spy&&!h.interaction.closed){var t=[],a=_.some(h.messages.rows,["read",!0]);if(h.messages.rows.forEach(function(e){if("in"===e.direction&&!e.read){var n=0===t.length&&!a;t.push(l[h.tab.channel+"Message"].accept({id:e.id,UserId:h.user.id,manual:n}).$promise),h.acceptedMessages.push(e.id)}}),"mail"===h.tab.channel){var e=_(h.interaction.Messages).filter({read:!1,direction:"in"}).differenceBy(h.messages.rows,"id").value();e.forEach(function(e){t.push(l.mailMessage.accept({id:e.id,UserId:h.user.id}).$promise),h.acceptedMessages.push(e.id)})}s.all(t)}}(),y(),m.on(h.tab.channel+"Message:save",h.onMessageSave),m.on(h.tab.channel+"Message:update",h.onMessageSave),m.on(h.tab.channel+"Interaction:save",h.onInteractionSave),m.on(h.tab.channel+"Interaction:update",h.onInteractionSave),m.on("user_has_"+h.tab.channel+"_interactions:save",h.onInteractionOpen),m.on("user_has_"+h.tab.channel+"_interactions:remove",h.onInteractionClose),h.tab.areaText=h.tab.areaText?h.tab.areaText:"",h.showFooter=!0,"mail"===h.tab.channel&&(h.draft=p.getByInteraction(h.tab.interaction.id),h.tab.isDraft&&(h.tab.interaction.closed?(p.removeByInteraction(h.tab.interaction.id),h.draft=null):T()))}))},h.getLabelByMessage=function(e){var n="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":n:e.UserId?h.usersMap?h.usersMap[e.UserId]:n:"System"},h.openContact=function(e,n){try{h.tab&&!h.tab.spy&&a.$parent.$parent.$parent.vm.addContactTab(n||h.contact)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Unable to open the contact"})}},h.openInteraction=function(e){try{if(e.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",e);if(e.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",e);if(e.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",e);if(e.WhatsappAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("whatsapp",e);if(e.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",e);if(e.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",e)}catch(e){d.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},h.disposeInteraction=A,h.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,skipHide:Boolean(h.tab.spy),resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0,fields:"id,name,color"})}]},locals:{channel:h.tab.channel,interaction:h.tab.interaction}})},h.composeMailInteraction=function(n,e){if(e.inReplyTo){var t=_.find(h.messages.rows,{messageId:e.inReplyTo});if(!t)return l.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){E(n,e&&e.count?e.rows[0]:void 0)}).catch(function(e){d.error(e.data?e.data.message:e.toString()),E(n,void 0)});E(n,t)}else E(n,e)},h.composeFaxInteraction=function(e){var n={to:[]};n.to.push(h.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:h.account.id},e).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},h.composeSmsInteraction=function(e,n){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeWhatsappInteraction=function(e,n){i.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeChatInteraction=function(e,n){i.show({controller:"ComposeChatInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeOpenchannelInteraction=function(e,n){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.transferLastMessage=function(){if(h.interaction){var e=_.findLast(h.messages.rows,function(e){return"in"===e.direction});e?i.show({controller:"TransferMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,interaction:h.interaction,message:e,channel:h.tab.channel},resolve:{agents:["apiResolver",function(e){var n={fields:"id,name",$id:{ne:h.user.id},role:"agent",online:!0,sort:"name",nolimit:!0};return n[h.tab.channel+"Pause"]=!1,e.resolve("user@get",n)}],queues:["apiResolver",function(e){return e.resolve(h.tab.channel+"Queue@get",{fields:"id,name",sort:"name",nolimit:!0})}]}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)}):d.error({title:"Invalid transfer",msg:"Message not found!"})}},h.downloadMessage=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Message"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=h.tab.channel+"-message"+s.id+".eml";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.downloadMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.downloadInteraction=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Interaction"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t=h.tab.channel+"-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.inteactionMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.openDraft=T,h.createVidaooSession=function(e){var n={id:e.id,account:e.Account,contact:e.Contact};return l.chatInteraction.createVidaooSession(n).$promise.then(function(){d.success({title:"Start Video Call",msg:"Session properly created."})}).catch(function(){d.error({title:"Start Video Call",msg:"Unable to create session!"})})},h.reply=function(e,n){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===n.trim())return;S(function(e){var n={},t="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";n[t]=h.interaction[t].toString(),n[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,("sms"===h.tab.channel||"whatsapp"===h.tab.channel)&&(n.phone=h.interaction.phone);e&&(n.UserId=h.user.id,n.ContactId=h.interaction.ContactId,n.body=e);return n}(n.trim()))},h.upload=function(){h.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},h.ngFlow.flow.upload()},h.fileAdded=function(e){if(e.size>b)return d.error({title:"File too big",msg:"The max allowed size is "+f+"MB"}),!1;return!0},h.fileSuccess=function(e,n){var t=JSON.parse(n),a=t.name;"chat"===h.tab.channel&&(a='<a href="'+(h.account.remote?h.account.remote:o.protocol()+"://"+o.host())+"/api/chat/interactions/"+h.interaction.id+"/attachment_download?attachId="+t.id+"&token="+h.account.token+'" target="_self">'+t.name+"</a>");S({body:a,AttachmentId:t.id})},h.onMessageSave=function(e){if(e&&h.interaction.id!=e[_.capitalize(h.tab.channel)+"InteractionId"])return;var n=!1;h.messages?n=_.find(h.messages.rows,{id:e.id}):h.messages={rows:[],count:0};n?_.merge(n,e):("mail"===h.tab.channel?h.messages.rows.unshift(e):h.messages.rows.push(e),y())},h.onInteractionSave=function(e){if(e&&h.interaction.id!==e.id)return;e.closed&&h.interaction.UserId!==h.user.id&&(h.tab.saved=!0);_.merge(h.interaction,e)},h.searchTextChange=function(n){var t=s.defer(),a=[],e={},i="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";return e.filter=n,e[i]=h.account.id,l.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},h.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:h.user,account:h.account,interaction:h.interaction,contact:h.interaction&&h.interaction.Contact?h.interaction.Contact:{}};""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=e(t),h.ctrlMethods.setText(h.tab.areaText)}catch(e){""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=n.value,h.ctrlMethods.setText(h.tab.areaText)}h.selectedItem=null,h.changeDisplayCannedAnswerInputValue()}},h.getMessagesAlignment=function(e){if(e.secret&&h.user.id!=e.UserId)return"in";switch(h.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}},h.displayCannedAnswerInput=!1,h.changeDisplayCannedAnswerInputValue=function(){h.displayCannedAnswerInput=!h.displayCannedAnswerInput},h.setAs=function(e){h.tab.channel&&h.interaction&&h.interaction.id&&l[h.tab.channel+"Interaction"].update({id:h.interaction.id,substatus:e}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},h.markAsUnread=function(){if(h.tab.channel&&h.interaction&&h.interaction.id)if(h.acceptedMessages.length)for(var e=0;e<h.acceptedMessages.length;e+=1)l[h.tab.channel+"Message"].update({id:h.acceptedMessages[e],read:!1,UserId:null});else for(var n=0;n<h.messages.rows.length;n+=1)if("in"===h.messages.rows[n].direction){h.messages.rows[n].UserId===h.user.id?l[h.tab.channel+"Message"].update({id:h.messages.rows[n].id,read:!1,UserId:null}):d.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}h.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(h.tab)},h.getAttachments=function(n){return l.attachment.get({MailMessageId:n.id}).$promise.then(function(e){e&&e.rows&&(n.attachments=e.rows)}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.getAttachment=function(i){return l.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},h.onInteractionOpen=function(e){var n;h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&(h.interaction.Users&&(n=_.find(h.interaction.Users,{id:e.UserId})),n||h.interaction.Users.push({id:e.UserId}))},h.onInteractionClose=function(e){h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&h.interaction.Users&&_.remove(h.interaction.Users,{id:e.UserId})},h.getCustomerJourney=I,h.loadNextPage=function(){var t=s.defer();if(h.queryMessage)return h.queryMessage.offset=h.messages.rows.length,l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise.then(function(e){for(var n=0;n<e.rows.length;n+=1)h.messages.rows.push(e.rows[n]),h.interaction.closed||"in"!==e.rows[n].direction||e.rows[n].read||(l[h.tab.channel+"Message"].accept({id:e.rows[n].id,UserId:h.user.id}),h.acceptedMessages.push(e.rows[n].id));return 0<e.rows.length&&(h.BTNLoadMore=h.BTNLoadMore-e.rows.length),t.resolve(e)}).catch(function(e){return t.reject(e)});return t.reject()},h.interactionTimelineOptions={scrollEl:"#interaction-content"},h.loadMoreJourney=function(){return s(function(e){var n=h.journey.length;return e(I(n))})},h.journeyTimelineOptions={scrollEl:"#journey-content"},a.$on("$destroy",function(){m.removeAllListeners(h.tab.channel+"Message:save"),m.removeAllListeners(h.tab.channel+"Message:update"),m.removeAllListeners(h.tab.channel+"Interaction:save"),m.removeAllListeners(h.tab.channel+"Interaction:update"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:save"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:remove")})}function n(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(t){t.updateView=function(){var e,n=_.replace(t.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');t.trustedHtml=a.trustAsHtml(n)},t.$watch("ngBindHtmlUnsafe",function(e){t.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$location","$translate","api","toasty","Auth","socket","msUtils","draftManager","customerJourneyManager","privacyManager"],n.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",n).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,ChatAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeChatInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=25,u=1024*m*1024;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.message={from:i.localstationid,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,attachments:[]},c.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:u,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(s.draft=void 0,t.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,c.message.attachments.push(n)}catch(e){console.error(e)}},c.fileAdded=function(e){var n=["pdf","tif"];if(!_.includes(n,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extensions: "+n.join()}),!1;if(e.size>u)return l.error({title:"File too big",msg:"The max allowed size is "+m+"MB"}),!1;return!0},c.getContact=function(e){var n="";e.firstName&&e.firstName!==e.fax&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(n+=e.lastName+" ");return n+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var n=e;if(_.isObject(e))return e.fax;if(t=n,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(t))return n;var t;return l.error("Fax "+n+" is not valid"),null},c.closeDialog=function(){s.draft=c.message,t.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(n,e,i,t,a,s,o,r,l,d,c,m,u,p){var g=this,v=25,h=1024*v*1024;g.currentUser=m.getCurrentUser(),g.secret="note"===r,g.hiddenCC=!0,g.hiddenBCC=!0,g.verifySmtp=!0,g.errors=[],g.separatorKeys=[t.KEY_CODE.ENTER,t.KEY_CODE.COMMA,t.KEY_CODE.TAB],g.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,MailAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},g.selectedItemChange=function(n){if(n&&n.value&&g.ckEditorInstance)try{var e=_.template(n.value),t={user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}},a=e(t),i=a.replace(/(?:\r\n|\r|\n)/g,"<br />");g.ckEditorInstance.insertHtml(i)}catch(e){console.error(e),g.ckEditorInstance.insertHtml(n.value)}document.getElementById("html-area").focus(),g.selectedItem=null},g.onReadyEditor=function(e){try{g.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,g.fromTemplate=_.template("{{ name }} <{{ email }}>"),g.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),g.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),g.message={from:g.fromTemplate({name:s.name,email:s.email||s.Smtp.user}),to:[],cc:[],bcc:[],body:S(),type:r,attachments:[],showLastMessage:!0},g.draft=null,g.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:g.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,enterMode:CKEDITOR.ENTER_BR,font_defaultLabel:s.fontFamily?s.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:s.fontSize||"12",removePlugins:"magicline"};for(var f=[],b=8;b<=72;b++)f.push(b+"/"+b+"pt");g.ckeditor.fontSize_sizes=f.join(";"),g.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:h,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},g.ngFlow={flow:{}},g.reply=function(e){angular.isDefined(o)&&(g.message.type="reply",g.message.to="in"===o.direction?o.from.split(","):o.to.split(","),g.message.subject=_.startsWith(o.subject,"Re:")?o.subject:"Re: "+o.subject,g.message.inReplyTo=o.messageId,g.message.body=S(),g.message.attachments=[],e&&o.cc&&(g.hiddenCC=!1,g.message.cc=o.cc.split(",")),g.message.showLastMessage=!1)},g.newMail=function(){angular.isDefined(o)&&(g.message.type="new",g.message.to=o.to?o.to.split(","):[])},g.forward=function(){if(angular.isDefined(o)){if(g.message.type="forward",g.message.subject=_.startsWith(o.subject,"Fwd:")?o.subject:"Fwd: "+o.subject,g.message.body=S(),o.Attachments&&o.Attachments.length)for(var e=0;e<o.Attachments.length;e++)g.message.attachments.push(o.Attachments[e]);g.message.showLastMessage=!1}},g.editDraft=function(){g.isDraft=!0,angular.isDefined(o)&&(o.savedAsDraft=!1,g.message=angular.copy(o),_.isEmpty(g.message.cc)||(g.hiddenCC=!1),_.isEmpty(g.message.bcc)||(g.hiddenBCC=!1))},g.send=function(e,n,t){if(!A&&g.message.to&&(g.message.body||o.from))if(g.message.to.length)if(_.isEmpty(g.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){E(n,t)})}else E(n,t);else d.error("To is mandatory");A=!1},g.note=function(){g.type="note",g.secret=!0,g.message.body='<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt"><p></p></div>'},g.addNote=function(){g.message.body&&i.hide({secret:!0,body:g.message.body,attach:g.message.attachments.length,attachments:g.message.attachments})},g.upload=function(e){g.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+n.get("motion.token")},g.ngFlow.flow.upload()},g.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,g.message.attachments.push(n)}catch(e){console.error(e)}},g.removeAttachment=function(e){g.message.attachments=_.reject(g.message.attachments,{id:e.id}),e.MailMessageId||l.attachment.delete({id:e.id}).$promise.catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.attachment.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.fileAdded=function(e){if(e.size>h)return d.error({title:"File too big",msg:"The max allowed size is "+v+"MB"}),!1;return!0},g.getContact=function(e){var n="";e.firstName&&e.firstName!==e.email&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(n+=e.lastName+" ");return n+="<"+e.email+">"},g.contactSearch=function(e){return s&&s.ListId?l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},g.transformContact=function(e,n){if(_.isObject(e))return(g.contact=e).email;if(_.isString(e)){if(y(e))return g.contact={email:e},e;for(var t=e.split(","),a=0;a<t.length;a+=1)y(t[a])?_.isArray(n)&&_.indexOf(n,t[a])<0&&n.push(t[a]):d.error("Email "+t[a]+" is not valid");return g.contact={email:e.split(",")[0]},null}return d.error("Email field is not valid"),null},g.saveDraft=function(){g.message.savedAsDraft=!0,g.draft=p.getByInteraction(u.id);var e={account:s,message:g.message,contact:g.contact,interaction:u};if(g.draft&&!g.isDraft){var n=i.confirm({skipHide:!0}).title(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_TITLE")).content(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_MESSAGE")).ariaLabel("Save draft").ok(a.instant("DASHBOARDS.OVERWRITE")).cancel(a.instant("DASHBOARDS.CANCEL"));i.show(n).then(function(){i.hide(e)})}else i.hide(e)},g.closeDialog=function(){i.cancel()},g.loadLastMessage=function(){g.message.body+=T(g.message.type)};var A=!(g.keyPress=function(e){13===e.keyCode&&(A=!0)});switch(r){case"reply":g.reply(!1);break;case"replyAll":g.reply(!0);break;case"forward":g.forward();break;case"draft":g.editDraft();break;case"new":g.newMail();break;case"note":g.note()}function E(e,n){var t={from:g.message.from,to:g.message.to.join(","),cc:g.message.cc.join(","),bcc:g.message.bcc.join(","),subject:g.message.subject,body:g.message.showLastMessage?g.message.body:g.message.body+T(g.message.type),inReplyTo:g.message.inReplyTo,attach:g.message.attachments.length,attachments:g.message.attachments,Interaction:{lastMsgDirection:"out",substatus:n},isDraft:g.isDraft};t.html='<div id="xm-mail-content">'+_.replace(t.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(t.Interaction.closed=!0),i.hide(t)}function y(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function S(){return'<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt">'+function(){if(_.isNil(s.template))return"";try{return _.template(s.template)({user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function T(e){var n='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":n+=g.replyTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||""});break;case"forward":n+=g.forwardTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||"",to:_.escape(o.to)||"",subject:_.escape(o.subject)||""})}var t,a,i=g.message.showLastMessage&&o.originalMessage||g.isDraft?o.originalMessage.body:o.body;return n+="<br><br>",n+=(t=i?_.replace(i,'<div id="xm-mail-content"',"<div"):"",(a=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?a[1]:t),n+="</blockquote></div>",e?n:""}l.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){g.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),g.secret||l.mailAccount.verifySmtp({id:s.id}).$promise.catch(function(e){g.verifySmtp=!1,g.errors.push({message:e.data,type:e.status}),g.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","$translate","account","message","type","api","toasty","$q","Auth","interaction","draftManager"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,OpenchannelAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=""===p.message.body.trim()?e(t):" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=""===p.message.body.trim()?n.value:" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e[s.mapKey]&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e[s.mapKey]&&(n+=e.lastName+" ");return n+="<"+e[s.mapKey]+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId){var n="firstName,lastName,phone,mobile";return s.mapKey&&(n+=","+s.mapKey),l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:n}).$promise.then(function(e){return e.rows})}return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e[s.mapKey];return n},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeOpenchannelInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,SmsAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=""===p.message.body.trim()?e(t):" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=""===p.message.body.trim()?n.value:" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,WhatsappAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=""===p.message.body.trim()?e(t):" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=""===p.message.body.trim()?n.value:" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeWhatsappInteractionDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.errors=[],r.dispositions=[],r.interaction=angular.copy(e),r.interaction.disposition||(r.interaction.disposition=null),r.channel=i,r.apiRoute=r.channel+"Interaction",r.apiAccountRoute=r.channel+("chat"===r.channel?"Website":"Account"),r.accountProperty=_.capitalize(r.channel)+("chat"===r.channel?"Website":"Account")+"Id",r.firstLevelDisposition=null,r.mandatoryDisposition=!1,r.mandatoryDispositionPause="",r.wasUserInPause=s.voicePause||s.chatPause||s.mailPause||s.openchannelPause||s.faxPause,r.onInit=function(){var n=[],t={fields:"id,name,level,ParentId",sort:"name",nolimit:!0};t[r.accountProperty]=e[r.accountProperty],a[r.apiAccountRoute].get({id:e[r.accountProperty]}).$promise.then(function(e){return r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name),a.disposition.get(t).$promise}).then(function(e){return e.rows.length&&(n=_.concat(n,e.rows)),a.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise}).then(function(e){e.rows.length&&(n=_.concat(n,e.rows))}).catch(function(e){console.error(e)}).finally(function(){r.dispositions=_.orderBy(n,["name"],["asc"]),r.mandatoryDisposition&&!r.wasUserInPause&&a.user.pause({id:s.id,type:r.mandatoryDispositionPause||"DEFAULT PAUSE"}).$promise.then(function(e){}).catch(function(e){console.error(e)})})},r.onDispositionChange=function(e){"first"===e?(r.anySecondLevelDisposition=!!r.firstLevelDisposition&&_.some(r.dispositions,["ParentId",r.firstLevelDisposition.id]),r.firstLevelDisposition||(r.secondLevelDisposition=void 0)):"second"===e&&(r.anyThirdLevelDisposition=_.some(r.dispositions,["ParentId",r.secondLevelDisposition.id]))},r.clearDispositionSelection=function(e){"second"===e?(r.secondLevelDisposition=void 0,r.thirdLevelDisposition=void 0):"third"===e&&(r.thirdLevelDisposition=void 0)},r.saveDisposition=function(){r.errors=[],r.interaction.UserId=s.id,r.interaction.closed=!0,r.interaction.closeReason="agent",r.interaction.disposition=r.firstLevelDisposition?r.firstLevelDisposition.name:null,r.interaction.secondDisposition=r.secondLevelDisposition?r.secondLevelDisposition.name:void 0,r.interaction.thirdDisposition=r.thirdLevelDisposition?r.thirdLevelDisposition.name:void 0,a[r.apiRoute]?a[r.apiRoute].update(_.pick(r.interaction,["MailAccountId","FaxAccountId","SmsAccountId","WhatsappAccountId","ChatWebsiteId","OpenchannelAccountId","closed","closeReason","disposition","secondDisposition","thirdDisposition","id","note","UserId"])).$promise.then(function(e){r.interaction=e,"mail"===r.channel&&o.removeByInteraction(r.interaction.id),t.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"})}).then(function(){l(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):l(!1)},r.closeDialog=l}e.$inject=["$mdDialog","toasty","api","interaction","channel","user","draftManager"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s){var o=this;function r(e){n.hide(e)}o.errors=[],o.tags=s,o.interaction=angular.copy(a),o.interaction.Tags=_.map(o.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),o.channel=i,o.autocompleteRequireMatch=!0,o.saveTag=function(){{if(o.errors=[],e[o.apiRoute])return e[o.apiRoute].addTags({id:o.interaction.id,ids:_.map(o.interaction.Tags,"id")}).$promise.then(function(){t.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=o.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},o.closeDialog=r,o.apiRoute=o.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l,d){var c=this;function m(e){n.hide(e)}c.channel=s.toLowerCase(),c.message=o,c.account=r,c.agents=l,c.queues=d,c.transfer={id:0,type:c.account.queueTransfer?"queue":"agent"},c.onTransfer=function(){m(!0),e(function(){var e="agent"===c.transfer.type?"agentNotify":c.channel+"QueueNotify";return a.rpc[e]({id:c.transfer.id,messageId:c.message.id,channel:c.channel}).$promise.then(function(){i.success({title:t.instant("DASHBOARDS.INFO"),msg:"queue"===c.transfer.type?t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_QUEUE_EXECUTED"):t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_AGENT_EXECUTED")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.rpc.notify"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.rpc.notify",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},5e3)},c.closeDialog=m}e.$inject=["$mdDialog","$timeout","$translate","api","toasty","channel","message","account","agents","queues"],angular.module("app.dashboards").controller("TransferMessageDialogController",e)}(),function(){"use strict";function e(i,m,s,e,u,o,r,t,n,a,l){var p=this;function d(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){o.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function c(t,e){var n,a,l=[],d=[],c=r.getCurrentUser();(n=c,a=m.defer(),p.project.sendUnpauseOnSubmit?u.user.unpause({id:n.id}).$promise.then(function(e){a.resolve()}).catch(function(e){console.log("err"),a.resolve()}):a.resolve(),a.promise).then(function(){return u.jscriptySessionReport.save({starttime:p.starttime,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,VoiceQueueId:p.call&&p.call["xmd-voicequeueid"]?p.call["xmd-voicequeueid"]:void 0,ProjectId:p.project&&p.project.id?p.project.id:void 0,projectname:p.project&&p.project.name?p.project.name:void 0,ContactId:p.contact&&p.contact.id?p.contact.id:void 0,completed:e}).$promise}).then(function(e){if(e)for(var n=p.getResponseSheetHeaders(),t=p.getResponseSheetRow(),a=p.getQuestionWithResponseList(),i=0;i<n.length;i+=1)if(!_.isEmpty(String(t[i]))){try{l.push(u.jscriptyQuestionReport.save({question:n[i],answer:"date"===a[i].type?moment(String(t[i])).format("YYYY-MM-DD"):"time"===a[i].type?moment(String(t[i])).format("HH:mm"):String(t[i]),questionId:a[i].id,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert question",e)}for(var s=String(t[i]).split(";"),o=0;o<s.length;o+=1){var r=s[o].trim();try{d.push(u.jscriptyAnswerReport.save({question:n[i],questionId:a[i].id,answer:"date"===a[i].type?moment(r).format("YYYY-MM-DD"):"time"===a[i].type?moment(r).format("HH:mm"):r,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert answer",e)}}}return m.all(l).then(function(){return m.all(d).then(function(){return e})})}).then(function(e){e?t.resolve(!0):t.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});t.reject()})}p.formViewer={},p.showResetButton=!0,p.showIncompleteSubmitButton=!1,p.detectBrowser=l.detectBrowser(),p.onSubmit=function(e,n){var t=m.defer();if(n){var a=s.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");s.show(a).then(function(){c(t,!1)},function(){t.resolve()})}else c(t,!0);return t.promise.then(function(e){e&&(o.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){o.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(p.tab))}).catch(function(e){o.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},p.openContact=function(e,n){try{i.$parent.$parent.$parent.vm.addContactTab(n)}catch(e){o.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},p.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},p.getResponseSheet=function(){return e.getResponseSheet(p.project.formData,p.project.responseData,!1)},p.getResponseSheetRow=function(){return e.getResponseSheetRow(p.project.formData,p.project.responseData)},p.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(p.project.formData,!1)},p.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(p.project.formData,p.project.responseData)},p.init=function(e){p.tab=e,p.tab&&(p.call=p.tab.call,p.starttime=p.tab.openedAt,p.contact=p.tab.contact,p.project=p.tab.project,p.project&&(_.isObjectLike(p.project.formData)?p.project.formData=p.project.formData:p.isJsonString(p.project.formData)?p.project.formData=JSON.parse(p.project.formData):p.project.formData=void 0,p.project.responseData=p.project.responseData||{},void 0!==p.project.currentPage&&a(function(){n.$broadcast("mwForm.pageEvents.changePage",{page:p.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&(p.project.currentPage=n.currentPage.number-1,d(),p.project.enableUncompleteSave&&(1<=n.currentPage.number&&n.currentPage.number<p.project.formData.pages.length?p.showIncompleteSubmitButton=!0:p.showIncompleteSubmitButton=!1),p.project.formData&&p.project.formData.pages))for(var t=0,a=p.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&p.project.formData.pages[t].elements)for(var i=0,s=p.project.formData.pages[t].elements.length;i<s;i++)"question"===p.project.formData.pages[t].elements[i].type&&p.project.formData.pages[t].elements[i].question&&delete p.project.responseData[p.project.formData.pages[t].elements[i].question.id]})))},p.resetViewer=function(e){if(p.formViewer.reset){var n=s.confirm().title(t.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(t.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(t.instant("JSCRIPTY.YES")).cancel(t.instant("JSCRIPTY.NO"));s.show(n).then(function(){p.showIncompleteSubmitButton=!1,p.project.currentPage=void 0,d(),p.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(t,a,e,n,i){var s=this;function o(){return function(e){if(404===e.status)a.info({title:t.instant("DASHBOARDS.ATTENTION"),msg:t.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}s.notification=e,s.user=i.getCurrentUser(),s.accept=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].accept({id:s.notification.id,UserId:s.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(o());a.error({title:"API:ERROR",msg:"API accept message not found: "+s.notification.channel+"Message"})}},s.reject=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].reject({id:s.notification.id,UserId:s.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(o());a.error({title:"API:ERROR",msg:"API reject message not found: "+s.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var n=this;n.init=function(e){n.tab=e,n.tab&&(n.tab.saved=!0,n.html=n.tab.html)}})}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&"abandoned"===e.disposition?(i.inbound.abandoned+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&!e.UserId&&e.disposition?(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.chatWebsites,{id:_.toNumber(e.ChatWebsiteId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.chatWebsites=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("chatInteraction:save",i.onSaveChatInteraction),n.on("chatInteraction:update",i.onUpdateChatInteraction),function(){if(0<Object.keys(i.chatWebsites).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("chatInteraction:save"),n.removeAllListeners("chatInteraction:update")})}e.$inject=["$scope","socket","chatInteractions","chatWebsites"],angular.module("app.dashboards").controller("UserChatDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){var l=this;function d(){s({queues:l.outboundQueues,rpcQueues:l.rpcQueues}).then(function(e){l.inbound=e})}function c(){o({rpcCampaigns:l.rpcCampaigns}).then(function(e){l.ivr=e})}l.outboundQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.rpcCampaigns=r?_.keyBy(r.rows?r.rows:[],"id"):{},l.ivr={originated:0,limitCalls:0},l.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},l.onSaveQueue=function(e){l.outboundQueues[e.id]&&l.rpcQueues[e.id]&&(l.rpcQueues[e.id]=e)},l.onSaveCampaign=function(e){l.rpcCampaigns[e.id]&&(l.rpcCampaigns[e.id]=e)},t.onWithoutApply("voice_queue:save",l.onSaveQueue),l.interval=n(function(){d(),c()},999),t.onWithoutApply("campaign:save",l.onSaveCampaign),d(),c(),e.$on("$destroy",function(){t.removeListener("voice_queue:save",l.onSaveQueue),t.removeAllListeners("campaign:save"),l.interval&&n.cancel(l.interval)})}e.$inject=["$scope","$interval","socket","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.faxAccounts,{id:_.toNumber(e.FaxAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.faxAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("faxInteraction:save",i.onSaveFaxInteraction),n.on("faxInteraction:update",i.onUpdateFaxInteraction),function(){if(0<Object.keys(i.faxAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("faxInteraction:save"),n.removeAllListeners("faxInteraction:update")})}e.$inject=["$scope","socket","faxInteractions","faxAccounts"],angular.module("app.dashboards").controller("UserFaxDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.mailAccounts,{id:_.toNumber(e.MailAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.mailAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("mailInteraction:save",i.onSaveMailInteraction),n.on("mailInteraction:update",i.onUpdateMailInteraction),function(){if(0<Object.keys(i.mailAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("mailInteraction:save"),n.removeAllListeners("mailInteraction:update")})}e.$inject=["$scope","socket","mailInteractions","mailAccounts"],angular.module("app.dashboards").controller("UserMailDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.openchannelAccounts,{id:_.toNumber(e.OpenchannelAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.openchannelAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("openchannelInteraction:save",i.onSaveOpenchannelInteraction),n.on("openchannelInteraction:update",i.onUpdateOpenchannelInteraction),function(){if(0<Object.keys(i.openchannelAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("openchannelInteraction:save"),n.removeAllListeners("openchannelInteraction:update")})}e.$inject=["$scope","socket","openchannelInteractions","openchannelAccounts"],angular.module("app.dashboards").controller("UserOpenchannelDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.smsAccounts,{id:_.toNumber(e.SmsAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.smsAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("smsInteraction:save",i.onSaveSmsInteraction),n.on("smsInteraction:update",i.onUpdateSmsInteraction),function(){if(0<Object.keys(i.smsAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("smsInteraction:save"),n.removeAllListeners("smsInteraction:update")})}e.$inject=["$scope","socket","smsInteractions","smsAccounts"],angular.module("app.dashboards").controller("UserSmsDashboardGeneralController",e)}(),function(){"use strict";function e(t){var i=[],s=function(){var t=i[0],a={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(t.queues,function(e,n){t.rpcQueues[n]&&(a.waiting+=t.rpcQueues[n].waiting||0,a.talking+=(t.rpcQueues[n].talking||0)+(t.rpcQueues[n].pTalking||0),a.answered+=t.rpcQueues[n].answered||0,a.abandoned+=t.rpcQueues[n].abandoned||0,a.sumHoldTime+=t.rpcQueues[n].sumHoldTime||0,a.sumBillable+=t.rpcQueues[n].sumBillable||0,a.total+=t.rpcQueues[n].total||0,a.originated+=t.rpcQueues[n].originated||0,a.outboundDropCallsDayCallersExit+=t.rpcQueues[n].outboundDropCallsDayCallersExit||0,a.outboundDropCallsDayTimeout+=t.rpcQueues[n].outboundDropCallsDayTimeout||0)});var e=a.total-a.answered-a.abandoned;a.unmanaged=0<e?e:0,a.avgHoldTime=Math.round(0<a.total?a.sumHoldTime/a.total:0),a.avgHoldTime=new Date(1e3*a.avgHoldTime).toISOString().substr(11,8),a.avgTalkTime=Math.round(0<a.answered?a.sumBillable/a.answered:0),a.avgTalkTime=new Date(1e3*a.avgTalkTime).toISOString().substr(11,8),a.answerRate=Math.round((0<a.total?a.answered/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.abandonRate=Math.round((0<a.total?a.abandoned/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundDropRate=Math.round((0<a.total?a.outboundDropCallsDayTimeout/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundAbandonRate=Math.round((0<a.total?a.outboundDropCallsDayCallersExit/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundanswerRate=0<100-a.outboundDropRate-a.outboundAbandonRate&&a.total?100-a.outboundDropRate-a.outboundAbandonRate:0,i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:n}),1===i.length&&s(),n.promise}}function n(t){var i=[],s=function(){var t=i[0],a={originated:0,limitCalls:0};_.forIn(t.rpcCampaigns,function(e,n){t.rpcCampaigns[n]&&(a.originated+=t.rpcCampaigns[n].originated||0,a.limitCalls+=t.rpcCampaigns[n].limitCalls||0)}),i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:n}),1===i.length&&s(),n.promise}}function t(t,a,e){var i=this;i.license=e,i.onInit=function(){if(i.hasDashboardPermissions=!a.hasRole("user")||a.hasPermission(101),i.hasDashboardPermissions){var e=t.current.name;switch(e){case"app.dashboards.general":n=[],i.license.voice&&n.push("app.dashboards.general.voice"),i.license.dialer&&n.push("app.dashboards.general.dialer"),i.license.chat&&n.push("app.dashboards.general.chat"),i.license.mail&&n.push("app.dashboards.general.mail"),i.license.messaging&&n.push("app.dashboards.general.sms"),i.license.openchannel&&n.push("app.dashboards.general.openchannel"),i.license.fax&&n.push("app.dashboards.general.fax"),i.license.whatsapp&&n.push("app.dashboards.general.whatsapp"),0<n.length&&t.go(_.first(n));break;case"app.dashboards.general.voice":i.selectedTab=0;break;case"app.dashboards.general.dialer":i.selectedTab=1;break;case"app.dashboards.general.chat":i.selectedTab=2;break;case"app.dashboards.general.mail":i.selectedTab=3;break;case"app.dashboards.general.sms":i.selectedTab=4;break;case"app.dashboards.general.openchannel":i.selectedTab=5;break;case"app.dashboards.general.fax":i.selectedTab=6;break;case"app.dashboards.general.whatsapp":i.selectedTab=7}}var n}}e.$inject=["$q"],n.$inject=["$q"],t.$inject=["$state","Auth","license"],angular.module("app.dashboards").factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",n).controller("UserDashboardGeneralController",t)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(){s({queues:o.inboundQueues,rpcQueues:o.rpcQueues}).then(function(e){o.inbound=e})}o.inboundQueues=t?_.keyBy(t.rows?t.rows:[],"id"):{},o.rpcQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},o.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},o.outbound=i||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},o.onSaveQueue=function(e){o.inboundQueues[e.id]&&o.rpcQueues[e.id]&&(o.rpcQueues[e.id]=e,r())},o.onSaveOutbound=function(e){o.outbound=e},n.on("voice_queue:save",o.onSaveQueue),n.on("voice_outbound:save",o.onSaveOutbound),r(),e.$on("$destroy",function(){n.removeListener("voice_queue:save",o.onSaveQueue),n.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","socket","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.whatsappAccounts,{id:_.toNumber(e.WhatsappAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.whatsappAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("whatsappInteraction:save",i.onSaveWhatsappInteraction),n.on("whatsappInteraction:update",i.onUpdateWhatsappInteraction),function(){if(0<Object.keys(i.whatsappAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("whatsappInteraction:save"),n.removeAllListeners("whatsappInteraction:update")})}e.$inject=["$scope","socket","whatsappInteractions","whatsappAccounts"],angular.module("app.dashboards").controller("UserWhatsappDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXACCOUNT",g.faxAccount=angular.copy(l),g.faxAccounts=r,g.newFaxAccount=!1,g.faxAccount||(g.faxAccount={waitForTheAssignedAgent:10,waitfortheassignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="FAX.NEW_FAXACCOUNT",g.newFaxAccount=!0),n.params.id&&(g.faxAccount.FaxAccountId=n.params.id),g.addNewFaxAccount=function(){g.errors=[],d.faxAccount.addAccountApplications(g.faxAccount).$promise.then(function(e){g.faxAccounts.unshift(e.toJSON()),o.success({title:"FaxAccount properly created",msg:g.faxAccount.name?g.faxAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxAccount=function(){g.errors=[],d.faxAccount.updateAccountApplications(g.faxAccount).$promise.then(function(e){var n=_.find(g.faxAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FaxAccount properly saved!",msg:g.faxAccount.name?g.faxAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.faxAccount.delete({id:g.faxAccount.id}).$promise.then(function(){_.remove(g.faxAccounts,{id:g.faxAccount.id}),o.success({title:"FaxAccount properly deleted!",msg:(g.faxAccount.name||"faxAccount")+" has been deleted!"}),v(g.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.lists,{id:Number(g.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.lists,{id:Number(g.faxAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxAccounts","faxAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:t,faxAccount:r.faxAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[n]=e:r.faxAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.faxAccountApps.rows.length;t++,0){var a=r.faxAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:901}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.faxAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=o.faxAccount.getApplications(r.query,t).$promise},r.editFaxAccountApp=n,r.editInterval=function(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxAccount.getAgents({id:c.faxAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxAccount?"penalty "+e.UserFaxAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.removeAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.addAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxAccount","faxAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("fax")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:901}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountApptagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.faxAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.faxAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.FaxAccountId=m.faxAccount.id,m.query.id=m.faxAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.faxAccount.id,field:"FaxAccountId",route:"faxAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.fax").controller("FaxAccountDispositionsController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"faxAccount",action:"getDispositions",field:"name",params:{id:m.faxAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.faxAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.faxAccountInteractions.rows.length;n+=1){var t=m.faxAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.faxInteraction.get(m.query,p).$promise}function v(e){d.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.faxAccountInteractions.rows,{id:e.id}),m.faxAccountInteractions.count-=1,m.faxAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.fax):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.faxAccount={},m.faxAccountInteractions={count:0,rows:[]},m.selectedFaxAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.faxAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.FaxAccountId=m.faxAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.faxInteractionDownload=function(s,e,n){return d.faxInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="fax-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getFaxAccountInteractions=g,m.createOrEditFaxAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:m.faxAccount,interaction:n,interactions:m.faxAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyfaxInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"fax",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"fax.faxAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||FaxAccountId:=$eq["+m.faxAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(m.selectedFaxAccountInteractions);return m.selectedFaxAccountInteractions=[],e},m.deleteFaxAccountInteraction=v,m.deleteSelectedFaxAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedFaxAccountInteractions.forEach(function(e){v(e)}),m.selectedFaxAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=n,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=e.protocol()+"://"+e.host(),p.faxAccount=c||t.params.faxAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=t.params.tab||0,p.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},p.agentadddialog=function(e,n){a.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:p.faxAccounts?p.faxAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoFaxAccounts=function(){t.go("app.fax.faxAccounts",{},{reload:"app.fax.faxAccounts"})},p.saveFaxAccount=function(){r.faxAccount.updateAccountApplications(p.faxAccount).$promise.then(function(){l.success({title:"FaxAccount updated!",msg:p.faxAccount.name?p.faxAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.trunks,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.trunks,{id:t.id});a.canSelect=!1,n.push(a)}p.trunks=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)}));for(var i=0;i<p.trunks.length;i++)a&&p.trunks[i].id===a.id&&(p.trunks[i].canSelect=!1,t.push(p.trunks[i]));p.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.lists,{id:Number(p.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.lists,{id:Number(p.faxAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxAccount","userProfile","userProfileSection"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFaxAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},f.agentadddialog=function(e,n){i.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:f.faxAccounts?f.faxAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxAccount")+"?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFaxAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxAccount=function(e,n){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:n,faxAccounts:f.faxAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFaxAccount=y,f.exportSelectedFaxAccounts=function(){var e=angular.copy(f.selectedFaxAccounts);return f.selectedFaxAccounts=[],e},f.deleteSelectedFaxAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+f.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxAccounts.forEach(function(e){y(e)}),f.selectedFaxAccounts=[]})},f.deselectFaxAccounts=function(){f.selectedFaxAccounts=[]},f.selectAllFaxAccounts=function(){f.selectedFaxAccounts=f.faxAccounts.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.faxAccount&&(t=_.find(f.lists,{id:Number(f.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.faxAccount&&(a=_.find(f.lists,{id:Number(f.faxAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.faxAccounts=e||{count:0,rows:[]}}function y(e){m.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.faxAccounts.rows,{id:e.id}),f.faxAccounts.count-=1,f.faxAccounts.rows.length||f.getFaxAccounts(),p.success({title:_.startCase("FaxAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="FAX.EDIT_FAXQUEUE",r.faxQueue=angular.copy(n),r.faxQueues=e,r.newFaxQueue=!1,r.faxQueue||(r.faxQueue={strategy:"beepall",timeout:10},r.title="FAX.NEW_FAXQUEUE",r.newFaxQueue=!0),r.addNewFaxQueue=function(){r.errors=[],i.faxQueue.save(r.faxQueue).$promise.then(function(e){r.faxQueues.unshift(e.toJSON()),a.success({title:"FaxQueue properly created",msg:r.faxQueue.name?r.faxQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveFaxQueue=function(){r.errors=[],i.faxQueue.update({id:r.faxQueue.id},r.faxQueue).$promise.then(function(e){var n=_.find(r.faxQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"FaxQueue properly saved!",msg:r.faxQueue.name?r.faxQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteFaxQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.faxQueue.delete({id:r.faxQueue.id}).$promise.then(function(){_.remove(r.faxQueues,{id:r.faxQueue.id}),a.success({title:"FaxQueue properly deleted!",msg:(r.faxQueue.name||"faxQueue")+" has been deleted!"}),l(r.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","faxQueues","faxQueue","api","Auth","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getAgents({id:c.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getTeams({id:l.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.faxQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("FAX.ALL_TEAMS"),labelSelected:t.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.faxQueue=c||e.params.faxQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxQueues=function(){e.go("app.fax.faxQueues",{},{reload:"app.fax.faxQueues"})},u.saveFaxQueue=function(){r.faxQueue.update({id:u.faxQueue.id},u.faxQueue).$promise.then(function(){l.success({title:"FaxQueue updated!",msg:u.faxQueue.name?u.faxQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxQueue","userProfileSection"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxQueues",f.listOrder="",f.listOrderAsc=null,f.selectedFaxQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxQueue")+"?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.queues",{})}},f.success=E,f.getFaxQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxQueue=function(e,n){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:f.faxQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteFaxQueue=y,f.exportSelectedFaxQueues=function(){var e=angular.copy(f.selectedFaxQueues);return f.selectedFaxQueues=[],e},f.deleteSelectedFaxQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+f.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxQueues.forEach(function(e){y(e)}),f.selectedFaxQueues=[]})},f.deselectFaxQueues=function(){f.selectedFaxQueues=[]},f.selectAllFaxQueues=function(){f.selectedFaxQueues=f.faxQueues.rows};var b=!0,A=1;function E(e){f.faxQueues=e||{count:0,rows:[]}}function y(e){m.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.faxQueues.rows,{id:e.id}),f.faxQueues.count-=1,f.faxQueues.rows.length||f.getFaxQueues(),p.success({title:_.startCase("FaxQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d){var c=this,m=d&&1==d.count?d.rows[0].crudPermissions:null;function u(){c.faxAccounts.rows.forEach(function(n){var e=_.find(c.rpcFaxAccounts.rows,["id",n.id]);e&&_.merge(n,e);var t={id:n.id,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};i.faxAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",i.faxAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){o.error(e.data?e.data.message:e.toString())})})}function p(e){var n=_.find(c.faxAccounts.rows,["id",e.id]);n&&_.merge(n,e)}function g(e){c.faxAccounts.rows=e.rows,u()}c.currentUser=n.getCurrentUser(),c.faxAccounts=r,c.rpcFaxAccounts=l,c.crudPermissions=n.parseCrudPermissions(m),c.query={sort:"name",limit:10,page:1},c.success=g,c.$onInit=u,c.getFaxAccounts=function(){c.query.offset=(c.query.page-1)*c.query.limit,n.hasRole("admin")?c.promise=i.faxAccount.get(c.query,g).$promise:(c.query.id=c.currentUser.userProfileId,c.query.section="FaxAccounts",c.promise=i.userProfile.getResources(c.query,g).$promise)},c.goToFaxAccount=function(e,n){a.go("app.fax.faxAccounts.edit",{id:n.id,faxAccount:n})},s.on("faxAccount:save",p),s.on("faxAccount:update",p),s.on("faxMessage:save",function(e){var n=_.find(c.faxAccounts.rows,["id",e.FaxAccountId]);n&&("in"==e.direction?(n.in+=1,n.lastIn=e.createdAt):(n.out+=1,n.lastOut=e.createdAt))});var v=!0,h=1;e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=h),c.getFaxAccounts())}),e.$on("$destroy",function(){s.removeAllListeners("faxAccount:save"),s.removeAllListeners("faxAccount:update"),s.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$state","api","Auth","socket","toasty","faxAccounts","rpcFaxAccounts","userProfileSection"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,t.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.fax.realtime.agents");break;case 1:t.go("app.fax.realtime.trunks");break;case 2:t.go("app.fax.realtime.queues");break;case 3:t.go("app.fax.realtime.accounts");break;default:t.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"name",limit:10,page:1},u.statusClass=r.STATUS_STYLES,u.stateClass=r.STATES_STYLES,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","realtimeManager","$state","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,n){this.info=e,this.license=n}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKACCOUNT",g.deskAccount=angular.copy(l),g.deskAccounts=r,g.newDeskAccount=!1,g.deskAccount||(g.deskAccount={type:"integrationTab",authType:"basic",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_DESKACCOUNT",g.newDeskAccount=!0),g.addNewDeskAccount=function(){g.errors=[],d.intDeskAccount.save(g.deskAccount).$promise.then(function(e){g.deskAccounts.unshift(e.toJSON()),o.success({title:"DeskAccount properly created",msg:g.deskAccount.name?g.deskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskAccount=function(){g.errors=[],d.intDeskAccount.update({id:g.deskAccount.id},g.deskAccount).$promise.then(function(e){var n=_.find(g.deskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskAccount properly saved!",msg:g.deskAccount.name?g.deskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskAccount.delete({id:g.deskAccount.id}).$promise.then(function(){_.remove(g.deskAccounts,{id:g.deskAccount.id}),o.success({title:"DeskAccount properly deleted!",msg:(g.deskAccount.name||"deskAccount")+" has been deleted!"}),v(g.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","deskAccounts","deskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.deskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="deskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedDeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("deskAccount")+"?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getDeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intDeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="DeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditDeskAccount=function(e,n){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:n,deskAccounts:f.deskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteDeskAccount=y,f.exportSelectedDeskAccounts=function(){var e=angular.copy(f.selectedDeskAccounts);return f.selectedDeskAccounts=[],e},f.deleteSelectedDeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+f.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedDeskAccounts.forEach(function(e){y(e)}),f.selectedDeskAccounts=[]})},f.deselectDeskAccounts=function(){f.selectedDeskAccounts=[]},f.selectAllDeskAccounts=function(){f.selectedDeskAccounts=f.deskAccounts.rows};var b=!0,A=1;function E(e){f.deskAccounts=e||{count:0,rows:[]}}function y(e){m.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.deskAccounts.rows,{id:e.id}),f.deskAccounts.count-=1,f.deskAccounts.rows.length||f.getDeskAccounts(),p.success({title:_.startCase("DeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","deskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.deskAccount={},o.deskConfiguration={},o.configurations=[],o.selectedDeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.deskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDeskAccount.getConfigurations({id:o.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDeskConfiguration=function(e){o.deskConfiguration=o.configurations[e],o.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:o.deskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:o.deskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:o.deskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:o.deskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDeskConfiguration=function(e,n){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDeskConfiguration(0)})},o.deleteDeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(n.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"DeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:o.deskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",g.deskConfiguration=angular.copy(l),g.configurations=r,g.newDeskConfiguration=!1,g.deskConfiguration||(g.deskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_DESKCONFIGURATION",g.newDeskConfiguration=!0),g.addNewDeskConfiguration=function(){g.errors=[],d.intDeskAccount.addConfiguration({id:n.params.id},g.deskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"DeskConfiguration properly created",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskConfiguration=function(){g.errors=[],d.intDeskConfiguration.update({id:g.deskConfiguration.id},g.deskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskConfiguration properly saved!",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskConfiguration.delete({id:g.deskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.deskConfiguration.id}),o.success({title:"DeskConfiguration properly deleted!",msg:(g.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),v(g.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","deskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.deskAccount=c||e.params.deskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts",{},{reload:"app.integrations.deskAccounts"})},u.saveDeskAccount=function(){r.intDeskAccount.update({id:u.deskAccount.id},u.deskAccount).$promise.then(function(){l.success({title:"DeskAccount updated!",msg:u.deskAccount.name?u.deskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","deskAccount","userProfileSection"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT",v.dynamics365Account=angular.copy(l),v.dynamics365Accounts=r,v.cloudProviders=d,v.newDynamics365Account=!1,v.dynamics365Account||(v.dynamics365Account={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),modernAuthentication:!1},v.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",v.newDynamics365Account=!0),v.addNewDynamics365Account=function(){v.errors=[],c.intDynamics365Account.save(v.dynamics365Account).$promise.then(function(e){v.dynamics365Accounts.unshift(e.toJSON()),o.success({title:"Dynamics365Account properly created",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveDynamics365Account=function(){v.errors=[],c.intDynamics365Account.update({id:v.dynamics365Account.id},v.dynamics365Account).$promise.then(function(e){var n=_.find(v.dynamics365Accounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Account properly saved!",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteDynamics365Account=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Account will be deleted.").ariaLabel("Delete Dynamics365Account").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Account.delete({id:v.dynamics365Account.id}).$promise.then(function(){_.remove(v.dynamics365Accounts,{id:v.dynamics365Account.id}),o.success({title:"Dynamics365Account properly deleted!",msg:(v.dynamics365Account.name||"dynamics365Account")+" has been deleted!"}),h(v.dynamics365Account)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dynamics365Accounts","dynamics365Account","cloudProviders","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=h,b.setting=f,b.currentUser=v.getCurrentUser(),b.dynamics365Accounts=l||{count:0,rows:[]},b.cloudProviders=d||{count:0,rows:[]},b.userProfile=c,b.userProfileSection=m&&1==m.count?m.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dynamics365Accounts",b.listOrder="",b.listOrderAsc=null,b.selectedDynamics365Accounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,n){t.go("app.integrations.dynamics365Accounts.edit",{id:e.id,dynamics365Account:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,n){return u.intDynamics365Account.getFields({id:e.id,test:!0}).$promise.then(function(){g.success({title:"Dynamics365Account properly tested",msg:"Connection succeded!"})}).catch(function(e){g.error({title:"Dynamics365Account properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("dynamics365Account")+"?").htmlContent("<b>"+(e.name||"dynamics365Account")+"</b> will be deleted.").ariaLabel("delete dynamics365Account").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDynamics365Accounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,v.hasRole("admin")?b.promise=u.intDynamics365Account.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dynamics365Accounts",b.promise=u.userProfile.getResources(b.query,y).$promise)},b.createOrEditDynamics365Account=function(e,n){i.show({controller:"CreateOrEditDynamics365AccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Account:n,dynamics365Accounts:b.dynamics365Accounts.rows,cloudProviders:b.cloudProviders.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDynamics365Account=S,b.exportSelectedDynamics365Accounts=function(){var e=angular.copy(b.selectedDynamics365Accounts);return b.selectedDynamics365Accounts=[],e},b.deleteSelectedDynamics365Accounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected dynamics365Accounts?").htmlContent("<b>"+b.selectedDynamics365Accounts.length+" selected</b> will be deleted.").ariaLabel("delete Dynamics365Accounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedDynamics365Accounts.forEach(function(e){S(e)}),b.selectedDynamics365Accounts=[]})},b.deselectDynamics365Accounts=function(){b.selectedDynamics365Accounts=[]},b.selectAllDynamics365Accounts=function(){b.selectedDynamics365Accounts=b.dynamics365Accounts.rows};var A=!0,E=1;function y(e){b.dynamics365Accounts=e||{count:0,rows:[]}}function S(e){u.intDynamics365Account.delete({id:e.id}).$promise.then(function(){_.remove(b.dynamics365Accounts.rows,{id:e.id}),b.dynamics365Accounts.count-=1,b.dynamics365Accounts.rows.length||b.getDynamics365Accounts(),g.success({title:_.startCase("Dynamics365Account")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDynamics365Account"}];for(var n=0;n<e.data.errors.length;n++)g.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else g.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDynamics365Account",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){A?o(function(){A=!1}):(n||(E=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=E),b.getDynamics365Accounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dynamics365Accounts","cloudProviders","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("Dynamics365AccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.dynamics365Account={},o.dynamics365Configuration={},o.configurations=[],o.selectedDynamics365Configuration=-1,o.crudPermissions,o.init=function(e,n){o.dynamics365Account=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDynamics365Account.getConfigurations({id:o.dynamics365Account.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDynamics365Configuration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDynamics365Configuration=function(e){o.advancedForm&&o.advancedForm.$setPristine();o.dynamics365Configuration=o.configurations[e],o.selectedDynamics365Configuration=e,i.intDynamics365Configuration.getSubjects({id:o.dynamics365Configuration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDynamics365Configuration.getDescriptions({id:o.dynamics365Configuration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDynamics365Configuration.getFields({id:o.dynamics365Configuration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDynamics365Configuration=function(e,n){a.show({controller:"CreateOrEditDynamics365ConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Configuration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDynamics365Configuration(0)})},o.deleteDynamics365Configuration=function(e,n){var t=a.confirm().title("Are you sure want to delete the dynamics365Configuration?").htmlContent("<b>"+(n.name||"dynamics365Configuration")+"</b> will be deleted.").ariaLabel("delete dynamics365Configuration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDynamics365Configuration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"Dynamics365Configuration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDynamics365Configuration(0)})},function(){console.log("CANCEL")})},o.saveDynamics365Configuration=function(){o.errors=[],i.intDynamics365Configuration.update({id:o.dynamics365Configuration.id},o.dynamics365Configuration).$promise.then(function(e){var n=_.find(o.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.advancedForm.$setPristine(),s.success({title:"Dynamics365Configuration properly saved!",msg:o.dynamics365Configuration.name?o.dynamics365Configuration.name+" has been saved!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("Dynamics365AccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365CONFIGURATION",g.dynamics365Configuration=angular.copy(l),g.configurations=r,g.newDynamics365Configuration=!1,g.dynamics365Configuration||(g.dynamics365Configuration={channel:"voice",type:"inbound",ticketType:"incident"},g.title="INTEGRATIONS.NEW_DYNAMICS365CONFIGURATION",g.newDynamics365Configuration=!0),g.addNewDynamics365Configuration=function(){g.errors=[],d.intDynamics365Account.addConfiguration({id:n.params.id},g.dynamics365Configuration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"Dynamics365Configuration properly created",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Configuration=function(){g.errors=[],d.intDynamics365Configuration.update({id:g.dynamics365Configuration.id},g.dynamics365Configuration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Configuration properly saved!",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Configuration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Configuration will be deleted.").ariaLabel("Delete Dynamics365Configuration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDynamics365Configuration.delete({id:g.dynamics365Configuration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.dynamics365Configuration.id}),o.success({title:"Dynamics365Configuration properly deleted!",msg:(g.dynamics365Configuration.name||"dynamics365Configuration")+" has been deleted!"}),v(g.dynamics365Configuration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","dynamics365Configuration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365ConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Field.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.dynamics365Account=c||e.params.dynamics365Account||{},p.cloudProviders=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.alert=l.info,p.gotoDynamics365Accounts=function(){e.go("app.integrations.dynamics365Accounts",{},{reload:"app.integrations.dynamics365Accounts"})},p.saveDynamics365Account=function(){r.intDynamics365Account.update({id:p.dynamics365Account.id},p.dynamics365Account).$promise.then(function(){l.success({title:"Dynamics365Account updated!",msg:p.dynamics365Account.name?p.dynamics365Account.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDynamics365Account",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","dynamics365Account","cloudProviders","userProfileSection"],angular.module("app.integrations").controller("Dynamics365AccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",g.freshdeskAccount=angular.copy(l),g.freshdeskAccounts=r,g.newFreshdeskAccount=!1,g.freshdeskAccount||(g.freshdeskAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",g.newFreshdeskAccount=!0),g.addNewFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.save(g.freshdeskAccount).$promise.then(function(e){g.freshdeskAccounts.unshift(e.toJSON()),o.success({title:"FreshdeskAccount properly created",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.update({id:g.freshdeskAccount.id},g.freshdeskAccount).$promise.then(function(e){var n=_.find(g.freshdeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskAccount properly saved!",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskAccount.delete({id:g.freshdeskAccount.id}).$promise.then(function(){_.remove(g.freshdeskAccounts,{id:g.freshdeskAccount.id}),o.success({title:"FreshdeskAccount properly deleted!",msg:(g.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),v(g.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshdeskAccount={},o.freshdeskConfiguration={},o.configurations=[],o.selectedFreshdeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshdeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshdeskAccount.getConfigurations({id:o.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshdeskConfiguration=function(e){o.freshdeskConfiguration=o.configurations[e],o.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:o.freshdeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:o.freshdeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshdeskConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshdeskConfiguration(0)})},o.deleteFreshdeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(n.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshdeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshdeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:o.freshdeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",g.freshdeskConfiguration=angular.copy(l),g.configurations=r,g.newFreshdeskConfiguration=!1,g.freshdeskConfiguration||(g.freshdeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",g.newFreshdeskConfiguration=!0),g.addNewFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskAccount.addConfiguration({id:n.params.id},g.freshdeskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshdeskConfiguration properly created",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskConfiguration.update({id:g.freshdeskConfiguration.id},g.freshdeskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskConfiguration properly saved!",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskConfiguration.delete({id:g.freshdeskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshdeskConfiguration.id}),o.success({title:"FreshdeskConfiguration properly deleted!",msg:(g.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),v(g.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshdeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshdeskAccount=c||e.params.freshdeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts",{},{reload:"app.integrations.freshdeskAccounts"})},u.saveFreshdeskAccount=function(){r.intFreshdeskAccount.update({id:u.freshdeskAccount.id},u.freshdeskAccount).$promise.then(function(){l.success({title:"FreshdeskAccount updated!",msg:u.freshdeskAccount.name?u.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshdeskAccount","userProfileSection"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshdeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshdeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshdeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshdeskAccount")+"?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshdeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshdeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshdeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshdeskAccount=function(e,n){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:n,freshdeskAccounts:f.freshdeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshdeskAccount=y,f.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(f.selectedFreshdeskAccounts);return f.selectedFreshdeskAccounts=[],e},f.deleteSelectedFreshdeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+f.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshdeskAccounts.forEach(function(e){y(e)}),f.selectedFreshdeskAccounts=[]})},f.deselectFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=[]},f.selectAllFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=f.freshdeskAccounts.rows};var b=!0,A=1;function E(e){f.freshdeskAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshdeskAccounts.rows,{id:e.id}),f.freshdeskAccounts.count-=1,f.freshdeskAccounts.rows.length||f.getFreshdeskAccounts(),p.success({title:_.startCase("FreshdeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshdeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESACCOUNT",g.freshsalesAccount=angular.copy(l),g.freshsalesAccounts=r,g.newFreshsalesAccount=!1,g.freshsalesAccount||(g.freshsalesAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHSALESACCOUNT",g.newFreshsalesAccount=!0),g.addNewFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.save(g.freshsalesAccount).$promise.then(function(e){g.freshsalesAccounts.unshift(e.toJSON()),o.success({title:"FreshsalesAccount properly created",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.update({id:g.freshsalesAccount.id},g.freshsalesAccount).$promise.then(function(e){var n=_.find(g.freshsalesAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesAccount properly saved!",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesAccount will be deleted.").ariaLabel("Delete FreshsalesAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesAccount.delete({id:g.freshsalesAccount.id}).$promise.then(function(){_.remove(g.freshsalesAccounts,{id:g.freshsalesAccount.id}),o.success({title:"FreshsalesAccount properly deleted!",msg:(g.freshsalesAccount.name||"freshsalesAccount")+" has been deleted!"}),v(g.freshsalesAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshsalesAccounts","freshsalesAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshsalesAccount={},o.freshsalesConfiguration={},o.configurations=[],o.selectedFreshsalesConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshsalesAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshsalesAccount.getConfigurations({id:o.freshsalesAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshsalesConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshsalesConfiguration=function(e){o.freshsalesConfiguration=o.configurations[e],o.selectedFreshsalesConfiguration=e,i.intFreshsalesConfiguration.getSubjects({id:o.freshsalesConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshsalesConfiguration.getDescriptions({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshsalesConfiguration.getFields({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshsalesConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshsalesConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshsalesConfiguration(0)})},o.deleteFreshsalesConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshsalesConfiguration?").htmlContent("<b>"+(n.name||"freshsalesConfiguration")+"</b> will be deleted.").ariaLabel("delete freshsalesConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshsalesConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshsalesConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshsalesConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshsalesAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESCONFIGURATION",g.freshsalesConfiguration=angular.copy(l),g.configurations=r,g.newFreshsalesConfiguration=!1,g.freshsalesConfiguration||(g.freshsalesConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHSALESCONFIGURATION",g.newFreshsalesConfiguration=!0),g.addNewFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesAccount.addConfiguration({id:n.params.id},g.freshsalesConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshsalesConfiguration properly created",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesConfiguration.update({id:g.freshsalesConfiguration.id},g.freshsalesConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesConfiguration properly saved!",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesConfiguration will be deleted.").ariaLabel("Delete FreshsalesConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesConfiguration.delete({id:g.freshsalesConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshsalesConfiguration.id}),o.success({title:"FreshsalesConfiguration properly deleted!",msg:(g.freshsalesConfiguration.name||"freshsalesConfiguration")+" has been deleted!"}),v(g.freshsalesConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshsalesConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshsalesField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshsalesAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshsalesAccount=c||e.params.freshsalesAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshsalesAccounts=function(){e.go("app.integrations.freshsalesAccounts",{},{reload:"app.integrations.freshsalesAccounts"})},u.saveFreshsalesAccount=function(){r.intFreshsalesAccount.update({id:u.freshsalesAccount.id},u.freshsalesAccount).$promise.then(function(){l.success({title:"FreshsalesAccount updated!",msg:u.freshsalesAccount.name?u.freshsalesAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshsalesAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshsalesAccount","userProfileSection"],angular.module("app.integrations").controller("FreshsalesAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshsalesAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshsalesAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshsalesAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshsalesAccounts.edit",{id:e.id,freshsalesAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshsalesAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshsalesAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshsalesAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshsalesAccount")+"?").htmlContent("<b>"+(e.name||"freshsalesAccount")+"</b> will be deleted.").ariaLabel("delete freshsalesAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshsalesAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshsalesAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshsalesAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshsalesAccount=function(e,n){i.show({controller:"CreateOrEditFreshsalesAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesAccount:n,freshsalesAccounts:f.freshsalesAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshsalesAccount=y,f.exportSelectedFreshsalesAccounts=function(){var e=angular.copy(f.selectedFreshsalesAccounts);return f.selectedFreshsalesAccounts=[],e},f.deleteSelectedFreshsalesAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshsalesAccounts?").htmlContent("<b>"+f.selectedFreshsalesAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshsalesAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshsalesAccounts.forEach(function(e){y(e)}),f.selectedFreshsalesAccounts=[]})},f.deselectFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=[]},f.selectAllFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=f.freshsalesAccounts.rows};var b=!0,A=1;function E(e){f.freshsalesAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshsalesAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshsalesAccounts.rows,{id:e.id}),f.freshsalesAccounts.count-=1,f.freshsalesAccounts.rows.length||f.getFreshsalesAccounts(),p.success({title:_.startCase("FreshsalesAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshsalesAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshsalesAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshsalesAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshsalesAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshsalesAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",g.salesforceAccount=angular.copy(l),g.salesforceAccounts=r,g.newSalesforceAccount=!1,g.salesforceAccount||(g.salesforceAccount={type:"integrationTab",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",g.newSalesforceAccount=!0),g.addNewSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.save(g.salesforceAccount).$promise.then(function(e){g.salesforceAccounts.unshift(e.toJSON()),o.success({title:"SalesforceAccount properly created",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.update({id:g.salesforceAccount.id},g.salesforceAccount).$promise.then(function(e){var n=_.find(g.salesforceAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceAccount properly saved!",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceAccount.delete({id:g.salesforceAccount.id}).$promise.then(function(){_.remove(g.salesforceAccounts,{id:g.salesforceAccount.id}),o.success({title:"SalesforceAccount properly deleted!",msg:(g.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),v(g.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function n(){return"Case"===o.salesforceConfiguration.ticketType&&("lead"===o.salesforceConfiguration.moduleCreate||_.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch))}function r(){return _.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function l(){return _.includes(["contact","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function d(){return _.includes(["account","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function c(){return i.intSalesforceConfiguration.update({id:o.salesforceConfiguration.id},o.salesforceConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function m(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function u(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.salesforceAccount={},o.salesforceConfiguration={},o.configurations=[],o.selectedSalesforceConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.salesforceAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSalesforceAccount.getConfigurations({id:o.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSalesforceConfiguration=function(e){o.salesforceConfiguration=o.configurations[e],o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),o.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:o.salesforceConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:o.salesforceConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:o.salesforceConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSalesforceConfiguration=function(e,n){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSalesforceConfiguration(0)})},o.deleteSalesforceConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(n.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSalesforceConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SalesforceConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),c()},o.salesforceConfiguration.isLead=!1,o.salesforceConfiguration.isLeadSearch=!1,o.salesforceConfiguration.isContactSearch=!1,o.salesforceConfiguration.isAccountSearch=!1,o.checkIsLead=n,o.checkIsLeadSearch=r,o.checkIsContactSearch=l,o.checkIsAccountSearch=d,o.saveSalesforceConfiguration=c,o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){m(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){m(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){u(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){u(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){p(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",g.salesforceConfiguration=angular.copy(l),g.configurations=r,g.newSalesforceConfiguration=!1,g.salesforceConfiguration||(g.salesforceConfiguration={channel:"voice",type:"inbound",ticketType:"Task"},g.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",g.newSalesforceConfiguration=!0),g.addNewSalesforceConfiguration=function(){g.errors=[],d.intSalesforceAccount.addConfiguration({id:n.params.id},g.salesforceConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SalesforceConfiguration properly created",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceConfiguration=function(){g.errors=[],d.intSalesforceConfiguration.update({id:g.salesforceConfiguration.id},g.salesforceConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceConfiguration properly saved!",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceConfiguration.delete({id:g.salesforceConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.salesforceConfiguration.id}),o.success({title:"SalesforceConfiguration properly deleted!",msg:(g.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),v(g.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","salesforceConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSalesforceField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.salesforceAccount=c||e.params.salesforceAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts",{},{reload:"app.integrations.salesforceAccounts"})},u.saveSalesforceAccount=function(){r.intSalesforceAccount.update({id:u.salesforceAccount.id},u.salesforceAccount).$promise.then(function(){l.success({title:"SalesforceAccount updated!",msg:u.salesforceAccount.name?u.salesforceAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","salesforceAccount","userProfileSection"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.salesforceAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="salesforceAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSalesforceAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("salesforceAccount")+"?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSalesforceAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSalesforceAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SalesforceAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSalesforceAccount=function(e,n){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:n,salesforceAccounts:f.salesforceAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSalesforceAccount=y,f.exportSelectedSalesforceAccounts=function(){var e=angular.copy(f.selectedSalesforceAccounts);return f.selectedSalesforceAccounts=[],e},f.deleteSelectedSalesforceAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+f.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSalesforceAccounts.forEach(function(e){y(e)}),f.selectedSalesforceAccounts=[]})},f.deselectSalesforceAccounts=function(){f.selectedSalesforceAccounts=[]},f.selectAllSalesforceAccounts=function(){f.selectedSalesforceAccounts=f.salesforceAccounts.rows};var b=!0,A=1;function E(e){f.salesforceAccounts=e||{count:0,rows:[]}}function y(e){m.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.salesforceAccounts.rows,{id:e.id}),f.salesforceAccounts.count-=1,f.salesforceAccounts.rows.length||f.getSalesforceAccounts(),p.success({title:_.startCase("SalesforceAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","salesforceAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWACCOUNT",g.servicenowAccount=angular.copy(l),g.servicenowAccounts=r,g.newServicenowAccount=!1,g.servicenowAccount||(g.servicenowAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SERVICENOWACCOUNT",g.newServicenowAccount=!0),g.addNewServicenowAccount=function(){g.errors=[],d.intServicenowAccount.save(g.servicenowAccount).$promise.then(function(e){g.servicenowAccounts.unshift(e.toJSON()),o.success({title:"ServicenowAccount properly created",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowAccount=function(){g.errors=[],d.intServicenowAccount.update({id:g.servicenowAccount.id},g.servicenowAccount).$promise.then(function(e){var n=_.find(g.servicenowAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowAccount properly saved!",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowAccount will be deleted.").ariaLabel("Delete ServicenowAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowAccount.delete({id:g.servicenowAccount.id}).$promise.then(function(){_.remove(g.servicenowAccounts,{id:g.servicenowAccount.id}),o.success({title:"ServicenowAccount properly deleted!",msg:(g.servicenowAccount.name||"servicenowAccount")+" has been deleted!"}),v(g.servicenowAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","servicenowAccounts","servicenowAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.servicenowAccount={},o.servicenowConfiguration={},o.configurations=[],o.selectedServicenowConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.servicenowAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intServicenowAccount.getConfigurations({id:o.servicenowAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getServicenowConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getServicenowConfiguration=function(e){o.servicenowConfiguration=o.configurations[e],o.selectedServicenowConfiguration=e,i.intServicenowConfiguration.getSubjects({id:o.servicenowConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intServicenowConfiguration.getDescriptions({id:o.servicenowConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intServicenowConfiguration.getFields({id:o.servicenowConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditServicenowConfiguration=function(e,n){a.show({controller:"CreateOrEditServicenowConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getServicenowConfiguration(0)})},o.deleteServicenowConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the servicenowConfiguration?").htmlContent("<b>"+(n.name||"servicenowConfiguration")+"</b> will be deleted.").ariaLabel("delete servicenowConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intServicenowConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ServicenowConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getServicenowConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ServicenowAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWCONFIGURATION",g.servicenowConfiguration=angular.copy(l),g.configurations=r,g.newServicenowConfiguration=!1,g.servicenowConfiguration||(g.servicenowConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SERVICENOWCONFIGURATION",g.newServicenowConfiguration=!0),g.addNewServicenowConfiguration=function(){g.errors=[],d.intServicenowAccount.addConfiguration({id:n.params.id},g.servicenowConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ServicenowConfiguration properly created",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowConfiguration=function(){g.errors=[],d.intServicenowConfiguration.update({id:g.servicenowConfiguration.id},g.servicenowConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowConfiguration properly saved!",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowConfiguration will be deleted.").ariaLabel("Delete ServicenowConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowConfiguration.delete({id:g.servicenowConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.servicenowConfiguration.id}),o.success({title:"ServicenowConfiguration properly deleted!",msg:(g.servicenowConfiguration.name||"servicenowConfiguration")+" has been deleted!"}),v(g.servicenowConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","servicenowConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intServicenowField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.servicenowAccount=c||e.params.servicenowAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoServicenowAccounts=function(){e.go("app.integrations.servicenowAccounts",{},{reload:"app.integrations.servicenowAccounts"})},u.saveServicenowAccount=function(){r.intServicenowAccount.update({id:u.servicenowAccount.id},u.servicenowAccount).$promise.then(function(){l.success({title:"ServicenowAccount updated!",msg:u.servicenowAccount.name?u.servicenowAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintServicenowAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","servicenowAccount","userProfileSection"],angular.module("app.integrations").controller("ServicenowAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.servicenowAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="servicenowAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedServicenowAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.servicenowAccounts.edit",{id:e.id,servicenowAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intServicenowAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ServicenowAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ServicenowAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("servicenowAccount")+"?").htmlContent("<b>"+(e.name||"servicenowAccount")+"</b> will be deleted.").ariaLabel("delete servicenowAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getServicenowAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intServicenowAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ServicenowAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditServicenowAccount=function(e,n){i.show({controller:"CreateOrEditServicenowAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowAccount:n,servicenowAccounts:f.servicenowAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteServicenowAccount=y,f.exportSelectedServicenowAccounts=function(){var e=angular.copy(f.selectedServicenowAccounts);return f.selectedServicenowAccounts=[],e},f.deleteSelectedServicenowAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected servicenowAccounts?").htmlContent("<b>"+f.selectedServicenowAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ServicenowAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedServicenowAccounts.forEach(function(e){y(e)}),f.selectedServicenowAccounts=[]})},f.deselectServicenowAccounts=function(){f.selectedServicenowAccounts=[]},f.selectAllServicenowAccounts=function(){f.selectedServicenowAccounts=f.servicenowAccounts.rows};var b=!0,A=1;function E(e){f.servicenowAccounts=e||{count:0,rows:[]}}function y(e){m.intServicenowAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.servicenowAccounts.rows,{id:e.id}),f.servicenowAccounts.count-=1,f.servicenowAccounts.rows.length||f.getServicenowAccounts(),p.success({title:_.startCase("ServicenowAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintServicenowAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintServicenowAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getServicenowAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","servicenowAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ServicenowAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",g.sugarcrmAccount=angular.copy(l),g.sugarcrmAccounts=r,g.newSugarcrmAccount=!1,g.sugarcrmAccount||(g.sugarcrmAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",g.newSugarcrmAccount=!0),g.addNewSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.save(g.sugarcrmAccount).$promise.then(function(e){g.sugarcrmAccounts.unshift(e.toJSON()),o.success({title:"SugarcrmAccount properly created",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.update({id:g.sugarcrmAccount.id},g.sugarcrmAccount).$promise.then(function(e){var n=_.find(g.sugarcrmAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmAccount properly saved!",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmAccount.delete({id:g.sugarcrmAccount.id}).$promise.then(function(){_.remove(g.sugarcrmAccounts,{id:g.sugarcrmAccount.id}),o.success({title:"SugarcrmAccount properly deleted!",msg:(g.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),v(g.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.sugarcrmAccount={},o.sugarcrmConfiguration={},o.configurations=[],o.selectedSugarcrmConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.sugarcrmAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSugarcrmAccount.getConfigurations({id:o.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSugarcrmConfiguration=function(e){o.sugarcrmConfiguration=o.configurations[e],o.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:o.sugarcrmConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSugarcrmConfiguration=function(e,n){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSugarcrmConfiguration(0)})},o.deleteSugarcrmConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(n.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSugarcrmConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SugarcrmConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",g.sugarcrmConfiguration=angular.copy(l),g.configurations=r,g.newSugarcrmConfiguration=!1,g.sugarcrmConfiguration||(g.sugarcrmConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",g.newSugarcrmConfiguration=!0),g.addNewSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmAccount.addConfiguration({id:n.params.id},g.sugarcrmConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SugarcrmConfiguration properly created",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmConfiguration.update({id:g.sugarcrmConfiguration.id},g.sugarcrmConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmConfiguration properly saved!",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmConfiguration.delete({id:g.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.sugarcrmConfiguration.id}),o.success({title:"SugarcrmConfiguration properly deleted!",msg:(g.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),v(g.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSugarcrmField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.sugarcrmAccount=c||e.params.sugarcrmAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts",{},{reload:"app.integrations.sugarcrmAccounts"})},u.saveSugarcrmAccount=function(){r.intSugarcrmAccount.update({id:u.sugarcrmAccount.id},u.sugarcrmAccount).$promise.then(function(){l.success({title:"SugarcrmAccount updated!",msg:u.sugarcrmAccount.name?u.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","sugarcrmAccount","userProfileSection"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sugarcrmAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sugarcrmAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSugarcrmAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sugarcrmAccount")+"?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSugarcrmAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSugarcrmAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SugarcrmAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSugarcrmAccount=function(e,n){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:n,sugarcrmAccounts:f.sugarcrmAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSugarcrmAccount=y,f.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(f.selectedSugarcrmAccounts);return f.selectedSugarcrmAccounts=[],e},f.deleteSelectedSugarcrmAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+f.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSugarcrmAccounts.forEach(function(e){y(e)}),f.selectedSugarcrmAccounts=[]})},f.deselectSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=[]},f.selectAllSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=f.sugarcrmAccounts.rows};var b=!0,A=1;function E(e){f.sugarcrmAccounts=e||{count:0,rows:[]}}function y(e){m.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.sugarcrmAccounts.rows,{id:e.id}),f.sugarcrmAccounts.count-=1,f.sugarcrmAccounts.rows.length||f.getSugarcrmAccounts(),p.success({title:_.startCase("SugarcrmAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sugarcrmAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERACCOUNT",g.vtigerAccount=angular.copy(l),g.vtigerAccounts=r,g.newVtigerAccount=!1,g.vtigerAccount||(g.vtigerAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_VTIGERACCOUNT",g.newVtigerAccount=!0),g.addNewVtigerAccount=function(){g.errors=[],d.intVtigerAccount.save(g.vtigerAccount).$promise.then(function(e){g.vtigerAccounts.unshift(e.toJSON()),o.success({title:"VtigerAccount properly created",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerAccount=function(){g.errors=[],d.intVtigerAccount.update({id:g.vtigerAccount.id},g.vtigerAccount).$promise.then(function(e){var n=_.find(g.vtigerAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerAccount properly saved!",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerAccount will be deleted.").ariaLabel("Delete VtigerAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerAccount.delete({id:g.vtigerAccount.id}).$promise.then(function(){_.remove(g.vtigerAccounts,{id:g.vtigerAccount.id}),o.success({title:"VtigerAccount properly deleted!",msg:(g.vtigerAccount.name||"vtigerAccount")+" has been deleted!"}),v(g.vtigerAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","vtigerAccounts","vtigerAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.vtigerAccount={},o.vtigerConfiguration={},o.configurations=[],o.selectedVtigerConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.vtigerAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intVtigerAccount.getConfigurations({id:o.vtigerAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getVtigerConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getVtigerConfiguration=function(e){o.vtigerConfiguration=o.configurations[e],o.selectedVtigerConfiguration=e,i.intVtigerConfiguration.getSubjects({id:o.vtigerConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intVtigerConfiguration.getDescriptions({id:o.vtigerConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intVtigerConfiguration.getFields({id:o.vtigerConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditVtigerConfiguration=function(e,n){a.show({controller:"CreateOrEditVtigerConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getVtigerConfiguration(0)})},o.deleteVtigerConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the vtigerConfiguration?").htmlContent("<b>"+(n.name||"vtigerConfiguration")+"</b> will be deleted.").ariaLabel("delete vtigerConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intVtigerConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"VtigerConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getVtigerConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("VtigerAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERCONFIGURATION",g.vtigerConfiguration=angular.copy(l),g.configurations=r,g.newVtigerConfiguration=!1,g.vtigerConfiguration||(g.vtigerConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_VTIGERCONFIGURATION",g.newVtigerConfiguration=!0),g.addNewVtigerConfiguration=function(){g.errors=[],d.intVtigerAccount.addConfiguration({id:n.params.id},g.vtigerConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"VtigerConfiguration properly created",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerConfiguration=function(){g.errors=[],d.intVtigerConfiguration.update({id:g.vtigerConfiguration.id},g.vtigerConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerConfiguration properly saved!",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerConfiguration will be deleted.").ariaLabel("Delete VtigerConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerConfiguration.delete({id:g.vtigerConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.vtigerConfiguration.id}),o.success({title:"VtigerConfiguration properly deleted!",msg:(g.vtigerConfiguration.name||"vtigerConfiguration")+" has been deleted!"}),v(g.vtigerConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","vtigerConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intVtigerField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.vtigerAccount=c||e.params.vtigerAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVtigerAccounts=function(){e.go("app.integrations.vtigerAccounts",{},{reload:"app.integrations.vtigerAccounts"})},u.saveVtigerAccount=function(){r.intVtigerAccount.update({id:u.vtigerAccount.id},u.vtigerAccount).$promise.then(function(){l.success({title:"VtigerAccount updated!",msg:u.vtigerAccount.name?u.vtigerAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintVtigerAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","vtigerAccount","userProfileSection"],angular.module("app.integrations").controller("VtigerAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.vtigerAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="vtigerAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedVtigerAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.vtigerAccounts.edit",{id:e.id,vtigerAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intVtigerAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"VtigerAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"VtigerAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("vtigerAccount")+"?").htmlContent("<b>"+(e.name||"vtigerAccount")+"</b> will be deleted.").ariaLabel("delete vtigerAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVtigerAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intVtigerAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VtigerAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVtigerAccount=function(e,n){i.show({controller:"CreateOrEditVtigerAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerAccount:n,vtigerAccounts:f.vtigerAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVtigerAccount=y,f.exportSelectedVtigerAccounts=function(){var e=angular.copy(f.selectedVtigerAccounts);return f.selectedVtigerAccounts=[],e},f.deleteSelectedVtigerAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected vtigerAccounts?").htmlContent("<b>"+f.selectedVtigerAccounts.length+" selected</b> will be deleted.").ariaLabel("delete VtigerAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVtigerAccounts.forEach(function(e){y(e)}),f.selectedVtigerAccounts=[]})},f.deselectVtigerAccounts=function(){f.selectedVtigerAccounts=[]},f.selectAllVtigerAccounts=function(){f.selectedVtigerAccounts=f.vtigerAccounts.rows};var b=!0,A=1;function E(e){f.vtigerAccounts=e||{count:0,rows:[]}}function y(e){m.intVtigerAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.vtigerAccounts.rows,{id:e.id}),f.vtigerAccounts.count-=1,f.vtigerAccounts.rows.length||f.getVtigerAccounts(),p.success({title:_.startCase("VtigerAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintVtigerAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintVtigerAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVtigerAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","vtigerAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("VtigerAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",g.zendeskAccount=angular.copy(l),g.zendeskAccounts=r,g.newZendeskAccount=!1,g.zendeskAccount||(g.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",g.newZendeskAccount=!0),g.addNewZendeskAccount=function(){g.errors=[],d.intZendeskAccount.save(g.zendeskAccount).$promise.then(function(e){g.zendeskAccounts.unshift(e.toJSON()),o.success({title:"ZendeskAccount properly created",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskAccount=function(){g.errors=[],d.intZendeskAccount.update({id:g.zendeskAccount.id},g.zendeskAccount).$promise.then(function(e){var n=_.find(g.zendeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskAccount properly saved!",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskAccount.delete({id:g.zendeskAccount.id}).$promise.then(function(){_.remove(g.zendeskAccounts,{id:g.zendeskAccount.id}),o.success({title:"ZendeskAccount properly deleted!",msg:(g.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),v(g.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZendeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zendeskAccount=c||e.params.zendeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts",{},{reload:"app.integrations.zendeskAccounts"})},u.saveZendeskAccount=function(){r.intZendeskAccount.update({id:u.zendeskAccount.id},u.zendeskAccount).$promise.then(function(){l.success({title:"ZendeskAccount updated!",msg:u.zendeskAccount.name?u.zendeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zendeskAccount","userProfileSection"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zendeskAccount={},o.zendeskConfiguration={},o.zendeskConfigurations=[],o.selectedZendeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zendeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZendeskAccount.getConfigurations({id:o.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.zendeskConfigurations=e.rows?e.rows:[],o.zendeskConfigurations.length&&o.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZendeskConfiguration=function(e){o.zendeskConfiguration=o.zendeskConfigurations[e],o.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:o.zendeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:o.zendeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:o.zendeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:o.zendeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZendeskConfiguration=function(e,n){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:n,zendeskConfigurations:o.zendeskConfigurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZendeskConfiguration(0)})},o.deleteZendeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(n.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZendeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.zendeskConfigurations,{id:n.id}),s.success({title:"ZendeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:o.zendeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",g.zendeskConfiguration=angular.copy(l),g.zendeskConfigurations=r,g.newZendeskConfiguration=!1,g.zendeskConfiguration||(g.zendeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",g.newZendeskConfiguration=!0),g.addNewZendeskConfiguration=function(){g.errors=[],d.intZendeskAccount.addConfiguration({id:n.params.id},g.zendeskConfiguration).$promise.then(function(e){g.zendeskConfigurations.unshift(e.toJSON()),o.success({title:"ZendeskConfiguration properly created",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskConfiguration=function(){g.errors=[],d.intZendeskConfiguration.update({id:g.zendeskConfiguration.id},g.zendeskConfiguration).$promise.then(function(e){var n=_.find(g.zendeskConfigurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskConfiguration properly saved!",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskConfiguration.delete({id:g.zendeskConfiguration.id}).$promise.then(function(){_.remove(g.zendeskConfigurations,{id:g.zendeskConfiguration.id}),o.success({title:"ZendeskConfiguration properly deleted!",msg:(g.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),v(g.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zendeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zendeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZendeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zendeskAccount")+"?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZendeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZendeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZendeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZendeskAccount=function(e,n){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:n,zendeskAccounts:f.zendeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZendeskAccount=y,f.exportSelectedZendeskAccounts=function(){var e=angular.copy(f.selectedZendeskAccounts);return f.selectedZendeskAccounts=[],e},f.deleteSelectedZendeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+f.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZendeskAccounts.forEach(function(e){y(e)}),f.selectedZendeskAccounts=[]})},f.deselectZendeskAccounts=function(){f.selectedZendeskAccounts=[]},f.selectAllZendeskAccounts=function(){f.selectedZendeskAccounts=f.zendeskAccounts.rows};var b=!0,A=1;function E(e){f.zendeskAccounts=e||{count:0,rows:[]}}function y(e){m.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zendeskAccounts.rows,{id:e.id}),f.zendeskAccounts.count-=1,f.zendeskAccounts.rows.length||f.getZendeskAccounts(),p.success({title:_.startCase("ZendeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zendeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",g.zohoAccount=angular.copy(l),g.zohoAccounts=r,g.newZohoAccount=!1,g.zohoAccount||(g.zohoAccount={host:"zoho.com",zone:"EU",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZOHOACCOUNT",g.newZohoAccount=!0),g.addNewZohoAccount=function(){g.errors=[],d.intZohoAccount.save(g.zohoAccount).$promise.then(function(e){g.zohoAccounts.unshift(e.toJSON()),o.success({title:"ZohoAccount properly created",msg:g.zohoAccount.name?g.zohoAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoAccount=function(){g.errors=[],d.intZohoAccount.update({id:g.zohoAccount.id},g.zohoAccount).$promise.then(function(e){var n=_.find(g.zohoAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoAccount properly saved!",msg:g.zohoAccount.name?g.zohoAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoAccount.delete({id:g.zohoAccount.id}).$promise.then(function(){_.remove(g.zohoAccounts,{id:g.zohoAccount.id}),o.success({title:"ZohoAccount properly deleted!",msg:(g.zohoAccount.name||"zohoAccount")+" has been deleted!"}),v(g.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zohoAccount={},o.zohoConfiguration={},o.configurations=[],o.selectedZohoConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zohoAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZohoAccount.getConfigurations({id:o.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZohoConfiguration=function(e){o.zohoConfiguration=o.configurations[e],o.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:o.zohoConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:o.zohoConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:o.zohoConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZohoConfiguration=function(e,n){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZohoConfiguration(0)})},o.deleteZohoConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(n.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZohoConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ZohoConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){i.intZohoConfiguration.update({id:o.zohoConfiguration.id},o.zohoConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",g.zohoConfiguration=angular.copy(l),g.configurations=r,g.newZohoConfiguration=!1,g.zohoConfiguration||(g.zohoConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",g.newZohoConfiguration=!0),g.addNewZohoConfiguration=function(){g.errors=[],d.intZohoAccount.addConfiguration({id:n.params.id},g.zohoConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ZohoConfiguration properly created",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoConfiguration=function(){g.errors=[],d.intZohoConfiguration.update({id:g.zohoConfiguration.id},g.zohoConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoConfiguration properly saved!",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoConfiguration.delete({id:g.zohoConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.zohoConfiguration.id}),o.success({title:"ZohoConfiguration properly deleted!",msg:(g.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),v(g.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","zohoConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZohoField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zohoAccount=c||e.params.zohoAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts",{},{reload:"app.integrations.zohoAccounts"})},u.saveZohoAccount=function(){r.intZohoAccount.update({id:u.zohoAccount.id},u.zohoAccount).$promise.then(function(){l.success({title:"ZohoAccount updated!",msg:u.zohoAccount.name?u.zohoAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zohoAccount","userProfileSection"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zohoAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zohoAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZohoAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayzone=_.keyBy([{option:"US",value:"'US'"},{option:"AU",value:"'AU'"},{option:"EU",value:"'EU'"},{option:"IN",value:"'IN'"},{option:"CN",value:"'CN'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zohoAccount")+"?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZohoAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZohoAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZohoAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZohoAccount=function(e,n){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:n,zohoAccounts:f.zohoAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZohoAccount=y,f.exportSelectedZohoAccounts=function(){var e=angular.copy(f.selectedZohoAccounts);return f.selectedZohoAccounts=[],e},f.deleteSelectedZohoAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+f.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZohoAccounts.forEach(function(e){y(e)}),f.selectedZohoAccounts=[]})},f.deselectZohoAccounts=function(){f.selectedZohoAccounts=[]},f.selectAllZohoAccounts=function(){f.selectedZohoAccounts=f.zohoAccounts.rows};var b=!0,A=1;function E(e){f.zohoAccounts=e||{count:0,rows:[]}}function y(e){m.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zohoAccounts.rows,{id:e.id}),f.zohoAccounts.count-=1,f.zohoAccounts.rows.length||f.getZohoAccounts(),p.success({title:_.startCase("ZohoAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zohoAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="JSCRIPTY.EDIT_PROJECT",g.project=angular.copy(l),g.projects=r,g.newProject=!1,g.project||(g.project={enableUncompleteSave:!0,sendUnpauseOnSubmit:!0},g.title="JSCRIPTY.NEW_PROJECT",g.newProject=!0),g.addNewProject=function(){g.errors=[],d.jscriptyProject.save(g.project).$promise.then(function(e){g.projects.unshift(e.toJSON()),o.success({title:"Project properly created",msg:g.project.name?g.project.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveProject=function(){g.errors=[],d.jscriptyProject.update({id:g.project.id},g.project).$promise.then(function(e){var n=_.find(g.projects,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Project properly saved!",msg:g.project.name?g.project.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteProject=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.jscriptyProject.delete({id:g.project.id}).$promise.then(function(){_.remove(g.projects,{id:g.project.id}),o.success({title:"Project properly deleted!",msg:(g.project.name||"project")+" has been deleted!"}),v(g.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","projects","project","api","Auth","license","setting","crudPermissions"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;r.currentUser=i.getCurrentUser(),r.project={},r.localizationMap=o;var l=new Date;r.pickerModel={dateStart:new Date(l.getFullYear(),l.getMonth(),1),dateEnd:new Date(l.getFullYear(),l.getMonth()+1,0),selectedTemplate:"TM"},r.init=function(e,n){r.project=e,r.userProfile=n,r.getAnswers()},r.getSummary=function(){return a.jscriptyProject.getSummary({id:r.project.id,startTime:{$gte:r.pickerModel.dateStart,$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","jscriptyProjectSummary_"+r.project.id+".csv"),a.click()}else s.info({title:"EXPORT",msg:"No answers available"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.getSummary",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.getAnswers=function(){return r.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:r.project.id,sort:"-createdAt,questionId",createdAt:{$gte:moment(r.pickerModel.dateStart).add(0,"hours").add(0,"minutes").add(0,"seconds").utcOffset(0,!0).format(),$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").utcOffset(0,!0).format()},nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){r.answers={};for(var n=0,t=e.count;n<t;n++)e.rows[n].questionId&&(r.hasIdAnswers=!0,r.answers.hasOwnProperty(e.rows[n].questionId)||(r.answers[e.rows[n].questionId]={question:e.rows[n].question,answers:{},sum:0}),""===e.rows[n].answer&&(e.rows[n].answer="NO_ANSWER"),r.answers[e.rows[n].questionId].answers[e.rows[n].answer]?r.answers[e.rows[n].questionId].answers[e.rows[n].answer]+=1:r.answers[e.rows[n].questionId].answers[e.rows[n].answer]=1,r.answers[e.rows[n].questionId].sum+=1)}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","Auth","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var n=this;n.project={},n.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},n.init=function(e){n.project=e,_.isObjectLike(e.formData)?n.project.formData=e.formData:n.isJsonString(e.formData)?n.project.formData=JSON.parse(e.formData):n.project.formData={}},n.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=s,r.title=o.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),t.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,n){var o=this;o.project={},o.responseData={},o.formViewer={},o.init=function(e){o.project=e,n.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&o.project.formData&&o.project.formData.pages)for(var t=0,a=o.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&o.project.formData.pages[t].elements)for(var i=0,s=o.project.formData.pages[t].elements.length;i<s;i++)"question"===o.project.formData.pages[t].elements[i].type&&o.project.formData.pages[t].elements[i].question&&delete o.responseData[o.project.formData.pages[t].elements[i].question.id]})},o.onSubmit=function(e){var n=a.defer(),t=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(t).then(function(){n.resolve(!0)},function(){n.reject()}),n.promise},o.resetViewer=function(){o.formViewer.reset&&o.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.projectSessions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.jscriptyProject.getSessions(m.query,u).$promise}function g(e){d.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(m.projectSessions.rows,{id:e.id}),m.projectSessions.count-=1,m.projectSessions.rows.length||p(),l.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.project={},m.projectSessions={count:0,rows:[]},m.selectedProjectSessions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},m.init=function(e,n,t){m.project=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.project.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("session #")+e.id||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getProjectSessions=p,m.createOrEditProjectSession=function(e,n){o.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:m.project,session:n,sessions:m.projectSessions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showQuestionsProjectSession=function(e,t){o.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:t.id})}]},locals:{project:m.project,session:t}})},m.exportSelectedProjectSessions=function(){var e=angular.copy(m.selectedProjectSessions);return m.selectedProjectSessions=[],e},m.deleteProjectSession=g,m.deleteSelectedProjectSessions=function(e){var n=o.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+m.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedProjectSessions.forEach(function(e){g(e)}),m.selectedProjectSessions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=s,this.questions=o,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.project=c||e.params.project||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.clonedialog=function(e,n){t.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:p.projects?p.projects.rows:[],crudPermissions:p.crudPermissions}})},p.alert=l.info,p.gotoProjects=function(){e.go("app.jscripty.projects",{},{reload:"app.jscripty.projects"})},p.saveProject=function(){r.jscriptyProject.update({id:p.project.id},p.project).$promise.then(function(){l.success({title:"Project updated!",msg:p.project.name?p.project.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","project","userProfile","userProfileSection"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.projects=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="projects",f.listOrder="",f.listOrderAsc=null,f.selectedProjects=[],f.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,project:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:f.projects?f.projects.rows:[],crudPermissions:f.crudPermissions}})},f.sessionsgoto=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,tab:3})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("project")+"?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getProjects=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.jscriptyProject.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Projects",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditProject=function(e,n){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:f.projects.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteProject=y,f.exportSelectedProjects=function(){var e=angular.copy(f.selectedProjects);return f.selectedProjects=[],e},f.deleteSelectedProjects=function(e){var n=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+f.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedProjects.forEach(function(e){y(e)}),f.selectedProjects=[]})},f.deselectProjects=function(){f.selectedProjects=[]},f.selectAllProjects=function(){f.selectedProjects=f.projects.rows};var b=!0,A=1;function E(e){f.projects=e||{count:0,rows:[]}}function y(e){m.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(f.projects.rows,{id:e.id}),f.projects.count-=1,f.projects.rows.length||f.getProjects(),p.success({title:_.startCase("Project")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","projects","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m,u){var p,g=this;function v(e){t.hide(e)}g.currentUser=l.getCurrentUser(),g.errors=[],g.setting=c,g.license=d,g.crudPermissions=m,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.mailAccount=angular.copy(s),g.mailAccounts=n,g.cloudProviders=o,g.providers=u.getEmailProviders(),g.newMailAccount=!1,g.mailAccount||(g.mailAccount={active:!0,service:"null",authentication:!0,fontSize:13,waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.newMailAccount=!0),e.params.id&&(g.mailAccount.MailAccountId=e.params.id),g.addNewMailAccount=function(){g.errors=[],r.mailAccount.save(g.mailAccount).$promise.then(function(e){g.mailAccounts.unshift(e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_CREATED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailAccount=function(){g.errors=[],r.mailAccount.update({id:g.mailAccount.id},g.mailAccount).$promise.then(function(e){var n=_.find(g.mailAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailAccount=function(e){if(g.mailAccount.service)return i.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});g.errors=[];var n=t.confirm().title(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:g.mailAccount.name})).ariaLabel("Delete Mail Account").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.mailAccount.delete({id:g.mailAccount.id}).$promise.then(function(){_.remove(g.mailAccounts,{id:g.mailAccount.id}),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")}),v(g.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.onProviderChange=function(){"custom"!==g.mailAccount.provider&&(g.mailAccount.authentication=!0);"outlook365"!==g.mailAccount.provider&&(g.mailAccount.modernAuthentication=!1)},g.closeDialog=v,p=[{key:"id",value:Number(g.mailAccount.ListId)}],r.getResourcesByRole(g.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},p).then(function(e){g.lists=e.rows}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$mdDialog","$translate","toasty","mailAccounts","mailAccount","cloudProviders","api","Auth","license","setting","crudPermissions","msUtils"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:t,mailAccount:r.mailAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[n]=e:r.mailAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.mailAccountApps.rows.length;t++,0){var a=r.mailAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:601}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Reply_Type",name:"replyType",type:"select",defaultValue:"1",values:[{option:"Reply",value:"0"},{option:"Reply All",value:"1"}],required:!0,param:1},{title:"Text",name:"text",type:"html",required:!0,param:2}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.mailAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=o.mailAccount.getApplications(r.query,t).$promise},r.editMailAccountApp=n,r.editInterval=function(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailAccount.getAgents({id:c.mailAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailAccount?"penalty "+e.UserMailAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.removeAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.addAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailAccount","mailAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.agent.text=d.slice(2,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.autoreply.text=d.slice(2,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.replyType=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.autoreply.text=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.autoreply.times=1,l.autoreply.replyType=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.replyType,e[2]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.close.text=d.slice(2,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotoif.text=d.slice(2,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotop.text=d.slice(2,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.noop.text=d.slice(2,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.queue.text=d.slice(2,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("mail")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:601}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.system.text=d.slice(2,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.tag.text=d.slice(2,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"mailAccount",action:"getDispositions",field:"name",params:{id:m.mailAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.mailAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.mailAccountInteractions.rows.length;n+=1){var t=m.mailAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,(void 0===m.query.closed||null===m.query.closed||m.query.closed)&&delete m.query.substatus,m.promise=d.mailInteraction.get(m.query,p).$promise}function v(e){d.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountInteractions.rows,{id:e.id}),m.mailAccountInteractions.count-=1,m.mailAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){_.isEmpty(e.to)||_.includes(e.to,m.mailAccount.email)?e.contactInfo=e.Contact?e.Contact.email:void 0:(e.contactName=e.to.split(" <")[0],e.contactInfo=e.to.split("<").pop().split(">")[0]),"Unknown"===e.contactName&&(e.contactName=i.instant("MAIL.UNKNOWN"))}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountInteractions={count:0,rows:[]},m.selectedMailAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){m.subStatuses=e||{count:0,rows:[]}})}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:m.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.mailInteractionDownload=function(s,e,n){return d.mailInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="mail-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getMailAccountInteractions=g,m.createOrEditMailAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,interaction:n,interactions:m.mailAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spymailInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"mail",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"mail.mailAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||MailAccountId:=$eq["+m.mailAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedMailAccountInteractions=function(){var e=angular.copy(m.selectedMailAccountInteractions);return m.selectedMailAccountInteractions=[],e},m.deleteMailAccountInteraction=v,m.deleteSelectedMailAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountInteractions.forEach(function(e){v(e)}),m.selectedMailAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.mailAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountMailCannedAnswers.rows,{id:e.id}),m.mailAccountMailCannedAnswers.count-=1,m.mailAccountMailCannedAnswers.rows.length||p(),l.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountMailCannedAnswers={count:0,rows:[]},m.selectedMailAccountMailCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mailCannedAnswer #")+e.id||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getMailAccountMailCannedAnswers=p,m.createOrEditMailAccountMailCannedAnswer=function(e,n){o.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,mailCannedAnswer:n,mailCannedAnswers:m.mailAccountMailCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(m.selectedMailAccountMailCannedAnswers);return m.selectedMailAccountMailCannedAnswers=[],e},m.deleteMailAccountMailCannedAnswer=g,m.deleteSelectedMailAccountMailCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+m.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),m.selectedMailAccountMailCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILCANNEDANSWER",g.mailCannedAnswer=angular.copy(l),g.mailCannedAnswers=r,g.newMailCannedAnswer=!1,g.mailCannedAnswer||(g.mailCannedAnswer={},g.title="MAIL.NEW_MAILCANNEDANSWER",g.newMailCannedAnswer=!0),n.params.id&&(g.mailCannedAnswer.MailAccountId=n.params.id),g.addNewMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.mailCannedAnswer).$promise.then(function(e){g.mailCannedAnswers.unshift(e.toJSON()),o.success({title:"MailCannedAnswer properly created",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.mailCannedAnswer.id},g.mailCannedAnswer).$promise.then(function(e){var n=_.find(g.mailCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailCannedAnswer properly saved!",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.mailCannedAnswer.id}).$promise.then(function(){_.remove(g.mailCannedAnswers,{id:g.mailCannedAnswer.id}),o.success({title:"MailCannedAnswer properly deleted!",msg:(g.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),v(g.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.mailAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.mailAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.mailAccount.id,field:"MailAccountId",route:"mailAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.mail").controller("MailAccountDispositionsController",e)}(),function(){"use strict";function e(t,a,i,s,e,n,o,r,l,d,c,m,u,p,g){var v,h,f=this;f.currentUser=d.getCurrentUser(),f.license=n,f.setting=o,f.passwordPattern=f.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",f.mailAccount=c||t.params.mailAccount||{},f.cloudProviders=m||{rows:[],count:0},f.userProfile=u,f.userProfileSection=p&&1==p.count?p.rows[0]:null,f.crudPermissions=d.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.hasModulePermissions={},f.selectedTab=t.params.tab||0,f.providers=g.getEmailProviders(),f.originalProvider=f.mailAccount.provider,f.goToRealtime=function(){return d.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},f.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:f.mailAccounts?f.mailAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.goToMailAccounts=function(){t.go("app.mail.mailAccounts",{},{reload:"app.mail.mailAccounts"})},f.saveMailAccount=function(){var e=angular.copy(f.mailAccount);"custom"===e.provider?e.provider=null:(f.originalProvider!==e.provider&&(e.Imap.modernAuthentication?e.Imap.password=null:e.Imap.CloudProviderId=null),e.Smtp.user=e.Imap.user,e.Smtp.pass=e.Imap.password,e.Imap.modernAuthentication||(e.Imap.CloudProviderId=null),e.Smtp.modernAuthentication=e.Imap.modernAuthentication,e.Smtp.CloudProviderId=e.Imap.CloudProviderId,e.Imap=_.omit(e.Imap,["host","port","service"]),e.Smtp=_.omit(e.Smtp,["host","port","secure","service"]));r.mailAccount.update({id:f.mailAccount.id},e).$promise.then(function(){f.originalProvider=e.provider,l.success({title:s.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.onProviderChange=function(){"custom"!==f.mailAccount.provider&&(f.mailAccount.authentication=!0);"outlook365"!==f.mailAccount.provider&&(f.mailAccount.Imap.modernAuthentication=!1)},e.all((h=[{key:"id",value:Number(f.mailAccount.ListId)}],r.getResourcesByRole(f.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},h).then(function(e){f.lists=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})),(v=[{key:"id",value:Number(f.mailAccount.mandatoryDispositionPauseId)}],r.getResourcesByRole(f.currentUser,"pause",{fields:"id,name",sort:"name",nolimit:"true"},v).then(function(e){f.pauses=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))}e.$inject=["$state","$mdDialog","$document","$translate","$q","license","setting","api","toasty","Auth","mailAccount","cloudProviders","userProfile","userProfileSection","msUtils"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u,p){var g=this;function v(e){g.mailAccounts=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.hasRole("admin")?g.promise=d.mailAccount.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="MailAccounts",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){if(e.service)return c.error({msg:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_SERVICE_DELETE")});d.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(g.mailAccounts.rows,{id:e.id}),g.mailAccounts.count-=1,g.mailAccounts.rows.length||h(),c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.mailAccounts=n||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedMailAccounts=[],g.query={fields:"createdAt,updatedAt,id,name,key,email,ListId,active,provider,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},g.editstate=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e,crudPermissions:g.crudPermissions})},g.verifySMTP=function(e){return e&&e.id?d.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){c.success({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString()})}):c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:o.instant("MAIL.NOTIFICATIONS.UNKNOWN_SMTP_SERVER")})},g.goToInteractions=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,tab:"custom"===e.provider?7:6})},g.goToRealtime=function(){return m.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):d.userProfileSection.get({userProfileId:m.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});c.info({title:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},g.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:g.mailAccounts?g.mailAccounts.rows:[],crudPermissions:g.crudPermissions,realtime:!1}})},g.deleteconfirm=function(e,n){var t=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete mail account").targetEvent(n).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.success=v,g.getMailAccounts=h,g.createOrEditMailAccount=function(e,n){a.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:n,mailAccounts:g.mailAccounts.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]}})},g.deleteMailAccount=f,g.exportSelectedMailAccounts=function(){var e=angular.copy(g.selectedMailAccounts);return g.selectedMailAccounts=[],e},g.deleteSelectedMailAccounts=function(e){var n=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_MESSAGE",{total:g.selectedMailAccounts.length})).ariaLabel("delete mail accounts").targetEvent(e).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedMailAccounts.forEach(function(e){f(e)}),g.selectedMailAccounts=[],c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETED_SUCCESS_TITLE")})})},g.deselectMailAccounts=function(){g.selectedMailAccounts=[]},g.selectAllMailAccounts=function(){g.selectedMailAccounts=g.mailAccounts.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?s(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","mailAccounts","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="MAIL.EDIT_MAILQUEUE",r.mailQueue=angular.copy(n),r.mailQueues=e,r.newMailQueue=!1,r.mailQueue||(r.mailQueue={strategy:"beepall",timeout:10},r.title="MAIL.NEW_MAILQUEUE",r.newMailQueue=!0),r.addNewMailQueue=function(){r.errors=[],i.mailQueue.save(r.mailQueue).$promise.then(function(e){r.mailQueues.unshift(e.toJSON()),a.success({title:"MailQueue properly created",msg:r.mailQueue.name?r.mailQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveMailQueue=function(){r.errors=[],i.mailQueue.update({id:r.mailQueue.id},r.mailQueue).$promise.then(function(e){var n=_.find(r.mailQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"MailQueue properly saved!",msg:r.mailQueue.name?r.mailQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteMailQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.mailQueue.delete({id:r.mailQueue.id}).$promise.then(function(){_.remove(r.mailQueues,{id:r.mailQueue.id}),a.success({title:"MailQueue properly deleted!",msg:(r.mailQueue.name||"mailQueue")+" has been deleted!"}),l(r.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","mailQueues","mailQueue","api","Auth","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getAgents({id:c.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getTeams({id:l.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.mailQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MAIL.ALL_TEAMS"),labelSelected:t.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.mailQueue=c||e.params.mailQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailQueues=function(){e.go("app.mail.mailQueues",{},{reload:"app.mail.mailQueues"})},u.saveMailQueue=function(){r.mailQueue.update({id:u.mailQueue.id},u.mailQueue).$promise.then(function(){l.success({title:"MailQueue updated!",msg:u.mailQueue.name?u.mailQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailQueue","userProfileSection"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailQueues",f.listOrder="",f.listOrderAsc=null,f.selectedMailQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailQueue")+"?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.mail.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.mail.realtime.queues",{})}},f.success=E,f.getMailQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailQueue=function(e,n){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:f.mailQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteMailQueue=y,f.exportSelectedMailQueues=function(){var e=angular.copy(f.selectedMailQueues);return f.selectedMailQueues=[],e},f.deleteSelectedMailQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+f.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailQueues.forEach(function(e){y(e)}),f.selectedMailQueues=[]})},f.deselectMailQueues=function(){f.selectedMailQueues=[]},f.selectAllMailQueues=function(){f.selectedMailQueues=f.mailQueues.rows};var b=!0,A=1;function E(e){f.mailQueues=e||{count:0,rows:[]}}function y(e){m.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.mailQueues.rows,{id:e.id}),f.mailQueues.count-=1,f.mailQueues.rows.length||f.getMailQueues(),p.success({title:_.startCase("MailQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILSUBSTATUS",g.mailSubstatus=angular.copy(l),g.mailSubtatuses=r,g.newMailSubstatus=!1,g.mailSubstatus||(g.mailSubstatus={},g.title="MAIL.NEW_MAILSUBSTATUS",g.newMailSubstatus=!0),g.addNewMailSubstatus=function(){g.errors=[],d.mailSubstatus.save(g.mailSubstatus).$promise.then(function(e){g.mailSubtatuses.unshift(e.toJSON()),o.success({title:"MailSubstatus properly created",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailSubstatus=function(){g.errors=[],d.mailSubstatus.update({id:g.mailSubstatus.id},g.mailSubstatus).$promise.then(function(e){var n=_.find(g.mailSubtatuses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailSubstatus properly saved!",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailSubstatus=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.mailSubstatus.delete({id:g.mailSubstatus.id}).$promise.then(function(){_.remove(g.mailSubtatuses,{id:g.mailSubstatus.id}),o.success({title:"MailSubstatus properly deleted!",msg:(g.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),v(g.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailSubtatuses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailSubtatuses",f.listOrder="",f.listOrderAsc=null,f.selectedMailSubstatuses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailSubstatus")+"?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMailSubstatuses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailSubstatus.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailSubstatuses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailSubstatus=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:n,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMailSubstatus=y,f.exportSelectedMailSubstatuses=function(){var e=angular.copy(f.selectedMailSubstatuses);return f.selectedMailSubstatuses=[],e},f.deleteSelectedMailSubstatuses=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+f.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailSubstatuses.forEach(function(e){y(e)}),f.selectedMailSubstatuses=[]})},f.deselectMailSubstatuses=function(){f.selectedMailSubstatuses=[]},f.selectAllMailSubstatuses=function(){f.selectedMailSubstatuses=f.mailSubtatuses.rows};var b=!0,A=1;function E(e){f.mailSubtatuses=e||{count:0,rows:[]}}function y(e){m.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(f.mailSubtatuses.rows,{id:e.id}),f.mailSubtatuses.count-=1,f.mailSubtatuses.rows.length||f.getMailSubstatuses(),p.success({title:_.startCase("MailSubstatus")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailSubtatuses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d){var c=this,m=d&&1==d.count?d.rows[0].crudPermissions:null;function u(){c.mailAccounts.rows.forEach(function(n){var e=_.find(c.rpcMailAccounts.rows,["id",n.id]);e&&_.merge(n,e);var t={id:n.id,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};i.mailAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",i.mailAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){o.error(e.data?e.data.message:e.toString())})})}function p(e){var n=_.find(c.mailAccounts.rows,["id",e.id]);n&&_.merge(n,e)}function g(e){c.mailAccounts.rows=e.rows,u()}function v(){c.query.offset=(c.query.page-1)*c.query.limit,n.hasRole("admin")?c.promise=i.mailAccount.get(c.query,g).$promise:(c.query.id=c.currentUser.userProfileId,c.query.section="MailAccounts",c.promise=i.userProfile.getResources(c.query,g).$promise)}c.currentUser=n.getCurrentUser(),c.mailAccounts=r,c.rpcMailAccounts=l,c.crudPermissions=n.parseCrudPermissions(m),c.query={sort:"name",limit:10,page:1},c.success=g,c.$onInit=u,c.getMailAccounts=v,c.goToMailAccount=function(e,n){a.go("app.mail.mailAccounts.edit",{id:n.id,mailAccount:n})},c.verifySmtp=function(e,n){{if(n&&n.id)return i.mailAccount.verifySmtp({id:n.id}).$promise.then(function(){o.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){o.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});o.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},s.on("mailAccount:save",p),s.on("mailAccount:update",p),s.on("mailMessage:save",function(e){var n=_.find(c.mailAccounts.rows,["id",e.MailAccountId]);n&&("in"==e.direction?(n.in+=1,n.lastIn=e.createdAt):(n.out+=1,n.lastOut=e.createdAt))});var h=!0,f=1;e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),v())}),e.$on("$destroy",function(){s.removeAllListeners("mailAccount:save"),s.removeAllListeners("mailAccount:update"),s.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$state","api","Auth","socket","toasty","mailAccounts","rpcMailAccounts","userProfileSection"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,t.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.mail.realtime.agents");break;case 1:t.go("app.mail.realtime.queues");break;case 2:t.go("app.mail.realtime.accounts");break;default:t.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MARKETPLACE.EDIT_PLUGIN",g.plugin=angular.copy(l),g.plugins=r,g.newPlugin=!1,g.plugin||(g.plugin={},g.title="MARKETPLACE.NEW_PLUGIN",g.newPlugin=!0),g.addNewPlugin=function(){g.errors=[],d.plugin.save(g.plugin).$promise.then(function(e){g.plugins.unshift(e.toJSON()),o.success({title:"Plugin properly created",msg:g.plugin.name?g.plugin.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePlugin=function(){g.errors=[],d.plugin.update({id:g.plugin.id},g.plugin).$promise.then(function(e){var n=_.find(g.plugins,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Plugin properly saved!",msg:g.plugin.name?g.plugin.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePlugin=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The plugin will be deleted.").ariaLabel("Delete Plugin").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.plugin.delete({id:g.plugin.id}).$promise.then(function(){_.remove(g.plugins,{id:g.plugin.id}),o.success({title:"Plugin properly deleted!",msg:(g.plugin.name||"plugin")+" has been deleted!"}),v(g.plugin)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","plugins","plugin","api","Auth","license","setting","crudPermissions"],angular.module("app.marketplace").controller("CreateOrEditPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.plugin=c||e.params.plugin||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoPlugins=function(){e.go("app.marketplace.plugins",{},{reload:"app.marketplace.plugins"})},u.savePlugin=function(){r.plugin.update({id:u.plugin.id},u.plugin).$promise.then(function(){l.success({title:"Plugin updated!",msg:u.plugin.name?u.plugin.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETplugin",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","plugin","userProfileSection"],angular.module("app.marketplace").controller("MarketplacePluginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.plugins=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="plugins",f.listOrder="",f.listOrderAsc=null,f.selectedPlugins=[],f.query={fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,page:1},f.installing=!1,f.arraysidebar=_.keyBy([{option:"Always",value:"'always'"},{option:"Admin Only",value:"'adminOnly'"},{option:"Agent Only",value:"'agentOnly'"},{option:"Never",value:"'never'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.installplugin=function(e){{if("script"!==e.type)return e.active=!0,m.plugin.update({id:e.id},e).$promise.then(function(){p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});f.installing=!0,m.pm2.save({name:e.scriptName,script:e.path+"/"+e.scriptPath}).$promise.then(function(){return e.active=!0,m.plugin.update({id:e.id},e).$promise}).then(function(){f.installing=!1,p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.save"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.save",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}},f.editstate=function(e,n){t.go("app.marketplace.plugins.edit",{id:e.id,plugin:e,crudPermissions:f.crudPermissions})},f.stopplugin=function(e,n){var t=i.confirm().title("Are you sure want to stop the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be stoppped.").ariaLabel("stop plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"stopped"}).$promise.then(function(){p.success({title:"Process stopped!",msg:"Attached pm2 process successfully stopped"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.restartplugin=function(e,n){var t=i.confirm().title("Are you sure want to restart the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be restarted.").ariaLabel("restart plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"online"}).$promise.then(function(){p.success({title:"Process restarted!",msg:"Attached pm2 process successfully restarted"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.downloadfile2=function(s,e){return m.plugin.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.name.replace(" ","_").toLowerCase()+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.uninstallplugin=function(e,n){var t=i.confirm().title("Are you sure want to uninstall the plugin?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be uninstalled.").ariaLabel("uninstall plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){!function(t){"script"===t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});t.active=!1,m.plugin.update({id:t.id},t).$promise.then(function(){p.success({title:"Plugin uninstalled!",msg:t.name?t.name+" has been uninstalled!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}(e)},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("plugin")+"?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be deleted.").ariaLabel("delete plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPlugins=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.plugin.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Plugins",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPlugin=function(e,n){i.show({controller:"CreateOrEditPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugin:n,plugins:f.plugins.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePlugin=y,f.exportSelectedPlugins=function(){var e=angular.copy(f.selectedPlugins);return f.selectedPlugins=[],e},f.deleteSelectedPlugins=function(e){var n=i.confirm().title("Are you sure want to delete the selected plugins?").htmlContent("<b>"+f.selectedPlugins.length+" selected</b> will be deleted.").ariaLabel("delete Plugins").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPlugins.forEach(function(e){y(e)}),f.selectedPlugins=[]})},f.deselectPlugins=function(){f.selectedPlugins=[]},f.selectAllPlugins=function(){f.selectedPlugins=f.plugins.rows},f.uploadPlugin=function(e){i.show({controller:"UploadPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugins:f.plugins.rows}})};var b=!0,A=1;function E(e){f.plugins=e||{count:0,rows:[]}}function y(t){t.active&&"script"==t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)return p.error({title:"Plugin not deleted!",msg:"Failed to retrieve pm2 processes"});var n=_.find(e.rows,{name:t.scriptName});n?m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise:console.log("No '%s' process found",t.scriptName)}).catch(function(e){return p.error({title:"PM2 process not found!",msg:"Failed to delete the attached pm2 process"})}),m.plugin.delete({id:t.id}).$promise.then(function(){_.remove(f.plugins.rows,{id:t.id}),f.plugins.count-=1,f.plugins.rows.length||f.getPlugins(),p.success({title:_.startCase("Plugin")+" deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEplugin"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEplugin",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPlugins())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","plugins","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.marketplace").controller("MarketplacePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=4,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="MARKETPLACE.UPLOAD_PLUGIN",o.plugins=a,o.uploadPlugins=[],o.uploadState="none",o.plugin={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/plugins"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["zip"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.plugin={id:e.uniqueIdentifier,file:e},o.uploadPlugins.unshift(o.plugin),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.plugins.unshift(JSON.parse(e)),angular.forEach(o.uploadPlugins,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the plugin"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.plugin.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","plugins","api","Auth"],angular.module("app.marketplace").controller("UploadPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=c.getCurrentUser(),v.errors=[],v.setting=u,v.license=m,v.crudPermissions=p,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="MOTIONDIALER.EDIT_HOPPER",v.hopper=angular.copy(l),v.hoppers=r,v.newHopper=!1,v.contact,v.dateTime,v.hopper||(v.hopper={},v.title="MOTIONDIALER.NEW_HOPPER",v.newHopper=!0),n.params.id&&("IvrCampaign"===g?v.hopper.CampaignId=n.params.id:"QueueCampaign"==g?v.hopper.VoiceQueueId=n.params.id:v.hopper.ContactId=n.params.id),v.addNewHopper=function(){v.errors=[],d.cmHopper.save(v.hopper).$promise.then(function(e){v.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:v.hopper.name?v.hopper.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveHopper=function(){var t,a,i,s;v.errors=[],v.hopper.UserId=v.hopper.recallme?v.hopper.UserId:null,v.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:v.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){v.hopper.dialTimezone=v.contact.dialTimezone,d.cmHopper.update({id:v.hopper.id},_.omit(v.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:v.contact.dialTimezone})})})});var n=_.find(v.hoppers,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"Hopper properly saved!",msg:v.hopper.name?v.hopper.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},v.deleteHopper=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:v.hopper.id}).$promise.then(function(){_.remove(v.hoppers,{id:v.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(v.hopper.name||"hopper")+" has been deleted!"}),h(v.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h,v.recalcTZTime=function(){if(_.isNil(v.hopper.VoiceQueueId)){var e=v.hopper.CampaignId;d.campaign.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}else{var e=v.hopper.VoiceQueueId;e&&d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(v.agents,{id:e.resourceId})}),t=null;if(v.hopper&&(t=_.find(v.agents,{id:Number(v.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(v.agents,{id:t.id});a.canSelect=!1,n.push(a)}v.agents=n})}else{var t=[],a=null;v.hopper&&(a=_.find(v.agents,{id:Number(v.hopper.UserId)}));for(var i=0;i<v.agents.length;i++)a&&v.agents[i].id===a.id&&(v.agents[i].canSelect=!1,t.push(v.agents[i]));v.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.cmContact.get({id:v.hopper.ContactId,fields:"dialTimezone"}).$promise.then(function(e){var n;v.contact=e,_.isNil(v.hopper.VoiceQueueId)?(n=v.hopper.CampaignId)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=v.hopper.VoiceQueueId)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions","from"],angular.module("app.motiondialer").controller("HopperdateController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",g.ivrCampaign=angular.copy(l),g.ivrCampaigns=r,g.newIvrCampaign=!1,g.ivrCampaign||(g.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",dialCutDigit:0,limitCalls:30,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},g.title="MOTIONDIALER.NEW_IVRCAMPAIGN",g.newIvrCampaign=!0),g.addNewIvrCampaign=function(){g.errors=[],d.campaign.save(g.ivrCampaign).$promise.then(function(e){g.ivrCampaigns.unshift(e.toJSON()),o.success({title:"IvrCampaign properly created",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveIvrCampaign=function(){g.errors=[],d.campaign.update({id:g.ivrCampaign.id},g.ivrCampaign).$promise.then(function(e){var n=_.find(g.ivrCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"IvrCampaign properly saved!",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteIvrCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.campaign.delete({id:g.ivrCampaign.id}).$promise.then(function(){_.remove(g.ivrCampaigns,{id:g.ivrCampaign.id}),o.success({title:"IvrCampaign properly deleted!",msg:(g.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),v(g.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})});g.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.trunks=n})}else g.trunks=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.projects,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.projects,{id:t.id});a.canSelect=!1,n.push(a)}g.projects=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)}));for(var i=0;i<g.projects.length;i++)a&&g.projects[i].id===a.id&&(g.projects[i].canSelect=!1,t.push(g.projects[i]));g.projects=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newIvrCampaign=!0,r.ivrCampaign=angular.copy(i),r.ivrCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_IVRCAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneIvrCampaign=function(){return e.campaign.clone({id:i.id},r.ivrCampaign).$promise.then(function(e){r.ivrCampaigns.unshift(e.toJSON()),a.success({title:"IvrCampaign properly cloned",msg:r.ivrCampaign.name?r.ivrCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","ivrCampaign","ivrCampaigns","$translate"],angular.module("app.motiondialer").controller("IvrCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperBlacks.rows,{id:e.id}),m.ivrCampaignHopperBlacks.count-=1,m.ivrCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperBlacks={count:0,rows:[]},m.selectedIvrCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperBlacks=p,m.createOrEditIvrCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperBlack:n,hopperBlacks:m.ivrCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(m.selectedIvrCampaignHopperBlacks);return m.selectedIvrCampaignHopperBlacks=[],e},m.deleteIvrCampaignHopperBlack=g,m.deleteSelectedIvrCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperFinals.rows,{id:e.id}),m.ivrCampaignHopperFinals.count-=1,m.ivrCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.ivrCampaign={},m.ivrCampaignHopperFinals={count:0,rows:[]},m.selectedIvrCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperFinals=p,m.createOrEditIvrCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperFinal:n,hopperFinals:m.ivrCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(m.selectedIvrCampaignHopperFinals);return m.selectedIvrCampaignHopperFinals=[],e},m.deleteIvrCampaignHopperFinal=g,m.deleteSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperFinals=[]})},m.moveIvrCampaignHopperFinal=v,m.moveContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedIvrCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperHistories.rows,{id:e.id}),m.ivrCampaignHopperHistories.count-=1,m.ivrCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperHistories={count:0,rows:[]},m.selectedIvrCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperHistories=p,m.createOrEditIvrCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperHistory:n,hopperHistories:m.ivrCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(m.selectedIvrCampaignHopperHistories);return m.selectedIvrCampaignHopperHistories=[],e},m.deleteIvrCampaignHopperHistory=g,m.deleteSelectedIvrCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHoppers.rows,{id:e.id}),m.ivrCampaignHoppers.count-=1,m.ivrCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHoppers={count:0,rows:[]},m.selectedIvrCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHoppers=p,m.createOrEditIvrCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopper:n,hoppers:m.ivrCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"IvrCampaign"}})},m.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(m.selectedIvrCampaignHoppers);return m.selectedIvrCampaignHoppers=[],e},m.deleteIvrCampaignHopper=g,m.deleteSelectedIvrCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),m.selectedIvrCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})});m.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),m.agents=n})}else m.agents=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.CampaignId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})});g.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.agents=n})}else g.agents=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.ivrCampaign={},i.init=function(n){i.ivrCampaign=n,t.cmHopper.get({limit:0,CampaignId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,CampaignId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,CampaignId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return i.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.ivrCampaign=c||t.params.ivrCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.resetlistdialog=function(n,t){r.campaign.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.ivrCampaign.id,n=a.rows[0],t=n.id,r.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return r.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{ivrCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},u.alert=l.info,u.gotoIvrCampaigns=function(){t.go("app.motiondialer.ivrCampaigns",{},{reload:"app.motiondialer.ivrCampaigns"})},u.saveIvrCampaign=function(){r.campaign.update({id:u.ivrCampaign.id},u.ivrCampaign).$promise.then(function(){l.success({title:"IvrCampaign updated!",msg:u.ivrCampaign.name?u.ivrCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})});u.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.trunks=n})}else u.trunks=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","ivrCampaign","userProfileSection"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.ivrCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="ivrCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedIvrCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("ivrCampaign")+"?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},f.success=E,f.getIvrCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.campaign.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="IvrCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditIvrCampaign=function(e,n){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:f.ivrCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteIvrCampaign=y,f.exportSelectedIvrCampaigns=function(){var e=angular.copy(f.selectedIvrCampaigns);return f.selectedIvrCampaigns=[],e},f.deleteSelectedIvrCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+f.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIvrCampaigns.forEach(function(e){y(e)}),f.selectedIvrCampaigns=[]})},f.deselectIvrCampaigns=function(){f.selectedIvrCampaigns=[]},f.selectAllIvrCampaigns=function(){f.selectedIvrCampaigns=f.ivrCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})});f.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.trunks=n})}else f.trunks=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.projects,{id:e.resourceId})}),a=null;a=[],f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),f.projects=t})}else{var t=[],a=[];f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)});for(var i=0;i<f.projects.length;i++){_.some(a,{id:f.projects[i].id})&&(f.projects[i].canSelect=!1,t.push(f.projects[i]))}f.projects=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.ivrCampaign&&(t=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.ivrCampaign&&(a=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.ivrCampaigns=e||{count:0,rows:[]}}function y(e){m.campaign.delete({id:e.id}).$promise.then(function(){_.remove(f.ivrCampaigns.rows,{id:e.id}),f.ivrCampaigns.count-=1,f.ivrCampaigns.rows.length||f.getIvrCampaigns(),p.success({title:_.startCase("IvrCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","ivrCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",g.queueCampaign=angular.copy(l),g.queueCampaigns=r,g.newQueueCampaign=!1,g.queueCampaign||(g.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",dialCutDigit:0,autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,callAdditionalPhoneAfterMin:3,dialPredictiveIntervalMaxThreshold:20,dialPredictiveIntervalMinThreshold:10},g.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",g.newQueueCampaign=!0),g.addNewQueueCampaign=function(){g.errors=[],d.voiceQueue.save(g.queueCampaign).$promise.then(function(e){g.queueCampaigns.unshift(e.toJSON()),o.success({title:"QueueCampaign properly created",msg:g.queueCampaign.name?g.queueCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveQueueCampaign=function(){g.errors=[],d.voiceQueue.update({id:g.queueCampaign.id},g.queueCampaign).$promise.then(function(e){var n=_.find(g.queueCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"QueueCampaign properly saved!",msg:g.queueCampaign.name?g.queueCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteQueueCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceQueue.delete({id:g.queueCampaign.id}).$promise.then(function(){_.remove(g.queueCampaigns,{id:g.queueCampaign.id}),o.success({title:"QueueCampaign properly deleted!",msg:(g.queueCampaign.name||"queueCampaign")+" has been deleted!"}),v(g.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.queueCampaign=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newQueueCampaign=!0,r.queueCampaign=angular.copy(i),r.queueCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_QUEUECAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneQueueCampaign=function(){return e.voiceQueue.clone({id:i.id},r.queueCampaign).$promise.then(function(e){r.queueCampaigns.unshift(e.toJSON()),a.success({title:"QueueCampaign properly cloned",msg:r.queueCampaign.name?r.queueCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.queueCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","queueCampaign","queueCampaigns","$translate"],angular.module("app.motiondialer").controller("QueueCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperBlacks.rows,{id:e.id}),m.queueCampaignHopperBlacks.count-=1,m.queueCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperBlacks={count:0,rows:[]},m.selectedQueueCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperBlacks=p,m.createOrEditQueueCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperBlack:n,hopperBlacks:m.queueCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(m.selectedQueueCampaignHopperBlacks);return m.selectedQueueCampaignHopperBlacks=[],e},m.deleteQueueCampaignHopperBlack=g,m.deleteSelectedQueueCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperFinals.rows,{id:e.id}),m.queueCampaignHopperFinals.count-=1,m.queueCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.queueCampaign={},m.queueCampaignHopperFinals={count:0,rows:[]},m.selectedQueueCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,secondDisposition,thirdDisposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperFinals=p,m.createOrEditQueueCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperFinal:n,hopperFinals:m.queueCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(m.selectedQueueCampaignHopperFinals);return m.selectedQueueCampaignHopperFinals=[],e},m.deleteQueueCampaignHopperFinal=g,m.deleteSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperFinals=[]})},m.moveQueueCampaignHopperFinal=v,m.moveContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedQueueCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperHistories.rows,{id:e.id}),m.queueCampaignHopperHistories.count-=1,m.queueCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperHistories={count:0,rows:[]},m.selectedQueueCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperHistories=p,m.createOrEditQueueCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperHistory:n,hopperHistories:m.queueCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(m.selectedQueueCampaignHopperHistories);return m.selectedQueueCampaignHopperHistories=[],e},m.deleteQueueCampaignHopperHistory=g,m.deleteSelectedQueueCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHoppers.rows,{id:e.id}),m.queueCampaignHoppers.count-=1,m.queueCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHoppers={count:0,rows:[]},m.selectedQueueCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHoppers=p,m.createOrEditQueueCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopper:n,hoppers:m.queueCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"QueueCampaign"}})},m.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(m.selectedQueueCampaignHoppers);return m.selectedQueueCampaignHoppers=[],e},m.deleteQueueCampaignHopper=g,m.deleteSelectedQueueCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),m.selectedQueueCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})}),t=null;if(m.queueCampaign&&(t=_.find(m.agents,{id:Number(m.queueCampaign.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.agents,{id:t.id});a.canSelect=!1,n.push(a)}m.agents=n})}else{var t=[],a=null;m.queueCampaign&&(a=_.find(m.agents,{id:Number(m.queueCampaign.UserId)}));for(var i=0;i<m.agents.length;i++)a&&m.agents[i].id===a.id&&(m.agents[i].canSelect=!1,t.push(m.agents[i]));m.agents=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}function h(){console.log("recalcTZTime hopper",g.hopper);var e=g.hopper.Queue.id;if(e)d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(g.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})});else{d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})}});else{d.cmHopper.getTimezone({id:g.hopper.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.recalcTZTime=h,e.$watch("vm.contact.dialTimezone",function(){h()}),g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.VoiceQueueId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,g.hopper.dialTimezone=g.contact.dialTimezone,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:g.contact.dialTimezone})})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.dateTime,g.contact,d.cmContact.get({id:g.hopper.Contact.id,fields:"dialTimezone"}).$promise.then(function(e){var n;g.contact=e,console.log("initTZTime hopper",g.hopper),_.isNil(g.hopper.Queue.id)?(n=g.hopper.Campaign.id)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=g.hopper.Queue.id)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})}),g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})}),t=null;if(g.hopper&&(t=_.find(g.agents,{id:Number(g.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.agents,{id:t.id});a.canSelect=!1,n.push(a)}g.agents=n})}else{var t=[],a=null;g.hopper&&(a=_.find(g.agents,{id:Number(g.hopper.UserId)}));for(var i=0;i<g.agents.length;i++)a&&g.agents[i].id===a.id&&(g.agents[i].canSelect=!1,t.push(g.agents[i]));g.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.queueCampaign={},i.init=function(n){i.queueCampaign=n,t.cmHopper.get({limit:0,VoiceQueueId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,VoiceQueueId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,VoiceQueueId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.queueCampaign=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.queueCampaign.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.queueCampaign=c||t.params.queueCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.resetlistdialog=function(n,t){r.voiceQueue.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.queueCampaign.id,n=a.rows[0],t=n.id,r.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return r.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{queueCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},u.alert=l.info,u.gotoQueueCampaigns=function(){t.go("app.motiondialer.queueCampaigns",{},{reload:"app.motiondialer.queueCampaigns"})},u.saveQueueCampaign=function(){r.voiceQueue.update({id:u.queueCampaign.id},u.queueCampaign).$promise.then(function(){l.success({title:"QueueCampaign updated!",msg:u.queueCampaign.name?u.queueCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.musiconholds,{name:u.queueCampaign.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.trunks,{id:t.id});a.canSelect=!1,n.push(a)}u.trunks=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,t.push(u.trunks[i]));u.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.projects,{name:u.queueCampaign.dialQueueProject})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.projects,{name:u.queueCampaign.dialQueueProject}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","queueCampaign","userProfileSection"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.queueCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="queueCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedQueueCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,callAdditionalPhoneAfterMin,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("queueCampaign")+"?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},f.success=E,f.getQueueCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="QueueCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditQueueCampaign=function(e,n){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:f.queueCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteQueueCampaign=y,f.exportSelectedQueueCampaigns=function(){var e=angular.copy(f.selectedQueueCampaigns);return f.selectedQueueCampaigns=[],e},f.deleteSelectedQueueCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+f.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedQueueCampaigns.forEach(function(e){y(e)}),f.selectedQueueCampaigns=[]})},f.deselectQueueCampaigns=function(){f.selectedQueueCampaigns=[]},f.selectAllQueueCampaigns=function(){f.selectedQueueCampaigns=f.queueCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.queueCampaign&&(t=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.queueCampaign&&(a=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.queueCampaigns=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.queueCampaigns.rows,{id:e.id}),f.queueCampaigns.count-=1,f.queueCampaigns.rows.length||f.getQueueCampaigns(),p.success({title:_.startCase("QueueCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","queueCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},!1,g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(e){console.log(e)})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"outbound"===queue.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m){var u=this,p=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function g(){u.campaigns.rows.forEach(function(e){u.rpcCampaigns[e.id]&&_.merge(e,_.pick(u.rpcCampaigns[e.id],p))})}u.currentUser=m.getCurrentUser(),u.campaigns=o||{rows:[],count:0},u.rpcCampaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={sort:"name",limit:10,page:1},u.success=f,u.getCampaigns=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=r.campaign.get(u.query,f).$promise:(u.query.id=u.userProfile.id,u.query.section="IvrCampaigns",u.promise=r.userProfile.getResources(u.query,f).$promise)},u.onSave=function(e){var n=_.find(u.campaigns.rows,["id",e.id]);n&&(_.merge(n,_.pick(e,p)),_.merge(u.rpcCampaigns[e.id],_.pick(e,p)))},u.$onInit=g,u.createOrEditIvrCampaign=function(e,n){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:u.campaigns.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},l.onWithoutApply("campaign:save",u.onSave),u.interval=n(function(){},999);var v=!0,h=1;function f(e){u.campaigns=e||{count:0,rows:[]},g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=h),u.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),u.interval&&n.cancel(u.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function u(){c.queues.rows.forEach(function(e){c.rpcQueues[e.id]&&_.merge(e,_.pick(c.rpcQueues[e.id],m))})}c.queues=a||{rows:[],count:0},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"outbound",fields:"id,name",sort:"name",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"name",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="QueueCampaigns",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){var n=_.find(c.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.queues=e||{count:0,rows:[]},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,t.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.motiondialer.realtime.agents");break;case 1:t.go("app.motiondialer.realtime.queues");break;case 2:t.go("app.motiondialer.realtime.queue_calls");break;case 3:t.go("app.motiondialer.realtime.abandonedcalls");break;case 4:t.go("app.motiondialer.realtime.queue_params");break;case 5:t.go("app.motiondialer.realtime.ivr_campaigns");break;default:t.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",g.openchannelAccount=angular.copy(l),g.openchannelAccounts=r,g.newOpenchannelAccount=!1,g.openchannelAccount||(g.openchannelAccount={waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",g.newOpenchannelAccount=!0),n.params.id&&(g.openchannelAccount.OpenchannelAccountId=n.params.id),g.addNewOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.save(g.openchannelAccount).$promise.then(function(e){g.openchannelAccounts.unshift(e.toJSON()),o.success({title:"OpenchannelAccount properly created",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.update({id:g.openchannelAccount.id},g.openchannelAccount).$promise.then(function(e){var n=_.find(g.openchannelAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelAccount properly saved!",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.openchannelAccount.delete({id:g.openchannelAccount.id}).$promise.then(function(){_.remove(g.openchannelAccounts,{id:g.openchannelAccount.id}),o.success({title:"OpenchannelAccount properly deleted!",msg:(g.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),v(g.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.openchannelAccount&&(t=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.openchannelAccount&&(a=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:t,openchannelAccount:r.openchannelAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[n]=e:r.openchannelAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.openchannelAccountApps.rows.length;t++,0){var a=r.openchannelAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]},{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:801}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.openchannelAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=o.openchannelAccount.getApplications(r.query,t).$promise},r.editOpenchannelAccountApp=n,r.editInterval=function(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelAccount.getAgents({id:c.openchannelAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelAccount?"penalty "+e.UserOpenchannelAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.removeAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.addAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelAccount","openchannelAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("openChannel")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:801}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:m.openchannelAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.openchannelAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.openchannelAccountInteractions.rows.length;n+=1){var t=m.openchannelAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelInteraction.get(m.query,p).$promise}function v(e){d.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountInteractions.rows,{id:e.id}),m.openchannelAccountInteractions.count-=1,m.openchannelAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.from?e.contactName=e.from:e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("OPENCHANNEL.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountInteractions={count:0,rows:[]},m.selectedOpenchannelAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.openchannelInteractionDownload=function(s,e,n){return d.openchannelInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="openchannel-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getOpenchannelAccountInteractions=g,m.createOrEditOpenchannelAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,interaction:n,interactions:m.openchannelAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyopenchannelInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"openchannel",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"openchannel.openchannelAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||OpenchannelAccountId:=$eq["+m.openchannelAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(m.selectedOpenchannelAccountInteractions);return m.selectedOpenchannelAccountInteractions=[],e},m.deleteOpenchannelAccountInteraction=v,m.deleteSelectedOpenchannelAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountInteractions.forEach(function(e){v(e)}),m.selectedOpenchannelAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),m.openchannelAccountOpenchannelCannedAnswers.count-=1,m.openchannelAccountOpenchannelCannedAnswers.rows.length||p(),l.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("openchannelCannedAnswer #")+e.id||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getOpenchannelAccountOpenchannelCannedAnswers=p,m.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,n){o.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,openchannelCannedAnswer:n,openchannelCannedAnswers:m.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(m.selectedOpenchannelAccountOpenchannelCannedAnswers);return m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},m.deleteOpenchannelAccountOpenchannelCannedAnswer=g,m.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+m.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),m.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",g.openchannelCannedAnswer=angular.copy(l),g.openchannelCannedAnswers=r,g.newOpenchannelCannedAnswer=!1,g.openchannelCannedAnswer||(g.openchannelCannedAnswer={},g.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",g.newOpenchannelCannedAnswer=!0),n.params.id&&(g.openchannelCannedAnswer.OpenchannelAccountId=n.params.id),g.addNewOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.openchannelCannedAnswer).$promise.then(function(e){g.openchannelCannedAnswers.unshift(e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly created",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.openchannelCannedAnswer.id},g.openchannelCannedAnswer).$promise.then(function(e){var n=_.find(g.openchannelCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly saved!",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(g.openchannelCannedAnswers,{id:g.openchannelCannedAnswer.id}),o.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(g.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),v(g.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.openchannelAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.openchannelAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.openchannelAccount.id,field:"OpenchannelAccountId",route:"openchannelAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.openchannelAccount=c||e.params.openchannelAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:p.openchannelAccounts?p.openchannelAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts",{},{reload:"app.openchannel.openchannelAccounts"})},p.saveOpenchannelAccount=function(){r.openchannelAccount.update({id:p.openchannelAccount.id},p.openchannelAccount).$promise.then(function(){l.success({title:"OpenchannelAccount updated!",msg:p.openchannelAccount.name?p.openchannelAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.openchannelAccount&&(t=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.openchannelAccount&&(a=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmContact.describe({id:p.openchannelAccount.ListId}).$promise.then(function(e){p.fields=[];e=_.values(e.toJSON());for(var n=["id","createdAt","updatedAt","deletedAt","scheduledat","ListId","CompanyId"],t=0;t<e.length;t++)_.includes(n,e[t].columnName)||p.fields.push(e[t])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelAccount","userProfile","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:f.openchannelAccounts?f.openchannelAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelAccount")+"?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getOpenchannelAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelAccount=function(e,n){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:n,openchannelAccounts:f.openchannelAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelAccount=y,f.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(f.selectedOpenchannelAccounts);return f.selectedOpenchannelAccounts=[],e},f.deleteSelectedOpenchannelAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+f.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelAccounts.forEach(function(e){y(e)}),f.selectedOpenchannelAccounts=[]})},f.deselectOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=[]},f.selectAllOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=f.openchannelAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.openchannelAccount&&(t=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.openchannelAccount&&(a=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.openchannelAccounts=e||{count:0,rows:[]}}function y(e){m.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelAccounts.rows,{id:e.id}),f.openchannelAccounts.count-=1,f.openchannelAccounts.rows.length||f.getOpenchannelAccounts(),p.success({title:_.startCase("OpenchannelAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",r.openchannelQueue=angular.copy(n),r.openchannelQueues=e,r.newOpenchannelQueue=!1,r.openchannelQueue||(r.openchannelQueue={strategy:"beepall",timeout:10},r.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",r.newOpenchannelQueue=!0),r.addNewOpenchannelQueue=function(){r.errors=[],i.openchannelQueue.save(r.openchannelQueue).$promise.then(function(e){r.openchannelQueues.unshift(e.toJSON()),a.success({title:"OpenchannelQueue properly created",msg:r.openchannelQueue.name?r.openchannelQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveOpenchannelQueue=function(){r.errors=[],i.openchannelQueue.update({id:r.openchannelQueue.id},r.openchannelQueue).$promise.then(function(e){var n=_.find(r.openchannelQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"OpenchannelQueue properly saved!",msg:r.openchannelQueue.name?r.openchannelQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteOpenchannelQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.openchannelQueue.delete({id:r.openchannelQueue.id}).$promise.then(function(){_.remove(r.openchannelQueues,{id:r.openchannelQueue.id}),a.success({title:"OpenchannelQueue properly deleted!",msg:(r.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),l(r.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelQueues","openchannelQueue","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getAgents({id:c.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getTeams({id:l.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.openchannelQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:t.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.openchannelQueue=c||e.params.openchannelQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues",{},{reload:"app.openchannel.openchannelQueues"})},u.saveOpenchannelQueue=function(){r.openchannelQueue.update({id:u.openchannelQueue.id},u.openchannelQueue).$promise.then(function(){l.success({title:"OpenchannelQueue updated!",msg:u.openchannelQueue.name?u.openchannelQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelQueue","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelQueues",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelQueue")+"?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:810}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.openchannel.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.openchannel.realtime.queues",{})}},f.success=E,f.getOpenchannelQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelQueue=function(e,n){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:f.openchannelQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelQueue=y,f.exportSelectedOpenchannelQueues=function(){var e=angular.copy(f.selectedOpenchannelQueues);return f.selectedOpenchannelQueues=[],e},f.deleteSelectedOpenchannelQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+f.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelQueues.forEach(function(e){y(e)}),f.selectedOpenchannelQueues=[]})},f.deselectOpenchannelQueues=function(){f.selectedOpenchannelQueues=[]},f.selectAllOpenchannelQueues=function(){f.selectedOpenchannelQueues=f.openchannelQueues.rows};var b=!0,A=1;function E(e){f.openchannelQueues=e||{count:0,rows:[]}}function y(e){m.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelQueues.rows,{id:e.id}),f.openchannelQueues.count-=1,f.openchannelQueues.rows.length||f.getOpenchannelQueues(),p.success({title:_.startCase("OpenchannelQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.openchannel.realtime.agents");break;case 1:t.go("app.openchannel.realtime.queues");break;default:t.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.currentUser=s.getCurrentUser(),o.plugin={},o.getTrustedURL=function(){return t.trustAsResourceUrl(o.plugin.adminUrl)},a.plugin.get({id:e.params.id}).$promise.then(function(e){if(e)return o.plugin=e,a.plugin.get({id:o.plugin.id}).$promise}).catch(function(e){o.plugin=void 0})}e.$inject=["$state","$scope","$sce","api","socket","Auth"],angular.module("app.plugins.plugin").controller("PluginController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o,r,l,d,c,m,u,p,g,v){var h=this,f=i.params.direction||"inbound",b=g&&1==g.count?g.rows[0].crudPermissions:null;function A(n){return h.query.offset=(h.query.page-1)*h.query.limit,e.resolve().then(function(){if(!0===n){var e=Object.assign({},_.omit(h.query,["limit","offset","page"]),{nolimit:!0});return o.realtime.getAgents(e).$promise}}).then(function(e){e&&(h.amiAgents=e)}).then(function(){var e=h.queues?h.queues.rows:[];h.agents=l.paginateAgents(h.amiAgents.rows,e,h.query)}).catch(function(e){c.error({title:s.instant("VOICE.AGENTS"),msg:e.status?JSON.stringify(e.data):e.toString()})})}function E(e){return _.find(h.amiAgents.rows,["id",e])}function y(e){var n=E(e.id);n?(Object.assign(n,e),A()):r.isAdmin()&&A(!0)}function S(){A(!0)}function T(e){var n=E(e.id);n?(Object.assign(n,e),A()):r.isAdmin()&&A(!0)}function I(){A(!0)}function O(e){var n=E(e.id);n?(Object.assign(n,_.pick(e,["queue","destconnectedlinenum","routealias"])),A()):r.isAdmin()&&A(!0)}function C(e){if("ATTENDED"!==e.transfer){var n=E(e.id);n?(delete n.queue,delete n.destconnectedlinenum,delete n.routealias,A()):r.isAdmin()&&A(!0)}}function w(e){if(0!==h.query.globalQueueFilter.length){var n=e[_.capitalize(h.channel)+"QueueId"];if(h.query.globalQueueFilter.includes(n))_.find(h.queues.rows,function(e){return e.id===n}).Agents.push({id:e.UserId}),A()}}function R(n){if(0!==h.query.globalQueueFilter.length){var t=n[_.capitalize(h.channel)+"QueueId"];if(h.query.globalQueueFilter.includes(t)){var e=_.find(h.queues.rows,function(e){return e.id===t});_.remove(e.Agents,function(e){return e.id===n.UserId}),A()}}}function x(){h.queues&&D(!0)}function N(){h.queues&&D(!0)}function D(e){if(!(h.queues&&0<h.queues.count)||e){var n={type:f,fields:"id,name",sort:"name",nolimit:!0,include:[{model:"User",alias:"Agents",fields:["id","name"],raw:!0}]},t=h.channel+"Queue";return o.getResourcesByRole(h.currentUser,t,n,null).then(function(e){h.queues=e}).catch(function(e){c.error({title:s.instant("VOICE.QUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})}}h.currentUser=r.getCurrentUser(),h.channel=i.params.channel,h.amiAgents=m,h.pauses=p,h.license=u,h.crudPermissions=r.parseCrudPermissions(b),h.utcOffset=v,h.query={channel:h.channel,globalQueueFilter:[],globalStatusFilter:null,pauseTypeFilter:null,limit:10,page:1,sort:"fullname"},h.$onInit=function(){d.on("user:remove",I),d.on("user:save",S),d.on("user:update",T),d.on("user:agentconnect",O),d.on("user:agentcomplete",C),d.on("user:ami:update",y),d.on("user:routing:update",y),d.on("user"+_.capitalize(h.channel)+"Queue:save",w),d.on("user"+_.capitalize(h.channel)+"Queue:remove",R),d.on(h.channel+"Queue:save",x),d.on(h.channel+"Queue:remove",N),A()},h.getAgents=A,h.onPaginate=function(){A()},h.onSort=function(){A()},h.logout=function(e){return o.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){c.success({title:"Agent logout",msg:e.fullname+" properly logout"})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.LOGOUT"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.pause=function(e,n){return o.user.pause({id:e.id,type:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.PAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unpause=function(e){return o.user.unpause({id:e.id}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.UNPAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.addQueue=function(e,n){a.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,channel:h.channel,direction:f,crudPermissions:h.crudPermissions}})},h.manageScreenRecording=function(e,n){return o.user.update({id:e.id},{screenrecording:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.SCREENRECORDING"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.getQueuesByChannel=D,h.selectAllQueues=function(){h.query.globalQueueFilter=h.queues.rows.map(function(e){return e.id})},h.clearQueuesSelection=function(){h.query.globalQueueFilter=[]},n.$on("$destroy",function(){d.removeAllListeners("user:remove"),d.removeAllListeners("user:save"),d.removeAllListeners("user:update"),d.removeAllListeners("user:agentconnect"),d.removeAllListeners("user:agentcomplete"),d.removeAllListeners("user:ami:update"),d.removeAllListeners("user:routing:update"),d.removeAllListeners("user"+_.capitalize(h.channel)+"Queue:save"),d.removeAllListeners("user"+_.capitalize(h.channel)+"Queue:remove")})}e.$inject=["$document","$mdDialog","$q","$scope","$state","$translate","api","Auth","realtimeManager","socket","toasty","agents","license","pauses","userProfileSection","utcOffset"],angular.module("app.realtime").controller("AgentsRealtimeController",e)}(),function(){"use strict";function e(e,a,n,i,s,t,o,r,l,d,c){var m=this,u=c&&1==c.count?c.rows[0].crudPermissions:null;function p(){return m.queues.rows.map(function(e){return e.name})}function g(n){if(n.type===m.voiceQueueType&&p().includes(n.queue)){var e=_.find(m.voiceQueuesChannels.rows,function(e){return e.uniqueid===n.uniqueid});e?Object.assign(e,n):(m.voiceQueuesChannels.rows.push(n),m.voiceQueuesChannels.count=m.voiceQueuesChannels.rows.length)}}function v(n){m.voiceQueuesChannels.rows=_.filter(m.voiceQueuesChannels.rows,function(e){return e.uniqueid!==n.uniqueid}),m.voiceQueuesChannels.count=m.voiceQueuesChannels.rows.length}m.currentUser=t.getCurrentUser(),m.queues=l,m.voiceQueuesChannels=d,m.voiceQueueType=n.params.direction,m.crudPermissions=t.parseCrudPermissions(u),m.query={limit:10,page:1},m.$onInit=function(){o.on("voice_queue_channel:save",g),o.on("voice_queue_channel:remove",v);var n=p(),e=m.voiceQueuesChannels.rows.filter(function(e){if(n.includes(e.queue))return!0});m.voiceQueuesChannels.rows=e,m.voiceQueuesChannels.count=e.length},m.hangup=function(e){return s.rpc.getVoiceQueuesChannelHangup({uniqueid:e}).$promise.then(function(e){r.success({title:i.instant("VOICE.CALL_HANGUP_SUCCESS"),msg:e.message||void 0})}).catch(function(e){r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},m.getAvailableAgents=function(){m.availableAgents=null;var e={id:t.isUser()?m.currentUser.userProfileId:void 0,fields:"id,name,fullname,internal,context,online,voicePause,voiceStatus",sort:"fullname",online:!0,voicePause:!1};return s.realtime.getAgents(e).$promise.then(function(e){var n=e.rows.filter(function(e){return"idle"===e.voiceStatus});m.availableAgents=n}).catch(function(e){r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},m.redirectToAgent=function(e,n,t){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:e,exten:n,context:t}).$promise.then(function(e){r.success({title:i.instant("VOICE.CALL_REDIRECT_SUCCESS"),msg:e.message||void 0})}).catch(function(e){r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},m.redirectToNumber=function(e,n){var t=a.prompt().title(i.instant("VOICE.CALL_NUMBER_REDIRECT")).placeholder(i.instant("DASHBOARDS.NUMBER")).targetEvent(e).ok("Ok").cancel(i.instant("TOOLBAR.CANCEL"));return a.show(t).then(function(e){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e}).$promise}).then(function(e){r.success({title:i.instant("VOICE.CALL_REDIRECT_SUCCESS"),msg:e.message||void 0})}).catch(function(e){e&&r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},e.$on("$destroy",function(){o.removeAllListeners("voice_queue_channel:save"),o.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$mdDialog","$state","$translate","api","Auth","socket","toasty","queues","voiceQueuesChannels","userProfileSection"],angular.module("app.realtime").controller("QueueCallsRealtimeController",e)}(),function(){"use strict";function e(i,s,e,n,t,a,o,r,l,d,c,m,u){var p=this,g=e(function(){},999),v=u&&1==u.count?u.rows[0].crudPermissions:null,h=t.params.direction,f="outbound"===h?"QueueCampaigns":_.startCase(p.channel)+"Queues";function b(e){var n=_.find(p.queues.rows,["id",e.id]);n&&(n=l.updateQueue(e,n))}p.currentUser=r.getCurrentUser(),p.channel=t.params.channel,p.queues=m,p.crudPermissions=r.parseCrudPermissions(v),p.headersTemplate=null,p.rowsTemplate=null,p.query={id:r.isUser()?p.currentUser.id:void 0,section:r.isUser()?f:void 0,channel:p.channel,type:h,sort:"name",limit:10,page:1},p.$onInit=function(){var e,n;d.on(p.channel+"_queue:save",b),p.headersTemplate=(e="default.html","voice"===p.channel&&(e=h+".html"),"app/main/apps/realtime/views/queues/templates/headers/"+e),p.rowsTemplate=(n="default.html","voice"===p.channel&&(n=h+".html"),"app/main/apps/realtime/views/queues/templates/rows/"+n),"voice"===p.channel&&p.queues.rows.forEach(function(e){0<e.ringing&&e.available<e.loggedIn&&(e.available+=e.ringing)})},p.getQueues=function(){return p.query.offset=(p.query.page-1)*p.query.limit,o.realtime.getQueues(p.query).$promise.then(function(e){p.queues=e}).catch(function(e){c.error({title:a.instant("DASHBOARDS.QUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},p.editQueue=function(e,n){var t={crudPermissions:p.crudPermissions};t[p.channel+"Queue"]=n,t[p.channel+"Queues"]=p.queues.rows;var a={controller:"CreateOrEdit"+_.startCase(p.channel)+"QueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/"+p.channel+"/views/"+p.channel+"Queues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:t};return s.show(a)},p.addOrRemoveAgents=function(e,n){var t={realtime:"voice"===p.channel,crudPermissions:p.crudPermissions};t[p.channel+"Queue"]=n,t[p.channel+"Queues"]=p.queues.rows;var a={controller:_.startCase(p.channel)+"QueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/"+p.channel+"/views/"+p.channel+"Queues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:t};return s.show(a)},p.showPredictiveInfo=function(e,n){var t={controller:"PredictiveInfoDialogController",controllerAs:"vm",templateUrl:"app/main/apps/realtime/views/queues/predictive/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n}};return s.show(t)},n.$on("$destroy",function(){d.removeAllListeners(p.channel+"_queue:save"),g&&e.cancel(g)})}e.$inject=["$document","$mdDialog","$interval","$scope","$state","$translate","api","Auth","realtimeManager","socket","toasty","queues","userProfileSection"],angular.module("app.realtime").controller("QueuesRealtimeController",e)}(),function(){"use strict";function e(e,n){this.queueCampaign=n,this.formatTime=function(e,n){var t=moment(e);return n&&t.add(n,"minutes"),t.format("HH:mm:ss")},this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","queueCampaign"],angular.module("app.realtime").controller("PredictiveInfoDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u){var p=this;function g(e){p.cloudProviders=e||{count:0,rows:[]}}function v(e){r.cloudProvider.delete({id:e.id}).$promise.then(function(){_.remove(p.cloudProviders.rows,{id:e.id}),p.cloudProviders.count-=1,p.cloudProviders.rows.length||p.getAiTools(),d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcloudProvider"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcloudProvider",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}p.license=m,p.setting=u,p.currentUser=c.getCurrentUser(),p.cloudProviders=o||{count:0,rows:[]},p.selectedAiTools=[],p.query={fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data5,data6",sort:"-updatedAt",limit:10,page:1},p.services={AmazonAWS:"AmazonAWS",MicrosoftAzure:"Microsoft Azure"},p.editdialog=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{cloudProvider:e,cloudProviders:p.cloudProviders.rows,license:p.license,setting:null,crudPermissions:p.crudPermissions}})},p.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete cloud provider").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){v(e)})},p.success=g,p.getAiTools=function(){p.query.offset=(p.query.page-1)*p.query.limit,c.hasRole("admin")?p.promise=r.cloudProvider.get(p.query,g).$promise:(p.query.id=p.userProfile.id,p.query.section="AiTools",p.promise=r.userProfile.getResources(p.query,g).$promise)},p.createOrEditCloudProvider=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{cloudProvider:n,cloudProviders:p.cloudProviders.rows,license:p.license,setting:p.setting,crudPermissions:p.crudPermissions}})},p.deleteCloudProvider=v,p.exportSelectedAiTools=function(){var e=angular.copy(p.selectedAiTools);return p.selectedAiTools=[],e},p.deleteSelectedAiTools=function(e){var n=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_MESSAGE",{total:p.selectedAiTools.length})).ariaLabel("delete CloudProviders").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){p.selectedAiTools.forEach(function(e){v(e)}),p.selectedAiTools=[],d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE")})})},p.deselectAiTools=function(){p.selectedAiTools=[]},p.selectAllAiTools=function(){p.selectedAiTools=p.cloudProviders.rows},p.authenticateToMicrosoftIdentityPlatform=function(e){return r.cloudProvider.oauth2MicrosoftAuthorize({id:e.id}).$promise.then(function(e){p.loginWindow=n.open(e.url,"_blank","width=800,height=600")})},p.updateClientSecret=function(n,e){return a.show({controller:"UpdateClientSecretController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{cloudProvider:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,service,data3",id:n.id})}]}})},l.on("microsoftAuthorization:success",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.success({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_SUCCESS")}))}),l.on("microsoftAuthorization:error",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.error({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_FAIL")}))}),e.$on("$destroy",function(){l.removeAllListeners("microsoftAuthorization:success"),l.removeAllListeners("microsoftAuthorization:error")});var h=!0,f=1;e.$watch("vm.query.filter",function(e,n){h?i(function(){h=!1}):(n||(f=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=f),p.getAiTools())})}e.$inject=["$scope","$window","$mdDialog","$document","$timeout","$translate","cloudProviders","api","socket","toasty","Auth","license","setting"],angular.module("app.settings").controller("CloudProvidersController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r){var l=this;function d(e){t.hide(e)}l.currentUser=o.getCurrentUser(),l.license=r,l.cloudProvider=angular.copy(n),l.cloudProviders=e,l.newCloudProvider=!1,l.errors=[],l.cloudProvider||(l.cloudProvider={},l.newCloudProvider=!0),l.addNewCloudProvider=function(){l.errors=[],s.cloudProvider.save(l.cloudProvider).$promise.then(function(e){l.cloudProviders.unshift(e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_CREATED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.saveCloudProvider=function(){l.errors=[],s.cloudProvider.update({id:l.cloudProvider.id},l.cloudProvider).$promise.then(function(e){var n=_.find(l.cloudProviders,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SAVED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.deleteCloudProvider=function(e){l.errors=[];var n=t.confirm().title(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:l.cloudProvider.name})).ariaLabel("Delete Cloud Provider").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.cloudProvider.delete({id:l.cloudProvider.id}).$promise.then(function(){_.remove(l.cloudProviders,{id:l.cloudProvider.id}),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")}),d(l.cloudProvider)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},l.closeDialog=d}e.$inject=["$mdDialog","$translate","toasty","cloudProviders","cloudProvider","api","Auth","license"],angular.module("app.settings").controller("CreateOrEditCloudProviderDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.cloudProvider=i,s.errors=[],s.saveSecret=function(){return s.errors=[],a.cloudProvider.update({id:i.id},{data3:s.newSecret}).$promise.then(function(){t.success({title:n.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE")}),o()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},s.closeDialog=o}e.$inject=["$mdDialog","$translate","toasty","api","cloudProvider"],angular.module("app.settings").controller("UpdateClientSecretController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_CUSTOMIZATION",g.customization=angular.copy(l),g.customizations=r,g.newCustomization=!1,g.customization||(g.customization={},g.title="SETTINGS.NEW_CUSTOMIZATION",g.newCustomization=!0),g.addNewCustomization=function(){g.errors=[],d.setting.save(g.customization).$promise.then(function(e){g.customizations.unshift(e.toJSON()),o.success({title:"Customization properly created",msg:g.customization.name?g.customization.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomization=function(){g.errors=[],d.setting.update({id:g.customization.id},g.customization).$promise.then(function(e){var n=_.find(g.customizations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Customization properly saved!",msg:g.customization.name?g.customization.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomization=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.customization.id}).$promise.then(function(){_.remove(g.customizations,{id:g.customization.id}),o.success({title:"Customization properly deleted!",msg:(g.customization.name||"customization")+" has been deleted!"}),v(g.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customizations","customization","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.customizations=e,s.customization={},s.customizations&&s.customizations.rows&&s.customizations.rows.length&&(s.customization=s.customizations.rows[0]),s.saveCustomization=function(){s.customization.id?n.setting.update({id:s.customization.id},s.customization).$promise.then(function(){t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.customization).$promise.then(function(e){_.merge(s.customization,e),t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty","license","Auth"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg","ico"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/favicon".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationfaviconController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/preferred".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationpreferredController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_GENERAL",g.general=angular.copy(l),g.generals=r,g.newGeneral=!1,g.general||(g.general={min_internal:1e3,chatTimeout:30,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml",splitSizeCsv:5e3,splitSizePdf:1e3,splitSizeXlsx:5e3,messagesAlignment:"alternate",phoneBarRememberMeEnabled:!0,allowedLoginAttempts:5,blockDuration:10,loginMailFrequency:10,enforcePasswordHistory:!0,passwordHistoryLimit:3},g.title="SETTINGS.NEW_GENERAL",g.newGeneral=!0),g.addNewGeneral=function(){g.errors=[],d.setting.save(g.general).$promise.then(function(e){g.generals.unshift(e.toJSON()),o.success({title:"General properly created",msg:g.general.name?g.general.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGeneral=function(){g.errors=[],d.setting.update({id:g.general.id},g.general).$promise.then(function(e){var n=_.find(g.generals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"General properly saved!",msg:g.general.name?g.general.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGeneral=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.general.id}).$promise.then(function(){_.remove(g.generals,{id:g.general.id}),o.success({title:"General properly deleted!",msg:(g.general.name||"general")+" has been deleted!"}),v(g.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.cloudProviders=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","generals","general","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.generals=e,s.general={},s.generals&&s.generals.rows&&s.generals.rows.length&&(s.general=s.generals.rows[0]),_.isNil(s.general.privacyPolicyEmail)||(s.general.enablePrivacyPolicyEmail=!0),_.isNil(s.general.privacyPolicyName)||(s.general.enablePrivacyPolicyName=!0),_.isNil(s.general.privacyPolicyNumber)||(s.general.enablePrivacyPolicyNumber=!0),n.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){s.cloudProviders=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.saveGeneral=function(){s.general.enablePrivacyPolicyEmail||(s.general.privacyPolicyEmail=null),s.general.enablePrivacyPolicyNumber||(s.general.privacyPolicyNumber=null),s.general.enablePrivacyPolicyName||(s.general.privacyPolicyName=null),s.general.id?n.setting.update({id:s.general.id},s.general).$promise.then(function(){t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.general).$promise.then(function(e){_.merge(s.general,e),t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.onPrivacyPolicyChange=function(e){switch(e){case"email":s.general.enablePrivacyPolicyEmail&&!s.general.privacyPolicyEmail&&(s.general.privacyPolicyEmail=0);break;case"name":s.general.enablePrivacyPolicyName&&!s.general.privacyPolicyName&&(s.general.privacyPolicyName=0);break;case"number":s.general.enablePrivacyPolicyNumber&&!s.general.privacyPolicyNumber&&(s.general.privacyPolicyNumber=0)}}}e.$inject=["generals","api","toasty","license","Auth"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l){var d=this;d.license=i||{},d.agents=0,d.users=0,d.telephones=0,d.channels=[{name:"voice",icon:"icon-phone"},{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"},{name:"whatsapp",icon:"icon-whatsapp"}],d.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],d.addons=[{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"},{name:"screenrecording",icon:"icon-video"},{name:"ai",icon:"icon-text-to-speech"}],d.sessions=[{name:"callysquare",icon:"icon-sitemap",restart:!0,label:"channels",enabled:"voice"},{name:"virtual",icon:"icon-dots-horizontal",restart:!1,label:"sessions",enabled:"chat"}],d.others=[{name:"update",icon:"icon-cloud-download"}],d.requestLicense=function(e){t.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:d.channels,modules:d.modules,addons:d.addons,sessions:d.sessions,others:d.others}})},d.updateLicense=function(e){t.show({controller:"UpdateLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/update/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i}})},d.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},d.alert=s.info,d.downloadLogFile=function(){return o.license.downloadLogFile().$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","license-info.log"),document.body.appendChild(a),a.click(),s.success({title:l.instant("SETTINGS.LICENSE_LOG_FILE"),msg:l.instant("SETTINGS.LICENSE_LOG_FILE_DOWNLOADED")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.isAdmin=r.isAdmin(),o.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return d.agents=e&&e.count?e.count:0,o.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return d.users=e&&e.count?e.count:0,o.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){d.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$window","$mdDialog","$state","license","toasty","api","Auth","$translate"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){e.hide()}m.errors=[],m.user=d.getCurrentUser(),m.license=angular.copy(t),m.channels=a,m.modules=i,m.addons=s,m.sessions=o,m.others=r,m.license.name=m.user.fullname,m.license.email=m.user.email,m.sendRequest=function(){for(var e in m.errors=[],m.table="||FIELD||OLD||NEW||\n",m.license)m.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(t[e]===m.license[e]?m.table+="|"+e+"|"+(void 0!==t[e]?t[e]:"")+"|"+m.license[e]+"|\n":m.table+="|"+e+"|{color:red}"+(void 0!==t[e]?t[e]:"")+"{color}|*"+m.license[e]+"*|\n");l.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:m.table,issuetype:"License Request"}).$promise.then(function(e){n.success({title:"Request sent!",msg:c.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),u()}).catch(function(e){console.error(e),m.errors=[{message:c.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},m.closeDialog=u}e.$inject=["$mdDialog","toasty","license","channels","modules","addons","sessions","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.errors=[],s.license=angular.copy(t),s.licenseKey,s.updateLicense=function(){return a.license.update({id:1,key:s.licenseKey}).$promise.then(function(e){e&&(e.demo?n.error({title:"License update failed!",msg:"Invalid license key"}):n.success({title:"License properly updated!",msg:"The license has been updated!"}))}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","toasty","license","api","$translate"],angular.module("app.settings.license").controller("UpdateLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){a.hide(e)}p.currentUser=c.getCurrentUser(),p.errors=[],p.setting=u,p.license=m,p.hasModulePermissions={},p.passwordPattern=p.setting&&p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.title="SETTINGS.EDIT_NETWORK",p.network=angular.copy(l),p.networks=r,p.newNetwork=!1,p.network||(p.network={type:"localnet"},p.title="SETTINGS.NEW_NETWORK",p.newNetwork=!0),p.addNewNetwork=function(){p.errors=[],d.network.save(p.network).$promise.then(function(e){p.networks.unshift(e.toJSON()),o.success({title:"Network properly created",msg:p.network.name?p.network.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveNetwork=function(){p.errors=[],d.network.update({id:p.network.id},p.network).$promise.then(function(e){var n=_.find(p.networks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Network properly saved!",msg:p.network.name?p.network.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteNetwork=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.network.delete({id:p.network.id}).$promise.then(function(){_.remove(p.networks,{id:p.network.id}),o.success({title:"Network properly deleted!",msg:(p.network.name||"network")+" has been deleted!"}),g(p.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.getDateFromString=function(e){return null===e?void 0:new Date(e)},p.closeDialog=g}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;v.license=p,v.setting=g,v.currentUser=u.getCurrentUser(),v.networks=l||{count:0,rows:[]},v.table="networks",v.listOrder="",v.listOrderAsc=null,v.selectedNetworks=[],v.query={fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"},{option:"Turn",value:"'turn'"},{option:"Stun",value:"'stun'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{network:e,networks:v.networks.rows,license:v.license,setting:null,crudPermissions:v.crudPermissions}})},v.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("network")+"?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=b,v.getNetworks=function(){v.query.offset=(v.query.page-1)*v.query.limit,u.hasRole("admin")?v.promise=d.network.get(v.query,b).$promise:(v.query.id=v.userProfile.id,v.query.section="Networks",v.promise=d.userProfile.getResources(v.query,b).$promise)},v.createOrEditNetwork=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:n,networks:v.networks.rows,license:v.license,setting:v.setting,crudPermissions:v.crudPermissions}})},v.deleteNetwork=A,v.exportSelectedNetworks=function(){var e=angular.copy(v.selectedNetworks);return v.selectedNetworks=[],e},v.deleteSelectedNetworks=function(e){var n=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+v.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){v.selectedNetworks.forEach(function(e){A(e)}),v.selectedNetworks=[]})},v.deselectNetworks=function(){v.selectedNetworks=[]},v.selectAllNetworks=function(){v.selectedNetworks=v.networks.rows};var h=!0,f=1;function b(e){v.networks=e||{count:0,rows:[]}}function A(e){d.network.delete({id:e.id}).$promise.then(function(){_.remove(v.networks.rows,{id:e.id}),v.networks.count-=1,v.networks.rows.length||v.getNetworks(),m.success({title:_.startCase("Network")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){h?o(function(){h=!1}):(n||(f=v.query.page),e!==n&&(v.query.page=1),e||(v.query.page=f),v.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","networks","api","msUtils","toasty","Auth","license","setting"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;l.currentUser=o.getCurrentUser(),l.license=s,l.providers=r.getEmailProviders(),l.mailAccounts=e||{rows:[],count:0},l.cloudProviders=t||{rows:[],count:0},l.mailAccount={service:!0,Smtp:{}},0<l.mailAccounts.count&&(l.mailAccount=l.mailAccounts.rows[0]),l.originalProvider=l.mailAccount.provider,l.saveSmtp=function(){var e=angular.copy(l.mailAccount);"custom"===e.provider?e.provider=null:(l.originalProvider!==e.provider&&(e.Smtp.modernAuthentication?e.Smtp.pass=null:e.Smtp.CloudProviderId=null),e.Smtp.modernAuthentication||(e.Smtp.CloudProviderId=null),e.Smtp=_.omit(e.Smtp,["host","port","secure","service"]));l.mailAccount.id?a.mailAccount.update({id:l.mailAccount.id},e).$promise.then(function(){l.originalProvider=e.provider,i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):a.mailAccount.save(e).$promise.then(function(e){_.merge(l.mailAccount,e),i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},l.verifySmtp=function(){a.mailAccount.verifySmtp({id:l.mailAccount.id}).$promise.then(function(){i.success({msg:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){i.error({title:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})},l.onProviderChange=function(){"custom"!==l.mailAccount.provider&&(l.mailAccount.authentication=!0);"outlook365"!==l.mailAccount.provider&&(l.mailAccount.Smtp.modernAuthentication=!1)}}e.$inject=["$translate","mailAccounts","cloudProviders","api","toasty","license","Auth","msUtils"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,s,n,t,a,o,r){var l,d=this;d.system=t||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=n.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,n,t){var a=s.confirm().title("Would you like to change the status of the process #"+n+"?").textContent("The status will be changed to: "+t.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");s.show(a).then(function(){return r.pm2.update({id:n,status:t})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){o.success({title:"Process updated!",msg:"Status properly changed to: "+t})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.title="SETTINGS.UPDATE",s.progress=0,s.updating=!0,s.output="Waiting...",s.success=!0,s.interval=n(function(){s.progress<90&&(s.progress+=1)},1e3),s.closeDialog=function(){e.hide()},s.reload=function(){t.location.reload()},s.stopInterval=function(){angular.isDefined(s.interval)&&(n.cancel(s.interval),s.interval=void 0);s.progress=100,s.updating=!1},i.version.fetch().$promise.then(function(e){return s.output=e.output+"...",i.version.reset().$promise}).then(function(e){return s.output=e.output+"...",i.version.pull().$promise}).then(function(e){return s.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return s.output=e.output+"...",i.version.restart().$promise}).then(function(e){s.output="Waiting to restart motion...",a(function(){s.stopInterval()},3e4)}).catch(function(e){s.success=!1,s.stopInterval(),s.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(t,e,a,n,i){this.version=n||{},this.updateConfirm=function(e){var n=t.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");t.show(n).then(function(){t.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.sms.realtime.agents");break;case 1:t.go("app.sms.realtime.queues");break;default:t.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSACCOUNT",g.smsAccount=angular.copy(l),g.smsAccounts=r,g.newSmsAccount=!1,g.smsAccount||(g.smsAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="SMS.NEW_SMSACCOUNT",g.newSmsAccount=!0),n.params.id&&(g.smsAccount.SmsAccountId=n.params.id),g.addNewSmsAccount=function(){g.errors=[],d.smsAccount.save(g.smsAccount).$promise.then(function(e){g.smsAccounts.unshift(e.toJSON()),o.success({title:"SmsAccount properly created",msg:g.smsAccount.name?g.smsAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsAccount=function(){g.errors=[],d.smsAccount.update({id:g.smsAccount.id},g.smsAccount).$promise.then(function(e){var n=_.find(g.smsAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsAccount properly saved!",msg:g.smsAccount.name?g.smsAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.smsAccount.delete({id:g.smsAccount.id}).$promise.then(function(){_.remove(g.smsAccounts,{id:g.smsAccount.id}),o.success({title:"SmsAccount properly deleted!",msg:(g.smsAccount.name||"smsAccount")+" has been deleted!"}),v(g.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.smsAccount&&(t=_.find(g.lists,{id:Number(g.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.smsAccount&&(a=_.find(g.lists,{id:Number(g.smsAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsAccounts","smsAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:t,smsAccount:r.smsAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[n]=e:r.smsAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.smsAccountApps.rows.length;t++,0){var a=r.smsAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:701}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.smsAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=o.smsAccount.getApplications(r.query,t).$promise},r.editSmsAccountApp=n,r.editInterval=function(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsAccount.getAgents({id:c.smsAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsAccount?"penalty "+e.UserSmsAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.removeAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.addAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsAccount","smsAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("sms")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"smsAccount",action:"getDispositions",field:"name",params:{id:m.smsAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.smsAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.smsAccountInteractions.rows.length;n+=1){var t=m.smsAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsInteraction.get(m.query,p).$promise}function v(e){d.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountInteractions.rows,{id:e.id}),m.smsAccountInteractions.count-=1,m.smsAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.mobile):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountInteractions={count:0,rows:[]},m.selectedSmsAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.smsInteractionDownload=function(s,e,n){return d.smsInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="sms-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getSmsAccountInteractions=g,m.createOrEditSmsAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,interaction:n,interactions:m.smsAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spysmsInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"sms",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"sms.smsAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||SmsAccountId:=$eq["+m.smsAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(m.selectedSmsAccountInteractions);return m.selectedSmsAccountInteractions=[],e},m.deleteSmsAccountInteraction=v,m.deleteSelectedSmsAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountInteractions.forEach(function(e){v(e)}),m.selectedSmsAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountSmsCannedAnswers.rows,{id:e.id}),m.smsAccountSmsCannedAnswers.count-=1,m.smsAccountSmsCannedAnswers.rows.length||p(),l.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountSmsCannedAnswers={count:0,rows:[]},m.selectedSmsAccountSmsCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("smsCannedAnswer #")+e.id||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getSmsAccountSmsCannedAnswers=p,m.createOrEditSmsAccountSmsCannedAnswer=function(e,n){o.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,smsCannedAnswer:n,smsCannedAnswers:m.smsAccountSmsCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(m.selectedSmsAccountSmsCannedAnswers);return m.selectedSmsAccountSmsCannedAnswers=[],e},m.deleteSmsAccountSmsCannedAnswer=g,m.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+m.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),m.selectedSmsAccountSmsCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSCANNEDANSWER",g.smsCannedAnswer=angular.copy(l),g.smsCannedAnswers=r,g.newSmsCannedAnswer=!1,g.smsCannedAnswer||(g.smsCannedAnswer={},g.title="SMS.NEW_SMSCANNEDANSWER",g.newSmsCannedAnswer=!0),n.params.id&&(g.smsCannedAnswer.SmsAccountId=n.params.id),g.addNewSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.smsCannedAnswer).$promise.then(function(e){g.smsCannedAnswers.unshift(e.toJSON()),o.success({title:"SmsCannedAnswer properly created",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.smsCannedAnswer.id},g.smsCannedAnswer).$promise.then(function(e){var n=_.find(g.smsCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsCannedAnswer properly saved!",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.smsCannedAnswer.id}).$promise.then(function(){_.remove(g.smsCannedAnswers,{id:g.smsCannedAnswer.id}),o.success({title:"SmsCannedAnswer properly deleted!",msg:(g.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),v(g.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.smsAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.smsAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.smsAccount.id,field:"SmsAccountId",route:"smsAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.sms").controller("SmsAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.smsAccount=c||e.params.smsAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:p.smsAccounts?p.smsAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts",{},{reload:"app.sms.smsAccounts"})},p.saveSmsAccount=function(){r.smsAccount.update({id:p.smsAccount.id},p.smsAccount).$promise.then(function(){l.success({title:"SmsAccount updated!",msg:p.smsAccount.name?p.smsAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.smsAccount&&(t=_.find(p.lists,{id:Number(p.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.smsAccount&&(a=_.find(p.lists,{id:Number(p.smsAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsAccount","userProfile","userProfileSection"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSmsAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"},{option:"Infobip",value:"'infobip'"},{option:"Clickatell",value:"'clickatell'"},{option:"Bandwidth",value:"'bandwidth'"},{option:"CSCTelecom",value:"'csc'"},{option:"Intelepeer",value:"'intelepeer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysmsMethod=_.keyBy([{option:"Basic",value:"'SI'"},{option:"Classic",value:"'TI'"},{option:"Classic+",value:"'GP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:f.smsAccounts?f.smsAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsAccount")+"?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSmsAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsAccount=function(e,n){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:n,smsAccounts:f.smsAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSmsAccount=y,f.exportSelectedSmsAccounts=function(){var e=angular.copy(f.selectedSmsAccounts);return f.selectedSmsAccounts=[],e},f.deleteSelectedSmsAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+f.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsAccounts.forEach(function(e){y(e)}),f.selectedSmsAccounts=[]})},f.deselectSmsAccounts=function(){f.selectedSmsAccounts=[]},f.selectAllSmsAccounts=function(){f.selectedSmsAccounts=f.smsAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.smsAccount&&(t=_.find(f.lists,{id:Number(f.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.smsAccount&&(a=_.find(f.lists,{id:Number(f.smsAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.smsAccounts=e||{count:0,rows:[]}}function y(e){m.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.smsAccounts.rows,{id:e.id}),f.smsAccounts.count-=1,f.smsAccounts.rows.length||f.getSmsAccounts(),p.success({title:_.startCase("SmsAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="SMS.EDIT_SMSQUEUE",r.smsQueue=angular.copy(n),r.smsQueues=e,r.newSmsQueue=!1,r.smsQueue||(r.smsQueue={strategy:"beepall",timeout:10},r.title="SMS.NEW_SMSQUEUE",r.newSmsQueue=!0),r.addNewSmsQueue=function(){r.errors=[],i.smsQueue.save(r.smsQueue).$promise.then(function(e){r.smsQueues.unshift(e.toJSON()),a.success({title:"SmsQueue properly created",msg:r.smsQueue.name?r.smsQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveSmsQueue=function(){r.errors=[],i.smsQueue.update({id:r.smsQueue.id},r.smsQueue).$promise.then(function(e){var n=_.find(r.smsQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"SmsQueue properly saved!",msg:r.smsQueue.name?r.smsQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteSmsQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.smsQueue.delete({id:r.smsQueue.id}).$promise.then(function(){_.remove(r.smsQueues,{id:r.smsQueue.id}),a.success({title:"SmsQueue properly deleted!",msg:(r.smsQueue.name||"smsQueue")+" has been deleted!"}),l(r.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","smsQueues","smsQueue","api","Auth","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getAgents({id:c.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getTeams({id:l.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.smsQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("SMS.ALL_TEAMS"),labelSelected:t.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.smsQueue=c||e.params.smsQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsQueues=function(){e.go("app.sms.smsQueues",{},{reload:"app.sms.smsQueues"})},u.saveSmsQueue=function(){r.smsQueue.update({id:u.smsQueue.id},u.smsQueue).$promise.then(function(){l.success({title:"SmsQueue updated!",msg:u.smsQueue.name?u.smsQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsQueue","userProfileSection"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsQueues",f.listOrder="",f.listOrderAsc=null,f.selectedSmsQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsQueue")+"?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:710}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.sms.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.sms.realtime.queues",{})}},f.success=E,f.getSmsQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsQueue=function(e,n){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:f.smsQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteSmsQueue=y,f.exportSelectedSmsQueues=function(){var e=angular.copy(f.selectedSmsQueues);return f.selectedSmsQueues=[],e},f.deleteSelectedSmsQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+f.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsQueues.forEach(function(e){y(e)}),f.selectedSmsQueues=[]})},f.deselectSmsQueues=function(){f.selectedSmsQueues=[]},f.selectAllSmsQueues=function(){f.selectedSmsQueues=f.smsQueues.rows};var b=!0,A=1;function E(e){f.smsQueues=e||{count:0,rows:[]}}function y(e){m.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.smsQueues.rows,{id:e.id}),f.smsQueues.count-=1,f.smsQueues.rows.length||f.getSmsQueues(),p.success({title:_.startCase("SmsQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.agents=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="Agents",g.promise=l.userProfile.getResources(g.query,v).$promise)}function f(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.agents.rows,{id:e.id}),g.agents.count-=1,g.agents.rows.length||g.getAgents(),d.success({title:_.startCase("Agent")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.agents=s||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedAgents=[],g.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay",role:"agent",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.showWebBarOptions=[{option:"Phonebar",value:0},{option:"External",value:1},{option:"WebRTC",value:2}],g.editstate=function(e){n.go("app.staff.agents.edit",{id:e.id,agent:e,crudPermissions:g.crudPermissions})},g.teamadddialog=function(e,n){a.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:g.agents?g.agents.rows:[],crudPermissions:g.crudPermissions}})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("agent")+"?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){f(e)})},g.success=v,g.getAgents=h,g.createOrEditAgent=function(e,n){a.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:n,agents:g.agents.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteAgent=f,g.exportSelectedAgents=function(){var e=angular.copy(g.selectedAgents);return g.selectedAgents=[],e},g.deleteSelectedAgents=function(e){var n=a.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+g.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedAgents.forEach(function(e){f(e)}),g.selectedAgents=[]})},g.deselectAgents=function(){g.selectedAgents=[]},g.selectAllAgents=function(){g.selectedAgents=g.agents.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),g.getAgents())}),p.on("user-setting:update",h),e.$on("$destroy",function(){p.removeListener("user-setting:update",h)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","agents","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_AGENT",m.agent=angular.copy(i),m.agents=n,m.newAgent=!1,m.agent||(m.agent={role:"agent",showWebBar:"0",autointernal:!0,wssPort:8089,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0,downloadAttachments:!0,downloadOmnichannelInteractions:!0,downloadVoiceRecordings:!0},m.title="STAFF.NEW_AGENT",m.newAgent=!0),m.addNewAgent=function(){m.errors=[],s.user.save(m.agent).$promise.then(function(e){m.agents.unshift(e.toJSON()),a.success({title:"Agent properly created",msg:m.agent.name?m.agent.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveAgent=function(){m.errors=[],s.user.update({id:m.agent.id},m.agent).$promise.then(function(e){var n=_.find(m.agents,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"Agent properly saved!",msg:m.agent.name?m.agent.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteAgent=function(e){m.errors=[];var n=t.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.agent.id}).$promise.then(function(){_.remove(m.agents,{id:m.agent.id}),a.success({title:"Agent properly deleted!",msg:(m.agent.name||"agent")+" has been deleted!"}),p(m.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p;var g="user-setting:update:user-"+m.agent.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","agents","agent","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.agent=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.agent=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.agent.id,newPassword:r.password};r.currentUser.id==r.agent.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Agent password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.agent.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.agentForm.password.$setValidity("oldPasswordMatch",!1):t.agentForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","agent","setting","Auth"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(e,n,i,t,s){var o=this;o.agent={},o.navigation=t.getNavigation(),o.crudPermissions,o.init=function(e,n){o.agent=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1}},o.onChange=function(n,t){if((t||n).enabled){if(t)t.enabled=!0,o.agent.permissions.push(t.id);else for(var e=0;e<n.children.length;e++)n.children[e].enabled=!0,o.agent.permissions.push(n.children[e].id);n.enabled=!0,o.agent.permissions.push(n.id)}else if(t)t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e}),_.filter(n.children,{enabled:!1}).length===n.children.length&&(n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e}));else{n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e});for(var a=0;a<n.children.length;a++)n.children[a].enabled=!1,_.remove(o.agent.permissions,function(e){return n.children[a].id===e})}return i.user.update({id:o.agent.id,permissions:_.uniq(o.agent.permissions)}).$promise.then(function(){s.success({title:"agent updated!",msg:o.agent.name?o.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["$document","$mdDialog","api","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d[c.apiName].get({fields:"id,name,strategy,type",channel:c.channel,type:"voice"===c.channel?c.direction:void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.user.getQueues({id:c.agent.id,fields:"id,name,strategy,type,penalty",nolimit:!0,type:"voice"===c.channel?c.direction:void 0,channel:c.channel}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return"voice"===c.channel&&(n.penalty=void 0!==n&&void 0!==e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"penalty 0"),n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.agent=n,c.crudPermissions=r,c.penalty=0,c.channel=t,c.direction=i,c.apiName=c.channel+"Queue",c.title=s.instant("STAFF.ADD_AGENT_TO_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"type",line3:"voice"===c.channel?"penalty":"",labelAll:s.instant("STAFF.ALL_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),labelSelected:s.instant("STAFF.SELECTED_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}},c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){var e;switch(c.channel){case"voice":switch(c.direction){case"inbound":e="VoiceQueues";break;case"outbound":e="QueueCampaigns"}break;case"chat":e="ChatQueues";break;case"mail":e="MailQueues";break;case"sms":e="SmsQueues";break;case"openchannel":e="OpenchannelQueues";break;case"fax":e="FaxQueues"}d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:e}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveQueues=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.user.removeQueues({id:c.agent.id,ids:_.map(t,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else if("voice"===c.channel){for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.user.addQueues({id:c.agent.id,ids:_.map(o,"id"),channel:c.channel,penalty:_.trim(s,"penalty ")}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}else d.user.addQueues({id:c.agent.id,ids:_.map(r,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Queues association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:QUEUES_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","channel","direction","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentQueueAddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.user.getTeams({id:l.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.agent=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("STAFF.ALL_TEAMS"),labelSelected:t.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.user.removeTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.user.addTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,n,i,s,t,a,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=t,m.setting=a,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.agent=d||e.params.agent||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.queueaddchannel=function(e,n,t,a){i.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],channel:n,direction:a||"inbound",crudPermissions:m.crudPermissions}})},m.teamadddialog=function(e,n){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,setting:a,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.onEnableScreenRecordingByAgentSelection=function(){["phoneBarEnableAutomaticScreenRecording"].forEach(function(e){m.agent.phoneBarEnableScreenRecordingByAgent&&(m.agent[e]=!m.agent.phoneBarEnableScreenRecordingByAgent)})},m.onEnableAutomaticScreenRecordingSelection=function(){["phoneBarEnableScreenRecordingByAgent"].forEach(function(e){m.agent.phoneBarEnableAutomaticScreenRecording&&(m.agent[e]=!m.agent.phoneBarEnableAutomaticScreenRecording)})},m.alert=r.info,m.gotoAgents=function(){e.go("app.staff.agents",{},{reload:"app.staff.agents"})},m.saveAgent=function(){m.agent=_.omit(m.agent,"userpic"),o.user.update({id:m.agent.id},m.agent).$promise.then(function(){r.success({title:"Agent updated!",msg:m.agent.name?m.agent.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshAgent=function(){return o.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})},l.hasRole("admin")?o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.contexts,{id:e.resourceId})}),t=null;if(m.agent&&(t=_.find(m.contexts,{name:m.agent.context})),t&&!_.some(n,["id",t.id])){var a=_.find(m.contexts,{id:t.id});a.canSelect=!1,n.push(a)}m.contexts=n}):o.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){m.contexts=e.rows||[]})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","agent","userProfileSection"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TEAM",g.team=angular.copy(l),g.teams=r,g.newTeam=!1,g.team||(g.team={},g.title="STAFF.NEW_TEAM",g.newTeam=!0),g.addNewTeam=function(){g.errors=[],d.team.save(g.team).$promise.then(function(e){g.teams.unshift(e.toJSON()),o.success({title:"Team properly created",msg:g.team.name?g.team.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTeam=function(){g.errors=[],d.team.update({id:g.team.id},g.team).$promise.then(function(e){var n=_.find(g.teams,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Team properly saved!",msg:g.team.name?g.team.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTeam=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.team.delete({id:g.team.id}).$promise.then(function(){_.remove(g.teams,{id:g.team.id}),o.success({title:"Team properly deleted!",msg:(g.team.name||"team")+" has been deleted!"}),v(g.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","teams","team","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.team.getAgents({id:c.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.team=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.team.removeAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.team.addAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("STAFF.ALL_AGENTS"),labelSelected:r.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","team","teams","realtime","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.teams=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="teams",f.listOrder="",f.listOrderAsc=null,f.selectedTeams=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams?f.teams.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("team")+"?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTeams=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.team.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Teams",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTeam=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:n,teams:f.teams.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTeam=y,f.exportSelectedTeams=function(){var e=angular.copy(f.selectedTeams);return f.selectedTeams=[],e},f.deleteSelectedTeams=function(e){var n=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+f.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTeams.forEach(function(e){y(e)}),f.selectedTeams=[]})},f.deselectTeams=function(){f.selectedTeams=[]},f.selectAllTeams=function(){f.selectedTeams=f.teams.rows};var b=!0,A=1;function E(e){f.teams=e||{count:0,rows:[]}}function y(e){m.team.delete({id:e.id}).$promise.then(function(){_.remove(f.teams.rows,{id:e.id}),f.teams.count-=1,f.teams.rows.length||f.getTeams(),p.success({title:_.startCase("Team")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","teams","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TELEPHONE",g.telephone=angular.copy(l),g.telephones=r,g.newTelephone=!1,g.telephone||(g.telephone={role:"telephone",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_TELEPHONE",g.newTelephone=!0),g.addNewTelephone=function(){g.errors=[],d.user.save(g.telephone).$promise.then(function(e){g.telephones.unshift(e.toJSON()),o.success({title:"Telephone properly created",msg:g.telephone.name?g.telephone.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTelephone=function(){g.errors=[],d.user.update({id:g.telephone.id},g.telephone).$promise.then(function(e){var n=_.find(g.telephones,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Telephone properly saved!",msg:g.telephone.name?g.telephone.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTelephone=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.user.delete({id:g.telephone.id}).$promise.then(function(){_.remove(g.telephones,{id:g.telephone.id}),o.success({title:"Telephone properly deleted!",msg:(g.telephone.name||"telephone")+" has been deleted!"}),v(g.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","telephones","telephone","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.telephone=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.telephone.id,newPassword:r.password};r.currentUser.id==r.telephone.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Telephone password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.telephone.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.telephoneForm.password.$setValidity("oldPasswordMatch",!1):t.telephoneForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","telephone","setting","Auth"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.telephone=c||e.params.telephone||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.changepassworddialog=function(e,n){t.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:u.telephones?u.telephones.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTelephones=function(){e.go("app.staff.telephones",{},{reload:"app.staff.telephones"})},u.saveTelephone=function(){r.user.update({id:u.telephone.id},u.telephone).$promise.then(function(){l.success({title:"Telephone updated!",msg:u.telephone.name?u.telephone.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.telephone&&(t=_.find(u.contexts,{name:u.telephone.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","telephone","userProfileSection"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.telephones=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="telephones",f.listOrder="",f.listOrderAsc=null,f.selectedTelephones=[],f.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.staff.telephones.edit",{id:e.id,telephone:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("telephone")+"?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTelephones=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.user.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Telephones",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTelephone=function(e,n){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:n,telephones:f.telephones.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTelephone=y,f.exportSelectedTelephones=function(){var e=angular.copy(f.selectedTelephones);return f.selectedTelephones=[],e},f.deleteSelectedTelephones=function(e){var n=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+f.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTelephones.forEach(function(e){y(e)}),f.selectedTelephones=[]})},f.deselectTelephones=function(){f.selectedTelephones=[]},f.selectAllTelephones=function(){f.selectedTelephones=f.telephones.rows};var b=!0,A=1;function E(e){f.telephones=e||{count:0,rows:[]}}function y(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(f.telephones.rows,{id:e.id}),f.telephones.count-=1,f.telephones.rows.length||f.getTelephones(),p.success({title:_.startCase("Telephone")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","telephones","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USERPROFILE",g.userProfile=angular.copy(l),g.userProfiles=r,g.newUserProfile=!1,g.userProfile||(g.userProfile={crudPermissions:["r"],downloadAttachments:!0,downloadCallySquareRecordings:!0,downloadContactManagerLists:!0,downloadJscriptySessions:!0,downloadOmnichannelInteractions:!0,downloadScreenRecordings:!0,downloadVoiceRecordings:!0},g.title="STAFF.NEW_USERPROFILE",g.newUserProfile=!0),g.addNewUserProfile=function(){g.errors=[],d.userProfile.save(g.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(s.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),g.userProfiles.unshift(e.toJSON()),o.success({title:"UserProfile properly created",msg:g.userProfile.name?g.userProfile.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUserProfile=function(){g.errors=[],d.userProfile.update({id:g.userProfile.id},g.userProfile).$promise.then(function(e){var n=_.find(g.userProfiles,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"UserProfile properly saved!",msg:g.userProfile.name?g.userProfile.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUserProfile=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The userProfile will be deleted.").ariaLabel("Delete UserProfile").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.userProfile.delete({id:g.userProfile.id}).$promise.then(function(){_.remove(g.userProfiles,{id:g.userProfile.id}),o.success({title:"UserProfile properly deleted!",msg:(g.userProfile.name||"userProfile")+" has been deleted!"}),v(g.userProfile)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","userProfiles","userProfile","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserProfileDialogController",e)}(),function(){"use strict";function e(n,a,i,e,t,s,o){var r=this;function l(e){n.hide(e)}r.newUserProfile=!0,r.userProfile=angular.copy(t),r.userProfiles=s,r.title=o.instant("STAFF.CLONE_USERPROFILE"),t&&t.name&&(r.title+=": "+t.name),r.cloneUserProfile=function(){return e.userProfile.clone({id:t.id},r.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(o.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),r.userProfiles.unshift(e.toJSON()),i.success({title:"UserProfile properly cloned",msg:r.userProfile.name?r.userProfile.name+" has been cloned!":""}),a.go("app.staff.userProfiles.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.clone"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","userProfile","userProfiles","$translate"],angular.module("app.staff").controller("UserProfilecloneController",e)}(),function(){"use strict";function e(t,o,r,l,d,e,n,c){var m=this;function u(e,n){switch(e.allResourcesEnabled="full"===n,n){case"full":return _.find(m.statusList,["tag","full"]);case"partial":return _.find(m.statusList,["tag","partial"]);case"disabled":return _.find(m.statusList,["tag","disabled"]);case"unlicensed":return _.find(m.statusList,["tag","unlicensed"]);case"unknown":default:return _.find(m.statusList,["tag","unknown"])}}function p(e){return l(function(n,t){var o,a;void 0!==e.channel&&_.includes(e.route,"Queue")?(a=e,l(function(n,t){var e=void 0!==a.channel&&"bull"===a.channel?"outbound":"inbound";return d[a.route].get({fields:"id,name,strategy,type",channel:"bull"===a.channel?"voice":a.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})).then(function(e){n(e)}).catch(function(e){t(e)}):(o=e,l(function(a,n){switch(o.route){case"voiceExtension":var e;switch(o.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}break;case"interval":var t=!0;break;case"disposition":var i=!0;break;case"user":var s;switch(o.title){case"Agents":s="agent";break;case"Telephones":s="telephone";break;case"Users":s="user"}}if("Reports"===o.title){if(!o.reportType)return d.analyticDefaultReport.get({nolimit:!0}).$promise.then(function(t){d.analyticCustomReport.get({nolimit:!0}).$promise.then(function(e){var n=_.union(t.rows,e.rows);a({count:n.length,rows:n.rows})})}).catch(function(e){n(e)});switch(o.reportType){case"default":o.route="analyticDefaultReport";break;case"custom":o.route="analyticCustomReport"}}return d[o.route].get({role:s||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:t?"null":void 0,MailAccountId:i?"null":void 0,FaxAccountId:i?"null":void 0,SmsAccountId:i?"null":void 0,OpenchannelAccountId:i?"null":void 0,ChatWebsiteId:i?"null":void 0,WhatsappAccountId:i?"null":void 0,ListId:i?"null":void 0,nolimit:!0}).$promise.then(function(e){a(e)}).catch(function(e){n(e)})})).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(e,n,t){var a=e&&0<e.length?e[0]:null;if(!a)return t;var i,s,o=_.find(n,["sectionId",a.id]);return o?(n=_.remove(n,["sectionId",a.id]),(i=a,s=o.id,l(function(n,t){d.userProfileResource.get({sectionId:s}).$promise.then(function(n){return p(i).then(function(e){return _.differenceBy(n.rows,e.rows,"id")})}).then(function(e){_.isEmpty(e)?n():t()}).catch(function(e){t(e)})})).then(function(){return t="full",g(e.shift(),n,t)}).catch(function(e){return l.reject(e)})):void 0}function a(a){var t="Marketplace"===a.title?"AppZone":a.title;m.license?void 0===a.permissions||a.permissions.association?void 0===a.license||m.license[a.license]?d.userProfileSection.get({userProfileId:m.userProfile.id,category:t}).$promise.then(function(e){var n=e&&e.rows&&0<e.rows.length?e.rows:[];if("Dashboards"===a.title)return _.isEmpty(n)?"disabled":n[0].autoAssociation?"full":d.userProfileResource.get({sectionId:n[0].id,resourceId:101}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)?"full":"partial"});var t=_.filter(a.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e});return n.length!==t.length?0===n.length?"disabled":"partial":_.every(n,["autoAssociation",!0])?"full":g(_.filter(t,function(e){return void 0===e.permissions||e.permissions.association?e:void 0}),n,"partial")}).then(function(e){a.status=u(a,e)}).catch(function(e){var n=e?"unknown":"partial";a.status=u(a,n),e&&c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GETRESOURCES("+t.toUpperCase()+")",msg:e.status?JSON.stringify(e.data):e.toString()})}):a.status=u(a,"unlicensed"):d.userProfileSection.get({userProfileId:m.userProfile.id,sectionId:a.id}).$promise.then(function(e){var n=(e&&1===e.rows.length?e.rows[0]:null)?"full":"disabled";a.status=u(a,n)}):a.status=u(a,"unknown")}m.userProfile={},m.license={},m.navigation=e.getNavigation(),m.modules=m.navigation[0].children,m.statusList=[{id:0,name:"Fully Enabled",color:"green-A700-bg",info:"All resources enabled",tag:"full"},{id:1,name:"Partially Enabled",color:"orange-A700-bg",info:"Some resources enabled",tag:"partial"},{id:2,name:"Disabled",color:"grey-A400-bg",info:"No resources enabled",tag:"disabled"},{id:3,name:"Unlicensed",color:"red-A700-bg",info:"Module not included in the license",tag:"unlicensed"},{id:4,name:"Unknown",color:"grey-A700-bg",info:"Unknown status",tag:"unknown"}],m.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],m.init=function(e,n){m.userProfile=e,m.license=n},m.onChangeEnableAllResources=function(n){var e=void 0!==n.permissions&&!n.permissions.association,a="Marketplace"===n.title?"AppZone":n.title;if("Fully Enabled"!==n.status.name){var i=[];if(e)return i.push({category:a,sectionId:n.id,name:a,enabled:!0,crudPermissions:"red"}),d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})});var t=o.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_ENABLE_ALL",{sectionName:r.instant(n.translate)})).ariaLabel("Warning").ok(r.instant("STAFF.CONFIRM")).cancel(r.instant("STAFF.CANCEL"));o.show(t).then(function(){switch(a){case"Dashboards":_.map(m.dashboardSections,function(e){i.push({category:a,sectionId:e.id,name:e.title,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})});break;default:_.map(n.children,function(e){var n=!(void 0===e.permissions||!e.permissions.hidden);if(!n){var t=e.title;switch(a){case"CallySquare":t="Projects"===t?"SquareProjects":t}i.push({category:a,sectionId:e.id,name:t,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})}})}return d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})})}).catch(function(e){e?c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()}):n.status=u(n,n.status.tag)})}else if("Fully Enabled"===n.status.name){n.status=u(n,"disabled");var s=[];switch(a){case"Settings":case"Help":s=[n.id];break;case"Dashboards":s=_.map(m.dashboardSections,function(e){return e.id});break;default:s=_.map(n.children,function(e){return e.id})}return d.userProfile.removeSections({id:m.userProfile.id,ids:s}).$promise.then(function(){c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.REMOVESECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},m.manageResources=function(e,n){o.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!1,locals:{userProfile:m.userProfile,userProfiles:[],section:e}}).then(function(){a(e)})},m.checkSectionResources=a}e.$inject=["$document","$mdDialog","$translate","$q","api","msNavigationService","Auth","toasty"],angular.module("app.staff").controller("UserProfilePermissionsController",e)}(),function(){"use strict";function e(n,t,i,o,r,e,a,l,s,d){var c=this;function m(){var a=void 0!==c.selectedSection.pending&&c.selectedSection.pending;return i(function(t,n){r.userProfileSection.get({userProfileId:c.userProfile.id,sectionId:c.selectedSection.id}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;a||(c.selectedSection.enabled=!!n&&!!n.enabled,c.selectedSection.autoAssociation=!!n&&!!n.autoAssociation,c.selectedSection.crudPermissions=v(n?n.crudPermissions:c.userProfile.crudPermissions)),t(n)}).catch(function(e){n(e)})})}function u(){return i(function(n,t){c.loadedSection?r.userProfileResource.get({sectionId:c.loadedSection.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)}):n(null)})}function p(){return i(function(n,t){void 0!==c.selectedSection.channel&&_.includes(c.selectedSection.route,"Queue")?i(function(n,t){var e=void 0!==c.selectedSection.channel&&"bull"===c.selectedSection.channel?"outbound":"inbound";return r[c.selectedSection.route].get({fields:"id,name,strategy,type",channel:"bull"===c.selectedSection.channel?"voice":c.selectedSection.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){n(e)}).catch(function(e){t(e)}):i(function(n,t){var e,a;if("voiceExtension"===c.selectedSection.route)switch(c.selectedSection.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}if("user"===c.selectedSection.route)switch(c.selectedSection.title){case"Agents":a="agent";break;case"Telephones":a="telephone";break;case"Users":a="user"}if("interval"===c.selectedSection.route)var i=!0;if("disposition"===c.selectedSection.route)var s=!0;if("Reports"===c.selectedSection.title&&(c.selectedSection.route="default"===c.selectedSection.reportType?"analyticDefaultReport":"analyticCustomReport"),"Dashboards"!==c.selectedSection.title)return r[c.selectedSection.route].get({role:a||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:i?"null":void 0,MailAccountId:s?"null":void 0,FaxAccountId:s?"null":void 0,SmsAccountId:s?"null":void 0,OpenchannelAccountId:s?"null":void 0,ChatWebsiteId:s?"null":void 0,WhatsappAccountId:s?"null":void 0,ListId:s?"null":void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)});n({count:1,rows:[{id:101,name:l.instant("DASHBOARDS.GENERAL")}]})}).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(){var i=void 0!==c.selectedSection.pending&&c.selectedSection.pending,s=[];return u().then(function(e){var n;return s=e&&e.rows?e.rows:[],"Reports"===c.selectedSection.title&&(c.associatedReports=c.associatedReports?c.associatedReports:s,n=c.associatedReports,s=_.filter(n,{type:"default"===c.selectedSection.reportType?"DefaultReports":"CustomReports"})),void 0===c.selectedSection.permissions||c.selectedSection.permissions.association?p():{rows:[]}}).then(function(e){c.items=e.rows?_.map(e.rows,function(e){var n,t;return"Reports"===c.selectedSection.title&&(e.fullPath=(n=e.parent,t=c.treeStructure[0].text,t=function e(n,t,a){if(!a||_.isEmpty(a.children))return n;var a=_.find(a.children,function(e){return _.includes(t,e.id)?e:void 0});return n+=a?"/"+a.text:"",e(n,t,a)}(t,n,c.treeStructure[0])).replace(" ","_")),e.isValid=!0,e}):[],i||(c.selectedSection.selectedItems=_.map(s,function(e){return _.find(c.items,{id:e.resourceId})}));var n,t=_.differenceBy(c.selectedSection.selectedItems,c.items,"id");switch(_.isEmpty(t)||(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,t,"id")),c.selectedSection.title){case"Contexts":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"MusicOnHolds":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"Reports":var a=(n=c.allReportsSelected,_.filter(n,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")}));c.selectedSection.selectedItems=b(c.selectedSection.selectedItems),c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,a,"id")}c.dualMultiselectOptions.selectedItems=c.selectedSection.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.items,c.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})}function v(e){return e&&(c.selectedSection.allowEdit=!!_.includes(e,"e"),c.selectedSection.allowDelete=!!_.includes(e,"d")),function(){var e=["r"];if(c.selectedSection.allowEdit)e.push("e");else{var n=_.indexOf(e,["e"]);0<n&&c.selectedSection.crudPermissions.replace("e","")}if(c.selectedSection.allowDelete)e.push("d");else{var n=_.indexOf(e,["d"]);0<n&&c.selectedSection.crudPermissions.replace("d","")}return e}()}function h(e){var n=_.findIndex(c.subsections,function(e){return e.id==c.selectedSection.id});c.subsections[n].pending=e,f()}function f(){return c.pendingChanges=_.some(c.subsections,["pending",!0])}function b(e){return _.remove(e,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")})}function A(){_.isEmpty(c.selectedSection.selectedItems)?c.allReportsSelected=_.remove(c.allReportsSelected,function(e){return e.type===("default"===c.selectedSection.reportType?"CustomReports":"DefaultReports")}):c.selectedSection.selectedItems.forEach(function(e){_.some(c.allReportsSelected,{id:e.id,parent:e.parent})||c.allReportsSelected.push(e)})}c.userProfile=e,c.penalty=0,c.section=angular.copy(d),c.title=l.instant("STAFF.PERMISSIONS_SECTION_TITLE",{sectionName:l.instant(c.section.translate)}),c.items=[],c.selectedItems=[],c.subsections=_.filter(c.section.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e}),c.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],c.dashboardItems=[],"Dashboards"===c.section.title&&(c.dashboardItems=c.subsections,c.subsections=c.dashboardSections),c.selectedSection=null,c.loadedSection=null,c.allReportsSelected=[],c.closeDialog=function(e){if(c.pendingChanges){var n=t.confirm({skipHide:!0}).title("Warning").textContent(l.instant("STAFF.PERMISSIONS_WARNING_CLOSE")).ariaLabel("Warning").targetEvent(e).ok(l.instant("STAFF.CLOSE")).cancel(l.instant("STAFF.CANCEL"));t.show(n).then(function(){t.hide()})}else t.hide()},c.onChangeSection=function(){return m().then(function(e){if(c.loadedSection=e,"Reports"===c.selectedSection.title)return i(function(n,t){r.analyticTreeReport.get({}).$promise.then(function(e){c.treeReports=e.rows||[],n(c.treeReports)}).catch(function(e){t(e)})}).then(function(){if(!c.selectedSection.reportType)return u().then(function(e){c.allReportsSelected=e?_.map(e.rows,function(e){return{id:e.resourceId,name:e.name,type:e.type}}):[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREE_REPORT_STRUCTURE",msg:e.data?JSON.stringify(e.data):e.toString()})});g()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})},c.onChangeVisibility=function(){c.selectedSection.enabled=!c.selectedSection.enabled,h(!0)},c.onChangeAutoAssociation=function(){if(!c.selectedSection.autoAssociation){for(var e=[],n=0;n<c.dualMultiselectOptions.items.length;n++)e.push(c.dualMultiselectOptions.items[n]),c.dualMultiselectOptions.selectedItems.push(c.dualMultiselectOptions.items[n]);c.dualMultiselectOptions.items=[],c.dualMultiselectOptions.transferCallback(e,!1)}h(!0)},c.onChangeReportType=function(){c.treeStructure="default"===c.selectedSection.reportType?c.treeReports[0]?angular.fromJson(c.treeReports[0].tree):[]:c.treeReports[1]?angular.fromJson(c.treeReports[1].tree):[],c.selectedSection.selectedItems&&(c.allReportsSelected=b(c.allReportsSelected),A());g()},c.setPermission=function(e){"edit"===e?c.selectedSection.allowEdit=!c.selectedSection.allowEdit:"delete"===e&&(c.selectedSection.allowDelete=!c.selectedSection.allowDelete);c.selectedSection.crudPermissions=v(),h(!0)},c.saveSection=function(){var a="Marketplace"===c.section.title?"AppZone":c.section.title,e=_(c.subsections).filter({pending:!0}).map(function(e){var n="CallySquare"===a&&"Projects"===e.title?"SquareProjects":e.title,t="Reports"===n?c.allReportsSelected:e.selectedItems;return"Integrations"===a&&(e.autoAssociation=!0),{category:a,sectionId:e.id,name:n,enabled:e.enabled,autoAssociation:e.autoAssociation,crudPermissions:_.map(e.crudPermissions).join(""),Resources:_.map(t,function(e){return{name:e.name,resourceId:e.id,type:function(e,n){if("Reports"!==e)return e;{if(n.parent){var t=_.startsWith(n.parent,"motion")?"Default":"Custom";return t+e}return n.type}}(n,e)}})}}).value();return r.userProfile.addSections({id:c.userProfile.id},e).$promise.then(function(){c.subsections.forEach(function(e){e.pending=void 0}),c.associatedReports=null,f(),"Reports"!==c.selectedSection.title||c.selectedSection.reportType||n.userProfileForm.$setPristine(),o.success({title:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_TITLE",{sectionName:l.instant(a.translate)}),msg:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_MESSAGE")})}).then(function(){return m().then(function(e){c.loadedSection=e})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",line4:"fullPath",labelAll:l.instant("STAFF.PERMISSIONS_ALL_RESOURCES"),labelSelected:l.instant("STAFF.PERMISSIONS_SELECTED_RESOURCES"),transferCallback:function(e,n){h(!0),n?(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,e,"id"),c.selectedSection.autoAssociation=!1):c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,e,"id"),"Reports"===c.selectedSection.title&&A()}}}e.$inject=["$scope","$mdDialog","$q","toasty","api","userProfile","userProfiles","$translate","Auth","section"],angular.module("app.staff").controller("UserProfilepermissionsmanageController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.userProfile=c||e.params.userProfile||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.permissionsmanagedialog=function(e,n){t.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.clonedialog=function(e,n){t.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUserProfiles=function(){e.go("app.staff.userProfiles",{},{reload:"app.staff.userProfiles"})},u.saveUserProfile=function(){r.userProfile.update({id:u.userProfile.id},u.userProfile).$promise.then(function(){l.success({title:"UserProfile updated!",msg:u.userProfile.name?u.userProfile.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuserProfile",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","userProfile","userProfileSection"],angular.module("app.staff").controller("UserProfileController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.userProfiles=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="userProfiles",f.listOrder="",f.listOrderAsc=null,f.selectedUserProfiles=[],f.query={fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,page:1},f.arraycrudPermissions=_.keyBy([{option:"Read_permission",value:"'r'",disabled:!0},{option:"Edit_permission",value:"'e'"},{option:"Delete_permission",value:"'d'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.userProfiles&&0<f.userProfiles.count&&f.userProfiles.rows.forEach(function(e){var n=[];e.crudPermissions.forEach(function(e){n.push(f.arraycrudPermissions[e].option)});var t=[];n.forEach(function(e){t.push(r.instant("STAFF."+e.toUpperCase()))}),e.selectedcrudPermissions=t.join(", ")}),f.editstate=function(e,n){t.go("app.staff.userProfiles.edit",{id:e.id,userProfile:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:f.userProfiles?f.userProfiles.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("userProfile")+"?").htmlContent("<b>"+(e.name||"userProfile")+"</b> will be deleted.").ariaLabel("delete userProfile").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getUserProfiles=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.userProfile.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="UserProfiles",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditUserProfile=function(e,n){i.show({controller:"CreateOrEditUserProfileDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{userProfile:n,userProfiles:f.userProfiles.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteUserProfile=y,f.exportSelectedUserProfiles=function(){var e=angular.copy(f.selectedUserProfiles);return f.selectedUserProfiles=[],e},f.deleteSelectedUserProfiles=function(e){var n=i.confirm().title("Are you sure want to delete the selected userProfiles?").htmlContent("<b>"+f.selectedUserProfiles.length+" selected</b> will be deleted.").ariaLabel("delete UserProfiles").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedUserProfiles.forEach(function(e){y(e)}),f.selectedUserProfiles=[]})},f.deselectUserProfiles=function(){f.selectedUserProfiles=[]},f.selectAllUserProfiles=function(){f.selectedUserProfiles=f.userProfiles.rows};var b=!0,A=1;function E(e){f.userProfiles=e||{count:0,rows:[]}}function y(e){m.userProfile.delete({id:e.id}).$promise.then(function(){_.remove(f.userProfiles.rows,{id:e.id}),f.userProfiles.count-=1,f.userProfiles.rows.length||f.getUserProfiles(),p.success({title:_.startCase("UserProfile")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuserProfile"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuserProfile",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getUserProfiles())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","userProfiles","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("UserProfilesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.user=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_USER",m.user=angular.copy(i),m.users=n,m.newUser=!1,m.user||(m.user={role:"user",autointernal:!0,context:"from-sip"},m.title="STAFF.NEW_USER",m.newUser=!0),m.addNewUser=function(){m.errors=[],s.user.save(m.user).$promise.then(function(e){m.users.unshift(e.toJSON()),a.success({title:"User properly created",msg:m.user.name?m.user.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveUser=function(){m.errors=[],s.user.update({id:m.user.id},m.user).$promise.then(function(e){var n=_.find(m.users,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"User properly saved!",msg:m.user.name?m.user.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteUser=function(e){if(o.getCurrentUser().id===m.user.id)return a.error({title:"User not deleted!",msg:"You can't remove yourself"});m.errors=[];var n=t.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.user.id}).$promise.then(function(){_.remove(m.users,{id:m.user.id}),a.success({title:"User properly deleted!",msg:(m.user.name||"user")+" has been deleted!"}),p(m.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p,s.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var g="user-setting:update:user-"+m.user.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","users","user","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.currentUser=i.getCurrentUser(),s.errors=[],s.user=a,s.generateApiKey=function(){s.errors=[],t.user.createApiKey({id:s.user.id}).$promise.then(function(e){s.user.apiKey=e.api_key||"N/A",n.success({title:"User API key updated!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.createApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.createApiKey"}]})},s.removeApiKey=function(){s.errors=[],t.user.removeApiKey({id:s.user.id}).$promise.then(function(){s.user.apiKey="N/A",n.success({title:"User API key removed!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.removeApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.removeApiKey"}]})},s.closeDialog=o}e.$inject=["$mdDialog","toasty","api","user","Auth"],angular.module("app.staff").controller("UserapikeymanagerController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.user=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.user=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.user.id,newPassword:r.password};r.currentUser.id==r.user.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"User password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.userForm.password.$setValidity("oldPasswordMatch",!1):t.userForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","user","setting","Auth"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=i,m.setting=s,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.user=d||e.params.user||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.apikeymanagerdialog=function(e,n){t.show({controller:"UserapikeymanagerController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){t.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,setting:s,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.alert=r.info,m.gotoUsers=function(){e.go("app.staff.users",{},{reload:"app.staff.users"})},m.saveUser=function(){m.user=_.omit(m.user,"userpic"),o.user.update({id:m.user.id},m.user).$promise.then(function(){r.success({title:"User updated!",msg:m.user.name?m.user.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshUser=function(){return o.user.get({id:m.user.id,userSetting:!0}).$promise.then(function(e){m.user=e})},o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.user.getApiKey({id:m.user.id}).$promise.then(function(e){m.user.apiKey=e.api_key?e.api_key:"N/A"}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_APIKEY",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","user","userProfileSection"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r,l,d,c,m,u,p){var g=this;g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.users=n||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.table="users",g.listOrder="",g.listOrderAsc=null,g.selectedUsers=[],g.query={fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",role:"admin,user",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.editstate=function(e,n){t.go("app.staff.users.edit",{id:e.id,user:e,crudPermissions:g.crudPermissions})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("user")+"?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},g.success=f,g.getUsers=b,g.createOrEditUser=function(e,n){a.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:n,users:g.users.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteUser=A,g.exportSelectedUsers=function(){var e=angular.copy(g.selectedUsers);return g.selectedUsers=[],e},g.deleteSelectedUsers=function(e){var n=a.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+g.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedUsers.forEach(function(e){A(e)}),g.selectedUsers=[]})},g.deselectUsers=function(){g.selectedUsers=[]},g.selectAllUsers=function(){g.selectedUsers=g.users.rows},l.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.userProfiles=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=!0,h=1;function f(e){g.users=e||{count:0,rows:[]}}function b(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,f).$promise:(g.query.id=g.userProfile.id,g.query.section="Users",g.promise=l.userProfile.getResources(g.query,f).$promise)}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.users.rows,{id:e.id}),g.users.count-=1,g.users.rows.length||g.getUsers(),d.success({title:_.startCase("User")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){v?s(function(){v=!1}):(n||(h=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=h),g.getUsers())}),p.on("user-setting:update",b),e.$on("$destroy",function(){p.removeListener("user-setting:update",b)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","users","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.cannedAnswers=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="cannedAnswers",f.listOrder="",f.listOrderAsc=null,f.selectedCannedAnswers=[],f.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("cannedAnswer")+"?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCannedAnswers=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cannedAnswer.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CannedAnswers",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCannedAnswer=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:n,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCannedAnswer=y,f.exportSelectedCannedAnswers=function(){var e=angular.copy(f.selectedCannedAnswers);return f.selectedCannedAnswers=[],e},f.deleteSelectedCannedAnswers=function(e){var n=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+f.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCannedAnswers.forEach(function(e){y(e)}),f.selectedCannedAnswers=[]})},f.deselectCannedAnswers=function(){f.selectedCannedAnswers=[]},f.selectAllCannedAnswers=function(){f.selectedCannedAnswers=f.cannedAnswers.rows};var b=!0,A=1;function E(e){f.cannedAnswers=e||{count:0,rows:[]}}function y(e){m.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(f.cannedAnswers.rows,{id:e.id}),f.cannedAnswers.count-=1,f.cannedAnswers.rows.length||f.getCannedAnswers(),p.success({title:_.startCase("CannedAnswer")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","cannedAnswers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CANNEDANSWER",g.cannedAnswer=angular.copy(l),g.cannedAnswers=r,g.newCannedAnswer=!1,g.cannedAnswer||(g.cannedAnswer={},g.title="TOOLS.NEW_CANNEDANSWER",g.newCannedAnswer=!0),g.addNewCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.cannedAnswer).$promise.then(function(e){g.cannedAnswers.unshift(e.toJSON()),o.success({title:"CannedAnswer properly created",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.cannedAnswer.id},g.cannedAnswer).$promise.then(function(e){var n=_.find(g.cannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CannedAnswer properly saved!",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.cannedAnswer.id}).$promise.then(function(){_.remove(g.cannedAnswers,{id:g.cannedAnswer.id}),o.success({title:"CannedAnswer properly deleted!",msg:(g.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),v(g.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contact_item_types=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="contact_item_types",f.listOrder="",f.listOrderAsc=null,f.selectedContactItemType=[],f.query={fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContactItemTypeDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/contact_item_types/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{contactItemType:e,contact_item_types:f.contact_item_types.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("contactItemType")+"?").htmlContent("<b>"+(e.name||"contactItemType")+"</b> will be deleted.").ariaLabel("delete contactItemType").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContactItemType=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.contactItemType.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ContactItemType",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContactItemType=function(e,n){i.show({controller:"CreateOrEditContactItemTypeDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/contact_item_types/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{contactItemType:n,contact_item_types:f.contact_item_types.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContactItemType=y,f.exportSelectedContactItemType=function(){var e=angular.copy(f.selectedContactItemType);return f.selectedContactItemType=[],e},f.deleteSelectedContactItemType=function(e){var n=i.confirm().title("Are you sure want to delete the selected contact_item_types?").htmlContent("<b>"+f.selectedContactItemType.length+" selected</b> will be deleted.").ariaLabel("delete ContactItemTypes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContactItemType.forEach(function(e){y(e)}),f.selectedContactItemType=[]})},f.deselectContactItemType=function(){f.selectedContactItemType=[]},f.selectAllContactItemType=function(){f.selectedContactItemType=f.contact_item_types.rows};var b=!0,A=1;function E(e){f.contact_item_types=e||{count:0,rows:[]}}function y(e){m.contactItemType.delete({id:e.id}).$promise.then(function(){_.remove(f.contact_item_types.rows,{id:e.id}),f.contact_item_types.count-=1,f.contact_item_types.rows.length||f.getContactItemType(),p.success({title:_.startCase("ContactItemType")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcontactItemType"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcontactItemType",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getContactItemType())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contact_item_types","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("ContactItemTypesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CONTACTITEMTYPE",g.contactItemType=angular.copy(l),g.contact_item_types=r,g.newContactItemType=!1,g.contactItemType||(g.contactItemType={rgbBackgroundColor:"#2196f3"},g.title="TOOLS.NEW_CONTACTITEMTYPE",g.newContactItemType=!0),g.addNewContactItemType=function(){g.errors=[],d.contactItemType.save(g.contactItemType).$promise.then(function(e){g.contact_item_types.unshift(e.toJSON()),o.success({title:"ContactItemType properly created",msg:g.contactItemType.name?g.contactItemType.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contactItemType.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContactItemType=function(){g.errors=[],isNaN(g.contactItemType.OrderBy)?alert(s.instant("TOOLS.ORDER_BY_NUMERIC")):d.contactItemType.update({id:g.contactItemType.id},g.contactItemType).$promise.then(function(e){var n=_.find(g.contact_item_types,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"ContactItemType properly saved!",msg:g.contactItemType.name?g.contactItemType.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contactItemType.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContactItemType=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The contactItemType will be deleted.").ariaLabel("Delete ContactItemType").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.contactItemType.delete({id:g.contactItemType.id}).$promise.then(function(){_.remove(g.contact_item_types,{id:g.contactItemType.id}),o.success({title:"ContactItemType properly deleted!",msg:(g.contactItemType.name||"contactItemType")+" has been deleted!"}),v(g.contactItemType)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contactItemType.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contact_item_types","contactItemType","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactItemTypeDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CUSTOMDASHBOARD",g.customDashboard=angular.copy(l),g.customDashboards=r,g.newCustomDashboard=!1,g.customDashboard||(g.customDashboard={},g.title="TOOLS.NEW_CUSTOMDASHBOARD",g.newCustomDashboard=!0),g.addNewCustomDashboard=function(){g.errors=[],d.dashboard.save(g.customDashboard).$promise.then(function(e){g.customDashboards.unshift(e.toJSON()),o.success({title:"CustomDashboard properly created",msg:g.customDashboard.name?g.customDashboard.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomDashboard=function(){g.errors=[],d.dashboard.update({id:g.customDashboard.id},g.customDashboard).$promise.then(function(e){var n=_.find(g.customDashboards,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomDashboard properly saved!",msg:g.customDashboard.name?g.customDashboard.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomDashboard=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboard.delete({id:g.customDashboard.id}).$promise.then(function(){_.remove(g.customDashboards,{id:g.customDashboard.id}),o.success({title:"CustomDashboard properly deleted!",msg:(g.customDashboard.name||"customDashboard")+" has been deleted!"}),v(g.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customDashboards","customDashboard","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.customDashboards=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="customDashboards",f.listOrder="",f.listOrderAsc=null,f.selectedCustomDashboards=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:f.customDashboards?f.customDashboards.rows:[],crudPermissions:f.crudPermissions}})},f.gotodashboardgoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("customDashboard")+"?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCustomDashboards=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.dashboard.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CustomDashboards",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCustomDashboard=function(e,n){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:n,customDashboards:f.customDashboards.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCustomDashboard=y,f.exportSelectedCustomDashboards=function(){var e=angular.copy(f.selectedCustomDashboards);return f.selectedCustomDashboards=[],e},f.deleteSelectedCustomDashboards=function(e){var n=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+f.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCustomDashboards.forEach(function(e){y(e)}),f.selectedCustomDashboards=[]})},f.deselectCustomDashboards=function(){f.selectedCustomDashboards=[]},f.selectAllCustomDashboards=function(){f.selectedCustomDashboards=f.customDashboards.rows};var b=!0,A=1;function E(e){f.customDashboards=e||{count:0,rows:[]}}function y(e){m.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(f.customDashboards.rows,{id:e.id}),f.customDashboards.count-=1,f.customDashboards.rows.length||f.getCustomDashboards(),p.success({title:_.startCase("CustomDashboard")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","customDashboards","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=s,r.title=o.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),t.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(t,a,i,s,o){var r=this;r.customDashboard={};var l=[];function d(e,n,t){return o.dashboardItem.update(t).$promise.catch(function(e){console.error(e)})}r.init=function(e,n){return r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.customDashboard=e,r.customDashboard.draggable={enabled:!0,handle:".draggable",stop:d},r.customDashboard.resizable={enabled:!0,handle:".resizable",stop:d},r.customDashboard.widgets=[],r.customDashboard.crudPermissions=r.crudPermissions,l.push(i(function(e){e(r.voiceQueues=o.rpc.getVoiceQueues({fields:"id,name"}))})),l.push(i(function(n){o.chatWebsite.get({fields:"id,name"}).$promise.then(function(e){r.chatWebsites=e||{count:0,rows:[]},n(r.chatWebsites)})})),l.push(i(function(n){o.faxAccount.get({fields:"id,name"}).$promise.then(function(e){r.faxAccounts=e||{count:0,rows:[]},n(r.faxAccounts)})})),l.push(i(function(n){o.mailAccount.get({fields:"id,name"}).$promise.then(function(e){r.mailAccounts=e||{count:0,rows:[]},n(r.mailAccounts)})})),l.push(i(function(n){o.openchannelAccount.get({fields:"id,name"}).$promise.then(function(e){r.openchannelAccounts=e||{count:0,rows:[]},n(r.openchannelAccounts)})})),l.push(i(function(n){o.whatsappAccount.get({fields:"id,name"}).$promise.then(function(e){r.whatsappAccounts=e||{count:0,rows:[]},n(r.whatsappAccounts)})})),l.push(i(function(n){o.smsAccount.get({fields:"id,name"}).$promise.then(function(e){r.smsAccounts=e||{count:0,rows:[]},n(r.smsAccounts)})})),i.all(l).then(function(){return o.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].voiceQueues=r.voiceQueues,e.rows[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),e.rows[n].smsAccounts=r.smsAccounts,e.rows[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),e.rows[n].faxAccounts=r.faxAccounts,e.rows[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),e.rows[n].mailAccounts=r.mailAccounts,e.rows[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),e.rows[n].openchannelAccounts=r.openchannelAccounts,e.rows[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),e.rows[n].chatWebsites=r.chatWebsites,e.rows[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),e.rows[n].whatsappAccounts=r.whatsappAccounts,e.rows[n].whatsappAccountsSelected=_.map(r.whatsappAccounts.rows,"id"),e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",r.customDashboard.widgets.push(e.rows[n])}).catch(function(e){console.error(e)})})},r.createOrEditWidget=function(e){if(e&&e.attrs)for(var n=0;n<e.attrs.length;n+=1)"attrReport"===e.attrs[n].name&&(e.reportType=e.attrs[n].type),e[e.attrs[n].name]=e.attrs[n].value;t.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:r.customDashboard.widgets,license:null,setting:null,crudPermissions:r.crudPermissions}}).then(function(e){if(e)for(var n=0;n<r.customDashboard.widgets.length;n+=1)r.customDashboard.widgets[n].id===e.id&&(r.customDashboard.widgets[n].attrs=e.attrs,r.customDashboard.widgets[n].voiceQueues=r.voiceQueues,r.customDashboard.widgets[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),r.customDashboard.widgets[n].smsAccounts=r.smsAccounts,r.customDashboard.widgets[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),r.customDashboard.widgets[n].faxAccounts=r.faxAccounts,r.customDashboard.widgets[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),r.customDashboard.widgets[n].mailAccounts=r.mailAccounts,r.customDashboard.widgets[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),r.customDashboard.widgets[n].openchannelAccounts=r.openchannelAccounts,r.customDashboard.widgets[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),r.customDashboard.widgets[n].chatWebsites=r.chatWebsites,r.customDashboard.widgets[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),r.customDashboard.widgets[n].whatsappAccounts=r.whatsappAccounts,r.customDashboard.widgets[n].whatsappAccountsSelected=_.map(r.whatsappAccounts.rows,"id"),r.customDashboard.widgets[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+r.customDashboard.widgets[n].type+"/ms-widget-engine."+r.customDashboard.widgets[n].type+".html")})},r.deleteWidget=function(n){var e=t.confirm().title("Would you like to delete "+n.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");t.show(e).then(function(){return o.dashboardItem.delete({id:n.id}).$promise.then(function(e){_.remove(r.customDashboard.widgets,{id:n.id}),s.success({title:"Widget deleted!",msg:n.name?n.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","$q","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(n,e,t,a,o,i,s,r,l,d,c,m,u,p){var g=this;g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DASHBOARDITEM",g.dashboarditem=angular.copy(l),g.dashboard=r,g.newDashboardItem=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.dashboarditem?"web-report"==g.dashboarditem.type&&(g.apiName="custom"===g.dashboarditem.reportType?"analyticCustomReport":"analyticDefaultReport",d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:g.dashboarditem.attrReport}),g.dashboarditem.report=g.currentReport.name,g.query.parent=g.currentReport.parent})):(g.dashboarditem={type:"counter",attrChannel:"voice",titleFontSize:12,attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},g.title="TOOLS.NEW_DASHBOARDITEM",g.newDashboardItem=!0),g.addNewDashboardItem=function(){g.errors=[],d.dashboard.addItem({id:e.params.id},g.dashboarditem).$promise.then(function(e){g.dashboard.unshift(e.toJSON()),s.success({title:"DashboardItem properly created",msg:g.dashboarditem.name?g.dashboarditem.name+" has been created!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var n=0;n<e.data.errors.length;n+=1)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDashboardItem=function(){g.errors=[],d.dashboardItem.update({id:g.dashboarditem.id},g.dashboarditem).$promise.then(function(e){var n=_.find(g.dashboard,{id:e.id});n&&_.merge(n,e.toJSON()),s.success({title:"DashboardItem properly saved!",msg:g.dashboarditem.name?g.dashboarditem.name+" has been saved!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDashboardItem=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboardItem.delete({id:g.dashboarditem.id}).$promise.then(function(){_.remove(g.dashboard,{id:g.dashboarditem.id}),s.success({title:"DashboardItem properly deleted!",msg:(g.dashboarditem.name||"dashboarditem")+" has been deleted!"}),I(g.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=S,g.selectReport=function(){if(g.dashboarditem.report=g.selectedReport[0].name,g.dashboarditem.attrReport=g.selectedReport[0].id,g.dashboarditem.reportType=g.currentNode.custom?"custom":"default",!g.newDashboardItem){var e={name:"attrReport",type:g.dashboarditem.reportType,value:g.selectedReport[0].id};g.dashboarditem.attrs.splice(_.findIndex(g.dashboarditem.attrs,1,e))}n.dashboarditemForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.onTypeChange=function(){["web-report","iframe","clock","custom"].includes(g.dashboarditem.type)&&(g.dashboarditem.attrEmailAccounts=null,g.dashboarditem.attrFaxAccounts=null,g.dashboarditem.attrSmsAccounts=null,g.dashboarditem.attrOpenchannelAccounts=null,g.dashboarditem.attrWhatsappAccounts=null,g.dashboarditem.attrChatWebsites=null)},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){s.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=f(!1),g.treeCustomEvents=f(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=I,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],h=null;function f(e){return e?{loaded:E,select_node:b}:{loaded:y,select_node:A}}function b(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,S()}function A(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,S()}function E(){if(!g.newDashboardItem&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(!g.newDashboardItem&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);A(0,{node:e,selected:e.id})}}function S(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,T).$promise;else{if(!g.userProfileSection)return T(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,T).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),T({count:t.length,rows:t})}return T(null)}):T(null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function T(e){g.reports=e||{count:0,rows:[]},g.newDashboardItem||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function I(e){a.hide(e)}c.hasRole("admin")?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){g.voiceQueues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){h=e.rows||[]}).then(function(){for(var e=[],n=0;n<v.length;n++)e.push(d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:v[n].id}).$promise);return o.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<v.length;a++){var i=_.find(n,["sectionId",v[a].id]);if(i)if(i.autoAssociation){var s=[];h.forEach(function(e){e.type===v[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(t)}).then(function(e){var n=[],t=null;g.dashboarditem&&(t=_.find(h,{id:Number(g.dashboarditem.attrVoiceQueues)}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){n.push(e)})}t&&!_.some(n,["resourceId",t.id])&&h.forEach(function(e){e.id===t.id&&(e.canSelect=!1,n.push(e))}),g.voiceQueues=n}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)}));for(var i=0;i<g.mailAccount.length;i++)a&&g.mailAccount[i].id===a.id&&(g.mailAccount[i].canSelect=!1,t.push(g.mailAccount[i]));g.mailAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.faxAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.faxAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.faxAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)}));for(var i=0;i<g.faxAccount.length;i++)a&&g.faxAccount[i].id===a.id&&(g.faxAccount[i].canSelect=!1,t.push(g.faxAccount[i]));g.faxAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.smsAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.smsAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.smsAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)}));for(var i=0;i<g.smsAccount.length;i++)a&&g.smsAccount[i].id===a.id&&(g.smsAccount[i].canSelect=!1,t.push(g.smsAccount[i]));g.smsAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.openchannelAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.openchannelAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.openchannelAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)}));for(var i=0;i<g.openchannelAccount.length;i++)a&&g.openchannelAccount[i].id===a.id&&(g.openchannelAccount[i].canSelect=!1,t.push(g.openchannelAccount[i]));g.openchannelAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_WHATSAPPACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:2102}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.whatsappAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.whatsappAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.whatsappAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)}));for(var i=0;i<g.whatsappAccount.length;i++)a&&g.whatsappAccount[i].id===a.id&&(g.whatsappAccount[i].canSelect=!1,t.push(g.whatsappAccount[i]));g.whatsappAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATWEBSITE",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.chatWebsite,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.chatWebsite,{id:t.id});a.canSelect=!1,n.push(a)}g.chatWebsite=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)}));for(var i=0;i<g.chatWebsite.length;i++)a&&g.chatWebsite[i].id===a.id&&(g.chatWebsite[i].canSelect=!1,t.push(g.chatWebsite[i]));g.chatWebsite=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dashboard","dashboarditem","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.customDashboard=c||t.params.customDashboard||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:u.customDashboards?u.customDashboards.rows:[],crudPermissions:u.crudPermissions}})},u.gotogoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},u.alert=l.info,u.gotoCustomDashboards=function(){t.go("app.tools.customDashboards",{},{reload:"app.tools.customDashboards"})},u.saveCustomDashboard=function(){r.dashboard.update({id:u.customDashboard.id},u.customDashboard).$promise.then(function(){l.success({title:"CustomDashboard updated!",msg:u.customDashboard.name?u.customDashboard.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","customDashboard","userProfileSection"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(a,i,o,r,e,l,d,n,t,s,c){var m=this;if(m.currentUser=n.getCurrentUser(),m.disposition=angular.copy(e),m.setting=c,m.license=s,m.crudPermissions=t,m.newDisposition=!1,m.errors=[],m.disposition||(m.disposition={level:"first"},m.newDisposition=!0),l){var u=l.field;m.disposition[u]=l.id}function p(){return o(function(t,n){d.disposition.get({fields:"id,name,level,ParentId",sort:"id",nolimit:"true"}).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})}function g(e){"first"===e.level?m.firstLevelDisposition=e:(m.anySecondLevelDisposition=!0,m.secondLevelDisposition=e,m.firstLevelDisposition=_.find(m.dispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition||p().then(function(){m.firstLevelDisposition=_.find(m.allDispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition.canSelect=!1,m.dispositions.push(m.firstLevelDisposition)}))}function v(e){a.hide(e)}m.onInit=function(){var e={fields:"id,name,level,ParentId",id:l?l.id:void 0,section:"user"===m.currentUser.role?"Dispositions":void 0,MailAccountId:l?void 0:"null",FaxAccountId:l?void 0:"null",SmsAccountId:l?void 0:"null",OpenchannelAccountId:l?void 0:"null",ChatWebsiteId:l?void 0:"null",WhatsappAccountId:l?void 0:"null",ListId:l?void 0:"null",sort:"id",nolimit:"true"},n="get",t="disposition";l?(n="getDispositions",t=l.route):"user"===m.currentUser.role&&(n="getResources",t="userProfile",e.id=m.currentUser.userProfileId);(a=t,i=n,s=e,o(function(t,n){d[a][i](s).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})).then(function(e){m.dispositions=angular.copy(e),m.newDisposition||function(){if("first"===m.disposition.level)return;if(m.parentDisposition=_.find(m.dispositions,["id",m.disposition.ParentId]),!m.parentDisposition)return p().then(function(e){m.allDispositions=e;for(var n=0;n<m.allDispositions.length;n++){var t=m.allDispositions[n];if(t.id===m.disposition.ParentId){g(t),t.canSelect=!1,m.dispositions.push(t);break}}});g(m.parentDisposition)}()}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:["api",t,n].join(":"),msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var a,i,s},m.onFirstLevelSelection=function(){m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=_.some(m.dispositions,function(e){return e.ParentId===m.firstLevelDisposition.id&&e.id!=m.disposition.id})},m.addNewDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.save(m.disposition).$promise.then(function(e){m.dispositions.unshift(e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_CREATED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var n=0;n<e.data.errors.length;n+=1)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.update({id:m.disposition.id},m.disposition).$promise.then(function(e){var n=_.find(m.dispositions,{id:e.id});n&&_.merge(n,e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_SAVED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDisposition=function(e){m.errors=[];var n=_.some(m.dispositions,["ParentId",m.disposition.id]),t=a.confirm({skipHide:!0}).title(i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(i.instant("TOOLS.NOTIFICATIONS."+(n?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:m.disposition.name})).ariaLabel("Delete disposition").ok(i.instant("TOOLS.DELETE")).cancel(i.instant("TOOLS.CANCEL")).targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:m.disposition.id}).$promise.then(function(){r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.clearSelection=function(e){"first"===e?(m.firstLevelDisposition=void 0,m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=!1):m.secondLevelDisposition=void 0},m.closeDialog=v}e.$inject=["$mdDialog","$translate","$q","toasty","disposition","model","api","Auth","crudPermissions","license","setting"],angular.module("app.tools").controller("CreateOrEditDispositionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this;function f(e){h.dispositions=e||{count:0,rows:[]}}function b(){h.query.offset=(h.query.page-1)*h.query.limit,p.isAdmin()?h.promise=m.disposition.get(h.query,f).$promise:(h.query.id=h.userProfile.id,h.query.section="Dispositions",h.promise=m.userProfile.getResources(h.query,f).$promise)}function A(e){m.disposition.delete({id:e.id}).$promise.then(function(){b(),u.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)u.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}h.license=g,h.setting=v,h.currentUser=p.getCurrentUser(),h.dispositions=l||{count:0,rows:[]},h.userProfile=d,h.userProfileSection=c&&1==c.count?c.rows[0]:null,h.crudPermissions=p.parseCrudPermissions(h.userProfileSection?h.userProfileSection.crudPermissions:null),h.selectedDispositions=[],h.levels={first:"1st",second:"2nd",third:"3rd"},h.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,page:1},h.deleteconfirm=function(e,n){var t=_.some(h.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){A(e)})},h.success=f,h.getDispositions=b,h.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:null,license:h.license,setting:h.setting,crudPermissions:h.crudPermissions}}).then(function(e){!0===e&&b()})},h.deleteDisposition=A,h.exportSelectedDispositions=function(){var e=angular.copy(h.selectedDispositions);return h.selectedDispositions=[],e},h.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:h.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){h.selectedDispositions.forEach(function(e){A(e)}),h.selectedDispositions=[]})},h.deselectDispositions=function(){h.selectedDispositions=[]},h.selectAllDispositions=function(){h.selectedDispositions=h.dispositions.rows};var E=!0,y=1;e.$watch("vm.query.filter",function(e,n){E?o(function(){E=!1}):(n||(y=h.query.page),e!==n&&(h.query.page=1),e||(h.query.page=y),b())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dispositions","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("DispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.intervalIntervals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.interval.getIntervals(m.query,u).$promise}function g(e){d.interval.delete({id:e.id}).$promise.then(function(){_.remove(m.intervalIntervals.rows,{id:e.id}),m.intervalIntervals.count-=1,m.intervalIntervals.rows.length||p(),l.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.interval={},m.intervalIntervals={count:0,rows:[]},m.selectedIntervalIntervals=[],m.crudPermissions,m.sortableTable={animation:100,onSort:function(e){d.interval.addIntervals({id:m.interval.id},e.models).$promise.then(function(e){m.intervalIntervals.rows=e}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},m.query={fields:"createdAt,updatedAt,id,name,interval",nolimit:"true",limit:10,page:1},m.init=function(e,n){m.interval=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.sortableTable.disabled=!m.crudPermissions.canEdit,m.query.id=m.interval.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interval #")+e.id||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIntervalIntervals=p,m.createOrEditIntervalInterval=function(e,n){o.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:m.interval,interval:n,intervals:m.intervalIntervals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIntervalIntervals=function(){var e=angular.copy(m.selectedIntervalIntervals);return m.selectedIntervalIntervals=[],e},m.deleteIntervalInterval=g,m.deleteSelectedIntervalIntervals=function(e){var n=o.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+m.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIntervalIntervals.forEach(function(e){g(e)}),m.selectedIntervalIntervals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.interval=c||e.params.interval||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoIntervals=function(){e.go("app.tools.intervals",{},{reload:"app.tools.intervals"})},u.saveInterval=function(){r.interval.update({id:u.interval.id},u.interval).$promise.then(function(){l.success({title:"Interval updated!",msg:u.interval.name?u.interval.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","interval","userProfileSection"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.intervals=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="intervals",f.listOrder="",f.listOrderAsc=null,f.selectedIntervals=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.intervals.edit",{id:e.id,interval:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("interval")+"?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getIntervals=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.interval.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Intervals",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditInterval=function(e,n){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:n,intervals:f.intervals.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteInterval=y,f.exportSelectedIntervals=function(){var e=angular.copy(f.selectedIntervals);return f.selectedIntervals=[],e},f.deleteSelectedIntervals=function(e){var n=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+f.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIntervals.forEach(function(e){y(e)}),f.selectedIntervals=[]})},f.deselectIntervals=function(){f.selectedIntervals=[]},f.selectAllIntervals=function(){f.selectedIntervals=f.intervals.rows};var b=!0,A=1;function E(e){f.intervals=e||{count:0,rows:[]}}function y(e){m.interval.delete({id:e.id}).$promise.then(function(){_.remove(f.intervals.rows,{id:e.id}),f.intervals.count-=1,f.intervals.rows.length||f.getIntervals(),p.success({title:_.startCase("Interval")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","intervals","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_PAUSE",g.pause=angular.copy(l),g.pauses=r,g.newPause=!1,g.pause||(g.pause={},g.title="TOOLS.NEW_PAUSE",g.newPause=!0),g.addNewPause=function(){g.errors=[],d.pause.save(g.pause).$promise.then(function(e){g.pauses.unshift(e.toJSON()),o.success({title:"Pause properly created",msg:g.pause.name?g.pause.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePause=function(){g.errors=[],d.pause.update({id:g.pause.id},g.pause).$promise.then(function(e){var n=_.find(g.pauses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Pause properly saved!",msg:g.pause.name?g.pause.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePause=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.pause.delete({id:g.pause.id}).$promise.then(function(){_.remove(g.pauses,{id:g.pause.id}),o.success({title:"Pause properly deleted!",msg:(g.pause.name||"pause")+" has been deleted!"}),v(g.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","pauses","pause","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.pauses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="pauses",f.listOrder="",f.listOrderAsc=null,f.selectedPauses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{pause:e,pauses:f.pauses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("pause")+"?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPauses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.pause.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Pauses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPause=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:n,pauses:f.pauses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePause=y,f.exportSelectedPauses=function(){var e=angular.copy(f.selectedPauses);return f.selectedPauses=[],e},f.deleteSelectedPauses=function(e){var n=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+f.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPauses.forEach(function(e){y(e)}),f.selectedPauses=[]})},f.deselectPauses=function(){f.selectedPauses=[]},f.selectAllPauses=function(){f.selectedPauses=f.pauses.rows};var b=!0,A=1;function E(e){f.pauses=e||{count:0,rows:[]}}function y(e){m.pause.delete({id:e.id}).$promise.then(function(){_.remove(f.pauses.rows,{id:e.id}),f.pauses.count-=1,f.pauses.rows.length||f.getPauses(),p.success({title:_.startCase("Pause")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","pauses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;if(g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SCHEDULE",g.schedule=angular.copy(l),g.schedules=r,g.newSchedule=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.schedule){g.apiName=g.schedule.DefaultReportId?"analyticDefaultReport":"analyticCustomReport";var v=g.schedule.DefaultReportId?g.schedule.DefaultReportId:g.schedule.CustomReportId;d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:v}),g.schedule.report=g.currentReport.name,g.query.parent=g.currentReport.parent})}else g.schedule={output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1,sendIfEmpty:!0},g.title="TOOLS.NEW_SCHEDULE",g.newSchedule=!0;function h(e){return e?{loaded:A,select_node:f}:{loaded:E,select_node:b}}function f(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,y()}function b(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,y()}function A(){if(!g.newSchedule&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);f(0,{node:e,selected:e.id})}}function E(){if(!g.newSchedule&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,S).$promise;else{if(!g.userProfileSection)return S(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,S).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),S({count:t.length,rows:t})}return S(null)}):S(null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function S(e){g.reports=e||{count:0,rows:[]},g.newSchedule||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function T(e){a.hide(e)}g.addNewSchedule=function(){g.errors=[],d.schedule.save(g.schedule).$promise.then(function(e){g.schedules.unshift(e.toJSON()),o.success({title:"Schedule properly created",msg:g.schedule.name?g.schedule.name+" has been created!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSchedule=function(){g.errors=[],d.schedule.update({id:g.schedule.id},g.schedule).$promise.then(function(e){var n=_.find(g.schedules,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Schedule properly saved!",msg:g.schedule.name?g.schedule.name+" has been saved!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSchedule=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.schedule.delete({id:g.schedule.id}).$promise.then(function(){_.remove(g.schedules,{id:g.schedule.id}),o.success({title:"Schedule properly deleted!",msg:(g.schedule.name||"schedule")+" has been deleted!"}),T(g.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=y,g.selectReport=function(){g.schedule.report=g.selectedReport[0].name,g.currentNode.custom?(g.schedule.CustomReportId=g.selectedReport[0].id,delete g.schedule.DefaultReportId):(g.schedule.DefaultReportId=g.selectedReport[0].id,delete g.schedule.CustomReportId);e.scheduleForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){o.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=h(!1),g.treeCustomEvents=h(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=T,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccounts,{id:e.resourceId})}),t=null;if(g.schedule&&(t=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccounts=n})}else{var t=[],a=null;g.schedule&&(a=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)}));for(var i=0;i<g.mailAccounts.length;i++)a&&g.mailAccounts[i].id===a.id&&(g.mailAccounts[i].canSelect=!1,t.push(g.mailAccounts[i]));g.mailAccounts=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","schedules","schedule","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.schedules=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="schedules",f.listOrder="",f.listOrderAsc=null,f.selectedScheduler=[],f.query={fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,page:1},f.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{schedule:e,schedules:f.schedules.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.runconfirm=function(e,n){var t=i.confirm().title("Are you sure want to run the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be run.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){return m.schedule.run({id:e.id}).$promise},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("schedule")+"?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScheduler=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.schedule.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Scheduler",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSchedule=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:n,schedules:f.schedules.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSchedule=y,f.exportSelectedScheduler=function(){var e=angular.copy(f.selectedScheduler);return f.selectedScheduler=[],e},f.deleteSelectedScheduler=function(e){var n=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+f.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedScheduler.forEach(function(e){y(e)}),f.selectedScheduler=[]})},f.deselectScheduler=function(){f.selectedScheduler=[]},f.selectAllScheduler=function(){f.selectedScheduler=f.schedules.rows},m.analyticTreeReport.get({}).$promise.then(function(e){f.treeReports=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.mailAccounts,{id:e.resourceId})}),t=null;if(f.schedule&&(t=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}f.mailAccounts=n})}else{var t=[],a=null;f.schedule&&(a=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)}));for(var i=0;i<f.mailAccounts.length;i++)a&&f.mailAccounts[i].id===a.id&&(f.mailAccounts[i].canSelect=!1,t.push(f.mailAccounts[i]));f.mailAccounts=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.schedules=e||{count:0,rows:[]}}function y(e){m.schedule.delete({id:e.id}).$promise.then(function(){_.remove(f.schedules.rows,{id:e.id}),f.schedules.count-=1,f.schedules.rows.length||f.getScheduler(),p.success({title:_.startCase("Schedule")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","schedules","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SOUND",g.sound=angular.copy(l),g.sounds=r,g.newSound=!1,g.sound||(g.sound={},g.title="TOOLS.NEW_SOUND",g.newSound=!0),g.addNewSound=function(){g.errors=[],d.sound.save(g.sound).$promise.then(function(e){g.sounds.unshift(e.toJSON()),o.success({title:"Sound properly created",msg:g.sound.name?g.sound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSound=function(){g.errors=[],d.sound.update({id:g.sound.id},g.sound).$promise.then(function(e){var n=_.find(g.sounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Sound properly saved!",msg:g.sound.name?g.sound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.sound.delete({id:g.sound.id}).$promise.then(function(){_.remove(g.sounds,{id:g.sound.id}),o.success({title:"Sound properly deleted!",msg:(g.sound.name||"sound")+" has been deleted!"}),v(g.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sounds","sound","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sounds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sounds",f.listOrder="",f.listOrderAsc=null,f.selectedSounds=[],f.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{sound:e,sounds:f.sounds.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.sound.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sound")+"?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSounds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.sound.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Sounds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSound=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:n,sounds:f.sounds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSound=y,f.exportSelectedSounds=function(){var e=angular.copy(f.selectedSounds);return f.selectedSounds=[],e},f.deleteSelectedSounds=function(e){var n=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+f.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSounds.forEach(function(e){y(e)}),f.selectedSounds=[]})},f.deselectSounds=function(){f.selectedSounds=[]},f.selectAllSounds=function(){f.selectedSounds=f.sounds.rows},f.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:f.sounds.rows}})};var b=!0,A=1;function E(e){f.sounds=e||{count:0,rows:[]}}function y(e){m.sound.delete({id:e.id}).$promise.then(function(){_.remove(f.sounds.rows,{id:e.id}),f.sounds.count-=1,f.sounds.rows.length||f.getSounds(),p.success({title:_.startCase("Sound")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sounds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=15,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=a,o.uploadSounds=[],o.uploadState="none",o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/sounds"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["wav","mp3","gsm"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.sound={id:e.uniqueIdentifier,file:e},o.uploadSounds.unshift(o.sound),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the sound"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.sound.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api","Auth"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TAG",g.tag=angular.copy(l),g.tags=r,g.newTag=!1,g.tag||(g.tag={},g.title="TOOLS.NEW_TAG",g.newTag=!0),g.addNewTag=function(){g.errors=[],d.tag.save(g.tag).$promise.then(function(e){g.tags.unshift(e.toJSON()),o.success({title:"Tag properly created",msg:g.tag.name?g.tag.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTag=function(){g.errors=[],d.tag.update({id:g.tag.id},g.tag).$promise.then(function(e){var n=_.find(g.tags,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Tag properly saved!",msg:g.tag.name?g.tag.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTag=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.tag.delete({id:g.tag.id}).$promise.then(function(){_.remove(g.tags,{id:g.tag.id}),o.success({title:"Tag properly deleted!",msg:(g.tag.name||"tag")+" has been deleted!"}),v(g.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","tags","tag","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.tags=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="tags",f.listOrder="",f.listOrderAsc=null,f.selectedTags=[],f.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"name,-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{tag:e,tags:f.tags.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("tag")+"?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTags=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.tag.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Tags",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTag=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:n,tags:f.tags.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTag=y,f.exportSelectedTags=function(){var e=angular.copy(f.selectedTags);return f.selectedTags=[],e},f.deleteSelectedTags=function(e){var n=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+f.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTags.forEach(function(e){y(e)}),f.selectedTags=[]})},f.deselectTags=function(){f.selectedTags=[]},f.selectAllTags=function(){f.selectedTags=f.tags.rows};var b=!0,A=1;function E(e){f.tags=e||{count:0,rows:[]}}function y(e){m.tag.delete({id:e.id}).$promise.then(function(){_.remove(f.tags.rows,{id:e.id}),f.tags.count-=1,f.tags.rows.length||f.getTags(),p.success({title:_.startCase("Tag")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","tags","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TEMPLATE",g.template=angular.copy(l),g.templates=r,g.newTemplate=!1,g.template||(g.template={},g.title="TOOLS.NEW_TEMPLATE",g.newTemplate=!0),g.addNewTemplate=function(){g.errors=[],d.template.save(g.template).$promise.then(function(e){g.templates.unshift(e.toJSON()),o.success({title:"Template properly created",msg:g.template.name?g.template.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTemplate=function(){g.errors=[],d.template.update({id:g.template.id},g.template).$promise.then(function(e){var n=_.find(g.templates,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Template properly saved!",msg:g.template.name?g.template.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTemplate=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.template.delete({id:g.template.id}).$promise.then(function(){_.remove(g.templates,{id:g.template.id}),o.success({title:"Template properly deleted!",msg:(g.template.name||"template")+" has been deleted!"}),v(g.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","templates","template","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.templates=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="templates",f.listOrder="",f.listOrderAsc=null,f.selectedTemplates=[],f.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{template:e,templates:f.templates.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("template")+"?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTemplates=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.template.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Templates",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTemplate=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:n,templates:f.templates.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTemplate=y,f.exportSelectedTemplates=function(){var e=angular.copy(f.selectedTemplates);return f.selectedTemplates=[],e},f.deleteSelectedTemplates=function(e){var n=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+f.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTemplates.forEach(function(e){y(e)}),f.selectedTemplates=[]})},f.deselectTemplates=function(){f.selectedTemplates=[]},f.selectAllTemplates=function(){f.selectedTemplates=f.templates.rows};var b=!0,A=1;function E(e){f.templates=e||{count:0,rows:[]}}function y(e){m.template.delete({id:e.id}).$promise.then(function(){_.remove(f.templates.rows,{id:e.id}),f.templates.count-=1,f.templates.rows.length||f.getTemplates(),p.success({title:_.startCase("Template")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","templates","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r,l,d){var c=this;function m(e){t.hide(e)}c.currentUser=o.getCurrentUser(),c.trigger=angular.copy(n),c.triggers=angular.copy(e),c.setting=l,c.license=r,c.crudPermissions=d,c.newTrigger=!1,c.errors=[],c.trigger||(c.trigger={channel:"voice"},c.newTrigger=!0),c.addNewTrigger=function(){c.errors=[],s.trigger.save(c.trigger).$promise.then(function(e){c.triggers.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_CREATED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveTrigger=function(){c.errors=[],s.trigger.update({id:c.trigger.id},c.trigger).$promise.then(function(){c.triggers=_.map(c.triggers,function(e){return e.id===c.trigger.id?c.trigger:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteTrigger=function(e){c.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:c.trigger.name})).ariaLabel("Delete trigger").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.trigger.delete({id:c.trigger.id}).$promise.then(function(){c.triggers=_.filter(c.triggers,function(e){return e.id!==c.trigger.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$translate","toasty","triggers","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,a,n,i,t,s,o,r){var l=this;function d(){_.some(l.triggerActions.rows,["action","contactManager"])&&(l.lists||(r.isAdmin()?o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.lists,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),l.lists=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.lists.length;i++)_.some(a,{id:l.lists[i].id})&&(l.lists[i].canSelect=!1,t.push(l.lists[i]));l.lists=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","integration"])&&_(l.triggerActions.rows).map(function(e){return"integration"===e.action?e.data1:void 0}).compact().uniq().value().forEach(function(e){var n=e+"Accounts";if(!l[n]){var t="int"+_.startCase(e)+"Account";o[t.replace(/\s+/g,"")].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l[n]=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+n.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}),_.some(l.triggerActions.rows,function(e){return _.includes(["motionbar","browser"],e.action)})&&(l.templates||(r.isAdmin()?o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.templates,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),l.templates=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<l.templates.length;i++)_.some(a,{id:l.templates[i].id})&&(l.templates[i].canSelect=!1,t.push(l.templates[i]));l.templates=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","jscripty"])&&(l.projects||(r.isAdmin()?o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),l.projects=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.projects.length;i++)_.some(a,{id:l.projects[i].id})&&(l.projects[i].canSelect=!1,t.push(l.projects[i]));l.projects=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})))}function c(e){l.triggerActions=e||{count:0,rows:[]},d()}function m(){l.query.offset=(l.query.page-1)*l.query.limit,l.promise=o.trigger.getActions(l.query,c).$promise}function u(e,n){o.action.delete({id:e.id}).$promise.then(function(){m(),n&&s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}l.currentUser=r.getCurrentUser(),l.trigger={},l.triggerActions={count:0,rows:[]},l.selectedTriggerActions=[],l.query={fields:"id,action,contact,data1,data2,data3,data4,data5,data6,data7,createdAt,updatedAt",limit:10,page:1},l.integrationTypes={zendesk:"Zendesk",salesforce:"Salesforce",sugarcrm:"SugarCRM",freshdesk:"Freshdesk",desk:"Desk",zoho:"Zoho",vtiger:"vTiger",dynamics365:"Dynamics365",servicenow:"ServiceNow",freshsales:"Freshsales"},l.motionBarOptions={0:"Popup",1:"CTI URL",2:"Windows App"},l.onInit=function(e,n){l.trigger=e,l.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},l.query.ActionId=l.trigger.id,l.query.id=l.trigger.id,m()},l.success=c,l.getTriggerActions=m,l.createOrEditTriggerAction=function(e,n){i.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:l.trigger,action:n,actions:l.triggerActions.rows,license:null,setting:null,crudPermissions:l.crudPermissions}}).then(function(e){e&&(l.triggerActions={count:e.length,rows:e},d())})},l.exportSelectedTriggerActions=function(){var e=angular.copy(l.selectedTriggerActions);return l.selectedTriggerActions=[],e},l.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){u(e,!0)})},l.deleteSelectedTriggerActions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_MESSAGE",{total:l.selectedTriggerActions.length})).ariaLabel("Delete actions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){l.selectedTriggerActions.forEach(function(e){u(e)}),l.selectedTriggerActions=[],s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r,l,d,c,m){var u=this;function p(){return new Promise(function(n,t){l.hasSectionsPermissions([1301,1302,1303,1304,1305,1306,1307,1308,1309,1310]).then(function(e){u.hasSectionPermissions=_.merge(u.hasSectionPermissions,e),n(u.hasSectionPermissions)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SECTIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()}),t()})})}function g(){r.cmList.getCustomFields({id:u.action.data1,ListId:u.action.data1}).$promise.then(function(e){u.listFields=_.filter(e.rows,["type","text"]),u.listFields.forEach(function(e){e.columnName="cf_"+e.id})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LIST_CUSTOM_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function v(){l.isAdmin()?r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.templates,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),u.templates=t})}else{var t=[],a=[];u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<u.templates.length;i++){_.some(a,{id:u.templates[i].id})&&(u.templates[i].canSelect=!1,t.push(u.templates[i]))}u.templates=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})})}function h(){switch(u.action.action){case"contactManager":u.lists||(l.isAdmin()?r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),u.lists=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.lists.length;i++)_.some(a,{id:u.lists[i].id})&&(u.lists[i].canSelect=!1,t.push(u.lists[i]));u.lists=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})),u.contactFields||r.cmContact.describe({}).$promise.then(function(e){u.contactFields=[],u.customFields=[];for(var n=_.values(e.toJSON()),t=0;t<n.length;t++)_.includes(u.allowedStandardFields,n[t].columnName)?u.contactFields.push(n[t]):_.startsWith(n[t].columnName,"cf_")&&"text"===n[t].custom.type&&u.customFields.push(n[t])}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE_CM_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.data3=u.action.data3?u.action.data3.split(","):["phone"],"1"!==u.action.data2||u.action.data4||(u.action.data4="phone");break;case"jscripty":u.projects||(l.isAdmin()?r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),u.projects=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.projects.length;i++)_.some(a,{id:u.projects[i].id})&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"urlForward":u.action.data5||(u.action.data5=5)}}function f(){u.editAccount||(u.action.data2=void 0,u.action.data3=void 0),u.action.isIntegrationDisabled=!u.newAction&&!function(){switch(u.action.data1){case"zendesk":return u.hasSectionPermissions[1301];case"salesforce":return u.hasSectionPermissions[1302];case"sugarcrm":return u.hasSectionPermissions[1305];case"freshdesk":return u.hasSectionPermissions[1303];case"desk":return u.hasSectionPermissions[1306];case"zoho":return u.hasSectionPermissions[1307];case"vtiger":return u.hasSectionPermissions[1308];case"dynamics365":return u.hasSectionPermissions[1309];case"servicenow":return u.hasSectionPermissions[1310];case"freshsales":return u.hasSectionPermissions[1304]}}();var e="int"+_.capitalize(u.action.data1)+"Account";r[e].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.accounts=e.rows||[],u.editAccount=!1}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function b(){u.action.data3=u.action.data3?u.action.data3:void 0;var e="int"+_.capitalize(u.action.data1)+"Configuration";r[e].get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.configurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function A(){var e=angular.copy(u.action);return _.isArray(e.data3)&&(e.data3=u.action.data3.join(",")),e}function E(e){t.hide(e)}u.currentUser=l.getCurrentUser(),void 0!==s&&"urlForward"===s.action&&s.data5&&(s.data5=parseInt(s.data5)),u.action=angular.copy(s),u.actions=angular.copy(e),u.setting=c,u.license=d,u.crudPermissions=m,u.newAction=!1,u.errors=[],u.trigger=angular.copy(o),u.action?function(){switch(u.editAccount=!0,u.action.action){case"integration":return new Promise(function(e){e(p())}).then(function(){return u.editAccount||(u.action.data2=void 0,u.action.data3=void 0,h()),f()}).then(function(){return b()});case"motionbar":case"browser":v()}u.editAccount=!1}():(u.action={},u.newAction=!0),u.action.ActionId=n.params.id||void 0,u.allowedStandardFields=["phone","mobile","fax"],u.addNewAction=function(){u.errors=[];var e=A();r.trigger.addAction({id:n.params.id},e).$promise.then(function(e){u.actions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_CREATED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAction=function(){u.errors=[];var n=A();r.action.update({id:n.id},n).$promise.then(function(){u.actions=_.map(u.actions,function(e){return e.id===n.id?n:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_SAVED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAction=function(e){u.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.action.delete({id:u.action.id}).$promise.then(function(){u.actions=_.filter(u.actions,function(e){return e.id!==u.action.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.onActionInit=function(){l.hasModulePermissions("Integrations").then(function(e){u.hasIntegrationsPermissions=e}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MODULE_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.action&&h()},u.onIntegrationInit=p,u.onSearchFieldsInit=function(){u.newAction||g()},u.onActionSelection=function(){u.newAction&&(u.action.data1=void 0,u.action.data2=void 0,u.action.data3=void 0,u.action.data4=void 0,u.action.data5="urlForward"===u.action.action?5:void 0,h())},u.onIntegrationSelection=f,u.onListSelection=function(){g()},u.onTypeSelection=function(){"0"!==u.action.data1||u.templates?(u.action.data2=void 0,u.action.data4="1"===u.action.data1?0:void 0):v()},u.onAutocreateSelection=function(){"0"===u.action.data2&&(u.action.data4=void 0);u.action.data4||"1"!==u.action.data2||(u.action.data4="phone")},u.onIntegrationAccountSelection=b,u.closeDialog=E,u.onActionLocationChange=function(){u.editAccount||(u.action.data5=void 0,u.action.data6=void 0)}}e.$inject=["$state","$mdDialog","$translate","toasty","actions","action","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.allConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.allConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.allConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAllConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.allConditions={count:0,rows:[]},u.selectedAllConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAllId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAllConditions=r,u.createOrEditAllCondition=function(e,n){i.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,allCondition:n,allConditions:u.allConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.allConditions={count:e.length,rows:e},s())})},u.exportSelectedAllConditions=function(){var e=angular.copy(u.selectedAllConditions);return u.selectedAllConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteSelectedAllConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAllConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAllConditions.forEach(function(e){p(e)}),u.selectedAllConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.allCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.allConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.allCondition=angular.copy(s),p.allConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAllCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.allCondition?g():(p.allCondition={operator:"equals"},p.newAllCondition=!0),p.allCondition.TriggerAllId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.allCondition.value=void 0,g()},p.addNewAllCondition=function(){p.errors=[],d.trigger.addAllCondition({id:e.params.id},p.allCondition).$promise.then(function(e){p.allConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAllCondition=function(){p.errors=[],d.condition.update({id:p.allCondition.id},p.allCondition).$promise.then(function(){p.allConditions=_.map(p.allConditions,function(e){return e.id===p.allCondition.id?p.allCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAllCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.allCondition.id}).$promise.then(function(){p.allConditions=_.filter(p.allConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","allConditions","allCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.anyConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.anyConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAnyConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.anyConditions={count:0,rows:[]},u.selectedAnyConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAnyId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAnyConditions=r,u.createOrEditAnyCondition=function(e,n){i.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,anyCondition:n,anyConditions:u.anyConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.anyConditions={count:e.length,rows:e},s())})},u.exportSelectedAnyConditions=function(){var e=angular.copy(u.selectedAnyConditions);return u.selectedAnyConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteAnyCondition=p,u.deleteSelectedAnyConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAnyConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAnyConditions.forEach(function(e){p(e)}),u.selectedAnyConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.anyCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.anyConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.anyCondition=angular.copy(s),p.anyConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAnyCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.anyCondition?g():(p.anyCondition={operator:"equals"},p.newAnyCondition=!0),p.anyCondition.TriggerAnyId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.anyCondition.value=void 0,g()},p.addNewAnyCondition=function(){p.errors=[],d.trigger.addAnyCondition({id:e.params.id},p.anyCondition).$promise.then(function(e){p.anyConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAnyCondition=function(){p.errors=[],d.condition.update({id:p.anyCondition.id},p.anyCondition).$promise.then(function(){p.anyConditions=_.map(p.anyConditions,function(e){return e.id===p.anyCondition.id?p.anyCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAnyCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.anyCondition.id}).$promise.then(function(){p.anyConditions=_.filter(p.anyConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","anyConditions","anyCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;d.currentUser=o.getCurrentUser(),d.license=t,d.setting=a,d.trigger=r||e.params.trigger||{},d.selectedTab=e.params.tab||0,e.params.crudPermissions?d.crudPermissions=e.params.crudPermissions:(d.userProfileSection=l&&1==l.count?l.rows[0]:null,d.crudPermissions=o.parseCrudPermissions(d.userProfileSection?d.userProfileSection.crudPermissions:null)),d.gotoTriggers=function(){e.go("app.tools.triggers",{},{reload:"app.tools.triggers"})},d.saveTrigger=function(){i.trigger.update({id:d.trigger.id},d.trigger).$promise.then(function(){s.success({title:n.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$translate","license","setting","api","toasty","Auth","trigger","userProfileSection"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.go("app.tools.triggers.edit",{id:e.id,trigger:e,crudPermissions:g.crudPermissions})}function h(e){g.triggers=e||{count:0,rows:[]}}function f(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.trigger.get(g.query,h).$promise:(g.query.id=g.userProfile.id,g.query.section="Triggers",g.promise=d.userProfile.getResources(g.query,h).$promise)}function b(e,n){d.trigger.delete({id:e.id}).$promise.then(function(){f(),n&&c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.triggers=o||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedTriggers=[],g.query={fields:"id,name,channel,status,description,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},g.goToEditState=v,g.createOrEditTrigger=function(e,n){if(g.crudPermissions.readOnly||g.crudPermissions.canDelete&&!g.crudPermissions.canEdit)return void v(n);a.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:n,triggers:g.triggers.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}}).then(function(e){e&&(g.triggers={count:e.length,rows:e})})},g.success=h,g.getTriggers=f,g.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:e.name})).ariaLabel("Delete trigger").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){b(e,!0)})},g.exportSelectedTriggers=function(){var e=angular.copy(g.selectedTriggers);return g.selectedTriggers=[],e},g.deleteSelectedTriggers=function(e){var n=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_MESSAGE",{total:g.selectedTriggers.length})).ariaLabel("Delete triggers").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedTriggers.forEach(function(e){b(e)}),g.selectedTriggers=[],c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETED_SUCCESS_TITLE")})})},g.deselectTriggers=function(){g.selectedTriggers=[]},g.selectAllTriggers=function(){g.selectedTriggers=g.triggers.rows};var A=!0,E=1;e.$watch("vm.query.filter",function(e,n){A?i(function(){A=!1}):(n||(E=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=E),f())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","triggers","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRUNK",g.trunk=angular.copy(l),g.trunks=r,g.newTrunk=!1,g.trunk||(g.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},g.title="TOOLS.NEW_TRUNK",g.newTrunk=!0),g.addNewTrunk=function(){g.errors=[],d.trunk.save(g.trunk).$promise.then(function(e){g.trunks.unshift(e.toJSON()),o.success({title:"Trunk properly created",msg:g.trunk.name?g.trunk.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrunk=function(){g.errors=[],d.trunk.update({id:g.trunk.id},g.trunk).$promise.then(function(e){var n=_.find(g.trunks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Trunk properly saved!",msg:g.trunk.name?g.trunk.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrunk=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.trunk.delete({id:g.trunk.id}).$promise.then(function(){_.remove(g.trunks,{id:g.trunk.id}),o.success({title:"Trunk properly deleted!",msg:(g.trunk.name||"trunk")+" has been deleted!"}),v(g.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","trunks","trunk","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newTrunk=!0,r.trunk=angular.copy(i),r.trunks=s,r.title=o.instant("TOOLS.CLONE_TRUNK"),i&&i.name&&(r.title+=": "+i.name),r.cloneTrunk=function(){return e.trunk.clone({id:i.id},r.trunk).$promise.then(function(e){r.trunks.unshift(e.toJSON()),a.success({title:"Trunk properly cloned",msg:r.trunk.name?r.trunk.name+" has been cloned!":""}),t.go("app.tools.trunks.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","trunk","trunks","$translate"],angular.module("app.tools").controller("TrunkcloneController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.trunk=c||t.params.trunk||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},u.clonedialog=function(e,n){a.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:u.trunks?u.trunks.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTrunks=function(){t.go("app.tools.trunks",{},{reload:"app.tools.trunks"})},u.saveTrunk=function(){r.trunk.update({id:u.trunk.id},u.trunk).$promise.then(function(){l.success({title:"Trunk updated!",msg:u.trunk.name?u.trunk.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.trunk&&(t=_.find(u.contexts,{name:u.trunk.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trunk","userProfileSection"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.trunks=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="trunks",f.listOrder="",f.listOrderAsc=null,f.selectedTrunks=[],f.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.tools.trunks.edit",{id:e.id,trunk:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:f.trunks?f.trunks.rows:[],crudPermissions:f.crudPermissions}})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("trunk")+"?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTrunks=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.trunk.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Trunks",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTrunk=function(e,n){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:n,trunks:f.trunks.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTrunk=y,f.exportSelectedTrunks=function(){var e=angular.copy(f.selectedTrunks);return f.selectedTrunks=[],e},f.deleteSelectedTrunks=function(e){var n=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+f.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTrunks.forEach(function(e){y(e)}),f.selectedTrunks=[]})},f.deselectTrunks=function(){f.selectedTrunks=[]},f.selectAllTrunks=function(){f.selectedTrunks=f.trunks.rows};var b=!0,A=1;function E(e){f.trunks=e||{count:0,rows:[]}}function y(e){m.trunk.delete({id:e.id}).$promise.then(function(){_.remove(f.trunks.rows,{id:e.id}),f.trunks.count-=1,f.trunks.rows.length||f.getTrunks(),p.success({title:_.startCase("Trunk")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","trunks","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_VARIABLE",g.variable=angular.copy(l),g.variables=r,g.newVariable=!1,g.variable||(g.variable={},g.title="TOOLS.NEW_VARIABLE",g.newVariable=!0),g.addNewVariable=function(){g.errors=[],d.variable.save(g.variable).$promise.then(function(e){g.variables.unshift(e.toJSON()),o.success({title:"Variable properly created",msg:g.variable.name?g.variable.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVariable=function(){g.errors=[],d.variable.update({id:g.variable.id},g.variable).$promise.then(function(e){var n=_.find(g.variables,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Variable properly saved!",msg:g.variable.name?g.variable.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVariable=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.variable.delete({id:g.variable.id}).$promise.then(function(){_.remove(g.variables,{id:g.variable.id}),o.success({title:"Variable properly deleted!",msg:(g.variable.name||"variable")+" has been deleted!"}),v(g.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","variables","variable","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.variables=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="variables",f.listOrder="",f.listOrderAsc=null,f.selectedVariables=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{variable:e,variables:f.variables.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("variable")+"?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVariables=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.variable.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Variables",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVariable=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:n,variables:f.variables.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVariable=y,f.exportSelectedVariables=function(){var e=angular.copy(f.selectedVariables);return f.selectedVariables=[],e},f.deleteSelectedVariables=function(e){var n=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+f.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVariables.forEach(function(e){y(e)}),f.selectedVariables=[]})},f.deselectVariables=function(){f.selectedVariables=[]},f.selectAllVariables=function(){f.selectedVariables=f.variables.rows};var b=!0,A=1;function E(e){f.variables=e||{count:0,rows:[]}}function y(e){m.variable.delete({id:e.id}).$promise.then(function(){_.remove(f.variables.rows,{id:e.id}),f.variables.count-=1,f.variables.rows.length||f.getVariables(),p.success({title:_.startCase("Variable")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","variables","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VIDEO.EDIT_SCREENRECORDING",g.screenRecording=angular.copy(l),g.screenRecordings=r,g.newscreenRecording=!1,g.screenRecording||(g.screenRecording={},g.title="VIDEO.NEW_SCREENRECORDING",g.newscreenRecording=!0),g.addNewscreenRecording=function(){g.errors=[],d.screenRecording.save(g.screenRecording).$promise.then(function(e){g.screenRecordings.unshift(e.toJSON()),o.success({title:"screenRecording properly created",msg:g.screenRecording.name?g.screenRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savescreenRecording=function(){g.errors=[],d.screenRecording.update({id:g.screenRecording.id},g.screenRecording).$promise.then(function(e){var n=_.find(g.screenRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"screenRecording properly saved!",msg:g.screenRecording.name?g.screenRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletescreenRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The screenRecording will be deleted.").ariaLabel("Delete screenRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.screenRecording.delete({id:g.screenRecording.id}).$promise.then(function(){_.remove(g.screenRecordings,{id:g.screenRecording.id}),o.success({title:"screenRecording properly deleted!",msg:(g.screenRecording.name||"screenRecording")+" has been deleted!"}),v(g.screenRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){g.users=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","screenRecordings","screenRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.video").controller("CreateOrEditscreenRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c,m=this;if(m.loading=!1,m.recording=Object.assign({},i),m.route="screenRecording",m.element=l,m.actionOptions=Object.assign({},s),m.path=r,m.label=o,m.app="video",m.model="screenRecording",console.log("TCL: vm.path",m.path),console.log("TCL: vm.recording[vm.path]",m.recording[m.path]),m.filename=-1<m.recording[m.path].indexOf("/")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("/")+1):-1<m.recording[m.path].indexOf("\\")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("\\")+1):m.recording[m.path],m.format=!1,_.isNil(m.recording.format)&&(m.recording.format=m.filename.slice(m.filename.lastIndexOf("."))),(".wav"===m.recording.format&&"audio"===m.element||".mp4"===m.recording.format&&"video"===m.element)&&(m.format=!0),m.found=!0,m.format&&(c=d.defer(),a.screenRecording.download({id:m.recording.id,path:String(m.path)}).$promise.then(function(e){m.format=!0,m.found=!0,c.resolve()}).catch(function(e){console.log("err"),m.format=!1,m.found=!1,c.resolve()}),c.promise),!_.isNil(s.properties)&&s.properties){if(m.properties=Object.assign({},i),Object.keys(i).forEach(function(e){String(e[0].toUpperCase())===String(e[0])&&delete m.properties[e]}),m.propertiesDefault={},!_.isNil(s.propertiesList)&&0<s.propertiesList.length){m.propertiesDefault=Object.assign({},i);var u=s.propertiesList,p=Object.keys(i),g=!0;p.forEach(function(n){g=!0,u.forEach(function(e){String(n)===String(e)&&(g=!1)}),g&&delete m.propertiesDefault[n]}),m.properties=m.propertiesDefault}if(!_.isNil(s.extraData)&&0<s.extraData.length){m.propertiesExtra={};for(var v=s.extraData,h=0;h<v.length;h++)for(var f=v[h].values,b=v[h].model,A=0;A<f.length;A++)m.propertiesExtra[f[A].text]=i[b][f[A].key];m.properties=Object.assign({},m.propertiesDefault,m.propertiesExtra)}}m.closeDialog=function(){n.hide()}}e.$inject=["$scope","$mdDialog","toasty","api","recording","actionOptions","label","varPath","elementTag","$q"],angular.module("app.video").controller("screenRecordingplayController",e)}(),function(){"use strict";function e(e,n,t,a,r,l,i,o,s,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.screenRecordings=s||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="screenRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedScreenRecordings=[],f.query={fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:"@msUtils.firstLastDayMonth()",includeAll:"true",sort:"-updatedAt",limit:10,page:1},f.query.createdAt=u.firstLastDayMonth(),f.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],f.playrecording=function(e,n,t,a,i){var s={route:"screenRecording",name:"screenRecordings",model:"screenRecording",singular:"screenRecording"},a=String(a),o=String(t);console.log("TCL: path",String(t)),r.show({controller:"screenRecordingplayController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/partialViews/play.html",parent:angular.element(l.body),targetEvent:n,clickOutsideToClose:!0,locals:{recording:e,recordings:f.screenRecordings.rows,license:f.license,setting:null,item:s,actionOptions:{upperTitle:!1,lowerTitle:!0,properties:!0,propertiesIcon:"icon-video",propertiesList:["format","interactionid","duration","startedAt","closedAt","createdAt"],extraData:[{model:"User",values:[{key:"name",text:"agentname"}]}]},label:a,varPath:o,elementTag:String(i)}})},f.downloadfile2=function(e,n){var t=!1,a=_.isNil(e.format)?e.value.substring(e.value.lastIndexOf(".")):e.format;t=".mp4"===a;var s=-1<e.value.lastIndexOf("/")?e.value.substring(e.value.lastIndexOf("/")+1):-1<e.value.lastIndexOf("\\")?e.value.substring(e.value.lastIndexOf("\\")+1):e.value;return m.screenRecording.download({id:e.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=r.confirm().title("Are you sure want to delete the "+_.startCase("screenRecording")+"?").htmlContent("<b>"+(e.name||"screenRecording")+"</b> will be deleted.").ariaLabel("delete screenRecording").targetEvent(n).ok("OK").cancel("CANCEL");r.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScreenRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.screenRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ScreenRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditscreenRecording=function(e,n){r.show({controller:"CreateOrEditscreenRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/create/dialog.html",parent:angular.element(l.body),targetEvent:e,clickOutsideToClose:!0,locals:{screenRecording:n,screenRecordings:f.screenRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletescreenRecording=y,f.exportSelectedScreenRecordings=function(){var e=angular.copy(f.selectedScreenRecordings);return f.selectedScreenRecordings=[],e},f.deleteSelectedScreenRecordings=function(e){var n=r.confirm().title("Are you sure want to delete the selected screenRecordings?").htmlContent("<b>"+f.selectedScreenRecordings.length+" selected</b> will be deleted.").ariaLabel("delete screenRecordings").targetEvent(e).ok("OK").cancel("CANCEL");r.show(n).then(function(){f.selectedScreenRecordings.forEach(function(e){y(e)}),f.selectedScreenRecordings=[]})},f.deselectScreenRecordings=function(){f.selectedScreenRecordings=[]},f.selectAllScreenRecordings=function(){f.selectedScreenRecordings=f.screenRecordings.rows},f.convertDuration=function(e){var n=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),i=a<10?"0"+String(a):String(a),s=t<10?"0"+String(t):String(t),o=n<10?"0"+String(n):String(n);return i+":"+s+":"+o},m.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){f.users=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.screenRecordings=e||{count:0,rows:[]}}function y(e){m.screenRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.screenRecordings.rows,{id:e.id}),f.screenRecordings.count-=1,f.screenRecordings.rows.length||f.getScreenRecordings(),p.success({title:_.startCase("screenRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEscreenRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEscreenRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScreenRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","screenRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.video").controller("ScreenRecordingsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(e){return _.isEmpty(e)||isNaN(e)?e:parseInt(e,10)}function m(e){switch(e){case"sound":if(!d.application.appdata)return;return[{key:"save_name",value:d.application.appdata.split("/").pop()}];case"squareProject":if(!d.application.project)return;return[{key:"name",value:d.application.project.split(",")[1]}];case"tag":if(!d.application.tag)return;return[{key:"name",value:d.application.tag}];case"trunk":if(!d.application.trunk)return;return[{key:"name",value:d.application.trunk}];case"user":if(!d.application.user&&!d.application.users)return;return d.application.user?[{key:"name",value:d.application.user.split("/")[1]}]:_.map(d.application.users,function(e){return{key:"name",value:e.split("/")[1]}});case"variable":if(!d.application.name)return;return[{key:"name",value:d.application.name}];case"voiceContext":if(!d.application.context)return;return[{key:"name",value:d.application.context}];case"voiceMail":if(!d.application.voiceMail)return;return[{key:"mailbox",value:d.application.voiceMail.split("@")[0]}];case"voiceQueue":if(!d.application.queue)return;return[{key:"name",value:d.application.queue}]}}function u(){o.getResourcesByRole(d.currentUser,"trunk",{fields:"id,name",sort:"name",nolimit:"true"},m("trunk")).then(function(e){d.trunks=e}).catch(function(){s.error({title:i.instant("TOOLS.TRUNKS"),msg:i.instant("VOICE.NOTIFICATIONS.TRUNKS_GET_ERROR")})})}function p(){o.getResourcesByRole(d.currentUser,"sound",{fields:"id,name,save_name",sort:"name",nolimit:"true"},m("sound")).then(function(e){d.sounds=e}).catch(function(){s.error({title:i.instant("TOOLS.SOUNDS"),msg:i.instant("VOICE.NOTIFICATIONS.SOUNDS_GET_ERROR")})})}function g(){var e={fields:"id,name,role",sort:"name",nolimit:"true"},n=m("user"),t=[o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"agent"}),n,"Agents"),o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"telephone"}),n,"Telephones")];a.all(t).then(function(e){var n=_(e).flatMap(function(e){return e.rows}).orderBy([function(e){return e.name.toLowerCase()}]).value();d.users={rows:n,count:n.length}}).catch(function(){s.error({title:i.instant("STAFF.USERS"),msg:i.instant("VOICE.NOTIFICATIONS.USERS_GET_ERROR")})})}function v(){(d.application.appdata||"custom"===d.application.appType)&&e.hide(d.application),e.hide()}d.currentUser=r.getCurrentUser(),d.application=angular.copy(n),d.crudPermissions=l,d.errors=[],d.init=function(){d.application.appdata&&function(){var e=[];switch(d.application.appType){case"agi":d.application.project=d.application.appdata;break;case"dial":e=d.application.appdata.split(","),d.application.tech=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"externalDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"goTo":e=d.application.appdata.split(","),d.application.context=c(e[0]),d.application.extension=c(e[1]),d.application.priority=c(e[2]);break;case"internalDial":e=d.application.appdata.split(","),d.application.user=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"outboundDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]),d.application.prefix=d.application.phone?d.application.phone.split("$")[0]:void 0,d.application.callerId=d.application.callerID?"CALLERID(all)="+d.application.callerID:void 0;break;case"playback":e=d.application.appdata.split(","),d.application.appdata=c(e[0]),d.application.options=c(e[1]);break;case"queue":e=d.application.appdata.split(","),d.application.queue=c(e[0]),d.application.options=c(e[1]),d.application.URL=c(e[2]),d.application.sound=c(e[3]),d.application.timeout=c(e[4]),d.application.agi=c(e[5]),d.application.macro=c(e[6]),d.application.gosub=c(e[7]),d.application.rule=c(e[8]),d.application.position=c(e[9]);break;case"ringGroup":e=d.application.appdata.split(","),d.application.users=e[0].split("&"),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"set":e=d.application.appdata.split("="),d.application.name=e[0],d.application.value=e[1];break;case"voicemail":e=d.application.appdata.split(","),d.application.voiceMail=c(e[0]),d.application.options=c(e[1])}}();switch(d.application.appType){case"agi":o.getResourcesByRole(d.currentUser,"squareProject",{fields:"id,name",sort:"name",nolimit:"true"},m("squareProject")).then(function(e){d.projects=e}).catch(function(){s.error({title:i.instant("CALLYSQUARE.CALLYSQUARE")+" "+i.instant("CALLYSQUARE.PROJECTS"),msg:i.instant("VOICE.NOTIFICATIONS.CALLYSQUARE_PROJECTS_GET_ERROR")})});break;case"externalDial":u();break;case"goTo":o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:"true"},m("voiceContext")).then(function(e){d.contexts=e}).catch(function(){s.error({title:i.instant("VOICE.CONTEXTS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});break;case"internalDial":g();break;case"outboundDial":o.getResourcesByRole(d.currentUser,"tag",{fields:"id,name",sort:"name",nolimit:"true"},m("tag")).then(function(e){d.tags=e}).catch(function(){s.error({title:i.instant("TOOLS.TAGS"),msg:i.instant("VOICE.NOTIFICATIONS.TAGS_GET_ERROR")})}),u();break;case"playback":p();break;case"queue":p(),o.getResourcesByRole(d.currentUser,"voiceQueue",{type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"},m("voiceQueue")).then(function(e){d.queues=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEQUEUES"),msg:i.instant("VOICE.NOTIFICATIONS.QUEUES_GET_ERROR")})});break;case"ringGroup":g();break;case"set":o.getResourcesByRole(d.currentUser,"variable",{fields:"id,name",sort:"name",nolimit:"true"},m("variable")).then(function(e){d.variables=e}).catch(function(){s.error({title:i.instant("TOOLS.VARIABLES"),msg:i.instant("VOICE.NOTIFICATIONS.VARIABLES_GET_ERROR")})});break;case"voicemail":o.getResourcesByRole(d.currentUser,"voiceMail",{fields:"id,mailbox",sort:"mailbox",nolimit:"true"},m("voiceMail")).then(function(e){d.voiceMails=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEMAILS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICEMAILS_GET_ERROR")})})}},d.saveRoutingApp=function(){d.errors=[],function(){var e=[];switch(d.application.appType){case"agi":d.application.appdata=d.application.project;break;case"dial":e[0]=d.application.tech,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"externalDial":e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"goTo":e[0]=d.application.context,e[1]=d.application.extension,e[2]=d.application.priority,d.application.appdata=e.join(",");break;case"internalDial":e[0]=d.application.user,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"outboundDial":d.application.phone=t.cutdigits?(d.application.prefix||"")+"${EXTEN:"+t.cutdigits+"}":(d.application.prefix||"")+"${EXTEN}","none"===t.recordingFormat?d.application.options=d.application.options.replace("U(xcally-mixmonitor-context)",""):d.application.options.indexOf("U(xcally-mixmonitor-context)")<0&&(d.application.options+="U(xcally-mixmonitor-context)"),e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"playback":e[0]=d.application.appdata,e[1]=d.application.options,d.application.appdata=e.join(",");break;case"queue":e[0]=d.application.queue,e[1]=d.application.options,e[2]=d.application.URL,e[3]=d.application.sound,e[4]=d.application.timeout,e[5]=d.application.agi,e[6]=d.application.macro,e[7]=d.application.gosub,e[8]=d.application.rule,e[9]=d.application.position,d.application.appdata=e.join(",");break;case"ringGroup":e[0]=d.application.users.join("&"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"set":e[0]=d.application.name,e[1]=d.application.value,d.application.appdata=e.join("=");break;case"voicemail":e[0]=d.application.voiceMail,e[1]=d.application.options,d.application.appdata=e.join(",")}}(),v()},d.closeDialog=v}e.$inject=["$mdDialog","$q","$translate","toasty","application","route","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditRoutingAppDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r,l){var d=this;function c(){var e=[{key:"name",value:d.interval.IntervalId}];s.getResourcesByRole(d.currentUser,"interval",{fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0},e).then(function(e){d.intervals=e}).catch(function(){i.error({title:t.instant("TOOLS.INTERVALS"),msg:t.instant("VOICE.NOTIFICATIONS.INTERVALS_GET_ERROR")})})}function m(e){n.hide(e)}d.currentUser=o.getCurrentUser(),d.interval=angular.copy(e),d.intervals=a||{rows:[],count:0},d.types=["always","custom","list"],d.crudPermissions=r,d.errors=[],d.daysOfWeek=l.getDaysOfWeek(),d.monthNumber=l.getMonthNumber(),d.monthName=l.getMonthName(),d.daysOfMonth=l.getDaysOfMonth(),d.initialize=function(){if("*,*,*,*"===d.interval.interval)return d.type=d.interval.IntervalId&&d.interval.application?"list":"always",void("list"===d.type&&c());d.type="custom";var e=d.interval.interval.split(","),n=e[0],t=e[1],a=e[2],i=e[3];if("*"!==n){var s,o=n.split("-")[0],r=n.split("-")[1];(s=new Date).setHours(Number(o.split(":")[0])),s.setMinutes(Number(o.split(":")[1])),d.timeRangeFrom=s,(s=new Date).setHours(Number(r.split(":")[0])),s.setMinutes(Number(r.split(":")[1])),d.timeRangeTo=s}"*"!==t&&(d.dayOfWeekFrom=t.split("-")[0],d.dayOfWeekTo=t.split("-")[1]);"*"!==a&&(d.monthDayFrom=a.split("-")[0],d.monthDayTo=a.split("-")[1]);"*"!==i&&(d.monthFrom=i.split("-")[0],d.monthTo=i.split("-")[1])},d.onTypeChange=function(){"list"===d.type&&0===d.intervals.count&&c()},d.saveInterval=function(){d.errors=[],d.interval.interval=function(){if(["always","list"].includes(d.type))return"*,*,*,*";var e=[];if("*"!==d.timeRangeFrom&&d.timeRangeFrom&&d.timeRangeTo){var n=(d.timeRangeFrom.getHours()<10?"0":"")+d.timeRangeFrom.getHours()+":"+(d.timeRangeFrom.getMinutes()<10?"0":"")+d.timeRangeFrom.getMinutes(),t=(d.timeRangeTo.getHours()<10?"0":"")+d.timeRangeTo.getHours()+":"+(d.timeRangeTo.getMinutes()<10?"0":"")+d.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return d.dayOfWeekFrom?d.dayOfWeekTo?e.push(d.dayOfWeekFrom+"-"+d.dayOfWeekTo):e.push(d.dayOfWeekFrom):e.push("*"),d.monthDayFrom?d.monthDayTo?e.push(d.monthDayFrom+"-"+d.monthDayTo):e.push(d.monthDayFrom):e.push("*"),d.monthFrom?d.monthTo?e.push(d.monthFrom+"-"+d.monthTo):e.push(d.monthFrom):e.push("*"),e.join()}(),"list"!==d.type&&(d.interval.IntervalId=null);m(d.interval)},d.closeDialog=m}e.$inject=["$mdDialog","$translate","interval","intervals","toasty","api","Auth","crudPermissions","IndexFactory"],angular.module("app.voice").controller("EditRoutingIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chanSpies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chanSpies",f.listOrder="",f.listOrderAsc=null,f.selectedChanSpies=[],f.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},f.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:f.chanSpies.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chanSpy")+"?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChanSpies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceChanSpy.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChanSpies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditchanSpy=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:n,chanSpies:f.chanSpies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletechanSpy=y,f.exportSelectedChanSpies=function(){var e=angular.copy(f.selectedChanSpies);return f.selectedChanSpies=[],e},f.deleteSelectedChanSpies=function(e){var n=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+f.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChanSpies.forEach(function(e){y(e)}),f.selectedChanSpies=[]})},f.deselectChanSpies=function(){f.selectedChanSpies=[]},f.selectAllChanSpies=function(){f.selectedChanSpies=f.chanSpies.rows};var b=!0,A=1;function E(e){f.chanSpies=e||{count:0,rows:[]}}function y(e){m.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(f.chanSpies.rows,{id:e.id}),f.chanSpies.count-=1,f.chanSpies.rows.length||f.getChanSpies(),p.success({title:_.startCase("chanSpy")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chanSpies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CHANSPY",g.chanSpy=angular.copy(l),g.chanSpies=r,g.newchanSpy=!1,g.chanSpy||(g.chanSpy={recordingFormat:"wav"},g.title="VOICE.NEW_CHANSPY",g.newchanSpy=!0),g.addNewchanSpy=function(){g.errors=[],d.voiceChanSpy.save(g.chanSpy).$promise.then(function(e){g.chanSpies.unshift(e.toJSON()),o.success({title:"chanSpy properly created",msg:g.chanSpy.name?g.chanSpy.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savechanSpy=function(){g.errors=[],d.voiceChanSpy.update({id:g.chanSpy.id},g.chanSpy).$promise.then(function(e){var n=_.find(g.chanSpies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"chanSpy properly saved!",msg:g.chanSpy.name?g.chanSpy.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletechanSpy=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceChanSpy.delete({id:g.chanSpy.id}).$promise.then(function(){_.remove(g.chanSpies,{id:g.chanSpy.id}),o.success({title:"chanSpy properly deleted!",msg:(g.chanSpy.name||"chanSpy")+" has been deleted!"}),v(g.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chanSpies","chanSpy","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contexts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="contexts",f.listOrder="",f.listOrderAsc=null,f.selectedContexts=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{context:e,contexts:f.contexts.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("context")+"?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContexts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceContext.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Contexts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContext=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:n,contexts:f.contexts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContext=y,f.exportSelectedContexts=function(){var e=angular.copy(f.selectedContexts);return f.selectedContexts=[],e},f.deleteSelectedContexts=function(e){var n=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+f.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContexts.forEach(function(e){y(e)}),f.selectedContexts=[]})},f.deselectContexts=function(){f.selectedContexts=[]},f.selectAllContexts=function(){f.selectedContexts=f.contexts.rows};var b=!0,A=1;function E(e){f.contexts=e||{count:0,rows:[]}}function y(e){m.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(f.contexts.rows,{id:e.id}),f.contexts.count-=1,f.contexts.rows.length||f.getContexts(),p.success({title:_.startCase("Context")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contexts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CONTEXT",g.context=angular.copy(l),g.contexts=r,g.newContext=!1,g.context||(g.context={},g.title="VOICE.NEW_CONTEXT",g.newContext=!0),g.addNewContext=function(){g.errors=[],d.voiceContext.save(g.context).$promise.then(function(e){g.contexts.unshift(e.toJSON()),o.success({title:"Context properly created",msg:g.context.name?g.context.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContext=function(){g.errors=[],d.voiceContext.update({id:g.context.id},g.context).$promise.then(function(e){var n=_.find(g.contexts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Context properly saved!",msg:g.context.name?g.context.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContext=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceContext.delete({id:g.context.id}).$promise.then(function(){_.remove(g.contexts,{id:g.context.id}),o.success({title:"Context properly deleted!",msg:(g.context.name||"context")+" has been deleted!"}),v(g.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contexts","context","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.inboundRoute=angular.copy(s),d.inboundRoutes=n,d.newInboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.inboundRoute||(d.inboundRoute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},d.newInboundRoute=!0);e=[{key:"name",value:d.inboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newInboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.inboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInboundRoute=function(){d.errors=[],o.voiceExtension.save(d.inboundRoute).$promise.then(function(e){c(e.id).then(function(){d.inboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.inboundRoute.id},d.inboundRoute).$promise.then(function(e){var n=_.find(d.inboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.inboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.inboundRoute.exten})).ariaLabel("Delete inbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.inboundRoute.id}).$promise.then(function(){_.remove(d.inboundRoutes,{id:d.inboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.inboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","inboundRoutes","inboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.inboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.inboundRoute=l||e.params.inboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.inboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Inbound",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Inbound",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Inbound",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Inbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.inboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInboundRoutes=function(){e.go("app.voice.inboundRoutes",{},{reload:"app.voice.inboundRoutes"})},m.saveInboundRoute=function(){o.voiceExtension.update({id:m.inboundRoute.id},m.inboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.inboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","inboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.inboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.inboundRoutes.rows,{id:e.id}),g.inboundRoutes.count-=1,g.inboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.inboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.inboundRoutes.edit",{id:e.id,inboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInboundRoute=function(e,n){a.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundRoute:n,inboundRoutes:g.inboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInboundRoutes=function(){var e=angular.copy(g.selectedInboundRoutes);return g.selectedInboundRoutes=[],e},g.deleteSelectedInboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInboundRoutes.forEach(function(e){f(e)}),g.selectedInboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","inboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.internalRoute=angular.copy(s),d.internalRoutes=n,d.newInternalRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.internalRoute||(d.internalRoute={appdata:"Internal Call",type:"internal",context:"from-sip"},d.newInternalRoute=!0);e=[{key:"name",value:d.internalRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newInternalRoute)return;var e={sort:"priority",VoiceExtensionId:d.internalRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInternalRoute=function(){d.errors=[],o.voiceExtension.save(d.internalRoute).$promise.then(function(e){c(e.id).then(function(){d.internalRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInternalRoute=function(){d.errors=[],o.voiceExtension.update({id:d.internalRoute.id},d.internalRoute).$promise.then(function(e){var n=_.find(d.internalRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.internalRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInternalRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.internalRoute.exten})).ariaLabel("Delete internal route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.internalRoute.id}).$promise.then(function(){_.remove(d.internalRoutes,{id:d.internalRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.internalRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","internalRoutes","internalRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.internalRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.internalRoute=l||e.params.internalRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.internalRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Internal",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.internalRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInternalRoutes=function(){e.go("app.voice.internalRoutes",{},{reload:"app.voice.internalRoutes"})},m.saveInternalRoute=function(){o.voiceExtension.update({id:m.internalRoute.id},m.internalRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.internalRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","internalRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.internalRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InternalRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.internalRoutes.rows,{id:e.id}),g.internalRoutes.count-=1,g.internalRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.internalRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInternalRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.internalRoutes.edit",{id:e.id,internalRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInternalRoute=function(e,n){a.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalRoute:n,internalRoutes:g.internalRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInternalRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInternalRoutes=function(){var e=angular.copy(g.selectedInternalRoutes);return g.selectedInternalRoutes=[],e},g.deleteSelectedInternalRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInternalRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInternalRoutes.forEach(function(e){f(e)}),g.selectedInternalRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","internalRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MUSICONHOLD",g.musiconhold=angular.copy(l),g.musiconholds=r,g.newMusicOnHold=!1,g.musiconhold||(g.musiconhold={mode:"files"},g.title="VOICE.NEW_MUSICONHOLD",g.newMusicOnHold=!0),g.addNewMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.save(g.musiconhold).$promise.then(function(e){g.musiconholds.unshift(e.toJSON()),o.success({title:"MusicOnHold properly created",msg:g.musiconhold.name?g.musiconhold.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.musiconhold.id},g.musiconhold).$promise.then(function(e){var n=_.find(g.musiconholds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MusicOnHold properly saved!",msg:g.musiconhold.name?g.musiconhold.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMusicOnHold=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.musiconhold.id}).$promise.then(function(){_.remove(g.musiconholds,{id:g.musiconhold.id}),o.success({title:"MusicOnHold properly deleted!",msg:(g.musiconhold.name||"musiconhold")+" has been deleted!"}),v(g.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","musiconholds","musiconhold","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.musiconholdMohSounds=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMusicOnHold.getSounds(m.query,u).$promise}function g(e){d.voiceMusicOnHold.removeSound({id:t.params.id,id2:e.id}).$promise.then(function(){_.remove(m.musiconholdMohSounds.rows,{id:e.id}),m.musiconholdMohSounds.count-=1,m.musiconholdMohSounds.rows.length||p(),l.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.musiconhold={},m.musiconholdMohSounds={count:0,rows:[]},m.selectedMusicOnHoldMohSounds=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio",limit:10,page:1},m.init=function(e,n){m.musiconhold=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceMusicOnHoldId=m.musiconhold.id,m.query.id=m.musiconhold.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mohSound #")+e.id||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMusicOnHoldDownload=function(s,e,n){return d.sound.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mohSound"+s.id,a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getMusicOnHoldMohSounds=p,m.createOrEditMusicOnHoldMohSound=function(e,n){o.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:m.musiconhold,mohSound:n,mohSounds:m.musiconholdMohSounds.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(m.selectedMusicOnHoldMohSounds);return m.selectedMusicOnHoldMohSounds=[],e},m.deleteMusicOnHoldMohSound=g,m.deleteSelectedMusicOnHoldMohSounds=function(e){var n=o.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+m.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),m.selectedMusicOnHoldMohSounds=[]})},c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.sounds,{id:e.resourceId})}),t=null;if(m.musiconhold&&(t=_.find(m.sounds,{id:Number(m.musiconhold.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.sounds,{id:t.id});a.canSelect=!1,n.push(a)}m.sounds=n})}else{var t=[],a=null;m.musiconhold&&(a=_.find(m.sounds,{id:Number(m.musiconhold.id)}));for(var i=0;i<m.sounds.length;i++)a&&m.sounds[i].id===a.id&&(m.sounds[i].canSelect=!1,t.push(m.sounds[i]));m.sounds=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MOHSOUND",g.mohSound=angular.copy(l),g.mohSounds=r,g.newMohSound=!1,g.mohSound||(g.mohSound={},g.title="VOICE.NEW_MOHSOUND",g.newMohSound=!0),n.params.id&&(g.mohSound.VoiceMusicOnHoldId=n.params.id),g.addNewMohSound=function(){g.errors=[],d.voiceMusicOnHold.addSound({id:n.params.id},g.mohSound).$promise.then(function(e){g.mohSounds.unshift(e.toJSON()),o.success({title:"MohSound properly created",msg:g.mohSound.name?g.mohSound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMohSound=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.mohSound.id},g.mohSound).$promise.then(function(e){var n=_.find(g.mohSounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MohSound properly saved!",msg:g.mohSound.name?g.mohSound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMohSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.mohSound.id}).$promise.then(function(){_.remove(g.mohSounds,{id:g.mohSound.id}),o.success({title:"MohSound properly deleted!",msg:(g.mohSound.name||"mohSound")+" has been deleted!"}),v(g.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.sounds,{id:e.resourceId})}),t=null;if(g.mohSound&&(t=_.find(g.sounds,{id:Number(g.mohSound.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.sounds,{id:t.id});a.canSelect=!1,n.push(a)}g.sounds=n})}else{var t=[],a=null;g.mohSound&&(a=_.find(g.sounds,{id:Number(g.mohSound.id)}));for(var i=0;i<g.sounds.length;i++)a&&g.sounds[i].id===a.id&&(g.sounds[i].canSelect=!1,t.push(g.sounds[i]));g.sounds=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mohSounds","mohSound","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.musiconhold=c||e.params.musiconhold||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds",{},{reload:"app.voice.musiconholds"})},u.saveMusicOnHold=function(){r.voiceMusicOnHold.update({id:u.musiconhold.id},u.musiconhold).$promise.then(function(){l.success({title:"MusicOnHold updated!",msg:u.musiconhold.name?u.musiconhold.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","musiconhold","userProfileSection"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.musiconholds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="musiconholds",f.listOrder="",f.listOrderAsc=null,f.selectedMusicOnHolds=[],f.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},f.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("musiconhold")+"?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMusicOnHolds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMusicOnHold.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MusicOnHolds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMusicOnHold=function(e,n){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:n,musiconholds:f.musiconholds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMusicOnHold=y,f.exportSelectedMusicOnHolds=function(){var e=angular.copy(f.selectedMusicOnHolds);return f.selectedMusicOnHolds=[],e},f.deleteSelectedMusicOnHolds=function(e){var n=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+f.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMusicOnHolds.forEach(function(e){y(e)}),f.selectedMusicOnHolds=[]})},f.deselectMusicOnHolds=function(){f.selectedMusicOnHolds=[]},f.selectAllMusicOnHolds=function(){f.selectedMusicOnHolds=f.musiconholds.rows};var b=!0,A=1;function E(e){f.musiconholds=e||{count:0,rows:[]}}function y(e){m.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(f.musiconholds.rows,{id:e.id}),f.musiconholds.count-=1,f.musiconholds.rows.length||f.getMusicOnHolds(),p.success({title:_.startCase("MusicOnHold")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","musiconholds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.outboundRoute=angular.copy(s),d.outboundRoutes=n,d.newOutboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.outboundRoute||(d.outboundRoute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},d.newOutboundRoute=!0);e=[{key:"name",value:d.outboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newOutboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.outboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewOutboundRoute=function(){d.errors=[],o.voiceExtension.save(d.outboundRoute).$promise.then(function(e){c(e.id).then(function(){d.outboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveOutboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.outboundRoute.id},d.outboundRoute).$promise.then(function(e){var n=_.find(d.outboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.outboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteOutboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.outboundRoute.exten})).ariaLabel("Delete outbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.outboundRoute.id}).$promise.then(function(){_.remove(d.outboundRoutes,{id:d.outboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.outboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","outboundRoutes","outboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.outboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.outboundRoute=l||e.params.outboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.outboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",options:"xX",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Outbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.outboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoOutboundRoutes=function(){e.go("app.voice.outboundRoutes",{},{reload:"app.voice.outboundRoutes"})},m.saveOutboundRoute=function(){o.voiceExtension.update({id:m.outboundRoute.id},m.outboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.outboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","outboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.outboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="OutboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.outboundRoutes.rows,{id:e.id}),g.outboundRoutes.count-=1,g.outboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.outboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedOutboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.outboundRoutes.edit",{id:e.id,outboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditOutboundRoute=function(e,n){a.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundRoute:n,outboundRoutes:g.outboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getOutboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedOutboundRoutes=function(){var e=angular.copy(g.selectedOutboundRoutes);return g.selectedOutboundRoutes=[],e},g.deleteSelectedOutboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedOutboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedOutboundRoutes.forEach(function(e){f(e)}),g.selectedOutboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","outboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition,note",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-createdAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(){})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null,note:e.note||null};o.voiceQueueReport.update(n).$promise.catch(function(){})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"inbound"===g.query.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(){}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(){}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.calls=i||{rows:[],count:0},o.query={limit:10,page:1},o.channelStatus=s.OUTGOING_CALL_STATUS_STYLES,o.onSave=function(e){var n=_.find(o.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",n?_.merge(n,e):e.channel&&o.calls.rows.push(e)},o.onRemove=function(e){var n=_.findIndex(o.calls.rows,{channel:e.channel});0<=n&&(o.calls.rows[n].status="hangup");t(function(){o.calls.rows.splice(n,1)},5e3)},a.on("voice_outbound_channel:save",o.onSave),a.on("voice_outbound_channel:remove",o.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","realtimeManager"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","unmanaged","abandoned","sumHoldTime","sumDuration","sumBillable"];function u(){c.queues.rows.forEach(function(e){c.rpcQueues[e.id]&&_.merge(e,_.pick(c.rpcQueues[e.id],m))})}c.queues=a||{rows:[],count:0},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"inbound",fields:"id,name",sort:"name",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"name",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="VoiceQueues",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){var n=_.find(c.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.queues=e||{count:0,rows:[]},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n){var a=this;switch(a.selectedTab=0,t.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,t.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.voice.realtime.agents");break;case 1:t.go("app.voice.realtime.telephones");break;case 2:t.go("app.voice.realtime.trunks");break;case 3:t.go("app.voice.realtime.queues");break;case 4:t.go("app.voice.realtime.queue_calls");break;case 5:t.go("app.voice.realtime.abandonedcalls");break;case 6:t.go("app.voice.realtime.queue_params");break;case 7:t.go("app.voice.realtime.outbound_calls");break;default:t.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c){var m=this,u=["fullname","internal","state","status"];function p(){_.forIn(m.telephones,function(e,n){m.rpcTelephones[n]&&_.merge(e,_.pick(m.rpcTelephones[n],u))})}m.count=a.count,m.telephones=a?a.rows:{},m.rpcTelephones=i?i.rows:{},m.userProfile=l,m.userProfileSection=d&&1==d.count?d.rows[0]:null,m.crudPermissions=c.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={fields:"id,fullname,internal",role:"telephone",sort:"fullname",limit:10,page:1},m.statusClass=r.STATUS_STYLES,m.stateClass=r.STATES_STYLES,m.success=h,m.$onInit=p,m.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},m.getTelephones=function(){m.query.offset=(m.query.page-1)*m.query.limit,c.hasRole("admin")?m.promise=s.user.get(m.query,h).$promise:(m.query.id=m.userProfile.id,m.query.section="Telephones",m.promise=s.userProfile.getResources(m.query,h).$promise)},m.onSave=function(e){m.telephones[e.id]&&_.merge(m.telephones[e.id],_.pick(e,u))},o.on("telephone:save",m.onSave);var g=!0,v=1;function h(e){m.telephones=e?e.rows:{},p()}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=v),m.getTelephones())}),e.$on("$destroy",function(){o.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","realtimeManager","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"name",limit:10,page:1},u.statusClass=r.STATUS_STYLES,u.stateClass=r.STATES_STYLES,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","realtimeManager","$state","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEMAIL",g.voicemail=angular.copy(l),g.voicemails=r,g.newVoicemail=!1,g.voicemail||(g.voicemail={attach:"no"},g.title="VOICE.NEW_VOICEMAIL",g.newVoicemail=!0),g.addNewVoicemail=function(){g.errors=[],d.voiceMail.save(g.voicemail).$promise.then(function(e){g.voicemails.unshift(e.toJSON()),o.success({title:"Voicemail properly created",msg:g.voicemail.name?g.voicemail.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoicemail=function(){g.errors=[],d.voiceMail.update({id:g.voicemail.id},g.voicemail).$promise.then(function(e){var n=_.find(g.voicemails,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Voicemail properly saved!",msg:g.voicemail.name?g.voicemail.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoicemail=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMail.delete({id:g.voicemail.id}).$promise.then(function(){_.remove(g.voicemails,{id:g.voicemail.id}),o.success({title:"Voicemail properly deleted!",msg:(g.voicemail.name||"voicemail")+" has been deleted!"}),v(g.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicemails","voicemail","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.voicemailMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMail.getMessages(m.query,u).$promise}function g(e){d.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.voicemailMessages.rows,{id:e.id}),m.voicemailMessages.count-=1,m.voicemailMessages.rows.length||p(),l.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.voicemail={},m.voicemailMessages={count:0,rows:[]},m.selectedVoicemailMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},m.init=function(e,n){m.voicemail=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.id=m.voicemail.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("message #")+e.id||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMailMessageDownload=function(s,e,n){return d.voiceMailMessage.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="message"+s.id,a=new Blob(n,{type:e.type});t=s.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getVoicemailMessages=p,m.createOrEditVoicemailMessage=function(e,n){o.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:m.voicemail,message:n,messages:m.voicemailMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedVoicemailMessages=function(){var e=angular.copy(m.selectedVoicemailMessages);return m.selectedVoicemailMessages=[],e},m.deleteVoicemailMessage=g,m.deleteSelectedVoicemailMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+m.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedVoicemailMessages.forEach(function(e){g(e)}),m.selectedVoicemailMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.voicemail=c||e.params.voicemail||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVoicemails=function(){e.go("app.voice.voicemails",{},{reload:"app.voice.voicemails"})},u.saveVoicemail=function(){r.voiceMail.update({id:u.voicemail.id},u.voicemail).$promise.then(function(){l.success({title:"Voicemail updated!",msg:u.voicemail.name?u.voicemail.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.voicemail&&(t=_.find(u.contexts,{name:u.voicemail.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voicemail","userProfileSection"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicemails=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicemails",f.listOrder="",f.listOrderAsc=null,f.selectedVoicemails=[],f.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},f.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voicemails.edit",{id:e.id,voicemail:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicemail")+"?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicemails=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMail.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Voicemails",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoicemail=function(e,n){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:n,voicemails:f.voicemails.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVoicemail=y,f.exportSelectedVoicemails=function(){var e=angular.copy(f.selectedVoicemails);return f.selectedVoicemails=[],e},f.deleteSelectedVoicemails=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+f.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicemails.forEach(function(e){y(e)}),f.selectedVoicemails=[]})},f.deselectVoicemails=function(){f.selectedVoicemails=[]},f.selectAllVoicemails=function(){f.selectedVoicemails=f.voicemails.rows};var b=!0,A=1;function E(e){f.voicemails=e||{count:0,rows:[]}}function y(e){m.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(f.voicemails.rows,{id:e.id}),f.voicemails.count-=1,f.voicemails.rows.length||f.getVoicemails(),p.success({title:_.startCase("Voicemail")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicemails","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEPREFIX",g.voicePrefix=angular.copy(l),g.voicePrefixes=r,g.newvoicePrefix=!1,g.voicePrefix||(g.voicePrefix={},g.title="VOICE.NEW_VOICEPREFIX",g.newvoicePrefix=!0),g.addNewvoicePrefix=function(){g.errors=[],d.voicePrefix.save(g.voicePrefix).$promise.then(function(e){g.voicePrefixes.unshift(e.toJSON()),o.success({title:"voicePrefix properly created",msg:g.voicePrefix.name?g.voicePrefix.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savevoicePrefix=function(){g.errors=[],d.voicePrefix.update({id:g.voicePrefix.id},g.voicePrefix).$promise.then(function(e){var n=_.find(g.voicePrefixes,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"voicePrefix properly saved!",msg:g.voicePrefix.name?g.voicePrefix.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletevoicePrefix=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicePrefix will be deleted.").ariaLabel("Delete voicePrefix").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voicePrefix.delete({id:g.voicePrefix.id}).$promise.then(function(){_.remove(g.voicePrefixes,{id:g.voicePrefix.id}),o.success({title:"voicePrefix properly deleted!",msg:(g.voicePrefix.name||"voicePrefix")+" has been deleted!"}),v(g.voicePrefix)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.outboundRoutes,{id:e.resourceId})}),t=null;if(g.voicePrefix&&(t=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}g.outboundRoutes=n})}else{var t=[],a=null;g.voicePrefix&&(a=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)}));for(var i=0;i<g.outboundRoutes.length;i++)a&&g.outboundRoutes[i].id===a.id&&(g.outboundRoutes[i].canSelect=!1,t.push(g.outboundRoutes[i]));g.outboundRoutes=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicePrefixes","voicePrefix","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditvoicePrefixDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getAgents({id:c.voicePrefix.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UservoicePrefix?"penalty "+e.UservoicePrefix.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.voicePrefix=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("VOICE.ALL_AGENTS"),labelSelected:r.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","voicePrefixes","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getTeams({id:l.voicePrefix.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voicePrefix=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicePrefixes=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicePrefixes",f.listOrder="",f.listOrderAsc=null,f.selectedVoicePrefixes=[],f.query={fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"voicePrefixagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.teamadddialog=function(e,n){i.show({controller:"voicePrefixteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicePrefix")+"?").htmlContent("<b>"+(e.name||"voicePrefix")+"</b> will be deleted.").ariaLabel("delete voicePrefix").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicePrefixes=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voicePrefix.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoicePrefixes",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditvoicePrefix=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicePrefix:n,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletevoicePrefix=y,f.exportSelectedVoicePrefixes=function(){var e=angular.copy(f.selectedVoicePrefixes);return f.selectedVoicePrefixes=[],e},f.deleteSelectedVoicePrefixes=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicePrefixes?").htmlContent("<b>"+f.selectedVoicePrefixes.length+" selected</b> will be deleted.").ariaLabel("delete voicePrefixs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicePrefixes.forEach(function(e){y(e)}),f.selectedVoicePrefixes=[]})},f.deselectVoicePrefixes=function(){f.selectedVoicePrefixes=[]},f.selectAllVoicePrefixes=function(){f.selectedVoicePrefixes=f.voicePrefixes.rows},g.hasRole("admin")?m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.outboundRoutes,{id:e.resourceId})}),t=null;if(f.voicePrefix&&(t=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}f.outboundRoutes=n})}else{var t=[],a=null;f.voicePrefix&&(a=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)}));for(var i=0;i<f.outboundRoutes.length;i++)a&&f.outboundRoutes[i].id===a.id&&(f.outboundRoutes[i].canSelect=!1,t.push(f.outboundRoutes[i]));f.outboundRoutes=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.voicePrefixes=e||{count:0,rows:[]}}function y(e){m.voicePrefix.delete({id:e.id}).$promise.then(function(){_.remove(f.voicePrefixes.rows,{id:e.id}),f.voicePrefixes.count-=1,f.voicePrefixes.rows.length||f.getVoicePrefixes(),p.success({title:_.startCase("voicePrefix")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoicePrefix"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoicePrefix",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicePrefixes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicePrefixes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicePrefixesController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="VOICE.EDIT_VOICEQUEUE",r.voiceQueue=angular.copy(n),r.voiceQueues=e,r.newVoiceQueue=!1,r.voiceQueue||(r.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},r.title="VOICE.NEW_VOICEQUEUE",r.newVoiceQueue=!0),r.addNewVoiceQueue=function(){r.errors=[],i.voiceQueue.save(r.voiceQueue).$promise.then(function(e){r.voiceQueues.unshift(e.toJSON()),a.success({title:"VoiceQueue properly created",msg:r.voiceQueue.name?r.voiceQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveVoiceQueue=function(){r.errors=[],i.voiceQueue.update({id:r.voiceQueue.id},r.voiceQueue).$promise.then(function(e){var n=_.find(r.voiceQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"VoiceQueue properly saved!",msg:r.voiceQueue.name?r.voiceQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteVoiceQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.voiceQueue.delete({id:r.voiceQueue.id}).$promise.then(function(){_.remove(r.voiceQueues,{id:r.voiceQueue.id}),a.success({title:"VoiceQueue properly deleted!",msg:(r.voiceQueue.name||"voiceQueue")+" has been deleted!"}),l(r.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","voiceQueues","voiceQueue","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.voiceQueue=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voiceQueue=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.voiceQueue.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.voiceQueue=c||t.params.voiceQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.teamadddialog=function(e,n){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},u.alert=l.info,u.gotoVoiceQueues=function(){t.go("app.voice.voiceQueues",{},{reload:"app.voice.voiceQueues"})},u.saveVoiceQueue=function(){r.voiceQueue.update({id:u.voiceQueue.id},u.voiceQueue).$promise.then(function(){l.success({title:"VoiceQueue updated!",msg:u.voiceQueue.name?u.voiceQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.voiceQueue&&(t=_.find(u.musiconholds,{name:u.voiceQueue.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.sounds,{id:e.resourceId})});u.sounds.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.sounds=n})}else u.sounds=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceQueue","userProfileSection"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voiceQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voiceQueues",f.listOrder="",f.listOrderAsc=null,f.selectedVoiceQueues=[],f.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayjoinempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceQueue")+"?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},f.success=E,f.getVoiceQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoiceQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoiceQueue=function(e,n){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:f.voiceQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteVoiceQueue=y,f.exportSelectedVoiceQueues=function(){var e=angular.copy(f.selectedVoiceQueues);return f.selectedVoiceQueues=[],e},f.deleteSelectedVoiceQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+f.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoiceQueues.forEach(function(e){y(e)}),f.selectedVoiceQueues=[]})},f.deselectVoiceQueues=function(){f.selectedVoiceQueues=[]},f.selectAllVoiceQueues=function(){f.selectedVoiceQueues=f.voiceQueues.rows};var b=!0,A=1;function E(e){f.voiceQueues=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.voiceQueues.rows,{id:e.id}),f.voiceQueues.count-=1,f.voiceQueues.rows.length||f.getVoiceQueues(),p.success({title:_.startCase("VoiceQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICERECORDING",g.voiceRecording=angular.copy(l),g.voiceRecordings=r,g.newVoiceRecording=!1,g.voiceRecording||(g.voiceRecording={},g.title="VOICE.NEW_VOICERECORDING",g.newVoiceRecording=!0),g.addNewVoiceRecording=function(){g.errors=[],d.voiceRecording.save(g.voiceRecording).$promise.then(function(e){g.voiceRecordings.unshift(e.toJSON()),o.success({title:"VoiceRecording properly created",msg:g.voiceRecording.name?g.voiceRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceRecording=function(){g.errors=[],d.voiceRecording.update({id:g.voiceRecording.id},g.voiceRecording).$promise.then(function(e){var n=_.find(g.voiceRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VoiceRecording properly saved!",msg:g.voiceRecording.name?g.voiceRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceRecording.delete({id:g.voiceRecording.id}).$promise.then(function(){_.remove(g.voiceRecordings,{id:g.voiceRecording.id}),o.success({title:"VoiceRecording properly deleted!",msg:(g.voiceRecording.name||"voiceRecording")+" has been deleted!"}),v(g.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,n){var t=this;t.voiceRecording={},t.init=function(e){t.voiceRecording=e}}e.$inject=["api","toasty"],angular.module("app.voice").controller("VoiceRecordingSentimentStatisticsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.voiceRecording=c||e.params.voiceRecording||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.alert=l.info,p.gotoVoiceRecordings=function(){e.go("app.voice.voiceRecordings",{},{reload:"app.voice.voiceRecordings"})},p.saveVoiceRecording=function(){r.voiceRecording.update({id:p.voiceRecording.id},p.voiceRecording).$promise.then(function(){l.success({title:"VoiceRecording updated!",msg:p.voiceRecording.name?p.voiceRecording.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceRecording","userProfile","userProfileSection"],angular.module("app.voice").controller("VoiceRecordingController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,l,r,d,c,m,u,p,g,v,h,f){var b=this;function A(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!1}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function E(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function y(e,n){return m.voiceRecording.runTranscribe({id:e.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING")+" succeded!"})}).catch(function(e){p.error({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceRecordings=r||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceRecordings=[],b.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:"@msUtils.firstLastDayMonth()",limit:10,page:1},b.query.createdAt=u.firstLastDayMonth(),b.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],b.editstate=function(e,n){t.go("app.voice.voiceRecordings.edit",{id:e.id,voiceRecording:e,crudPermissions:b.crudPermissions})},b.runtranscriberuntranscribesentiment=A,b.runtranscribesentimentruntranscribesentiment=E,b.runsentimentruntranscribesentiment=y,b.downloadtranscribefile2=function(s,e){var t=!1,n=_.isNil(s.format)?s.value.substring(s.value.lastIndexOf(".")):s.format;t=".mp4"===n;-1<s.value.lastIndexOf("/")?s.value.substring(s.value.lastIndexOf("/")+1):-1<s.value.lastIndexOf("\\")?s.value.substring(s.value.lastIndexOf("\\")+1):s.value;return m.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+".txt";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.downloadfile2=function(r,e){var t=!1,n=_.isNil(r.format)?r.value.substring(r.value.lastIndexOf(".")):r.format;t=".mp4"===n;-1<r.value.lastIndexOf("/")?r.value.substring(r.value.lastIndexOf("/")+1):-1<r.value.lastIndexOf("\\")?r.value.substring(r.value.lastIndexOf("\\")+1):r.value;return m.voiceRecording.download({id:r.id}).$promise.then(function(e){var n,t,a=[e.buffer],i="download",s=new Blob(a,{type:e.type});n=r.value,t=-1<n.lastIndexOf("/")?n.substring(n.lastIndexOf("/")+1):-1<n.lastIndexOf("\\")?n.substring(n.lastIndexOf("\\")+1):n,i=(t=t.substring(0,t.lastIndexOf(".")))+r.format;var o=window.document.createElement("a");o.setAttribute("href",URL.createObjectURL(s)),o.setAttribute("download",i),document.body.appendChild(o),o.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceRecording")+"?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){O(e)},function(){console.log("CANCEL")})},b.success=I,b.getVoiceRecordings=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceRecording.get(b.query,I).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceRecordings",b.promise=m.userProfile.getResources(b.query,I).$promise)},b.createOrEditVoiceRecording=function(e,n){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:n,voiceRecordings:b.voiceRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceRecording=O,b.exportSelectedVoiceRecordings=function(){var e=angular.copy(b.selectedVoiceRecordings);b.selectedVoiceRecordings=[],b.userProfile.privacyEnabled&&_.forEach(e,function(e){e.calleridnum=f.mask(e.calleridnum),e.exten=f.mask(e.exten),e.connectedlinenum=f.mask(e.connectedlinenum),e.membername=f.mask(e.membername)});return e},b.deleteSelectedVoiceRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+b.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedVoiceRecordings.forEach(function(e){O(e)}),b.selectedVoiceRecordings=[]})},b.deselectVoiceRecordings=function(){b.selectedVoiceRecordings=[]},b.selectAllVoiceRecordings=function(){b.selectedVoiceRecordings=b.voiceRecordings.rows},b.runtranscribeSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){A(e,n)}),b.selectedVoiceRecordings=[]},b.runtranscribesentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){E(e,n)}),b.selectedVoiceRecordings=[]},b.runsentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){y(e,n)}),b.selectedVoiceRecordings=[]};var S=!0,T=1;function I(e){b.voiceRecordings=e||{count:0,rows:[]}}function O(e){m.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceRecordings.rows,{id:e.id}),b.voiceRecordings.count-=1,b.voiceRecordings.rows.length||b.getVoiceRecordings(),p.success({title:_.startCase("VoiceRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){S?o(function(){S=!1}):(n||(T=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=T),b.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","privacyManager"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.whatsapp.realtime.agents":this.selectedTab=0;break;case"app.whatsapp.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.whatsapp.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.whatsapp.realtime.agents");break;case 1:t.go("app.whatsapp.realtime.queues");break;default:t.go("app.whatsapp.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.whatsapp").controller("WhatsappRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){"twilio"===g.whatsappAccount.type&&(g.whatsappAccount.baseUrl=null)}function h(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPACCOUNT",g.whatsappAccount=angular.copy(l),g.whatsappAccounts=r,g.newWhatsappAccount=!1,g.whatsappAccount||(g.whatsappAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",notificationSound:!0,queueTransferTimeout:300,waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,agentTransferTimeout:300},g.title="WHATSAPP.NEW_WHATSAPPACCOUNT",g.newWhatsappAccount=!0),n.params.id&&(g.whatsappAccount.WhatsappAccountId=n.params.id),g.addNewWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.save(g.whatsappAccount).$promise.then(function(e){g.whatsappAccounts.unshift(e.toJSON()),o.success({title:"WhatsappAccount properly created",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.update({id:g.whatsappAccount.id},g.whatsappAccount).$promise.then(function(e){var n=_.find(g.whatsappAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappAccount properly saved!",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappAccount will be deleted.").ariaLabel("Delete WhatsappAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.whatsappAccount.delete({id:g.whatsappAccount.id}).$promise.then(function(){_.remove(g.whatsappAccounts,{id:g.whatsappAccount.id}),o.success({title:"WhatsappAccount properly deleted!",msg:(g.whatsappAccount.name||"whatsappAccount")+" has been deleted!"}),h(g.whatsappAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=h,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.whatsappAccount&&(t=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.whatsappAccount&&(a=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.pauses,{id:e.resourceId})});g.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.pauses=n})}else g.pauses=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappAccounts","whatsappAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccountApp:t,whatsappAccount:r.whatsappAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.whatsappAccountApps.rows[n]=e:r.whatsappAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.whatsappAccountApps.rows.length;t++,0){var a=r.whatsappAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.whatsappAccount.context,a.exten=r.whatsappAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.whatsappAccount.addApplications({id:r.whatsappAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.whatsappAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.whatsappAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.whatsappAccount={},r.whatsappAccountApps={count:0,rows:[]},r.selectedWhatsappAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"WhatsappQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"whatsappQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:2102}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.whatsappAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getWhatsappAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.whatsappAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getWhatsappAccountApps=function(){r.promise=o.whatsappAccount.getApplications(r.query,t).$promise},r.editWhatsappAccountApp=n,r.editInterval=function(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteWhatsappAccountApp=function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedWhatsappAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedWhatsappAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedWhatsappAccountApps.forEach(function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id})}),r.selectedWhatsappAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappAccount.getAgents({id:c.whatsappAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappAccount?"penalty "+e.UserWhatsappAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.removeAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.addAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappAccount","whatsappAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditWhatsappAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("whatsapp")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:2102}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:m.whatsappAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.whatsappAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.whatsappAccountInteractions.rows.length;n+=1){var t=m.whatsappAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappInteraction.get(m.query,p).$promise}function v(e){d.whatsappInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountInteractions.rows,{id:e.id}),m.whatsappAccountInteractions.count-=1,m.whatsappAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountInteractions={count:0,rows:[]},m.selectedWhatsappAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.whatsappInteractionDownload=function(s,e,n){return d.whatsappInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="whatsapp-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getWhatsappAccountInteractions=g,m.createOrEditWhatsappAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,interaction:n,interactions:m.whatsappAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spywhatsappInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"whatsapp",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"whatsapp.whatsappAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||WhatsappAccountId:=$eq["+m.whatsappAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedWhatsappAccountInteractions=function(){var e=angular.copy(m.selectedWhatsappAccountInteractions);return m.selectedWhatsappAccountInteractions=[],e},m.deleteWhatsappAccountInteraction=v,m.deleteSelectedWhatsappAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedWhatsappAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountInteractions.forEach(function(e){v(e)}),m.selectedWhatsappAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.whatsappAccount=c||e.params.whatsappAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.baseUrl=[{name:"US Production",url:"https://us1.whatsapp.api.sinch.com"},{name:"EU Production",url:"https://eu1.whatsapp.api.sinch.com"}],p.agentadddialog=function(e,n){t.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:p.whatsappAccounts?p.whatsappAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoWhatsappAccounts=function(){e.go("app.whatsapp.whatsappAccounts",{},{reload:"app.whatsapp.whatsappAccounts"})},p.saveWhatsappAccount=function(){"twilio"===p.whatsappAccount.type&&(p.whatsappAccount.baseUrl=null);r.whatsappAccount.update({id:p.whatsappAccount.id},p.whatsappAccount).$promise.then(function(){l.success({title:"WhatsappAccount updated!",msg:p.whatsappAccount.name?p.whatsappAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.whatsappAccount&&(t=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.whatsappAccount&&(a=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappAccount","userProfile","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.whatsappAccountWhatsappCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountWhatsappCannedAnswers.rows,{id:e.id}),m.whatsappAccountWhatsappCannedAnswers.count-=1,m.whatsappAccountWhatsappCannedAnswers.rows.length||p(),l.success({title:"WhatsappCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountWhatsappCannedAnswers={count:0,rows:[]},m.selectedWhatsappAccountWhatsappCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the whatsappCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("whatsappCannedAnswer #")+e.id||"whatsappCannedAnswer")+"</b> will be deleted.").ariaLabel("delete whatsappCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getWhatsappAccountWhatsappCannedAnswers=p,m.createOrEditWhatsappAccountWhatsappCannedAnswer=function(e,n){o.show({controller:"CreateOrEditWhatsappCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,whatsappCannedAnswer:n,whatsappCannedAnswers:m.whatsappAccountWhatsappCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedWhatsappAccountWhatsappCannedAnswers=function(){var e=angular.copy(m.selectedWhatsappAccountWhatsappCannedAnswers);return m.selectedWhatsappAccountWhatsappCannedAnswers=[],e},m.deleteWhatsappAccountWhatsappCannedAnswer=g,m.deleteSelectedWhatsappAccountWhatsappCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected whatsappCannedAnswers?").htmlContent("<b>"+m.selectedWhatsappAccountWhatsappCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete whatsappCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountWhatsappCannedAnswers.forEach(function(e){g(e)}),m.selectedWhatsappAccountWhatsappCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountWhatsappCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER",g.whatsappCannedAnswer=angular.copy(l),g.whatsappCannedAnswers=r,g.newWhatsappCannedAnswer=!1,g.whatsappCannedAnswer||(g.whatsappCannedAnswer={},g.title="WHATSAPP.NEW_WHATSAPPCANNEDANSWER",g.newWhatsappCannedAnswer=!0),n.params.id&&(g.whatsappCannedAnswer.WhatsappAccountId=n.params.id),g.addNewWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.whatsappCannedAnswer).$promise.then(function(e){g.whatsappCannedAnswers.unshift(e.toJSON()),o.success({title:"WhatsappCannedAnswer properly created",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.whatsappCannedAnswer.id},g.whatsappCannedAnswer).$promise.then(function(e){var n=_.find(g.whatsappCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappCannedAnswer properly saved!",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappCannedAnswer will be deleted.").ariaLabel("Delete WhatsappCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.whatsappCannedAnswer.id}).$promise.then(function(){_.remove(g.whatsappCannedAnswers,{id:g.whatsappCannedAnswer.id}),o.success({title:"WhatsappCannedAnswer properly deleted!",msg:(g.whatsappCannedAnswer.name||"whatsappCannedAnswer")+" has been deleted!"}),v(g.whatsappCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappCannedAnswers","whatsappCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.whatsappAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.whatsappAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.whatsappAccount.id,field:"WhatsappAccountId",route:"whatsappAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Sinch",value:"'sinch'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,whatsappAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:f.whatsappAccounts?f.whatsappAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappAccount")+"?").htmlContent("<b>"+(e.name||"whatsappAccount")+"</b> will be deleted.").ariaLabel("delete whatsappAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getWhatsappAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappAccount=function(e,n){i.show({controller:"CreateOrEditWhatsappAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:n,whatsappAccounts:f.whatsappAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteWhatsappAccount=y,f.exportSelectedWhatsappAccounts=function(){var e=angular.copy(f.selectedWhatsappAccounts);return f.selectedWhatsappAccounts=[],e},f.deleteSelectedWhatsappAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappAccounts?").htmlContent("<b>"+f.selectedWhatsappAccounts.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappAccounts.forEach(function(e){y(e)}),f.selectedWhatsappAccounts=[]})},f.deselectWhatsappAccounts=function(){f.selectedWhatsappAccounts=[]},f.selectAllWhatsappAccounts=function(){f.selectedWhatsappAccounts=f.whatsappAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.whatsappAccount&&(t=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.whatsappAccount&&(a=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.pauses,{id:e.resourceId})});f.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.pauses=n})}else f.pauses=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.whatsappAccounts=e||{count:0,rows:[]}}function y(e){m.whatsappAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappAccounts.rows,{id:e.id}),f.whatsappAccounts.count-=1,f.whatsappAccounts.rows.length||f.getWhatsappAccounts(),p.success({title:_.startCase("WhatsappAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="WHATSAPP.EDIT_WHATSAPPQUEUE",r.whatsappQueue=angular.copy(n),r.whatsappQueues=e,r.newWhatsappQueue=!1,r.whatsappQueue||(r.whatsappQueue={strategy:"beepall",timeout:10},r.title="WHATSAPP.NEW_WHATSAPPQUEUE",r.newWhatsappQueue=!0),r.addNewWhatsappQueue=function(){r.errors=[],i.whatsappQueue.save(r.whatsappQueue).$promise.then(function(e){r.whatsappQueues.unshift(e.toJSON()),a.success({title:"WhatsappQueue properly created",msg:r.whatsappQueue.name?r.whatsappQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveWhatsappQueue=function(){r.errors=[],i.whatsappQueue.update({id:r.whatsappQueue.id},r.whatsappQueue).$promise.then(function(e){var n=_.find(r.whatsappQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"WhatsappQueue properly saved!",msg:r.whatsappQueue.name?r.whatsappQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteWhatsappQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The whatsappQueue will be deleted.").ariaLabel("Delete WhatsappQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.whatsappQueue.delete({id:r.whatsappQueue.id}).$promise.then(function(){_.remove(r.whatsappQueues,{id:r.whatsappQueue.id}),a.success({title:"WhatsappQueue properly deleted!",msg:(r.whatsappQueue.name||"whatsappQueue")+" has been deleted!"}),l(r.whatsappQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","whatsappQueues","whatsappQueue","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getAgents({id:c.whatsappQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappQueue?"penalty "+e.UserWhatsappQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","whatsappQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getTeams({id:l.whatsappQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.whatsappQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("WHATSAPP.ALL_TEAMS"),labelSelected:t.instant("WHATSAPP.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.whatsappQueue=c||e.params.whatsappQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoWhatsappQueues=function(){e.go("app.whatsapp.whatsappQueues",{},{reload:"app.whatsapp.whatsappQueues"})},u.saveWhatsappQueue=function(){r.whatsappQueue.update({id:u.whatsappQueue.id},u.whatsappQueue).$promise.then(function(){l.success({title:"WhatsappQueue updated!",msg:u.whatsappQueue.name?u.whatsappQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappQueue","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappQueues",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappQueues.edit",{id:e.id,whatsappQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappQueue")+"?").htmlContent("<b>"+(e.name||"whatsappQueue")+"</b> will be deleted.").ariaLabel("delete whatsappQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:2110}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.whatsapp.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.whatsapp.realtime.queues",{})}},f.success=E,f.getWhatsappQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappQueue=function(e,n){i.show({controller:"CreateOrEditWhatsappQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:f.whatsappQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteWhatsappQueue=y,f.exportSelectedWhatsappQueues=function(){var e=angular.copy(f.selectedWhatsappQueues);return f.selectedWhatsappQueues=[],e},f.deleteSelectedWhatsappQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappQueues?").htmlContent("<b>"+f.selectedWhatsappQueues.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappQueues.forEach(function(e){y(e)}),f.selectedWhatsappQueues=[]})},f.deselectWhatsappQueues=function(){f.selectedWhatsappQueues=[]},f.selectAllWhatsappQueues=function(){f.selectedWhatsappQueues=f.whatsappQueues.rows};var b=!0,A=1;function E(e){f.whatsappQueues=e||{count:0,rows:[]}}function y(e){m.whatsappQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappQueues.rows,{id:e.id}),f.whatsappQueues.count-=1,f.whatsappQueues.rows.length||f.getWhatsappQueues(),p.success({title:_.startCase("WhatsappQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappQueuesController",e)}(),function(){"use strict";function e(n,t,e,a,o,i,s,r,l,d,c,m,u){var p=this;function g(e,n){return{id:e,title:n.name||"NONAME",state:"app.dashboards.custom",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function v(e,n){return{id:e,title:n.name||"NONAME",state:"app.plugins.plugin",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function h(e,n){var t={user:_.pick(r.getCurrentUser(),["id","name","fullname","email","role","internal","interface"])};n.agentUrl=Mustache.render(n.agentUrl,t),i.saveItem("apps.home.plugin_"+e,{id:e,title:n.name,translate:n.name,state:"plugin_"+n.id,stateParams:n,view:"plugin",icon:n.icon,weight:12,hidden:function(){return!r.hasPermission(e)}})}function f(e){return _.map(e.children,function(e){return e.id})}s.clear(),p.isAgent=function(){return r.getCurrentUser()&&r.hasRole("agent")},o.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return r.hasRole("agent")}}),d.version.get().$promise.then(function(e){p.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(){p.version="UNKNOWN"}).finally(function(){o.saveItem("version",{title:"VERSION "+p.version,group:!0,weight:2,hidden:function(){return r.hasRole("agent")}})}),r.isLoggedIn()&&(null===m.userSettings&&m.getUserSettingForUser(),l.gray&&s.warning({msg:e.instant("DASHBOARDS.LICENSE_EXPIRE_REMAINING_DAYS"),showClose:!0,timeout:!1}),d.dashboard.get().$promise.then(function(e){for(var n=0,t=0;t<e.rows.length;t+=1)n=99999+e.rows[t].id,o.saveItem("apps.dashboards.custom_"+n,g(n,e.rows[t]))}),d.plugin.get({active:!0}).$promise.then(function(e){var n=0;if(e.count){var t=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"agentOnly"!=e.sidebar});if(0<t.length){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",permissions:{hidden:!0},weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}});for(var a=0;a<t.length;a+=1)n=88888+t[a].id,o.saveItem("apps.plugins.plugin_"+n,v(n,t[a]));o.sort()}var i=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"adminOnly"!=e.sidebar});if(0<i.length)for(var s=0;s<i.length;s+=1)h(n=88888+i[s].id,i[s])}})),l.custom&&!c.defaultPageTitle&&c.pageTitle&&angular.element("#pageTitle").html(c.pageTitle),o.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.dashboards.general",{id:101,title:"General",route:"",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(101)&&!r.hasRole("admin")}}),o.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.staff.users",{id:201,title:"Users",route:"user",translate:"STAFF.USERS",state:"app.staff.users",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||r.hasRole("user")||!r.hasPermission(201)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.agents",{id:202,title:"Agents",route:"user",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(202)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.telephones",{id:203,title:"Telephones",route:"user",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(203)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.teams",{id:204,title:"Teams",route:"team",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(204)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.userProfiles",{id:205,title:"UserProfiles",route:"userProfile",translate:"STAFF.USERPROFILES",state:"app.staff.userProfiles",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(205)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",license:"cm",weight:4,hidden:function(){return!l.cm||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",route:"cmList",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(301)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",route:"cmCompany",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(302)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",route:"cmCustomField",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",permissions:{association:!1},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(304)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",route:"",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(303)&&!r.hasRole("admin")}}),o.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",license:"voice",weight:5,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",route:"voiceQueue",channel:"voice",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(401)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.contexts",{id:405,title:"Contexts",route:"voiceContext",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(405)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",route:"voiceMail",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(406)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",route:"voiceMusicOnHold",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(407)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",route:"voiceRecording",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(408)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",route:"voiceChanSpy",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(409)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicePrefixes",{id:410,title:"VoicePrefixes",route:"voicePrefix",translate:"VOICE.VOICEPREFIXES",state:"app.voice.voicePrefixes",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(410)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.inboundRoutes",{id:402,title:"InboundRoutes",route:"voiceExtension",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundRoutes",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(402)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.outboundRoutes",{id:403,title:"OutboundRoutes",route:"voiceExtension",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundRoutes",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(403)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.internalRoutes",{id:404,title:"InternalRoutes",route:"voiceExtension",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalRoutes",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(404)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.realtime",{id:411,title:"Realtime",route:"",translate:"VOICE.REALTIME",state:"app.voice.realtime",permissions:{association:!1,crud:!1},weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(411)&&!r.hasRole("admin")}}),o.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",license:"chat",weight:6,hidden:function(){return!l.chat||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",route:"chatQueue",channel:"chat",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(501)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",route:"chatWebsite",channel:"chat",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(502)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.realtime",{id:510,title:"Realtime",route:"",translate:"CHAT.REALTIME",state:"app.chat.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(510)&&!r.hasRole("admin")}}),o.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",license:"mail",weight:7,hidden:function(){return!l.mail||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",route:"mailQueue",channel:"mail",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(601)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",route:"mailAccount",channel:"mail",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(602)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",route:"mailSubstatus",channel:"mail",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(603)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.realtime",{id:610,title:"Realtime",route:"",translate:"MAIL.REALTIME",state:"app.mail.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(610)&&!r.hasRole("admin")}}),o.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",license:"messaging",weight:8,hidden:function(){return!l.messaging||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",route:"smsQueue",channel:"sms",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(701)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",route:"smsAccount",channel:"sms",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(702)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.realtime",{id:710,title:"Realtime",route:"",translate:"SMS.REALTIME",state:"app.sms.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(710)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",license:"openchannel",weight:9,hidden:function(){return!l.openchannel||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",route:"openchannelQueue",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(801)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",route:"openchannelAccount",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(802)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",route:"",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(810)&&!r.hasRole("admin")}}),o.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",license:"fax",weight:10,hidden:function(){return!l.fax||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",route:"faxQueue",channel:"fax",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(901)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",route:"faxAccount",channel:"fax",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(902)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.realtime",{id:910,title:"Realtime",route:"",translate:"FAX.REALTIME",state:"app.fax.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(910)&&!r.hasRole("admin")}}),o.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:15,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.tools.cannedAnswers",{id:1001,title:"CannedAnswers",route:"cannedAnswer",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1001)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",route:"dashboard",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1003)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",route:"interval",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1004)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",route:"pause",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1005)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.schedules",{id:1006,title:"Scheduler",route:"schedule",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1006)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.sounds",{id:1007,title:"Sounds",route:"sound",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1007)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.tags",{id:1008,title:"Tags",route:"tag",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1008)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.templates",{id:1009,title:"Templates",route:"template",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1009)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.trunks",{id:1011,title:"Trunks",route:"trunk",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1011)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.variables",{id:1012,title:"Variables",route:"variable",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1012)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.contact_item_types",{id:1013,title:"ContactItemType",route:"contactItemType",translate:"TOOLS.CONTACTITEMTYPE",state:"app.tools.contact_item_types",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1013)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.dispositions",{id:1002,title:"Dispositions",route:"disposition",translate:"TOOLS.DISPOSITIONS",state:"app.tools.dispositions",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1002)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.triggers",{id:1010,title:"Triggers",route:"trigger",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1010)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",license:"voice",weight:13,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",route:"squareOdbc",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1101)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",route:"squareRecording",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1102)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",route:"squareProject",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1103)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:16,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",route:"analyticMetric",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1201)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",route:"analyticExtractedReport",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1202)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.reports",{id:1203,title:"Reports",route:"",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1203)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",route:"intZendeskAccount",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1301)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",route:"intSalesforceAccount",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1302)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",route:"intFreshdeskAccount",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1303)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.sugarcrmAccounts",{id:1305,title:"SugarcrmAccounts",route:"intSugarcrmAccount",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",permissions:{association:!1,loading:!0},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1305)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.deskAccounts",{id:1306,title:"DeskAccounts",route:"intDeskAccount",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",permissions:{association:!1,loading:!0},weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1306)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zohoAccounts",{id:1307,title:"ZohoAccounts",route:"intZohoAccount",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",permissions:{association:!1,loading:!0},weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1307)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.vtigerAccounts",{id:1308,title:"VtigerAccounts",route:"intVtigerAccount",translate:"INTEGRATIONS.VTIGERACCOUNTS",state:"app.integrations.vtigerAccounts",permissions:{association:!1,loading:!0},weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1308)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.dynamics365Accounts",{id:1309,title:"Dynamics365Accounts",route:"intDynamics365Account",translate:"INTEGRATIONS.DYNAMICS365ACCOUNTS",state:"app.integrations.dynamics365Accounts",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1309)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.servicenowAccounts",{id:1310,title:"ServicenowAccounts",route:"intServicenowAccount",translate:"INTEGRATIONS.SERVICENOWACCOUNTS",state:"app.integrations.servicenowAccounts",permissions:{association:!1,loading:!0},weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1310)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshsalesAccounts",{id:1304,title:"FreshsalesAccounts",route:"intFreshsalesAccount",translate:"INTEGRATIONS.FRESHSALESACCOUNTS",state:"app.integrations.freshsalesAccounts",permissions:{association:!1,loading:!0},weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1304)&&!r.hasRole("admin")}}),o.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",permissions:{hidden:!0},weight:20,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")||r.hasRole("admin")&&!r.getCurrentUser().settingsEnabled}}),o.saveItem("apps.settings.generals",{id:1401,title:"General",route:"setting",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",route:"mailAccount",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.networks",{id:1403,title:"Networks",route:"network",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",route:"setting",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!l.custom||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.cloudProviders",{id:1408,title:"AiTools",route:"cloudProvider",translate:"SETTINGS.CLOUD_PROVIDERS",state:"app.settings.cloudProviders",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.updates",{id:1404,title:"Updates",route:"",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!l.update||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.license",{id:1405,title:"License",route:"",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.system",{id:1406,title:"System",route:"",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",license:"dialer",weight:5,hidden:function(){return!l.dialer||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",route:"voiceQueue",channel:"bull",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1501)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",route:"campaign",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1502)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",route:"",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1510)&&!r.hasRole("admin")}}),o.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",permissions:{association:!1},weight:21,hidden:function(){return!c.viewHelpSection||r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.help.about",{id:1601,title:"About",route:"",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",license:"jscripty",weight:14,hidden:function(){return!l.jscripty||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",route:"jscriptyProject",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1701)&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace",{id:1800,title:"Marketplace",translate:"MARKETPLACE.MARKETPLACE",icon:"icon-cart",weight:18,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace.plugins",{id:1801,title:"Plugins",route:"plugin",translate:"MARKETPLACE.PLUGINS",state:"app.marketplace.plugins",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1801)&&!r.hasRole("admin")}}),o.saveItem("apps.video",{id:2e3,title:"Video",translate:"VIDEO.VIDEO",icon:"icon-video",license:"screenrecording",weight:12,hidden:function(){return!l.screenrecording||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.video.screenRecordings",{id:2001,title:"ScreenRecordings",route:"screenRecording",translate:"VIDEO.SCREENRECORDINGS",state:"app.video.screenRecordings",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2001)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp",{id:2100,title:"Whatsapp",translate:"WHATSAPP.WHATSAPP",icon:"icon-whatsapp",license:"whatsapp",weight:11,hidden:function(){return!l.whatsapp||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappQueues",{id:2101,title:"WhatsappQueues",route:"whatsappQueue",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPQUEUES",state:"app.whatsapp.whatsappQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2101)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappAccounts",{id:2102,title:"WhatsappAccounts",route:"whatsappAccount",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPACCOUNTS",state:"app.whatsapp.whatsappAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2102)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.realtime",{id:2110,title:"Realtime",route:"",translate:"WHATSAPP.REALTIME",state:"app.whatsapp.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2110)&&!r.hasRole("admin")}}),o.sort(),i.saveItem("apps",{title:"APPS",group:!0,weight:1}),i.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),i.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",view:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!r.hasPermission(101)}}),i.saveItem("apps.home.agentPresence",{id:115,title:"AgentPresence",translate:"DASHBOARDS.AGENT_PRESENCE",state:"agentPresence",view:"agentPresence",icon:"icon-webcam",iconClass:"xenialab-violet-light-fg",weight:2,hidden:function(){return!r.hasPermission(115)}}),i.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",view:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:3,hidden:function(){return!l.cm||!r.hasPermission(102)}}),i.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",view:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:4,hidden:function(){return!l.cm||!r.hasPermission(103)}}),i.saveItem("apps.home.scheduled",{id:113,title:"Scheduled Calls",translate:"DASHBOARDS.SCHEDULED_CALLS",state:"scheduled",view:"scheduled",icon:"icon-calendar-clock",iconClass:"blue-grey-fg",weight:5,hidden:function(){return!l.dialer||!r.hasPermission(113)}}),i.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",view:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:6,hidden:function(){return!l.voice||!r.hasPermission(110)}}),i.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",view:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:7,hidden:function(){return!l.voice||!r.hasPermission(111)}}),i.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",view:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:8,hidden:function(){return!l.voice||!r.hasPermission(104)}}),i.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",view:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:9,hidden:function(){return!l.chat||!r.hasPermission(105)}}),i.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",view:"mail",icon:"icon-email",iconClass:"teal-fg",weight:10,hidden:function(){return!l.mail||!r.hasPermission(106)}}),i.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",view:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:11,hidden:function(){return!l.messaging||!r.hasPermission(107)}}),i.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",view:"openchannel",icon:"icon-google-earth",iconClass:"amber-fg",weight:12,hidden:function(){return!l.openchannel||!r.hasPermission(108)}}),i.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",view:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:13,hidden:function(){return!l.fax||!r.hasPermission(109)}}),i.saveItem("apps.home.whatsapp",{id:114,title:"Whatsapp",translate:"DASHBOARDS.WHATSAPP",state:"whatsapp",view:"whatsapp",icon:"icon-whatsapp",iconClass:"lime-A700-fg",weight:14,hidden:function(){return!l.whatsapp||!r.hasPermission(114)}}),n.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===n.$id&&t.$broadcast("msSplashScreen::remove")}),n.$on("socket:connect",function(){t.toastySocketLost&&(s.clear(t.toastySocketLost),t.toastySocketLost=void 0)}),n.$on("socket:disconnect",function(){t.toastySocketLost||s.warning({title:e.instant("TOOLBAR.WARNING"),msg:e.instant("DASHBOARDS.LOST_CONNECTION"),timeout:!1,onAdd:function(){t.toastySocketLost=this.id}})}),n.$on("client-side-logging:enabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_ENABLED_MSG")})}),n.$on("client-side-logging:disabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_DISABLED_MSG")})}),a.onbeforeunload=function(){r.isTelephone()||u.flush()}}e.$inject=["$scope","$rootScope","$translate","$window","msNavigationService","msNavigationAgentService","toasty","Auth","license","api","setting","UserSettingService","ClientSideLoggingService"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,n,t,a,o,r){var i=this;function s(e){if(e&&e.id){var n=99999+e.id;o.saveItem("apps.dashboards.custom_"+n,{id:n,title:e.name||"NONAME",state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}})}}function l(e){if(e&&e.id&&"never"!=e.sidebar)if(e.active){if("always"==e.sidebar||"adminOnly"==e.sidebar){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1900)&&!r.hasRole("admin")}});var n=88888+e.id;o.saveItem("apps.plugins.plugin_"+n,{id:n,title:e.name||"NONAME",state:"app.plugins.plugin",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}}),o.sort()}}else{n=88888+e.id;t=1900,a=n,i=o.getNavigation(),(s=_.find(i[0].children,{id:t}))&&_.some(s.children,{id:a})&&("always"==e.sidebar||"adminOnly"==e.sidebar)&&(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}var t,a,i,s}function d(e){var n=o.getNavigation(),t=_.find(n[0].children,{id:e});return!!(t&&0<t.children.length)}i.bodyEl=angular.element("body"),i.setting=t,i.$onInit=function(){i.folded="true"===n.get("motion.folded")||!1},i.toggleMsNavigationFolded=function(){i.folded=!i.folded,n.put("motion.folded",i.folded)},i.getLogo=function(){return i.setting.defaultHeaderWhiteLabel?"xCALLY Motion":i.setting.headerWhiteLabel},a.on("dashboard:save",s),a.on("dashboard:update",s),a.on("dashboard:remove",function(e){if(e&&e.id){var n=99999+e.id;o.deleteItem("apps.dashboards.custom_"+n)}}),a.on("plugin:save",l),a.on("plugin:update",l),a.on("plugin:remove",function(e){if(e&&e.id&&"never"!=e.sidebar){var n=88888+e.id;"always"!=e.sidebar&&"adminOnly"!=e.sidebar||(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}}),e.$on("$stateChangeSuccess",function(){i.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,n,t,s,o,r){var l=this;function d(t){o.isSupported()?o.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=t).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},o.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),n)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=n.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},t.on("chatInternalMessage:save",l.onMessageSave),t.on("chatInternalMessage:update",l.onMessageUpdate),s.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),s.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var n=[],t=e.rows,a=0;a<t.length;a++)n.push(s.chatGroup.getUnread({id:t[a].id}).$promise);return i.all(n)}).then(function(e){for(var n=0;n<e.length;n++)l.unreadTotalGroupMessages+=e[n].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){t.removeAllListeners("chatInternalMessage:save"),t.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l,d,c){var m=this;function u(){if(!m.hasMoreMessages||m.isLoading)return t.resolve();m.user.messages.length;return function(){m.isLoading=!0;var e={sort:"-createdAt",FromId:m.currentUser.id+","+m.user.id,ToId:m.currentUser.id+","+m.user.id,ChatGroupId:"null",limit:50,offset:m.user.messages.length};return r.chatInternalMessage.get(e).$promise.then(function(e){m.user.messages=m.user.messages.concat(e.rows),m.hasMoreMessages=e.count>m.user.messages.length;for(var n=0;n<m.user.messages.length;n+=1)!1===m.user.messages[n].read&&m.user.messages[n].ToId===m.currentUser.id&&r.chatInternalMessage.update({id:m.user.messages[n].id,read:!0})}).finally(function(){m.isLoading=!1})}()}function p(e){var n=angular.element("#chat-dialog");s(function(){n.animate({scrollTop:0},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return n.get(e).success(function(){c.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(){c.error({title:"PhoneBar API Error",msg:o.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}m.currentUser=l.getCurrentUser(),m.user=void 0,m.users={count:0,rows:[]},m.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),m.unreadMessages={},m.replyMessage="",m.disabled=!1,m.defaultAvatar="assets/images/avatars/profile.png",m.init=function(e){m.license=e,t.all([r.chatInternalMessage.get({fields:"FromId",ToId:m.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){m.unreadMessages=_.countBy(e.rows,"FromId")}).catch(function(e){throw e}),r.chatInternalMessage.getUsers().$promise.then(function(e){m.users=e}).catch(function(e){throw e})]).catch(function(e){c.error({msg:e.data?e.data.message:e.message||e})})},m.reply=function(){if(m.disabled=!0,""===m.replyMessage)return void(m.disabled=!1);var e={FromId:m.currentUser.id,ToId:m.user.id,body:m.replyMessage,read:!1};m.replyMessage="",r.chatInternalMessage.save(e).$promise.then(function(e){m.user.messages.unshift(e),m.user.lastMessageAt=e.createdAt,m.user.lastMessage=e}).finally(function(){p(400),m.disabled=!1})},m.webcall=function(e){a.$broadcast("webrtc::call",{target:g(e)})},m.call=function(e){return v("http://127.0.0.1:"+(m.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},m.transfer=function(e){return v("http://127.0.0.1:"+(m.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},m.beepPlayer=null,m.openChat=function(e){return m.user=angular.copy(e),m.isMessengerAllowed=!1,"agent"!==m.user.role||m.user.allowmessenger?(p(0),m.isMessengerAllowed=!0,m.hasMoreMessages=!0,u()):void c.warning({title:o.instant("QUICKPANEL.WARNING"),msg:o.instant("QUICKPANEL.MESSENGER_DISABLED")})},m.closeChat=function(){m.user=void 0,m.hasMoreMessages=!0},m.scrollToTopOfChat=p,d.on("chatInternalMessage:save",function(e){m.beepPlayer=document.getElementById("beep-player"),e.ToId===m.currentUser.id&&e.ToId!==e.FromId&&m.currentUser.messengerSoundNotification&&m.beepPlayer.play().catch(function(e){console.log(e.message)});if(e.ToId===m.currentUser.id&&!e.ChatGroupId){m.user&&m.user.id===e.FromId?(m.user.messages.unshift(e),p(0),r.chatInternalMessage.update({id:e.id,read:!0})):m.unreadMessages[e.FromId]=m.unreadMessages[e.FromId]?m.unreadMessages[e.FromId]+1:1;var n=_.find(m.users.rows,{id:e.FromId});n&&(n.lastMessageAt=e.createdAt,n.lastMessage=e)}}),d.on("chatInternalMessage:update",function(e){if((e.FromId===m.currentUser.id||e.ToId===m.currentUser.id)&&!e.ChatGroupId){if(m.user){var n=_.find(m.user.messages,{id:e.id});n&&_.merge(n,e)}var t=_.find(m.users.rows,{id:m.currentUser.id===e.FromId?e.ToId:e.FromId});t&&t.lastMessage&&_.merge(t.lastMessage,e),e.ToId===m.currentUser.id&&e.read&&0<m.unreadMessages[e.FromId]&&(m.unreadMessages[e.FromId]-=1)}}),d.on("user:update",function(e){var n=_.find(m.users.rows,{id:e.id});n&&(_.isNil(e.online)||n.online===e.online||(n.online=e.online),_.isNil(e.allowmessenger)||n.allowmessenger===e.allowmessenger||(n.allowmessenger=e.allowmessenger))}),e("quick-panel").onClose(function(){m.user=void 0}),m.loadMoreMessages=u,m.timelineOptions={scrollEl:"#chat-dialog"},i.$on("$destroy",function(){d.removeAllListeners("chatInternalMessage:save"),d.removeAllListeners("chatInternalMessage:update"),d.removeAllListeners("user:update")})}e.$inject=["$http","$mdSidenav","$q","$rootScope","$scope","$timeout","$translate","api","Auth","socket","toasty"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=o.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var t;return d.errors=[],s.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var n=_.map(d.group.members,"id");return n.unshift(d.currentUser.id),t=e,s.chatGroup.addMembers({id:t.id,ids:n}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:t.name+" has been saved!"}),c(t)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((n=e,t=angular.lowercase(n),function(e){var n=e.name.toLowerCase();return-1!=n.indexOf(t)})):[];var n,t}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,t,a,s,n,o,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var n=angular.element("#chat-group-dialog");a(function(){n.animate({scrollTop:n[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var n=0,t=[];n<e.rows.length;n++)e.rows[n].unreadGroupMessages=0,c.groups[e.rows[n].id]=e.rows[n],t.push(r.chatGroup.getUnread({id:e.rows[n].id}).$promise);return o.all(t)}).then(function(e){for(var n=0;n<e.length;n++)c.groups[e[n].id].unreadGroupMessages+=e[n].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,n){s.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return i.hasRole("admin")?r.user.get({role:"agent"}).$promise:r.userProfile.getResources({id:i.getCurrentUser().userProfileId,section:"Agents",role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,n){var t=s.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){s.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var n=[];a.messages=e.rows,a.messages.unshift(i);for(var t=0;t<a.messages.length;t++)n.push(r.user.get({id:a.messages[t].ToId,fields:"id,name,fullname,userpic"}).$promise);return o.all(n)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(n){c.group={id:n.id,write:n.write,messages:{}},r.chatGroup.getMembers({id:n.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:n.id,nolimit:!0}).$promise}).then(function(e){for(var n,t=0,a=[];t<e.count;t++)e.rows[t].ToId===c.currentUser.id&&(n=e.rows[t],c.group.messages[n.id]=n,e.rows[t].ToId!=c.currentUser.id||e.rows[t].FromId===c.currentUser.id||n.read||a.push(r.chatInternalMessage.update({id:n.id,read:!0})));return o.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var t={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(t).$promise.then(function(e){t.read=!1,t.ChatInternalMessageId=e.id;for(var n=0;n<c.group.members.length;n++)c.group.members[n].id!==c.currentUser.id&&(t.ToId=c.group.members[n].id,a.push(r.chatGroup.addMessage(angular.copy(t)).$promise));return o.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(n){if(!c.group&&n.ToId===c.currentUser.id&&n.FromId!==c.currentUser.id&&!n.read&&n.ChatGroupId){var e=c.groups[n.ChatGroupId];if(!e)return r.chatGroup.get({id:n.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&n.ChatGroupId===c.group.id&&n.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:n.id,read:!0}).$promise.then(function(){var e;e=n,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),n("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.form={token:s.token},o.setting={},o.resetPassword=function(){return i.auth.reset(o.form).$promise.then(function(){n.success({title:t.instant("RESETPASSWORD.PASSWORD_RESET"),msg:t.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&n.error({title:t.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){o.setting=e,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:""}).catch(function(e){e&&n.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){u()}function u(){s.user.get({id:c.user.id}).$promise.then(function(e){c.user.permissions=e.permissions,c.items=[{font_icon:"icon-hangouts",class:"green-700-fg",label:"chat",title:"TOOLBAR.CHAT",value:"chat",permission:r.chat&&(p(105)||e.chatAutoanswer),enabled:e.chatAutoanswer,delay:e.chatAutoanswerDelay},{font_icon:"icon-email",class:"teal-fg",label:"email",title:"TOOLBAR.EMAIL",value:"email",permission:r.mail&&(p(106)||e.emailAutoanswer),enabled:e.emailAutoanswer,delay:e.emailAutoanswerDelay},{font_icon:"icon-message-text",class:"orange-fg",label:"sms",title:"TOOLBAR.SMS",value:"sms",permission:r.messaging&&(p(107)||e.smsAutoanswer),enabled:e.smsAutoanswer,delay:e.smsAutoanswerDelay},{font_icon:"icon-google-earth",class:"amber-fg",label:"openchannel",title:"TOOLBAR.OPENCHANNEL",value:"openchannel",permission:r.openchannel&&(p(108)||e.openchannelAutoanswer),enabled:e.openchannelAutoanswer,delay:e.openchannelAutoanswerDelay},{font_icon:"icon-deskphone",class:"grey-A200-fg",label:"fax",title:"TOOLBAR.FAX",value:"fax",permission:r.fax&&(p(109)||e.faxAutoanswer),enabled:e.faxAutoanswer,delay:e.faxAutoanswerDelay},{font_icon:"icon-whatsapp",class:"lime-A700-fg",label:"whatsapp",title:"TOOLBAR.WHATSAPP",value:"whatsapp",permission:r.whatsapp&&(p(114)||e.whatsappAutoanswer),enabled:e.whatsappAutoanswer,delay:e.whatsappAutoanswerDelay}]})}function p(e){return _.includes(c.user.permissions,e)}c.items=[],c.closeDialog=function(){a.hide()},c.user=d.getCurrentUser(),u(),o.connect(),o.on("userNotification:recalc:"+c.user.id,m)}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","socket","license","user","Auth"],angular.module("app.toolbar").controller("AutoAnswerNotificationsDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.errors=[],r.user=i,r.setting=s,r.reset=o,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.savePassword=function(){r.errors=[],a.user.changePassword({id:r.user.id},{oldPassword:r.oldPassword,newPassword:r.password}).$promise.then(function(){n.show(n.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),l()}).catch(function(e){console.error(e),r.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.changePasswordForm.password.$setValidity("oldPasswordMatch",!1):t.changePasswordForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o){var r=this;function l(e,n){var t={id:e.id};n?t.recallmeNotifiedDate=null:r.isRecallNotification?t.recallmeNotifiedDate=null:e.recallme||(t.UserId=null),i.cmHopper.update(t)}function d(e){var n=!1;_.isNil(e)||(n=e),l(r.preview,n),t.hide()}function c(e){return i.cmContact.getAdditionalPhones({id:e}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");r.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");r.additionalItems=[];for(var s=0;s<n.length;s++)r.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})})}r.customFieldsMap=s&&s.rows?_.mapValues(_.keyBy(s.rows,function(e){return"cf_"+e.id}),"name"):{},r.errors=[],r.hopperIds=[],r.additionalItems=[],r.preview=n,r.isRecallNotification=o,r.originated=!1,r.disable=!1,r.disableGetContact=!1,r.hopperIds.push(r.preview.id),r.originatePreview=function(){r.originated=!0,r.disable=!0,_.isEmpty(r.preview)?(a.error({title:"Message",msg:"Contact not available"}),r.disable=!1,r.hopperIds=[],d(!0)):i.rpc.getVoiceQueuesPreview({id:r.preview.id}).$promise.then(function(){d(!0)}).catch(function(e){a.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){r.disable=!1,r.hopperIds=[]})},r.closeDialog=d,r.nextContact=function(){return r.disableGetContact=!0,i.cmHopper.getPreview({hopperIds:r.hopperIds,direction:"next"}).$promise.then(function(e){r.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(r.hopperIds=[],t.hide(),a.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(c(e.Contact.id),r.originated||i.cmHopper.update({id:r.preview.id,UserId:null}),r.preview=e,r.hopperIds.push(r.preview.id))}).catch(function(e){if(r.disableGetContact=!1,r.hopperIds=[],404===e.status)r.getFirstAvailableContact();else if(e.data&&e.data.errors&&e.data.errors.length){t.hide();for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.hide(),a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.previousContact=function(){if(r.disableGetContact=!0,1<r.hopperIds.length){var e=_.without(r.hopperIds,r.preview.id);return i.cmHopper.getPreview({hopperIds:e,direction:"prev"}).$promise.then(function(e){r.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(r.hopperIds=[],t.hide(),a.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(c(e.Contact.id),_.remove(r.hopperIds,function(e){return e==r.preview.id}),r.originated||i.cmHopper.update({id:r.preview.id,UserId:null}),r.preview=e)}).catch(function(e){if(404===e.status)r.hopperIds=[r.preview.id],a.info({title:"PREVIEW",msg:"PREVIOUS CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){r.hopperIds=[],t.hide();for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.hopperIds=[],t.hide(),a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}},r.getFirstAvailableContact=function(){return r.disableGetContact=!0,a.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE. REWINDING THE LIST"}),i.cmHopper.getPreview({hopperIds:[r.preview.id],direction:"next"}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(t.hide(),a.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(c(e.Contact.id),r.originated||i.cmHopper.update({id:r.preview.id,UserId:null}),r.preview=e,r.hopperIds.push(r.preview.id))}).catch(function(e){if(t.hide(),404===e.status)a.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){r.disableGetContact=!1})},r.isCustomField=function(e){return _.startsWith(e,"cf_")},r.isHiddenField=function(e){return _.includes(["Company","CompanyId","ListId","UserId","createdAt","deletedAt","id","dialTimezone","utcOffset","AdditionalPhones","additionalPhones","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},r.isNil=function(e){return _.isNil(e)},_.isNil(r.preview)||c(r.preview.Contact.id),e.$on("$destroy",function(){r.originated||l(r.preview,!1)})}e.$inject=["$scope","$mdDialog","toasty","api","preview","customFields","isRecallNotification"],angular.module("app.toolbar").controller("PreviewDialogController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(n,t,s,a,o,e,i,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S){var T,I=this;I.voiceQueues=[],I.polling=!0,t.global={search:""},I.pauses=[],I.license=b,I.currentUser=v.getCurrentUser(),I.unreadTotalMessages=0,I.unreadTotalGroupMessages=0,I.contacts=0,"agent"===I.currentUser.role&&(T=E(function(){_.some(I.voiceQueues,{dialMethod:"preview",dialActive:!0})&&I.license.dialer&&I.polling?(I.polling=!1,f.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(I.contacts=e.contacts)}).finally(function(){I.polling=!0})):I.contacts=0},14999)),I.setting=A,I.bodyEl=angular.element("body"),I.conf={realm:"asterisk",host:e.host(),protocol:e.protocol(),soundPlayerId:"local-audio",remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:I.license.webrtc,phoneBarExpires:I.currentUser.phoneBarExpires,phoneBarPrefixRequired:I.currentUser.phoneBarPrefixRequired,wssPort:I.currentUser.wssPort},I.webRTCSessions=[],I.autoanswerIconColor="green-700-fg",I.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],I.languages={ar:{title:"Arabic",translation:"TOOLBAR.ARABIC",code:"ar",flag:"ar"},bs:{title:"Bosnian",translation:"TOOLBAR.BOSNIAN",code:"bs",flag:"bs"},cs:{title:"Czech",translation:"TOOLBAR.CZECH",code:"cs",flag:"cs"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},et:{title:"Estonian",translation:"TOOLBAR.ESTONIAN",code:"et",flag:"et"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},he:{title:"Hebrew",translation:"TOOLBAR.HEBREW",code:"he",flag:"he"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},hu:{title:"Hungarian",translation:"TOOLBAR.HUNGARIAN",code:"hu",flag:"hu"},id:{title:"Indonesian",translation:"TOOLBAR.INDONESIAN",code:"id",flag:"id"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},"pt-BR":{title:"Brazilian",translation:"TOOLBAR.BRAZILIAN",code:"pt-BR",flag:"pt-BR"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"}},I.isWebRTCBarRegistered=!1;var O=["ar","fa","he"],C=S.getLogger("toolbar");function w(n){n.queuecallerleaveAt?I.waitingQueueCalls=_.filter(I.waitingQueueCalls,function(e){return e!==n.uniqueid}):I.waitingQueueCalls.push(n.uniqueid)}function R(e){w(e)}function x(e){"inbound"===e.type&&w(e)}function N(){h.connect(),h.on("user:update",H),h.on("user:called",V),h.on("chatInternalMessage:save",F),h.on("chatInternalMessage:update",$),h.on("userVoiceQueue:save",k),h.on("voiceQueue:save",L),h.on("userVoiceQueue:remove",k),h.on("voiceQueue:remove",L),h.on("voiceQueue:update",L),h.on("user:forcelogout",B),h.on("userNotification:send",Q),h.on("userNotification:recalc:"+I.user.id,j),h.onWithoutApply("voice_queue_channel:save",x),h.onWithoutApply("voice_queue_channel:remove",R)}function D(){h.disconnect("logout")}function P(){var e={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0};return f.user.getQueues(e).$promise.then(function(e){I.voiceQueues=e.rows})}function L(){P()}function k(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&P()}function M(e,n,t){n||(n=!1),t||(t={type:"click",target:"button.preview-button"}),c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:t,clickOutsideToClose:!0,locals:{preview:e,currentUser:I.currentUser,isRecallNotification:n},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})}function U(){return I.license.chat&&(I.hasPermission(105)||I.currentUser.chatAutoanswer)||I.license.mail&&I.hasPermission(106)||I.currentUser.emailAutoanswer||I.license.messaging&&I.hasPermission(107)||I.currentUser.smsAutoanswer||I.license.openchannel&&I.hasPermission(108)||I.currentUser.openchannelAutoanswer||I.license.fax&&I.hasPermission(109)||I.currentUser.faxAutoanswer||I.license.whatsapp&&(I.hasPermission(114)||I.currentUser.whatsappAutoanswer)}function F(e){e.ToId!==I.currentUser.id||e.ChatGroupId||(I.unreadTotalMessages+=1),e.ToId===I.currentUser.id&&e.FromId!==I.currentUser.id&&!e.read&&e.ChatGroupId&&I.unreadTotalGroupMessages++}function $(e){e.ToId===I.currentUser.id&&e.read&&0<I.unreadTotalMessages&&!e.ChatGroupId&&(I.unreadTotalMessages-=1),e.ToId===I.currentUser.id&&e.read&&e.ChatGroupId&&0<I.unreadTotalGroupMessages&&I.unreadTotalGroupMessages--}function q(e){return D(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(e)}).then(function(){return t.$broadcast("webrtc::logout"),a.go("app.login")}).catch(function(e){C.error(e)})}function G(e,n){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!n,escapeToClose:!n,locals:{user:I.user,setting:A,reset:n}})}function H(e){if(e.id===I.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==I.user.showWebBar){var n;D();var t=c.confirm({title:r.instant("TOOLBAR.WARNING")+"!",htmlContent:"<span>"+r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")+"</span><br><span>"+r.instant("TOOLBAR.SESSION_TIMEOUT")+"</span>",ariaLabel:r.instant("TOOLBAR.WARNING")+"!",ok:r.instant("TOOLBAR.STAY_LOGGED"),cancel:r.instant("TOOLBAR.LOGOUT"),onComplete:function(){n=setTimeout(function(){c.cancel()},6e4)}});c.show(t).then(function(){return clearTimeout(n),v.queueLogin().then(function(){N(),_.merge(I.user,e),v.setCurrentUser(I.user)})}).catch(function(){clearTimeout(n),q(!0)})}else q(!0);else _.merge(I.user,e),v.setCurrentUser(I.user)}function V(e){if(I.isWebRTCBarRegistered&&2===I.currentUser.showWebBar&&"agent"===I.currentUser.role){var n=I.currentUser.privacyEnabled?y.mask(e.calleridnum):e.calleridnum;p.info({title:"WebRTC Popup",msg:"<div> <span>Call from: "+n+"</span><br> <span>Queue: "+e.queue+"</span><br> <span>Extra: "+(e.variables.extravar?e.variables.extravar:"Not defined")+"</span><br> </div>",showClose:!0,timeout:1e4,html:!0})}}function B(e){if(C.debug("onForceLogout -> data",e),e.user.id===I.user.id&&0!==I.user.showWebBar)return D(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(!0)}).then(function(){t.$broadcast("webrtc::logout"),c.show(c.alert().parent(angular.element(m.body)).clickOutsideToClose(!1).escapeToClose(!1).title(r.instant("TOOLBAR.WARNING")).textContent(r.instant("TOOLBAR.USER_FORCE_LOGOUT",{ip:e.ip})).ok("OK")).then(function(){return a.go("app.login")})}).catch(function(e){C.error(e)})}function Q(e){var n=e;if(I.currentUser.id===n.recipient){var t=r.instant("TOOLBAR.NOTIFICATION_TITLE",{sender:n.sender}),a=n.description?r.instant("TOOLBAR.NOTIFICATION_TITLE_RECIPIENT",{recipient:n.description}):null;p.wait({title:a?t+" "+a:t,msg:n.content,clickToClose:!1,timeout:!1,sound:n.beep,html:!0})}}function W(){I.autoanswerIconColor=U()?"green-700-fg":"gray-700-fg"}function j(e){e&&e.permissions&&(I.currentUser.permissions=e.permissions,W())}I.toggleSidenav=function(e){i(e).toggle()},I.logout=q,I.changeLanguage=function(e){if(!I.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}I.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===a.current.name&&d.location.reload();0<=O.indexOf(e.code)?p.info({title:r.instant("TOOLBAR.CHANGE_LANGUAGE_TITLE"),msg:r.instant("TOOLBAR.CHANGE_LANGUAGE_MESSAGE")}):n.$parent.$parent.vm.direction="ltr"},I.setUserStatus=function(e){I.userStatus=e},I.toggleHorizontalMobileMenu=function(){I.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},I.toggleMsNavigationFolded=function(){g.toggleFolded()},I.search=function(n){for(var e=[],t=g.getFlatNavigation(),a=s.defer(),i=0;i<t.length;i++)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},I.searchResultClick=function(e){e.uisref&&(e.stateParams?a.go(e.state,e.stateParams):a.go(e.state))},I.openSettings=function(){t.$broadcast("webrtc::settings")},I.changePassword=G,I.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},I.pause=function(e){var n=e||"DEFAULT PAUSE";_.some(I.webRTCSessions,["confirmed",!0])&&(n="#"+n);return f.user.pause({id:I.user.id,type:n}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.unpause=function(){return f.user.unpause({id:I.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.preview=function(n){return I.disable=!0,f.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):M(e,!1,n)}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){I.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){I.disable=!1})},I.autoAnswerNotificationsDialog=function(e){U()?c.show({controller:"AutoAnswerNotificationsDialogController",controllerAs:"vm",templateUrl:"app/toolbar/autoanswers/dialog.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:I.license,user:I.currentUser}}):alert(r.instant("TOOLBAR.NO_AUTOANSWER_CONFIGURED"))},I.getLogo=function(){return I.setting.defaultHeaderWhiteLabel?"xCALLY Motion":I.setting.headerWhiteLabel},I.userIsNotPhonebar=function(){return"admin"===I.currentUser.role||"user"===I.currentUser.role||"agent"===I.currentUser.role&&0!==I.currentUser.showWebBar},I.hasPermission=function(e){return _.includes(I.currentUser.permissions,e)},I.waitingQueueCalls=[],function(){I.user=v.getCurrentUser(),P().then(function(){return f.rpc.getVoiceQueuesChannels().$promise}).then(function(e){e.rows.forEach(function(n){if("inbound"===n.type&&!n.queuecallerleaveAt){var e=_.find(I.voiceQueues,function(e){return e.name===n.queue});e&&I.waitingQueueCalls.push(n.uniqueid)}})}),I.conf.ha1=I.user.md5secret,I.conf.id=I.user.id,I.conf.name=I.user.name,I.conf.fullname=I.user.fullname,I.conf.internal=I.user.internal,I.conf.recording=I.user.phoneBarEnableRecording,I.conf.autoAnswer=I.user.phoneBarAutoAnswer,I.conf.enableSettings=I.user.phoneBarEnableSettings,I.conf.enableDtmfTone=I.user.phoneBarEnableDtmfTone,I.conf.autoAnswerDelay=I.user.phoneBarAutoAnswerDelay,I.userStatus=I.userStatusOptions[0];var e=u.get("motion.language");e&&I.languages.hasOwnProperty(e)?I.selectedLanguage=I.languages[e]:I.selectedLanguage=I.languages[r.preferredLanguage()];if(f.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){I.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),"LOCAL_LOGIN"==v.getAuthenticationType()&&I.setting.securePassword)if(I.user.passwordResetAt){var n=moment(I.user.passwordResetAt).add(I.setting.passwordExpiresDays||90,"day");moment().isAfter(n)?G(null,!0):moment().add(15,"day").isAfter(n)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(n.diff(moment(),"days",!0)),timeout:2e4})}else G(null,!0);W()}(),N(),I.openPreviewDialog=M,f.chatInternalMessage.get({fields:"FromId",ToId:I.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){I.unreadTotalMessages=e.rows.length}),n.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),h.removeAllListeners("user:forcelogout"),h.removeAllListeners("userNotification:send"),h.removeAllListeners("userNotification:recalc:"+I.user.id),T&&(E.cancel(T),T=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval","privacyManager","ClientSideLoggingService"],angular.module("app.toolbar").controller("ToolbarController",e)}(),function(){"use strict";function e(a,i,t,s,e){var n={updateUserSettingById:function(e,n){if("number"==typeof e)return i.userSetting.update({id:e},n).$promise;throw new Error("User setting id is missing")}},o=!1,r=a.getCurrentUser(),l=r?r.userSetting:null,d=function(e){var n="user-setting:update:user-"+e;t.$on("local:user-updated",c),s.on(n,c)};function c(){return o?e(function(e){e(l)}):(o=!0,function(e){var n=a.getCurrentUser(),t=null;t="admin"===n.role&&"number"==typeof e?i.user.get({id:e,userSetting:!0}).$promise:i.user.whoami({userSetting:!0}).$promise;return t.then(function(e){return a.setCurrentUser(e),e.userSetting})}().then(function(e){l=e,t.$emit("local:user-setting-updated",l)}).finally(function(){o=!1}))}return r&&d(r.id),t.$on("local:user-login",d),t.$on("local:user-logout",function(e){var n="user-setting:update:user-"+e;s.removeListener(n,c),l=null}),n}e.$inject=["Auth","api","$rootScope","socket","$q"],angular.module("app.user-setting").service("UserSettingService",e)}();var urlParams=function(e){var n=new Object,t=e.lastIndexOf("?");if(0<t)for(var a=e.substring(t+1).split("&"),i=0;i<a.length;i++)0<(t=a[i].indexOf("="))&&(n[a[i].substring(0,t)]=a[i].substring(t+1));return n}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",CRUD_PERMISSIONS={readOnly:!1,canEdit:!1,canDelete:!1},tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-BR","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,n,t){if(t=t||document,mxClient.IS_IE6)t.write('<link rel="'+e+'" href="'+n+'" charset="ISO-8859-1" type="text/css"/>');else{var a=t.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",n),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),t.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,n=document.createElement("table");n.setAttribute("width","100%"),n.setAttribute("height","100%");var t=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),t.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),t.appendChild(a),n.appendChild(t),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=t=0,a="number"==typeof window.innerWidth?(t=window.innerHeight,window.innerWidth):(t=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(e,n,Math.max(0,a-320),Math.max(0,t-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var s=mxLog.window.getElement();e=function(e,n){mxLog.textarea.style.height=Math.max(0,s.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,n){var t=document.createElement("button");mxUtils.write(t,e),mxEvent.addListener(t,"click",n),mxLog.td.appendChild(t)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,n){if(mxLog.TRACE){var t=0!=n?" ("+((new Date).getTime()-n)+" ms)":"";mxLog.writeln("Leaving "+e+t)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var n=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=n+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,n){var t=mxObjectIdentity.get(e),a=this.map[t];return this.map[t]=n,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var n=this.map[e];return delete this.map[e],n},mxDictionary.prototype.getKeys=function(){var e,n=[];for(e in this.map)n.push(e);return n},mxDictionary.prototype.getValues=function(){var e,n=[];for(e in this.map)n.push(this.map[e]);return n},mxDictionary.prototype.visit=function(e){for(var n in this.map)e(n,this.map[n])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,n){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(n)?e+mxResources.extension:null},getSpecialBundle:function(e,n){if(null==mxClient.languages||!this.isLanguageSupported(n)){var t=n.indexOf("-");0<t&&(n=n.substring(0,t))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(n)&&n!=mxClient.defaultLanguage?e+"_"+n+mxResources.extension:null},add:function(e,n){if((n=null!=n?n:mxClient.language)!=mxConstants.NONE){var t=mxResources.getDefaultBundle(e,n);if(null!=t)try{var a=mxUtils.load(t);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(t=mxResources.getSpecialBundle(e,n)))try{(a=mxUtils.load(t)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var t=e[n].indexOf("=");if(0<t){var a=e[n].substring(0,t),i=e[n].length;13==e[n].charCodeAt(i-1)&&i--,t=e[n].substring(t+1,i),this.resourcesEncoded?(t=t.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(t)):mxResources.resources[a]=t}}}},get:function(e,n,t){if(null==(e=mxResources.resources[e])&&(e=t),null!=e&&null!=n){t=[];for(var a=null,i=0;i<e.length;i++){var s=e.charAt(i);"{"==s?a="":null!=a&&"}"==s?(0<=(a=parseInt(a)-1)&&a<n.length&&t.push(n[a]),a=null):null!=a?a+=s:t.push(s)}e=t.join("")}return e}};function mxPoint(e,n){this.x=null!=e?e:0,this.y=null!=n?n:0}function mxRectangle(e,n,t,a){mxPoint.call(this,e,n),this.width=null!=t?t:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,n,t,a){this.x=e,this.y=n,this.width=t,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var n=Math.min(this.x,e.x),t=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=n,this.y=t,this.width=a-n,this.height=e-t}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,n=0;n<d.length;n++){var t=d[n];if(t instanceof mxGeometryChange||t instanceof mxTerminalChange||t instanceof mxValueChange||t instanceof mxChildChange||t instanceof mxStyleChange){var a=l.getView().getState(t.cell||t.child,!1);if(null!=a)if(e=!0,t.constructor!=mxGeometryChange||l.model.isEdge(t.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,s=(t.geometry.x-t.previous.x)*i,o=(t.geometry.y-t.previous.y)*i,r=(t.geometry.width-t.previous.width)*i;i=(t.geometry.height-t.previous.height)*i;0==m?(a.x-=s,a.y-=o,a.width-=r,a.height-=i):(a.x+=s/10,a.y+=o/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,t.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,n,t){for(var a=e.model.getChildCount(n),i=0;i<a;i++){var s=e.model.getChildAt(n,i),o=e.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,t),mxEffects.cascadeOpacity(e,s,t))}if(null!=(n=e.model.getEdges(n)))for(i=0;i<n.length;i++)null!=(a=e.getView().getState(n[i]))&&mxUtils.setOpacity(a.shape.node,t)},fadeOut:function(e,n,t,a,i,s){a=a||40,i=i||30;var o=n||100;if(mxUtils.setOpacity(e,o),s||null==s){var r=function(){o=Math.max(o-a,0),mxUtils.setOpacity(e,o),0<o?window.setTimeout(r,i):(e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var n=e.length,t=0;t<n;t+=1)mxUtils.removeCursors(e[t])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,n){return function(){return n.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,n,t){var a=e.getAttribute(n);if(null!=a&&a==t)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,n,t)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,n,t){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(n)==t)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,n,t),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,n,t){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+n+"='"+t+"']")}:function(e,n,t){return null==e?null:e.ownerDocument.evaluate("//*[@"+n+"='"+t+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var n=null;if(null!=e)if(null!=e.name)n=e.name;else{for(e=e.toString(),n=9;" "==e.charAt(n);)n++;var t=e.indexOf("(",n);n=e.substring(n,t)}return n},indexOf:function(e,n){if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n)return t;return-1},remove:function(e,n){var t=null;if("object"==typeof n)for(var a=mxUtils.indexOf(n,e);0<=a;)n.splice(a,1),t=e,a=mxUtils.indexOf(n,e);for(var i in n)n[i]==e&&(delete n[i],t=e);return t},isNode:function(e,n,t,a){return!(null==e||isNaN(e.nodeType)||null!=n&&e.nodeName.toLowerCase()!=n.toLowerCase())&&(null==t||e.getAttribute(t)==a)},getChildNodes:function(e,n){n=n||mxConstants.NODETYPE_ELEMENT;for(var t=[],a=e.firstChild;null!=a;)a.nodeType==n&&t.push(a),a=a.nextSibling;return t},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var n=mxUtils.createXmlDocument();return n.async="false",n.loadXML(e),n}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,n,t){var a=[];if(null!=e)if(n=n||" ",t=t||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(t+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++){var o=mxUtils.htmlEntities(i[s].nodeValue);a.push(" "+i[s].nodeName+'="'+o+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,n,t+n)),i=i.nextSibling;a.push(t+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,n){for(var t=n?e.previousSibling:e.nextSibling;null!=t&&t.nodeType==mxConstants.NODETYPE_TEXT;){var a=n?t.previousSibling:t.nextSibling,i=mxUtils.getTextContent(t);0==mxUtils.trim(i).length&&t.parentNode.removeChild(t),t=a}},htmlEntities:function(e,n){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&")).replace(/"/g,""")).replace(/\'/g,"'")).replace(/</g,"<")).replace(/>/g,">"),(null==n||n)&&(e=e.replace(/\n/g,"
")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,n){var t="";return null!=e&&(t=null==(t=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):t.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),t.replace(/\n/g,n||"
")},getTextContent:function(e){var n="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),n=e.nodeValue||""),n},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null==e)return"";if(null!=e.outerHTML)return e.outerHTML;var n=[];n.push("<"+e.nodeName);var t=e.attributes;if(null!=t)for(var a=0;a<t.length;a++){var i=t[a].nodeValue;null!=i&&0<i.length&&(n.push(" "),n.push(t[a].nodeName),n.push('="'),n.push(i),n.push('"'))}return 0==e.innerHTML.length?n.push("/>"):(n.push(">"),n.push(e.innerHTML),n.push("</"+e.nodeName+">")),n.join("")}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&e.appendChild(t),t},writeln:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&(e.appendChild(t),e.appendChild(document.createElement("br"))),t},br:function(e,n){n=n||1;for(var t=null,a=0;a<n;a++)null!=e&&(t=e.ownerDocument.createElement("br"),e.appendChild(t));return t},button:function(e,n,t){return t=(t=null!=t?t:document).createElement("button"),mxUtils.write(t,e),mxEvent.addListener(t,"click",function(e){n(e)}),t},para:function(e,n){var t=document.createElement("p");return mxUtils.write(t,n),null!=e&&e.appendChild(t),t},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,n,t,a,i){return mxUtils.link(e,n,function(){t.execute(a)},i)},linkInvoke:function(e,n,t,a,i,s){return mxUtils.link(e,n,function(){t[a](i)},s)},link:function(e,n,t,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",t),mxUtils.write(i,n),null!=e&&e.appendChild(i),i},fit:function(e){var n=parseInt(e.offsetLeft),t=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,s=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);s<n+t&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,s-t)+"px"),n=parseInt(e.offsetTop),t=parseInt(e.offsetHeight),(s=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<n+t&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,s-t)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return n.initWithPath(e),n.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(n,1,4,null),(n=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),n.read(n.available())):(mxUtils.alert("File not found."),"")}return e=(n=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),n.close(),e},save:function(e,n){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);t.initWithPath(e),t.exists()||t.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(t,34,4,null),a.write(n,n.length),a.flush(),a.close()}else(t=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(n),t.Close()},saveAs:function(e){var n=document.createElement("iframe");n.setAttribute("src",""),n.style.visibility="hidden",document.body.appendChild(n);try{if(mxClient.IS_NS){var t=n.contentDocument;t.open(),t.write(e),t.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),n.focus(),saveDocument(t)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(t=n.contentWindow.document).write(e),t.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(n)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var n=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(n){var t=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(t){t.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,t.setTransferData("text/unicode",a,2*e.length),n.setData(t,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,n,t){return new mxXmlRequest(e,null,"GET").send(n,t)},post:function(e,n,t,a){return new mxXmlRequest(e,n).send(t,a)},submit:function(e,n,t,a){return new mxXmlRequest(e,n).simulate(t,a)},loadInto:function(e,n,t){mxClient.IS_IE?n.onreadystatechange=function(){4==n.readyState&&t()}:n.addEventListener("load",t,!1),n.load(e)},getValue:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t),e},getNumber:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t||0),Number(e)},getColor:function(e,n,t){return null==(e=null!=e?e[n]:null)?e=t:e==mxConstants.NONE&&(e=null),e},clone:function(e,n,t){t=null!=t&&t;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==n||mxUtils.indexOf(n,i)<0)&&(a[i]=t||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n[t]||null!=e[t]&&!e[t].equals(n[t]))return!1;return!0},equalEntries:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t in e)if(e[t]!=n[t])return!1;return!0},extend:function(e,n){var t=function(){};t.prototype=n.prototype,e.prototype=new t,e.prototype.constructor=e},toString:function(e){var n,t="";for(n in e)try{if(null==e[n])t+=n+" = [null]\n";else if("function"==typeof e[n])t+=n+" => [Function]\n";else if("object"==typeof e[n])t=t+(n+" => [")+mxUtils.getFunctionName(e[n].constructor)+"]\n";else t+=n+" = "+e[n]+"\n"}catch(e){t+=n+"="+e.message}return t},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,n,t,a,i,s,o,r,l){if(r-=e,l-=n,0===t||0===a)return h;t=Math.abs(t),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;r=m*(c=(s=1<(v=(c=i*i)/(g=t*t)+(p=d*d)/(A=a*a))?(t*=Math.sqrt(v),a*=Math.sqrt(v),0):(v=1,s===o&&(v=-1),v*Math.sqrt((g*A-g*p-A*c)/(g*p+A*c))))*t*d/a)-h*(p=-1*s*a*i/t)+r/2,l=h*c+m*p+l/2,s=0<=(g=Math.atan2((d-p)/a,(i-c)/t)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/t)-Math.atan2((d-p)/a,(i-c)/t))?g:2*Math.PI+g,0==o&&0<i?i-=2*Math.PI:0!=o&&i<0&&(i+=2*Math.PI),o=2*i/Math.PI,i/=o=Math.ceil(o<0?-1*o:o),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*t,m*=a,t*=h,a*=h;for(var u=Math.cos(s),p=-d*(c*(b=Math.sin(s))+a*u),g=-d*(t*b-m*u),v=A=0,h=[],f=0;f<o;++f){s+=i;var b,A=c*(u=Math.cos(s))-a*(b=Math.sin(s))+r,E=(v=t*u+m*b+l,-d*(c*b+a*u));u=-d*(t*b-m*u);h[b=6*f]=Number(p+e),h[b+1]=Number(g+n),h[b+2]=Number(A-E+e),h[b+3]=Number(v-u+n),h[b+4]=Number(A+e),h[b+5]=Number(v+n),p=A+E,g=v+u}return h},getBoundingBox:function(e,n){var t=null;if(null!=e&&null!=n&&0!=n){var a=mxUtils.toRadians(n),i=(t=Math.cos(a),Math.sin(a)),s=new mxPoint(e.x+e.width/2,e.y+e.height/2),o=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);o=mxUtils.getRotatedPoint(o,t,i,s),a=mxUtils.getRotatedPoint(a,t,i,s),r=mxUtils.getRotatedPoint(r,t,i,s),l=mxUtils.getRotatedPoint(l,t,i,s);(t=new mxRectangle(o.x,o.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),t.add(new mxRectangle(r.x,r.y,0,0)),t.add(new mxRectangle(l.x,l.y,0,0))}return t},getRotatedPoint:function(e,n,t,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*n-(e=e.y-a.y)*t+a.x,e*n+i*t+a.y)},getPortConstraints:function(e,n,t,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,n,t){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],s=null,o=1;o<e.absolutePoints.length;o++){var r=e.absolutePoints[o];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,n,t);(null==s||i<s)&&(s=i,a=o-1),i=r}return a},rectangleIntersectsSegment:function(e,n,t){var a=e.y,i=e.x,s=a+e.height,o=i+e.width;e=n.x;var r=t.x;if(n.x>t.x&&(e=t.x,r=n.x),o<r&&(r=o),e<i&&(e=i),r<e)return!1;i=n.y,o=t.y;var l=t.x-n.x;return 1e-7<Math.abs(l)&&(i=(t=(t.y-n.y)/l)*e+(n=n.y-t*n.x),o=t*r+n),o<i&&(n=o,o=i,i=n),s<o&&(o=s),i<a&&(i=a),!(o<i)},contains:function(e,n,t){return e.x<=n&&e.x+e.width>=n&&e.y<=t&&e.y+e.height>=t},intersects:function(e,n){var t=e.width,a=e.height,i=n.width,s=n.height;if(i<=0||s<=0||t<=0||a<=0)return!1;var o=e.x,r=e.y,l=n.x,d=n.y;s+=d,t+=o,a+=r;return((i=i+l)<l||o<i)&&(s<d||r<s)&&(t<o||l<t)&&(a<r||d<a)},intersectsHotspot:function(e,n,t,a,i,s){if(i=null!=i?i:0,s=null!=s?s:0,0<(a=null!=a?a:1)){var o=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(o=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<s&&(l=Math.min(l,s),d=Math.min(d,s)),a=new mxRectangle(o-l/2,r-d/2,l,d),0!=(o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-o),s=Math.sin(-o),o=new mxPoint(e.getCenterX(),e.getCenterY()),n=(e=mxUtils.getRotatedPoint(new mxPoint(n,t),i,s,o)).x,t=e.y),mxUtils.contains(a,n,t)}return!0},getOffset:function(e,n){var t=0,a=0;if(null!=n&&n){var i=document.body,s=document.documentElement;t=t+(i.scrollLeft||s.scrollLeft),a=a+(i.scrollTop||s.scrollTop)}for(;e.offsetParent;)t+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(t,a)},getScrollOrigin:function(e){for(var n=document.body,t=document.documentElement,a=new mxPoint(n.scrollLeft||t.scrollLeft,n.scrollTop||t.scrollTop);null!=e&&e!=n&&e!=t;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,n,t){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(n-e.x,t-e.y)},ltrim:function(e,n){return e.replace(RegExp("^["+(n||"\\s")+"]+","g"),"")},rtrim:function(e,n){return e.replace(RegExp("["+(n||"\\s")+"]+$","g"),"")},trim:function(e,n){return mxUtils.ltrim(mxUtils.rtrim(e,n),n)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,n){return(e%n+n)%n},intersection:function(e,n,t,a,i,s,o,r){var l=(r-s)*(t-e)-(o-i)*(a-n);return o=((o-i)*(n-s)-(r-s)*(e-i))/l,i=((t-e)*(n-s)-(a-n)*(e-i))/l,0<=o&&o<=1&&0<=i&&i<=1?new mxPoint(e+o*(t-e),n+o*(a-n)):null},ptSegDistSq:function(e,n,t,a,i,s){return t=(i-=e)*(t-=e)+(s-=n)*(a-=n)<=0?0:(e=(i=t-i)*t+(s=a-s)*a)<=0?0:e*e/(t*t+a*a),(i=i*i+s*s-t)<0&&(i=0),i},relativeCcw:function(e,n,t,a,i,s){return 0==(e=(i-=e)*(a-=n)-(s-=n)*(t-=e))&&(0<(e=i*t+s*a)&&((e=(i-t)*t+(s-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,n){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,n,t){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,n,t,a,i,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,n){mxUtils.isVml(e)?e.style.filter=100<=n?null:"alpha(opacity="+n/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=n?null:"alpha(opacity="+n+")":e.style.opacity=n/100},createImage:function(e){var n=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),n.style.borderStyle="none"):((n=document.createElement("img")).setAttribute("src",e),n.setAttribute("border","0")),n},sortCells:function(e,i){i=null==i||i;var s=new mxDictionary;return e.sort(function(e,n){var t=s.get(e);null==t&&(t=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),s.put(e,t));var a=s.get(n);return null==a&&(a=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),s.put(n,a)),0==(t=mxCellPath.compare(t,a))?0:0<t==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)e[t].indexOf("=")<0&&n.push(e[t])}return n},indexOfStylename:function(e,n){if(null!=e&&null!=n)for(var t=e.split(";"),a=0,i=0;i<t.length;i++){if(t[i]==n)return a;a+=t[i].length+1}return-1},addStylename:function(e,n){return mxUtils.indexOfStylename(e,n)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=n),e},removeStylename:function(e,n){var t=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=n&&t.push(a[i]);return t.join(";")},removeAllStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)0<=e[t].indexOf("=")&&n.push(e[t])}return n.join(";")},setCellStyles:function(e,n,t,a){if(null!=n&&0<n.length){e.beginUpdate();try{for(var i=0;i<n.length;i++)if(null!=n[i]){var s=mxUtils.setStyle(e.getStyle(n[i]),t,a);e.setStyle(n[i],s)}}finally{e.endUpdate()}}},setStyle:function(e,n,t){var a=null!=t&&(void 0===t.length||0<t.length);if(null==e||0==e.length)a&&(e=n+"="+t);else{var i=e.indexOf(n+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+n+"="+t):(n=a?n+"="+t:"",t=e.indexOf(";",i),a||t++,e=e.substring(0,i)+n+(i<t?e.substring(t):""))}return e},setCellStyleFlags:function(e,n,t,a,i){if(null!=n&&0<n.length){e.beginUpdate();try{for(var s=0;s<n.length;s++)if(null!=n[s]){var o=mxUtils.setStyleFlag(e.getStyle(n[s]),t,a,i);e.setStyle(n[s],o)}}finally{e.endUpdate()}}},setStyleFlag:function(e,n,t,a){if(null==e||0==e.length)e=a||null==a?n+"="+t:n+"=0";else{var i=e.indexOf(n+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+n+"="+t:e+i+n+"=0";else{var s=e.indexOf(";",i),o="";o=s<0?e.substring(i+n.length+1):e.substring(i+n.length+1,s),o=null==a?parseInt(o)^t:a?parseInt(o)|t:parseInt(o)&~t;e=e.substring(0,i)+n+"="+o+(0<=s?e.substring(s):"")}}return e},getAlignmentAsPoint:function(e,n){var t=0,a=0;return e==mxConstants.ALIGN_CENTER?t=-.5:e==mxConstants.ALIGN_RIGHT&&(t=-1),n==mxConstants.ALIGN_MIDDLE?a=-.5:n==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(t,a)},getSizeForString:function(e,n,t){n=null!=n?n:mxConstants.DEFAULT_FONTSIZE,t=null!=t?t:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=t,a.style.fontSize=Math.round(n)+"px",a.style.lineHeight=Math.round(n*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,n,t,a,i){a=null!=a?a:0,i=null!=i?i:0,n=null!=n?n:1,null==t&&(t=[e.getModel().getRoot()]);var s=e.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var l=s.drawPane,d=s.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var c=s.getTranslate();s.translate=new mxPoint(a,i),n=new mxTemporaryCellStates(e.getView(),n,t);try{o=(new mxCodec).encode(e.getView())}finally{n.destroy(),s.translate=c,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=l,s.overlayPane=d,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(e,n,t,a){if(e<1)return 1;a=null!=a?a:0;var i=(t=null!=t?t:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;t=t.height-2*a,a=n.getGraphBounds().clone(),n=n.getView().getScale(),a.width/=n,a.height/=n,t=(n=a.width)/a.height/(i/t),a=Math.sqrt(e);var s=Math.sqrt(t);if(t=a*s,a/=s,t<1&&e<a){var o=a/e;a=e,t/=o}for(a<1&&e<t&&(o=t/e,t=e,a/=o),o=Math.ceil(t)*Math.ceil(a),s=0;e<o;){o=Math.floor(t)/t;var r=Math.floor(a)/a;if(1==o&&(o=Math.floor(t-1)/t),1==r&&(r=Math.floor(a-1)/a),t*=o=r<o?o:r,a*=o,o=Math.ceil(t)*Math.ceil(a),10<++s)break}return i*t/n*.99999},show:function(e,n,t,a){if(t=null!=t?t:0,a=null!=a?a:0,null==n?n=window.open().document:n.open(),t=-(i=e.getGraphBounds()).x+t,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",s=document.getElementsByTagName("base"),o=0;o<s.length;o++)i+=s[o].outerHTML;for(i+="<style>",o=0;o<document.styleSheets.length;o++)try{i+=document.styleSheets(o).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",n.writeln(i),n.close(),null!=(e=n.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=t+"px",e.style.top=a+"px")}else{for(n.writeln("<html"),n.writeln("<head>"),s=document.getElementsByTagName("base"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("link"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("style"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(n.writeln("</head>"),n.writeln("</html>"),n.close(),null==n.body&&n.documentElement.appendChild(n.createElement("body")),n.body.style.overflow="auto",e=e.container.firstChild;null!=e;)o=e.cloneNode(!0),n.body.appendChild(o),e=e.nextSibling;null!=(e=n.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+t+","+a+")"),(t=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),t.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(n.body),n},printScreen:function(e){var n=window.open();mxUtils.show(e,n.document),e=function(){n.focus(),n.print(),n.close()},mxClient.IS_GC?n.setTimeout(e,500):e()},popup:function(e,n){if(n){var t=document.createElement("div");t.style.overflow="scroll",t.style.width="636px",t.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),t.appendChild(a),(t=new mxWindow("Popup Window",t,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),t.setVisible(!0)}else mxClient.IS_NS?((t=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),t.document.close()):((a=(t=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),t.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,n){return prompt(e,n)},confirm:function(e){return confirm(e)},error:function(e,n,t,a){var i=document.createElement("div");i.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",a||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",i.appendChild(s),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-n)/2,a/4,n,null,!1,!0);return t&&(mxUtils.br(i),n=document.createElement("p"),t=document.createElement("button"),mxClient.IS_IE?t.style.cssText="float:right":t.setAttribute("style","float:right"),mxEvent.addListener(t,"click",function(e){o.destroy()}),mxUtils.write(t,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),n.appendChild(t),i.appendChild(n),mxUtils.br(i),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(e,n,t,i,a,s,o,r,l,d){return(e=new mxDragSource(e,t)).dragOffset=new mxPoint(null!=a?a:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=o,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof n?n(e):n},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var n=i.cloneNode(!0),t=parseInt(n.style.width),a=parseInt(n.style.height);return n.style.width=Math.round(t*e.view.scale)+"px",n.style.height=Math.round(a*e.view.scale)+"px",n})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var n=1;n<arguments.length;n+=2)null!=arguments[n+1]&&(this.properties[arguments[n]]=arguments[n+1])}function mxMouseEvent(e,n){this.evt=e,this.state=n}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var n=this.getSource();null!=n;){if(n==e.node)return!0;n=n.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,n){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(n)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var n=0;n<this.eventListeners.length;)this.eventListeners[n+1]==e?this.eventListeners.splice(n,2):n+=2},mxEventSource.prototype.fireEvent=function(e,n){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==n&&(n=this.getEventSource()),null==n&&(n=this);for(var t=[n,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,t)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,n,t){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:n,f:t})};return window.addEventListener?function(e,n,t){e.addEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.attachEvent("on"+n,t),a(e,n,t)}}(),removeListener:function(){var a=function(e,n,t){if(null!=e.mxListenerList){n=e.mxListenerList.length;for(var a=0;a<n;a++)if(e.mxListenerList[a].f==t){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,n,t){e.removeEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.detachEvent("on"+n,t),a(e,n,t)}}(),removeAllListeners:function(e){var n=e.mxListenerList;if(null!=n)for(;0<n.length;){var t=n[0];mxEvent.removeListener(e,t.name,t.f)}},addGestureListeners:function(e,n,t,a){null!=n&&mxEvent.addListener(e,"mousedown",n),null!=t&&mxEvent.addListener(e,"mousemove",t),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.addListener(e,"touchstart",n),null!=t&&mxEvent.addListener(e,"touchmove",t),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,n,t,a){null!=n&&mxEvent.removeListener(e,"mousedown",n),null!=t&&mxEvent.removeListener(e,"mousemove",t),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.removeListener(e,"touchstart",n),null!=t&&mxEvent.removeListener(e,"touchmove",t),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,t,n,a,i,s,o){var r=function(e){return"function"==typeof n?n(e):n};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=s?s(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=o)o(e);else if(!mxEvent.isConsumed(e)){var n=r(e);t.dblClick(e,null!=n?n.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var n=e.length,t=0;t<n;t+=1)mxEvent.release(e[t])},addMouseWheelListener:function(t){if(null!=t){var e=function(e){null==e&&(e=window.event);var n=0;0!=(n=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&t(e,0<n)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,n,t){t=null==t||t,(null==n||n)&&(e.preventDefault?(t&&e.stopPropagation(),e.preventDefault()):t&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,n,t,a,i,s){this.url=e,this.params=n,this.method=t||"POST",this.async=null==a||a,this.username=i,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,n){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,n){null!=n&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,n){var t=null;(e=e||document)==document&&(t=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=n&&a.setAttribute("target",n),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<i.length;s++){if(0<(o=i[s].indexOf("="))){var o,r=i[s].substring(0,o),l=i[s].substring(o+1);(o=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"
"),r=e.createTextNode(l),o.appendChild(r),a.appendChild(o)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=t&&(window.onbeforeunload=t)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,n){return n=mxClipboard.copy(e,n),mxClipboard.insertCount=0,mxClipboard.removeCells(e,n),n},removeCells:function(e,n){e.removeCells(n)},copy:function(e,n){n=n||e.getSelectionCells();var t=e.getExportableCells(n);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(t),t},paste:function(e){if(null!=mxClipboard.cells){var n=e.getImportableCells(mxClipboard.cells),t=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();n=e.importCells(n,t,t,a);mxClipboard.insertCount++,e.setSelectionCells(n)}}};function mxWindow(e,n,t,a,i,s,o,r,l,d){null!=n&&(o=null==o||o,this.content=n,this.init(t,a,i,s,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,n,t){this.src=e,this.width=n,this.height=t}function mxDivResizer(e,n){if("div"==e.nodeName.toLowerCase()){null==n&&(n=window),this.div=e;var t=mxUtils.getCurrentStyle(e);null!=t&&(this.resizeWidth="auto"==t.width,this.resizeHeight="auto"==t.height),mxEvent.addListener(n,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,n){this.element=e,this.dropHandler=n,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(n,e,t,a){this.model=n,this.urlInit=e,this.urlPoll=t,this.urlNotify=a,null!=n&&(this.codec=new mxCodec,this.codec.lookup=function(e){return n.getCell(e)}),n.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");(null!=t&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(t.changes,t.undone)+"</edit>")}))}function mxUndoableEdit(e,n){this.source=e,this.changes=[],this.significant=null==n||n}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,n,t,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=n+"px",this.table=document.createElement("table"),this.table.className=i,null!=t&&(mxClient.IS_IE||(this.div.style.width=t+"px"),this.table.style.width=t+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),n=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",n.appendChild(this.title),e.appendChild(n),n=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),n.appendChild(this.td),e.appendChild(n),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var n=this.title.firstChild;null!=n;){var t=n.nextSibling;n.nodeType==mxConstants.NODETYPE_TEXT&&n.parentNode.removeChild(n),n=t}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}n=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.div.offsetWidth,o=this.div.offsetHeight,n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setSize(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,n){e=Math.max(this.minimumSize.width,e),n=Math.max(this.minimumSize.height,n),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=n+"px"),this.table.style.width=e+"px",this.table.style.height=n+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var t=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var n=this.getMinimumSize();0<n.height&&(mxClient.IS_IE||(this.div.style.height=n.height+"px"),this.table.style.height=n.height+"px"),0<n.width&&(mxClient.IS_IE||(this.div.style.width=n.width+"px"),this.table.style.width=n.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var t=!1,a=null,i=null,s=null,o=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(t)t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=s,this.div.style.width=o,"auto"!=(n=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var n=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=n.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.getX(),o=this.getY(),n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setLocation(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,n){this.div.style.left=e+"px",this.div.style.top=n+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");t.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){n()}),t.appendChild(a),this.body.appendChild(t)},mxForm.prototype.addText=function(e,n){var t=document.createElement("input");return t.setAttribute("type","text"),t.value=n,this.addField(e,t)},mxForm.prototype.addCheckbox=function(e,n){var t=document.createElement("input");return t.setAttribute("type","checkbox"),this.addField(e,t),n&&(t.checked=!0),t},mxForm.prototype.addTextarea=function(e,n,t){var a=document.createElement("textarea");return mxClient.IS_NS&&t--,a.setAttribute("rows",t||2),a.value=n,this.addField(e,a)},mxForm.prototype.addCombo=function(e,n,t){var a=document.createElement("select");return null!=t&&a.setAttribute("size",t),n&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,n,t,a){var i=document.createElement("option");mxUtils.writeln(i,n),i.setAttribute("value",t),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),t.appendChild(a),(a=document.createElement("td")).appendChild(n),t.appendChild(a),this.body.appendChild(t),n},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),n=this.getDocumentHeight(),t=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(t)&&!isNaN(a)&&0<=t&&0<=a&&0<e-a-t&&(this.div.style.width=e-a-t+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(s)&&0<=i&&0<=s&&0<n-i-s&&(this.div.style.height=n-i-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,n,t){return e.getCellAt(n,t)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,n){var t=mxEvent.getClientX(n),a=mxEvent.getClientY(n),i=mxUtils.getOffset(e.container),s=mxUtils.getScrollOrigin();return t>=i.x-s.x&&a>=i.y-s.y&&t<=i.x-s.x+e.container.offsetWidth&&a<=i.y-s.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(n=this.getGraphForEvent(e))&&!this.graphContainsEvent(n,e)&&(n=null),n!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=n,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(e),t=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,t+=this.dragOffset.y),n+=document.body.scrollLeft||document.documentElement.scrollLeft,t+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=n+"px",this.dragElement.style.top=t+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var n=this.currentGraph.view.scale,t=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/n-t.x,this.currentPoint.y/n-t.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,n){var t=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(n)-t.x+a.x;t=mxEvent.getClientY(n)-t.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,t,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,t),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(n);var s=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(n))s=new mxRectangle(0,0,s=parseInt(this.previewElement.style.width),o=parseInt(this.previewElement.style.height)),t=new mxPoint(i,t),t=this.currentGuide.move(s,t,a),s=!1,i=t.x,t=t.y;else if(a){a=e.view.scale;var o=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-o.x-r)+o.x)*a,t=(e.snap(t/a-o.y-r)+o.y)*a}null!=this.currentGuide&&s&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,t+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(t)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,t)},mxDragSource.prototype.drop=function(e,n,t,a,i){this.dropHandler(e,n,t,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,n,t,a,i,s){var o=document.createElement(null!=n?"img":"button"),r=i||(null!=s?"mxToolbarMode":"mxToolbarItem");return o.className=r,o.setAttribute("src",n),null!=e&&(null!=n?o.setAttribute("title",e):mxUtils.write(o,e)),this.container.appendChild(o),null!=t&&(mxEvent.addListener(o,"click",t),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",t)),e=mxUtils.bind(this,function(e){null!=a?o.setAttribute("src",n):o.style.backgroundColor=""}),mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){if(null!=a?o.setAttribute("src",a):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var n=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),n!=o&&(this.currentImg=o,this.menu.factoryMethod=s,n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(n.x,n.y,null,e),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(o,"mouseout",e),o},mxToolbar.prototype.addCombo=function(e){var n=document.createElement("div");n.style.display="inline",n.className="mxToolbarComboContainer";var t=document.createElement("select");return t.className=e||"mxToolbarCombo",n.appendChild(t),this.container.appendChild(n),t},mxToolbar.prototype.addActionCombo=function(e,n){var t=document.createElement("select");return t.className=n||"mxToolbarCombo",this.addOption(t,e,null),mxEvent.addListener(t,"change",function(e){var n=t.options[t.selectedIndex];t.selectedIndex=0,null!=n.funct&&n.funct(e)}),this.container.appendChild(t),t},mxToolbar.prototype.addOption=function(e,n,t){var a=document.createElement("option");return mxUtils.writeln(a,n),"function"==typeof t?a.funct=t:a.setAttribute("value",t),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,n,t,a,i){var s=document.createElement("img");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",n),s.altIcon=a,null!=e&&s.setAttribute("title",e),mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),t()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),t()),s},mxToolbar.prototype.addMode=function(e,n,t,a,i,s){s=null==s||s;var o=document.createElement(null!=n?"img":"button");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",n),o.altIcon=a,null!=e&&o.setAttribute("title",e),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=t,this.selectMode(o,t))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(e,n){if(this.selectedMode!=e){if(null!=this.selectedMode){var t=this.selectedMode.altIcon;null!=t?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(t=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",n))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="
",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,n,t){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,n,t){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,n,t))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(t,a,n){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=n?n(e):this.stop(e)});mxUtils.get(t,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",t,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var n=e.getDocumentElement();null==n?i("Invalid response: "+e.getText()):this.receive(n)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,n){for(var t="",a=n?-1:1,i=n?e.length-1:0;0<=i&&i<e.length;i+=a){var s=this.codec.encode(e[i]);t=t+mxUtils.getXml(s,this.linefeed)}return t},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var n=e.getAttribute("namespace");for(null!=n&&(this.model.prefix=n+"-"),n=e.firstChild;null!=n;){var t=n.nodeName.toLowerCase();"state"==t?this.processState(n):"delta"==t&&this.processDelta(n),n=n.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var n=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",n))}},mxSession.prototype.createUndoableEdit=function(e){var n=new mxUndoableEdit(this.model,this.significantRemoteChanges);return n.changes=e,n.notify=function(){n.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",n.changes)),n.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",n,"changes",n.changes))},n},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var n=[];for(e=e.firstChild;null!=e;){var t=this.decodeChange(e);null!=t&&n.push(t),e=e.nextSibling}return n},mxSession.prototype.decodeChange=function(e){var n=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(n="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(n.model=this.model,n.execute(),"mxChildChange"==e.nodeName&&null==n.parent&&this.cellRemoved(n.child))),n},mxSession.prototype.cellRemoved=function(e,n){this.codec.putObject(e.getId(),e);for(var t=this.model.getChildCount(e),a=0;a<t;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var n=this.changes[e];null!=n.execute?n.execute():null!=n.undo&&n.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,n=0;n<e;n++){var t=this.changes[n];null!=t.execute?t.execute():null!=t.redo&&t.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var n=this.history[this.indexOfNextAdd++];if(n.redo(),n.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",n));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),n=0;n<e.length;n++)e[n].die()};var mxUrlConverter=function(e){var t=!0,a=null,i=null;return{isEnabled:function(){return t},setEnabled:function(e){t=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(t&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var n=(a=i+location.pathname).lastIndexOf("/");0<n&&(a=a.substring(0,n+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(s){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,n){},mouseMove:function(e,n){},mouseUp:mxUtils.bind(this,function(e,n){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-s.container.scrollLeft-Math.ceil(this.dx),n=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(e,n),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(e,n,t,a){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,a=null!=a?a:0;var i=s.container;this.dx=e+(null!=t?t:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=n+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=n-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=s.panDx,n=s.panDy;0==e&&0==n||(s.panGraph(0,0),s.view.setTranslate(this.t0x+e/s.view.scale,this.t0y+n/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.graphModelChanged(n.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,n,t,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=n?n:6,this.ease=null!=t?t:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,n){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=n&&n;var t=null;if(e.ownerDocument!=document)for(t=e;null!=t&&"svg"!=t.nodeName;)t=t.parentNode;null!=t&&(0<t.getElementsByTagName("defs").length&&(this.defs=t.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=t.firstChild?t.insertBefore(this.defs,t.firstChild):t.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var o=document.createElement("tr");o.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=n?((i=document.createElement("img")).src=n,r.appendChild(i)):null!=i&&((n=document.createElement("div")).className=i,r.appendChild(n)),o.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),mxUtils.write(r,e),r.align="left",o.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",o.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(o),(null==s||s)&&(mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){this.eventReceiver=o,a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),o.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==o&&(a.activeRow!=o&&this.hideMenu(),null!=t&&t(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(o,"mouseout",mxUtils.bind(this,function(e){o.className="mxPopupMenuItem"}))),o},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var n=document.createElement("img");n.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(n)},mxPopupMenu.prototype.showSubmenu=function(e,n){if(null!=n.div){n.div.style.left=e.div.offsetLeft+n.offsetLeft+n.offsetWidth-1+"px",n.div.style.top=e.div.offsetTop+n.offsetTop+"px",document.body.appendChild(n.div);var t=parseInt(n.div.offsetLeft),a=parseInt(n.div.offsetWidth),i=document.body,s=document.documentElement;t+a>(i.scrollLeft||s.scrollLeft)+(i.clientWidth||s.clientWidth)&&(n.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(n.div)}},mxPopupMenu.prototype.addSeparator=function(e,n){if(e=e||this,this.smartSeparators&&!n)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var t=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",t.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),t.appendChild(a),e.tbody.appendChild(t)}},mxPopupMenu.prototype.popup=function(e,n,t,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=n+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,t,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var n=0;n<this.cells.length;n++)this.animateCell(cells[n],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,n,t){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();i.x+=s.x*o,i.y+=s.y*o,n.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(t&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),n,t)},mxMorphing.prototype.stopRecursion=function(e,n){return null!=n&&(0!=n.x||0!=n.y)},mxMorphing.prototype.getDelta=function(e){var n=this.getOriginForCell(e.cell),t=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-t.x,e.y/a-t.y),new mxPoint((n.x-e.x)*a,(n.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var n=null;return null!=e&&(n=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(n.x+=e.x,n.y+=e.y)),null==n&&(n=new mxPoint(-(n=this.graph.view.getTranslate()).x,-n.y)),n},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,n,t){this.images[e]={value:n,fallback:t}},mxImageBundle.prototype.getImage=function(e){var n=null;return null!=e&&(null!=(e=this.images[e])&&(n=this.alt?e.fallback:e.value)),n},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,n){null!=e&&(this.visitStatesRecursive(e,n,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,n,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,n,t){if(null!=e){t(e,n);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),s=0;s<i;s++){var o=a.view.getState(a.model.getChildAt(e.cell,s));this.visitStatesRecursive(o,n,t)}}},mxImageExport.prototype.drawCellState=function(e,n){e.shape instanceof mxShape&&(n.save(),e.shape.paint(n),n.restore()),null!=e.text&&(n.save(),e.text.paint(n),n.restore())},mxImageExport.prototype.drawOverlays=function(e,t){null!=e.overlays&&e.overlays.visit(function(e,n){n instanceof mxShape&&n.paint(t)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,n=2;n<arguments.length;n+=2)this.lastX=arguments[n-1],this.lastY=arguments[n],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,n,t,a,i){return t*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,n),Math.cos(t),Math.sin(t),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,n){this.state.dx+=e,this.state.dy+=n},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){(t=this.state).fillColor=e,t.fillAlpha=null!=r?r:1,t.gradientColor=n,t.gradientAlpha=null!=l?l:1,t.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,n){this.state.shadowDx=e,this.state.shadowDy=n},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,n){this.addOp(this.moveOp,e,n)},mxAbstractCanvas2D.prototype.lineTo=function(e,n){this.addOp(this.lineOp,e,n)},mxAbstractCanvas2D.prototype.quadTo=function(e,n,t,a){this.addOp(this.quadOp,e,n,t,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){this.addOp(this.curveOp,e,n,t,a,i,s)},mxAbstractCanvas2D.prototype.arcTo=function(e,n,t,a,i,s,o){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,n,t,a,i,s,o),n=0;n<e.length;n+=6)this.curveTo(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5])},mxAbstractCanvas2D.prototype.close=function(e,n,t,a,i,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("scale");n.setAttribute("scale",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.translate=function(e,n){var t=this.createElement("translate");t.setAttribute("dx",this.format(e)),t.setAttribute("dy",this.format(n)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rotate=function(e,n,t,a,i){var s=this.createElement("rotate");(0!=e||n||t)&&(s.setAttribute("theta",this.format(e)),s.setAttribute("flipH",n?"1":"0"),s.setAttribute("flipV",t?"1":"0"),s.setAttribute("cx",this.format(a)),s.setAttribute("cy",this.format(i)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("alpha");n.setAttribute("alpha",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var n=this.createElement("fillcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){if(null!=e&&null!=n){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",n),d.setAttribute("x",this.format(t)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(s)),null!=o&&d.setAttribute("direction",o),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var n=this.createElement("strokecolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var n=this.createElement("strokewidth");n.setAttribute("width",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var n=this.createElement("dashed");n.setAttribute("dashed",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var n=this.createElement("dashpattern");n.setAttribute("pattern",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var n=this.createElement("linecap");n.setAttribute("cap",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var n=this.createElement("linejoin");n.setAttribute("join",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var n=this.createElement("miterlimit");n.setAttribute("limit",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var n=this.createElement("fontcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var n=this.createElement("fontbackgroundcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var n=this.createElement("fontbordercolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var n=this.createElement("fontsize");n.setAttribute("size",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var n=this.createElement("fontfamily");n.setAttribute("family",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var n=this.createElement("fontstyle");n.setAttribute("style",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var n=this.createElement("shadow");n.setAttribute("enabled",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var n=this.createElement("shadowcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var n=this.createElement("shadowalpha");n.setAttribute("alpha",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,n){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==n)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var t=this.createElement("shadowoffset");t.setAttribute("dx",e),t.setAttribute("dy",n),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rect=function(e,n,t,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(e)),o.setAttribute("y",this.format(n)),o.setAttribute("w",this.format(t)),o.setAttribute("h",this.format(a)),o.setAttribute("dx",this.format(i)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(n)),l.setAttribute("w",this.format(t)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",s?"1":"0"),l.setAttribute("flipH",o?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,n){var t=this.createElement("move");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.lineTo=function(e,n){var t=this.createElement("line");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(n)),i.setAttribute("x2",this.format(t)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=t,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(e)),o.setAttribute("y1",this.format(n)),o.setAttribute("x2",this.format(t)),o.setAttribute("y2",this.format(a)),o.setAttribute("x3",this.format(i)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=i,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(n)),u.setAttribute("w",this.format(t)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=s&&u.setAttribute("align",s),null!=o&&u.setAttribute("valign",o),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,n){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(n||mxConstants.NS_SVG,e);var t=this.root.ownerDocument.createElement(e);return null!=n&&t.setAttribute("xmlns",n),t},mxSvgCanvas2D.prototype.createGradientId=function(e,n,t,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==n.charAt(0)&&(n=n.substring(1)),e=e.toLowerCase()+"-"+t,n=n.toLowerCase()+"-"+a,(t=null)==i||i==mxConstants.DIRECTION_SOUTH?t="s":i==mxConstants.DIRECTION_EAST?t="e":(a=e,e=n,n=a,i==mxConstants.DIRECTION_NORTH?t="s":i==mxConstants.DIRECTION_WEST&&(t="e")),"mx-gradient-"+e+"-"+n+"-"+t},mxSvgCanvas2D.prototype.getSvgGradient=function(e,n,t,a,i){var s=this.createGradientId(e,n,t,a,i),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,l=0,d=s+"-"+l;if(null!=r)for(o=r.ownerDocument.getElementById(d);null!=o&&o.ownerSVGElement!=r;)d=s+"-"+l++,o=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(e,n,t,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(o):r.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,n,t,a,i){var s=this.createElement("linearGradient");return s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%"),t=t<1?";stop-opacity:"+t:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+t),s.appendChild(i),t=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+n+t),s.appendChild(i),s},mxSvgCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("path"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=t.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?t.setAttribute("fill","none"):t.setAttribute("fill","transparent"),e=!1),n&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||t.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&t.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(t)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(t)),this.pointerEvents&&("path"!=t.nodeName||this.path[this.path.length-1]==this.closeOp)&&t.setAttribute("pointer-events","all"),this.root.appendChild(t)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var n=Math.max(1,this.format(e.strokeWidth*e.scale));1!=n&&this.node.setAttribute("stroke-width",n),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(n))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var n=e.lineCap;"flat"==n&&(n="butt"),"butt"!=n&&this.node.setAttribute("stroke-linecap",n)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var n=this.state.dashPattern.split(" "),t=[];if(0<n.length)for(var a=0;a<n.length;a++)t[a]=Number(n[a])*e;return t.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var n=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,n,t,a,i){if(0!=e||n||t){var s=this.state;if(a+=s.dx,i+=s.dy,a*=s.scale,i*=s.scale,s.transform=s.transform||"",n&&t)e+=180;else if(n^t){var o=n?a:0,r=n?-1:1,l=t?i:0,d=t?-1:1;s.transform+="translate("+this.format(o)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-o)+","+this.format(-l)+")"}(n?!t:t)&&(e*=-1),0!=e&&(s.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),s.rotation+=e,s.rotationCx=a,s.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,n,t,a){var i=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((e+i.dx)*i.scale)),s.setAttribute("y",this.format((n+i.dy)*i.scale)),s.setAttribute("width",this.format(t*i.scale)),s.setAttribute("height",this.format(a*i.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.rect(e,n,t,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((e+t/2+i.dx)*i.scale)),s.setAttribute("cy",Math.round((n+a/2+i.dy)*i.scale)),s.setAttribute("rx",t/2*i.scale),s.setAttribute("ry",a/2*i.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var l=this.state;e+=l.dx,n+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),s||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",o||r){var c=s=1,m=0,u=0;o&&(s=-1,m=-t-2*e),r&&(c=-1,u=-a-2*n),i+="scale("+s+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,n,t,a,i){return t=this.state,a="display:inline-block;font-size:"+Math.round(t.fontSize)+"px;font-family:"+t.fontFamily+";color:"+t.fontColor+";line-height:"+Math.round(t.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),n==mxConstants.ALIGN_CENTER?a+="text-align:center;":n==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),n="",null!=t.fontBackgroundColor&&(n+="background-color:"+t.fontBackgroundColor+";"),null!=t.fontBorderColor&&(n+="border:1px solid "+t.fontBorderColor+";"),mxUtils.isNode(e)||((t=document.createElement("textarea")).innerHTML=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">"),e=t.value,i?a+=n:0<n.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+n+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,n+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<t&&(p+="width:"+Math.round(t)+"px;")):d&&(p+="width:"+Math.round(t)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<t&&(p+="width:"+Math.round(t)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,s,o,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);t=d?Math.max(t,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,s==mxConstants.ALIGN_CENTER?i-=t/2:s==mxConstants.ALIGN_RIGHT&&(i-=t),e+=i,o==mxConstants.ALIGN_MIDDLE?d-=a/2:o==mxConstants.ALIGN_BOTTOM&&(d-=a),n+=d,s=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(s+="rotate("+u.rotation+","+t/2+","+a/2+")",e=(n=this.rotatePoint((e+t/2)*u.scale,(n+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-t*u.scale/2,n=n.y-a*u.scale/2):(e*=u.scale,n*=u.scale),0!=m&&(s+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(n)+")"+s),l.setAttribute("width",Math.round(Math.max(1,t))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,n,t,a,i,s,o,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,n,t,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(t=Math.round(t))+"-"+(a=Math.round(a)),s=0,o=i+"-"+s;null!=document.getElementById(o);)o=i+"-"+ ++s;return clip=this.createElement("clipPath"),clip.setAttribute("id",o),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",n),i.setAttribute("width",t),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(n*r.scale)+")"),d&&0<t&&0<a){var g=e;c=n,s==mxConstants.ALIGN_CENTER?g-=t/2:s==mxConstants.ALIGN_RIGHT&&(g-=t),o==mxConstants.ALIGN_MIDDLE?c-=a/2:o==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,t*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,s),"start"!=(c=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=n+m-1,o==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:o==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,n,t,v,s,o,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var n=this.state;e.setAttribute("fill",n.fontColor),(!this.styleEnabled||n.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",n.fontFamily),(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,n,t,a,i,s,o,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;null!=(c=l?(o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,a*d.scale,(i-2)*d.scale,(s+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),n=mxClient.IS_IE&&mxClient.IS_SVG,new mxRectangle(c.x,c.y+(n?0:1),c.width,c.height+(n?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),n=mxUtils.htmlEntities(n,!1),c.innerHTML=n.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,s=c.offsetHeight,c.parentNode.removeChild(c),o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,(a+2)*d.scale,i*d.scale,(s+1)*d.scale)))&&((n=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),n.setAttribute("stroke",d.fontBorderColor||"none"),n.setAttribute("x",Math.floor(c.x-1)),n.setAttribute("y",Math.floor(c.y-1)),n.setAttribute("width",Math.ceil(c.width+2)),n.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,n.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&n.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(n,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,n){this.graph=e,this.setStates(n)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("shape"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.path=this.path.join(" ")+" e",t.style.width=this.root.style.width,t.style.height=this.root.style.height,t.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height)}t.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(t,e&&null!=a.fillColor,n&&null!=a.strokeColor)),n&&null!=a.strokeColor?(t.stroked="true",t.strokecolor=a.strokeColor):t.stroked="false",t.appendChild(this.createStroke()),e&&null!=a.fillColor?t.appendChild(this.createFill()):!this.pointerEvents||"shape"==t.nodeName&&this.path[this.path.length-1]!=this.closeOp?t.filled="false":t.appendChild(this.createTransparentFill()),this.root.appendChild(t)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":fill");if(n.color=e.fillColor,null!=e.gradientColor){n.type="gradient",n.method="none",n.color2=e.gradientColor;var t=180-e.rotation;t=e.gradientDirection==mxConstants.DIRECTION_WEST?t-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?t+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?t-(180+("y"==this.root.style.flip?-180:0)):t+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(t*=-1),n.angle=mxUtils.mod(t,360),n.opacity=100*e.alpha*e.fillAlpha+"%",n.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(n.opacity=100*e.alpha+"%");return n},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":stroke");return n.endcap=e.lineCap||"flat",n.joinstyle=e.lineJoin||"miter",n.miterlimit=e.miterLimit||"10",e.alpha<1&&(n.opacity=100*e.alpha+"%"),e.dashed&&(n.dashstyle=this.getVmlDashStyle()),n},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var n=this.state.dashPattern.split(" ");0<n.length&&1==n[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,n,t){var a=this.state,i=-a.rotation*(Math.PI/180),s=Math.cos(i),o=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?o*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(o*s-r*i)+"px",l.style.marginTop=Math.round(o*i+r*s)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),t?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",n?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,n,t,a,i){n&&t?e+=180:n?this.root.style.flip="x":t&&(this.root.style.flip="y"),(n?!t:t)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.state,s=(this.lastX+i.dx)*i.scale,o=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;o+=2/3*((n=(n+i.dy)*i.scale)-o);var r=(t=(t+i.dx)*i.scale)+2/3*(e-t);n=(a=(a+i.dy)*i.scale)+2/3*(n-a),this.path.push("c "+this.format(s+2/3*(e-s))+" "+this.format(o)+" "+this.format(r)+" "+this.format(n)+" "+this.format(t)+" "+this.format(a)),this.lastX=t/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,n,t,a,i){var s=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((n+s.dx)*s.scale)+"px",e.style.top=this.format((t+s.dy)*s.scale)+"px",e.style.width=this.format(a*s.scale)+"px",e.style.height=this.format(i*s.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)},mxVmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,n,t,a),this.node.setAttribute("arcsize",Math.max(100*i/t,100*s/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,n,t,a)},mxVmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){var l=null;s?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=s?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,n,t,a)).src=i,o&&r?l.style.rotation="180":o?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,n,t,a){t=document.createElement("div");var i=this.state,s="";return null!=i.fontBackgroundColor&&(s+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(s+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?t.appendChild(e):0<s.length&&!a?((a=document.createElement("div")).style.cssText=s,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,t.appendChild(a)):(t.style.cssText=s,t.innerHTML=e),(e=t.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=n||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),t},mxVmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(n=this.rotatePoint(e,n,u.rotation,u.rotationCx,u.rotationCy)).x,n=n.y),8==document.documentMode?(e+=u.dx,n+=u.dy):(e*=u.scale,n*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(n)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(s,o)).x,v=v.y;if(i=this.createDiv(i,s,o,d),s=document.createElement("div"),r?(!c&&0<t&&(i.style.width=Math.round(t)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(s.style.display="inline",s.style.zoom="1",s.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(s),l.appendChild(p)):l.appendChild(s)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<t&&(i.style.width=Math.round(t)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=t+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){t=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(t)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-t)).toFixed(8)),(t%=2*Math.PI)<0&&(t+=2*Math.PI),(t%=Math.PI)>Math.PI/2&&(t=Math.PI-t),o=Math.cos(t);var h=Math.sin(t);8==document.documentMode&&(i.style.display="inline-block",s.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*o+t*-h)/2-m*t*(g+.5)+r*a*(v+.5),d=(t-t*o+a*-h)/2+r*t*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-t/2)*u.scale)+"px",g.style.top=this.format(n+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-t/2)*u)+"px",l.style.top=this.format(n+(c-a/2)*u)+"px"),s.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",s.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(s.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",s.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+t*g*this.state.scale)+"px",l.style.top=this.format(n+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,n,t,a,mxUtils.htmlEntities(i,!1),s,o,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,n=(n+a.dy)*a.scale,(t=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",t.style.height="1px",t.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+s,d.style.align=s,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",s=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=s+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=s+((i=i.split("\n")).length-1)*s*mxConstants.LINE_HEIGHT,s=i=0,o==mxConstants.ALIGN_BOTTOM?s=-a/2:o!=mxConstants.ALIGN_MIDDLE&&(s=a/2),null!=m&&(o=(t.style.rotation=m)*(Math.PI/180),i=Math.sin(o)*s,s*=Math.cos(o)),t.appendChild(d),t.style.left=this.format(e-i)+"px",t.style.top=this.format(n+s)+"px",this.root.appendChild(t)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,n){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var t=this.graph.getView().translate,i=this.graph.getView().scale,s=e.x,o=e.y,r=!1,l=!1,d=f=this.getGuideTolerance(),c=f;(f=a.clone()).x+=e.x,f.y+=e.y;var m=f.x,u=f.x+f.width,p=f.getCenterX(),g=f.y,v=f.y+f.height,h=f.getCenterY();e=function(e){e+=this.graph.panDx;var n=!1;if(Math.abs(e-p)<d?(s=e-a.getCenterX(),d=Math.abs(e-p),n=!0):Math.abs(e-m)<d?(s=e-a.x,d=Math.abs(e-m),n=!0):Math.abs(e-u)<d&&(s=e-a.x-a.width,d=Math.abs(e-u),n=!0),n){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,t.scrollHeight-3-this.graph.panDy)]}r=r||n};for(var f=function(e){e+=this.graph.panDy;var n=!1;if(Math.abs(e-h)<c?(o=e-a.getCenterY(),c=Math.abs(e-h),n=!0):Math.abs(e-g)<c?(o=e-a.y,c=Math.abs(e-g),n=!0):Math.abs(e-v)<c&&(o=e-a.y-a.height,c=Math.abs(e-v),n=!0),n){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(t.scrollWidth-3-this.graph.panDx,e)]}l=l||n},b=0;b<this.states.length;b++){var A=this.states[b];null!=A&&(this.horizontal&&(e.call(this,A.getCenterX()),e.call(this,A.x),e.call(this,A.x+A.width)),this.vertical&&(f.call(this,A.getCenterY()),f.call(this,A.y),f.call(this,A.y+A.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",n&&(r||(n=a.x-(this.graph.snap(a.x/i-t.x)+t.x)*i,s=this.graph.snap(s/i)*i-n),l||(t=a.y-(this.graph.snap(a.y/i-t.y)+t.y)*i,o=this.graph.snap(o/i)*i-t)),e=new mxPoint(s,o)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}},mxStencil.prototype.parseConstraint=function(e){var n=Number(e.getAttribute("x")),t=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(n,t),e)},mxStencil.prototype.evaluateTextAttribute=function(e,n,t){return n=this.evaluateAttribute(e,n,t),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(n=mxResources.get(n)),n},mxStencil.prototype.evaluateAttribute=function(e,n,t){return null==(n=e.getAttribute(n))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(n=e(t)))),n},mxStencil.prototype.drawShape=function(e,n,t,a,i,s){this.drawChildren(e,n,t,a,i,s,this.bgNode,!1),this.drawChildren(e,n,t,a,i,s,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,n,t,a,i,s,o,r){if(null!=o){var l=mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,null);for(t=this.computeAspect(n.style,t,a,i,s,l),a=Math.min(t.width,t.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(n.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),o=o.firstChild;null!=o;)o.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,o,t,r),o=o.nextSibling}},mxStencil.prototype.computeAspect=function(e,n,t,a,i,s){e=n,n=a/this.w0;var o=i/this.h0;if(s="north"==s||"south"==s){o=a/this.h0,n=i/this.w0;var r=(a-i)/2;e+=r,t-=r}return"fixed"==this.aspect&&(n=o=Math.min(n,o),s?(e+=(i-this.w0*n)/2,t+=(a-this.h0*o)/2):(e+=(a-this.w0*n)/2,t+=(i-this.h0*o)/2)),new mxRectangle(e,t,n,o)},mxStencil.prototype.drawNode=function(e,n,t,a,i){var s=t.nodeName,o=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==s)e.save();else if("restore"==s)e.restore();else if("path"==s)for(e.begin(),t=t.firstChild;null!=t;)t.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,t,a,i),t=t.nextSibling;else if("close"==s)e.close();else if("move"==s)e.moveTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("line"==s)e.lineTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("quad"==s)e.quadTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d);else if("curve"==s)e.curveTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d,o+Number(t.getAttribute("x3"))*l,r+Number(t.getAttribute("y3"))*d);else if("arc"==s)e.arcTo(Number(t.getAttribute("rx"))*l,Number(t.getAttribute("ry"))*d,Number(t.getAttribute("x-axis-rotation")),Number(t.getAttribute("large-arc-flag")),Number(t.getAttribute("sweep-flag")),o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("rect"==s)e.rect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("roundrect"==s)0==(n=t.getAttribute("arcsize"))&&(n=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,n=Number(n)/100,n=Math.min(c*n,a*n),e.roundrect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,c,a,n,n);else if("ellipse"==s)e.ellipse(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("image"==s)n=this.evaluateAttribute(t,"src",n),e.image(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d,n,!1,"1"==t.getAttribute("flipH"),"1"==t.getAttribute("flipV"));else if("text"==s){if(c=this.evaluateTextAttribute(t,"str",n),a="1"==t.getAttribute("vertical")?-90:0,"0"==t.getAttribute("align-shape")){var m=n.rotation,u=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPH,0);n=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPV,0),a=u&&n?a-m:u||n?a+m:a-m}a-=t.getAttribute("rotation"),e.text(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,0,0,c,t.getAttribute("align")||"left",t.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==s)null!=(m=mxStencilRegistry.getStencil(t.getAttribute("name")))&&(o+=Number(t.getAttribute("x"))*l,r+=Number(t.getAttribute("y"))*d,c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,m.drawShape(e,n,o,r,c,a));else if("fillstroke"==s)e.fillAndStroke();else if("fill"==s)e.fill();else if("stroke"==s)e.stroke();else if("strokewidth"==s)e.setStrokeWidth(Number(t.getAttribute("width"))*c);else if("dashed"==s)e.setDashed("1"==t.getAttribute("dashed"));else if("dashpattern"==s){if(null!=(t=t.getAttribute("pattern"))){for(t=t.split(" "),l=[],d=0;d<t.length;d++)0<t[d].length&&l.push(Number(t[d])*c);t=l.join(" "),e.setDashPattern(t)}}else"strokecolor"==s?e.setStrokeColor(t.getAttribute("color")):"linecap"==s?e.setLineCap(t.getAttribute("cap")):"linejoin"==s?e.setLineJoin(t.getAttribute("join")):"miterlimit"==s?e.setMiterLimit(Number(t.getAttribute("limit"))):"fillcolor"==s?e.setFillColor(t.getAttribute("color")):"alpha"==s?e.setAlpha(t.getAttribute("alpha")):"fontcolor"==s?e.setFontColor(t.getAttribute("color")):"fontstyle"==s?e.setFontStyle(t.getAttribute("style")):"fontfamily"==s?e.setFontFamily(t.getAttribute("family")):"fontsize"==s&&e.setFontSize(Number(t.getAttribute("size"))*c);i&&("fillstroke"==s||"fill"==s||"stroke"==s)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var n=1;n<this.points.length;n++)null!=e[n]&&this.bounds.add(new mxRectangle(Number(e[n].x),Number(e[n].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,n=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(n=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+n+","+n+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var t=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));n=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(n,!1);""!=n.tagUrn&&(n.coordsize=t*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),n=this.scale,e.translate(-Math.round(this.bounds.x/n),-Math.round(this.bounds.y/n))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=n+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var n in e.gradients){var t=e.gradients[n];t.mxRefCount=(t.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n,s=this.bounds.height/n;if(this.isPaintBoundsInverted()){t=t+(o=(i-s)/2),a=a-o;var o=i;i=s,s=o}if(this.updateTransform(e,t,a,i,s),this.configureCanvas(e,t,a,i,s),null!=this.stencil)this.paintStencilShape(e,t,a,i,s);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(t=[],a=0;a<this.points.length;a++)t.push(new mxPoint(this.points[a].x/n,this.points[a].y/n));this.paintEdgeShape(e,t)}else this.paintVertexShape(e,t,a,i,s)},mxShape.prototype.configureCanvas=function(e,n,t,a,i){var s=null;null!=this.style&&(s=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=s&&e.setDashPattern(s),null!=this.gradient?(n=this.getGradientBounds(e,n,t,a,i),e.setGradient(this.fill,this.gradient,n.x,n.y,n.width,n.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,i)},mxShape.prototype.updateTransform=function(e,n,t,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,n+a/2,t+i/2)},mxShape.prototype.paintStencilShape=function(e,n,t,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,n,t,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,n,t,a,i)},mxShape.prototype.paintVertexShape=function(e,n,t,a,i){this.paintBackground(e,n,t,a,i),e.setShadow(!1),this.paintForeground(e,n,t,a,i)},mxShape.prototype.paintBackground=function(e,n,t,a,i){},mxShape.prototype.paintForeground=function(e,n,t,a,i){},mxShape.prototype.paintEdgeShape=function(e,n){},mxShape.prototype.getArcSize=function(e,n){var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*t,n*t)},mxShape.prototype.paintGlassEffect=function(e,n,t,a,i,s){var o=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",n,t,a,.6*i,"south",.9,.1),e.begin(),s+=2*o,this.isRounded?(e.moveTo(n-o+s,t-o),e.quadTo(n-o,t-o,n-o,t-o+s),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o+s),e.quadTo(n+a+o,t-o,n+a+o-s,t-o)):(e.moveTo(n-o,t-o),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var n=(e.width-e.height)/2;e.x+=n,e.y-=n,n=e.width,e.width=e.height,e.height=n}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var n=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(n/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,n,t,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",n),e.setAttribute("y",t),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var n in e){var t=e[n];t.mxRefCount=(t.mxRefCount||0)-1,0==t.mxRefCount&&null!=t.parentNode&&t.parentNode.removeChild(t)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,n){mxStencilRegistry.stencils[e]=n},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,n){mxMarker.markers[e]=n},createMarker:function(e,n,t,a,i,s,o,r,l,d){var c=mxMarker.markers[t];return null!=c?c(e,n,t,a,i,s,o,r,l,d):null}};function mxActor(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxCloud(e,n,t,a){mxActor.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRhombus(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxPolyline(e,n,t){mxShape.call(this),this.points=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxArrow(e,n,t,a,i,s,o){mxShape.call(this),this.points=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxText(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A){mxShape.call(this),this.value=e,this.bounds=n,this.color=null!=i?i:"black",this.align=null!=t?t:"",this.valign=null!=a?a:"",this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=f&&f,this.overflow=null!=b?b:"visible",this.labelPadding=null!=A?A:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,n,t){mxShape.call(this),this.bounds=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxImageShape(e,n,t,a,i){mxShape.call(this),this.bounds=e,this.image=n,this.fill=t,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,n,t,a){mxRectangleShape.call(this,e,n,t,a)}function mxCylinder(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxConnector(e,n,t){mxPolyline.call(this,e,n,t)}function mxSwimlane(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,n,t,a,i,s){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=null!=t?t:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=s?s:0}function mxPartitionLayout(e,n,t,a){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=t||0,this.border=a||0}function mxCompactTreeLayout(e,n,t){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.invert=null!=t&&t}function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,n){mxGraphLayout.call(this,e),this.radius=null!=n?n:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,n,t){mxGraphLayout.call(this,e),this.layouts=n,this.master=t}function mxEdgeLabelLayout(e,n){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,n,t,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=t,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,t=[],null==n&&(n=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,n,t),a=0;a<n.length;a++){i=t[a].connectsAsSource;for(var s=0;s<i.length;s++){var o=i[s];if(null!=(r=o.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];t[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&t[a]!=l&&(0==(o.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,o)<0&&l.connectsAsTarget.push(o))}}t[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,n,t,a,i,s){this.layout=e,this.intraCellSpacing=n,this.interRankCellSpacing=t,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=s}!function(){function e(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,r=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=r,o=t!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*o-n,a.y+=-s*o-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-s/2,c.y-s+i/2),t==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*s/4),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function n(e,n,t,a,i,s,o,r,l,d){r=t==mxConstants.ARROW_DIAMOND?.7071:.9862,n=i*l*r,r*=s*l,i*=o+l,s*=o+l;var c=a.clone();c.x-=n,c.y-=r,a.x+=-i-n,a.y+=-s-r;var m=t==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-s/m,c.y+i/m-s/2),e.lineTo(c.x-i,c.y-s),e.lineTo(c.x-i/2+s/m,c.y-s/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,t=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=t,a.x+=2*-n,a.y+=2*-t,function(){e.begin(),e.moveTo(c.x-i-s/2,c.y-s+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,n,t,a,i,s,o,r,l,d){var c=o/2,m=a.clone();return a.x-=i*c,a.y-=s*c,function(){e.ellipse(m.x-c,m.y-c,o,o),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,n,t,a,i){n=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-n,2*i/5,a/2-n,0,a/2,0),e.curveTo(a/2+n,0,a/2+n,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,n,t,a,i){if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.min(a*s,i*s);e.roundrect(n,t,a,i,s,s)}else e.rect(n,t,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,n,t,a,i){this.glass&&this.paintGlassEffect(e,n,t,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var n=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,n)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-n/2)+"px",e.style.top=Math.round(this.bounds.y-n/2)+"px","CSS1Compat"==document.compatMode&&(n=-n),e.style.width=Math.round(Math.max(0,this.bounds.width+n))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+n))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var n=this.stroke;null!=n&&n!=mxConstants.NONE?(e.style.borderColor=n,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(n=this.fill)&&n!=mxConstants.NONE?(e.style.backgroundColor=n,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var n="";if(this.opacity<100&&(n+="alpha(opacity="+this.opacity+")"),this.isShadow&&(n+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var t=this.fill,a=this.gradient,i="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o?(i="1",s=t,t=a,a=s):2==o?(s=t,t=a,a=s):3==o&&(i="1"),n+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+t+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=n},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,n,t,a,i){var s=Math.min(4,Math.min(a/5,i/5));i-=2*s,0<(a-=2*s)&&0<i&&e.ellipse(n+s,t+s,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,n,t,a,i){var s=a/2,o=i/2;e.begin(),e.moveTo(n+s,t),e.lineTo(n+a,t+o),e.lineTo(n+s,t+i),e.lineTo(n,t+o),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,n){this.paintLine(e,n,this.isRounded)},mxPolyline.prototype.paintLine=function(e,n,t){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=n[0],s=n[n.length-1];e.begin(),e.moveTo(i.x,i.y);for(var o=1;o<n.length-1;o++){var r=n[o],l=i.x-r.x;i=i.y-r.y;if(t&&o<n.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=n[o+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(s.x,s.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,n){var t=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,s=n[0],o=n[n.length-1],r=o.x-s.x,l=o.y-s.y,d=(c=Math.sqrt(r*r+l*l))-2*t-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=s.x-c/2+t*r)+c),u=(s=s.y-a/2+t*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,f=v-3*a;e.begin(),e.moveTo(i,s),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(o.x-t*r,o.y-t*l),e.lineTo(h,f),e.lineTo(h+c,f+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var n=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var t=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,t=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(n=e.getBBox()).width&&0==n.height)return;this.boundingBox=new mxRectangle(n.x,n.y,n.width,n.height),n=0}else a=this.state.view.textDiv,a=null!=this.offsetWidth&&null!=this.offsetHeight?(t=this.wrap?this.bounds.width:this.offsetWidth*this.scale,this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(t=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=t),t=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a.offsetHeight*this.scale):(t=this.wrap?this.bounds.width:e.offsetWidth*this.scale,e.offsetHeight*this.scale);null!=t&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*t,this.bounds.y+this.margin.y*a,t,a))}null!=this.boundingBox&&(0!=n&&(n=mxUtils.getBoundingBox(this.boundingBox,n),this.boundingBox.x=n.x,this.boundingBox.y=n.y,mxClient.IS_QUIRKS||(this.boundingBox.width=n.width,this.boundingBox.height=n.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,n,t,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n;n=this.bounds.height/n;this.updateTransform(e,t,a,i,n),this.configureCanvas(e,t,a,i,n);var s=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=s||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!s&&"html"==o&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==o?r.replace(/\n/g,"<br/>"):r,e.text(t,a,i,n,r,this.align,this.valign,this.wrap,o,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),n=this.node.style,t=this.margin.x,a=this.margin.y;0!=e?(n[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-t+"% "+100*-a+"%",n[mxClient.CSS_PREFIX+"Transform"]="translate("+100*t+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(n[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",n[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*t+"%,"+100*a+"%)"),n.left=Math.round(this.bounds.x)+"px",n.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,n=this.margin.x,t=this.margin.y,a=this.scale;e.filter="";var i=0,s=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var o=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(o=mxUtils.htmlEntities(o,!1)),o=this.replaceLinefeeds?o.replace(/\n/g,"<br/>"):o,r.innerHTML=o}i=r.offsetWidth+2,s=r.offsetHeight+2}else i=this.node.offsetWidth,s=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=s,r=this.bounds.width/a,o=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<o?(o=Math.min(o,s),e.height=Math.round(o+1)+"px"):o=s,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);o*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),s=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(o-o*d+r*c)/2+l*(n=r*-(n+.5))-s*(t=o*-(t+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+s+", M12="+l+", M21="+-l+", M22="+s+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+o*c)/2-s*n-l*t)-r/2)+"px",e.top=Math.round(this.bounds.y+m-o/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var n=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,t=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=n||null!=t)if("fill"==this.overflow)null!=n&&(this.node.style.backgroundColor=n),null!=t&&(this.node.style.border="1px solid "+t);else{var a="";null!=n&&(a+="background-color:"+n+";"),null!=t&&(a+="border:1px solid "+t+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var n=Math.round(this.bounds.width/this.scale),t=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<t&&(e.maxHeight=t+"px"),0<n&&(e.width=n+"px")):"fill"==this.overflow&&(e.width=n+"px",0<t&&(e.maxHeight=t+"px")),this.wrap?(!this.clipped&&0<n&&(e.width=n+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,n,t,a,i){t+=i/2,e.begin(),e.moveTo(n,t),e.lineTo(n+a,t),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,n,t,a,i){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==s&&null==o||(e.setFillColor(s),e.setStrokeColor(o),e.rect(n,t,a,i),e.fillAndStroke()),e.image(n,t,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var n=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=n,this.flipH&&this.flipV?n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?n+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=n&&(e.style.filter=n),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,n,t,a,i){this.paintImage(e,n,t,a,i),this.paintIndicator(e,n,t,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,n,t,a,i){null!=this.image&&(n=this.getImageBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(t-o)/2:i==mxConstants.ALIGN_RIGHT?e+(t-o-l):e+l,n=s==mxConstants.ALIGN_TOP?n+l:s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):n+(a-r)/2,o,r)},mxLabel.prototype.paintIndicator=function(e,n,t,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(n,t,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(n=this.getIndicatorBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(t-o-l):i==mxConstants.ALIGN_CENTER?e+(t-o)/2:e+l,n=s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):s==mxConstants.ALIGN_TOP?n+l:n+(a-r)/2,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var n=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);n.x-=this.bounds.x,n.y-=this.bounds.y,e.style.left=Math.round(n.x)+"px",e.style.top=Math.round(n.y)+"px",e.style.width=Math.round(n.width)+"px",e.style.height=Math.round(n.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,n,t,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,n,t,a,i,s){n=Math.min(this.maxHeight,Math.round(i/5)),(s&&null!=this.fill||!s&&null==this.fill)&&(e.moveTo(0,n),e.curveTo(0,2*n,a,2*n,a,n),s||(e.stroke(),e.begin())),s||(e.moveTo(0,n),e.curveTo(0,-n/3,a,-n/3,a,n),e.lineTo(a,i-n),e.curveTo(a,i+n/3,0,i+n/3,0,i-n),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,n){var t=this.createMarker(e,n,!0),a=this.createMarker(e,n,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,n,this.isRounded):this.paintCurvedLine(e,n),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=t&&t(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,n){e.begin();var t=n[0],a=n.length;for(e.moveTo(t.x,t.y),t=1;t<a-2;t++){var i=n[t],s=n[t+1];e.quadTo(i.x,i.y,(i.x+s.x)/2,(i.y+s.y)/2)}i=n[a-2],s=n[a-1],e.quadTo(i.x,i.y,s.x,s.y),e.stroke()},mxConnector.prototype.createMarker=function(e,n,t){var a=n.length,i=t?n[1]:n[a-2],s=(a=(n=t?n[0]:n[a-1]).x-i.x,n.y-i.y),o=(i=a/(o=Math.max(1,Math.sqrt(a*a+s*s))),a=s/o,s=mxUtils.getNumber(this.style,t?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,t?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,o,n,i,a,s,t,this.strokewidth,0!=this.style[t?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var n=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=Math.max(n,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(n*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,n,t){return 3*t*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,n,t,a,i){var s=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(n,t),this.isRounded?(l=this.getArcSize(a,i,s),this.paintRoundedSwimlane(e,n,t,a,i,s,l,o,r)):this.paintSwimlane(e,n,t,a,i,s,o,r),o=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,s,i,o),null!=this.image&&(i=this.getImageBounds(n,s,a,i),e.image(i.x-n,i.y-t,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,s,l))},mxSwimlane.prototype.paintSwimlane=function(e,n,t,a,i,s,o,r){o!=mxConstants.NONE&&(e.save(),e.setFillColor(o),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,s),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,s),r&&e.close(),e.fillAndStroke(),s<i&&o==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,n,t,a,i,s,o,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,o,o),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,s),e.lineTo(a,o),e.quadTo(a,0,a-Math.min(a/2,o),0),e.lineTo(Math.min(a/2,o),0),e.quadTo(0,0,0,o),e.lineTo(0,s),l&&e.close(),e.fillAndStroke(),s<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i-o),e.quadTo(0,i,Math.min(a/2,o),i),e.lineTo(a-Math.min(a/2,o),i),e.quadTo(a,i,a,i-o),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,n,t,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(n,t),e.lineTo(n,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,n,t,a){return new mxRectangle(e+t-this.imageSize,n,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,n,t){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,n,t,a){return null!=(n=null!=(t=this.graph.view.getState(n))?t.style:this.graph.getCellStyle(n))?n[e]:null},mxGraphLayout.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.graph.model.getEdgeAt(e,s),r=this.graph.model.getTerminal(o,!0)==e;n&&!r||(r=this.graph.view.getVisibleTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var n=this.graph.getModel();return!n.isEdge(e)||!this.graph.isCellVisible(e)||null==n.getTerminal(e,!0)||null==n.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,n?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,n?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var n=new mxPoint;if(null!=e&&e!=this.parent){var t=this.graph.getModel();if(t.isAncestor(this.parent,e))for(var a=t.getGeometry(e);e!=this.parent;)n.x+=a.x,n.y+=a.y,e=t.getParent(e),a=t.getGeometry(e)}return n},mxGraphLayout.prototype.setEdgePoints=function(e,n){if(null!=e){var t=this.graph.model,a=t.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=n)for(var i=t.getParent(e),s=(i=this.getParentOffset(i),0);s<n.length;s++)n[s].x-=i.x,n[s].y-=i.y;a.points=n,t.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e),s=null;if(null!=i){if(s=new mxRectangle(n,t,i.width,i.height),this.useBoundingBox){var o=this.graph.getView().getState(e);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var r=this.graph.getView().scale,l=o.text.boundingBox;o.text.boundingBox.x<o.x&&(n+=(o.x-l.x)/r,s.width=l.width),o.text.boundingBox.y<o.y&&(t+=(o.y-l.y)/r,s.height=l.height)}}null!=this.parent&&(null!=(o=a.getParent(e))&&o!=this.parent&&(n-=(o=this.getParentOffset(o)).x,t-=o.y)),i.x==n&&i.y==t||((i=i.clone()).x=n,i.y=t,a.setGeometry(e,i))}return s},mxGraphLayout.prototype.getVertexBounds=function(e){var n=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var t=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/t,s=Math.max(r.y-a.y,0)/t,o=Math.max(a.x+a.width-(r.x+r.width),0)/t,r=Math.max(a.y+a.height-(r.y+r.height),0)/t;n=new mxRectangle(n.x-i,n.y-s,n.width+i+o,n.height+s+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),n=n.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),n.x+=e.x,n.y+=e.y)),new mxRectangle(n.x,n.y,n.width,n.height)},mxGraphLayout.prototype.arrangeGroups=function(e,n){this.graph.getModel().beginUpdate();try{for(var t=e.length-1;0<=t;t--){var a=e[t],i=this.graph.getChildVertices(a),s=this.graph.getBoundingBoxFromGeometry(i),o=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=s&&null!=o&&((o=o.clone()).x=o.x+s.x-n-r,o.y=o.y+s.y-n-l,o.width=s.width+2*n+r,o.height=s.height+2*n+l,this.graph.getModel().setGeometry(a,o),this.graph.moveCells(i,n+r-s.x,n+l-s.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,n,t){var a=this.graph.getModel(),i=a.getParent(e),s=this.isHorizontal();if(null!=e&&null!=i){var o=0,r=0,l=a.getChildCount(i);for(n=s?n:t,null!=(o=this.graph.getView().getState(i))&&(n-=s?o.x:o.y),o=0;o<l;o++)if((t=a.getChildAt(i,o))!=e&&null!=(t=a.getGeometry(t))){if(t=s?t.x+t.width/2:t.y+t.height/2,r<n&&n<t)break;r=t}s=i.getIndex(e),s=Math.max(0,o-(s<o?1:0)),a.add(i,e,s)}},mxStackLayout.prototype.getParentSize=function(e){var n=this.graph.getModel(),t=n.getGeometry(e);return null!=this.graph.container&&(null==t&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(t=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),t},mxStackLayout.prototype.execute=function(e){if(null!=e){var n=this.isHorizontal(),t=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=n?a.height:a.width);i=i-(2*this.spacing+2*this.border);var s=this.x0+this.border,o=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);n==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),n?o+=l:s+=l}t.beginUpdate();try{l=0,r=null;for(var d=t.getChildCount(e),c=0;c<d;c++){var m=t.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=t.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(n&&r.x+r.width+u.width+2*this.spacing>this.wrap||!n&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,n?o+=l+this.spacing:s+=l+this.spacing,l=0),l=Math.max(l,n?u.height:u.width),null!=r?n?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(n?u.x=s:u.y=o),n?u.y=o:u.x=s,this.fill&&0<i&&(n?u.height=i:u.width=i),t.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),n?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,t.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(n?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{t.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,n,t){var a=(t=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,s=0,o=t.getChildCount(a);for(i=0;i<o;i++){var r=t.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,s<n&&n<r)break;s=r}}n=a.getIndex(e),n=Math.max(0,i-(n<i?1:0)),t.add(a,e,n)}},mxPartitionLayout.prototype.execute=function(e){var n=this.isHorizontal(),t=this.graph.getModel(),a=t.getGeometry(e);if(null!=this.graph.container&&(null==a&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(s=i.length)){var l=this.border,d=this.border,c=(c=n?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=n?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(s-1)*this.spacing,0<(a=n?(a.width-l-e)/s:(a.height-d-e)/s)){t.beginUpdate();try{for(o=0;o<s;o++){r=i[o];var m=t.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,n?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),t.setGeometry(r,m))}}finally{t.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.getModel();if(null==n)if(0<this.graph.getEdges(e,t.getParent(e),this.invert,!this.invert,!1).length)n=e;else{if(0<(o=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<o.length;a++)if(!this.isVertexIgnored(o[a])&&0<this.graph.getEdges(o[a],null,this.invert,!this.invert,!1).length){n=o[a];break}}if(null!=n){this.parentsChanged=this.resizeParent?{}:null,t.beginUpdate();try{var i=this.dfs(n,e);if(null!=i){this.layout(i);var s=this.graph.gridSize,o=s;if(!this.moveTree){var r=this.getVertexBounds(n);null!=r&&(s=r.x,o=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,s,o):this.verticalLayout(i,null,s,o))){var l=a=0;r.x<0&&(a=Math.abs(s-r.x)),r.y<0&&(l=Math.abs(o-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{t.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,n,t){for(e.x+=n,e.y+=t,this.apply(e),e=e.child;null!=e;)this.moveNode(e,n,t),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,n,t){t=null!=t?t:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==t[a]&&!this.isVertexIgnored(e)){t[a]=e;i=this.createNode(e),a=this.graph.getModel();var s=null;e=this.graph.getEdges(e,n,this.invert,!this.invert,!1,!0);for(var o=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=o.getState(l))?d.getVisibleTerminal(this.invert):o.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,n,t))&&null!=a.getGeometry(l)&&(null==s?i.child=d:s.next=d,s=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var n=e.child;null!=n;)this.layout(n),n=n.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,n,t,a){if(e.x+=n+e.offsetX,e.y+=t+e.offsetY,a=this.apply(e,a),null!=(n=e.child)){a=this.horizontalLayout(n,e.x,e.y,a),t=e.y+n.offsetY;for(var i=n.next;null!=i;)a=this.horizontalLayout(i,e.x+n.offsetX,t,a),t+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,n,t,a,i){if(e.x+=t+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(n=e.child))for(i=this.verticalLayout(n,e,e.x,e.y,i),t=e.x+n.offsetY,a=n.next;null!=a;)i=this.verticalLayout(a,e,t,e.y+n.offsetX,i),t+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,n){var t=this.nodeDistance+this.levelDistance,a=(n-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-n;e.child.offsetX=t+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(t,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(t,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var n=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+n,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-n),e.contour.lowerHead=this.createLine(e.height+n,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var n=2*this.nodeDistance,t=e.child;e.contour=t.contour;var a=t.width+n,i=a;for(t=t.next;null!=t;){var s=this.merge(e.contour,t.contour);t.offsetY=s+a,t.offsetX=0,i+=s+(a=t.width+n),t=t.next}return i},mxCompactTreeLayout.prototype.merge=function(e,n){for(var t=0,a=0,i=0,s=e.lowerHead,o=n.upperHead;null!=o&&null!=s;){var r=this.offset(t,a,o.dx,o.dy,s.dx,s.dy);a=a+r,i=i+r;t+o.dx<=s.dx?(t+=o.dx,a+=o.dy,o=o.next):(t-=s.dx,a-=s.dy,s=s.next)}return null!=o?(t=this.bridge(e.upperTail,0,0,o,t,a),e.upperTail=null!=t.next?n.upperTail:t,e.lowerTail=n.lowerTail):null==(t=this.bridge(n.lowerTail,t,a,s,0,0)).next&&(e.lowerTail=t),e.lowerHead=n.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,n,t,a,i,s){var o;return i<=e||e+t<=0?0:0<(o=0<i*a-t*s?e<0?e*a/t-n:0<e?e*s/i-n:-n:i<e+t?s-(n+(i-e)*a/t):e+t<i?(t+e)*s/i-(n+a):s-(n+a))?o:0},mxCompactTreeLayout.prototype.bridge=function(e,n,t,a,i,s){return n=i+a.dx-n,i=i=0,0==a.dx?i=a.dy:(i=n*a.dy,i/=a.dx),n=this.createLine(n,i,a.next),e.next=this.createLine(0,s+a.dy-i-t,n),n},mxCompactTreeLayout.prototype.createNode=function(e){var n={};return n.cell=e,n.x=0,n.y=0,n.width=0,n.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(n.width=e.height,n.height=e.width):(n.width=e.width,n.height=e.height)),n.offsetX=0,n.offsetY=0,n.contour={},n},mxCompactTreeLayout.prototype.apply=function(e,n){var t=this.graph.getModel(),a=e.cell,i=t.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(t=t.getParent(a),a=mxCellPath.create(t),null==this.parentsChanged[a]&&(this.parentsChanged[a]=t))),n=null==n?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(n.x,i.x),Math.min(n.y,i.y),Math.max(n.x+n.width,i.x+i.width),Math.max(n.y+n.height,i.y+i.height))),n},mxCompactTreeLayout.prototype.createLine=function(e,n,t){var a={};return a.dx=e,a.dy=n,a.next=t,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,n=[];for(e in this.parentsChanged)n.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var n=e.child,t=e.cell,a=0,i=[];null!=n;){a++;var s=n.x;this.horizontal&&(s=n.y),i.push(new WeightedCellSorter(n,s)),n=n.next}i.sort(WeightedCellSorter.prototype.compare),(s=e.width)>(o=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(s-=2*this.prefHozEdgeSep),n=(e=s/a)/2,s>o+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep);s=this.minEdgeJetty-this.prefVertEdgeOff;for(var o=0,r=this.getVertexBounds(t),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(t,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+n,m.push(new mxPoint(u,p)),u=r.x+r.width+s,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+n,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+s,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?s+=this.prefVertEdgeOff:a/2<l&&(s-=this.prefVertEdgeOff),n+=e,o=Math.max(o,s)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?1:n.weightedValue<e.weightedValue?-1:n.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var n=this.graph.getModel();this.vertexArray=[];for(var t=this.graph.getChildVertices(e),a=0;a<t.length;a++)this.isVertexIgnored(t[a])||this.vertexArray.push(t[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,s=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var o=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(o);this.indices[r]=a;var l=this.getVertexBounds(o),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}n.beginUpdate();try{for(a=0;a<s;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);t=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<t.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(t[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=t=null,a=0;a<this.vertexArray.length;a++)o=this.vertexArray[a],this.isVertexMovable(o)&&(null!=(l=this.getVertexBounds(o))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(o,m,u),t=null==t?m:Math.min(t,m),e=null==e?u:Math.min(e,u)));a=1-(t||0),o=1-(e||0),null!=i&&(a+=i.x,o+=i.y),this.graph.moveCells(this.vertexArray,a,o)}finally{n.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(t=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(t=.001);var n=this.dispX[e]/t*Math.min(t,this.temperature),t=this.dispY[e]/t*Math.min(t,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=n,this.cellLocation[e][1]+=t}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var n=0;n<this.neighbours[e].length;n++){var t=this.neighbours[e][n];if(e!=t&&this.isMoveable[e]&&this.isMoveable[t]){(a=(s=this.cellLocation[e][0]-this.cellLocation[t][0])*s+(o=this.cellLocation[e][1]-this.cellLocation[t][1])*o-this.radiusSquared[e]-this.radiusSquared[t])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),s=s/i*(a=a/this.forceConstant),o=o/i*a;this.dispX[e]-=s,this.dispY[e]-=o,this.dispX[t]+=s,this.dispY[t]+=o}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,n=0;n<e;n++)for(var t=n;t<e;t++){if(!this.allowedToRun)return;if(t!=n&&this.isMoveable[n]&&this.isMoveable[t]){var a=this.cellLocation[n][0]-this.cellLocation[t][0],i=this.cellLocation[n][1]-this.cellLocation[t][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var s=Math.sqrt(a*a+i*i),o=s-this.radius[n]-this.radius[t];o>this.maxDistanceLimit||(o<this.minDistanceLimit&&(o=this.minDistanceLimit),a=a/s*(o=this.forceConstantSquared/o),i=i/s*o,this.dispX[n]+=a,this.dispY[n]+=i,this.dispX[t]-=a,this.dispY[t]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0,a=null,i=null,s=[],o=n.getChildCount(e),r=0;r<o;r++){var l=n.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{s.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),t=Math.max(t,Math.max(d.width,d.height))}}var c=this.getRadius(s.length,t);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(s,c,i,a)}finally{n.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,n){return Math.max(e*n/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,n,t,a){for(var i=e.length,s=2*Math.PI/i,o=0;o<i;o++)this.isVertexMovable(e[o])&&this.setVertexLocation(e[o],t+n+n*Math.sin(o*s),a+n+n*Math.cos(o*s))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var n in e){var t=e[n];1<t.length&&this.layout(t)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var n=this.graph.getModel(),t=[],a=n.getChildCount(e),i=0;i<a;i++){var s=n.getChildAt(e,i);if(!this.isEdgeIgnored(s)){var o=this.getEdgeId(s);null!=o&&(null==t[o]&&(t[o]=[]),t[o].push(s))}}return t},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var n=this.graph.getView(),t=n.getState(e),a=null!=t?t.getVisibleTerminal(!0):n.getVisibleTerminal(e,!0);return e=null!=t?t.getVisibleTerminal(!1):n.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var n=e[0];if((o=(t=this.graph.getModel()).getGeometry(t.getTerminal(n,!0)))==(s=t.getGeometry(t.getTerminal(n,!1)))){n=o.x+o.width+this.spacing;for(var t=o.y+o.height/2,a=0;a<e.length;a++)this.route(e[a],n,t),n+=this.spacing}else if(null!=o&&null!=s){n=o.x+o.width/2,t=o.y+o.height/2,a=s.x+s.width/2-n;var i=s.y+s.height/2-t,s=Math.sqrt(a*a+i*i),o=i*this.spacing/s;for(s=a*this.spacing/s,n=n+a/2+o*(e.length-1)/2,t=t+i/2-s*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],n,t),n-=o,t+=s}},mxParallelEdgeLayout.prototype.route=function(e,n,t){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(n,t)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,n,t){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<this.layouts.length;t++)this.layouts[t].execute.apply(this.layouts[t],arguments)}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var n=this.graph.view,t=this.graph.getModel(),a=[],i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o),l=n.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,n){var t=this.graph.getModel();t.beginUpdate();try{for(var a=0;a<n.length;a++){var i=n[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var s=0;s<e.length;s++){var o=e[s];null!=o&&this.avoid(i,o)}}}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,n){var t=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,n)){var i=-a.y-a.height+n.y,s=-a.y+n.y+n.height;i=Math.abs(i)<Math.abs(s)?i:s,s=-a.x-a.width+n.x,a=-a.x+n.x+n.width,a=Math.abs(s)<Math.abs(a)?s:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(s=t.getGeometry(e.cell))&&(null!=(s=s.clone()).offset?(s.offset.x+=a,s.offset.y+=i):s.offset=new mxPoint(a,i),t.setGeometry(e.cell,s))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,n){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,n){this.isVertex()?this.x[0]=n:this.isEdge()&&(this.x[e-this.minRank-1]=n)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,n){this.isVertex()?this.y[0]=n:this.isEdge()&&(this.y[e-this.minRank-1]=n)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsTarget.length;n++){var t=this.connectsAsTarget[n];-1==t.maxRank||t.maxRank==e+1?this.nextLayerConnectedCells[0].push(t.source):this.nextLayerConnectedCells[0].push(t)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsSource.length;n++){var t=this.connectsAsSource[n];-1==t.minRank||t.minRank==e-1?this.previousLayerConnectedCells[0].push(t.target):this.previousLayerConnectedCells[0].push(t)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,n){this.temp[0]=n},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var n=0;n<this.hashCode.length;n++)if(this.hashCode[n]!=e.hashCode[n])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.nextLayerConnectedCells[n]=[],n==this.temp.length-1?this.nextLayerConnectedCells[n].push(this.source):this.nextLayerConnectedCells[n].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.previousLayerConnectedCells[n]=[],0==n?this.previousLayerConnectedCells[n].push(this.target):this.previousLayerConnectedCells[n].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,n){this.temp[e-this.minRank-1]=n},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,n,t){for(var a=e.getGraph(),i=0;i<n.length;i++){t[i]=new mxGraphHierarchyNode(n[i]);var s=mxCellPath.create(n[i]);this.vertexMapper[s]=t[i],s=e.getEdges(n[i]),t[i].connectsAsSource=[];for(var o=0;o<s.length;o++){if((d=e.getVisibleTerminal(s[o],!1))!=n[i]&&d!=n[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(n[i],d,!1),l=e.getEdgesBetween(n[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=t[i],mxUtils.indexOf(t[i].connectsAsSource,l)<0&&t[i].connectsAsSource.push(l)}}}t[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var t=mxCellPath.create(this.roots[n]);null!=(t=this.vertexMapper[t])&&e.push(t)}for(var a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var s,o;s=(t=e[0]).connectsAsTarget,o=t.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(n=0;n<s.length;n++){var d=s[n];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(t.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(n=0;n<o.length;n++)(d=o[n]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(n=e.shift(),e.push(t),n==t&&1==e.length)break}for(a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]-=this.maxRank;for(n=0;n<i.length;n++)for(e=0,s=(t=i[n]).connectsAsSource,a=0;a<s.length;a++)d=(d=s[a]).target,t.temp[0]=Math.max(e,d.temp[0]+1),e=t.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var s=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)s[e]=[],this.ranks[e]=s[e];var n=null;if(null!=this.roots){var t=this.roots;for(n=[],e=0;e<t.length;e++){var a=mxCellPath.create(t[e]);n[e]=this.vertexMapper[a]}}this.visit(function(e,n,t,a,i){if(0==i&&n.maxRank<0&&n.minRank<0&&(s[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=s[n.maxRank].length-1),null!=e&&null!=t&&1<e.maxRank-n.maxRank)for(t.maxRank=e.maxRank,t.minRank=n.maxRank,t.temp=[],t.x=[],t.y=[],e=t.minRank+1;e<t.maxRank;e++)s[e].push(t),t.setGeneralPurposeVariable(e,s[e].length-1)},n,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,n,t,a){if(null!=n){for(var i=0;i<n.length;i++){var s=n[i];null!=s&&(null==a&&(a={}),t?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=i,this.extendedDfs(null,s,null,e,a,s.hashCode,i,0)):this.dfs(null,s,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,n,t,a,i,s){if(null!=n){var o=mxCellPath.create(n.cell);if(null==i[o])for(a(e,i[o]=n,t,s,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.dfs(n,o.target,o,a,i,s+1);else a(e,n,t,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,n,t,a,i,s,o,r){if(null!=n)if(null==e||null!=n.hashCode&&n.hashCode[0]==e.hashCode[0]||(s=e.hashCode.length+1,n.hashCode=e.hashCode.slice(),n.hashCode[s-1]=o),null==i[o=mxCellPath.create(n.cell)])for(a(e,i[o]=n,t,r,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.extendedDfs(n,o.target,o,a,i,n.hashCode,t,r+1);else a(e,n,t,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var t=0,a=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&t<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=t=0;i<this.nestedBestRanks.length;i++)for(var s=e.ranks[i],o=0;o<s.length;o++){var r=s[o];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(t++,i=0;i<this.nestedBestRanks.length;i++)for(s=e.ranks[i],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(i,o);if(0==a)break}for(t=[],a=[],n=0;n<e.maxRank+1;n++)a[n]=[],t[n]=a[n];for(n=0;n<this.nestedBestRanks.length;n++)for(i=0;i<this.nestedBestRanks[n].length;i++)a[n].push(this.nestedBestRanks[n][i]);e.ranks=t},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var n=e.ranks.length,t=0,a=1;a<n;a++)t+=this.calculateRankCrossing(a,e);return t},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,n){for(var t=0,a=n.ranks[e],i=a.length,s=n.ranks[e-1].length,o=[],r=0;r<i;r++)o[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);o[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<s;c++)if(201207==o[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==o[a][l]&&t++;for(a=0;a<r;a++)for(l=c+1;l<s;l++)201207==o[a][l]&&t++}return t/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,n){for(var t=!0,a=0;t&&a++<10;)for(var i=1==e%2&&1==a%2,s=(t=!1,0);s<n.ranks.length;s++){for(var o=n.ranks[s],r=[],l=0;l<o.length;l++){(b=(f=o[l]).getGeneralPurposeVariable(s))<0&&(b=l),r[b]=f}var d=b=f=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<o.length-1;l++){if(0==l){for(var f=(v=r[l]).getNextLayerConnectedCells(s),b=v.getPreviousLayerConnectedCells(s),A=(m=[],u=[],0);A<f.length;A++)m[A]=f[A].getGeneralPurposeVariable(s+1);for(A=0;A<b.length;A++)u[A]=b[A].getGeneralPurposeVariable(s-1)}else f=d,b=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(s),c=h.getPreviousLayerConnectedCells(s),p=[],g=[],A=0;A<d.length;A++)p[A]=d[A].getGeneralPurposeVariable(s+1);for(A=0;A<c.length;A++)g[A]=c[A].getGeneralPurposeVariable(s-1);var E=0,y=0;for(A=0;A<m.length;A++)for(var S=0;S<p.length;S++)m[A]>p[S]&&E++,m[A]<p[S]&&y++;for(A=0;A<u.length;A++)for(S=0;S<g.length;S++)u[A]>g[S]&&E++,u[A]<g[S]&&y++;(y<E||y==E&&i)&&(d=v.getGeneralPurposeVariable(s),v.setGeneralPurposeVariable(s,h.getGeneralPurposeVariable(s)),h.setGeneralPurposeVariable(s,d),d=f,c=b,p=m,g=u,h=v,i||(t=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,n){var t=0==e%2;if(t)for(var a=n.maxRank-1;0<=a;a--)this.medianRank(a,t);else for(a=1;a<n.maxRank;a++)this.medianRank(a,t)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,n){for(var t=this.nestedBestRanks[e].length,a=[],i=[],s=0;s<t;s++){var o,r,l=this.nestedBestRanks[e][s],d=new MedianCellSorter;d.cell=l,r=n?e+1:e-1,null!=(o=n?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=o.length?(d.medianValue=this.medianValue(o,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),s=0;s<t;s++)null==i[s]&&(l=a.shift().cell).setGeneralPurposeVariable(e,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,n){for(var t=[],a=0,i=0;i<e.length;i++){var s=e[i];t[a++]=s.getGeneralPurposeVariable(n)}return t.sort(function(e,n){return e-n}),1==a%2?t[Math.floor(a/2)]:2==a?(t[0]+t[1])/2:(s=t[(i=a/2)-1]-t[0],a=t[a-1]-t[i],(t[i-1]*a+t[i]*s)/(s+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.medianValue>e.medianValue?-1:n.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var n=this.layout.getModel(),s={},o=mxUtils.clone(n.vertexMapper,null,!0),t=null;if(null!=n.roots){var a=n.roots;t=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);t[e]=n.vertexMapper[i]}}if(n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget),n.connectsAsSource.push(t)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},t,!0,null),t=null,0<o.lenth&&(t=mxUtils.clone(o,null,!0)),e=mxUtils.clone(s,null,!0),n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),n.connectsAsSource.push(t),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},o,!0,e),a=this.layout.getGraph(),null!=t&&0<t.length)for(n=n.roots,e=0;e<t.length;e++)i=t[e].cell,0==a.getIncomingEdges(i).length&&n.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxHierarchicalLayout(e,n,t){mxGraphLayout.call(this,e),this.orientation=null!=n?n:mxConstants.DIRECTION_NORTH,this.deterministic=null==t||t}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,n){this.model=e,this.previous=this.root=n}function mxChildChange(e,n,t,a){this.model=e,this.previous=this.parent=n,this.child=t,this.previousIndex=this.index=a}function mxTerminalChange(e,n,t,a){this.model=e,this.cell=n,this.previous=this.terminal=t,this.source=a}function mxValueChange(e,n,t){this.model=e,this.cell=n,this.previous=this.value=t}function mxStyleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.style=t}function mxGeometryChange(e,n,t){this.model=e,this.cell=n,this.previous=this.geometry=t}function mxCollapseChange(e,n,t){this.model=e,this.cell=n,this.previous=this.collapsed=t}function mxVisibleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.visible=t}function mxCellAttributeChange(e,n,t){this.cell=e,this.attribute=n,this.previous=this.value=t}function mxCell(e,n,t){this.value=e,this.setGeometry(n),this.setStyle(t),null!=this.onInit&&this.onInit()}function mxGeometry(e,n,t,a){mxRectangle.call(this,e,n,t,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var n=0;n<e.ranks.length;n++){mxLog.write("Rank ",n," : ");for(var t=e.ranks[n],a=0;a<t.length;a++)mxLog.write(t[a].getGeneralPurposeVariable(n)," ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var t=0;t<this.maxIterations;t++){if(0!=t&&(this.medianPos(t,e),this.minNode(e)),this.currentXDelta<n){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],s=0;s<i.length;s++){var o=i[s];o.setX(a,o.getGeneralPurposeVariable(a))}n=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],s=0;s<i.length;s++)(o=i[s]).setGeneralPurposeVariable(a,o.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var n=[],t=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var s=0;s<a[i].length;s++){var o=a[i][s];(r=new WeightedCellSorter(o,i)).rankIndex=s,r.visited=!0,n.push(r),t[o=mxCellPath.create(o.getCoreCell())]=r}}for(e=10*n.length,s=0;0<n.length&&s<=e;){i=(r=n.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(o=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=o.length,u=c.length,p=this.medianXValue(o,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),f=h;if(0<v&&(f=(p*m+g*u)/v),m=!1,f<h-1?0==d?(i.setGeneralPurposeVariable(l,f),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<f?(i.setGeneralPurposeVariable(l,f),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<f&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,f),m=!0):f<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,f),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<o.length;i++)l=o[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l))}r.visited=!1,s++}},mxCoordinateAssignment.prototype.medianPos=function(e,n){if(0==e%2)for(var t=n.maxRank;0<t;t--)this.rankMedianPosition(t-1,n,t);else for(t=0;t<n.maxRank-1;t++)this.rankMedianPosition(t+1,n,t)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,n,t){n=n.ranks[e];for(var a=[],i=[],s=0;s<n.length;s++){var o=n[s];a[s]=new WeightedCellSorter,a[s].cell=o,a[s].rankIndex=s;var r=mxCellPath.create(o.getCoreCell());i[r]=a[s];var l=null;l=t<e?o.getPreviousLayerConnectedCells(e):o.getNextLayerConnectedCells(e);a[s].weightedValue=this.calculatedWeightedValue(o,l)}for(a.sort(WeightedCellSorter.prototype.compare),s=0;s<a.length;s++){r=0,o=a[s].cell,r=0,null!=(l=t<e?o.getPreviousLayerConnectedCells(e).slice():o.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,t):o.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[s].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+o.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[s].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-o.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?o.setGeneralPurposeVariable(e,r):r<l?(o.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(o.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[s].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,n){for(var t=0,a=0;a<n.length;a++){var i=n[a];e.isVertex()&&i.isVertex()?t++:t=e.isEdge()&&i.isEdge()?t+8:t+2}return t},mxCoordinateAssignment.prototype.medianXValue=function(e,n){if(0==e.length)return 0;for(var t=[],a=0;a<e.length;a++)t[a]=e[a].getGeneralPurposeVariable(n);return t.sort(function(e,n){return e-n}),1==e.length%2?t[Math.floor(e.length/2)]:(t[(a=e.length/2)-1]+t[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,n){this.calculateWidestRank(e,n);for(var t=this.widestRank;0<=t;t--)t<n.maxRank&&this.rankCoordinates(t,e,n);for(t=this.widestRank+1;t<=n.maxRank;t++)0<t&&this.rankCoordinates(t,e,n)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,n,t){n=t.ranks[e],t=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,s=0;s<n.length;s++){var o=n[s];if(o.isVertex()){var r=this.layout.getVertexBounds(o.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(o.width=r.width,o.height=r.height):(o.width=r.height,o.height=r.width):i=!0,t=Math.max(t,o.height)}else o.isEdge()&&(r=1,null!=o.edges?r=o.edges.length:mxLog.warn("edge.edges is null"),o.width=(r-1)*this.parallelEdgeSpacing);a+=o.width/2,o.setX(e,a),o.setGeneralPurposeVariable(e,a),a+=o.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,n){var t=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=n.maxRank;0<=i;i--){for(var s=0,o=n.ranks[i],r=this.initialX,l=!1,d=0;d<o.length;d++){var c=o[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,s=Math.max(s,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=t,r=s/2+a/2+this.interRankCellSpacing,a=s,t=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?t+r:t-r,d=0;d<o.length;d++)o[d].setY(i,t)}},mxCoordinateAssignment.prototype.minPath=function(e,n){var t,a=n.edgeMapper;for(t in a){var i=a[t];if(!(i.maxRank-i.minRank-1<1)){for(var s=i.getGeneralPurposeVariable(i.minRank+1),o=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){s!=(d=i.getGeneralPurposeVariable(l))?(o=!1,s=d):r++}if(!o){o=s=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,s++):this.repositionValid(n,i,l+1,m)?(d[l-i.minRank-1]=m,s++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,o++):this.repositionValid(n,i,l-1,m)?(c[l-i.minRank-2]=m,o++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<o||r<s)if(s<=o)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(o<s)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,n,t,a){e=e.ranks[t];for(var i=-1,s=0;s<e.length;s++)if(n==e[s]){i=s;break}if(i<0)return!1;if(a<(s=n.getGeneralPurposeVariable(t))){if(0==i)return!0;if(!((t=(t=(e=e[i-1]).getGeneralPurposeVariable(t))+e.width/2+this.intraCellSpacing+n.width/2)<=a))return!1}else if(s<a){if(i==e.length-1)return!0;if(!(a<=(t=(t=(e=e[i+1]).getGeneralPurposeVariable(t))-e.width/2-this.intraCellSpacing-n.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,n){this.rankTopY=[],this.rankBottomY=[];for(var t=0;t<n.ranks.length;t++)this.rankTopY[t]=Number.MAX_VALUE,this.rankBottomY[t]=0;t=null,this.layout.resizeParent&&(t={});var a,i=n.edgeMapper,s=n.vertexMapper;for(a in s){var o=s[a];if(this.setVertexLocation(o),this.layout.resizeParent){o=e.model.getParent(o.cell);var r=mxCellPath.create(o);null==t[r]&&(t[r]=o)}}for(a in this.layout.resizeParent&&null!=t&&this.adjustParents(t),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(n),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var n,t=[];for(n in e)t.push(e[n]);this.layout.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var n=0;n<e.ranks.length;n++)for(var t=e.ranks[n],a=0;a<t.length;a++){var i=t[a];if(i.isVertex())for(var s=i.getPreviousLayerConnectedCells(n),o=n-1,r=0;r<2;r++){if(-1<o&&o<e.ranks.length&&null!=s&&0<s.length){for(var l=[],d=0;d<s.length;d++){var c=new WeightedCellSorter(s[d],s[d].getX(o));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=s=0;for(o=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(s+=p[v].edges.length,u++,o.push(p[v]))}else s+=g.edges.length,u++,o.push(g)}for(i.width>(s+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/s)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<o.length;d++){for(g=o[d].edges.length,v=mxCellPath.create(o[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<s/2?m+=this.prefVertEdgeOff:s/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}s=i.getNextLayerConnectedCells(n),o=n+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var n=0;if(101207!=e.temp[0]){var t=e.maxRank,a=e.minRank;t==a&&(t=e.source.maxRank,a=e.target.minRank);for(var i=0,s=mxCellPath.create(e.edges[0]),o=(s=this.jettyPositions[s],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=o&&(p=!p),null!=s){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[t],h=s[4*i+1+g];p&&(h=-h),v+=h,g=s[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+n;var f=(this.rankTopY[c]+this.rankBottomY[c+1])/2,b=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var A=f;f=b,b=A}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,f)),u.push(new mxPoint(m,b))):(u.push(new mxPoint(f,m)),u.push(new mxPoint(b,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=s&&(g=p?2:0,v=p?this.rankBottomY[t]:this.rankTopY[a],h=s[4*i+3-g],p&&(h=-h),v-=h,g=s[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),n=0==n?this.parallelEdgeSpacing:0<n?-n:-n+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var n=e.cell,t=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(n,t,a):this.layout.setVertexLocation(n,a,t),this.limitX=Math.max(this.limitX,t+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,n){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?-1:n.weightedValue<e.weightedValue?1:n.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.model;if(this.edgesCache={},null!=n||null!=e){if(null!=n&&null!=e){for(var a=[],i=0;i<n.length;i++)t.isAncestor(e,n[i])&&a.push(n[i]);this.roots=a}else this.roots=n;t.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{t.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,n){var t=[];if(null!=e&&null!=n){var a,i=this.graph.model,s=null,o=-1e5;for(a in n){var r=n[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&t.push(r),o<(l=d-c)&&(o=l,s=r)}}0==t.length&&null!=s&&t.push(s)}return t},mxHierarchicalLayout.prototype.getEdges=function(e){var n=mxCellPath.create(e);if(null!=this.edgesCache[n])return this.edgesCache[n];for(var t=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);this.isPort(r)?a=a.concat(t.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(t.getEdges(r,!0,!0)))}for(a=a.concat(t.getEdges(e,!0,!0)),t=[],o=0;o<a.length;o++)((i=this.getVisibleTerminal(a[o],!0))==(s=this.getVisibleTerminal(a[o],!1))||i!=s&&(s==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(s,this.parent,this.traverseAncestors))))&&t.push(a[o]);return this.edgesCache[n]=t},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,n){var t=null!=(t=this.graph.view.getState(e))?t.getVisibleTerminal(n):this.graph.view.getVisibleTerminal(e,n);return this.isPort(t)&&(t=this.graph.model.getParent(t)),t},mxHierarchicalLayout.prototype.run=function(e){var n=[],t=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,s=!0;for(i in a)if(null!=a[i]){s=!1;break}for(;!s;){var o=this.findRoots(e,a);for(s=0;s<o.length;s++){var r=[];n.push(r),this.traverse(o[s],!0,null,t,r,n,a)}for(s=0;s<o.length;s++)this.roots.push(o[s]);for(i in s=!0,a)if(null!=a[i]){s=!1;break}}}else for(s=0;s<roots.length;s++)r=[],n.push(r),traverse(roots.get(s),!0,null,t,r,n,null);for(s=t=0;s<n.length;s++){for(i in a=[],r=n[s])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),t=this.placementStage(t,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,n){var t=this.graph.model;if(t.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(n[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=t.getChildCount(e),i=0;i<a;i++){var s=t.getChildAt(e,i);this.isPort(s)||this.filterDescendants(s,n)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=this.getVisibleTerminal(a[s],!0),r=this.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxHierarchicalLayout.prototype.traverse=function(e,n,t,a,i,s,o){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=o&&null==o[r]){if(null==i[r])for(t=0;t<s.length;t++)if(null!=(e=s[t])[r]){for(l in i)e[l]=i[l];return s.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete o[r];var l=this.getEdges(e);for(t=0;t<l.length;t++)r=this.getVisibleTerminal(l[t],!0)==e,(!n||r)&&(r=this.getVisibleTerminal(l[t],!r),i=this.traverse(r,n,l[t],a,i,s,o))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,n){var t=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return t.fineTuning=this.fineTuning,t.execute(n),t.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,n){var t=null;if(null!=e){t=[];for(var a=0;a<e.length;a++)n(e[a])&&t.push(e[a])}return t},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,n){var t=[];n=n||this.getRoot(),(null==e||e(n))&&t.push(n);for(var a=this.getChildCount(n),i=0;i<a;i++){var s=this.getChildAt(n,i);t=t.concat(this.filterDescendants(e,s))}return t},mxGraphModel.prototype.getRoot=function(e){var n=e||this.root;if(null!=e)for(;null!=e;)n=e,e=this.getParent(e);return n},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var n=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),n},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,n){for(;null!=n&&n!=e;)n=this.getParent(n);return n==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,n,t){if(n!=e&&null!=e&&null!=n){null==t&&(t=this.getChildCount(e));var a=e!=this.getParent(n);this.execute(new mxChildChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParents(n)}return n},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((n=this.getCell(e.getId()))!=e){for(;null!=n;)e.setId(this.createId(e)),n=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var n=this.getChildCount(e),t=0;t<n;t++)this.cellAdded(this.getChildAt(e,t))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,n){n=n||this.getRoot(e);for(var t=this.getChildCount(e),a=0;a<t;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,n)}for(i=this.getEdgeCount(e),t=[],a=0;a<i;a++)t.push(this.getEdgeAt(e,a));for(a=0;a<t.length;a++)i=t[a],this.isAncestor(n,i)&&this.updateEdgeParent(i,n)},mxGraphModel.prototype.updateEdgeParent=function(e,n){for(var t=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=t&&!this.isEdge(t)&&null!=t.geometry&&t.geometry.relative;)t=this.getParent(t);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(n,t)&&this.isAncestor(n,a)&&(null!=(i=t==a?this.getParent(t):this.getNearestCommonAncestor(t,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(t=this.getGeometry(e))){var s=this.getOrigin(this.getParent(e)),o=this.getOrigin(i);a=o.x-s.x,s=o.y-s.y;(t=t.clone()).translate(-a,-s),this.setGeometry(e,t)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var n=null;return null!=e?(n=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(n.x+=e.x,n.y+=e.y)):n=new mxPoint,n},mxGraphModel.prototype.getNearestCommonAncestor=function(e,n){if(null!=e&&null!=n&&(null!=(s=mxCellPath.create(n))&&0<s.length)){var t=e,a=mxCellPath.create(t);if(s.length<a.length){t=n;var i=a,s=(a=s,i)}for(;null!=t;){if(i=this.getParent(t),0==s.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return t;a=mxCellPath.getParentPath(a),t=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var n=this.getChildCount(e)-1;0<=n;n--)this.cellRemoved(this.getChildAt(e,n));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,n,t){var a=this.getParent(e);return null!=n?(n!=a||a.getIndex(e)!=t)&&n.insert(e,t):null!=a&&(t=a.getIndex(e),a.remove(t)),this.contains(a)||null==n?null==n&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,n){return null!=e?e.getChildAt(n):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,n,t){n=null!=n&&n,t=null!=t&&t;for(var a=this.getChildCount(e),i=[],s=0;s<a;s++){var o=this.getChildAt(e,s);(!t&&!n||t&&this.isEdge(o)||n&&this.isVertex(o))&&i.push(o)}return i},mxGraphModel.prototype.getTerminal=function(e,n){return null!=e?e.getTerminal(n):null},mxGraphModel.prototype.setTerminal=function(e,n,t){var a=n!=this.getTerminal(e,t);return this.execute(new mxTerminalChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),n},mxGraphModel.prototype.setTerminals=function(e,n,t){this.beginUpdate();try{this.setTerminal(e,n,!0),this.setTerminal(e,t,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,n,t){var a=this.getTerminal(e,t);return null!=n?n.insertEdge(e,t):null!=a&&a.removeEdge(e,t),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,n){return null!=e?e.getEdgeAt(n):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,n,t){for(var a=0,i=this.getEdgeCount(e),s=0;s<i;s++){var o=this.getEdgeAt(e,s);o!=t&&this.getTerminal(o,n)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,n,t,a){n=null==n||n,t=null==t||t,a=null==a||a;for(var i=this.getEdgeCount(e),s=[],o=0;o<i;o++){var r=this.getEdgeAt(e,o),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(n&&d==e||t&&l==e))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;var a=this.getEdgeCount(e),i=this.getEdgeCount(n),s=e,o=a;for(i<a&&(o=i,s=n),a=[],i=0;i<o;i++){var r=this.getEdgeAt(s,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==n||!t&&(d==e&&l==n))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[];if(null!=e)for(var s=0;s<e.length;s++){var o=this.getTerminal(e[s],!0),r=this.getTerminal(e[s],!1);o==n&&null!=r&&r!=n&&a?i.push(r):r==n&&null!=o&&o!=n&&t&&i.push(o)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var n=[],t=0;t<e.length;t++){for(var a=e[t],i=!0,s=this.getParent(a);null!=s;){if(0<=mxUtils.indexOf(e,s)){i=!1;break}s=this.getParent(s)}i&&n.push(a)}return n},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,n){return this.execute(new mxValueChange(this,e,n)),n},mxGraphModel.prototype.valueForCellChanged=function(e,n){return e.valueChanged(n)},mxGraphModel.prototype.getGeometry=function(e,n){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,n){return n!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,n)),n},mxGraphModel.prototype.geometryForCellChanged=function(e,n){var t=this.getGeometry(e);return e.setGeometry(n),t},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,n){return n!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,n)),n},mxGraphModel.prototype.styleForCellChanged=function(e,n){var t=this.getStyle(e);return e.setStyle(n),t},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,n){return n!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,n)),n},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,n){var t=this.isCollapsed(e);return e.setCollapsed(n),t},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,n){return n!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,n)),n},mxGraphModel.prototype.visibleStateForCellChanged=function(e,n){var t=this.isVisible(e);return e.setVisible(n),t},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,n,t){t=null==t||t,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,n,t,a),a){var s=a[i],o=this.getTerminal(s,!0);null!=o&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,n,t,a){this.beginUpdate();try{for(var i=e.getChildCount(),s=0;s<i;s++){var o=e.getChildAt(s);if("function"==typeof o.getId){var r=o.getId(),l=null==r||this.isEdge(o)&&t?null:this.getCell(r);if(null==l){var d=o.clone();d.setId(r),d.setTerminal(o.getTerminal(!0),!0),d.setTerminal(o.getTerminal(!1),!1),l=n.insert(d),this.cellAdded(l)}a[mxCellPath.create(o)]=l,this.mergeChildrenImpl(o,l,t,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var n=[];if(null!=e)for(var t={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var s=mxCellPath.create(i);null==t[s]&&(t[s]=i,n.push(i))}}return n},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,n){for(var t={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],t,n)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],t);return a},mxGraphModel.prototype.cloneCellImpl=function(e,n,t){var a=this.cellCloned(e);if(n[mxObjectIdentity.get(e)]=a,t){t=this.getChildCount(e);for(var i=0;i<t;i++){var s=this.cloneCellImpl(this.getChildAt(e,i),n,!0);a.insert(s)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,n,t){null!=(a=this.getTerminal(n,!0))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(n,!1))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(n,i),t)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),n=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=n},mxChildChange.prototype.connect=function(e,n){n=null==n||n;var t=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=t&&(n?this.model.terminalForCellChanged(e,t,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(n?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(t,!0),e.setTerminal(a,!1),t=this.model.getChildCount(e),a=0;a<t;a++)this.connect(this.model.getChildAt(e,a),n)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var n=this.getValue();return this.setValue(e),n},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,n){return n?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,n){return null!=e&&(null==n&&(n=this.getChildCount(),e.getParent()==this&&n--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(n,0,e)),e},mxCell.prototype.remove=function(e){var n=null;return null!=this.children&&0<=e&&(null!=(n=this.getChildAt(e))&&(this.children.splice(e,1),n.setParent(null))),n},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,n){return null!=e&&(e.removeFromTerminal(n),e.setTerminal(this,n),null==this.edges||e.getTerminal(!n)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,n){if(null!=e){if(e.getTerminal(!n)!=this&&null!=this.edges){var t=this.getEdgeIndex(e);0<=t&&this.edges.splice(t,1)}e.setTerminal(null,n)}return e},mxCell.prototype.removeFromTerminal=function(e){var n=this.getTerminal(e);null!=n&&n.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,n){var t=this.getValue();return(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT?t.getAttribute(e):null)||n},mxCell.prototype.setAttribute=function(e,n){var t=this.getValue();null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT&&t.setAttribute(e,n)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,n){return n?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,n){if(this.clone(),this.relative||(this.x+=e,this.y+=n),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=n),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=n),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var t=this.points.length,a=0;a<t;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=n)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var n="";if(null!=e)for(var t=e.getParent();null!=t;)n=t.getIndex(e)+mxCellPath.PATH_SEPARATOR+n,t=(e=t).getParent();return 1<(e=n.length)&&(n=n.substring(0,e-1)),n},getParentPath:function(e){if(null!=e){var n=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=n)return e.substring(0,n);if(0<e.length)return""}return null},resolve:function(e,n){var t=e;if(null!=n)for(var a=n.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)t=t.getChildAt(parseInt(a[i]));return t},compare:function(e,n){for(var t=Math.min(e.length,n.length),a=0,i=0;i<t;i++)if(e[i]!=n[i]){a=0==e[i].length||0==n[i].length?e[i]==n[i]?0:e[i]>n[i]?1:-1:(t=parseInt(e[i]))==(i=parseInt(n[i]))?0:i<t?1:-1;break}return 0==a&&((t=e.length)!=(i=n.length)&&(a=i<t?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,n,t,a){n=e.getCenterX();var i=e.getCenterY(),s=Math.atan2(t.y-i,t.x-n),o=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-s,d=Math.atan2(e.height,e.width);return s<-r+d||r-d<s?(o.x=e.x,o.y=i-e.width*Math.tan(s)/2):s<-d?(o.y=e.y,o.x=n-e.height*Math.tan(l)/2):s<d?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(s)/2):(o.y=e.y+e.height,o.x=n+e.height*Math.tan(l)/2),a&&(t.x>=e.x&&t.x<=e.x+e.width?o.x=t.x:t.y>=e.y&&t.y<=e.y+e.height&&(o.y=t.y),t.x<e.x?o.x=e.x:t.x>e.x+e.width&&(o.x=e.x+e.width),t.y<e.y?o.y=e.y:t.y>e.y+e.height&&(o.y=e.y+e.height)),o},EllipsePerimeter:function(e,n,t,a){var i=e.x,s=e.y,o=e.width/2,r=e.height/2,l=i+o,d=s+r;n=t.x,t=t.y;var c=parseInt(n-l),m=parseInt(t-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(n,t);if(a){if(s<=t&&t<=s+e.height)return e=t-d,e=Math.sqrt(o*o*(1-e*e/(r*r)))||0,n<=i&&(e=-e),new mxPoint(l+e,t);if(i<=n&&n<=i+e.width)return e=n-l,e=Math.sqrt(r*r*(1-e*e/(o*o)))||0,t<=s&&(e=-e),new mxPoint(n,d+e)}return d-=(i=m/c)*l,l=i*(o=(-(e=-2*l*(s=o*o*i*i+r*r))+(r=Math.sqrt(e*e-4*s*(o*o*i*i*l*l+r*r*l*l-o*o*r*r))))/(2*s))+d,d=i*(r=(-e-r)/(2*s))+d,i=Math.sqrt(Math.pow(o-n,2)+Math.pow(l-t,2)),n=Math.sqrt(Math.pow(r-n,2)+Math.pow(d-t,2)),s=t=0,s=i<n?(t=o,l):(t=r,d),new mxPoint(t,s)},RhombusPerimeter:function(e,n,t,a){n=e.x;var i=e.y,s=e.width,o=n+s/2,r=i+(e=e.height)/2,l=t.x;if(t=t.y,o==l)return new mxPoint(o,t<r?i:i+e);if(r==t)return new mxPoint(l<o?n:n+s,r);var d=o,c=r;return a&&(n<=l&&l<=n+s?d=l:i<=t&&t<=i+e&&(c=t)),l<o?t<r?mxUtils.intersection(l,t,d,c,o,i,n,r):mxUtils.intersection(l,t,d,c,o,i+e,n,r):t<r?mxUtils.intersection(l,t,d,c,o,i,n+s,r):mxUtils.intersection(l,t,d,c,o,i+e,n+s,r)},TrianglePerimeter:function(e,n,t,a){var i=(n=null!=n?n.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH,s=e.x,o=e.y,r=e.width,l=s+r/2,d=o+(e=e.height)/2,c=new mxPoint(s,o),m=new mxPoint(s+r,d),u=new mxPoint(s,o+e);n==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,o),u=new mxPoint(s+r,o+e)):n==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,o+e),u=new mxPoint(s+r,o)):n==mxConstants.DIRECTION_WEST&&(c=new mxPoint(s+r,o),m=new mxPoint(s,d),u=new mxPoint(s+r,o+e));var p=t.x-l,g=t.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return null==(v=g?a&&(i&&t.x>=c.x&&t.x<=u.x||!i&&t.y>=c.y&&t.y<=u.y)?i?new mxPoint(t.x,c.y):new mxPoint(c.x,t.y):n==mxConstants.DIRECTION_NORTH?new mxPoint(s+r/2+e*Math.tan(p)/2,o+e):n==mxConstants.DIRECTION_SOUTH?new mxPoint(s+r/2-e*Math.tan(p)/2,o):n==mxConstants.DIRECTION_WEST?new mxPoint(s+r,o+e/2+r*Math.tan(p)/2):new mxPoint(s,o+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),t.y>=o&&t.y<=o+e?(a.x=i?l:n==mxConstants.DIRECTION_WEST?s+r:s,a.y=t.y):t.x>=s&&t.x<=s+r&&(a.x=t.x,a.y=i?n==mxConstants.DIRECTION_NORTH?o+e:o:d),l=a.x,d=a.y),i&&t.x<=s+r/2||!i&&t.y<=o+e/2?mxUtils.intersection(t.x,t.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(t.x,t.y,l,d,m.x,m.y,u.x,u.y)))&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,n,t,a,i,s,o,r,l){this.graph=e,this.scale=null!=n?n:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=t?t:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,n,t){this.view=e,this.cell=n,this.style=t,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,n,t){this.selectionModel=e,this.added=null!=n?n.slice():null,this.removed=null!=t?t.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var n=this.graph.cellRenderer.initializeOverlay,t=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,n){n.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var s=this.graph.getGraphBounds().clone(),o=this.graph.getView().getScale(),r=o/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,s.width+=s.x,s.height+=s.y,s.x=0,this.border=s.y=0),s.width/=r,s.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((s.width+this.x0)/d)),u=Math.max(1,Math.ceil((s.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var n=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){n()}),mxEvent.addListener(this.wnd,"resize",function(e){n()})}}});if(e=function(e,n){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",n&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),n){var t=a.createElement("hr");t.className="mxPageBreak",a.body.appendChild(t)}},null!=(f=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<f.length;g++)e(f[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(s.y-l.y*o)/o,f=0;f<m;f++){if(null==this.wnd)return null;var b=f*d/this.scale-this.x0/this.scale+(s.x-l.x*o)/o,A=g*m+f+1;(t=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-b,-h,this.scale,A,e)}))).setAttribute("id","mxPage-"+A),e(t,null!=v||g<u-1||f<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)}finally{this.graph.cellRenderer.initializeOverlay=n}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,n){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln(" table.mxPageSelector { display: none; }"),e.writeln(" hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln(" body.mxPage { background: gray; }"),e.writeln("}"),null!=n&&e.writeln(n),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,n){var t=this.wnd.document,a=t.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=t.createElement("tbody"),s=0;s<e;s++){for(var o=t.createElement("tr"),r=0;r<n;r++){var l=s*n+r+1,d=t.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=t.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,t),d.appendChild(c)}else mxUtils.write(d,l,t);o.appendChild(d)}i.appendChild(o)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,n,t){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=n+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=n-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),t(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,n,t,a,i){a=this.graph.getView();var s=this.graph.container;this.graph.container=i;var o=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,n),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,t,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(t=i.firstChild;null!=t;)p=t.nextSibling,"svg"==(n=t.nodeName.toLowerCase())?(t.setAttribute("width",parseInt(i.style.width)),t.setAttribute("height",parseInt(i.style.height))):"default"!=t.style.cursor&&"table"!=n&&t.parentNode.removeChild(t),t=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=s,a.canvas=o,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,n){this.styles[e]=n},mxStylesheet.prototype.getCellStyle=function(e,n){var t=n;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(t=null!=t&&";"!=e.charAt(0)?mxUtils.clone(t):{},0);i<a.length;i++){var s=(o=a[i]).indexOf("=");if(0<=s){var o,r=o.substring(0,s);(o=o.substring(s+1))==mxConstants.NONE?delete t[r]:mxUtils.isNumeric(o)?t[r]=parseFloat(o):t[r]=o}else if(null!=(o=this.styles[o]))for(r in o)t[r]=o[r]}return t},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,n){if(e=e||0,n=null!=n?n:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var t=this.shape.stencil.computeAspect(this.style,n.x,n.y,n.width,n.height);n.x=t.x,n.y=t.y,n.width=this.shape.stencil.w0*t.width,n.height=this.shape.stencil.h0*t.height}return 0!=e&&n.grow(e),n},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,n){n?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,n){n?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var n=0;n<this.absolutePoints.length;n++)e.absolutePoints[n]=this.absolutePoints[n].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var n=[],t=0;t<e.length;t++)this.graph.isCellSelectable(e[t])&&n.push(e[t]);this.changeSelection(n,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var n=0;n<e.length;n++)if(this.graph.isCellSelectable(e[n]))return e[n];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var n=null;this.singleSelection&&(n=this.cells,e=[this.getFirstSelectableCell(e)]);for(var t=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&t.push(e[a]);this.changeSelection(t,n)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var n=[],t=0;t<e.length;t++)this.isSelected(e[t])&&n.push(e[t]);this.changeSelection(null,n)}},mxGraphSelectionModel.prototype.changeSelection=function(e,n){if(null!=e&&0<e.length&&null!=e[0]||null!=n&&0<n.length&&null!=n[0]){var t=new mxSelectionChange(this,e,n);t.execute();var a=new mxUndoableEdit(this,!1);a.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var n=0;n<this.removed.length;n++)this.selectionModel.cellRemoved(this.removed[n]);if(null!=this.added)for(n=0;n<this.added.length;n++)this.selectionModel.cellAdded(this.added[n]);n=this.added,this.added=this.removed,this.removed=n,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),n=this.graph.isLabelClipped(e.cell),t=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+=" "),a=mxUtils.htmlEntities(a,!1),t?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g," "),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);n&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var s=null!=e.text?e.text.margin:null;null==s&&(s=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getAlignmentAsPoint(s,e)),null!=s&&(!n&&t||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-s.x*this.bounds.width+s.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-s.y*this.bounds.height+s.y*i)+4)+"px"),!n&&t||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,n){null==this.textarea&&this.init(),this.stopEditing(!0);var t=this.graph.getView().getState(e);if(null!=t){this.editingCell=e,this.trigger=n,(this.textNode=null)!=t.text&&this.isHideLabel(t)&&(this.textNode=t.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),s=mxUtils.getValue(t.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.color=s,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(t),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(t=this.getInitialValue(t,n))||0==t.length?(t=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=t,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),n=e.style;return n.position="absolute",n.whiteSpace="nowrap",n.visibility="hidden",n.display=mxClient.IS_QUIRKS?"inline":"inline-block",n.zoom="1",n.verticalAlign="top",n.lineHeight=this.textarea.style.lineHeight,n.fontSize=this.textarea.style.fontSize,n.fontFamily=this.textarea.style.fontFamily,n.fontWeight=this.textarea.style.fontWeight,n.textAlign=this.textarea.style.textAlign,n.fontStyle=this.textarea.style.fontStyle,n.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,n){return this.graph.getEditingValue(e.cell,n)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var n=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*n+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var n=this.graph.getModel().isEdge(e.cell),t=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,s=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*t,o=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*t+s,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*t+s,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*t+s;t=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*t+s,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-t-r),Math.max(i,e.height-o-l));return n?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=t,r.y+=o,null!=e.text&&null!=e.text.boundingBox&&(n?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,n){mxCellRenderer.prototype.defaultShapes[e]=n},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,n){var t=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(t.isVertex(e.cell)||t.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=n&&!n||(this.initializeShape(e),e.view.graph.ordered||t.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,n){for(var t=null,a=e.view.graph,i=a.getModel(),s=e.cell,o=i.getParent(s);null!=o&&null==t;)t=this.findPreviousStateInContainer(a,o,s,n),s=o,o=i.getParent(s);return t},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,n,t,a){var i=null,s=e.getModel();for(t=null!=t?n.getIndex(t)-1:s.getChildCount(n)-1;0<=t&&null==i;t--)i=this.findPreviousStateInContainer(e,s.getChildAt(n,t),null,a);return null!=i||(null==(i=e.view.getState(n))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var n=e.shape.node.parentNode,t=this.getPreviousStateInContainer(e,n),a=n.firstChild;null!=t&&(a=t.shape.node,null!=t.text&&null!=t.text.node&&t.text.node.parentNode==n&&(a=t.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var n=(t=e.view).graph.getModel();if(t.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(t.graph.keepEdgesInBackground){var t,a=e.shape.node,i=a.parentNode;n=n.getParent(e.cell);null!=(i=null!=(t=t.getState(n))&&null!=t.shape&&null!=t.shape.node?t.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,n){e.shape.node.parentNode.insertBefore(e.shape.node,n),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var n=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=n?e.shape=new mxShape(n):(n=this.getShapeConstructor(e),e.shape=new n),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var n=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==n&&(n=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),n},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,n,t){var a=e.shape[n],i=e.view.graph,s=null;"inherit"==a?s=i.model.getParent(e.cell):"swimlane"==a?(s=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,s=i.getSwimlane(s),t=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[n]=e.shape.indicatorColor),null!=s&&(a=i.getView().getState(s),(e.shape[n]=null)!=a&&(e.shape[n]=null!=a.shape&&"indicatorColor"!=n?a.shape[n]:a.style[t]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var a=t.view.graph;if(a.getModel().isEdge(t.cell),0<t.style[mxConstants.STYLE_FONTSIZE]||null==t.style[mxConstants.STYLE_FONTSIZE]){var n=a.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(t.cell)&&a.isHtmlLabel(t.cell),a.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING]),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.state=t,this.initializeLabel(t);var i=!1,s=function(e){var n=t;return(mxClient.IS_TOUCH||i)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),i=!1)})),mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.dblClick(e,t.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var n=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(n.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var n=e.view.graph.getCellOverlays(e.cell),t=null;if(null!=n){t=new mxDictionary;for(var a=0;a<n.length;a++){var i=null!=e.overlays?e.overlays.remove(n[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,n[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=n[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,n[a],i),null!=n[a].cursor&&(i.node.style.cursor=n[a].cursor)),t.put(n[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,n){n.destroy()}),e.overlays=t},mxCellRenderer.prototype.initializeOverlay=function(e,n){n.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(n,t,e){var a=n.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))})},mxCellRenderer.prototype.createControl=function(t){var a=t.view.graph,e=a.getFoldingImage(t);if(a.foldingEnabled&&null!=e){if(null==t.control){var n=new mxRectangle(0,0,e.width,e.height);t.control=new mxImageShape(n,e.src),t.control.preserveImageAspect=!1,t.control.dialect=a.dialect,this.initControl(t,t.control,!0,function(e){if(a.isEnabled()){var n=!a.isCellCollapsed(t.cell);a.foldCells(n,!1,[t.cell]),mxEvent.consume(e)}})}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.initControl=function(n,e,t,a){var i=n.view.graph;return i.isHtmlLabel(n.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(n.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),t&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,n){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,n){return!0},mxCellRenderer.prototype.installListeners=function(t){var a=t.view.graph,n=function(e){var n=t;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n},i=!1;mxEvent.addListener(t.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}));var s=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(t.shape.node,s,mxUtils.bind(this,function(e){i=!1,"gestureend"==s?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(t,e),mxEvent.consume(e))):this.isShapeEvent(t,e)&&(a.dblClick(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,n){var t=this.getLabelValue(e);if(null==e.text&&null!=t&&(mxUtils.isNode(t)||0<t.length)?this.createLabel(e,t):null==e.text||null!=t&&0!=t.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),s=this.getLabelBounds(e);!n&&e.text.value==t&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(s)||(e.text.value=t,e.text.bounds=s,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var n=e.view.graph,t=e.view.scale,a=n.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*t,i.y+=a.y*t,null!=(n=n.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*n.width*t-e.text.spacingLeft*t-e.text.spacingRight*t),i.height=Math.max(0,e.text.margin.y*n.height*t-e.text.spacingTop*t-e.text.spacingBottom*t))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),n.isSwimlane(e.cell)&&(0<(n=n.getStartSize(e.cell)).width?(a=Math.min(i.width,n.width*t),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<n.height&&(a=Math.min(i.height,n.height*t),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,n){if(e.text.isPaintBoundsInverted()){var t=(e.width-e.height)/2;n.x+=t,n.y-=t,t=n.width,n.width=n.height,n.height=t}if(n.x-=e.text.margin.x*n.width,n.y-=e.text.margin.y*n.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){t=e.view.scale;var a=e.text.getSpacing();n.x+=a.x*t,n.y+=a.y*t,n.width=Math.max(0,n.width-e.text.spacingLeft*t-e.text.spacingRight*t),n.height=Math.max(0,n.height-e.text.spacingTop*t-e.text.spacingBottom*t)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(t=e.getCenterX(),a=e.getCenterY(),n.x!=t||n.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(i),Math.sin(i),new mxPoint(t,a)),n.x=pt.x,n.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(s,o){if(this.createCellOverlays(s),null!=s.overlays){var r=mxUtils.mod(mxUtils.getValue(s.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);s.overlays.visit(function(e,n){var t=n.overlay.getBounds(s);if(!s.view.graph.getModel().isEdge(s.cell)&&null!=s.shape&&0!=r){var a=t.getCenterX(),i=t.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(s.getCenterX(),s.getCenterY()))).x,i=i.y;t.x=Math.round(a-t.width/2),t.y=Math.round(i-t.height/2)}!o&&null!=n.bounds&&n.scale==s.view.scale&&n.bounds.equals(t)||(n.bounds=t,n.scale=s.view.scale,n.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,n){if(null!=e.control){var t=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!n&&e.control.scale==i&&e.control.bounds.equals(t)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=t,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null==e.control)return null;var n=e.control.scale,t=e.control.bounds.width/n,a=(n=e.control.bounds.height/n,e.view.scale),i=e.getCenterX(),s=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+t*a,s=e.y+n*a,null!=e.shape)){var o=e.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,s=s-r}0!=o&&(r=mxUtils.toRadians(o),o=Math.cos(r),r=Math.sin(r),i=(s=mxUtils.getRotatedPoint(new mxPoint(i,s),o,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,s=s.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-t/2*a),Math.round(s-n/2*a),Math.round(t*a),Math.round(n*a))},mxCellRenderer.prototype.redraw=function(e,n,t){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=n&&n,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),n=!0),delete e.invalidOrder,delete e.orderChanged,!n&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==t||t?e.shape.redraw():e.shape.updateBoundingBox()),(null==t||t)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,n){n.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,n,t,a,i){var s=e.view,o=s.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(n=new mxCellState).x=r.x,n.y=r.y;else{if(null==n)return;var c=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=o.getCellGeometry(n.cell)).relative?d=r.x<=.5:null!=t&&(d=t.x+t.width<n.x)}r=!0,null!=l?((t=new mxCellState).x=l.x,t.y=l.y):null!=t&&((c=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=o.getCellGeometry(t.cell)).relative?r=e.x<=.5:null!=n&&(r=n.x+n.width<t.x)),null!=n&&null!=t&&(e=d?n.x:n.x+n.width,n=s.getRoutingCenterY(n),o=r?t.x:t.x+t.width,t=s.getRoutingCenterY(t),s=new mxPoint(e+(d?-a:a),n),l=new mxPoint(o+(r?-a:a),t),d==r?(a=d?Math.min(e,o)-a:Math.max(e,o)+a,i.push(new mxPoint(a,n)),i.push(new mxPoint(a,t))):(s.x<l.x==d?(a=n+(t-n)/2,i.push(s),i.push(new mxPoint(s.x,a)),i.push(new mxPoint(l.x,a))):i.push(s),i.push(l)))},Loop:function(e,n,t,a,i){if(null!=n){var s=(t=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=t.transformControlPoint(e,a),mxUtils.contains(n,a.x,a.y)&&(a=null));var o=0,r=0,l=0,d=0;s=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,s.gridSize)*t.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(o=t.getRoutingCenterX(n),r=s):(l=t.getRoutingCenterY(n),d=s),null==a||a.x<n.x||a.x>n.x+n.width?null!=a?(o=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=n.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=n.y+n.height+2*r:o=e==mxConstants.DIRECTION_EAST?n.x-2*d:n.x+n.width+2*d:null!=a&&(o=t.getRoutingCenterX(n),r=Math.max(Math.abs(o-a.x),d),l=a.y,d=0),i.push(new mxPoint(o-r,l-d)),i.push(new mxPoint(o+r,l+d))}},ElbowConnector:function(e,n,t,a,i){var s=null!=a&&0<a.length?a[0]:null,o=!1,r=!1;if(null!=n&&null!=t)if(null!=s){var l=Math.min(n.x,t.x),d=Math.max(n.x+n.width,t.x+t.width),c=(r=Math.min(n.y,t.y),Math.max(n.y+n.height,t.y+t.height));o=(s=e.view.transformControlPoint(e,s)).y<r||s.y>c,r=s.x<l||s.x>d}else(o=(l=Math.max(n.x,t.x))==(d=Math.min(n.x+n.width,t.x+t.width)))||(r=(r=Math.max(n.y,t.y))==(c=Math.min(n.y+n.height,t.y+t.height)));r||!o&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,n,t,a,i):mxEdgeStyle.TopToBottom(e,n,t,a,i)},SideToSide:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(e=Math.max(n.x,t.x),o=Math.min(n.x+n.width,t.x+t.width),e=null!=a?a.x:o+(e-o)/2,o=s.getRoutingCenterY(n),s=s.getRoutingCenterY(t),null!=a&&(a.y>=n.y&&a.y<=n.y+n.height&&(o=a.y),a.y>=t.y&&a.y<=t.y+t.height&&(s=a.y)),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),!mxUtils.contains(t,e,s)&&!mxUtils.contains(n,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a?!mxUtils.contains(t,e,a.y)&&!mxUtils.contains(n,e,a.y)&&i.push(new mxPoint(e,a.y)):(s=Math.max(n.y,t.y),n=Math.min(n.y+n.height,t.y+t.height),i.push(new mxPoint(e,s+(n-s)/2)))))},TopToBottom:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(o=Math.max(n.y,t.y),r=Math.min(n.y+n.height,t.y+t.height),e=s.getRoutingCenterX(n),null!=a&&a.x>=n.x&&a.x<=n.x+n.width&&(e=a.x),o=null!=a?a.y:r+(o-r)/2,!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),e=null!=a&&a.x>=t.x&&a.x<=t.x+t.width?a.x:s.getRoutingCenterX(t),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(t,a.x,o)&&!mxUtils.contains(n,a.x,o)&&i.push(new mxPoint(a.x,o)):(s=Math.max(n.x,t.x),n=Math.min(n.x+n.width,t.x+t.width),i.push(new mxPoint(s+(n-s)/2,o)))))},SegmentConnector:function(e,n,t,a,i){var s=e.absolutePoints,o=!0,r=null,l=s[0];null==l&&null!=n?l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n)):null!=l&&(l=l.clone());var d=s.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=n,m=s[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,f=null!=m&&m.y==u.y,b=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=f||null==m&&b,p=h||null==m&&c;if(null!=m&&!f&&!h&&(b||c)){o=!b;break}if(p||u){o=u,1==v&&(o=0==a.length%2?u:p);break}c=t,m=s[d],u=e.view.transformControlPoint(e,a[g-1])}for(o&&(null!=s[0]&&s[0].y!=r.y||null==s[0]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[0]&&s[0].x!=r.x||null==s[0]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),o?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)o=!o,r=e.view.transformControlPoint(e,a[v]),o?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,o=!0;if(null==(l=s[d])&&null!=t&&(l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t))),o&&(null!=s[d]&&s[d].y!=r.y||null==s[d]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[d]&&s[d].x!=r.x||null==s[d]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),null==s[0]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[1].x,i[1].y);)i=i.splice(1,1);if(null==s[d]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,n,t,a,i){var s=e.view.graph,o=null!=n&&s.getModel().isEdge(n.cell);s=null!=t&&s.getModel().isEdge(t.cell);if(null!=a&&0<a.length||o||s)mxEdgeStyle.SegmentConnector(e,n,t,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=n?n.x:r.x;o=null!=n?n.y:r.y;var d=null!=n?n.width:1,c=null!=n?n.height:1,m=null!=t?t.x:l.x,u=null!=t?t.y:l.y,p=null!=t?t.width:1,g=null!=t?t.height:1,v=(s=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=n&&(v[0]=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=t&&(v[1]=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,o,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-s,mxEdgeStyle.limits[d][2]=a[d][1]-s,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+s,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+s;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(o=0)?o=c<0?2:1:c<=0&&(o=3,0==d&&(o=2)),(c=null)!=n&&(c=r),n=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(n[d][0]=(c.x-a[d][0])/a[d][2],n[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<n[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),n[d][1]=(c.y-a[d][1])/a[d][3],n[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<n[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=t&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*s,0),t=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*s<m&&2*s<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*s<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*s<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),t[d]=u[d][0]&v[d],t[d]|=(u[d][1]&v[d])<<8,t[d]|=(u[1-d][d]&v[d])<<16,t[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&t[d])&&(t[d]<<=8),0==(3840&t[d])&&(t[d]=15&t[d]|t[d]>>8),0==(983040&t[d])&&(t[d]=65535&t[d]|(251658240&t[d])>>8),e[d]=15&t[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=o)<1&&(d+=4),(v-=o)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+s;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=s}for(r=t=(s=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=o)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=t&&(s++,mxEdgeStyle.wayPoints1[s][0]=mxEdgeStyle.wayPoints1[s-1][0],mxEdgeStyle.wayPoints1[s][1]=mxEdgeStyle.wayPoints1[s-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<o)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+n[p][0]*a[p][2]:u?a[p][1]+n[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[s][0])*c[0])&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[s][1])*c[1])&&(mxEdgeStyle.wayPoints1[s][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[s][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<s&&mxEdgeStyle.wayPoints1[s][l]==mxEdgeStyle.wayPoints1[s-1][l]?s--:t=l}for(d=0;d<=s&&(d!=s||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(s+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,n,t,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=n)<1&&(i+=4),(e-=n)<1&&(e+=4),n=routePatterns[i-1][e-1],0!=t&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(n=inlineRoutePatterns[i-1][e-1]),n}},mxStyleRegistry={values:[],putValue:function(e,n){mxStyleRegistry.values[e]=n},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var n in mxStyleRegistry.values)if(mxStyleRegistry.values[n]==e)return n;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,n){if(this.view=e,this.previous=this.root=n,this.isUp=null==n,!this.isUp)for(var t=this.view.currentRoot,a=this.view.graph.getModel();null!=t;){if(t==n){this.isUp=!0;break}t=a.getParent(t)}}function mxGraph(e,n,t,a){this.mouseListeners=null,this.renderHint=t,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:t==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:t==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:t==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=n?n:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,n){this.graphModelChanged(n.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,n,t,a,i,s){this.image=e,this.tooltip=n,this.align=null!=t?t:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(e,n){this.source=e,null!=n&&this.init(n)}function mxMultiplicity(e,n,t,a,i,s,o,r,l,d){this.source=e,this.type=n,this.attr=t,this.value=a,this.min=null!=i?i:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.beforeUndo(n.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsMoved(n.getProperty("cells"),n.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,n,t,a){this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.shiftRightwards=null==n||n,this.shiftDownwards=null==t||t,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,n,t,a){this.horizontal=null==n||n,this.addEnabled=null==t||t,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(n.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,n,t){if(this.view=e,n=null!=n?n:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(n),null!=t){n=e.createState(new mxCell);for(var a=0;a<t.length;a++)e.validateBounds(n,t[a]);var i=null;for(a=0;a<t.length;a++){var s=e.validatePoints(n,t[a]);null==i?i=s:i.add(s)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,n){this.point=e,this.perimeter=null==n||n}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,n){null!=e&&(this.graph=e,this.factoryMethod=n,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,n,t,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?t:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,n){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=n,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,n){null!=e&&(this.graph=e,this.target=n||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,n){null!=e&&(this.graph=e,this.delay=n||500,this.graph.addMouseListener(this))}function mxCellTracker(e,n,t){mxCellMarker.call(this,e,n),this.graph.addMouseListener(this),null!=t&&(this.getCell=t),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,n,t,a){null!=e&&(this.graph=e,this.highlightColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=t?t:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(n){if(null!=n){this.editor=n,this.handler=new mxKeyHandler(n.graph);var t=this.handler.escape;this.handler.escape=function(e){t.apply(this,arguments),n.hideProperties(),n.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,n){this.editor=n,null!=e&&null!=n&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i))}return n},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var n=new mxCurrentRootChange(this,e);n.execute();var t=new mxUndoableEdit(this,!1);t.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,n,t){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==n&&this.translate.y==t||(this.scale=e,this.translate.x=n,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var n=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",n))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,n){var t=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==n||(this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",t))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,n,t){var a=this.graph.getModel();if(e=e||a.getRoot(),n=null!=n&&n,t=null==t||t,this.removeState(e),t&&(n||e!=this.currentRoot)){t=a.getChildCount(e);for(var i=0;i<t;i++)this.clear(a.getChildAt(e,i),n)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,n,t,a){var i=this.graph.getModel();if(e=e||i.getRoot(),n=null==n||n,t=null==t||t,a=null!=a&&a,null!=(o=this.getState(e))&&(o.invalid=!0,a&&(o.orderChanged=!0)),n)for(var s=i.getChildCount(e),o=0;o<s;o++){var r=i.getChildAt(e,o);this.invalidate(r,n,t,a)}if(t)for(a=i.getEdgeCount(e),o=0;o<a;o++)this.invalidate(i.getEdgeAt(e,o),n,t)},mxGraphView.prototype.validate=function(e){var n=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var t=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){t=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=t&&(this.canvas.style.display=t,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",n)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(n=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,n=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*n,e.height*n)},mxGraphView.prototype.redrawBackgroundImage=function(e,n){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*n.width,e.bounds.height=this.scale*n.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,n){var t=this.graph.getModel(),a=this.getState(n,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(n)){if(n!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(s=this.graph.getCellGeometry(n))){if(!t.isEdge(n)){var i=s.offset||this.EMPTY_POINT;s.relative?(a.origin.x+=s.x*e.width/this.scale+i.x,a.origin.y+=s.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=s.x,a.origin.y+=s.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*s.width,a.height=this.scale*s.height,t.isVertex(n)){if(s.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var s=Math.cos(i),o=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());s=mxUtils.getRotatedPoint(o,s,i,r);a.x=s.x-a.width/2,a.y=s.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(n);null!=(i=this.graph.getChildOffsetForCell(n))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),i=0;i<s;i++)o=t.getChildAt(n,i),this.validateBounds(a,o)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);n==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,n){var t=this.graph.getModel(),a=this.getState(n),i=null;if(null!=a){if(a.invalid){var s=this.graph.getCellGeometry(n);if(null!=s&&t.isEdge(n)){var o=this.getState(this.getVisibleTerminal(n,!0));if(a.setVisibleTerminalState(o,!0),null!=o&&t.isEdge(o.cell)&&!t.isAncestor(o.cell,n)){var r=this.getState(t.getParent(o.cell));this.validatePoints(r,o.cell)}var l=this.getState(this.getVisibleTerminal(n,!1));a.setVisibleTerminalState(l,!1),null!=l&&t.isEdge(l.cell)&&!t.isAncestor(l.cell,n)&&(r=this.getState(t.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,o,l),this.updatePoints(a,s.points,o,l),this.updateFloatingTerminalPoints(a,o,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=s&&s.relative&&null!=e&&t.isEdge(e.cell)&&(null!=(s=this.getPoint(e,s))&&(a.x=s.x,a.y=s.y,s.x=s.x/this.scale-this.translate.x,s.y=s.y/this.scale-this.translate.y,a.origin=s,this.childMoved(e,a)));a.invalid=!1,n!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(t.isEdge(n)||t.isVertex(n))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),o=0;o<s;o++)r=t.getChildAt(n,o),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,n){var t=n.cell;if(!this.graph.isCellCollapsed(t)||t==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(t),s=0;s<i;s++)this.validateBounds(n,a.getChildAt(t,s))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,n,t){this.updateFixedTerminalPoint(e,n,!0,this.graph.getConnectionConstraint(e,n,!0)),this.updateFixedTerminalPoint(e,t,!1,this.graph.getConnectionConstraint(e,t,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,n,t,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(n,a)),null==i&&null==n){n=this.scale,a=this.translate;var s=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(t))&&(i=new mxPoint(n*(a.x+i.x+s.x),n*(a.y+i.y+s.y)))}e.setAbsoluteTerminalPoint(i,t)},mxGraphView.prototype.updatePoints=function(e,n,t,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var s=this.getEdgeStyle(e,n,t,a);if(null!=s)s(e,t=this.getTerminalPort(e,t,!0),a=this.getTerminalPort(e,a,!1),n,i);else if(null!=n)for(s=0;s<n.length;s++)null!=n[s]&&(a=mxUtils.clone(n[s]),i.push(this.transformControlPoint(e,a)));n=e.absolutePoints,i.push(n[n.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,n){var t=e.origin;return new mxPoint(this.scale*(n.x+this.translate.x+t.x),this.scale*(n.y+this.translate.y+t.y))},mxGraphView.prototype.getEdgeStyle=function(e,n,t,a){return"string"==typeof(e=null!=t&&t==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(n=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,n,t){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!1),null==i&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,n,t,a){n=this.getTerminalPort(e,n,a);var i=this.getNextPoint(e,t,a),s=this.graph.isOrthogonal(e);t=mxUtils.toRadians(Number(n.style[mxConstants.STYLE_ROTATION]||"0"));var o=new mxPoint(n.getCenterX(),n.getCenterY());if(0!=t){var r=Math.cos(-t),l=Math.sin(-t);i=mxUtils.getRotatedPoint(i,r,l,o)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),n=this.getPerimeterPoint(n,i,0==t&&s,r),0!=t&&(r=Math.cos(t),l=Math.sin(t),n=mxUtils.getRotatedPoint(n,r,l,o)),e.setAbsoluteTerminalPoint(n,a)},mxGraphView.prototype.getTerminalPort=function(e,n,t){return null!=(e=mxUtils.getValue(e.style,t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(n=e)),n},mxGraphView.prototype.getPerimeterPoint=function(e,n,t,a){var i=null;if(null!=e){var s=this.getPerimeterFunction(e);null!=s&&null!=n&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=s(a,e,n,t)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+n*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+n*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,n){return n=null!=n?n:0,null!=e&&(n+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(n*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,n,t){var a=null;return null!=(e=e.absolutePoints)&&(t||2<e.length||null==n)&&(a=e.length,a=e[t?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=n&&(a=new mxPoint(n.getCenterX(),n.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,n){for(var t=this.graph.getModel(),a=t.getTerminal(e,n),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=t.getParent(a);return t.getParent(i)==t.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var n=e.absolutePoints;if(e.length=0,null!=n&&0<n.length){var t=n[0],a=n[n.length-1];if(null==t||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(t.x!=a.x||t.y!=a.y){var i=a.x-t.x,s=a.y-t.y;e.terminalDistance=Math.sqrt(i*i+s*s)}else e.terminalDistance=0;a=0;var o=[];if(null!=(s=t)){t=s.x;for(var r=s.y,l=t,d=r,c=1;c<n.length;c++){var m=n[c];null!=m&&(i=s.x-m.x,s=s.y-m.y,i=Math.sqrt(i*i+s*s),o.push(i),a+=i,s=m,t=Math.min(s.x,t),r=Math.min(s.y,r),l=Math.max(s.x,l),d=Math.max(s.y,d))}e.length=a,e.segments=o,e.x=t,e.y=r,e.width=Math.max(1,l-t),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,n){var t=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=n&&!n.relative)null!=n&&(null!=(d=n.offset)&&(t+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,s=(.5+(null!=n?n.x/2:0))*e.length,o=e.segments[0],r=0,l=1;r+o<s&&l<i-1;)r+=o,o=e.segments[l++];if(i=0==o?0:(s-r)/o,s=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=s&&null!=l){if(r=t=a=0,null!=n){a=n.y;var d=n.offset;null!=d&&(t=d.x,r=d.y)}d=l.x-s.x,l=l.y-s.y,t=s.x+d*i+((0==o?0:l/o)*a+t)*this.scale,a=s.y+l*i-((0==o?0:d/o)*a-r)*this.scale}}return new mxPoint(t,a)},mxGraphView.prototype.getRelativePoint=function(e,n,t){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,s=e.segments,o=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t),d=0,c=0,m=0,u=2;u<a;u++)c+=s[u-2],r=e.absolutePoints[u],(o=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t))<=l&&(l=o,d=u-1,m=c),o=r;return a=s[d],o=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,s=r.y,s=(l=(e=o.x-l)-(l=n-l))*e+(s=(d=o.y-s)-(s=t-s))*d,a<(e=Math.sqrt(s<=0?0:s*s/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t)),-1==mxUtils.relativeCcw(o.x,o.y,r.x,r.y,n,t)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var n=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=n&&0<n.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(t=this.getPoint(e,i))&&(e.absoluteOffset=t)}else{var t=n[0],a=n[n.length-1];if(null!=t&&null!=a){n=a.x-t.x;var i,s=a.y-t.y,o=a=0;null!=(i=i.offset)&&(a=i.x,o=i.y),i=t.y+s/2+o*this.scale,e.absoluteOffset.x=t.x+n/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,n){n=n||!1;var t=null;return null!=e&&(t=this.states.get(e),this.graph.isCellVisible(e)&&(null==t&&n&&this.graph.isCellVisible(e)?(t=this.createState(e),this.states.put(e,t)):n&&null!=t&&this.updateStyle&&(t.style=this.graph.getCellStyle(e)))),t},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var n=[],t=0;t<e.length;t++){var a=this.getState(e[t]);null!=a&&n.push(a)}return n},mxGraphView.prototype.removeState=function(e){var n=null;return null!=e&&(null!=(n=this.states.remove(e))&&(this.graph.cellRenderer.destroy(n),n.destroy())),n},mxGraphView.prototype.createState=function(e){var n=this.graph.getCellStyle(e);return e=new mxCellState(this,e,n),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var n=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-n.x,e.clientY-n.y);n=this.graph.container.offsetWidth;var t=this.graph.container.clientWidth;return t<n&&e.x>t+2&&e.x<=n||(n=this.graph.container.offsetHeight,(t=this.graph.container.clientHeight)<n&&e.y>t+2&&e.y<=n)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,n){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var n,t;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(n=e,t=null,mxClient.IS_TOUCH&&(t=mxEvent.getClientX(n),n=mxEvent.getClientY(n),n=mxUtils.convertPoint(i,t,n),t=a.view.getState(a.getCellAt(n.x,n.y))),t)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,n){if(null!=this.graph.container){var t=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=t<n?n+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,n){var t=document.createElement("DIV");return null!=e&&null!=n?(t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e,t.style.height=n):t.style.position="relative",t},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var n=e.offsetWidth,t=e.offsetHeight;this.canvas=this.createVmlPane(n,t),this.backgroundPane=this.createVmlPane(n,t),this.drawPane=this.createVmlPane(n,t),this.overlayPane=this.createVmlPane(n,t),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,n){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e+"px",t.style.height=n+"px",t.setAttribute("coordsize",e+","+n),t.setAttribute("coordorigin","0,0"),t},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var n=document.createElementNS(mxConstants.NS_SVG,"svg");n.style.width="100%",n.style.height="100%",n.style.display="block",n.appendChild(this.canvas),null!=e&&(e.appendChild(n),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(n,i)<0&&n.push(i)}}return this.getModel().getTopmostCells(n)},mxGraph.prototype.graphModelChanged=function(e){for(var n=0;n<e.length;n++)this.processChange(e[n]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(n=n.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(n=n.concat(this.model.getDescendants(a.cell)))}return n},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var n=this.model.getParent(e.child);null!=n?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),n!=e.previous&&(null!=n&&this.view.invalidate(n,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var n=this.model.getChildCount(e),t=0;t<n;t++)this.removeStateForCell(this.model.getChildAt(e,t));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,n){null==e.overlays&&(e.overlays=[]),e.overlays.push(n);var t=this.view.getState(e);return null!=t&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",n)),n},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,n){if(null==n)this.removeCellOverlays(e);else{var t=mxUtils.indexOf(e.overlays,n);0<=t?(e.overlays.splice(t,1),0==e.overlays.length&&(e.overlays=null),null!=(t=this.view.getState(e))&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n))):n=null}return n},mxGraph.prototype.removeCellOverlays=function(e){var n=e.overlays;if(null!=n){e.overlays=null;var t=this.view.getState(e);for(null!=t&&this.cellRenderer.redraw(t),t=0;t<n.length;t++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n[t]))}return n},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var n=this.model.getChildCount(e),t=0;t<n;t++){var a=this.model.getChildAt(e,t);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(t,e,n,a){return null!=e&&0<e.length?(e=new mxCellOverlay(n=null!=n?n:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,n){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,e)):(this.removeCellOverlays(t),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,n){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",n)),this.cellEditor.startEditing(e,n))},mxGraph.prototype.getEditingValue=function(e,n){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,n,t){this.model.beginUpdate();try{this.cellLabelChanged(e,n,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",n,"event",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,n,t){this.model.beginUpdate();try{this.model.setValue(e,n),t&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var n=0;n<e.length;n++){var t=this.view.getState(e[n]);null!=t&&null!=t.handler&&t.handler.reset()}},mxGraph.prototype.click=function(e){var n=e.getEvent(),t=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",n,"cell",t);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(n)&&!a.isConsumed()&&(null!=t?this.selectCellForEvent(t,n):(t=null,this.isSwimlaneSelectionEnabled()&&(t=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=t?this.selectCellForEvent(t,n):this.isToggleEvent(n)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),this.isEnabled()&&!mxEvent.isConsumed(e)&&!t.isConsumed()&&null!=n&&this.isCellEditable(n)&&this.startEditingAtCell(n,e)},mxGraph.prototype.scrollPointToVisible=function(e,n,t,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,n+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&n>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&n<=i.scrollTop+i.clientHeight){var s=i.scrollLeft+i.clientWidth-e;if(s<a){if(e=i.scrollLeft,i.scrollLeft+=a-s,t&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+a-s}else o=Math.max(i.clientWidth,i.scrollWidth)+a-s,e=this.view.getCanvas();e.style.width=o+"px",i.scrollLeft+=a-s}}else(s=e-i.scrollLeft)<a&&(i.scrollLeft-=a-s);(s=i.scrollTop+i.clientHeight-n)<a?(e=i.scrollTop,i.scrollTop+=a-s,e==i.scrollTop&&t&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,n=this.container.scrollHeight+a-s):(n=Math.max(i.clientHeight,i.scrollHeight)+a-s,e=this.view.getCanvas()),e.style.height=n+"px",i.scrollTop+=a-s)):(s=n-i.scrollTop)<a&&(i.scrollTop-=a-s)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var n=0;n="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(n)&&(n=0),n}var n=mxUtils.getCurrentStyle(this.container),t=new mxRectangle;return t.x=e(n.borderLeftWidth)+parseInt(n.paddingLeft||0),t.y=e(n.borderTopWidth)+parseInt(n.paddingTop||0),t.width=e(n.borderRightWidth)+parseInt(n.paddingRight||0),t.height=e(n.borderBottomWidth)+parseInt(n.paddingBottom||0),t},mxGraph.prototype.getPreferredPageSize=function(e,n,t){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,s=e*this.pageScale;i=new mxRectangle(0,0,i.width*s,i.height*s);return n=this.pageBreaksVisible?Math.ceil(n/i.width):1,t=this.pageBreaksVisible?Math.ceil(t/i.height):1,new mxRectangle(0,0,n*i.width+2+a.x/e,t*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var n=this.getBorder(),t=Math.max(0,e.x+e.width+1+n);n=Math.max(0,e.y+e.height+1+n);if(null!=this.minimumContainerSize&&(t=Math.max(t,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(t,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,t,n);null!=a&&(t=a.width,n=a.height)}null!=this.minimumGraphSize&&(t=Math.max(t,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),t=Math.ceil(t-1),n=Math.ceil(n-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,t)+"px",a.style.minHeight=Math.max(1,n)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,t),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,t)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px"),this.updatePageBreaks(this.pageBreaksVisible,t-1,n-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,n){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var t=this.getBorderSizes();e+=Math.max(2,t.x+t.width+1),n+=Math.max(2,t.y+t.height+1)}else 9<=document.documentMode?(e+=3,n+=5):(e+=1,n+=1);else n+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),n=Math.min(this.maximumContainerSize.height,n)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(n)+"px"},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),s=e?Math.ceil((n-i.x)/i.width):0,e=e?Math.ceil((t-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<s&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(o=0;o<=s;o++){var r=[new mxPoint(i.x+o*i.width,1),new mxPoint(i.x+o*i.width,t)];null!=this.horizontalPageBreaks[o]?(this.horizontalPageBreaks[o].scale=1,this.horizontalPageBreaks[o].points=r,this.horizontalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[o]=r)}for(o=s;o<this.horizontalPageBreaks.length;o++)this.horizontalPageBreaks[o].destroy();this.horizontalPageBreaks.splice(s,this.horizontalPageBreaks.length-s)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(o=0;o<=e;o++)r=[new mxPoint(1,i.y+o*i.height),new mxPoint(n,i.y+o*i.height)],null!=this.verticalPageBreaks[o]?(this.verticalPageBreaks[o].scale=1,this.verticalPageBreaks[o].points=r,this.verticalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[o]=r);for(o=e;o<this.verticalPageBreaks.length;o++)this.verticalPageBreaks[o].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var n=this.model.getStyle(e),t=null;t=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=n&&(t=this.postProcessCellStyle(this.stylesheet.getCellStyle(n,t))),null==t&&(t=mxGraph.prototype.EMPTY_ARRAY),t},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var n=e[mxConstants.STYLE_IMAGE],t=this.getImageFromBundles(n);null!=t?e[mxConstants.STYLE_IMAGE]=t:t=n,null!=t&&"data:image/"==t.substring(0,11)&&(0<(n=t.indexOf(","))&&(t=t.substring(0,n)+";base64,"+t.substring(n+1)),e[mxConstants.STYLE_IMAGE]=t)}return e},mxGraph.prototype.setCellStyle=function(e,n){if(null!=(n=n||this.getSelectionCells())){this.model.beginUpdate();try{for(var t=0;t<n.length;t++)this.model.setStyle(n[t],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,n,t){t=t||this.getSelectionCell(),this.toggleCellStyles(e,n,[t])},mxGraph.prototype.toggleCellStyles=function(e,n,t){var a;(n=null!=n&&n,null!=(t=t||this.getSelectionCells())&&0<t.length)&&(null!=(a=null!=(a=this.view.getState(t[0]))?a.style:this.getCellStyle(t[0]))&&(n=mxUtils.getValue(a,e,n)?0:1,this.setCellStyles(e,n,t)))},mxGraph.prototype.setCellStyles=function(e,n,t){t=t||this.getSelectionCells(),mxUtils.setCellStyles(this.model,t,e,n)},mxGraph.prototype.toggleCellStyleFlags=function(e,n,t){this.setCellStyleFlags(e,n,null,t)},mxGraph.prototype.setCellStyleFlags=function(e,n,t,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==t)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(t=(parseInt(i[e]||0)&n)!=n);mxUtils.setCellStyleFlags(this.model,a,e,n,t)}},mxGraph.prototype.alignCells=function(e,n,t){if(null==n&&(n=this.getSelectionCells()),null!=n&&1<n.length){if(null==t)for(var a=0;a<n.length;a++){var i=this.getCellGeometry(n[a]);if(null!=i&&!this.model.isEdge(n[a]))if(null==t){if(e==mxConstants.ALIGN_CENTER){t=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)t=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)t=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){t=i.y+i.height/2;break}t=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else t=e==mxConstants.ALIGN_RIGHT?Math.max(t,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(t,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(t,i.y+i.height):Math.min(t,i.x)}if(null!=t){this.model.beginUpdate();try{for(a=0;a<n.length;a++)null!=(i=this.getCellGeometry(n[a]))&&!this.model.isEdge(n[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=t-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=t-i.width:e==mxConstants.ALIGN_TOP?i.y=t:e==mxConstants.ALIGN_MIDDLE?i.y=t-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=t-i.height:i.x=t,this.model.setGeometry(n[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",n))}finally{this.model.endUpdate()}}}return n},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var n=this.model.getStyle(e);null==n||0==n.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var n=[],t=0;t<this.imageBundles.length;t++)this.imageBundles[t]!=e&&n.push(this.imageBundles[t]);this.imageBundles=n},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var n=0;n<this.imageBundles.length;n++){var t=this.imageBundles[n].getImage(e);if(null!=t)return t}return null},mxGraph.prototype.orderCells=function(e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(n,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsOrdered=function(e,n){if(null!=e){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=this.model.getParent(e[t]);n?this.model.add(a,e[t],t):this.model.add(a,e[t],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",n,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,n,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),t=this.getCellsForGroup(t),null==e&&(e=this.createGroupCell(t));var a=this.getBoundsForGroup(e,t,n);if(0<t.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(t[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var s=this.model.getChildCount(i);this.cellsAdded([e],i,s,null,null,!1),s=this.model.getChildCount(e),this.cellsAdded(t,e,s,null,null,!1,!1),this.cellsMoved(t,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",n,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var n=[];if(null!=e&&0<e.length){var t=this.model.getParent(e[0]);n.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==t&&n.push(e[a])}return n},mxGraph.prototype.getBoundsForGroup=function(e,n,t){return null!=(n=this.getBoundingBoxFromGeometry(n))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),n.x-=e.width,n.y-=e.height,n.width+=e.width,n.height+=e.height),n.x-=t,n.y-=t,n.width+=2*t,n.height+=2*t),n},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var n=[];if(null==e){e=this.getSelectionCells();for(var t=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&t.push(e[a]);e=t}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),s=this.model.getParent(e[a]),o=this.model.getChildCount(s);this.cellsAdded(i,s,o,null,null,!0),n=n.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return n},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var n=this.getDefaultParent(),t=this.model.getChildCount(n);this.cellsAdded(e,n,t,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,n,t){null==e&&(e=this.getSelectionCells()),n=null!=n?n:0,t=null!=t&&t,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var s=this.getBoundingBoxFromGeometry(i);if(0<s.width&&0<s.height){var o=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();t&&(r.x+=s.x-o.width-n,r.y+=s.y-o.height-n),r.width=s.width+o.width+2*n,r.height=s.height+o.height+2*n,this.model.setGeometry(e[a],r),this.moveCells(i,-s.x+o.width+n,-s.y+o.height+n)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,n){n=null==n||n;var t=null;if(null!=e){for(var a={},i=(t=[],0);i<e.length;i++){a[s=mxCellPath.create(e[i])]=e[i],t.push(e[i])}if(0<t.length){var s=this.view.scale,o=this.view.translate;for(t=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!n&&this.model.isEdge(t[i])&&null!=this.getEdgeValidationError(t[i],this.model.getTerminal(t[i],!0),this.model.getTerminal(t[i],!1)))t[i]=null;else{var r=this.model.getGeometry(t[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(t[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/s-o.x,l[0].y/s-o.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/s-o.x,l[m].y/s-o.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else t=[]}return t},mxGraph.prototype.insertVertex=function(e,n,t,a,i,s,o,r,l){return n=this.createVertex(e,n,t,a,i,s,o,r,l),this.addCell(n,e)},mxGraph.prototype.createVertex=function(e,n,t,a,i,s,o,r,l){return(e=new mxGeometry(a,i,s,o)).relative=null!=l&&l,(t=new mxCell(t,e,r)).setId(n),t.setVertex(!0),t.setConnectable(!0),t},mxGraph.prototype.insertEdge=function(e,n,t,a,i,s){return n=this.createEdge(e,n,t,a,i,s),this.addEdge(n,e,a,i)},mxGraph.prototype.createEdge=function(e,n,t,a,i,s){return(e=new mxCell(t,new mxGeometry,s)).setId(n),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,n,t,a,i){return this.addCell(e,n,i,t,a)},mxGraph.prototype.addCell=function(e,n,t,a,i){return this.addCells([e],n,t,a,i)[0]},mxGraph.prototype.addCells=function(e,n,t,a,i){null==n&&(n=this.getDefaultParent()),null==t&&(t=this.model.getChildCount(n)),this.model.beginUpdate();try{this.cellsAdded(e,n,t,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",n,"index",t,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,n,t,a,i,s,o){if(null!=e&&null!=n&&null!=t){this.model.beginUpdate();try{for(var r=null!=(d=s?this.view.getState(n):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])t--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=n&&n!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}n==c&&t+d>this.model.getChildCount(n)&&t--,this.model.add(n,e[d],t+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==o||o)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",n,"index",t,"source",a,"target",i,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,n){n=null==n||n,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),n&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var n=this.view.scale,t=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var s=mxCellPath.create(e[i]);a[s]=e[i]}for(i=0;i<e.length;i++){for(var o=this.getConnections(e[i]),r=0;r<o.length;r++)if(null==a[s=mxCellPath.create(o[r])]){if(null!=(d=this.model.getGeometry(o[r]))){var l=this.view.getState(o[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/n-t.x,m[u].y/n-t.y),c),this.model.setTerminal(o[r],null,c),this.model.setGeometry(o[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,n,t,a,i){a=a||0,i=i||0,null==t&&(t=this.cloneCells([e])[0]);var s=this.model.getParent(e),o=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(n,a,i,!1,!1),this.cellsAdded(n,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([t],s,this.model.getChildCount(s),o,n[0],!1),this.cellConnected(e,n[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",n,"newEdge",t,"dx",a,"dy",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.toggleCells=function(e,n,t){null==n&&(n=this.getSelectionCells()),t&&(n=this.addAllEdges(n)),this.model.beginUpdate();try{this.cellsToggled(n,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",n,"includeEdges",t))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsToggled=function(e,n){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++)this.model.setVisible(e[t],n)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,n,t,a){n=null!=n&&n,null==t&&(t=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(t,e,n,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",n,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsFolded=function(e,n,t,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],n))&&n!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],n),this.swapBounds(e[i],n),this.isExtendParent(e[i])&&this.extendParent(e[i]),t)){var s=this.model.getChildren(e[i]);this.foldCells(s,n,t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",n,"recurse",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,n){if(null!=e){var t=this.model.getGeometry(e);null!=t&&(t=t.clone(),this.updateAlternateBounds(e,t,n),t.swap(),this.model.setGeometry(e,t))}},mxGraph.prototype.updateAlternateBounds=function(e,n,t){if(null!=e&&null!=n){if(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e),null==n.alternateBounds){var a=n;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(t,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),n.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=n.alternateBounds){n.alternateBounds.x=n.x,n.alternateBounds.y=n.y;var i=mxUtils.toRadians(t[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=n.alternateBounds.getCenterX()-n.getCenterX(),t=n.alternateBounds.getCenterY()-n.getCenterY(),a=Math.cos(i),i=Math.sin(i),n.alternateBounds.x+=a*e-i*t-e,n.alternateBounds.y+=i*e+a*t-t)}}},mxGraph.prototype.addAllEdges=function(e){var n=e.slice();return n.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var n=[];if(null!=e)for(var t=0;t<e.length;t++){for(var a=this.model.getEdgeCount(e[t]),i=0;i<a;i++)n.push(this.model.getEdgeAt(e[t],i));a=this.model.getChildren(e[t]),n=n.concat(this.getAllEdges(a))}return n},mxGraph.prototype.updateCellSize=function(e,n){n=null!=n&&n,this.model.beginUpdate();try{this.cellSizeUpdated(e,n),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,n){if(null!=e){this.model.beginUpdate();try{var t=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=t&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var s=this.view.getState(e),o=null!=s?s.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.height+8),i&&(a.height=t.height+8),a.width=t.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.width+8),i&&(a.width=t.width+8),a.height=t.height),this.model.setStyle(e,r)}else a.width=t.width,a.height=t.height;if(!n&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var n=null;if(null!=e){var t=this.view.getState(e),a=null!=t?t.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0;n=0;null==this.getImage(t)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(n+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(a[mxConstants.STYLE_SPACING]||0),s+=a[mxConstants.STYLE_SPACING_LEFT]||0,s+=a[mxConstants.STYLE_SPACING_RIGHT]||0,n+=2*(a[mxConstants.STYLE_SPACING]||0),n+=a[mxConstants.STYLE_SPACING_TOP]||0,n+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(t=this.getFoldingImage(t))&&(s+=t.width+8),n=null!=(t=this.getLabel(e))&&0<t.length?(this.isHtmlLabel(e)||(t=t.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(t,i,a[mxConstants.STYLE_FONTFAMILY])).width+s,n=i.height+n,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=n,n=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),n=this.snap(n+this.gridSize/2)),new mxRectangle(0,0,e,n)):new mxRectangle(0,0,a=4*this.gridSize,a)}}return n},mxGraph.prototype.handleGesture=function(e,n){if(.2<Math.abs(1-n.scale)){var t=this.view.scale,a=this.view.translate,i=e.width*n.scale,s=e.height*n.scale,o=e.y-(s-e.height)/2;t=new mxRectangle(this.snap((e.x-(i-e.width)/2)/t)-a.x,this.snap(o/t)-a.y,this.snap(i/t),this.snap(s/t));this.resizeCell(e.cell,t)}},mxGraph.prototype.resizeCell=function(e,n){return this.resizeCells([e],[n])[0]},mxGraph.prototype.resizeCells=function(e,n){this.model.beginUpdate();try{this.cellsResized(e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,n){if(null!=e&&null!=n&&e.length==n.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=n[t],i=this.model.getGeometry(e[t]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var s=i.offset;null!=s&&(s.x+=a.x-i.x,s.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[t])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[t],i),this.isExtendParent(e[t])&&this.extendParent(e[t])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var n=this.model.getParent(e),t=this.model.getGeometry(n);null!=n&&null!=t&&!this.isCellCollapsed(n)&&(null!=(e=this.model.getGeometry(e))&&(t.width<e.x+e.width||t.height<e.y+e.height))&&((t=t.clone()).width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height),this.cellsResized([n],[t]))}},mxGraph.prototype.importCells=function(e,n,t,a,i){return this.moveCells(e,n,t,!0,a,i)},mxGraph.prototype.moveCells=function(e,n,t,a,i,s){if(n=null!=n?n:0,t=null!=t?t:0,a=null!=a&&a,null!=e&&(0!=n||0!=t||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var o=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,n,t,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(o),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",n,"dy",t,"clone",a,"target",i,"event",s))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,n,t,a,i){if(null!=e&&(0!=n||0!=t)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var s=0;s<e.length;s++)this.translateCell(e[s],n,t),i&&this.constrainChild(e[s]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",t,"dy",t,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,n,t){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(n,t),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(n,t):(a.offset.x+=n,a.offset.y+=t)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var n=this.model.getParent(e);if(n==this.getDefaultParent()||n==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=n&&n!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(n))){var t=e=0,a=i.width,i=i.height;return this.isSwimlane(n)&&(e=(n=this.getStartSize(n)).width,a-=n.width,t=n.height,i-=n.height),new mxRectangle(e,t,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var n=this.model.getGeometry(e),t=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=n&&null!=t&&!n.relative&&(n.x<t.x||n.y<t.y||t.width<n.x+n.width||t.height<n.y+n.height)&&(e=this.getOverlap(e),0<t.width&&(n.x=Math.min(n.x,t.x+t.width-(1-e)*n.width)),0<t.height&&(n.y=Math.min(n.y,t.y+t.height-(1-e)*n.height)),n.x=Math.max(n.x,t.x-n.width*e),n.y=Math.max(n.y,t.y-n.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var n={},t=0;t<e.length;t++){var a=mxCellPath.create(e[t]);n[a]=e[t]}this.model.beginUpdate();try{for(t=0;t<e.length;t++){var i=this.model.getEdges(e[t]);if(null!=i)for(a=0;a<i.length;a++){var s=this.view.getState(i[a]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(o),d=mxCellPath.create(r);(null==n[l]||null==n[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[t]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var n=this.model.getGeometry(e);return null!=n&&null!=n.points&&0<n.points.length&&((n=n.clone()).points=[],this.model.setGeometry(e,n)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,n){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,n,t){n=null;var a=e.style[t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(n=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=n&&(a=mxUtils.getValue(e.style,t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(n,a)},mxGraph.prototype.setConnectionConstraint=function(e,n,t,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,n){var t=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),s=e.style[mxConstants.STYLE_DIRECTION],o=0;if(null!=s&&("north"==s?o+=270:"west"==s?o+=180:"south"==s&&(o+=90),"north"==s||"south"==s)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=n.point){var l=t=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=s&&"south"!=s||(r=m,m=u,u=r),m&&(t=-1,d=-a.width),u&&(l=-1,c=-a.height)}t=new mxPoint(a.x+n.point.x*a.width*t-d,a.y+n.point.y*a.height*l-c)}s=e.style[mxConstants.STYLE_ROTATION]||0,n.perimeter?(0!=o&&null!=t&&(r=a=0,90==o?r=1:180==o?a=-1:270==s&&(r=-1),t=mxUtils.getRotatedPoint(t,a,r,i)),null!=t&&n.perimeter&&(t=this.view.getPerimeterPoint(e,t,!1))):s+=o,0!=s&&null!=t&&(o=mxUtils.toRadians(s),a=Math.cos(o),r=Math.sin(o),t=mxUtils.getRotatedPoint(t,a,r,i))}return t},mxGraph.prototype.connectCell=function(e,n,t,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.cellConnected(e,n,t,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,n,t,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.setConnectionConstraint(e,n,t,a),this.isPortsEnabled()&&(a=null,this.isPort(n)&&(a=n.getId(),n=this.getTerminalForPort(n,t)),this.setCellStyles(t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,n,t),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var n=this.view.scale,t=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var s=this.view.getState(e[i]),o=this.view.getState(this.model.getParent(e[i]));if(null!=s&&null!=o){var r=r.clone(),l=-o.origin.x,d=-o.origin.y,c=s.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/n-t.x+l,c[0].y/n-t.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/n-t.x+l,c[v].y/n-t.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,n){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),n=this.getCurrentRoot();if(null!=n){for(var t=this.model.getParent(n);t!=e&&!this.isValidRoot(t)&&this.model.getParent(t)!=e;)t=this.model.getParent(t);t==e||this.model.getParent(t)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(t),null!=this.view.getState(n)&&this.setSelectionCell(n)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,n,t){var a=[e];if(n&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),t){t=this.model.getChildCount(e);for(var i=0;i<t;i++){var s=this.getCellBounds(this.model.getChildAt(e,i),n,!0);null!=a?a.add(s):a=s}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,n){n=null!=n&&n;var t=null;if(null!=e)for(var a=0;a<e.length;a++)if(n||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var s=i.points;if(null!=s&&0<s.length){for(var o=new mxRectangle(s[0].x,s[0].y,0,0),r=function(e){null!=e&&o.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<s.length;l++)r(s[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i)}}return t},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,n){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-n;else{var t=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==n){if(mxClient.IS_IE?t.setAttribute("transform","translate("+e+","+n+")"):t.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(t.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(t.setAttribute("transform","translate("+e+","+n+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=t.parentNode?s.appendChild(a):s=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,t.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=n+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=n+"px"}else t.style.left=e+"px",t.style.top=n+"px";this.panDx=e,this.panDy=n,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,n){this.zoom(e/this.view.scale,n)},mxGraph.prototype.zoom=function(e,n){n=null!=n?n:this.centerZoom;var t=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=t,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(t));else if(n&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var s=(e-1)/(2*t);a=a*-s,i=i*-s}else a*=s=(1/e-1)/(2*this.view.scale),i*=s;this.view.scaleAndTranslate(t,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(t),mxUtils.hasScrollbars(this.container)&&(i=a=0,n&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var n=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var t=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=t-e.x,e.height=a-e.y,n<1?(t=((n=e.height/n)-e.height)/2,e.height=n,n=Math.min(e.y,t),e.y-=n,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(t=((n*=e.width)-e.width)/2,e.width=n,n=Math.min(e.x,t),e.x-=n,t=Math.min(this.container.scrollWidth,e.x+e.width),e.width=t-e.x),n=this.container.clientWidth/e.width,t=this.view.scale*n,mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),this.container.scrollLeft=Math.round(e.x*n),this.container.scrollTop=Math.round(e.y*n)):this.view.scaleAndTranslate(t,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,n){if(null!=this.container){e=null!=e?e:0,n=null!=n&&n;var t=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();n&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var s=this.view.scale,o=i.width/s,r=i.height/s;null!=this.backgroundImage&&(o=Math.max(o,this.backgroundImage.width-i.x/s),r=Math.max(r,this.backgroundImage.height-i.y/s));var l=n?e:2*e;t=Math.floor(100*Math.min(t/(o+l),a/(r+l)))/100;null!=this.minFitScale&&(t=Math.max(t,this.minFitScale)),null!=this.maxFitScale&&(t=Math.min(t,this.maxFitScale)),n?this.view.scale!=t&&this.view.setScale(t):mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/s)*t-e-Math.max(0,(this.container.clientWidth-o*t)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/s)*t-e-Math.max(0,(this.container.clientHeight-r*t)/2))):this.view.scaleAndTranslate(t,null!=i.x?Math.floor(this.view.translate.x-i.x/s+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/s+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,n){var t=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(t=new mxRectangle(t+i.x,a+i.y,i.width,i.height),n&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,t.x=t.getCenterX()-a/2,t.width=a,t.y=t.getCenterY()-i/2,t.height=i),this.scrollRectToVisible(t)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var n=!1;if(null!=e){var t=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(t,e.width),s=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){t=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var o=t.scrollLeft-e.x;a=Math.max(o-t.scrollLeft,0);0<o?t.scrollLeft-=o+2:0<(o=e.x+i-t.scrollLeft-t.clientWidth)&&(t.scrollLeft+=o+2),i=t.scrollTop-e.y,o=Math.max(0,i-t.scrollTop),0<i?t.scrollTop-=i+2:0<(i=e.y+s-t.scrollTop-t.clientHeight)&&(t.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=o)&&this.view.setTranslate(a,o)}else{o=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>o+t&&(this.view.translate.x-=(e.x+i-t-o)/l,n=!0),e.y+s>r+a&&(this.view.translate.y-=(e.y+s-a-r)/l,n=!0),e.x<o&&(this.view.translate.x+=(o-e.x)/l,n=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,n=!0),n&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return n},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var n=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=n?n:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var n=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=n&&n==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,n,t){return null==this.getEdgeValidationError(e,n,t)},mxGraph.prototype.getEdgeValidationError=function(e,n,t){if(null!=e&&!this.isAllowDanglingEdges()&&(null==n||null==t))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&n==t&&null!=n||!this.isValidConnection(n,t))return"";if(null==n||null==t)return this.allowDanglingEdges?null:"";var a="";this.multigraph||(1<(i=this.model.getEdgesBetween(n,t,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(n,!0,e),s=this.model.getDirectedEdgeCount(t,!1,e);if(null!=this.multiplicities)for(var o=0;o<this.multiplicities.length;o++){var r=this.multiplicities[o].check(this,e,n,t,i,s);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,n,t))&&(a+=r),0<a.length?a:null},mxGraph.prototype.validateEdge=function(e,n,t){return null},mxGraph.prototype.validateGraph=function(e,n){e=null!=e?e:this.model.getRoot(),n=null!=n?n:{};for(var t=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var s=this.model.getChildAt(e,i),o=n;this.isValidRoot(s)&&(o={}),null!=(o=this.validateGraph(s,o))?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),t=t&&null==o}return a="",this.isCellCollapsed(e)&&!t&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,n))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!t?a:null},mxGraph.prototype.getCellValidationError=function(e){var n=this.model.getDirectedEdgeCount(e,!0),t=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var s=this.multiplicities[i];s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<n||1==s.min&&0==n||1==s.max&&1<n)?a+=s.countError+"\n":!s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<t||1==s.min&&0==t||1==s.max&&1<t)&&(a+=s.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,n){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var n=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!n))return n?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var n="";if(this.labelsVisible&&null!=e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);mxUtils.getValue(t,mxConstants.STYLE_NOLABEL,!1)||(n=this.convertValueToString(e))}return n},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,t,n,a){var i=null;return null!=e&&(null==e.control||t!=e.control.node&&t.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,n){null!=i||t!=n.node&&t.parentNode!=n.node||(i=n.overlay.toString())}),null==i&&(null!=(n=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof n.getTooltipForNode&&(i=n.getTooltipForNode(t))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var n=new mxRectangle,t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&(t=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?n.height=t:n.width=t),n},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var n;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return n[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var n=this.model.getGeometry(e);return this.isCellsLocked()||null!=n&&this.model.isVertex(e)&&n.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,n){return!0},mxGraph.prototype.isCellBendable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,n,t){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,n){return this.isValidSource(e)&&this.isValidTarget(n)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null==this.cellEditor)return!1;var n=this.cellEditor.getEditingCell();return null==e?null!=n:e==n},mxGraph.prototype.isAutoSizeCell=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,n){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,n)}))},mxGraph.prototype.isCellFoldable=function(e,n){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=t[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,n,t){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,n,t)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,n,t){return!(!this.model.isEdge(e)||null==n||1!=n.length||!this.isCellConnectable(n[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),n[0]))&&(t=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(n[0],t)&&!this.model.isAncestor(n[0],e))},mxGraph.prototype.getDropTarget=function(e,n,t){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(n),mxEvent.getClientY(n))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==t)t=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=t;)i=this.model.getParent(i);i==t&&(t=a)}for(;null!=t&&!this.isValidDropTarget(t,e,n)&&!this.model.isLayer(t);)t=this.model.getParent(t);return!this.model.isLayer(t)&&mxUtils.indexOf(e,t)<0?t:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,n,t){if(null!=(t=t||this.getDefaultParent()))for(var a=this.model.getChildCount(t),i=0;i<a;i++){var s=this.model.getChildAt(t,i),o=this.getSwimlaneAt(e,n,s);if(null!=o)return o;if(this.isSwimlane(s)&&(o=this.view.getState(s),this.intersects(o,e,n)))return s}return null},mxGraph.prototype.getCellAt=function(e,n,t,a,i){if(a=null==a||a,i=null==i||i,null!=(t=null!=t?t:this.getDefaultParent()))for(var s=this.model.getChildCount(t)-1;0<=s;s--){var o=this.model.getChildAt(t,s),r=this.getCellAt(e,n,o,a,i);if(null!=r)return r;if(this.isCellVisible(o)&&(i&&this.model.isEdge(o)||a&&this.model.isVertex(o))&&(r=this.view.getState(o),this.intersects(r,e,n)))return o}return null},mxGraph.prototype.intersects=function(e,n,t){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],s=1;s<a.length;s++){var o=a[s];if(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,n,t)<=e)return!0;i=o}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),s=new mxPoint(e.getCenterX(),e.getCenterY()),n=(i=mxUtils.getRotatedPoint(new mxPoint(n,t),a,i,s)).x,t=i.y),mxUtils.contains(e,n,t))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,n,t){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(n-=a.x,t-=a.y,0<e.width&&0<n&&n>e.width*i||0<e.height&&0<t&&t>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,n,t){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=n&&n,null!=t&&t),n=[],t=0;t<e.length;t++)this.isCellVisible(e[t])&&n.push(e[t]);return n},mxGraph.prototype.getConnections=function(e,n){return this.getEdges(e,n,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,n){return this.getEdges(e,n,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,n){return this.getEdges(e,n,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,n,t,a,i,s){t=null==t||t,a=null==a||a,i=null==i||i,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(o=o.concat(this.model.getEdges(c,t,a)))}for(o=o.concat(this.model.getEdges(e,t,a)),r=[],d=0;d<o.length;d++)l=null!=(c=this.view.getState(o[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[d],!1),(i&&l==c||l!=c&&(t&&c==e&&(null==n||this.isValidAncestor(l,n,s))||a&&l==e&&(null==n||this.isValidAncestor(c,n,s))))&&r.push(o[d]);return r},mxGraph.prototype.isValidAncestor=function(e,n,t){return t?this.model.isAncestor(n,e):this.model.getParent(e)==n},mxGraph.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[],s={};if(null!=e)for(var o=0;o<e.length;o++){var r=null!=(l=this.view.getState(e[o]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[o],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[o],!1);if(r==n&&null!=l&&l!=n&&a){var d=mxCellPath.create(l);null==s[d]&&(s[d]=l,i.push(l))}else l==n&&null!=r&&r!=n&&t&&(null==s[d=mxCellPath.create(r)]&&(s[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=null!=(r=this.view.getState(a[s]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[s],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxGraph.prototype.getPointForEvent=function(e,n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,s=0!=n?this.gridSize/2:0;return t.x=this.snap(t.x/a-i.x-s),t.y=this.snap(t.y/a-i.y-s),t},mxGraph.prototype.getCells=function(e,n,t,a,i,s){if(s=null!=s?s:[],0<t||0<a){var o=e+t,r=n+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=n&&u.x+u.width<=o?s.push(c):this.getCells(e,n,t,a,c,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(e,n,t,a,i){var s=[];if((a||i)&&(null==t&&(t=this.getDefaultParent()),null!=t))for(var o=this.model.getChildCount(t),r=0;r<o;r++){var l=this.model.getChildAt(t,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=n)&&s.push(l)}return s},mxGraph.prototype.findTreeRoots=function(e,n,t){n=null!=n&&n,t=null!=t&&t;var a=[];if(null!=e){for(var i=this.getModel(),s=i.getChildCount(e),o=null,r=0,l=0;l<s;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,n?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(t&&0==m&&0<u||!t&&0==u&&0<m)&&a.push(d),r<(c=t?u-m:m-u)&&(r=c,o=d)}}0==a.length&&null!=o&&a.push(o)}return a},mxGraph.prototype.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.model.getEdgeAt(e,s),r=this.model.getTerminal(o,!0)==e;n&&!r||(r=this.model.getTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,n){var t=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(t,n),t},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,n,t){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),s=this.model.getChildCount(i);null==a&&0<s?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!n||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&t?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<s&&(n=i.getIndex(a),e=e?(n++,this.model.getChildAt(i,n%s)):(n--,this.model.getChildAt(i,n<0?s-1:n)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(n,t,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&n||this.model.isEdge(e)&&t)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,n){var t=this.isCellSelected(e);this.isToggleEvent(n)?t?this.removeSelectionCell(e):this.addSelectionCell(e):(!t||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,n){this.isToggleEvent(n)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var n=null;return null!=e&&(n=this.model.isEdge(e.cell)?(n=this.view.getEdgeStyle(e),this.isLoop(e)||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):new mxVertexHandler(e)),n},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var n=0;n<this.mouseListeners.length;n++)if(this.mouseListeners[n]==e){this.mouseListeners.splice(n,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var n=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=n.x-this.panDx,e.graphY=n.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,n,t){if(null==t&&(t=this),this.updateMouseEvent(n),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-n.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-n.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(n.getEvent(),n.getCell()),n.getEvent().cancelBubble=!0):(this.lastTouchX=n.getX(),this.lastTouchY=n.getY(),this.lastTouchTime=a)}if(a=2!=n.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-n.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-n.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=n.getX(),this.lastMouseY=n.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||n.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(n.getGraphX(),n.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(t=[t,n],n.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,t):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,t):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,t)}e==mxEvent.MOUSE_UP&&this.click(n)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var n=e.view.graph.getModel().isEdge(e.cell),t=e.view.scale,a=null,i=this.image.width,s=this.image.height;return n?a=1==(n=e.absolutePoints).length%2?n[Math.floor(n.length/2)]:(e=n[(a=n.length/2)-1],n=n[a],new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*t),Math.round(a.y-(s*this.defaultOverlap-this.offset.y)*t),i*t,s*t)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var n=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&n.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,n){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var n=this.source.view.scale,t=new mxRectangle((t=this.source.getGraphBounds()).x/n+this.source.panDx,t.y/n+this.source.panDy,t.width/n,t.height/n),a=new mxRectangle(0,0,this.source.container.clientWidth/n,this.source.container.clientHeight/n);(s=t.clone()).add(a);var i=this.getSourceContainerSize(),s=(a=Math.max(i.width/n,s.width),n=Math.max(i.height/n,s.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(s=Math.min(s/a,i/n))){this.outline.getView().scale!=s&&(this.outline.getView().scale=s,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(n=this.source.view.translate).x+this.source.panDx;var o=n.y+this.source.panDy;null!=(s=this.getOutlineOffset(s))&&(i+=s.x,o+=s.y),t.x<0&&(i-=t.x),t.y<0&&(o-=t.y),a.translate.x==i&&a.translate.y==o||(a.translate.x=i,a.translate.y=o,e=!0);t=a.translate,i=(s=this.source.getView().scale)/a.scale,o=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((t.x-n.x-this.source.panDx)/o,(t.y-n.y-this.source.panDy)/o,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/s,this.bounds.y+=this.source.container.scrollTop*a.scale/s,(t=this.selectionBorder.bounds).x==this.bounds.x&&t.y==this.bounds.y&&t.width==this.bounds.width&&t.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),t=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-t.width/2,this.bounds.y+this.bounds.height-t.height/2,t.width,t.height),t.x==a.x&&t.y==a.y&&t.width==a.width&&t.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,n){this.enabled&&this.showViewport&&(this.zoom=n.isSource(this.sizer),this.startX=n.getX(),this.startY=n.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),n.consume()},mxOutline.prototype.mouseMove=function(e,n){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var t=n.getX()-this.startX,a=n.getY()-this.startY,i=null;if(this.zoom)a=t/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+t),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var s=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+t,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),t=t/s*this.source.getView().scale,a=a/s*this.source.getView().scale,this.source.panGraph(-t-this.dx0,-a-this.dy0)}t=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-t.width/2,i.y+i.height-t.height/2,t.width,t.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),n.consume()}},mxOutline.prototype.mouseUp=function(e,n){if(this.active){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(0<Math.abs(t)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-t*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),t/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-t,i.y-a));this.update(),n.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,n,t,a,i,s){var o="";return(this.source&&this.checkTerminal(e,t,n)||!this.source&&this.checkTerminal(e,a,n))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,n,t,a)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(e,n,t,a){n=e.model.getValue(t),a=e.model.getValue(a),t=!this.validNeighborsAllowed;for(var i=this.validNeighbors,s=0;s<i.length;s++){if(this.source&&this.checkType(e,a,i[s])){t=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,n,i[s])){t=this.validNeighborsAllowed;break}}return t},mxMultiplicity.prototype.checkTerminal=function(e,n,t){return n=e.model.getValue(n),this.checkType(e,n,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,n,t,a,i){return null!=n&&(isNaN(n.nodeType)?n==t:mxUtils.isNode(n,t,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var n=this.graph.getModel();n.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((n=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var n=this.getGraph().getModel();if(this.isBubbling())for(var t=n.getParents(e);0<t.length;)e=e.concat(t),t=n.getParents(t);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,n){if(null!=e&&null!=n)for(var t=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var s=this.getLayout(a.getParent(e[i]));null!=s&&s.moveCell(e[i],t.x,t.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var n=[],t={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),s=0;s<i.length;s++)if(null!=i[s]){var o=mxCellPath.create(i[s]);null==t[o]&&(t[o]=i[s],n.push(i[s]))}}return n},mxLayoutManager.prototype.getCellsForChange=function(e){var n=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,n.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,n.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=null,a=0;a<e.length;a++)e[a]!=n.getRoot()&&e[a]!=t&&(t=e[a],this.executeLayout(this.getLayout(t),t));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{n.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,n){null!=e&&null!=n&&e.execute(n)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isCellIgnored(e[t])){this.cellResized(e[t]);break}}finally{n.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var n=this.getGraph(),t=n.getView(),a=n.getModel(),i=t.getState(e),s=t.getState(a.getParent(e));if(null!=i&&null!=s){var o=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=o&&null!=r){var l=t.translate,d=t.scale,c=(t=i.x-s.origin.x-l.x*d,s=i.y-s.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+t-r.x*d,u=i.height-r.height*d+s-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<o.length;r++)o[r]!=e&&this.isCellShiftable(o[r])&&this.shiftCell(o[r],m,u,t,s,l,c,p,i,this.isExtendParents()&&n.isExtendParent(o[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,n,t,a,i,s,o,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=s)(p=p.clone()).translate(-n,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=o)(p=p.clone()).translate(0,-t);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var n=this.getGraph(),t=n.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return n.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),t,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var n=this.graph.view.getState(e);return e=null!=n?n.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)this.isSwimlaneIgnored(e[t])||this.swimlaneAdded(e[t])}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var n=this.getGraph().getModel(),t=n.getParent(e),a=n.getChildCount(t),i=null,s=0;s<a;s++){var o=n.getChildAt(t,s);if(o!=e&&!this.isSwimlaneIgnored(o)&&null!=(i=n.getGeometry(o)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isSwimlaneIgnored(e[t])){var a=n.getGeometry(e[t]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),s=o=e[t];null!=s;){var o=s,r=(s=n.getParent(s),this.graph.isSwimlane(s)?this.graph.getStartSize(s):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(o,i.width,i.height)}}}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,n,t){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=t||!i&&r.width!=n)&&(r=r.clone(),i?r.height=t:r.width=n,a.setGeometry(e,r))}var s=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;n-=s.width,t-=s.height;for(var o=a.getChildCount(e),r=0;r<o;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,n,t)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,n,t,a,i){a=null==a||a,i=null==i||i;var s=mxCellPath.create(e.cell),o=this.deltas[s];return null==o?(o=new mxPoint(n,t),this.deltas[s]=o,this.count++):a?(o.X+=n,o.Y+=t):(o.X=n,o.Y=t),i&&this.addEdges(e),o},mxCellStatePreview.prototype.show=function(e){var n,t=this.graph.getModel(),a=t.getRoot();for(n in this.deltas){var i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n];i=this.graph.view.getState(t.getParent(i));this.translateState(i,s,o.x,o.y)}for(n in this.deltas)i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n],i=this.graph.view.getState(t.getParent(i)),this.revalidateState(i,s,o.x,o.y,e)},mxCellStatePreview.prototype.translateState=function(e,n,t,a){if(null!=n){var i=this.graph.getModel();if(i.isVertex(n.cell)){n.invalid=!0,this.graph.view.validateBounds(e,n.cell),e=i.getGeometry(n.cell);var s=mxCellPath.create(n.cell);0==t&&0==a||null==e||e.relative&&null==this.deltas[s]||(n.x+=t,n.y+=a)}for(e=i.getChildCount(n.cell),s=0;s<e;s++)this.translateState(n,this.graph.view.getState(i.getChildAt(n.cell,s)),t,a)}},mxCellStatePreview.prototype.revalidateState=function(e,n,t,a,i){if(null!=n){n.invalid=!0,this.graph.view.validatePoints(e,n.cell);var s=mxCellPath.create(n.cell),o=this.graph.getModel(),r=this.graph.getCellGeometry(n.cell);for(0==t&&0==a||null==r||!r.relative||!o.isVertex(n.cell)||null!=e&&!o.isVertex(e.cell)&&null==this.deltas[s]||(n.x+=t,n.y+=a,this.graph.cellRenderer.redraw(n)),null!=i&&i(n),e=o.getChildCount(n.cell),s=0;s<e;s++)this.revalidateState(n,this.graph.view.getState(o.getChildAt(n.cell,s)),t,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var n=this.graph.getModel(),t=n.getEdgeCount(e.cell),a=0;a<t;a++){var i=this.graph.view.getState(n.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&null!=n.getState()){var t=this.getInitialCellForEvent(n);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(t),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(t,n.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(t);this.graph.isCellMovable(t)&&(!a.isEdge(t)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(t,!0)||null==a.getTerminal(t,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(n.getEvent())&&this.graph.isCellsCloneable())&&this.start(t,n.getX(),n.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=n.getSource().nodeName?n.consume():mxClient.IS_SF&&"SELECT"==n.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),n=this.graph.getModel(),t=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&n.isVertex(e)&&null!=n.getGeometry(e)&&!n.getGeometry(e).relative});return this.graph.view.getCellStates(n.filterDescendants(t,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var s=i;t.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(s=i.shape.boundingBox),null==n?n=new mxRectangle(s.x,s.y,s.width,s.height):n.add(s)}}return n},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,n,t){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,n,t),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var n=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/n)*n,e.y=this.graph.snap(e.y/n)*n,e},mxGraphHandler.prototype.mouseMove=function(e,n){var t=this.graph;if(!n.isConsumed()&&t.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(s=mxUtils.convertPoint(t.container,n.getX(),n.getY())).x-this.first.x,i=s.y-this.first.y,s=t.tolerance;if(null!=this.shape||Math.abs(a)>s||Math.abs(i)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var o=t.isGridEnabledEvent(n.getEvent());s=!0;if(null!=this.guide&&this.useGuidesForEvent(n))s=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),o)).x,i=i.y;else if(o){var r=t.getView().translate,l=t.getView().scale;o=this.bounds.x-(t.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(t.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-o,i=i.y-r}for(null!=this.guide&&s&&this.guide.hide(),t.isConstrainedEvent(n.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),s=null,i=n.getCell(),t.isDropEnabled()&&this.highlightEnabled&&(s=t.getDropTarget(this.cells,n.getEvent(),i)),o=s,r=t.getModel();null!=o&&o!=this.cells[0];)o=r.getParent(o);l=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=t.getView().getState(s))||null!=o||r.getParent(this.cell)==s&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&t.getModel().isVertex(i)&&t.isCellConnectable(i)&&(null!=(a=t.getView().getState(i))&&(t=null==t.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(t),d=!0))):(this.target!=s&&(this.target=s,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}n.consume(),mxEvent.consume(n.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||n.isConsumed()||null==n.getState()||t.isMouseDown||(null==(a=t.getCursorForCell(n.getCell()))&&t.isEnabled()&&t.isCellMovable(n.getCell())&&(a=t.getModel().isEdge(n.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),n.getState().setCursor(a),n.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()){var t=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=t.getView().scale,i=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled(),s=this.currentDx/a,o=(a=this.currentDy/a,n.getCell());this.connectOnDrop&&null==this.target&&null!=o&&t.getModel().isVertex(o)&&t.isCellConnectable(o)&&t.isEdgeValid(null,this.cell,o)?t.connectionHandler.connect(this.cell,o,n.getEvent()):(o=this.target,t.isSplitEnabled()&&t.isSplitTarget(o,this.cells,n.getEvent())?t.splitEdge(o,this.cells,null,s,a):this.moveCells(this.cells,s,a,i,this.target,n.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(n)}this.cellWasClicked&&n.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());t=mxUtils.getRotatedPoint(t,n,a,i)}return null!=e&&!mxUtils.contains(e,t.x,t.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,n,t,a,i,s){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,s)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,n-this.graph.panDx/this.graph.view.scale,t-this.graph.panDy/this.graph.view.scale,a,i,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(n)||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)},mxPanningHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var t=mxUtils.convertPoint(this.graph.container,n.getX(),n.getY());this.triggerX=t.x,this.triggerY=t.y,this.popupTrigger=this.isPopupTrigger(n),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(n),this.startX=n.getX(),this.startY=n.getY(),this.panningTrigger&&this.consumePanningTrigger(n)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,n){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a)),this.graph.panGraph(t+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",n)),n.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(t)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",n))}},mxPanningHandler.prototype.mouseUp=function(e,n){var t=Math.abs(n.getX()-this.startX),a=Math.abs(n.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){t=n.getX()-this.startX,a=n.getY()-this.startY,this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a));var i=this.graph.getView().scale,s=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(s.x+t/i,s.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",n)),n.consume()}else this.popupTrigger&&t<this.graph.tolerance&&a<this.graph.tolerance&&(t=this.getCellForPopupEvent(n),this.graph.isEnabled()&&this.selectOnPopup&&null!=t&&!this.graph.isCellSelected(t)?this.graph.setSelectionCell(t):this.clearSelectionOnBackground&&null==t&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(n.getX()+a.x,n.getY()+a.y),this.popup(a.x+1,a.y+1,t,n.getEvent()),n.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,n){this.graph.getView().setTranslate(e,n)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var n=null;if(this.isEnabled()){var t=null!=(n=this.getState(e))&&this.isValidState(n);e=this.getMarkerColor(e.getEvent(),n,t),this.validState=t?n:null,n==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=n&&null!=this.currentColor?(this.markedState=n,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return n},mxCellMarker.prototype.markCell=function(e,n){var t=this.graph.getView().getState(e);null!=t&&(this.currentColor=null!=n?n:this.validColor,this.markedState=t,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,n,t){return t?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var n=this.graph.getView();return cell=this.getCell(e),null!=(n=this.getStateToMark(n.getState(cell)))&&this.intersects(n,e)?n:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,n){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,n.getGraphX(),n.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,n){n.reset.apply(n)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var n=this.graph.getSelectionCells(),t=0;t<n.length;t++){var a=this.graph.view.getState(n[t]);if(null!=a){var i=e.remove(n[t]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(n[t],i)}}e.visit(mxUtils.bind(this,function(e,n){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",n.state)),n.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseDown.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseMove.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseUp.apply(n,t)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var n=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,n)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,n){return n=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(n)?(null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(n)||(n=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),n):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,n,t){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,n){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,n,t,a){this.previous=e,this.first=new mxPoint(n,t),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,n){return this.isValidTarget(n)?this.graph.getEdgeValidationError(null,e,n):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null==(i=this.getConnectImage(e))||null==e)return null;this.iconState=e;var n=[],t=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);t.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=t.node.previousSibling&&t.node.parentNode.insertBefore(t.node,t.node.parentNode.firstChild)),t.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=t,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(t.node,this.graph,a,i),n.push(t),this.redrawIcons(n,this.iconState),n},mxConnectionHandler.prototype.redrawIcons=function(e,n){if(null!=e&&null!=e[0]&&null!=n){var t=this.getIconPosition(e[0],n);e[0].bounds.x=t.x,e[0].bounds.y=t.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,n){var t=this.graph.getView().scale,a=n.getCenterX(),i=n.getCenterY();if(this.graph.isSwimlane(n.cell)){a=0!=(s=this.graph.getStartSize(n.cell)).width?n.x+s.width*t/2:a,i=0!=s.height?n.y+s.height*t/2:i;if(0!=(s=mxUtils.toRadians(mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(s);var s=Math.sin(s),o=new mxPoint(n.getCenterX(),n.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),t,s,o)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var n=0;n<e.length;n++)e[n].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,n){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!n.isConsumed()&&!this.isConnecting()&&this.isStartEvent(n)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(n.getGraphX(),n.getGraphY()),this.edgeState=this.createEdgeState(n),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var t=this.graph.getPointForEvent(n.getEvent());this.edgeState.cell.geometry.setTerminalPoint(t,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),n.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=n.getX(),this.initialTouchY=n.getY();var a=this.graph.view.getState(this.marker.getCell(n));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(n,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,n){null!=n&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=n,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=n,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var n=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=n},mxConnectionHandler.prototype.convertWaypoint=function(e){var n=this.graph.getView().getScale(),t=this.graph.getView().getTranslate();e.x=e.x/n-t.x,e.y=e.y/n-t.y},mxConnectionHandler.prototype.mouseMove=function(e,n){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-n.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-n.getY())<this.tapAndHoldTolerance),n.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(n),null!=this.first){var t=this.graph.getView().scale,a=null,i=t=new mxPoint(this.graph.snap(n.getGraphX()/t)*t,this.graph.snap(n.getGraphY()/t)*t);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var s=this.first;if(null!=this.selectedIcon){var o=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(o=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=o.x,this.selectedIcon.bounds.y=o.y):(o=new mxRectangle(n.getGraphX()+this.connectIconOffset.x,n.getGraphY()+this.connectIconOffset.y,o,r),this.selectedIcon.bounds=o),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(s=null)!=this.waypoints)for(s=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),s[i]=a;this.graph.view.updatePoints(this.edgeState,s,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],s=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(o=this.getTargetPerimeterPoint(this.currentState,n))&&(i=o)),null==this.sourceConstraint&&null!=this.previous&&(null!=(o=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,n))&&(s=o));if(null==this.currentState&&this.movePreviewAway){if(o=s,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(o=a)),a=i.x-o.x,o=i.y-o.y,0==(r=Math.sqrt(a*a+o*o)))return;i.x-=4*a/r,i.y-=4*o/r}null==this.shape&&(a=Math.abs(t.x-this.first.x),o=Math.abs(t.y-this.first.y),a>this.graph.tolerance||o>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(n)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(t=[s],null!=this.waypoints&&(t=t.concat(this.waypoints)),t.push(i),this.shape.points=t),this.drawPreview()),mxEvent.consume(n.getEvent()),n.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),n.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&n.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(t=!1,s=n.getSource(),i=0;i<this.icons.length&&!t;i++)t=s==this.icons[i].node||s.parentNode==this.icons[i].node;t||this.updateIcons(this.currentState,this.icons,n)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,n){var t=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,s,!1))&&(t=i)}else t=new mxPoint(e.getCenterX(),e.getCenterY());return t},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,n,t){t=null;var a=e.view,i=a.getPerimeterFunction(e),s=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-o*(Math.PI/180);0!=o&&(n=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(r),Math.sin(r),s)),null!=(e=i(a.getPerimeterBounds(e),e,n,!1))&&(0!=o&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),s)),t=e)}else t=s;return t},mxConnectionHandler.prototype.updateIcons=function(e,n,t){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var n=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),t=Math.abs(n.x-this.first.x);n=Math.abs(n.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(t>this.graph.tolerance||n>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),t=this.graph.view.scale,n=new mxPoint(this.graph.snap(e.getGraphX()/t)*t,this.graph.snap(e.getGraphY()/t)*t),this.waypoints.push(n))},mxConnectionHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(n))return this.addWaypointForEvent(n),void n.consume();if(null==this.error){var t=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(t,a,n.getEvent(),n.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),n.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,n,t,a){if(null!=n||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),s=null;i.beginUpdate();try{if(null!=e&&null==n&&this.isCreateTarget()&&null!=(n=this.createTargetVertex(t,e))){if(null!=(a=this.graph.getDropTarget([n],t,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var o=this.graph.getView().getState(a);if(null!=o){var r=i.getGeometry(n);r.x-=o.origin.x,r.y-=o.origin.y}}this.graph.addCell(n,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=n&&i.getParent(e)==i.getParent(n)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=n.geometry&&n.geometry.relative&&(l=i.getParent(l))),r=o=null,null!=this.edgeState&&(o=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(s=this.insertEdge(l,null,o,e,n,r))){this.graph.setConnectionConstraint(s,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(s,n,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(s,this.edgeState.cell.geometry);var d=i.getGeometry(s);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(s,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==n&&((u=this.graph.getPointForEvent(t,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",s,"event",t,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(s,n)}},mxConnectionHandler.prototype.selectCells=function(e,n){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,n,t,a,i,s){return null==this.factoryMethod?this.graph.insertEdge(e,n,t,a,i,s):(n=this.createEdge(t,a,i,s),this.graph.addEdge(n,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,n){for(var t=this.graph.getCellGeometry(n);null!=t&&t.relative;)n=this.graph.getModel().getParent(n),t=this.graph.getCellGeometry(n);var a=this.graph.cloneCells([n])[0];if(null!=(t=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(t.x=this.graph.snap(i.x-t.width/2)-this.graph.panDx/this.graph.view.scale,t.y=this.graph.snap(i.y-t.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var s=this.graph.view.getState(n);if(null!=s){var o=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=o?t.x=s.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=o&&(t.y=s.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,n,t,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(n,t,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,n,t){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,n){return!1},mxConstraintHandler.prototype.update=function(e,n){if(this.isEnabled()&&!this.isEventIgnored(e)){var t=this.getTolerance(),a=new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),n):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var s,o=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(s=this.getImageForConstraint(e.getState(),this.constraints[i],o)).src;(s=new mxImageShape(s=new mxRectangle(o.x-s.width/2,o.y-s.height/2,s.width,s.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getOverlayPane()),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,r),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(o)}this.currentFocusArea.grow(t)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(t=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(t.width-=1,t.height-=1),null==this.focusHighlight?((t=new mxRectangleShape(t,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.focusHighlight=t,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(t.node,this.graph,r)):(this.focusHighlight.bounds=t,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(n.getEvent())||null==n.getState())){var t=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=t.x,a.y-=t.y,this.start(n.getX()+a.x,n.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,s=function(e){e=new mxMouseEvent(e);var n=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=n.x,e.graphY=n.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,s(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,s(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}n.consume(!1)}},mxRubberband.prototype.start=function(e,n){this.first=new mxPoint(e,n)},mxRubberband.prototype.mouseMove=function(e,n){if(!n.isConsumed()&&null!=this.first){var t=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);t.x-=a.x,t.y-=a.y;a=n.getX()+t.x,t=n.getY()+t.y;var i=this.first.x-a,s=this.first.y-t,o=this.graph.tolerance;(null!=this.div||Math.abs(i)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,t),n.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,n){var t=null!=this.div;this.reset(),t&&(t=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(t,n.getEvent()),n.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,n){this.currentX=e,this.currentY=n,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,n=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,n),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,n)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var n=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",n++)),this.sizers.push(this.createSizer("n-resize",n++)),this.sizers.push(this.createSizer("ne-resize",n++)),this.sizers.push(this.createSizer("w-resize",n++)),this.sizers.push(this.createSizer("e-resize",n++)),this.sizers.push(this.createSizer("sw-resize",n++)),this.sizers.push(this.createSizer("s-resize",n++))),this.sizers.push(this.createSizer("se-resize",n++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,n,t,a){return t=new mxRectangle(0,0,t=t||mxConstants.HANDLE_SIZE,t),(a=this.createSizerShape(t,n,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(n)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,n,t){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):n==mxEvent.ROTATION_HANDLE?new mxEllipse(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,n,t){null!=e&&(e.bounds.x=Math.round(n-e.bounds.width/2),e.bounds.y=Math.round(t-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.sizers.length;t++)if(e.isSource(this.sizers[t])||null!=n&&mxUtils.intersects(this.sizers[t].bounds,n))return t;return null},mxVertexHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(0<this.tolerance||n.getState()==this.state)){var t=this.getHandleForEvent(n);null!=t&&(this.start(n.getX(),n.getY(),t),n.consume())}},mxVertexHandler.prototype.start=function(e,n,t){e=mxUtils.convertPoint(this.graph.container,e,n),this.startX=e.x,this.startY=e.y,this.index=t,this.selectionBorder.node.style.display=t==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,n){if(n.isConsumed()||null==this.index)null!=this.getHandleForEvent(n)&&n.consume(!1);else{var t=new mxPoint(n.getGraphX(),n.getGraphY()),a=this.graph.isGridEnabledEvent(n.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(t.x=this.graph.snap(t.x/i)*i,t.y=this.graph.snap(t.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],t.x,t.y);else if(this.index==mxEvent.ROTATION_HANDLE){var s=this.state.x+this.state.width/2-t.x,o=this.state.y+this.state.height/2-t.y;this.currentAlpha=0!=s?180*Math.atan(o/s)/Math.PI+90:o<0?180:0,0<s&&(this.currentAlpha-=180),this.rotationRaster&&(s=t.x-this.state.getCenterX(),o=t.y-this.state.getCenterY(),s=Math.abs(Math.sqrt(s*s+o*o)-this.state.height/2-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(s))))),this.currentAlpha=Math.round(this.currentAlpha/s)*s),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(s=t.x-this.startX,o=t.y-this.startY,t=this.graph.view.translate,d*s+l*o);s=l*s-d*o;this.bounds=this.union(this.selectionBounds,s,m,this.index,a,i,t),l=Math.cos(r),c=(d=Math.sin(r))*(s=(o=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(o=o.y-c.y)-o,this.bounds.x+=l*s-d*o-s,this.bounds.y+=c,this.drawPreview()}n.consume()}},mxVertexHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&null!=this.index&&null!=this.state){var t=new mxPoint(n.getGraphX(),n.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(n.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(-i),o=Math.sin(-i),r=(t=o*(r=t.x-this.startX)+s*(l=t.y-this.startY),s*r-o*l),l=t,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),n.consume()}},mxVertexHandler.prototype.rotateCell=function(e,n){var t=this.graph.getModel();if(t.isVertex(e)){if(null!=(s=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(s.style[mxConstants.STYLE_ROTATION]||0)+n,[e]),this.state.cell!=e&&(null!=(s=this.graph.getCellGeometry(e))&&!s.relative))if(0!=n){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!s.relative&&null!=i){var s,o=mxUtils.toRadians(n),r=(a=Math.cos(o),o=Math.sin(o),new mxPoint(s.getCenterX(),s.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,o,i);(s=s.clone()).x=a.x-s.width/2,s.y=a.y-s.height/2,t.setGeometry(e,s)}}else(s=s.clone()).x+=dx,s.y+=dy,t.setGeometry(e,s);for(s=t.getChildCount(e),a=0;a<s;a++)this.rotateCell(t.getChildAt(e,a),n)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,n,t,a,i){var s=this.graph.model.getGeometry(e);if(null!=s)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,n=(this.labelShape.bounds.getCenterX()-this.startX)/a,t=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(s=s.clone()).offset?s.offset=new mxPoint(n,t):(s.offset.x+=n,s.offset.y+=t),this.graph.model.setGeometry(e,s);else{if(a=this.union(s,n,t,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){n=a.getCenterX()-s.getCenterX(),t=a.getCenterY()-s.getCenterY(),i=Math.cos(r);var o=Math.sin(r),r=i*n-o*t-n;n=o*n+i*t-t,t=a.x-s.x;var l=a.y-s.y,d=i*t-o*l;i=o*t+i*l,a.x+=r,a.y+=n,this.graph.isCellCollapsed(e)||0==r&&0==n||(t=s.x-a.x+d,l=s.y-a.y+i,this.moveChildren(e,t,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,n,t){for(var a=this.graph.getModel(),i=a.getChildCount(e),s=0;s<i;s++){var o=a.getChildAt(e,s);if(a.isVertex(o)){var r=this.graph.getCellGeometry(o);null!=r&&!r.relative&&((r=r.clone()).x+=n,r.y+=t,a.setGeometry(o,r))}}},mxVertexHandler.prototype.union=function(e,n,t,a,i,s,o){if(this.singleSizer){o=e.x+e.width+n;var r=e.y+e.height+t;return i&&(o=this.graph.snap(o/s)*s,r=this.graph.snap(r/s)*s),(s=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(o,r,0,0)),s}var l=(r=e.x-o.x*s)+e.width,d=e.y-o.y*s;return e=d+e.height,4<a?(e+=t,i&&(e=this.graph.snap(e/s)*s)):a<3&&(d+=t,i&&(d=this.graph.snap(d/s)*s)),0==a||3==a||5==a?(r+=n,i&&(r=this.graph.snap(r/s)*s)):2!=a&&4!=a&&7!=a||(l+=n,i&&(l=this.graph.snap(l/s)*s)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+o.x*s,d+o.y*s,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var n=e.x+e.width,t=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],n,t);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var s=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=(s=Math.sin(s),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),o,s,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=n,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=n,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=n,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),s=Math.sin(s),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),o,s,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var n=this.state.cell;if(null!=this.index){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.graph.getCellAt(t.x,t.y);this.graph.isSwimlane(n)&&this.graph.hitsSwimlaneContent(n,t.x,t.y)&&(n=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(n)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var n=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(n))return null;var t=a.graph.getModel();return(n==a.state.cell||null!=n&&!a.graph.connectableEdges&&t.isEdge(n))&&(n=null),n},e.isValidState=function(e){var n=a.graph.getModel();n=null!=(n=a.graph.view.getTerminalPort(e,a.graph.view.getState(n.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?n.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:n,a.isSource?n:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,n){return this.graph.getEdgeValidationError(this.state.cell,e,n)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,n=[],t=0;t<this.abspoints.length;t++)if(this.isHandleVisible(t)){var a=t==this.abspoints.length-1;if((a=0==t||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(t);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(t))if(mxClient.IS_TOUCH){var s=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,s)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);n.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return n},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.bends.length;t++)if((e.isSource(this.bends[t])||null!=n&&mxUtils.intersects(this.bends[t].bounds,n))&&"hidden"!=this.bends[t].node.style.visibility)return t;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,n){var t=null;null!=(t=this.getHandleForEvent(n))&&!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(n.getEvent())?this.removePoint(this.state,t):(t!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(n.getCell()))&&this.start(n.getX(),n.getY(),t),n.consume())},mxEdgeHandler.prototype.start=function(e,n,t){this.startX=e,this.startY=n,this.isSource=null!=this.bends&&0==t,this.isTarget=null!=this.bends&&t==this.bends.length-1,this.isLabel=t==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(n=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=n&&this.graph.isCellDisconnectable(e,n,this.isSource))&&(this.index=t)):this.index=t},mxEdgeHandler.prototype.clonePreviewState=function(e,n){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var t=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),n=this.graph.getView(),i=!1,s=!1;if(this.snapToTerminals&&0<a){var o=function(e){if(null!=e){var n=e.x;Math.abs(t.x-n)<a&&(t.x=n,i=!0),e=e.y,Math.abs(t.y-e)<a&&(t.y=e,s=!0)}},r=function(e){null!=e&&o.call(this,new mxPoint(n.getRoutingCenterX(e),n.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&o.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=n.scale,r=n.translate,i||(t.x=(this.graph.snap(t.x/e-r.x)+r.x)*e),s||(t.y=(this.graph.snap(t.y/e-r.y)+r.y)*e)),t},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var n=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?n=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(n=this.constraintHandler.currentFocus),n},mxEdgeHandler.prototype.getPreviewPoints=function(e){var n=null!=(n=this.graph.getCellGeometry(this.state.cell)).points?n.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(n=null):(this.convertPoint(e,!1),null==n?n=[e]:n[this.index-1]=e),n},mxEdgeHandler.prototype.updatePreviewState=function(e,n,t){var a=this.isSource?t:this.state.getVisibleTerminalState(!0),i=this.isTarget?t:this.state.getVisibleTerminalState(!1),s=this.graph.getConnectionConstraint(e,a,!0),o=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?s=r:this.isTarget&&(o=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,s),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,o),(this.isSource||this.isTarget)&&null==t&&(e.setAbsoluteTerminalPoint(n,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.getPointForEvent(n);if(this.isLabel)this.label.x=t.x,this.label.y=t.y;else{this.points=this.getPreviewPoints(t);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(n):null,i=this.clonePreviewState(t,null!=a?a.cell:null);this.updatePreviewState(i,t,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(n.getEvent()),n.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(n)&&n.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.state.cell;if(n.getX()!=this.startX||n.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)t=this.connect(t,a,this.isSource,this.graph.isCloneEvent(n.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),n);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(t));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(t,a,this.isSource)}}else this.active?this.changePoints(t,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),t!=this.state.cell&&this.graph.setSelectionCell(t)),n.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x),e.y=Math.round(e.y/t-a.y),null!=(t=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=t.origin.x,e.y-=t.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,n,t){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),s=this.graph.getView().getRelativePoint(e,n,t);i.x=s.x,i.y=s.y;var o=this.graph.getView().scale;i.offset=new mxPoint(0,0),s=this.graph.view.getPoint(e,i),i.offset=new mxPoint((n-s.x)/o,(t-s.y)/o),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,n,t,a,i){var s=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var o=e.clone();i.add(s,o,i.getChildCount(s));var r=i.getTerminal(e,!t);this.graph.connectCell(o,r,!t),e=o}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,n,t,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(n,t),a.setGeometry(e,i),this.graph.connectCell(e,null,t,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,n){var t=this.graph.getModel(),a=t.getGeometry(e);null!=a&&((a=a.clone()).points=n,t.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,n){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.graph.isGridEnabledEvent(n);this.convertPoint(t,a),this.addPointAt(e,t.x,t.y),mxEvent.consume(n)},mxEdgeHandler.prototype.addPointAt=function(e,n,t){var a=this.graph.getCellGeometry(e.cell);if(n=new mxPoint(n,t),null!=a){a=a.clone(),t=this.graph.view.translate;var i=this.graph.view.scale;t=mxUtils.findNearestSegment(e,(n.x+t.x)*i,(n.y+t.y)*i),null==a.points?a.points=[n]:a.points.splice(t,0,n),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,n){if(0<n&&n<this.abspoints.length-1){var t=this.graph.getCellGeometry(this.state.cell);null!=t&&null!=t.points&&((t=t.clone()).points.splice(n-1,1),this.graph.getModel().setGeometry(e.cell,t),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var n=this.state.cell,t=this.graph.getModel().getTerminal(n,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=t&&!this.graph.isCellDisconnectable(n,t,e)||null==t&&!this.graph.isTerminalPointMovable(n,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=t&&this.graph.isCellDisconnectable(n,t,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,n=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-n/2),Math.round(this.label.y-n/2),n,n),this.labelShape.redraw(),null!=(n=this.graph.getLabel(e))&&0<n.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var t=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);n=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-n.width/2),Math.round(a-n.height/2),n.width,n.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[t];var i=this.abspoints[t].x,s=(t=this.abspoints[t].y,this.bends.length-1);n=this.bends[s].bounds;this.bends[s].bounds=new mxRectangle(Math.round(i-n.width/2),Math.round(t-n.height/2),n.width,n.height),this.bends[s].fill=this.getHandleFillColor(s),this.bends[s].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=t){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,s=this.abspoints[a].y,o=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-o.width/2),Math.round(s-o.height/2),o.width,o.height),this.bends[a].redraw(),this.points[a-1]=t[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);return this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),n=this.createHandleShape(2),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var n=this.getCursorForBend();return e.node.style.cursor=n,n=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,n),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var n=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(n=this.doubleClickOrientationResource,n=mxResources.get(n)||n),n},mxElbowEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x-i.x),e.y=Math.round(e.y/t-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=null==(t=null!=(t=this.graph.getModel().getGeometry(this.state.cell).points)?t[0]:null)?new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2):new mxPoint(this.graph.getView().scale*(t.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(t.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(s,this.labelShape.bounds)&&(a+=3,i+=3,s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i)),this.bends[1].bounds=s,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var n=this.state.absolutePoints,t=n[0].clone();this.convertPoint(t,!1);for(var a=[],i=1;i<n.length;i++){var s=n[i].clone();this.convertPoint(s,!1),i==this.index&&(t.x==s.x?(t.x=e.x,s.x=e.x):(t.y=e.y,s.y=e.y)),i<n.length-1&&a.push(s),t=s}if(1==a.length){if(t=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(s=this.state.getVisibleTerminalState(!1))&null!=i){var o=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(s,a[0].x+o,a[0].y+r)?n[1].y==n[2].y?a[0].y=t.getRoutingCenterY(i)-r:a[0].x=t.getRoutingCenterX(i)-o:mxUtils.contains(i,a[0].x+o,a[0].y+r)&&(n[1].y==n[0].y?a[0].y=t.getRoutingCenterY(s)-r:a[0].x=t.getRoutingCenterX(s)-o)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none");var t=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<t.length-1;a++)n=this.createVirtualBend(),e.push(n),n.node.style.cursor=0==t[a].x-t[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none")}return n=this.createHandleShape(t.length),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,n){if(this.graph.isCellBendable(this.state.cell)){var t=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],n=a[i+1];var s=new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(s.x-t/2),Math.round(s.y-t/2),t,t),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,n){n=[];var t=this.abspoints;if(1<t.length)for(var a=t[0],i=t[1],s=2;s<t.length;s++){var o=t[s];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(o.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(o.y)||(i=(a=i).clone(),this.convertPoint(i,!1),n.push(i)),i=o}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,n){this.normalKeys[e]=n},mxKeyHandler.prototype.bindShiftKey=function(e,n){this.shiftKeys[e]=n},mxKeyHandler.prototype.bindControlKey=function(e,n){this.controlKeys[e]=n},mxKeyHandler.prototype.bindControlShiftKey=function(e,n){this.controlShiftKeys[e]=n},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var n=this.getFunction(e);null!=n&&(n(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,n){this.reset(n,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,n){n.getX()==this.lastX&&n.getY()==this.lastY||(this.reset(n,!0),(this.isHideOnHover()||n.getState()!=this.state||n.getSource()!=this.node&&(!this.stateSource||null!=n.getState()&&this.stateSource==(n.isSource(n.getState().shape)||!n.isSource(n.getState().text))))&&this.hideTooltip()),this.lastX=n.getX(),this.lastY=n.getY()},mxTooltipHandler.prototype.mouseUp=function(e,n){this.reset(n,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,n){if(this.resetTimer(),n&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var t=e.getState(),a=e.getSource(),i=e.getX(),s=e.getY(),o=e.isSource(t.shape)||e.isSource(t.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(t,a,i,s);this.show(e,i,s),this.state=t,this.node=a,this.stateSource=o}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,n,t){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=n+a.x+"px",this.div.style.top=t+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,n){},mxCellTracker.prototype.mouseMove=function(e,n){this.isEnabled()&&this.process(n)},mxCellTracker.prototype.mouseUp=function(e,n){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(n)});t?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,n,t,a){if(null!=this.config){var i=this.createConditions(e,t,a);this.addItems(e,n,t,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,n,t,a,i,s,o){for(var r=!1;null!=s;){if("add"==s.nodeName){if(null==(l=s.getAttribute("if"))||i[l]){var l=s.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(s))),c=s.getAttribute("action"),m=s.getAttribute("icon"),u=s.getAttribute("iconCls");r&&(n.addSeparator(o),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(n,e,l,m,d,c,t,o,u),this.addItems(e,n,t,a,i,s.firstChild,l)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,n,t,a,i,s,o,r,l){return e.addItem(t,a,function(e){"function"==typeof i&&i.call(n,n,o,e),null!=s&&n.execute(s,o,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,n,t){var a=e.graph.getModel(),i=a.getChildCount(n),s=[];for(s.nocell=null==n,s.ncells=1<e.graph.getSelectionCount(),s.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),s.cell=null!=n,a=null!=n&&1==e.graph.getSelectionCount(),s.nonEmpty=a&&0<i,s.expandable=a&&e.graph.isCellFoldable(n,!1),s.collapsable=a&&e.graph.isCellFoldable(n,!0),s.validRoot=a&&e.graph.isValidRoot(n),s.emptyValidRoot=s.validRoot&&0==i,s.swimlane=a&&e.graph.isSwimlane(n),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var o=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof o&&(s[r]=o(e,n,t))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,n){var t=n.getProperty("function");this.editor.insertFunction=null!=t?mxUtils.bind(this,function(){t.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,n,t,a){var i=mxUtils.bind(this,function(){null!=t&&0<t.length&&this.editor.execute(t)});return this.toolbar.addItem(e,n,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(t)});this.addOption(e,n,a)},mxDefaultToolbar.prototype.addOption=function(e,n,t){return this.toolbar.addOption(e,n,t)},mxDefaultToolbar.prototype.addMode=function(e,n,t,a,i){var s=mxUtils.bind(this,function(){this.editor.setMode(t),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,n,s,a)},mxDefaultToolbar.prototype.addPrototype=function(e,n,t,a,i,s){var o=function(){return"function"==typeof t?t():null!=t?t.clone():null},r=mxUtils.bind(this,function(e,n){"function"==typeof i?i(this.editor,o(),e,n):this.drop(o(),e,n),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,n,r,a,null,s),this.installDropHandler(e,function(e,n,t){r(n,t)}),e},mxDefaultToolbar.prototype.drop=function(e,n,t){var a=this.editor.graph,i=a.getModel();if(null!=t&&!i.isEdge(t)&&this.connectOnDrop&&a.isCellConnectable(t))this.connect(e,n,t);else{for(;null!=t&&!a.isValidDropTarget(t,[e],n);)t=i.getParent(t);this.insert(e,n,t)}},mxDefaultToolbar.prototype.insert=function(e,n,t){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(n),s=mxEvent.getClientY(n);i=mxUtils.convertPoint(a.container,i,s);return a.isSplitEnabled()&&a.isSplitTarget(t,[e],n)?a.splitEdge(t,[e],null,i.x,i.y):this.editor.addVertex(t,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,n,t){var a=(n=this.editor.graph).getModel();if(null!=t&&n.isCellConnectable(e)&&n.isEdgeValid(null,t,e)){var i=null;a.beginUpdate();try{var s=a.getGeometry(t),o=a.getGeometry(e).clone();o.x=s.x+(s.width-o.width)/2,o.y=s.y+(s.height-o.height)/2;var r=this.spacing*n.gridSize,l=20*a.getDirectedEdgeCount(t,!0);this.editor.horizontalFlow?o.x+=(o.width+s.width)/2+r+l:o.y+=(o.height+s.height)/2+r+l,e.setGeometry(o);var d=a.getParent(t);if(n.addCell(e,d),n.constrainChild(e),i=this.editor.createEdge(t,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}n.addEdge(i,d,t,e)}finally{a.endUpdate()}n.setSelectionCells([e,i]),n.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(n,t){var a=document.createElement("img");a.setAttribute("src",n.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*n.offsetWidth+"px",a.style.height=2*n.offsetHeight+"px",mxUtils.makeDraggable(n,this.editor.graph,t,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var n=e.getUrlImage();if(null==n||mxClient.IS_LOCAL)e.execute("show");else{var t=mxUtils.getViewXml(e.graph,1);t=mxUtils.getXml(t,"\n");mxUtils.submit(n,e.postParameterName+"="+encodeURIComponent(t),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,n){e.showProperties(n)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,n){e.graph.isEnabled()&&e.graph.isCellEditable(n)&&e.graph.startEditingAtCell(n)}),this.addAction("toBack",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,n){e.graph.enterGroup(n)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!0,!1,n)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!1,!1,n)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var n=100*e.graph.getView().scale;n=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,n))/100;isNaN(n)||e.graph.getView().setScale(n)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,n){this.actions[e]=n},mxEditor.prototype.execute=function(n,e,t){var a=this.actions[n];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+n+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+n,280,!0)},mxEditor.prototype.addTemplate=function(e,n){this.templates[e]=n},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){return this.createPopupMenu(e,n,t)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,n){return this.createEdge(e,n)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var n=null,t=i.graph.getModel();return null!=t.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),n=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==t.getParent(t.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),n=i.diagramLayout)),n},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,n){var t=n.getProperty("cell");null!=t&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,t),n.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");this.undoManager.undoableEditHappened(t)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,n){var t=n.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(t))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var n=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,n),e.getView().addListener(mxEvent.UP,n)},mxEditor.prototype.installChangeHandler=function(s){var e=mxUtils.bind(this,function(e,n){this.setModified(!0),1==this.validating&&s.validateGraph();for(var t=n.getProperty("edit").changes,a=0;a<t.length;a++){var i=t[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var t=this;e.addMouseListener({mouseDown:function(e,n){null==t.insertFunction||n.isPopupTrigger()||!t.forcedInserting&&null!=n.getState()||(t.graph.clearSelection(),t.insertFunction(n.getEvent(),n.getCell()),this.isActive=!0,n.consume())},mouseMove:function(e,n){this.isActive&&n.consume()},mouseUp:function(e,n){this.isActive&&(this.isActive=!1,n.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,n=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return n.isVertexIgnored=function(e){return!n.graph.isSwimlane(e)},n},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(n){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){n.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(n)},mxEditor.prototype.treeLayout=function(e,n){null!=e&&new mxCompactTreeLayout(this.graph,n).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",n=this.graph,t=n.getCurrentRoot();null!=t&&null!=n.getModel().getParent(n.getModel().getParent(t));)n.isValidRoot(t)&&(e=" > "+n.convertValueToString(t)+e),t=n.getModel().getParent(t);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var n=mxUtils.load(e).getXml();this.readGraphModel(n.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,n){if(null!=(e=e||this.getUrlPost())&&0<e.length){var t=this.writeGraphModel(n);this.postDiagram(e,t),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(n,t){this.escapePostData&&(t=encodeURIComponent(t)),mxUtils.post(n,this.postParameterName+"="+t,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",n,"data",t))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var n=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(n,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,n,t,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,n,t)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,n){null!=n.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,n){var t=this.graph.getStylesheet().styles[n];this.graph.getView().getStylesheet().putCellStyle(n,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,t),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var n=(t=mxUtils.getOffset(this.graph.container)).x+10,t=t.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(n+=a.x+Math.min(200,a.width),t+=a.y)}else n=this.properties.getX(),t=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,n,t,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var a=this.graph.getModel(),e=a.getValue(t);if(mxUtils.isNode(e)){var n=new mxForm("properties");n.addText("ID",t.getId()).setAttribute("readonly","true");var i=null,s=null,o=null,r=null,l=null;a.isVertex(t)&&(null!=(i=a.getGeometry(t))&&(s=n.addText("top",i.y),o=n.addText("left",i.x),r=n.addText("width",i.width),l=n.addText("height",i.height)));var d=a.getStyle(t),c=n.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=n.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(o.value),i.y=parseFloat(s.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(t,i)),0<c.value.length?a.setStyle(t,c.value):a.setStyle(t,null);for(var e=0;e<m.length;e++){var n=new mxCellAttributeChange(t,m[e].nodeName,u[e].value);a.execute(n)}this.graph.isAutoSizeCell(t)&&this.graph.updateCellSize(t)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),n.addButtons(e,d),n.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var n=document.createElement("div");n.style.padding="4px",n.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,n,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var t=mxUtils.bind(this,function(e){mxEvent.release(n),n.innerHTML="",this.createTasks(n)});this.graph.getModel().addListener(mxEvent.CHANGE,t),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,t),this.graph.addListener(mxEvent.ROOT,t),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(n)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var n=document.createElement("iframe");n.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),n.setAttribute("height","100%"),n.setAttribute("width","100%"),n.setAttribute("frameBorder","0"),n.style.backgroundColor="white",e=document.body.clientWidth;var t=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,n,(e-this.helpWidth)/2,(t-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){n.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var n=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),t=new mxOutline(this.graph,e);n.setClosable(!0),n.setResizable(!0),n.destroyOnClose=!1,n.addListener(mxEvent.RESIZE_END,function(){t.update()}),this.outline=n,this.outline.outline=t}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,n,t){this.popupHandler.createMenu(this,e,n,t)},mxEditor.prototype.createEdge=function(e,n){var t=null;if(null!=this.defaultEdge)t=this.graph.getModel().cloneCell(this.defaultEdge);else{(t=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,t.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&t.setStyle(a),t},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var n=this.consumeCycleAttribute(e);null!=n&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+n)}},mxEditor.prototype.addVertex=function(e,n,t,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(t,a);var s=this.graph.getView().scale,o=i.getGeometry(n),r=i.getGeometry(e);if(this.graph.isSwimlane(n)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(t-=l.origin.x*s,a-=l.origin.y*s,this.graph.isConstrainedMoving){r=o.width;var d=o.height,c=l.x+l.width;c<t+r&&(t-=t+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(t-=r.x*s,a-=r.y*s)}}(o=o.clone()).x=this.graph.snap(t/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(a/s-this.graph.getView().translate.y-this.graph.gridSize/2),n.setGeometry(o),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(n),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",n,"parent",e)),i.beginUpdate();try{null!=(n=this.graph.addCell(n,e))&&(this.graph.constrainChild(n),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",n)))}finally{i.endUpdate()}return null!=n&&(this.graph.setSelectionCell(n),this.graph.scrollCellToVisible(n),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",n))),n},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var n=e.getName();mxCodecRegistry.codecs[n]=e;var t=mxUtils.getFunctionName(e.template.constructor);t!=n&&mxCodecRegistry.addAlias(t,n)}return e},addAlias:function(e,n){mxCodecRegistry.aliases[e]=n},getCodec:function(e){var n=null;if(null!=e){n=mxUtils.getFunctionName(e);var t=mxCodecRegistry.aliases[n];if(null!=t&&(n=t),null==(n=mxCodecRegistry.codecs[n]))try{n=new mxObjectCodec(new e),mxCodecRegistry.register(n)}catch(e){}}return n}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,n,t,a){for(var i in this.template=e,this.exclude=null!=n?n:[],this.idrefs=null!=t?t:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,n){return this.objects[e]=n},mxCodec.prototype.getObject=function(e){var n=null;return null!=e&&(null==(n=this.objects[e])&&(null==(n=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(n=this.decode(e))))),n},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,n){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=n?n:"id",e)},mxCodec.prototype.getId=function(e){var n=null;return null!=e&&(null==(n=this.reference(e))&&e instanceof mxCell&&(null==(n=e.getId())&&(0==(n=mxCellPath.create(e)).length&&(n="root")))),n},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var n=null;if(null!=e&&null!=e.constructor){var t=mxCodecRegistry.getCodec(e.constructor);null!=t?n=t.encode(this,e):mxUtils.isNode(e)?n=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return n},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,n,t){if(n.appendChild(this.encode(e)),null==t||t){t=e.getChildCount();for(var a=0;a<t;a++)this.encodeCell(e.getChildAt(a),n)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,n){n=null==n||n;var t=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(t=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(t))for(var a=e.firstChild;null!=a&&!this.isCellCodec(t);)t=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(t)||(t=mxCodecRegistry.getCodec(mxCell)),t=t.decode(this,e),n&&this.insertIntoGraph(t)}return t},mxCodec.prototype.insertIntoGraph=function(e){var n=e.parent,t=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=n&&n.insert(e),null!=t&&t.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,n,t){null!=n&&null!=t&&e.setAttribute(n,t)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var n=this.reverse[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var n=this.mapping[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.isExcluded=function(e,n,t,a){return n==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,n)},mxObjectCodec.prototype.isReference=function(e,n,t,a){return 0<=mxUtils.indexOf(this.idrefs,n)},mxObjectCodec.prototype.encode=function(e,n){var t=e.document.createElement(this.getName());return n=this.beforeEncode(e,n,t),this.encodeObject(e,n,t),this.afterEncode(e,n,t)},mxObjectCodec.prototype.encodeObject=function(e,n,t){for(var a in e.setAttribute(t,"id",e.getId(n)),n){var i=a,s=n[i];null!=s&&!this.isExcluded(n,i,s,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,n,i,s,t))}},mxObjectCodec.prototype.encodeValue=function(e,n,t,a,i){if(null!=a){if(this.isReference(n,t,a,!0)){var s=e.getId(a);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+t+"="+a);a=s}s=this.template[t],(null==t||e.encodeDefaults||s!=a)&&(t=this.getAttributeName(t),this.writeAttribute(e,n,t,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,n,t,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,n,t,a,i):this.writeComplexAttribute(e,n,t,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,n,t,a,i){a=this.convertValueToXml(a),null==t?(n=e.document.createElement("add"),"function"==typeof a?n.appendChild(e.document.createTextNode(a)):e.setAttribute(n,"value",a),i.appendChild(n)):"function"!=typeof a&&e.setAttribute(i,t,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,n,t,a,i){null!=(e=e.encode(a))?(null!=t&&e.setAttribute("as",t),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+t+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,n,t){return n},mxObjectCodec.prototype.afterEncode=function(e,n,t){return t},mxObjectCodec.prototype.decode=function(e,n,t){var a=n.getAttribute("id"),i=e.objects[a];return null==i&&(i=t||this.cloneTemplate(),null!=a&&e.putObject(a,i)),n=this.beforeDecode(e,n,i),this.decodeNode(e,n,i),this.afterDecode(e,n,i)},mxObjectCodec.prototype.decodeNode=function(e,n,t){null!=n&&(this.decodeAttributes(e,n,t),this.decodeChildren(e,n,t))},mxObjectCodec.prototype.decodeAttributes=function(e,n,t){if(null!=(n=n.attributes))for(var a=0;a<n.length;a++)this.decodeAttribute(e,n[a],t)},mxObjectCodec.prototype.decodeAttribute=function(e,n,t){var a=n.nodeName;if("as"!=a&&"id"!=a){n="value"==a?n.nodeValue:this.convertValueFromXml(n.nodeValue);var i=this.getFieldName(a);if(this.isReference(t,i,n,!1)){if(null==(e=e.getObject(n)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+n);n=e}this.isExcluded(t,a,n,!1)||(t[a]=n)}},mxObjectCodec.prototype.decodeChildren=function(e,n,t){for(n=n.firstChild;null!=n;){var a=n.nextSibling;n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t)&&this.decodeChild(e,n,t),n=a}},mxObjectCodec.prototype.decodeChild=function(e,n,t){var a=this.getFieldName(n.getAttribute("as"));if(null==a||!this.isExcluded(t,a,n,!1)){var i=this.getFieldTemplate(t,a,n),s=null;"add"==n.nodeName?null==(s=n.getAttribute("value"))&&(s=mxUtils.eval(mxUtils.getTextContent(n))):s=e.decode(n,i),this.addObjectValue(t,a,s,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,n,t){return(e=e[n])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,n,t,a){null!=t&&t!=a&&(null!=n&&0<n.length?e[n]=t:e.push(t))},mxObjectCodec.prototype.processInclude=function(e,n,t){if("include"!=n.nodeName)return!1;if(null!=(n=n.getAttribute("name")))try{var a=mxUtils.load(n).getDocumentElement();null!=a&&e.decode(a,t)}catch(e){}return!0},mxObjectCodec.prototype.beforeDecode=function(e,n,t){return n},mxObjectCodec.prototype.afterDecode=function(e,n,t){return t},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,n,t,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==n&&t.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,n,t){if(null!=n.value&&n.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=t;(t=mxClient.IS_IE?n.value.cloneNode(!0):e.document.importNode(n.value,!0)).appendChild(a),e=a.getAttribute("id"),t.setAttribute("id",e),a.removeAttribute("id")}return t},e.beforeDecode=function(e,n,t){var a=n,i=this.getName();if(n.nodeName!=i?(null!=(a=n.getElementsByTagName(i)[0])&&a.parentNode==n?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,t.value=n.cloneNode(!0),null!=(n=t.value.getAttribute("id"))&&(t.setId(n),t.value.removeAttribute("id"))):t.setId(n.getAttribute("id")),null!=a)for(n=0;n<this.idrefs.length;n++){i=this.idrefs[n];var s=a.getAttribute(i);if(null!=s){a.removeAttribute(i);var o=e.objects[s]||e.lookup(s);null==o&&(null!=(s=e.getElementById(s))&&(o=(mxCodecRegistry.codecs[s.nodeName]||this).decode(e,s))),t[i]=o}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,n,t){var a=e.document.createElement("root");e.encodeCell(n.getRoot(),a),t.appendChild(a)},e.decodeChild=function(e,n,t){"root"==n.nodeName?this.decodeRoot(e,n,t):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,n,t){var a=null;for(n=n.firstChild;null!=n;){var i=e.decodeCell(n);null!=i&&null==i.getParent()&&(a=i),n=n.nextSibling}null!=a&&t.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,n,t){return e.encodeCell(n.root,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.root=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;)t=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=t}return n},e.afterDecode=function(e,n,t){return t.previous=t.root,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,n,t,a){return!("child"!=n||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,n)},e.afterEncode=function(e,n,t){return this.isReference(n,"child",n.child,!0)?t.setAttribute("child",e.getId(n.child)):e.encodeCell(n.child,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.child=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;){if(t=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=t}}else a=n.getAttribute("child"),t.child=e.getObject(a);return n},e.afterDecode=function(e,n,t){return t.child.parent=t.previous,t.previous=t.parent,t.previousIndex=t.index,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,n,t){return t.previous=t.terminal,t},e}());var mxGenericChangeCodec=function(e,a){var n=new mxObjectCodec(e,["model","previous"],["cell"]);return n.afterDecode=function(e,n,t){return mxUtils.isNode(t.cell)&&(t.cell=e.decodeCell(t.cell,!1)),t.previous=t[a],t},n};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,n){return this.encodeCell(e,n,n.graph.getModel().getRoot())},e.encodeCell=function(e,n,t){var a=n.graph.getModel(),i=n.getState(t),s=a.getParent(t);if(null==s||null!=i){var o=a.getChildCount(t),r=n.graph.getCellGeometry(t),l=null;if(s==a.getRoot()?l="layer":null==s?l="graph":a.isEdge(t)?l="edge":0<o&&null!=r?l="group":a.isVertex(t)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=n.graph.getLabel(t)&&(d.setAttribute("label",n.graph.getLabel(t)),n.graph.isHtmlLabel(t)&&d.setAttribute("html",!0)),null==s){var c=n.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",n.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(s=i.style[c])&&"object"==typeof s&&(s=mxStyleRegistry.getName(s)),null!=s&&"function"!=typeof s&&"object"!=typeof s&&d.setAttribute(c,s);if(null!=(s=i.absolutePoints)&&0<s.length){for(r=Math.round(s[0].x)+","+Math.round(s[0].y),c=1;c<s.length;c++)r+=" "+Math.round(s[c].x)+","+Math.round(s[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<o;c++)null!=(i=this.encodeCell(e,n,a.getChildAt(t,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,n){var t,a=e.document.createElement(this.getName());for(t in n.styles){var i=n.styles[t],s=e.document.createElement("add");if(null!=t){for(var o in s.setAttribute("as",t),i){var r=this.getStringValue(o,i[o]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",o),s.appendChild(l)}}0<s.childNodes.length&&a.appendChild(s)}}return a},e.getStringValue=function(e,n){var t=typeof n;return"function"==t?n=mxStyleRegistry.getName(style[j]):"object"==t&&(n=null),n},e.decode=function(e,n,t){t=t||new this.template.constructor;var a=n.getAttribute("id");for(null!=a&&(e.objects[a]=t),n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName&&null!=(a=n.getAttribute("as"))){var i=n.getAttribute("extend"),s=null!=i?mxUtils.clone(t.styles[i]):null;for(null==s&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),s={}),i=n.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var o=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(s[o]=l)}else"remove"==i.nodeName&&delete s[o]}i=i.nextSibling}t.putCellStyle(a,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t)for(n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName){var a=n.getAttribute("as"),i=n.getAttribute("action"),s=n.getAttribute("control");t.bindAction(a,i,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t){var a=t.editor;for(n=n.firstChild;null!=n;){if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t))if("separator"==n.nodeName)t.addSeparator();else if("br"==n.nodeName)t.toolbar.addBreak();else if("hr"==n.nodeName)t.toolbar.addLine();else if("add"==n.nodeName){var i=n.getAttribute("as"),s=(i=mxResources.get(i)||i,n.getAttribute("icon")),o=n.getAttribute("pressedIcon"),r=n.getAttribute("action"),l=n.getAttribute("mode"),d=n.getAttribute("template"),c="0"!=n.getAttribute("toggle"),m=mxUtils.getTextContent(n),u=null;if(null!=r)u=t.addItem(i,s,r,o);else if(null!=l){var p=mxUtils.eval(m);u=t.addMode(i,s,l,o,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=n.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=t.addPrototype(i,s,u,o,d,c);else if(0<(o=mxUtils.getChildNodes(n)).length)if(null==s)for(d=t.addActionCombo(i),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(d,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),c=c.getAttribute("action"),t.addActionOption(d,s,c));else{var g=null,v=t.addPrototype(i,s,function(){if(null==(e=a.templates[g.value]))return mxLog.warn("Template "+e+" not found"),null;var e=e.clone(),n=g.options[g.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e},null,null,c);g=t.addCombo();for(mxEvent.addListener(g,"change",function(){t.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),t.toolbar.noReset=!1}),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(g,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),m=c.getAttribute("template"),t.addOption(g,s,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=n.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}n=n.nextSibling}}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,n){return null},e.decode=function(e,n,t){var a=n.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,t):null!=t&&(t.config=n),t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,n,t){return null!=(e=n.getAttribute("defaultEdge"))&&(n.removeAttribute("defaultEdge"),t.defaultEdge=t.templates[e]),null!=(e=n.getAttribute("defaultGroup"))&&(n.removeAttribute("defaultGroup"),t.defaultGroup=t.templates[e]),t},e.decodeChild=function(e,n,t){if("Array"==n.nodeName){if("templates"==n.getAttribute("as"))return void this.decodeTemplates(e,n,t)}else if("ui"==n.nodeName)return void this.decodeUi(e,n,t);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,n,t){for(e=n.firstChild;null!=e;){if("add"==e.nodeName){n=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),s=null;if(null!=a)null!=(s=document.getElementById(a))&&null!=i&&(s.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var o=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(s=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(n)||n,s,a,o,r,l,!1,!0).setVisible(!0)}"graph"==n?t.setGraphContainer(s):"toolbar"==n?t.setToolbarContainer(s):"title"==n?t.setTitleContainer(s):"status"==n?t.setStatusContainer(s):"map"==n&&t.setMapContainer(s)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,n,t){null==t.templates&&(t.templates=[]),n=mxUtils.getChildNodes(n);for(var a=0;a<n.length;a++){for(var i=n[a].getAttribute("as"),s=n[a].firstChild;null!=s&&1!=s.nodeType;)s=s.nextSibling;null!=s&&(t.templates[i]=e.decodeCell(s))}},e}()),EditorUi=function(e,n,t){this.projectDesignController=e,this.editor=n||new Editor,this.container=t||document.body;var a=n.graph,i=this;CRUD_PERMISSIONS=this.projectDesignController.crudPermissions;var s=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isEditingEnabled()&&a.isEditing()});this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi(),this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.footerContainer.onselectstart=s,this.footerContainer.onmousedown=s),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",s),mxEvent.addListener(this.sidebarContainer,"contextmenu",s)):(this.diagramContainer.oncontextmenu=s,this.sidebarContainer.oncontextmenu=s),a.init(this.diagramContainer),a.refresh(),a.setEnabled(this.isEditingEnabled()),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+n.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var o=a.fireMouseEvent;a.fireMouseEvent=function(e,n,t){e==mxEvent.MOUSE_DOWN&&this.container.focus(),o.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","google_cloud_tts","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts","sestektts","mrcpsynth"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr","dialogflow","dialogflowV2","awslex","sesteknda","sestekasr","restapi","mrcprecog"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),mxEvent.isConsumed(e)||n.isConsumed()||(this.getModel().isEdge(t)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(t.source.value.tagName)&&this.startEditingAtCell(t):this.getModel().isVertex(t)&&i.projectDesignController.openDialog(t.getValue(),function(e){for(var n=0;n<e.length;n+=1)t.setAttribute(e[n].name,e[n].value);a.refresh(t)}),n.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){this.isEditingEnabled()&&this.menus.createPopupMenu(e,n,t)}),n.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.isEditingEnabled()?this.createKeyHandler(n):null;this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),n=function(){e.setEnabled(!mxClipboard.isEmpty())},t=mxClipboard.cut;mxClipboard.cut=function(){t.apply(this,arguments),n()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),n()}},EditorUi.prototype.isEditingEnabled=function(){return!!CRUD_PERMISSIONS.canEdit},EditorUi.prototype.exportXML=function(e){var n=window.document.createElement("a");n.href="data:attachment/text;charset=utf-8,"+encodeURIComponent(e),n.download=this.editor.filename+".xml",n.target="_self",n.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,n){try{var t=mxUtils.parseXml(e);this.editor.setGraphXml(t.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,n,t){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n),null!=t&&(this.editor.data=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,n){for(var t=this.editor.graph,a=(e=null!=e?e:t.model.getRoot(),n=null!=n?n:{},!0),i=t.model.getChildCount(e),s=0;s<i;s++){var o=t.model.getChildAt(e,s),r=n;t.isValidRoot(o)&&(r={}),null!=(r=this.validate(o,r))?t.setCellWarning(o,r.replace(/\n/g,"<br>")):t.setCellWarning(o,null),a=a&&null==r}if(i="",t.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i=""!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=""!==e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"google_cloud_tts":i=""!==e.value.getAttribute("apiKey")?"":mxResources.get("noApiKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"awslex":i=""!==e.value.getAttribute("aws_bot_name")?"":mxResources.get("noNameSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":case"sestektts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":case"sestekasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUrlInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n";break;case"sesteknda":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("ndauth_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("ndassistant_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("username")?"":mxResources.get("noUsernameSelected")+"\n",i+=""!==e.value.getAttribute("password")?"":mxResources.get("noPasswordSelected")+"\n";break;case"restapi":i=""!==e.value.getAttribute("url")?"":mxResources.get("noUrlSelected")+"\n",i+=""!==e.value.getAttribute("method")?"":mxResources.get("noMethodSelected")+"\n";case"mrcpsynth":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"mrcprecog":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"dialogflow":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("dialogflow_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n";break;case"dialogflowV2":i=""!==e.value.getAttribute("dialogflowV2_project_id")?"":mxResources.get("noDialogflowProjectSelected")+"\n",i+=""!==e.value.getAttribute("client_email")?"":mxResources.get("noClientEmailSelected")+"\n",i+=""!==e.value.getAttribute("private_key")?"":mxResources.get("noPrivateKeySelected")+"\n",i+=""!==e.value.getAttribute("dialogflowV2_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n"}if(t.model.isEdge(e))switch(t.model.getCell(e.source.getId()).value.nodeName){case"background":case"menu":if(void 0!==e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(void 0!==e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(void 0!==e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(void 0!==e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return t.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(t.containsValidationErrorsResource)||t.containsValidationErrorsResource)+"\n"),i=t.model.isEdge(e)?i+(t.getEdgeValidationError(e,t.model.getTerminal(e,!0),t.model.getTerminal(e,!1))||""):i+(t.getCellValidationError(e)||""),null!=(s=t.validateCell(e,n))&&(i+=s),null==t.model.getParent(e)&&t.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(n){var t=this.editor.graph,e=t.getDefaultParent(),a=0;return e.children.forEach(function(e){t.model.isVertex(e)&&e.value.nodeName==n&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var n=null!=e?e:window.location.pathname,t=0<n.indexOf("?")?1:0;for(var a in urlParams)n+=0==t?"?":"&",n+=a+"="+urlParams[a],t++;return n},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),n=this.actions.get("redo"),t=this.editor.undoManager,a=function(){e.setEnabled(t.canUndo()),n.setEnabled(t.canRedo())};t.addListener(mxEvent.ADD,a),t.addListener(mxEvent.UNDO,a),t.addListener(mxEvent.REDO,a),t.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,n=!e.isSelectionEmpty(),t=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var s=0;s<i.length;s++){var o=i[s];if(e.getModel().isEdge(o)&&(a=!0),e.getModel().isVertex(o)&&(t=!0),a&&t)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(n);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(t),this.actions.get("wordWrap").setEnabled(t),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=t&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(n);d=["line","lineend","linestart"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(t||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),n=this.container.clientWidth+390,t=this.container.clientHeight+190;this.container==document.body&&(n=document.body.clientWidth||document.documentElement.clientWidth,t=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,n-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,t-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var s=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(s+=1),this.sidebarContainer.style.top=s+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=this.isEditingEnabled()?a+this.splitSize+"px":"0px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=n+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var o=t-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=o+"px",this.diagramContainer.style.width=n-a-this.splitSize+"px";var r=t-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.isEditingEnabled()&&(this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit)),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.footerContainer),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var n=document.createElement("div");return n.className=e,n},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var n=document.createElement("form");return n.className=e,n},EditorUi.prototype.addSplitHandler=function(n,t,a,i){var s=null,o=null;function r(e){if(null!=s){var n=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,o+(t?n.x-s.x:s.y-n.y)-a)),mxEvent.consume(e)}}function e(e){r(e),o=s=null}mxEvent.addGestureListeners(n,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),o=parseInt(t?n.style.left:n.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,n,t){var a=this.editor.graph,i=a.getSelectionCell();n=null!=this.animate?this.animate:n,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(n&&navigator.userAgent.indexOf("Camino")<0){var s=new mxMorphing(a);s.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),s.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,o=new mxKeyHandler(a);function n(e){if(!a.isSelectionEmpty()){var n=0,t=0;37==e?n=-1:38==e?t=-1:39==e?n=1:40==e&&(t=1),a.moveCells(a.getSelectionCells(),n,t),a.scrollCellToVisible(a.getSelectionCell())}}o.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var t=mxUtils.bind(this,function(e,n,t,a){var i=this.actions.get(t);if(null!=i){var s=function(){i.enabled&&i.funct()};n?a?o.bindControlShiftKey(e,s):o.bindControlKey(e,s):a?o.bindShiftKey(e,s):o.bindKey(e,s)}});return o.enter=function(){},o.bindKey(8,function(){a.foldCells(!0)}),o.bindKey(13,function(){a.foldCells(!1)}),o.bindKey(33,function(){a.exitGroup()}),o.bindKey(34,function(){a.enterGroup()}),o.bindKey(36,function(){a.home()}),o.bindKey(35,function(){a.refresh()}),o.bindKey(37,function(){n(37)}),o.bindKey(38,function(){n(38)}),o.bindKey(39,function(){n(39)}),o.bindKey(40,function(){n(40)}),o.bindKey(113,function(){a.startEditingAtCell()}),t(46,!1,"delete"),t(82,!0,"tilt"),t(83,!0,"save"),t(83,!0,"saveAs",!0),t(107,!1,"zoomIn"),t(109,!1,"zoomOut"),t(65,!0,"selectAll"),t(86,!0,"selectVertices",!0),t(69,!0,"selectEdges",!0),t(69,!0,"export"),t(66,!0,"toBack"),t(70,!0,"toFront"),t(68,!0,"duplicate"),t(90,!0,"undo"),t(89,!0,"redo"),t(88,!0,"cut"),t(67,!0,"copy"),t(81,!0,"connect"),t(86,!0,"paste"),t(71,!0,"group"),t(71,!0,"grid",!0),t(85,!0,"ungroup"),t(112,!1,"about"),t(80,!0,"publish",!0),o},EditorUi.prototype.createMultiplicities=function(e,n,t,a){for(var i=0;i<n.length;i++)e.push(new mxMultiplicity(!0,n[i],null,null,t[i][0],t[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+t[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,n[i],null,null,a[i][0],a[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,n){this.editorUi=e,this.container=n,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var n=mxEvent.getSource(e);null!=n;){if(n==this.currentElt)return;n=n.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(n,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,n,t,a,i){mxEventSource.call(this),this.label=e,this.funct=n,this.enabled=null==t||t,this.iconCls=a,this.shortcut=i}function Menubar(e,n){this.editorUi=e,this.container=n,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,n){mxEventSource.call(this),this.funct=e,this.enabled=null==n||n}function Toolbar(e,n){this.editorUi=e,this.container=n,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),e&&n.setAttribute("checked",!0),n}function createDropdownFromApi(e,t,a,i,n,s,o,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+n.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(n){r&&n[a]==r||((m=document.createElement("option")).text=n[a],s&&o?(m.value=o,s.forEach(function(e){m.value=m.value.replace("%"+e+"%",n[e])}),m.selected=m.value==t):(m.value=n[i],m.selected=n[i]==t),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,s);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[t],d.value=e[a],d.selected=e[a]==n,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[t].toUpperCase(),d.value=e[a],d.selected=e[a]==n,l.appendChild(d),e[s].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[t]),d.value=e[a],d.selected=e[a]==n,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,n){var t=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<n||""!=n)&&(i.selected=n===a),t.appendChild(i)}return t.className="form-control select2",t}function createDropdownFromTigerDialList(e){var n=document.createElement("select"),t=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var s=i.response.RMI.rows;for(var o in s)t[s[o].id]=s[o].name}}}catch(e){console.log(e)}for(var r in t){var l=document.createElement("option");l.text=t[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),n.appendChild(l)}return n.className="form-control select2",n}function Dialog(e,n,t,a,i,s,o){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),t+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-t)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(n),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=o,this.container=l}function ImportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("import")+" XML");var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var n=e.target.files[0];if(console.log(n),n)if("text/xml"===n.type){var t=new FileReader;t.onload=function(e){var n=e.target.result;mxUtils.write(d,n)},t.readAsText(n)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var n=mxUtils.parseXml(d.value);t.editor.setGraphXml(n.documentElement),t.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("about")+" Cally Square");var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function SaveDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("saveAs"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function NewDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("new"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function DescriptionDialog(e){console.log(e.editor.data);var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("description"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function VariableDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("variable"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function OpenDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("open"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function RenameDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("rename"));var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-4"),d=t.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=t.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var n=new XMLHttpRequest;n.open("PUT",SAVE_URL+t.editor.data.id,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("Authorization","Bearer "+t.editor.data.token),n.send("name="+u.value),n.onload=function(e){200===n.status?(t.editor.setStatus("Project successfully renamed"),t.editor.filename=u.value):(console.log(n.response),t.editor.setStatus(JSON.parse(n.response).errors[0].message))},n.onerror=function(e){mxUtils.alert(n.statusText)},t.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("edit"));var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(n.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var n=e.dataTransfer.files[0],t=new FileReader;t.onload=function(e){d.value=e.target.result},t.readAsText(n)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);n.editor.setGraphXml(e.documentElement),n.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body form"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("export")+" XML");var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("form-horizontal form-row-seperated"),l=n.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",n.editor.getOrCreateFilename()),c.className="form-control";var m=n.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){n.save(!1);encodeURIComponent(mxUtils.getXml(n.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+n.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),n.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,s){console.log("general");var o=i.editor.graph,e=i.createDiv("md-dialog"),n=i.createDiv("md-toolbar"),t=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(s.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",n.appendChild(l),n.appendChild(r);for(var d=s.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=s.value.attributes[m].name,g="_"+p,v=s.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),f=document.createElement("label");switch(f.className="col-sm-4 control-label",mxUtils.write(f,mxResources.get(p)),h.appendChild(f),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==s.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var b=i.createDiv("col-sm-8");if(b.appendChild(u),mxResources.get("help_"+p)){var A=i.createDiv("p");A.className="help-block",mxUtils.write(A,mxResources.get("help_"+p)),b.appendChild(A)}h.appendChild(b),c.appendChild(h)}t.appendChild(c);var E=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var n=0;n<s.value.attributes.length;n++){var t="_"+s.value.attributes[n].name,a=s.value.attributes[n].name;s.setAttribute(a,document.getElementById(t).value)}o.refresh(s),i.hideDialog()}));E.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(E),a.appendChild(y),e.appendChild(n),e.appendChild(t),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var n=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var t=e.getAttribute("pageScale");this.graph.pageScale=null!=t?t:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var s=e.getAttribute("background");null!=s&&0<s.length&&(this.graph.background=s),n.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,n=this.outline;if(null!=e.container&&null!=n.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",n.outline.container.style.backgroundColor=e.container.style.backgroundColor,n.outline.pageVisible==e.pageVisible&&n.outline.pageScale==e.pageScale||(n.outline.pageScale=e.pageScale,n.outline.pageVisible=e.pageVisible,n.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var t=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":t,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var t=e.apply(this,arguments);return t.intersects=mxUtils.bind(this,function(e,n){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(t,arguments)}),t},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),n=0<e.width?e.x/this.scale-this.translate.x:0,t=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,l=s.height*o,d=Math.floor(Math.min(0,n)/r),c=Math.floor(Math.min(0,t)/l),m=Math.ceil(Math.max(1,n+a)/r)-d,u=Math.ceil(Math.max(1,t+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var t=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,n){t.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=n+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){n=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale,r=this.view.getBackgroundPageBounds();n=r.width,t=r.height;var l=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(n/l.width)-1:0,c=e?Math.ceil(t/l.height)-1:0,m=r.x+n,u=r.y+t;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){for(var a=0;a<n.length;a++)if(this.graph.getModel().isVertex(n[a])){var i=this.graph.getCellGeometry(n[a]);if(null!=i&&i.relative)return!1}return s.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(e){mxEvent.consume(e)}),o};var o=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var n=this.graph.getModel(),t=n.getParent(this.graph.getSelectionCell()),a=o.apply(this,arguments),i=n.getParent(a);if(null==t||t!=a&&t!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&n.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var n=l.apply(this,arguments),t=this.graph.getModel(),a=t.getParent(this.graph.getSelectionCell()),i=t.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!t.isVertex(i)||this.graph.isValidRoot(i)||(n=!0)),n},mxGraphHandler.prototype.selectDelayed=function(e){var n=e.getCell();null==n&&(n=this.cell);for(var t=this.graph.getModel(),a=t.getParent(n);this.graph.isCellSelected(n)&&t.isVertex(a)&&!this.graph.isValidRoot(a);)n=a,a=t.getParent(n);this.graph.selectCellForEvent(n,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var n=e.getCell(),t=this.graph.getModel(),a=t.getParent(n);t.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(n=a),a=t.getParent(a);return n}},Editor.prototype.createUndoManager=function(){var s=this.graph,t=new mxUndoManager,e=function(e,n){t.undoableEditHappened(n.getProperty("edit"))};s.getModel().addListener(mxEvent.UNDO,e),s.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){for(var t=s.getSelectionCellsForChanges(n.getProperty("edit").changes),a=[],i=1;i<t.length;i++)null!=s.view.getState(t[i])&&a.push(t[i]);s.setSelectionCells(a)};return t.addListener(mxEvent.UNDO,n),t.addListener(mxEvent.REDO,n),t},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var n=mxStencilRegistry.stencils[e];if(null==n){var t=mxStencilRegistry.getBasenameForStencil(e);if(null!=t){var a=mxStencilRegistry.libraries[t];if(null!=a){if(null==mxStencilRegistry.packages[t]){mxStencilRegistry.packages[t]=1;for(var i=0;i<a.length;i++){var s=a[i];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length)){var o=mxUtils.load(s);null!=o&&eval.call(window,o.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+t+".xml",null);n=mxStencilRegistry.stencils[e]}}return n},mxStencilRegistry.getBasenameForStencil=function(e){var n=e.split("."),t=null;if(0<n.length&&"mxgraph"==n[0]){t=n[1];for(var a=2;a<n.length-1;a++)t+="/"+n[a]}return t},mxStencilRegistry.loadStencilSet=function(e,n,t){t=null!=t&&t;var a=mxStencilRegistry.packages[e];if(t||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,n,i)}},mxStencilRegistry.parseStencilSet=function(e,n,t){t=null==t||t;var a=e.documentElement,i=a.firstChild,s="",o=a.getAttribute("name");for(null!=o&&(s=o+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(o=i.getAttribute("name"))){s=s.toLowerCase();var r=o.replace(/ /g,"_");if(t&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(i)),null!=n){var l=i.getAttribute("w"),d=i.getAttribute("h");n(s,r,o,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,n){this.data=e,this.filename=n,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["google_cloud_tts","tts","ispeechtts","awspolly","lumenvoxtts","sestektts","mrcpsynth"],["Google Cloud TTS","GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS","SestekTTS","MRCPSynth"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr","sestekasr","mrcprecog"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR","SestekASR","MRCPRecog"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS","dialogflow","dialogflowV2","awslex","sesteknda","restapi"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS"),"Dialogflow","DialogflowV2","AWSLex","SestekNDA","RestAPI"]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),n=e.width+2*this.tooltipBorder+4,t=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(t+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=n+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;t+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(t-=6,this.tooltipTitle.style.top=t-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=t+"px";var i=-Math.round(e.x-this.tooltipBorder),s=-Math.round(e.y-this.tooltipBorder),o=document.body,r=document.documentElement,l=(o.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-t/2+16);mxClient.IS_SVG?0!=i||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+t/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,n){if(null!=this.taglist&&null!=e&&0<e.length)for(var t=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<t.length;a++)if(t[a]=t[a].replace(/\.*\d*$/,""),1<t[a].length){var i=this.taglist[t[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[t[a]]=i),null==i.dict.get(n)&&(i.dict.put(n,n),i.entries.push(n))}return n},Sidebar.prototype.searchEntries=function(e,n,t,a,i){if(null!=this.taglist&&null!=e){for(var s=e.toLowerCase().split(" "),o=new mxDictionary,r=(t+1)*n,l=[],d=0,c=0;c<s.length;c++)if(0<s[c].length){var m=this.taglist[s[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==o.get(m))&&(u.put(m,m),l.push(m),c==s.length-1&&l.length==r))return void a(l.slice(t*n,r),r,!0)}}else l=[];o=u,d++}var v=l.length;a(l.slice(t*n,(t+1)*n),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null==e)return null;for(var n=e.split(" "),t=[],a={},i=0;i<n.length;i++)null==a[n[i]]&&(a[n[i]]="1",t.push(n[i]));return t.join(" ")},Sidebar.prototype.cloneCell=function(e,n){var t=e.clone();return null!=n&&(t.value=n),t},Sidebar.prototype.addSearchPalette=function(e){var n=document.createElement("div");n.style.visibility="hidden",this.container.appendChild(n);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var t=document.createElement("div");t.style.whiteSpace="nowrap",t.style.textOverflow="clip",t.style.paddingBottom="8px",t.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",t.appendChild(a);var i,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",s.style.top="-4px"):s.style.top="2px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",t.appendChild(s),r.appendChild(t);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var n=e.nextSibling;e!=t&&e!=l&&e.parentNode.removeChild(e),e=n}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var o=new Object;this.currentSearch=o,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,n,t){if(this.currentSearch==o){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(t?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.color="gray",s.style.padding="0px",s.style.margin="0px 8px 0px 8px",s.style.paddingTop="6px",s.style.textAlign="center",s.style.cursor="default",mxUtils.write(s,mxResources.get("noResultsFor",[c])),r.appendChild(s)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",s.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",s.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var o=document.createElement("div");o.appendChild(r),this.container.appendChild(o),this.palettes.search=[n,o]},Sidebar.prototype.createTitle=function(e){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.setAttribute("title",mxResources.get("sidebarTooltip")),n.className="geTitle",mxUtils.write(n,e),n},Sidebar.prototype.createThumb=function(e,n,t,a,i,s,o,r,l){this.graph.labelsVisible=null==s||s;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((n-2*this.thumbBorder)/c.width,(t-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((n-c.width*m)/2/m-c.x),Math.floor((t-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=n+"px",u.style.height=t+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=o){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(n,t,a,e,i,s,o){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(n,this.thumbWidth,this.thumbHeight,r,t,a,e,i,s);var d=new mxRectangle(0,0,i,s);if(1<n.length||n[0].vertex){var c=this.createDragSource(r,this.createDropHandler(n,!0,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=n[0]&&n[0].edge){c=this.createDragSource(r,this.createDropHandler(n,!1,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,n,d.width,d.height,t,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,f){return h=null==h||h,mxUtils.bind(this,function(e,n,t,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var s=null!=t&&e.isValidDropTarget(t,g,n),o=null;if(null==t||s||(t=null),!e.isCellLocked(t||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(t,g,n)){var r=e.cloneCells(g);e.splitEdge(t,r,null,a-f.width/2,i-f.height/2),o=r}else 0<g.length&&(o=e.importCells(g,a,i,t));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(t);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<o.length;p++)l.moveCell(o[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",o))}finally{e.model.endUpdate()}null!=o&&0<o.length&&(e.scrollCellToVisible(o[0]),e.setSelectionCells(o))}}mxEvent.consume(n)}})},Sidebar.prototype.createDragPreview=function(e,n){var t=document.createElement("div");return t.style.border="1px dashed black",t.style.width=e+"px",t.style.height=n+"px",t},Sidebar.prototype.createDragSource=function(e,n,t){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,n,t,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,n,t){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,s=null;mxEvent.addGestureListeners(e,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var o=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=s){var n=i.tolerance;if(Math.abs(s.x-mxEvent.getClientX(e))<=n&&Math.abs(s.y-mxEvent.getClientY(e))<=n){var t=i.getGridSize();a.drop(i,e,null,t,t)}}o.apply(this,arguments),s=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,n,t,a,i,s,o,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,n,t,a,i,s,o)}))},Sidebar.prototype.createXmlDocument=function(e,n,t,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",n),t.forEach(function(e,n){i.setAttribute(e,a[n]?a[n]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,n,t,a,i,s,o,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","","60"];break;case"google_cloud_tts":l=["apiKey","google_cloud_tts_text_type","text","languageCode","ssmlGender"],d=["","text","","en-US","FEMALE"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":case"sestektts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"sestekasr":l=["grammar","options"],d=["/usr/local/unimrcp/data/grammar.xml",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text","aws_text_type"],d=["","","eu-west-1","Amy","","text"];break;case"awslex":l=["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],d=["","","eu-west-1","",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","dialTimezone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;case"dialogflow":l=["key","text","dialogflow_language"],d=["","","it"];break;case"sesteknda":l=["ndauth_url","username","password","ndassistant_url","text","project","ndagenerate_audio","custom_action","custom_action_data","ndaactivity_type"],d=["","","","","","",1,"","","message"];break;case"restapi":l=["url","method","timeout","computedVariables","rawHeaders","rawBody","variable_id"],d=["","GET","5","","","",""];break;case"mrcpsynth":l=["text","options"],d=["",""];break;case"mrcprecog":l=["grammar","options"],d=["",""];break;case"dialogflowV2":l=["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"],d=["","","","en",""];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,n,t),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,n,t,i,s,o,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,n,t,a,i,s,o){return this.createItem(e,a,i,s,n,t,o)},Sidebar.prototype.createEdgeTemplate=function(e,n,t,a,i,s,o){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,n,t),e);return r.geometry.setTerminalPoint(new mxPoint(0,t),!0),r.geometry.setTerminalPoint(new mxPoint(n,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],n,t,i,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,n,t,a,i,s){return this.createItem(e,a,i,!0,n,t,s)},Sidebar.prototype.addPaletteFunctions=function(e,n,t,a){this.addPalette(e,n,t,mxUtils.bind(this,function(e){for(var n=0;n<a.length;n++)e.appendChild(a[n](e))}))},Sidebar.prototype.addPalette=function(e,n,t,a){var i=this.createTitle(n);this.container.appendChild(i);var s=document.createElement("div");s.className="geSidebar",mxClient.IS_POINTER&&(s.style.touchAction="none"),mxEvent.addListener(s,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==s?s.setAttribute("title",mxResources.get("sidebarTooltip")):s.removeAttribute("title")})),t?(a(s),a=null):s.style.display="none",this.addFoldingHandler(i,s,a);var o=document.createElement("div");return o.appendChild(s),this.container.appendChild(o),null!=e&&(this.palettes[e]=[i,o]),s},Sidebar.prototype.addFoldingHandler=function(t,a,i){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(t.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="0% 50%",mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(s)a.style.display="block";else if(s=!0,null!=i){t.style.cursor="wait";var n=t.innerHTML;t.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",t.style.cursor="",t.innerHTML=n},0)}else a.style.display="block";t.style.backgroundImage="url('"+this.expandedImage+"')"}else t.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,n,s,o,r,t,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,n,t){if(null==t){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");t=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+s+e+o,this.defaultImageWidth,this.defaultImageHeight,r[d],n,!1,!0,this.filterTags(t)))})(r[d],null!=t?t[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,n,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,n,t,a){mxGraph.call(this,e,n,t,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);return"1"==t.html||"wrap"==t.whiteSpace},this.cellRenderer.getLabelValue=function(e){var n=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(n=mxUtils.htmlEntities(n,!1)),n},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var s=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,n){null==n?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?s.apply(this,arguments):this.graph.isCellSelected(n.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(n.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);if(null!=t){var a=mxUtils.getValue(t,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var n=this.getModel().cloneCells([e])[0];null!=n.geometry&&(n.geometry.points=null);var t=n.getStyle();t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_Y,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_Y,null),n.setStyle(t),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(n)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([n])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var n="";return this.getModel().isVertex(e)?n+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(n=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),n},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,n,t){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",n),n=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,n){var t=null;null!=e.value&&"object"==typeof e.value?t=e.value.cloneNode(!0):(t=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=n&&0<n.length?t.setAttribute("link",n):t.removeAttribute("link"),this.model.setValue(e,t)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,n){this.panningHandler.hideMenu()});var s=!1,o=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var n=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(n)&&(e.state=this.view.getState(n),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,n,t){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(s=!1,o=null):(o=n.getCell(),s=null!=o?this.isCellSelected(o):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(s&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(n.getEvent()),i=mxEvent.getClientY(n.getEvent());this.panningHandler.popup(a+16,i,o,n.getEvent())}return s=!1,o=null,void n.consume()}s=!1,o=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&n.isConsumed()&&(s=!1,o=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)});var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,n){t.apply(this,arguments),this.graph.isCellSelected(n.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,n){touchStyle&&null!=n?this.graph.setSelectionCell(n):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,n){if(null==n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.getCellAt(t.x,t.y)}a.call(this,e,n)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var n=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(n),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=n}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var n=this.editorUi,l=n.editor,d=l.graph;this.addAction("new",function(){n.projectDesignController.newProject()},CRUD_PERMISSIONS.canEdit),this.addAction("open",function(){n.projectDesignController.openProject()},CRUD_PERMISSIONS.canEdit),this.addAction("save",function(){n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),n.editor.modified=!1},CRUD_PERMISSIONS.canEdit,null,"Ctrl+S"),this.addAction("saveAs",function(){n.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+S"),this.addAction("publish",function(){n.editor.setStatus(""),null===n.validate()?(n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),n.editor.modified=!1):(n.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){n.editor.setStatus("")},3e3))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+P"),this.addAction("variable",function(){n.projectDesignController.newVariable()},CRUD_PERMISSIONS.canEdit),this.addAction("import",function(){n.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("export",function(){n.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){n.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null==n&&(n=""),null!=(n=mxUtils.prompt(mxResources.get("enterValue"),n))&&d.setLinkForCell(e,n)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null!=n&&window.open(n)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];d.getModel().getChildCount(t)?d.updateGroupBounds([t],20):d.updateCellSize(t)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),n="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(n=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,n)}),this.addAction("rotation",function(){var e="0",n=d.getView().getState(d.getSelectionCell());null!=n&&(e=n.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];if(d.getModel().isVertex(t)&&0==d.getModel().getChildCount(t)){var a=d.getCellGeometry(t);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(t,a);var s=d.view.getState(t);if(null!=s){var o=s.style[mxConstants.STYLE_DIRECTION]||"east";"east"==o?o="south":"south"==o?o="west":"west"==o?o="north":"north"==o&&(o="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,o,[t])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(t/e.width/n,a/e.height/n))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*n*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*n*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=Math.floor(100*t/e.width/n)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*n*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*n*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,n=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(n*d.view.scale)}else{var t=d.view.translate;d.view.setTranslate(t.x-d.container.scrollLeft/d.view.scale,t.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var t=mxUtils.bind(this,function(e,n){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,n)})});t("bold",mxConstants.FONT_BOLD),t("italic",mxConstants.FONT_ITALIC),t("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var n=d.getModel(),t=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",n.getStyle(e[0])||"");null!=t&&d.setCellStyle(t,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var n=l.graph.selectionCellsHandler.getHandler(e);if(n instanceof mxEdgeHandler){var t=d.view.translate,a=d.view.scale,i=t.x,s=t.y,o=d.getModel().getParent(e),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r&&(i+=r.x,s+=r.y),n.addPointAt(n.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-s)}}}),this.addAction("removeWaypoint",function(){var e=n.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",n=d.getView().getState(d.getSelectionCell());if(null!=n&&(e=n.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var t=new Image;t.onload=function(){!function(e,n,t){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var s=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",s,s,n,t)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=n&&null!=t){var o=i[0],r=d.getModel().getGeometry(o);null!=r&&((r=r.clone()).width=n,r.height=t,d.getModel().setGeometry(o,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,t.width,t.height)},t.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},t.src=e}})},Actions.prototype.addAction=function(e,n,t,a,i){return this.put(e,new Action(mxResources.get(e),n,t,a,i))},Actions.prototype.put=function(e,n){return this.actions[e]=n},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,n){for(var t=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<t.length;a++){this.styleChange(e,t[a],[mxConstants.STYLE_FONTFAMILY],[t[a]],null,n).firstChild.nextSibling.style.fontFamily=t[a]}e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,n)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,n){for(var t=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<t.length;a++)this.styleChange(e,t[a],[mxConstants.STYLE_FONTSIZE],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,n)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,n){for(var t=[1,2,3,4,8,12,16,24],a=0;a<t.length;a++)this.styleChange(e,t[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,n)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,n),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,n),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,n),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,n)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,n)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,n)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,n){var t=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(t||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,n,t),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,n,t),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,n,t),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,n,t),e.addSeparator(n),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,n,t),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,n,t)),(a||e.showDisabled)&&(e.addSeparator(n),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,n,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,n,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItem(e,"style",n)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,n){var t=this.get("text").enabled;e.addSeparator(n),this.addSubmenu("fontFamily",e,n),this.addSubmenu("fontSize",e,n),this.addMenuItems(e,["-","bold","italic","underline","-"],n),this.addSubmenu("alignment",e,n),this.addMenuItem(e,"wordWrap",n),e.addSeparator(n),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,n,t),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},n,null,t)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,n),e.addSeparator(n),this.addSubmenu("position",e,n),this.addSubmenu("spacing",e,n),e.addSeparator(n);var t=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},n,null,t)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,n)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},n),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},n),this.addMenuItems(e,["-","tilt","rotation"],n)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},n),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},n),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},n),e.addSeparator(n),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},n),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},n),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},n)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),n),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),n)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],n)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["toFront","toBack","-"],n),this.addSubmenu("layout",e,n),e.addSeparator(n),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],n)}))),this.put("view",new Menu(mxUtils.bind(this,function(n,t){this.addMenuItems(n,["actualSize"],t),n.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){n.addItem(100*e+"%",null,function(){i.zoomTo(e)},t)}(e[a]);this.addMenuItems(n,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],t)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],n)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,n){this.menus[e]=n},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,n,t){var a=this.get(e).enabled;if(n.showDisabled||a){var i=n.addItem(mxResources.get(e),null,null,t,null,a);this.addMenu(e,n,i)}},Menus.prototype.addMenu=function(e,n,t){var a=this.get(e);null!=a&&(n.showDisabled||a.enabled)&&this.get(e).execute(n,t)},Menus.prototype.styleChange=function(e,n,t,a,i,s){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var n=0;n<t.length;n++)e.setCellStyles(t[n],a[n])}finally{e.getModel().endUpdate()}}),s,i)},Menus.prototype.promptChange=function(e,n,a,i,s,t,o){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,n=i,t=e.getView().getState(e.getSelectionCell());null!=t&&(n=t.style[s]||n),null!=(n=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),n))&&0<n.length&&e.setCellStyles(s,n)}),t,null,o)},Menus.prototype.addMenuItem=function(e,n,t){var a=this.editorUi.actions.get(n);if(null==a||!e.showDisabled&&!a.enabled)return null;var i=e.addItem(a.label,null,a.funct,t,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i},Menus.prototype.addShortcut=function(e,n){if(null!=n.shortcut){var t=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,n.shortcut),t.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var n=e.firstChild.nextSibling;n.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,n,t){for(var a=0;a<n.length;a++)"-"==n[a]?e.addSeparator(t):this.addMenuItem(e,n[a],t)},Menus.prototype.createPopupMenu=function(e,n,t){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(n=a.getSelectionCell())&&a.getModel().isEdge(n)){var s=a.selectionCellsHandler.getHandler(n);if(s instanceof mxEdgeHandler&&null!=s.bends&&2<s.bends.length){var o=s.getHandleForEvent(new mxMouseEvent(t)),r=this.editorUi.actions.get("removeWaypoint");r.handler=s,i=0<(r.index=o)&&o<s.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){var n=new Menubar(this.editorUi,e),t=[];t=CRUD_PERMISSIONS.canEdit?["file","edit","view","format","text","arrange","help"]:["file","view","help"];for(var a=0;a<t.length;a++)n.addMenu(mxResources.get(t[a]),this.get(t[a]).funct);return n},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geItem",mxUtils.write(t,e),this.addMenuHandler(t,n),this.container.appendChild(t),t},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,s){if(null!=s){var o=!0,n=mxUtils.bind(this,function(e){if(o&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var n=new mxPopupMenu(s);n.div.className+=" geMenubarMenu",n.smartSeparators=!0,n.showDisabled=!0,n.autoExpand=!0,n.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(n,arguments),n.destroy(),this.currentMenu=null,this.currentElt=null});var t=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;n.popup(t,a,null,e),this.currentMenu=n,this.currentElt=i}o=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),n(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){o=this.currentElt!=i})),mxEvent.addListener(i,"click",n)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,n){this.funct(e,n)},Toolbar.prototype.init=function(){CRUD_PERMISSIONS.canEdit?this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]):this.addItems(["print","actualSize","zoomIn","zoomOut","-"])},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,n,t,a){var i=this.editorUi.menus.get(a),s=this.addMenuFunction(e,n,t,i.funct);return i.addListener("stateChanged",function(){s.setEnabled(i.enabled)}),s},Toolbar.prototype.addMenuFunction=function(e,n,t,a){var i=t?this.createLabel(e):this.createButton(e);return this.initElement(i,n),this.addMenuHandler(i,t,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var n=0;n<e.length;n++){var t=e[n];"-"==t?this.addSeparator():this.addItem("geSprite-"+t.toLowerCase(),t)}},Toolbar.prototype.addItem=function(e,n){var t=this.editorUi.actions.get(n),a=null;return null!=t&&((a=this.addButton(e,t.label,t.funct)).setEnabled(t.enabled),t.addListener("stateChanged",function(){a.setEnabled(t.enabled)})),a},Toolbar.prototype.addButton=function(e,n,t){var a=this.createButton(e);return this.initElement(a,n),this.addClickHandler(a,t),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(t){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),n=0;n<t.length;n++)t[n].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var n=i.getSelectionCells(),t=0;t<n.length;t++)if(i.getModel().isEdge(n[t])){e=!0;break}for(t=0;t<a.length;t++)a[t].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,n){e.setAttribute("tabindex","0"),null!=n&&e.setAttribute("title",n),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(n){var t=n.className;n.setEnabled=function(e){n.enabled=e,n.className=e?t:t+" geDisabled"},n.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(n,t){null!=t&&mxEvent.addListener(n,"click",function(e){n.enabled&&t(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var n=document.createElement("a");n.setAttribute("href","javascript:void(0);"),n.className="geButton";var t=document.createElement("div");return t.className="geSprite "+e,n.appendChild(t),n},Toolbar.prototype.createLabel=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geLabel",mxUtils.write(t,e),t},Toolbar.prototype.addMenuHandler=function(n,t,a,i){if(null!=a){var s=this.editorUi.editor.graph,o=null;mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){(null==n.enabled||n.enabled)&&(s.panningHandler.hideMenu(),(o=new mxPopupMenu(a)).div.className+=" geToolbarMenu",o.showDisabled=i,o.labels=t,o.autoExpand=!0,o.popup(n.offsetLeft,n.offsetTop+n.offsetHeight+34,null,e),this.currentMenu=o),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/auth/services/hotdesk/dialog.html",'<md-dialog aria-label="Telephone">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="LOGIN.TELEPHONES">Telephones</span>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-select ng-model="vm.name" placeholder="Select a telephone">\n <md-option value="{{telephone.name}}" ng-repeat="telephone in vm.telephones.rows">{{telephone.fullname}}</md-option>\n </md-select>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.closeDialog(vm.name)" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.name">\n <span translate="LOGIN.SELECT">SELECT</span>\n </md-button>\n \x3c!-- <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="LOGIN.CANCEL">Cancel</span>\n </md-button> --\x3e\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/dialogs/advanced-search/dialog.html",'<md-dialog class="advanced-search-dialog" aria-label="Advanced search" flex="70" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="advanced-search-dialog-header" ng-class="{{ \'vm.toolbarColor\' }} + \'-bg\'">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="DASHBOARDS.ADVANCED_SEARCH"></span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.minimize()">\n <md-icon class="no-margin" md-font-icon="icon-window-minimize" aria-label="Minimize dialog"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.close()">\n <md-icon class="no-margin" md-font-icon="icon-window-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <ms-advanced-search options="vm.searchOptions" clear-filter="vm.clearConditions()"></ms-advanced-search>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button class="md-primary md-raised" aria-label="Clear" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.CLEAR" translate-attr-aria-label="DASHBOARDS.CLEAR" ng-click="vm.clearConditions()"></md-button>\n <md-button class="md-primary md-accent md-raised" aria-label="Apply" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.APPLY" translate-attr-aria-label="DASHBOARDS.APPLY" ng-click="vm.applyFilter()"></md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-advanced-search/ms-advanced-search.html",'<div layout="column" class="advanced-search-container" flex>\n <div layout-margin>\n <md-radio-group ng-model="vm.options.matchType" class="md-primary" layout="row">\n <md-radio-button value="$and" class="md-primary">{{ \'DASHBOARDS.MEET_ALL_CONDITIONS\' | translate }}\n </md-radio-button>\n <md-radio-button value="$or">{{ \'DASHBOARDS.MEET_ANY_CONDITIONS\' | translate }}</md-radio-button>\n </md-radio-group>\n </div>\n\n \x3c!-- ACTIVE CONDITIONS --\x3e\n <div layout="row" ng-if="vm.options.conditions.length > 0" class="advanced-search-conditions">\n <md-list>\n <md-list-item>\n <md-chips ng-model="vm.options.conditions" class="advanced-search-chips" readonly="true" md-removable="true" md-on-remove="vm.removeCondition()">\n <md-chip-template ms-chip-color="{{ $chip.style }}">\n <md-menu md-offset="50 0" ng-class="{\'no-click\': vm.pendingCondition}">\n <span>\n <p class="filter-text">{{ $chip.name }}</p>\n <em ng-show="$chip.operator" class="text-lowercase">{{ $chip.operator }}</em>\n <strong>{{ $chip.displayValue }}</strong>\n <em ng-show="$chip.displayEndValue" class="text-lowercase">{{ \'DASHBOARDS.AND\' | translate }}</em>\n <strong>{{ $chip.displayEndValue }}</strong>\n </span>\n <md-menu-content width=2 class="md-dense">\n <md-menu-item ng-hide="$chip.disabled">\n <md-button ng-click="vm.editCondition($chip)">Edit\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.setConditionStatus($chip)">\n {{ $chip.disabled ? \'Enable\' : \'Disable\' }}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-chip-template>\n <button type="button" md-chip-remove class="md-primary remove-filter">\n <md-icon md-font-icon="icon-cancel" aria-label="Remove Filter"></md-icon>\n </button>\n </md-chips>\n </md-list-item>\n </md-list>\n </div>\n\n \x3c!-- FILTERS --\x3e\n <div layout="row">\n <div layout="row" class="advanced-search-bar" layout-margin flex>\n \x3c!-- FIELD --\x3e\n <md-input-container flex="35">\n <md-icon md-font-icon="icon-filter-variant"></md-icon>\n <md-select class="font-size-12" ng-model="vm.selectedField" ng-change="vm.onFieldChange()" placeholder="{{ \'DASHBOARDS.SELECT_FIELD\' | translate }}" aria-label="Field">\n <md-option ng-value="field" ng-repeat="field in vm.options.fields">{{ field.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- OPERATOR --\x3e\n <md-input-container flex="30">\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-select class="font-size-12" ng-model="vm.selectedOperator" ng-change="vm.onOperatorChange(oldValue)" ng-focus="oldValue=vm.selectedOperator" md-selected-text="vm.selectedOperator ? (\'DASHBOARDS.\' + vm.selectedOperator.translate | translate) : (\'DASHBOARDS.SELECT_OPERATOR\' | translate)" ng-disabled="!vm.selectedField" aria-label="Operator">\n <md-option ng-value="operator" ng-repeat="operator in vm.availableOperators" ng-selected="vm.autoSelectOperator">\n <div layout="row" class="operators-list">\n <span class="operator-symbol">\n {{ operator.symbol }}\n </span>\n <span>\n {{ \'DASHBOARDS.\' + operator.translate | translate }}\n </span>\n </div>\n </md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TEXT INPUT --\x3e\n <md-input-container ng-if="!vm.selectedField.type || vm.selectedField.type === \'text\'" class="no-errors" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n </md-input-container>\n \x3c!-- NUMERIC INPUT --\x3e\n <div ng-if="vm.selectedField.type === \'number\'" flex layout="row" layout-margin class="no-margin">\n <md-input-container class="no-errors" flex>\n <md-icon md-font-icon="icon-numeric"></md-icon>\n <input type="number" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" min="0" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_VALUE\' : \'DASHBOARDS.VALUE\' | translate }}">\n </md-input-container>\n <md-input-container class="no-errors" ng-if="vm.selectedOperator.type === \'$between\'" ng-class="{\'md-input-invalid\': !vm.isValidRange}" flex>\n <md-icon md-font-icon=" icon-numeric">\n </md-icon>\n <input class="md-input" type="number" aria-label="Value" ng-model="vm.endRangeValue" ng-change="vm.checkRange()" ng-disabled="!vm.value" min="vm.value" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.ENDING_VALUE\' | translate }}">\n <div ng-if="!vm.isValidRange" class="md-input-message-animation md-input-messages-animation">\n {{ (\'DASHBOARDS.VALUE_RANGE_CHECK\' | translate) + \' \' + vm.value }}\n </div>\n </md-input-container>\n </div>\n \x3c!-- SELECT --\x3e\n <md-input-container ng-if="vm.selectedField.type === \'select\'" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-select class="font-size-12" ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n </md-option>\n </md-select>\n </md-input-container>\n \x3c!-- MULTISELECT --\x3e\n <md-input-container ng-if="vm.selectedField.type === \'multiselect\'" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-select class="font-size-12" multiple ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n </md-option>\n </md-select>\n </md-input-container>\n \x3c!-- DATE INPUT --\x3e\n <div ng-if="vm.selectedField.type === \'date\'" flex layout="row">\n <mdp-date-picker mdp-open-on-click ng-model="vm.value" ng-change="vm.onValueChange()" mdp-max-date="vm.maxDateRange" mdp-placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_DATE\' : \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n </mdp-date-picker>\n <mdp-date-picker mdp-open-on-click ng-if="vm.selectedOperator.type === \'$between\'" ng-change="vm.checkRange()" ng-model="vm.endRangeValue" mdp-min-date="vm.minDateRange" mdp-disabled="!vm.value" mdp-placeholder="{{ \'DASHBOARDS.ENDING_DATE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n </mdp-date-picker>\n </div>\n \x3c!-- AUTOCOMPLETE --\x3e\n <div layout="row" layout-align="start start" ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type != \'$substring\'" class=" autocomplete-input" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-autocomplete md-selected-item="vm.value" md-selected-item-change="vm.onValueChange()" md-items="item in vm.getValues()" md-search-text="vm.searchText" md-item-text="item.displayValue" md-min-length="4" md-no-cache="true" md-floating-label="{{ \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="i">{{item.displayValue}}</span>\n </md-item-template>\n </md-autocomplete>\n </div>\n <md-input-container ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type === \'$substring\'" class="no-errors" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n </md-input-container>\n </div>\n <md-button class="md-fab md-mini md-primary mt-20" ng-if="!vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Add filter" ng-click="vm.addCondition()" translate-attr-aria-label="DASHBOARDS.ADD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini mt-20" ng-if="vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Update filter" ng-click="vm.updateCondition()" translate-attr-aria-label="DASHBOARDS.UPDATE">\n <md-icon md-font-icon="icon-check"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-primary mt-20" ng-if="vm.pendingCondition" aria-label="Cancel filter update" ng-click="vm.cancelUpdateCondition()" translate-attr-aria-label="DASHBOARDS.CANCEL">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h2" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n </div>\n\n <div class="text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="text p-16" ng-if="card.text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n <div layout="column" layout-align="space-between">\n <div class="info">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="cta">\n <md-button class="m-0">{{card.cta}}</md-button>\n </div>\n </div>\n\n <div class="media pl-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n <div class="info white-fg ph-16 pv-24">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="event h2" ng-if="card.event">\n {{card.event}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n <div class="content pv-24 ph-16">\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="title h2" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div class="p-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text h4 pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div>\n <md-divider></md-divider>\n <div class="p-8" layout="row">\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="buttons pt-16">\n <md-button class="m-0">{{card.button1}}</md-button>\n <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n </div>\n </div>\n\n <div class="text ph-16 pb-16" ng-if="card.text">\n {{card.text}}\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="buttons m-8">\n <md-button class="md-icon-button mr-16" aria-label="Favorite">\n <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Share">\n <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n </md-button>\n </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n <span ng-if="!showMenu()" privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n <md-menu ng-if="showMenu()">\n <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n <span ng-if="prefix" privacy="{{ privacy }}" ng-cloak>{{prefix}}-</span>\n <span privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n </a>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>\n<section ng-if="type === \'button\'">\n <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="showMenu()">\n <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html",'<md-icon ng-style="vm.styleColor" md-font-icon="{{ vm.styleIcon }}">\n <md-tooltip class="client-side-logging-tooltip">\n <span ng-bind-html="vm.tooltipHTML"></span>\n </md-tooltip>\n</md-icon>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging.html",'<md-content layout="column">\n <form name="clientSideLoggingSettingsForm">\n <div flex layout="column" layout-align="stretch center">\n <div ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-amber-500-bg p-10" layout="row" layout-align="start center">\n <span class="no-margin font-size-14 line-height-30" translate="STAFF.CLIENT_LOGS_ALL_ENABLED_WARNING" flex></span>\n </div>\n <md-input-container>\n <md-switch ng-model="vm.user.userSetting.clientSideLoggingEnabled" aria-label="Manage client side logging" ng-change="vm.onEnabledSwitchChange()">\n {{ vm.user.userSetting.clientSideLoggingEnabled ? \'STAFF.CLIENT_LOGS_ENABLED\' : \'STAFF.CLIENT_LOGS_DISABLED\' | translate }}\n </md-switch>\n </md-input-container>\n <h2 ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-subhead mt-0">{{ vm.clientSideLoggingEnabledSince }}</h2>\n </div>\n <div layout="column" layout-align="stretch center">\n <md-input-container ng-if="vm.user.userSetting.clientSideLoggingEnabled">\n <label>{{ \'STAFF.CLIENT_LOGS_LOGLEVEL_SELECT\' | translate }}</label>\n <md-select ng-if="vm.user.userSetting.clientSideLoggingEnabled" ng-model="vm.user.userSetting.clientSideLoggingLevel" placeholder="Debugging level" ng-change="vm.onLogLevelSelectionChange()" flex="30">\n <md-option ng-value="loggingLevel" ng-repeat="loggingLevel in vm.availableClientSideLoggingLevels">\n <md-icon ng-style="vm.computeStyleForLoggingLevel(loggingLevel)" md-font-icon="{{ loggingLevel === \'info\' ? \'icon-checkbox-blank-circle-outline\' : \'icon-checkbox-blank-circle\' }}"></md-icon>\n {{ loggingLevel }}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n </form>\n</md-content>'),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="query" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || vm.addDisabled}" ng-disabled="vm.readOnly || vm.addDisabled" ng-repeat="item in availableItems = (vm.options.items | filter: query) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, false)">\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n </p>\n </div>\n <md-icon ng-hide="vm.readOnly && !vm.addDisabled" ng-class="{\'add-disabled\': vm.addDisabled}" md-font-icon="icon-arrow-right-bold" aria-label="swap">\n </md-icon>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <span class="h4" flex>{{vm.options.labelAll || \'All Items\'}} ({{availableItems.length}})</span>\n <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" ng-class="{\'add-disabled\': vm.addDisabled}" ng-disabled="vm.addDisabled" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="vm.transfer(vm.options.items, vm.options.selectedItems, -1, false)"></md-icon>\n </div>\n </div>\n\n <div flex="10" layout="row" layout-align="center center">\n <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n </div>\n\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="selectedQuery" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || !item.isValid}" ng-disabled="vm.readOnly" ng-repeat="item in associatedItems = (vm.options.selectedItems | filter: selectedQuery) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, true)">\n <md-icon ng-class="{\'hidden\': vm.readOnly || !item.isValid}" md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n </p>\n </div>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" md-font-icon="icon-chevron-double-left" aria-label="swap" ng-click="vm.transfer(vm.options.selectedItems, vm.options.items, -1, true)"></md-icon>\n <span class="h4 text-right" flex>{{vm.options.labelSelected || \'Selected Items\'}}\n ({{associatedItems.length}})</span>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-repeat="font in fonts" ng-value="font.value"><span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n <div id="ms-info-bar-message" ng-transclude flex></div>\n <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n <md-icon md-font-icon="icon-close s20"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n <div ng-click="$mdOpenMenu($event)">\n <ms-color-picker-button>\n <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n <span ng-show="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n <span ng-show="!vm.selectedColor.palette">\n Select Color\n </span>\n </md-button>\n </ms-color-picker-button>\n </div>\n\n <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n </md-button>\n\n <span ng-if="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n\n <span ng-if="!vm.selectedColor.palette">\n Select Color\n </span>\n\n <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n </md-button>\n </header>\n\n <div class="colors">\n <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n <span class="label">\n {{palette}}\n </span>\n </div>\n </div>\n\n <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n <span class="label">\n {{hue}}\n </span>\n <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n </i>\n </div>\n </div>\n\n </div>\n\n </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n <md-icon md-font-icon="icon-menu"></md-icon>\n </md-button>\n</div>\n\n<ul class="horizontal">\n <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}"\n ng-if="node.uisref && node.title">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node"\n ng-class="{\'has-children\': vm.hasChildren}"\n ng-include="\'navigation-horizontal-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n <div id="{{ node.id }}" ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-node="node"\n ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}"\n ng-include="\'navigation-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n <section layout="row" layout-align="start center">\n <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n <span class="md-subhead">Dialpad</span>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </section>\n <md-divider></md-divider>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\n\x3c!-- Input&Media Area --\x3e\n<div layout="row" layout-align="start center">\n <div layout="row" layout-align="center center">\n \x3c!-- START Ringing Tone--\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.conf.ringingMute = !vm_pb.conf.ringingMute; vm_pb.initDevice(\'ringing\', true)" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Ringing Tone --\x3e\n\n \x3c!-- START Speaker --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.conf.speakerMute = !vm_pb.conf.speakerMute; vm_pb.initDevice(\'speaker\', true)" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Speaker --\x3e\n\n \x3c!-- START Microphone --\x3e\n <md-button ng-disabled="(!vm_pb.registered || vm_pb.sessions.length==0)?true:false" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.conf.microphoneMute = !vm_pb.conf.microphoneMute; vm_pb.initDevice(\'microphone\', true)">\n <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Microphone --\x3e\n\n \x3c!-- START Registered --\x3e\n <span>\n <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}}\n <timer ng-if="vm_pb.registered"></timer>\n </span>\n </md-tooltip>\n </span>\n \x3c!-- END Registered --\x3e\n </div>\n <div layout="column" layout-align="center start">\n <div layout="row" layout-align="start center">\n \x3c!-- START Target --\x3e\n <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html" input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" disable-autocomplete="vm_pb.currentUser.privacyEnabled"></angucomplete-alt>\n \x3c!-- END Target --\x3e\n\n \x3c!-- Auto Answer --\x3e\n <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n <span class="font-size-20">A<span class="font-size-16">A</span></span>\n </div>\n \x3c!-- Auto Answer --\x3e\n\n <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n </md-button>\n <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n\x3c!-- Input&Media Area --\x3e\n\n\x3c!-- START 3WC --\x3e\n<md-button ng-if="vm_pb.canGoInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="3Way" ng-click="vm_pb.start3WayConf(); $event.stopPropagation();">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon orange-fg s14"></md-icon>\n <md-tooltip><span translate="TOOLBAR.CONFERENCE">Conference</span></md-tooltip>\n</md-button>\n\x3c!-- END 3Way --\x3e\n\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n </div>\n\n <div id="{{\'div_session_\'+session.id.substr(0,32)}}" ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n <div layout="column" layout-align="center start">\n <span class="session-info">\n <span ng-if="session.user == session.name" privacy ng-cloak>{{session.user}}</span>\n <span ng-if="session.user != session.name" privacy ng-cloak>{{session.name}}</span> <span ng-if="session.user != session.name" privacy ng-cloak>{{session.user}}</span>\n </span>\n <span class="session-info" layout="row" layout="start center">\n <timer></timer>\n </span>\n </div>\n\n \x3c!-- START Answer --\x3e\n <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Anser" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Answer --\x3e\n\n \x3c!-- START Hangup --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hangup --\x3e\n\n \x3c!-- START Hold/Unhold --\x3e\n <md-button ng-if="session.confirmed && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hold/Unhold --\x3e\n\n \x3c!-- START Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1 && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END transfer --\x3e\n\n \x3c!-- START Attended Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length>1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Attended Transfer --\x3e\n </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title" privacy ng-cloak></span></span>\n </div>\n </div>\n </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n \x3c!-- Audio stream --\x3e\n <audio id="local-audio" autoplay hidden=true></audio>\n <audio id="remote-audio" autoplay hidden=true></audio>\n \x3c!-- Audio stream --\x3e\n\n \x3c!-- WebRtc PhoneBar --\x3e\n <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/prefix/dialog.html",'<md-dialog aria-label="Prefix">\n <form ng-cloak ng-keypress="vm.keyPress($event)">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.PREFIXES">Prefixes</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog(-1)">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-radio-group ng-model="vm.prefix">\n <md-radio-button ng-repeat="prefix in vm.prefixes.rows" value="{{prefix.prefix}}" class="md-primary">{{prefix.name}}</md-radio-button>\n <md-radio-button ng-if="!vm.required" ng-value="null" class="md-primary">no prefix</md-radio-button>\n </md-radio-group>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.call()" class="send-button md-accent md-raised" aria-label="call" md-autofocus ng-disabled="!vm.prefix && vm.required">\n <span translate="TOOLBAR.CALL">CALL</span>\n </md-button>\n <md-button ng-click="vm.closeDialog(-1)" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding">\n <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-table-container>\n <table md-table layout-padding>\n <thead md-head>\n <tr md-row>\n <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.session.monitors.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="monitor in vm.session.monitors">\n <td md-cell>{{monitor.filename}}</td>\n <td md-cell class="no-padding">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n </td>\n <td md-cell class="no-padding">\n <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+" <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <label translate="TOOLBAR.TARGET">Target</label>\n <md-input-container class="md-block">\n <md-select ng-model="vm.target">\n <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n {{ session.name }}\n </md-option>\n </md-select>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n </md-button>\n <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n <form name="settingsForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="no-padding">\n <md-tabs md-no-pagination md-stretch-tabs="always">\n <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n <md-content layout-padding layout="column">\n <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n <md-content layout-padding>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n </md-switch>\n <md-switch ng-model="vm.messengerSoundNotification" aria-label="EnableMessengerSoundNotification">\n <span translate="TOOLBAR.MESSENGERSOUNDNOTIFICATION">MessengerSoundNotification</span>\n </md-switch> \n </md-input-container>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n <md-content layout-padding>\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between cetner">\n <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\' }).length">\n <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-disabled="vm.activeSessions.length==0" ng-model="vm.conf.microphoneMute" aria-label="Mute">\n Mute\n </md-switch>\n </div>\n </div>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n <md-content layout-padding>\n <md-list>\n <md-list-item>\n <h3 translate="TOOLBAR.LICENSE">License</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n </md-list>\n </md-content>\n </md-tab>\n </md-tabs>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-quick-filter/ms-quick-filter.html",'<div ng-cloak layout="row" class="quick-filter-container" flex>\n <div ng-repeat="filter in vm.filters" ng-if="filter.ngIf ? $eval(\'vm.query.\' + filter.ngIf) : true" layout="column" class="padding-horizontal-16">\n <span class="font-size-10" translate="{{ filter.label }}" />\n <md-select ng-if="filter.type === \'select\'" class="font-size-12 no-margin" ng-model="vm.query[filter.key]" ng-change="vm.search()" aria-label="Filter {{ filter.name }}">\n <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id">\n {{ option.name }}</md-option>\n <md-option ng-repeat="option in filter.customOptions" ng-value="option.value" translate="{{ option.translate }}">\n </md-option>\n </md-select>\n\n <md-select ng-if="filter.type === \'multiselect\'" multiple class="font-size-12 no-margin" ng-init="vm.onMultiselectInit(filter)" ng-model="vm.query[filter.key]" ng-disabled="filter.options.length === 0" ng-change="vm.onMultiselectSelection(filter, isOpen)" md-selected-text="vm.placeholders[filter.key]" aria-label="Filter {{ filter.name }}" md-on-open="isOpen = true" md-on-close="isOpen = false">\n <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id" ng-disabled="filter.clearAll === false && vm.query[filter.key].length === 1 && vm.query[filter.key][0] === (filter.ngValue ? option[filter.ngValue] : option.id)">\n {{ option.name }}</md-option>\n <md-button ng-if="vm.query[filter.key].length < filter.options.length" ng-click="vm.selectAll(filter)" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n <md-button ng-if="vm.query[filter.key].length === filter.options.length" ng-click="vm.clearSelection(filter)" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n </md-select>\n\n <div ng-if="filter.type === \'date\'" layout="row" layout-align="center center">\n <md-date-range ng-init="vm.onDateRangeInit(filter)" localization-map="vm.localizationMap" ng-model="vm.pickerModels[filter.key]" auto-confirm="true" show-template="true" md-on-select="vm.onDateRangeSelection(filter)" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}">\n </md-date-range>\n <md-button ng-if="vm.pickerModels[filter.key].dateStart" ng-click="vm.clearDate(filter)" class="md-icon-button no-margin no-padding width-20 height-20" aria-label="Clear date filter">\n <md-icon md-font-icon="icon-close" class="quick-filter-date-clear-button s16"></md-icon>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n <label>\n <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar" ng-click="vm.expandBar()" ng-if="!vm.resultsLoading || !vm.expanded" ng-class="{\'ms-search-button-expanded\': vm.expanded }">\n <md-icon id="ms-search-bar-icon" md-font-icon="icon-magnify" class="s24" ng-class="{\'{{ vm.iconColor }}\': vm.iconColor && !vm.expanded }"></md-icon>\n </md-button>\n <div class="ms-search-bar-loader" layout="row" layout-align="center center" ng-if="vm.resultsLoading && vm.expanded">\n <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n </div>\n </label>\n <input ng-if="vm.expanded" focus-on="vm.expanded" type="text" placeholder="{{ \'TOOLBAR.SEARCH\' | translate }}" flex ng-model="vm.query.filter" ng-model-options="vm.queryOptions" ng-blur="vm.blurCollapse()" ng-keydown="vm.onKeyDown($event)" />\n <md-button class="ms-search-bar-collapser md-icon-button" ng-click="vm.collapseBar(true)" aria-label="Collapse Search Bar">\n <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n </md-button>\n <div class="ms-search-bar-results" ng-if="vm.results">\n <div class="no-results" ng-if="vm.results.length === 0">{{ \'DASHBOARDS.NO_RESULTS_AVAILABLE\' | translate }}</div>\n <div class="result" ng-repeat="result in vm.results" ng-click="vm.handleResultClick(result)" ng-mouseenter="vm.handleMouseEnter($index)" ng-mousedown="vm.absorbEvent($event)" ng-class="{\'selected\': $index == vm.selectedResultIndex}" md-ink-ripple>\n <div layout="row" layout-align="start center">\n <div class="icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="icon {{ result.icon }}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{ result.title }}</div>\n <div class="description" ng-if="result.description">{{ result.description }}</div>\n </div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n </md-button>\n </div>\n </div>\n\n \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n </md-button>\n\n <md-menu-content>\n <div id="ms-shortcut-add-menu">\n <div class="shortcut-search" layout="row" layout-align="start center">\n <div class="search-icon" layout="row" layout-align="center center"\n ng-if="!MsShortcuts.resultsLoading">\n <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </div>\n <div class="shortcut-loader" layout="row" layout-align="center center"\n ng-if="MsShortcuts.resultsLoading">\n <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n </md-progress-circular>\n </div>\n\n <input type="text" placeholder="Search" flex\n ng-model="MsShortcuts.query"\n ng-model-options="MsShortcuts.queryOptions"\n ng-keydown="MsShortcuts.handleKeydown($event)">\n </div>\n\n <div class="results" ng-if="MsShortcuts.results" >\n <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsShortcuts.results"\n ng-click="MsShortcuts.handleResultClick(result)"\n ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n ng-mousedown="MsShortcuts.absorbEvent($event)"\n ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n md-prevent-menu-close="md-prevent-menu-close"\n md-ink-ripple>\n <div layout="row" layout-align="start space-between">\n <div layout="row" layout-align="start center" flex>\n <div class="icon icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="{{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n </div>\n </div>\n <md-icon md-font-icon="icon-pin" class="icon s18"\n ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n </div>\n </div>\n </div>\n </div>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n <div class="ms-stepper-navigation-wrapper">\n <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}" ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n <div class="step md-accent-bg" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n {{$index + 1}}\n </span>\n <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n <i class="icon icon-check s18"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n </div>\n </md-button>\n </div>\n </div>\n\n <div class="ms-stepper-steps" ng-transclude></div>\n\n <div class="ms-stepper-controls" layout="row" layout-align="center center">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <div class="ms-stepper-dots">\n <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n </span>\n </div>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",'<md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(stepInfo.stepNumber), \'valid\': MsStepper.isStepValid(stepInfo.stepNumber), \'disabled\': MsStepper.isStepDisabled(stepInfo.stepNumber), \'optional\': MsStepper.isStepOptional(stepInfo.stepNumber)}" ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n <div class="step" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n </span>\n <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-check-circle s18 md-accent-fg"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n <div class="ms-stepper-vertical-line"></div>\n <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-tab-scroll/ms-tab-scroll.html",'<div layout="row">\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'left\')" ng-if="vm.canScroll(\'left\') == true">\n <md-icon md-font-icon="icon-chevron-left" class="icon s26"></md-icon>\n </md-button>\n <div id="bar-container" layout="row" class="bar-container">\n <div ng-transclude id="tab-container" layout="row" layout-align="start center" class="scroll-container">\n </div>\n </div>\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'right\')" ng-if="vm.canScroll(\'right\') == true">\n <md-icon md-font-icon="icon-chevron-right" class="icon s26"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin" ng-change="ngChange()">\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-2" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n <div ng-class="\'font-size-\' + (vm.fontSize * 2)" ng-style="{\'color\': widget.foreground}">\n {{ vm.getCount(widget) }}\n </div>\n <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' + vm.label | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n <dl ng-if="vm.error">\n <dt class="text-bold">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt>Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.title}}</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n </div>\n </md-toolbar>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span>No Data</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n <ul>\n <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n <md-card layout-fill>\n <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground, \'font-size\': (widget.titleFontSize || 12) }" class="text-truncate" flex>\n {{ widget.title || \'No Title\' }}\n </a>\n <md-button ng-if="!vm.config.preview && !vm.config.crudPermissions.readOnly" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu ng-if="!vm.config.preview">\n <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.config.crudPermissions.canEdit === true">\n <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.config.crudPermissions.canDelete === true">\n <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">\n Delete</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n </div>\n </md-toolbar>\n <md-card-content class="resizable" layout="column" layout-align="center center" flex style="height: 60px !important; min-height: 60px !important" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n <div ng-switch="widget.type" layout-fill>\n <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n <div ng-switch-default layout-fill>\n <div ng-include="widget.templateUrl" layout-fill></div>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </li>\n </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n </div>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n <div class="ms-theme-options-list" layout="column">\n <div class="theme-option layout-options">\n <div class="option-title">Layout Style:</div>\n <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n <div layout="column" layout-align="center center">\n <img ng-src="{{layoutStyle.figure}}">\n <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n </div>\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option">\n <div class="option-title">Layout Mode:</div>\n <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n {{layoutMode.label}}\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option color-palettes">\n <div class="option-title">Color Palette:</div>\n <div layout="row" layout-align="start start" layout-wrap>\n <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}" ng-class="{active: vm.getActiveTheme().name === themeName}">\n <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n <div class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR404.CODE">404</div>\n\n <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n </div> --\x3e\n\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR500.CODE">500</div>\n <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n </div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n </div>\n <pre ng-if="!vm.send">\n {{vm.error}}\n </pre>\n <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code">#{{vm.code}}</div>\n <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n <div layout="row" layout-align="start center">\n <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n </div>\n </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n <form name="forgotPasswordForm" novalidate>\n <md-input-container class="md-block" md-no-float>\n <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n SEND RESET LINK\n </md-button>\n </form>\n\n <div class="login" layout="row" layout-align="center center">\n <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n </div>\n </div>\n </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n <div flex hide-xs translate="HEADER.NEWS"></div>\n </div>\n </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column">\n <div id="login-form-wrapper" layout="column" layout-align="center center">\n <div id="login-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n <md-input-container class="md-block" md-no-float>\n <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n <div ng-messages="loginForm.name.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n <div ng-messages="loginForm.password.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n </md-checkbox> --\x3e\n <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n </div>\n\n <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message">\n <font color="red">{{vm.message}}</font>\n </b>\n <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n LOG IN\n </md-button>\n </form>\n\n <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n <div ng-if="vm.googleSsoEnabled || vm.adSsoEnabled" class="separator">\n <span class="text" translate="LOGIN.OR">OR</span>\n </div>\n\n <md-button ng-if="vm.googleSsoEnabled" ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="fab fa-google" class="s16"></md-icon>\n <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n </span>\n </div>\n </md-button>\n\n <md-button ng-if="vm.adSsoEnabled" ng-click="vm.loginAD()" class="md-raised ad">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="fas fa-ad" class="s16"></md-icon>\n <span style="text-transform: none" translate="LOGIN.WITH_AD">Log in with Active Directory</span>\n </span>\n </div>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n <form name="extractedReportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n\n <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n\n <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n ADD EXTRACTEDREPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-extractedReports-count">\n <span>{{vm.selectedExtractedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.extractedReports.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(extractedReport, $event )" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n Edit ExtractedReport\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="extractedReport.status == \'Completed\'">\n\n <md-button ng-click="vm.downloadfile2(extractedReport, $event , \'analytics/extracted_reports\' )" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n Download ExtractedReport\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(extractedReport, $event )" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n Delete ExtractedReport\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n <form name="metricForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n\n <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select name="table" ng-model="vm.metric.table" required>\n <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n <md-option ng-value="\'report_call\'">Call Report</md-option>\n <md-option ng-value="\'cdr\'">CDR</md-option>\n <md-option ng-value="\'chat_websites\'">Chat Website</md-option>\n <md-option ng-value="\'chat_interactions\'">Chat Interaction</md-option>\n <md-option ng-value="\'chat_messages\'">Chat Messages</md-option>\n <md-option ng-value="\'chat_offline_messages\'">Chat Offline Messages</md-option>\n <md-option ng-value="\'chat_queues\'">Chat Queues</md-option>\n <md-option ng-value="\'report_chat_queue\'">Chat Report Queue</md-option>\n <md-option ng-value="\'report_chat_transfer\'">Chat Report Transfer</md-option>\n <md-option ng-value="\'cm_companies\'">Companies</md-option>\n <md-option ng-value="\'report_call_transfer\'">Call transfer report</md-option>\n <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n <md-option ng-value="\'report_dial\'">Dial Report</md-option>\n <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n <md-option ng-value="\'mail_accounts\'">Email Account</md-option>\n <md-option ng-value="\'mail_interactions\'">Email Interaction</md-option>\n <md-option ng-value="\'mail_messages\'">Email Messages</md-option>\n <md-option ng-value="\'mail_queues\'">Email Queues</md-option>\n <md-option ng-value="\'report_mail_queue\'">Email Report Queue</md-option>\n <md-option ng-value="\'report_mail_transfer\'">Email Report Transfer</md-option>\n <md-option ng-value="\'fax_accounts\'">Fax Account</md-option>\n <md-option ng-value="\'fax_interactions\'">Fax Interaction</md-option>\n <md-option ng-value="\'fax_messages\'">Fax Messages</md-option>\n <md-option ng-value="\'fax_queues\'">Fax Queues</md-option>\n <md-option ng-value="\'report_fax_queue\'">Fax Report Queue</md-option>\n <md-option ng-value="\'report_fax_transfer\'">Fax Report Transfer</md-option>\n <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n <md-option ng-value="\'cm_lists\'">Lists</md-option>\n <md-option ng-value="\'report_member\'">Member Report</md-option>\n <md-option ng-value="\'openchannel_accounts\'">Openchannel Account</md-option>\n <md-option ng-value="\'openchannel_interactions\'">Openchannel Interaction</md-option>\n <md-option ng-value="\'openchannel_messages\'">Openchannel Messages</md-option>\n <md-option ng-value="\'openchannel_queues\'">Openchannel Queues</md-option>\n <md-option ng-value="\'report_openchannel_queue\'">Openchannel Report Queue</md-option>\n <md-option ng-value="\'report_openchannel_transfer\'">Openchannel Report Transfer</md-option>\n <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n <md-option ng-value="\'sms_accounts\'">SMS Account</md-option>\n <md-option ng-value="\'sms_interactions\'">SMS Interaction</md-option>\n <md-option ng-value="\'sms_messages\'">SMS Messages</md-option>\n <md-option ng-value="\'sms_queues\'">SMS Queues</md-option>\n <md-option ng-value="\'report_sms_queue\'">SMS Report Queue</md-option>\n <md-option ng-value="\'report_sms_transfer\'">SMS Report Transfer</md-option>\n <md-option ng-value="\'users\'">Users</md-option>\n <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n <md-option ng-value="\'whatsapp_accounts\'">Whatsapp Account</md-option>\n <md-option ng-value="\'whatsapp_interactions\'">Whatsapp Interaction</md-option>\n <md-option ng-value="\'whatsapp_messages\'">Whatsapp Messages</md-option>\n <md-option ng-value="\'whatsapp_queues\'">Whatsapp Queues</md-option>\n <md-option ng-value="\'report_whatsapp_queue\'">Whatsapp Report Queue</md-option>\n <md-option ng-value="\'report_whatsapp_transfer\'">Whatsapp Report Transfer</md-option>\n </md-select>\n <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.METRIC">Metric</label>\n <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n\n <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.metric.description">\n\n <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n ADD METRIC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-metrics-count">\n <span>{{vm.selectedMetrics.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- METRIC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.metrics.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(metric, $event )" translate="ANALYTICS.EDIT_METRIC">\n Edit Metric\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(metric, $event )" translate="ANALYTICS.DELETE_METRIC">\n Delete Metric\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / METRIC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD METRIC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n COPY REPORT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newReport">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select ng-model="vm.report.table" required>\n <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)" placeholder="Select the table to Join">\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n </md-item-template>\n <md-not-found>\n No states matching "{{vm.searchText}}" were found.\n </md-not-found>\n </md-autocomplete>\n\n <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n <md-card-title>\n <md-card-title-text layout="row">\n <div layout="row" flex="50">\n <span class="md-subhead">{{table.name}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.type" placeholder="Select join type" required>\n <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n </md-select>\n </md-card-content>\n </md-card>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n ADD REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n <div layout="row" ng-if="vm_rc.crudPermissions.canEdit">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.OPERATOR">Operator</label>\n <md-select ng-model="group.operator" required>\n <md-option value="AND">AND</md-option>\n <md-option value="OR">OR</md-option>\n </md-select>\n <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}\n </md-button>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n <div flex></div>\n <md-input-container class="md-block" ng-if="parent">\n <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n </div>\n <div layout="column" ng-repeat="rule in group.rules">\n <div layout="row" ng-if="!rule.group">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.COLUMN">COLUMN</label>\n <md-select name="field" ng-model="rule.field" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-optgroup label="{{vm_rc.report.table}}">\n <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n </md-optgroup>\n <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.CONDITION">CONDITION</label>\n <md-select name="condition" ng-model="rule.condition" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n </md-select>\n <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n <label translate="ANALYTICS.VALUE">VALUE</label>\n <input type="text" name="value" ng-model="rule.value" ng-disabled="!vm_rc.crudPermissions.canEdit" required md-autofocus>\n <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm_rc.crudPermissions.canEdit" flex>\n <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </md-input-container>\n </div>\n <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n <form name="reportFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <pre></pre>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n <md-option value="column">Select a column</md-option>\n <md-option value="metric">Select an existing metric</md-option>\n <md-option value="custom">Write a custom metric</md-option>\n </md-select>\n <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch on="vm.reportField.type">\n <md-input-container class="md-block" ng-switch-when="column">\n <label translate="ANALYTICS.COLUMN">Column Name</label>\n <md-select name="column" ng-model="vm.reportField.field" required>\n <md-optgroup label="{{vm.report.table}}">\n <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n </md-optgroup>\n <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="metric">\n <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="custom">\n <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FUNCTION">Function</label>\n <md-select name="function" ng-model="vm.reportField.function">\n <md-option ng-value="null">No Function</md-option>\n <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FORMAT">Format</label>\n <md-select name="format" ng-model="vm.reportField.format">\n <md-option ng-value="null">No Format</md-option>\n <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.GROUP_BY">Group By</label>\n <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ORDER_BY">Order By</label>\n <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n <md-option ng-value="null">No Order</md-option>\n <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n </md-select>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n ADD REPORT FIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="report-image" hide-xs>\n <img ng-src="assets/images/business/reports.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.report.id}} {{vm.report.name}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span>{{vm.report.description}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.description">\n <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="start start">\n <div class="md-subhead" translate="ANALYTICS.FIELDS">\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </div>\n <div class="h4">\n <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n </div>\n <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n </div>\n </div>\n </div>\n <div flex></div>\n <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-if="vm_rf.crudPermissions.canEdit" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select="vm_rf.crudPermissions.canDelete" multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n <tr md-row>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n </th>\n <th md-column>Type</th>\n <th md-column>Column or Metric</th>\n <th md-column>Alias</th>\n <th md-column>Function</th>\n <th md-column>Format</th>\n <th md-column>Group By</th>\n <th md-column>Order By</th>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_rf.sortableTable">\n <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n <td md-cell class="handle" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical" class="s16"></md-icon>\n </td>\n <td md-cell>\n <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n </td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n <td md-cell class="actions" ng-if="vm_rf.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report, vm.crudPermissions)">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n </div>\n <form name="conditionsForm" novalidate>\n <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.previewReport()">\n <md-tab-label>\n <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.queryReport()">\n <md-tab-label>\n <span>Query</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <div ng-if="!vm.error">\n {{vm.queryResult}}\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-reports-count">\n <span>{{vm.selectedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div layout="column" flex="30">\n <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n \x3c!-- SEARCH --\x3e\n <div layout="row" layout-align="start center">\n <label for="searchFolder" class="m-0">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n <div flex></div>\n <ms-search-bar on-search="vm.getReports()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n Copy Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n Preview Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n Run Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n Download Json Report\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete && vm.currentNode.custom">\n </md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom">\n <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n Edit Report\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom">\n <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.export.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.FORMAT">FORMAT</label>\n <md-select name="format" ng-model="vm.export.output" required>\n <md-option value="csv">CSV</md-option>\n <md-option value="xlsx">Excel (XLSX)</md-option>\n <md-option value="pdf">PDF</md-option>\n <md-option value="web">Web</md-option>\n </md-select>\n <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="maxDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="minDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n </div>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startTime">\n <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endTime">\n <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n RUN REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.WEB_REPORT">Web Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n <form name="odbcForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n\n <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DSN">DSN</label>\n <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n\n <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.odbc.description">\n\n <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n ADD ODBC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-odbcs-count">\n <span>{{vm.selectedODBC.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- ODBC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.odbcs.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(odbc, $event )" translate="CALLYSQUARE.EDIT_ODBC">\n Edit Odbc\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestOdbc(odbc, $event )" translate="CALLYSQUARE.TEST_ODBC">\n Test Odbc\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(odbc, $event )" translate="CALLYSQUARE.DELETE_ODBC">\n Delete Odbc\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ODBC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ODBC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title | translate}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.openFromEditor" class="md-block">\n \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">\n <form name="dialogForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_cloud_tts_text_type|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type|languageCode|ssmlGender|method|dialogflowV2_language" ng-required="attribute.required">\n <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START NUMBER INPUT --\x3e\n <div ng-switch-when="timeout">\n <div ng-switch="vm.cellName">\n <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="restapi" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n </div>\n </div>\n <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n \x3c!-- END NUMBER INPUT --\x3e\n\n \x3c!-- START TEXTAREA INPUT --\x3e\n <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text|custom_action_data|headers|body|rawHeaders|rawBody|private_key" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n \x3c!-- END TEXTAREA INPUT --\x3e\n\n \x3c!-- START URL INPUT --\x3e\n <input ng-switch-when-separator="|" ng-switch-when="ndauth_url|ndassistant_url|url" type="url" name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n \x3c!-- END URL INPUT --\x3e\n\n \x3c!-- START TEXT INPUT --\x3e\n <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit">\n <div class=\'hint\' ng-if="attribute.name === \'text\' && vm.cellName === \'tts\' ">\n <span translate="CALLYSQUARE.HELP.MAX_TEXT_TTS" class="ng-scope">Max 250 chars are supported</span>\n </div>\n \x3c!-- END TEXT INPUT--\x3e\n\n <div class="hint" ng-if="attribute.help">\n <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n </div>\n <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="vm.crudPermissions.canEdit">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="editForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label>XML</label>\n <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n CLOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="descriptionFrom" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description" md-autofocus>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NOTES">Description</label>\n <textarea name="notes" ng-model="vm.project.notes"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="openForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.PROJECT">Project</label>\n <md-select name="id" ng-model="vm.id" required>\n <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n </md-select>\n <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n OPEN\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="newForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus>\n <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n COPY\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/cprojects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}} {{vm.project.name}}\n </div>\n <div class="subtitle secondary-text text-truncate">\n <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-if="vm.crudPermissions.canEdit" ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content class="callysquare-content">\n\n <div id="geEditor" class="geEditor"></div>\n\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-if="vm.crudPermissions.canEdit" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n <form name="squareRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.FILENAME">Filename</label>\n <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n\n <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n ADD SQUARERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-squareRecordings-count">\n <span>{{vm.selectedSquareRecordings.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SQUARERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n <th md-column>{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.squareRecordings.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n <td md-cell class="audio " ng-switch="squareRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadCallySquareRecordings">\n\n <md-button ng-click="vm.downloadfile2(squareRecording, $event , \'square/recordings\' )" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n Download SquareRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(squareRecording, $event )" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n Delete SquareRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SQUARERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatQueues-count">\n <span>{{vm.selectedChatQueues.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CHATQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(chatQueue, $event )" translate="CHAT.EDIT_CHATQUEUE">\n Edit ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(chatQueue, $event )" translate="CHAT.TEAMADD_CHATQUEUE">\n teamadd ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(chatQueue, $event )" translate="CHAT.AGENTADD_CHATQUEUE">\n agentadd ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(chatQueue, $event )" translate="CHAT.DELETE_CHATQUEUE">\n Delete ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event )" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n goToRealtime ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n <form name="chatQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n\n <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n ADD CHATQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatQueue-image" hide-xs>\n <img ng-src="assets/images/business/chatQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatQueue.id}}\n <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatWebsites-count">\n <span>{{vm.selectedChatWebsites.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CHATWEBSITE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatWebsites.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(chatWebsite, $event )" translate="CHAT.EDIT_CHATWEBSITE">\n Edit ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(chatWebsite, $event )" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n Interactions ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event )" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n OfflineMessages ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(chatWebsite, $event )" translate="CHAT.AGENTADD_CHATWEBSITE">\n AgentAdd ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(chatWebsite, $event )" translate="CHAT.DELETE_CHATWEBSITE">\n Delete ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATWEBSITE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n\n <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n\n <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n ADD CHATWEBSITE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",'<md-dialog class="chatWebsite-dialog" aria-label="chatWebsite" ng-init="vm.onInit()">\n <form name="chatWebsiteForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATWEBSITE">Add Agent to chatWebsite</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/amazonlex/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'accesskeyid\'].$error" ng-show="chatWebsiteFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'secretaccesskey\'].$error" ng-show="chatWebsiteFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'lexregion\'].$error" ng-show="chatWebsiteFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'botname\'].$error" ng-show="chatWebsiteFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflow/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'key\'].$error" ng-show="chatWebsiteFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'projectId\'].$error" ng-show="chatWebsiteFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'clientEmail\'].$error" ng-show="chatWebsiteFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'privateKey\'].$error" ng-show="chatWebsiteFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tag/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'tag\'].$error" ng-show="chatWebsiteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tvox/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.SERVICEID">serviceid</label>\n <input type="text" name="serviceid" ng-model="vm.tvox.serviceid" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'serviceid\'].$error" ng-show="chatWebsiteFormApp[\'serviceid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SERVICEID_REQUIRED">serviceid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CHANNELID">channelid</label>\n <input type="text" name="channelid" ng-model="vm.tvox.channelid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'channelid\'].$error" ng-show="chatWebsiteFormApp[\'channelid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CHANNELID_REQUIRED">channelid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXURL">tvoxurl</label>\n <input type="text" name="tvoxurl" ng-model="vm.tvox.tvoxurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXURL_REQUIRED">tvoxurl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXLOGINURL">tvoxloginurl</label>\n <input type="text" name="tvoxloginurl" ng-model="vm.tvox.tvoxloginurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxloginurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxloginurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXLOGINURL_REQUIRED">tvoxloginurl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXSESSIONURL">tvoxsessionurl</label>\n <input type="text" name="tvoxsessionurl" ng-model="vm.tvox.tvoxsessionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxsessionurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxsessionurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXSESSIONURL_REQUIRED">tvoxsessionurl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXUSERNAME">tvoxusername</label>\n <input type="text" name="tvoxusername" ng-model="vm.tvox.tvoxusername" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxusername\'].$error" ng-show="chatWebsiteFormApp[\'tvoxusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXUSERNAME_REQUIRED">tvoxusername field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXPASSWD">tvoxpasswd</label>\n <input type="password" name="tvoxpasswd" ng-model="vm.tvox.tvoxpasswd" placeholder="Password" translate translate-attr-placeholder="CHAT.PASSWORD">\n <div ng-messages="chatWebsiteFormApp[\'tvoxpasswd\'].$error" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONURLONRING">motionurlonring</label>\n <input type="text" name="motionurlonring" ng-model="vm.tvox.motionurlonring" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motionurlonring\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonring\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONURLONRING_REQUIRED">motionurlonring field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONURLONANSWER">motionurlonanswer</label>\n <input type="text" name="motionurlonanswer" ng-model="vm.tvox.motionurlonanswer" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motionurlonanswer\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonanswer\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONURLONANSWER_REQUIRED">motionurlonanswer field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONTITLE">motiontitle</label>\n <input type="text" name="motiontitle" ng-model="vm.tvox.motiontitle" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motiontitle\'].$error" ng-show="chatWebsiteFormApp[\'motiontitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONTITLE_REQUIRED">motiontitle field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONURL">motionurl</label>\n <input type="text" name="motionurl" ng-model="vm.tvox.motionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motionurl\'].$error" ng-show="chatWebsiteFormApp[\'motionurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONURL_REQUIRED">motionurl field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n\n <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n ADD CHATCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-content flex layout-padding>\n <pre ng-if="vm.isHtml">{{vm.message.body}}</pre>\n <div ng-if="!vm.isHtml" ng-bind-html-unsafe="vm.message.body"></div>\n\n <span ng-repeat="attachment in vm.attachments">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.download(attachment)">\n <md-icon class="no-margin material-icons" aria-label="Attachment">attach_file</md-icon>\n </md-button>\n <span>{{attachment.name}}</span><br />\n </span>\n </md-content>\n\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n\n <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TYPE">Type</label>\n <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }} </md-option>\n\n <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n <label translate="CHAT.SELECTOR">Selector</label>\n <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n ADD CHATPROACTIVEACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatWebsite-image" hide-xs>\n <img ng-src="assets/images/business/chatWebsites.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatWebsite.id}}\n <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatWebsite, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATWEBSITE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatWebsite()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (dispositionForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (customerAvatarForm.$invalid) || (systemAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (vidaooForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.chatWebsite.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.queueTransfer == true" class="md-block">\n <label translate="CHAT.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.chatWebsite.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentTransfer == true" class="md-block">\n <label translate="CHAT.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.chatWebsite.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n <form name="scriptForm" flex="100" novalidate>\n <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n <div>\n <pre style="font-size: 13px;">\n {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n </pre>\n </div>\n <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n </md-input-container>\n\n </div>\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n </div>\n <form name="intervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEZONE">Timezone</label>\n <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span></div>\n <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.mandatoryDisposition" class="md-block">\n <label translate="CHAT.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.chatWebsite.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SNIPPET">SNIPPET</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n </div>\n <form name="appearanceForm" novalidate>\n <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textButtonColor" label="{{\'CHAT.TEXT_BUTTON_COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.backgroundColor" label="{{\'CHAT.BACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="CHAT.FONTSIZE">fontSize</label>\n <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADERSHAPE">headershape</label>\n <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }} </md-option>\n\n <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showCustomerAvatar" aria-label="showCustomerAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWCUSTOMERAVATAR">showCustomerAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SNIPPETSWIPEOUT">snippetSwipeOut</label>\n <md-select name="alignment" ng-model="vm.chatWebsite.alignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'bottom_right\'"> {{ \'CHAT.BOTTOM_RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'right\'"> {{ \'CHAT.RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'left\'"> {{ \'CHAT.LEFT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'alignment\'].$error" ng-show="appearanceForm[\'alignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SNIPPETSWIPEOUT_REQUIRED">snippetSwipeOut field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.alignment !== \'bottom_right\'" class="md-block">\n <label translate="CHAT.VERTICALPOSITION">verticalPosition</label>\n <input type="number" name="verticalAlignment" ng-model="vm.chatWebsite.verticalAlignment" min="0" max="100" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.VERTICALPOSITION"></span></div>\n <div ng-messages="appearanceForm[\'verticalAlignment\'].$error" ng-show="appearanceForm[\'verticalAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_REQUIRED">verticalPosition field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>100</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.chatWebsite.messagesAlignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'alternate\'"> {{ \'CHAT.ALTERNATE\' | translate }} </md-option>\n\n <md-option ng-value="\'centered\'"> {{ \'CHAT.CENTERED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'messagesAlignment\'].$error" ng-show="appearanceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DEFAULTTITLE">defaultTitle</label>\n <input type="text" name="defaultTitle" ng-model="vm.chatWebsite.defaultTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'defaultTitle\'].$error" ng-show="appearanceForm[\'defaultTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_REQUIRED">defaultTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>defaultTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LABELTEXT">labelText</label>\n <input type="text" name="labelText" ng-model="vm.chatWebsite.labelText" md-maxlength="6" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'labelText\'].$error" ng-show="appearanceForm[\'labelText\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LABELTEXT_REQUIRED">labelText field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.LABELTEXT_MAX_LENGTH" translate-values=\'{max: 6}\'>labelText\n must have a maximum length equal to 6</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n </div>\n <form name="onlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_ONLINE">header_online</label>\n <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n </div>\n <form name="offlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n </div>\n <form name="closingformForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n <label translate="CHAT.RATINGTYPE">ratingType</label>\n <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'star\'">Star</md-option>\n <md-option ng-value="\'thumb\'">Thumb</md-option>\n </md-select>\n <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableFeedback" class="md-block">\n <label translate="CHAT.FEEDBACKTITLE">feedbackTitle</label>\n <input type="text" name="feedbackTitle" ng-model="vm.chatWebsite.feedbackTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'feedbackTitle\'].$error" ng-show="closingformForm[\'feedbackTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FEEDBACKTITLE_REQUIRED">feedbackTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FEEDBACKTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>feedbackTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n </div>\n <form name="unmanagedstatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.NOTETITLE">noteTitle</label>\n <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'noteTitle\'].$error" ng-show="unmanagedstatusForm[\'noteTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n </div>\n <form name="interactionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CUSTOMERALIAS">customerAlias</label>\n <input type="text" name="customerAlias" ng-model="vm.chatWebsite.customerAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'customerAlias\'].$error" ng-show="interactionForm[\'customerAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_REQUIRED">customerAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>customerAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGEFONTSIZE">messageFontSize</label>\n <input type="number" name="messageFontSize" ng-model="vm.chatWebsite.messageFontSize" min="0" max="20" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'messageFontSize\'].$error" ng-show="interactionForm[\'messageFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_REQUIRED">messageFontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>20</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableSendButton" aria-label="enableSendButton" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLESENDBUTTON">enableSendButton</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerCheckmarks" aria-label="enableCustomerCheckmarks" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERCHECKMARKS">enableCustomerCheckmarks</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SYSTEMALIAS">systemAlias</label>\n <input type="text" name="systemAlias" ng-model="vm.chatWebsite.systemAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'systemAlias\'].$error" ng-show="interactionForm[\'systemAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_REQUIRED">systemAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>systemAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n </div>\n <form name="whitelabelForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DEFAULT">default</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n <label translate="CHAT.WHITELABEL">whiteLabel</label>\n <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n </div>\n <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n </div>\n <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="agentAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{agentAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container customeravatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CUSTOMERAVATAR">CUSTOMERAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitecustomerAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="customerAvatarimage in vm_ca.chatWebsite.images" ng-switch="customerAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{customerAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="customerAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{customerAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container systemavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SYSTEMAVATAR">SYSTEMAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitesystemAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="systemAvatarimage in vm_ca.chatWebsite.images" ng-switch="systemAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{systemAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="systemAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{systemAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ONLINE">ONLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="onlineForm" novalidate>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select ng-model="item.variable">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINE">OFFLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="offlineForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n <div ng-message="email">\n <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.openNewInteraction" aria-label="openNewInteraction">\n <span translate="CHAT.OPEN_NEW_INTERACTION">openNewInteraction</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction">\n <label translate="CHAT.EMAIL_ACCOUNT">Email account</label>\n <md-select ng-model="vm_fonc.chatWebsite.MailAccountId" required>\n <md-option ng-repeat="account in vm_fonc.email_accounts" ng-value="account.id">{{ account.name }}</md-option>\n </md-select>\n <div ng-messages="offlineForm[\'MailAccountId\'].$error" ng-show="offlineForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.EMAIL_ACCOUNT_REQUIRED">Email account field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction && vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.SUBJECT">Subject</label>\n <md-select ng-model="vm_fonc.chatWebsite.subjectOffline" md-selected-text="vm_fonc.chatWebsite.subjectOffline != null ? vm_fonc.chatWebsite.subjectOffline : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="item.props.title">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n <md-input-container class="md-block" ng-if="item.type != \'upload\'">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteProactiveActions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column md-order-by="name">\n {{ \'CHAT.NAME\' | translate }}\n </th>\n <th md-column md-order-by="type">\n {{ \'CHAT.TYPE\' | translate }}\n </th>\n <th md-column md-order-by="selector">\n {{ \'CHAT.SELECTOR\' | translate }}\n </th>\n <th md-column md-order-by="timeout">\n {{ \'CHAT.TIMEOUT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.id}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.name}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}\n </td>\n\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.selector}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.timeout}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{ chatProactiveAction.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n Edit ChatProactiveAction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n Delete ChatProactiveAction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="ChatWebsiteDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add chat dispositions" translate translate-attr-label="CHAT.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteChatCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'CHAT.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'CHAT.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'CHAT.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{ chatCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n Edit ChatCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n Delete ChatCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.VIDEO">VIDEO</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container vidaoo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.VIDAOO">VIDAOO</div>\n </div>\n <form name="vidaooForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.vidaooEscalation" aria-label="vidaooEscalation" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.VIDAOOESCALATION">vidaooEscalation</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOOAPIKEY">vidaooApiKey</label>\n <input type="text" name="vidaooApiKey" ng-model="vm.chatWebsite.vidaooApiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="vidaooForm[\'vidaooApiKey\'].$error" ng-show="vidaooForm[\'vidaooApiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VIDAOOAPIKEY_REQUIRED">vidaooApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOOTOPIC">vidaooTopic</label>\n <input type="text" name="vidaooTopic" ng-model="vm.chatWebsite.vidaooTopic" value="Generated by XCALLY Motion" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="vidaooForm[\'vidaooTopic\'].$error" ng-show="vidaooForm[\'vidaooTopic\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VIDAOOTOPIC_REQUIRED">vidaooTopic field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOONOTE">vidaooNote</label>\n <input type="text" name="vidaooNote" ng-model="vm.chatWebsite.vidaooNote" value="Meeting generated for interaction #{{interaction.id}} by {{agent.name}}" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="vidaooForm[\'vidaooNote\'].$error" ng-show="vidaooForm[\'vidaooNote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VIDAOONOTE_REQUIRED">vidaooNote field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOOMETADATA">vidaooMetadata</label>\n <textarea name="vidaooMetadata" ng-model="vm.chatWebsite.vidaooMetadata"></textarea>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="CHAT.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getChatWebsiteInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'CHAT.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'CHAT.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'CHAT.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'CHAT.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'CHAT.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'CHAT.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'CHAT.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteOfflineMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column>\n {{ \'CHAT.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n <td md-cell>\n {{offlineMessage.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="offlineMessage.Attachments.length > 0">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n {{offlineMessage.Contact.firstName}}\n </td>\n <td md-cell>\n {{ offlineMessage.createdAt | formatdate }}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n SHOW OfflineMessage\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n Delete OfflineMessage\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-companies-count">\n <span>{{vm.selectedCompanies.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- COMPANY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.companies.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(company, $event )" translate="CONTACTMANAGER.EDIT_COMPANY">\n Edit Company\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotocontactsgoto(company, $event )" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n goToContacts Company\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(company, $event )" translate="CONTACTMANAGER.DELETE_COMPANY">\n Delete Company\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / COMPANY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD COMPANY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n <form name="companyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n\n <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n\n <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n\n <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n\n <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n\n <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n\n <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n\n <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n\n <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n\n <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n\n <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n ADD COMPANY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="company-image" hide-xs>\n <img ng-src="assets/images/business/companies.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.company.id}}\n <span ng-if="vm.company.name">{{vm.company.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCompany()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n </div>\n <form name="addressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.company.street" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="postalCode" ng-model="vm.company.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.company.city" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.company.country" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n </div>\n <form name="shipmentAddressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="sCity" ng-model="vm.company.sCity" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="sCountry" ng-model="vm.company.sCountry" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-contacts-count">\n <span>{{vm.selectedContacts.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []">\n <md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n <md-select placeholder="Select a list" ng-model="vm.selectedList" ng-disabled="vm.lists.count === 0">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n <md-select placeholder="Select a company" flex="100" ng-model="vm.selectedCompany" ng-disabled="vm.companies.count === 0">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n <md-select multiple placeholder="Select one or more tags" flex="100" ng-model="vm.query.tag" ng-change="vm.getContacts()">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n\n \x3c!-- USER TABLE --\x3e\n <md-card flex="80">\n <md-table-container ng-init="vm.getAssignedCompanies()">\n <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'CONTACTMANAGER.CREATED_AT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="phone" privacy ng-cloak>{{contact.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="createdAt">{{contact.createdAt | date:\'medium\'}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete">\n </md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n Delete Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-fab-speed-dial id="add-contact-button" ng-if="vm.crudPermissions.canEdit" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-accent">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button class="md-fab md-mini md-primary" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContactsUpdates($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.UPDATES_EXISTING_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.UPDATE_EXISTING_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus privacy="!vm.crudPermissions.canEdit" ng-cloak>\n\n <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n <input name="lastName" ng-model="vm.contact.lastName" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input name="phone" ng-model="vm.contact.phone" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input name="email" type="email" ng-model="vm.contact.email" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <input name="mobile" ng-model="vm.contact.mobile" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input name="fax" ng-model="vm.contact.fax" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" flex-gt-sm="">\n <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="100">\n <div class="pb-16" layout="column" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n </div>\n <form flex name="additionalPhonesForm" novalidate>\n <div ng-repeat="additionalPhone in vm.additionalItems">\n <div layout="row" flex="1">\n <md-input-container class="md-block" flex="50">\n <label>{{$index}} - {{additionalPhone.phone}}</label>\n <md-select ng-model="vm.additionalItemTypes[$index]" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" flex="50">\n <input ng-model="additionalPhone.description" ng-cloak>\n </md-input-container>\n </div>\n </div>\n </form>\n </div>\n\n <md-input-container>\n <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone"></ms-timezone>\n </md-input-container>\n\n <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n <div ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div>\n \x3c!-- ng-model="customField.value" --\x3e\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-time-picker>\n </div>\n </div>\n\n <div ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </div>\n\n <div ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </div>\n\n <md-input-container ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-hide="!vm.contact.CompanyId && company.canSelect === false" ng-disabled="company.canSelect === false">\n {{company.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All\n Fields</md-button>\n </div>\n\n <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth">\n </mdp-date-picker>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.contact.country">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.NOTES">Notes</label>\n <input type="text" name="description" ng-model="vm.contact.description">\n </md-input-container>\n\n <div ng-if="vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer\n Fields</md-button>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="contact-image" hide-xs>\n <img ng-src="assets/images/business/contacts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <div ng-repeat="channel in vm_contact_qa.channels">\n <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n {{channel.name}}\n </md-tooltip>\n <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n </md-button>\n </div>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n <md-icon md-font-icon="icon-file-multiple"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine && socialForm.$pristine && additionalPhonesForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div layout="column" flex="70">\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO\n </div>\n </div>\n <form name="detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- phone --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- mobile --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- email --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail\n address</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- fax --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.ADDITIONAL_PHONES">Additional Phones</label>\n <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth" mdp-disabled="!vm.crudPermissions.canEdit"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-disabled="company.canSelect === false">{{company.name}}</md-option>\n <md-option ng-value=" null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n </md-input-container>\n <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-briefcase"></md-icon>\n <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n </section>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.Tags" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Tags">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-tag"></md-icon>\n <label translate="CONTACTMANAGER.NO_TAG">No Tags</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n </section>\n </div>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <div ng-if="vm.allFields">\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- country --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- city --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div flex="5"></div>\n \x3c!-- street --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- postalCode --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n </md-input-container>\n </div>\n\n <div layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n </md-button>\n </div>\n\n </div>\n </form>\n </md-card>\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n </div>\n <form name="socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n\n <div flex></div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS\n </div>\n </div>\n <form name="customFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n </md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}\n </md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n </form>\n </div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n </div>\n <form name="additionalPhonesForm" novalidate>\n <div ng-repeat="additionalPhone in vm.additionalItems">\n <div layout="row">\n <md-button class="md-icon-button" ng-show="!$first" ng-click="vm.moveUp($index)">\n <md-tooltip>{{\'CONTACTMANAGER.MOVE_UP\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-arrow-up"></md-icon>\n </md-button>\n <md-button class="md-icon-button md-primary" ng-show="!$last" ng-click="vm.moveDown($index)">\n <md-tooltip>{{\'CONTACTMANAGER.MOVE_DOWN\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-arrow-down"></md-icon>\n </md-button>\n </div>\n <div layout="column" style="margin-bottom:5px;border-bottom: 1px solid gray;">\n <md-input-container class="md-block">\n <label>{{$index}} - {{additionalPhone.phone}}</label>\n <md-select ng-model="additionalPhone.ItemTypeId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <input ng-model="additionalPhone.description" ng-cloak>\n </md-input-container>\n </div>\n </div>\n </form>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.dialer">\n <md-tab-label>\n <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'CONTACTMANAGER.RECALLME\' | translate }}</th>\n <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.hoppers.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n <td md-cell>{{hopper.id}}</td>\n <td md-cell privacy ng-cloak>{{hopper.phone}}</td>\n <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell>{{hopper.VoiceQueueId}}</td>\n <td md-cell>{{hopper.CampaignId}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.crudPermissions.canDelete && vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.finals.count">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n <td md-cell>{{final.uniqueid}}</td>\n <td md-cell privacy ng-cloak>{{final.calleridnum}}</td>\n <td md-cell>{{final.statedesc}}</td>\n <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n <td md-cell>{{final.disposition}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.histories.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n <td md-cell>{{history.uniqueid}}</td>\n <td md-cell privacy ng-cloak>{{history.calleridnum}}</td>\n <td md-cell>{{history.statedesc}}</td>\n <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.jscripty">\n <md-tab-label>\n <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n\n \x3c!-- SESSION TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.jscriptySessions.count">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.projectname}}</td>\n <td md-cell class="actions"></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / SESSION TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n </md-tab-label>\n\n <md-tab-body>\n <md-content class="md-padding" id="journey-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n <div class="form-title" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n <div layout="row" ng-repeat="additionalPhone in vm.contactItemTypes" flex>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select name="{{additionalPhone.key}}" ng-model="vm.binding[additionalPhone.key]" placeholder="{{additionalPhone.key}}" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select name="{{additionalPhone.key+\'_description\'}}" ng-model="vm.binding[additionalPhone.key+\'_description\']" placeholder="{{additionalPhone.key}} description" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/import/importUpdates.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.UPDATE_EXISTING_CONTACTS">Update Existing Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n <div class="form-title" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n <div layout="row" ng-repeat="additionalPhone in vm.contactItemTypes" flex>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select multiple="true" name="{{additionalPhone.key}}" ng-model="vm.binding[additionalPhone.key]" placeholder="{{additionalPhone.key}}" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select multiple="true" name="{{additionalPhone.key+\'_description\'}}" ng-model="vm.binding[additionalPhone.key+\'_description\']" placeholder="{{additionalPhone.key}} description" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block" flex-gt-sm>\n <label>Filter</label>\n <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n </md-input-container>\n\n <md-list flex>\n <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n <div class="md-list-item-text" layout="column">\n <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n <h4>{{ contact.email }}</h4>\n <p>{{ contact.phone }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n\n <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.globalCustomField.type == \'text\'" class="md-block">\n <md-switch ng-model="vm.globalCustomField.clickToAction" aria-label="ClickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">ClickToAction</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.globalCustomField.clickToAction" class="md-block">\n <label translate="CONTACTMANAGER.ACTIONTYPE">ActionType</label>\n <md-select name="actionType" ng-model="vm.globalCustomField.actionType">\n <md-option ng-value="\'voice\'">Voice</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'actionType\'].$error" ng-show="globalCustomFieldForm[\'actionType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">ActionType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n ADD GLOBALCUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-globalCustomFields-count">\n <span>{{vm.selectedGlobalCustomFields.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(globalCustomField, $event )" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n Edit GlobalCustomField\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(globalCustomField, $event )" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n Delete GlobalCustomField\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n <form name="listForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n\n <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n\n <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n ADD LIST\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list" ng-init="vm.onInit()">\n <form name="listForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n <form name="customFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n\n <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.customField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.customField.type == \'text\'" class="md-block">\n <md-switch ng-model="vm.customField.clickToAction" aria-label="clickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">clickToAction</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.customField.clickToAction" class="md-block">\n <label translate="CONTACTMANAGER.ACTIONTYPE">actionType</label>\n <md-select name="actionType" ng-model="vm.customField.actionType">\n <md-option ng-value="\'voice\'">Voice</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'actionType\'].$error" ng-show="customFieldForm[\'actionType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">actionType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n ADD CUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="list-image" hide-xs>\n <img ng-src="assets/images/business/lists.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.list.id}}\n <span ng-if="vm.list.name">{{vm.list.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-eye"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveList()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n <ms-search-bar on-search="vm_dc.getListCustomFields()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CONTACTMANAGER.ID\' | translate }}\n </th>\n <th md-column md-order-by="alias">\n {{ \'CONTACTMANAGER.ALIAS\' | translate }}\n </th>\n <th md-column md-order-by="type">\n {{ \'CONTACTMANAGER.TYPE\' | translate }}\n </th>\n <th md-column md-order-by="required">\n {{ \'CONTACTMANAGER.REQUIRED\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n {{customField.id}}\n </td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n {{customField.alias}}\n </td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n {{ vm_dc.arraytype[customField.type].option }} </td>\n\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n Edit CustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n Delete CustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n <td md-cell colspan="9">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="ListDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add contactmanager dispositions" translate translate-attr-label="CONTACTMANAGER.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedLists.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-lists-count">\n <span>{{vm.selectedLists.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- LIST TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.lists.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(list, $event )" translate="CONTACTMANAGER.EDIT_LIST">\n Edit List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotocontactsgoto(list, $event )" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n goToContacts List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadContactManagerLists">\n\n <md-button ng-click="vm.exportcsvcontactsexport(list, $event )" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n exportCsvContacts List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(list, $event )" translate="CONTACTMANAGER.AGENTADD_LIST">\n AgentAdd List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(list, $event )" translate="CONTACTMANAGER.DELETE_LIST">\n Delete List\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / LIST TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD LIST BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n <md-content>\n <md-toolbar class="md-default md-accent filter-header">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.customDashboard.name}}</span>\n <div flex></div>\n <md-button ng-click="vm.setFilter($event)">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.FILTERS"></span></md-tooltip>\n <md-icon md-font-icon="icon-filter" ng-class=""></md-icon>\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n <md-icon md-font-icon="icon-table-edit"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/custom/filter/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Set Filter">\n <form name="FilterForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content style="padding:30px;">\n <div layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-phone"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n </div>\n <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'voice\')" ng-model="vm.parent.voiceQueuesSelected" multiple aria-label="voiceQueues">\n <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.parent.voiceQueues.rows">{{\n voiceQueue.name }}\n </md-option>\n </md-select>\n </div>\n <div layout="column">\n <div>\n <i class="icon s16 icon-hangouts"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_CHAT_WEBSITES">Filter Chat\n Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'chat\')" ng-model="vm.parent.chatWebsitesSelected" multiple aria-label="chatWebsite">\n <md-option ng-value="chatWebsite.id" ng-repeat="chatWebsite in vm.parent.chatWebsites.rows">{{\n chatWebsite.name }}</md-option>\n </md-select>\n </div>\n </div>\n <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-message-text"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_SMS_ACCOUNTS">Filter Sms Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'sms\')" ng-model="vm.parent.smsAccountsSelected" multiple aria-label="smsAccount">\n <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.parent.smsAccounts.rows">{{\n smsAccount.name }}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <div>\n <i class="icon s16 icon-deskphone"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_FAX_ACCOUNTS">Filter Fax Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'fax\')" ng-model="vm.parent.faxAccountsSelected" multiple aria-label="faxAccount">\n <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.parent.faxAccounts.rows">{{\n faxAccount.name }}</md-option>\n </md-select>\n </div>\n </div>\n <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-email"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_MAIL_ACCOUNTS">Filter Mail\n Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'mail\')" ng-model="vm.parent.mailAccountsSelected" multiple aria-label="mailAccount">\n <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.parent.mailAccounts.rows">{{\n mailAccount.name }}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <div>\n <i class="icon s16 icon-google-earth"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_OPENCHANNEL_ACCOUNTS">Filter Openchannel\n Websites</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'openchannel\')" ng-model="vm.parent.openchannelAccountsSelected" multiple aria-label="openchannelAccount">\n <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.parent.openchannelAccounts.rows">{{\n openchannelAccount.name }}</md-option>\n </md-select>\n </div>\n </div>\n <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-whatsapp"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_WHATSAPP_ACCOUNTS">Filter Whatsapp\n Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'whatsapp\')" ng-model="vm.parent.whatsappAccountsSelected" multiple aria-label="whatsappAccount">\n <md-option ng-value="whatsappAccount.id" ng-repeat="whatsappAccount in vm.parent.whatsappAccounts.rows">\n {{whatsappAccount.name }}</md-option>\n </md-select>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.confirm()" class="send-button md-accent md-raised" aria-label="CONFIRM" translate="DASHBOARDS.CONFIRM" translate-attr-aria-label="DASHBOARDS.CONFIRM">\n CONFIRM\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n <div layout="row" layout-align="start center" class="md-primary-bg">\n <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n </md-button>\n\n <ms-tab-scroll style="overflow: hidden;">\n <div layout="column" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n <div style="height: 34px" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'">\n </md-icon>\n <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'">\n {{tab.title}}\n <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab); $event.stopPropagation()">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n </div>\n </ms-tab-scroll>\n </div>\n \x3c!-- home --\x3e\n <div layout="row" class="agent-content overflow-hidden" ng-if="vm.isActiveTab(0)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home" ng-init="vm_home.init(vm.license, vm.setting)"></div>\n \x3c!-- other tabs --\x3e\n <div ng-if="tab.id !== 0 && vm.isActiveTab(tab.id)" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-switch="tab.type" flex layout="column">\n <div ng-switch-when="contact" ng-class="{{tab.type}}" flex layout="column">\n <div class="agent-content" flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm" ng-init="vm.init(tab,$parent.vm.license)"></div>\n </div>\n <div ng-switch-when="popup" ng-class="{{tab.type}}" flex layout="column">\n <div flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="jscripty" ng-class="{{tab.type}}" flex layout="column">\n <div class="agent-content" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="bot" ng-class="{{tab.type}}" flex layout="column">\n <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html\'" ng-controller="AgentGeneralBotController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n </div>\n <div ng-switch-when="interaction" ng-class="{{tab.type}}" flex layout="column">\n <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'" ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n </div>\n </div>\n <div ng-switch-when="iframe" ng-class="{{tab.type}}" flex layout="column">\n <div id="iframe" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html\'" ng-controller="AgentGeneralIframeController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center">\n <div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent pink-fg" md-font-icon="fas fa-robot"></md-icon>\n </div>\n <span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n <span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n interaction...</span>\n </div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n <md-card flex="100" class="interaction">\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="fas fa-robot" class="s20 pink-fg"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.tab.data.uniqueid}} - {{vm.tab.title}}</span>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n\n </div>\n </div>\n </md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n <div class="interaction-messages">\n \x3c!-- MESSAGES --\x3e\n <div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\'" class="avatar" src="assets/images/avatars/robot.png">\n\n <div class="bubble" ng-switch="message.direction">\n <div>\n <div ng-switch-when="in" class="time secondary-text">\n {{vm.tab.title}} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n System - {{message.createdAt | date: \'medium\'}}\n </div>\n <div>\n <md-icon class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n </div>\n \x3c!-- / MESSAGES --\x3e\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n </md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.DETAIL">Detail</span>\n </md-tab-label>\n <md-tab-body>\n <md-content>\n <div layout="row" class="pr-10">\n <div layout="row" flex="75" class="flex-scrollable only-x">\n <md-card ng-repeat="call in vm.tab.calls track by call.uniqueid" class="call-info-card">\n <md-progress-linear md-mode="indeterminate" ng-if="vm.checkingCallStatus"></md-progress-linear>\n <md-card-header layout="row" layout-align="space-between">\n <span ng-if="call.answertime" class="text-boxed indigo-100-bg ml-0">\n <timer start-time="call.answertime"></timer>\n <md-tooltip md-direction="bottom">\n {{ \'DASHBOARDS.ELAPSED_ANSWERED\' | translate }}\n </md-tooltip>\n </span>\n <span ng-if="call.disposedAt" class="text-boxed amber-200-bg">\n <timer start-time="call.disposedAt"></timer>\n <md-tooltip md-direction="bottom">\n {{ \'DASHBOARDS.ELAPSED_DISPOSED\' | translate }}\n </md-tooltip>\n </span>\n <md-button class="md-icon-button no-margin reload-button" ng-click="vm.checkCallStatus(call)" ng-disabled="vm.checkingCallStatus">\n <md-icon md-font-icon="icon-reload" class="s22"></md-icon>\n <md-tooltip md-direction="bottom">\n {{ \'DASHBOARDS.RELOAD\' | translate }}\n </md-tooltip>\n </md-button>\n </md-card-header>\n <md-divider></md-divider>\n <md-card-content>\n <div layout="column" layout-align="space-between start" class="word-break-all mr-16">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{ call.routeId ? \'icon-phone-outgoing\' : \'icon-phone-incoming\'}}" class="s20 mr-5">\n </md-icon>\n <span class="h2" privacy ng-cloak>{{ call.routeId ? call.destcalleridnum : call.calleridnum }}</span>\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n <md-icon md-font-icon="icon-account" class="s20"></md-icon>\n Name: <span privacy ng-cloak>{{ call.calleridname }}</span>\n <div ng-if="(vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum}).length>0">\n <span ng-style="{\'color\':(vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].color} ">\n {{ (vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].description }} -\n {{ (vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].type }}\n </span>\n </div>\n </div>\n\n <div class="text h4 pt-8" ng-if="call.queue">\n <md-icon md-font-icon="icon-stackoverflow" class="s20"></md-icon>\n Queue: {{call.queue}}\n </div>\n <div class="text h4 pt-8" ng-if="call.variables.extravar">\n <md-icon md-font-icon="icon-minus" class="s20"></md-icon>\n Extra: {{call.variables.extravar}}\n </div>\n </div>\n <div layout="row" layout-align="center end" class="mt-8">\n <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised mr-0 mv-0">\n {{ \'DASHBOARDS.DISPOSE\' | translate}}\n </md-button>\n </div>\n </md-card-content>\n </md-card>\n </div>\n <div flex="25" layout="row" layout-md="column" layout-sm="column" layout-align="end center" layout-align-md="center center">\n <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="merge">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n <md-icon md-font-icon="icon-source-fork"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="duplicate">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="add">\n {{ \'DASHBOARDS.ADD\'| translate }}\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="save">\n {{ \'DASHBOARDS.SAVE\' | translate }}\n </md-button>\n </div>\n </div>\n <div layout="row">\n <div layout="column" flex="75">\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">\n PERSONAL_INFO</div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span>\n <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n\n <form name="vm.detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required privacy ng-cloak>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name\n field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event); vm.getJscriptyProjects();" aria-label="jscripty">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingJscriptyProjects">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingJscriptyProjects && vm.jscriptyProjects.count > 0" ng-repeat="project in vm.jscriptyProjects.rows">\n <md-button ng-click="vm.addJscriptyTab(project, $event)">\n <md-icon md-font-icon="icon-script"></md-icon>\n {{project.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingJscriptyProjects && (!vm.jscriptyProjects || vm.jscriptyProjects.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" privacy ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" privacy ng-cloak>\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" privacy ng-cloak>\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event); vm.getAccounts(\'sms\')" aria-label="sms">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.smsAccounts.count > 0" ng-repeat="account in vm.smsAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.smsAccounts || vm.smsAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.whatsapp || !vm.hasPermission(114) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW WHATSAPP" ng-click="$mdOpenMenu($event); vm.getAccounts(\'whatsapp\')" aria-label="whatsapp">\n <md-icon md-font-icon="icon-whatsapp"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.whatsappAccounts.count > 0" ng-repeat="account in vm.whatsappAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Whatsapp\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-whatsapp"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.whatsappAccounts || vm.whatsappAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_WHATSAPP_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-whatsapp"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" privacy ng-cloak>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a\n valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event); vm.getAccounts(\'mail\')" aria-label="email">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.mailAccounts.count > 0" ng-repeat="account in vm.mailAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n <md-icon md-font-icon="icon-email"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.mailAccounts || vm.mailAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax" privacy ng-cloak>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event); vm.getAccounts(\'fax\')" aria-label="fax">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.faxAccounts.count > 0" ng-repeat="account in vm.faxAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.faxAccounts || vm.faxAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n </div>\n <form name="additionalPhonesForm" novalidate>\n <div ng-repeat="additionalPhone in vm.additionalItems" layout="column">\n <md-input-container class="md-block">\n <label>{{$index}} - {{additionalPhone.phone}}</label>\n <md-select ng-model="vm.additionalItemTypes[$index]">\n <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <input ng-model="additionalPhone.description" ng-cloak>\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}\n </md-option>\n <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.TAG">TAG</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.tab.Tags" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tab.tags.rows">\n {{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n </form>\n </md-card>\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n <form name="vm.socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n <div flex="25" layout="column" layout-padding>\n <md-card flex="100" layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM\n FIELDS</div>\n <form name="vm.customFieldsForm" novalidate>\n\n \x3c!-- START INPUT LIST --\x3e\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select name="list" ng-disabled="!vm.newContact" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n </md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END INPUT LIST --\x3e\n\n <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">\n {{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}<span ng-if="customField.required">*</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <div layout-gt-sm="row" class="layout-gt-sm-row"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n <ms-click-to-call ng-if="customField.clickToAction && customField.actionType === \'voice\'" target="vm.contact[\'cf_\' + customField.id]" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n </div>\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding" id="journey-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <form name="disposition" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.call.mandatoryDisposition">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div ng-if="!vm.isReschedule">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\')">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.availableCalls === 1">\n <md-switch ng-model="vm.autoClose" aria-label="Auto Close">\n <span translate="DASHBOARDS.AUTOCLOSE">Automatically close contact tab after disposal</span>\n </md-switch>\n </md-input-container>\n </div>\n <div ng-if="vm.isReschedule">\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-change="vm.recalcTZTime()" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.date.$error" ng-show="disposition.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.time.$error" ng-show="disposition.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n <div layout="row">\n <div flex class="md-block">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n </md-input-container>\n </div>\n <div flex class="md-block">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n <input type="text" readonly value="{{vm.hopper.scheduledAt}}">\n </md-input-container>\n </div>\n </div>\n <div ng-if="(!vm.dialer || (vm.dialer && vm.recallme && vm.user.selectRecallMeCampaign)) && vm.queueCampaigns.rows.length > 0" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.CAMPAIGN">Campaign</label>\n <md-select name="queueCampaign" ng-model="vm.queueCampaign" required>\n <md-option ng-value="queueCampaign" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <md-icon md-font-icon="icon-checkbox-blank-circle" ng-class="{\'green-fg\': queueCampaign.dialActive}" aria-label="Status">\n </md-icon>\n {{ queueCampaign.name }}\n </md-option>\n </md-select>\n <div ng-messages="disposition.queueCampaign.$error" ng-show="disposition.queueCampaign.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.CAMPAIGN_REQUIRED">Campaign field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()" ms-dialog-spinner>\n {{(vm.selectedDisposition.name ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n </md-button>\n <md-button class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n Reschedule\n </md-button>\n <md-button class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n Recall Me\n </md-button>\n <span flex></span>\n <md-button ng-if="vm.hasBlackLists" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n Blacklist\n </md-button>\n </md-dialog-actions>\n <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="disposition.$invalid || disposition.$pristine || vm.disable" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="dateTime" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",'<md-dialog ng-init="vm.onInit()" class="contact-trigger-dialog" aria-label="Select contact" ng-cloak>\n <md-toolbar class="red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'DASHBOARDS.SELECT_CONTACT\' | translate }}</span>\n </div>\n </md-toolbar>\n <md-dialog-content class="h-400 pv-16">\n <div layout="row" class="p-10">\n <span class="font-size-16">{{ \'DASHBOARDS.MULTIPLE_CONTACTS_FOUND\' | translate }}<strong> {{ vm.callNumber }}</strong>.</span>\n <span class="font-size-16"> {{ \'DASHBOARDS.WHICH_ONE_TO_USE\' | translate }}</span>\n </div>\n <md-grid-list md-cols-xs="1" md-cols="2" md-row-height="fit" ng-class="vm.paginatedContacts[vm.page - 1].length > 2 ? \'two-rows-layout\' : \'one-row-layout\'" flex>\n <md-grid-tile ng-repeat="contact in vm.paginatedContacts[vm.page - 1]" md-rowspan="1">\n <md-card layout="column" class="contact-info" no-padding no-margin ng-click="vm.selectedContact = contact;" ng-class="{ \'light-blue-50-bg\' : vm.selectedContact && vm.selectedContact.id === contact.id }" flex>\n <md-card-title class="pt-16">\n <md-card-title-text layout-align="center start">\n <span class="font-size-16 text-bold">#{{ contact.id }} -\n <span privacy ng-cloak>{{ contact.firstName }} {{ contact.lastName }}</span>\n </span>\n <em class="font-size-12">{{ \'DASHBOARDS.LAST_UPDATED\' | translate }}: {{ contact.updatedAt }}</em>\n <span class="font-size-12">{{ \'DASHBOARDS.LIST\' | translate }}: {{ vm.lists[contact.ListId] }}</span>\n </md-card-title-text>\n <md-button class="md-icon-button no-margin" aria-label="Selected">\n <md-icon md-font-icon="{{ vm.selectedContact && vm.selectedContact.id === contact.id ? \'icon-checkbox-marked-circle\' : \'icon-checkbox-blank-circle-outline\' }}" ng-class="{ \'green-fg\': vm.selectedContact && vm.selectedContact.id === contact.id }"></md-icon>\n </md-button>\n </md-card-title>\n <md-divider></md-divider>\n <md-card-content layout="row" layout-align="center start" class="p-10">\n <span class="font-size-16">{{ \'DASHBOARDS.MATCHING_FIELD\' | translate }}:\n <strong privacy ng-cloak>{{ contact.matchingField }}</strong>\n </span>\n </md-card-content>\n </md-card>\n </md-grid-tile>\n </md-grid-list>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <div ng-if="vm.paginatedContacts.length > 1" layout="row" layout-align="center center" flex>\n <md-button ng-click="vm.page = vm.page - 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': vm.page <= 1 }" aria-label="Previous page">\n <md-icon md-font-icon="icon-chevron-double-left"></md-icon>\n </md-button>\n <span>{{ \'DASHBOARDS.PAGE\' | translate }} {{ vm.page }} {{ \'DASHBOARDS.OF\' | translate }}\n {{ vm.paginatedContacts.length }}</span>\n <md-button ng-click="vm.page = vm.page + 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': !vm.paginatedContacts[vm.page] }" aria-label="Next page">\n <md-icon md-font-icon="icon-chevron-double-right"></md-icon>\n </md-button>\n </div>\n <md-button ng-click="vm.selectContact()" class="select-button md-accent md-raised" ng-disabled="!vm.selectedContact" aria-label="Select" translate="DASHBOARDS.SELECT" translate-attr-aria-label="DASHBOARDS.SELECT">\n SELECT\n </md-button>\n </md-dialog-actions>\n</md-dialog>vc'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n <md-content ng-if="vm.selectedTab === 0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n <md-content ng-if="vm.selectedTab === 1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" ng-controller="AgentHomeAbandonedBullController as vm_bull">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_bull.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_bull.getAbandonedCalls()" query="vm_bull.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_bull.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_bull.quickFilters" query="vm_bull.query" search="vm_bull.getAbandonedCalls()"></ms-quick-filter>\n <md-button class="md-icon-button reload-list" ng-click="vm_bull.refresh && vm_bull.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">\n {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}\n </th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_bull.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_bull.currentUser.name">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_bull.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">\n {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">\n {{abandonedCall.queuecallerexitAt ? (abandonedCall.queuecallerexitAt | formatdate) : undefined }}\n </td>\n <td md-cell class="list">{{abandonedCall.queuecallerexitreason}}</td>\n <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_bull.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_bull.reserved(abandonedCall)">\n </md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-button ng-click="vm_bull.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.abandonedCalls.count}}" md-on-paginate="vm_bull.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <form name="disposition" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\',false)" required>\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\',false)">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\',false)">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n'+" {{(vm.selectedDisposition.name ? 'DASHBOARDS.DISPOSE' : 'DASHBOARDS.SAVE') | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>"),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_voice.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_voice.getAbandonedCalls()" query="vm_voice.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_voice.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_voice.quickFilters" query="vm_voice.query" search="vm_voice.getAbandonedCalls()"></ms-quick-filter>\n <md-button class="md-icon-button reload-list" ng-click="vm_voice.refresh && vm_voice.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">\n {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_voice.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_voice.currentUser.name">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_voice.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">\n {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_voice.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_voice.reserved(abandonedCall)">\n </md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-button ng-click="vm_voice.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.abandonedCalls.count}}" md-on-paginate="vm_voice.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="agent-general-home-navbar md-primary-bg width-50">\n <div ng-repeat="node in vm_home.navigation">\n <div ng-repeat="home in node.children">\n <md-button ng-repeat="button in home.children | orderBy:\'weight\'" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span>\n </md-tooltip>\n <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n<div class="agent-general-home-sections" layout="column" flex>\n <div layout="column" flex>\n <div ng-switch="vm_home.sidebar" style="overflow-y: auto; overflow-x: hidden" flex>\n <div ng-switch-when="agentPresence" class="home-agent-presence">\n <div ng-if="vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html\'" ng-controller="AgentHomePresenceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="contacts" class="home-contacts">\n <div ng-if="vm_home.hasPermission(102) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(102) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="mycontacts" class="home-mycontacts">\n <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="scheduled" class="home-scheduled">\n <div ng-if="vm_home.hasPermission(113) && vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html\'" ng-controller="AgentHomeScheduledCallsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(113) || !vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="voice" class="home-voice">\n <div ng-if="vm_home.hasPermission(110) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(110) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="abandoned" class="home-abandoned">\n <div ng-if="vm_home.hasPermission(111) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n <div ng-if="!vm_home.hasPermission(111) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="recordings" class="home-recordings">\n <div ng-if="vm_home.hasPermission(104) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(104) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="chat" class="home-chat">\n <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="mail" class="home-mail">\n <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="sms" class="home-sms">\n <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="openchannel" class="home-openchannel">\n <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="fax" class="home-fax">\n <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="whatsapp" class="home-whatsapp">\n <div ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html\'" ng-controller="AgentHomeWhatsappController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(114) || !vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="plugin" class="home-plugin" layout-fill>\n <div ng-if="vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html\'" ng-controller="AgentHomePluginsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting, vm_home.plugin)" layout-fill></div>\n <div ng-if="!vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-default class="home-default">\n <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController as vm"></div>\n <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n </div>\n </div>\n <div ng-if="(vm_home.draftManager.drafts | json) != \'{}\'" layout="column" class="draft-manager-bar">\n <ms-tab-scroll>\n <div layout="column" ng-repeat="(key, draft) in vm_home.draftManager.drafts" class="grey-50-bg" ng-click="vm_home.draftManager.open(draft.id)">\n <div class="draft-manager-tab" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-pencil" class="icon s16 margin-horizontal-5 black-fg"></md-icon>\n <span class="text-truncate font-size-12 black-fg">{{draft.title}}</span>\n <md-button class="md-icon-button md-mini no-margin md-primary" aria-label="close" ng-click="vm_home.draftManager.remove(draft.id)">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n </div>\n </ms-tab-scroll>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html",'<md-content layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHAT_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getChatInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getChatInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.WEBSITE\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="chatAccount">\n {{ vm.getChatWebsiteLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showChatInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Chat\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n <md-button ng-click="vm.downloadChatInteraction($event, interaction, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadChatInteraction($event, interaction)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact()" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact(contact.id)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}}\n {{contact.lastName}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="fax" privacy ng-cloak>{{contact.fax}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="createdAt">{{contact.createdAt | formatdate}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact(contact.id)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html\'" ng-controller="AgentHomeDashboardMultiChannelWhatsappController as vm_whatsapp" class="md-padding">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select>\n </md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_chat.promise">\n <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_fax.promise">\n <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_mail.promise">\n <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_openchannel.promise">\n <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_sms.promise">\n <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select>\n </md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_whatsapp.promise">\n <thead md-head md-order="vm_whatsapp.query.sort" md-on-reorder="vm_whatsapp.getWhatsappQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_whatsapp.getSize(vm_whatsapp.whatsappQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_whatsapp.whatsappQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_whatsapp.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_whatsapp.query.page" md-total="{{vm_whatsapp.whatsappQueuesTotal}}" md-on-paginate="vm_whatsapp.getWhatsappQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_whatsapp.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_whatsapp.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_whatsapp.queryChannels.limit" md-page="vm_whatsapp.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_whatsapp.paginatedInteractions.length}}" md-on-paginate="vm_whatsapp.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.FAX_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getFaxInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getFaxInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">\n {{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="faxAccount">\n {{ vm.getFaxAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showFaxInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Fax\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadFaxInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n Download Fax\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.MAIL_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getMailInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getMailInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">\n {{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="subject">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <div ng-if="vm.setting.enableEmailPreview && interaction.lastMsgText" class="tooltip-preview" ng-mouseleave="vm.resetTooltipPosition($event)" ng-mouseenter="vm.adjustTooltipPosition($event)">\n <span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span>\n <md-card class="tooltip-preview-text">\n <md-card-content><span class="email-preview-message">{{ interaction.lastMsgText }}</span>\n </md-card-content>\n </md-card>\n </div>\n <span ng-if="!interaction.lastMsgText || !vm.setting.enableEmailPreview"><span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="mailAccount">\n {{ vm.getMailAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showMailInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Mail\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n <md-button ng-click="vm.downloadMailInteraction($event, interaction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadMailInteraction($event, interaction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact($event)" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName" privacy ng-cloak>\n {{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax" privacy ng-cloak>\n {{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="createdAt">{{contact.createdAt |\n formatdate}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">\n {{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.OPENCHANNEL_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getOpenchannelInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getOpenchannelInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.openchannelAccounts.rows && vm.openchannelAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeOpenchannelInteraction($event, openchannelAccount)" ng-disabled="!openchannelAccount.replyUri">\n {{ openchannelAccount.name }} ({{ openchannelAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="openchannelAccount">\n {{ vm.getOpenchannelAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showOpenchannelInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Openchannel\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html",'<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab label="{{\'DASHBOARDS.AGENTS\' | translate}}" md-on-select="vm.onAgentsTabSelection()">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html\'">\n </md-content>\n </md-tab>\n <md-tab label="{{\'DASHBOARDS.QUEUES\' | translate}}" md-on-select="vm.onQueuesTabSelection()">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html\'">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.AGENTS"></span>\n <ms-search-bar on-search="vm.getAgents()" query="vm.agentsQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.agentsQuery" search="vm.getAgents()"></ms-quick-filter>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getAgents()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.agentsQuery.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n <th md-column md-order-by="internal">{{\'VOICE.INTERNAL\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column class="no-padding width-70"></th>\n <th md-column class="width-70"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="agent in vm.agents.rows">\n <td md-cell>{{agent.id}}</td>\n <td md-cell>{{agent.name}}</td>\n <td md-cell>{{agent.internal}}</td>\n <td md-cell>\n <div layout="row">\n <div layout="column" layout-align="center center">\n <span class="text-boxed width-120 text-center md-background-bg bl bt padding-5" ng-class="{\'online\':\'lime-300-bg\',\'offline\':\'red-A200-bg\',\'pause\':\'amber-200-bg\',\'busy\':\'indigo-100-bg\'}[agent.status]">\n {{ \'VOICE.\' + (agent.status | uppercase) | translate | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-cell class="no-padding width-70">\n <md-button ng-if="agent.status !== \'offline\' && agent.status !== \'unavailable\'" ng-click="vm.originateCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n <td md-cell class="width-70">\n <md-button ng-if="agent.status !== \'offline\' && agent.status !== \'unavailable\'" ng-click="vm.transferCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.agentsQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.agentsQuery.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES"></span>\n <ms-search-bar on-search="vm.getVoiceQueues()" query="vm.queuesQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.queuesQuery.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n <th md-column md-order-by="name">{{\'VOICE.CALLS\' | translate}}</th>\n <th md-column class="no-padding width-70"></th>\n <th md-column class="width-70"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="queue in vm.voiceQueues.rows">\n <td md-cell>{{queue.id}}</td>\n <td md-cell>{{queue.name}}</td>\n <td md-cell>{{queue.calls.length || 0}}</td>\n <td md-cell class="no-padding width-70">\n <md-button ng-click="vm.originateCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n <td md-cell class="width-70">\n <md-button ng-click="vm.transferCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.queuesQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queuesQuery.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n <ms-search-bar on-search="vm.getVoiceRecordings()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()">\n </ms-quick-filter>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column width="10px" ng-if="vm.currentUser.downloadVoiceRecordings"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="{{ vm.currentUser.downloadVoiceRecordings ? 10 : 9}}">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell class="type">{{voiceRecording.type}}</td>\n <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n <td md-cell class="calleridnum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="exten">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="connectedlinenum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="queue">{{voiceRecording.queue}}</td>\n <td md-cell class="rating">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio" ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions" ng-if="vm.currentUser.downloadVoiceRecordings">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\'">\n <md-button ng-click="vm.downloadtranscribe(voiceRecording, $event)" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n Download Transcribe\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-grey-bg" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScheduledCalls()">\n </ms-quick-filter>\n <md-button class="md-icon-button reload-list" ng-click="vm.getScheduledCalls()" aria-label="Refresh scheduled calls" translate translate-attr-label="MOTIONDIALER.REFRESH_SCHEDULED_CALLS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'MOTIONDIALER.REFRESH_SCHEDULED_CALLS\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduledCalls">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CAMPAIGN\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.scheduledCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="scheduledCall in vm.scheduledCalls.rows">\n <td md-cell privacy ng-cloak>{{scheduledCall.Contact.firstName}} {{scheduledCall.Contact.lastName}}</td>\n <td md-cell>\n <ms-click-to-call target="scheduledCall.phone" license="vm_home.license"></ms-click-to-call>\n </td>\n <td md-colors="{color: {{ vm.isDateBeforeToday(scheduledCall.scheduledat) ? \'\\\'red\\\'\' : \'\\\'green\\\'\' }}}" md-cell>{{ scheduledCall.scheduledat | date:\'medium\' }}</td>\n <td md-cell>{{ vm.priorities[scheduledCall.priority] }}</td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'icon-check\' : \'icon-close\' }}">\n </md-icon>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.Queue.dialActive? \'\\\'green\\\'\' : \'\\\'red\\\'\' }}}" md-font-icon="icon-checkbox-blank-circle"></md-icon> {{scheduledCall.Queue.name}}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditQueueCampaignHopper($event, scheduledCall)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteConfirm(scheduledCall, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.scheduledCalls.count}}" md-on-paginate="vm.getScheduledCalls" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.SMS_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getSmsInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getSmsInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">\n {{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="smsAccount">\n {{ vm.getSmsAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showSmsInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Sms\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadSmsInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n Download Sms\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n <ms-search-bar on-search="vm.getVoiceCalls()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceCalls()">\n </ms-quick-filter>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n <tr md-row>\n <th md-column md-order-by="id">{{\'VOICE.ID\' | translate}}</th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n <td md-cell class="type">{{voiceCall.id}}</td>\n <td md-cell class="type">{{ \'VOICE.\' + voiceCall.type.toUpperCase() | translate}}</td>\n <td md-cell class="source">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="destination">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n <td md-cell class="disposition">{{ voiceCall.userDisposition}}</td>\n <td md-cell class="disposition">{{ voiceCall.userSecondDisposition}}</td>\n <td md-cell class="disposition">{{ voiceCall.userThirdDisposition}}</td>\n <td md-cell class="note">\n <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n Show Details\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.UNIQUEID">Uniqueid</p>\n <h4>{{vm.call.uniqueid}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.TYPE">Type</p>\n <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.SOURCE">Source</p>\n <h4 privacy ng-cloak>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DESTINATION">Destination</p>\n <h4 privacy ng-cloak>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.STARTEDAT">Started At</p>\n <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ANSWEREDAT">Answered At</p>\n <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ENDEDAT">Ended At</p>\n <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DURATION">Duration</p>\n <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DISPOSITION">Disposition</p>\n <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n <h4>{{vm.call.userSecondDisposition ? vm.call.userSecondDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n <h4>{{vm.call.userThirdDisposition ? vm.call.userThirdDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.NOTE">Note</p>\n <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WHATSAPP_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getWhatsappInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getWhatsappInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getWhatsappInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.whatsappAccounts.rows && vm.whatsappAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeWhatsappInteraction($event, whatsappAccount)">\n {{ whatsappAccount.name }} ({{ whatsappAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.whatsappInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.whatsappInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="whatsappAccount">\n {{ vm.getWhatsappAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showWhatsappInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Whatsapp\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadWhatsappInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n Download Whatsapp\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappInteractions.count}}" md-on-paginate="vm.getWhatsappInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html",'<md-content layout="row" layout-fill>\n\n <div flex layout="row">\n\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="width: 100%; height: 100%; border:0px;"></iframe>\n\n </div>\n\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n\n <md-card flex="75" class="interaction">\n\n <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n <div ng-repeat="u in vm.interaction.Users">\n <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }}\n </md-tooltip>\n </div>\n </md-content>\n\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'">\n </md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n <div class="interaction-messages" ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'">\n </div>\n </div>\n <div ng-switch-default>\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'">\n </div>\n </div>\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- FOOTER --\x3e\n <div ng-if="\n !vm.interaction.closed && ( vm.tab.channel == \'chat\' \n || (vm.tab.channel == \'openchannel\' && vm.account.replyUri) \n || (vm.tab.channel == \'sms\' && !vm.tab.spy) \n || (vm.tab.channel == \'whatsapp\' && !vm.tab.spy) )\n && (vm.user.role !== \'admin\' && vm.user.role !== \'user\')" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'">\n </div>\n \x3c!-- / FOOTER--\x3e\n </md-card>\n\n <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'">\n </md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="CHAT.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="CHAT.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="CHAT.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="CHAT.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'CHAT.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'CHAT.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.ChatAccountId" md-font-icon="icon-earth" aria-label="alert chat" class="s16"></md-icon>\n <md-icon ng-if="item.ChatAccountId" md-font-icon="icon-message-text" aria-label="alert chat" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="CHAT.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="FAX.SEND">SEND</span>\n </md-button>\n <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block to">\n <label translate="FAX.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n </div>\n </md-input-container>\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-class="{\'mail-no-secret\': !vm.secret}" ng-cloak>\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar ng-class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n </button>\n <span class="white-fg secondary-text vertical-divider"></span>\n <md-menu>\n <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n </button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.subStatuses.rows.length">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n Send as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.send($event, false, subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n Send and Close\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <md-button ng-if="!vm.secret" class=" md-button md-raised blue-bg white-fg margin-horizontal-10" aria-label="Save draft" ng-click="vm.saveDraft()">\n <span>{{ (vm.isDraft ? \'DASHBOARDS.UPDATE_DRAFT\' : \'DASHBOARDS.SAVE_AS_DRAFT\') | translate | uppercase }}</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="MAIL.ADD_NOTE">Add note</span>\n </md-button>\n <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions" flow-file-success="vm.fileSuccess($file, $message)" flow-file-added="vm.fileAdded($file)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n <label translate="MAIL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.to)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n <div class="cc-bcc" layout="row" layout-align="start center">\n <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n <label translate="MAIL.CC">Cc</label>\n <md-chips name="cc" ng-model="vm.message.cc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.cc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n <label translate="MAIL.BCC">Bcc</label>\n <md-chips name="bcc" ng-model="vm.message.bcc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.bcc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n <label translate="MAIL.SUBJECT">Subject</label>\n <input ng-model="vm.message.subject" type="text" ng-keypress="vm.keyPress($event)">\n </md-input-container>\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n <md-button ng-click="vm.removeAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="padding-top-5">\n <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n </div>\n <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin" ng-keypress="vm.keyPress($event)">\n <md-item-template>\n <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16">\n </md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{ item.key }} -\n {{ item.value | htmlToPlaintext }}</span>\n </md-item-template>\n <md-not-found>\n <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="OPENCHANNEL.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="OPENCHANNEL.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="OPENCHANNEL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="OPENCHANNEL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mapkey" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'OPENCHANNEL.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'OPENCHANNEL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.OpenchannelAccountId" md-font-icon="icon-earth" aria-label="alert openchannel" class="s16"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-message-text" aria-label="alert openchannel" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n <md-not-found>\n <span translate="OPENCHANNEL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="SMS.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="SMS.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="SMS.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'SMS.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n <md-not-found>\n <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="WHATSAPP.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="WHATSAPP.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="WHATSAPP.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="WHATSAPP.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'WHATSAPP.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'WHATSAPP.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.WhatsappAccountId" md-font-icon="icon-earth" aria-label="alert whatsapp" class="s16">\n </md-icon>\n <md-icon ng-if="item.WhatsappAccountId" md-font-icon="icon-message-text" aria-label="alert whatsapp" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n <md-not-found>\n <span translate="WHATSAPP.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition" ng-init="vm.onInit()">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.mandatoryDisposition">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n <md-option ng-value="null" ng-if="!vm.mandatoryDisposition">NONE</md-option>\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && (vm.firstLevelDisposition || vm.secondLevelDisposition || vm.thirdLevelDisposition)" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n CLOSE AND DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.firstLevelDisposition" ng-disabled="vm.mandatoryDisposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n CLOSE WITHOUT DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="vm.interaction.closed" ng-disabled="vm.mandatoryDisposition && !vm.firstLevelDisposition" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n DISPOSE\n </md-button>\n <div ng-if="vm.mandatoryDisposition">\n <md-icon md-font-icon="icon-information-outline" aria-label="Mandatory Disposition"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="DASHBOARDS.HELP.MANDATORY_DISPOSITION_ENABLED"></span>\n </div>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TAGS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name" placeholder="Search for a tag">\n <span md-highlight-text="vm.searchText">{{item.name}}</span>\n </md-autocomplete>\n <md-chip-template>\n <span>\n <strong>{{$chip.name}}</strong>\n </span>\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="transferForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TRANSFER"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.transfer.type">\n <md-option ng-value="\'queue\'" ng-if="vm.account.queueTransfer">Queue</md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.account.agentTransfer">Agent</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'queue\'">\n <label translate="DASHBOARDS.QUEUES">Queues</label>\n <md-select name="queue" ng-model="vm.transfer.id" required>\n <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.queue.$error" ng-show="transferForm.queue.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'agent\'">\n <label translate="DASHBOARDS.AGENTS">Agents</label>\n <md-select name="agent" ng-model="vm.transfer.id" required>\n <md-option ng-value="agent.id" ng-repeat="agent in vm.agents.rows">{{\n agent.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.agent.$error" ng-show="transferForm.agent.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.onTransfer(true)" ng-disabled="transferForm.$pristine" class="send-button md-accent md-raised" aria-label="DASHBOARDS.TRANSFER" translate="DASHBOARDS.TRANSFER" translate-attr-aria-label="DASHBOARDS.TRANSFER">\n TRANSFER\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align="center center" flex>\n <div layout="row" layout-align="center center" style="flex-grow: 1; align-self: stretch" flex>\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.tab.areaText" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n </md-button>\n\n <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n <md-item-template>\n <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.browserName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n <h4>{{ item.browserName }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.osName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n <h4>{{ item.osName }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.deviceModel">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n <h4>{{ item.deviceModel }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.referer">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.REFERER">Referer</p>\n <h4>{{ item.referer }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerIp">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_IP">Originating IP Address</p>\n <h4>{{ item.customerIp }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerPort">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_PORT">Originating TCP Port</p>\n <h4>{{ item.customerPort }}</h4>\n </div>\n </md-list-item>\n <md-divider ng-if="item.closed && item.ratingValue != null || item.ratingMessage"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.RATING">Rating</p>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.ratingMessage }}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CONTACT">Contact</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-account"></md-icon>\n <label translate="DASHBOARDS.NAME">Name</label>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-email"></md-icon>\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.contact.email" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-phone"></md-icon>\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.contact.phone" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <label translate="DASHBOARDS.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.contact.fax" disabled privacy ng-cloak>\n </md-input-container>\n\n <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n More\n </md-button>\n </div>\n </form>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n </md-tab-label>\n <md-tab-body>\n <div layout="column" layout-align="space-between center" class="md-padding">\n <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} -\n <span translate="DASHBOARDS.OPENED"></span></span>\n <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{vm.interaction.substatus}}</span>\n </div>\n <md-divider></md-divider>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n <h4>{{vm.account.name}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{vm.interaction.externalUrl}}" target="_blank">\n <h4>{{vm.interaction.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n </div>\n </div>\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n </div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html\'">\n </div>\n </div>\n </div>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TAGS">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n </md-list-item>\n\n <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ vm.interaction.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.secondDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n <h4>{{ vm.interaction.secondDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.thirdDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n <h4>{{ vm.interaction.thirdDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{ vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{ item.externalUrl }}" target="_blank">\n <h4>{{ item.externalUrl }}</h4>\n </a>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{ item.createdAt | date: \'medium\' }}</h4>\n </div>\n </md-list-item>\n <div ng-if="item.channel === \'chat\'">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n </div>\n </div>\n <div ng-if="item.channel === \'mail\'">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n </div>\n </div>\n <md-divider ng-if="item.closed"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{ item.closedAt | date: \'medium\' }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ item.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.secondDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n <h4>{{ item.secondDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.thirdDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n <h4>{{ item.thirdDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n </div>\n </md-list-item>\n <md-list-item ng-if="item.Tags.length">\n <p class="padding-horizontal-15 grey-fg">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{ tag.name }}</div>\n </div>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<div layout-margin layout="row" layout-align="center center">\n <ms-quick-filter filters="vm.quickFilters" query="vm.journeyOptions" search="vm.getCustomerJourney()">\n </ms-quick-filter>\n</div>\n\n<md-content id="journey-content" flex layout-wrap>\n <div ng-if="vm.journeyIsLoading" layout="row" layout-align="center center">\n <md-progress-circular class="md-accent" md-diameter="48" md-mode="indeterminate"></md-progress-circular>\n </div>\n <div id="timeline" layout="column" ng-if="vm.journey && vm.journey.length && !vm.journeyIsLoading" ms-timeline="vm.journeyTimelineOptions" ms-timeline-load-more="vm.loadMoreJourney()">\n \x3c!-- TIMELINE ITEM --\x3e\n <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey">\n <div class="timeline-card">\n <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n <div layout="row" layout-align="space-between center">\n <div class="header p-6" layout="row" layout-align="start center" ng-cloak>\n <md-button class="md-fab md-mini no-click" aria-label="icon-channel" ng-class="{{ \'item.style.color\' }} + \'-bg\'">\n <md-icon md-font-icon="{{ item.style.icon }}"></md-icon>\n </md-button>\n <div class="info" layout="column" ng-init="item.showMore = false">\n <span class="font-size-12 text-truncate" ng-if="item.destination">\n #{{item.id}} - <span privacy ng-cloak>{{ item.destination }}</span>\n </span>\n <span class="font-size-12 text-truncate" ng-if="!item.destination">\n #{{item.id}} - {{ item.Account.key }}\n </span>\n <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n <span>\n <a class="toggle-details md-accent-color" ng-click="item.showMore = !item.showMore" translate="{{ item.showMore ? \'DASHBOARDS.HIDE_DETAILS\' : \'DASHBOARDS.SHOW_DETAILS\' }}">\n </a>\n </span>\n </div>\n </div>\n <span>\n <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n </span>\n </div>\n <div ng-if="item.showMore">\n <div ng-if="item.channel !== \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'">\n </div>\n <div ng-if="item.channel === \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'">\n </div>\n </div>\n <md-divider></md-divider>\n <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n <div ng-if="item.closed && item.channel !== \'voice\'" class="text-truncate text-boxed-light">\n <span class="red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate }} {{ item.dispositionsValues }}">\n {{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.dispositionsValues\n }}\n </span>\n </div>\n <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && item.channel !== \'voice\'" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">\n {{ \'DASHBOARDS.STATUS\' | translate}}:\n {{ \'DASHBOARDS.OPENED\' | translate}}\n <span ng-if="item.substatus"> - {{ item.substatus }}</span>\n </span>\n <span ng-if="item.channel === \'voice\'" class="text-boxed md-background-bg red-fg" title="{{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}">\n {{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}\n </span>\n <span ng-if="item.channel === \'voice\' && item.userSecondDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}: {{ item.userSecondDisposition }}">\n {{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:\n {{ item.userSecondDisposition }}\n </span>\n <span ng-if="item.channel === \'voice\' && item.userThirdDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}: {{ item.userThirdDisposition }}">\n {{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:\n {{ item.userThirdDisposition }}\n </span>\n <div flex></div>\n <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\' && item.canOpen && item.channel !== \'voice\'" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction(item)">\n <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n </md-button>\n </div>\n </md-card>\n </div>\n </div>\n\n <div ng-if="vm.canLoadMoreJourney" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row keep-on-top">\n <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-click="vm.loadMoreJourney()" translate="DASHBOARDS.MORE">\n </md-button>\n </div>\n </div>\n \x3c!-- / TIMELINE ITEM --\x3e\n</md-content>\n\n<div ng-if="!vm.journey || vm.journey.length === 0" layout="row" layout-align="center center">\n <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TYPE">Type</p>\n <h4>{{ item.type ? item.type : \'no type\' }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SOURCE">Source</p>\n <h4 privacy ng-cloak>{{ item.source ? item.source : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DESTINATION">Destination</p>\n <h4 privacy ng-cloak>{{ item.destination ? item.destination : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.UNIQUEID">Uniqueid</p>\n <h4>{{ item.uniqueid ? item.uniqueid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n <h4 privacy ng-cloak>{{ item.callerid ? item.callerid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n <h4>{{ item.starttime | date:\'medium\' }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.END_AT">End At</p>\n <h4>{{ item.endtime | date:\'medium\' }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DURATION">Duration</p>\n <h4>{{ item.duration ? item.duration : \'--\' }}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">Note</p>\n <h4>{{ item.note ? item.note : \'--\' }}</h4>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.subject">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SUBJECT">Subject</p>\n <h4>{{ item.subject }}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.VISIBILITY">Visibility</p>\n <h4 translate="{{ item.threadId ? \'DASHBOARDS.PUBLIC\' : \'DASHBOARDS.PRIVATE\'}}"></h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n <md-button ng-if="vm.tab.channel === \'fax\'" class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n\n <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n <div ng-if="message.secret">\n <div class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n <span> - {{message.createdAt | date: \'medium\'}}</span>\n </div>\n <div ng-if="message.id">\n <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="!message.secret">\n <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n <span> - {{message.createdAt | date: \'medium\'}}</span>\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n <span> - {{message.createdAt | date: \'medium\'}}</span>\n </div>\n <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n <div ng-if="message.id && vm.tab.channel === \'fax\'">\n <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n <md-button ng-if="vm.downloadPermissions.attachments" class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <div ng-if="!vm.downloadPermissions.attachments" class="disabled-button">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </div>\n </div>\n <div ng-if="!message.AttachmentId" class="message" layout="row" layout-align="end center">\n <span ng-bind-html="message.body | embed: vm.embedOptions"></span>\n </div>\n </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.interactionTimelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <div layout="column">\n <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n <div layout="row" layout-align="center center" layout-fill ng-if="message.attach && vm.downloadPermissions.attachments">\n <div flex>\n <md-divider></md-divider>\n </div>\n <md-menu>\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span>\n </md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n <span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">\n {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n </md-card>\n <div ng-if="!message.secret">\n <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">\n [{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n </div>\n <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n <md-content class="mail-content">\n <div class="info" layout="row" layout-align="space-between start">\n <div layout="column" layout-align="start start">\n <div layout="row" layout-align="start start">\n <div layout="column" layout-align="start start">\n <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n <strong privacy ng-cloak>{{message.from}}</strong>\n <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16">\n </md-icon>\n </div>\n <div class="name">\n <div>{{message.subject}}</div>\n </div>\n <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate" privacy ng-cloak>{{ message.originTo || message.to\n }}</span>\n </div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.originCc && message.originCc.indexOf(vm.account.email) >= 0">\n <em><span class="blue-grey" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n registered as a</span> <span class="blue-grey">CC</span></em>\n </div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.bcc && message.bcc.indexOf(vm.account.email) >= 0">\n <em><span class="red-fg" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n registered as a</span> <span class="red-fg">BCC</span></em>\n </div>\n </div>\n </div>\n\n <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n Hide Details\n </a>\n <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n <div layout="column">\n <span class="title" translate="MAIL.DATE">Date:</span>\n <span class="title" translate="MAIL.FROM">From:</span>\n <span class="title" translate="MAIL.TO">To:</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && message.originCc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'out\' && message.cc">Cc:</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="title" translate="MAIL.BCC" ng-if="message.bcc">Bcc:</span>\n <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n </div>\n\n <div layout="column">\n <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n <span class="detail" privacy ng-cloak>{{message.from}}</span>\n <span class="detail" privacy ng-cloak>{{message.originTo || message.to}}</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="detail" ng-if="message.direction === \'in\' && message.originCc" privacy ng-cloak>{{\n message.originCc }}</span>\n <span class="detail" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc" privacy ng-cloak>{{ message.cc }}</span>\n <span class="detail" ng-if="message.direction === \'out\' && message.cc" privacy ng-cloak>{{ message.cc\n }}</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="detail" ng-if="message.bcc" privacy ng-cloak>{{message.bcc}}</span>\n <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n </div>\n </div>\n </div>\n\n <div layout="row" layout-align="center center">\n <div layout="column" layout-align="center end" class="md-padding">\n <span class="grey-fg" ng-if="message.direction ===\'in\'" privacy>{{message.from.indexOf(vm.contact.email)\n >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname ||\n vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n </div>\n </div>\n\n <div layout="row" layout-align="center center" layout-fill>\n <div flex>\n <md-divider></md-divider>\n </div>\n <div>\n <div class="interaction-reply-button-container">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span>\n </md-tooltip>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft(message.id)">\n <md-icon md-font-icon="icon-pencil-box" class="icon s24"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!message.attach && vm.downloadPermissions.interactions" class="md-icon-button" aria-label="forward" ng-click="vm.downloadMessage(message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n <md-menu ng-if="message.attach && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.downloadPermissions.attachments">\n <md-button ng-click="vm.downloadMessage(message, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMessage(message)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <md-menu ng-if="message.attach && vm.downloadPermissions.attachments">\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n <span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">\n {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n\n <md-content ng-bind-html-unsafe="message.body"></md-content>\n </md-content>\n </md-card>\n </div>\n <div ng-hide="!(vm.BTNLoadMore > 0)" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row">\n <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-disabled="!(vm.BTNLoadMore > 0)" ng-click="vm.loadNextPage()" translate="DASHBOARDS.MORE">\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeChatInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="CHAT.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n <div layout="row" layout-align="center center" class="p-8">\n <md-icon ng-if="vm.tab.channel === \'openchannel\' && vm.interaction.threadId" md-font-icon="fas fa-users" class="s16">\n <md-tooltip><span translate="DASHBOARDS.PUBLIC_INTERACTION">The interaction is public</span></md-tooltip>\n </md-icon>\n <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> -\n {{vm.interaction.substatus}}</span></span>\n <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt"></timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div>\n </div>\n <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'">\n </div>\n </div>\n <div ng-switch-when="fax">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'">\n </div>\n </div>\n <div ng-switch-when="sms">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'">\n </div>\n </div>\n <div ng-switch-when="whatsapp">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html\'">\n </div>\n </div>\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html\'">\n </div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html\'">\n </div>\n </div>\n </div>\n <md-menu ng-if="[\'fax\', \'sms\', \'whatsapp\'].indexOf(vm.tab.channel) < 0 && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.downloadPermissions.attachments">\n <md-button ng-click="vm.downloadInteraction(vm.interaction, true)" translate="DASHBOARDS.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadInteraction(vm.interaction)" translate="DASHBOARDS.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n\n <md-menu-item ng-if="vm.tab.channel === \'chat\' && !vm.interaction.closed && !vm.tab.spy && vm.account.vidaooEscalation && vm.account.vidaooApiKey">\n <md-button ng-click="vm.createVidaooSession(vm.interaction)" translate="DASHBOARDS.VIDAOOSESSION">\n Start Video Call\n </md-button>\n </md-menu-item>\n\n <md-menu-item>\n <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.account.queueTransfer || vm.account.agentTransfer">\n <md-button ng-click="vm.transferLastMessage()" translate="DASHBOARDS.TRANSFER">\n Transfer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n Set as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.interaction.substatus != null">\n <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n None\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.setAs(subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n Unread\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<div class="interaction-reply-button-container">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span></md-tooltip>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft()">\n <md-icon ng-cloak md-font-icon="icon-pencil-box" class="icon s24" ng-class="vm.draft ? \'red-500-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n</div>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeOpenchannelInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="OPENCHANNEL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeWhatsappInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="WHATSAPP.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n <div layout="row" layout-align="center center">\n <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg">\n <timer start-time="vm.starttime"></timer>\n </span>\n <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}\n </md-button>\n <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n </div>\n <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n <div class="padding-top-5" layout="row">\n <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n ACCEPT\n </md-button>\n <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n REJECT\n </md-button>\n </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-hangouts" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_MANAGED_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_MANAGED_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_MANAGED_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.originated || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundAbandonRate || 0}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundDropRate }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-deskphone" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-email" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-google-earth" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" ng-init="vm.onInit()" class="page-layout simple right-sidenav" layout="row">\n \x3c!-- CENTER --\x3e\n <div class="center" flex>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs ng-if="vm.hasDashboardPermissions" md-selected="vm.selectedTab" md-dynamic-height>\n <md-tab ng-if="vm.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n <div ui-view="voice"></div>\n </md-tab>\n <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n <div ui-view="dialer"></div>\n </md-tab>\n <md-tab ng-if="vm.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}" ui-sref="app.dashboards.general.chat">\n <div ui-view="chat"></div>\n </md-tab>\n <md-tab ng-if="vm.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}" ui-sref="app.dashboards.general.mail">\n <div ui-view="mail"></div>\n </md-tab>\n <md-tab ng-if="vm.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}" ui-sref="app.dashboards.general.sms">\n <div ui-view="sms"></div>\n </md-tab>\n <md-tab ng-if="vm.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}" ui-sref="app.dashboards.general.openchannel">\n <div ui-view="openchannel"></div>\n </md-tab>\n <md-tab ng-if="vm.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}" ui-sref="app.dashboards.general.fax">\n <div ui-view="fax"></div>\n </md-tab>\n <md-tab ng-if="vm.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}" ui-sref="app.dashboards.general.whatsapp">\n <div ui-view="whatsapp"></div>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- END CONTENT --\x3e\n\n <md-content ng-if="!vm.hasDashboardPermissions" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to\n navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n </md-content>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timer-sand"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n </div>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.outbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.outbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-clock"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-division"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-42 line-height-72">\n {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-whatsapp" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n\n <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n ADD FAXACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",'<md-dialog class="faxAccount-dialog" aria-label="faxAccount" ng-init="vm.onInit()">\n <form name="faxAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXACCOUNT">Add Agent to faxAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/tag/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'tag\'].$error" ng-show="faxAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxAccount-image" hide-xs>\n <img ng-src="assets/images/business/faxAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxAccount.id}}\n <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (advancedForm.$invalid) || (dispositionForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.HEADERINFO">headerinfo</label>\n <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.faxAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.faxAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.queueTransfer == true" class="md-block">\n <label translate="FAX.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.faxAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.agentTransfer == true" class="md-block">\n <label translate="FAX.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.faxAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.ECM">ECM</label>\n <md-select name="ecm" ng-model="vm.faxAccount.ecm" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MINRATE">minrate</label>\n <md-select name="minrate" ng-model="vm.faxAccount.minrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MAXRATE">maxrate</label>\n <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MODEM">modem</label>\n <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.GATEWAY">gateway</label>\n <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FAXDETECT">faxdetect</label>\n <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.T38TIMEOUT">t38timeout</label>\n <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.SIP">SIP</label>\n <md-select name="tech" ng-model="vm.faxAccount.tech" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP\'">SIP</md-option>\n <md-option ng-value="\'IAX\'">IAX</md-option>\n <md-option ng-value="\'DADHI\'">DADHI</md-option>\n <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.mandatoryDisposition" class="md-block">\n <label translate="FAX.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.faxAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="FaxAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add fax dispositions" translate translate-attr-label="FAX.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="FAX.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getFaxAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getFaxAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'FAX.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'FAX.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'FAX.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'FAX.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'FAX.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'FAX.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'FAX.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'FAX.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'FAX.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.faxInteractionDownload(interaction, $event)" translate="FAX.DOWNLOAD_INTERACTION">\n Download\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxAccounts-count">\n <span>{{vm.selectedFaxAccounts.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FAXACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':faxAccount.TrunkId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(faxAccount, $event )" translate="FAX.EDIT_FAXACCOUNT">\n Edit FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(faxAccount, $event )" translate="FAX.INTERACTIONS_FAXACCOUNT">\n Interactions FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event )" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n goToRealtime FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(faxAccount, $event )" translate="FAX.AGENTADD_FAXACCOUNT">\n AgentAdd FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(faxAccount, $event )" translate="FAX.DELETE_FAXACCOUNT">\n Delete FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n <form name="faxQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n\n <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n ADD FAXQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxQueue-image" hide-xs>\n <img ng-src="assets/images/business/faxQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxQueue.id}}\n <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxQueues-count">\n <span>{{vm.selectedFaxQueues.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FAXQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(faxQueue, $event )" translate="FAX.EDIT_FAXQUEUE">\n Edit FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(faxQueue, $event )" translate="FAX.TEAMADD_FAXQUEUE">\n teamadd FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(faxQueue, $event )" translate="FAX.AGENTADD_FAXQUEUE">\n agentadd FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(faxQueue, $event )" translate="FAX.DELETE_FAXQUEUE">\n Delete FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event )" translate="FAX.GOTOREALTIME_FAXQUEUE">\n goToRealtime FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}" md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.vm.getFaxAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- ACCOUNTS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate}}</th>\n <th md-column>{{\'FAX.KEY\' | translate}}</th>\n <th md-column>{{\'FAX.TOTAL\' | translate}}</th>\n <th md-column>{{\'FAX.IN\' | translate}}</th>\n <th md-column>{{\'FAX.OUT\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.count > 0">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="account" md-select-id="id" ng-repeat="account in vm.faxAccounts.rows">\n <td md-cell>{{account.name}}</td>\n <td md-cell>{{account.key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(account.in || 0) + (account.out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{account.in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{account.lastIn ? (account.lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{account.out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{account.lastOut ? (account.lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToFaxAccount($event, account)" translate="FAX.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / ACCOUNTS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column">\n <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n <div id="maintenance-form" class="md-whiteframe-8dp">\n <div>\n <img src="/api/settings/1/logo_login" alt="logo_login" />\n </div>\n\n <br>\n\n <div>\n <div class="info-line">\n <div class="title">Useful pages</div>\n </div>\n <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n <md-icon md-font-icon="icon-wikipedia"></md-icon>\n </a>\n <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n </a>\n <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n <md-icon md-font-icon="icon-headphones"></md-icon>\n </a>\n <div class="info"><a href="https://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n <md-icon md-font-icon="icon-console"></md-icon>\n </a>\n <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n </div>\n\n </section>\n\n <br>\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title">Follow us on</div>\n </div>\n <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-facebook"></md-icon>\n </a>\n\n <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-twitter"></md-icon>\n </a>\n <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n <md-icon md-font-icon="icon-google-plus"></md-icon>\n </a>\n <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n <md-icon md-font-icon="icon-linkedin"></md-icon>\n </a>\n </section>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n </div>\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n </div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n <br>\n\n <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n <form name="deskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n\n <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n ADD DESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-deskAccounts-count">\n <span>{{vm.selectedDeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- DESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.deskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(deskAccount, $event )" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n Edit DeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event )" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n Test DeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(deskAccount, $event )" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n Delete DeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n ADD DESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error"\n ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error"\n ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="deskAccount-image" hide-xs>\n <img ng-src="assets/images/business/deskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.deskAccount.id}}\n <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n Delete DeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",'<md-dialog class="dynamics365Account-dialog" aria-label="New Dynamics365Account">\n <form name="dynamics365AccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365AccountForm[\'name\'].$error" ng-show="dynamics365AccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.dynamics365Account.modernAuthentication">\n <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n </md-switch>\n \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'username\'].$error" ng-show="dynamics365AccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" ng-required="true">\n <div ng-messages="dynamics365AccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'remoteUri\'].$error" ng-show="dynamics365AccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'tenantId\'].$error" ng-show="dynamics365AccountForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientId\'].$error" ng-show="dynamics365AccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientSecret\'].$error" ng-show="dynamics365AccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="dynamics365AccountForm[\'serverUrl\'].$error" ng-show="dynamics365AccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </div>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders">{{provider.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description">\n\n <div ng-messages="dynamics365AccountForm[\'description\'].$error" ng-show="dynamics365AccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Account" ng-click="vm.saveDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid || dynamics365AccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Account" ng-click="vm.addNewDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n ADD DYNAMICS365ACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Account" ng-click="vm.deleteDynamics365Account($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",'<div id="dynamics365Accounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DYNAMICS365ACCOUNTS">Dynamics365Accounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDynamics365Accounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDynamics365Accounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-dynamics365Accounts-count">\n <span>{{vm.selectedDynamics365Accounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDynamics365Accounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDynamics365Accounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDynamics365Accounts" csv-label="true" filename="dynamics365Accounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDynamics365Accounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- DYNAMICS365ACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDynamics365Accounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDynamics365Accounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="modernAuthentication">{{ \'INTEGRATIONS.MODERN_AUTHENTICATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dynamics365Accounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="dynamics365Account" md-select-id="id" ng-repeat="dynamics365Account in vm.dynamics365Accounts.rows">\n <td md-cell ng-if="dynamics365Account.userpic"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="api/users/{{dynamics365Account.id}}/avatar" /></td>\n <td md-cell ng-if="!dynamics365Account.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="id ">{{dynamics365Account.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="name ">{{dynamics365Account.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="modernAuthentication ">\n <md-icon md-colors="{color: {{dynamics365Account.modernAuthentication ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{dynamics365Account.modernAuthentication ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(dynamics365Account, $event )" translate="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT">\n Edit Dynamics365Account\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(dynamics365Account, $event )" translate="INTEGRATIONS.TEST_DYNAMICS365ACCOUNT">\n Test Dynamics365Account\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n <md-button ng-click="vm.deleteconfirm(dynamics365Account, $event )" translate="INTEGRATIONS.DELETE_DYNAMICS365ACCOUNT">\n Delete Dynamics365Account\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dynamics365Accounts.count}}" md-on-paginate="vm.getDynamics365Accounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DYNAMICS365ACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-dynamics365Account-button" ng-click="vm.createOrEditDynamics365Account($event)" aria-label="add dynamics365Account" translate translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",'<md-dialog class="dynamics365Configuration-dialog" aria-label="New Dynamics365Configuration">\n <form name="dynamics365ConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.dynamics365Configuration.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365ConfigurationForm[\'name\'].$error" ng-show="dynamics365ConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.dynamics365Configuration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'channel\'].$error" ng-show="dynamics365ConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dynamics365Configuration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'type\'].$error" ng-show="dynamics365ConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n <md-select name="ticketType" ng-model="vm.dynamics365Configuration.ticketType" required>\n\n <md-option ng-value="\'incident\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n\n <md-option ng-value="\'phonecall\'"> {{ \'INTEGRATIONS.PHONECALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'ticketType\'].$error" ng-show="dynamics365ConfigurationForm[\'ticketType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Configuration" ng-click="vm.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid || dynamics365ConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Configuration" ng-click="vm.addNewDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION">\n ADD DYNAMICS365CONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Configuration" ng-click="vm.deleteDynamics365Configuration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",'<md-dialog class="dynamics365Account-item-dialog" aria-label="New Item">\n <form name="dynamics365AccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.key.$error" ng-show="dynamics365AccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.keyType.$error" ng-show="dynamics365AccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.keyContent.$error" ng-show="dynamics365AccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.customField.$error" ng-show="dynamics365AccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error"\n ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error"\n ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",'<div id="integrations-dynamics365Account" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-dynamics365Accounts-button md-icon-button" aria-label="Go to dynamics365Accounts" ng-click="vm.gotoDynamics365Accounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="dynamics365Account-image" hide-xs>\n <img ng-src="assets/images/business/dynamics365Accounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.dynamics365Account.id}}\n <span ng-if="vm.dynamics365Account.name">{{vm.dynamics365Account.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.dynamics365Account.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDynamics365Account()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.dynamics365Account.modernAuthentication">\n <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n </md-switch>\n \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n </md-input-container>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders.rows">{{provider.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" ng-required="vm.dynamics365Account.modernAuthentication == false">\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'tenantId\'].$error" ng-show="generalForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </div>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="Dynamics365AccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" class="md-icon-button" aria-label="create dynamics365Configuration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="dynamics365Configuration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDynamics365Configuration($index)">\n <span class="text-truncate" flex="80">{{ dynamics365Configuration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)" translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION">\n Delete Dynamics365Configuration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container general md-background-bg">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ADVANCED">ADVANCED</div>\n </div>\n <form name="vm_cc.advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MODULECREATE">Module Create</label>\n <md-select name="type" ng-model="vm_cc.dynamics365Configuration.moduleCreate" required>\n <md-option ng-value="\'contact\'">{{\'INTEGRATIONS.DYNAMIC365CONTACT\' | translate}}</md-option>\n <md-option ng-value="\'nothing\'">{{\'INTEGRATIONS.DYNAMIC365NOTHING\' | translate}}</md-option>\n </md-select>\n <div ng-messages="vm_cc.advancedForm[\'moduleCreate\'].$error" ng-show="vm_cc.advancedForm[\'moduleCreate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MODULECREATE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm_cc.dynamics365Configuration.openNewTab">\n <span translate="INTEGRATIONS.OPENNEWTAB">Open new tab</span>\n </md-switch>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT">Additional search contact</label>\n <input type="" name="additionalSearchContact" ng-model="vm_cc.dynamics365Configuration.additionalSearchContact" autofocus>\n </md-input-container>\n <div layout="row" layout-align="end center">\n <md-button type="submit" ng-click="vm_cc.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="vm_cc.advancedForm.$invalid || vm_cc.advancedForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n </div>\n\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n\n <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n ADD FRESHDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n ADD FRESHDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error"\n ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error"\n ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshdeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshdeskAccount.id}}\n <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n Delete FreshdeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshdeskAccounts-count">\n <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(freshdeskAccount, $event )" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n Edit FreshdeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event )" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n Test FreshdeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event )" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n Delete FreshdeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",'<md-dialog class="freshsalesAccount-dialog" aria-label="New FreshsalesAccount">\n <form name="freshsalesAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="freshsalesAccountForm[\'name\'].$error" ng-show="freshsalesAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true">\n\n <div ng-messages="freshsalesAccountForm[\'username\'].$error" ng-show="freshsalesAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true">\n\n <div ng-messages="freshsalesAccountForm[\'remoteUri\'].$error" ng-show="freshsalesAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true">\n\n <div ng-messages="freshsalesAccountForm[\'apiKey\'].$error" ng-show="freshsalesAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshsalesAccountForm[\'serverUrl\'].$error" ng-show="freshsalesAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshsalesAccount.description">\n\n <div ng-messages="freshsalesAccountForm[\'description\'].$error" ng-show="freshsalesAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesAccount" ng-click="vm.saveFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid || freshsalesAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesAccount" ng-click="vm.addNewFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n ADD FRESHSALESACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesAccount" ng-click="vm.deleteFreshsalesAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",'<md-dialog class="freshsalesConfiguration-dialog" aria-label="New FreshsalesConfiguration">\n <form name="freshsalesConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshsalesConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="freshsalesConfigurationForm[\'name\'].$error" ng-show="freshsalesConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshsalesConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshsalesConfigurationForm[\'channel\'].$error" ng-show="freshsalesConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshsalesConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshsalesConfigurationForm[\'type\'].$error" ng-show="freshsalesConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesConfiguration" ng-click="vm.saveFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid || freshsalesConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesConfiguration" ng-click="vm.addNewFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION">\n ADD FRESHSALESCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesConfiguration" ng-click="vm.deleteFreshsalesConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",'<md-dialog class="freshsalesAccount-item-dialog" aria-label="New Item">\n <form name="freshsalesAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.key.$error" ng-show="freshsalesAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.keyType.$error" ng-show="freshsalesAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.keyContent.$error" ng-show="freshsalesAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.customField.$error" ng-show="freshsalesAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="freshsalesAccountItemForm.option.$error" ng-show="freshsalesAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.content.$error"\n ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.variableName.$error"\n ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",'<div id="integrations-freshsalesAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshsalesAccounts-button md-icon-button" aria-label="Go to freshsalesAccounts" ng-click="vm.gotoFreshsalesAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHSALESACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshsalesAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshsalesAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshsalesAccount.id}}\n <span ng-if="vm.freshsalesAccount.name">{{vm.freshsalesAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshsalesAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFreshsalesAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshsalesAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshsalesAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshsalesAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshsalesAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshsalesAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" class="md-icon-button" aria-label="create freshsalesConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshsalesConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshsalesConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshsalesConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshsalesConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFreshsalesConfiguration($event, freshsalesConfiguration)" translate="INTEGRATIONS.DELETE_FRESHSALESCONFIGURATION">\n Delete FreshsalesConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",'<div id="freshsalesAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHSALESACCOUNTS">FreshsalesAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshsalesAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshsalesAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshsalesAccounts-count">\n <span>{{vm.selectedFreshsalesAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshsalesAccounts" csv-label="true" filename="freshsalesAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshsalesAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FRESHSALESACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshsalesAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshsalesAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshsalesAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshsalesAccount" md-select-id="id" ng-repeat="freshsalesAccount in vm.freshsalesAccounts.rows">\n <td md-cell ng-if="freshsalesAccount.userpic"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="api/users/{{freshsalesAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshsalesAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="id ">{{freshsalesAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="name ">{{freshsalesAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="username ">{{freshsalesAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="remoteUri ">{{freshsalesAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(freshsalesAccount, $event )" translate="INTEGRATIONS.EDIT_FRESHSALESACCOUNT">\n Edit FreshsalesAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(freshsalesAccount, $event )" translate="INTEGRATIONS.TEST_FRESHSALESACCOUNT">\n Test FreshsalesAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(freshsalesAccount, $event )" translate="INTEGRATIONS.DELETE_FRESHSALESACCOUNT">\n Delete FreshsalesAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshsalesAccounts.count}}" md-on-paginate="vm.getFreshsalesAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHSALESACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHSALESACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshsalesAccount-button" ng-click="vm.createOrEditFreshsalesAccount($event)" aria-label="add freshsalesAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHSALESACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n\n <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n ADD SALESFORCEACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n <md-select name="ticketType" ng-model="vm.salesforceConfiguration.ticketType" required>\n\n <md-option ng-value="\'Task\'"> {{ \'INTEGRATIONS.TASK\' | translate }} </md-option>\n\n <md-option ng-value="\'Case\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'ticketType\'].$error" ng-show="salesforceConfigurationForm[\'ticketType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n ADD SALESFORCECONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error"\n ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error"\n ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="salesforceAccount-image" hide-xs>\n <img ng-src="assets/images/business/salesforceAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.salesforceAccount.id}}\n <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSalesforceAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n Delete SalesforceConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">\n ADVANCED\n </span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'account_contact_lead\', value: \'Account & Contact & Lead\'}, {key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLead">\n <label translate="INTEGRATIONS.LEADID"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.leadId" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.LEADID"></span></div>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isAccountSearch">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHACCOUNT"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.additionalSearchAccount" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHACCOUNT"></span></div>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isContactSearch">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.additionalSearchContact" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHCONTACT"></span></div>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLeadSearch">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHLEAD"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.additionalSearchLead" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHLEAD"></span></div>\n </div>\n\n <md-button type="submit" ng-click="vm_cc.saveSalesforceConfiguration()" ng-disabled="!vm_cc.crudPermissions.canEdit" class="send-button md-accent md-raised" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-salesforceAccounts-count">\n <span>{{vm.selectedSalesforceAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(salesforceAccount, $event )" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n Edit SalesforceAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event )" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n Test SalesforceAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event )" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n Delete SalesforceAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",'<md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">\n <form name="servicenowAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowAccountForm[\'name\'].$error" ng-show="servicenowAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'username\'].$error" ng-show="servicenowAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="servicenowAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'email\'].$error" ng-show="servicenowAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'remoteUri\'].$error" ng-show="servicenowAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="servicenowAccountForm[\'serverUrl\'].$error" ng-show="servicenowAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description">\n\n <div ng-messages="servicenowAccountForm[\'description\'].$error" ng-show="servicenowAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount" ng-click="vm.saveServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount" ng-click="vm.addNewServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n ADD SERVICENOWACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount" ng-click="vm.deleteServicenowAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",'<md-dialog class="servicenowConfiguration-dialog" aria-label="New ServicenowConfiguration">\n <form name="servicenowConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.servicenowConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowConfigurationForm[\'name\'].$error" ng-show="servicenowConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.servicenowConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'channel\'].$error" ng-show="servicenowConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.servicenowConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'type\'].$error" ng-show="servicenowConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowConfiguration" ng-click="vm.saveServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid || servicenowConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowConfiguration" ng-click="vm.addNewServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION">\n ADD SERVICENOWCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowConfiguration" ng-click="vm.deleteServicenowConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",'<md-dialog class="servicenowAccount-item-dialog" aria-label="New Item">\n <form name="servicenowAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.key.$error" ng-show="servicenowAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.keyType.$error" ng-show="servicenowAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.keyContent.$error" ng-show="servicenowAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="servicenowAccountItemForm.customField.$error" ng-show="servicenowAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error"\n ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error"\n ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/view.html",'<div id="integrations-servicenowAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-servicenowAccounts-button md-icon-button" aria-label="Go to servicenowAccounts" ng-click="vm.gotoServicenowAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SERVICENOWACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="servicenowAccount-image" hide-xs>\n <img ng-src="assets/images/business/servicenowAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.servicenowAccount.id}}\n <span ng-if="vm.servicenowAccount.name">{{vm.servicenowAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.servicenowAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveServicenowAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ServicenowAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.servicenowAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" class="md-icon-button" aria-label="create servicenowConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="servicenowConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedServicenowConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getServicenowConfiguration($index)">\n <span class="text-truncate" flex="80">{{ servicenowConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteServicenowConfiguration($event, servicenowConfiguration)" translate="INTEGRATIONS.DELETE_SERVICENOWCONFIGURATION">\n Delete ServicenowConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",'<div id="servicenowAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS">ServicenowAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedServicenowAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedServicenowAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-servicenowAccounts-count">\n <span>{{vm.selectedServicenowAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllServicenowAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectServicenowAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedServicenowAccounts" csv-label="true" filename="servicenowAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedServicenowAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SERVICENOWACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedServicenowAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getServicenowAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'INTEGRATIONS.EMAIL\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.servicenowAccounts.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="servicenowAccount" md-select-id="id" ng-repeat="servicenowAccount in vm.servicenowAccounts.rows">\n <td md-cell ng-if="servicenowAccount.userpic"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="api/users/{{servicenowAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!servicenowAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="id ">{{servicenowAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="name ">{{servicenowAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="username ">{{servicenowAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="email ">{{servicenowAccount.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="remoteUri ">{{servicenowAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(servicenowAccount, $event )" translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT">\n Edit ServicenowAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(servicenowAccount, $event )" translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT">\n Test ServicenowAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n <md-button ng-click="vm.deleteconfirm(servicenowAccount, $event )" translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT">\n Delete ServicenowAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.servicenowAccounts.count}}" md-on-paginate="vm.getServicenowAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SERVICENOWACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SERVICENOWACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-servicenowAccount-button" ng-click="vm.createOrEditServicenowAccount($event)" aria-label="add servicenowAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SERVICENOWACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n\n <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n ADD SUGARCRMACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n ADD SUGARCRMCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error"\n ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error"\n ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="sugarcrmAccount-image" hide-xs>\n <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.sugarcrmAccount.id}}\n <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n Delete SugarcrmConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sugarcrmAccounts-count">\n <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(sugarcrmAccount, $event )" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n Edit SugarcrmAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event )" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n Test SugarcrmAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event )" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n Delete SugarcrmAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",'<md-dialog class="vtigerAccount-dialog" aria-label="New VtigerAccount">\n <form name="vtigerAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerAccountForm[\'name\'].$error" ng-show="vtigerAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description">\n\n <div ng-messages="vtigerAccountForm[\'description\'].$error" ng-show="vtigerAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'username\'].$error" ng-show="vtigerAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'accessKey\'].$error" ng-show="vtigerAccountForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'remoteUri\'].$error" ng-show="vtigerAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="vtigerAccountForm[\'serverUrl\'].$error" ng-show="vtigerAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerAccount" ng-click="vm.saveVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid || vtigerAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerAccount" ng-click="vm.addNewVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n ADD VTIGERACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerAccount" ng-click="vm.deleteVtigerAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",'<md-dialog class="vtigerConfiguration-dialog" aria-label="New VtigerConfiguration">\n <form name="vtigerConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.vtigerConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerConfigurationForm[\'name\'].$error" ng-show="vtigerConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.vtigerConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'channel\'].$error" ng-show="vtigerConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.vtigerConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'type\'].$error" ng-show="vtigerConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerConfiguration" ng-click="vm.saveVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid || vtigerConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerConfiguration" ng-click="vm.addNewVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERCONFIGURATION">\n ADD VTIGERCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerConfiguration" ng-click="vm.deleteVtigerConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",'<md-dialog class="vtigerAccount-item-dialog" aria-label="New Item">\n <form name="vtigerAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.key.$error" ng-show="vtigerAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.keyType.$error" ng-show="vtigerAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.keyContent.$error" ng-show="vtigerAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="vtigerAccountItemForm.customField.$error" ng-show="vtigerAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error"\n ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error"\n ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/view.html",'<div id="integrations-vtigerAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-vtigerAccounts-button md-icon-button" aria-label="Go to vtigerAccounts" ng-click="vm.gotoVtigerAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_VTIGERACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="vtigerAccount-image" hide-xs>\n <img ng-src="assets/images/business/vtigerAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.vtigerAccount.id}}\n <span ng-if="vm.vtigerAccount.name">{{vm.vtigerAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.vtigerAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVtigerAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accessKey\'].$error" ng-show="generalForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="VtigerAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.vtigerAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" class="md-icon-button" aria-label="create vtigerConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="vtigerConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedVtigerConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getVtigerConfiguration($index)">\n <span class="text-truncate" flex="80">{{ vtigerConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteVtigerConfiguration($event, vtigerConfiguration)" translate="INTEGRATIONS.DELETE_VTIGERCONFIGURATION">\n Delete VtigerConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",'<div id="vtigerAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.VTIGERACCOUNTS">VtigerAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVtigerAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVtigerAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-vtigerAccounts-count">\n <span>{{vm.selectedVtigerAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVtigerAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVtigerAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVtigerAccounts" csv-label="true" filename="vtigerAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVtigerAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VTIGERACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVtigerAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVtigerAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.VTIGER_USER_NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.vtigerAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vtigerAccount" md-select-id="id" ng-repeat="vtigerAccount in vm.vtigerAccounts.rows">\n <td md-cell ng-if="vtigerAccount.userpic"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="api/users/{{vtigerAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!vtigerAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="id ">{{vtigerAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="name ">{{vtigerAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="username ">{{vtigerAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="remoteUri ">{{vtigerAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(vtigerAccount, $event )" translate="INTEGRATIONS.EDIT_VTIGERACCOUNT">\n Edit VtigerAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(vtigerAccount, $event )" translate="INTEGRATIONS.TEST_VTIGERACCOUNT">\n Test VtigerAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(vtigerAccount, $event )" translate="INTEGRATIONS.DELETE_VTIGERACCOUNT">\n Delete VtigerAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.vtigerAccounts.count}}" md-on-paginate="vm.getVtigerAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VTIGERACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VTIGERACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-vtigerAccount-button" ng-click="vm.createOrEditVtigerAccount($event)" aria-label="add vtigerAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VTIGERACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n\n <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n ADD ZENDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error"\n ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error"\n ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zendeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/zendeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zendeskAccount.id}}\n <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZendeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n </div>\n <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n Delete ZendeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n ADD ZENDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zendeskAccounts-count">\n <span>{{vm.selectedZendeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(zendeskAccount, $event )" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n Edit ZendeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event )" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n Test ZendeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event )" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n Delete ZendeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n <form name="zohoAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ZONE">Zone</label>\n <md-select name="zone" ng-model="vm.zohoAccount.zone" required>\n <md-option ng-value="\'US\'">US</md-option>\n <md-option ng-value="\'AU\'">AU</md-option>\n <md-option ng-value="\'EU\'">EU</md-option>\n <md-option ng-value="\'IN\'">IN</md-option>\n <md-option ng-value="\'CN\'">CN</md-option>\n </md-select>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n <div ng-messages="zohoAccountForm[\'zone\'].$error" ng-show="zohoAccountForm[\'zone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n <div ng-messages="zohoAccountForm[\'clientId\'].$error" ng-show="zohoAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n <div ng-messages="zohoAccountForm[\'clientSecret\'].$error" ng-show="zohoAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CODE">Code</label>\n <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n <div ng-messages="zohoAccountForm[\'code\'].$error" ng-show="zohoAccountForm[\'code\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n\n <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n ADD ZOHOACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n ADD ZOHOCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error"\n ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error"\n ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zohoAccount-image" hide-xs>\n <img ng-src="assets/images/business/zohoAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zohoAccount.id}}\n <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZohoAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ZONE">Zone</label>\n <md-select name="zone" ng-model="vm.zohoAccount.zone" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'US\'">US</md-option>\n <md-option ng-value="\'AU\'">AU</md-option>\n <md-option ng-value="\'EU\'">EU</md-option>\n <md-option ng-value="\'IN\'">IN</md-option>\n <md-option ng-value="\'CN\'">CN</md-option>\n </md-select>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n <div ng-messages="generalForm[\'zone\'].$error" ng-show="generalForm[\'zone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CODE">Code</label>\n <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n <div ng-messages="generalForm[\'code\'].$error" ng-show="generalForm[\'code\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.REFRESHTOKEN">RefreshToken</label>\n <input type="text" name="refreshToken" ng-model="vm.zohoAccount.refreshToken" disabled>\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.REFRESHTOKEN"></span></div>\n <div ng-messages="generalForm[\'refreshToken\'].$error" ng-show="generalForm[\'refreshToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.REFRESHTOKEN_REQUIRED">RefreshToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n Delete ZohoConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">\n ADVANCED\n </span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.zohoConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.zohoConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zohoAccounts-count">\n <span>{{vm.selectedZohoAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- ZOHOACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column md-order-by="zone">{{ \'INTEGRATIONS.ZONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="zone ">{{ vm.arrayzone[zohoAccount.zone].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(zohoAccount, $event )" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n Edit ZohoAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event )" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n Test ZohoAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(zohoAccount, $event )" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n Delete ZohoAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n\n <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n CLONE PROJECT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n <form name="sessionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list>\n <md-subheader class="md-no-sticky">\n <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n </div>\n </md-subheader>\n <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n <div class="md-list-item-text compact">\n <h3>{{$index+1}}. {{question.question}}</h3>\n <p>{{question.answer}}</p>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n <div class="md-list-item-text compact">\n <h3><span class="text-boxed-light" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n </div>\n </md-list-item>\n </md-list>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/projects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}}\n <span ng-if="vm.project.name">{{vm.project.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveProject()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.sendUnpauseOnSubmit" aria-label="SendUnpauseOnSubmit" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.SENDUNPAUSEONSUBMIT">SendUnpauseOnSubmit</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.SENDUNPAUSEONSUBMIT"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n <div layout="row" layout-align="center">\n <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n Reset\n </md-button>\n </div>\n <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n <ms-search-bar on-search="vm_dc.getProjectSessions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'JSCRIPTY.ID\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'JSCRIPTY.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'JSCRIPTY.ENDTIME\' | translate }}\n </th>\n <th md-column md-order-by="membername">\n {{ \'JSCRIPTY.MEMBERNAME\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'JSCRIPTY.CALLERIDNUM\' | translate }}\n </th>\n <th md-column md-order-by="completed">\n {{ \'JSCRIPTY.COMPLETE\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n <td md-cell>\n {{session.id}}\n </td>\n <td md-cell>\n {{ session.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ session.endtime | formatdate }}\n </td>\n <td md-cell>\n {{session.membername}}\n </td>\n <td md-cell>\n {{session.calleridnum}}\n </td>\n <td md-cell class="completed ">\n <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n Results Session\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n Delete Session\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project, vm.userProfile)">\n <div class="pb-16" layout="row">\n <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS" flex>Answers</div>\n <div layout="row" layout-align="space-between center" flex>\n <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n <md-button type="button" ng-if="vm_an.currentUser.role === \'admin\' || vm_an.userProfile.downloadJscriptySessions" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n </md-button>\n </div>\n </div>\n <div layout="row">\n <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n <md-list>\n <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n <div class="md-list-item-text compact" layout-padding>\n <h3>{{question.question}}</h3>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column></th>\n <th md-column>#</th>\n <th md-column>%</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="(key, value) in question.answers">\n <td md-cell>{{key}}</td>\n <td md-cell width="20px">{{value}}</td>\n <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n </tr>\n <tr md-row>\n <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n <td md-cell width="20px"><b>{{question.sum}}</b></td>\n <td md-cell width="20px"><b>100</b></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n </md-list>\n </md-card>\n <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-light" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="JSCRIPTY.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="JSCRIPTY.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="JSCRIPTY.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(project, $event )" translate="JSCRIPTY.EDIT_PROJECT">\n Edit Project\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(project, $event )" translate="JSCRIPTY.CLONE_PROJECT">\n clone Project\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.sessionsgoto(project, $event )" translate="JSCRIPTY.SESSIONS_PROJECT">\n Sessions Project\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.deleteconfirm(project, $event )" translate="JSCRIPTY.DELETE_PROJECT">\n Delete Project\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newMailAccount ? \'MAIL.NEW_MAILACCOUNT\' : \'MAIL.EDIT_MAILACCOUNT\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.newMailAccount" class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'provider\'].$error" ng-show="mailAccountForm[\'provider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n <div layout="row">\n <md-input-container class="md-block mr-20 mb-0" flex>\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block mb-0">\n <label translate="MAIL.IMAP_PORT">IMAP Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP Port field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </div>\n\n <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n <div layout="row">\n <md-input-container class="md-block mr-20 mb-0" flex>\n <label translate="MAIL.SMTP_HOST">SMTP Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block mb-0">\n <label translate="MAIL.SMTP_PORT">SMTP Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP Port field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </div>\n\n <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'" class="md-block pt-0">\n <md-switch ng-model="vm.mailAccount.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n\n <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'outlook365\'" class="md-block">\n <md-switch ng-model="vm.mailAccount.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n </md-input-container>\n\n <div ng-if="vm.newMailAccount && vm.mailAccount.authentication && vm.mailAccount.provider">\n <md-input-container class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.mailAccount.username" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="mailAccountForm[\'username\'].$error" ng-show="mailAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.modernAuthentication" class="md-block">\n <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select name="cloudProvider" ng-model="vm.mailAccount.CloudProviderId" required>\n <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n <div ng-messages="mailAccountForm[\'cloudProvider\'].$error" ng-show="mailAccountForm[\'cloudProvider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.mailAccount.modernAuthentication" class="md-block">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.mailAccount.password" translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="mailAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n ADD MAIL ACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",'<md-dialog class="mailAccount-dialog" aria-label="mailAccount" ng-init="vm.onInit()">\n <form name="mailAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILACCOUNT">Add Agent to mailAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.REPLY_TYPE">Reply_Type</label>\n <md-select name="replyType" ng-model="vm.autoreply.replyType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="0">Reply</md-option>\n <md-option ng-value="1">Reply All</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'replyType\'].$error" ng-show="mailAccountFormApp[\'replyType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.REPLY_TYPE_REQUIRED">Reply_Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.autoreply.text"></textarea>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/tag/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'tag\'].$error" ng-show="mailAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.VALUE">Value</label>\n <textarea aria-label="Value value" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.mailCannedAnswer.value"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n\n <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n ADD MAILCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.goToMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailAccount-image" hide-xs>\n <img ng-src="assets/images/business/mailAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailAccount.id}}\n <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.goToRealtime()" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.addAgent(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (credentialsForm.$invalid) || (templateForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (dispositionForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" class="mb-20" required>\n <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.mailAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.mailAccount.provider !== \'custom\'">\n <md-tab-label>\n <span translate="MAIL.AUTHENTICATION">Authentication</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.CREDENTIALS">Credentials</div>\n </div>\n <form name="credentialsForm" novalidate>\n <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="credentialsForm[\'username\'].$error" ng-show="credentialsForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.modernAuthentication" class="md-block">\n <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select name="cloudProvider" ng-model="vm.mailAccount.Imap.CloudProviderId" required>\n <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n <div ng-messages="credentialsForm[\'cloudProvider\'].$error" ng-show="credentialsForm[\'cloudProvider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.mailAccount.Imap.modernAuthentication" class="md-block">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="credentialsForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">Mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorizazion Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorizazion Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n <md-tab-label>\n <span translate="MAIL.IMAP">IMAP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.authentication" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">Mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorization Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorization Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n <md-tab-label>\n <span translate="MAIL.SMTP">SMTP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.authentication" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container template md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.TEMPLATE">TEMPLATE</div>\n </div>\n <form name="templateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n <div ng-messages="templateForm[\'fontFamily\'].$error" ng-show="templateForm[fontFamily].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_SIZE">Font_Size</label>\n <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" value="13" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n <div ng-messages="templateForm[\'fontSize\'].$error" ng-show="templateForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.mailAccount.template"></textarea>\n </div>\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.mailAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.queueTransfer == true" class="md-block">\n <label translate="MAIL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.mailAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.agentTransfer == true" class="md-block">\n <label translate="MAIL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.mailAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.mandatoryDisposition" class="md-block">\n <label translate="MAIL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.mailAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="MailAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add mail dispositions" translate translate-attr-label="MAIL.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getMailAccountMailCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'MAIL.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'MAIL.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'MAIL.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'MAIL.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'MAIL.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{mailCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{mailCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value | htmlToPlaintext }}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{mailCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{ mailCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n Edit MailCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n Delete MailCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="MAIL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getMailAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getMailAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'MAIL.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'MAIL.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="subject">\n {{ \'MAIL.SUBJECT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'MAIL.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'MAIL.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'MAIL.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'MAIL.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'MAIL.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n <div class="width-300">\n <span class="text-truncate font-size-12">\n {{interaction.subject}}\n </span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'MAIL.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'MAIL.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n\n <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailAccounts-count">\n <span>{{vm.selectedMailAccounts.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="provider">{{ \'MAIL.SERVICE\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows" ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)">\n <td md-cell class="id">{{mailAccount.id}}</td>\n <td md-cell class="name">{{mailAccount.name}}</td>\n <td md-cell class="provider">{{ mailAccount.provider ? (mailAccount.provider | startcase) : (\'MAIL.CUSTOM\' | translate) }}</td>\n <td md-cell class="key">{{mailAccount.key}}</td>\n <td md-cell class="email">{{mailAccount.email}}</td>\n <td md-cell class="active">\n <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="description ">{{mailAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n Edit Email Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySMTP(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n Verify SMTP\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.goToInteractions(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n Go To Interactions\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.goToRealtime()" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n Go To Realtime\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.addAgent(mailAccount, $event)" translate="MAIL.AGENTADD_MAILACCOUNT">\n Add Agent To Email Account\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n Delete Email Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </div>\n\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n <form name="mailQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n\n <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n ADD MAILQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailQueue-image" hide-xs>\n <img ng-src="assets/images/business/mailQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailQueue.id}}\n <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailQueues-count">\n <span>{{vm.selectedMailQueues.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- MAILQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(mailQueue, $event )" translate="MAIL.EDIT_MAILQUEUE">\n Edit MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(mailQueue, $event )" translate="MAIL.TEAMADD_MAILQUEUE">\n teamadd MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(mailQueue, $event )" translate="MAIL.AGENTADD_MAILQUEUE">\n agentadd MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(mailQueue, $event )" translate="MAIL.DELETE_MAILQUEUE">\n Delete MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event )" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n goToRealtime MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n\n <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n\n <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n ADD MAILSUBSTATUS\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailSubtatuses-count">\n <span>{{vm.selectedMailSubstatuses.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- MAILSUBSTATUS TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(mailSubstatus, $event )" translate="MAIL.EDIT_MAILSUBSTATUS">\n Edit MailSubstatus\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event )" translate="MAIL.DELETE_MAILSUBSTATUS">\n Delete MailSubstatus\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getMailAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- ACCOUNTS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate}}</th>\n <th md-column>{{\'MAIL.KEY\' | translate}}</th>\n <th md-column>{{\'MAIL.TOTAL\' | translate}}</th>\n <th md-column>{{\'MAIL.IN\' | translate}}</th>\n <th md-column>{{\'MAIL.OUT\' | translate}}</th>\n <th md-column>{{\'MAIL.IMAP_STATUS\' | translate}}</th>\n <th md-column>{{\'MAIL.SMTP_STATUS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.count > 0">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="account" md-select-id="id" ng-repeat="account in vm.mailAccounts.rows">\n <td md-cell>{{account.name}}</td>\n <td md-cell>{{account.key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(account.in || 0) + (account.out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{account.in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{account.lastIn ? (account.lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{account.out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{account.lastOut ? (account.lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{account.Imap.messageStatus}}</md-tooltip>\n <div ng-switch="account.Imap.status">\n <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n </div>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + account.Imap.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed" ng-if="account.active && (account.Imap.lastSync && account.Imap.lastSync != \'\')">{{account.Imap.lastSync | date: \'shortTime\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center" ng-if="account.Smtp.status">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{account.Smtp.messageStatus}}</md-tooltip>\n <md-icon md-font-icon="{{ account.Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + account.Smtp.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed">{{account.Smtp.lastSync | date: \'shortTime\'}}</span>\n </div>\n <span class="md-caption grey-fg" ng-if="!account.Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToMailAccount($event, account)" translate="MAIL.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySmtp($event, account)" translate="MAIL.VERIFY_SMTP">\n Verify Smtp\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / ACCOUNTS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/create/dialog.html",'<md-dialog class="plugin-dialog" aria-label="New Plugin">\n <form name="pluginForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus>\n\n <div ng-messages="pluginForm[\'name\'].$error" ng-show="pluginForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'type\'].$error" ng-show="pluginForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="!vm.newPlugin"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description">\n\n <div ng-messages="pluginForm[\'description\'].$error" ng-show="pluginForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true">\n\n <div ng-messages="pluginForm[\'icon\'].$error" ng-show="pluginForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required>\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="pluginForm[\'sidebar\'].$error" ng-show="pluginForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl">\n\n <div ng-messages="pluginForm[\'adminUrl\'].$error" ng-show="pluginForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl">\n\n <div ng-messages="pluginForm[\'agentUrl\'].$error" ng-show="pluginForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'scriptName\'].$error" ng-show="pluginForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true">\n\n <div ng-messages="pluginForm[\'scriptPath\'].$error" ng-show="pluginForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'version\'].$error" ng-show="pluginForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPlugin" ng-click="vm.savePlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid || pluginForm.$pristine" aria-label="SAVE" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPlugin" ng-click="vm.addNewPlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid" aria-label="ADD" translate="MARKETPLACE.ADD_PLUGIN" translate-attr-aria-label="MARKETPLACE.ADD_PLUGIN">\n ADD PLUGIN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPlugin" ng-click="vm.deletePlugin($event)" aria-label="DELETE" translate translate-attr-aria-label="MARKETPLACE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MARKETPLACE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/marketplace/views/plugins/edit/view.html",'<div id="marketplace-plugin" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-plugins-button md-icon-button" aria-label="Go to plugins" ng-click="vm.gotoPlugins()" translate translate-attr-aria-label="MARKETPLACE.GO_TO_PLUGINS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="plugin-image" hide-xs>\n <img ng-src="assets/images/business/plugins.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.plugin.id}}\n <span ng-if="vm.plugin.name">{{vm.plugin.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MARKETPLACE.CREATED_AT"></span> <span>{{vm.plugin.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.savePlugin()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MARKETPLACE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="plugin-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MARKETPLACE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" disabled>\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="true"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'icon\'].$error" ng-show="generalForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="generalForm[\'sidebar\'].$error" ng-show="generalForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'adminUrl\'].$error" ng-show="generalForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'agentUrl\'].$error" ng-show="generalForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" disabled>\n\n <div ng-messages="generalForm[\'scriptName\'].$error" ng-show="generalForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'scriptPath\'].$error" ng-show="generalForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" disabled>\n\n <div ng-messages="generalForm[\'version\'].$error" ng-show="generalForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/marketplace/views/plugins/plugins.html",'<div id="plugins" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MARKETPLACE.PLUGINS">Plugins</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MARKETPLACE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPlugins.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPlugins =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MARKETPLACE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-plugins-count">\n <span>{{vm.selectedPlugins.length}}</span>\n <span translate="MARKETPLACE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MARKETPLACE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPlugins()" translate="MARKETPLACE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPlugins()" translate="MARKETPLACE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPlugins" csv-label="true" filename="plugins.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPlugins($event)" aria-label="delete selected" translate translate-attr-label="MARKETPLACE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n <div ng-if="vm.installing">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="MARKETPLACE.INSTALLING">Installing</span>\n <md-progress-linear md-mode="indeterminate" class="md-accent padding-20"></md-progress-linear>\n </div>\n </md-card>\n </div>\n\n \x3c!-- PLUGIN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPlugins" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPlugins">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="name">{{ \'MARKETPLACE.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'MARKETPLACE.TYPE\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MARKETPLACE.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MARKETPLACE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="version">{{ \'MARKETPLACE.VERSION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.plugins.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MARKETPLACE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="plugin" md-select-id="id" ng-repeat="plugin in vm.plugins.rows">\n <td md-cell ng-if="plugin.userpic"><img class="avatar" alt="{{plugin.name}}" ng-src="api/users/{{plugin.id}}/avatar" /></td>\n <td md-cell ng-if="!plugin.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{plugin.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="name ">{{plugin.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="type ">{{plugin.type}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="active ">\n <md-icon md-colors="{color: {{plugin.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{plugin.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="description ">{{plugin.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="version ">{{plugin.version}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MARKETPLACE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && !plugin.active">\n\n <md-button ng-click="vm.installplugin(plugin, $event )" translate="MARKETPLACE.INSTALL_PLUGIN">\n Install Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(plugin, $event )" translate="MARKETPLACE.EDIT_PLUGIN">\n Edit Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n <md-button ng-click="vm.stopplugin(plugin, $event )" translate="MARKETPLACE.STOP_PLUGIN">\n Stop Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n <md-button ng-click="vm.restartplugin(plugin, $event )" translate="MARKETPLACE.RESTART_PLUGIN">\n Restart Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.downloadfile2(plugin, $event , \'plugins\' )" translate="MARKETPLACE.DOWNLOAD_PLUGIN">\n Download Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active">\n\n <md-button ng-click="vm.uninstallplugin(plugin, $event )" translate="MARKETPLACE.UNINSTALL_PLUGIN">\n Uninstall Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(plugin, $event )" translate="MARKETPLACE.DELETE_PLUGIN">\n Delete Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MARKETPLACE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MARKETPLACE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MARKETPLACE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.plugins.count}}" md-on-paginate="vm.getPlugins" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PLUGIN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD PLUGIN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-plugin-button" ng-click="vm.uploadPlugin($event)" aria-label="upload plugin" translate translate-attr-aria-label="MARKETPLACE.UPLOAD_PLUGIN">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD PLUGIN BUTTON --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="plugin-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="MARKETPLACE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="MARKETPLACE.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="MARKETPLACE.UPLOADING">Uploading</span>\n <span>{{vm.plugin.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="MARKETPLACE.FINISH" translate-attr-aria-label="MARKETPLACE.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/hopperdate/hopperdate.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" ng-change="vm.recalcTZTime()" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n </md-content>\n </div>\n <md-input-container class="md-block">\n <div layout="row">\n <div flex class="md-block">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-change="vm.recalcTZTime()" autofocus>\n </md-input-container>\n </div>\n <div flex class="md-block">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n </md-input-container>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n\n <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n ADD IVRCAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",'<md-dialog class="ivrCampaign-dialog" aria-label="Clone IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n CLONE IVRCAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="ivrCampaign-image" hide-xs>\n <img ng-src="assets/images/business/ivrCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.ivrCampaign.id}}\n <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveIvrCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.ivrCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.ivrCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n </div>\n <form name="nosuchnumberForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.ivrCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.ivrCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n </div>\n <form name="dropForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n <input type="number" name="dialDropMaxRetry" ng-model="vm.ivrCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n <input type="number" name="dialDropRetryFrequency" ng-model="vm.ivrCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n </div>\n <form name="abandonedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.ivrCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.ivrCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n </div>\n <form name="machineForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n <input type="number" name="dialMachineMaxRetry" ng-model="vm.ivrCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n <input type="number" name="dialMachineRetryFrequency" ng-model="vm.ivrCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n </div>\n <form name="agentrejectForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.ivrCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.ivrCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="priority">\n {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.ContactId}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n {{hopper.phone}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countcongestionretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countbusyretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnoanswerretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnosuchnumberretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countdropretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countabandonedretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countmachineretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countagentrejectretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{ hopper.scheduledat | formatdate }}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n <td md-cell colspan="15">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n <td md-cell>\n {{hopperHistory.uniqueid}}\n </td>\n <td md-cell>\n {{hopperHistory.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridname}}\n </td>\n <td md-cell>\n {{hopperHistory.statedesc}}\n </td>\n <td md-cell>\n {{ hopperHistory.scheduledat | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.endtime | formatdate }}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column md-order-by="disposition">\n {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n <td md-cell>\n {{hopperFinal.uniqueid}}\n </td>\n <td md-cell>\n {{hopperFinal.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridname}}\n </td>\n <td md-cell>\n {{hopperFinal.statedesc}}\n </td>\n <td md-cell>\n {{hopperFinal.countcongestionretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countbusyretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnoanswerretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnosuchnumberretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countdropretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countabandonedretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countmachineretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countagentrejectretry}}\n </td>\n <td md-cell>\n {{ hopperFinal.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperFinal.endtime | formatdate }}\n </td>\n <td md-cell>\n {{hopperFinal.disposition}}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n <td md-cell colspan="28">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n <td md-cell>\n {{hopperBlack.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperBlack.phone}}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-ivrCampaigns-count">\n <span>{{vm.selectedIvrCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- IVRCAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':ivrCampaign.TrunkId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ (vm.projects | filter : {\'id\':ivrCampaign.SquareProjectId} : true)[0].name }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(ivrCampaign, $event )" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n Edit IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(ivrCampaign, $event )" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n clone IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.listadddialog(ivrCampaign, $event )" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n listadd IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event )" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n blacklistadd IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event )" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n Delete IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event )" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n goToRealtime IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n\n <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n ADD QUEUECAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",'<md-dialog class="queueCampaign-dialog" aria-label="Clone QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n CLONE QUEUECAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div layout="row">\n <div flex class="md-block">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n </md-input-container>\n </div>\n <div flex class="md-block">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n </md-input-container>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="queueCampaign-image" hide-xs>\n <img ng-src="assets/images/business/queueCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.queueCampaign.id}}\n <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveQueueCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (additionalphonesForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (thresholdsForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.queueCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n </div>\n <form name="queueForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" value="tTxX" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0" value="1" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.queueCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n </div>\n <form name="nosuchnumberForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.queueCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.queueCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n </div>\n <form name="dropForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n <input type="number" name="dialDropMaxRetry" ng-model="vm.queueCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n <input type="number" name="dialDropRetryFrequency" ng-model="vm.queueCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n </div>\n <form name="abandonedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.queueCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.queueCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n </div>\n <form name="machineForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n <input type="number" name="dialMachineMaxRetry" ng-model="vm.queueCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n <input type="number" name="dialMachineRetryFrequency" ng-model="vm.queueCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n </div>\n <form name="agentrejectForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.queueCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.queueCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container additionalphones md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADDITIONALPHONES">ADDITIONALPHONES</div>\n </div>\n <form name="additionalphonesForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLADDITIONALPHONEAFTERMIN">CallAdditionalPhoneAfterMin</label>\n <input type="number" name="callAdditionalPhoneAfterMin" ng-model="vm.queueCampaign.callAdditionalPhoneAfterMin" min="1" max="99999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="additionalphonesForm[\'callAdditionalPhoneAfterMin\'].$error" ng-show="additionalphonesForm[\'callAdditionalPhoneAfterMin\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_REQUIRED">CallAdditionalPhoneAfterMin field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CallAdditionalPhoneAfterMin must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_MUST_BE_LESS_THAN_OR_EQUAL_TO">CallAdditionalPhoneAfterMin must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.queueCampaign.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.queueCampaign.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n </div>\n <form name="advancedpreviewForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedpreviewForm[\'acwTimeout\'].$error" ng-show="advancedpreviewForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'predictive\'" class="queueCampaign-detail-form-container thresholds md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.THRESHOLDS">THRESHOLDS</div>\n </div>\n <form name="thresholdsForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEMAXTHRESHOLD">PredictiveMaxThreshold</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMAXTHRESHOLD"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMaxThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEMINTHRESHOLD">PredictiveMinThreshold</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMINTHRESHOLD"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMinThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n </div>\n <form name="recallmeForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialPreviewAutoRecallMe" aria-label="Preview_Auto_Recall_Me" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_AUTO_RECALL_ME">Preview_Auto_Recall_Me</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_AUTO_RECALL_ME"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialPreviewRecallmeReminder" aria-label="Preview_Recall_Me_Reminder" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_RECALL_ME_REMINDER">Preview_Recall_Me_Reminder</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_RECALL_ME_REMINDER"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="priority">\n {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n </th>\n <th md-column md-order-by="recallme">\n {{ \'MOTIONDIALER.RECALLAGENT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.ContactId}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n {{hopper.phone}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countcongestionretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countbusyretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnoanswerretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnosuchnumberretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countdropretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countabandonedretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countmachineretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countagentrejectretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{ hopper.scheduledat | formatdate }}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n <td md-cell>\n {{hopperHistory.uniqueid}}\n </td>\n <td md-cell>\n {{hopperHistory.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridname}}\n </td>\n <td md-cell>\n {{hopperHistory.statedesc}}\n </td>\n <td md-cell>\n {{ hopperHistory.scheduledat | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.endtime | formatdate }}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column md-order-by="disposition">\n {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n </th>\n <th md-column md-order-by="secondDisposition">\n {{ \'MOTIONDIALER.SECOND_LEVEL_DISPOSITION\' | translate }}\n </th>\n <th md-column md-order-by="thirdDisposition">\n {{ \'MOTIONDIALER.THIRD_LEVEL_DISPOSITION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n <td md-cell>\n {{hopperFinal.uniqueid}}\n </td>\n <td md-cell>\n {{hopperFinal.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridname}}\n </td>\n <td md-cell>\n {{hopperFinal.statedesc}}\n </td>\n <td md-cell>\n {{hopperFinal.countcongestionretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countbusyretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnoanswerretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnosuchnumberretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countdropretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countabandonedretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countmachineretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countagentrejectretry}}\n </td>\n <td md-cell>\n {{ hopperFinal.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperFinal.endtime | formatdate }}\n </td>\n <td md-cell>\n {{hopperFinal.disposition}}\n </td>\n <td md-cell>\n {{hopperFinal.secondDisposition}}\n </td>\n <td md-cell>\n {{hopperFinal.thirdDisposition}}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n <td md-cell colspan="30">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n <td md-cell>\n {{hopperBlack.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperBlack.phone}}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-queueCampaigns-count">\n <span>{{vm.selectedQueueCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':queueCampaign.TrunkId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(queueCampaign, $event )" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n Edit QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(queueCampaign, $event )" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n clone QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.listadddialog(queueCampaign, $event )" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n listadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event )" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n blacklistadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(queueCampaign, $event )" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n teamadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(queueCampaign, $event )" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n agentadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(queueCampaign, $event )" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n Delete QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event )" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n goToRealtime QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n </ms-search-bar>\n <div flex></div>\n\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n </md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n <td md-cell class="id">{{call.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n <td md-cell class="list">\n {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">{{call.queuecallerexitAt ? (call.queuecallerexitAt | formatdate) : undefined }}\n </td>\n <td md-cell class="list">{{call.queuecallerexitreason}}</td>\n <td md-cell class="list">{{call.lastAssignedTo}}</td>\n <td md-cell class="list">{{ call.disposition }}</td>\n <td md-cell class="list">{{ call.secondDisposition }}</td>\n <td md-cell class="list">{{ call.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n Assigned\n to</md-button>\n <md-menu-content>\n <md-menu-item ng-if="call.lastAssignedTo">\n <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getCampaigns()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n <tr md-row>\n <th md-column md-order-by="name" class="bl">{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column>{{\'MOTIONDIALER.ACTIVE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.campaigns.rows.length > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="campaign in vm.campaigns.rows">\n <td md-cell>\n <span>{{campaign.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n Edit Campaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.campaigns.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ABANDONED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.DROPPED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues.rows.length > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="queue in vm.queues.rows">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 ) ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n\n <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n\n <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n ADD OPENCHANNELACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",'<md-dialog class="openchannelAccount-dialog" aria-label="openchannelAccount" ng-init="vm.onInit()">\n <form name="openchannelAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">Add Agent to openchannelAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'accesskeyid\'].$error" ng-show="openchannelAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'secretaccesskey\'].$error" ng-show="openchannelAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'lexregion\'].$error" ng-show="openchannelAccountFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'botname\'].$error" ng-show="openchannelAccountFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'key\'].$error" ng-show="openchannelAccountFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'projectId\'].$error" ng-show="openchannelAccountFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'clientEmail\'].$error" ng-show="openchannelAccountFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'privateKey\'].$error" ng-show="openchannelAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/tag/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'tag\'].$error" ng-show="openchannelAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n\n <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n ADD OPENCHANNELCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelAccount-image" hide-xs>\n <img ng-src="assets/images/business/openchannelAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelAccount.id}}\n <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.openchannelAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.MAPKEY">MapKey</label>\n <md-select name="mapKey" ng-model="vm.openchannelAccount.mapKey" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-optgroup label="standard">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="!mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="custom">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="generalForm[\'mapKey\'].$error" ng-show="generalForm[\'mapKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MAPKEY_REQUIRED">MapKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n </div>\n <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.queueTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.openchannelAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.agentTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.openchannelAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.openchannelAccount.token" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.TOKEN"></span></div>\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.mandatoryDisposition" class="md-block">\n <label translate="OPENCHANNEL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.openchannelAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="OpenchannelAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add openchannel dispositions" translate translate-attr-label="OPENCHANNEL.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'OPENCHANNEL.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'OPENCHANNEL.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'OPENCHANNEL.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'OPENCHANNEL.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{ openchannelCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n Edit OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n Delete OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="OPENCHANNEL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getOpenchannelAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getOpenchannelAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'OPENCHANNEL.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'OPENCHANNEL.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'OPENCHANNEL.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'OPENCHANNEL.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'OPENCHANNEL.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'OPENCHANNEL.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'OPENCHANNEL.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'OPENCHANNEL.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'OPENCHANNEL.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelAccounts-count">\n <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':openchannelAccount.ListId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(openchannelAccount, $event )" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n Edit OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event )" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n Interactions OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(openchannelAccount, $event )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">\n AgentAdd OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event )" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n Delete OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n\n <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n ADD OPENCHANNELQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelQueue-image" hide-xs>\n <img ng-src="assets/images/business/openchannelQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelQueue.id}}\n <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelQueues-count">\n <span>{{vm.selectedOpenchannelQueues.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(openchannelQueue, $event )" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n Edit OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(openchannelQueue, $event )" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n teamadd OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(openchannelQueue, $event )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n agentadd OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event )" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n Delete OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event )" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n goToRealtime OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/plugins/views/plugin/plugin.html",'<div ng-if="!vm.plugin">\n <p>Plugin not available...</p>\n</div>\n<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/realtime/views/agents/view.html",'<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools quick-filter-container">\n <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getAgents()" query="vm.query" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = null; vm.getAgents()" aria-label="Status filter">\n <md-option ng-value="null">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n </md-select>\n <md-select ng-if="vm.query.globalStatusFilter === \'pause\' || vm.query.globalStatusFilter === \'*pause\'" ng-model="vm.query.pauseTypeFilter" class="md-caption ml-16" ng-change="vm.getAgents()">\n <md-option ng-value="null">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="DEFAULT PAUSE">{{ \'VOICE.DEFAULT_PAUSE\' | translate | uppercase }}</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">{{ \'STAFF.LOGININPAUSE\' | translate | uppercase }}</md-option>\n <md-option value="Auto-Pause">{{ \'VOICE.AUTOPAUSE\' | translate | uppercase }}</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n <md-select ng-model="vm.query.globalQueueFilter" multiple class="md-caption margin-left-10 mw-150" placeholder="{{ \'DASHBOARDS.SELECT_QUEUE\' | translate }}" md-on-open="vm.getQueuesByChannel()" md-on-close="vm.getAgents()">\n <md-button ng-click="vm.selectAllQueues()" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{\n queue.name }}</md-option>\n <md-button ng-click="vm.clearQueuesSelection()" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n </md-select>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table multiple md-progress="vm.getAgents">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.onSort">\n <tr md-row>\n <th class="bv text-center" colspan="5">{{ \'VOICE.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">\n {{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th ng-if="vm.license.whatsapp" class="bv bl text-center" colspan="2">\n {{ \'WHATSAPP.WHATSAPP\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" colspan="2" md-column md-order-by="fullname">\n {{ \'VOICE.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">\n {{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">\n {{ \'VOICE.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">\n {{ \'VOICE.PAUSE_TIME\' | translate }}</th>\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.whatsapp" class="bl text-center">{{ \'WHATSAPP.STATUS\' | translate }}</th>\n <th ng-if="vm.license.whatsapp" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'WHATSAPP.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.count > 0">\n <td md-cell colspan="19">\n <div layout="row" layout-align="center center">\n <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{agent.userpic && \'api/users/\'+ agent.id +\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{agent.fullname}}</span>\n <span>{{agent.internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5">\n <div layout="row" layout-align="start center" ng-if="vm.license.screenrecording && (agent.phoneBarEnableScreenRecordingByAgent || agent.phoneBarEnableAutomaticScreenRecording)">\n <div class="column">\n <span>\n <md-icon md-font-icon="icon-camcorder-box" ng-class="agent.screenrecording ? \'green-fg\' : \'grey-fg\'" aria-hidden="true">\n <md-tooltip>\n {{ agent.screenrecording ? \'VOICE.TOOLTIP_SCREENRECORDING_ON\' : \'VOICE.TOOLTIP_SCREENRECORDING_OFF\'\n | translate }}\n </md-tooltip>\n </md-icon>\n </span>\n </div>\n </div>\n </td>\n <td class="bt text-center">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[agent.globalStatus]\">\n <span ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">{{ 'VOICE.PAUSE' | translate | uppercase }} (</span>{{\n ['pause', '*pause'].includes(agent.globalStatus) ? \n ((agent.globalStatusDisplayValue === 'DEFAULT PAUSE' ? ('VOICE.DEFAULT_PAUSE' | translate) : agent.globalStatusDisplayValue) | uppercase) : \n ('VOICE.' + (agent.globalStatusDisplayValue | uppercase) | translate | uppercase) }}<span ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">)</span>\n </span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"agent.lastLoginAt\" utc-offset=\"vm.utcOffset\"></timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\" start-time=\"agent.lastPauseAt\" utc-offset=\"vm.utcOffset\"></timer>\n </td>\n <td class=\"bt bl text-center\">\n <span ng-if=\"!agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[agent.voiceStatus]\">\n {{ 'VOICE.' + (agent.voiceStatus | uppercase) | translate | uppercase }}</span>\n <span ng-if=\"agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">\n {{ 'VOICE.ONHOLD' | translate | uppercase }}</span>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\" ng-if=\"agent.voiceStatus === 'talking' || agent.voiceStatus === 'ringing'\">\n <span ng-if=\"agent.queue\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n agent.queue }}</span>\n <span ng-if=\"agent.destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\" privacy ng-cloak>{{\n agent.destconnectedlinenum }}</span>\n <span ng-if=\"agent.routealias\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n agent.routealias }}</span>\n <span class=\"padding-5\" ng-if=\"agent.queue || agent.destconnectedlinenum\">\n <timer start-time=\"agent.voiceStatusTime\" utc-offset=\"vm.utcOffset\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">\n </timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl text-center\" ng-if=\"vm.license.chat\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.chatStatus]\">\n {{ 'VOICE.' + (agent.chatStatus | uppercase) | translate | uppercase }}</span>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.chatStatus]\">\n {{ agent.chatCurrentCapacity }}</td>\n <td class=\"bl bt text-center\" ng-if=\"vm.license.mail\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.mailStatus]\">\n {{ 'VOICE.' + (agent.mailStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.mailStatus]\">\n {{ agent.mailCurrentCapacity }}</td>\n <td class=\"bl bt text-center\" ng-if=\"vm.license.messaging\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.smsStatus]\">\n {{ 'VOICE.' + (agent.smsStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.smsStatus]\">\n {{ agent.smsCurrentCapacity }}</td>\n <td class=\"bt bl text-center\" ng-if=\"vm.license.openchannel\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.openchannelStatus]\">\n {{ 'VOICE.' + (agent.openchannelStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.openchannelStatus]\">\n {{ agent.openchannelCurrentCapacity }}</td>\n <td class=\"bt bl text-center\" ng-if=\"vm.license.fax\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.faxStatus]\">\n {{ 'VOICE.' + (agent.faxStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.faxStatus]\">\n {{ agent.faxCurrentCapacity }}</td>\n <td class=\"bl bt text-center\" ng-if=\"vm.license.whatsapp\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.whatsappStatus]\">\n {{ 'VOICE.' + (agent.whatsappStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.whatsapp\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.whatsappStatus]\">\n {{ agent.whatsappCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(agent, $event)\" translate=\"VOICE.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.addQueue(agent, $event)\" translate=\"{{ vm.channel.toUpperCase() + '.AGENTADD_QUEUE' }}\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.license.screenrecording && agent.phoneBarEnableScreenRecordingByAgent\">\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.SCREENRECORDING\">Manage Screen Recording\n </md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click=\"vm.manageScreenRecording(agent, !agent.screenrecording)\" translate=\"{{ agent.screenrecording ? 'VOICE.STOP_SCREENRECORDING' : 'VOICE.START_SCREENRECORDING' }}\" aria-label=\"Screen Recording\">\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\"agent.voicePause && 'DEFAULT PAUSE' === agent.pauseType\" ng-click=\"vm.pause(agent)\">\n <em translate=\"VOICE.DEFAULT_PAUSE\">Default Pause</em>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"agent.voicePause && pause.name === agent.pauseType\" ng-click=\"vm.pause(agent, pause.name)\">{{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">\n <md-button ng-click=\"vm.unpause(agent)\" translate=\"VOICE.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n<md-table-pagination md-label=\"{page: '{{'VOICE.PAGE' | translate}}:', rowsPerPage: '{{'VOICE.ROWSPERPAGE' | translate}}:', of: '{{'VOICE.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.agents.count}}\" md-on-paginate=\"vm.onPaginate\" md-page-select></md-table-pagination>"),e.put("app/main/apps/realtime/views/queue-calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </div>\n</md-toolbar>\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th ng-if="vm.voiceQueueType === \'inbound\'" md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueuesChannels.count > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="channel in vm.voiceQueuesChannels.rows | limitObjectFromTo: vm.query.limit:(vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td ng-if="vm.voiceQueueType === \'inbound\'" md-cell>{{channel.routealias}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell privacy ng-cloak>\n <span ng-if="vm.voiceQueueType === \'inbound\'">{{channel.calleridname}}, </span>\n <span>{{channel.calleridnum}}</span>\n </td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt"></timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt"></timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt"></timer>\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu class="no-margin">\n <md-button ng-mouseenter="vm.getAvailableAgents()" translate="VOICE.REDIRECT_TO_AGENT">\n Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-if="!vm.availableAgents">\n <md-progress-circular class="md-accent auto-margin" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="vm.availableAgents.length > 0" ng-repeat="agent in vm.availableAgents">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">\n {{agent.name}}</md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.availableAgents.length === 0">\n <span>{{ \'VOICE.NO_AGENT_AVAILABLE\' | translate }}</span>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-page="vm.query.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{ vm.voiceQueuesChannels.count }}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/realtime/views/queues/predictive/dialog.html",'<md-dialog class="predictive-dialog" aria-label="New predictive">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.queueCampaign.name }} {{ \'DASHBOARDS.INFO\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="text-center">\n <ds-widget-clock data-show-digital></ds-widget-clock>\n <div ng-if="!vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive">\n <div class="md-title"><span translate="MOTIONDIALER.PREDICTIVE_IS_NOT_RUNNING">Predictive is not running</span></div>\n </div>\n\n <div ng-if="vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive" class="m-10">\n <div layout="row">\n <div flex="" class="column">\n <div class="md-headline"><span translate="MOTIONDIALER.DATA_COLLECTION_IN_PROGRESSIVE">Data collection in progressive</span></div>\n <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n </div>\n </div>\n\n <div layout="row">\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n <div class="md-headline">{{ vm.formatTime(vm.queueCampaign.startProgressive) }}</div>\n </div>\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n <div class="md-headline">\n {{ vm.formatTime(vm.queueCampaign.startProgressive, vm.queueCampaign.dialPredictiveInterval) }}\n </div>\n </div>\n </div>\n <div>\n <span class="text-boxed blue-bg white-fg">\n {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n </span>\n </div>\n </div>\n <div ng-if="vm.queueCampaign.startPredictive" class="m-10">\n <div layout="row">\n <div flex="" class="column">\n <div class="md-headline"><span translate="MOTIONDIALER.PREDICTIVE_IS_RUNNING">Predictive is runnning</span></div>\n <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n </div>\n </div>\n\n <div layout="row">\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n <div class="md-headline">{{ vm.formatTime(vm.queueCampaign.startPredictive) }}</div>\n </div>\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n <div class="md-headline">\n {{ vm.formatTime(vm.queueCampaign.startPredictive, vm.queueCampaign.dialPredictiveInterval) }}\n </div>\n </div>\n </div>\n <div>\n <span class="text-boxed blue-bg white-fg">\n {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n </span>\n </div>\n <div class="row">\n <md-card>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Predictive - {{ \'MOTIONDIALER.PREVIOUS_INTERVAL\' | translate }}</span>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <tbody md-body>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.TOTAL_CALLS">Total Calls</span></td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalTotalCalls }}</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.ANSWERED_CALLS">Total Calls</span></td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalAnsweredCalls }}</td>\n </tr>\n \x3c!-- Temporaneamente non mostrate perchè contengono anche i dati dell\'intervallo corrente --\x3e\n \x3c!-- <tr md-row>\n <td md-cell>Dropped Calls Timeout</td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsTimeout }}</td>\n </tr>\n <tr md-row>\n <td md-cell>Dropped Calls Caller Exit</td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsCallersExit }}\n </td>\n </tr> --\x3e\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.AVG_HOLD_TIME">AVG Hold Time</span></td>\n <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgHoldtime | number:0 }}s</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.AVG_TALK_TIME">AVG Talk Time</span></td>\n <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgTalktime | number:0 }}s</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n <md-card>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">ErlangB - {{ \'MOTIONDIALER.CURRENT_INTERVAL\' | translate }}</span>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <tbody md-body>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span></td>\n <td md-cell>{{ vm.queueCampaign.erlangCalls }}</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.ONE_CALL_EVERY">One call every</span></td>\n <td md-cell>~ {{ vm.queueCampaign.erlangCallToSecond | number:0 }}s</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.DROPRATE">Drop Rate</span></td>\n <td md-cell>{{ vm.queueCampaign.erlangAbandonmentRate * 100 | number:2 }}%</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.AGENTBUSYFACTOR">Agent Busy Factor</span></td>\n <td md-cell>{{ vm.queueCampaign.erlangBusyFactor * 100 | number:2 }}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </div>\n </md-dialog-content>\n</md-dialog>'),e.put("app/main/apps/realtime/views/queues/templates/actions.html",'<md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editQueue($event, queue)" translate="{{ (vm.channel | uppercase) + \'.EDIT_QUEUE\' }}">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="queue.dialMethod === \'predictive\'">\n <md-button ng-click="vm.showPredictiveInfo($event, queue)" translate="MOTIONDIALER.SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO">\n Show Predictive Info\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.addOrRemoveAgents($event, queue)" translate="{{ (vm.channel | uppercase) + \'.AGENTSADD_QUEUE\' }}">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n</md-menu>'),e.put("app/main/apps/realtime/views/queues/templates/headers/default.html","<tr md-row>\n <th md-column md-order-by=\"name\">{{ (vm.channel | uppercase) + '.NAME' | translate }}</th>\n <th md-column>{{ (vm.channel | uppercase) + '.LOGGED_IN' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.AVAILABLE' | translate }}</th>\n <th md-column>{{ (vm.channel | uppercase) + '.PAUSED' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.WAITING_INTERACTIONS' | translate }}</th>\n <th md-column width=\"10px\"></th>\n</tr>"),e.put("app/main/apps/realtime/views/queues/templates/headers/inbound.html","<tr md-row>\n <th md-column md-order-by=\"name\">{{ 'VOICE.NAME' | translate }}</th>\n <th md-column>{{ 'VOICE.LOGGED_IN' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.AVAILABLE' | translate }}</th>\n <th md-column>{{ 'VOICE.PAUSED' | translate }}</th>\n <th md-column>{{ 'VOICE.TALKING' | translate }}</th>\n <th md-column>{{ 'VOICE.BUSY' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.WAITING_CALLS' | translate }}</th>\n <th md-column width=\"10px\"></th>\n</tr>"),e.put("app/main/apps/realtime/views/queues/templates/headers/outbound.html","<tr md-row>\n <th md-column md-order-by=\"name\">{{ 'MOTIONDIALER.NAME' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.LOGGED_IN' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.AVAILABLE' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.PAUSED' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.TALKING' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.BUSY' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.WAITING_CALLS' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.ORIGINATED_TEXT' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.MESSAGE' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.METHOD' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.TRUNK' | translate }}</th>\n <th md-column md-order-by=\"dialActive\">{{ 'MOTIONDIALER.ACTIVE' | translate }}</th>\n <th md-column width=\"10px\"></th>\n</tr>"),e.put("app/main/apps/realtime/views/queues/templates/rows/default.html",'<tr md-row ng-hide="vm.queues.count > 0">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n</tr>\n<tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n <td md-cell>{{ queue.name }}</td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n </td>\n\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit" ng-include="\'app/main/apps/realtime/views/queues/templates/actions.html\'"></td>\n</tr>'),e.put("app/main/apps/realtime/views/queues/templates/rows/inbound.html",'<tr md-row ng-hide="vm.queues.count > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n</tr>\n<tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n <td md-cell>{{ queue.name }}</td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.talking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.inUse - queue.talking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n </td>\n\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit" ng-include="\'app/main/apps/realtime/views/queues/templates/actions.html\'"></td>\n</tr>'),e.put("app/main/apps/realtime/views/queues/templates/rows/outbound.html",'<tr md-row ng-hide="vm.queues.count > 0">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n</tr>\n<tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n <td md-cell>{{ queue.name }}</td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.talking + queue.pTalking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.inUse - queue.talking - queue.pTalking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.originated }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{ queue.message ? (\'MOTIONDIALER.\' + queue.message | translate) : (queue.statusMessage ? (\'MOTIONDIALER.\' + queue.statusMessage | translate) : \'--\')}}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.dialMethod || 0 }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{ queue.Trunk ? queue.Trunk.name : \'--\' }}</span>\n </td>\n <td md-cell>\n'+" <md-icon md-colors=\"{color: {{queue.dialActive ? '\\'green\\'' : '\\'red\\''}}}\" md-font-icon=\"{{queue.dialActive ? 'icon-check' : 'icon-close'}}\"></md-icon>\n </td>\n\n <td md-cell class=\"actions\" ng-if=\"vm.crudPermissions.canEdit\" ng-include=\"'app/main/apps/realtime/views/queues/templates/actions.html'\"></td>\n</tr>"),e.put("app/main/apps/realtime/views/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="{{ (vm.channel | uppercase) + \'.QUEUES\' }}">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues" ng-include="vm.headersTemplate">\n </thead>\n <tbody md-body ng-include="vm.rowsTemplate"></tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{ \'DASHBOARDS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'DASHBOARDS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'DASHBOARDS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/settings/views/cloudProviders/cloudProviders.html",'<div id="cloudProviders" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CLOUD_PROVIDERS">Cloud Providers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAiTools.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedAiTools =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cloudProviders-count">\n <span>{{vm.selectedAiTools.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAiTools()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAiTools()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAiTools" csv-label="true" filename="cloudProviders.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm.deleteSelectedAiTools($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CLOUDPROVIDER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAiTools" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAiTools">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SETTINGS.NAME\' | translate }}</th>\n <th md-column md-order-by="service">{{ \'SETTINGS.SERVICE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cloudProviders.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cloudProvider" md-select-id="id" ng-repeat="cloudProvider in vm.cloudProviders.rows">\n <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="id">{{cloudProvider.id}}</td>\n <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="name">{{cloudProvider.name}}</td>\n <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="service">{{ vm.services[cloudProvider.service] }}</td>\n\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n <md-button ng-click="vm.authenticateToMicrosoftIdentityPlatform(cloudProvider)" translate="SETTINGS.AUTHENTICATE">\n Authenticate\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n <md-button ng-click="vm.updateClientSecret(cloudProvider, $event)" translate="SETTINGS.UPDATE_CLIENT_SECRET">\n Update Client Secret\n </md-button>\n </md-menu-item>\n\n <md-menu-item>\n <md-button ng-click="vm.editdialog(cloudProvider, $event)" translate="SETTINGS.EDIT_CLOUDPROVIDER">\n Edit CloudProvider\n </md-button>\n </md-menu-item>\n\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(cloudProvider, $event)" translate="SETTINGS.DELETE_CLOUDPROVIDER">\n Delete CloudProvider\n </md-button>\n </md-menu-item>\n\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cloudProviders.count}}" md-on-paginate="vm.getAiTools" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CLOUDPROVIDER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CLOUDPROVIDER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-cloudProvider-button" ng-click="vm.createOrEditCloudProvider($event)" aria-label="add cloudProvider" translate translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CLOUDPROVIDER BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/cloudProviders/create/dialog.html",'<md-dialog class="cloudProvider-dialog" aria-label="New CloudProvider">\n <form name="cloudProviderForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ (vm.newCloudProvider ? \'SETTINGS.NEW_CLOUDPROVIDER\' : \'SETTINGS.EDIT_CLOUDPROVIDER\') | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.cloudProvider.name" ng-required="true" autofocus>\n\n <div ng-messages="cloudProviderForm[\'name\'].$error" ng-show="cloudProviderForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SERVICE">Service</label>\n <md-select name="service" ng-model="vm.cloudProvider.service" required ng-disabled="!vm.newCloudProvider">\n <md-option ng-if="vm.license.ai" ng-value="\'AmazonAWS\'">AmazonAWS</md-option>\n <md-option ng-value="\'MicrosoftAzure\'">Microsoft Azure</md-option>\n </md-select>\n <div ng-messages="cloudProviderForm[\'service\'].$error" ng-show="cloudProviderForm[\'service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'" class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="service" ng-model="vm.cloudProvider.type" required ng-disabled="!vm.newCloudProvider">\n <md-option ng-value="\'Outlook365\'">Outlook365</md-option>\n <md-option ng-value="\'Dynamics365\'">Dynamics365</md-option>\n </md-select>\n <div ng-messages="cloudProviderForm[\'type\'].$error" ng-show="cloudProviderForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n <label translate="SETTINGS.ACCESSKEY">AccessKey</label>\n <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCESSKEY_REQUIRED">AccessKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n <label translate="SETTINGS.SECRETACCESSKEY">SecretAccesskey</label>\n <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SECRETACCESSKEY_REQUIRED">SecretAccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'">\n <md-input-container class="md-block">\n <label translate="SETTINGS.APPLICATION_ID">Application Id</label>\n <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.TENANT_ID">Tenant Id</label>\n <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.newCloudProvider" class="md-block">\n <label translate="SETTINGS.CLIENT_SECRET">Client Secret</label>\n <input type="password" name="data3" ng-model="vm.cloudProvider.data3" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.CLIENT_SECRET"></span></div>\n\n <div ng-messages="cloudProviderForm[\'data3\'].$error" ng-show="cloudProviderForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.REDIRECT_URI">Redirect Uri</label>\n <input type="url" name="data4" ng-model="vm.cloudProvider.data4" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data4\'].$error" ng-show="cloudProviderForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.cloudProvider.type == \'Dynamics365\'" class="md-block">\n <label translate="SETTINGS.REMOTE_URI">Remote Uri</label>\n <input type="url" name="data7" ng-model="vm.cloudProvider.data7" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data7\'].$error" ng-show="cloudProviderForm[\'data7\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCloudProvider" ng-click="vm.saveCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid || cloudProviderForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCloudProvider" ng-click="vm.addNewCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CLOUDPROVIDER" translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n ADD CLOUDPROVIDER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.deleteCloudProvider($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",'<md-dialog class="cloudProvider-dialog" aria-label="update client secret">\n <form name="updateSecretForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'SETTINGS.UPDATE_CLIENT_SECRET\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n <label translate="SETTINGS.CLIENT_SECRET">Current Client Secret</label>\n <input type="text" name="currentSecret" ng-model="vm.cloudProvider.data3" disabled>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NEW_CLIENT_SECRET">New Client Secret</label>\n <input type="password" name="secret" ng-model="vm.newSecret" required>\n <div ng-messages="updateSecretForm.secret.$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">New Client Secret field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSecret()" class="send-button md-accent md-raised" ng-disabled="updateSecretForm.$invalid || updateSecretForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n <form name="customizationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n ADD CUSTOMIZATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="(customizationsForm.$pristine && logoForm.$pristine && logologinForm.$pristine && preferredForm.$pristine && faviconForm.$pristine) || (customizationsForm.$invalid || logoForm.$invalid || logologinForm.$invalid || preferredForm.$invalid || faviconForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n </div>\n <form name="customizationsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationsForm[\'headerWhiteLabel\'].$error" ng-show="customizationsForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationsForm[\'pageTitle\'].$error" ng-show="customizationsForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n </div>\n <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()" flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n </div>\n <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()" flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logologinimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logologinimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultPreferred && vm.license.preferred" class="customization-detail-form-container preferred md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.PREFERRED">PREFERRED</div>\n </div>\n <div ng-controller="CustomizationpreferredController as vm_cp" ng-init="vm_cp.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cp.ngFlowOptions" flow-name="vm_cp.ngFlow.flow" flow-files-submitted="vm_cp.upload()" flow-file-added="vm_cp.fileAdded($file)" flow-file-success="vm_cp.fileSuccess($file, $message)" flow-complete="vm_cp.uploadComplete()" flow-drop flow-drag-enter="vm_cp.dropping=true" flow-drag-leave="vm_cp.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="preferredimage in vm_cp.customization.images" ng-switch="preferredimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{preferredimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="preferredimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{preferredimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultFavicon" class="customization-detail-form-container favicon md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.FAVICON">FAVICON</div>\n </div>\n <div ng-controller="CustomizationfaviconController as vm_cf" ng-init="vm_cf.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cf.ngFlowOptions" flow-name="vm_cf.ngFlow.flow" flow-files-submitted="vm_cf.upload()" flow-file-added="vm_cf.fileAdded($file)" flow-file-success="vm_cf.fileSuccess($file, $message)" flow-complete="vm_cf.uploadComplete()" flow-drop flow-drag-enter="vm_cf.dropping=true" flow-drag-leave="vm_cf.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG, ICO - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="faviconimage in vm_cf.customization.images" ng-switch="faviconimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{faviconimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="faviconimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{faviconimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n <form name="generalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n ADD GENERAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="(globalForm.$pristine && motionbarForm.$pristine && reportForm.$pristine && agentOmniDesktopInterfaceForm.$pristine && screenRecordingForm.$pristine && securityForm.$pristine && imapGeneralSettingsForm.$pristine && SSOForm.$pristine && aiToolsForm.$pristine) || (globalForm.$invalid || motionbarForm.$invalid || reportForm.$invalid || agentOmniDesktopInterfaceForm.$invalid || screenRecordingForm.$invalid || securityForm.$invalid || imapGeneralSettingsForm.$invalid || SSOForm.$invalid || aiToolsForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" value="1000" ng-required="true" autofocus>\n\n <div ng-messages="globalForm[\'min_internal\'].$error" ng-show="globalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" value="30" ng-required="true">\n\n <div ng-messages="globalForm[\'chatTimeout\'].$error" ng-show="globalForm[\'chatTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.rtlSupport" aria-label="RtlSupport"><span translate="SETTINGS.RTLSUPPORT">RtlSupport</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.RTLSUPPORT"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.stopRecordingOnTransfer" aria-label="Stop_Recording_On_Voice_Call_Transfer"><span translate="SETTINGS.STOP_RECORDING_ON_VOICE_CALL_TRANSFER">Stop_Recording_On_Voice_Call_Transfer</span></md-switch>\n </md-input-container>\n </form>\n </div>\n\n <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n </div>\n <form name="motionbarForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" value="https://www.xcally.com/bar/phonebar/autoupdater.xml" ng-required="vm.general.phoneBarAutoUpdater">\n\n <div ng-messages="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarRememberMeEnabled" aria-label="MotionbarRememberMe"><span translate="SETTINGS.MOTIONBARREMEMBERME">MotionbarRememberMe</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.MOTIONBARREMEMBERME"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container report md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.REPORT">REPORT</div>\n </div>\n <form name="reportForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv" value="5000">\n\n <div ng-messages="reportForm[\'splitSizeCsv\'].$error" ng-show="reportForm[\'splitSizeCsv\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf" value="1000">\n\n <div ng-messages="reportForm[\'splitSizePdf\'].$error" ng-show="reportForm[\'splitSizePdf\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx" value="5000">\n\n <div ng-messages="reportForm[\'splitSizeXlsx\'].$error" ng-show="reportForm[\'splitSizeXlsx\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container agentomnidesktopinterface md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.AGENTOMNIDESKTOPINTERFACE">AGENTOMNIDESKTOPINTERFACE</div>\n </div>\n <form name="agentOmniDesktopInterfaceForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.enableEmailPreview" aria-label="EnableEmailPreview"><span translate="SETTINGS.ENABLEEMAILPREVIEW">EnableEmailPreview</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.searchOnEnterKey" aria-label="Search_On_Enter_Key"><span translate="SETTINGS.SEARCH_ON_ENTER_KEY">Search_On_Enter_Key</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SEARCH_ON_ENTER_KEY"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.general.messagesAlignment">\n <md-option ng-value="\'alternate\'">Alternate</md-option>\n <md-option ng-value="\'left\'">Left</md-option>\n <md-option ng-value="\'right\'">Right</md-option>\n </md-select>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHAT_INTERACTIONS_RELOAD_TIMEOUT">Chat_Interactions_Reload_Timeout</label>\n <input type="number" name="chatInteractionsReloadTimeout" ng-model="vm.general.chatInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHAT_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Chat_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MAIL_INTERACTIONS_RELOAD_TIMEOUT">Mail_Interactions_Reload_Timeout</label>\n <input type="number" name="mailInteractionsReloadTimeout" ng-model="vm.general.mailInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MAIL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Mail_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT">Openchannel_Interactions_Reload_Timeout</label>\n <input type="number" name="openchannelInteractionsReloadTimeout" ng-model="vm.general.openchannelInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Openchannel_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMS_INTERACTIONS_RELOAD_TIMEOUT">Sms_Interactions_Reload_Timeout</label>\n <input type="number" name="smsInteractionsReloadTimeout" ng-model="vm.general.smsInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMS_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Sms_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT">Whatsapp_Interactions_Reload_Timeout</label>\n <input type="number" name="whatsappInteractionsReloadTimeout" ng-model="vm.general.whatsappInteractionsReloadTimeout">\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Whatsapp_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PREVIEW_RECALLME_REMINDER_INTERVAL">Preview_Recallme_Reminder_Interval</label>\n <input type="number" name="previewRecallmeReminderInterval" ng-model="vm.general.previewRecallmeReminderInterval" min="1">\n <div class="hint"><span translate="SETTINGS.HELP.PREVIEW_RECALLME_REMINDER_INTERVAL"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED">Preview_Recallme_Reminder_Interval field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Preview_Recallme_Reminder_Interval must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.LIMIT_TABS">limitTabs</label>\n <input type="number" name="limitTabs" ng-model="vm.general.limitTabs" min="0" value="20">\n <div class="hint"><span translate="SETTINGS.HELP.LIMIT_TABS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container filters md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.FILTERS">FILTERS</div>\n </div>\n <form name="filtersForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.filterFullName" aria-label="fullName"><span translate="SETTINGS.FILTER_FULLNAME">Full Name</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.FILTER_FULLNAME"></span></div>\n </md-input-container>\n </form>\n </div>\n\n <div ng-if="vm.license.screenrecording" class="general-detail-form-container screenrecording md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.SCREENRECORDING">SCREENRECORDING</div>\n </div>\n <form name="screenRecordingForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.DEFAULTSCREENRECORDINGPATH">defaultScreenRecordingPath</label>\n <input type="text" name="defaultScreenRecordingPath" ng-model="vm.general.defaultScreenRecordingPath" autofocus>\n\n <div class="hint"><span translate="SETTINGS.HELP.DEFAULTSCREENRECORDINGPATH"></span></div>\n <div ng-messages="screenRecordingForm[\'defaultScreenRecordingPath\'].$error" ng-show="screenRecordingForm[\'defaultScreenRecordingPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DEFAULTSCREENRECORDINGPATH_REQUIRED">defaultScreenRecordingPath field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container security md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.SECURITY">SECURITY</div>\n </div>\n <form name="securityForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ALLOWEDLOGINATTEMPTS">allowedLoginAttempts</label>\n <input type="number" name="allowedLoginAttempts" ng-model="vm.general.allowedLoginAttempts" value="5" ng-required="true">\n\n <div ng-messages="securityForm[\'allowedLoginAttempts\'].$error" ng-show="securityForm[\'allowedLoginAttempts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ALLOWEDLOGINATTEMPTS_REQUIRED">allowedLoginAttempts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.BLOCKDURATION">blockDuration</label>\n <input type="number" name="blockDuration" ng-model="vm.general.blockDuration" value="10" ng-required="true">\n\n <div ng-messages="securityForm[\'blockDuration\'].$error" ng-show="securityForm[\'blockDuration\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.BLOCKDURATION_REQUIRED">blockDuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.enforcePasswordHistory" aria-label="Enforce_Password_History"><span translate="SETTINGS.ENFORCE_PASSWORD_HISTORY">Enforce_Password_History</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.ENFORCE_PASSWORD_HISTORY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.general.enforcePasswordHistory" class="md-block">\n <label translate="SETTINGS.PASSWORD_HISTORY_LIMIT">Password_History_Limit</label>\n <input type="number" name="passwordHistoryLimit" ng-model="vm.general.passwordHistoryLimit" min="2" max="5" value="3">\n\n <div class="hint"><span translate="SETTINGS.HELP.PASSWORD_HISTORY_LIMIT"></span></div>\n <div ng-messages="securityForm[\'passwordHistoryLimit\'].$error" ng-show="securityForm[\'passwordHistoryLimit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_REQUIRED">Password_History_Limit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block no-margin-bottom">\n <md-switch ng-change="vm.onPrivacyPolicyChange(\'email\')" ng-model="vm.general.enablePrivacyPolicyEmail" aria-label="Privacy_Policy_Email"><span translate="SETTINGS.PRIVACY_POLICY_EMAIL">Privacy_Policy_Email</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.enablePrivacyPolicyEmail" class="md-block no-margin-top">\n\n <input type="number" name="privacyPolicyEmail" ng-model="vm.general.privacyPolicyEmail" min="0" value="0" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n <div ng-messages="securityForm[\'privacyPolicyEmail\'].$error" ng-show="securityForm[\'privacyPolicyEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_REQUIRED">Privacy_Policy_Email field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Email must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block no-margin-bottom">\n <md-switch ng-change="vm.onPrivacyPolicyChange(\'name\')" ng-model="vm.general.enablePrivacyPolicyName" aria-label="Privacy_Policy_Name"><span translate="SETTINGS.PRIVACY_POLICY_NAME">Privacy_Policy_Name</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.enablePrivacyPolicyName" class="md-block no-margin-top">\n\n <input type="number" name="privacyPolicyName" ng-model="vm.general.privacyPolicyName" min="0" value="0" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n <div ng-messages="securityForm[\'privacyPolicyName\'].$error" ng-show="securityForm[\'privacyPolicyName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_REQUIRED">Privacy_Policy_Name field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Name must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block no-margin-bottom">\n <md-switch ng-change="vm.onPrivacyPolicyChange(\'number\')" ng-model="vm.general.enablePrivacyPolicyNumber" aria-label="Privacy_Policy_Number"><span translate="SETTINGS.PRIVACY_POLICY_NUMBER">Privacy_Policy_Number</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.enablePrivacyPolicyNumber" class="md-block no-margin-top">\n\n <input type="number" name="privacyPolicyNumber" ng-model="vm.general.privacyPolicyNumber" min="0" value="0" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n <div ng-messages="securityForm[\'privacyPolicyNumber\'].$error" ng-show="securityForm[\'privacyPolicyNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_REQUIRED">Privacy_Policy_Number field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Number must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.disabledCookie" aria-label="Disabled_Cookie"><span translate="SETTINGS.DISABLED_COOKIE">Disabled_Cookie</span></md-switch>\n </md-input-container>\n </form>\n </div>\n\n <div class="general-detail-form-container imapgeneralsettings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.IMAPGENERALSETTINGS">IMAPGENERALSETTINGS</div>\n </div>\n <form name="imapGeneralSettingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.LOGINMAILFREQUENCY">loginMailFrequency</label>\n <input type="number" name="loginMailFrequency" ng-model="vm.general.loginMailFrequency" min="10" value="10" ng-required="true" autofocus>\n\n <div class="hint"><span translate="SETTINGS.HELP.LOGINMAILFREQUENCY"></span></div>\n <div ng-messages="imapGeneralSettingsForm[\'loginMailFrequency\'].$error" ng-show="imapGeneralSettingsForm[\'loginMailFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_REQUIRED">loginMailFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">loginMailFrequency must be a valid greater or equal than</span> <span>10</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container sso md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.SSO">SSO</div>\n </div>\n <form name="SSOForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.googleSsoEnabled" aria-label="Google_SSO_enabled"><span translate="SETTINGS.GOOGLE_SSO_ENABLED">Google_SSO_enabled</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.adSsoEnabled" aria-label="AD_SSO_enabled"><span translate="SETTINGS.AD_SSO_ENABLED">AD_SSO_enabled</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="vm.license.ai" class="general-detail-form-container aitools md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.AITOOLS">AITOOLS</div>\n </div>\n <form name="aiToolsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.LANGUAGE">Language</label>\n <md-select name="language" ng-model="vm.general.language" autofocus required>\n <md-option ng-value="\'en-US\'">US English</md-option>\n <md-option ng-value="\'en-AU\'">Australian English</md-option>\n <md-option ng-value="\'en-GB\'">British English</md-option>\n <md-option ng-value="\'en-AB\'">Scottish English</md-option>\n <md-option ng-value="\'en-WL\'">Welsh English</md-option>\n <md-option ng-value="\'en-IE\'">English (Ireland)</md-option>\n <md-option ng-value="\'en-IN\'">Indian English</md-option>\n <md-option ng-value="\'hi-IN\'">Hindi (India)</md-option>\n <md-option ng-value="\'fr-CA\'">Canadian French</md-option>\n <md-option ng-value="\'fr-FR\'">French</md-option>\n <md-option ng-value="\'de-DE\'">German</md-option>\n <md-option ng-value="\'de-CH\'">German (Switzerland)</md-option>\n <md-option ng-value="\'it-IT\'">Italian</md-option>\n <md-option ng-value="\'es-ES\'">Spanish</md-option>\n <md-option ng-value="\'es-Us\'">US Spanish</md-option>\n <md-option ng-value="\'pt-BR\'">Brazilian Portuguese</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese(Portugal)</md-option>\n <md-option ng-value="\'ar-SA\'">Modern Standard Arabic</md-option>\n <md-option ng-value="\'ar-AE\'">Arabic</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese Mandarin - Mainland</md-option>\n <md-option ng-value="\'ja-JP\'">Japanese (Japan)</md-option>\n <md-option ng-value="\'ko-KR\'">Korean (Korea)</md-option>\n <md-option ng-value="\'he-IL\'">Hebrew (Israel) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'ms-MY\'">Malay (Malaysia) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'fa-IR\'">Farsi (Iran) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'ru-RU\'">Russian (Russia) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'te-IN\'">Telugu(India) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'ta-IN\'">Tamil - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'nl-NL\'">Dutch - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'tr-TR\'">Turkish (Turkey) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'id-ID\'">Indonesian(Indonesia) - This language is not available for the Sentiment Analysis</md-option>\n </md-select>\n <div ng-messages="aiToolsForm[\'language\'].$error" ng-show="aiToolsForm[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LANGUAGE_REQUIRED">Language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.BUCKET">Bucket</label>\n <input type="text" name="bucket" ng-model="vm.general.bucket" ng-required="true">\n\n <div ng-messages="aiToolsForm[\'bucket\'].$error" ng-show="aiToolsForm[\'bucket\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.BUCKET_REQUIRED">Bucket field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.transcribe" aria-label="Transcribe"><span translate="SETTINGS.TRANSCRIBE">Transcribe</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n <label translate="SETTINGS.TRANSCRIBEREGION">TranscribeRegion</label>\n <md-select name="transcribeRegion" ng-model="vm.general.transcribeRegion" required>\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-east-2\'">US East (Ohio)</md-option>\n <md-option ng-value="\'us-east-2\'">US West (N. California)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'ap-south-1\'">Asia Pacific (Mumbai)</md-option>\n <md-option ng-value="\'ap-east-1\'">Asia Pacific (Hong Kong)</md-option>\n <md-option ng-value="\'ap-northeast-2\'">Asia Pacific (Seoul)</md-option>\n <md-option ng-value="\'ap-southeast-1\'">Asia Pacific (Singapore)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n <md-option ng-value="\'ap-northeast-1\'">Asia Pacific (Tokyo)</md-option>\n <md-option ng-value="\'ca-central-1\'">Canada (Central)</md-option>\n <md-option ng-value="\'eu-central-1\'">Europe (Frankfurt)</md-option>\n <md-option ng-value="\'eu-west-1\'">Europe (Ireland)</md-option>\n <md-option ng-value="\'eu-west-2\'">Europe (London)</md-option>\n <md-option ng-value="\'eu-west-3\'">Europe (Paris)</md-option>\n <md-option ng-value="\'me-south-1\'">Middle East (Bahrain)</md-option>\n <md-option ng-value="\'sa-east-1\'">South America (São Paulo)</md-option>\n </md-select>\n <div ng-messages="aiToolsForm[\'transcribeRegion\'].$error" ng-show="aiToolsForm[\'transcribeRegion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TRANSCRIBEREGION_REQUIRED">TranscribeRegion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n <label translate="SETTINGS.TRANSCRIBEACCOUNT">TranscribeAccount</label>\n <md-select name="transcribeAccountId" ng-model="vm.general.transcribeAccountId" required>\n <md-option ng-value="transcribeAccountId.id" ng-repeat="transcribeAccountId in vm.cloudProviders" ng-disabled="transcribeAccountId.canSelect === false">{{ transcribeAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="aiToolsForm[\'transcribeAccountId\'].$error" ng-show="aiToolsForm[\'transcribeAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TRANSCRIBEACCOUNT_REQUIRED">TranscribeAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n'+" <md-input-container ng-if=\"vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n <md-switch ng-model=\"vm.general.sentiment\" aria-label=\"SentimentAnalysis\"><span translate=\"SETTINGS.SENTIMENTANALYSIS\">SentimentAnalysis</span></md-switch>\n </md-input-container>\n <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n <label translate=\"SETTINGS.SENTIMENTREGION\">SentimentRegion</label>\n <md-select name=\"sentimentRegion\" ng-model=\"vm.general.sentimentRegion\" required>\n <md-option ng-value=\"'us-east-1'\">US East (N. Virginia)</md-option>\n <md-option ng-value=\"'us-east-2'\">US East (Ohio)</md-option>\n <md-option ng-value=\"'us-west-2'\">US West (Oregon)</md-option>\n <md-option ng-value=\"'ap-south-1'\">Asia Pacific (Mumbai)</md-option>\n <md-option ng-value=\"'ap-northeast-2'\">Asia Pacific (Seoul)</md-option>\n <md-option ng-value=\"'ap-southeast-1'\">Asia Pacific (Singapore)</md-option>\n <md-option ng-value=\"'ap-southeast-2'\">Asia Pacific (Sydney)</md-option>\n <md-option ng-value=\"'ap-northeast-1'\">Asia Pacific (Tokyo)</md-option>\n <md-option ng-value=\"'ca-central-1'\">Canada (Central)</md-option>\n <md-option ng-value=\"'eu-central-1'\">Europe (Frankfurt)</md-option>\n <md-option ng-value=\"'eu-west-1'\">Europe (Ireland)</md-option>\n <md-option ng-value=\"'eu-west-2'\">Europe (London)</md-option>\n </md-select>\n <div ng-messages=\"aiToolsForm['sentimentRegion'].$error\" ng-show=\"aiToolsForm['sentimentRegion'].$touched\" role=\"alert\">\n <div ng-message=\"required\">\n <span translate=\"SETTINGS.ERRORS.SENTIMENTREGION_REQUIRED\">SentimentRegion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n <label translate=\"SETTINGS.SENTIMENTACCOUNT\">SentimentAccount</label>\n <md-select name=\"sentimentAccountId\" ng-model=\"vm.general.sentimentAccountId\" required>\n <md-option ng-value=\"sentimentAccountId.id\" ng-repeat=\"sentimentAccountId in vm.cloudProviders\" ng-disabled=\"sentimentAccountId.canSelect === false\">{{ sentimentAccountId.name }}</md-option>\n </md-select>\n <div ng-messages=\"aiToolsForm['sentimentAccountId'].$error\" ng-show=\"aiToolsForm['sentimentAccountId'].$touched\" role=\"alert\">\n <div ng-message=\"required\">\n <span translate=\"SETTINGS.ERRORS.SENTIMENTACCOUNT_REQUIRED\">SentimentAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n \x3c!-- <div>\n <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n REQUEST LICENSE\n </md-button>\n </div> --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n \x3c!-- LICENSE CARD --\x3e\n <div layout="row" flex>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="row" layout-align="center">\n <div flex layout="row" layout-align="start center">\n <div ng-if="!vm.license.custom">\n <a href="https://www.xcally.com/plans.html" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n <md-icon md-font-icon="icon-coin"></md-icon>\n </a>\n </div>\n </div>\n <div flex>\n <div ng-switch="vm.license.months" class="text-center">\n <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n <span ng-switch-when="1200" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n </div>\n </div>\n <div flex layout="row" layout-align="end center">\n <div>\n <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n <md-icon md-font-icon="icon-pencil"></md-icon>\n </md-button>\n <md-button type="submit" ng-if="vm.isAdmin" ng-click="vm.downloadLogFile()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.DOWNLOAD_LICENSE_LOG_FILE">Download license log file</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <span ng-if="!vm.license.demo && !vm.license.gray && vm.license.months != 36" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" id="licenseUuid" class="hover-token text-italic text-bold">{{vm.license.uuid}}</span>\n \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip>\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </md-button>--\x3e\n </span>\n\n <div layout="column">\n <span ng-if="vm.license.grayReason == \'changed\'" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span id="licenseMachineUuid" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" class="hover-token text-italic text-bold">{{vm.license.machineUuid}}</span>\n \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip> \n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </md-button>--\x3e\n </span>\n <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n <span ng-if="vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_DISABLED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_CHANGED_ADVISE\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n </div>\n\n <div ng-if="vm.license.demo" layout="column">\n <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n <p translate="SETTINGS.USERS">Users</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n <p translate="SETTINGS.AGENTS">Agents</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n <p translate="SETTINGS.TELEPHONES">Telephones</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:6">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <div ng-repeat="session in vm.sessions" flex="33">\n <md-list-item class="md-2-line">\n <md-icon md-font-icon="{{session.icon}}" class="md-avatar-icon" ng-class="vm.license[session.enabled] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <div layout="row" layout="start center">\n <h3 translate="SETTINGS.{{session.name | uppercase}}"></h3>\n <button ng-if="session.restart" ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n <md-tooltip>Restart</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </button>\n </div>\n <p ng-if="vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">{{vm.license[session.name]}} {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">UNLIMITED {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.enabled]" class="red-A700-fg">{{ \'SETTINGS.DISABLED\' | translate }}</p>\n </div>\n </md-list-item>\n\n </div>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3" flex="33">\n <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3:3" flex="33">\n <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3" flex="33">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n <p ng-class="vm.license[other.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[other.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3:3" flex="33">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+" <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n </md-card>\n </div>\n \x3c!-- / LICENSE CARD --\x3e\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n <form name="requestForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.license.name" required>\n <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.license.email" required>\n <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PLAN">Plan</label>\n <md-select name="plan" ng-model="vm.license.months" required>\n <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n <md-option ng-value="1200"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n </md-select>\n <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.USERS">Users</label>\n <input type="number" name="users" ng-model="vm.license.users" required>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.AGENTS">Agents</label>\n <input type="number" name="agents" ng-model="vm.license.agents" required>\n <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.TELEPHONES">Telephones</label>\n <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <div layout="row">\n <md-input-container ng-repeat="session in vm.sessions" class="md-block" flex="50">\n <label>{{ \'SETTINGS.\' + session.name | uppercase | translate }} ({{ \'SETTINGS.\' + session.label | uppercase | translate }})</label>\n <input type="number" name="{{session.name}}" ng-model="vm.license[session.name]" required>\n <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n <div ng-messages="requestForm[session.name].$error" ng-show="requestForm[session.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHANNEL_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[addon.name]" aria-label="{{module.name}}" ng-repeat="addon in vm.addons"><span translate="SETTINGS.{{addon.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}" ng-repeat="other in vm.others"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <textarea name="description" ng-model="vm.license.description"></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/license/update/dialog.html",'<md-dialog class="update-dialog" aria-label="Update License">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.UPDATE_LICENSE">Update License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-content layout="row">\n <span class="md-title" translate="SETTINGS.UPDATE_LICENSE_MANUALLY">Do you want to update your license manually?</span>\n </md-content>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ENTER_LICENSE">Enter your license</label>\n <textarea name="key" ng-model="vm.licenseKey" required></textarea>\n <div ng-messages="updateForm.name.$error" ng-show="updateForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LICENSE_REQUIRED">License key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.updateLicense()" class="send-button md-accent md-raised" ng-disabled="updateForm.$invalid || updateForm.$pristine" aria-label="UPDATE" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n <form name="networkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.network.type" autofocus required>\n <md-option ng-value="\'localnet\'">LocalNET</md-option>\n <md-option ng-value="\'externip\'">ExternIP</md-option>\n <md-option ng-value="\'turn\'">Turn</md-option>\n <md-option ng-value="\'stun\'">Stun</md-option>\n </md-select>\n <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'turn\' || vm.network.type == \'stun\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-required="true">\n\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n <label translate="SETTINGS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.network.username" ng-required="vm.network.type == \'turn\'">\n\n <div class="hint"><span translate="SETTINGS.HELP.USERNAME"></span></div>\n <div ng-messages="networkForm[\'username\'].$error" ng-show="networkForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n <label translate="SETTINGS.PASSWORD">Password</label>\n <input type="text" name="password" ng-model="vm.network.password" ng-required="vm.network.type == \'turn\'">\n\n <div class="hint"><span translate="SETTINGS.HELP.PASSWORD"></span></div>\n <div ng-messages="networkForm[\'password\'].$error" ng-show="networkForm[\'password\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n ADD NETWORK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-networks-count">\n <span>{{vm.selectedNetworks.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- NETWORK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.networks.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.editdialog(network, $event )" translate="SETTINGS.EDIT_NETWORK">\n Edit Network\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.deleteconfirm(network, $event )" translate="SETTINGS.DELETE_NETWORK">\n Delete Network\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / NETWORK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD NETWORK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.mailAccount.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n VERIFY\n </md-button>\n <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="(generalForm.$pristine) || (generalForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n <div class="main scrollable">\n <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Name field required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.mailAccount.description">\n </md-input-container>\n\n <md-input-container class="md-block mt-0">\n <label translate="SETTINGS.EMAILADDRESS">Email Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Email Address field required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.WRONG_FORMAT">Email Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block mt-30">\n <label translate="SETTINGS.SMTP_SERVICE">Service</label>\n <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Service field required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.mailAccount.provider === \'custom\'">\n <md-input-container class="md-block mt-30">\n <label translate="SETTINGS.SMTP_HOST">Host</label>\n <input type="text" name="host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Host field required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_PORT">Port</label>\n <input type="number" name="port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n <div ng-messages="generalForm[\'port\'].$error" ng-show="generalForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Port field required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="SMTP Secure"><span translate="SETTINGS.SMTP_SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="SMTP Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n </div>\n\n <div ng-if="vm.mailAccount.Smtp.authentication || (vm.mailAccount.provider && vm.mailAccount.provider !== \'custom\')">\n <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.mailAccount.Smtp.user" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Username field required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select name="cloudProvider" ng-model="vm.mailAccount.Smtp.CloudProviderId" required>\n <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n <div ng-messages="generalForm[\'cloudProvider\'].$error" ng-show="generalForm[\'cloudProvider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="!vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n <label translate="SETTINGS.SMTP_PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Password field required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n\n </div>\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget flex="50" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg">\n <div class="h3">OS</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n <div class="h4">Node.js: {{vm.system.node}}</div>\n <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n <div class="h3">CPU</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">MEM</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n </div>\n <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">DISK {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">NET {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n <div class="h4">IPv4: {{net.ip4}}</div>\n <div class="h4">IPv6: {{net.ip6}}</div>\n <div class="h4">MAC: {{net.mac}}</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row">\n <div flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>pmem</th>\n <th md-column>pcpu</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.command}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\n \'green-600-bg\': process.state == \'running\',\n \'yellow-600-bg\': process.state == \'sleeping\',\n \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n </td>\n <td md-cell>{{process.pmem}}%</td>\n <td md-cell>{{process.pcpu}}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>id</th>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>MEM</th>\n <th md-column>CPU</th>\n <th md-column width="20px">Actions</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n <td md-cell>{{process.pm_id}}</td>\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n </td>\n <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n <td md-cell>{{process.monit.cpu}}%</td>\n <td md-cell>\n <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n </md-button>\n <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n <td md-cell></td>\n <td md-cell></td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr>\n <td md-cell class="no-border">pm2 list</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 start <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 stop <id | name | all></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 restart <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 logs [id | name]</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content>\n <div layout="row" layout-align="center center">\n <div ng-if="vm.updating" layout="column" layout-align="center center">\n <span class="text-center md-title">Grab a quick coffee and</span>\n <span class="text-center md-title">get back here as soon as completed!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n <div ng-if="!vm.updating">\n <div ng-if="vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n <span class="text-center md-title">In order to complete the update,</span>\n <span class="text-center md-title">please click on reload button</span>\n </div>\n <div ng-if="!vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Error!</span>\n <span class="text-center md-title">Please contact your administrator!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n </div>\n <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n </div>\n </md-dialog-content>\n\n <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n RELOAD\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n \x3c!-- UPDATE CARD --\x3e\n <div layout="row" ng-if="!vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n </div>\n </md-card>\n </div>\n \x3c!-- / UPDATE CARD --\x3e\n\n <div ng-if="vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n\n <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'baseUrl\'].$error" ng-show="smsAccountForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'apiKey\'].$error" ng-show="smsAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.ACCOUNTID">AccountId</label>\n <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'accountId\'].$error" ng-show="smsAccountForm[\'accountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.APPLICATIONID">ApplicationID</label>\n <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'applicationId\'].$error" ng-show="smsAccountForm[\'applicationId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n\n <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n ADD SMSACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",'<md-dialog class="smsAccount-dialog" aria-label="smsAccount" ng-init="vm.onInit()">\n <form name="smsAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSACCOUNT">Add Agent to smsAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'accesskeyid\'].$error" ng-show="smsAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'secretaccesskey\'].$error" ng-show="smsAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'lexregion\'].$error" ng-show="smsAccountFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'botname\'].$error" ng-show="smsAccountFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'key\'].$error" ng-show="smsAccountFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'projectId\'].$error" ng-show="smsAccountFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'clientEmail\'].$error" ng-show="smsAccountFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'privateKey\'].$error" ng-show="smsAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/tag/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'tag\'].$error" ng-show="smsAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n\n <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n ADD SMSCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsAccount-image" hide-xs>\n <img ng-src="assets/images/business/smsAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsAccount.id}}\n <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.ACCOUNTID">AccountId</label>\n <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accountId\'].$error" ng-show="generalForm[\'accountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.APPLICATIONID">ApplicationID</label>\n <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'applicationId\'].$error" ng-show="generalForm[\'applicationId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'|| vm.smsAccount.type == \'csc\'|| vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.SENDERSTRING">SenderString</label>\n <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\'" class="md-block">\n <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.smsAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.RECEIVEURL">receiveUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container ng-if="( ((vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\') && vm.smsAccount.deliveryReport) || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token + (vm.smsAccount.type == \'csc\' ? \'&message-id={message-id}&state={state}\' : \'\')" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.smsAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.queueTransfer == true" class="md-block">\n <label translate="SMS.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.smsAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.agentTransfer == true" class="md-block">\n <label translate="SMS.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.smsAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus disabled>\n\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.mandatoryDisposition" class="md-block">\n <label translate="SMS.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.smsAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="SmsAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add sms dispositions" translate translate-attr-label="SMS.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getSmsAccountSmsCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'SMS.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'SMS.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'SMS.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'SMS.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'SMS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{ smsCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n Edit SmsCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n Delete SmsCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="SMS.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getSmsAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getSmsAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'SMS.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'SMS.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'SMS.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'SMS.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'SMS.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'SMS.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'SMS.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'SMS.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'SMS.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.smsInteractionDownload(interaction, $event)" translate="SMS.DOWNLOAD_INTERACTION">\n Download\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsAccounts-count">\n <span>{{vm.selectedSmsAccounts.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SMSACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':smsAccount.ListId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(smsAccount, $event )" translate="SMS.EDIT_SMSACCOUNT">\n Edit SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(smsAccount, $event )" translate="SMS.INTERACTIONS_SMSACCOUNT">\n Interactions SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(smsAccount, $event )" translate="SMS.AGENTADD_SMSACCOUNT">\n AgentAdd SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(smsAccount, $event )" translate="SMS.DELETE_SMSACCOUNT">\n Delete SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}" md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n <form name="smsQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n\n <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n ADD SMSQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsQueue-image" hide-xs>\n <img ng-src="assets/images/business/smsQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsQueue.id}}\n <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsQueues-count">\n <span>{{vm.selectedSmsQueues.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SMSQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(smsQueue, $event )" translate="SMS.EDIT_SMSQUEUE">\n Edit SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(smsQueue, $event )" translate="SMS.TEAMADD_SMSQUEUE">\n teamadd SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(smsQueue, $event )" translate="SMS.AGENTADD_SMSQUEUE">\n agentadd SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(smsQueue, $event )" translate="SMS.DELETE_SMSQUEUE">\n Delete SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event )" translate="SMS.GOTOREALTIME_SMSQUEUE">\n goToRealtime SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}" md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-agents-count">\n <span>{{vm.selectedAgents.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- AGENT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="showWebBar">{{ \'STAFF.SHOWWEBCONTROL\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n <td md-cell ng-if="!agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="name">{{agent.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="showWebBar">{{ agent.showWebBar | getOptionByValue: vm.showWebBarOptions }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="email">{{agent.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="phone">{{agent.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="mobile">{{agent.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="internal">{{agent.internal}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="disabled">\n <md-icon md-colors="{color: {{agent.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="blocked">\n <md-icon md-colors="{color: {{agent.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="client-side-logging">\n <ms-client-side-logging-icon user="agent"></ms-client-side-logging-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(agent, $event )" translate="STAFF.EDIT_AGENT">\n Edit Agent\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(agent, $event )" translate="STAFF.TEAMADD_AGENT">\n teamadd Agent\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(agent, $event )" translate="STAFF.DELETE_AGENT">\n Delete Agent\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / AGENT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD AGENT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.setting.filterFullName" class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.setting.filterFullName" class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-pattern="/^[A-Za-z0-9\\ \\_\\-]+$/i" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.FILTERFULLNAME"></span></div>\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.FULLNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\ \\_\\-]+$/i\' }">Fullname must be valid pattern</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n\n <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n\n <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="agentForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent && (vm.newAgent)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n\n <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.agent.userSetting">\n <ms-client-side-logging user="vm.agent"></ms-client-side-logging>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true">\n\n <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n ADD AGENT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.agent.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="agentForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n\n\n\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.channel === \'voice\'">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" add-disabled="vm.channel === \'voice\' && vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveQueues()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="agent-image" hide-xs>\n <img ng-src="assets/images/business/agents.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.agent.id}}\n <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div ng-cloak>\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.whatsapp" aria-label="whatsapp" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'whatsapp\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="WHATSAPP.WHATSAPP">whatsapp</span></md-tooltip>\n <md-icon md-font-icon="icon-whatsapp" aria-label="whatsapp"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveAgent()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (download_permissionsForm.$invalid) || (permissionsForm.$invalid) || (autoAnswerForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container ng-if="!vm.setting.filterFullName" class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.setting.filterFullName" class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-pattern="/^[A-Za-z0-9\\ \\_\\-]+$/i" ng-required="true" autofocus>\n <div class="hint"><span translate="STAFF.HELP.FILTERFULLNAME"></span></div>\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.FULLNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\ \\_\\-]+$/i\' }">Fullname must be valid pattern</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.agent.phone" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.agent.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 1" class="md-block">\n <md-switch ng-model="vm.agent.hotdesk" aria-label="Hotdesk" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.HOTDESK">Hotdesk</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus disabled>\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" disabled>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.disabled == 0" class="md-block">\n <md-switch ng-model="vm.agent.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n </div>\n <form name="authenticationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus disabled>\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.agent.transport" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.HOST">Host</label>\n <input type="text" name="host" ng-model="vm.agent.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.agent.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TYPE">Type</label>\n <md-select name="type" ng-model="vm.agent.type" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.agent.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.setting.filterFullName" class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input ng-readonly="vm.setting.filterFullName" type="text" name="callerid" ng-model="vm.agent.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.setting.filterFullName" class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.agent.callerid" ng-pattern="/^[A-Za-z0-9\\ \\_\\-\\<\\>\\x22]+$/i" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.CALLERID_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\ \\_\\-\\<\\>\\x22]+$/i\' }">CallerId must be valid pattern</span>\n </div>\n </div>\n \n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.agent.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.agent.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.agent.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n </div>\n <form name="capacityForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n <label translate="STAFF.WHATSAPPCAPACITY">WhatsappCapacity</label>\n <input type="number" name="whatsappCapacity" ng-model="vm.agent.whatsappCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.WHATSAPPCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'whatsappCapacity\'].$error" ng-show="capacityForm[\'whatsappCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_REQUIRED">WhatsappCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WhatsappCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container auto_answer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.AUTO_ANSWER">AUTO_ANSWER</div>\n </div>\n <form name="autoAnswerForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <md-switch ng-model="vm.agent.chatAutoanswer" aria-label="chatAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.CHAT_AUTOANSWER">ChatAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.chatAutoanswer" class="md-block">\n <label translate="STAFF.CHAT_AUTOANSWERDELAY">ChatAutoAnswerDelay</label>\n <input type="number" name="chatAutoAnswerDelay" ng-model="vm.agent.chatAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <md-switch ng-model="vm.agent.emailAutoanswer" aria-label="emailAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.EMAIL_AUTOANSWER">EmailAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.emailAutoanswer" class="md-block">\n <label translate="STAFF.EMAIL_AUTOANSWERDELAY">EmailAutoAnswerDelay</label>\n <input type="number" name="emailAutoAnswerDelay" ng-model="vm.agent.emailAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <md-switch ng-model="vm.agent.smsAutoanswer" aria-label="smsAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.SMS_AUTOANSWER">SmsAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.smsAutoanswer" class="md-block">\n <label translate="STAFF.SMS_AUTOANSWERDELAY">SmsAutoAnswerDelay</label>\n <input type="number" name="smsAutoAnswerDelay" ng-model="vm.agent.smsAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <md-switch ng-model="vm.agent.openchannelAutoanswer" aria-label="openchannelAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.OPENCHANNEL_AUTOANSWER">openchannelAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.openchannelAutoanswer" class="md-block">\n <label translate="STAFF.OPENCHANNEL_AUTOANSWERDELAY">openchannelAutoAnswerDelay</label>\n <input type="number" name="openchannelAutoAnswerDelay" ng-model="vm.agent.openchannelAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <md-switch ng-model="vm.agent.faxAutoanswer" aria-label="faxAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.FAX_AUTOANSWER">faxAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.faxAutoanswer" class="md-block">\n <label translate="STAFF.FAX_AUTOANSWERDELAY">faxAutoAnswerDelay</label>\n <input type="number" name="faxAutoAnswerDelay" ng-model="vm.agent.faxAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n <md-switch ng-model="vm.agent.whatsappAutoanswer" aria-label="whatsappAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.WHATSAPP_AUTOANSWER">whatsappAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.whatsappAutoanswer" class="md-block">\n <label translate="STAFF.WHATSAPP_AUTOANSWERDELAY">whatsappAutoAnswerDelay</label>\n <input type="number" name="whatsappAutoAnswerDelay" ng-model="vm.agent.whatsappAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 0">\n <md-tab-label>\n <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n <md-switch ng-change="vm.onEnableScreenRecordingByAgentSelection()" ng-model="vm.agent.phoneBarEnableScreenRecordingByAgent" aria-label="EnableScreenRecordingByAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESCREENRECORDINGBYAGENT">EnableScreenRecordingByAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n <md-switch ng-change="vm.onEnableAutomaticScreenRecordingSelection()" ng-model="vm.agent.phoneBarEnableAutomaticScreenRecording" aria-label="EnableAutomaticScreenRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEAUTOMATICSCREENRECORDING">EnableAutomaticScreenRecording</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.ENABLEAUTOMATICSCREENRECORDING"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n </div>\n <form name="remote_controlForm" novalidate>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n </div>\n <form name="sipForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPPORT">SipPort</label>\n <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n </div>\n <form name="callforwardingForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 2">\n <md-tab-label>\n <span translate="STAFF.WEBRTC">WEBRTC</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n </div>\n <form name="settings_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.WSS_PORT">WSS_Port</label>\n <input type="number" name="wssPort" ng-model="vm.agent.wssPort" min="0" value="8089" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.WSS_PORT"></span></div>\n <div ng-messages="settings_webrtcForm[\'wssPort\'].$error" ng-show="settings_webrtcForm[\'wssPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.WSS_PORT_REQUIRED">WSS_Port field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.WSS_PORT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WSS_Port must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.ignorePauseForPreviewCalls" aria-label="Ignore agent break status for preview calls" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS">Ignore agent break status for preview calls</span></md-switch>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n </div>\n <form name="sip_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.messengerSoundNotification" aria-label="EnableMessengerSoundNotification" \n ng-if="vm.agent.allowmessenger">\n <span translate="STAFF.MESSENGERSOUNDNOTIFICATION">MessengerSoundNotification</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block"> \n <md-switch ng-model="vm.agent.phoneBarPrefixRequired" aria-label="PrefixRequired" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.PREFIXREQUIRED">PrefixRequired</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.selectRecallMeCampaign" aria-label="Select_RecallMe_Campaign" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SELECT_RECALLME_CAMPAIGN">Select_RecallMe_Campaign</span></md-switch>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n </div>\n <form name="download_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)" \n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n <md-divider></md-divider>\n <md-list>\n <md-list-item ng-repeat="child in father.children" ng-if="child.id !== 201">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"\n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n CLIENT-SIDE LOGS\n </div>\n </div>\n <ms-client-side-logging user="vm.agent" on-user-update="vm.refreshAgent()"></ms-client-side-logging>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n <form name="teamForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n\n <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.team.description">\n\n <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n ADD TEAM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team" ng-init="vm.onInit()">\n <form name="teamForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-teams-count">\n <span>{{vm.selectedTeams.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TEAM TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.teams.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(team, $event )" translate="STAFF.EDIT_TEAM">\n Edit Team\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(team, $event )" translate="STAFF.AGENTADD_TEAM">\n AgentAdd Team\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(team, $event )" translate="STAFF.DELETE_TEAM">\n Delete Team\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEAM TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEAM BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n\n <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n\n <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newTelephone">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newTelephone && (vm.newTelephone)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n\n <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n ADD TELEPHONE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.telephone.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="telephoneForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n\n\n\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="telephone-image" hide-xs>\n <img ng-src="assets/images/business/telephones.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.telephone.id}}\n <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTelephone()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n </div>\n <form name="accountForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.telephone.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.telephone.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.telephone.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.telephone.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.telephone.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.telephone.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.telephone.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.telephone.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.telephone.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ENCRYPTION">Encryption</label>\n <md-select name="encryption" ng-model="vm.telephone.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-telephones-count">\n <span>{{vm.selectedTelephones.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TELEPHONE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(telephone, $event )" translate="STAFF.EDIT_TELEPHONE">\n Edit Telephone\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(telephone, $event )" translate="STAFF.DELETE_TELEPHONE">\n Delete Telephone\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TELEPHONE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TELEPHONE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/userProfiles/create/dialog.html",'<md-dialog class="userProfile-dialog" aria-label="New UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUserProfile" ng-click="vm.saveUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid || userProfileForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUserProfile" ng-click="vm.addNewUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USERPROFILE" translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n ADD USERPROFILE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUserProfile" ng-click="vm.deleteUserProfile($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/clone/clone.html",'<md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="CLONE" translate="STAFF.CLONE_USERPROFILE" translate-attr-aria-label="STAFF.CLONE_USERPROFILE">\n CLONE USERPROFILE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",'<md-dialog class="userProfile-dialog" aria-label="userProfile">\n <form name="userProfileForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog($event)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div layout="column" class="padding-bottom-10">\n <div layout="row" class="padding-bottom-10">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.SECTIONS">Sections</label>\n <md-select name="sections" ng-model="vm.selectedSection" placeholder="{{\'STAFF.PERMISSIONS_SELECT_SECTION\' | translate}}" ng-change="vm.onChangeSection()" required>\n <md-option ng-value="subsection" ng-repeat="subsection in vm.subsections" ng-selected="{{vm.subsections.length === 1 ? \'true\' : \'false\'}}">{{subsection.translate | translate}}</md-option>\n </md-select>\n </md-input-container>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10">\n <md-button ng-switch="vm.selectedSection.enabled" class="md-icon-button md-fab md-mini size-8 padding-10" ng-class="vm.selectedSection.enabled ? \'blue-500-bg\' : \'grey-A400-bg\'" ng-click="vm.onChangeVisibility()" aria-label="Visibility">\n <md-icon ng-switch-when="true" md-font-icon="icon-eye" aria-label="Visible section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_HIDE\' | translate}}</md-tooltip>\n </md-icon>\n <md-icon ng-switch-when="false" md-font-icon="icon-eye-off" aria-label="Hidden section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_SHOW\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <div>\n <md-button class="md-icon-button md-fab md-mini size-8 green-A700-bg no-margin" ng-disabled="true">\n <md-icon md-font-icon="icon-monitor" class="md-background-fg" aria-label="Read permission">\n <md-tooltip>{{\'STAFF.READ_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowEdit ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'edit\')">\n <md-icon md-font-icon="icon-pencil" aria-label="Edit permission">\n <md-tooltip>{{\'STAFF.EDIT_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowDelete ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'delete\')">\n <md-icon md-font-icon="icon-delete" aria-label="Delete permission">\n <md-tooltip>{{\'STAFF.DELETE_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-switch ng-model="vm.selectedSection.autoAssociation" class="no-margin padding-right-10" aria-label="Auto association" ng-change="vm.onChangeAutoAssociation()">\n </md-switch>\n <p class="no-margin font-size-12 line-height-30">{{\'STAFF.PERMISSIONS_AUTO_ASSOCIATION_INFO\' | translate}}</p>\n </div>\n <div layout="row" ng-show="vm.selectedSection && vm.selectedSection.title === \'Reports\' && !vm.selectedSection.autoAssociation" class="margin-bottom-10 margin-top-30" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.REPORT_TYPE">Report Type</label>\n <md-select name="type" ng-model="vm.selectedSection.reportType" placeholder="{{\'STAFF.PERMISSIONS_SELECT_REPORT_TYPE\' | translate}}" ng-change="vm.onChangeReportType()" required>\n <md-option ng-value="\'default\'">Default</md-option>\n <md-option ng-value="\'custom\'">Custom</md-option>\n </md-select>\n </md-input-container>\n </div>\n <div ng-show="vm.selectedSection && vm.selectedSection.title === \'Dashboards\'" class="user-profile-section-help margin-bottom-10 margin-top-20">\n <md-icon md-font-icon="icon-help" aria-label="Dashboards help"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.CUSTOM_DASHBOARDS_PERMISSIONS"></span>\n </div>\n </div>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association" ng-hide="vm.selectedSection.autoAssociation"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center">\n <div>\n <md-icon md-font-icon="icon-information-outline" aria-label="Delete permission"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.SAVE_PERMISSIONS"></span>\n </div>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveSection()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/view.html",'<div id="staff-userProfile" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-userProfiles-button md-icon-button" aria-label="Go to userProfiles" ng-click="vm.gotoUserProfiles()" translate translate-attr-aria-label="STAFF.GO_TO_USERPROFILES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="userProfile-image" hide-xs>\n <img ng-src="assets/images/business/userProfiles.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.userProfile.id}}\n <span ng-if="vm.userProfile.name">{{vm.userProfile.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.userProfile.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.userProfile, $event)" class="md-fab md-amber-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="STAFF.CLONE_USERPROFILE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUserProfile()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (modulesForm.$invalid) || (download_permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'crudPermissions\'].$error" ng-show="generalForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container modules md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.MODULES">MODULES</div>\n </div>\n <div ng-controller="UserProfilePermissionsController as vm_pc" ng-init="vm_pc.init(vm.userProfile, vm.license)" class="userProfile-detail-form-container">\n <md-grid-list flex md-cols-gt-xs="2" md-cols-gt-sm="2" md-cols-gt-md="4" md-cols-gt-lg="6" md-row-height-gt-xs="2:1" md-row-height-gt-sm="3:1" md-row-height-gt-md="3:1" gt-xs-gutter="4px" gt-sm-gutter="4px" gt-md-gutter="16px" gt-lg-gutter="16px">\n <md-grid-tile ng-repeat="father in vm_pc.modules" ng-if="vm_pc.userProfile.role !== \'admin\' && !father.permissions.hidden" md-colspan="2">\n <md-card flex-xs flex-gt-xs="90" layout="column" no-padding no-margin>\n <md-card-header>\n <md-card-avatar>\n <md-icon class="md-avatar-icon auto-size" md-font-icon="{{father.icon}}" ng-class="{ true: father.status.color }[true]">\n <md-tooltip>{{ father.status.info }}</md-tooltip>\n </md-icon>\n </md-card-avatar>\n <md-card-header-text layout-align="center start">\n <span class="md-title" translate="{{father.translate}}">{{ father.title }}</span>\n </md-card-header-text>\n <md-card-actions class="no-margin" layout="row" ng-init="vm_pc.checkSectionResources(father)" ng-if="father.status.tag != \'unlicensed\'">\n <md-switch class="auto-height no-margin" ng-model="father.allResourcesEnabled" ng-change="vm_pc.onChangeEnableAllResources(father)" aria-label="Enable all"></md-switch>\n <md-button class="md-mini auto-width" aria-label="Manage" ng-click="vm_pc.manageResources(father)" ng-hide="father.permissions && !father.permissions.association">\n <md-tooltip>{{\'STAFF.PERMISSIONS_MANAGE\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-cog"></md-icon>\n </md-button>\n </md-card-actions>\n <md-card-header-text ng-if="father.status.tag === \'unlicensed\'" layout-align="center end">\n <span class="md-subhead red-A700-fg">{{ father.status.name }}</span>\n </md-card-header-text>\n </md-card-header>\n </md-card>\n </md-grid-tile>\n </md-grid-list>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.DOWNLOADS">DOWNLOADS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n </div>\n <form name="download_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadCallySquareRecordings" aria-label="CallySquare_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CALLYSQUARE_RECORDINGS">CallySquare_Recordings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadContactManagerLists" aria-label="Contact_Manager_Lists" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CONTACT_MANAGER_LISTS">Contact_Manager_Lists</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadJscriptySessions" aria-label="Jscripty_Sessions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.JSCRIPTY_SESSIONS">Jscripty_Sessions</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadScreenRecordings" aria-label="Screen_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SCREEN_RECORDINGS">Screen_Recordings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/userProfiles/userProfiles.html",'<div id="userProfiles" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERPROFILES">UserProfiles</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUserProfiles.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUserProfiles =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-userProfiles-count">\n <span>{{vm.selectedUserProfiles.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUserProfiles()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUserProfiles()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUserProfiles" csv-label="true" filename="userProfiles.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedUserProfiles($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- USERPROFILE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUserProfiles" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUserProfiles">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="crudPermissions">{{ \'STAFF.CRUDPERMISSIONS\' | translate }}</th>\n <th md-column md-order-by="privacyEnabled">{{ \'STAFF.MASK_SENSITIVE_DATA\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.userProfiles.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="userProfile" md-select-id="id" ng-repeat="userProfile in vm.userProfiles.rows">\n <td md-cell ng-if="userProfile.userpic"><img class="avatar" alt="{{userProfile.name}}" ng-src="api/users/{{userProfile.id}}/avatar" /></td>\n <td md-cell ng-if="!userProfile.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{userProfile.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="id ">{{userProfile.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="name ">{{userProfile.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="description ">{{userProfile.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="crudPermissions ">{{userProfile.selectedcrudPermissions}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="privacyEnabled ">\n <md-icon md-colors="{color: {{userProfile.privacyEnabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{userProfile.privacyEnabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(userProfile, $event )" translate="STAFF.EDIT_USERPROFILE">\n Edit UserProfile\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(userProfile, $event )" translate="STAFF.CLONE_USERPROFILE">\n clone UserProfile\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n\n <md-button ng-click="vm.deleteconfirm(userProfile, $event )" translate="STAFF.DELETE_USERPROFILE">\n Delete UserProfile\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.userProfiles.count}}" md-on-paginate="vm.getUserProfiles" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USERPROFILE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USERPROFILE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-userProfile-button" ng-click="vm.createOrEditUserProfile($event)" aria-label="add userProfile" translate translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USERPROFILE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required ng-disabled="!vm.newUser">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required>\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="userForm[\'userProfileId\'].$error" ng-show="userForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n\n <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n\n <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="userForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser && (vm.newUser)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n\n <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n\n <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.user.userSetting">\n <ms-client-side-logging user="vm.user"></ms-client-side-logging>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n ADD USER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.MANAGE_API_KEY\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-card layout-fill layout-padding>\n <textarea class="api-key-area" ng-model="vm.user.apiKey" rows="6" disabled></textarea>\n </md-card>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.generateApiKey()" class="send-button md-accent md-raised" aria-label="Generate" translate="{{ vm.user.apiKey === \'N/A\' ? \'STAFF.GENERATE\' : \'STAFF.REGENERATE\' }}" translate-attr-aria-label="STAFF.GENERATE">\n Generate\n </md-button>\n <md-button type="submit" ng-click="vm.removeApiKey()" class="send-button md-accent md-raised" aria-label="Remove" translate="STAFF.REMOVE" translate-attr-aria-label="STAFF.DELETE">\n Delete\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="userForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n\n\n\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="user-image" hide-xs>\n <img ng-src="assets/images/business/users.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.user.id}}\n <span ng-if="vm.user.name">{{vm.user.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.apikeymanagerdialog(vm.user, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="apikeymanager">\n <md-tooltip><span translate="STAFF.APIKEYMANAGER_USER"></span></md-tooltip>\n <md-icon md-font-icon="fab fa-hubspot"></md-icon>\n </md-button>\n </div>\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUser()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required disabled>\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'userProfileId\'].$error" ng-show="personal_infoForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.user.phone" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.user.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus disabled>\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" disabled>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.APIKEY">ApiKey</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: \'API Key copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n </div>\n <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\'" class="md-block">\n <md-switch ng-model="vm.user.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\' && vm.user.disabled == 0" class="md-block">\n <md-switch ng-model="vm.user.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="user-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n </div>\n <form name="authenticationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.user.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user, vm.crudPermissions)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="user-detail-form-container internal-chat md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.INTERNAL_MESSENGER">INTERNAL_MESSENGER</div>\n </div>\n <form name="internalChatForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.user.messengerSoundNotification" \n aria-label="messengerSoundNotification" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.MESSENGERSOUNDNOTIFICATION">MESSENGERSOUNDNOTIFICATION</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MESSENGERSOUNDNOTIFICATION"></span></div>\n </md-input-container>\n </form>\n </div> \n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus disabled>\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.user.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.user.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.user.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.user.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.user.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.user.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n CLIENT-SIDE LOGS\n </div>\n </div>\n <ms-client-side-logging user="vm.user" on-user-update="vm.refreshUser()"></ms-client-side-logging>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERS">Users</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-users-count">\n <span>{{vm.selectedUsers.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- USER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n <th md-column md-order-by="userProfileId">{{ \'STAFF.USERPROFILE\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.users.rows.length">\n <td md-cell colspan="11">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n <td md-cell ng-if="!user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="userProfileId font-weight-600">{{ (vm.userProfiles | filter : {\'id\':user.userProfileId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="disabled ">\n <md-icon md-colors="{color: {{user.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="blocked ">\n <md-icon md-colors="{color: {{user.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditAgent($event, user)" md-cell class="client-side-logging">\n <ms-client-side-logging-icon user="user"></ms-client-side-logging-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(user, $event )" translate="STAFF.EDIT_USER">\n Edit User\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n <md-button ng-click="vm.deleteconfirm(user, $event )" translate="STAFF.DELETE_USER">\n Delete User\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cannedAnswers-count">\n <span>{{vm.selectedCannedAnswers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CANNEDANSWER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(cannedAnswer, $event )" translate="TOOLS.EDIT_CANNEDANSWER">\n Edit CannedAnswer\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event )" translate="TOOLS.DELETE_CANNEDANSWER">\n Delete CannedAnswer\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CANNEDANSWER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n\n <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n ADD CANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/contact_item_types/contact_item_types.html",'<div id="contact_item_types" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CONTACTITEMTYPE">ContactItemType</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContactItemType.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContactItemType =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contact_item_types-count">\n <span>{{vm.selectedContactItemType.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContactItemType()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContactItemType()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContactItemType" csv-label="true" filename="contact_item_types.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContactItemType($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CONTACTITEMTYPE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContactItemType" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContactItemType">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="OrderBy">{{ \'TOOLS.ORDER_BY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contact_item_types.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contactItemType" md-select-id="id" ng-repeat="contactItemType in vm.contact_item_types.rows">\n <td md-cell ng-if="contactItemType.userpic"><img class="avatar" alt="{{contactItemType.name}}" ng-src="api/users/{{contactItemType.id}}/avatar" /></td>\n <td md-cell ng-if="!contactItemType.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{contactItemType.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="id ">{{contactItemType.id}}</td>\n <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="name ">{{contactItemType.name}}</td>\n <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="OrderBy ">{{contactItemType.OrderBy}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(contactItemType, $event )" translate="TOOLS.EDIT_CONTACTITEMTYPE">\n Edit ContactItemType\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(contactItemType, $event )" translate="TOOLS.DELETE_CONTACTITEMTYPE">\n Delete ContactItemType\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contact_item_types.count}}" md-on-paginate="vm.getContactItemType" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTACTITEMTYPE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTACTITEMTYPE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-contactItemType-button" ng-click="vm.createOrEditContactItemType($event)" aria-label="add contactItemType" translate translate-attr-aria-label="TOOLS.ADD_CONTACTITEMTYPE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTACTITEMTYPE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/contact_item_types/create/dialog.html",'<md-dialog class="contactItemType-dialog" aria-label="New ContactItemType">\n <form name="contactItemTypeForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.contactItemType.name" ng-required="true" autofocus>\n\n <div ng-messages="contactItemTypeForm[\'name\'].$error" ng-show="contactItemTypeForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ORDER_BY">Order_by</label>\n <input type="integer" name="OrderBy" ng-model="vm.contactItemType.OrderBy" ng-required="true">\n\n <div ng-messages="contactItemTypeForm[\'OrderBy\'].$error" ng-show="contactItemTypeForm[\'OrderBy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ORDER_BY_REQUIRED">Order_by field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.contactItemType.rgbBackgroundColor" label="{{\'TOOLS.RGBBACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContactItemType" ng-click="vm.saveContactItemType()" class="send-button md-accent md-raised" ng-disabled="contactItemTypeForm.$invalid || contactItemTypeForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContactItemType" ng-click="vm.addNewContactItemType()" class="send-button md-accent md-raised" ng-disabled="contactItemTypeForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CONTACTITEMTYPE" translate-attr-aria-label="TOOLS.ADD_CONTACTITEMTYPE">\n ADD CONTACTITEMTYPE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContactItemType" ng-click="vm.deleteContactItemType($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n\n <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n ADD CUSTOMDASHBOARD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-customDashboards-count">\n <span>{{vm.selectedCustomDashboards.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.customDashboards.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(customDashboard, $event )" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n Edit CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(customDashboard, $event )" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n clone CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event )" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n goToDashboard CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(customDashboard, $event )" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n Delete CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n CLONE CUSTOMDASHBOARD\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n <form name="dashboarditemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dashboarditem.type" ng-change="vm.onTypeChange()" autofocus ng-disabled="!vm.newDashboardItem">\n\n <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }} </md-option>\n\n <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }} </md-option>\n\n <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }} </md-option>\n\n <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }} </md-option>\n\n <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }} </md-option>\n\n <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\',\'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="attrChannel" ng-model="vm.dashboarditem.attrChannel" required>\n\n <md-option ng-value="\'chat\'"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n <md-option ng-value="\'mail\'"> {{ \'TOOLS.EMAIL\' | translate }} </md-option>\n\n <md-option ng-value="\'sms\'"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n <md-option ng-value="\'openchannel\'"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n <md-option ng-value="\'fax\'"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n <md-option ng-value="\'whatsapp\'"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrChannel\'].$error" ng-show="dashboarditemForm[\'attrChannel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="![\'web-report\', \'iframe\',\'clock\', \'custom\'].includes(vm.dashboarditem.type)">\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'mail\'" class="md-block">\n <label translate="TOOLS.FILTEREMAILACCOUNTS">FilterEmailAccounts</label>\n <md-select name="attrEmailAccounts" ng-model="vm.dashboarditem.attrEmailAccounts" multiple>\n <md-option ng-value="attrEmailAccounts.id" ng-repeat="attrEmailAccounts in vm.mailAccount" ng-disabled="attrEmailAccounts.canSelect === false">{{ attrEmailAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrEmailAccounts\'].$error" ng-show="dashboarditemForm[\'attrEmailAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTEREMAILACCOUNTS_REQUIRED">FilterEmailAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'fax\'" class="md-block">\n <label translate="TOOLS.FILTERFAXACCOUNTS">FilterFaxAccounts</label>\n <md-select name="attrFaxAccounts" ng-model="vm.dashboarditem.attrFaxAccounts" multiple>\n <md-option ng-value="attrFaxAccounts.id" ng-repeat="attrFaxAccounts in vm.faxAccount" ng-disabled="attrFaxAccounts.canSelect === false">{{ attrFaxAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrFaxAccounts\'].$error" ng-show="dashboarditemForm[\'attrFaxAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERFAXACCOUNTS_REQUIRED">FilterFaxAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'sms\'" class="md-block">\n <label translate="TOOLS.FILTERSMSACCOUNTS">FilterSmsAccounts</label>\n <md-select name="attrSmsAccounts" ng-model="vm.dashboarditem.attrSmsAccounts" multiple>\n <md-option ng-value="attrSmsAccounts.id" ng-repeat="attrSmsAccounts in vm.smsAccount" ng-disabled="attrSmsAccounts.canSelect === false">{{ attrSmsAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSmsAccounts\'].$error" ng-show="dashboarditemForm[\'attrSmsAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERSMSACCOUNTS_REQUIRED">FilterSmsAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'openchannel\'" class="md-block">\n <label translate="TOOLS.FILTEROPENCHANNELACCOUNTS">FilterOpenchannelAccounts</label>\n <md-select name="attrOpenchannelAccounts" ng-model="vm.dashboarditem.attrOpenchannelAccounts" multiple>\n <md-option ng-value="attrOpenchannelAccounts.id" ng-repeat="attrOpenchannelAccounts in vm.openchannelAccount" ng-disabled="attrOpenchannelAccounts.canSelect === false">{{ attrOpenchannelAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrOpenchannelAccounts\'].$error" ng-show="dashboarditemForm[\'attrOpenchannelAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTEROPENCHANNELACCOUNTS_REQUIRED">FilterOpenchannelAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'whatsapp\'" class="md-block">\n <label translate="TOOLS.FILTERWHATSAPPACCOUNTS">FilterWhatsappAccounts</label>\n <md-select name="attrWhatsappAccounts" ng-model="vm.dashboarditem.attrWhatsappAccounts" multiple>\n <md-option ng-value="attrWhatsappAccounts.id" ng-repeat="attrWhatsappAccounts in vm.whatsappAccount" ng-disabled="attrWhatsappAccounts.canSelect === false">{{ attrWhatsappAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrWhatsappAccounts\'].$error" ng-show="dashboarditemForm[\'attrWhatsappAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERWHATSAPPACCOUNTS_REQUIRED">FilterWhatsappAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'chat\'" class="md-block">\n <label translate="TOOLS.FILTERCHATWEBSITES">FilterChatWebsites</label>\n <md-select name="attrChatWebsites" ng-model="vm.dashboarditem.attrChatWebsites" multiple>\n <md-option ng-value="attrChatWebsites.id" ng-repeat="attrChatWebsites in vm.chatWebsite" ng-disabled="attrChatWebsites.canSelect === false">{{ attrChatWebsites.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrChatWebsites\'].$error" ng-show="dashboarditemForm[\'attrChatWebsites\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERCHATWEBSITES_REQUIRED">FilterChatWebsites field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type) && vm.dashboarditem.attrChannel === \'voice\'" class="md-block">\n <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues" ng-disabled="attrVoiceQueues.canSelect === false">{{ attrVoiceQueues.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLE">Title</label>\n <input type="text" name="title" ng-model="vm.dashboarditem.title" md-maxlength="255" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.TITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>Title must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLEFONTSIZE">TitleFontSize</label>\n <input type="number" name="titleFontSize" ng-model="vm.dashboarditem.titleFontSize" value="12">\n\n <div ng-messages="dashboarditemForm[\'titleFontSize\'].$error" ng-show="dashboarditemForm[\'titleFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLEFONTSIZE_REQUIRED">TitleFontSize field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" value="https://" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n <label translate="TOOLS.PATH">Path</label>\n <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.FORMAT">Format</label>\n <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" value="HH:mm:ss" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.TIMEZONE">Timezone</label>\n <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type === \'counter\'" class="md-block">\n <label translate="TOOLS.METRIC">Metric</label>\n <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE1">Serie1</label>\n <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE2">Serie2</label>\n <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE3">Serie3</label>\n <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.dashboarditem.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="dashboarditemForm[\'report\'].$error" ng-show="dashboarditemForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REFRESH">Refresh</label>\n <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" value="10" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FONTSIZE">FontSize</label>\n <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" value="20" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LINK">link</label>\n <input type="url" name="link" ng-model="vm.dashboarditem.link">\n\n <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n ADD DASHBOARDITEM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="customDashboard-image" hide-xs>\n <img ng-src="assets/images/business/customDashboards.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.customDashboard.id}}\n <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCustomDashboard()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard, vm.crudPermissions)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n <div ng-if="vm_cd.customDashboard.widgets.length">\n <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" ng-if="vm_cd.crudPermissions.canEdit" aria-label="add item">\n <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-content flex>\n <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n </md-content>\n </div>\n <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/create/dialog.html",'<md-dialog ng-init="vm.onInit()" class="disposition-dialog" aria-label="New Disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newDisposition ? \'TOOLS.NEW_DISPOSITION\' : \'TOOLS.EDIT_DISPOSITION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.disposition.name" md-maxlength="255" required md-autofocus>\n <div ng-messages="dispositionForm[\'name\'].$error" ng-show="dispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.NAME_MAX_LENGTH" translate-values=\'{max: 255}\'>Name must have a maximum length\n equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.disposition.description" md-maxlength="255">\n <div ng-messages="dispositionForm[\'description\'].$error" ng-show="dispositionForm[\'description\'].$touched" role="alert">\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.DESCRIPTION_MAX_LENGTH" translate-values=\'{max: 255}\'>Description must have a\n maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.newDisposition && vm.dispositions.length > 0 || vm.disposition.ParentId" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="TOOLS.FIRST_LEVEL_DISPOSITION">First Level Disposition</label>\n <md-select name="firstLevelDisposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onFirstLevelSelection()">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.firstLevelDisposition" ng-click="vm.clearSelection(\'first\'); dispositionForm.$setDirty();" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="TOOLS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition">\n <md-option ng-value="disposition" ng-if="disposition.id != vm.disposition.id" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearSelection(\'second\'); dispositionForm.$setDirty();" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDisposition" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid || dispositionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDisposition" ng-click="vm.addNewDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DISPOSITION" translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n ADD DISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDisposition" ng-click="vm.deleteDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/dispositions.html",'<div id="dispositions" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.DISPOSITIONS">Dispositions</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDispositions.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedDispositions = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-dispositions-count">\n <span>{{vm.selectedDispositions.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDispositions()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDispositions()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDispositions" csv-label="true" filename="dispositions.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.query.level = null; vm.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm.query.level" ng-change="vm.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n \x3c!-- DISPOSITION TABLE --\x3e\n <md-card flex="80">\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDispositions" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm.dispositions.rows">\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm.levels[disposition.level] }}</td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dispositions.count}}" md-on-paginate="vm.getDispositions" md-page-select>\n </md-table-pagination>\n </md-card>\n \x3c!-- / DISPOSITION TABLE --\x3e\n </div>\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n \x3c!-- ADD DISPOSITION BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-disposition-button" ng-click="vm.createOrEditDisposition($event)" aria-label="add disposition" translate translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DISPOSITION BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n\n <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" md-autofocus required>\n <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="interval-image" hide-xs>\n <img ng-src="assets/images/business/intervals.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.interval.id}}\n <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInterval()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.INTERVALS">INTERVALS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n <ms-search-bar on-search="vm_dc.getIntervalIntervals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column md-order-by="id">\n {{ \'TOOLS.ID\' | translate }}\n </th>\n <th md-column md-order-by="name">\n {{ \'TOOLS.NAME\' | translate }}\n </th>\n <th md-column md-order-by="interval">\n {{ \'TOOLS.INTERVAL\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'TOOLS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_dc.sortableTable">\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{interval.id}}\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{interval.name}}\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{interval.interval}}\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{ interval.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-intervals-count">\n <span>{{vm.selectedIntervals.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- INTERVAL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.intervals.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(interval, $event )" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(interval, $event )" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERVAL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERVAL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n <form name="pauseForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n\n <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.pause.description">\n\n <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n ADD PAUSE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-pauses-count">\n <span>{{vm.selectedPauses.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- PAUSE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.pauses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(pause, $event )" translate="TOOLS.EDIT_PAUSE">\n Edit Pause\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(pause, $event )" translate="TOOLS.DELETE_PAUSE">\n Delete Pause\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PAUSE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PAUSE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n <form name="scheduleForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n\n <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.schedule.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="scheduleForm[\'report\'].$error" ng-show="scheduleForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTPUT">Output</label>\n <md-select name="output" ng-model="vm.schedule.output" required>\n <md-option ng-value="\'csv\'">CSV</md-option>\n <md-option ng-value="\'pdf\'">PDF</md-option>\n <md-option ng-value="\'xlsx\'">Excel</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div flex class="md-block">\n <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LAST">Last</label>\n <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" value="1" ng-required="true">\n\n <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.LASTUNIT">LastUnit</label>\n <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n <md-option ng-value="\'minutes\'">Minutes</md-option>\n <md-option ng-value="\'hours\'">Hours</md-option>\n <md-option ng-value="\'days\'">Days</md-option>\n <md-option ng-value="\'weeks\'">Weeks</md-option>\n <md-option ng-value="\'months\'">Months</md-option>\n <md-option ng-value="\'quarters\'">Quarters</md-option>\n <md-option ng-value="\'years\'">Years</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts" ng-disabled="MailAccountId.canSelect === false">{{ MailAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILCCADDRESS">EmailCcAddress</label>\n <input type="text" name="cc" ng-model="vm.schedule.cc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'cc\'].$error" ng-show="scheduleForm[\'cc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILCCADDRESS_REQUIRED">EmailCcAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILBCCADDRESS">EmailBccAddress</label>\n <input type="text" name="bcc" ng-model="vm.schedule.bcc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILBCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'bcc\'].$error" ng-show="scheduleForm[\'bcc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILBCCADDRESS_REQUIRED">EmailBccAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <md-switch ng-model="vm.schedule.sendIfEmpty" aria-label="SendIfEmpty"><span translate="TOOLS.SENDIFEMPTY">SendIfEmpty</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.schedule.description">\n\n <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n ADD SCHEDULE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-schedules-count">\n <span>{{vm.selectedScheduler.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SCHEDULE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.schedules.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(schedule, ev) : vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(schedule, $event )" translate="TOOLS.EDIT_SCHEDULE">\n Edit Schedule\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.runconfirm(schedule, $event )" translate="TOOLS.RUN_SCHEDULE">\n Run Schedule\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(schedule, $event )" translate="TOOLS.DELETE_SCHEDULE">\n Delete Schedule\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCHEDULE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SCHEDULE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n <form name="soundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n\n <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sound.description">\n\n <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n ADD SOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sounds-count">\n <span>{{vm.selectedSounds.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SOUND TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sounds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(sound, $event )" translate="TOOLS.EDIT_SOUND">\n Edit Sound\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.downloadfile2(sound, $event , \'sounds\' )" translate="TOOLS.DOWNLOAD_SOUND">\n Download Sound\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(sound, $event )" translate="TOOLS.DELETE_SOUND">\n Delete Sound\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SOUND TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD SOUND BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-sound-button" ng-click="vm.uploadSound($event)" aria-label="upload sound" translate translate-attr-aria-label="TOOLS.UPLOAD_SOUND">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="sound-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="TOOLS.UPLOADING">Uploading</span>\n <span>{{vm.sound.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n\n <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.tag.description">\n\n <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n ADD TAG\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTags.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-tags-count">\n <span>{{vm.selectedTags.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TAG TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.tags.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(tag, $event )" translate="TOOLS.EDIT_TAG">\n Edit Tag\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(tag, $event )" translate="TOOLS.DELETE_TAG">\n Delete Tag\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TAG TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TAG BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n <form name="templateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n\n <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.template.html"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.template.description">\n\n <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n ADD TEMPLATE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-templates-count">\n <span>{{vm.selectedTemplates.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TEMPLATE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.templates.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(template, $event )" translate="TOOLS.EDIT_TEMPLATE">\n Edit Template\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(template, $event )" translate="TOOLS.DELETE_TEMPLATE">\n Delete Template\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEMPLATE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEMPLATE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n <form name="triggerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newTrigger ? \'TOOLS.NEW_TRIGGER\' : \'TOOLS.EDIT_TRIGGER\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" required md-autofocus>\n <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}\n </md-option>\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n </md-select>\n <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span>\n </md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{ error.message }}</span>\n <span class="type">({{ error.type }})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n ADD TRIGGER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/actions.html",'<div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\r\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\r\n <div class="md-toolbar-tools">\r\n <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\r\n <ms-search-bar on-search="vm_dc.getTriggerActions()" query="vm_dc.query" debounce="300" direction="down">\r\n </ms-search-bar>\r\n <div flex></div>\r\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\r\n <md-icon md-font-icon="icon-plus"></md-icon>\r\n </md-button>\r\n </div>\r\n </md-toolbar>\r\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\r\n <div class="md-toolbar-tools">\r\n <span class="md-subhead">{{ vm_dc.selectedTriggerActions.length }}\r\n {{ vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\' }} selected</span>\r\n <div flex></div>\r\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\r\n <md-icon md-font-icon="icon-file-excel"></md-icon>\r\n </button>\r\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\r\n <md-icon md-font-icon="icon-delete"></md-icon>\r\n </md-button>\r\n </div>\r\n </md-toolbar>\r\n <md-table-container class="font-size-12">\r\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\r\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\r\n <tr md-row>\r\n <th md-column md-order-by="id">\r\n {{ \'TOOLS.ID\' | translate }}\r\n </th>\r\n <th md-column md-order-by="action">\r\n {{ \'TOOLS.ACTION\' | translate }}\r\n </th>\r\n <th md-column md-order-by="data1">\r\n {{ \'TOOLS.TYPE\' | translate }}\r\n </th>\r\n <th md-column md-order-by="data2">\r\n {{ \'TOOLS.INFO\' | translate }}\r\n </th>\r\n <th md-column md-order-by="createdAt">\r\n {{ \'TOOLS.CREATED_AT\' | translate }}\r\n </th>\r\n <th md-column width="10px"></th>\r\n </tr>\r\n </thead>\r\n <tbody md-body>\r\n <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n {{ action.id }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n {{ \'TOOLS.\' + (action.action | snakecase | uppercase) | translate }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>\r\n {{ action.data1 === \'1\' ? \'CTI URL\' : \'Popup\' }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n {{ (vm_dc.lists | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n {{ action.data2 === \'1\' ? \'TOOLS.YES\' : \'TOOLS.NO\' | uppercase | translate }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n {{ action.data1 }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data1" md-cell>\r\n {{ action.data1 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data2" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data1" md-cell>\r\n {{ action.data1 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>\r\n {{ (vm_dc.projects | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>\r\n {{ vm_dc.integrationTypes[action.data1] }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>\r\n {{ (vm_dc.zendeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>\r\n {{ (vm_dc.deskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>\r\n {{ (vm_dc.zohoAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>\r\n {{ (vm_dc.salesforceAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>\r\n {{ (vm_dc.sugarcrmAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>\r\n {{ (vm_dc.freshdeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'vtiger\'" md-cell>\r\n {{ (vm_dc.vtigerAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'dynamics365\'" md-cell>\r\n {{ (vm_dc.dynamics365Accounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'servicenow\'" md-cell>\r\n {{ (vm_dc.servicenowAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshsales\'" md-cell>\r\n {{ (vm_dc.freshsalesAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>\r\n {{ vm_dc.motionBarOptions[action.data1] }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'1\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'2\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'0\'" md-cell>\r\n {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'0\'" md-cell>\r\n {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'1\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n {{ action.createdAt | formatdate }}\r\n </td>\r\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\r\n <md-menu>\r\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\r\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\r\n </md-button>\r\n <md-menu-content width="3">\r\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\r\n <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\r\n Edit Action\r\n </md-button>\r\n </md-menu-item>\r\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\r\n <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\r\n Delete Action\r\n </md-button>\r\n </md-menu-item>\r\n </md-menu-content>\r\n </md-menu>\r\n </td>\r\n </tr>\r\n <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\r\n <td md-cell colspan="5">\r\n <div layout="row" layout-align="center center">\r\n <span class="text-boxed-light" translate="TOOLS.NO_ACTION_AVAILABLE">No action\r\n available</span>\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </md-table-container>\r\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.triggerActions.count }}" md-on-paginate="vm_dc.getTriggerActions" md-page-select>\r\n </md-table-pagination>\r\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n <form name="actionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newAction ? \'TOOLS.NEW_ACTION\' : \'TOOLS.EDIT_ACTION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.ACTION">Action</label>\n <md-select name="action" ng-model="vm.action.action" ng-init="vm.onActionInit()" ng-change="vm.onActionSelection()" md-autofocus required ng-disabled="!vm.newAction">\n <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'">\n {{ \'TOOLS.CONTACT_MANAGER\' | translate }} </md-option>\n <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\' && ((vm.newAction && vm.hasIntegrationsPermissions) || !vm.newAction)">\n {{ \'TOOLS.INTEGRATIONS\' | translate }} </md-option>\n <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTIONBAR\' | translate }} </md-option>\n <md-option ng-value="\'jscripty\'"> {{ \'TOOLS.JSCRIPTY\' | translate }} </md-option>\n <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }} </md-option>\n <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }} </md-option>\n <md-option ng-value="\'bot\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.BOT\' | translate }} </md-option>\n <md-option ng-value="\'script\'"> {{ \'TOOLS.SCRIPT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n <label translate="TOOLS.PROJECT">Project</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects" ng-disabled="data1.canSelect === false">\n {{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.LIST">List</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onListSelection()" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists" ng-disabled="data1.canSelect === false">\n {{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.SEARCH_FIELDS">Search fields</label>\n <md-select name="fields" ng-model="vm.action.data3" ng-init="vm.onSearchFieldsInit()" multiple required>\n <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n {{ field.name }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEARCH_FIELDS_REQUIRED">Search fields field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.AUTOCREATECONTACT">Create contact automatically</label>\n <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onAutocreateSelection()" required>\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\' && vm.action.data2 === \'1\'" class="md-block">\n <label translate="TOOLS.AUTOCREATE_FIELD">Autocreate field</label>\n <md-select name="autocreateField" ng-model="vm.action.data4" ng-required="vm.action.data2 === \'1\'">\n <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n {{ field.name }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATE_FIELD_REQUIRED">Autocreate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.IGNOREDIALERCONTACTID">Ignore dialer contact Id</label>\n <md-select name="data5" ng-model="vm.action.data5" required>\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.IGNOREDIALERCONTACTID_REQUIRED">Ignore dialer contact Id field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'GET\'">GET</md-option>\n <md-option ng-value="\'POST\'">POST</md-option>\n <md-option ng-value="\'PUT\'">PUT</md-option>\n <md-option ng-value="\'DELETE\'">DELETE</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TIMEOUT">Timeout</label>\n <input type="number" name="data5" ng-model="vm.action.data5" min="1" max="10" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.TIMEOUT"></span></div>\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>10</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.HEADERS">Headers</label>\n <textarea name="data6" ng-model="vm.action.data6"></textarea>\n <div class="hint"><span translate="TOOLS.HELP.HEADERS"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\' && (vm.action.data1 == \'POST\' || vm.action.data1 == \'PUT\')" class="md-block">\n <label translate="TOOLS.BODY">Body</label>\n <textarea name="data7" ng-model="vm.action.data7"></textarea>\n <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n <label translate="TOOLS.SCRIPT_TYPE">Script_Type</label>\n <input type="input" name="data2" ng-model="vm.action.data2">\n <div class="hint"><span translate="TOOLS.HELP.SCRIPT_TYPE"></span></div>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SCRIPT_TYPE_REQUIRED">Script_Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n <label translate="TOOLS.SCRIPT_INFO">Script_Info</label>\n <input type="input" name="data1" ng-model="vm.action.data1">\n <div class="hint"><span translate="TOOLS.HELP.SCRIPT_INFO"></span></div>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SCRIPT_INFO_REQUIRED">Script_Info field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n <label translate="TOOLS.SCRIPT">Script</label>\n <textarea name="data3" ng-model="vm.action.data3" required></textarea>\n <div class="hint"><span translate="TOOLS.HELP.SCRIPT"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SCRIPT_REQUIRED">Script field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n <label translate="TOOLS.INTEGRATION">Integration</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-init="vm.onIntegrationInit()" ng-change="vm.onIntegrationSelection()" required>\n <md-option ng-value="\'desk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])">Desk</md-option>\n <md-option ng-value="\'dynamics365\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])">Dynamics365</md-option>\n <md-option ng-value="\'freshdesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])">Freshdesk</md-option>\n <md-option ng-value="\'freshsales\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1304]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1304])">Freshsales</md-option>\n <md-option ng-value="\'salesforce\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])">Salesforce</md-option>\n <md-option ng-value="\'servicenow\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])">ServiceNow</md-option>\n <md-option ng-value="\'sugarcrm\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])">SugarCRM</md-option>\n <md-option ng-value="\'vtiger\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])">vTiger</md-option>\n <md-option ng-value="\'zendesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])">Zendesk</md-option>\n <md-option ng-value="\'zoho\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])">Zoho</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onIntegrationAccountSelection()" ng-disabled="vm.action.isIntegrationDisabled" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.accounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="vm.action.isIntegrationDisabled">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.configurations | filter : { AccountId: (vm.action.data2 | toInteger) } : true">{{\n data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n <md-option ng-value="\'2\'">Windows App</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.APPLICATION">Application</label>\n <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.ARGUMENTS">Arguments</label>\n <input type="text" name="data3" ng-model="vm.action.data3">\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n {{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n {{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.LOCATION">Location</label>\n <md-select name="data4" ng-model="vm.action.data4" required ng-change="vm.onActionLocationChange()">\n <md-option ng-value="0"> {{ \'TOOLS.NEW_TAB\' | translate }} </md-option>\n <md-option ng-value="1"> {{ \'TOOLS.NEW_WINDOW\' | translate }} </md-option>\n <md-option ng-value="2"> {{ \'TOOLS.MOTION_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n <input type="text" name="data5" ng-model="vm.action.data5">\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n <input type="text" name="data6" ng-model="vm.action.data6">\n <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n ADD ACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html",'<div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">All Conditions</span>\n <ms-search-bar on-search="vm_dc.getAllConditions()" query="vm_dc.query" debounce="300" direction="down">\n </ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{ vm_dc.selectedAllConditions.length }}\n {{ vm_dc.selectedAllConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAllConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedAllConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAllConditions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'TOOLS.ID\' | translate }}\n </th>\n <th md-column md-order-by="field">\n {{ \'TOOLS.FIELD\' | translate }}\n </th>\n <th md-column md-order-by="operator">\n {{ \'TOOLS.OPERATOR\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'TOOLS.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'TOOLS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.allConditions.rows">\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ allCondition.id }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ \'TOOLS.\' + vm_dc.fields[allCondition.field] | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ \'TOOLS.\' + allCondition.operator | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>\n {{ allCondition.value }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.chatWebsites | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.mailAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.smsAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.whatsappAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.faxAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.openchannelAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>\n {{ (vm_dc.queues | filter : {\'name\':allCondition.value} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>\n {{ (vm_dc.outboundRoutes | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'agent\'" md-cell>\n {{ (vm_dc.agents | filter : {\'name\':allCondition.value} : true)[0].fullname }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>\n {{ vm_dc.callStatuses[allCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>\n {{ allCondition.value | capitalize }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>\n {{ vm_dc.messageStatuses[allCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'mailSubstatus\'" md-cell>\n {{ allCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': allCondition.value } : true)[0].name }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'offlineMessage\'" md-cell>\n {{allCondition.value}} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ allCondition.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n Edit AllCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n Delete AllCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.allConditions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No condition\n available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.allConditions.count }}" md-on-paginate="vm_dc.getAllConditions" md-page-select>\n </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n <form name="allConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newAllCondition ? \'TOOLS.NEW_ALLCONDITION\' : \'TOOLS.EDIT_ALLCONDITION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.allCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n </md-option>\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n </md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n </md-option>\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n </md-option>\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n </md-option>\n <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.allCondition.operator" required>\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n {{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.AGENT">Agent</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n {{ value.fullname }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n {{ status.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'mailSubstatus\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n {{ mailSubstatus.name }}</md-option>\n <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.CHAT">Chat</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'created\'">Created</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n ADD ALLCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html",'<div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n <ms-search-bar on-search="vm_dc.getAnyConditions()" query="vm_dc.query" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{ vm_dc.selectedAnyConditions.length }}\n {{ vm_dc.selectedAnyConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAnyConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedAnyConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAnyConditions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'TOOLS.ID\' | translate }}\n </th>\n <th md-column md-order-by="field">\n {{ \'TOOLS.FIELD\' | translate }}\n </th>\n <th md-column md-order-by="operator">\n {{ \'TOOLS.OPERATOR\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'TOOLS.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'TOOLS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.anyConditions.rows">\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ anyCondition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ \'TOOLS.\' + vm_dc.fields[anyCondition.field] | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ \'TOOLS.\' + anyCondition.operator | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>\n {{ anyCondition.value }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.chatWebsites | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.mailAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.smsAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.whatsappAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.faxAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.openchannelAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>\n {{ (vm_dc.queues | filter : {\'name\':anyCondition.value} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>\n {{ (vm_dc.outboundRoutes | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'agent\'" md-cell>\n {{ (vm_dc.agents | filter : {\'name\':anyCondition.value} : true)[0].fullname }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>\n {{ vm_dc.callStatuses[anyCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>\n {{ anyCondition.value | capitalize }} </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>\n {{ vm_dc.messageStatuses[anyCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'mailSubstatus\'" md-cell>\n {{ anyCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': anyCondition.value } : true)[0].name }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'offlineMessage\'" md-cell>\n {{anyCondition.value}} </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ anyCondition.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n Edit AnyCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n Delete AnyCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.anyConditions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition\n available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.anyConditions.count }}" md-on-paginate="vm_dc.getAnyConditions" md-page-select>\n </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n <form name="anyConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newAnyCondition ? \'TOOLS.NEW_ANYCONDITION\' : \'TOOLS.EDIT_ANYCONDITION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.anyCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n </md-option>\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n </md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n </md-option>\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n </md-option>\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n </md-option>\n <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n {{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.AGENT">Agent</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n {{ value.fullname }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n {{ status.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'mailSubstatus\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n {{ mailSubstatus.name }}</md-option>\n <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.CHAT">Chat</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'created\'">Created</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n ADD ANYCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="trigger-image" hide-xs>\n <img ng-src="assets/images/business/triggers.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">#{{ vm.trigger.id }}\n <span ng-if="vm.trigger.name">{{ vm.trigger.name }}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{ vm.trigger.createdAt | date:\'medium\' }}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrigger()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" required autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required disabled>\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel">\n {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }}\n </md-option>\n </md-select>\n <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html\'">\n </div>\n <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html\'">\n </div>\n <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/actions/actions.html\'">\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-triggers-count">\n <span>{{ vm.selectedTriggers.length }}</span>\n <span translate="TOOLS.SELECTED">Selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n \x3c!-- TRIGGER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.triggers.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{ trigger.id }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{ trigger.name }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">\n {{ \'TOOLS.\' + trigger.channel | uppercase | translate }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n <md-icon md-colors="{color: {{ trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ trigger.status ? \'icon-check\' : \'icon-close\' }}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="description ">\n {{ trigger.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToEditState(trigger)" translate="TOOLS.EDIT_TRIGGER">\n Edit Trigger\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n Delete Trigger\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.triggers.count }}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRIGGER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n \x3c!-- ADD TRIGGER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n\n <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n ADD TRUNK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/clone/clone.html",'<md-dialog class="trunk-dialog" aria-label="Clone Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_TRUNK" translate-attr-aria-label="TOOLS.CLONE_TRUNK">\n CLONE TRUNK\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trunk-image" hide-xs>\n <img ng-src="assets/images/business/trunks.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trunk.id}}\n <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.trunk, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrunk()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CONTEXT">context</label>\n <md-select name="context" ng-model="vm.trunk.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLERID">callerid</label>\n <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.trunk.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n <md-option ng-value="\'info\'">info</md-option>\n <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n <md-option ng-value="\'inband\'">inband</md-option>\n <md-option ng-value="\'auto\'">auto</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAT">nat</label>\n <md-select name="nat" ng-model="vm.trunk.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.QUALIFY">qualify</label>\n <md-select name="qualify" ng-model="vm.trunk.qualify" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.trunk.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g723\'">g723</md-option>\n <md-option ng-value="\'g726\'">g726</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'ilbc\'">ilbc</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.INSECURE">insecure</label>\n <md-select name="insecure" ng-model="vm.trunk.insecure" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'port\'">port</md-option>\n <md-option ng-value="\'invite\'">invite</md-option>\n <md-option ng-value="\'very\'">very</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n <input type="number" name="call_limit" ng-model="vm.trunk.call_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n <md-select name="directmedia" ng-model="vm.trunk.directmedia" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'nonat\'">nonat</md-option>\n <md-option ng-value="\'update\'">update</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n <md-select name="callcounter" ng-model="vm.trunk.callcounter" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMUSER">fromuser</label>\n <input type="text" name="fromuser" ng-model="vm.trunk.fromuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n\n <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ENCRYPTION">encryption</label>\n <md-select name="encryption" ng-model="vm.trunk.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.PORT">port</label>\n <input type="number" name="port" ng-model="vm.trunk.port" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.trunk.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl" value="no" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.trunk.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'videosupport\'].$error" ng-show="advancedForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n </div>\n <form name="otherFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-trunks-count">\n <span>{{vm.selectedTrunks.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TRUNK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(trunk, $event )" translate="TOOLS.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(trunk, $event )" translate="TOOLS.CLONE_TRUNK">\n clone Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(trunk, $event )" translate="TOOLS.GOTOREALTIME_TRUNK">\n goToRealtime Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(trunk, $event )" translate="TOOLS.DELETE_TRUNK">\n Delete Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRUNK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRUNK BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n <form name="variableForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n\n <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.variable.description">\n\n <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n ADD VARIABLE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-variables-count">\n <span>{{vm.selectedVariables.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VARIABLE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.variables.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(variable, $event )" translate="TOOLS.EDIT_VARIABLE">\n Edit Variable\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(variable, $event )" translate="TOOLS.DELETE_VARIABLE">\n Delete Variable\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VARIABLE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VARIABLE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/video/views/screenRecordings/create/dialog.html",'<md-dialog class="screenRecording-dialog" aria-label="New screenRecording">\n <form name="screenRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VIDEO.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.screenRecording.rating" autofocus ng-disabled="!vm.newscreenRecording && !vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VIDEO.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="screenRecordingForm[\'rating\'].$error" ng-show="screenRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VIDEO.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newscreenRecording" ng-click="vm.savescreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid || screenRecordingForm.$pristine" aria-label="SAVE" translate="VIDEO.SAVE" translate-attr-aria-label="VIDEO.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newscreenRecording" ng-click="vm.addNewscreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid" aria-label="ADD" translate="VIDEO.ADD_SCREENRECORDING" translate-attr-aria-label="VIDEO.ADD_SCREENRECORDING">\n ADD SCREENRECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newscreenRecording" ng-click="vm.deletescreenRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VIDEO.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VIDEO.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/partialViews/play.html",'<md-dialog class="play-dialog" aria-label="play">\n <form name="playForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="{{ vm.app.toUpperCase() }}.{{ vm.label.toUpperCase() }}">Play Recording</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-sm flex>\n \x3c!-- VIRTUAL field --\x3e\n <md-card>\n\n <md-card-title ng-if="vm.actionOptions.upperTitle">\n <md-card-title-text>\n <span class="md-headline">{{ vm.filename }}</span>\n <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>: {{ vm.recording.updatedAt}}</span>\n </md-card-title-text>\n </md-card-title>\n\n \x3c!-- video recording directive --\x3e\n <ms-dialog-recording ng-if="vm.format" id="vm.recording.id" title="vm.filename" element="vm.element" model="vm.route" path="vm.path" class="md-card-image"></ms-dialog-recording>\n \x3c!-- / video recording directive --\x3e\n\n <span ng-if="!vm.format">\n <em ng-if="vm.found">{{ vm.app.toUpperCase() + \'.CANT_PLAY_THIS_FILE\' | translate }}</em>\n <em ng-if="!vm.found">{{ vm.app.toUpperCase() + \'.FILE_NOT_FOUND\' | translate }}</em>\n </span>\n\n <md-card-title ng-if="vm.actionOptions.lowerTitle">\n <md-card-title-text>\n <span class="md-headline">{{ vm.filename }}</span>\n <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>:{{ vm.recording.updatedAt}}</span>\n <span ng-if="vm.actionOptions.properties" class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.PROPERTIES"></span>:</span>\n </md-card-title-text>\n </md-card-title>\n\n <md-card-content ng-if="vm.actionOptions.properties">\n <md-list>\n <md-list-item class="md-2-line" ng-repeat="(key,value) in vm.properties" ng-click="null" ng-if="key != \'value\' && key != \'updatedAt\' && key != \'queue\'">\n\n <md-icon ng-if="vm.icon" class="md-avatar-icon" md-font-icon="vm.actionOptions.propertiesIcon" class="s24"></md-icon>\n\n <div class="md-list-item-text" layout="column">\n <p><b><span translate="{{ vm.app.toUpperCase() }}.{{ key.toUpperCase() }}"></span></b></p>\n <p>{{ value }}\n <p>\n </div>\n </md-list-item>\n </md-list>\n </md-card-content>\n\n\n </md-card>\n </div>\n </md-dialog-content>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/screenRecordings.html",'<div id="screenRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-video" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VIDEO.SCREENRECORDINGS">ScreenRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VIDEO.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScreenRecordings()"></ms-quick-filter>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScreenRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScreenRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VIDEO.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-screenRecordings-count">\n <span>{{vm.selectedScreenRecordings.length}}</span>\n <span translate="VIDEO.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VIDEO.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScreenRecordings()" translate="VIDEO.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScreenRecordings()" translate="VIDEO.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScreenRecordings" csv-label="true" filename="screenRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScreenRecordings($event)" aria-label="delete selected" translate translate-attr-label="VIDEO.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SCREENRECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScreenRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScreenRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VIDEO.ID\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VIDEO.RATING\' | translate }}</th>\n <th md-column md-order-by="UserId">{{ \'VIDEO.AGENT\' | translate }}</th>\n <th md-column md-order-by="duration">{{ \'VIDEO.DURATION\' | translate }}</th>\n <th md-column md-order-by="startedAt">{{ \'VIDEO.RECORDSTARTTIME\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'VIDEO.RECORDENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.screenRecordings.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="VIDEO.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="screenRecording" md-select-id="id" ng-repeat="screenRecording in vm.screenRecordings.rows">\n <td md-cell ng-if="screenRecording.userpic"><img class="avatar" alt="{{screenRecording.name}}" ng-src="api/users/{{screenRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!screenRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{screenRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="id ">{{screenRecording.id}}</td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="screenRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:screenRecording.rating"></md-icon><span ng-hide="screenRecording.rating" translate="VIDEO.NO_RATING">No rating</span>\n </td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="UserId ">{{ (vm.users | filter : {\'id\':screenRecording.UserId} : true)[0].fullname }}</td>\n <td md-cell><span ng-bind="vm.convertDuration(screenRecording.duration)"></span></td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="startedAt ">{{screenRecording.startedAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="closedAt ">{{screenRecording.closedAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VIDEO.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.playrecording(screenRecording, $event , \'value\' , \'play_screenrecording\' , \'video\' )" translate="VIDEO.PLAY_SCREENRECORDING">\n play screenRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadScreenRecordings">\n\n <md-button ng-click="vm.downloadfile2(screenRecording, $event , \'screen/recordings\' )" translate="VIDEO.DOWNLOAD_SCREENRECORDING">\n Download screenRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(screenRecording, $event )" translate="VIDEO.DELETE_SCREENRECORDING">\n Delete screenRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VIDEO.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VIDEO.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VIDEO.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.screenRecordings.count}}" md-on-paginate="vm.getScreenRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCREENRECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/routing/dialog.html",'<md-dialog ng-init="vm.init()" class="voice-routing-dialog" aria-label="New routing application">\n <form name="routingAppForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'VOICE.EDIT_\' + vm.application.appType | uppercase | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-switch="vm.application.appType">\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div ng-switch-when="agi">\n <div ng-include="\'app/main/apps/voice/routing/views/agi.html\'"></div>\n </div>\n <div ng-switch-when="custom">\n <div ng-include="\'app/main/apps/voice/routing/views/custom.html\'"></div>\n </div>\n <div ng-switch-when="dial">\n <div ng-include="\'app/main/apps/voice/routing/views/dial.html\'"></div>\n </div>\n <div ng-switch-when="externalDial">\n <div ng-include="\'app/main/apps/voice/routing/views/externalDial.html\'"></div>\n </div>\n <div ng-switch-when="goTo">\n <div ng-include="\'app/main/apps/voice/routing/views/goTo.html\'"></div>\n </div>\n <div ng-switch-when="hangup">\n <div ng-include="\'app/main/apps/voice/routing/views/hangup.html\'"></div>\n </div>\n <div ng-switch-when="internalDial">\n <div ng-include="\'app/main/apps/voice/routing/views/internalDial.html\'"></div>\n </div>\n <div ng-switch-when="outboundDial">\n <div ng-include="\'app/main/apps/voice/routing/views/outboundDial.html\'"></div>\n </div>\n <div ng-switch-when="playback">\n <div ng-include="\'app/main/apps/voice/routing/views/playback.html\'"></div>\n </div>\n <div ng-switch-when="queue">\n <div ng-include="\'app/main/apps/voice/routing/views/queue.html\'"></div>\n </div>\n <div ng-switch-when="ringGroup">\n <div ng-include="\'app/main/apps/voice/routing/views/ringGroup.html\'"></div>\n </div>\n <div ng-switch-when="set">\n <div ng-include="\'app/main/apps/voice/routing/views/set.html\'"></div>\n </div>\n <div ng-switch-when="voicemail">\n <div ng-include="\'app/main/apps/voice/routing/views/voicemail.html\'"></div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveRoutingApp()" class="send-button md-accent md-raised" ng-disabled="routingAppForm.$invalid || routingAppForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/interval/dialog.html",'<md-dialog ng-init="vm.initialize()" class="interval-dialog" aria-label="Edit Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'TOOLS.EDIT_INTERVAL\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.crudPermissions.canEdit" ng-change="vm.onTypeChange()">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | startcase }}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.crudPermissions.canEdit" required>\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows" ng-disabled="interval.canSelect === false">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n </md-select>\n </md-input-container>\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n </md-select>\n </md-input-container>\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/views/agi.html",'<md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.application.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects.rows" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'project\'].$error" ng-show="routingAppForm[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/custom.html",'<md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.application.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'app\'].$error" ng-show="routingAppForm[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.application.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'appdata\'].$error" ng-show="routingAppForm[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/dial.html",'<md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.application.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'tech\'].$error" ng-show="routingAppForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/externalDial.html",'<md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n trunk.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.application.phone" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'phone\'].$error" ng-show="routingAppForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/goTo.html",'<md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.application.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{\n context.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'context\'].$error" ng-show="routingAppForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.application.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'extension\'].$error" ng-show="routingAppForm[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.application.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'priority\'].$error" ng-show="routingAppForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/hangup.html","<md-input-container class=\"md-block\">\n <label translate=\"VOICE.HANGUP_CAUSE\">Hangup_Cause</label>\n <md-select name=\"appdata\" ng-model=\"vm.application.appdata\" autofocus required ng-disabled=\"!vm.crudPermissions.canEdit\">\n <md-option ng-value=\"'1'\"> {{ 'VOICE.HANGUPCAUSE_1' | translate }} </md-option>\n <md-option ng-value=\"'16'\"> {{ 'VOICE.HANGUPCAUSE_16' | translate }} </md-option>\n <md-option ng-value=\"'17'\"> {{ 'VOICE.HANGUPCAUSE_17' | translate }} </md-option>\n <md-option ng-value=\"'18'\"> {{ 'VOICE.HANGUPCAUSE_18' | translate }} </md-option>\n <md-option ng-value=\"'21'\"> {{ 'VOICE.HANGUPCAUSE_21' | translate }} </md-option>\n <md-option ng-value=\"'22'\"> {{ 'VOICE.HANGUPCAUSE_22' | translate }} </md-option>\n <md-option ng-value=\"'27'\"> {{ 'VOICE.HANGUPCAUSE_27' | translate }} </md-option>\n <md-option ng-value=\"'38'\"> {{ 'VOICE.HANGUPCAUSE_38' | translate }} </md-option>\n <md-option ng-value=\"'41'\"> {{ 'VOICE.HANGUPCAUSE_41' | translate }} </md-option>\n </md-select>\n <div ng-messages=\"routingAppForm['appdata'].$error\" ng-show=\"routingAppForm['appdata'].$touched\" role=\"alert\">\n <div ng-message=\"required\">\n <span translate=\"VOICE.ERRORS.HANGUP_CAUSE_REQUIRED\">Hangup_Cause field is required</span>\n </div>\n </div>\n</md-input-container>"),e.put("app/main/apps/voice/routing/views/internalDial.html",'<md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.application.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n {{ user.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/outboundDial.html",'<md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n trunk.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.CALLER_ID">Caller_ID</label>\n <input type="text" name="callerID" ng-model="vm.application.callerID" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>\n <div ng-messages="routingAppForm[\'callerID\'].$error" ng-show="routingAppForm[\'callerID\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.application.prefix" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'prefix\'].$error" ng-show="routingAppForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TAGS">Tags</label>\n <md-select name="tag" ng-model="vm.application.tag" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'--\'">None</md-option>\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{ tag.name }}\n </md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'tag\'].$error" ng-show="routingAppForm[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/playback.html",'<md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="sound" ng-model="vm.application.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/queue.html",'<md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.application.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows" ng-disabled="queue.canSelect === false">{{\n queue.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'queue\'].$error" ng-show="routingAppForm[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.application.URL" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'URL\'].$error" ng-show="routingAppForm[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.application.sound" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.application.agi" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'agi\'].$error" ng-show="routingAppForm[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.application.macro" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'macro\'].$error" ng-show="routingAppForm[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.application.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'gosub\'].$error" ng-show="routingAppForm[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.application.rule" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'rule\'].$error" ng-show="routingAppForm[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.application.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'position\'].$error" ng-show="routingAppForm[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/ringGroup.html",'<md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.application.users" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n {{ user.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/set.html",'<md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.application.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables.rows" ng-disabled="variable.canSelect === false">{{\n variable.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'variable\'].$error" ng-show="routingAppForm[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.application.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'value\'].$error" ng-show="routingAppForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/voicemail.html",'<md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.application.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails.rows" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'voiceMail\'].$error" ng-show="routingAppForm[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chanSpies-count">\n <span>{{vm.selectedChanSpies.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CHANSPY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chanSpies.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(chanSpy, $event )" translate="VOICE.EDIT_CHANSPY">\n Edit chanSpy\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(chanSpy, $event )" translate="VOICE.DELETE_CHANSPY">\n Delete chanSpy\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHANSPY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHANSPY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n <form name="chanSpyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n\n <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n\n <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <md-select name="options" ng-model="vm.chanSpy.options" multiple required>\n <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chanSpy.description">\n\n <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n ADD CHANSPY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contexts-count">\n <span>{{vm.selectedContexts.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CONTEXT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contexts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(context, $event )" translate="VOICE.EDIT_CONTEXT">\n Edit Context\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(context, $event )" translate="VOICE.DELETE_CONTEXT">\n Delete Context\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTEXT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTEXT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n <form name="contextForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n\n <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.context.description">\n\n <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n ADD CONTEXT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="inbound-route-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newInboundRoute ? \'VOICE.NEW_INBOUNDROUTE\' : \'VOICE.EDIT_INBOUNDROUTE\' | translate\n }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus>\n <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundRoute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.getRouting()">\n <div ng-messages="inboundrouteForm[\'alias\'].$error" ng-show="inboundrouteForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundRoute.description">\n <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n ADD INBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-inbound-route" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-inbound-routes-button md-icon-button" aria-label="Go to inbound routes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="inbound-route-image" hide-xs>\n <img ng-src="assets/images/business/inboundroutes.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.inboundRoute.id}}\n <span ng-if="vm.inboundRoute.exten">{{vm.inboundRoute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundRoute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- /HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n \x3c!-- SETTINGS TAB --\x3e\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /SETTINGS TAB --\x3e\n \x3c!-- ACTIONS TAB --\x3e\n <md-tab md-on-select="vm.onActionsTabSelection()">\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inbound-route-detail-form-container no-padding no-margin">\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- APPLICATIONS LIST --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider class="no-margin"></md-divider>\n <md-list ng-sortable="vm.sortableAppsOptions">\n <md-list-item class="handle" ng-repeat="a in vm.apps">\n <div layout="row">\n <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n a.appType}}</p>\n </div>\n </md-list-item>\n </md-list>\n </div>\n \x3c!-- /APPLICATIONS LIST --\x3e\n <div flex></div>\n \x3c!-- ROUTING --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n </div>\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.selectedApplications.length}}\n {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n a.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n <td md-cell colspan="6">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </div>\n \x3c!-- /ROUTING --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /ACTIONS TAB --\x3e\n </md-tabs>\n </div>\n \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",'<div id="inbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-inbound-routes-count">\n <span>{{ vm.selectedInboundRoutes.length }}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectedInboundRoutes = vm.inboundRoutes.rows" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.selectedInboundRoutes = []" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inbound_routes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.inboundRoutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.inboundRoutes.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INBOUNDROUTE">\n Edit InboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n Delete InboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.inboundRoutes.count }}" md-on-paginate="vm.getInboundRoutes" md-page-select>\n </md-table-pagination>\n </md-card>\n </div>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-inbound-route-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inbound route" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="internal-route-dialog" aria-label="New InternalRoute">\n <form name="internalrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newInternalRoute ? \'VOICE.NEW_INTERNALROUTE\' : \'VOICE.EDIT_INTERNALROUTE\' | translate\n }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus>\n <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalRoute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.getRouting()">\n <div ng-messages="internalrouteForm[\'alias\'].$error" ng-show="internalrouteForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalRoute.description">\n <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n ADD INTERNALROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-internal-route" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-internal-routes-button md-icon-button" aria-label="Go to internal routes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="internal-route-image" hide-xs>\n <img ng-src="assets/images/business/internalroutes.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.internalRoute.id}}\n <span ng-if="vm.internalRoute.exten">{{vm.internalRoute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalRoute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInternalRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- /HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n \x3c!-- SETTINGS TAB --\x3e\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internal-route-detail-form-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /SETTINGS TAB --\x3e\n \x3c!-- ACTIONS TAB --\x3e\n <md-tab md-on-select="vm.onActionsTabSelection()">\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internal-route-detail-form-container no-padding no-margin">\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- APPLICATIONS LIST --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider class="no-margin"></md-divider>\n <md-list ng-sortable="vm.sortableAppsOptions">\n <md-list-item class="handle" ng-repeat="a in vm.apps">\n <div layout="row">\n <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n a.appType}}</p>\n </div>\n </md-list-item>\n </md-list>\n </div>\n \x3c!-- /APPLICATIONS LIST --\x3e\n <div flex></div>\n \x3c!-- ROUTING --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n </div>\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.selectedApplications.length}}\n {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n a.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n <td md-cell colspan="6">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </div>\n \x3c!-- /ROUTING --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /ACTIONS TAB --\x3e\n </md-tabs>\n </div>\n \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/internalRoutes.html",'<div id="internal-routes" class="page-layout simple left-sidenav inner-sidenav">\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-internal-routes-count">\n <span>{{ vm.selectedInternalRoutes.length }}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectedInternalRoutes = vm.internalRoutes.rows" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.selectedInternalRoutes = []" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internal_routes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.internalRoutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.internalRoutes.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INTERNALROUTE">\n Edit InternalRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n Delete InternalRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.internalRoutes.count }}" md-on-paginate="vm.getInternalRoutes" md-page-select>\n </md-table-pagination>\n </md-card>\n </div>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-internal-route-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internal route" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n <form name="musiconholdForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n\n <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n\n <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n\n <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n ADD MUSICONHOLD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n <form name="mohSoundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FILE">File</label>\n <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n <md-option ng-value="id.id" ng-repeat="id in vm.sounds" ng-disabled="id.canSelect === false">{{ id.name }}</md-option>\n </md-select>\n <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n ADD MOHSOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="musiconhold-image" hide-xs>\n <img ng-src="assets/images/business/musiconholds.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.musiconhold.id}}\n <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMusicOnHold()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required disabled>\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n <ms-search-bar on-search="vm_dc.getMusicOnHoldMohSounds()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'VOICE.ID\' | translate }}\n </th>\n <th md-column md-order-by="audio">\n {{ \'VOICE.AUDIO\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'VOICE.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n <td md-cell>\n {{mohSound.id}}\n </td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>\n {{ mohSound.createdAt | formatdate }}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n Delete MohSound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-musiconholds-count">\n <span>{{vm.selectedMusicOnHolds.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- MUSICONHOLD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.musiconholds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(musiconhold, $event )" translate="VOICE.EDIT_MUSICONHOLD">\n Edit MusicOnHold\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(musiconhold, $event )" translate="VOICE.DELETE_MUSICONHOLD">\n Delete MusicOnHold\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MUSICONHOLD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="outbound-route-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newOutboundRoute ? \'VOICE.NEW_OUTBOUNDROUTE\' : \'VOICE.EDIT_OUTBOUNDROUTE\' | translate\n }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus>\n <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundRoute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.getRouting()" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0">\n <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater\n or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.getRouting()">\n <div ng-messages="outboundrouteForm[\'alias\'].$error" ng-show="outboundrouteForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundRoute.description">\n <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n ADD OUTBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-outbound-route" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-outbound-routes-button md-icon-button" aria-label="Go to outbound routes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="outbound-route-image" hide-xs>\n <img ng-src="assets/images/business/outboundroutes.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.outboundRoute.id}}\n <span ng-if="vm.outboundRoute.exten">{{vm.outboundRoute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundRoute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOutboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- /HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n \x3c!-- SETTINGS TAB --\x3e\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.onActionsTabSelection()" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid\n greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /SETTINGS TAB --\x3e\n \x3c!-- ACTIONS TAB --\x3e\n <md-tab md-on-select="vm.onActionsTabSelection()">\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outbound-route-detail-form-container no-padding no-margin">\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- APPLICATIONS LIST --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider class="no-margin"></md-divider>\n <md-list ng-sortable="vm.sortableAppsOptions">\n <md-list-item class="handle" ng-repeat="a in vm.apps">\n <div layout="row">\n <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n a.appType}}</p>\n </div>\n </md-list-item>\n </md-list>\n </div>\n \x3c!-- /APPLICATIONS LIST --\x3e\n <div flex></div>\n \x3c!-- ROUTING --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n </div>\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.selectedApplications.length}}\n {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n a.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n <td md-cell colspan="6">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </div>\n \x3c!-- /ROUTING --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /ACTIONS TAB --\x3e\n </md-tabs>\n </div>\n \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",'<div id="outbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-outbound-routes-count">\n <span>{{ vm.selectedOutboundRoutes.length }}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectedOutboundRoutes = vm.outboundRoutes.rows" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.selectedOutboundRoutes = []" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outbound_routes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.outboundRoutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.outboundRoutes.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n Edit OutboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n Delete OutboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.outboundRoutes.count }}" md-on-paginate="vm.getOutboundRoutes" md-page-select>\n </md-table-pagination>\n </md-card>\n </div>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-outbound-route-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outbound route" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n </ms-search-bar>\n <div flex></div>\n\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n </md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n <td md-cell class="id">{{call.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n <td md-cell class="list">\n {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">{{call.lastAssignedTo}}</td>\n <td md-cell class="list">{{ call.disposition }}</td>\n <td md-cell class="list">{{ call.secondDisposition }}</td>\n <td md-cell class="list">{{ call.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n Assigned\n to</md-button>\n <md-menu-content>\n <md-menu-item ng-if="call.lastAssignedTo">\n <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.calls.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n </td>\n <td md-cell privacy ng-cloak>\n {{call.calleridname}}, {{call.calleridnum}}\n <span class="text-boxed" ng-if="call.answered">\n <timer ng-if="call.answertime" start-time="call.answertime"></timer>\n </span>\n </td>\n <td md-cell privacy ng-cloak>{{call.exten}}</td>\n <td md-cell>{{call.routealias}}</td>\n <td md-cell>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n <timer ng-if="call.starttime" start-time="call.starttime"></timer>\n </span>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{\'\n VOICE.NAME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ANSWERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ABANDONED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.UNMANAGED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues.rows.length > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="queue in vm.queues.rows">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n \x3c!-- <span class="font-size-20 grey-fg">{{queue.total || 0}}</span> --\x3e\n <span class="font-size-20 grey-fg">{{ (queue.answered || 0) + (queue.abandoned || 0) + (queue.unmanaged || 0) }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.abandoned || 0}} ({{(queue.total) ? (queue.abandoned || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? ((queue.sumHoldTime || 0) / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(queue.total ? ((queue.sumDuration || 0) / queue.total) : 0) | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TELEPHONES">Telephones</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getTelephones()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n <td md-cell>{{telephone.fullname}}</td>\n <td md-cell>{{telephone.internal}}</td>\n <td md-cell>\n <i ng-class="vm.stateClass[telephone.state]">\n <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n </i>\n </td>\n <td md-cell>\n <i ng-class="vm.statusClass[telephone.status]">\n <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n <form name="voicemailForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n\n <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n\n <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n\n <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n ADD VOICEMAIL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voicemail-image" hide-xs>\n <img ng-src="assets/images/business/voicemails.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voicemail.id}}\n <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoicemail()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" disabled>\n\n <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n <md-select name="context" ng-model="vm.voicemail.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEZONE">TimeZone</label>\n <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ENVELOPE">Envelope</label>\n <md-select name="envelope" ng-model="vm.voicemail.envelope" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DELETE">Delete</label>\n <md-select name="delete" ng-model="vm.voicemail.delete" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILBODY">EmailBody</label>\n <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.MESSAGES">MESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n <ms-search-bar on-search="vm_dc.getVoicemailMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'VOICE.ID\' | translate }}\n </th>\n <th md-column md-order-by="callerid">\n {{ \'VOICE.CALLER_ID\' | translate }}\n </th>\n <th md-column md-order-by="duration">\n {{ \'VOICE.DURATION\' | translate }}\n </th>\n <th md-column md-order-by="audio">\n {{ \'VOICE.AUDIO\' | translate }}\n </th>\n <th md-column md-order-by="stamp">\n {{ \'VOICE.RECEIVED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n <td md-cell>\n {{message.id}}\n </td>\n <td md-cell>\n {{message.callerid}}\n </td>\n <td md-cell>\n {{message.duration}}\n </td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>\n {{ message.stamp | formatdate }}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n Delete Message\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicemails-count">\n <span>{{vm.selectedVoicemails.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICEMAIL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicemails.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(voicemail, $event )" translate="VOICE.EDIT_VOICEMAIL">\n Edit Voicemail\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voicemail, $event )" translate="VOICE.DELETE_VOICEMAIL">\n Delete Voicemail\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEMAIL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voicePrefixes/create/dialog.html",'<md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">\n <form name="voicePrefixForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voicePrefix.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voicePrefixForm[\'name\'].$error" ng-show="voicePrefixForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="VoiceExtensionId" ng-model="vm.voicePrefix.VoiceExtensionId" required>\n <md-option ng-value="VoiceExtensionId.id" ng-repeat="VoiceExtensionId in vm.outboundRoutes" ng-disabled="VoiceExtensionId.canSelect === false">{{ VoiceExtensionId.exten }}</md-option>\n </md-select>\n <div ng-messages="voicePrefixForm[\'VoiceExtensionId\'].$error" ng-show="voicePrefixForm[\'VoiceExtensionId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLERIDALL">CallerIdAll</label>\n <input type="text" name="callerIdAll" ng-model="vm.voicePrefix.callerIdAll" ng-pattern="/"(.*)"\\s<(.*?)>$/">\n\n <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>\n <div ng-messages="voicePrefixForm[\'callerIdAll\'].$error" ng-show="voicePrefixForm[\'callerIdAll\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED">CallerIdAll field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN" translate-values="{ regex: \'/"(.*)"\\s<(.*?)>$/\' }">CallerIdAll must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voicePrefix.description">\n\n <div ng-messages="voicePrefixForm[\'description\'].$error" ng-show="voicePrefixForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix" ng-click="vm.savevoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix" ng-click="vm.addNewvoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEPREFIX" translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n ADD VOICEPREFIX\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix" ng-click="vm.deletevoicePrefix($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n <form name="voicePrefixForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEPREFIX">Add Agent to voicePrefix</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n <form name="voicePrefixForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",'<div id="voicePrefixes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEPREFIXES">VoicePrefixes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicePrefixes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicePrefixes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicePrefixes-count">\n <span>{{vm.selectedVoicePrefixes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicePrefixes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicePrefixes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicePrefixes" csv-label="true" filename="voicePrefixes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicePrefixes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICEPREFIX TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicePrefixes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicePrefixes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="VoiceExtensionId">{{ \'VOICE.OUTBOUNDROUTE\' | translate }}</th>\n <th md-column md-order-by="callerIdAll">{{ \'VOICE.CALLERIDALL\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicePrefixes.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicePrefix" md-select-id="id" ng-repeat="voicePrefix in vm.voicePrefixes.rows">\n <td md-cell ng-if="voicePrefix.userpic"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="api/users/{{voicePrefix.id}}/avatar" /></td>\n <td md-cell ng-if="!voicePrefix.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="id ">{{voicePrefix.id}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="name ">{{voicePrefix.name}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="VoiceExtensionId ">{{ (vm.outboundRoutes | filter : {\'id\':voicePrefix.VoiceExtensionId} : true)[0].exten }}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="callerIdAll ">{{voicePrefix.callerIdAll}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="description ">{{voicePrefix.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(voicePrefix, $event )" translate="VOICE.EDIT_VOICEPREFIX">\n Edit voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(voicePrefix, $event )" translate="VOICE.AGENTADD_VOICEPREFIX">\n AgentAdd voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(voicePrefix, $event )" translate="VOICE.TEAMADD_VOICEPREFIX">\n teamadd voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voicePrefix, $event )" translate="VOICE.DELETE_VOICEPREFIX">\n Delete voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicePrefixes.count}}" md-on-paginate="vm.getVoicePrefixes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEPREFIX TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEPREFIX BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicePrefix-button" ng-click="vm.createOrEditvoicePrefix($event)" aria-label="add voicePrefix" translate translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEPREFIX BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n <form name="voiceQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n\n <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n ADD VOICEQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceQueue-image" hide-xs>\n <img ng-src="assets/images/business/voiceQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceQueue.id}}\n <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" value="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXLENGTH">MaxLength</label>\n <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0" value="2" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'no\'">no</md-option>\n <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unknown\'">unknown</md-option>\n <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'no\'">no</md-option>\n <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unknown\'">unknown</md-option>\n <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n <md-select name="announce" ng-model="vm.voiceQueue.announce" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'FALSE\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds" ng-disabled="announce.canSelect === false">{{ announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'once\'">Once</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'limit\'">Limit</md-option>\n <md-option ng-value="\'more\'">More</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n </div>\n <form name="announcementsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Default</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds" ng-disabled="periodic_announce.canSelect === false">{{ periodic_announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds" ng-disabled="queue_reporthold.canSelect === false">{{ queue_reporthold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds" ng-disabled="queue_youarenext.canSelect === false">{{ queue_youarenext.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds" ng-disabled="queue_thereare.canSelect === false">{{ queue_thereare.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds" ng-disabled="queue_callswaiting.canSelect === false">{{ queue_callswaiting.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds" ng-disabled="queue_holdtime.canSelect === false">{{ queue_holdtime.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds" ng-disabled="queue_minutes.canSelect === false">{{ queue_minutes.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds" ng-disabled="queue_minute.canSelect === false">{{ queue_minute.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds" ng-disabled="queue_seconds.canSelect === false">{{ queue_seconds.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds" ng-disabled="queue_thankyou.canSelect === false">{{ queue_thankyou.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.voiceQueue.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.voiceQueue.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SERVICELEVEL">ServiceLevel</label>\n <input type="number" name="servicelevel" ng-model="vm.voiceQueue.servicelevel" min="0" max="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.SERVICELEVEL"></span></div>\n <div ng-messages="advancedForm[\'servicelevel\'].$error" ng-show="advancedForm[\'servicelevel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SERVICELEVEL_REQUIRED">ServiceLevel field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>100</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.mandatoryDisposition" class="md-block">\n <label translate="VOICE.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.voiceQueue.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceQueues-count">\n <span>{{vm.selectedVoiceQueues.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICEQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(voiceQueue, $event )" translate="VOICE.EDIT_VOICEQUEUE">\n Edit VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(voiceQueue, $event )" translate="VOICE.TEAMADD_VOICEQUEUE">\n teamadd VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(voiceQueue, $event )" translate="VOICE.AGENTADD_VOICEQUEUE">\n agentadd VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voiceQueue, $event )" translate="VOICE.DELETE_VOICEQUEUE">\n Delete VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event )" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n goToRealtime VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n ADD VOICERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/edit/view.html",'<div id="voice-voiceRecording" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceRecordings-button md-icon-button" aria-label="Go to voiceRecordings" ng-click="vm.gotoVoiceRecordings()" translate translate-attr-aria-label="VOICE.GO_TO_VOICERECORDINGS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceRecording-image" hide-xs>\n <img ng-src="assets/images/business/voiceRecordings.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceRecording.id}}\n <span ng-if="vm.voiceRecording.name">{{vm.voiceRecording.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceRecording.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceRecording()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(voiceRecordingsForm.$invalid) || (transcriptForm.$invalid) || (sentimentAnalysisForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.GENERAL">GENERAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceRecording-detail-form-container voicerecordings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.VOICERECORDINGS">VOICERECORDINGS</div>\n </div>\n <form name="voiceRecordingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TYPE">Type</label>\n <input type="" name="type" ng-model="vm.voiceRecording.type" autofocus disabled>\n\n <div ng-messages="voiceRecordingsForm[\'type\'].$error" ng-show="voiceRecordingsForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.UNIQUEID">UniqueId</label>\n <input type="" name="uniqueid" ng-model="vm.voiceRecording.uniqueid" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'uniqueid\'].$error" ng-show="voiceRecordingsForm[\'uniqueid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.UNIQUEID_REQUIRED">UniqueId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLER">Caller</label>\n <input type="" name="calleridnum" ng-model="vm.voiceRecording.calleridnum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'calleridnum\'].$error" ng-show="voiceRecordingsForm[\'calleridnum\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_REQUIRED">Caller field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLED">Called</label>\n <input type="" name="exten" ng-model="vm.voiceRecording.exten" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'exten\'].$error" ng-show="voiceRecordingsForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLED_REQUIRED">Called field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONNECTED">Connected</label>\n <input type="" name="connectedlinenum" ng-model="vm.voiceRecording.connectedlinenum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'connectedlinenum\'].$error" ng-show="voiceRecordingsForm[\'connectedlinenum\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONNECTED_REQUIRED">Connected field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="" name="queue" ng-model="vm.voiceRecording.queue" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'queue\'].$error" ng-show="voiceRecordingsForm[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGENT">Agent</label>\n <input type="text" name="membername" ng-model="vm.voiceRecording.membername" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'membername\'].$error" ng-show="voiceRecordingsForm[\'membername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingsForm[\'rating\'].$error" ng-show="voiceRecordingsForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DISPOSITION">Disposition</label>\n <input type="text" name="userDisposition" ng-model="vm.voiceRecording.userDisposition" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'userDisposition\'].$error" ng-show="voiceRecordingsForm[\'userDisposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECOND_LEVEL_DISPOSITION">Second_Level_Disposition</label>\n <input type="text" name="userSecondDisposition" ng-model="vm.voiceRecording.userSecondDisposition" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'userSecondDisposition\'].$error" ng-show="voiceRecordingsForm[\'userSecondDisposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECOND_LEVEL_DISPOSITION_REQUIRED">Second_Level_Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THIRD_LEVEL_DISPOSITION">Third_Level_Disposition</label>\n <input type="text" name="userThirdDisposition" ng-model="vm.voiceRecording.userThirdDisposition" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'userThirdDisposition\'].$error" ng-show="voiceRecordingsForm[\'userThirdDisposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THIRD_LEVEL_DISPOSITION_REQUIRED">Third_Level_Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.license.ai">\n <md-tab-label>\n <span translate="VOICE.TRANSCRIPTANALYSIS">TRANSCRIPTANALYSIS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceRecording-detail-form-container transcript md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.TRANSCRIPT">TRANSCRIPT</div>\n </div>\n <form name="transcriptForm" novalidate>\n <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'COMPLETED\'" class="md-block">\n <label translate="VOICE.TEXT">Text</label>\n <textarea name="fileText" ng-model="vm.voiceRecording.fileText" autofocus ng-disabled="true"></textarea>\n </md-input-container>\n <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'FAILED\'" class="md-block">\n <label translate="VOICE.FAILUREREASON">FailureReason</label>\n <textarea name="failureReason" ng-model="vm.voiceRecording.failureReason" ng-disabled="true"></textarea>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceRecording-detail-form-container sentimentanalysis md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoiceRecordingSentimentStatisticsController as vm_ss" ng-init="vm_ss.init(vm.voiceRecording)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.SENTIMENTANALYSIS" style="width: 50px;">Sentiment Analysis</span>\n <div flex></div>\n </div>\n </md-toolbar>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 sentiment" ng-class="vm_ss.voiceRecording.sentiment">\n {{vm_ss.voiceRecording.sentiment}}\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sPositive || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_POSITIVE\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sNegative || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_NEGATIVE\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sNeutral || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_NEUTRAL\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 5 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sMixed || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_MIXED\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 5 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()"></ms-quick-filter>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceRecordings-count">\n <span>{{vm.selectedVoiceRecordings.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribesentimentSelectedVoiceRecordings($event)" aria-label="transcribesentiment selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBESENTIMENT_SELECTED">\n <md-icon md-font-icon="icon-text-to-speech"></md-icon>\n <md-tooltip>{{\'VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribeSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBE_SELECTED">\n <md-icon md-font-icon="icon-format-size"></md-icon>\n <md-tooltip>{{\'VOICE.RUNTRANSCRIBE_VOICERECORDING\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runsentimentSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.SENTIMENT_SELECTED">\n <md-icon md-font-icon="icon-heart-outline"></md-icon>\n <md-tooltip>{{\'VOICE.RUNSENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="transcribeStatus" ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBE\' | translate }}</th>\n <th md-column md-order-by="sentiment" ng-if="vm.license.ai">{{ \'VOICE.SENTIMENTANALYSIS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="16">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.calleridnum}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.connectedlinenum}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.membername}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio " ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id" model="\'voiceRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userSecondDisposition ">{{voiceRecording.userSecondDisposition}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userThirdDisposition ">{{voiceRecording.userThirdDisposition}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="transcribeStatus " ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBESTATUS_\' + voiceRecording.transcribeStatus | translate}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="sentiment " ng-if="vm.license.ai">{{voiceRecording.sentiment}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(voiceRecording, $event )" translate="VOICE.EDIT_VOICERECORDING">\n Edit VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n <md-button ng-click="vm.runtranscriberuntranscribesentiment(voiceRecording, $event )" translate="VOICE.RUNTRANSCRIBE_VOICERECORDING">\n RunTranscribe VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n <md-button ng-click="vm.runtranscribesentimentruntranscribesentiment(voiceRecording, $event )" translate="VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING">\n RunTranscribeSentiment VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && voiceRecording.sentiment == null && vm.license.ai">\n\n <md-button ng-click="vm.runsentimentruntranscribesentiment(voiceRecording, $event )" translate="VOICE.RUNSENTIMENT_VOICERECORDING">\n RunSentiment VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && vm.license.ai">\n\n <md-button ng-click="vm.downloadtranscribefile2(voiceRecording, $event )" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n DownloadTranscribe VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadVoiceRecordings">\n\n <md-button ng-click="vm.downloadfile2(voiceRecording, $event , \'voice/recordings\' )" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voiceRecording, $event )" translate="VOICE.DELETE_VOICERECORDING">\n Delete VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus ng-disabled="!vm.newWhatsappAccount">\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="whatsappAccountForm[\'name\'].$error" ng-show="whatsappAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">key</label>\n <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="whatsappAccountForm[\'key\'].$error" ng-show="whatsappAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LIST">List</label>\n <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n <div ng-messages="whatsappAccountForm[\'ListId\'].$error" ng-show="whatsappAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="whatsappAccountForm[\'remote\'].$error" ng-show="whatsappAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TYPE">Type</label>\n <md-select name="type" ng-model="vm.whatsappAccount.type">\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'sinch\'">Sinch</md-option>\n </md-select>\n <div ng-messages="whatsappAccountForm[\'type\'].$error" ng-show="whatsappAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true">\n\n <div ng-messages="whatsappAccountForm[\'accountSid\'].$error" ng-show="whatsappAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true">\n\n <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.BASEURL">Base URL</label>\n\n \x3c!-- <input type="text" name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" ng-required="true"> --\x3e\n\n <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required>\n <md-option ng-value="\'https://us1.whatsapp.api.sinch.com\'">US Production</md-option>\n <md-option ng-value="\'https://eu1.whatsapp.api.sinch.com\'">EU Production</md-option>\n </md-select>\n\n <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PHONE">phone</label>\n <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true">\n <div ng-messages="whatsappAccountForm[\'phone\'].$error" ng-show="whatsappAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappAccount.description">\n\n <div ng-messages="whatsappAccountForm[\'description\'].$error" ng-show="whatsappAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappAccount" ng-click="vm.saveWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid || whatsappAccountForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappAccount" ng-click="vm.addNewWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPACCOUNT" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n ADD WHATSAPPACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappAccount" ng-click="vm.deleteWhatsappAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",'<md-dialog class="whatsappAccount-dialog" aria-label="whatsappAccount" ng-init="vm.onInit()">\n <form name="whatsappAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">Add Agent to whatsappAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/agent/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'agent\'].$error" ng-show="whatsappAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'accesskeyid\'].$error" ng-show="whatsappAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'secretaccesskey\'].$error" ng-show="whatsappAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'lexregion\'].$error" ng-show="whatsappAccountFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'botname\'].$error" ng-show="whatsappAccountFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'times\'].$error" ng-show="whatsappAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="whatsappAccountFormApp[\'text\'].$error" ng-show="whatsappAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/close/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'disposition\'].$error" ng-show="whatsappAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'key\'].$error" ng-show="whatsappAccountFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'projectId\'].$error" ng-show="whatsappAccountFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'clientEmail\'].$error" ng-show="whatsappAccountFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="whatsappAccountFormApp[\'privateKey\'].$error" ng-show="whatsappAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'condition\'].$error" ng-show="whatsappAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'truepriority\'].$error" ng-show="whatsappAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'falsepriority\'].$error" ng-show="whatsappAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'priority\'].$error" ng-show="whatsappAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/noop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'value\'].$error" ng-show="whatsappAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/queue/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'queue\'].$error" ng-show="whatsappAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/system/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'command\'].$error" ng-show="whatsappAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'variable\'].$error" ng-show="whatsappAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/tag/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'tag\'].$error" ng-show="whatsappAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",'<div id="whatsapp-whatsappAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-whatsappAccounts-button md-icon-button" aria-label="Go to whatsappAccounts" ng-click="vm.gotoWhatsappAccounts()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="whatsappAccount-image" hide-xs>\n <img ng-src="assets/images/business/whatsappAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.whatsappAccount.id}}\n <span ng-if="vm.whatsappAccount.name">{{vm.whatsappAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.whatsappAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveWhatsappAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (whatsappDispositionsForm.$invalid) || (whatsappCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">key</label>\n <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LIST">List</label>\n <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.BASEURL">BaseURL</label>\n\n <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryBaseUrl.url" ng-repeat="mandatoryBaseUrl in vm.baseUrl" ng-disabled="mandatoryBaseUrl.canSelect === false">{{ mandatoryBaseUrl.name }}</md-option>\n </md-select>\n\n <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.BASEURL_REQUIRED">Base URL field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PHONE">phone</label>\n <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.RECEIVEURL">receiveUrl</label>\n\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.whatsappAccount.remote + \'/api/whatsapp/accounts/\' + vm.whatsappAccount.id + \'/notify?token=\' + vm.whatsappAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="WHATSAPP.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.whatsappAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.whatsappAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="whatsappAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="WHATSAPP.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.whatsappAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="whatsappAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.queueTransfer == true" class="md-block">\n <label translate="WHATSAPP.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.whatsappAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.agentTransfer == true" class="md-block">\n <label translate="WHATSAPP.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.whatsappAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.whatsappAccount.token" disabled>\n\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="whatsappAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.mandatoryDisposition" class="md-block">\n <label translate="WHATSAPP.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.whatsappAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="WHATSAPP.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="WhatsappAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="whatsappAccount-detail-form-container whatsappdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="WHATSAPP.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add whatsapp dispositions" translate translate-attr-label="WHATSAPP.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container whatsappcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="WhatsappAccountWhatsappCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="WHATSAPP.WHATSAPPCANNEDANSWERS">WhatsappCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getWhatsappAccountWhatsappCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event)" aria-label="add whatsappCannedAnswer" translate translate-attr-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length}} {{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountWhatsappCannedAnswers" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountWhatsappCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountWhatsappCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'WHATSAPP.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'WHATSAPP.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'WHATSAPP.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'WHATSAPP.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'WHATSAPP.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="whatsappCannedAnswer" md-select-id="id" ng-repeat="whatsappCannedAnswer in vm_dc.whatsappAccountWhatsappCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{ whatsappCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" translate="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER">\n Edit WhatsappCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(whatsappCannedAnswer, $event)" translate="WHATSAPP.DELETE_WHATSAPPCANNEDANSWER">\n Delete WhatsappCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.whatsappAccountWhatsappCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="WHATSAPP.NO_WHATSAPPCANNEDANSWER_AVAILABLE">No whatsappcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountWhatsappCannedAnswers.count}}" md-on-paginate="vm_dc.getWhatsappAccountWhatsappCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="WhatsappAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.whatsappAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="WHATSAPP.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedWhatsappAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedWhatsappAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedWhatsappAccountApps.length}} {{vm_ac.selectedWhatsappAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedWhatsappAccountApps($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedWhatsappAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.whatsappAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editWhatsappAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.whatsappAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="WhatsappAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="WHATSAPP.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getWhatsappAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getWhatsappAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getWhatsappAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="WHATSAPP.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedWhatsappAccountInteractions.length}} {{vm_dc.selectedWhatsappAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountInteractions" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'WHATSAPP.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'WHATSAPP.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'WHATSAPP.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'WHATSAPP.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'WHATSAPP.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'WHATSAPP.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'WHATSAPP.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.whatsappAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'WHATSAPP.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'WHATSAPP.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spywhatsappInteraction($event, interaction)" translate="WHATSAPP.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.whatsappInteractionDownload(interaction, $event)" translate="WHATSAPP.DOWNLOAD_INTERACTION">\n Download\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="WHATSAPP.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.whatsappAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="WHATSAPP.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountInteractions.count}}" md-on-paginate="vm_dc.getWhatsappAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",'<md-dialog class="whatsappCannedAnswer-dialog" aria-label="New WhatsappCannedAnswer">\n <form name="whatsappCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">Key</label>\n <input type="" name="key" ng-model="vm.whatsappCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="whatsappCannedAnswerForm[\'key\'].$error" ng-show="whatsappCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.VALUE">Value</label>\n <textarea name="value" ng-model="vm.whatsappCannedAnswer.value" required></textarea>\n\n <div ng-messages="whatsappCannedAnswerForm[\'value\'].$error" ng-show="whatsappCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappCannedAnswer.description">\n\n <div ng-messages="whatsappCannedAnswerForm[\'description\'].$error" ng-show="whatsappCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappCannedAnswer" ng-click="vm.saveWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid || whatsappCannedAnswerForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappCannedAnswer" ng-click="vm.addNewWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPCANNEDANSWER" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n ADD WHATSAPPCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappCannedAnswer" ng-click="vm.deleteWhatsappCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",'<div id="whatsappAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="WHATSAPP.WHATSAPPACCOUNTS">WhatsappAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedWhatsappAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedWhatsappAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="WHATSAPP.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-whatsappAccounts-count">\n <span>{{vm.selectedWhatsappAccounts.length}}</span>\n <span translate="WHATSAPP.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllWhatsappAccounts()" translate="WHATSAPP.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectWhatsappAccounts()" translate="WHATSAPP.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappAccounts" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappAccounts($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- WHATSAPPACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedWhatsappAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'WHATSAPP.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'WHATSAPP.LIST\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'WHATSAPP.TYPE\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'WHATSAPP.PHONE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.whatsappAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="whatsappAccount" md-select-id="id" ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n <td md-cell ng-if="whatsappAccount.userpic"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="api/users/{{whatsappAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!whatsappAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="id ">{{whatsappAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="name ">{{whatsappAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="key ">{{whatsappAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':whatsappAccount.ListId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="type ">{{ vm.arraytype[whatsappAccount.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="phone ">{{whatsappAccount.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="description ">{{whatsappAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(whatsappAccount, $event )" translate="WHATSAPP.EDIT_WHATSAPPACCOUNT">\n Edit WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(whatsappAccount, $event )" translate="WHATSAPP.INTERACTIONS_WHATSAPPACCOUNT">\n Interactions WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(whatsappAccount, $event )" translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">\n AgentAdd WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(whatsappAccount, $event )" translate="WHATSAPP.DELETE_WHATSAPPACCOUNT">\n Delete WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappAccounts.count}}" md-on-paginate="vm.getWhatsappAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / WHATSAPPACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD WHATSAPPACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappAccount-button" ng-click="vm.createOrEditWhatsappAccount($event)" aria-label="add whatsappAccount" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD WHATSAPPACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",'<md-dialog class="whatsappQueue-dialog" aria-label="New WhatsappQueue">\n <form name="whatsappQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newWhatsappQueue">\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="whatsappQueueForm[\'name\'].$error" ng-show="whatsappQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="whatsappQueueForm[\'strategy\'].$error" ng-show="whatsappQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="whatsappQueueForm[\'timeout\'].$error" ng-show="whatsappQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappQueue.description">\n\n <div ng-messages="whatsappQueueForm[\'description\'].$error" ng-show="whatsappQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappQueue" ng-click="vm.saveWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid || whatsappQueueForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappQueue" ng-click="vm.addNewWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPQUEUE" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n ADD WHATSAPPQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappQueue" ng-click="vm.deleteWhatsappQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n <form name="whatsappQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">Add Agent to whatsappQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n <form name="whatsappQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="WHATSAPP.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",'<div id="whatsapp-whatsappQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-whatsappQueues-button md-icon-button" aria-label="Go to whatsappQueues" ng-click="vm.gotoWhatsappQueues()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="whatsappQueue-image" hide-xs>\n <img ng-src="assets/images/business/whatsappQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.whatsappQueue.id}}\n <span ng-if="vm.whatsappQueue.name">{{vm.whatsappQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.whatsappQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.whatsappQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveWhatsappQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",'<div id="whatsappQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="WHATSAPP.WHATSAPPQUEUES">WhatsappQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedWhatsappQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedWhatsappQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="WHATSAPP.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-whatsappQueues-count">\n <span>{{vm.selectedWhatsappQueues.length}}</span>\n <span translate="WHATSAPP.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllWhatsappQueues()" translate="WHATSAPP.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectWhatsappQueues()" translate="WHATSAPP.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappQueues" csv-label="true" filename="whatsappQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappQueues($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- WHATSAPPQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedWhatsappQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'WHATSAPP.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.whatsappQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="whatsappQueue" md-select-id="id" ng-repeat="whatsappQueue in vm.whatsappQueues.rows">\n <td md-cell ng-if="whatsappQueue.userpic"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="api/users/{{whatsappQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!whatsappQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="id ">{{whatsappQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="name ">{{whatsappQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="strategy ">{{ vm.arraystrategy[whatsappQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(whatsappQueue, $event )" translate="WHATSAPP.EDIT_WHATSAPPQUEUE">\n Edit WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(whatsappQueue, $event )" translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE">\n teamadd WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(whatsappQueue, $event )" translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">\n agentadd WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(whatsappQueue, $event )" translate="WHATSAPP.DELETE_WHATSAPPQUEUE">\n Delete WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(whatsappQueue, $event )" translate="WHATSAPP.GOTOREALTIME_WHATSAPPQUEUE">\n goToRealtime WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappQueues.count}}" md-on-paginate="vm.getWhatsappQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / WHATSAPPQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD WHATSAPPQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappQueue-button" ng-click="vm.createOrEditWhatsappQueue($event)" aria-label="add whatsappQueue" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD WHATSAPPQUEUE BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n </div>\n <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n <md-tab>\n <md-tab-label>\n <span translate="QUICKPANEL.TODAY">TODAY</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="today-tab scrollable" ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n <span>MESSENGER</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="chat-tab scrollable" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="group-tab scrollable" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.FRIENDS">Friends</span>\n </md-subheader>\n\n <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n <div class="status {{friend.status}}"></div>\n\n <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n <div class="md-list-item-text">\n <h3 class="message">{{friend.message}}</h3>\n <p class="time">{{friend.time}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n </md-subheader>\n\n <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n <div class="md-list-item-text">\n <h3>{{server.location}}</h3>\n <p>{{server.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n </md-subheader>\n\n <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n <div class="md-list-item-text">\n <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main" ng-hide="vm_ct.user && vm_ct.isMessengerAllowed">\n <audio id="beep-player" hidden src="/assets/ms-phonebar/sounds/beep.ogg"></audio>\n <md-subheader class="md-no-sticky">\n <div class="search" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input class="search-input" ng-model="vm_ct.search.$" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin" aria-label="Chat Tab Search">\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL">All</md-option>\n <md-option ng-value="true">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg" translate="CHAT.ONLINE"></md-icon>Online\n </md-option>\n <md-option ng-value="false">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg" translate="CHAT.OFFLINE"></md-icon>Offline\n </md-option>\n </md-select>\n </div>\n </md-subheader>\n <md-divider></md-divider>\n <md-list class="recent">\n <md-list-item class="contact md-3-line" ng-if="user.id !== vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter: vm_ct.search" ng-click="vm_ct.openChat(user)">\n <md-divider></md-divider>\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : vm_ct.defaultAvatar}}" class="md-avatar" alt="{{user.fullname}}" />\n <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n <div ng-if="vm_ct.unreadMessages[user.id]" class="md-accent-bg unread-message-count">\n {{vm_ct.unreadMessages[user.id]}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{user.fullname}}</h3>\n <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper">\n </md-icon>\n </div>\n <p>{{user.name}} <{{user.internal}}></p>\n <div layout="row" layout-align="start center">\n <md-icon ng-if="user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" ng-class="{\'md-accent\': user.lastMessage.read}" md-font-icon="{{ user.lastMessage.read ? \'icon-check-all\' : \'icon-check\' }}"></md-icon>\n <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n <span flex></span>\n <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">\n {{user.lastMessageAt | formatdate}}</p>\n </div>\n </md-list-item>\n</div>\n</md-list>\n</div>\n\n<div class="chat" ng-show="vm_ct.user && vm_ct.isMessengerAllowed" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_ct.closeChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span>{{vm_ct.user.fullname}}</span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-dialog">\n <div ng-if="vm_ct.isLoading" layout="row" layout-align="center center">\n <md-progress-circular class="md-accent" md-diameter="48" md-mode="indeterminate"></md-progress-circular>\n </div>\n <div ms-timeline="vm_ct.timelineOptions" ms-timeline-load-more="vm_ct.loadMoreMessages()">\n <div layout="row" ng-repeat="message in vm_ct.user.messages" class="ms-timeline-item md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{ vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : vm_ct.defaultAvatar }}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n <img ng-if="message.FromId === vm_ct.currentUser.id" ng-src="{{ vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : vm_ct.defaultAvatar }}" class="avatar">\n <div class="bubble timeline-card" flex>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text">{{ message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_ct.currentUser.id" class="s16 margin-5" ng-class="{\'md-accent\': message.read}" md-font-icon="{{ message.read ? \'icon-check-all\' : \'icon-check\' }}"></md-icon>\n </div>\n </div>\n </div>\n\n <div ng-if="vm_ct.hasMoreMessages" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row">\n <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-click="vm_ct.loadMoreMessages()" translate="DASHBOARDS.MORE">\n </md-button>\n </div>\n <div ng-if="!vm_ct.hasMoreMessages && vm_ct.user.messages.length > 20" layout="row" layout-align="end center" class="ng-scope layout-align-center-center layout-row">\n <md-button class="md-fab md-mini" type="button" ng-click="vm_ct.scrollToTopOfChat(0)">\n <md-icon md-font-icon="icon-arrow-up-bold"></md-icon>\n </md-button>\n </div>\n </div>\n </md-content>\n\n <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n \x3c!--START Error--\x3e\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n \x3c!--END Error--\x3e\n\n \x3c!--START NAME--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END NAME--\x3e\n\n \x3c!--START Members--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.MEMBERS">Members</label>\n <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n </md-contact-chips>\n <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END Members--\x3e\n\n \x3c!--START Writing--\x3e\n <md-input-container class="md-block">\n <md-switch ng-model="vm.group.write" aria-label="Write">\n {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n </md-switch>\n </md-input-container>\n \x3c!--END Writing--\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE" translate-attr-aria-label="QUICKPANEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main" ng-if="!vm_cg.group">\n <md-subheader>\n <div layout="row">\n \x3c!-- START Search --\x3e\n <div class="search" layout="row" layout-align="start center" flex>\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n </div>\n \x3c!-- END Search --\x3e\n\n \x3c!-- START New Group --\x3e\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n </md-button>\n \x3c!-- END New Group --\x3e\n </div>\n </md-subheader>\n\n <md-divider></md-divider>\n\n \x3c!-- START Groups --\x3e\n <md-list class="recent no-padding">\n \x3c!-- START Group --\x3e\n <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{group.name}}</h3>\n </div>\n </div>\n\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n </md-button>\n\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item>\n <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n </div>\n </md-list-item>\n \x3c!-- END Group --\x3e\n </md-list>\n \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat" ng-if="vm_cg.group" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools " layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK" flex="15">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4 flex layout-align="start center" style="max-height: 100%; overflow-y:auto;">\n <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n </h4>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_cg.webcall(vm_cg.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings id="chat-group-dialog">\n <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <div ng-if="message.FromId !== vm_cg.currentUser.id">\n <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n </div>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n <div layout="row">\n <div layout="row" layout-align="start center">\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n <span>{{user.fullname}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n </div>\n </div>\n <div>\n <md-divider ng-if="!$last"></md-divider>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n <md-list-item class="md-display-1 md-2-line">\n <div class="secondary-text">\n <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n <div layout="row" layout-align="start start">\n <span> {{vm.date | date:\'d\'}}</span>\n <span class="md-subhead">th</span>\n <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n </div>\n </div>\n </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{event.title}}</h3>\n\n <p>{{event.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{note.title}}</h3>\n\n <p>{{note.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n <div id="reset-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n <form name="resetPasswordForm" novalidate>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n <div ng-messages="resetPasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n RESET MY PASSWORD\n </md-button>\n </form>\n </div>\n </div>\n</div>'),e.put("app/toolbar/autoanswers/dialog.html",'<md-dialog class="autoanswers-dialog" aria-label="autoanswers">\n <form name="autoanswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ (\'TOOLBAR.AUTOANSWER_NOTIFICATIONS\' | translate) }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content layout-padding>\n <md-table-container>\n <table md-table multiple>\n <thead md-head>\n <tr md-row>\n <th></th>\n <th md-column>{{ \'TOOLBAR.CHANNEL\' | translate }}</th>\n <th md-column>{{ \'TOOLBAR.NOTIFICATIONS\' | translate }}</th>\n <th md-column>{{ \'TOOLBAR.DELAY\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="item in vm.items" ng-if="item.permission">\n <td>\n <md-icon md-font-icon="{{item.font_icon}}" class="icon {{item.class}} {{item.font_icon}}" aria-label="{{item.label}}"></md-icon>\n </td>\n <td md-cell>\n <div layout="row">\n <span translate="{{item.title}}"></span>\n </div>\n </td>\n <td md-cell align="center">\n <div layout="row" layout-align="center">\n <md-icon ng-if="item.enabled" md-font-icon="icon-check-circle" class="icon green-700-fg"></md-icon>\n <span ng-if="!item.enabled" style="color:red">X</span>\n </div>\n </td>\n <td md-cell align="right">\n <div layout="row" layout-align="end">\n <span ng-if="item.enabled">{{item.delay}}</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-dialog-content>\n\n <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="changePasswordForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n <div ng-messages="changePasswordForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="TOOLBAR.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n <div layout="row" layout-align="start center" flex>\n <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n </md-button>\n\n <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n <div class="toolbar-separator"></div>\n\n <div ng-if="vm.license.demo" class="blink md-padding">\n <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n </div>\n\n <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() |\n uppercase }}</span>\n </div>\n\n \x3c!-- phonebar directive WebRtc type--\x3e\n <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" sessions="vm.webRTCSessions" registered="vm.isWebRTCBarRegistered" flex></ms-phonebar>\n \x3c!-- phonebar directive --\x3e\n </div>\n\n <div layout="row" layout-align="start center">\n\n <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32">\n </md-progress-circular>\n\n \x3c!-- Pause Management --\x3e\n <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n <div class="toolbar-separator"></div>\n\n <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n </md-button>\n\n <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n </md-button>\n\n <md-menu>\n <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="4">\n <md-menu-item ng-if="!vm.pauses.length">\n <md-button disabled="disabled">\n <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="pause in vm.pauses">\n <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n {{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n \x3c!-- Pause Management --\x3e\n\n <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n <div layout="row" layout-align="space-between center">\n <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt"></timer>\n <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n </div>\n <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n <timer start-time="vm.user.lastPauseAt"></timer>\n <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n </div>\n <div ng-if="vm.user.voicePause">\n <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n </div>\n </div>\n\n <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n <md-menu-bar id="user-menu">\n <md-menu md-position-mode="left bottom">\n <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n <div layout="row" layout-align="space-between center">\n <div class="avatar-wrapper">\n <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n </div>\n <div layout="column" layout-align="center center" class="padding-horizontal-5">\n <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n <span class="font-size-12 md-subhead">{{vm.user.name}} <{{vm.user.internal}}></span>\n </div>\n\n <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n </div>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n </md-menu-item>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change\n Password</span></md-button>\n </md-menu-item>\n\n <md-menu-divider></md-menu-divider>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n <md-button ng-click="vm.logout()">Logout</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-bar>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.user.role === \'agent\' && (vm.license.chat || vm.license.mail || vm.license.messaging || vm.license.openchannel || vm.license.fax || vm.license.whatsapp)" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.autoAnswerNotificationsDialog($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <md-icon md-font-icon="icon-reply" class="icon {{ vm.autoanswerIconColor }}"></md-icon>\n <md-tooltip><span translate="TOOLBAR.AUTOANSWER_NOTIFICATIONS">Notifications</span></md-tooltip>\n </md-button>\n\n <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.contacts" class="md-accent-bg open-contact-count badge-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n </md-button>\n \n \x3c!-- \n ADD V3\n \n <md-button ng-if="vm.user.role === \'agent\' && vm.license.voice && vm.user.permissions.includes(110)" class="preview-button no-margin" ng-disabled="vm.disable" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.waitingQueueCalls.length > 0" class="md-accent-bg queues-call-count badge-count">{{vm.waitingQueueCalls.length}}</div>\n <md-icon md-font-icon="icon-phone-incoming blue-fg" class="icon"></md-icon>\n <md-tooltip><span translate="TOOLBAR.WAITINGQUEUECALLS">Waiting Queues Calls</span></md-tooltip>\n </md-button> --\x3e\n\n \x3c!-- \n ADD V3\n \n <md-button ng-if="vm.user.role === \'agent\' && vm.license.voice && vm.user.permissions.includes(110)" class="preview-button no-margin" ng-disabled="vm.disable" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.waitingQueueCalls.length > 0" class="md-accent-bg queues-call-count badge-count">{{vm.waitingQueueCalls.length}}</div>\n <md-icon md-font-icon="icon-phone-incoming blue-fg" class="icon"></md-icon>\n <md-tooltip><span translate="TOOLBAR.WAITINGQUEUECALLS">Waiting Queues Calls</span></md-tooltip>\n </md-button> --\x3e\n\n <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n <div layout="row" layout-align="center center">\n <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n </div>\n </md-button>\n\n <md-menu-content width="3" id="language-menu-content">\n <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n <span layout="row" layout-align="start center">\n <img class="flag flag-24" ng-src="assets/images/flags/{{lang.flag}}.png">\n <span>{{ lang.translation | translate | startcase }}</span>\n </span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n\n <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">\n {{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n <form name="previewForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ (\'TOOLBAR.PREVIEW\' | translate) + (vm.preview.recallme ? \' - \' +\n (\'CONTACTMANAGER.RECALLME\' | translate | uppercase) : \'\') }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div ng-if="vm.preview">\n <div ng-if="vm.preview.recallme" layout="row" class="recall-me-info">\n <md-icon md-font-icon="icon-information-outline" aria-label="Recall Me"></md-icon>\n <p class="ml-5" translate="TOOLBAR.HELP.PREVIEW_RECALLME" translate-values="{ date: (vm.preview.scheduledat | date:\'short\') }" flex></p>\n </div>\n <div layout="row">\n <div class="md-padding md-margin" layout="column" flex="30">\n <md-input-container ng-if="vm.preview.Contact.id" class="md-block no-margin">\n <label translate="CONTACTMANAGER.ID">ID</label>\n <input type="text" ng-model="vm.preview.Contact.id" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Queue.name" class="md-block no-margin">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.List.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <input type="text" ng-model="vm.preview.List.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.tags && vm.preview.Contact.tags.length" class="md-block no-margin">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <input type="text" ng-model="vm.preview.Contact.tags" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.Company && vm.preview.Contact.Company.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <input type="text" ng-model="vm.preview.Contact.Company.name" disabled="true">\n </md-input-container>\n </div>\n <md-divider></md-divider>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && !vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ \'CONTACTMANAGER.\' + key.toUpperCase() | translate}}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n\n <md-input-container ng-if="vm.additionalItems.length>0" class="md-block no-margin">\n <label translate="CONTACTMANAGER.ADDITIONAL_PHONES">Additional phones</label>\n <md-chips ng-model="vm.additionalItems" placeholder="Phone numbers" readonly="true">\n <md-chip-template custom-chip alt="{{$chip.type}} {{$chip.description}}" title="{{$chip.type}} {{$chip.description}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n </div>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ vm.customFieldsMap[key] || key }}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n </div>\n </div>\n </div>\n <div layout="row" ng-if="!vm.preview">\n <span>no contacts available</span>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n <md-button class="md-icon-button md-primary" ng-if="!vm.isRecallNotification" ng-hide="vm.hopperIds.length <= 1" ng-disabled="vm.disableGetContact" ng-click="vm.previousContact()" aria-label="PREVIOUSCONTACT" translate-attr-aria-label="TOOLS.PREVIOUSCONTACT">\n <md-icon md-font-icon="icon-chevron-left"></md-icon>\n </md-button>\n <md-button class="md-fab green-bg" aria-label="CALL" translate-attr-aria-label="TOOLS.CALL" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-button class="md-icon-button md-primary" ng-if="!vm.isRecallNotification" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact()" aria-label="NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n <md-icon md-font-icon="icon-chevron-right"></md-icon>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>')}]);
\ No newline at end of file
+!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.client-side-logging",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","ui.router.state.events","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,n){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),n.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),n.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),n.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.realtime","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.motiondialer","app.help","app.jscripty","app.marketplace","app.plugins","app.video","app.whatsapp","app.login","app.forgot","app.reset","app.errors","app.user-setting","app.client-side-logging"])}(),function(){"use strict";function e(e,n){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),n.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Metrics",fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1201})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ExtractedReports",fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1202})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),n.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,n,a,i){var s;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:n.id}).then(function(e){var n=[];if((s=e).joins)try{s.joins=JSON.parse(s.joins);for(var t=0;t<s.joins.length;t+=1)n.push(i.getColumns(s.joins[t].foreignTable))}catch(e){console.log(e)}return a.all(n)}).then(function(e){for(var n=0;n<e.length;n+=1)s.joins[n].foreignTableFields=_.difference(_.keys(e[n]),["$promise","$resolved"]);return s})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1101})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareRecordings",fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadCallySquareRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1102})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),n.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},params:{crudPermissions:void 0},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("squareProject@get",{id:n.id})}],users:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Users",mergeResources:!0,fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",type:"inbound",fields:"id,name",sort:"name",nolimit:!0})}],sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ODBC",fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"id,name",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,n){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),n.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:510})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",params:{channel:"chat"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",params:{channel:"chat"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"ChatQueues":void 0,channel:"chat",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadContactManagerLists",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,n){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,n){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver","Auth",function(e,n){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:304})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),n.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","Auth","$stateParams",function(e,n,t){return n.hasRole("admin")?e.resolve("cmContact@get",_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t)):e.resolve("userProfile@getResources",_.merge({id:n.getCurrentUser().userProfileId,section:"Contacts",includeAll:!0,sort:"-updatedAt",limit:10,offset:0},t))}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],listsMap:["lists",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies",fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var n={},t=0;t<e.rows.length;t++)n[e.rows[t].id]=e.rows[t].name;return n}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"id,name",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",params:{crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@get",{id:n.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHoppers",{id:n.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperFinals",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getHopperHistories",{id:n.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,n){return e.resolve("cmContact@getJscriptySessions",{id:n.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmCompany@get"):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Companies"})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,n){return n.ListId?e.resolve("cmList@getCustomFields",{id:n.ListId}):null}],tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{sort:"name"}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),n.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"VoiceQueues",mergeResources:!0,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return t=e,n.resolve("rpc@getVoiceQueues",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)t&&t.id===e.rows[n].id?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged,a.abandoned+=e.rows[n].abandoned):(a=_.find(t.rows,{id:e.rows[n].id}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged","abandoned"]));return t})}],faxAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("faxAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"FaxAccounts",mergeResources:!0,fields:"id,name",channel:"fax",nolimit:!0})).then(function(e){return t=e,n.resolve("faxInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].FaxAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].FaxAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],chatWebsites:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("chatWebsite@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"ChatWebsites",mergeResources:!0,fields:"id,name",channel:"chat",nolimit:!0})).then(function(e){return t=e,n.resolve("chatInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].ChatWebsiteId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.abandoned+=e.rows[n].abandoned,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].ChatWebsiteId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","abandoned","unmanaged"]));return t})}],smsAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("smsAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"SmsAccounts",mergeResources:!0,fields:"id,name",channel:"sms",nolimit:!0})).then(function(e){return t=e,n.resolve("smsInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].SmsAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].SmsAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],openchannelAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("openchannelAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"OpenchannelAccounts",mergeResources:!0,fields:"id,name",channel:"openchannel",nolimit:!0})).then(function(e){return t=e,n.resolve("openchannelInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].OpenchannelAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].OpenchannelAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],mailAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("mailAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"MailAccounts",mergeResources:!0,fields:"id,name",channel:"mail",nolimit:!0})).then(function(e){return t=e,n.resolve("mailInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].MailAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].MailAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],whatsappAccounts:["apiResolver","Auth",function(n,e){var t,a;return(e.hasRole("admin")?n.resolve("whatsappAccount@get",{fields:"id,name",nolimit:!0}):n.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"WhatsappAccounts",mergeResources:!0,fields:"id,name",channel:"whatsapp",nolimit:!0})).then(function(e){return t=e,n.resolve("whatsappInteraction@get",{createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}).then(function(e){if(e&&0<e.count)for(var n=0;n<e.rows.length;n+=1)a&&a.id===e.rows[n].WhatsappAccountId?(a.total+=e.rows[n].total,a.waiting+=e.rows[n].waiting,a.talking+=e.rows[n].talking,a.answered+=e.rows[n].answered,a.unmanaged+=e.rows[n].unmanaged):(a=_.find(t.rows,{id:e.rows[n].WhatsappAccountId}))&&_.merge(a,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged"]));return t})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth","$window",function(e,n,t,a){var i=t.getCurrentUser();return null===a.localStorage.getItem("motion2.user:"+i.id)&&a.localStorage.setItem("motion2.user:"+i.id,JSON.stringify({authenticationType:"google"})),t.isAgent()?n.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):n.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){return e.isAgent()?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,n){return e.resolve("user@getLists",{id:n.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver",function(e){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"id,name",type:"inbound",channel:"voice",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"id,name",type:"outbound",channel:"voice",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.chat",{url:"/chat",data:{selectedTab:2},views:{chat:{templateUrl:"app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",controller:"UserChatDashboardGeneralController as vm"}},resolve:{chatInteractions:["apiResolver",function(e){return e.resolve("chatInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,ChatWebsiteId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],chatWebsites:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.mail",{url:"/mail",data:{selectedTab:3},views:{mail:{templateUrl:"app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",controller:"UserMailDashboardGeneralController as vm"}},resolve:{mailInteractions:["apiResolver",function(e){return e.resolve("mailInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,MailAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.sms",{url:"/sms",data:{selectedTab:4},views:{sms:{templateUrl:"app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",controller:"UserSmsDashboardGeneralController as vm"}},resolve:{smsInteractions:["apiResolver",function(e){return e.resolve("smsInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,SmsAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.openchannel",{url:"/openchannel",data:{selectedTab:5},views:{openchannel:{templateUrl:"app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",controller:"UserOpenchannelDashboardGeneralController as vm"}},resolve:{openchannelInteractions:["apiResolver",function(e){return e.resolve("openchannelInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,OpenchannelAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.fax",{url:"/fax",data:{selectedTab:6},views:{fax:{templateUrl:"app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",controller:"UserFaxDashboardGeneralController as vm"}},resolve:{faxInteractions:["apiResolver",function(e){return e.resolve("faxInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,FaxAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.whatsapp",{url:"/whatsapp",data:{selectedTab:7},views:{whatsapp:{templateUrl:"app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",controller:"UserWhatsappDashboardGeneralController as vm"}},resolve:{whatsappInteractions:["apiResolver",function(e){return e.resolve("whatsappInteraction@get",{fields:"id,closed,createdAt,closedAt,disposition,read1stAt,UserId,WhatsappAccountId",createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0})}],whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"id,name",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),n.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:910})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",params:{channel:"fax"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",params:{channel:"fax"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"FaxQueues":void 0,channel:"fax",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("faxAccount@get",{sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FaxAccounts",sort:"name",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:902})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.help",{abstract:!0,url:"/help"}),n.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1600,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZendeskAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SalesforceAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshdeskAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SugarcrmAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"DeskAccounts",fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ZohoAccounts",fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts",{url:"/vtigerAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",controller:"VtigerAccountsController as vm"}},resolve:{vtigerAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VtigerAccounts",fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts.edit",{url:"/:id?tab",params:{vtigerAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/view.html",controller:"VtigerAccountController as vm"}},resolve:{vtigerAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts",{url:"/dynamics365Accounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",controller:"Dynamics365AccountsController as vm"}},resolve:{dynamics365Accounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dynamics365Accounts",fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts.edit",{url:"/:id?tab",params:{dynamics365Account:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",controller:"Dynamics365AccountController as vm"}},resolve:{dynamics365Account:["apiResolver","$stateParams",function(e,n){return e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication,CloudProviderId",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",type:"Dynamics365",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts",{url:"/servicenowAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",controller:"ServicenowAccountsController as vm"}},resolve:{servicenowAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ServicenowAccounts",fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts.edit",{url:"/:id?tab",params:{servicenowAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/view.html",controller:"ServicenowAccountController as vm"}},resolve:{servicenowAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts",{url:"/freshsalesAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",controller:"FreshsalesAccountsController as vm"}},resolve:{freshsalesAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"FreshsalesAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}).state("app.integrations.freshsalesAccounts.edit",{url:"/:id?tab",params:{freshsalesAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",controller:"FreshsalesAccountController as vm"}},resolve:{freshsalesAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("intFreshsalesAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1304})}]},authenticate:!0,permissionId:1304,bodyClass:"integrations"}),n.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Projects",fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadJscriptySessions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),n.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver",function(e){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:603})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),n.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:610})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",params:{channel:"mail"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",params:{channel:"mail"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"MailQueues":void 0,channel:"mail",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("mailAccount@get",{sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MailAccounts",sort:"name",limit:10,offset:0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:602})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.marketplace",{abstract:!0,url:"/marketplace"}).state("app.marketplace.plugins",{url:"/plugins",views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/plugins.html",controller:"MarketplacePluginsController as vm"}},resolve:{plugins:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Plugins",fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}).state("app.marketplace.plugins.edit",{url:"/:id?tab",params:{plugin:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/edit/view.html",controller:"MarketplacePluginController as vm"}},resolve:{plugin:["apiResolver","$stateParams",function(e,n){return e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}),n.addPart("app/main/apps/marketplace")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.marketplace",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,callAdditionalPhoneAfterMin,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,callAdditionalPhoneAfterMin,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe,dialPreviewRecallmeReminder,callAdditionalPhoneAfterMin",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,n){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),n.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.hopperdate",{url:"/hopperdate",views:{"hopperdate@app":{templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",controller:"HopperdateController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1500,bodyClass:"motiondialer"})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.hopperdate",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1510})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"outbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",params:{channel:"voice",direction:"outbound"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"QueueCampaigns":void 0,channel:"voice",type:"outbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",params:{direction:"outbound"},controller:"QueueCallsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queue-calls/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,fields:"id,name",section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],voiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels",{type:"outbound"})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"name",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("campaign@get",{sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"IvrCampaigns",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1502})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadAttachments,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),n.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:810})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",params:{channel:"openchannel"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",params:{channel:"openchannel"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"OpenchannelQueues":void 0,channel:"openchannel",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.plugins",{abstract:!0,url:"/plugins"}),n.addPart("app/main/apps/plugins")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.plugins",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.plugins.plugin"]).config(e)}(),function(){"use strict";function e(e){e.state("app.plugins.plugin",{url:"/plugin/:id",views:{"content@app":{templateUrl:"app/main/apps/plugins/views/plugin/plugin.html",controller:"PluginController as vm"}},resolve:{},authenticate:!0,bodyClass:"plugins"})}e.$inject=["$stateProvider"],angular.module("app.plugins.plugin",[]).config(e)}(),function(){"use strict";angular.module("app.realtime",[])}(),function(){"use strict";function e(e,n){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,chatTimeout,phoneBarAutoUpdater,defaultScreenRecordingPath,phoneBarAutoUpdaterUrl,enableEmailPreview,split,splitSizeCsv,splitSizePdf,splitSizeXlsx,searchOnEnterKey,messagesAlignment,phoneBarRememberMeEnabled,rtlSupport,allowedLoginAttempts,blockDuration,loginMailFrequency,language,bucket,transcribe,transcribeRegion,transcribeAccountId,sentiment,sentimentRegion,sentimentAccountId,googleSsoEnabled,enforcePasswordHistory,passwordHistoryLimit,enablePrivacyPolicyEmail,privacyPolicyEmail,enablePrivacyPolicyName,privacyPolicyName,enablePrivacyPolicyNumber,privacyPolicyNumber,chatInteractionsReloadTimeout,mailInteractionsReloadTimeout,openchannelInteractionsReloadTimeout,smsInteractionsReloadTimeout,whatsappInteractionsReloadTimeout,stopRecordingOnTransfer,adSsoEnabled,disabledCookie,previewRecallmeReminderInterval,limitTabs",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{mailAccounts:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,provider,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}],cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultFavicon,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle,defaultPreferred",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.cloudProviders",{url:"/cloudProviders",views:{"content@app":{templateUrl:"app/main/apps/settings/views/cloudProviders/cloudProviders.html",controller:"CloudProvidersController as vm"}},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data7",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}),n.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1400})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),n.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:710})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",params:{channel:"sms"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",params:{channel:"sms"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"SmsQueues":void 0,channel:"sms",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver",function(e){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",role:"admin,user",sort:"-updatedAt",userSetting:!0,limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",role:"agent",sort:"-updatedAt",userSetting:!0,limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",role:"agent",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay,emailAutoanswer,emailAutoanswerDelay,smsAutoanswer,smsAutoanswerDelay,faxAutoanswer,faxAutoanswerDelay,whatsappAutoanswer,whatsappAutoanswerDelay,openchannelAutoanswer,openchannelAutoanswerDelay,messengerSoundNotification",id:n.id,userSetting:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,n){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Teams",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:204})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}).state("app.staff.userProfiles",{url:"/userProfiles",views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/userProfiles.html",controller:"UserProfilesController as vm"}},resolve:{userProfiles:["apiResolver",function(e){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}).state("app.staff.userProfiles.edit",{url:"/:id?tab",params:{userProfile:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/edit/view.html",controller:"UserProfileController as vm"}},resolve:{userProfile:["apiResolver","$stateParams",function(e,n){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}),n.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CannedAnswers",fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1001})}]},authenticate:!0,permissionId:1001,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"CustomDashboards",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,n){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Intervals",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,n){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Pauses",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1005})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Scheduler",fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1006})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Sounds",fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1007})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Tags",fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1008})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Templates",fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1009})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,n){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Variables",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1012})}]},authenticate:!0,permissionId:1012,bodyClass:"tools"}).state("app.tools.contact_item_types",{url:"/contact_item_types",views:{"content@app":{templateUrl:"app/main/apps/tools/views/contact_item_types/contact_item_types.html",controller:"ContactItemTypesController as vm"}},resolve:{contact_item_types:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("contactItemType@get",{fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ContactItemType",fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1013})}]},authenticate:!0,permissionId:1013,bodyClass:"tools"}),n.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.tools.dispositions","app.tools.triggers"]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.dispositions",{url:"/dispositions",views:{"content@app":{templateUrl:"app/main/apps/tools/views/dispositions/dispositions.html",controller:"DispositionsController as vm"}},resolve:{dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1002})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.dispositions",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Triggers",fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,n){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"})}e.$inject=["$stateProvider"],angular.module("app.tools.triggers",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.video",{abstract:!0,url:"/video"}).state("app.video.screenRecordings",{url:"/screenRecordings",views:{"content@app":{templateUrl:"app/main/apps/video/views/screenRecordings/screenRecordings.html",controller:"ScreenRecordingsController as vm"}},resolve:{screenRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("screenRecording@get",{fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ScreenRecordings",fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:t.firstLastDayMonth(),includeAll:"true",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadScreenRecordings",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2001})}]},authenticate:!0,permissionId:2001,bodyClass:"video"}),n.addPart("app/main/apps/video")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.video",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.inboundRoutes",{url:"/inboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InboundRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundRoutes.edit",{url:"/:id?tab",params:{inboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundRoutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.inboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.internalRoutes",{url:"/internalRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/internalRoutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"InternalRoutes",fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalRoutes.edit",{url:"/:id?tab",params:{internalRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalRoutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.internalRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.outboundRoutes",{url:"/outboundRoutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundRoutes:["apiResolver","Auth",function(e,n){return n.isAdmin()?e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"OutboundRoutes",fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundRoutes.edit",{url:"/:id?tab",params:{outboundRoute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundRoutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundRoute:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceExtension@get",{fields:"id,appdata,type,exten,context,recordingFormat,cutdigits,description,alias,createdAt,updatedAt",id:n.id})}],contexts:["apiResolver",function(e){return e.resolve("voiceContext@get",{fields:"id,name",sort:"name"})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"})}e.$inject=["$stateProvider"],angular.module("app.voice.outboundRoutes",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:411})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.agents",{url:"/agents",params:{channel:"voice",direction:"inbound"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"fullname",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Telephones",fields:"id,fullname,userpic,internal",role:"telephone",sort:"fullname",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:203})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queues",{url:"/queues",params:{channel:"voice",direction:"inbound"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"VoiceQueues":void 0,channel:"voice",type:"inbound",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",params:{direction:"inbound"},controller:"QueueCallsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queue-calls/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,fields:"id,name",section:"VoiceQueues",channel:"voice",type:"inbound",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],voiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels",{type:"inbound"})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context,createdAt",role:"agent",sort:"-createdAt",nolimit:!0})}],queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"name",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"name",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:411})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Contexts",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:405})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Voicemails",fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"MusicOnHolds",fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver","Auth","msUtils",function(e,n,t){return n.hasRole("admin")?e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoiceRecordings",fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:t.firstLastDayMonth(),limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.voiceRecordings.edit",{url:"/:id?tab",params:{voiceRecording:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/edit/view.html",controller:"VoiceRecordingController as vm"}},resolve:{voiceRecording:["apiResolver","$stateParams",function(e,n){return e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadVoiceRecordings,privacyEnabled",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"ChanSpies",fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:409})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}).state("app.voice.voicePrefixes",{url:"/voicePrefixes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",controller:"VoicePrefixesController as vm"}},resolve:{voicePrefixes:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("voicePrefix@get",{fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"VoicePrefixes",fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:410})}]},authenticate:!0,permissionId:410,bodyClass:"voice"}),n.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.inboundRoutes","app.voice.outboundRoutes","app.voice.internalRoutes","app.voice.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.whatsapp.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/realtime/realtime.html",controller:"WhatsappRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2110})}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.agents",{url:"/agents",params:{channel:"whatsapp"},controller:"AgentsRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{sort:"name",nolimit:!0})}],agents:["apiResolver",function(e){return e.resolve("realtime@getAgents",{sort:"fullname"})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:202})}],utcOffset:["settingsManager",function(e){return e.getUTCOffset()}]},authenticate:!0,permissionId:2110}).state("app.whatsapp.realtime.queues",{url:"/queues",params:{channel:"whatsapp"},controller:"QueuesRealtimeController as vm",templateUrl:"app/main/apps/realtime/views/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,n){return e.resolve("realtime@getQueues",{id:n.isUser()?n.getCurrentUser().userProfileId:void 0,section:n.isUser()?"WhatsappQueues":void 0,channel:"whatsapp",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2110})}e.$inject=["$stateProvider"],angular.module("app.whatsapp.realtime",[]).config(e)}(),function(){"use strict";function e(e,n,t,a){e.state("app.whatsapp",{abstract:!0,url:"/whatsapp"}).state("app.whatsapp.whatsappQueues",{url:"/whatsappQueues",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",controller:"WhatsappQueuesController as vm"}},resolve:{whatsappQueues:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappQueues.edit",{url:"/:id?tab",params:{whatsappQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",controller:"WhatsappQueueController as vm"}},resolve:{whatsappQueue:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:n.id})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2101})}]},authenticate:!0,permissionId:2101,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts",{url:"/whatsappAccounts",views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",controller:"WhatsappAccountsController as vm"}},resolve:{whatsappAccounts:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"WhatsappAccounts",fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}).state("app.whatsapp.whatsappAccounts.edit",{url:"/:id?tab",params:{whatsappAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",controller:"WhatsappAccountController as vm"}},resolve:{whatsappAccount:["apiResolver","$stateParams",function(e,n){return e.resolve("whatsappAccount@get",{fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",id:n.id})}],userProfile:["apiResolver","Auth",function(e,n){return n.isAdmin()?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions,downloadOmnichannelInteractions",id:n.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,n){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:n.getCurrentUser().userProfileId,sectionId:2102})}]},authenticate:!0,permissionId:2102,bodyClass:"whatsapp"}),n.addPart("app/main/apps/whatsapp")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.whatsapp",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.whatsapp.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,n){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,n){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),n.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";angular.module("app.user-setting",[])}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e){e.onBefore({to:function(e){return!0===e.authenticate}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;return n.isLoggedIn()?n.retrieveUser().catch(function(){return t.target("app.login",void 0,{reload:!0})}):t.target("app.login",void 0,{reload:!0})}),e.onStart({to:function(e){return"app.login"!==e.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("agent")&&"app.dashboards.general"!=a.name)return t.target("app.dashboards.general",{redirect:!1},{reload:!0})}),e.onFinish({to:function(e){return"app.help"===e.parent.name}},function(e){var n=e.router.stateService;if("app.help"===e.$to().parent.name){var t=e.injector().get("settingsManager"),a=t?t.get():null;if(!a||!a.viewHelpSection)return n.target("app.dashboards.general",{redirect:!1},{reload:!0})}}),e.onFinish({to:function(e){return e.permissionId}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService,a=e.$to();if(n.hasRole("user")){if(!n.hasPermission(a.permissionId))return t.target("app.dashboards.general",{redirect:!1},{reload:!0});var i=e.params().id?Number(e.params().id):void 0;if(i)return n.hasResourcePermission(a.permissionId,i).catch(function(){return t.target(a.parent.name,{redirect:!1},{reload:!0})})}}),e.onFinish({to:function(e){return"app.dashboards.general"===e.parent.name}},function(e){var n=e.injector().get("Auth"),t=e.router.stateService;e.$to();if(n.hasRole("user")&&!n.hasPermission(100))return t.target("app.dashboards.general",{redirect:!1},{reload:!0})})}e.$inject=["$transitions"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(a,e,o,i,s,r,l,d,c){var m;return{getToken:n,getCurrentUser:u,getPermissions:A,hasChildrenPermissions:function(e){return!!e&&_.some(e,function(e){return t(e)})},hasModulePermissions:function(i){return o(function(a,n){f()?a(!0):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a(!1);else{var t=_.filter(n,function(e){return e.enabled});a(_.some(t,["category",i]))}}).catch(function(e){n(e)})})},hasModulesPermissions:function(s){return o(function(a,n){var i={};f()?(s.forEach(function(e){i[e]=!0}),a(i)):r.userProfileSection.get({userProfileId:m.userProfileId}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(_.isEmpty(n))a({});else{var t=_(n).filter(function(e){return e.enabled&&_.includes(s,e.category)}).uniqBy(function(e){return e.category}).map(function(e){return e.category}).value();t.forEach(function(e){i[e]=!0}),a(i)}}).catch(function(e){n(e)})})},hasRole:function(e){return!!m&&m.role===e},hasPermission:t,hasResourcePermission:function(e,s){return o(function(a,i){return r.userProfileSection.get({userProfileId:m.userProfileId,sectionId:e}).$promise.then(function(e){var n=e.rows[0];if(n.autoAssociation)return a();var t=l.getActiveItem().node;return t.permissions&&!1===t.permissions.association?a():r.userProfileResource.get({sectionId:n.id,nolimit:!0}).$promise.then(function(e){var n=e.rows;_.some(n,["resourceId",s])?a():i()})}).catch(function(e){i("Error retrieving user profile permissions",e)})})},hasSectionPermissions:function(a){return o(function(e,n){var t={};return E().then(function(){_.includes(m.permissions,a)&&(t[a]=!0),e(t)}).catch(function(e){n(e)})})},hasSectionsPermissions:function(a){return o(function(e,n){var t={};if(!f())return E().then(function(){a.forEach(function(e){_.includes(m.permissions,e)&&(t[e]=!0)}),e(t)}).catch(function(e){n(e)});a.forEach(function(e){t[e]=!0}),e(t)})},isAgent:h,isAdmin:f,isLoggedIn:function(){return!!n()},isTelephone:function(){return"telephone"===m.role},isUser:b,login:function(e){return o(function(n,t){r.auth.local(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("LOCAL_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})},logout:function(t){return o(function(e,n){t?(v(),e()):o.resolve().then(function(){return h()&&0!==m.showWebBar?o(function(e,n){r.user.logout({id:m.id,device:"web"}).$promise.then(function(){e()}).catch(function(e){n(e)})}):f()||b()?g(!1):void 0}).then(function(){v(),e()}).catch(function(e){n(e)})})},parseCrudPermissions:function(e){return f()?{readOnly:!1,canEdit:!0,canDelete:!0}:e?{readOnly:!(!_.includes(e,"r")||1!==e.length),canEdit:!!_.includes(e,"e"),canDelete:!!_.includes(e,"d")}:{readOnly:!0,canEdit:!1,canDelete:!1}},queueLogin:p,reloadPermissions:E,removeCookies:v,retrieveUser:function(){return o(function(n,t){r.user.whoami({userSetting:!0}).$promise.then(function(n){return"user"===n.role?A(n.userProfileId).then(function(e){return n.permissions=e,n}):n}).then(function(e){n(m=e)}).catch(function(e){t(e)})})},setCurrentUser:function(e){m=_.merge(m,e)},getAuthenticationType:function(){var e=u(),n=i.localStorage.getItem("motion2.user:"+e.id);if(n)return JSON.parse(n).authenticationType;return"NONE"},loginSSO:function(e){"google"!==e&&y("SSO_LOGIN");return"/api/auth/"+e},loginAD:function(e){return o(function(n,t){r.auth.activedirectory(e).$promise.then(function(e){return d.get().secureCookieEnabled?c.set("motion.token",e.token,{secure:!0,sameSite:"none"}):c.set("motion.token",e.token),r.user.get({id:e.id}).$promise}).then(function(e){(m=e).lastLoginAt=moment().format("YYYY-MM-DD HH:mm:ss"),y("SSO_LOGIN")}).then(function(){if(h()&&1===m.showWebBar&&m.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver",function(e){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return h()&&0!==m.showWebBar?p(e):f()||b()?g(!0):void 0}).then(function(e){m=_.assign(m,e),n()}).catch(function(e){t(e)})})},setMessengerSoundNotification:function(e){u().messengerSoundNotification=e}};function n(){return e.get("motion.token")}function u(){return m}function p(e){return o(function(n,t){r.user.login({id:m.id,device:"web",intrf:e}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function g(a){return o(function(n,t){var e={online:a,lastLoginAt:a?moment().format("YYYY-MM-DD HH:mm:ss"):void 0};r.user.update({id:m.id},e).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}function v(){e.remove("motion.token"),m&&(i.localStorage.removeItem("motion.user:"+m.id),m=null)}function h(){return"agent"===m.role}function f(){return"admin"===m.role}function b(){return"user"===m.role}function t(e){return!!m&&_.includes(m.permissions,e)}function A(e){var a=[];return o(function(n,t){return e||n(a),r.userProfile.getSections({id:e}).$promise.then(function(e){for(var n=0;n<e.length;n++){var t=e[n];a.push(t.sectionId),t.subsections&&(a=_.concat(a,t.subsections))}return a}).then(function(e){n(e)}).catch(function(e){t("Error retrieving user profile permissions",e)})})}function E(){return o(function(n,t){A(m.userProfileId).then(function(e){m.permissions=e,n()}).catch(function(e){t(e)})})}function y(e){var n=u(),t={authenticationType:e};i.localStorage.setItem("motion2.user:"+n.id,JSON.stringify(t))}}e.$inject=["$mdDialog","$cookies","$q","$window","$document","api","msNavigationService","settingsManager","jscookie"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(n,e){this.telephones=e,this.closeDialog=function(e){n.hide(e)},e.count&&(this.name=e.rows[0].name)}e.$inject=["$mdDialog","telephones"],angular.module("app.auth").controller("HotDeskDialogController",e)}(),function(){"use strict";function e(n,t,a,i,s){var o;return{request:function(e){var n=a.get("motion.token");return e.headers=e.headers||{},s.isSameOrigin(e.url)&&n&&(e.headers.Authorization="Bearer "+n),e},responseError:function(e){switch(e.status){case 401:a.remove("motion.token"),n.$broadcast("webrtc::logout"),(o||(o=i.get("$state"))).go("app.login")}return t.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(n){var t={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var n=document.createElement("a");return n.href=e,""===n.host&&(n.href=n.href),n},isSameOrigin:function(i,e){return i=t.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(t.urlParse)).push(n.location),1<=(e=e.filter(function(e){var n=i.hostname===e.hostname,t=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return n&&t&&a})).length}};return t}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";function e(e,n,t){var a={initLogger:function(){return i.init({uri:t.baseUrl+"logs/client-logs",initial_state_name:"client-logs",flushInterval:6e4,debounceInterval:10,sizeLimit:300,silent:!1,autoLog:["error"],heartbeat:!1,logUnload:!1,logPerformance:!1}),i.addHeaderBuilder(function(){return(e=n.get("motion.token"))?{Authorization:"Bearer "+e}:{};var e}),i}},i=e.$logger;if(!i)throw new Error("Beaver Logger not found");return a}function n(d,e,t){var n={getLogger:function(l){var e=function(r){return function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n[0],i=n.slice(1),s="string"!=typeof a||"string"==typeof a&&0===i.length?l:a,o=1<n.length&&"string"==typeof a?i:n;(function(e,n,t){if(!d.isLoggedIn())return;var a=d.getCurrentUser();if(!a||!a.userSetting.clientSideLoggingEnabled)return;if(i=e,!(c.indexOf(i)>=c.indexOf(m)))return;var i;var s=n,o=t;"string"==typeof n&&void 0===t&&(s=e,o=n);u[e].call(u,s,{data:p(o)})}).call(this,r,s,o)}};return{error:e("error"),warn:e("warn"),info:e("info"),debug:e("debug")}},getLoggingColors:function(){return{disabled:{color:"#616161"},debug:{color:"#283593"},info:{color:"#000000"},warning:{color:"#FBC02D"},error:{color:"#FF5252"}}},flush:a},c=["debug","info","warn","error"],m="debug",u=e.initLogger();function p(t){return Array.isArray(t)?t.map(p):null===t||"object"!=typeof t?t:_.isPlainObject(t)?t:t&&"function"==typeof t.toJSON?t.toJSON():t instanceof Error?Object.getOwnPropertyNames(t).reduce(function(e,n){return e[n]=p(t[n]),e},{}):JSON.parse(JSON.stringifyOnce(t))}function a(){return u.flush()}return t.$on("local:user-setting-updated",function(e,n){n.clientSideLoggingEnabled?t.$broadcast("client-side-logging:enabled"):(a(),t.$broadcast("client-side-logging:disabled")),m=n.clientSideLoggingLevel}),t.$on("local:user-logout",function(){m="debug"}),JSON.stringifyOnce=function(i,s,e){var o=[],r=[];return e||(e=2),JSON.stringify(i,function(e,t){if(2e3<o.length)return"object too long";var a=!1;if(o.forEach(function(e,n){e===t&&(a=n)}),""==e)return o.push(i),r.push("root"),t;if(a+""!="false"&&"object"==typeof t)return"root"==r[a]?"(pointer to root)":"(see "+(t&&t.constructor?t.constructor.name.toLowerCase():typeof t)+" with key "+r[a]+")";var n=e||"(empty key)";return o.push(t),r.push(n),s?s(e,t):t},e)},n}e.$inject=["$window","$cookies","api"],n.$inject=["Auth","clientSideLogger","$rootScope"],angular.module("app.client-side-logging").factory("clientSideLogger",e).service("ClientSideLoggingService",n)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var t={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(t[e]))return!1;return t[e]},setConfig:function(e,n){t[e]=n}};return e}})}(),function(){"use strict";function e(e,n,t){n.debugEnabled(!0),e.config({tabindex:!1}),t.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0})}e.$inject=["$ariaProvider","$logProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,n,t){(n.generate(),t.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(n,e,t,a,i,s){var l=this;function o(){var e=_.filter(l.searchOptions.conditions,["disabled",!1]),o=[],r="";if(_(e).groupBy("name").forEach(function(e){var n=e[0],t=1<e.length,a=n.query.column;if(t){var i=_(e).groupBy(function(e){return e.query.operator}).mapValues(function(e){return _.chain(e).map(function(e){return e.query.value}).flattenDeep().value()}).value(),s=[];_.keys(i).forEach(function(e){var n=i[e],t=e;_.includes(["$between","$in","$notIn"],e)?t+="["+n+"]":n.forEach(function(e){t+="["+e+"]"}),s.push(t)}),r+=a+":="+s.join(":=")}else r=a+":="+n.query.operator+"["+n.query.value+"]";o.push(r)}),0!==o.length){var n="["+l.searchOptions.matchType+"]";return n+=o.join("||")}}function r(){var e=n.localStorage.getItem("motion2."+s+":"+l.currentUser.id);return e?JSON.parse(e):{}}function d(e){n.localStorage.setItem("motion2."+s+":"+l.currentUser.id,JSON.stringify(e))}function c(){if(s){var e=r();e.advancedSearch=_.omit(l.searchOptions,"fields"),d(e)}}function m(){return!!r().advancedSearch}l.currentUser=t.getCurrentUser(),l.searchOptions={matchType:"$and",conditions:[],fields:i},l.toolbarColor=a,l.onInit=function(){if(s){var e=r();e.hasOwnProperty("advancedSearch")&&(l.searchOptions=_.merge(l.searchOptions,e.advancedSearch))}},l.applyFilter=function(){c(),e.hide({apply:!0,value:o()})},l.clearConditions=function(){l.searchOptions.conditions=[],function(){if(s){var e=r();delete e.advancedSearch,e.query&&delete e.query.search,d(e)}}()},l.minimize=function(){c(),e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})},l.close=function(){e.hide({apply:!m(),value:o()||m()?!_.isEmpty(l.searchOptions.conditions):void 0})}}e.$inject=["$window","$mdDialog","Auth","color","fields","storagePath"],angular.module("app.core").controller("AdvancedSearchController",e)}(),function(){"use strict";function e(a){return{restrict:"A",link:function(e,n,t){e.$watch(t.focusOn,function(e){a(function(){e?n[0].focus():n[0].blur()})})}}}e.$inject=["$timeout"],angular.module("app.core").directive("focusOn",e)}(),function(){"use strict";function e(o,l,d){return{restrict:"E",compile:function(e,n){var s;return n.code||(s=e.html(),e.empty()),function(t,a,r){r.code&&(s=t.$eval(r.code));var i=t.$eval(r.shouldInterpolate);l.when(s).then(function(e){if(e){i&&(e=d(e)(t));var n=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(n),o(function(){!function(e,n){var t=n.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],s=new RegExp("^"+i);a=a.map(function(e){return e.replace(s,"").replace(/\s+$/,"")});var o=hljs.highlight(r.language||r.lang,a.join("\n"),!0);o.value=o.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),t.append(o.value).addClass("highlight")}(e,n)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";function e(n,a,e,t){var o=this;function i(){var a=o.selectedField.options&&!_.isEmpty(o.selectedField.options.extraOperators),i=o.selectedField.options&&!_.isEmpty(o.selectedField.options.excludedOperators);o.availableOperators=_.filter(o.operators,function(n){var e=!n.applyTo||_.includes(n.applyTo,o.selectedField.type);n.isExtra=a&&_.some(o.selectedField.options.extraOperators,function(e){return e===n.type});var t=_.includes(n.excludeFrom,o.selectedField.type)||i&&_.includes(o.selectedField.options.excludedOperators,n.type);if((e||n.isExtra)&&!t)return n})}function s(n){return e[n.model][n.action](n.params).$promise.then(function(e){return e.rows}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:n.model.toUpperCase()+"."+n.action.toUpperCase(),msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function r(){!o.value||_.isArray(o.value)&&_.isEmpty(o.value)?o.isValidCondition=!1:o.selectedOperator?o.selectedOperator&&"$between"===o.selectedOperator.type?o.isValidCondition=!(!o.endRangeValue||!o.isValidRange):o.isValidCondition=!0:o.isValidCondition=!1}function l(){"number"===o.selectedField.type?_.isNumber(o.endRangeValue)?o.isValidRange=Number(o.endRangeValue)>Number(o.value):o.isValidRange=!0:"date"===o.selectedField.type&&(o.maxDateRange=moment(o.endRangeValue).subtract(1,"day"),o.isValidRange=!0),r()}function d(){var e=m();o.options.conditions.push(e),p()}function c(){var e=m(),n=_.findIndex(o.options.conditions,"style");o.options.conditions.splice(n,1,e),p(),o.pendingCondition.style=null,o.pendingCondition=void 0}function m(){return{name:o.selectedField.name,operator:n.instant("DASHBOARDS."+o.selectedOperator.translate),value:o.value,endValue:o.endRangeValue,displayValue:u(o.value),displayEndValue:u(o.endRangeValue),query:{column:o.selectedField.column,operator:o.selectedOperator.type,value:function(){var e,n=o.value,t=o.endRangeValue;switch(o.selectedField.type){case"date":var a=moment(n).utcOffset(0,!0).format("YYYY-MM-DD");if("$between"===o.selectedOperator.type){var i=moment(t).utcOffset(0,!0).format("YYYY-MM-DD");e=[a,i]}else e=a;break;case"number":e="$between"===o.selectedOperator.type?[n,t]:n;break;case"multiselect":var s=o.selectedField.options.field||"name";e=_.map(n,s);break;case"select":e=n.id;break;case"autocomplete":e=o.selectedOperator.isExtra?n:n.id;break;default:e=n}return e}()},disabled:!1}}function u(e){var n;if(e){switch(o.selectedField.type){case"date":n=moment(e).format("YYYY-MM-DD");break;case"multiselect":var t=_.map(e,function(e){return e.name});n="$eq"===o.selectedOperator.type?t.join(" or "):t.join(" and ");break;case"select":n=e.name;break;case"autocomplete":n=o.selectedOperator.isExtra?e:e.displayValue;break;default:n=e}return n}}function p(){o.value=null,o.endRangeValue=null,o.minDateRange=null,o.maxDateRange=null,o.isValidCondition=!1}o.operators=o.availableOperators=[{type:"$eq",symbol:"=",translate:"EQUALS",excludeFrom:["multiselect"]},{type:"$ne",symbol:"≠",translate:"IS_NOT_EQUAL",excludeFrom:["multiselect"]},{type:"$in",symbol:"∈",translate:"IS_AMONG",applyTo:["multiselect"]},{type:"$notIn",symbol:"∉",translate:"IS_NOT_AMONG",applyTo:["multiselect"]},{type:"$substring",symbol:"⊃",translate:"CONTAINS",applyTo:["text"]},{type:"$startsWith",symbol:"a..",translate:"STARTS_WITH",applyTo:["text"]},{type:"$endsWith",symbol:"..a",translate:"ENDS_WITH",applyTo:["text"]},{type:"$lt",symbol:"<",translate:"IS_LESS_THAN",applyTo:["date","number"]},{type:"$gt",symbol:">",translate:"IS_GREATER_THAN",applyTo:["date","number"]},{type:"$lte",symbol:"≤",translate:"IS_LESS_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$gte",symbol:"≥",translate:"IS_GREATER_THAN_OR_EQUAL_TO",applyTo:["date","number"]},{type:"$between",symbol:"≬",translate:"IS_BETWEEN",applyTo:["date","number"]}],o.addCondition=d,o.editCondition=function(e){o.pendingCondition=e,o.pendingCondition.style="md-amber-200-bg",o.selectedField=_.find(o.options.fields,["name",o.pendingCondition.name]),i(),o.selectedOperator=_.find(o.availableOperators,["type",o.pendingCondition.query.operator]),"date"===o.selectedField.type&&"string"==typeof o.pendingCondition.value?(o.value=new Date(o.pendingCondition.value),o.minDateRange=moment(o.value).add(1,"day"),o.endRangeValue=o.pendingCondition.endValue?new Date(o.pendingCondition.endValue):void 0):(o.value=o.pendingCondition.value,o.endRangeValue=o.pendingCondition.endValue);o.isValidRange=!0,o.isValidCondition=!0},o.updateCondition=c,o.cancelUpdateCondition=function(){o.pendingCondition.style=null,o.pendingCondition=void 0},o.setConditionStatus=function(e){e.style=e.disabled?void 0:"chip-disabled",e.disabled=!e.disabled},o.removeCondition=function(){_.isEmpty(o.options.conditions)&&o.clearFilter()},o.getValues=function(){return o.selectedField.options.routes&&Array.isArray(o.selectedField.options.routes)?(e=angular.copy(o.selectedField.options.routes).map(function(e){return s(e)}),a.all(e).then(function(e){o.selectedField.values=_.flatten(e)})):o.selectedField.options.route?function(){var e=angular.copy(o.selectedField.options.route);if("autocomplete"===o.selectedField.type)for(var n=0;n<Object.keys(e.params).length;n++){var t=Object.keys(e.params)[n];"@autocomplete"===e.params[t]&&(e.params[t]=o.searchText,e.params.autocomplete=!0)}return a.resolve().then(function(){if(!o.selectedField.values||!0===e.params.autocomplete)return s(e)}).then(function(e){return e&&(o.selectedField.values=e),"autocomplete"===o.selectedField.type?function(e){var n=[];o.searchText&&(n=e.filter(function(e){e.displayValue="";for(var n=0;n<o.selectedField.options.searchFields.length;n++){var t=o.selectedField.options.searchFields[n],a=e[t]||"";e.displayValue+=a+" "}return _.trimEnd(e.displayValue),e.displayValue.toLowerCase().includes(o.searchText.toLowerCase())}));return n}(o.selectedField.values):o.selectedField.values})}():(o.selectedField.values.forEach(function(e){e.translate&&(e.name=n.instant(e.translate))}),o.selectedField.values);var e},o.onFieldChange=function(){o.value=void 0,o.endRangeValue=void 0,o.searchText=void 0,o.isValidCondition=!1,i(),o.autoSelectOperator=1===o.availableOperators.length,o.autoSelectOperator||(o.selectedOperator=void 0)},o.onOperatorChange=function(e){o.isValidRange=!0,o.selectedOperator&&(e?e.applyTo?0<_.difference(o.selectedOperator.applyTo,e.applyTo).length&&(o.value=null):o.selectedOperator.applyTo&&(o.value=null):o.value||(o.value=null),"between"!=o.selectedOperator.type&&(o.endRangeValue=null),o.selectedField.options&&!_.isEmpty(o.selectedField.options.extraOperators)&&(o.selectedOperator.isExtra=_.some(o.selectedField.options.extraOperators,function(e){return e===o.selectedOperator.type})));r()},o.onValueChange=function(){o.selectedOperator&&"$between"===o.selectedOperator.type?"number"===o.selectedField.type?l():"date"===o.selectedField.type&&(o.minDateRange=moment(o.value).add(1,"day"),r()):r()},o.checkRange=l,o.handleKeyboardAction=function(){o.pendingCondition?c():d()}}e.$inject=["$translate","$q","api","toasty"],angular.module("app.core").directive("msAdvancedSearch",function(){return{restrict:"E",scope:{options:"=",clearFilter:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-advanced-search/ms-advanced-search.html"}})}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,n){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",n)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msChipColor",function(){return{restrict:"A",link:function(e,i,n){n.$observe("msChipColor",function(e){var n=i.parent().parent();if(n.hasClass("md-background-bg md-hue-3")||n.addClass("md-background-bg md-hue-3"),_.isEmpty(e)){var t=n[0].className.split(" "),a=t.indexOf("md-hue-3");t.length=a+1,n[0].className=t.join(" ")}else n.addClass(e)})}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","$document","$mdDialog","Auth","toasty","api",function(t,n,a,i,s,o,e,r,l){function d(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+c(e));case 2:return n.$broadcast("webrtc::call",{target:c(e)})}}function c(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function m(e){return a.get(e).success(function(){r.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){r.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}t.currentUser=e.getCurrentUser(),t.privacy=t.currentUser.privacyEnabled,t.showMenu=function(){return t.target&&t.target.indexOf("@")<0&&t.target!=t.currentUser.internal&&t.target!=t.currentUser.name&&(0==t.currentUser.showWebBar&&t.currentUser.phoneBarRemoteControl||2==t.currentUser.showWebBar&&t.license.webrtc)&&!t.disabled},t.call=function(e){return 2!==t.currentUser.showWebBar?(n=e,l.user.getVoicePrefixes({id:t.currentUser.id}).$promise.then(function(e){if(e.count)return o.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{prefixes:e,required:t.currentUser.phoneBarPrefixRequired}})}).then(function(e){t.currentUser.phoneBarPrefixRequired?e&&-1!==e&&d(e+n):e&&-1!==e?d(e+n):e||d(n)})):d(e);var n},t.transfer=function(e){switch(t.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(t.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+c(e));case 2:n.$broadcast("webrtc::transfer",{target:c(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";n.$inject=["ClientSideLoggingService","$rootScope","$translate"];var e={bindings:{user:"<"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html"};function n(e,n,t){var a=this,i=e.getLoggingColors();function s(){a.tooltipHTML=a.user.userSetting.clientSideLoggingEnabled?[t.instant("STAFF.CLIENT_LOGS_ENABLED"),t.instant("STAFF.CLIENT_LOGS_LOGLEVEL",{logLevel:a.user.userSetting.clientSideLoggingLevel}),t.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(a.user.userSetting.clientSideLoggingEnabledSince).format("LLLL")})].join("<br>"):t.instant("STAFF.CLIENT_LOGS_DISABLED")}a.tooltipHTML=t.instant("STAFF.CLIENT_LOGS_DISABLED"),a.styleColor=i.disabled,a.styleIcon=a.user.userSetting&&a.user.userSetting.clientSideLoggingEnabled?"icon-checkbox-marked-circle":"icon-close",a.$onInit=function(){if(!a.user.userSetting)return;var e=a.user.userSetting.clientSideLoggingEnabled?a.user.userSetting.clientSideLoggingLevel:"disabled";a.styleColor=i[e],"info"===e&&(a.styleIcon="icon-checkbox-marked-circle-outline");return s()},a.$onDestroy=function(){o()};var o=n.$on("$translateChangeSuccess",s)}angular.module("app.core").component("msClientSideLoggingIcon",e)}(),function(){"use strict";n.$inject=["ClientSideLoggingService","UserSettingService","$q","$translate","$rootScope","$interval"];var e={bindings:{user:"<",onUserUpdate:"&"},controller:n,controllerAs:"vm",templateUrl:"app/core/directives/ms-client-side-logging/ms-client-side-logging.html"};function n(e,t,n,a,i,s){var o=this,r=e.getLoggingColors(),l=null;function d(){l&&s.cancel(l)}o.styleProperties=r.disabled,o.clientSideLoggingEnabledSince="",o.$onInit=function(){m().then(function(){d(),l=s(u,6e4)})},o.$onChanges=function(e){e&&n.resolve().then(m)},o.$onDestroy=function(){d(),c()},o.onEnabledSwitchChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;return p(e,n)},o.onLogLevelSelectionChange=function(){var e=o.user.userSetting.clientSideLoggingEnabled,n=o.user.userSetting.clientSideLoggingLevel;p(e,n)},o.computeStyleForLoggingLevel=function(e){return r[e]};var c=i.$on("$translateChangeSuccess",u);function m(){o.availableClientSideLoggingLevels=Object.keys(r).filter(function(e){return"disabled"!==e});var e=o.user.userSetting&&o.user.userSetting.clientSideLoggingEnabled?o.user.userSetting.clientSideLoggingLevel:"disabled";return o.styleProperties=r[e],u()}function u(){if(o.user.userSetting)return o.user.userSetting.clientSideLoggingEnabled?void(o.clientSideLoggingEnabledSince=a.instant("STAFF.CLIENT_LOGS_ENABLED_SINCE",{enabledSince:moment(moment(o.user.userSetting.clientSideLoggingEnabledSince).format()).fromNow()})):o.clientSideLoggingEnabledSince=""}function p(e,n){return t.updateUserSettingById(o.user.userSetting.id,{clientSideLoggingEnabled:e,clientSideLoggingLevel:n}).then(function(){"function"==typeof o.onUserUpdate&&o.onUserUpdate()})}}angular.module("app.core").component("msClientSideLogging",e)}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,n,t,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var n={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){return n}}).directive("msDatepickerFix",e)}(),function(){"use strict";function e(s){return{restrict:"E",scope:{id:"=",model:"=",element:"=",title:"=",path:"="},replace:!0,link:function(n,e){var t=!1,a={};a.id=n.id,_.isNil(n.path)||(a.path=n.path);var i=document.createElement(n.element);i.setAttribute("preload","none"),i.setAttribute("controls","true"),"audio"===n.element&&i.setAttribute("style","width: 265px;"),"video"===n.element&&i.setAttribute("style","max-width: 500px;"),i.setAttribute("title",n.title),i.setAttribute("src"," "),i.onplay=function(e){t||(t=!0,e.preventDefault(),s[n.model].download(a).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});i.setAttribute("type",e.type),i.setAttribute("src",URL.createObjectURL(t)),i.play()}).catch(function(e){console.error(e)}))},e.append(i)}}}e.$inject=["api"],angular.module("app.core").directive("msDialogRecording",e)}(),function(){"use strict";function e(i){return{restrict:"A",link:function(t,a){a.bind("click",function(e){var n=i('<div layout="row" class="spinner-overlay" layout-sm="column" layout-align="center center" aria-label="wait"><md-progress-circular md-mode="indeterminate"></md-progress-circular></div>')(t);a.closest("md-dialog").prepend(n)})}}}e.$inject=["$compile"],angular.module("app.core").directive("msDialogSpinner",e)}(),function(){"use strict";function e(){var o=this;function a(e,n,t,a){var i=[];if(0<=t)i.push(e[t]),n.push(e[t]),e.splice(t,1);else{for(var s=0;s<e.length;s++)void 0!==e[s].isValid&&e[s].isValid&&n.push(e[s]);for(s=e.length-1;0<=s;s--)e[s].isValid&&e.splice(s,1);i=n}o.options.transferCallback&&o.options.transferCallback(i,a)}o.canTransfer=function(e,n,t){if(void 0!==e.isValid&&e.isValid)return t?a(n.selectedItems,n.items,n.selectedItems.indexOf(e),t):a(n.items,n.selectedItems,n.items.indexOf(e),t)},o.transfer=a,o.getLine=function(e,n){var t="";if(_.isNil(n))return t;{if(_.isArray(n)){for(var a=0;a<n.length;a++)t+=" "+(e[n[a]]?e[n[a]]:"");return t}return e[n]?e[n]:""}}}angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"=",readOnly:"=",addDisabled:"<"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(a){return{restrict:"E",replace:!0,scope:{onReply:"&",ngModel:"=",ctrlMethods:"=",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<textarea class="emojionearea"></textarea>',link:function(t,e){var n=e.emojioneArea({pickerPosition:t.pickerPosition,search:t.search,recentEmojis:t.recentEmojis,placeholder:a.instant(t.placeholder||"Type a message"),attributes:{spellcheck:!0},events:{keyup:function(e,n){t.ngModel=this.getText(),t.onReply({event:n,body:this.getText()})},emojibtn_click:function(){t.ngModel=this.getText()}}});t.ngModel&&n[0].emojioneArea.setText(t.ngModel),t.internalControl=t.ctrlMethods||{},t.internalControl.setText=function(e){n[0].emojioneArea.setText(e)},t.internalControl.getText=function(){return n[0].emojioneArea.getText()},t.$watch("ngModel",function(e){e||n[0].emojioneArea.setText("")})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Century Gothic",value:"Century Gothic,Futura,Didact Gothic,san-serif"},{option:"Calibri",value:"Calibri, Verdana, Geneva, sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var n=this;function e(){return n.forms.length}function t(){return 0===n.selectedIndex}function a(){return n.selectedIndex===e()-1}n.forms=[],n.selectedIndex=0,n.registerForm=function(e){n.forms.push(e)},n.previousStep=function(){if(t())return;n.selectedIndex--},n.nextStep=function(){if(a())return;n.selectedIndex++},n.firstStep=function(){n.selectedIndex=0},n.lastStep=function(){n.selectedIndex=e()-1},n.totalSteps=e,n.isFirstStep=t,n.isLastStep=a,n.currentStepInvalid=function(){return angular.isDefined(n.forms[n.selectedIndex])&&n.forms[n.selectedIndex].$invalid},n.previousStepInvalid=function(){return 0<n.selectedIndex&&angular.isDefined(n.forms[n.selectedIndex-1])&&n.forms[n.selectedIndex-1].$invalid},n.formsIncomplete=function(){for(var e=0;e<n.forms.length;e++)if(n.forms[e].$invalid)return!0;return!1},n.resetForm=function(){for(var e=n.selectedIndex=0;e<n.forms.length;e++)n.forms[e].$setPristine(),n.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,n,t,a){var i=a[0],s=a[1];s.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,n){var t=i.find("ms-info-bar-active"),a="ms-info-bar-active";t.addClass(a),e.removeInfoBar=function(){t.removeClass(a),n.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,n={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},t=!0;function i(){t&&e.cancel(t),t=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),n=0;n<d.items.length;n++){var t,a,i,s,o=d.items[n];(o=angular.element(o)).scope()&&o.scope().$broadcast("msMasonryItem:startReLayout"),o.css({width:d.columnWidth}),d.options.respectItemOrder?(i=n%d.columnCount,s=e[i]):(s=Math.min.apply(Math,e),i=e.indexOf(s)),e[i]=s+o[0].getBoundingClientRect().height,t=Math.round(i*d.columnWidth),a=s,o.css({transform:"translate3d("+t+"px,"+a+"px,0px)"}),o.addClass("placed"),o.scope()&&o.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(n,d.options):n,r.$watch(function(){return d.container.width()},function(e,n){e!==n&&i()})},d.waitImagesLoaded=function(e,n){if("undefined"!=typeof imagesLoaded){var t=a.imagesLoaded(e);t.on("done",function(){n()})}else n()},r.$on("msMasonry:relayout",function(){i()})}function n(o){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,s){return{pre:function(e,n,t,a){a.options=angular.fromJson(s.options||"{}"),a.container=i},post:function(e,n,t,a){o(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",n).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,n,t,a){a.waitImagesLoaded(n,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return n.height()},function(e,n){e!==n&&a.reLayout()})}),n.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(t,e,a,i){var s=this;function o(e,n){s.selectedPalette=e,s.selectedHues=n}function r(){o(!(s.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,n){s.selectedColor={palette:e,hue:n,class:"md-"+e+"-"+n+"-bg",bgColorValue:i.rgba(s.palettes[e][n].value),fgColorValue:i.rgba(s.palettes[e][n].contrast)},"obj"!==s.msModelType||angular.equals(s.selectedColor,s.modelCtrl.$viewValue)||d(),o(e,s.palettes[e]),t.$selectedColor=s.selectedColor}function d(){"class"===s.msModelType?s.modelCtrl.$setViewValue(s.selectedColor.class):"obj"===s.msModelType&&s.modelCtrl.$setViewValue(s.selectedColor)}s.palettes=e,s.selectedPalette=!1,s.selectedHues=!1,t.$selectedColor={},s.activateHueSelection=o,s.selectColor=function(e,n){l(e,n),d(),a.hide()},s.removeColor=r,t.$watch("ngModel",function(){if(!s.modelCtrl.$viewValue||""===s.modelCtrl.$viewValue)return void r();var e,n;if("class"===s.msModelType){var t=s.modelCtrl.$viewValue.split("-");n=5<=t.length?(e=t[1]+"-"+t[2],t[3]):(e=t[1],t[2])}else"obj"===s.msModelType&&(e=s.modelCtrl.$viewValue.palette,n=s.modelCtrl.$viewValue.hue||500);l(e,n)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,n,t,a,i){var s=a[0];s.modelCtrl=a[1],s.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,n){return 1===n.nodeType})).length&&n.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,n,t){var a="true"===t.msNavIsFolded,i=!1,s=angular.element(p[0].body),o=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=n.parent();function d(){s.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),s.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(o).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),n.scrollTop(0),s.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){s.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),n.off("mouseenter mouseleave")}v.setFoldable(e,n,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){o.off("mouseenter touchstart"),r.off("mouseenter touchstart"),n.off("mouseenter mouseleave")})}}}function n(t,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){t.$broadcast("msNav::expandMatchingToggles");var n=t.$on("$stateChangeSuccess",function(){t.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){n()})}}}}function t(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,n){return e.addClass("ms-nav-toggle"),angular.isUndefined(n.collapsed)&&(n.collapsed=!0),e.attr("collapsed",n.collapsed),function(a,i,e,t){var s={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},n=i.find("a"),o=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var n=angular.element(i.find("ms-nav-toggle-items")[0]);n.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=n[0].offsetHeight;return n.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(n,{display:"block",height:"0px"},{height:t+"px"},s.expandAnimation).then(function(){n.addClass(s.expanded),n.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var n=angular.element(i.find("ms-nav-toggle-items")[0]),t=n[0].offsetHeight;return a.$evalAsync(function(){p.animate(n,{height:t+"px"},{height:"0px"},s.collapseAnimation).then(function(){n.removeClass(s.expanded),n.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(n,function(e){var n=angular.element(e).attr("ui-sref");angular.isUndefined(n)||(n=n.replace(r,""),o.push(n))}),t.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(t.isDisabled())return;t.disable(),l()?(t.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){t.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=t.getLockedItems(),n=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(n=!0)}),n||c().then(function(){t.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){t.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var n=g.current.name,t=!1;angular.forEach(o,function(e){n===e&&(t=!0)}),t?d():c()}),a.$on("msNav::pushToLockedList",function(){t.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],n.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],t.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var t={};return{setFoldable:function(e,n){t={scope:e,element:n}},isNavFoldedOpen:function(){return t.scope.isNavFoldedOpen()},toggleFold:function(){t.scope.toggleFold()},openFolded:function(){t.scope.openFolded()},closeFolded:function(){t.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,n=!1,t=[],a=[];e.isDisabled=function(){return n},e.enable=function(){n=!1},e.disable=function(){n=!0},e.setToggleItem=function(e,n){t.push({element:e,scope:n})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,n){a.push({element:e,scope:n})},e.clearLockedItems=function(){a=[]}}).directive("msNav",n).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",t)}(),function(){"use strict";function e(e,n){e.root?this.navigation=n.getNavigation(e.root):this.navigation=n.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},n.sort()}function n(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,n){var t=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),s=u("navigation");function o(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),t.addClass("ms-navigation-folded"),r();else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){n.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched"),t.addClass("ms-navigation-folded-open"),a.remove(),t.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),t.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),t.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return s.isLockedOpen()},function(e,n){if(!angular.isUndefined(e)&&!angular.equals(e,n)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||o(e)}),e.toggleFolded=function(){o(!p.getFolded())},e.$on("$stateChangeStart",function(){s.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function t(t,e,a,i,n,s){var o=this;o.element=e,o.node=t.node,o.hasChildren=void 0,o.collapsed=void 0,o.collapsable=void 0,o.group=void 0,o.animateHeightClass="animate-height",o.toggleCollapsed=function(){o.collapsed?o.expand():o.collapse()},o.collapse=function(){var e=o.element.children("ul"),n=e[0].offsetHeight;t.$evalAsync(function(){o.collapsed=!0,o.element.addClass("collapsing"),i.animate(e,{display:"block",height:n+"px"},{height:"0px"},o.animateHeightClass).then(function(){e.css({display:"",height:""}),o.element.removeClass("collapsing")}),t.$broadcast("msNavigation::collapse")})},o.expand=function(){var e=o.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),t.$evalAsync(function(){o.collapsed=!1,o.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:n+"px"},o.animateHeightClass).then(function(){e.css({height:""}),o.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",o.node._path)})},o.getClass=function(){return o.node.class},o.isHidden=function(){if(angular.isDefined(o.node.hidden)&&angular.isFunction(o.node.hidden))return o.node.hidden();return!1},function(){o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),!o.hasChildren||o.group?o.collapsable=!1:o.collapsable=!(!angular.isUndefined(o.node.collapsable)&&"boolean"==typeof o.node.collapsable&&!0!==o.node.collapsable);o.collapsable?o.collapsed=!(!angular.isUndefined(o.node.collapsed)&&"boolean"==typeof o.node.collapsed&&!0!==o.node.collapsed):o.collapsed=!1;if(o.node.state===n.current.name||n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched"),s.setActiveItem(o.node,t)}t.$on("msNavigation::stateMatched",function(){o.collapsable&&o.collapsed&&t.$evalAsync(function(){o.collapsed=!1})}),t.$on("msNavigation::collapse",function(e,n){if(!o.collapsed&&o.collapsable)if(angular.isUndefined(n))o.collapse();else{var t=n.split("."),a=[],i=s.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<t.indexOf(o.node._id))return;if(-1<a.indexOf(o.node._id))return;o.collapse()}}),t.$on("$stateChangeSuccess",function(){if(o.node.state===n.current.name){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;s.setActiveItem(o.node,t),a.$broadcast("msNavigation::collapse",o.node._path)}if(n.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(n.params)&&!angular.equals(o.node.stateParams,n.params))return;t.$emit("msNavigation::stateMatched")}})}()}function a(n){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){n.setNavigationScope(e)}}}}function i(t,e,n,a,i){var s=this;s.element=e,s.node=t.node,s.hasChildren=void 0,s.group=void 0,s.getClass=function(){return s.node.class},function(){if(s.isActive=!1,s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;t.$emit("msNavigation::stateMatched"),i.setActiveItem(s.node,t)}t.$on("msNavigation::stateMatched",function(){s.hasChildren&&t.$evalAsync(function(){s.isActive=!0})}),t.$on("msNavigation::clearActive",function(){if(s.hasChildren){var e=[],n=i.getActiveItem();n&&(e=n.node._path.split(".")),-1<e.indexOf(s.node._id)?t.$evalAsync(function(){s.isActive=!0}):t.$evalAsync(function(){s.isActive=!1})}}),t.$on("$stateChangeSuccess",function(){if(s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;i.setActiveItem(s.node,t),n.$broadcast("msNavigation::clearActive")}})}()}function s(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,n,t,a){n.on("click",function(){if(!a.hasChildren||i("gt-md"))return;n.toggleClass("expanded")}),e.$on("$destroy",function(){n.off("click")})}}}}e.$inject=["$scope","msNavigationService"],n.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],t.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],s.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function d(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=u(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=u(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function c(e){if(angular.isString(e)){for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function m(e){e||(e=l).sort(a);for(var n=0;n<e.length;n++){var t=e[n].children;1<t.length&&t.sort(a),0<t.length&&m(t)}}function a(e,n){return parseInt(e.weight)-parseInt(n.weight)}function u(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=d,this.deleteItem=c,this.sortByWeight=m,this.$get=function(){var t=null,n=null,a=null,i=null,e={saveItem:d,deleteItem:c,sort:m,clearNavigation:function(){l=[],n&&(n.vm.navigation=l)},setActiveItem:function(e,n){t={node:e,scope:n}},getActiveItem:function(){return t},getNavigation:s,getFlatNavigation:o,setNavigationScope:function(e){n=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){n.toggleFolded()},getSectionId:function(n,t){var e=o(),a=_.find(e,function(e){return t?e.route===n&&e.title.toLowerCase()===t.toLowerCase():e.route===n});return a?a.id:0}};return e;function s(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}function o(e){var n=s(e);return function e(n){var t=[];for(var a=0;a<n.length;a++){var i=angular.copy(n[a]);i.children=[],t.push(i),0<n[a].children.length&&(t=t.concat(e(n[a].children)))}return t}(n)}}}).controller("MsNavigationController",e).directive("msNavigation",n).controller("MsNavigationNodeController",t).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,n,t,a){a.collapsable&&n.on("click",a.toggleCollapsed),e.$on("$destroy",function(){n.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,n,t,a){n.addClass(a.getClass()),a.group&&n.addClass("group")}}}}).directive("msNavigationHorizontalItem",s)}(),function(){"use strict";function e(p,t,g,e,a,i,n,u,s,o,v,h,f,b,r,A,l){var E=this,d=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],c=JSON.parse(n.localStorage.getItem("motion2.user:"+E.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};e(function(){},999);var y=l.getLogger("jssip","ms-phonebar");function m(l){var d,c,m;return E.initDeviceInProgress=!0,navigator.mediaDevices.getUserMedia({audio:!0}).then(function(e){return E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/silence.ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}),e.getTracks().forEach(function(e){e.stop()}),navigator.mediaDevices.enumerateDevices()}).then(function(e){var n=_.filter(e,function(e){return"audioinput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<n.length){var t=_.find(e,function(e){return"default"===e.deviceId&&"audioinput"===e.kind});if(m=_.find(n,function(e){return e.groupId===t.groupId}),E.conf.microphoneId&&!l){var a=_.find(n,function(e){return e.deviceId===E.conf.microphoneId});a&&(m=a)}E.conf.microphoneId=m.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_MICROPHONE_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,x("microphone",!1);var i=_.filter(e,function(e){return"audiooutput"===e.kind&&"default"!==e.deviceId&&"communications"!==e.deviceId});if(0<i.length){var s=_.find(e,function(e){return"default"===e.deviceId&&"audiooutput"===e.kind});if(c=d=_.find(i,function(e){return e.groupId===s.groupId}),E.conf.speakerId&&!l){var o=_.find(i,function(e){return e.deviceId===E.conf.speakerId});o&&(c=o)}if(E.conf.speakerId=c.deviceId,E.conf.ringingId&&!l){var r=_.find(i,function(e){return e.deviceId===E.conf.ringingId});r&&(d=r)}E.conf.ringingId=d.deviceId}else v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_SPEAKER_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"});return x("speaker",!1)}).then(function(){return x("ringing",!1)}).then(function(){if(jabra)return jabra.init().then(function(){return E.isJabraInitialized=!0,jabra.getInstallInfo()}).then(function(){return jabra.getUserDeviceMediaExt()}).then(function(e){m&&c&&d&&e&&_.includes([m.groupId,c.groupId,d.groupId],e.deviceInfo.browserGroupId)&&(y.info("Jabra library correctly initialized and device correctly installed"),E.isJabraEnabled=!0,jabra.onHook(),jabra.addEventListener("acceptcall",function(e){var n=_.last(E.sessions);n?"incoming"===n.direction&&n.isInProgress()?E.answer(n):y.error("Unable to find a valid call to answer",e):y.error("Unable to answer the call",e)}.bind(this)),jabra.addEventListener("mute",function(){x("microphone",E.conf.microphoneMute=!0)}.bind(this)),jabra.addEventListener("unmute",function(){E.conf.microphoneMute=!1,x("microphone",!0)}.bind(this)),jabra.addEventListener("flash",function(){E.jabraSession.localHold?E.unhold(E.jabraSession):E.hold(E.jabraSession)}.bind(this)),jabra.addEventListener("endcall",function(){o(function(e){for(var n=null,t=0;t<E.sessions.length;t++)_.has(E.sessions[t],"localHold")&&E.sessions[t].localHold||(n=E.sessions[t]);e(n)}).then(function(e){null!==e&&E.terminate(e)})}.bind(this)))}).catch(function(e){y.warn("Error initializing Jabra integration",e)})}).catch(function(e){y.error("Unable to init media devices",e),"NotFoundError"===e.name&&v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}).finally(function(){E.initDeviceInProgress=!1,S(),DetectRTC.load(function(){E.conf.hasMicrophone=DetectRTC.hasMicrophone,E.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,E.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,E.conf.osName=DetectRTC.osName,E.conf.osVersion=DetectRTC.osVersion,E.conf.browserName=DetectRTC.browser.name,E.conf.browserVersion=DetectRTC.browser.version,E.conf.license&&E.conf.isWebRTCSupported&&E.conf.hasMicrophone&&E.conf.hasSpeakers&&"https"===E.conf.protocol&&("chrome"===E.conf.browserName.toLowerCase()||"opera"===E.conf.browserName.toLowerCase()||"safari"===E.conf.browserName.toLowerCase())?E.register||E.ua.start():E.conf.license||v.warning({title:u.instant("TOOLBAR.WARNING"),msg:u.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))})}function S(){c.webrtc=_.pick(E.conf,d),n.localStorage.setItem("motion2.user:"+E.conf.id,JSON.stringify(c))}function T(e,n,t){y.debug("addCall -> target, inbound, fullname",e,n,t),E.calls.unshift({target:e,fullname:t||e,inbound:n,time:moment().format("HH:mm")}),50<E.calls.length&&E.calls.pop()}function I(e){y.debug("answer -> session",e._request),e.notification&&(e.notification.close(),e.notification=null),E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0,e.answer(E.sessionConf),E.isJabraEnabled&&(jabra.offHook(),E.jabraSession=e)}function O(e,n){y.debug("terminate -> session",e._request),e.notification&&(e.notification.close(),e.notification=null);var t={};if(n?t.status_code=n:e.isEstablished()||(t.status_code=603),e.terminate(t),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var a=_.last(E.sessions);a.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=a):jabra.offHook()}}function C(t){return y.debug("getVoiceChannels -> session",t._request),h.rpc.getVoiceChannels().$promise.then(function(e){var n=_.find(e.rows,function(e){return e.sipcalllinkedid===t.call_id?e:e.sipcalluniqueid===t.call_id?e:null});n&&(t.monitor=n.monitor,t.uniqueid=n.uniqueid,t.monitors=n.monitors)})}function w(e){y.debug("onAddstream -> data",e),this.remotePlayer.srcObject=e.stream,this.remotePlayer.play()}function R(){E.canGoInConference=!1,E.isInConference=!1,E.currentconferenceSessions=[]}function x(e,n){switch(e){case"ringing":E.soundPlayer.muted=E.conf.ringingMute,E.conf.ringingId&&E.soundPlayer.setSinkId(E.conf.ringingId).then(function(){E.soundPlayer.volume=E.conf.ringingVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.ringingId)});break;case"speaker":E.remotePlayer.muted=E.conf.speakerMute,E.conf.speakerId&&E.remotePlayer.setSinkId(E.conf.speakerId).then(function(){E.remotePlayer.volume=E.conf.speakerVolume}).then(function(){n&&S()}).catch(function(e){y.info(e.message,E.conf.speakerId)});break;case"microphone":for(var t=0;t<E.sessions.length;t+=1)E.conf.microphoneMute?E.sessions[t].mute():E.sessions[t].unmute();jabra&&E.isJabraEnabled&&(E.conf.microphoneMute?jabra.mute():jabra.unmute()),n&&S();break;default:y.info("unknown device")}}function N(){E.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",p.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function D(n){return h.user.getVoicePrefixes({id:E.conf.id}).$promise.then(function(e){if(e.count)return a.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{prefixes:e,required:E.conf.phoneBarPrefixRequired}})}).then(function(e){if(E.conf.phoneBarPrefixRequired){if(e&&-1!==e)return e+n}else{if(e&&-1!==e)return e+n;if(!e)return n}})}function P(){if(E.isInConference){var e=E.sessions[0].connection.getReceivers()[0],n=E.sessions[1].connection.getReceivers()[0],t=new MediaStream;t.addTrack(e.track),t.addTrack(n.track);var a=document.getElementById("remote-audio");a.srcObject=t;var i=a.play();void 0!==i&&i.then(function(){}).catch(function(e){y.error(e)})}}function L(e,n,t,a){return y.debug("onReferCallback -> session, textContent, position, delay",e._request,n,t,a),function(){i.show(i.simple().textContent(n).position(t).hideDelay(a)),O(e)}}function k(n){return y.debug("findSessionBySessionId -> sessionId, vm_pb.sessions",n,E.sessions),_.find(E.sessions,function(e){return e.call_id==n})}function M(e,n){return y.debug("callCallback -> url, params",e,n),s({url:e,method:"GET",params:n})}E.currentUser=b.getCurrentUser(),E.direction="right",E.selectedMode="md-scale",E.target="",E.showDialpad=!1,E.soundPlayer=document.getElementById(E.conf.soundPlayerId),E.remotePlayer=document.getElementById(E.conf.remotePlayerId),E.soundPlayer.volume=1,E.sessionConf={mediaConstraints:{audio:!0,video:!1},pcConfig:{iceServers:[]}},E.sessions=[],E.calls=[],E.callbackQueue=[],E.canGoInConference=!1,E.isInConference=!1,E.currentConferenceSessions=[],E.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+E.conf.host+":"+E.conf.wssPort+"/ws")],uri:new JsSIP.URI("sip",E.conf.name,E.conf.host,5060,null,null).toString(),authorization_user:E.conf.name,ha1:E.conf.ha1,realm:E.conf.realm,user_agent:E.conf.ua,session_timers_refresh_method:"invite",register_expires:E.conf.phoneBarExpires||60,register:!0}),E.conf=_.merge(c.webrtc,E.conf),E.initDeviceInProgress=!1,E.isJabraEnabled=!1,E.isJabraInitialized=!1,E.jabraSession=null,E.jabraClicked=!1,E.buttonClicked=!1,E.originateInProgress=!1,t.bind("keyup",function(e){switch(e.keyCode){case 27:g(function(){E.showDialpad=!1})}}),E.$onInit=function(){m(!1),navigator.mediaDevices.ondevicechange=function(){E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(!(E.isJabraEnabled=!1))}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!0))};var e=[h.network.get({type:"turn",nolimit:!0}).$promise,h.network.get({type:"stun",nolimit:!0}).$promise];o.all(e).then(function(e){var n=e[0].rows,t=e[1].rows,a=[],i=[];t.forEach(function(e){i.push("stun:"+e.value)}),a.push({urls:i}),n.forEach(function(e){var n={urls:"turn:"+e.value};e.username&&(n.username=e.username),e.password&&(n.credential=e.password),a.push(n)}),E.sessionConf.pcConfig={iceServers:a}}),this.ua.on("registered",function(){this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){this.registered=!1}.bind(this)),this.ua.on("newRTCSession",function(e){y.debug("onNewRTCSession -> data",e);var n,t,a,i,s,o=e.session,r=!0,l="",d=0;switch(e.originator){case"local":o.outgoing=!0,o.name=e.request.ruri.user,o.user=e.request.ruri.user,T(o.user,!1),t=e.request.extraHeaders,a="X-callback-url",s=_.find(t,function(e){return _.startsWith(e,a)}),n=!!s&&_.trim(s.replace(a,"").replace(i||":","")),E.isJabraEnabled&&(E.jabraSession&&jabra.resume(),E.jabraSession=o,jabra.offHook());break;case"remote":var c=b.getCurrentUser();c.voicePause&&c.phoneBarDnd&&(r=!1);var m=e.request.getHeader("Call-Type")||"";if(c.ignorePauseForPreviewCalls&&"PREVIEW"===m&&(r=!0),E.originateInProgress&&(r=!1),r&&(o.incoming=!0,o.name=e.request.from.display_name,o.user=e.request.from.uri.user,l=e.request.getHeader("X-Answer-Mode")||"",d=e.request.getHeader("X-Answer-After")||0,function(n){y.debug("getNotification -> session",n._request);var e=n.name?n.name+" <"+n.user+">":n.user;E.currentUser.privacyEnabled&&(e=A.mask(e)),f.create("Incoming call from: ",e,null,function(){I(n)},function(){O(n)},E.conf.autoAnswer).then(function(e){n.notification=e}).catch(function(e){y.error("Error creating notification for incoming call",e)})}(e.session),T(e.session.user,!0),E.isJabraEnabled&&jabra.ring(),E.conf.autoAnswer&&g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},E.conf.autoAnswerDelay?1e3*E.conf.autoAnswerDelay:0),y.debug("xAnswerMode",l),y.debug("xAnswerAfterSec",d),"auto"==l.toLowerCase())){var u=0==d?500:1e3*d;y.debug("auto answer enabled after:"+u+" ms"),g(function(){o.isInProgress()&&(o.autoAnswer=!0,I(o))},u)}}r?(o.call_id=e.request.call_id,n&&M(E.callbackQueue[o.call_id]=n,{call_id:o.call_id}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}),o.connection&&(o.connection.onaddstream=w.bind(this)),o.iceCandidateTimeout=null,o.on("progress",function(e,n){y.debug("onProgress -> session, data",e._request,n),y.error("onProgress -> session, data",e._request,n);var t=!1;switch(n.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),t=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),t=!0}E.originateInProgress&&(E.originateInProgress=!1),t&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){y.error(e.message)})),C(e).then(function(){var n=E.callbackQueue[e.call_id];n&&M(n,{uniqueid:e.uniqueid,call_id:e.call_id,number_called:e.user}).then(function(){y.info('callbackurl:"'+n+'" called successfully')}).catch(function(e){y.error('fail callbackurl:"'+n+'" err:',e)}).finally(function(){delete E.callbackQueue[e.call_id]})}).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("confirmed",function(e,n){y.debug("onConfirmed -> session, data",e._request,n);var t=document.getElementById("div_session_"+e.id.substr(0,32));t&&$(t).scope().$broadcast("timer-start"),e.confirmed=!0,"remote"===n.originator&&e.connection&&(e.connection.onaddstream=w.bind(this),_.head(e.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(e.connection.getRemoteStreams()),this.remotePlayer.play())),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(e),e.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){y.error("Unable to play autoAnswer notification",e)})),E.canGoInConference=2==E.sessions.length,C(e).catch(function(e){y.error("Unable to retrieve voice channels",e)})}.bind(this,o)),o.on("hold",function(e,n){y.debug("onHold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!0)}.bind(this,o)),o.on("unhold",function(e,n){y.debug("onUnhold -> session, data",e._request,n),"local"===n.originator&&(e.localHold=!1)}.bind(this,o)),o.on("ended",function(e,n){if(y.debug("onEnded -> session, data",e._request,n),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&(R(),E.buttonClicked=!0),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}0===E.sessions.length&&E.currentUser.voicePause&&"ACW"!==E.currentUser.pauseType&&h.user.pause({id:E.currentUser.id,type:_.startsWith(E.currentUser.pauseType,"#")?E.currentUser.pauseType.substring(1):E.currentUser.pauseType}).$promise.catch(function(e){v.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})}),E.conf.microphoneMute=!1,E.initDevice("microphone",!0)}.bind(this,o)),o.on("failed",function(e,n){if(y.debug("onFailed -> session, data",e._request,n),this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),E.isInConference&&_.includes(E.currentConferenceSessions,e.id)&&R(),E.originateInProgress&&(E.originateInProgress=!1),_.remove(this.sessions,{id:e.id}),2!==E.sessions.length&&(E.canGoInConference=!1),E.isJabraEnabled)if(0===E.sessions.length)e.localHold&&jabra.resume(),jabra.onHook(),E.jabraSession=null;else{var t=_.last(E.sessions);t.localHold?(jabra.onHook(),jabra.hold(),E.jabraSession=t):jabra.offHook()}}.bind(this,o)),o.on("icecandidate",function(e,n){y.debug("onIcecandidate -> session, data",e._request,n),null!==e.iceCandidateTimeout&&clearTimeout(e.iceCandidateTimeout),e.iceCandidateTimeout=setTimeout(n.ready,1e3)}.bind(this,o)),E.sessions.push(o),g(function(){p.$apply(),y.debug("onNewRTCSession -> vm_pb.sessions",E.sessions)})):O(o,486)}.bind(this)),r.on("webbar:originate",function(e){y.debug("originateHook -> payload",e);var n=e.callNumber,t=e.callerId,a=e.callbackUrl;E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var i=n.replace(/ /g,"");if(i=(i=i.replace(/\(/g,"")).replace(/\)/g,"")){var s=angular.copy(E.sessionConf);s.extraHeaders=[],t&&s.extraHeaders.push("X-CID: "+t),a&&s.extraHeaders.push("X-callback-url: "+a),E.originateInProgress=!0,E.ua.call(i,s)}}.bind(this)),r.on("webbar:hangup",function(e){y.debug("hangupHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];y.info("hangupHook -> sessionToHangup",a),E.terminate(a)}}.bind(this)),r.on("webbar:answer",function(e){var n;y.debug("answerHook -> payload",e),n=e.sessionId?k(e.sessionId):_.find(E.sessions,function(e){return e.incoming&&!e.confirmed}),e.sessionId&&!n&&y.warn("call with session Id "+e.sessionId+" not found"),n&&E.answer(n)}.bind(this)),r.on("webbar:hold",function(e){y.debug("holdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.hold(a)}}.bind(this)),r.on("webbar:unhold",function(e){y.debug("unholdHook -> payload",e);var n=E.sessions;if(e.sessionId&&((n=[]).push(k(e.sessionId)),0==n.length))y.warn("call with session Id "+e.sessionId+" not found");else for(var t=0;t<n.length;t++){var a=n[t];E.unhold(a)}}.bind(this)),r.on("webbar:transfer",function(e){if(y.debug("transferHook -> payload",e),e.sessionId)if(e.transferNumber){var n=k(e.sessionId);n?n.refer(e.transferNumber,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}}):y.warn("call with session Id "+e.sessionId+" not found")}else y.error("transferNumber required");else y.error("sessionId required")}.bind(this)),r.on("webbar:stopmonitors",function(e){if(e.agentId===E.currentUser.id){var n=_.find(E.sessions,["uniqueid",e.uniqueid]);if(!n)return;n.monitors.forEach(function(e){e.status="pause"}),n.monitor=!1}}.bind(this))}.bind(this),E.type=function(e,n){var t=e;switch(E.target||(E.target=""),n&&(E.target+=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)),e){case"*":t="asterisk";break;case"#":t="pound"}E.conf.enableDtmfTone&&(E.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+t+".ogg"),E.soundPlayer.play().catch(function(e){y.error(e.message)}));for(var a=0;a<E.sessions.length;a+=1)E.sessions[a].isEstablished()&&!E.sessions[a].isOnHold().local&&E.sessions[a].sendDTMF(e)},E.call=function(){if(E.target&&E.target!==E.conf.name&&E.target!==E.conf.internal){E.conf.microphoneId?E.sessionConf.mediaConstraints.audio={deviceId:E.conf.microphoneId}:E.sessionConf.mediaConstraints.audio=!0;var e=E.target.replace(/ /g,"");return D(e=(e=e.replace(/\(/g,"")).replace(/\)/g,"")).then(function(e){e&&E.ua.call(e,E.sessionConf)}).then(function(){N()})}},E.hold=function(e){y.debug("hold -> session",e._request),e.hold({useUpdate:!1}),E.isJabraEnabled&&(jabra.hold(),jabra.onHook())},E.refer=function(n){y.debug("refer -> session",n._request);var e=a.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");a.show(e).then(function(e){return D(e.replace(/ /g,"").replace(/\(/g,"").replace(/\)/g,""))}).then(function(e){n.refer(e,{eventHandlers:{requestSucceeded:L(n,"requestSucceeded","top right",3e3),requestFailed:L(n,"requestFailed","top right",3e3)}})})},E.record=function(e){y.debug("record -> session",e._request),a.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:E.sessions}})},E.unhold=function(e){y.debug("unhold -> session",e._request),e.unhold({useUpdate:!1}),E.putOtherCallsOnHold(e),E.isJabraEnabled&&(jabra.offHook(),jabra.resume())},E.answer=I,E.terminate=O,E.selectSession=function(e){y.debug("selectSession -> session",e._request),E.unhold(e)},E.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":E.type(e.key);break;case"enter":E.call()}},E.toggleDialpad=function(){E.showDialpad=!E.showDialpad},E.referAttended=function(e){y.debug("referAttended -> session",e._request),a.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(E.sessions,{id:e.id}),isJabraEnabled:E.isJabraEnabled}})},E.closeDialpad=function(){E.showDialpad=!1},E.initDevice=x,E.putOtherCallsOnHold=function(e){if(y.debug("putOtherCallsOnHold -> session",e._request),1<E.sessions.length)for(var n=0;n<E.sessions.length;n+=1)E.sessions[n].id===e.id||E.sessions[n].isOnHold().remote||E.sessions[n].hold({useUpdate:!1})},E.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|-)*$/.test(e)?(E.target=e,p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target)):E.target?p.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",E.target):N():N()},E.targetSelected=function(e){e&&(E.target=e.originalObject.target,E.call(),N())},E.start3WayConf=function(){E.isInConference=!0,E.canGoInConference=!1,E.currentConferenceSessions.push(E.sessions[0].id),E.currentConferenceSessions.push(E.sessions[1].id);var e=new AudioContext,n=E.sessions[0].connection.getSenders()[0],t=E.sessions[0].connection.getReceivers()[0];t.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1);var a=E.sessions[1].connection.getSenders()[0],i=E.sessions[1].connection.getReceivers()[0];i.track.addEventListener("unmute",function(){setTimeout(function(){P()},1e3)},!1),E.sessions[0].unhold({useUpdate:!1}),E.sessions[1].unhold({useUpdate:!1}),t.track.enabled=!0,i.track.enabled=!0;var s=new MediaStream,o=e.createMediaStreamDestination();o=(e=new AudioContext).createMediaStreamDestination();var r=e.createMediaStreamSource(new MediaStream([i.track]));r.connect(o),(r=e.createMediaStreamSource(new MediaStream([n.track]))).connect(o),n.replaceTrack(o.stream.getTracks()[0]).then(function(){}),o=e.createMediaStreamDestination(),(r=e.createMediaStreamSource(new MediaStream([t.track]))).connect(o),(r=e.createMediaStreamSource(new MediaStream([a.track]))).connect(o),a.replaceTrack(o.stream.getTracks()[0]).then(function(){s.addTrack(t.track),s.addTrack(i.track);var e=document.getElementById("remote-audio");e.srcObject=s;var n=e.play();void 0!==n&&n.then(function(){}).catch(function(e){y.error(e)})})},E.patchConference=P,p.$on("webrtc::settings",function(e){a.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:E.conf,activeSessions:E.sessions}}).then(function(e){e&&(E.conf=e,E.initDeviceInProgress||(E.initDeviceInProgress=!0,jabra&&E.isJabraInitialized?jabra.shutdown().then(function(){E.isJabraInitialized=!1,m(E.isJabraEnabled=!1)}).catch(function(e){y.error("Unable to shutdown Jabra library",e)}):m(!1)))})}),p.$on("webrtc::logout",function(){E.ua.stop(),jabra&&E.isJabraInitialized&&jabra.shutdown(),navigator.mediaDevices.ondevicechange=function(){}}),p.$on("webrtc::call",function(e,n){y.debug("onRemoteCall -> evt, data",e,n),n.target&&(E.target=n.target,E.call())}),p.$on("webrtc::transfer",function(e,n){if(y.debug("onRemoteTransfer -> evt, data",e,n),n.target)for(var t=0;t<E.sessions.length;t+=1)if(E.sessions[t].isEstablished()&&!E.sessions[t].isOnHold().local)return D(n.target).then(function(e){e&&E.sessions[t].refer(e,{eventHandlers:{requestSucceeded:L(E.sessions[t],"requestSucceeded","top right",3e3),requestFailed:L(E.sessions[t],"requestFailed","top right",3e3)}})})}),p.$on("$destroy",function(){y.debug("$destroy event fired"),r.removeAllListeners("webbar:originate"),r.removeAllListeners("webbar:hangup"),r.removeAllListeners("webbar:answer"),r.removeAllListeners("webbar:hold"),r.removeAllListeners("webbar:unhold"),r.removeAllListeners("webbar:transfer"),r.removeAllListeners("webbar:stopmonitors")}),n.onbeforeunload=function(){E.sessions.forEach(function(e){E.terminate(e)})}}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","$http","$q","toasty","api","motNotification","Auth","socket","privacyManager","ClientSideLoggingService"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"=",sessions:"=",registered:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(n,e,t){var a=this;a.prefixes=e,a.required=t,a.closeDialog=function(e){n.hide(e)},a.keyPress=function(e){13===e.keyCode&&this.call()},a.call=function(){n.hide(a.prefix)}}e.$inject=["$mdDialog","prefixes","required"],angular.module("app.core").controller("PrefixDialogController",e)}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,n){function t(){n.css("display","inline"),i(a,1e3)}function a(){n.css("display","none"),i(t,1e3)}t()}],replace:!0}}function n(n,i,s,e,t){var o=this;function a(n,e){console.log("startMonitor");var t=i.defer(),a=(e||n.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return s.rpc.startMonitor({uniqueid:o.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){n.filename=a+".wav",n.mixmonitorid=e.mixmonitorid,n.status="rec",o.session.monitor=!0,t.resolve(n)}).catch(function(e){t.reject(e)}),t.promise}o.title="Record",o.sessions=e,o.session=t,o.closeDialog=function(){n.hide()},o.addRecording=function(){var e=n.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");n.show(e).then(function(e){return a({},e)}).then(function(e){o.session.monitors.push(e)})},o.stop=function(n){return console.log("stopMonitor"),s.rpc.stopMonitor({uniqueid:o.session.uniqueid,mixmonitorid:n.mixmonitorid}).$promise.then(function(e){n.status="pause",o.session.monitor=_.includes(o.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},o.start=a}e.$inject=["$timeout"],n.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",n)}(),function(){"use strict";function e(n,i,a,s,o){var r=this;function l(e,n){var t=n?"Transfer Success":"Transfer Failed",a="top right";return console.debug("onTransferCallback -> session, textContent, position, delay",e,t,a,3e3),function(){i.show(i.simple().textContent(t).position(a).hideDelay(3e3))}}function d(e){n.hide(e)}r.title="Refer Attended",r.sessions=a,r.session=s,r.isJabraEnabled=o,r.sessionTarget=null,a.length&&(r.target=a[0].user),r.closeDialog=d,r.transfer=function(){var e,n,t=_.find(a,function(e){if(e.user===r.target)return e});n=t.outgoing?(e=t,r.session):(e=r.session,t);console.debug("session.refer() -> source, target, replaces, callback",n,e.user,e,"onTransferCallback"),n.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:l(s,!0),requestFailed:l(s,!1)}}),function(e,n){e.terminate(),jabra&&n&&jabra.onHook();d()}(s,o)}}e.$inject=["$mdDialog","$mdToast","sessions","session","isJabraEnabled"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,s,n,t,a,i){var o=this;function r(e,n,t){var a;if(s[t]){if(a=_.find(e,function(e){return e.deviceId===s[t]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===n});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===n}))&&(s[t]=a.deviceId);return s[t]||null}o.currentUser=a.getCurrentUser(),o.messengerSoundNotification=o.currentUser.messengerSoundNotification,_.remove(n,function(e){return"audioinput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)||"audiooutput"===e.kind&&("default"===e.deviceId||"communications"===e.deviceId)}),s.ringingId=r(n,"audiooutput","ringingId"),s.speakerId=r(n,"audiooutput","speakerId"),s.microphoneId=r(n,"audioinput","microphoneId"),s.ringingVolume=s.ringingVolume||.5,s.speakerVolume=s.speakerVolume||.5,s.microphoneVolume=s.microphoneVolume||1,s.ringingMute=s.ringingMute||!1,s.speakerMute=s.speakerMute||!1,s.microphoneMute=s.microphoneMute||!1,o.conf=angular.copy(s),o.devices=n,o.activeSessions=t,o.saveSettings=function(){i.user.messengerSoundNotification({id:o.currentUser.id,enabled:o.messengerSoundNotification}).$promise.then(function(){a.setMessengerSoundNotification(o.messengerSoundNotification),e.hide(o.conf)})},o.closeDialog=function(){e.hide()},o.isCompatibleBrowser=function(){return"chrome"===o.conf.browserName.toLowerCase()||"opera"===o.conf.browserName.toLowerCase()||"safari"===o.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices","activeSessions","Auth","api"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";function e(e,t,a){var i=this;function s(e,n,t){r(e).then(function(){n&&!1!==t&&i.search()})}function o(e){var n=e.key;i.pickerModels[n].dateStart?!0===e.useFromToKeys?i.query[n]={from:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),to:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]={$gte:moment(i.pickerModels[n].dateStart).utcOffset(0,!0).format(),$lte:moment(i.pickerModels[n].dateEnd).utcOffset(0,!0).add(23,"hours").add(59,"minutes").add(59,"seconds").format()}:i.query[n]=void 0,i.search()}function r(e){var n=e.key,t={param:i.query[n],resources:e.options,placeholder:e.placeholder,ngValue:e.ngValue};return a.setPlaceholder(t).then(function(e){i.placeholders[n]=e})}i.pickerModels={},i.placeholders={},i.localizationMap=t.localizationMap,i.onMultiselectInit=function(e){r(e)},i.onDateRangeInit=function(e){var n=e.key;i.query[n]?i.pickerModels[n]=t.setSelectedDate(i.query[n]):i.pickerModels[n]={dateStart:null}},i.onMultiselectSelection=s,i.onDateRangeSelection=o,i.clearDate=function(e){var n=e.key;i.pickerModels[n]={dateStart:null},delete i.query[n],i.search()},i.clearSelection=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=!1===e.clearAll?[_.head(e.options)[t]]:[],r(e).then(function(){i.search()})},i.selectAll=function(e){var n=e.key,t=e.ngValue||"id";i.query[n]=_.map(e.options,t),r(e).then(function(){i.search()})},e.$on("ms-quick-filter:update",function(e,t){t.filters.forEach(function(e){var n=_.find(i.filters,["name",e]);if(n)switch(n.type){case"date":o(n);break;case"multiselect":s(n,!0,t.update);break;case"select":i.search()}})})}e.$inject=["$scope","dateRangeManager","quickFilterManager"],angular.module("app.core").directive("msQuickFilter",function(){return{restrict:"E",scope:{query:"=",filters:"=",search:"&"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-quick-filter/ms-quick-filter.html"}})}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,n){var t=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];n.addClass(t)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(n,e){var t=!1,a=document.createElement("audio");n.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){t||(t=!0,e.preventDefault(),i[n.model||"voiceRecording"].download({id:n.id}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(t)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,n){var t=angular.element('<div class="ms-responsive-table-wrapper"></div>');n.after(t),t.append(n)}}})}(),function(){"use strict";function e(n,i,s,e){var o=this;function t(){angular.isArray(o.onSearch)?a(o.onSearch):o.onResultClick?(o.resultsLoading=!0,n.$parent.$eval("vm.search(query)",{query:o.query.filter}).then(function(e){a(e)}).catch(function(){a([])}).finally(function(){o.resultsLoading=!1})):o.onSearch()}function a(e){o.expanded&&(void 0===e||angular.isArray(e)||null===e)&&(o.selectedResultIndex=0,o.results=e)}function r(){o.expanded=!0,o.displayOn=!0,n.expand()}function l(e){!1!==e&&(o.query.filter=void 0,o.onResultClick?a(null):t()),o.expanded=!1,n.collapse()}function d(e){o.onResultClick&&o.onResultClick({item:e}),l()}function c(){var e=i.find(".ms-search-bar-results"),n=angular.element(e.find(".result")[o.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;o.ignoreMouseEvents=!0,s.cancel(o.mouseEventIgnoreTimeout),o.mouseEventIgnoreTimeout=s(function(){o.ignoreMouseEvents=!1},250),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}}o.queryOptions={debounce:o.debounce||0},o.searchOnEnterKey=e.get().searchOnEnterKey||!1,o.resultsLoading=!1,o.results=null,o.selectedResultIndex=0,o.ignoreMouseEvents=!1,o.expandBar=r,o.collapseBar=l,o.blurCollapse=function(){if(!o.collapseOnBlur)return;l(!0)},o.onKeyDown=function(e){var n=e.keyCode;-1<[27,38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:if(!o.onResultClick)return t();if(!o.results)return;d(o.results[o.selectedResultIndex]);break;case 27:l(!0);break;case 38:0<=o.selectedResultIndex-1&&(o.selectedResultIndex--,c());break;case 40:if(!o.results)return;o.selectedResultIndex+1<o.results.length&&(o.selectedResultIndex++,c())}},o.absorbEvent=function(e){e.preventDefault()},o.handleMouseenter=function(e){if(o.ignoreMouseEvents)return;o.selectedResultIndex=e},o.handleResultClick=d,n.$watch("vm.displayOn",function(e){angular.isUndefined(e)||(!0!==e||o.expanded?e||!1===o.expanded||l(!1):r())}),n.$watch("vm.query.filter",function(e,n){if(!angular.isUndefined(e)&&0!==e.length&&!angular.equals(e,n)&&!1!==o.displayOn){if(o.expanded){if(!0===o.searchOnEnterKey&&!o.onResultClick)return;if(o.minChars&&o.minChars>e.length)return}else r();t()}})}function n(a){return{restrict:"E",scope:{query:"=?",debounce:"=?",direction:"@",iconColor:"@",onSearch:"&",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"<?",minChars:"<?",displayOn:"=?"},controller:e,controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),{post:function(n,t){n.collapse=function(){if(t.removeClass("expanded"),"down"===n.vm.direction){t.removeClass("down");var e=t.closest("md-toolbar");e&&e.removeClass("h-128")}a.find("body").removeClass("ms-search-bar-expanded")},n.expand=function(){if(t.addClass("expanded"),"down"===n.vm.direction){t.addClass("down");var e=t.closest("md-toolbar");e&&e.addClass("h-128")}a.find("body").addClass("ms-search-bar-expanded")}}}}}}e.$inject=["$scope","$element","$timeout","settingsManager"],n.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",n)}(),function(){"use strict";function e(e,t,i,o,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],n=l.getFlatNavigation(),t=r.defer(),a=0;a<n.length;a++)n[a].uisref&&e.push(n[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var s=0;s<d.shortcuts.length;s++)if(d.shortcuts[s]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,o(function(){t.resolve(e)},250),t.promise},d.loadShortcuts=function(){var e=r.defer(),n=angular.fromJson(t.get("motion.shortcuts"));angular.isUndefined(n)&&(n=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],t.put("motion.shortcuts",angular.toJson(n)));return e.resolve(n),e.promise},d.saveShortcuts=function(){var e=r.defer();return t.put("motion.shortcuts",angular.toJson(d.shortcuts)),o(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var n=0;n<d.shortcuts.length;n++)d.shortcuts[n]._id===e._id&&(d.shortcuts.splice(n,1),d.query||(0===d.shortcuts.length?d.results=null:n>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var n=e.keyCode;-1<[38,40].indexOf(n)&&e.preventDefault();switch(n){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,o.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=o(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),n=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&n){var t=n.position().top-8,a=n.position().top+n.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>t&&e.scrollTop(t),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,n){angular.isUndefined(e)||angular.equals(e,n)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,n){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,n,t,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(n.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,n){var t=e.$on("msSplashScreen::remove",function(){a.leave(n).then(function(){t(),e=n=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function n(){i.setCurrentStep(1)}function t(e){return o(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return o(e)?!!i.steps[e-1].scope.hideStep:null}function s(e){return o(e)?!!t(e)||i.steps[e-1].form.$valid:null}function o(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,n,t){var a={element:e,scope:n,form:t,stepNumber:n.step||i.steps.length+1,stepTitle:n.stepTitle,stepTitleTranslate:n.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,n){return e.stepNumber-n.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),n()})},i.setCurrentStep=function(e){if(!o(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,n=e;1<=n;n--)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,n=e;n<=i.steps.length;n++)if(!a(n)){e=n;break}i.setCurrentStep(e)},i.gotoFirstStep=n,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){return o(e)?i.currentStepNumber===e:null},i.isStepDisabled=function(e){if(!o(e))return null;for(var n=!1,t=1;t<e;t++)if(!s(t)){n=!0;break}return n},i.isStepOptional=t,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=s,i.isStepNumberValid=o,i.isFormValid=function(){return i.mainForm.$valid}}function n(o){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];o(function(){s.setOrientation("vertical"),s.registerMainForm(i),s.setupSteps()})}}}}e.$inject=["$timeout"],n.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,n,t,a){var i=a[0],s=a[1];s.setOrientation("horizontal"),s.registerMainForm(i),s.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),s.registerStep(n,e,i),n.hide()}}}}).directive("msVerticalStepper",n).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,n,t,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(t.optionalStep),e.stepInfo=s.registerStep(n,e,i),e.MsStepper=s,n.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(e){return{restrict:"E",scope:{},transclude:!0,controller:"MsTabScrollController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-tab-scroll/ms-tab-scroll.html",compile:function(e){return e.addClass("ms-tab-scroll"),function(e,n){}}}}e.$inject=["$document"],angular.module("app.core").controller("MsTabScrollController",function(){function n(){var e=document.getElementById("bar-container"),n=document.getElementById("tab-container");return n.scrollWidth>e.scrollWidth&&0==e.scrollLeft&&0==n.scrollLeft?"right":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft>=n.scrollWidth?"left":n.scrollWidth>e.scrollWidth&&n.scrollLeft>e.scrollLeft&&e.scrollWidth+n.scrollLeft<n.scrollWidth?"both":"none"}this.onTabScroll=function(e){"left"==e?$("#tab-container").stop().animate({scrollLeft:"-=400"},1e3):$("#tab-container").stop().animate({scrollLeft:"+=400"},1e3)},this.canScroll=function(e){switch(n()){case"both":return!0;case"left":return"left"==e;case"right":return"right"==e;case"none":default:return!1}}}).directive("msTabScroll",e)}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,t,n,a){var i=72,s=!1,o=!1,r=a.getScrollEl();!function(){t.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,n){var t=angular.element(n[0]);d(t).then(function(){m(function(){s=!0})})}):d(t).then(function(){m(function(){s=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return s&&o},function(e,n){angular.equals(e,n)||e&&(t.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var n=u.defer(),t=e.find("img");return 0<t.length?t.on("load",function(){n.resolve("Image is loaded")}):n.resolve("No images"),n.promise}function c(){r.scrollTop()+r.height()>t.position().top+i&&(m(function(){o=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var n=this;n.scrollEl=void 0,n.setScrollEl=function(e){n.scrollEl=e},n.getScrollEl=function(){return n.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,n,t,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner"></span></div>');n.append(i);var s={scrollEl:"#content"};s=angular.extend(s,e.msTimeline,{});var o=angular.element(s.scrollEl);a.setScrollEl(o);var r=144;function l(){o.scrollTop()+o.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore&&e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){o.on("scroll",l)}function c(){o.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";function e(e,n,t,a,i){var r=this;function s(){!function(){r.millis=l().diff(moment(r.startingTime));var e=moment.duration(r.millis),n=e.seconds(),t=e.minutes(),a=e.hours(),i=e.days(),s=e.months(),o=e.years();r.seconds=n<10?"0"+n:n,r.minutes=t<10?"0"+t:t,r.hours=a<10?"0"+a:a,r.days=i<10?"0"+i:i,r.months=s<10?"0"+s:s,r.years=o<10?"0"+o:o,r.timer=0<r.days?r.days+"d ":r.hours+":"+r.minutes+":"+r.seconds}(),r.timeoutId=setTimeout(function(){s(),e.$digest()},r.interval)}function l(e){var n=(e||moment()).utcOffset(r.utcOffset).format("YYYY-MM-DD HH:mm:ss");return moment(n)}function o(){t.resolve().then(function(){return null===r.utcOffset||void 0===r.utcOffset?i.getUTCOffset():r.utcOffset}).then(function(e){return r.utcOffset=e,l()}).catch(function(e){throw e}).then(function(e){var n=r.startTime?moment(r.startTime):void 0;r.startTime?n.isAfter(e,"hour")||n.isBefore(e,"hour")?r.startingTime=l(n):r.startingTime=n:r.startingTime=e,s()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.getDate",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}o(),e.$watch("vm.startTime",function(e,n){angular.isUndefined(e)||0!==e.length&&(angular.equals(e,n)||o())}),e.$on("timer-start",function(){r.startTime=void 0,o()}),n.bind("$destroy",function(){r.timeoutId&&clearTimeout(r.timeoutId)})}e.$inject=["$scope","$element","$q","toasty","settingsManager"],angular.module("app.core").directive("timer",function(){return{restrict:"EA",replace:!1,scope:{startTime:"=?",interval:"=?",utcOffset:"=?"},template:"<span ng-cloak>{{ vm.timer }}</span>",compile:function(){return{pre:function(e,n,t){e.interval=t.interval||1e3}}},controller:e,controllerAs:"vm",bindToController:!0}})}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"=",ngChange:"&"},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],link:function(e,n,t,a){e.updateModel=function(e){a.$setViewValue(e)}},templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var i=this;i.filter=[],i.filtered=!1,i.fontSize=20,i.label="",i.getCount=function(e){var n=0;if(e){i.fontSize=e.attrs[r]&&e.attrs[r].value?parseInt(e.attrs[r].value)-parseInt(e.attrs[r].value)%2:20;var t=e.attrs.find(function(e){return"attrChannel"===e.name});if(t||e.attrs.push({name:"attrChannel",value:"voice"}),"voice"!==e.attrs[l].value?"talking"===e.attrs[s].value?i.label="Opened":"answered"===e.attrs[s].value?i.label="Managed":i.label=e.attrs[s].value:i.label=e.attrs[s].value,e.attrs[l].value.toLowerCase().includes("voice")){e.attrs[o].value&&e.attrs[o].value.length?(i.filtered=!0,i.filter=_.intersection(e.voiceQueuesSelected,e.attrs[o].value)):(i.filtered=!1,i.filter=e.voiceQueuesSelected);for(var a=0;a<e.voiceQueues.rows.length;a+=1)_.includes(i.filter,e.voiceQueues.rows[a].id)&&(n+=e.voiceQueues.rows[a][e.attrs[s].value]?parseInt(e.voiceQueues.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("chat")){e.attrs[g].value&&e.attrs[g].value.length?(i.filtered=!0,i.filter=_.intersection(e.chatWebsitesSelected,e.attrs[g].value)):(i.filtered=!1,i.filter=e.chatWebsitesSelected);for(var a=0;a<e.chatWebsites.rows.length;a+=1)_.includes(i.filter,e.chatWebsites.rows[a].id)&&(n+=e.chatWebsites.rows[a][e.attrs[s].value]?parseInt(e.chatWebsites.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("fax")){e.attrs[c].value&&e.attrs[c].value.length?(i.filtered=!0,i.filter=_.intersection(e.faxAccountsSelected,e.attrs[c].value)):(i.filtered=!1,i.filter=e.faxAccountsSelected);for(var a=0;a<e.faxAccounts.rows.length;a+=1)_.includes(i.filter,e.faxAccounts.rows[a].id)&&(n+=e.faxAccounts.rows[a][e.attrs[s].value]?parseInt(e.faxAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("mail")){e.attrs[d].value&&e.attrs[d].value.length?(i.filtered=!0,i.filter=_.intersection(e.mailAccountsSelected,e.attrs[d].value)):(i.filtered=!1,i.filter=e.mailAccountsSelected);for(var a=0;a<e.mailAccounts.rows.length;a+=1)_.includes(i.filter,e.mailAccounts.rows[a].id)&&(n+=e.mailAccounts.rows[a][e.attrs[s].value]?parseInt(e.mailAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("openchannel")){e.attrs[u].value&&e.attrs[u].value.length?(i.filtered=!0,i.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[u].value)):(i.filtered=!1,i.filter=e.openchannelAccountsSelected);for(var a=0;a<e.openchannelAccounts.rows.length;a+=1)_.includes(i.filter,e.openchannelAccounts.rows[a].id)&&(n+=e.openchannelAccounts.rows[a][e.attrs[s].value]?parseInt(e.openchannelAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("whatsapp")){e.attrs[p].value&&e.attrs[p].value.length?(i.filtered=!0,i.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[p].value)):(i.filtered=!1,i.filter=e.whatsappAccountsSelected);for(var a=0;a<e.whatsappAccounts.rows.length;a+=1)_.includes(i.filter,e.whatsappAccounts.rows[a].id)&&(n+=e.whatsappAccounts.rows[a][e.attrs[s].value]?parseInt(e.whatsappAccounts.rows[a][e.attrs[s].value]):0)}else if(e.attrs[l].value.toLowerCase().includes("sms")){e.attrs[m].value&&e.attrs[m].value.length?(i.filtered=!0,i.filter=_.intersection(e.smsAccountsSelected,e.attrs[m].value)):(i.filtered=!1,i.filter=e.smsAccountsSelected);for(var a=0;a<e.smsAccounts.rows.length;a+=1)_.includes(i.filter,e.smsAccounts.rows[a].id)&&(n+=e.smsAccounts.rows[a][e.attrs[s].value]?parseInt(e.smsAccounts.rows[a][e.attrs[s].value]):0)}}return n};var s=0,o=1,r=2,l=3,d=4,c=5,m=6,u=7,p=8,g=9})}(),function(){"use strict";function e(r,e){var l=this;l.filter=[],l.filtered=!1,l.properties=[],l.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},l.getMultiBarChart=function(e){e&&(e.attrs&&function(e){switch(l.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(l.filtered=!0,l.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(l.filtered=!1,l.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(l.filtered=!0,l.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(l.filtered=!1,l.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(l.filtered=!0,l.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(l.filtered=!1,l.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(l.filtered=!0,l.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(l.filtered=!1,l.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(l.filtered=!0,l.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(l.filtered=!1,l.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(l.filtered=!0,l.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(l.filtered=!1,l.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(l.filtered=!0,l.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(l.filtered=!1,l.filter=e.voiceQueuesSelected)}if(l.multiBarChart.series.length>l.properties.length){var n=l.multiBarChart.series.length-l.properties.length;l.multiBarChart.series.splice(0,n),l.multiBarChart.data.splice(0,n)}for(var t=0;t<l.properties.length;t+=1){var a="";if(a="voice"!==e.attrs[4].value?"talking"===l.properties[t]?"Opened":"answered"===l.properties[t]?"Managed":l.properties[t]:l.properties[t],l.multiBarChart.series[t]=r.instant("TOOLS."+a.toUpperCase()),_.isNil(l.multiBarChart.data[t])&&(l.multiBarChart.data[t]=[]),l.multiBarChart.labels.length>l.filter.length){var i=l.multiBarChart.labels.length-l.filter.length;l.multiBarChart.labels.splice(0,i),l.multiBarChart.data[t].splice(0,i)}switch(e.attrs[4].value){case"voice":for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1);break;case"sms":for(var s=0,o=0;s<e.smsAccounts.rows.length;s+=1)_.includes(l.filter,e.smsAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.smsAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.smsAccounts.rows[s][l.properties[t]]?parseInt(e.smsAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"chat":for(var s=0,o=0;s<e.chatWebsites.rows.length;s+=1)_.includes(l.filter,e.chatWebsites.rows[s].id)&&(l.multiBarChart.labels[o]=e.chatWebsites.rows[s].name,l.multiBarChart.data[t][o]=e.chatWebsites.rows[s][l.properties[t]]?parseInt(e.chatWebsites.rows[s][l.properties[t]]):0,o+=1);break;case"fax":for(var s=0,o=0;s<e.faxAccounts.rows.length;s+=1)_.includes(l.filter,e.faxAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.faxAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.faxAccounts.rows[s][l.properties[t]]?parseInt(e.faxAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"mail":for(var s=0,o=0;s<e.mailAccounts.rows.length;s+=1)_.includes(l.filter,e.mailAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.mailAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.mailAccounts.rows[s][l.properties[t]]?parseInt(e.mailAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"openchannel":for(var s=0,o=0;s<e.openchannelAccounts.rows.length;s+=1)_.includes(l.filter,e.openchannelAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.openchannelAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.openchannelAccounts.rows[s][l.properties[t]]?parseInt(e.openchannelAccounts.rows[s][l.properties[t]]):0,o+=1);break;case"whatsapp":for(var s=0,o=0;s<e.whatsappAccounts.rows.length;s+=1)_.includes(l.filter,e.whatsappAccounts.rows[s].id)&&(l.multiBarChart.labels[o]=e.whatsappAccounts.rows[s].name,l.multiBarChart.data[t][o]=e.whatsappAccounts.rows[s][l.properties[t]]?parseInt(e.whatsappAccounts.rows[s][l.properties[t]]):0,o+=1);break;default:for(var s=0,o=0;s<e.voiceQueues.rows.length;s+=1)_.includes(l.filter,e.voiceQueues.rows[s].id)&&(l.multiBarChart.labels[o]=e.voiceQueues.rows[s].name,l.multiBarChart.data[t][o]=e.voiceQueues.rows[s][l.properties[t]]?parseInt(e.voiceQueues.rows[s][l.properties[t]]):0,o+=1)}}}(e),e.foreground&&function(e){l.multiBarChart.options.legend.fontColor=e.foreground;for(var n=0;n<l.multiBarChart.options.scales.xAxes.length;n+=1)l.multiBarChart.options.scales.xAxes[n].ticks.fontColor=e.foreground;for(var t=0;t<l.multiBarChart.options.scales.yAxes.length;t+=1)l.multiBarChart.options.scales.yAxes[t].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(s){var o=this;o.filter=[],o.filtered=!1,o.properties=[],o.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},o.getPieChart=function(e){e&&(e.attrs&&function(e){switch(o.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[4].value){case"voice":e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected);break;case"sms":e.attrs[7].value&&e.attrs[7].value.length?(o.filtered=!0,o.filter=_.intersection(e.smsAccountsSelected,e.attrs[7].value)):(o.filtered=!1,o.filter=e.smsAccountsSelected);break;case"mail":e.attrs[5].value&&e.attrs[5].value.length?(o.filtered=!0,o.filter=_.intersection(e.mailAccountsSelected,e.attrs[5].value)):(o.filtered=!1,o.filter=e.mailAccountsSelected);break;case"chat":e.attrs[10].value&&e.attrs[10].value.length?(o.filtered=!0,o.filter=_.intersection(e.chatWebsitesSelected,e.attrs[10].value)):(o.filtered=!1,o.filter=e.chatWebsitesSelected);break;case"fax":e.attrs[6].value&&e.attrs[6].value.length?(o.filtered=!0,o.filter=_.intersection(e.faxAccountsSelected,e.attrs[6].value)):(o.filtered=!1,o.filter=e.faxAccountsSelected);break;case"openchannel":e.attrs[8].value&&e.attrs[8].value.length?(o.filtered=!0,o.filter=_.intersection(e.openchannelAccountsSelected,e.attrs[8].value)):(o.filtered=!1,o.filter=e.openchannelAccountsSelected);break;case"whatsapp":e.attrs[9].value&&e.attrs[9].value.length?(o.filtered=!0,o.filter=_.intersection(e.whatsappAccountsSelected,e.attrs[9].value)):(o.filtered=!1,o.filter=e.whatsappAccountsSelected);break;default:e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected)}if(o.pieChart.labels.length>o.properties.length){var n=o.pieChart.labels.length-o.properties.length;o.pieChart.labels.splice(0,n),o.pieChart.data.splice(0,n)}for(var t=0,a=0;t<o.properties.length;t+=1){switch("voice"!==e.attrs[4].value?"talking"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.OPENED"):"answered"===o.properties[t]?o.pieChart.labels[t]=s.instant("TOOLS.MANAGED"):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()):o.pieChart.labels[t]=s.instant("TOOLS."+o.properties[t].toUpperCase()),e.attrs[4].value){case"voice":for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0);break;case"sms":for(var i=0;i<e.smsAccounts.rows.length;i+=1)_.includes(o.filter,e.smsAccounts.rows[i].id)&&(a+=e.smsAccounts.rows[i][o.properties[t]]?parseInt(e.smsAccounts.rows[i][o.properties[t]]):0);break;case"chat":for(var i=0;i<e.chatWebsites.rows.length;i+=1)_.includes(o.filter,e.chatWebsites.rows[i].id)&&(a+=e.chatWebsites.rows[i][o.properties[t]]?parseInt(e.chatWebsites.rows[i][o.properties[t]]):0);break;case"fax":for(var i=0;i<e.faxAccounts.rows.length;i+=1)_.includes(o.filter,e.faxAccounts.rows[i].id)&&(a+=e.faxAccounts.rows[i][o.properties[t]]?parseInt(e.faxAccounts.rows[i][o.properties[t]]):0);break;case"mail":for(var i=0;i<e.mailAccounts.rows.length;i+=1)_.includes(o.filter,e.mailAccounts.rows[i].id)&&(a+=e.mailAccounts.rows[i][o.properties[t]]?parseInt(e.mailAccounts.rows[i][o.properties[t]]):0);break;case"openchannel":for(var i=0;i<e.openchannelAccounts.rows.length;i+=1)_.includes(o.filter,e.openchannelAccounts.rows[i].id)&&(a+=e.openchannelAccounts.rows[i][o.properties[t]]?parseInt(e.openchannelAccounts.rows[i][o.properties[t]]):0);break;case"whatsapp":for(var i=0;i<e.whatsappAccounts.rows.length;i+=1)_.includes(o.filter,e.whatsappAccounts.rows[i].id)&&(a+=e.whatsappAccounts.rows[i][o.properties[t]]?parseInt(e.whatsappAccounts.rows[i][o.properties[t]]):0);break;default:for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[t]]?parseInt(e.voiceQueues.rows[i][o.properties[t]]):0)}o.pieChart.data[t]=a,a=0}}(e),e.foreground&&(n=e,o.pieChart.options.legend.fontColor=n.foreground));var n}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,t,a,i){var s=this;function n(e){s.results=e||{count:0,rows:[]}}function o(){s.query.offset=(s.query.page-1)*s.query.limit,s.promise=i[s.reportRoute].run(s.query,n).$promise}s.countDown=0,s.refresh=0,s.title="",s.columns=[],s.results={rows:[],count:0},s.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},s.onInit=function e(n){n&&n.attrs&&(n.attrs[0]&&n.attrs[0].value&&(s.query.id=n.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,DefaultReportId:"default"===n.attrs[0].type?n.attrs[0].value:void 0,CustomReportId:"custom"===n.attrs[0].type?n.attrs[0].value:void 0}).$promise.then(function(e){switch(e&&e.rows&&(s.columns=e.rows),n.attrs[0].type){case"default":s.reportRoute="analyticDefaultReport";break;case"custom":s.reportRoute="analyticCustomReport"}return i[s.reportRoute].get({id:n.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(s.title=e.name),o()}).catch(function(e){console.log(e)})),n.attrs[1]&&n.attrs[1].value&&(s.refresh=parseInt(n.attrs[1].value),!_.isNaN(s.refresh)&&0<s.refresh?(s.countDown=parseInt(n.attrs[1].value),s.interval=a(function(){s.countDown-=1},1e3,0),s.timeout=t(function(){s.interval&&a.cancel(s.interval),e(n)},1e3*s.refresh)):(s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout))))},s.getResults=o,s.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},e.$on("$destroy",function(){s.interval&&a.cancel(s.interval),s.timeout&&t.cancel(s.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,n){this.getTrustedURL=function(e){return n.trustAsResourceUrl(e)}}function n(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],n.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",n)}(),function(){"use strict";function e(e,n){var t=this;t.flipped=!1,t.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;t.flipped=!t.flipped,n.toggleClass("flipped",t.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,n,t,a,i){i(function(e){n.empty(),n.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";function e(s,n,o,r){return{restrict:"A",require:"?ngModel",link:function(t,a,e,i){o.isAdmin()||o.isTelephone()||(""!==e.privacy||o.getCurrentUser().privacyEnabled)&&!1!==t.$eval(e.privacy)&&(i?(i.$formatters.push(function(e){if(!e)return e;var n=r.mask(e);return i.$setViewValue(n),i.$render(),i.$viewValue}),i.$parsers.push(function(){return i.$modelValue}),a[0].disabled=!0):n(function(){s(a.contents())(t);var e=a.text();if(e){var n=r.mask(e);a.text(n)}}))}}}e.$inject=["$compile","$timeout","Auth","privacyManager"],angular.module("app.core").directive("privacy",e)}(),function(){"use strict";function e(d,c,t,h){function f(e,n){return"motion2.home."+e+":"+n}function b(e){return _.capitalize(e)+("chat"===e?"Website":"Account")+"Id"}function A(e){return"chat"===e?"Website":"Account"}function E(e,n,t){var a=f(n,t);h.set(a,e)}return{addAccount:function(r,e){var l=e.accounts,d=e.accountId,c=e.filters,m=e.query,u=e.userId,n="get"+_.capitalize(r)+("chat"===r?"Websites":"Accounts"),p=b(r),g=A(r),v=l.rows.length===m[p].length;return t.user[n]({id:u,nolimit:!0}).$promise.then(function(e){var n,t,a,i,s;if(l.rows=e.rows,l.count=e.count,_.find(c,["name",g]).options=l.rows,v){var o=(t=d,a=f(n=r,u),i=b(n),(s=h.get(a)).query&&s.query[i]&&s.query[i].push(t),s);o&&E(o,r,u),m[p].push(d)}return v})},removeAccount:function(t,e){var n=e.accounts,a=e.accountId,i=e.filters,s=e.query,o=e.userId,r=b(t),l=s[r].includes(a);return c.resolve().then(function(){var e=function(e,n,t){var a=f(e,n),i=b(e),s=h.get(a);if(s.query&&s.query[i]){var o=s.query[i].indexOf(t);-1<o&&s.query[i].splice(o,1)}return s}(t,o,a);e||(e=s),s[r]=e.query[r],_.remove(n.rows,function(e){return e.id===a}),n.count=n.rows.length,_.find(i,function(e){var n=A(t);return e.name===n}).options=n.rows,1===n.count&&(e.query[r]=[n.rows[0].id],s[r]=[n.rows[0].id]),E(e,t,o)}).then(function(){var e=A(t);d.$broadcast("ms-quick-filter:update",{filters:[e],update:l})})}}}e.$inject=["$rootScope","$q","api","localStorageManager"],angular.module("app.core").factory("agentAccountAssociationManager",e)}(),function(){"use strict";function e(o,r,i,l,d){var e={get:function(s,a){return o(function(n,t){0===a.offset&&(s=void 0);var e=_.merge({},a);i.cmContact.getJourney(e).$promise.then(function(e){var a,n=_(e.rows).uniqBy(function(e){return e.channel}).map("channel").value();return(a=n,o(function(e,n){var t=a.map(function(n){if("voice"!==n){var e="get"+_.startCase(n)+("chat"===n?"Websites":"Accounts");return i.user[e]({id:l.getCurrentUser().id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){c[n]=e.rows})}});return o.all(t).then(function(){e()}).catch(function(e){n(e)})})).then(function(){return e.rows.forEach(function(e){var n;e.canOpen=function(e){switch(e.channel){case"chat":return!!c.chat&&_.some(c.chat,["id",e.ChatWebsiteId]);case"fax":return!!c.fax&&_.some(c.fax,["id",e.FaxAccountId]);case"mail":return!!c.mail&&_.some(c.mail,["id",e.MailAccountId]);case"openchannel":return!!c.openchannel&&_.some(c.openchannel,["id",e.OpenchannelAccountId]);case"sms":return!!c.sms&&_.some(c.sms,["id",e.SmsAccountId]);case"voice":return!0;case"whatsapp":return!!c.whatsapp&&_.some(c.whatsapp,["id",e.WhatsappAccountId]);default:return!1}}(e),e.dispositionsValues=(n=e).disposition?"("+_.compact([n.disposition,n.secondDisposition,n.thirdDisposition]).join(" - ")+")":"("+r.instant("DASHBOARDS.NO_DISPOSITION_SET")+")",e.style=function(e){switch(e.channel){case"chat":return{color:"green-A700",icon:"icon-hangouts"};case"fax":return{color:"blue-grey-A200",icon:"icon-deskphone"};case"mail":return{color:"teal",icon:"icon-email"};case"openchannel":return{color:"amber-A200",icon:"icon-google-earth"};case"sms":return{color:"orange",icon:"icon-message-text"};case"voice":return{color:"blue-A700",icon:"icon-phone"};case"whatsapp":return{color:"lime-A700",icon:"icon-whatsapp"}}}(e)}),a=s,i=e,o(function(e,n){try{var t={journey:a?_.union(a,i.rows):i.rows};t.loadMore=0<i.count-t.journey.length,e(t)}catch(e){n(e)}});var a,i})}).then(function(e){n(e)}).catch(function(e){d.error({title:r.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:r.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),t(e)})})},getQuery:function(){return{range:{from:moment().subtract(3,"M").startOf("month").format("YYYY-MM-DD HH:mm:ss"),to:moment().endOf("month").format("YYYY-MM-DD HH:mm:ss")},limit:10,offset:0}},getQuickFilters:function(){return[{name:"Channel",key:"channel",type:"select",label:"INTEGRATIONS.CHANNEL",customOptions:[{value:void 0,translate:"DASHBOARDS.ALL"},{value:"voice",translate:"DASHBOARDS.VOICE"},{value:"chat",translate:"DASHBOARDS.CHAT"},{value:"mail",translate:"DASHBOARDS.MAIL"},{value:"sms",translate:"DASHBOARDS.SMS"},{value:"fax",translate:"DASHBOARDS.FAX"},{value:"openchannel",translate:"DASHBOARDS.OPENCHANNEL"},{value:"whatsapp",translate:"DASHBOARDS.WHATSAPP"}]},{name:"Start Date",key:"range",type:"date",label:"DASHBOARDS.SELECT_DATE",useFromToKeys:!0}]}},c={};return e}e.$inject=["$q","$translate","api","Auth","toasty"],angular.module("app.core").factory("customerJourneyManager",e)}(),function(){"use strict";function e(p,e){var g={localizationMap:e,setSelectedDate:function(e){var n=e.$gte?new Date(moment.utc(e.$gte).format("YYYY-MM-DD")):new Date(moment.utc(e.from).format("YYYY-MM-DD")),t=e.$lte?new Date(moment.utc(e.$lte).format("YYYY-MM-DD")):new Date(moment.utc(e.to).format("YYYY-MM-DD")),a={dateStart:new Date(n.getFullYear(),n.getMonth(),n.getDate()),dateEnd:new Date(t.getFullYear(),t.getMonth(),t.getDate())};return a.selectedTemplateName=(i=a,moment(i.dateStart).isSame(i.dateEnd)?(u=i,moment().startOf("day").isSame(u.dateStart)?g.localizationMap.Today:(m=i,moment().subtract(1,"days").startOf("day").isSame(m.dateStart)?g.localizationMap.Yesterday:p("date")(i.dateStart,"dd MMM yyyy"))):(c=i,moment().startOf("isoWeek").isSame(c.dateStart,"day")&&moment().endOf("isoWeek").isSame(c.dateEnd,"day")?g.localizationMap["This Week"]:(d=i,moment().subtract(1,"weeks").startOf("isoWeek").isSame(d.dateStart,"day")&&moment().subtract(1,"weeks").endOf("isoWeek").isSame(d.dateEnd,"day")?g.localizationMap["Last Week"]:(l=i,moment().startOf("month").isSame(l.dateStart,"day")&&moment().endOf("month").isSame(l.dateEnd,"day")?g.localizationMap["This Month"]:(r=i,moment().subtract(1,"months").startOf("month").isSame(r.dateStart,"day")&&moment().subtract(1,"months").endOf("month").isSame(r.dateEnd,"day")?g.localizationMap["Last Month"]:(o=i,moment().startOf("year").isSame(o.dateStart,"day")&&moment().endOf("year").isSame(o.dateEnd,"day")?g.localizationMap["This Year"]:(s=i,moment().subtract(1,"years").startOf("year").isSame(s.dateStart,"day")&&moment().subtract(1,"years").endOf("year").isSame(s.dateEnd,"day")?g.localizationMap["Last Year"]:p("date")(i.dateStart,"dd"+(i.dateStart.getMonth()!==i.dateEnd.getMonth()||i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" MMM":"")+(i.dateStart.getFullYear()!==i.dateEnd.getFullYear()?" yyyy":""))+" - "+p("date")(i.dateEnd,"dd MMM yyyy")))))))),a;var i,s,o,r,l,d,c,m,u}};return g}e.$inject=["$filter","dateFilterLocalizationFactory"],angular.module("app.core").factory("dateRangeManager",e)}(),function(){"use strict";function e(t,a,e,n,i){var s={},o={},r="mail",l={};function d(){if(o=n.getCurrentUser(),e.localStorage.getItem("motion2.home:"+o.id)||(r="dashboard"),l=e.localStorage.getItem("motion2.home."+r+":"+o.id)){var a=JSON.parse(l);a.drafts?o.privacyEnabled&&Object.keys(a.drafts).forEach(function(e){var n=a.drafts[e].title,t=n.split(/-(.+)/)[1].trim();a.drafts[e].title=n.replace(t,i.mask(t))}):a.drafts={},l=a}else l={drafts:{}};return l.drafts}function c(){_.isEmpty(s.drafts)?delete l.drafts:l.drafts=s.drafts,e.localStorage.setItem("motion2.home."+r+":"+o.id,JSON.stringify(l))}return s.init=function(){s.drafts=d()},s.getByInteraction=function(n){return s.drafts=d(),_.find(_.values(s.drafts),function(e){return e.interaction&&e.interaction.id===n})},s.removeByInteraction=function(n){s.drafts=d();var e=_.find(_.values(s.drafts),function(e){return e.interaction&&e.interaction.id===n});e&&(delete s.drafts[e.id],c())},s.add=function(e){s.drafts=d();var n=a.instant("DASHBOARDS.UNTITLED");e.contact?n=e.contact.firstName||e.contact.email:_.isEmpty(e.message.subject)||(n=e.message.subject);var t={type:"draft",title:e.account.key+" - "+n,channel:e.channel,content:e.message,account:e.account,interaction:e.interaction,id:_.random(1e10),openedAt:new Date,saved:!1};s.drafts[t.id]=t,c()},s.update=function(e){s.drafts=d();var n=s.drafts[e.id];n&&(n.content=e.message,s.drafts[e.id]=n,c())},s.open=function(e){s.drafts=d();var n=s.drafts[e];n&&t.$broadcast("open"+_.startCase(r)+"Draft",n)},s.remove=function(e){s.drafts=d(),s.drafts[e]&&(delete s.drafts[e],c())},s}e.$inject=["$rootScope","$translate","$window","Auth","privacyManager"],angular.module("app.core").factory("draftManager",e)}(),function(){"use strict";function e(s){var o=[];return function(n,e){e||(e="global-exception");var t,a=s.get("ClientSideLoggingService").getLogger("global-exception"),i=o.findIndex(function(e){return e===n});-1<i?(t=i,o.splice(t,1)):(!function(e){if(100<=o.length){var n=o.length-100+1;o.splice(0,n)}o.push(e)}(n),a.error(e,n))}}e.$inject=["$injector"],angular.module("app.core").factory("$exceptionHandler",e)}(),function(){"use strict";function e(o,i){function r(e,n){var t=i.localStorage.getItem(e),a=t?JSON.parse(t):{};return n?a[n]:a}function s(e,n){return i.localStorage.setItem(e,JSON.stringify(n))}return{get:r,parseInteractionsKey:function(e,n,t,a){var i="motion2.home."+e+":"+t,s=_.capitalize(e)+("chat"===e?"Website":"Account")+"Id";return o.resolve().then(function(){var e=r(i,"query");return e?((n=_.merge(n,e)).sort&&0<=n.sort.indexOf("lastMessage")&&(n=_.omit(n,"sort")),n.includeAll=!0):n.createdAt={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()},1===a.length?n[s]=[a[0].id]:0===a.length&&(n[s]=[]),n}).catch(function(e){throw e})},set:s,update:function(e,n,t){var a=r(e);t?a[t]=n:a=n;return s(e,a)}}}e.$inject=["$q","$window"],angular.module("app.core").factory("localStorageManager",e)}(),function(){"use strict";function e(i){function s(e,n){var t=i.get(),a=0;if(t)switch(n){case"email":a=t.privacyPolicyEmail;break;case"number":a=t.privacyPolicyNumber;break;default:a=t.privacyPolicyName}return _.isNil(a)?e:0===a||a>e.length?e.replace(/./g,"*"):e.substring(0,e.length-a).padEnd(e.length,"*")}function o(e){return _.startsWith(e,"<")&&_.endsWith(e,">")&&(e=e.substring(1,e.length-1)),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function r(e){if(_.startsWith(e,"<")&&_.endsWith(e,">")){var n=!0;e=e.substring(1,e.length-1)}var t=e.split("@")[0],a=e.split("@")[1],i="";return n&&(i+="<"),i+=s(t,"email"),i+="@",i+=s(a,"email"),n&&(i+=">"),i}return{mask:function n(e){t=e,e=t.replace(/\s\s+/g," ").trim();var t;{if(o(e))return r(e);if(/^[+]?[0-9|.|\-|\s]*$/.test(e))return s(e,"number");var a=[],i=e.split(" ");return 1===i.length?s(e):(i.forEach(function(e){a.push(n(e))}),a.join(" "))}}}}e.$inject=["settingsManager"],angular.module("app.core").factory("privacyManager",e)}(),function(){"use strict";function e(n,i){return{setPlaceholder:function(a){var e;return n(function(n){try{if(_.isEmpty(a.resources))e=i.instant("DASHBOARDS.NONE");else if(_.isEmpty(a.param))e=a.placeholder?i.instant(a.placeholder):i.instant("DASHBOARDS.CHOOSE");else if(a.param.length===a.resources.length)e=i.instant("DASHBOARDS.ALL");else{var t=a.ngValue||"id";e=_(a.resources).filter(function(e){return _.includes(a.param,e[t])}).map("name").value().join(", ")}n(e)}catch(e){n(null)}})}}}e.$inject=["$q","$translate"],angular.module("app.core").factory("quickFilterManager",e)}(),function(){"use strict";function e(h,f){var s=["available","loggedIn","paused","waiting"],o=["busy","inUse","invalid","loggedInDb","notInUse","onHold","ringing","ringInUse","talking","unavailable","unknown"],r=["pTalking","originated","message","statusMessage","dialActive","dialMethod","Trunk","startPredictive","startProgressive","erlangCalls","erlangCallToSecond","erlangAbandonmentRate","erlangBusyFactor","dialPredictiveInterval","dialPredictiveIntervalMaxThreshold","dialPredictiveIntervalMinThreshold","predictiveIntervalAvailable","predictiveIntervalTotalCalls","predictiveIntervalAnsweredCalls","predictiveIntervalDroppedCallsTimeout","predictiveIntervalDroppedCallsCallersExit","predictiveIntervalAvgHoldtime","predictiveIntervalAvgTalktime"],n=["idle","unknown","unavailable","ringing"];function t(e,n){var t=[e.chatPause,e.faxPause,e.mailPause,e.openchannelPause,e.smsPause,e.voicePause,e.whatsappPause];if(!n)return _.every(t);var a=_.filter(t);return 0<a.length&&a.length<t.length}function a(e){return!!_.isNil(e)||_.includes(n,e)}function b(e){var n;return t(e,!1)?"pause":t(e,!0)?"*pause":("idle"!==(n=e).voiceStatus&&n.voicePause?n.voiceStatus="pause":!_.every([n.chatStatus,n.faxStatus,n.mailStatus,n.openchannelStatus,n.smsStatus,n.voiceStatus,n.whatsappStatus],a))?"busy":"idle"}function A(){return moment().set("year","0000").format()}return{INCOMING_CALL_STATUS_STYLES:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},OUTGOING_CALL_STATUS_STYLES:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},STATES_STYLES:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},STATUS_STYLES:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},paginateAgents:function(e,n,t){var a={count:0,rows:[]},i=e.filter(function(e){return e.online});if(i.forEach(function(e){var n,t,a;e.globalStatus=b(e),n=e,f.getChannels().forEach(function(e){n[e+"Pause"]&&"idle"===n[e+"Status"]&&(n[e+"Status"]="pause")}),e.globalStatusDisplayValue=(a=(t=e).globalStatus,"pause"===t.globalStatus?a=t.pauseType||h.instant("VOICE.DEFAULT_PAUSE"):"*pause"===t.globalStatus&&(a="*"+(t.pauseType||h.instant("VOICE.DEFAULT_PAUSE"))),a)}),0<t.globalQueueFilter.length){var s=n.filter(function(e){return t.globalQueueFilter.includes(e.id)}),o=_.uniq(s.flatMap(function(e){return _.map(e.Agents,"id")}));i=i.filter(function(e){return o.includes(e.id)})}if(t.globalStatusFilter&&(i=i.filter(function(e){var n=e.globalStatus===t.globalStatusFilter;return"pause"===e.globalStatus&&t.pauseTypeFilter&&(n=e.pauseType===t.pauseTypeFilter),n})),t.filter){var r=t.filter.toLowerCase();i=i.filter(function(e){return(e.fullname+" "+e.internal).toLowerCase().includes(r)})}var l,d,c,m,u="-"===t.sort[0]?"DESC":"ASC",p="DESC"===u?t.sort.substring(1):t.sort;l=i,c=u,i="globalStatus"===(d=p)?(m=c,l.sort(function(e,n){return e.globalStatus===n.globalStatus?"pause"===e.globalStatus?"DESC"===m?(e.pauseType||"")<(n.pauseType||"")||e.fullname.toLowerCase()>n.fullname.toLowerCase()?1:-1:(e.pauseType||"")<(n.pauseType||"")||e.fullname.toLowerCase()>n.fullname.toLowerCase()?-1:1:"DESC"===m?e.fullname.toLowerCase()<n.fullname.toLowerCase()?1:-1:e.fullname.toLowerCase()<n.fullname.toLowerCase()?-1:1:"DESC"===m?e.globalStatus<n.globalStatus?1:-1:e.globalStatus<n.globalStatus?-1:1})):l.sort(function(e,n){var t=e[d],a=n[d];return"fullname"===d?(t=e[d].toLowerCase(),a=n[d].toLowerCase()):"lastPauseAt"===d&&(t=e.globalStatus.includes("pause")?e[d]:A(),a=n.globalStatus.includes("pause")?n[d]:A()),"DESC"===c?t<a?1:-1:t<a?-1:1}),a.count=i.length;var g=t.offset||0,v=g+t.limit;return a.rows=i.slice(g,v),a},updateQueue:function(e,n){var t=!!n.type,a=s;"inbound"===n.type?a=a.concat(o):"outbound"===n.type&&(a=a.concat(o,r));var i=_.pick(e,a);_.merge(n,i),t&&0<n.ringing&&n.available<n.loggedIn&&(n.available+=n.ringing)}}}e.$inject=["$translate","msUtils"],angular.module("app.core").factory("realtimeManager",e)}(),function(){"use strict";function e(e,n){var t={get:function(){return a},getUTCOffset:function(){return null===i?n.setting.getDate().$promise.then(function(e){return i=e.offset}):e.resolve(i)},set:function(e){e&&(a=e.toJSON())}},a={},i=null;return t}e.$inject=["$q","api"],angular.module("app.core").factory("settingsManager",e)}(),function(){"use strict";function e(c,m){function u(e,n,t){if(_.isEmpty(n))return t;for(var a=0;a<n.length;a++){var i=n[a].key,s=_.find(e,function(e){return e[i]===n[a].value});s&&(_.some(t,["id",s.id])||(s.canSelect=!1,t.push(s)))}return t}return{getResources:function(a,i,s,o,r,l,d){return c(function(t,n){o||(o={}),d||(d="get"),a[s][d](o).$promise.then(function(e){var t=e.rows;if("admin"===i.role)return t;var n=m.getSectionId(s,l);return a.userProfileSection.get({userProfileId:i.userProfileId,sectionId:n}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?t:a.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(t,{id:e.resourceId})});return u(t,r,n)}):c.resolve().then(function(){return e=s,_.includes(["voiceContext"],e)?(o.defaultEntry=1,a[s][d](o).$promise.then(function(e){return e.rows})):[];var e}).then(function(e){return u(t,r,e)})})}).then(function(e){var n={rows:_.orderBy(e,[o.sort]),count:e.length};t(n)}).catch(function(e){n(e)})})}}}e.$inject=["$q","msNavigationService"],angular.module("app.core").factory("userProfileManager",e)}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var n=Date.now()-new Date(e);return n<36e5?moment(e).fromNow():n<864e5?moment(e).format("HH:mm"):n<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(n){return function(e){return n.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("capitalize",function(){return function(e){return e?_.capitalize(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,n){if(0===e.length||!n)return e;if(0===n.length)return[];for(var t=[],a=0;a<e.length;a++){for(var i=e[a],s=!1,o=0;o<n.length;o++){var r=n[o];if(i.id===r){s=!0;break}}s&&t.push(i)}return t}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,n,t){if(0===e.length||!t||0===t.length)return e;for(var a=[],i=0;i<e.length;i++){for(var s=e[i],o=!1,r=0;r<t.length;r++){var l=t[r];if(-1<s[n].indexOf(l)){o=!0;break}}o&&a.push(s)}return a}})}(),function(){"use strict";angular.module("app.core").filter("getOptionByValue",function(){return function(n,e,t){if(void 0===n)return"";if(!e)return"";t||(t="option");var a=_.find(e,function(e){return e.value==n});return a?a[t]:""}})}(),function(){"use strict";angular.module("app.core").filter("orderByDate",function(){return function(e){var n=[];return angular.forEach(e,function(e){n.push(e)}),n.sort(function(e,n){return e.hasOwnProperty("openedAt")&&n.hasOwnProperty("openedAt")?e.openedAt>n.openedAt?1:-1:1}),n}})}(),function(){"use strict";angular.module("app.core").filter("secToTime",function(){return function(e){e&&(e=e.toString().replace(",",""));var n=Math.floor(e/86400),t=e%86400,a=new Date(1e3*t).toISOString().substring(11,19);return a.replace(/^(\d+)/,function(e){return(""+(Number(e)+24*n)).padStart(2,"0")})}})}(),function(){"use strict";angular.module("app.core").filter("snakecase",function(){return function(e){return e?_.snakeCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("startcase",function(){return function(e){return e?_.startCase(e):""}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,t){if(0===e.length||0===t.length)return e;var a=[];return e.forEach(function(e){var n=t.every(function(n){var t=!1;return e.tags.forEach(function(e){e.name!==n.name||(t=!0)}),t});n&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,n){if(0!==e.length&&0!==n.length){if(e.length<n.length)return[];var t=[],a=n.every(function(n){var t=!1;return e.forEach(function(e){e.name!==n.name||(t=!0)}),t});return a&&t.push(e),t}}})}(),function(){"use strict";angular.module("app.core").filter("toInteger",function(){return function(e){if(e&&"string"==typeof e)return parseInt(e)}})}(),function(){"use strict";function m(e,n,t,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=n,this.accept=t,this.reject=a,this.close=i}function u(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var t=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var n=_.find(e,function(e){return e.data.id===t.id});n&&n.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var d,t,c=[];"serviceWorker"in navigator&&u()?navigator.serviceWorker.register("notification.js").then(function(e){(d=e).update(),d.installing?t=d.installing:d.waiting?t=d.waiting:d.active&&(t=d.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===t){var n=_.find(c,{id:e.data.id});if(n)switch(e.data.action){case"accept":n.accept&&n.accept();break;case"reject":n.reject&&n.reject()}}}),{create:function(e,i,s,o,r,l){return new Promise(function(t,n){var a;u()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new m(e||"MyTitle",i||"MyBody",o,r),c.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return d.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:s||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){if(l){for(var n=0;n<c.length;n++)c[n].close();t()}else t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,n){var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var o=l.defer(),r=function(e){for(var n=e.split("."),t=c,a=0;a<n.length;a++){if(angular.isUndefined(t[n[a]])){d.error('Resource part "'+n[a]+'" is not defined!'),t=!1;break}t=t[n[a]]}return t||!1}(a);r?r[i](s,function(e){o.resolve(e)},function(e){o.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!'));return o.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";function e(e){return{showLoadingIndicator:function(){e.loadingProgress=!0},hideLoadingIndicator:function(){e.loadingProgress=!1}}}e.$inject=["$rootScope"],angular.module("app.core").factory("LoadingIndicatorService",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var t=angular.injector(["ng"]).get("$log"),a="",v=[];function n(e){a=e}function i(){return a}function s(e,n){angular.isString(e)?angular.isArray(n)?v[e]={url:a+(n[0]||""),paramDefaults:n[1]||[],actions:n[2]||[],options:n[3]||{}}:t.error('"resource" must be an array and it must follow $resource definition'):t.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=n,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=s,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:n,getBaseUrl:i,register:s,resolve:function(e,n){g.$broadcast("msApi::resolveStart");var t=e.split("@"),a=t[0],i=t[1],s=n||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var o=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](s,function(e){o.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){o.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!');return o.promise},request:function(e,n,t,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),s=i[0],o=i[1],r=n||{};if(!s||!o)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[s];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[o](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(t)&&angular.isFunction(t)&&t(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+s+'" is not defined in the api service!'),l.reject('Resource "'+s+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,n){return-1<n.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],n=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function t(e){for(var n=0;n<e.length;n++){var t=e[n].string,a=e[n].prop;if(i=e[n].versionSearch||e[n].identity,t){if(-1!==t.indexOf(e[n].subString))return e[n].identity}else if(a)return e[n].identity}}function a(e){var n=e.indexOf(i);if(-1!==n)return parseInt(e.substring(n+i.length+1))}var s=t(e)||"unknown-browser",o=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=t(n)||"unknown-os";return s=s.toLowerCase(),o=s+"-"+o,r=r.toLowerCase(),d={browser:s,version:o,os:r}},getChannels:function(){return["chat","fax","mail","openchannel","sms","voice","whatsapp"]},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,n){-1===n.indexOf(e)?n.push(e):n.splice(n.indexOf(e),1)},firstLastDayMonth:function(){return{$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()}},getEmailProviders:function(){return[{name:"Custom",value:"custom"},{name:"Gmail",value:"gmail"},{name:"Hotmail",value:"hotmail"},{name:"Yahoo",value:"yahoo"},{name:"Outlook365",value:"outlook365"}]}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,n){var t=this;t.themes=n.themes,t.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],t.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],t.layoutMode="wide",t.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",t.setActiveTheme=function(e){n.setActiveTheme(e)},t.getActiveTheme=function(){return n.themes.active},t.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===t.layoutMode)},t.updateLayoutStyle=function(){e.put("motion.layoutStyle",t.layoutStyle),location.reload()}}function n(n){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){n("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],n.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",n)}(),function(){"use strict";function e(i,a,s){var o={};return{generate:function(){var e=angular.copy(s.getRegisteredThemes()),a=angular.copy(s.getRegisteredPalettes());angular.forEach(e,function(t){o[t.name]={},angular.forEach(t.colors,function(e,n){o[t.name][n]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var n=angular.copy(e);angular.forEach(n,function(t){angular.forEach(t,function(e,n){t[n]=e.levels,t[n].color=e.levels.default.color,t[n].contrast1=e.levels.default.contrast1,t[n].contrast2=e.levels.default.contrast2,t[n].contrast3=e.levels.default.contrast3,t[n].contrast4=e.levels.default.contrast4,delete t[n].default})}),s.setThemesList(n);var t=i.get("motion.selectedTheme");t?s.setActiveTheme(t):s.setActiveTheme("default")}(o);var r={};angular.forEach(o,function(e,n){var t,a,i,s,o;(r={})["@themeName"]=n,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,t){angular.forEach(e,function(e,n){r["@"+a+d(t)+d(n)]=e})})}),t=r,a=new RegExp(Object.keys(t).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n color: @backgroundHue1Contrast1;\n background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n color: @backgroundHue2Contrast1;\n background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n color: @backgroundHue3Contrast1;\n background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n background-color: @primaryDefaultColor;\n color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n background-color: @primaryHue1Color;\n color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n background-color: @primaryHue2Color;\n color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n background-color: @primaryHue3Color;\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n background-color: @accentDefaultColor;\n color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n background-color: @accentHue1Color;\n color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n background-color: @accentHue2Color;\n color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n background-color: @accentHue3Color;\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n background-color: @warnDefaultColor;\n color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n background-color: @warnHue1Color;\n color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n background-color: @warnHue2Color;\n color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n background-color: @warnHue3Color;\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n background-color: @backgroundDefaultColor;\n color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n background-color: @backgroundHue1Color;\n color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n background-color: @backgroundHue2Color;\n color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n background-color: @backgroundHue3Color;\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return t[e]}),s=angular.element("head"),(o=angular.element('<style type="text/css"></style>')).html(i),s.append(o)})},rgba:l};function l(e,n){var t=n||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),t&&(e=function(e,n){var t={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=t.white[n]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=t.black[n]);return e}(e,t)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(t,e,n){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(n.custom=i),t.alwaysWatchTheme(!0),angular.forEach(e,function(e){t.definePalette(e.name,e.options)}),angular.forEach(n,function(e,n){t.theme(n).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(n,t,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void t.error('You must have at least one theme named "default"'):(t.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void n.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],n.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(n,s,o,r){this.search=function(n){for(var e=[],t=r.getFlatNavigation(),a=o.defer(),i=0;i<t.length;i+=1)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,n){var t=this;t.code="",t.send=!1,t.error=e.params,t.sendReport=function(){n.post("/api/jira",t.error).then(function(e){t.send=!0,e.data&&(t.code=e.data.id)},function(e){t.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,n,t){var a=this;a.currentUser=e.getCurrentUser(),a.cookieAlertHide=n.get("motion.cookieAlertHide:"+a.currentUser.id)||!1,a.cookieAlertOnClose=function(){n.put("motion.cookieAlertHide:"+a.currentUser.id,!0)},a.onInit=function(){t.setting.get({id:1}).$promise.then(function(e){e&&(a.cookieAlertHide=!e.disabledCookie)})},a.onInit()}e.$inject=["Auth","$cookies","api"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.form={},s.forgotPassword=function(){return i.auth.forgot(s.form).$promise.then(function(){n.success({title:t.instant("FORGOTPASSWORD.LINK_SENT"),msg:t.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&n.error({title:t.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,n){var t=this;t.currentUser=e.getCurrentUser(),t.newsAlertHide=n.get("motion.newsAlertHide:"+t.currentUser.id)||!1,t.newsAlertOnClose=function(){n.put("motion.newsAlertHide:"+t.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e,o){var r={getResourcesByRole:function(e,n,t,a,i,s){return o.getResources(r,e,n,t,a,i,s)}};return r.baseUrl="api/",r.auth=e(r.baseUrl+"auth/local",{},{local:{method:"post",url:r.baseUrl+"auth/local"},forgot:{method:"post",url:r.baseUrl+"auth/local/forgot"},reset:{method:"post",url:r.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},user:{method:"get",url:r.baseUrl+"auth/local/user/:token",params:{token:"@token"}},google:{method:"post",url:r.baseUrl+"auth/google"},activedirectory:{method:"post",url:r.baseUrl+"auth/activedirectory"}}),r.jira=e(r.baseUrl+"jira"),r.rpc=e(r.baseUrl+"rpc",{},{startMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:r.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:r.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:r.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:r.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:r.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:r.baseUrl+"rpc/sms/queues"},getWhatsappQueues:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues"},getOpenchannelQueues:{method:"get",url:r.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:r.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:r.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:r.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:r.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:r.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:r.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:r.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:r.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:r.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:r.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:r.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:r.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getOpenchannelQueuesIdWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/openchannel/queues/:id/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/fax/queues/waitinginteractions"},getWhatsappQueuesWaitingInteractions:{method:"get",url:r.baseUrl+"rpc/whatsapp/queues/waitinginteractions"},mailQueueNotify:{method:"post",url:r.baseUrl+"rpc/mail/queues/:id/notify",params:{id:"@id"}},chatQueueNotify:{method:"post",url:r.baseUrl+"rpc/chat/queues/:id/notify",params:{id:"@id"}},faxQueueNotify:{method:"post",url:r.baseUrl+"rpc/fax/queues/:id/notify",params:{id:"@id"}},smsQueueNotify:{method:"post",url:r.baseUrl+"rpc/sms/queues/:id/notify",params:{id:"@id"}},openchannelQueueNotify:{method:"post",url:r.baseUrl+"rpc/openchannel/queues/:id/notify",params:{id:"@id"}},agentNotify:{method:"post",url:r.baseUrl+"rpc/agents/:id/notify",params:{id:"@id"}}}),r.version=e(r.baseUrl+"version",{},{fetch:{method:"get",url:r.baseUrl+"version/fetch"},reset:{method:"get",url:r.baseUrl+"version/reset"},pull:{method:"get",url:r.baseUrl+"version/pull"},restart:{method:"get",url:r.baseUrl+"version/restart"},migrations:{method:"get",url:r.baseUrl+"version/migrations"}}),r.system=e(r.baseUrl+"system",{},{killProcess:{method:"get",url:r.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),r.pm2=e(r.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),r.user=e(r.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"users/describe"},clone:{method:"post",url:r.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/contacts"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"users/create_many"},changePassword:{isArray:!1,method:"put",url:r.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/avatar"},getOpenTabs:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/open_tabs"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/recordings"},getScreenRecordings:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/screen_recordings"},getChatInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax/interactions"},getWhatsappInteractions:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp/interactions"},login:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/unpause"},messengerSoundNotification:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/messengerSoundNotification"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_interactions"},addWhatsappInteractions:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_interactions"},removeWhatsappInteractions:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_interactions"},getVoicePrefixes:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/prefixes"},getFaxAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/fax_accounts"},addFaxAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/fax_accounts"},removeFaxAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/fax_accounts"},getMailAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/mail_accounts"},addMailAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/mail_accounts"},removeMailAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/mail_accounts"},getOpenchannelAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/openchannel_accounts"},addOpenchannelAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/openchannel_accounts"},removeOpenchannelAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/openchannel_accounts"},getSmsAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/sms_accounts"},addSmsAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/sms_accounts"},removeSmsAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/sms_accounts"},getChatWebsites:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/chat_websites"},addChatWebsites:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/chat_websites"},removeChatWebsites:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/chat_websites"},getWhatsappAccounts:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/whatsapp_accounts"},addWhatsappAccounts:{isArray:!0,method:"post",url:r.baseUrl+"users/:id/whatsapp_accounts"},removeWhatsappAccounts:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/whatsapp_accounts"},getScheduledCalls:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/scheduled_calls"},getApiKey:{isArray:!1,method:"get",url:r.baseUrl+"users/:id/api_key"},createApiKey:{isArray:!1,method:"post",url:r.baseUrl+"users/:id/api_key"},removeApiKey:{isArray:!1,method:"delete",url:r.baseUrl+"users/:id/api_key"},whoami:{isArray:!1,method:"get",url:r.baseUrl+"users/whoami"},getPresence:{isArray:!1,method:"get",url:r.baseUrl+"users/presence"}}),r.voiceChanSpy=e(r.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:r.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceContext=e(r.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:r.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceExtension=e(r.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:r.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"voice/extensions/:id/applications"}}),r.voiceMusicOnHold=e(r.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:r.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:r.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:r.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:r.baseUrl+"voice/mohs/:id/sounds"}}),r.voiceQueue=e(r.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"voice/queues/:id/blacklists"}}),r.voiceRecording=e(r.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:r.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/downloads"},runTranscribe:{isArray:!1,method:"post",url:r.baseUrl+"voice/recordings/:id/transcribe"},downloadTranscribe:{isArray:!1,method:"get",url:r.baseUrl+"voice/recordings/:id/transcribe",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.screenRecording=e(r.baseUrl+"screen/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"screen/recordings/describe"},clone:{method:"post",url:r.baseUrl+"screen/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"screen/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceMail=e(r.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/:id/messages"}}),r.voiceMailMessage=e(r.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:r.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.voiceCallReport=e(r.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceDialReport=e(r.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceAgentReport=e(r.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueueReport=e(r.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:r.baseUrl+"voice/queues/reports/index"}}),r.memberReport=e(r.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"members/reports/describe"},clone:{method:"post",url:r.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.trunk=e(r.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"trunks/describe"},clone:{method:"post",url:r.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceTransferReport=e(r.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:r.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailServerOut=e(r.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:r.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailAccount=e(r.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:r.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/applications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/verify"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/accounts/:id/users"}}),r.mailQueue=e(r.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/queues/describe"},clone:{method:"post",url:r.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"mail/queues/:id/users"}}),r.mailSubstatus=e(r.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:r.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailInteraction=e(r.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:r.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"mail/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailMessage=e(r.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/messages/describe"},clone:{method:"post",url:r.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"mail/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"mail/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.mailApplication=e(r.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/applications/describe"},clone:{method:"post",url:r.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.mailQueueReport=e(r.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.dashboard=e(r.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:r.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:r.baseUrl+"dashboards/:id/items"}}),r.dashboardItem=e(r.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:r.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxAccount=e(r.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:r.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/applications"},addAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:r.baseUrl+"fax/accounts/:id/send"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/accounts/:id/users"}}),r.faxApplication=e(r.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/applications/describe"},clone:{method:"post",url:r.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxInteraction=e(r.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:r.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"fax/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxMessage=e(r.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/messages/describe"},clone:{method:"post",url:r.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"fax/messages/:id/reject"},download:{isArray:!1,method:"get",url:r.baseUrl+"fax/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.faxQueue=e(r.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/queues/describe"},clone:{method:"post",url:r.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"fax/queues/:id/users"}}),r.faxQueueReport=e(r.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsAccount=e(r.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:r.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/accounts/:id/status"},statusGet:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/status"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/accounts/:id/users"}}),r.smsApplication=e(r.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/applications/describe"},clone:{method:"post",url:r.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsInteraction=e(r.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:r.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"sms/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"sms/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.smsMessage=e(r.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/messages/describe"},clone:{method:"post",url:r.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"sms/messages/:id/status"}}),r.smsQueue=e(r.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/queues/describe"},clone:{method:"post",url:r.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"sms/queues/:id/users"}}),r.openchannelAccount=e(r.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/interactions"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/accounts/:id/users"},send:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/accounts/:id/send"}}),r.openchannelApplication=e(r.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelInteraction=e(r.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.openchannelMessage=e(r.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"openchannel/messages/:id/reject"}}),r.openchannelQueue=e(r.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"openchannel/queues/:id/users"}}),r.chatWebsite=e(r.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/websites/describe"},clone:{method:"post",url:r.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/avatar"},addCustomerAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/customer_avatar"},addSystemAvatar:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/system_avatar"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/avatar"},getCustomerAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/customer_avatar"},getSystemAvatar:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/system_avatar"},notify:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/applications"},addProactiveActions:{isArray:!1,method:"post",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/offline_messages"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/websites/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/websites/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/websites/:id/users"}}),r.openchannelQueueReport=e(r.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatApplication=e(r.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/applications/describe"},clone:{method:"post",url:r.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInteraction=e(r.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:r.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},createVidaooSession:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/vidaoo"},customUpdate:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/custom_update"},abandon:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:r.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"chat/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"chat/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.chatMessage=e(r.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"chat/messages/:id/reject"}}),r.chatOfflineMessage=e(r.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueue=e(r.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/queues/describe"},clone:{method:"post",url:r.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"chat/queues/:id/users"}}),r.chatGroup=e(r.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/groups/describe"},clone:{method:"post",url:r.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:r.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:r.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"chat/groups/:id/messages"}}),r.chatProactiveAction=e(r.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:r.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCompany=e(r.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/companies/describe"},clone:{method:"post",url:r.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/companies/:id/contacts"}}),r.cmContact=e(r.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:r.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/create_many"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/tags"},setAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/phones"},getAdditionalPhones:{isArray:!0,method:"get",url:r.baseUrl+"cm/contacts/:id/phones"},duplicateAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/duplicateAdditionalPhones"},rescheduleAdditionalPhones:{isArray:!0,method:"post",url:r.baseUrl+"cm/contacts/:id/rescheduleAdditionalPhones"},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/upload/:id"},importUpdates:{isArray:!1,method:"post",url:r.baseUrl+"cm/contacts/uploadUpdates/:id"},getJourney:{isArray:!1,method:"get",url:r.baseUrl+"cm/contacts/:id/journey"}}),r.cmHopper=e(r.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/preview"},getPreviewRecall:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/:id/previewrecall"},getOpenContacts:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/opencontacts"},getTimezones:{isArray:!1,method:"get",url:r.baseUrl+"cm/hopper/timezones"},getTimezone:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper/timezone"}}),r.cmHopperBlack=e(r.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperFinal=e(r.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:r.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:r.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:r.baseUrl+"cm/hopper_final/checkContactHopper"}}),r.cmHopperHistory=e(r.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:r.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmCustomField=e(r.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:r.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.action=e(r.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"actions/describe"},clone:{method:"post",url:r.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),r.automation=e(r.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"automations/describe"},clone:{method:"post",url:r.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:r.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"automations/:id/actions"}}),r.cannedAnswer=e(r.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"canned_answers/describe"},clone:{method:"post",url:r.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),r.disposition=e(r.baseUrl+"dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"dispositions/describe"},clone:{method:"post",url:r.baseUrl+"dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),r.condition=e(r.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"conditions/describe"},clone:{method:"post",url:r.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),r.interval=e(r.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"intervals/describe"},clone:{method:"post",url:r.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:r.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:r.baseUrl+"intervals/:id/sub_intervals/create_many"}}),r.pause=e(r.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"pauses/describe"},clone:{method:"post",url:r.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),r.cdr=e(r.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cdr/describe"},clone:{method:"post",url:r.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),r.voiceQueuesLog=e(r.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:r.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),r.schedule=e(r.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"schedules/describe"},clone:{method:"post",url:r.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}},run:{isArray:!1,method:"get",url:r.baseUrl+"schedules/:id/run"}}),r.sound=e(r.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sounds/describe"},clone:{method:"post",url:r.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:r.baseUrl+"sounds/:id"}}),r.tag=e(r.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"tags/describe"},clone:{method:"post",url:r.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),r.contactItemType=e(r.baseUrl+"contact_item_types/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"contact_item_types/describe"},clone:{method:"post",url:r.baseUrl+"contact_item_types/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmContactHasItem=e(r.baseUrl+"cm_contact_has_items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm_contact_has_items/describe"},clone:{method:"post",url:r.baseUrl+"cm_contact_has_items/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmHopperAdditionalPhone=e(r.baseUrl+"cm_hopper_additional_phones/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm_hopper_additional_phones/describe"},clone:{method:"post",url:r.baseUrl+"cm_hopper_additional_phones/:id/clone",params:{includeAll:"@includeAll"}}}),r.template=e(r.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"templates/describe"},clone:{method:"post",url:r.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),r.trigger=e(r.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"triggers/describe"},clone:{method:"post",url:r.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:r.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:r.baseUrl+"triggers/:id/actions"}}),r.variable=e(r.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"variables/describe"},clone:{method:"post",url:r.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),r.integration=e(r.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.integrationReport=e(r.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:r.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticCustomReport=e(r.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/custom_reports/:id/query"}}),r.analyticDefaultReport=e(r.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:r.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:r.baseUrl+"analytics/default_reports/:id/query"}}),r.analyticExtractedReport=e(r.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.analyticMetric=e(r.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:r.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),r.analyticFieldReport=e(r.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:r.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:r.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:r.baseUrl+"analytics/field_reports/:id/create_many"}}),r.analyticTreeReport=e(r.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:r.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSalesforceAccount=e(r.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),r.intSalesforceConfiguration=e(r.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),r.intSalesforceField=e(r.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intSugarcrmAccount=e(r.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),r.intSugarcrmConfiguration=e(r.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),r.intSugarcrmField=e(r.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDeskAccount=e(r.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/accounts/:id/fields"}}),r.intDeskConfiguration=e(r.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/desk/configurations/:id/tags"}}),r.intDeskField=e(r.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZohoAccount=e(r.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/accounts/:id/fields"}}),r.intZohoConfiguration=e(r.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),r.intZohoField=e(r.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intZendeskAccount=e(r.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),r.intZendeskConfiguration=e(r.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),r.intZendeskField=e(r.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshdeskAccount=e(r.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),r.intFreshdeskConfiguration=e(r.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:r.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),r.intFreshdeskField=e(r.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intVtigerAccount=e(r.baseUrl+"integrations/vtiger/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/vtiger/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/accounts/:id/fields"}}),r.intVtigerConfiguration=e(r.baseUrl+"integrations/vtiger/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/vtiger/configurations/:id/descriptions"}}),r.intVtigerField=e(r.baseUrl+"integrations/vtiger/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/vtiger/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/vtiger/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intServicenowAccount=e(r.baseUrl+"integrations/servicenow/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/servicenow/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/accounts/:id/fields"}}),r.intServicenowConfiguration=e(r.baseUrl+"integrations/servicenow/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/servicenow/configurations/:id/descriptions"}}),r.intServicenowField=e(r.baseUrl+"integrations/servicenow/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/servicenow/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/servicenow/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intDynamics365Account=e(r.baseUrl+"integrations/dynamics365/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/accounts/:id/fields"}}),r.intDynamics365Configuration=e(r.baseUrl+"integrations/dynamics365/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/dynamics365/configurations/:id/descriptions"}}),r.intDynamics365Field=e(r.baseUrl+"integrations/dynamics365/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/dynamics365/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/dynamics365/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.intFreshsalesAccount=e(r.baseUrl+"integrations/freshsales/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/accounts/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:r.baseUrl+"integrations/freshsales/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/accounts/:id/fields"}}),r.intFreshsalesConfiguration=e(r.baseUrl+"integrations/freshsales/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/configurations/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/configurations/:id/clone",params:{includeAll:"@includeAll"}},getSubjects:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/descriptions"},getFields:{isArray:!1,method:"get",url:r.baseUrl+"integrations/freshsales/configurations/:id/fields"}}),r.intFreshsalesField=e(r.baseUrl+"integrations/freshsales/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"integrations/freshsales/fields/describe"},clone:{method:"post",url:r.baseUrl+"integrations/freshsales/fields/:id/clone",params:{includeAll:"@includeAll"}}}),r.network=e(r.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"networks/describe"},clone:{method:"post",url:r.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatQueueReport=e(r.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatInternalMessage=e(r.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:r.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:r.baseUrl+"chat/internal/messages/users"}}),r.jscriptyAnswerReport=e(r.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyQuestionReport=e(r.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptySessionReport=e(r.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/sessions/reports/:id/questions"}}),r.smsQueueReport=e(r.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReport=e(r.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareReportDetail=e(r.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:r.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),r.jscriptyProject=e(r.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:r.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:r.baseUrl+"jscripty/projects/:id/summary",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.setting=e(r.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"settings/describe"},clone:{method:"post",url:r.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/gdpr"},addPreferred:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/preferred"},getPreferred:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/preferred"},addFavicon:{isArray:!1,method:"post",url:r.baseUrl+"settings/:id/favicon"},getFavicon:{isArray:!1,method:"get",url:r.baseUrl+"settings/:id/favicon"},getDate:{isArray:!1,method:"get",url:r.baseUrl+"settings/now"}}),r.squareOdbc=e(r.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/odbc/describe"},clone:{method:"post",url:r.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:r.baseUrl+"square/odbc/:id/test"}}),r.squareProject=e(r.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/projects/describe"},clone:{method:"post",url:r.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}}}),r.squareRecording=e(r.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/recordings/describe"},clone:{method:"post",url:r.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.squareMessage=e(r.baseUrl+"square/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"square/messages/describe"},clone:{method:"post",url:r.baseUrl+"square/messages/:id/clone",params:{includeAll:"@includeAll"}}}),r.team=e(r.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"teams/describe"},clone:{method:"post",url:r.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:r.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"teams/:id/users"}}),r.license=e(r.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"license/describe"},clone:{method:"post",url:r.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}},downloadLogFile:{isArray:!1,method:"get",url:r.baseUrl+"license/download_log_file",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.campaign=e(r.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"campaigns/describe"},clone:{method:"post",url:r.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:r.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:r.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:r.baseUrl+"campaigns/:id/blacklists"}}),r.migration=e(r.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"migrations/describe"},clone:{method:"post",url:r.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),r.attachment=e(r.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"attachments/describe"},clone:{method:"post",url:r.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.plugin=e(r.baseUrl+"plugins/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"plugins/describe"},clone:{method:"post",url:r.baseUrl+"plugins/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:r.baseUrl+"plugins/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},upload:{isArray:!1,method:"post",url:r.baseUrl+"plugins/"},delete:{isArray:!1,method:"delete",url:r.baseUrl+"plugins/:id"},webhookGet:{isArray:!1,method:"get",url:r.baseUrl+"plugins/webhook"},webhookPost:{isArray:!1,method:"post",url:r.baseUrl+"plugins/webhook"}}),r.mailTransferReport=e(r.baseUrl+"mail/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"mail/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"mail/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.chatTransferReport=e(r.baseUrl+"chat/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"chat/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"chat/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.faxTransferReport=e(r.baseUrl+"fax/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"fax/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"fax/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.openchannelTransferReport=e(r.baseUrl+"openchannel/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"openchannel/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"openchannel/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.smsTransferReport=e(r.baseUrl+"sms/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"sms/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"sms/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.cmList=e(r.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cm/lists/describe"},clone:{method:"post",url:r.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:r.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/contacts/csv",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}},addCustomField:{isArray:!1,method:"post",url:r.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/fields"},getGlobalCustomFields:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/global_fields"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"cm/lists/:id/users"}}),r.voicePrefix=e(r.baseUrl+"voice/prefixes/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"voice/prefixes/describe"},clone:{method:"post",url:r.baseUrl+"voice/prefixes/:id/clone",params:{includeAll:"@includeAll"}},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/users"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"voice/prefixes/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"voice/prefixes/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"voice/prefixes/:id/teams"}}),r.userProfile=e(r.baseUrl+"userProfiles/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfiles/describe"},clone:{method:"post",url:r.baseUrl+"userProfiles/:id/clone",params:{includeAll:"@includeAll"}},addSections:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/sections"},removeSections:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/sections"},getSections:{isArray:!0,method:"get",url:r.baseUrl+"userProfiles/:id/sections"},addResources:{isArray:!0,method:"post",url:r.baseUrl+"userProfiles/:id/resources"},removeResources:{isArray:!1,method:"delete",url:r.baseUrl+"userProfiles/:id/resources"},getResources:{isArray:!1,method:"get",url:r.baseUrl+"userProfiles/:id/resources"}}),r.userProfileSection=e(r.baseUrl+"userProfile/sections/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/sections/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/sections/:id/clone",params:{includeAll:"@includeAll"}}}),r.userProfileResource=e(r.baseUrl+"userProfile/resources/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userProfile/resources/describe"},clone:{method:"post",url:r.baseUrl+"userProfile/resources/:id/clone",params:{includeAll:"@includeAll"}}}),r.userNotification=e(r.baseUrl+"userNotifications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"userNotifications/describe"},clone:{method:"post",url:r.baseUrl+"userNotifications/:id/clone",params:{includeAll:"@includeAll"}},sendUserNotification:{isArray:!1,method:"post",url:r.baseUrl+"userNotifications/"}}),r.whatsappAccount=e(r.baseUrl+"whatsapp/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/accounts/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/canned_answers"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/users"},addApplications:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/accounts/:id/applications"},notify:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/notify"},send:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/accounts/:id/send"}}),r.whatsappApplication=e(r.baseUrl+"whatsapp/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/applications/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/applications/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappInteraction=e(r.baseUrl+"whatsapp/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/interactions/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/interactions/:id/tags"},download:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,n){var t=n();return{type:t["content-type"],length:t["content-length"],buffer:e}}}}),r.whatsappMessage=e(r.baseUrl+"whatsapp/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/messages/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/accept"},reject:{isArray:!1,method:"put",url:r.baseUrl+"whatsapp/messages/:id/reject"},status:{isArray:!1,method:"post",url:r.baseUrl+"whatsapp/messages/:id/status"}}),r.whatsappQueueReport=e(r.baseUrl+"whatsapp/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/queue/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappTransferReport=e(r.baseUrl+"whatsapp/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/reports/transfer/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),r.whatsappQueue=e(r.baseUrl+"whatsapp/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"whatsapp/queues/describe"},clone:{method:"post",url:r.baseUrl+"whatsapp/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:r.baseUrl+"whatsapp/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:r.baseUrl+"whatsapp/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:r.baseUrl+"whatsapp/queues/:id/users"}}),r.cloudProvider=e(r.baseUrl+"cloudProviders/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:r.baseUrl+"cloudProviders/describe"},clone:{method:"post",url:r.baseUrl+"cloudProviders/:id/clone",params:{includeAll:"@includeAll"}},oauth2MicrosoftAuthorize:{method:"get",url:r.baseUrl+"cloudProviders/:id/oauth2/microsoft/authorize"}}),r.realtime=e(r.baseUrl+"realtime",{},{getAgents:{isArray:!1,method:"get",url:r.baseUrl+"realtime/agents"},getQueues:{isArray:!1,method:"get",url:r.baseUrl+"realtime/queues"}}),r.userSetting=e(r.baseUrl+"user-settings/:id",{id:"@id"},{update:{method:"put",isArray:!1}}),r}e.$inject=["$resource","userProfileManager"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,n){n.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.fallbackLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,n,t,a){var i=this;i.themes=e.themes,i.direction="ltr";var s=t.get("motion.language");s&&(n.use(s),0<=["ar","fa","he"].indexOf(s)&&a.setting.get({id:1}).$promise.then(function(e){e&&e.rtlSupport&&(i.direction="rtl")}).catch(function(e){e&&toasty.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})}))}e.$inject=["motionTheming","$translate","$cookies","api"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var n=new Date,t=new Date(e);return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?a("date")(t.getTime(),"shortTime"):t.getDate()===n.getDate()-1&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(t.getTime(),"shortTime"):a("date")(t.getTime(),"MMM d, y h:mm a")}}function n(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],n.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,n,t){var a,i={},s=0;for(a in e)if(t<=s&&(i[a]=e[a]),++s===t+n)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],n=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],t=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];return{getMonthName:function(){return e},getMonthNumber:function(){return n},getDaysOfWeek:function(){return t},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",n).factory("jscookie",function(){return Cookies}).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,n,t){var a;t.html5Mode(!0),n.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",s={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:s[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:s[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:s[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:s[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:s[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver","settingsManager",function(e,n){return e.resolve("setting@get",{id:1}).then(function(e){return n.set(e),e})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,n){e.onStart({},n.showLoadingIndicator),e.onFinish({},n.hideLoadingIndicator)}e.$inject=["$transitions","LoadingIndicatorService"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i,o={};function s(){a.$broadcast("socket:connect"),i&&i.connected||(i=io({query:e.getCurrentUser()?"id="+e.getCurrentUser().id:void 0,transports:["websocket","polling"]})).once("disconnect",n)}function n(e){i.once("connect",s),"logout"===e?i.removeAllListeners():a.$broadcast("socket:disconnect"),i&&i.connected&&i.disconnect()}function r(e,n,t){o[e]||(o[e]=[]),o[e].push({wrapper:n,fn:t})}return{connect:s,disconnect:n,getListeners:function(e){return e?o[e]:o},on:function(e,n){n=n||angular.noop,i||s();var t=function(){var e=arguments;a.$applyAsync(function(){n.apply(i,e)})};r(e,t,n),i.on(e,t)},onWithoutApply:function(e,n){n=n||angular.noop,i||s();var t=function(){n.apply(i,arguments)};r(e,t,n),i.on(e,t)},emit:function(e,n,t){t=t||angular.noop,i||s(),i.emit(e,n,function(){var e=arguments;a.$applyAsync(function(){t.apply(i,e)})})},removeAllListeners:function(e){var n;i||s(),i.removeAllListeners(e),n=e,_.isEmpty(o[n])||delete o[n]},removeListener:function(e,n){i||s();var t=function(e,n){var t=o[e];if(!_.isEmpty(t))for(var a=0;a<t.length;a++){var i=t[a];if(i.fn===n){var s=i.wrapper;return t.splice(a,1),s}}}(e,n);i.removeListener(e,t)}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r){var l=this;l.progresslogin=!1,l.googleSsoEnabled=!1,l.adSsoEnabled=!1,l.login=function(){return l.progresslogin=!0,l.message="",s.login(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.loginOauth=function(e){l.message="",t.location.href=s.loginSSO(e)},l.loginAD=function(){return l.progresslogin=!0,l.message="",s.loginAD(l.form).then(function(){return n.go("app.dashboards.general")}).catch(function(e){l.message=e.data?e.data.message:e.message}).finally(function(){l.progresslogin=!1})},l.onInit=function(){{if(n.params.token&&n.params.userId)return s.removeCookies(),l.progresslogin=!0,o.secureCookieEnabled?r.set("motion.token",n.params.token,{secure:!0,sameSite:"none"}):r.set("motion.token",n.params.token),i.user.get({id:n.params.userId}).$promise.then(function(e){e&&(s.setCurrentUser(e),n.go("app.dashboards.general"))}).finally(function(){l.progresslogin=!1});s.isLoggedIn()&&n.go("app.dashboards.general")}l.googleSsoEnabled=o.googleSsoEnabled,l.adSsoEnabled=o.adSsoEnabled},l.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth","setting","jscookie"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_EXTRACTEDREPORT",g.extractedReport=angular.copy(l),g.extractedReports=r,g.newExtractedReport=!1,g.extractedReport||(g.extractedReport={},g.title="ANALYTICS.NEW_EXTRACTEDREPORT",g.newExtractedReport=!0),g.addNewExtractedReport=function(){g.errors=[],d.analyticExtractedReport.save(g.extractedReport).$promise.then(function(e){g.extractedReports.unshift(e.toJSON()),o.success({title:"ExtractedReport properly created",msg:g.extractedReport.name?g.extractedReport.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveExtractedReport=function(){g.errors=[],d.analyticExtractedReport.update({id:g.extractedReport.id},g.extractedReport).$promise.then(function(e){var n=_.find(g.extractedReports,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ExtractedReport properly saved!",msg:g.extractedReport.name?g.extractedReport.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteExtractedReport=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticExtractedReport.delete({id:g.extractedReport.id}).$promise.then(function(){_.remove(g.extractedReports,{id:g.extractedReport.id}),o.success({title:"ExtractedReport properly deleted!",msg:(g.extractedReport.name||"extractedReport")+" has been deleted!"}),v(g.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","extractedReports","extractedReport","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.extractedReports=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="extractedReports",f.listOrder="",f.listOrderAsc=null,f.selectedExtractedReports=[],f.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:f.extractedReports.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.analyticExtractedReport.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("extractedReport")+"?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getExtractedReports=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticExtractedReport.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ExtractedReports",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditExtractedReport=function(e,n){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:n,extractedReports:f.extractedReports.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteExtractedReport=y,f.exportSelectedExtractedReports=function(){var e=angular.copy(f.selectedExtractedReports);return f.selectedExtractedReports=[],e},f.deleteSelectedExtractedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+f.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedExtractedReports.forEach(function(e){y(e)}),f.selectedExtractedReports=[]})},f.deselectExtractedReports=function(){f.selectedExtractedReports=[]},f.selectAllExtractedReports=function(){f.selectedExtractedReports=f.extractedReports.rows};var b=!0,A=1;function E(e){f.extractedReports=e||{count:0,rows:[]}}function y(e){m.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(f.extractedReports.rows,{id:e.id}),f.extractedReports.count-=1,f.extractedReports.rows.length||f.getExtractedReports(),p.success({title:_.startCase("ExtractedReport")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","extractedReports","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_METRIC",g.metric=angular.copy(l),g.metrics=r,g.newMetric=!1,g.metric||(g.metric={table:"report_agent"},g.title="ANALYTICS.NEW_METRIC",g.newMetric=!0),g.addNewMetric=function(){g.errors=[],d.analyticMetric.save(g.metric).$promise.then(function(e){g.metrics.unshift(e.toJSON()),o.success({title:"Metric properly created",msg:g.metric.name?g.metric.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMetric=function(){g.errors=[],d.analyticMetric.update({id:g.metric.id},g.metric).$promise.then(function(e){var n=_.find(g.metrics,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Metric properly saved!",msg:g.metric.name?g.metric.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMetric=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.analyticMetric.delete({id:g.metric.id}).$promise.then(function(){_.remove(g.metrics,{id:g.metric.id}),o.success({title:"Metric properly deleted!",msg:(g.metric.name||"metric")+" has been deleted!"}),v(g.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","metrics","metric","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.metrics=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="metrics",f.listOrder="",f.listOrderAsc=null,f.selectedMetrics=[],f.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},f.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"CDR",value:"'cdr'"},{option:"Chat Website",value:"'chat_websites'"},{option:"Chat Interaction",value:"'chat_interactions'"},{option:"Chat Messages",value:"'chat_messages'"},{option:"Chat Offline Messages",value:"'chat_offline_messages'"},{option:"Chat Queues",value:"'chat_queues'"},{option:"Chat Report Queue",value:"'report_chat_queue'"},{option:"Chat Report Transfer",value:"'report_chat_transfer'"},{option:"Companies",value:"'cm_companies'"},{option:"Call transfer report",value:"'report_call_transfer'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dial Report",value:"'report_dial'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Email Account",value:"'mail_accounts'"},{option:"Email Interaction",value:"'mail_interactions'"},{option:"Email Messages",value:"'mail_messages'"},{option:"Email Queues",value:"'mail_queues'"},{option:"Email Report Queue",value:"'report_mail_queue'"},{option:"Email Report Transfer",value:"'report_mail_transfer'"},{option:"Fax Account",value:"'fax_accounts'"},{option:"Fax Interaction",value:"'fax_interactions'"},{option:"Fax Messages",value:"'fax_messages'"},{option:"Fax Queues",value:"'fax_queues'"},{option:"Fax Report Queue",value:"'report_fax_queue'"},{option:"Fax Report Transfer",value:"'report_fax_transfer'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Lists",value:"'cm_lists'"},{option:"Member Report",value:"'report_member'"},{option:"Openchannel Account",value:"'openchannel_accounts'"},{option:"Openchannel Interaction",value:"'openchannel_interactions'"},{option:"Openchannel Messages",value:"'openchannel_messages'"},{option:"Openchannel Queues",value:"'openchannel_queues'"},{option:"Openchannel Report Queue",value:"'report_openchannel_queue'"},{option:"Openchannel Report Transfer",value:"'report_openchannel_transfer'"},{option:"Queue Report",value:"'report_queue'"},{option:"SMS Account",value:"'sms_accounts'"},{option:"SMS Interaction",value:"'sms_interactions'"},{option:"SMS Messages",value:"'sms_messages'"},{option:"SMS Queues",value:"'sms_queues'"},{option:"SMS Report Queue",value:"'report_sms_queue'"},{option:"SMS Report Transfer",value:"'report_sms_transfer'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"},{option:"Whatsapp Account",value:"'whatsapp_accounts'"},{option:"Whatsapp Interaction",value:"'whatsapp_interactions'"},{option:"Whatsapp Messages",value:"'whatsapp_messages'"},{option:"Whatsapp Queues",value:"'whatsapp_queues'"},{option:"Whatsapp Report Queue",value:"'report_whatsapp_queue'"},{option:"Whatsapp Report Transfer",value:"'report_whatsapp_transfer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{metric:e,metrics:f.metrics.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("metric")+"?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMetrics=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.analyticMetric.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Metrics",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMetric=function(e,n){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:n,metrics:f.metrics.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMetric=y,f.exportSelectedMetrics=function(){var e=angular.copy(f.selectedMetrics);return f.selectedMetrics=[],e},f.deleteSelectedMetrics=function(e){var n=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+f.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMetrics.forEach(function(e){y(e)}),f.selectedMetrics=[]})},f.deselectMetrics=function(){f.selectedMetrics=[]},f.selectAllMetrics=function(){f.selectedMetrics=f.metrics.rows};var b=!0,A=1;function E(e){f.metrics=e||{count:0,rows:[]}}function y(e){m.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(f.metrics.rows,{id:e.id}),f.metrics.count-=1,f.metrics.rows.length||f.getMetrics(),p.success({title:_.startCase("Metric")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","metrics","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o){var r=this;function l(){n.hide()}r.errors=[],r.report=angular.copy(t),r.report.name+="-copy",r.treeCustomData=o,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,n){r.currentNode=n.node}},r.copyReport=function(){var t;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){t=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(n).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:t.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){n.hide()}c.errors=[],c.joinTables=[],c.title="ANALYTICS.EDIT_REPORT",c.crudPermissions=d,c.report=angular.copy(i),c.reports=a,c.newReport=!1,c.tables=l.getMap(),c.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"cross_join",value:"Cross Join"}],c.report||(c.report={name:"",table:"report_agent",description:"",parent:r.id},c.title="ANALYTICS.NEW_REPORT",c.newReport=!0),c.addNewReport=function(){c.errors=[],c.report.joins=_.map(c.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),c.report.joins=JSON.stringify(c.report.joins),s[o].save(c.report).$promise.then(function(e){c.reports.unshift(e),t.success({title:"Report properly created",msg:c.report.name?c.report.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveReport=function(){c.errors=[],s[o].update({id:c.report.id},c.report).$promise.then(function(e){var n=_.find(c.reports,{id:e.id});n&&_.merge(n,e),t.success({title:"Report properly saved!",msg:c.report.name?c.report.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteReport=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){s[o].delete({id:c.report.id}).$promise.then(function(){_.remove(c.reports,{id:c.report.id}),t.success({title:"Report properly deleted!",msg:c.report.name?c.report.name+" has been deleted!":""}),m()}).catch(function(e){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},c.closeDialog=m,c.selectedTableChange=function(e){e&&(delete c.selectedItem,c.joinTables.push(e))},c.removeJoin=function(e){c.joinTables.splice(e,1)},c.getFields=function(n,t,e){var a=_.find(c.tables,{name:e});a&&a.api&&s[a.api].describe().$promise.then(function(e){n[t]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,s,o,e){var r=this;r.report={},r.conditions=e.getConditions,r.init=function(e,n){r.report=e,r.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}},r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1};for(var t=0;t<r.report.condition.group.rules.length;t++)if(r.report.condition.group.rules[t].field){var a=r.report.condition.group.rules[t].field.split(".");1===a.length&&(r.report.condition.group.rules[t].field=r.report.table+"."+r.report.condition.group.rules[t].field)}s.getColumns(r.report.table).then(function(e){r.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},r.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(n,1)},function(){console.log("CANCEL")})},r.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(a){var i={report_call_transfer:"voiceTransferReport",cm_companies:"cmCompany",cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",cm_lists:"cmList",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",report_chat_transfer:"chatTransferReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",report_mail_transfer:"mailTransferReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",report_openchannel_transfer:"openchannelTransferReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",report_sms_transfer:"smsTransferReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_transfer:"faxTransferReport",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_dial:"voiceDialReport",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording",cdr:"cdr",whatsapp_accounts:"whatsappAccount",whatsapp_queues:"whatsappQueue",whatsapp_interactions:"whatsappInteraction",whatsapp_messages:"whatsappMessage",report_whatsapp_queue:"whatsappQueueReport",report_whatsapp_transfer:"whatsappTransferReport"};return{getMap:function(){var t=[];return _.forIn(i,function(e,n){t.push({name:n,api:e})}),t},getColumns:function(e){var n=i[e],t={};return"cm_contacts"===e&&(t.analytics=!0),a[n].describe(t).$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;(u.errors=[],u.title="Edit Report Field",u.report=i,u.reportField=angular.copy(o),u.reportFields=s,u.metrics=r,u.columns=l,u.sqlUtil=d,u.newReportField=!1,u.crudPermissions=m,u.reportField)?(u.reportField.type=u.reportField.custom?"custom":u.reportField.MetricId?"metric":"column",u.reportField.field&&!u.reportField.custom&&_.isNil(u.reportField.MetricId)&&1===u.reportField.field.split(".").length&&(u.reportField.field=u.report.table+"."+u.reportField.field)):(u.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},u.title="New Report Field",u.newReportField=!0);function p(){t.hide()}u.addNewReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,u.reportField.CustomReportId=u.report.id,c.analyticFieldReport.save(u.reportField).$promise.then(function(e){u.reportFields.push(e),a.success({title:"Report field properly created",msg:u.reportField.field?u.reportField.field+" has been created!":u.reportField.type+" has been created!"}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},u.saveReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,c.analyticFieldReport.update({id:u.reportField.id},u.reportField).$promise.then(function(e){var n=_.find(u.reportFields,{id:e.id});n&&_.merge(n,e),a.success({title:"Report Field properly saved!",msg:u.reportField.field?u.reportField.field+" has been saved!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},u.deleteReportField=function(e){u.errors=[];var n=t.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){c.analyticFieldReport.delete({id:u.reportField.id}).$promise.then(function(){_.remove(u.reportFields,{id:u.reportField.id}),a.success({title:"Report Field properly deleted!",msg:u.reportField.field?u.reportField.field+" has been deleted!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},u.closeDialog=p}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){o.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e,n){c.report=e,c.query.CustomReportId=c.report.id,c.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),o.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=o.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,n){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:n,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null,crudPermissions:c.crudPermissions}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var n=_.find(c.metrics,{id:e});return n?n.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var n=_.find(c.metrics,{id:e});return n?n.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){o.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),s.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}n.$watch("vm_rf.query.filter",function(e,n){m?t(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(e){return _.isArray(e)}o.report=a||{},o.userProfileSection=s&&1==s.count?s.rows[0]:null,o.crudPermissions=i.parseCrudPermissions(o.userProfileSection?o.userProfileSection.crudPermissions:null),o.selectedTab=e.params.tab||0,o.gotoReports=function(){e.go("app.analytics.reports",{},{reload:"app.analytics.reports"})},o.saveReport=function(){o.report.conditions=angular.toJson(o.report.condition),t.analyticCustomReport.update({id:o.report.id},_.omit(o.report,"joins")).$promise.then(function(){n.success({title:"Report updated!",msg:o.report.name?o.report.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.previewReport=function(){o.columns=[],o.rows=[],o.error=!1,t.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:o.report.id}).$promise.then(function(e){return o.columns=e?e.rows:[],t.analyticCustomReport.preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.queryReport=function(){return o.queryResult="Loading...",t.analyticCustomReport.query({id:o.report.id}).$promise.then(function(e){o.queryResult=e.sql}).catch(function(e){o.queryResult="",console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})},o.mapArray=function(e,n){if(r(e))return _.map(e,n).join(",");return""},o.isArray=r,o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$state","toasty","api","report","Auth","userProfileSection"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.errors=[],o.report=angular.copy(a),o.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n},o.closeDialog=function(){n.hide()},function(){o.columns=[],o.rows=[],o.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=o.report.id,o.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return o.columns=e?e.rows:[],i[s].preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.reports={count:0,rows:[]},p.userProfile=r,p.userProfileSection=l&&1==l.count?l.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.selectedReports=[],p.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},p.apiName=null,p.currentPath="",p.customTree=!0,p.editstate=function(e,n){s.go("app.analytics.reports.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.copydialog=function(e,n){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,treeCustomData:p.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},p.previewdialog=function(e,n){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName}})},p.rundialog=function(e,n){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,currentPath:p.currentPath}})},p.downloadfile=function(a,e){var i;d.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var n={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return n["analyticCustomReport"===p.apiName?"CustomReportId":"DefaultReportId"]=a.id,d.analyticFieldReport.get(n).$promise}).then(function(e){for(var n=0;n<e.rows.length;n+=1)e.rows[n].MetricId&&(e.rows[n].field=i[e.rows[n].MetricId].metric,e.rows[n].custom=!0),delete e.rows[n].MetricId;var t=o.document.createElement("a");t.href="data:text/json;charset=utf-8,"+o.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),t.download=a.name+".json",t.target="_self",t.click(),m.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){b(e)},function(){console.log("CANCEL")})},p.success=h,p.getReports=f,p.createOrEditReport=function(e,n){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:n,reports:p.reports.rows,apiName:p.apiName,currentNode:p.currentNode,setting:null,crudPermissions:p.crudPermissions}})},p.importReport=function(e,n,t){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var t=atob(e.target.result.split(",")[1]);t=angular.fromJson(t),d.analyticCustomReport.save({name:t.name,description:t.description,table:t.table,conditions:t.conditions,joins:t.joins,parent:p.currentNode.id}).$promise.then(function(n){p.reports.rows.unshift(n),m.success({title:"Report saved!",msg:n.name?n.name+" has been saved!":""});var e=_.map(t.fields,function(e){return _.extend({},e,{CustomReportId:n.id})});return d.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){m.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),m.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else m.error({title:"Format Error",msg:"Please use only json files"})},p.deleteReport=b,p.exportSelectedReports=function(){var e=angular.copy(p.selectedReports);return p.selectedReports=[],e},p.deleteSelectedReports=function(e){var n=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+p.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){p.selectedReports.forEach(function(e){b(e)}),p.selectedReports=[]})},p.deselectReports=function(){p.selectedReports=[]},p.selectAllReports=function(){p.selectedReports=p.reports.rows},p.treeDefaultData=c.rows[0]?angular.fromJson(c.rows[0].tree):[],p.treeCustomData=c.rows[1]?angular.fromJson(c.rows[1].tree):[],p.treeDefaultConfig=S(!1),p.treeCustomConfig=S(!0),p.treeDefaultEvents=T(!1),p.treeCustomEvents=T(!0);var g=!0,v=1;function h(e){p.reports=e||{count:0,rows:[]}}function f(){if(p.query.offset=(p.query.page-1)*p.query.limit,p.apiName)if("admin"===p.currentUser.role||p.userProfileSection.autoAssociation)p.promise=d[p.apiName].get(p.query,h).$promise;else{var a=[];p.promise=d[p.apiName].get(p.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:p.userProfileSection.id,type:"analyticDefaultReport"===p.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),h({count:t.length,rows:t})}return h(null)}):h(null)})}}function b(e){p.apiName&&d[p.apiName].delete({id:e.id}).$promise.then(function(){_.remove(p.reports.rows,{id:e.id}),p.reports.count-=1,p.reports.rows.length||p.getReports(),m.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function A(e,n){p.treeDefaultInstance.jstree(!0).deselect_all(),p.treeDefaultInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!0,p.currentPath=p.treeCustomInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticCustomReport",p.query.parent=n.node.id,f()}function E(e,n){p.treeCustomInstance.jstree(!0).deselect_all(),p.treeCustomInstance.jstree(!0).close_all(),p.currentNode=n.node,p.currentNode.custom=!1,p.currentPath=p.treeDefaultInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticDefaultReport",p.query.parent=n.node.id,f()}function y(e,n){var t,a,i;"rename_node"===e.type&&(a=(t=n).node.id,i="","custom"===t.node.parent?t.node.id.includes("custom_report_")||(i="custom_report_"+t.text):i=t.node.parent+"_"+t.text,p.treeCustomInstance.jstree(!0).set_id(t.node,"custom_report_"+i.toLowerCase()),t.node.a_attr.id=t.node.a_attr.id.replace(a,t.node.id),t.node.li_attr.id=t.node.id);var s=angular.toJson(p.treeCustomInstance.jstree(!0).get_json("#"));d.analyticTreeReport.update({id:2,tree:s}).$promise.then(function(){c.rows[1]&&(c.rows[1].tree=s),m.success({title:"Node Updated",msg:n.node.text?n.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function S(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(t){var e={};return p.crudPermissions.canEdit&&_.assign(e,{create:{label:n.instant("ANALYTICS.CREATE"),action:function(){t=p.treeCustomInstance.jstree(!0).create_node(t),p.treeCustomInstance.jstree(!0).edit(t)}},rename:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.RENAME"),action:function(){p.treeCustomInstance.jstree(!0).edit(t)}}}),p.crudPermissions.canDelete&&_.assign(e,{remove:{_disabled:"#"===t.parent,label:n.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(t.text?t.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n=p.treeCustomInstance.jstree(!0).get_parent(t);n=p.treeCustomInstance.jstree(!0).get_node(n),p.treeCustomInstance.jstree(!0).delete_node(t),e=[t.id].concat(t.children_d||[]),d.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){b(e)})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),p.treeCustomInstance.jstree(!0).select_node(n)})}}}),e}}}}function T(e){return e?{create_node:y,rename_node:y,move_node:y,delete_node:y,select_node:A}:{select_node:E}}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getReports())}),e.$watch("vm.search",function(e,n){p.treeDefaultInstance&&p.treeDefaultInstance.jstree(!0).search(e),p.treeCustomInstance&&p.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","userProfile","userProfileSection","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startTime:new Date(moment().startOf("day")),startDate:new Date(moment().startOf("day")),endTime:new Date(moment().endOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){t.hide()}l.errors=[],l.report=angular.copy(n),l.export={},l.runReport=function(n){l.export.name=l.export.name.replace(/\//g,"_"),l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).set("hour",l.export.startTime.getHours()).set("minute",l.export.startTime.getMinutes()).set("second",l.export.startTime.getSeconds()).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).set("hour",l.export.endTime.getHours()).set("minute",l.export.endTime.getMinutes()).set("second",l.export.endTime.getSeconds()).format("YYYY-MM-DD HH:mm:ss")}),i[s].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?t.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(o.body),targetEvent:n,skipHide:!0,locals:{apiName:s,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var n={fields:"field,alias",nolimit:!0};return n["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",n)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){o.offset=(r.query.page-1)*r.query.limit,o.limit=r.query.limit,r.promise=t[s].run(o,l).$promise},r.valueReplacer=function(e,n){moment(n,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(n=moment(n,"").format("YYYY-MM-DD HH:mm:ss"));return n}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_ODBC",g.odbc=angular.copy(l),g.odbcs=r,g.newOdbc=!1,g.odbc||(g.odbc={},g.title="CALLYSQUARE.NEW_ODBC",g.newOdbc=!0),g.addNewOdbc=function(){g.errors=[],d.squareOdbc.save(g.odbc).$promise.then(function(e){g.odbcs.unshift(e.toJSON()),o.success({title:"Odbc properly created",msg:g.odbc.name?g.odbc.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOdbc=function(){g.errors=[],d.squareOdbc.update({id:g.odbc.id},g.odbc).$promise.then(function(e){var n=_.find(g.odbcs,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Odbc properly saved!",msg:g.odbc.name?g.odbc.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOdbc=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareOdbc.delete({id:g.odbc.id}).$promise.then(function(){_.remove(g.odbcs,{id:g.odbc.id}),o.success({title:"Odbc properly deleted!",msg:(g.odbc.name||"odbc")+" has been deleted!"}),v(g.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","odbcs","odbc","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.odbcs=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="odbcs",f.listOrder="",f.listOrderAsc=null,f.selectedODBC=[],f.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{odbc:e,odbcs:f.odbcs.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.testtestOdbc=function(e,n){return m.squareOdbc.test({id:e.id}).$promise.then(function(){p.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("odbc")+"?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getODBC=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareOdbc.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ODBC",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOdbc=function(e,n){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:n,odbcs:f.odbcs.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOdbc=y,f.exportSelectedODBC=function(){var e=angular.copy(f.selectedODBC);return f.selectedODBC=[],e},f.deleteSelectedODBC=function(e){var n=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+f.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedODBC.forEach(function(e){y(e)}),f.selectedODBC=[]})},f.deselectODBC=function(){f.selectedODBC=[]},f.selectAllODBC=function(){f.selectedODBC=f.odbcs.rows};var b=!0,A=1;function E(e){f.odbcs=e||{count:0,rows:[]}}function y(e){m.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(f.odbcs.rows,{id:e.id}),f.odbcs.count-=1,f.odbcs.rows.length||f.getODBC(),p.success({title:_.startCase("Odbc")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","odbcs","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o,r,l,d){var c=this;function m(e){n.hide(e)}c.errors=[],c.title="CALLYSQUARE.EDIT_PROJECT",c.crudPermissions=d,c.project=angular.copy(o),c.newWindow=!0,c.projects=s,c.newProject=!1,c.openFromEditor=l,c.project||(c.project={name:"",description:""},c.title="CALLYSQUARE.NEW_PROJECT",c.newProject=!0),c.addNewProject=function(){c.errors=[],r.squareProject.save(c.project).$promise.then(function(e){c.projects.unshift(e),i.success({title:"Project properly created",msg:c.project.name?c.project.name+" has been created!":""}),m(e),c.openFromEditor&&(c.newWindow?t.open("/callysquare/projects/"+e.id,"_blank"):a.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveProject=function(){c.errors=[],r.squareProject.update({id:c.project.id},c.project).$promise.then(function(e){var n=_.find(c.projects,{id:e.id});n&&_.merge(n,e),i.success({title:"Project properly saved!",msg:c.project.name?c.project.name+" has been saved!":""}),m(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteProject=function(){c.errors=[];var e=n.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);n.show(e).then(function(){r.squareProject.delete({id:c.project.id}).$promise.then(function(){_.remove(c.projects,{id:c.project.id}),i.success({title:"Project properly deleted!",msg:c.project.name?c.project.name+" has been deleted!":""}),m(c.project)}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$window","$state","Auth","toasty","projects","project","api","openFromEditor","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T,I,O,C,w,R,x,N,D){var P=this,L={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],google_cloud_tts:["apiKey","google_cloud_tts_text_type","text"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","text","aws_text_type"],lumenvoxtts:["text"],sestektts:["text"],lumenvoxasr:["grammar"],sestekasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"],dialogflow:["key","text","dialogflow_language"],awslex:["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],sesteknda:["text","ndauth_url","username","password","ndassistant_url"],restapi:["url","method"],mrcpsynth:["text"],mrcprecog:["grammar"],dialogflowV2:["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"]},k={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},M={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function U(e,n,t,a){return _.map(e,function(e){return{value:e[n],option:e[t],group:a?e[a]:void 0,canSelect:void 0===e.canSelect||e.canSelect}})}function F(){var e=Number(_.find(P.attributes,{name:"sip_id"}).value);if(!_.some(d,{id:e})&&0<e)return t.user.get({id:e,fields:"id,fullname,role"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,d.push(n),P.values.sip_id=U(d,"id","fullname","role")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_USER",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sip_id=U(d,"id","fullname","role")}function $(){var e=Number(_.find(P.attributes,{name:"list_id"}).value);if(!_.some(E,{id:e})&&0<e)return t.cmList.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,E.push(n),P.values.list_id=U(E,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_LIST",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.list_id=U(E,"id","name")}function q(){var e=Number(_.find(P.attributes,{name:"trunk_id"}).value);if(!_.some(c,{id:e})&&0<e)return t.trunk.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,c.push(n),P.values.trunk_id=U(c,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_id=U(c,"id","name")}function G(){var e=_.find(P.attributes,{name:"trunk_name"}).value;if(!_.some(c,{name:e})&&e)return t.trunk.get({name:e,fields:"id,name"}).$promise.then(function(e){if(0<e.count&&0<e.rows.length){var n=e.rows[0];n.canSelect=!1,c.push(n),P.values.trunk_name=U(c,"name","name")}}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.trunk_name=U(c,"name","name")}function H(){var e=Number(_.find(P.attributes,{name:"queue_id"}).value);if(!_.some(m,{id:e})&&0<e)return t.voiceQueue.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,m.push(n),P.values.queue_id=U(m,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_QUEUE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.queue_id=U(m,"id","name")}function V(){var e=Number(_.find(P.attributes,{name:"file_id"}).value);if(!_.some(u,{id:e})&&0<e)return t.sound.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,u.push(n),P.values.file_id=U(u,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SOUND",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.file_id=U(u,"id","name")}function B(){var e=Number(_.find(P.attributes,{name:"variable_id"}).value);if(!_.some(p,{id:e})&&0<e)return t.variable.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,p.push(n),P.values.variable_id=U(p,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_VARIABLE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.variable_id=U(p,"id","name")}function Q(){var e=Number(_.find(P.attributes,{name:"odbc_id"}).value);if(!_.some(g,{id:e})&&0<e)return t.squareOdbc.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,g.push(n),P.values.odbc_id=U(g,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_ODBC",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.odbc_id=U(g,"id","name")}function W(){var e=Number(_.find(P.attributes,{name:"project_id"}).value);if(!_.some(v,{id:e})&&0<e)return t.squareProject.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,v.push(n),P.values.project_id=U(v,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PROJECT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.project_id=U(v,"id","name")}function j(){var e=Number(_.find(P.attributes,{name:"context"}).value);if(!_.some(h,{id:e})&&0<e)return t.voiceContext.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,h.push(n),P.values.context=U(h,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_CONTEXT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.context=U(h,"id","name")}function Y(){var e=Number(_.find(P.attributes,{name:"interval_id"}).value);if(!_.some(f,{id:e})&&0<e)return t.interval.get({id:e,fields:"id,name,IntervalId"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,f.push(n),P.values.interval_id=U(f,"id","name","IntervalId")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_INTERVAL",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.interval_id=U(f,"id","name","IntervalId")}function z(){var e=Number(_.find(P.attributes,{name:"account_id"}).value);if(!_.some(b,{id:e})&&0<e)return t.mailAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,b.push(n),P.values.account_id=U(b,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_MAIL_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.account_id=U(b,"id","name")}function J(){var e=Number(_.find(P.attributes,{name:"sms_account_id"}).value);if(!_.some(O,{id:e})&&0<e)return t.smsAccount.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,O.push(n),P.values.sms_account_id=U(O,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SMS_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.sms_account_id=U(O,"id","name")}function K(){var e=Number(_.find(P.attributes,{name:"template_id"}).value);if(!_.some(A,{id:e})&&0<e)return t.template.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,A.push(n),P.values.template_id=U(A,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TEMPLATE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.template_id=U(A,"id","name")}function X(){var e=Number(_.find(P.attributes,{name:"pause_id"}).value);if(!_.some(C,{id:e})&&0<e)return t.pause.get({id:e,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,C.push(n),P.values.pause_id=U(C,"id","name")}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PAUSE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});P.values.pause_id=U(C,"id","name")}P.cellName=y.tagName,P.attributes=_.map(y.attributes,function(e){return{name:e.name,value:e.value,defaultValue:k[P.cellName]&&_.includes(k[P.cellName],e.name),required:L[P.cellName]&&_.includes(L[P.cellName],e.name),help:M[P.cellName]&&_.includes(M[P.cellName],e.name)}}),P.values={authMethod:[{value:"noauth",option:"NO AUTH"},{value:"hmac",option:"HMAC"}],answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],ndagenerate_audio:[{value:1,option:"Yes"},{value:0,option:"No"}],ndaactivity_type:[{value:"message",option:"Message"},{value:"conversationUpdate",option:"Conversation Update"},{value:"contactRelationUpdate",option:"Contact Relation Update"},{value:"endOfConversation",option:"End of Conversation"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:e,ispeech_asr_language:i,ispeech_tts_language:o,languageCode:r,ssmlGender:[{value:"FEMALE",option:"Female"},{value:"MALE",option:"Male"}],google_tts_language:l,google_asr_language:s,google_cloud_tts_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],aws_polly_region:I,aws_polly_voice:T,aws_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}],dialogflow_language:w,dialogflowV2_language:R,aws_lex_region:x,method:[{value:"GET",option:"GET"},{value:"POST",option:"POST"},{value:"PUT",option:"PUT"},{value:"DELETE",option:"DELETE"}]},P.crudPermissions=D,P.onInit=function(){N.hasRole("admin")?(e={sip_id:U(d,"id","fullname","role"),trunk_name:U(c,"name","name"),trunk_id:U(c,"id","name"),queue_id:U(m,"id","name"),file_id:U(u,"id","name"),variable_id:U(p,"id","name"),odbc_id:U(g,"id","name"),project_id:U(v,"id","name"),context:U(h,"id","name"),interval_id:(t=f,a="id",i="name",s="IntervalId",o=_.filter(t,function(e){return null===e[s]}),r=[],_.forEach(o,function(n){r.push({value:n[a],option:n[i]});var e=_.filter(t,function(e){return e[s]===n.id});_.forEach(e,function(e){r.push({value:e[a],option:" - "+e[i]})})}),r),account_id:U(b,"id","name"),template_id:U(A,"id","name"),list_id:U(E,"id","name"),sms_account_id:U(O,"id","name"),pause_id:U(C,"id","name")},n=_.merge(P.values,e),P.values=n):function(){for(var e=["sip_id","trunk_name","trunk_id","queue_id","file_id","variable_id","odbc_id","project_id","context","interval_id","account_id","template_id","list_id","sms_account_id","pause_id"],n=0;n<P.attributes.length;n++)if(_.includes(e,P.attributes[n].name))switch(P.attributes[n].name){case"sip_id":F();break;case"trunk_name":G();break;case"trunk_id":q();break;case"queue_id":H();break;case"file_id":V();break;case"variable_id":B();break;case"odbc_id":Q();break;case"project_id":W();break;case"context":j();break;case"interval_id":Y();break;case"account_id":z();break;case"template_id":K();break;case"list_id":$();break;case"sms_account_id":J();break;case"pause_id":X()}}();var e,n,t,a,i,s,o,r},P.closeDialog=function(e){e&&S(P.attributes),n.hide()},P.getMap=U}e.$inject=["$mdDialog","api","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleCloudTtslanguageCode","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses","dialogFlowLanguage","dialogFlowV2Language","awsLexRegion","Auth","crudPermissions"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,n,t,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleCloudTtslanguageCode",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"ar-XA",option:"Arabic"},{value:"bn-IN",option:"Bengali (India)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"yue-HK",option:"Chinese (Hong Kong)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"nl-BE",option:"Dutch (Belgium)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"en-AU",option:"English (Australian)"},{value:"en-IN",option:"English (India)"},{value:"en-GB",option:"English (UK)"},{value:"en-US",option:"English (US)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"de-DE",option:"German (Germany)"},{value:"el-GR",option:"Greek (Greece)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hi-IN",option:"Hindi (India)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"it-IT",option:"Italian (Italy)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"kn-IN",option:"Kannada (India)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"cmn-CN",option:"Mandarin Chinese"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Cyrillic)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (US)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"te-IN",option:"Telugu (India)\t"},{value:"th-TH",option:"Thai (Thailand)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"bn",option:"Bengali"},{value:"bs",option:"Bosnian"},{value:"bg",option:"Bulgarian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gu",option:"Gujarati"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"ko",option:"Korean"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"mk",option:"Macedonian"},{value:"ml",option:"Malayalam"},{value:"mr",option:"Marathi"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"pl",option:"Polish"},{value:"pt",option:"Portuguese"},{value:"ro",option:"Romanian"},{value:"ru",option:"Russian"},{value:"sr",option:"Serbian"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"ta",option:"Tamil"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"tr",option:"Turkish"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"}]}).factory("googleAsrLanguage",function(){return[{option:"Afrikaans (South Africa)",value:"af-ZA"},{option:"Albanian (Albania)",value:"sq-AL"},{option:"Amharic (Ethiopia)",value:"am-ET"},{option:"Arabic (Algeria)",value:"ar-DZ"},{option:"Arabic (Bahrain)",value:"ar-BH"},{option:"Arabic (Egypt)",value:"ar-EG"},{option:"Arabic (Iraq)",value:"ar-IQ"},{option:"Arabic (Israel)",value:"ar-IL"},{option:"Arabic (Jordan)",value:"ar-JO"},{option:"Arabic (Kuwait)",value:"ar-KW"},{option:"Arabic (Lebanon)",value:"ar-LB"},{option:"Arabic (Morocco)",value:"ar-MA"},{option:"Arabic (Oman)",value:"ar-OM"},{option:"Arabic (Qatar)",value:"ar-QA"},{option:"Arabic (Saudi Arabia)",value:"ar-SA"},{option:"Arabic (State of Palestine)",value:"ar-PS"},{option:"Arabic (Tunisia)",value:"ar-TN"},{option:"Arabic (United Arab Emirates)",value:"ar-AE"},{option:"Arabic (Yemen)",value:"ar-YE"},{option:"Armenian (Armenia)",value:"hy-AM"},{option:"Azerbaijani (Azerbaijan)",value:"az-AZ"},{option:"Basque (Spain)",value:"eu-ES"},{option:"Bengali (Bangladesh)",value:"bn-BD"},{option:"Bengali (India)",value:"bn-IN"},{option:"Bosnian (Bosnia and Herzegovina)",value:"bs-BA"},{option:"Bulgarian (Bulgaria)",value:"bg-BG"},{option:"Burmese (Myanmar)",value:"my-MM"},{option:"Catalan (Spain)",value:"ca-ES"},{option:"Chinese, Cantonese (Traditional Hong Kong)",value:"yue-Hant-HK"},{option:"Chinese, Mandarin (Simplified, China)",value:"cmn-Hans-CN"},{option:"Croatian (Croatia)",value:"hr-HR"},{option:"Czech (Czech Republic)",value:"cs-CZ"},{option:"Danish (Denmark)",value:"da-DK"},{option:"Dutch (Belgium)",value:"nl-BE"},{option:"Dutch (Netherlands)",value:"nl-NL"},{option:"English (Australia)",value:"en-AU"},{option:"English (Canada)",value:"en-CA"},{option:"English (Ghana)",value:"en-GH"},{option:"English (Hong Kong)",value:"en-HK"},{option:"English (India)",value:"en-IN"},{option:"English (Ireland)",value:"en-IE"},{option:"English (Kenya)",value:"en-KE"},{option:"English (New Zealand)",value:"en-NZ"},{option:"English (Nigeria)",value:"en-NG"},{option:"English (Pakistan)",value:"en-PK"},{option:"English (Philippines)",value:"en-PH"},{option:"English (Singapore)",value:"en-SG"},{option:"English (South Africa)",value:"en-ZA"},{option:"English (Tanzania)",value:"en-TZ"},{option:"English (United Kingdom)",value:"en-GB"},{option:"English (United States)",value:"en-US"},{option:"Estonian (Estonia)",value:"et-EE"},{option:"Filipino (Philippines)",value:"fil-PH"},{option:"Finnish (Finland)",value:"fi-FI"},{option:"French (Belgium)",value:"fr-BE"},{option:"French (Canada)",value:"fr-CA"},{option:"French (France)",value:"fr-FR"},{option:"French (Switzerland)",value:"fr-CH"},{option:"Galician (Spain)",value:"gl-ES"},{option:"Georgian (Georgia)",value:"ka-GE"},{option:"German (Austria)",value:"de-AT"},{option:"German (Germany)",value:"de-DE"},{option:"German (Switzerland)",value:"de-CH"},{option:"Greek (Greece)",value:"el-GR"},{option:"Gujarati (India)",value:"gu-IN"},{option:"Hebrew (Israel)",value:"iw-IL"},{option:"Hindi (India)",value:"hi-IN"},{option:"Hungarian (Hungary)",value:"hu-HU"},{option:"Icelandic (Iceland)",value:"is-IS"},{option:"Indonesian (Indonesia)",value:"id-ID"},{option:"Italian (Italy)",value:"it-IT"},{option:"Italian (Switzerland)",value:"it-CH"},{option:"Japanese (Japan)",value:"ja-JP"},{option:"Javanese (Indonesia)",value:"jv-ID"},{option:"Kannada (India)",value:"kn-IN"},{option:"Kazakh (Kazakhstan)",value:"kk-KZ"},{option:"Khmer (Cambodia)",value:"km-KH"},{option:"Korean (South Korea)",value:"ko-KR"},{option:"Lao (Laos)",value:"lo-LA"},{option:"Latvian (Latvia)",value:"lv-LV"},{option:"Lithuanian (Lithuania)",value:"lt-LT"},{option:"Macedonian (North Macedonia)",value:"mk-MK"},{option:"Malay (Malaysia)",value:"ms-MY"},{option:"Malayalam (India)",value:"ml-IN"},{option:"Marathi (India)",value:"mr-IN"},{option:"Mongolian (Mongolia)",value:"mn-MN"},{option:"Nepali (Nepal)",value:"ne-NP"},{option:"Norwegian Bokmål (Norway)",value:"no-NO"},{option:"Persian (Iran)",value:"fa-IR"},{option:"Polish (Poland)",value:"pl-PL"},{option:"Portuguese (Brazil)",value:"pt-BR"},{option:"Portuguese (Portugal)",value:"pt-PT"},{option:"Punjabi (Gurmukhi India)",value:"pa-Guru-IN"},{option:"Romanian (Romania)",value:"ro-RO"},{option:"Russian (Russia)",value:"ru-RU"},{option:"Serbian (Serbia)",value:"sr-RS"},{option:"Sinhala (Sri Lanka)",value:"si-LK"},{option:"Slovak (Slovakia)",value:"sk-SK"},{option:"Slovenian (Slovenia)",value:"sl-SI"},{option:"Spanish (Argentina)",value:"es-AR"},{option:"Spanish (Bolivia)",value:"es-BO"},{option:"Spanish (Chile)",value:"es-CL"},{option:"Spanish (Colombia)",value:"es-CO"},{option:"Spanish (Costa Rica)",value:"es-CR"},{option:"Spanish (Dominican Republic)",value:"es-DO"},{option:"Spanish (Ecuador)",value:"es-EC"},{option:"Spanish (El Salvador)",value:"es-SV"},{option:"Spanish (Guatemala)",value:"es-GT"},{option:"Spanish (Honduras)",value:"es-HN"},{option:"Spanish (Mexico)",value:"es-MX"},{option:"Spanish (Nicaragua)",value:"es-NI"},{option:"Spanish (Panama)",value:"es-PA"},{option:"Spanish (Paraguay)",value:"es-PY"},{option:"Spanish (Peru)",value:"es-PE"},{option:"Spanish (Puerto Rico)",value:"es-PR"},{option:"Spanish (Spain)",value:"es-ES"},{option:"Spanish (United States)",value:"es-US"},{option:"Spanish (Uruguay)",value:"es-UY"},{option:"Spanish (Venezuela)",value:"es-VE"},{option:"Sundanese (Indonesia)",value:"su-ID"},{option:"Swahili (Kenya)",value:"sw-KE"},{option:"Swahili (Tanzania)",value:"sw-TZ"},{option:"Swedish (Sweden)",value:"sv-SE"},{option:"Tamil (India)",value:"ta-IN"},{option:"Tamil (Malaysia)",value:"ta-MY"},{option:"Tamil (Singapore)",value:"ta-SG"},{option:"Tamil (Sri Lanka)",value:"ta-LK"},{option:"Telugu (India)",value:"te-IN"},{option:"Thai (Thailand)",value:"th-TH"},{option:"Turkish (Turkey)",value:"tr-TR"},{option:"Ukrainian (Ukraine)",value:"uk-UA"},{option:"Urdu (India)",value:"ur-IN"},{option:"Urdu (Pakistan)",value:"ur-PK"},{option:"Uzbek (Uzbekistan)",value:"uz-UZ"},{option:"Vietnamese (Vietnam)",value:"vi-VN"},{option:"Zulu (South Africa)",value:"zu-ZA"}]}).factory("awsPollyVoice",function(){return[{value:"Zeina",option:"Zeina (Arabic, Female)"},{value:"Zhiyu",option:"Zhiyu (Chinese, Mandarin, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Nicole",option:"Nicole (English, Australian, Female)"},{value:"Olivia",option:"Olivia (English, Austrialian, Female)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Amy",option:"Amy (English, British, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Aditi",option:"Aditi (English, Indian, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Aria",option:"Aria (English, New Zealand, Female)"},{value:"Ayanda",option:"Ayanda (English, South African, Female)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Kevin",option:"Kevin (English, US, Male)"},{value:"Matthew",option:"Matthew (English, US, Male)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Léa",option:"Léa (French, Male)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Gabrielle",option:"Gabrielle (French, Canadian, Female)"},{value:"Vicki",option:"Vicki (German , Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Aditi",option:"Aditi (Hindi , Female)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Bianca",option:"Bianca (Italian, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Takumi",option:"Takumi (Japanese, Male)"},{value:"Seoyeon",option:"Seoyeon (Korean, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Camila",option:"Camila (Portuguese, Brazilian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Conchita",option:"Conchita (Spanish, European, Female)"},{value:"Lucia",option:"Lucia (Spanish, European, Female)"},{value:"Enrique",option:"Enrique (Spanish, European, Male)"},{value:"Mia",option:"Mia (Spanish, Mexican, Female)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Lupe",option:"Lupe (Spanish, US, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Gwyneth",option:"Gwyneth (Welsh , Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]}).factory("awsLexRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"}]}).factory("dialogFlowLanguage",function(){return[{value:"da",option:"Danish"},{value:"en",option:"English"},{value:"de",option:"German"},{value:"it",option:"Italian"},{value:"es",option:"Spanish"},{value:"fr",option:"French"},{value:"id",option:"Indonesian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean (South Korea)"},{value:"nl",option:"Dutch"},{value:"no",option:"Norwegian"},{value:"pt",option:"Portuguese (European)"},{value:"pt-br",option:"Portuguese (Nrazilian)"},{value:"ru",option:"Russian"},{value:"sv",option:"Swedish"},{value:"th",option:"Thai"},{value:"uk",option:"Ukrainian"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-HK",option:"Chinese (Hong Kong)"},{value:"zh-TW",option:"Chinese (Traditional)"}]}).factory("dialogFlowV2Language",function(){return[{value:"zh-HK",option:"Chinese (Cantonese)"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (Great Britain)"},{value:"en-IN",option:"English (India)"},{value:"en-US",option:"English (US)"},{value:"fr",option:"French"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"France (France)"},{value:"de",option:"German"},{value:"hi",option:"Hindi"},{value:"id",option:"Indonesian"},{value:"it",option:"Italian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean"},{value:"no",option:"Norwegian"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ru",option:"Russian"},{value:"es",option:"Spanish"},{value:"es-419",option:"Spanish (Latin America)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"sw",option:"Swedish"},{value:"th",option:"Thai"},{value:"tr",option:"Turkish"},{value:"uk",option:"Ukrainian"}]})}(),function(){"use strict";function e(n,e,t,a){var i=this;i.project={preproduction:t},i.closeDialog=function(e){e?(a(i.project.preproduction),n.hide(i.project.preproduction)):n.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(n,t){var a=this;function i(e){e?(t(e),n.hide(e)):n.hide()}a.errors=[],a.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:5242880,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[];_.includes(["xml"],e.getExtension())||a.errors.push({message:"The extension "+e.getExtension()+" is not supported!"});5242880<e.size&&a.errors.push({message:"The file is too big. The max allowed size is 5MB"});if(!a.errors.length){var n=new FileReader;n.onload=function(e){i(e.target.result)},n.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(n,t,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){n.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){t.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),n.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.projects=t,s.id="",s.newWindow=!0,s.closeDialog=function(e){s.errors=[],e?(n.hide(),s.newWindow?a.open("/callysquare/projects/"+s.id,"_blank"):i.go("app.callysquare.projects.edit",{id:s.id})):n.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){n.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){t.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),n.hide(e),r.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):o.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S,T){var I=this;I.currentUser=T.getCurrentUser(),I.project=n||{},I.userProfileSection=S&&1==S.count?S.rows[0]:null,I.crudPermissions=T.parseCrudPermissions(I.userProfileSection?I.userProfileSection.crudPermissions:null),I.onInit=function(){new EditorUi(I,new Editor,document.getElementById("geEditor")).openString(I.project.preproduction,I.project.name,I.project)},I.saveOrPublishProject=function(e,n){var t={preproduction:e};n&&(t.production=e);r.squareProject.update({id:I.project.id},t).$promise.then(function(e){o.success({title:"Project "+(n?"published":"saved")+"!",msg:I.project.name?I.project.name+" has been "+(n?"published":"saved")+"!":""}),I.project.preproduction=e.preproduction}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.openDialog=function(e,n){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{users:l.rows||[],trunks:d.rows||[],queues:c.rows||[],sounds:m.rows||[],variables:u.rows||[],databases:p.rows||[],contexts:g.rows||[],projects:v.rows||[],intervals:h.rows||[],mailAccounts:f.rows||[],smsAccounts:E.rows||[],pauses:y.rows||[],templates:b.rows||[],lists:A.rows||[],cell:e,saveCallback:n,crudPermissions:I.crudPermissions}})},I.newProject=function(e){a.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:e,projects:v.rows,openFromEditor:!0,license:null,setting:null,crudPermissions:I.crudPermissions}})},I.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{projects:v.rows||[]}})},I.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{project:I.project,currentXML:e}}).then(function(e){e&&v.rows.push(e)})},I.newVariable=function(n){return i(function(a,n){return r.userProfileSection.get({userProfileId:I.currentUser.userProfileId,sectionId:1012}).$promise.then(function(e){var n=e.rows?e.rows[0]:null,t=T.parseCrudPermissions(n?n.crudPermissions:null);a(t)}).catch(function(e){n(e)})}).then(function(e){e.canEdit?a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{variable:n,variables:u.rows,license:null,setting:null,crudPermissions:e}}):o.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE")})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:NEW_VARIABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:I.project}}).then(function(e){e&&_.merge(I.project,e)})},I.editXML=function(e,n){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:n}}).then(function(e){e&&(I.project.preproduction=e)})},I.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(I.project.preproduction=e)})},I.gotoProjects=function(){e.go("app.callysquare.projects",{},{reload:"app.callysquare.projects"})}}e.$inject=["$state","$document","$mdDialog","$q","$translate","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","userProfileSection","Auth"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.projects=a||{count:0,rows:[]},p.userProfile=i,p.userProfileSection=s&&1==s.count?s.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.listOrder="",p.listOrderAsc=null,p.selectedProjects=[],p.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},p.editstate=function(e,n){t.go("app.callysquare.projects.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.deleteconfirm=function(e,n){var t=l.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");l.show(t).then(function(){f(e)},function(){console.log("CANCEL")})},p.success=h,p.getProjects=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=o.squareProject.get(p.query,h).$promise:(p.query.id=p.userProfile.id,p.query.section="SquareProjects",p.promise=o.userProfile.getResources(p.query,h).$promise)},p.createOrEditProject=function(e,n){l.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(d.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:p.projects.rows,openFromEditor:null,setting:null,crudPermissions:p.crudPermissions}})},p.deleteProject=f,p.exportSelectedProjects=function(){var e=angular.copy(p.selectedProjects);return p.selectedProjects=[],e},p.deleteSelectedProjects=function(e){var n=l.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+p.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");l.show(n).then(function(){p.selectedProjects.forEach(function(e){f(e)}),p.selectedProjects=[]})},p.deselectProjects=function(){p.selectedProjects=[]},p.selectAllProjects=function(){p.selectedProjects=p.projects.rows};var g=!0,v=1;function h(e){p.projects=e||{count:0,rows:[]}}function f(e){o.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(p.projects.rows,{id:e.id}),p.projects.count-=1,p.projects.rows.length||p.getProjects(),m.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){g?c(function(){g=!1}):(n||(v=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=v),p.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","userProfile","userProfileSection","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_SQUARERECORDING",g.squareRecording=angular.copy(l),g.squareRecordings=r,g.newSquareRecording=!1,g.squareRecording||(g.squareRecording={},g.title="CALLYSQUARE.NEW_SQUARERECORDING",g.newSquareRecording=!0),g.addNewSquareRecording=function(){g.errors=[],d.squareRecording.save(g.squareRecording).$promise.then(function(e){g.squareRecordings.unshift(e.toJSON()),o.success({title:"SquareRecording properly created",msg:g.squareRecording.name?g.squareRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSquareRecording=function(){g.errors=[],d.squareRecording.update({id:g.squareRecording.id},g.squareRecording).$promise.then(function(e){var n=_.find(g.squareRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SquareRecording properly saved!",msg:g.squareRecording.name?g.squareRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSquareRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.squareRecording.delete({id:g.squareRecording.id}).$promise.then(function(){_.remove(g.squareRecordings,{id:g.squareRecording.id}),o.success({title:"SquareRecording properly deleted!",msg:(g.squareRecording.name||"squareRecording")+" has been deleted!"}),v(g.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","squareRecordings","squareRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.squareRecordings=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="squareRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedSquareRecordings=[],f.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio,savePath,format",sort:"-createdAt",limit:10,page:1},f.downloadfile2=function(s,e){return m.squareRecording.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+s.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("squareRecording")+"?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSquareRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.squareRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SquareRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSquareRecording=function(e,n){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:n,squareRecordings:f.squareRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSquareRecording=y,f.exportSelectedSquareRecordings=function(){var e=angular.copy(f.selectedSquareRecordings);return f.selectedSquareRecordings=[],e},f.deleteSelectedSquareRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+f.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSquareRecordings.forEach(function(e){y(e)}),f.selectedSquareRecordings=[]})},f.deselectSquareRecordings=function(){f.selectedSquareRecordings=[]},f.selectAllSquareRecordings=function(){f.selectedSquareRecordings=f.squareRecordings.rows};var b=!0,A=1;function E(e){f.squareRecordings=e||{count:0,rows:[]}}function y(e){m.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.squareRecordings.rows,{id:e.id}),f.squareRecordings.count-=1,f.squareRecordings.rows.length||f.getSquareRecordings(),p.success({title:_.startCase("SquareRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","squareRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatQueues",f.listOrder="",f.listOrderAsc=null,f.selectedChatQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:f.chatQueues?f.chatQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatQueue")+"?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.chat.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.chat.realtime.queues",{})}},f.success=E,f.getChatQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatQueue=function(e,n){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:n,chatQueues:f.chatQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteChatQueue=y,f.exportSelectedChatQueues=function(){var e=angular.copy(f.selectedChatQueues);return f.selectedChatQueues=[],e},f.deleteSelectedChatQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+f.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatQueues.forEach(function(e){y(e)}),f.selectedChatQueues=[]})},f.deselectChatQueues=function(){f.selectedChatQueues=[]},f.selectAllChatQueues=function(){f.selectedChatQueues=f.chatQueues.rows};var b=!0,A=1;function E(e){f.chatQueues=e||{count:0,rows:[]}}function y(e){m.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.chatQueues.rows,{id:e.id}),f.chatQueues.count-=1,f.chatQueues.rows.length||f.getChatQueues(),p.success({title:_.startCase("ChatQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="CHAT.EDIT_CHATQUEUE",r.chatQueue=angular.copy(n),r.chatQueues=e,r.newChatQueue=!1,r.chatQueue||(r.chatQueue={strategy:"beepall",timeout:10},r.title="CHAT.NEW_CHATQUEUE",r.newChatQueue=!0),r.addNewChatQueue=function(){r.errors=[],i.chatQueue.save(r.chatQueue).$promise.then(function(e){r.chatQueues.unshift(e.toJSON()),a.success({title:"ChatQueue properly created",msg:r.chatQueue.name?r.chatQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveChatQueue=function(){r.errors=[],i.chatQueue.update({id:r.chatQueue.id},r.chatQueue).$promise.then(function(e){var n=_.find(r.chatQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"ChatQueue properly saved!",msg:r.chatQueue.name?r.chatQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteChatQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.chatQueue.delete({id:r.chatQueue.id}).$promise.then(function(){_.remove(r.chatQueues,{id:r.chatQueue.id}),a.success({title:"ChatQueue properly deleted!",msg:(r.chatQueue.name||"chatQueue")+" has been deleted!"}),l(r.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","chatQueues","chatQueue","api","Auth","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getAgents({id:c.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addAgents({id:c.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatQueue.getTeams({id:l.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.chatQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("CHAT.ALL_TEAMS"),labelSelected:t.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.removeTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatQueue.addTeams({id:l.chatQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.chatQueue=c||e.params.chatQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatQueues=function(){e.go("app.chat.chatQueues",{},{reload:"app.chat.chatQueues"})},u.saveChatQueue=function(){r.chatQueue.update({id:u.chatQueue.id},u.chatQueue).$promise.then(function(){l.success({title:"ChatQueue updated!",msg:u.chatQueue.name?u.chatQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatQueue","userProfileSection"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chatWebsites=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chatWebsites",f.listOrder="",f.listOrderAsc=null,f.selectedChatWebsites=[],f.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,textButtonColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,labelText,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,feedbackTitle,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableSendButton,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,MailAccountId,openNewInteraction,forwardOfflineAddress,subjectOffline,IntervalId,timezone,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout,vidaooEscalation,vidaooApiKey,vidaooTopic,vidaooNote,vidaooMetadata",sort:"-updatedAt",limit:10,page:1},f.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayalignment=_.keyBy([{option:"bottom_right",value:"'bottom_right'"},{option:"right",value:"'right'"},{option:"left",value:"'left'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymessagesAlignment=_.keyBy([{option:"alternate",value:"'alternate'"},{option:"centered",value:"'centered'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},f.offlinemessagesgoto=function(e,n){t.go("app.chat.chatWebsites.edit",{id:e.id,tab:11})},f.agentadddialog=function(e,n){i.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:f.chatWebsites?f.chatWebsites.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chatWebsite")+"?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChatWebsites=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.chatWebsite.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChatWebsites",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditChatWebsite=function(e,n){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:n,chatWebsites:f.chatWebsites.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteChatWebsite=y,f.exportSelectedChatWebsites=function(){var e=angular.copy(f.selectedChatWebsites);return f.selectedChatWebsites=[],e},f.deleteSelectedChatWebsites=function(e){var n=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+f.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChatWebsites.forEach(function(e){y(e)}),f.selectedChatWebsites=[]})},f.deselectChatWebsites=function(){f.selectedChatWebsites=[]},f.selectAllChatWebsites=function(){f.selectedChatWebsites=f.chatWebsites.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.lists,{id:Number(f.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.lists,{id:Number(f.chatWebsite.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.chatWebsite&&(t=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.chatWebsite&&(a=_.find(f.interval,{id:Number(f.chatWebsite.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.chatWebsites=e||{count:0,rows:[]}}function y(e){m.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(f.chatWebsites.rows,{id:e.id}),f.chatWebsites.count-=1,f.chatWebsites.rows.length||f.getChatWebsites(),p.success({title:_.startCase("ChatWebsite")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatWebsites","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATWEBSITE",g.chatWebsite=angular.copy(l),g.chatWebsites=r,g.newChatWebsite=!1,g.chatWebsite||(g.chatWebsite={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),header_shape:"rounded",alignment:"bottom_right",verticalAlignment:30,labelText:"CHAT",messagesAlignment:"alternate",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300,vidaooTopic:"Generated by XCALLY Motion",vidaooNote:"Meeting generated for interaction #{{interaction.id}} by {{agent.name}}"},g.title="CHAT.NEW_CHATWEBSITE",g.newChatWebsite=!0),n.params.id&&(g.chatWebsite.ChatWebsiteId=n.params.id),g.addNewChatWebsite=function(){g.errors=[],d.chatWebsite.save(g.chatWebsite).$promise.then(function(e){g.chatWebsites.unshift(e.toJSON()),o.success({title:"ChatWebsite properly created",msg:g.chatWebsite.name?g.chatWebsite.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatWebsite=function(){g.errors=[],d.chatWebsite.update({id:g.chatWebsite.id},g.chatWebsite).$promise.then(function(e){var n=_.find(g.chatWebsites,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatWebsite properly saved!",msg:g.chatWebsite.name?g.chatWebsite.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatWebsite=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatWebsite.delete({id:g.chatWebsite.id}).$promise.then(function(){_.remove(g.chatWebsites,{id:g.chatWebsite.id}),o.success({title:"ChatWebsite properly deleted!",msg:(g.chatWebsite.name||"chatWebsite")+" has been deleted!"}),v(g.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.lists,{id:Number(g.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.lists,{id:Number(g.chatWebsite.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.chatWebsite&&(t=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.chatWebsite&&(a=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatWebsites","chatWebsite","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:t,chatWebsite:r.chatWebsite,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[n]=e:r.chatWebsiteApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.chatWebsiteApps.rows.length;t++,0){var a=r.chatWebsiteApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(n,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:501}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"tvox",appType:"tvox",type:"tvox",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"serviceid",name:"serviceid",type:"text",param:0},{title:"channelid",name:"channelid",type:"text",param:1},{title:"tvoxurl",name:"tvoxurl",type:"text",param:2},{title:"tvoxloginurl",name:"tvoxloginurl",type:"text",param:3},{title:"tvoxsessionurl",name:"tvoxsessionurl",type:"text",param:4},{title:"tvoxusername",name:"tvoxusername",type:"text",param:5},{title:"tvoxpasswd",name:"tvoxpasswd",type:"password",param:6},{title:"motionurlonring",name:"motionurlonring",type:"text",param:7},{title:"motionurlonanswer",name:"motionurlonanswer",type:"text",param:8},{title:"motiontitle",name:"motiontitle",type:"text",param:9},{title:"motionurl",name:"motionurl",type:"text",param:10}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.chatWebsite=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=o.chatWebsite.getApplications(r.query,t).$promise},r.editChatWebsiteApp=n,r.editInterval=function(e,n){if(r.chatWebsiteApps.rows.length){var t=r.chatWebsiteApps.rows[n]?r.chatWebsiteApps.rows[n]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.chatWebsite.getAgents({id:c.chatWebsite.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserChatWebsite?"penalty "+e.UserChatWebsite.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.chatWebsite=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.removeAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.chatWebsite.addAgents({id:c.chatWebsite.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","chatWebsite","chatWebsites","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatWebsiteagentaddController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("chat")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:501}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptagDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tvox=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tvox.appdata)switch(l.tvox.appType?l.tvox.appType.toLowerCase():l.tvox.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tvox.appdata.split(",");l.tvox.key=d[0],l.tvox.language=d[1],l.tvox.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tvox.appdata.split(",");l.tvox.projectId=d[0],l.tvox.clientEmail=d[1],l.tvox.privateKey=d[2],l.tvox.language=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tvox.appdata.split(",");l.tvox.accesskeyid=d[0],l.tvox.secretaccesskey=d[1],l.tvox.lexregion=d[2],l.tvox.botname=d[3],l.tvox.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tvox.appdata.split(",");l.tvox.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tvox.text=d.slice(1,d.length).join(",");break;case"message":l.tvox.text=l.tvox.appdata;break;case"set":l.tvox.name=l.tvox.appdata.split("=")[0],l.tvox.value=l.tvox.appdata.split("=")[1];break;case"agi":l.tvox.project=l.tvox.appdata;break;default:var c=l.tvox.appdata.split(",");l.tvox.serviceid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.tvox.channelid=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.tvox.tvoxurl=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.tvox.tvoxloginurl=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.tvox.tvoxsessionurl=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.tvox.tvoxusername=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.tvox.tvoxpasswd=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.tvox.motionurlonring=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.tvox.motionurlonanswer=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.tvox.motiontitle=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10),l.tvox.motionurl=_.isEmpty(c[10])?c[10]:isNaN(c[10])?c[10]:parseInt(c[10],10)}function m(e){n.hide(e)}l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outbounddial"===l.tvox.appType.toLowerCase()&&(l.tvox.prefix=l.tvox.phone?l.tvox.phone.split("$")[0]:void 0,l.tvox.callerId=l.tvox.callerID?"CALLERID(all)="+l.tvox.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tvox.type&&"outbound"===l.tvox.type.toLowerCase()&&"outboundDial"===l.tvox.appType&&(l.tvox.phone=i.cutdigits?(l.tvox.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tvox.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tvox.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tvox.options+="U(xcally-mixmonitor-context)"):l.tvox.options=l.tvox.options.replace("U(xcally-mixmonitor-context)",""));if(l.tvox.appType&&"custom"===l.tvox.appType);else switch((l.tvox.app||l.tvox.appType).toLowerCase()){case"set":l.tvox.appdata=l.tvox.name+"="+l.tvox.value;break;case"custom":break;default:e[0]=l.tvox.serviceid,e[1]=l.tvox.channelid,e[2]=l.tvox.tvoxurl,e[3]=l.tvox.tvoxloginurl,e[4]=l.tvox.tvoxsessionurl,e[5]=l.tvox.tvoxusername,e[6]=l.tvox.tvoxpasswd,e[7]=l.tvox.motionurlonring,e[8]=l.tvox.motionurlonanswer,e[9]=l.tvox.motiontitle,e[10]=l.tvox.motionurl,l.tvox.appdata=e.join(",")}m(l.tvox)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptvoxDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteChatCannedAnswers.rows,{id:e.id}),m.chatWebsiteChatCannedAnswers.count-=1,m.chatWebsiteChatCannedAnswers.rows.length||p(),l.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteChatCannedAnswers={count:0,rows:[]},m.selectedChatWebsiteChatCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatCannedAnswer #")+e.id||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteChatCannedAnswers=p,m.createOrEditChatWebsiteChatCannedAnswer=function(e,n){o.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatCannedAnswer:n,chatCannedAnswers:m.chatWebsiteChatCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(m.selectedChatWebsiteChatCannedAnswers);return m.selectedChatWebsiteChatCannedAnswers=[],e},m.deleteChatWebsiteChatCannedAnswer=g,m.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+m.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),m.selectedChatWebsiteChatCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATCANNEDANSWER",g.chatCannedAnswer=angular.copy(l),g.chatCannedAnswers=r,g.newChatCannedAnswer=!1,g.chatCannedAnswer||(g.chatCannedAnswer={},g.title="CHAT.NEW_CHATCANNEDANSWER",g.newChatCannedAnswer=!0),n.params.id&&(g.chatCannedAnswer.ChatWebsiteId=n.params.id),g.addNewChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.chatCannedAnswer).$promise.then(function(e){g.chatCannedAnswers.unshift(e.toJSON()),o.success({title:"ChatCannedAnswer properly created",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.chatCannedAnswer.id},g.chatCannedAnswer).$promise.then(function(e){var n=_.find(g.chatCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatCannedAnswer properly saved!",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.chatCannedAnswer.id}).$promise.then(function(){_.remove(g.chatCannedAnswers,{id:g.chatCannedAnswer.id}),o.success({title:"ChatCannedAnswer properly deleted!",msg:(g.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),v(g.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.chatWebsite.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.chatWebsite=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.chatWebsite.id,field:"ChatWebsiteId",route:"chatWebsite"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteDispositionsController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"},{type:"upload",name:"Upload",icon:"icon-upload"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.offlineForm.items[n-1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===n-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.offlineForm.items.length-1){var t=i.chatWebsite.offlineForm.items[n+1];i.chatWebsite.offlineForm.items[n]=t,i.chatWebsite.offlineForm.items[n+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===n?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===n+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})},i.card_type="offline",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(t,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var n=0;n<e.rows.length;n++)i.customFields.push({key:"cf_"+e.rows[n].id,value:e.rows[n].alias});return a.cmContact.describe().$promise}).then(function(e){for(var n=_.keys(e),t=0;t<n.length;t++)_.includes(i.uselessFields,n[t])||_.startsWith(n[t],"cf_")||i.fields.unshift({key:n[t],value:n[t]});return a.variable.get().$promise}).then(function(e){return i.variables=e.rows,a.mailAccount.get({fields:"id,name",raw:!0}).$promise.then(function(e){i.email_accounts=e.rows})}).catch(function(e){console.error(e)})},i.up=function(e,n){if(0!==n){var t=i.chatWebsite.onlineForm.items[n-1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===n-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,n){if(n!==i.chatWebsite.onlineForm.items.length-1){var t=i.chatWebsite.onlineForm.items[n+1];i.chatWebsite.onlineForm.items[n]=t,i.chatWebsite.onlineForm.items[n+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===n?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===n+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var n=t.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");t.show(n).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})},i.card_type="online",i.email_accounts=[]}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/customer_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitecustomerAvatarController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:m.chatWebsite.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.chatWebsiteInteractions=e||{count:0,rows:[]};for(var n=0;n<m.chatWebsiteInteractions.rows.length;n+=1){var t=m.chatWebsiteInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatInteraction.get(m.query,p).$promise}function v(e){d.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteInteractions.rows,{id:e.id}),m.chatWebsiteInteractions.count-=1,m.chatWebsiteInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteInteractions={count:0,rows:[]},m.selectedChatWebsiteInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.chatInteractionDownload=function(s,e,n){return d.chatInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="chat-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getChatWebsiteInteractions=g,m.createOrEditChatWebsiteInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,interaction:n,interactions:m.chatWebsiteInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spychatInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"chat",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"chat.chatWebsites"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||ChatWebsiteId:=$eq["+m.chatWebsite.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(m.selectedChatWebsiteInteractions);return m.selectedChatWebsiteInteractions=[],e},m.deleteChatWebsiteInteraction=v,m.deleteSelectedChatWebsiteInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteInteractions.forEach(function(e){v(e)}),m.selectedChatWebsiteInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getOfflineMessages(m.query,u).$promise}function g(e){d.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteOfflineMessages.rows,{id:e.id}),m.chatWebsiteOfflineMessages.count-=1,m.chatWebsiteOfflineMessages.rows.length||p(),l.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteOfflineMessages={count:0,rows:[]},m.selectedChatWebsiteOfflineMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,attachments,Contact.firstName,ContactId,ChatWebsiteId",sort:"-createdAt",limit:10,page:1},m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("offlineMessage #")+e.id||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteOfflineMessages=p,m.createOrEditChatWebsiteOfflineMessage=function(e,n){o.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,offlineMessage:n,offlineMessages:m.chatWebsiteOfflineMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showOfflineMessageChatWebsiteOfflineMessage=function(e,t){o.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,n){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:t.id})}],attachments:["apiResolver","$stateParams",function(e,n){return e.resolve("attachment@get",{fields:"id,name",ChatOfflineMessageId:t.id})}]}})},m.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(m.selectedChatWebsiteOfflineMessages);return m.selectedChatWebsiteOfflineMessages=[],e},m.deleteChatWebsiteOfflineMessage=g,m.deleteSelectedChatWebsiteOfflineMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+m.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),m.selectedChatWebsiteOfflineMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(n,e,t,a,i){var s=this;s.title="CHAT.OFFLINE_MESSAGE",s.message=a,s.attachments=i.rows,s.closeDialog=function(e){n.hide(e)},s.download=function(i){return e.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.isHtml=_.isNil(s.message.body.match(/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i))}e.$inject=["$mdDialog","api","toasty","message","attachments"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.chatWebsite.getProactiveActions(m.query,u).$promise}function g(e){d.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(m.chatWebsiteProactiveActions.rows,{id:e.id}),m.chatWebsiteProactiveActions.count-=1,m.chatWebsiteProactiveActions.rows.length||p(),l.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.chatWebsite={},m.chatWebsiteProactiveActions={count:0,rows:[]},m.selectedChatWebsiteProactiveActions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout",limit:10,page:1},m.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n,t){m.chatWebsite=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.ChatWebsiteId=m.chatWebsite.id,m.query.id=m.chatWebsite.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("chatProactiveAction #")+e.id||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getChatWebsiteProactiveActions=p,m.createOrEditChatWebsiteChatProactiveAction=function(e,n){o.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:m.chatWebsite,chatProactiveAction:n,proactive:m.chatWebsiteProactiveActions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(m.selectedChatWebsiteProactiveActions);return m.selectedChatWebsiteProactiveActions=[],e},m.deleteChatWebsiteChatProactiveAction=g,m.deleteSelectedChatWebsiteProactiveActions=function(e){var n=o.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+m.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),m.selectedChatWebsiteProactiveActions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATPROACTIVEACTION",g.chatProactiveAction=angular.copy(l),g.proactive=r,g.newChatProactiveAction=!1,g.chatProactiveAction||(g.chatProactiveAction={type:"mouseOver"},g.title="CHAT.NEW_CHATPROACTIVEACTION",g.newChatProactiveAction=!0),n.params.id&&(g.chatProactiveAction.ChatWebsiteId=n.params.id),g.addNewChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.save(g.chatProactiveAction).$promise.then(function(e){g.proactive.unshift(e.toJSON()),o.success({title:"ChatProactiveAction properly created",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.update({id:g.chatProactiveAction.id},g.chatProactiveAction).$promise.then(function(e){var n=_.find(g.proactive,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ChatProactiveAction properly saved!",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatProactiveAction=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.chatProactiveAction.delete({id:g.chatProactiveAction.id}).$promise.then(function(){_.remove(g.proactive,{id:g.chatProactiveAction.id}),o.success({title:"ChatProactiveAction properly deleted!",msg:(g.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),v(g.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","proactive","chatProactiveAction","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var n=this;n.chatWebsite={},n.init=function(e){n.chatWebsite=e,n.start="\n\x3c!-- START Motion Chat Script --\x3e",n.script='\n <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>',n.end="\n\x3c!-- START Motion Chat Script --\x3e"},n.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){n.script='\n <script src="'+n.chatWebsite.remote+"/api/chat/websites/"+n.chatWebsite.id+"/snippet?token="+n.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/system_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitesystemAvatarController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.chatWebsite=c||e.params.chatWebsite||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:p.chatWebsites?p.chatWebsites.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoChatWebsites=function(){e.go("app.chat.chatWebsites",{},{reload:"app.chat.chatWebsites"})},p.saveChatWebsite=function(){r.chatWebsite.update({id:p.chatWebsite.id},p.chatWebsite).$promise.then(function(){l.success({title:"ChatWebsite updated!",msg:p.chatWebsite.name?p.chatWebsite.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.lists,{id:Number(p.chatWebsite.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.lists,{id:Number(p.chatWebsite.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){p.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.interval,{id:e.resourceId})}),t=null;if(p.chatWebsite&&(t=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.interval,{id:t.id});a.canSelect=!1,n.push(a)}p.interval=n})}else{var t=[],a=null;p.chatWebsite&&(a=_.find(p.interval,{id:Number(p.chatWebsite.IntervalId)}));for(var i=0;i<p.interval.length;i++)a&&p.interval[i].id===a.id&&(p.interval[i].canSelect=!1,t.push(p.interval[i]));p.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatWebsite","userProfile","userProfileSection"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.chat.realtime.agents");break;case 1:t.go("app.chat.realtime.queues");break;default:t.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.companies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="companies",f.listOrder="",f.listOrderAsc=null,f.selectedCompanies=[],f.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.companies.edit",{id:e.id,company:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("company")+"?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCompanies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCompany.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Companies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCompany=function(e,n){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:n,companies:f.companies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCompany=y,f.exportSelectedCompanies=function(){var e=angular.copy(f.selectedCompanies);return f.selectedCompanies=[],e},f.deleteSelectedCompanies=function(e){var n=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+f.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCompanies.forEach(function(e){y(e)}),f.selectedCompanies=[]})},f.deselectCompanies=function(){f.selectedCompanies=[]},f.selectAllCompanies=function(){f.selectedCompanies=f.companies.rows};var b=!0,A=1;function E(e){f.companies=e||{count:0,rows:[]}}function y(e){m.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(f.companies.rows,{id:e.id}),f.companies.count-=1,f.companies.rows.length||f.getCompanies(),p.success({title:_.startCase("Company")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","companies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_COMPANY",g.company=angular.copy(l),g.companies=r,g.newCompany=!1,g.company||(g.company={},g.title="CONTACTMANAGER.NEW_COMPANY",g.newCompany=!0),g.addNewCompany=function(){g.errors=[],d.cmCompany.save(g.company).$promise.then(function(e){g.companies.unshift(e.toJSON()),o.success({title:"Company properly created",msg:g.company.name?g.company.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCompany=function(){g.errors=[],d.cmCompany.update({id:g.company.id},g.company).$promise.then(function(e){var n=_.find(g.companies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Company properly saved!",msg:g.company.name?g.company.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCompany=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmCompany.delete({id:g.company.id}).$promise.then(function(){_.remove(g.companies,{id:g.company.id}),o.success({title:"Company properly deleted!",msg:(g.company.name||"company")+" has been deleted!"}),v(g.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","companies","company","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.company=c||a.params.company||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{CompanyId:t.id}):l.info({title:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:t.id})}},u.alert=l.info,u.gotoCompanies=function(){a.go("app.contactmanager.companies",{},{reload:"app.contactmanager.companies"})},u.saveCompany=function(){r.cmCompany.update({id:u.company.id},u.company).$promise.then(function(){l.success({title:"Company updated!",msg:u.company.name?u.company.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","company","userProfileSection"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(n,i,t,a,e,s,o,r,l,d,c,m,u,p,g,v,h,f,b){var A=this;A.currentUser=f.getCurrentUser(),A.license=b,A.userProfile=r,A.userProfileSection=l&&1==l.count?l.rows[0]:null,A.crudPermissions=f.parseCrudPermissions(A.userProfileSection?A.userProfileSection.crudPermissions:null);var E=60,y=1024*E*1024;A.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:y,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},A.contacts=c||{count:0,rows:[]},A.options={hidden:!1,hover:!1,isOpen:!1},A.table="cm_contacts",A.selectedContacts=[],A.lists=m||{rows:[],count:0},A.companies=p||{rows:[],count:0},A.tags=v||{rows:[],count:0},A.listsMap=u,A.companiesMap=g,A.selectedTags=[],A.selectedList=null,A.selectedCompany=null,A.query=_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0,page:1},e),A.editdialog=function(e,n){a.go("app.contactmanager.contacts.edit",{id:e.id,crudPermissions:A.crudPermissions})},A.deleteconfirm=function(e,n){var t=s.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){O(e)})},A.success=I,A.getContacts=function(){A.query.offset=(A.query.page-1)*A.query.limit,f.hasRole("admin")?A.promise=d.cmContact.get(A.query,I).$promise:(A.query.id=A.userProfile.id,A.query.ListId=A.query.ListId?A.query.ListId:_.map(A.lists.rows,"id"),A.query.CompanyId=A.query.CompanyId?A.query.CompanyId:_(A.companies.rows).filter({canSelect:void 0}).map("id").value(),A.query.section="Contacts",A.promise=d.userProfile.getResources(A.query,I).$promise)},A.getAssignedCompanies=function(){if(!f.hasRole("admin")){var e=_(A.contacts.rows).map(function(e){return{id:e.CompanyId}}).uniqBy("id").filter(function(e){return e.id&&0<e.id}).pullAllBy(A.companies.rows,"id").value();if(!_.isEmpty(e)){var n=[];e.forEach(function(e){n.push(d.cmCompany.get({id:e.id,fields:"id,name"}).$promise)}),o.all(n).then(function(e){e.forEach(function(e){var n=e.toJSON();n.canSelect=!1,A.companies.rows.push(n);var t={};t[n.id]=n.name,A.companiesMap=_.assignIn(A.companiesMap,t)})}).catch(function(e){h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}},A.mergeContact=function(e,n){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.duplicateContact=function(e,n){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:n.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:A.contacts.rows}})},A.createOrEditContact=function(e,n){n&&n.dateOfBirth&&(n.dateOfBirth=new Date(n.dateOfBirth));s.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:A.query.ListId||a.params.ListId,CompanyId:A.query.CompanyId||a.params.CompanyId,contact:n,contacts:A.contacts.rows,companies:A.companies,lists:A.lists,setting:null,crudPermissions:A.crudPermissions}})},A.deleteContact=O,A.exportSelectedContacts=function(){var e=angular.copy(A.selectedContacts);return A.selectedContacts=[],e},A.deleteSelectedContacts=function(e){var n=s.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+A.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(n).then(function(){A.selectedContacts.forEach(function(e){O(e)}),A.selectedContacts=[]})},A.deselectContacts=function(){A.selectedContacts=[]},A.selectAllContacts=function(){A.selectedContacts=A.contacts.rows},A.createTag=function(e){var n=s.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.tag.save({name:e});h.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(A.tags.rows.push(e),h.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},A.createList=function(e){var n=s.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmList.save({name:e});h.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(A.lists.rows.push(e),h.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},A.createCompany=function(e){var n=s.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(function(e){if(e)return d.cmCompany.save({name:e});h.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(A.companies.rows.push(e),h.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},A.importContacts=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:A.license}}).then(function(){A.getContacts()}).catch(function(e){console.error()})},A.importContactsUpdates=function(e,n,t){var a=JSON.parse(n);s.show({controller:"ImportContactsUpdatesDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/importUpdates.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:A.license}}).then(function(){A.getContacts()}).catch(function(e){console.error()})},A.hasPermission=function(){return f.hasPermission(303)||f.hasRole("admin")},A.fileAdded=function(e){var n=["csv"];if(!_.includes(n,e.getExtension()))return h.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>y)return h.error({title:"File too big",msg:"The max allowed size is "+E+"MB"}),!1;return!0},a.params.ListId&&(A.selectedList=a.params.ListId),a.params.CompanyId&&(A.selectedCompany=a.params.CompanyId),n.$watch("vm.options.isOpen",function(e){e?t(function(){n.tooltipVisible=A.options.isOpen},600):n.tooltipVisible=A.options.isOpen});var S=!0,T=1;function I(e){A.contacts=e||{count:0,rows:[]}}function O(e){d.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(A.contacts.rows,{id:e.id}),A.contacts.count-=1,A.contacts.rows.length||A.getContacts(),h.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){A.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var n=0;n<e.data.errors.length;n++)h.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}n.$watch("vm.query.filter",function(e,n){S?t(function(){S=!1}):(n||(T=A.query.page),e!==n&&(A.query.page=1),e||(A.query.page=T),A.getContacts())},!0),n.$watch("vm.selectedList",function(e,n){e!==n&&(A.query.ListId=A.selectedList||void 0,A.getContacts())}),n.$watch("vm.selectedCompany",function(e,n){e!==n&&(A.query.CompanyId=A.selectedCompany||void 0,A.getContacts())}),n.$watch("vm.selectedTags",function(e,n){(e.length||n.length)&&A.getContacts()})}e.$inject=["$scope","$document","$timeout","$state","$stateParams","$mdDialog","$q","userProfile","userProfileSection","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(t,e,a,n,i,s,o,r,l,d,c){var m=this;if(m.errors=[],m.title="CONTACTMANAGER.EDIT_CONTACT",m.crudPermissions=c,m.contact=angular.copy(o),m.additionalItemTypes=[],m.additionalItems=[],m.contacts=n||{rows:[],count:0},m.lists=i||{rows:[],count:0},m.companies=s||{rows:[],count:0},m.customFields={rows:[],count:0},m.newContact=!1,m.newPhone=function(e){return{phone:e,color:"gray"}},m.contactItemTypes=[],m.contact)delete m.contact.List,f(m.contact.ListId),d.cmContact.getAdditionalPhones({id:o.id}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");m.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");m.additionalItems=[];for(var s=0;s<n.length;s++)m.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})}).catch(function(e){console.log(e)});else{m.contact={ListId:r?parseInt(r,10):void 0,CompanyId:l?parseInt(l,10):void 0};var u=_.map(m.contact.Phones,"item"),p=_.map(m.contact.Phones,"description");m.additionalItemTypes=_.map(m.contact.Phones,"ItemTypeId");var g=_.map(m.contact.Phones,"ItemType.rgbBackgroundColor"),v=_.map(m.contact.Phones,"ItemType.name");m.additionalItems=[];for(var h=0;h<u.length;h++)m.additionalItems.push({phone:u[h],type:v[h],color:g[h],description:p[h]});m.title="CONTACTMANAGER.NEW_CONTACT",m.newContact=!0,b()}function f(e){if(e)return d.cmList.getCustomFields({id:e}).$promise.then(function(e){if(e){m.customFields=e;var n=_.map(m.customFields.rows,function(e){return"cf_"+e.id});return d.cmContact.get({id:m.contact.id,attributes:n,raw:!0}).$promise.then(function(e){m.contact=_.merge(m.contact,e)})}}).then(function(){m.customFields.rows.forEach(function(e){"datetime"===e.type&&m.contact["cf_"+e.id]&&(m.contact["cf_"+e.id]=A(m.contact["cf_"+e.id]))}),Object.keys(m.contact).forEach(function(e){if(_.startsWith(e,"cf_")){var n=e.split("_")[1];_.some(m.customFields.rows,["id",Number(n)])||delete m.contact["cf_"+n]}})}).catch(function(e){console.error(e)});m.customFields={rows:[],count:0}}function b(){return d.cmList.getGlobalCustomFields().$promise.then(function(e){if(e){m.customFields=e;_.map(m.customFields.rows,function(e){return"cf_"+e.id})}else;}).catch(function(e){console.error(e)})}function A(e){return null===e?void 0:new Date(e)}function E(){t.hide()}d.contactItemType.get({fields:"id,name,rgbBackgroundColor"}).$promise.then(function(e){m.contactItemTypes=e.rows}),m.addNewContact=function(){m.errors=[],d.cmContact.save(m.contact).$promise.then(function(e){m.contacts.unshift(e),d.cmContact.setAdditionalPhones({id:e.id,items:m.additionalItems,item_types:m.additionalItemTypes}).$promise.then(function(){a.success({title:"Contact properly created",msg:m.contact.name?m.contact.name+" has been created!":""}),E()})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContact=function(){m.errors=[],d.cmContact.update({id:m.contact.id},m.contact).$promise.then(function(e){var n=_.find(m.contacts,{id:e.id});n&&_.merge(n,e)}).then(function(){return d.cmContact.setAdditionalPhones({id:o.id,items:m.additionalItems,item_types:m.additionalItemTypes}).$promise.then(function(){a.success({title:"Contact properly saved!",msg:m.contact.name?m.contact.name+" has been saved!":""}),E()})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteContact=function(e){m.errors=[];var n=t.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmContact.delete({id:m.contact.id}).$promise.then(function(){_.remove(m.contacts,{id:m.contact.id}),a.success({title:"Contact properly deleted!",msg:m.contact.name?m.contact.name+" has been deleted!":""}),E()}).catch(function(e){console.error(e),m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},m.closeDialog=E,m.getCustomFields=f,m.getDateFromString=A,e.$watch("vm.contact.ListId",function(e,n){_.isNil(e)&&b()})}e.$inject=["$mdDialog","$scope","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(n),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[];var n=o.contact.id;delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){return a.unshift(e),s.cmContact.duplicateAdditionalPhones({id:n,fromContactId:n,toContactId:e.id}).$promise.then(function(){t.success({title:"Contact properly created",msg:o.contact.name?o.contact.name+" has been created!":""}),r()})}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="CONTACTMANAGER.EDIT_HOPPER",d.hopper=angular.copy(o),d.hoppers=s,d.newHopper=!1,d.crudPermissions=l,d.hopper||(d.hopper={},d.title="CONTACTMANAGER.NEW_HOPPER",d.newHopper=!0),d.saveHopper=function(){d.errors=[],r.cmHopper.update({id:d.hopper.id},d.hopper).$promise.then(function(e){var n=_.find(d.hoppers,{id:e.id});n&&_.merge(n,e),i.success({title:"Hopper properly saved!",msg:d.hopper.name?d.hopper.name+" has been saved!":""}),c(e)}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},d.getDateFromString=function(e){return null===e?void 0:new Date(e)},d.closeDialog=c}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","crudPermissions"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(a,t,e,i,s,n,o,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y){var S=this;function T(n){return function(e){S[n]=e||{count:0,rows:[]}}}function I(){S.queryHopper.offset=(S.queryHopper.page-1)*S.queryHopper.limit,S.queryHopper.id=S.contact.id,S.promise=r.cmContact.getHoppers(S.queryHopper,T("hoppers")).$promise}function O(){S.queryFinal.offset=(S.queryFinal.page-1)*S.queryFinal.limit,S.queryFinal.id=S.contact.id,S.promise=r.cmContact.getHopperFinals(S.queryFinal,T("finals")).$promise}function C(){S.queryHistory.offset=(S.queryHistory.page-1)*S.queryHistory.limit,S.queryHistory.id=S.contact.id,S.promise=r.cmContact.getHopperHistories(S.queryHistory,T("histories")).$promise}function w(e){S.journeyIsLoading=!0;var n=_.merge(S.journeyOptions,{id:S.contact.id,offset:e||0});return y.get(S.journey,n).then(function(e){S.journey=e.journey,S.canLoadMoreJourney=e.loadMore}).finally(function(){S.journeyIsLoading=!1})}S.currentUser=A.getCurrentUser(),S.license=b,S.journey=[],S.contact=l||{},S.hoppers=d||{rows:[],count:0},S.finals=c||{rows:[],count:0},S.histories=m||{rows:[],count:0},S.companies=p||{rows:[],count:0},S.lists=g||{rows:[],count:0},S.customFields=v||{rows:[],count:0},S.tags=h||{rows:[],count:0},S.jscriptySessions=f||{rows:[],count:0},S.journeyOptions=y.getQuery(),S.quickFilters=y.getQuickFilters(),S.journeyTimelineOptions={scrollEl:"#journey-content"},S.additionalItems=[],S.additionalItemTypes=[],S.contactItemTypes=[],S.firstDayMonth=new Date(moment().startOf("month").subtract(1,"seconds").utcOffset(0,!0).format()),S.lastDayMonth=new Date(moment().endOf("month").subtract(1,"day").utcOffset(0,!0).format()),S.userProfileSection=E&&1==E.count?E.rows[0]:null,S.crudPermissions=A.parseCrudPermissions(S.userProfileSection?S.userProfileSection.crudPermissions:null),S.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),S.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},S.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},S.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},S.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},S.selectedTab=e.params.tab||0,S.onInit=function(){A.hasRole("admin")||(function(){if(!_.some(S.companies.rows,{id:S.contact.CompanyId}))r.cmCompany.get({id:S.contact.CompanyId,fields:"id,name"}).$promise.then(function(e){var n=e.toJSON();n.canSelect=!1,S.companies.rows.push(n)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}(),function(){var e=_.map(S.contact.Tags,function(e){return{id:e.id,name:e.name}});if(!_.isEmpty(e))for(var n=0;n<e.length;n++)_.some(S.tags.rows,{id:e.id})||(e[n].canSelect=!1,S.tags.rows.push(e[n]))}());return r.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){S.users=e||{count:0,rows:[]},S.usersMap=_.mapValues(_.keyBy(S.users.rows,"id"),"fullname"),S.Tags=_.map(S.contact.Tags,"id");var n=_.map(S.contact.Phones,"item"),t=_.map(S.contact.Phones,"description");S.additionalItemTypes=_.map(S.contact.Phones,"ItemTypeId");var a=_.map(S.contact.Phones,"ItemType.rgbBackgroundColor"),i=_.map(S.contact.Phones,"ItemType.name"),s=_.map(S.contact.Phones,"ItemType.id");S.additionalItems=[];for(var o=0;o<n.length;o++)S.additionalItems.push({phone:n[o],type:i[o],ItemTypeId:s[o],color:a[o],description:t[o]})}).then(function(e){r.contactItemType.get({fields:"id,name,rgbBackgroundColor"}).$promise.then(function(e){S.contactItemTypes=e.rows})}).finally(function(){S.contact&&w()})},S.gotoContacts=function(){e.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},S.duplicateContact=function(e){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver","Auth",function(e,n){return n.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:S.currentUser.userProfileId,section:"Lists",fields:"id,name"})}]},locals:{contacts:u.rows,contact:l}})},S.saveContact=function(){r.cmContact.update({id:S.contact.id},S.contact).$promise.then(function(){o.success({title:"Contact updated!",msg:S.contact.name?S.contact.name+" has been updated!":""})}).then(function(){return r.cmContact.setTags({id:S.contact.id,ids:S.Tags}).$promise}).then(function(){return r.cmContact.setAdditionalPhones({id:S.contact.id,items:S.additionalItems}).$promise}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},S.editCompany=function(e,n){var t=_.find(S.companies.rows,{id:n});s.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null,crudPermissions:!1===t.canSelect?{readOnly:!0,canEdit:!1,canDelete:!1}:r.userProfileSection.get({userProfileId:S.currentUser.userProfileId,sectionId:302}).$promise.then(function(e){var n=e.rows?e.rows[0]:null;return A.parseCrudPermissions(n?n.crudPermissions:null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:GET_COMPANY_SECTION",msg:e.data?JSON.stringify(e.data):e.toString()})})},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:n})}]}})},S.onSelectList=function(e){if(S.contact.ListId){var n=s.confirm().title("You are selecting the list number: "+S.contact.ListId).textContent("Warning! You won't select a different list for the contact "+S.contact.firstName||S.contact.lastName||S.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return s.show(n).then(S.onSelectListSuccess).catch(function(){S.contact.ListId=null})}},S.onSelectListSuccess=function(){return r.cmList.getCustomFields({id:S.contact.ListId}).$promise.then(function(e){S.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},S.getDateFromString=function(e){return null===e?void 0:new Date(e)},S.getHoppers=I,S.getFinals=O,S.getHistories=C,S.getJscriptySessions=function(){S.queryJscriptySession.offset=(S.queryJscriptySession.page-1)*S.queryJscriptySession.limit,S.queryJscriptySession.id=S.contact.id,S.promise=r.cmContact.getJscriptySessions(S.queryJscriptySession,T("jscriptySessions")).$promise},S.deleteconfirm=function(n,e){var t=s.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(n.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(S.hoppers.rows,{id:e.id}),S.hoppers.count--,S.hoppers.rows.length||S.getHoppers(),o.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},S.editHopper=function(e,n){s.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.createOrEditIvrCampaignHopper=function(e,n){s.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:n,hoppers:S.hoppers.rows,license:null,setting:null,crudPermissions:S.crudPermissions}})},S.newPhone=function(e){return{phone:e,color:"gray"}},S.getCustomerJourney=w,S.loadMoreJourney=function(){return n(function(e,n){var t=S.journey.length;return e(w(t))})},S.moveUp=function(e){N(e,e-1)},S.moveDown=function(e){N(e,e+1)};var R=!0,x=1;function N(e,n){var t=S.additionalItems[n];S.additionalItems[n]=S.additionalItems[e],S.additionalItems[e]=t,a.additionalPhonesForm.$setDirty()}a.$watch("vm.queryHopper.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHopper.page),e!==n&&(S.queryHopper.page=1),e||(S.queryHopper.page=x),I())}),a.$watch("vm.queryFinal.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryFinal.page),e!==n&&(S.queryFinal.page=1),e||(S.queryFinal.page=x),O())}),a.$watch("vm.queryHistory.filter",function(e,n){R?t(function(){R=!1}):(n||(x=S.queryHistory.page),e!==n&&(S.queryHistory.page=1),e||(S.queryHistory.page=x),C())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","$q","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license","Auth","userProfileSection","customerJourneyManager"],angular.module("app.contactmanager.contacts").controller("ContactController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1},{key:"dialTimezone",required:!1}],g.contactItemTypes=[],l.contactItemType.get({fields:"id,name,orderBy"}).$promise.then(function(e){var n=e.rows;console.log(n);for(var t=0;t<n.length;t++)g.contactItemTypes.push({key:n[t].name,required:!1})}),g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),n.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],n=0;n<g.result.errors.length;n+=1){var t=g.result.errors[n].row;t.contact_import_error=g.result.errors[n].message,e.push(t)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(t){i(function(){if(g.result.rows=t.rows,t.errors)for(var e=0;e<t.errors.length;e++)g.result.errors.push(t.errors[e]);if(t.finish){g.result.finish=!0,g.result.affectedRows=t.affectedRows,g.result.failedRows=g.result.errors.length;var n=g.result.rows-g.result.affectedRows-g.result.errors.length;n&&0<n&&(g.duplicates.length?g.result.duplicatedRows=n:g.result.failedRows+=n),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"id",required:!0},{key:"firstName",required:!1},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1}],g.contactItemTypes=[],l.contactItemType.get({fields:"id,name,orderBy"}).$promise.then(function(e){for(var n=e.rows,t=0;t<n.length;t++)g.contactItemTypes.push({key:n[t].name,required:!1})}),g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),n.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.importUpdates({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],n=0;n<g.result.errors.length;n+=1){var t=g.result.errors[n].row;t.contact_import_error=g.result.errors[n].message,e.push(t)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(t){i(function(){if(g.result.rows=t.rows,t.errors)for(var e=0;e<t.errors.length;e++)g.result.errors.push(t.errors[e]);if(t.finish){g.result.finish=!0,g.result.affectedRows=t.affectedRows,g.result.failedRows=g.result.errors.length;var n=g.result.rows-g.result.affectedRows-g.result.errors.length;n&&0<n&&(g.duplicates.length?g.result.duplicatedRows=n:g.result.failedRows+=n),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsUpdatesDialogController",e)}(),function(){"use strict";function e(i,e,s,n,o,t,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(n),a.lists=t||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:n.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,n,t){var a=i.confirm({skipHide:!0}).title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+t.id+" will be overwritten by the fields of the contact #"+n.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:t.id,from:n.id}).$promise}).then(function(e){i.hide({new:e,to:t,from:n}),_.remove(o,{id:t.id}),_.remove(o,{id:n.id}),o.unshift(e)}).then(function(){s.success({title:"Contact properly merged!"})}).catch(function(e){e&&e.status&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},g.globalCustomField=l,g.globalCustomFields=r,g.newGlobalCustomField=!1,g.globalCustomField||(g.globalCustomField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",g.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,n){if(e!==n)switch(e){case"text":g.globalCustomField.values="";break;case"select":g.globalCustomField.values=[]}}),g.addNewGlobalCustomField=function(){g.errors=[],d.cmCustomField.save(g.globalCustomField).$promise.then(function(e){g.globalCustomFields.unshift(e.toJSON()),o.success({title:"GlobalCustomField properly created",msg:g.globalCustomField.name?g.globalCustomField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGlobalCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.globalCustomField.id},g.globalCustomField).$promise.then(function(e){var n=_.find(g.globalCustomFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"GlobalCustomField properly saved!",msg:g.globalCustomField.name?g.globalCustomField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGlobalCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.globalCustomField.id}).$promise.then(function(){_.remove(g.globalCustomFields,{id:g.globalCustomField.id}),o.success({title:"GlobalCustomField properly deleted!",msg:(g.globalCustomField.name||"globalCustomField")+" has been deleted!"}),v(g.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.globalCustomFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.globalCustomFields=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="globalCustomFields",f.listOrder="",f.listOrderAsc=null,f.selectedGlobalCustomFields=[],f.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",sort:"-updatedAt",ListId:"null",limit:10,page:1},f.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("globalCustomField")+"?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getGlobalCustomFields=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmCustomField.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="GlobalCustomFields",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditGlobalCustomField=function(e,n){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:n,globalCustomFields:f.globalCustomFields.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteGlobalCustomField=y,f.exportSelectedGlobalCustomFields=function(){var e=angular.copy(f.selectedGlobalCustomFields);return f.selectedGlobalCustomFields=[],e},f.deleteSelectedGlobalCustomFields=function(e){var n=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+f.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedGlobalCustomFields.forEach(function(e){y(e)}),f.selectedGlobalCustomFields=[]})},f.deselectGlobalCustomFields=function(){f.selectedGlobalCustomFields=[]},f.selectAllGlobalCustomFields=function(){f.selectedGlobalCustomFields=f.globalCustomFields.rows};var b=!0,A=1;function E(e){f.globalCustomFields=e||{count:0,rows:[]}}function y(e){m.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(f.globalCustomFields.rows,{id:e.id}),f.globalCustomFields.count-=1,f.globalCustomFields.rows.length||f.getGlobalCustomFields(),p.success({title:_.startCase("GlobalCustomField")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","globalCustomFields","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_LIST",g.list=angular.copy(l),g.lists=r,g.newList=!1,g.list||(g.list={},g.title="CONTACTMANAGER.NEW_LIST",g.newList=!0),g.addNewList=function(){g.errors=[],d.cmList.save(g.list).$promise.then(function(e){g.lists.unshift(e.toJSON()),o.success({title:"List properly created",msg:g.list.name?g.list.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveList=function(){g.errors=[],d.cmList.update({id:g.list.id},g.list).$promise.then(function(e){var n=_.find(g.lists,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"List properly saved!",msg:g.list.name?g.list.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteList=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmList.delete({id:g.list.id}).$promise.then(function(){_.remove(g.lists,{id:g.list.id}),o.success({title:"List properly deleted!",msg:(g.list.name||"list")+" has been deleted!"}),v(g.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","lists","list","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.cmList.getAgents({id:c.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserList?"penalty "+e.UserList.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.list=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.cmList.removeAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.cmList.addAgents({id:c.list.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:r.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","list","lists","realtime","$translate","Auth","crudPermissions"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.listCustomFields=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.cmList.getCustomFields(m.query,u).$promise}function g(e){d.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(m.listCustomFields.rows,{id:e.id}),m.listCustomFields.count-=1,m.listCustomFields.rows.length||p(),l.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.list={},m.listCustomFields={count:0,rows:[]},m.selectedListCustomFields=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,alias,type,values,required,clickToAction,actionType",limit:10,page:1},m.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.arrayactionType=_.keyBy([{option:"Voice",value:"'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.list=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("customField #")+e.id||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getListCustomFields=p,m.createOrEditListCustomField=function(e,n){o.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:m.list,customField:n,customFields:m.listCustomFields.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedListCustomFields=function(){var e=angular.copy(m.selectedListCustomFields);return m.selectedListCustomFields=[],e},m.deleteListCustomField=g,m.deleteSelectedListCustomFields=function(e){var n=o.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+m.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedListCustomFields.forEach(function(e){g(e)}),m.selectedListCustomFields=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,n,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){t.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},g.customField=l,g.customFields=r,g.newCustomField=!1,g.customField||(g.customField={type:"text",actionType:"voice"},g.title="CONTACTMANAGER.NEW_CUSTOMFIELD",g.newCustomField=!0),e.params.id&&(g.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,n){if(e!==n)switch(e){case"text":g.customField.values="";break;case"select":g.customField.values=[]}}),g.addNewCustomField=function(){g.errors=[],d.cmList.addCustomField({id:e.params.id},g.customField).$promise.then(function(e){g.customFields.unshift(e.toJSON()),o.success({title:"CustomField properly created",msg:g.customField.name?g.customField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.customField.id},g.customField).$promise.then(function(e){var n=_.find(g.customFields,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomField properly saved!",msg:g.customField.name?g.customField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomField=function(e){g.errors=[];var n=t.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){d.cmCustomField.delete({id:g.customField.id}).$promise.then(function(){_.remove(g.customFields,{id:g.customField.id}),o.success({title:"CustomField properly deleted!",msg:(g.customField.name||"customField")+" has been deleted!"}),v(g.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},g.removeItem=function(e,n){e.splice(n,1),a.customFieldForm.$pristine=!1},g.removeItems=function(e){for(var n=e.length,t=0;t<n;t++)e.splice(0,1);a.customFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customFields","customField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(a,e,t,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.list=c||a.params.list||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(t,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},u.agentadddialog=function(e,n){t.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:u.lists?u.lists.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoLists=function(){a.go("app.contactmanager.lists",{},{reload:"app.contactmanager.lists"})},u.saveList=function(){r.cmList.update({id:u.list.id},u.list).$promise.then(function(){l.success({title:"List updated!",msg:u.list.name?u.list.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","list","userProfileSection"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.cmList.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.list=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.ListId=m.list.id,m.query.id=m.list.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.list.id,field:"ListId",route:"cmList"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.contactmanager").controller("ListDispositionsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.lists=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="lists",f.listOrder="",f.listOrderAsc=null,f.selectedLists=[],f.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){a.go("app.contactmanager.lists.edit",{id:e.id,list:e,crudPermissions:f.crudPermissions})},f.gotocontactsgoto=function(t,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?a.go("app.contactmanager.contacts",{ListId:t.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:t.id})}},f.exportcsvcontactsexport=function(i,e){return m.cmList.getContactsCsv({id:i.id,nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","exportContacts_"+i.id+".csv"),a.click()}else p.info({title:"EXPORT",msg:"The list is empty"})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.agentadddialog=function(e,n){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{list:e,lists:f.lists?f.lists.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("list")+"?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getLists=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cmList.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Lists",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditList=function(e,n){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:n,lists:f.lists.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteList=y,f.exportSelectedLists=function(){var e=angular.copy(f.selectedLists);return f.selectedLists=[],e},f.deleteSelectedLists=function(e){var n=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+f.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedLists.forEach(function(e){y(e)}),f.selectedLists=[]})},f.deselectLists=function(){f.selectedLists=[]},f.selectAllLists=function(){f.selectedLists=f.lists.rows};var b=!0,A=1;function E(e){f.lists=e||{count:0,rows:[]}}function y(e){m.cmList.delete({id:e.id}).$promise.then(function(){_.remove(f.lists.rows,{id:e.id}),f.lists.count-=1,f.lists.rows.length||f.getLists(),p.success({title:_.startCase("List")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","lists","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;function b(){return a.smsAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.smsAccounts=e,a.smsInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].SmsAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.smsAccounts.rows,{id:e.rows[t].SmsAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.smsAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.smsAccounts=n})})}function A(){return a.faxAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.faxAccounts=e,a.faxInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].FaxAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.faxAccounts.rows,{id:e.rows[t].FaxAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.faxAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.faxAccounts=n})})}function E(){return a.openchannelAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.openchannelAccounts=e,a.openchannelInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].OpenchannelAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.openchannelAccounts.rows,{id:e.rows[t].OpenchannelAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.openchannelAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.openchannelAccounts=n})})}function y(){return a.whatsappAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.whatsappAccounts=e,a.whatsappInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].WhatsappAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.whatsappAccounts.rows,{id:e.rows[t].WhatsappAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.whatsappAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.whatsappAccounts=n})})}function S(){return a.chatWebsite.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.chatWebsites=e,a.chatInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].ChatWebsiteId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.abandoned+=e.rows[t].abandoned,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.chatWebsites.rows,{id:e.rows[t].ChatWebsiteId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","abandoned","unmanaged"]));return f.chatWebsites}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.chatWebsites=n})})}function T(){return a.mailAccount.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){return f.mailAccounts=e,a.mailInteraction.get({createdAt:{$gte:moment().startOf("day").utcOffset(0,!0).format(),$lte:moment().endOf("day").utcOffset(0,!0).format()},nolimit:!0}).$promise}).then(function(e){var n;if(e&&0<e.count)for(var t=0;t<e.rows.length;t+=1)n&&n.id===e.rows[t].MailAccountId?(n.total+=e.rows[t].total,n.waiting+=e.rows[t].waiting,n.talking+=e.rows[t].talking,n.answered+=e.rows[t].answered,n.unmanaged+=e.rows[t].unmanaged):(n=_.find(f.mailAccounts.rows,{id:e.rows[t].MailAccountId}))&&_.merge(n,_.pick(e.rows[t],["waiting","total","talking","answered","unmanaged"]));return f.mailAccounts}).then(function(n){f.customDashboard.widgets.forEach(function(e){e.mailAccounts=n})})}function I(){for(var e=0;e<f.customDashboard.widgets.length;e+=1)f.customDashboard.widgets[e].voiceQueuesSelected=f.voiceQueuesSelected,f.customDashboard.widgets[e].chatWebsitesSelected=f.chatWebsitesSelected,f.customDashboard.widgets[e].smsAccountsSelected=f.smsAccountsSelected,f.customDashboard.widgets[e].faxAccountsSelected=f.faxAccountsSelected,f.customDashboard.widgets[e].mailAccountsSelected=f.mailAccountsSelected,f.customDashboard.widgets[e].openchannelAccountsSelected=f.openchannelAccountsSelected,f.customDashboard.widgets[e].whatsappAccountsSelected=f.whatsappAccountsSelected}f.currentUser=s.getCurrentUser(),f.userProfile=v,f.userProfileSection=h&&1===h.count?h.rows[0]:null,f.crudPermissions=s.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.customDashboard={},f.voiceQueues=l&&l.count?l:{count:0,rows:[]},f.voiceQueuesSelected=l&&l.count?_.map(l.rows,"id"):[],f.faxAccounts=d&&d.count?d:{count:0,rows:[]},f.faxAccountsSelected=d&&d.count?_.map(d.rows,"id"):[],f.chatWebsites=c&&c.count?c:{count:0,rows:[]},f.chatWebsitesSelected=c&&c.count?_.map(c.rows,"id"):[],f.smsAccounts=m&&m.count?m:{count:0,rows:[]},f.smsAccountsSelected=m&&m.count?_.map(m.rows,"id"):[],f.mailAccounts=u&&u.count?u:{count:0,rows:[]},f.mailAccountsSelected=u&&u.count?_.map(u.rows,"id"):[],f.openchannelAccounts=p&&p.count?p:{count:0,rows:[]},f.openchannelAccountsSelected=p&&p.count?_.map(p.rows,"id"):[],f.whatsappAccounts=g&&g.count?g:{count:0,rows:[]},f.whatsappAccountsSelected=g&&g.count?_.map(g.rows,"id"):[],f.interval=n(function(){},1e3),f.goToEdit=function(){e.go("app.tools.customDashboards.edit",{customDashboard:f.customDashboard,id:f.customDashboard.id,tab:1})},f.setFilter=function(e){o.show({controller:"FilterDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/custom/filter/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{vm_parent:f}}).then(function(e){f=e,I()})},f.updateWidget=I,i.onWithoutApply("voice_queue:save",function(e){var n=_.find(f.voiceQueues.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.onWithoutApply("sms_account:save",function(e){var n=_.find(f.smsAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("smsInteraction:update",b),i.on("smsInteraction:save",b),i.onWithoutApply("fax_account:save",function(e){var n=_.find(f.faxAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("faxInteraction:update",A),i.on("faxInteraction:save",A),i.onWithoutApply("mail_account:save",function(e){var n=_.find(f.mailAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("mailInteraction:update",T),i.on("mailInteraction:save",T),i.onWithoutApply("openchannel_account:save",function(e){var n=_.find(f.openchannelAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("openchannelInteraction:update",E),i.on("openchannelInteraction:save",E),i.onWithoutApply("whatsapp_account:save",function(e){var n=_.find(f.whatsappAccounts.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("whatsappInteraction:update",y),i.on("whatsappInteraction:save",y),i.onWithoutApply("chat_website:save",function(e){var n=_.find(f.chatWebsites.rows,{id:e.id});n&&_.merge(n,_.pick(e,_.keys(n)))}),i.on("chatInteraction:update",S),i.on("chatInteraction:save",S),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return f.customDashboard=e,f.customDashboard.widgets=[],f.customDashboard.preview=!0,f.customDashboard.draggable={enabled:!1},f.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:f.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",e.rows[n].voiceQueues=f.voiceQueues,e.rows[n].voiceQueuesSelected=f.voiceQueuesSelected,e.rows[n].faxAccounts=f.faxAccounts,e.rows[n].faxAccountsSelected=f.faxAccountsSelected,e.rows[n].mailAccounts=f.mailAccounts,e.rows[n].mailAccountsSelected=f.mailAccountsSelected,e.rows[n].smsAccounts=f.smsAccounts,e.rows[n].smsAccountsSelected=f.smsAccountsSelected,e.rows[n].chatWebsites=f.chatWebsites,e.rows[n].chatWebsitesSelected=f.chatWebsitesSelected,e.rows[n].openchannelAccounts=f.openchannelAccounts,e.rows[n].openchannelAccountsSelected=f.openchannelAccountsSelected,e.rows[n].whatsappAccounts=f.whatsappAccounts,e.rows[n].whatsappAccountsSelected=f.whatsappAccountsSelected,f.customDashboard.widgets.push(e.rows[n])}).catch(function(){f.customDashboard=void 0}),t.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),i.removeAllListeners("sms_account:save"),i.removeAllListeners("fax_account:save"),i.removeAllListeners("mail_account:save"),i.removeAllListeners("openchannel_account:save"),i.removeAllListeners("whatsapp_account:save"),i.removeAllListeners("chat_website:save"),i.removeAllListeners("chatInteraction:save"),i.removeAllListeners("chatInteraction:update"),i.removeAllListeners("smsInteraction:save"),i.removeAllListeners("smsInteraction:update"),i.removeAllListeners("openchannelInteraction:save"),i.removeAllListeners("openchannelInteraction:update"),i.removeAllListeners("mailInteraction:save"),i.removeAllListeners("mailInteraction:update"),i.removeAllListeners("faxInteraction:save"),i.removeAllListeners("faxInteraction:update"),i.removeAllListeners("whatsappInteraction:save"),i.removeAllListeners("whatsappInteraction:update"),f.interval&&n.cancel(f.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","$mdDialog","$document","voiceQueues","faxAccounts","chatWebsites","smsAccounts","mailAccounts","openchannelAccounts","whatsappAccounts","userProfile","userProfileSection"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){a.hide(c.parent)}c.title="DASHBOARDS.SETFILTERS",c.currentUser=l.getCurrentUser(),c.parent=d,c.onChangeFilter=function(e){for(var n=0;n<c.parent.customDashboard.widgets.length;n+=1)switch(e){case"voice":c.parent.customDashboard.widgets[n].voiceQueuesSelected=c.parent.voiceQueuesSelected;break;case"sms":c.parent.customDashboard.widgets[n].smsAccountsSelected=c.parent.smsAccountsSelected;break;case"chat":c.parent.customDashboard.widgets[n].chatAccountsSelected=c.parent.chatAccountsSelected;break;case"fax":c.parent.customDashboard.widgets[n].faxAccountsSelected=c.parent.faxAccountsSelected;break;case"mail":c.parent.customDashboard.widgets[n].mailAccountsSelected=c.parent.mailAccountsSelected;break;case"openchannel":c.parent.customDashboard.widgets[n].openchannelAccountsSelected=c.parent.openchannelAccountsSelected;break;case"whatsapp":c.parent.customDashboard.widgets[n].whatsappAccountsSelected=c.parent.whatsappAccountsSelected}},c.confirm=function(){m()},c.closeDialog=m}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","api","Auth","vm_parent"],angular.module("app.tools").controller("FilterDialogController",e)}(),function(){"use strict";function e(e,s,i,c,o,r,m,n,l,t,u,a,d,p,g,v,h,f,b,A,E){var y=this;y.license=v,y.setting=h,y.detectBrowser=b.detectBrowser(),y.user=n.getCurrentUser(),y.currentTab=0,y.notifications={},y.tabs={},y.agentCapacity={},y.autoClose=!1,y.acceptedNotifications=[],y.autoanswerTimeout,y.globalUserLists=a||{count:0,rows:[]},y.globalLists=d||{count:0,rows:[]},y.globalCompanies=p||{count:0,rows:[]},y.globalTags=g||{count:0,rows:[]};var S=E.getLogger("dashboard","agent.general.contact");function T(e){var n={};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&(n[t]=_.pick(y.tabs[t],["type","title","channel","icon","color","autoCreate","id","saved","badges","openedAt"]),_.isNil(y.tabs[t].contact)||(n[t].contact=_.pick(y.tabs[t].contact,["id","ListId"])),_.isNil(y.tabs[t].calls)||(n[t].calls=y.tabs[t].calls),y.tabs[t].interaction&&(n[t].interaction=_.pick(y.tabs[t].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","WhatsappAccountId","closed","draft"])));var a=JSON.parse(i.localStorage.getItem("motion2.user:"+y.user.id));a?(a.tabs=n,a.currentTab=y.currentTab,a.autoClose=y.autoClose):a={tabs:n,currentTab:y.currentTab,autoClose:y.autoClose},i.localStorage.setItem("motion2.user:"+y.user.id,JSON.stringify(a)),e&&I(e)}function I(e){if(_.isNil(e)||e&&"interaction"===e.type){var n={id:y.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,whatsapp:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],whatsapp:[],openchannel:[],chat:[]}};for(var t in y.tabs)y.tabs.hasOwnProperty(t)&&n.capacity.hasOwnProperty(y.tabs[t].channel)&&y.tabs[t].interaction&&!y.tabs[t].interaction.closed&&(n.capacity[y.tabs[t].channel]+=1,n.interaction[y.tabs[t].channel].push(y.tabs[t].interaction.id));if(!_.isEqual(y.agentCapacity,n.capacity))return y.agentCapacity=n.capacity,l.rpc.setAgentCapacity(n)}}function O(e){y.tabs[e.id]&&(!function(e){if(e.channel&&e.interaction)l.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:y.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){S.error(e)})}(y.tabs[e.id]),delete y.tabs[e.id],y.currentTab=0,T(e))}function C(e){Object.keys(y.tabs).length!==y.setting.limitTabs?(e.id=_.random(1e10),e.openedAt=(new Date).toISOString(),e.saved=!1,e.badges=0,y.tabs[e.id]=e,y.currentTab=e.id,T(e)):u.warning({title:"",msg:c.instant("DASHBOARD.LIMIT_TABS_REACHED")})}function w(n){return _.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==n.interactionId&&e.channel==n.channel})}function R(n,t){var e,a,i={type:"contact",title:n?(e=n,a="",e&&(e.firstName||e.lastName?(e.firstName&&(a+=e.firstName+" "),e.lastName&&(a+=e.lastName)):e.phone&&(a=e.phone)),a=y.user.privacyEnabled?A.mask(a):a):c.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:n,calls:t?[t]:[],autoCreate:t?t.autoCreate:0};if(t&&(t.answertime||(t.answertime=t.agentconnectAt),(t.agentcompleteAt||t.endtime)&&U(t)),n){var s=_.find(y.tabs,function(e){return e.contact&&e.contact.id?"contact"===e.type&&e.contact&&e.contact.id==n.id:"contact"===e.type&&e.contact&&e.contact.phone==n.phone});if(s){if(t)return l.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){(e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime),s.calls)?_.find(s.calls,function(e){return e.uniqueid===t.uniqueid})||s.calls.push(t):s.calls=[t];y.currentTab=s.id})}else{if(n.ListId)return l.disposition.get({ListId:n.ListId,nolimit:!0}).$promise.then(function(e){return i.dispositions=e,l.cmList.getCustomFields({id:n.ListId,nolimit:!0}).$promise}).then(function(e){i.customFields=e}).catch(F()).finally(function(){C(i)});C(i)}}else C(i)}function x(n,t){var e=_.find(y.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===t.id&&e.channel===n});e?(e.isDraft=t.isDraft||!1,y.currentTab=e.id):C(e={type:"interaction",title:n?n.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";case"whatsapp":return"icon-whatsapp";default:return"icon-hangouts"}}(n),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";case"whatsapp":return"lime-A700";default:return"grey"}}(n),channel:n,interaction:t,isDraft:t.isDraft||!1})}function N(e){var n=0;switch(e){case"chat":n=105;break;case"mail":n=106;break;case"sms":n=107;break;case"openchannel":n=108;break;case"fax":n=109;break;case"whatsapp":n=114}return 0<n&&_.includes(y.user.permissions,n)}function D(t){f.isSupported()?f.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=t).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},f.show(e.title,n)},function(e){S.error("Please enable browser notifications!",e)}):S.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}function P(n){u.wait({title:n.title,msg:n.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:n.sound,html:!0,shake:n.shake||!1,onAdd:function(){y.notifications[n.uniqueid]=this.id},onAccept:function(){if(L(n),l[n.channel+"Message"])return l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){y.acceptedNotifications.push(n.id),y.autoanswerTimeout=null,x(e.channel,e.interaction),u.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(F())},onReject:function(){if(L(n),_.isNil(y.autoanswerTimeout)||(r.cancel(y.autoanswerTimeout),y.autoanswerTimeout=null),l[n.channel+"Message"])return l[n.channel+"Message"].reject({id:n.id,UserId:y.user.id}).$promise.then(function(){u.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(F())}})}function L(e){e&&e.uniqueid&&y.notifications[e.uniqueid]&&(u.clear(y.notifications[e.uniqueid]),delete y.notifications[e.uniqueid])}function k(n){var t=n.uniqueid;for(var e in S.debug("onVoiceChannelRemove -> evt",n),y.tabs)if(y.tabs.hasOwnProperty(e)){var a=y.tabs[e];if(a.calls){S.debug("onVoiceChannelRemove -> key, tab, tab.calls",e,a,a.calls);var i=_.findIndex(a.calls,function(e){return e.uniqueid===t});i<0&&0<=(i=_.findIndex(a.calls,function(e){return e.uniqueid===n.linkedid}))&&(t=n.linkedid),0<=i&&!a.calls[i].disposedAt?(S.debug("Allowing disposition for call %s",a.calls[i].uniqueid),U(a.calls[i])):S.debug("Call %s not found or already completed",a.calls[i].uniqueid),a.contact&&a.contact.id&&r(M(t,a.contact.id,a),1e3)}}T()}function M(n,e,t){return function(){if(_.find(t.calls,function(e){return e.uniqueid===n}))return l.voiceCallReport.update({id:n,ContactId:e}).$promise.catch(function(e){S.error(e)})}}function U(e){e.disposedAt=new Date}function F(){return function(e){if(404===e.status)u.warning({title:c.instant("DASHBOARDS.ATTENTION"),msg:c.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){y.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)u.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}function $(e){l.cmHopper.update({id:e,recallmeNotifiedDate:null}).$promise.then(function(e){S.debug(e)}).catch(function(e){S.error(e)}).finally(function(){q(e)})}function q(e){y.toasty.clear(y.notifications[e])}y.onClickTab=function(e){y.currentTab=e,T(y.tabs[e])},y.isActiveTab=function(e){return e===y.currentTab},y.alreadyExistsTab=w,y.addContactTab=R,y.addInteractionTab=x,y.addTab=C,y.removeTab=O,y.updateLocalStorage=T,y.closeTab=function(e){var n=!1,t=s.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved){var a=y.user.voicePause||y.user.chatPause||y.user.mailPause||y.user.openchannelPause||y.user.faxPause;return"interaction"===e.type&&(n=e.interaction.Account.mandatoryDisposition),s.show(t).then(function(){"interaction"===e.type&&s.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(o.body),onRemoving:function(){y.user&&n&&!a&&l.user.unpause({id:y.user.id}).$promise.catch(function(e){S.error(e)})},clickOutsideToClose:!n,escapeToClose:!n,locals:{user:y.user,channel:e.channel,interaction:e.interaction}}),O(e)}).catch(function(){"interaction"===e.type&&O(e)})}if(_.forEach(e.calls,function(e){e.mandatoryDisposition&&(n=!0)}),"contact"===e.type&&0<e.calls.length){if(!n)return t._options.textContent="There is a call that hasn't been disposed yet.",s.show(t).then(function(){O(e)});var i=s.alert().title("Warning").textContent("There is a call that hasn't been disposed yet.").ok("OK");s.show(i).finally(function(){i=void 0})}else O(e)}},y.dialPreviewRecallReminder=function(e){var n,t,a,i,s;if(e&&e.hopper){if(i=m("formatdate")(e.hopper.scheduledat),s=e.hopper,e.hopper.Contact&&(n=e.hopper.Contact),e.hopper.List&&(t=e.hopper.List),e.hopper.id&&(a=e.hopper.id),a&&n&&t&&n.firstName){var o=n.firstName;n.lastName&&(o=o+" "+n.lastName);var r=s.phone||n.phone;y.user.privacyEnabled&&(o=A.mask(o),r=A.mask(r));var l=c.instant("DASHBOARDS.RECALLME_CALL_REMINDER"),d="<div> <span>"+c.instant("DASHBOARDS.UPCOMING_RECALLME_CALL")+"</span><br> <span>"+c.instant("DASHBOARDS.CONTACT_NAME")+": "+o+"</span><br> <span>"+c.instant("DASHBOARDS.CONTACT_PHONE")+": "+r+"</span><br> <span>"+c.instant("DASHBOARDS.SCHEDULED_TIME")+": "+i+"</span><br> <span>"+c.instant("DASHBOARDS.LIST_NAME")+": "+t.name+"</span><br> </div>";S.debug(e),u.info({title:l,msg:d,showClose:!0,clickToClose:!0,timeout:6e4,html:!0,onAdd:function(){y.notifications[a]=this.id},onAccept:function(){delete y.notifications[a],y.openContactTab(a)},onReject:function(){delete y.notifications[a],$(a)},onRemove:function(){setTimeout(function(){y.notifications[a]&&(delete y.notifications[a],$(a))},1e3)}})}}else S.warn("Response does not contain hopper",e)},y.openContactTab=function(e){y.openPreviewDialog(e),q(e)},y.openPreviewDialog=function(e){l.cmHopper.getPreviewRecall({id:e}).$promise.then(function(e){var n=angular.element("#toolbar").scope();n&&n.vm.openPreviewDialog(e,!0)})},y.toasty=u,function(){var e=i.localStorage.getItem("motion2.user:"+y.user.id);if(e)try{e=JSON.parse(e),y.tabs=e.tabs?e.tabs:{},y.currentTab=e.currentTab?e.currentTab:0,y.autoClose=!!e.autoClose&&e.autoClose,I(y.tabs[y.currentTab]),S.debug("Tabs initiated correctly")}catch(e){S.error(e)}}(),e.$on("$destroy",function(){for(var e in y.notifications)y.notifications.hasOwnProperty(e)&&L({uniqueid:e});t.removeAllListeners("trigger:contactmanager"),t.removeAllListeners("trigger:jscripty"),t.removeAllListeners("trigger:browser:url"),t.removeAllListeners("trigger:browser:popup"),t.removeAllListeners("notification:save"),t.removeAllListeners("notification:remove"),t.removeAllListeners("voice_queue_channel:remove"),t.removeAllListeners("voice_outbound_channel:remove")}),t.on("trigger:contactmanager",function(n){_.isNil(n.contacts)||1!==n.contacts.length?s.show({controller:"ContactSelectionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",parent:angular.element(o.body),locals:{contacts:n.contacts,callNumber:n.evt.routeId?n.evt.destcalleridnum:n.evt.calleridnum}}).then(function(e){R(e,n.evt)}):R(n.contact,n.evt)}),t.on("trigger:jscripty",function(t){return l.jscriptyProject.get({id:t.ProjectId}).$promise.then(function(n){if(n){if(!_.isUndefined(t["xmd-contactid"]))return l.cmContact.get({id:t["xmd-contactid"]}).$promise.then(function(e){try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user,contact:e}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t,contact:e})}).catch(F());try{n.formData=Mustache.render(n.formData,_.merge(t,{user:y.user}))}catch(e){S.error(e)}C({type:"jscripty",title:n.name,icon:"icon-script",color:"grey",project:n,call:t})}}).catch(F())}),t.on("trigger:bot",function(n){var t=n.calleridname&&"<unknown>"!==n.calleridname?n.calleridname:n.calleridnum,a=n.calleridnum;return l.squareMessage.get({fields:"id",limit:1,offset:0,uniqueid:n.uniqueid}).$promise.then(function(e){e.count&&C({type:"bot",title:t+" <"+a+">",icon:"fas fa-robot",color:"pink",data:{uniqueid:n.uniqueid}})})}),t.on("trigger:browser:url",function(e){if(e&&e.uri)if(e.uri=_.replace(e.uri,"<%3B",""),e.uri=_.replace(e.uri,"=>%3B=",""),e.uriLocation)switch(e.uriLocation){case"0":i.open(e.uri);break;case"1":i.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;case"2":C({type:"iframe",title:e.uri,icon:"icon-google-earth",color:"blue",src:e.uri});break;default:i.open(e.uri)}else i.open(e.uri)}),t.on("trigger:browser:popup",function(e){e&&e.html&&C({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})}),t.on("notification:save",function(n){if(N(n.channel)&&n&&n.uniqueid){D(n);var e=w(n);if(e){if(l[n.channel+"Message"])return y.currentTab!==e.id&&(e.badges+=1),y.acceptedNotifications.push(n.id),l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id}).$promise.catch(F())}else{var t="mail"==n.channel?"email":n.channel,a=y.user[t+"AutoanswerDelay"]?1e3*y.user[t+"AutoanswerDelay"]:0;if(y.user[t+"Autoanswer"]&&y.license[n.channel]&&N(n.channel)){if(0<a)P(n),y.autoanswerTimeout=r(function(){if(l[n.channel+"Message"]&&!_.includes(y.acceptedNotifications,n.id))return l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){y.acceptedNotifications.push(n.id),x(e.channel,e.interaction),L(n)}).catch(F())},y.user[t+"AutoanswerDelay"]?1e3*y.user[t+"AutoanswerDelay"]:0);else if(l[n.channel+"Message"])return l[n.channel+"Message"].accept({id:n.id,UserId:y.user.id,manual:!0}).$promise.then(function(e){y.acceptedNotifications.push(n.id),x(e.channel,e.interaction)}).catch(F())}else P(n)}}}),t.on("notification:remove",L),t.on("voice_queue_channel:remove",k),t.on("voice_outbound_channel:remove",k),t.on("user:dialPreviewRecallReminder",y.dialPreviewRecallReminder)}e.$inject=["$scope","$mdDialog","$window","$translate","$document","$timeout","$filter","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","setting","desktopNotification","msUtils","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var f={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var n in e)f.hasOwnProperty(n)&&null!=e[n]&&(f[n]=e[n])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,n,p){var g=n.Notification||n.mozNotification||n.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var t=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?t.resolve(e):t.reject(e)}):g.requestPermission(function(e,n){p.GRANTED===e?t.resolve(e):t.reject(e)});return t.promise},show:function(e,n){if(n=n||{},!v()||(t=e,a=n,i=angular.isString(t),s=!a.onClick||angular.isFunction(a.onClick),!i||!s)||function(e){if(e||f.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(n.showOnPageHidden)||h()!==p.GRANTED)return;var t,a,i,s;var o=new g(e,n),r=n.duration||f.duration,l=void 0===n.autoClose?f.autoClose:n.autoClose;o.onclick=function(){n.onClick&&n.onClick(),n.focusOnclick&&window.focus(),n.closeOnClick&&o.close()},l&&(d=o,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return o},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function n(e,n){if(angular.isString(e)){for(var t=e.split("."),a=t[t.length-1],i=function(e){var n=l;if(1===e.length)return n;e.pop();for(var t=0;t<e.length;t++){for(var a=e[t],i=!0,s=0;s<n.length;s++)if(n[s]._id===a){n=n[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};n.push(o),n=o.children}}return n}(t),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,n),s.uisref=d(s)):(n.children=[],!angular.isUndefined(n.weight)&&angular.isNumber(n.weight)||(n.weight=1),n._id=a,n._path=e,n.uisref=d(n),i.push(n))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var n="";return angular.isDefined(e.state)&&(n=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(n=n+"("+angular.toJson(e.stateParams)+")")),n}this.saveItem=n,this.deleteItem=function(e){if(!angular.isString(e))return void r.error("path must be a string (eg. `dashboard.project`)");for(var n=l,t=e.split("."),a=0;a<t.length;a++)for(var i=t[a],s=0;s<n.length;s++)if(n[s]._id===i){if(n[s]._path===e)return n.splice(s,1),!0;n=n[s].children;break}return!1},this.$get=function(){var e={saveItem:n,getNavigation:function(e){if(e){for(var n=0;n<l.length;n++)if(l[n]._id===e)return[l[n]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(t){var a=this;a.setting={},a.messages={count:0,rows:[]},a.showInteraction=!1,a.init=function(e,n){{if(a.setting=n,a.tab=e,a.tab.saved=!0,a.tab&&a.tab.data&&a.tab.data.uniqueid)return t.squareMessage.get({uniqueid:a.tab.data.uniqueid}).$promise.then(function(e){a.messages=e}).finally(function(){a.showInteraction=!0});a.showInteraction=!0}},a.getMessagesAlignment=function(e){switch(a.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}}}e.$inject=["api"],angular.module("app.dashboards").controller("AgentGeneralBotController",e)}(),function(){"use strict";function e(a,d,c,t,m,i,u,p,s,o,e,r,l,n){var g=this;g.user=s.getCurrentUser(),g.detectBrowser=e.detectBrowser(),g.additionalItemTypes=[],g.additionalItems=[],g.contactItemTypes=[],g.newPhone=function(e){return{phone:e,color:"gray"}},g.journey=[],g.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},g.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition,secondDisposition,thirdDisposition",sort:"-updatedAt",limit:10,page:1},g.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},g.hoppers={rows:[],count:0},g.finals={rows:[],count:0},g.histories={rows:[],count:0},g.journeyOptions=r.getQuery(),g.quickFilters=r.getQuickFilters(),g.addNewContact=f,g.saveContact=function(){g.errors=[],u.cmContact.update({id:g.contact.id},g.contact).$promise.then(function(e){var n=h(e);return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,m.$parent.vm.updateLocalStorage(),u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).then(function(){return u.cmContact.setAdditionalPhones({id:g.contact.id,items:g.additionalItems,item_types:g.additionalItemTypes}).$promise.then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly updated!",msg:g.contact.name?g.contact.name+" has been updated!":""})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.getCustomFields=function(e){return u.cmList.getCustomFields({id:e}).$promise.then(function(e){g.tab.customFields=e}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},g.call=m.$parent.vm.call,g.disposeCall=function(e,i){if(g.newContact)return void p.error({title:"ATTENTION",msg:"Please save the contact before disposing!"});d.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(c.body),targetEvent:i,clickOutsideToClose:!i.mandatoryDisposition,escapeToClose:!i.mandatoryDisposition,resolve:{globalDispositions:["apiResolver",function(e){return e.resolve("disposition@get",{MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0})}]},onRemoving:function(){g.user&&i.mandatoryDisposition&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{dispositions:g.tab.dispositions,contact:g.contact,call:i,availableCalls:g.tab.calls.length,autoClose:m.$parent.vm.autoClose}}).then(function(e){var n=e[0];for(var t in m.$parent.vm.autoClose=e[1],n&&("BLACKLIST"===n?p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_DISPOSED")+" "+n}):"RECALLME"===n||"RESCHEDULE"===n||p.success({title:o.instant("DASHBOARDS.INFO"),msg:o.instant("DASHBOARDS.CALL_SAVED")})),m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(t)){var a=m.$parent.$parent.$parent.vm.tabs[t];_.remove(a.calls,function(e){return e.uniqueid===i.uniqueid})}0===g.tab.calls.length&&m.$parent.vm.autoClose&&m.$parent.vm.removeTab(g.tab),m.$parent.vm.updateLocalStorage()})},g.checkCallStatus=function(n){return g.checkingCallStatus=!0,u.voiceCallReport.get({uniqueid:n.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(n.disposedAt=_.first(e.rows).endtime)}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"VOICE_CALL_REPORT:GET",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){g.checkingCallStatus=!1})},g.duplicateContact=function(e){d.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},g.mergeContact=function(e){d.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(c.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:g.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:s.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}}).then(function(e){if(e){for(var n in m.$parent.$parent.$parent.vm.tabs)if(m.$parent.$parent.$parent.vm.tabs.hasOwnProperty(n)){var t=m.$parent.$parent.$parent.vm.tabs[n];t&&t.contact&&(e.from&&e.from.id&&e.from.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t),e.to&&e.to.id&&e.to.id===t.contact.id&&m.$parent.$parent.$parent.vm.removeTab(t))}e.new&&m.$parent.$parent.$parent.vm.addContactTab(e.new)}})},g.getDateFromString=S,g.addJscriptyTab=function(e){try{e.formData=Mustache.render(e.formData,{contact:g.contact,user:g.user})}catch(e){v.error(e)}try{m.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:g.contact})}catch(e){p.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},g.getHoppers=A,g.getFinals=E,g.getHistories=y,g.getJscriptyProjects=function(){if(g.jscriptyProjects)return;return g.loadingJscriptyProjects=!0,u.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant("JSCRIPTY.JSCRIPTY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.JSCRIPTY_GET_ERROR")})}).finally(function(){g.loadingJscriptyProjects=!1})},g.getAccounts=function(n){if(g[n+"Accounts"])return;var e="get"+_.startCase(n)+"Accounts";return g.loadingAccounts=!0,u.user[e]({id:g.user.id,attributes:["id","name"],nolimit:!0}).$promise.then(function(e){g[n+"Accounts"]=e||{count:0,rows:[]}}).catch(function(){p.error({title:o.instant(n.toUpperCase()+"."+n.toUpperCase()+"ACCOUNTS"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.ACCOUNTS_GET_ERROR",{channel:o.instant("DASHBOARDS."+n.toUpperCase())})})}).finally(function(){g.loadingAccounts=!1})},g.composeInteraction=function(e,o,r,n){var l=o.toLowerCase();d.show({controller:"Compose"+o+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/"+o.toLowerCase()+"/dialog.html",parent:angular.element(c.body),clickOutsideToClose:!1,locals:{account:r,message:{to:"mail"==l?n:n.split(",")},type:"new",interaction:{Contact:g.contact}},fullscreen:!0}).then(function(s){if(!s||_.isNil(s.message)||!s.message.savedAsDraft)return u[l+"Account"].send({id:r.id},s).$promise.then(function(e){if("Mail"===o){var n=e;if(n&&n.Messages&&n.Messages.length){if(s.attachments&&s.attachments.length)for(var t=0;t<s.attachments.length;t+=1)u.attachment.update({id:s.attachments[t].id},{MailMessageId:_.head(n.Messages).id});if(p.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.closed){n.disposition=null;var a=!r.mandatoryDisposition,i=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause;d.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(c.body),onRemoving:function(){g.user&&r.mandatoryDisposition&&!i&&u.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},clickOutsideToClose:a,escapeToClose:a,locals:{user:g.user,channel:"mail",interaction:n}})}else m.$parent.vm.addInteractionTab("mail",n)}}else p.success({title:"Message properly sent!",msg:"Message has been sent!"}),m.$parent.vm.addInteractionTab(l,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"fax"===l?p.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:o.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var e={type:"draft",channel:"mail",account:r,contact:g.contact,id:g.tab.id,openedAt:new Date,saved:!1,title:r.key+" - Untitled",content:s.message},n=a.localStorage.getItem("motion2.home.mail:"+g.user.id);if(n){var t=JSON.parse(n);t.drafts||(t.drafts={}),n=t}else n={drafts:{}};n.drafts[g.tab.id]=e,a.localStorage.setItem("motion2.home.mail:"+g.user.id,JSON.stringify(n))})},g.init=function(n,e){return g.tab=n,m.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e){g.tab.saved=e[0]&&e[1]}),g.license=e,g.contact=g.tab.contact,g.newContact=!1,g.currentTab=0,u.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){g.users=e||{count:0,rows:[]},g.usersMap=_.mapValues(_.keyBy(g.users.rows,"id"),"fullname")}).then(function(){for(var e=[],n=0;n<g.tab.calls.length;n++){var t=g.tab.calls[n];e.push(u.voiceCallReport.get({uniqueid:t.uniqueid}).$promise.then(function(e){e&&0<e.rows.length&&(t.disposedAt=_.first(e.rows).endtime)}))}return i.all(e)}).then(function(){return u.user.getLists({id:g.user.id,nolimit:!0}).$promise}).then(function(e){if(g.lists=e||{count:0,rows:[]},g.contact&&g.contact.ListId){if(g.list=_.find(g.lists.rows,{id:g.contact.ListId}),g.list)return;return u.cmList.get({id:g.contact.ListId}).$promise.then(function(e){e&&(g.list=e,g.lists.rows=_.unionBy(g.lists.rows,[g.list]))})}}).then(function(){if(g.contact&&g.contact.id){var e={id:g.contact.id,ListId:g.contact.ListId,limit:1,offset:0,sort:"-updatedAt"};return u.cmContact.get(e).$promise.then(function(e){return g.contact=e,g.tab.contact=e,u.user.addContacts({id:g.user.id,ids:[g.contact.id]})}).then(function(){if(g.contact.ListId)return u.disposition.get({ListId:g.contact.ListId,nolimit:!0}).$promise.then(function(e){return g.tab.dispositions=e,u.cmList.getCustomFields({id:g.contact.ListId,nolimit:!0}).$promise}).then(function(e){g.tab.customFields=e})}).then(function(){try{g.tab.companies=m.$parent.$parent.$parent.vm.globalCompanies,g.tab.tags=m.$parent.$parent.$parent.vm.globalTags,g.tab.autoCreate=0}catch(e){}u.contactItemType.get({}).$promise.then(function(e){g.contactItemTypes=e.rows}).then(function(){u.cmContact.getAdditionalPhones({id:g.contact.id}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");g.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");g.additionalItems=[];for(var s=0;s<n.length;s++)g.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})}).catch(function(e){console.log(e)})}),A(),E(),y()}).then(function(){return u.cmContact.getTags({id:g.contact.id}).$promise.then(function(e){g.tab.Tags=_.map(e.rows,"id")})})}return g.newContact=!0,n.autoCreate?f():void 0}).finally(function(){g.contact&&g.contact.id&&(T(),g.contact.dateOfBirth=S(g.contact.dateOfBirth))})},g.hasPermission=function(e){return s.hasPermission(e)},g.openInteraction=function(e){try{return m.$parent.$parent.$parent.vm.addInteractionTab(e.channel,e)}catch(e){p.error({title:o.instant("CONTACTMANAGER.CUSTOMER_JOURNEY"),msg:o.instant("CONTACTMANAGER.NOTIFICATIONS.INTERACTION_OPEN_ERROR")})}},g.getCustomerJourney=T,g.loadMoreJourney=function(){return i(function(e){var n=g.journey.length;return e(T(n))})};var v=n.getLogger("agent.general.contact");function h(e){return e.firstName||e.lastName?(e.firstName+" "+e.lastName).trim():e.phone}function f(){g.errors=[],u.cmContact.save(g.contact).$promise.then(function(e){g.contact.id=e.id,g.newContact=!1;var n=h(e);return g.tab.title=g.user.privacyEnabled?l.mask(n):n,g.tab.contact=g.contact,u.user.addContacts({id:s.getCurrentUser().id,ids:[e.id]})}).then(function(){g.detailForm.$pristine=!0,g.customFieldsForm.$pristine=!0,p.success({title:"Contact properly created",msg:g.contact.firstName?g.contact.firstName+" has been created!":""})}).then(function(){return u.cmContact.setTags({id:g.contact.id,ids:g.tab.Tags}).$promise}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}function b(n){return function(e){g[n]=e||{count:0,rows:[]}}}function A(){g.contact&&g.contact.id&&(g.queryHopper.ContactId=g.contact.id,g.queryHopper.offset=(g.queryHopper.page-1)*g.queryHopper.limit,g.promise=u.cmHopper.get(g.queryHopper,b("hoppers")).$promise)}function E(){g.contact&&g.contact.id&&(g.queryFinal.ContactId=g.contact.id,g.queryFinal.offset=(g.queryFinal.page-1)*g.queryFinal.limit,g.promise=u.cmHopperFinal.get(g.queryFinal,b("finals")).$promise)}function y(){g.contact&&g.contact.id&&(g.queryHistory.ContactId=g.contact.id,g.queryHistory.offset=(g.queryHistory.page-1)*g.queryHistory.limit,g.promise=u.cmHopperHistory.get(g.queryHistory,b("histories")).$promise)}function S(e){return null===e?void 0:new Date(e)}function T(e){g.journeyIsLoading=!0;var n=_.merge(g.journeyOptions,{id:g.contact.id,offset:e||0});return r.get(g.journey,n).then(function(e){g.journey=e.journey,g.canLoadMoreJourney=e.loadMore}).finally(function(){g.journeyIsLoading=!1})}m.$on("$destroy",function(){}),m.$watch("currentTab",function(){1===g.currentTab&&(A(),E(),y())});var I=!0,O=1;m.$watch("queryHopper.filter",function(e,n){I?t(function(){I=!1}):(n||(O=g.queryHopper.page),e!==n&&(g.queryHopper.page=1),e||(g.queryHopper.page=O),A())}),m.$watch("queryFinal.filter",function(e,n){I?t(function(){I=!1}):(n||(O=g.queryFinal.page),e!==n&&(g.queryFinal.page=1),e||(g.queryFinal.page=O),E())}),m.$watch("queryHistory.filter",function(e,n){I?t(function(){I=!1}):(n||(O=g.queryHistory.page),e!==n&&(g.queryHistory.page=1),e||(g.queryHistory.page=O),y())})}e.$inject=["$window","$mdDialog","$document","$timeout","$scope","$q","api","toasty","Auth","$translate","msUtils","customerJourneyManager","privacyManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(n,t,i,s,o,e,a,r,l,d,c,m,u,p,g){var v=this;v.user=d.getCurrentUser(),v.isReschedule=!1,v.recallme=!1,v.queueCampaign=void 0,v.queueCampaigns={count:0,rows:[]},v.dispositions=_.orderBy(_.concat([],e.rows,a.rows),["name"],["asc"]),v.contact=l,v.call=r,v.note=v.call.note||void 0,v.dialerCall=!1,v.hasBlackLists=!1,v.contactTZTime,v.availableCalls=m,v.autoClose=u,v.recalcTZTime=b,v.hopper={minDate:new Date,dateTime:new Date,scheduledAt:new Date},p.$watch("vm.contact.dialTimezone",function(){b()});var h=g.getLogger("dashboard","agent.general.contact.dispose");function f(){return i(function(n){o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name,dialActive,dialMethod",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){v.queueCampaigns=e||{count:0,rows:[]},n()}).catch(function(e){h.error(e),s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})})}function b(){var e=v.dialerCall?Number(v.call["xmd-voicequeueid"]):v.queueCampaign?v.queueCampaign.id:v.call["xmd-campaignid"]?Number(v.call["xmd-campaignid"]):null;if(e)o.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,_.isNil(v.contact.dialTimezone)&&(v.contact.dialTimezone=v.hopper.dialTimezone),n)o.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}});else{o.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledAt=moment(v.hopper.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}function A(){var e=v.selectedDisposition?v.selectedDisposition.name.toLowerCase():void 0;return{id:v.call.uniqueid,disposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,secondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,thirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?d.getCurrentUser().id:null,OwnerId:d.getCurrentUser().id}}function E(e){t.hide([e,v.autoClose])}v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]?(v.dialerCall=!0,o.voiceQueue.getBlackLists({id:v.call.variables["xmd-voicequeueid"]}).$promise.then(function(e){e&&e.rows&&0<e.rows.length&&(v.hasBlackLists=!0)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})):f(),v.onDispositionChange=function(e){switch(e){case"first":v.selectedDisposition=v.firstLevelDisposition,v.anySecondLevelDisposition=_.some(v.dispositions,["ParentId",v.firstLevelDisposition.id]),v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.anyThirdLevelDisposition=!1;break;case"second":v.selectedDisposition=v.secondLevelDisposition,v.anyThirdLevelDisposition=_.some(v.dispositions,["ParentId",v.secondLevelDisposition.id]);break;case"third":v.selectedDisposition=v.thirdLevelDisposition}},v.clearDispositionSelection=function(e){"second"===e?(v.secondLevelDisposition=void 0,v.thirdLevelDisposition=void 0,v.selectedDisposition=v.firstLevelDisposition):"third"===e&&(v.thirdLevelDisposition=void 0,v.selectedDisposition=v.secondLevelDisposition)},v.saveDisposition=function(e){v.selectedDisposition=_.isNil(e)?v.selectedDisposition:{name:e},e&&(v.firstLevelDisposition=v.selectedDisposition);v.call.note=v.note,o.voiceCallReport.update({id:v.call.uniqueid,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null,note:v.note,UserId:d.getCurrentUser().id,ContactId:v.contact.id}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.voiceRecording.get({uniqueid:v.call.uniqueid}).$promise.then(function(e){if(e)for(var n=0;n<e.rows.length;n+=1)o.voiceRecording.update({id:e.rows[n].id,userDisposition:v.firstLevelDisposition?v.firstLevelDisposition.name:null,userSecondDisposition:v.secondLevelDisposition?v.secondLevelDisposition.name:null,userThirdDisposition:v.thirdLevelDisposition?v.thirdLevelDisposition.name:null}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),v.dialerCall&&(o.cmHopperFinal.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.cmHopperHistory.update(A()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}));if(_.isNil(v.selectedDisposition))E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"");else switch(v.selectedDisposition.name.toLowerCase()){case"blacklist":v.call&&v.call.variables&&v.call.variables["xmd-voicequeueid"]&&function(e){if(e)o.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var n=[];if(e&&0<e.count){for(var t=0;t<e.rows.length;t+=1){var a=angular.copy(v.contact);delete a.id,a.ListId=e.rows[t].id,n.push(o.cmContact.save(a).$promise)}return i.all(n)}s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.NOTAVAILABLE")+" "+v.selectedDisposition}),v.selectedDisposition=void 0}).then(function(e){e&&E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}(v.call.variables["xmd-voicequeueid"]);break;case"reschedule":v.isReschedule=!0,v.recallme=!1;break;case"recallme":v.isReschedule=!0,v.recallme=!0,v.user.selectRecallMeCampaign&&f().then(function(){v.originalCampaign=_.find(v.queueCampaigns.rows,["id",v.call.variables["xmd-voicequeueid"]]);var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));v.queueCampaign=e.previewCampaignId?_.find(v.queueCampaigns.rows,["id",Number(e.previewCampaignId)]):v.originalCampaign});break;default:E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}},v.closeDialog=function(){t.cancel()},v.saveReschedule=function(){v.disable=!0;var e=null;v.queueCampaign?e=v.queueCampaign.id:v.dialerCall&&(e=Number(v.call["xmd-voicequeueid"]));return o.cmHopper.save({phone:v.contact.phone,UserId:v.recallme?d.getCurrentUser().id:null,ContactId:v.contact.id,ListId:v.contact.ListId,VoiceQueueId:e,scheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),dialTimezone:v.contact.dialTimezone,priority:3,recallme:v.recallme,OwnerId:d.getCurrentUser().id}).$promise.then(function(e){o.cmContact.rescheduleAdditionalPhones({id:v.contact.id,hopperId:e.id}).$promise.catch(function(e){console.log(e)})}).then(function(){if(v.dialerCall&&(o.cmHopperFinal.update({id:v.call.uniqueid,rescheduled:!0,rescheduledat:moment(v.hopper.scheduledAt).format("YYYY-MM-DD HH:mm:ss"),recallme:v.recallme}).$promise.catch(function(e){h.error(e)}),v.user.selectRecallMeCampaign)){var e=JSON.parse(n.localStorage.getItem("motion2.user:"+v.user.id));e.previewCampaignId=v.queueCampaign.id,n.localStorage.setItem("motion2.user:"+v.user.id,JSON.stringify(e))}}).then(function(){return o.cmContact.update({id:v.contact.id,dialTimezone:v.contact.dialTimezone})}).then(function(){s.success({title:c.instant("DASHBOARDS.INFO"),msg:c.instant("DASHBOARDS.CALL_DISPOSED")+" "+(v.recallme?c.instant("DASHBOARDS.RECALLME"):c.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){h.error(e),E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")}).finally(function(){v.disable=!1,E(v.selectedDisposition?v.selectedDisposition.name.toUpperCase():"")})}}e.$inject=["$window","$mdDialog","$q","toasty","api","dispositions","globalDispositions","call","contact","Auth","$translate","availableCalls","autoClose","$scope","ClientSideLoggingService"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,o.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c,OwnerId:d.getCurrentUser().id}).$promise.then(function(){o.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){s.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s){var o=this;o.callNumber=i,o.page=1,o.onInit=function(){n.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){o.lists=_.chain(e.rows).keyBy("id").mapValues("name").value(),n.cmCustomField.get({fields:"id,alias",nolimit:!0}).$promise.then(function(e){o.customFields=e.rows,o.contacts=_.map(t,function(t){return Object.keys(t).forEach(function(e){if(Number(t[e])===Number(o.callNumber))if(e.startsWith("cf_")){var n=_.find(o.customFields,["id",Number(_.trimStart(e,"cf_"))]);t.matchingField=n?n.alias:a.instant("DASHBOARDS.UNKNOWN")}else t.matchingField=e}),t})})}).then(function(){o.paginatedContacts=_.chunk(t,4)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectContact=function(){e.hide(o.selectedContact)}}e.$inject=["$mdDialog","$translate","api","contacts","callNumber","toasty"],angular.module("app.dashboards").controller("ContactSelectionController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.bull.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition,note",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null,note:e.note||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"outbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(n,t,e,a){var i=this;function s(e,n){switch(e){case"first":i.selectedDisposition=i.firstLevelDisposition,i.anySecondLevelDisposition=_.some(i.dispositions,["ParentId",i.firstLevelDisposition.id]),i.secondLevelDisposition=void 0,i.thirdLevelDisposition=void 0,i.anyThirdLevelDisposition=!1;break;case"second":i.selectedDisposition=i.secondLevelDisposition,i.anyThirdLevelDisposition=_.some(i.dispositions,["ParentId",i.secondLevelDisposition.id]);break;case"third":i.selectedDisposition=i.thirdLevelDisposition}n&&function(e){switch(e){case"first":i.call.secondDisposition&&(i.secondLevelDisposition=_.find(i.dispositions,function(e){return e.name===i.call.secondDisposition&&e.ParentId===i.firstLevelDisposition.id}),i.secondLevelDisposition&&s("second",!0));break;case"second":i.call.thirdDisposition&&(i.thirdLevelDisposition=_.find(i.dispositions,function(e){return e.name===i.call.thirdDisposition&e.ParentId===i.secondLevelDisposition.id}),i.thirdLevelDisposition&&s("third",!0))}}(e)}i.dispositions=e,i.call=a,i.note=i.call.note||void 0,i.onDispositionChange=s,i.clearDispositionSelection=function(e){"second"===e?(i.secondLevelDisposition=void 0,i.thirdLevelDisposition=void 0,i.selectedDisposition=i.firstLevelDisposition):"third"===e&&(i.thirdLevelDisposition=void 0,i.selectedDisposition=i.secondLevelDisposition);n.disposition.$setDirty()},i.saveDisposition=function(){i.call.note=i.note;var e={firstLevel:i.firstLevelDisposition?i.firstLevelDisposition.name:void 0,secondLevel:i.secondLevelDisposition?i.secondLevelDisposition.name:void 0,thirdLevel:i.thirdLevelDisposition?i.thirdLevelDisposition.name:void 0,note:i.note?i.note:void 0};t.hide(e)},i.closeDialog=function(){t.cancel()},i.call.disposition&&(i.firstLevelDisposition=_.find(i.dispositions,function(e){return e.name===i.call.disposition}),i.firstLevelDisposition&&s("first",!0))}e.$inject=["$scope","$mdDialog","dispositions","call"],angular.module("app.dashboards").controller("DisposeAbandonedCallDialogController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d){var c=this;function m(){return o.disposition.get({fields:"createdAt,updatedAt,id,name,level,ParentId",sort:"name",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise.then(function(e){return c.dispositions=e?e.rows:[],o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise}).then(function(e){c.queues=e||{count:0,rows:[]},c.queuesMap=_.mapValues(_.keyBy(c.queues.rows,"name"),"name"),c.defaultQueues=c.queues.rows?_.map(c.queues.rows,"name").join(","):void 0}).then(function(){c.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:c.currentUser.name,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:c.queues.rows,ngValue:"name",clearAll:!1}]}).catch(function(e){console.log(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id);if(e)(e=JSON.parse(e)).query&&(c.query=_.merge(e.query,c.query));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};c.query.createdAt=n}c.isSearchBarVisible=!!c.query.filter,u()})}function u(){c.query.queue=c.query.queue||c.defaultQueues.split(","),c.query.offset=(c.query.page-1)*c.query.limit;var e={query:c.query};t.localStorage.setItem("motion2.home.abandoned.voice.calls:"+c.currentUser.id,JSON.stringify(e)),c.promise=o.voiceQueueReport.getVoiceQueuesReport(c.query,p).$promise}function p(e){c.abandonedCalls=e||{count:0,rows:[]},c.refresh=!0}c.showTooltip=!1,c.refresh=!0,c.disable=[],c.dispositions={count:0,rows:[]},c.currentUser=r.getCurrentUser(),c.queues={},c.abandonedCalls={count:0,rows:[]},c.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition,note",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},c.getAbandonedCalls=u,c.refreshAbandonedCalls=function(){c.showTooltip=!1,u()},c.onInit=m,c.reserved=function(e){e&&(c.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?c.currentUser.name:null,assigned:e.assigned}).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[e.id]=!1,e.lastAssignedTo=e.assigned?c.currentUser.name:null}))},c.dispose=function(t){a.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(i.body),targetEvent:t,locals:{dispositions:c.dispositions,call:t}}).then(function(e){if(e){c.disable[t.id]=!0;var n={id:t.id,lastAssignedTo:t.assigned?c.currentUser.name:null,assigned:t.assigned,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null,note:e.note||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)}).finally(function(){c.disable[t.id]=!1,t.disposition=e.firstLevel,t.secondDisposition=e.secondLevel,t.thirdDisposition=e.thirdLevel})}})},c.call=e.$parent.$parent.$parent.$parent.vm.call,c.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,c.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,c.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",function(e){c.queuesMap&&"inbound"===e.type&&c.queuesMap[e.queue]&&(c.showTooltip=!0)}),l.onWithoutApply("voiceQueueReport:update",function(e){if(e){var n=_.findIndex(c.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(c.abandonedCalls.rows[n],e)}}),m(),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(n,a,t,e,i){var s=this;function o(){var e=angular.element(".agent-general-home-navbar button.current")[0];e&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}s.user=t.getCurrentUser(),s.license={},s.plugin={},s.setting={},s.sidebar="dashboard",s.draftManager=i,s.navigation=e.getNavigation(),s.addContactTab=n.$parent.vm.addContactTab,s.addInteractionTab=n.$parent.vm.addInteractionTab,s.init=function(e,n){s.license=e,s.setting=n;var t=a.localStorage.getItem("motion2.home:"+s.user.id);if(t){try{t=JSON.parse(t),s.sidebar=t.currentSidebarTab?t.currentSidebarTab:"dashboard"}catch(e){console.error(e),s.sidebar="dashboard"}"mail"===s.sidebar&&s.draftManager.init()}},s.changeSidebarTab=function(e){s.sidebar=e.view,"plugin"===s.sidebar&&(s.plugin=e.stateParams,s.pluginId=e.id,n.$broadcast("pluginUpdated",{plugin:s.plugin}));a.localStorage.setItem("motion2.home:"+s.user.id,JSON.stringify({currentSidebarTab:e.view}))},s.hasPermission=function(e){return t.hasPermission(e)},angular.element(a).on("resize",o),n.$on("$destroy",function(){angular.element(a).off("resize",o)}),n.$watch("vm_home.sidebar",function(e,n){"mail"===e?s.draftManager.init():s.draftManager.drafts={}})}e.$inject=["$scope","$window","Auth","msNavigationAgentService","draftManager"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(t,n,i,s,a,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.chatInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,ChatWebsiteId:[]},g.sectionColor="green-A700",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getChatWebsites({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.chatAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Website",key:"ChatWebsiteId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.chatAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Customer Ip",column:"customerIp",type:"text",options:{excludedOperators:["$eq","$ne","$startsWith","$endsWith"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Website",column:"ChatWebsiteId",type:"multiselect",options:{route:{model:"user",action:"getChatWebsites",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("chat",g.query,g.user.id,g.chatAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("chatInteraction:save",O),d.on("chatInteraction:update",O),d.on("chatInteractionTags:save",C),d.on("chatMessage:save",w),d.on("chatMessage:update",w),d.on("user_has_chat_interactions:save",T),d.on("user_has_chat_interactions:remove",I),d.on("userChatWebsite:save",f),d.on("userChatWebsite:remove",b),0<g.setting.chatInteractionsReloadTimeout&&R()})},g.success=E,g.getChatInteractions=y,g.showChatInteraction=function(e,n){t.$parent.vm.addInteractionTab("chat",n)},g.downloadChatInteraction=function(e,s,n){r.chatInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="chat-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadChatInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"chat",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.chat"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.chat");function h(e){return{accounts:g.chatAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.ChatWebsiteId);u.addAccount("chat",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.ChatWebsiteId);u.removeAccount("chat",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.chatAccounts.rows,function(e){return{model:"chatWebsite",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.chatInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.chatInteractions=e||{count:0,rows:[]};for(var n=0;n<g.chatInteractions.rows.length;n+=1)S(g.chatInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=a.localStorage.getItem("motion2.home.chat:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,a.localStorage.setItem("motion2.home.chat:"+g.user.id,JSON.stringify(n)),g.promise=r.chatInteraction.get(g.query,E).$promise}function S(e){"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.chatInteractions.rows,{id:e.ChatInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.chatInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.chatInteractions.rows=_.orderBy(g.chatInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.chatInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.chatInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.chatInteractions.rows,{id:e.ChatInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.chatInteractionsReloadTimeout)}t.$on("$destroy",function(){d.removeAllListeners("chatMessage:save"),d.removeAllListeners("chatMessage:update"),d.removeAllListeners("chatInteraction:save"),d.removeAllListeners("chatInteractionTags:save"),d.removeAllListeners("chatInteraction:update"),d.removeAllListeners("user_has_chat_interactions:save"),d.removeAllListeners("user_has_chat_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(t,n,e,a,i,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,o.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,i.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify(t)),l.promise=o.cmContact.get(l.query,d).$promise}l.currentUser=s.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){a.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){a.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e){return o.cmContact.get({id:e}).$promise.then(function(e){n.$parent.vm.addContactTab(e)})},l.call=n.$parent.vm.call,l.onInit=function(){o.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),o.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.log(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){a.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.contacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","$window","Auth","api","toasty"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,n){var t=n(function(){},999);e.$on("$destroy",function(){t&&(n.cancel(t),t=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,n){c.rpcVoiceQueues[n]&&(c.voiceQueues[n].waiting=c.rpcVoiceQueues[n].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,n){c.rpcChatQueues[n]&&(c.chatQueues[n].waiting=c.rpcChatQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.chatQueues[e.queue_id]&&(c.rpcChatQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveChatQueue),l.onWithoutApply("chatQueue:update",c.onUpdateChatQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveChatQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),o.rpc.getChatQueues().$promise.then(function(e){c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"chat"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,n){c.rpcFaxQueues[n]&&(c.faxQueues[n].waiting=c.rpcFaxQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.faxQueues[e.queue_id]&&(c.rpcFaxQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveFaxQueue),l.onWithoutApply("faxQueue:update",c.onUpdateFaxQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveFaxQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),o.rpc.getFaxQueues().$promise.then(function(e){c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"fax"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,n){c.rpcMailQueues[n]&&(c.mailQueues[n].waiting=c.rpcMailQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.mailQueues[e.queue_id]&&(c.rpcMailQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveMailQueue),l.onWithoutApply("mailQueue:update",c.onUpdateMailQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveMailQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),o.rpc.getMailQueues().$promise.then(function(e){c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"mail"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,n){c.rpcOpenchannelQueues[n]&&(c.openchannelQueues[n].waiting=c.rpcOpenchannelQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.openchannelQueues[e.queue_id]&&(c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveOpenchannelQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateOpenchannelQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),o.rpc.getOpenchannelQueues().$promise.then(function(e){c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"openchannel"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,n){c.rpcSmsQueues[n]&&(c.smsQueues[n].waiting=c.rpcSmsQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.smsQueues[e.queue_id]&&(c.rpcSmsQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveSmsQueue),l.onWithoutApply("smsQueue:update",c.onUpdateSmsQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveSmsQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),o.rpc.getSmsQueues().$promise.then(function(e){c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"sms"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this,c=["type","waiting","dialMethod","dialActive"];function m(e){d.voiceQueuesTotal=e.count?e.count:0,d.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(d.voiceQueues,function(e,n){d.rpcVoiceQueues[n]&&(d.voiceQueues[n].waiting=d.rpcVoiceQueues[n].waiting||0)})}d.voiceQueues={},d.voiceQueuesTotal=0,d.rpcVoiceQueues={},d.getVoiceQueues={},d.rpcVoiceQueuesChannels={},d.addVoiceQueuesChannels={},d.deleteVoiceQueuesChannels=[],d.load=!0,d.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},d.queryChannels={limit:10,page:1},d.success=m,d.getVoiceQueues=function(){d.query.offset=(d.query.page-1)*d.query.limit,d.promise=o.user.getQueues(d.query,m).$promise},d.getSize=function(e){return _.size(e)},d.onSaveQueue=function(e){d.voiceQueues[e.id]&&d.rpcVoiceQueues[e.id]&&(d.rpcVoiceQueues[e.id]=e,_.merge(d.voiceQueues[e.id],_.pick(e,c)))},d.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete d.rpcVoiceQueuesChannels[e.uniqueid],d.load&&d.deleteVoiceQueuesChannels.push(e.uniqueid)):(d.rpcVoiceQueuesChannels[e.uniqueid]=e,d.load&&(d.addVoiceQueuesChannels[e.uniqueid]=e)))},d.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&d.getVoiceQueues()},d.onSaveVoiceQueue=function(e){_.isNil(e)||(d.rpcVoiceQueues[e.id]=_.pick(e,c))},d.onUpdateVoiceQueue=function(e){_.isNil(e)||(d.rpcVoiceQueues[e.id]&&_.merge(d.rpcVoiceQueues[e.id],_.pick(e,c)),d.voiceQueues[e.id]&&_.merge(d.voiceQueues[e.id],_.pick(e,c)))},d.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete d.rpcVoiceQueues[e.id],delete d.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",d.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",d.onSaveChannel),l.onWithoutApply("voice_queue_channel:remove",function(e){"inbound"===e.type&&delete d.rpcVoiceQueuesChannels[e.uniqueid]}),l.onWithoutApply("userVoiceQueue:save",d.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",d.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",d.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",d.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",d.onUpdateVoiceQueue),o.user.getQueues(d.query).$promise.then(function(e){return d.myQueues=e,d.myQueues.count=e.rows.length,o.rpc.getVoiceQueues().$promise}).then(function(e){for(var n=e.rows,t=_.keyBy(n,"id"),a=0;a<d.myQueues.count;a++){var i=d.myQueues.rows[a];d.rpcVoiceQueues[i.id]=t[i.id]}return o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){d.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,function(e){return!("inbound"!==e.type||e.queuecallerleaveAt||!_.find(d.myQueues.rows,{name:e.queue}))}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(d.rpcVoiceQueuesChannels,d.addVoiceQueuesChannels);for(var e=0;e<d.deleteVoiceQueuesChannels.length;e+=1)delete d.rpcVoiceQueuesChannels[d.deleteVoiceQueuesChannels[e]];d.load=!1,d.addVoiceQueuesChannels={},d.deleteVoiceQueuesChannels=[],d.getVoiceQueues()});var u=!0,p=1;e.$watch("vm_dc.query.filter",function(e,n){u?t(function(){u=!1}):(n||(p=d.query.page),e!==n&&(d.query.page=1),e||(d.query.page=p),d.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcWhatsappQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.whatsappQueuesTotal=e.count?e.count:0,c.whatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.whatsappQueues,function(e,n){c.rpcWhatsappQueues[n]&&(c.whatsappQueues[n].waiting=c.rpcWhatsappQueues[n].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.whatsappQueues={},c.whatsappQueuesTotal=0,c.rpcWhatsappQueues={},c.paginatedInteractions=[],c.deleteWhatsappQueuesWaitingInteractions=[],c.rpcWhatsappQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"whatsapp",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getWhatsappQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"whatsapp":return"lime-A700-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.whatsappQueues[e.id]&&c.rpcWhatsappQueues[e.id]&&(_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onSaveWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]=_.pick(e,m))},c.onUpdateWhatsappQueue=function(e){_.isNil(e)||(c.rpcWhatsappQueues[e.id]&&_.merge(c.rpcWhatsappQueues[e.id],_.pick(e,m)),c.whatsappQueues[e.id]&&_.merge(c.whatsappQueues[e.id],_.pick(e,m)))},c.onRemoveWhatsappQueue=function(e){_.isNil(e)||(delete c.rpcWhatsappQueues[e.id],delete c.whatsappQueues[e.id])},c.onSaveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onRemoveUserWhatsappQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getWhatsappQueues()},c.onSaveWhatsappQueueChannel=function(e){c.whatsappQueues[e.queue_id]&&(c.rpcWhatsappQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveWhatsappQueueChannel=function(e){delete c.rpcWhatsappQueuesWaitingInteractions[e.id],u&&c.deleteWhatsappQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("whatsapp_queue:save",c.onSaveQueue),l.onWithoutApply("whatsappQueue:save",c.onSaveWhatsappQueue),l.onWithoutApply("whatsappQueue:update",c.onUpdateWhatsappQueue),l.onWithoutApply("whatsappQueue:remove",c.onRemoveWhatsappQueue),l.onWithoutApply("userWhatsappQueue:save",c.onSaveUserWhatsappQueue),l.onWithoutApply("userWhatsappQueue:remove",c.onRemoveUserWhatsappQueue),l.onWithoutApply("whatsapp_queue_waiting_interaction:save",c.onSaveWhatsappQueueChannel),l.onWithoutApply("whatsapp_queue_waiting_interaction:remove",c.onRemoveWhatsappQueueChannel),o.rpc.getWhatsappQueues().$promise.then(function(e){c.rpcWhatsappQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"whatsapp"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getWhatsappQueuesWaitingInteractions().$promise}).then(function(e){var n=_.filter(e.rows,function(e){return _.find(c.myQueues,{id:e.queue_id})});e.rows=n,e.count=n.length,_.merge(c.rpcWhatsappQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteWhatsappQueuesWaitingInteractions.length;e+=1)delete c.rpcWhatsappQueuesWaitingInteractions[c.deleteWhatsappQueuesWaitingInteractions[e]];u=!1,c.deleteWhatsappQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),c.getWhatsappQueues())}),e.$on("$destroy",function(){l.removeAllListeners("whatsapp_queue:save"),l.removeAllListeners("whatsappQueue:save"),l.removeAllListeners("whatsappQueue:update"),l.removeAllListeners("whatsappQueue:remove"),l.removeAllListeners("userWhatsappQueue:save"),l.removeAllListeners("userWhatsappQueue:remove"),l.removeAllListeners("whatsapp_queue_waiting_interaction:save"),l.removeAllListeners("whatsapp_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelWhatsappController",e)}(),function(){"use strict";function e(a,t,i,s,o,n,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.faxInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,FaxAccountId:[]},g.sectionColor="blue-grey",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getFaxAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.faxAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"FaxAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.faxAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"FaxAccountId",type:"multiselect",options:{route:{model:"user",action:"getFaxAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("fax",g.query,g.user.id,g.faxAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("faxInteraction:save",O),d.on("faxInteraction:update",O),d.on("faxInteractionTags:save",C),d.on("faxMessage:save",w),d.on("faxMessage:update",w),d.on("user_has_fax_interactions:save",T),d.on("user_has_fax_interactions:remove",I),d.on("userFaxAccount:save",f),d.on("userFaxAccount:remove",b)})},g.success=E,g.getFaxInteractions=y,g.showFaxInteraction=function(e,n){a.$parent.vm.addInteractionTab("fax",n)},g.downloadFaxInteraction=function(e,s,n){r.faxInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="fax-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadFaxInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"fax",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?n.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return n.instant("DASHBOARDS.NOT_ASSIGNED")},g.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return n.instant("DASHBOARDS.UNKNOWN")},g.composeFaxInteraction=function(e,t){i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.faxAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.fax"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.fax");function h(e){return{accounts:g.faxAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.FaxAccountId);u.addAccount("fax",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.FaxAccountId);u.removeAccount("fax",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.faxAccounts.rows,function(e){return{model:"faxAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.faxInteractionsReloadTimeout&&function(e){e&&g.interactionsInterval&&t.cancel(g.interactionsInterval);g.interactionsInterval=t(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.faxInteractionsReloadTimeout)}(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.faxInteractions=e||{count:0,rows:[]};for(var n=0;n<g.faxInteractions.rows.length;n+=1)S(g.faxInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=o.localStorage.getItem("motion2.home.fax:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,o.localStorage.setItem("motion2.home.fax:"+g.user.id,JSON.stringify(n)),g.promise=r.faxInteraction.get(g.query,E).$promise}function S(e){e.contactInfo=e.Contact?e.Contact.fax:void 0,"Unknown"===e.contactName&&(e.contactName=n.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.faxInteractions.rows,{id:e.FaxInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.faxInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.faxInteractions.rows=_.orderBy(g.faxInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else y(g.query.page)}}function C(e){if(e){var n=_.find(g.faxInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.faxInteractions.rows,{id:e.FaxInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}a.$on("$destroy",function(){d.removeAllListeners("faxMessage:save"),d.removeAllListeners("faxMessage:update"),d.removeAllListeners("faxInteraction:save"),d.removeAllListeners("faxInteractionTags:save"),d.removeAllListeners("faxInteraction:update"),d.removeAllListeners("user_has_fax_interactions:save"),d.removeAllListeners("user_has_fax_interactions:remove"),g.interactionsInterval&&t.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(o,n,r,l,m,t,e,d,a,i,c,u,s,p,g){var v=this;v.user=a.getCurrentUser(),v.license={},v.setting={},v.tags={count:0,rows:[]},v.mailInteractions={count:0,rows:[]},v.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,MailAccountId:[]},v.sectionColor="teal",v.onInit=function(e,n){return v.license=e,v.setting=n,d.user.getMailAccounts({id:v.user.id,nolimit:!0}).$promise.then(function(e){return v.mailAccounts=e||{count:0,rows:[]},d.tag.get({sort:"name"}).$promise}).then(function(e){v.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){v.subStatuses=e||{count:0,rows:[]}}).then(function(){v.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:v.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Account",key:"MailAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:v.mailAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:v.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:v.tags.rows,placeholder:"DASHBOARDS.TAGS"}],v.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"MailAccountId",type:"multiselect",options:{route:{model:"user",action:"getMailAccounts",params:{id:v.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:E("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:E("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:E("third")}}]}}).catch(function(e){h.error(e)}).finally(function(){s.parseInteractionsKey("mail",v.query,v.user.id,v.mailAccounts.rows).then(function(){v.isSearchBarVisible=!(v.query.search||!v.query.filter),S(v.query.page)}),i.on("mailInteraction:save",w),i.on("mailInteraction:update",w),i.on("mailInteractionTags:save",R),i.on("mailMessage:save",x),i.on("mailMessage:update",x),i.on("user_has_mail_interactions:save",O),i.on("user_has_mail_interactions:remove",C),i.on("userMailAccount:save",b),i.on("userMailAccount:remove",A),0<v.setting.mailInteractionsReloadTimeout&&N()})},v.success=y,v.getMailInteractions=S,v.showMailInteraction=T,v.downloadMailInteraction=function(e,s,n){d.mailInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mail-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadMailInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.disposeInteraction=function(e,n){var t=v.user.voicePause||v.user.chatPause||v.user.mailPause||v.user.openchannelPause||v.user.faxPause,a=!n.Account.mandatoryDisposition;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){v.user&&n.Account.mandatoryDisposition&&!t&&d.user.unpause({id:v.user.id}).$promise.catch(function(e){h.error(e)})},locals:{user:v.user,channel:"mail",interaction:n}})},v.getContactLabel=I,v.getAgentLabel=function(e){if(e.UserId)return e.UserId===v.user.id?t.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return t.instant("DASHBOARDS.NOT_ASSIGNED")},v.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return t.instant("DASHBOARDS.UNKNOWN")},v.composeMailInteraction=function(e,s){r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.id},i).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.mandatoryDisposition,a=v.user.voicePause||v.user.chatPause||v.user.mailPause||v.user.openchannelPause||v.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(){v.user&&s.mandatoryDisposition&&!a&&d.user.unpause({id:v.user.id}).$promise.catch(function(e){h.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:v.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={channel:"mail",account:s,message:e.message,contact:e.contact};u.add(n)}})},v.openAdvancedSearch=function(){r.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{color:v.sectionColor,fields:v.advancedSearch.fields,storagePath:"home.mail"},fullscreen:!0}).then(function(e){v.isSearchBarVisible=!(e.value||!v.query.filter),e.apply&&(v.query.search=e.value,S())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var h=g.getLogger("agent.general.mail");function f(e){return{accounts:v.mailAccounts,accountId:e,filters:v.quickFilters,query:v.query,userId:v.user.id}}function b(e){if(e.UserId===v.user.id){var n=f(e.MailAccountId);p.addAccount("mail",n).then(function(e){e&&S()}).catch(function(e){h.error(e)})}}function A(e){if(e.UserId===v.user.id){var n=f(e.MailAccountId);p.removeAccount("mail",n).catch(function(e){h.error(e)})}}function E(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(v.mailAccounts.rows,function(e){return{model:"mailAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function y(e){!v.reloadingInteractions&&0<v.setting.mailInteractionsReloadTimeout&&N(!0),v.searchInProgress=!1,v.reloadingInteractions=!1,v.mailInteractions=e||{count:0,rows:[]};for(var n=0;n<v.mailInteractions.rows.length;n+=1)I(v.mailInteractions.rows[n])}function S(e){v.searchInProgress=!0,e||(v.query.page=1),(void 0===v.query.closed||null===v.query.closed||v.query.closed)&&delete v.query.substatus,v.query.offset=(v.query.page-1)*v.query.limit;var n=m.localStorage.getItem("motion2.home.mail:"+v.user.id);(n=n?JSON.parse(n):{}).query=v.query,m.localStorage.setItem("motion2.home.mail:"+v.user.id,JSON.stringify(n)),v.promise=d.mailInteraction.get(v.query,y).$promise}function T(e,n){o.$parent.vm.addInteractionTab("mail",n)}function I(e){_.isEmpty(e.to)||!e.Account||_.includes(e.to,e.Account.email)?e.contactInfo=e.Contact?e.Contact.email:void 0:e.contactInfo=e.to.split("<").pop().split(">")[0],"Unknown"===e.contactName&&(e.contactName=t.instant("DASHBOARDS.UNKNOWN"))}function O(e){var n=_.find(v.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function C(e){var n=_.find(v.mailInteractions.rows,{id:e.MailInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function w(e){if(e){var n=_.find(v.mailInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),v.query.sort){var t=_.startsWith(v.query.sort,"-")?"desc":"asc";v.mailInteractions.rows=_.orderBy(v.mailInteractions.rows,_.trimStart(v.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===v.setting.mailInteractionsReloadTimeout&&S(v.query.page)}}function R(e){if(e){var n=_.find(v.mailInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function x(e){if(e&&!e.secret){var n=_.find(v.mailInteractions.rows,{id:e.MailInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function N(e){e&&v.interactionsInterval&&n.cancel(v.interactionsInterval),v.interactionsInterval=n(function(){v.reloadingInteractions=!0,v.searchInProgress||S()},1e3*v.setting.mailInteractionsReloadTimeout)}o.$on("openMailDraft",function(e,s){s.interaction?(s.interaction.isDraft=!0,T(null,s.interaction)):r.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(l.body),clickOutsideToClose:!1,locals:{account:s.account,message:s.content,type:"draft",interaction:{}},fullscreen:!0}).then(function(e){if(e){if(!e.message||!e.message.savedAsDraft){var i=e;return d.mailAccount.send({id:s.account.id},i).$promise.then(function(e){if(u.remove(s.id),e&&e.Messages&&e.Messages.length){if(i.attachments&&i.attachments.length)for(var n=0;n<i.attachments.length;n+=1)d.attachment.update({id:i.attachments[n].id},{MailMessageId:_.head(e.Messages).id});if(c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed){e.disposition=null;var t=!s.account.mandatoryDisposition,a=v.user.voicePause||v.user.chatPause||v.user.mailPause||v.user.openchannelPause||v.user.faxPause;r.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(l.body),onRemoving:function(){v.user&&s.account.mandatoryDisposition&&!a&&d.user.unpause({id:v.user.id}).$promise.catch(function(e){h.error(e)})},clickOutsideToClose:t,escapeToClose:t,locals:{user:v.user,channel:"mail",interaction:e}})}else o.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}var n={id:s.id,channel:"mail",account:e.account,message:e.message};u.update(n)}})}),v.resetTooltipPosition=function(e){var n=angular.element(e.currentTarget).children()[1],t=angular.element(n);t.css("top",""),t.css("left",""),t.css("bottom","")},v.adjustTooltipPosition=function(e){var n=angular.element(e.currentTarget).children(),t=n[0],a=n[1],i=angular.element(t),s=angular.element(a),o=m.innerHeight,r=i.offset(),l=r.top,d=r.left,c=o<216+l;s.css("left",d),c?(s.css("top",""),s.css("bottom",o-l)):(s.css("bottom",""),s.css("top",l))},o.$on("$destroy",function(){i.removeAllListeners("mailMessage:save"),i.removeAllListeners("mailMessage:update"),i.removeAllListeners("mailInteraction:save"),i.removeAllListeners("mailInteractionTags:save"),i.removeAllListeners("mailInteraction:update"),i.removeAllListeners("user_has_mail_interactions:save"),i.removeAllListeners("user_has_mail_interactions:remove"),v.interactionsInterval&&n.cancel(v.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","draftManager","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(t,a,e,i,n,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.contacts=e||{count:0,rows:[]}}function c(e,n){l.searchInProgress=!0,s.cmContact.describe({id:l.query.ListId}).$promise.then(function(e){return _(e.toJSON()).omit("UserId").values().map(function(e){return function(e){var n={name:_.startCase(e.displayName),column:e.columnName,options:{}};if(e.custom)switch(e.custom.type){case"text":n.type="text";break;case"select":n.type="multiselect",n.values=_.map(JSON.parse(e.custom.values),function(e,n){return{id:n,name:e.value,value:e.value}}),n.options.field="name";break;case"switch":n.type="select",n.values=[{id:1,translate:"DASHBOARDS.ENABLED"},{id:0,translate:"DASHBOARDS.DISABLED"}],n.options.excludedOperators=["$ne"];break;case"number":n.type="number";break;case"datetime":n.type="date"}else switch(e.columnName){case"dateOfBirth":n.type="date";break;case"CompanyId":n.name="Company",n.type="autocomplete",n.options.route={model:"cmCompany",action:"get",params:{fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;case"ListId":n.name="List",n.type="autocomplete",n.options.route={model:"user",action:"getLists",params:{id:l.currentUser.id,fields:"id,name",nolimit:!0}},n.options.searchFields=["name"],n.options.excludedOperators=["$ne"];break;default:_.includes(e.type.toLowerCase(),"int")?n.type="number":_.includes(e.type.toLowerCase(),"date")?n.type="date":n.type="text"}return n}(e)}).value()}).then(function(e){l.advancedSearch.fields=e;var n=_.findIndex(e,function(e){return _.startsWith(e.column,"cf_")})||e.length-1;n<0&&(n=e.length),l.advancedSearch.fields.splice(n,0,{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"DESCRIBE_CM_CONTACTS",msg:e.data?JSON.stringify(e.data.message):e.toString()})}),e||(l.query.page=1),l.query.offset=(l.query.page-1)*l.query.limit;var t=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);(t=t?JSON.parse(t):{}).query=l.query,o.localStorage.setItem("motion2.home.mycontacts:"+l.currentUser.id,JSON.stringify(t)),l.query.search&&(l.advancedQuery=_.omit(l.query,"id")),l.promise=l.query.search?s.cmContact.get(l.advancedQuery,d).$promise:s.user.getContacts(l.query,d).$promise}l.currentUser=n.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,id:l.currentUser.id,sort:"-updatedAt",limit:10,page:1},l.advancedSearch={fields:[]},l.sectionColor="red",l.getContacts=c,l.refreshContacts=function(){c()},l.mergeContact=function(e,n){i.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,n){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:n.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e,n){a.$parent.vm.addContactTab(n)},l.call=a.$parent.vm.call,l.onInit=function(){s.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),s.tag.get({sort:"name"}).$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"List",key:"ListId",type:"multiselect",label:"CONTACTMANAGER.SELECT_LIST",options:l.lists.rows,clearAll:!1},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:l.tags.rows,placeholder:"DASHBOARDS.TAGS"}]}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.mycontacts:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query),_.isEmpty(l.lists.rows)?l.query.ListId=[]:_.isEmpty(l.query.ListId)&&(l.query.ListId=_(l.lists.rows).map("id").take().value()))}catch(e){console.error(e)}else l.query.ListId=_.map(l.lists.rows,"id");l.isSearchBarVisible=!(l.query.search||!l.query.filter),c()})},l.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{color:l.sectionColor,fields:l.advancedSearch.fields,storagePath:"home.mycontacts"},fullscreen:!0}).then(function(e){l.isSearchBarVisible=!(e.value||!l.query.filter),e.apply&&(l.query.search=e.value?e.value+="||User:=$eq["+l.currentUser.id+"]":e.value,c())}).catch(function(e){r.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window","toasty"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(a,n,i,s,t,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.openchannelInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,OpenchannelAccountId:[]},g.sectionColor="amber",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getOpenchannelAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.openchannelAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"OpenchannelAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.openchannelAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"OpenchannelAccountId",type:"multiselect",options:{route:{model:"user",action:"getOpenchannelAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("openchannel",g.query,g.user.id,g.openchannelAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("openchannelInteraction:save",O),d.on("openchannelInteraction:update",O),d.on("openchannelInteractionTags:save",C),d.on("openchannelMessage:save",w),d.on("openchannelMessage:update",w),d.on("user_has_openchannel_interactions:save",T),d.on("user_has_openchannel_interactions:remove",I),d.on("userOpenchannelAccount:save",f),d.on("userOpenchannelAccount:remove",b),0<g.setting.openchannelInteractionsReloadTimeout&&R()})},g.success=E,g.getOpenchannelInteractions=y,g.showOpenchannelInteraction=function(e,n){a.$parent.vm.addInteractionTab("openchannel",n)},g.downloadOpenchannelInteraction=function(e,s,n){r.openchannelInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="openchannel-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadOpenchannelInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"openchannel",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.composeOpenchannelInteraction=function(e,t){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.openchannelAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("openchannel",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"OPENCHANNELACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.openchannel"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.openchannel");function h(e){return{accounts:g.openchannelAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.OpenchannelAccountId);u.addAccount("openchannel",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.OpenchannelAccountId);u.removeAccount("openchannel",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.openchannelAccounts.rows,function(e){return{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.openchannelInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.openchannelInteractions=e||{count:0,rows:[]};for(var n=0;n<g.openchannelInteractions.rows.length;n+=1)S(g.openchannelInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=t.localStorage.getItem("motion2.home.openchannel:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,t.localStorage.setItem("motion2.home.openchannel:"+g.user.id,JSON.stringify(n)),g.promise=r.openchannelInteraction.get(g.query,E).$promise}function S(e){"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.openchannelInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.openchannelInteractions.rows=_.orderBy(g.openchannelInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.openchannelInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.openchannelInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.openchannelInteractionsReloadTimeout)}a.$on("$destroy",function(){d.removeAllListeners("openchannelMessage:save"),d.removeAllListeners("openchannelMessage:update"),d.removeAllListeners("openchannelInteraction:save"),d.removeAllListeners("openchannelInteractionTags:save"),d.removeAllListeners("openchannelInteraction:update"),d.removeAllListeners("user_has_openchannel_interactions:save"),d.removeAllListeners("user_has_openchannel_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e,n,t){d.license=e,d.setting=n,d.plugin=t}d.currentUser=o.getCurrentUser(),d.plugin={},d.onInit=c,d.getTrustedURL=function(){return s.trustAsResourceUrl(d.plugin.agentUrl)},c(),n.$on("pluginUpdated",function(e,n){d.plugin=n.plugin})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","$sce","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(){d.agentsQuery.offset=(d.agentsQuery.page-1)*d.agentsQuery.limit,l.update("motion2.home.presence.agents:"+d.currentUser.id,d.agentsQuery,"query"),i.user.getPresence(d.agentsQuery).$promise.then(function(e){d.agents={count:e.count,rows:_.filter(e.rows,function(e){return e.id!==d.currentUser.id})}}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function m(){d.queuesQuery.offset=(d.queuesQuery.page-1)*d.queuesQuery.limit,l.update("motion2.home.presence.queues:"+d.currentUser.id,d.queuesQuery,"query"),i.voiceQueue.get(d.queuesQuery).$promise.then(function(e){return d.voiceQueues=e||{rows:[],count:0},i.rpc.getVoiceQueuesChannels().$promise.then(function(e){e.rows.forEach(function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);n&&(n.calls||(n.calls=[]),n.calls.push(e))})})}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")})})}function u(e){return 0===d.selectedTab?e:"xcallyQueueExtension"+e}function p(e,n,t,a){var i=_.find(d.agents.rows,["id",e]);i&&(i.status=!1===n?"offline":a?"pause":"unavailable"===t?t:_.includes(["idle","unknown","ringing",null,void 0],t)?"online":"busy")}function g(e){e.id!==d.currentUser.id&&p(e.id,e.online,e.voiceStatus,e.voicePause)}d.currentUser=s.getCurrentUser(),d.agents={count:0,rows:[]},d.agentsQuery={fields:"id,name,internal,online",role:"agent",sort:"name",limit:10,page:1},d.queuesQuery={fields:"id,name",type:"inbound",sort:"name",limit:10,page:1},d.onAgentsTabSelection=function(){if(d.agentsQuery.filter||d.agentsQuery.teams||d.agentsQuery.queues)return;_.merge(d.agentsQuery,l.get("motion2.home.presence.agents:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.agentsQuery.filter,a.all([a(function(n,e){i.team.get({fields:"id,name",sort:"name",nolimit:!0}).$promise.then(function(e){d.teams=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("STAFF.TEAMS"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})}),a(function(n,e){i.voiceQueue.get({fields:"id,name",type:"inbound",sort:"name",nolimit:!0}).$promise.then(function(e){d.queues=e||{rows:[],count:0},n()}).catch(function(){r.error({title:t.instant("VOICE.VOICEQUEUES"),msg:t.instant("CONTACTMANAGER.NOTIFICATIONS.NO_DATA_ERROR")}),e()})})]).then(function(){d.quickFilters=[{name:"Team",key:"teams",type:"multiselect",label:"DASHBOARDS.SELECT_TEAM",options:d.teams.rows},{name:"Queue",key:"queues",type:"multiselect",label:"DASHBOARDS.SELECT_QUEUE",options:d.queues.rows}],c()}).catch(function(){r.error({title:t.instant("DASHBOARDS.AGENT_PRESENCE"),msg:t.instant("DASHBOARDS.ERRORS.FAILED_INITIALIZATION")})})},d.onQueuesTabSelection=function(){if(d.queuesQuery.filter)return;_.merge(d.queuesQuery,l.get("motion2.home.presence.queues:"+d.currentUser.id,"query")),d.isSearchBarVisible=!!d.queuesQuery.filter,m()},d.getAgents=c,d.getVoiceQueues=m,d.originateCall=function(e){n.$broadcast("webrtc::call",{target:u(e)})},d.transferCall=function(e){n.$broadcast("webrtc::transfer",{target:u(e)})},o.on("user:presence",function(e){if(e.id===d.currentUser.id)return;p(e.id,e.online,e.voiceStatus,e.voicePause)}),o.on("user:update",g),o.on("voice_queue_presence:save",function(e){if(!d.voiceQueues&&d.voiceQueues.rows)return;var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;n.calls||(n.calls=[]);if(_.some(n.calls,["uniqueid",e.uniqueid]))return;n.calls.push(e)}),o.on("voice_queue_presence:remove",function(e){var n=_.find(d.voiceQueues.rows,["name",e.name]);if(!n)return;_.remove(n.calls,["uniqueid",e.uniqueid])}),e.$on("$destroy",function(){o.removeListener("user:update",g),o.removeAllListeners("user:presence"),o.removeAllListeners("voice_queue_presence:save"),o.removeAllListeners("voice_queue_presence:remove")})}e.$inject=["$scope","$rootScope","$translate","$q","api","Auth","socket","toasty","localStorageManager"],angular.module("app.dashboards").controller("AgentHomePresenceController",e)}(),function(){"use strict";function e(e,t,n,a,o,i){var s=this;function r(e){s.searchInProgress=!1,s.voiceRecordings=e||{count:0,rows:[]}}function l(){s.searchInProgress=!0,s.query.offset=(s.query.page-1)*s.query.limit;var e={query:s.query};t.localStorage.setItem("motion2.home.recordings:"+s.currentUser.id,JSON.stringify(e)),s.promise=a.voiceRecording.get(s.query,r).$promise}s.currentUser=i.getCurrentUser(),s.voiceRecordings={},s.table="voiceRecordings",s.query={UserId:s.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,transcribeStatus,UserId",sort:"-updatedAt",limit:10,page:1,type:null},s.downloadfile=function(i,e){return a.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.downloadtranscribe=function(s,e){return a.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.success=r,s.getVoiceRecordings=l,s.onInit=function(){s.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}];var e=t.localStorage.getItem("motion2.home.recordings:"+s.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(s.query=_.merge(s.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};s.query.createdAt=n}s.isSearchBarVisible=!!s.query.filter,l()}}e.$inject=["$scope","$window","$timeout","api","toasty","Auth"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,r,n){var l=this;function d(e){l.searchInProgress=!1,l.scheduledCalls=e||{count:0,rows:[]}}l.currentUser=n.getCurrentUser(),l.priorities=["Lowest","Low","Medium","High","Highest"],l.crudPermissions={readOnly:!1,canEdit:!0,canDelete:!0},l.scheduledCalls={},l.query={id:l.currentUser.id,fields:"id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone",sort:"scheduledat",limit:10,page:1},l.queueCampaigns={rows:[],count:0},l.success=d,l.getScheduledCalls=function(){l.searchInProgress=!0,l.query.id=l.currentUser.id,l.query.includeAll=!0,l.query.offset=(l.query.page-1)*l.query.limit,l.query.fields="id,phone,scheduledat,recallme,priority,UserId,OwnerId,dialTimezone";var e={query:l.query};t.localStorage.setItem("motion2.home.scheduled:"+l.currentUser.id,JSON.stringify(e)),l.promise=r.user.getScheduledCalls(l.query,d).$promise},l.onInit=function(){r.user.getQueues({id:n.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){l.queueCampaigns=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"scheduledat",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Campaigns",key:"VoiceQueueId",type:"multiselect",label:"MOTIONDIALER.SELECT_CAMPAIGN",options:l.queueCampaigns.rows}]}).catch(function(e){console.error(e)}).finally(function(){var e=t.localStorage.getItem("motion2.home.scheduled:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.omit(e.query,["filter"]))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.scheduledat=n}l.getScheduledCalls()})},l.isDateBeforeToday=function(e){return moment(e).isBefore(moment())},l.createOrEditQueueCampaignHopper=function(e,n){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:null,hopper:n,hoppers:l.scheduledCalls.rows,license:null,setting:null,crudPermissions:l.crudPermissions}})},l.deleteConfirm=function(n,e){var t=i.confirm().title("Are you sure want to delete the scheduled call?").htmlContent("<b>Scheduled call</b> will be deleted.").ariaLabel("delete scheduled call").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){var e;e=n,r.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(l.scheduledCalls.rows,{id:e.id}),l.scheduledCalls.count-=1,l.scheduledCalls.rows.length||l.getScheduledCalls(),o.success({title:"Scheduled call deleted!",msg:e.name?"Scheduled call has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE_HOPPER"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETE_HOPPER",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})};var c=!0,m=1;e.$watch("vm.query.filter",function(e,n){c?a(function(){c=!1}):(n||(m=l.query.page),e!==n&&(l.query.page=1),e||(l.query.page=m),l.getScheduledCalls())})}e.$inject=["$scope","$window","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.dashboards").controller("AgentHomeScheduledCallsController",e)}(),function(){"use strict";function e(a,n,i,s,t,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.smsInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,SmsAccountId:[]},g.sectionColor="orange",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getSmsAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.smsAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"SmsAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.smsAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"SmsAccountId",type:"multiselect",options:{route:{model:"user",action:"getSmsAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("sms",g.query,g.user.id,g.smsAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("smsInteraction:save",O),d.on("smsInteraction:update",O),d.on("smsInteractionTags:save",C),d.on("smsMessage:save",w),d.on("smsMessage:update",w),d.on("user_has_sms_interactions:save",T),d.on("user_has_sms_interactions:remove",I),d.on("userSmsAccount:save",f),d.on("userSmsAccount:remove",b),0<g.setting.smsInteractionsReloadTimeout&&R()})},g.success=E,g.getSmsInteractions=y,g.showSmsInteraction=function(e,n){a.$parent.vm.addInteractionTab("sms",n)},g.downloadSmsInteraction=function(e,s,n){r.smsInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="sms-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadSmsInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"sms",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.smsAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.sms"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.sms");function h(e){return{accounts:g.smsAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.SmsAccountId);u.addAccount("sms",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.SmsAccountId);u.removeAccount("sms",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.smsAccounts.rows,function(e){return{model:"smsAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.smsInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.smsInteractions=e||{count:0,rows:[]};for(var n=0;n<g.smsInteractions.rows.length;n+=1)S(g.smsInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=t.localStorage.getItem("motion2.home.sms:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,t.localStorage.setItem("motion2.home.sms:"+g.user.id,JSON.stringify(n)),g.promise=r.smsInteraction.get(g.query,E).$promise}function S(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.smsInteractions.rows,{id:e.SmsInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.smsInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.smsInteractions.rows=_.orderBy(g.smsInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.smsInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.smsInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.smsInteractions.rows,{id:e.SmsInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.smsInteractionsReloadTimeout)}a.$on("$destroy",function(){d.removeAllListeners("smsMessage:save"),d.removeAllListeners("smsMessage:update"),d.removeAllListeners("smsInteraction:save"),d.removeAllListeners("smsInteractionTags:save"),d.removeAllListeners("smsInteraction:update"),d.removeAllListeners("user_has_sms_interactions:save"),d.removeAllListeners("user_has_sms_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r){var l=this;function d(e){l.searchInProgress=!1,l.voiceCalls=e||{count:0,rows:[]}}function c(){l.searchInProgress=!0,l.query.offset=(l.query.page-1)*l.query.limit;var e={query:l.query};s.localStorage.setItem("motion2.home.voice:"+l.currentUser.id,JSON.stringify(e)),l.promise=a.voiceCallReport.get(l.query,d).$promise}l.currentUser=e.getCurrentUser(),l.voiceCalls={},l.table="voiceCalls",l.query={UserId:l.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,userSecondDisposition,userThirdDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},l.success=d,l.getVoiceCalls=c,l.onInit=function(){return a.tag.get({sort:"name"}).$promise.then(function(e){l.tags=e||{count:0,rows:[]}}).then(function(){l.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Type",key:"type",type:"select",label:"VOICE.SELECT_TYPE",customOptions:[{value:"internal",translate:"VOICE.INTERNAL"},{value:"inbound",translate:"VOICE.INBOUND"},{value:"outbound",translate:"VOICE.OUTBOUND"},{value:"dialer",translate:"VOICE.DIALER"},{value:null,translate:"VOICE.ALL"}]}]}).catch(function(e){i.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),l.tags={count:0,rows:[]}}).finally(function(){var e=s.localStorage.getItem("motion2.home.voice:"+l.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(l.query=_.merge(l.query,e.query))}catch(e){console.error(e)}else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};l.query.createdAt=n}l.isSearchBarVisible=!!l.query.filter,c()})},l.showDetails=function(e){n.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,locals:{call:e}})}}e.$inject=["$mdDialog","$document","api","toasty","Auth","$window","$scope","$timeout"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,n){this.call=n,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(a,n,i,s,t,o,e,r,l,d,c,m,u,p){var g=this;g.user=l.getCurrentUser(),g.license={},g.setting={},g.tags={count:0,rows:[]},g.whatsappInteractions={count:0,rows:[]},g.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,WhatsappAccountId:[]},g.sectionColor="lime-A700",g.onInit=function(e,n){return g.license=e,g.setting=n,r.user.getWhatsappAccounts({id:g.user.id,nolimit:!0}).$promise.then(function(e){return g.whatsappAccounts=e||{count:0,rows:[]},r.tag.get({sort:"name"}).$promise}).then(function(e){g.tags=e||{count:0,rows:[]}}).then(function(){g.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Account",key:"WhatsappAccountId",type:"multiselect",label:"DASHBOARDS.SELECT_ACCOUNT",options:g.whatsappAccounts.rows,clearAll:!1},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:g.user.id,translate:"DASHBOARDS.ME"},{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:g.tags.rows,placeholder:"DASHBOARDS.TAGS"}],g.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Account",column:"WhatsappAccountId",type:"multiselect",options:{route:{model:"user",action:"getWhatsappAccounts",params:{id:g.user.id,nolimit:!0}}}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:A("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:A("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:A("third")}}]}}).catch(function(e){v.error(e)}).finally(function(){m.parseInteractionsKey("whatsapp",g.query,g.user.id,g.whatsappAccounts.rows).then(function(){g.isSearchBarVisible=!(g.query.search||!g.query.filter),y(g.query.page)}),d.on("whatsappInteraction:save",O),d.on("whatsappInteraction:update",O),d.on("whatsappInteractionTags:save",C),d.on("whatsappMessage:save",w),d.on("whatsappMessage:update",w),d.on("user_has_whatsapp_interactions:save",T),d.on("user_has_whatsapp_interactions:remove",I),d.on("userWhatsappAccount:save",f),d.on("userWhatsappAccount:remove",b),0<g.setting.whatsappInteractionsReloadTimeout&&R()})},g.success=E,g.getWhatsappInteractions=y,g.showWhatsappInteraction=function(e,n){a.$parent.vm.addInteractionTab("whatsapp",n)},g.downloadWhatsappInteraction=function(e,s,n){r.whatsappInteraction.download({id:s.id,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="whatsapp-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadWhatsappInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.disposeInteraction=function(e,n){var t=g.user.voicePause||g.user.chatPause||g.user.mailPause||g.user.openchannelPause||g.user.faxPause,a=!n.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:a,escapeToClose:a,onRemoving:function(){g.user&&n.Account.mandatoryDisposition&&!t&&r.user.unpause({id:g.user.id}).$promise.catch(function(e){v.error(e)})},locals:{user:g.user,channel:"whatsapp",interaction:n}})},g.getContactLabel=S,g.getAgentLabel=function(e){if(e.UserId)return e.UserId===g.user.id?o.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">";return o.instant("DASHBOARDS.NOT_ASSIGNED")},g.getWhatsappAccountLabel=function(e){if(e.Account)return e.Account.key;return o.instant("DASHBOARDS.UNKNOWN")},g.composeWhatsappInteraction=function(e,t){i.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){if(e){var n=e;return r.whatsappAccount.send({id:t.id},n).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("whatsapp",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"WHATSAPPACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}})},g.openAdvancedSearch=function(){i.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{color:g.sectionColor,fields:g.advancedSearch.fields,storagePath:"home.whatsapp"},fullscreen:!0}).then(function(e){g.isSearchBarVisible=!(e.value||!g.query.filter),e.apply&&(g.query.search=e.value,y())}).catch(function(e){c.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})};var v=p.getLogger("agent.general.whatsapp");function h(e){return{accounts:g.whatsappAccounts,accountId:e,filters:g.quickFilters,query:g.query,userId:g.user.id}}function f(e){if(e.UserId===g.user.id){var n=h(e.WhatsappAccountId);u.addAccount("whatsapp",n).then(function(e){e&&y()}).catch(function(e){v.error(e)})}}function b(e){if(e.UserId===g.user.id){var n=h(e.WhatsappAccountId);u.removeAccount("whatsapp",n).catch(function(e){v.error(e)})}}function A(n){var e=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:n,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=_.map(g.whatsappAccounts.rows,function(e){return{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:e.id,field:"name,level",level:n,nolimit:!0}}});return _.concat(t,e)}function E(e){!g.reloadingInteractions&&0<g.setting.whatsappInteractionsReloadTimeout&&R(!0),g.searchInProgress=!1,g.reloadingInteractions=!1,g.whatsappInteractions=e||{count:0,rows:[]};for(var n=0;n<g.whatsappInteractions.rows.length;n+=1)S(g.whatsappInteractions.rows[n])}function y(e){g.searchInProgress=!0,e||(g.query.page=1),g.query.offset=(g.query.page-1)*g.query.limit;var n=t.localStorage.getItem("motion2.home.whatsapp:"+g.user.id);(n=n?JSON.parse(n):{}).query=g.query,t.localStorage.setItem("motion2.home.whatsapp:"+g.user.id,JSON.stringify(n)),g.promise=r.whatsappInteraction.get(g.query,E).$promise}function S(e){e.contactInfo=e.Contact?e.Contact.mobile:void 0,"Unknown"===e.contactName&&(e.contactName=o.instant("DASHBOARDS.UNKNOWN"))}function T(e){var n=_.find(g.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&(_.find(n.Users,{id:e.UserId})||n.Users.push({id:e.UserId}))}function I(e){var n=_.find(g.whatsappInteractions.rows,{id:e.WhatsappInteractionId});n&&n.Users&&_.remove(n.Users,{id:e.UserId})}function O(e){if(e){var n=_.find(g.whatsappInteractions.rows,{id:e.id});if(n){if(n.Users=[],e.closed&&(n.unreadMessages=0),g.query.sort){var t=_.startsWith(g.query.sort,"-")?"desc":"asc";g.whatsappInteractions.rows=_.orderBy(g.whatsappInteractions.rows,_.trimStart(g.query.sort,"-"),t)}_.merge(n,_.pick(e,_.keys(n)))}else 0===g.setting.whatsappInteractionsReloadTimeout&&y(g.query.page)}}function C(e){if(e){var n=_.find(g.whatsappInteractions.rows,{id:e.id});n&&(n.Tags=e.tags||[],_.merge(n,_.pick(e,_.keys(n))))}}function w(e){if(e&&!e.secret){var n=_.find(g.whatsappInteractions.rows,{id:e.WhatsappInteractionId});if(n){var t=_.find(n.Messages,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):(_.isNil(n.Messages)&&(n.Messages={count:0}),e.read||(n.Messages.count+=1))}}}function R(e){e&&g.interactionsInterval&&n.cancel(g.interactionsInterval),g.interactionsInterval=n(function(){g.reloadingInteractions=!0,g.searchInProgress||y()},1e3*g.setting.whatsappInteractionsReloadTimeout)}a.$on("$destroy",function(){d.removeAllListeners("whatsappMessage:save"),d.removeAllListeners("whatsappMessage:update"),d.removeAllListeners("whatsappInteraction:save"),d.removeAllListeners("whatsappInteractionTags:save"),d.removeAllListeners("whatsappInteraction:update"),d.removeAllListeners("user_has_whatsapp_interactions:save"),d.removeAllListeners("user_has_whatsapp_interactions:remove"),g.interactionsInterval&&n.cancel(g.interactionsInterval)})}e.$inject=["$scope","$interval","$mdDialog","$document","$window","$translate","$q","api","Auth","socket","toasty","localStorageManager","agentAccountAssociationManager","ClientSideLoggingService"],angular.module("app.dashboards").controller("AgentHomeWhatsappController",e)}(),function(){"use strict";function e(e,n){var t=this;t.setting={},t.messages={count:0,rows:[]},t.showInteraction=!1,t.init=function(e,n){t.setting=n,t.tab=e,t.tab.saved=!0},t.getTrustedURL=function(){return n.trustAsResourceUrl(t.tab.src)}}e.$inject=["$scope","$sce"],angular.module("app.dashboards").controller("AgentGeneralIframeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this,f=16,b=1024*f*1024;function A(){var e=h.user.voicePause||h.user.chatPause||h.user.mailPause||h.user.openchannelPause||h.user.faxPause,n=!h.tab.interaction.Account.mandatoryDisposition;i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(t.body),clickOutsideToClose:n,escapeToClose:n,onRemoving:function(){h.user&&h.interaction.Account.mandatoryDisposition&&!e&&l.user.unpause({id:h.user.id}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},locals:{user:h.user,channel:h.tab.channel,interaction:h.tab.interaction}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)})}function E(e,n){h.tab.message=n,i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:h.tab.message,type:e,interaction:h.interaction},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){if(e)if(e.message&&e.message.savedAsDraft)h.draft?p.update({id:h.draft.id,channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}):p.add({channel:"mail",account:h.account,message:e.message,contact:h.contact,interaction:h.interaction}),h.draft=p.getByInteraction(h.tab.interaction.id);else{var n=e;n&&S(n),n.Interaction&&h.interaction&&h.interaction.id&&(n.Interaction.id=h.interaction.id,l.mailInteraction.update(n.Interaction).$promise.then(function(e){e&&e.closed?(h.tab.saved=!0,h.interaction.closed=!0,A()):null!==n.Interaction.substatus&&(h.tab.saved=!0,h.tab.interaction.substatus=n.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(h.tab))}).catch(function(e){d.error(e.data?e.data.message:e.toString())}))}}).finally(function(){h.tab.isDraft=!1})}function y(){"mail"!==h.tab.channel&&n(function(){var e=angular.element(t.find("md-content[name*='interaction-content-"+h.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function S(i){if(i)return i["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]=h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"],i[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,i.UserId=h.user.id,i.ContactId=h.interaction.ContactId,i.direction="out",i.secret=Boolean(h.tab.spy||i.secret),l[h.tab.channel+"Message"].save(i).$promise.then(function(e){if(e&&e.id&&!_.isEmpty(i.attachments)){for(var n=[],t=0;t<i.attachments.length;t++){var a=i.attachments[t];a.MailMessageId?n.push(l.attachment.clone({id:a.id},{name:a.name,basename:a.basename,type:a.type,MailMessageId:e.id}).$promise):n.push(l.attachment.update({id:a.id},{MailMessageId:e.id}).$promise)}return s.all(n)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){"mail"===h.tab.channel&&i.isDraft&&(p.removeByInteraction(h.interaction.id),h.draft=null),h.tab.areaText="",y()})}function T(e){switch(h.tab.channel){case"mail":h.draft.content.originalMessage=e?_.find(h.interaction.Messages,["id",e]):_.findLast(h.interaction.Messages,["secret",!1]),E(h.draft.type,h.draft.content)}}function I(e){h.journeyIsLoading=!0;var n=_.merge(h.journeyOptions,{id:h.contact.id,offset:e||0});return g.get(h.journey,n).then(function(e){h.journey=e.journey,h.canLoadMoreJourney=e.loadMore}).finally(function(){h.journeyIsLoading=!1})}h.showFooter=!1,h.BTNLoadMore=0,h.showInteraction=!1,h.user=c.getCurrentUser(),h.detectBrowser=u.detectBrowser(),h.journey=[],h.acceptedMessages=[],h.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:b,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},h.ngFlow={flow:{}},h.selectedMailShowDetails={},h.selectedMailShowSystemMessage={},h.setting={},h.ctrlMethods={},h.embedOptions={fontSmiley:!0,sanitizeHtml:!0,emoji:!0,link:!0,linkTarget:"_blank"},h.journeyOptions=g.getQuery(),h.quickFilters=g.getQuickFilters(),h.init=function(e,n){h.tab=e,h.tab.saved=!0,h.tab.badges=0,h.setting=n||{},h.tab&&h.tab.channel&&h.tab.interaction&&(h.interaction=h.tab.interaction,l[h.tab.channel+"Interaction"].get({id:h.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(h.interaction=e,h.tab.interaction=e),h.tab.saved=h.interaction.closed,h.queryMessage={id:h.interaction.id,includeAll:!0},"mail"===h.tab.channel?(h.queryMessage.sort="-id",h.queryMessage.offset=0,h.queryMessage.limit=3,h.queryMessage.inlineCss=!0):(h.queryMessage.sort="id",h.queryMessage.nolimit=!0),l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise}).then(function(e){return e&&(h.BTNLoadMore=e.count-h.queryMessage.limit),h.messages=e||{count:0,rows:[]},l["chat"===h.tab.channel?"chatWebsite":h.tab.channel+"Account"].get({id:h.interaction["chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId"]}).$promise}).then(function(e){if(h.account=e,h.tab.title=h.account.key||h.account.name,h.interaction.ContactId)return l.cmContact.get({id:h.interaction.ContactId}).$promise}).then(function(e){return e&&(h.contact=e),h.showInteraction=!0,h.contact?h.tab.title+=" - "+(h.user.privacyEnabled?v.mask(h.contact.firstName):h.contact.firstName):h.tab.title+=" - "+r.instant(h.tab.channel.toUpperCase()+".UNKNOWN"),l.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){h.users=e||{count:0,rows:[]},h.usersMap=_.mapValues(_.keyBy(h.users.rows,"id"),"fullname")}).then(function(){if(h.tab.channel&&h.interaction)return l.user["add"+_.upperFirst(h.tab.channel)+"Interactions"]({id:h.user.id,ids:[h.interaction.id]})}).then(function(){return l.mailSubstatus.get({sort:"name",nolimit:!0}).$promise}).then(function(e){h.subStatuses=e||{count:0,rows:[]}}).catch(function(){h.showInteraction=!0}).finally(function(){h.contact&&I(),function(){switch(h.user.role){case"admin":return h.downloadPermissions={attachments:!0,interactions:!0};case"agent":return h.downloadPermissions={attachments:h.user.downloadAttachments,interactions:h.user.downloadOmnichannelInteractions};case"user":l.userProfile.get({id:h.user.userProfileId,fields:"downloadAttachments,downloadOmnichannelInteractions"}).$promise.then(function(e){h.downloadPermissions={attachments:e.downloadAttachments,interactions:e.downloadOmnichannelInteractions}}).catch(function(){h.downloadPermissions={attachments:!1,interactions:!1}})}}(),function(){if(!h.tab.spy&&!h.interaction.closed){var t=[],a=_.some(h.messages.rows,["read",!0]);if(h.messages.rows.forEach(function(e){if("in"===e.direction&&!e.read){var n=0===t.length&&!a;t.push(l[h.tab.channel+"Message"].accept({id:e.id,UserId:h.user.id,manual:n}).$promise),h.acceptedMessages.push(e.id)}}),"mail"===h.tab.channel){var e=_(h.interaction.Messages).filter({read:!1,direction:"in"}).differenceBy(h.messages.rows,"id").value();e.forEach(function(e){t.push(l.mailMessage.accept({id:e.id,UserId:h.user.id}).$promise),h.acceptedMessages.push(e.id)})}s.all(t)}}(),y(),m.on(h.tab.channel+"Message:save",h.onMessageSave),m.on(h.tab.channel+"Message:update",h.onMessageSave),m.on(h.tab.channel+"Interaction:save",h.onInteractionSave),m.on(h.tab.channel+"Interaction:update",h.onInteractionSave),m.on("user_has_"+h.tab.channel+"_interactions:save",h.onInteractionOpen),m.on("user_has_"+h.tab.channel+"_interactions:remove",h.onInteractionClose),h.tab.areaText=h.tab.areaText?h.tab.areaText:"",h.showFooter=!0,"mail"===h.tab.channel&&(h.draft=p.getByInteraction(h.tab.interaction.id),h.tab.isDraft&&(h.tab.interaction.closed?(p.removeByInteraction(h.tab.interaction.id),h.draft=null):T()))}))},h.getLabelByMessage=function(e){var n="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":n:e.UserId?h.usersMap?h.usersMap[e.UserId]:n:"System"},h.openContact=function(e,n){try{h.tab&&!h.tab.spy&&a.$parent.$parent.$parent.vm.addContactTab(n||h.contact)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Unable to open the contact"})}},h.openInteraction=function(e){try{if(e.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",e);if(e.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",e);if(e.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",e);if(e.WhatsappAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("whatsapp",e);if(e.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",e);if(e.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",e)}catch(e){d.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},h.disposeInteraction=A,h.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!0,skipHide:Boolean(h.tab.spy),resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0,fields:"id,name,color"})}]},locals:{channel:h.tab.channel,interaction:h.tab.interaction}})},h.composeMailInteraction=function(n,e){if(e.inReplyTo){var t=_.find(h.messages.rows,{messageId:e.inReplyTo});if(!t)return l.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){E(n,e&&e.count?e.rows[0]:void 0)}).catch(function(e){d.error(e.data?e.data.message:e.toString()),E(n,void 0)});E(n,t)}else E(n,e)},h.composeFaxInteraction=function(e){var n={to:[]};n.to.push(h.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:h.account.id},e).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},h.composeSmsInteraction=function(e,n){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeWhatsappInteraction=function(e,n){i.show({controller:"ComposeWhatsappInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeChatInteraction=function(e,n){i.show({controller:"ComposeChatInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.composeOpenchannelInteraction=function(e,n){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,message:n,type:e},fullscreen:!0,skipHide:Boolean(h.tab.spy)}).then(function(e){e&&S(e)})},h.transferLastMessage=function(){if(h.interaction){var e=_.findLast(h.messages.rows,function(e){return"in"===e.direction});e?i.show({controller:"TransferMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",parent:angular.element(t.body),clickOutsideToClose:!1,locals:{account:h.account,interaction:h.interaction,message:e,channel:h.tab.channel},resolve:{agents:["apiResolver",function(e){var n={fields:"id,name",$id:{ne:h.user.id},role:"agent",online:!0,sort:"name",nolimit:!0};return n[h.tab.channel+"Pause"]=!1,e.resolve("user@get",n)}],queues:["apiResolver",function(e){return e.resolve(h.tab.channel+"Queue@get",{fields:"id,name",sort:"name",nolimit:!0})}]}}).then(function(e){h.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(h.tab)}):d.error({title:"Invalid transfer",msg:"Message not found!"})}},h.downloadMessage=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Message"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=h.tab.channel+"-message"+s.id+".eml";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.downloadMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.downloadInteraction=function(s,e){h.tab.channel&&s.id&&l[h.tab.channel+"Interaction"].download({id:s.id,attachments:e}).$promise.then(function(e){var n=[e.buffer],t=h.tab.channel+"-interaction"+s.id+".zip",a=new Blob(n,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.inteactionMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.openDraft=T,h.createVidaooSession=function(e){var n={id:e.id,account:e.Account,contact:e.Contact};return l.chatInteraction.createVidaooSession(n).$promise.then(function(){d.success({title:"Start Video Call",msg:"Session properly created."})}).catch(function(){d.error({title:"Start Video Call",msg:"Unable to create session!"})})},h.reply=function(e,n){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===n.trim())return;S(function(e){var n={},t="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";n[t]=h.interaction[t].toString(),n[_.capitalize(h.tab.channel)+"InteractionId"]=h.interaction.id,("sms"===h.tab.channel||"whatsapp"===h.tab.channel)&&(n.phone=h.interaction.phone);e&&(n.UserId=h.user.id,n.ContactId=h.interaction.ContactId,n.body=e);return n}(n.trim()))},h.upload=function(){h.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},h.ngFlow.flow.upload()},h.fileAdded=function(e){if(e.size>b)return d.error({title:"File too big",msg:"The max allowed size is "+f+"MB"}),!1;return!0},h.fileSuccess=function(e,n){var t=JSON.parse(n),a=t.name;"chat"===h.tab.channel&&(a='<a href="'+(h.account.remote?h.account.remote:o.protocol()+"://"+o.host())+"/api/chat/interactions/"+h.interaction.id+"/attachment_download?attachId="+t.id+"&token="+h.account.token+'" target="_self">'+t.name+"</a>");S({body:a,AttachmentId:t.id})},h.onMessageSave=function(e){if(e&&h.interaction.id!=e[_.capitalize(h.tab.channel)+"InteractionId"])return;var n=!1;h.messages?n=_.find(h.messages.rows,{id:e.id}):h.messages={rows:[],count:0};n?_.merge(n,e):("mail"===h.tab.channel?h.messages.rows.unshift(e):h.messages.rows.push(e),y())},h.onInteractionSave=function(e){if(e&&h.interaction.id!==e.id)return;e.closed&&h.interaction.UserId!==h.user.id&&(h.tab.saved=!0);_.merge(h.interaction,e)},h.searchTextChange=function(n){var t=s.defer(),a=[],e={},i="chat"===h.tab.channel?"ChatWebsiteId":_.capitalize(h.tab.channel)+"AccountId";return e.filter=n,e[i]=h.account.id,l.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},h.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:h.user,account:h.account,interaction:h.interaction,contact:h.interaction&&h.interaction.Contact?h.interaction.Contact:{}};""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=e(t),h.ctrlMethods.setText(h.tab.areaText)}catch(e){""!==h.tab.areaText&&(h.tab.areaText+=" "),h.tab.areaText+=n.value,h.ctrlMethods.setText(h.tab.areaText)}h.selectedItem=null,h.changeDisplayCannedAnswerInputValue()}},h.getMessagesAlignment=function(e){if(e.secret&&h.user.id!=e.UserId)return"in";switch(h.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}},h.displayCannedAnswerInput=!1,h.changeDisplayCannedAnswerInputValue=function(){h.displayCannedAnswerInput=!h.displayCannedAnswerInput},h.setAs=function(e){h.tab.channel&&h.interaction&&h.interaction.id&&l[h.tab.channel+"Interaction"].update({id:h.interaction.id,substatus:e}).$promise.catch(function(e){d.error(e.data?e.data.message:e.toString())})},h.markAsUnread=function(){if(h.tab.channel&&h.interaction&&h.interaction.id)if(h.acceptedMessages.length)for(var e=0;e<h.acceptedMessages.length;e+=1)l[h.tab.channel+"Message"].update({id:h.acceptedMessages[e],read:!1,UserId:null});else for(var n=0;n<h.messages.rows.length;n+=1)if("in"===h.messages.rows[n].direction){h.messages.rows[n].UserId===h.user.id?l[h.tab.channel+"Message"].update({id:h.messages.rows[n].id,read:!1,UserId:null}):d.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}h.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(h.tab)},h.getAttachments=function(n){return l.attachment.get({MailMessageId:n.id}).$promise.then(function(e){e&&e.rows&&(n.attachments=e.rows)}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.getAttachment=function(i){return l.attachment.download({id:i.id}).$promise.then(function(e){if(e){var n=new Blob([e.buffer],{type:e.type}),t=document.createElement("a"),a=window.URL.createObjectURL(n);t.href=a,t.target="_self",t.download=i.name,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},h.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},h.onInteractionOpen=function(e){var n;h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&(h.interaction.Users&&(n=_.find(h.interaction.Users,{id:e.UserId})),n||h.interaction.Users.push({id:e.UserId}))},h.onInteractionClose=function(e){h.interaction.id==e[_.upperFirst(h.tab.channel)+"InteractionId"]&&h.interaction.Users&&_.remove(h.interaction.Users,{id:e.UserId})},h.getCustomerJourney=I,h.loadNextPage=function(){var t=s.defer();if(h.queryMessage)return h.queryMessage.offset=h.messages.rows.length,l[h.tab.channel+"Interaction"].getMessages(h.queryMessage).$promise.then(function(e){for(var n=0;n<e.rows.length;n+=1)h.messages.rows.push(e.rows[n]),h.interaction.closed||"in"!==e.rows[n].direction||e.rows[n].read||(l[h.tab.channel+"Message"].accept({id:e.rows[n].id,UserId:h.user.id}),h.acceptedMessages.push(e.rows[n].id));return 0<e.rows.length&&(h.BTNLoadMore=h.BTNLoadMore-e.rows.length),t.resolve(e)}).catch(function(e){return t.reject(e)});return t.reject()},h.interactionTimelineOptions={scrollEl:"#interaction-content"},h.loadMoreJourney=function(){return s(function(e){var n=h.journey.length;return e(I(n))})},h.journeyTimelineOptions={scrollEl:"#journey-content"},a.$on("$destroy",function(){m.removeAllListeners(h.tab.channel+"Message:save"),m.removeAllListeners(h.tab.channel+"Message:update"),m.removeAllListeners(h.tab.channel+"Interaction:save"),m.removeAllListeners(h.tab.channel+"Interaction:update"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:save"),m.removeAllListeners("user_has_"+h.tab.channel+"_interactions:remove")})}function n(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(t){t.updateView=function(){var e,n=_.replace(t.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');t.trustedHtml=a.trustAsHtml(n)},t.$watch("ngBindHtmlUnsafe",function(e){t.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$location","$translate","api","toasty","Auth","socket","msUtils","draftManager","customerJourneyManager","privacyManager"],n.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",n).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,ChatAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeChatInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=25,u=1024*m*1024;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.message={from:i.localstationid,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,attachments:[]},c.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:u,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(s.draft=void 0,t.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,c.message.attachments.push(n)}catch(e){console.error(e)}},c.fileAdded=function(e){var n=["pdf","tif"];if(!_.includes(n,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extensions: "+n.join()}),!1;if(e.size>u)return l.error({title:"File too big",msg:"The max allowed size is "+m+"MB"}),!1;return!0},c.getContact=function(e){var n="";e.firstName&&e.firstName!==e.fax&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(n+=e.lastName+" ");return n+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var n=e;if(_.isObject(e))return e.fax;if(t=n,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(t))return n;var t;return l.error("Fax "+n+" is not valid"),null},c.closeDialog=function(){s.draft=c.message,t.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(n,e,i,t,a,s,o,r,l,d,c,m,u,p){var g=this,v=25,h=1024*v*1024;g.currentUser=m.getCurrentUser(),g.secret="note"===r,g.hiddenCC=!0,g.hiddenBCC=!0,g.verifySmtp=!0,g.errors=[],g.separatorKeys=[t.KEY_CODE.ENTER,t.KEY_CODE.COMMA,t.KEY_CODE.TAB],g.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,MailAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},g.selectedItemChange=function(n){if(n&&n.value&&g.ckEditorInstance)try{var e=_.template(n.value),t={user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}},a=e(t),i=a.replace(/(?:\r\n|\r|\n)/g,"<br />");g.ckEditorInstance.insertHtml(i)}catch(e){console.error(e),g.ckEditorInstance.insertHtml(n.value)}document.getElementById("html-area").focus(),g.selectedItem=null},g.onReadyEditor=function(e){try{g.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,g.fromTemplate=_.template("{{ name }} <{{ email }}>"),g.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),g.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),g.message={from:g.fromTemplate({name:s.name,email:s.email||s.Smtp.user}),to:[],cc:[],bcc:[],body:S(),type:r,attachments:[],showLastMessage:!0},g.draft=null,g.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:g.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,enterMode:CKEDITOR.ENTER_BR,font_defaultLabel:s.fontFamily?s.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:s.fontSize||"12",removePlugins:"magicline"};for(var f=[],b=8;b<=72;b++)f.push(b+"/"+b+"pt");g.ckeditor.fontSize_sizes=f.join(";"),g.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:h,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},g.ngFlow={flow:{}},g.reply=function(e){angular.isDefined(o)&&(g.message.type="reply",g.message.to="in"===o.direction?o.from.split(","):o.to.split(","),g.message.subject=_.startsWith(o.subject,"Re:")?o.subject:"Re: "+o.subject,g.message.inReplyTo=o.messageId,g.message.body=S(),g.message.attachments=[],e&&o.cc&&(g.hiddenCC=!1,g.message.cc=o.cc.split(",")),g.message.showLastMessage=!1)},g.newMail=function(){angular.isDefined(o)&&(g.message.type="new",g.message.to=o.to?o.to.split(","):[])},g.forward=function(){if(angular.isDefined(o)){if(g.message.type="forward",g.message.subject=_.startsWith(o.subject,"Fwd:")?o.subject:"Fwd: "+o.subject,g.message.body=S(),o.Attachments&&o.Attachments.length)for(var e=0;e<o.Attachments.length;e++)g.message.attachments.push(o.Attachments[e]);g.message.showLastMessage=!1}},g.editDraft=function(){g.isDraft=!0,angular.isDefined(o)&&(o.savedAsDraft=!1,g.message=angular.copy(o),_.isEmpty(g.message.cc)||(g.hiddenCC=!1),_.isEmpty(g.message.bcc)||(g.hiddenBCC=!1))},g.send=function(e,n,t){if(!A&&g.message.to&&(g.message.body||o.from))if(g.message.to.length)if(_.isEmpty(g.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){E(n,t)})}else E(n,t);else d.error("To is mandatory");A=!1},g.note=function(){g.type="note",g.secret=!0,g.message.body='<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt"><p></p></div>'},g.addNote=function(){g.message.body&&i.hide({secret:!0,body:g.message.body,attach:g.message.attachments.length,attachments:g.message.attachments})},g.upload=function(e){g.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+n.get("motion.token")},g.ngFlow.flow.upload()},g.fileSuccess=function(e,n){try{(n=JSON.parse(n)).size=e.size,g.message.attachments.push(n)}catch(e){console.error(e)}},g.removeAttachment=function(e){g.message.attachments=_.reject(g.message.attachments,{id:e.id}),e.MailMessageId||l.attachment.delete({id:e.id}).$promise.catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.attachment.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.fileAdded=function(e){if(e.size>h)return d.error({title:"File too big",msg:"The max allowed size is "+v+"MB"}),!1;return!0},g.getContact=function(e){var n="";e.firstName&&e.firstName!==e.email&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(n+=e.lastName+" ");return n+="<"+e.email+">"},g.contactSearch=function(e){return s&&s.ListId?l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},g.transformContact=function(e,n){if(_.isObject(e))return(g.contact=e).email;if(_.isString(e)){if(y(e))return g.contact={email:e},e;for(var t=e.split(","),a=0;a<t.length;a+=1)y(t[a])?_.isArray(n)&&_.indexOf(n,t[a])<0&&n.push(t[a]):d.error("Email "+t[a]+" is not valid");return g.contact={email:e.split(",")[0]},null}return d.error("Email field is not valid"),null},g.saveDraft=function(){g.message.savedAsDraft=!0,g.draft=p.getByInteraction(u.id);var e={account:s,message:g.message,contact:g.contact,interaction:u};if(g.draft&&!g.isDraft){var n=i.confirm({skipHide:!0}).title(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_TITLE")).content(a.instant("DASHBOARDS.DRAFT_SAVE_WARNING_MESSAGE")).ariaLabel("Save draft").ok(a.instant("DASHBOARDS.OVERWRITE")).cancel(a.instant("DASHBOARDS.CANCEL"));i.show(n).then(function(){i.hide(e)})}else i.hide(e)},g.closeDialog=function(){i.cancel()},g.loadLastMessage=function(){g.message.body+=T(g.message.type)};var A=!(g.keyPress=function(e){13===e.keyCode&&(A=!0)});switch(r){case"reply":g.reply(!1);break;case"replyAll":g.reply(!0);break;case"forward":g.forward();break;case"draft":g.editDraft();break;case"new":g.newMail();break;case"note":g.note()}function E(e,n){var t={from:g.message.from,to:g.message.to.join(","),cc:g.message.cc.join(","),bcc:g.message.bcc.join(","),subject:g.message.subject,body:g.message.showLastMessage?g.message.body:g.message.body+T(g.message.type),inReplyTo:g.message.inReplyTo,attach:g.message.attachments.length,attachments:g.message.attachments,Interaction:{lastMsgDirection:"out",substatus:n},isDraft:g.isDraft};t.html='<div id="xm-mail-content">'+_.replace(t.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(t.Interaction.closed=!0),i.hide(t)}function y(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function S(){return'<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'pt">'+function(){if(_.isNil(s.template))return"";try{return _.template(s.template)({user:g.currentUser,account:s,interaction:u,contact:u&&u.Contact?u.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function T(e){var n='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":n+=g.replyTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||""});break;case"forward":n+=g.forwardTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||"",to:_.escape(o.to)||"",subject:_.escape(o.subject)||""})}var t,a,i=g.message.showLastMessage&&o.originalMessage||g.isDraft?o.originalMessage.body:o.body;return n+="<br><br>",n+=(t=i?_.replace(i,'<div id="xm-mail-content"',"<div"):"",(a=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?a[1]:t),n+="</blockquote></div>",e?n:""}l.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){g.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),g.secret||l.mailAccount.verifySmtp({id:s.id}).$promise.catch(function(e){g.verifySmtp=!1,g.errors.push({message:e.data,type:e.status}),g.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","$translate","account","message","type","api","toasty","$q","Auth","interaction","draftManager"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,OpenchannelAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=""===p.message.body.trim()?e(t):" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=""===p.message.body.trim()?n.value:" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e[s.mapKey]&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e[s.mapKey]&&(n+=e.lastName+" ");return n+="<"+e[s.mapKey]+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId){var n="firstName,lastName,phone,mobile";return s.mapKey&&(n+=","+s.mapKey),l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:n}).$promise.then(function(e){return e.rows})}return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e[s.mapKey];return n},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeOpenchannelInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,SmsAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=""===p.message.body.trim()?e(t):" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=""===p.message.body.trim()?n.value:" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(n){var t=c.defer(),a=[];return l.cannedAnswer.get({filter:n,WhatsappAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:n}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.WhatsappAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),t.resolve(a)}).catch(function(e){t.reject(e)}),t.promise},p.selectedItemChange=function(n){if(n){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(n.value),t={user:p.currentUser,account:s};p.message.body+=""===p.message.body.trim()?e(t):" "+e(t),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=""===p.message.body.trim()?n.value:" "+n.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(n=p.message.body,a.hide({to:p.message.to.join(","),body:n})):d.error("To is mandatory"));var n},p.getContact=function(e){var n="";e.firstName&&e.firstName!==e.mobile&&(n+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(n+=e.lastName+" ");return n+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var n=e;if(_.isObject(n))return e.mobile;if(t=n,/^(\+|\d)[0-9]{7,16}$/.test(t))return n;var t;return d.error("Mobile "+n+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeWhatsappInteractionDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.errors=[],r.dispositions=[],r.interaction=angular.copy(e),r.interaction.disposition||(r.interaction.disposition=null),r.channel=i,r.apiRoute=r.channel+"Interaction",r.apiAccountRoute=r.channel+("chat"===r.channel?"Website":"Account"),r.accountProperty=_.capitalize(r.channel)+("chat"===r.channel?"Website":"Account")+"Id",r.firstLevelDisposition=null,r.mandatoryDisposition=!1,r.mandatoryDispositionPause="",r.wasUserInPause=s.voicePause||s.chatPause||s.mailPause||s.openchannelPause||s.faxPause,r.onInit=function(){var n=[],t={fields:"id,name,level,ParentId",sort:"name",nolimit:!0};t[r.accountProperty]=e[r.accountProperty],a[r.apiAccountRoute].get({id:e[r.accountProperty]}).$promise.then(function(e){return r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name),a.disposition.get(t).$promise}).then(function(e){return e.rows.length&&(n=_.concat(n,e.rows)),a.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",WhatsappAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",nolimit:!0}).$promise}).then(function(e){e.rows.length&&(n=_.concat(n,e.rows))}).catch(function(e){console.error(e)}).finally(function(){r.dispositions=_.orderBy(n,["name"],["asc"]),r.mandatoryDisposition&&!r.wasUserInPause&&a.user.pause({id:s.id,type:r.mandatoryDispositionPause||"DEFAULT PAUSE"}).$promise.then(function(e){}).catch(function(e){console.error(e)})})},r.onDispositionChange=function(e){"first"===e?(r.anySecondLevelDisposition=!!r.firstLevelDisposition&&_.some(r.dispositions,["ParentId",r.firstLevelDisposition.id]),r.firstLevelDisposition||(r.secondLevelDisposition=void 0)):"second"===e&&(r.anyThirdLevelDisposition=_.some(r.dispositions,["ParentId",r.secondLevelDisposition.id]))},r.clearDispositionSelection=function(e){"second"===e?(r.secondLevelDisposition=void 0,r.thirdLevelDisposition=void 0):"third"===e&&(r.thirdLevelDisposition=void 0)},r.saveDisposition=function(){r.errors=[],r.interaction.UserId=s.id,r.interaction.closed=!0,r.interaction.closeReason="agent",r.interaction.disposition=r.firstLevelDisposition?r.firstLevelDisposition.name:null,r.interaction.secondDisposition=r.secondLevelDisposition?r.secondLevelDisposition.name:void 0,r.interaction.thirdDisposition=r.thirdLevelDisposition?r.thirdLevelDisposition.name:void 0,a[r.apiRoute]?a[r.apiRoute].update(_.pick(r.interaction,["MailAccountId","FaxAccountId","SmsAccountId","WhatsappAccountId","ChatWebsiteId","OpenchannelAccountId","closed","closeReason","disposition","secondDisposition","thirdDisposition","id","note","UserId"])).$promise.then(function(e){r.interaction=e,"mail"===r.channel&&o.removeByInteraction(r.interaction.id),t.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"})}).then(function(){l(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):l(!1)},r.closeDialog=l}e.$inject=["$mdDialog","toasty","api","interaction","channel","user","draftManager"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s){var o=this;function r(e){n.hide(e)}o.errors=[],o.tags=s,o.interaction=angular.copy(a),o.interaction.Tags=_.map(o.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),o.channel=i,o.autocompleteRequireMatch=!0,o.saveTag=function(){{if(o.errors=[],e[o.apiRoute])return e[o.apiRoute].addTags({id:o.interaction.id,ids:_.map(o.interaction.Tags,"id")}).$promise.then(function(){t.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=o.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},o.closeDialog=r,o.apiRoute=o.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l,d){var c=this;function m(e){n.hide(e)}c.channel=s.toLowerCase(),c.message=o,c.account=r,c.agents=l,c.queues=d,c.transfer={id:0,type:c.account.queueTransfer?"queue":"agent"},c.onTransfer=function(){m(!0),e(function(){var e="agent"===c.transfer.type?"agentNotify":c.channel+"QueueNotify";return a.rpc[e]({id:c.transfer.id,messageId:c.message.id,channel:c.channel}).$promise.then(function(){i.success({title:t.instant("DASHBOARDS.INFO"),msg:"queue"===c.transfer.type?t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_QUEUE_EXECUTED"):t.instant("DASHBOARDS.NOTIFICATIONS.TRANSFER_AGENT_EXECUTED")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.rpc.notify"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.rpc.notify",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},5e3)},c.closeDialog=m}e.$inject=["$mdDialog","$timeout","$translate","api","toasty","channel","message","account","agents","queues"],angular.module("app.dashboards").controller("TransferMessageDialogController",e)}(),function(){"use strict";function e(i,m,s,e,u,o,r,t,n,a,l){var p=this;function d(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){o.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function c(t,e){var n,a,l=[],d=[],c=r.getCurrentUser();(n=c,a=m.defer(),p.project.sendUnpauseOnSubmit?u.user.unpause({id:n.id}).$promise.then(function(e){a.resolve()}).catch(function(e){console.log("err"),a.resolve()}):a.resolve(),a.promise).then(function(){return u.jscriptySessionReport.save({starttime:p.starttime,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,VoiceQueueId:p.call&&p.call["xmd-voicequeueid"]?p.call["xmd-voicequeueid"]:void 0,ProjectId:p.project&&p.project.id?p.project.id:void 0,projectname:p.project&&p.project.name?p.project.name:void 0,ContactId:p.contact&&p.contact.id?p.contact.id:void 0,completed:e}).$promise}).then(function(e){if(e)for(var n=p.getResponseSheetHeaders(),t=p.getResponseSheetRow(),a=p.getQuestionWithResponseList(),i=0;i<n.length;i+=1)if(!_.isEmpty(String(t[i]))){try{l.push(u.jscriptyQuestionReport.save({question:n[i],answer:"date"===a[i].type?moment(String(t[i])).format("YYYY-MM-DD"):"time"===a[i].type?moment(String(t[i])).format("HH:mm"):String(t[i]),questionId:a[i].id,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert question",e)}for(var s=String(t[i]).split(";"),o=0;o<s.length;o+=1){var r=s[o].trim();try{d.push(u.jscriptyAnswerReport.save({question:n[i],questionId:a[i].id,answer:"date"===a[i].type?moment(r).format("YYYY-MM-DD"):"time"===a[i].type?moment(r).format("HH:mm"):r,membername:p.call&&p.call.membername?p.call.membername:c.name,calleridname:p.call&&p.call.calleridname?p.call.calleridname:void 0,calleridnum:p.call&&p.call.calleridnum?p.call.calleridnum:void 0,queue:p.call&&p.call.queue?p.call.queue:void 0,uniqueid:p.call&&p.call.uniqueid?p.call.uniqueid:void 0,SessionId:e.id,ProjectId:p.project.id,projectname:p.project.name}))}catch(e){console.error("Unable to convert answer",e)}}}return m.all(l).then(function(){return m.all(d).then(function(){return e})})}).then(function(e){e?t.resolve(!0):t.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});t.reject()})}p.formViewer={},p.showResetButton=!0,p.showIncompleteSubmitButton=!1,p.detectBrowser=l.detectBrowser(),p.onSubmit=function(e,n){var t=m.defer();if(n){var a=s.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");s.show(a).then(function(){c(t,!1)},function(){t.resolve()})}else c(t,!0);return t.promise.then(function(e){e&&(o.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){o.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(p.tab))}).catch(function(e){o.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},p.openContact=function(e,n){try{i.$parent.$parent.$parent.vm.addContactTab(n)}catch(e){o.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},p.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},p.getResponseSheet=function(){return e.getResponseSheet(p.project.formData,p.project.responseData,!1)},p.getResponseSheetRow=function(){return e.getResponseSheetRow(p.project.formData,p.project.responseData)},p.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(p.project.formData,!1)},p.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(p.project.formData,p.project.responseData)},p.init=function(e){p.tab=e,p.tab&&(p.call=p.tab.call,p.starttime=p.tab.openedAt,p.contact=p.tab.contact,p.project=p.tab.project,p.project&&(_.isObjectLike(p.project.formData)?p.project.formData=p.project.formData:p.isJsonString(p.project.formData)?p.project.formData=JSON.parse(p.project.formData):p.project.formData=void 0,p.project.responseData=p.project.responseData||{},void 0!==p.project.currentPage&&a(function(){n.$broadcast("mwForm.pageEvents.changePage",{page:p.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&(p.project.currentPage=n.currentPage.number-1,d(),p.project.enableUncompleteSave&&(1<=n.currentPage.number&&n.currentPage.number<p.project.formData.pages.length?p.showIncompleteSubmitButton=!0:p.showIncompleteSubmitButton=!1),p.project.formData&&p.project.formData.pages))for(var t=0,a=p.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&p.project.formData.pages[t].elements)for(var i=0,s=p.project.formData.pages[t].elements.length;i<s;i++)"question"===p.project.formData.pages[t].elements[i].type&&p.project.formData.pages[t].elements[i].question&&delete p.project.responseData[p.project.formData.pages[t].elements[i].question.id]})))},p.resetViewer=function(e){if(p.formViewer.reset){var n=s.confirm().title(t.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(t.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(t.instant("JSCRIPTY.YES")).cancel(t.instant("JSCRIPTY.NO"));s.show(n).then(function(){p.showIncompleteSubmitButton=!1,p.project.currentPage=void 0,d(),p.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(t,a,e,n,i){var s=this;function o(){return function(e){if(404===e.status)a.info({title:t.instant("DASHBOARDS.ATTENTION"),msg:t.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}s.notification=e,s.user=i.getCurrentUser(),s.accept=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].accept({id:s.notification.id,UserId:s.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(o());a.error({title:"API:ERROR",msg:"API accept message not found: "+s.notification.channel+"Message"})}},s.reject=function(e){{if(n[s.notification.channel+"Message"])return n[s.notification.channel+"Message"].reject({id:s.notification.id,UserId:s.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(o());a.error({title:"API:ERROR",msg:"API reject message not found: "+s.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var n=this;n.init=function(e){n.tab=e,n.tab&&(n.tab.saved=!0,n.html=n.tab.html)}})}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&"abandoned"===e.disposition?(i.inbound.abandoned+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&!e.UserId&&e.disposition?(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.chatWebsites,{id:_.toNumber(e.ChatWebsiteId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.chatWebsites=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("chatInteraction:save",i.onSaveChatInteraction),n.on("chatInteraction:update",i.onUpdateChatInteraction),function(){if(0<Object.keys(i.chatWebsites).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("chatInteraction:save"),n.removeAllListeners("chatInteraction:update")})}e.$inject=["$scope","socket","chatInteractions","chatWebsites"],angular.module("app.dashboards").controller("UserChatDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){var l=this;function d(){s({queues:l.outboundQueues,rpcQueues:l.rpcQueues}).then(function(e){l.inbound=e})}function c(){o({rpcCampaigns:l.rpcCampaigns}).then(function(e){l.ivr=e})}l.outboundQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.rpcCampaigns=r?_.keyBy(r.rows?r.rows:[],"id"):{},l.ivr={originated:0,limitCalls:0},l.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},l.onSaveQueue=function(e){l.outboundQueues[e.id]&&l.rpcQueues[e.id]&&(l.rpcQueues[e.id]=e)},l.onSaveCampaign=function(e){l.rpcCampaigns[e.id]&&(l.rpcCampaigns[e.id]=e)},t.onWithoutApply("voice_queue:save",l.onSaveQueue),l.interval=n(function(){d(),c()},999),t.onWithoutApply("campaign:save",l.onSaveCampaign),d(),c(),e.$on("$destroy",function(){t.removeListener("voice_queue:save",l.onSaveQueue),t.removeAllListeners("campaign:save"),l.interval&&n.cancel(l.interval)})}e.$inject=["$scope","$interval","socket","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.faxAccounts,{id:_.toNumber(e.FaxAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.faxAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("faxInteraction:save",i.onSaveFaxInteraction),n.on("faxInteraction:update",i.onUpdateFaxInteraction),function(){if(0<Object.keys(i.faxAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("faxInteraction:save"),n.removeAllListeners("faxInteraction:update")})}e.$inject=["$scope","socket","faxInteractions","faxAccounts"],angular.module("app.dashboards").controller("UserFaxDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.mailAccounts,{id:_.toNumber(e.MailAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.mailAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("mailInteraction:save",i.onSaveMailInteraction),n.on("mailInteraction:update",i.onUpdateMailInteraction),function(){if(0<Object.keys(i.mailAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("mailInteraction:save"),n.removeAllListeners("mailInteraction:update")})}e.$inject=["$scope","socket","mailInteractions","mailAccounts"],angular.module("app.dashboards").controller("UserMailDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.openchannelAccounts,{id:_.toNumber(e.OpenchannelAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.openchannelAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("openchannelInteraction:save",i.onSaveOpenchannelInteraction),n.on("openchannelInteraction:update",i.onUpdateOpenchannelInteraction),function(){if(0<Object.keys(i.openchannelAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("openchannelInteraction:save"),n.removeAllListeners("openchannelInteraction:update")})}e.$inject=["$scope","socket","openchannelInteractions","openchannelAccounts"],angular.module("app.dashboards").controller("UserOpenchannelDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.smsAccounts,{id:_.toNumber(e.SmsAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.smsAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("smsInteraction:save",i.onSaveSmsInteraction),n.on("smsInteraction:update",i.onUpdateSmsInteraction),function(){if(0<Object.keys(i.smsAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("smsInteraction:save"),n.removeAllListeners("smsInteraction:update")})}e.$inject=["$scope","socket","smsInteractions","smsAccounts"],angular.module("app.dashboards").controller("UserSmsDashboardGeneralController",e)}(),function(){"use strict";function e(t){var i=[],s=function(){var t=i[0],a={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(t.queues,function(e,n){t.rpcQueues[n]&&(a.waiting+=t.rpcQueues[n].waiting||0,a.talking+=(t.rpcQueues[n].talking||0)+(t.rpcQueues[n].pTalking||0),a.answered+=t.rpcQueues[n].answered||0,a.abandoned+=t.rpcQueues[n].abandoned||0,a.sumHoldTime+=t.rpcQueues[n].sumHoldTime||0,a.sumBillable+=t.rpcQueues[n].sumBillable||0,a.total+=t.rpcQueues[n].total||0,a.originated+=t.rpcQueues[n].originated||0,a.outboundDropCallsDayCallersExit+=t.rpcQueues[n].outboundDropCallsDayCallersExit||0,a.outboundDropCallsDayTimeout+=t.rpcQueues[n].outboundDropCallsDayTimeout||0)});var e=a.total-a.answered-a.abandoned;a.unmanaged=0<e?e:0,a.avgHoldTime=Math.round(0<a.total?a.sumHoldTime/a.total:0),a.avgHoldTime=new Date(1e3*a.avgHoldTime).toISOString().substr(11,8),a.avgTalkTime=Math.round(0<a.answered?a.sumBillable/a.answered:0),a.avgTalkTime=new Date(1e3*a.avgTalkTime).toISOString().substr(11,8),a.answerRate=Math.round((0<a.total?a.answered/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.abandonRate=Math.round((0<a.total?a.abandoned/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundDropRate=Math.round((0<a.total?a.outboundDropCallsDayTimeout/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundAbandonRate=Math.round((0<a.total?a.outboundDropCallsDayCallersExit/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundanswerRate=0<100-a.outboundDropRate-a.outboundAbandonRate&&a.total?100-a.outboundDropRate-a.outboundAbandonRate:0,i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:n}),1===i.length&&s(),n.promise}}function n(t){var i=[],s=function(){var t=i[0],a={originated:0,limitCalls:0};_.forIn(t.rpcCampaigns,function(e,n){t.rpcCampaigns[n]&&(a.originated+=t.rpcCampaigns[n].originated||0,a.limitCalls+=t.rpcCampaigns[n].limitCalls||0)}),i.shift(),t.defer.resolve(a),0<i.length&&s()};return function(e){var n=t.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:n}),1===i.length&&s(),n.promise}}function t(t,a,e){var i=this;i.license=e,i.onInit=function(){if(i.hasDashboardPermissions=!a.hasRole("user")||a.hasPermission(101),i.hasDashboardPermissions){var e=t.current.name;switch(e){case"app.dashboards.general":n=[],i.license.voice&&n.push("app.dashboards.general.voice"),i.license.dialer&&n.push("app.dashboards.general.dialer"),i.license.chat&&n.push("app.dashboards.general.chat"),i.license.mail&&n.push("app.dashboards.general.mail"),i.license.messaging&&n.push("app.dashboards.general.sms"),i.license.openchannel&&n.push("app.dashboards.general.openchannel"),i.license.fax&&n.push("app.dashboards.general.fax"),i.license.whatsapp&&n.push("app.dashboards.general.whatsapp"),0<n.length&&t.go(_.first(n));break;case"app.dashboards.general.voice":i.selectedTab=0;break;case"app.dashboards.general.dialer":i.selectedTab=1;break;case"app.dashboards.general.chat":i.selectedTab=2;break;case"app.dashboards.general.mail":i.selectedTab=3;break;case"app.dashboards.general.sms":i.selectedTab=4;break;case"app.dashboards.general.openchannel":i.selectedTab=5;break;case"app.dashboards.general.fax":i.selectedTab=6;break;case"app.dashboards.general.whatsapp":i.selectedTab=7}}var n}}e.$inject=["$q"],n.$inject=["$q"],t.$inject=["$state","Auth","license"],angular.module("app.dashboards").factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",n).controller("UserDashboardGeneralController",t)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;function r(){s({queues:o.inboundQueues,rpcQueues:o.rpcQueues}).then(function(e){o.inbound=e})}o.inboundQueues=t?_.keyBy(t.rows?t.rows:[],"id"):{},o.rpcQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},o.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},o.outbound=i||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},o.onSaveQueue=function(e){o.inboundQueues[e.id]&&o.rpcQueues[e.id]&&(o.rpcQueues[e.id]=e,r())},o.onSaveOutbound=function(e){o.outbound=e},n.on("voice_queue:save",o.onSaveQueue),n.on("voice_outbound:save",o.onSaveOutbound),r(),e.$on("$destroy",function(){n.removeListener("voice_queue:save",o.onSaveQueue),n.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","socket","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a){var i=this,s=[];function o(e,n){e.closed||e.UserId||!n||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!n&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!n&&i.inbound.waiting&&(i.inbound.waiting-=1)),n&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.whatsappAccounts,{id:_.toNumber(e.WhatsappAccountId)})}function d(e){var n=moment().utcOffset(0,!0).startOf("day"),t=moment().utcOffset(0,!0).endOf("day");return moment(e).utcOffset(0,!0).isBetween(n,t)}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.whatsappAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateWhatsappInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},n.on("whatsappInteraction:save",i.onSaveWhatsappInteraction),n.on("whatsappInteraction:update",i.onUpdateWhatsappInteraction),function(){if(0<Object.keys(i.whatsappAccounts).length)for(var e=0;e<t.rows.length;e+=1)if(l(t.rows[e])){var n=t.rows[e];o(n,!0),r()}}(),e.$on("$destroy",function(){n.removeAllListeners("whatsappInteraction:save"),n.removeAllListeners("whatsappInteraction:update")})}e.$inject=["$scope","socket","whatsappInteractions","whatsappAccounts"],angular.module("app.dashboards").controller("UserWhatsappDashboardGeneralController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXACCOUNT",g.faxAccount=angular.copy(l),g.faxAccounts=r,g.newFaxAccount=!1,g.faxAccount||(g.faxAccount={waitForTheAssignedAgent:10,waitfortheassignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="FAX.NEW_FAXACCOUNT",g.newFaxAccount=!0),n.params.id&&(g.faxAccount.FaxAccountId=n.params.id),g.addNewFaxAccount=function(){g.errors=[],d.faxAccount.addAccountApplications(g.faxAccount).$promise.then(function(e){g.faxAccounts.unshift(e.toJSON()),o.success({title:"FaxAccount properly created",msg:g.faxAccount.name?g.faxAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxAccount=function(){g.errors=[],d.faxAccount.updateAccountApplications(g.faxAccount).$promise.then(function(e){var n=_.find(g.faxAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FaxAccount properly saved!",msg:g.faxAccount.name?g.faxAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.faxAccount.delete({id:g.faxAccount.id}).$promise.then(function(){_.remove(g.faxAccounts,{id:g.faxAccount.id}),o.success({title:"FaxAccount properly deleted!",msg:(g.faxAccount.name||"faxAccount")+" has been deleted!"}),v(g.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.faxAccount&&(t=_.find(g.lists,{id:Number(g.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.faxAccount&&(a=_.find(g.lists,{id:Number(g.faxAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxAccounts","faxAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:t,faxAccount:r.faxAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[n]=e:r.faxAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.faxAccountApps.rows.length;t++,0){var a=r.faxAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:901}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.faxAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=o.faxAccount.getApplications(r.query,t).$promise},r.editFaxAccountApp=n,r.editInterval=function(e,n){if(r.faxAccountApps.rows.length){var t=r.faxAccountApps.rows[n]?r.faxAccountApps.rows[n]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxAccount.getAgents({id:c.faxAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxAccount?"penalty "+e.UserFaxAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.removeAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxAccount.addAgents({id:c.faxAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxAccount","faxAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("fax")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:901}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountApptagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.faxAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.faxAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.FaxAccountId=m.faxAccount.id,m.query.id=m.faxAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.faxAccount.id,field:"FaxAccountId",route:"faxAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.fax").controller("FaxAccountDispositionsController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"faxAccount",action:"getDispositions",field:"name",params:{id:m.faxAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.faxAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.faxAccountInteractions.rows.length;n+=1){var t=m.faxAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.faxInteraction.get(m.query,p).$promise}function v(e){d.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.faxAccountInteractions.rows,{id:e.id}),m.faxAccountInteractions.count-=1,m.faxAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.fax):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.faxAccount={},m.faxAccountInteractions={count:0,rows:[]},m.selectedFaxAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.faxAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.FaxAccountId=m.faxAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.faxInteractionDownload=function(s,e,n){return d.faxInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="fax-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getFaxAccountInteractions=g,m.createOrEditFaxAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:m.faxAccount,interaction:n,interactions:m.faxAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyfaxInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"fax",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"fax.faxAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||FaxAccountId:=$eq["+m.faxAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(m.selectedFaxAccountInteractions);return m.selectedFaxAccountInteractions=[],e},m.deleteFaxAccountInteraction=v,m.deleteSelectedFaxAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedFaxAccountInteractions.forEach(function(e){v(e)}),m.selectedFaxAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=n,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=e.protocol()+"://"+e.host(),p.faxAccount=c||t.params.faxAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=t.params.tab||0,p.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},p.agentadddialog=function(e,n){a.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:p.faxAccounts?p.faxAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoFaxAccounts=function(){t.go("app.fax.faxAccounts",{},{reload:"app.fax.faxAccounts"})},p.saveFaxAccount=function(){r.faxAccount.updateAccountApplications(p.faxAccount).$promise.then(function(){l.success({title:"FaxAccount updated!",msg:p.faxAccount.name?p.faxAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.trunks,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.trunks,{id:t.id});a.canSelect=!1,n.push(a)}p.trunks=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.trunks,{id:Number(p.faxAccount.TrunkId)}));for(var i=0;i<p.trunks.length;i++)a&&p.trunks[i].id===a.id&&(p.trunks[i].canSelect=!1,t.push(p.trunks[i]));p.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.faxAccount&&(t=_.find(p.lists,{id:Number(p.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.faxAccount&&(a=_.find(p.lists,{id:Number(p.faxAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxAccount","userProfile","userProfileSection"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFaxAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.accounts",{})}},f.agentadddialog=function(e,n){i.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:f.faxAccounts?f.faxAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxAccount")+"?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFaxAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxAccount=function(e,n){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:n,faxAccounts:f.faxAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFaxAccount=y,f.exportSelectedFaxAccounts=function(){var e=angular.copy(f.selectedFaxAccounts);return f.selectedFaxAccounts=[],e},f.deleteSelectedFaxAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+f.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxAccounts.forEach(function(e){y(e)}),f.selectedFaxAccounts=[]})},f.deselectFaxAccounts=function(){f.selectedFaxAccounts=[]},f.selectAllFaxAccounts=function(){f.selectedFaxAccounts=f.faxAccounts.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.faxAccounts.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.faxAccount&&(t=_.find(f.lists,{id:Number(f.faxAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.faxAccount&&(a=_.find(f.lists,{id:Number(f.faxAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.faxAccounts=e||{count:0,rows:[]}}function y(e){m.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.faxAccounts.rows,{id:e.id}),f.faxAccounts.count-=1,f.faxAccounts.rows.length||f.getFaxAccounts(),p.success({title:_.startCase("FaxAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="FAX.EDIT_FAXQUEUE",r.faxQueue=angular.copy(n),r.faxQueues=e,r.newFaxQueue=!1,r.faxQueue||(r.faxQueue={strategy:"beepall",timeout:10},r.title="FAX.NEW_FAXQUEUE",r.newFaxQueue=!0),r.addNewFaxQueue=function(){r.errors=[],i.faxQueue.save(r.faxQueue).$promise.then(function(e){r.faxQueues.unshift(e.toJSON()),a.success({title:"FaxQueue properly created",msg:r.faxQueue.name?r.faxQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveFaxQueue=function(){r.errors=[],i.faxQueue.update({id:r.faxQueue.id},r.faxQueue).$promise.then(function(e){var n=_.find(r.faxQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"FaxQueue properly saved!",msg:r.faxQueue.name?r.faxQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteFaxQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.faxQueue.delete({id:r.faxQueue.id}).$promise.then(function(){_.remove(r.faxQueues,{id:r.faxQueue.id}),a.success({title:"FaxQueue properly deleted!",msg:(r.faxQueue.name||"faxQueue")+" has been deleted!"}),l(r.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","faxQueues","faxQueue","api","Auth","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getAgents({id:c.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.faxQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addAgents({id:c.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.faxQueue.getTeams({id:l.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.faxQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("FAX.ALL_TEAMS"),labelSelected:t.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.removeTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.faxQueue.addTeams({id:l.faxQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.faxQueue=c||e.params.faxQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxQueues=function(){e.go("app.fax.faxQueues",{},{reload:"app.fax.faxQueues"})},u.saveFaxQueue=function(){r.faxQueue.update({id:u.faxQueue.id},u.faxQueue).$promise.then(function(){l.success({title:"FaxQueue updated!",msg:u.faxQueue.name?u.faxQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxQueue","userProfileSection"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.faxQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="faxQueues",f.listOrder="",f.listOrderAsc=null,f.selectedFaxQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:f.faxQueues?f.faxQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("faxQueue")+"?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.fax.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.fax.realtime.queues",{})}},f.success=E,f.getFaxQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.faxQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FaxQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFaxQueue=function(e,n){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:n,faxQueues:f.faxQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteFaxQueue=y,f.exportSelectedFaxQueues=function(){var e=angular.copy(f.selectedFaxQueues);return f.selectedFaxQueues=[],e},f.deleteSelectedFaxQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+f.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFaxQueues.forEach(function(e){y(e)}),f.selectedFaxQueues=[]})},f.deselectFaxQueues=function(){f.selectedFaxQueues=[]},f.selectAllFaxQueues=function(){f.selectedFaxQueues=f.faxQueues.rows};var b=!0,A=1;function E(e){f.faxQueues=e||{count:0,rows:[]}}function y(e){m.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.faxQueues.rows,{id:e.id}),f.faxQueues.count-=1,f.faxQueues.rows.length||f.getFaxQueues(),p.success({title:_.startCase("FaxQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d){var c=this,m=d&&1==d.count?d.rows[0].crudPermissions:null;function u(){c.faxAccounts.rows.forEach(function(n){var e=_.find(c.rpcFaxAccounts.rows,["id",n.id]);e&&_.merge(n,e);var t={id:n.id,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};i.faxAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",i.faxAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){o.error(e.data?e.data.message:e.toString())})})}function p(e){var n=_.find(c.faxAccounts.rows,["id",e.id]);n&&_.merge(n,e)}function g(e){c.faxAccounts.rows=e.rows,u()}c.currentUser=n.getCurrentUser(),c.faxAccounts=r,c.rpcFaxAccounts=l,c.crudPermissions=n.parseCrudPermissions(m),c.query={sort:"name",limit:10,page:1},c.success=g,c.$onInit=u,c.getFaxAccounts=function(){c.query.offset=(c.query.page-1)*c.query.limit,n.hasRole("admin")?c.promise=i.faxAccount.get(c.query,g).$promise:(c.query.id=c.currentUser.userProfileId,c.query.section="FaxAccounts",c.promise=i.userProfile.getResources(c.query,g).$promise)},c.goToFaxAccount=function(e,n){a.go("app.fax.faxAccounts.edit",{id:n.id,faxAccount:n})},s.on("faxAccount:save",p),s.on("faxAccount:update",p),s.on("faxMessage:save",function(e){var n=_.find(c.faxAccounts.rows,["id",e.FaxAccountId]);n&&("in"==e.direction?(n.in+=1,n.lastIn=e.createdAt):(n.out+=1,n.lastOut=e.createdAt))});var v=!0,h=1;e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=h),c.getFaxAccounts())}),e.$on("$destroy",function(){s.removeAllListeners("faxAccount:save"),s.removeAllListeners("faxAccount:update"),s.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$state","api","Auth","socket","toasty","faxAccounts","rpcFaxAccounts","userProfileSection"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,t.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.fax.realtime.agents");break;case 1:t.go("app.fax.realtime.trunks");break;case 2:t.go("app.fax.realtime.queues");break;case 3:t.go("app.fax.realtime.accounts");break;default:t.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"name",limit:10,page:1},u.statusClass=r.STATUS_STYLES,u.stateClass=r.STATES_STYLES,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","realtimeManager","$state","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,n){this.info=e,this.license=n}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKACCOUNT",g.deskAccount=angular.copy(l),g.deskAccounts=r,g.newDeskAccount=!1,g.deskAccount||(g.deskAccount={type:"integrationTab",authType:"basic",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_DESKACCOUNT",g.newDeskAccount=!0),g.addNewDeskAccount=function(){g.errors=[],d.intDeskAccount.save(g.deskAccount).$promise.then(function(e){g.deskAccounts.unshift(e.toJSON()),o.success({title:"DeskAccount properly created",msg:g.deskAccount.name?g.deskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskAccount=function(){g.errors=[],d.intDeskAccount.update({id:g.deskAccount.id},g.deskAccount).$promise.then(function(e){var n=_.find(g.deskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskAccount properly saved!",msg:g.deskAccount.name?g.deskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskAccount.delete({id:g.deskAccount.id}).$promise.then(function(){_.remove(g.deskAccounts,{id:g.deskAccount.id}),o.success({title:"DeskAccount properly deleted!",msg:(g.deskAccount.name||"deskAccount")+" has been deleted!"}),v(g.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","deskAccounts","deskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.deskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="deskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedDeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("deskAccount")+"?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getDeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intDeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="DeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditDeskAccount=function(e,n){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:n,deskAccounts:f.deskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteDeskAccount=y,f.exportSelectedDeskAccounts=function(){var e=angular.copy(f.selectedDeskAccounts);return f.selectedDeskAccounts=[],e},f.deleteSelectedDeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+f.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedDeskAccounts.forEach(function(e){y(e)}),f.selectedDeskAccounts=[]})},f.deselectDeskAccounts=function(){f.selectedDeskAccounts=[]},f.selectAllDeskAccounts=function(){f.selectedDeskAccounts=f.deskAccounts.rows};var b=!0,A=1;function E(e){f.deskAccounts=e||{count:0,rows:[]}}function y(e){m.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.deskAccounts.rows,{id:e.id}),f.deskAccounts.count-=1,f.deskAccounts.rows.length||f.getDeskAccounts(),p.success({title:_.startCase("DeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","deskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.deskAccount={},o.deskConfiguration={},o.configurations=[],o.selectedDeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.deskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDeskAccount.getConfigurations({id:o.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDeskConfiguration=function(e){o.deskConfiguration=o.configurations[e],o.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:o.deskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:o.deskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:o.deskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:o.deskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDeskConfiguration=function(e,n){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDeskConfiguration(0)})},o.deleteDeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(n.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"DeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:o.deskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",g.deskConfiguration=angular.copy(l),g.configurations=r,g.newDeskConfiguration=!1,g.deskConfiguration||(g.deskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_DESKCONFIGURATION",g.newDeskConfiguration=!0),g.addNewDeskConfiguration=function(){g.errors=[],d.intDeskAccount.addConfiguration({id:n.params.id},g.deskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"DeskConfiguration properly created",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskConfiguration=function(){g.errors=[],d.intDeskConfiguration.update({id:g.deskConfiguration.id},g.deskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"DeskConfiguration properly saved!",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDeskConfiguration.delete({id:g.deskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.deskConfiguration.id}),o.success({title:"DeskConfiguration properly deleted!",msg:(g.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),v(g.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","deskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.deskAccount=c||e.params.deskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts",{},{reload:"app.integrations.deskAccounts"})},u.saveDeskAccount=function(){r.intDeskAccount.update({id:u.deskAccount.id},u.deskAccount).$promise.then(function(){l.success({title:"DeskAccount updated!",msg:u.deskAccount.name?u.deskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","deskAccount","userProfileSection"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT",v.dynamics365Account=angular.copy(l),v.dynamics365Accounts=r,v.cloudProviders=d,v.newDynamics365Account=!1,v.dynamics365Account||(v.dynamics365Account={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),modernAuthentication:!1},v.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",v.newDynamics365Account=!0),v.addNewDynamics365Account=function(){v.errors=[],c.intDynamics365Account.save(v.dynamics365Account).$promise.then(function(e){v.dynamics365Accounts.unshift(e.toJSON()),o.success({title:"Dynamics365Account properly created",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveDynamics365Account=function(){v.errors=[],c.intDynamics365Account.update({id:v.dynamics365Account.id},v.dynamics365Account).$promise.then(function(e){var n=_.find(v.dynamics365Accounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Account properly saved!",msg:v.dynamics365Account.name?v.dynamics365Account.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteDynamics365Account=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Account will be deleted.").ariaLabel("Delete Dynamics365Account").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Account.delete({id:v.dynamics365Account.id}).$promise.then(function(){_.remove(v.dynamics365Accounts,{id:v.dynamics365Account.id}),o.success({title:"Dynamics365Account properly deleted!",msg:(v.dynamics365Account.name||"dynamics365Account")+" has been deleted!"}),h(v.dynamics365Account)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dynamics365Accounts","dynamics365Account","cloudProviders","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=h,b.setting=f,b.currentUser=v.getCurrentUser(),b.dynamics365Accounts=l||{count:0,rows:[]},b.cloudProviders=d||{count:0,rows:[]},b.userProfile=c,b.userProfileSection=m&&1==m.count?m.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dynamics365Accounts",b.listOrder="",b.listOrderAsc=null,b.selectedDynamics365Accounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description,modernAuthentication",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,n){t.go("app.integrations.dynamics365Accounts.edit",{id:e.id,dynamics365Account:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,n){return u.intDynamics365Account.getFields({id:e.id,test:!0}).$promise.then(function(){g.success({title:"Dynamics365Account properly tested",msg:"Connection succeded!"})}).catch(function(e){g.error({title:"Dynamics365Account properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("dynamics365Account")+"?").htmlContent("<b>"+(e.name||"dynamics365Account")+"</b> will be deleted.").ariaLabel("delete dynamics365Account").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDynamics365Accounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,v.hasRole("admin")?b.promise=u.intDynamics365Account.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dynamics365Accounts",b.promise=u.userProfile.getResources(b.query,y).$promise)},b.createOrEditDynamics365Account=function(e,n){i.show({controller:"CreateOrEditDynamics365AccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Account:n,dynamics365Accounts:b.dynamics365Accounts.rows,cloudProviders:b.cloudProviders.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDynamics365Account=S,b.exportSelectedDynamics365Accounts=function(){var e=angular.copy(b.selectedDynamics365Accounts);return b.selectedDynamics365Accounts=[],e},b.deleteSelectedDynamics365Accounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected dynamics365Accounts?").htmlContent("<b>"+b.selectedDynamics365Accounts.length+" selected</b> will be deleted.").ariaLabel("delete Dynamics365Accounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedDynamics365Accounts.forEach(function(e){S(e)}),b.selectedDynamics365Accounts=[]})},b.deselectDynamics365Accounts=function(){b.selectedDynamics365Accounts=[]},b.selectAllDynamics365Accounts=function(){b.selectedDynamics365Accounts=b.dynamics365Accounts.rows};var A=!0,E=1;function y(e){b.dynamics365Accounts=e||{count:0,rows:[]}}function S(e){u.intDynamics365Account.delete({id:e.id}).$promise.then(function(){_.remove(b.dynamics365Accounts.rows,{id:e.id}),b.dynamics365Accounts.count-=1,b.dynamics365Accounts.rows.length||b.getDynamics365Accounts(),g.success({title:_.startCase("Dynamics365Account")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDynamics365Account"}];for(var n=0;n<e.data.errors.length;n++)g.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else g.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDynamics365Account",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){A?o(function(){A=!1}):(n||(E=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=E),b.getDynamics365Accounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dynamics365Accounts","cloudProviders","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("Dynamics365AccountsController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.dynamics365Account={},o.dynamics365Configuration={},o.configurations=[],o.selectedDynamics365Configuration=-1,o.crudPermissions,o.init=function(e,n){o.dynamics365Account=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDynamics365Account.getConfigurations({id:o.dynamics365Account.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDynamics365Configuration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDynamics365Configuration=function(e){o.advancedForm&&o.advancedForm.$setPristine();o.dynamics365Configuration=o.configurations[e],o.selectedDynamics365Configuration=e,i.intDynamics365Configuration.getSubjects({id:o.dynamics365Configuration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDynamics365Configuration.getDescriptions({id:o.dynamics365Configuration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDynamics365Configuration.getFields({id:o.dynamics365Configuration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDynamics365Configuration=function(e,n){a.show({controller:"CreateOrEditDynamics365ConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Configuration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDynamics365Configuration(0)})},o.deleteDynamics365Configuration=function(e,n){var t=a.confirm().title("Are you sure want to delete the dynamics365Configuration?").htmlContent("<b>"+(n.name||"dynamics365Configuration")+"</b> will be deleted.").ariaLabel("delete dynamics365Configuration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intDynamics365Configuration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"Dynamics365Configuration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDynamics365Configuration(0)})},function(){console.log("CANCEL")})},o.saveDynamics365Configuration=function(){o.errors=[],i.intDynamics365Configuration.update({id:o.dynamics365Configuration.id},o.dynamics365Configuration).$promise.then(function(e){var n=_.find(o.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.advancedForm.$setPristine(),s.success({title:"Dynamics365Configuration properly saved!",msg:o.dynamics365Configuration.name?o.dynamics365Configuration.name+" has been saved!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("Dynamics365AccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365CONFIGURATION",g.dynamics365Configuration=angular.copy(l),g.configurations=r,g.newDynamics365Configuration=!1,g.dynamics365Configuration||(g.dynamics365Configuration={channel:"voice",type:"inbound",ticketType:"incident"},g.title="INTEGRATIONS.NEW_DYNAMICS365CONFIGURATION",g.newDynamics365Configuration=!0),g.addNewDynamics365Configuration=function(){g.errors=[],d.intDynamics365Account.addConfiguration({id:n.params.id},g.dynamics365Configuration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"Dynamics365Configuration properly created",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Configuration=function(){g.errors=[],d.intDynamics365Configuration.update({id:g.dynamics365Configuration.id},g.dynamics365Configuration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Dynamics365Configuration properly saved!",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Configuration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dynamics365Configuration will be deleted.").ariaLabel("Delete Dynamics365Configuration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intDynamics365Configuration.delete({id:g.dynamics365Configuration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.dynamics365Configuration.id}),o.success({title:"Dynamics365Configuration properly deleted!",msg:(g.dynamics365Configuration.name||"dynamics365Configuration")+" has been deleted!"}),v(g.dynamics365Configuration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","dynamics365Configuration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365ConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intDynamics365Field.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.dynamics365Account=c||e.params.dynamics365Account||{},p.cloudProviders=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.alert=l.info,p.gotoDynamics365Accounts=function(){e.go("app.integrations.dynamics365Accounts",{},{reload:"app.integrations.dynamics365Accounts"})},p.saveDynamics365Account=function(){r.intDynamics365Account.update({id:p.dynamics365Account.id},p.dynamics365Account).$promise.then(function(){l.success({title:"Dynamics365Account updated!",msg:p.dynamics365Account.name?p.dynamics365Account.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDynamics365Account",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","dynamics365Account","cloudProviders","userProfileSection"],angular.module("app.integrations").controller("Dynamics365AccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",g.freshdeskAccount=angular.copy(l),g.freshdeskAccounts=r,g.newFreshdeskAccount=!1,g.freshdeskAccount||(g.freshdeskAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",g.newFreshdeskAccount=!0),g.addNewFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.save(g.freshdeskAccount).$promise.then(function(e){g.freshdeskAccounts.unshift(e.toJSON()),o.success({title:"FreshdeskAccount properly created",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.update({id:g.freshdeskAccount.id},g.freshdeskAccount).$promise.then(function(e){var n=_.find(g.freshdeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskAccount properly saved!",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskAccount.delete({id:g.freshdeskAccount.id}).$promise.then(function(){_.remove(g.freshdeskAccounts,{id:g.freshdeskAccount.id}),o.success({title:"FreshdeskAccount properly deleted!",msg:(g.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),v(g.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshdeskAccount={},o.freshdeskConfiguration={},o.configurations=[],o.selectedFreshdeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshdeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshdeskAccount.getConfigurations({id:o.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshdeskConfiguration=function(e){o.freshdeskConfiguration=o.configurations[e],o.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:o.freshdeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:o.freshdeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshdeskConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshdeskConfiguration(0)})},o.deleteFreshdeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(n.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshdeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshdeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:o.freshdeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",g.freshdeskConfiguration=angular.copy(l),g.configurations=r,g.newFreshdeskConfiguration=!1,g.freshdeskConfiguration||(g.freshdeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",g.newFreshdeskConfiguration=!0),g.addNewFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskAccount.addConfiguration({id:n.params.id},g.freshdeskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshdeskConfiguration properly created",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskConfiguration.update({id:g.freshdeskConfiguration.id},g.freshdeskConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshdeskConfiguration properly saved!",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshdeskConfiguration.delete({id:g.freshdeskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshdeskConfiguration.id}),o.success({title:"FreshdeskConfiguration properly deleted!",msg:(g.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),v(g.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshdeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshdeskAccount=c||e.params.freshdeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts",{},{reload:"app.integrations.freshdeskAccounts"})},u.saveFreshdeskAccount=function(){r.intFreshdeskAccount.update({id:u.freshdeskAccount.id},u.freshdeskAccount).$promise.then(function(){l.success({title:"FreshdeskAccount updated!",msg:u.freshdeskAccount.name?u.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshdeskAccount","userProfileSection"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshdeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshdeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshdeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshdeskAccount")+"?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshdeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshdeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshdeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshdeskAccount=function(e,n){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:n,freshdeskAccounts:f.freshdeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshdeskAccount=y,f.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(f.selectedFreshdeskAccounts);return f.selectedFreshdeskAccounts=[],e},f.deleteSelectedFreshdeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+f.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshdeskAccounts.forEach(function(e){y(e)}),f.selectedFreshdeskAccounts=[]})},f.deselectFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=[]},f.selectAllFreshdeskAccounts=function(){f.selectedFreshdeskAccounts=f.freshdeskAccounts.rows};var b=!0,A=1;function E(e){f.freshdeskAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshdeskAccounts.rows,{id:e.id}),f.freshdeskAccounts.count-=1,f.freshdeskAccounts.rows.length||f.getFreshdeskAccounts(),p.success({title:_.startCase("FreshdeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshdeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESACCOUNT",g.freshsalesAccount=angular.copy(l),g.freshsalesAccounts=r,g.newFreshsalesAccount=!1,g.freshsalesAccount||(g.freshsalesAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_FRESHSALESACCOUNT",g.newFreshsalesAccount=!0),g.addNewFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.save(g.freshsalesAccount).$promise.then(function(e){g.freshsalesAccounts.unshift(e.toJSON()),o.success({title:"FreshsalesAccount properly created",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesAccount=function(){g.errors=[],d.intFreshsalesAccount.update({id:g.freshsalesAccount.id},g.freshsalesAccount).$promise.then(function(e){var n=_.find(g.freshsalesAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesAccount properly saved!",msg:g.freshsalesAccount.name?g.freshsalesAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesAccount will be deleted.").ariaLabel("Delete FreshsalesAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesAccount.delete({id:g.freshsalesAccount.id}).$promise.then(function(){_.remove(g.freshsalesAccounts,{id:g.freshsalesAccount.id}),o.success({title:"FreshsalesAccount properly deleted!",msg:(g.freshsalesAccount.name||"freshsalesAccount")+" has been deleted!"}),v(g.freshsalesAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshsalesAccounts","freshsalesAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshsalesField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshsalesAccount={},o.freshsalesConfiguration={},o.configurations=[],o.selectedFreshsalesConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.freshsalesAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshsalesAccount.getConfigurations({id:o.freshsalesAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshsalesConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshsalesConfiguration=function(e){o.freshsalesConfiguration=o.configurations[e],o.selectedFreshsalesConfiguration=e,i.intFreshsalesConfiguration.getSubjects({id:o.freshsalesConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshsalesConfiguration.getDescriptions({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshsalesConfiguration.getFields({id:o.freshsalesConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshsalesConfiguration=function(e,n){a.show({controller:"CreateOrEditFreshsalesConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshsalesConfiguration(0)})},o.deleteFreshsalesConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the freshsalesConfiguration?").htmlContent("<b>"+(n.name||"freshsalesConfiguration")+"</b> will be deleted.").ariaLabel("delete freshsalesConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intFreshsalesConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"FreshsalesConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshsalesConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditFreshsalesAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.freshsalesConfiguration,account:o.freshsalesAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshsalesAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHSALESCONFIGURATION",g.freshsalesConfiguration=angular.copy(l),g.configurations=r,g.newFreshsalesConfiguration=!1,g.freshsalesConfiguration||(g.freshsalesConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHSALESCONFIGURATION",g.newFreshsalesConfiguration=!0),g.addNewFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesAccount.addConfiguration({id:n.params.id},g.freshsalesConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshsalesConfiguration properly created",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshsalesConfiguration=function(){g.errors=[],d.intFreshsalesConfiguration.update({id:g.freshsalesConfiguration.id},g.freshsalesConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"FreshsalesConfiguration properly saved!",msg:g.freshsalesConfiguration.name?g.freshsalesConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshsalesConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The freshsalesConfiguration will be deleted.").ariaLabel("Delete FreshsalesConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intFreshsalesConfiguration.delete({id:g.freshsalesConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshsalesConfiguration.id}),o.success({title:"FreshsalesConfiguration properly deleted!",msg:(g.freshsalesConfiguration.name||"freshsalesConfiguration")+" has been deleted!"}),v(g.freshsalesConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshsalesConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshsalesConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshsalesConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshsalesField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intFreshsalesField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshsalesAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshsalesAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.freshsalesAccount=c||e.params.freshsalesAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshsalesAccounts=function(){e.go("app.integrations.freshsalesAccounts",{},{reload:"app.integrations.freshsalesAccounts"})},u.saveFreshsalesAccount=function(){r.intFreshsalesAccount.update({id:u.freshsalesAccount.id},u.freshsalesAccount).$promise.then(function(){l.success({title:"FreshsalesAccount updated!",msg:u.freshsalesAccount.name?u.freshsalesAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshsalesAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshsalesAccount","userProfileSection"],angular.module("app.integrations").controller("FreshsalesAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.freshsalesAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="freshsalesAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedFreshsalesAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.freshsalesAccounts.edit",{id:e.id,freshsalesAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intFreshsalesAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshsalesAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshsalesAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("freshsalesAccount")+"?").htmlContent("<b>"+(e.name||"freshsalesAccount")+"</b> will be deleted.").ariaLabel("delete freshsalesAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getFreshsalesAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intFreshsalesAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="FreshsalesAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditFreshsalesAccount=function(e,n){i.show({controller:"CreateOrEditFreshsalesAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshsalesAccount:n,freshsalesAccounts:f.freshsalesAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteFreshsalesAccount=y,f.exportSelectedFreshsalesAccounts=function(){var e=angular.copy(f.selectedFreshsalesAccounts);return f.selectedFreshsalesAccounts=[],e},f.deleteSelectedFreshsalesAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected freshsalesAccounts?").htmlContent("<b>"+f.selectedFreshsalesAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshsalesAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedFreshsalesAccounts.forEach(function(e){y(e)}),f.selectedFreshsalesAccounts=[]})},f.deselectFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=[]},f.selectAllFreshsalesAccounts=function(){f.selectedFreshsalesAccounts=f.freshsalesAccounts.rows};var b=!0,A=1;function E(e){f.freshsalesAccounts=e||{count:0,rows:[]}}function y(e){m.intFreshsalesAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.freshsalesAccounts.rows,{id:e.id}),f.freshsalesAccounts.count-=1,f.freshsalesAccounts.rows.length||f.getFreshsalesAccounts(),p.success({title:_.startCase("FreshsalesAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshsalesAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshsalesAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getFreshsalesAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshsalesAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("FreshsalesAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",g.salesforceAccount=angular.copy(l),g.salesforceAccounts=r,g.newSalesforceAccount=!1,g.salesforceAccount||(g.salesforceAccount={type:"integrationTab",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",g.newSalesforceAccount=!0),g.addNewSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.save(g.salesforceAccount).$promise.then(function(e){g.salesforceAccounts.unshift(e.toJSON()),o.success({title:"SalesforceAccount properly created",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.update({id:g.salesforceAccount.id},g.salesforceAccount).$promise.then(function(e){var n=_.find(g.salesforceAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceAccount properly saved!",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceAccount.delete({id:g.salesforceAccount.id}).$promise.then(function(){_.remove(g.salesforceAccounts,{id:g.salesforceAccount.id}),o.success({title:"SalesforceAccount properly deleted!",msg:(g.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),v(g.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function n(){return"Case"===o.salesforceConfiguration.ticketType&&("lead"===o.salesforceConfiguration.moduleCreate||_.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch))}function r(){return _.includes(["lead","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function l(){return _.includes(["contact","contact_lead","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function d(){return _.includes(["account","account_contact_lead"],o.salesforceConfiguration.moduleSearch)}function c(){return i.intSalesforceConfiguration.update({id:o.salesforceConfiguration.id},o.salesforceConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function m(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function u(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.salesforceAccount={},o.salesforceConfiguration={},o.configurations=[],o.selectedSalesforceConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.salesforceAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSalesforceAccount.getConfigurations({id:o.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSalesforceConfiguration=function(e){o.salesforceConfiguration=o.configurations[e],o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),o.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:o.salesforceConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:o.salesforceConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:o.salesforceConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSalesforceConfiguration=function(e,n){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSalesforceConfiguration(0)})},o.deleteSalesforceConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(n.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSalesforceConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SalesforceConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){o.salesforceConfiguration.isLead=n(),o.salesforceConfiguration.isLeadSearch=r(),o.salesforceConfiguration.isContactSearch=l(),o.salesforceConfiguration.isAccountSearch=d(),c()},o.salesforceConfiguration.isLead=!1,o.salesforceConfiguration.isLeadSearch=!1,o.salesforceConfiguration.isContactSearch=!1,o.salesforceConfiguration.isAccountSearch=!1,o.checkIsLead=n,o.checkIsLeadSearch=r,o.checkIsContactSearch=l,o.checkIsAccountSearch=d,o.saveSalesforceConfiguration=c,o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){m(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){m(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){u(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){u(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){p(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){p(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",g.salesforceConfiguration=angular.copy(l),g.configurations=r,g.newSalesforceConfiguration=!1,g.salesforceConfiguration||(g.salesforceConfiguration={channel:"voice",type:"inbound",ticketType:"Task"},g.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",g.newSalesforceConfiguration=!0),g.addNewSalesforceConfiguration=function(){g.errors=[],d.intSalesforceAccount.addConfiguration({id:n.params.id},g.salesforceConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SalesforceConfiguration properly created",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceConfiguration=function(){g.errors=[],d.intSalesforceConfiguration.update({id:g.salesforceConfiguration.id},g.salesforceConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SalesforceConfiguration properly saved!",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSalesforceConfiguration.delete({id:g.salesforceConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.salesforceConfiguration.id}),o.success({title:"SalesforceConfiguration properly deleted!",msg:(g.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),v(g.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","salesforceConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSalesforceField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.salesforceAccount=c||e.params.salesforceAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts",{},{reload:"app.integrations.salesforceAccounts"})},u.saveSalesforceAccount=function(){r.intSalesforceAccount.update({id:u.salesforceAccount.id},u.salesforceAccount).$promise.then(function(){l.success({title:"SalesforceAccount updated!",msg:u.salesforceAccount.name?u.salesforceAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","salesforceAccount","userProfileSection"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.salesforceAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="salesforceAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSalesforceAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("salesforceAccount")+"?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSalesforceAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSalesforceAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SalesforceAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSalesforceAccount=function(e,n){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:n,salesforceAccounts:f.salesforceAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSalesforceAccount=y,f.exportSelectedSalesforceAccounts=function(){var e=angular.copy(f.selectedSalesforceAccounts);return f.selectedSalesforceAccounts=[],e},f.deleteSelectedSalesforceAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+f.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSalesforceAccounts.forEach(function(e){y(e)}),f.selectedSalesforceAccounts=[]})},f.deselectSalesforceAccounts=function(){f.selectedSalesforceAccounts=[]},f.selectAllSalesforceAccounts=function(){f.selectedSalesforceAccounts=f.salesforceAccounts.rows};var b=!0,A=1;function E(e){f.salesforceAccounts=e||{count:0,rows:[]}}function y(e){m.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.salesforceAccounts.rows,{id:e.id}),f.salesforceAccounts.count-=1,f.salesforceAccounts.rows.length||f.getSalesforceAccounts(),p.success({title:_.startCase("SalesforceAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","salesforceAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWACCOUNT",g.servicenowAccount=angular.copy(l),g.servicenowAccounts=r,g.newServicenowAccount=!1,g.servicenowAccount||(g.servicenowAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SERVICENOWACCOUNT",g.newServicenowAccount=!0),g.addNewServicenowAccount=function(){g.errors=[],d.intServicenowAccount.save(g.servicenowAccount).$promise.then(function(e){g.servicenowAccounts.unshift(e.toJSON()),o.success({title:"ServicenowAccount properly created",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowAccount=function(){g.errors=[],d.intServicenowAccount.update({id:g.servicenowAccount.id},g.servicenowAccount).$promise.then(function(e){var n=_.find(g.servicenowAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowAccount properly saved!",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowAccount will be deleted.").ariaLabel("Delete ServicenowAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowAccount.delete({id:g.servicenowAccount.id}).$promise.then(function(){_.remove(g.servicenowAccounts,{id:g.servicenowAccount.id}),o.success({title:"ServicenowAccount properly deleted!",msg:(g.servicenowAccount.name||"servicenowAccount")+" has been deleted!"}),v(g.servicenowAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","servicenowAccounts","servicenowAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.servicenowAccount={},o.servicenowConfiguration={},o.configurations=[],o.selectedServicenowConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.servicenowAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intServicenowAccount.getConfigurations({id:o.servicenowAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getServicenowConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getServicenowConfiguration=function(e){o.servicenowConfiguration=o.configurations[e],o.selectedServicenowConfiguration=e,i.intServicenowConfiguration.getSubjects({id:o.servicenowConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intServicenowConfiguration.getDescriptions({id:o.servicenowConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intServicenowConfiguration.getFields({id:o.servicenowConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditServicenowConfiguration=function(e,n){a.show({controller:"CreateOrEditServicenowConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getServicenowConfiguration(0)})},o.deleteServicenowConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the servicenowConfiguration?").htmlContent("<b>"+(n.name||"servicenowConfiguration")+"</b> will be deleted.").ariaLabel("delete servicenowConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intServicenowConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ServicenowConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getServicenowConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ServicenowAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWCONFIGURATION",g.servicenowConfiguration=angular.copy(l),g.configurations=r,g.newServicenowConfiguration=!1,g.servicenowConfiguration||(g.servicenowConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SERVICENOWCONFIGURATION",g.newServicenowConfiguration=!0),g.addNewServicenowConfiguration=function(){g.errors=[],d.intServicenowAccount.addConfiguration({id:n.params.id},g.servicenowConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ServicenowConfiguration properly created",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowConfiguration=function(){g.errors=[],d.intServicenowConfiguration.update({id:g.servicenowConfiguration.id},g.servicenowConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ServicenowConfiguration properly saved!",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The servicenowConfiguration will be deleted.").ariaLabel("Delete ServicenowConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intServicenowConfiguration.delete({id:g.servicenowConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.servicenowConfiguration.id}),o.success({title:"ServicenowConfiguration properly deleted!",msg:(g.servicenowConfiguration.name||"servicenowConfiguration")+" has been deleted!"}),v(g.servicenowConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","servicenowConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intServicenowField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.servicenowAccount=c||e.params.servicenowAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoServicenowAccounts=function(){e.go("app.integrations.servicenowAccounts",{},{reload:"app.integrations.servicenowAccounts"})},u.saveServicenowAccount=function(){r.intServicenowAccount.update({id:u.servicenowAccount.id},u.servicenowAccount).$promise.then(function(){l.success({title:"ServicenowAccount updated!",msg:u.servicenowAccount.name?u.servicenowAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintServicenowAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","servicenowAccount","userProfileSection"],angular.module("app.integrations").controller("ServicenowAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.servicenowAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="servicenowAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedServicenowAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.servicenowAccounts.edit",{id:e.id,servicenowAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intServicenowAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ServicenowAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ServicenowAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("servicenowAccount")+"?").htmlContent("<b>"+(e.name||"servicenowAccount")+"</b> will be deleted.").ariaLabel("delete servicenowAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getServicenowAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intServicenowAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ServicenowAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditServicenowAccount=function(e,n){i.show({controller:"CreateOrEditServicenowAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowAccount:n,servicenowAccounts:f.servicenowAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteServicenowAccount=y,f.exportSelectedServicenowAccounts=function(){var e=angular.copy(f.selectedServicenowAccounts);return f.selectedServicenowAccounts=[],e},f.deleteSelectedServicenowAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected servicenowAccounts?").htmlContent("<b>"+f.selectedServicenowAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ServicenowAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedServicenowAccounts.forEach(function(e){y(e)}),f.selectedServicenowAccounts=[]})},f.deselectServicenowAccounts=function(){f.selectedServicenowAccounts=[]},f.selectAllServicenowAccounts=function(){f.selectedServicenowAccounts=f.servicenowAccounts.rows};var b=!0,A=1;function E(e){f.servicenowAccounts=e||{count:0,rows:[]}}function y(e){m.intServicenowAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.servicenowAccounts.rows,{id:e.id}),f.servicenowAccounts.count-=1,f.servicenowAccounts.rows.length||f.getServicenowAccounts(),p.success({title:_.startCase("ServicenowAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintServicenowAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintServicenowAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getServicenowAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","servicenowAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ServicenowAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",g.sugarcrmAccount=angular.copy(l),g.sugarcrmAccounts=r,g.newSugarcrmAccount=!1,g.sugarcrmAccount||(g.sugarcrmAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",g.newSugarcrmAccount=!0),g.addNewSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.save(g.sugarcrmAccount).$promise.then(function(e){g.sugarcrmAccounts.unshift(e.toJSON()),o.success({title:"SugarcrmAccount properly created",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.update({id:g.sugarcrmAccount.id},g.sugarcrmAccount).$promise.then(function(e){var n=_.find(g.sugarcrmAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmAccount properly saved!",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmAccount.delete({id:g.sugarcrmAccount.id}).$promise.then(function(){_.remove(g.sugarcrmAccounts,{id:g.sugarcrmAccount.id}),o.success({title:"SugarcrmAccount properly deleted!",msg:(g.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),v(g.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.sugarcrmAccount={},o.sugarcrmConfiguration={},o.configurations=[],o.selectedSugarcrmConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.sugarcrmAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSugarcrmAccount.getConfigurations({id:o.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSugarcrmConfiguration=function(e){o.sugarcrmConfiguration=o.configurations[e],o.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:o.sugarcrmConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSugarcrmConfiguration=function(e,n){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSugarcrmConfiguration(0)})},o.deleteSugarcrmConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(n.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intSugarcrmConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"SugarcrmConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",g.sugarcrmConfiguration=angular.copy(l),g.configurations=r,g.newSugarcrmConfiguration=!1,g.sugarcrmConfiguration||(g.sugarcrmConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",g.newSugarcrmConfiguration=!0),g.addNewSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmAccount.addConfiguration({id:n.params.id},g.sugarcrmConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SugarcrmConfiguration properly created",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmConfiguration.update({id:g.sugarcrmConfiguration.id},g.sugarcrmConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SugarcrmConfiguration properly saved!",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intSugarcrmConfiguration.delete({id:g.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.sugarcrmConfiguration.id}),o.success({title:"SugarcrmConfiguration properly deleted!",msg:(g.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),v(g.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intSugarcrmField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.sugarcrmAccount=c||e.params.sugarcrmAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts",{},{reload:"app.integrations.sugarcrmAccounts"})},u.saveSugarcrmAccount=function(){r.intSugarcrmAccount.update({id:u.sugarcrmAccount.id},u.sugarcrmAccount).$promise.then(function(){l.success({title:"SugarcrmAccount updated!",msg:u.sugarcrmAccount.name?u.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","sugarcrmAccount","userProfileSection"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sugarcrmAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sugarcrmAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSugarcrmAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sugarcrmAccount")+"?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSugarcrmAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intSugarcrmAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SugarcrmAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSugarcrmAccount=function(e,n){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:n,sugarcrmAccounts:f.sugarcrmAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSugarcrmAccount=y,f.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(f.selectedSugarcrmAccounts);return f.selectedSugarcrmAccounts=[],e},f.deleteSelectedSugarcrmAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+f.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSugarcrmAccounts.forEach(function(e){y(e)}),f.selectedSugarcrmAccounts=[]})},f.deselectSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=[]},f.selectAllSugarcrmAccounts=function(){f.selectedSugarcrmAccounts=f.sugarcrmAccounts.rows};var b=!0,A=1;function E(e){f.sugarcrmAccounts=e||{count:0,rows:[]}}function y(e){m.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.sugarcrmAccounts.rows,{id:e.id}),f.sugarcrmAccounts.count-=1,f.sugarcrmAccounts.rows.length||f.getSugarcrmAccounts(),p.success({title:_.startCase("SugarcrmAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sugarcrmAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERACCOUNT",g.vtigerAccount=angular.copy(l),g.vtigerAccounts=r,g.newVtigerAccount=!1,g.vtigerAccount||(g.vtigerAccount={serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_VTIGERACCOUNT",g.newVtigerAccount=!0),g.addNewVtigerAccount=function(){g.errors=[],d.intVtigerAccount.save(g.vtigerAccount).$promise.then(function(e){g.vtigerAccounts.unshift(e.toJSON()),o.success({title:"VtigerAccount properly created",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerAccount=function(){g.errors=[],d.intVtigerAccount.update({id:g.vtigerAccount.id},g.vtigerAccount).$promise.then(function(e){var n=_.find(g.vtigerAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerAccount properly saved!",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerAccount will be deleted.").ariaLabel("Delete VtigerAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerAccount.delete({id:g.vtigerAccount.id}).$promise.then(function(){_.remove(g.vtigerAccounts,{id:g.vtigerAccount.id}),o.success({title:"VtigerAccount properly deleted!",msg:(g.vtigerAccount.name||"vtigerAccount")+" has been deleted!"}),v(g.vtigerAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","vtigerAccounts","vtigerAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.vtigerAccount={},o.vtigerConfiguration={},o.configurations=[],o.selectedVtigerConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.vtigerAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intVtigerAccount.getConfigurations({id:o.vtigerAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getVtigerConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getVtigerConfiguration=function(e){o.vtigerConfiguration=o.configurations[e],o.selectedVtigerConfiguration=e,i.intVtigerConfiguration.getSubjects({id:o.vtigerConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intVtigerConfiguration.getDescriptions({id:o.vtigerConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intVtigerConfiguration.getFields({id:o.vtigerConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditVtigerConfiguration=function(e,n){a.show({controller:"CreateOrEditVtigerConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getVtigerConfiguration(0)})},o.deleteVtigerConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the vtigerConfiguration?").htmlContent("<b>"+(n.name||"vtigerConfiguration")+"</b> will be deleted.").ariaLabel("delete vtigerConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intVtigerConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"VtigerConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getVtigerConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("VtigerAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERCONFIGURATION",g.vtigerConfiguration=angular.copy(l),g.configurations=r,g.newVtigerConfiguration=!1,g.vtigerConfiguration||(g.vtigerConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_VTIGERCONFIGURATION",g.newVtigerConfiguration=!0),g.addNewVtigerConfiguration=function(){g.errors=[],d.intVtigerAccount.addConfiguration({id:n.params.id},g.vtigerConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"VtigerConfiguration properly created",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerConfiguration=function(){g.errors=[],d.intVtigerConfiguration.update({id:g.vtigerConfiguration.id},g.vtigerConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VtigerConfiguration properly saved!",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The vtigerConfiguration will be deleted.").ariaLabel("Delete VtigerConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intVtigerConfiguration.delete({id:g.vtigerConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.vtigerConfiguration.id}),o.success({title:"VtigerConfiguration properly deleted!",msg:(g.vtigerConfiguration.name||"vtigerConfiguration")+" has been deleted!"}),v(g.vtigerConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","vtigerConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intVtigerField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.vtigerAccount=c||e.params.vtigerAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVtigerAccounts=function(){e.go("app.integrations.vtigerAccounts",{},{reload:"app.integrations.vtigerAccounts"})},u.saveVtigerAccount=function(){r.intVtigerAccount.update({id:u.vtigerAccount.id},u.vtigerAccount).$promise.then(function(){l.success({title:"VtigerAccount updated!",msg:u.vtigerAccount.name?u.vtigerAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintVtigerAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","vtigerAccount","userProfileSection"],angular.module("app.integrations").controller("VtigerAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.vtigerAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="vtigerAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedVtigerAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.integrations.vtigerAccounts.edit",{id:e.id,vtigerAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intVtigerAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"VtigerAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"VtigerAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("vtigerAccount")+"?").htmlContent("<b>"+(e.name||"vtigerAccount")+"</b> will be deleted.").ariaLabel("delete vtigerAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVtigerAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intVtigerAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VtigerAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVtigerAccount=function(e,n){i.show({controller:"CreateOrEditVtigerAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerAccount:n,vtigerAccounts:f.vtigerAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVtigerAccount=y,f.exportSelectedVtigerAccounts=function(){var e=angular.copy(f.selectedVtigerAccounts);return f.selectedVtigerAccounts=[],e},f.deleteSelectedVtigerAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected vtigerAccounts?").htmlContent("<b>"+f.selectedVtigerAccounts.length+" selected</b> will be deleted.").ariaLabel("delete VtigerAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVtigerAccounts.forEach(function(e){y(e)}),f.selectedVtigerAccounts=[]})},f.deselectVtigerAccounts=function(){f.selectedVtigerAccounts=[]},f.selectAllVtigerAccounts=function(){f.selectedVtigerAccounts=f.vtigerAccounts.rows};var b=!0,A=1;function E(e){f.vtigerAccounts=e||{count:0,rows:[]}}function y(e){m.intVtigerAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.vtigerAccounts.rows,{id:e.id}),f.vtigerAccounts.count-=1,f.vtigerAccounts.rows.length||f.getVtigerAccounts(),p.success({title:_.startCase("VtigerAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintVtigerAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintVtigerAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVtigerAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","vtigerAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("VtigerAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",g.zendeskAccount=angular.copy(l),g.zendeskAccounts=r,g.newZendeskAccount=!1,g.zendeskAccount||(g.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",g.newZendeskAccount=!0),g.addNewZendeskAccount=function(){g.errors=[],d.intZendeskAccount.save(g.zendeskAccount).$promise.then(function(e){g.zendeskAccounts.unshift(e.toJSON()),o.success({title:"ZendeskAccount properly created",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskAccount=function(){g.errors=[],d.intZendeskAccount.update({id:g.zendeskAccount.id},g.zendeskAccount).$promise.then(function(e){var n=_.find(g.zendeskAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskAccount properly saved!",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskAccount.delete({id:g.zendeskAccount.id}).$promise.then(function(){_.remove(g.zendeskAccounts,{id:g.zendeskAccount.id}),o.success({title:"ZendeskAccount properly deleted!",msg:(g.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),v(g.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZendeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zendeskAccount=c||e.params.zendeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts",{},{reload:"app.integrations.zendeskAccounts"})},u.saveZendeskAccount=function(){r.intZendeskAccount.update({id:u.zendeskAccount.id},u.zendeskAccount).$promise.then(function(){l.success({title:"ZendeskAccount updated!",msg:u.zendeskAccount.name?u.zendeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zendeskAccount","userProfileSection"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zendeskAccount={},o.zendeskConfiguration={},o.zendeskConfigurations=[],o.selectedZendeskConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zendeskAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZendeskAccount.getConfigurations({id:o.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.zendeskConfigurations=e.rows?e.rows:[],o.zendeskConfigurations.length&&o.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZendeskConfiguration=function(e){o.zendeskConfiguration=o.zendeskConfigurations[e],o.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:o.zendeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:o.zendeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:o.zendeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:o.zendeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZendeskConfiguration=function(e,n){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:n,zendeskConfigurations:o.zendeskConfigurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZendeskConfiguration(0)})},o.deleteZendeskConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(n.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZendeskConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.zendeskConfigurations,{id:n.id}),s.success({title:"ZendeskConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:o.zendeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",g.zendeskConfiguration=angular.copy(l),g.zendeskConfigurations=r,g.newZendeskConfiguration=!1,g.zendeskConfiguration||(g.zendeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",g.newZendeskConfiguration=!0),g.addNewZendeskConfiguration=function(){g.errors=[],d.intZendeskAccount.addConfiguration({id:n.params.id},g.zendeskConfiguration).$promise.then(function(e){g.zendeskConfigurations.unshift(e.toJSON()),o.success({title:"ZendeskConfiguration properly created",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskConfiguration=function(){g.errors=[],d.intZendeskConfiguration.update({id:g.zendeskConfiguration.id},g.zendeskConfiguration).$promise.then(function(e){var n=_.find(g.zendeskConfigurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZendeskConfiguration properly saved!",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZendeskConfiguration.delete({id:g.zendeskConfiguration.id}).$promise.then(function(){_.remove(g.zendeskConfigurations,{id:g.zendeskConfiguration.id}),o.success({title:"ZendeskConfiguration properly deleted!",msg:(g.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),v(g.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zendeskAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zendeskAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZendeskAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zendeskAccount")+"?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZendeskAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZendeskAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZendeskAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZendeskAccount=function(e,n){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:n,zendeskAccounts:f.zendeskAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZendeskAccount=y,f.exportSelectedZendeskAccounts=function(){var e=angular.copy(f.selectedZendeskAccounts);return f.selectedZendeskAccounts=[],e},f.deleteSelectedZendeskAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+f.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZendeskAccounts.forEach(function(e){y(e)}),f.selectedZendeskAccounts=[]})},f.deselectZendeskAccounts=function(){f.selectedZendeskAccounts=[]},f.selectAllZendeskAccounts=function(){f.selectedZendeskAccounts=f.zendeskAccounts.rows};var b=!0,A=1;function E(e){f.zendeskAccounts=e||{count:0,rows:[]}}function y(e){m.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zendeskAccounts.rows,{id:e.id}),f.zendeskAccounts.count-=1,f.zendeskAccounts.rows.length||f.getZendeskAccounts(),p.success({title:_.startCase("ZendeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zendeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",g.zohoAccount=angular.copy(l),g.zohoAccounts=r,g.newZohoAccount=!1,g.zohoAccount||(g.zohoAccount={host:"zoho.com",zone:"EU",serverUrl:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():"")},g.title="INTEGRATIONS.NEW_ZOHOACCOUNT",g.newZohoAccount=!0),g.addNewZohoAccount=function(){g.errors=[],d.intZohoAccount.save(g.zohoAccount).$promise.then(function(e){g.zohoAccounts.unshift(e.toJSON()),o.success({title:"ZohoAccount properly created",msg:g.zohoAccount.name?g.zohoAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoAccount=function(){g.errors=[],d.intZohoAccount.update({id:g.zohoAccount.id},g.zohoAccount).$promise.then(function(e){var n=_.find(g.zohoAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoAccount properly saved!",msg:g.zohoAccount.name?g.zohoAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoAccount.delete({id:g.zohoAccount.id}).$promise.then(function(){_.remove(g.zohoAccounts,{id:g.zohoAccount.id}),o.success({title:"ZohoAccount properly deleted!",msg:(g.zohoAccount.name||"zohoAccount")+" has been deleted!"}),v(g.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,t,i,s,e){var o=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zohoAccount={},o.zohoConfiguration={},o.configurations=[],o.selectedZohoConfiguration=-1,o.crudPermissions,o.init=function(e,n){o.zohoAccount=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZohoAccount.getConfigurations({id:o.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZohoConfiguration=function(e){o.zohoConfiguration=o.configurations[e],o.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:o.zohoConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:o.zohoConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:o.zohoConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZohoConfiguration=function(e,n){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:n,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZohoConfiguration(0)})},o.deleteZohoConfiguration=function(e,n){var t=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(n.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){i.intZohoConfiguration.delete({id:n.id}).$promise.then(function(){_.remove(o.configurations,{id:n.id}),s.success({title:"ZohoConfiguration deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){i.intZohoConfiguration.update({id:o.zohoConfiguration.id},o.zohoConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:n,items:o.subjects,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){r(n)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var n=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:n,items:o.descriptions,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){l(n)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var n=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,n){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:n,items:o.fields,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){d(n)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var n=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",g.zohoConfiguration=angular.copy(l),g.configurations=r,g.newZohoConfiguration=!1,g.zohoConfiguration||(g.zohoConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",g.newZohoConfiguration=!0),g.addNewZohoConfiguration=function(){g.errors=[],d.intZohoAccount.addConfiguration({id:n.params.id},g.zohoConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ZohoConfiguration properly created",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoConfiguration=function(){g.errors=[],d.intZohoConfiguration.update({id:g.zohoConfiguration.id},g.zohoConfiguration).$promise.then(function(e){var n=_.find(g.configurations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"ZohoConfiguration properly saved!",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoConfiguration=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.intZohoConfiguration.delete({id:g.zohoConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.zohoConfiguration.id}),o.success({title:"ZohoConfiguration properly deleted!",msg:(g.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),v(g.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","zohoConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.update({id:p.item.id},p.item).$promise.then(function(e){var n=_.find(p.items,{id:e.id});n&&_.merge(n,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){c.intZohoField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id,ticketType:s.ticketType?s.ticketType:void 0}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.zohoAccount=c||e.params.zohoAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts",{},{reload:"app.integrations.zohoAccounts"})},u.saveZohoAccount=function(){r.intZohoAccount.update({id:u.zohoAccount.id},u.zohoAccount).$promise.then(function(){l.success({title:"ZohoAccount updated!",msg:u.zohoAccount.name?u.zohoAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zohoAccount","userProfileSection"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.zohoAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="zohoAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedZohoAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,host,zone,clientId,clientSecret,code,refreshToken,serverUrl,description",sort:"-updatedAt",limit:10,page:1},f.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayzone=_.keyBy([{option:"US",value:"'US'"},{option:"AU",value:"'AU'"},{option:"EU",value:"'EU'"},{option:"IN",value:"'IN'"},{option:"CN",value:"'CN'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e,crudPermissions:f.crudPermissions})},f.testtestintegrationaccount=function(e,n){return m.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("zohoAccount")+"?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getZohoAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.intZohoAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ZohoAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditZohoAccount=function(e,n){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:n,zohoAccounts:f.zohoAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteZohoAccount=y,f.exportSelectedZohoAccounts=function(){var e=angular.copy(f.selectedZohoAccounts);return f.selectedZohoAccounts=[],e},f.deleteSelectedZohoAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+f.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedZohoAccounts.forEach(function(e){y(e)}),f.selectedZohoAccounts=[]})},f.deselectZohoAccounts=function(){f.selectedZohoAccounts=[]},f.selectAllZohoAccounts=function(){f.selectedZohoAccounts=f.zohoAccounts.rows};var b=!0,A=1;function E(e){f.zohoAccounts=e||{count:0,rows:[]}}function y(e){m.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.zohoAccounts.rows,{id:e.id}),f.zohoAccounts.count-=1,f.zohoAccounts.rows.length||f.getZohoAccounts(),p.success({title:_.startCase("ZohoAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zohoAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="JSCRIPTY.EDIT_PROJECT",g.project=angular.copy(l),g.projects=r,g.newProject=!1,g.project||(g.project={enableUncompleteSave:!0,sendUnpauseOnSubmit:!0},g.title="JSCRIPTY.NEW_PROJECT",g.newProject=!0),g.addNewProject=function(){g.errors=[],d.jscriptyProject.save(g.project).$promise.then(function(e){g.projects.unshift(e.toJSON()),o.success({title:"Project properly created",msg:g.project.name?g.project.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveProject=function(){g.errors=[],d.jscriptyProject.update({id:g.project.id},g.project).$promise.then(function(e){var n=_.find(g.projects,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Project properly saved!",msg:g.project.name?g.project.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteProject=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.jscriptyProject.delete({id:g.project.id}).$promise.then(function(){_.remove(g.projects,{id:g.project.id}),o.success({title:"Project properly deleted!",msg:(g.project.name||"project")+" has been deleted!"}),v(g.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","projects","project","api","Auth","license","setting","crudPermissions"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o){var r=this;r.currentUser=i.getCurrentUser(),r.project={},r.localizationMap=o;var l=new Date;r.pickerModel={dateStart:new Date(l.getFullYear(),l.getMonth(),1),dateEnd:new Date(l.getFullYear(),l.getMonth()+1,0),selectedTemplate:"TM"},r.init=function(e,n){r.project=e,r.userProfile=n,r.getAnswers()},r.getSummary=function(){return a.jscriptyProject.getSummary({id:r.project.id,startTime:{$gte:r.pickerModel.dateStart,$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","jscriptyProjectSummary_"+r.project.id+".csv"),a.click()}else s.info({title:"EXPORT",msg:"No answers available"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.getSummary",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.getAnswers=function(){return r.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:r.project.id,sort:"-createdAt,questionId",createdAt:{$gte:moment(r.pickerModel.dateStart).add(0,"hours").add(0,"minutes").add(0,"seconds").utcOffset(0,!0).format(),$lte:moment(r.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").utcOffset(0,!0).format()},nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){r.answers={};for(var n=0,t=e.count;n<t;n++)e.rows[n].questionId&&(r.hasIdAnswers=!0,r.answers.hasOwnProperty(e.rows[n].questionId)||(r.answers[e.rows[n].questionId]={question:e.rows[n].question,answers:{},sum:0}),""===e.rows[n].answer&&(e.rows[n].answer="NO_ANSWER"),r.answers[e.rows[n].questionId].answers[e.rows[n].answer]?r.answers[e.rows[n].questionId].answers[e.rows[n].answer]+=1:r.answers[e.rows[n].questionId].answers[e.rows[n].answer]=1,r.answers[e.rows[n].questionId].sum+=1)}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","Auth","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var n=this;n.project={},n.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},n.init=function(e){n.project=e,_.isObjectLike(e.formData)?n.project.formData=e.formData:n.isJsonString(e.formData)?n.project.formData=JSON.parse(e.formData):n.project.formData={}},n.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=s,r.title=o.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),t.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,n){var o=this;o.project={},o.responseData={},o.formViewer={},o.init=function(e){o.project=e,n.$on("mwForm.pageEvents.pageCurrentChanged",function(e,n){if(n.currentPage&&o.project.formData&&o.project.formData.pages)for(var t=0,a=o.project.formData.pages.length;t<a;t++)if(n.currentPage.number<t+1&&o.project.formData.pages[t].elements)for(var i=0,s=o.project.formData.pages[t].elements.length;i<s;i++)"question"===o.project.formData.pages[t].elements[i].type&&o.project.formData.pages[t].elements[i].question&&delete o.responseData[o.project.formData.pages[t].elements[i].question.id]})},o.onSubmit=function(e){var n=a.defer(),t=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(t).then(function(){n.resolve(!0)},function(){n.reject()}),n.promise},o.resetViewer=function(){o.formViewer.reset&&o.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.projectSessions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.jscriptyProject.getSessions(m.query,u).$promise}function g(e){d.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(m.projectSessions.rows,{id:e.id}),m.projectSessions.count-=1,m.projectSessions.rows.length||p(),l.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.project={},m.projectSessions={count:0,rows:[]},m.selectedProjectSessions=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},m.init=function(e,n,t){m.project=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.id=m.project.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("session #")+e.id||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getProjectSessions=p,m.createOrEditProjectSession=function(e,n){o.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:m.project,session:n,sessions:m.projectSessions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.showQuestionsProjectSession=function(e,t){o.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,n){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:t.id})}]},locals:{project:m.project,session:t}})},m.exportSelectedProjectSessions=function(){var e=angular.copy(m.selectedProjectSessions);return m.selectedProjectSessions=[],e},m.deleteProjectSession=g,m.deleteSelectedProjectSessions=function(e){var n=o.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+m.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedProjectSessions.forEach(function(e){g(e)}),m.selectedProjectSessions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=s,this.questions=o,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.project=c||e.params.project||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.clonedialog=function(e,n){t.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:p.projects?p.projects.rows:[],crudPermissions:p.crudPermissions}})},p.alert=l.info,p.gotoProjects=function(){e.go("app.jscripty.projects",{},{reload:"app.jscripty.projects"})},p.saveProject=function(){r.jscriptyProject.update({id:p.project.id},p.project).$promise.then(function(){l.success({title:"Project updated!",msg:p.project.name?p.project.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","project","userProfile","userProfileSection"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.projects=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="projects",f.listOrder="",f.listOrderAsc=null,f.selectedProjects=[],f.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,sendUnpauseOnSubmit,description,formData",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,project:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{project:e,projects:f.projects?f.projects.rows:[],crudPermissions:f.crudPermissions}})},f.sessionsgoto=function(e,n){t.go("app.jscripty.projects.edit",{id:e.id,tab:3})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("project")+"?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getProjects=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.jscriptyProject.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Projects",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditProject=function(e,n){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:n,projects:f.projects.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteProject=y,f.exportSelectedProjects=function(){var e=angular.copy(f.selectedProjects);return f.selectedProjects=[],e},f.deleteSelectedProjects=function(e){var n=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+f.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedProjects.forEach(function(e){y(e)}),f.selectedProjects=[]})},f.deselectProjects=function(){f.selectedProjects=[]},f.selectAllProjects=function(){f.selectedProjects=f.projects.rows};var b=!0,A=1;function E(e){f.projects=e||{count:0,rows:[]}}function y(e){m.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(f.projects.rows,{id:e.id}),f.projects.count-=1,f.projects.rows.length||f.getProjects(),p.success({title:_.startCase("Project")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","projects","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m,u){var p,g=this;function v(e){t.hide(e)}g.currentUser=l.getCurrentUser(),g.errors=[],g.setting=c,g.license=d,g.crudPermissions=m,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.mailAccount=angular.copy(s),g.mailAccounts=n,g.cloudProviders=o,g.providers=u.getEmailProviders(),g.newMailAccount=!1,g.mailAccount||(g.mailAccount={active:!0,service:"null",authentication:!0,fontSize:13,waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.newMailAccount=!0),e.params.id&&(g.mailAccount.MailAccountId=e.params.id),g.addNewMailAccount=function(){g.errors=[],r.mailAccount.save(g.mailAccount).$promise.then(function(e){g.mailAccounts.unshift(e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_CREATED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailAccount=function(){g.errors=[],r.mailAccount.update({id:g.mailAccount.id},g.mailAccount).$promise.then(function(e){var n=_.find(g.mailAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailAccount=function(e){if(g.mailAccount.service)return i.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});g.errors=[];var n=t.confirm().title(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:g.mailAccount.name})).ariaLabel("Delete Mail Account").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.mailAccount.delete({id:g.mailAccount.id}).$promise.then(function(){_.remove(g.mailAccounts,{id:g.mailAccount.id}),i.success({title:a.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")}),v(g.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.onProviderChange=function(){"custom"!==g.mailAccount.provider&&(g.mailAccount.authentication=!0);"outlook365"!==g.mailAccount.provider&&(g.mailAccount.modernAuthentication=!1)},g.closeDialog=v,p=[{key:"id",value:Number(g.mailAccount.ListId)}],r.getResourcesByRole(g.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},p).then(function(e){g.lists=e.rows}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$mdDialog","$translate","toasty","mailAccounts","mailAccount","cloudProviders","api","Auth","license","setting","crudPermissions","msUtils"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:t,mailAccount:r.mailAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[n]=e:r.mailAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.mailAccountApps.rows.length;t++,0){var a=r.mailAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:601}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Reply_Type",name:"replyType",type:"select",defaultValue:"1",values:[{option:"Reply",value:"0"},{option:"Reply All",value:"1"}],required:!0,param:1},{title:"Text",name:"text",type:"html",required:!0,param:2}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.mailAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=o.mailAccount.getApplications(r.query,t).$promise},r.editMailAccountApp=n,r.editInterval=function(e,n){if(r.mailAccountApps.rows.length){var t=r.mailAccountApps.rows[n]?r.mailAccountApps.rows[n]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailAccount.getAgents({id:c.mailAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailAccount?"penalty "+e.UserMailAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.removeAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailAccount.addAgents({id:c.mailAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailAccount","mailAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.agent.text=d.slice(2,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.autoreply.text=d.slice(2,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.replyType=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.autoreply.text=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.autoreply.times=1,l.autoreply.replyType=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.replyType,e[2]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.close.text=d.slice(2,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotoif.text=d.slice(2,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.gotop.text=d.slice(2,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.noop.text=d.slice(2,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.queue.text=d.slice(2,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("mail")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:601}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.system.text=d.slice(2,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.replyType=isNaN(d[1])?d[1]:parseInt(d[1],10),l.tag.text=d.slice(2,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"mailAccount",action:"getDispositions",field:"name",params:{id:m.mailAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.mailAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.mailAccountInteractions.rows.length;n+=1){var t=m.mailAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,(void 0===m.query.closed||null===m.query.closed||m.query.closed)&&delete m.query.substatus,m.promise=d.mailInteraction.get(m.query,p).$promise}function v(e){d.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountInteractions.rows,{id:e.id}),m.mailAccountInteractions.count-=1,m.mailAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){_.isEmpty(e.to)||_.includes(e.to,m.mailAccount.email)?e.contactInfo=e.Contact?e.Contact.email:void 0:(e.contactName=e.to.split(" <")[0],e.contactInfo=e.to.split("<").pop().split(">")[0]),"Unknown"===e.contactName&&(e.contactName=i.instant("MAIL.UNKNOWN"))}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountInteractions={count:0,rows:[]},m.selectedMailAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"plainBody",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Substatus",column:"substatus",type:"multiselect",options:{field:"name",route:{model:"mailSubstatus",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return d.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){m.subStatuses=e||{count:0,rows:[]}})}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Substatus",key:"substatus",type:"select",label:"DASHBOARDS.SELECT_SUBSTATUS",options:m.subStatuses.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NONE"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name",ngIf:"closed === 0"},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.mailInteractionDownload=function(s,e,n){return d.mailInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="mail-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getMailAccountInteractions=g,m.createOrEditMailAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,interaction:n,interactions:m.mailAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spymailInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"mail",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"mail.mailAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||MailAccountId:=$eq["+m.mailAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedMailAccountInteractions=function(){var e=angular.copy(m.selectedMailAccountInteractions);return m.selectedMailAccountInteractions=[],e},m.deleteMailAccountInteraction=v,m.deleteSelectedMailAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountInteractions.forEach(function(e){v(e)}),m.selectedMailAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.mailAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.mailAccountMailCannedAnswers.rows,{id:e.id}),m.mailAccountMailCannedAnswers.count-=1,m.mailAccountMailCannedAnswers.rows.length||p(),l.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.mailAccount={},m.mailAccountMailCannedAnswers={count:0,rows:[]},m.selectedMailAccountMailCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.mailAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mailCannedAnswer #")+e.id||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getMailAccountMailCannedAnswers=p,m.createOrEditMailAccountMailCannedAnswer=function(e,n){o.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:m.mailAccount,mailCannedAnswer:n,mailCannedAnswers:m.mailAccountMailCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(m.selectedMailAccountMailCannedAnswers);return m.selectedMailAccountMailCannedAnswers=[],e},m.deleteMailAccountMailCannedAnswer=g,m.deleteSelectedMailAccountMailCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+m.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),m.selectedMailAccountMailCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILCANNEDANSWER",g.mailCannedAnswer=angular.copy(l),g.mailCannedAnswers=r,g.newMailCannedAnswer=!1,g.mailCannedAnswer||(g.mailCannedAnswer={},g.title="MAIL.NEW_MAILCANNEDANSWER",g.newMailCannedAnswer=!0),n.params.id&&(g.mailCannedAnswer.MailAccountId=n.params.id),g.addNewMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.mailCannedAnswer).$promise.then(function(e){g.mailCannedAnswers.unshift(e.toJSON()),o.success({title:"MailCannedAnswer properly created",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.mailCannedAnswer.id},g.mailCannedAnswer).$promise.then(function(e){var n=_.find(g.mailCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailCannedAnswer properly saved!",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.mailCannedAnswer.id}).$promise.then(function(){_.remove(g.mailCannedAnswers,{id:g.mailCannedAnswer.id}),o.success({title:"MailCannedAnswer properly deleted!",msg:(g.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),v(g.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.mailAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.mailAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.MailAccountId=m.mailAccount.id,m.query.id=m.mailAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.mailAccount.id,field:"MailAccountId",route:"mailAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.mail").controller("MailAccountDispositionsController",e)}(),function(){"use strict";function e(t,a,i,s,e,n,o,r,l,d,c,m,u,p,g){var v,h,f=this;f.currentUser=d.getCurrentUser(),f.license=n,f.setting=o,f.passwordPattern=f.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",f.mailAccount=c||t.params.mailAccount||{},f.cloudProviders=m||{rows:[],count:0},f.userProfile=u,f.userProfileSection=p&&1==p.count?p.rows[0]:null,f.crudPermissions=d.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.hasModulePermissions={},f.selectedTab=t.params.tab||0,f.providers=g.getEmailProviders(),f.originalProvider=f.mailAccount.provider,f.goToRealtime=function(){return d.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},f.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:f.mailAccounts?f.mailAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.goToMailAccounts=function(){t.go("app.mail.mailAccounts",{},{reload:"app.mail.mailAccounts"})},f.saveMailAccount=function(){var e=angular.copy(f.mailAccount);"custom"===e.provider?e.provider=null:(f.originalProvider!==e.provider&&(e.Imap.modernAuthentication?e.Imap.password=null:e.Imap.CloudProviderId=null),e.Smtp.user=e.Imap.user,e.Smtp.pass=e.Imap.password,e.Imap.modernAuthentication||(e.Imap.CloudProviderId=null),e.Smtp.modernAuthentication=e.Imap.modernAuthentication,e.Smtp.CloudProviderId=e.Imap.CloudProviderId,e.Imap=_.omit(e.Imap,["host","port","service"]),e.Smtp=_.omit(e.Smtp,["host","port","secure","service"]));r.mailAccount.update({id:f.mailAccount.id},e).$promise.then(function(){f.originalProvider=e.provider,l.success({title:s.instant("MAIL.NOTIFICATIONS.ACCOUNT_SAVED_SUCCESS_TITLE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},f.onProviderChange=function(){"custom"!==f.mailAccount.provider&&(f.mailAccount.authentication=!0);"outlook365"!==f.mailAccount.provider&&(f.mailAccount.Imap.modernAuthentication=!1)},e.all((h=[{key:"id",value:Number(f.mailAccount.ListId)}],r.getResourcesByRole(f.currentUser,"cmList",{fields:"id,name",sort:"name",nolimit:"true"},h).then(function(e){f.lists=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})),(v=[{key:"id",value:Number(f.mailAccount.mandatoryDispositionPauseId)}],r.getResourcesByRole(f.currentUser,"pause",{fields:"id,name",sort:"name",nolimit:"true"},v).then(function(e){f.pauses=e.rows}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))}e.$inject=["$state","$mdDialog","$document","$translate","$q","license","setting","api","toasty","Auth","mailAccount","cloudProviders","userProfile","userProfileSection","msUtils"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,a,i,s,o,n,r,l,d,c,m,u,p){var g=this;function v(e){g.mailAccounts=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.hasRole("admin")?g.promise=d.mailAccount.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="MailAccounts",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){if(e.service)return c.error({msg:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_SERVICE_DELETE")});d.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(g.mailAccounts.rows,{id:e.id}),g.mailAccounts.count-=1,g.mailAccounts.rows.length||h(),c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.mailAccounts=n||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedMailAccounts=[],g.query={fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},g.editstate=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e,crudPermissions:g.crudPermissions})},g.verifySMTP=function(e){return e&&e.id?d.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){c.success({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString()})}):c.error({title:o.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:o.instant("MAIL.NOTIFICATIONS.UNKNOWN_SMTP_SERVER")})},g.goToInteractions=function(e){t.go("app.mail.mailAccounts.edit",{id:e.id,tab:"custom"===e.provider?7:6})},g.goToRealtime=function(){return m.hasRole("admin")?t.go("app.mail.realtime.accounts",{}):d.userProfileSection.get({userProfileId:m.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n&&n.enabled)return t.go("app.mail.realtime.accounts",{});c.info({title:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:o.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})})},g.addAgent=function(e,n){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:g.mailAccounts?g.mailAccounts.rows:[],crudPermissions:g.crudPermissions,realtime:!1}})},g.deleteconfirm=function(e,n){var t=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNT_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete mail account").targetEvent(n).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.success=v,g.getMailAccounts=h,g.createOrEditMailAccount=function(e,n){a.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:n,mailAccounts:g.mailAccounts.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions},resolve:{cloudProviders:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,name",sort:"name",type:"outlook365"})}]}})},g.deleteMailAccount=f,g.exportSelectedMailAccounts=function(){var e=angular.copy(g.selectedMailAccounts);return g.selectedMailAccounts=[],e},g.deleteSelectedMailAccounts=function(e){var n=a.confirm().title(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_TITLE")).content(o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETE_MESSAGE",{total:g.selectedMailAccounts.length})).ariaLabel("delete mail accounts").targetEvent(e).ok("OK").cancel(o.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedMailAccounts.forEach(function(e){f(e)}),g.selectedMailAccounts=[],c.success({title:o.instant("MAIL.NOTIFICATIONS.ACCOUNTS_DELETED_SUCCESS_TITLE")})})},g.deselectMailAccounts=function(){g.selectedMailAccounts=[]},g.selectAllMailAccounts=function(){g.selectedMailAccounts=g.mailAccounts.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?s(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","mailAccounts","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="MAIL.EDIT_MAILQUEUE",r.mailQueue=angular.copy(n),r.mailQueues=e,r.newMailQueue=!1,r.mailQueue||(r.mailQueue={strategy:"beepall",timeout:10},r.title="MAIL.NEW_MAILQUEUE",r.newMailQueue=!0),r.addNewMailQueue=function(){r.errors=[],i.mailQueue.save(r.mailQueue).$promise.then(function(e){r.mailQueues.unshift(e.toJSON()),a.success({title:"MailQueue properly created",msg:r.mailQueue.name?r.mailQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveMailQueue=function(){r.errors=[],i.mailQueue.update({id:r.mailQueue.id},r.mailQueue).$promise.then(function(e){var n=_.find(r.mailQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"MailQueue properly saved!",msg:r.mailQueue.name?r.mailQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteMailQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.mailQueue.delete({id:r.mailQueue.id}).$promise.then(function(){_.remove(r.mailQueues,{id:r.mailQueue.id}),a.success({title:"MailQueue properly deleted!",msg:(r.mailQueue.name||"mailQueue")+" has been deleted!"}),l(r.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","mailQueues","mailQueue","api","Auth","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getAgents({id:c.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.mailQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addAgents({id:c.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.mailQueue.getTeams({id:l.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.mailQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MAIL.ALL_TEAMS"),labelSelected:t.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.removeTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.mailQueue.addTeams({id:l.mailQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.mailQueue=c||e.params.mailQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailQueues=function(){e.go("app.mail.mailQueues",{},{reload:"app.mail.mailQueues"})},u.saveMailQueue=function(){r.mailQueue.update({id:u.mailQueue.id},u.mailQueue).$promise.then(function(){l.success({title:"MailQueue updated!",msg:u.mailQueue.name?u.mailQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailQueue","userProfileSection"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailQueues",f.listOrder="",f.listOrderAsc=null,f.selectedMailQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:f.mailQueues?f.mailQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailQueue")+"?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.mail.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.mail.realtime.queues",{})}},f.success=E,f.getMailQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailQueue=function(e,n){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:n,mailQueues:f.mailQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteMailQueue=y,f.exportSelectedMailQueues=function(){var e=angular.copy(f.selectedMailQueues);return f.selectedMailQueues=[],e},f.deleteSelectedMailQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+f.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailQueues.forEach(function(e){y(e)}),f.selectedMailQueues=[]})},f.deselectMailQueues=function(){f.selectedMailQueues=[]},f.selectAllMailQueues=function(){f.selectedMailQueues=f.mailQueues.rows};var b=!0,A=1;function E(e){f.mailQueues=e||{count:0,rows:[]}}function y(e){m.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.mailQueues.rows,{id:e.id}),f.mailQueues.count-=1,f.mailQueues.rows.length||f.getMailQueues(),p.success({title:_.startCase("MailQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILSUBSTATUS",g.mailSubstatus=angular.copy(l),g.mailSubtatuses=r,g.newMailSubstatus=!1,g.mailSubstatus||(g.mailSubstatus={},g.title="MAIL.NEW_MAILSUBSTATUS",g.newMailSubstatus=!0),g.addNewMailSubstatus=function(){g.errors=[],d.mailSubstatus.save(g.mailSubstatus).$promise.then(function(e){g.mailSubtatuses.unshift(e.toJSON()),o.success({title:"MailSubstatus properly created",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailSubstatus=function(){g.errors=[],d.mailSubstatus.update({id:g.mailSubstatus.id},g.mailSubstatus).$promise.then(function(e){var n=_.find(g.mailSubtatuses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MailSubstatus properly saved!",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailSubstatus=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.mailSubstatus.delete({id:g.mailSubstatus.id}).$promise.then(function(){_.remove(g.mailSubtatuses,{id:g.mailSubstatus.id}),o.success({title:"MailSubstatus properly deleted!",msg:(g.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),v(g.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.mailSubtatuses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="mailSubtatuses",f.listOrder="",f.listOrderAsc=null,f.selectedMailSubstatuses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("mailSubstatus")+"?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMailSubstatuses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.mailSubstatus.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MailSubstatuses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMailSubstatus=function(e,n){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:n,mailSubtatuses:f.mailSubtatuses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMailSubstatus=y,f.exportSelectedMailSubstatuses=function(){var e=angular.copy(f.selectedMailSubstatuses);return f.selectedMailSubstatuses=[],e},f.deleteSelectedMailSubstatuses=function(e){var n=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+f.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMailSubstatuses.forEach(function(e){y(e)}),f.selectedMailSubstatuses=[]})},f.deselectMailSubstatuses=function(){f.selectedMailSubstatuses=[]},f.selectAllMailSubstatuses=function(){f.selectedMailSubstatuses=f.mailSubtatuses.rows};var b=!0,A=1;function E(e){f.mailSubtatuses=e||{count:0,rows:[]}}function y(e){m.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(f.mailSubtatuses.rows,{id:e.id}),f.mailSubtatuses.count-=1,f.mailSubtatuses.rows.length||f.getMailSubstatuses(),p.success({title:_.startCase("MailSubstatus")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailSubtatuses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d){var c=this,m=d&&1==d.count?d.rows[0].crudPermissions:null;function u(){c.mailAccounts.rows.forEach(function(n){var e=_.find(c.rpcMailAccounts.rows,["id",n.id]);e&&_.merge(n,e);var t={id:n.id,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),fields:"id,createdAt"};i.mailAccount.getMessages(t).$promise.then(function(e){return e&&(n.in=e.count||0,n.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),t.direction="out",i.mailAccount.getMessages(t).$promise}).then(function(e){e&&(n.out=e.count||0,n.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){o.error(e.data?e.data.message:e.toString())})})}function p(e){var n=_.find(c.mailAccounts.rows,["id",e.id]);n&&_.merge(n,e)}function g(e){c.mailAccounts.rows=e.rows,u()}function v(){c.query.offset=(c.query.page-1)*c.query.limit,n.hasRole("admin")?c.promise=i.mailAccount.get(c.query,g).$promise:(c.query.id=c.currentUser.userProfileId,c.query.section="MailAccounts",c.promise=i.userProfile.getResources(c.query,g).$promise)}c.currentUser=n.getCurrentUser(),c.mailAccounts=r,c.rpcMailAccounts=l,c.crudPermissions=n.parseCrudPermissions(m),c.query={sort:"name",limit:10,page:1},c.success=g,c.$onInit=u,c.getMailAccounts=v,c.goToMailAccount=function(e,n){a.go("app.mail.mailAccounts.edit",{id:n.id,mailAccount:n})},c.verifySmtp=function(e,n){{if(n&&n.id)return i.mailAccount.verifySmtp({id:n.id}).$promise.then(function(){o.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){o.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});o.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},s.on("mailAccount:save",p),s.on("mailAccount:update",p),s.on("mailMessage:save",function(e){var n=_.find(c.mailAccounts.rows,["id",e.MailAccountId]);n&&("in"==e.direction?(n.in+=1,n.lastIn=e.createdAt):(n.out+=1,n.lastOut=e.createdAt))});var h=!0,f=1;e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=f),v())}),e.$on("$destroy",function(){s.removeAllListeners("mailAccount:save"),s.removeAllListeners("mailAccount:update"),s.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$state","api","Auth","socket","toasty","mailAccounts","rpcMailAccounts","userProfileSection"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,t.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.mail.realtime.agents");break;case 1:t.go("app.mail.realtime.queues");break;case 2:t.go("app.mail.realtime.accounts");break;default:t.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MARKETPLACE.EDIT_PLUGIN",g.plugin=angular.copy(l),g.plugins=r,g.newPlugin=!1,g.plugin||(g.plugin={},g.title="MARKETPLACE.NEW_PLUGIN",g.newPlugin=!0),g.addNewPlugin=function(){g.errors=[],d.plugin.save(g.plugin).$promise.then(function(e){g.plugins.unshift(e.toJSON()),o.success({title:"Plugin properly created",msg:g.plugin.name?g.plugin.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePlugin=function(){g.errors=[],d.plugin.update({id:g.plugin.id},g.plugin).$promise.then(function(e){var n=_.find(g.plugins,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Plugin properly saved!",msg:g.plugin.name?g.plugin.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePlugin=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The plugin will be deleted.").ariaLabel("Delete Plugin").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.plugin.delete({id:g.plugin.id}).$promise.then(function(){_.remove(g.plugins,{id:g.plugin.id}),o.success({title:"Plugin properly deleted!",msg:(g.plugin.name||"plugin")+" has been deleted!"}),v(g.plugin)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","plugins","plugin","api","Auth","license","setting","crudPermissions"],angular.module("app.marketplace").controller("CreateOrEditPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.plugin=c||e.params.plugin||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoPlugins=function(){e.go("app.marketplace.plugins",{},{reload:"app.marketplace.plugins"})},u.savePlugin=function(){r.plugin.update({id:u.plugin.id},u.plugin).$promise.then(function(){l.success({title:"Plugin updated!",msg:u.plugin.name?u.plugin.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETplugin",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","plugin","userProfileSection"],angular.module("app.marketplace").controller("MarketplacePluginController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.plugins=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="plugins",f.listOrder="",f.listOrderAsc=null,f.selectedPlugins=[],f.query={fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"-updatedAt",limit:10,page:1},f.installing=!1,f.arraysidebar=_.keyBy([{option:"Always",value:"'always'"},{option:"Admin Only",value:"'adminOnly'"},{option:"Agent Only",value:"'agentOnly'"},{option:"Never",value:"'never'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.installplugin=function(e){{if("script"!==e.type)return e.active=!0,m.plugin.update({id:e.id},e).$promise.then(function(){p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});f.installing=!0,m.pm2.save({name:e.scriptName,script:e.path+"/"+e.scriptPath}).$promise.then(function(){return e.active=!0,m.plugin.update({id:e.id},e).$promise}).then(function(){f.installing=!1,p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.save"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.save",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}},f.editstate=function(e,n){t.go("app.marketplace.plugins.edit",{id:e.id,plugin:e,crudPermissions:f.crudPermissions})},f.stopplugin=function(e,n){var t=i.confirm().title("Are you sure want to stop the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be stoppped.").ariaLabel("stop plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"stopped"}).$promise.then(function(){p.success({title:"Process stopped!",msg:"Attached pm2 process successfully stopped"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.restartplugin=function(e,n){var t=i.confirm().title("Are you sure want to restart the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be restarted.").ariaLabel("restart plugin process").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){var t;t=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.update({id:n.pm_id,status:"online"}).$promise.then(function(){p.success({title:"Process restarted!",msg:"Attached pm2 process successfully restarted"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},f.downloadfile2=function(s,e){return m.plugin.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.name.replace(" ","_").toLowerCase()+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.uninstallplugin=function(e,n){var t=i.confirm().title("Are you sure want to uninstall the plugin?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be uninstalled.").ariaLabel("uninstall plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){!function(t){"script"===t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var n=_.find(e.rows,{name:t.scriptName});if(!n)throw new Error("No corresponding process found");m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});t.active=!1,m.plugin.update({id:t.id},t).$promise.then(function(){p.success({title:"Plugin uninstalled!",msg:t.name?t.name+" has been uninstalled!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}(e)},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("plugin")+"?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be deleted.").ariaLabel("delete plugin").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPlugins=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.plugin.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Plugins",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPlugin=function(e,n){i.show({controller:"CreateOrEditPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugin:n,plugins:f.plugins.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePlugin=y,f.exportSelectedPlugins=function(){var e=angular.copy(f.selectedPlugins);return f.selectedPlugins=[],e},f.deleteSelectedPlugins=function(e){var n=i.confirm().title("Are you sure want to delete the selected plugins?").htmlContent("<b>"+f.selectedPlugins.length+" selected</b> will be deleted.").ariaLabel("delete Plugins").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPlugins.forEach(function(e){y(e)}),f.selectedPlugins=[]})},f.deselectPlugins=function(){f.selectedPlugins=[]},f.selectAllPlugins=function(){f.selectedPlugins=f.plugins.rows},f.uploadPlugin=function(e){i.show({controller:"UploadPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugins:f.plugins.rows}})};var b=!0,A=1;function E(e){f.plugins=e||{count:0,rows:[]}}function y(t){t.active&&"script"==t.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)return p.error({title:"Plugin not deleted!",msg:"Failed to retrieve pm2 processes"});var n=_.find(e.rows,{name:t.scriptName});n?m.pm2.delete({id:n.pm_id,name:t.scriptName}).$promise:console.log("No '%s' process found",t.scriptName)}).catch(function(e){return p.error({title:"PM2 process not found!",msg:"Failed to delete the attached pm2 process"})}),m.plugin.delete({id:t.id}).$promise.then(function(){_.remove(f.plugins.rows,{id:t.id}),f.plugins.count-=1,f.plugins.rows.length||f.getPlugins(),p.success({title:_.startCase("Plugin")+" deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEplugin"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEplugin",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPlugins())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","plugins","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.marketplace").controller("MarketplacePluginsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=4,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="MARKETPLACE.UPLOAD_PLUGIN",o.plugins=a,o.uploadPlugins=[],o.uploadState="none",o.plugin={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/plugins"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["zip"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.plugin={id:e.uniqueIdentifier,file:e},o.uploadPlugins.unshift(o.plugin),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.plugins.unshift(JSON.parse(e)),angular.forEach(o.uploadPlugins,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the plugin"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.plugin.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","plugins","api","Auth"],angular.module("app.marketplace").controller("UploadPluginDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=c.getCurrentUser(),v.errors=[],v.setting=u,v.license=m,v.crudPermissions=p,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="MOTIONDIALER.EDIT_HOPPER",v.hopper=angular.copy(l),v.hoppers=r,v.newHopper=!1,v.contact,v.dateTime,v.hopper||(v.hopper={},v.title="MOTIONDIALER.NEW_HOPPER",v.newHopper=!0),n.params.id&&("IvrCampaign"===g?v.hopper.CampaignId=n.params.id:"QueueCampaign"==g?v.hopper.VoiceQueueId=n.params.id:v.hopper.ContactId=n.params.id),v.addNewHopper=function(){v.errors=[],d.cmHopper.save(v.hopper).$promise.then(function(e){v.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:v.hopper.name?v.hopper.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveHopper=function(){var t,a,i,s;v.errors=[],v.hopper.UserId=v.hopper.recallme?v.hopper.UserId:null,v.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:v.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){v.hopper.dialTimezone=v.contact.dialTimezone,d.cmHopper.update({id:v.hopper.id},_.omit(v.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:v.contact.dialTimezone})})})});var n=_.find(v.hoppers,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"Hopper properly saved!",msg:v.hopper.name?v.hopper.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},v.deleteHopper=function(e){v.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:v.hopper.id}).$promise.then(function(){_.remove(v.hoppers,{id:v.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(v.hopper.name||"hopper")+" has been deleted!"}),h(v.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=h,v.recalcTZTime=function(){if(_.isNil(v.hopper.VoiceQueueId)){var e=v.hopper.CampaignId;d.campaign.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}else{var e=v.hopper.VoiceQueueId;e&&d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(v.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.hopper.scheduledat=moment(v.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})});else{d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.hopper.scheduledat=moment(v.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}})}},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){v.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(v.agents,{id:e.resourceId})}),t=null;if(v.hopper&&(t=_.find(v.agents,{id:Number(v.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(v.agents,{id:t.id});a.canSelect=!1,n.push(a)}v.agents=n})}else{var t=[],a=null;v.hopper&&(a=_.find(v.agents,{id:Number(v.hopper.UserId)}));for(var i=0;i<v.agents.length;i++)a&&v.agents[i].id===a.id&&(v.agents[i].canSelect=!1,t.push(v.agents[i]));v.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.cmContact.get({id:v.hopper.ContactId,fields:"dialTimezone"}).$promise.then(function(e){var n;v.contact=e,_.isNil(v.hopper.VoiceQueueId)?(n=v.hopper.CampaignId)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=v.hopper.VoiceQueueId)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;v.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;v.dateTime=moment(v.hopper.scheduledat).add(n-t,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:v.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),v.dateTime=moment(v.hopper.scheduledat).add(n-0,"minutes").toDate(),v.hopper.scheduledat=moment(v.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions","from"],angular.module("app.motiondialer").controller("HopperdateController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",g.ivrCampaign=angular.copy(l),g.ivrCampaigns=r,g.newIvrCampaign=!1,g.ivrCampaign||(g.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",dialCutDigit:0,limitCalls:30,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},g.title="MOTIONDIALER.NEW_IVRCAMPAIGN",g.newIvrCampaign=!0),g.addNewIvrCampaign=function(){g.errors=[],d.campaign.save(g.ivrCampaign).$promise.then(function(e){g.ivrCampaigns.unshift(e.toJSON()),o.success({title:"IvrCampaign properly created",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveIvrCampaign=function(){g.errors=[],d.campaign.update({id:g.ivrCampaign.id},g.ivrCampaign).$promise.then(function(e){var n=_.find(g.ivrCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"IvrCampaign properly saved!",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteIvrCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.campaign.delete({id:g.ivrCampaign.id}).$promise.then(function(){_.remove(g.ivrCampaigns,{id:g.ivrCampaign.id}),o.success({title:"IvrCampaign properly deleted!",msg:(g.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),v(g.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})});g.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.trunks=n})}else g.trunks=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.projects,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.projects,{id:t.id});a.canSelect=!1,n.push(a)}g.projects=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)}));for(var i=0;i<g.projects.length;i++)a&&g.projects[i].id===a.id&&(g.projects[i].canSelect=!1,t.push(g.projects[i]));g.projects=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.ivrCampaign&&(t=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.ivrCampaign&&(a=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newIvrCampaign=!0,r.ivrCampaign=angular.copy(i),r.ivrCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_IVRCAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneIvrCampaign=function(){return e.campaign.clone({id:i.id},r.ivrCampaign).$promise.then(function(e){r.ivrCampaigns.unshift(e.toJSON()),a.success({title:"IvrCampaign properly cloned",msg:r.ivrCampaign.name?r.ivrCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","ivrCampaign","ivrCampaigns","$translate"],angular.module("app.motiondialer").controller("IvrCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperBlacks.rows,{id:e.id}),m.ivrCampaignHopperBlacks.count-=1,m.ivrCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperBlacks={count:0,rows:[]},m.selectedIvrCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperBlacks=p,m.createOrEditIvrCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperBlack:n,hopperBlacks:m.ivrCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(m.selectedIvrCampaignHopperBlacks);return m.selectedIvrCampaignHopperBlacks=[],e},m.deleteIvrCampaignHopperBlack=g,m.deleteSelectedIvrCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperFinals.rows,{id:e.id}),m.ivrCampaignHopperFinals.count-=1,m.ivrCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.ivrCampaign={},m.ivrCampaignHopperFinals={count:0,rows:[]},m.selectedIvrCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperFinals=p,m.createOrEditIvrCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperFinal:n,hopperFinals:m.ivrCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(m.selectedIvrCampaignHopperFinals);return m.selectedIvrCampaignHopperFinals=[],e},m.deleteIvrCampaignHopperFinal=g,m.deleteSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperFinals=[]})},m.moveIvrCampaignHopperFinal=v,m.moveContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsIvrCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedIvrCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedIvrCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHopperHistories.rows,{id:e.id}),m.ivrCampaignHopperHistories.count-=1,m.ivrCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHopperHistories={count:0,rows:[]},m.selectedIvrCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHopperHistories=p,m.createOrEditIvrCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopperHistory:n,hopperHistories:m.ivrCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(m.selectedIvrCampaignHopperHistories);return m.selectedIvrCampaignHopperHistories=[],e},m.deleteIvrCampaignHopperHistory=g,m.deleteSelectedIvrCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedIvrCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.ivrCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.campaign.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.ivrCampaignHoppers.rows,{id:e.id}),m.ivrCampaignHoppers.count-=1,m.ivrCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.ivrCampaign={},m.ivrCampaignHoppers={count:0,rows:[]},m.selectedIvrCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.ivrCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.CampaignId=m.ivrCampaign.id,m.query.id=m.ivrCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIvrCampaignHoppers=p,m.createOrEditIvrCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:m.ivrCampaign,hopper:n,hoppers:m.ivrCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"IvrCampaign"}})},m.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(m.selectedIvrCampaignHoppers);return m.selectedIvrCampaignHoppers=[],e},m.deleteIvrCampaignHopper=g,m.deleteSelectedIvrCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),m.selectedIvrCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})});m.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),m.agents=n})}else m.agents=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.CampaignId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})});g.agents.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.agents=n})}else g.agents=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.ivrCampaign={},i.init=function(n){i.ivrCampaign=n,t.cmHopper.get({limit:0,CampaignId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,CampaignId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,CampaignId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=n,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return i.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.ivrCampaign=c||t.params.ivrCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.resetlistdialog=function(n,t){r.campaign.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.ivrCampaign.id,n=a.rows[0],t=n.id,r.campaign.removeLists({id:e,ids:t}).$promise.then(function(){return r.campaign.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{ivrCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},u.alert=l.info,u.gotoIvrCampaigns=function(){t.go("app.motiondialer.ivrCampaigns",{},{reload:"app.motiondialer.ivrCampaigns"})},u.saveIvrCampaign=function(){r.campaign.update({id:u.ivrCampaign.id},u.ivrCampaign).$promise.then(function(){l.success({title:"IvrCampaign updated!",msg:u.ivrCampaign.name?u.ivrCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})});u.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.trunks=n})}else u.trunks=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.ivrCampaign&&(t=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.ivrCampaign&&(a=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","ivrCampaign","userProfileSection"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.ivrCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="ivrCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedIvrCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:f.ivrCampaigns?f.ivrCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("ivrCampaign")+"?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.ivr_campaigns",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.ivr_campaigns",{})}},f.success=E,f.getIvrCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.campaign.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="IvrCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditIvrCampaign=function(e,n){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:f.ivrCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteIvrCampaign=y,f.exportSelectedIvrCampaigns=function(){var e=angular.copy(f.selectedIvrCampaigns);return f.selectedIvrCampaigns=[],e},f.deleteSelectedIvrCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+f.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIvrCampaigns.forEach(function(e){y(e)}),f.selectedIvrCampaigns=[]})},f.deselectIvrCampaigns=function(){f.selectedIvrCampaigns=[]},f.selectAllIvrCampaigns=function(){f.selectedIvrCampaigns=f.ivrCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})});f.trunks.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.trunks=n})}else f.trunks=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.projects=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.projects,{id:e.resourceId})}),a=null;a=[],f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),f.projects=t})}else{var t=[],a=[];f.ivrCampaigns.rows.forEach(function(e){var n=_.find(f.projects,{id:Number(e.SquareProjectId)});a.push(n)});for(var i=0;i<f.projects.length;i++){_.some(a,{id:f.projects[i].id})&&(f.projects[i].canSelect=!1,t.push(f.projects[i]))}f.projects=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.ivrCampaign&&(t=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.ivrCampaign&&(a=_.find(f.interval,{id:Number(f.ivrCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.ivrCampaigns=e||{count:0,rows:[]}}function y(e){m.campaign.delete({id:e.id}).$promise.then(function(){_.remove(f.ivrCampaigns.rows,{id:e.id}),f.ivrCampaigns.count-=1,f.ivrCampaigns.rows.length||f.getIvrCampaigns(),p.success({title:_.startCase("IvrCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","ivrCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",g.queueCampaign=angular.copy(l),g.queueCampaigns=r,g.newQueueCampaign=!1,g.queueCampaign||(g.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",dialCutDigit:0,autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialNoSuchNumberMaxRetry:3,dialNoSuchNumberRetryFrequency:150,dialDropMaxRetry:3,dialDropRetryFrequency:150,dialAbandonedMaxRetry:3,dialAbandonedRetryFrequency:150,dialMachineMaxRetry:3,dialMachineRetryFrequency:150,dialAgentRejectMaxRetry:3,dialAgentRejectRetryFrequency:150,callAdditionalPhoneAfterMin:3,dialPredictiveIntervalMaxThreshold:20,dialPredictiveIntervalMinThreshold:10},g.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",g.newQueueCampaign=!0),g.addNewQueueCampaign=function(){g.errors=[],d.voiceQueue.save(g.queueCampaign).$promise.then(function(e){g.queueCampaigns.unshift(e.toJSON()),o.success({title:"QueueCampaign properly created",msg:g.queueCampaign.name?g.queueCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveQueueCampaign=function(){g.errors=[],d.voiceQueue.update({id:g.queueCampaign.id},g.queueCampaign).$promise.then(function(e){var n=_.find(g.queueCampaigns,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"QueueCampaign properly saved!",msg:g.queueCampaign.name?g.queueCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteQueueCampaign=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceQueue.delete({id:g.queueCampaign.id}).$promise.then(function(){_.remove(g.queueCampaigns,{id:g.queueCampaign.id}),o.success({title:"QueueCampaign properly deleted!",msg:(g.queueCampaign.name||"queueCampaign")+" has been deleted!"}),v(g.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.trunks,{id:t.id});a.canSelect=!1,n.push(a)}g.trunks=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,t.push(g.trunks[i]));g.trunks=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),t=null;if(g.queueCampaign&&(t=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.interval,{id:t.id});a.canSelect=!1,n.push(a)}g.interval=n})}else{var t=[],a=null;g.queueCampaign&&(a=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,t.push(g.interval[i]));g.interval=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.queueCampaign=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newQueueCampaign=!0,r.queueCampaign=angular.copy(i),r.queueCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_QUEUECAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneQueueCampaign=function(){return e.voiceQueue.clone({id:i.id},r.queueCampaign).$promise.then(function(e){r.queueCampaigns.unshift(e.toJSON()),a.success({title:"QueueCampaign properly cloned",msg:r.queueCampaign.name?r.queueCampaign.name+" has been cloned!":""}),t.go("app.motiondialer.queueCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","queueCampaign","queueCampaigns","$translate"],angular.module("app.motiondialer").controller("QueueCampaigncloneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperBlacks(m.query,u).$promise}function g(e){d.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperBlacks.rows,{id:e.id}),m.queueCampaignHopperBlacks.count-=1,m.queueCampaignHopperBlacks.rows.length||p(),l.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperBlacks={count:0,rows:[]},m.selectedQueueCampaignHopperBlacks=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperBlack #")+e.id||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperBlacks=p,m.createOrEditQueueCampaignHopperBlack=function(e,n){o.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperBlack:n,hopperBlacks:m.queueCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(m.selectedQueueCampaignHopperBlacks);return m.selectedQueueCampaignHopperBlacks=[],e},m.deleteQueueCampaignHopperBlack=g,m.deleteSelectedQueueCampaignHopperBlacks=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+m.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperBlacks=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperFinals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperFinals(m.query,u).$promise}function g(e){d.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperFinals.rows,{id:e.id}),m.queueCampaignHopperFinals.count-=1,m.queueCampaignHopperFinals.rows.length||p(),l.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){d.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){l.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var n,t;"Not Found"===e.data?d.cmHopper.save((n=a,t={},t.phone=n.calleridnum,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=0,t.countcongestionretry=0,t.countnoanswerretry=0,t.countglobal=0,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=n.deleted?null:n.UserId,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.priority=n.recallme?3:2,t.recallme=!!n.recallme,t)).$promise.then(function(e){var n,t;l.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&d.cmHopperHistory.save(((t={}).calleridnum=(n=a).calleridnum,t.calleridname=n.calleridname,t.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),t.countbusyretry=n.countbusyretry,t.countcongestionretry=n.countcongestionretry,t.countnoanswerretry=n.countnoanswerretry,t.countglobal=n.countglobal,t.ContactId=n.ContactId,t.ListId=n.ListId,t.UserId=c.getCurrentUser().id,t.VoiceQueueId=n.VoiceQueueId,t.CampaignId=n.CampaignId,t.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),t.edited=!0,t.state=25,t.statedesc="Restored",t.campaign=n.campaign,t.campaigntype=n.VoiceQueueId?"queue":"ivr",t))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):l.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.contacts={},m.queueCampaign={},m.queueCampaignHopperFinals={count:0,rows:[]},m.selectedQueueCampaignHopperFinals=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,secondDisposition,thirdDisposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperFinal #")+e.id||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperFinals=p,m.createOrEditQueueCampaignHopperFinal=function(e,n){o.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperFinal:n,hopperFinals:m.queueCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(m.selectedQueueCampaignHopperFinals);return m.selectedQueueCampaignHopperFinals=[],e},m.deleteQueueCampaignHopperFinal=g,m.deleteSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+m.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperFinals=[]})},m.moveQueueCampaignHopperFinal=v,m.moveContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:m.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?l.info({title:"Restored Contacts",msg:"0"}):l.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.countContactsQueueCampaignHopperFinal=function(e){d.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(m.contacts,e[0])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},m.moveConfirm=function(e,n){var t=o.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.moveSelectedQueueCampaignHopperFinals=function(e){var n=o.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),m.selectedQueueCampaignHopperFinals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHopperHistories=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHopperHistories(m.query,u).$promise}function g(e){d.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHopperHistories.rows,{id:e.id}),m.queueCampaignHopperHistories.count-=1,m.queueCampaignHopperHistories.rows.length||p(),l.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHopperHistories={count:0,rows:[]},m.selectedQueueCampaignHopperHistories=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopperHistory #")+e.id||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHopperHistories=p,m.createOrEditQueueCampaignHopperHistory=function(e,n){o.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopperHistory:n,hopperHistories:m.queueCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(m.selectedQueueCampaignHopperHistories);return m.selectedQueueCampaignHopperHistories=[],e},m.deleteQueueCampaignHopperHistory=g,m.deleteSelectedQueueCampaignHopperHistories=function(e){var n=o.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+m.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),m.selectedQueueCampaignHopperHistories=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.queueCampaignHoppers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceQueue.getHoppers(m.query,u).$promise}function g(e){d.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(m.queueCampaignHoppers.rows,{id:e.id}),m.queueCampaignHoppers.count-=1,m.queueCampaignHoppers.rows.length||p(),l.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.queueCampaign={},m.queueCampaignHoppers={count:0,rows:[]},m.selectedQueueCampaignHoppers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,countnosuchnumberretry,countdropretry,countabandonedretry,countmachineretry,countagentrejectretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},m.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),m.init=function(e,n){m.queueCampaign=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceQueueId=m.queueCampaign.id,m.query.id=m.queueCampaign.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("hopper #")+e.id||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getQueueCampaignHoppers=p,m.createOrEditQueueCampaignHopper=function(e,n){o.show({controller:"HopperdateController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/hopperdate/hopperdate.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:m.queueCampaign,hopper:n,hoppers:m.queueCampaignHoppers.rows,license:null,setting:null,crudPermissions:m.crudPermissions,from:"QueueCampaign"}})},m.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(m.selectedQueueCampaignHoppers);return m.selectedQueueCampaignHoppers=[],e},m.deleteQueueCampaignHopper=g,m.deleteSelectedQueueCampaignHoppers=function(e){var n=o.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+m.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),m.selectedQueueCampaignHoppers=[]})},c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){m.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.agents,{id:e.resourceId})}),t=null;if(m.queueCampaign&&(t=_.find(m.agents,{id:Number(m.queueCampaign.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.agents,{id:t.id});a.canSelect=!1,n.push(a)}m.agents=n})}else{var t=[],a=null;m.queueCampaign&&(a=_.find(m.agents,{id:Number(m.queueCampaign.UserId)}));for(var i=0;i<m.agents.length;i++)a&&m.agents[i].id===a.id&&(m.agents[i].canSelect=!1,t.push(m.agents[i]));m.agents=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}function h(){console.log("recalcTZTime hopper",g.hopper);var e=g.hopper.Queue.id;if(e)d.voiceQueue.get({id:e,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;if(g.hopper.dialTimezone=e.dialTimezone,n)d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(t-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})});else{d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),_.isNil(g.dateTime)||(g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss"))})}});else{d.cmHopper.getTimezone({id:g.hopper.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.hopper.scheduledat=moment(g.dateTime).add(0-n,"minutes").format("YYYY-MM-DD HH:mm:ss")})}}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.recalcTZTime=h,e.$watch("vm.contact.dialTimezone",function(){h()}),g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),n.params.id&&(g.hopper.VoiceQueueId=n.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var t,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,g.hopper.dialTimezone=g.contact.dialTimezone,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){t=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:t,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme}).$promise.then(function(){d.cmContact.update({id:a.ContactId,dialTimezone:g.contact.dialTimezone})})})});var n=_.find(g.hoppers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.dateTime,g.contact,d.cmContact.get({id:g.hopper.Contact.id,fields:"dialTimezone"}).$promise.then(function(e){var n;g.contact=e,console.log("initTZTime hopper",g.hopper),_.isNil(g.hopper.Queue.id)?(n=g.hopper.Campaign.id)&&d.campaign.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):(n=g.hopper.Queue.id)&&d.voiceQueue.get({id:n,fields:"dialTimezone"}).$promise.then(function(e){var n=e.dialTimezone;g.hopper.dialTimezone=e.dialTimezone,n?d.cmHopper.getTimezone({id:n}).$promise.then(function(e){var t=e.utcOffset;d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;g.dateTime=moment(g.hopper.scheduledat).add(n-t,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})}):d.cmHopper.getTimezone({id:g.contact.dialTimezone}).$promise.then(function(e){var n=e.utcOffset;_.isNil(n)&&(n=0),g.dateTime=moment(g.hopper.scheduledat).add(n-0,"minutes").toDate(),g.hopper.scheduledat=moment(g.hopper.scheduledat).format("YYYY-MM-DD HH:mm:ss")})})}),g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})}),t=null;if(g.hopper&&(t=_.find(g.agents,{id:Number(g.hopper.UserId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.agents,{id:t.id});a.canSelect=!1,n.push(a)}g.agents=n})}else{var t=[],a=null;g.hopper&&(a=_.find(g.agents,{id:Number(g.hopper.UserId)}));for(var i=0;i<g.agents.length;i++)a&&g.agents[i].id===a.id&&(g.agents[i].canSelect=!1,t.push(g.agents[i]));g.agents=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(t,a){var i=this;i.queueCampaign={},i.init=function(n){i.queueCampaign=n,t.cmHopper.get({limit:0,VoiceQueueId:n.id}).$promise.then(function(e){return i.total=e.count||0,t.cmHopper.get({limit:0,VoiceQueueId:n.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0,countnosuchnumberretry:0,countdropretry:0,countabandonedretry:0,countmachineretry:0,countagentrejectretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,t.cmHopperFinal.get({limit:0,VoiceQueueId:n.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(){return a(function(t,n){return a(function(n,t){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:d.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return d.allowedItems=_.map(n,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var n=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];d.selectedItems=_.map(n,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=n,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,n){var t=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(t)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),n=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var t},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,n,a,i,s,t,o,r){var l=this;function d(){n.hide()}function c(e,n){var t=n.id;o.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=t||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,n){return-1<n.indexOf(e)},l.toggle=function(e,n){var t=n.indexOf(e);-1<t?n.splice(t,1):n.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,n){for(var t=0;t<l.selected.length;t+=1)c(s.id,l.selected[t]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.queueCampaign=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:t.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.queueCampaign.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.queueCampaign.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(t,e,i,s,a,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.queueCampaign=c||t.params.queueCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.resetlistdialog=function(n,t){r.voiceQueue.getLists({id:n.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(t).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,n,t;e=u.queueCampaign.id,n=a.rows[0],t=n.id,r.voiceQueue.removeLists({id:e,ids:t}).$promise.then(function(){return r.voiceQueue.addLists({id:e,ids:t,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+n.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!1,locals:{queueCampaign:n,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},u.alert=l.info,u.gotoQueueCampaigns=function(){t.go("app.motiondialer.queueCampaigns",{},{reload:"app.motiondialer.queueCampaigns"})},u.saveQueueCampaign=function(){r.voiceQueue.update({id:u.queueCampaign.id},u.queueCampaign).$promise.then(function(){l.success({title:"QueueCampaign updated!",msg:u.queueCampaign.name?u.queueCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.musiconholds,{name:u.queueCampaign.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.trunks,{id:t.id});a.canSelect=!1,n.push(a)}u.trunks=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,t.push(u.trunks[i]));u.trunks=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.projects,{name:u.queueCampaign.dialQueueProject})),t&&!_.some(n,["id",t.id])){var a=_.find(u.projects,{id:t.id});a.canSelect=!1,n.push(a)}u.projects=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.projects,{name:u.queueCampaign.dialQueueProject}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),t=null;if(u.queueCampaign&&(t=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(u.interval,{id:t.id});a.canSelect=!1,n.push(a)}u.interval=n})}else{var t=[],a=null;u.queueCampaign&&(a=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,t.push(u.interval[i]));u.interval=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","queueCampaign","userProfileSection"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.queueCampaigns=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="queueCampaigns",f.listOrder="",f.listOrderAsc=null,f.selectedQueueCampaigns=[],f.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialNoSuchNumberMaxRetry,dialNoSuchNumberRetryFrequency,dialDropMaxRetry,dialDropRetryFrequency,dialAbandonedMaxRetry,dialAbandonedRetryFrequency,dialMachineMaxRetry,dialMachineRetryFrequency,dialAgentRejectMaxRetry,dialAgentRejectRetryFrequency,callAdditionalPhoneAfterMin,description,mandatoryDisposition,mandatoryDispositionPauseId,dialPredictiveIntervalMaxThreshold,dialPredictiveIntervalMinThreshold,dialPreviewAutoRecallMe",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.listadddialog=function(e,n){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.blacklistadddialog=function(e,n){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.teamadddialog=function(e,n){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:f.queueCampaigns?f.queueCampaigns.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("queueCampaign")+"?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.motiondialer.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.motiondialer.realtime.queues",{})}},f.success=E,f.getQueueCampaigns=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="QueueCampaigns",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditQueueCampaign=function(e,n){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n,queueCampaigns:f.queueCampaigns.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteQueueCampaign=y,f.exportSelectedQueueCampaigns=function(){var e=angular.copy(f.selectedQueueCampaigns);return f.selectedQueueCampaigns=[],e},f.deleteSelectedQueueCampaigns=function(e){var n=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+f.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedQueueCampaigns.forEach(function(e){y(e)}),f.selectedQueueCampaigns=[]})},f.deselectQueueCampaigns=function(){f.selectedQueueCampaigns=[]},f.selectAllQueueCampaigns=function(){f.selectedQueueCampaigns=f.queueCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.trunks,{id:e.resourceId})}),a=null;a=[],f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(f.trunks,{id:e.id});n.canSelect=!1,t.push(n)}}),f.trunks=t})}else{var t=[],a=[];f.queueCampaigns.rows.forEach(function(e){var n=_.find(f.trunks,{id:Number(e.TrunkId)});a.push(n)});for(var i=0;i<f.trunks.length;i++){_.some(a,{id:f.trunks[i].id})&&(f.trunks[i].canSelect=!1,t.push(f.trunks[i]))}f.trunks=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){f.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.interval,{id:e.resourceId})}),t=null;if(f.queueCampaign&&(t=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.interval,{id:t.id});a.canSelect=!1,n.push(a)}f.interval=n})}else{var t=[],a=null;f.queueCampaign&&(a=_.find(f.interval,{id:Number(f.queueCampaign.IntervalId)}));for(var i=0;i<f.interval.length;i++)a&&f.interval[i].id===a.id&&(f.interval[i].canSelect=!1,t.push(f.interval[i]));f.interval=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.queueCampaigns=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.queueCampaigns.rows,{id:e.id}),f.queueCampaigns.count-=1,f.queueCampaigns.rows.length||f.getQueueCampaigns(),p.success({title:_.startCase("QueueCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","queueCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},!1,g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(e){console.log(e)})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null};o.voiceQueueReport.update(n).$promise.catch(function(e){console.log(e)})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"outbound"===queue.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o,r,l,d,c,m){var u=this,p=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function g(){u.campaigns.rows.forEach(function(e){u.rpcCampaigns[e.id]&&_.merge(e,_.pick(u.rpcCampaigns[e.id],p))})}u.currentUser=m.getCurrentUser(),u.campaigns=o||{rows:[],count:0},u.rpcCampaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={sort:"name",limit:10,page:1},u.success=f,u.getCampaigns=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=r.campaign.get(u.query,f).$promise:(u.query.id=u.userProfile.id,u.query.section="IvrCampaigns",u.promise=r.userProfile.getResources(u.query,f).$promise)},u.onSave=function(e){var n=_.find(u.campaigns.rows,["id",e.id]);n&&(_.merge(n,_.pick(e,p)),_.merge(u.rpcCampaigns[e.id],_.pick(e,p)))},u.$onInit=g,u.createOrEditIvrCampaign=function(e,n){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:n,ivrCampaigns:u.campaigns.rows,license:null,setting:null,crudPermissions:u.crudPermissions}})},l.onWithoutApply("campaign:save",u.onSave),u.interval=n(function(){},999);var v=!0,h=1;function f(e){u.campaigns=e||{count:0,rows:[]},g()}e.$watch("vm.query.filter",function(e,n){v?t(function(){v=!1}):(n||(h=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=h),u.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),u.interval&&n.cancel(u.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function u(){c.queues.rows.forEach(function(e){c.rpcQueues[e.id]&&_.merge(e,_.pick(c.rpcQueues[e.id],m))})}c.queues=a||{rows:[],count:0},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"outbound",fields:"id,name",sort:"name",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"name",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="QueueCampaigns",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){var n=_.find(c.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.queues=e||{count:0,rows:[]},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,t.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.motiondialer.realtime.agents");break;case 1:t.go("app.motiondialer.realtime.queues");break;case 2:t.go("app.motiondialer.realtime.queue_calls");break;case 3:t.go("app.motiondialer.realtime.abandonedcalls");break;case 4:t.go("app.motiondialer.realtime.queue_params");break;case 5:t.go("app.motiondialer.realtime.ivr_campaigns");break;default:t.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",g.openchannelAccount=angular.copy(l),g.openchannelAccounts=r,g.newOpenchannelAccount=!1,g.openchannelAccount||(g.openchannelAccount={waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",g.newOpenchannelAccount=!0),n.params.id&&(g.openchannelAccount.OpenchannelAccountId=n.params.id),g.addNewOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.save(g.openchannelAccount).$promise.then(function(e){g.openchannelAccounts.unshift(e.toJSON()),o.success({title:"OpenchannelAccount properly created",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.update({id:g.openchannelAccount.id},g.openchannelAccount).$promise.then(function(e){var n=_.find(g.openchannelAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelAccount properly saved!",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.openchannelAccount.delete({id:g.openchannelAccount.id}).$promise.then(function(){_.remove(g.openchannelAccounts,{id:g.openchannelAccount.id}),o.success({title:"OpenchannelAccount properly deleted!",msg:(g.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),v(g.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.openchannelAccount&&(t=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.openchannelAccount&&(a=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:t,openchannelAccount:r.openchannelAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[n]=e:r.openchannelAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.openchannelAccountApps.rows.length;t++,0){var a=r.openchannelAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]},{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:801}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.openchannelAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=o.openchannelAccount.getApplications(r.query,t).$promise},r.editOpenchannelAccountApp=n,r.editInterval=function(e,n){if(r.openchannelAccountApps.rows.length){var t=r.openchannelAccountApps.rows[n]?r.openchannelAccountApps.rows[n]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelAccount.getAgents({id:c.openchannelAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelAccount?"penalty "+e.UserOpenchannelAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.removeAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelAccount.addAgents({id:c.openchannelAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelAccount","openchannelAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("openChannel")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:801}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"openchannelAccount",action:"getDispositions",field:"name",params:{id:m.openchannelAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.openchannelAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.openchannelAccountInteractions.rows.length;n+=1){var t=m.openchannelAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelInteraction.get(m.query,p).$promise}function v(e){d.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountInteractions.rows,{id:e.id}),m.openchannelAccountInteractions.count-=1,m.openchannelAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.from?e.contactName=e.from:e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("OPENCHANNEL.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountInteractions={count:0,rows:[]},m.selectedOpenchannelAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.openchannelInteractionDownload=function(s,e,n){return d.openchannelInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="openchannel-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getOpenchannelAccountInteractions=g,m.createOrEditOpenchannelAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,interaction:n,interactions:m.openchannelAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spyopenchannelInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"openchannel",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"openchannel.openchannelAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||OpenchannelAccountId:=$eq["+m.openchannelAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(m.selectedOpenchannelAccountInteractions);return m.selectedOpenchannelAccountInteractions=[],e},m.deleteOpenchannelAccountInteraction=v,m.deleteSelectedOpenchannelAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountInteractions.forEach(function(e){v(e)}),m.selectedOpenchannelAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.openchannelAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),m.openchannelAccountOpenchannelCannedAnswers.count-=1,m.openchannelAccountOpenchannelCannedAnswers.rows.length||p(),l.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.openchannelAccount={},m.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.openchannelAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("openchannelCannedAnswer #")+e.id||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getOpenchannelAccountOpenchannelCannedAnswers=p,m.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,n){o.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:m.openchannelAccount,openchannelCannedAnswer:n,openchannelCannedAnswers:m.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(m.selectedOpenchannelAccountOpenchannelCannedAnswers);return m.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},m.deleteOpenchannelAccountOpenchannelCannedAnswer=g,m.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+m.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),m.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",g.openchannelCannedAnswer=angular.copy(l),g.openchannelCannedAnswers=r,g.newOpenchannelCannedAnswer=!1,g.openchannelCannedAnswer||(g.openchannelCannedAnswer={},g.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",g.newOpenchannelCannedAnswer=!0),n.params.id&&(g.openchannelCannedAnswer.OpenchannelAccountId=n.params.id),g.addNewOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.openchannelCannedAnswer).$promise.then(function(e){g.openchannelCannedAnswers.unshift(e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly created",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.openchannelCannedAnswer.id},g.openchannelCannedAnswer).$promise.then(function(e){var n=_.find(g.openchannelCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly saved!",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(g.openchannelCannedAnswers,{id:g.openchannelCannedAnswer.id}),o.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(g.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),v(g.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.openchannelAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.openchannelAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.OpenchannelAccountId=m.openchannelAccount.id,m.query.id=m.openchannelAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.openchannelAccount.id,field:"OpenchannelAccountId",route:"openchannelAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.openchannelAccount=c||e.params.openchannelAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:p.openchannelAccounts?p.openchannelAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts",{},{reload:"app.openchannel.openchannelAccounts"})},p.saveOpenchannelAccount=function(){r.openchannelAccount.update({id:p.openchannelAccount.id},p.openchannelAccount).$promise.then(function(){l.success({title:"OpenchannelAccount updated!",msg:p.openchannelAccount.name?p.openchannelAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.openchannelAccount&&(t=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.openchannelAccount&&(a=_.find(p.lists,{id:Number(p.openchannelAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmContact.describe({id:p.openchannelAccount.ListId}).$promise.then(function(e){p.fields=[];e=_.values(e.toJSON());for(var n=["id","createdAt","updatedAt","deletedAt","scheduledat","ListId","CompanyId"],t=0;t<e.length;t++)_.includes(n,e[t].columnName)||p.fields.push(e[t])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelAccount","userProfile","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,waitForTheAssignedQueue,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:f.openchannelAccounts?f.openchannelAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelAccount")+"?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getOpenchannelAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelAccount=function(e,n){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:n,openchannelAccounts:f.openchannelAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelAccount=y,f.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(f.selectedOpenchannelAccounts);return f.selectedOpenchannelAccounts=[],e},f.deleteSelectedOpenchannelAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+f.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelAccounts.forEach(function(e){y(e)}),f.selectedOpenchannelAccounts=[]})},f.deselectOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=[]},f.selectAllOpenchannelAccounts=function(){f.selectedOpenchannelAccounts=f.openchannelAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.openchannelAccount&&(t=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.openchannelAccount&&(a=_.find(f.lists,{id:Number(f.openchannelAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.openchannelAccounts=e||{count:0,rows:[]}}function y(e){m.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelAccounts.rows,{id:e.id}),f.openchannelAccounts.count-=1,f.openchannelAccounts.rows.length||f.getOpenchannelAccounts(),p.success({title:_.startCase("OpenchannelAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",r.openchannelQueue=angular.copy(n),r.openchannelQueues=e,r.newOpenchannelQueue=!1,r.openchannelQueue||(r.openchannelQueue={strategy:"beepall",timeout:10},r.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",r.newOpenchannelQueue=!0),r.addNewOpenchannelQueue=function(){r.errors=[],i.openchannelQueue.save(r.openchannelQueue).$promise.then(function(e){r.openchannelQueues.unshift(e.toJSON()),a.success({title:"OpenchannelQueue properly created",msg:r.openchannelQueue.name?r.openchannelQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveOpenchannelQueue=function(){r.errors=[],i.openchannelQueue.update({id:r.openchannelQueue.id},r.openchannelQueue).$promise.then(function(e){var n=_.find(r.openchannelQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"OpenchannelQueue properly saved!",msg:r.openchannelQueue.name?r.openchannelQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteOpenchannelQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.openchannelQueue.delete({id:r.openchannelQueue.id}).$promise.then(function(){_.remove(r.openchannelQueues,{id:r.openchannelQueue.id}),a.success({title:"OpenchannelQueue properly deleted!",msg:(r.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),l(r.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","openchannelQueues","openchannelQueue","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getAgents({id:c.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addAgents({id:c.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.openchannelQueue.getTeams({id:l.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.openchannelQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:t.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.removeTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.openchannelQueue.addTeams({id:l.openchannelQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.openchannelQueue=c||e.params.openchannelQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues",{},{reload:"app.openchannel.openchannelQueues"})},u.saveOpenchannelQueue=function(){r.openchannelQueue.update({id:u.openchannelQueue.id},u.openchannelQueue).$promise.then(function(){l.success({title:"OpenchannelQueue updated!",msg:u.openchannelQueue.name?u.openchannelQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelQueue","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.openchannelQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="openchannelQueues",f.listOrder="",f.listOrderAsc=null,f.selectedOpenchannelQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:f.openchannelQueues?f.openchannelQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelQueue")+"?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:810}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.openchannel.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.openchannel.realtime.queues",{})}},f.success=E,f.getOpenchannelQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.openchannelQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="OpenchannelQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditOpenchannelQueue=function(e,n){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:n,openchannelQueues:f.openchannelQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteOpenchannelQueue=y,f.exportSelectedOpenchannelQueues=function(){var e=angular.copy(f.selectedOpenchannelQueues);return f.selectedOpenchannelQueues=[],e},f.deleteSelectedOpenchannelQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+f.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedOpenchannelQueues.forEach(function(e){y(e)}),f.selectedOpenchannelQueues=[]})},f.deselectOpenchannelQueues=function(){f.selectedOpenchannelQueues=[]},f.selectAllOpenchannelQueues=function(){f.selectedOpenchannelQueues=f.openchannelQueues.rows};var b=!0,A=1;function E(e){f.openchannelQueues=e||{count:0,rows:[]}}function y(e){m.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.openchannelQueues.rows,{id:e.id}),f.openchannelQueues.count-=1,f.openchannelQueues.rows.length||f.getOpenchannelQueues(),p.success({title:_.startCase("OpenchannelQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.openchannel.realtime.agents");break;case 1:t.go("app.openchannel.realtime.queues");break;default:t.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.currentUser=s.getCurrentUser(),o.plugin={},o.getTrustedURL=function(){return t.trustAsResourceUrl(o.plugin.adminUrl)},a.plugin.get({id:e.params.id}).$promise.then(function(e){if(e)return o.plugin=e,a.plugin.get({id:o.plugin.id}).$promise}).catch(function(e){o.plugin=void 0})}e.$inject=["$state","$scope","$sce","api","socket","Auth"],angular.module("app.plugins.plugin").controller("PluginController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o,r,l,d,c,m,u,p,g,v){var h=this,f=i.params.direction||"inbound",b=g&&1==g.count?g.rows[0].crudPermissions:null;function A(n){return h.query.offset=(h.query.page-1)*h.query.limit,e.resolve().then(function(){if(!0===n){var e=Object.assign({},_.omit(h.query,["limit","offset","page"]),{nolimit:!0});return o.realtime.getAgents(e).$promise}}).then(function(e){e&&(h.amiAgents=e)}).then(function(){var e=h.queues?h.queues.rows:[];h.agents=l.paginateAgents(h.amiAgents.rows,e,h.query)}).catch(function(e){c.error({title:s.instant("VOICE.AGENTS"),msg:e.status?JSON.stringify(e.data):e.toString()})})}function E(e){return _.find(h.amiAgents.rows,["id",e])}function y(e){var n=E(e.id);n?(Object.assign(n,e),A()):r.isAdmin()&&A(!0)}function S(){A(!0)}function T(e){var n=E(e.id);n?(Object.assign(n,e),A()):r.isAdmin()&&A(!0)}function I(){A(!0)}function O(e){var n=E(e.id);n?(Object.assign(n,_.pick(e,["queue","destconnectedlinenum","routealias"])),A()):r.isAdmin()&&A(!0)}function C(e){if("ATTENDED"!==e.transfer){var n=E(e.id);n?(delete n.queue,delete n.destconnectedlinenum,delete n.routealias,A()):r.isAdmin()&&A(!0)}}function w(e){if(0!==h.query.globalQueueFilter.length){var n=e[_.capitalize(h.channel)+"QueueId"];if(h.query.globalQueueFilter.includes(n))_.find(h.queues.rows,function(e){return e.id===n}).Agents.push({id:e.UserId}),A()}}function R(n){if(0!==h.query.globalQueueFilter.length){var t=n[_.capitalize(h.channel)+"QueueId"];if(h.query.globalQueueFilter.includes(t)){var e=_.find(h.queues.rows,function(e){return e.id===t});_.remove(e.Agents,function(e){return e.id===n.UserId}),A()}}}function x(){h.queues&&D(!0)}function N(){h.queues&&D(!0)}function D(e){if(!(h.queues&&0<h.queues.count)||e){var n={type:f,fields:"id,name",sort:"name",nolimit:!0,include:[{model:"User",alias:"Agents",fields:["id","name"],raw:!0}]},t=h.channel+"Queue";return o.getResourcesByRole(h.currentUser,t,n,null).then(function(e){h.queues=e}).catch(function(e){c.error({title:s.instant("VOICE.QUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})}}h.currentUser=r.getCurrentUser(),h.channel=i.params.channel,h.amiAgents=m,h.pauses=p,h.license=u,h.crudPermissions=r.parseCrudPermissions(b),h.utcOffset=v,h.query={channel:h.channel,globalQueueFilter:[],globalStatusFilter:null,pauseTypeFilter:null,limit:10,page:1,sort:"fullname"},h.$onInit=function(){d.on("user:remove",I),d.on("user:save",S),d.on("user:update",T),d.on("user:agentconnect",O),d.on("user:agentcomplete",C),d.on("user:ami:update",y),d.on("user:routing:update",y),d.on("user"+_.capitalize(h.channel)+"Queue:save",w),d.on("user"+_.capitalize(h.channel)+"Queue:remove",R),d.on(h.channel+"Queue:save",x),d.on(h.channel+"Queue:remove",N),A()},h.getAgents=A,h.onPaginate=function(){A()},h.onSort=function(){A()},h.logout=function(e){return o.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){c.success({title:"Agent logout",msg:e.fullname+" properly logout"})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.LOGOUT"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.pause=function(e,n){return o.user.pause({id:e.id,type:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.PAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.unpause=function(e){return o.user.unpause({id:e.id}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.UNPAUSE"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.addQueue=function(e,n){a.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,channel:h.channel,direction:f,crudPermissions:h.crudPermissions}})},h.manageScreenRecording=function(e,n){return o.user.update({id:e.id},{screenrecording:n}).$promise.catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:s.instant("VOICE.SCREENRECORDING"),msg:e.data?JSON.stringify(e.data.message):e.toString()})})},h.getQueuesByChannel=D,h.selectAllQueues=function(){h.query.globalQueueFilter=h.queues.rows.map(function(e){return e.id})},h.clearQueuesSelection=function(){h.query.globalQueueFilter=[]},n.$on("$destroy",function(){d.removeAllListeners("user:remove"),d.removeAllListeners("user:save"),d.removeAllListeners("user:update"),d.removeAllListeners("user:agentconnect"),d.removeAllListeners("user:agentcomplete"),d.removeAllListeners("user:ami:update"),d.removeAllListeners("user:routing:update"),d.removeAllListeners("user"+_.capitalize(h.channel)+"Queue:save"),d.removeAllListeners("user"+_.capitalize(h.channel)+"Queue:remove")})}e.$inject=["$document","$mdDialog","$q","$scope","$state","$translate","api","Auth","realtimeManager","socket","toasty","agents","license","pauses","userProfileSection","utcOffset"],angular.module("app.realtime").controller("AgentsRealtimeController",e)}(),function(){"use strict";function e(e,a,n,i,s,t,o,r,l,d,c){var m=this,u=c&&1==c.count?c.rows[0].crudPermissions:null;function p(){return m.queues.rows.map(function(e){return e.name})}function g(n){if(n.type===m.voiceQueueType&&p().includes(n.queue)){var e=_.find(m.voiceQueuesChannels.rows,function(e){return e.uniqueid===n.uniqueid});e?Object.assign(e,n):(m.voiceQueuesChannels.rows.push(n),m.voiceQueuesChannels.count=m.voiceQueuesChannels.rows.length)}}function v(n){m.voiceQueuesChannels.rows=_.filter(m.voiceQueuesChannels.rows,function(e){return e.uniqueid!==n.uniqueid}),m.voiceQueuesChannels.count=m.voiceQueuesChannels.rows.length}m.currentUser=t.getCurrentUser(),m.queues=l,m.voiceQueuesChannels=d,m.voiceQueueType=n.params.direction,m.crudPermissions=t.parseCrudPermissions(u),m.query={limit:10,page:1},m.$onInit=function(){o.on("voice_queue_channel:save",g),o.on("voice_queue_channel:remove",v);var n=p(),e=m.voiceQueuesChannels.rows.filter(function(e){if(n.includes(e.queue))return!0});m.voiceQueuesChannels.rows=e,m.voiceQueuesChannels.count=e.length},m.hangup=function(e){return s.rpc.getVoiceQueuesChannelHangup({uniqueid:e}).$promise.then(function(e){r.success({title:i.instant("VOICE.CALL_HANGUP_SUCCESS"),msg:e.message||void 0})}).catch(function(e){r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},m.getAvailableAgents=function(){m.availableAgents=null;var e={id:t.isUser()?m.currentUser.userProfileId:void 0,fields:"id,name,fullname,internal,context,online,voicePause,voiceStatus",sort:"fullname",online:!0,voicePause:!1};return s.realtime.getAgents(e).$promise.then(function(e){var n=e.rows.filter(function(e){return"idle"===e.voiceStatus});m.availableAgents=n}).catch(function(e){r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},m.redirectToAgent=function(e,n,t){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:e,exten:n,context:t}).$promise.then(function(e){r.success({title:i.instant("VOICE.CALL_REDIRECT_SUCCESS"),msg:e.message||void 0})}).catch(function(e){r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},m.redirectToNumber=function(e,n){var t=a.prompt().title(i.instant("VOICE.CALL_NUMBER_REDIRECT")).placeholder(i.instant("DASHBOARDS.NUMBER")).targetEvent(e).ok("Ok").cancel(i.instant("TOOLBAR.CANCEL"));return a.show(t).then(function(e){return s.rpc.getVoiceQueuesChannelRedirect({uniqueid:n,exten:e}).$promise}).then(function(e){r.success({title:i.instant("VOICE.CALL_REDIRECT_SUCCESS"),msg:e.message||void 0})}).catch(function(e){e&&r.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},e.$on("$destroy",function(){o.removeAllListeners("voice_queue_channel:save"),o.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$mdDialog","$state","$translate","api","Auth","socket","toasty","queues","voiceQueuesChannels","userProfileSection"],angular.module("app.realtime").controller("QueueCallsRealtimeController",e)}(),function(){"use strict";function e(i,s,e,n,t,a,o,r,l,d,c,m,u){var p=this,g=e(function(){},999),v=u&&1==u.count?u.rows[0].crudPermissions:null,h=t.params.direction,f="outbound"===h?"QueueCampaigns":_.startCase(p.channel)+"Queues";function b(e){var n=_.find(p.queues.rows,["id",e.id]);n&&(n=l.updateQueue(e,n))}p.currentUser=r.getCurrentUser(),p.channel=t.params.channel,p.queues=m,p.crudPermissions=r.parseCrudPermissions(v),p.headersTemplate=null,p.rowsTemplate=null,p.query={id:r.isUser()?p.currentUser.id:void 0,section:r.isUser()?f:void 0,channel:p.channel,type:h,sort:"name",limit:10,page:1},p.$onInit=function(){var e,n;d.on(p.channel+"_queue:save",b),p.headersTemplate=(e="default.html","voice"===p.channel&&(e=h+".html"),"app/main/apps/realtime/views/queues/templates/headers/"+e),p.rowsTemplate=(n="default.html","voice"===p.channel&&(n=h+".html"),"app/main/apps/realtime/views/queues/templates/rows/"+n),"voice"===p.channel&&p.queues.rows.forEach(function(e){0<e.ringing&&e.available<e.loggedIn&&(e.available+=e.ringing)})},p.getQueues=function(){return p.query.offset=(p.query.page-1)*p.query.limit,o.realtime.getQueues(p.query).$promise.then(function(e){p.queues=e}).catch(function(e){c.error({title:a.instant("DASHBOARDS.QUEUES"),msg:e.status?JSON.stringify(e.data):e.toString()})})},p.editQueue=function(e,n){var t={crudPermissions:p.crudPermissions};t[p.channel+"Queue"]=n,t[p.channel+"Queues"]=p.queues.rows;var a={controller:"CreateOrEdit"+_.startCase(p.channel)+"QueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/"+p.channel+"/views/"+p.channel+"Queues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:t};return s.show(a)},p.addOrRemoveAgents=function(e,n){var t={realtime:"voice"===p.channel,crudPermissions:p.crudPermissions};t[p.channel+"Queue"]=n,t[p.channel+"Queues"]=p.queues.rows;var a={controller:_.startCase(p.channel)+"QueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/"+p.channel+"/views/"+p.channel+"Queues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:t};return s.show(a)},p.showPredictiveInfo=function(e,n){var t={controller:"PredictiveInfoDialogController",controllerAs:"vm",templateUrl:"app/main/apps/realtime/views/queues/predictive/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:n}};return s.show(t)},n.$on("$destroy",function(){d.removeAllListeners(p.channel+"_queue:save"),g&&e.cancel(g)})}e.$inject=["$document","$mdDialog","$interval","$scope","$state","$translate","api","Auth","realtimeManager","socket","toasty","queues","userProfileSection"],angular.module("app.realtime").controller("QueuesRealtimeController",e)}(),function(){"use strict";function e(e,n){this.queueCampaign=n,this.formatTime=function(e,n){var t=moment(e);return n&&t.add(n,"minutes"),t.format("HH:mm:ss")},this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","queueCampaign"],angular.module("app.realtime").controller("PredictiveInfoDialogController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u){var p=this;function g(e){p.cloudProviders=e||{count:0,rows:[]}}function v(e){r.cloudProvider.delete({id:e.id}).$promise.then(function(){_.remove(p.cloudProviders.rows,{id:e.id}),p.cloudProviders.count-=1,p.cloudProviders.rows.length||p.getAiTools(),d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcloudProvider"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcloudProvider",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}p.license=m,p.setting=u,p.currentUser=c.getCurrentUser(),p.cloudProviders=o||{count:0,rows:[]},p.selectedAiTools=[],p.query={fields:"createdAt,updatedAt,id,name,service,type,data1,data2,data3,data4,data5,data6",sort:"-updatedAt",limit:10,page:1},p.services={AmazonAWS:"AmazonAWS",MicrosoftAzure:"Microsoft Azure"},p.editdialog=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{cloudProvider:e,cloudProviders:p.cloudProviders.rows,license:p.license,setting:null,crudPermissions:p.crudPermissions}})},p.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:e.name})).ariaLabel("delete cloud provider").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){v(e)})},p.success=g,p.getAiTools=function(){p.query.offset=(p.query.page-1)*p.query.limit,c.hasRole("admin")?p.promise=r.cloudProvider.get(p.query,g).$promise:(p.query.id=p.userProfile.id,p.query.section="AiTools",p.promise=r.userProfile.getResources(p.query,g).$promise)},p.createOrEditCloudProvider=function(e,n){a.show({controller:"CreateOrEditCloudProviderDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{cloudProvider:n,cloudProviders:p.cloudProviders.rows,license:p.license,setting:p.setting,crudPermissions:p.crudPermissions}})},p.deleteCloudProvider=v,p.exportSelectedAiTools=function(){var e=angular.copy(p.selectedAiTools);return p.selectedAiTools=[],e},p.deleteSelectedAiTools=function(e){var n=a.confirm().title(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_TITLE")).content(s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETE_MESSAGE",{total:p.selectedAiTools.length})).ariaLabel("delete CloudProviders").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){p.selectedAiTools.forEach(function(e){v(e)}),p.selectedAiTools=[],d.success({title:s.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE")})})},p.deselectAiTools=function(){p.selectedAiTools=[]},p.selectAllAiTools=function(){p.selectedAiTools=p.cloudProviders.rows},p.authenticateToMicrosoftIdentityPlatform=function(e){return r.cloudProvider.oauth2MicrosoftAuthorize({id:e.id}).$promise.then(function(e){p.loginWindow=n.open(e.url,"_blank","width=800,height=600")})},p.updateClientSecret=function(n,e){return a.show({controller:"UpdateClientSecretController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,resolve:{cloudProvider:["apiResolver",function(e){return e.resolve("cloudProvider@get",{fields:"id,service,data3",id:n.id})}]}})},l.on("microsoftAuthorization:success",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.success({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_SUCCESS")}))}),l.on("microsoftAuthorization:error",function(e){p.currentUser.id===e.id&&(p.loginWindow.close(),d.error({msg:s.instant("SETTINGS.NOTIFICATIONS.MICROSOFT_AUTHENTICATION_FAIL")}))}),e.$on("$destroy",function(){l.removeAllListeners("microsoftAuthorization:success"),l.removeAllListeners("microsoftAuthorization:error")});var h=!0,f=1;e.$watch("vm.query.filter",function(e,n){h?i(function(){h=!1}):(n||(f=p.query.page),e!==n&&(p.query.page=1),e||(p.query.page=f),p.getAiTools())})}e.$inject=["$scope","$window","$mdDialog","$document","$timeout","$translate","cloudProviders","api","socket","toasty","Auth","license","setting"],angular.module("app.settings").controller("CloudProvidersController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r){var l=this;function d(e){t.hide(e)}l.currentUser=o.getCurrentUser(),l.license=r,l.cloudProvider=angular.copy(n),l.cloudProviders=e,l.newCloudProvider=!1,l.errors=[],l.cloudProvider||(l.cloudProvider={},l.newCloudProvider=!0),l.addNewCloudProvider=function(){l.errors=[],s.cloudProvider.save(l.cloudProvider).$promise.then(function(e){l.cloudProviders.unshift(e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_CREATED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.saveCloudProvider=function(){l.errors=[],s.cloudProvider.update({id:l.cloudProvider.id},l.cloudProvider).$promise.then(function(e){var n=_.find(l.cloudProviders,{id:e.id});n&&_.merge(n,e.toJSON()),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SAVED_SUCCESS_TITLE")}),d(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.deleteCloudProvider=function(e){l.errors=[];var n=t.confirm().title(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_TITLE")).content(a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETE_MESSAGE",{name:l.cloudProvider.name})).ariaLabel("Delete Cloud Provider").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.cloudProvider.delete({id:l.cloudProvider.id}).$promise.then(function(){_.remove(l.cloudProviders,{id:l.cloudProvider.id}),i.success({title:a.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_DELETED_SUCCESS_TITLE")}),d(l.cloudProvider)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},l.closeDialog=d}e.$inject=["$mdDialog","$translate","toasty","cloudProviders","cloudProvider","api","Auth","license"],angular.module("app.settings").controller("CreateOrEditCloudProviderDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.cloudProvider=i,s.errors=[],s.saveSecret=function(){return s.errors=[],a.cloudProvider.update({id:i.id},{data3:s.newSecret}).$promise.then(function(){t.success({title:n.instant("SETTINGS.NOTIFICATIONS.CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE")}),o()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.cloudProvider.update"}];for(var n=0;n<e.data.errors.length;n+=1)t.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cloudProvider.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},s.closeDialog=o}e.$inject=["$mdDialog","$translate","toasty","api","cloudProvider"],angular.module("app.settings").controller("UpdateClientSecretController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_CUSTOMIZATION",g.customization=angular.copy(l),g.customizations=r,g.newCustomization=!1,g.customization||(g.customization={},g.title="SETTINGS.NEW_CUSTOMIZATION",g.newCustomization=!0),g.addNewCustomization=function(){g.errors=[],d.setting.save(g.customization).$promise.then(function(e){g.customizations.unshift(e.toJSON()),o.success({title:"Customization properly created",msg:g.customization.name?g.customization.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomization=function(){g.errors=[],d.setting.update({id:g.customization.id},g.customization).$promise.then(function(e){var n=_.find(g.customizations,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Customization properly saved!",msg:g.customization.name?g.customization.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomization=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.customization.id}).$promise.then(function(){_.remove(g.customizations,{id:g.customization.id}),o.success({title:"Customization properly deleted!",msg:(g.customization.name||"customization")+" has been deleted!"}),v(g.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customizations","customization","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.customizations=e,s.customization={},s.customizations&&s.customizations.rows&&s.customizations.rows.length&&(s.customization=s.customizations.rows[0]),s.saveCustomization=function(){s.customization.id?n.setting.update({id:s.customization.id},s.customization).$promise.then(function(){t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.customization).$promise.then(function(e){_.merge(s.customization,e),t.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty","license","Auth"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg","ico"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/favicon".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationfaviconController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/preferred".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationpreferredController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_GENERAL",g.general=angular.copy(l),g.generals=r,g.newGeneral=!1,g.general||(g.general={min_internal:1e3,chatTimeout:30,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml",splitSizeCsv:5e3,splitSizePdf:1e3,splitSizeXlsx:5e3,messagesAlignment:"alternate",phoneBarRememberMeEnabled:!0,allowedLoginAttempts:5,blockDuration:10,loginMailFrequency:10,enforcePasswordHistory:!0,passwordHistoryLimit:3},g.title="SETTINGS.NEW_GENERAL",g.newGeneral=!0),g.addNewGeneral=function(){g.errors=[],d.setting.save(g.general).$promise.then(function(e){g.generals.unshift(e.toJSON()),o.success({title:"General properly created",msg:g.general.name?g.general.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGeneral=function(){g.errors=[],d.setting.update({id:g.general.id},g.general).$promise.then(function(e){var n=_.find(g.generals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"General properly saved!",msg:g.general.name?g.general.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGeneral=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.setting.delete({id:g.general.id}).$promise.then(function(){_.remove(g.generals,{id:g.general.id}),o.success({title:"General properly deleted!",msg:(g.general.name||"general")+" has been deleted!"}),v(g.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.cloudProviders=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","generals","general","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.generals=e,s.general={},s.generals&&s.generals.rows&&s.generals.rows.length&&(s.general=s.generals.rows[0]),_.isNil(s.general.privacyPolicyEmail)||(s.general.enablePrivacyPolicyEmail=!0),_.isNil(s.general.privacyPolicyName)||(s.general.enablePrivacyPolicyName=!0),_.isNil(s.general.privacyPolicyNumber)||(s.general.enablePrivacyPolicyNumber=!0),n.cloudProvider.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){s.cloudProviders=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CLOUDPROVIDERS",msg:e.data?JSON.stringify(e.data):e.toString()})}),s.saveGeneral=function(){s.general.enablePrivacyPolicyEmail||(s.general.privacyPolicyEmail=null),s.general.enablePrivacyPolicyNumber||(s.general.privacyPolicyNumber=null),s.general.enablePrivacyPolicyName||(s.general.privacyPolicyName=null),s.general.id?n.setting.update({id:s.general.id},s.general).$promise.then(function(){t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):n.setting.save(s.general).$promise.then(function(e){_.merge(s.general,e),t.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.onPrivacyPolicyChange=function(e){switch(e){case"email":s.general.enablePrivacyPolicyEmail&&!s.general.privacyPolicyEmail&&(s.general.privacyPolicyEmail=0);break;case"name":s.general.enablePrivacyPolicyName&&!s.general.privacyPolicyName&&(s.general.privacyPolicyName=0);break;case"number":s.general.enablePrivacyPolicyNumber&&!s.general.privacyPolicyNumber&&(s.general.privacyPolicyNumber=0)}}}e.$inject=["generals","api","toasty","license","Auth"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l){var d=this;d.license=i||{},d.agents=0,d.users=0,d.telephones=0,d.channels=[{name:"voice",icon:"icon-phone"},{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"},{name:"whatsapp",icon:"icon-whatsapp"}],d.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],d.addons=[{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"},{name:"screenrecording",icon:"icon-video"},{name:"ai",icon:"icon-text-to-speech"}],d.sessions=[{name:"callysquare",icon:"icon-sitemap",restart:!0,label:"channels",enabled:"voice"},{name:"virtual",icon:"icon-dots-horizontal",restart:!1,label:"sessions",enabled:"chat"}],d.others=[{name:"update",icon:"icon-cloud-download"}],d.requestLicense=function(e){t.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:d.channels,modules:d.modules,addons:d.addons,sessions:d.sessions,others:d.others}})},d.updateLicense=function(e){t.show({controller:"UpdateLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/update/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i}})},d.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},d.alert=s.info,d.downloadLogFile=function(){return o.license.downloadLogFile().$promise.then(function(e){var n=[e.buffer],t=new Blob(n,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(t)),a.setAttribute("download","license-info.log"),document.body.appendChild(a),a.click(),s.success({title:l.instant("SETTINGS.LICENSE_LOG_FILE"),msg:l.instant("SETTINGS.LICENSE_LOG_FILE_DOWNLOADED")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.isAdmin=r.isAdmin(),o.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return d.agents=e&&e.count?e.count:0,o.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return d.users=e&&e.count?e.count:0,o.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){d.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$window","$mdDialog","$state","license","toasty","api","Auth","$translate"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){e.hide()}m.errors=[],m.user=d.getCurrentUser(),m.license=angular.copy(t),m.channels=a,m.modules=i,m.addons=s,m.sessions=o,m.others=r,m.license.name=m.user.fullname,m.license.email=m.user.email,m.sendRequest=function(){for(var e in m.errors=[],m.table="||FIELD||OLD||NEW||\n",m.license)m.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(t[e]===m.license[e]?m.table+="|"+e+"|"+(void 0!==t[e]?t[e]:"")+"|"+m.license[e]+"|\n":m.table+="|"+e+"|{color:red}"+(void 0!==t[e]?t[e]:"")+"{color}|*"+m.license[e]+"*|\n");l.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:m.table,issuetype:"License Request"}).$promise.then(function(e){n.success({title:"Request sent!",msg:c.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),u()}).catch(function(e){console.error(e),m.errors=[{message:c.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},m.closeDialog=u}e.$inject=["$mdDialog","toasty","license","channels","modules","addons","sessions","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.errors=[],s.license=angular.copy(t),s.licenseKey,s.updateLicense=function(){return a.license.update({id:1,key:s.licenseKey}).$promise.then(function(e){e&&(e.demo?n.error({title:"License update failed!",msg:"Invalid license key"}):n.success({title:"License properly updated!",msg:"The license has been updated!"}))}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","toasty","license","api","$translate"],angular.module("app.settings.license").controller("UpdateLicenseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){a.hide(e)}p.currentUser=c.getCurrentUser(),p.errors=[],p.setting=u,p.license=m,p.hasModulePermissions={},p.passwordPattern=p.setting&&p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.title="SETTINGS.EDIT_NETWORK",p.network=angular.copy(l),p.networks=r,p.newNetwork=!1,p.network||(p.network={type:"localnet"},p.title="SETTINGS.NEW_NETWORK",p.newNetwork=!0),p.addNewNetwork=function(){p.errors=[],d.network.save(p.network).$promise.then(function(e){p.networks.unshift(e.toJSON()),o.success({title:"Network properly created",msg:p.network.name?p.network.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveNetwork=function(){p.errors=[],d.network.update({id:p.network.id},p.network).$promise.then(function(e){var n=_.find(p.networks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Network properly saved!",msg:p.network.name?p.network.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteNetwork=function(e){p.errors=[];var n=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.network.delete({id:p.network.id}).$promise.then(function(){_.remove(p.networks,{id:p.network.id}),o.success({title:"Network properly deleted!",msg:(p.network.name||"network")+" has been deleted!"}),g(p.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.getDateFromString=function(e){return null===e?void 0:new Date(e)},p.closeDialog=g}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;v.license=p,v.setting=g,v.currentUser=u.getCurrentUser(),v.networks=l||{count:0,rows:[]},v.table="networks",v.listOrder="",v.listOrderAsc=null,v.selectedNetworks=[],v.query={fields:"createdAt,updatedAt,id,type,value,username,password",sort:"-updatedAt",limit:10,page:1},v.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"},{option:"Turn",value:"'turn'"},{option:"Stun",value:"'stun'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),v.editdialog=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{network:e,networks:v.networks.rows,license:v.license,setting:null,crudPermissions:v.crudPermissions}})},v.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("network")+"?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},v.success=b,v.getNetworks=function(){v.query.offset=(v.query.page-1)*v.query.limit,u.hasRole("admin")?v.promise=d.network.get(v.query,b).$promise:(v.query.id=v.userProfile.id,v.query.section="Networks",v.promise=d.userProfile.getResources(v.query,b).$promise)},v.createOrEditNetwork=function(e,n){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:n,networks:v.networks.rows,license:v.license,setting:v.setting,crudPermissions:v.crudPermissions}})},v.deleteNetwork=A,v.exportSelectedNetworks=function(){var e=angular.copy(v.selectedNetworks);return v.selectedNetworks=[],e},v.deleteSelectedNetworks=function(e){var n=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+v.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){v.selectedNetworks.forEach(function(e){A(e)}),v.selectedNetworks=[]})},v.deselectNetworks=function(){v.selectedNetworks=[]},v.selectAllNetworks=function(){v.selectedNetworks=v.networks.rows};var h=!0,f=1;function b(e){v.networks=e||{count:0,rows:[]}}function A(e){d.network.delete({id:e.id}).$promise.then(function(){_.remove(v.networks.rows,{id:e.id}),v.networks.count-=1,v.networks.rows.length||v.getNetworks(),m.success({title:_.startCase("Network")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var n=0;n<e.data.errors.length;n++)m.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){h?o(function(){h=!1}):(n||(f=v.query.page),e!==n&&(v.query.page=1),e||(v.query.page=f),v.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","networks","api","msUtils","toasty","Auth","license","setting"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;l.currentUser=o.getCurrentUser(),l.license=s,l.providers=r.getEmailProviders(),l.mailAccounts=e||{rows:[],count:0},l.cloudProviders=t||{rows:[],count:0},l.mailAccount={service:!0,Smtp:{}},0<l.mailAccounts.count&&(l.mailAccount=l.mailAccounts.rows[0]),l.originalProvider=l.mailAccount.provider,l.saveSmtp=function(){var e=angular.copy(l.mailAccount);"custom"===e.provider?e.provider=null:(l.originalProvider!==e.provider&&(e.Smtp.modernAuthentication?e.Smtp.pass=null:e.Smtp.CloudProviderId=null),e.Smtp.modernAuthentication||(e.Smtp.CloudProviderId=null),e.Smtp=_.omit(e.Smtp,["host","port","secure","service"]));l.mailAccount.id?a.mailAccount.update({id:l.mailAccount.id},e).$promise.then(function(){l.originalProvider=e.provider,i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):a.mailAccount.save(e).$promise.then(function(e){_.merge(l.mailAccount,e),i.success({msg:n.instant("SETTINGS.NOTIFICATIONS.SMTP_SAVED_SUCCESS_TITLE")})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},l.verifySmtp=function(){a.mailAccount.verifySmtp({id:l.mailAccount.id}).$promise.then(function(){i.success({msg:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_SUCCESS_TITLE")})}).catch(function(e){i.error({title:n.instant("MAIL.NOTIFICATIONS.SMTP_CONNECTION_FAIL_TITLE"),msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})},l.onProviderChange=function(){"custom"!==l.mailAccount.provider&&(l.mailAccount.authentication=!0);"outlook365"!==l.mailAccount.provider&&(l.mailAccount.Smtp.modernAuthentication=!1)}}e.$inject=["$translate","mailAccounts","cloudProviders","api","toasty","license","Auth","msUtils"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,s,n,t,a,o,r){var l,d=this;d.system=t||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=n.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,n,t){var a=s.confirm().title("Would you like to change the status of the process #"+n+"?").textContent("The status will be changed to: "+t.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");s.show(a).then(function(){return r.pm2.update({id:n,status:t})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){o.success({title:"Process updated!",msg:"Status properly changed to: "+t})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;s.title="SETTINGS.UPDATE",s.progress=0,s.updating=!0,s.output="Waiting...",s.success=!0,s.interval=n(function(){s.progress<90&&(s.progress+=1)},1e3),s.closeDialog=function(){e.hide()},s.reload=function(){t.location.reload()},s.stopInterval=function(){angular.isDefined(s.interval)&&(n.cancel(s.interval),s.interval=void 0);s.progress=100,s.updating=!1},i.version.fetch().$promise.then(function(e){return s.output=e.output+"...",i.version.reset().$promise}).then(function(e){return s.output=e.output+"...",i.version.pull().$promise}).then(function(e){return s.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return s.output=e.output+"...",i.version.restart().$promise}).then(function(e){s.output="Waiting to restart motion...",a(function(){s.stopInterval()},3e4)}).catch(function(e){s.success=!1,s.stopInterval(),s.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(t,e,a,n,i){this.version=n||{},this.updateConfirm=function(e){var n=t.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");t.show(n).then(function(){t.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.sms.realtime.agents");break;case 1:t.go("app.sms.realtime.queues");break;default:t.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSACCOUNT",g.smsAccount=angular.copy(l),g.smsAccounts=r,g.newSmsAccount=!1,g.smsAccount||(g.smsAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="SMS.NEW_SMSACCOUNT",g.newSmsAccount=!0),n.params.id&&(g.smsAccount.SmsAccountId=n.params.id),g.addNewSmsAccount=function(){g.errors=[],d.smsAccount.save(g.smsAccount).$promise.then(function(e){g.smsAccounts.unshift(e.toJSON()),o.success({title:"SmsAccount properly created",msg:g.smsAccount.name?g.smsAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsAccount=function(){g.errors=[],d.smsAccount.update({id:g.smsAccount.id},g.smsAccount).$promise.then(function(e){var n=_.find(g.smsAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsAccount properly saved!",msg:g.smsAccount.name?g.smsAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.smsAccount.delete({id:g.smsAccount.id}).$promise.then(function(){_.remove(g.smsAccounts,{id:g.smsAccount.id}),o.success({title:"SmsAccount properly deleted!",msg:(g.smsAccount.name||"smsAccount")+" has been deleted!"}),v(g.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.smsAccount&&(t=_.find(g.lists,{id:Number(g.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.smsAccount&&(a=_.find(g.lists,{id:Number(g.smsAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsAccounts","smsAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:t,smsAccount:r.smsAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[n]=e:r.smsAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.smsAccountApps.rows.length;t++,0){var a=r.smsAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:701}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.smsAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=o.smsAccount.getApplications(r.query,t).$promise},r.editSmsAccountApp=n,r.editInterval=function(e,n){if(r.smsAccountApps.rows.length){var t=r.smsAccountApps.rows[n]?r.smsAccountApps.rows[n]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsAccount.getAgents({id:c.smsAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsAccount?"penalty "+e.UserSmsAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.removeAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsAccount.addAgents({id:c.smsAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsAccount","smsAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("sms")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"smsAccount",action:"getDispositions",field:"name",params:{id:m.smsAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.smsAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.smsAccountInteractions.rows.length;n+=1){var t=m.smsAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsInteraction.get(m.query,p).$promise}function v(e){d.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountInteractions.rows,{id:e.id}),m.smsAccountInteractions.count-=1,m.smsAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?(e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""),e.contactInfo=e.Contact.mobile):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountInteractions={count:0,rows:[]},m.selectedSmsAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.smsInteractionDownload=function(s,e,n){return d.smsInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="sms-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getSmsAccountInteractions=g,m.createOrEditSmsAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,interaction:n,interactions:m.smsAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spysmsInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"sms",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"sms.smsAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||SmsAccountId:=$eq["+m.smsAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(m.selectedSmsAccountInteractions);return m.selectedSmsAccountInteractions=[],e},m.deleteSmsAccountInteraction=v,m.deleteSelectedSmsAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountInteractions.forEach(function(e){v(e)}),m.selectedSmsAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.smsAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.smsAccountSmsCannedAnswers.rows,{id:e.id}),m.smsAccountSmsCannedAnswers.count-=1,m.smsAccountSmsCannedAnswers.rows.length||p(),l.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.smsAccount={},m.smsAccountSmsCannedAnswers={count:0,rows:[]},m.selectedSmsAccountSmsCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.smsAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("smsCannedAnswer #")+e.id||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getSmsAccountSmsCannedAnswers=p,m.createOrEditSmsAccountSmsCannedAnswer=function(e,n){o.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:m.smsAccount,smsCannedAnswer:n,smsCannedAnswers:m.smsAccountSmsCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(m.selectedSmsAccountSmsCannedAnswers);return m.selectedSmsAccountSmsCannedAnswers=[],e},m.deleteSmsAccountSmsCannedAnswer=g,m.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+m.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),m.selectedSmsAccountSmsCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSCANNEDANSWER",g.smsCannedAnswer=angular.copy(l),g.smsCannedAnswers=r,g.newSmsCannedAnswer=!1,g.smsCannedAnswer||(g.smsCannedAnswer={},g.title="SMS.NEW_SMSCANNEDANSWER",g.newSmsCannedAnswer=!0),n.params.id&&(g.smsCannedAnswer.SmsAccountId=n.params.id),g.addNewSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.smsCannedAnswer).$promise.then(function(e){g.smsCannedAnswers.unshift(e.toJSON()),o.success({title:"SmsCannedAnswer properly created",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.smsCannedAnswer.id},g.smsCannedAnswer).$promise.then(function(e){var n=_.find(g.smsCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"SmsCannedAnswer properly saved!",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.smsCannedAnswer.id}).$promise.then(function(){_.remove(g.smsCannedAnswers,{id:g.smsCannedAnswer.id}),o.success({title:"SmsCannedAnswer properly deleted!",msg:(g.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),v(g.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.smsAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.smsAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.SmsAccountId=m.smsAccount.id,m.query.id=m.smsAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.smsAccount.id,field:"SmsAccountId",route:"smsAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.sms").controller("SmsAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.smsAccount=c||e.params.smsAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.agentadddialog=function(e,n){t.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:p.smsAccounts?p.smsAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts",{},{reload:"app.sms.smsAccounts"})},p.saveSmsAccount=function(){r.smsAccount.update({id:p.smsAccount.id},p.smsAccount).$promise.then(function(){l.success({title:"SmsAccount updated!",msg:p.smsAccount.name?p.smsAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.smsAccount&&(t=_.find(p.lists,{id:Number(p.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.smsAccount&&(a=_.find(p.lists,{id:Number(p.smsAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsAccount","userProfile","userProfileSection"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedSmsAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,accountId,applicationId,senderString,deliveryReport,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"},{option:"Infobip",value:"'infobip'"},{option:"Clickatell",value:"'clickatell'"},{option:"Bandwidth",value:"'bandwidth'"},{option:"CSCTelecom",value:"'csc'"},{option:"Intelepeer",value:"'intelepeer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysmsMethod=_.keyBy([{option:"Basic",value:"'SI'"},{option:"Classic",value:"'TI'"},{option:"Classic+",value:"'GP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:f.smsAccounts?f.smsAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsAccount")+"?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSmsAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsAccount=function(e,n){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:n,smsAccounts:f.smsAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSmsAccount=y,f.exportSelectedSmsAccounts=function(){var e=angular.copy(f.selectedSmsAccounts);return f.selectedSmsAccounts=[],e},f.deleteSelectedSmsAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+f.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsAccounts.forEach(function(e){y(e)}),f.selectedSmsAccounts=[]})},f.deselectSmsAccounts=function(){f.selectedSmsAccounts=[]},f.selectAllSmsAccounts=function(){f.selectedSmsAccounts=f.smsAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.smsAccount&&(t=_.find(f.lists,{id:Number(f.smsAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.smsAccount&&(a=_.find(f.lists,{id:Number(f.smsAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.smsAccounts=e||{count:0,rows:[]}}function y(e){m.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.smsAccounts.rows,{id:e.id}),f.smsAccounts.count-=1,f.smsAccounts.rows.length||f.getSmsAccounts(),p.success({title:_.startCase("SmsAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="SMS.EDIT_SMSQUEUE",r.smsQueue=angular.copy(n),r.smsQueues=e,r.newSmsQueue=!1,r.smsQueue||(r.smsQueue={strategy:"beepall",timeout:10},r.title="SMS.NEW_SMSQUEUE",r.newSmsQueue=!0),r.addNewSmsQueue=function(){r.errors=[],i.smsQueue.save(r.smsQueue).$promise.then(function(e){r.smsQueues.unshift(e.toJSON()),a.success({title:"SmsQueue properly created",msg:r.smsQueue.name?r.smsQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveSmsQueue=function(){r.errors=[],i.smsQueue.update({id:r.smsQueue.id},r.smsQueue).$promise.then(function(e){var n=_.find(r.smsQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"SmsQueue properly saved!",msg:r.smsQueue.name?r.smsQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteSmsQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.smsQueue.delete({id:r.smsQueue.id}).$promise.then(function(){_.remove(r.smsQueues,{id:r.smsQueue.id}),a.success({title:"SmsQueue properly deleted!",msg:(r.smsQueue.name||"smsQueue")+" has been deleted!"}),l(r.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","smsQueues","smsQueue","api","Auth","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getAgents({id:c.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.smsQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addAgents({id:c.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.smsQueue.getTeams({id:l.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.smsQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("SMS.ALL_TEAMS"),labelSelected:t.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.removeTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.smsQueue.addTeams({id:l.smsQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.smsQueue=c||e.params.smsQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsQueues=function(){e.go("app.sms.smsQueues",{},{reload:"app.sms.smsQueues"})},u.saveSmsQueue=function(){r.smsQueue.update({id:u.smsQueue.id},u.smsQueue).$promise.then(function(){l.success({title:"SmsQueue updated!",msg:u.smsQueue.name?u.smsQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsQueue","userProfileSection"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.smsQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="smsQueues",f.listOrder="",f.listOrderAsc=null,f.selectedSmsQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:f.smsQueues?f.smsQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("smsQueue")+"?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:710}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.sms.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.sms.realtime.queues",{})}},f.success=E,f.getSmsQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.smsQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="SmsQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSmsQueue=function(e,n){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:n,smsQueues:f.smsQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteSmsQueue=y,f.exportSelectedSmsQueues=function(){var e=angular.copy(f.selectedSmsQueues);return f.selectedSmsQueues=[],e},f.deleteSelectedSmsQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+f.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSmsQueues.forEach(function(e){y(e)}),f.selectedSmsQueues=[]})},f.deselectSmsQueues=function(){f.selectedSmsQueues=[]},f.selectAllSmsQueues=function(){f.selectedSmsQueues=f.smsQueues.rows};var b=!0,A=1;function E(e){f.smsQueues=e||{count:0,rows:[]}}function y(e){m.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.smsQueues.rows,{id:e.id}),f.smsQueues.count-=1,f.smsQueues.rows.length||f.getSmsQueues(),p.success({title:_.startCase("SmsQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.agents=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="Agents",g.promise=l.userProfile.getResources(g.query,v).$promise)}function f(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.agents.rows,{id:e.id}),g.agents.count-=1,g.agents.rows.length||g.getAgents(),d.success({title:_.startCase("Agent")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.agents=s||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedAgents=[],g.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,wssPort,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,smsCapacity,openchannelCapacity,faxCapacity,whatsappCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,disabled,blocked,phoneBarEnableScreenRecordingByAgent,phoneBarEnableAutomaticScreenRecording,privacyEnabled,downloadAttachments,downloadOmnichannelInteractions,downloadVoiceRecordings,selectRecallMeCampaign,ignorePauseForPreviewCalls,adSsoEnabled,chatAutoanswer,chatAutoanswerDelay",role:"agent",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.showWebBarOptions=[{option:"Phonebar",value:0},{option:"External",value:1},{option:"WebRTC",value:2}],g.editstate=function(e){n.go("app.staff.agents.edit",{id:e.id,agent:e,crudPermissions:g.crudPermissions})},g.teamadddialog=function(e,n){a.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:g.agents?g.agents.rows:[],crudPermissions:g.crudPermissions}})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("agent")+"?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){f(e)})},g.success=v,g.getAgents=h,g.createOrEditAgent=function(e,n){a.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:n,agents:g.agents.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteAgent=f,g.exportSelectedAgents=function(){var e=angular.copy(g.selectedAgents);return g.selectedAgents=[],e},g.deleteSelectedAgents=function(e){var n=a.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+g.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedAgents.forEach(function(e){f(e)}),g.selectedAgents=[]})},g.deselectAgents=function(){g.selectedAgents=[]},g.selectAllAgents=function(){g.selectedAgents=g.agents.rows};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),g.getAgents())}),p.on("user-setting:update",h),e.$on("$destroy",function(){p.removeListener("user-setting:update",h)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","agents","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_AGENT",m.agent=angular.copy(i),m.agents=n,m.newAgent=!1,m.agent||(m.agent={role:"agent",showWebBar:"0",autointernal:!0,wssPort:8089,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0,downloadAttachments:!0,downloadOmnichannelInteractions:!0,downloadVoiceRecordings:!0},m.title="STAFF.NEW_AGENT",m.newAgent=!0),m.addNewAgent=function(){m.errors=[],s.user.save(m.agent).$promise.then(function(e){m.agents.unshift(e.toJSON()),a.success({title:"Agent properly created",msg:m.agent.name?m.agent.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveAgent=function(){m.errors=[],s.user.update({id:m.agent.id},m.agent).$promise.then(function(e){var n=_.find(m.agents,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"Agent properly saved!",msg:m.agent.name?m.agent.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteAgent=function(e){m.errors=[];var n=t.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.agent.id}).$promise.then(function(){_.remove(m.agents,{id:m.agent.id}),a.success({title:"Agent properly deleted!",msg:(m.agent.name||"agent")+" has been deleted!"}),p(m.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p;var g="user-setting:update:user-"+m.agent.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","agents","agent","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.agent=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.agent=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.agent.id,newPassword:r.password};r.currentUser.id==r.agent.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Agent password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.agent.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.agentForm.password.$setValidity("oldPasswordMatch",!1):t.agentForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","agent","setting","Auth"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(e,n,i,t,s){var o=this;o.agent={},o.navigation=t.getNavigation(),o.crudPermissions,o.init=function(e,n){o.agent=e,o.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1}},o.onChange=function(n,t){if((t||n).enabled){if(t)t.enabled=!0,o.agent.permissions.push(t.id);else for(var e=0;e<n.children.length;e++)n.children[e].enabled=!0,o.agent.permissions.push(n.children[e].id);n.enabled=!0,o.agent.permissions.push(n.id)}else if(t)t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e}),_.filter(n.children,{enabled:!1}).length===n.children.length&&(n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e}));else{n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e});for(var a=0;a<n.children.length;a++)n.children[a].enabled=!1,_.remove(o.agent.permissions,function(e){return n.children[a].id===e})}return i.user.update({id:o.agent.id,permissions:_.uniq(o.agent.permissions)}).$promise.then(function(){s.success({title:"agent updated!",msg:o.agent.name?o.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["$document","$mdDialog","api","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d[c.apiName].get({fields:"id,name,strategy,type",channel:c.channel,type:"voice"===c.channel?c.direction:void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.user.getQueues({id:c.agent.id,fields:"id,name,strategy,type,penalty",nolimit:!0,type:"voice"===c.channel?c.direction:void 0,channel:c.channel}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return"voice"===c.channel&&(n.penalty=void 0!==n&&void 0!==e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"penalty 0"),n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.agent=n,c.crudPermissions=r,c.penalty=0,c.channel=t,c.direction=i,c.apiName=c.channel+"Queue",c.title=s.instant("STAFF.ADD_AGENT_TO_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"type",line3:"voice"===c.channel?"penalty":"",labelAll:s.instant("STAFF.ALL_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),labelSelected:s.instant("STAFF.SELECTED_"+("outbound"===c.direction?"QUEUE_CAMPAIGNS":c.channel.toUpperCase()+"_QUEUES")),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}},c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){var e;switch(c.channel){case"voice":switch(c.direction){case"inbound":e="VoiceQueues";break;case"outbound":e="QueueCampaigns"}break;case"chat":e="ChatQueues";break;case"mail":e="MailQueues";break;case"sms":e="SmsQueues";break;case"openchannel":e="OpenchannelQueues";break;case"fax":e="FaxQueues"}d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:e}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveQueues=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.user.removeQueues({id:c.agent.id,ids:_.map(t,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else if("voice"===c.channel){for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.user.addQueues({id:c.agent.id,ids:_.map(o,"id"),channel:c.channel,penalty:_.trim(s,"penalty ")}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}else d.user.addQueues({id:c.agent.id,ids:_.map(r,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){n(e)})});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Queues association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:QUEUES_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","channel","direction","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentQueueAddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.user.getTeams({id:l.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.agent=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("STAFF.ALL_TEAMS"),labelSelected:t.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.user.removeTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.user.addTeams({id:l.agent.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,n,i,s,t,a,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=t,m.setting=a,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.agent=d||e.params.agent||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.queueaddchannel=function(e,n,t,a){i.show({controller:"AgentQueueAddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],channel:n,direction:a||"inbound",crudPermissions:m.crudPermissions}})},m.teamadddialog=function(e,n){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,setting:a,agents:m.agents?m.agents.rows:[],crudPermissions:m.crudPermissions}})},m.onEnableScreenRecordingByAgentSelection=function(){["phoneBarEnableAutomaticScreenRecording"].forEach(function(e){m.agent.phoneBarEnableScreenRecordingByAgent&&(m.agent[e]=!m.agent.phoneBarEnableScreenRecordingByAgent)})},m.onEnableAutomaticScreenRecordingSelection=function(){["phoneBarEnableScreenRecordingByAgent"].forEach(function(e){m.agent.phoneBarEnableAutomaticScreenRecording&&(m.agent[e]=!m.agent.phoneBarEnableAutomaticScreenRecording)})},m.alert=r.info,m.gotoAgents=function(){e.go("app.staff.agents",{},{reload:"app.staff.agents"})},m.saveAgent=function(){m.agent=_.omit(m.agent,"userpic"),o.user.update({id:m.agent.id},m.agent).$promise.then(function(){r.success({title:"Agent updated!",msg:m.agent.name?m.agent.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshAgent=function(){return o.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.agent=e})},l.hasRole("admin")?o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.contexts,{id:e.resourceId})}),t=null;if(m.agent&&(t=_.find(m.contexts,{name:m.agent.context})),t&&!_.some(n,["id",t.id])){var a=_.find(m.contexts,{id:t.id});a.canSelect=!1,n.push(a)}m.contexts=n}):o.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){m.contexts=e.rows||[]})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","agent","userProfileSection"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TEAM",g.team=angular.copy(l),g.teams=r,g.newTeam=!1,g.team||(g.team={},g.title="STAFF.NEW_TEAM",g.newTeam=!0),g.addNewTeam=function(){g.errors=[],d.team.save(g.team).$promise.then(function(e){g.teams.unshift(e.toJSON()),o.success({title:"Team properly created",msg:g.team.name?g.team.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTeam=function(){g.errors=[],d.team.update({id:g.team.id},g.team).$promise.then(function(e){var n=_.find(g.teams,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Team properly saved!",msg:g.team.name?g.team.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTeam=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.team.delete({id:g.team.id}).$promise.then(function(){_.remove(g.teams,{id:g.team.id}),o.success({title:"Team properly deleted!",msg:(g.team.name||"team")+" has been deleted!"}),v(g.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","teams","team","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.team.getAgents({id:c.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.team=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.team.removeAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.team.addAgents({id:c.team.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("STAFF.ALL_AGENTS"),labelSelected:r.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","team","teams","realtime","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.teams=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="teams",f.listOrder="",f.listOrderAsc=null,f.selectedTeams=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{team:e,teams:f.teams?f.teams.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("team")+"?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTeams=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.team.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Teams",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTeam=function(e,n){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:n,teams:f.teams.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTeam=y,f.exportSelectedTeams=function(){var e=angular.copy(f.selectedTeams);return f.selectedTeams=[],e},f.deleteSelectedTeams=function(e){var n=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+f.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTeams.forEach(function(e){y(e)}),f.selectedTeams=[]})},f.deselectTeams=function(){f.selectedTeams=[]},f.selectAllTeams=function(){f.selectedTeams=f.teams.rows};var b=!0,A=1;function E(e){f.teams=e||{count:0,rows:[]}}function y(e){m.team.delete({id:e.id}).$promise.then(function(){_.remove(f.teams.rows,{id:e.id}),f.teams.count-=1,f.teams.rows.length||f.getTeams(),p.success({title:_.startCase("Team")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","teams","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TELEPHONE",g.telephone=angular.copy(l),g.telephones=r,g.newTelephone=!1,g.telephone||(g.telephone={role:"telephone",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_TELEPHONE",g.newTelephone=!0),g.addNewTelephone=function(){g.errors=[],d.user.save(g.telephone).$promise.then(function(e){g.telephones.unshift(e.toJSON()),o.success({title:"Telephone properly created",msg:g.telephone.name?g.telephone.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTelephone=function(){g.errors=[],d.user.update({id:g.telephone.id},g.telephone).$promise.then(function(e){var n=_.find(g.telephones,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Telephone properly saved!",msg:g.telephone.name?g.telephone.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTelephone=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.user.delete({id:g.telephone.id}).$promise.then(function(){_.remove(g.telephones,{id:g.telephone.id}),o.success({title:"Telephone properly deleted!",msg:(g.telephone.name||"telephone")+" has been deleted!"}),v(g.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","telephones","telephone","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.telephone=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.telephone.id,newPassword:r.password};r.currentUser.id==r.telephone.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"Telephone password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.telephone.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.telephoneForm.password.$setValidity("oldPasswordMatch",!1):t.telephoneForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","telephone","setting","Auth"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.telephone=c||e.params.telephone||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.changepassworddialog=function(e,n){t.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:u.telephones?u.telephones.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTelephones=function(){e.go("app.staff.telephones",{},{reload:"app.staff.telephones"})},u.saveTelephone=function(){r.user.update({id:u.telephone.id},u.telephone).$promise.then(function(){l.success({title:"Telephone updated!",msg:u.telephone.name?u.telephone.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.telephone&&(t=_.find(u.contexts,{name:u.telephone.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","telephone","userProfileSection"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.telephones=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="telephones",f.listOrder="",f.listOrderAsc=null,f.selectedTelephones=[],f.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.staff.telephones.edit",{id:e.id,telephone:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("telephone")+"?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTelephones=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.user.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Telephones",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTelephone=function(e,n){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:n,telephones:f.telephones.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTelephone=y,f.exportSelectedTelephones=function(){var e=angular.copy(f.selectedTelephones);return f.selectedTelephones=[],e},f.deleteSelectedTelephones=function(e){var n=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+f.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTelephones.forEach(function(e){y(e)}),f.selectedTelephones=[]})},f.deselectTelephones=function(){f.selectedTelephones=[]},f.selectAllTelephones=function(){f.selectedTelephones=f.telephones.rows};var b=!0,A=1;function E(e){f.telephones=e||{count:0,rows:[]}}function y(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(f.telephones.rows,{id:e.id}),f.telephones.count-=1,f.telephones.rows.length||f.getTelephones(),p.success({title:_.startCase("Telephone")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","telephones","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USERPROFILE",g.userProfile=angular.copy(l),g.userProfiles=r,g.newUserProfile=!1,g.userProfile||(g.userProfile={crudPermissions:["r"],downloadAttachments:!0,downloadCallySquareRecordings:!0,downloadContactManagerLists:!0,downloadJscriptySessions:!0,downloadOmnichannelInteractions:!0,downloadScreenRecordings:!0,downloadVoiceRecordings:!0},g.title="STAFF.NEW_USERPROFILE",g.newUserProfile=!0),g.addNewUserProfile=function(){g.errors=[],d.userProfile.save(g.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(s.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),g.userProfiles.unshift(e.toJSON()),o.success({title:"UserProfile properly created",msg:g.userProfile.name?g.userProfile.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUserProfile=function(){g.errors=[],d.userProfile.update({id:g.userProfile.id},g.userProfile).$promise.then(function(e){var n=_.find(g.userProfiles,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"UserProfile properly saved!",msg:g.userProfile.name?g.userProfile.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUserProfile=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The userProfile will be deleted.").ariaLabel("Delete UserProfile").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.userProfile.delete({id:g.userProfile.id}).$promise.then(function(){_.remove(g.userProfiles,{id:g.userProfile.id}),o.success({title:"UserProfile properly deleted!",msg:(g.userProfile.name||"userProfile")+" has been deleted!"}),v(g.userProfile)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","userProfiles","userProfile","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserProfileDialogController",e)}(),function(){"use strict";function e(n,a,i,e,t,s,o){var r=this;function l(e){n.hide(e)}r.newUserProfile=!0,r.userProfile=angular.copy(t),r.userProfiles=s,r.title=o.instant("STAFF.CLONE_USERPROFILE"),t&&t.name&&(r.title+=": "+t.name),r.cloneUserProfile=function(){return e.userProfile.clone({id:t.id},r.userProfile).$promise.then(function(e){var n,t;t=[],(n=e).crudPermissions.forEach(function(e){var n;switch(e){case"r":n="READ_PERMISSION";break;case"e":n="EDIT_PERMISSION";break;case"d":n="DELETE_PERMISSION"}t.push(o.instant("STAFF."+n))}),n.selectedcrudPermissions=t.join(", "),r.userProfiles.unshift(e.toJSON()),i.success({title:"UserProfile properly cloned",msg:r.userProfile.name?r.userProfile.name+" has been cloned!":""}),a.go("app.staff.userProfiles.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.clone"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","userProfile","userProfiles","$translate"],angular.module("app.staff").controller("UserProfilecloneController",e)}(),function(){"use strict";function e(t,o,r,l,d,e,n,c){var m=this;function u(e,n){switch(e.allResourcesEnabled="full"===n,n){case"full":return _.find(m.statusList,["tag","full"]);case"partial":return _.find(m.statusList,["tag","partial"]);case"disabled":return _.find(m.statusList,["tag","disabled"]);case"unlicensed":return _.find(m.statusList,["tag","unlicensed"]);case"unknown":default:return _.find(m.statusList,["tag","unknown"])}}function p(e){return l(function(n,t){var o,a;void 0!==e.channel&&_.includes(e.route,"Queue")?(a=e,l(function(n,t){var e=void 0!==a.channel&&"bull"===a.channel?"outbound":"inbound";return d[a.route].get({fields:"id,name,strategy,type",channel:"bull"===a.channel?"voice":a.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})).then(function(e){n(e)}).catch(function(e){t(e)}):(o=e,l(function(a,n){switch(o.route){case"voiceExtension":var e;switch(o.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}break;case"interval":var t=!0;break;case"disposition":var i=!0;break;case"user":var s;switch(o.title){case"Agents":s="agent";break;case"Telephones":s="telephone";break;case"Users":s="user"}}if("Reports"===o.title){if(!o.reportType)return d.analyticDefaultReport.get({nolimit:!0}).$promise.then(function(t){d.analyticCustomReport.get({nolimit:!0}).$promise.then(function(e){var n=_.union(t.rows,e.rows);a({count:n.length,rows:n.rows})})}).catch(function(e){n(e)});switch(o.reportType){case"default":o.route="analyticDefaultReport";break;case"custom":o.route="analyticCustomReport"}}return d[o.route].get({role:s||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:t?"null":void 0,MailAccountId:i?"null":void 0,FaxAccountId:i?"null":void 0,SmsAccountId:i?"null":void 0,OpenchannelAccountId:i?"null":void 0,ChatWebsiteId:i?"null":void 0,WhatsappAccountId:i?"null":void 0,ListId:i?"null":void 0,nolimit:!0}).$promise.then(function(e){a(e)}).catch(function(e){n(e)})})).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(e,n,t){var a=e&&0<e.length?e[0]:null;if(!a)return t;var i,s,o=_.find(n,["sectionId",a.id]);return o?(n=_.remove(n,["sectionId",a.id]),(i=a,s=o.id,l(function(n,t){d.userProfileResource.get({sectionId:s}).$promise.then(function(n){return p(i).then(function(e){return _.differenceBy(n.rows,e.rows,"id")})}).then(function(e){_.isEmpty(e)?n():t()}).catch(function(e){t(e)})})).then(function(){return t="full",g(e.shift(),n,t)}).catch(function(e){return l.reject(e)})):void 0}function a(a){var t="Marketplace"===a.title?"AppZone":a.title;m.license?void 0===a.permissions||a.permissions.association?void 0===a.license||m.license[a.license]?d.userProfileSection.get({userProfileId:m.userProfile.id,category:t}).$promise.then(function(e){var n=e&&e.rows&&0<e.rows.length?e.rows:[];if("Dashboards"===a.title)return _.isEmpty(n)?"disabled":n[0].autoAssociation?"full":d.userProfileResource.get({sectionId:n[0].id,resourceId:101}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)?"full":"partial"});var t=_.filter(a.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e});return n.length!==t.length?0===n.length?"disabled":"partial":_.every(n,["autoAssociation",!0])?"full":g(_.filter(t,function(e){return void 0===e.permissions||e.permissions.association?e:void 0}),n,"partial")}).then(function(e){a.status=u(a,e)}).catch(function(e){var n=e?"unknown":"partial";a.status=u(a,n),e&&c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GETRESOURCES("+t.toUpperCase()+")",msg:e.status?JSON.stringify(e.data):e.toString()})}):a.status=u(a,"unlicensed"):d.userProfileSection.get({userProfileId:m.userProfile.id,sectionId:a.id}).$promise.then(function(e){var n=(e&&1===e.rows.length?e.rows[0]:null)?"full":"disabled";a.status=u(a,n)}):a.status=u(a,"unknown")}m.userProfile={},m.license={},m.navigation=e.getNavigation(),m.modules=m.navigation[0].children,m.statusList=[{id:0,name:"Fully Enabled",color:"green-A700-bg",info:"All resources enabled",tag:"full"},{id:1,name:"Partially Enabled",color:"orange-A700-bg",info:"Some resources enabled",tag:"partial"},{id:2,name:"Disabled",color:"grey-A400-bg",info:"No resources enabled",tag:"disabled"},{id:3,name:"Unlicensed",color:"red-A700-bg",info:"Module not included in the license",tag:"unlicensed"},{id:4,name:"Unknown",color:"grey-A700-bg",info:"Unknown status",tag:"unknown"}],m.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],m.init=function(e,n){m.userProfile=e,m.license=n},m.onChangeEnableAllResources=function(n){var e=void 0!==n.permissions&&!n.permissions.association,a="Marketplace"===n.title?"AppZone":n.title;if("Fully Enabled"!==n.status.name){var i=[];if(e)return i.push({category:a,sectionId:n.id,name:a,enabled:!0,crudPermissions:"red"}),d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})});var t=o.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_ENABLE_ALL",{sectionName:r.instant(n.translate)})).ariaLabel("Warning").ok(r.instant("STAFF.CONFIRM")).cancel(r.instant("STAFF.CANCEL"));o.show(t).then(function(){switch(a){case"Dashboards":_.map(m.dashboardSections,function(e){i.push({category:a,sectionId:e.id,name:e.title,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})});break;default:_.map(n.children,function(e){var n=!(void 0===e.permissions||!e.permissions.hidden);if(!n){var t=e.title;switch(a){case"CallySquare":t="Projects"===t?"SquareProjects":t}i.push({category:a,sectionId:e.id,name:t,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})}})}return d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){n.status=u(n,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})})}).catch(function(e){e?c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()}):n.status=u(n,n.status.tag)})}else if("Fully Enabled"===n.status.name){n.status=u(n,"disabled");var s=[];switch(a){case"Settings":case"Help":s=[n.id];break;case"Dashboards":s=_.map(m.dashboardSections,function(e){return e.id});break;default:s=_.map(n.children,function(e){return e.id})}return d.userProfile.removeSections({id:m.userProfile.id,ids:s}).$promise.then(function(){c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(n.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.REMOVESECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},m.manageResources=function(e,n){o.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!1,locals:{userProfile:m.userProfile,userProfiles:[],section:e}}).then(function(){a(e)})},m.checkSectionResources=a}e.$inject=["$document","$mdDialog","$translate","$q","api","msNavigationService","Auth","toasty"],angular.module("app.staff").controller("UserProfilePermissionsController",e)}(),function(){"use strict";function e(n,t,i,o,r,e,a,l,s,d){var c=this;function m(){var a=void 0!==c.selectedSection.pending&&c.selectedSection.pending;return i(function(t,n){r.userProfileSection.get({userProfileId:c.userProfile.id,sectionId:c.selectedSection.id}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;a||(c.selectedSection.enabled=!!n&&!!n.enabled,c.selectedSection.autoAssociation=!!n&&!!n.autoAssociation,c.selectedSection.crudPermissions=v(n?n.crudPermissions:c.userProfile.crudPermissions)),t(n)}).catch(function(e){n(e)})})}function u(){return i(function(n,t){c.loadedSection?r.userProfileResource.get({sectionId:c.loadedSection.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)}):n(null)})}function p(){return i(function(n,t){void 0!==c.selectedSection.channel&&_.includes(c.selectedSection.route,"Queue")?i(function(n,t){var e=void 0!==c.selectedSection.channel&&"bull"===c.selectedSection.channel?"outbound":"inbound";return r[c.selectedSection.route].get({fields:"id,name,strategy,type",channel:"bull"===c.selectedSection.channel?"voice":c.selectedSection.channel,type:e,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){n(e)}).catch(function(e){t(e)}):i(function(n,t){var e,a;if("voiceExtension"===c.selectedSection.route)switch(c.selectedSection.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}if("user"===c.selectedSection.route)switch(c.selectedSection.title){case"Agents":a="agent";break;case"Telephones":a="telephone";break;case"Users":a="user"}if("interval"===c.selectedSection.route)var i=!0;if("disposition"===c.selectedSection.route)var s=!0;if("Reports"===c.selectedSection.title&&(c.selectedSection.route="default"===c.selectedSection.reportType?"analyticDefaultReport":"analyticCustomReport"),"Dashboards"!==c.selectedSection.title)return r[c.selectedSection.route].get({role:a||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:i?"null":void 0,MailAccountId:s?"null":void 0,FaxAccountId:s?"null":void 0,SmsAccountId:s?"null":void 0,OpenchannelAccountId:s?"null":void 0,ChatWebsiteId:s?"null":void 0,WhatsappAccountId:s?"null":void 0,ListId:s?"null":void 0,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)});n({count:1,rows:[{id:101,name:l.instant("DASHBOARDS.GENERAL")}]})}).then(function(e){n(e)}).catch(function(e){t(e)})})}function g(){var i=void 0!==c.selectedSection.pending&&c.selectedSection.pending,s=[];return u().then(function(e){var n;return s=e&&e.rows?e.rows:[],"Reports"===c.selectedSection.title&&(c.associatedReports=c.associatedReports?c.associatedReports:s,n=c.associatedReports,s=_.filter(n,{type:"default"===c.selectedSection.reportType?"DefaultReports":"CustomReports"})),void 0===c.selectedSection.permissions||c.selectedSection.permissions.association?p():{rows:[]}}).then(function(e){c.items=e.rows?_.map(e.rows,function(e){var n,t;return"Reports"===c.selectedSection.title&&(e.fullPath=(n=e.parent,t=c.treeStructure[0].text,t=function e(n,t,a){if(!a||_.isEmpty(a.children))return n;var a=_.find(a.children,function(e){return _.includes(t,e.id)?e:void 0});return n+=a?"/"+a.text:"",e(n,t,a)}(t,n,c.treeStructure[0])).replace(" ","_")),e.isValid=!0,e}):[],i||(c.selectedSection.selectedItems=_.map(s,function(e){return _.find(c.items,{id:e.resourceId})}));var n,t=_.differenceBy(c.selectedSection.selectedItems,c.items,"id");switch(_.isEmpty(t)||(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,t,"id")),c.selectedSection.title){case"Contexts":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"MusicOnHolds":c.selectedSection.selectedItems=_.filter(c.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(s,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"Reports":var a=(n=c.allReportsSelected,_.filter(n,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")}));c.selectedSection.selectedItems=b(c.selectedSection.selectedItems),c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,a,"id")}c.dualMultiselectOptions.selectedItems=c.selectedSection.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.items,c.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})}function v(e){return e&&(c.selectedSection.allowEdit=!!_.includes(e,"e"),c.selectedSection.allowDelete=!!_.includes(e,"d")),function(){var e=["r"];if(c.selectedSection.allowEdit)e.push("e");else{var n=_.indexOf(e,["e"]);0<n&&c.selectedSection.crudPermissions.replace("e","")}if(c.selectedSection.allowDelete)e.push("d");else{var n=_.indexOf(e,["d"]);0<n&&c.selectedSection.crudPermissions.replace("d","")}return e}()}function h(e){var n=_.findIndex(c.subsections,function(e){return e.id==c.selectedSection.id});c.subsections[n].pending=e,f()}function f(){return c.pendingChanges=_.some(c.subsections,["pending",!0])}function b(e){return _.remove(e,function(e){return _.startsWith(e.parent,"default"===c.selectedSection.reportType?"motion":"custom")})}function A(){_.isEmpty(c.selectedSection.selectedItems)?c.allReportsSelected=_.remove(c.allReportsSelected,function(e){return e.type===("default"===c.selectedSection.reportType?"CustomReports":"DefaultReports")}):c.selectedSection.selectedItems.forEach(function(e){_.some(c.allReportsSelected,{id:e.id,parent:e.parent})||c.allReportsSelected.push(e)})}c.userProfile=e,c.penalty=0,c.section=angular.copy(d),c.title=l.instant("STAFF.PERMISSIONS_SECTION_TITLE",{sectionName:l.instant(c.section.translate)}),c.items=[],c.selectedItems=[],c.subsections=_.filter(c.section.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e}),c.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],c.dashboardItems=[],"Dashboards"===c.section.title&&(c.dashboardItems=c.subsections,c.subsections=c.dashboardSections),c.selectedSection=null,c.loadedSection=null,c.allReportsSelected=[],c.closeDialog=function(e){if(c.pendingChanges){var n=t.confirm({skipHide:!0}).title("Warning").textContent(l.instant("STAFF.PERMISSIONS_WARNING_CLOSE")).ariaLabel("Warning").targetEvent(e).ok(l.instant("STAFF.CLOSE")).cancel(l.instant("STAFF.CANCEL"));t.show(n).then(function(){t.hide()})}else t.hide()},c.onChangeSection=function(){return m().then(function(e){if(c.loadedSection=e,"Reports"===c.selectedSection.title)return i(function(n,t){r.analyticTreeReport.get({}).$promise.then(function(e){c.treeReports=e.rows||[],n(c.treeReports)}).catch(function(e){t(e)})}).then(function(){if(!c.selectedSection.reportType)return u().then(function(e){c.allReportsSelected=e?_.map(e.rows,function(e){return{id:e.resourceId,name:e.name,type:e.type}}):[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREE_REPORT_STRUCTURE",msg:e.data?JSON.stringify(e.data):e.toString()})});g()}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+c.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})},c.onChangeVisibility=function(){c.selectedSection.enabled=!c.selectedSection.enabled,h(!0)},c.onChangeAutoAssociation=function(){if(!c.selectedSection.autoAssociation){for(var e=[],n=0;n<c.dualMultiselectOptions.items.length;n++)e.push(c.dualMultiselectOptions.items[n]),c.dualMultiselectOptions.selectedItems.push(c.dualMultiselectOptions.items[n]);c.dualMultiselectOptions.items=[],c.dualMultiselectOptions.transferCallback(e,!1)}h(!0)},c.onChangeReportType=function(){c.treeStructure="default"===c.selectedSection.reportType?c.treeReports[0]?angular.fromJson(c.treeReports[0].tree):[]:c.treeReports[1]?angular.fromJson(c.treeReports[1].tree):[],c.selectedSection.selectedItems&&(c.allReportsSelected=b(c.allReportsSelected),A());g()},c.setPermission=function(e){"edit"===e?c.selectedSection.allowEdit=!c.selectedSection.allowEdit:"delete"===e&&(c.selectedSection.allowDelete=!c.selectedSection.allowDelete);c.selectedSection.crudPermissions=v(),h(!0)},c.saveSection=function(){var a="Marketplace"===c.section.title?"AppZone":c.section.title,e=_(c.subsections).filter({pending:!0}).map(function(e){var n="CallySquare"===a&&"Projects"===e.title?"SquareProjects":e.title,t="Reports"===n?c.allReportsSelected:e.selectedItems;return"Integrations"===a&&(e.autoAssociation=!0),{category:a,sectionId:e.id,name:n,enabled:e.enabled,autoAssociation:e.autoAssociation,crudPermissions:_.map(e.crudPermissions).join(""),Resources:_.map(t,function(e){return{name:e.name,resourceId:e.id,type:function(e,n){if("Reports"!==e)return e;{if(n.parent){var t=_.startsWith(n.parent,"motion")?"Default":"Custom";return t+e}return n.type}}(n,e)}})}}).value();return r.userProfile.addSections({id:c.userProfile.id},e).$promise.then(function(){c.subsections.forEach(function(e){e.pending=void 0}),c.associatedReports=null,f(),"Reports"!==c.selectedSection.title||c.selectedSection.reportType||n.userProfileForm.$setPristine(),o.success({title:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_TITLE",{sectionName:l.instant(a.translate)}),msg:l.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_MESSAGE")})}).then(function(){return m().then(function(e){c.loadedSection=e})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",line4:"fullPath",labelAll:l.instant("STAFF.PERMISSIONS_ALL_RESOURCES"),labelSelected:l.instant("STAFF.PERMISSIONS_SELECTED_RESOURCES"),transferCallback:function(e,n){h(!0),n?(c.selectedSection.selectedItems=_.pullAllBy(c.selectedSection.selectedItems,e,"id"),c.selectedSection.autoAssociation=!1):c.selectedSection.selectedItems=_.unionBy(c.selectedSection.selectedItems,e,"id"),"Reports"===c.selectedSection.title&&A()}}}e.$inject=["$scope","$mdDialog","$q","toasty","api","userProfile","userProfiles","$translate","Auth","section"],angular.module("app.staff").controller("UserProfilepermissionsmanageController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.userProfile=c||e.params.userProfile||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.permissionsmanagedialog=function(e,n){t.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.clonedialog=function(e,n){t.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUserProfiles=function(){e.go("app.staff.userProfiles",{},{reload:"app.staff.userProfiles"})},u.saveUserProfile=function(){r.userProfile.update({id:u.userProfile.id},u.userProfile).$promise.then(function(){l.success({title:"UserProfile updated!",msg:u.userProfile.name?u.userProfile.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuserProfile",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","userProfile","userProfileSection"],angular.module("app.staff").controller("UserProfileController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.userProfiles=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="userProfiles",f.listOrder="",f.listOrderAsc=null,f.selectedUserProfiles=[],f.query={fields:"createdAt,updatedAt,id,name,description,crudPermissions,privacyEnabled,downloadAttachments,downloadCallySquareRecordings,downloadContactManagerLists,downloadJscriptySessions,downloadOmnichannelInteractions,downloadScreenRecordings,downloadVoiceRecordings",sort:"-updatedAt",limit:10,page:1},f.arraycrudPermissions=_.keyBy([{option:"Read_permission",value:"'r'",disabled:!0},{option:"Edit_permission",value:"'e'"},{option:"Delete_permission",value:"'d'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.userProfiles&&0<f.userProfiles.count&&f.userProfiles.rows.forEach(function(e){var n=[];e.crudPermissions.forEach(function(e){n.push(f.arraycrudPermissions[e].option)});var t=[];n.forEach(function(e){t.push(r.instant("STAFF."+e.toUpperCase()))}),e.selectedcrudPermissions=t.join(", ")}),f.editstate=function(e,n){t.go("app.staff.userProfiles.edit",{id:e.id,userProfile:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:f.userProfiles?f.userProfiles.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("userProfile")+"?").htmlContent("<b>"+(e.name||"userProfile")+"</b> will be deleted.").ariaLabel("delete userProfile").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getUserProfiles=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.userProfile.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="UserProfiles",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditUserProfile=function(e,n){i.show({controller:"CreateOrEditUserProfileDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{userProfile:n,userProfiles:f.userProfiles.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteUserProfile=y,f.exportSelectedUserProfiles=function(){var e=angular.copy(f.selectedUserProfiles);return f.selectedUserProfiles=[],e},f.deleteSelectedUserProfiles=function(e){var n=i.confirm().title("Are you sure want to delete the selected userProfiles?").htmlContent("<b>"+f.selectedUserProfiles.length+" selected</b> will be deleted.").ariaLabel("delete UserProfiles").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedUserProfiles.forEach(function(e){y(e)}),f.selectedUserProfiles=[]})},f.deselectUserProfiles=function(){f.selectedUserProfiles=[]},f.selectAllUserProfiles=function(){f.selectedUserProfiles=f.userProfiles.rows};var b=!0,A=1;function E(e){f.userProfiles=e||{count:0,rows:[]}}function y(e){m.userProfile.delete({id:e.id}).$promise.then(function(){_.remove(f.userProfiles.rows,{id:e.id}),f.userProfiles.count-=1,f.userProfiles.rows.length||f.getUserProfiles(),p.success({title:_.startCase("UserProfile")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuserProfile"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuserProfile",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getUserProfiles())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","userProfiles","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.staff").controller("UserProfilesController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c){var m=this;function u(){return s.user.get({id:m.agent.id,userSetting:!0}).$promise.then(function(e){m.user=e})}function p(e){t.hide(e)}m.currentUser=o.getCurrentUser(),m.errors=[],m.setting=l,m.license=r,m.crudPermissions=d,m.hasModulePermissions={},m.passwordPattern=m.setting&&m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.title="STAFF.EDIT_USER",m.user=angular.copy(i),m.users=n,m.newUser=!1,m.user||(m.user={role:"user",autointernal:!0,context:"from-sip"},m.title="STAFF.NEW_USER",m.newUser=!0),m.addNewUser=function(){m.errors=[],s.user.save(m.user).$promise.then(function(e){m.users.unshift(e.toJSON()),a.success({title:"User properly created",msg:m.user.name?m.user.name+" has been created!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveUser=function(){m.errors=[],s.user.update({id:m.user.id},m.user).$promise.then(function(e){var n=_.find(m.users,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"User properly saved!",msg:m.user.name?m.user.name+" has been saved!":""}),p(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteUser=function(e){if(o.getCurrentUser().id===m.user.id)return a.error({title:"User not deleted!",msg:"You can't remove yourself"});m.errors=[];var n=t.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){s.user.delete({id:m.user.id}).$promise.then(function(){_.remove(m.users,{id:m.user.id}),a.success({title:"User properly deleted!",msg:(m.user.name||"user")+" has been deleted!"}),p(m.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.closeDialog=p,s.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var g="user-setting:update:user-"+m.user.id;c.on(g,u),e.$on("$destroy",function(){c.removeListener(g,u)})}e.$inject=["$scope","$mdDialog","toasty","users","user","api","Auth","license","setting","crudPermissions","socket"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i){var s=this;function o(){e.hide()}s.currentUser=i.getCurrentUser(),s.errors=[],s.user=a,s.generateApiKey=function(){s.errors=[],t.user.createApiKey({id:s.user.id}).$promise.then(function(e){s.user.apiKey=e.api_key||"N/A",n.success({title:"User API key updated!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.createApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.createApiKey"}]})},s.removeApiKey=function(){s.errors=[],t.user.removeApiKey({id:s.user.id}).$promise.then(function(){s.user.apiKey="N/A",n.success({title:"User API key removed!"}),o()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.removeApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.removeApiKey"}]})},s.closeDialog=o}e.$inject=["$mdDialog","toasty","api","user","Auth"],angular.module("app.staff").controller("UserapikeymanagerController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var n=["png","jpg"];if(!_.includes(n,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var t={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(t),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result},n.type="image"}})},i.init=function(e,n){i.user=angular.copy(e),i.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.currentUser=o.getCurrentUser(),r.errors=[],r.setting=s,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.user=i,r.password="",r.oldPassword="",r.savePassword=function(){r.errors=[];var e={id:r.user.id,newPassword:r.password};r.currentUser.id==r.user.id&&(e.oldPassword=r.oldPassword);a.user.changePassword(e).$promise.then(function(){n.success({title:"User password properly updated!"}),l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),r.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.userForm.password.$setValidity("oldPasswordMatch",!1):t.userForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","toasty","api","user","setting","Auth"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;m.currentUser=l.getCurrentUser(),m.license=i,m.setting=s,m.passwordPattern=m.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",m.location=n.protocol()+"://"+n.host(),m.user=d||e.params.user||{},m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=l.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.hasModulePermissions={},m.selectedTab=e.params.tab||0,m.apikeymanagerdialog=function(e,n){t.show({controller:"UserapikeymanagerController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.changepassworddialog=function(e,n){t.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{user:e,setting:s,users:m.users?m.users.rows:[],crudPermissions:m.crudPermissions}})},m.alert=r.info,m.gotoUsers=function(){e.go("app.staff.users",{},{reload:"app.staff.users"})},m.saveUser=function(){m.user=_.omit(m.user,"userpic"),o.user.update({id:m.user.id},m.user).$promise.then(function(){r.success({title:"User updated!",msg:m.user.name?m.user.name+" has been updated!":""})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.refreshUser=function(){return o.user.get({id:m.user.id,userSetting:!0}).$promise.then(function(e){m.user=e})},o.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.contexts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){m.userProfiles=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.user.getApiKey({id:m.user.id}).$promise.then(function(e){m.user.apiKey=e.api_key?e.api_key:"N/A"}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_APIKEY",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","license","setting","api","toasty","Auth","user","userProfileSection"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r,l,d,c,m,u,p){var g=this;g.license=m,g.setting=u,g.currentUser=c.getCurrentUser(),g.users=n||{count:0,rows:[]},g.userProfile=o,g.userProfileSection=r&&1==r.count?r.rows[0]:null,g.crudPermissions=c.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.table="users",g.listOrder="",g.listOrderAsc=null,g.selectedUsers=[],g.query={fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport,disabled,blocked,adSsoEnabled",role:"admin,user",userSetting:!0,sort:"-updatedAt",limit:10,page:1},g.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),g.editstate=function(e,n){t.go("app.staff.users.edit",{id:e.id,user:e,crudPermissions:g.crudPermissions})},g.deleteconfirm=function(e,n){var t=a.confirm().title("Are you sure want to delete the "+_.startCase("user")+"?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(n).ok("OK").cancel("CANCEL");a.show(t).then(function(){A(e)},function(){console.log("CANCEL")})},g.success=f,g.getUsers=b,g.createOrEditUser=function(e,n){a.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:n,users:g.users.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}})},g.deleteUser=A,g.exportSelectedUsers=function(){var e=angular.copy(g.selectedUsers);return g.selectedUsers=[],e},g.deleteSelectedUsers=function(e){var n=a.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+g.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){g.selectedUsers.forEach(function(e){A(e)}),g.selectedUsers=[]})},g.deselectUsers=function(){g.selectedUsers=[]},g.selectAllUsers=function(){g.selectedUsers=g.users.rows},l.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.userProfiles=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=!0,h=1;function f(e){g.users=e||{count:0,rows:[]}}function b(){g.query.offset=(g.query.page-1)*g.query.limit,c.hasRole("admin")?g.promise=l.user.get(g.query,f).$promise:(g.query.id=g.userProfile.id,g.query.section="Users",g.promise=l.userProfile.getResources(g.query,f).$promise)}function A(e){l.user.delete({id:e.id}).$promise.then(function(){_.remove(g.users.rows,{id:e.id}),g.users.count-=1,g.users.rows.length||g.getUsers(),d.success({title:_.startCase("User")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){v?s(function(){v=!1}):(n||(h=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=h),g.getUsers())}),p.on("user-setting:update",b),e.$on("$destroy",function(){p.removeListener("user-setting:update",b)})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","users","userProfile","userProfileSection","api","toasty","Auth","license","setting","socket"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.cannedAnswers=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="cannedAnswers",f.listOrder="",f.listOrderAsc=null,f.selectedCannedAnswers=[],f.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("cannedAnswer")+"?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCannedAnswers=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.cannedAnswer.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CannedAnswers",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCannedAnswer=function(e,n){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:n,cannedAnswers:f.cannedAnswers.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCannedAnswer=y,f.exportSelectedCannedAnswers=function(){var e=angular.copy(f.selectedCannedAnswers);return f.selectedCannedAnswers=[],e},f.deleteSelectedCannedAnswers=function(e){var n=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+f.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCannedAnswers.forEach(function(e){y(e)}),f.selectedCannedAnswers=[]})},f.deselectCannedAnswers=function(){f.selectedCannedAnswers=[]},f.selectAllCannedAnswers=function(){f.selectedCannedAnswers=f.cannedAnswers.rows};var b=!0,A=1;function E(e){f.cannedAnswers=e||{count:0,rows:[]}}function y(e){m.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(f.cannedAnswers.rows,{id:e.id}),f.cannedAnswers.count-=1,f.cannedAnswers.rows.length||f.getCannedAnswers(),p.success({title:_.startCase("CannedAnswer")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","cannedAnswers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CANNEDANSWER",g.cannedAnswer=angular.copy(l),g.cannedAnswers=r,g.newCannedAnswer=!1,g.cannedAnswer||(g.cannedAnswer={},g.title="TOOLS.NEW_CANNEDANSWER",g.newCannedAnswer=!0),g.addNewCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.cannedAnswer).$promise.then(function(e){g.cannedAnswers.unshift(e.toJSON()),o.success({title:"CannedAnswer properly created",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.cannedAnswer.id},g.cannedAnswer).$promise.then(function(e){var n=_.find(g.cannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CannedAnswer properly saved!",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.cannedAnswer.id}).$promise.then(function(){_.remove(g.cannedAnswers,{id:g.cannedAnswer.id}),o.success({title:"CannedAnswer properly deleted!",msg:(g.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),v(g.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contact_item_types=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="contact_item_types",f.listOrder="",f.listOrderAsc=null,f.selectedContactItemType=[],f.query={fields:"createdAt,updatedAt,id,name,OrderBy,rgbBackgroundColor",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContactItemTypeDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/contact_item_types/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{contactItemType:e,contact_item_types:f.contact_item_types.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("contactItemType")+"?").htmlContent("<b>"+(e.name||"contactItemType")+"</b> will be deleted.").ariaLabel("delete contactItemType").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContactItemType=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.contactItemType.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ContactItemType",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContactItemType=function(e,n){i.show({controller:"CreateOrEditContactItemTypeDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/contact_item_types/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{contactItemType:n,contact_item_types:f.contact_item_types.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContactItemType=y,f.exportSelectedContactItemType=function(){var e=angular.copy(f.selectedContactItemType);return f.selectedContactItemType=[],e},f.deleteSelectedContactItemType=function(e){var n=i.confirm().title("Are you sure want to delete the selected contact_item_types?").htmlContent("<b>"+f.selectedContactItemType.length+" selected</b> will be deleted.").ariaLabel("delete ContactItemTypes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContactItemType.forEach(function(e){y(e)}),f.selectedContactItemType=[]})},f.deselectContactItemType=function(){f.selectedContactItemType=[]},f.selectAllContactItemType=function(){f.selectedContactItemType=f.contact_item_types.rows};var b=!0,A=1;function E(e){f.contact_item_types=e||{count:0,rows:[]}}function y(e){m.contactItemType.delete({id:e.id}).$promise.then(function(){_.remove(f.contact_item_types.rows,{id:e.id}),f.contact_item_types.count-=1,f.contact_item_types.rows.length||f.getContactItemType(),p.success({title:_.startCase("ContactItemType")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcontactItemType"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcontactItemType",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getContactItemType())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contact_item_types","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("ContactItemTypesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CONTACTITEMTYPE",g.contactItemType=angular.copy(l),g.contact_item_types=r,g.newContactItemType=!1,g.contactItemType||(g.contactItemType={rgbBackgroundColor:"#2196f3"},g.title="TOOLS.NEW_CONTACTITEMTYPE",g.newContactItemType=!0),g.addNewContactItemType=function(){g.errors=[],d.contactItemType.save(g.contactItemType).$promise.then(function(e){g.contact_item_types.unshift(e.toJSON()),o.success({title:"ContactItemType properly created",msg:g.contactItemType.name?g.contactItemType.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contactItemType.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContactItemType=function(){g.errors=[],isNaN(g.contactItemType.OrderBy)?alert(s.instant("TOOLS.ORDER_BY_NUMERIC")):d.contactItemType.update({id:g.contactItemType.id},g.contactItemType).$promise.then(function(e){var n=_.find(g.contact_item_types,{id:e.id});n&&_.merge(n,_.pick(e.toJSON(),_.keys(n))),o.success({title:"ContactItemType properly saved!",msg:g.contactItemType.name?g.contactItemType.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contactItemType.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContactItemType=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The contactItemType will be deleted.").ariaLabel("Delete ContactItemType").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.contactItemType.delete({id:g.contactItemType.id}).$promise.then(function(){_.remove(g.contact_item_types,{id:g.contactItemType.id}),o.success({title:"ContactItemType properly deleted!",msg:(g.contactItemType.name||"contactItemType")+" has been deleted!"}),v(g.contactItemType)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.contactItemType.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contactItemType.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contact_item_types","contactItemType","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactItemTypeDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CUSTOMDASHBOARD",g.customDashboard=angular.copy(l),g.customDashboards=r,g.newCustomDashboard=!1,g.customDashboard||(g.customDashboard={},g.title="TOOLS.NEW_CUSTOMDASHBOARD",g.newCustomDashboard=!0),g.addNewCustomDashboard=function(){g.errors=[],d.dashboard.save(g.customDashboard).$promise.then(function(e){g.customDashboards.unshift(e.toJSON()),o.success({title:"CustomDashboard properly created",msg:g.customDashboard.name?g.customDashboard.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomDashboard=function(){g.errors=[],d.dashboard.update({id:g.customDashboard.id},g.customDashboard).$promise.then(function(e){var n=_.find(g.customDashboards,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"CustomDashboard properly saved!",msg:g.customDashboard.name?g.customDashboard.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomDashboard=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboard.delete({id:g.customDashboard.id}).$promise.then(function(){_.remove(g.customDashboards,{id:g.customDashboard.id}),o.success({title:"CustomDashboard properly deleted!",msg:(g.customDashboard.name||"customDashboard")+" has been deleted!"}),v(g.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customDashboards","customDashboard","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.customDashboards=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="customDashboards",f.listOrder="",f.listOrderAsc=null,f.selectedCustomDashboards=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:f.customDashboards?f.customDashboards.rows:[],crudPermissions:f.crudPermissions}})},f.gotodashboardgoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("customDashboard")+"?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getCustomDashboards=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.dashboard.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="CustomDashboards",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditCustomDashboard=function(e,n){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:n,customDashboards:f.customDashboards.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteCustomDashboard=y,f.exportSelectedCustomDashboards=function(){var e=angular.copy(f.selectedCustomDashboards);return f.selectedCustomDashboards=[],e},f.deleteSelectedCustomDashboards=function(e){var n=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+f.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedCustomDashboards.forEach(function(e){y(e)}),f.selectedCustomDashboards=[]})},f.deselectCustomDashboards=function(){f.selectedCustomDashboards=[]},f.selectAllCustomDashboards=function(){f.selectedCustomDashboards=f.customDashboards.rows};var b=!0,A=1;function E(e){f.customDashboards=e||{count:0,rows:[]}}function y(e){m.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(f.customDashboards.rows,{id:e.id}),f.customDashboards.count-=1,f.customDashboards.rows.length||f.getCustomDashboards(),p.success({title:_.startCase("CustomDashboard")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","customDashboards","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=s,r.title=o.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),t.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(t,a,i,s,o){var r=this;r.customDashboard={};var l=[];function d(e,n,t){return o.dashboardItem.update(t).$promise.catch(function(e){console.error(e)})}r.init=function(e,n){return r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.customDashboard=e,r.customDashboard.draggable={enabled:!0,handle:".draggable",stop:d},r.customDashboard.resizable={enabled:!0,handle:".resizable",stop:d},r.customDashboard.widgets=[],r.customDashboard.crudPermissions=r.crudPermissions,l.push(i(function(e){e(r.voiceQueues=o.rpc.getVoiceQueues({fields:"id,name"}))})),l.push(i(function(n){o.chatWebsite.get({fields:"id,name"}).$promise.then(function(e){r.chatWebsites=e||{count:0,rows:[]},n(r.chatWebsites)})})),l.push(i(function(n){o.faxAccount.get({fields:"id,name"}).$promise.then(function(e){r.faxAccounts=e||{count:0,rows:[]},n(r.faxAccounts)})})),l.push(i(function(n){o.mailAccount.get({fields:"id,name"}).$promise.then(function(e){r.mailAccounts=e||{count:0,rows:[]},n(r.mailAccounts)})})),l.push(i(function(n){o.openchannelAccount.get({fields:"id,name"}).$promise.then(function(e){r.openchannelAccounts=e||{count:0,rows:[]},n(r.openchannelAccounts)})})),l.push(i(function(n){o.whatsappAccount.get({fields:"id,name"}).$promise.then(function(e){r.whatsappAccounts=e||{count:0,rows:[]},n(r.whatsappAccounts)})})),l.push(i(function(n){o.smsAccount.get({fields:"id,name"}).$promise.then(function(e){r.smsAccounts=e||{count:0,rows:[]},n(r.smsAccounts)})})),i.all(l).then(function(){return o.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var n=0;n<e.rows.length;n+=1)e.rows[n].voiceQueues=r.voiceQueues,e.rows[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),e.rows[n].smsAccounts=r.smsAccounts,e.rows[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),e.rows[n].faxAccounts=r.faxAccounts,e.rows[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),e.rows[n].mailAccounts=r.mailAccounts,e.rows[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),e.rows[n].openchannelAccounts=r.openchannelAccounts,e.rows[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),e.rows[n].chatWebsites=r.chatWebsites,e.rows[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),e.rows[n].whatsappAccounts=r.whatsappAccounts,e.rows[n].whatsappAccountsSelected=_.map(r.whatsappAccounts.rows,"id"),e.rows[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[n].type+"/ms-widget-engine."+e.rows[n].type+".html",r.customDashboard.widgets.push(e.rows[n])}).catch(function(e){console.error(e)})})},r.createOrEditWidget=function(e){if(e&&e.attrs)for(var n=0;n<e.attrs.length;n+=1)"attrReport"===e.attrs[n].name&&(e.reportType=e.attrs[n].type),e[e.attrs[n].name]=e.attrs[n].value;t.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:r.customDashboard.widgets,license:null,setting:null,crudPermissions:r.crudPermissions}}).then(function(e){if(e)for(var n=0;n<r.customDashboard.widgets.length;n+=1)r.customDashboard.widgets[n].id===e.id&&(r.customDashboard.widgets[n].attrs=e.attrs,r.customDashboard.widgets[n].voiceQueues=r.voiceQueues,r.customDashboard.widgets[n].voiceQueuesSelected=_.map(r.voiceQueues.rows,"id"),r.customDashboard.widgets[n].smsAccounts=r.smsAccounts,r.customDashboard.widgets[n].smsAccountsSelected=_.map(r.smsAccounts.rows,"id"),r.customDashboard.widgets[n].faxAccounts=r.faxAccounts,r.customDashboard.widgets[n].faxAccountsSelected=_.map(r.faxAccounts.rows,"id"),r.customDashboard.widgets[n].mailAccounts=r.mailAccounts,r.customDashboard.widgets[n].mailAccountsSelected=_.map(r.mailAccounts.rows,"id"),r.customDashboard.widgets[n].openchannelAccounts=r.openchannelAccounts,r.customDashboard.widgets[n].openchannelAccountsSelected=_.map(r.openchannelAccounts.rows,"id"),r.customDashboard.widgets[n].chatWebsites=r.chatWebsites,r.customDashboard.widgets[n].chatWebsitesSelected=_.map(r.chatWebsites.rows,"id"),r.customDashboard.widgets[n].whatsappAccounts=r.whatsappAccounts,r.customDashboard.widgets[n].whatsappAccountsSelected=_.map(r.whatsappAccounts.rows,"id"),r.customDashboard.widgets[n].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+r.customDashboard.widgets[n].type+"/ms-widget-engine."+r.customDashboard.widgets[n].type+".html")})},r.deleteWidget=function(n){var e=t.confirm().title("Would you like to delete "+n.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");t.show(e).then(function(){return o.dashboardItem.delete({id:n.id}).$promise.then(function(e){_.remove(r.customDashboard.widgets,{id:n.id}),s.success({title:"Widget deleted!",msg:n.name?n.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","$q","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(n,e,t,a,o,i,s,r,l,d,c,m,u,p){var g=this;g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DASHBOARDITEM",g.dashboarditem=angular.copy(l),g.dashboard=r,g.newDashboardItem=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.dashboarditem?"web-report"==g.dashboarditem.type&&(g.apiName="custom"===g.dashboarditem.reportType?"analyticCustomReport":"analyticDefaultReport",d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:g.dashboarditem.attrReport}),g.dashboarditem.report=g.currentReport.name,g.query.parent=g.currentReport.parent})):(g.dashboarditem={type:"counter",attrChannel:"voice",titleFontSize:12,attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},g.title="TOOLS.NEW_DASHBOARDITEM",g.newDashboardItem=!0),g.addNewDashboardItem=function(){g.errors=[],d.dashboard.addItem({id:e.params.id},g.dashboarditem).$promise.then(function(e){g.dashboard.unshift(e.toJSON()),s.success({title:"DashboardItem properly created",msg:g.dashboarditem.name?g.dashboarditem.name+" has been created!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var n=0;n<e.data.errors.length;n+=1)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDashboardItem=function(){g.errors=[],d.dashboardItem.update({id:g.dashboarditem.id},g.dashboarditem).$promise.then(function(e){var n=_.find(g.dashboard,{id:e.id});n&&_.merge(n,e.toJSON()),s.success({title:"DashboardItem properly saved!",msg:g.dashboarditem.name?g.dashboarditem.name+" has been saved!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDashboardItem=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.dashboardItem.delete({id:g.dashboarditem.id}).$promise.then(function(){_.remove(g.dashboard,{id:g.dashboarditem.id}),s.success({title:"DashboardItem properly deleted!",msg:(g.dashboarditem.name||"dashboarditem")+" has been deleted!"}),I(g.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=S,g.selectReport=function(){if(g.dashboarditem.report=g.selectedReport[0].name,g.dashboarditem.attrReport=g.selectedReport[0].id,g.dashboarditem.reportType=g.currentNode.custom?"custom":"default",!g.newDashboardItem){var e={name:"attrReport",type:g.dashboarditem.reportType,value:g.selectedReport[0].id};g.dashboarditem.attrs.splice(_.findIndex(g.dashboarditem.attrs,1,e))}n.dashboarditemForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.onTypeChange=function(){["web-report","iframe","clock","custom"].includes(g.dashboarditem.type)&&(g.dashboarditem.attrEmailAccounts=null,g.dashboarditem.attrFaxAccounts=null,g.dashboarditem.attrSmsAccounts=null,g.dashboarditem.attrOpenchannelAccounts=null,g.dashboarditem.attrWhatsappAccounts=null,g.dashboarditem.attrChatWebsites=null)},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){s.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=f(!1),g.treeCustomEvents=f(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=I,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],h=null;function f(e){return e?{loaded:E,select_node:b}:{loaded:y,select_node:A}}function b(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,S()}function A(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,S()}function E(){if(!g.newDashboardItem&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(!g.newDashboardItem&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);A(0,{node:e,selected:e.id})}}function S(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,T).$promise;else{if(!g.userProfileSection)return T(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,T).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),T({count:t.length,rows:t})}return T(null)}):T(null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function T(e){g.reports=e||{count:0,rows:[]},g.newDashboardItem||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function I(e){a.hide(e)}c.hasRole("admin")?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){g.voiceQueues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){h=e.rows||[]}).then(function(){for(var e=[],n=0;n<v.length;n++)e.push(d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:v[n].id}).$promise);return o.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<v.length;a++){var i=_.find(n,["sectionId",v[a].id]);if(i)if(i.autoAssociation){var s=[];h.forEach(function(e){e.type===v[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(t)}).then(function(e){var n=[],t=null;g.dashboarditem&&(t=_.find(h,{id:Number(g.dashboarditem.attrVoiceQueues)}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){n.push(e)})}t&&!_.some(n,["resourceId",t.id])&&h.forEach(function(e){e.id===t.id&&(e.canSelect=!1,n.push(e))}),g.voiceQueues=n}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.mailAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.mailAccount,{id:Number(g.dashboarditem.attrEmailAccounts)}));for(var i=0;i<g.mailAccount.length;i++)a&&g.mailAccount[i].id===a.id&&(g.mailAccount[i].canSelect=!1,t.push(g.mailAccount[i]));g.mailAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.faxAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.faxAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.faxAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.faxAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.faxAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.faxAccount,{id:Number(g.dashboarditem.attrFaxAccounts)}));for(var i=0;i<g.faxAccount.length;i++)a&&g.faxAccount[i].id===a.id&&(g.faxAccount[i].canSelect=!1,t.push(g.faxAccount[i]));g.faxAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.smsAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.smsAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.smsAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.smsAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.smsAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.smsAccount,{id:Number(g.dashboarditem.attrSmsAccounts)}));for(var i=0;i<g.smsAccount.length;i++)a&&g.smsAccount[i].id===a.id&&(g.smsAccount[i].canSelect=!1,t.push(g.smsAccount[i]));g.smsAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.openchannelAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.openchannelAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.openchannelAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.openchannelAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.openchannelAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.openchannelAccount,{id:Number(g.dashboarditem.attrOpenchannelAccounts)}));for(var i=0;i<g.openchannelAccount.length;i++)a&&g.openchannelAccount[i].id===a.id&&(g.openchannelAccount[i].canSelect=!1,t.push(g.openchannelAccount[i]));g.openchannelAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_WHATSAPPACCOUNT",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.whatsappAccount.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.whatsappAccount=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:2102}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.whatsappAccount,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.whatsappAccount,{id:t.id});a.canSelect=!1,n.push(a)}g.whatsappAccount=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.whatsappAccount,{id:Number(g.dashboarditem.attrWhatsappAccounts)}));for(var i=0;i<g.whatsappAccount.length;i++)a&&g.whatsappAccount[i].id===a.id&&(g.whatsappAccount[i].canSelect=!1,t.push(g.whatsappAccount[i]));g.whatsappAccount=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATWEBSITE",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.chatWebsite.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.chatWebsite=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.chatWebsite,{id:e.resourceId})}),t=null;if(g.dashboarditem&&(t=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.chatWebsite,{id:t.id});a.canSelect=!1,n.push(a)}g.chatWebsite=n})}else{var t=[],a=null;g.dashboarditem&&(a=_.find(g.chatWebsite,{id:Number(g.dashboarditem.attrChatWebsites)}));for(var i=0;i<g.chatWebsite.length;i++)a&&g.chatWebsite[i].id===a.id&&(g.chatWebsite[i].canSelect=!1,t.push(g.chatWebsite[i]));g.chatWebsite=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dashboard","dashboarditem","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.customDashboard=c||t.params.customDashboard||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.clonedialog=function(e,n){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:u.customDashboards?u.customDashboards.rows:[],crudPermissions:u.crudPermissions}})},u.gotogoto=function(e,n){t.go("app.dashboards.custom",{id:e.id})},u.alert=l.info,u.gotoCustomDashboards=function(){t.go("app.tools.customDashboards",{},{reload:"app.tools.customDashboards"})},u.saveCustomDashboard=function(){r.dashboard.update({id:u.customDashboard.id},u.customDashboard).$promise.then(function(){l.success({title:"CustomDashboard updated!",msg:u.customDashboard.name?u.customDashboard.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","customDashboard","userProfileSection"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(a,i,o,r,e,l,d,n,t,s,c){var m=this;if(m.currentUser=n.getCurrentUser(),m.disposition=angular.copy(e),m.setting=c,m.license=s,m.crudPermissions=t,m.newDisposition=!1,m.errors=[],m.disposition||(m.disposition={level:"first"},m.newDisposition=!0),l){var u=l.field;m.disposition[u]=l.id}function p(){return o(function(t,n){d.disposition.get({fields:"id,name,level,ParentId",sort:"id",nolimit:"true"}).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})}function g(e){"first"===e.level?m.firstLevelDisposition=e:(m.anySecondLevelDisposition=!0,m.secondLevelDisposition=e,m.firstLevelDisposition=_.find(m.dispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition||p().then(function(){m.firstLevelDisposition=_.find(m.allDispositions,["id",m.secondLevelDisposition.ParentId]),m.firstLevelDisposition.canSelect=!1,m.dispositions.push(m.firstLevelDisposition)}))}function v(e){a.hide(e)}m.onInit=function(){var e={fields:"id,name,level,ParentId",id:l?l.id:void 0,section:"user"===m.currentUser.role?"Dispositions":void 0,MailAccountId:l?void 0:"null",FaxAccountId:l?void 0:"null",SmsAccountId:l?void 0:"null",OpenchannelAccountId:l?void 0:"null",ChatWebsiteId:l?void 0:"null",WhatsappAccountId:l?void 0:"null",ListId:l?void 0:"null",sort:"id",nolimit:"true"},n="get",t="disposition";l?(n="getDispositions",t=l.route):"user"===m.currentUser.role&&(n="getResources",t="userProfile",e.id=m.currentUser.userProfileId);(a=t,i=n,s=e,o(function(t,n){d[a][i](s).$promise.then(function(e){var n=e.rows||[];return t(n)}).catch(function(e){n(e)})})).then(function(e){m.dispositions=angular.copy(e),m.newDisposition||function(){if("first"===m.disposition.level)return;if(m.parentDisposition=_.find(m.dispositions,["id",m.disposition.ParentId]),!m.parentDisposition)return p().then(function(e){m.allDispositions=e;for(var n=0;n<m.allDispositions.length;n++){var t=m.allDispositions[n];if(t.id===m.disposition.ParentId){g(t),t.canSelect=!1,m.dispositions.push(t);break}}});g(m.parentDisposition)}()}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:["api",t,n].join(":"),msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});var a,i,s},m.onFirstLevelSelection=function(){m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=_.some(m.dispositions,function(e){return e.ParentId===m.firstLevelDisposition.id&&e.id!=m.disposition.id})},m.addNewDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.save(m.disposition).$promise.then(function(e){m.dispositions.unshift(e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_CREATED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var n=0;n<e.data.errors.length;n+=1)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveDisposition=function(){m.errors=[],m.secondLevelDisposition?(m.disposition.ParentId=m.secondLevelDisposition.id,m.disposition.level="third"):m.firstLevelDisposition&&(m.disposition.ParentId=m.firstLevelDisposition.id,m.disposition.level="second");d.disposition.update({id:m.disposition.id},m.disposition).$promise.then(function(e){var n=_.find(m.dispositions,{id:e.id});n&&_.merge(n,e.toJSON()),r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_SAVED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.deleteDisposition=function(e){m.errors=[];var n=_.some(m.dispositions,["ParentId",m.disposition.id]),t=a.confirm({skipHide:!0}).title(i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(i.instant("TOOLS.NOTIFICATIONS."+(n?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:m.disposition.name})).ariaLabel("Delete disposition").ok(i.instant("TOOLS.DELETE")).cancel(i.instant("TOOLS.CANCEL")).targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:m.disposition.id}).$promise.then(function(){r.success({title:i.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")}),v(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var n=0;n<e.data.errors.length;n++)r.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.clearSelection=function(e){"first"===e?(m.firstLevelDisposition=void 0,m.secondLevelDisposition=void 0,m.anySecondLevelDisposition=!1):m.secondLevelDisposition=void 0},m.closeDialog=v}e.$inject=["$mdDialog","$translate","$q","toasty","disposition","model","api","Auth","crudPermissions","license","setting"],angular.module("app.tools").controller("CreateOrEditDispositionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this;function f(e){h.dispositions=e||{count:0,rows:[]}}function b(){h.query.offset=(h.query.page-1)*h.query.limit,p.isAdmin()?h.promise=m.disposition.get(h.query,f).$promise:(h.query.id=h.userProfile.id,h.query.section="Dispositions",h.promise=m.userProfile.getResources(h.query,f).$promise)}function A(e){m.disposition.delete({id:e.id}).$promise.then(function(){b(),u.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)u.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else u.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}h.license=g,h.setting=v,h.currentUser=p.getCurrentUser(),h.dispositions=l||{count:0,rows:[]},h.userProfile=d,h.userProfileSection=c&&1==c.count?c.rows[0]:null,h.crudPermissions=p.parseCrudPermissions(h.userProfileSection?h.userProfileSection.crudPermissions:null),h.selectedDispositions=[],h.levels={first:"1st",second:"2nd",third:"3rd"},h.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",WhatsappAccountId:"null",ListId:"null",limit:10,page:1},h.deleteconfirm=function(e,n){var t=_.some(h.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){A(e)})},h.success=f,h.getDispositions=b,h.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:null,license:h.license,setting:h.setting,crudPermissions:h.crudPermissions}}).then(function(e){!0===e&&b()})},h.deleteDisposition=A,h.exportSelectedDispositions=function(){var e=angular.copy(h.selectedDispositions);return h.selectedDispositions=[],e},h.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:h.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){h.selectedDispositions.forEach(function(e){A(e)}),h.selectedDispositions=[]})},h.deselectDispositions=function(){h.selectedDispositions=[]},h.selectAllDispositions=function(){h.selectedDispositions=h.dispositions.rows};var E=!0,y=1;e.$watch("vm.query.filter",function(e,n){E?o(function(){E=!1}):(n||(y=h.query.page),e!==n&&(h.query.page=1),e||(h.query.page=y),b())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dispositions","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("DispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.intervalIntervals=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.interval.getIntervals(m.query,u).$promise}function g(e){d.interval.delete({id:e.id}).$promise.then(function(){_.remove(m.intervalIntervals.rows,{id:e.id}),m.intervalIntervals.count-=1,m.intervalIntervals.rows.length||p(),l.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.interval={},m.intervalIntervals={count:0,rows:[]},m.selectedIntervalIntervals=[],m.crudPermissions,m.sortableTable={animation:100,onSort:function(e){d.interval.addIntervals({id:m.interval.id},e.models).$promise.then(function(e){m.intervalIntervals.rows=e}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},m.query={fields:"createdAt,updatedAt,id,name,interval",nolimit:"true",limit:10,page:1},m.init=function(e,n){m.interval=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.sortableTable.disabled=!m.crudPermissions.canEdit,m.query.id=m.interval.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interval #")+e.id||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getIntervalIntervals=p,m.createOrEditIntervalInterval=function(e,n){o.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:m.interval,interval:n,intervals:m.intervalIntervals.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedIntervalIntervals=function(){var e=angular.copy(m.selectedIntervalIntervals);return m.selectedIntervalIntervals=[],e},m.deleteIntervalInterval=g,m.deleteSelectedIntervalIntervals=function(e){var n=o.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+m.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedIntervalIntervals.forEach(function(e){g(e)}),m.selectedIntervalIntervals=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var n=_.find(g.intervals,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.interval=c||e.params.interval||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoIntervals=function(){e.go("app.tools.intervals",{},{reload:"app.tools.intervals"})},u.saveInterval=function(){r.interval.update({id:u.interval.id},u.interval).$promise.then(function(){l.success({title:"Interval updated!",msg:u.interval.name?u.interval.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","interval","userProfileSection"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.intervals=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="intervals",f.listOrder="",f.listOrderAsc=null,f.selectedIntervals=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},f.editstate=function(e,n){t.go("app.tools.intervals.edit",{id:e.id,interval:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("interval")+"?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getIntervals=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.interval.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Intervals",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditInterval=function(e,n){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:n,intervals:f.intervals.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteInterval=y,f.exportSelectedIntervals=function(){var e=angular.copy(f.selectedIntervals);return f.selectedIntervals=[],e},f.deleteSelectedIntervals=function(e){var n=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+f.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedIntervals.forEach(function(e){y(e)}),f.selectedIntervals=[]})},f.deselectIntervals=function(){f.selectedIntervals=[]},f.selectAllIntervals=function(){f.selectedIntervals=f.intervals.rows};var b=!0,A=1;function E(e){f.intervals=e||{count:0,rows:[]}}function y(e){m.interval.delete({id:e.id}).$promise.then(function(){_.remove(f.intervals.rows,{id:e.id}),f.intervals.count-=1,f.intervals.rows.length||f.getIntervals(),p.success({title:_.startCase("Interval")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","intervals","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_PAUSE",g.pause=angular.copy(l),g.pauses=r,g.newPause=!1,g.pause||(g.pause={},g.title="TOOLS.NEW_PAUSE",g.newPause=!0),g.addNewPause=function(){g.errors=[],d.pause.save(g.pause).$promise.then(function(e){g.pauses.unshift(e.toJSON()),o.success({title:"Pause properly created",msg:g.pause.name?g.pause.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePause=function(){g.errors=[],d.pause.update({id:g.pause.id},g.pause).$promise.then(function(e){var n=_.find(g.pauses,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Pause properly saved!",msg:g.pause.name?g.pause.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePause=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.pause.delete({id:g.pause.id}).$promise.then(function(){_.remove(g.pauses,{id:g.pause.id}),o.success({title:"Pause properly deleted!",msg:(g.pause.name||"pause")+" has been deleted!"}),v(g.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","pauses","pause","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.pauses=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="pauses",f.listOrder="",f.listOrderAsc=null,f.selectedPauses=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{pause:e,pauses:f.pauses.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("pause")+"?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getPauses=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.pause.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Pauses",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditPause=function(e,n){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:n,pauses:f.pauses.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletePause=y,f.exportSelectedPauses=function(){var e=angular.copy(f.selectedPauses);return f.selectedPauses=[],e},f.deleteSelectedPauses=function(e){var n=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+f.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedPauses.forEach(function(e){y(e)}),f.selectedPauses=[]})},f.deselectPauses=function(){f.selectedPauses=[]},f.selectAllPauses=function(){f.selectedPauses=f.pauses.rows};var b=!0,A=1;function E(e){f.pauses=e||{count:0,rows:[]}}function y(e){m.pause.delete({id:e.id}).$promise.then(function(){_.remove(f.pauses.rows,{id:e.id}),f.pauses.count-=1,f.pauses.rows.length||f.getPauses(),p.success({title:_.startCase("Pause")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","pauses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;if(g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SCHEDULE",g.schedule=angular.copy(l),g.schedules=r,g.newSchedule=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.schedule){g.apiName=g.schedule.DefaultReportId?"analyticDefaultReport":"analyticCustomReport";var v=g.schedule.DefaultReportId?g.schedule.DefaultReportId:g.schedule.CustomReportId;d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:v}),g.schedule.report=g.currentReport.name,g.query.parent=g.currentReport.parent})}else g.schedule={output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1,sendIfEmpty:!0},g.title="TOOLS.NEW_SCHEDULE",g.newSchedule=!0;function h(e){return e?{loaded:A,select_node:f}:{loaded:E,select_node:b}}function f(e,n){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=n.node.id,y()}function b(e,n){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=n.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=n.node.id,y()}function A(){if(!g.newSchedule&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);f(0,{node:e,selected:e.id})}}function E(){if(!g.newSchedule&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,S).$promise;else{if(!g.userProfileSection)return S(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,S).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var n=e&&e.rows?e.rows:[];if(0<n.length){var t=[];return a.forEach(function(e){_.find(n,["resourceId",e.id])&&t.push(e)}),S({count:t.length,rows:t})}return S(null)}):S(null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function S(e){g.reports=e||{count:0,rows:[]},g.newSchedule||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function T(e){a.hide(e)}g.addNewSchedule=function(){g.errors=[],d.schedule.save(g.schedule).$promise.then(function(e){g.schedules.unshift(e.toJSON()),o.success({title:"Schedule properly created",msg:g.schedule.name?g.schedule.name+" has been created!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSchedule=function(){g.errors=[],d.schedule.update({id:g.schedule.id},g.schedule).$promise.then(function(e){var n=_.find(g.schedules,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Schedule properly saved!",msg:g.schedule.name?g.schedule.name+" has been saved!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSchedule=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.schedule.delete({id:g.schedule.id}).$promise.then(function(){_.remove(g.schedules,{id:g.schedule.id}),o.success({title:"Schedule properly deleted!",msg:(g.schedule.name||"schedule")+" has been deleted!"}),T(g.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.getReports=y,g.selectReport=function(){g.schedule.report=g.selectedReport[0].name,g.currentNode.custom?(g.schedule.CustomReportId=g.selectedReport[0].id,delete g.schedule.DefaultReportId):(g.schedule.DefaultReportId=g.selectedReport[0].id,delete g.schedule.CustomReportId);e.scheduleForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(n={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,n}).catch(function(e){o.error({title:"ERROR",msg:e.message})}):n),g.treeDefaultEvents=h(!1),g.treeCustomEvents=h(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var n},g.closeDialog=T,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.mailAccounts,{id:e.resourceId})}),t=null;if(g.schedule&&(t=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}g.mailAccounts=n})}else{var t=[],a=null;g.schedule&&(a=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)}));for(var i=0;i<g.mailAccounts.length;i++)a&&g.mailAccounts[i].id===a.id&&(g.mailAccounts[i].canSelect=!1,t.push(g.mailAccounts[i]));g.mailAccounts=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","schedules","schedule","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.schedules=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="schedules",f.listOrder="",f.listOrderAsc=null,f.selectedScheduler=[],f.query={fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,page:1},f.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{schedule:e,schedules:f.schedules.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.runconfirm=function(e,n){var t=i.confirm().title("Are you sure want to run the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be run.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){return m.schedule.run({id:e.id}).$promise},function(){console.log("CANCEL")})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("schedule")+"?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScheduler=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.schedule.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Scheduler",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSchedule=function(e,n){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:n,schedules:f.schedules.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSchedule=y,f.exportSelectedScheduler=function(){var e=angular.copy(f.selectedScheduler);return f.selectedScheduler=[],e},f.deleteSelectedScheduler=function(e){var n=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+f.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedScheduler.forEach(function(e){y(e)}),f.selectedScheduler=[]})},f.deselectScheduler=function(){f.selectedScheduler=[]},f.selectAllScheduler=function(){f.selectedScheduler=f.schedules.rows},m.analyticTreeReport.get({}).$promise.then(function(e){f.treeReports=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.mailAccounts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.mailAccounts,{id:e.resourceId})}),t=null;if(f.schedule&&(t=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.mailAccounts,{id:t.id});a.canSelect=!1,n.push(a)}f.mailAccounts=n})}else{var t=[],a=null;f.schedule&&(a=_.find(f.mailAccounts,{id:Number(f.schedule.MailAccountId)}));for(var i=0;i<f.mailAccounts.length;i++)a&&f.mailAccounts[i].id===a.id&&(f.mailAccounts[i].canSelect=!1,t.push(f.mailAccounts[i]));f.mailAccounts=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.schedules=e||{count:0,rows:[]}}function y(e){m.schedule.delete({id:e.id}).$promise.then(function(){_.remove(f.schedules.rows,{id:e.id}),f.schedules.count-=1,f.schedules.rows.length||f.getScheduler(),p.success({title:_.startCase("Schedule")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","schedules","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SOUND",g.sound=angular.copy(l),g.sounds=r,g.newSound=!1,g.sound||(g.sound={},g.title="TOOLS.NEW_SOUND",g.newSound=!0),g.addNewSound=function(){g.errors=[],d.sound.save(g.sound).$promise.then(function(e){g.sounds.unshift(e.toJSON()),o.success({title:"Sound properly created",msg:g.sound.name?g.sound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSound=function(){g.errors=[],d.sound.update({id:g.sound.id},g.sound).$promise.then(function(e){var n=_.find(g.sounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Sound properly saved!",msg:g.sound.name?g.sound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.sound.delete({id:g.sound.id}).$promise.then(function(){_.remove(g.sounds,{id:g.sound.id}),o.success({title:"Sound properly deleted!",msg:(g.sound.name||"sound")+" has been deleted!"}),v(g.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sounds","sound","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.sounds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="sounds",f.listOrder="",f.listOrderAsc=null,f.selectedSounds=[],f.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{sound:e,sounds:f.sounds.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.downloadfile2=function(s,e){return m.sound.download({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("sound")+"?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getSounds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.sound.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Sounds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditSound=function(e,n){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:n,sounds:f.sounds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteSound=y,f.exportSelectedSounds=function(){var e=angular.copy(f.selectedSounds);return f.selectedSounds=[],e},f.deleteSelectedSounds=function(e){var n=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+f.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedSounds.forEach(function(e){y(e)}),f.selectedSounds=[]})},f.deselectSounds=function(){f.selectedSounds=[]},f.selectAllSounds=function(){f.selectedSounds=f.sounds.rows},f.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:f.sounds.rows}})};var b=!0,A=1;function E(e){f.sounds=e||{count:0,rows:[]}}function y(e){m.sound.delete({id:e.id}).$promise.then(function(){_.remove(f.sounds.rows,{id:e.id}),f.sounds.count-=1,f.sounds.rows.length||f.getSounds(),p.success({title:_.startCase("Sound")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sounds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this,r=15,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=a,o.uploadSounds=[],o.uploadState="none",o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/sounds"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var n=["wav","mp3","gsm"];if(!_.includes(n,e.getExtension()))return t.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+n.join()}),!1;if(e.size>l)return t.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.sound={id:e.uniqueIdentifier,file:e},o.uploadSounds.unshift(o.sound),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(n,e){if(n.id===a.uniqueIdentifier){var t=new FileReader;t.readAsDataURL(n.file.file),t.onload=function(e){n.url=e.target.result}}})},o.uploadError=function(e,n){o.ngFlow.flow.cancel(),t.error({title:"Upload error",msg:"Cannot upload the sound"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",t.success({title:"Upload completed",msg:o.sound.file.name+" uploaded successfully"}))},o.closeDialog=function(){n.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api","Auth"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TAG",g.tag=angular.copy(l),g.tags=r,g.newTag=!1,g.tag||(g.tag={},g.title="TOOLS.NEW_TAG",g.newTag=!0),g.addNewTag=function(){g.errors=[],d.tag.save(g.tag).$promise.then(function(e){g.tags.unshift(e.toJSON()),o.success({title:"Tag properly created",msg:g.tag.name?g.tag.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTag=function(){g.errors=[],d.tag.update({id:g.tag.id},g.tag).$promise.then(function(e){var n=_.find(g.tags,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Tag properly saved!",msg:g.tag.name?g.tag.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTag=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.tag.delete({id:g.tag.id}).$promise.then(function(){_.remove(g.tags,{id:g.tag.id}),o.success({title:"Tag properly deleted!",msg:(g.tag.name||"tag")+" has been deleted!"}),v(g.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","tags","tag","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.tags=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="tags",f.listOrder="",f.listOrderAsc=null,f.selectedTags=[],f.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"name,-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{tag:e,tags:f.tags.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("tag")+"?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTags=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.tag.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Tags",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTag=function(e,n){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:n,tags:f.tags.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTag=y,f.exportSelectedTags=function(){var e=angular.copy(f.selectedTags);return f.selectedTags=[],e},f.deleteSelectedTags=function(e){var n=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+f.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTags.forEach(function(e){y(e)}),f.selectedTags=[]})},f.deselectTags=function(){f.selectedTags=[]},f.selectAllTags=function(){f.selectedTags=f.tags.rows};var b=!0,A=1;function E(e){f.tags=e||{count:0,rows:[]}}function y(e){m.tag.delete({id:e.id}).$promise.then(function(){_.remove(f.tags.rows,{id:e.id}),f.tags.count-=1,f.tags.rows.length||f.getTags(),p.success({title:_.startCase("Tag")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","tags","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TEMPLATE",g.template=angular.copy(l),g.templates=r,g.newTemplate=!1,g.template||(g.template={},g.title="TOOLS.NEW_TEMPLATE",g.newTemplate=!0),g.addNewTemplate=function(){g.errors=[],d.template.save(g.template).$promise.then(function(e){g.templates.unshift(e.toJSON()),o.success({title:"Template properly created",msg:g.template.name?g.template.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTemplate=function(){g.errors=[],d.template.update({id:g.template.id},g.template).$promise.then(function(e){var n=_.find(g.templates,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Template properly saved!",msg:g.template.name?g.template.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTemplate=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.template.delete({id:g.template.id}).$promise.then(function(){_.remove(g.templates,{id:g.template.id}),o.success({title:"Template properly deleted!",msg:(g.template.name||"template")+" has been deleted!"}),v(g.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","templates","template","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.templates=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="templates",f.listOrder="",f.listOrderAsc=null,f.selectedTemplates=[],f.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{template:e,templates:f.templates.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("template")+"?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTemplates=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.template.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Templates",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTemplate=function(e,n){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:n,templates:f.templates.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTemplate=y,f.exportSelectedTemplates=function(){var e=angular.copy(f.selectedTemplates);return f.selectedTemplates=[],e},f.deleteSelectedTemplates=function(e){var n=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+f.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTemplates.forEach(function(e){y(e)}),f.selectedTemplates=[]})},f.deselectTemplates=function(){f.selectedTemplates=[]},f.selectAllTemplates=function(){f.selectedTemplates=f.templates.rows};var b=!0,A=1;function E(e){f.templates=e||{count:0,rows:[]}}function y(e){m.template.delete({id:e.id}).$promise.then(function(){_.remove(f.templates.rows,{id:e.id}),f.templates.count-=1,f.templates.rows.length||f.getTemplates(),p.success({title:_.startCase("Template")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","templates","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r,l,d){var c=this;function m(e){t.hide(e)}c.currentUser=o.getCurrentUser(),c.trigger=angular.copy(n),c.triggers=angular.copy(e),c.setting=l,c.license=r,c.crudPermissions=d,c.newTrigger=!1,c.errors=[],c.trigger||(c.trigger={channel:"voice"},c.newTrigger=!0),c.addNewTrigger=function(){c.errors=[],s.trigger.save(c.trigger).$promise.then(function(e){c.triggers.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_CREATED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveTrigger=function(){c.errors=[],s.trigger.update({id:c.trigger.id},c.trigger).$promise.then(function(){c.triggers=_.map(c.triggers,function(e){return e.id===c.trigger.id?c.trigger:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteTrigger=function(e){c.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:c.trigger.name})).ariaLabel("Delete trigger").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){s.trigger.delete({id:c.trigger.id}).$promise.then(function(){c.triggers=_.filter(c.triggers,function(e){return e.id!==c.trigger.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")}),m(c.triggers)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$translate","toasty","triggers","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,a,n,i,t,s,o,r){var l=this;function d(){_.some(l.triggerActions.rows,["action","contactManager"])&&(l.lists||(r.isAdmin()?o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.lists=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.lists,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),l.lists=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var n=_.find(l.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.lists.length;i++)_.some(a,{id:l.lists[i].id})&&(l.lists[i].canSelect=!1,t.push(l.lists[i]));l.lists=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","integration"])&&_(l.triggerActions.rows).map(function(e){return"integration"===e.action?e.data1:void 0}).compact().uniq().value().forEach(function(e){var n=e+"Accounts";if(!l[n]){var t="int"+_.startCase(e)+"Account";o[t.replace(/\s+/g,"")].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l[n]=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+n.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}),_.some(l.triggerActions.rows,function(e){return _.includes(["motionbar","browser"],e.action)})&&(l.templates||(r.isAdmin()?o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){l.templates=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.templates,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),l.templates=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(l.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<l.templates.length;i++)_.some(a,{id:l.templates[i].id})&&(l.templates[i].canSelect=!1,t.push(l.templates[i]));l.templates=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(l.triggerActions.rows,["action","jscripty"])&&(l.projects||(r.isAdmin()?o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):o.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return o.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return o.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),a=null;a=[],l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(l.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),l.projects=t})}else{var t=[],a=[];l.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var n=_.find(l.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<l.projects.length;i++)_.some(a,{id:l.projects[i].id})&&(l.projects[i].canSelect=!1,t.push(l.projects[i]));l.projects=t}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})))}function c(e){l.triggerActions=e||{count:0,rows:[]},d()}function m(){l.query.offset=(l.query.page-1)*l.query.limit,l.promise=o.trigger.getActions(l.query,c).$promise}function u(e,n){o.action.delete({id:e.id}).$promise.then(function(){m(),n&&s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)s.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}l.currentUser=r.getCurrentUser(),l.trigger={},l.triggerActions={count:0,rows:[]},l.selectedTriggerActions=[],l.query={fields:"id,action,contact,data1,data2,data3,data4,data5,data6,data7,createdAt,updatedAt",limit:10,page:1},l.integrationTypes={zendesk:"Zendesk",salesforce:"Salesforce",sugarcrm:"SugarCRM",freshdesk:"Freshdesk",desk:"Desk",zoho:"Zoho",vtiger:"vTiger",dynamics365:"Dynamics365",servicenow:"ServiceNow",freshsales:"Freshsales"},l.motionBarOptions={0:"Popup",1:"CTI URL",2:"Windows App"},l.onInit=function(e,n){l.trigger=e,l.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},l.query.ActionId=l.trigger.id,l.query.id=l.trigger.id,m()},l.success=c,l.getTriggerActions=m,l.createOrEditTriggerAction=function(e,n){i.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:l.trigger,action:n,actions:l.triggerActions.rows,license:null,setting:null,crudPermissions:l.crudPermissions}}).then(function(e){e&&(l.triggerActions={count:e.length,rows:e},d())})},l.exportSelectedTriggerActions=function(){var e=angular.copy(l.selectedTriggerActions);return l.selectedTriggerActions=[],e},l.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){u(e,!0)})},l.deleteSelectedTriggerActions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETE_MESSAGE",{total:l.selectedTriggerActions.length})).ariaLabel("Delete actions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){l.selectedTriggerActions.forEach(function(e){u(e)}),l.selectedTriggerActions=[],s.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r,l,d,c,m){var u=this;function p(){return new Promise(function(n,t){l.hasSectionsPermissions([1301,1302,1303,1304,1305,1306,1307,1308,1309,1310]).then(function(e){u.hasSectionPermissions=_.merge(u.hasSectionPermissions,e),n(u.hasSectionPermissions)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SECTIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()}),t()})})}function g(){r.cmList.getCustomFields({id:u.action.data1,ListId:u.action.data1}).$promise.then(function(e){u.listFields=_.filter(e.rows,["type","text"]),u.listFields.forEach(function(e){e.columnName="cf_"+e.id})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LIST_CUSTOM_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function v(){l.isAdmin()?r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.templates=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.templates,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.templates,{id:e.id});n.canSelect=!1,t.push(n)}}),u.templates=t})}else{var t=[],a=[];u.actions.forEach(function(e){if(_.includes(["motionbar","browser"],e.action)){var n=_.find(u.templates,{id:Number(e.data2)});a.push(n)}});for(var i=0;i<u.templates.length;i++){_.some(a,{id:u.templates[i].id})&&(u.templates[i].canSelect=!1,t.push(u.templates[i]))}u.templates=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})})}function h(){switch(u.action.action){case"contactManager":u.lists||(l.isAdmin()?r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.lists,{id:e.id});n.canSelect=!1,t.push(n)}}),u.lists=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("contactManager"===e.action){var n=_.find(u.lists,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.lists.length;i++)_.some(a,{id:u.lists[i].id})&&(u.lists[i].canSelect=!1,t.push(u.lists[i]));u.lists=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})),u.contactFields||r.cmContact.describe({}).$promise.then(function(e){u.contactFields=[],u.customFields=[];for(var n=_.values(e.toJSON()),t=0;t<n.length;t++)_.includes(u.allowedStandardFields,n[t].columnName)?u.contactFields.push(n[t]):_.startsWith(n[t].columnName,"cf_")&&"text"===n[t].custom.type&&u.customFields.push(n[t])}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE_CM_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.data3=u.action.data3?u.action.data3.split(","):["phone"],"1"!==u.action.data2||u.action.data4||(u.action.data4="phone");break;case"jscripty":u.projects||(l.isAdmin()?r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),a=null;a=[],u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.projects,{id:e.id});n.canSelect=!1,t.push(n)}}),u.projects=t})}else{var t=[],a=[];u.actions.forEach(function(e){if("jscripty"===e.action){var n=_.find(u.projects,{id:Number(e.data1)});a.push(n)}});for(var i=0;i<u.projects.length;i++)_.some(a,{id:u.projects[i].id})&&(u.projects[i].canSelect=!1,t.push(u.projects[i]));u.projects=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"urlForward":u.action.data5||(u.action.data5=5)}}function f(){u.editAccount||(u.action.data2=void 0,u.action.data3=void 0),u.action.isIntegrationDisabled=!u.newAction&&!function(){switch(u.action.data1){case"zendesk":return u.hasSectionPermissions[1301];case"salesforce":return u.hasSectionPermissions[1302];case"sugarcrm":return u.hasSectionPermissions[1305];case"freshdesk":return u.hasSectionPermissions[1303];case"desk":return u.hasSectionPermissions[1306];case"zoho":return u.hasSectionPermissions[1307];case"vtiger":return u.hasSectionPermissions[1308];case"dynamics365":return u.hasSectionPermissions[1309];case"servicenow":return u.hasSectionPermissions[1310];case"freshsales":return u.hasSectionPermissions[1304]}}();var e="int"+_.capitalize(u.action.data1)+"Account";r[e].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u.accounts=e.rows||[],u.editAccount=!1}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function b(){u.action.data3=u.action.data3?u.action.data3:void 0;var e="int"+_.capitalize(u.action.data1)+"Configuration";r[e].get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){u.configurations=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.action.data1.toUpperCase()+"CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})}function A(){var e=angular.copy(u.action);return _.isArray(e.data3)&&(e.data3=u.action.data3.join(",")),e}function E(e){t.hide(e)}u.currentUser=l.getCurrentUser(),void 0!==s&&"urlForward"===s.action&&s.data5&&(s.data5=parseInt(s.data5)),u.action=angular.copy(s),u.actions=angular.copy(e),u.setting=c,u.license=d,u.crudPermissions=m,u.newAction=!1,u.errors=[],u.trigger=angular.copy(o),u.action?function(){switch(u.editAccount=!0,u.action.action){case"integration":return new Promise(function(e){e(p())}).then(function(){return u.editAccount||(u.action.data2=void 0,u.action.data3=void 0,h()),f()}).then(function(){return b()});case"motionbar":case"browser":v()}u.editAccount=!1}():(u.action={},u.newAction=!0),u.action.ActionId=n.params.id||void 0,u.allowedStandardFields=["phone","mobile","fax"],u.addNewAction=function(){u.errors=[];var e=A();r.trigger.addAction({id:n.params.id},e).$promise.then(function(e){u.actions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_CREATED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.saveAction=function(){u.errors=[];var n=A();r.action.update({id:n.id},n).$promise.then(function(){u.actions=_.map(u.actions,function(e){return e.id===n.id?n:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_SAVED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},u.deleteAction=function(e){u.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETE_TITLE")).ariaLabel("Delete action").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){r.action.delete({id:u.action.id}).$promise.then(function(){u.actions=_.filter(u.actions,function(e){return e.id!==u.action.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.ACTION_DELETED_SUCCESS_TITLE")}),E(u.actions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},u.onActionInit=function(){l.hasModulePermissions("Integrations").then(function(e){u.hasIntegrationsPermissions=e}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MODULE_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),u.action.action&&h()},u.onIntegrationInit=p,u.onSearchFieldsInit=function(){u.newAction||g()},u.onActionSelection=function(){u.newAction&&(u.action.data1=void 0,u.action.data2=void 0,u.action.data3=void 0,u.action.data4=void 0,u.action.data5="urlForward"===u.action.action?5:void 0,h())},u.onIntegrationSelection=f,u.onListSelection=function(){g()},u.onTypeSelection=function(){"0"!==u.action.data1||u.templates?(u.action.data2=void 0,u.action.data4="1"===u.action.data1?0:void 0):v()},u.onAutocreateSelection=function(){"0"===u.action.data2&&(u.action.data4=void 0);u.action.data4||"1"!==u.action.data2||(u.action.data4="phone")},u.onIntegrationAccountSelection=b,u.closeDialog=E,u.onActionLocationChange=function(){u.editAccount||(u.action.data5=void 0,u.action.data6=void 0)}}e.$inject=["$state","$mdDialog","$translate","toasty","actions","action","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.allConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.allConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.allConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.triggerAllConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.allConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.allConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAllConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.allConditions={count:0,rows:[]},u.selectedAllConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAllId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAllConditions=r,u.createOrEditAllCondition=function(e,n){i.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,allCondition:n,allConditions:u.allConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.allConditions={count:e.length,rows:e},s())})},u.exportSelectedAllConditions=function(){var e=angular.copy(u.selectedAllConditions);return u.selectedAllConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteSelectedAllConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAllConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAllConditions.forEach(function(e){p(e)}),u.selectedAllConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.allCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.allConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.allConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.allCondition=angular.copy(s),p.allConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAllCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.allCondition?g():(p.allCondition={operator:"equals"},p.newAllCondition=!0),p.allCondition.TriggerAllId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.allCondition.value=void 0,g()},p.addNewAllCondition=function(){p.errors=[],d.trigger.addAllCondition({id:e.params.id},p.allCondition).$promise.then(function(e){p.allConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAllCondition=function(){p.errors=[],d.condition.update({id:p.allCondition.id},p.allCondition).$promise.then(function(){p.allConditions=_.map(p.allConditions,function(e){return e.id===p.allCondition.id?p.allCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAllCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.allCondition.id}).$promise.then(function(){p.allConditions=_.filter(p.allConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.allConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","allConditions","allCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,l,a,n,i,t,d,c,m){var u=this;function s(){var o,r;"voice"===u.trigger.channel?(_.some(u.anyConditions.rows,["field","queue"])&&(u.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,m.isAdmin()?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u.queues=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(c.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),u.queues=t}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","routeId"])&&(u.outboundRoutes||(m.isAdmin()?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){u.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.outboundRoutes,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),u.outboundRoutes=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("routeId"===e.field){var n=_.find(u.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<u.outboundRoutes.length;i++)_.some(a,{id:u.outboundRoutes[i].id})&&(u.outboundRoutes[i].canSelect=!1,t.push(u.outboundRoutes[i]));u.outboundRoutes=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}))),_.some(u.anyConditions.rows,["field","agent"])&&(u.agents||(m.isAdmin()?c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){u.agents=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.agents,{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),u.agents=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("agent"===e.field){var n=_.find(u.agents,{name:e.value});a.push(n)}});for(var i=0;i<u.agents.length;i++)_.some(a,{id:u.agents[i].id})&&(u.agents[i].canSelect=!1,t.push(u.agents[i]));u.agents=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})})))):("mail"===u.trigger.channel&&c.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.mailSubstatuses=e.rows||[]}).catch(function(){d.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})}),function(){var e,s=u.trigger.channel+("chat"===u.trigger.channel?"Websites":"Accounts"),n=u.trigger.channel+("chat"===u.trigger.channel?"Website":"Account");switch(u.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}m.isAdmin()?c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){u[s]=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return c.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u[s],{id:e.resourceId})}),a=null;a=[],u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(u[s],{id:e.id});n.canSelect=!1,t.push(n)}}),u[s]=t})}else{var t=[],a=[];u.anyConditions.rows.forEach(function(e){if("account"===e.field){var n=_.find(u[s],{id:Number(e.value)});a.push(n)}});for(var i=0;i<u[s].length;i++)_.some(a,{id:u[s][i].id})&&(u[s][i].canSelect=!1,t.push(u[s][i]));u[s]=t}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+u.trigger.channel.toUpperCase()+u.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}())}function o(e){u.anyConditions=e||{count:0,rows:[]},s()}function r(){u.query.offset=(u.query.page-1)*u.query.limit,u.promise=c.trigger.getAnyConditions(u.query,o).$promise}function p(e,n){c.condition.delete({id:e.id}).$promise.then(function(){r(),n&&d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){u.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}u.currentUser=m.getCurrentUser(),u.trigger={},u.anyConditions={count:0,rows:[]},u.selectedAnyConditions=[],u.query={fields:"id,field,operator,value,createdAt,updatedAt",limit:10,page:1},u.fields={queue:"Queue",lastevent:"Call_Status",routeId:"OutboundRoute",agent:"Agent",account:"Account",interaction:"Interaction",message:"Message",mailSubstatus:"Mail_Substatus",offlineMessage:"Offline_Message"},u.callStatuses={abandoned:"Abandon",timeout:"Timeout",complete:"Hangup",rejected:"Reject",called:"Ring",connect:"Answer",nosuchnumber:"NoSuchNumber",busy:"Busy",noanswer:"NoAnswer",congestion:"Congestion",agentreject:"AgentReject",amd:"AMD"},u.messageStatuses={in:"Incoming",out:"Outgoing",accept:"Accepted",reject:"Rejected"},u.onInit=function(e,n){u.trigger=e,u.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},u.query.TriggerAnyId=u.trigger.id,u.query.id=u.trigger.id,r()},u.success=o,u.getAnyConditions=r,u.createOrEditAnyCondition=function(e,n){i.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:u.trigger,anyCondition:n,anyConditions:u.anyConditions.rows,license:null,setting:null,crudPermissions:u.crudPermissions}}).then(function(e){e&&(u.anyConditions={count:e.length,rows:e},s())})},u.exportSelectedAnyConditions=function(){var e=angular.copy(u.selectedAnyConditions);return u.selectedAnyConditions=[],e},u.deleteConfirm=function(e,n){var t=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").targetEvent(n).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(t).then(function(){p(e,!0)})},u.deleteAnyCondition=p,u.deleteSelectedAnyConditions=function(e){var n=i.confirm().title(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_TITLE")).content(a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETE_MESSAGE",{total:u.selectedAnyConditions.length})).ariaLabel("Delete conditions").targetEvent(e).ok("OK").cancel(a.instant("TOOLS.CANCEL"));i.show(n).then(function(){u.selectedAnyConditions.forEach(function(e){p(e)}),u.selectedAnyConditions=[],d.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITIONS_DELETED_SUCCESS_TITLE")})})}}e.$inject=["$scope","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,l,a,i,n,s,o,d,c,r,m,u){var p=this;function g(){switch(p.anyCondition.field){case"queue":p.queues||(o=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],r=null,c.isAdmin()?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){p.queues=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){r=e.rows||[]}).then(function(){for(var e=[],n=0;n<o.length;n++)e.push(d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:o[n].id}).$promise);return l.all(e)}).then(function(e){for(var n=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),t=[],a=0;a<o.length;a++){var i=_.find(n,["sectionId",o[a].id]);if(i)if(i.autoAssociation){var s=[];r.forEach(function(e){e.type===o[a].type&&s.push(e)}),t.push({rows:s,count:s.length})}else t.push(d.userProfileResource.get({sectionId:i.id}).$promise.then(function(e){return{count:e.count,rows:_.map(e.rows,function(e){return e.id=e.resourceId,delete e.resourceId,e})}}))}return l.all(t)}).then(function(e){var t=[],a=[];p.anyConditions.forEach(function(e){if("queue"===e.field){var n=_.find(r,{name:e.value});a.push(n)}});for(var n=0;n<e.length;n++)(e[n].rows||[]).forEach(function(e){t.push(e)});_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(r,{id:e.id});n.canSelect=!1,t.push(n)}}),p.queues=t}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"routeId":p.outboundRoutes||(c.isAdmin()?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){p.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.outboundRoutes,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.outboundRoutes,{id:e.id});n.canSelect=!1,t.push(n)}}),p.outboundRoutes=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("routeId"===e.field){var n=_.find(p.outboundRoutes,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.outboundRoutes.length;i++)_.some(a,{id:p.outboundRoutes[i].id})&&(p.outboundRoutes[i].canSelect=!1,t.push(p.outboundRoutes[i]));p.outboundRoutes=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"agent":p.agents||(c.isAdmin()?d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name,fullname",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){p.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.agents,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.agents,{id:e.id});n.canSelect=!1,t.push(n)}}),p.agents=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("agent"===e.field){var n=_.find(p.agents,{name:e.value});a.push(n)}});for(var i=0;i<p.agents.length;i++)_.some(a,{id:p.agents[i].id})&&(p.agents[i].canSelect=!1,t.push(p.agents[i]));p.agents=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}));break;case"account":!function(){var e,n=p.trigger.channel+("chat"===p.trigger.channel?"Website":"Account");switch(p.trigger.channel){case"chat":e=502;break;case"fax":e=902;break;case"mail":e=602;break;case"openchannel":e=802;break;case"sms":e=702;break;case"whatsapp":e=2102}c.isAdmin()?d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d[n].get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){p.accounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:e}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(p.accounts,{id:e.resourceId})}),a=null;a=[],p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(t,["id",e.id])){var n=_.find(p.accounts,{id:e.id});n.canSelect=!1,t.push(n)}}),p.accounts=t})}else{var t=[],a=[];p.anyConditions.forEach(function(e){if("account"===e.field){var n=_.find(p.accounts,{id:Number(e.value)});a.push(n)}});for(var i=0;i<p.accounts.length;i++)_.some(a,{id:p.accounts[i].id})&&(p.accounts[i].canSelect=!1,t.push(p.accounts[i]));p.accounts=t}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_"+p.trigger.channel.toUpperCase()+p.trigger.channel=="chat"?"WEBSITES":"ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}();break;case"mailSubstatus":d.mailSubstatus.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){p.mailSubstatuses=e.rows||[]}).catch(function(){i.error({title:a.instant("MAIL.SUBSTATUSES"),msg:a.instant("MAIL.NOTIFICATIONS.SUBSTATUSES_GET_ERROR")})})}var o,r}function v(e){t.hide(e)}p.currentUser=c.getCurrentUser(),p.anyCondition=angular.copy(s),p.anyConditions=angular.copy(n),p.setting=m,p.license=r,p.crudPermissions=u,p.hasModulePermissions={},p.newAnyCondition=!1,p.errors=[],p.trigger=angular.copy(o),p.anyCondition?g():(p.anyCondition={operator:"equals"},p.newAnyCondition=!0),p.anyCondition.TriggerAnyId=e.params.id||void 0,p.callStatuses=[{name:"Abandon",value:"abandoned"},{name:"Timeout",value:"timeout"},{name:"Hangup",value:"complete"},{name:"Reject",value:"rejected"},{name:"Ring",value:"called"},{name:"Answer",value:"connect"},{name:"NoSuchNumber",value:"nosuchnumber"},{name:"Busy",value:"busy"},{name:"NoAnswer",value:"noanswer"},{name:"Congestion",value:"congestion"},{name:"AgentReject",value:"agentreject"},{name:"AMD",value:"amd"}],p.onFieldSelection=function(){p.anyCondition.value=void 0,g()},p.addNewAnyCondition=function(){p.errors=[],d.trigger.addAnyCondition({id:e.params.id},p.anyCondition).$promise.then(function(e){p.anyConditions.unshift(e.toJSON()),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_CREATED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveAnyCondition=function(){p.errors=[],d.condition.update({id:p.anyCondition.id},p.anyCondition).$promise.then(function(){p.anyConditions=_.map(p.anyConditions,function(e){return e.id===p.anyCondition.id?p.anyCondition:e}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_SAVED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteAnyCondition=function(e){p.errors=[];var n=t.confirm({skipHide:!0}).title(a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETE_TITLE")).ariaLabel("Delete condition").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){d.condition.delete({id:p.anyCondition.id}).$promise.then(function(){p.anyConditions=_.filter(p.anyConditions,function(e){return e.id!==p.allCondition.id}),i.success({title:a.instant("TOOLS.NOTIFICATIONS.CONDITION_DELETED_SUCCESS_TITLE")}),v(p.anyConditions)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.closeDialog=v}e.$inject=["$state","$mdDialog","$q","$translate","toasty","anyConditions","anyCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;d.currentUser=o.getCurrentUser(),d.license=t,d.setting=a,d.trigger=r||e.params.trigger||{},d.selectedTab=e.params.tab||0,e.params.crudPermissions?d.crudPermissions=e.params.crudPermissions:(d.userProfileSection=l&&1==l.count?l.rows[0]:null,d.crudPermissions=o.parseCrudPermissions(d.userProfileSection?d.userProfileSection.crudPermissions:null)),d.gotoTriggers=function(){e.go("app.tools.triggers",{},{reload:"app.tools.triggers"})},d.saveTrigger=function(){i.trigger.update({id:d.trigger.id},d.trigger).$promise.then(function(){s.success({title:n.instant("TOOLS.NOTIFICATIONS.TRIGGER_SAVED_SUCCESS_TITLE")})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$translate","license","setting","api","toasty","Auth","trigger","userProfileSection"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.go("app.tools.triggers.edit",{id:e.id,trigger:e,crudPermissions:g.crudPermissions})}function h(e){g.triggers=e||{count:0,rows:[]}}function f(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.trigger.get(g.query,h).$promise:(g.query.id=g.userProfile.id,g.query.section="Triggers",g.promise=d.userProfile.getResources(g.query,h).$promise)}function b(e,n){d.trigger.delete({id:e.id}).$promise.then(function(){f(),n&&c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.triggers=o||{count:0,rows:[]},g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedTriggers=[],g.query={fields:"id,name,channel,status,description,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},g.goToEditState=v,g.createOrEditTrigger=function(e,n){if(g.crudPermissions.readOnly||g.crudPermissions.canDelete&&!g.crudPermissions.canEdit)return void v(n);a.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:n,triggers:g.triggers.rows,license:g.license,setting:g.setting,crudPermissions:g.crudPermissions}}).then(function(e){e&&(g.triggers={count:e.length,rows:e})})},g.success=h,g.getTriggers=f,g.deleteconfirm=function(e,n){var t=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGER_DELETE_MESSAGE",{name:e.name})).ariaLabel("Delete trigger").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){b(e,!0)})},g.exportSelectedTriggers=function(){var e=angular.copy(g.selectedTriggers);return g.selectedTriggers=[],e},g.deleteSelectedTriggers=function(e){var n=a.confirm().title(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_TITLE")).content(s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETE_MESSAGE",{total:g.selectedTriggers.length})).ariaLabel("Delete triggers").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedTriggers.forEach(function(e){b(e)}),g.selectedTriggers=[],c.success({title:s.instant("TOOLS.NOTIFICATIONS.TRIGGERS_DELETED_SUCCESS_TITLE")})})},g.deselectTriggers=function(){g.selectedTriggers=[]},g.selectAllTriggers=function(){g.selectedTriggers=g.triggers.rows};var A=!0,E=1;e.$watch("vm.query.filter",function(e,n){A?i(function(){A=!1}):(n||(E=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=E),f())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","triggers","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRUNK",g.trunk=angular.copy(l),g.trunks=r,g.newTrunk=!1,g.trunk||(g.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},g.title="TOOLS.NEW_TRUNK",g.newTrunk=!0),g.addNewTrunk=function(){g.errors=[],d.trunk.save(g.trunk).$promise.then(function(e){g.trunks.unshift(e.toJSON()),o.success({title:"Trunk properly created",msg:g.trunk.name?g.trunk.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrunk=function(){g.errors=[],d.trunk.update({id:g.trunk.id},g.trunk).$promise.then(function(e){var n=_.find(g.trunks,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Trunk properly saved!",msg:g.trunk.name?g.trunk.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrunk=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.trunk.delete({id:g.trunk.id}).$promise.then(function(){_.remove(g.trunks,{id:g.trunk.id}),o.success({title:"Trunk properly deleted!",msg:(g.trunk.name||"trunk")+" has been deleted!"}),v(g.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","trunks","trunk","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(n,t,a,e,i,s,o){var r=this;function l(e){n.hide(e)}r.newTrunk=!0,r.trunk=angular.copy(i),r.trunks=s,r.title=o.instant("TOOLS.CLONE_TRUNK"),i&&i.name&&(r.title+=": "+i.name),r.cloneTrunk=function(){return e.trunk.clone({id:i.id},r.trunk).$promise.then(function(e){r.trunks.unshift(e.toJSON()),a.success({title:"Trunk properly cloned",msg:r.trunk.name?r.trunk.name+" has been cloned!":""}),t.go("app.tools.trunks.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.clone"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","trunk","trunks","$translate"],angular.module("app.tools").controller("TrunkcloneController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.trunk=c||t.params.trunk||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},u.clonedialog=function(e,n){a.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:u.trunks?u.trunks.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTrunks=function(){t.go("app.tools.trunks",{},{reload:"app.tools.trunks"})},u.saveTrunk=function(){r.trunk.update({id:u.trunk.id},u.trunk).$promise.then(function(){l.success({title:"Trunk updated!",msg:u.trunk.name?u.trunk.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.trunk&&(t=_.find(u.contexts,{name:u.trunk.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trunk","userProfileSection"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.trunks=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="trunks",f.listOrder="",f.listOrderAsc=null,f.selectedTrunks=[],f.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.tools.trunks.edit",{id:e.id,trunk:e,crudPermissions:f.crudPermissions})},f.clonedialog=function(e,n){i.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{trunk:e,trunks:f.trunks?f.trunks.rows:[],crudPermissions:f.crudPermissions}})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.trunks",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.trunks",{})}},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("trunk")+"?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getTrunks=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.trunk.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Trunks",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditTrunk=function(e,n){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:n,trunks:f.trunks.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteTrunk=y,f.exportSelectedTrunks=function(){var e=angular.copy(f.selectedTrunks);return f.selectedTrunks=[],e},f.deleteSelectedTrunks=function(e){var n=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+f.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedTrunks.forEach(function(e){y(e)}),f.selectedTrunks=[]})},f.deselectTrunks=function(){f.selectedTrunks=[]},f.selectAllTrunks=function(){f.selectedTrunks=f.trunks.rows};var b=!0,A=1;function E(e){f.trunks=e||{count:0,rows:[]}}function y(e){m.trunk.delete({id:e.id}).$promise.then(function(){_.remove(f.trunks.rows,{id:e.id}),f.trunks.count-=1,f.trunks.rows.length||f.getTrunks(),p.success({title:_.startCase("Trunk")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","trunks","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_VARIABLE",g.variable=angular.copy(l),g.variables=r,g.newVariable=!1,g.variable||(g.variable={},g.title="TOOLS.NEW_VARIABLE",g.newVariable=!0),g.addNewVariable=function(){g.errors=[],d.variable.save(g.variable).$promise.then(function(e){g.variables.unshift(e.toJSON()),o.success({title:"Variable properly created",msg:g.variable.name?g.variable.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVariable=function(){g.errors=[],d.variable.update({id:g.variable.id},g.variable).$promise.then(function(e){var n=_.find(g.variables,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Variable properly saved!",msg:g.variable.name?g.variable.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVariable=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.variable.delete({id:g.variable.id}).$promise.then(function(){_.remove(g.variables,{id:g.variable.id}),o.success({title:"Variable properly deleted!",msg:(g.variable.name||"variable")+" has been deleted!"}),v(g.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","variables","variable","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.variables=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="variables",f.listOrder="",f.listOrderAsc=null,f.selectedVariables=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{variable:e,variables:f.variables.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("variable")+"?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVariables=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.variable.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Variables",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVariable=function(e,n){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:n,variables:f.variables.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVariable=y,f.exportSelectedVariables=function(){var e=angular.copy(f.selectedVariables);return f.selectedVariables=[],e},f.deleteSelectedVariables=function(e){var n=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+f.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVariables.forEach(function(e){y(e)}),f.selectedVariables=[]})},f.deselectVariables=function(){f.selectedVariables=[]},f.selectAllVariables=function(){f.selectedVariables=f.variables.rows};var b=!0,A=1;function E(e){f.variables=e||{count:0,rows:[]}}function y(e){m.variable.delete({id:e.id}).$promise.then(function(){_.remove(f.variables.rows,{id:e.id}),f.variables.count-=1,f.variables.rows.length||f.getVariables(),p.success({title:_.startCase("Variable")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","variables","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VIDEO.EDIT_SCREENRECORDING",g.screenRecording=angular.copy(l),g.screenRecordings=r,g.newscreenRecording=!1,g.screenRecording||(g.screenRecording={},g.title="VIDEO.NEW_SCREENRECORDING",g.newscreenRecording=!0),g.addNewscreenRecording=function(){g.errors=[],d.screenRecording.save(g.screenRecording).$promise.then(function(e){g.screenRecordings.unshift(e.toJSON()),o.success({title:"screenRecording properly created",msg:g.screenRecording.name?g.screenRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savescreenRecording=function(){g.errors=[],d.screenRecording.update({id:g.screenRecording.id},g.screenRecording).$promise.then(function(e){var n=_.find(g.screenRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"screenRecording properly saved!",msg:g.screenRecording.name?g.screenRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletescreenRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The screenRecording will be deleted.").ariaLabel("Delete screenRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.screenRecording.delete({id:g.screenRecording.id}).$promise.then(function(){_.remove(g.screenRecordings,{id:g.screenRecording.id}),o.success({title:"screenRecording properly deleted!",msg:(g.screenRecording.name||"screenRecording")+" has been deleted!"}),v(g.screenRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.screenRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){g.users=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","screenRecordings","screenRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.video").controller("CreateOrEditscreenRecordingDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c,m=this;if(m.loading=!1,m.recording=Object.assign({},i),m.route="screenRecording",m.element=l,m.actionOptions=Object.assign({},s),m.path=r,m.label=o,m.app="video",m.model="screenRecording",console.log("TCL: vm.path",m.path),console.log("TCL: vm.recording[vm.path]",m.recording[m.path]),m.filename=-1<m.recording[m.path].indexOf("/")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("/")+1):-1<m.recording[m.path].indexOf("\\")?m.recording[m.path].substring(m.recording[m.path].lastIndexOf("\\")+1):m.recording[m.path],m.format=!1,_.isNil(m.recording.format)&&(m.recording.format=m.filename.slice(m.filename.lastIndexOf("."))),(".wav"===m.recording.format&&"audio"===m.element||".mp4"===m.recording.format&&"video"===m.element)&&(m.format=!0),m.found=!0,m.format&&(c=d.defer(),a.screenRecording.download({id:m.recording.id,path:String(m.path)}).$promise.then(function(e){m.format=!0,m.found=!0,c.resolve()}).catch(function(e){console.log("err"),m.format=!1,m.found=!1,c.resolve()}),c.promise),!_.isNil(s.properties)&&s.properties){if(m.properties=Object.assign({},i),Object.keys(i).forEach(function(e){String(e[0].toUpperCase())===String(e[0])&&delete m.properties[e]}),m.propertiesDefault={},!_.isNil(s.propertiesList)&&0<s.propertiesList.length){m.propertiesDefault=Object.assign({},i);var u=s.propertiesList,p=Object.keys(i),g=!0;p.forEach(function(n){g=!0,u.forEach(function(e){String(n)===String(e)&&(g=!1)}),g&&delete m.propertiesDefault[n]}),m.properties=m.propertiesDefault}if(!_.isNil(s.extraData)&&0<s.extraData.length){m.propertiesExtra={};for(var v=s.extraData,h=0;h<v.length;h++)for(var f=v[h].values,b=v[h].model,A=0;A<f.length;A++)m.propertiesExtra[f[A].text]=i[b][f[A].key];m.properties=Object.assign({},m.propertiesDefault,m.propertiesExtra)}}m.closeDialog=function(){n.hide()}}e.$inject=["$scope","$mdDialog","toasty","api","recording","actionOptions","label","varPath","elementTag","$q"],angular.module("app.video").controller("screenRecordingplayController",e)}(),function(){"use strict";function e(e,n,t,a,r,l,i,o,s,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.screenRecordings=s||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="screenRecordings",f.listOrder="",f.listOrderAsc=null,f.selectedScreenRecordings=[],f.query={fields:"createdAt,updatedAt,id,interactionid,channel,format,value,rating,UserId,duration,startedAt,closedAt",createdAt:"@msUtils.firstLastDayMonth()",includeAll:"true",sort:"-updatedAt",limit:10,page:1},f.query.createdAt=u.firstLastDayMonth(),f.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],f.playrecording=function(e,n,t,a,i){var s={route:"screenRecording",name:"screenRecordings",model:"screenRecording",singular:"screenRecording"},a=String(a),o=String(t);console.log("TCL: path",String(t)),r.show({controller:"screenRecordingplayController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/partialViews/play.html",parent:angular.element(l.body),targetEvent:n,clickOutsideToClose:!0,locals:{recording:e,recordings:f.screenRecordings.rows,license:f.license,setting:null,item:s,actionOptions:{upperTitle:!1,lowerTitle:!0,properties:!0,propertiesIcon:"icon-video",propertiesList:["format","interactionid","duration","startedAt","closedAt","createdAt"],extraData:[{model:"User",values:[{key:"name",text:"agentname"}]}]},label:a,varPath:o,elementTag:String(i)}})},f.downloadfile2=function(e,n){var t=!1,a=_.isNil(e.format)?e.value.substring(e.value.lastIndexOf(".")):e.format;t=".mp4"===a;var s=-1<e.value.lastIndexOf("/")?e.value.substring(e.value.lastIndexOf("/")+1):-1<e.value.lastIndexOf("\\")?e.value.substring(e.value.lastIndexOf("\\")+1):e.value;return m.screenRecording.download({id:e.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:o.instant("VIDEO.CANT_DOWNLOAD_THIS_FILE"),msg:o.instant("VIDEO.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.screenRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteconfirm=function(e,n){var t=r.confirm().title("Are you sure want to delete the "+_.startCase("screenRecording")+"?").htmlContent("<b>"+(e.name||"screenRecording")+"</b> will be deleted.").ariaLabel("delete screenRecording").targetEvent(n).ok("OK").cancel("CANCEL");r.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getScreenRecordings=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.screenRecording.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ScreenRecordings",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditscreenRecording=function(e,n){r.show({controller:"CreateOrEditscreenRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/video/views/screenRecordings/create/dialog.html",parent:angular.element(l.body),targetEvent:e,clickOutsideToClose:!0,locals:{screenRecording:n,screenRecordings:f.screenRecordings.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletescreenRecording=y,f.exportSelectedScreenRecordings=function(){var e=angular.copy(f.selectedScreenRecordings);return f.selectedScreenRecordings=[],e},f.deleteSelectedScreenRecordings=function(e){var n=r.confirm().title("Are you sure want to delete the selected screenRecordings?").htmlContent("<b>"+f.selectedScreenRecordings.length+" selected</b> will be deleted.").ariaLabel("delete screenRecordings").targetEvent(e).ok("OK").cancel("CANCEL");r.show(n).then(function(){f.selectedScreenRecordings.forEach(function(e){y(e)}),f.selectedScreenRecordings=[]})},f.deselectScreenRecordings=function(){f.selectedScreenRecordings=[]},f.selectAllScreenRecordings=function(){f.selectedScreenRecordings=f.screenRecordings.rows},f.convertDuration=function(e){var n=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),i=a<10?"0"+String(a):String(a),s=t<10?"0"+String(t):String(t),o=n<10?"0"+String(n):String(n);return i+":"+s+":"+o},m.user.get({fields:"id,name,fullname",sort:"name",nolimit:"true"}).$promise.then(function(e){f.users=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.screenRecordings=e||{count:0,rows:[]}}function y(e){m.screenRecording.delete({id:e.id}).$promise.then(function(){_.remove(f.screenRecordings.rows,{id:e.id}),f.screenRecordings.count-=1,f.screenRecordings.rows.length||f.getScreenRecordings(),p.success({title:_.startCase("screenRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEscreenRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEscreenRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getScreenRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","screenRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.video").controller("ScreenRecordingsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l){var d=this;function c(e){return _.isEmpty(e)||isNaN(e)?e:parseInt(e,10)}function m(e){switch(e){case"sound":if(!d.application.appdata)return;return[{key:"save_name",value:d.application.appdata.split("/").pop()}];case"squareProject":if(!d.application.project)return;return[{key:"name",value:d.application.project.split(",")[1]}];case"tag":if(!d.application.tag)return;return[{key:"name",value:d.application.tag}];case"trunk":if(!d.application.trunk)return;return[{key:"name",value:d.application.trunk}];case"user":if(!d.application.user&&!d.application.users)return;return d.application.user?[{key:"name",value:d.application.user.split("/")[1]}]:_.map(d.application.users,function(e){return{key:"name",value:e.split("/")[1]}});case"variable":if(!d.application.name)return;return[{key:"name",value:d.application.name}];case"voiceContext":if(!d.application.context)return;return[{key:"name",value:d.application.context}];case"voiceMail":if(!d.application.voiceMail)return;return[{key:"mailbox",value:d.application.voiceMail.split("@")[0]}];case"voiceQueue":if(!d.application.queue)return;return[{key:"name",value:d.application.queue}]}}function u(){o.getResourcesByRole(d.currentUser,"trunk",{fields:"id,name",sort:"name",nolimit:"true"},m("trunk")).then(function(e){d.trunks=e}).catch(function(){s.error({title:i.instant("TOOLS.TRUNKS"),msg:i.instant("VOICE.NOTIFICATIONS.TRUNKS_GET_ERROR")})})}function p(){o.getResourcesByRole(d.currentUser,"sound",{fields:"id,name,save_name",sort:"name",nolimit:"true"},m("sound")).then(function(e){d.sounds=e}).catch(function(){s.error({title:i.instant("TOOLS.SOUNDS"),msg:i.instant("VOICE.NOTIFICATIONS.SOUNDS_GET_ERROR")})})}function g(){var e={fields:"id,name,role",sort:"name",nolimit:"true"},n=m("user"),t=[o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"agent"}),n,"Agents"),o.getResourcesByRole(d.currentUser,"user",_.merge(e,{role:"telephone"}),n,"Telephones")];a.all(t).then(function(e){var n=_(e).flatMap(function(e){return e.rows}).orderBy([function(e){return e.name.toLowerCase()}]).value();d.users={rows:n,count:n.length}}).catch(function(){s.error({title:i.instant("STAFF.USERS"),msg:i.instant("VOICE.NOTIFICATIONS.USERS_GET_ERROR")})})}function v(){(d.application.appdata||"custom"===d.application.appType)&&e.hide(d.application),e.hide()}d.currentUser=r.getCurrentUser(),d.application=angular.copy(n),d.crudPermissions=l,d.errors=[],d.init=function(){d.application.appdata&&function(){var e=[];switch(d.application.appType){case"agi":d.application.project=d.application.appdata;break;case"dial":e=d.application.appdata.split(","),d.application.tech=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"externalDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"goTo":e=d.application.appdata.split(","),d.application.context=c(e[0]),d.application.extension=c(e[1]),d.application.priority=c(e[2]);break;case"internalDial":e=d.application.appdata.split(","),d.application.user=c(e[0]),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"outboundDial":e=d.application.appdata.split(","),d.application.trunk=e[0].split("/")[1],d.application.phone=e[0].split("/")[2],d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]),d.application.prefix=d.application.phone?d.application.phone.split("$")[0]:void 0,d.application.callerId=d.application.callerID?"CALLERID(all)="+d.application.callerID:void 0;break;case"playback":e=d.application.appdata.split(","),d.application.appdata=c(e[0]),d.application.options=c(e[1]);break;case"queue":e=d.application.appdata.split(","),d.application.queue=c(e[0]),d.application.options=c(e[1]),d.application.URL=c(e[2]),d.application.sound=c(e[3]),d.application.timeout=c(e[4]),d.application.agi=c(e[5]),d.application.macro=c(e[6]),d.application.gosub=c(e[7]),d.application.rule=c(e[8]),d.application.position=c(e[9]);break;case"ringGroup":e=d.application.appdata.split(","),d.application.users=e[0].split("&"),d.application.timeout=c(e[1]),d.application.options=c(e[2]),d.application.url=c(e[3]);break;case"set":e=d.application.appdata.split("="),d.application.name=e[0],d.application.value=e[1];break;case"voicemail":e=d.application.appdata.split(","),d.application.voiceMail=c(e[0]),d.application.options=c(e[1])}}();switch(d.application.appType){case"agi":o.getResourcesByRole(d.currentUser,"squareProject",{fields:"id,name",sort:"name",nolimit:"true"},m("squareProject")).then(function(e){d.projects=e}).catch(function(){s.error({title:i.instant("CALLYSQUARE.CALLYSQUARE")+" "+i.instant("CALLYSQUARE.PROJECTS"),msg:i.instant("VOICE.NOTIFICATIONS.CALLYSQUARE_PROJECTS_GET_ERROR")})});break;case"externalDial":u();break;case"goTo":o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:"true"},m("voiceContext")).then(function(e){d.contexts=e}).catch(function(){s.error({title:i.instant("VOICE.CONTEXTS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});break;case"internalDial":g();break;case"outboundDial":o.getResourcesByRole(d.currentUser,"tag",{fields:"id,name",sort:"name",nolimit:"true"},m("tag")).then(function(e){d.tags=e}).catch(function(){s.error({title:i.instant("TOOLS.TAGS"),msg:i.instant("VOICE.NOTIFICATIONS.TAGS_GET_ERROR")})}),u();break;case"playback":p();break;case"queue":p(),o.getResourcesByRole(d.currentUser,"voiceQueue",{type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"},m("voiceQueue")).then(function(e){d.queues=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEQUEUES"),msg:i.instant("VOICE.NOTIFICATIONS.QUEUES_GET_ERROR")})});break;case"ringGroup":g();break;case"set":o.getResourcesByRole(d.currentUser,"variable",{fields:"id,name",sort:"name",nolimit:"true"},m("variable")).then(function(e){d.variables=e}).catch(function(){s.error({title:i.instant("TOOLS.VARIABLES"),msg:i.instant("VOICE.NOTIFICATIONS.VARIABLES_GET_ERROR")})});break;case"voicemail":o.getResourcesByRole(d.currentUser,"voiceMail",{fields:"id,mailbox",sort:"mailbox",nolimit:"true"},m("voiceMail")).then(function(e){d.voiceMails=e}).catch(function(){s.error({title:i.instant("VOICE.VOICEMAILS"),msg:i.instant("VOICE.NOTIFICATIONS.VOICEMAILS_GET_ERROR")})})}},d.saveRoutingApp=function(){d.errors=[],function(){var e=[];switch(d.application.appType){case"agi":d.application.appdata=d.application.project;break;case"dial":e[0]=d.application.tech,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"externalDial":e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"goTo":e[0]=d.application.context,e[1]=d.application.extension,e[2]=d.application.priority,d.application.appdata=e.join(",");break;case"internalDial":e[0]=d.application.user,e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"outboundDial":d.application.phone=t.cutdigits?(d.application.prefix||"")+"${EXTEN:"+t.cutdigits+"}":(d.application.prefix||"")+"${EXTEN}","none"===t.recordingFormat?d.application.options=d.application.options.replace("U(xcally-mixmonitor-context)",""):d.application.options.indexOf("U(xcally-mixmonitor-context)")<0&&(d.application.options+="U(xcally-mixmonitor-context)"),e[0]=["SIP",d.application.trunk,d.application.phone].join("/"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"playback":e[0]=d.application.appdata,e[1]=d.application.options,d.application.appdata=e.join(",");break;case"queue":e[0]=d.application.queue,e[1]=d.application.options,e[2]=d.application.URL,e[3]=d.application.sound,e[4]=d.application.timeout,e[5]=d.application.agi,e[6]=d.application.macro,e[7]=d.application.gosub,e[8]=d.application.rule,e[9]=d.application.position,d.application.appdata=e.join(",");break;case"ringGroup":e[0]=d.application.users.join("&"),e[1]=d.application.timeout,e[2]=d.application.options,e[3]=d.application.url,d.application.appdata=e.join(",");break;case"set":e[0]=d.application.name,e[1]=d.application.value,d.application.appdata=e.join("=");break;case"voicemail":e[0]=d.application.voiceMail,e[1]=d.application.options,d.application.appdata=e.join(",")}}(),v()},d.closeDialog=v}e.$inject=["$mdDialog","$q","$translate","toasty","application","route","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditRoutingAppDialogController",e)}(),function(){"use strict";function e(n,t,e,a,i,s,o,r,l){var d=this;function c(){var e=[{key:"name",value:d.interval.IntervalId}];s.getResourcesByRole(d.currentUser,"interval",{fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0},e).then(function(e){d.intervals=e}).catch(function(){i.error({title:t.instant("TOOLS.INTERVALS"),msg:t.instant("VOICE.NOTIFICATIONS.INTERVALS_GET_ERROR")})})}function m(e){n.hide(e)}d.currentUser=o.getCurrentUser(),d.interval=angular.copy(e),d.intervals=a||{rows:[],count:0},d.types=["always","custom","list"],d.crudPermissions=r,d.errors=[],d.daysOfWeek=l.getDaysOfWeek(),d.monthNumber=l.getMonthNumber(),d.monthName=l.getMonthName(),d.daysOfMonth=l.getDaysOfMonth(),d.initialize=function(){if("*,*,*,*"===d.interval.interval)return d.type=d.interval.IntervalId&&d.interval.application?"list":"always",void("list"===d.type&&c());d.type="custom";var e=d.interval.interval.split(","),n=e[0],t=e[1],a=e[2],i=e[3];if("*"!==n){var s,o=n.split("-")[0],r=n.split("-")[1];(s=new Date).setHours(Number(o.split(":")[0])),s.setMinutes(Number(o.split(":")[1])),d.timeRangeFrom=s,(s=new Date).setHours(Number(r.split(":")[0])),s.setMinutes(Number(r.split(":")[1])),d.timeRangeTo=s}"*"!==t&&(d.dayOfWeekFrom=t.split("-")[0],d.dayOfWeekTo=t.split("-")[1]);"*"!==a&&(d.monthDayFrom=a.split("-")[0],d.monthDayTo=a.split("-")[1]);"*"!==i&&(d.monthFrom=i.split("-")[0],d.monthTo=i.split("-")[1])},d.onTypeChange=function(){"list"===d.type&&0===d.intervals.count&&c()},d.saveInterval=function(){d.errors=[],d.interval.interval=function(){if(["always","list"].includes(d.type))return"*,*,*,*";var e=[];if("*"!==d.timeRangeFrom&&d.timeRangeFrom&&d.timeRangeTo){var n=(d.timeRangeFrom.getHours()<10?"0":"")+d.timeRangeFrom.getHours()+":"+(d.timeRangeFrom.getMinutes()<10?"0":"")+d.timeRangeFrom.getMinutes(),t=(d.timeRangeTo.getHours()<10?"0":"")+d.timeRangeTo.getHours()+":"+(d.timeRangeTo.getMinutes()<10?"0":"")+d.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return d.dayOfWeekFrom?d.dayOfWeekTo?e.push(d.dayOfWeekFrom+"-"+d.dayOfWeekTo):e.push(d.dayOfWeekFrom):e.push("*"),d.monthDayFrom?d.monthDayTo?e.push(d.monthDayFrom+"-"+d.monthDayTo):e.push(d.monthDayFrom):e.push("*"),d.monthFrom?d.monthTo?e.push(d.monthFrom+"-"+d.monthTo):e.push(d.monthFrom):e.push("*"),e.join()}(),"list"!==d.type&&(d.interval.IntervalId=null);m(d.interval)},d.closeDialog=m}e.$inject=["$mdDialog","$translate","interval","intervals","toasty","api","Auth","crudPermissions","IndexFactory"],angular.module("app.voice").controller("EditRoutingIntervalDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.chanSpies=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="chanSpies",f.listOrder="",f.listOrderAsc=null,f.selectedChanSpies=[],f.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},f.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editdialog=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:f.chanSpies.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("chanSpy")+"?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getChanSpies=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceChanSpy.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="ChanSpies",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditchanSpy=function(e,n){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:n,chanSpies:f.chanSpies.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletechanSpy=y,f.exportSelectedChanSpies=function(){var e=angular.copy(f.selectedChanSpies);return f.selectedChanSpies=[],e},f.deleteSelectedChanSpies=function(e){var n=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+f.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedChanSpies.forEach(function(e){y(e)}),f.selectedChanSpies=[]})},f.deselectChanSpies=function(){f.selectedChanSpies=[]},f.selectAllChanSpies=function(){f.selectedChanSpies=f.chanSpies.rows};var b=!0,A=1;function E(e){f.chanSpies=e||{count:0,rows:[]}}function y(e){m.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(f.chanSpies.rows,{id:e.id}),f.chanSpies.count-=1,f.chanSpies.rows.length||f.getChanSpies(),p.success({title:_.startCase("chanSpy")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chanSpies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CHANSPY",g.chanSpy=angular.copy(l),g.chanSpies=r,g.newchanSpy=!1,g.chanSpy||(g.chanSpy={recordingFormat:"wav"},g.title="VOICE.NEW_CHANSPY",g.newchanSpy=!0),g.addNewchanSpy=function(){g.errors=[],d.voiceChanSpy.save(g.chanSpy).$promise.then(function(e){g.chanSpies.unshift(e.toJSON()),o.success({title:"chanSpy properly created",msg:g.chanSpy.name?g.chanSpy.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savechanSpy=function(){g.errors=[],d.voiceChanSpy.update({id:g.chanSpy.id},g.chanSpy).$promise.then(function(e){var n=_.find(g.chanSpies,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"chanSpy properly saved!",msg:g.chanSpy.name?g.chanSpy.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletechanSpy=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceChanSpy.delete({id:g.chanSpy.id}).$promise.then(function(){_.remove(g.chanSpies,{id:g.chanSpy.id}),o.success({title:"chanSpy properly deleted!",msg:(g.chanSpy.name||"chanSpy")+" has been deleted!"}),v(g.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chanSpies","chanSpy","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.contexts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="contexts",f.listOrder="",f.listOrderAsc=null,f.selectedContexts=[],f.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{context:e,contexts:f.contexts.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("context")+"?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getContexts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceContext.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Contexts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditContext=function(e,n){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:n,contexts:f.contexts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteContext=y,f.exportSelectedContexts=function(){var e=angular.copy(f.selectedContexts);return f.selectedContexts=[],e},f.deleteSelectedContexts=function(e){var n=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+f.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedContexts.forEach(function(e){y(e)}),f.selectedContexts=[]})},f.deselectContexts=function(){f.selectedContexts=[]},f.selectAllContexts=function(){f.selectedContexts=f.contexts.rows};var b=!0,A=1;function E(e){f.contexts=e||{count:0,rows:[]}}function y(e){m.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(f.contexts.rows,{id:e.id}),f.contexts.count-=1,f.contexts.rows.length||f.getContexts(),p.success({title:_.startCase("Context")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contexts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CONTEXT",g.context=angular.copy(l),g.contexts=r,g.newContext=!1,g.context||(g.context={},g.title="VOICE.NEW_CONTEXT",g.newContext=!0),g.addNewContext=function(){g.errors=[],d.voiceContext.save(g.context).$promise.then(function(e){g.contexts.unshift(e.toJSON()),o.success({title:"Context properly created",msg:g.context.name?g.context.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContext=function(){g.errors=[],d.voiceContext.update({id:g.context.id},g.context).$promise.then(function(e){var n=_.find(g.contexts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Context properly saved!",msg:g.context.name?g.context.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContext=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceContext.delete({id:g.context.id}).$promise.then(function(){_.remove(g.contexts,{id:g.context.id}),o.success({title:"Context properly deleted!",msg:(g.context.name||"context")+" has been deleted!"}),v(g.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contexts","context","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.inboundRoute=angular.copy(s),d.inboundRoutes=n,d.newInboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.inboundRoute||(d.inboundRoute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},d.newInboundRoute=!0);e=[{key:"name",value:d.inboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newInboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.inboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInboundRoute=function(){d.errors=[],o.voiceExtension.save(d.inboundRoute).$promise.then(function(e){c(e.id).then(function(){d.inboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.inboundRoute.id},d.inboundRoute).$promise.then(function(e){var n=_.find(d.inboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.inboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.inboundRoute.exten})).ariaLabel("Delete inbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.inboundRoute.id}).$promise.then(function(){_.remove(d.inboundRoutes,{id:d.inboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.inboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","inboundRoutes","inboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.inboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.inboundRoute=l||e.params.inboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.inboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Inbound",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Inbound",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Inbound",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Inbound",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Inbound",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Inbound",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Inbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.inboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInboundRoutes=function(){e.go("app.voice.inboundRoutes",{},{reload:"app.voice.inboundRoutes"})},m.saveInboundRoute=function(){o.voiceExtension.update({id:m.inboundRoute.id},m.inboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.inboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","inboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.inboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.inboundRoutes.rows,{id:e.id}),g.inboundRoutes.count-=1,g.inboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.inboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.inboundRoutes.edit",{id:e.id,inboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInboundRoute=function(e,n){a.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundRoute:n,inboundRoutes:g.inboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInboundRoutes=function(){var e=angular.copy(g.selectedInboundRoutes);return g.selectedInboundRoutes=[],e},g.deleteSelectedInboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInboundRoutes.forEach(function(e){f(e)}),g.selectedInboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","inboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.internalRoute=angular.copy(s),d.internalRoutes=n,d.newInternalRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.internalRoute||(d.internalRoute={appdata:"Internal Call",type:"internal",context:"from-sip"},d.newInternalRoute=!0);e=[{key:"name",value:d.internalRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newInternalRoute)return;var e={sort:"priority",VoiceExtensionId:d.internalRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewInternalRoute=function(){d.errors=[],o.voiceExtension.save(d.internalRoute).$promise.then(function(e){c(e.id).then(function(){d.internalRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveInternalRoute=function(){d.errors=[],o.voiceExtension.update({id:d.internalRoute.id},d.internalRoute).$promise.then(function(e){var n=_.find(d.internalRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.internalRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteInternalRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.internalRoute.exten})).ariaLabel("Delete internal route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.internalRoute.id}).$promise.then(function(){_.remove(d.internalRoutes,{id:d.internalRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.internalRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","internalRoutes","internalRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.internalRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.internalRoute=l||e.params.internalRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.internalRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"AGI",appAlias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",options:"xX",interval:"*,*,*,*"},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",interval:"*,*,*,*",options:"xX"},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",interval:"*,*,*,*",answer:!0},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",interval:"*,*,*,*",answer:!0},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",interval:"*,*,*,*"},{app:"Voicemail",appType:"voicemail",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Internal",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.internalRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoInternalRoutes=function(){e.go("app.voice.internalRoutes",{},{reload:"app.voice.internalRoutes"})},m.saveInternalRoute=function(){o.voiceExtension.update({id:m.internalRoute.id},m.internalRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.internalRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","internalRoute","contexts","userProfileSection"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.internalRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="InternalRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.internalRoutes.rows,{id:e.id}),g.internalRoutes.count-=1,g.internalRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.internalRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedInternalRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.internalRoutes.edit",{id:e.id,internalRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditInternalRoute=function(e,n){a.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalRoute:n,internalRoutes:g.internalRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getInternalRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedInternalRoutes=function(){var e=angular.copy(g.selectedInternalRoutes);return g.selectedInternalRoutes=[],e},g.deleteSelectedInternalRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedInternalRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedInternalRoutes.forEach(function(e){f(e)}),g.selectedInternalRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","internalRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MUSICONHOLD",g.musiconhold=angular.copy(l),g.musiconholds=r,g.newMusicOnHold=!1,g.musiconhold||(g.musiconhold={mode:"files"},g.title="VOICE.NEW_MUSICONHOLD",g.newMusicOnHold=!0),g.addNewMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.save(g.musiconhold).$promise.then(function(e){g.musiconholds.unshift(e.toJSON()),o.success({title:"MusicOnHold properly created",msg:g.musiconhold.name?g.musiconhold.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.musiconhold.id},g.musiconhold).$promise.then(function(e){var n=_.find(g.musiconholds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MusicOnHold properly saved!",msg:g.musiconhold.name?g.musiconhold.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMusicOnHold=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.musiconhold.id}).$promise.then(function(){_.remove(g.musiconholds,{id:g.musiconhold.id}),o.success({title:"MusicOnHold properly deleted!",msg:(g.musiconhold.name||"musiconhold")+" has been deleted!"}),v(g.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","musiconholds","musiconhold","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.musiconholdMohSounds=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMusicOnHold.getSounds(m.query,u).$promise}function g(e){d.voiceMusicOnHold.removeSound({id:t.params.id,id2:e.id}).$promise.then(function(){_.remove(m.musiconholdMohSounds.rows,{id:e.id}),m.musiconholdMohSounds.count-=1,m.musiconholdMohSounds.rows.length||p(),l.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.musiconhold={},m.musiconholdMohSounds={count:0,rows:[]},m.selectedMusicOnHoldMohSounds=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio",limit:10,page:1},m.init=function(e,n){m.musiconhold=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.VoiceMusicOnHoldId=m.musiconhold.id,m.query.id=m.musiconhold.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("mohSound #")+e.id||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMusicOnHoldDownload=function(s,e,n){return d.sound.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="mohSound"+s.id,a=new Blob(n,{type:e.type});t=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getMusicOnHoldMohSounds=p,m.createOrEditMusicOnHoldMohSound=function(e,n){o.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:m.musiconhold,mohSound:n,mohSounds:m.musiconholdMohSounds.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(m.selectedMusicOnHoldMohSounds);return m.selectedMusicOnHoldMohSounds=[],e},m.deleteMusicOnHoldMohSound=g,m.deleteSelectedMusicOnHoldMohSounds=function(e){var n=o.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+m.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),m.selectedMusicOnHoldMohSounds=[]})},c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){m.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:m.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(m.sounds,{id:e.resourceId})}),t=null;if(m.musiconhold&&(t=_.find(m.sounds,{id:Number(m.musiconhold.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(m.sounds,{id:t.id});a.canSelect=!1,n.push(a)}m.sounds=n})}else{var t=[],a=null;m.musiconhold&&(a=_.find(m.sounds,{id:Number(m.musiconhold.id)}));for(var i=0;i<m.sounds.length;i++)a&&m.sounds[i].id===a.id&&(m.sounds[i].canSelect=!1,t.push(m.sounds[i]));m.sounds=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MOHSOUND",g.mohSound=angular.copy(l),g.mohSounds=r,g.newMohSound=!1,g.mohSound||(g.mohSound={},g.title="VOICE.NEW_MOHSOUND",g.newMohSound=!0),n.params.id&&(g.mohSound.VoiceMusicOnHoldId=n.params.id),g.addNewMohSound=function(){g.errors=[],d.voiceMusicOnHold.addSound({id:n.params.id},g.mohSound).$promise.then(function(e){g.mohSounds.unshift(e.toJSON()),o.success({title:"MohSound properly created",msg:g.mohSound.name?g.mohSound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMohSound=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.mohSound.id},g.mohSound).$promise.then(function(e){var n=_.find(g.mohSounds,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"MohSound properly saved!",msg:g.mohSound.name?g.mohSound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMohSound=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMusicOnHold.delete({id:g.mohSound.id}).$promise.then(function(){_.remove(g.mohSounds,{id:g.mohSound.id}),o.success({title:"MohSound properly deleted!",msg:(g.mohSound.name||"mohSound")+" has been deleted!"}),v(g.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){g.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.sounds,{id:e.resourceId})}),t=null;if(g.mohSound&&(t=_.find(g.sounds,{id:Number(g.mohSound.id)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.sounds,{id:t.id});a.canSelect=!1,n.push(a)}g.sounds=n})}else{var t=[],a=null;g.mohSound&&(a=_.find(g.sounds,{id:Number(g.mohSound.id)}));for(var i=0;i<g.sounds.length;i++)a&&g.sounds[i].id===a.id&&(g.sounds[i].canSelect=!1,t.push(g.sounds[i]));g.sounds=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mohSounds","mohSound","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.musiconhold=c||e.params.musiconhold||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds",{},{reload:"app.voice.musiconholds"})},u.saveMusicOnHold=function(){r.voiceMusicOnHold.update({id:u.musiconhold.id},u.musiconhold).$promise.then(function(){l.success({title:"MusicOnHold updated!",msg:u.musiconhold.name?u.musiconhold.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","musiconhold","userProfileSection"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.musiconholds=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="musiconholds",f.listOrder="",f.listOrderAsc=null,f.selectedMusicOnHolds=[],f.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},f.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("musiconhold")+"?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getMusicOnHolds=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMusicOnHold.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="MusicOnHolds",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditMusicOnHold=function(e,n){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:n,musiconholds:f.musiconholds.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteMusicOnHold=y,f.exportSelectedMusicOnHolds=function(){var e=angular.copy(f.selectedMusicOnHolds);return f.selectedMusicOnHolds=[],e},f.deleteSelectedMusicOnHolds=function(e){var n=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+f.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedMusicOnHolds.forEach(function(e){y(e)}),f.selectedMusicOnHolds=[]})},f.deselectMusicOnHolds=function(){f.selectedMusicOnHolds=[]},f.selectAllMusicOnHolds=function(){f.selectedMusicOnHolds=f.musiconholds.rows};var b=!0,A=1;function E(e){f.musiconholds=e||{count:0,rows:[]}}function y(e){m.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(f.musiconholds.rows,{id:e.id}),f.musiconholds.count-=1,f.musiconholds.rows.length||f.getMusicOnHolds(),p.success({title:_.startCase("MusicOnHold")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","musiconholds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(t,e,a,i,n,s,o,r,l){var d=this;function c(t){return e(function(e,n){o.voiceExtension.addApplications({id:t},d.applications?d.applications.rows:[]).$promise.then(function(){e()}).catch(function(e){n(e)})})}function m(e){t.hide(e)}d.currentUser=r.getCurrentUser(),d.crudPermissions=l,d.outboundRoute=angular.copy(s),d.outboundRoutes=n,d.newOutboundRoute=!1,d.hasModulePermissions={},d.errors=[],d.initialize=function(){d.outboundRoute||(d.outboundRoute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},d.newOutboundRoute=!0);e=[{key:"name",value:d.outboundRoute.context}],o.getResourcesByRole(d.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){d.contexts=e}).catch(function(){i.error({title:a.instant("VOICE.CONTEXTS"),msg:a.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},d.getRouting=function(){if(d.newOutboundRoute)return;var e={sort:"priority",VoiceExtensionId:d.outboundRoute.id,isApp:!0,nolimit:!0};o.voiceExtension.get(e).$promise.then(function(e){d.applications=e||{count:0,rows:[]}})},d.addNewOutboundRoute=function(){d.errors=[],o.voiceExtension.save(d.outboundRoute).$promise.then(function(e){c(e.id).then(function(){d.outboundRoutes.unshift(e.toJSON()),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_CREATED_SUCCESS_TITLE")}),m(e)})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var n=0;n<e.data.errors.length;n+=1)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.saveOutboundRoute=function(){d.errors=[],o.voiceExtension.update({id:d.outboundRoute.id},d.outboundRoute).$promise.then(function(e){var n=_.find(d.outboundRoutes,{id:e.id});if(n&&_.merge(n,e.toJSON()),d.applications)return c(d.outboundRoute.id)}).then(function(){i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")}),m(s)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.deleteOutboundRoute=function(e){d.errors=[];var n=t.confirm().title(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:d.outboundRoute.exten})).ariaLabel("Delete outbound route").ok(a.instant("TOOLS.DELETE")).cancel(a.instant("TOOLS.CANCEL")).targetEvent(e);t.show(n).then(function(){o.voiceExtension.delete({id:d.outboundRoute.id}).$promise.then(function(){_.remove(d.outboundRoutes,{id:d.outboundRoute.id}),i.success({title:a.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")}),m(d.outboundRoute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var n=0;n<e.data.errors.length;n++)i.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},d.closeDialog=m}e.$inject=["$mdDialog","$q","$translate","toasty","outboundRoutes","outboundRoute","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(e,i,a,n,s,o,r,t,l,d,c){var m=this;function u(e,n){1===m.applications.rows.length&&1===n&&(n=0);var t=m.applications.rows[n];i.show({controller:"EditRoutingAppDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/dialog.html",parent:angular.element(a.body),targetEvent:e,locals:{application:t,route:m.outboundRoute,crudPermissions:m.crudPermissions}}).then(function(e){e?(m.applications.rows[n].appdata===e.appdata&&"custom"!==e.appType||p(),m.applications.rows[n]=e):t.id||m.applications.rows.splice(n,1)}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}function p(){m.pendingChanges=!0}m.currentUser=t.getCurrentUser(),m.outboundRoute=l||e.params.outboundRoute||{},m.contexts=d,m.userProfileSection=c&&1==c.count?c.rows[0]:null,m.crudPermissions=t.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={sort:"priority",VoiceExtensionId:m.outboundRoute.id,isApp:!0,nolimit:!0},m.apps=[{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",options:"xX",interval:"*,*,*,*"},{app:null,appType:"custom",type:"Outbound",interval:"*,*,*,*"}],m.sortableAppsOptions={group:{name:"apps",pull:"clone",put:!1},animation:100,sort:!1},m.sortableRoutingOptions={group:{name:"apps",put:!0},animation:100,disabled:!m.crudPermissions.canEdit,onAdd:function(e){u(e,e.newIndex)},onUpdate:function(){p()}},m.selectedApplications=[],m.onInit=function(){if(t.isAdmin())return;e=[{key:"name",value:m.outboundRoute.context}],o.getResourcesByRole(m.currentUser,"voiceContext",{fields:"id,name",sort:"name",nolimit:!0},e).then(function(e){m.contexts=e}).catch(function(){r.error({title:s.instant("VOICE.CONTEXTS"),msg:s.instant("VOICE.NOTIFICATIONS.VOICE_CONTEXTS_GET_ERROR")})});var e},m.onActionsTabSelection=function(){m.applications||o.voiceExtension.get(m.query).$promise.then(function(e){m.applications=e||{count:0,rows:[]}})},m.gotoOutboundRoutes=function(){e.go("app.voice.outboundRoutes",{},{reload:"app.voice.outboundRoutes"})},m.saveOutboundRoute=function(){o.voiceExtension.update({id:m.outboundRoute.id},m.outboundRoute).$promise.then(function(){n(function(n,t){if(!m.applications)return n();o.voiceExtension.addApplications({id:m.outboundRoute.id},m.applications.rows).$promise.then(function(e){m.applications.rows=e.rows,n()}).catch(function(e){t(e)})}).then(function(){m.pendingChanges=!1,r.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_SAVED_SUCCESS_TITLE")})})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.editApplication=u,m.editInterval=function(e,n){var t=m.applications.rows[n];i.show({controller:"EditRoutingIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/routing/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:void 0,crudPermissions:m.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,p())})},m.deleteApplication=function(e,n,t){var a=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATION_DELETE_MESSAGE",{name:e.app})).ariaLabel("Delete application").targetEvent(t).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(a).then(function(){m.applications.rows.splice(n,1),p()})},m.deleteSelectedApplications=function(e){var n=i.confirm().title(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.ROUTING_APPLICATIONS_DELETE_MESSAGE",{total:m.selectedApplications.length})).ariaLabel("Delete applications").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedApplications.forEach(function(e){_.remove(m.applications.rows,{id:e.id})}),m.selectedApplications=[],p()})}}e.$inject=["$state","$mdDialog","$document","$q","$translate","api","toasty","Auth","outboundRoute","contexts","userProfileSection"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){g.outboundRoutes=e||{count:0,rows:[]}}function h(){g.query.offset=(g.query.page-1)*g.query.limit,m.isAdmin()?g.promise=d.voiceExtension.get(g.query,v).$promise:(g.query.id=g.userProfile.id,g.query.section="OutboundRoutes",g.promise=d.userProfile.getResources(g.query,v).$promise)}function f(e){d.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(g.outboundRoutes.rows,{id:e.id}),g.outboundRoutes.count-=1,g.outboundRoutes.rows.length||h(),c.success({title:s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var n=0;n<e.data.errors.length;n++)c.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}g.license=u,g.setting=p,g.currentUser=m.getCurrentUser(),g.outboundRoutes=o,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=m.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.selectedOutboundRoutes=[],g.query={fields:"id,appdata,type,exten,context,description,alias,createdAt,updatedAt",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},g.editRoute=function(e){n.go("app.voice.outboundRoutes.edit",{id:e.id,outboundRoute:e,crudPermissions:g.crudPermissions})},g.createOrEditOutboundRoute=function(e,n){a.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundRoutes/create/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundRoute:n,outboundRoutes:g.outboundRoutes.rows,crudPermissions:g.crudPermissions}})},g.success=v,g.getOutboundRoutes=h,g.deleteConfirm=function(e,n){var t=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSION_DELETE_MESSAGE",{name:e.exten})).ariaLabel("Delete extension").targetEvent(n).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(t).then(function(){f(e)})},g.exportSelectedOutboundRoutes=function(){var e=angular.copy(g.selectedOutboundRoutes);return g.selectedOutboundRoutes=[],e},g.deleteSelectedOutboundRoutes=function(e){var n=a.confirm().title(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_TITLE")).content(s.instant("VOICE.NOTIFICATIONS.EXTENSIONS_DELETE_MESSAGE",{total:g.selectedOutboundRoutes.length})).ariaLabel("Delete extensions").targetEvent(e).ok("OK").cancel(s.instant("TOOLS.CANCEL"));a.show(n).then(function(){g.selectedOutboundRoutes.forEach(function(e){f(e)}),g.selectedOutboundRoutes=[]})};var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?i(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())})}e.$inject=["$scope","$state","$mdDialog","$document","$timeout","$translate","outboundRoutes","userProfile","userProfileSection","api","toasty","Auth","license","setting"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){return[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Agent",key:"lastAssignedTo",type:"select",label:"DASHBOARDS.SELECT_AGENT",options:g.agents.rows,customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}],ngValue:"name"},{name:"Campaign",key:"queue",type:"multiselect",label:"DASHBOARDS.SELECT_CAMPAIGN",options:g.queues.rows,ngValue:"name"}]}function h(){return g.refresh=!1,0===g.queues.count?f(null):(g.query.queue=1===g.queues.count?g.queues.rows[0].name:g.query.queue,void 0===g.query.queue&&(g.query.queue=_.map(g.queues.rows,"name")),_.isEmpty(g.query.queue)?f(null):(g.query.offset=(g.query.page-1)*g.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id,JSON.stringify({query:_.omit(g.query,"queue")})),void(g.promise=o.voiceQueueReport.getVoiceQueuesReport(g.query,f).$promise)))}function f(e){g.abandonedCalls=e||{count:0,rows:[]},g.refresh=!0}g.currentUser=d.getCurrentUser(),g.agents=u||[],g.dispositions=p.rows,g.abandonedCalls={count:0,rows:[]},g.showTooltip=!1,g.refresh=!0,g.userProfile=r,g.userProfileSection=l&&1==l.count?l.rows[0]:null,g.crudPermissions=d.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),g.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition,secondDisposition,thirdDisposition,note",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-createdAt",limit:10,page:1},g.getAbandonedCalls=h,g.refreshAbandonedCalls=function(){g.showTooltip=!1,h()},g.assignTo=function(e,n){e&&o.voiceQueueReport.update({id:e.id,lastAssignedTo:n?n.name:null,assigned:!!n}).$promise.catch(function(){})},g.dispose=function(t){n.show({controller:"DisposeAbandonedCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",parent:angular.element(a.body),targetEvent:t,locals:{dispositions:g.dispositions,call:t}}).then(function(e){if(e){var n={id:t.id,disposition:e.firstLevel||null,secondDisposition:e.secondLevel||null,thirdDisposition:e.thirdLevel||null,note:e.note||null};o.voiceQueueReport.update(n).$promise.catch(function(){})}})},g.onSaveVoiceQueueReport=function(e){e&&g.queuesMap&&"inbound"===g.query.type&&g.queuesMap[e.queue]&&(g.showTooltip=!0)},g.onUpdateVoiceQueueReport=function(e){if(e){var n=_.findIndex(g.abandonedCalls.rows,["id",e.id]);0<=n&&_.merge(g.abandonedCalls.rows[n],e)}},c.onWithoutApply("voiceQueueReport:save",g.onSaveVoiceQueueReport),c.on("voiceQueueReport:update",g.onUpdateVoiceQueueReport),function(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.abandonedCalls:"+g.currentUser.id);if(e)(e=JSON.parse(e))&&e.query&&(g.query=_.merge(e.query,_.omit(g.query,["sort","limit","page"])),g.query=_.omit(g.query,"filter"));else{var n={$gte:moment().startOf("month").utcOffset(0,!0).format(),$lte:moment().endOf("month").utcOffset(0,!0).format()};g.query.createdAt=n}d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(){}).finally(function(){g.quickFilters=v(),h()}):o.userProfile.getResources({id:g.currentUser.userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){g.queues=e||{count:0,rows:[]},g.queuesMap=_.mapValues(_.keyBy(g.queues.rows,"name"),"name")}).catch(function(){}).finally(function(){g.quickFilters=v(),h()})}();var b=!0,A=1;e.$watch("vm.query.filter",function(e,n){b?t(function(){b=!1}):(n||(A=g.query.page),e!==n&&(g.query.page=1),e||(g.query.page=A),h())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","agents","dispositions"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.calls=i||{rows:[],count:0},o.query={limit:10,page:1},o.channelStatus=s.OUTGOING_CALL_STATUS_STYLES,o.onSave=function(e){var n=_.find(o.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",n?_.merge(n,e):e.channel&&o.calls.rows.push(e)},o.onRemove=function(e){var n=_.findIndex(o.calls.rows,{channel:e.channel});0<=n&&(o.calls.rows[n].status="hangup");t(function(){o.calls.rows.splice(n,1)},5e3)},a.on("voice_outbound_channel:save",o.onSave),a.on("voice_outbound_channel:remove",o.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","realtimeManager"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=["total","answered","unmanaged","abandoned","sumHoldTime","sumDuration","sumBillable"];function u(){c.queues.rows.forEach(function(e){c.rpcQueues[e.id]&&_.merge(e,_.pick(c.rpcQueues[e.id],m))})}c.queues=a||{rows:[],count:0},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"inbound",fields:"id,name",sort:"name",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"name",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="VoiceQueues",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){var n=_.find(c.queues.rows,["id",e.id]);n&&_.merge(n,_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=n(function(){},999);var p=!0,g=1;function v(e){c.queues=e||{count:0,rows:[]},u()}e.$watch("vm.query.filter",function(e,n){p?t(function(){p=!1}):(n||(g=c.query.page),e!==n&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&n.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n){var a=this;switch(a.selectedTab=0,t.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,t.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.voice.realtime.agents");break;case 1:t.go("app.voice.realtime.telephones");break;case 2:t.go("app.voice.realtime.trunks");break;case 3:t.go("app.voice.realtime.queues");break;case 4:t.go("app.voice.realtime.queue_calls");break;case 5:t.go("app.voice.realtime.abandonedcalls");break;case 6:t.go("app.voice.realtime.queue_params");break;case 7:t.go("app.voice.realtime.outbound_calls");break;default:t.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c){var m=this,u=["fullname","internal","state","status"];function p(){_.forIn(m.telephones,function(e,n){m.rpcTelephones[n]&&_.merge(e,_.pick(m.rpcTelephones[n],u))})}m.count=a.count,m.telephones=a?a.rows:{},m.rpcTelephones=i?i.rows:{},m.userProfile=l,m.userProfileSection=d&&1==d.count?d.rows[0]:null,m.crudPermissions=c.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={fields:"id,fullname,internal",role:"telephone",sort:"fullname",limit:10,page:1},m.statusClass=r.STATUS_STYLES,m.stateClass=r.STATES_STYLES,m.success=h,m.$onInit=p,m.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},m.getTelephones=function(){m.query.offset=(m.query.page-1)*m.query.limit,c.hasRole("admin")?m.promise=s.user.get(m.query,h).$promise:(m.query.id=m.userProfile.id,m.query.section="Telephones",m.promise=s.userProfile.getResources(m.query,h).$promise)},m.onSave=function(e){m.telephones[e.id]&&_.merge(m.telephones[e.id],_.pick(e,u))},o.on("telephone:save",m.onSave);var g=!0,v=1;function h(e){m.telephones=e?e.rows:{},p()}e.$watch("vm.query.filter",function(e,n){g?t(function(){g=!1}):(n||(v=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=v),m.getTelephones())}),e.$on("$destroy",function(){o.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","realtimeManager","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,n=0;n<u.trunks.length;n+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[n].id]))&&_.merge(u.trunks[n],_.pick(u.rpcTrunks[e],p))}function v(e,n,t){0<=n&&_.merge(e[n],_.pick(t,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"name",limit:10,page:1},u.statusClass=r.STATUS_STYLES,u.stateClass=r.STATES_STYLES,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,n){l.go("app.tools.trunks.edit",{id:n.id})},u.onSave=function(e){var n=_.findIndex(u.trunks,["id",e.id]),t=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,n,e),v(u.rpcTrunks,t,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,n){h?t(function(){h=!1}):(n||(f=u.query.page),e!==n&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","realtimeManager","$state","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEMAIL",g.voicemail=angular.copy(l),g.voicemails=r,g.newVoicemail=!1,g.voicemail||(g.voicemail={attach:"no"},g.title="VOICE.NEW_VOICEMAIL",g.newVoicemail=!0),g.addNewVoicemail=function(){g.errors=[],d.voiceMail.save(g.voicemail).$promise.then(function(e){g.voicemails.unshift(e.toJSON()),o.success({title:"Voicemail properly created",msg:g.voicemail.name?g.voicemail.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoicemail=function(){g.errors=[],d.voiceMail.update({id:g.voicemail.id},g.voicemail).$promise.then(function(e){var n=_.find(g.voicemails,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"Voicemail properly saved!",msg:g.voicemail.name?g.voicemail.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoicemail=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceMail.delete({id:g.voicemail.id}).$promise.then(function(){_.remove(g.voicemails,{id:g.voicemail.id}),o.success({title:"Voicemail properly deleted!",msg:(g.voicemail.name||"voicemail")+" has been deleted!"}),v(g.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicemails","voicemail","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.voicemailMessages=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.voiceMail.getMessages(m.query,u).$promise}function g(e){d.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(m.voicemailMessages.rows,{id:e.id}),m.voicemailMessages.count-=1,m.voicemailMessages.rows.length||p(),l.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.voicemail={},m.voicemailMessages={count:0,rows:[]},m.selectedVoicemailMessages=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},m.init=function(e,n){m.voicemail=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.id=m.voicemail.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("message #")+e.id||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.voiceMailMessageDownload=function(s,e,n){return d.voiceMailMessage.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="message"+s.id,a=new Blob(n,{type:e.type});t=s.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=u,m.getVoicemailMessages=p,m.createOrEditVoicemailMessage=function(e,n){o.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:m.voicemail,message:n,messages:m.voicemailMessages.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedVoicemailMessages=function(){var e=angular.copy(m.selectedVoicemailMessages);return m.selectedVoicemailMessages=[],e},m.deleteVoicemailMessage=g,m.deleteSelectedVoicemailMessages=function(e){var n=o.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+m.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedVoicemailMessages.forEach(function(e){g(e)}),m.selectedVoicemailMessages=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.voicemail=c||e.params.voicemail||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVoicemails=function(){e.go("app.voice.voicemails",{},{reload:"app.voice.voicemails"})},u.saveVoicemail=function(){r.voiceMail.update({id:u.voicemail.id},u.voicemail).$promise.then(function(){l.success({title:"Voicemail updated!",msg:u.voicemail.name?u.voicemail.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),t=null;if(u.voicemail&&(t=_.find(u.contexts,{name:u.voicemail.context})),t&&!_.some(n,["id",t.id])){var a=_.find(u.contexts,{id:t.id});a.canSelect=!1,n.push(a)}u.contexts=n}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voicemail","userProfileSection"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicemails=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicemails",f.listOrder="",f.listOrderAsc=null,f.selectedVoicemails=[],f.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},f.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voicemails.edit",{id:e.id,voicemail:e,crudPermissions:f.crudPermissions})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicemail")+"?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicemails=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceMail.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="Voicemails",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoicemail=function(e,n){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:n,voicemails:f.voicemails.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteVoicemail=y,f.exportSelectedVoicemails=function(){var e=angular.copy(f.selectedVoicemails);return f.selectedVoicemails=[],e},f.deleteSelectedVoicemails=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+f.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicemails.forEach(function(e){y(e)}),f.selectedVoicemails=[]})},f.deselectVoicemails=function(){f.selectedVoicemails=[]},f.selectAllVoicemails=function(){f.selectedVoicemails=f.voicemails.rows};var b=!0,A=1;function E(e){f.voicemails=e||{count:0,rows:[]}}function y(e){m.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(f.voicemails.rows,{id:e.id}),f.voicemails.count-=1,f.voicemails.rows.length||f.getVoicemails(),p.success({title:_.startCase("Voicemail")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicemails","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEPREFIX",g.voicePrefix=angular.copy(l),g.voicePrefixes=r,g.newvoicePrefix=!1,g.voicePrefix||(g.voicePrefix={},g.title="VOICE.NEW_VOICEPREFIX",g.newvoicePrefix=!0),g.addNewvoicePrefix=function(){g.errors=[],d.voicePrefix.save(g.voicePrefix).$promise.then(function(e){g.voicePrefixes.unshift(e.toJSON()),o.success({title:"voicePrefix properly created",msg:g.voicePrefix.name?g.voicePrefix.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savevoicePrefix=function(){g.errors=[],d.voicePrefix.update({id:g.voicePrefix.id},g.voicePrefix).$promise.then(function(e){var n=_.find(g.voicePrefixes,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"voicePrefix properly saved!",msg:g.voicePrefix.name?g.voicePrefix.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletevoicePrefix=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voicePrefix will be deleted.").ariaLabel("Delete voicePrefix").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voicePrefix.delete({id:g.voicePrefix.id}).$promise.then(function(){_.remove(g.voicePrefixes,{id:g.voicePrefix.id}),o.success({title:"voicePrefix properly deleted!",msg:(g.voicePrefix.name||"voicePrefix")+" has been deleted!"}),v(g.voicePrefix)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.outboundRoutes,{id:e.resourceId})}),t=null;if(g.voicePrefix&&(t=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}g.outboundRoutes=n})}else{var t=[],a=null;g.voicePrefix&&(a=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)}));for(var i=0;i<g.outboundRoutes.length;i++)a&&g.outboundRoutes[i].id===a.id&&(g.outboundRoutes[i].canSelect=!1,t.push(g.outboundRoutes[i]));g.outboundRoutes=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicePrefixes","voicePrefix","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditvoicePrefixDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getAgents({id:c.voicePrefix.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UservoicePrefix?"penalty "+e.UservoicePrefix.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.voicePrefix=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addAgents({id:c.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("VOICE.ALL_AGENTS"),labelSelected:r.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","voicePrefixes","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.voicePrefix.getTeams({id:l.voicePrefix.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voicePrefix=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.removeTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.voicePrefix.addTeams({id:l.voicePrefix.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voicePrefixes=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voicePrefixes",f.listOrder="",f.listOrderAsc=null,f.selectedVoicePrefixes=[],f.query={fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",sort:"-updatedAt",limit:10,page:1},f.editdialog=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:null,crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"voicePrefixagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.teamadddialog=function(e,n){i.show({controller:"voicePrefixteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:f.voicePrefixes?f.voicePrefixes.rows:[],crudPermissions:f.crudPermissions}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voicePrefix")+"?").htmlContent("<b>"+(e.name||"voicePrefix")+"</b> will be deleted.").ariaLabel("delete voicePrefix").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getVoicePrefixes=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voicePrefix.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoicePrefixes",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditvoicePrefix=function(e,n){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicePrefix:n,voicePrefixes:f.voicePrefixes.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deletevoicePrefix=y,f.exportSelectedVoicePrefixes=function(){var e=angular.copy(f.selectedVoicePrefixes);return f.selectedVoicePrefixes=[],e},f.deleteSelectedVoicePrefixes=function(e){var n=i.confirm().title("Are you sure want to delete the selected voicePrefixes?").htmlContent("<b>"+f.selectedVoicePrefixes.length+" selected</b> will be deleted.").ariaLabel("delete voicePrefixs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoicePrefixes.forEach(function(e){y(e)}),f.selectedVoicePrefixes=[]})},f.deselectVoicePrefixes=function(){f.selectedVoicePrefixes=[]},f.selectAllVoicePrefixes=function(){f.selectedVoicePrefixes=f.voicePrefixes.rows},g.hasRole("admin")?m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){f.outboundRoutes=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.outboundRoutes,{id:e.resourceId})}),t=null;if(f.voicePrefix&&(t=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.outboundRoutes,{id:t.id});a.canSelect=!1,n.push(a)}f.outboundRoutes=n})}else{var t=[],a=null;f.voicePrefix&&(a=_.find(f.outboundRoutes,{id:Number(f.voicePrefix.VoiceExtensionId)}));for(var i=0;i<f.outboundRoutes.length;i++)a&&f.outboundRoutes[i].id===a.id&&(f.outboundRoutes[i].canSelect=!1,t.push(f.outboundRoutes[i]));f.outboundRoutes=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.voicePrefixes=e||{count:0,rows:[]}}function y(e){m.voicePrefix.delete({id:e.id}).$promise.then(function(){_.remove(f.voicePrefixes.rows,{id:e.id}),f.voicePrefixes.count-=1,f.voicePrefixes.rows.length||f.getVoicePrefixes(),p.success({title:_.startCase("voicePrefix")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoicePrefix"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoicePrefix",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoicePrefixes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicePrefixes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoicePrefixesController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="VOICE.EDIT_VOICEQUEUE",r.voiceQueue=angular.copy(n),r.voiceQueues=e,r.newVoiceQueue=!1,r.voiceQueue||(r.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},r.title="VOICE.NEW_VOICEQUEUE",r.newVoiceQueue=!0),r.addNewVoiceQueue=function(){r.errors=[],i.voiceQueue.save(r.voiceQueue).$promise.then(function(e){r.voiceQueues.unshift(e.toJSON()),a.success({title:"VoiceQueue properly created",msg:r.voiceQueue.name?r.voiceQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveVoiceQueue=function(){r.errors=[],i.voiceQueue.update({id:r.voiceQueue.id},r.voiceQueue).$promise.then(function(e){var n=_.find(r.voiceQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"VoiceQueue properly saved!",msg:r.voiceQueue.name?r.voiceQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteVoiceQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.voiceQueue.delete({id:r.voiceQueue.id}).$promise.then(function(){_.remove(r.voiceQueues,{id:r.voiceQueue.id}),a.success({title:"VoiceQueue properly deleted!",msg:(r.voiceQueue.name||"voiceQueue")+" has been deleted!"}),l(r.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","voiceQueues","voiceQueue","api","Auth","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,l,a,d,n,t,i,s,o,r){var c=this;function m(){return l(function(t,n){return l(function(n,t){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(n,t){return d.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),l(function(n,t){return d.voiceQueue.getAgents({id:c.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=o.getCurrentUser(),c.voiceQueue=n,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(t,n){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,l(function(e,n){_.isEmpty(t)?e():d.voiceQueue.removeAgents({id:c.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return r=n,l(function(e,n){if(_.isEmpty(r))e();else{for(var t=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);t.push(d.voiceQueue.addAgents({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(t).then(function(){e()}).catch(function(e){n(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var t=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,i,a,s,n,t,o,r){var l=this;function d(){return i(function(t,n){return i(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:i(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),i(function(n,t){return s.voiceQueue.getTeams({id:l.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.voiceQueue=n,l.crudPermissions=r,l.penalty=0,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"penalty",labelAll:t.instant("VOICE.ALL_TEAMS"),labelSelected:t.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,n){n?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+l.penalty});var t=_.xorWith(l.startingSelectedItems,l.selectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):i(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceWith(l.selectedItems,l.startingSelectedItems,function(e,n){return e.id===n.id&&e.penalty===n.penalty});return(t=e,i(function(e,n){_.isEmpty(t)?e():s.voiceQueue.removeTeams({id:l.voiceQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return a=n,i(function(e,n){if(!_.isEmpty(a)){var t=_.map(a,function(e){return{id:e.id,penalty:_.trim(e.penalty,"penalty ")}});return s.voiceQueue.addTeams({id:l.voiceQueue.id,teams:t}).$promise.then(function(){e()}).catch(function(e){n(e)})}e()});var a}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(t,e,a,i,s,n,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=n,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.voiceQueue=c||t.params.voiceQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=t.params.tab||0,u.teamadddialog=function(e,n){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.gotogoto=function(e,n){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},u.alert=l.info,u.gotoVoiceQueues=function(){t.go("app.voice.voiceQueues",{},{reload:"app.voice.voiceQueues"})},u.saveVoiceQueue=function(){r.voiceQueue.update({id:u.voiceQueue.id},u.voiceQueue).$promise.then(function(){l.success({title:"VoiceQueue updated!",msg:u.voiceQueue.name?u.voiceQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;return n?n.autoAssociation?void 0:r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),t=null;if(u.voiceQueue&&(t=_.find(u.musiconholds,{name:u.voiceQueue.musiconhold})),t&&!_.some(n,["id",t.id])){var a=_.find(u.musiconholds,{id:t.id});a.canSelect=!1,n.push(a)}u.musiconholds=n}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.sounds,{id:e.resourceId})});u.sounds.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.sounds=n})}else u.sounds=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),u.pauses=n})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceQueue","userProfileSection"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.voiceQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="voiceQueues",f.listOrder="",f.listOrderAsc=null,f.selectedVoiceQueues=[],f.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,servicelevel,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayjoinempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'no'"},{option:"yes",value:"'yes'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'yes'"},{option:"strict",value:"'strict'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'strict'"},{option:"loose",value:"'loose'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'loose'"},{option:"paused",value:"'paused'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'paused'"},{option:"penalty",value:"'penalty'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'penalty'"},{option:"inuse",value:"'inuse'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'inuse'"},{option:"ringing",value:"'ringing'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'ringing'"},{option:"unavailable",value:"'unavailable'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unavailable'"},{option:"invalid",value:"'invalid'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'invalid'"},{option:"unknown",value:"'unknown'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'unknown'"},{option:"wrapup",value:"'wrapup'",disabled:"vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === 'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:f.voiceQueues?f.voiceQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceQueue")+"?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.voice.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.voice.realtime.queues",{})}},f.success=E,f.getVoiceQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.voiceQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="VoiceQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditVoiceQueue=function(e,n){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:n,voiceQueues:f.voiceQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteVoiceQueue=y,f.exportSelectedVoiceQueues=function(){var e=angular.copy(f.selectedVoiceQueues);return f.selectedVoiceQueues=[],e},f.deleteSelectedVoiceQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+f.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedVoiceQueues.forEach(function(e){y(e)}),f.selectedVoiceQueues=[]})},f.deselectVoiceQueues=function(){f.selectedVoiceQueues=[]},f.selectAllVoiceQueues=function(){f.selectedVoiceQueues=f.voiceQueues.rows};var b=!0,A=1;function E(e){f.voiceQueues=e||{count:0,rows:[]}}function y(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.voiceQueues.rows,{id:e.id}),f.voiceQueues.count-=1,f.voiceQueues.rows.length||f.getVoiceQueues(),p.success({title:_.startCase("VoiceQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICERECORDING",g.voiceRecording=angular.copy(l),g.voiceRecordings=r,g.newVoiceRecording=!1,g.voiceRecording||(g.voiceRecording={},g.title="VOICE.NEW_VOICERECORDING",g.newVoiceRecording=!0),g.addNewVoiceRecording=function(){g.errors=[],d.voiceRecording.save(g.voiceRecording).$promise.then(function(e){g.voiceRecordings.unshift(e.toJSON()),o.success({title:"VoiceRecording properly created",msg:g.voiceRecording.name?g.voiceRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceRecording=function(){g.errors=[],d.voiceRecording.update({id:g.voiceRecording.id},g.voiceRecording).$promise.then(function(e){var n=_.find(g.voiceRecordings,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"VoiceRecording properly saved!",msg:g.voiceRecording.name?g.voiceRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceRecording=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.voiceRecording.delete({id:g.voiceRecording.id}).$promise.then(function(){_.remove(g.voiceRecordings,{id:g.voiceRecording.id}),o.success({title:"VoiceRecording properly deleted!",msg:(g.voiceRecording.name||"voiceRecording")+" has been deleted!"}),v(g.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,n){var t=this;t.voiceRecording={},t.init=function(e){t.voiceRecording=e}}e.$inject=["api","toasty"],angular.module("app.voice").controller("VoiceRecordingSentimentStatisticsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.voiceRecording=c||e.params.voiceRecording||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.alert=l.info,p.gotoVoiceRecordings=function(){e.go("app.voice.voiceRecordings",{},{reload:"app.voice.voiceRecordings"})},p.saveVoiceRecording=function(){r.voiceRecording.update({id:p.voiceRecording.id},p.voiceRecording).$promise.then(function(){l.success({title:"VoiceRecording updated!",msg:p.voiceRecording.name?p.voiceRecording.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceRecording","userProfile","userProfileSection"],angular.module("app.voice").controller("VoiceRecordingController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,l,r,d,c,m,u,p,g,v,h,f){var b=this;function A(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!1}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBE_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function E(n,e){return m.voiceRecording.runTranscribe({id:n.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING")+" succeded!"}),n.transcribeStatus=e.transcribeStatus}).catch(function(e){p.error({title:l.instant("VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}function y(e,n){return m.voiceRecording.runTranscribe({id:e.id,runSentiment:!0}).$promise.then(function(e){p.success({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING")+" succeded!"})}).catch(function(e){p.error({title:l.instant("VOICE.RUNSENTIMENT_VOICERECORDING"),msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})}b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceRecordings=r||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceRecordings=[],b.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition,userSecondDisposition,userThirdDisposition,transcribeStatus,fileText,failureReason,sentiment,sPositive,sNegative,sNeutral,sMixed",sort:"-createdAt",createdAt:"@msUtils.firstLastDayMonth()",limit:10,page:1},b.query.createdAt=u.firstLastDayMonth(),b.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE_RANGE"}],b.editstate=function(e,n){t.go("app.voice.voiceRecordings.edit",{id:e.id,voiceRecording:e,crudPermissions:b.crudPermissions})},b.runtranscriberuntranscribesentiment=A,b.runtranscribesentimentruntranscribesentiment=E,b.runsentimentruntranscribesentiment=y,b.downloadtranscribefile2=function(s,e){var t=!1,n=_.isNil(s.format)?s.value.substring(s.value.lastIndexOf(".")):s.format;t=".mp4"===n;-1<s.value.lastIndexOf("/")?s.value.substring(s.value.lastIndexOf("/")+1):-1<s.value.lastIndexOf("\\")?s.value.substring(s.value.lastIndexOf("\\")+1):s.value;return m.voiceRecording.downloadTranscribe({id:s.id}).$promise.then(function(e){var n=[e.buffer],t="download",a=new Blob(n,{type:e.type});t=s.uniqueid+".txt";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.downloadfile2=function(r,e){var t=!1,n=_.isNil(r.format)?r.value.substring(r.value.lastIndexOf(".")):r.format;t=".mp4"===n;-1<r.value.lastIndexOf("/")?r.value.substring(r.value.lastIndexOf("/")+1):-1<r.value.lastIndexOf("\\")?r.value.substring(r.value.lastIndexOf("\\")+1):r.value;return m.voiceRecording.download({id:r.id}).$promise.then(function(e){var n,t,a=[e.buffer],i="download",s=new Blob(a,{type:e.type});n=r.value,t=-1<n.lastIndexOf("/")?n.substring(n.lastIndexOf("/")+1):-1<n.lastIndexOf("\\")?n.substring(n.lastIndexOf("\\")+1):n,i=(t=t.substring(0,t.lastIndexOf(".")))+r.format;var o=window.document.createElement("a");o.setAttribute("href",URL.createObjectURL(s)),o.setAttribute("download",i),document.body.appendChild(o),o.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else"404"===String(e.status)&&!1===t?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.WRONG_EXTENSION")}):"404"===String(e.status)?p.info({title:l.instant("VOICE.CANT_DOWNLOAD_THIS_FILE"),msg:l.instant("VOICE.FILE_NOT_FOUND")}):p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceRecording")+"?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){O(e)},function(){console.log("CANCEL")})},b.success=I,b.getVoiceRecordings=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceRecording.get(b.query,I).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceRecordings",b.promise=m.userProfile.getResources(b.query,I).$promise)},b.createOrEditVoiceRecording=function(e,n){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:n,voiceRecordings:b.voiceRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceRecording=O,b.exportSelectedVoiceRecordings=function(){var e=angular.copy(b.selectedVoiceRecordings);b.selectedVoiceRecordings=[],b.userProfile.privacyEnabled&&_.forEach(e,function(e){e.calleridnum=f.mask(e.calleridnum),e.exten=f.mask(e.exten),e.connectedlinenum=f.mask(e.connectedlinenum),e.membername=f.mask(e.membername)});return e},b.deleteSelectedVoiceRecordings=function(e){var n=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+b.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){b.selectedVoiceRecordings.forEach(function(e){O(e)}),b.selectedVoiceRecordings=[]})},b.deselectVoiceRecordings=function(){b.selectedVoiceRecordings=[]},b.selectAllVoiceRecordings=function(){b.selectedVoiceRecordings=b.voiceRecordings.rows},b.runtranscribeSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){A(e,n)}),b.selectedVoiceRecordings=[]},b.runtranscribesentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){E(e,n)}),b.selectedVoiceRecordings=[]},b.runsentimentSelectedVoiceRecordings=function(n){b.selectedVoiceRecordings.forEach(function(e){y(e,n)}),b.selectedVoiceRecordings=[]};var S=!0,T=1;function I(e){b.voiceRecordings=e||{count:0,rows:[]}}function O(e){m.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceRecordings.rows,{id:e.id}),b.voiceRecordings.count-=1,b.voiceRecordings.rows.length||b.getVoiceRecordings(),p.success({title:_.startCase("VoiceRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){S?o(function(){S=!1}):(n||(T=b.query.page),e!==n&&(b.query.page=1),e||(b.query.page=T),b.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","privacyManager"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(e,t,n){switch(this.selectedTab=0,t.current.name){case"app.whatsapp.realtime.agents":this.selectedTab=0;break;case"app.whatsapp.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,t.go("app.whatsapp.realtime.agents")}e.$watch("vm.selectedTab",function(e,n){if(e!==n)switch(e){case 0:t.go("app.whatsapp.realtime.agents");break;case 1:t.go("app.whatsapp.realtime.queues");break;default:t.go("app.whatsapp.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.whatsapp").controller("WhatsappRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(){"twilio"===g.whatsappAccount.type&&(g.whatsappAccount.baseUrl=null)}function h(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPACCOUNT",g.whatsappAccount=angular.copy(l),g.whatsappAccounts=r,g.newWhatsappAccount=!1,g.whatsappAccount||(g.whatsappAccount={remote:t.protocol()+"://"+t.host()+(t.port()?":"+t.port():""),type:"twilio",notificationSound:!0,queueTransferTimeout:300,waitForTheAssignedAgent:10,waitForTheAssignedQueue:10,agentTransferTimeout:300},g.title="WHATSAPP.NEW_WHATSAPPACCOUNT",g.newWhatsappAccount=!0),n.params.id&&(g.whatsappAccount.WhatsappAccountId=n.params.id),g.addNewWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.save(g.whatsappAccount).$promise.then(function(e){g.whatsappAccounts.unshift(e.toJSON()),o.success({title:"WhatsappAccount properly created",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappAccount=function(){g.errors=[],v(),d.whatsappAccount.update({id:g.whatsappAccount.id},g.whatsappAccount).$promise.then(function(e){var n=_.find(g.whatsappAccounts,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappAccount properly saved!",msg:g.whatsappAccount.name?g.whatsappAccount.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappAccount=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappAccount will be deleted.").ariaLabel("Delete WhatsappAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.whatsappAccount.delete({id:g.whatsappAccount.id}).$promise.then(function(){_.remove(g.whatsappAccounts,{id:g.whatsappAccount.id}),o.success({title:"WhatsappAccount properly deleted!",msg:(g.whatsappAccount.name||"whatsappAccount")+" has been deleted!"}),h(g.whatsappAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappAccount.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=h,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),t=null;if(g.whatsappAccount&&(t=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(g.lists,{id:t.id});a.canSelect=!1,n.push(a)}g.lists=n})}else{var t=[],a=null;g.whatsappAccount&&(a=_.find(g.lists,{id:Number(g.whatsappAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,t.push(g.lists[i]));g.lists=t}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){g.pauses=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return d.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(g.pauses,{id:e.resourceId})});g.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),g.pauses=n})}else g.pauses=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappAccounts","whatsappAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function n(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountApp"+(t.appType||t.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/"+(t.appType||t.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccountApp:t,whatsappAccount:r.whatsappAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.whatsappAccountApps.rows[n]=e:r.whatsappAccountApps.rows.splice(n,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,n=[],t=0;t<r.whatsappAccountApps.rows.length;t++,0){var a=r.whatsappAccountApps.rows[t],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.whatsappAccount.context,a.exten=r.whatsappAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,n=_.concat(n,i,[a],s)}o.whatsappAccount.addApplications({id:r.whatsappAccount.id},_.sortBy(n,"priority")).$promise.then(function(e){r.whatsappAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function t(e){r.whatsappAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.whatsappAccount={},r.whatsappAccountApps={count:0,rows:[]},r.selectedWhatsappAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"WhatsappQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"whatsappQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:2102}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"2"},{option:"Always",value:"0"},{option:"First Message",value:"1"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:2,help:!0}]},{app:"dialogflowV2",appType:"dialogflowv2",type:"dialogflowv2",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"ProjectID",name:"projectId",type:"text",required:!0,param:0},{title:"ClientEmail",name:"clientEmail",type:"text",required:!0,param:1},{title:"PrivateKey",name:"privateKey",type:"textarea",required:!0,param:2},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{value:"'zh-HK'",option:"Chinese (Cantonese)"},{value:"'zh-CN'",option:"Chinese (Simplified)"},{value:"'zh-TW'",option:"Chinese (Traditional)"},{value:"'da'",option:"Danish"},{value:"'nl'",option:"Dutch"},{value:"'en'",option:"English"},{value:"'en-AU'",option:"English (Australia)"},{value:"'en-CA'",option:"English (Canada)"},{value:"'en-GB'",option:"English (Great Britain)"},{value:"'en-IN'",option:"English (India)"},{value:"'en-US'",option:"English (US)"},{value:"'fr'",option:"French"},{value:"'fr-CA'",option:"French (Canada)"},{value:"'fr-FR'",option:"'France (France)"},{value:"'de'",option:"German"},{value:"'hi'",option:"Hindi"},{value:"'id'",option:"Indonesian"},{value:"'it'",option:"Italian"},{value:"'ja'",option:"Japanese"},{value:"'ko'",option:"Korean"},{value:"'no'",option:"Norwegian"},{value:"'pl'",option:"Polish"},{value:"'pt-BR'",option:"Portuguese (Brazil)"},{value:"'pt-PT'",option:"Portuguese (Portugal)"},{value:"'ru'",option:"Russian"},{value:"'es'",option:"Spanish"},{value:"'es-419'",option:"Spanish (Latin America)"},{value:"'es-ES'",option:"Spanish (Spain)"},{value:"'sw'",option:"Swedish"},{value:"'th'",option:"Thai"},{value:"'tr'",option:"Turkish"},{value:"'uk'",option:"Ukrainian"}],required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,required:!1,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){n(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,n){r.whatsappAccount=e,r.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getWhatsappAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,n,t){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(t).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.whatsappAccountApps.rows.splice(n,1),l()},function(){console.log("CANCEL")})},r.getWhatsappAccountApps=function(){r.promise=o.whatsappAccount.getApplications(r.query,t).$promise},r.editWhatsappAccountApp=n,r.editInterval=function(e,n){if(r.whatsappAccountApps.rows.length){var t=r.whatsappAccountApps.rows[n]?r.whatsappAccountApps.rows[n]:r.whatsappAccountApps.rows[0];i.show({controller:"EditWhatsappAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:t.interval,IntervalId:t.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(t.interval=e.interval||"*,*,*,*",t.IntervalId=e.IntervalId||null,l())})}},r.deleteWhatsappAccountApp=function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedWhatsappAccountApps=function(e){var n=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedWhatsappAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){r.selectedWhatsappAccountApps.forEach(function(e){_.remove(r.whatsappAccountApps.rows,{id:e.id})}),r.selectedWhatsappAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappAccount.getAgents({id:c.whatsappAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappAccount?"penalty "+e.UserWhatsappAccount.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappAccount=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.removeAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappAccount.addAgents({id:c.whatsappAccount.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappAccount","whatsappAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappAccountagentaddController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.agent.appdata.split(",");l.agent.projectId=d[0],l.agent.clientEmail=d[1],l.agent.privateKey=d[2],l.agent.language=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){n.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.agents,{name:l.agent.agent});n&&(l.agent.UserId=n.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),t=null;if(l.agent&&(t=_.find(l.agents,{name:l.agent.agent})),t&&!_.some(n,["id",t.id])){var a=_.find(l.agents,{id:t.id});a.canSelect=!1,n.push(a)}l.agents=n})}else{var t=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,t.push(l.agents[i]));l.agents=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppagentDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.amazonlex.appdata.split(",");l.amazonlex.projectId=d[0],l.amazonlex.clientEmail=d[1],l.amazonlex.privateKey=d[2],l.amazonlex.language=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){n.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppamazonlexDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.autoreply.appdata.split(",");l.autoreply.projectId=d[0],l.autoreply.clientEmail=d[1],l.autoreply.privateKey=d[2],l.autoreply.language=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){n.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.close.appdata.split(",");l.close.projectId=d[0],l.close.clientEmail=d[1],l.close.privateKey=d[2],l.close.language=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppcloseDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflow.appdata.split(",");l.dialogflow.projectId=d[0],l.dialogflow.clientEmail=d[1],l.dialogflow.privateKey=d[2],l.dialogflow.language=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){n.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflowv2=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflowv2.appdata)switch(l.dialogflowv2.appType?l.dialogflowv2.appType.toLowerCase():l.dialogflowv2.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.key=d[0],l.dialogflowv2.language=d[1],l.dialogflowv2.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=d[0],l.dialogflowv2.clientEmail=d[1],l.dialogflowv2.privateKey=d[2],l.dialogflowv2.language=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.accesskeyid=d[0],l.dialogflowv2.secretaccesskey=d[1],l.dialogflowv2.lexregion=d[2],l.dialogflowv2.botname=d[3],l.dialogflowv2.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflowv2.appdata.split(",");l.dialogflowv2.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflowv2.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflowv2.text=l.dialogflowv2.appdata;break;case"set":l.dialogflowv2.name=l.dialogflowv2.appdata.split("=")[0],l.dialogflowv2.value=l.dialogflowv2.appdata.split("=")[1];break;case"agi":l.dialogflowv2.project=l.dialogflowv2.appdata;break;default:var c=l.dialogflowv2.appdata.split(",");l.dialogflowv2.projectId=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflowv2.clientEmail=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflowv2.privateKey=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dialogflowv2.language=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.dialogflowv2.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.dialogflowv2.language="en";function m(e){n.hide(e)}l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outbounddial"===l.dialogflowv2.appType.toLowerCase()&&(l.dialogflowv2.prefix=l.dialogflowv2.phone?l.dialogflowv2.phone.split("$")[0]:void 0,l.dialogflowv2.callerId=l.dialogflowv2.callerID?"CALLERID(all)="+l.dialogflowv2.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.dialogflowv2.type&&"outbound"===l.dialogflowv2.type.toLowerCase()&&"outboundDial"===l.dialogflowv2.appType&&(l.dialogflowv2.phone=i.cutdigits?(l.dialogflowv2.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflowv2.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflowv2.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflowv2.options+="U(xcally-mixmonitor-context)"):l.dialogflowv2.options=l.dialogflowv2.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflowv2.appType&&"custom"===l.dialogflowv2.appType);else switch((l.dialogflowv2.app||l.dialogflowv2.appType).toLowerCase()){case"set":l.dialogflowv2.appdata=l.dialogflowv2.name+"="+l.dialogflowv2.value;break;case"custom":break;default:e[0]=l.dialogflowv2.projectId,e[1]=l.dialogflowv2.clientEmail,e[2]=l.dialogflowv2.privateKey,e[3]=l.dialogflowv2.language,e[4]=l.dialogflowv2.welcomemessage,l.dialogflowv2.appdata=e.join(",")}m(l.dialogflowv2)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppdialogflowv2DialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotoif.appdata.split(",");l.gotoif.projectId=d[0],l.gotoif.clientEmail=d[1],l.gotoif.privateKey=d[2],l.gotoif.language=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){n.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.gotop.appdata.split(",");l.gotop.projectId=d[0],l.gotop.clientEmail=d[1],l.gotop.privateKey=d[2],l.gotop.language=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function A(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var n=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),t=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(n+"-"+t)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function E(e){n.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=A(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=A(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),E(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var n=_.find(c.intervals,{id:e.id});n&&_.merge(n,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),E()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=E,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=e&&e.rows?e.rows:[],t=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(n,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,t.push(e))}),c.intervals=t})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditWhatsappAccountAppintervalDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.noop.appdata.split(",");l.noop.projectId=d[0],l.noop.clientEmail=d[1],l.noop.privateKey=d[2],l.noop.language=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppnoopDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.queue.appdata.split(",");l.queue.projectId=d[0],l.queue.clientEmail=d[1],l.queue.privateKey=d[2],l.queue.language=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){n.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.queues,{name:l.queue.queue});n&&(l.queue[_.capitalize("whatsapp")+"QueueId"]=n.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.whatsappQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:2102}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),t=null;if(l.queue&&(t=_.find(l.queues,{name:l.queue.queue})),t&&!_.some(n,["id",t.id])){var a=_.find(l.queues,{id:t.id});a.canSelect=!1,n.push(a)}l.queues=n})}else{var t=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,t.push(l.queues[i]));l.queues=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppqueueDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.system.appdata.split(",");l.system.projectId=d[0],l.system.clientEmail=d[1],l.system.privateKey=d[2],l.system.language=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){n.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),t=null;if(l.system&&(t=_.find(l.variables,{name:l.system.variable})),t&&!_.some(n,["id",t.id])){var a=_.find(l.variables,{id:t.id});a.canSelect=!1,n.push(a)}l.variables=n})}else{var t=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,t.push(l.variables[i]));l.variables=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountAppsystemDialogController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="WHATSAPP.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"dialogflowv2":d=l.tag.appdata.split(",");l.tag.projectId=d[0],l.tag.clientEmail=d[1],l.tag.privateKey=d[2],l.tag.language=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){n.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveWhatsappAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var n=_.find(l.tags,{name:l.tag.tag});n&&(l.tag.TagId=n.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return s.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),t=null;if(l.tag&&(t=_.find(l.tags,{name:l.tag.tag})),t&&!_.some(n,["id",t.id])){var a=_.find(l.tags,{id:t.id});a.canSelect=!1,n.push(a)}l.tags=n})}else{var t=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,t.push(l.tags[i]));l.tags=t}}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","whatsappAccountApp","whatsappAccount","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("EditWhatsappAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,n,t,i,s,o,r,l,d,c){var m=this;function u(e){var n=[{model:"disposition",action:"get",field:"name",params:{field:"name,level",level:e,MailAccountId:"null",SmsAccountId:"null",ChatWebsiteId:"null",OpenchannelAccountId:"null",WhatsappAccountId:"null",FaxAccountId:"null",ListId:"null",nolimit:!0}}],t=[{model:"whatsappAccount",action:"getDispositions",field:"name",params:{id:m.whatsappAccount.id,field:"name,level",level:e,nolimit:!0}}];return _.concat(t,n)}function p(e){m.whatsappAccountInteractions=e||{count:0,rows:[]};for(var n=0;n<m.whatsappAccountInteractions.rows.length;n+=1){var t=m.whatsappAccountInteractions.rows[n];h(t),t.Owner.name=f(t)}}function g(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappInteraction.get(m.query,p).$promise}function v(e){d.whatsappInteraction.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountInteractions.rows,{id:e.id}),m.whatsappAccountInteractions.count-=1,m.whatsappAccountInteractions.rows.length||g(),l.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function h(e){e.Contact?e.contactName=(e.Contact.firstName||"")+" "+(e.Contact.lastName||""):e.contactName=i.instant("DASHBOARDS.UNKNOWN")}function f(e){return e.UserId?e.UserId===m.currentUser.id?i.instant("DASHBOARDS.ME"):e.Owner.fullname+" <"+e.Owner.internal+">":i.instant("DASHBOARDS.NOT_ASSIGNED")}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountInteractions={count:0,rows:[]},m.selectedWhatsappAccountInteractions=[],m.crudPermissions,m.query={read:"null",closed:"null",sort:"-createdAt",includeAll:"true",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.advancedSearch={fields:[{name:"Id",column:"id",type:"number"},{name:"Contact",column:"Contact",type:"autocomplete",options:{searchFields:["firstName","lastName","email"],route:{model:"cmContact",action:"get",params:{fields:"id,firstName,lastName,email",Contact:"@autocomplete",nolimit:!0}},extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Subject",column:"subject",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Body",column:"body",type:"text",options:{excludedOperators:["$eq","$ne"]}},{name:"Status",column:"closed",type:"select",values:[{id:0,translate:"DASHBOARDS.OPENED"},{id:1,translate:"DASHBOARDS.CLOSED"}],options:{excludedOperators:["$ne"]}},{name:"Agent",column:"User",type:"autocomplete",options:{table:"i",route:{model:"user",action:"get",params:{role:"agent",fields:"id,name,fullname",nolimit:!0}},searchFields:["fullname","name"],extraOperators:["$substring"],excludedOperators:["$ne"]}},{name:"Tags",column:"Tag",type:"multiselect",options:{route:{model:"tag",action:"get",params:{nolimit:!0}},excludedOperators:["$notIn"]}},{name:"Start Date",column:"createdAt",type:"date",options:{excludedOperators:["$ne"]}},{name:"Read",column:"unreadMessages",type:"select",values:[{id:1,translate:"DASHBOARDS.READ"},{id:0,translate:"DASHBOARDS.UNREAD"}],options:{excludedOperators:["$ne"]}},{name:"Disposition",column:"disposition",type:"multiselect",options:{routes:u("first")}},{name:"Second Disposition",column:"secondDisposition",type:"multiselect",options:{routes:u("second")}},{name:"Third Disposition",column:"thirdDisposition",type:"multiselect",options:{routes:u("third")}}]},d.tag.get({sort:"name"}).$promise.then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){m.quickFilters=[{name:"Start Date",key:"createdAt",type:"date",label:"DASHBOARDS.SELECT_DATE"},{name:"Messages",key:"read",type:"select",label:"DASHBOARDS.SELECT_READ_UNREAD",customOptions:[{value:0,translate:"DASHBOARDS.UNREAD"},{value:1,translate:"DASHBOARDS.READ"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Status",key:"closed",type:"select",label:"DASHBOARDS.SELECT_STATUS",customOptions:[{value:0,translate:"DASHBOARDS.OPENED"},{value:1,translate:"DASHBOARDS.CLOSED"},{value:null,translate:"DASHBOARDS.ALL"}]},{name:"Agent",key:"UserId",type:"select",label:"DASHBOARDS.SELECT_AGENT",customOptions:[{value:"null",translate:"DASHBOARDS.NOT_ASSIGNED"},{value:void 0,translate:"DASHBOARDS.ALL"}]},{name:"Tag",key:"tag",type:"multiselect",label:"DASHBOARDS.SELECT_TAG",options:m.tags.rows,placeholder:"DASHBOARDS.TAGS"}]})},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("interaction #")+e.id||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){v(e)},function(){console.log("CANCEL")})},m.whatsappInteractionDownload=function(s,e,n){return d.whatsappInteraction.download({id:s.id,exists:!0,attachments:n}).$promise.then(function(e){var n=[e.buffer],t="interaction"+s.id,a=new Blob(n,{type:e.type});t="whatsapp-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",t),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.success=p,m.getWhatsappAccountInteractions=g,m.createOrEditWhatsappAccountInteraction=function(e,n){o.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/interactions/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,interaction:n,interactions:m.whatsappAccountInteractions.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.spywhatsappInteraction=function(e,t){o.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,n){e.vm.init({id:1,channel:"whatsapp",interaction:t,spy:!0},a.$parent.vm.setting)}})},m.openAdvancedSearch=function(){o.show({controller:"AdvancedSearchController",controllerAs:"vm",templateUrl:"app/core/dialogs/advanced-search/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{fields:m.advancedSearch.fields,color:void 0,storagePath:"whatsapp.whatsappAccounts"},fullscreen:!0}).then(function(e){if(m.isSearchBarVisible=!(e.value||!m.query.filter),e.apply){var n="";n+="||WhatsappAccountId:=$eq["+m.whatsappAccount.id+"]",m.query.search=e.value?e.value+=n:e.value,g()}}).catch(function(e){l.error({title:"ERROR",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.exportSelectedWhatsappAccountInteractions=function(){var e=angular.copy(m.selectedWhatsappAccountInteractions);return m.selectedWhatsappAccountInteractions=[],e},m.deleteWhatsappAccountInteraction=v,m.deleteSelectedWhatsappAccountInteractions=function(e){var n=o.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+m.selectedWhatsappAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountInteractions.forEach(function(e){v(e)}),m.selectedWhatsappAccountInteractions=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountInteractionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=d.getCurrentUser(),p.license=s,p.setting=o,p.passwordPattern=p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.location=n.protocol()+"://"+n.host(),p.whatsappAccount=c||e.params.whatsappAccount||{},p.userProfile=m,p.userProfileSection=u&&1==u.count?u.rows[0]:null,p.crudPermissions=d.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.hasModulePermissions={},p.selectedTab=e.params.tab||0,p.baseUrl=[{name:"US Production",url:"https://us1.whatsapp.api.sinch.com"},{name:"EU Production",url:"https://eu1.whatsapp.api.sinch.com"}],p.agentadddialog=function(e,n){t.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:p.whatsappAccounts?p.whatsappAccounts.rows:[],crudPermissions:p.crudPermissions,realtime:!1}})},p.alert=l.info,p.gotoWhatsappAccounts=function(){e.go("app.whatsapp.whatsappAccounts",{},{reload:"app.whatsapp.whatsappAccounts"})},p.saveWhatsappAccount=function(){"twilio"===p.whatsappAccount.type&&(p.whatsappAccount.baseUrl=null);r.whatsappAccount.update({id:p.whatsappAccount.id},p.whatsappAccount).$promise.then(function(){l.success({title:"WhatsappAccount updated!",msg:p.whatsappAccount.name?p.whatsappAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){p.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.lists,{id:e.resourceId})}),t=null;if(p.whatsappAccount&&(t=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(p.lists,{id:t.id});a.canSelect=!1,n.push(a)}p.lists=n})}else{var t=[],a=null;p.whatsappAccount&&(a=_.find(p.lists,{id:Number(p.whatsappAccount.ListId)}));for(var i=0;i<p.lists.length;i++)a&&p.lists[i].id===a.id&&(p.lists[i].canSelect=!1,t.push(p.lists[i]));p.lists=t}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){p.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:p.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return r.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(p.pauses,{id:e.resourceId})});p.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),p.pauses=n})}else p.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappAccount","userProfile","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappAccountController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.whatsappAccountWhatsappCannedAnswers=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=d.whatsappAccount.getAnswers(m.query,u).$promise}function g(e){d.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(m.whatsappAccountWhatsappCannedAnswers.rows,{id:e.id}),m.whatsappAccountWhatsappCannedAnswers.count-=1,m.whatsappAccountWhatsappCannedAnswers.rows.length||p(),l.success({title:"WhatsappCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)l.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.whatsappAccount={},m.whatsappAccountWhatsappCannedAnswers={count:0,rows:[]},m.selectedWhatsappAccountWhatsappCannedAnswers=[],m.crudPermissions,m.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},m.init=function(e,n,t){m.whatsappAccount=e,m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.userProfile=t,m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=o.confirm().title("Are you sure want to delete the whatsappCannedAnswer?").htmlContent("<b>"+(e.name||e.id&&_.upperFirst("whatsappCannedAnswer #")+e.id||"whatsappCannedAnswer")+"</b> will be deleted.").ariaLabel("delete whatsappCannedAnswer").targetEvent(n).ok("OK").cancel("CANCEL");o.show(t).then(function(){g(e)},function(){console.log("CANCEL")})},m.success=u,m.getWhatsappAccountWhatsappCannedAnswers=p,m.createOrEditWhatsappAccountWhatsappCannedAnswer=function(e,n){o.show({controller:"CreateOrEditWhatsappCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:m.whatsappAccount,whatsappCannedAnswer:n,whatsappCannedAnswers:m.whatsappAccountWhatsappCannedAnswers.rows,license:null,setting:null,crudPermissions:m.crudPermissions}})},m.exportSelectedWhatsappAccountWhatsappCannedAnswers=function(){var e=angular.copy(m.selectedWhatsappAccountWhatsappCannedAnswers);return m.selectedWhatsappAccountWhatsappCannedAnswers=[],e},m.deleteWhatsappAccountWhatsappCannedAnswer=g,m.deleteSelectedWhatsappAccountWhatsappCannedAnswers=function(e){var n=o.confirm().title("Are you sure want to delete the selected whatsappCannedAnswers?").htmlContent("<b>"+m.selectedWhatsappAccountWhatsappCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete whatsappCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");o.show(n).then(function(){m.selectedWhatsappAccountWhatsappCannedAnswers.forEach(function(e){g(e)}),m.selectedWhatsappAccountWhatsappCannedAnswers=[]})}}e.$inject=["$cookies","$scope","$state","$q","$translate","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountWhatsappCannedAnswersController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER",g.whatsappCannedAnswer=angular.copy(l),g.whatsappCannedAnswers=r,g.newWhatsappCannedAnswer=!1,g.whatsappCannedAnswer||(g.whatsappCannedAnswer={},g.title="WHATSAPP.NEW_WHATSAPPCANNEDANSWER",g.newWhatsappCannedAnswer=!0),n.params.id&&(g.whatsappCannedAnswer.WhatsappAccountId=n.params.id),g.addNewWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.whatsappCannedAnswer).$promise.then(function(e){g.whatsappCannedAnswers.unshift(e.toJSON()),o.success({title:"WhatsappCannedAnswer properly created",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var n=0;n<e.data.errors.length;n+=1)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveWhatsappCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.whatsappCannedAnswer.id},g.whatsappCannedAnswer).$promise.then(function(e){var n=_.find(g.whatsappCannedAnswers,{id:e.id});n&&_.merge(n,e.toJSON()),o.success({title:"WhatsappCannedAnswer properly saved!",msg:g.whatsappCannedAnswer.name?g.whatsappCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteWhatsappCannedAnswer=function(e){g.errors=[];var n=a.confirm().title("Are you sure?").content("The whatsappCannedAnswer will be deleted.").ariaLabel("Delete WhatsappCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(n).then(function(){d.cannedAnswer.delete({id:g.whatsappCannedAnswer.id}).$promise.then(function(){_.remove(g.whatsappCannedAnswers,{id:g.whatsappCannedAnswer.id}),o.success({title:"WhatsappCannedAnswer properly deleted!",msg:(g.whatsappCannedAnswer.name||"whatsappCannedAnswer")+" has been deleted!"}),v(g.whatsappCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var n=0;n<e.data.errors.length;n++)o.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","whatsappCannedAnswers","whatsappCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(e){m.dispositions=e||{count:0,rows:[]}}function p(){m.query.offset=(m.query.page-1)*m.query.limit,m.promise=l.whatsappAccount.getDispositions(m.query,u).$promise}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){p(),d.success({title:r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETED_SUCCESS_TITLE")})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var n=0;n<e.data.errors.length;n++)d.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}m.currentUser=c.getCurrentUser(),m.dispositions={count:0,rows:[]},m.selectedDispositions=[],m.crudPermissions,m.levels={first:"1st",second:"2nd",third:"3rd"},m.query={fields:"id,level,name,description,ParentId,createdAt,updatedAt",sort:"-updatedAt",limit:10,page:1},m.init=function(e,n){m.whatsappAccount=e||{},m.crudPermissions=void 0!==n?n:{readOnly:!0,canEdit:!1,canDelete:!1},m.query.WhatsappAccountId=m.whatsappAccount.id,m.query.id=m.whatsappAccount.id,p()},m.deleteConfirm=function(e,n){var t=_.some(m.dispositions.rows,["ParentId",e.id]),a=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITION_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS."+(t?"DISPOSITION_DELETE_MESSAGE_CHILDREN":"DISPOSITION_DELETE_MESSAGE"),{name:e.name})).ariaLabel("Delete disposition").targetEvent(n).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(a).then(function(){g(e)})},m.success=u,m.getDispositions=p,m.createOrEditDisposition=function(e,n){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:n,model:{id:m.whatsappAccount.id,field:"WhatsappAccountId",route:"whatsappAccount"},license:null,setting:null,crudPermissions:m.crudPermissions}}).then(function(e){e&&p()})},m.deleteDisposition=g,m.exportSelectedDispositions=function(){var e=angular.copy(m.selectedDispositions);return m.selectedDispositions=[],e},m.deleteSelectedDispositions=function(e){var n=i.confirm().title(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_TITLE")).content(r.instant("TOOLS.NOTIFICATIONS.DISPOSITIONS_DELETE_MESSAGE",{total:m.selectedDispositions.length})).ariaLabel("Delete dispositions").targetEvent(e).ok("OK").cancel(r.instant("TOOLS.CANCEL"));i.show(n).then(function(){m.selectedDispositions.forEach(function(e){g(e)}),m.selectedDispositions=[]})},m.deselectDispositions=function(){m.selectedDispositions=[]},m.selectAllDispositions=function(){m.selectedDispositions=m.dispositions.rows};var v=!0,h=1;e.$watch("vm_dc.query.filter",function(e,n){v?o(function(){v=!1}):(n||(h=m.query.page),e!==n&&(m.query.page=1),e||(m.query.page=h),p())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","api","toasty","Auth"],angular.module("app.whatsapp").controller("WhatsappAccountDispositionsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappAccounts=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappAccounts",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappAccounts=[],f.query={fields:"createdAt,updatedAt,id,name,key,ListId,remote,token,type,accountSid,authToken,phone,receiveUrl,deliveryReportUrl,notificationShake,notificationSound,notificationTemplate,queueTransfer,queueTransferTimeout,waitForTheAssignedAgent,waitForTheAssignedQueue,mandatoryDisposition,mandatoryDispositionPauseId,agentTransfer,agentTransferTimeout,description,baseUrl",sort:"-updatedAt",limit:10,page:1},f.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Sinch",value:"'sinch'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,whatsappAccount:e,crudPermissions:f.crudPermissions})},f.interactionsgoto=function(e,n){t.go("app.whatsapp.whatsappAccounts.edit",{id:e.id,tab:5})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappAccount:e,whatsappAccounts:f.whatsappAccounts?f.whatsappAccounts.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappAccount")+"?").htmlContent("<b>"+(e.name||"whatsappAccount")+"</b> will be deleted.").ariaLabel("delete whatsappAccount").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.success=E,f.getWhatsappAccounts=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappAccount.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappAccounts",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappAccount=function(e,n){i.show({controller:"CreateOrEditWhatsappAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappAccount:n,whatsappAccounts:f.whatsappAccounts.rows,license:f.license,setting:f.setting,crudPermissions:f.crudPermissions}})},f.deleteWhatsappAccount=y,f.exportSelectedWhatsappAccounts=function(){var e=angular.copy(f.selectedWhatsappAccounts);return f.selectedWhatsappAccounts=[],e},f.deleteSelectedWhatsappAccounts=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappAccounts?").htmlContent("<b>"+f.selectedWhatsappAccounts.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappAccounts.forEach(function(e){y(e)}),f.selectedWhatsappAccounts=[]})},f.deselectWhatsappAccounts=function(){f.selectedWhatsappAccounts=[]},f.selectAllWhatsappAccounts=function(){f.selectedWhatsappAccounts=f.whatsappAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.lists,{id:e.resourceId})}),t=null;if(f.whatsappAccount&&(t=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)})),t&&!_.some(n,["id",t.id])){var a=_.find(f.lists,{id:t.id});a.canSelect=!1,n.push(a)}f.lists=n})}else{var t=[],a=null;f.whatsappAccount&&(a=_.find(f.lists,{id:Number(f.whatsappAccount.ListId)}));for(var i=0;i<f.lists.length;i++)a&&f.lists[i].id===a.id&&(f.lists[i].canSelect=!1,t.push(f.lists[i]));f.lists=t}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){f.pauses=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var n=e&&e.rows?e.rows[0]:null;if(n){if(!n.autoAssociation)return m.userProfileResource.get({sectionId:n.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(f.pauses,{id:e.resourceId})});f.pauses.forEach(function(e){_.some(n,["id",e.id])||(e.canSelect=!1),n.push(e)}),f.pauses=n})}else f.pauses=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})});var b=!0,A=1;function E(e){f.whatsappAccounts=e||{count:0,rows:[]}}function y(e){m.whatsappAccount.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappAccounts.rows,{id:e.id}),f.whatsappAccounts.count-=1,f.whatsappAccounts.rows.length||f.getWhatsappAccounts(),p.success({title:_.startCase("WhatsappAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappAccount"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappAccountsController",e)}(),function(){"use strict";function e(t,a,e,n,i,s,o){var r=this;function l(e){t.hide(e)}r.currentUser=s.getCurrentUser(),r.errors=[],r.crudPermissions=o,r.hasModulePermissions={},r.title="WHATSAPP.EDIT_WHATSAPPQUEUE",r.whatsappQueue=angular.copy(n),r.whatsappQueues=e,r.newWhatsappQueue=!1,r.whatsappQueue||(r.whatsappQueue={strategy:"beepall",timeout:10},r.title="WHATSAPP.NEW_WHATSAPPQUEUE",r.newWhatsappQueue=!0),r.addNewWhatsappQueue=function(){r.errors=[],i.whatsappQueue.save(r.whatsappQueue).$promise.then(function(e){r.whatsappQueues.unshift(e.toJSON()),a.success({title:"WhatsappQueue properly created",msg:r.whatsappQueue.name?r.whatsappQueue.name+" has been created!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.save"}];for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.saveWhatsappQueue=function(){r.errors=[],i.whatsappQueue.update({id:r.whatsappQueue.id},r.whatsappQueue).$promise.then(function(e){var n=_.find(r.whatsappQueues,{id:e.id});n&&_.merge(n,e.toJSON()),a.success({title:"WhatsappQueue properly saved!",msg:r.whatsappQueue.name?r.whatsappQueue.name+" has been saved!":""}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.update"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.deleteWhatsappQueue=function(e){r.errors=[];var n=t.confirm().title("Are you sure?").content("The whatsappQueue will be deleted.").ariaLabel("Delete WhatsappQueue").ok("Delete").cancel("Cancel").targetEvent(e);t.show(n).then(function(){i.whatsappQueue.delete({id:r.whatsappQueue.id}).$promise.then(function(){_.remove(r.whatsappQueues,{id:r.whatsappQueue.id}),a.success({title:"WhatsappQueue properly deleted!",msg:(r.whatsappQueue.name||"whatsappQueue")+" has been deleted!"}),l(r.whatsappQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.whatsappQueue.delete"}];for(var n=0;n<e.data.errors.length;n++)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.whatsappQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},r.closeDialog=l}e.$inject=["$mdDialog","toasty","whatsappQueues","whatsappQueue","api","Auth","crudPermissions"],angular.module("app.whatsapp").controller("CreateOrEditWhatsappQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r,l,d){var c=this;function m(){return a(function(t,n){return a(function(n,t){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:c.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return c.allowedItems=_.map(n,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var n=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getAgents({id:c.whatsappQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];c.selectedItems=_.map(n,function(e){var n=_.find(c.items,{id:e.id});return n.penalty=e.UserWhatsappQueue?"penalty "+e.UserWhatsappQueue.penalty:"",n.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",n}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}c.currentUser=l.getCurrentUser(),c.whatsappQueue=n,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),n=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addAgents({id:c.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={items:[],selectedItems:[],orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("WHATSAPP.ALL_AGENTS"),labelSelected:r.instant("WHATSAPP.SELECTED_AGENTS"),transferCallback:function(e,n){var t=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(t)}}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","whatsappQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,n,t,o,r){var l=this;function d(){return a(function(t,n){return a(function(n,t){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(n,t){return s.userProfileResource.get({sectionId:l.section.id,nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})}):null}).then(function(e){var n=e&&e.rows?e.rows:[];return l.allowedItems=_.map(n,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var n=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==n}),a(function(n,t){return s.whatsappQueue.getTeams({id:l.whatsappQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){n(e)}).catch(function(e){t(e)})})}).then(function(e){var n=e&&e.rows?e.rows:[];l.selectedItems=_.map(n,function(e){var n=_.find(l.items,{id:e.id});return n.penalty=e.TeamVoiceQueue?"penalty "+e.TeamVoiceQueue.penalty:"",n}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),t()}).catch(function(e){n(e)})})}l.currentUser=o.getCurrentUser(),l.whatsappQueue=n,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={allowedItems:[],selectedItems:[],orderBy:"name",line1:"name",line2:"",line3:"",labelAll:t.instant("WHATSAPP.ALL_TEAMS"),labelSelected:t.instant("WHATSAPP.SELECTED_TEAMS"),transferCallback:function(e,n){var t=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(t)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(t,n){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;t(n)}).catch(function(e){n(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),n=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(t=e,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.removeTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})})).then(function(){return t=n,a(function(e,n){_.isEmpty(t)?e():s.whatsappQueue.addTeams({id:l.whatsappQueue.id,ids:_.map(t,"id")}).$promise.then(function(){e()}).catch(function(e){n(e)})});var t}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var t},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","whatsappQueue","$translate","Auth","crudPermissions"],angular.module("app.whatsapp").controller("WhatsappQueueteamaddController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=n.protocol()+"://"+n.host(),u.whatsappQueue=c||e.params.whatsappQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,n){t.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,n){t.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:u.whatsappQueues?u.whatsappQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoWhatsappQueues=function(){e.go("app.whatsapp.whatsappQueues",{},{reload:"app.whatsapp.whatsappQueues"})},u.saveWhatsappQueue=function(){r.whatsappQueue.update({id:u.whatsappQueue.id},u.whatsappQueue).$promise.then(function(){l.success({title:"WhatsappQueue updated!",msg:u.whatsappQueue.name?u.whatsappQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETwhatsappQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","whatsappQueue","userProfileSection"],angular.module("app.whatsapp").controller("WhatsappQueueController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h){var f=this;f.license=v,f.setting=h,f.currentUser=g.getCurrentUser(),f.whatsappQueues=l||{count:0,rows:[]},f.userProfile=d,f.userProfileSection=c&&1==c.count?c.rows[0]:null,f.crudPermissions=g.parseCrudPermissions(f.userProfileSection?f.userProfileSection.crudPermissions:null),f.table="whatsappQueues",f.listOrder="",f.listOrderAsc=null,f.selectedWhatsappQueues=[],f.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"whatsapp",limit:10,page:1},f.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),f.editstate=function(e,n){t.go("app.whatsapp.whatsappQueues.edit",{id:e.id,whatsappQueue:e,crudPermissions:f.crudPermissions})},f.teamadddialog=function(e,n){i.show({controller:"WhatsappQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions}})},f.agentadddialog=function(e,n){i.show({controller:"WhatsappQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{whatsappQueue:e,whatsappQueues:f.whatsappQueues?f.whatsappQueues.rows:[],crudPermissions:f.crudPermissions,realtime:!1}})},f.deleteconfirm=function(e,n){var t=i.confirm().title("Are you sure want to delete the "+_.startCase("whatsappQueue")+"?").htmlContent("<b>"+(e.name||"whatsappQueue")+"</b> will be deleted.").ariaLabel("delete whatsappQueue").targetEvent(n).ok("OK").cancel("CANCEL");i.show(t).then(function(){y(e)},function(){console.log("CANCEL")})},f.gotorealtimegoto=function(e,n){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:2110}).$promise.then(function(e){var n=e&&e.rows?e.rows[0]:null;n&&n.enabled?t.go("app.whatsapp.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});t.go("app.whatsapp.realtime.queues",{})}},f.success=E,f.getWhatsappQueues=function(){f.query.offset=(f.query.page-1)*f.query.limit,g.hasRole("admin")?f.promise=m.whatsappQueue.get(f.query,E).$promise:(f.query.id=f.userProfile.id,f.query.section="WhatsappQueues",f.promise=m.userProfile.getResources(f.query,E).$promise)},f.createOrEditWhatsappQueue=function(e,n){i.show({controller:"CreateOrEditWhatsappQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{whatsappQueue:n,whatsappQueues:f.whatsappQueues.rows,crudPermissions:f.crudPermissions}})},f.deleteWhatsappQueue=y,f.exportSelectedWhatsappQueues=function(){var e=angular.copy(f.selectedWhatsappQueues);return f.selectedWhatsappQueues=[],e},f.deleteSelectedWhatsappQueues=function(e){var n=i.confirm().title("Are you sure want to delete the selected whatsappQueues?").htmlContent("<b>"+f.selectedWhatsappQueues.length+" selected</b> will be deleted.").ariaLabel("delete WhatsappQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){f.selectedWhatsappQueues.forEach(function(e){y(e)}),f.selectedWhatsappQueues=[]})},f.deselectWhatsappQueues=function(){f.selectedWhatsappQueues=[]},f.selectAllWhatsappQueues=function(){f.selectedWhatsappQueues=f.whatsappQueues.rows};var b=!0,A=1;function E(e){f.whatsappQueues=e||{count:0,rows:[]}}function y(e){m.whatsappQueue.delete({id:e.id}).$promise.then(function(){_.remove(f.whatsappQueues.rows,{id:e.id}),f.whatsappQueues.count-=1,f.whatsappQueues.rows.length||f.getWhatsappQueues(),p.success({title:_.startCase("WhatsappQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEwhatsappQueue"}];for(var n=0;n<e.data.errors.length;n++)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEwhatsappQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,n){b?o(function(){b=!1}):(n||(A=f.query.page),e!==n&&(f.query.page=1),e||(f.query.page=A),f.getWhatsappQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","whatsappQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting"],angular.module("app.whatsapp").controller("WhatsappQueuesController",e)}(),function(){"use strict";function e(n,t,e,a,o,i,s,r,l,d,c,m,u){var p=this;function g(e,n){return{id:e,title:n.name||"NONAME",state:"app.dashboards.custom",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function v(e,n){return{id:e,title:n.name||"NONAME",state:"app.plugins.plugin",stateParams:n,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(e)&&!r.hasRole("admin")}}}function h(e,n){var t={user:_.pick(r.getCurrentUser(),["id","name","fullname","email","role","internal","interface"])};n.agentUrl=Mustache.render(n.agentUrl,t),i.saveItem("apps.home.plugin_"+e,{id:e,title:n.name,translate:n.name,state:"plugin_"+n.id,stateParams:n,view:"plugin",icon:n.icon,weight:12,hidden:function(){return!r.hasPermission(e)}})}function f(e){return _.map(e.children,function(e){return e.id})}s.clear(),p.isAgent=function(){return r.getCurrentUser()&&r.hasRole("agent")},o.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return r.hasRole("agent")}}),d.version.get().$promise.then(function(e){p.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(){p.version="UNKNOWN"}).finally(function(){o.saveItem("version",{title:"VERSION "+p.version,group:!0,weight:2,hidden:function(){return r.hasRole("agent")}})}),r.isLoggedIn()&&(null===m.userSettings&&m.getUserSettingForUser(),l.gray&&s.warning({msg:e.instant("DASHBOARDS.LICENSE_EXPIRE_REMAINING_DAYS"),showClose:!0,timeout:!1}),d.dashboard.get().$promise.then(function(e){for(var n=0,t=0;t<e.rows.length;t+=1)n=99999+e.rows[t].id,o.saveItem("apps.dashboards.custom_"+n,g(n,e.rows[t]))}),d.plugin.get({active:!0}).$promise.then(function(e){var n=0;if(e.count){var t=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"agentOnly"!=e.sidebar});if(0<t.length){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",permissions:{hidden:!0},weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}});for(var a=0;a<t.length;a+=1)n=88888+t[a].id,o.saveItem("apps.plugins.plugin_"+n,v(n,t[a]));o.sort()}var i=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"adminOnly"!=e.sidebar});if(0<i.length)for(var s=0;s<i.length;s+=1)h(n=88888+i[s].id,i[s])}})),l.custom&&!c.defaultPageTitle&&c.pageTitle&&angular.element("#pageTitle").html(c.pageTitle),o.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.dashboards.general",{id:101,title:"General",route:"",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(101)&&!r.hasRole("admin")}}),o.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.staff.users",{id:201,title:"Users",route:"user",translate:"STAFF.USERS",state:"app.staff.users",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||r.hasRole("user")||!r.hasPermission(201)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.agents",{id:202,title:"Agents",route:"user",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(202)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.telephones",{id:203,title:"Telephones",route:"user",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(203)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.teams",{id:204,title:"Teams",route:"team",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(204)&&!r.hasRole("admin")}}),o.saveItem("apps.staff.userProfiles",{id:205,title:"UserProfiles",route:"userProfile",translate:"STAFF.USERPROFILES",state:"app.staff.userProfiles",permissions:{hidden:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(205)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",license:"cm",weight:4,hidden:function(){return!l.cm||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",route:"cmList",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(301)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",route:"cmCompany",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(302)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",route:"cmCustomField",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",permissions:{association:!1},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(304)&&!r.hasRole("admin")}}),o.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",route:"",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(303)&&!r.hasRole("admin")}}),o.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",license:"voice",weight:5,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",route:"voiceQueue",channel:"voice",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(401)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.contexts",{id:405,title:"Contexts",route:"voiceContext",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(405)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",route:"voiceMail",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(406)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",route:"voiceMusicOnHold",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(407)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",route:"voiceRecording",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(408)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",route:"voiceChanSpy",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(409)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.voicePrefixes",{id:410,title:"VoicePrefixes",route:"voicePrefix",translate:"VOICE.VOICEPREFIXES",state:"app.voice.voicePrefixes",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(410)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.inboundRoutes",{id:402,title:"InboundRoutes",route:"voiceExtension",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundRoutes",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(402)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.outboundRoutes",{id:403,title:"OutboundRoutes",route:"voiceExtension",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundRoutes",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(403)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.internalRoutes",{id:404,title:"InternalRoutes",route:"voiceExtension",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalRoutes",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(404)&&!r.hasRole("admin")}}),o.saveItem("apps.voice.realtime",{id:411,title:"Realtime",route:"",translate:"VOICE.REALTIME",state:"app.voice.realtime",permissions:{association:!1,crud:!1},weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(411)&&!r.hasRole("admin")}}),o.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",license:"chat",weight:6,hidden:function(){return!l.chat||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",route:"chatQueue",channel:"chat",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(501)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",route:"chatWebsite",channel:"chat",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(502)&&!r.hasRole("admin")}}),o.saveItem("apps.chat.realtime",{id:510,title:"Realtime",route:"",translate:"CHAT.REALTIME",state:"app.chat.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(510)&&!r.hasRole("admin")}}),o.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",license:"mail",weight:7,hidden:function(){return!l.mail||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",route:"mailQueue",channel:"mail",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(601)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",route:"mailAccount",channel:"mail",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(602)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",route:"mailSubstatus",channel:"mail",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",permissions:{association:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(603)&&!r.hasRole("admin")}}),o.saveItem("apps.mail.realtime",{id:610,title:"Realtime",route:"",translate:"MAIL.REALTIME",state:"app.mail.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(610)&&!r.hasRole("admin")}}),o.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",license:"messaging",weight:8,hidden:function(){return!l.messaging||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",route:"smsQueue",channel:"sms",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(701)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",route:"smsAccount",channel:"sms",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(702)&&!r.hasRole("admin")}}),o.saveItem("apps.sms.realtime",{id:710,title:"Realtime",route:"",translate:"SMS.REALTIME",state:"app.sms.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(710)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",license:"openchannel",weight:9,hidden:function(){return!l.openchannel||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",route:"openchannelQueue",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(801)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",route:"openchannelAccount",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(802)&&!r.hasRole("admin")}}),o.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",route:"",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(810)&&!r.hasRole("admin")}}),o.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",license:"fax",weight:10,hidden:function(){return!l.fax||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",route:"faxQueue",channel:"fax",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(901)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",route:"faxAccount",channel:"fax",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(902)&&!r.hasRole("admin")}}),o.saveItem("apps.fax.realtime",{id:910,title:"Realtime",route:"",translate:"FAX.REALTIME",state:"app.fax.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(910)&&!r.hasRole("admin")}}),o.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:15,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.tools.cannedAnswers",{id:1001,title:"CannedAnswers",route:"cannedAnswer",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1001)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",route:"dashboard",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1003)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",route:"interval",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1004)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",route:"pause",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1005)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.schedules",{id:1006,title:"Scheduler",route:"schedule",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1006)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.sounds",{id:1007,title:"Sounds",route:"sound",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1007)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.tags",{id:1008,title:"Tags",route:"tag",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1008)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.templates",{id:1009,title:"Templates",route:"template",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1009)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.trunks",{id:1011,title:"Trunks",route:"trunk",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1011)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.variables",{id:1012,title:"Variables",route:"variable",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1012)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.contact_item_types",{id:1013,title:"ContactItemType",route:"contactItemType",translate:"TOOLS.CONTACTITEMTYPE",state:"app.tools.contact_item_types",weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1013)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.dispositions",{id:1002,title:"Dispositions",route:"disposition",translate:"TOOLS.DISPOSITIONS",state:"app.tools.dispositions",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1002)&&!r.hasRole("admin")}}),o.saveItem("apps.tools.triggers",{id:1010,title:"Triggers",route:"trigger",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1010)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",license:"voice",weight:13,hidden:function(){return!l.voice||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",route:"squareOdbc",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1101)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",route:"squareRecording",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1102)&&!r.hasRole("admin")}}),o.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",route:"squareProject",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1103)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:16,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",route:"analyticMetric",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1201)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",route:"analyticExtractedReport",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1202)&&!r.hasRole("admin")}}),o.saveItem("apps.analytics.reports",{id:1203,title:"Reports",route:"",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1203)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",route:"intZendeskAccount",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1301)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",route:"intSalesforceAccount",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1302)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",route:"intFreshdeskAccount",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1303)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.sugarcrmAccounts",{id:1305,title:"SugarcrmAccounts",route:"intSugarcrmAccount",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",permissions:{association:!1,loading:!0},weight:4,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1305)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.deskAccounts",{id:1306,title:"DeskAccounts",route:"intDeskAccount",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",permissions:{association:!1,loading:!0},weight:5,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1306)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.zohoAccounts",{id:1307,title:"ZohoAccounts",route:"intZohoAccount",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",permissions:{association:!1,loading:!0},weight:6,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1307)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.vtigerAccounts",{id:1308,title:"VtigerAccounts",route:"intVtigerAccount",translate:"INTEGRATIONS.VTIGERACCOUNTS",state:"app.integrations.vtigerAccounts",permissions:{association:!1,loading:!0},weight:7,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1308)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.dynamics365Accounts",{id:1309,title:"Dynamics365Accounts",route:"intDynamics365Account",translate:"INTEGRATIONS.DYNAMICS365ACCOUNTS",state:"app.integrations.dynamics365Accounts",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1309)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.servicenowAccounts",{id:1310,title:"ServicenowAccounts",route:"intServicenowAccount",translate:"INTEGRATIONS.SERVICENOWACCOUNTS",state:"app.integrations.servicenowAccounts",permissions:{association:!1,loading:!0},weight:9,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1310)&&!r.hasRole("admin")}}),o.saveItem("apps.integrations.freshsalesAccounts",{id:1304,title:"FreshsalesAccounts",route:"intFreshsalesAccount",translate:"INTEGRATIONS.FRESHSALESACCOUNTS",state:"app.integrations.freshsalesAccounts",permissions:{association:!1,loading:!0},weight:10,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1304)&&!r.hasRole("admin")}}),o.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",permissions:{hidden:!0},weight:20,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")||r.hasRole("admin")&&!r.getCurrentUser().settingsEnabled}}),o.saveItem("apps.settings.generals",{id:1401,title:"General",route:"setting",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",route:"mailAccount",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.networks",{id:1403,title:"Networks",route:"network",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",route:"setting",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!l.custom||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.cloudProviders",{id:1408,title:"AiTools",route:"cloudProvider",translate:"SETTINGS.CLOUD_PROVIDERS",state:"app.settings.cloudProviders",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.updates",{id:1404,title:"Updates",route:"",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!l.update||r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.license",{id:1405,title:"License",route:"",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.settings.system",{id:1406,title:"System",route:"",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1400)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",license:"dialer",weight:5,hidden:function(){return!l.dialer||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",route:"voiceQueue",channel:"bull",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1501)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",route:"campaign",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1502)&&!r.hasRole("admin")}}),o.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",route:"",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1510)&&!r.hasRole("admin")}}),o.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",permissions:{association:!1},weight:21,hidden:function(){return!c.viewHelpSection||r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.help.about",{id:1601,title:"About",route:"",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1600)&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",license:"jscripty",weight:14,hidden:function(){return!l.jscripty||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",route:"jscriptyProject",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1701)&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace",{id:1800,title:"Marketplace",translate:"MARKETPLACE.MARKETPLACE",icon:"icon-cart",weight:18,hidden:function(){return r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.marketplace.plugins",{id:1801,title:"Plugins",route:"plugin",translate:"MARKETPLACE.PLUGINS",state:"app.marketplace.plugins",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1801)&&!r.hasRole("admin")}}),o.saveItem("apps.video",{id:2e3,title:"Video",translate:"VIDEO.VIDEO",icon:"icon-video",license:"screenrecording",weight:12,hidden:function(){return!l.screenrecording||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.video.screenRecordings",{id:2001,title:"ScreenRecordings",route:"screenRecording",translate:"VIDEO.SCREENRECORDINGS",state:"app.video.screenRecordings",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2001)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp",{id:2100,title:"Whatsapp",translate:"WHATSAPP.WHATSAPP",icon:"icon-whatsapp",license:"whatsapp",weight:11,hidden:function(){return!l.whatsapp||r.hasRole("agent")||!r.hasChildrenPermissions(f(this))&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappQueues",{id:2101,title:"WhatsappQueues",route:"whatsappQueue",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPQUEUES",state:"app.whatsapp.whatsappQueues",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2101)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.whatsappAccounts",{id:2102,title:"WhatsappAccounts",route:"whatsappAccount",channel:"whatsapp",translate:"WHATSAPP.WHATSAPPACCOUNTS",state:"app.whatsapp.whatsappAccounts",weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2102)&&!r.hasRole("admin")}}),o.saveItem("apps.whatsapp.realtime",{id:2110,title:"Realtime",route:"",translate:"WHATSAPP.REALTIME",state:"app.whatsapp.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return r.hasRole("agent")||!r.hasPermission(2110)&&!r.hasRole("admin")}}),o.sort(),i.saveItem("apps",{title:"APPS",group:!0,weight:1}),i.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),i.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",view:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!r.hasPermission(101)}}),i.saveItem("apps.home.agentPresence",{id:115,title:"AgentPresence",translate:"DASHBOARDS.AGENT_PRESENCE",state:"agentPresence",view:"agentPresence",icon:"icon-webcam",iconClass:"xenialab-violet-light-fg",weight:2,hidden:function(){return!r.hasPermission(115)}}),i.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",view:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:3,hidden:function(){return!l.cm||!r.hasPermission(102)}}),i.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",view:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:4,hidden:function(){return!l.cm||!r.hasPermission(103)}}),i.saveItem("apps.home.scheduled",{id:113,title:"Scheduled Calls",translate:"DASHBOARDS.SCHEDULED_CALLS",state:"scheduled",view:"scheduled",icon:"icon-calendar-clock",iconClass:"blue-grey-fg",weight:5,hidden:function(){return!l.dialer||!r.hasPermission(113)}}),i.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",view:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:6,hidden:function(){return!l.voice||!r.hasPermission(110)}}),i.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",view:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:7,hidden:function(){return!l.voice||!r.hasPermission(111)}}),i.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",view:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:8,hidden:function(){return!l.voice||!r.hasPermission(104)}}),i.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",view:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:9,hidden:function(){return!l.chat||!r.hasPermission(105)}}),i.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",view:"mail",icon:"icon-email",iconClass:"teal-fg",weight:10,hidden:function(){return!l.mail||!r.hasPermission(106)}}),i.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",view:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:11,hidden:function(){return!l.messaging||!r.hasPermission(107)}}),i.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",view:"openchannel",icon:"icon-google-earth",iconClass:"amber-fg",weight:12,hidden:function(){return!l.openchannel||!r.hasPermission(108)}}),i.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",view:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:13,hidden:function(){return!l.fax||!r.hasPermission(109)}}),i.saveItem("apps.home.whatsapp",{id:114,title:"Whatsapp",translate:"DASHBOARDS.WHATSAPP",state:"whatsapp",view:"whatsapp",icon:"icon-whatsapp",iconClass:"lime-A700-fg",weight:14,hidden:function(){return!l.whatsapp||!r.hasPermission(114)}}),n.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===n.$id&&t.$broadcast("msSplashScreen::remove")}),n.$on("socket:connect",function(){t.toastySocketLost&&(s.clear(t.toastySocketLost),t.toastySocketLost=void 0)}),n.$on("socket:disconnect",function(){t.toastySocketLost||s.warning({title:e.instant("TOOLBAR.WARNING"),msg:e.instant("DASHBOARDS.LOST_CONNECTION"),timeout:!1,onAdd:function(){t.toastySocketLost=this.id}})}),n.$on("client-side-logging:enabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_ENABLED_MSG")})}),n.$on("client-side-logging:disabled",function(){"admin"!==r.getCurrentUser().role&&s.info({title:e.instant("STAFF.CLIENT_LOGS"),msg:e.instant("STAFF.CLIENT_LOGS_DISABLED_MSG")})}),a.onbeforeunload=function(){r.isTelephone()||u.flush()}}e.$inject=["$scope","$rootScope","$translate","$window","msNavigationService","msNavigationAgentService","toasty","Auth","license","api","setting","UserSettingService","ClientSideLoggingService"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,n,t,a,o,r){var i=this;function s(e){if(e&&e.id){var n=99999+e.id;o.saveItem("apps.dashboards.custom_"+n,{id:n,title:e.name||"NONAME",state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}})}}function l(e){if(e&&e.id&&"never"!=e.sidebar)if(e.active){if("always"==e.sidebar||"adminOnly"==e.sidebar){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1900)&&!r.hasRole("admin")}});var n=88888+e.id;o.saveItem("apps.plugins.plugin_"+n,{id:n,title:e.name||"NONAME",state:"app.plugins.plugin",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(n)&&!r.hasRole("admin")}}),o.sort()}}else{n=88888+e.id;t=1900,a=n,i=o.getNavigation(),(s=_.find(i[0].children,{id:t}))&&_.some(s.children,{id:a})&&("always"==e.sidebar||"adminOnly"==e.sidebar)&&(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}var t,a,i,s}function d(e){var n=o.getNavigation(),t=_.find(n[0].children,{id:e});return!!(t&&0<t.children.length)}i.bodyEl=angular.element("body"),i.setting=t,i.$onInit=function(){i.folded="true"===n.get("motion.folded")||!1},i.toggleMsNavigationFolded=function(){i.folded=!i.folded,n.put("motion.folded",i.folded)},i.getLogo=function(){return i.setting.defaultHeaderWhiteLabel?"xCALLY Motion":i.setting.headerWhiteLabel},a.on("dashboard:save",s),a.on("dashboard:update",s),a.on("dashboard:remove",function(e){if(e&&e.id){var n=99999+e.id;o.deleteItem("apps.dashboards.custom_"+n)}}),a.on("plugin:save",l),a.on("plugin:update",l),a.on("plugin:remove",function(e){if(e&&e.id&&"never"!=e.sidebar){var n=88888+e.id;"always"!=e.sidebar&&"adminOnly"!=e.sidebar||(o.deleteItem("apps.plugins.plugin_"+n),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}}),e.$on("$stateChangeSuccess",function(){i.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,n,t,s,o,r){var l=this;function d(t){o.isSupported()?o.requestPermission().then(function(){var e,n;n={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=t).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},o.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),n)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=n.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},t.on("chatInternalMessage:save",l.onMessageSave),t.on("chatInternalMessage:update",l.onMessageUpdate),s.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),s.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var n=[],t=e.rows,a=0;a<t.length;a++)n.push(s.chatGroup.getUnread({id:t[a].id}).$promise);return i.all(n)}).then(function(e){for(var n=0;n<e.length;n++)l.unreadTotalGroupMessages+=e[n].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){t.removeAllListeners("chatInternalMessage:save"),t.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(n,e,t,a,i,s,o,r,l,d,c){var m=this;function u(){if(!m.hasMoreMessages||m.isLoading)return t.resolve();m.user.messages.length;return function(){m.isLoading=!0;var e={sort:"-createdAt",FromId:m.currentUser.id+","+m.user.id,ToId:m.currentUser.id+","+m.user.id,ChatGroupId:"null",limit:50,offset:m.user.messages.length};return r.chatInternalMessage.get(e).$promise.then(function(e){m.user.messages=m.user.messages.concat(e.rows),m.hasMoreMessages=e.count>m.user.messages.length;for(var n=0;n<m.user.messages.length;n+=1)!1===m.user.messages[n].read&&m.user.messages[n].ToId===m.currentUser.id&&r.chatInternalMessage.update({id:m.user.messages[n].id,read:!0})}).finally(function(){m.isLoading=!1})}()}function p(e){var n=angular.element("#chat-dialog");s(function(){n.animate({scrollTop:0},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return n.get(e).success(function(){c.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(){c.error({title:"PhoneBar API Error",msg:o.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}m.currentUser=l.getCurrentUser(),m.user=void 0,m.users={count:0,rows:[]},m.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),m.unreadMessages={},m.replyMessage="",m.disabled=!1,m.defaultAvatar="assets/images/avatars/profile.png",m.init=function(e){m.license=e,t.all([r.chatInternalMessage.get({fields:"FromId",ToId:m.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){m.unreadMessages=_.countBy(e.rows,"FromId")}).catch(function(e){throw e}),r.chatInternalMessage.getUsers().$promise.then(function(e){m.users=e}).catch(function(e){throw e})]).catch(function(e){c.error({msg:e.data?e.data.message:e.message||e})})},m.reply=function(){if(m.disabled=!0,""===m.replyMessage)return void(m.disabled=!1);var e={FromId:m.currentUser.id,ToId:m.user.id,body:m.replyMessage,read:!1};m.replyMessage="",r.chatInternalMessage.save(e).$promise.then(function(e){m.user.messages.unshift(e),m.user.lastMessageAt=e.createdAt,m.user.lastMessage=e}).finally(function(){p(400),m.disabled=!1})},m.webcall=function(e){a.$broadcast("webrtc::call",{target:g(e)})},m.call=function(e){return v("http://127.0.0.1:"+(m.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},m.transfer=function(e){return v("http://127.0.0.1:"+(m.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},m.beepPlayer=null,m.openChat=function(e){return m.user=angular.copy(e),m.isMessengerAllowed=!1,"agent"!==m.user.role||m.user.allowmessenger?(p(0),m.isMessengerAllowed=!0,m.hasMoreMessages=!0,u()):void c.warning({title:o.instant("QUICKPANEL.WARNING"),msg:o.instant("QUICKPANEL.MESSENGER_DISABLED")})},m.closeChat=function(){m.user=void 0,m.hasMoreMessages=!0},m.scrollToTopOfChat=p,d.on("chatInternalMessage:save",function(e){m.beepPlayer=document.getElementById("beep-player"),e.ToId===m.currentUser.id&&e.ToId!==e.FromId&&m.currentUser.messengerSoundNotification&&m.beepPlayer.play().catch(function(e){console.log(e.message)});if(e.ToId===m.currentUser.id&&!e.ChatGroupId){m.user&&m.user.id===e.FromId?(m.user.messages.unshift(e),p(0),r.chatInternalMessage.update({id:e.id,read:!0})):m.unreadMessages[e.FromId]=m.unreadMessages[e.FromId]?m.unreadMessages[e.FromId]+1:1;var n=_.find(m.users.rows,{id:e.FromId});n&&(n.lastMessageAt=e.createdAt,n.lastMessage=e)}}),d.on("chatInternalMessage:update",function(e){if((e.FromId===m.currentUser.id||e.ToId===m.currentUser.id)&&!e.ChatGroupId){if(m.user){var n=_.find(m.user.messages,{id:e.id});n&&_.merge(n,e)}var t=_.find(m.users.rows,{id:m.currentUser.id===e.FromId?e.ToId:e.FromId});t&&t.lastMessage&&_.merge(t.lastMessage,e),e.ToId===m.currentUser.id&&e.read&&0<m.unreadMessages[e.FromId]&&(m.unreadMessages[e.FromId]-=1)}}),d.on("user:update",function(e){var n=_.find(m.users.rows,{id:e.id});n&&(_.isNil(e.online)||n.online===e.online||(n.online=e.online),_.isNil(e.allowmessenger)||n.allowmessenger===e.allowmessenger||(n.allowmessenger=e.allowmessenger))}),e("quick-panel").onClose(function(){m.user=void 0}),m.loadMoreMessages=u,m.timelineOptions={scrollEl:"#chat-dialog"},i.$on("$destroy",function(){d.removeAllListeners("chatInternalMessage:save"),d.removeAllListeners("chatInternalMessage:update"),d.removeAllListeners("user:update")})}e.$inject=["$http","$mdSidenav","$q","$rootScope","$scope","$timeout","$translate","api","Auth","socket","toasty"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=o.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var t;return d.errors=[],s.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var n=_.map(d.group.members,"id");return n.unshift(d.currentUser.id),t=e,s.chatGroup.addMembers({id:t.id,ids:n}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:t.name+" has been saved!"}),c(t)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((n=e,t=angular.lowercase(n),function(e){var n=e.name.toLowerCase();return-1!=n.indexOf(t)})):[];var n,t}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,t,a,s,n,o,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var n=angular.element("#chat-group-dialog");a(function(){n.animate({scrollTop:n[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var n=0,t=[];n<e.rows.length;n++)e.rows[n].unreadGroupMessages=0,c.groups[e.rows[n].id]=e.rows[n],t.push(r.chatGroup.getUnread({id:e.rows[n].id}).$promise);return o.all(t)}).then(function(e){for(var n=0;n<e.length;n++)c.groups[e[n].id].unreadGroupMessages+=e[n].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,n){s.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(t.body),targetEvent:n,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return i.hasRole("admin")?r.user.get({role:"agent"}).$promise:r.userProfile.getResources({id:i.getCurrentUser().userProfileId,section:"Agents",role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,n){var t=s.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(n).ok("OK").cancel("CANCEL");s.show(t).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){s.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var n=[];a.messages=e.rows,a.messages.unshift(i);for(var t=0;t<a.messages.length;t++)n.push(r.user.get({id:a.messages[t].ToId,fields:"id,name,fullname,userpic"}).$promise);return o.all(n)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(n){c.group={id:n.id,write:n.write,messages:{}},r.chatGroup.getMembers({id:n.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:n.id,nolimit:!0}).$promise}).then(function(e){for(var n,t=0,a=[];t<e.count;t++)e.rows[t].ToId===c.currentUser.id&&(n=e.rows[t],c.group.messages[n.id]=n,e.rows[t].ToId!=c.currentUser.id||e.rows[t].FromId===c.currentUser.id||n.read||a.push(r.chatInternalMessage.update({id:n.id,read:!0})));return o.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var t={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(t).$promise.then(function(e){t.read=!1,t.ChatInternalMessageId=e.id;for(var n=0;n<c.group.members.length;n++)c.group.members[n].id!==c.currentUser.id&&(t.ToId=c.group.members[n].id,a.push(r.chatGroup.addMessage(angular.copy(t)).$promise));return o.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(n){if(!c.group&&n.ToId===c.currentUser.id&&n.FromId!==c.currentUser.id&&!n.read&&n.ChatGroupId){var e=c.groups[n.ChatGroupId];if(!e)return r.chatGroup.get({id:n.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&n.ChatGroupId===c.group.id&&n.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:n.id,read:!0}).$promise.then(function(){var e;e=n,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),n("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.form={token:s.token},o.setting={},o.resetPassword=function(){return i.auth.reset(o.form).$promise.then(function(){n.success({title:t.instant("RESETPASSWORD.PASSWORD_RESET"),msg:t.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&n.error({title:t.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){o.setting=e,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:""}).catch(function(e){e&&n.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this;function m(){u()}function u(){s.user.get({id:c.user.id}).$promise.then(function(e){c.user.permissions=e.permissions,c.items=[{font_icon:"icon-hangouts",class:"green-700-fg",label:"chat",title:"TOOLBAR.CHAT",value:"chat",permission:r.chat&&(p(105)||e.chatAutoanswer),enabled:e.chatAutoanswer,delay:e.chatAutoanswerDelay},{font_icon:"icon-email",class:"teal-fg",label:"email",title:"TOOLBAR.EMAIL",value:"email",permission:r.mail&&(p(106)||e.emailAutoanswer),enabled:e.emailAutoanswer,delay:e.emailAutoanswerDelay},{font_icon:"icon-message-text",class:"orange-fg",label:"sms",title:"TOOLBAR.SMS",value:"sms",permission:r.messaging&&(p(107)||e.smsAutoanswer),enabled:e.smsAutoanswer,delay:e.smsAutoanswerDelay},{font_icon:"icon-google-earth",class:"amber-fg",label:"openchannel",title:"TOOLBAR.OPENCHANNEL",value:"openchannel",permission:r.openchannel&&(p(108)||e.openchannelAutoanswer),enabled:e.openchannelAutoanswer,delay:e.openchannelAutoanswerDelay},{font_icon:"icon-deskphone",class:"grey-A200-fg",label:"fax",title:"TOOLBAR.FAX",value:"fax",permission:r.fax&&(p(109)||e.faxAutoanswer),enabled:e.faxAutoanswer,delay:e.faxAutoanswerDelay},{font_icon:"icon-whatsapp",class:"lime-A700-fg",label:"whatsapp",title:"TOOLBAR.WHATSAPP",value:"whatsapp",permission:r.whatsapp&&(p(114)||e.whatsappAutoanswer),enabled:e.whatsappAutoanswer,delay:e.whatsappAutoanswerDelay}]})}function p(e){return _.includes(c.user.permissions,e)}c.items=[],c.closeDialog=function(){a.hide()},c.user=d.getCurrentUser(),u(),o.connect(),o.on("userNotification:recalc:"+c.user.id,m)}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","socket","license","user","Auth"],angular.module("app.toolbar").controller("AutoAnswerNotificationsDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o){var r=this;function l(){e.hide()}r.errors=[],r.user=i,r.setting=s,r.reset=o,r.passwordPattern=r.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",r.savePassword=function(){r.errors=[],a.user.changePassword({id:r.user.id},{oldPassword:r.oldPassword,newPassword:r.password}).$promise.then(function(){n.show(n.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),l()}).catch(function(e){console.error(e),r.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},r.closeDialog=l,t.$watch("vm.password",function(e,n){_.isNil(r.oldPassword)||(e===r.oldPassword?t.changePasswordForm.password.$setValidity("oldPasswordMatch",!1):t.changePasswordForm.password.$setValidity("oldPasswordMatch",!0))})}e.$inject=["$scope","$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,t,a,i,n,s,o){var r=this;function l(e,n){var t={id:e.id};n?t.recallmeNotifiedDate=null:r.isRecallNotification?t.recallmeNotifiedDate=null:e.recallme||(t.UserId=null),i.cmHopper.update(t)}function d(e){var n=!1;_.isNil(e)||(n=e),l(r.preview,n),t.hide()}function c(e){return i.cmContact.getAdditionalPhones({id:e}).$promise.then(function(e){var n=_.map(e,"item"),t=_.map(e,"description");r.additionalItemTypes=_.map(e,"ItemTypeId");var a=_.map(e,"ItemType.rgbBackgroundColor"),i=_.map(e,"ItemType.name");r.additionalItems=[];for(var s=0;s<n.length;s++)r.additionalItems.push({phone:n[s],type:i[s],color:a[s],description:t[s]})})}r.customFieldsMap=s&&s.rows?_.mapValues(_.keyBy(s.rows,function(e){return"cf_"+e.id}),"name"):{},r.errors=[],r.hopperIds=[],r.additionalItems=[],r.preview=n,r.isRecallNotification=o,r.originated=!1,r.disable=!1,r.disableGetContact=!1,r.hopperIds.push(r.preview.id),r.originatePreview=function(){r.originated=!0,r.disable=!0,_.isEmpty(r.preview)?(a.error({title:"Message",msg:"Contact not available"}),r.disable=!1,r.hopperIds=[],d(!0)):i.rpc.getVoiceQueuesPreview({id:r.preview.id}).$promise.then(function(){d(!0)}).catch(function(e){a.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){r.disable=!1,r.hopperIds=[]})},r.closeDialog=d,r.nextContact=function(){return r.disableGetContact=!0,i.cmHopper.getPreview({hopperIds:r.hopperIds,direction:"next"}).$promise.then(function(e){r.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(r.hopperIds=[],t.hide(),a.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(c(e.Contact.id),r.originated||i.cmHopper.update({id:r.preview.id,UserId:null}),r.preview=e,r.hopperIds.push(r.preview.id))}).catch(function(e){if(r.disableGetContact=!1,r.hopperIds=[],404===e.status)r.getFirstAvailableContact();else if(e.data&&e.data.errors&&e.data.errors.length){t.hide();for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else t.hide(),a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.previousContact=function(){if(r.disableGetContact=!0,1<r.hopperIds.length){var e=_.without(r.hopperIds,r.preview.id);return i.cmHopper.getPreview({hopperIds:e,direction:"prev"}).$promise.then(function(e){r.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(r.hopperIds=[],t.hide(),a.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(c(e.Contact.id),_.remove(r.hopperIds,function(e){return e==r.preview.id}),r.originated||i.cmHopper.update({id:r.preview.id,UserId:null}),r.preview=e)}).catch(function(e){if(404===e.status)r.hopperIds=[r.preview.id],a.info({title:"PREVIEW",msg:"PREVIOUS CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){r.hopperIds=[],t.hide();for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else r.hopperIds=[],t.hide(),a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}},r.getFirstAvailableContact=function(){return r.disableGetContact=!0,a.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE. REWINDING THE LIST"}),i.cmHopper.getPreview({hopperIds:[r.preview.id],direction:"next"}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(t.hide(),a.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(c(e.Contact.id),r.originated||i.cmHopper.update({id:r.preview.id,UserId:null}),r.preview=e,r.hopperIds.push(r.preview.id))}).catch(function(e){if(t.hide(),404===e.status)a.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length)for(var n=0;n<e.data.errors.length;n+=1)a.error({title:e.data.errors[n].type,msg:e.data.errors[n].message});else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){r.disableGetContact=!1})},r.isCustomField=function(e){return _.startsWith(e,"cf_")},r.isHiddenField=function(e){return _.includes(["Company","CompanyId","ListId","UserId","createdAt","deletedAt","id","dialTimezone","utcOffset","AdditionalPhones","additionalPhones","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},r.isNil=function(e){return _.isNil(e)},_.isNil(r.preview)||c(r.preview.Contact.id),e.$on("$destroy",function(){r.originated||l(r.preview,!1)})}e.$inject=["$scope","$mdDialog","toasty","api","preview","customFields","isRecallNotification"],angular.module("app.toolbar").controller("PreviewDialogController",e).directive("customChip",function(){return{restrict:"A",scope:!1,link:function(e,n,t){n.parent().parent().css("background",e.$chip.color)}}})}(),function(){"use strict";function e(n,t,s,a,o,e,i,r,l,d,c,m,u,p,g,v,h,f,b,A,E,y,S){var T,I=this;I.voiceQueues=[],I.polling=!0,t.global={search:""},I.pauses=[],I.license=b,I.currentUser=v.getCurrentUser(),I.unreadTotalMessages=0,I.unreadTotalGroupMessages=0,I.contacts=0,"agent"===I.currentUser.role&&(T=E(function(){_.some(I.voiceQueues,{dialMethod:"preview",dialActive:!0})&&I.license.dialer&&I.polling?(I.polling=!1,f.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(I.contacts=e.contacts)}).finally(function(){I.polling=!0})):I.contacts=0},14999)),I.setting=A,I.bodyEl=angular.element("body"),I.conf={realm:"asterisk",host:e.host(),protocol:e.protocol(),soundPlayerId:"local-audio",remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:I.license.webrtc,phoneBarExpires:I.currentUser.phoneBarExpires,phoneBarPrefixRequired:I.currentUser.phoneBarPrefixRequired,wssPort:I.currentUser.wssPort},I.webRTCSessions=[],I.autoanswerIconColor="green-700-fg",I.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],I.languages={ar:{title:"Arabic",translation:"TOOLBAR.ARABIC",code:"ar",flag:"ar"},bs:{title:"Bosnian",translation:"TOOLBAR.BOSNIAN",code:"bs",flag:"bs"},cs:{title:"Czech",translation:"TOOLBAR.CZECH",code:"cs",flag:"cs"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},et:{title:"Estonian",translation:"TOOLBAR.ESTONIAN",code:"et",flag:"et"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},he:{title:"Hebrew",translation:"TOOLBAR.HEBREW",code:"he",flag:"he"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},hu:{title:"Hungarian",translation:"TOOLBAR.HUNGARIAN",code:"hu",flag:"hu"},id:{title:"Indonesian",translation:"TOOLBAR.INDONESIAN",code:"id",flag:"id"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},"pt-BR":{title:"Brazilian",translation:"TOOLBAR.BRAZILIAN",code:"pt-BR",flag:"pt-BR"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"}},I.isWebRTCBarRegistered=!1;var O=["ar","fa","he"],C=S.getLogger("toolbar");function w(n){n.queuecallerleaveAt?I.waitingQueueCalls=_.filter(I.waitingQueueCalls,function(e){return e!==n.uniqueid}):I.waitingQueueCalls.push(n.uniqueid)}function R(e){w(e)}function x(e){"inbound"===e.type&&w(e)}function N(){h.connect(),h.on("user:update",H),h.on("user:called",V),h.on("chatInternalMessage:save",F),h.on("chatInternalMessage:update",$),h.on("userVoiceQueue:save",k),h.on("voiceQueue:save",L),h.on("userVoiceQueue:remove",k),h.on("voiceQueue:remove",L),h.on("voiceQueue:update",L),h.on("user:forcelogout",B),h.on("userNotification:send",Q),h.on("userNotification:recalc:"+I.user.id,j),h.onWithoutApply("voice_queue_channel:save",x),h.onWithoutApply("voice_queue_channel:remove",R)}function D(){h.disconnect("logout")}function P(){var e={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0};return f.user.getQueues(e).$promise.then(function(e){I.voiceQueues=e.rows})}function L(){P()}function k(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&P()}function M(e,n,t){n||(n=!1),t||(t={type:"click",target:"button.preview-button"}),c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:t,clickOutsideToClose:!0,locals:{preview:e,currentUser:I.currentUser,isRecallNotification:n},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})}function U(){return I.license.chat&&(I.hasPermission(105)||I.currentUser.chatAutoanswer)||I.license.mail&&I.hasPermission(106)||I.currentUser.emailAutoanswer||I.license.messaging&&I.hasPermission(107)||I.currentUser.smsAutoanswer||I.license.openchannel&&I.hasPermission(108)||I.currentUser.openchannelAutoanswer||I.license.fax&&I.hasPermission(109)||I.currentUser.faxAutoanswer||I.license.whatsapp&&(I.hasPermission(114)||I.currentUser.whatsappAutoanswer)}function F(e){e.ToId!==I.currentUser.id||e.ChatGroupId||(I.unreadTotalMessages+=1),e.ToId===I.currentUser.id&&e.FromId!==I.currentUser.id&&!e.read&&e.ChatGroupId&&I.unreadTotalGroupMessages++}function $(e){e.ToId===I.currentUser.id&&e.read&&0<I.unreadTotalMessages&&!e.ChatGroupId&&(I.unreadTotalMessages-=1),e.ToId===I.currentUser.id&&e.read&&e.ChatGroupId&&0<I.unreadTotalGroupMessages&&I.unreadTotalGroupMessages--}function q(e){return D(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(e)}).then(function(){return t.$broadcast("webrtc::logout"),a.go("app.login")}).catch(function(e){C.error(e)})}function G(e,n){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!n,escapeToClose:!n,locals:{user:I.user,setting:A,reset:n}})}function H(e){if(e.id===I.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==I.user.showWebBar){var n;D();var t=c.confirm({title:r.instant("TOOLBAR.WARNING")+"!",htmlContent:"<span>"+r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")+"</span><br><span>"+r.instant("TOOLBAR.SESSION_TIMEOUT")+"</span>",ariaLabel:r.instant("TOOLBAR.WARNING")+"!",ok:r.instant("TOOLBAR.STAY_LOGGED"),cancel:r.instant("TOOLBAR.LOGOUT"),onComplete:function(){n=setTimeout(function(){c.cancel()},6e4)}});c.show(t).then(function(){return clearTimeout(n),v.queueLogin().then(function(){N(),_.merge(I.user,e),v.setCurrentUser(I.user)})}).catch(function(){clearTimeout(n),q(!0)})}else q(!0);else _.merge(I.user,e),v.setCurrentUser(I.user)}function V(e){if(I.isWebRTCBarRegistered&&2===I.currentUser.showWebBar&&"agent"===I.currentUser.role){var n=I.currentUser.privacyEnabled?y.mask(e.calleridnum):e.calleridnum;p.info({title:"WebRTC Popup",msg:"<div> <span>Call from: "+n+"</span><br> <span>Queue: "+e.queue+"</span><br> <span>Extra: "+(e.variables.extravar?e.variables.extravar:"Not defined")+"</span><br> </div>",showClose:!0,timeout:1e4,html:!0})}}function B(e){if(C.debug("onForceLogout -> data",e),e.user.id===I.user.id&&0!==I.user.showWebBar)return D(),s.resolve().then(function(){if(!v.isTelephone())return S.flush()}).then(function(){return v.logout(!0)}).then(function(){t.$broadcast("webrtc::logout"),c.show(c.alert().parent(angular.element(m.body)).clickOutsideToClose(!1).escapeToClose(!1).title(r.instant("TOOLBAR.WARNING")).textContent(r.instant("TOOLBAR.USER_FORCE_LOGOUT",{ip:e.ip})).ok("OK")).then(function(){return a.go("app.login")})}).catch(function(e){C.error(e)})}function Q(e){var n=e;if(I.currentUser.id===n.recipient){var t=r.instant("TOOLBAR.NOTIFICATION_TITLE",{sender:n.sender}),a=n.description?r.instant("TOOLBAR.NOTIFICATION_TITLE_RECIPIENT",{recipient:n.description}):null;p.wait({title:a?t+" "+a:t,msg:n.content,clickToClose:!1,timeout:!1,sound:n.beep,html:!0})}}function W(){I.autoanswerIconColor=U()?"green-700-fg":"gray-700-fg"}function j(e){e&&e.permissions&&(I.currentUser.permissions=e.permissions,W())}I.toggleSidenav=function(e){i(e).toggle()},I.logout=q,I.changeLanguage=function(e){if(!I.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}I.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===a.current.name&&d.location.reload();0<=O.indexOf(e.code)?p.info({title:r.instant("TOOLBAR.CHANGE_LANGUAGE_TITLE"),msg:r.instant("TOOLBAR.CHANGE_LANGUAGE_MESSAGE")}):n.$parent.$parent.vm.direction="ltr"},I.setUserStatus=function(e){I.userStatus=e},I.toggleHorizontalMobileMenu=function(){I.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},I.toggleMsNavigationFolded=function(){g.toggleFolded()},I.search=function(n){for(var e=[],t=g.getFlatNavigation(),a=s.defer(),i=0;i<t.length;i++)t[i].uisref&&e.push(t[i]);n&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(n)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},I.searchResultClick=function(e){e.uisref&&(e.stateParams?a.go(e.state,e.stateParams):a.go(e.state))},I.openSettings=function(){t.$broadcast("webrtc::settings")},I.changePassword=G,I.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},I.pause=function(e){var n=e||"DEFAULT PAUSE";_.some(I.webRTCSessions,["confirmed",!0])&&(n="#"+n);return f.user.pause({id:I.user.id,type:n}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.unpause=function(){return f.user.unpause({id:I.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},I.preview=function(n){return I.disable=!0,f.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):M(e,!1,n)}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){I.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var n=0;n<e.data.errors.length;n+=1)p.error({title:e.data.errors[n].type,msg:e.data.errors[n].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){I.disable=!1})},I.autoAnswerNotificationsDialog=function(e){U()?c.show({controller:"AutoAnswerNotificationsDialogController",controllerAs:"vm",templateUrl:"app/toolbar/autoanswers/dialog.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:I.license,user:I.currentUser}}):alert(r.instant("TOOLBAR.NO_AUTOANSWER_CONFIGURED"))},I.getLogo=function(){return I.setting.defaultHeaderWhiteLabel?"xCALLY Motion":I.setting.headerWhiteLabel},I.userIsNotPhonebar=function(){return"admin"===I.currentUser.role||"user"===I.currentUser.role||"agent"===I.currentUser.role&&0!==I.currentUser.showWebBar},I.hasPermission=function(e){return _.includes(I.currentUser.permissions,e)},I.waitingQueueCalls=[],function(){I.user=v.getCurrentUser(),P().then(function(){return f.rpc.getVoiceQueuesChannels().$promise}).then(function(e){e.rows.forEach(function(n){if("inbound"===n.type&&!n.queuecallerleaveAt){var e=_.find(I.voiceQueues,function(e){return e.name===n.queue});e&&I.waitingQueueCalls.push(n.uniqueid)}})}),I.conf.ha1=I.user.md5secret,I.conf.id=I.user.id,I.conf.name=I.user.name,I.conf.fullname=I.user.fullname,I.conf.internal=I.user.internal,I.conf.recording=I.user.phoneBarEnableRecording,I.conf.autoAnswer=I.user.phoneBarAutoAnswer,I.conf.enableSettings=I.user.phoneBarEnableSettings,I.conf.enableDtmfTone=I.user.phoneBarEnableDtmfTone,I.conf.autoAnswerDelay=I.user.phoneBarAutoAnswerDelay,I.userStatus=I.userStatusOptions[0];var e=u.get("motion.language");e&&I.languages.hasOwnProperty(e)?I.selectedLanguage=I.languages[e]:I.selectedLanguage=I.languages[r.preferredLanguage()];if(f.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){I.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),"LOCAL_LOGIN"==v.getAuthenticationType()&&I.setting.securePassword)if(I.user.passwordResetAt){var n=moment(I.user.passwordResetAt).add(I.setting.passwordExpiresDays||90,"day");moment().isAfter(n)?G(null,!0):moment().add(15,"day").isAfter(n)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(n.diff(moment(),"days",!0)),timeout:2e4})}else G(null,!0);W()}(),N(),I.openPreviewDialog=M,f.chatInternalMessage.get({fields:"FromId",ToId:I.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){I.unreadTotalMessages=e.rows.length}),n.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),h.removeAllListeners("user:forcelogout"),h.removeAllListeners("userNotification:send"),h.removeAllListeners("userNotification:recalc:"+I.user.id),T&&(E.cancel(T),T=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval","privacyManager","ClientSideLoggingService"],angular.module("app.toolbar").controller("ToolbarController",e)}(),function(){"use strict";function e(a,i,t,s,e){var n={updateUserSettingById:function(e,n){if("number"==typeof e)return i.userSetting.update({id:e},n).$promise;throw new Error("User setting id is missing")}},o=!1,r=a.getCurrentUser(),l=r?r.userSetting:null,d=function(e){var n="user-setting:update:user-"+e;t.$on("local:user-updated",c),s.on(n,c)};function c(){return o?e(function(e){e(l)}):(o=!0,function(e){var n=a.getCurrentUser(),t=null;t="admin"===n.role&&"number"==typeof e?i.user.get({id:e,userSetting:!0}).$promise:i.user.whoami({userSetting:!0}).$promise;return t.then(function(e){return a.setCurrentUser(e),e.userSetting})}().then(function(e){l=e,t.$emit("local:user-setting-updated",l)}).finally(function(){o=!1}))}return r&&d(r.id),t.$on("local:user-login",d),t.$on("local:user-logout",function(e){var n="user-setting:update:user-"+e;s.removeListener(n,c),l=null}),n}e.$inject=["Auth","api","$rootScope","socket","$q"],angular.module("app.user-setting").service("UserSettingService",e)}();var urlParams=function(e){var n=new Object,t=e.lastIndexOf("?");if(0<t)for(var a=e.substring(t+1).split("&"),i=0;i<a.length;i++)0<(t=a[i].indexOf("="))&&(n[a[i].substring(0,t)]=a[i].substring(t+1));return n}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",CRUD_PERMISSIONS={readOnly:!1,canEdit:!1,canDelete:!1},tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-BR","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,n,t){if(t=t||document,mxClient.IS_IE6)t.write('<link rel="'+e+'" href="'+n+'" charset="ISO-8859-1" type="text/css"/>');else{var a=t.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",n),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),t.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,n=document.createElement("table");n.setAttribute("width","100%"),n.setAttribute("height","100%");var t=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),t.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),t.appendChild(a),n.appendChild(t),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=t=0,a="number"==typeof window.innerWidth?(t=window.innerHeight,window.innerWidth):(t=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(e,n,Math.max(0,a-320),Math.max(0,t-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var s=mxLog.window.getElement();e=function(e,n){mxLog.textarea.style.height=Math.max(0,s.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,n){var t=document.createElement("button");mxUtils.write(t,e),mxEvent.addListener(t,"click",n),mxLog.td.appendChild(t)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,n){if(mxLog.TRACE){var t=0!=n?" ("+((new Date).getTime()-n)+" ms)":"";mxLog.writeln("Leaving "+e+t)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",n=0;n<arguments.length;n++)e+=arguments[n],n<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var n=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=n+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,n){var t=mxObjectIdentity.get(e),a=this.map[t];return this.map[t]=n,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var n=this.map[e];return delete this.map[e],n},mxDictionary.prototype.getKeys=function(){var e,n=[];for(e in this.map)n.push(e);return n},mxDictionary.prototype.getValues=function(){var e,n=[];for(e in this.map)n.push(this.map[e]);return n},mxDictionary.prototype.visit=function(e){for(var n in this.map)e(n,this.map[n])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,n){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(n)?e+mxResources.extension:null},getSpecialBundle:function(e,n){if(null==mxClient.languages||!this.isLanguageSupported(n)){var t=n.indexOf("-");0<t&&(n=n.substring(0,t))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(n)&&n!=mxClient.defaultLanguage?e+"_"+n+mxResources.extension:null},add:function(e,n){if((n=null!=n?n:mxClient.language)!=mxConstants.NONE){var t=mxResources.getDefaultBundle(e,n);if(null!=t)try{var a=mxUtils.load(t);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(t=mxResources.getSpecialBundle(e,n)))try{(a=mxUtils.load(t)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var t=e[n].indexOf("=");if(0<t){var a=e[n].substring(0,t),i=e[n].length;13==e[n].charCodeAt(i-1)&&i--,t=e[n].substring(t+1,i),this.resourcesEncoded?(t=t.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(t)):mxResources.resources[a]=t}}}},get:function(e,n,t){if(null==(e=mxResources.resources[e])&&(e=t),null!=e&&null!=n){t=[];for(var a=null,i=0;i<e.length;i++){var s=e.charAt(i);"{"==s?a="":null!=a&&"}"==s?(0<=(a=parseInt(a)-1)&&a<n.length&&t.push(n[a]),a=null):null!=a?a+=s:t.push(s)}e=t.join("")}return e}};function mxPoint(e,n){this.x=null!=e?e:0,this.y=null!=n?n:0}function mxRectangle(e,n,t,a){mxPoint.call(this,e,n),this.width=null!=t?t:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,n,t,a){this.x=e,this.y=n,this.width=t,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var n=Math.min(this.x,e.x),t=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=n,this.y=t,this.width=a-n,this.height=e-t}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,n=0;n<d.length;n++){var t=d[n];if(t instanceof mxGeometryChange||t instanceof mxTerminalChange||t instanceof mxValueChange||t instanceof mxChildChange||t instanceof mxStyleChange){var a=l.getView().getState(t.cell||t.child,!1);if(null!=a)if(e=!0,t.constructor!=mxGeometryChange||l.model.isEdge(t.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,s=(t.geometry.x-t.previous.x)*i,o=(t.geometry.y-t.previous.y)*i,r=(t.geometry.width-t.previous.width)*i;i=(t.geometry.height-t.previous.height)*i;0==m?(a.x-=s,a.y-=o,a.width-=r,a.height-=i):(a.x+=s/10,a.y+=o/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,t.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,n,t){for(var a=e.model.getChildCount(n),i=0;i<a;i++){var s=e.model.getChildAt(n,i),o=e.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,t),mxEffects.cascadeOpacity(e,s,t))}if(null!=(n=e.model.getEdges(n)))for(i=0;i<n.length;i++)null!=(a=e.getView().getState(n[i]))&&mxUtils.setOpacity(a.shape.node,t)},fadeOut:function(e,n,t,a,i,s){a=a||40,i=i||30;var o=n||100;if(mxUtils.setOpacity(e,o),s||null==s){var r=function(){o=Math.max(o-a,0),mxUtils.setOpacity(e,o),0<o?window.setTimeout(r,i):(e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",t&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var n=e.length,t=0;t<n;t+=1)mxUtils.removeCursors(e[t])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,n){return function(){return n.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,n,t){var a=e.getAttribute(n);if(null!=a&&a==t)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,n,t)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,n,t){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(n)==t)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,n,t),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,n,t){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+n+"='"+t+"']")}:function(e,n,t){return null==e?null:e.ownerDocument.evaluate("//*[@"+n+"='"+t+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var n=null;if(null!=e)if(null!=e.name)n=e.name;else{for(e=e.toString(),n=9;" "==e.charAt(n);)n++;var t=e.indexOf("(",n);n=e.substring(n,t)}return n},indexOf:function(e,n){if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n)return t;return-1},remove:function(e,n){var t=null;if("object"==typeof n)for(var a=mxUtils.indexOf(n,e);0<=a;)n.splice(a,1),t=e,a=mxUtils.indexOf(n,e);for(var i in n)n[i]==e&&(delete n[i],t=e);return t},isNode:function(e,n,t,a){return!(null==e||isNaN(e.nodeType)||null!=n&&e.nodeName.toLowerCase()!=n.toLowerCase())&&(null==t||e.getAttribute(t)==a)},getChildNodes:function(e,n){n=n||mxConstants.NODETYPE_ELEMENT;for(var t=[],a=e.firstChild;null!=a;)a.nodeType==n&&t.push(a),a=a.nextSibling;return t},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var n=mxUtils.createXmlDocument();return n.async="false",n.loadXML(e),n}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,n,t){var a=[];if(null!=e)if(n=n||" ",t=t||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(t+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++){var o=mxUtils.htmlEntities(i[s].nodeValue);a.push(" "+i[s].nodeName+'="'+o+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,n,t+n)),i=i.nextSibling;a.push(t+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,n){for(var t=n?e.previousSibling:e.nextSibling;null!=t&&t.nodeType==mxConstants.NODETYPE_TEXT;){var a=n?t.previousSibling:t.nextSibling,i=mxUtils.getTextContent(t);0==mxUtils.trim(i).length&&t.parentNode.removeChild(t),t=a}},htmlEntities:function(e,n){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&")).replace(/"/g,""")).replace(/\'/g,"'")).replace(/</g,"<")).replace(/>/g,">"),(null==n||n)&&(e=e.replace(/\n/g,"
")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,n){var t="";return null!=e&&(t=null==(t=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):t.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),t.replace(/\n/g,n||"
")},getTextContent:function(e){var n="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),n=e.nodeValue||""),n},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null==e)return"";if(null!=e.outerHTML)return e.outerHTML;var n=[];n.push("<"+e.nodeName);var t=e.attributes;if(null!=t)for(var a=0;a<t.length;a++){var i=t[a].nodeValue;null!=i&&0<i.length&&(n.push(" "),n.push(t[a].nodeName),n.push('="'),n.push(i),n.push('"'))}return 0==e.innerHTML.length?n.push("/>"):(n.push(">"),n.push(e.innerHTML),n.push("</"+e.nodeName+">")),n.join("")}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&e.appendChild(t),t},writeln:function(e,n){var t=e.ownerDocument.createTextNode(n);return null!=e&&(e.appendChild(t),e.appendChild(document.createElement("br"))),t},br:function(e,n){n=n||1;for(var t=null,a=0;a<n;a++)null!=e&&(t=e.ownerDocument.createElement("br"),e.appendChild(t));return t},button:function(e,n,t){return t=(t=null!=t?t:document).createElement("button"),mxUtils.write(t,e),mxEvent.addListener(t,"click",function(e){n(e)}),t},para:function(e,n){var t=document.createElement("p");return mxUtils.write(t,n),null!=e&&e.appendChild(t),t},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,n,t,a,i){return mxUtils.link(e,n,function(){t.execute(a)},i)},linkInvoke:function(e,n,t,a,i,s){return mxUtils.link(e,n,function(){t[a](i)},s)},link:function(e,n,t,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",t),mxUtils.write(i,n),null!=e&&e.appendChild(i),i},fit:function(e){var n=parseInt(e.offsetLeft),t=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,s=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);s<n+t&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,s-t)+"px"),n=parseInt(e.offsetTop),t=parseInt(e.offsetHeight),(s=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<n+t&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,s-t)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return n.initWithPath(e),n.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(n,1,4,null),(n=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),n.read(n.available())):(mxUtils.alert("File not found."),"")}return e=(n=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),n.close(),e},save:function(e,n){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);t.initWithPath(e),t.exists()||t.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(t,34,4,null),a.write(n,n.length),a.flush(),a.close()}else(t=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(n),t.Close()},saveAs:function(e){var n=document.createElement("iframe");n.setAttribute("src",""),n.style.visibility="hidden",document.body.appendChild(n);try{if(mxClient.IS_NS){var t=n.contentDocument;t.open(),t.write(e),t.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),n.focus(),saveDocument(t)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(t=n.contentWindow.document).write(e),t.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(n)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var n=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(n){var t=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(t){t.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,t.setTransferData("text/unicode",a,2*e.length),n.setData(t,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,n,t){return new mxXmlRequest(e,null,"GET").send(n,t)},post:function(e,n,t,a){return new mxXmlRequest(e,n).send(t,a)},submit:function(e,n,t,a){return new mxXmlRequest(e,n).simulate(t,a)},loadInto:function(e,n,t){mxClient.IS_IE?n.onreadystatechange=function(){4==n.readyState&&t()}:n.addEventListener("load",t,!1),n.load(e)},getValue:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t),e},getNumber:function(e,n,t){return null==(e=null!=e?e[n]:null)&&(e=t||0),Number(e)},getColor:function(e,n,t){return null==(e=null!=e?e[n]:null)?e=t:e==mxConstants.NONE&&(e=null),e},clone:function(e,n,t){t=null!=t&&t;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==n||mxUtils.indexOf(n,i)<0)&&(a[i]=t||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t=0;t<e.length;t++)if(e[t]==n[t]||null!=e[t]&&!e[t].equals(n[t]))return!1;return!0},equalEntries:function(e,n){if(null==e&&null!=n||null!=e&&null==n||null!=e&&null!=n&&e.length!=n.length)return!1;if(null!=e&&null!=n)for(var t in e)if(e[t]!=n[t])return!1;return!0},extend:function(e,n){var t=function(){};t.prototype=n.prototype,e.prototype=new t,e.prototype.constructor=e},toString:function(e){var n,t="";for(n in e)try{if(null==e[n])t+=n+" = [null]\n";else if("function"==typeof e[n])t+=n+" => [Function]\n";else if("object"==typeof e[n])t=t+(n+" => [")+mxUtils.getFunctionName(e[n].constructor)+"]\n";else t+=n+" = "+e[n]+"\n"}catch(e){t+=n+"="+e.message}return t},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,n,t,a,i,s,o,r,l){if(r-=e,l-=n,0===t||0===a)return h;t=Math.abs(t),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;r=m*(c=(s=1<(v=(c=i*i)/(g=t*t)+(p=d*d)/(A=a*a))?(t*=Math.sqrt(v),a*=Math.sqrt(v),0):(v=1,s===o&&(v=-1),v*Math.sqrt((g*A-g*p-A*c)/(g*p+A*c))))*t*d/a)-h*(p=-1*s*a*i/t)+r/2,l=h*c+m*p+l/2,s=0<=(g=Math.atan2((d-p)/a,(i-c)/t)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/t)-Math.atan2((d-p)/a,(i-c)/t))?g:2*Math.PI+g,0==o&&0<i?i-=2*Math.PI:0!=o&&i<0&&(i+=2*Math.PI),o=2*i/Math.PI,i/=o=Math.ceil(o<0?-1*o:o),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*t,m*=a,t*=h,a*=h;for(var u=Math.cos(s),p=-d*(c*(b=Math.sin(s))+a*u),g=-d*(t*b-m*u),v=A=0,h=[],f=0;f<o;++f){s+=i;var b,A=c*(u=Math.cos(s))-a*(b=Math.sin(s))+r,E=(v=t*u+m*b+l,-d*(c*b+a*u));u=-d*(t*b-m*u);h[b=6*f]=Number(p+e),h[b+1]=Number(g+n),h[b+2]=Number(A-E+e),h[b+3]=Number(v-u+n),h[b+4]=Number(A+e),h[b+5]=Number(v+n),p=A+E,g=v+u}return h},getBoundingBox:function(e,n){var t=null;if(null!=e&&null!=n&&0!=n){var a=mxUtils.toRadians(n),i=(t=Math.cos(a),Math.sin(a)),s=new mxPoint(e.x+e.width/2,e.y+e.height/2),o=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);o=mxUtils.getRotatedPoint(o,t,i,s),a=mxUtils.getRotatedPoint(a,t,i,s),r=mxUtils.getRotatedPoint(r,t,i,s),l=mxUtils.getRotatedPoint(l,t,i,s);(t=new mxRectangle(o.x,o.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),t.add(new mxRectangle(r.x,r.y,0,0)),t.add(new mxRectangle(l.x,l.y,0,0))}return t},getRotatedPoint:function(e,n,t,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*n-(e=e.y-a.y)*t+a.x,e*n+i*t+a.y)},getPortConstraints:function(e,n,t,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,n,t){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],s=null,o=1;o<e.absolutePoints.length;o++){var r=e.absolutePoints[o];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,n,t);(null==s||i<s)&&(s=i,a=o-1),i=r}return a},rectangleIntersectsSegment:function(e,n,t){var a=e.y,i=e.x,s=a+e.height,o=i+e.width;e=n.x;var r=t.x;if(n.x>t.x&&(e=t.x,r=n.x),o<r&&(r=o),e<i&&(e=i),r<e)return!1;i=n.y,o=t.y;var l=t.x-n.x;return 1e-7<Math.abs(l)&&(i=(t=(t.y-n.y)/l)*e+(n=n.y-t*n.x),o=t*r+n),o<i&&(n=o,o=i,i=n),s<o&&(o=s),i<a&&(i=a),!(o<i)},contains:function(e,n,t){return e.x<=n&&e.x+e.width>=n&&e.y<=t&&e.y+e.height>=t},intersects:function(e,n){var t=e.width,a=e.height,i=n.width,s=n.height;if(i<=0||s<=0||t<=0||a<=0)return!1;var o=e.x,r=e.y,l=n.x,d=n.y;s+=d,t+=o,a+=r;return((i=i+l)<l||o<i)&&(s<d||r<s)&&(t<o||l<t)&&(a<r||d<a)},intersectsHotspot:function(e,n,t,a,i,s){if(i=null!=i?i:0,s=null!=s?s:0,0<(a=null!=a?a:1)){var o=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(o=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<s&&(l=Math.min(l,s),d=Math.min(d,s)),a=new mxRectangle(o-l/2,r-d/2,l,d),0!=(o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-o),s=Math.sin(-o),o=new mxPoint(e.getCenterX(),e.getCenterY()),n=(e=mxUtils.getRotatedPoint(new mxPoint(n,t),i,s,o)).x,t=e.y),mxUtils.contains(a,n,t)}return!0},getOffset:function(e,n){var t=0,a=0;if(null!=n&&n){var i=document.body,s=document.documentElement;t=t+(i.scrollLeft||s.scrollLeft),a=a+(i.scrollTop||s.scrollTop)}for(;e.offsetParent;)t+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(t,a)},getScrollOrigin:function(e){for(var n=document.body,t=document.documentElement,a=new mxPoint(n.scrollLeft||t.scrollLeft,n.scrollTop||t.scrollTop);null!=e&&e!=n&&e!=t;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,n,t){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(n-e.x,t-e.y)},ltrim:function(e,n){return e.replace(RegExp("^["+(n||"\\s")+"]+","g"),"")},rtrim:function(e,n){return e.replace(RegExp("["+(n||"\\s")+"]+$","g"),"")},trim:function(e,n){return mxUtils.ltrim(mxUtils.rtrim(e,n),n)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,n){return(e%n+n)%n},intersection:function(e,n,t,a,i,s,o,r){var l=(r-s)*(t-e)-(o-i)*(a-n);return o=((o-i)*(n-s)-(r-s)*(e-i))/l,i=((t-e)*(n-s)-(a-n)*(e-i))/l,0<=o&&o<=1&&0<=i&&i<=1?new mxPoint(e+o*(t-e),n+o*(a-n)):null},ptSegDistSq:function(e,n,t,a,i,s){return t=(i-=e)*(t-=e)+(s-=n)*(a-=n)<=0?0:(e=(i=t-i)*t+(s=a-s)*a)<=0?0:e*e/(t*t+a*a),(i=i*i+s*s-t)<0&&(i=0),i},relativeCcw:function(e,n,t,a,i,s){return 0==(e=(i-=e)*(a-=n)-(s-=n)*(t-=e))&&(0<(e=i*t+s*a)&&((e=(i-t)*t+(s-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,n){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,n,t){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,n,t,a,i,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,n){mxUtils.isVml(e)?e.style.filter=100<=n?null:"alpha(opacity="+n/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=n?null:"alpha(opacity="+n+")":e.style.opacity=n/100},createImage:function(e){var n=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),n.style.borderStyle="none"):((n=document.createElement("img")).setAttribute("src",e),n.setAttribute("border","0")),n},sortCells:function(e,i){i=null==i||i;var s=new mxDictionary;return e.sort(function(e,n){var t=s.get(e);null==t&&(t=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),s.put(e,t));var a=s.get(n);return null==a&&(a=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),s.put(n,a)),0==(t=mxCellPath.compare(t,a))?0:0<t==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)e[t].indexOf("=")<0&&n.push(e[t])}return n},indexOfStylename:function(e,n){if(null!=e&&null!=n)for(var t=e.split(";"),a=0,i=0;i<t.length;i++){if(t[i]==n)return a;a+=t[i].length+1}return-1},addStylename:function(e,n){return mxUtils.indexOfStylename(e,n)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=n),e},removeStylename:function(e,n){var t=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=n&&t.push(a[i]);return t.join(";")},removeAllStylenames:function(e){var n=[];if(null!=e){e=e.split(";");for(var t=0;t<e.length;t++)0<=e[t].indexOf("=")&&n.push(e[t])}return n.join(";")},setCellStyles:function(e,n,t,a){if(null!=n&&0<n.length){e.beginUpdate();try{for(var i=0;i<n.length;i++)if(null!=n[i]){var s=mxUtils.setStyle(e.getStyle(n[i]),t,a);e.setStyle(n[i],s)}}finally{e.endUpdate()}}},setStyle:function(e,n,t){var a=null!=t&&(void 0===t.length||0<t.length);if(null==e||0==e.length)a&&(e=n+"="+t);else{var i=e.indexOf(n+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+n+"="+t):(n=a?n+"="+t:"",t=e.indexOf(";",i),a||t++,e=e.substring(0,i)+n+(i<t?e.substring(t):""))}return e},setCellStyleFlags:function(e,n,t,a,i){if(null!=n&&0<n.length){e.beginUpdate();try{for(var s=0;s<n.length;s++)if(null!=n[s]){var o=mxUtils.setStyleFlag(e.getStyle(n[s]),t,a,i);e.setStyle(n[s],o)}}finally{e.endUpdate()}}},setStyleFlag:function(e,n,t,a){if(null==e||0==e.length)e=a||null==a?n+"="+t:n+"=0";else{var i=e.indexOf(n+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+n+"="+t:e+i+n+"=0";else{var s=e.indexOf(";",i),o="";o=s<0?e.substring(i+n.length+1):e.substring(i+n.length+1,s),o=null==a?parseInt(o)^t:a?parseInt(o)|t:parseInt(o)&~t;e=e.substring(0,i)+n+"="+o+(0<=s?e.substring(s):"")}}return e},getAlignmentAsPoint:function(e,n){var t=0,a=0;return e==mxConstants.ALIGN_CENTER?t=-.5:e==mxConstants.ALIGN_RIGHT&&(t=-1),n==mxConstants.ALIGN_MIDDLE?a=-.5:n==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(t,a)},getSizeForString:function(e,n,t){n=null!=n?n:mxConstants.DEFAULT_FONTSIZE,t=null!=t?t:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=t,a.style.fontSize=Math.round(n)+"px",a.style.lineHeight=Math.round(n*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,n,t,a,i){a=null!=a?a:0,i=null!=i?i:0,n=null!=n?n:1,null==t&&(t=[e.getModel().getRoot()]);var s=e.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var l=s.drawPane,d=s.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var c=s.getTranslate();s.translate=new mxPoint(a,i),n=new mxTemporaryCellStates(e.getView(),n,t);try{o=(new mxCodec).encode(e.getView())}finally{n.destroy(),s.translate=c,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=l,s.overlayPane=d,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(e,n,t,a){if(e<1)return 1;a=null!=a?a:0;var i=(t=null!=t?t:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;t=t.height-2*a,a=n.getGraphBounds().clone(),n=n.getView().getScale(),a.width/=n,a.height/=n,t=(n=a.width)/a.height/(i/t),a=Math.sqrt(e);var s=Math.sqrt(t);if(t=a*s,a/=s,t<1&&e<a){var o=a/e;a=e,t/=o}for(a<1&&e<t&&(o=t/e,t=e,a/=o),o=Math.ceil(t)*Math.ceil(a),s=0;e<o;){o=Math.floor(t)/t;var r=Math.floor(a)/a;if(1==o&&(o=Math.floor(t-1)/t),1==r&&(r=Math.floor(a-1)/a),t*=o=r<o?o:r,a*=o,o=Math.ceil(t)*Math.ceil(a),10<++s)break}return i*t/n*.99999},show:function(e,n,t,a){if(t=null!=t?t:0,a=null!=a?a:0,null==n?n=window.open().document:n.open(),t=-(i=e.getGraphBounds()).x+t,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",s=document.getElementsByTagName("base"),o=0;o<s.length;o++)i+=s[o].outerHTML;for(i+="<style>",o=0;o<document.styleSheets.length;o++)try{i+=document.styleSheets(o).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",n.writeln(i),n.close(),null!=(e=n.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=t+"px",e.style.top=a+"px")}else{for(n.writeln("<html"),n.writeln("<head>"),s=document.getElementsByTagName("base"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("link"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("style"),o=0;o<s.length;o++)n.writeln(mxUtils.getOuterHtml(s[o]));for(n.writeln("</head>"),n.writeln("</html>"),n.close(),null==n.body&&n.documentElement.appendChild(n.createElement("body")),n.body.style.overflow="auto",e=e.container.firstChild;null!=e;)o=e.cloneNode(!0),n.body.appendChild(o),e=e.nextSibling;null!=(e=n.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+t+","+a+")"),(t=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),t.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(n.body),n},printScreen:function(e){var n=window.open();mxUtils.show(e,n.document),e=function(){n.focus(),n.print(),n.close()},mxClient.IS_GC?n.setTimeout(e,500):e()},popup:function(e,n){if(n){var t=document.createElement("div");t.style.overflow="scroll",t.style.width="636px",t.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),t.appendChild(a),(t=new mxWindow("Popup Window",t,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),t.setVisible(!0)}else mxClient.IS_NS?((t=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),t.document.close()):((a=(t=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),t.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,n){return prompt(e,n)},confirm:function(e){return confirm(e)},error:function(e,n,t,a){var i=document.createElement("div");i.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",a||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",i.appendChild(s),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-n)/2,a/4,n,null,!1,!0);return t&&(mxUtils.br(i),n=document.createElement("p"),t=document.createElement("button"),mxClient.IS_IE?t.style.cssText="float:right":t.setAttribute("style","float:right"),mxEvent.addListener(t,"click",function(e){o.destroy()}),mxUtils.write(t,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),n.appendChild(t),i.appendChild(n),mxUtils.br(i),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(e,n,t,i,a,s,o,r,l,d){return(e=new mxDragSource(e,t)).dragOffset=new mxPoint(null!=a?a:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=o,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof n?n(e):n},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var n=i.cloneNode(!0),t=parseInt(n.style.width),a=parseInt(n.style.height);return n.style.width=Math.round(t*e.view.scale)+"px",n.style.height=Math.round(a*e.view.scale)+"px",n})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var n=1;n<arguments.length;n+=2)null!=arguments[n+1]&&(this.properties[arguments[n]]=arguments[n+1])}function mxMouseEvent(e,n){this.evt=e,this.state=n}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var n=this.getSource();null!=n;){if(n==e.node)return!0;n=n.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,n){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(n)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var n=0;n<this.eventListeners.length;)this.eventListeners[n+1]==e?this.eventListeners.splice(n,2):n+=2},mxEventSource.prototype.fireEvent=function(e,n){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==n&&(n=this.getEventSource()),null==n&&(n=this);for(var t=[n,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,t)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,n,t){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:n,f:t})};return window.addEventListener?function(e,n,t){e.addEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.attachEvent("on"+n,t),a(e,n,t)}}(),removeListener:function(){var a=function(e,n,t){if(null!=e.mxListenerList){n=e.mxListenerList.length;for(var a=0;a<n;a++)if(e.mxListenerList[a].f==t){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,n,t){e.removeEventListener(n,t,!1),a(e,n,t)}:function(e,n,t){e.detachEvent("on"+n,t),a(e,n,t)}}(),removeAllListeners:function(e){var n=e.mxListenerList;if(null!=n)for(;0<n.length;){var t=n[0];mxEvent.removeListener(e,t.name,t.f)}},addGestureListeners:function(e,n,t,a){null!=n&&mxEvent.addListener(e,"mousedown",n),null!=t&&mxEvent.addListener(e,"mousemove",t),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.addListener(e,"touchstart",n),null!=t&&mxEvent.addListener(e,"touchmove",t),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,n,t,a){null!=n&&mxEvent.removeListener(e,"mousedown",n),null!=t&&mxEvent.removeListener(e,"mousemove",t),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=n&&mxEvent.removeListener(e,"touchstart",n),null!=t&&mxEvent.removeListener(e,"touchmove",t),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,t,n,a,i,s,o){var r=function(e){return"function"==typeof n?n(e):n};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=s?s(e):mxEvent.isConsumed(e)||t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=o)o(e);else if(!mxEvent.isConsumed(e)){var n=r(e);t.dblClick(e,null!=n?n.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var n=e.length,t=0;t<n;t+=1)mxEvent.release(e[t])},addMouseWheelListener:function(t){if(null!=t){var e=function(e){null==e&&(e=window.event);var n=0;0!=(n=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&t(e,0<n)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,n,t){t=null==t||t,(null==n||n)&&(e.preventDefault?(t&&e.stopPropagation(),e.preventDefault()):t&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,n,t,a,i,s){this.url=e,this.params=n,this.method=t||"POST",this.async=null==a||a,this.username=i,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,n){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,n){null!=n&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,n){var t=null;(e=e||document)==document&&(t=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=n&&a.setAttribute("target",n),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<i.length;s++){if(0<(o=i[s].indexOf("="))){var o,r=i[s].substring(0,o),l=i[s].substring(o+1);(o=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"
"),r=e.createTextNode(l),o.appendChild(r),a.appendChild(o)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=t&&(window.onbeforeunload=t)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,n){return n=mxClipboard.copy(e,n),mxClipboard.insertCount=0,mxClipboard.removeCells(e,n),n},removeCells:function(e,n){e.removeCells(n)},copy:function(e,n){n=n||e.getSelectionCells();var t=e.getExportableCells(n);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(t),t},paste:function(e){if(null!=mxClipboard.cells){var n=e.getImportableCells(mxClipboard.cells),t=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();n=e.importCells(n,t,t,a);mxClipboard.insertCount++,e.setSelectionCells(n)}}};function mxWindow(e,n,t,a,i,s,o,r,l,d){null!=n&&(o=null==o||o,this.content=n,this.init(t,a,i,s,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,n,t){this.src=e,this.width=n,this.height=t}function mxDivResizer(e,n){if("div"==e.nodeName.toLowerCase()){null==n&&(n=window),this.div=e;var t=mxUtils.getCurrentStyle(e);null!=t&&(this.resizeWidth="auto"==t.width,this.resizeHeight="auto"==t.height),mxEvent.addListener(n,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,n){this.element=e,this.dropHandler=n,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(n,e,t,a){this.model=n,this.urlInit=e,this.urlPoll=t,this.urlNotify=a,null!=n&&(this.codec=new mxCodec,this.codec.lookup=function(e){return n.getCell(e)}),n.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");(null!=t&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(t.changes,t.undone)+"</edit>")}))}function mxUndoableEdit(e,n){this.source=e,this.changes=[],this.significant=null==n||n}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,n,t,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=n+"px",this.table=document.createElement("table"),this.table.className=i,null!=t&&(mxClient.IS_IE||(this.div.style.width=t+"px"),this.table.style.width=t+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),n=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",n.appendChild(this.title),e.appendChild(n),n=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),n.appendChild(this.td),e.appendChild(n),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var n=this.title.firstChild;null!=n;){var t=n.nextSibling;n.nodeType==mxConstants.NODETYPE_TEXT&&n.parentNode.removeChild(n),n=t}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}n=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.div.offsetWidth,o=this.div.offsetHeight,n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setSize(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,n){e=Math.max(this.minimumSize.width,e),n=Math.max(this.minimumSize.height,n),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=n+"px"),this.table.style.width=e+"px",this.table.style.height=n+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var t=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var n=this.getMinimumSize();0<n.height&&(mxClient.IS_IE||(this.div.style.height=n.height+"px"),this.table.style.height=n.height+"px"),0<n.width&&(mxClient.IS_IE||(this.div.style.width=n.width+"px"),this.table.style.width=n.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var t=!1,a=null,i=null,s=null,o=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(t)t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=s,this.div.style.width=o,"auto"!=(n=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var n=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=n.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.getX(),o=this.getY(),n=mxUtils.bind(this,function(e){var n=mxEvent.getClientX(e)-a,t=mxEvent.getClientY(e)-i;this.setLocation(s+n,o+t),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),t=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,n,t),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,n){this.div.style.left=e+"px",this.div.style.top=n+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");t.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){n()}),t.appendChild(a),this.body.appendChild(t)},mxForm.prototype.addText=function(e,n){var t=document.createElement("input");return t.setAttribute("type","text"),t.value=n,this.addField(e,t)},mxForm.prototype.addCheckbox=function(e,n){var t=document.createElement("input");return t.setAttribute("type","checkbox"),this.addField(e,t),n&&(t.checked=!0),t},mxForm.prototype.addTextarea=function(e,n,t){var a=document.createElement("textarea");return mxClient.IS_NS&&t--,a.setAttribute("rows",t||2),a.value=n,this.addField(e,a)},mxForm.prototype.addCombo=function(e,n,t){var a=document.createElement("select");return null!=t&&a.setAttribute("size",t),n&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,n,t,a){var i=document.createElement("option");mxUtils.writeln(i,n),i.setAttribute("value",t),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,n){var t=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),t.appendChild(a),(a=document.createElement("td")).appendChild(n),t.appendChild(a),this.body.appendChild(t),n},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),n=this.getDocumentHeight(),t=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(t)&&!isNaN(a)&&0<=t&&0<=a&&0<e-a-t&&(this.div.style.width=e-a-t+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(s)&&0<=i&&0<=s&&0<n-i-s&&(this.div.style.height=n-i-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,n,t){return e.getCellAt(n,t)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,n){var t=mxEvent.getClientX(n),a=mxEvent.getClientY(n),i=mxUtils.getOffset(e.container),s=mxUtils.getScrollOrigin();return t>=i.x-s.x&&a>=i.y-s.y&&t<=i.x-s.x+e.container.offsetWidth&&a<=i.y-s.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(n=this.getGraphForEvent(e))&&!this.graphContainsEvent(n,e)&&(n=null),n!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=n,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(e),t=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,t+=this.dragOffset.y),n+=document.body.scrollLeft||document.documentElement.scrollLeft,t+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=n+"px",this.dragElement.style.top=t+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var n=this.currentGraph.view.scale,t=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/n-t.x,this.currentPoint.y/n-t.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,n){var t=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(n)-t.x+a.x;t=mxEvent.getClientY(n)-t.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,t,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,t),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(n);var s=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(n))s=new mxRectangle(0,0,s=parseInt(this.previewElement.style.width),o=parseInt(this.previewElement.style.height)),t=new mxPoint(i,t),t=this.currentGuide.move(s,t,a),s=!1,i=t.x,t=t.y;else if(a){a=e.view.scale;var o=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-o.x-r)+o.x)*a,t=(e.snap(t/a-o.y-r)+o.y)*a}null!=this.currentGuide&&s&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,t+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(t)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,t)},mxDragSource.prototype.drop=function(e,n,t,a,i){this.dropHandler(e,n,t,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,n,t,a,i,s){var o=document.createElement(null!=n?"img":"button"),r=i||(null!=s?"mxToolbarMode":"mxToolbarItem");return o.className=r,o.setAttribute("src",n),null!=e&&(null!=n?o.setAttribute("title",e):mxUtils.write(o,e)),this.container.appendChild(o),null!=t&&(mxEvent.addListener(o,"click",t),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",t)),e=mxUtils.bind(this,function(e){null!=a?o.setAttribute("src",n):o.style.backgroundColor=""}),mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){if(null!=a?o.setAttribute("src",a):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var n=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),n!=o&&(this.currentImg=o,this.menu.factoryMethod=s,n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(n.x,n.y,null,e),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(o,"mouseout",e),o},mxToolbar.prototype.addCombo=function(e){var n=document.createElement("div");n.style.display="inline",n.className="mxToolbarComboContainer";var t=document.createElement("select");return t.className=e||"mxToolbarCombo",n.appendChild(t),this.container.appendChild(n),t},mxToolbar.prototype.addActionCombo=function(e,n){var t=document.createElement("select");return t.className=n||"mxToolbarCombo",this.addOption(t,e,null),mxEvent.addListener(t,"change",function(e){var n=t.options[t.selectedIndex];t.selectedIndex=0,null!=n.funct&&n.funct(e)}),this.container.appendChild(t),t},mxToolbar.prototype.addOption=function(e,n,t){var a=document.createElement("option");return mxUtils.writeln(a,n),"function"==typeof t?a.funct=t:a.setAttribute("value",t),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,n,t,a,i){var s=document.createElement("img");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",n),s.altIcon=a,null!=e&&s.setAttribute("title",e),mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),t()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),t()),s},mxToolbar.prototype.addMode=function(e,n,t,a,i,s){s=null==s||s;var o=document.createElement(null!=n?"img":"button");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",n),o.altIcon=a,null!=e&&o.setAttribute("title",e),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(e){this.selectMode(o,t),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=t,this.selectMode(o,t))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(e,n){if(this.selectedMode!=e){if(null!=this.selectedMode){var t=this.selectedMode.altIcon;null!=t?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(t=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",t)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",n))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="
",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,n,t){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,n,t){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,n,t))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(t,a,n){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=n?n(e):this.stop(e)});mxUtils.get(t,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",t,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var n=e.getDocumentElement();null==n?i("Invalid response: "+e.getText()):this.receive(n)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,n){for(var t="",a=n?-1:1,i=n?e.length-1:0;0<=i&&i<e.length;i+=a){var s=this.codec.encode(e[i]);t=t+mxUtils.getXml(s,this.linefeed)}return t},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var n=e.getAttribute("namespace");for(null!=n&&(this.model.prefix=n+"-"),n=e.firstChild;null!=n;){var t=n.nodeName.toLowerCase();"state"==t?this.processState(n):"delta"==t&&this.processDelta(n),n=n.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var n=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",n))}},mxSession.prototype.createUndoableEdit=function(e){var n=new mxUndoableEdit(this.model,this.significantRemoteChanges);return n.changes=e,n.notify=function(){n.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",n,"changes",n.changes)),n.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",n,"changes",n.changes))},n},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var n=[];for(e=e.firstChild;null!=e;){var t=this.decodeChange(e);null!=t&&n.push(t),e=e.nextSibling}return n},mxSession.prototype.decodeChange=function(e){var n=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(n="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(n.model=this.model,n.execute(),"mxChildChange"==e.nodeName&&null==n.parent&&this.cellRemoved(n.child))),n},mxSession.prototype.cellRemoved=function(e,n){this.codec.putObject(e.getId(),e);for(var t=this.model.getChildCount(e),a=0;a<t;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var n=this.changes[e];null!=n.execute?n.execute():null!=n.undo&&n.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,n=0;n<e;n++){var t=this.changes[n];null!=t.execute?t.execute():null!=t.redo&&t.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var n=this.history[this.indexOfNextAdd++];if(n.redo(),n.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",n));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),n=0;n<e.length;n++)e[n].die()};var mxUrlConverter=function(e){var t=!0,a=null,i=null;return{isEnabled:function(){return t},setEnabled:function(e){t=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(t&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var n=(a=i+location.pathname).lastIndexOf("/");0<n&&(a=a.substring(0,n+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(s){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,n){},mouseMove:function(e,n){},mouseUp:mxUtils.bind(this,function(e,n){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-s.container.scrollLeft-Math.ceil(this.dx),n=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(e,n),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(e,n,t,a){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,a=null!=a?a:0;var i=s.container;this.dx=e+(null!=t?t:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=n+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=n-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=s.panDx,n=s.panDy;0==e&&0==n||(s.panGraph(0,0),s.view.setTranslate(this.t0x+e/s.view.scale,this.t0y+n/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.graphModelChanged(n.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,n,t,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=n?n:6,this.ease=null!=t?t:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,n){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=n&&n;var t=null;if(e.ownerDocument!=document)for(t=e;null!=t&&"svg"!=t.nodeName;)t=t.parentNode;null!=t&&(0<t.getElementsByTagName("defs").length&&(this.defs=t.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=t.firstChild?t.insertBefore(this.defs,t.firstChild):t.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var o=document.createElement("tr");o.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=n?((i=document.createElement("img")).src=n,r.appendChild(i)):null!=i&&((n=document.createElement("div")).className=i,r.appendChild(n)),o.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),mxUtils.write(r,e),r.align="left",o.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",o.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(o),(null==s||s)&&(mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){this.eventReceiver=o,a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),o.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==o&&(a.activeRow!=o&&this.hideMenu(),null!=t&&t(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(o,"mouseout",mxUtils.bind(this,function(e){o.className="mxPopupMenuItem"}))),o},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var n=document.createElement("img");n.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(n)},mxPopupMenu.prototype.showSubmenu=function(e,n){if(null!=n.div){n.div.style.left=e.div.offsetLeft+n.offsetLeft+n.offsetWidth-1+"px",n.div.style.top=e.div.offsetTop+n.offsetTop+"px",document.body.appendChild(n.div);var t=parseInt(n.div.offsetLeft),a=parseInt(n.div.offsetWidth),i=document.body,s=document.documentElement;t+a>(i.scrollLeft||s.scrollLeft)+(i.clientWidth||s.clientWidth)&&(n.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(n.div)}},mxPopupMenu.prototype.addSeparator=function(e,n){if(e=e||this,this.smartSeparators&&!n)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var t=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",t.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),t.appendChild(a),e.tbody.appendChild(t)}},mxPopupMenu.prototype.popup=function(e,n,t,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=n+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,t,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var n=0;n<this.cells.length;n++)this.animateCell(cells[n],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,n,t){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();i.x+=s.x*o,i.y+=s.y*o,n.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(t&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),n,t)},mxMorphing.prototype.stopRecursion=function(e,n){return null!=n&&(0!=n.x||0!=n.y)},mxMorphing.prototype.getDelta=function(e){var n=this.getOriginForCell(e.cell),t=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-t.x,e.y/a-t.y),new mxPoint((n.x-e.x)*a,(n.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var n=null;return null!=e&&(n=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(n.x+=e.x,n.y+=e.y)),null==n&&(n=new mxPoint(-(n=this.graph.view.getTranslate()).x,-n.y)),n},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,n,t){this.images[e]={value:n,fallback:t}},mxImageBundle.prototype.getImage=function(e){var n=null;return null!=e&&(null!=(e=this.images[e])&&(n=this.alt?e.fallback:e.value)),n},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,n){null!=e&&(this.visitStatesRecursive(e,n,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,n,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,n,t){if(null!=e){t(e,n);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),s=0;s<i;s++){var o=a.view.getState(a.model.getChildAt(e.cell,s));this.visitStatesRecursive(o,n,t)}}},mxImageExport.prototype.drawCellState=function(e,n){e.shape instanceof mxShape&&(n.save(),e.shape.paint(n),n.restore()),null!=e.text&&(n.save(),e.text.paint(n),n.restore())},mxImageExport.prototype.drawOverlays=function(e,t){null!=e.overlays&&e.overlays.visit(function(e,n){n instanceof mxShape&&n.paint(t)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,n=2;n<arguments.length;n+=2)this.lastX=arguments[n-1],this.lastY=arguments[n],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,n,t,a,i){return t*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,n),Math.cos(t),Math.sin(t),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,n){this.state.dx+=e,this.state.dy+=n},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){(t=this.state).fillColor=e,t.fillAlpha=null!=r?r:1,t.gradientColor=n,t.gradientAlpha=null!=l?l:1,t.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,n){this.state.shadowDx=e,this.state.shadowDy=n},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,n){this.addOp(this.moveOp,e,n)},mxAbstractCanvas2D.prototype.lineTo=function(e,n){this.addOp(this.lineOp,e,n)},mxAbstractCanvas2D.prototype.quadTo=function(e,n,t,a){this.addOp(this.quadOp,e,n,t,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){this.addOp(this.curveOp,e,n,t,a,i,s)},mxAbstractCanvas2D.prototype.arcTo=function(e,n,t,a,i,s,o){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,n,t,a,i,s,o),n=0;n<e.length;n+=6)this.curveTo(e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5])},mxAbstractCanvas2D.prototype.close=function(e,n,t,a,i,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("scale");n.setAttribute("scale",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.translate=function(e,n){var t=this.createElement("translate");t.setAttribute("dx",this.format(e)),t.setAttribute("dy",this.format(n)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rotate=function(e,n,t,a,i){var s=this.createElement("rotate");(0!=e||n||t)&&(s.setAttribute("theta",this.format(e)),s.setAttribute("flipH",n?"1":"0"),s.setAttribute("flipV",t?"1":"0"),s.setAttribute("cx",this.format(a)),s.setAttribute("cy",this.format(i)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var n=this.createElement("alpha");n.setAttribute("alpha",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var n=this.createElement("fillcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setGradient=function(e,n,t,a,i,s,o,r,l){if(null!=e&&null!=n){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",n),d.setAttribute("x",this.format(t)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(s)),null!=o&&d.setAttribute("direction",o),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var n=this.createElement("strokecolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var n=this.createElement("strokewidth");n.setAttribute("width",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var n=this.createElement("dashed");n.setAttribute("dashed",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var n=this.createElement("dashpattern");n.setAttribute("pattern",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var n=this.createElement("linecap");n.setAttribute("cap",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var n=this.createElement("linejoin");n.setAttribute("join",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var n=this.createElement("miterlimit");n.setAttribute("limit",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var n=this.createElement("fontcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var n=this.createElement("fontbackgroundcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var n=this.createElement("fontbordercolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var n=this.createElement("fontsize");n.setAttribute("size",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var n=this.createElement("fontfamily");n.setAttribute("family",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var n=this.createElement("fontstyle");n.setAttribute("style",e),this.root.appendChild(n)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var n=this.createElement("shadow");n.setAttribute("enabled",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var n=this.createElement("shadowcolor");n.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var n=this.createElement("shadowalpha");n.setAttribute("alpha",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,n){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==n)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var t=this.createElement("shadowoffset");t.setAttribute("dx",e),t.setAttribute("dy",n),this.root.appendChild(t)},mxXmlCanvas2D.prototype.rect=function(e,n,t,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(e)),o.setAttribute("y",this.format(n)),o.setAttribute("w",this.format(t)),o.setAttribute("h",this.format(a)),o.setAttribute("dx",this.format(i)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(n)),i.setAttribute("w",this.format(t)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(n)),l.setAttribute("w",this.format(t)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",s?"1":"0"),l.setAttribute("flipH",o?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,n){var t=this.createElement("move");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.lineTo=function(e,n){var t=this.createElement("line");t.setAttribute("x",this.format(e)),t.setAttribute("y",this.format(n)),this.root.appendChild(t),this.lastX=e,this.lastY=n},mxXmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(n)),i.setAttribute("x2",this.format(t)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=t,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,n,t,a,i,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(e)),o.setAttribute("y1",this.format(n)),o.setAttribute("x2",this.format(t)),o.setAttribute("y2",this.format(a)),o.setAttribute("x3",this.format(i)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=i,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(n)),u.setAttribute("w",this.format(t)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=s&&u.setAttribute("align",s),null!=o&&u.setAttribute("valign",o),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,n){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(n||mxConstants.NS_SVG,e);var t=this.root.ownerDocument.createElement(e);return null!=n&&t.setAttribute("xmlns",n),t},mxSvgCanvas2D.prototype.createGradientId=function(e,n,t,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==n.charAt(0)&&(n=n.substring(1)),e=e.toLowerCase()+"-"+t,n=n.toLowerCase()+"-"+a,(t=null)==i||i==mxConstants.DIRECTION_SOUTH?t="s":i==mxConstants.DIRECTION_EAST?t="e":(a=e,e=n,n=a,i==mxConstants.DIRECTION_NORTH?t="s":i==mxConstants.DIRECTION_WEST&&(t="e")),"mx-gradient-"+e+"-"+n+"-"+t},mxSvgCanvas2D.prototype.getSvgGradient=function(e,n,t,a,i){var s=this.createGradientId(e,n,t,a,i),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,l=0,d=s+"-"+l;if(null!=r)for(o=r.ownerDocument.getElementById(d);null!=o&&o.ownerSVGElement!=r;)d=s+"-"+l++,o=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(e,n,t,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(o):r.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,n,t,a,i){var s=this.createElement("linearGradient");return s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%"),t=t<1?";stop-opacity:"+t:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+t),s.appendChild(i),t=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+n+t),s.appendChild(i),s},mxSvgCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("path"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=t.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?t.setAttribute("fill","none"):t.setAttribute("fill","transparent"),e=!1),n&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||t.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&t.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(t)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(t)),this.pointerEvents&&("path"!=t.nodeName||this.path[this.path.length-1]==this.closeOp)&&t.setAttribute("pointer-events","all"),this.root.appendChild(t)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var n=Math.max(1,this.format(e.strokeWidth*e.scale));1!=n&&this.node.setAttribute("stroke-width",n),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(n))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var n=e.lineCap;"flat"==n&&(n="butt"),"butt"!=n&&this.node.setAttribute("stroke-linecap",n)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var n=this.state.dashPattern.split(" "),t=[];if(0<n.length)for(var a=0;a<n.length;a++)t[a]=Number(n[a])*e;return t.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var n=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,n,t,a,i){if(0!=e||n||t){var s=this.state;if(a+=s.dx,i+=s.dy,a*=s.scale,i*=s.scale,s.transform=s.transform||"",n&&t)e+=180;else if(n^t){var o=n?a:0,r=n?-1:1,l=t?i:0,d=t?-1:1;s.transform+="translate("+this.format(o)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-o)+","+this.format(-l)+")"}(n?!t:t)&&(e*=-1),0!=e&&(s.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),s.rotation+=e,s.rotationCx=a,s.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,n,t,a){var i=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((e+i.dx)*i.scale)),s.setAttribute("y",this.format((n+i.dy)*i.scale)),s.setAttribute("width",this.format(t*i.scale)),s.setAttribute("height",this.format(a*i.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.rect(e,n,t,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,n,t,a){var i=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((e+t/2+i.dx)*i.scale)),s.setAttribute("cy",Math.round((n+a/2+i.dy)*i.scale)),s.setAttribute("rx",t/2*i.scale),s.setAttribute("ry",a/2*i.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){i=this.converter.convert(i),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var l=this.state;e+=l.dx,n+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),s||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",o||r){var c=s=1,m=0,u=0;o&&(s=-1,m=-t-2*e),r&&(c=-1,u=-a-2*n),i+="scale("+s+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(n*l.scale)),d.setAttribute("width",this.format(t*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,n,t,a,i){return t=this.state,a="display:inline-block;font-size:"+Math.round(t.fontSize)+"px;font-family:"+t.fontFamily+";color:"+t.fontColor+";line-height:"+Math.round(t.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),n==mxConstants.ALIGN_CENTER?a+="text-align:center;":n==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),n="",null!=t.fontBackgroundColor&&(n+="background-color:"+t.fontBackgroundColor+";"),null!=t.fontBorderColor&&(n+="border:1px solid "+t.fontBorderColor+";"),mxUtils.isNode(e)||((t=document.createElement("textarea")).innerHTML=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">"),e=t.value,i?a+=n:0<n.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+n+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,n+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<t&&(p+="width:"+Math.round(t)+"px;")):d&&(p+="width:"+Math.round(t)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<t&&(p+="width:"+Math.round(t)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,s,o,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);t=d?Math.max(t,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,s==mxConstants.ALIGN_CENTER?i-=t/2:s==mxConstants.ALIGN_RIGHT&&(i-=t),e+=i,o==mxConstants.ALIGN_MIDDLE?d-=a/2:o==mxConstants.ALIGN_BOTTOM&&(d-=a),n+=d,s=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(s+="rotate("+u.rotation+","+t/2+","+a/2+")",e=(n=this.rotatePoint((e+t/2)*u.scale,(n+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-t*u.scale/2,n=n.y-a*u.scale/2):(e*=u.scale,n*=u.scale),0!=m&&(s+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(n)+")"+s),l.setAttribute("width",Math.round(Math.max(1,t))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,n,t,a,i,s,o,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,n,t,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(t=Math.round(t))+"-"+(a=Math.round(a)),s=0,o=i+"-"+s;null!=document.getElementById(o);)o=i+"-"+ ++s;return clip=this.createElement("clipPath"),clip.setAttribute("id",o),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",n),i.setAttribute("width",t),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(n*r.scale)+")"),d&&0<t&&0<a){var g=e;c=n,s==mxConstants.ALIGN_CENTER?g-=t/2:s==mxConstants.ALIGN_RIGHT&&(g-=t),o==mxConstants.ALIGN_MIDDLE?c-=a/2:o==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,t*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,s),"start"!=(c=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=n+m-1,o==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:o==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,n,t,v,s,o,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var n=this.state;e.setAttribute("fill",n.fontColor),(!this.styleEnabled||n.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",n.fontFamily),(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,n,t,a,i,s,o,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;null!=(c=l?(o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,a*d.scale,(i-2)*d.scale,(s+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),n=mxClient.IS_IE&&mxClient.IS_SVG,new mxRectangle(c.x,c.y+(n?0:1),c.width,c.height+(n?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),n=mxUtils.htmlEntities(n,!1),c.innerHTML=n.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,s=c.offsetHeight,c.parentNode.removeChild(c),o==mxConstants.ALIGN_CENTER?t-=i/2:o==mxConstants.ALIGN_RIGHT&&(t-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((t+1)*d.scale,(a+2)*d.scale,i*d.scale,(s+1)*d.scale)))&&((n=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),n.setAttribute("stroke",d.fontBorderColor||"none"),n.setAttribute("x",Math.floor(c.x-1)),n.setAttribute("y",Math.floor(c.y-1)),n.setAttribute("width",Math.ceil(c.width+2)),n.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,n.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&n.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(n,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,n){this.graph=e,this.setStates(n)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,n){var t=this.node,a=this.state;if(null!=t){if("shape"==t.nodeName){if(!(null!=this.path&&0<this.path.length))return;t.path=this.path.join(" ")+" e",t.style.width=this.root.style.width,t.style.height=this.root.style.height,t.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height)}t.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(t,e&&null!=a.fillColor,n&&null!=a.strokeColor)),n&&null!=a.strokeColor?(t.stroked="true",t.strokecolor=a.strokeColor):t.stroked="false",t.appendChild(this.createStroke()),e&&null!=a.fillColor?t.appendChild(this.createFill()):!this.pointerEvents||"shape"==t.nodeName&&this.path[this.path.length-1]!=this.closeOp?t.filled="false":t.appendChild(this.createTransparentFill()),this.root.appendChild(t)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":fill");if(n.color=e.fillColor,null!=e.gradientColor){n.type="gradient",n.method="none",n.color2=e.gradientColor;var t=180-e.rotation;t=e.gradientDirection==mxConstants.DIRECTION_WEST?t-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?t+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?t-(180+("y"==this.root.style.flip?-180:0)):t+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(t*=-1),n.angle=mxUtils.mod(t,360),n.opacity=100*e.alpha*e.fillAlpha+"%",n.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(n.opacity=100*e.alpha+"%");return n},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,n=document.createElement(mxClient.VML_PREFIX+":stroke");return n.endcap=e.lineCap||"flat",n.joinstyle=e.lineJoin||"miter",n.miterlimit=e.miterLimit||"10",e.alpha<1&&(n.opacity=100*e.alpha+"%"),e.dashed&&(n.dashstyle=this.getVmlDashStyle()),n},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var n=this.state.dashPattern.split(" ");0<n.length&&1==n[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,n,t){var a=this.state,i=-a.rotation*(Math.PI/180),s=Math.cos(i),o=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?o*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(o*s-r*i)+"px",l.style.marginTop=Math.round(o*i+r*s)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),t?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",n?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,n,t,a,i){n&&t?e+=180:n?this.root.style.flip="x":t&&(this.root.style.flip="y"),(n?!t:t)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,n,t,a){var i=this.state,s=(this.lastX+i.dx)*i.scale,o=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;o+=2/3*((n=(n+i.dy)*i.scale)-o);var r=(t=(t+i.dx)*i.scale)+2/3*(e-t);n=(a=(a+i.dy)*i.scale)+2/3*(n-a),this.path.push("c "+this.format(s+2/3*(e-s))+" "+this.format(o)+" "+this.format(r)+" "+this.format(n)+" "+this.format(t)+" "+this.format(a)),this.lastX=t/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,n,t,a,i){var s=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((n+s.dx)*s.scale)+"px",e.style.top=this.format((t+s.dy)*s.scale)+"px",e.style.width=this.format(a*s.scale)+"px",e.style.height=this.format(i*s.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)},mxVmlCanvas2D.prototype.roundrect=function(e,n,t,a,i,s){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,n,t,a),this.node.setAttribute("arcsize",Math.max(100*i/t,100*s/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,n,t,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,n,t,a)},mxVmlCanvas2D.prototype.image=function(e,n,t,a,i,s,o,r){var l=null;s?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,n,t,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=s?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,n,t,a)).src=i,o&&r?l.style.rotation="180":o?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,n,t,a){t=document.createElement("div");var i=this.state,s="";return null!=i.fontBackgroundColor&&(s+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(s+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?t.appendChild(e):0<s.length&&!a?((a=document.createElement("div")).style.cssText=s,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,t.appendChild(a)):(t.style.cssText=s,t.innerHTML=e),(e=t.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=n||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),t},mxVmlCanvas2D.prototype.text=function(e,n,t,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(n=this.rotatePoint(e,n,u.rotation,u.rotationCx,u.rotationCy)).x,n=n.y),8==document.documentMode?(e+=u.dx,n+=u.dy):(e*=u.scale,n*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(n)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(s,o)).x,v=v.y;if(i=this.createDiv(i,s,o,d),s=document.createElement("div"),r?(!c&&0<t&&(i.style.width=Math.round(t)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(s.style.display="inline",s.style.zoom="1",s.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(s),l.appendChild(p)):l.appendChild(s)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<t&&(i.style.width=Math.round(t)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=t+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){t=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(t)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-t)).toFixed(8)),(t%=2*Math.PI)<0&&(t+=2*Math.PI),(t%=Math.PI)>Math.PI/2&&(t=Math.PI-t),o=Math.cos(t);var h=Math.sin(t);8==document.documentMode&&(i.style.display="inline-block",s.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*o+t*-h)/2-m*t*(g+.5)+r*a*(v+.5),d=(t-t*o+a*-h)/2+r*t*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-t/2)*u.scale)+"px",g.style.top=this.format(n+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-t/2)*u)+"px",l.style.top=this.format(n+(c-a/2)*u)+"px"),s.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",s.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(s.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",s.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),t=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+t*g*this.state.scale)+"px",l.style.top=this.format(n+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,n,t,a,mxUtils.htmlEntities(i,!1),s,o,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,n,t,a,i,s,o,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,n=(n+a.dy)*a.scale,(t=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",t.style.height="1px",t.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),t.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+s,d.style.align=s,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",s=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=s+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=s+((i=i.split("\n")).length-1)*s*mxConstants.LINE_HEIGHT,s=i=0,o==mxConstants.ALIGN_BOTTOM?s=-a/2:o!=mxConstants.ALIGN_MIDDLE&&(s=a/2),null!=m&&(o=(t.style.rotation=m)*(Math.PI/180),i=Math.sin(o)*s,s*=Math.cos(o)),t.appendChild(d),t.style.left=this.format(e-i)+"px",t.style.top=this.format(n+s)+"px",this.root.appendChild(t)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,n){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var t=this.graph.getView().translate,i=this.graph.getView().scale,s=e.x,o=e.y,r=!1,l=!1,d=f=this.getGuideTolerance(),c=f;(f=a.clone()).x+=e.x,f.y+=e.y;var m=f.x,u=f.x+f.width,p=f.getCenterX(),g=f.y,v=f.y+f.height,h=f.getCenterY();e=function(e){e+=this.graph.panDx;var n=!1;if(Math.abs(e-p)<d?(s=e-a.getCenterX(),d=Math.abs(e-p),n=!0):Math.abs(e-m)<d?(s=e-a.x,d=Math.abs(e-m),n=!0):Math.abs(e-u)<d&&(s=e-a.x-a.width,d=Math.abs(e-u),n=!0),n){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,t.scrollHeight-3-this.graph.panDy)]}r=r||n};for(var f=function(e){e+=this.graph.panDy;var n=!1;if(Math.abs(e-h)<c?(o=e-a.getCenterY(),c=Math.abs(e-h),n=!0):Math.abs(e-g)<c?(o=e-a.y,c=Math.abs(e-g),n=!0):Math.abs(e-v)<c&&(o=e-a.y-a.height,c=Math.abs(e-v),n=!0),n){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var t=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(t.scrollWidth-3-this.graph.panDx,e)]}l=l||n},b=0;b<this.states.length;b++){var A=this.states[b];null!=A&&(this.horizontal&&(e.call(this,A.getCenterX()),e.call(this,A.x),e.call(this,A.x+A.width)),this.vertical&&(f.call(this,A.getCenterY()),f.call(this,A.y),f.call(this,A.y+A.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",n&&(r||(n=a.x-(this.graph.snap(a.x/i-t.x)+t.x)*i,s=this.graph.snap(s/i)*i-n),l||(t=a.y-(this.graph.snap(a.y/i-t.y)+t.y)*i,o=this.graph.snap(o/i)*i-t)),e=new mxPoint(s,o)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}},mxStencil.prototype.parseConstraint=function(e){var n=Number(e.getAttribute("x")),t=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(n,t),e)},mxStencil.prototype.evaluateTextAttribute=function(e,n,t){return n=this.evaluateAttribute(e,n,t),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(n=mxResources.get(n)),n},mxStencil.prototype.evaluateAttribute=function(e,n,t){return null==(n=e.getAttribute(n))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(n=e(t)))),n},mxStencil.prototype.drawShape=function(e,n,t,a,i,s){this.drawChildren(e,n,t,a,i,s,this.bgNode,!1),this.drawChildren(e,n,t,a,i,s,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,n,t,a,i,s,o,r){if(null!=o){var l=mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,null);for(t=this.computeAspect(n.style,t,a,i,s,l),a=Math.min(t.width,t.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(n.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),o=o.firstChild;null!=o;)o.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,o,t,r),o=o.nextSibling}},mxStencil.prototype.computeAspect=function(e,n,t,a,i,s){e=n,n=a/this.w0;var o=i/this.h0;if(s="north"==s||"south"==s){o=a/this.h0,n=i/this.w0;var r=(a-i)/2;e+=r,t-=r}return"fixed"==this.aspect&&(n=o=Math.min(n,o),s?(e+=(i-this.w0*n)/2,t+=(a-this.h0*o)/2):(e+=(a-this.w0*n)/2,t+=(i-this.h0*o)/2)),new mxRectangle(e,t,n,o)},mxStencil.prototype.drawNode=function(e,n,t,a,i){var s=t.nodeName,o=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==s)e.save();else if("restore"==s)e.restore();else if("path"==s)for(e.begin(),t=t.firstChild;null!=t;)t.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,n,t,a,i),t=t.nextSibling;else if("close"==s)e.close();else if("move"==s)e.moveTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("line"==s)e.lineTo(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("quad"==s)e.quadTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d);else if("curve"==s)e.curveTo(o+Number(t.getAttribute("x1"))*l,r+Number(t.getAttribute("y1"))*d,o+Number(t.getAttribute("x2"))*l,r+Number(t.getAttribute("y2"))*d,o+Number(t.getAttribute("x3"))*l,r+Number(t.getAttribute("y3"))*d);else if("arc"==s)e.arcTo(Number(t.getAttribute("rx"))*l,Number(t.getAttribute("ry"))*d,Number(t.getAttribute("x-axis-rotation")),Number(t.getAttribute("large-arc-flag")),Number(t.getAttribute("sweep-flag")),o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d);else if("rect"==s)e.rect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("roundrect"==s)0==(n=t.getAttribute("arcsize"))&&(n=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,n=Number(n)/100,n=Math.min(c*n,a*n),e.roundrect(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,c,a,n,n);else if("ellipse"==s)e.ellipse(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d);else if("image"==s)n=this.evaluateAttribute(t,"src",n),e.image(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,Number(t.getAttribute("w"))*l,Number(t.getAttribute("h"))*d,n,!1,"1"==t.getAttribute("flipH"),"1"==t.getAttribute("flipV"));else if("text"==s){if(c=this.evaluateTextAttribute(t,"str",n),a="1"==t.getAttribute("vertical")?-90:0,"0"==t.getAttribute("align-shape")){var m=n.rotation,u=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPH,0);n=1==mxUtils.getValue(n.style,mxConstants.STYLE_FLIPV,0),a=u&&n?a-m:u||n?a+m:a-m}a-=t.getAttribute("rotation"),e.text(o+Number(t.getAttribute("x"))*l,r+Number(t.getAttribute("y"))*d,0,0,c,t.getAttribute("align")||"left",t.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==s)null!=(m=mxStencilRegistry.getStencil(t.getAttribute("name")))&&(o+=Number(t.getAttribute("x"))*l,r+=Number(t.getAttribute("y"))*d,c=Number(t.getAttribute("w"))*l,a=Number(t.getAttribute("h"))*d,m.drawShape(e,n,o,r,c,a));else if("fillstroke"==s)e.fillAndStroke();else if("fill"==s)e.fill();else if("stroke"==s)e.stroke();else if("strokewidth"==s)e.setStrokeWidth(Number(t.getAttribute("width"))*c);else if("dashed"==s)e.setDashed("1"==t.getAttribute("dashed"));else if("dashpattern"==s){if(null!=(t=t.getAttribute("pattern"))){for(t=t.split(" "),l=[],d=0;d<t.length;d++)0<t[d].length&&l.push(Number(t[d])*c);t=l.join(" "),e.setDashPattern(t)}}else"strokecolor"==s?e.setStrokeColor(t.getAttribute("color")):"linecap"==s?e.setLineCap(t.getAttribute("cap")):"linejoin"==s?e.setLineJoin(t.getAttribute("join")):"miterlimit"==s?e.setMiterLimit(Number(t.getAttribute("limit"))):"fillcolor"==s?e.setFillColor(t.getAttribute("color")):"alpha"==s?e.setAlpha(t.getAttribute("alpha")):"fontcolor"==s?e.setFontColor(t.getAttribute("color")):"fontstyle"==s?e.setFontStyle(t.getAttribute("style")):"fontfamily"==s?e.setFontFamily(t.getAttribute("family")):"fontsize"==s&&e.setFontSize(Number(t.getAttribute("size"))*c);i&&("fillstroke"==s||"fill"==s||"stroke"==s)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var n=1;n<this.points.length;n++)null!=e[n]&&this.bounds.add(new mxRectangle(Number(e[n].x),Number(e[n].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,n=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(n=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+n+","+n+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var t=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));n=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(n,!1);""!=n.tagUrn&&(n.coordsize=t*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),n=this.scale,e.translate(-Math.round(this.bounds.x/n),-Math.round(this.bounds.y/n))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=n+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var n in e.gradients){var t=e.gradients[n];t.mxRefCount=(t.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n,s=this.bounds.height/n;if(this.isPaintBoundsInverted()){t=t+(o=(i-s)/2),a=a-o;var o=i;i=s,s=o}if(this.updateTransform(e,t,a,i,s),this.configureCanvas(e,t,a,i,s),null!=this.stencil)this.paintStencilShape(e,t,a,i,s);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(t=[],a=0;a<this.points.length;a++)t.push(new mxPoint(this.points[a].x/n,this.points[a].y/n));this.paintEdgeShape(e,t)}else this.paintVertexShape(e,t,a,i,s)},mxShape.prototype.configureCanvas=function(e,n,t,a,i){var s=null;null!=this.style&&(s=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=s&&e.setDashPattern(s),null!=this.gradient?(n=this.getGradientBounds(e,n,t,a,i),e.setGradient(this.fill,this.gradient,n.x,n.y,n.width,n.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,i)},mxShape.prototype.updateTransform=function(e,n,t,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,n+a/2,t+i/2)},mxShape.prototype.paintStencilShape=function(e,n,t,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,n,t,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,n,t,a,i)},mxShape.prototype.paintVertexShape=function(e,n,t,a,i){this.paintBackground(e,n,t,a,i),e.setShadow(!1),this.paintForeground(e,n,t,a,i)},mxShape.prototype.paintBackground=function(e,n,t,a,i){},mxShape.prototype.paintForeground=function(e,n,t,a,i){},mxShape.prototype.paintEdgeShape=function(e,n){},mxShape.prototype.getArcSize=function(e,n){var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*t,n*t)},mxShape.prototype.paintGlassEffect=function(e,n,t,a,i,s){var o=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",n,t,a,.6*i,"south",.9,.1),e.begin(),s+=2*o,this.isRounded?(e.moveTo(n-o+s,t-o),e.quadTo(n-o,t-o,n-o,t-o+s),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o+s),e.quadTo(n+a+o,t-o,n+a+o-s,t-o)):(e.moveTo(n-o,t-o),e.lineTo(n-o,t+.4*i),e.quadTo(n+.5*a,t+.7*i,n+a+o,t+.4*i),e.lineTo(n+a+o,t-o)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var n=(e.width-e.height)/2;e.x+=n,e.y-=n,n=e.width,e.width=e.height,e.height=n}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var n=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(n/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,n,t,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",n),e.setAttribute("y",t),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var n in e){var t=e[n];t.mxRefCount=(t.mxRefCount||0)-1,0==t.mxRefCount&&null!=t.parentNode&&t.parentNode.removeChild(t)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,n){mxStencilRegistry.stencils[e]=n},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,n){mxMarker.markers[e]=n},createMarker:function(e,n,t,a,i,s,o,r,l,d){var c=mxMarker.markers[t];return null!=c?c(e,n,t,a,i,s,o,r,l,d):null}};function mxActor(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxCloud(e,n,t,a){mxActor.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxRhombus(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxPolyline(e,n,t){mxShape.call(this),this.points=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxArrow(e,n,t,a,i,s,o){mxShape.call(this),this.points=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxText(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,A){mxShape.call(this),this.value=e,this.bounds=n,this.color=null!=i?i:"black",this.align=null!=t?t:"",this.valign=null!=a?a:"",this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=f&&f,this.overflow=null!=b?b:"visible",this.labelPadding=null!=A?A:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,n,t){mxShape.call(this),this.bounds=e,this.stroke=n,this.strokewidth=null!=t?t:1}function mxImageShape(e,n,t,a,i){mxShape.call(this),this.bounds=e,this.image=n,this.fill=t,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,n,t,a){mxRectangleShape.call(this,e,n,t,a)}function mxCylinder(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxConnector(e,n,t){mxPolyline.call(this,e,n,t)}function mxSwimlane(e,n,t,a){mxShape.call(this),this.bounds=e,this.fill=n,this.stroke=t,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,n,t,a,i,s){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=null!=t?t:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=s?s:0}function mxPartitionLayout(e,n,t,a){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.spacing=t||0,this.border=a||0}function mxCompactTreeLayout(e,n,t){mxGraphLayout.call(this,e),this.horizontal=null==n||n,this.invert=null!=t&&t}function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,n){mxGraphLayout.call(this,e),this.radius=null!=n?n:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,n,t){mxGraphLayout.call(this,e),this.layouts=n,this.master=t}function mxEdgeLabelLayout(e,n){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,n,t,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=t,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,t=[],null==n&&(n=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,n,t),a=0;a<n.length;a++){i=t[a].connectsAsSource;for(var s=0;s<i.length;s++){var o=i[s];if(null!=(r=o.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];t[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&t[a]!=l&&(0==(o.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,o)<0&&l.connectsAsTarget.push(o))}}t[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,n,t,a,i,s){this.layout=e,this.intraCellSpacing=n,this.interRankCellSpacing=t,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=s}!function(){function e(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,r=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=r,o=t!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*o-n,a.y+=-s*o-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-s/2,c.y-s+i/2),t==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*s/4),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function n(e,n,t,a,i,s,o,r,l,d){r=t==mxConstants.ARROW_DIAMOND?.7071:.9862,n=i*l*r,r*=s*l,i*=o+l,s*=o+l;var c=a.clone();c.x-=n,c.y-=r,a.x+=-i-n,a.y+=-s-r;var m=t==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-s/m,c.y+i/m-s/2),e.lineTo(c.x-i,c.y-s),e.lineTo(c.x-i/2+s/m,c.y-s/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,n,t,a,i,s,o,r,l,d){n=1.118*i*l,t=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=n,c.y-=t,a.x+=2*-n,a.y+=2*-t,function(){e.begin(),e.moveTo(c.x-i-s/2,c.y-s+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,n,t,a,i,s,o,r,l,d){var c=o/2,m=a.clone();return a.x-=i*c,a.y-=s*c,function(){e.ellipse(m.x-c,m.y-c,o,o),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,n,t,a,i){n=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-n,2*i/5,a/2-n,0,a/2,0),e.curveTo(a/2+n,0,a/2+n,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,n,t,a,i){if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.min(a*s,i*s);e.roundrect(n,t,a,i,s,s)}else e.rect(n,t,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,n,t,a,i){this.glass&&this.paintGlassEffect(e,n,t,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var n=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,n)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-n/2)+"px",e.style.top=Math.round(this.bounds.y-n/2)+"px","CSS1Compat"==document.compatMode&&(n=-n),e.style.width=Math.round(Math.max(0,this.bounds.width+n))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+n))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var n=this.stroke;null!=n&&n!=mxConstants.NONE?(e.style.borderColor=n,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(n=this.fill)&&n!=mxConstants.NONE?(e.style.backgroundColor=n,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var n="";if(this.opacity<100&&(n+="alpha(opacity="+this.opacity+")"),this.isShadow&&(n+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var t=this.fill,a=this.gradient,i="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o?(i="1",s=t,t=a,a=s):2==o?(s=t,t=a,a=s):3==o&&(i="1"),n+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+t+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=n},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,n,t,a,i){e.ellipse(n,t,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,n,t,a,i){var s=Math.min(4,Math.min(a/5,i/5));i-=2*s,0<(a-=2*s)&&0<i&&e.ellipse(n+s,t+s,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,n,t,a,i){var s=a/2,o=i/2;e.begin(),e.moveTo(n+s,t),e.lineTo(n+a,t+o),e.lineTo(n+s,t+i),e.lineTo(n,t+o),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,n){this.paintLine(e,n,this.isRounded)},mxPolyline.prototype.paintLine=function(e,n,t){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=n[0],s=n[n.length-1];e.begin(),e.moveTo(i.x,i.y);for(var o=1;o<n.length-1;o++){var r=n[o],l=i.x-r.x;i=i.y-r.y;if(t&&o<n.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=n[o+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(s.x,s.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,n){var t=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,s=n[0],o=n[n.length-1],r=o.x-s.x,l=o.y-s.y,d=(c=Math.sqrt(r*r+l*l))-2*t-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=s.x-c/2+t*r)+c),u=(s=s.y-a/2+t*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,f=v-3*a;e.begin(),e.moveTo(i,s),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(o.x-t*r,o.y-t*l),e.lineTo(h,f),e.lineTo(h+c,f+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var n=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var t=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,t=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(n=e.getBBox()).width&&0==n.height)return;this.boundingBox=new mxRectangle(n.x,n.y,n.width,n.height),n=0}else a=this.state.view.textDiv,a=null!=this.offsetWidth&&null!=this.offsetHeight?(t=this.wrap?this.bounds.width:this.offsetWidth*this.scale,this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(t=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=t),t=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a.offsetHeight*this.scale):(t=this.wrap?this.bounds.width:e.offsetWidth*this.scale,e.offsetHeight*this.scale);null!=t&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*t,this.bounds.y+this.margin.y*a,t,a))}null!=this.boundingBox&&(0!=n&&(n=mxUtils.getBoundingBox(this.boundingBox,n),this.boundingBox.x=n.x,this.boundingBox.y=n.y,mxClient.IS_QUIRKS||(this.boundingBox.width=n.width,this.boundingBox.height=n.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,n,t,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var n=this.scale,t=this.bounds.x/n,a=this.bounds.y/n,i=this.bounds.width/n;n=this.bounds.height/n;this.updateTransform(e,t,a,i,n),this.configureCanvas(e,t,a,i,n);var s=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=s||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!s&&"html"==o&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==o?r.replace(/\n/g,"<br/>"):r,e.text(t,a,i,n,r,this.align,this.valign,this.wrap,o,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),n=this.node.style,t=this.margin.x,a=this.margin.y;0!=e?(n[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-t+"% "+100*-a+"%",n[mxClient.CSS_PREFIX+"Transform"]="translate("+100*t+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(n[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",n[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*t+"%,"+100*a+"%)"),n.left=Math.round(this.bounds.x)+"px",n.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,n=this.margin.x,t=this.margin.y,a=this.scale;e.filter="";var i=0,s=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var o=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(o=mxUtils.htmlEntities(o,!1)),o=this.replaceLinefeeds?o.replace(/\n/g,"<br/>"):o,r.innerHTML=o}i=r.offsetWidth+2,s=r.offsetHeight+2}else i=this.node.offsetWidth,s=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=s,r=this.bounds.width/a,o=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<o?(o=Math.min(o,s),e.height=Math.round(o+1)+"px"):o=s,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);o*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),s=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(o-o*d+r*c)/2+l*(n=r*-(n+.5))-s*(t=o*-(t+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+s+", M12="+l+", M21="+-l+", M22="+s+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+o*c)/2-s*n-l*t)-r/2)+"px",e.top=Math.round(this.bounds.y+m-o/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var n=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,t=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=n||null!=t)if("fill"==this.overflow)null!=n&&(this.node.style.backgroundColor=n),null!=t&&(this.node.style.border="1px solid "+t);else{var a="";null!=n&&(a+="background-color:"+n+";"),null!=t&&(a+="border:1px solid "+t+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var n=Math.round(this.bounds.width/this.scale),t=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<t&&(e.maxHeight=t+"px"),0<n&&(e.width=n+"px")):"fill"==this.overflow&&(e.width=n+"px",0<t&&(e.maxHeight=t+"px")),this.wrap?(!this.clipped&&0<n&&(e.width=n+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,n,t,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,n,t,a,i){t+=i/2,e.begin(),e.moveTo(n,t),e.lineTo(n+a,t),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,n,t,a,i){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==s&&null==o||(e.setFillColor(s),e.setStrokeColor(o),e.rect(n,t,a,i),e.fillAndStroke()),e.image(n,t,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var n=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=n,this.flipH&&this.flipV?n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?n+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(n+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=n&&(e.style.filter=n),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,n,t,a,i){this.paintImage(e,n,t,a,i),this.paintIndicator(e,n,t,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,n,t,a,i){null!=this.image&&(n=this.getImageBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(t-o)/2:i==mxConstants.ALIGN_RIGHT?e+(t-o-l):e+l,n=s==mxConstants.ALIGN_TOP?n+l:s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):n+(a-r)/2,o,r)},mxLabel.prototype.paintIndicator=function(e,n,t,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(n,t,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(n=this.getIndicatorBounds(n,t,a,i),e.image(n.x,n.y,n.width,n.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,n,t,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(t-o-l):i==mxConstants.ALIGN_CENTER?e+(t-o)/2:e+l,n=s==mxConstants.ALIGN_BOTTOM?n+(a-r-l):s==mxConstants.ALIGN_TOP?n+l:n+(a-r)/2,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var n=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);n.x-=this.bounds.x,n.y-=this.bounds.y,e.style.left=Math.round(n.x)+"px",e.style.top=Math.round(n.y)+"px",e.style.width=Math.round(n.width)+"px",e.style.height=Math.round(n.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,n,t,a,i){e.translate(n,t),e.begin(),this.redrawPath(e,n,t,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,n,t,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,n,t,a,i,s){n=Math.min(this.maxHeight,Math.round(i/5)),(s&&null!=this.fill||!s&&null==this.fill)&&(e.moveTo(0,n),e.curveTo(0,2*n,a,2*n,a,n),s||(e.stroke(),e.begin())),s||(e.moveTo(0,n),e.curveTo(0,-n/3,a,-n/3,a,n),e.lineTo(a,i-n),e.curveTo(a,i+n/3,0,i+n/3,0,i-n),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,n){var t=this.createMarker(e,n,!0),a=this.createMarker(e,n,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,n,this.isRounded):this.paintCurvedLine(e,n),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=t&&t(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,n){e.begin();var t=n[0],a=n.length;for(e.moveTo(t.x,t.y),t=1;t<a-2;t++){var i=n[t],s=n[t+1];e.quadTo(i.x,i.y,(i.x+s.x)/2,(i.y+s.y)/2)}i=n[a-2],s=n[a-1],e.quadTo(i.x,i.y,s.x,s.y),e.stroke()},mxConnector.prototype.createMarker=function(e,n,t){var a=n.length,i=t?n[1]:n[a-2],s=(a=(n=t?n[0]:n[a-1]).x-i.x,n.y-i.y),o=(i=a/(o=Math.max(1,Math.sqrt(a*a+s*s))),a=s/o,s=mxUtils.getNumber(this.style,t?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,t?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,o,n,i,a,s,t,this.strokewidth,0!=this.style[t?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var n=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(n=Math.max(n,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(n*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,n,t,a,i){return new mxRectangle(n,t,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,n,t){return 3*t*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,n,t,a,i){var s=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(n,t),this.isRounded?(l=this.getArcSize(a,i,s),this.paintRoundedSwimlane(e,n,t,a,i,s,l,o,r)):this.paintSwimlane(e,n,t,a,i,s,o,r),o=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,s,i,o),null!=this.image&&(i=this.getImageBounds(n,s,a,i),e.image(i.x-n,i.y-t,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,s,l))},mxSwimlane.prototype.paintSwimlane=function(e,n,t,a,i,s,o,r){o!=mxConstants.NONE&&(e.save(),e.setFillColor(o),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,s),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,s),r&&e.close(),e.fillAndStroke(),s<i&&o==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,n,t,a,i,s,o,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,o,o),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,s),e.lineTo(a,o),e.quadTo(a,0,a-Math.min(a/2,o),0),e.lineTo(Math.min(a/2,o),0),e.quadTo(0,0,0,o),e.lineTo(0,s),l&&e.close(),e.fillAndStroke(),s<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i-o),e.quadTo(0,i,Math.min(a/2,o),i),e.lineTo(a-Math.min(a/2,o),i),e.quadTo(a,i,a,i-o),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,n,t,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(n,t),e.lineTo(n,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,n,t,a){return new mxRectangle(e+t-this.imageSize,n,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,n,t){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,n,t,a){return null!=(n=null!=(t=this.graph.view.getState(n))?t.style:this.graph.getCellStyle(n))?n[e]:null},mxGraphLayout.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.graph.model.getEdgeAt(e,s),r=this.graph.model.getTerminal(o,!0)==e;n&&!r||(r=this.graph.view.getVisibleTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var n=this.graph.getModel();return!n.isEdge(e)||!this.graph.isCellVisible(e)||null==n.getTerminal(e,!0)||null==n.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,n?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,n){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,n?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var n=new mxPoint;if(null!=e&&e!=this.parent){var t=this.graph.getModel();if(t.isAncestor(this.parent,e))for(var a=t.getGeometry(e);e!=this.parent;)n.x+=a.x,n.y+=a.y,e=t.getParent(e),a=t.getGeometry(e)}return n},mxGraphLayout.prototype.setEdgePoints=function(e,n){if(null!=e){var t=this.graph.model,a=t.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=n)for(var i=t.getParent(e),s=(i=this.getParentOffset(i),0);s<n.length;s++)n[s].x-=i.x,n[s].y-=i.y;a.points=n,t.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e),s=null;if(null!=i){if(s=new mxRectangle(n,t,i.width,i.height),this.useBoundingBox){var o=this.graph.getView().getState(e);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var r=this.graph.getView().scale,l=o.text.boundingBox;o.text.boundingBox.x<o.x&&(n+=(o.x-l.x)/r,s.width=l.width),o.text.boundingBox.y<o.y&&(t+=(o.y-l.y)/r,s.height=l.height)}}null!=this.parent&&(null!=(o=a.getParent(e))&&o!=this.parent&&(n-=(o=this.getParentOffset(o)).x,t-=o.y)),i.x==n&&i.y==t||((i=i.clone()).x=n,i.y=t,a.setGeometry(e,i))}return s},mxGraphLayout.prototype.getVertexBounds=function(e){var n=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var t=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/t,s=Math.max(r.y-a.y,0)/t,o=Math.max(a.x+a.width-(r.x+r.width),0)/t,r=Math.max(a.y+a.height-(r.y+r.height),0)/t;n=new mxRectangle(n.x-i,n.y-s,n.width+i+o,n.height+s+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),n=n.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),n.x+=e.x,n.y+=e.y)),new mxRectangle(n.x,n.y,n.width,n.height)},mxGraphLayout.prototype.arrangeGroups=function(e,n){this.graph.getModel().beginUpdate();try{for(var t=e.length-1;0<=t;t--){var a=e[t],i=this.graph.getChildVertices(a),s=this.graph.getBoundingBoxFromGeometry(i),o=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=s&&null!=o&&((o=o.clone()).x=o.x+s.x-n-r,o.y=o.y+s.y-n-l,o.width=s.width+2*n+r,o.height=s.height+2*n+l,this.graph.getModel().setGeometry(a,o),this.graph.moveCells(i,n+r-s.x,n+l-s.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,n,t){var a=this.graph.getModel(),i=a.getParent(e),s=this.isHorizontal();if(null!=e&&null!=i){var o=0,r=0,l=a.getChildCount(i);for(n=s?n:t,null!=(o=this.graph.getView().getState(i))&&(n-=s?o.x:o.y),o=0;o<l;o++)if((t=a.getChildAt(i,o))!=e&&null!=(t=a.getGeometry(t))){if(t=s?t.x+t.width/2:t.y+t.height/2,r<n&&n<t)break;r=t}s=i.getIndex(e),s=Math.max(0,o-(s<o?1:0)),a.add(i,e,s)}},mxStackLayout.prototype.getParentSize=function(e){var n=this.graph.getModel(),t=n.getGeometry(e);return null!=this.graph.container&&(null==t&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(t=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),t},mxStackLayout.prototype.execute=function(e){if(null!=e){var n=this.isHorizontal(),t=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=n?a.height:a.width);i=i-(2*this.spacing+2*this.border);var s=this.x0+this.border,o=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);n==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),n?o+=l:s+=l}t.beginUpdate();try{l=0,r=null;for(var d=t.getChildCount(e),c=0;c<d;c++){var m=t.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=t.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(n&&r.x+r.width+u.width+2*this.spacing>this.wrap||!n&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,n?o+=l+this.spacing:s+=l+this.spacing,l=0),l=Math.max(l,n?u.height:u.width),null!=r?n?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(n?u.x=s:u.y=o),n?u.y=o:u.x=s,this.fill&&0<i&&(n?u.height=i:u.width=i),t.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),n?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,t.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(n?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{t.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,n,t){var a=(t=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,s=0,o=t.getChildCount(a);for(i=0;i<o;i++){var r=t.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,s<n&&n<r)break;s=r}}n=a.getIndex(e),n=Math.max(0,i-(n<i?1:0)),t.add(a,e,n)}},mxPartitionLayout.prototype.execute=function(e){var n=this.isHorizontal(),t=this.graph.getModel(),a=t.getGeometry(e);if(null!=this.graph.container&&(null==a&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(s=i.length)){var l=this.border,d=this.border,c=(c=n?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=n?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(s-1)*this.spacing,0<(a=n?(a.width-l-e)/s:(a.height-d-e)/s)){t.beginUpdate();try{for(o=0;o<s;o++){r=i[o];var m=t.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,n?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),t.setGeometry(r,m))}}finally{t.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.getModel();if(null==n)if(0<this.graph.getEdges(e,t.getParent(e),this.invert,!this.invert,!1).length)n=e;else{if(0<(o=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<o.length;a++)if(!this.isVertexIgnored(o[a])&&0<this.graph.getEdges(o[a],null,this.invert,!this.invert,!1).length){n=o[a];break}}if(null!=n){this.parentsChanged=this.resizeParent?{}:null,t.beginUpdate();try{var i=this.dfs(n,e);if(null!=i){this.layout(i);var s=this.graph.gridSize,o=s;if(!this.moveTree){var r=this.getVertexBounds(n);null!=r&&(s=r.x,o=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,s,o):this.verticalLayout(i,null,s,o))){var l=a=0;r.x<0&&(a=Math.abs(s-r.x)),r.y<0&&(l=Math.abs(o-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{t.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,n,t){for(e.x+=n,e.y+=t,this.apply(e),e=e.child;null!=e;)this.moveNode(e,n,t),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,n,t){t=null!=t?t:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==t[a]&&!this.isVertexIgnored(e)){t[a]=e;i=this.createNode(e),a=this.graph.getModel();var s=null;e=this.graph.getEdges(e,n,this.invert,!this.invert,!1,!0);for(var o=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=o.getState(l))?d.getVisibleTerminal(this.invert):o.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,n,t))&&null!=a.getGeometry(l)&&(null==s?i.child=d:s.next=d,s=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var n=e.child;null!=n;)this.layout(n),n=n.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,n,t,a){if(e.x+=n+e.offsetX,e.y+=t+e.offsetY,a=this.apply(e,a),null!=(n=e.child)){a=this.horizontalLayout(n,e.x,e.y,a),t=e.y+n.offsetY;for(var i=n.next;null!=i;)a=this.horizontalLayout(i,e.x+n.offsetX,t,a),t+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,n,t,a,i){if(e.x+=t+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(n=e.child))for(i=this.verticalLayout(n,e,e.x,e.y,i),t=e.x+n.offsetY,a=n.next;null!=a;)i=this.verticalLayout(a,e,t,e.y+n.offsetX,i),t+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,n){var t=this.nodeDistance+this.levelDistance,a=(n-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-n;e.child.offsetX=t+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(t,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(t,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var n=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+n,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-n),e.contour.lowerHead=this.createLine(e.height+n,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var n=2*this.nodeDistance,t=e.child;e.contour=t.contour;var a=t.width+n,i=a;for(t=t.next;null!=t;){var s=this.merge(e.contour,t.contour);t.offsetY=s+a,t.offsetX=0,i+=s+(a=t.width+n),t=t.next}return i},mxCompactTreeLayout.prototype.merge=function(e,n){for(var t=0,a=0,i=0,s=e.lowerHead,o=n.upperHead;null!=o&&null!=s;){var r=this.offset(t,a,o.dx,o.dy,s.dx,s.dy);a=a+r,i=i+r;t+o.dx<=s.dx?(t+=o.dx,a+=o.dy,o=o.next):(t-=s.dx,a-=s.dy,s=s.next)}return null!=o?(t=this.bridge(e.upperTail,0,0,o,t,a),e.upperTail=null!=t.next?n.upperTail:t,e.lowerTail=n.lowerTail):null==(t=this.bridge(n.lowerTail,t,a,s,0,0)).next&&(e.lowerTail=t),e.lowerHead=n.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,n,t,a,i,s){var o;return i<=e||e+t<=0?0:0<(o=0<i*a-t*s?e<0?e*a/t-n:0<e?e*s/i-n:-n:i<e+t?s-(n+(i-e)*a/t):e+t<i?(t+e)*s/i-(n+a):s-(n+a))?o:0},mxCompactTreeLayout.prototype.bridge=function(e,n,t,a,i,s){return n=i+a.dx-n,i=i=0,0==a.dx?i=a.dy:(i=n*a.dy,i/=a.dx),n=this.createLine(n,i,a.next),e.next=this.createLine(0,s+a.dy-i-t,n),n},mxCompactTreeLayout.prototype.createNode=function(e){var n={};return n.cell=e,n.x=0,n.y=0,n.width=0,n.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(n.width=e.height,n.height=e.width):(n.width=e.width,n.height=e.height)),n.offsetX=0,n.offsetY=0,n.contour={},n},mxCompactTreeLayout.prototype.apply=function(e,n){var t=this.graph.getModel(),a=e.cell,i=t.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(t=t.getParent(a),a=mxCellPath.create(t),null==this.parentsChanged[a]&&(this.parentsChanged[a]=t))),n=null==n?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(n.x,i.x),Math.min(n.y,i.y),Math.max(n.x+n.width,i.x+i.width),Math.max(n.y+n.height,i.y+i.height))),n},mxCompactTreeLayout.prototype.createLine=function(e,n,t){var a={};return a.dx=e,a.dy=n,a.next=t,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,n=[];for(e in this.parentsChanged)n.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var n=e.child,t=e.cell,a=0,i=[];null!=n;){a++;var s=n.x;this.horizontal&&(s=n.y),i.push(new WeightedCellSorter(n,s)),n=n.next}i.sort(WeightedCellSorter.prototype.compare),(s=e.width)>(o=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(s-=2*this.prefHozEdgeSep),n=(e=s/a)/2,s>o+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep);s=this.minEdgeJetty-this.prefVertEdgeOff;for(var o=0,r=this.getVertexBounds(t),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(t,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+n,m.push(new mxPoint(u,p)),u=r.x+r.width+s,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+n,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+s,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?s+=this.prefVertEdgeOff:a/2<l&&(s-=this.prefVertEdgeOff),n+=e,o=Math.max(o,s)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?1:n.weightedValue<e.weightedValue?-1:n.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var n=this.graph.getModel();this.vertexArray=[];for(var t=this.graph.getChildVertices(e),a=0;a<t.length;a++)this.isVertexIgnored(t[a])||this.vertexArray.push(t[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,s=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var o=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(o);this.indices[r]=a;var l=this.getVertexBounds(o),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}n.beginUpdate();try{for(a=0;a<s;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);t=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<t.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(t[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=t=null,a=0;a<this.vertexArray.length;a++)o=this.vertexArray[a],this.isVertexMovable(o)&&(null!=(l=this.getVertexBounds(o))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(o,m,u),t=null==t?m:Math.min(t,m),e=null==e?u:Math.min(e,u)));a=1-(t||0),o=1-(e||0),null!=i&&(a+=i.x,o+=i.y),this.graph.moveCells(this.vertexArray,a,o)}finally{n.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(t=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(t=.001);var n=this.dispX[e]/t*Math.min(t,this.temperature),t=this.dispY[e]/t*Math.min(t,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=n,this.cellLocation[e][1]+=t}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var n=0;n<this.neighbours[e].length;n++){var t=this.neighbours[e][n];if(e!=t&&this.isMoveable[e]&&this.isMoveable[t]){(a=(s=this.cellLocation[e][0]-this.cellLocation[t][0])*s+(o=this.cellLocation[e][1]-this.cellLocation[t][1])*o-this.radiusSquared[e]-this.radiusSquared[t])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),s=s/i*(a=a/this.forceConstant),o=o/i*a;this.dispX[e]-=s,this.dispY[e]-=o,this.dispX[t]+=s,this.dispY[t]+=o}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,n=0;n<e;n++)for(var t=n;t<e;t++){if(!this.allowedToRun)return;if(t!=n&&this.isMoveable[n]&&this.isMoveable[t]){var a=this.cellLocation[n][0]-this.cellLocation[t][0],i=this.cellLocation[n][1]-this.cellLocation[t][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var s=Math.sqrt(a*a+i*i),o=s-this.radius[n]-this.radius[t];o>this.maxDistanceLimit||(o<this.minDistanceLimit&&(o=this.minDistanceLimit),a=a/s*(o=this.forceConstantSquared/o),i=i/s*o,this.dispX[n]+=a,this.dispY[n]+=i,this.dispX[t]-=a,this.dispY[t]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0,a=null,i=null,s=[],o=n.getChildCount(e),r=0;r<o;r++){var l=n.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{s.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),t=Math.max(t,Math.max(d.width,d.height))}}var c=this.getRadius(s.length,t);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(s,c,i,a)}finally{n.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,n){return Math.max(e*n/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,n,t,a){for(var i=e.length,s=2*Math.PI/i,o=0;o<i;o++)this.isVertexMovable(e[o])&&this.setVertexLocation(e[o],t+n+n*Math.sin(o*s),a+n+n*Math.cos(o*s))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var n in e){var t=e[n];1<t.length&&this.layout(t)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var n=this.graph.getModel(),t=[],a=n.getChildCount(e),i=0;i<a;i++){var s=n.getChildAt(e,i);if(!this.isEdgeIgnored(s)){var o=this.getEdgeId(s);null!=o&&(null==t[o]&&(t[o]=[]),t[o].push(s))}}return t},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var n=this.graph.getView(),t=n.getState(e),a=null!=t?t.getVisibleTerminal(!0):n.getVisibleTerminal(e,!0);return e=null!=t?t.getVisibleTerminal(!1):n.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var n=e[0];if((o=(t=this.graph.getModel()).getGeometry(t.getTerminal(n,!0)))==(s=t.getGeometry(t.getTerminal(n,!1)))){n=o.x+o.width+this.spacing;for(var t=o.y+o.height/2,a=0;a<e.length;a++)this.route(e[a],n,t),n+=this.spacing}else if(null!=o&&null!=s){n=o.x+o.width/2,t=o.y+o.height/2,a=s.x+s.width/2-n;var i=s.y+s.height/2-t,s=Math.sqrt(a*a+i*i),o=i*this.spacing/s;for(s=a*this.spacing/s,n=n+a/2+o*(e.length-1)/2,t=t+i/2-s*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],n,t),n-=o,t+=s}},mxParallelEdgeLayout.prototype.route=function(e,n,t){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(n,t)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,n,t){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<this.layouts.length;t++)this.layouts[t].execute.apply(this.layouts[t],arguments)}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var n=this.graph.view,t=this.graph.getModel(),a=[],i=[],s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o),l=n.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,n){var t=this.graph.getModel();t.beginUpdate();try{for(var a=0;a<n.length;a++){var i=n[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var s=0;s<e.length;s++){var o=e[s];null!=o&&this.avoid(i,o)}}}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,n){var t=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,n)){var i=-a.y-a.height+n.y,s=-a.y+n.y+n.height;i=Math.abs(i)<Math.abs(s)?i:s,s=-a.x-a.width+n.x,a=-a.x+n.x+n.width,a=Math.abs(s)<Math.abs(a)?s:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(s=t.getGeometry(e.cell))&&(null!=(s=s.clone()).offset?(s.offset.x+=a,s.offset.y+=i):s.offset=new mxPoint(a,i),t.setGeometry(e.cell,s))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,n){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,n){this.isVertex()?this.x[0]=n:this.isEdge()&&(this.x[e-this.minRank-1]=n)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,n){this.isVertex()?this.y[0]=n:this.isEdge()&&(this.y[e-this.minRank-1]=n)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsTarget.length;n++){var t=this.connectsAsTarget[n];-1==t.maxRank||t.maxRank==e+1?this.nextLayerConnectedCells[0].push(t.source):this.nextLayerConnectedCells[0].push(t)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var n=0;n<this.connectsAsSource.length;n++){var t=this.connectsAsSource[n];-1==t.minRank||t.minRank==e-1?this.previousLayerConnectedCells[0].push(t.target):this.previousLayerConnectedCells[0].push(t)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,n){this.temp[0]=n},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var n=0;n<this.hashCode.length;n++)if(this.hashCode[n]!=e.hashCode[n])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.nextLayerConnectedCells[n]=[],n==this.temp.length-1?this.nextLayerConnectedCells[n].push(this.source):this.nextLayerConnectedCells[n].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var n=0;n<this.temp.length;n++)this.previousLayerConnectedCells[n]=[],0==n?this.previousLayerConnectedCells[n].push(this.target):this.previousLayerConnectedCells[n].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,n){this.temp[e-this.minRank-1]=n},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,n,t){for(var a=e.getGraph(),i=0;i<n.length;i++){t[i]=new mxGraphHierarchyNode(n[i]);var s=mxCellPath.create(n[i]);this.vertexMapper[s]=t[i],s=e.getEdges(n[i]),t[i].connectsAsSource=[];for(var o=0;o<s.length;o++){if((d=e.getVisibleTerminal(s[o],!1))!=n[i]&&d!=n[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(n[i],d,!1),l=e.getEdgesBetween(n[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=t[i],mxUtils.indexOf(t[i].connectsAsSource,l)<0&&t[i].connectsAsSource.push(l)}}}t[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var t=mxCellPath.create(this.roots[n]);null!=(t=this.vertexMapper[t])&&e.push(t)}for(var a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var s,o;s=(t=e[0]).connectsAsTarget,o=t.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(n=0;n<s.length;n++){var d=s[n];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(t.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(n=0;n<o.length;n++)(d=o[n]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(n=e.shift(),e.push(t),n==t&&1==e.length)break}for(a in this.vertexMapper)(t=this.vertexMapper[a]).temp[0]-=this.maxRank;for(n=0;n<i.length;n++)for(e=0,s=(t=i[n]).connectsAsSource,a=0;a<s.length;a++)d=(d=s[a]).target,t.temp[0]=Math.max(e,d.temp[0]+1),e=t.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var s=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)s[e]=[],this.ranks[e]=s[e];var n=null;if(null!=this.roots){var t=this.roots;for(n=[],e=0;e<t.length;e++){var a=mxCellPath.create(t[e]);n[e]=this.vertexMapper[a]}}this.visit(function(e,n,t,a,i){if(0==i&&n.maxRank<0&&n.minRank<0&&(s[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=s[n.maxRank].length-1),null!=e&&null!=t&&1<e.maxRank-n.maxRank)for(t.maxRank=e.maxRank,t.minRank=n.maxRank,t.temp=[],t.x=[],t.y=[],e=t.minRank+1;e<t.maxRank;e++)s[e].push(t),t.setGeneralPurposeVariable(e,s[e].length-1)},n,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,n,t,a){if(null!=n){for(var i=0;i<n.length;i++){var s=n[i];null!=s&&(null==a&&(a={}),t?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=i,this.extendedDfs(null,s,null,e,a,s.hashCode,i,0)):this.dfs(null,s,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,n,t,a,i,s){if(null!=n){var o=mxCellPath.create(n.cell);if(null==i[o])for(a(e,i[o]=n,t,s,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.dfs(n,o.target,o,a,i,s+1);else a(e,n,t,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,n,t,a,i,s,o,r){if(null!=n)if(null==e||null!=n.hashCode&&n.hashCode[0]==e.hashCode[0]||(s=e.hashCode.length+1,n.hashCode=e.hashCode.slice(),n.hashCode[s-1]=o),null==i[o=mxCellPath.create(n.cell)])for(a(e,i[o]=n,t,r,0),e=n.connectsAsSource.slice(),t=0;t<e.length;t++)o=e[t],this.extendedDfs(n,o.target,o,a,i,n.hashCode,t,r+1);else a(e,n,t,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var t=0,a=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&t<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=t=0;i<this.nestedBestRanks.length;i++)for(var s=e.ranks[i],o=0;o<s.length;o++){var r=s[o];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(t++,i=0;i<this.nestedBestRanks.length;i++)for(s=e.ranks[i],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(i,o);if(0==a)break}for(t=[],a=[],n=0;n<e.maxRank+1;n++)a[n]=[],t[n]=a[n];for(n=0;n<this.nestedBestRanks.length;n++)for(i=0;i<this.nestedBestRanks[n].length;i++)a[n].push(this.nestedBestRanks[n][i]);e.ranks=t},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var n=e.ranks.length,t=0,a=1;a<n;a++)t+=this.calculateRankCrossing(a,e);return t},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,n){for(var t=0,a=n.ranks[e],i=a.length,s=n.ranks[e-1].length,o=[],r=0;r<i;r++)o[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);o[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<s;c++)if(201207==o[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==o[a][l]&&t++;for(a=0;a<r;a++)for(l=c+1;l<s;l++)201207==o[a][l]&&t++}return t/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,n){for(var t=!0,a=0;t&&a++<10;)for(var i=1==e%2&&1==a%2,s=(t=!1,0);s<n.ranks.length;s++){for(var o=n.ranks[s],r=[],l=0;l<o.length;l++){(b=(f=o[l]).getGeneralPurposeVariable(s))<0&&(b=l),r[b]=f}var d=b=f=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<o.length-1;l++){if(0==l){for(var f=(v=r[l]).getNextLayerConnectedCells(s),b=v.getPreviousLayerConnectedCells(s),A=(m=[],u=[],0);A<f.length;A++)m[A]=f[A].getGeneralPurposeVariable(s+1);for(A=0;A<b.length;A++)u[A]=b[A].getGeneralPurposeVariable(s-1)}else f=d,b=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(s),c=h.getPreviousLayerConnectedCells(s),p=[],g=[],A=0;A<d.length;A++)p[A]=d[A].getGeneralPurposeVariable(s+1);for(A=0;A<c.length;A++)g[A]=c[A].getGeneralPurposeVariable(s-1);var E=0,y=0;for(A=0;A<m.length;A++)for(var S=0;S<p.length;S++)m[A]>p[S]&&E++,m[A]<p[S]&&y++;for(A=0;A<u.length;A++)for(S=0;S<g.length;S++)u[A]>g[S]&&E++,u[A]<g[S]&&y++;(y<E||y==E&&i)&&(d=v.getGeneralPurposeVariable(s),v.setGeneralPurposeVariable(s,h.getGeneralPurposeVariable(s)),h.setGeneralPurposeVariable(s,d),d=f,c=b,p=m,g=u,h=v,i||(t=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,n){var t=0==e%2;if(t)for(var a=n.maxRank-1;0<=a;a--)this.medianRank(a,t);else for(a=1;a<n.maxRank;a++)this.medianRank(a,t)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,n){for(var t=this.nestedBestRanks[e].length,a=[],i=[],s=0;s<t;s++){var o,r,l=this.nestedBestRanks[e][s],d=new MedianCellSorter;d.cell=l,r=n?e+1:e-1,null!=(o=n?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=o.length?(d.medianValue=this.medianValue(o,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),s=0;s<t;s++)null==i[s]&&(l=a.shift().cell).setGeneralPurposeVariable(e,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,n){for(var t=[],a=0,i=0;i<e.length;i++){var s=e[i];t[a++]=s.getGeneralPurposeVariable(n)}return t.sort(function(e,n){return e-n}),1==a%2?t[Math.floor(a/2)]:2==a?(t[0]+t[1])/2:(s=t[(i=a/2)-1]-t[0],a=t[a-1]-t[i],(t[i-1]*a+t[i]*s)/(s+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.medianValue>e.medianValue?-1:n.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var n=this.layout.getModel(),s={},o=mxUtils.clone(n.vertexMapper,null,!0),t=null;if(null!=n.roots){var a=n.roots;t=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);t[e]=n.vertexMapper[i]}}if(n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget),n.connectsAsSource.push(t)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},t,!0,null),t=null,0<o.lenth&&(t=mxUtils.clone(o,null,!0)),e=mxUtils.clone(s,null,!0),n.visit(function(e,n,t,a,i){n.isAncestor(e)&&(t.invert(),mxUtils.remove(t,e.connectsAsSource),n.connectsAsSource.push(t),e.connectsAsTarget.push(t),mxUtils.remove(t,n.connectsAsTarget)),e=mxCellPath.create(n.cell),s[e]=n,delete o[e]},o,!0,e),a=this.layout.getGraph(),null!=t&&0<t.length)for(n=n.roots,e=0;e<t.length;e++)i=t[e].cell,0==a.getIncomingEdges(i).length&&n.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,n){this.cell=e,this.weightedValue=n}function mxHierarchicalLayout(e,n,t){mxGraphLayout.call(this,e),this.orientation=null!=n?n:mxConstants.DIRECTION_NORTH,this.deterministic=null==t||t}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,n){this.model=e,this.previous=this.root=n}function mxChildChange(e,n,t,a){this.model=e,this.previous=this.parent=n,this.child=t,this.previousIndex=this.index=a}function mxTerminalChange(e,n,t,a){this.model=e,this.cell=n,this.previous=this.terminal=t,this.source=a}function mxValueChange(e,n,t){this.model=e,this.cell=n,this.previous=this.value=t}function mxStyleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.style=t}function mxGeometryChange(e,n,t){this.model=e,this.cell=n,this.previous=this.geometry=t}function mxCollapseChange(e,n,t){this.model=e,this.cell=n,this.previous=this.collapsed=t}function mxVisibleChange(e,n,t){this.model=e,this.cell=n,this.previous=this.visible=t}function mxCellAttributeChange(e,n,t){this.cell=e,this.attribute=n,this.previous=this.value=t}function mxCell(e,n,t){this.value=e,this.setGeometry(n),this.setStyle(t),null!=this.onInit&&this.onInit()}function mxGeometry(e,n,t,a){mxRectangle.call(this,e,n,t,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var n=0;n<e.ranks.length;n++){mxLog.write("Rank ",n," : ");for(var t=e.ranks[n],a=0;a<t.length;a++)mxLog.write(t[a].getGeneralPurposeVariable(n)," ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var t=0;t<this.maxIterations;t++){if(0!=t&&(this.medianPos(t,e),this.minNode(e)),this.currentXDelta<n){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],s=0;s<i.length;s++){var o=i[s];o.setX(a,o.getGeneralPurposeVariable(a))}n=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],s=0;s<i.length;s++)(o=i[s]).setGeneralPurposeVariable(a,o.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var n=[],t=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var s=0;s<a[i].length;s++){var o=a[i][s];(r=new WeightedCellSorter(o,i)).rankIndex=s,r.visited=!0,n.push(r),t[o=mxCellPath.create(o.getCoreCell())]=r}}for(e=10*n.length,s=0;0<n.length&&s<=e;){i=(r=n.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(o=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=o.length,u=c.length,p=this.medianXValue(o,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),f=h;if(0<v&&(f=(p*m+g*u)/v),m=!1,f<h-1?0==d?(i.setGeneralPurposeVariable(l,f),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<f?(i.setGeneralPurposeVariable(l,f),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<f&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,f),m=!0):f<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,f),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<o.length;i++)l=o[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=t[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,n.push(l))}r.visited=!1,s++}},mxCoordinateAssignment.prototype.medianPos=function(e,n){if(0==e%2)for(var t=n.maxRank;0<t;t--)this.rankMedianPosition(t-1,n,t);else for(t=0;t<n.maxRank-1;t++)this.rankMedianPosition(t+1,n,t)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,n,t){n=n.ranks[e];for(var a=[],i=[],s=0;s<n.length;s++){var o=n[s];a[s]=new WeightedCellSorter,a[s].cell=o,a[s].rankIndex=s;var r=mxCellPath.create(o.getCoreCell());i[r]=a[s];var l=null;l=t<e?o.getPreviousLayerConnectedCells(e):o.getNextLayerConnectedCells(e);a[s].weightedValue=this.calculatedWeightedValue(o,l)}for(a.sort(WeightedCellSorter.prototype.compare),s=0;s<a.length;s++){r=0,o=a[s].cell,r=0,null!=(l=t<e?o.getPreviousLayerConnectedCells(e).slice():o.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,t):o.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[s].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+o.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[s].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(n[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-o.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?o.setGeneralPurposeVariable(e,r):r<l?(o.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(o.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[s].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,n){for(var t=0,a=0;a<n.length;a++){var i=n[a];e.isVertex()&&i.isVertex()?t++:t=e.isEdge()&&i.isEdge()?t+8:t+2}return t},mxCoordinateAssignment.prototype.medianXValue=function(e,n){if(0==e.length)return 0;for(var t=[],a=0;a<e.length;a++)t[a]=e[a].getGeneralPurposeVariable(n);return t.sort(function(e,n){return e-n}),1==e.length%2?t[Math.floor(e.length/2)]:(t[(a=e.length/2)-1]+t[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,n){this.calculateWidestRank(e,n);for(var t=this.widestRank;0<=t;t--)t<n.maxRank&&this.rankCoordinates(t,e,n);for(t=this.widestRank+1;t<=n.maxRank;t++)0<t&&this.rankCoordinates(t,e,n)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,n,t){n=t.ranks[e],t=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,s=0;s<n.length;s++){var o=n[s];if(o.isVertex()){var r=this.layout.getVertexBounds(o.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(o.width=r.width,o.height=r.height):(o.width=r.height,o.height=r.width):i=!0,t=Math.max(t,o.height)}else o.isEdge()&&(r=1,null!=o.edges?r=o.edges.length:mxLog.warn("edge.edges is null"),o.width=(r-1)*this.parallelEdgeSpacing);a+=o.width/2,o.setX(e,a),o.setGeneralPurposeVariable(e,a),a+=o.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,n){var t=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=n.maxRank;0<=i;i--){for(var s=0,o=n.ranks[i],r=this.initialX,l=!1,d=0;d<o.length;d++){var c=o[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,s=Math.max(s,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=t,r=s/2+a/2+this.interRankCellSpacing,a=s,t=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?t+r:t-r,d=0;d<o.length;d++)o[d].setY(i,t)}},mxCoordinateAssignment.prototype.minPath=function(e,n){var t,a=n.edgeMapper;for(t in a){var i=a[t];if(!(i.maxRank-i.minRank-1<1)){for(var s=i.getGeneralPurposeVariable(i.minRank+1),o=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){s!=(d=i.getGeneralPurposeVariable(l))?(o=!1,s=d):r++}if(!o){o=s=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,s++):this.repositionValid(n,i,l+1,m)?(d[l-i.minRank-1]=m,s++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,o++):this.repositionValid(n,i,l-1,m)?(c[l-i.minRank-2]=m,o++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<o||r<s)if(s<=o)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(o<s)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,n,t,a){e=e.ranks[t];for(var i=-1,s=0;s<e.length;s++)if(n==e[s]){i=s;break}if(i<0)return!1;if(a<(s=n.getGeneralPurposeVariable(t))){if(0==i)return!0;if(!((t=(t=(e=e[i-1]).getGeneralPurposeVariable(t))+e.width/2+this.intraCellSpacing+n.width/2)<=a))return!1}else if(s<a){if(i==e.length-1)return!0;if(!(a<=(t=(t=(e=e[i+1]).getGeneralPurposeVariable(t))-e.width/2-this.intraCellSpacing-n.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,n){this.rankTopY=[],this.rankBottomY=[];for(var t=0;t<n.ranks.length;t++)this.rankTopY[t]=Number.MAX_VALUE,this.rankBottomY[t]=0;t=null,this.layout.resizeParent&&(t={});var a,i=n.edgeMapper,s=n.vertexMapper;for(a in s){var o=s[a];if(this.setVertexLocation(o),this.layout.resizeParent){o=e.model.getParent(o.cell);var r=mxCellPath.create(o);null==t[r]&&(t[r]=o)}}for(a in this.layout.resizeParent&&null!=t&&this.adjustParents(t),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(n),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var n,t=[];for(n in e)t.push(e[n]);this.layout.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var n=0;n<e.ranks.length;n++)for(var t=e.ranks[n],a=0;a<t.length;a++){var i=t[a];if(i.isVertex())for(var s=i.getPreviousLayerConnectedCells(n),o=n-1,r=0;r<2;r++){if(-1<o&&o<e.ranks.length&&null!=s&&0<s.length){for(var l=[],d=0;d<s.length;d++){var c=new WeightedCellSorter(s[d],s[d].getX(o));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=s=0;for(o=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(s+=p[v].edges.length,u++,o.push(p[v]))}else s+=g.edges.length,u++,o.push(g)}for(i.width>(s+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/s)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<o.length;d++){for(g=o[d].edges.length,v=mxCellPath.create(o[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<s/2?m+=this.prefVertEdgeOff:s/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}s=i.getNextLayerConnectedCells(n),o=n+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var n=0;if(101207!=e.temp[0]){var t=e.maxRank,a=e.minRank;t==a&&(t=e.source.maxRank,a=e.target.minRank);for(var i=0,s=mxCellPath.create(e.edges[0]),o=(s=this.jettyPositions[s],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=o&&(p=!p),null!=s){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[t],h=s[4*i+1+g];p&&(h=-h),v+=h,g=s[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+n;var f=(this.rankTopY[c]+this.rankBottomY[c+1])/2,b=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var A=f;f=b,b=A}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,f)),u.push(new mxPoint(m,b))):(u.push(new mxPoint(f,m)),u.push(new mxPoint(b,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=s&&(g=p?2:0,v=p?this.rankBottomY[t]:this.rankTopY[a],h=s[4*i+3-g],p&&(h=-h),v-=h,g=s[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),n=0==n?this.parallelEdgeSpacing:0<n?-n:-n+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var n=e.cell,t=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(n,t,a):this.layout.setVertexLocation(n,a,t),this.limitX=Math.max(this.limitX,t+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,n){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,n){return null!=e&&null!=n?n.weightedValue>e.weightedValue?-1:n.weightedValue<e.weightedValue?1:n.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,n){this.parent=e;var t=this.graph.model;if(this.edgesCache={},null!=n||null!=e){if(null!=n&&null!=e){for(var a=[],i=0;i<n.length;i++)t.isAncestor(e,n[i])&&a.push(n[i]);this.roots=a}else this.roots=n;t.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{t.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,n){var t=[];if(null!=e&&null!=n){var a,i=this.graph.model,s=null,o=-1e5;for(a in n){var r=n[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&t.push(r),o<(l=d-c)&&(o=l,s=r)}}0==t.length&&null!=s&&t.push(s)}return t},mxHierarchicalLayout.prototype.getEdges=function(e){var n=mxCellPath.create(e);if(null!=this.edgesCache[n])return this.edgesCache[n];for(var t=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),s=t.getChildCount(e),o=0;o<s;o++){var r=t.getChildAt(e,o);this.isPort(r)?a=a.concat(t.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(t.getEdges(r,!0,!0)))}for(a=a.concat(t.getEdges(e,!0,!0)),t=[],o=0;o<a.length;o++)((i=this.getVisibleTerminal(a[o],!0))==(s=this.getVisibleTerminal(a[o],!1))||i!=s&&(s==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(s,this.parent,this.traverseAncestors))))&&t.push(a[o]);return this.edgesCache[n]=t},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,n){var t=null!=(t=this.graph.view.getState(e))?t.getVisibleTerminal(n):this.graph.view.getVisibleTerminal(e,n);return this.isPort(t)&&(t=this.graph.model.getParent(t)),t},mxHierarchicalLayout.prototype.run=function(e){var n=[],t=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,s=!0;for(i in a)if(null!=a[i]){s=!1;break}for(;!s;){var o=this.findRoots(e,a);for(s=0;s<o.length;s++){var r=[];n.push(r),this.traverse(o[s],!0,null,t,r,n,a)}for(s=0;s<o.length;s++)this.roots.push(o[s]);for(i in s=!0,a)if(null!=a[i]){s=!1;break}}}else for(s=0;s<roots.length;s++)r=[],n.push(r),traverse(roots.get(s),!0,null,t,r,n,null);for(s=t=0;s<n.length;s++){for(i in a=[],r=n[s])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),t=this.placementStage(t,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,n){var t=this.graph.model;if(t.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(n[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=t.getChildCount(e),i=0;i<a;i++){var s=t.getChildAt(e,i);this.isPort(s)||this.filterDescendants(s,n)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=this.getVisibleTerminal(a[s],!0),r=this.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxHierarchicalLayout.prototype.traverse=function(e,n,t,a,i,s,o){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=o&&null==o[r]){if(null==i[r])for(t=0;t<s.length;t++)if(null!=(e=s[t])[r]){for(l in i)e[l]=i[l];return s.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete o[r];var l=this.getEdges(e);for(t=0;t<l.length;t++)r=this.getVisibleTerminal(l[t],!0)==e,(!n||r)&&(r=this.getVisibleTerminal(l[t],!r),i=this.traverse(r,n,l[t],a,i,s,o))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,n){var t=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return t.fineTuning=this.fineTuning,t.execute(n),t.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,n){var t=null;if(null!=e){t=[];for(var a=0;a<e.length;a++)n(e[a])&&t.push(e[a])}return t},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,n){var t=[];n=n||this.getRoot(),(null==e||e(n))&&t.push(n);for(var a=this.getChildCount(n),i=0;i<a;i++){var s=this.getChildAt(n,i);t=t.concat(this.filterDescendants(e,s))}return t},mxGraphModel.prototype.getRoot=function(e){var n=e||this.root;if(null!=e)for(;null!=e;)n=e,e=this.getParent(e);return n},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var n=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),n},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,n){for(;null!=n&&n!=e;)n=this.getParent(n);return n==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,n,t){if(n!=e&&null!=e&&null!=n){null==t&&(t=this.getChildCount(e));var a=e!=this.getParent(n);this.execute(new mxChildChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParents(n)}return n},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((n=this.getCell(e.getId()))!=e){for(;null!=n;)e.setId(this.createId(e)),n=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var n=this.getChildCount(e),t=0;t<n;t++)this.cellAdded(this.getChildAt(e,t))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,n){n=n||this.getRoot(e);for(var t=this.getChildCount(e),a=0;a<t;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,n)}for(i=this.getEdgeCount(e),t=[],a=0;a<i;a++)t.push(this.getEdgeAt(e,a));for(a=0;a<t.length;a++)i=t[a],this.isAncestor(n,i)&&this.updateEdgeParent(i,n)},mxGraphModel.prototype.updateEdgeParent=function(e,n){for(var t=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=t&&!this.isEdge(t)&&null!=t.geometry&&t.geometry.relative;)t=this.getParent(t);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(n,t)&&this.isAncestor(n,a)&&(null!=(i=t==a?this.getParent(t):this.getNearestCommonAncestor(t,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(t=this.getGeometry(e))){var s=this.getOrigin(this.getParent(e)),o=this.getOrigin(i);a=o.x-s.x,s=o.y-s.y;(t=t.clone()).translate(-a,-s),this.setGeometry(e,t)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var n=null;return null!=e?(n=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(n.x+=e.x,n.y+=e.y)):n=new mxPoint,n},mxGraphModel.prototype.getNearestCommonAncestor=function(e,n){if(null!=e&&null!=n&&(null!=(s=mxCellPath.create(n))&&0<s.length)){var t=e,a=mxCellPath.create(t);if(s.length<a.length){t=n;var i=a,s=(a=s,i)}for(;null!=t;){if(i=this.getParent(t),0==s.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return t;a=mxCellPath.getParentPath(a),t=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var n=this.getChildCount(e)-1;0<=n;n--)this.cellRemoved(this.getChildAt(e,n));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,n,t){var a=this.getParent(e);return null!=n?(n!=a||a.getIndex(e)!=t)&&n.insert(e,t):null!=a&&(t=a.getIndex(e),a.remove(t)),this.contains(a)||null==n?null==n&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,n){return null!=e?e.getChildAt(n):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,n,t){n=null!=n&&n,t=null!=t&&t;for(var a=this.getChildCount(e),i=[],s=0;s<a;s++){var o=this.getChildAt(e,s);(!t&&!n||t&&this.isEdge(o)||n&&this.isVertex(o))&&i.push(o)}return i},mxGraphModel.prototype.getTerminal=function(e,n){return null!=e?e.getTerminal(n):null},mxGraphModel.prototype.setTerminal=function(e,n,t){var a=n!=this.getTerminal(e,t);return this.execute(new mxTerminalChange(this,e,n,t)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),n},mxGraphModel.prototype.setTerminals=function(e,n,t){this.beginUpdate();try{this.setTerminal(e,n,!0),this.setTerminal(e,t,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,n,t){var a=this.getTerminal(e,t);return null!=n?n.insertEdge(e,t):null!=a&&a.removeEdge(e,t),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,n){return null!=e?e.getEdgeAt(n):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,n,t){for(var a=0,i=this.getEdgeCount(e),s=0;s<i;s++){var o=this.getEdgeAt(e,s);o!=t&&this.getTerminal(o,n)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,n,t,a){n=null==n||n,t=null==t||t,a=null==a||a;for(var i=this.getEdgeCount(e),s=[],o=0;o<i;o++){var r=this.getEdgeAt(e,o),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(n&&d==e||t&&l==e))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;var a=this.getEdgeCount(e),i=this.getEdgeCount(n),s=e,o=a;for(i<a&&(o=i,s=n),a=[],i=0;i<o;i++){var r=this.getEdgeAt(s,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==n||!t&&(d==e&&l==n))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[];if(null!=e)for(var s=0;s<e.length;s++){var o=this.getTerminal(e[s],!0),r=this.getTerminal(e[s],!1);o==n&&null!=r&&r!=n&&a?i.push(r):r==n&&null!=o&&o!=n&&t&&i.push(o)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var n=[],t=0;t<e.length;t++){for(var a=e[t],i=!0,s=this.getParent(a);null!=s;){if(0<=mxUtils.indexOf(e,s)){i=!1;break}s=this.getParent(s)}i&&n.push(a)}return n},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,n){return this.execute(new mxValueChange(this,e,n)),n},mxGraphModel.prototype.valueForCellChanged=function(e,n){return e.valueChanged(n)},mxGraphModel.prototype.getGeometry=function(e,n){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,n){return n!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,n)),n},mxGraphModel.prototype.geometryForCellChanged=function(e,n){var t=this.getGeometry(e);return e.setGeometry(n),t},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,n){return n!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,n)),n},mxGraphModel.prototype.styleForCellChanged=function(e,n){var t=this.getStyle(e);return e.setStyle(n),t},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,n){return n!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,n)),n},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,n){var t=this.isCollapsed(e);return e.setCollapsed(n),t},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,n){return n!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,n)),n},mxGraphModel.prototype.visibleStateForCellChanged=function(e,n){var t=this.isVisible(e);return e.setVisible(n),t},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,n,t){t=null==t||t,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,n,t,a),a){var s=a[i],o=this.getTerminal(s,!0);null!=o&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,n,t,a){this.beginUpdate();try{for(var i=e.getChildCount(),s=0;s<i;s++){var o=e.getChildAt(s);if("function"==typeof o.getId){var r=o.getId(),l=null==r||this.isEdge(o)&&t?null:this.getCell(r);if(null==l){var d=o.clone();d.setId(r),d.setTerminal(o.getTerminal(!0),!0),d.setTerminal(o.getTerminal(!1),!1),l=n.insert(d),this.cellAdded(l)}a[mxCellPath.create(o)]=l,this.mergeChildrenImpl(o,l,t,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var n=[];if(null!=e)for(var t={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var s=mxCellPath.create(i);null==t[s]&&(t[s]=i,n.push(i))}}return n},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,n){for(var t={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],t,n)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],t);return a},mxGraphModel.prototype.cloneCellImpl=function(e,n,t){var a=this.cellCloned(e);if(n[mxObjectIdentity.get(e)]=a,t){t=this.getChildCount(e);for(var i=0;i<t;i++){var s=this.cloneCellImpl(this.getChildAt(e,i),n,!0);a.insert(s)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,n,t){null!=(a=this.getTerminal(n,!0))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(n,!1))&&(null!=(a=t[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(n,i),t)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),n=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=n},mxChildChange.prototype.connect=function(e,n){n=null==n||n;var t=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=t&&(n?this.model.terminalForCellChanged(e,t,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(n?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(t,!0),e.setTerminal(a,!1),t=this.model.getChildCount(e),a=0;a<t;a++)this.connect(this.model.getChildAt(e,a),n)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var n=this.getValue();return this.setValue(e),n},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,n){return n?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,n){return null!=e&&(null==n&&(n=this.getChildCount(),e.getParent()==this&&n--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(n,0,e)),e},mxCell.prototype.remove=function(e){var n=null;return null!=this.children&&0<=e&&(null!=(n=this.getChildAt(e))&&(this.children.splice(e,1),n.setParent(null))),n},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,n){return null!=e&&(e.removeFromTerminal(n),e.setTerminal(this,n),null==this.edges||e.getTerminal(!n)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,n){if(null!=e){if(e.getTerminal(!n)!=this&&null!=this.edges){var t=this.getEdgeIndex(e);0<=t&&this.edges.splice(t,1)}e.setTerminal(null,n)}return e},mxCell.prototype.removeFromTerminal=function(e){var n=this.getTerminal(e);null!=n&&n.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,n){var t=this.getValue();return(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT?t.getAttribute(e):null)||n},mxCell.prototype.setAttribute=function(e,n){var t=this.getValue();null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT&&t.setAttribute(e,n)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,n){return n?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,n){if(this.clone(),this.relative||(this.x+=e,this.y+=n),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=n),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=n),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var t=this.points.length,a=0;a<t;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=n)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var n="";if(null!=e)for(var t=e.getParent();null!=t;)n=t.getIndex(e)+mxCellPath.PATH_SEPARATOR+n,t=(e=t).getParent();return 1<(e=n.length)&&(n=n.substring(0,e-1)),n},getParentPath:function(e){if(null!=e){var n=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=n)return e.substring(0,n);if(0<e.length)return""}return null},resolve:function(e,n){var t=e;if(null!=n)for(var a=n.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)t=t.getChildAt(parseInt(a[i]));return t},compare:function(e,n){for(var t=Math.min(e.length,n.length),a=0,i=0;i<t;i++)if(e[i]!=n[i]){a=0==e[i].length||0==n[i].length?e[i]==n[i]?0:e[i]>n[i]?1:-1:(t=parseInt(e[i]))==(i=parseInt(n[i]))?0:i<t?1:-1;break}return 0==a&&((t=e.length)!=(i=n.length)&&(a=i<t?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,n,t,a){n=e.getCenterX();var i=e.getCenterY(),s=Math.atan2(t.y-i,t.x-n),o=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-s,d=Math.atan2(e.height,e.width);return s<-r+d||r-d<s?(o.x=e.x,o.y=i-e.width*Math.tan(s)/2):s<-d?(o.y=e.y,o.x=n-e.height*Math.tan(l)/2):s<d?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(s)/2):(o.y=e.y+e.height,o.x=n+e.height*Math.tan(l)/2),a&&(t.x>=e.x&&t.x<=e.x+e.width?o.x=t.x:t.y>=e.y&&t.y<=e.y+e.height&&(o.y=t.y),t.x<e.x?o.x=e.x:t.x>e.x+e.width&&(o.x=e.x+e.width),t.y<e.y?o.y=e.y:t.y>e.y+e.height&&(o.y=e.y+e.height)),o},EllipsePerimeter:function(e,n,t,a){var i=e.x,s=e.y,o=e.width/2,r=e.height/2,l=i+o,d=s+r;n=t.x,t=t.y;var c=parseInt(n-l),m=parseInt(t-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(n,t);if(a){if(s<=t&&t<=s+e.height)return e=t-d,e=Math.sqrt(o*o*(1-e*e/(r*r)))||0,n<=i&&(e=-e),new mxPoint(l+e,t);if(i<=n&&n<=i+e.width)return e=n-l,e=Math.sqrt(r*r*(1-e*e/(o*o)))||0,t<=s&&(e=-e),new mxPoint(n,d+e)}return d-=(i=m/c)*l,l=i*(o=(-(e=-2*l*(s=o*o*i*i+r*r))+(r=Math.sqrt(e*e-4*s*(o*o*i*i*l*l+r*r*l*l-o*o*r*r))))/(2*s))+d,d=i*(r=(-e-r)/(2*s))+d,i=Math.sqrt(Math.pow(o-n,2)+Math.pow(l-t,2)),n=Math.sqrt(Math.pow(r-n,2)+Math.pow(d-t,2)),s=t=0,s=i<n?(t=o,l):(t=r,d),new mxPoint(t,s)},RhombusPerimeter:function(e,n,t,a){n=e.x;var i=e.y,s=e.width,o=n+s/2,r=i+(e=e.height)/2,l=t.x;if(t=t.y,o==l)return new mxPoint(o,t<r?i:i+e);if(r==t)return new mxPoint(l<o?n:n+s,r);var d=o,c=r;return a&&(n<=l&&l<=n+s?d=l:i<=t&&t<=i+e&&(c=t)),l<o?t<r?mxUtils.intersection(l,t,d,c,o,i,n,r):mxUtils.intersection(l,t,d,c,o,i+e,n,r):t<r?mxUtils.intersection(l,t,d,c,o,i,n+s,r):mxUtils.intersection(l,t,d,c,o,i+e,n+s,r)},TrianglePerimeter:function(e,n,t,a){var i=(n=null!=n?n.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH,s=e.x,o=e.y,r=e.width,l=s+r/2,d=o+(e=e.height)/2,c=new mxPoint(s,o),m=new mxPoint(s+r,d),u=new mxPoint(s,o+e);n==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,o),u=new mxPoint(s+r,o+e)):n==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,o+e),u=new mxPoint(s+r,o)):n==mxConstants.DIRECTION_WEST&&(c=new mxPoint(s+r,o),m=new mxPoint(s,d),u=new mxPoint(s+r,o+e));var p=t.x-l,g=t.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return null==(v=g?a&&(i&&t.x>=c.x&&t.x<=u.x||!i&&t.y>=c.y&&t.y<=u.y)?i?new mxPoint(t.x,c.y):new mxPoint(c.x,t.y):n==mxConstants.DIRECTION_NORTH?new mxPoint(s+r/2+e*Math.tan(p)/2,o+e):n==mxConstants.DIRECTION_SOUTH?new mxPoint(s+r/2-e*Math.tan(p)/2,o):n==mxConstants.DIRECTION_WEST?new mxPoint(s+r,o+e/2+r*Math.tan(p)/2):new mxPoint(s,o+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),t.y>=o&&t.y<=o+e?(a.x=i?l:n==mxConstants.DIRECTION_WEST?s+r:s,a.y=t.y):t.x>=s&&t.x<=s+r&&(a.x=t.x,a.y=i?n==mxConstants.DIRECTION_NORTH?o+e:o:d),l=a.x,d=a.y),i&&t.x<=s+r/2||!i&&t.y<=o+e/2?mxUtils.intersection(t.x,t.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(t.x,t.y,l,d,m.x,m.y,u.x,u.y)))&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,n,t,a,i,s,o,r,l){this.graph=e,this.scale=null!=n?n:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=t?t:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,n,t){this.view=e,this.cell=n,this.style=t,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,n,t){this.selectionModel=e,this.added=null!=n?n.slice():null,this.removed=null!=t?t.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var n=this.graph.cellRenderer.initializeOverlay,t=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,n){n.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var s=this.graph.getGraphBounds().clone(),o=this.graph.getView().getScale(),r=o/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,s.width+=s.x,s.height+=s.y,s.x=0,this.border=s.y=0),s.width/=r,s.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((s.width+this.x0)/d)),u=Math.max(1,Math.ceil((s.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var n=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){n()}),mxEvent.addListener(this.wnd,"resize",function(e){n()})}}});if(e=function(e,n){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",n&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),n){var t=a.createElement("hr");t.className="mxPageBreak",a.body.appendChild(t)}},null!=(f=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<f.length;g++)e(f[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(s.y-l.y*o)/o,f=0;f<m;f++){if(null==this.wnd)return null;var b=f*d/this.scale-this.x0/this.scale+(s.x-l.x*o)/o,A=g*m+f+1;(t=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-b,-h,this.scale,A,e)}))).setAttribute("id","mxPage-"+A),e(t,null!=v||g<u-1||f<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)}finally{this.graph.cellRenderer.initializeOverlay=n}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,n){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln(" table.mxPageSelector { display: none; }"),e.writeln(" hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln(" body.mxPage { background: gray; }"),e.writeln("}"),null!=n&&e.writeln(n),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,n){var t=this.wnd.document,a=t.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=t.createElement("tbody"),s=0;s<e;s++){for(var o=t.createElement("tr"),r=0;r<n;r++){var l=s*n+r+1,d=t.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=t.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,t),d.appendChild(c)}else mxUtils.write(d,l,t);o.appendChild(d)}i.appendChild(o)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,n,t){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=n+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=n-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),t(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,n,t,a,i){a=this.graph.getView();var s=this.graph.container;this.graph.container=i;var o=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,n),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,t,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(t=i.firstChild;null!=t;)p=t.nextSibling,"svg"==(n=t.nodeName.toLowerCase())?(t.setAttribute("width",parseInt(i.style.width)),t.setAttribute("height",parseInt(i.style.height))):"default"!=t.style.cursor&&"table"!=n&&t.parentNode.removeChild(t),t=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=s,a.canvas=o,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,n){this.styles[e]=n},mxStylesheet.prototype.getCellStyle=function(e,n){var t=n;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(t=null!=t&&";"!=e.charAt(0)?mxUtils.clone(t):{},0);i<a.length;i++){var s=(o=a[i]).indexOf("=");if(0<=s){var o,r=o.substring(0,s);(o=o.substring(s+1))==mxConstants.NONE?delete t[r]:mxUtils.isNumeric(o)?t[r]=parseFloat(o):t[r]=o}else if(null!=(o=this.styles[o]))for(r in o)t[r]=o[r]}return t},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,n){if(e=e||0,n=null!=n?n:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var t=this.shape.stencil.computeAspect(this.style,n.x,n.y,n.width,n.height);n.x=t.x,n.y=t.y,n.width=this.shape.stencil.w0*t.width,n.height=this.shape.stencil.h0*t.height}return 0!=e&&n.grow(e),n},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,n){n?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,n){n?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var n=0;n<this.absolutePoints.length;n++)e.absolutePoints[n]=this.absolutePoints[n].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var n=[],t=0;t<e.length;t++)this.graph.isCellSelectable(e[t])&&n.push(e[t]);this.changeSelection(n,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var n=0;n<e.length;n++)if(this.graph.isCellSelectable(e[n]))return e[n];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var n=null;this.singleSelection&&(n=this.cells,e=[this.getFirstSelectableCell(e)]);for(var t=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&t.push(e[a]);this.changeSelection(t,n)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var n=[],t=0;t<e.length;t++)this.isSelected(e[t])&&n.push(e[t]);this.changeSelection(null,n)}},mxGraphSelectionModel.prototype.changeSelection=function(e,n){if(null!=e&&0<e.length&&null!=e[0]||null!=n&&0<n.length&&null!=n[0]){var t=new mxSelectionChange(this,e,n);t.execute();var a=new mxUndoableEdit(this,!1);a.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var n=0;n<this.removed.length;n++)this.selectionModel.cellRemoved(this.removed[n]);if(null!=this.added)for(n=0;n<this.added.length;n++)this.selectionModel.cellAdded(this.added[n]);n=this.added,this.added=this.removed,this.removed=n,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),n=this.graph.isLabelClipped(e.cell),t=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+=" "),a=mxUtils.htmlEntities(a,!1),t?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g," "),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);n&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var s=null!=e.text?e.text.margin:null;null==s&&(s=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getAlignmentAsPoint(s,e)),null!=s&&(!n&&t||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-s.x*this.bounds.width+s.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-s.y*this.bounds.height+s.y*i)+4)+"px"),!n&&t||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,n){null==this.textarea&&this.init(),this.stopEditing(!0);var t=this.graph.getView().getState(e);if(null!=t){this.editingCell=e,this.trigger=n,(this.textNode=null)!=t.text&&this.isHideLabel(t)&&(this.textNode=t.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),s=mxUtils.getValue(t.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.color=s,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(t),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(t=this.getInitialValue(t,n))||0==t.length?(t=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=t,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),n=e.style;return n.position="absolute",n.whiteSpace="nowrap",n.visibility="hidden",n.display=mxClient.IS_QUIRKS?"inline":"inline-block",n.zoom="1",n.verticalAlign="top",n.lineHeight=this.textarea.style.lineHeight,n.fontSize=this.textarea.style.fontSize,n.fontFamily=this.textarea.style.fontFamily,n.fontWeight=this.textarea.style.fontWeight,n.textAlign=this.textarea.style.textAlign,n.fontStyle=this.textarea.style.fontStyle,n.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,n){return this.graph.getEditingValue(e.cell,n)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var n=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*n+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var n=this.graph.getModel().isEdge(e.cell),t=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,s=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*t,o=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*t+s,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*t+s,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*t+s;t=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*t+s,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-t-r),Math.max(i,e.height-o-l));return n?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=t,r.y+=o,null!=e.text&&null!=e.text.boundingBox&&(n?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,n){mxCellRenderer.prototype.defaultShapes[e]=n},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,n){var t=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(t.isVertex(e.cell)||t.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=n&&!n||(this.initializeShape(e),e.view.graph.ordered||t.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,n){for(var t=null,a=e.view.graph,i=a.getModel(),s=e.cell,o=i.getParent(s);null!=o&&null==t;)t=this.findPreviousStateInContainer(a,o,s,n),s=o,o=i.getParent(s);return t},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,n,t,a){var i=null,s=e.getModel();for(t=null!=t?n.getIndex(t)-1:s.getChildCount(n)-1;0<=t&&null==i;t--)i=this.findPreviousStateInContainer(e,s.getChildAt(n,t),null,a);return null!=i||(null==(i=e.view.getState(n))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var n=e.shape.node.parentNode,t=this.getPreviousStateInContainer(e,n),a=n.firstChild;null!=t&&(a=t.shape.node,null!=t.text&&null!=t.text.node&&t.text.node.parentNode==n&&(a=t.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var n=(t=e.view).graph.getModel();if(t.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(t.graph.keepEdgesInBackground){var t,a=e.shape.node,i=a.parentNode;n=n.getParent(e.cell);null!=(i=null!=(t=t.getState(n))&&null!=t.shape&&null!=t.shape.node?t.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,n){e.shape.node.parentNode.insertBefore(e.shape.node,n),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var n=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=n?e.shape=new mxShape(n):(n=this.getShapeConstructor(e),e.shape=new n),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var n=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==n&&(n=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),n},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,n,t){var a=e.shape[n],i=e.view.graph,s=null;"inherit"==a?s=i.model.getParent(e.cell):"swimlane"==a?(s=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,s=i.getSwimlane(s),t=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[n]=e.shape.indicatorColor),null!=s&&(a=i.getView().getState(s),(e.shape[n]=null)!=a&&(e.shape[n]=null!=a.shape&&"indicatorColor"!=n?a.shape[n]:a.style[t]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var a=t.view.graph;if(a.getModel().isEdge(t.cell),0<t.style[mxConstants.STYLE_FONTSIZE]||null==t.style[mxConstants.STYLE_FONTSIZE]){var n=a.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(t.cell)&&a.isHtmlLabel(t.cell),a.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING]),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.state=t,this.initializeLabel(t);var i=!1,s=function(e){var n=t;return(mxClient.IS_TOUCH||i)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),i=!1)})),mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(t,e)&&(a.dblClick(e,t.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var n=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(n.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var n=e.view.graph.getCellOverlays(e.cell),t=null;if(null!=n){t=new mxDictionary;for(var a=0;a<n.length;a++){var i=null!=e.overlays?e.overlays.remove(n[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,n[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=n[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,n[a],i),null!=n[a].cursor&&(i.node.style.cursor=n[a].cursor)),t.put(n[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,n){n.destroy()}),e.overlays=t},mxCellRenderer.prototype.initializeOverlay=function(e,n){n.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(n,t,e){var a=n.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){t.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",n.cell))})},mxCellRenderer.prototype.createControl=function(t){var a=t.view.graph,e=a.getFoldingImage(t);if(a.foldingEnabled&&null!=e){if(null==t.control){var n=new mxRectangle(0,0,e.width,e.height);t.control=new mxImageShape(n,e.src),t.control.preserveImageAspect=!1,t.control.dialect=a.dialect,this.initControl(t,t.control,!0,function(e){if(a.isEnabled()){var n=!a.isCellCollapsed(t.cell);a.foldCells(n,!1,[t.cell]),mxEvent.consume(e)}})}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.initControl=function(n,e,t,a){var i=n.view.graph;return i.isHtmlLabel(n.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(n.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),t&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,n){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,n){return!0},mxCellRenderer.prototype.installListeners=function(t){var a=t.view.graph,n=function(e){var n=t;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(n=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,n,e),n=a.view.getState(a.getCellAt(e.x,e.y))),n},i=!1;mxEvent.addListener(t.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(t,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:n(e))):i&&mxEvent.consume(e)}));var s=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(t.shape.node,s,mxUtils.bind(this,function(e){i=!1,"gestureend"==s?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(t,e),mxEvent.consume(e))):this.isShapeEvent(t,e)&&(a.dblClick(e,null!=t.shape&&mxEvent.getSource(e)==t.shape.content?null:t.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,n){var t=this.getLabelValue(e);if(null==e.text&&null!=t&&(mxUtils.isNode(t)||0<t.length)?this.createLabel(e,t):null==e.text||null!=t&&0!=t.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),s=this.getLabelBounds(e);!n&&e.text.value==t&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(s)||(e.text.value=t,e.text.bounds=s,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var n=e.view.graph,t=e.view.scale,a=n.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*t,i.y+=a.y*t,null!=(n=n.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*n.width*t-e.text.spacingLeft*t-e.text.spacingRight*t),i.height=Math.max(0,e.text.margin.y*n.height*t-e.text.spacingTop*t-e.text.spacingBottom*t))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),n.isSwimlane(e.cell)&&(0<(n=n.getStartSize(e.cell)).width?(a=Math.min(i.width,n.width*t),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<n.height&&(a=Math.min(i.height,n.height*t),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,n){if(e.text.isPaintBoundsInverted()){var t=(e.width-e.height)/2;n.x+=t,n.y-=t,t=n.width,n.width=n.height,n.height=t}if(n.x-=e.text.margin.x*n.width,n.y-=e.text.margin.y*n.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){t=e.view.scale;var a=e.text.getSpacing();n.x+=a.x*t,n.y+=a.y*t,n.width=Math.max(0,n.width-e.text.spacingLeft*t-e.text.spacingRight*t),n.height=Math.max(0,n.height-e.text.spacingTop*t-e.text.spacingBottom*t)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(t=e.getCenterX(),a=e.getCenterY(),n.x!=t||n.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(i),Math.sin(i),new mxPoint(t,a)),n.x=pt.x,n.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(s,o){if(this.createCellOverlays(s),null!=s.overlays){var r=mxUtils.mod(mxUtils.getValue(s.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);s.overlays.visit(function(e,n){var t=n.overlay.getBounds(s);if(!s.view.graph.getModel().isEdge(s.cell)&&null!=s.shape&&0!=r){var a=t.getCenterX(),i=t.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(s.getCenterX(),s.getCenterY()))).x,i=i.y;t.x=Math.round(a-t.width/2),t.y=Math.round(i-t.height/2)}!o&&null!=n.bounds&&n.scale==s.view.scale&&n.bounds.equals(t)||(n.bounds=t,n.scale=s.view.scale,n.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,n){if(null!=e.control){var t=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!n&&e.control.scale==i&&e.control.bounds.equals(t)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=t,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null==e.control)return null;var n=e.control.scale,t=e.control.bounds.width/n,a=(n=e.control.bounds.height/n,e.view.scale),i=e.getCenterX(),s=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+t*a,s=e.y+n*a,null!=e.shape)){var o=e.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,s=s-r}0!=o&&(r=mxUtils.toRadians(o),o=Math.cos(r),r=Math.sin(r),i=(s=mxUtils.getRotatedPoint(new mxPoint(i,s),o,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,s=s.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-t/2*a),Math.round(s-n/2*a),Math.round(t*a),Math.round(n*a))},mxCellRenderer.prototype.redraw=function(e,n,t){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=n&&n,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),n=!0),delete e.invalidOrder,delete e.orderChanged,!n&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==t||t?e.shape.redraw():e.shape.updateBoundingBox()),(null==t||t)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,n){n.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,n,t,a,i){var s=e.view,o=s.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(n=new mxCellState).x=r.x,n.y=r.y;else{if(null==n)return;var c=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=o.getCellGeometry(n.cell)).relative?d=r.x<=.5:null!=t&&(d=t.x+t.width<n.x)}r=!0,null!=l?((t=new mxCellState).x=l.x,t.y=l.y):null!=t&&((c=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=o.getCellGeometry(t.cell)).relative?r=e.x<=.5:null!=n&&(r=n.x+n.width<t.x)),null!=n&&null!=t&&(e=d?n.x:n.x+n.width,n=s.getRoutingCenterY(n),o=r?t.x:t.x+t.width,t=s.getRoutingCenterY(t),s=new mxPoint(e+(d?-a:a),n),l=new mxPoint(o+(r?-a:a),t),d==r?(a=d?Math.min(e,o)-a:Math.max(e,o)+a,i.push(new mxPoint(a,n)),i.push(new mxPoint(a,t))):(s.x<l.x==d?(a=n+(t-n)/2,i.push(s),i.push(new mxPoint(s.x,a)),i.push(new mxPoint(l.x,a))):i.push(s),i.push(l)))},Loop:function(e,n,t,a,i){if(null!=n){var s=(t=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=t.transformControlPoint(e,a),mxUtils.contains(n,a.x,a.y)&&(a=null));var o=0,r=0,l=0,d=0;s=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,s.gridSize)*t.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(o=t.getRoutingCenterX(n),r=s):(l=t.getRoutingCenterY(n),d=s),null==a||a.x<n.x||a.x>n.x+n.width?null!=a?(o=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=n.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=n.y+n.height+2*r:o=e==mxConstants.DIRECTION_EAST?n.x-2*d:n.x+n.width+2*d:null!=a&&(o=t.getRoutingCenterX(n),r=Math.max(Math.abs(o-a.x),d),l=a.y,d=0),i.push(new mxPoint(o-r,l-d)),i.push(new mxPoint(o+r,l+d))}},ElbowConnector:function(e,n,t,a,i){var s=null!=a&&0<a.length?a[0]:null,o=!1,r=!1;if(null!=n&&null!=t)if(null!=s){var l=Math.min(n.x,t.x),d=Math.max(n.x+n.width,t.x+t.width),c=(r=Math.min(n.y,t.y),Math.max(n.y+n.height,t.y+t.height));o=(s=e.view.transformControlPoint(e,s)).y<r||s.y>c,r=s.x<l||s.x>d}else(o=(l=Math.max(n.x,t.x))==(d=Math.min(n.x+n.width,t.x+t.width)))||(r=(r=Math.max(n.y,t.y))==(c=Math.min(n.y+n.height,t.y+t.height)));r||!o&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,n,t,a,i):mxEdgeStyle.TopToBottom(e,n,t,a,i)},SideToSide:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(e=Math.max(n.x,t.x),o=Math.min(n.x+n.width,t.x+t.width),e=null!=a?a.x:o+(e-o)/2,o=s.getRoutingCenterY(n),s=s.getRoutingCenterY(t),null!=a&&(a.y>=n.y&&a.y<=n.y+n.height&&(o=a.y),a.y>=t.y&&a.y<=t.y+t.height&&(s=a.y)),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),!mxUtils.contains(t,e,s)&&!mxUtils.contains(n,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a?!mxUtils.contains(t,e,a.y)&&!mxUtils.contains(n,e,a.y)&&i.push(new mxPoint(e,a.y)):(s=Math.max(n.y,t.y),n=Math.min(n.y+n.height,t.y+t.height),i.push(new mxPoint(e,s+(n-s)/2)))))},TopToBottom:function(e,n,t,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((n=new mxCellState).x=o.x,n.y=o.y),null!=r&&((t=new mxCellState).x=r.x,t.y=r.y),null!=n&&null!=t&&(o=Math.max(n.y,t.y),r=Math.min(n.y+n.height,t.y+t.height),e=s.getRoutingCenterX(n),null!=a&&a.x>=n.x&&a.x<=n.x+n.width&&(e=a.x),o=null!=a?a.y:r+(o-r)/2,!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),e=null!=a&&a.x>=t.x&&a.x<=t.x+t.width?a.x:s.getRoutingCenterX(t),!mxUtils.contains(t,e,o)&&!mxUtils.contains(n,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(t,a.x,o)&&!mxUtils.contains(n,a.x,o)&&i.push(new mxPoint(a.x,o)):(s=Math.max(n.x,t.x),n=Math.min(n.x+n.width,t.x+t.width),i.push(new mxPoint(s+(n-s)/2,o)))))},SegmentConnector:function(e,n,t,a,i){var s=e.absolutePoints,o=!0,r=null,l=s[0];null==l&&null!=n?l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n)):null!=l&&(l=l.clone());var d=s.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=n,m=s[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,f=null!=m&&m.y==u.y,b=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=f||null==m&&b,p=h||null==m&&c;if(null!=m&&!f&&!h&&(b||c)){o=!b;break}if(p||u){o=u,1==v&&(o=0==a.length%2?u:p);break}c=t,m=s[d],u=e.view.transformControlPoint(e,a[g-1])}for(o&&(null!=s[0]&&s[0].y!=r.y||null==s[0]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[0]&&s[0].x!=r.x||null==s[0]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),o?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)o=!o,r=e.view.transformControlPoint(e,a[v]),o?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,o=!0;if(null==(l=s[d])&&null!=t&&(l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t))),o&&(null!=s[d]&&s[d].y!=r.y||null==s[d]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[d]&&s[d].x!=r.x||null==s[d]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),null==s[0]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[1].x,i[1].y);)i=i.splice(1,1);if(null==s[d]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,n,t,a,i){var s=e.view.graph,o=null!=n&&s.getModel().isEdge(n.cell);s=null!=t&&s.getModel().isEdge(t.cell);if(null!=a&&0<a.length||o||s)mxEdgeStyle.SegmentConnector(e,n,t,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=n?n.x:r.x;o=null!=n?n.y:r.y;var d=null!=n?n.width:1,c=null!=n?n.height:1,m=null!=t?t.x:l.x,u=null!=t?t.y:l.y,p=null!=t?t.width:1,g=null!=t?t.height:1,v=(s=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=n&&(v[0]=mxUtils.getPortConstraints(n,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=t&&(v[1]=mxUtils.getPortConstraints(t,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,o,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-s,mxEdgeStyle.limits[d][2]=a[d][1]-s,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+s,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+s;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(o=0)?o=c<0?2:1:c<=0&&(o=3,0==d&&(o=2)),(c=null)!=n&&(c=r),n=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(n[d][0]=(c.x-a[d][0])/a[d][2],n[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<n[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),n[d][1]=(c.y-a[d][1])/a[d][3],n[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<n[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=t&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*s,0),t=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*s<m&&2*s<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*s<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*s<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),t[d]=u[d][0]&v[d],t[d]|=(u[d][1]&v[d])<<8,t[d]|=(u[1-d][d]&v[d])<<16,t[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&t[d])&&(t[d]<<=8),0==(3840&t[d])&&(t[d]=15&t[d]|t[d]>>8),0==(983040&t[d])&&(t[d]=65535&t[d]|(251658240&t[d])>>8),e[d]=15&t[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=o)<1&&(d+=4),(v-=o)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+s;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+s,mxEdgeStyle.wayPoints1[0][1]+=n[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=n[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=s}for(r=t=(s=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=o)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=t&&(s++,mxEdgeStyle.wayPoints1[s][0]=mxEdgeStyle.wayPoints1[s-1][0],mxEdgeStyle.wayPoints1[s][1]=mxEdgeStyle.wayPoints1[s-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<o)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+n[p][0]*a[p][2]:u?a[p][1]+n[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[s][0])*c[0])&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[s][1])*c[1])&&(mxEdgeStyle.wayPoints1[s][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[s][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<s&&mxEdgeStyle.wayPoints1[s][l]==mxEdgeStyle.wayPoints1[s-1][l]?s--:t=l}for(d=0;d<=s&&(d!=s||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(s+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,n,t,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=n)<1&&(i+=4),(e-=n)<1&&(e+=4),n=routePatterns[i-1][e-1],0!=t&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(n=inlineRoutePatterns[i-1][e-1]),n}},mxStyleRegistry={values:[],putValue:function(e,n){mxStyleRegistry.values[e]=n},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var n in mxStyleRegistry.values)if(mxStyleRegistry.values[n]==e)return n;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,n){if(this.view=e,this.previous=this.root=n,this.isUp=null==n,!this.isUp)for(var t=this.view.currentRoot,a=this.view.graph.getModel();null!=t;){if(t==n){this.isUp=!0;break}t=a.getParent(t)}}function mxGraph(e,n,t,a){this.mouseListeners=null,this.renderHint=t,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:t==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:t==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:t==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=n?n:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,n){this.graphModelChanged(n.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,n,t,a,i,s){this.image=e,this.tooltip=n,this.align=null!=t?t:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(e,n){this.source=e,null!=n&&this.init(n)}function mxMultiplicity(e,n,t,a,i,s,o,r,l,d){this.source=e,this.type=n,this.attr=t,this.value=a,this.min=null!=i?i:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.beforeUndo(n.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsMoved(n.getProperty("cells"),n.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,n,t,a){this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.shiftRightwards=null==n||n,this.shiftDownwards=null==t||t,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,n,t,a){this.horizontal=null==n||n,this.addEnabled=null==t||t,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(n.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(n.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,n,t){if(this.view=e,n=null!=n?n:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(n),null!=t){n=e.createState(new mxCell);for(var a=0;a<t.length;a++)e.validateBounds(n,t[a]);var i=null;for(a=0;a<t.length;a++){var s=e.validatePoints(n,t[a]);null==i?i=s:i.add(s)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,n){this.point=e,this.perimeter=null==n||n}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,n){null!=e&&(this.graph=e,this.factoryMethod=n,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,n,t,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?t:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,n){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,n){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=n,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,n){null!=e&&(this.graph=e,this.target=n||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,n){null!=e&&(this.graph=e,this.delay=n||500,this.graph.addMouseListener(this))}function mxCellTracker(e,n,t){mxCellMarker.call(this,e,n),this.graph.addMouseListener(this),null!=t&&(this.getCell=t),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,n,t,a){null!=e&&(this.graph=e,this.highlightColor=null!=n?n:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=t?t:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(n){if(null!=n){this.editor=n,this.handler=new mxKeyHandler(n.graph);var t=this.handler.escape;this.handler.escape=function(e){t.apply(this,arguments),n.hideProperties(),n.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,n){this.editor=n,null!=e&&null!=n&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i))}return n},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var n=new mxCurrentRootChange(this,e);n.execute();var t=new mxUndoableEdit(this,!1);t.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,n,t){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==n&&this.translate.y==t||(this.scale=e,this.translate.x=n,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var n=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",n))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,n){var t=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==n||(this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",t))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,n,t){var a=this.graph.getModel();if(e=e||a.getRoot(),n=null!=n&&n,t=null==t||t,this.removeState(e),t&&(n||e!=this.currentRoot)){t=a.getChildCount(e);for(var i=0;i<t;i++)this.clear(a.getChildAt(e,i),n)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,n,t,a){var i=this.graph.getModel();if(e=e||i.getRoot(),n=null==n||n,t=null==t||t,a=null!=a&&a,null!=(o=this.getState(e))&&(o.invalid=!0,a&&(o.orderChanged=!0)),n)for(var s=i.getChildCount(e),o=0;o<s;o++){var r=i.getChildAt(e,o);this.invalidate(r,n,t,a)}if(t)for(a=i.getEdgeCount(e),o=0;o<a;o++)this.invalidate(i.getEdgeAt(e,o),n,t)},mxGraphView.prototype.validate=function(e){var n=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var t=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){t=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=t&&(this.canvas.style.display=t,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",n)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(n=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,n=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*n,e.height*n)},mxGraphView.prototype.redrawBackgroundImage=function(e,n){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*n.width,e.bounds.height=this.scale*n.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,n){var t=this.graph.getModel(),a=this.getState(n,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(n)){if(n!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(s=this.graph.getCellGeometry(n))){if(!t.isEdge(n)){var i=s.offset||this.EMPTY_POINT;s.relative?(a.origin.x+=s.x*e.width/this.scale+i.x,a.origin.y+=s.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=s.x,a.origin.y+=s.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*s.width,a.height=this.scale*s.height,t.isVertex(n)){if(s.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var s=Math.cos(i),o=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());s=mxUtils.getRotatedPoint(o,s,i,r);a.x=s.x-a.width/2,a.y=s.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(n);null!=(i=this.graph.getChildOffsetForCell(n))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),i=0;i<s;i++)o=t.getChildAt(n,i),this.validateBounds(a,o)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var n=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);n==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:n==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(n=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:n==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,n){var t=this.graph.getModel(),a=this.getState(n),i=null;if(null!=a){if(a.invalid){var s=this.graph.getCellGeometry(n);if(null!=s&&t.isEdge(n)){var o=this.getState(this.getVisibleTerminal(n,!0));if(a.setVisibleTerminalState(o,!0),null!=o&&t.isEdge(o.cell)&&!t.isAncestor(o.cell,n)){var r=this.getState(t.getParent(o.cell));this.validatePoints(r,o.cell)}var l=this.getState(this.getVisibleTerminal(n,!1));a.setVisibleTerminalState(l,!1),null!=l&&t.isEdge(l.cell)&&!t.isAncestor(l.cell,n)&&(r=this.getState(t.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,o,l),this.updatePoints(a,s.points,o,l),this.updateFloatingTerminalPoints(a,o,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=s&&s.relative&&null!=e&&t.isEdge(e.cell)&&(null!=(s=this.getPoint(e,s))&&(a.x=s.x,a.y=s.y,s.x=s.x/this.scale-this.translate.x,s.y=s.y/this.scale-this.translate.y,a.origin=s,this.childMoved(e,a)));a.invalid=!1,n!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(t.isEdge(n)||t.isVertex(n))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(n)||n==this.currentRoot))for(s=t.getChildCount(n),o=0;o<s;o++)r=t.getChildAt(n,o),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,n){var t=n.cell;if(!this.graph.isCellCollapsed(t)||t==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(t),s=0;s<i;s++)this.validateBounds(n,a.getChildAt(t,s))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,n,t){this.updateFixedTerminalPoint(e,n,!0,this.graph.getConnectionConstraint(e,n,!0)),this.updateFixedTerminalPoint(e,t,!1,this.graph.getConnectionConstraint(e,t,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,n,t,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(n,a)),null==i&&null==n){n=this.scale,a=this.translate;var s=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(t))&&(i=new mxPoint(n*(a.x+i.x+s.x),n*(a.y+i.y+s.y)))}e.setAbsoluteTerminalPoint(i,t)},mxGraphView.prototype.updatePoints=function(e,n,t,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var s=this.getEdgeStyle(e,n,t,a);if(null!=s)s(e,t=this.getTerminalPort(e,t,!0),a=this.getTerminalPort(e,a,!1),n,i);else if(null!=n)for(s=0;s<n.length;s++)null!=n[s]&&(a=mxUtils.clone(n[s]),i.push(this.transformControlPoint(e,a)));n=e.absolutePoints,i.push(n[n.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,n){var t=e.origin;return new mxPoint(this.scale*(n.x+this.translate.x+t.x),this.scale*(n.y+this.translate.y+t.y))},mxGraphView.prototype.getEdgeStyle=function(e,n,t,a){return"string"==typeof(e=null!=t&&t==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(n=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,n,t){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!1),null==i&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,n,t,a){n=this.getTerminalPort(e,n,a);var i=this.getNextPoint(e,t,a),s=this.graph.isOrthogonal(e);t=mxUtils.toRadians(Number(n.style[mxConstants.STYLE_ROTATION]||"0"));var o=new mxPoint(n.getCenterX(),n.getCenterY());if(0!=t){var r=Math.cos(-t),l=Math.sin(-t);i=mxUtils.getRotatedPoint(i,r,l,o)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),n=this.getPerimeterPoint(n,i,0==t&&s,r),0!=t&&(r=Math.cos(t),l=Math.sin(t),n=mxUtils.getRotatedPoint(n,r,l,o)),e.setAbsoluteTerminalPoint(n,a)},mxGraphView.prototype.getTerminalPort=function(e,n,t){return null!=(e=mxUtils.getValue(e.style,t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(n=e)),n},mxGraphView.prototype.getPerimeterPoint=function(e,n,t,a){var i=null;if(null!=e){var s=this.getPerimeterFunction(e);null!=s&&null!=n&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=s(a,e,n,t)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+n*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var n=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+n*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,n){return n=null!=n?n:0,null!=e&&(n+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(n*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,n,t){var a=null;return null!=(e=e.absolutePoints)&&(t||2<e.length||null==n)&&(a=e.length,a=e[t?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=n&&(a=new mxPoint(n.getCenterX(),n.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,n){for(var t=this.graph.getModel(),a=t.getTerminal(e,n),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=t.getParent(a);return t.getParent(i)==t.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var n=e.absolutePoints;if(e.length=0,null!=n&&0<n.length){var t=n[0],a=n[n.length-1];if(null==t||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(t.x!=a.x||t.y!=a.y){var i=a.x-t.x,s=a.y-t.y;e.terminalDistance=Math.sqrt(i*i+s*s)}else e.terminalDistance=0;a=0;var o=[];if(null!=(s=t)){t=s.x;for(var r=s.y,l=t,d=r,c=1;c<n.length;c++){var m=n[c];null!=m&&(i=s.x-m.x,s=s.y-m.y,i=Math.sqrt(i*i+s*s),o.push(i),a+=i,s=m,t=Math.min(s.x,t),r=Math.min(s.y,r),l=Math.max(s.x,l),d=Math.max(s.y,d))}e.length=a,e.segments=o,e.x=t,e.y=r,e.width=Math.max(1,l-t),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,n){var t=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=n&&!n.relative)null!=n&&(null!=(d=n.offset)&&(t+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,s=(.5+(null!=n?n.x/2:0))*e.length,o=e.segments[0],r=0,l=1;r+o<s&&l<i-1;)r+=o,o=e.segments[l++];if(i=0==o?0:(s-r)/o,s=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=s&&null!=l){if(r=t=a=0,null!=n){a=n.y;var d=n.offset;null!=d&&(t=d.x,r=d.y)}d=l.x-s.x,l=l.y-s.y,t=s.x+d*i+((0==o?0:l/o)*a+t)*this.scale,a=s.y+l*i-((0==o?0:d/o)*a-r)*this.scale}}return new mxPoint(t,a)},mxGraphView.prototype.getRelativePoint=function(e,n,t){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,s=e.segments,o=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t),d=0,c=0,m=0,u=2;u<a;u++)c+=s[u-2],r=e.absolutePoints[u],(o=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t))<=l&&(l=o,d=u-1,m=c),o=r;return a=s[d],o=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,s=r.y,s=(l=(e=o.x-l)-(l=n-l))*e+(s=(d=o.y-s)-(s=t-s))*d,a<(e=Math.sqrt(s<=0?0:s*s/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,n,t)),-1==mxUtils.relativeCcw(o.x,o.y,r.x,r.y,n,t)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var n=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=n&&0<n.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(t=this.getPoint(e,i))&&(e.absoluteOffset=t)}else{var t=n[0],a=n[n.length-1];if(null!=t&&null!=a){n=a.x-t.x;var i,s=a.y-t.y,o=a=0;null!=(i=i.offset)&&(a=i.x,o=i.y),i=t.y+s/2+o*this.scale,e.absoluteOffset.x=t.x+n/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,n){n=n||!1;var t=null;return null!=e&&(t=this.states.get(e),this.graph.isCellVisible(e)&&(null==t&&n&&this.graph.isCellVisible(e)?(t=this.createState(e),this.states.put(e,t)):n&&null!=t&&this.updateStyle&&(t.style=this.graph.getCellStyle(e)))),t},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var n=[],t=0;t<e.length;t++){var a=this.getState(e[t]);null!=a&&n.push(a)}return n},mxGraphView.prototype.removeState=function(e){var n=null;return null!=e&&(null!=(n=this.states.remove(e))&&(this.graph.cellRenderer.destroy(n),n.destroy())),n},mxGraphView.prototype.createState=function(e){var n=this.graph.getCellStyle(e);return e=new mxCellState(this,e,n),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var n=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-n.x,e.clientY-n.y);n=this.graph.container.offsetWidth;var t=this.graph.container.clientWidth;return t<n&&e.x>t+2&&e.x<=n||(n=this.graph.container.offsetHeight,(t=this.graph.container.clientHeight)<n&&e.y>t+2&&e.y<=n)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,n){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var n,t;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(n=e,t=null,mxClient.IS_TOUCH&&(t=mxEvent.getClientX(n),n=mxEvent.getClientY(n),n=mxUtils.convertPoint(i,t,n),t=a.view.getState(a.getCellAt(n.x,n.y))),t)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,n){if(null!=this.graph.container){var t=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=t<n?n+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,n){var t=document.createElement("DIV");return null!=e&&null!=n?(t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e,t.style.height=n):t.style.position="relative",t},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var n=e.offsetWidth,t=e.offsetHeight;this.canvas=this.createVmlPane(n,t),this.backgroundPane=this.createVmlPane(n,t),this.drawPane=this.createVmlPane(n,t),this.overlayPane=this.createVmlPane(n,t),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,n){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.width=e+"px",t.style.height=n+"px",t.setAttribute("coordsize",e+","+n),t.setAttribute("coordorigin","0,0"),t},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var n=document.createElementNS(mxConstants.NS_SVG,"svg");n.style.width="100%",n.style.height="100%",n.style.display="block",n.appendChild(this.canvas),null!=e&&(e.appendChild(n),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(n,i)<0&&n.push(i)}}return this.getModel().getTopmostCells(n)},mxGraph.prototype.graphModelChanged=function(e){for(var n=0;n<e.length;n++)this.processChange(e[n]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var n=[],t=0;t<e.length;t++){var a=e[t];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(n=n.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(n=n.concat(this.model.getDescendants(a.cell)))}return n},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var n=this.model.getParent(e.child);null!=n?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),n!=e.previous&&(null!=n&&this.view.invalidate(n,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var n=this.model.getChildCount(e),t=0;t<n;t++)this.removeStateForCell(this.model.getChildAt(e,t));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,n){null==e.overlays&&(e.overlays=[]),e.overlays.push(n);var t=this.view.getState(e);return null!=t&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",n)),n},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,n){if(null==n)this.removeCellOverlays(e);else{var t=mxUtils.indexOf(e.overlays,n);0<=t?(e.overlays.splice(t,1),0==e.overlays.length&&(e.overlays=null),null!=(t=this.view.getState(e))&&this.cellRenderer.redraw(t),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n))):n=null}return n},mxGraph.prototype.removeCellOverlays=function(e){var n=e.overlays;if(null!=n){e.overlays=null;var t=this.view.getState(e);for(null!=t&&this.cellRenderer.redraw(t),t=0;t<n.length;t++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",n[t]))}return n},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var n=this.model.getChildCount(e),t=0;t<n;t++){var a=this.model.getChildAt(e,t);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(t,e,n,a){return null!=e&&0<e.length?(e=new mxCellOverlay(n=null!=n?n:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,n){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,e)):(this.removeCellOverlays(t),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,n){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",n)),this.cellEditor.startEditing(e,n))},mxGraph.prototype.getEditingValue=function(e,n){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,n,t){this.model.beginUpdate();try{this.cellLabelChanged(e,n,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",n,"event",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,n,t){this.model.beginUpdate();try{this.model.setValue(e,n),t&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var n=0;n<e.length;n++){var t=this.view.getState(e[n]);null!=t&&null!=t.handler&&t.handler.reset()}},mxGraph.prototype.click=function(e){var n=e.getEvent(),t=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",n,"cell",t);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(n)&&!a.isConsumed()&&(null!=t?this.selectCellForEvent(t,n):(t=null,this.isSwimlaneSelectionEnabled()&&(t=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=t?this.selectCellForEvent(t,n):this.isToggleEvent(n)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),this.isEnabled()&&!mxEvent.isConsumed(e)&&!t.isConsumed()&&null!=n&&this.isCellEditable(n)&&this.startEditingAtCell(n,e)},mxGraph.prototype.scrollPointToVisible=function(e,n,t,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,n+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&n>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&n<=i.scrollTop+i.clientHeight){var s=i.scrollLeft+i.clientWidth-e;if(s<a){if(e=i.scrollLeft,i.scrollLeft+=a-s,t&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+a-s}else o=Math.max(i.clientWidth,i.scrollWidth)+a-s,e=this.view.getCanvas();e.style.width=o+"px",i.scrollLeft+=a-s}}else(s=e-i.scrollLeft)<a&&(i.scrollLeft-=a-s);(s=i.scrollTop+i.clientHeight-n)<a?(e=i.scrollTop,i.scrollTop+=a-s,e==i.scrollTop&&t&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,n=this.container.scrollHeight+a-s):(n=Math.max(i.clientHeight,i.scrollHeight)+a-s,e=this.view.getCanvas()),e.style.height=n+"px",i.scrollTop+=a-s)):(s=n-i.scrollTop)<a&&(i.scrollTop-=a-s)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var n=0;n="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(n)&&(n=0),n}var n=mxUtils.getCurrentStyle(this.container),t=new mxRectangle;return t.x=e(n.borderLeftWidth)+parseInt(n.paddingLeft||0),t.y=e(n.borderTopWidth)+parseInt(n.paddingTop||0),t.width=e(n.borderRightWidth)+parseInt(n.paddingRight||0),t.height=e(n.borderBottomWidth)+parseInt(n.paddingBottom||0),t},mxGraph.prototype.getPreferredPageSize=function(e,n,t){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,s=e*this.pageScale;i=new mxRectangle(0,0,i.width*s,i.height*s);return n=this.pageBreaksVisible?Math.ceil(n/i.width):1,t=this.pageBreaksVisible?Math.ceil(t/i.height):1,new mxRectangle(0,0,n*i.width+2+a.x/e,t*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var n=this.getBorder(),t=Math.max(0,e.x+e.width+1+n);n=Math.max(0,e.y+e.height+1+n);if(null!=this.minimumContainerSize&&(t=Math.max(t,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(t,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,t,n);null!=a&&(t=a.width,n=a.height)}null!=this.minimumGraphSize&&(t=Math.max(t,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),t=Math.ceil(t-1),n=Math.ceil(n-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,t)+"px",a.style.minHeight=Math.max(1,n)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,t),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,t)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px"),this.updatePageBreaks(this.pageBreaksVisible,t-1,n-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,n){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var t=this.getBorderSizes();e+=Math.max(2,t.x+t.width+1),n+=Math.max(2,t.y+t.height+1)}else 9<=document.documentMode?(e+=3,n+=5):(e+=1,n+=1);else n+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),n=Math.min(this.maximumContainerSize.height,n)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(n)+"px"},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),s=e?Math.ceil((n-i.x)/i.width):0,e=e?Math.ceil((t-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<s&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(o=0;o<=s;o++){var r=[new mxPoint(i.x+o*i.width,1),new mxPoint(i.x+o*i.width,t)];null!=this.horizontalPageBreaks[o]?(this.horizontalPageBreaks[o].scale=1,this.horizontalPageBreaks[o].points=r,this.horizontalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[o]=r)}for(o=s;o<this.horizontalPageBreaks.length;o++)this.horizontalPageBreaks[o].destroy();this.horizontalPageBreaks.splice(s,this.horizontalPageBreaks.length-s)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(o=0;o<=e;o++)r=[new mxPoint(1,i.y+o*i.height),new mxPoint(n,i.y+o*i.height)],null!=this.verticalPageBreaks[o]?(this.verticalPageBreaks[o].scale=1,this.verticalPageBreaks[o].points=r,this.verticalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[o]=r);for(o=e;o<this.verticalPageBreaks.length;o++)this.verticalPageBreaks[o].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var n=this.model.getStyle(e),t=null;t=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=n&&(t=this.postProcessCellStyle(this.stylesheet.getCellStyle(n,t))),null==t&&(t=mxGraph.prototype.EMPTY_ARRAY),t},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var n=e[mxConstants.STYLE_IMAGE],t=this.getImageFromBundles(n);null!=t?e[mxConstants.STYLE_IMAGE]=t:t=n,null!=t&&"data:image/"==t.substring(0,11)&&(0<(n=t.indexOf(","))&&(t=t.substring(0,n)+";base64,"+t.substring(n+1)),e[mxConstants.STYLE_IMAGE]=t)}return e},mxGraph.prototype.setCellStyle=function(e,n){if(null!=(n=n||this.getSelectionCells())){this.model.beginUpdate();try{for(var t=0;t<n.length;t++)this.model.setStyle(n[t],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,n,t){t=t||this.getSelectionCell(),this.toggleCellStyles(e,n,[t])},mxGraph.prototype.toggleCellStyles=function(e,n,t){var a;(n=null!=n&&n,null!=(t=t||this.getSelectionCells())&&0<t.length)&&(null!=(a=null!=(a=this.view.getState(t[0]))?a.style:this.getCellStyle(t[0]))&&(n=mxUtils.getValue(a,e,n)?0:1,this.setCellStyles(e,n,t)))},mxGraph.prototype.setCellStyles=function(e,n,t){t=t||this.getSelectionCells(),mxUtils.setCellStyles(this.model,t,e,n)},mxGraph.prototype.toggleCellStyleFlags=function(e,n,t){this.setCellStyleFlags(e,n,null,t)},mxGraph.prototype.setCellStyleFlags=function(e,n,t,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==t)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(t=(parseInt(i[e]||0)&n)!=n);mxUtils.setCellStyleFlags(this.model,a,e,n,t)}},mxGraph.prototype.alignCells=function(e,n,t){if(null==n&&(n=this.getSelectionCells()),null!=n&&1<n.length){if(null==t)for(var a=0;a<n.length;a++){var i=this.getCellGeometry(n[a]);if(null!=i&&!this.model.isEdge(n[a]))if(null==t){if(e==mxConstants.ALIGN_CENTER){t=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)t=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)t=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){t=i.y+i.height/2;break}t=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else t=e==mxConstants.ALIGN_RIGHT?Math.max(t,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(t,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(t,i.y+i.height):Math.min(t,i.x)}if(null!=t){this.model.beginUpdate();try{for(a=0;a<n.length;a++)null!=(i=this.getCellGeometry(n[a]))&&!this.model.isEdge(n[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=t-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=t-i.width:e==mxConstants.ALIGN_TOP?i.y=t:e==mxConstants.ALIGN_MIDDLE?i.y=t-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=t-i.height:i.x=t,this.model.setGeometry(n[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",n))}finally{this.model.endUpdate()}}}return n},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var n=this.model.getStyle(e);null==n||0==n.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var n=[],t=0;t<this.imageBundles.length;t++)this.imageBundles[t]!=e&&n.push(this.imageBundles[t]);this.imageBundles=n},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var n=0;n<this.imageBundles.length;n++){var t=this.imageBundles[n].getImage(e);if(null!=t)return t}return null},mxGraph.prototype.orderCells=function(e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(n,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsOrdered=function(e,n){if(null!=e){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=this.model.getParent(e[t]);n?this.model.add(a,e[t],t):this.model.add(a,e[t],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",n,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,n,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),t=this.getCellsForGroup(t),null==e&&(e=this.createGroupCell(t));var a=this.getBoundsForGroup(e,t,n);if(0<t.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(t[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var s=this.model.getChildCount(i);this.cellsAdded([e],i,s,null,null,!1),s=this.model.getChildCount(e),this.cellsAdded(t,e,s,null,null,!1,!1),this.cellsMoved(t,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",n,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var n=[];if(null!=e&&0<e.length){var t=this.model.getParent(e[0]);n.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==t&&n.push(e[a])}return n},mxGraph.prototype.getBoundsForGroup=function(e,n,t){return null!=(n=this.getBoundingBoxFromGeometry(n))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),n.x-=e.width,n.y-=e.height,n.width+=e.width,n.height+=e.height),n.x-=t,n.y-=t,n.width+=2*t,n.height+=2*t),n},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var n=[];if(null==e){e=this.getSelectionCells();for(var t=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&t.push(e[a]);e=t}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),s=this.model.getParent(e[a]),o=this.model.getChildCount(s);this.cellsAdded(i,s,o,null,null,!0),n=n.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return n},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var n=this.getDefaultParent(),t=this.model.getChildCount(n);this.cellsAdded(e,n,t,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,n,t){null==e&&(e=this.getSelectionCells()),n=null!=n?n:0,t=null!=t&&t,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var s=this.getBoundingBoxFromGeometry(i);if(0<s.width&&0<s.height){var o=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();t&&(r.x+=s.x-o.width-n,r.y+=s.y-o.height-n),r.width=s.width+o.width+2*n,r.height=s.height+o.height+2*n,this.model.setGeometry(e[a],r),this.moveCells(i,-s.x+o.width+n,-s.y+o.height+n)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,n){n=null==n||n;var t=null;if(null!=e){for(var a={},i=(t=[],0);i<e.length;i++){a[s=mxCellPath.create(e[i])]=e[i],t.push(e[i])}if(0<t.length){var s=this.view.scale,o=this.view.translate;for(t=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!n&&this.model.isEdge(t[i])&&null!=this.getEdgeValidationError(t[i],this.model.getTerminal(t[i],!0),this.model.getTerminal(t[i],!1)))t[i]=null;else{var r=this.model.getGeometry(t[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(t[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/s-o.x,l[0].y/s-o.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/s-o.x,l[m].y/s-o.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else t=[]}return t},mxGraph.prototype.insertVertex=function(e,n,t,a,i,s,o,r,l){return n=this.createVertex(e,n,t,a,i,s,o,r,l),this.addCell(n,e)},mxGraph.prototype.createVertex=function(e,n,t,a,i,s,o,r,l){return(e=new mxGeometry(a,i,s,o)).relative=null!=l&&l,(t=new mxCell(t,e,r)).setId(n),t.setVertex(!0),t.setConnectable(!0),t},mxGraph.prototype.insertEdge=function(e,n,t,a,i,s){return n=this.createEdge(e,n,t,a,i,s),this.addEdge(n,e,a,i)},mxGraph.prototype.createEdge=function(e,n,t,a,i,s){return(e=new mxCell(t,new mxGeometry,s)).setId(n),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,n,t,a,i){return this.addCell(e,n,i,t,a)},mxGraph.prototype.addCell=function(e,n,t,a,i){return this.addCells([e],n,t,a,i)[0]},mxGraph.prototype.addCells=function(e,n,t,a,i){null==n&&(n=this.getDefaultParent()),null==t&&(t=this.model.getChildCount(n)),this.model.beginUpdate();try{this.cellsAdded(e,n,t,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",n,"index",t,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,n,t,a,i,s,o){if(null!=e&&null!=n&&null!=t){this.model.beginUpdate();try{for(var r=null!=(d=s?this.view.getState(n):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])t--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=n&&n!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}n==c&&t+d>this.model.getChildCount(n)&&t--,this.model.add(n,e[d],t+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==o||o)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",n,"index",t,"source",a,"target",i,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,n){n=null==n||n,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),n&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var n=this.view.scale,t=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var s=mxCellPath.create(e[i]);a[s]=e[i]}for(i=0;i<e.length;i++){for(var o=this.getConnections(e[i]),r=0;r<o.length;r++)if(null==a[s=mxCellPath.create(o[r])]){if(null!=(d=this.model.getGeometry(o[r]))){var l=this.view.getState(o[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/n-t.x,m[u].y/n-t.y),c),this.model.setTerminal(o[r],null,c),this.model.setGeometry(o[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,n,t,a,i){a=a||0,i=i||0,null==t&&(t=this.cloneCells([e])[0]);var s=this.model.getParent(e),o=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(n,a,i,!1,!1),this.cellsAdded(n,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([t],s,this.model.getChildCount(s),o,n[0],!1),this.cellConnected(e,n[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",n,"newEdge",t,"dx",a,"dy",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.toggleCells=function(e,n,t){null==n&&(n=this.getSelectionCells()),t&&(n=this.addAllEdges(n)),this.model.beginUpdate();try{this.cellsToggled(n,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",n,"includeEdges",t))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsToggled=function(e,n){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++)this.model.setVisible(e[t],n)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,n,t,a){n=null!=n&&n,null==t&&(t=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(t,e,n,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",n,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsFolded=function(e,n,t,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],n))&&n!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],n),this.swapBounds(e[i],n),this.isExtendParent(e[i])&&this.extendParent(e[i]),t)){var s=this.model.getChildren(e[i]);this.foldCells(s,n,t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",n,"recurse",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,n){if(null!=e){var t=this.model.getGeometry(e);null!=t&&(t=t.clone(),this.updateAlternateBounds(e,t,n),t.swap(),this.model.setGeometry(e,t))}},mxGraph.prototype.updateAlternateBounds=function(e,n,t){if(null!=e&&null!=n){if(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e),null==n.alternateBounds){var a=n;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(t,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),n.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=n.alternateBounds){n.alternateBounds.x=n.x,n.alternateBounds.y=n.y;var i=mxUtils.toRadians(t[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=n.alternateBounds.getCenterX()-n.getCenterX(),t=n.alternateBounds.getCenterY()-n.getCenterY(),a=Math.cos(i),i=Math.sin(i),n.alternateBounds.x+=a*e-i*t-e,n.alternateBounds.y+=i*e+a*t-t)}}},mxGraph.prototype.addAllEdges=function(e){var n=e.slice();return n.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var n=[];if(null!=e)for(var t=0;t<e.length;t++){for(var a=this.model.getEdgeCount(e[t]),i=0;i<a;i++)n.push(this.model.getEdgeAt(e[t],i));a=this.model.getChildren(e[t]),n=n.concat(this.getAllEdges(a))}return n},mxGraph.prototype.updateCellSize=function(e,n){n=null!=n&&n,this.model.beginUpdate();try{this.cellSizeUpdated(e,n),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,n){if(null!=e){this.model.beginUpdate();try{var t=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=t&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var s=this.view.getState(e),o=null!=s?s.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.height+8),i&&(a.height=t.height+8),a.width=t.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,t.width+8),i&&(a.width=t.width+8),a.height=t.height),this.model.setStyle(e,r)}else a.width=t.width,a.height=t.height;if(!n&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var n=null;if(null!=e){var t=this.view.getState(e),a=null!=t?t.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0;n=0;null==this.getImage(t)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(n+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(a[mxConstants.STYLE_SPACING]||0),s+=a[mxConstants.STYLE_SPACING_LEFT]||0,s+=a[mxConstants.STYLE_SPACING_RIGHT]||0,n+=2*(a[mxConstants.STYLE_SPACING]||0),n+=a[mxConstants.STYLE_SPACING_TOP]||0,n+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(t=this.getFoldingImage(t))&&(s+=t.width+8),n=null!=(t=this.getLabel(e))&&0<t.length?(this.isHtmlLabel(e)||(t=t.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(t,i,a[mxConstants.STYLE_FONTFAMILY])).width+s,n=i.height+n,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=n,n=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),n=this.snap(n+this.gridSize/2)),new mxRectangle(0,0,e,n)):new mxRectangle(0,0,a=4*this.gridSize,a)}}return n},mxGraph.prototype.handleGesture=function(e,n){if(.2<Math.abs(1-n.scale)){var t=this.view.scale,a=this.view.translate,i=e.width*n.scale,s=e.height*n.scale,o=e.y-(s-e.height)/2;t=new mxRectangle(this.snap((e.x-(i-e.width)/2)/t)-a.x,this.snap(o/t)-a.y,this.snap(i/t),this.snap(s/t));this.resizeCell(e.cell,t)}},mxGraph.prototype.resizeCell=function(e,n){return this.resizeCells([e],[n])[0]},mxGraph.prototype.resizeCells=function(e,n){this.model.beginUpdate();try{this.cellsResized(e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,n){if(null!=e&&null!=n&&e.length==n.length){this.model.beginUpdate();try{for(var t=0;t<e.length;t++){var a=n[t],i=this.model.getGeometry(e[t]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var s=i.offset;null!=s&&(s.x+=a.x-i.x,s.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[t])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[t],i),this.isExtendParent(e[t])&&this.extendParent(e[t])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var n=this.model.getParent(e),t=this.model.getGeometry(n);null!=n&&null!=t&&!this.isCellCollapsed(n)&&(null!=(e=this.model.getGeometry(e))&&(t.width<e.x+e.width||t.height<e.y+e.height))&&((t=t.clone()).width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height),this.cellsResized([n],[t]))}},mxGraph.prototype.importCells=function(e,n,t,a,i){return this.moveCells(e,n,t,!0,a,i)},mxGraph.prototype.moveCells=function(e,n,t,a,i,s){if(n=null!=n?n:0,t=null!=t?t:0,a=null!=a&&a,null!=e&&(0!=n||0!=t||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var o=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,n,t,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(o),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",n,"dy",t,"clone",a,"target",i,"event",s))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,n,t,a,i){if(null!=e&&(0!=n||0!=t)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var s=0;s<e.length;s++)this.translateCell(e[s],n,t),i&&this.constrainChild(e[s]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",t,"dy",t,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,n,t){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(n,t),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(n,t):(a.offset.x+=n,a.offset.y+=t)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var n=this.model.getParent(e);if(n==this.getDefaultParent()||n==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=n&&n!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(n))){var t=e=0,a=i.width,i=i.height;return this.isSwimlane(n)&&(e=(n=this.getStartSize(n)).width,a-=n.width,t=n.height,i-=n.height),new mxRectangle(e,t,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var n=this.model.getGeometry(e),t=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=n&&null!=t&&!n.relative&&(n.x<t.x||n.y<t.y||t.width<n.x+n.width||t.height<n.y+n.height)&&(e=this.getOverlap(e),0<t.width&&(n.x=Math.min(n.x,t.x+t.width-(1-e)*n.width)),0<t.height&&(n.y=Math.min(n.y,t.y+t.height-(1-e)*n.height)),n.x=Math.max(n.x,t.x-n.width*e),n.y=Math.max(n.y,t.y-n.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var n={},t=0;t<e.length;t++){var a=mxCellPath.create(e[t]);n[a]=e[t]}this.model.beginUpdate();try{for(t=0;t<e.length;t++){var i=this.model.getEdges(e[t]);if(null!=i)for(a=0;a<i.length;a++){var s=this.view.getState(i[a]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(o),d=mxCellPath.create(r);(null==n[l]||null==n[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[t]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var n=this.model.getGeometry(e);return null!=n&&null!=n.points&&0<n.points.length&&((n=n.clone()).points=[],this.model.setGeometry(e,n)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,n){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,n,t){n=null;var a=e.style[t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(n=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=n&&(a=mxUtils.getValue(e.style,t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(n,a)},mxGraph.prototype.setConnectionConstraint=function(e,n,t,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(t?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(t?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(t?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,n){var t=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),s=e.style[mxConstants.STYLE_DIRECTION],o=0;if(null!=s&&("north"==s?o+=270:"west"==s?o+=180:"south"==s&&(o+=90),"north"==s||"south"==s)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=n.point){var l=t=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=s&&"south"!=s||(r=m,m=u,u=r),m&&(t=-1,d=-a.width),u&&(l=-1,c=-a.height)}t=new mxPoint(a.x+n.point.x*a.width*t-d,a.y+n.point.y*a.height*l-c)}s=e.style[mxConstants.STYLE_ROTATION]||0,n.perimeter?(0!=o&&null!=t&&(r=a=0,90==o?r=1:180==o?a=-1:270==s&&(r=-1),t=mxUtils.getRotatedPoint(t,a,r,i)),null!=t&&n.perimeter&&(t=this.view.getPerimeterPoint(e,t,!1))):s+=o,0!=s&&null!=t&&(o=mxUtils.toRadians(s),a=Math.cos(o),r=Math.sin(o),t=mxUtils.getRotatedPoint(t,a,r,i))}return t},mxGraph.prototype.connectCell=function(e,n,t,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.cellConnected(e,n,t,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,n,t,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,t);this.setConnectionConstraint(e,n,t,a),this.isPortsEnabled()&&(a=null,this.isPort(n)&&(a=n.getId(),n=this.getTerminalForPort(n,t)),this.setCellStyles(t?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,n,t),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",n,"source",t,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var n=this.view.scale,t=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var s=this.view.getState(e[i]),o=this.view.getState(this.model.getParent(e[i]));if(null!=s&&null!=o){var r=r.clone(),l=-o.origin.x,d=-o.origin.y,c=s.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/n-t.x+l,c[0].y/n-t.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/n-t.x+l,c[v].y/n-t.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,n){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),n=this.getCurrentRoot();if(null!=n){for(var t=this.model.getParent(n);t!=e&&!this.isValidRoot(t)&&this.model.getParent(t)!=e;)t=this.model.getParent(t);t==e||this.model.getParent(t)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(t),null!=this.view.getState(n)&&this.setSelectionCell(n)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,n,t){var a=[e];if(n&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),t){t=this.model.getChildCount(e);for(var i=0;i<t;i++){var s=this.getCellBounds(this.model.getChildAt(e,i),n,!0);null!=a?a.add(s):a=s}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,n){n=null!=n&&n;var t=null;if(null!=e)for(var a=0;a<e.length;a++)if(n||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var s=i.points;if(null!=s&&0<s.length){for(var o=new mxRectangle(s[0].x,s[0].y,0,0),r=function(e){null!=e&&o.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<s.length;l++)r(s[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i)}}return t},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,n){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-n;else{var t=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==n){if(mxClient.IS_IE?t.setAttribute("transform","translate("+e+","+n+")"):t.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(t.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(t.setAttribute("transform","translate("+e+","+n+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=t.parentNode?s.appendChild(a):s=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,t.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=n+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=n+"px"}else t.style.left=e+"px",t.style.top=n+"px";this.panDx=e,this.panDy=n,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,n){this.zoom(e/this.view.scale,n)},mxGraph.prototype.zoom=function(e,n){n=null!=n?n:this.centerZoom;var t=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=t,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(t));else if(n&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var s=(e-1)/(2*t);a=a*-s,i=i*-s}else a*=s=(1/e-1)/(2*this.view.scale),i*=s;this.view.scaleAndTranslate(t,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(t),mxUtils.hasScrollbars(this.container)&&(i=a=0,n&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var n=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var t=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=t-e.x,e.height=a-e.y,n<1?(t=((n=e.height/n)-e.height)/2,e.height=n,n=Math.min(e.y,t),e.y-=n,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(t=((n*=e.width)-e.width)/2,e.width=n,n=Math.min(e.x,t),e.x-=n,t=Math.min(this.container.scrollWidth,e.x+e.width),e.width=t-e.x),n=this.container.clientWidth/e.width,t=this.view.scale*n,mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),this.container.scrollLeft=Math.round(e.x*n),this.container.scrollTop=Math.round(e.y*n)):this.view.scaleAndTranslate(t,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,n){if(null!=this.container){e=null!=e?e:0,n=null!=n&&n;var t=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();n&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var s=this.view.scale,o=i.width/s,r=i.height/s;null!=this.backgroundImage&&(o=Math.max(o,this.backgroundImage.width-i.x/s),r=Math.max(r,this.backgroundImage.height-i.y/s));var l=n?e:2*e;t=Math.floor(100*Math.min(t/(o+l),a/(r+l)))/100;null!=this.minFitScale&&(t=Math.max(t,this.minFitScale)),null!=this.maxFitScale&&(t=Math.min(t,this.maxFitScale)),n?this.view.scale!=t&&this.view.setScale(t):mxUtils.hasScrollbars(this.container)?(this.view.setScale(t),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/s)*t-e-Math.max(0,(this.container.clientWidth-o*t)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/s)*t-e-Math.max(0,(this.container.clientHeight-r*t)/2))):this.view.scaleAndTranslate(t,null!=i.x?Math.floor(this.view.translate.x-i.x/s+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/s+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,n){var t=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(t=new mxRectangle(t+i.x,a+i.y,i.width,i.height),n&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,t.x=t.getCenterX()-a/2,t.width=a,t.y=t.getCenterY()-i/2,t.height=i),this.scrollRectToVisible(t)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var n=!1;if(null!=e){var t=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(t,e.width),s=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){t=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var o=t.scrollLeft-e.x;a=Math.max(o-t.scrollLeft,0);0<o?t.scrollLeft-=o+2:0<(o=e.x+i-t.scrollLeft-t.clientWidth)&&(t.scrollLeft+=o+2),i=t.scrollTop-e.y,o=Math.max(0,i-t.scrollTop),0<i?t.scrollTop-=i+2:0<(i=e.y+s-t.scrollTop-t.clientHeight)&&(t.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=o)&&this.view.setTranslate(a,o)}else{o=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>o+t&&(this.view.translate.x-=(e.x+i-t-o)/l,n=!0),e.y+s>r+a&&(this.view.translate.y-=(e.y+s-a-r)/l,n=!0),e.x<o&&(this.view.translate.x+=(o-e.x)/l,n=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,n=!0),n&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return n},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var n=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=n?n:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var n=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=n&&n==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,n,t){return null==this.getEdgeValidationError(e,n,t)},mxGraph.prototype.getEdgeValidationError=function(e,n,t){if(null!=e&&!this.isAllowDanglingEdges()&&(null==n||null==t))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&n==t&&null!=n||!this.isValidConnection(n,t))return"";if(null==n||null==t)return this.allowDanglingEdges?null:"";var a="";this.multigraph||(1<(i=this.model.getEdgesBetween(n,t,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(n,!0,e),s=this.model.getDirectedEdgeCount(t,!1,e);if(null!=this.multiplicities)for(var o=0;o<this.multiplicities.length;o++){var r=this.multiplicities[o].check(this,e,n,t,i,s);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,n,t))&&(a+=r),0<a.length?a:null},mxGraph.prototype.validateEdge=function(e,n,t){return null},mxGraph.prototype.validateGraph=function(e,n){e=null!=e?e:this.model.getRoot(),n=null!=n?n:{};for(var t=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var s=this.model.getChildAt(e,i),o=n;this.isValidRoot(s)&&(o={}),null!=(o=this.validateGraph(s,o))?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),t=t&&null==o}return a="",this.isCellCollapsed(e)&&!t&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,n))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!t?a:null},mxGraph.prototype.getCellValidationError=function(e){var n=this.model.getDirectedEdgeCount(e,!0),t=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var s=this.multiplicities[i];s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<n||1==s.min&&0==n||1==s.max&&1<n)?a+=s.countError+"\n":!s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<t||1==s.min&&0==t||1==s.max&&1<t)&&(a+=s.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,n){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var n=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!n))return n?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var n="";if(this.labelsVisible&&null!=e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);mxUtils.getValue(t,mxConstants.STYLE_NOLABEL,!1)||(n=this.convertValueToString(e))}return n},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,t,n,a){var i=null;return null!=e&&(null==e.control||t!=e.control.node&&t.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,n){null!=i||t!=n.node&&t.parentNode!=n.node||(i=n.overlay.toString())}),null==i&&(null!=(n=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof n.getTooltipForNode&&(i=n.getTooltipForNode(t))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var n=new mxRectangle,t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&(t=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?n.height=t:n.width=t),n},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var n;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return n[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var n=this.model.getGeometry(e);return this.isCellsLocked()||null!=n&&this.model.isVertex(e)&&n.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,n){return!0},mxGraph.prototype.isCellBendable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=n[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,n,t){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,n){return this.isValidSource(e)&&this.isValidTarget(n)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null==this.cellEditor)return!1;var n=this.cellEditor.getEditingCell();return null==e?null!=n:e==n},mxGraph.prototype.isAutoSizeCell=function(e){var n=this.view.getState(e);return e=null!=n?n.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,n){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,n)}))},mxGraph.prototype.isCellFoldable=function(e,n){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=t[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,n,t){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,n,t)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,n,t){return!(!this.model.isEdge(e)||null==n||1!=n.length||!this.isCellConnectable(n[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),n[0]))&&(t=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(n[0],t)&&!this.model.isAncestor(n[0],e))},mxGraph.prototype.getDropTarget=function(e,n,t){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(n),mxEvent.getClientY(n))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==t)t=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=t;)i=this.model.getParent(i);i==t&&(t=a)}for(;null!=t&&!this.isValidDropTarget(t,e,n)&&!this.model.isLayer(t);)t=this.model.getParent(t);return!this.model.isLayer(t)&&mxUtils.indexOf(e,t)<0?t:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,n,t){if(null!=(t=t||this.getDefaultParent()))for(var a=this.model.getChildCount(t),i=0;i<a;i++){var s=this.model.getChildAt(t,i),o=this.getSwimlaneAt(e,n,s);if(null!=o)return o;if(this.isSwimlane(s)&&(o=this.view.getState(s),this.intersects(o,e,n)))return s}return null},mxGraph.prototype.getCellAt=function(e,n,t,a,i){if(a=null==a||a,i=null==i||i,null!=(t=null!=t?t:this.getDefaultParent()))for(var s=this.model.getChildCount(t)-1;0<=s;s--){var o=this.model.getChildAt(t,s),r=this.getCellAt(e,n,o,a,i);if(null!=r)return r;if(this.isCellVisible(o)&&(i&&this.model.isEdge(o)||a&&this.model.isVertex(o))&&(r=this.view.getState(o),this.intersects(r,e,n)))return o}return null},mxGraph.prototype.intersects=function(e,n,t){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],s=1;s<a.length;s++){var o=a[s];if(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,n,t)<=e)return!0;i=o}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),s=new mxPoint(e.getCenterX(),e.getCenterY()),n=(i=mxUtils.getRotatedPoint(new mxPoint(n,t),a,i,s)).x,t=i.y),mxUtils.contains(e,n,t))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,n,t){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(n-=a.x,t-=a.y,0<e.width&&0<n&&n>e.width*i||0<e.height&&0<t&&t>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,n,t){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=n&&n,null!=t&&t),n=[],t=0;t<e.length;t++)this.isCellVisible(e[t])&&n.push(e[t]);return n},mxGraph.prototype.getConnections=function(e,n){return this.getEdges(e,n,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,n){return this.getEdges(e,n,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,n){return this.getEdges(e,n,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,n,t,a,i,s){t=null==t||t,a=null==a||a,i=null==i||i,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(o=o.concat(this.model.getEdges(c,t,a)))}for(o=o.concat(this.model.getEdges(e,t,a)),r=[],d=0;d<o.length;d++)l=null!=(c=this.view.getState(o[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[d],!1),(i&&l==c||l!=c&&(t&&c==e&&(null==n||this.isValidAncestor(l,n,s))||a&&l==e&&(null==n||this.isValidAncestor(c,n,s))))&&r.push(o[d]);return r},mxGraph.prototype.isValidAncestor=function(e,n,t){return t?this.model.isAncestor(n,e):this.model.getParent(e)==n},mxGraph.prototype.getOpposites=function(e,n,t,a){t=null==t||t,a=null==a||a;var i=[],s={};if(null!=e)for(var o=0;o<e.length;o++){var r=null!=(l=this.view.getState(e[o]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[o],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[o],!1);if(r==n&&null!=l&&l!=n&&a){var d=mxCellPath.create(l);null==s[d]&&(s[d]=l,i.push(l))}else l==n&&null!=r&&r!=n&&t&&(null==s[d=mxCellPath.create(r)]&&(s[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,n,t){t=null!=t&&t;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=null!=(r=this.view.getState(a[s]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[s],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[s],!1);(o==e&&r==n||!t&&o==n&&r==e)&&i.push(a[s])}return i},mxGraph.prototype.getPointForEvent=function(e,n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,s=0!=n?this.gridSize/2:0;return t.x=this.snap(t.x/a-i.x-s),t.y=this.snap(t.y/a-i.y-s),t},mxGraph.prototype.getCells=function(e,n,t,a,i,s){if(s=null!=s?s:[],0<t||0<a){var o=e+t,r=n+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=n&&u.x+u.width<=o?s.push(c):this.getCells(e,n,t,a,c,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(e,n,t,a,i){var s=[];if((a||i)&&(null==t&&(t=this.getDefaultParent()),null!=t))for(var o=this.model.getChildCount(t),r=0;r<o;r++){var l=this.model.getChildAt(t,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=n)&&s.push(l)}return s},mxGraph.prototype.findTreeRoots=function(e,n,t){n=null!=n&&n,t=null!=t&&t;var a=[];if(null!=e){for(var i=this.getModel(),s=i.getChildCount(e),o=null,r=0,l=0;l<s;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,n?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(t&&0==m&&0<u||!t&&0==u&&0<m)&&a.push(d),r<(c=t?u-m:m-u)&&(r=c,o=d)}}0==a.length&&null!=o&&a.push(o)}return a},mxGraph.prototype.traverse=function(e,n,t,a,i){if(null!=t&&null!=e){n=null==n||n,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=t(i[s]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.model.getEdgeAt(e,s),r=this.model.getTerminal(o,!0)==e;n&&!r||(r=this.model.getTerminal(o,!r),this.traverse(r,n,t,o,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,n){var t=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(t,n),t},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,n,t){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),s=this.model.getChildCount(i);null==a&&0<s?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!n||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&t?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<s&&(n=i.getIndex(a),e=e?(n++,this.model.getChildAt(i,n%s)):(n--,this.model.getChildAt(i,n<0?s-1:n)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(n,t,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&n||this.model.isEdge(e)&&t)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,n){var t=this.isCellSelected(e);this.isToggleEvent(n)?t?this.removeSelectionCell(e):this.addSelectionCell(e):(!t||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,n){this.isToggleEvent(n)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var n=null;return null!=e&&(n=this.model.isEdge(e.cell)?(n=this.view.getEdgeStyle(e),this.isLoop(e)||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):new mxVertexHandler(e)),n},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var n=0;n<this.mouseListeners.length;n++)if(this.mouseListeners[n]==e){this.mouseListeners.splice(n,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var n=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=n.x-this.panDx,e.graphY=n.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,n,t){if(null==t&&(t=this),this.updateMouseEvent(n),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-n.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-n.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(n.getEvent(),n.getCell()),n.getEvent().cancelBubble=!0):(this.lastTouchX=n.getX(),this.lastTouchY=n.getY(),this.lastTouchTime=a)}if(a=2!=n.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-n.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-n.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=n.getX(),this.lastMouseY=n.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||n.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(n.getGraphX(),n.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(t=[t,n],n.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,t):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,t):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,t)}e==mxEvent.MOUSE_UP&&this.click(n)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var n=e.view.graph.getModel().isEdge(e.cell),t=e.view.scale,a=null,i=this.image.width,s=this.image.height;return n?a=1==(n=e.absolutePoints).length%2?n[Math.floor(n.length/2)]:(e=n[(a=n.length/2)-1],n=n[a],new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*t),Math.round(a.y-(s*this.defaultOverlap-this.offset.y)*t),i*t,s*t)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var n=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&n.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,n){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var n=this.source.view.scale,t=new mxRectangle((t=this.source.getGraphBounds()).x/n+this.source.panDx,t.y/n+this.source.panDy,t.width/n,t.height/n),a=new mxRectangle(0,0,this.source.container.clientWidth/n,this.source.container.clientHeight/n);(s=t.clone()).add(a);var i=this.getSourceContainerSize(),s=(a=Math.max(i.width/n,s.width),n=Math.max(i.height/n,s.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(s=Math.min(s/a,i/n))){this.outline.getView().scale!=s&&(this.outline.getView().scale=s,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(n=this.source.view.translate).x+this.source.panDx;var o=n.y+this.source.panDy;null!=(s=this.getOutlineOffset(s))&&(i+=s.x,o+=s.y),t.x<0&&(i-=t.x),t.y<0&&(o-=t.y),a.translate.x==i&&a.translate.y==o||(a.translate.x=i,a.translate.y=o,e=!0);t=a.translate,i=(s=this.source.getView().scale)/a.scale,o=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((t.x-n.x-this.source.panDx)/o,(t.y-n.y-this.source.panDy)/o,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/s,this.bounds.y+=this.source.container.scrollTop*a.scale/s,(t=this.selectionBorder.bounds).x==this.bounds.x&&t.y==this.bounds.y&&t.width==this.bounds.width&&t.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),t=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-t.width/2,this.bounds.y+this.bounds.height-t.height/2,t.width,t.height),t.x==a.x&&t.y==a.y&&t.width==a.width&&t.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,n){this.enabled&&this.showViewport&&(this.zoom=n.isSource(this.sizer),this.startX=n.getX(),this.startY=n.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),n.consume()},mxOutline.prototype.mouseMove=function(e,n){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var t=n.getX()-this.startX,a=n.getY()-this.startY,i=null;if(this.zoom)a=t/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+t),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var s=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+t,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),t=t/s*this.source.getView().scale,a=a/s*this.source.getView().scale,this.source.panGraph(-t-this.dx0,-a-this.dy0)}t=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-t.width/2,i.y+i.height-t.height/2,t.width,t.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),n.consume()}},mxOutline.prototype.mouseUp=function(e,n){if(this.active){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(0<Math.abs(t)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-t*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),t/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-t,i.y-a));this.update(),n.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,n,t,a,i,s){var o="";return(this.source&&this.checkTerminal(e,t,n)||!this.source&&this.checkTerminal(e,a,n))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,n,t,a)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(e,n,t,a){n=e.model.getValue(t),a=e.model.getValue(a),t=!this.validNeighborsAllowed;for(var i=this.validNeighbors,s=0;s<i.length;s++){if(this.source&&this.checkType(e,a,i[s])){t=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,n,i[s])){t=this.validNeighborsAllowed;break}}return t},mxMultiplicity.prototype.checkTerminal=function(e,n,t){return n=e.model.getValue(n),this.checkType(e,n,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,n,t,a,i){return null!=n&&(isNaN(n.nodeType)?n==t:mxUtils.isNode(n,t,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var n=this.graph.getModel();n.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((n=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var n=this.getGraph().getModel();if(this.isBubbling())for(var t=n.getParents(e);0<t.length;)e=e.concat(t),t=n.getParents(t);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,n){if(null!=e&&null!=n)for(var t=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var s=this.getLayout(a.getParent(e[i]));null!=s&&s.moveCell(e[i],t.x,t.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var n=[],t={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),s=0;s<i.length;s++)if(null!=i[s]){var o=mxCellPath.create(i[s]);null==t[o]&&(t[o]=i[s],n.push(i[s]))}}return n},mxLayoutManager.prototype.getCellsForChange=function(e){var n=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,n.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,n.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=null,a=0;a<e.length;a++)e[a]!=n.getRoot()&&e[a]!=t&&(t=e[a],this.executeLayout(this.getLayout(t),t));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{n.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,n){null!=e&&null!=n&&e.execute(n)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var n=this.graph.getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isCellIgnored(e[t])){this.cellResized(e[t]);break}}finally{n.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var n=this.getGraph(),t=n.getView(),a=n.getModel(),i=t.getState(e),s=t.getState(a.getParent(e));if(null!=i&&null!=s){var o=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=o&&null!=r){var l=t.translate,d=t.scale,c=(t=i.x-s.origin.x-l.x*d,s=i.y-s.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+t-r.x*d,u=i.height-r.height*d+s-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<o.length;r++)o[r]!=e&&this.isCellShiftable(o[r])&&this.shiftCell(o[r],m,u,t,s,l,c,p,i,this.isExtendParents()&&n.isExtendParent(o[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,n,t,a,i,s,o,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=s)(p=p.clone()).translate(-n,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=o)(p=p.clone()).translate(0,-t);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var n=this.getGraph(),t=n.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return n.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),t,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var n=this.graph.view.getState(e);return e=null!=n?n.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)this.isSwimlaneIgnored(e[t])||this.swimlaneAdded(e[t])}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var n=this.getGraph().getModel(),t=n.getParent(e),a=n.getChildCount(t),i=null,s=0;s<a;s++){var o=n.getChildAt(t,s);if(o!=e&&!this.isSwimlaneIgnored(o)&&null!=(i=n.getGeometry(o)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var n=this.getGraph().getModel();n.beginUpdate();try{for(var t=0;t<e.length;t++)if(!this.isSwimlaneIgnored(e[t])){var a=n.getGeometry(e[t]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),s=o=e[t];null!=s;){var o=s,r=(s=n.getParent(s),this.graph.isSwimlane(s)?this.graph.getStartSize(s):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(o,i.width,i.height)}}}finally{n.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,n,t){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=t||!i&&r.width!=n)&&(r=r.clone(),i?r.height=t:r.width=n,a.setGeometry(e,r))}var s=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;n-=s.width,t-=s.height;for(var o=a.getChildCount(e),r=0;r<o;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,n,t)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,n,t,a,i){a=null==a||a,i=null==i||i;var s=mxCellPath.create(e.cell),o=this.deltas[s];return null==o?(o=new mxPoint(n,t),this.deltas[s]=o,this.count++):a?(o.X+=n,o.Y+=t):(o.X=n,o.Y=t),i&&this.addEdges(e),o},mxCellStatePreview.prototype.show=function(e){var n,t=this.graph.getModel(),a=t.getRoot();for(n in this.deltas){var i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n];i=this.graph.view.getState(t.getParent(i));this.translateState(i,s,o.x,o.y)}for(n in this.deltas)i=mxCellPath.resolve(a,n),s=this.graph.view.getState(i),o=this.deltas[n],i=this.graph.view.getState(t.getParent(i)),this.revalidateState(i,s,o.x,o.y,e)},mxCellStatePreview.prototype.translateState=function(e,n,t,a){if(null!=n){var i=this.graph.getModel();if(i.isVertex(n.cell)){n.invalid=!0,this.graph.view.validateBounds(e,n.cell),e=i.getGeometry(n.cell);var s=mxCellPath.create(n.cell);0==t&&0==a||null==e||e.relative&&null==this.deltas[s]||(n.x+=t,n.y+=a)}for(e=i.getChildCount(n.cell),s=0;s<e;s++)this.translateState(n,this.graph.view.getState(i.getChildAt(n.cell,s)),t,a)}},mxCellStatePreview.prototype.revalidateState=function(e,n,t,a,i){if(null!=n){n.invalid=!0,this.graph.view.validatePoints(e,n.cell);var s=mxCellPath.create(n.cell),o=this.graph.getModel(),r=this.graph.getCellGeometry(n.cell);for(0==t&&0==a||null==r||!r.relative||!o.isVertex(n.cell)||null!=e&&!o.isVertex(e.cell)&&null==this.deltas[s]||(n.x+=t,n.y+=a,this.graph.cellRenderer.redraw(n)),null!=i&&i(n),e=o.getChildCount(n.cell),s=0;s<e;s++)this.revalidateState(n,this.graph.view.getState(o.getChildAt(n.cell,s)),t,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var n=this.graph.getModel(),t=n.getEdgeCount(e.cell),a=0;a<t;a++){var i=this.graph.view.getState(n.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&null!=n.getState()){var t=this.getInitialCellForEvent(n);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(t),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(t,n.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(t);this.graph.isCellMovable(t)&&(!a.isEdge(t)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(t,!0)||null==a.getTerminal(t,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(n.getEvent())&&this.graph.isCellsCloneable())&&this.start(t,n.getX(),n.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=n.getSource().nodeName?n.consume():mxClient.IS_SF&&"SELECT"==n.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),n=this.graph.getModel(),t=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&n.isVertex(e)&&null!=n.getGeometry(e)&&!n.getGeometry(e).relative});return this.graph.view.getCellStates(n.filterDescendants(t,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var n=null;if(null!=e&&0<e.length)for(var t=this.graph.getModel(),a=0;a<e.length;a++)if(t.isVertex(e[a])||t.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var s=i;t.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(s=i.shape.boundingBox),null==n?n=new mxRectangle(s.x,s.y,s.width,s.height):n.add(s)}}return n},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,n,t){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,n,t),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var n=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/n)*n,e.y=this.graph.snap(e.y/n)*n,e},mxGraphHandler.prototype.mouseMove=function(e,n){var t=this.graph;if(!n.isConsumed()&&t.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(s=mxUtils.convertPoint(t.container,n.getX(),n.getY())).x-this.first.x,i=s.y-this.first.y,s=t.tolerance;if(null!=this.shape||Math.abs(a)>s||Math.abs(i)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var o=t.isGridEnabledEvent(n.getEvent());s=!0;if(null!=this.guide&&this.useGuidesForEvent(n))s=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),o)).x,i=i.y;else if(o){var r=t.getView().translate,l=t.getView().scale;o=this.bounds.x-(t.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(t.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-o,i=i.y-r}for(null!=this.guide&&s&&this.guide.hide(),t.isConstrainedEvent(n.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),s=null,i=n.getCell(),t.isDropEnabled()&&this.highlightEnabled&&(s=t.getDropTarget(this.cells,n.getEvent(),i)),o=s,r=t.getModel();null!=o&&o!=this.cells[0];)o=r.getParent(o);l=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=t.getView().getState(s))||null!=o||r.getParent(this.cell)==s&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&t.getModel().isVertex(i)&&t.isCellConnectable(i)&&(null!=(a=t.getView().getState(i))&&(t=null==t.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(t),d=!0))):(this.target!=s&&(this.target=s,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}n.consume(),mxEvent.consume(n.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||n.isConsumed()||null==n.getState()||t.isMouseDown||(null==(a=t.getCursorForCell(n.getCell()))&&t.isEnabled()&&t.isCellMovable(n.getCell())&&(a=t.getModel().isEdge(n.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),n.getState().setCursor(a),n.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()){var t=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=t.getView().scale,i=t.isCloneEvent(n.getEvent())&&t.isCellsCloneable()&&this.isCloneEnabled(),s=this.currentDx/a,o=(a=this.currentDy/a,n.getCell());this.connectOnDrop&&null==this.target&&null!=o&&t.getModel().isVertex(o)&&t.isCellConnectable(o)&&t.isEdgeValid(null,this.cell,o)?t.connectionHandler.connect(this.cell,o,n.getEvent()):(o=this.target,t.isSplitEnabled()&&t.isSplitTarget(o,this.cells,n.getEvent())?t.splitEdge(o,this.cells,null,s,a):this.moveCells(this.cells,s,a,i,this.target,n.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(n)}this.cellWasClicked&&n.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());t=mxUtils.getRotatedPoint(t,n,a,i)}return null!=e&&!mxUtils.contains(e,t.x,t.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,n,t,a,i,s){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,s)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,n-this.graph.panDx/this.graph.view.scale,t-this.graph.panDy/this.graph.view.scale,a,i,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(n)||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)},mxPanningHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var t=mxUtils.convertPoint(this.graph.container,n.getX(),n.getY());this.triggerX=t.x,this.triggerY=t.y,this.popupTrigger=this.isPopupTrigger(n),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(n),this.startX=n.getX(),this.startY=n.getY(),this.panningTrigger&&this.consumePanningTrigger(n)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,n){var t=n.getX()-this.startX,a=n.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a)),this.graph.panGraph(t+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",n)),n.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(t)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",n))}},mxPanningHandler.prototype.mouseUp=function(e,n){var t=Math.abs(n.getX()-this.startX),a=Math.abs(n.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){t=n.getX()-this.startX,a=n.getY()-this.startY,this.useGrid&&(t=this.graph.snap(t),a=this.graph.snap(a));var i=this.graph.getView().scale,s=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(s.x+t/i,s.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",n)),n.consume()}else this.popupTrigger&&t<this.graph.tolerance&&a<this.graph.tolerance&&(t=this.getCellForPopupEvent(n),this.graph.isEnabled()&&this.selectOnPopup&&null!=t&&!this.graph.isCellSelected(t)?this.graph.setSelectionCell(t):this.clearSelectionOnBackground&&null==t&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(n.getX()+a.x,n.getY()+a.y),this.popup(a.x+1,a.y+1,t,n.getEvent()),n.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,n){this.graph.getView().setTranslate(e,n)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var n=null;if(this.isEnabled()){var t=null!=(n=this.getState(e))&&this.isValidState(n);e=this.getMarkerColor(e.getEvent(),n,t),this.validState=t?n:null,n==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=n&&null!=this.currentColor?(this.markedState=n,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return n},mxCellMarker.prototype.markCell=function(e,n){var t=this.graph.getView().getState(e);null!=t&&(this.currentColor=null!=n?n:this.validColor,this.markedState=t,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,n,t){return t?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var n=this.graph.getView();return cell=this.getCell(e),null!=(n=this.getStateToMark(n.getState(cell)))&&this.intersects(n,e)?n:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,n){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,n.getGraphX(),n.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,n){n.reset.apply(n)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var n=this.graph.getSelectionCells(),t=0;t<n.length;t++){var a=this.graph.view.getState(n[t]);if(null!=a){var i=e.remove(n[t]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(n[t],i)}}e.visit(mxUtils.bind(this,function(e,n){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",n.state)),n.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseDown.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseMove.apply(n,t)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,n){if(this.graph.isEnabled()&&this.isEnabled()){var t=[e,n];this.handlers.visit(function(e,n){n.mouseUp.apply(n,t)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var n=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,n)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,n){return n=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(n)?(null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(n)||(n=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),n):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,n,t){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,n){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,n,t,a){this.previous=e,this.first=new mxPoint(n,t),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,n){return this.isValidTarget(n)?this.graph.getEdgeValidationError(null,e,n):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null==(i=this.getConnectImage(e))||null==e)return null;this.iconState=e;var n=[],t=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);t.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=t.node.previousSibling&&t.node.parentNode.insertBefore(t.node,t.node.parentNode.firstChild)),t.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=t,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(t.node,this.graph,a,i),n.push(t),this.redrawIcons(n,this.iconState),n},mxConnectionHandler.prototype.redrawIcons=function(e,n){if(null!=e&&null!=e[0]&&null!=n){var t=this.getIconPosition(e[0],n);e[0].bounds.x=t.x,e[0].bounds.y=t.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,n){var t=this.graph.getView().scale,a=n.getCenterX(),i=n.getCenterY();if(this.graph.isSwimlane(n.cell)){a=0!=(s=this.graph.getStartSize(n.cell)).width?n.x+s.width*t/2:a,i=0!=s.height?n.y+s.height*t/2:i;if(0!=(s=mxUtils.toRadians(mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(s);var s=Math.sin(s),o=new mxPoint(n.getCenterX(),n.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),t,s,o)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var n=0;n<e.length;n++)e[n].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,n){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!n.isConsumed()&&!this.isConnecting()&&this.isStartEvent(n)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(n.getGraphX(),n.getGraphY()),this.edgeState=this.createEdgeState(n),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var t=this.graph.getPointForEvent(n.getEvent());this.edgeState.cell.geometry.setTerminalPoint(t,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),n.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=n.getX(),this.initialTouchY=n.getY();var a=this.graph.view.getState(this.marker.getCell(n));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(n,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,n){null!=n&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=n,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=n,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var n=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=n},mxConnectionHandler.prototype.convertWaypoint=function(e){var n=this.graph.getView().getScale(),t=this.graph.getView().getTranslate();e.x=e.x/n-t.x,e.y=e.y/n-t.y},mxConnectionHandler.prototype.mouseMove=function(e,n){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-n.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-n.getY())<this.tapAndHoldTolerance),n.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(n),null!=this.first){var t=this.graph.getView().scale,a=null,i=t=new mxPoint(this.graph.snap(n.getGraphX()/t)*t,this.graph.snap(n.getGraphY()/t)*t);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var s=this.first;if(null!=this.selectedIcon){var o=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(o=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=o.x,this.selectedIcon.bounds.y=o.y):(o=new mxRectangle(n.getGraphX()+this.connectIconOffset.x,n.getGraphY()+this.connectIconOffset.y,o,r),this.selectedIcon.bounds=o),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(s=null)!=this.waypoints)for(s=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),s[i]=a;this.graph.view.updatePoints(this.edgeState,s,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],s=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(o=this.getTargetPerimeterPoint(this.currentState,n))&&(i=o)),null==this.sourceConstraint&&null!=this.previous&&(null!=(o=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,n))&&(s=o));if(null==this.currentState&&this.movePreviewAway){if(o=s,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(o=a)),a=i.x-o.x,o=i.y-o.y,0==(r=Math.sqrt(a*a+o*o)))return;i.x-=4*a/r,i.y-=4*o/r}null==this.shape&&(a=Math.abs(t.x-this.first.x),o=Math.abs(t.y-this.first.y),a>this.graph.tolerance||o>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(n)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(t=[s],null!=this.waypoints&&(t=t.concat(this.waypoints)),t.push(i),this.shape.points=t),this.drawPreview()),mxEvent.consume(n.getEvent()),n.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),n.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&n.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(t=!1,s=n.getSource(),i=0;i<this.icons.length&&!t;i++)t=s==this.icons[i].node||s.parentNode==this.icons[i].node;t||this.updateIcons(this.currentState,this.icons,n)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,n){var t=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,s,!1))&&(t=i)}else t=new mxPoint(e.getCenterX(),e.getCenterY());return t},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,n,t){t=null;var a=e.view,i=a.getPerimeterFunction(e),s=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-o*(Math.PI/180);0!=o&&(n=mxUtils.getRotatedPoint(new mxPoint(n.x,n.y),Math.cos(r),Math.sin(r),s)),null!=(e=i(a.getPerimeterBounds(e),e,n,!1))&&(0!=o&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),s)),t=e)}else t=s;return t},mxConnectionHandler.prototype.updateIcons=function(e,n,t){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var n=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),t=Math.abs(n.x-this.first.x);n=Math.abs(n.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(t>this.graph.tolerance||n>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),t=this.graph.view.scale,n=new mxPoint(this.graph.snap(e.getGraphX()/t)*t,this.graph.snap(e.getGraphY()/t)*t),this.waypoints.push(n))},mxConnectionHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(n))return this.addWaypointForEvent(n),void n.consume();if(null==this.error){var t=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(t,a,n.getEvent(),n.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),n.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,n,t,a){if(null!=n||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),s=null;i.beginUpdate();try{if(null!=e&&null==n&&this.isCreateTarget()&&null!=(n=this.createTargetVertex(t,e))){if(null!=(a=this.graph.getDropTarget([n],t,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var o=this.graph.getView().getState(a);if(null!=o){var r=i.getGeometry(n);r.x-=o.origin.x,r.y-=o.origin.y}}this.graph.addCell(n,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=n&&i.getParent(e)==i.getParent(n)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=n.geometry&&n.geometry.relative&&(l=i.getParent(l))),r=o=null,null!=this.edgeState&&(o=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(s=this.insertEdge(l,null,o,e,n,r))){this.graph.setConnectionConstraint(s,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(s,n,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(s,this.edgeState.cell.geometry);var d=i.getGeometry(s);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(s,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==n&&((u=this.graph.getPointForEvent(t,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",s,"event",t,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(s,n)}},mxConnectionHandler.prototype.selectCells=function(e,n){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,n,t,a,i,s){return null==this.factoryMethod?this.graph.insertEdge(e,n,t,a,i,s):(n=this.createEdge(t,a,i,s),this.graph.addEdge(n,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,n){for(var t=this.graph.getCellGeometry(n);null!=t&&t.relative;)n=this.graph.getModel().getParent(n),t=this.graph.getCellGeometry(n);var a=this.graph.cloneCells([n])[0];if(null!=(t=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(t.x=this.graph.snap(i.x-t.width/2)-this.graph.panDx/this.graph.view.scale,t.y=this.graph.snap(i.y-t.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var s=this.graph.view.getState(n);if(null!=s){var o=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=o?t.x=s.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=o&&(t.y=s.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,n,t,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(n,t,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,n,t){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,n){return!1},mxConstraintHandler.prototype.update=function(e,n){if(this.isEnabled()&&!this.isEventIgnored(e)){var t=this.getTolerance(),a=new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),n):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var s,o=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(s=this.getImageForConstraint(e.getState(),this.constraints[i],o)).src;(s=new mxImageShape(s=new mxRectangle(o.x-s.width/2,o.y-s.height/2,s.width,s.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getOverlayPane()),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,r),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(o)}this.currentFocusArea.grow(t)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(t=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(t.width-=1,t.height-=1),null==this.focusHighlight?((t=new mxRectangleShape(t,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,t.init(this.graph.getView().getOverlayPane()),this.focusHighlight=t,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(t.node,this.graph,r)):(this.focusHighlight.bounds=t,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(n.getEvent())||null==n.getState())){var t=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=t.x,a.y-=t.y,this.start(n.getX()+a.x,n.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,s=function(e){e=new mxMouseEvent(e);var n=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=n.x,e.graphY=n.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,s(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,s(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}n.consume(!1)}},mxRubberband.prototype.start=function(e,n){this.first=new mxPoint(e,n)},mxRubberband.prototype.mouseMove=function(e,n){if(!n.isConsumed()&&null!=this.first){var t=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);t.x-=a.x,t.y-=a.y;a=n.getX()+t.x,t=n.getY()+t.y;var i=this.first.x-a,s=this.first.y-t,o=this.graph.tolerance;(null!=this.div||Math.abs(i)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,t),n.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,n){var t=null!=this.div;this.reset(),t&&(t=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(t,n.getEvent()),n.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,n){this.currentX=e,this.currentY=n,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,n=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,n),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,n)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var n=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",n++)),this.sizers.push(this.createSizer("n-resize",n++)),this.sizers.push(this.createSizer("ne-resize",n++)),this.sizers.push(this.createSizer("w-resize",n++)),this.sizers.push(this.createSizer("e-resize",n++)),this.sizers.push(this.createSizer("sw-resize",n++)),this.sizers.push(this.createSizer("s-resize",n++))),this.sizers.push(this.createSizer("se-resize",n++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,n,t,a){return t=new mxRectangle(0,0,t=t||mxConstants.HANDLE_SIZE,t),(a=this.createSizerShape(t,n,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(n)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,n,t){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):n==mxEvent.ROTATION_HANDLE?new mxEllipse(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,t||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,n,t){null!=e&&(e.bounds.x=Math.round(n-e.bounds.width/2),e.bounds.y=Math.round(t-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.sizers.length;t++)if(e.isSource(this.sizers[t])||null!=n&&mxUtils.intersects(this.sizers[t].bounds,n))return t;return null},mxVertexHandler.prototype.mouseDown=function(e,n){if(!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(0<this.tolerance||n.getState()==this.state)){var t=this.getHandleForEvent(n);null!=t&&(this.start(n.getX(),n.getY(),t),n.consume())}},mxVertexHandler.prototype.start=function(e,n,t){e=mxUtils.convertPoint(this.graph.container,e,n),this.startX=e.x,this.startY=e.y,this.index=t,this.selectionBorder.node.style.display=t==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,n){if(n.isConsumed()||null==this.index)null!=this.getHandleForEvent(n)&&n.consume(!1);else{var t=new mxPoint(n.getGraphX(),n.getGraphY()),a=this.graph.isGridEnabledEvent(n.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(t.x=this.graph.snap(t.x/i)*i,t.y=this.graph.snap(t.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],t.x,t.y);else if(this.index==mxEvent.ROTATION_HANDLE){var s=this.state.x+this.state.width/2-t.x,o=this.state.y+this.state.height/2-t.y;this.currentAlpha=0!=s?180*Math.atan(o/s)/Math.PI+90:o<0?180:0,0<s&&(this.currentAlpha-=180),this.rotationRaster&&(s=t.x-this.state.getCenterX(),o=t.y-this.state.getCenterY(),s=Math.abs(Math.sqrt(s*s+o*o)-this.state.height/2-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(s))))),this.currentAlpha=Math.round(this.currentAlpha/s)*s),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(s=t.x-this.startX,o=t.y-this.startY,t=this.graph.view.translate,d*s+l*o);s=l*s-d*o;this.bounds=this.union(this.selectionBounds,s,m,this.index,a,i,t),l=Math.cos(r),c=(d=Math.sin(r))*(s=(o=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(o=o.y-c.y)-o,this.bounds.x+=l*s-d*o-s,this.bounds.y+=c,this.drawPreview()}n.consume()}},mxVertexHandler.prototype.mouseUp=function(e,n){if(!n.isConsumed()&&null!=this.index&&null!=this.state){var t=new mxPoint(n.getGraphX(),n.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(n.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(-i),o=Math.sin(-i),r=(t=o*(r=t.x-this.startX)+s*(l=t.y-this.startY),s*r-o*l),l=t,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),n.consume()}},mxVertexHandler.prototype.rotateCell=function(e,n){var t=this.graph.getModel();if(t.isVertex(e)){if(null!=(s=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(s.style[mxConstants.STYLE_ROTATION]||0)+n,[e]),this.state.cell!=e&&(null!=(s=this.graph.getCellGeometry(e))&&!s.relative))if(0!=n){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!s.relative&&null!=i){var s,o=mxUtils.toRadians(n),r=(a=Math.cos(o),o=Math.sin(o),new mxPoint(s.getCenterX(),s.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,o,i);(s=s.clone()).x=a.x-s.width/2,s.y=a.y-s.height/2,t.setGeometry(e,s)}}else(s=s.clone()).x+=dx,s.y+=dy,t.setGeometry(e,s);for(s=t.getChildCount(e),a=0;a<s;a++)this.rotateCell(t.getChildAt(e,a),n)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,n,t,a,i){var s=this.graph.model.getGeometry(e);if(null!=s)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,n=(this.labelShape.bounds.getCenterX()-this.startX)/a,t=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(s=s.clone()).offset?s.offset=new mxPoint(n,t):(s.offset.x+=n,s.offset.y+=t),this.graph.model.setGeometry(e,s);else{if(a=this.union(s,n,t,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){n=a.getCenterX()-s.getCenterX(),t=a.getCenterY()-s.getCenterY(),i=Math.cos(r);var o=Math.sin(r),r=i*n-o*t-n;n=o*n+i*t-t,t=a.x-s.x;var l=a.y-s.y,d=i*t-o*l;i=o*t+i*l,a.x+=r,a.y+=n,this.graph.isCellCollapsed(e)||0==r&&0==n||(t=s.x-a.x+d,l=s.y-a.y+i,this.moveChildren(e,t,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,n,t){for(var a=this.graph.getModel(),i=a.getChildCount(e),s=0;s<i;s++){var o=a.getChildAt(e,s);if(a.isVertex(o)){var r=this.graph.getCellGeometry(o);null!=r&&!r.relative&&((r=r.clone()).x+=n,r.y+=t,a.setGeometry(o,r))}}},mxVertexHandler.prototype.union=function(e,n,t,a,i,s,o){if(this.singleSizer){o=e.x+e.width+n;var r=e.y+e.height+t;return i&&(o=this.graph.snap(o/s)*s,r=this.graph.snap(r/s)*s),(s=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(o,r,0,0)),s}var l=(r=e.x-o.x*s)+e.width,d=e.y-o.y*s;return e=d+e.height,4<a?(e+=t,i&&(e=this.graph.snap(e/s)*s)):a<3&&(d+=t,i&&(d=this.graph.snap(d/s)*s)),0==a||3==a||5==a?(r+=n,i&&(r=this.graph.snap(r/s)*s)):2!=a&&4!=a&&7!=a||(l+=n,i&&(l=this.graph.snap(l/s)*s)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+o.x*s,d+o.y*s,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var n=e.x+e.width,t=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],n,t);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var s=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=(s=Math.sin(s),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),o,s,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=n,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=n,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=n,l.y=t,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),s=Math.sin(s),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),o,s,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var n=this.state.cell;if(null!=this.index){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.graph.getCellAt(t.x,t.y);this.graph.isSwimlane(n)&&this.graph.hitsSwimlaneContent(n,t.x,t.y)&&(n=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(n)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var n=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(n))return null;var t=a.graph.getModel();return(n==a.state.cell||null!=n&&!a.graph.connectableEdges&&t.isEdge(n))&&(n=null),n},e.isValidState=function(e){var n=a.graph.getModel();n=null!=(n=a.graph.view.getTerminalPort(e,a.graph.view.getState(n.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?n.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:n,a.isSource?n:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,n){return this.graph.getEdgeValidationError(this.state.cell,e,n)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,n=[],t=0;t<this.abspoints.length;t++)if(this.isHandleVisible(t)){var a=t==this.abspoints.length-1;if((a=0==t||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(t);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(t))if(mxClient.IS_TOUCH){var s=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,s)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);n.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return n},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var n=this.tolerance,t=(n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,0);t<this.bends.length;t++)if((e.isSource(this.bends[t])||null!=n&&mxUtils.intersects(this.bends[t].bounds,n))&&"hidden"!=this.bends[t].node.style.visibility)return t;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,n){var t=null;null!=(t=this.getHandleForEvent(n))&&!n.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(n.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(n.getEvent())?this.removePoint(this.state,t):(t!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(n.getCell()))&&this.start(n.getX(),n.getY(),t),n.consume())},mxEdgeHandler.prototype.start=function(e,n,t){this.startX=e,this.startY=n,this.isSource=null!=this.bends&&0==t,this.isTarget=null!=this.bends&&t==this.bends.length-1,this.isLabel=t==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(n=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=n&&this.graph.isCellDisconnectable(e,n,this.isSource))&&(this.index=t)):this.index=t},mxEdgeHandler.prototype.clonePreviewState=function(e,n){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var t=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),n=this.graph.getView(),i=!1,s=!1;if(this.snapToTerminals&&0<a){var o=function(e){if(null!=e){var n=e.x;Math.abs(t.x-n)<a&&(t.x=n,i=!0),e=e.y,Math.abs(t.y-e)<a&&(t.y=e,s=!0)}},r=function(e){null!=e&&o.call(this,new mxPoint(n.getRoutingCenterX(e),n.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&o.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=n.scale,r=n.translate,i||(t.x=(this.graph.snap(t.x/e-r.x)+r.x)*e),s||(t.y=(this.graph.snap(t.y/e-r.y)+r.y)*e)),t},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var n=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?n=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(n=this.constraintHandler.currentFocus),n},mxEdgeHandler.prototype.getPreviewPoints=function(e){var n=null!=(n=this.graph.getCellGeometry(this.state.cell)).points?n.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(n=null):(this.convertPoint(e,!1),null==n?n=[e]:n[this.index-1]=e),n},mxEdgeHandler.prototype.updatePreviewState=function(e,n,t){var a=this.isSource?t:this.state.getVisibleTerminalState(!0),i=this.isTarget?t:this.state.getVisibleTerminalState(!1),s=this.graph.getConnectionConstraint(e,a,!0),o=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?s=r:this.isTarget&&(o=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,s),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,o),(this.isSource||this.isTarget)&&null==t&&(e.setAbsoluteTerminalPoint(n,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.getPointForEvent(n);if(this.isLabel)this.label.x=t.x,this.label.y=t.y;else{this.points=this.getPreviewPoints(t);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(n):null,i=this.clonePreviewState(t,null!=a?a.cell:null);this.updatePreviewState(i,t,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(n.getEvent()),n.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(n)&&n.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,n){if(null!=this.index&&null!=this.marker){var t=this.state.cell;if(n.getX()!=this.startX||n.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)t=this.connect(t,a,this.isSource,this.graph.isCloneEvent(n.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),n);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(t));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(t,a,this.isSource)}}else this.active?this.changePoints(t,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),t!=this.state.cell&&this.graph.setSelectionCell(t)),n.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x),e.y=Math.round(e.y/t-a.y),null!=(t=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=t.origin.x,e.y-=t.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,n,t){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),s=this.graph.getView().getRelativePoint(e,n,t);i.x=s.x,i.y=s.y;var o=this.graph.getView().scale;i.offset=new mxPoint(0,0),s=this.graph.view.getPoint(e,i),i.offset=new mxPoint((n-s.x)/o,(t-s.y)/o),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,n,t,a,i){var s=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var o=e.clone();i.add(s,o,i.getChildCount(s));var r=i.getTerminal(e,!t);this.graph.connectCell(o,r,!t),e=o}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,n,t,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,n,t){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(n,t),a.setGeometry(e,i),this.graph.connectCell(e,null,t,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,n){var t=this.graph.getModel(),a=t.getGeometry(e);null!=a&&((a=a.clone()).points=n,t.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,n){var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),a=this.graph.isGridEnabledEvent(n);this.convertPoint(t,a),this.addPointAt(e,t.x,t.y),mxEvent.consume(n)},mxEdgeHandler.prototype.addPointAt=function(e,n,t){var a=this.graph.getCellGeometry(e.cell);if(n=new mxPoint(n,t),null!=a){a=a.clone(),t=this.graph.view.translate;var i=this.graph.view.scale;t=mxUtils.findNearestSegment(e,(n.x+t.x)*i,(n.y+t.y)*i),null==a.points?a.points=[n]:a.points.splice(t,0,n),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,n){if(0<n&&n<this.abspoints.length-1){var t=this.graph.getCellGeometry(this.state.cell);null!=t&&null!=t.points&&((t=t.clone()).points.splice(n-1,1),this.graph.getModel().setGeometry(e.cell,t),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var n=this.state.cell,t=this.graph.getModel().getTerminal(n,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=t&&!this.graph.isCellDisconnectable(n,t,e)||null==t&&!this.graph.isTerminalPointMovable(n,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=t&&this.graph.isCellDisconnectable(n,t,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,n=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-n/2),Math.round(this.label.y-n/2),n,n),this.labelShape.redraw(),null!=(n=this.graph.getLabel(e))&&0<n.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var t=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);n=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-n.width/2),Math.round(a-n.height/2),n.width,n.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[t];var i=this.abspoints[t].x,s=(t=this.abspoints[t].y,this.bends.length-1);n=this.bends[s].bounds;this.bends[s].bounds=new mxRectangle(Math.round(i-n.width/2),Math.round(t-n.height/2),n.width,n.height),this.bends[s].fill=this.getHandleFillColor(s),this.bends[s].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=t){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,s=this.abspoints[a].y,o=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-o.width/2),Math.round(s-o.height/2),o.width,o.height),this.bends[a].redraw(),this.points[a-1]=t[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);return this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),n=this.createHandleShape(2),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var n=this.getCursorForBend();return e.node.style.cursor=n,n=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,n),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var n=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(n=this.doubleClickOrientationResource,n=mxResources.get(n)||n),n},mxElbowEdgeHandler.prototype.convertPoint=function(e,n){var t=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;n&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/t-a.x-i.x),e.y=Math.round(e.y/t-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,n){var t=null==(t=null!=(t=this.graph.getModel().getGeometry(this.state.cell).points)?t[0]:null)?new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2):new mxPoint(this.graph.getView().scale*(t.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(t.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(s,this.labelShape.bounds)&&(a+=3,i+=3,s=new mxRectangle(Math.round(t.x-a/2),Math.round(t.y-i/2),a,i)),this.bends[1].bounds=s,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var n=this.state.absolutePoints,t=n[0].clone();this.convertPoint(t,!1);for(var a=[],i=1;i<n.length;i++){var s=n[i].clone();this.convertPoint(s,!1),i==this.index&&(t.x==s.x?(t.x=e.x,s.x=e.x):(t.y=e.y,s.y=e.y)),i<n.length-1&&a.push(s),t=s}if(1==a.length){if(t=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(s=this.state.getVisibleTerminalState(!1))&null!=i){var o=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(s,a[0].x+o,a[0].y+r)?n[1].y==n[2].y?a[0].y=t.getRoutingCenterY(i)-r:a[0].x=t.getRoutingCenterX(i)-o:mxUtils.contains(i,a[0].x+o,a[0].y+r)&&(n[1].y==n[0].y?a[0].y=t.getRoutingCenterY(s)-r:a[0].x=t.getRoutingCenterX(s)-o)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],n=this.createHandleShape(0);this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none");var t=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<t.length-1;a++)n=this.createVirtualBend(),e.push(n),n.node.style.cursor=0==t[a].x-t[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none")}return n=this.createHandleShape(t.length),this.initBend(n),n.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(n.node,this.graph,this.state),e.push(n),mxClient.IS_TOUCH&&n.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,n){if(this.graph.isCellBendable(this.state.cell)){var t=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],n=a[i+1];var s=new mxPoint(e.x+(n.x-e.x)/2,e.y+(n.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(s.x-t/2),Math.round(s.y-t/2),t,t),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,n){n=[];var t=this.abspoints;if(1<t.length)for(var a=t[0],i=t[1],s=2;s<t.length;s++){var o=t[s];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(o.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(o.y)||(i=(a=i).clone(),this.convertPoint(i,!1),n.push(i)),i=o}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,n){this.normalKeys[e]=n},mxKeyHandler.prototype.bindShiftKey=function(e,n){this.shiftKeys[e]=n},mxKeyHandler.prototype.bindControlKey=function(e,n){this.controlKeys[e]=n},mxKeyHandler.prototype.bindControlShiftKey=function(e,n){this.controlShiftKeys[e]=n},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var n=this.getFunction(e);null!=n&&(n(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,n){this.reset(n,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,n){n.getX()==this.lastX&&n.getY()==this.lastY||(this.reset(n,!0),(this.isHideOnHover()||n.getState()!=this.state||n.getSource()!=this.node&&(!this.stateSource||null!=n.getState()&&this.stateSource==(n.isSource(n.getState().shape)||!n.isSource(n.getState().text))))&&this.hideTooltip()),this.lastX=n.getX(),this.lastY=n.getY()},mxTooltipHandler.prototype.mouseUp=function(e,n){this.reset(n,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,n){if(this.resetTimer(),n&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var t=e.getState(),a=e.getSource(),i=e.getX(),s=e.getY(),o=e.isSource(t.shape)||e.isSource(t.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(t,a,i,s);this.show(e,i,s),this.state=t,this.node=a,this.stateSource=o}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,n,t){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=n+a.x+"px",this.div.style.top=t+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,n){},mxCellTracker.prototype.mouseMove=function(e,n){this.isEnabled()&&this.process(n)},mxCellTracker.prototype.mouseUp=function(e,n){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(n)});t?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,n,t,a){if(null!=this.config){var i=this.createConditions(e,t,a);this.addItems(e,n,t,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,n,t,a,i,s,o){for(var r=!1;null!=s;){if("add"==s.nodeName){if(null==(l=s.getAttribute("if"))||i[l]){var l=s.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(s))),c=s.getAttribute("action"),m=s.getAttribute("icon"),u=s.getAttribute("iconCls");r&&(n.addSeparator(o),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(n,e,l,m,d,c,t,o,u),this.addItems(e,n,t,a,i,s.firstChild,l)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,n,t,a,i,s,o,r,l){return e.addItem(t,a,function(e){"function"==typeof i&&i.call(n,n,o,e),null!=s&&n.execute(s,o,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,n,t){var a=e.graph.getModel(),i=a.getChildCount(n),s=[];for(s.nocell=null==n,s.ncells=1<e.graph.getSelectionCount(),s.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),s.cell=null!=n,a=null!=n&&1==e.graph.getSelectionCount(),s.nonEmpty=a&&0<i,s.expandable=a&&e.graph.isCellFoldable(n,!1),s.collapsable=a&&e.graph.isCellFoldable(n,!0),s.validRoot=a&&e.graph.isValidRoot(n),s.emptyValidRoot=s.validRoot&&0==i,s.swimlane=a&&e.graph.isSwimlane(n),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var o=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof o&&(s[r]=o(e,n,t))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,n){var t=n.getProperty("function");this.editor.insertFunction=null!=t?mxUtils.bind(this,function(){t.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,n,t,a){var i=mxUtils.bind(this,function(){null!=t&&0<t.length&&this.editor.execute(t)});return this.toolbar.addItem(e,n,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,n,t){var a=mxUtils.bind(this,function(){this.editor.execute(t)});this.addOption(e,n,a)},mxDefaultToolbar.prototype.addOption=function(e,n,t){return this.toolbar.addOption(e,n,t)},mxDefaultToolbar.prototype.addMode=function(e,n,t,a,i){var s=mxUtils.bind(this,function(){this.editor.setMode(t),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,n,s,a)},mxDefaultToolbar.prototype.addPrototype=function(e,n,t,a,i,s){var o=function(){return"function"==typeof t?t():null!=t?t.clone():null},r=mxUtils.bind(this,function(e,n){"function"==typeof i?i(this.editor,o(),e,n):this.drop(o(),e,n),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,n,r,a,null,s),this.installDropHandler(e,function(e,n,t){r(n,t)}),e},mxDefaultToolbar.prototype.drop=function(e,n,t){var a=this.editor.graph,i=a.getModel();if(null!=t&&!i.isEdge(t)&&this.connectOnDrop&&a.isCellConnectable(t))this.connect(e,n,t);else{for(;null!=t&&!a.isValidDropTarget(t,[e],n);)t=i.getParent(t);this.insert(e,n,t)}},mxDefaultToolbar.prototype.insert=function(e,n,t){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(n),s=mxEvent.getClientY(n);i=mxUtils.convertPoint(a.container,i,s);return a.isSplitEnabled()&&a.isSplitTarget(t,[e],n)?a.splitEdge(t,[e],null,i.x,i.y):this.editor.addVertex(t,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,n,t){var a=(n=this.editor.graph).getModel();if(null!=t&&n.isCellConnectable(e)&&n.isEdgeValid(null,t,e)){var i=null;a.beginUpdate();try{var s=a.getGeometry(t),o=a.getGeometry(e).clone();o.x=s.x+(s.width-o.width)/2,o.y=s.y+(s.height-o.height)/2;var r=this.spacing*n.gridSize,l=20*a.getDirectedEdgeCount(t,!0);this.editor.horizontalFlow?o.x+=(o.width+s.width)/2+r+l:o.y+=(o.height+s.height)/2+r+l,e.setGeometry(o);var d=a.getParent(t);if(n.addCell(e,d),n.constrainChild(e),i=this.editor.createEdge(t,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}n.addEdge(i,d,t,e)}finally{a.endUpdate()}n.setSelectionCells([e,i]),n.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(n,t){var a=document.createElement("img");a.setAttribute("src",n.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*n.offsetWidth+"px",a.style.height=2*n.offsetHeight+"px",mxUtils.makeDraggable(n,this.editor.graph,t,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var n=e.getUrlImage();if(null==n||mxClient.IS_LOCAL)e.execute("show");else{var t=mxUtils.getViewXml(e.graph,1);t=mxUtils.getXml(t,"\n");mxUtils.submit(n,e.postParameterName+"="+encodeURIComponent(t),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,n){e.showProperties(n)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,n){e.graph.isEnabled()&&e.graph.isCellEditable(n)&&e.graph.startEditingAtCell(n)}),this.addAction("toBack",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,n){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,n){e.graph.enterGroup(n)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!0,!1,n)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var n=e.graph.getChildVertices();e.graph.foldCells(!1,!1,n)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var n=100*e.graph.getView().scale;n=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,n))/100;isNaN(n)||e.graph.getView().setScale(n)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,n){this.actions[e]=n},mxEditor.prototype.execute=function(n,e,t){var a=this.actions[n];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+n+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+n,280,!0)},mxEditor.prototype.addTemplate=function(e,n){this.templates[e]=n},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){return this.createPopupMenu(e,n,t)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,n){return this.createEdge(e,n)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var n=null,t=i.graph.getModel();return null!=t.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),n=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==t.getParent(t.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),n=i.diagramLayout)),n},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,n){var t=n.getProperty("cell");null!=t&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,t),n.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,n){var t=n.getProperty("edit");this.undoManager.undoableEditHappened(t)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,n){var t=n.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(t))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var n=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,n),e.getView().addListener(mxEvent.UP,n)},mxEditor.prototype.installChangeHandler=function(s){var e=mxUtils.bind(this,function(e,n){this.setModified(!0),1==this.validating&&s.validateGraph();for(var t=n.getProperty("edit").changes,a=0;a<t.length;a++){var i=t[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var t=this;e.addMouseListener({mouseDown:function(e,n){null==t.insertFunction||n.isPopupTrigger()||!t.forcedInserting&&null!=n.getState()||(t.graph.clearSelection(),t.insertFunction(n.getEvent(),n.getCell()),this.isActive=!0,n.consume())},mouseMove:function(e,n){this.isActive&&n.consume()},mouseUp:function(e,n){this.isActive&&(this.isActive=!1,n.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,n=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return n.isVertexIgnored=function(e){return!n.graph.isSwimlane(e)},n},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(n){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){n.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(n)},mxEditor.prototype.treeLayout=function(e,n){null!=e&&new mxCompactTreeLayout(this.graph,n).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",n=this.graph,t=n.getCurrentRoot();null!=t&&null!=n.getModel().getParent(n.getModel().getParent(t));)n.isValidRoot(t)&&(e=" > "+n.convertValueToString(t)+e),t=n.getModel().getParent(t);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var n=mxUtils.load(e).getXml();this.readGraphModel(n.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,n){if(null!=(e=e||this.getUrlPost())&&0<e.length){var t=this.writeGraphModel(n);this.postDiagram(e,t),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(n,t){this.escapePostData&&(t=encodeURIComponent(t)),mxUtils.post(n,this.postParameterName+"="+t,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",n,"data",t))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var n=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(n,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,n,t,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,n,t)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,n){null!=n.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,n){var t=this.graph.getStylesheet().styles[n];this.graph.getView().getStylesheet().putCellStyle(n,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,t),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var n=(t=mxUtils.getOffset(this.graph.container)).x+10,t=t.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(n+=a.x+Math.min(200,a.width),t+=a.y)}else n=this.properties.getX(),t=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,n,t,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var a=this.graph.getModel(),e=a.getValue(t);if(mxUtils.isNode(e)){var n=new mxForm("properties");n.addText("ID",t.getId()).setAttribute("readonly","true");var i=null,s=null,o=null,r=null,l=null;a.isVertex(t)&&(null!=(i=a.getGeometry(t))&&(s=n.addText("top",i.y),o=n.addText("left",i.x),r=n.addText("width",i.width),l=n.addText("height",i.height)));var d=a.getStyle(t),c=n.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=n.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(o.value),i.y=parseFloat(s.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(t,i)),0<c.value.length?a.setStyle(t,c.value):a.setStyle(t,null);for(var e=0;e<m.length;e++){var n=new mxCellAttributeChange(t,m[e].nodeName,u[e].value);a.execute(n)}this.graph.isAutoSizeCell(t)&&this.graph.updateCellSize(t)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),n.addButtons(e,d),n.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var n=document.createElement("div");n.style.padding="4px",n.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,n,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var t=mxUtils.bind(this,function(e){mxEvent.release(n),n.innerHTML="",this.createTasks(n)});this.graph.getModel().addListener(mxEvent.CHANGE,t),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,t),this.graph.addListener(mxEvent.ROOT,t),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(n)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var n=document.createElement("iframe");n.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),n.setAttribute("height","100%"),n.setAttribute("width","100%"),n.setAttribute("frameBorder","0"),n.style.backgroundColor="white",e=document.body.clientWidth;var t=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,n,(e-this.helpWidth)/2,(t-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){n.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var n=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),t=new mxOutline(this.graph,e);n.setClosable(!0),n.setResizable(!0),n.destroyOnClose=!1,n.addListener(mxEvent.RESIZE_END,function(){t.update()}),this.outline=n,this.outline.outline=t}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,n,t){this.popupHandler.createMenu(this,e,n,t)},mxEditor.prototype.createEdge=function(e,n){var t=null;if(null!=this.defaultEdge)t=this.graph.getModel().cloneCell(this.defaultEdge);else{(t=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,t.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&t.setStyle(a),t},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var n=this.consumeCycleAttribute(e);null!=n&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+n)}},mxEditor.prototype.addVertex=function(e,n,t,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(t,a);var s=this.graph.getView().scale,o=i.getGeometry(n),r=i.getGeometry(e);if(this.graph.isSwimlane(n)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(t-=l.origin.x*s,a-=l.origin.y*s,this.graph.isConstrainedMoving){r=o.width;var d=o.height,c=l.x+l.width;c<t+r&&(t-=t+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(t-=r.x*s,a-=r.y*s)}}(o=o.clone()).x=this.graph.snap(t/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(a/s-this.graph.getView().translate.y-this.graph.gridSize/2),n.setGeometry(o),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(n),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",n,"parent",e)),i.beginUpdate();try{null!=(n=this.graph.addCell(n,e))&&(this.graph.constrainChild(n),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",n)))}finally{i.endUpdate()}return null!=n&&(this.graph.setSelectionCell(n),this.graph.scrollCellToVisible(n),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",n))),n},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var n=e.getName();mxCodecRegistry.codecs[n]=e;var t=mxUtils.getFunctionName(e.template.constructor);t!=n&&mxCodecRegistry.addAlias(t,n)}return e},addAlias:function(e,n){mxCodecRegistry.aliases[e]=n},getCodec:function(e){var n=null;if(null!=e){n=mxUtils.getFunctionName(e);var t=mxCodecRegistry.aliases[n];if(null!=t&&(n=t),null==(n=mxCodecRegistry.codecs[n]))try{n=new mxObjectCodec(new e),mxCodecRegistry.register(n)}catch(e){}}return n}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,n,t,a){for(var i in this.template=e,this.exclude=null!=n?n:[],this.idrefs=null!=t?t:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,n){return this.objects[e]=n},mxCodec.prototype.getObject=function(e){var n=null;return null!=e&&(null==(n=this.objects[e])&&(null==(n=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(n=this.decode(e))))),n},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,n){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=n?n:"id",e)},mxCodec.prototype.getId=function(e){var n=null;return null!=e&&(null==(n=this.reference(e))&&e instanceof mxCell&&(null==(n=e.getId())&&(0==(n=mxCellPath.create(e)).length&&(n="root")))),n},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var n=null;if(null!=e&&null!=e.constructor){var t=mxCodecRegistry.getCodec(e.constructor);null!=t?n=t.encode(this,e):mxUtils.isNode(e)?n=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return n},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,n,t){if(n.appendChild(this.encode(e)),null==t||t){t=e.getChildCount();for(var a=0;a<t;a++)this.encodeCell(e.getChildAt(a),n)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,n){n=null==n||n;var t=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(t=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(t))for(var a=e.firstChild;null!=a&&!this.isCellCodec(t);)t=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(t)||(t=mxCodecRegistry.getCodec(mxCell)),t=t.decode(this,e),n&&this.insertIntoGraph(t)}return t},mxCodec.prototype.insertIntoGraph=function(e){var n=e.parent,t=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=n&&n.insert(e),null!=t&&t.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,n,t){null!=n&&null!=t&&e.setAttribute(n,t)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var n=this.reverse[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var n=this.mapping[e];null!=n&&(e=n)}return e},mxObjectCodec.prototype.isExcluded=function(e,n,t,a){return n==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,n)},mxObjectCodec.prototype.isReference=function(e,n,t,a){return 0<=mxUtils.indexOf(this.idrefs,n)},mxObjectCodec.prototype.encode=function(e,n){var t=e.document.createElement(this.getName());return n=this.beforeEncode(e,n,t),this.encodeObject(e,n,t),this.afterEncode(e,n,t)},mxObjectCodec.prototype.encodeObject=function(e,n,t){for(var a in e.setAttribute(t,"id",e.getId(n)),n){var i=a,s=n[i];null!=s&&!this.isExcluded(n,i,s,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,n,i,s,t))}},mxObjectCodec.prototype.encodeValue=function(e,n,t,a,i){if(null!=a){if(this.isReference(n,t,a,!0)){var s=e.getId(a);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+t+"="+a);a=s}s=this.template[t],(null==t||e.encodeDefaults||s!=a)&&(t=this.getAttributeName(t),this.writeAttribute(e,n,t,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,n,t,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,n,t,a,i):this.writeComplexAttribute(e,n,t,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,n,t,a,i){a=this.convertValueToXml(a),null==t?(n=e.document.createElement("add"),"function"==typeof a?n.appendChild(e.document.createTextNode(a)):e.setAttribute(n,"value",a),i.appendChild(n)):"function"!=typeof a&&e.setAttribute(i,t,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,n,t,a,i){null!=(e=e.encode(a))?(null!=t&&e.setAttribute("as",t),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+t+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,n,t){return n},mxObjectCodec.prototype.afterEncode=function(e,n,t){return t},mxObjectCodec.prototype.decode=function(e,n,t){var a=n.getAttribute("id"),i=e.objects[a];return null==i&&(i=t||this.cloneTemplate(),null!=a&&e.putObject(a,i)),n=this.beforeDecode(e,n,i),this.decodeNode(e,n,i),this.afterDecode(e,n,i)},mxObjectCodec.prototype.decodeNode=function(e,n,t){null!=n&&(this.decodeAttributes(e,n,t),this.decodeChildren(e,n,t))},mxObjectCodec.prototype.decodeAttributes=function(e,n,t){if(null!=(n=n.attributes))for(var a=0;a<n.length;a++)this.decodeAttribute(e,n[a],t)},mxObjectCodec.prototype.decodeAttribute=function(e,n,t){var a=n.nodeName;if("as"!=a&&"id"!=a){n="value"==a?n.nodeValue:this.convertValueFromXml(n.nodeValue);var i=this.getFieldName(a);if(this.isReference(t,i,n,!1)){if(null==(e=e.getObject(n)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+n);n=e}this.isExcluded(t,a,n,!1)||(t[a]=n)}},mxObjectCodec.prototype.decodeChildren=function(e,n,t){for(n=n.firstChild;null!=n;){var a=n.nextSibling;n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t)&&this.decodeChild(e,n,t),n=a}},mxObjectCodec.prototype.decodeChild=function(e,n,t){var a=this.getFieldName(n.getAttribute("as"));if(null==a||!this.isExcluded(t,a,n,!1)){var i=this.getFieldTemplate(t,a,n),s=null;"add"==n.nodeName?null==(s=n.getAttribute("value"))&&(s=mxUtils.eval(mxUtils.getTextContent(n))):s=e.decode(n,i),this.addObjectValue(t,a,s,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,n,t){return(e=e[n])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,n,t,a){null!=t&&t!=a&&(null!=n&&0<n.length?e[n]=t:e.push(t))},mxObjectCodec.prototype.processInclude=function(e,n,t){if("include"!=n.nodeName)return!1;if(null!=(n=n.getAttribute("name")))try{var a=mxUtils.load(n).getDocumentElement();null!=a&&e.decode(a,t)}catch(e){}return!0},mxObjectCodec.prototype.beforeDecode=function(e,n,t){return n},mxObjectCodec.prototype.afterDecode=function(e,n,t){return t},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,n,t,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==n&&t.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,n,t){if(null!=n.value&&n.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=t;(t=mxClient.IS_IE?n.value.cloneNode(!0):e.document.importNode(n.value,!0)).appendChild(a),e=a.getAttribute("id"),t.setAttribute("id",e),a.removeAttribute("id")}return t},e.beforeDecode=function(e,n,t){var a=n,i=this.getName();if(n.nodeName!=i?(null!=(a=n.getElementsByTagName(i)[0])&&a.parentNode==n?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,t.value=n.cloneNode(!0),null!=(n=t.value.getAttribute("id"))&&(t.setId(n),t.value.removeAttribute("id"))):t.setId(n.getAttribute("id")),null!=a)for(n=0;n<this.idrefs.length;n++){i=this.idrefs[n];var s=a.getAttribute(i);if(null!=s){a.removeAttribute(i);var o=e.objects[s]||e.lookup(s);null==o&&(null!=(s=e.getElementById(s))&&(o=(mxCodecRegistry.codecs[s.nodeName]||this).decode(e,s))),t[i]=o}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,n,t){var a=e.document.createElement("root");e.encodeCell(n.getRoot(),a),t.appendChild(a)},e.decodeChild=function(e,n,t){"root"==n.nodeName?this.decodeRoot(e,n,t):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,n,t){var a=null;for(n=n.firstChild;null!=n;){var i=e.decodeCell(n);null!=i&&null==i.getParent()&&(a=i),n=n.nextSibling}null!=a&&t.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,n,t){return e.encodeCell(n.root,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.root=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;)t=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=t}return n},e.afterDecode=function(e,n,t){return t.previous=t.root,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,n,t,a){return!("child"!=n||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,n)},e.afterEncode=function(e,n,t){return this.isReference(n,"child",n.child,!0)?t.setAttribute("child",e.getId(n.child)):e.encodeCell(n.child,t),t},e.beforeDecode=function(e,n,t){if(null!=n.firstChild&&n.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(n=n.cloneNode(!0)).firstChild;for(t.child=e.decodeCell(a,!1),t=a.nextSibling,a.parentNode.removeChild(a),a=t;null!=a;){if(t=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=t}}else a=n.getAttribute("child"),t.child=e.getObject(a);return n},e.afterDecode=function(e,n,t){return t.child.parent=t.previous,t.previous=t.parent,t.previousIndex=t.index,t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,n,t){return t.previous=t.terminal,t},e}());var mxGenericChangeCodec=function(e,a){var n=new mxObjectCodec(e,["model","previous"],["cell"]);return n.afterDecode=function(e,n,t){return mxUtils.isNode(t.cell)&&(t.cell=e.decodeCell(t.cell,!1)),t.previous=t[a],t},n};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,n){return this.encodeCell(e,n,n.graph.getModel().getRoot())},e.encodeCell=function(e,n,t){var a=n.graph.getModel(),i=n.getState(t),s=a.getParent(t);if(null==s||null!=i){var o=a.getChildCount(t),r=n.graph.getCellGeometry(t),l=null;if(s==a.getRoot()?l="layer":null==s?l="graph":a.isEdge(t)?l="edge":0<o&&null!=r?l="group":a.isVertex(t)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=n.graph.getLabel(t)&&(d.setAttribute("label",n.graph.getLabel(t)),n.graph.isHtmlLabel(t)&&d.setAttribute("html",!0)),null==s){var c=n.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",n.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(s=i.style[c])&&"object"==typeof s&&(s=mxStyleRegistry.getName(s)),null!=s&&"function"!=typeof s&&"object"!=typeof s&&d.setAttribute(c,s);if(null!=(s=i.absolutePoints)&&0<s.length){for(r=Math.round(s[0].x)+","+Math.round(s[0].y),c=1;c<s.length;c++)r+=" "+Math.round(s[c].x)+","+Math.round(s[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<o;c++)null!=(i=this.encodeCell(e,n,a.getChildAt(t,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,n){var t,a=e.document.createElement(this.getName());for(t in n.styles){var i=n.styles[t],s=e.document.createElement("add");if(null!=t){for(var o in s.setAttribute("as",t),i){var r=this.getStringValue(o,i[o]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",o),s.appendChild(l)}}0<s.childNodes.length&&a.appendChild(s)}}return a},e.getStringValue=function(e,n){var t=typeof n;return"function"==t?n=mxStyleRegistry.getName(style[j]):"object"==t&&(n=null),n},e.decode=function(e,n,t){t=t||new this.template.constructor;var a=n.getAttribute("id");for(null!=a&&(e.objects[a]=t),n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName&&null!=(a=n.getAttribute("as"))){var i=n.getAttribute("extend"),s=null!=i?mxUtils.clone(t.styles[i]):null;for(null==s&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),s={}),i=n.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var o=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(s[o]=l)}else"remove"==i.nodeName&&delete s[o]}i=i.nextSibling}t.putCellStyle(a,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t)for(n=n.firstChild;null!=n;){if(!this.processInclude(e,n,t)&&"add"==n.nodeName){var a=n.getAttribute("as"),i=n.getAttribute("action"),s=n.getAttribute("control");t.bindAction(a,i,s)}n=n.nextSibling}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,n){return null},e.decode=function(e,n,t){if(null!=t){var a=t.editor;for(n=n.firstChild;null!=n;){if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,n,t))if("separator"==n.nodeName)t.addSeparator();else if("br"==n.nodeName)t.toolbar.addBreak();else if("hr"==n.nodeName)t.toolbar.addLine();else if("add"==n.nodeName){var i=n.getAttribute("as"),s=(i=mxResources.get(i)||i,n.getAttribute("icon")),o=n.getAttribute("pressedIcon"),r=n.getAttribute("action"),l=n.getAttribute("mode"),d=n.getAttribute("template"),c="0"!=n.getAttribute("toggle"),m=mxUtils.getTextContent(n),u=null;if(null!=r)u=t.addItem(i,s,r,o);else if(null!=l){var p=mxUtils.eval(m);u=t.addMode(i,s,l,o,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=n.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=t.addPrototype(i,s,u,o,d,c);else if(0<(o=mxUtils.getChildNodes(n)).length)if(null==s)for(d=t.addActionCombo(i),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(d,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),c=c.getAttribute("action"),t.addActionOption(d,s,c));else{var g=null,v=t.addPrototype(i,s,function(){if(null==(e=a.templates[g.value]))return mxLog.warn("Template "+e+" not found"),null;var e=e.clone(),n=g.options[g.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e},null,null,c);g=t.addCombo();for(mxEvent.addListener(g,"change",function(){t.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),t.toolbar.noReset=!1}),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?t.addOption(g,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),m=c.getAttribute("template"),t.addOption(g,s,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=n.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}n=n.nextSibling}}return t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,n){return null},e.decode=function(e,n,t){var a=n.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,t):null!=t&&(t.config=n),t},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,n,t){return null!=(e=n.getAttribute("defaultEdge"))&&(n.removeAttribute("defaultEdge"),t.defaultEdge=t.templates[e]),null!=(e=n.getAttribute("defaultGroup"))&&(n.removeAttribute("defaultGroup"),t.defaultGroup=t.templates[e]),t},e.decodeChild=function(e,n,t){if("Array"==n.nodeName){if("templates"==n.getAttribute("as"))return void this.decodeTemplates(e,n,t)}else if("ui"==n.nodeName)return void this.decodeUi(e,n,t);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,n,t){for(e=n.firstChild;null!=e;){if("add"==e.nodeName){n=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),s=null;if(null!=a)null!=(s=document.getElementById(a))&&null!=i&&(s.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var o=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(s=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(n)||n,s,a,o,r,l,!1,!0).setVisible(!0)}"graph"==n?t.setGraphContainer(s):"toolbar"==n?t.setToolbarContainer(s):"title"==n?t.setTitleContainer(s):"status"==n?t.setStatusContainer(s):"map"==n&&t.setMapContainer(s)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,n,t){null==t.templates&&(t.templates=[]),n=mxUtils.getChildNodes(n);for(var a=0;a<n.length;a++){for(var i=n[a].getAttribute("as"),s=n[a].firstChild;null!=s&&1!=s.nodeType;)s=s.nextSibling;null!=s&&(t.templates[i]=e.decodeCell(s))}},e}()),EditorUi=function(e,n,t){this.projectDesignController=e,this.editor=n||new Editor,this.container=t||document.body;var a=n.graph,i=this;CRUD_PERMISSIONS=this.projectDesignController.crudPermissions;var s=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isEditingEnabled()&&a.isEditing()});this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi(),this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.footerContainer.onselectstart=s,this.footerContainer.onmousedown=s),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",s),mxEvent.addListener(this.sidebarContainer,"contextmenu",s)):(this.diagramContainer.oncontextmenu=s,this.sidebarContainer.oncontextmenu=s),a.init(this.diagramContainer),a.refresh(),a.setEnabled(this.isEditingEnabled()),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+n.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var o=a.fireMouseEvent;a.fireMouseEvent=function(e,n,t){e==mxEvent.MOUSE_DOWN&&this.container.focus(),o.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","google_cloud_tts","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts","sestektts","mrcpsynth"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr","dialogflow","dialogflowV2","awslex","sesteknda","sestekasr","restapi","mrcprecog"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),mxEvent.isConsumed(e)||n.isConsumed()||(this.getModel().isEdge(t)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(t.source.value.tagName)&&this.startEditingAtCell(t):this.getModel().isVertex(t)&&i.projectDesignController.openDialog(t.getValue(),function(e){for(var n=0;n<e.length;n+=1)t.setAttribute(e[n].name,e[n].value);a.refresh(t)}),n.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,n,t){this.isEditingEnabled()&&this.menus.createPopupMenu(e,n,t)}),n.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.isEditingEnabled()?this.createKeyHandler(n):null;this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),n=function(){e.setEnabled(!mxClipboard.isEmpty())},t=mxClipboard.cut;mxClipboard.cut=function(){t.apply(this,arguments),n()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),n()}},EditorUi.prototype.isEditingEnabled=function(){return!!CRUD_PERMISSIONS.canEdit},EditorUi.prototype.exportXML=function(e){var n=window.document.createElement("a");n.href="data:attachment/text;charset=utf-8,"+encodeURIComponent(e),n.download=this.editor.filename+".xml",n.target="_self",n.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,n){try{var t=mxUtils.parseXml(e);this.editor.setGraphXml(t.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,n,t){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=n&&(this.editor.filename=n),null!=t&&(this.editor.data=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,n){for(var t=this.editor.graph,a=(e=null!=e?e:t.model.getRoot(),n=null!=n?n:{},!0),i=t.model.getChildCount(e),s=0;s<i;s++){var o=t.model.getChildAt(e,s),r=n;t.isValidRoot(o)&&(r={}),null!=(r=this.validate(o,r))?t.setCellWarning(o,r.replace(/\n/g,"<br>")):t.setCellWarning(o,null),a=a&&null==r}if(i="",t.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i=""!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=""!==e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"google_cloud_tts":i=""!==e.value.getAttribute("apiKey")?"":mxResources.get("noApiKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"awslex":i=""!==e.value.getAttribute("aws_bot_name")?"":mxResources.get("noNameSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i+=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":case"sestektts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":case"sestekasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUrlInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n";break;case"sesteknda":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("ndauth_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("ndassistant_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("username")?"":mxResources.get("noUsernameSelected")+"\n",i+=""!==e.value.getAttribute("password")?"":mxResources.get("noPasswordSelected")+"\n";break;case"restapi":i=""!==e.value.getAttribute("url")?"":mxResources.get("noUrlSelected")+"\n",i+=""!==e.value.getAttribute("method")?"":mxResources.get("noMethodSelected")+"\n";case"mrcpsynth":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"mrcprecog":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"dialogflow":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("dialogflow_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n";break;case"dialogflowV2":i=""!==e.value.getAttribute("dialogflowV2_project_id")?"":mxResources.get("noDialogflowProjectSelected")+"\n",i+=""!==e.value.getAttribute("client_email")?"":mxResources.get("noClientEmailSelected")+"\n",i+=""!==e.value.getAttribute("private_key")?"":mxResources.get("noPrivateKeySelected")+"\n",i+=""!==e.value.getAttribute("dialogflowV2_language")?"":mxResources.get("noDialogflowLanguageSelected")+"\n",i+=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n"}if(t.model.isEdge(e))switch(t.model.getCell(e.source.getId()).value.nodeName){case"background":case"menu":if(void 0!==e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(void 0!==e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(void 0!==e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(void 0!==e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return t.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(t.containsValidationErrorsResource)||t.containsValidationErrorsResource)+"\n"),i=t.model.isEdge(e)?i+(t.getEdgeValidationError(e,t.model.getTerminal(e,!0),t.model.getTerminal(e,!1))||""):i+(t.getCellValidationError(e)||""),null!=(s=t.validateCell(e,n))&&(i+=s),null==t.model.getParent(e)&&t.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(n){var t=this.editor.graph,e=t.getDefaultParent(),a=0;return e.children.forEach(function(e){t.model.isVertex(e)&&e.value.nodeName==n&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var n=null!=e?e:window.location.pathname,t=0<n.indexOf("?")?1:0;for(var a in urlParams)n+=0==t?"?":"&",n+=a+"="+urlParams[a],t++;return n},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),n=this.actions.get("redo"),t=this.editor.undoManager,a=function(){e.setEnabled(t.canUndo()),n.setEnabled(t.canRedo())};t.addListener(mxEvent.ADD,a),t.addListener(mxEvent.UNDO,a),t.addListener(mxEvent.REDO,a),t.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,n=!e.isSelectionEmpty(),t=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var s=0;s<i.length;s++){var o=i[s];if(e.getModel().isEdge(o)&&(a=!0),e.getModel().isVertex(o)&&(t=!0),a&&t)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(n);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(t),this.actions.get("wordWrap").setEnabled(t),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=t&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(n);d=["line","lineend","linestart"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(t||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),n=this.container.clientWidth+390,t=this.container.clientHeight+190;this.container==document.body&&(n=document.body.clientWidth||document.documentElement.clientWidth,t=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,n-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,t-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var s=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(s+=1),this.sidebarContainer.style.top=s+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=this.isEditingEnabled()?a+this.splitSize+"px":"0px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=n+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var o=t-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=o+"px",this.diagramContainer.style.width=n-a-this.splitSize+"px";var r=t-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.isEditingEnabled()&&(this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit)),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.footerContainer),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var n=document.createElement("div");return n.className=e,n},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var n=document.createElement("form");return n.className=e,n},EditorUi.prototype.addSplitHandler=function(n,t,a,i){var s=null,o=null;function r(e){if(null!=s){var n=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,o+(t?n.x-s.x:s.y-n.y)-a)),mxEvent.consume(e)}}function e(e){r(e),o=s=null}mxEvent.addGestureListeners(n,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),o=parseInt(t?n.style.left:n.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,n,t){var a=this.editor.graph,i=a.getSelectionCell();n=null!=this.animate?this.animate:n,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(n&&navigator.userAgent.indexOf("Camino")<0){var s=new mxMorphing(a);s.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),s.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,o=new mxKeyHandler(a);function n(e){if(!a.isSelectionEmpty()){var n=0,t=0;37==e?n=-1:38==e?t=-1:39==e?n=1:40==e&&(t=1),a.moveCells(a.getSelectionCells(),n,t),a.scrollCellToVisible(a.getSelectionCell())}}o.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var t=mxUtils.bind(this,function(e,n,t,a){var i=this.actions.get(t);if(null!=i){var s=function(){i.enabled&&i.funct()};n?a?o.bindControlShiftKey(e,s):o.bindControlKey(e,s):a?o.bindShiftKey(e,s):o.bindKey(e,s)}});return o.enter=function(){},o.bindKey(8,function(){a.foldCells(!0)}),o.bindKey(13,function(){a.foldCells(!1)}),o.bindKey(33,function(){a.exitGroup()}),o.bindKey(34,function(){a.enterGroup()}),o.bindKey(36,function(){a.home()}),o.bindKey(35,function(){a.refresh()}),o.bindKey(37,function(){n(37)}),o.bindKey(38,function(){n(38)}),o.bindKey(39,function(){n(39)}),o.bindKey(40,function(){n(40)}),o.bindKey(113,function(){a.startEditingAtCell()}),t(46,!1,"delete"),t(82,!0,"tilt"),t(83,!0,"save"),t(83,!0,"saveAs",!0),t(107,!1,"zoomIn"),t(109,!1,"zoomOut"),t(65,!0,"selectAll"),t(86,!0,"selectVertices",!0),t(69,!0,"selectEdges",!0),t(69,!0,"export"),t(66,!0,"toBack"),t(70,!0,"toFront"),t(68,!0,"duplicate"),t(90,!0,"undo"),t(89,!0,"redo"),t(88,!0,"cut"),t(67,!0,"copy"),t(81,!0,"connect"),t(86,!0,"paste"),t(71,!0,"group"),t(71,!0,"grid",!0),t(85,!0,"ungroup"),t(112,!1,"about"),t(80,!0,"publish",!0),o},EditorUi.prototype.createMultiplicities=function(e,n,t,a){for(var i=0;i<n.length;i++)e.push(new mxMultiplicity(!0,n[i],null,null,t[i][0],t[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+t[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,n[i],null,null,a[i][0],a[i][1],null,mxResources.get(n[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,n){this.editorUi=e,this.container=n,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var n=mxEvent.getSource(e);null!=n;){if(n==this.currentElt)return;n=n.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(n,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,n,t,a,i){mxEventSource.call(this),this.label=e,this.funct=n,this.enabled=null==t||t,this.iconCls=a,this.shortcut=i}function Menubar(e,n){this.editorUi=e,this.container=n,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,n){mxEventSource.call(this),this.funct=e,this.enabled=null==n||n}function Toolbar(e,n){this.editorUi=e,this.container=n,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),e&&n.setAttribute("checked",!0),n}function createDropdownFromApi(e,t,a,i,n,s,o,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+n.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(n){r&&n[a]==r||((m=document.createElement("option")).text=n[a],s&&o?(m.value=o,s.forEach(function(e){m.value=m.value.replace("%"+e+"%",n[e])}),m.selected=m.value==t):(m.value=n[i],m.selected=n[i]==t),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,s);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[t],d.value=e[a],d.selected=e[a]==n,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,n,t,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[t].toUpperCase(),d.value=e[a],d.selected=e[a]==n,l.appendChild(d),e[s].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[t]),d.value=e[a],d.selected=e[a]==n,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,n){var t=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<n||""!=n)&&(i.selected=n===a),t.appendChild(i)}return t.className="form-control select2",t}function createDropdownFromTigerDialList(e){var n=document.createElement("select"),t=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var s=i.response.RMI.rows;for(var o in s)t[s[o].id]=s[o].name}}}catch(e){console.log(e)}for(var r in t){var l=document.createElement("option");l.text=t[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),n.appendChild(l)}return n.className="form-control select2",n}function Dialog(e,n,t,a,i,s,o){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),t+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-t)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(n),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=o,this.container=l}function ImportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("import")+" XML");var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var n=e.target.files[0];if(console.log(n),n)if("text/xml"===n.type){var t=new FileReader;t.onload=function(e){var n=e.target.result;mxUtils.write(d,n)},t.readAsText(n)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var n=mxUtils.parseXml(d.value);t.editor.setGraphXml(n.documentElement),t.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("about")+" Cally Square");var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function SaveDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("saveAs"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function NewDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("new"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function DescriptionDialog(e){console.log(e.editor.data);var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("description"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function VariableDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("variable"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function OpenDialog(e){var n=e.createDiv("modal-content"),t=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("open"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),n.appendChild(t),n.appendChild(a),n.appendChild(i),this.container=n}function RenameDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("rename"));var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-4"),d=t.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=t.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var n=new XMLHttpRequest;n.open("PUT",SAVE_URL+t.editor.data.id,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("Authorization","Bearer "+t.editor.data.token),n.send("name="+u.value),n.onload=function(e){200===n.status?(t.editor.setStatus("Project successfully renamed"),t.editor.filename=u.value):(console.log(n.response),t.editor.setStatus(JSON.parse(n.response).errors[0].message))},n.onerror=function(e){mxUtils.alert(n.statusText)},t.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("edit"));var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(n.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var n=e.dataTransfer.files[0],t=new FileReader;t.onload=function(e){d.value=e.target.result},t.readAsText(n)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);n.editor.setGraphXml(e.documentElement),n.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body form"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("export")+" XML");var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("form-horizontal form-row-seperated"),l=n.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",n.editor.getOrCreateFilename()),c.className="form-control";var m=n.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){n.save(!1);encodeURIComponent(mxUtils.getXml(n.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+n.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),n.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,s){console.log("general");var o=i.editor.graph,e=i.createDiv("md-dialog"),n=i.createDiv("md-toolbar"),t=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(s.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",n.appendChild(l),n.appendChild(r);for(var d=s.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=s.value.attributes[m].name,g="_"+p,v=s.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),f=document.createElement("label");switch(f.className="col-sm-4 control-label",mxUtils.write(f,mxResources.get(p)),h.appendChild(f),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==s.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var b=i.createDiv("col-sm-8");if(b.appendChild(u),mxResources.get("help_"+p)){var A=i.createDiv("p");A.className="help-block",mxUtils.write(A,mxResources.get("help_"+p)),b.appendChild(A)}h.appendChild(b),c.appendChild(h)}t.appendChild(c);var E=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var n=0;n<s.value.attributes.length;n++){var t="_"+s.value.attributes[n].name,a=s.value.attributes[n].name;s.setAttribute(a,document.getElementById(t).value)}o.refresh(s),i.hideDialog()}));E.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(E),a.appendChild(y),e.appendChild(n),e.appendChild(t),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var n=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var t=e.getAttribute("pageScale");this.graph.pageScale=null!=t?t:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var s=e.getAttribute("background");null!=s&&0<s.length&&(this.graph.background=s),n.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,n=this.outline;if(null!=e.container&&null!=n.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",n.outline.container.style.backgroundColor=e.container.style.backgroundColor,n.outline.pageVisible==e.pageVisible&&n.outline.pageScale==e.pageScale||(n.outline.pageScale=e.pageScale,n.outline.pageVisible=e.pageVisible,n.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var t=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":t,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var t=e.apply(this,arguments);return t.intersects=mxUtils.bind(this,function(e,n){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(t,arguments)}),t},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),n=0<e.width?e.x/this.scale-this.translate.x:0,t=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,l=s.height*o,d=Math.floor(Math.min(0,n)/r),c=Math.floor(Math.min(0,t)/l),m=Math.ceil(Math.max(1,n+a)/r)-d,u=Math.ceil(Math.max(1,t+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var t=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,n){t.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=n+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var n=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(n,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){n=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(n),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=n,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,n,t){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale,r=this.view.getBackgroundPageBounds();n=r.width,t=r.height;var l=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(n/l.width)-1:0,c=e?Math.ceil(t/l.height)-1:0,m=r.x+n,u=r.y+t;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,n,t){for(var a=0;a<n.length;a++)if(this.graph.getModel().isVertex(n[a])){var i=this.graph.getCellGeometry(n[a]);if(null!=i&&i.relative)return!1}return s.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,n,t,a,i,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(e){mxEvent.consume(e)}),o};var o=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var n=this.graph.getModel(),t=n.getParent(this.graph.getSelectionCell()),a=o.apply(this,arguments),i=n.getParent(a);if(null==t||t!=a&&t!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&n.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var n=l.apply(this,arguments),t=this.graph.getModel(),a=t.getParent(this.graph.getSelectionCell()),i=t.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!t.isVertex(i)||this.graph.isValidRoot(i)||(n=!0)),n},mxGraphHandler.prototype.selectDelayed=function(e){var n=e.getCell();null==n&&(n=this.cell);for(var t=this.graph.getModel(),a=t.getParent(n);this.graph.isCellSelected(n)&&t.isVertex(a)&&!this.graph.isValidRoot(a);)n=a,a=t.getParent(n);this.graph.selectCellForEvent(n,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var n=e.getCell(),t=this.graph.getModel(),a=t.getParent(n);t.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(n=a),a=t.getParent(a);return n}},Editor.prototype.createUndoManager=function(){var s=this.graph,t=new mxUndoManager,e=function(e,n){t.undoableEditHappened(n.getProperty("edit"))};s.getModel().addListener(mxEvent.UNDO,e),s.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){for(var t=s.getSelectionCellsForChanges(n.getProperty("edit").changes),a=[],i=1;i<t.length;i++)null!=s.view.getState(t[i])&&a.push(t[i]);s.setSelectionCells(a)};return t.addListener(mxEvent.UNDO,n),t.addListener(mxEvent.REDO,n),t},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var n=mxStencilRegistry.stencils[e];if(null==n){var t=mxStencilRegistry.getBasenameForStencil(e);if(null!=t){var a=mxStencilRegistry.libraries[t];if(null!=a){if(null==mxStencilRegistry.packages[t]){mxStencilRegistry.packages[t]=1;for(var i=0;i<a.length;i++){var s=a[i];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length)){var o=mxUtils.load(s);null!=o&&eval.call(window,o.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+t+".xml",null);n=mxStencilRegistry.stencils[e]}}return n},mxStencilRegistry.getBasenameForStencil=function(e){var n=e.split("."),t=null;if(0<n.length&&"mxgraph"==n[0]){t=n[1];for(var a=2;a<n.length-1;a++)t+="/"+n[a]}return t},mxStencilRegistry.loadStencilSet=function(e,n,t){t=null!=t&&t;var a=mxStencilRegistry.packages[e];if(t||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,n,i)}},mxStencilRegistry.parseStencilSet=function(e,n,t){t=null==t||t;var a=e.documentElement,i=a.firstChild,s="",o=a.getAttribute("name");for(null!=o&&(s=o+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(o=i.getAttribute("name"))){s=s.toLowerCase();var r=o.replace(/ /g,"_");if(t&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(i)),null!=n){var l=i.getAttribute("w"),d=i.getAttribute("h");n(s,r,o,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,n){this.data=e,this.filename=n,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["google_cloud_tts","tts","ispeechtts","awspolly","lumenvoxtts","sestektts","mrcpsynth"],["Google Cloud TTS","GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS","SestekTTS","MRCPSynth"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr","sestekasr","mrcprecog"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR","SestekASR","MRCPRecog"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS","dialogflow","dialogflowV2","awslex","sesteknda","restapi"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS"),"Dialogflow","DialogflowV2","AWSLex","SestekNDA","RestAPI"]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),n=e.width+2*this.tooltipBorder+4,t=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(t+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=n+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;t+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(t-=6,this.tooltipTitle.style.top=t-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=t+"px";var i=-Math.round(e.x-this.tooltipBorder),s=-Math.round(e.y-this.tooltipBorder),o=document.body,r=document.documentElement,l=(o.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-t/2+16);mxClient.IS_SVG?0!=i||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+t/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,n){if(null!=this.taglist&&null!=e&&0<e.length)for(var t=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<t.length;a++)if(t[a]=t[a].replace(/\.*\d*$/,""),1<t[a].length){var i=this.taglist[t[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[t[a]]=i),null==i.dict.get(n)&&(i.dict.put(n,n),i.entries.push(n))}return n},Sidebar.prototype.searchEntries=function(e,n,t,a,i){if(null!=this.taglist&&null!=e){for(var s=e.toLowerCase().split(" "),o=new mxDictionary,r=(t+1)*n,l=[],d=0,c=0;c<s.length;c++)if(0<s[c].length){var m=this.taglist[s[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==o.get(m))&&(u.put(m,m),l.push(m),c==s.length-1&&l.length==r))return void a(l.slice(t*n,r),r,!0)}}else l=[];o=u,d++}var v=l.length;a(l.slice(t*n,(t+1)*n),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null==e)return null;for(var n=e.split(" "),t=[],a={},i=0;i<n.length;i++)null==a[n[i]]&&(a[n[i]]="1",t.push(n[i]));return t.join(" ")},Sidebar.prototype.cloneCell=function(e,n){var t=e.clone();return null!=n&&(t.value=n),t},Sidebar.prototype.addSearchPalette=function(e){var n=document.createElement("div");n.style.visibility="hidden",this.container.appendChild(n);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var t=document.createElement("div");t.style.whiteSpace="nowrap",t.style.textOverflow="clip",t.style.paddingBottom="8px",t.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",t.appendChild(a);var i,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",s.style.top="-4px"):s.style.top="2px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",t.appendChild(s),r.appendChild(t);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var n=e.nextSibling;e!=t&&e!=l&&e.parentNode.removeChild(e),e=n}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var o=new Object;this.currentSearch=o,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,n,t){if(this.currentSearch==o){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(t?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.color="gray",s.style.padding="0px",s.style.margin="0px 8px 0px 8px",s.style.paddingTop="6px",s.style.textAlign="center",s.style.cursor="default",mxUtils.write(s,mxResources.get("noResultsFor",[c])),r.appendChild(s)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",s.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",s.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var o=document.createElement("div");o.appendChild(r),this.container.appendChild(o),this.palettes.search=[n,o]},Sidebar.prototype.createTitle=function(e){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.setAttribute("title",mxResources.get("sidebarTooltip")),n.className="geTitle",mxUtils.write(n,e),n},Sidebar.prototype.createThumb=function(e,n,t,a,i,s,o,r,l){this.graph.labelsVisible=null==s||s;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((n-2*this.thumbBorder)/c.width,(t-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((n-c.width*m)/2/m-c.x),Math.floor((t-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=n+"px",u.style.height=t+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=o){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(n,t,a,e,i,s,o){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(n,this.thumbWidth,this.thumbHeight,r,t,a,e,i,s);var d=new mxRectangle(0,0,i,s);if(1<n.length||n[0].vertex){var c=this.createDragSource(r,this.createDropHandler(n,!0,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=n[0]&&n[0].edge){c=this.createDragSource(r,this.createDropHandler(n,!1,o,d),this.createDragPreview(i,s),n,d);this.addClickHandler(r,c,n)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,n,d.width,d.height,t,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,f){return h=null==h||h,mxUtils.bind(this,function(e,n,t,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var s=null!=t&&e.isValidDropTarget(t,g,n),o=null;if(null==t||s||(t=null),!e.isCellLocked(t||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(t,g,n)){var r=e.cloneCells(g);e.splitEdge(t,r,null,a-f.width/2,i-f.height/2),o=r}else 0<g.length&&(o=e.importCells(g,a,i,t));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(t);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<o.length;p++)l.moveCell(o[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",o))}finally{e.model.endUpdate()}null!=o&&0<o.length&&(e.scrollCellToVisible(o[0]),e.setSelectionCells(o))}}mxEvent.consume(n)}})},Sidebar.prototype.createDragPreview=function(e,n){var t=document.createElement("div");return t.style.border="1px dashed black",t.style.width=e+"px",t.style.height=n+"px",t},Sidebar.prototype.createDragSource=function(e,n,t){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,n,t,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,n,t){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,s=null;mxEvent.addGestureListeners(e,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var o=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=s){var n=i.tolerance;if(Math.abs(s.x-mxEvent.getClientX(e))<=n&&Math.abs(s.y-mxEvent.getClientY(e))<=n){var t=i.getGridSize();a.drop(i,e,null,t,t)}}o.apply(this,arguments),s=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,n,t,a,i,s,o,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,n,t,a,i,s,o)}))},Sidebar.prototype.createXmlDocument=function(e,n,t,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",n),t.forEach(function(e,n){i.setAttribute(e,a[n]?a[n]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,n,t,a,i,s,o,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","","60"];break;case"google_cloud_tts":l=["apiKey","google_cloud_tts_text_type","text","languageCode","ssmlGender"],d=["","text","","en-US","FEMALE"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":case"sestektts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"sestekasr":l=["grammar","options"],d=["/usr/local/unimrcp/data/grammar.xml",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text","aws_text_type"],d=["","","eu-west-1","Amy","","text"];break;case"awslex":l=["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],d=["","","eu-west-1","",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","dialTimezone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;case"dialogflow":l=["key","text","dialogflow_language"],d=["","","it"];break;case"sesteknda":l=["ndauth_url","username","password","ndassistant_url","text","project","ndagenerate_audio","custom_action","custom_action_data","ndaactivity_type"],d=["","","","","","",1,"","","message"];break;case"restapi":l=["url","method","timeout","computedVariables","rawHeaders","rawBody","variable_id"],d=["","GET","5","","","",""];break;case"mrcpsynth":l=["text","options"],d=["",""];break;case"mrcprecog":l=["grammar","options"],d=["",""];break;case"dialogflowV2":l=["dialogflowV2_project_id","client_email","private_key","dialogflowV2_language","text"],d=["","","","en",""];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,n,t),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,n,t,i,s,o,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,n,t,a,i,s,o){return this.createItem(e,a,i,s,n,t,o)},Sidebar.prototype.createEdgeTemplate=function(e,n,t,a,i,s,o){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,n,t),e);return r.geometry.setTerminalPoint(new mxPoint(0,t),!0),r.geometry.setTerminalPoint(new mxPoint(n,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],n,t,i,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,n,t,a,i,s){return this.createItem(e,a,i,!0,n,t,s)},Sidebar.prototype.addPaletteFunctions=function(e,n,t,a){this.addPalette(e,n,t,mxUtils.bind(this,function(e){for(var n=0;n<a.length;n++)e.appendChild(a[n](e))}))},Sidebar.prototype.addPalette=function(e,n,t,a){var i=this.createTitle(n);this.container.appendChild(i);var s=document.createElement("div");s.className="geSidebar",mxClient.IS_POINTER&&(s.style.touchAction="none"),mxEvent.addListener(s,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==s?s.setAttribute("title",mxResources.get("sidebarTooltip")):s.removeAttribute("title")})),t?(a(s),a=null):s.style.display="none",this.addFoldingHandler(i,s,a);var o=document.createElement("div");return o.appendChild(s),this.container.appendChild(o),null!=e&&(this.palettes[e]=[i,o]),s},Sidebar.prototype.addFoldingHandler=function(t,a,i){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(t.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="0% 50%",mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(s)a.style.display="block";else if(s=!0,null!=i){t.style.cursor="wait";var n=t.innerHTML;t.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",t.style.cursor="",t.innerHTML=n},0)}else a.style.display="block";t.style.backgroundImage="url('"+this.expandedImage+"')"}else t.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,n,s,o,r,t,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,n,t){if(null==t){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");t=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+s+e+o,this.defaultImageWidth,this.defaultImageHeight,r[d],n,!1,!0,this.filterTags(t)))})(r[d],null!=t?t[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,n,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,n,t,a){mxGraph.call(this,e,n,t,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);return"1"==t.html||"wrap"==t.whiteSpace},this.cellRenderer.getLabelValue=function(e){var n=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(n=mxUtils.htmlEntities(n,!1)),n},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var s=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,n){null==n?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?s.apply(this,arguments):this.graph.isCellSelected(n.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(n.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var n=this.view.getState(e),t=null!=n?n.style:this.getCellStyle(e);if(null!=t){var a=mxUtils.getValue(t,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var n=this.getModel().cloneCells([e])[0];null!=n.geometry&&(n.geometry.points=null);var t=n.getStyle();t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_ENTRY_Y,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_X,null),t=mxUtils.setStyle(t,mxConstants.STYLE_EXIT_Y,null),n.setStyle(t),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(n)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([n])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var n="";return this.getModel().isVertex(e)?n+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(n=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),n},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,n,t){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",n),n=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,n){var t=null;null!=e.value&&"object"==typeof e.value?t=e.value.cloneNode(!0):(t=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=n&&0<n.length?t.setAttribute("link",n):t.removeAttribute("link"),this.model.setValue(e,t)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,n){this.panningHandler.hideMenu()});var s=!1,o=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var n=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(n)&&(e.state=this.view.getState(n),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,n,t){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(s=!1,o=null):(o=n.getCell(),s=null!=o?this.isCellSelected(o):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(s&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(n.getEvent()),i=mxEvent.getClientY(n.getEvent());this.panningHandler.popup(a+16,i,o,n.getEvent())}return s=!1,o=null,void n.consume()}s=!1,o=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&n.isConsumed()&&(s=!1,o=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var n=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(n)&&mxEvent.isShiftDown(n)||this.usePopupTrigger&&mxEvent.isPopupTrigger(n)});var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,n){t.apply(this,arguments),this.graph.isCellSelected(n.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,n){touchStyle&&null!=n?this.graph.setSelectionCell(n):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,n){if(null==n){var t=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));n=this.getCellAt(t.x,t.y)}a.call(this,e,n)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var n=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(n),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=n}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,n.x,n.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,n){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var n=this.editorUi,l=n.editor,d=l.graph;this.addAction("new",function(){n.projectDesignController.newProject()},CRUD_PERMISSIONS.canEdit),this.addAction("open",function(){n.projectDesignController.openProject()},CRUD_PERMISSIONS.canEdit),this.addAction("save",function(){n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),n.editor.modified=!1},CRUD_PERMISSIONS.canEdit,null,"Ctrl+S"),this.addAction("saveAs",function(){n.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+S"),this.addAction("publish",function(){n.editor.setStatus(""),null===n.validate()?(n.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),n.editor.modified=!1):(n.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){n.editor.setStatus("")},3e3))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+P"),this.addAction("variable",function(){n.projectDesignController.newVariable()},CRUD_PERMISSIONS.canEdit),this.addAction("import",function(){n.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("export",function(){n.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){n.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null==n&&(n=""),null!=(n=mxUtils.prompt(mxResources.get("enterValue"),n))&&d.setLinkForCell(e,n)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),n=d.getLinkForCell(e);null!=n&&window.open(n)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];d.getModel().getChildCount(t)?d.updateGroupBounds([t],20):d.updateCellSize(t)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),n="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(n=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,n)}),this.addAction("rotation",function(){var e="0",n=d.getView().getState(d.getSelectionCell());null!=n&&(e=n.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var n=0;n<e.length;n++){var t=e[n];if(d.getModel().isVertex(t)&&0==d.getModel().getChildCount(t)){var a=d.getCellGeometry(t);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(t,a);var s=d.view.getState(t);if(null!=s){var o=s.style[mxConstants.STYLE_DIRECTION]||"east";"east"==o?o="south":"south"==o?o="west":"west"==o?o="north":"north"==o&&(o="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,o,[t])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(t/e.width/n,a/e.height/n))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*n*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*n*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,n=d.pageScale,t=d.container.clientWidth-20,a=Math.floor(100*t/e.width/n)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*n*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*n*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,n=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(n*d.view.scale)}else{var t=d.view.translate;d.view.setTranslate(t.x-d.container.scrollLeft/d.view.scale,t.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var t=mxUtils.bind(this,function(e,n){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,n)})});t("bold",mxConstants.FONT_BOLD),t("italic",mxConstants.FONT_ITALIC),t("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var n=d.getModel(),t=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",n.getStyle(e[0])||"");null!=t&&d.setCellStyle(t,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var n=l.graph.selectionCellsHandler.getHandler(e);if(n instanceof mxEdgeHandler){var t=d.view.translate,a=d.view.scale,i=t.x,s=t.y,o=d.getModel().getParent(e),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r&&(i+=r.x,s+=r.y),n.addPointAt(n.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-s)}}}),this.addAction("removeWaypoint",function(){var e=n.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",n=d.getView().getState(d.getSelectionCell());if(null!=n&&(e=n.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var t=new Image;t.onload=function(){!function(e,n,t){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var s=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",s,s,n,t)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=n&&null!=t){var o=i[0],r=d.getModel().getGeometry(o);null!=r&&((r=r.clone()).width=n,r.height=t,d.getModel().setGeometry(o,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,t.width,t.height)},t.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},t.src=e}})},Actions.prototype.addAction=function(e,n,t,a,i){return this.put(e,new Action(mxResources.get(e),n,t,a,i))},Actions.prototype.put=function(e,n){return this.actions[e]=n},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,n){for(var t=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<t.length;a++){this.styleChange(e,t[a],[mxConstants.STYLE_FONTFAMILY],[t[a]],null,n).firstChild.nextSibling.style.fontFamily=t[a]}e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,n)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,n){for(var t=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<t.length;a++)this.styleChange(e,t[a],[mxConstants.STYLE_FONTSIZE],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,n)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,n){for(var t=[1,2,3,4,8,12,16,24],a=0;a<t.length;a++)this.styleChange(e,t[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[t[a]],null,n);e.addSeparator(n),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,n)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,n),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,n),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,n),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,n)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,n)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,n),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,n),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,n),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,n),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,n),e.addSeparator(n),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},n,null,!0),e.addSeparator(n),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,n)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,n){var t=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(t||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,n,t),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,n,t),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,n,t),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,n,t),e.addSeparator(n),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,n,t),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,n,t)),(a||e.showDisabled)&&(e.addSeparator(n),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,n,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,n,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItem(e,"style",n)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,n){var t=this.get("text").enabled;e.addSeparator(n),this.addSubmenu("fontFamily",e,n),this.addSubmenu("fontSize",e,n),this.addMenuItems(e,["-","bold","italic","underline","-"],n),this.addSubmenu("alignment",e,n),this.addMenuItem(e,"wordWrap",n),e.addSeparator(n),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,n,t),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},n,null,t)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,n),e.addSeparator(n),this.addSubmenu("position",e,n),this.addSubmenu("spacing",e,n),e.addSeparator(n);var t=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},n,null,t)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,n){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,n),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,n),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,n),e.addSeparator(n),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,n),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,n),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,n)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},n),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},n),this.addMenuItems(e,["-","tilt","rotation"],n)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},n),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},n),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},n),e.addSeparator(n),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},n),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},n),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},n)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,n){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),n),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),n)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],n)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["toFront","toBack","-"],n),this.addSubmenu("layout",e,n),e.addSeparator(n),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],n)}))),this.put("view",new Menu(mxUtils.bind(this,function(n,t){this.addMenuItems(n,["actualSize"],t),n.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){n.addItem(100*e+"%",null,function(){i.zoomTo(e)},t)}(e[a]);this.addMenuItems(n,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],t)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],n)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,n){this.menus[e]=n},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,n,t){var a=this.get(e).enabled;if(n.showDisabled||a){var i=n.addItem(mxResources.get(e),null,null,t,null,a);this.addMenu(e,n,i)}},Menus.prototype.addMenu=function(e,n,t){var a=this.get(e);null!=a&&(n.showDisabled||a.enabled)&&this.get(e).execute(n,t)},Menus.prototype.styleChange=function(e,n,t,a,i,s){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var n=0;n<t.length;n++)e.setCellStyles(t[n],a[n])}finally{e.getModel().endUpdate()}}),s,i)},Menus.prototype.promptChange=function(e,n,a,i,s,t,o){return e.addItem(n,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,n=i,t=e.getView().getState(e.getSelectionCell());null!=t&&(n=t.style[s]||n),null!=(n=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),n))&&0<n.length&&e.setCellStyles(s,n)}),t,null,o)},Menus.prototype.addMenuItem=function(e,n,t){var a=this.editorUi.actions.get(n);if(null==a||!e.showDisabled&&!a.enabled)return null;var i=e.addItem(a.label,null,a.funct,t,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i},Menus.prototype.addShortcut=function(e,n){if(null!=n.shortcut){var t=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,n.shortcut),t.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var n=e.firstChild.nextSibling;n.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,n,t){for(var a=0;a<n.length;a++)"-"==n[a]?e.addSeparator(t):this.addMenuItem(e,n[a],t)},Menus.prototype.createPopupMenu=function(e,n,t){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(n=a.getSelectionCell())&&a.getModel().isEdge(n)){var s=a.selectionCellsHandler.getHandler(n);if(s instanceof mxEdgeHandler&&null!=s.bends&&2<s.bends.length){var o=s.getHandleForEvent(new mxMouseEvent(t)),r=this.editorUi.actions.get("removeWaypoint");r.handler=s,i=0<(r.index=o)&&o<s.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){var n=new Menubar(this.editorUi,e),t=[];t=CRUD_PERMISSIONS.canEdit?["file","edit","view","format","text","arrange","help"]:["file","view","help"];for(var a=0;a<t.length;a++)n.addMenu(mxResources.get(t[a]),this.get(t[a]).funct);return n},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geItem",mxUtils.write(t,e),this.addMenuHandler(t,n),this.container.appendChild(t),t},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,s){if(null!=s){var o=!0,n=mxUtils.bind(this,function(e){if(o&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var n=new mxPopupMenu(s);n.div.className+=" geMenubarMenu",n.smartSeparators=!0,n.showDisabled=!0,n.autoExpand=!0,n.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(n,arguments),n.destroy(),this.currentMenu=null,this.currentElt=null});var t=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;n.popup(t,a,null,e),this.currentMenu=n,this.currentElt=i}o=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),n(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){o=this.currentElt!=i})),mxEvent.addListener(i,"click",n)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,n){this.funct(e,n)},Toolbar.prototype.init=function(){CRUD_PERMISSIONS.canEdit?this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]):this.addItems(["print","actualSize","zoomIn","zoomOut","-"])},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,n,t,a){var i=this.editorUi.menus.get(a),s=this.addMenuFunction(e,n,t,i.funct);return i.addListener("stateChanged",function(){s.setEnabled(i.enabled)}),s},Toolbar.prototype.addMenuFunction=function(e,n,t,a){var i=t?this.createLabel(e):this.createButton(e);return this.initElement(i,n),this.addMenuHandler(i,t,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var n=0;n<e.length;n++){var t=e[n];"-"==t?this.addSeparator():this.addItem("geSprite-"+t.toLowerCase(),t)}},Toolbar.prototype.addItem=function(e,n){var t=this.editorUi.actions.get(n),a=null;return null!=t&&((a=this.addButton(e,t.label,t.funct)).setEnabled(t.enabled),t.addListener("stateChanged",function(){a.setEnabled(t.enabled)})),a},Toolbar.prototype.addButton=function(e,n,t){var a=this.createButton(e);return this.initElement(a,n),this.addClickHandler(a,t),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(t){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),n=0;n<t.length;n++)t[n].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var n=i.getSelectionCells(),t=0;t<n.length;t++)if(i.getModel().isEdge(n[t])){e=!0;break}for(t=0;t<a.length;t++)a[t].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,n){e.setAttribute("tabindex","0"),null!=n&&e.setAttribute("title",n),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(n){var t=n.className;n.setEnabled=function(e){n.enabled=e,n.className=e?t:t+" geDisabled"},n.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(n,t){null!=t&&mxEvent.addListener(n,"click",function(e){n.enabled&&t(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var n=document.createElement("a");n.setAttribute("href","javascript:void(0);"),n.className="geButton";var t=document.createElement("div");return t.className="geSprite "+e,n.appendChild(t),n},Toolbar.prototype.createLabel=function(e,n){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.className="geLabel",mxUtils.write(t,e),t},Toolbar.prototype.addMenuHandler=function(n,t,a,i){if(null!=a){var s=this.editorUi.editor.graph,o=null;mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){(null==n.enabled||n.enabled)&&(s.panningHandler.hideMenu(),(o=new mxPopupMenu(a)).div.className+=" geToolbarMenu",o.showDisabled=i,o.labels=t,o.autoExpand=!0,o.popup(n.offsetLeft,n.offsetTop+n.offsetHeight+34,null,e),this.currentMenu=o),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/auth/services/hotdesk/dialog.html",'<md-dialog aria-label="Telephone">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="LOGIN.TELEPHONES">Telephones</span>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-select ng-model="vm.name" placeholder="Select a telephone">\n <md-option value="{{telephone.name}}" ng-repeat="telephone in vm.telephones.rows">{{telephone.fullname}}</md-option>\n </md-select>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.closeDialog(vm.name)" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.name">\n <span translate="LOGIN.SELECT">SELECT</span>\n </md-button>\n \x3c!-- <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="LOGIN.CANCEL">Cancel</span>\n </md-button> --\x3e\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/dialogs/advanced-search/dialog.html",'<md-dialog class="advanced-search-dialog" aria-label="Advanced search" flex="70" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="advanced-search-dialog-header" ng-class="{{ \'vm.toolbarColor\' }} + \'-bg\'">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="DASHBOARDS.ADVANCED_SEARCH"></span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.minimize()">\n <md-icon class="no-margin" md-font-icon="icon-window-minimize" aria-label="Minimize dialog"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.close()">\n <md-icon class="no-margin" md-font-icon="icon-window-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <ms-advanced-search options="vm.searchOptions" clear-filter="vm.clearConditions()"></ms-advanced-search>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button class="md-primary md-raised" aria-label="Clear" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.CLEAR" translate-attr-aria-label="DASHBOARDS.CLEAR" ng-click="vm.clearConditions()"></md-button>\n <md-button class="md-primary md-accent md-raised" aria-label="Apply" ng-disabled="vm.searchOptions.conditions.length === 0" translate="DASHBOARDS.APPLY" translate-attr-aria-label="DASHBOARDS.APPLY" ng-click="vm.applyFilter()"></md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-advanced-search/ms-advanced-search.html",'<div layout="column" class="advanced-search-container" flex>\n <div layout-margin>\n <md-radio-group ng-model="vm.options.matchType" class="md-primary" layout="row">\n <md-radio-button value="$and" class="md-primary">{{ \'DASHBOARDS.MEET_ALL_CONDITIONS\' | translate }}\n </md-radio-button>\n <md-radio-button value="$or">{{ \'DASHBOARDS.MEET_ANY_CONDITIONS\' | translate }}</md-radio-button>\n </md-radio-group>\n </div>\n\n \x3c!-- ACTIVE CONDITIONS --\x3e\n <div layout="row" ng-if="vm.options.conditions.length > 0" class="advanced-search-conditions">\n <md-list>\n <md-list-item>\n <md-chips ng-model="vm.options.conditions" class="advanced-search-chips" readonly="true" md-removable="true" md-on-remove="vm.removeCondition()">\n <md-chip-template ms-chip-color="{{ $chip.style }}">\n <md-menu md-offset="50 0" ng-class="{\'no-click\': vm.pendingCondition}">\n <span>\n <p class="filter-text">{{ $chip.name }}</p>\n <em ng-show="$chip.operator" class="text-lowercase">{{ $chip.operator }}</em>\n <strong>{{ $chip.displayValue }}</strong>\n <em ng-show="$chip.displayEndValue" class="text-lowercase">{{ \'DASHBOARDS.AND\' | translate }}</em>\n <strong>{{ $chip.displayEndValue }}</strong>\n </span>\n <md-menu-content width=2 class="md-dense">\n <md-menu-item ng-hide="$chip.disabled">\n <md-button ng-click="vm.editCondition($chip)">Edit\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.setConditionStatus($chip)">\n {{ $chip.disabled ? \'Enable\' : \'Disable\' }}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-chip-template>\n <button type="button" md-chip-remove class="md-primary remove-filter">\n <md-icon md-font-icon="icon-cancel" aria-label="Remove Filter"></md-icon>\n </button>\n </md-chips>\n </md-list-item>\n </md-list>\n </div>\n\n \x3c!-- FILTERS --\x3e\n <div layout="row">\n <div layout="row" class="advanced-search-bar" layout-margin flex>\n \x3c!-- FIELD --\x3e\n <md-input-container flex="35">\n <md-icon md-font-icon="icon-filter-variant"></md-icon>\n <md-select class="font-size-12" ng-model="vm.selectedField" ng-change="vm.onFieldChange()" placeholder="{{ \'DASHBOARDS.SELECT_FIELD\' | translate }}" aria-label="Field">\n <md-option ng-value="field" ng-repeat="field in vm.options.fields">{{ field.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- OPERATOR --\x3e\n <md-input-container flex="30">\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-select class="font-size-12" ng-model="vm.selectedOperator" ng-change="vm.onOperatorChange(oldValue)" ng-focus="oldValue=vm.selectedOperator" md-selected-text="vm.selectedOperator ? (\'DASHBOARDS.\' + vm.selectedOperator.translate | translate) : (\'DASHBOARDS.SELECT_OPERATOR\' | translate)" ng-disabled="!vm.selectedField" aria-label="Operator">\n <md-option ng-value="operator" ng-repeat="operator in vm.availableOperators" ng-selected="vm.autoSelectOperator">\n <div layout="row" class="operators-list">\n <span class="operator-symbol">\n {{ operator.symbol }}\n </span>\n <span>\n {{ \'DASHBOARDS.\' + operator.translate | translate }}\n </span>\n </div>\n </md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TEXT INPUT --\x3e\n <md-input-container ng-if="!vm.selectedField.type || vm.selectedField.type === \'text\'" class="no-errors" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n </md-input-container>\n \x3c!-- NUMERIC INPUT --\x3e\n <div ng-if="vm.selectedField.type === \'number\'" flex layout="row" layout-margin class="no-margin">\n <md-input-container class="no-errors" flex>\n <md-icon md-font-icon="icon-numeric"></md-icon>\n <input type="number" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" min="0" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_VALUE\' : \'DASHBOARDS.VALUE\' | translate }}">\n </md-input-container>\n <md-input-container class="no-errors" ng-if="vm.selectedOperator.type === \'$between\'" ng-class="{\'md-input-invalid\': !vm.isValidRange}" flex>\n <md-icon md-font-icon=" icon-numeric">\n </md-icon>\n <input class="md-input" type="number" aria-label="Value" ng-model="vm.endRangeValue" ng-change="vm.checkRange()" ng-disabled="!vm.value" min="vm.value" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.ENDING_VALUE\' | translate }}">\n <div ng-if="!vm.isValidRange" class="md-input-message-animation md-input-messages-animation">\n {{ (\'DASHBOARDS.VALUE_RANGE_CHECK\' | translate) + \' \' + vm.value }}\n </div>\n </md-input-container>\n </div>\n \x3c!-- SELECT --\x3e\n <md-input-container ng-if="vm.selectedField.type === \'select\'" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-select class="font-size-12" ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n </md-option>\n </md-select>\n </md-input-container>\n \x3c!-- MULTISELECT --\x3e\n <md-input-container ng-if="vm.selectedField.type === \'multiselect\'" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-select class="font-size-12" multiple ng-model="vm.value" md-on-open="vm.getValues()" ng-change="vm.onValueChange()" ng-model-options="{trackBy: \'$value.id\'}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}" aria-label="Value">\n <md-option ng-value="item" ng-repeat="item in vm.selectedField.values">{{item.name}}\n </md-option>\n </md-select>\n </md-input-container>\n \x3c!-- DATE INPUT --\x3e\n <div ng-if="vm.selectedField.type === \'date\'" flex layout="row">\n <mdp-date-picker mdp-open-on-click ng-model="vm.value" ng-change="vm.onValueChange()" mdp-max-date="vm.maxDateRange" mdp-placeholder="{{ vm.selectedOperator.type === \'$between\' ? \'DASHBOARDS.STARTING_DATE\' : \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n </mdp-date-picker>\n <mdp-date-picker mdp-open-on-click ng-if="vm.selectedOperator.type === \'$between\'" ng-change="vm.checkRange()" ng-model="vm.endRangeValue" mdp-min-date="vm.minDateRange" mdp-disabled="!vm.value" mdp-placeholder="{{ \'DASHBOARDS.ENDING_DATE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n </mdp-date-picker>\n </div>\n \x3c!-- AUTOCOMPLETE --\x3e\n <div layout="row" layout-align="start start" ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type != \'$substring\'" class=" autocomplete-input" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <md-autocomplete md-selected-item="vm.value" md-selected-item-change="vm.onValueChange()" md-items="item in vm.getValues()" md-search-text="vm.searchText" md-item-text="item.displayValue" md-min-length="4" md-no-cache="true" md-floating-label="{{ \'DASHBOARDS.VALUE\' | translate }}" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" flex>\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="i">{{item.displayValue}}</span>\n </md-item-template>\n </md-autocomplete>\n </div>\n <md-input-container ng-if="vm.selectedField.type === \'autocomplete\' && vm.selectedOperator.type === \'$substring\'" class="no-errors" flex>\n <md-icon md-font-icon="icon-format-text"></md-icon>\n <input type="text" aria-label="Value" ng-model="vm.value" ng-change="vm.onValueChange()" ng-disabled="!vm.selectedField" ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()" placeholder="{{ \'DASHBOARDS.VALUE\' | translate }}">\n </md-input-container>\n </div>\n <md-button class="md-fab md-mini md-primary mt-20" ng-if="!vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Add filter" ng-click="vm.addCondition()" translate-attr-aria-label="DASHBOARDS.ADD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini mt-20" ng-if="vm.pendingCondition" ng-disabled="!vm.isValidCondition" aria-label="Update filter" ng-click="vm.updateCondition()" translate-attr-aria-label="DASHBOARDS.UPDATE">\n <md-icon md-font-icon="icon-check"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-primary mt-20" ng-if="vm.pendingCondition" aria-label="Cancel filter update" ng-click="vm.cancelUpdateCondition()" translate-attr-aria-label="DASHBOARDS.CANCEL">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h2" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n </div>\n\n <div class="text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="text p-16" ng-if="card.text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n <div layout="column" layout-align="space-between">\n <div class="info">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="cta">\n <md-button class="m-0">{{card.cta}}</md-button>\n </div>\n </div>\n\n <div class="media pl-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n <div class="info white-fg ph-16 pv-24">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="event h2" ng-if="card.event">\n {{card.event}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n <div class="content pv-24 ph-16">\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="title h2" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div class="p-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text h4 pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div>\n <md-divider></md-divider>\n <div class="p-8" layout="row">\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="buttons pt-16">\n <md-button class="m-0">{{card.button1}}</md-button>\n <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n </div>\n </div>\n\n <div class="text ph-16 pb-16" ng-if="card.text">\n {{card.text}}\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="buttons m-8">\n <md-button class="md-icon-button mr-16" aria-label="Favorite">\n <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Share">\n <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n </md-button>\n </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n <span ng-if="!showMenu()" privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n <md-menu ng-if="showMenu()">\n <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n <span ng-if="prefix" privacy="{{ privacy }}" ng-cloak>{{prefix}}-</span>\n <span privacy="{{ privacy }}" ng-cloak>{{target}}</span>\n </a>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>\n<section ng-if="type === \'button\'">\n <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="showMenu()">\n <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} (<span privacy="{{ privacy }}" ng-cloak>{{prefix ? prefix + \'-\' + target : target}}</span>)\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging-icon.html",'<md-icon ng-style="vm.styleColor" md-font-icon="{{ vm.styleIcon }}">\n <md-tooltip class="client-side-logging-tooltip">\n <span ng-bind-html="vm.tooltipHTML"></span>\n </md-tooltip>\n</md-icon>'),e.put("app/core/directives/ms-client-side-logging/ms-client-side-logging.html",'<md-content layout="column">\n <form name="clientSideLoggingSettingsForm">\n <div flex layout="column" layout-align="stretch center">\n <div ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-amber-500-bg p-10" layout="row" layout-align="start center">\n <span class="no-margin font-size-14 line-height-30" translate="STAFF.CLIENT_LOGS_ALL_ENABLED_WARNING" flex></span>\n </div>\n <md-input-container>\n <md-switch ng-model="vm.user.userSetting.clientSideLoggingEnabled" aria-label="Manage client side logging" ng-change="vm.onEnabledSwitchChange()">\n {{ vm.user.userSetting.clientSideLoggingEnabled ? \'STAFF.CLIENT_LOGS_ENABLED\' : \'STAFF.CLIENT_LOGS_DISABLED\' | translate }}\n </md-switch>\n </md-input-container>\n <h2 ng-if="vm.user.userSetting.clientSideLoggingEnabled" class="md-subhead mt-0">{{ vm.clientSideLoggingEnabledSince }}</h2>\n </div>\n <div layout="column" layout-align="stretch center">\n <md-input-container ng-if="vm.user.userSetting.clientSideLoggingEnabled">\n <label>{{ \'STAFF.CLIENT_LOGS_LOGLEVEL_SELECT\' | translate }}</label>\n <md-select ng-if="vm.user.userSetting.clientSideLoggingEnabled" ng-model="vm.user.userSetting.clientSideLoggingLevel" placeholder="Debugging level" ng-change="vm.onLogLevelSelectionChange()" flex="30">\n <md-option ng-value="loggingLevel" ng-repeat="loggingLevel in vm.availableClientSideLoggingLevels">\n <md-icon ng-style="vm.computeStyleForLoggingLevel(loggingLevel)" md-font-icon="{{ loggingLevel === \'info\' ? \'icon-checkbox-blank-circle-outline\' : \'icon-checkbox-blank-circle\' }}"></md-icon>\n {{ loggingLevel }}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n </form>\n</md-content>'),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="query" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || vm.addDisabled}" ng-disabled="vm.readOnly || vm.addDisabled" ng-repeat="item in availableItems = (vm.options.items | filter: query) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, false)">\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n </p>\n </div>\n <md-icon ng-hide="vm.readOnly && !vm.addDisabled" ng-class="{\'add-disabled\': vm.addDisabled}" md-font-icon="icon-arrow-right-bold" aria-label="swap">\n </md-icon>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <span class="h4" flex>{{vm.options.labelAll || \'All Items\'}} ({{availableItems.length}})</span>\n <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" ng-class="{\'add-disabled\': vm.addDisabled}" ng-disabled="vm.addDisabled" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="vm.transfer(vm.options.items, vm.options.selectedItems, -1, false)"></md-icon>\n </div>\n </div>\n\n <div flex="10" layout="row" layout-align="center center">\n <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n </div>\n\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="selectedQuery" type="text" placeholder="{{ \'STAFF.PERMISSIONS_PLACEHOLDER_SEARCH\' | translate }}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="{\'read-only-mode\': vm.readOnly || !item.isValid}" ng-disabled="vm.readOnly" ng-repeat="item in associatedItems = (vm.options.selectedItems | filter: selectedQuery) | orderBy: vm.options.orderBy" ng-click="vm.canTransfer(item, vm.options, true)">\n <md-icon ng-class="{\'hidden\': vm.readOnly || !item.isValid}" md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="vm.options.line1">{{vm.getLine(item, vm.options.line1)}}</h3>\n <h4 ng-if="vm.options.line2">{{vm.getLine(item, vm.options.line2)}}</h4>\n <p ng-if="vm.options.line3">{{vm.getLine(item, vm.options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="vm.options.line4">{{vm.getLine(item, vm.options.line4)}}\n </p>\n </div>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <md-icon ng-hide="vm.options.showSelectAndDeselectAll === false || vm.readOnly" md-font-icon="icon-chevron-double-left" aria-label="swap" ng-click="vm.transfer(vm.options.selectedItems, vm.options.items, -1, true)"></md-icon>\n <span class="h4 text-right" flex>{{vm.options.labelSelected || \'Selected Items\'}}\n ({{associatedItems.length}})</span>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-repeat="font in fonts" ng-value="font.value"><span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n <div id="ms-info-bar-message" ng-transclude flex></div>\n <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n <md-icon md-font-icon="icon-close s20"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n <div ng-click="$mdOpenMenu($event)">\n <ms-color-picker-button>\n <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n <span ng-show="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n <span ng-show="!vm.selectedColor.palette">\n Select Color\n </span>\n </md-button>\n </ms-color-picker-button>\n </div>\n\n <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n </md-button>\n\n <span ng-if="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n\n <span ng-if="!vm.selectedColor.palette">\n Select Color\n </span>\n\n <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n </md-button>\n </header>\n\n <div class="colors">\n <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n <span class="label">\n {{palette}}\n </span>\n </div>\n </div>\n\n <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n <span class="label">\n {{hue}}\n </span>\n <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n </i>\n </div>\n </div>\n\n </div>\n\n </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n <md-icon md-font-icon="icon-menu"></md-icon>\n </md-button>\n</div>\n\n<ul class="horizontal">\n <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}"\n ng-if="node.uisref && node.title">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node"\n ng-class="{\'has-children\': vm.hasChildren}"\n ng-include="\'navigation-horizontal-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n <div id="{{ node.id }}" ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-node="node"\n ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}"\n ng-include="\'navigation-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n <section layout="row" layout-align="start center">\n <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n <span class="md-subhead">Dialpad</span>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </section>\n <md-divider></md-divider>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\n\x3c!-- Input&Media Area --\x3e\n<div layout="row" layout-align="start center">\n <div layout="row" layout-align="center center">\n \x3c!-- START Ringing Tone--\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.conf.ringingMute = !vm_pb.conf.ringingMute; vm_pb.initDevice(\'ringing\', true)" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Ringing Tone --\x3e\n\n \x3c!-- START Speaker --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.conf.speakerMute = !vm_pb.conf.speakerMute; vm_pb.initDevice(\'speaker\', true)" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Speaker --\x3e\n\n \x3c!-- START Microphone --\x3e\n <md-button ng-disabled="(!vm_pb.registered || vm_pb.sessions.length==0)?true:false" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.conf.microphoneMute = !vm_pb.conf.microphoneMute; vm_pb.initDevice(\'microphone\', true)">\n <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Microphone --\x3e\n\n \x3c!-- START Registered --\x3e\n <span>\n <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}}\n <timer ng-if="vm_pb.registered"></timer>\n </span>\n </md-tooltip>\n </span>\n \x3c!-- END Registered --\x3e\n </div>\n <div layout="column" layout-align="center start">\n <div layout="row" layout-align="start center">\n \x3c!-- START Target --\x3e\n <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html" input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" disable-autocomplete="vm_pb.currentUser.privacyEnabled"></angucomplete-alt>\n \x3c!-- END Target --\x3e\n\n \x3c!-- Auto Answer --\x3e\n <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n <span class="font-size-20">A<span class="font-size-16">A</span></span>\n </div>\n \x3c!-- Auto Answer --\x3e\n\n <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n </md-button>\n <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n\x3c!-- Input&Media Area --\x3e\n\n\x3c!-- START 3WC --\x3e\n<md-button ng-if="vm_pb.canGoInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="3Way" ng-click="vm_pb.start3WayConf(); $event.stopPropagation();">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon orange-fg s14"></md-icon>\n <md-tooltip><span translate="TOOLBAR.CONFERENCE">Conference</span></md-tooltip>\n</md-button>\n\x3c!-- END 3Way --\x3e\n\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n </div>\n\n <div id="{{\'div_session_\'+session.id.substr(0,32)}}" ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n <div layout="column" layout-align="center start">\n <span class="session-info">\n <span ng-if="session.user == session.name" privacy ng-cloak>{{session.user}}</span>\n <span ng-if="session.user != session.name" privacy ng-cloak>{{session.name}}</span> <span ng-if="session.user != session.name" privacy ng-cloak>{{session.user}}</span>\n </span>\n <span class="session-info" layout="row" layout="start center">\n <timer></timer>\n </span>\n </div>\n\n \x3c!-- START Answer --\x3e\n <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Anser" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Answer --\x3e\n\n \x3c!-- START Hangup --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hangup --\x3e\n\n \x3c!-- START Hold/Unhold --\x3e\n <md-button ng-if="session.confirmed && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hold/Unhold --\x3e\n\n \x3c!-- START Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1 && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END transfer --\x3e\n\n \x3c!-- START Attended Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length>1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Attended Transfer --\x3e\n </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title" privacy ng-cloak></span></span>\n </div>\n </div>\n </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n \x3c!-- Audio stream --\x3e\n <audio id="local-audio" autoplay hidden=true></audio>\n <audio id="remote-audio" autoplay hidden=true></audio>\n \x3c!-- Audio stream --\x3e\n\n \x3c!-- WebRtc PhoneBar --\x3e\n <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/prefix/dialog.html",'<md-dialog aria-label="Prefix">\n <form ng-cloak ng-keypress="vm.keyPress($event)">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.PREFIXES">Prefixes</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog(-1)">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-radio-group ng-model="vm.prefix">\n <md-radio-button ng-repeat="prefix in vm.prefixes.rows" value="{{prefix.prefix}}" class="md-primary">{{prefix.name}}</md-radio-button>\n <md-radio-button ng-if="!vm.required" ng-value="null" class="md-primary">no prefix</md-radio-button>\n </md-radio-group>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.call()" class="send-button md-accent md-raised" aria-label="call" md-autofocus ng-disabled="!vm.prefix && vm.required">\n <span translate="TOOLBAR.CALL">CALL</span>\n </md-button>\n <md-button ng-click="vm.closeDialog(-1)" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding">\n <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-table-container>\n <table md-table layout-padding>\n <thead md-head>\n <tr md-row>\n <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.session.monitors.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="monitor in vm.session.monitors">\n <td md-cell>{{monitor.filename}}</td>\n <td md-cell class="no-padding">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n </td>\n <td md-cell class="no-padding">\n <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+" <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <label translate="TOOLBAR.TARGET">Target</label>\n <md-input-container class="md-block">\n <md-select ng-model="vm.target">\n <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n {{ session.name }}\n </md-option>\n </md-select>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n </md-button>\n <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n <form name="settingsForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="no-padding">\n <md-tabs md-no-pagination md-stretch-tabs="always">\n <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n <md-content layout-padding layout="column">\n <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n <md-content layout-padding>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n </md-switch>\n <md-switch ng-model="vm.messengerSoundNotification" aria-label="EnableMessengerSoundNotification">\n <span translate="TOOLBAR.MESSENGERSOUNDNOTIFICATION">MessengerSoundNotification</span>\n </md-switch> \n </md-input-container>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n <md-content layout-padding>\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between cetner">\n <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\' }).length">\n <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-disabled="vm.activeSessions.length==0" ng-model="vm.conf.microphoneMute" aria-label="Mute">\n Mute\n </md-switch>\n </div>\n </div>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n <md-content layout-padding>\n <md-list>\n <md-list-item>\n <h3 translate="TOOLBAR.LICENSE">License</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n </md-list>\n </md-content>\n </md-tab>\n </md-tabs>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-quick-filter/ms-quick-filter.html",'<div ng-cloak layout="row" class="quick-filter-container" flex>\n <div ng-repeat="filter in vm.filters" ng-if="filter.ngIf ? $eval(\'vm.query.\' + filter.ngIf) : true" layout="column" class="padding-horizontal-16">\n <span class="font-size-10" translate="{{ filter.label }}" />\n <md-select ng-if="filter.type === \'select\'" class="font-size-12 no-margin" ng-model="vm.query[filter.key]" ng-change="vm.search()" aria-label="Filter {{ filter.name }}">\n <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id">\n {{ option.name }}</md-option>\n <md-option ng-repeat="option in filter.customOptions" ng-value="option.value" translate="{{ option.translate }}">\n </md-option>\n </md-select>\n\n <md-select ng-if="filter.type === \'multiselect\'" multiple class="font-size-12 no-margin" ng-init="vm.onMultiselectInit(filter)" ng-model="vm.query[filter.key]" ng-disabled="filter.options.length === 0" ng-change="vm.onMultiselectSelection(filter, isOpen)" md-selected-text="vm.placeholders[filter.key]" aria-label="Filter {{ filter.name }}" md-on-open="isOpen = true" md-on-close="isOpen = false">\n <md-option ng-repeat="option in filter.options" ng-value="filter.ngValue ? option[filter.ngValue] : option.id" ng-disabled="filter.clearAll === false && vm.query[filter.key].length === 1 && vm.query[filter.key][0] === (filter.ngValue ? option[filter.ngValue] : option.id)">\n {{ option.name }}</md-option>\n <md-button ng-if="vm.query[filter.key].length < filter.options.length" ng-click="vm.selectAll(filter)" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n <md-button ng-if="vm.query[filter.key].length === filter.options.length" ng-click="vm.clearSelection(filter)" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n </md-select>\n\n <div ng-if="filter.type === \'date\'" layout="row" layout-align="center center">\n <md-date-range ng-init="vm.onDateRangeInit(filter)" localization-map="vm.localizationMap" ng-model="vm.pickerModels[filter.key]" auto-confirm="true" show-template="true" md-on-select="vm.onDateRangeSelection(filter)" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}">\n </md-date-range>\n <md-button ng-if="vm.pickerModels[filter.key].dateStart" ng-click="vm.clearDate(filter)" class="md-icon-button no-margin no-padding width-20 height-20" aria-label="Clear date filter">\n <md-icon md-font-icon="icon-close" class="quick-filter-date-clear-button s16"></md-icon>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n <label>\n <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar" ng-click="vm.expandBar()" ng-if="!vm.resultsLoading || !vm.expanded" ng-class="{\'ms-search-button-expanded\': vm.expanded }">\n <md-icon id="ms-search-bar-icon" md-font-icon="icon-magnify" class="s24" ng-class="{\'{{ vm.iconColor }}\': vm.iconColor && !vm.expanded }"></md-icon>\n </md-button>\n <div class="ms-search-bar-loader" layout="row" layout-align="center center" ng-if="vm.resultsLoading && vm.expanded">\n <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n </div>\n </label>\n <input ng-if="vm.expanded" focus-on="vm.expanded" type="text" placeholder="{{ \'TOOLBAR.SEARCH\' | translate }}" flex ng-model="vm.query.filter" ng-model-options="vm.queryOptions" ng-blur="vm.blurCollapse()" ng-keydown="vm.onKeyDown($event)" />\n <md-button class="ms-search-bar-collapser md-icon-button" ng-click="vm.collapseBar(true)" aria-label="Collapse Search Bar">\n <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n </md-button>\n <div class="ms-search-bar-results" ng-if="vm.results">\n <div class="no-results" ng-if="vm.results.length === 0">{{ \'DASHBOARDS.NO_RESULTS_AVAILABLE\' | translate }}</div>\n <div class="result" ng-repeat="result in vm.results" ng-click="vm.handleResultClick(result)" ng-mouseenter="vm.handleMouseEnter($index)" ng-mousedown="vm.absorbEvent($event)" ng-class="{\'selected\': $index == vm.selectedResultIndex}" md-ink-ripple>\n <div layout="row" layout-align="start center">\n <div class="icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="icon {{ result.icon }}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{ result.title }}</div>\n <div class="description" ng-if="result.description">{{ result.description }}</div>\n </div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n </md-button>\n </div>\n </div>\n\n \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n </md-button>\n\n <md-menu-content>\n <div id="ms-shortcut-add-menu">\n <div class="shortcut-search" layout="row" layout-align="start center">\n <div class="search-icon" layout="row" layout-align="center center"\n ng-if="!MsShortcuts.resultsLoading">\n <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </div>\n <div class="shortcut-loader" layout="row" layout-align="center center"\n ng-if="MsShortcuts.resultsLoading">\n <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n </md-progress-circular>\n </div>\n\n <input type="text" placeholder="Search" flex\n ng-model="MsShortcuts.query"\n ng-model-options="MsShortcuts.queryOptions"\n ng-keydown="MsShortcuts.handleKeydown($event)">\n </div>\n\n <div class="results" ng-if="MsShortcuts.results" >\n <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsShortcuts.results"\n ng-click="MsShortcuts.handleResultClick(result)"\n ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n ng-mousedown="MsShortcuts.absorbEvent($event)"\n ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n md-prevent-menu-close="md-prevent-menu-close"\n md-ink-ripple>\n <div layout="row" layout-align="start space-between">\n <div layout="row" layout-align="start center" flex>\n <div class="icon icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="{{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n </div>\n </div>\n <md-icon md-font-icon="icon-pin" class="icon s18"\n ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n </div>\n </div>\n </div>\n </div>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n <div class="ms-stepper-navigation-wrapper">\n <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}" ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n <div class="step md-accent-bg" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n {{$index + 1}}\n </span>\n <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n <i class="icon icon-check s18"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n </div>\n </md-button>\n </div>\n </div>\n\n <div class="ms-stepper-steps" ng-transclude></div>\n\n <div class="ms-stepper-controls" layout="row" layout-align="center center">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <div class="ms-stepper-dots">\n <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n </span>\n </div>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",'<md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(stepInfo.stepNumber), \'valid\': MsStepper.isStepValid(stepInfo.stepNumber), \'disabled\': MsStepper.isStepDisabled(stepInfo.stepNumber), \'optional\': MsStepper.isStepOptional(stepInfo.stepNumber)}" ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n <div class="step" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n </span>\n <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-check-circle s18 md-accent-fg"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n <div class="ms-stepper-vertical-line"></div>\n <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-tab-scroll/ms-tab-scroll.html",'<div layout="row">\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'left\')" ng-if="vm.canScroll(\'left\') == true">\n <md-icon md-font-icon="icon-chevron-left" class="icon s26"></md-icon>\n </md-button>\n <div id="bar-container" layout="row" class="bar-container">\n <div ng-transclude id="tab-container" layout="row" layout-align="start center" class="scroll-container">\n </div>\n </div>\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'right\')" ng-if="vm.canScroll(\'right\') == true">\n <md-icon md-font-icon="icon-chevron-right" class="icon s26"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin" ng-change="ngChange()">\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-2" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n <div ng-class="\'font-size-\' + (vm.fontSize * 2)" ng-style="{\'color\': widget.foreground}">\n {{ vm.getCount(widget) }}\n </div>\n <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' + vm.label | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n <dl ng-if="vm.error">\n <dt class="text-bold">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt>Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.title}}</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n </div>\n </md-toolbar>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span>No Data</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n <ul>\n <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n <md-card layout-fill>\n <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground, \'font-size\': (widget.titleFontSize || 12) }" class="text-truncate" flex>\n {{ widget.title || \'No Title\' }}\n </a>\n <md-button ng-if="!vm.config.preview && !vm.config.crudPermissions.readOnly" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu ng-if="!vm.config.preview">\n <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.config.crudPermissions.canEdit === true">\n <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.config.crudPermissions.canDelete === true">\n <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">\n Delete</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n </div>\n </md-toolbar>\n <md-card-content class="resizable" layout="column" layout-align="center center" flex style="height: 60px !important; min-height: 60px !important" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n <div ng-switch="widget.type" layout-fill>\n <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n <div ng-switch-default layout-fill>\n <div ng-include="widget.templateUrl" layout-fill></div>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </li>\n </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n </div>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n <md-content id="content" class="md-hue-2" ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n <div class="ms-theme-options-list" layout="column">\n <div class="theme-option layout-options">\n <div class="option-title">Layout Style:</div>\n <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n <div layout="column" layout-align="center center">\n <img ng-src="{{layoutStyle.figure}}">\n <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n </div>\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option">\n <div class="option-title">Layout Mode:</div>\n <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n {{layoutMode.label}}\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option color-palettes">\n <div class="option-title">Color Palette:</div>\n <div layout="row" layout-align="start start" layout-wrap>\n <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}" ng-class="{active: vm.getActiveTheme().name === themeName}">\n <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n <div class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR404.CODE">404</div>\n\n <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n </div> --\x3e\n\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR500.CODE">500</div>\n <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n </div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n </div>\n <pre ng-if="!vm.send">\n {{vm.error}}\n </pre>\n <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code">#{{vm.code}}</div>\n <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n <div layout="row" layout-align="start center">\n <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n </div>\n </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n <form name="forgotPasswordForm" novalidate>\n <md-input-container class="md-block" md-no-float>\n <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n SEND RESET LINK\n </md-button>\n </form>\n\n <div class="login" layout="row" layout-align="center center">\n <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n </div>\n </div>\n </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n <div flex hide-xs translate="HEADER.NEWS"></div>\n </div>\n </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column">\n <div id="login-form-wrapper" layout="column" layout-align="center center">\n <div id="login-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n <md-input-container class="md-block" md-no-float>\n <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n <div ng-messages="loginForm.name.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n <div ng-messages="loginForm.password.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n </md-checkbox> --\x3e\n <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n </div>\n\n <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message">\n <font color="red">{{vm.message}}</font>\n </b>\n <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n LOG IN\n </md-button>\n </form>\n\n <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n <div ng-if="vm.googleSsoEnabled || vm.adSsoEnabled" class="separator">\n <span class="text" translate="LOGIN.OR">OR</span>\n </div>\n\n <md-button ng-if="vm.googleSsoEnabled" ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="fab fa-google" class="s16"></md-icon>\n <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n </span>\n </div>\n </md-button>\n\n <md-button ng-if="vm.adSsoEnabled" ng-click="vm.loginAD()" class="md-raised ad">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="fas fa-ad" class="s16"></md-icon>\n <span style="text-transform: none" translate="LOGIN.WITH_AD">Log in with Active Directory</span>\n </span>\n </div>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n <form name="extractedReportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n\n <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n\n <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n ADD EXTRACTEDREPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-extractedReports-count">\n <span>{{vm.selectedExtractedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.extractedReports.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(extractedReport, $event )" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n Edit ExtractedReport\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="extractedReport.status == \'Completed\'">\n\n <md-button ng-click="vm.downloadfile2(extractedReport, $event , \'analytics/extracted_reports\' )" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n Download ExtractedReport\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(extractedReport, $event )" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n Delete ExtractedReport\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n <form name="metricForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n\n <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select name="table" ng-model="vm.metric.table" required>\n <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n <md-option ng-value="\'report_call\'">Call Report</md-option>\n <md-option ng-value="\'cdr\'">CDR</md-option>\n <md-option ng-value="\'chat_websites\'">Chat Website</md-option>\n <md-option ng-value="\'chat_interactions\'">Chat Interaction</md-option>\n <md-option ng-value="\'chat_messages\'">Chat Messages</md-option>\n <md-option ng-value="\'chat_offline_messages\'">Chat Offline Messages</md-option>\n <md-option ng-value="\'chat_queues\'">Chat Queues</md-option>\n <md-option ng-value="\'report_chat_queue\'">Chat Report Queue</md-option>\n <md-option ng-value="\'report_chat_transfer\'">Chat Report Transfer</md-option>\n <md-option ng-value="\'cm_companies\'">Companies</md-option>\n <md-option ng-value="\'report_call_transfer\'">Call transfer report</md-option>\n <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n <md-option ng-value="\'report_dial\'">Dial Report</md-option>\n <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n <md-option ng-value="\'mail_accounts\'">Email Account</md-option>\n <md-option ng-value="\'mail_interactions\'">Email Interaction</md-option>\n <md-option ng-value="\'mail_messages\'">Email Messages</md-option>\n <md-option ng-value="\'mail_queues\'">Email Queues</md-option>\n <md-option ng-value="\'report_mail_queue\'">Email Report Queue</md-option>\n <md-option ng-value="\'report_mail_transfer\'">Email Report Transfer</md-option>\n <md-option ng-value="\'fax_accounts\'">Fax Account</md-option>\n <md-option ng-value="\'fax_interactions\'">Fax Interaction</md-option>\n <md-option ng-value="\'fax_messages\'">Fax Messages</md-option>\n <md-option ng-value="\'fax_queues\'">Fax Queues</md-option>\n <md-option ng-value="\'report_fax_queue\'">Fax Report Queue</md-option>\n <md-option ng-value="\'report_fax_transfer\'">Fax Report Transfer</md-option>\n <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n <md-option ng-value="\'cm_lists\'">Lists</md-option>\n <md-option ng-value="\'report_member\'">Member Report</md-option>\n <md-option ng-value="\'openchannel_accounts\'">Openchannel Account</md-option>\n <md-option ng-value="\'openchannel_interactions\'">Openchannel Interaction</md-option>\n <md-option ng-value="\'openchannel_messages\'">Openchannel Messages</md-option>\n <md-option ng-value="\'openchannel_queues\'">Openchannel Queues</md-option>\n <md-option ng-value="\'report_openchannel_queue\'">Openchannel Report Queue</md-option>\n <md-option ng-value="\'report_openchannel_transfer\'">Openchannel Report Transfer</md-option>\n <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n <md-option ng-value="\'sms_accounts\'">SMS Account</md-option>\n <md-option ng-value="\'sms_interactions\'">SMS Interaction</md-option>\n <md-option ng-value="\'sms_messages\'">SMS Messages</md-option>\n <md-option ng-value="\'sms_queues\'">SMS Queues</md-option>\n <md-option ng-value="\'report_sms_queue\'">SMS Report Queue</md-option>\n <md-option ng-value="\'report_sms_transfer\'">SMS Report Transfer</md-option>\n <md-option ng-value="\'users\'">Users</md-option>\n <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n <md-option ng-value="\'whatsapp_accounts\'">Whatsapp Account</md-option>\n <md-option ng-value="\'whatsapp_interactions\'">Whatsapp Interaction</md-option>\n <md-option ng-value="\'whatsapp_messages\'">Whatsapp Messages</md-option>\n <md-option ng-value="\'whatsapp_queues\'">Whatsapp Queues</md-option>\n <md-option ng-value="\'report_whatsapp_queue\'">Whatsapp Report Queue</md-option>\n <md-option ng-value="\'report_whatsapp_transfer\'">Whatsapp Report Transfer</md-option>\n </md-select>\n <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.METRIC">Metric</label>\n <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n\n <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.metric.description">\n\n <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n ADD METRIC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-metrics-count">\n <span>{{vm.selectedMetrics.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- METRIC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.metrics.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(metric, $event )" translate="ANALYTICS.EDIT_METRIC">\n Edit Metric\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(metric, $event )" translate="ANALYTICS.DELETE_METRIC">\n Delete Metric\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / METRIC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD METRIC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n COPY REPORT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newReport">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select ng-model="vm.report.table" required>\n <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)" placeholder="Select the table to Join">\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n </md-item-template>\n <md-not-found>\n No states matching "{{vm.searchText}}" were found.\n </md-not-found>\n </md-autocomplete>\n\n <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n <md-card-title>\n <md-card-title-text layout="row">\n <div layout="row" flex="50">\n <span class="md-subhead">{{table.name}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.type" placeholder="Select join type" required>\n <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n </md-select>\n </md-card-content>\n </md-card>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n ADD REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n <div layout="row" ng-if="vm_rc.crudPermissions.canEdit">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.OPERATOR">Operator</label>\n <md-select ng-model="group.operator" required>\n <md-option value="AND">AND</md-option>\n <md-option value="OR">OR</md-option>\n </md-select>\n <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}\n </md-button>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n <div flex></div>\n <md-input-container class="md-block" ng-if="parent">\n <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n </div>\n <div layout="column" ng-repeat="rule in group.rules">\n <div layout="row" ng-if="!rule.group">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.COLUMN">COLUMN</label>\n <md-select name="field" ng-model="rule.field" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-optgroup label="{{vm_rc.report.table}}">\n <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n </md-optgroup>\n <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.CONDITION">CONDITION</label>\n <md-select name="condition" ng-model="rule.condition" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n </md-select>\n <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n <label translate="ANALYTICS.VALUE">VALUE</label>\n <input type="text" name="value" ng-model="rule.value" ng-disabled="!vm_rc.crudPermissions.canEdit" required md-autofocus>\n <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm_rc.crudPermissions.canEdit" flex>\n <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </md-input-container>\n </div>\n <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n <form name="reportFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <pre></pre>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n <md-option value="column">Select a column</md-option>\n <md-option value="metric">Select an existing metric</md-option>\n <md-option value="custom">Write a custom metric</md-option>\n </md-select>\n <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch on="vm.reportField.type">\n <md-input-container class="md-block" ng-switch-when="column">\n <label translate="ANALYTICS.COLUMN">Column Name</label>\n <md-select name="column" ng-model="vm.reportField.field" required>\n <md-optgroup label="{{vm.report.table}}">\n <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n </md-optgroup>\n <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="metric">\n <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="custom">\n <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FUNCTION">Function</label>\n <md-select name="function" ng-model="vm.reportField.function">\n <md-option ng-value="null">No Function</md-option>\n <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FORMAT">Format</label>\n <md-select name="format" ng-model="vm.reportField.format">\n <md-option ng-value="null">No Format</md-option>\n <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.GROUP_BY">Group By</label>\n <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ORDER_BY">Order By</label>\n <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n <md-option ng-value="null">No Order</md-option>\n <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n </md-select>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n ADD REPORT FIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="report-image" hide-xs>\n <img ng-src="assets/images/business/reports.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.report.id}} {{vm.report.name}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span>{{vm.report.description}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.description">\n <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="start start">\n <div class="md-subhead" translate="ANALYTICS.FIELDS">\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </div>\n <div class="h4">\n <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n </div>\n <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n </div>\n </div>\n </div>\n <div flex></div>\n <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-if="vm_rf.crudPermissions.canEdit" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select="vm_rf.crudPermissions.canDelete" multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n <tr md-row>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n </th>\n <th md-column>Type</th>\n <th md-column>Column or Metric</th>\n <th md-column>Alias</th>\n <th md-column>Function</th>\n <th md-column>Format</th>\n <th md-column>Group By</th>\n <th md-column>Order By</th>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_rf.sortableTable">\n <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n <td md-cell class="handle" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical" class="s16"></md-icon>\n </td>\n <td md-cell>\n <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n </td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n <td md-cell class="actions" ng-if="vm_rf.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report, vm.crudPermissions)">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n </div>\n <form name="conditionsForm" novalidate>\n <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.previewReport()">\n <md-tab-label>\n <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.queryReport()">\n <md-tab-label>\n <span>Query</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <div ng-if="!vm.error">\n {{vm.queryResult}}\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedReports.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-reports-count">\n <span>{{vm.selectedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div layout="column" flex="30">\n <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n \x3c!-- SEARCH --\x3e\n <div layout="row" layout-align="start center">\n <label for="searchFolder" class="m-0">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n <div flex></div>\n <ms-search-bar on-search="vm.getReports()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n Copy Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n Preview Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n Run Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n Download Json Report\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete && vm.currentNode.custom">\n </md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom">\n <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n Edit Report\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom">\n <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.export.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.FORMAT">FORMAT</label>\n <md-select name="format" ng-model="vm.export.output" required>\n <md-option value="csv">CSV</md-option>\n <md-option value="xlsx">Excel (XLSX)</md-option>\n <md-option value="pdf">PDF</md-option>\n <md-option value="web">Web</md-option>\n </md-select>\n <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="maxDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="minDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n </div>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startTime">\n <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endTime">\n <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n RUN REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.WEB_REPORT">Web Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n <form name="odbcForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n\n <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DSN">DSN</label>\n <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n\n <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.odbc.description">\n\n <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n ADD ODBC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-odbcs-count">\n <span>{{vm.selectedODBC.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- ODBC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.odbcs.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(odbc, $event )" translate="CALLYSQUARE.EDIT_ODBC">\n Edit Odbc\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestOdbc(odbc, $event )" translate="CALLYSQUARE.TEST_ODBC">\n Test Odbc\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(odbc, $event )" translate="CALLYSQUARE.DELETE_ODBC">\n Delete Odbc\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ODBC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ODBC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title | translate}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.openFromEditor" class="md-block">\n \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">\n <form name="dialogForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_cloud_tts_text_type|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type|languageCode|ssmlGender|method|dialogflowV2_language" ng-required="attribute.required">\n <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START NUMBER INPUT --\x3e\n <div ng-switch-when="timeout">\n <div ng-switch="vm.cellName">\n <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="restapi" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n </div>\n </div>\n <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n \x3c!-- END NUMBER INPUT --\x3e\n\n \x3c!-- START TEXTAREA INPUT --\x3e\n <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text|custom_action_data|headers|body|rawHeaders|rawBody|private_key" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n \x3c!-- END TEXTAREA INPUT --\x3e\n\n \x3c!-- START URL INPUT --\x3e\n <input ng-switch-when-separator="|" ng-switch-when="ndauth_url|ndassistant_url|url" type="url" name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n \x3c!-- END URL INPUT --\x3e\n\n \x3c!-- START TEXT INPUT --\x3e\n <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit">\n <div class=\'hint\' ng-if="attribute.name === \'text\' && vm.cellName === \'tts\' ">\n <span translate="CALLYSQUARE.HELP.MAX_TEXT_TTS" class="ng-scope">Max 250 chars are supported</span>\n </div>\n \x3c!-- END TEXT INPUT--\x3e\n\n <div class="hint" ng-if="attribute.help">\n <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n </div>\n <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="vm.crudPermissions.canEdit">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="editForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label>XML</label>\n <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n CLOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="descriptionFrom" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description" md-autofocus>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NOTES">Description</label>\n <textarea name="notes" ng-model="vm.project.notes"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="openForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.PROJECT">Project</label>\n <md-select name="id" ng-model="vm.id" required>\n <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n </md-select>\n <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n OPEN\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="newForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus>\n <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n COPY\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/cprojects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}} {{vm.project.name}}\n </div>\n <div class="subtitle secondary-text text-truncate">\n <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-if="vm.crudPermissions.canEdit" ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content class="callysquare-content">\n\n <div id="geEditor" class="geEditor"></div>\n\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-if="vm.crudPermissions.canEdit" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n <form name="squareRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.FILENAME">Filename</label>\n <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n\n <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n ADD SQUARERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-squareRecordings-count">\n <span>{{vm.selectedSquareRecordings.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SQUARERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n <th md-column>{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.squareRecordings.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n <td md-cell class="audio " ng-switch="squareRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadCallySquareRecordings">\n\n <md-button ng-click="vm.downloadfile2(squareRecording, $event , \'square/recordings\' )" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n Download SquareRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(squareRecording, $event )" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n Delete SquareRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SQUARERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatQueues-count">\n <span>{{vm.selectedChatQueues.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CHATQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(chatQueue, $event )" translate="CHAT.EDIT_CHATQUEUE">\n Edit ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(chatQueue, $event )" translate="CHAT.TEAMADD_CHATQUEUE">\n teamadd ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(chatQueue, $event )" translate="CHAT.AGENTADD_CHATQUEUE">\n agentadd ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(chatQueue, $event )" translate="CHAT.DELETE_CHATQUEUE">\n Delete ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event )" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n goToRealtime ChatQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n <form name="chatQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n\n <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n ADD CHATQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatQueue-image" hide-xs>\n <img ng-src="assets/images/business/chatQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatQueue.id}}\n <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatWebsites-count">\n <span>{{vm.selectedChatWebsites.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHAT.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CHATWEBSITE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatWebsites.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(chatWebsite, $event )" translate="CHAT.EDIT_CHATWEBSITE">\n Edit ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(chatWebsite, $event )" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n Interactions ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event )" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n OfflineMessages ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(chatWebsite, $event )" translate="CHAT.AGENTADD_CHATWEBSITE">\n AgentAdd ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(chatWebsite, $event )" translate="CHAT.DELETE_CHATWEBSITE">\n Delete ChatWebsite\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATWEBSITE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n\n <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n\n <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n ADD CHATWEBSITE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",'<md-dialog class="chatWebsite-dialog" aria-label="chatWebsite" ng-init="vm.onInit()">\n <form name="chatWebsiteForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATWEBSITE">Add Agent to chatWebsite</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/amazonlex/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'accesskeyid\'].$error" ng-show="chatWebsiteFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'secretaccesskey\'].$error" ng-show="chatWebsiteFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'lexregion\'].$error" ng-show="chatWebsiteFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'botname\'].$error" ng-show="chatWebsiteFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflow/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'key\'].$error" ng-show="chatWebsiteFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'projectId\'].$error" ng-show="chatWebsiteFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'clientEmail\'].$error" ng-show="chatWebsiteFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'privateKey\'].$error" ng-show="chatWebsiteFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tag/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'tag\'].$error" ng-show="chatWebsiteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tvox/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.SERVICEID">serviceid</label>\n <input type="text" name="serviceid" ng-model="vm.tvox.serviceid" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'serviceid\'].$error" ng-show="chatWebsiteFormApp[\'serviceid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SERVICEID_REQUIRED">serviceid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CHANNELID">channelid</label>\n <input type="text" name="channelid" ng-model="vm.tvox.channelid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'channelid\'].$error" ng-show="chatWebsiteFormApp[\'channelid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CHANNELID_REQUIRED">channelid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXURL">tvoxurl</label>\n <input type="text" name="tvoxurl" ng-model="vm.tvox.tvoxurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXURL_REQUIRED">tvoxurl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXLOGINURL">tvoxloginurl</label>\n <input type="text" name="tvoxloginurl" ng-model="vm.tvox.tvoxloginurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxloginurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxloginurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXLOGINURL_REQUIRED">tvoxloginurl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXSESSIONURL">tvoxsessionurl</label>\n <input type="text" name="tvoxsessionurl" ng-model="vm.tvox.tvoxsessionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxsessionurl\'].$error" ng-show="chatWebsiteFormApp[\'tvoxsessionurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXSESSIONURL_REQUIRED">tvoxsessionurl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXUSERNAME">tvoxusername</label>\n <input type="text" name="tvoxusername" ng-model="vm.tvox.tvoxusername" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'tvoxusername\'].$error" ng-show="chatWebsiteFormApp[\'tvoxusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TVOXUSERNAME_REQUIRED">tvoxusername field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TVOXPASSWD">tvoxpasswd</label>\n <input type="password" name="tvoxpasswd" ng-model="vm.tvox.tvoxpasswd" placeholder="Password" translate translate-attr-placeholder="CHAT.PASSWORD">\n <div ng-messages="chatWebsiteFormApp[\'tvoxpasswd\'].$error" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONURLONRING">motionurlonring</label>\n <input type="text" name="motionurlonring" ng-model="vm.tvox.motionurlonring" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motionurlonring\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonring\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONURLONRING_REQUIRED">motionurlonring field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONURLONANSWER">motionurlonanswer</label>\n <input type="text" name="motionurlonanswer" ng-model="vm.tvox.motionurlonanswer" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motionurlonanswer\'].$error" ng-show="chatWebsiteFormApp[\'motionurlonanswer\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONURLONANSWER_REQUIRED">motionurlonanswer field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONTITLE">motiontitle</label>\n <input type="text" name="motiontitle" ng-model="vm.tvox.motiontitle" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motiontitle\'].$error" ng-show="chatWebsiteFormApp[\'motiontitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONTITLE_REQUIRED">motiontitle field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONURL">motionurl</label>\n <input type="text" name="motionurl" ng-model="vm.tvox.motionurl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'motionurl\'].$error" ng-show="chatWebsiteFormApp[\'motionurl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONURL_REQUIRED">motionurl field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n\n <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n ADD CHATCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-content flex layout-padding>\n <pre ng-if="vm.isHtml">{{vm.message.body}}</pre>\n <div ng-if="!vm.isHtml" ng-bind-html-unsafe="vm.message.body"></div>\n\n <span ng-repeat="attachment in vm.attachments">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.download(attachment)">\n <md-icon class="no-margin material-icons" aria-label="Attachment">attach_file</md-icon>\n </md-button>\n <span>{{attachment.name}}</span><br />\n </span>\n </md-content>\n\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n\n <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TYPE">Type</label>\n <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }} </md-option>\n\n <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n <label translate="CHAT.SELECTOR">Selector</label>\n <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n ADD CHATPROACTIVEACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatWebsite-image" hide-xs>\n <img ng-src="assets/images/business/chatWebsites.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatWebsite.id}}\n <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatWebsite, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATWEBSITE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatWebsite()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (dispositionForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (customerAvatarForm.$invalid) || (systemAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (vidaooForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.chatWebsite.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.queueTransfer == true" class="md-block">\n <label translate="CHAT.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.chatWebsite.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentTransfer == true" class="md-block">\n <label translate="CHAT.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.chatWebsite.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n <form name="scriptForm" flex="100" novalidate>\n <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n <div>\n <pre style="font-size: 13px;">\n {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n </pre>\n </div>\n <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n </md-input-container>\n\n </div>\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n </div>\n <form name="intervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEZONE">Timezone</label>\n <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span></div>\n <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.mandatoryDisposition" class="md-block">\n <label translate="CHAT.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.chatWebsite.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SNIPPET">SNIPPET</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n </div>\n <form name="appearanceForm" novalidate>\n <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textButtonColor" label="{{\'CHAT.TEXT_BUTTON_COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.backgroundColor" label="{{\'CHAT.BACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="CHAT.FONTSIZE">fontSize</label>\n <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADERSHAPE">headershape</label>\n <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }} </md-option>\n\n <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showCustomerAvatar" aria-label="showCustomerAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWCUSTOMERAVATAR">showCustomerAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SNIPPETSWIPEOUT">snippetSwipeOut</label>\n <md-select name="alignment" ng-model="vm.chatWebsite.alignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'bottom_right\'"> {{ \'CHAT.BOTTOM_RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'right\'"> {{ \'CHAT.RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'left\'"> {{ \'CHAT.LEFT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'alignment\'].$error" ng-show="appearanceForm[\'alignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SNIPPETSWIPEOUT_REQUIRED">snippetSwipeOut field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.alignment !== \'bottom_right\'" class="md-block">\n <label translate="CHAT.VERTICALPOSITION">verticalPosition</label>\n <input type="number" name="verticalAlignment" ng-model="vm.chatWebsite.verticalAlignment" min="0" max="100" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.VERTICALPOSITION"></span></div>\n <div ng-messages="appearanceForm[\'verticalAlignment\'].$error" ng-show="appearanceForm[\'verticalAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_REQUIRED">verticalPosition field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>100</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.chatWebsite.messagesAlignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'alternate\'"> {{ \'CHAT.ALTERNATE\' | translate }} </md-option>\n\n <md-option ng-value="\'centered\'"> {{ \'CHAT.CENTERED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'messagesAlignment\'].$error" ng-show="appearanceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DEFAULTTITLE">defaultTitle</label>\n <input type="text" name="defaultTitle" ng-model="vm.chatWebsite.defaultTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'defaultTitle\'].$error" ng-show="appearanceForm[\'defaultTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_REQUIRED">defaultTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>defaultTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LABELTEXT">labelText</label>\n <input type="text" name="labelText" ng-model="vm.chatWebsite.labelText" md-maxlength="6" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'labelText\'].$error" ng-show="appearanceForm[\'labelText\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LABELTEXT_REQUIRED">labelText field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.LABELTEXT_MAX_LENGTH" translate-values=\'{max: 6}\'>labelText\n must have a maximum length equal to 6</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n </div>\n <form name="onlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_ONLINE">header_online</label>\n <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n </div>\n <form name="offlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n </div>\n <form name="closingformForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n <label translate="CHAT.RATINGTYPE">ratingType</label>\n <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'star\'">Star</md-option>\n <md-option ng-value="\'thumb\'">Thumb</md-option>\n </md-select>\n <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableFeedback" class="md-block">\n <label translate="CHAT.FEEDBACKTITLE">feedbackTitle</label>\n <input type="text" name="feedbackTitle" ng-model="vm.chatWebsite.feedbackTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'feedbackTitle\'].$error" ng-show="closingformForm[\'feedbackTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FEEDBACKTITLE_REQUIRED">feedbackTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FEEDBACKTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>feedbackTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n </div>\n <form name="unmanagedstatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.NOTETITLE">noteTitle</label>\n <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'noteTitle\'].$error" ng-show="unmanagedstatusForm[\'noteTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n </div>\n <form name="interactionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CUSTOMERALIAS">customerAlias</label>\n <input type="text" name="customerAlias" ng-model="vm.chatWebsite.customerAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'customerAlias\'].$error" ng-show="interactionForm[\'customerAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_REQUIRED">customerAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>customerAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGEFONTSIZE">messageFontSize</label>\n <input type="number" name="messageFontSize" ng-model="vm.chatWebsite.messageFontSize" min="0" max="20" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'messageFontSize\'].$error" ng-show="interactionForm[\'messageFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_REQUIRED">messageFontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>20</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableSendButton" aria-label="enableSendButton" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLESENDBUTTON">enableSendButton</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerCheckmarks" aria-label="enableCustomerCheckmarks" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERCHECKMARKS">enableCustomerCheckmarks</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SYSTEMALIAS">systemAlias</label>\n <input type="text" name="systemAlias" ng-model="vm.chatWebsite.systemAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'systemAlias\'].$error" ng-show="interactionForm[\'systemAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_REQUIRED">systemAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>systemAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n </div>\n <form name="whitelabelForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DEFAULT">default</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n <label translate="CHAT.WHITELABEL">whiteLabel</label>\n <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n </div>\n <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n </div>\n <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="agentAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{agentAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container customeravatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CUSTOMERAVATAR">CUSTOMERAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitecustomerAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="customerAvatarimage in vm_ca.chatWebsite.images" ng-switch="customerAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{customerAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="customerAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{customerAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container systemavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SYSTEMAVATAR">SYSTEMAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitesystemAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="systemAvatarimage in vm_ca.chatWebsite.images" ng-switch="systemAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{systemAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="systemAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{systemAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ONLINE">ONLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="onlineForm" novalidate>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select ng-model="item.variable">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINE">OFFLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="offlineForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n <div ng-message="email">\n <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.openNewInteraction" aria-label="openNewInteraction">\n <span translate="CHAT.OPEN_NEW_INTERACTION">openNewInteraction</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction">\n <label translate="CHAT.EMAIL_ACCOUNT">Email account</label>\n <md-select ng-model="vm_fonc.chatWebsite.MailAccountId" required>\n <md-option ng-repeat="account in vm_fonc.email_accounts" ng-value="account.id">{{ account.name }}</md-option>\n </md-select>\n <div ng-messages="offlineForm[\'MailAccountId\'].$error" ng-show="offlineForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.EMAIL_ACCOUNT_REQUIRED">Email account field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.openNewInteraction && vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.SUBJECT">Subject</label>\n <md-select ng-model="vm_fonc.chatWebsite.subjectOffline" md-selected-text="vm_fonc.chatWebsite.subjectOffline != null ? vm_fonc.chatWebsite.subjectOffline : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="item.props.title">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n <md-input-container class="md-block" ng-if="item.type != \'upload\'">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteProactiveActions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column md-order-by="name">\n {{ \'CHAT.NAME\' | translate }}\n </th>\n <th md-column md-order-by="type">\n {{ \'CHAT.TYPE\' | translate }}\n </th>\n <th md-column md-order-by="selector">\n {{ \'CHAT.SELECTOR\' | translate }}\n </th>\n <th md-column md-order-by="timeout">\n {{ \'CHAT.TIMEOUT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.id}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.name}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}\n </td>\n\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.selector}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{chatProactiveAction.timeout}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>\n {{ chatProactiveAction.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n Edit ChatProactiveAction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n Delete ChatProactiveAction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="ChatWebsiteDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add chat dispositions" translate translate-attr-label="CHAT.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteChatCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'CHAT.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'CHAT.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'CHAT.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{chatCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>\n {{ chatCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n Edit ChatCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n Delete ChatCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.VIDEO">VIDEO</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container vidaoo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.VIDAOO">VIDAOO</div>\n </div>\n <form name="vidaooForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.vidaooEscalation" aria-label="vidaooEscalation" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.VIDAOOESCALATION">vidaooEscalation</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOOAPIKEY">vidaooApiKey</label>\n <input type="text" name="vidaooApiKey" ng-model="vm.chatWebsite.vidaooApiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="vidaooForm[\'vidaooApiKey\'].$error" ng-show="vidaooForm[\'vidaooApiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VIDAOOAPIKEY_REQUIRED">vidaooApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOOTOPIC">vidaooTopic</label>\n <input type="text" name="vidaooTopic" ng-model="vm.chatWebsite.vidaooTopic" value="Generated by XCALLY Motion" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="vidaooForm[\'vidaooTopic\'].$error" ng-show="vidaooForm[\'vidaooTopic\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VIDAOOTOPIC_REQUIRED">vidaooTopic field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOONOTE">vidaooNote</label>\n <input type="text" name="vidaooNote" ng-model="vm.chatWebsite.vidaooNote" value="Meeting generated for interaction #{{interaction.id}} by {{agent.name}}" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="vidaooForm[\'vidaooNote\'].$error" ng-show="vidaooForm[\'vidaooNote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VIDAOONOTE_REQUIRED">vidaooNote field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.vidaooEscalation == true" class="md-block">\n <label translate="CHAT.VIDAOOMETADATA">vidaooMetadata</label>\n <textarea name="vidaooMetadata" ng-model="vm.chatWebsite.vidaooMetadata"></textarea>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="CHAT.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getChatWebsiteInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'CHAT.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'CHAT.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'CHAT.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'CHAT.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'CHAT.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'CHAT.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'CHAT.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n <ms-search-bar on-search="vm_dc.getChatWebsiteOfflineMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CHAT.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column>\n {{ \'CHAT.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'CHAT.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n <td md-cell>\n {{offlineMessage.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="offlineMessage.Attachments.length > 0">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n {{offlineMessage.Contact.firstName}}\n </td>\n <td md-cell>\n {{ offlineMessage.createdAt | formatdate }}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n SHOW OfflineMessage\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n Delete OfflineMessage\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-companies-count">\n <span>{{vm.selectedCompanies.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- COMPANY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.companies.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(company, $event )" translate="CONTACTMANAGER.EDIT_COMPANY">\n Edit Company\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotocontactsgoto(company, $event )" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n goToContacts Company\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(company, $event )" translate="CONTACTMANAGER.DELETE_COMPANY">\n Delete Company\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / COMPANY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD COMPANY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n <form name="companyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n\n <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n\n <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n\n <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n\n <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n\n <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n\n <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n\n <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n\n <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n\n <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n\n <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n ADD COMPANY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="company-image" hide-xs>\n <img ng-src="assets/images/business/companies.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.company.id}}\n <span ng-if="vm.company.name">{{vm.company.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCompany()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n </div>\n <form name="addressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.company.street" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="postalCode" ng-model="vm.company.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.company.city" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.company.country" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n </div>\n <form name="shipmentAddressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="sCity" ng-model="vm.company.sCity" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="sCountry" ng-model="vm.company.sCountry" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-contacts-count">\n <span>{{vm.selectedContacts.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []">\n <md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n <md-select placeholder="Select a list" ng-model="vm.selectedList" ng-disabled="vm.lists.count === 0">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n <md-select placeholder="Select a company" flex="100" ng-model="vm.selectedCompany" ng-disabled="vm.companies.count === 0">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.ALL">All</em></md-option>\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n <md-select multiple placeholder="Select one or more tags" flex="100" ng-model="vm.query.tag" ng-change="vm.getContacts()">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n\n \x3c!-- USER TABLE --\x3e\n <md-card flex="80">\n <md-table-container ng-init="vm.getAssignedCompanies()">\n <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'CONTACTMANAGER.CREATED_AT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="phone" privacy ng-cloak>{{contact.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="createdAt">{{contact.createdAt | date:\'medium\'}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete">\n </md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n Delete Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-fab-speed-dial id="add-contact-button" ng-if="vm.crudPermissions.canEdit" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-accent">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button class="md-fab md-mini md-primary" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContactsUpdates($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.UPDATES_EXISTING_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.UPDATE_EXISTING_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus privacy="!vm.crudPermissions.canEdit" ng-cloak>\n\n <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n <input name="lastName" ng-model="vm.contact.lastName" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input name="phone" ng-model="vm.contact.phone" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input name="email" type="email" ng-model="vm.contact.email" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <input name="mobile" ng-model="vm.contact.mobile" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input name="fax" ng-model="vm.contact.fax" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" flex-gt-sm="">\n <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="100">\n <div class="pb-16" layout="column" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n </div>\n <form flex name="additionalPhonesForm" novalidate>\n <div ng-repeat="additionalPhone in vm.additionalItems">\n <div layout="row" flex="1">\n <md-input-container class="md-block" flex="50">\n <label>{{$index}} - {{additionalPhone.phone}}</label>\n <md-select ng-model="vm.additionalItemTypes[$index]" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" flex="50">\n <input ng-model="additionalPhone.description" ng-cloak>\n </md-input-container>\n </div>\n </div>\n </form>\n </div>\n\n <md-input-container>\n <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone"></ms-timezone>\n </md-input-container>\n\n <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n <div ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div>\n \x3c!-- ng-model="customField.value" --\x3e\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-time-picker>\n </div>\n </div>\n\n <div ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </div>\n\n <div ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </div>\n\n <md-input-container ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-hide="!vm.contact.CompanyId && company.canSelect === false" ng-disabled="company.canSelect === false">\n {{company.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All\n Fields</md-button>\n </div>\n\n <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth">\n </mdp-date-picker>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.contact.country">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.NOTES">Notes</label>\n <input type="text" name="description" ng-model="vm.contact.description">\n </md-input-container>\n\n <div ng-if="vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer\n Fields</md-button>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="contact-image" hide-xs>\n <img ng-src="assets/images/business/contacts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <div ng-repeat="channel in vm_contact_qa.channels">\n <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n {{channel.name}}\n </md-tooltip>\n <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n </md-button>\n </div>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n <md-icon md-font-icon="icon-file-multiple"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine && socialForm.$pristine && additionalPhonesForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div layout="column" flex="70">\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO\n </div>\n </div>\n <form name="detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- phone --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- mobile --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- email --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail\n address</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- fax --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax" ng-disabled="!vm.crudPermissions.canEdit" privacy="!vm.crudPermissions.canEdit" ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.ADDITIONAL_PHONES">Additional Phones</label>\n <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth" mdp-disabled="!vm.crudPermissions.canEdit"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-disabled="company.canSelect === false">{{company.name}}</md-option>\n <md-option ng-value=" null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n </md-input-container>\n <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-briefcase"></md-icon>\n <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n </section>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.Tags" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Tags">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-tag"></md-icon>\n <label translate="CONTACTMANAGER.NO_TAG">No Tags</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n </section>\n </div>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <div ng-if="vm.allFields">\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- country --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- city --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div flex="5"></div>\n \x3c!-- street --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- postalCode --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n </md-input-container>\n </div>\n\n <div layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n </md-button>\n </div>\n\n </div>\n </form>\n </md-card>\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n </div>\n <form name="socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n\n <div flex></div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS\n </div>\n </div>\n <form name="customFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n </md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}\n </md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n </form>\n </div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n </div>\n <form name="additionalPhonesForm" novalidate>\n <div ng-repeat="additionalPhone in vm.additionalItems">\n <div layout="row">\n <md-button class="md-icon-button" ng-show="!$first" ng-click="vm.moveUp($index)">\n <md-tooltip>{{\'CONTACTMANAGER.MOVE_UP\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-arrow-up"></md-icon>\n </md-button>\n <md-button class="md-icon-button md-primary" ng-show="!$last" ng-click="vm.moveDown($index)">\n <md-tooltip>{{\'CONTACTMANAGER.MOVE_DOWN\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-arrow-down"></md-icon>\n </md-button>\n </div>\n <div layout="column" style="margin-bottom:5px;border-bottom: 1px solid gray;">\n <md-input-container class="md-block">\n <label>{{$index}} - {{additionalPhone.phone}}</label>\n <md-select ng-model="additionalPhone.ItemTypeId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <input ng-model="additionalPhone.description" ng-cloak>\n </md-input-container>\n </div>\n </div>\n </form>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.dialer">\n <md-tab-label>\n <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'CONTACTMANAGER.RECALLME\' | translate }}</th>\n <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.hoppers.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n <td md-cell>{{hopper.id}}</td>\n <td md-cell privacy ng-cloak>{{hopper.phone}}</td>\n <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell>{{hopper.VoiceQueueId}}</td>\n <td md-cell>{{hopper.CampaignId}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.crudPermissions.canDelete && vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.finals.count">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n <td md-cell>{{final.uniqueid}}</td>\n <td md-cell privacy ng-cloak>{{final.calleridnum}}</td>\n <td md-cell>{{final.statedesc}}</td>\n <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n <td md-cell>{{final.disposition}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.histories.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n <td md-cell>{{history.uniqueid}}</td>\n <td md-cell privacy ng-cloak>{{history.calleridnum}}</td>\n <td md-cell>{{history.statedesc}}</td>\n <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.jscripty">\n <md-tab-label>\n <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n\n \x3c!-- SESSION TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.jscriptySessions.count">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.projectname}}</td>\n <td md-cell class="actions"></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / SESSION TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n </md-tab-label>\n\n <md-tab-body>\n <md-content class="md-padding" id="journey-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n <div class="form-title" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n <div layout="row" ng-repeat="additionalPhone in vm.contactItemTypes" flex>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select name="{{additionalPhone.key}}" ng-model="vm.binding[additionalPhone.key]" placeholder="{{additionalPhone.key}}" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select name="{{additionalPhone.key+\'_description\'}}" ng-model="vm.binding[additionalPhone.key+\'_description\']" placeholder="{{additionalPhone.key}} description" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/import/importUpdates.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.UPDATE_EXISTING_CONTACTS">Update Existing Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n <div class="form-title" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n <div layout="row" ng-repeat="additionalPhone in vm.contactItemTypes" flex>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select multiple="true" name="{{additionalPhone.key}}" ng-model="vm.binding[additionalPhone.key]" placeholder="{{additionalPhone.key}}" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-icon-float md-block" flex="50">\n <md-select multiple="true" name="{{additionalPhone.key+\'_description\'}}" ng-model="vm.binding[additionalPhone.key+\'_description\']" placeholder="{{additionalPhone.key}} description" ng-required="additionalPhone.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block" flex-gt-sm>\n <label>Filter</label>\n <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n </md-input-container>\n\n <md-list flex>\n <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n <div class="md-list-item-text" layout="column">\n <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n <h4>{{ contact.email }}</h4>\n <p>{{ contact.phone }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n\n <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.globalCustomField.type == \'text\'" class="md-block">\n <md-switch ng-model="vm.globalCustomField.clickToAction" aria-label="ClickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">ClickToAction</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.globalCustomField.clickToAction" class="md-block">\n <label translate="CONTACTMANAGER.ACTIONTYPE">ActionType</label>\n <md-select name="actionType" ng-model="vm.globalCustomField.actionType">\n <md-option ng-value="\'voice\'">Voice</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'actionType\'].$error" ng-show="globalCustomFieldForm[\'actionType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">ActionType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n ADD GLOBALCUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-globalCustomFields-count">\n <span>{{vm.selectedGlobalCustomFields.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(globalCustomField, $event )" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n Edit GlobalCustomField\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(globalCustomField, $event )" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n Delete GlobalCustomField\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n <form name="listForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n\n <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n\n <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n ADD LIST\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list" ng-init="vm.onInit()">\n <form name="listForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n <form name="customFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n\n <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.customField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.customField.type == \'text\'" class="md-block">\n <md-switch ng-model="vm.customField.clickToAction" aria-label="clickToAction"><span translate="CONTACTMANAGER.CLICKTOACTION">clickToAction</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.customField.clickToAction" class="md-block">\n <label translate="CONTACTMANAGER.ACTIONTYPE">actionType</label>\n <md-select name="actionType" ng-model="vm.customField.actionType">\n <md-option ng-value="\'voice\'">Voice</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'actionType\'].$error" ng-show="customFieldForm[\'actionType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED">actionType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n ADD CUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="list-image" hide-xs>\n <img ng-src="assets/images/business/lists.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.list.id}}\n <span ng-if="vm.list.name">{{vm.list.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-eye"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveList()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n <ms-search-bar on-search="vm_dc.getListCustomFields()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'CONTACTMANAGER.ID\' | translate }}\n </th>\n <th md-column md-order-by="alias">\n {{ \'CONTACTMANAGER.ALIAS\' | translate }}\n </th>\n <th md-column md-order-by="type">\n {{ \'CONTACTMANAGER.TYPE\' | translate }}\n </th>\n <th md-column md-order-by="required">\n {{ \'CONTACTMANAGER.REQUIRED\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n {{customField.id}}\n </td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n {{customField.alias}}\n </td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>\n {{ vm_dc.arraytype[customField.type].option }} </td>\n\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n Edit CustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n Delete CustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n <td md-cell colspan="9">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="ListDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add contactmanager dispositions" translate translate-attr-label="CONTACTMANAGER.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedLists.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-lists-count">\n <span>{{vm.selectedLists.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTMANAGER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="CONTACTMANAGER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- LIST TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.lists.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(list, $event )" translate="CONTACTMANAGER.EDIT_LIST">\n Edit List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotocontactsgoto(list, $event )" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n goToContacts List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadContactManagerLists">\n\n <md-button ng-click="vm.exportcsvcontactsexport(list, $event )" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n exportCsvContacts List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(list, $event )" translate="CONTACTMANAGER.AGENTADD_LIST">\n AgentAdd List\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(list, $event )" translate="CONTACTMANAGER.DELETE_LIST">\n Delete List\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / LIST TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD LIST BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n <md-content>\n <md-toolbar class="md-default md-accent filter-header">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.customDashboard.name}}</span>\n <div flex></div>\n <md-button ng-click="vm.setFilter($event)">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.FILTERS"></span></md-tooltip>\n <md-icon md-font-icon="icon-filter" ng-class=""></md-icon>\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n <md-icon md-font-icon="icon-table-edit"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/custom/filter/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Set Filter">\n <form name="FilterForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content style="padding:30px;">\n <div layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-phone"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n </div>\n <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'voice\')" ng-model="vm.parent.voiceQueuesSelected" multiple aria-label="voiceQueues">\n <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.parent.voiceQueues.rows">{{\n voiceQueue.name }}\n </md-option>\n </md-select>\n </div>\n <div layout="column">\n <div>\n <i class="icon s16 icon-hangouts"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_CHAT_WEBSITES">Filter Chat\n Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'chat\')" ng-model="vm.parent.chatWebsitesSelected" multiple aria-label="chatWebsite">\n <md-option ng-value="chatWebsite.id" ng-repeat="chatWebsite in vm.parent.chatWebsites.rows">{{\n chatWebsite.name }}</md-option>\n </md-select>\n </div>\n </div>\n <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-message-text"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_SMS_ACCOUNTS">Filter Sms Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'sms\')" ng-model="vm.parent.smsAccountsSelected" multiple aria-label="smsAccount">\n <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.parent.smsAccounts.rows">{{\n smsAccount.name }}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <div>\n <i class="icon s16 icon-deskphone"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_FAX_ACCOUNTS">Filter Fax Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'fax\')" ng-model="vm.parent.faxAccountsSelected" multiple aria-label="faxAccount">\n <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.parent.faxAccounts.rows">{{\n faxAccount.name }}</md-option>\n </md-select>\n </div>\n </div>\n <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-email"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_MAIL_ACCOUNTS">Filter Mail\n Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'mail\')" ng-model="vm.parent.mailAccountsSelected" multiple aria-label="mailAccount">\n <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.parent.mailAccounts.rows">{{\n mailAccount.name }}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <div>\n <i class="icon s16 icon-google-earth"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_OPENCHANNEL_ACCOUNTS">Filter Openchannel\n Websites</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'openchannel\')" ng-model="vm.parent.openchannelAccountsSelected" multiple aria-label="openchannelAccount">\n <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.parent.openchannelAccounts.rows">{{\n openchannelAccount.name }}</md-option>\n </md-select>\n </div>\n </div>\n <div class="margin-top-30" layout="row" flex layout-align="space-between" layout-fill>\n <div layout="column">\n <div>\n <i class="icon s16 icon-whatsapp"></i>\n <span class="font-size-12" translate="DASHBOARDS.FILTER_WHATSAPP_ACCOUNTS">Filter Whatsapp\n Accounts</span>\n </div>\n <md-select placeholder="Select one or more interaction" class="font-size-12 no-margin w-200" md-on-close="vm.parent.onChangeFilter(\'whatsapp\')" ng-model="vm.parent.whatsappAccountsSelected" multiple aria-label="whatsappAccount">\n <md-option ng-value="whatsappAccount.id" ng-repeat="whatsappAccount in vm.parent.whatsappAccounts.rows">\n {{whatsappAccount.name }}</md-option>\n </md-select>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.confirm()" class="send-button md-accent md-raised" aria-label="CONFIRM" translate="DASHBOARDS.CONFIRM" translate-attr-aria-label="DASHBOARDS.CONFIRM">\n CONFIRM\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n <div layout="row" layout-align="start center" class="md-primary-bg">\n <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n </md-button>\n\n <ms-tab-scroll style="overflow: hidden;">\n <div layout="column" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n <div style="height: 34px" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'">\n </md-icon>\n <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'">\n {{tab.title}}\n <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab); $event.stopPropagation()">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n </div>\n </ms-tab-scroll>\n </div>\n \x3c!-- home --\x3e\n <div layout="row" class="agent-content overflow-hidden" ng-if="vm.isActiveTab(0)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home" ng-init="vm_home.init(vm.license, vm.setting)"></div>\n \x3c!-- other tabs --\x3e\n <div ng-if="tab.id !== 0 && vm.isActiveTab(tab.id)" ng-repeat="(key, tab) in vm.tabs | orderByDate " ng-switch="tab.type" flex layout="column">\n <div ng-switch-when="contact" ng-class="{{tab.type}}" flex layout="column">\n <div class="agent-content" flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm" ng-init="vm.init(tab,$parent.vm.license)"></div>\n </div>\n <div ng-switch-when="popup" ng-class="{{tab.type}}" flex layout="column">\n <div flex layout="column" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="jscripty" ng-class="{{tab.type}}" flex layout="column">\n <div class="agent-content" ng-if="vm.isActiveTab(tab.id)" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="bot" ng-class="{{tab.type}}" flex layout="column">\n <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html\'" ng-controller="AgentGeneralBotController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n </div>\n <div ng-switch-when="interaction" ng-class="{{tab.type}}" flex layout="column">\n <div id="interaction-app" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'" ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n </div>\n </div>\n <div ng-switch-when="iframe" ng-class="{{tab.type}}" flex layout="column">\n <div id="iframe" flex layout="column" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html\'" ng-controller="AgentGeneralIframeController as vm" ng-init="vm.init(tab, $parent.vm.setting)">\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center">\n <div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent pink-fg" md-font-icon="fas fa-robot"></md-icon>\n </div>\n <span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n <span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n interaction...</span>\n </div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n <md-card flex="100" class="interaction">\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="fas fa-robot" class="s20 pink-fg"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.tab.data.uniqueid}} - {{vm.tab.title}}</span>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n\n </div>\n </div>\n </md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n <div class="interaction-messages">\n \x3c!-- MESSAGES --\x3e\n <div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\'" class="avatar" src="assets/images/avatars/robot.png">\n\n <div class="bubble" ng-switch="message.direction">\n <div>\n <div ng-switch-when="in" class="time secondary-text">\n {{vm.tab.title}} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n System - {{message.createdAt | date: \'medium\'}}\n </div>\n <div>\n <md-icon class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n </div>\n \x3c!-- / MESSAGES --\x3e\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n </md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.DETAIL">Detail</span>\n </md-tab-label>\n <md-tab-body>\n <md-content>\n <div layout="row" class="pr-10">\n <div layout="row" flex="75" class="flex-scrollable only-x">\n <md-card ng-repeat="call in vm.tab.calls track by call.uniqueid" class="call-info-card">\n <md-progress-linear md-mode="indeterminate" ng-if="vm.checkingCallStatus"></md-progress-linear>\n <md-card-header layout="row" layout-align="space-between">\n <span ng-if="call.answertime" class="text-boxed indigo-100-bg ml-0">\n <timer start-time="call.answertime"></timer>\n <md-tooltip md-direction="bottom">\n {{ \'DASHBOARDS.ELAPSED_ANSWERED\' | translate }}\n </md-tooltip>\n </span>\n <span ng-if="call.disposedAt" class="text-boxed amber-200-bg">\n <timer start-time="call.disposedAt"></timer>\n <md-tooltip md-direction="bottom">\n {{ \'DASHBOARDS.ELAPSED_DISPOSED\' | translate }}\n </md-tooltip>\n </span>\n <md-button class="md-icon-button no-margin reload-button" ng-click="vm.checkCallStatus(call)" ng-disabled="vm.checkingCallStatus">\n <md-icon md-font-icon="icon-reload" class="s22"></md-icon>\n <md-tooltip md-direction="bottom">\n {{ \'DASHBOARDS.RELOAD\' | translate }}\n </md-tooltip>\n </md-button>\n </md-card-header>\n <md-divider></md-divider>\n <md-card-content>\n <div layout="column" layout-align="space-between start" class="word-break-all mr-16">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{ call.routeId ? \'icon-phone-outgoing\' : \'icon-phone-incoming\'}}" class="s20 mr-5">\n </md-icon>\n <span class="h2" privacy ng-cloak>{{ call.routeId ? call.destcalleridnum : call.calleridnum }}</span>\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n <md-icon md-font-icon="icon-account" class="s20"></md-icon>\n Name: <span privacy ng-cloak>{{ call.calleridname }}</span>\n <div ng-if="(vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum}).length>0">\n <span ng-style="{\'color\':(vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].color} ">\n {{ (vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].description }} -\n {{ (vm.additionalItems | filter : {\'phone\':call.routeId ? call.destcalleridnum : call.calleridnum})[0].type }}\n </span>\n </div>\n </div>\n\n <div class="text h4 pt-8" ng-if="call.queue">\n <md-icon md-font-icon="icon-stackoverflow" class="s20"></md-icon>\n Queue: {{call.queue}}\n </div>\n <div class="text h4 pt-8" ng-if="call.variables.extravar">\n <md-icon md-font-icon="icon-minus" class="s20"></md-icon>\n Extra: {{call.variables.extravar}}\n </div>\n </div>\n <div layout="row" layout-align="center end" class="mt-8">\n <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised mr-0 mv-0">\n {{ \'DASHBOARDS.DISPOSE\' | translate}}\n </md-button>\n </div>\n </md-card-content>\n </md-card>\n </div>\n <div flex="25" layout="row" layout-md="column" layout-sm="column" layout-align="end center" layout-align-md="center center">\n <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="merge">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n <md-icon md-font-icon="icon-source-fork"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="duplicate">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="add">\n {{ \'DASHBOARDS.ADD\'| translate }}\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="save">\n {{ \'DASHBOARDS.SAVE\' | translate }}\n </md-button>\n </div>\n </div>\n <div layout="row">\n <div layout="column" flex="75">\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">\n PERSONAL_INFO</div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span>\n <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n\n <form name="vm.detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required privacy ng-cloak>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name\n field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event); vm.getJscriptyProjects();" aria-label="jscripty">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingJscriptyProjects">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingJscriptyProjects && vm.jscriptyProjects.count > 0" ng-repeat="project in vm.jscriptyProjects.rows">\n <md-button ng-click="vm.addJscriptyTab(project, $event)">\n <md-icon md-font-icon="icon-script"></md-icon>\n {{project.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingJscriptyProjects && (!vm.jscriptyProjects || vm.jscriptyProjects.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" privacy ng-cloak>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" privacy ng-cloak>\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" privacy ng-cloak>\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event); vm.getAccounts(\'sms\')" aria-label="sms">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.smsAccounts.count > 0" ng-repeat="account in vm.smsAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.smsAccounts || vm.smsAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.whatsapp || !vm.hasPermission(114) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW WHATSAPP" ng-click="$mdOpenMenu($event); vm.getAccounts(\'whatsapp\')" aria-label="whatsapp">\n <md-icon md-font-icon="icon-whatsapp"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.whatsappAccounts.count > 0" ng-repeat="account in vm.whatsappAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Whatsapp\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-whatsapp"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.whatsappAccounts || vm.whatsappAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_WHATSAPP_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-whatsapp"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" privacy ng-cloak>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a\n valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event); vm.getAccounts(\'mail\')" aria-label="email">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.mailAccounts.count > 0" ng-repeat="account in vm.mailAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n <md-icon md-font-icon="icon-email"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.mailAccounts || vm.mailAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax" privacy ng-cloak>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event); vm.getAccounts(\'fax\')" aria-label="fax">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.loadingAccounts">\n <md-progress-circular class="md-accent margin-auto" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && vm.faxAccounts.count > 0" ng-repeat="account in vm.faxAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.loadingAccounts && (!vm.faxAccounts || vm.faxAccounts.count === 0)">\n <md-button disabled translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <md-chips ng-model="vm.additionalItems" md-transform-chip="vm.newPhone($chip)" placeholder="Phone numbers">\n <md-chip-template custom-chip alt="{{$chip.type}}" title="{{$chip.type}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.ADDITIONAL_PHONES">ADDITIONAL_PHONES</div>\n </div>\n <form name="additionalPhonesForm" novalidate>\n <div ng-repeat="additionalPhone in vm.additionalItems" layout="column">\n <md-input-container class="md-block">\n <label>{{$index}} - {{additionalPhone.phone}}</label>\n <md-select ng-model="vm.additionalItemTypes[$index]">\n <md-option ng-repeat="value in vm.contactItemTypes" ng-value="value.id">{{value.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <input ng-model="additionalPhone.description" ng-cloak>\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}\n </md-option>\n <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.TAG">TAG</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.tab.Tags" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tab.tags.rows">\n {{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n </form>\n </md-card>\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n <form name="vm.socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n <div flex="25" layout="column" layout-padding>\n <md-card flex="100" layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM\n FIELDS</div>\n <form name="vm.customFieldsForm" novalidate>\n\n \x3c!-- START INPUT LIST --\x3e\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select name="list" ng-disabled="!vm.newContact" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}\n </md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END INPUT LIST --\x3e\n\n <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]">\n </mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">\n {{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}<span ng-if="customField.required">*</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <div layout-gt-sm="row" class="layout-gt-sm-row"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n <ms-click-to-call ng-if="customField.clickToAction && customField.actionType === \'voice\'" target="vm.contact[\'cf_\' + customField.id]" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n </div>\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding" id="journey-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <form name="disposition" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.call.mandatoryDisposition">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div ng-if="!vm.isReschedule">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\')">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.availableCalls === 1">\n <md-switch ng-model="vm.autoClose" aria-label="Auto Close">\n <span translate="DASHBOARDS.AUTOCLOSE">Automatically close contact tab after disposal</span>\n </md-switch>\n </md-input-container>\n </div>\n <div ng-if="vm.isReschedule">\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-change="vm.recalcTZTime()" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.date.$error" ng-show="disposition.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.time.$error" ng-show="disposition.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n <div layout="row">\n <div flex class="md-block">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n </md-input-container>\n </div>\n <div flex class="md-block">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n <input type="text" readonly value="{{vm.hopper.scheduledAt}}">\n </md-input-container>\n </div>\n </div>\n <div ng-if="(!vm.dialer || (vm.dialer && vm.recallme && vm.user.selectRecallMeCampaign)) && vm.queueCampaigns.rows.length > 0" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.CAMPAIGN">Campaign</label>\n <md-select name="queueCampaign" ng-model="vm.queueCampaign" required>\n <md-option ng-value="queueCampaign" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <md-icon md-font-icon="icon-checkbox-blank-circle" ng-class="{\'green-fg\': queueCampaign.dialActive}" aria-label="Status">\n </md-icon>\n {{ queueCampaign.name }}\n </md-option>\n </md-select>\n <div ng-messages="disposition.queueCampaign.$error" ng-show="disposition.queueCampaign.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.CAMPAIGN_REQUIRED">Campaign field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()" ms-dialog-spinner>\n {{(vm.selectedDisposition.name ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n </md-button>\n <md-button class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n Reschedule\n </md-button>\n <md-button class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n Recall Me\n </md-button>\n <span flex></span>\n <md-button ng-if="vm.hasBlackLists" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n Blacklist\n </md-button>\n </md-dialog-actions>\n <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="disposition.$invalid || disposition.$pristine || vm.disable" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="dateTime" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/selection/dialog.html",'<md-dialog ng-init="vm.onInit()" class="contact-trigger-dialog" aria-label="Select contact" ng-cloak>\n <md-toolbar class="red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'DASHBOARDS.SELECT_CONTACT\' | translate }}</span>\n </div>\n </md-toolbar>\n <md-dialog-content class="h-400 pv-16">\n <div layout="row" class="p-10">\n <span class="font-size-16">{{ \'DASHBOARDS.MULTIPLE_CONTACTS_FOUND\' | translate }}<strong> {{ vm.callNumber }}</strong>.</span>\n <span class="font-size-16"> {{ \'DASHBOARDS.WHICH_ONE_TO_USE\' | translate }}</span>\n </div>\n <md-grid-list md-cols-xs="1" md-cols="2" md-row-height="fit" ng-class="vm.paginatedContacts[vm.page - 1].length > 2 ? \'two-rows-layout\' : \'one-row-layout\'" flex>\n <md-grid-tile ng-repeat="contact in vm.paginatedContacts[vm.page - 1]" md-rowspan="1">\n <md-card layout="column" class="contact-info" no-padding no-margin ng-click="vm.selectedContact = contact;" ng-class="{ \'light-blue-50-bg\' : vm.selectedContact && vm.selectedContact.id === contact.id }" flex>\n <md-card-title class="pt-16">\n <md-card-title-text layout-align="center start">\n <span class="font-size-16 text-bold">#{{ contact.id }} -\n <span privacy ng-cloak>{{ contact.firstName }} {{ contact.lastName }}</span>\n </span>\n <em class="font-size-12">{{ \'DASHBOARDS.LAST_UPDATED\' | translate }}: {{ contact.updatedAt }}</em>\n <span class="font-size-12">{{ \'DASHBOARDS.LIST\' | translate }}: {{ vm.lists[contact.ListId] }}</span>\n </md-card-title-text>\n <md-button class="md-icon-button no-margin" aria-label="Selected">\n <md-icon md-font-icon="{{ vm.selectedContact && vm.selectedContact.id === contact.id ? \'icon-checkbox-marked-circle\' : \'icon-checkbox-blank-circle-outline\' }}" ng-class="{ \'green-fg\': vm.selectedContact && vm.selectedContact.id === contact.id }"></md-icon>\n </md-button>\n </md-card-title>\n <md-divider></md-divider>\n <md-card-content layout="row" layout-align="center start" class="p-10">\n <span class="font-size-16">{{ \'DASHBOARDS.MATCHING_FIELD\' | translate }}:\n <strong privacy ng-cloak>{{ contact.matchingField }}</strong>\n </span>\n </md-card-content>\n </md-card>\n </md-grid-tile>\n </md-grid-list>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <div ng-if="vm.paginatedContacts.length > 1" layout="row" layout-align="center center" flex>\n <md-button ng-click="vm.page = vm.page - 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': vm.page <= 1 }" aria-label="Previous page">\n <md-icon md-font-icon="icon-chevron-double-left"></md-icon>\n </md-button>\n <span>{{ \'DASHBOARDS.PAGE\' | translate }} {{ vm.page }} {{ \'DASHBOARDS.OF\' | translate }}\n {{ vm.paginatedContacts.length }}</span>\n <md-button ng-click="vm.page = vm.page + 1;" class="md-icon-button no-margin" ng-class="{ \'hidden\': !vm.paginatedContacts[vm.page] }" aria-label="Next page">\n <md-icon md-font-icon="icon-chevron-double-right"></md-icon>\n </md-button>\n </div>\n <md-button ng-click="vm.selectContact()" class="select-button md-accent md-raised" ng-disabled="!vm.selectedContact" aria-label="Select" translate="DASHBOARDS.SELECT" translate-attr-aria-label="DASHBOARDS.SELECT">\n SELECT\n </md-button>\n </md-dialog-actions>\n</md-dialog>vc'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n <md-content ng-if="vm.selectedTab === 0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n <md-content ng-if="vm.selectedTab === 1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" ng-controller="AgentHomeAbandonedBullController as vm_bull">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_bull.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_bull.getAbandonedCalls()" query="vm_bull.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_bull.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_bull.quickFilters" query="vm_bull.query" search="vm_bull.getAbandonedCalls()"></ms-quick-filter>\n <md-button class="md-icon-button reload-list" ng-click="vm_bull.refresh && vm_bull.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">\n {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}\n </th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_bull.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_bull.currentUser.name">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_bull.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">\n {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">\n {{abandonedCall.queuecallerexitAt ? (abandonedCall.queuecallerexitAt | formatdate) : undefined }}\n </td>\n <td md-cell class="list">{{abandonedCall.queuecallerexitreason}}</td>\n <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_bull.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_bull.reserved(abandonedCall)">\n </md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-button ng-click="vm_bull.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.abandonedCalls.count}}" md-on-paginate="vm_bull.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <form name="disposition" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\',false)" required>\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\',false)">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition" ng-change="vm.onDispositionChange(\'third\',false)">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n'+" {{(vm.selectedDisposition.name ? 'DASHBOARDS.DISPOSE' : 'DASHBOARDS.SAVE') | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>"),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg" ng-class="{\'h-128\' : vm_voice.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_voice.getAbandonedCalls()" query="vm_voice.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm_voice.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_voice.quickFilters" query="vm_voice.query" search="vm_voice.getAbandonedCalls()"></ms-quick-filter>\n <md-button class="md-icon-button reload-list" ng-click="vm_voice.refresh && vm_voice.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">\n {{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="secondDisposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="thirdDisposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_voice.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_voice.currentUser.name">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_voice.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">\n {{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : (abandonedCall.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">{{ abandonedCall.disposition }}</td>\n <td md-cell class="list">{{ abandonedCall.secondDisposition }}</td>\n <td md-cell class="list">{{ abandonedCall.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_voice.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_voice.reserved(abandonedCall)">\n </md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-button ng-click="vm_voice.dispose(abandonedCall)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.abandonedCalls.count}}" md-on-paginate="vm_voice.getAbandonedCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="agent-general-home-navbar md-primary-bg width-50">\n <div ng-repeat="node in vm_home.navigation">\n <div ng-repeat="home in node.children">\n <md-button ng-repeat="button in home.children | orderBy:\'weight\'" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span>\n </md-tooltip>\n <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n<div class="agent-general-home-sections" layout="column" flex>\n <div layout="column" flex>\n <div ng-switch="vm_home.sidebar" style="overflow-y: auto; overflow-x: hidden" flex>\n <div ng-switch-when="agentPresence" class="home-agent-presence">\n <div ng-if="vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html\'" ng-controller="AgentHomePresenceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(115)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="contacts" class="home-contacts">\n <div ng-if="vm_home.hasPermission(102) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(102) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="mycontacts" class="home-mycontacts">\n <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="scheduled" class="home-scheduled">\n <div ng-if="vm_home.hasPermission(113) && vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html\'" ng-controller="AgentHomeScheduledCallsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(113) || !vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="voice" class="home-voice">\n <div ng-if="vm_home.hasPermission(110) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(110) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="abandoned" class="home-abandoned">\n <div ng-if="vm_home.hasPermission(111) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n <div ng-if="!vm_home.hasPermission(111) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="recordings" class="home-recordings">\n <div ng-if="vm_home.hasPermission(104) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(104) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="chat" class="home-chat">\n <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="mail" class="home-mail">\n <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="sms" class="home-sms">\n <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="openchannel" class="home-openchannel">\n <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="fax" class="home-fax">\n <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="whatsapp" class="home-whatsapp">\n <div ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html\'" ng-controller="AgentHomeWhatsappController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)">\n </div>\n <div ng-if="!vm_home.hasPermission(114) || !vm_home.license.whatsapp" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-when="plugin" class="home-plugin" layout-fill>\n <div ng-if="vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html\'" ng-controller="AgentHomePluginsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting, vm_home.plugin)" layout-fill></div>\n <div ng-if="!vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n <div ng-switch-default class="home-default">\n <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController as vm"></div>\n <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'">\n </div>\n </div>\n </div>\n </div>\n <div ng-if="(vm_home.draftManager.drafts | json) != \'{}\'" layout="column" class="draft-manager-bar">\n <ms-tab-scroll>\n <div layout="column" ng-repeat="(key, draft) in vm_home.draftManager.drafts" class="grey-50-bg" ng-click="vm_home.draftManager.open(draft.id)">\n <div class="draft-manager-tab" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-pencil" class="icon s16 margin-horizontal-5 black-fg"></md-icon>\n <span class="text-truncate font-size-12 black-fg">{{draft.title}}</span>\n <md-button class="md-icon-button md-mini no-margin md-primary" aria-label="close" ng-click="vm_home.draftManager.remove(draft.id)">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n </div>\n </ms-tab-scroll>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html",'<md-content layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHAT_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getChatInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getChatInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.WEBSITE\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, interaction)" md-cell class="chatAccount">\n {{ vm.getChatWebsiteLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showChatInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Chat\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n <md-button ng-click="vm.downloadChatInteraction($event, interaction, true)" translate="CHAT.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadChatInteraction($event, interaction)" translate="CHAT.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact()" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact(contact.id)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="firstName" privacy ng-cloak>{{contact.firstName}}\n {{contact.lastName}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="fax" privacy ng-cloak>{{contact.fax}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="email" privacy ng-cloak>{{contact.email}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="createdAt">{{contact.createdAt | formatdate}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact(contact.id)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="{{\'DASHBOARDS.MOTION_BULL\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(114) && vm_home.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html\'" ng-controller="AgentHomeDashboardMultiChannelWhatsappController as vm_whatsapp" class="md-padding">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select>\n </md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_chat.promise">\n <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_fax.promise">\n <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_mail.promise">\n <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_openchannel.promise">\n <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_sms.promise">\n <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell privacy ng-cloak>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select>\n </md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/whatsapp/agent.general.dashboard.whatsapp.html",'<div layout="row" ng-cloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_whatsapp.promise">\n <thead md-head md-order="vm_whatsapp.query.sort" md-on-reorder="vm_whatsapp.getWhatsappQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_whatsapp.getSize(vm_whatsapp.whatsappQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_whatsapp.whatsappQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_whatsapp.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_whatsapp.query.page" md-total="{{vm_whatsapp.whatsappQueuesTotal}}" md-on-paginate="vm_whatsapp.getWhatsappQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_whatsapp.getColorByChannel(\'whatsapp\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_whatsapp.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_whatsapp.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_whatsapp.queryChannels.limit" md-page="vm_whatsapp.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_whatsapp.paginatedInteractions.length}}" md-on-paginate="vm_whatsapp.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.FAX_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getFaxInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getFaxInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">\n {{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, interaction)" md-cell class="faxAccount">\n {{ vm.getFaxAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showFaxInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Fax\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadFaxInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n Download Fax\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.MAIL_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getMailInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getMailInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">\n {{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="subject">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <div ng-if="vm.setting.enableEmailPreview && interaction.lastMsgText" class="tooltip-preview" ng-mouseleave="vm.resetTooltipPosition($event)" ng-mouseenter="vm.adjustTooltipPosition($event)">\n <span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span>\n <md-card class="tooltip-preview-text">\n <md-card-content><span class="email-preview-message">{{ interaction.lastMsgText }}</span>\n </md-card-content>\n </md-card>\n </div>\n <span ng-if="!interaction.lastMsgText || !vm.setting.enableEmailPreview"><span class="text-truncate font-size-12 subject-text">{{ interaction.subject }}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, interaction)" md-cell class="mailAccount">\n {{ vm.getMailAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showMailInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Mail\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n <md-button ng-click="vm.downloadMailInteraction($event, interaction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadMailInteraction($event, interaction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n <ms-search-bar on-search="vm.getContacts()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getContacts()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n <md-button ng-if="vm.lists.rows && vm.lists.rows.length" class="md-icon-button create-new" ng-click="vm.openContact($event)" aria-label="Add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.CREATEDAT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName" privacy ng-cloak>\n {{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax" privacy ng-cloak>\n {{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email" privacy ng-cloak>{{contact.email}}\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="createdAt">{{contact.createdAt |\n formatdate}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">\n {{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.OPENCHANNEL_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getOpenchannelInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getOpenchannelInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.openchannelAccounts.rows && vm.openchannelAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeOpenchannelInteraction($event, openchannelAccount)" ng-disabled="!openchannelAccount.replyUri">\n {{ openchannelAccount.name }} ({{ openchannelAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, interaction)" md-cell class="openchannelAccount">\n {{ vm.getOpenchannelAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showOpenchannelInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Openchannel\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions && vm.user.downloadAttachments">\n <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadOpenchannelInteraction($event, interaction)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html",'<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/agent.general.presence.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab label="{{\'DASHBOARDS.AGENTS\' | translate}}" md-on-select="vm.onAgentsTabSelection()">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html\'">\n </md-content>\n </md-tab>\n <md-tab label="{{\'DASHBOARDS.QUEUES\' | translate}}" md-on-select="vm.onQueuesTabSelection()">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html\'">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.agents.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.AGENTS"></span>\n <ms-search-bar on-search="vm.getAgents()" query="vm.agentsQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.agentsQuery" search="vm.getAgents()"></ms-quick-filter>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getAgents()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.agentsQuery.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n <th md-column md-order-by="internal">{{\'VOICE.INTERNAL\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column class="no-padding width-70"></th>\n <th md-column class="width-70"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="agent in vm.agents.rows">\n <td md-cell>{{agent.id}}</td>\n <td md-cell>{{agent.name}}</td>\n <td md-cell>{{agent.internal}}</td>\n <td md-cell>\n <div layout="row">\n <div layout="column" layout-align="center center">\n <span class="text-boxed width-120 text-center md-background-bg bl bt padding-5" ng-class="{\'online\':\'lime-300-bg\',\'offline\':\'red-A200-bg\',\'pause\':\'amber-200-bg\',\'busy\':\'indigo-100-bg\'}[agent.status]">\n {{ \'VOICE.\' + (agent.status | uppercase) | translate | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-cell class="no-padding width-70">\n <md-button ng-if="agent.status !== \'offline\' && agent.status !== \'unavailable\'" ng-click="vm.originateCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n <td md-cell class="width-70">\n <md-button ng-if="agent.status !== \'offline\' && agent.status !== \'unavailable\'" ng-click="vm.transferCall(agent.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.agentsQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.agentsQuery.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/presence/views/agent.general.presence.queues.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header xenialab-violet-light-bg" ng-class="{\'h-128\' : vm.isSearchBarVisible === true}">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES"></span>\n <ms-search-bar on-search="vm.getVoiceQueues()" query="vm.queuesQuery" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.queuesQuery.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column md-order-by="id">{{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column md-order-by="name">{{\'DASHBOARDS.NAME\' | translate}}</th>\n <th md-column md-order-by="name">{{\'VOICE.CALLS\' | translate}}</th>\n <th md-column class="no-padding width-70"></th>\n <th md-column class="width-70"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="queue in vm.voiceQueues.rows">\n <td md-cell>{{queue.id}}</td>\n <td md-cell>{{queue.name}}</td>\n <td md-cell>{{queue.calls.length || 0}}</td>\n <td md-cell class="no-padding width-70">\n <md-button ng-click="vm.originateCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Dial">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s20">\n <md-tooltip><span translate="VOICE.DIAL"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n <td md-cell class="width-70">\n <md-button ng-click="vm.transferCall(queue.name)" class="md-fab md-mini md-raised" aria-label="Transfer">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s20">\n <md-tooltip><span translate="DASHBOARDS.TRANSFER"></span></md-tooltip>\n </md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.queuesQuery.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queuesQuery.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n <ms-search-bar on-search="vm.getVoiceRecordings()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()">\n </ms-quick-filter>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column width="10px" ng-if="vm.currentUser.downloadVoiceRecordings"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="{{ vm.currentUser.downloadVoiceRecordings ? 10 : 9}}">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell class="type">{{voiceRecording.type}}</td>\n <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n <td md-cell class="calleridnum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="exten">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="connectedlinenum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license">\n </ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="queue">{{voiceRecording.queue}}</td>\n <td md-cell class="rating">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio" ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions" ng-if="vm.currentUser.downloadVoiceRecordings">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\'">\n <md-button ng-click="vm.downloadtranscribe(voiceRecording, $event)" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n Download Transcribe\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-grey-bg" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScheduledCalls()">\n </ms-quick-filter>\n <md-button class="md-icon-button reload-list" ng-click="vm.getScheduledCalls()" aria-label="Refresh scheduled calls" translate translate-attr-label="MOTIONDIALER.REFRESH_SCHEDULED_CALLS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'MOTIONDIALER.REFRESH_SCHEDULED_CALLS\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduledCalls">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CAMPAIGN\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.scheduledCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="scheduledCall in vm.scheduledCalls.rows">\n <td md-cell privacy ng-cloak>{{scheduledCall.Contact.firstName}} {{scheduledCall.Contact.lastName}}</td>\n <td md-cell>\n <ms-click-to-call target="scheduledCall.phone" license="vm_home.license"></ms-click-to-call>\n </td>\n <td md-colors="{color: {{ vm.isDateBeforeToday(scheduledCall.scheduledat) ? \'\\\'red\\\'\' : \'\\\'green\\\'\' }}}" md-cell>{{ scheduledCall.scheduledat | date:\'medium\' }}</td>\n <td md-cell>{{ vm.priorities[scheduledCall.priority] }}</td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'icon-check\' : \'icon-close\' }}">\n </md-icon>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.Queue.dialActive? \'\\\'green\\\'\' : \'\\\'red\\\'\' }}}" md-font-icon="icon-checkbox-blank-circle"></md-icon> {{scheduledCall.Queue.name}}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditQueueCampaignHopper($event, scheduledCall)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteConfirm(scheduledCall, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.scheduledCalls.count}}" md-on-paginate="vm.getScheduledCalls" md-page-select>\n </md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.SMS_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getSmsInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getSmsInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">\n {{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, interaction)" md-cell class="smsAccount">\n {{ vm.getSmsAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showSmsInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Sms\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadSmsInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n Download Sms\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n <ms-search-bar on-search="vm.getVoiceCalls()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceCalls()">\n </ms-quick-filter>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n <tr md-row>\n <th md-column md-order-by="id">{{\'VOICE.ID\' | translate}}</th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n <td md-cell class="type">{{voiceCall.id}}</td>\n <td md-cell class="type">{{ \'VOICE.\' + voiceCall.type.toUpperCase() | translate}}</td>\n <td md-cell class="source">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="destination">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n <td md-cell class="disposition">{{ voiceCall.userDisposition}}</td>\n <td md-cell class="disposition">{{ voiceCall.userSecondDisposition}}</td>\n <td md-cell class="disposition">{{ voiceCall.userThirdDisposition}}</td>\n <td md-cell class="note">\n <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n Show Details\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.UNIQUEID">Uniqueid</p>\n <h4>{{vm.call.uniqueid}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.TYPE">Type</p>\n <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.SOURCE">Source</p>\n <h4 privacy ng-cloak>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DESTINATION">Destination</p>\n <h4 privacy ng-cloak>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.STARTEDAT">Started At</p>\n <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ANSWEREDAT">Answered At</p>\n <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ENDEDAT">Ended At</p>\n <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DURATION">Duration</p>\n <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DISPOSITION">Disposition</p>\n <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n <h4>{{vm.call.userSecondDisposition ? vm.call.userSecondDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n <h4>{{vm.call.userThirdDisposition ? vm.call.userThirdDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.NOTE">Note</p>\n <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/whatsapp/agent.general.whatsapp.html",'<md-card ng-cloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" ng-disabled="vm.searchInProgress">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WHATSAPP_INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.getWhatsappInteractions()" query="vm.query" debounce="300" direction="down" icon-color="white-fg" display-on="vm.isSearchBarVisible" ng-disabled="vm.query.search" min-chars="5">\n </ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getWhatsappInteractions()" ng-disabled="vm.query.search"></ms-quick-filter>\n <div layout="row">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini white-bg\': vm.query.search }" aria-label="Advanced search" translate translate-attr-aria-label="DASHBOARDS.ADVANCED_SEARCH" ng-click="vm.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'{{ vm.sectionColor }}-fg blink\': vm.query.search }"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.ADVANCED_SEARCH\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button reload-list" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getWhatsappInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'DASHBOARDS.RELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n <md-menu ng-if="vm.whatsappAccounts.rows && vm.whatsappAccounts.rows.length">\n <md-button class="md-icon-button create-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeWhatsappInteraction($event, whatsappAccount)">\n {{ whatsappAccount.name }} ({{ whatsappAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container class="interactions-list">\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappInteractions">\n <tr md-row>\n <th class="id-header" md-column md-order-by="id">\n {{\'DASHBOARDS.ID\' | translate}}</th>\n <th md-column class="no-padding width-5">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding width-5"></th>\n <th md-column class="no-padding width-5"></th>\n <th md-column md-order-by="contactName">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>\n {{\'DASHBOARDS.ACCOUNT\' | translate}}\n </th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.whatsappInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available\n Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="interaction in vm.whatsappInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{interaction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in interaction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : u.fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="!interaction.closed && interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg" ng-class="{{ \'vm.sectionColor\' }} + \'-bg\'" layout-margin>{{interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="width-5 no-padding">\n <div ng-if="interaction.attach" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'no-margin-bottom\' : interaction.contactInfo}" layout-margin privacy ng-cloak>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text no-margin-top" layout-margin privacy ng-cloak>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <span class="font-size-10 text-truncate">{{interaction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <div layout="row" ng-if="interaction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}">\n </md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n <span ng-if="!interaction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell>\n <span ng-if="interaction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="interaction.disposition">-\n {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}</span></span>\n <md-tooltip class="multiline" ng-if="interaction.closed">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n <span ng-if="!interaction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="interaction.substatus"> -\n {{interaction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="user">\n <span class="font-size-12 text-truncate width-80">{{ vm.getAgentLabel(interaction) }}</span>\n </td>\n <td ng-click="vm.showWhatsappInteraction($event, interaction)" md-cell class="whatsappAccount">\n {{ vm.getWhatsappAccountLabel(interaction) }}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <div layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">,\n </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions actions-padding">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showWhatsappInteraction($event, interaction)" translate="DASHBOARDS.SHOW">\n Show Whatsapp\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.user.downloadOmnichannelInteractions">\n <md-button ng-click="vm.downloadWhatsappInteraction($event, interaction)" translate="DASHBOARDS.DOWNLOAD">\n Download Whatsapp\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!interaction.closed">\n <md-button ng-click="vm.disposeInteraction($event, interaction)" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappInteractions.count}}" md-on-paginate="vm.getWhatsappInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/iframe/agent.general.iframe.html",'<md-content layout="row" layout-fill>\n\n <div flex layout="row">\n\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="width: 100%; height: 100%; border:0px;"></iframe>\n\n </div>\n\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n\n <md-card flex="75" class="interaction">\n\n <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n <div ng-repeat="u in vm.interaction.Users">\n <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }}\n </md-tooltip>\n </div>\n </md-content>\n\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'">\n </md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex layout-wrap>\n <div class="interaction-messages" ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'">\n </div>\n </div>\n <div ng-switch-default>\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'">\n </div>\n </div>\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- FOOTER --\x3e\n <div ng-if="\n !vm.interaction.closed && ( vm.tab.channel == \'chat\' \n || (vm.tab.channel == \'openchannel\' && vm.account.replyUri) \n || (vm.tab.channel == \'sms\' && !vm.tab.spy) \n || (vm.tab.channel == \'whatsapp\' && !vm.tab.spy) )\n && (vm.user.role !== \'admin\' && vm.user.role !== \'user\')" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'">\n </div>\n \x3c!-- / FOOTER--\x3e\n </md-card>\n\n <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'">\n </md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/chat/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="CHAT.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="CHAT.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="CHAT.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="CHAT.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'CHAT.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'CHAT.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.ChatAccountId" md-font-icon="icon-earth" aria-label="alert chat" class="s16"></md-icon>\n <md-icon ng-if="item.ChatAccountId" md-font-icon="icon-message-text" aria-label="alert chat" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="CHAT.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/fax/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="FAX.SEND">SEND</span>\n </md-button>\n <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block to">\n <label translate="FAX.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n </div>\n </md-input-container>\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/mail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-class="{\'mail-no-secret\': !vm.secret}" ng-cloak>\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar ng-class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n </button>\n <span class="white-fg secondary-text vertical-divider"></span>\n <md-menu>\n <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n </button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.subStatuses.rows.length">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n Send as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.send($event, false, subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n Send and Close\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <md-button ng-if="!vm.secret" class=" md-button md-raised blue-bg white-fg margin-horizontal-10" aria-label="Save draft" ng-click="vm.saveDraft()">\n <span>{{ (vm.isDraft ? \'DASHBOARDS.UPDATE_DRAFT\' : \'DASHBOARDS.SAVE_AS_DRAFT\') | translate | uppercase }}</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="MAIL.ADD_NOTE">Add note</span>\n </md-button>\n <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions" flow-file-success="vm.fileSuccess($file, $message)" flow-file-added="vm.fileAdded($file)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n <label translate="MAIL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.to)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n <div class="cc-bcc" layout="row" layout-align="start center">\n <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n <label translate="MAIL.CC">Cc</label>\n <md-chips name="cc" ng-model="vm.message.cc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.cc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n <label translate="MAIL.BCC">Bcc</label>\n <md-chips name="bcc" ng-model="vm.message.bcc" ng-keypress="vm.keyPress($event)" md-transform-chip="vm.transformContact($chip, vm.message.bcc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n <label translate="MAIL.SUBJECT">Subject</label>\n <input ng-model="vm.message.subject" type="text" ng-keypress="vm.keyPress($event)">\n </md-input-container>\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n <md-button ng-click="vm.removeAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="padding-top-5">\n <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n </div>\n <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin" ng-keypress="vm.keyPress($event)">\n <md-item-template>\n <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16">\n </md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{ item.key }} -\n {{ item.value | htmlToPlaintext }}</span>\n </md-item-template>\n <md-not-found>\n <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/openchannel/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="OPENCHANNEL.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="OPENCHANNEL.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="OPENCHANNEL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="OPENCHANNEL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mapkey" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'OPENCHANNEL.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'OPENCHANNEL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.OpenchannelAccountId" md-font-icon="icon-earth" aria-label="alert openchannel" class="s16"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-message-text" aria-label="alert openchannel" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n <md-not-found>\n <span translate="OPENCHANNEL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/sms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="SMS.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="SMS.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="SMS.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'SMS.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n <md-not-found>\n <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/compose/whatsapp/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="WHATSAPP.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="WHATSAPP.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="WHATSAPP.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="WHATSAPP.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'WHATSAPP.INSERT_MESSAGE_HERE\'" picker-position="\'bottom\'"></ms-emoji-area>\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'WHATSAPP.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.WhatsappAccountId" md-font-icon="icon-earth" aria-label="alert whatsapp" class="s16">\n </md-icon>\n <md-icon ng-if="item.WhatsappAccountId" md-font-icon="icon-message-text" aria-label="alert whatsapp" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n <md-not-found>\n <span translate="WHATSAPP.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition" ng-init="vm.onInit()">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" ng-if="!vm.mandatoryDisposition">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITION">Disposition</label>\n <md-select name="disposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onDispositionChange(\'first\')" required>\n <md-option ng-value="null" ng-if="!vm.mandatoryDisposition">NONE</md-option>\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition" ng-change="vm.onDispositionChange(\'second\')">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id } : true">\n {{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearDispositionSelection(\'second\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear second level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</label>\n <md-select name="thirdLevelDisposition" ng-model="vm.thirdLevelDisposition">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'third\', ParentId: vm.secondLevelDisposition.id } : true" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.thirdLevelDisposition" ng-click="vm.clearDispositionSelection(\'third\')" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear third level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && (vm.firstLevelDisposition || vm.secondLevelDisposition || vm.thirdLevelDisposition)" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n CLOSE AND DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.firstLevelDisposition" ng-disabled="vm.mandatoryDisposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n CLOSE WITHOUT DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition()" ms-dialog-spinner class="send-button md-accent md-raised" ng-if="vm.interaction.closed" ng-disabled="vm.mandatoryDisposition && !vm.firstLevelDisposition" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n DISPOSE\n </md-button>\n <div ng-if="vm.mandatoryDisposition">\n <md-icon md-font-icon="icon-information-outline" aria-label="Mandatory Disposition"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="DASHBOARDS.HELP.MANDATORY_DISPOSITION_ENABLED"></span>\n </div>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TAGS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name" placeholder="Search for a tag">\n <span md-highlight-text="vm.searchText">{{item.name}}</span>\n </md-autocomplete>\n <md-chip-template>\n <span>\n <strong>{{$chip.name}}</strong>\n </span>\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="transferForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TRANSFER"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.transfer.type">\n <md-option ng-value="\'queue\'" ng-if="vm.account.queueTransfer">Queue</md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.account.agentTransfer">Agent</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'queue\'">\n <label translate="DASHBOARDS.QUEUES">Queues</label>\n <md-select name="queue" ng-model="vm.transfer.id" required>\n <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.queue.$error" ng-show="transferForm.queue.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'agent\'">\n <label translate="DASHBOARDS.AGENTS">Agents</label>\n <md-select name="agent" ng-model="vm.transfer.id" required>\n <md-option ng-value="agent.id" ng-repeat="agent in vm.agents.rows">{{\n agent.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.agent.$error" ng-show="transferForm.agent.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.onTransfer(true)" ng-disabled="transferForm.$pristine" class="send-button md-accent md-raised" aria-label="DASHBOARDS.TRANSFER" translate="DASHBOARDS.TRANSFER" translate-attr-aria-label="DASHBOARDS.TRANSFER">\n TRANSFER\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align="center center" flex>\n <div layout="row" layout-align="center center" style="flex-grow: 1; align-self: stretch" flex>\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.tab.areaText" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n </md-button>\n\n <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n <md-item-template>\n <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.browserName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n <h4>{{ item.browserName }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.osName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n <h4>{{ item.osName }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.deviceModel">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n <h4>{{ item.deviceModel }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.referer">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.REFERER">Referer</p>\n <h4>{{ item.referer }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerIp">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_IP">Originating IP Address</p>\n <h4>{{ item.customerIp }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerPort">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_PORT">Originating TCP Port</p>\n <h4>{{ item.customerPort }}</h4>\n </div>\n </md-list-item>\n <md-divider ng-if="item.closed && item.ratingValue != null || item.ratingMessage"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.RATING">Rating</p>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.ratingMessage }}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CONTACT">Contact</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-account"></md-icon>\n <label translate="DASHBOARDS.NAME">Name</label>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-email"></md-icon>\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.contact.email" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-phone"></md-icon>\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.contact.phone" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" disabled privacy ng-cloak>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <label translate="DASHBOARDS.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.contact.fax" disabled privacy ng-cloak>\n </md-input-container>\n\n <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n More\n </md-button>\n </div>\n </form>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n </md-tab-label>\n <md-tab-body>\n <div layout="column" layout-align="space-between center" class="md-padding">\n <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} -\n <span translate="DASHBOARDS.OPENED"></span></span>\n <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{vm.interaction.substatus}}</span>\n </div>\n <md-divider></md-divider>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n <h4>{{vm.account.name}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{vm.interaction.externalUrl}}" target="_blank">\n <h4>{{vm.interaction.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n </div>\n </div>\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n </div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html\'">\n </div>\n </div>\n </div>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TAGS">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n </md-list-item>\n\n <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ vm.interaction.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.secondDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n <h4>{{ vm.interaction.secondDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.thirdDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n <h4>{{ vm.interaction.thirdDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'">\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{ vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{ item.externalUrl }}" target="_blank">\n <h4>{{ item.externalUrl }}</h4>\n </a>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{ item.createdAt | date: \'medium\' }}</h4>\n </div>\n </md-list-item>\n <div ng-if="item.channel === \'chat\'">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'">\n </div>\n </div>\n <div ng-if="item.channel === \'mail\'">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'">\n </div>\n </div>\n <md-divider ng-if="item.closed"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{ item.closedAt | date: \'medium\' }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ item.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.secondDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</p>\n <h4>{{ item.secondDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.thirdDisposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION">Third Level Disposition</p>\n <h4>{{ item.thirdDisposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n </div>\n </md-list-item>\n <md-list-item ng-if="item.Tags.length">\n <p class="padding-horizontal-15 grey-fg">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{ tag.name }}</div>\n </div>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<div layout-margin layout="row" layout-align="center center">\n <ms-quick-filter filters="vm.quickFilters" query="vm.journeyOptions" search="vm.getCustomerJourney()">\n </ms-quick-filter>\n</div>\n\n<md-content id="journey-content" flex layout-wrap>\n <div ng-if="vm.journeyIsLoading" layout="row" layout-align="center center">\n <md-progress-circular class="md-accent" md-diameter="48" md-mode="indeterminate"></md-progress-circular>\n </div>\n <div id="timeline" layout="column" ng-if="vm.journey && vm.journey.length && !vm.journeyIsLoading" ms-timeline="vm.journeyTimelineOptions" ms-timeline-load-more="vm.loadMoreJourney()">\n \x3c!-- TIMELINE ITEM --\x3e\n <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey">\n <div class="timeline-card">\n <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n <div layout="row" layout-align="space-between center">\n <div class="header p-6" layout="row" layout-align="start center" ng-cloak>\n <md-button class="md-fab md-mini no-click" aria-label="icon-channel" ng-class="{{ \'item.style.color\' }} + \'-bg\'">\n <md-icon md-font-icon="{{ item.style.icon }}"></md-icon>\n </md-button>\n <div class="info" layout="column" ng-init="item.showMore = false">\n <span class="font-size-12 text-truncate" ng-if="item.destination">\n #{{item.id}} - <span privacy ng-cloak>{{ item.destination }}</span>\n </span>\n <span class="font-size-12 text-truncate" ng-if="!item.destination">\n #{{item.id}} - {{ item.Account.key }}\n </span>\n <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n <span>\n <a class="toggle-details md-accent-color" ng-click="item.showMore = !item.showMore" translate="{{ item.showMore ? \'DASHBOARDS.HIDE_DETAILS\' : \'DASHBOARDS.SHOW_DETAILS\' }}">\n </a>\n </span>\n </div>\n </div>\n <span>\n <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n </span>\n </div>\n <div ng-if="item.showMore">\n <div ng-if="item.channel !== \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'">\n </div>\n <div ng-if="item.channel === \'voice\'" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'">\n </div>\n </div>\n <md-divider></md-divider>\n <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n <div ng-if="item.closed && item.channel !== \'voice\'" class="text-truncate text-boxed-light">\n <span class="red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate }} {{ item.dispositionsValues }}">\n {{ \'DASHBOARDS.STATUS\' | translate}} : {{ \'DASHBOARDS.CLOSED\' | translate}} {{ item.dispositionsValues\n }}\n </span>\n </div>\n <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && item.channel !== \'voice\'" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">\n {{ \'DASHBOARDS.STATUS\' | translate}}:\n {{ \'DASHBOARDS.OPENED\' | translate}}\n <span ng-if="item.substatus"> - {{ item.substatus }}</span>\n </span>\n <span ng-if="item.channel === \'voice\'" class="text-boxed md-background-bg red-fg" title="{{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}">\n {{ item.userDisposition ? (\'DASHBOARDS.DISPOSITION\' | translate) + \':\' : \'\'}} {{ item.userDisposition ?\n item.userDisposition : (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }}\n </span>\n <span ng-if="item.channel === \'voice\' && item.userSecondDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}: {{ item.userSecondDisposition }}">\n {{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:\n {{ item.userSecondDisposition }}\n </span>\n <span ng-if="item.channel === \'voice\' && item.userThirdDisposition" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}: {{ item.userThirdDisposition }}">\n {{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:\n {{ item.userThirdDisposition }}\n </span>\n <div flex></div>\n <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\' && item.canOpen && item.channel !== \'voice\'" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction(item)">\n <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n </md-button>\n </div>\n </md-card>\n </div>\n </div>\n\n <div ng-if="vm.canLoadMoreJourney" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row keep-on-top">\n <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-click="vm.loadMoreJourney()" translate="DASHBOARDS.MORE">\n </md-button>\n </div>\n </div>\n \x3c!-- / TIMELINE ITEM --\x3e\n</md-content>\n\n<div ng-if="!vm.journey || vm.journey.length === 0" layout="row" layout-align="center center">\n <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TYPE">Type</p>\n <h4>{{ item.type ? item.type : \'no type\' }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SOURCE">Source</p>\n <h4 privacy ng-cloak>{{ item.source ? item.source : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DESTINATION">Destination</p>\n <h4 privacy ng-cloak>{{ item.destination ? item.destination : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.UNIQUEID">Uniqueid</p>\n <h4>{{ item.uniqueid ? item.uniqueid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n <h4 privacy ng-cloak>{{ item.callerid ? item.callerid : (\'DASHBOARDS.UNKNOWN\' | translate) }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n <h4>{{ item.starttime | date:\'medium\' }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.END_AT">End At</p>\n <h4>{{ item.endtime | date:\'medium\' }}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DURATION">Duration</p>\n <h4>{{ item.duration ? item.duration : \'--\' }}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">Note</p>\n <h4>{{ item.note ? item.note : \'--\' }}</h4>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.subject">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SUBJECT">Subject</p>\n <h4>{{ item.subject }}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.VISIBILITY">Visibility</p>\n <h4 translate="{{ item.threadId ? \'DASHBOARDS.PUBLIC\' : \'DASHBOARDS.PRIVATE\'}}"></h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n <md-button ng-if="vm.tab.channel === \'fax\'" class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n\n <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n <div ng-if="message.secret">\n <div class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n <span> - {{message.createdAt | date: \'medium\'}}</span>\n </div>\n <div ng-if="message.id">\n <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="!message.secret">\n <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n <span> - {{message.createdAt | date: \'medium\'}}</span>\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n <span privacy ng-cloak>{{ vm.getLabelByMessage(message) }}</span>\n <span> - {{message.createdAt | date: \'medium\'}}</span>\n </div>\n <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n <div ng-if="message.id && vm.tab.channel === \'fax\'">\n <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n <md-button ng-if="vm.downloadPermissions.attachments" class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <div ng-if="!vm.downloadPermissions.attachments" class="disabled-button">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </div>\n </div>\n <div ng-if="!message.AttachmentId" class="message" layout="row" layout-align="end center">\n <span ng-bind-html="message.body | embed: vm.embedOptions"></span>\n </div>\n </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.interactionTimelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <div layout="column">\n <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n <div layout="row" layout-align="center center" layout-fill ng-if="message.attach && vm.downloadPermissions.attachments">\n <div flex>\n <md-divider></md-divider>\n </div>\n <md-menu>\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span>\n </md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n <span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">\n {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n </md-card>\n <div ng-if="!message.secret">\n <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">\n [{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n </div>\n <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n <md-content class="mail-content">\n <div class="info" layout="row" layout-align="space-between start">\n <div layout="column" layout-align="start start">\n <div layout="row" layout-align="start start">\n <div layout="column" layout-align="start start">\n <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n <strong privacy ng-cloak>{{message.from}}</strong>\n <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16">\n </md-icon>\n </div>\n <div class="name">\n <div>{{message.subject}}</div>\n </div>\n <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate" privacy ng-cloak>{{ message.originTo || message.to\n }}</span>\n </div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.originCc && message.originCc.indexOf(vm.account.email) >= 0">\n <em><span class="blue-grey" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n registered as a</span> <span class="blue-grey">CC</span></em>\n </div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.bcc && message.bcc.indexOf(vm.account.email) >= 0">\n <em><span class="red-fg" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are\n registered as a</span> <span class="red-fg">BCC</span></em>\n </div>\n </div>\n </div>\n\n <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n Hide Details\n </a>\n <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n <div layout="column">\n <span class="title" translate="MAIL.DATE">Date:</span>\n <span class="title" translate="MAIL.FROM">From:</span>\n <span class="title" translate="MAIL.TO">To:</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && message.originCc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'out\' && message.cc">Cc:</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="title" translate="MAIL.BCC" ng-if="message.bcc">Bcc:</span>\n <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n </div>\n\n <div layout="column">\n <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n <span class="detail" privacy ng-cloak>{{message.from}}</span>\n <span class="detail" privacy ng-cloak>{{message.originTo || message.to}}</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="detail" ng-if="message.direction === \'in\' && message.originCc" privacy ng-cloak>{{\n message.originCc }}</span>\n <span class="detail" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc" privacy ng-cloak>{{ message.cc }}</span>\n <span class="detail" ng-if="message.direction === \'out\' && message.cc" privacy ng-cloak>{{ message.cc\n }}</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="detail" ng-if="message.bcc" privacy ng-cloak>{{message.bcc}}</span>\n <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n </div>\n </div>\n </div>\n\n <div layout="row" layout-align="center center">\n <div layout="column" layout-align="center end" class="md-padding">\n <span class="grey-fg" ng-if="message.direction ===\'in\'" privacy>{{message.from.indexOf(vm.contact.email)\n >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname ||\n vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n </div>\n </div>\n\n <div layout="row" layout-align="center center" layout-fill>\n <div flex>\n <md-divider></md-divider>\n </div>\n <div>\n <div class="interaction-reply-button-container">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span>\n </md-tooltip>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft(message.id)">\n <md-icon md-font-icon="icon-pencil-box" class="icon s24"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!message.attach && vm.downloadPermissions.interactions" class="md-icon-button" aria-label="forward" ng-click="vm.downloadMessage(message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n <md-menu ng-if="message.attach && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span>\n </md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.downloadPermissions.attachments">\n <md-button ng-click="vm.downloadMessage(message, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMessage(message)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <md-menu ng-if="message.attach && vm.downloadPermissions.attachments">\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon>\n <span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">\n {{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n\n <md-content ng-bind-html-unsafe="message.body"></md-content>\n </md-content>\n </md-card>\n </div>\n <div ng-hide="!(vm.BTNLoadMore > 0)" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row">\n <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-disabled="!(vm.BTNLoadMore > 0)" ng-click="vm.loadNextPage()" translate="DASHBOARDS.MORE">\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeChatInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="CHAT.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n <div layout="row" layout-align="center center" class="p-8">\n <md-icon ng-if="vm.tab.channel === \'openchannel\' && vm.interaction.threadId" md-font-icon="fas fa-users" class="s16">\n <md-tooltip><span translate="DASHBOARDS.PUBLIC_INTERACTION">The interaction is public</span></md-tooltip>\n </md-icon>\n <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> -\n {{vm.interaction.substatus}}</span></span>\n <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt"></timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div>\n </div>\n <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'">\n </div>\n </div>\n <div ng-switch-when="fax">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'">\n </div>\n </div>\n <div ng-switch-when="sms">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'">\n </div>\n </div>\n <div ng-switch-when="whatsapp">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html\'">\n </div>\n </div>\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.chat.html\'">\n </div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html\'">\n </div>\n </div>\n </div>\n <md-menu ng-if="[\'fax\', \'sms\', \'whatsapp\'].indexOf(vm.tab.channel) < 0 && vm.downloadPermissions.interactions" class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.downloadPermissions.attachments">\n <md-button ng-click="vm.downloadInteraction(vm.interaction, true)" translate="DASHBOARDS.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadInteraction(vm.interaction)" translate="DASHBOARDS.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n\n <md-menu-item ng-if="vm.tab.channel === \'chat\' && !vm.interaction.closed && !vm.tab.spy && vm.account.vidaooEscalation && vm.account.vidaooApiKey">\n <md-button ng-click="vm.createVidaooSession(vm.interaction)" translate="DASHBOARDS.VIDAOOSESSION">\n Start Video Call\n </md-button>\n </md-menu-item>\n\n <md-menu-item>\n <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.account.queueTransfer || vm.account.agentTransfer">\n <md-button ng-click="vm.transferLastMessage()" translate="DASHBOARDS.TRANSFER">\n Transfer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n Set as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.interaction.substatus != null">\n <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n None\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.setAs(subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n Unread\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<div class="interaction-reply-button-container">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DRAFT">Draft</span></md-tooltip>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="draft" ng-disabled="!vm.draft" ng-click="vm.openDraft()">\n <md-icon ng-cloak md-font-icon="icon-pencil-box" class="icon s24" ng-class="vm.draft ? \'red-500-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n</div>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.openchannel.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeOpenchannelInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="OPENCHANNEL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.whatsapp.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeWhatsappInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="WHATSAPP.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)" ng-if="vm.downloadPermissions.interactions">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n <div layout="row" layout-align="center center">\n <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg">\n <timer start-time="vm.starttime"></timer>\n </span>\n <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}\n </md-button>\n <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n </div>\n <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n <div class="padding-top-5" layout="row">\n <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n ACCEPT\n </md-button>\n <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n REJECT\n </md-button>\n </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-hangouts" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_MANAGED_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_MANAGED_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_MANAGED_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.originated || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundAbandonRate || 0}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundDropRate }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-deskphone" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-email" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-google-earth" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" ng-init="vm.onInit()" class="page-layout simple right-sidenav" layout="row">\n \x3c!-- CENTER --\x3e\n <div class="center" flex>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs ng-if="vm.hasDashboardPermissions" md-selected="vm.selectedTab" md-dynamic-height>\n <md-tab ng-if="vm.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n <div ui-view="voice"></div>\n </md-tab>\n <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n <div ui-view="dialer"></div>\n </md-tab>\n <md-tab ng-if="vm.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}" ui-sref="app.dashboards.general.chat">\n <div ui-view="chat"></div>\n </md-tab>\n <md-tab ng-if="vm.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}" ui-sref="app.dashboards.general.mail">\n <div ui-view="mail"></div>\n </md-tab>\n <md-tab ng-if="vm.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}" ui-sref="app.dashboards.general.sms">\n <div ui-view="sms"></div>\n </md-tab>\n <md-tab ng-if="vm.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}" ui-sref="app.dashboards.general.openchannel">\n <div ui-view="openchannel"></div>\n </md-tab>\n <md-tab ng-if="vm.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}" ui-sref="app.dashboards.general.fax">\n <div ui-view="fax"></div>\n </md-tab>\n <md-tab ng-if="vm.license.whatsapp" label="{{\'DASHBOARDS.WHATSAPP\' | translate}}" ui-sref="app.dashboards.general.whatsapp">\n <div ui-view="whatsapp"></div>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- END CONTENT --\x3e\n\n <md-content ng-if="!vm.hasDashboardPermissions" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to\n navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n </md-content>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timer-sand"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n </div>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.outbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.outbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-clock"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-division"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-42 line-height-72">\n {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/whatsapp/user.general.whatsapp.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-whatsapp" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n\n <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n ADD FAXACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",'<md-dialog class="faxAccount-dialog" aria-label="faxAccount" ng-init="vm.onInit()">\n <form name="faxAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXACCOUNT">Add Agent to faxAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/tag/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'tag\'].$error" ng-show="faxAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxAccount-image" hide-xs>\n <img ng-src="assets/images/business/faxAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxAccount.id}}\n <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (advancedForm.$invalid) || (dispositionForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.HEADERINFO">headerinfo</label>\n <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.faxAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.faxAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.queueTransfer == true" class="md-block">\n <label translate="FAX.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.faxAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.agentTransfer == true" class="md-block">\n <label translate="FAX.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.faxAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.ECM">ECM</label>\n <md-select name="ecm" ng-model="vm.faxAccount.ecm" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MINRATE">minrate</label>\n <md-select name="minrate" ng-model="vm.faxAccount.minrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MAXRATE">maxrate</label>\n <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MODEM">modem</label>\n <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.GATEWAY">gateway</label>\n <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FAXDETECT">faxdetect</label>\n <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.T38TIMEOUT">t38timeout</label>\n <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.SIP">SIP</label>\n <md-select name="tech" ng-model="vm.faxAccount.tech" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP\'">SIP</md-option>\n <md-option ng-value="\'IAX\'">IAX</md-option>\n <md-option ng-value="\'DADHI\'">DADHI</md-option>\n <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.mandatoryDisposition" class="md-block">\n <label translate="FAX.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.faxAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="FaxAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add fax dispositions" translate translate-attr-label="FAX.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="FAX.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getFaxAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getFaxAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'FAX.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'FAX.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'FAX.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'FAX.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'FAX.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'FAX.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'FAX.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'FAX.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'FAX.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.faxInteractionDownload(interaction, $event)" translate="FAX.DOWNLOAD_INTERACTION">\n Download\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxAccounts-count">\n <span>{{vm.selectedFaxAccounts.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FAXACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':faxAccount.TrunkId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(faxAccount, $event )" translate="FAX.EDIT_FAXACCOUNT">\n Edit FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(faxAccount, $event )" translate="FAX.INTERACTIONS_FAXACCOUNT">\n Interactions FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event )" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n goToRealtime FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(faxAccount, $event )" translate="FAX.AGENTADD_FAXACCOUNT">\n AgentAdd FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(faxAccount, $event )" translate="FAX.DELETE_FAXACCOUNT">\n Delete FaxAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n <form name="faxQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n\n <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n ADD FAXQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxQueue-image" hide-xs>\n <img ng-src="assets/images/business/faxQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxQueue.id}}\n <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxQueues-count">\n <span>{{vm.selectedFaxQueues.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAX.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FAXQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(faxQueue, $event )" translate="FAX.EDIT_FAXQUEUE">\n Edit FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(faxQueue, $event )" translate="FAX.TEAMADD_FAXQUEUE">\n teamadd FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(faxQueue, $event )" translate="FAX.AGENTADD_FAXQUEUE">\n agentadd FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(faxQueue, $event )" translate="FAX.DELETE_FAXQUEUE">\n Delete FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event )" translate="FAX.GOTOREALTIME_FAXQUEUE">\n goToRealtime FaxQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}" md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.vm.getFaxAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- ACCOUNTS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate}}</th>\n <th md-column>{{\'FAX.KEY\' | translate}}</th>\n <th md-column>{{\'FAX.TOTAL\' | translate}}</th>\n <th md-column>{{\'FAX.IN\' | translate}}</th>\n <th md-column>{{\'FAX.OUT\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.count > 0">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="account" md-select-id="id" ng-repeat="account in vm.faxAccounts.rows">\n <td md-cell>{{account.name}}</td>\n <td md-cell>{{account.key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(account.in || 0) + (account.out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{account.in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{account.lastIn ? (account.lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{account.out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{account.lastOut ? (account.lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToFaxAccount($event, account)" translate="FAX.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / ACCOUNTS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column">\n <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n <div id="maintenance-form" class="md-whiteframe-8dp">\n <div>\n <img src="/api/settings/1/logo_login" alt="logo_login" />\n </div>\n\n <br>\n\n <div>\n <div class="info-line">\n <div class="title">Useful pages</div>\n </div>\n <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n <md-icon md-font-icon="icon-wikipedia"></md-icon>\n </a>\n <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n </a>\n <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n <md-icon md-font-icon="icon-headphones"></md-icon>\n </a>\n <div class="info"><a href="https://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n <md-icon md-font-icon="icon-console"></md-icon>\n </a>\n <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n </div>\n\n </section>\n\n <br>\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title">Follow us on</div>\n </div>\n <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-facebook"></md-icon>\n </a>\n\n <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-twitter"></md-icon>\n </a>\n <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n <md-icon md-font-icon="icon-google-plus"></md-icon>\n </a>\n <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n <md-icon md-font-icon="icon-linkedin"></md-icon>\n </a>\n </section>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n </div>\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n </div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n <br>\n\n <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n <form name="deskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n\n <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n ADD DESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-deskAccounts-count">\n <span>{{vm.selectedDeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- DESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.deskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(deskAccount, $event )" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n Edit DeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event )" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n Test DeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(deskAccount, $event )" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n Delete DeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n ADD DESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error"\n ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error"\n ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="deskAccount-image" hide-xs>\n <img ng-src="assets/images/business/deskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.deskAccount.id}}\n <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n Delete DeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",'<md-dialog class="dynamics365Account-dialog" aria-label="New Dynamics365Account">\n <form name="dynamics365AccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365AccountForm[\'name\'].$error" ng-show="dynamics365AccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.dynamics365Account.modernAuthentication">\n <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n </md-switch>\n \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'username\'].$error" ng-show="dynamics365AccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" ng-required="true">\n <div ng-messages="dynamics365AccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'remoteUri\'].$error" ng-show="dynamics365AccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'tenantId\'].$error" ng-show="dynamics365AccountForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientId\'].$error" ng-show="dynamics365AccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientSecret\'].$error" ng-show="dynamics365AccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="dynamics365AccountForm[\'serverUrl\'].$error" ng-show="dynamics365AccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </div>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders">{{provider.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description">\n\n <div ng-messages="dynamics365AccountForm[\'description\'].$error" ng-show="dynamics365AccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Account" ng-click="vm.saveDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid || dynamics365AccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Account" ng-click="vm.addNewDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n ADD DYNAMICS365ACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Account" ng-click="vm.deleteDynamics365Account($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",'<div id="dynamics365Accounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DYNAMICS365ACCOUNTS">Dynamics365Accounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDynamics365Accounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDynamics365Accounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-dynamics365Accounts-count">\n <span>{{vm.selectedDynamics365Accounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDynamics365Accounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDynamics365Accounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDynamics365Accounts" csv-label="true" filename="dynamics365Accounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDynamics365Accounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- DYNAMICS365ACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDynamics365Accounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDynamics365Accounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="modernAuthentication">{{ \'INTEGRATIONS.MODERN_AUTHENTICATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dynamics365Accounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="dynamics365Account" md-select-id="id" ng-repeat="dynamics365Account in vm.dynamics365Accounts.rows">\n <td md-cell ng-if="dynamics365Account.userpic"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="api/users/{{dynamics365Account.id}}/avatar" /></td>\n <td md-cell ng-if="!dynamics365Account.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="id ">{{dynamics365Account.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="name ">{{dynamics365Account.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="modernAuthentication ">\n <md-icon md-colors="{color: {{dynamics365Account.modernAuthentication ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{dynamics365Account.modernAuthentication ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(dynamics365Account, $event )" translate="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT">\n Edit Dynamics365Account\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(dynamics365Account, $event )" translate="INTEGRATIONS.TEST_DYNAMICS365ACCOUNT">\n Test Dynamics365Account\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n <md-button ng-click="vm.deleteconfirm(dynamics365Account, $event )" translate="INTEGRATIONS.DELETE_DYNAMICS365ACCOUNT">\n Delete Dynamics365Account\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dynamics365Accounts.count}}" md-on-paginate="vm.getDynamics365Accounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DYNAMICS365ACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-dynamics365Account-button" ng-click="vm.createOrEditDynamics365Account($event)" aria-label="add dynamics365Account" translate translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",'<md-dialog class="dynamics365Configuration-dialog" aria-label="New Dynamics365Configuration">\n <form name="dynamics365ConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.dynamics365Configuration.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365ConfigurationForm[\'name\'].$error" ng-show="dynamics365ConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.dynamics365Configuration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'channel\'].$error" ng-show="dynamics365ConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dynamics365Configuration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'type\'].$error" ng-show="dynamics365ConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n <md-select name="ticketType" ng-model="vm.dynamics365Configuration.ticketType" required>\n\n <md-option ng-value="\'incident\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n\n <md-option ng-value="\'phonecall\'"> {{ \'INTEGRATIONS.PHONECALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'ticketType\'].$error" ng-show="dynamics365ConfigurationForm[\'ticketType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Configuration" ng-click="vm.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid || dynamics365ConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Configuration" ng-click="vm.addNewDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION">\n ADD DYNAMICS365CONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Configuration" ng-click="vm.deleteDynamics365Configuration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",'<md-dialog class="dynamics365Account-item-dialog" aria-label="New Item">\n <form name="dynamics365AccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.key.$error" ng-show="dynamics365AccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.keyType.$error" ng-show="dynamics365AccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.keyContent.$error" ng-show="dynamics365AccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.customField.$error" ng-show="dynamics365AccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error"\n ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error"\n ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",'<div id="integrations-dynamics365Account" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-dynamics365Accounts-button md-icon-button" aria-label="Go to dynamics365Accounts" ng-click="vm.gotoDynamics365Accounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="dynamics365Account-image" hide-xs>\n <img ng-src="assets/images/business/dynamics365Accounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.dynamics365Account.id}}\n <span ng-if="vm.dynamics365Account.name">{{vm.dynamics365Account.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.dynamics365Account.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDynamics365Account()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.dynamics365Account.modernAuthentication">\n <span translate="INTEGRATIONS.MODERN_AUTHENTICATION">Modern Authentication</span>\n </md-switch>\n \x3c!-- <div class="hint"><span translate="INTEGRATIONS.HELP.MODERN_AUTHENTICATION"></span></div> --\x3e\n </md-input-container>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == true">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select ng-model="vm.dynamics365Account.CloudProviderId" placeholder="Cloud Provider connection" ng-required="true">\n <md-option value="{{provider.id}}" ng-repeat="provider in vm.cloudProviders.rows">{{provider.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.dynamics365Account.modernAuthentication == false">\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" ng-required="vm.dynamics365Account.modernAuthentication == false">\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'tenantId\'].$error" ng-show="generalForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" value="LOCALIP" ng-required="vm.dynamics365Account.modernAuthentication == false" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </div>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="Dynamics365AccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" class="md-icon-button" aria-label="create dynamics365Configuration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="dynamics365Configuration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDynamics365Configuration($index)">\n <span class="text-truncate" flex="80">{{ dynamics365Configuration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)" translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION">\n Delete Dynamics365Configuration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container general md-background-bg">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ADVANCED">ADVANCED</div>\n </div>\n <form name="vm_cc.advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MODULECREATE">Module Create</label>\n <md-select name="type" ng-model="vm_cc.dynamics365Configuration.moduleCreate" required>\n <md-option ng-value="\'contact\'">{{\'INTEGRATIONS.DYNAMIC365CONTACT\' | translate}}</md-option>\n <md-option ng-value="\'nothing\'">{{\'INTEGRATIONS.DYNAMIC365NOTHING\' | translate}}</md-option>\n </md-select>\n <div ng-messages="vm_cc.advancedForm[\'moduleCreate\'].$error" ng-show="vm_cc.advancedForm[\'moduleCreate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MODULECREATE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm_cc.dynamics365Configuration.openNewTab">\n <span translate="INTEGRATIONS.OPENNEWTAB">Open new tab</span>\n </md-switch>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT">Additional search contact</label>\n <input type="" name="additionalSearchContact" ng-model="vm_cc.dynamics365Configuration.additionalSearchContact" autofocus>\n </md-input-container>\n <div layout="row" layout-align="end center">\n <md-button type="submit" ng-click="vm_cc.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="vm_cc.advancedForm.$invalid || vm_cc.advancedForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n </div>\n\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n\n <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n ADD FRESHDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n ADD FRESHDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error"\n ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error"\n ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshdeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshdeskAccount.id}}\n <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n Delete FreshdeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshdeskAccounts-count">\n <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(freshdeskAccount, $event )" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n Edit FreshdeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event )" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n Test FreshdeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event )" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n Delete FreshdeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/create/dialog.html",'<md-dialog class="freshsalesAccount-dialog" aria-label="New FreshsalesAccount">\n <form name="freshsalesAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="freshsalesAccountForm[\'name\'].$error" ng-show="freshsalesAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true">\n\n <div ng-messages="freshsalesAccountForm[\'username\'].$error" ng-show="freshsalesAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true">\n\n <div ng-messages="freshsalesAccountForm[\'remoteUri\'].$error" ng-show="freshsalesAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true">\n\n <div ng-messages="freshsalesAccountForm[\'apiKey\'].$error" ng-show="freshsalesAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshsalesAccountForm[\'serverUrl\'].$error" ng-show="freshsalesAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshsalesAccount.description">\n\n <div ng-messages="freshsalesAccountForm[\'description\'].$error" ng-show="freshsalesAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesAccount" ng-click="vm.saveFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid || freshsalesAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesAccount" ng-click="vm.addNewFreshsalesAccount()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n ADD FRESHSALESACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesAccount" ng-click="vm.deleteFreshsalesAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/configurations/dialog.html",'<md-dialog class="freshsalesConfiguration-dialog" aria-label="New FreshsalesConfiguration">\n <form name="freshsalesConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshsalesConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="freshsalesConfigurationForm[\'name\'].$error" ng-show="freshsalesConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshsalesConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshsalesConfigurationForm[\'channel\'].$error" ng-show="freshsalesConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshsalesConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshsalesConfigurationForm[\'type\'].$error" ng-show="freshsalesConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshsalesConfiguration" ng-click="vm.saveFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid || freshsalesConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshsalesConfiguration" ng-click="vm.addNewFreshsalesConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshsalesConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESCONFIGURATION">\n ADD FRESHSALESCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshsalesConfiguration" ng-click="vm.deleteFreshsalesConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/item/dialog.html",'<md-dialog class="freshsalesAccount-item-dialog" aria-label="New Item">\n <form name="freshsalesAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.key.$error" ng-show="freshsalesAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.keyType.$error" ng-show="freshsalesAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.keyContent.$error" ng-show="freshsalesAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.customField.$error" ng-show="freshsalesAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshsalesAccountItemForm.$invalid || freshsalesAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="freshsalesAccountItemForm.option.$error" ng-show="freshsalesAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="freshsalesAccountItemForm.content.$error" ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.variableName.$error" ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.type.$error" ng-show="freshsalesAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshsalesAccountItemForm.content.$error"\n ng-show="freshsalesAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshsalesAccountItemForm.variableName.$error"\n ng-show="freshsalesAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/edit/view.html",'<div id="integrations-freshsalesAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshsalesAccounts-button md-icon-button" aria-label="Go to freshsalesAccounts" ng-click="vm.gotoFreshsalesAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHSALESACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshsalesAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshsalesAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshsalesAccount.id}}\n <span ng-if="vm.freshsalesAccount.name">{{vm.freshsalesAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshsalesAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFreshsalesAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshsalesAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshsalesAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshsalesAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshsalesAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshsalesAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshsalesAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshsalesAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshsalesAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshsalesAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshsalesAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" class="md-icon-button" aria-label="create freshsalesConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshsalesConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshsalesConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshsalesConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshsalesConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFreshsalesConfiguration($event, freshsalesConfiguration)" translate="INTEGRATIONS.DELETE_FRESHSALESCONFIGURATION">\n Delete FreshsalesConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshsalesAccounts/freshsalesAccounts.html",'<div id="freshsalesAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHSALESACCOUNTS">FreshsalesAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshsalesAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshsalesAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshsalesAccounts-count">\n <span>{{vm.selectedFreshsalesAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshsalesAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshsalesAccounts" csv-label="true" filename="freshsalesAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshsalesAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- FRESHSALESACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshsalesAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshsalesAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshsalesAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshsalesAccount" md-select-id="id" ng-repeat="freshsalesAccount in vm.freshsalesAccounts.rows">\n <td md-cell ng-if="freshsalesAccount.userpic"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="api/users/{{freshsalesAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshsalesAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshsalesAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="id ">{{freshsalesAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="name ">{{freshsalesAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="username ">{{freshsalesAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)" md-cell class="remoteUri ">{{freshsalesAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(freshsalesAccount, $event )" translate="INTEGRATIONS.EDIT_FRESHSALESACCOUNT">\n Edit FreshsalesAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(freshsalesAccount, $event )" translate="INTEGRATIONS.TEST_FRESHSALESACCOUNT">\n Test FreshsalesAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(freshsalesAccount, $event )" translate="INTEGRATIONS.DELETE_FRESHSALESACCOUNT">\n Delete FreshsalesAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshsalesAccounts.count}}" md-on-paginate="vm.getFreshsalesAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHSALESACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHSALESACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshsalesAccount-button" ng-click="vm.createOrEditFreshsalesAccount($event)" aria-label="add freshsalesAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHSALESACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n\n <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n ADD SALESFORCEACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n <md-select name="ticketType" ng-model="vm.salesforceConfiguration.ticketType" required>\n\n <md-option ng-value="\'Task\'"> {{ \'INTEGRATIONS.TASK\' | translate }} </md-option>\n\n <md-option ng-value="\'Case\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'ticketType\'].$error" ng-show="salesforceConfigurationForm[\'ticketType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n ADD SALESFORCECONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error"\n ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error"\n ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="salesforceAccount-image" hide-xs>\n <img ng-src="assets/images/business/salesforceAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.salesforceAccount.id}}\n <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSalesforceAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n Delete SalesforceConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">\n ADVANCED\n </span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'account_contact_lead\', value: \'Account & Contact & Lead\'}, {key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}, {key: \'account\', value: \'Account\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLead">\n <label translate="INTEGRATIONS.LEADID"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.leadId" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.LEADID"></span></div>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isAccountSearch">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHACCOUNT"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.additionalSearchAccount" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHACCOUNT"></span></div>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isContactSearch">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHCONTACT"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.additionalSearchContact" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHCONTACT"></span></div>\n </div>\n\n <div layout-margin ng-if="vm_cc.salesforceConfiguration.isLeadSearch">\n <label translate="INTEGRATIONS.ADDITIONALSEARCHLEAD"></label>\n <md-input-container class="md-block">\n <input ng-model="vm_cc.salesforceConfiguration.additionalSearchLead" type="text">\n </md-input-container>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ADDITIONALSEARCHLEAD"></span></div>\n </div>\n\n <md-button type="submit" ng-click="vm_cc.saveSalesforceConfiguration()" ng-disabled="!vm_cc.crudPermissions.canEdit" class="send-button md-accent md-raised" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-salesforceAccounts-count">\n <span>{{vm.selectedSalesforceAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(salesforceAccount, $event )" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n Edit SalesforceAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event )" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n Test SalesforceAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event )" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n Delete SalesforceAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",'<md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">\n <form name="servicenowAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowAccountForm[\'name\'].$error" ng-show="servicenowAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'username\'].$error" ng-show="servicenowAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="servicenowAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'email\'].$error" ng-show="servicenowAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'remoteUri\'].$error" ng-show="servicenowAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="servicenowAccountForm[\'serverUrl\'].$error" ng-show="servicenowAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description">\n\n <div ng-messages="servicenowAccountForm[\'description\'].$error" ng-show="servicenowAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount" ng-click="vm.saveServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount" ng-click="vm.addNewServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n ADD SERVICENOWACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount" ng-click="vm.deleteServicenowAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",'<md-dialog class="servicenowConfiguration-dialog" aria-label="New ServicenowConfiguration">\n <form name="servicenowConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.servicenowConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowConfigurationForm[\'name\'].$error" ng-show="servicenowConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.servicenowConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'channel\'].$error" ng-show="servicenowConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.servicenowConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'type\'].$error" ng-show="servicenowConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowConfiguration" ng-click="vm.saveServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid || servicenowConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowConfiguration" ng-click="vm.addNewServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION">\n ADD SERVICENOWCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowConfiguration" ng-click="vm.deleteServicenowConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",'<md-dialog class="servicenowAccount-item-dialog" aria-label="New Item">\n <form name="servicenowAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.key.$error" ng-show="servicenowAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.keyType.$error" ng-show="servicenowAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.keyContent.$error" ng-show="servicenowAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="servicenowAccountItemForm.customField.$error" ng-show="servicenowAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error"\n ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error"\n ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/view.html",'<div id="integrations-servicenowAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-servicenowAccounts-button md-icon-button" aria-label="Go to servicenowAccounts" ng-click="vm.gotoServicenowAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SERVICENOWACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="servicenowAccount-image" hide-xs>\n <img ng-src="assets/images/business/servicenowAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.servicenowAccount.id}}\n <span ng-if="vm.servicenowAccount.name">{{vm.servicenowAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.servicenowAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveServicenowAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ServicenowAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.servicenowAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" class="md-icon-button" aria-label="create servicenowConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="servicenowConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedServicenowConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getServicenowConfiguration($index)">\n <span class="text-truncate" flex="80">{{ servicenowConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteServicenowConfiguration($event, servicenowConfiguration)" translate="INTEGRATIONS.DELETE_SERVICENOWCONFIGURATION">\n Delete ServicenowConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",'<div id="servicenowAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS">ServicenowAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedServicenowAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedServicenowAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-servicenowAccounts-count">\n <span>{{vm.selectedServicenowAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllServicenowAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectServicenowAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedServicenowAccounts" csv-label="true" filename="servicenowAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedServicenowAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SERVICENOWACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedServicenowAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getServicenowAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'INTEGRATIONS.EMAIL\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.servicenowAccounts.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="servicenowAccount" md-select-id="id" ng-repeat="servicenowAccount in vm.servicenowAccounts.rows">\n <td md-cell ng-if="servicenowAccount.userpic"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="api/users/{{servicenowAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!servicenowAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="id ">{{servicenowAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="name ">{{servicenowAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="username ">{{servicenowAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="email ">{{servicenowAccount.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="remoteUri ">{{servicenowAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(servicenowAccount, $event )" translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT">\n Edit ServicenowAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(servicenowAccount, $event )" translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT">\n Test ServicenowAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === \'admin\'">\n\n <md-button ng-click="vm.deleteconfirm(servicenowAccount, $event )" translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT">\n Delete ServicenowAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.servicenowAccounts.count}}" md-on-paginate="vm.getServicenowAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SERVICENOWACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SERVICENOWACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-servicenowAccount-button" ng-click="vm.createOrEditServicenowAccount($event)" aria-label="add servicenowAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SERVICENOWACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n\n <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n ADD SUGARCRMACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n ADD SUGARCRMCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error"\n ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error"\n ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="sugarcrmAccount-image" hide-xs>\n <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.sugarcrmAccount.id}}\n <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n Delete SugarcrmConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sugarcrmAccounts-count">\n <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(sugarcrmAccount, $event )" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n Edit SugarcrmAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event )" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n Test SugarcrmAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event )" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n Delete SugarcrmAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",'<md-dialog class="vtigerAccount-dialog" aria-label="New VtigerAccount">\n <form name="vtigerAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerAccountForm[\'name\'].$error" ng-show="vtigerAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description">\n\n <div ng-messages="vtigerAccountForm[\'description\'].$error" ng-show="vtigerAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'username\'].$error" ng-show="vtigerAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'accessKey\'].$error" ng-show="vtigerAccountForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'remoteUri\'].$error" ng-show="vtigerAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="vtigerAccountForm[\'serverUrl\'].$error" ng-show="vtigerAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerAccount" ng-click="vm.saveVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid || vtigerAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerAccount" ng-click="vm.addNewVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n ADD VTIGERACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerAccount" ng-click="vm.deleteVtigerAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",'<md-dialog class="vtigerConfiguration-dialog" aria-label="New VtigerConfiguration">\n <form name="vtigerConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.vtigerConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerConfigurationForm[\'name\'].$error" ng-show="vtigerConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.vtigerConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'channel\'].$error" ng-show="vtigerConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.vtigerConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'type\'].$error" ng-show="vtigerConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerConfiguration" ng-click="vm.saveVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid || vtigerConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerConfiguration" ng-click="vm.addNewVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERCONFIGURATION">\n ADD VTIGERCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerConfiguration" ng-click="vm.deleteVtigerConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",'<md-dialog class="vtigerAccount-item-dialog" aria-label="New Item">\n <form name="vtigerAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.key.$error" ng-show="vtigerAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.keyType.$error" ng-show="vtigerAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.keyContent.$error" ng-show="vtigerAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="vtigerAccountItemForm.customField.$error" ng-show="vtigerAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error"\n ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error"\n ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/view.html",'<div id="integrations-vtigerAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-vtigerAccounts-button md-icon-button" aria-label="Go to vtigerAccounts" ng-click="vm.gotoVtigerAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_VTIGERACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="vtigerAccount-image" hide-xs>\n <img ng-src="assets/images/business/vtigerAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.vtigerAccount.id}}\n <span ng-if="vm.vtigerAccount.name">{{vm.vtigerAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.vtigerAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVtigerAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accessKey\'].$error" ng-show="generalForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="VtigerAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.vtigerAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" class="md-icon-button" aria-label="create vtigerConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="vtigerConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedVtigerConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getVtigerConfiguration($index)">\n <span class="text-truncate" flex="80">{{ vtigerConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteVtigerConfiguration($event, vtigerConfiguration)" translate="INTEGRATIONS.DELETE_VTIGERCONFIGURATION">\n Delete VtigerConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",'<div id="vtigerAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.VTIGERACCOUNTS">VtigerAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVtigerAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVtigerAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-vtigerAccounts-count">\n <span>{{vm.selectedVtigerAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVtigerAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVtigerAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVtigerAccounts" csv-label="true" filename="vtigerAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVtigerAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VTIGERACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVtigerAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVtigerAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.VTIGER_USER_NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.vtigerAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vtigerAccount" md-select-id="id" ng-repeat="vtigerAccount in vm.vtigerAccounts.rows">\n <td md-cell ng-if="vtigerAccount.userpic"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="api/users/{{vtigerAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!vtigerAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="id ">{{vtigerAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="name ">{{vtigerAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="username ">{{vtigerAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="remoteUri ">{{vtigerAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(vtigerAccount, $event )" translate="INTEGRATIONS.EDIT_VTIGERACCOUNT">\n Edit VtigerAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(vtigerAccount, $event )" translate="INTEGRATIONS.TEST_VTIGERACCOUNT">\n Test VtigerAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(vtigerAccount, $event )" translate="INTEGRATIONS.DELETE_VTIGERACCOUNT">\n Delete VtigerAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.vtigerAccounts.count}}" md-on-paginate="vm.getVtigerAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VTIGERACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VTIGERACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-vtigerAccount-button" ng-click="vm.createOrEditVtigerAccount($event)" aria-label="add vtigerAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VTIGERACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n\n <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n ADD ZENDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error"\n ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error"\n ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zendeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/zendeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zendeskAccount.id}}\n <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZendeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n </div>\n <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n Delete ZendeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n ADD ZENDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zendeskAccounts-count">\n <span>{{vm.selectedZendeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(zendeskAccount, $event )" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n Edit ZendeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event )" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n Test ZendeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event )" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n Delete ZendeskAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n <form name="zohoAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ZONE">Zone</label>\n <md-select name="zone" ng-model="vm.zohoAccount.zone" required>\n <md-option ng-value="\'US\'">US</md-option>\n <md-option ng-value="\'AU\'">AU</md-option>\n <md-option ng-value="\'EU\'">EU</md-option>\n <md-option ng-value="\'IN\'">IN</md-option>\n <md-option ng-value="\'CN\'">CN</md-option>\n </md-select>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n <div ng-messages="zohoAccountForm[\'zone\'].$error" ng-show="zohoAccountForm[\'zone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n <div ng-messages="zohoAccountForm[\'clientId\'].$error" ng-show="zohoAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n <div ng-messages="zohoAccountForm[\'clientSecret\'].$error" ng-show="zohoAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CODE">Code</label>\n <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n <div ng-messages="zohoAccountForm[\'code\'].$error" ng-show="zohoAccountForm[\'code\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n\n <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n ADD ZOHOACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n ADD ZOHOCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n <md-option ng-if="vm.customField.options.length" value="picklist">Picklist</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'picklist\'">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error"\n ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error"\n ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zohoAccount-image" hide-xs>\n <img ng-src="assets/images/business/zohoAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zohoAccount.id}}\n <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZohoAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ZONE">Zone</label>\n <md-select name="zone" ng-model="vm.zohoAccount.zone" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'US\'">US</md-option>\n <md-option ng-value="\'AU\'">AU</md-option>\n <md-option ng-value="\'EU\'">EU</md-option>\n <md-option ng-value="\'IN\'">IN</md-option>\n <md-option ng-value="\'CN\'">CN</md-option>\n </md-select>\n <div class="hint"><span translate="INTEGRATIONS.HELP.ZONE"></span></div>\n <div ng-messages="generalForm[\'zone\'].$error" ng-show="generalForm[\'zone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ZONE_REQUIRED">Zone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.zohoAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTID"></span></div>\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.zohoAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CLIENTSECRET"></span></div>\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CODE">Code</label>\n <input type="text" name="code" ng-model="vm.zohoAccount.code" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.CODE"></span></div>\n <div ng-messages="generalForm[\'code\'].$error" ng-show="generalForm[\'code\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CODE_REQUIRED">Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.REFRESHTOKEN">RefreshToken</label>\n <input type="text" name="refreshToken" ng-model="vm.zohoAccount.refreshToken" disabled>\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.REFRESHTOKEN"></span></div>\n <div ng-messages="generalForm[\'refreshToken\'].$error" ng-show="generalForm[\'refreshToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.REFRESHTOKEN_REQUIRED">RefreshToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n Delete ZohoConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">\n ADVANCED\n </span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.zohoConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.zohoConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">\n {{ option.value }}</md-option>\n </md-select>\n </div>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zohoAccounts-count">\n <span>{{vm.selectedZohoAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- ZOHOACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column md-order-by="zone">{{ \'INTEGRATIONS.ZONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="zone ">{{ vm.arrayzone[zohoAccount.zone].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(zohoAccount, $event )" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n Edit ZohoAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event )" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n Test ZohoAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(zohoAccount, $event )" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n Delete ZohoAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n\n <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n CLONE PROJECT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n <form name="sessionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list>\n <md-subheader class="md-no-sticky">\n <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n </div>\n </md-subheader>\n <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n <div class="md-list-item-text compact">\n <h3>{{$index+1}}. {{question.question}}</h3>\n <p>{{question.answer}}</p>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n <div class="md-list-item-text compact">\n <h3><span class="text-boxed-light" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n </div>\n </md-list-item>\n </md-list>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/projects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}}\n <span ng-if="vm.project.name">{{vm.project.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveProject()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.sendUnpauseOnSubmit" aria-label="SendUnpauseOnSubmit" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.SENDUNPAUSEONSUBMIT">SendUnpauseOnSubmit</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.SENDUNPAUSEONSUBMIT"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n <div layout="row" layout-align="center">\n <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n Reset\n </md-button>\n </div>\n <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n <ms-search-bar on-search="vm_dc.getProjectSessions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'JSCRIPTY.ID\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'JSCRIPTY.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'JSCRIPTY.ENDTIME\' | translate }}\n </th>\n <th md-column md-order-by="membername">\n {{ \'JSCRIPTY.MEMBERNAME\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'JSCRIPTY.CALLERIDNUM\' | translate }}\n </th>\n <th md-column md-order-by="completed">\n {{ \'JSCRIPTY.COMPLETE\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n <td md-cell>\n {{session.id}}\n </td>\n <td md-cell>\n {{ session.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ session.endtime | formatdate }}\n </td>\n <td md-cell>\n {{session.membername}}\n </td>\n <td md-cell>\n {{session.calleridnum}}\n </td>\n <td md-cell class="completed ">\n <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n Results Session\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n Delete Session\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project, vm.userProfile)">\n <div class="pb-16" layout="row">\n <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS" flex>Answers</div>\n <div layout="row" layout-align="space-between center" flex>\n <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n <md-button type="button" ng-if="vm_an.currentUser.role === \'admin\' || vm_an.userProfile.downloadJscriptySessions" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n </md-button>\n </div>\n </div>\n <div layout="row">\n <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n <md-list>\n <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n <div class="md-list-item-text compact" layout-padding>\n <h3>{{question.question}}</h3>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column></th>\n <th md-column>#</th>\n <th md-column>%</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="(key, value) in question.answers">\n <td md-cell>{{key}}</td>\n <td md-cell width="20px">{{value}}</td>\n <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n </tr>\n <tr md-row>\n <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n <td md-cell width="20px"><b>{{question.sum}}</b></td>\n <td md-cell width="20px"><b>100</b></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n </md-list>\n </md-card>\n <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-light" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="JSCRIPTY.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="JSCRIPTY.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="JSCRIPTY.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="JSCRIPTY.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(project, $event )" translate="JSCRIPTY.EDIT_PROJECT">\n Edit Project\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(project, $event )" translate="JSCRIPTY.CLONE_PROJECT">\n clone Project\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.sessionsgoto(project, $event )" translate="JSCRIPTY.SESSIONS_PROJECT">\n Sessions Project\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.deleteconfirm(project, $event )" translate="JSCRIPTY.DELETE_PROJECT">\n Delete Project\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newMailAccount ? \'MAIL.NEW_MAILACCOUNT\' : \'MAIL.EDIT_MAILACCOUNT\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.newMailAccount" class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'provider\'].$error" ng-show="mailAccountForm[\'provider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n <div layout="row">\n <md-input-container class="md-block mr-20 mb-0" flex>\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block mb-0">\n <label translate="MAIL.IMAP_PORT">IMAP Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true">\n <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP Port field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </div>\n\n <div ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'">\n <div layout="row">\n <md-input-container class="md-block mr-20 mb-0" flex>\n <label translate="MAIL.SMTP_HOST">SMTP Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block mb-0">\n <label translate="MAIL.SMTP_PORT">SMTP Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP Port field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </div>\n\n <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'custom\'" class="md-block pt-0">\n <md-switch ng-model="vm.mailAccount.authentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n\n <md-input-container ng-if="vm.newMailAccount && vm.mailAccount.provider === \'outlook365\'" class="md-block">\n <md-switch ng-model="vm.mailAccount.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n </md-input-container>\n\n <div ng-if="vm.newMailAccount && vm.mailAccount.authentication && vm.mailAccount.provider">\n <md-input-container class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.mailAccount.username" ng-required="true">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="mailAccountForm[\'username\'].$error" ng-show="mailAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.modernAuthentication" class="md-block">\n <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select name="cloudProvider" ng-model="vm.mailAccount.CloudProviderId" required>\n <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n <div ng-messages="mailAccountForm[\'cloudProvider\'].$error" ng-show="mailAccountForm[\'cloudProvider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.mailAccount.modernAuthentication" class="md-block">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.mailAccount.password" translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="mailAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n ADD MAIL ACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",'<md-dialog class="mailAccount-dialog" aria-label="mailAccount" ng-init="vm.onInit()">\n <form name="mailAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILACCOUNT">Add Agent to mailAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.REPLY_TYPE">Reply_Type</label>\n <md-select name="replyType" ng-model="vm.autoreply.replyType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="0">Reply</md-option>\n <md-option ng-value="1">Reply All</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'replyType\'].$error" ng-show="mailAccountFormApp[\'replyType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.REPLY_TYPE_REQUIRED">Reply_Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.autoreply.text"></textarea>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/tag/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'tag\'].$error" ng-show="mailAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.VALUE">Value</label>\n <textarea aria-label="Value value" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.mailCannedAnswer.value"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n\n <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n ADD MAILCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.goToMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailAccount-image" hide-xs>\n <img ng-src="assets/images/business/mailAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailAccount.id}}\n <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.goToRealtime()" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.addAgent(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (credentialsForm.$invalid) || (templateForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (dispositionForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" class="mb-20" required>\n <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.mailAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.mailAccount.provider !== \'custom\'">\n <md-tab-label>\n <span translate="MAIL.AUTHENTICATION">Authentication</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.CREDENTIALS">Credentials</div>\n </div>\n <form name="credentialsForm" novalidate>\n <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="credentialsForm[\'username\'].$error" ng-show="credentialsForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.modernAuthentication" class="md-block">\n <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select name="cloudProvider" ng-model="vm.mailAccount.Imap.CloudProviderId" required>\n <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n <div ng-messages="credentialsForm[\'cloudProvider\'].$error" ng-show="credentialsForm[\'cloudProvider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.mailAccount.Imap.modernAuthentication" class="md-block">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="credentialsForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">Mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorizazion Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorizazion Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n <md-tab-label>\n <span translate="MAIL.IMAP">IMAP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.authentication" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">Mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">Connection Timeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">Connection Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Connection Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">Authorization Timeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" value="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">Authorization Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Authorization Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.mailAccount.provider === \'custom\'">\n <md-tab-label>\n <span translate="MAIL.SMTP">SMTP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.authentication" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container template md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.TEMPLATE">TEMPLATE</div>\n </div>\n <form name="templateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n <div ng-messages="templateForm[\'fontFamily\'].$error" ng-show="templateForm[fontFamily].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_SIZE">Font_Size</label>\n <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" value="13" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n <div ng-messages="templateForm[\'fontSize\'].$error" ng-show="templateForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.mailAccount.template"></textarea>\n </div>\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.mailAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.queueTransfer == true" class="md-block">\n <label translate="MAIL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.mailAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.agentTransfer == true" class="md-block">\n <label translate="MAIL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.mailAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="mailAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.mandatoryDisposition" class="md-block">\n <label translate="MAIL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.mailAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="MailAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add mail dispositions" translate translate-attr-label="MAIL.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getMailAccountMailCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'MAIL.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'MAIL.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'MAIL.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'MAIL.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'MAIL.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{mailCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{mailCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value | htmlToPlaintext }}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{mailCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>\n {{ mailCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n Edit MailCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n Delete MailCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="MAIL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getMailAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getMailAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'MAIL.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'MAIL.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="subject">\n {{ \'MAIL.SUBJECT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'MAIL.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'MAIL.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'MAIL.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'MAIL.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'MAIL.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n <div class="width-300">\n <span class="text-truncate font-size-12">\n {{interaction.subject}}\n </span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'MAIL.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'MAIL.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n\n <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailAccounts-count">\n <span>{{vm.selectedMailAccounts.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="provider">{{ \'MAIL.SERVICE\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows" ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)">\n <td md-cell class="id">{{mailAccount.id}}</td>\n <td md-cell class="name">{{mailAccount.name}}</td>\n <td md-cell class="provider">{{ mailAccount.provider ? (mailAccount.provider | startcase) : (\'MAIL.CUSTOM\' | translate) }}</td>\n <td md-cell class="key">{{mailAccount.key}}</td>\n <td md-cell class="email">{{mailAccount.email}}</td>\n <td md-cell class="active">\n <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="description ">{{mailAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n Edit Email Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySMTP(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n Verify SMTP\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.goToInteractions(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n Go To Interactions\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.goToRealtime()" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n Go To Realtime\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.addAgent(mailAccount, $event)" translate="MAIL.AGENTADD_MAILACCOUNT">\n Add Agent To Email Account\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n Delete Email Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </div>\n\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n <form name="mailQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n\n <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n ADD MAILQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailQueue-image" hide-xs>\n <img ng-src="assets/images/business/mailQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailQueue.id}}\n <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailQueues-count">\n <span>{{vm.selectedMailQueues.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- MAILQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(mailQueue, $event )" translate="MAIL.EDIT_MAILQUEUE">\n Edit MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(mailQueue, $event )" translate="MAIL.TEAMADD_MAILQUEUE">\n teamadd MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(mailQueue, $event )" translate="MAIL.AGENTADD_MAILQUEUE">\n agentadd MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(mailQueue, $event )" translate="MAIL.DELETE_MAILQUEUE">\n Delete MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event )" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n goToRealtime MailQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n\n <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n\n <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n ADD MAILSUBSTATUS\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailSubtatuses-count">\n <span>{{vm.selectedMailSubstatuses.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAIL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- MAILSUBSTATUS TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(mailSubstatus, $event )" translate="MAIL.EDIT_MAILSUBSTATUS">\n Edit MailSubstatus\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event )" translate="MAIL.DELETE_MAILSUBSTATUS">\n Delete MailSubstatus\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getMailAccounts()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- ACCOUNTS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate}}</th>\n <th md-column>{{\'MAIL.KEY\' | translate}}</th>\n <th md-column>{{\'MAIL.TOTAL\' | translate}}</th>\n <th md-column>{{\'MAIL.IN\' | translate}}</th>\n <th md-column>{{\'MAIL.OUT\' | translate}}</th>\n <th md-column>{{\'MAIL.IMAP_STATUS\' | translate}}</th>\n <th md-column>{{\'MAIL.SMTP_STATUS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.count > 0">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="account" md-select-id="id" ng-repeat="account in vm.mailAccounts.rows">\n <td md-cell>{{account.name}}</td>\n <td md-cell>{{account.key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(account.in || 0) + (account.out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{account.in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{account.lastIn ? (account.lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{account.out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{account.lastOut ? (account.lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{account.Imap.messageStatus}}</md-tooltip>\n <div ng-switch="account.Imap.status">\n <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n </div>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + account.Imap.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed" ng-if="account.active && (account.Imap.lastSync && account.Imap.lastSync != \'\')">{{account.Imap.lastSync | date: \'shortTime\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center" ng-if="account.Smtp.status">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{account.Smtp.messageStatus}}</md-tooltip>\n <md-icon md-font-icon="{{ account.Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + account.Smtp.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed">{{account.Smtp.lastSync | date: \'shortTime\'}}</span>\n </div>\n <span class="md-caption grey-fg" ng-if="!account.Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToMailAccount($event, account)" translate="MAIL.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySmtp($event, account)" translate="MAIL.VERIFY_SMTP">\n Verify Smtp\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / ACCOUNTS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/create/dialog.html",'<md-dialog class="plugin-dialog" aria-label="New Plugin">\n <form name="pluginForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus>\n\n <div ng-messages="pluginForm[\'name\'].$error" ng-show="pluginForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'type\'].$error" ng-show="pluginForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="!vm.newPlugin"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description">\n\n <div ng-messages="pluginForm[\'description\'].$error" ng-show="pluginForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true">\n\n <div ng-messages="pluginForm[\'icon\'].$error" ng-show="pluginForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required>\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="pluginForm[\'sidebar\'].$error" ng-show="pluginForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl">\n\n <div ng-messages="pluginForm[\'adminUrl\'].$error" ng-show="pluginForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl">\n\n <div ng-messages="pluginForm[\'agentUrl\'].$error" ng-show="pluginForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'scriptName\'].$error" ng-show="pluginForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true">\n\n <div ng-messages="pluginForm[\'scriptPath\'].$error" ng-show="pluginForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'version\'].$error" ng-show="pluginForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPlugin" ng-click="vm.savePlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid || pluginForm.$pristine" aria-label="SAVE" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPlugin" ng-click="vm.addNewPlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid" aria-label="ADD" translate="MARKETPLACE.ADD_PLUGIN" translate-attr-aria-label="MARKETPLACE.ADD_PLUGIN">\n ADD PLUGIN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPlugin" ng-click="vm.deletePlugin($event)" aria-label="DELETE" translate translate-attr-aria-label="MARKETPLACE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MARKETPLACE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/marketplace/views/plugins/edit/view.html",'<div id="marketplace-plugin" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-plugins-button md-icon-button" aria-label="Go to plugins" ng-click="vm.gotoPlugins()" translate translate-attr-aria-label="MARKETPLACE.GO_TO_PLUGINS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="plugin-image" hide-xs>\n <img ng-src="assets/images/business/plugins.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.plugin.id}}\n <span ng-if="vm.plugin.name">{{vm.plugin.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MARKETPLACE.CREATED_AT"></span> <span>{{vm.plugin.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.savePlugin()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MARKETPLACE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="plugin-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MARKETPLACE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" disabled>\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="true"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'icon\'].$error" ng-show="generalForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="generalForm[\'sidebar\'].$error" ng-show="generalForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'adminUrl\'].$error" ng-show="generalForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'agentUrl\'].$error" ng-show="generalForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" disabled>\n\n <div ng-messages="generalForm[\'scriptName\'].$error" ng-show="generalForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'scriptPath\'].$error" ng-show="generalForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" disabled>\n\n <div ng-messages="generalForm[\'version\'].$error" ng-show="generalForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/marketplace/views/plugins/plugins.html",'<div id="plugins" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MARKETPLACE.PLUGINS">Plugins</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MARKETPLACE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPlugins.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPlugins =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MARKETPLACE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-plugins-count">\n <span>{{vm.selectedPlugins.length}}</span>\n <span translate="MARKETPLACE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MARKETPLACE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPlugins()" translate="MARKETPLACE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPlugins()" translate="MARKETPLACE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPlugins" csv-label="true" filename="plugins.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPlugins($event)" aria-label="delete selected" translate translate-attr-label="MARKETPLACE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n <div ng-if="vm.installing">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="MARKETPLACE.INSTALLING">Installing</span>\n <md-progress-linear md-mode="indeterminate" class="md-accent padding-20"></md-progress-linear>\n </div>\n </md-card>\n </div>\n\n \x3c!-- PLUGIN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPlugins" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPlugins">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="name">{{ \'MARKETPLACE.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'MARKETPLACE.TYPE\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MARKETPLACE.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MARKETPLACE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="version">{{ \'MARKETPLACE.VERSION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.plugins.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MARKETPLACE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="plugin" md-select-id="id" ng-repeat="plugin in vm.plugins.rows">\n <td md-cell ng-if="plugin.userpic"><img class="avatar" alt="{{plugin.name}}" ng-src="api/users/{{plugin.id}}/avatar" /></td>\n <td md-cell ng-if="!plugin.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{plugin.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="name ">{{plugin.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="type ">{{plugin.type}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="active ">\n <md-icon md-colors="{color: {{plugin.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{plugin.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="description ">{{plugin.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="version ">{{plugin.version}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MARKETPLACE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && !plugin.active">\n\n <md-button ng-click="vm.installplugin(plugin, $event )" translate="MARKETPLACE.INSTALL_PLUGIN">\n Install Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(plugin, $event )" translate="MARKETPLACE.EDIT_PLUGIN">\n Edit Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n <md-button ng-click="vm.stopplugin(plugin, $event )" translate="MARKETPLACE.STOP_PLUGIN">\n Stop Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n\n <md-button ng-click="vm.restartplugin(plugin, $event )" translate="MARKETPLACE.RESTART_PLUGIN">\n Restart Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.downloadfile2(plugin, $event , \'plugins\' )" translate="MARKETPLACE.DOWNLOAD_PLUGIN">\n Download Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active">\n\n <md-button ng-click="vm.uninstallplugin(plugin, $event )" translate="MARKETPLACE.UNINSTALL_PLUGIN">\n Uninstall Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(plugin, $event )" translate="MARKETPLACE.DELETE_PLUGIN">\n Delete Plugin\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MARKETPLACE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MARKETPLACE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MARKETPLACE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.plugins.count}}" md-on-paginate="vm.getPlugins" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PLUGIN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD PLUGIN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-plugin-button" ng-click="vm.uploadPlugin($event)" aria-label="upload plugin" translate translate-attr-aria-label="MARKETPLACE.UPLOAD_PLUGIN">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD PLUGIN BUTTON --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="plugin-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="MARKETPLACE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="MARKETPLACE.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="MARKETPLACE.UPLOADING">Uploading</span>\n <span>{{vm.plugin.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="MARKETPLACE.FINISH" translate-attr-aria-label="MARKETPLACE.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/hopperdate/hopperdate.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" ng-change="vm.recalcTZTime()" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" ng-change="vm.recalcTZTime()" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n </md-content>\n </div>\n <md-input-container class="md-block">\n <div layout="row">\n <div flex class="md-block">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" ng-change="vm.recalcTZTime()" autofocus>\n </md-input-container>\n </div>\n <div flex class="md-block">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n </md-input-container>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n\n <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n ADD IVRCAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",'<md-dialog class="ivrCampaign-dialog" aria-label="Clone IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n CLONE IVRCAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="ivrCampaign-image" hide-xs>\n <img ng-src="assets/images/business/ivrCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.ivrCampaign.id}}\n <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveIvrCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.ivrCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.ivrCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n </div>\n <form name="nosuchnumberForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.ivrCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.ivrCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n </div>\n <form name="dropForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n <input type="number" name="dialDropMaxRetry" ng-model="vm.ivrCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n <input type="number" name="dialDropRetryFrequency" ng-model="vm.ivrCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n </div>\n <form name="abandonedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.ivrCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.ivrCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n </div>\n <form name="machineForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n <input type="number" name="dialMachineMaxRetry" ng-model="vm.ivrCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n <input type="number" name="dialMachineRetryFrequency" ng-model="vm.ivrCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n </div>\n <form name="agentrejectForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.ivrCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.ivrCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="priority">\n {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.ContactId}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n {{hopper.phone}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countcongestionretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countbusyretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnoanswerretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnosuchnumberretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countdropretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countabandonedretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countmachineretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{hopper.countagentrejectretry}}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{ hopper.scheduledat | formatdate }}\n </td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>\n {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n <td md-cell colspan="15">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n <td md-cell>\n {{hopperHistory.uniqueid}}\n </td>\n <td md-cell>\n {{hopperHistory.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridname}}\n </td>\n <td md-cell>\n {{hopperHistory.statedesc}}\n </td>\n <td md-cell>\n {{ hopperHistory.scheduledat | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.endtime | formatdate }}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column md-order-by="disposition">\n {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n <td md-cell>\n {{hopperFinal.uniqueid}}\n </td>\n <td md-cell>\n {{hopperFinal.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridname}}\n </td>\n <td md-cell>\n {{hopperFinal.statedesc}}\n </td>\n <td md-cell>\n {{hopperFinal.countcongestionretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countbusyretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnoanswerretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnosuchnumberretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countdropretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countabandonedretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countmachineretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countagentrejectretry}}\n </td>\n <td md-cell>\n {{ hopperFinal.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperFinal.endtime | formatdate }}\n </td>\n <td md-cell>\n {{hopperFinal.disposition}}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n <td md-cell colspan="28">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <ms-search-bar on-search="vm_dc.getIvrCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n <td md-cell>\n {{hopperBlack.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperBlack.phone}}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-ivrCampaigns-count">\n <span>{{vm.selectedIvrCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- IVRCAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':ivrCampaign.TrunkId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ (vm.projects | filter : {\'id\':ivrCampaign.SquareProjectId} : true)[0].name }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(ivrCampaign, $event )" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n Edit IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(ivrCampaign, $event )" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n clone IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.listadddialog(ivrCampaign, $event )" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n listadd IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event )" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n blacklistadd IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event )" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n Delete IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event )" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n goToRealtime IvrCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n\n <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n ADD QUEUECAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",'<md-dialog class="queueCampaign-dialog" aria-label="Clone QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n CLONE QUEUECAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.dateTime" ng-change="vm.recalcTZTime()">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div layout="row">\n <div flex class="md-block">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.DIAL_TIMEZONE">Dial Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.contact.dialTimezone" autofocus>\n </md-input-container>\n </div>\n <div flex class="md-block">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.SYSTEM_TIME">System time</label>\n <input type="text" readonly value="{{vm.hopper.scheduledat}}">\n </md-input-container>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="queueCampaign-image" hide-xs>\n <img ng-src="assets/images/business/queueCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.queueCampaign.id}}\n <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveQueueCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (nosuchnumberForm.$invalid) || (dropForm.$invalid) || (abandonedForm.$invalid) || (machineForm.$invalid) || (agentrejectForm.$invalid) || (additionalphonesForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (thresholdsForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.queueCampaign.dialCutDigit" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n </div>\n <form name="queueForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" value="tTxX" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" value="3" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0" value="1" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.queueCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/" value="" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" value="4" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container nosuchnumber md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOSUCHNUMBER">NOSUCHNUMBER</div>\n </div>\n <form name="nosuchnumberForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERMAXRETRY">NoSuchNumberMaxRetry</label>\n <input type="number" name="dialNoSuchNumberMaxRetry" ng-model="vm.queueCampaign.dialNoSuchNumberMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERMAXRETRY"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_REQUIRED">NoSuchNumberMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOSUCHNUMBERRETRYTIME">NoSuchNumberRetryTime</label>\n <input type="number" name="dialNoSuchNumberRetryFrequency" ng-model="vm.queueCampaign.dialNoSuchNumberRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOSUCHNUMBERRETRYTIME"></span></div>\n <div ng-messages="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$error" ng-show="nosuchnumberForm[\'dialNoSuchNumberRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_REQUIRED">NoSuchNumberRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoSuchNumberRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container drop md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.DROP">DROP</div>\n </div>\n <form name="dropForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPMAXRETRY">DropMaxRetry</label>\n <input type="number" name="dialDropMaxRetry" ng-model="vm.queueCampaign.dialDropMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPMAXRETRY"></span></div>\n <div ng-messages="dropForm[\'dialDropMaxRetry\'].$error" ng-show="dropForm[\'dialDropMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_REQUIRED">DropMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DROPRETRYTIME">DropRetryTime</label>\n <input type="number" name="dialDropRetryFrequency" ng-model="vm.queueCampaign.dialDropRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DROPRETRYTIME"></span></div>\n <div ng-messages="dropForm[\'dialDropRetryFrequency\'].$error" ng-show="dropForm[\'dialDropRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_REQUIRED">DropRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">DropRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container abandoned md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ABANDONED">ABANDONED</div>\n </div>\n <form name="abandonedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDMAXRETRY">AbandonedMaxRetry</label>\n <input type="number" name="dialAbandonedMaxRetry" ng-model="vm.queueCampaign.dialAbandonedMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDMAXRETRY"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedMaxRetry\'].$error" ng-show="abandonedForm[\'dialAbandonedMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_REQUIRED">AbandonedMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ABANDONEDRETRYTIME">AbandonedRetryTime</label>\n <input type="number" name="dialAbandonedRetryFrequency" ng-model="vm.queueCampaign.dialAbandonedRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ABANDONEDRETRYTIME"></span></div>\n <div ng-messages="abandonedForm[\'dialAbandonedRetryFrequency\'].$error" ng-show="abandonedForm[\'dialAbandonedRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_REQUIRED">AbandonedRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AbandonedRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container machine md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.MACHINE">MACHINE</div>\n </div>\n <form name="machineForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINEMAXRETRY">MachineMaxRetry</label>\n <input type="number" name="dialMachineMaxRetry" ng-model="vm.queueCampaign.dialMachineMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINEMAXRETRY"></span></div>\n <div ng-messages="machineForm[\'dialMachineMaxRetry\'].$error" ng-show="machineForm[\'dialMachineMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_REQUIRED">MachineMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MACHINERETRYTIME">MachineRetryTime</label>\n <input type="number" name="dialMachineRetryFrequency" ng-model="vm.queueCampaign.dialMachineRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MACHINERETRYTIME"></span></div>\n <div ng-messages="machineForm[\'dialMachineRetryFrequency\'].$error" ng-show="machineForm[\'dialMachineRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_REQUIRED">MachineRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">MachineRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container agentreject md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AGENTREJECT">AGENTREJECT</div>\n </div>\n <form name="agentrejectForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTMAXRETRY">AgentRejectMaxRetry</label>\n <input type="number" name="dialAgentRejectMaxRetry" ng-model="vm.queueCampaign.dialAgentRejectMaxRetry" min="1" max="999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTMAXRETRY"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectMaxRetry\'].$error" ng-show="agentrejectForm[\'dialAgentRejectMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_REQUIRED">AgentRejectMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTREJECTRETRYTIME">AgentRejectRetryTime</label>\n <input type="number" name="dialAgentRejectRetryFrequency" ng-model="vm.queueCampaign.dialAgentRejectRetryFrequency" min="1" max="99999" value="150" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTREJECTRETRYTIME"></span></div>\n <div ng-messages="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$error" ng-show="agentrejectForm[\'dialAgentRejectRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_REQUIRED">AgentRejectRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">AgentRejectRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container additionalphones md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADDITIONALPHONES">ADDITIONALPHONES</div>\n </div>\n <form name="additionalphonesForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLADDITIONALPHONEAFTERMIN">CallAdditionalPhoneAfterMin</label>\n <input type="number" name="callAdditionalPhoneAfterMin" ng-model="vm.queueCampaign.callAdditionalPhoneAfterMin" min="1" max="99999" value="3" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="additionalphonesForm[\'callAdditionalPhoneAfterMin\'].$error" ng-show="additionalphonesForm[\'callAdditionalPhoneAfterMin\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_REQUIRED">CallAdditionalPhoneAfterMin field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CallAdditionalPhoneAfterMin must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CALLADDITIONALPHONEAFTERMIN_MUST_BE_LESS_THAN_OR_EQUAL_TO">CallAdditionalPhoneAfterMin must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.queueCampaign.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.queueCampaign.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n </div>\n <form name="advancedpreviewForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedpreviewForm[\'acwTimeout\'].$error" ng-show="advancedpreviewForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'predictive\'" class="queueCampaign-detail-form-container thresholds md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.THRESHOLDS">THRESHOLDS</div>\n </div>\n <form name="thresholdsForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEMAXTHRESHOLD">PredictiveMaxThreshold</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMAXTHRESHOLD"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMaxThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEMINTHRESHOLD">PredictiveMinThreshold</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEMINTHRESHOLD"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveIntervalMinThreshold" min="1" max="100" step="1" class="md-accent"></md-slider>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n </div>\n <form name="recallmeForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialPreviewAutoRecallMe" aria-label="Preview_Auto_Recall_Me" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_AUTO_RECALL_ME">Preview_Auto_Recall_Me</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_AUTO_RECALL_ME"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'preview\'" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialPreviewRecallmeReminder" aria-label="Preview_Recall_Me_Reminder" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.PREVIEW_RECALL_ME_REMINDER">Preview_Recall_Me_Reminder</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREVIEW_RECALL_ME_REMINDER"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" value="07:00-22:00,*,*,*" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit"></ms-timezone>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span></div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0" value="2500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0" value="1500" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0" value="800" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0" value="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0" value="50" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0" value="3" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767" value="256" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0" value="5000" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHoppers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="priority">\n {{ \'MOTIONDIALER.PRIORITY\' | translate }}\n </th>\n <th md-column md-order-by="recallme">\n {{ \'MOTIONDIALER.RECALLAGENT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.ContactId}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell privacy ng-cloak>\n {{hopper.phone}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countcongestionretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countbusyretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnoanswerretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countnosuchnumberretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countdropretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countabandonedretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countmachineretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{hopper.countagentrejectretry}}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{ hopper.scheduledat | formatdate }}\n </td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>\n {{ vm_dc.arraypriority[hopper.priority].option }} </td>\n\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHopperHistories()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="scheduledat">\n {{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n <td md-cell>\n {{hopperHistory.uniqueid}}\n </td>\n <td md-cell>\n {{hopperHistory.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperHistory.calleridname}}\n </td>\n <td md-cell>\n {{hopperHistory.statedesc}}\n </td>\n <td md-cell>\n {{ hopperHistory.scheduledat | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperHistory.endtime | formatdate }}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHopperFinals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="MOTIONDIALER.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">\n {{ \'MOTIONDIALER.UNIQUEID\' | translate }}\n </th>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="calleridnum">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column md-order-by="calleridname">\n {{ \'MOTIONDIALER.NAME\' | translate }}\n </th>\n <th md-column md-order-by="statedesc">\n {{ \'MOTIONDIALER.STATUS\' | translate }}\n </th>\n <th md-column md-order-by="countcongestionretry">\n {{ \'MOTIONDIALER.CONGESTION\' | translate }}\n </th>\n <th md-column md-order-by="countbusyretry">\n {{ \'MOTIONDIALER.BUSY\' | translate }}\n </th>\n <th md-column md-order-by="countnoanswerretry">\n {{ \'MOTIONDIALER.NOANSWER\' | translate }}\n </th>\n <th md-column md-order-by="countnosuchnumberretry">\n {{ \'MOTIONDIALER.NOSUCHNUMBER\' | translate }}\n </th>\n <th md-column md-order-by="countdropretry">\n {{ \'MOTIONDIALER.DROP\' | translate }}\n </th>\n <th md-column md-order-by="countabandonedretry">\n {{ \'MOTIONDIALER.ABANDONED\' | translate }}\n </th>\n <th md-column md-order-by="countmachineretry">\n {{ \'MOTIONDIALER.MACHINE\' | translate }}\n </th>\n <th md-column md-order-by="countagentrejectretry">\n {{ \'MOTIONDIALER.AGENTREJECT\' | translate }}\n </th>\n <th md-column md-order-by="starttime">\n {{ \'MOTIONDIALER.STARTTIME\' | translate }}\n </th>\n <th md-column md-order-by="endtime">\n {{ \'MOTIONDIALER.ENDTIME\' | translate }}\n </th>\n <th md-column md-order-by="disposition">\n {{ \'MOTIONDIALER.DISPOSITION\' | translate }}\n </th>\n <th md-column md-order-by="secondDisposition">\n {{ \'MOTIONDIALER.SECOND_LEVEL_DISPOSITION\' | translate }}\n </th>\n <th md-column md-order-by="thirdDisposition">\n {{ \'MOTIONDIALER.THIRD_LEVEL_DISPOSITION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n <td md-cell>\n {{hopperFinal.uniqueid}}\n </td>\n <td md-cell>\n {{hopperFinal.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridnum}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperFinal.calleridname}}\n </td>\n <td md-cell>\n {{hopperFinal.statedesc}}\n </td>\n <td md-cell>\n {{hopperFinal.countcongestionretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countbusyretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnoanswerretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countnosuchnumberretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countdropretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countabandonedretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countmachineretry}}\n </td>\n <td md-cell>\n {{hopperFinal.countagentrejectretry}}\n </td>\n <td md-cell>\n {{ hopperFinal.starttime | formatdate }}\n </td>\n <td md-cell>\n {{ hopperFinal.endtime | formatdate }}\n </td>\n <td md-cell>\n {{hopperFinal.disposition}}\n </td>\n <td md-cell>\n {{hopperFinal.secondDisposition}}\n </td>\n <td md-cell>\n {{hopperFinal.thirdDisposition}}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n <td md-cell colspan="30">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <ms-search-bar on-search="vm_dc.getQueueCampaignHopperBlacks()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">\n {{ \'MOTIONDIALER.CONTACTID\' | translate }}\n </th>\n <th md-column md-order-by="phone">\n {{ \'MOTIONDIALER.PHONE\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n <td md-cell>\n {{hopperBlack.ContactId}}\n </td>\n <td md-cell privacy ng-cloak>\n {{hopperBlack.phone}}\n </td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-queueCampaigns-count">\n <span>{{vm.selectedQueueCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MOTIONDIALER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="MOTIONDIALER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':queueCampaign.TrunkId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(queueCampaign, $event )" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n Edit QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(queueCampaign, $event )" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n clone QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.listadddialog(queueCampaign, $event )" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n listadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event )" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n blacklistadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(queueCampaign, $event )" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n teamadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(queueCampaign, $event )" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n agentadd QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(queueCampaign, $event )" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n Delete QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event )" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n goToRealtime QueueCampaign\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n </ms-search-bar>\n <div flex></div>\n\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n </md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n <td md-cell class="id">{{call.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n <td md-cell class="list">\n {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">{{call.queuecallerexitAt ? (call.queuecallerexitAt | formatdate) : undefined }}\n </td>\n <td md-cell class="list">{{call.queuecallerexitreason}}</td>\n <td md-cell class="list">{{call.lastAssignedTo}}</td>\n <td md-cell class="list">{{ call.disposition }}</td>\n <td md-cell class="list">{{ call.secondDisposition }}</td>\n <td md-cell class="list">{{ call.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n Assigned\n to</md-button>\n <md-menu-content>\n <md-menu-item ng-if="call.lastAssignedTo">\n <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getCampaigns()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n <tr md-row>\n <th md-column md-order-by="name" class="bl">{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column>{{\'MOTIONDIALER.ACTIVE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.campaigns.rows.length > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="campaign in vm.campaigns.rows">\n <td md-cell>\n <span>{{campaign.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n Edit Campaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.campaigns.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ABANDONED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.DROPPED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues.rows.length > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="queue in vm.queues.rows">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 ) ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n\n <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n\n <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n ADD OPENCHANNELACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",'<md-dialog class="openchannelAccount-dialog" aria-label="openchannelAccount" ng-init="vm.onInit()">\n <form name="openchannelAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">Add Agent to openchannelAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'accesskeyid\'].$error" ng-show="openchannelAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'secretaccesskey\'].$error" ng-show="openchannelAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'lexregion\'].$error" ng-show="openchannelAccountFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'botname\'].$error" ng-show="openchannelAccountFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'key\'].$error" ng-show="openchannelAccountFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'projectId\'].$error" ng-show="openchannelAccountFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'clientEmail\'].$error" ng-show="openchannelAccountFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'privateKey\'].$error" ng-show="openchannelAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'language\'].$error" ng-show="openchannelAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="OPENCHANNEL.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="openchannelAccountFormApp[\'welcomemessage\'].$error" ng-show="openchannelAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/tag/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'tag\'].$error" ng-show="openchannelAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n\n <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n ADD OPENCHANNELCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelAccount-image" hide-xs>\n <img ng-src="assets/images/business/openchannelAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelAccount.id}}\n <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.openchannelAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.MAPKEY">MapKey</label>\n <md-select name="mapKey" ng-model="vm.openchannelAccount.mapKey" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-optgroup label="standard">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="!mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="custom">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="generalForm[\'mapKey\'].$error" ng-show="generalForm[\'mapKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MAPKEY_REQUIRED">MapKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n </div>\n <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.queueTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.openchannelAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.agentTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.openchannelAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.openchannelAccount.token" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.TOKEN"></span></div>\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.mandatoryDisposition" class="md-block">\n <label translate="OPENCHANNEL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.openchannelAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="OpenchannelAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add openchannel dispositions" translate translate-attr-label="OPENCHANNEL.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'OPENCHANNEL.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'OPENCHANNEL.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'OPENCHANNEL.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'OPENCHANNEL.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'OPENCHANNEL.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{openchannelCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>\n {{ openchannelCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n Edit OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n Delete OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="OPENCHANNEL.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getOpenchannelAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getOpenchannelAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'OPENCHANNEL.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'OPENCHANNEL.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'OPENCHANNEL.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'OPENCHANNEL.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'OPENCHANNEL.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'OPENCHANNEL.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'OPENCHANNEL.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'OPENCHANNEL.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'OPENCHANNEL.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || (vm_dc.userProfile.downloadOmnichannelInteractions && vm_dc.userProfile.downloadAttachments)">\n <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event, true)" translate="OPENCHANNEL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event)" translate="OPENCHANNEL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelAccounts-count">\n <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':openchannelAccount.ListId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(openchannelAccount, $event )" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n Edit OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event )" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n Interactions OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(openchannelAccount, $event )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">\n AgentAdd OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event )" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n Delete OpenchannelAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n\n <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n ADD OPENCHANNELQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelQueue-image" hide-xs>\n <img ng-src="assets/images/business/openchannelQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelQueue.id}}\n <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelQueues-count">\n <span>{{vm.selectedOpenchannelQueues.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNEL.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(openchannelQueue, $event )" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n Edit OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(openchannelQueue, $event )" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n teamadd OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(openchannelQueue, $event )" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n agentadd OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event )" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n Delete OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event )" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n goToRealtime OpenchannelQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/plugins/views/plugin/plugin.html",'<div ng-if="!vm.plugin">\n <p>Plugin not available...</p>\n</div>\n<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/realtime/views/agents/view.html",'<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools quick-filter-container">\n <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getAgents()" query="vm.query" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = null; vm.getAgents()" aria-label="Status filter">\n <md-option ng-value="null">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n </md-select>\n <md-select ng-if="vm.query.globalStatusFilter === \'pause\' || vm.query.globalStatusFilter === \'*pause\'" ng-model="vm.query.pauseTypeFilter" class="md-caption ml-16" ng-change="vm.getAgents()">\n <md-option ng-value="null">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="DEFAULT PAUSE">{{ \'VOICE.DEFAULT_PAUSE\' | translate | uppercase }}</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">{{ \'STAFF.LOGININPAUSE\' | translate | uppercase }}</md-option>\n <md-option value="Auto-Pause">{{ \'VOICE.AUTOPAUSE\' | translate | uppercase }}</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n <md-select ng-model="vm.query.globalQueueFilter" multiple class="md-caption margin-left-10 mw-150" placeholder="{{ \'DASHBOARDS.SELECT_QUEUE\' | translate }}" md-on-open="vm.getQueuesByChannel()" md-on-close="vm.getAgents()">\n <md-button ng-click="vm.selectAllQueues()" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.SELECT_ALL\' | translate}}</md-button>\n <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{\n queue.name }}</md-option>\n <md-button ng-click="vm.clearQueuesSelection()" md-no-ink class="md-primary" layout-fill>\n {{\'DASHBOARDS.CLEAR\' | translate}}</md-button>\n </md-select>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table multiple md-progress="vm.getAgents">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.onSort">\n <tr md-row>\n <th class="bv text-center" colspan="5">{{ \'VOICE.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">\n {{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th ng-if="vm.license.whatsapp" class="bv bl text-center" colspan="2">\n {{ \'WHATSAPP.WHATSAPP\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" colspan="2" md-column md-order-by="fullname">\n {{ \'VOICE.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">\n {{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">\n {{ \'VOICE.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">\n {{ \'VOICE.PAUSE_TIME\' | translate }}</th>\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n <th ng-if="vm.license.whatsapp" class="bl text-center">{{ \'WHATSAPP.STATUS\' | translate }}</th>\n <th ng-if="vm.license.whatsapp" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'WHATSAPP.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.count > 0">\n <td md-cell colspan="19">\n <div layout="row" layout-align="center center">\n <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{agent.userpic && \'api/users/\'+ agent.id +\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{agent.fullname}}</span>\n <span>{{agent.internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt padding-5">\n <div layout="row" layout-align="start center" ng-if="vm.license.screenrecording && (agent.phoneBarEnableScreenRecordingByAgent || agent.phoneBarEnableAutomaticScreenRecording)">\n <div class="column">\n <span>\n <md-icon md-font-icon="icon-camcorder-box" ng-class="agent.screenrecording ? \'green-fg\' : \'grey-fg\'" aria-hidden="true">\n <md-tooltip>\n {{ agent.screenrecording ? \'VOICE.TOOLTIP_SCREENRECORDING_ON\' : \'VOICE.TOOLTIP_SCREENRECORDING_OFF\'\n | translate }}\n </md-tooltip>\n </md-icon>\n </span>\n </div>\n </div>\n </td>\n <td class="bt text-center">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[agent.globalStatus]\">\n <span ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">{{ 'VOICE.PAUSE' | translate | uppercase }} (</span>{{\n ['pause', '*pause'].includes(agent.globalStatus) ? \n ((agent.globalStatusDisplayValue === 'DEFAULT PAUSE' ? ('VOICE.DEFAULT_PAUSE' | translate) : agent.globalStatusDisplayValue) | uppercase) : \n ('VOICE.' + (agent.globalStatusDisplayValue | uppercase) | translate | uppercase) }}<span ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">)</span>\n </span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"agent.lastLoginAt\" utc-offset=\"vm.utcOffset\"></timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\" start-time=\"agent.lastPauseAt\" utc-offset=\"vm.utcOffset\"></timer>\n </td>\n <td class=\"bt bl text-center\">\n <span ng-if=\"!agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[agent.voiceStatus]\">\n {{ 'VOICE.' + (agent.voiceStatus | uppercase) | translate | uppercase }}</span>\n <span ng-if=\"agent.onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">\n {{ 'VOICE.ONHOLD' | translate | uppercase }}</span>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\" ng-if=\"agent.voiceStatus === 'talking' || agent.voiceStatus === 'ringing'\">\n <span ng-if=\"agent.queue\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n agent.queue }}</span>\n <span ng-if=\"agent.destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\" privacy ng-cloak>{{\n agent.destconnectedlinenum }}</span>\n <span ng-if=\"agent.routealias\" class=\"padding-5\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">{{\n agent.routealias }}</span>\n <span class=\"padding-5\" ng-if=\"agent.queue || agent.destconnectedlinenum\">\n <timer start-time=\"agent.voiceStatusTime\" utc-offset=\"vm.utcOffset\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.voiceStatus]\">\n </timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl text-center\" ng-if=\"vm.license.chat\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.chatStatus]\">\n {{ 'VOICE.' + (agent.chatStatus | uppercase) | translate | uppercase }}</span>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.chatStatus]\">\n {{ agent.chatCurrentCapacity }}</td>\n <td class=\"bl bt text-center\" ng-if=\"vm.license.mail\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.mailStatus]\">\n {{ 'VOICE.' + (agent.mailStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.mailStatus]\">\n {{ agent.mailCurrentCapacity }}</td>\n <td class=\"bl bt text-center\" ng-if=\"vm.license.messaging\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.smsStatus]\">\n {{ 'VOICE.' + (agent.smsStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.smsStatus]\">\n {{ agent.smsCurrentCapacity }}</td>\n <td class=\"bt bl text-center\" ng-if=\"vm.license.openchannel\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.openchannelStatus]\">\n {{ 'VOICE.' + (agent.openchannelStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.openchannelStatus]\">\n {{ agent.openchannelCurrentCapacity }}</td>\n <td class=\"bt bl text-center\" ng-if=\"vm.license.fax\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.faxStatus]\">\n {{ 'VOICE.' + (agent.faxStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.faxStatus]\">\n {{ agent.faxCurrentCapacity }}</td>\n <td class=\"bl bt text-center\" ng-if=\"vm.license.whatsapp\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[agent.whatsappStatus]\">\n {{ 'VOICE.' + (agent.whatsappStatus | uppercase) | translate | uppercase }}\n </span>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.whatsapp\" ng-class=\"{'idle':'dark-lime-fg','maxcapacity':'dark-red-fg','working':'iron-fg','pause':'light-brown-fg'}[agent.whatsappStatus]\">\n {{ agent.whatsappCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(agent, $event)\" translate=\"VOICE.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.addQueue(agent, $event)\" translate=\"{{ vm.channel.toUpperCase() + '.AGENTADD_QUEUE' }}\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.license.screenrecording && agent.phoneBarEnableScreenRecordingByAgent\">\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.SCREENRECORDING\">Manage Screen Recording\n </md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click=\"vm.manageScreenRecording(agent, !agent.screenrecording)\" translate=\"{{ agent.screenrecording ? 'VOICE.STOP_SCREENRECORDING' : 'VOICE.START_SCREENRECORDING' }}\" aria-label=\"Screen Recording\">\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\"agent.voicePause && 'DEFAULT PAUSE' === agent.pauseType\" ng-click=\"vm.pause(agent)\">\n <em translate=\"VOICE.DEFAULT_PAUSE\">Default Pause</em>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"agent.voicePause && pause.name === agent.pauseType\" ng-click=\"vm.pause(agent, pause.name)\">{{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"['pause', '*pause'].includes(agent.globalStatus)\">\n <md-button ng-click=\"vm.unpause(agent)\" translate=\"VOICE.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n<md-table-pagination md-label=\"{page: '{{'VOICE.PAGE' | translate}}:', rowsPerPage: '{{'VOICE.ROWSPERPAGE' | translate}}:', of: '{{'VOICE.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.agents.count}}\" md-on-paginate=\"vm.onPaginate\" md-page-select></md-table-pagination>"),e.put("app/main/apps/realtime/views/queue-calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </div>\n</md-toolbar>\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th ng-if="vm.voiceQueueType === \'inbound\'" md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueuesChannels.count > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="channel in vm.voiceQueuesChannels.rows | limitObjectFromTo: vm.query.limit:(vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td ng-if="vm.voiceQueueType === \'inbound\'" md-cell>{{channel.routealias}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell privacy ng-cloak>\n <span ng-if="vm.voiceQueueType === \'inbound\'">{{channel.calleridname}}, </span>\n <span>{{channel.calleridnum}}</span>\n </td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt"></timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt"></timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt"></timer>\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu class="no-margin">\n <md-button ng-mouseenter="vm.getAvailableAgents()" translate="VOICE.REDIRECT_TO_AGENT">\n Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-if="!vm.availableAgents">\n <md-progress-circular class="md-accent auto-margin" md-diameter="32" md-mode="indeterminate">\n </md-progress-circular>\n </md-menu-item>\n <md-menu-item ng-if="vm.availableAgents.length > 0" ng-repeat="agent in vm.availableAgents">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">\n {{agent.name}}</md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.availableAgents.length === 0">\n <span>{{ \'VOICE.NO_AGENT_AVAILABLE\' | translate }}</span>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-page="vm.query.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{ vm.voiceQueuesChannels.count }}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/realtime/views/queues/predictive/dialog.html",'<md-dialog class="predictive-dialog" aria-label="New predictive">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.queueCampaign.name }} {{ \'DASHBOARDS.INFO\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="text-center">\n <ds-widget-clock data-show-digital></ds-widget-clock>\n <div ng-if="!vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive">\n <div class="md-title"><span translate="MOTIONDIALER.PREDICTIVE_IS_NOT_RUNNING">Predictive is not running</span></div>\n </div>\n\n <div ng-if="vm.queueCampaign.startProgressive && !vm.queueCampaign.startPredictive" class="m-10">\n <div layout="row">\n <div flex="" class="column">\n <div class="md-headline"><span translate="MOTIONDIALER.DATA_COLLECTION_IN_PROGRESSIVE">Data collection in progressive</span></div>\n <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n </div>\n </div>\n\n <div layout="row">\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n <div class="md-headline">{{ vm.formatTime(vm.queueCampaign.startProgressive) }}</div>\n </div>\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n <div class="md-headline">\n {{ vm.formatTime(vm.queueCampaign.startProgressive, vm.queueCampaign.dialPredictiveInterval) }}\n </div>\n </div>\n </div>\n <div>\n <span class="text-boxed blue-bg white-fg">\n {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n </span>\n </div>\n </div>\n <div ng-if="vm.queueCampaign.startPredictive" class="m-10">\n <div layout="row">\n <div flex="" class="column">\n <div class="md-headline"><span translate="MOTIONDIALER.PREDICTIVE_IS_RUNNING">Predictive is runnning</span></div>\n <div class="md-subhead">({{vm.queueCampaign.dialPredictiveInterval}} minutes)</div>\n </div>\n </div>\n\n <div layout="row">\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.STARTTIME">Start Time</span></div>\n <div class="md-headline">{{ vm.formatTime(vm.queueCampaign.startPredictive) }}</div>\n </div>\n <div flex="" class="column">\n <div class="md-subhead"><span translate="MOTIONDIALER.ENDTIME">End Time</span></div>\n <div class="md-headline">\n {{ vm.formatTime(vm.queueCampaign.startPredictive, vm.queueCampaign.dialPredictiveInterval) }}\n </div>\n </div>\n </div>\n <div>\n <span class="text-boxed blue-bg white-fg">\n {{vm.queueCampaign.message ? (\'MOTIONDIALER.\' + vm.queueCampaign.message | translate) : \'--\'}}\n </span>\n </div>\n <div class="row">\n <md-card>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Predictive - {{ \'MOTIONDIALER.PREVIOUS_INTERVAL\' | translate }}</span>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <tbody md-body>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.TOTAL_CALLS">Total Calls</span></td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalTotalCalls }}</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.ANSWERED_CALLS">Total Calls</span></td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalAnsweredCalls }}</td>\n </tr>\n \x3c!-- Temporaneamente non mostrate perchè contengono anche i dati dell\'intervallo corrente --\x3e\n \x3c!-- <tr md-row>\n <td md-cell>Dropped Calls Timeout</td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsTimeout }}</td>\n </tr>\n <tr md-row>\n <td md-cell>Dropped Calls Caller Exit</td>\n <td md-cell>{{ vm.queueCampaign.predictiveIntervalDroppedCallsCallersExit }}\n </td>\n </tr> --\x3e\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.AVG_HOLD_TIME">AVG Hold Time</span></td>\n <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgHoldtime | number:0 }}s</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.AVG_TALK_TIME">AVG Talk Time</span></td>\n <td md-cell>~ {{ vm.queueCampaign.predictiveIntervalAvgTalktime | number:0 }}s</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n <md-card>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">ErlangB - {{ \'MOTIONDIALER.CURRENT_INTERVAL\' | translate }}</span>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <tbody md-body>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span></td>\n <td md-cell>{{ vm.queueCampaign.erlangCalls }}</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.ONE_CALL_EVERY">One call every</span></td>\n <td md-cell>~ {{ vm.queueCampaign.erlangCallToSecond | number:0 }}s</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.DROPRATE">Drop Rate</span></td>\n <td md-cell>{{ vm.queueCampaign.erlangAbandonmentRate * 100 | number:2 }}%</td>\n </tr>\n <tr md-row>\n <td md-cell><span translate="MOTIONDIALER.AGENTBUSYFACTOR">Agent Busy Factor</span></td>\n <td md-cell>{{ vm.queueCampaign.erlangBusyFactor * 100 | number:2 }}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </div>\n </md-dialog-content>\n</md-dialog>'),e.put("app/main/apps/realtime/views/queues/templates/actions.html",'<md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editQueue($event, queue)" translate="{{ (vm.channel | uppercase) + \'.EDIT_QUEUE\' }}">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="queue.dialMethod === \'predictive\'">\n <md-button ng-click="vm.showPredictiveInfo($event, queue)" translate="MOTIONDIALER.SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO">\n Show Predictive Info\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.addOrRemoveAgents($event, queue)" translate="{{ (vm.channel | uppercase) + \'.AGENTSADD_QUEUE\' }}">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n</md-menu>'),e.put("app/main/apps/realtime/views/queues/templates/headers/default.html","<tr md-row>\n <th md-column md-order-by=\"name\">{{ (vm.channel | uppercase) + '.NAME' | translate }}</th>\n <th md-column>{{ (vm.channel | uppercase) + '.LOGGED_IN' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.AVAILABLE' | translate }}</th>\n <th md-column>{{ (vm.channel | uppercase) + '.PAUSED' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.WAITING_INTERACTIONS' | translate }}</th>\n <th md-column width=\"10px\"></th>\n</tr>"),e.put("app/main/apps/realtime/views/queues/templates/headers/inbound.html","<tr md-row>\n <th md-column md-order-by=\"name\">{{ 'VOICE.NAME' | translate }}</th>\n <th md-column>{{ 'VOICE.LOGGED_IN' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.AVAILABLE' | translate }}</th>\n <th md-column>{{ 'VOICE.PAUSED' | translate }}</th>\n <th md-column>{{ 'VOICE.TALKING' | translate }}</th>\n <th md-column>{{ 'VOICE.BUSY' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.WAITING_CALLS' | translate }}</th>\n <th md-column width=\"10px\"></th>\n</tr>"),e.put("app/main/apps/realtime/views/queues/templates/headers/outbound.html","<tr md-row>\n <th md-column md-order-by=\"name\">{{ 'MOTIONDIALER.NAME' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.LOGGED_IN' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.AVAILABLE' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.PAUSED' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.TALKING' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.BUSY' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.WAITING_CALLS' | translate }}</th>\n <th md-column>{{ 'DASHBOARDS.ORIGINATED_TEXT' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.MESSAGE' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.METHOD' | translate }}</th>\n <th md-column>{{ 'MOTIONDIALER.TRUNK' | translate }}</th>\n <th md-column md-order-by=\"dialActive\">{{ 'MOTIONDIALER.ACTIVE' | translate }}</th>\n <th md-column width=\"10px\"></th>\n</tr>"),e.put("app/main/apps/realtime/views/queues/templates/rows/default.html",'<tr md-row ng-hide="vm.queues.count > 0">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n</tr>\n<tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n <td md-cell>{{ queue.name }}</td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.loggedIn }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n </td>\n\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit" ng-include="\'app/main/apps/realtime/views/queues/templates/actions.html\'"></td>\n</tr>'),e.put("app/main/apps/realtime/views/queues/templates/rows/inbound.html",'<tr md-row ng-hide="vm.queues.count > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n</tr>\n<tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n <td md-cell>{{ queue.name }}</td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.talking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.inUse - queue.talking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n </td>\n\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit" ng-include="\'app/main/apps/realtime/views/queues/templates/actions.html\'"></td>\n</tr>'),e.put("app/main/apps/realtime/views/queues/templates/rows/outbound.html",'<tr md-row ng-hide="vm.queues.count > 0">\n <td md-cell colspan="13">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n</tr>\n<tr md-row md-select="queue" md-select-id="id" ng-repeat="queue in vm.queues.rows">\n <td md-cell>{{ queue.name }}</td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.loggedInDb }} ({{ queue.loggedIn }})</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.available }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.paused }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.talking + queue.pTalking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.inUse - queue.talking - queue.pTalking }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.waiting }}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.originated }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{ queue.message ? (\'MOTIONDIALER.\' + queue.message | translate) : (queue.statusMessage ? (\'MOTIONDIALER.\' + queue.statusMessage | translate) : \'--\')}}</span>\n </td>\n <td md-cell>\n <span class="font-size-18 grey-fg">{{ queue.dialMethod || 0 }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{ queue.Trunk ? queue.Trunk.name : \'--\' }}</span>\n </td>\n <td md-cell>\n'+" <md-icon md-colors=\"{color: {{queue.dialActive ? '\\'green\\'' : '\\'red\\''}}}\" md-font-icon=\"{{queue.dialActive ? 'icon-check' : 'icon-close'}}\"></md-icon>\n </td>\n\n <td md-cell class=\"actions\" ng-if=\"vm.crudPermissions.canEdit\" ng-include=\"'app/main/apps/realtime/views/queues/templates/actions.html'\"></td>\n</tr>"),e.put("app/main/apps/realtime/views/queues/view.html",'<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="{{ (vm.channel | uppercase) + \'.QUEUES\' }}">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getQueues()" query="vm.query" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues" ng-include="vm.headersTemplate">\n </thead>\n <tbody md-body ng-include="vm.rowsTemplate"></tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{ \'DASHBOARDS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'DASHBOARDS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'DASHBOARDS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>'),e.put("app/main/apps/settings/views/cloudProviders/cloudProviders.html",'<div id="cloudProviders" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CLOUD_PROVIDERS">Cloud Providers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAiTools.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedAiTools =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cloudProviders-count">\n <span>{{vm.selectedAiTools.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAiTools()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAiTools()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAiTools" csv-label="true" filename="cloudProviders.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm.deleteSelectedAiTools($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CLOUDPROVIDER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAiTools" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAiTools">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SETTINGS.NAME\' | translate }}</th>\n <th md-column md-order-by="service">{{ \'SETTINGS.SERVICE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cloudProviders.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cloudProvider" md-select-id="id" ng-repeat="cloudProvider in vm.cloudProviders.rows">\n <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="id">{{cloudProvider.id}}</td>\n <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="name">{{cloudProvider.name}}</td>\n <td ng-click="vm.createOrEditCloudProvider($event, cloudProvider)" md-cell class="service">{{ vm.services[cloudProvider.service] }}</td>\n\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n <md-button ng-click="vm.authenticateToMicrosoftIdentityPlatform(cloudProvider)" translate="SETTINGS.AUTHENTICATE">\n Authenticate\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="cloudProvider.service === \'MicrosoftAzure\'">\n <md-button ng-click="vm.updateClientSecret(cloudProvider, $event)" translate="SETTINGS.UPDATE_CLIENT_SECRET">\n Update Client Secret\n </md-button>\n </md-menu-item>\n\n <md-menu-item>\n <md-button ng-click="vm.editdialog(cloudProvider, $event)" translate="SETTINGS.EDIT_CLOUDPROVIDER">\n Edit CloudProvider\n </md-button>\n </md-menu-item>\n\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(cloudProvider, $event)" translate="SETTINGS.DELETE_CLOUDPROVIDER">\n Delete CloudProvider\n </md-button>\n </md-menu-item>\n\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cloudProviders.count}}" md-on-paginate="vm.getAiTools" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CLOUDPROVIDER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CLOUDPROVIDER BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-cloudProvider-button" ng-click="vm.createOrEditCloudProvider($event)" aria-label="add cloudProvider" translate translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CLOUDPROVIDER BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/cloudProviders/create/dialog.html",'<md-dialog class="cloudProvider-dialog" aria-label="New CloudProvider">\n <form name="cloudProviderForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ (vm.newCloudProvider ? \'SETTINGS.NEW_CLOUDPROVIDER\' : \'SETTINGS.EDIT_CLOUDPROVIDER\') | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.cloudProvider.name" ng-required="true" autofocus>\n\n <div ng-messages="cloudProviderForm[\'name\'].$error" ng-show="cloudProviderForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SERVICE">Service</label>\n <md-select name="service" ng-model="vm.cloudProvider.service" required ng-disabled="!vm.newCloudProvider">\n <md-option ng-if="vm.license.ai" ng-value="\'AmazonAWS\'">AmazonAWS</md-option>\n <md-option ng-value="\'MicrosoftAzure\'">Microsoft Azure</md-option>\n </md-select>\n <div ng-messages="cloudProviderForm[\'service\'].$error" ng-show="cloudProviderForm[\'service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'" class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="service" ng-model="vm.cloudProvider.type" required ng-disabled="!vm.newCloudProvider">\n <md-option ng-value="\'Outlook365\'">Outlook365</md-option>\n <md-option ng-value="\'Dynamics365\'">Dynamics365</md-option>\n </md-select>\n <div ng-messages="cloudProviderForm[\'type\'].$error" ng-show="cloudProviderForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n <label translate="SETTINGS.ACCESSKEY">AccessKey</label>\n <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCESSKEY_REQUIRED">AccessKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.cloudProvider.service == \'AmazonAWS\'" class="md-block">\n <label translate="SETTINGS.SECRETACCESSKEY">SecretAccesskey</label>\n <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SECRETACCESSKEY_REQUIRED">SecretAccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.cloudProvider.service == \'MicrosoftAzure\'">\n <md-input-container class="md-block">\n <label translate="SETTINGS.APPLICATION_ID">Application Id</label>\n <input type="text" name="data1" ng-model="vm.cloudProvider.data1" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data1\'].$error" ng-show="cloudProviderForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.TENANT_ID">Tenant Id</label>\n <input type="text" name="data2" ng-model="vm.cloudProvider.data2" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data2\'].$error" ng-show="cloudProviderForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.newCloudProvider" class="md-block">\n <label translate="SETTINGS.CLIENT_SECRET">Client Secret</label>\n <input type="password" name="data3" ng-model="vm.cloudProvider.data3" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.CLIENT_SECRET"></span></div>\n\n <div ng-messages="cloudProviderForm[\'data3\'].$error" ng-show="cloudProviderForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.REDIRECT_URI">Redirect Uri</label>\n <input type="url" name="data4" ng-model="vm.cloudProvider.data4" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data4\'].$error" ng-show="cloudProviderForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.cloudProvider.type == \'Dynamics365\'" class="md-block">\n <label translate="SETTINGS.REMOTE_URI">Remote Uri</label>\n <input type="url" name="data7" ng-model="vm.cloudProvider.data7" ng-required="true">\n\n <div ng-messages="cloudProviderForm[\'data7\'].$error" ng-show="cloudProviderForm[\'data7\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED"></span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.WRONG_FORMAT"></span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newCloudProvider" ng-click="vm.saveCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid || cloudProviderForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newCloudProvider" ng-click="vm.addNewCloudProvider()" class="send-button md-accent md-raised" ng-disabled="cloudProviderForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CLOUDPROVIDER" translate-attr-aria-label="SETTINGS.ADD_CLOUDPROVIDER">\n ADD CLOUDPROVIDER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.deleteCloudProvider($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/cloudProviders/updateSecret/updateSecret.html",'<md-dialog class="cloudProvider-dialog" aria-label="update client secret">\n <form name="updateSecretForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'SETTINGS.UPDATE_CLIENT_SECRET\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n <label translate="SETTINGS.CLIENT_SECRET">Current Client Secret</label>\n <input type="text" name="currentSecret" ng-model="vm.cloudProvider.data3" disabled>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NEW_CLIENT_SECRET">New Client Secret</label>\n <input type="password" name="secret" ng-model="vm.newSecret" required>\n <div ng-messages="updateSecretForm.secret.$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">New Client Secret field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSecret()" class="send-button md-accent md-raised" ng-disabled="updateSecretForm.$invalid || updateSecretForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n <form name="customizationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n ADD CUSTOMIZATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="(customizationsForm.$pristine && logoForm.$pristine && logologinForm.$pristine && preferredForm.$pristine && faviconForm.$pristine) || (customizationsForm.$invalid || logoForm.$invalid || logologinForm.$invalid || preferredForm.$invalid || faviconForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n </div>\n <form name="customizationsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultFavicon" aria-label="Default_Favicon"><span translate="SETTINGS.DEFAULT_FAVICON">Default_Favicon</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationsForm[\'headerWhiteLabel\'].$error" ng-show="customizationsForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationsForm[\'pageTitle\'].$error" ng-show="customizationsForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n </div>\n <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()" flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n </div>\n <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()" flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logologinimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logologinimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultPreferred && vm.license.preferred" class="customization-detail-form-container preferred md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.PREFERRED">PREFERRED</div>\n </div>\n <div ng-controller="CustomizationpreferredController as vm_cp" ng-init="vm_cp.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cp.ngFlowOptions" flow-name="vm_cp.ngFlow.flow" flow-files-submitted="vm_cp.upload()" flow-file-added="vm_cp.fileAdded($file)" flow-file-success="vm_cp.fileSuccess($file, $message)" flow-complete="vm_cp.uploadComplete()" flow-drop flow-drag-enter="vm_cp.dropping=true" flow-drag-leave="vm_cp.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="preferredimage in vm_cp.customization.images" ng-switch="preferredimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{preferredimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="preferredimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{preferredimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultFavicon" class="customization-detail-form-container favicon md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.FAVICON">FAVICON</div>\n </div>\n <div ng-controller="CustomizationfaviconController as vm_cf" ng-init="vm_cf.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cf.ngFlowOptions" flow-name="vm_cf.ngFlow.flow" flow-files-submitted="vm_cf.upload()" flow-file-added="vm_cf.fileAdded($file)" flow-file-success="vm_cf.fileSuccess($file, $message)" flow-complete="vm_cf.uploadComplete()" flow-drop flow-drag-enter="vm_cf.dropping=true" flow-drag-leave="vm_cf.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG, ICO - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="faviconimage in vm_cf.customization.images" ng-switch="faviconimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{faviconimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="faviconimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{faviconimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n <form name="generalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n ADD GENERAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="(globalForm.$pristine && motionbarForm.$pristine && reportForm.$pristine && agentOmniDesktopInterfaceForm.$pristine && screenRecordingForm.$pristine && securityForm.$pristine && imapGeneralSettingsForm.$pristine && SSOForm.$pristine && aiToolsForm.$pristine) || (globalForm.$invalid || motionbarForm.$invalid || reportForm.$invalid || agentOmniDesktopInterfaceForm.$invalid || screenRecordingForm.$invalid || securityForm.$invalid || imapGeneralSettingsForm.$invalid || SSOForm.$invalid || aiToolsForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" value="1000" ng-required="true" autofocus>\n\n <div ng-messages="globalForm[\'min_internal\'].$error" ng-show="globalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" value="30" ng-required="true">\n\n <div ng-messages="globalForm[\'chatTimeout\'].$error" ng-show="globalForm[\'chatTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.rtlSupport" aria-label="RtlSupport"><span translate="SETTINGS.RTLSUPPORT">RtlSupport</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.RTLSUPPORT"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.stopRecordingOnTransfer" aria-label="Stop_Recording_On_Voice_Call_Transfer"><span translate="SETTINGS.STOP_RECORDING_ON_VOICE_CALL_TRANSFER">Stop_Recording_On_Voice_Call_Transfer</span></md-switch>\n </md-input-container>\n </form>\n </div>\n\n <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n </div>\n <form name="motionbarForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" value="https://www.xcally.com/bar/phonebar/autoupdater.xml" ng-required="vm.general.phoneBarAutoUpdater">\n\n <div ng-messages="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarRememberMeEnabled" aria-label="MotionbarRememberMe"><span translate="SETTINGS.MOTIONBARREMEMBERME">MotionbarRememberMe</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.MOTIONBARREMEMBERME"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container report md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.REPORT">REPORT</div>\n </div>\n <form name="reportForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv" value="5000">\n\n <div ng-messages="reportForm[\'splitSizeCsv\'].$error" ng-show="reportForm[\'splitSizeCsv\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf" value="1000">\n\n <div ng-messages="reportForm[\'splitSizePdf\'].$error" ng-show="reportForm[\'splitSizePdf\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx" value="5000">\n\n <div ng-messages="reportForm[\'splitSizeXlsx\'].$error" ng-show="reportForm[\'splitSizeXlsx\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container agentomnidesktopinterface md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.AGENTOMNIDESKTOPINTERFACE">AGENTOMNIDESKTOPINTERFACE</div>\n </div>\n <form name="agentOmniDesktopInterfaceForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.enableEmailPreview" aria-label="EnableEmailPreview"><span translate="SETTINGS.ENABLEEMAILPREVIEW">EnableEmailPreview</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.searchOnEnterKey" aria-label="Search_On_Enter_Key"><span translate="SETTINGS.SEARCH_ON_ENTER_KEY">Search_On_Enter_Key</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SEARCH_ON_ENTER_KEY"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.general.messagesAlignment">\n <md-option ng-value="\'alternate\'">Alternate</md-option>\n <md-option ng-value="\'left\'">Left</md-option>\n <md-option ng-value="\'right\'">Right</md-option>\n </md-select>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHAT_INTERACTIONS_RELOAD_TIMEOUT">Chat_Interactions_Reload_Timeout</label>\n <input type="number" name="chatInteractionsReloadTimeout" ng-model="vm.general.chatInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'chatInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHAT_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Chat_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MAIL_INTERACTIONS_RELOAD_TIMEOUT">Mail_Interactions_Reload_Timeout</label>\n <input type="number" name="mailInteractionsReloadTimeout" ng-model="vm.general.mailInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'mailInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MAIL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Mail_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT">Openchannel_Interactions_Reload_Timeout</label>\n <input type="number" name="openchannelInteractionsReloadTimeout" ng-model="vm.general.openchannelInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'openchannelInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Openchannel_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMS_INTERACTIONS_RELOAD_TIMEOUT">Sms_Interactions_Reload_Timeout</label>\n <input type="number" name="smsInteractionsReloadTimeout" ng-model="vm.general.smsInteractionsReloadTimeout">\n\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'smsInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMS_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Sms_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT">Whatsapp_Interactions_Reload_Timeout</label>\n <input type="number" name="whatsappInteractionsReloadTimeout" ng-model="vm.general.whatsappInteractionsReloadTimeout">\n <div class="hint"><span translate="SETTINGS.HELP.INTERACTIONS_RELOAD_TIMEOUT"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'whatsappInteractionsReloadTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT_REQUIRED">Whatsapp_Interactions_Reload_Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PREVIEW_RECALLME_REMINDER_INTERVAL">Preview_Recallme_Reminder_Interval</label>\n <input type="number" name="previewRecallmeReminderInterval" ng-model="vm.general.previewRecallmeReminderInterval" min="1">\n <div class="hint"><span translate="SETTINGS.HELP.PREVIEW_RECALLME_REMINDER_INTERVAL"></span></div>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'previewRecallmeReminderInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED">Preview_Recallme_Reminder_Interval field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Preview_Recallme_Reminder_Interval must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.LIMIT_TABS">limitTabs</label>\n <input type="number" name="limitTabs" ng-model="vm.general.limitTabs" min="0" value="20">\n <div class="hint"><span translate="SETTINGS.HELP.LIMIT_TABS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="vm.license.screenrecording" class="general-detail-form-container screenrecording md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.SCREENRECORDING">SCREENRECORDING</div>\n </div>\n <form name="screenRecordingForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.DEFAULTSCREENRECORDINGPATH">defaultScreenRecordingPath</label>\n <input type="text" name="defaultScreenRecordingPath" ng-model="vm.general.defaultScreenRecordingPath" autofocus>\n\n <div class="hint"><span translate="SETTINGS.HELP.DEFAULTSCREENRECORDINGPATH"></span></div>\n <div ng-messages="screenRecordingForm[\'defaultScreenRecordingPath\'].$error" ng-show="screenRecordingForm[\'defaultScreenRecordingPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DEFAULTSCREENRECORDINGPATH_REQUIRED">defaultScreenRecordingPath field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container security md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.SECURITY">SECURITY</div>\n </div>\n <form name="securityForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ALLOWEDLOGINATTEMPTS">allowedLoginAttempts</label>\n <input type="number" name="allowedLoginAttempts" ng-model="vm.general.allowedLoginAttempts" value="5" ng-required="true">\n\n <div ng-messages="securityForm[\'allowedLoginAttempts\'].$error" ng-show="securityForm[\'allowedLoginAttempts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ALLOWEDLOGINATTEMPTS_REQUIRED">allowedLoginAttempts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.BLOCKDURATION">blockDuration</label>\n <input type="number" name="blockDuration" ng-model="vm.general.blockDuration" value="10" ng-required="true">\n\n <div ng-messages="securityForm[\'blockDuration\'].$error" ng-show="securityForm[\'blockDuration\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.BLOCKDURATION_REQUIRED">blockDuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.enforcePasswordHistory" aria-label="Enforce_Password_History"><span translate="SETTINGS.ENFORCE_PASSWORD_HISTORY">Enforce_Password_History</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.ENFORCE_PASSWORD_HISTORY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.general.enforcePasswordHistory" class="md-block">\n <label translate="SETTINGS.PASSWORD_HISTORY_LIMIT">Password_History_Limit</label>\n <input type="number" name="passwordHistoryLimit" ng-model="vm.general.passwordHistoryLimit" min="2" max="5" value="3">\n\n <div class="hint"><span translate="SETTINGS.HELP.PASSWORD_HISTORY_LIMIT"></span></div>\n <div ng-messages="securityForm[\'passwordHistoryLimit\'].$error" ng-show="securityForm[\'passwordHistoryLimit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_REQUIRED">Password_History_Limit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="SETTINGS.ERRORS.PASSWORD_HISTORY_LIMIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Password_History_Limit must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block no-margin-bottom">\n <md-switch ng-change="vm.onPrivacyPolicyChange(\'email\')" ng-model="vm.general.enablePrivacyPolicyEmail" aria-label="Privacy_Policy_Email"><span translate="SETTINGS.PRIVACY_POLICY_EMAIL">Privacy_Policy_Email</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.enablePrivacyPolicyEmail" class="md-block no-margin-top">\n\n <input type="number" name="privacyPolicyEmail" ng-model="vm.general.privacyPolicyEmail" min="0" value="0" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n <div ng-messages="securityForm[\'privacyPolicyEmail\'].$error" ng-show="securityForm[\'privacyPolicyEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_REQUIRED">Privacy_Policy_Email field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_EMAIL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Email must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block no-margin-bottom">\n <md-switch ng-change="vm.onPrivacyPolicyChange(\'name\')" ng-model="vm.general.enablePrivacyPolicyName" aria-label="Privacy_Policy_Name"><span translate="SETTINGS.PRIVACY_POLICY_NAME">Privacy_Policy_Name</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.enablePrivacyPolicyName" class="md-block no-margin-top">\n\n <input type="number" name="privacyPolicyName" ng-model="vm.general.privacyPolicyName" min="0" value="0" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n <div ng-messages="securityForm[\'privacyPolicyName\'].$error" ng-show="securityForm[\'privacyPolicyName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_REQUIRED">Privacy_Policy_Name field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NAME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Name must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block no-margin-bottom">\n <md-switch ng-change="vm.onPrivacyPolicyChange(\'number\')" ng-model="vm.general.enablePrivacyPolicyNumber" aria-label="Privacy_Policy_Number"><span translate="SETTINGS.PRIVACY_POLICY_NUMBER">Privacy_Policy_Number</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.enablePrivacyPolicyNumber" class="md-block no-margin-top">\n\n <input type="number" name="privacyPolicyNumber" ng-model="vm.general.privacyPolicyNumber" min="0" value="0" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.PRIVACY_POLICY"></span></div>\n <div ng-messages="securityForm[\'privacyPolicyNumber\'].$error" ng-show="securityForm[\'privacyPolicyNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_REQUIRED">Privacy_Policy_Number field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.PRIVACY_POLICY_NUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Privacy_Policy_Number must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.disabledCookie" aria-label="Disabled_Cookie"><span translate="SETTINGS.DISABLED_COOKIE">Disabled_Cookie</span></md-switch>\n </md-input-container>\n </form>\n </div>\n\n <div class="general-detail-form-container imapgeneralsettings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.IMAPGENERALSETTINGS">IMAPGENERALSETTINGS</div>\n </div>\n <form name="imapGeneralSettingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.LOGINMAILFREQUENCY">loginMailFrequency</label>\n <input type="number" name="loginMailFrequency" ng-model="vm.general.loginMailFrequency" min="10" value="10" ng-required="true" autofocus>\n\n <div class="hint"><span translate="SETTINGS.HELP.LOGINMAILFREQUENCY"></span></div>\n <div ng-messages="imapGeneralSettingsForm[\'loginMailFrequency\'].$error" ng-show="imapGeneralSettingsForm[\'loginMailFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_REQUIRED">loginMailFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">loginMailFrequency must be a valid greater or equal than</span> <span>10</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container sso md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.SSO">SSO</div>\n </div>\n <form name="SSOForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.googleSsoEnabled" aria-label="Google_SSO_enabled"><span translate="SETTINGS.GOOGLE_SSO_ENABLED">Google_SSO_enabled</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.adSsoEnabled" aria-label="AD_SSO_enabled"><span translate="SETTINGS.AD_SSO_ENABLED">AD_SSO_enabled</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="vm.license.ai" class="general-detail-form-container aitools md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.AITOOLS">AITOOLS</div>\n </div>\n <form name="aiToolsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.LANGUAGE">Language</label>\n <md-select name="language" ng-model="vm.general.language" autofocus required>\n <md-option ng-value="\'en-US\'">US English</md-option>\n <md-option ng-value="\'en-AU\'">Australian English</md-option>\n <md-option ng-value="\'en-GB\'">British English</md-option>\n <md-option ng-value="\'en-AB\'">Scottish English</md-option>\n <md-option ng-value="\'en-WL\'">Welsh English</md-option>\n <md-option ng-value="\'en-IE\'">English (Ireland)</md-option>\n <md-option ng-value="\'en-IN\'">Indian English</md-option>\n <md-option ng-value="\'hi-IN\'">Hindi (India)</md-option>\n <md-option ng-value="\'fr-CA\'">Canadian French</md-option>\n <md-option ng-value="\'fr-FR\'">French</md-option>\n <md-option ng-value="\'de-DE\'">German</md-option>\n <md-option ng-value="\'de-CH\'">German (Switzerland)</md-option>\n <md-option ng-value="\'it-IT\'">Italian</md-option>\n <md-option ng-value="\'es-ES\'">Spanish</md-option>\n <md-option ng-value="\'es-Us\'">US Spanish</md-option>\n <md-option ng-value="\'pt-BR\'">Brazilian Portuguese</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese(Portugal)</md-option>\n <md-option ng-value="\'ar-SA\'">Modern Standard Arabic</md-option>\n <md-option ng-value="\'ar-AE\'">Arabic</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese Mandarin - Mainland</md-option>\n <md-option ng-value="\'ja-JP\'">Japanese (Japan)</md-option>\n <md-option ng-value="\'ko-KR\'">Korean (Korea)</md-option>\n <md-option ng-value="\'he-IL\'">Hebrew (Israel) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'ms-MY\'">Malay (Malaysia) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'fa-IR\'">Farsi (Iran) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'ru-RU\'">Russian (Russia) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'te-IN\'">Telugu(India) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'ta-IN\'">Tamil - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'nl-NL\'">Dutch - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'tr-TR\'">Turkish (Turkey) - This language is not available for the Sentiment Analysis</md-option>\n <md-option ng-value="\'id-ID\'">Indonesian(Indonesia) - This language is not available for the Sentiment Analysis</md-option>\n </md-select>\n <div ng-messages="aiToolsForm[\'language\'].$error" ng-show="aiToolsForm[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LANGUAGE_REQUIRED">Language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.BUCKET">Bucket</label>\n <input type="text" name="bucket" ng-model="vm.general.bucket" ng-required="true">\n\n <div ng-messages="aiToolsForm[\'bucket\'].$error" ng-show="aiToolsForm[\'bucket\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.BUCKET_REQUIRED">Bucket field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.transcribe" aria-label="Transcribe"><span translate="SETTINGS.TRANSCRIBE">Transcribe</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n <label translate="SETTINGS.TRANSCRIBEREGION">TranscribeRegion</label>\n <md-select name="transcribeRegion" ng-model="vm.general.transcribeRegion" required>\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-east-2\'">US East (Ohio)</md-option>\n <md-option ng-value="\'us-east-2\'">US West (N. California)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'ap-south-1\'">Asia Pacific (Mumbai)</md-option>\n <md-option ng-value="\'ap-east-1\'">Asia Pacific (Hong Kong)</md-option>\n <md-option ng-value="\'ap-northeast-2\'">Asia Pacific (Seoul)</md-option>\n <md-option ng-value="\'ap-southeast-1\'">Asia Pacific (Singapore)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n <md-option ng-value="\'ap-northeast-1\'">Asia Pacific (Tokyo)</md-option>\n <md-option ng-value="\'ca-central-1\'">Canada (Central)</md-option>\n <md-option ng-value="\'eu-central-1\'">Europe (Frankfurt)</md-option>\n <md-option ng-value="\'eu-west-1\'">Europe (Ireland)</md-option>\n <md-option ng-value="\'eu-west-2\'">Europe (London)</md-option>\n <md-option ng-value="\'eu-west-3\'">Europe (Paris)</md-option>\n <md-option ng-value="\'me-south-1\'">Middle East (Bahrain)</md-option>\n <md-option ng-value="\'sa-east-1\'">South America (São Paulo)</md-option>\n </md-select>\n <div ng-messages="aiToolsForm[\'transcribeRegion\'].$error" ng-show="aiToolsForm[\'transcribeRegion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TRANSCRIBEREGION_REQUIRED">TranscribeRegion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.transcribe == true" class="md-block">\n <label translate="SETTINGS.TRANSCRIBEACCOUNT">TranscribeAccount</label>\n <md-select name="transcribeAccountId" ng-model="vm.general.transcribeAccountId" required>\n <md-option ng-value="transcribeAccountId.id" ng-repeat="transcribeAccountId in vm.cloudProviders" ng-disabled="transcribeAccountId.canSelect === false">{{ transcribeAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="aiToolsForm[\'transcribeAccountId\'].$error" ng-show="aiToolsForm[\'transcribeAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TRANSCRIBEACCOUNT_REQUIRED">TranscribeAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n'+" <md-input-container ng-if=\"vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n <md-switch ng-model=\"vm.general.sentiment\" aria-label=\"SentimentAnalysis\"><span translate=\"SETTINGS.SENTIMENTANALYSIS\">SentimentAnalysis</span></md-switch>\n </md-input-container>\n <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n <label translate=\"SETTINGS.SENTIMENTREGION\">SentimentRegion</label>\n <md-select name=\"sentimentRegion\" ng-model=\"vm.general.sentimentRegion\" required>\n <md-option ng-value=\"'us-east-1'\">US East (N. Virginia)</md-option>\n <md-option ng-value=\"'us-east-2'\">US East (Ohio)</md-option>\n <md-option ng-value=\"'us-west-2'\">US West (Oregon)</md-option>\n <md-option ng-value=\"'ap-south-1'\">Asia Pacific (Mumbai)</md-option>\n <md-option ng-value=\"'ap-northeast-2'\">Asia Pacific (Seoul)</md-option>\n <md-option ng-value=\"'ap-southeast-1'\">Asia Pacific (Singapore)</md-option>\n <md-option ng-value=\"'ap-southeast-2'\">Asia Pacific (Sydney)</md-option>\n <md-option ng-value=\"'ap-northeast-1'\">Asia Pacific (Tokyo)</md-option>\n <md-option ng-value=\"'ca-central-1'\">Canada (Central)</md-option>\n <md-option ng-value=\"'eu-central-1'\">Europe (Frankfurt)</md-option>\n <md-option ng-value=\"'eu-west-1'\">Europe (Ireland)</md-option>\n <md-option ng-value=\"'eu-west-2'\">Europe (London)</md-option>\n </md-select>\n <div ng-messages=\"aiToolsForm['sentimentRegion'].$error\" ng-show=\"aiToolsForm['sentimentRegion'].$touched\" role=\"alert\">\n <div ng-message=\"required\">\n <span translate=\"SETTINGS.ERRORS.SENTIMENTREGION_REQUIRED\">SentimentRegion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if=\"vm.general.sentiment == true && vm.general.transcribe == true && vm.general.language != 'he-IL' && vm.general.language != 'ms-MY' && vm.general.language != 'fa-IR' && vm.general.language != 'ru-RU' && vm.general.language != 'te-IN' && vm.general.language != 'ta-IN' && vm.general.language != 'nl-NL' && vm.general.language != 'tr-TR' && vm.general.language != 'id-ID'\" class=\"md-block\">\n <label translate=\"SETTINGS.SENTIMENTACCOUNT\">SentimentAccount</label>\n <md-select name=\"sentimentAccountId\" ng-model=\"vm.general.sentimentAccountId\" required>\n <md-option ng-value=\"sentimentAccountId.id\" ng-repeat=\"sentimentAccountId in vm.cloudProviders\" ng-disabled=\"sentimentAccountId.canSelect === false\">{{ sentimentAccountId.name }}</md-option>\n </md-select>\n <div ng-messages=\"aiToolsForm['sentimentAccountId'].$error\" ng-show=\"aiToolsForm['sentimentAccountId'].$touched\" role=\"alert\">\n <div ng-message=\"required\">\n <span translate=\"SETTINGS.ERRORS.SENTIMENTACCOUNT_REQUIRED\">SentimentAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n \x3c!-- <div>\n <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n REQUEST LICENSE\n </md-button>\n </div> --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n \x3c!-- LICENSE CARD --\x3e\n <div layout="row" flex>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="row" layout-align="center">\n <div flex layout="row" layout-align="start center">\n <div ng-if="!vm.license.custom">\n <a href="https://www.xcally.com/plans.html" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n <md-icon md-font-icon="icon-coin"></md-icon>\n </a>\n </div>\n </div>\n <div flex>\n <div ng-switch="vm.license.months" class="text-center">\n <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n <span ng-switch-when="1200" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n </div>\n </div>\n <div flex layout="row" layout-align="end center">\n <div>\n <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n <md-icon md-font-icon="icon-pencil"></md-icon>\n </md-button>\n <md-button type="submit" ng-if="vm.isAdmin" ng-click="vm.downloadLogFile()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.DOWNLOAD_LICENSE_LOG_FILE">Download license log file</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <span ng-if="!vm.license.demo && !vm.license.gray && vm.license.months != 36" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" id="licenseUuid" class="hover-token text-italic text-bold">{{vm.license.uuid}}</span>\n \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip>\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </md-button>--\x3e\n </span>\n\n <div layout="column">\n <span ng-if="vm.license.grayReason == \'changed\'" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span id="licenseMachineUuid" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});" class="hover-token text-italic text-bold">{{vm.license.machineUuid}}</span>\n \x3c!--<md-button class="md-button md-fab md-accent" ngclipboard data-clipboard-target="#licenseMachineUuid" ngclipboard-success="vm.alert({title: \'clipboard\', msg: \'Token copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-tooltip><span translate="SETTINGS.COPY_LICENSE">Copy</span></md-tooltip> \n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </md-button>--\x3e\n </span>\n <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n <span ng-if="vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_DISABLED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_CHANGED_ADVISE\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n </div>\n\n <div ng-if="vm.license.demo" layout="column">\n <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n <p translate="SETTINGS.USERS">Users</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n <p translate="SETTINGS.AGENTS">Agents</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n <p translate="SETTINGS.TELEPHONES">Telephones</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:6">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <div ng-repeat="session in vm.sessions" flex="33">\n <md-list-item class="md-2-line">\n <md-icon md-font-icon="{{session.icon}}" class="md-avatar-icon" ng-class="vm.license[session.enabled] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <div layout="row" layout="start center">\n <h3 translate="SETTINGS.{{session.name | uppercase}}"></h3>\n <button ng-if="session.restart" ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n <md-tooltip>Restart</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </button>\n </div>\n <p ng-if="vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">{{vm.license[session.name]}} {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">UNLIMITED {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.enabled]" class="red-A700-fg">{{ \'SETTINGS.DISABLED\' | translate }}</p>\n </div>\n </md-list-item>\n\n </div>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3" flex="33">\n <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="addon in vm.addons | limitTo:3:3" flex="33">\n <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3" flex="33">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n <p ng-class="vm.license[other.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[other.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="other in vm.others | limitTo:3:3" flex="33">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+" <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n </md-card>\n </div>\n \x3c!-- / LICENSE CARD --\x3e\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n <form name="requestForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.license.name" required>\n <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.license.email" required>\n <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PLAN">Plan</label>\n <md-select name="plan" ng-model="vm.license.months" required>\n <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n <md-option ng-value="1200"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n </md-select>\n <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.USERS">Users</label>\n <input type="number" name="users" ng-model="vm.license.users" required>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.AGENTS">Agents</label>\n <input type="number" name="agents" ng-model="vm.license.agents" required>\n <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.TELEPHONES">Telephones</label>\n <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <div layout="row">\n <md-input-container ng-repeat="session in vm.sessions" class="md-block" flex="50">\n <label>{{ \'SETTINGS.\' + session.name | uppercase | translate }} ({{ \'SETTINGS.\' + session.label | uppercase | translate }})</label>\n <input type="number" name="{{session.name}}" ng-model="vm.license[session.name]" required>\n <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n <div ng-messages="requestForm[session.name].$error" ng-show="requestForm[session.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHANNEL_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[addon.name]" aria-label="{{module.name}}" ng-repeat="addon in vm.addons"><span translate="SETTINGS.{{addon.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}" ng-repeat="other in vm.others"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <textarea name="description" ng-model="vm.license.description"></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/license/update/dialog.html",'<md-dialog class="update-dialog" aria-label="Update License">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.UPDATE_LICENSE">Update License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-content layout="row">\n <span class="md-title" translate="SETTINGS.UPDATE_LICENSE_MANUALLY">Do you want to update your license manually?</span>\n </md-content>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ENTER_LICENSE">Enter your license</label>\n <textarea name="key" ng-model="vm.licenseKey" required></textarea>\n <div ng-messages="updateForm.name.$error" ng-show="updateForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LICENSE_REQUIRED">License key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.updateLicense()" class="send-button md-accent md-raised" ng-disabled="updateForm.$invalid || updateForm.$pristine" aria-label="UPDATE" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n <form name="networkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.network.type" autofocus required>\n <md-option ng-value="\'localnet\'">LocalNET</md-option>\n <md-option ng-value="\'externip\'">ExternIP</md-option>\n <md-option ng-value="\'turn\'">Turn</md-option>\n <md-option ng-value="\'stun\'">Stun</md-option>\n </md-select>\n <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'turn\' || vm.network.type == \'stun\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-required="true">\n\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n <label translate="SETTINGS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.network.username" ng-required="vm.network.type == \'turn\'">\n\n <div class="hint"><span translate="SETTINGS.HELP.USERNAME"></span></div>\n <div ng-messages="networkForm[\'username\'].$error" ng-show="networkForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'turn\'" class="md-block">\n <label translate="SETTINGS.PASSWORD">Password</label>\n <input type="text" name="password" ng-model="vm.network.password" ng-required="vm.network.type == \'turn\'">\n\n <div class="hint"><span translate="SETTINGS.HELP.PASSWORD"></span></div>\n <div ng-messages="networkForm[\'password\'].$error" ng-show="networkForm[\'password\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n ADD NETWORK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-networks-count">\n <span>{{vm.selectedNetworks.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SETTINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="SETTINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- NETWORK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.networks.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.editdialog(network, $event )" translate="SETTINGS.EDIT_NETWORK">\n Edit Network\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.deleteconfirm(network, $event )" translate="SETTINGS.DELETE_NETWORK">\n Delete Network\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / NETWORK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD NETWORK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.mailAccount.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n VERIFY\n </md-button>\n <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="(generalForm.$pristine) || (generalForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n <div class="main scrollable">\n <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Name field required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.mailAccount.description">\n </md-input-container>\n\n <md-input-container class="md-block mt-0">\n <label translate="SETTINGS.EMAILADDRESS">Email Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Email Address field required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.WRONG_FORMAT">Email Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block mt-30">\n <label translate="SETTINGS.SMTP_SERVICE">Service</label>\n <md-select name="provider" ng-model="vm.mailAccount.provider" ng-change="vm.onProviderChange()" required>\n <md-option ng-value="provider.value" ng-repeat="provider in vm.providers">{{ provider.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'provider\'].$error" ng-show="generalForm[\'provider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Service field required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-if="vm.mailAccount.provider === \'custom\'">\n <md-input-container class="md-block mt-30">\n <label translate="SETTINGS.SMTP_HOST">Host</label>\n <input type="text" name="host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Host field required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_PORT">Port</label>\n <input type="number" name="port" ng-model="vm.mailAccount.Smtp.port" value="465" ng-required="true">\n <div ng-messages="generalForm[\'port\'].$error" ng-show="generalForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Port field required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="SMTP Secure"><span translate="SETTINGS.SMTP_SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="SMTP Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n </div>\n\n <div ng-if="vm.mailAccount.Smtp.authentication || (vm.mailAccount.provider && vm.mailAccount.provider !== \'custom\')">\n <md-input-container ng-if="vm.mailAccount.provider === \'outlook365\'" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.modernAuthentication" aria-label="Modern Authentication" class="no-margin-bottom"><span translate="MAIL.MODERN_AUTHENTICATION">Modern Authentication</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.mailAccount.Smtp.user" ng-required="true">\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Username field required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n <label translate="MAIL.CLOUD_PROVIDER">Cloud Provider</label>\n <md-select name="cloudProvider" ng-model="vm.mailAccount.Smtp.CloudProviderId" required>\n <md-option ng-value="cloudProvider.id" ng-repeat="cloudProvider in vm.cloudProviders.rows">{{ cloudProvider.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.CLOUD_PROVIDER"></span></div>\n <div ng-messages="generalForm[\'cloudProvider\'].$error" ng-show="generalForm[\'cloudProvider\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FIELD_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="!vm.mailAccount.Smtp.modernAuthentication" class="md-block">\n <label translate="SETTINGS.SMTP_PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.FIELD_REQUIRED">Password field required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n\n </div>\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget flex="50" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg">\n <div class="h3">OS</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n <div class="h4">Node.js: {{vm.system.node}}</div>\n <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n <div class="h3">CPU</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">MEM</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n </div>\n <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">DISK {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">NET {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n <div class="h4">IPv4: {{net.ip4}}</div>\n <div class="h4">IPv6: {{net.ip6}}</div>\n <div class="h4">MAC: {{net.mac}}</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row">\n <div flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>pmem</th>\n <th md-column>pcpu</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.command}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\n \'green-600-bg\': process.state == \'running\',\n \'yellow-600-bg\': process.state == \'sleeping\',\n \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n </td>\n <td md-cell>{{process.pmem}}%</td>\n <td md-cell>{{process.pcpu}}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>id</th>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>MEM</th>\n <th md-column>CPU</th>\n <th md-column width="20px">Actions</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n <td md-cell>{{process.pm_id}}</td>\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n </td>\n <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n <td md-cell>{{process.monit.cpu}}%</td>\n <td md-cell>\n <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n </md-button>\n <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n <td md-cell></td>\n <td md-cell></td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr>\n <td md-cell class="no-border">pm2 list</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 start <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 stop <id | name | all></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 restart <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 logs [id | name]</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content>\n <div layout="row" layout-align="center center">\n <div ng-if="vm.updating" layout="column" layout-align="center center">\n <span class="text-center md-title">Grab a quick coffee and</span>\n <span class="text-center md-title">get back here as soon as completed!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n <div ng-if="!vm.updating">\n <div ng-if="vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n <span class="text-center md-title">In order to complete the update,</span>\n <span class="text-center md-title">please click on reload button</span>\n </div>\n <div ng-if="!vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Error!</span>\n <span class="text-center md-title">Please contact your administrator!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n </div>\n <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n </div>\n </md-dialog-content>\n\n <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n RELOAD\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n \x3c!-- UPDATE CARD --\x3e\n <div layout="row" ng-if="!vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n </div>\n </md-card>\n </div>\n \x3c!-- / UPDATE CARD --\x3e\n\n <div ng-if="vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n\n <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'baseUrl\'].$error" ng-show="smsAccountForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'apiKey\'].$error" ng-show="smsAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.ACCOUNTID">AccountId</label>\n <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'accountId\'].$error" ng-show="smsAccountForm[\'accountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.APPLICATIONID">ApplicationID</label>\n <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'applicationId\'].$error" ng-show="smsAccountForm[\'applicationId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n\n <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n ADD SMSACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",'<md-dialog class="smsAccount-dialog" aria-label="smsAccount" ng-init="vm.onInit()">\n <form name="smsAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSACCOUNT">Add Agent to smsAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'accesskeyid\'].$error" ng-show="smsAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'secretaccesskey\'].$error" ng-show="smsAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'lexregion\'].$error" ng-show="smsAccountFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'botname\'].$error" ng-show="smsAccountFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'key\'].$error" ng-show="smsAccountFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'projectId\'].$error" ng-show="smsAccountFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'clientEmail\'].$error" ng-show="smsAccountFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'privateKey\'].$error" ng-show="smsAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'language\'].$error" ng-show="smsAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="SMS.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="smsAccountFormApp[\'welcomemessage\'].$error" ng-show="smsAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/tag/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'tag\'].$error" ng-show="smsAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n\n <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n ADD SMSCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsAccount-image" hide-xs>\n <img ng-src="assets/images/business/smsAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsAccount.id}}\n <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'bandwidth\'">Bandwidth</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'bandwidth\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'csc\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.ACCOUNTID">AccountId</label>\n <input type="text" name="accountId" ng-model="vm.smsAccount.accountId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accountId\'].$error" ng-show="generalForm[\'accountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTID_REQUIRED">AccountId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.APPLICATIONID">ApplicationID</label>\n <input type="text" name="applicationId" ng-model="vm.smsAccount.applicationId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'applicationId\'].$error" ng-show="generalForm[\'applicationId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APPLICATIONID_REQUIRED">ApplicationID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'|| vm.smsAccount.type == \'csc\'|| vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.SENDERSTRING">SenderString</label>\n <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\'" class="md-block">\n <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.smsAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.RECEIVEURL">receiveUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container ng-if="( ((vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\') && vm.smsAccount.deliveryReport) || vm.smsAccount.type == \'bandwidth\'" class="md-block">\n <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token + (vm.smsAccount.type == \'csc\' ? \'&message-id={message-id}&state={state}\' : \'\')" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.smsAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.queueTransfer == true" class="md-block">\n <label translate="SMS.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.smsAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.agentTransfer == true" class="md-block">\n <label translate="SMS.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.smsAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus disabled>\n\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.mandatoryDisposition" class="md-block">\n <label translate="SMS.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.smsAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="SmsAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add sms dispositions" translate translate-attr-label="SMS.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getSmsAccountSmsCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'SMS.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'SMS.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'SMS.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'SMS.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'SMS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{smsCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>\n {{ smsCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n Edit SmsCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n Delete SmsCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="SMS.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getSmsAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getSmsAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'SMS.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'SMS.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'SMS.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'SMS.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'SMS.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'SMS.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'SMS.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'SMS.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'SMS.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.smsInteractionDownload(interaction, $event)" translate="SMS.DOWNLOAD_INTERACTION">\n Download\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsAccounts-count">\n <span>{{vm.selectedSmsAccounts.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SMSACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':smsAccount.ListId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(smsAccount, $event )" translate="SMS.EDIT_SMSACCOUNT">\n Edit SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(smsAccount, $event )" translate="SMS.INTERACTIONS_SMSACCOUNT">\n Interactions SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(smsAccount, $event )" translate="SMS.AGENTADD_SMSACCOUNT">\n AgentAdd SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(smsAccount, $event )" translate="SMS.DELETE_SMSACCOUNT">\n Delete SmsAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}" md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n <form name="smsQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n\n <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n ADD SMSQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsQueue-image" hide-xs>\n <img ng-src="assets/images/business/smsQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsQueue.id}}\n <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsQueues-count">\n <span>{{vm.selectedSmsQueues.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SMSQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(smsQueue, $event )" translate="SMS.EDIT_SMSQUEUE">\n Edit SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(smsQueue, $event )" translate="SMS.TEAMADD_SMSQUEUE">\n teamadd SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(smsQueue, $event )" translate="SMS.AGENTADD_SMSQUEUE">\n agentadd SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(smsQueue, $event )" translate="SMS.DELETE_SMSQUEUE">\n Delete SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event )" translate="SMS.GOTOREALTIME_SMSQUEUE">\n goToRealtime SmsQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}" md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-agents-count">\n <span>{{vm.selectedAgents.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- AGENT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="showWebBar">{{ \'STAFF.SHOWWEBCONTROL\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n <td md-cell ng-if="!agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="name">{{agent.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="showWebBar">{{ agent.showWebBar | getOptionByValue: vm.showWebBarOptions }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="email">{{agent.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="phone">{{agent.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="mobile">{{agent.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="internal">{{agent.internal}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="disabled">\n <md-icon md-colors="{color: {{agent.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="blocked">\n <md-icon md-colors="{color: {{agent.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{agent.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="client-side-logging">\n <ms-client-side-logging-icon user="agent"></ms-client-side-logging-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(agent, $event )" translate="STAFF.EDIT_AGENT">\n Edit Agent\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(agent, $event )" translate="STAFF.TEAMADD_AGENT">\n teamadd Agent\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(agent, $event )" translate="STAFF.DELETE_AGENT">\n Delete Agent\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / AGENT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD AGENT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n\n <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n\n <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="agentForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent && (vm.newAgent)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n\n <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.agent.userSetting">\n <ms-client-side-logging user="vm.agent"></ms-client-side-logging>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true">\n\n <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n ADD AGENT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.agent.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="agentForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n\n\n\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.channel === \'voice\'">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" add-disabled="vm.channel === \'voice\' && vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveQueues()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="agent-image" hide-xs>\n <img ng-src="assets/images/business/agents.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.agent.id}}\n <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div ng-cloak>\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.whatsapp" aria-label="whatsapp" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'whatsapp\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="WHATSAPP.WHATSAPP">whatsapp</span></md-tooltip>\n <md-icon md-font-icon="icon-whatsapp" aria-label="whatsapp"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveAgent()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (download_permissionsForm.$invalid) || (permissionsForm.$invalid) || (autoAnswerForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.agent.phone" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.agent.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 1" class="md-block">\n <md-switch ng-model="vm.agent.hotdesk" aria-label="Hotdesk" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.HOTDESK">Hotdesk</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus disabled>\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" disabled>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.disabled == 0" class="md-block">\n <md-switch ng-model="vm.agent.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n </div>\n <form name="authenticationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus disabled>\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.agent.transport" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.HOST">Host</label>\n <input type="text" name="host" ng-model="vm.agent.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.agent.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TYPE">Type</label>\n <md-select name="type" ng-model="vm.agent.type" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.agent.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.agent.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.agent.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.agent.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.agent.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n </div>\n <form name="capacityForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n <label translate="STAFF.WHATSAPPCAPACITY">WhatsappCapacity</label>\n <input type="number" name="whatsappCapacity" ng-model="vm.agent.whatsappCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.WHATSAPPCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'whatsappCapacity\'].$error" ng-show="capacityForm[\'whatsappCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_REQUIRED">WhatsappCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.WHATSAPPCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WhatsappCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container auto_answer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.AUTO_ANSWER">AUTO_ANSWER</div>\n </div>\n <form name="autoAnswerForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <md-switch ng-model="vm.agent.chatAutoanswer" aria-label="chatAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.CHAT_AUTOANSWER">ChatAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.chatAutoanswer" class="md-block">\n <label translate="STAFF.CHAT_AUTOANSWERDELAY">ChatAutoAnswerDelay</label>\n <input type="number" name="chatAutoAnswerDelay" ng-model="vm.agent.chatAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <md-switch ng-model="vm.agent.emailAutoanswer" aria-label="emailAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.EMAIL_AUTOANSWER">EmailAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.emailAutoanswer" class="md-block">\n <label translate="STAFF.EMAIL_AUTOANSWERDELAY">EmailAutoAnswerDelay</label>\n <input type="number" name="emailAutoAnswerDelay" ng-model="vm.agent.emailAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <md-switch ng-model="vm.agent.smsAutoanswer" aria-label="smsAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.SMS_AUTOANSWER">SmsAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.smsAutoanswer" class="md-block">\n <label translate="STAFF.SMS_AUTOANSWERDELAY">SmsAutoAnswerDelay</label>\n <input type="number" name="smsAutoAnswerDelay" ng-model="vm.agent.smsAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <md-switch ng-model="vm.agent.openchannelAutoanswer" aria-label="openchannelAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.OPENCHANNEL_AUTOANSWER">openchannelAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.openchannelAutoanswer" class="md-block">\n <label translate="STAFF.OPENCHANNEL_AUTOANSWERDELAY">openchannelAutoAnswerDelay</label>\n <input type="number" name="openchannelAutoAnswerDelay" ng-model="vm.agent.openchannelAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <md-switch ng-model="vm.agent.faxAutoanswer" aria-label="faxAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.FAX_AUTOANSWER">faxAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.faxAutoanswer" class="md-block">\n <label translate="STAFF.FAX_AUTOANSWERDELAY">faxAutoAnswerDelay</label>\n <input type="number" name="faxAutoAnswerDelay" ng-model="vm.agent.faxAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n <md-input-container ng-if="vm.license.whatsapp" class="md-block">\n <md-switch ng-model="vm.agent.whatsappAutoanswer" aria-label="whatsappAutoanswer" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.WHATSAPP_AUTOANSWER">whatsappAutoAnswer</span>\n </md-switch>\n <md-input-container ng-if="vm.agent.whatsappAutoanswer" class="md-block">\n <label translate="STAFF.WHATSAPP_AUTOANSWERDELAY">whatsappAutoAnswerDelay</label>\n <input type="number" name="whatsappAutoAnswerDelay" ng-model="vm.agent.whatsappAutoanswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 0">\n <md-tab-label>\n <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n <md-switch ng-change="vm.onEnableScreenRecordingByAgentSelection()" ng-model="vm.agent.phoneBarEnableScreenRecordingByAgent" aria-label="EnableScreenRecordingByAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESCREENRECORDINGBYAGENT">EnableScreenRecordingByAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0 && vm.license.screenrecording" class="md-block">\n <md-switch ng-change="vm.onEnableAutomaticScreenRecordingSelection()" ng-model="vm.agent.phoneBarEnableAutomaticScreenRecording" aria-label="EnableAutomaticScreenRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEAUTOMATICSCREENRECORDING">EnableAutomaticScreenRecording</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.ENABLEAUTOMATICSCREENRECORDING"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n </div>\n <form name="remote_controlForm" novalidate>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" value="9888" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n </div>\n <form name="sipForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPPORT">SipPort</label>\n <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n </div>\n <form name="callforwardingForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 2">\n <md-tab-label>\n <span translate="STAFF.WEBRTC">WEBRTC</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n </div>\n <form name="settings_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.WSS_PORT">WSS_Port</label>\n <input type="number" name="wssPort" ng-model="vm.agent.wssPort" min="0" value="8089" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.WSS_PORT"></span></div>\n <div ng-messages="settings_webrtcForm[\'wssPort\'].$error" ng-show="settings_webrtcForm[\'wssPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.WSS_PORT_REQUIRED">WSS_Port field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.WSS_PORT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WSS_Port must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" value="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.ignorePauseForPreviewCalls" aria-label="Ignore agent break status for preview calls" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS">Ignore agent break status for preview calls</span></md-switch>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n </div>\n <form name="sip_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.messengerSoundNotification" aria-label="EnableMessengerSoundNotification" \n ng-if="vm.agent.allowmessenger">\n <span translate="STAFF.MESSENGERSOUNDNOTIFICATION">MessengerSoundNotification</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block"> \n <md-switch ng-model="vm.agent.phoneBarPrefixRequired" aria-label="PrefixRequired" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.PREFIXREQUIRED">PrefixRequired</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.selectRecallMeCampaign" aria-label="Select_RecallMe_Campaign" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SELECT_RECALLME_CAMPAIGN">Select_RecallMe_Campaign</span></md-switch>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n </div>\n <form name="download_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n </md-input-container>\n </form>\n </div>\n <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)" \n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n <md-divider></md-divider>\n <md-list>\n <md-list-item ng-repeat="child in father.children" ng-if="child.id !== 201">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"\n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n CLIENT-SIDE LOGS\n </div>\n </div>\n <ms-client-side-logging user="vm.agent" on-user-update="vm.refreshAgent()"></ms-client-side-logging>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n <form name="teamForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n\n <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.team.description">\n\n <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n ADD TEAM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team" ng-init="vm.onInit()">\n <form name="teamForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-teams-count">\n <span>{{vm.selectedTeams.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TEAM TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.teams.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(team, $event )" translate="STAFF.EDIT_TEAM">\n Edit Team\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(team, $event )" translate="STAFF.AGENTADD_TEAM">\n AgentAdd Team\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(team, $event )" translate="STAFF.DELETE_TEAM">\n Delete Team\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEAM TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEAM BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n\n <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n\n <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newTelephone">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newTelephone && (vm.newTelephone)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n\n <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n ADD TELEPHONE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.telephone.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="telephoneForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n\n\n\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="telephone-image" hide-xs>\n <img ng-src="assets/images/business/telephones.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.telephone.id}}\n <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTelephone()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n </div>\n <form name="accountForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.telephone.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.telephone.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.telephone.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.telephone.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.telephone.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.telephone.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.telephone.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.telephone.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.telephone.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ENCRYPTION">Encryption</label>\n <md-select name="encryption" ng-model="vm.telephone.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-telephones-count">\n <span>{{vm.selectedTelephones.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TELEPHONE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(telephone, $event )" translate="STAFF.EDIT_TELEPHONE">\n Edit Telephone\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(telephone, $event )" translate="STAFF.DELETE_TELEPHONE">\n Delete Telephone\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TELEPHONE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TELEPHONE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/userProfiles/create/dialog.html",'<md-dialog class="userProfile-dialog" aria-label="New UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUserProfile" ng-click="vm.saveUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid || userProfileForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUserProfile" ng-click="vm.addNewUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USERPROFILE" translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n ADD USERPROFILE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUserProfile" ng-click="vm.deleteUserProfile($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/clone/clone.html",'<md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="CLONE" translate="STAFF.CLONE_USERPROFILE" translate-attr-aria-label="STAFF.CLONE_USERPROFILE">\n CLONE USERPROFILE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",'<md-dialog class="userProfile-dialog" aria-label="userProfile">\n <form name="userProfileForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog($event)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div layout="column" class="padding-bottom-10">\n <div layout="row" class="padding-bottom-10">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.SECTIONS">Sections</label>\n <md-select name="sections" ng-model="vm.selectedSection" placeholder="{{\'STAFF.PERMISSIONS_SELECT_SECTION\' | translate}}" ng-change="vm.onChangeSection()" required>\n <md-option ng-value="subsection" ng-repeat="subsection in vm.subsections" ng-selected="{{vm.subsections.length === 1 ? \'true\' : \'false\'}}">{{subsection.translate | translate}}</md-option>\n </md-select>\n </md-input-container>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10">\n <md-button ng-switch="vm.selectedSection.enabled" class="md-icon-button md-fab md-mini size-8 padding-10" ng-class="vm.selectedSection.enabled ? \'blue-500-bg\' : \'grey-A400-bg\'" ng-click="vm.onChangeVisibility()" aria-label="Visibility">\n <md-icon ng-switch-when="true" md-font-icon="icon-eye" aria-label="Visible section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_HIDE\' | translate}}</md-tooltip>\n </md-icon>\n <md-icon ng-switch-when="false" md-font-icon="icon-eye-off" aria-label="Hidden section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_SHOW\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <div>\n <md-button class="md-icon-button md-fab md-mini size-8 green-A700-bg no-margin" ng-disabled="true">\n <md-icon md-font-icon="icon-monitor" class="md-background-fg" aria-label="Read permission">\n <md-tooltip>{{\'STAFF.READ_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowEdit ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'edit\')">\n <md-icon md-font-icon="icon-pencil" aria-label="Edit permission">\n <md-tooltip>{{\'STAFF.EDIT_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowDelete ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'delete\')">\n <md-icon md-font-icon="icon-delete" aria-label="Delete permission">\n <md-tooltip>{{\'STAFF.DELETE_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-switch ng-model="vm.selectedSection.autoAssociation" class="no-margin padding-right-10" aria-label="Auto association" ng-change="vm.onChangeAutoAssociation()">\n </md-switch>\n <p class="no-margin font-size-12 line-height-30">{{\'STAFF.PERMISSIONS_AUTO_ASSOCIATION_INFO\' | translate}}</p>\n </div>\n <div layout="row" ng-show="vm.selectedSection && vm.selectedSection.title === \'Reports\' && !vm.selectedSection.autoAssociation" class="margin-bottom-10 margin-top-30" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.REPORT_TYPE">Report Type</label>\n <md-select name="type" ng-model="vm.selectedSection.reportType" placeholder="{{\'STAFF.PERMISSIONS_SELECT_REPORT_TYPE\' | translate}}" ng-change="vm.onChangeReportType()" required>\n <md-option ng-value="\'default\'">Default</md-option>\n <md-option ng-value="\'custom\'">Custom</md-option>\n </md-select>\n </md-input-container>\n </div>\n <div ng-show="vm.selectedSection && vm.selectedSection.title === \'Dashboards\'" class="user-profile-section-help margin-bottom-10 margin-top-20">\n <md-icon md-font-icon="icon-help" aria-label="Dashboards help"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.CUSTOM_DASHBOARDS_PERMISSIONS"></span>\n </div>\n </div>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association" ng-hide="vm.selectedSection.autoAssociation"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center">\n <div>\n <md-icon md-font-icon="icon-information-outline" aria-label="Delete permission"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.SAVE_PERMISSIONS"></span>\n </div>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveSection()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/view.html",'<div id="staff-userProfile" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-userProfiles-button md-icon-button" aria-label="Go to userProfiles" ng-click="vm.gotoUserProfiles()" translate translate-attr-aria-label="STAFF.GO_TO_USERPROFILES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="userProfile-image" hide-xs>\n <img ng-src="assets/images/business/userProfiles.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.userProfile.id}}\n <span ng-if="vm.userProfile.name">{{vm.userProfile.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.userProfile.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.userProfile, $event)" class="md-fab md-amber-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="STAFF.CLONE_USERPROFILE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUserProfile()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (modulesForm.$invalid) || (download_permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'crudPermissions\'].$error" ng-show="generalForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.privacyEnabled" aria-label="Mask_Sensitive_Data" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.MASK_SENSITIVE_DATA">Mask_Sensitive_Data</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MASK_SENSITIVE_DATA"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container modules md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.MODULES">MODULES</div>\n </div>\n <div ng-controller="UserProfilePermissionsController as vm_pc" ng-init="vm_pc.init(vm.userProfile, vm.license)" class="userProfile-detail-form-container">\n <md-grid-list flex md-cols-gt-xs="2" md-cols-gt-sm="2" md-cols-gt-md="4" md-cols-gt-lg="6" md-row-height-gt-xs="2:1" md-row-height-gt-sm="3:1" md-row-height-gt-md="3:1" gt-xs-gutter="4px" gt-sm-gutter="4px" gt-md-gutter="16px" gt-lg-gutter="16px">\n <md-grid-tile ng-repeat="father in vm_pc.modules" ng-if="vm_pc.userProfile.role !== \'admin\' && !father.permissions.hidden" md-colspan="2">\n <md-card flex-xs flex-gt-xs="90" layout="column" no-padding no-margin>\n <md-card-header>\n <md-card-avatar>\n <md-icon class="md-avatar-icon auto-size" md-font-icon="{{father.icon}}" ng-class="{ true: father.status.color }[true]">\n <md-tooltip>{{ father.status.info }}</md-tooltip>\n </md-icon>\n </md-card-avatar>\n <md-card-header-text layout-align="center start">\n <span class="md-title" translate="{{father.translate}}">{{ father.title }}</span>\n </md-card-header-text>\n <md-card-actions class="no-margin" layout="row" ng-init="vm_pc.checkSectionResources(father)" ng-if="father.status.tag != \'unlicensed\'">\n <md-switch class="auto-height no-margin" ng-model="father.allResourcesEnabled" ng-change="vm_pc.onChangeEnableAllResources(father)" aria-label="Enable all"></md-switch>\n <md-button class="md-mini auto-width" aria-label="Manage" ng-click="vm_pc.manageResources(father)" ng-hide="father.permissions && !father.permissions.association">\n <md-tooltip>{{\'STAFF.PERMISSIONS_MANAGE\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-cog"></md-icon>\n </md-button>\n </md-card-actions>\n <md-card-header-text ng-if="father.status.tag === \'unlicensed\'" layout-align="center end">\n <span class="md-subhead red-A700-fg">{{ father.status.name }}</span>\n </md-card-header-text>\n </md-card-header>\n </md-card>\n </md-grid-tile>\n </md-grid-list>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.DOWNLOADS">DOWNLOADS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container download_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.DOWNLOAD_PERMISSIONS">DOWNLOAD_PERMISSIONS</div>\n </div>\n <form name="download_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadAttachments" aria-label="Attachments" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ATTACHMENTS">Attachments</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadCallySquareRecordings" aria-label="CallySquare_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CALLYSQUARE_RECORDINGS">CallySquare_Recordings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadContactManagerLists" aria-label="Contact_Manager_Lists" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CONTACT_MANAGER_LISTS">Contact_Manager_Lists</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadJscriptySessions" aria-label="Jscripty_Sessions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.JSCRIPTY_SESSIONS">Jscripty_Sessions</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadOmnichannelInteractions" aria-label="Omnichannel_Interactions" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.OMNICHANNEL_INTERACTIONS">Omnichannel_Interactions</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadScreenRecordings" aria-label="Screen_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.SCREEN_RECORDINGS">Screen_Recordings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.userProfile.downloadVoiceRecordings" aria-label="Voice_Recordings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.VOICE_RECORDINGS">Voice_Recordings</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/userProfiles/userProfiles.html",'<div id="userProfiles" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERPROFILES">UserProfiles</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUserProfiles.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUserProfiles =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-userProfiles-count">\n <span>{{vm.selectedUserProfiles.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUserProfiles()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUserProfiles()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUserProfiles" csv-label="true" filename="userProfiles.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedUserProfiles($event)" aria-label="delete selected" translate translate-attr-label="STAFF.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- USERPROFILE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUserProfiles" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUserProfiles">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="crudPermissions">{{ \'STAFF.CRUDPERMISSIONS\' | translate }}</th>\n <th md-column md-order-by="privacyEnabled">{{ \'STAFF.MASK_SENSITIVE_DATA\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.userProfiles.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="userProfile" md-select-id="id" ng-repeat="userProfile in vm.userProfiles.rows">\n <td md-cell ng-if="userProfile.userpic"><img class="avatar" alt="{{userProfile.name}}" ng-src="api/users/{{userProfile.id}}/avatar" /></td>\n <td md-cell ng-if="!userProfile.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{userProfile.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="id ">{{userProfile.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="name ">{{userProfile.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="description ">{{userProfile.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="crudPermissions ">{{userProfile.selectedcrudPermissions}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="privacyEnabled ">\n <md-icon md-colors="{color: {{userProfile.privacyEnabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{userProfile.privacyEnabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(userProfile, $event )" translate="STAFF.EDIT_USERPROFILE">\n Edit UserProfile\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(userProfile, $event )" translate="STAFF.CLONE_USERPROFILE">\n clone UserProfile\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n\n <md-button ng-click="vm.deleteconfirm(userProfile, $event )" translate="STAFF.DELETE_USERPROFILE">\n Delete UserProfile\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.userProfiles.count}}" md-on-paginate="vm.getUserProfiles" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USERPROFILE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USERPROFILE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-userProfile-button" ng-click="vm.createOrEditUserProfile($event)" aria-label="add userProfile" translate translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USERPROFILE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required ng-disabled="!vm.newUser">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required>\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="userForm[\'userProfileId\'].$error" ng-show="userForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n\n <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n\n <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="userForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser && (vm.newUser)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n\n <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n\n <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.user.userSetting">\n <ms-client-side-logging user="vm.user"></ms-client-side-logging>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n ADD USER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.MANAGE_API_KEY\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-card layout-fill layout-padding>\n <textarea class="api-key-area" ng-model="vm.user.apiKey" rows="6" disabled></textarea>\n </md-card>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.generateApiKey()" class="send-button md-accent md-raised" aria-label="Generate" translate="{{ vm.user.apiKey === \'N/A\' ? \'STAFF.GENERATE\' : \'STAFF.REGENERATE\' }}" translate-attr-aria-label="STAFF.GENERATE">\n Generate\n </md-button>\n <md-button type="submit" ng-click="vm.removeApiKey()" class="send-button md-accent md-raised" aria-label="Remove" translate="STAFF.REMOVE" translate-attr-aria-label="STAFF.DELETE">\n Delete\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="userForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="STAFF.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n\n\n\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="user-image" hide-xs>\n <img ng-src="assets/images/business/users.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.user.id}}\n <span ng-if="vm.user.name">{{vm.user.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.apikeymanagerdialog(vm.user, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="apikeymanager">\n <md-tooltip><span translate="STAFF.APIKEYMANAGER_USER"></span></md-tooltip>\n <md-icon md-font-icon="fab fa-hubspot"></md-icon>\n </md-button>\n </div>\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUser()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required disabled>\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'userProfileId\'].$error" ng-show="personal_infoForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.user.phone" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.user.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus disabled>\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" disabled>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.APIKEY">ApiKey</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: \'API Key copied!\' });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n </div>\n <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\'" class="md-block">\n <md-switch ng-model="vm.user.disabled" aria-label="Disabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DISABLED">Disabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.DISABLED"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.user.id != vm.currentUser.id && vm.currentUser.role == \'admin\' && vm.user.disabled == 0" class="md-block">\n <md-switch ng-model="vm.user.blocked" aria-label="Blocked" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.BLOCKED">Blocked</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.BLOCKED"></span></div>\n </md-input-container>\n </form>\n </div>\n <div class="user-detail-form-container authentication md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.AUTHENTICATION">AUTHENTICATION</div>\n </div>\n <form name="authenticationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.user.adSsoEnabled" aria-label="AD_SSO_Enabled" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AD_SSO_ENABLED">AD_SSO_Enabled</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.AD_SSO_ENABLED"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user, vm.crudPermissions)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="user-detail-form-container internal-chat md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.INTERNAL_MESSENGER">INTERNAL_MESSENGER</div>\n </div>\n <form name="internalChatForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.user.messengerSoundNotification" \n aria-label="messengerSoundNotification" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="STAFF.MESSENGERSOUNDNOTIFICATION">MESSENGERSOUNDNOTIFICATION</span></md-switch>\n <div class="hint"><span translate="STAFF.HELP.MESSENGERSOUNDNOTIFICATION"></span></div>\n </md-input-container>\n </form>\n </div> \n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus disabled>\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.user.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.user.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.user.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.user.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.user.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.user.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.CLIENT_LOGS">CLIENT-SIDE LOGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container client_logs md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CLIENT_LOGS">\n CLIENT-SIDE LOGS\n </div>\n </div>\n <ms-client-side-logging user="vm.user" on-user-update="vm.refreshUser()"></ms-client-side-logging>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERS">Users</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-users-count">\n <span>{{vm.selectedUsers.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="STAFF.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- USER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n <th md-column md-order-by="userProfileId">{{ \'STAFF.USERPROFILE\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column md-order-by="disabled">{{ \'STAFF.DISABLED\' | translate }}</th>\n <th md-column md-order-by="blocked">{{ \'STAFF.BLOCKED\' | translate }}</th>\n <th md-column>{{ \'STAFF.CLIENT_LOGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.users.rows.length">\n <td md-cell colspan="11">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n <td md-cell ng-if="!user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="userProfileId font-weight-600">{{ (vm.userProfiles | filter : {\'id\':user.userProfileId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="disabled ">\n <md-icon md-colors="{color: {{user.disabled ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.disabled ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="blocked ">\n <md-icon md-colors="{color: {{user.blocked ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{user.blocked ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditAgent($event, user)" md-cell class="client-side-logging">\n <ms-client-side-logging-icon user="user"></ms-client-side-logging-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(user, $event )" translate="STAFF.EDIT_USER">\n Edit User\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' && user.id !== vm.currentUser.id">\n <md-button ng-click="vm.deleteconfirm(user, $event )" translate="STAFF.DELETE_USER">\n Delete User\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cannedAnswers-count">\n <span>{{vm.selectedCannedAnswers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CANNEDANSWER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(cannedAnswer, $event )" translate="TOOLS.EDIT_CANNEDANSWER">\n Edit CannedAnswer\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event )" translate="TOOLS.DELETE_CANNEDANSWER">\n Delete CannedAnswer\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CANNEDANSWER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n\n <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n ADD CANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/contact_item_types/contact_item_types.html",'<div id="contact_item_types" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CONTACTITEMTYPE">ContactItemType</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContactItemType.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContactItemType =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contact_item_types-count">\n <span>{{vm.selectedContactItemType.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContactItemType()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContactItemType()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContactItemType" csv-label="true" filename="contact_item_types.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContactItemType($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CONTACTITEMTYPE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContactItemType" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContactItemType">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="OrderBy">{{ \'TOOLS.ORDER_BY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contact_item_types.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contactItemType" md-select-id="id" ng-repeat="contactItemType in vm.contact_item_types.rows">\n <td md-cell ng-if="contactItemType.userpic"><img class="avatar" alt="{{contactItemType.name}}" ng-src="api/users/{{contactItemType.id}}/avatar" /></td>\n <td md-cell ng-if="!contactItemType.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{contactItemType.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="id ">{{contactItemType.id}}</td>\n <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="name ">{{contactItemType.name}}</td>\n <td ng-click="vm.createOrEditContactItemType($event, contactItemType)" md-cell class="OrderBy ">{{contactItemType.OrderBy}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(contactItemType, $event )" translate="TOOLS.EDIT_CONTACTITEMTYPE">\n Edit ContactItemType\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(contactItemType, $event )" translate="TOOLS.DELETE_CONTACTITEMTYPE">\n Delete ContactItemType\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contact_item_types.count}}" md-on-paginate="vm.getContactItemType" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTACTITEMTYPE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTACTITEMTYPE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-contactItemType-button" ng-click="vm.createOrEditContactItemType($event)" aria-label="add contactItemType" translate translate-attr-aria-label="TOOLS.ADD_CONTACTITEMTYPE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTACTITEMTYPE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/contact_item_types/create/dialog.html",'<md-dialog class="contactItemType-dialog" aria-label="New ContactItemType">\n <form name="contactItemTypeForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.contactItemType.name" ng-required="true" autofocus>\n\n <div ng-messages="contactItemTypeForm[\'name\'].$error" ng-show="contactItemTypeForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ORDER_BY">Order_by</label>\n <input type="integer" name="OrderBy" ng-model="vm.contactItemType.OrderBy" ng-required="true">\n\n <div ng-messages="contactItemTypeForm[\'OrderBy\'].$error" ng-show="contactItemTypeForm[\'OrderBy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ORDER_BY_REQUIRED">Order_by field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.contactItemType.rgbBackgroundColor" label="{{\'TOOLS.RGBBACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContactItemType" ng-click="vm.saveContactItemType()" class="send-button md-accent md-raised" ng-disabled="contactItemTypeForm.$invalid || contactItemTypeForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContactItemType" ng-click="vm.addNewContactItemType()" class="send-button md-accent md-raised" ng-disabled="contactItemTypeForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CONTACTITEMTYPE" translate-attr-aria-label="TOOLS.ADD_CONTACTITEMTYPE">\n ADD CONTACTITEMTYPE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContactItemType" ng-click="vm.deleteContactItemType($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n\n <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n ADD CUSTOMDASHBOARD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-customDashboards-count">\n <span>{{vm.selectedCustomDashboards.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.customDashboards.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(customDashboard, $event )" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n Edit CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(customDashboard, $event )" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n clone CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event )" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n goToDashboard CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(customDashboard, $event )" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n Delete CustomDashboard\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n CLONE CUSTOMDASHBOARD\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n <form name="dashboarditemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dashboarditem.type" ng-change="vm.onTypeChange()" autofocus ng-disabled="!vm.newDashboardItem">\n\n <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }} </md-option>\n\n <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }} </md-option>\n\n <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }} </md-option>\n\n <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }} </md-option>\n\n <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }} </md-option>\n\n <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\',\'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="attrChannel" ng-model="vm.dashboarditem.attrChannel" required>\n\n <md-option ng-value="\'chat\'"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n <md-option ng-value="\'mail\'"> {{ \'TOOLS.EMAIL\' | translate }} </md-option>\n\n <md-option ng-value="\'sms\'"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n <md-option ng-value="\'openchannel\'"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n <md-option ng-value="\'fax\'"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n <md-option ng-value="\'whatsapp\'"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrChannel\'].$error" ng-show="dashboarditemForm[\'attrChannel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="![\'web-report\', \'iframe\',\'clock\', \'custom\'].includes(vm.dashboarditem.type)">\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'mail\'" class="md-block">\n <label translate="TOOLS.FILTEREMAILACCOUNTS">FilterEmailAccounts</label>\n <md-select name="attrEmailAccounts" ng-model="vm.dashboarditem.attrEmailAccounts" multiple>\n <md-option ng-value="attrEmailAccounts.id" ng-repeat="attrEmailAccounts in vm.mailAccount" ng-disabled="attrEmailAccounts.canSelect === false">{{ attrEmailAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrEmailAccounts\'].$error" ng-show="dashboarditemForm[\'attrEmailAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTEREMAILACCOUNTS_REQUIRED">FilterEmailAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'fax\'" class="md-block">\n <label translate="TOOLS.FILTERFAXACCOUNTS">FilterFaxAccounts</label>\n <md-select name="attrFaxAccounts" ng-model="vm.dashboarditem.attrFaxAccounts" multiple>\n <md-option ng-value="attrFaxAccounts.id" ng-repeat="attrFaxAccounts in vm.faxAccount" ng-disabled="attrFaxAccounts.canSelect === false">{{ attrFaxAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrFaxAccounts\'].$error" ng-show="dashboarditemForm[\'attrFaxAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERFAXACCOUNTS_REQUIRED">FilterFaxAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'sms\'" class="md-block">\n <label translate="TOOLS.FILTERSMSACCOUNTS">FilterSmsAccounts</label>\n <md-select name="attrSmsAccounts" ng-model="vm.dashboarditem.attrSmsAccounts" multiple>\n <md-option ng-value="attrSmsAccounts.id" ng-repeat="attrSmsAccounts in vm.smsAccount" ng-disabled="attrSmsAccounts.canSelect === false">{{ attrSmsAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSmsAccounts\'].$error" ng-show="dashboarditemForm[\'attrSmsAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERSMSACCOUNTS_REQUIRED">FilterSmsAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'openchannel\'" class="md-block">\n <label translate="TOOLS.FILTEROPENCHANNELACCOUNTS">FilterOpenchannelAccounts</label>\n <md-select name="attrOpenchannelAccounts" ng-model="vm.dashboarditem.attrOpenchannelAccounts" multiple>\n <md-option ng-value="attrOpenchannelAccounts.id" ng-repeat="attrOpenchannelAccounts in vm.openchannelAccount" ng-disabled="attrOpenchannelAccounts.canSelect === false">{{ attrOpenchannelAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrOpenchannelAccounts\'].$error" ng-show="dashboarditemForm[\'attrOpenchannelAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTEROPENCHANNELACCOUNTS_REQUIRED">FilterOpenchannelAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'whatsapp\'" class="md-block">\n <label translate="TOOLS.FILTERWHATSAPPACCOUNTS">FilterWhatsappAccounts</label>\n <md-select name="attrWhatsappAccounts" ng-model="vm.dashboarditem.attrWhatsappAccounts" multiple>\n <md-option ng-value="attrWhatsappAccounts.id" ng-repeat="attrWhatsappAccounts in vm.whatsappAccount" ng-disabled="attrWhatsappAccounts.canSelect === false">{{ attrWhatsappAccounts.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrWhatsappAccounts\'].$error" ng-show="dashboarditemForm[\'attrWhatsappAccounts\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERWHATSAPPACCOUNTS_REQUIRED">FilterWhatsappAccounts field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.attrChannel === \'chat\'" class="md-block">\n <label translate="TOOLS.FILTERCHATWEBSITES">FilterChatWebsites</label>\n <md-select name="attrChatWebsites" ng-model="vm.dashboarditem.attrChatWebsites" multiple>\n <md-option ng-value="attrChatWebsites.id" ng-repeat="attrChatWebsites in vm.chatWebsite" ng-disabled="attrChatWebsites.canSelect === false">{{ attrChatWebsites.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrChatWebsites\'].$error" ng-show="dashboarditemForm[\'attrChatWebsites\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERCHATWEBSITES_REQUIRED">FilterChatWebsites field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type) && vm.dashboarditem.attrChannel === \'voice\'" class="md-block">\n <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues" ng-disabled="attrVoiceQueues.canSelect === false">{{ attrVoiceQueues.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLE">Title</label>\n <input type="text" name="title" ng-model="vm.dashboarditem.title" md-maxlength="255" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.TITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>Title must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLEFONTSIZE">TitleFontSize</label>\n <input type="number" name="titleFontSize" ng-model="vm.dashboarditem.titleFontSize" value="12">\n\n <div ng-messages="dashboarditemForm[\'titleFontSize\'].$error" ng-show="dashboarditemForm[\'titleFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLEFONTSIZE_REQUIRED">TitleFontSize field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" value="https://" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n <label translate="TOOLS.PATH">Path</label>\n <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.FORMAT">Format</label>\n <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" value="HH:mm:ss" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.TIMEZONE">Timezone</label>\n <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type === \'counter\'" class="md-block">\n <label translate="TOOLS.METRIC">Metric</label>\n <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE1">Serie1</label>\n <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE2">Serie2</label>\n <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE3">Serie3</label>\n <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'" ng-if="vm.dashboarditem.attrChannel === \'voice\' || vm.dashboarditem.attrChannel === \'chat\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.OPENED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel === \'voice\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'" ng-if="vm.dashboarditem.attrChannel !== \'voice\'"> {{ \'TOOLS.MANAGED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.dashboarditem.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="dashboarditemForm[\'report\'].$error" ng-show="dashboarditemForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REFRESH">Refresh</label>\n <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" value="10" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FONTSIZE">FontSize</label>\n <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" value="20" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LINK">link</label>\n <input type="url" name="link" ng-model="vm.dashboarditem.link">\n\n <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n ADD DASHBOARDITEM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="customDashboard-image" hide-xs>\n <img ng-src="assets/images/business/customDashboards.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.customDashboard.id}}\n <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCustomDashboard()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard, vm.crudPermissions)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n <div ng-if="vm_cd.customDashboard.widgets.length">\n <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" ng-if="vm_cd.crudPermissions.canEdit" aria-label="add item">\n <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-content flex>\n <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n </md-content>\n </div>\n <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/create/dialog.html",'<md-dialog ng-init="vm.onInit()" class="disposition-dialog" aria-label="New Disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newDisposition ? \'TOOLS.NEW_DISPOSITION\' : \'TOOLS.EDIT_DISPOSITION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.disposition.name" md-maxlength="255" required md-autofocus>\n <div ng-messages="dispositionForm[\'name\'].$error" ng-show="dispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.NAME_MAX_LENGTH" translate-values=\'{max: 255}\'>Name must have a maximum length\n equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.disposition.description" md-maxlength="255">\n <div ng-messages="dispositionForm[\'description\'].$error" ng-show="dispositionForm[\'description\'].$touched" role="alert">\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.DESCRIPTION_MAX_LENGTH" translate-values=\'{max: 255}\'>Description must have a\n maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.newDisposition && vm.dispositions.length > 0 || vm.disposition.ParentId" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="TOOLS.FIRST_LEVEL_DISPOSITION">First Level Disposition</label>\n <md-select name="firstLevelDisposition" ng-model="vm.firstLevelDisposition" ng-change="vm.onFirstLevelSelection()">\n <md-option ng-value="disposition" ng-repeat="disposition in vm.dispositions | filter: { level: \'first\' }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.firstLevelDisposition" ng-click="vm.clearSelection(\'first\'); dispositionForm.$setDirty();" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition" layout="row" layout-align="start center">\n <md-input-container class="md-block" flex>\n <label translate="TOOLS.SECOND_LEVEL_DISPOSITION">Second Level Disposition</label>\n <md-select name="secondLevelDisposition" ng-model="vm.secondLevelDisposition">\n <md-option ng-value="disposition" ng-if="disposition.id != vm.disposition.id" ng-repeat="disposition in vm.dispositions | filter: { level: \'second\', ParentId: vm.firstLevelDisposition.id }" ng-disabled="disposition.canSelect === false">{{ disposition.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-button ng-if="vm.secondLevelDisposition" ng-click="vm.clearSelection(\'second\'); dispositionForm.$setDirty();" class="md-icon-button">\n <md-icon md-font-icon="icon-cancel" aria-label="Clear first level disposition selection">\n </md-icon>\n </md-button>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDisposition" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid || dispositionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDisposition" ng-click="vm.addNewDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DISPOSITION" translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n ADD DISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDisposition" ng-click="vm.deleteDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/dispositions.html",'<div id="dispositions" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.DISPOSITIONS">Dispositions</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDispositions.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedDispositions = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-dispositions-count">\n <span>{{vm.selectedDispositions.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDispositions()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDispositions()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDispositions" csv-label="true" filename="dispositions.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.query.level = null; vm.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm.query.level" ng-change="vm.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n \x3c!-- DISPOSITION TABLE --\x3e\n <md-card flex="80">\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDispositions" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm.dispositions.rows">\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm.levels[disposition.level] }}</td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dispositions.count}}" md-on-paginate="vm.getDispositions" md-page-select>\n </md-table-pagination>\n </md-card>\n \x3c!-- / DISPOSITION TABLE --\x3e\n </div>\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n \x3c!-- ADD DISPOSITION BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-disposition-button" ng-click="vm.createOrEditDisposition($event)" aria-label="add disposition" translate translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DISPOSITION BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n\n <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" md-autofocus required>\n <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="interval-image" hide-xs>\n <img ng-src="assets/images/business/intervals.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.interval.id}}\n <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInterval()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.INTERVALS">INTERVALS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n <ms-search-bar on-search="vm_dc.getIntervalIntervals()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column md-order-by="id">\n {{ \'TOOLS.ID\' | translate }}\n </th>\n <th md-column md-order-by="name">\n {{ \'TOOLS.NAME\' | translate }}\n </th>\n <th md-column md-order-by="interval">\n {{ \'TOOLS.INTERVAL\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'TOOLS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_dc.sortableTable">\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{interval.id}}\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{interval.name}}\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{interval.interval}}\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>\n {{ interval.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-intervals-count">\n <span>{{vm.selectedIntervals.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- INTERVAL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.intervals.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(interval, $event )" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(interval, $event )" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERVAL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERVAL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n <form name="pauseForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n\n <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.pause.description">\n\n <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n ADD PAUSE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-pauses-count">\n <span>{{vm.selectedPauses.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- PAUSE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.pauses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(pause, $event )" translate="TOOLS.EDIT_PAUSE">\n Edit Pause\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(pause, $event )" translate="TOOLS.DELETE_PAUSE">\n Delete Pause\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PAUSE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PAUSE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n <form name="scheduleForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n\n <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.schedule.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="scheduleForm[\'report\'].$error" ng-show="scheduleForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTPUT">Output</label>\n <md-select name="output" ng-model="vm.schedule.output" required>\n <md-option ng-value="\'csv\'">CSV</md-option>\n <md-option ng-value="\'pdf\'">PDF</md-option>\n <md-option ng-value="\'xlsx\'">Excel</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div flex class="md-block">\n <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LAST">Last</label>\n <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" value="1" ng-required="true">\n\n <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.LASTUNIT">LastUnit</label>\n <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n <md-option ng-value="\'minutes\'">Minutes</md-option>\n <md-option ng-value="\'hours\'">Hours</md-option>\n <md-option ng-value="\'days\'">Days</md-option>\n <md-option ng-value="\'weeks\'">Weeks</md-option>\n <md-option ng-value="\'months\'">Months</md-option>\n <md-option ng-value="\'quarters\'">Quarters</md-option>\n <md-option ng-value="\'years\'">Years</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts" ng-disabled="MailAccountId.canSelect === false">{{ MailAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILCCADDRESS">EmailCcAddress</label>\n <input type="text" name="cc" ng-model="vm.schedule.cc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'cc\'].$error" ng-show="scheduleForm[\'cc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILCCADDRESS_REQUIRED">EmailCcAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILBCCADDRESS">EmailBccAddress</label>\n <input type="text" name="bcc" ng-model="vm.schedule.bcc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILBCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'bcc\'].$error" ng-show="scheduleForm[\'bcc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILBCCADDRESS_REQUIRED">EmailBccAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <md-switch ng-model="vm.schedule.sendIfEmpty" aria-label="SendIfEmpty"><span translate="TOOLS.SENDIFEMPTY">SendIfEmpty</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.schedule.description">\n\n <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n ADD SCHEDULE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable">\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-schedules-count">\n <span>{{vm.selectedScheduler.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SCHEDULE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.schedules.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(schedule, ev) : vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(schedule, $event )" translate="TOOLS.EDIT_SCHEDULE">\n Edit Schedule\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.runconfirm(schedule, $event )" translate="TOOLS.RUN_SCHEDULE">\n Run Schedule\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(schedule, $event )" translate="TOOLS.DELETE_SCHEDULE">\n Delete Schedule\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCHEDULE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SCHEDULE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n <form name="soundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n\n <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sound.description">\n\n <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n ADD SOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sounds-count">\n <span>{{vm.selectedSounds.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SOUND TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sounds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(sound, $event )" translate="TOOLS.EDIT_SOUND">\n Edit Sound\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.downloadfile2(sound, $event , \'sounds\' )" translate="TOOLS.DOWNLOAD_SOUND">\n Download Sound\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(sound, $event )" translate="TOOLS.DELETE_SOUND">\n Delete Sound\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SOUND TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD SOUND BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-sound-button" ng-click="vm.uploadSound($event)" aria-label="upload sound" translate translate-attr-aria-label="TOOLS.UPLOAD_SOUND">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="sound-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="TOOLS.UPLOADING">Uploading</span>\n <span>{{vm.sound.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n\n <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.tag.description">\n\n <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n ADD TAG\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTags.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-tags-count">\n <span>{{vm.selectedTags.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TAG TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.tags.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(tag, $event )" translate="TOOLS.EDIT_TAG">\n Edit Tag\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(tag, $event )" translate="TOOLS.DELETE_TAG">\n Delete Tag\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TAG TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TAG BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n <form name="templateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n\n <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.template.html"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.template.description">\n\n <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n ADD TEMPLATE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-templates-count">\n <span>{{vm.selectedTemplates.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TEMPLATE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.templates.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(template, $event )" translate="TOOLS.EDIT_TEMPLATE">\n Edit Template\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(template, $event )" translate="TOOLS.DELETE_TEMPLATE">\n Delete Template\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEMPLATE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEMPLATE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n <form name="triggerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newTrigger ? \'TOOLS.NEW_TRIGGER\' : \'TOOLS.EDIT_TRIGGER\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" required md-autofocus>\n <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }}\n </md-option>\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }} </md-option>\n </md-select>\n <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span>\n </md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{ error.message }}</span>\n <span class="type">({{ error.type }})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n ADD TRIGGER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/actions.html",'<div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\r\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\r\n <div class="md-toolbar-tools">\r\n <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\r\n <ms-search-bar on-search="vm_dc.getTriggerActions()" query="vm_dc.query" debounce="300" direction="down">\r\n </ms-search-bar>\r\n <div flex></div>\r\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\r\n <md-icon md-font-icon="icon-plus"></md-icon>\r\n </md-button>\r\n </div>\r\n </md-toolbar>\r\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\r\n <div class="md-toolbar-tools">\r\n <span class="md-subhead">{{ vm_dc.selectedTriggerActions.length }}\r\n {{ vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\' }} selected</span>\r\n <div flex></div>\r\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\r\n <md-icon md-font-icon="icon-file-excel"></md-icon>\r\n </button>\r\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\r\n <md-icon md-font-icon="icon-delete"></md-icon>\r\n </md-button>\r\n </div>\r\n </md-toolbar>\r\n <md-table-container class="font-size-12">\r\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\r\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\r\n <tr md-row>\r\n <th md-column md-order-by="id">\r\n {{ \'TOOLS.ID\' | translate }}\r\n </th>\r\n <th md-column md-order-by="action">\r\n {{ \'TOOLS.ACTION\' | translate }}\r\n </th>\r\n <th md-column md-order-by="data1">\r\n {{ \'TOOLS.TYPE\' | translate }}\r\n </th>\r\n <th md-column md-order-by="data2">\r\n {{ \'TOOLS.INFO\' | translate }}\r\n </th>\r\n <th md-column md-order-by="createdAt">\r\n {{ \'TOOLS.CREATED_AT\' | translate }}\r\n </th>\r\n <th md-column width="10px"></th>\r\n </tr>\r\n </thead>\r\n <tbody md-body>\r\n <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n {{ action.id }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n {{ \'TOOLS.\' + (action.action | snakecase | uppercase) | translate }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>\r\n {{ action.data1 === \'1\' ? \'CTI URL\' : \'Popup\' }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n {{ (vm_dc.lists | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>\r\n {{ action.data2 === \'1\' ? \'TOOLS.YES\' : \'TOOLS.NO\' | uppercase | translate }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n {{ action.data1 }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data1" md-cell>\r\n {{ action.data1 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data2" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'script\' && action.data1" md-cell>\r\n {{ action.data1 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>\r\n {{ (vm_dc.projects | filter : {\'id\':(action.data1 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>\r\n {{ vm_dc.integrationTypes[action.data1] }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>\r\n {{ (vm_dc.zendeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>\r\n {{ (vm_dc.deskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>\r\n {{ (vm_dc.zohoAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>\r\n {{ (vm_dc.salesforceAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>\r\n {{ (vm_dc.sugarcrmAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>\r\n {{ (vm_dc.freshdeskAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'vtiger\'" md-cell>\r\n {{ (vm_dc.vtigerAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'dynamics365\'" md-cell>\r\n {{ (vm_dc.dynamics365Accounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'servicenow\'" md-cell>\r\n {{ (vm_dc.servicenowAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshsales\'" md-cell>\r\n {{ (vm_dc.freshsalesAccounts | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>\r\n {{ vm_dc.motionBarOptions[action.data1] }} </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'1\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'2\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 === \'0\'" md-cell>\r\n {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'0\'" md-cell>\r\n {{ (vm_dc.templates | filter : {\'id\':(action.data2 | toInteger)} : true)[0].name }}</td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 === \'1\'" md-cell>\r\n {{ action.data2 }}\r\n </td>\r\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>\r\n {{ action.createdAt | formatdate }}\r\n </td>\r\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\r\n <md-menu>\r\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\r\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\r\n </md-button>\r\n <md-menu-content width="3">\r\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\r\n <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\r\n Edit Action\r\n </md-button>\r\n </md-menu-item>\r\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\r\n <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\r\n Delete Action\r\n </md-button>\r\n </md-menu-item>\r\n </md-menu-content>\r\n </md-menu>\r\n </td>\r\n </tr>\r\n <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\r\n <td md-cell colspan="5">\r\n <div layout="row" layout-align="center center">\r\n <span class="text-boxed-light" translate="TOOLS.NO_ACTION_AVAILABLE">No action\r\n available</span>\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </md-table-container>\r\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.triggerActions.count }}" md-on-paginate="vm_dc.getTriggerActions" md-page-select>\r\n </md-table-pagination>\r\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/actions/create/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n <form name="actionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newAction ? \'TOOLS.NEW_ACTION\' : \'TOOLS.EDIT_ACTION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.ACTION">Action</label>\n <md-select name="action" ng-model="vm.action.action" ng-init="vm.onActionInit()" ng-change="vm.onActionSelection()" md-autofocus required ng-disabled="!vm.newAction">\n <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'">\n {{ \'TOOLS.CONTACT_MANAGER\' | translate }} </md-option>\n <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\' && ((vm.newAction && vm.hasIntegrationsPermissions) || !vm.newAction)">\n {{ \'TOOLS.INTEGRATIONS\' | translate }} </md-option>\n <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTIONBAR\' | translate }} </md-option>\n <md-option ng-value="\'jscripty\'"> {{ \'TOOLS.JSCRIPTY\' | translate }} </md-option>\n <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }} </md-option>\n <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }} </md-option>\n <md-option ng-value="\'bot\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.BOT\' | translate }} </md-option>\n <md-option ng-value="\'script\'"> {{ \'TOOLS.SCRIPT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n <label translate="TOOLS.PROJECT">Project</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects" ng-disabled="data1.canSelect === false">\n {{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.LIST">List</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onListSelection()" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists" ng-disabled="data1.canSelect === false">\n {{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.SEARCH_FIELDS">Search fields</label>\n <md-select name="fields" ng-model="vm.action.data3" ng-init="vm.onSearchFieldsInit()" multiple required>\n <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n {{ field.name }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEARCH_FIELDS_REQUIRED">Search fields field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.AUTOCREATECONTACT">Create contact automatically</label>\n <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onAutocreateSelection()" required>\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\' && vm.action.data2 === \'1\'" class="md-block">\n <label translate="TOOLS.AUTOCREATE_FIELD">Autocreate field</label>\n <md-select name="autocreateField" ng-model="vm.action.data4" ng-required="vm.action.data2 === \'1\'">\n <md-optgroup label="{{ \'TOOLS.STANDARD\' | translate }}">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.contactFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.LIST\' | translate }}" ng-if="vm.listFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.listFields">\n {{ field.name }}</md-option>\n </md-optgroup>\n <md-optgroup label="{{ \'TOOLS.GLOBALS\' | translate }}" ng-if="vm.customFields.length > 0">\n <md-option ng-value="field.columnName" ng-repeat="field in vm.customFields">\n {{ field.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATE_FIELD_REQUIRED">Autocreate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.IGNOREDIALERCONTACTID">Ignore dialer contact Id</label>\n <md-select name="data5" ng-model="vm.action.data5" required>\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.IGNOREDIALERCONTACTID_REQUIRED">Ignore dialer contact Id field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'GET\'">GET</md-option>\n <md-option ng-value="\'POST\'">POST</md-option>\n <md-option ng-value="\'PUT\'">PUT</md-option>\n <md-option ng-value="\'DELETE\'">DELETE</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TIMEOUT">Timeout</label>\n <input type="number" name="data5" ng-model="vm.action.data5" min="1" max="10" ng-required="true">\n <div class="hint"><span translate="TOOLS.HELP.TIMEOUT"></span></div>\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>10</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.HEADERS">Headers</label>\n <textarea name="data6" ng-model="vm.action.data6"></textarea>\n <div class="hint"><span translate="TOOLS.HELP.HEADERS"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\' && (vm.action.data1 == \'POST\' || vm.action.data1 == \'PUT\')" class="md-block">\n <label translate="TOOLS.BODY">Body</label>\n <textarea name="data7" ng-model="vm.action.data7"></textarea>\n <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n <label translate="TOOLS.SCRIPT_TYPE">Script_Type</label>\n <input type="input" name="data2" ng-model="vm.action.data2">\n <div class="hint"><span translate="TOOLS.HELP.SCRIPT_TYPE"></span></div>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SCRIPT_TYPE_REQUIRED">Script_Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n <label translate="TOOLS.SCRIPT_INFO">Script_Info</label>\n <input type="input" name="data1" ng-model="vm.action.data1">\n <div class="hint"><span translate="TOOLS.HELP.SCRIPT_INFO"></span></div>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SCRIPT_INFO_REQUIRED">Script_Info field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'script\'" class="md-block">\n <label translate="TOOLS.SCRIPT">Script</label>\n <textarea name="data3" ng-model="vm.action.data3" required></textarea>\n <div class="hint"><span translate="TOOLS.HELP.SCRIPT"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SCRIPT_REQUIRED">Script field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n <label translate="TOOLS.INTEGRATION">Integration</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-init="vm.onIntegrationInit()" ng-change="vm.onIntegrationSelection()" required>\n <md-option ng-value="\'desk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])">Desk</md-option>\n <md-option ng-value="\'dynamics365\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])">Dynamics365</md-option>\n <md-option ng-value="\'freshdesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])">Freshdesk</md-option>\n <md-option ng-value="\'freshsales\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1304]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1304])">Freshsales</md-option>\n <md-option ng-value="\'salesforce\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])">Salesforce</md-option>\n <md-option ng-value="\'servicenow\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])">ServiceNow</md-option>\n <md-option ng-value="\'sugarcrm\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])">SugarCRM</md-option>\n <md-option ng-value="\'vtiger\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])">vTiger</md-option>\n <md-option ng-value="\'zendesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])">Zendesk</md-option>\n <md-option ng-value="\'zoho\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])">Zoho</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" ng-change="vm.onIntegrationAccountSelection()" ng-disabled="vm.action.isIntegrationDisabled" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.accounts">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="vm.action.isIntegrationDisabled">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.configurations | filter : { AccountId: (vm.action.data2 | toInteger) } : true">{{\n data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-change="vm.onTypeSelection()" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n <md-option ng-value="\'2\'">Windows App</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.APPLICATION">Application</label>\n <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.ARGUMENTS">Arguments</label>\n <input type="text" name="data3" ng-model="vm.action.data3">\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n {{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">\n {{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.LOCATION">Location</label>\n <md-select name="data4" ng-model="vm.action.data4" required ng-change="vm.onActionLocationChange()">\n <md-option ng-value="0"> {{ \'TOOLS.NEW_TAB\' | translate }} </md-option>\n <md-option ng-value="1"> {{ \'TOOLS.NEW_WINDOW\' | translate }} </md-option>\n <md-option ng-value="2"> {{ \'TOOLS.MOTION_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n <input type="text" name="data5" ng-model="vm.action.data5">\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n <input type="text" name="data6" ng-model="vm.action.data6">\n <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n ADD ACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html",'<div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">All Conditions</span>\n <ms-search-bar on-search="vm_dc.getAllConditions()" query="vm_dc.query" debounce="300" direction="down">\n </ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{ vm_dc.selectedAllConditions.length }}\n {{ vm_dc.selectedAllConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAllConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedAllConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAllConditions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'TOOLS.ID\' | translate }}\n </th>\n <th md-column md-order-by="field">\n {{ \'TOOLS.FIELD\' | translate }}\n </th>\n <th md-column md-order-by="operator">\n {{ \'TOOLS.OPERATOR\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'TOOLS.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'TOOLS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.allConditions.rows">\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ allCondition.id }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ \'TOOLS.\' + vm_dc.fields[allCondition.field] | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ \'TOOLS.\' + allCondition.operator | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>\n {{ allCondition.value }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.chatWebsites | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.mailAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.smsAccounts | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.whatsappAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.faxAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>\n {{ (vm_dc.openchannelAccounts | filter : {\'id\': (allCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>\n {{ (vm_dc.queues | filter : {\'name\':allCondition.value} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>\n {{ (vm_dc.outboundRoutes | filter : {\'id\':(allCondition.value | toInteger)} : true)[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'agent\'" md-cell>\n {{ (vm_dc.agents | filter : {\'name\':allCondition.value} : true)[0].fullname }}</td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>\n {{ vm_dc.callStatuses[allCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>\n {{ allCondition.value | capitalize }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>\n {{ vm_dc.messageStatuses[allCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'mailSubstatus\'" md-cell>\n {{ allCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': allCondition.value } : true)[0].name }}\n </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'offlineMessage\'" md-cell>\n {{allCondition.value}} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" md-cell>\n {{ allCondition.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n Edit AllCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n Delete AllCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.allConditions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No condition\n available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.allConditions.count }}" md-on-paginate="vm_dc.getAllConditions" md-page-select>\n </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/create/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n <form name="allConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newAllCondition ? \'TOOLS.NEW_ALLCONDITION\' : \'TOOLS.EDIT_ALLCONDITION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.allCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n </md-option>\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n </md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n </md-option>\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n </md-option>\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n </md-option>\n <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.allCondition.operator" required>\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n {{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.AGENT">Agent</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n {{ value.fullname }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n {{ status.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'mailSubstatus\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n {{ mailSubstatus.name }}</md-option>\n <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.CHAT">Chat</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'created\'">Created</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n ADD ALLCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html",'<div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.onInit(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n <ms-search-bar on-search="vm_dc.getAnyConditions()" query="vm_dc.query" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{ vm_dc.selectedAnyConditions.length }}\n {{ vm_dc.selectedAnyConditions.length > 1 ? \'items\' : \'item\' }} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedAnyConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedAnyConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getAnyConditions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'TOOLS.ID\' | translate }}\n </th>\n <th md-column md-order-by="field">\n {{ \'TOOLS.FIELD\' | translate }}\n </th>\n <th md-column md-order-by="operator">\n {{ \'TOOLS.OPERATOR\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'TOOLS.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'TOOLS.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.anyConditions.rows">\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ anyCondition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ \'TOOLS.\' + vm_dc.fields[anyCondition.field] | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ \'TOOLS.\' + anyCondition.operator | uppercase | translate }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>\n {{ anyCondition.value }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.chatWebsites | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.mailAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.smsAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, allCondition)" ng-if="vm.trigger.channel == \'whatsapp\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.whatsappAccounts | filter : {\'id\':(anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.faxAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>\n {{ (vm_dc.openchannelAccounts | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>\n {{ (vm_dc.queues | filter : {\'name\':anyCondition.value} : true)[0].name }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>\n {{ (vm_dc.outboundRoutes | filter : {\'id\': (anyCondition.value | toInteger)} : true)[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'agent\'" md-cell>\n {{ (vm_dc.agents | filter : {\'name\':anyCondition.value} : true)[0].fullname }}</td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>\n {{ vm_dc.callStatuses[anyCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>\n {{ anyCondition.value | capitalize }} </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>\n {{ vm_dc.messageStatuses[anyCondition.value] }} </td>\n <td ng-click="vm_dc.createOrEditAllCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'mailSubstatus\'" md-cell>\n {{ anyCondition.value === \'null\' ? (\'TOOLS.NONE\' | translate) : (vm_dc.mailSubstatuses | filter : {\'name\': anyCondition.value } : true)[0].name }}\n </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'offlineMessage\'" md-cell>\n {{anyCondition.value}} </td>\n <td ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" md-cell>\n {{ anyCondition.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n Edit AnyCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n Delete AnyCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.anyConditions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition\n available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{ vm_dc.anyConditions.count }}" md-on-paginate="vm_dc.getAnyConditions" md-page-select>\n </md-table-pagination>\n</div>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/create/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n <form name="anyConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newAnyCondition ? \'TOOLS.NEW_ANYCONDITION\' : \'TOOLS.EDIT_ANYCONDITION\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.anyCondition.field" ng-change="vm.onFieldSelection()" md-autofocus required>\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }}\n </md-option>\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }}\n </md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.AGENT\' | translate }}\n </md-option>\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }}\n </md-option>\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'">\n {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }}\n </md-option>\n <md-option ng-value="\'mailSubstatus\'" ng-if="vm.trigger.channel == \'mail\'"> {{ \'TOOLS.MAIL_SUBSTATUS\' | translate }}\n </md-option>\n <md-option ng-value="\'offlineMessage\'" ng-if="vm.trigger.channel == \'chat\'"> {{ \'TOOLS.OFFLINE_MESSAGE\' | translate }}\n </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.accounts" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">\n {{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id.toString()" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">\n {{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'agent\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.AGENT">Agent</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.agents" ng-disabled="value.canSelect === false">\n {{ value.fullname }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="status.value" ng-repeat="status in vm.callStatuses">\n {{ status.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'mailSubstatus\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="mailSubstatus.name" ng-repeat="mailSubstatus in vm.mailSubstatuses">\n {{ mailSubstatus.name }}</md-option>\n <md-option ng-value="\'null\'">{{\'TOOLS.NONE\' | translate}}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n <md-option ng-if="vm.trigger.channel==\'mail\'" ng-value="\'substatus\'">SubStatus</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'offlineMessage\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.CHAT">Chat</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'created\'">Created</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n ADD ANYCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="trigger-image" hide-xs>\n <img ng-src="assets/images/business/triggers.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">#{{ vm.trigger.id }}\n <span ng-if="vm.trigger.name">{{ vm.trigger.name }}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{ vm.trigger.createdAt | date:\'medium\' }}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrigger()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" required autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required disabled>\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel">\n {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n <md-option ng-value="\'whatsapp\'" ng-if="vm.license.whatsapp"> {{ \'TOOLS.WHATSAPP\' | translate }}\n </md-option>\n </md-select>\n <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status" ng-disabled="!vm.crudPermissions.canEdit">\n <span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/allconditions/allconditions.html\'">\n </div>\n <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/anyconditions/anyconditions.html\'">\n </div>\n <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp" ng-include="\'app/main/apps/tools/views/triggers/edit/actions/actions.html\'">\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-triggers-count">\n <span>{{ vm.selectedTriggers.length }}</span>\n <span translate="TOOLS.SELECTED">Selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n \x3c!-- TRIGGER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.triggers.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{ trigger.id }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{ trigger.name }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">\n {{ \'TOOLS.\' + trigger.channel | uppercase | translate }}</td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n <md-icon md-colors="{color: {{ trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ trigger.status ? \'icon-check\' : \'icon-close\' }}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditTrigger($event, trigger)" md-cell class="description ">\n {{ trigger.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToEditState(trigger)" translate="TOOLS.EDIT_TRIGGER">\n Edit Trigger\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n Delete Trigger\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'TOOLS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'TOOLS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'TOOLS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.triggers.count }}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRIGGER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n \x3c!-- ADD TRIGGER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n\n <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n ADD TRUNK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/clone/clone.html",'<md-dialog class="trunk-dialog" aria-label="Clone Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_TRUNK" translate-attr-aria-label="TOOLS.CLONE_TRUNK">\n CLONE TRUNK\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trunk-image" hide-xs>\n <img ng-src="assets/images/business/trunks.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trunk.id}}\n <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.trunk, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrunk()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CONTEXT">context</label>\n <md-select name="context" ng-model="vm.trunk.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLERID">callerid</label>\n <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.trunk.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n <md-option ng-value="\'info\'">info</md-option>\n <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n <md-option ng-value="\'inband\'">inband</md-option>\n <md-option ng-value="\'auto\'">auto</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAT">nat</label>\n <md-select name="nat" ng-model="vm.trunk.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.QUALIFY">qualify</label>\n <md-select name="qualify" ng-model="vm.trunk.qualify" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.trunk.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g723\'">g723</md-option>\n <md-option ng-value="\'g726\'">g726</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'ilbc\'">ilbc</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.INSECURE">insecure</label>\n <md-select name="insecure" ng-model="vm.trunk.insecure" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'port\'">port</md-option>\n <md-option ng-value="\'invite\'">invite</md-option>\n <md-option ng-value="\'very\'">very</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n <input type="number" name="call_limit" ng-model="vm.trunk.call_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n <md-select name="directmedia" ng-model="vm.trunk.directmedia" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'nonat\'">nonat</md-option>\n <md-option ng-value="\'update\'">update</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n <md-select name="callcounter" ng-model="vm.trunk.callcounter" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMUSER">fromuser</label>\n <input type="text" name="fromuser" ng-model="vm.trunk.fromuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n\n <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ENCRYPTION">encryption</label>\n <md-select name="encryption" ng-model="vm.trunk.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.PORT">port</label>\n <input type="number" name="port" ng-model="vm.trunk.port" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.trunk.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl" value="no" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.trunk.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'videosupport\'].$error" ng-show="advancedForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n </div>\n <form name="otherFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-trunks-count">\n <span>{{vm.selectedTrunks.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- TRUNK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(trunk, $event )" translate="TOOLS.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.clonedialog(trunk, $event )" translate="TOOLS.CLONE_TRUNK">\n clone Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(trunk, $event )" translate="TOOLS.GOTOREALTIME_TRUNK">\n goToRealtime Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(trunk, $event )" translate="TOOLS.DELETE_TRUNK">\n Delete Trunk\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRUNK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRUNK BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n <form name="variableForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n\n <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.variable.description">\n\n <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n ADD VARIABLE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-variables-count">\n <span>{{vm.selectedVariables.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TOOLS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="TOOLS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VARIABLE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.variables.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(variable, $event )" translate="TOOLS.EDIT_VARIABLE">\n Edit Variable\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(variable, $event )" translate="TOOLS.DELETE_VARIABLE">\n Delete Variable\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VARIABLE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VARIABLE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/video/views/screenRecordings/create/dialog.html",'<md-dialog class="screenRecording-dialog" aria-label="New screenRecording">\n <form name="screenRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VIDEO.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.screenRecording.rating" autofocus ng-disabled="!vm.newscreenRecording && !vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VIDEO.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="screenRecordingForm[\'rating\'].$error" ng-show="screenRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VIDEO.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newscreenRecording" ng-click="vm.savescreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid || screenRecordingForm.$pristine" aria-label="SAVE" translate="VIDEO.SAVE" translate-attr-aria-label="VIDEO.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newscreenRecording" ng-click="vm.addNewscreenRecording()" class="send-button md-accent md-raised" ng-disabled="screenRecordingForm.$invalid" aria-label="ADD" translate="VIDEO.ADD_SCREENRECORDING" translate-attr-aria-label="VIDEO.ADD_SCREENRECORDING">\n ADD SCREENRECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newscreenRecording" ng-click="vm.deletescreenRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VIDEO.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VIDEO.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/partialViews/play.html",'<md-dialog class="play-dialog" aria-label="play">\n <form name="playForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="{{ vm.app.toUpperCase() }}.{{ vm.label.toUpperCase() }}">Play Recording</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-sm flex>\n \x3c!-- VIRTUAL field --\x3e\n <md-card>\n\n <md-card-title ng-if="vm.actionOptions.upperTitle">\n <md-card-title-text>\n <span class="md-headline">{{ vm.filename }}</span>\n <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>: {{ vm.recording.updatedAt}}</span>\n </md-card-title-text>\n </md-card-title>\n\n \x3c!-- video recording directive --\x3e\n <ms-dialog-recording ng-if="vm.format" id="vm.recording.id" title="vm.filename" element="vm.element" model="vm.route" path="vm.path" class="md-card-image"></ms-dialog-recording>\n \x3c!-- / video recording directive --\x3e\n\n <span ng-if="!vm.format">\n <em ng-if="vm.found">{{ vm.app.toUpperCase() + \'.CANT_PLAY_THIS_FILE\' | translate }}</em>\n <em ng-if="!vm.found">{{ vm.app.toUpperCase() + \'.FILE_NOT_FOUND\' | translate }}</em>\n </span>\n\n <md-card-title ng-if="vm.actionOptions.lowerTitle">\n <md-card-title-text>\n <span class="md-headline">{{ vm.filename }}</span>\n <span class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.UPDATEDAT"></span>:{{ vm.recording.updatedAt}}</span>\n <span ng-if="vm.actionOptions.properties" class="md-subhead"><span translate="{{ vm.app.toUpperCase() }}.PROPERTIES"></span>:</span>\n </md-card-title-text>\n </md-card-title>\n\n <md-card-content ng-if="vm.actionOptions.properties">\n <md-list>\n <md-list-item class="md-2-line" ng-repeat="(key,value) in vm.properties" ng-click="null" ng-if="key != \'value\' && key != \'updatedAt\' && key != \'queue\'">\n\n <md-icon ng-if="vm.icon" class="md-avatar-icon" md-font-icon="vm.actionOptions.propertiesIcon" class="s24"></md-icon>\n\n <div class="md-list-item-text" layout="column">\n <p><b><span translate="{{ vm.app.toUpperCase() }}.{{ key.toUpperCase() }}"></span></b></p>\n <p>{{ value }}\n <p>\n </div>\n </md-list-item>\n </md-list>\n </md-card-content>\n\n\n </md-card>\n </div>\n </md-dialog-content>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/video/views/screenRecordings/screenRecordings.html",'<div id="screenRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-video" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VIDEO.SCREENRECORDINGS">ScreenRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VIDEO.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getScreenRecordings()"></ms-quick-filter>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScreenRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScreenRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VIDEO.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-screenRecordings-count">\n <span>{{vm.selectedScreenRecordings.length}}</span>\n <span translate="VIDEO.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VIDEO.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScreenRecordings()" translate="VIDEO.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScreenRecordings()" translate="VIDEO.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScreenRecordings" csv-label="true" filename="screenRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScreenRecordings($event)" aria-label="delete selected" translate translate-attr-label="VIDEO.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- SCREENRECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScreenRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScreenRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VIDEO.ID\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VIDEO.RATING\' | translate }}</th>\n <th md-column md-order-by="UserId">{{ \'VIDEO.AGENT\' | translate }}</th>\n <th md-column md-order-by="duration">{{ \'VIDEO.DURATION\' | translate }}</th>\n <th md-column md-order-by="startedAt">{{ \'VIDEO.RECORDSTARTTIME\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'VIDEO.RECORDENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.screenRecordings.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="VIDEO.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="screenRecording" md-select-id="id" ng-repeat="screenRecording in vm.screenRecordings.rows">\n <td md-cell ng-if="screenRecording.userpic"><img class="avatar" alt="{{screenRecording.name}}" ng-src="api/users/{{screenRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!screenRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{screenRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="id ">{{screenRecording.id}}</td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="screenRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:screenRecording.rating"></md-icon><span ng-hide="screenRecording.rating" translate="VIDEO.NO_RATING">No rating</span>\n </td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="UserId ">{{ (vm.users | filter : {\'id\':screenRecording.UserId} : true)[0].fullname }}</td>\n <td md-cell><span ng-bind="vm.convertDuration(screenRecording.duration)"></span></td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="startedAt ">{{screenRecording.startedAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditscreenRecording($event, screenRecording)" md-cell class="closedAt ">{{screenRecording.closedAt | date:\'medium\' }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VIDEO.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.playrecording(screenRecording, $event , \'value\' , \'play_screenrecording\' , \'video\' )" translate="VIDEO.PLAY_SCREENRECORDING">\n play screenRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadScreenRecordings">\n\n <md-button ng-click="vm.downloadfile2(screenRecording, $event , \'screen/recordings\' )" translate="VIDEO.DOWNLOAD_SCREENRECORDING">\n Download screenRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(screenRecording, $event )" translate="VIDEO.DELETE_SCREENRECORDING">\n Delete screenRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VIDEO.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VIDEO.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VIDEO.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.screenRecordings.count}}" md-on-paginate="vm.getScreenRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCREENRECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/routing/dialog.html",'<md-dialog ng-init="vm.init()" class="voice-routing-dialog" aria-label="New routing application">\n <form name="routingAppForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'VOICE.EDIT_\' + vm.application.appType | uppercase | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-switch="vm.application.appType">\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div ng-switch-when="agi">\n <div ng-include="\'app/main/apps/voice/routing/views/agi.html\'"></div>\n </div>\n <div ng-switch-when="custom">\n <div ng-include="\'app/main/apps/voice/routing/views/custom.html\'"></div>\n </div>\n <div ng-switch-when="dial">\n <div ng-include="\'app/main/apps/voice/routing/views/dial.html\'"></div>\n </div>\n <div ng-switch-when="externalDial">\n <div ng-include="\'app/main/apps/voice/routing/views/externalDial.html\'"></div>\n </div>\n <div ng-switch-when="goTo">\n <div ng-include="\'app/main/apps/voice/routing/views/goTo.html\'"></div>\n </div>\n <div ng-switch-when="hangup">\n <div ng-include="\'app/main/apps/voice/routing/views/hangup.html\'"></div>\n </div>\n <div ng-switch-when="internalDial">\n <div ng-include="\'app/main/apps/voice/routing/views/internalDial.html\'"></div>\n </div>\n <div ng-switch-when="outboundDial">\n <div ng-include="\'app/main/apps/voice/routing/views/outboundDial.html\'"></div>\n </div>\n <div ng-switch-when="playback">\n <div ng-include="\'app/main/apps/voice/routing/views/playback.html\'"></div>\n </div>\n <div ng-switch-when="queue">\n <div ng-include="\'app/main/apps/voice/routing/views/queue.html\'"></div>\n </div>\n <div ng-switch-when="ringGroup">\n <div ng-include="\'app/main/apps/voice/routing/views/ringGroup.html\'"></div>\n </div>\n <div ng-switch-when="set">\n <div ng-include="\'app/main/apps/voice/routing/views/set.html\'"></div>\n </div>\n <div ng-switch-when="voicemail">\n <div ng-include="\'app/main/apps/voice/routing/views/voicemail.html\'"></div>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveRoutingApp()" class="send-button md-accent md-raised" ng-disabled="routingAppForm.$invalid || routingAppForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/interval/dialog.html",'<md-dialog ng-init="vm.initialize()" class="interval-dialog" aria-label="Edit Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'TOOLS.EDIT_INTERVAL\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.crudPermissions.canEdit" ng-change="vm.onTypeChange()">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | startcase }}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.crudPermissions.canEdit" required>\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals.rows" ng-disabled="interval.canSelect === false">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n </md-select>\n </md-input-container>\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | startcase }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n </md-select>\n </md-input-container>\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | startcase }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/routing/views/agi.html",'<md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.application.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects.rows" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'project\'].$error" ng-show="routingAppForm[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/custom.html",'<md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.application.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'app\'].$error" ng-show="routingAppForm[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.application.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'appdata\'].$error" ng-show="routingAppForm[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/dial.html",'<md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.application.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'tech\'].$error" ng-show="routingAppForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/externalDial.html",'<md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n trunk.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.application.phone" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'phone\'].$error" ng-show="routingAppForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/goTo.html",'<md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.application.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{\n context.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'context\'].$error" ng-show="routingAppForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.application.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'extension\'].$error" ng-show="routingAppForm[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.application.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'priority\'].$error" ng-show="routingAppForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/hangup.html","<md-input-container class=\"md-block\">\n <label translate=\"VOICE.HANGUP_CAUSE\">Hangup_Cause</label>\n <md-select name=\"appdata\" ng-model=\"vm.application.appdata\" autofocus required ng-disabled=\"!vm.crudPermissions.canEdit\">\n <md-option ng-value=\"'1'\"> {{ 'VOICE.HANGUPCAUSE_1' | translate }} </md-option>\n <md-option ng-value=\"'16'\"> {{ 'VOICE.HANGUPCAUSE_16' | translate }} </md-option>\n <md-option ng-value=\"'17'\"> {{ 'VOICE.HANGUPCAUSE_17' | translate }} </md-option>\n <md-option ng-value=\"'18'\"> {{ 'VOICE.HANGUPCAUSE_18' | translate }} </md-option>\n <md-option ng-value=\"'21'\"> {{ 'VOICE.HANGUPCAUSE_21' | translate }} </md-option>\n <md-option ng-value=\"'22'\"> {{ 'VOICE.HANGUPCAUSE_22' | translate }} </md-option>\n <md-option ng-value=\"'27'\"> {{ 'VOICE.HANGUPCAUSE_27' | translate }} </md-option>\n <md-option ng-value=\"'38'\"> {{ 'VOICE.HANGUPCAUSE_38' | translate }} </md-option>\n <md-option ng-value=\"'41'\"> {{ 'VOICE.HANGUPCAUSE_41' | translate }} </md-option>\n </md-select>\n <div ng-messages=\"routingAppForm['appdata'].$error\" ng-show=\"routingAppForm['appdata'].$touched\" role=\"alert\">\n <div ng-message=\"required\">\n <span translate=\"VOICE.ERRORS.HANGUP_CAUSE_REQUIRED\">Hangup_Cause field is required</span>\n </div>\n </div>\n</md-input-container>"),e.put("app/main/apps/voice/routing/views/internalDial.html",'<md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.application.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n {{ user.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/outboundDial.html",'<md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.application.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks.rows" ng-disabled="trunk.canSelect === false">{{\n trunk.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'trunk\'].$error" ng-show="routingAppForm[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.CALLER_ID">Caller_ID</label>\n <input type="text" name="callerID" ng-model="vm.application.callerID" ng-disabled="!vm.crudPermissions.canEdit">\n <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>\n <div ng-messages="routingAppForm[\'callerID\'].$error" ng-show="routingAppForm[\'callerID\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.application.prefix" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'prefix\'].$error" ng-show="routingAppForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TAGS">Tags</label>\n <md-select name="tag" ng-model="vm.application.tag" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'--\'">None</md-option>\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{ tag.name }}\n </md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'tag\'].$error" ng-show="routingAppForm[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/playback.html",'<md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="sound" ng-model="vm.application.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/queue.html",'<md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.application.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows" ng-disabled="queue.canSelect === false">{{\n queue.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'queue\'].$error" ng-show="routingAppForm[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.application.URL" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'URL\'].$error" ng-show="routingAppForm[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.application.sound" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds.rows" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'sound\'].$error" ng-show="routingAppForm[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.application.agi" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'agi\'].$error" ng-show="routingAppForm[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.application.macro" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'macro\'].$error" ng-show="routingAppForm[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.application.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'gosub\'].$error" ng-show="routingAppForm[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.application.rule" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'rule\'].$error" ng-show="routingAppForm[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.application.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'position\'].$error" ng-show="routingAppForm[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <md-switch ng-model="vm.application.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/ringGroup.html",'<md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.application.users" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users.rows" ng-disabled="user.canSelect === false">\n {{ user.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'user\'].$error" ng-show="routingAppForm[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.application.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'timeout\'].$error" ng-show="routingAppForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or\n equal than</span> <span>0</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.application.url" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'url\'].$error" ng-show="routingAppForm[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/set.html",'<md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.application.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables.rows" ng-disabled="variable.canSelect === false">{{\n variable.name }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'variable\'].$error" ng-show="routingAppForm[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.application.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'value\'].$error" ng-show="routingAppForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/routing/views/voicemail.html",'<md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.application.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails.rows" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="routingAppForm[\'voiceMail\'].$error" ng-show="routingAppForm[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n</md-input-container>\n<md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.application.options" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="routingAppForm[\'options\'].$error" ng-show="routingAppForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n</md-input-container>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chanSpies-count">\n <span>{{vm.selectedChanSpies.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CHANSPY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chanSpies.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(chanSpy, $event )" translate="VOICE.EDIT_CHANSPY">\n Edit chanSpy\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(chanSpy, $event )" translate="VOICE.DELETE_CHANSPY">\n Delete chanSpy\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHANSPY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHANSPY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n <form name="chanSpyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n\n <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n\n <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <md-select name="options" ng-model="vm.chanSpy.options" multiple required>\n <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chanSpy.description">\n\n <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n ADD CHANSPY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contexts-count">\n <span>{{vm.selectedContexts.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- CONTEXT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contexts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(context, $event )" translate="VOICE.EDIT_CONTEXT">\n Edit Context\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(context, $event )" translate="VOICE.DELETE_CONTEXT">\n Delete Context\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTEXT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTEXT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n <form name="contextForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n\n <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.context.description">\n\n <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n ADD CONTEXT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="inbound-route-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newInboundRoute ? \'VOICE.NEW_INBOUNDROUTE\' : \'VOICE.EDIT_INBOUNDROUTE\' | translate\n }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus>\n <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundRoute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.getRouting()">\n <div ng-messages="inboundrouteForm[\'alias\'].$error" ng-show="inboundrouteForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundRoute.description">\n <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n ADD INBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-inbound-route" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-inbound-routes-button md-icon-button" aria-label="Go to inbound routes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="inbound-route-image" hide-xs>\n <img ng-src="assets/images/business/inboundroutes.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.inboundRoute.id}}\n <span ng-if="vm.inboundRoute.exten">{{vm.inboundRoute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundRoute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- /HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n \x3c!-- SETTINGS TAB --\x3e\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.inboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /SETTINGS TAB --\x3e\n \x3c!-- ACTIONS TAB --\x3e\n <md-tab md-on-select="vm.onActionsTabSelection()">\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inbound-route-detail-form-container no-padding no-margin">\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- APPLICATIONS LIST --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider class="no-margin"></md-divider>\n <md-list ng-sortable="vm.sortableAppsOptions">\n <md-list-item class="handle" ng-repeat="a in vm.apps">\n <div layout="row">\n <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n a.appType}}</p>\n </div>\n </md-list-item>\n </md-list>\n </div>\n \x3c!-- /APPLICATIONS LIST --\x3e\n <div flex></div>\n \x3c!-- ROUTING --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n </div>\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.selectedApplications.length}}\n {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n a.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n <td md-cell colspan="6">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </div>\n \x3c!-- /ROUTING --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /ACTIONS TAB --\x3e\n </md-tabs>\n </div>\n \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/inboundRoutes/inboundRoutes.html",'<div id="inbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-inbound-routes-count">\n <span>{{ vm.selectedInboundRoutes.length }}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectedInboundRoutes = vm.inboundRoutes.rows" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.selectedInboundRoutes = []" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inbound_routes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.inboundRoutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.inboundRoutes.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INBOUNDROUTE">\n Edit InboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n Delete InboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.inboundRoutes.count }}" md-on-paginate="vm.getInboundRoutes" md-page-select>\n </md-table-pagination>\n </md-card>\n </div>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-inbound-route-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inbound route" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="internal-route-dialog" aria-label="New InternalRoute">\n <form name="internalrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newInternalRoute ? \'VOICE.NEW_INTERNALROUTE\' : \'VOICE.EDIT_INTERNALROUTE\' | translate\n }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus>\n <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalRoute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.getRouting()">\n <div ng-messages="internalrouteForm[\'alias\'].$error" ng-show="internalrouteForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalRoute.description">\n <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n ADD INTERNALROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-internal-route" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-internal-routes-button md-icon-button" aria-label="Go to internal routes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="internal-route-image" hide-xs>\n <img ng-src="assets/images/business/internalroutes.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.internalRoute.id}}\n <span ng-if="vm.internalRoute.exten">{{vm.internalRoute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalRoute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInternalRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- /HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n \x3c!-- SETTINGS TAB --\x3e\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internal-route-detail-form-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.internalRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /SETTINGS TAB --\x3e\n \x3c!-- ACTIONS TAB --\x3e\n <md-tab md-on-select="vm.onActionsTabSelection()">\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internal-route-detail-form-container no-padding no-margin">\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- APPLICATIONS LIST --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider class="no-margin"></md-divider>\n <md-list ng-sortable="vm.sortableAppsOptions">\n <md-list-item class="handle" ng-repeat="a in vm.apps">\n <div layout="row">\n <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n a.appType}}</p>\n </div>\n </md-list-item>\n </md-list>\n </div>\n \x3c!-- /APPLICATIONS LIST --\x3e\n <div flex></div>\n \x3c!-- ROUTING --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n </div>\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.selectedApplications.length}}\n {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n a.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n <td md-cell colspan="6">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </div>\n \x3c!-- /ROUTING --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /ACTIONS TAB --\x3e\n </md-tabs>\n </div>\n \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalRoutes/internalRoutes.html",'<div id="internal-routes" class="page-layout simple left-sidenav inner-sidenav">\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-internal-routes-count">\n <span>{{ vm.selectedInternalRoutes.length }}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectedInternalRoutes = vm.internalRoutes.rows" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.selectedInternalRoutes = []" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internal_routes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.internalRoutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.internalRoutes.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditInternalRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_INTERNALROUTE">\n Edit InternalRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n Delete InternalRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.internalRoutes.count }}" md-on-paginate="vm.getInternalRoutes" md-page-select>\n </md-table-pagination>\n </md-card>\n </div>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-internal-route-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internal route" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n <form name="musiconholdForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n\n <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n\n <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n\n <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n ADD MUSICONHOLD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n <form name="mohSoundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FILE">File</label>\n <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n <md-option ng-value="id.id" ng-repeat="id in vm.sounds" ng-disabled="id.canSelect === false">{{ id.name }}</md-option>\n </md-select>\n <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n ADD MOHSOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="musiconhold-image" hide-xs>\n <img ng-src="assets/images/business/musiconholds.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.musiconhold.id}}\n <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMusicOnHold()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required disabled>\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n <ms-search-bar on-search="vm_dc.getMusicOnHoldMohSounds()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'VOICE.ID\' | translate }}\n </th>\n <th md-column md-order-by="audio">\n {{ \'VOICE.AUDIO\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'VOICE.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n <td md-cell>\n {{mohSound.id}}\n </td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>\n {{ mohSound.createdAt | formatdate }}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n Delete MohSound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-musiconholds-count">\n <span>{{vm.selectedMusicOnHolds.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- MUSICONHOLD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.musiconholds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(musiconhold, $event )" translate="VOICE.EDIT_MUSICONHOLD">\n Edit MusicOnHold\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(musiconhold, $event )" translate="VOICE.DELETE_MUSICONHOLD">\n Delete MusicOnHold\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MUSICONHOLD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/create/dialog.html",'<md-dialog ng-init="vm.initialize()" class="outbound-route-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.newOutboundRoute ? \'VOICE.NEW_OUTBOUNDROUTE\' : \'VOICE.EDIT_OUTBOUNDROUTE\' | translate\n }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span>({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus>\n <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundRoute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.getRouting()" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0">\n <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater\n or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.getRouting()">\n <div ng-messages="outboundrouteForm[\'alias\'].$error" ng-show="outboundrouteForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundRoute.description">\n <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n ADD OUTBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundRoutes/edit/view.html",'<div ng-init="vm.onInit()" id="voice-outbound-route" class="page-layout simple tabbed" layout="column">\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-outbound-routes-button md-icon-button" aria-label="Go to outbound routes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n <div layout="row" layout-align="start center">\n <div class="outbound-route-image" hide-xs>\n <img ng-src="assets/images/business/outboundroutes.jpg">\n </div>\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.outboundRoute.id}}\n <span ng-if="vm.outboundRoute.exten">{{vm.outboundRoute.exten}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundRoute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOutboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- /HEADER --\x3e\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n \x3c!-- SETTINGS TAB --\x3e\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outbound-route-detail-form-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundRoute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundRoute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts.rows" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundRoute.recordingFormat" ng-change="vm.onActionsTabSelection()" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundRoute.cutdigits" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid\n greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.outboundRoute.alias" ng-change="vm.onActionsTabSelection()" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'alias\'].$error" ng-show="generalForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundRoute.description" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /SETTINGS TAB --\x3e\n \x3c!-- ACTIONS TAB --\x3e\n <md-tab md-on-select="vm.onActionsTabSelection()">\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outbound-route-detail-form-container no-padding no-margin">\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- APPLICATIONS LIST --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm.crudPermissions.canEdit">\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider class="no-margin"></md-divider>\n <md-list ng-sortable="vm.sortableAppsOptions">\n <md-list-item class="handle" ng-repeat="a in vm.apps">\n <div layout="row">\n <md-icon md-font-icon="icon-apps" class="s16 mr-15"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias ||\n a.appType}}</p>\n </div>\n </md-list-item>\n </md-list>\n </div>\n \x3c!-- /APPLICATIONS LIST --\x3e\n <div flex></div>\n \x3c!-- ROUTING --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm.crudPermissions.canEdit ? 75 : 100}}">\n <div ng-if="vm.pendingChanges" class="p-10 md-amber-300-bg">\n <md-icon md-font-icon="icon-information-outline" aria-label="Save reminder"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="VOICE.HELP.SAVE_ROUTES"></span>\n </div>\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar query="vm.query" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm.selectedApplications.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.selectedApplications.length}}\n {{vm.selectedApplications.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedApplications($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedApplications">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm.sortableRoutingOptions">\n <tr md-row md-select="a" md-select-id="id" ng-repeat="a in vm.applications.rows | filter:vm.query.filter as results">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm.editApplication($event, $index)">{{a.app.toLowerCase() ===\n \'agi\' ? \'Cally-Square\' : a.app | ucfirst}}<span ng-if="a.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm.editApplication($event, $index)"><span class="text-truncate actionAppData">{{a.appdata}}</span></td>\n <td md-cell ng-click="vm.editInterval($event, $index)">{{a.IntervalId ? \'From List\' :\n a.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{a.IntervalId ? \'From List\' : (a.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editApplication($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteApplication(a, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-class="{ \'ng-cloak\': results.length > 0 }">\n <td md-cell colspan="6">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No applications\n available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </div>\n \x3c!-- /ROUTING --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n \x3c!-- /ACTIONS TAB --\x3e\n </md-tabs>\n </div>\n \x3c!-- /CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundRoutes/outboundRoutes.html",'<div id="outbound-routes" class="page-layout simple left-sidenav inner-sidenav">\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n </div>\n </div>\n <div layout="row">\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n </div>\n </div>\n <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes = []">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-outbound-routes-count">\n <span>{{ vm.selectedOutboundRoutes.length }}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectedOutboundRoutes = vm.outboundRoutes.rows" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.selectedOutboundRoutes = []" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outbound_routes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div class="main scrollable">\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.outboundRoutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="route" md-select-id="id" ng-repeat="route in vm.outboundRoutes.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="id ">{{ route.id }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="exten ">{{ route.exten }}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.editRoute(route) : vm.createOrEditOutboundRoute($event, route)" md-cell class="description ">{{ route.description }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editRoute(route)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n Edit OutboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteConfirm(route, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n Delete OutboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{ \'VOICE.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'VOICE.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'VOICE.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{ vm.outboundRoutes.count }}" md-on-paginate="vm.getOutboundRoutes" md-page-select>\n </md-table-pagination>\n </md-card>\n </div>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-outbound-route-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outbound route" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",'<md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.getAbandonedCalls()" query="vm.query" on-collapse="vm.query.filter = undefined" debounce="300">\n </ms-search-bar>\n <div flex></div>\n\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getAbandonedCalls()"></ms-quick-filter>\n\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}\n </md-tooltip>\n </md-button>\n </div>\n</md-toolbar>\n<md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.abandonedCalls.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.abandonedCalls.rows">\n <td md-cell class="id">{{call.id}}</td>\n <td md-cell class="firstName" privacy ng-cloak>{{call.calleridname}}</td>\n <td md-cell class="list" privacy ng-cloak>{{call.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[call.queue]}}</td>\n <td md-cell class="list">\n {{call.queuecallerabandonAt ? (call.queuecallerabandonAt | formatdate) : (call.queuecallerexitAt | formatdate) }}\n </td>\n <td md-cell class="list">{{call.lastAssignedTo}}</td>\n <td md-cell class="list">{{ call.disposition }}</td>\n <td md-cell class="list">{{ call.secondDisposition }}</td>\n <td md-cell class="list">{{ call.thirdDisposition }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">\n Assigned\n to</md-button>\n <md-menu-content>\n <md-menu-item ng-if="call.lastAssignedTo">\n <md-button ng-click="vm.assignTo(call)"><em translate="DASHBOARDS.NONE">Not Assigned</em>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignTo(call,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.dispose(call)" class="text-capitalize" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.abandonedCalls.count}}" md-on-paginate="vm.getAbandonedCalls" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column>{{ \'VOICE.ALIAS\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.calls.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n </td>\n <td md-cell privacy ng-cloak>\n {{call.calleridname}}, {{call.calleridnum}}\n <span class="text-boxed" ng-if="call.answered">\n <timer ng-if="call.answertime" start-time="call.answertime"></timer>\n </span>\n </td>\n <td md-cell privacy ng-cloak>{{call.exten}}</td>\n <td md-cell>{{call.routealias}}</td>\n <td md-cell>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n <timer ng-if="call.starttime" start-time="call.starttime"></timer>\n </span>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getQueues()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{\'\n VOICE.NAME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ANSWERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ABANDONED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.UNMANAGED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues.rows.length > 0">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="queue in vm.queues.rows">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n \x3c!-- <span class="font-size-20 grey-fg">{{queue.total || 0}}</span> --\x3e\n <span class="font-size-20 grey-fg">{{ (queue.answered || 0) + (queue.abandoned || 0) + (queue.unmanaged || 0) }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.abandoned || 0}} ({{(queue.total) ? (queue.abandoned || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? ((queue.sumHoldTime || 0) / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(queue.total ? ((queue.sumDuration || 0) / queue.total) : 0) | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queues.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TELEPHONES">Telephones</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getTelephones()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n <td md-cell>{{telephone.fullname}}</td>\n <td md-cell>{{telephone.internal}}</td>\n <td md-cell>\n <i ng-class="vm.stateClass[telephone.state]">\n <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n </i>\n </td>\n <td md-cell>\n <i ng-class="vm.statusClass[telephone.status]">\n <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.getTrunks()" query="vm.query" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n <form name="voicemailForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n\n <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n\n <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n\n <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n ADD VOICEMAIL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voicemail-image" hide-xs>\n <img ng-src="assets/images/business/voicemails.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voicemail.id}}\n <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoicemail()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" disabled>\n\n <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n <md-select name="context" ng-model="vm.voicemail.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEZONE">TimeZone</label>\n <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ENVELOPE">Envelope</label>\n <md-select name="envelope" ng-model="vm.voicemail.envelope" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DELETE">Delete</label>\n <md-select name="delete" ng-model="vm.voicemail.delete" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILBODY">EmailBody</label>\n <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.MESSAGES">MESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n <ms-search-bar on-search="vm_dc.getVoicemailMessages()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'VOICE.ID\' | translate }}\n </th>\n <th md-column md-order-by="callerid">\n {{ \'VOICE.CALLER_ID\' | translate }}\n </th>\n <th md-column md-order-by="duration">\n {{ \'VOICE.DURATION\' | translate }}\n </th>\n <th md-column md-order-by="audio">\n {{ \'VOICE.AUDIO\' | translate }}\n </th>\n <th md-column md-order-by="stamp">\n {{ \'VOICE.RECEIVED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n <td md-cell>\n {{message.id}}\n </td>\n <td md-cell>\n {{message.callerid}}\n </td>\n <td md-cell>\n {{message.duration}}\n </td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>\n {{ message.stamp | formatdate }}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n Delete Message\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicemails-count">\n <span>{{vm.selectedVoicemails.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICEMAIL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicemails.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n\n\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(voicemail, $event )" translate="VOICE.EDIT_VOICEMAIL">\n Edit Voicemail\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voicemail, $event )" translate="VOICE.DELETE_VOICEMAIL">\n Delete Voicemail\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEMAIL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voicePrefixes/create/dialog.html",'<md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">\n <form name="voicePrefixForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voicePrefix.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voicePrefixForm[\'name\'].$error" ng-show="voicePrefixForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="VoiceExtensionId" ng-model="vm.voicePrefix.VoiceExtensionId" required>\n <md-option ng-value="VoiceExtensionId.id" ng-repeat="VoiceExtensionId in vm.outboundRoutes" ng-disabled="VoiceExtensionId.canSelect === false">{{ VoiceExtensionId.exten }}</md-option>\n </md-select>\n <div ng-messages="voicePrefixForm[\'VoiceExtensionId\'].$error" ng-show="voicePrefixForm[\'VoiceExtensionId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLERIDALL">CallerIdAll</label>\n <input type="text" name="callerIdAll" ng-model="vm.voicePrefix.callerIdAll" ng-pattern="/"(.*)"\\s<(.*?)>$/">\n\n <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>\n <div ng-messages="voicePrefixForm[\'callerIdAll\'].$error" ng-show="voicePrefixForm[\'callerIdAll\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED">CallerIdAll field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN" translate-values="{ regex: \'/"(.*)"\\s<(.*?)>$/\' }">CallerIdAll must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voicePrefix.description">\n\n <div ng-messages="voicePrefixForm[\'description\'].$error" ng-show="voicePrefixForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix" ng-click="vm.savevoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix" ng-click="vm.addNewvoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEPREFIX" translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n ADD VOICEPREFIX\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix" ng-click="vm.deletevoicePrefix($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n <form name="voicePrefixForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEPREFIX">Add Agent to voicePrefix</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/teamadd/teamadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n <form name="voicePrefixForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",'<div id="voicePrefixes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEPREFIXES">VoicePrefixes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicePrefixes.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicePrefixes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicePrefixes-count">\n <span>{{vm.selectedVoicePrefixes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicePrefixes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicePrefixes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicePrefixes" csv-label="true" filename="voicePrefixes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicePrefixes($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICEPREFIX TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicePrefixes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicePrefixes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="VoiceExtensionId">{{ \'VOICE.OUTBOUNDROUTE\' | translate }}</th>\n <th md-column md-order-by="callerIdAll">{{ \'VOICE.CALLERIDALL\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicePrefixes.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicePrefix" md-select-id="id" ng-repeat="voicePrefix in vm.voicePrefixes.rows">\n <td md-cell ng-if="voicePrefix.userpic"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="api/users/{{voicePrefix.id}}/avatar" /></td>\n <td md-cell ng-if="!voicePrefix.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="id ">{{voicePrefix.id}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="name ">{{voicePrefix.name}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="VoiceExtensionId ">{{ (vm.outboundRoutes | filter : {\'id\':voicePrefix.VoiceExtensionId} : true)[0].exten }}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="callerIdAll ">{{voicePrefix.callerIdAll}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="description ">{{voicePrefix.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editdialog(voicePrefix, $event )" translate="VOICE.EDIT_VOICEPREFIX">\n Edit voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(voicePrefix, $event )" translate="VOICE.AGENTADD_VOICEPREFIX">\n AgentAdd voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(voicePrefix, $event )" translate="VOICE.TEAMADD_VOICEPREFIX">\n teamadd voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voicePrefix, $event )" translate="VOICE.DELETE_VOICEPREFIX">\n Delete voicePrefix\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicePrefixes.count}}" md-on-paginate="vm.getVoicePrefixes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEPREFIX TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEPREFIX BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicePrefix-button" ng-click="vm.createOrEditvoicePrefix($event)" aria-label="add voicePrefix" translate translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEPREFIX BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n <form name="voiceQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n\n <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n ADD VOICEQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" type="number" ng-model="vm.penalty" min="0" placeholder="0" required onkeypress="return event.charCode >= 48 && event.charCode <= 57 && this.value.length < 3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>{{ \'VOICE.ERRORS.PENALTY_REQUIRED\' | translate }}</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit" add-disabled="vm.penalty === undefined"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceQueue-image" hide-xs>\n <img ng-src="assets/images/business/voiceQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceQueue.id}}\n <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" value="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXLENGTH">MaxLength</label>\n <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0" value="2" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'no\'">no</md-option>\n <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'unknown\'">unknown</md-option>\n <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.joinempty.length === 1 && vm.voiceQueue.joinempty[0] === \'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'no\'">no</md-option>\n <md-option ng-value="\'yes\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'unknown\'">unknown</md-option>\n <md-option ng-value="\'wrapup\'" ng-disabled="vm.voiceQueue.leavewhenempty.length === 1 && vm.voiceQueue.leavewhenempty[0] === \'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n <md-select name="announce" ng-model="vm.voiceQueue.announce" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'FALSE\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds" ng-disabled="announce.canSelect === false">{{ announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'once\'">Once</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'limit\'">Limit</md-option>\n <md-option ng-value="\'more\'">More</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n </div>\n <form name="announcementsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Default</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds" ng-disabled="periodic_announce.canSelect === false">{{ periodic_announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds" ng-disabled="queue_reporthold.canSelect === false">{{ queue_reporthold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds" ng-disabled="queue_youarenext.canSelect === false">{{ queue_youarenext.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds" ng-disabled="queue_thereare.canSelect === false">{{ queue_thereare.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds" ng-disabled="queue_callswaiting.canSelect === false">{{ queue_callswaiting.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds" ng-disabled="queue_holdtime.canSelect === false">{{ queue_holdtime.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds" ng-disabled="queue_minutes.canSelect === false">{{ queue_minutes.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds" ng-disabled="queue_minute.canSelect === false">{{ queue_minute.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds" ng-disabled="queue_seconds.canSelect === false">{{ queue_seconds.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds" ng-disabled="queue_thankyou.canSelect === false">{{ queue_thankyou.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.voiceQueue.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.voiceQueue.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SERVICELEVEL">ServiceLevel</label>\n <input type="number" name="servicelevel" ng-model="vm.voiceQueue.servicelevel" min="0" max="100" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.SERVICELEVEL"></span></div>\n <div ng-messages="advancedForm[\'servicelevel\'].$error" ng-show="advancedForm[\'servicelevel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SERVICELEVEL_REQUIRED">ServiceLevel field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.SERVICELEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO">ServiceLevel must be a valid greater or equal than</span> <span>100</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.mandatoryDisposition" class="md-block">\n <label translate="VOICE.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.voiceQueue.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceQueues-count">\n <span>{{vm.selectedVoiceQueues.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICEQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(voiceQueue, $event )" translate="VOICE.EDIT_VOICEQUEUE">\n Edit VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(voiceQueue, $event )" translate="VOICE.TEAMADD_VOICEQUEUE">\n teamadd VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(voiceQueue, $event )" translate="VOICE.AGENTADD_VOICEQUEUE">\n agentadd VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voiceQueue, $event )" translate="VOICE.DELETE_VOICEQUEUE">\n Delete VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event )" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n goToRealtime VoiceQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n ADD VOICERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/edit/view.html",'<div id="voice-voiceRecording" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceRecordings-button md-icon-button" aria-label="Go to voiceRecordings" ng-click="vm.gotoVoiceRecordings()" translate translate-attr-aria-label="VOICE.GO_TO_VOICERECORDINGS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceRecording-image" hide-xs>\n <img ng-src="assets/images/business/voiceRecordings.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceRecording.id}}\n <span ng-if="vm.voiceRecording.name">{{vm.voiceRecording.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceRecording.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceRecording()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(voiceRecordingsForm.$invalid) || (transcriptForm.$invalid) || (sentimentAnalysisForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.GENERAL">GENERAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceRecording-detail-form-container voicerecordings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.VOICERECORDINGS">VOICERECORDINGS</div>\n </div>\n <form name="voiceRecordingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TYPE">Type</label>\n <input type="" name="type" ng-model="vm.voiceRecording.type" autofocus disabled>\n\n <div ng-messages="voiceRecordingsForm[\'type\'].$error" ng-show="voiceRecordingsForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.UNIQUEID">UniqueId</label>\n <input type="" name="uniqueid" ng-model="vm.voiceRecording.uniqueid" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'uniqueid\'].$error" ng-show="voiceRecordingsForm[\'uniqueid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.UNIQUEID_REQUIRED">UniqueId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLER">Caller</label>\n <input type="" name="calleridnum" ng-model="vm.voiceRecording.calleridnum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'calleridnum\'].$error" ng-show="voiceRecordingsForm[\'calleridnum\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_REQUIRED">Caller field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLED">Called</label>\n <input type="" name="exten" ng-model="vm.voiceRecording.exten" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'exten\'].$error" ng-show="voiceRecordingsForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLED_REQUIRED">Called field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONNECTED">Connected</label>\n <input type="" name="connectedlinenum" ng-model="vm.voiceRecording.connectedlinenum" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'connectedlinenum\'].$error" ng-show="voiceRecordingsForm[\'connectedlinenum\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONNECTED_REQUIRED">Connected field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="" name="queue" ng-model="vm.voiceRecording.queue" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'queue\'].$error" ng-show="voiceRecordingsForm[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGENT">Agent</label>\n <input type="text" name="membername" ng-model="vm.voiceRecording.membername" privacy="vm.userProfile.privacyEnabled" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'membername\'].$error" ng-show="voiceRecordingsForm[\'membername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingsForm[\'rating\'].$error" ng-show="voiceRecordingsForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DISPOSITION">Disposition</label>\n <input type="text" name="userDisposition" ng-model="vm.voiceRecording.userDisposition" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'userDisposition\'].$error" ng-show="voiceRecordingsForm[\'userDisposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECOND_LEVEL_DISPOSITION">Second_Level_Disposition</label>\n <input type="text" name="userSecondDisposition" ng-model="vm.voiceRecording.userSecondDisposition" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'userSecondDisposition\'].$error" ng-show="voiceRecordingsForm[\'userSecondDisposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECOND_LEVEL_DISPOSITION_REQUIRED">Second_Level_Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THIRD_LEVEL_DISPOSITION">Third_Level_Disposition</label>\n <input type="text" name="userThirdDisposition" ng-model="vm.voiceRecording.userThirdDisposition" disabled>\n\n <div ng-messages="voiceRecordingsForm[\'userThirdDisposition\'].$error" ng-show="voiceRecordingsForm[\'userThirdDisposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THIRD_LEVEL_DISPOSITION_REQUIRED">Third_Level_Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.license.ai">\n <md-tab-label>\n <span translate="VOICE.TRANSCRIPTANALYSIS">TRANSCRIPTANALYSIS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceRecording-detail-form-container transcript md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.TRANSCRIPT">TRANSCRIPT</div>\n </div>\n <form name="transcriptForm" novalidate>\n <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'COMPLETED\'" class="md-block">\n <label translate="VOICE.TEXT">Text</label>\n <textarea name="fileText" ng-model="vm.voiceRecording.fileText" autofocus ng-disabled="true"></textarea>\n </md-input-container>\n <md-input-container ng-if="vm.voiceRecording.transcribeStatus == \'FAILED\'" class="md-block">\n <label translate="VOICE.FAILUREREASON">FailureReason</label>\n <textarea name="failureReason" ng-model="vm.voiceRecording.failureReason" ng-disabled="true"></textarea>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceRecording-detail-form-container sentimentanalysis md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoiceRecordingSentimentStatisticsController as vm_ss" ng-init="vm_ss.init(vm.voiceRecording)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.SENTIMENTANALYSIS" style="width: 50px;">Sentiment Analysis</span>\n <div flex></div>\n </div>\n </md-toolbar>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 sentiment" ng-class="vm_ss.voiceRecording.sentiment">\n {{vm_ss.voiceRecording.sentiment}}\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sPositive || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_POSITIVE\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sNegative || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_NEGATIVE\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sNeutral || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_NEUTRAL\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 5 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">\n ({{ (vm_ss.voiceRecording.sMixed || 0) * 100 | number: 2 }}%)\n </div>\n <div class="font-weight-500 secondary-text">\n {{ \'VOICE.SENTIMENT_MIXED\' | translate | uppercase }}\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET 5 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n <ms-quick-filter filters="vm.quickFilters" query="vm.query" search="vm.getVoiceRecordings()"></ms-quick-filter>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceRecordings-count">\n <span>{{vm.selectedVoiceRecordings.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribesentimentSelectedVoiceRecordings($event)" aria-label="transcribesentiment selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBESENTIMENT_SELECTED">\n <md-icon md-font-icon="icon-text-to-speech"></md-icon>\n <md-tooltip>{{\'VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runtranscribeSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.TRANSCRIBE_SELECTED">\n <md-icon md-font-icon="icon-format-size"></md-icon>\n <md-tooltip>{{\'VOICE.RUNTRANSCRIBE_VOICERECORDING\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button" ng-if="vm.license.ai" ng-click="vm.runsentimentSelectedVoiceRecordings($event)" aria-label="transcribe selected" translate translate-attr-label="VOICERECORDINGS.SENTIMENT_SELECTED">\n <md-icon md-font-icon="icon-heart-outline"></md-icon>\n <md-tooltip>{{\'VOICE.RUNSENTIMENT_VOICERECORDING\' | translate}}</md-tooltip>\n </md-button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- VOICERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userSecondDisposition">{{ \'VOICE.SECOND_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="userThirdDisposition">{{ \'VOICE.THIRD_LEVEL_DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="transcribeStatus" ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBE\' | translate }}</th>\n <th md-column md-order-by="sentiment" ng-if="vm.license.ai">{{ \'VOICE.SENTIMENTANALYSIS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="16">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.calleridnum}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.connectedlinenum}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername " privacy="{{vm.userProfile.privacyEnabled}}" ng-cloak>{{voiceRecording.membername}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio " ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id" model="\'voiceRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userSecondDisposition ">{{voiceRecording.userSecondDisposition}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userThirdDisposition ">{{voiceRecording.userThirdDisposition}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="transcribeStatus " ng-if="vm.license.ai">{{ \'VOICE.TRANSCRIBESTATUS_\' + voiceRecording.transcribeStatus | translate}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceRecording, ev) : vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="sentiment " ng-if="vm.license.ai">{{voiceRecording.sentiment}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(voiceRecording, $event )" translate="VOICE.EDIT_VOICERECORDING">\n Edit VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n <md-button ng-click="vm.runtranscriberuntranscribesentiment(voiceRecording, $event )" translate="VOICE.RUNTRANSCRIBE_VOICERECORDING">\n RunTranscribe VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'NEW\' && vm.license.ai">\n\n <md-button ng-click="vm.runtranscribesentimentruntranscribesentiment(voiceRecording, $event )" translate="VOICE.RUNTRANSCRIBESENTIMENT_VOICERECORDING">\n RunTranscribeSentiment VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && voiceRecording.sentiment == null && vm.license.ai">\n\n <md-button ng-click="vm.runsentimentruntranscribesentiment(voiceRecording, $event )" translate="VOICE.RUNSENTIMENT_VOICERECORDING">\n RunSentiment VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="voiceRecording.transcribeStatus == \'COMPLETED\' && vm.license.ai">\n\n <md-button ng-click="vm.downloadtranscribefile2(voiceRecording, $event )" translate="VOICE.DOWNLOADTRANSCRIBE_VOICERECORDING">\n DownloadTranscribe VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.currentUser.role === \'admin\' || vm.userProfile.downloadVoiceRecordings">\n\n <md-button ng-click="vm.downloadfile2(voiceRecording, $event , \'voice/recordings\' )" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(voiceRecording, $event )" translate="VOICE.DELETE_VOICERECORDING">\n Delete VoiceRecording\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/create/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus ng-disabled="!vm.newWhatsappAccount">\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="whatsappAccountForm[\'name\'].$error" ng-show="whatsappAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">key</label>\n <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="whatsappAccountForm[\'key\'].$error" ng-show="whatsappAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LIST">List</label>\n <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n <div ng-messages="whatsappAccountForm[\'ListId\'].$error" ng-show="whatsappAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true">\n\n <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="whatsappAccountForm[\'remote\'].$error" ng-show="whatsappAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TYPE">Type</label>\n <md-select name="type" ng-model="vm.whatsappAccount.type">\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'sinch\'">Sinch</md-option>\n </md-select>\n <div ng-messages="whatsappAccountForm[\'type\'].$error" ng-show="whatsappAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true">\n\n <div ng-messages="whatsappAccountForm[\'accountSid\'].$error" ng-show="whatsappAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true">\n\n <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.BASEURL">Base URL</label>\n\n \x3c!-- <input type="text" name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" ng-required="true"> --\x3e\n\n <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required>\n <md-option ng-value="\'https://us1.whatsapp.api.sinch.com\'">US Production</md-option>\n <md-option ng-value="\'https://eu1.whatsapp.api.sinch.com\'">EU Production</md-option>\n </md-select>\n\n <div ng-messages="whatsappAccountForm[\'authToken\'].$error" ng-show="whatsappAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PHONE">phone</label>\n <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true">\n <div ng-messages="whatsappAccountForm[\'phone\'].$error" ng-show="whatsappAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappAccount.description">\n\n <div ng-messages="whatsappAccountForm[\'description\'].$error" ng-show="whatsappAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappAccount" ng-click="vm.saveWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid || whatsappAccountForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappAccount" ng-click="vm.addNewWhatsappAccount()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPACCOUNT" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n ADD WHATSAPPACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappAccount" ng-click="vm.deleteWhatsappAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/agentadd/agentadd.html",'<md-dialog class="whatsappAccount-dialog" aria-label="whatsappAccount" ng-init="vm.onInit()">\n <form name="whatsappAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">Add Agent to whatsappAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/agent/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'agent\'].$error" ng-show="whatsappAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" value="30" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/amazonlex/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'accesskeyid\'].$error" ng-show="whatsappAccountFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'secretaccesskey\'].$error" ng-show="whatsappAccountFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'lexregion\'].$error" ng-show="whatsappAccountFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'botname\'].$error" ng-show="whatsappAccountFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="2">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n <md-option ng-value="1">First Message</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'times\'].$error" ng-show="whatsappAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" required></textarea>\n\n <div ng-messages="whatsappAccountFormApp[\'text\'].$error" ng-show="whatsappAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/close/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'disposition\'].$error" ng-show="whatsappAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflow/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'key\'].$error" ng-show="whatsappAccountFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_REQUIRED">welcomemessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/dialogflowv2/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PROJECTID">ProjectID</label>\n <input type="text" name="projectId" ng-model="vm.dialogflowv2.projectId" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'projectId\'].$error" ng-show="whatsappAccountFormApp[\'projectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PROJECTID_REQUIRED">ProjectID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.CLIENTEMAIL">ClientEmail</label>\n <input type="text" name="clientEmail" ng-model="vm.dialogflowv2.clientEmail" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'clientEmail\'].$error" ng-show="whatsappAccountFormApp[\'clientEmail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.CLIENTEMAIL_REQUIRED">ClientEmail field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PRIVATEKEY">PrivateKey</label>\n <textarea name="privateKey" ng-model="vm.dialogflowv2.privateKey" required></textarea>\n\n <div ng-messages="whatsappAccountFormApp[\'privateKey\'].$error" ng-show="whatsappAccountFormApp[\'privateKey\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PRIVATEKEY_REQUIRED">PrivateKey field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflowv2.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zh-HK\'">Chinese (Cantonese)</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'en-AU\'">English (Australia)</md-option>\n <md-option ng-value="\'en-CA\'">English (Canada)</md-option>\n <md-option ng-value="\'en-GB\'">English (Great Britain)</md-option>\n <md-option ng-value="\'en-IN\'">English (India)</md-option>\n <md-option ng-value="\'en-US\'">English (US)</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'fr-CA\'">French (Canada)</md-option>\n <md-option ng-value="\'fr-FR\'">\'France (France)</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'hi\'">Hindi</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pl\'">Polish</md-option>\n <md-option ng-value="\'pt-BR\'">Portuguese (Brazil)</md-option>\n <md-option ng-value="\'pt-PT\'">Portuguese (Portugal)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'es-419\'">Spanish (Latin America)</md-option>\n <md-option ng-value="\'es-ES\'">Spanish (Spain)</md-option>\n <md-option ng-value="\'sw\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'tr\'">Turkish</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'language\'].$error" ng-show="whatsappAccountFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflowv2.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="WHATSAPP.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="whatsappAccountFormApp[\'welcomemessage\'].$error" ng-show="whatsappAccountFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'condition\'].$error" ng-show="whatsappAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'truepriority\'].$error" ng-show="whatsappAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'falsepriority\'].$error" ng-show="whatsappAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'priority\'].$error" ng-show="whatsappAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/interval/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/noop/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'value\'].$error" ng-show="whatsappAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/queue/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'queue\'].$error" ng-show="whatsappAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'timeout\'].$error" ng-show="whatsappAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/system/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="whatsappAccountFormApp[\'command\'].$error" ng-show="whatsappAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'variable\'].$error" ng-show="whatsappAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/apps/tag/dialog.html",'<md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">\n <form name="whatsappAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="whatsappAccountFormApp[\'tag\'].$error" ng-show="whatsappAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveWhatsappAccountApp()" class="send-button md-accent md-raised" ng-disabled="whatsappAccountFormApp.$invalid || whatsappAccountFormApp.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/view.html",'<div id="whatsapp-whatsappAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-whatsappAccounts-button md-icon-button" aria-label="Go to whatsappAccounts" ng-click="vm.gotoWhatsappAccounts()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="whatsappAccount-image" hide-xs>\n <img ng-src="assets/images/business/whatsappAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.whatsappAccount.id}}\n <span ng-if="vm.whatsappAccount.name">{{vm.whatsappAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.whatsappAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveWhatsappAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (whatsappDispositionsForm.$invalid) || (whatsappCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappAccount.name" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">key</label>\n <input type="text" name="key" ng-model="vm.whatsappAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.LIST">List</label>\n <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.whatsappAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.whatsappAccount.type == \'twilio\' || vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.whatsappAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n <md-input-container ng-if="vm.whatsappAccount.type == \'sinch\'" class="md-block">\n <label translate="WHATSAPP.BASEURL">BaseURL</label>\n\n <md-select name="baseUrl" ng-model="vm.whatsappAccount.baseUrl" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryBaseUrl.url" ng-repeat="mandatoryBaseUrl in vm.baseUrl" ng-disabled="mandatoryBaseUrl.canSelect === false">{{ mandatoryBaseUrl.name }}</md-option>\n </md-select>\n\n <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.BASEURL_REQUIRED">Base URL field is required</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n <md-input-container class="md-block">\n <label translate="WHATSAPP.PHONE">phone</label>\n <input type="text" name="phone" ng-model="vm.whatsappAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED">phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.RECEIVEURL">receiveUrl</label>\n\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text });" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.whatsappAccount.remote + \'/api/whatsapp/accounts/\' + vm.whatsappAccount.id + \'/notify?token=\' + vm.whatsappAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="WHATSAPP.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.whatsappAccount.waitForTheAssignedAgent" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.WAIT_FOR_THE_ASSIGNED_QUEUE">Wait For The Assigned Queue</label>\n <input type="number" name="waitForTheAssignedQueue" ng-model="vm.whatsappAccount.waitForTheAssignedQueue" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedQueue\'].$error" ng-show="generalForm[\'waitForTheAssignedQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Wait For The Assigned Queue field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLBAR.ERRORS.FIELD_MUST_BE_LESS_THAN_OR_EQUAL_TO">Wait For The Assigned Queue must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n\n\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="whatsappAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="WHATSAPP.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, fontSize_sizes: \'8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt\', removePlugins: \'magicline\' }" ng-model="vm.whatsappAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="whatsappAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.queueTransfer == true" class="md-block">\n <label translate="WHATSAPP.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.whatsappAccount.queueTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.agentTransfer == true" class="md-block">\n <label translate="WHATSAPP.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.whatsappAccount.agentTransferTimeout" min="1" max="2147483" value="300" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.whatsappAccount.remote" md-maxlength="255" value="LOCALIP" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="WHATSAPP.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.whatsappAccount.token" disabled>\n\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="whatsappAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.whatsappAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="WHATSAPP.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.whatsappAccount.mandatoryDisposition" class="md-block">\n <label translate="WHATSAPP.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.whatsappAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="WHATSAPP.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-controller="WhatsappAccountDispositionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions)">\n <div layout="row">\n <div class="column" flex="20">\n <md-card class="mt-0">\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm_dc.query.level = null; vm_dc.getDispositions()">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <span class="ph-5">{{ \'TOOLS.ALL_DISPOSITIONS\' | translate }}</span>\n </div>\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="TOOLS.SELECT_LEVEL">Select a level</label>\n <md-select placeholder="{{ \'TOOLS.SELECT_LEVEL\' | translate }}" ng-model="vm_dc.query.level" ng-change="vm_dc.getDispositions()">\n <md-option ng-value="null"><em translate="TOOLS.ALL">All</em></md-option>\n <md-option ng-value="key" ng-repeat="(key, value) in vm_dc.levels">{{ value }}</md-option>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n <div class="whatsappAccount-detail-form-container whatsappdispositions md-background-bg md-whiteframe-1dp" flex="80">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="WHATSAPP.DISPOSITIONS">Dispositions</span>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300" direction="down"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditDisposition($event)" aria-label="Add whatsapp dispositions" translate translate-attr-label="WHATSAPP.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedDispositions.length}}\n {{vm_dc.selectedDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedDispositions" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n <th md-column md-order-by="level">{{ \'TOOLS.LEVEL\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_dc.dispositions.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm_dc.dispositions.rows">\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}\n </td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="level ">\n {{ vm_dc.levels[disposition.level] }}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="name ">\n {{disposition.name}}</td>\n <td ng-click="vm_dc.createOrEditDisposition($event, disposition)" md-cell class="description ">\n {{disposition.description}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditDisposition($event, disposition)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n \x3c!-- SUBACTIONS --\x3e\n \x3c!-- ACTIONS --\x3e\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.dispositions.count}}" md-on-paginate="vm_dc.getDispositions" md-page-select>\n </md-table-pagination>\n </div>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container whatsappcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="WhatsappAccountWhatsappCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="WHATSAPP.WHATSAPPCANNEDANSWERS">WhatsappCannedAnswers</span>\n <ms-search-bar on-search="vm_dc.getWhatsappAccountWhatsappCannedAnswers()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event)" aria-label="add whatsappCannedAnswer" translate translate-attr-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length}} {{vm_dc.selectedWhatsappAccountWhatsappCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountWhatsappCannedAnswers" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountWhatsappCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountWhatsappCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountWhatsappCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'WHATSAPP.ID\' | translate }}\n </th>\n <th md-column md-order-by="key">\n {{ \'WHATSAPP.KEY\' | translate }}\n </th>\n <th md-column md-order-by="value">\n {{ \'WHATSAPP.VALUE\' | translate }}\n </th>\n <th md-column md-order-by="description">\n {{ \'WHATSAPP.DESCRIPTION\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'WHATSAPP.CREATED_AT\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="whatsappCannedAnswer" md-select-id="id" ng-repeat="whatsappCannedAnswer in vm_dc.whatsappAccountWhatsappCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.id}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.key}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.value}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{whatsappCannedAnswer.description}}\n </td>\n <td ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" md-cell>\n {{ whatsappCannedAnswer.createdAt | formatdate }}\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditWhatsappAccountWhatsappCannedAnswer($event, whatsappCannedAnswer)" translate="WHATSAPP.EDIT_WHATSAPPCANNEDANSWER">\n Edit WhatsappCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(whatsappCannedAnswer, $event)" translate="WHATSAPP.DELETE_WHATSAPPCANNEDANSWER">\n Delete WhatsappCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.whatsappAccountWhatsappCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="WHATSAPP.NO_WHATSAPPCANNEDANSWER_AVAILABLE">No whatsappcannedanswer available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountWhatsappCannedAnswers.count}}" md-on-paginate="vm_dc.getWhatsappAccountWhatsappCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="WhatsappAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.whatsappAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="WHATSAPP.{{(a.appAlias || a.appType) | uppercase}}">{{a.appAlias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedWhatsappAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedWhatsappAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedWhatsappAccountApps.length}} {{vm_ac.selectedWhatsappAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedWhatsappAccountApps($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedWhatsappAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.whatsappAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editWhatsappAccountApp($event, $index)"><span class="text-truncate actionAppData">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editWhatsappAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.whatsappAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-light" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="WhatsappAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.whatsappAccount, vm.crudPermissions, vm.userProfile)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedWhatsappAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="WHATSAPP.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm_dc.getWhatsappAccountInteractions()" query="vm_dc.query" display-on="vm_dc.isSearchBarVisible" ng-disabled="vm_dc.query.search" debounce="300" direction="down" min-chars="5"></ms-search-bar>\n <div flex></div>\n <ms-quick-filter filters="vm_dc.quickFilters" query="vm_dc.query" search="vm_dc.getWhatsappAccountInteractions()"></ms-quick-filter>\n <div layout="column">\n <md-button class="md-icon-button advanced-search" ng-class="{ \'md-fab md-mini md-accent-bg\': vm_dc.query.search }" aria-label="Filter" translate translate-attr-aria-label="DASHBOARDS.FILTER" ng-click="vm_dc.openAdvancedSearch()">\n <md-icon md-font-icon="{{ vm_dc.query.search ? \'icon-filter\' : \'icon-filter-outline\' }}" ng-class="{ \'blink\': vm_dc.query.search }"></md-icon>\n </md-button>\n </div>\n <md-button class="md-icon-button" ng-click="vm_dc.getWhatsappAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="WHATSAPP.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedWhatsappAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedWhatsappAccountInteractions.length}} {{vm_dc.selectedWhatsappAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedWhatsappAccountInteractions" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedWhatsappAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="font-size-12">\n <table md-table md-row-select multiple ng-model="vm_dc.selectedWhatsappAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getWhatsappAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">\n {{ \'WHATSAPP.ID\' | translate }}\n </th>\n <th md-column class="no-padding">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column class="no-padding">\n </th>\n <th md-column md-order-by="contactName">\n {{ \'WHATSAPP.CONTACT\' | translate }}\n </th>\n <th md-column md-order-by="createdAt">\n {{ \'WHATSAPP.STARTEDAT\' | translate }}\n </th>\n <th md-column md-order-by="lastMsgAt">\n {{ \'WHATSAPP.LASTMESSAGE\' | translate }}\n </th>\n <th md-column md-order-by="closed">\n {{ \'WHATSAPP.STATUS\' | translate }}\n </th>\n <th md-column>\n {{ \'WHATSAPP.AGENT\' | translate }}\n </th>\n <th md-column md-order-by="tag">\n {{ \'WHATSAPP.TAGS\' | translate }}\n </th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.whatsappAccountInteractions.rows" ng-class="{\'text-bold text-italic\': interaction.unreadMessages > 0}">\n <td md-cell>\n {{interaction.id}}\n </td>\n <td md-cell class="no-padding">\n <div ng-if="!interaction.closed && interaction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="user in interaction.Users">{{ user.fullname | translate }}\n <span ng-if="!$last">, </span>\n </span>\n </md-tooltip>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.unreadMessages > 0" layout="row" layout-align="start center">\n <span class="badge white-fg md-primary-bg" layout-margin>{{ interaction.unreadMessages}}</span>\n </div>\n </td>\n <td md-cell class="no-padding">\n <div ng-if="interaction.attach">\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n </td>\n <td md-cell privacy ng-cloak>\n <div layout="column" layout-align="start start">\n <span class="font-size-12 text-truncate contact-text" ng-class="{\'margin-bottom-0\' : interaction.contactInfo}" layout-margin>{{ interaction.contactName }}</span>\n <span ng-if="interaction.contactInfo" class="font-size-12 text-truncate contact-text margin-top-0" layout-margin>{{ interaction.contactInfo }}</span>\n </div>\n </td>\n <td md-cell>\n {{ interaction.createdAt | formatdate }}\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="{{interaction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="text-truncate">{{ interaction.lastMsgAt | formatdate }}</span>\n </div>\n </div>\n </td>\n <td md-cell>\n <span ng-if="interaction.closed === 0" class="green-fg">\n {{ \'WHATSAPP.OPENED\' | translate }}\n <span ng-if="interaction.substatus">\n - {{ interaction.substatus }}\n </span>\n </span>\n <span ng-if="interaction.closed === 1" class="red-fg">\n {{ \'WHATSAPP.CLOSED\' | translate }}\n <span ng-if="interaction.disposition">\n - {{ interaction.thirdDisposition || interaction.secondDisposition || interaction.disposition }}\n </span>\n <md-tooltip class="multiline">\n <div layout="column">\n <div layout="column">\n <span>{{ \'DASHBOARDS.CLOSED_AT\' | translate}}:</span>\n <span class="text-bold">{{ interaction.closedAt | formatdate }}</span>\n </div>\n <div ng-if="interaction.disposition" layout="column">\n <span>{{ \'DASHBOARDS.DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.disposition }}</span>\n </div>\n <div ng-if="interaction.secondDisposition" layout="column">\n <span>{{ \'DASHBOARDS.SECOND_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.secondDisposition }}</span>\n </div>\n <div ng-if="interaction.thirdDisposition" layout="column">\n <span>{{ \'DASHBOARDS.THIRD_LEVEL_DISPOSITION\' | translate}}:</span>\n <span class="text-bold">{{ interaction.thirdDisposition }}</span>\n </div>\n </div>\n </md-tooltip>\n </span>\n </td>\n\n <td md-cell>\n {{interaction.Owner.name}}\n </td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': interaction.Tags.length == 1 && interaction.Tags[0].color }">\n </md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spywhatsappInteraction($event, interaction)" translate="WHATSAPP.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.currentUser.role === \'admin\' || vm_dc.userProfile.downloadOmnichannelInteractions">\n <md-button class="md-primary" ng-click="vm_dc.whatsappInteractionDownload(interaction, $event)" translate="WHATSAPP.DOWNLOAD_INTERACTION">\n Download\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="WHATSAPP.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.whatsappAccountInteractions.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span class="text-boxed-light" translate="WHATSAPP.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.whatsappAccountInteractions.count}}" md-on-paginate="vm_dc.getWhatsappAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/edit/whatsappCannedAnswers/dialog.html",'<md-dialog class="whatsappCannedAnswer-dialog" aria-label="New WhatsappCannedAnswer">\n <form name="whatsappCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.KEY">Key</label>\n <input type="" name="key" ng-model="vm.whatsappCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="whatsappCannedAnswerForm[\'key\'].$error" ng-show="whatsappCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.VALUE">Value</label>\n <textarea name="value" ng-model="vm.whatsappCannedAnswer.value" required></textarea>\n\n <div ng-messages="whatsappCannedAnswerForm[\'value\'].$error" ng-show="whatsappCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappCannedAnswer.description">\n\n <div ng-messages="whatsappCannedAnswerForm[\'description\'].$error" ng-show="whatsappCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappCannedAnswer" ng-click="vm.saveWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid || whatsappCannedAnswerForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappCannedAnswer" ng-click="vm.addNewWhatsappCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="whatsappCannedAnswerForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPCANNEDANSWER" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPCANNEDANSWER">\n ADD WHATSAPPCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappCannedAnswer" ng-click="vm.deleteWhatsappCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappAccounts/whatsappAccounts.html",'<div id="whatsappAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="WHATSAPP.WHATSAPPACCOUNTS">WhatsappAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedWhatsappAccounts.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedWhatsappAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="WHATSAPP.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-whatsappAccounts-count">\n <span>{{vm.selectedWhatsappAccounts.length}}</span>\n <span translate="WHATSAPP.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllWhatsappAccounts()" translate="WHATSAPP.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectWhatsappAccounts()" translate="WHATSAPP.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappAccounts" csv-label="true" filename="whatsappAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappAccounts($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- WHATSAPPACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedWhatsappAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'WHATSAPP.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'WHATSAPP.LIST\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'WHATSAPP.TYPE\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'WHATSAPP.PHONE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'WHATSAPP.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.whatsappAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="whatsappAccount" md-select-id="id" ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">\n <td md-cell ng-if="whatsappAccount.userpic"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="api/users/{{whatsappAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!whatsappAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="id ">{{whatsappAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="name ">{{whatsappAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="key ">{{whatsappAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':whatsappAccount.ListId} : true)[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="type ">{{ vm.arraytype[whatsappAccount.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="phone ">{{whatsappAccount.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)" md-cell class="description ">{{whatsappAccount.description}}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(whatsappAccount, $event )" translate="WHATSAPP.EDIT_WHATSAPPACCOUNT">\n Edit WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.interactionsgoto(whatsappAccount, $event )" translate="WHATSAPP.INTERACTIONS_WHATSAPPACCOUNT">\n Interactions WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(whatsappAccount, $event )" translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">\n AgentAdd WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(whatsappAccount, $event )" translate="WHATSAPP.DELETE_WHATSAPPACCOUNT">\n Delete WhatsappAccount\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappAccounts.count}}" md-on-paginate="vm.getWhatsappAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / WHATSAPPACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD WHATSAPPACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappAccount-button" ng-click="vm.createOrEditWhatsappAccount($event)" aria-label="add whatsappAccount" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD WHATSAPPACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/create/dialog.html",'<md-dialog class="whatsappQueue-dialog" aria-label="New WhatsappQueue">\n <form name="whatsappQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newWhatsappQueue">\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="whatsappQueueForm[\'name\'].$error" ng-show="whatsappQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="whatsappQueueForm[\'strategy\'].$error" ng-show="whatsappQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true">\n\n <div ng-messages="whatsappQueueForm[\'timeout\'].$error" ng-show="whatsappQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappQueue.description">\n\n <div ng-messages="whatsappQueueForm[\'description\'].$error" ng-show="whatsappQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappQueue" ng-click="vm.saveWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid || whatsappQueueForm.$pristine" aria-label="SAVE" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newWhatsappQueue" ng-click="vm.addNewWhatsappQueue()" class="send-button md-accent md-raised" ng-disabled="whatsappQueueForm.$invalid" aria-label="ADD" translate="WHATSAPP.ADD_WHATSAPPQUEUE" translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n ADD WHATSAPPQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappQueue" ng-click="vm.deleteWhatsappQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="WHATSAPP.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/agentadd/agentadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n <form name="whatsappQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">Add Agent to whatsappQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/teamadd/teamadd.html",'<md-dialog class="whatsappQueue-dialog" aria-label="whatsappQueue" ng-init="vm.onInit()">\n <form name="whatsappQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="WHATSAPP.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" read-only="!vm.crudPermissions.canEdit"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/edit/view.html",'<div id="whatsapp-whatsappQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-whatsappQueues-button md-icon-button" aria-label="Go to whatsappQueues" ng-click="vm.gotoWhatsappQueues()" translate translate-attr-aria-label="WHATSAPP.GO_TO_WHATSAPPQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="whatsappQueue-image" hide-xs>\n <img ng-src="assets/images/business/whatsappQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.whatsappQueue.id}}\n <span ng-if="vm.whatsappQueue.name">{{vm.whatsappQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="WHATSAPP.CREATED_AT"></span> <span>{{vm.whatsappQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.whatsappQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.whatsappQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveWhatsappQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="WHATSAPP.SAVE" translate-attr-aria-label="WHATSAPP.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="WHATSAPP.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="whatsappQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="WHATSAPP.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.whatsappQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="WHATSAPP.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.whatsappQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.whatsappQueue.timeout" min="1" max="2147483" value="10" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="WHATSAPP.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="WHATSAPP.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.whatsappQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/whatsapp/views/whatsappQueues/whatsappQueues.html",'<div id="whatsappQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="WHATSAPP.WHATSAPPQUEUES">WhatsappQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="WHATSAPP.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedWhatsappQueues.length > 0" class="selected-bar header md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedWhatsappQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="WHATSAPP.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-whatsappQueues-count">\n <span>{{vm.selectedWhatsappQueues.length}}</span>\n <span translate="WHATSAPP.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllWhatsappQueues()" translate="WHATSAPP.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectWhatsappQueues()" translate="WHATSAPP.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappQueues" csv-label="true" filename="whatsappQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedWhatsappQueues($event)" aria-label="delete selected" translate translate-attr-label="WHATSAPP.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable">\n\n\n \x3c!-- WHATSAPPQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedWhatsappQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'WHATSAPP.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'WHATSAPP.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'WHATSAPP.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.whatsappQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="WHATSAPP.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="whatsappQueue" md-select-id="id" ng-repeat="whatsappQueue in vm.whatsappQueues.rows">\n <td md-cell ng-if="whatsappQueue.userpic"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="api/users/{{whatsappQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!whatsappQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{whatsappQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="id ">{{whatsappQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="name ">{{whatsappQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)" md-cell class="strategy ">{{ vm.arraystrategy[whatsappQueue.strategy].option }}</td>\n\n\n <td md-cell class="actions">\n\n <md-menu>\n\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="WHATSAPP.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n\n <md-button ng-click="vm.editstate(whatsappQueue, $event )" translate="WHATSAPP.EDIT_WHATSAPPQUEUE">\n Edit WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.teamadddialog(whatsappQueue, $event )" translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE">\n teamadd WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.agentadddialog(whatsappQueue, $event )" translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">\n agentadd WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n\n <md-button ng-click="vm.deleteconfirm(whatsappQueue, $event )" translate="WHATSAPP.DELETE_WHATSAPPQUEUE">\n Delete WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n \x3c!-- SUBACTIONS --\x3e\n\n\n \x3c!-- ACTIONS --\x3e\n\n <md-menu-item>\n\n <md-button ng-click="vm.gotorealtimegoto(whatsappQueue, $event )" translate="WHATSAPP.GOTOREALTIME_WHATSAPPQUEUE">\n goToRealtime WhatsappQueue\n </md-button>\n\n </md-menu-item>\n\n\n\n </md-menu-content>\n\n </md-menu>\n </td>\n\n\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'WHATSAPP.PAGE\' | translate}}:\', rowsPerPage: \'{{\'WHATSAPP.ROWSPERPAGE\' | translate}}:\', of: \'{{\'WHATSAPP.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.whatsappQueues.count}}" md-on-paginate="vm.getWhatsappQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / WHATSAPPQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD WHATSAPPQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-whatsappQueue-button" ng-click="vm.createOrEditWhatsappQueue($event)" aria-label="add whatsappQueue" translate translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD WHATSAPPQUEUE BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n </div>\n <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n <md-tab>\n <md-tab-label>\n <span translate="QUICKPANEL.TODAY">TODAY</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="today-tab scrollable" ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n <span>MESSENGER</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="chat-tab scrollable" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="group-tab scrollable" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.FRIENDS">Friends</span>\n </md-subheader>\n\n <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n <div class="status {{friend.status}}"></div>\n\n <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n <div class="md-list-item-text">\n <h3 class="message">{{friend.message}}</h3>\n <p class="time">{{friend.time}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n </md-subheader>\n\n <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n <div class="md-list-item-text">\n <h3>{{server.location}}</h3>\n <p>{{server.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n </md-subheader>\n\n <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n <div class="md-list-item-text">\n <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main" ng-hide="vm_ct.user && vm_ct.isMessengerAllowed">\n <audio id="beep-player" hidden src="/assets/ms-phonebar/sounds/beep.ogg"></audio>\n <md-subheader class="md-no-sticky">\n <div class="search" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input class="search-input" ng-model="vm_ct.search.$" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin" aria-label="Chat Tab Search">\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL">All</md-option>\n <md-option ng-value="true">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg" translate="CHAT.ONLINE"></md-icon>Online\n </md-option>\n <md-option ng-value="false">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg" translate="CHAT.OFFLINE"></md-icon>Offline\n </md-option>\n </md-select>\n </div>\n </md-subheader>\n <md-divider></md-divider>\n <md-list class="recent">\n <md-list-item class="contact md-3-line" ng-if="user.id !== vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter: vm_ct.search" ng-click="vm_ct.openChat(user)">\n <md-divider></md-divider>\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : vm_ct.defaultAvatar}}" class="md-avatar" alt="{{user.fullname}}" />\n <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n <div ng-if="vm_ct.unreadMessages[user.id]" class="md-accent-bg unread-message-count">\n {{vm_ct.unreadMessages[user.id]}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{user.fullname}}</h3>\n <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper">\n </md-icon>\n </div>\n <p>{{user.name}} <{{user.internal}}></p>\n <div layout="row" layout-align="start center">\n <md-icon ng-if="user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" ng-class="{\'md-accent\': user.lastMessage.read}" md-font-icon="{{ user.lastMessage.read ? \'icon-check-all\' : \'icon-check\' }}"></md-icon>\n <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n <span flex></span>\n <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">\n {{user.lastMessageAt | formatdate}}</p>\n </div>\n </md-list-item>\n</div>\n</md-list>\n</div>\n\n<div class="chat" ng-show="vm_ct.user && vm_ct.isMessengerAllowed" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_ct.closeChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span>{{vm_ct.user.fullname}}</span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-dialog">\n <div ng-if="vm_ct.isLoading" layout="row" layout-align="center center">\n <md-progress-circular class="md-accent" md-diameter="48" md-mode="indeterminate"></md-progress-circular>\n </div>\n <div ms-timeline="vm_ct.timelineOptions" ms-timeline-load-more="vm_ct.loadMoreMessages()">\n <div layout="row" ng-repeat="message in vm_ct.user.messages" class="ms-timeline-item md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{ vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : vm_ct.defaultAvatar }}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n <img ng-if="message.FromId === vm_ct.currentUser.id" ng-src="{{ vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : vm_ct.defaultAvatar }}" class="avatar">\n <div class="bubble timeline-card" flex>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text">{{ message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_ct.currentUser.id" class="s16 margin-5" ng-class="{\'md-accent\': message.read}" md-font-icon="{{ message.read ? \'icon-check-all\' : \'icon-check\' }}"></md-icon>\n </div>\n </div>\n </div>\n\n <div ng-if="vm_ct.hasMoreMessages" layout="row" layout-align="center center" class="ng-scope layout-align-center-center layout-row">\n <md-button class="md-raised md-accent md-button ng-scope md-default-theme md-ink-ripple" type="button" ng-click="vm_ct.loadMoreMessages()" translate="DASHBOARDS.MORE">\n </md-button>\n </div>\n <div ng-if="!vm_ct.hasMoreMessages && vm_ct.user.messages.length > 20" layout="row" layout-align="end center" class="ng-scope layout-align-center-center layout-row">\n <md-button class="md-fab md-mini" type="button" ng-click="vm_ct.scrollToTopOfChat(0)">\n <md-icon md-font-icon="icon-arrow-up-bold"></md-icon>\n </md-button>\n </div>\n </div>\n </md-content>\n\n <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n \x3c!--START Error--\x3e\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n \x3c!--END Error--\x3e\n\n \x3c!--START NAME--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END NAME--\x3e\n\n \x3c!--START Members--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.MEMBERS">Members</label>\n <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n </md-contact-chips>\n <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END Members--\x3e\n\n \x3c!--START Writing--\x3e\n <md-input-container class="md-block">\n <md-switch ng-model="vm.group.write" aria-label="Write">\n {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n </md-switch>\n </md-input-container>\n \x3c!--END Writing--\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE" translate-attr-aria-label="QUICKPANEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main" ng-if="!vm_cg.group">\n <md-subheader>\n <div layout="row">\n \x3c!-- START Search --\x3e\n <div class="search" layout="row" layout-align="start center" flex>\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n </div>\n \x3c!-- END Search --\x3e\n\n \x3c!-- START New Group --\x3e\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n </md-button>\n \x3c!-- END New Group --\x3e\n </div>\n </md-subheader>\n\n <md-divider></md-divider>\n\n \x3c!-- START Groups --\x3e\n <md-list class="recent no-padding">\n \x3c!-- START Group --\x3e\n <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{group.name}}</h3>\n </div>\n </div>\n\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n </md-button>\n\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item>\n <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n </div>\n </md-list-item>\n \x3c!-- END Group --\x3e\n </md-list>\n \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat" ng-if="vm_cg.group" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools " layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK" flex="15">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4 flex layout-align="start center" style="max-height: 100%; overflow-y:auto;">\n <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n </h4>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_cg.webcall(vm_cg.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings id="chat-group-dialog">\n <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <div ng-if="message.FromId !== vm_cg.currentUser.id">\n <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n </div>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n <div layout="row">\n <div layout="row" layout-align="start center">\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n <span>{{user.fullname}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n </div>\n </div>\n <div>\n <md-divider ng-if="!$last"></md-divider>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n <md-list-item class="md-display-1 md-2-line">\n <div class="secondary-text">\n <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n <div layout="row" layout-align="start start">\n <span> {{vm.date | date:\'d\'}}</span>\n <span class="md-subhead">th</span>\n <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n </div>\n </div>\n </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{event.title}}</h3>\n\n <p>{{event.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{note.title}}</h3>\n\n <p>{{note.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()">\n <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n <div id="reset-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n <form name="resetPasswordForm" novalidate>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n <div ng-messages="resetPasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n RESET MY PASSWORD\n </md-button>\n </form>\n </div>\n </div>\n</div>'),e.put("app/toolbar/autoanswers/dialog.html",'<md-dialog class="autoanswers-dialog" aria-label="autoanswers">\n <form name="autoanswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ (\'TOOLBAR.AUTOANSWER_NOTIFICATIONS\' | translate) }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content layout-padding>\n <md-table-container>\n <table md-table multiple>\n <thead md-head>\n <tr md-row>\n <th></th>\n <th md-column>{{ \'TOOLBAR.CHANNEL\' | translate }}</th>\n <th md-column>{{ \'TOOLBAR.NOTIFICATIONS\' | translate }}</th>\n <th md-column>{{ \'TOOLBAR.DELAY\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="item in vm.items" ng-if="item.permission">\n <td>\n <md-icon md-font-icon="{{item.font_icon}}" class="icon {{item.class}} {{item.font_icon}}" aria-label="{{item.label}}"></md-icon>\n </td>\n <td md-cell>\n <div layout="row">\n <span translate="{{item.title}}"></span>\n </div>\n </td>\n <td md-cell align="center">\n <div layout="row" layout-align="center">\n <md-icon ng-if="item.enabled" md-font-icon="icon-check-circle" class="icon green-700-fg"></md-icon>\n <span ng-if="!item.enabled" style="color:red">X</span>\n </div>\n </td>\n <td md-cell align="right">\n <div layout="row" layout-align="end">\n <span ng-if="item.enabled">{{item.delay}}</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-dialog-content>\n\n <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="changePasswordForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n <div ng-messages="changePasswordForm.oldPassword.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n <div ng-message="oldPasswordMatch">\n <span translate="TOOLBAR.ERRORS.PASSWORD_OLDPASSWORD_MATCH">New password must be different from old one</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n <div layout="row" layout-align="start center" flex>\n <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n </md-button>\n\n <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n <div class="toolbar-separator"></div>\n\n <div ng-if="vm.license.demo" class="blink md-padding">\n <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n </div>\n\n <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() |\n uppercase }}</span>\n </div>\n\n \x3c!-- phonebar directive WebRtc type--\x3e\n <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" sessions="vm.webRTCSessions" registered="vm.isWebRTCBarRegistered" flex></ms-phonebar>\n \x3c!-- phonebar directive --\x3e\n </div>\n\n <div layout="row" layout-align="start center">\n\n <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32">\n </md-progress-circular>\n\n \x3c!-- Pause Management --\x3e\n <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n <div class="toolbar-separator"></div>\n\n <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n </md-button>\n\n <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n </md-button>\n\n <md-menu>\n <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="4">\n <md-menu-item ng-if="!vm.pauses.length">\n <md-button disabled="disabled">\n <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="pause in vm.pauses">\n <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n {{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n \x3c!-- Pause Management --\x3e\n\n <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n <div layout="row" layout-align="space-between center">\n <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt"></timer>\n <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n </div>\n <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n <timer start-time="vm.user.lastPauseAt"></timer>\n <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n </div>\n <div ng-if="vm.user.voicePause">\n <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n </div>\n </div>\n\n <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n <md-menu-bar id="user-menu">\n <md-menu md-position-mode="left bottom">\n <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n <div layout="row" layout-align="space-between center">\n <div class="avatar-wrapper">\n <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n </div>\n <div layout="column" layout-align="center center" class="padding-horizontal-5">\n <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n <span class="font-size-12 md-subhead">{{vm.user.name}} <{{vm.user.internal}}></span>\n </div>\n\n <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n </div>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n </md-menu-item>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change\n Password</span></md-button>\n </md-menu-item>\n\n <md-menu-divider></md-menu-divider>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n <md-button ng-click="vm.logout()">Logout</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-bar>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.user.role === \'agent\' && (vm.license.chat || vm.license.mail || vm.license.messaging || vm.license.openchannel || vm.license.fax || vm.license.whatsapp)" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.autoAnswerNotificationsDialog($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <md-icon md-font-icon="icon-reply" class="icon {{ vm.autoanswerIconColor }}"></md-icon>\n <md-tooltip><span translate="TOOLBAR.AUTOANSWER_NOTIFICATIONS">Notifications</span></md-tooltip>\n </md-button>\n\n <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.contacts" class="md-accent-bg open-contact-count badge-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n </md-button>\n \n \x3c!-- \n ADD V3\n \n <md-button ng-if="vm.user.role === \'agent\' && vm.license.voice && vm.user.permissions.includes(110)" class="preview-button no-margin" ng-disabled="vm.disable" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.waitingQueueCalls.length > 0" class="md-accent-bg queues-call-count badge-count">{{vm.waitingQueueCalls.length}}</div>\n <md-icon md-font-icon="icon-phone-incoming blue-fg" class="icon"></md-icon>\n <md-tooltip><span translate="TOOLBAR.WAITINGQUEUECALLS">Waiting Queues Calls</span></md-tooltip>\n </md-button> --\x3e\n\n \x3c!-- \n ADD V3\n \n <md-button ng-if="vm.user.role === \'agent\' && vm.license.voice && vm.user.permissions.includes(110)" class="preview-button no-margin" ng-disabled="vm.disable" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.waitingQueueCalls.length > 0" class="md-accent-bg queues-call-count badge-count">{{vm.waitingQueueCalls.length}}</div>\n <md-icon md-font-icon="icon-phone-incoming blue-fg" class="icon"></md-icon>\n <md-tooltip><span translate="TOOLBAR.WAITINGQUEUECALLS">Waiting Queues Calls</span></md-tooltip>\n </md-button> --\x3e\n\n <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n <div layout="row" layout-align="center center">\n <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n </div>\n </md-button>\n\n <md-menu-content width="3" id="language-menu-content">\n <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n <span layout="row" layout-align="start center">\n <img class="flag flag-24" ng-src="assets/images/flags/{{lang.flag}}.png">\n <span>{{ lang.translation | translate | startcase }}</span>\n </span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n\n <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">\n {{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n <form name="previewForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ (\'TOOLBAR.PREVIEW\' | translate) + (vm.preview.recallme ? \' - \' +\n (\'CONTACTMANAGER.RECALLME\' | translate | uppercase) : \'\') }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div ng-if="vm.preview">\n <div ng-if="vm.preview.recallme" layout="row" class="recall-me-info">\n <md-icon md-font-icon="icon-information-outline" aria-label="Recall Me"></md-icon>\n <p class="ml-5" translate="TOOLBAR.HELP.PREVIEW_RECALLME" translate-values="{ date: (vm.preview.scheduledat | date:\'short\') }" flex></p>\n </div>\n <div layout="row">\n <div class="md-padding md-margin" layout="column" flex="30">\n <md-input-container ng-if="vm.preview.Contact.id" class="md-block no-margin">\n <label translate="CONTACTMANAGER.ID">ID</label>\n <input type="text" ng-model="vm.preview.Contact.id" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Queue.name" class="md-block no-margin">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.List.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <input type="text" ng-model="vm.preview.List.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.tags && vm.preview.Contact.tags.length" class="md-block no-margin">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <input type="text" ng-model="vm.preview.Contact.tags" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.Company && vm.preview.Contact.Company.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <input type="text" ng-model="vm.preview.Contact.Company.name" disabled="true">\n </md-input-container>\n </div>\n <md-divider></md-divider>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && !vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ \'CONTACTMANAGER.\' + key.toUpperCase() | translate}}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n\n <md-input-container ng-if="vm.additionalItems.length>0" class="md-block no-margin">\n <label translate="CONTACTMANAGER.ADDITIONAL_PHONES">Additional phones</label>\n <md-chips ng-model="vm.additionalItems" placeholder="Phone numbers" readonly="true">\n <md-chip-template custom-chip alt="{{$chip.type}} {{$chip.description}}" title="{{$chip.type}} {{$chip.description}}">\n {{ $chip.phone }}\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n </div>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ vm.customFieldsMap[key] || key }}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n </div>\n </div>\n </div>\n <div layout="row" ng-if="!vm.preview">\n <span>no contacts available</span>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n <md-button class="md-icon-button md-primary" ng-if="!vm.isRecallNotification" ng-hide="vm.hopperIds.length <= 1" ng-disabled="vm.disableGetContact" ng-click="vm.previousContact()" aria-label="PREVIOUSCONTACT" translate-attr-aria-label="TOOLS.PREVIOUSCONTACT">\n <md-icon md-font-icon="icon-chevron-left"></md-icon>\n </md-button>\n <md-button class="md-fab green-bg" aria-label="CALL" translate-attr-aria-label="TOOLS.CALL" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-button class="md-icon-button md-primary" ng-if="!vm.isRecallNotification" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact()" aria-label="NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n <md-icon md-font-icon="icon-chevron-right"></md-icon>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>')}]);
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd1e2=['exports','action','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x2851f2,_0x3d6113){var _0x4984db=function(_0x5c354f){while(--_0x5c354f){_0x2851f2['push'](_0x2851f2['shift']());}};_0x4984db(++_0x3d6113);}(_0xd1e2,0x1c2));var _0x2d1e=function(_0x9302c3,_0x43cf30){_0x9302c3=_0x9302c3-0x0;var _0x3a6d83=_0xd1e2[_0x9302c3];return _0x3a6d83;};'use strict';var Sequelize=require('sequelize');module[_0x2d1e('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38bff9){return this['getDataValue'](_0x2d1e('0x1'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x2d1e('0x2'),_0x2d1e('0x3'),_0x2d1e('0x4'),'jscripty',_0x2d1e('0x5'),_0x2d1e('0x6'),_0x2d1e('0x7'),_0x2d1e('0x8')]],'msg':_0x2d1e('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x2d1e('0xa')](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[_0x2d1e('0xa')](0x1000),'comment':_0x2d1e('0xb')},'data3':{'type':Sequelize[_0x2d1e('0xa')](0x1000),'comment':_0x2d1e('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x2d1e('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2d1e('0xe')},'data6':{'type':Sequelize[_0x2d1e('0xa')],'comments':_0x2d1e('0xf')},'data7':{'type':Sequelize[_0x2d1e('0x10')],'comments':_0x2d1e('0x11')}};
\ No newline at end of file
+var _0x3912=['contactManager','urlForward','browser','script','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x567d9c,_0x50405d){var _0x472c9b=function(_0x1e0ba){while(--_0x1e0ba){_0x567d9c['push'](_0x567d9c['shift']());}};_0x472c9b(++_0x50405d);}(_0x3912,0xb5));var _0x2391=function(_0x2668f9,_0x1a8c85){_0x2668f9=_0x2668f9-0x0;var _0x248b1e=_0x3912[_0x2668f9];return _0x248b1e;};'use strict';var Sequelize=require(_0x2391('0x0'));module[_0x2391('0x1')]={'name':{'type':Sequelize[_0x2391('0x2')],'get':function(_0xe0aacf){return this[_0x2391('0x3')](_0x2391('0x4'));}},'action':{'type':Sequelize[_0x2391('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2391('0x6'),'integration','motionbar','jscripty',_0x2391('0x7'),_0x2391('0x8'),'bot',_0x2391('0x9')]],'msg':_0x2391('0xa')}},'comment':_0x2391('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x2391('0xb')},'data2':{'type':Sequelize[_0x2391('0x5')](0x1000),'comment':_0x2391('0xc')},'data3':{'type':Sequelize[_0x2391('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x2391('0xd')},'data5':{'type':Sequelize[_0x2391('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x2391('0x5')],'comments':_0x2391('0xe')},'data7':{'type':Sequelize[_0x2391('0xf')],'comments':_0x2391('0x10')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xff13=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','body','find','params','catch','Action'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xff13,0x1d4));var _0x3ff1=function(_0x1cf861,_0x22d87b){_0x1cf861=_0x1cf861-0x0;var _0x49e521=_0xff13[_0x1cf861];return _0x49e521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ff1('0x0'));var zipdir=require(_0x3ff1('0x1'));var jsonpatch=require(_0x3ff1('0x2'));var rp=require(_0x3ff1('0x3'));var moment=require(_0x3ff1('0x4'));var BPromise=require(_0x3ff1('0x5'));var Mustache=require(_0x3ff1('0x6'));var util=require(_0x3ff1('0x7'));var path=require(_0x3ff1('0x8'));var sox=require(_0x3ff1('0x9'));var csv=require(_0x3ff1('0xa'));var ejs=require(_0x3ff1('0xb'));var fs=require('fs');var fs_extra=require(_0x3ff1('0xc'));var _=require(_0x3ff1('0xd'));var squel=require(_0x3ff1('0xe'));var crypto=require(_0x3ff1('0xf'));var jsforce=require(_0x3ff1('0x10'));var deskjs=require(_0x3ff1('0x11'));var toCsv=require(_0x3ff1('0xa'));var querystring=require(_0x3ff1('0x12'));var Papa=require('papaparse');var Redis=require(_0x3ff1('0x13'));var authService=require(_0x3ff1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3ff1('0x15'));var hardwareService=require(_0x3ff1('0x16'));var logger=require(_0x3ff1('0x17'))(_0x3ff1('0x18'));var utils=require(_0x3ff1('0x19'));var config=require(_0x3ff1('0x1a'));var licenseUtil=require(_0x3ff1('0x1b'));var db=require(_0x3ff1('0x1c'))['db'];function respondWithStatusCode(_0x40f71c,_0x248c74){_0x248c74=_0x248c74||0xcc;return function(_0xf003e9){if(_0xf003e9){return _0x40f71c[_0x3ff1('0x1d')](_0x248c74);}return _0x40f71c[_0x3ff1('0x1e')](_0x248c74)['end']();};}function respondWithResult(_0x1d350b,_0x9b3f69){_0x9b3f69=_0x9b3f69||0xc8;return function(_0xb1b706){if(_0xb1b706){return _0x1d350b[_0x3ff1('0x1e')](_0x9b3f69)[_0x3ff1('0x1f')](_0xb1b706);}};}function respondWithFilteredResult(_0x46f417,_0x5e53b4){return function(_0x422bcb){if(_0x422bcb){var _0x27f240=typeof _0x5e53b4[_0x3ff1('0x20')]===_0x3ff1('0x21')&&typeof _0x5e53b4['limit']==='undefined';var _0x6bdd65=_0x422bcb['count'];var _0x294f3a=_0x27f240?0x0:_0x5e53b4['offset'];var _0x11193c=_0x27f240?_0x422bcb[_0x3ff1('0x22')]:_0x5e53b4[_0x3ff1('0x20')]+_0x5e53b4['limit'];var _0x22518a;if(_0x11193c>=_0x6bdd65){_0x11193c=_0x6bdd65;_0x22518a=0xc8;}else{_0x22518a=0xce;}_0x46f417['status'](_0x22518a);return _0x46f417[_0x3ff1('0x23')](_0x3ff1('0x24'),_0x294f3a+'-'+_0x11193c+'/'+_0x6bdd65)['json'](_0x422bcb);}return null;};}function patchUpdates(_0x30a06f){return function(_0x183a6c){try{jsonpatch[_0x3ff1('0x25')](_0x183a6c,_0x30a06f,!![]);}catch(_0x50fc7e){return BPromise['reject'](_0x50fc7e);}return _0x183a6c[_0x3ff1('0x26')]();};}function saveUpdates(_0x5596da,_0xb753ee){return function(_0x243ede){if(_0x243ede){return _0x243ede[_0x3ff1('0x27')](_0x5596da)[_0x3ff1('0x28')](function(_0x229884){return _0x229884;});}return null;};}function removeEntity(_0x5a5e35,_0x1c478c){return function(_0x3aa3a0){if(_0x3aa3a0){return _0x3aa3a0[_0x3ff1('0x29')]()[_0x3ff1('0x28')](function(){_0x5a5e35[_0x3ff1('0x1e')](0xcc)[_0x3ff1('0x2a')]();});}};}function handleEntityNotFound(_0x3c1e9f,_0xb7ec99){return function(_0x13041c){if(!_0x13041c){_0x3c1e9f[_0x3ff1('0x1d')](0x194);}return _0x13041c;};}function handleError(_0xeea754,_0x32eea1){_0x32eea1=_0x32eea1||0x1f4;return function(_0x20d925){logger[_0x3ff1('0x2b')](_0x20d925[_0x3ff1('0x2c')]);if(_0x20d925[_0x3ff1('0x2d')]){delete _0x20d925['name'];}_0xeea754[_0x3ff1('0x1e')](_0x32eea1)[_0x3ff1('0x2e')](_0x20d925);};}exports[_0x3ff1('0x27')]=function(_0x52f0a3,_0xc0fe77){if(_0x52f0a3[_0x3ff1('0x2f')]['id']){delete _0x52f0a3[_0x3ff1('0x2f')]['id'];}return db['Action'][_0x3ff1('0x30')]({'where':{'id':_0x52f0a3[_0x3ff1('0x31')]['id']}})[_0x3ff1('0x28')](handleEntityNotFound(_0xc0fe77,null))[_0x3ff1('0x28')](saveUpdates(_0x52f0a3[_0x3ff1('0x2f')],null))[_0x3ff1('0x28')](respondWithResult(_0xc0fe77,null))[_0x3ff1('0x32')](handleError(_0xc0fe77,null));};exports[_0x3ff1('0x29')]=function(_0x56d961,_0x3fb849){return db[_0x3ff1('0x33')][_0x3ff1('0x30')]({'where':{'id':_0x56d961[_0x3ff1('0x31')]['id']}})[_0x3ff1('0x28')](handleEntityNotFound(_0x3fb849,null))[_0x3ff1('0x28')](removeEntity(_0x3fb849,null))['catch'](handleError(_0x3fb849,null));};
\ No newline at end of file
+var _0x7e98=['count','Content-Range','reject','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x7e98,0xe1));var _0x87e9=function(_0xb899b,_0x2ecc3e){_0xb899b=_0xb899b-0x0;var _0x4c0bea=_0x7e98[_0xb899b];return _0x4c0bea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87e9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87e9('0x1'));var rp=require('request-promise');var moment=require(_0x87e9('0x2'));var BPromise=require(_0x87e9('0x3'));var Mustache=require(_0x87e9('0x4'));var util=require('util');var path=require(_0x87e9('0x5'));var sox=require('sox');var csv=require(_0x87e9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87e9('0x7'));var squel=require(_0x87e9('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87e9('0x9'));var toCsv=require('to-csv');var querystring=require(_0x87e9('0xa'));var Papa=require(_0x87e9('0xb'));var Redis=require('ioredis');var authService=require(_0x87e9('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x87e9('0xd'));var hardwareService=require(_0x87e9('0xe'));var logger=require(_0x87e9('0xf'))(_0x87e9('0x10'));var utils=require(_0x87e9('0x11'));var config=require(_0x87e9('0x12'));var licenseUtil=require(_0x87e9('0x13'));var db=require(_0x87e9('0x14'))['db'];function respondWithStatusCode(_0x111b7e,_0x599265){_0x599265=_0x599265||0xcc;return function(_0x1047e5){if(_0x1047e5){return _0x111b7e[_0x87e9('0x15')](_0x599265);}return _0x111b7e[_0x87e9('0x16')](_0x599265)['end']();};}function respondWithResult(_0x3222b9,_0xff982){_0xff982=_0xff982||0xc8;return function(_0xae058e){if(_0xae058e){return _0x3222b9[_0x87e9('0x16')](_0xff982)[_0x87e9('0x17')](_0xae058e);}};}function respondWithFilteredResult(_0x3acfef,_0x35df4c){return function(_0x11c966){if(_0x11c966){var _0x415113=typeof _0x35df4c[_0x87e9('0x18')]===_0x87e9('0x19')&&typeof _0x35df4c[_0x87e9('0x1a')]===_0x87e9('0x19');var _0x4dc92c=_0x11c966[_0x87e9('0x1b')];var _0x531f6b=_0x415113?0x0:_0x35df4c[_0x87e9('0x18')];var _0x4bb239=_0x415113?_0x11c966[_0x87e9('0x1b')]:_0x35df4c[_0x87e9('0x18')]+_0x35df4c['limit'];var _0x561553;if(_0x4bb239>=_0x4dc92c){_0x4bb239=_0x4dc92c;_0x561553=0xc8;}else{_0x561553=0xce;}_0x3acfef['status'](_0x561553);return _0x3acfef['set'](_0x87e9('0x1c'),_0x531f6b+'-'+_0x4bb239+'/'+_0x4dc92c)['json'](_0x11c966);}return null;};}function patchUpdates(_0xa4bde2){return function(_0x248dd0){try{jsonpatch['apply'](_0x248dd0,_0xa4bde2,!![]);}catch(_0x1c6a0b){return BPromise[_0x87e9('0x1d')](_0x1c6a0b);}return _0x248dd0['save']();};}function saveUpdates(_0x3224b6,_0x5e196c){return function(_0x4c712f){if(_0x4c712f){return _0x4c712f[_0x87e9('0x1e')](_0x3224b6)[_0x87e9('0x1f')](function(_0x4a21be){return _0x4a21be;});}return null;};}function removeEntity(_0x527af0,_0x423dd9){return function(_0x50c592){if(_0x50c592){return _0x50c592[_0x87e9('0x20')]()['then'](function(){_0x527af0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x105f6b,_0x4cecb0){return function(_0x14eb20){if(!_0x14eb20){_0x105f6b[_0x87e9('0x15')](0x194);}return _0x14eb20;};}function handleError(_0x367a3c,_0x5def1e){_0x5def1e=_0x5def1e||0x1f4;return function(_0x38d8e5){logger[_0x87e9('0x21')](_0x38d8e5[_0x87e9('0x22')]);if(_0x38d8e5[_0x87e9('0x23')]){delete _0x38d8e5[_0x87e9('0x23')];}_0x367a3c[_0x87e9('0x16')](_0x5def1e)[_0x87e9('0x24')](_0x38d8e5);};}exports[_0x87e9('0x1e')]=function(_0x1352bf,_0x261119){if(_0x1352bf['body']['id']){delete _0x1352bf[_0x87e9('0x25')]['id'];}return db[_0x87e9('0x26')][_0x87e9('0x27')]({'where':{'id':_0x1352bf[_0x87e9('0x28')]['id']}})[_0x87e9('0x1f')](handleEntityNotFound(_0x261119,null))[_0x87e9('0x1f')](saveUpdates(_0x1352bf[_0x87e9('0x25')],null))[_0x87e9('0x1f')](respondWithResult(_0x261119,null))['catch'](handleError(_0x261119,null));};exports[_0x87e9('0x20')]=function(_0x3b4676,_0x32441c){return db[_0x87e9('0x26')]['find']({'where':{'id':_0x3b4676[_0x87e9('0x28')]['id']}})[_0x87e9('0x1f')](handleEntityNotFound(_0x32441c,null))[_0x87e9('0x1f')](removeEntity(_0x32441c,null))[_0x87e9('0x29')](handleError(_0x32441c,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45d2=['bluebird','request-promise','../../config/environment','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0x59f3d6,_0x4389ee){var _0x386933=function(_0x26dfb6){while(--_0x26dfb6){_0x59f3d6['push'](_0x59f3d6['shift']());}};_0x386933(++_0x4389ee);}(_0x45d2,0xec));var _0x245d=function(_0x1dc995,_0x5dd8f4){_0x1dc995=_0x1dc995-0x0;var _0x2cd006=_0x45d2[_0x1dc995];return _0x2cd006;};'use strict';var _=require(_0x245d('0x0'));var util=require(_0x245d('0x1'));var logger=require(_0x245d('0x2'))(_0x245d('0x3'));var moment=require('moment');var BPromise=require(_0x245d('0x4'));var rp=require(_0x245d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x245d('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0x568f94,_0x46a727){return _0x568f94[_0x245d('0x7')](_0x245d('0x8'),attributes,{'tableName':_0x245d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff33=['api','bluebird','request-promise','path','rimraf','./action.attributes','exports','tools_actions','util','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xff33,0x17a));var _0x3ff3=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xff33[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x3ff3('0x0'));var logger=require(_0x3ff3('0x1'))(_0x3ff3('0x2'));var moment=require('moment');var BPromise=require(_0x3ff3('0x3'));var rp=require(_0x3ff3('0x4'));var fs=require('fs');var path=require(_0x3ff3('0x5'));var rimraf=require(_0x3ff3('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ff3('0x7'));module[_0x3ff3('0x8')]=function(_0xc6214d,_0x30468b){return _0xc6214d['define']('Action',attributes,{'tableName':_0x3ff3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x15a634,_0x3e20d0){var _0x4c7d46=function(_0x10ef24){while(--_0x10ef24){_0x15a634['push'](_0x15a634['shift']());}};_0x4c7d46(++_0x3e20d0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x7fbe[_0x21b74b];return _0x518cc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5b3a66,_0x46acfb){var _0x336f30=function(_0x66862a){while(--_0x66862a){_0x5b3a66['push'](_0x5b3a66['shift']());}};_0x336f30(++_0x46acfb);}(_0x1261,0x144));var _0x1126=function(_0x1d326a,_0x89b53){_0x1d326a=_0x1d326a-0x0;var _0x5804d5=_0x1261[_0x1d326a];return _0x5804d5;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d35=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','update','delete','/:id','isAuthenticated','destroy'];(function(_0x43a84a,_0x6c500e){var _0x2ed43a=function(_0x8f88c3){while(--_0x8f88c3){_0x43a84a['push'](_0x43a84a['shift']());}};_0x2ed43a(++_0x6c500e);}(_0x0d35,0xb7));var _0x50d3=function(_0x14ab65,_0x8dc76a){_0x14ab65=_0x14ab65-0x0;var _0x556a6d=_0x0d35[_0x14ab65];return _0x556a6d;};'use strict';var multer=require(_0x50d3('0x0'));var util=require(_0x50d3('0x1'));var path=require('path');var timeout=require(_0x50d3('0x2'));var express=require(_0x50d3('0x3'));var router=express[_0x50d3('0x4')]();var fs_extra=require(_0x50d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x50d3('0x6'));var config=require(_0x50d3('0x7'));var controller=require('./action.controller');router['put']('/:id',auth['isAuthenticated'](),controller[_0x50d3('0x8')]);router[_0x50d3('0x9')](_0x50d3('0xa'),auth[_0x50d3('0xb')](),controller[_0x50d3('0xc')]);module[_0x50d3('0xd')]=router;
\ No newline at end of file
+var _0x3b85=['connect-timeout','Router','fs-extra','../../components/interaction/service','./action.controller','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x3b85,0x184));var _0x53b8=function(_0x2ab8ef,_0x3ea87c){_0x2ab8ef=_0x2ab8ef-0x0;var _0x2b773c=_0x3b85[_0x2ab8ef];return _0x2b773c;};'use strict';var multer=require(_0x53b8('0x0'));var util=require(_0x53b8('0x1'));var path=require('path');var timeout=require(_0x53b8('0x2'));var express=require('express');var router=express[_0x53b8('0x3')]();var fs_extra=require(_0x53b8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x53b8('0x5'));var config=require('../../config/environment');var controller=require(_0x53b8('0x6'));router[_0x53b8('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x53b8('0x8')]);router[_0x53b8('0x9')](_0x53b8('0xa'),auth['isAuthenticated'](),controller[_0x53b8('0xb')]);module[_0x53b8('0xc')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x51be7f,_0xd159f3){var _0x58f88c=function(_0x29c5d7){while(--_0x29c5d7){_0x51be7f['push'](_0x51be7f['shift']());}};_0x58f88c(++_0xd159f3);}(_0x5fab,0x177));var _0xb5fa=function(_0x7440e0,_0x42d9b8){_0x7440e0=_0x7440e0-0x0;var _0x33ee99=_0x5fab[_0x7440e0];return _0x33ee99;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x2675,0x75));var _0x5267=function(_0x59ef16,_0x4ac29c){_0x59ef16=_0x59ef16-0x0;var _0xdbf81c=_0x2675[_0x59ef16];return _0xdbf81c;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85a2=['update','destroy','then','get','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','params','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','create','CustomReports','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','format','order','orderBy','DESC','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','Limited\x20Query:','toString','sequelize','SUM(%s)','MAX(%s)','HOUR(%s)','select','metric','replace','alias','clone','output','web','fullPath','randomstring','generate','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','IS\x20NOT\x20NULL','operator','ValidationErrorItem','groupBy','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save'];(function(_0xf3840d,_0x32c7ba){var _0x18d617=function(_0x363714){while(--_0x363714){_0xf3840d['push'](_0xf3840d['shift']());}};_0x18d617(++_0x32c7ba);}(_0x85a2,0x7c));var _0x285a=function(_0x1d991c,_0x38857f){_0x1d991c=_0x1d991c-0x0;var _0x424471=_0x85a2[_0x1d991c];return _0x424471;};'use strict';var emlformat=require(_0x285a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x285a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x285a('0x2'));var moment=require(_0x285a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x285a('0x4'));var util=require(_0x285a('0x5'));var path=require(_0x285a('0x6'));var sox=require(_0x285a('0x7'));var csv=require(_0x285a('0x8'));var ejs=require(_0x285a('0x9'));var fs=require('fs');var fs_extra=require(_0x285a('0xa'));var _=require('lodash');var squel=require(_0x285a('0xb'));var crypto=require(_0x285a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x285a('0xd'));var toCsv=require(_0x285a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x285a('0xe'));var authService=require(_0x285a('0xf'));var qs=require(_0x285a('0x10'));var as=require(_0x285a('0x11'));var hardwareService=require(_0x285a('0x12'));var logger=require(_0x285a('0x13'))(_0x285a('0x14'));var utils=require(_0x285a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x285a('0x16'));var db=require(_0x285a('0x17'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x125b47,_0x2dc8c5){_0x2dc8c5=_0x2dc8c5||0xcc;return function(_0x5ca77d){if(_0x5ca77d){return _0x125b47[_0x285a('0x18')](_0x2dc8c5);}return _0x125b47[_0x285a('0x19')](_0x2dc8c5)[_0x285a('0x1a')]();};}function respondWithResult(_0x259a7e,_0x2cf96f){_0x2cf96f=_0x2cf96f||0xc8;return function(_0x362204){if(_0x362204){return _0x259a7e[_0x285a('0x19')](_0x2cf96f)[_0x285a('0x1b')](_0x362204);}};}function respondWithFilteredResult(_0x28f2bc,_0x1174ee){return function(_0x1e82a8){if(_0x1e82a8){var _0x84743d=typeof _0x1174ee['offset']===_0x285a('0x1c')&&typeof _0x1174ee['limit']===_0x285a('0x1c');var _0x16e80b=_0x1e82a8[_0x285a('0x1d')];var _0x196572=_0x84743d?0x0:_0x1174ee[_0x285a('0x1e')];var _0x2e74b6=_0x84743d?_0x1e82a8[_0x285a('0x1d')]:_0x1174ee[_0x285a('0x1e')]+_0x1174ee[_0x285a('0x1f')];var _0x5c7215;if(_0x2e74b6>=_0x16e80b){_0x2e74b6=_0x16e80b;_0x5c7215=0xc8;}else{_0x5c7215=0xce;}_0x28f2bc[_0x285a('0x19')](_0x5c7215);return _0x28f2bc['set'](_0x285a('0x20'),_0x196572+'-'+_0x2e74b6+'/'+_0x16e80b)['json'](_0x1e82a8);}return null;};}function patchUpdates(_0x5022f0){return function(_0x37e943){try{jsonpatch['apply'](_0x37e943,_0x5022f0,!![]);}catch(_0x2f51c3){return BPromise[_0x285a('0x21')](_0x2f51c3);}return _0x37e943[_0x285a('0x22')]();};}function saveUpdates(_0x319ad8,_0x31b587){return function(_0x2d7be9){if(_0x2d7be9){return _0x2d7be9[_0x285a('0x23')](_0x319ad8)['then'](function(_0x52b596){return _0x52b596;});}return null;};}function removeEntity(_0x49ab9c,_0x2c2fbb){return function(_0x22a3d3){if(_0x22a3d3){return _0x22a3d3[_0x285a('0x24')]()[_0x285a('0x25')](function(){var _0x2b75d1=_0x22a3d3[_0x285a('0x26')]({'plain':!![]});var _0x1fcc60='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x1fcc60,'resourceId':_0x2b75d1['id']}})[_0x285a('0x25')](function(){return _0x22a3d3;});})[_0x285a('0x25')](function(){_0x49ab9c['status'](0xcc)[_0x285a('0x1a')]();});}};}function handleEntityNotFound(_0x2a6a5a,_0x204f29){return function(_0x102b0b){if(!_0x102b0b){_0x2a6a5a[_0x285a('0x18')](0x194);}return _0x102b0b;};}function handleError(_0x30fdd5,_0x4417e4){_0x4417e4=_0x4417e4||0x1f4;return function(_0x2ac956){logger[_0x285a('0x27')](_0x2ac956[_0x285a('0x28')]);if(_0x2ac956[_0x285a('0x29')]){delete _0x2ac956[_0x285a('0x29')];}_0x30fdd5[_0x285a('0x19')](_0x4417e4)[_0x285a('0x2a')](_0x2ac956);};}exports[_0x285a('0x2b')]=function(_0x4f858e,_0x1075e8){var _0x35ca0e={},_0x452a59={},_0x48dc9f={'count':0x0,'rows':[]};var _0x5c7c05=_[_0x285a('0x2c')](db[_0x285a('0x2d')]['rawAttributes'],function(_0x500958){return{'name':_0x500958[_0x285a('0x2e')],'type':_0x500958[_0x285a('0x2f')][_0x285a('0x30')]};});_0x452a59[_0x285a('0x31')]=_[_0x285a('0x2c')](_0x5c7c05,_0x285a('0x29'));_0x452a59[_0x285a('0x32')]=_[_0x285a('0x33')](_0x4f858e[_0x285a('0x32')]);_0x452a59[_0x285a('0x34')]=_['intersection'](_0x452a59['model'],_0x452a59['query']);_0x35ca0e['attributes']=_[_0x285a('0x35')](_0x452a59['model'],qs['fields'](_0x4f858e[_0x285a('0x32')][_0x285a('0x36')]));_0x35ca0e[_0x285a('0x37')]=_0x35ca0e[_0x285a('0x37')][_0x285a('0x38')]?_0x35ca0e['attributes']:_0x452a59[_0x285a('0x31')];if(!_0x4f858e[_0x285a('0x32')][_0x285a('0x39')](_0x285a('0x3a'))){_0x35ca0e[_0x285a('0x1f')]=qs['limit'](_0x4f858e[_0x285a('0x32')][_0x285a('0x1f')]);_0x35ca0e[_0x285a('0x1e')]=qs['offset'](_0x4f858e[_0x285a('0x32')][_0x285a('0x1e')]);}_0x35ca0e['order']=qs[_0x285a('0x3b')](_0x4f858e[_0x285a('0x32')][_0x285a('0x3b')]);_0x35ca0e[_0x285a('0x3c')]=qs['filters'](_[_0x285a('0x3d')](_0x4f858e[_0x285a('0x32')],_0x452a59[_0x285a('0x34')]),_0x5c7c05);if(_0x4f858e[_0x285a('0x32')]['filter']){_0x35ca0e[_0x285a('0x3c')]=_[_0x285a('0x3e')](_0x35ca0e['where'],{'$or':_[_0x285a('0x2c')](_0x5c7c05,function(_0x377168){if(_0x377168[_0x285a('0x2f')]!=='VIRTUAL'){var _0x5f54c0={};_0x5f54c0[_0x377168[_0x285a('0x29')]]={'$like':'%'+_0x4f858e['query'][_0x285a('0x3f')]+'%'};return _0x5f54c0;}})});}_0x35ca0e=_[_0x285a('0x3e')]({},_0x35ca0e,_0x4f858e[_0x285a('0x40')]);var _0x46dbb3={'where':_0x35ca0e[_0x285a('0x3c')]};return db[_0x285a('0x2d')][_0x285a('0x1d')](_0x46dbb3)[_0x285a('0x25')](function(_0x17e3c9){_0x48dc9f['count']=_0x17e3c9;if(_0x4f858e[_0x285a('0x32')][_0x285a('0x41')]){_0x35ca0e[_0x285a('0x42')]=[{'all':!![]}];}return db[_0x285a('0x2d')][_0x285a('0x43')](_0x35ca0e);})[_0x285a('0x25')](function(_0x825f1f){_0x48dc9f['rows']=_0x825f1f;return _0x48dc9f;})[_0x285a('0x25')](respondWithFilteredResult(_0x1075e8,_0x35ca0e))['catch'](handleError(_0x1075e8,null));};exports[_0x285a('0x44')]=function(_0x393f34,_0x14cad6){var _0x2ec527={'raw':![],'where':{'id':_0x393f34[_0x285a('0x45')]['id']}},_0x181435={};_0x181435['model']=_[_0x285a('0x33')](db[_0x285a('0x2d')]['rawAttributes']);_0x181435[_0x285a('0x32')]=_['keys'](_0x393f34[_0x285a('0x32')]);_0x181435[_0x285a('0x34')]=_['intersection'](_0x181435[_0x285a('0x31')],_0x181435['query']);_0x2ec527['attributes']=_[_0x285a('0x35')](_0x181435['model'],qs[_0x285a('0x36')](_0x393f34['query'][_0x285a('0x36')]));_0x2ec527['attributes']=_0x2ec527['attributes']['length']?_0x2ec527[_0x285a('0x37')]:_0x181435[_0x285a('0x31')];if(_0x393f34['query']['includeAll']){_0x2ec527[_0x285a('0x42')]=[{'all':!![]}];}_0x2ec527=_[_0x285a('0x3e')]({},_0x2ec527,_0x393f34[_0x285a('0x40')]);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x2ec527)[_0x285a('0x25')](handleEntityNotFound(_0x14cad6,null))['then'](respondWithResult(_0x14cad6,null))[_0x285a('0x47')](handleError(_0x14cad6,null));};exports['create']=function(_0x4ffcd7,_0x3a0693){return db[_0x285a('0x2d')]['create'](_0x4ffcd7[_0x285a('0x48')],{})[_0x285a('0x25')](function(_0x11f86b){var _0x2e6143=_0x4ffcd7['user'][_0x285a('0x26')]({'plain':!![]});if(!_0x2e6143)throw new Error(_0x285a('0x49'));if(_0x2e6143['role']==='user'){var _0x3b1af2=_0x11f86b[_0x285a('0x26')]({'plain':!![]});var _0x28247c='Reports';return db[_0x285a('0x4a')][_0x285a('0x46')]({'where':{'name':_0x28247c,'userProfileId':_0x2e6143['userProfileId']},'raw':!![]})[_0x285a('0x25')](function(_0x294f4b){if(_0x294f4b&&_0x294f4b[_0x285a('0x4b')]===0x0){return db[_0x285a('0x4c')][_0x285a('0x4d')]({'name':_0x3b1af2[_0x285a('0x29')],'resourceId':_0x3b1af2['id'],'type':_0x285a('0x4e'),'sectionId':_0x294f4b['id']},{})[_0x285a('0x25')](function(){return _0x11f86b;});}else{return _0x11f86b;}})[_0x285a('0x47')](function(_0x381088){logger[_0x285a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x381088);throw _0x381088;});}return _0x11f86b;})[_0x285a('0x25')](respondWithResult(_0x3a0693,0xc9))[_0x285a('0x47')](handleError(_0x3a0693,null));};exports['update']=function(_0xd52261,_0x5b04be){if(_0xd52261[_0x285a('0x48')]['id']){delete _0xd52261[_0x285a('0x48')]['id'];}return db[_0x285a('0x2d')][_0x285a('0x46')]({'where':{'id':_0xd52261[_0x285a('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b04be,null))['then'](saveUpdates(_0xd52261[_0x285a('0x48')],null))[_0x285a('0x25')](respondWithResult(_0x5b04be,null))[_0x285a('0x47')](handleError(_0x5b04be,null));};exports[_0x285a('0x24')]=function(_0x585df5,_0x338e01){return db[_0x285a('0x2d')][_0x285a('0x46')]({'where':{'id':_0x585df5[_0x285a('0x45')]['id']}})['then'](handleEntityNotFound(_0x338e01,null))[_0x285a('0x25')](removeEntity(_0x338e01,null))[_0x285a('0x47')](handleError(_0x338e01,null));};exports[_0x285a('0x4f')]=function(_0x5bc9d7,_0x27ef76){var _0x548fce=0xa;var _0x8a0779=[_0x285a('0x50'),_0x285a('0x51'),_0x285a('0x52'),_0x285a('0x53')];var _0x470a5c={'SUM':'SUM(%s)','COUNT':_0x285a('0x54'),'COUNT DISTINCT':_0x285a('0x55'),'MAX':'MAX(%s)','MIN':_0x285a('0x56'),'AVG':_0x285a('0x57'),'GROUP_CONCAT':_0x285a('0x58'),'GROUP_CONCAT ASC':_0x285a('0x59'),'GROUP_CONCAT DESC':_0x285a('0x5a')};var _0x256855={'SEC_TO_TIME':_0x285a('0x5b'),'DATE':_0x285a('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x285a('0x5d'),'UNIX_TIMESTAMP':_0x285a('0x5e')};var _0x4ee89f=function(_0x13ce1e){return!_[_0x285a('0x5f')]([_0x285a('0x60'),'IS\x20NOT\x20NULL',_0x285a('0x61'),_0x285a('0x62')],_0x13ce1e);};var _0x15439b=function(_0x4677e9){if(!_0x4677e9||!_0x4677e9['rules'][_0x285a('0x38')]){return'';}for(var _0x2775ec='(',_0x1c0f27=0x0;_0x1c0f27<_0x4677e9[_0x285a('0x63')]['length'];_0x1c0f27+=0x1){_0x1c0f27>0x0&&(_0x2775ec+='\x20'+_0x4677e9['operator']+'\x20');_0x2775ec+=_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x64')]?_0x15439b(_0x4677e9['rules'][_0x1c0f27][_0x285a('0x64')]):_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x65')]+'\x20'+_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x66')]+(_0x4ee89f(_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x66')])?'\x20'+_0x4677e9[_0x285a('0x63')][_0x1c0f27][_0x285a('0x67')]:'');}return _0x2775ec+')';};var _0x9219f8={'where':{'id':_0x5bc9d7[_0x285a('0x45')]['id']}},_0x253b51,_0x416424,_0x12f1e1,_0x25f1dd,_0x137100;_0x9219f8=_['merge']({},_0x9219f8,_0x5bc9d7[_0x285a('0x40')]);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x9219f8)[_0x285a('0x25')](function(_0x5ac6e7){if(_0x5ac6e7){_0x253b51=_0x5ac6e7;return _0x5ac6e7[_0x285a('0x68')]();}return null;})[_0x285a('0x25')](function(_0xcc05d){if(_0xcc05d){if(!_0xcc05d[_0x285a('0x38')]){throw new db[(_0x285a('0x69'))]['ValidationErrorItem'](_0x285a('0x6a'),0x193);}_0x416424=_0xcc05d;return db[_0x285a('0x6b')][_0x285a('0x43')]({'raw':!![]});}return null;})[_0x285a('0x25')](function(_0x498056){if(_0x498056){_0x12f1e1=_[_0x285a('0x6c')](_0x498056,'id');var _0x4f9a0c;var _0x1dc316=squel['select']();_0x1dc316[_0x285a('0x6d')](_0x253b51[_0x285a('0x6e')]);for(var _0x14621e=0x0;_0x14621e<_0x416424['length'];_0x14621e+=0x1){_0x4f9a0c=_0x416424[_0x14621e][_0x285a('0x6f')]?_0x12f1e1[_0x416424[_0x14621e][_0x285a('0x6f')]]['metric']:_0x416424[_0x14621e]['field'];_0x4f9a0c=_0x416424[_0x14621e]['function']?_['replace'](_0x470a5c[_0x416424[_0x14621e][_0x285a('0x70')]],'%s',_0x4f9a0c):_0x4f9a0c;_0x4f9a0c=_0x416424[_0x14621e][_0x285a('0x71')]?_['replace'](_0x256855[_0x416424[_0x14621e][_0x285a('0x71')]],'%s',_0x4f9a0c):_0x4f9a0c;if(_0x416424[_0x14621e]['groupBy']){_0x1dc316[_0x285a('0x64')](_0x4f9a0c);}_0x416424[_0x14621e]['orderBy']&&_0x1dc316[_0x285a('0x72')](_0x4f9a0c,_0x416424[_0x14621e][_0x285a('0x73')]===_0x285a('0x74')?![]:!![]);_0x1dc316[_0x285a('0x65')](_0x4f9a0c,_0x416424[_0x14621e]['alias']||_0x4f9a0c);}if(_0x253b51[_0x285a('0x75')]){_0x253b51[_0x285a('0x75')]=JSON[_0x285a('0x76')](_0x253b51['joins']);for(var _0x58b7f4=0x0;_0x58b7f4<_0x253b51[_0x285a('0x75')]['length'];_0x58b7f4+=0x1){if(_0x253b51[_0x285a('0x75')][_0x58b7f4]['type']&&_[_0x285a('0x5f')](_0x8a0779,_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x2f')])&&_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x77')]&&_0x253b51['joins'][_0x58b7f4]['foreignTable']&&_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x78')]){_0x1dc316[_0x253b51['joins'][_0x58b7f4][_0x285a('0x2f')]](_0x253b51[_0x285a('0x75')][_0x58b7f4]['foreignTable'],null,util[_0x285a('0x71')](_0x285a('0x79'),_0x253b51[_0x285a('0x6e')],_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x77')],_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x7a')],_0x253b51[_0x285a('0x75')][_0x58b7f4][_0x285a('0x78')]));}}}if(_0x253b51['conditions']){_0x253b51[_0x285a('0x7b')]=JSON[_0x285a('0x76')](_0x253b51['conditions']);_0x1dc316['where'](_0x15439b(_0x253b51[_0x285a('0x7b')][_0x285a('0x64')]));}_0x137100=_0x1dc316['clone']();_0x1dc316[_0x285a('0x1f')](_0x548fce);_0x1dc316[_0x285a('0x1e')](0x0);logger['debug'](_0x285a('0x7c'),_0x1dc316[_0x285a('0x7d')]());return dbH[_0x285a('0x7e')][_0x285a('0x32')](_0x1dc316[_0x285a('0x7d')](),{'type':dbH[_0x285a('0x7e')]['QueryTypes']['SELECT']});}})[_0x285a('0x25')](respondWithResult(_0x27ef76,null))[_0x285a('0x47')](handleError(_0x27ef76,null));};function runReport(_0x1730f4,_0xf20c03,_0x3081ff){var _0x459471=_0xf20c03[_0x285a('0x29')];var _0x3f3b82=0xa;var _0x518078=[_0x285a('0x50'),_0x285a('0x51'),_0x285a('0x52'),'cross_join'];var _0x40cace={'SUM':_0x285a('0x7f'),'COUNT':_0x285a('0x54'),'COUNT DISTINCT':_0x285a('0x55'),'MAX':_0x285a('0x80'),'MIN':_0x285a('0x56'),'AVG':_0x285a('0x57'),'GROUP_CONCAT':_0x285a('0x58'),'GROUP_CONCAT ASC':_0x285a('0x59'),'GROUP_CONCAT DESC':_0x285a('0x5a')};var _0x5770f7={'SEC_TO_TIME':_0x285a('0x5b'),'DATE':_0x285a('0x5c'),'HOUR':_0x285a('0x81'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x285a('0x5e')};var _0x222faf=function(_0x1ad6cb){return!_[_0x285a('0x5f')]([_0x285a('0x60'),'IS\x20NOT\x20NULL',_0x285a('0x61'),_0x285a('0x62')],_0x1ad6cb);};var _0xe24089=function(_0x535f69){if(!_0x535f69||!_0x535f69[_0x285a('0x63')][_0x285a('0x38')]){return'';}for(var _0x60c847='(',_0x3332d5=0x0;_0x3332d5<_0x535f69['rules']['length'];_0x3332d5+=0x1){_0x3332d5>0x0&&(_0x60c847+='\x20'+_0x535f69['operator']+'\x20');_0x60c847+=_0x535f69[_0x285a('0x63')][_0x3332d5][_0x285a('0x64')]?_0xe24089(_0x535f69[_0x285a('0x63')][_0x3332d5]['group']):_0x535f69[_0x285a('0x63')][_0x3332d5][_0x285a('0x65')]+'\x20'+_0x535f69[_0x285a('0x63')][_0x3332d5][_0x285a('0x66')]+(_0x222faf(_0x535f69[_0x285a('0x63')][_0x3332d5]['condition'])?'\x20'+_0x535f69['rules'][_0x3332d5][_0x285a('0x67')]:'');}return _0x60c847+')';};var _0x1347c5={'where':{'id':_0x1730f4['id']}},_0x49ace8,_0x489edb,_0x182790,_0x26987e,_0x3db43c;_0x1347c5=_['merge']({},_0x1347c5,_0x3081ff);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x1347c5)['then'](function(_0x5eff47){if(_0x5eff47){_0x49ace8=_0x5eff47;return _0x5eff47[_0x285a('0x68')]();}return null;})[_0x285a('0x25')](function(_0xeb5070){if(_0xeb5070){if(!_0xeb5070[_0x285a('0x38')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x489edb=_0xeb5070;return db[_0x285a('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x52a617){if(_0x52a617){_0x182790=_[_0x285a('0x6c')](_0x52a617,'id');var _0x24dd84;var _0x5d15f9=squel[_0x285a('0x82')]();_0x5d15f9[_0x285a('0x6d')](_0x49ace8['table']);for(var _0x3913a5=0x0;_0x3913a5<_0x489edb['length'];_0x3913a5+=0x1){_0x24dd84=_0x489edb[_0x3913a5][_0x285a('0x6f')]?_0x182790[_0x489edb[_0x3913a5]['MetricId']][_0x285a('0x83')]:_0x489edb[_0x3913a5][_0x285a('0x65')];_0x24dd84=_0x489edb[_0x3913a5][_0x285a('0x70')]?_['replace'](_0x40cace[_0x489edb[_0x3913a5][_0x285a('0x70')]],'%s',_0x24dd84):_0x24dd84;_0x24dd84=_0x489edb[_0x3913a5]['format']?_[_0x285a('0x84')](_0x5770f7[_0x489edb[_0x3913a5][_0x285a('0x71')]],'%s',_0x24dd84):_0x24dd84;if(_0x489edb[_0x3913a5]['groupBy']){_0x5d15f9[_0x285a('0x64')](_0x24dd84);}_0x489edb[_0x3913a5][_0x285a('0x73')]&&_0x5d15f9['order'](_0x24dd84,_0x489edb[_0x3913a5][_0x285a('0x73')]===_0x285a('0x74')?![]:!![]);_0x5d15f9['field'](_0x24dd84,_0x489edb[_0x3913a5][_0x285a('0x85')]||_0x24dd84);}if(_0x49ace8[_0x285a('0x75')]){_0x49ace8[_0x285a('0x75')]=JSON[_0x285a('0x76')](_0x49ace8[_0x285a('0x75')]);for(var _0x37f1f6=0x0;_0x37f1f6<_0x49ace8[_0x285a('0x75')][_0x285a('0x38')];_0x37f1f6+=0x1){if(_0x49ace8[_0x285a('0x75')][_0x37f1f6]['type']&&_[_0x285a('0x5f')](_0x518078,_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x2f')])&&_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x77')]&&_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x7a')]&&_0x49ace8['joins'][_0x37f1f6]['foreignKey']){_0x5d15f9[_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x2f')]](_0x49ace8['joins'][_0x37f1f6][_0x285a('0x7a')],null,util[_0x285a('0x71')](_0x285a('0x79'),_0x49ace8['table'],_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x77')],_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x7a')],_0x49ace8[_0x285a('0x75')][_0x37f1f6][_0x285a('0x78')]));}}}if(_0x49ace8[_0x285a('0x7b')]){_0x49ace8[_0x285a('0x7b')]=JSON[_0x285a('0x76')](_0x49ace8[_0x285a('0x7b')]);_0x5d15f9[_0x285a('0x3c')](_0xe24089(_0x49ace8[_0x285a('0x7b')]['group']));}_0x3db43c=_0x5d15f9[_0x285a('0x86')]();_0x5d15f9[_0x285a('0x1f')](_0x3f3b82);_0x5d15f9[_0x285a('0x1e')](0x0);return;}})[_0x285a('0x25')](function(){if(_0xf20c03[_0x285a('0x87')]===_0x285a('0x88')){return null;}var _0x31f904=_['merge'](_0xf20c03,{'name':_0xf20c03[_0x285a('0x89')]||_0xf20c03[_0x285a('0x29')]||_0x49ace8[_0x285a('0x29')],'basename':_0x459471,'savename':util[_0x285a('0x71')]('%s-%s.%s',_0xf20c03[_0x285a('0x29')]||_0x49ace8[_0x285a('0x29')],require(_0x285a('0x8a'))[_0x285a('0x8b')](0x4),_0xf20c03[_0x285a('0x87')]||'csv'),'reportId':_0x49ace8['id'],'reportType':'custom'});return db[_0x285a('0x8c')][_0x285a('0x4d')](_0x31f904,{'raw':!![]});})[_0x285a('0x25')](function(_0x30426d){if(_0x49ace8['table']===_0x285a('0x8d')){_0x3db43c[_0x285a('0x3c')](_0x49ace8[_0x285a('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xf20c03[_0x285a('0x8e')],_0xf20c03[_0x285a('0x8f')]);}else{_0x3db43c[_0x285a('0x3c')](_0x49ace8[_0x285a('0x6e')]+_0x285a('0x90'),_0xf20c03['startDate'],_0xf20c03[_0x285a('0x8f')]);}if(_0x30426d){logger[_0x285a('0x91')](_0x285a('0x92'),_0x3db43c[_0x285a('0x7d')]());require('child_process')[_0x285a('0x93')](path[_0x285a('0x50')](__dirname,_0x285a('0x94'),_0x30426d[_0x285a('0x87')]),[_0x30426d['id'],_0x3db43c['toString'](),path[_0x285a('0x50')](__dirname,_0x285a('0x95'),_0x30426d[_0x285a('0x96')]),_0x459471]);return _0x30426d;}else{var _0x54f788=squel[_0x285a('0x82')]();_0x54f788[_0x285a('0x6d')]('('+_0x3db43c[_0x285a('0x7d')]()+')',_0x285a('0x97'));_0x54f788[_0x285a('0x65')](_0x285a('0x98'),_0x285a('0x1d'));_0x3db43c['limit'](_0xf20c03['limit']||_0x3f3b82);_0x3db43c[_0x285a('0x1e')](_0xf20c03[_0x285a('0x1e')]||0x0);return dbH[_0x285a('0x7e')][_0x285a('0x32')](_0x54f788[_0x285a('0x7d')](),{'type':dbH['sequelize'][_0x285a('0x99')]['SELECT']})[_0x285a('0x25')](function(_0x42a165){if(!_0x42a165[_0x285a('0x38')]){_0x26987e=0x0;}else{_0x26987e=_0x42a165[0x0]['count']||0x0;}return dbH[_0x285a('0x7e')]['query'](_0x3db43c[_0x285a('0x7d')](),{'type':dbH['sequelize'][_0x285a('0x99')][_0x285a('0x9a')]});})['then'](function(_0x35d12a){return{'rows':_0x35d12a||[],'count':_0x26987e};});}});}exports['run']=function(_0x9e146e,_0x183438){return runReport(_0x9e146e['params'],_0x9e146e[_0x285a('0x32')],_0x9e146e[_0x285a('0x40')])[_0x285a('0x25')](respondWithResult(_0x183438,null))[_0x285a('0x47')](handleError(_0x183438,null));};exports['runReport']=runReport;exports['query']=function(_0x2cd2f9,_0x49d5ac){var _0x21391d=0xa;var _0x597f62=[_0x285a('0x50'),_0x285a('0x51'),_0x285a('0x52'),_0x285a('0x53')];var _0x26744d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x285a('0x55'),'MAX':_0x285a('0x80'),'MIN':_0x285a('0x56'),'AVG':_0x285a('0x57'),'GROUP_CONCAT':_0x285a('0x58'),'GROUP_CONCAT ASC':_0x285a('0x59'),'GROUP_CONCAT DESC':_0x285a('0x5a')};var _0x4a62d2={'SEC_TO_TIME':_0x285a('0x5b'),'DATE':_0x285a('0x5c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x285a('0x5e')};var _0x3dd2ce=function(_0x1d3888){return!_[_0x285a('0x5f')]([_0x285a('0x60'),_0x285a('0x9b'),_0x285a('0x61'),_0x285a('0x62')],_0x1d3888);};var _0x59f74d=function(_0x40bce5){if(!_0x40bce5||!_0x40bce5[_0x285a('0x63')][_0x285a('0x38')]){return'';}for(var _0x2a92c8='(',_0x5cc7d9=0x0;_0x5cc7d9<_0x40bce5[_0x285a('0x63')]['length'];_0x5cc7d9+=0x1){_0x5cc7d9>0x0&&(_0x2a92c8+='\x20'+_0x40bce5[_0x285a('0x9c')]+'\x20');_0x2a92c8+=_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x64')]?_0x59f74d(_0x40bce5['rules'][_0x5cc7d9][_0x285a('0x64')]):_0x40bce5['rules'][_0x5cc7d9][_0x285a('0x65')]+'\x20'+_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x66')]+(_0x3dd2ce(_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x66')])?'\x20'+_0x40bce5[_0x285a('0x63')][_0x5cc7d9][_0x285a('0x67')]:'');}return _0x2a92c8+')';};var _0x26d8ae={'where':{'id':_0x2cd2f9[_0x285a('0x45')]['id']}},_0x2436c4,_0x24114a,_0x387409,_0x32d3a4,_0x2b8a96;_0x26d8ae=_[_0x285a('0x3e')]({},_0x26d8ae,_0x2cd2f9['options']);return db[_0x285a('0x2d')][_0x285a('0x46')](_0x26d8ae)[_0x285a('0x25')](function(_0x48d9fa){if(_0x48d9fa){_0x2436c4=_0x48d9fa;return _0x48d9fa[_0x285a('0x68')]();}return null;})['then'](function(_0x29921f){if(_0x29921f){if(!_0x29921f[_0x285a('0x38')]){throw new db[(_0x285a('0x69'))][(_0x285a('0x9d'))](_0x285a('0x6a'),0x193);}_0x24114a=_0x29921f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x285a('0x25')](function(_0x4b275b){if(_0x4b275b){_0x387409=_[_0x285a('0x6c')](_0x4b275b,'id');var _0x3e32d3;var _0x3028e4=squel[_0x285a('0x82')]();_0x3028e4['from'](_0x2436c4[_0x285a('0x6e')]);for(var _0xec620f=0x0;_0xec620f<_0x24114a['length'];_0xec620f+=0x1){_0x3e32d3=_0x24114a[_0xec620f][_0x285a('0x6f')]?_0x387409[_0x24114a[_0xec620f][_0x285a('0x6f')]]['metric']:_0x24114a[_0xec620f][_0x285a('0x65')];_0x3e32d3=_0x24114a[_0xec620f][_0x285a('0x70')]?_[_0x285a('0x84')](_0x26744d[_0x24114a[_0xec620f][_0x285a('0x70')]],'%s',_0x3e32d3):_0x3e32d3;_0x3e32d3=_0x24114a[_0xec620f][_0x285a('0x71')]?_[_0x285a('0x84')](_0x4a62d2[_0x24114a[_0xec620f][_0x285a('0x71')]],'%s',_0x3e32d3):_0x3e32d3;if(_0x24114a[_0xec620f][_0x285a('0x9e')]){_0x3028e4[_0x285a('0x64')](_0x3e32d3);}_0x24114a[_0xec620f]['orderBy']&&_0x3028e4['order'](_0x3e32d3,_0x24114a[_0xec620f]['orderBy']===_0x285a('0x74')?![]:!![]);_0x3028e4[_0x285a('0x65')](_0x3e32d3,_0x24114a[_0xec620f][_0x285a('0x85')]||_0x3e32d3);}if(_0x2436c4[_0x285a('0x75')]){_0x2436c4[_0x285a('0x75')]=JSON[_0x285a('0x76')](_0x2436c4[_0x285a('0x75')]);for(var _0x256599=0x0;_0x256599<_0x2436c4['joins']['length'];_0x256599+=0x1){if(_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x2f')]&&_[_0x285a('0x5f')](_0x597f62,_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x2f')])&&_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x77')]&&_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x7a')]&&_0x2436c4[_0x285a('0x75')][_0x256599]['foreignKey']){_0x3028e4[_0x2436c4['joins'][_0x256599][_0x285a('0x2f')]](_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x7a')],null,util[_0x285a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2436c4[_0x285a('0x6e')],_0x2436c4[_0x285a('0x75')][_0x256599]['parentKey'],_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x7a')],_0x2436c4[_0x285a('0x75')][_0x256599][_0x285a('0x78')]));}}}if(_0x2436c4[_0x285a('0x7b')]){_0x2436c4[_0x285a('0x7b')]=JSON[_0x285a('0x76')](_0x2436c4[_0x285a('0x7b')]);_0x3028e4[_0x285a('0x3c')](_0x59f74d(_0x2436c4[_0x285a('0x7b')]['group']));}_0x2b8a96=_0x3028e4['clone']();_0x3028e4[_0x285a('0x1f')](_0x21391d);_0x3028e4[_0x285a('0x1e')](0x0);logger['debug'](_0x285a('0x7c'),_0x3028e4[_0x285a('0x7d')]());return dbH['sequelize'][_0x285a('0x32')](_0x3028e4[_0x285a('0x7d')](),{'type':dbH[_0x285a('0x7e')][_0x285a('0x99')][_0x285a('0x9a')]});}})[_0x285a('0x25')](function(){return{'sql':_0x2b8a96[_0x285a('0x7d')]()};})[_0x285a('0x25')](respondWithResult(_0x49d5ac,null))['catch'](handleError(_0x49d5ac,null));};
\ No newline at end of file
+var _0xa6ac=['sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','rawAttributes','include','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','params','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','includes','IS\x20NULL','from','parentKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','savename','countTable','run','runReport','cross_join','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2f48a7,_0x54ea3c){var _0x3546f6=function(_0x2323d4){while(--_0x2323d4){_0x2f48a7['push'](_0x2f48a7['shift']());}};_0x3546f6(++_0x54ea3c);}(_0xa6ac,0x1c5));var _0xca6a=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0xa6ac[_0x1c7b4c];return _0x18daf6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca6a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca6a('0x1'));var rp=require(_0xca6a('0x2'));var moment=require(_0xca6a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xca6a('0x4'));var util=require(_0xca6a('0x5'));var path=require('path');var sox=require(_0xca6a('0x6'));var csv=require(_0xca6a('0x7'));var ejs=require(_0xca6a('0x8'));var fs=require('fs');var fs_extra=require(_0xca6a('0x9'));var _=require(_0xca6a('0xa'));var squel=require('squel');var crypto=require(_0xca6a('0xb'));var jsforce=require(_0xca6a('0xc'));var deskjs=require(_0xca6a('0xd'));var toCsv=require(_0xca6a('0x7'));var querystring=require('querystring');var Papa=require(_0xca6a('0xe'));var Redis=require(_0xca6a('0xf'));var authService=require(_0xca6a('0x10'));var qs=require(_0xca6a('0x11'));var as=require(_0xca6a('0x12'));var hardwareService=require(_0xca6a('0x13'));var logger=require(_0xca6a('0x14'))('api');var utils=require(_0xca6a('0x15'));var config=require(_0xca6a('0x16'));var licenseUtil=require(_0xca6a('0x17'));var db=require(_0xca6a('0x18'))['db'];var dbH=require('../../mysqldb')[_0xca6a('0x19')];function respondWithStatusCode(_0x178c0e,_0x26de88){_0x26de88=_0x26de88||0xcc;return function(_0x18535a){if(_0x18535a){return _0x178c0e[_0xca6a('0x1a')](_0x26de88);}return _0x178c0e[_0xca6a('0x1b')](_0x26de88)['end']();};}function respondWithResult(_0x9127aa,_0x3d9607){_0x3d9607=_0x3d9607||0xc8;return function(_0x12f82e){if(_0x12f82e){return _0x9127aa[_0xca6a('0x1b')](_0x3d9607)[_0xca6a('0x1c')](_0x12f82e);}};}function respondWithFilteredResult(_0x3c4e49,_0x3d8df0){return function(_0x4d0c94){if(_0x4d0c94){var _0x80b94f=typeof _0x3d8df0['offset']===_0xca6a('0x1d')&&typeof _0x3d8df0['limit']==='undefined';var _0x9422b6=_0x4d0c94['count'];var _0x4cf57a=_0x80b94f?0x0:_0x3d8df0[_0xca6a('0x1e')];var _0x4ed1d0=_0x80b94f?_0x4d0c94[_0xca6a('0x1f')]:_0x3d8df0[_0xca6a('0x1e')]+_0x3d8df0[_0xca6a('0x20')];var _0x5c2ea2;if(_0x4ed1d0>=_0x9422b6){_0x4ed1d0=_0x9422b6;_0x5c2ea2=0xc8;}else{_0x5c2ea2=0xce;}_0x3c4e49[_0xca6a('0x1b')](_0x5c2ea2);return _0x3c4e49[_0xca6a('0x21')]('Content-Range',_0x4cf57a+'-'+_0x4ed1d0+'/'+_0x9422b6)['json'](_0x4d0c94);}return null;};}function patchUpdates(_0x440c51){return function(_0x2bdfde){try{jsonpatch[_0xca6a('0x22')](_0x2bdfde,_0x440c51,!![]);}catch(_0x18589a){return BPromise[_0xca6a('0x23')](_0x18589a);}return _0x2bdfde[_0xca6a('0x24')]();};}function saveUpdates(_0x36c718,_0x3d2b8d){return function(_0x1f7aeb){if(_0x1f7aeb){return _0x1f7aeb[_0xca6a('0x25')](_0x36c718)[_0xca6a('0x26')](function(_0x4b654a){return _0x4b654a;});}return null;};}function removeEntity(_0x26e190,_0x5376ad){return function(_0x35cf35){if(_0x35cf35){return _0x35cf35[_0xca6a('0x27')]()[_0xca6a('0x26')](function(){var _0x5058e4=_0x35cf35[_0xca6a('0x28')]({'plain':!![]});var _0x10c808=_0xca6a('0x29');return db[_0xca6a('0x2a')][_0xca6a('0x27')]({'where':{'type':_0x10c808,'resourceId':_0x5058e4['id']}})[_0xca6a('0x26')](function(){return _0x35cf35;});})['then'](function(){_0x26e190[_0xca6a('0x1b')](0xcc)[_0xca6a('0x2b')]();});}};}function handleEntityNotFound(_0xbd4476,_0x449eed){return function(_0x233fdc){if(!_0x233fdc){_0xbd4476['sendStatus'](0x194);}return _0x233fdc;};}function handleError(_0x1b79e6,_0x5eaf5f){_0x5eaf5f=_0x5eaf5f||0x1f4;return function(_0x1049a6){logger[_0xca6a('0x2c')](_0x1049a6[_0xca6a('0x2d')]);if(_0x1049a6[_0xca6a('0x2e')]){delete _0x1049a6[_0xca6a('0x2e')];}_0x1b79e6[_0xca6a('0x1b')](_0x5eaf5f)[_0xca6a('0x2f')](_0x1049a6);};}exports[_0xca6a('0x30')]=function(_0x3bd8a2,_0x46ced6){var _0x4a5eed={},_0x8e9503={},_0x19d147={'count':0x0,'rows':[]};var _0x4c3432=_[_0xca6a('0x31')](db['AnalyticCustomReport']['rawAttributes'],function(_0x283aab){return{'name':_0x283aab[_0xca6a('0x32')],'type':_0x283aab[_0xca6a('0x33')][_0xca6a('0x34')]};});_0x8e9503['model']=_[_0xca6a('0x31')](_0x4c3432,'name');_0x8e9503['query']=_[_0xca6a('0x35')](_0x3bd8a2[_0xca6a('0x36')]);_0x8e9503['filters']=_[_0xca6a('0x37')](_0x8e9503[_0xca6a('0x38')],_0x8e9503[_0xca6a('0x36')]);_0x4a5eed[_0xca6a('0x39')]=_['intersection'](_0x8e9503['model'],qs[_0xca6a('0x3a')](_0x3bd8a2[_0xca6a('0x36')][_0xca6a('0x3a')]));_0x4a5eed['attributes']=_0x4a5eed[_0xca6a('0x39')][_0xca6a('0x3b')]?_0x4a5eed[_0xca6a('0x39')]:_0x8e9503[_0xca6a('0x38')];if(!_0x3bd8a2[_0xca6a('0x36')][_0xca6a('0x3c')](_0xca6a('0x3d'))){_0x4a5eed['limit']=qs[_0xca6a('0x20')](_0x3bd8a2[_0xca6a('0x36')][_0xca6a('0x20')]);_0x4a5eed[_0xca6a('0x1e')]=qs['offset'](_0x3bd8a2['query'][_0xca6a('0x1e')]);}_0x4a5eed[_0xca6a('0x3e')]=qs[_0xca6a('0x3f')](_0x3bd8a2['query'][_0xca6a('0x3f')]);_0x4a5eed[_0xca6a('0x40')]=qs[_0xca6a('0x41')](_[_0xca6a('0x42')](_0x3bd8a2[_0xca6a('0x36')],_0x8e9503[_0xca6a('0x41')]),_0x4c3432);if(_0x3bd8a2[_0xca6a('0x36')]['filter']){_0x4a5eed[_0xca6a('0x40')]=_[_0xca6a('0x43')](_0x4a5eed[_0xca6a('0x40')],{'$or':_[_0xca6a('0x31')](_0x4c3432,function(_0x3db59a){if(_0x3db59a[_0xca6a('0x33')]!==_0xca6a('0x44')){var _0x72a22a={};_0x72a22a[_0x3db59a[_0xca6a('0x2e')]]={'$like':'%'+_0x3bd8a2[_0xca6a('0x36')][_0xca6a('0x45')]+'%'};return _0x72a22a;}})});}_0x4a5eed=_[_0xca6a('0x43')]({},_0x4a5eed,_0x3bd8a2[_0xca6a('0x46')]);var _0x27ca70={'where':_0x4a5eed[_0xca6a('0x40')]};return db[_0xca6a('0x47')]['count'](_0x27ca70)[_0xca6a('0x26')](function(_0x128ede){_0x19d147[_0xca6a('0x1f')]=_0x128ede;if(_0x3bd8a2['query'][_0xca6a('0x48')]){_0x4a5eed['include']=[{'all':!![]}];}return db[_0xca6a('0x47')][_0xca6a('0x49')](_0x4a5eed);})[_0xca6a('0x26')](function(_0x5b87f5){_0x19d147[_0xca6a('0x4a')]=_0x5b87f5;return _0x19d147;})[_0xca6a('0x26')](respondWithFilteredResult(_0x46ced6,_0x4a5eed))[_0xca6a('0x4b')](handleError(_0x46ced6,null));};exports[_0xca6a('0x4c')]=function(_0x39c3bb,_0x289dc4){var _0x49f3b2={'raw':![],'where':{'id':_0x39c3bb['params']['id']}},_0x1396a1={};_0x1396a1['model']=_[_0xca6a('0x35')](db[_0xca6a('0x47')][_0xca6a('0x4d')]);_0x1396a1[_0xca6a('0x36')]=_[_0xca6a('0x35')](_0x39c3bb[_0xca6a('0x36')]);_0x1396a1[_0xca6a('0x41')]=_[_0xca6a('0x37')](_0x1396a1[_0xca6a('0x38')],_0x1396a1[_0xca6a('0x36')]);_0x49f3b2[_0xca6a('0x39')]=_['intersection'](_0x1396a1[_0xca6a('0x38')],qs[_0xca6a('0x3a')](_0x39c3bb['query']['fields']));_0x49f3b2['attributes']=_0x49f3b2[_0xca6a('0x39')]['length']?_0x49f3b2['attributes']:_0x1396a1['model'];if(_0x39c3bb['query']['includeAll']){_0x49f3b2[_0xca6a('0x4e')]=[{'all':!![]}];}_0x49f3b2=_[_0xca6a('0x43')]({},_0x49f3b2,_0x39c3bb[_0xca6a('0x46')]);return db['AnalyticCustomReport'][_0xca6a('0x4f')](_0x49f3b2)[_0xca6a('0x26')](handleEntityNotFound(_0x289dc4,null))['then'](respondWithResult(_0x289dc4,null))['catch'](handleError(_0x289dc4,null));};exports[_0xca6a('0x50')]=function(_0xc1fc01,_0x417c73){return db[_0xca6a('0x47')][_0xca6a('0x50')](_0xc1fc01[_0xca6a('0x51')],{})['then'](function(_0x227d1e){var _0xf34a21=_0xc1fc01[_0xca6a('0x52')]['get']({'plain':!![]});if(!_0xf34a21)throw new Error(_0xca6a('0x53'));if(_0xf34a21[_0xca6a('0x54')]===_0xca6a('0x52')){var _0x2f063a=_0x227d1e[_0xca6a('0x28')]({'plain':!![]});var _0x68be3a=_0xca6a('0x55');return db[_0xca6a('0x56')]['find']({'where':{'name':_0x68be3a,'userProfileId':_0xf34a21[_0xca6a('0x57')]},'raw':!![]})['then'](function(_0x4cc7f7){if(_0x4cc7f7&&_0x4cc7f7[_0xca6a('0x58')]===0x0){return db['UserProfileResource'][_0xca6a('0x50')]({'name':_0x2f063a[_0xca6a('0x2e')],'resourceId':_0x2f063a['id'],'type':_0xca6a('0x29'),'sectionId':_0x4cc7f7['id']},{})['then'](function(){return _0x227d1e;});}else{return _0x227d1e;}})[_0xca6a('0x4b')](function(_0x3bda44){logger[_0xca6a('0x2c')](_0xca6a('0x59'),_0x3bda44);throw _0x3bda44;});}return _0x227d1e;})[_0xca6a('0x26')](respondWithResult(_0x417c73,0xc9))['catch'](handleError(_0x417c73,null));};exports[_0xca6a('0x25')]=function(_0x849943,_0x5b462a){if(_0x849943[_0xca6a('0x51')]['id']){delete _0x849943['body']['id'];}return db[_0xca6a('0x47')]['find']({'where':{'id':_0x849943[_0xca6a('0x5a')]['id']}})[_0xca6a('0x26')](handleEntityNotFound(_0x5b462a,null))[_0xca6a('0x26')](saveUpdates(_0x849943[_0xca6a('0x51')],null))['then'](respondWithResult(_0x5b462a,null))[_0xca6a('0x4b')](handleError(_0x5b462a,null));};exports['destroy']=function(_0x31d950,_0x267f44){return db[_0xca6a('0x47')][_0xca6a('0x4f')]({'where':{'id':_0x31d950[_0xca6a('0x5a')]['id']}})[_0xca6a('0x26')](handleEntityNotFound(_0x267f44,null))[_0xca6a('0x26')](removeEntity(_0x267f44,null))[_0xca6a('0x4b')](handleError(_0x267f44,null));};exports[_0xca6a('0x5b')]=function(_0x1862b7,_0x3e6f15){var _0x52fe54=0xa;var _0x587a87=[_0xca6a('0x5c'),_0xca6a('0x5d'),_0xca6a('0x5e'),'cross_join'];var _0x211f55={'SUM':_0xca6a('0x5f'),'COUNT':_0xca6a('0x60'),'COUNT DISTINCT':_0xca6a('0x61'),'MAX':_0xca6a('0x62'),'MIN':_0xca6a('0x63'),'AVG':_0xca6a('0x64'),'GROUP_CONCAT':_0xca6a('0x65'),'GROUP_CONCAT ASC':_0xca6a('0x66'),'GROUP_CONCAT DESC':_0xca6a('0x67')};var _0x2072c6={'SEC_TO_TIME':_0xca6a('0x68'),'DATE':_0xca6a('0x69'),'HOUR':_0xca6a('0x6a'),'ROUND':_0xca6a('0x6b'),'UNIX_TIMESTAMP':_0xca6a('0x6c')};var _0x192b6f=function(_0x131a3e){return!_['includes'](['IS\x20NULL',_0xca6a('0x6d'),_0xca6a('0x6e'),_0xca6a('0x6f')],_0x131a3e);};var _0x4f61de=function(_0x4e5994){if(!_0x4e5994||!_0x4e5994[_0xca6a('0x70')][_0xca6a('0x3b')]){return'';}for(var _0x38f411='(',_0x169715=0x0;_0x169715<_0x4e5994[_0xca6a('0x70')][_0xca6a('0x3b')];_0x169715+=0x1){_0x169715>0x0&&(_0x38f411+='\x20'+_0x4e5994[_0xca6a('0x71')]+'\x20');_0x38f411+=_0x4e5994['rules'][_0x169715][_0xca6a('0x72')]?_0x4f61de(_0x4e5994['rules'][_0x169715]['group']):_0x4e5994[_0xca6a('0x70')][_0x169715][_0xca6a('0x73')]+'\x20'+_0x4e5994[_0xca6a('0x70')][_0x169715][_0xca6a('0x74')]+(_0x192b6f(_0x4e5994[_0xca6a('0x70')][_0x169715][_0xca6a('0x74')])?'\x20'+_0x4e5994[_0xca6a('0x70')][_0x169715][_0xca6a('0x75')]:'');}return _0x38f411+')';};var _0x701629={'where':{'id':_0x1862b7[_0xca6a('0x5a')]['id']}},_0x41f125,_0x5c8f23,_0x21b93d,_0x491540,_0x53f94c;_0x701629=_[_0xca6a('0x43')]({},_0x701629,_0x1862b7[_0xca6a('0x46')]);return db['AnalyticCustomReport']['find'](_0x701629)[_0xca6a('0x26')](function(_0x56c799){if(_0x56c799){_0x41f125=_0x56c799;return _0x56c799[_0xca6a('0x76')]();}return null;})['then'](function(_0x1b489c){if(_0x1b489c){if(!_0x1b489c[_0xca6a('0x3b')]){throw new db[(_0xca6a('0x77'))][(_0xca6a('0x78'))](_0xca6a('0x79'),0x193);}_0x5c8f23=_0x1b489c;return db[_0xca6a('0x7a')][_0xca6a('0x49')]({'raw':!![]});}return null;})[_0xca6a('0x26')](function(_0x31cf39){if(_0x31cf39){_0x21b93d=_[_0xca6a('0x7b')](_0x31cf39,'id');var _0x2a2734;var _0x5e653d=squel[_0xca6a('0x7c')]();_0x5e653d['from'](_0x41f125[_0xca6a('0x7d')]);for(var _0x5c8ef9=0x0;_0x5c8ef9<_0x5c8f23[_0xca6a('0x3b')];_0x5c8ef9+=0x1){_0x2a2734=_0x5c8f23[_0x5c8ef9][_0xca6a('0x7e')]?_0x21b93d[_0x5c8f23[_0x5c8ef9][_0xca6a('0x7e')]][_0xca6a('0x7f')]:_0x5c8f23[_0x5c8ef9][_0xca6a('0x73')];_0x2a2734=_0x5c8f23[_0x5c8ef9][_0xca6a('0x80')]?_[_0xca6a('0x81')](_0x211f55[_0x5c8f23[_0x5c8ef9][_0xca6a('0x80')]],'%s',_0x2a2734):_0x2a2734;_0x2a2734=_0x5c8f23[_0x5c8ef9][_0xca6a('0x82')]?_[_0xca6a('0x81')](_0x2072c6[_0x5c8f23[_0x5c8ef9][_0xca6a('0x82')]],'%s',_0x2a2734):_0x2a2734;if(_0x5c8f23[_0x5c8ef9][_0xca6a('0x83')]){_0x5e653d[_0xca6a('0x72')](_0x2a2734);}_0x5c8f23[_0x5c8ef9][_0xca6a('0x84')]&&_0x5e653d[_0xca6a('0x3e')](_0x2a2734,_0x5c8f23[_0x5c8ef9]['orderBy']==='DESC'?![]:!![]);_0x5e653d[_0xca6a('0x73')](_0x2a2734,_0x5c8f23[_0x5c8ef9][_0xca6a('0x85')]||_0x2a2734);}if(_0x41f125[_0xca6a('0x86')]){_0x41f125[_0xca6a('0x86')]=JSON[_0xca6a('0x87')](_0x41f125[_0xca6a('0x86')]);for(var _0xd45468=0x0;_0xd45468<_0x41f125[_0xca6a('0x86')][_0xca6a('0x3b')];_0xd45468+=0x1){if(_0x41f125[_0xca6a('0x86')][_0xd45468][_0xca6a('0x33')]&&_['includes'](_0x587a87,_0x41f125['joins'][_0xd45468][_0xca6a('0x33')])&&_0x41f125[_0xca6a('0x86')][_0xd45468]['parentKey']&&_0x41f125[_0xca6a('0x86')][_0xd45468][_0xca6a('0x88')]&&_0x41f125[_0xca6a('0x86')][_0xd45468][_0xca6a('0x89')]){_0x5e653d[_0x41f125['joins'][_0xd45468][_0xca6a('0x33')]](_0x41f125[_0xca6a('0x86')][_0xd45468][_0xca6a('0x88')],null,util[_0xca6a('0x82')](_0xca6a('0x8a'),_0x41f125[_0xca6a('0x7d')],_0x41f125[_0xca6a('0x86')][_0xd45468]['parentKey'],_0x41f125[_0xca6a('0x86')][_0xd45468][_0xca6a('0x88')],_0x41f125[_0xca6a('0x86')][_0xd45468][_0xca6a('0x89')]));}}}if(_0x41f125['conditions']){_0x41f125['conditions']=JSON[_0xca6a('0x87')](_0x41f125['conditions']);_0x5e653d['where'](_0x4f61de(_0x41f125[_0xca6a('0x8b')][_0xca6a('0x72')]));}_0x53f94c=_0x5e653d[_0xca6a('0x8c')]();_0x5e653d[_0xca6a('0x20')](_0x52fe54);_0x5e653d[_0xca6a('0x1e')](0x0);logger[_0xca6a('0x8d')](_0xca6a('0x8e'),_0x5e653d[_0xca6a('0x8f')]());return dbH[_0xca6a('0x90')][_0xca6a('0x36')](_0x5e653d[_0xca6a('0x8f')](),{'type':dbH[_0xca6a('0x90')][_0xca6a('0x91')][_0xca6a('0x92')]});}})['then'](respondWithResult(_0x3e6f15,null))[_0xca6a('0x4b')](handleError(_0x3e6f15,null));};function runReport(_0x23dae3,_0x4bec51,_0x12837e){var _0x1e8525=_0x4bec51[_0xca6a('0x2e')];var _0x483954=0xa;var _0x3714ac=['join',_0xca6a('0x5d'),_0xca6a('0x5e'),'cross_join'];var _0x34bac2={'SUM':_0xca6a('0x5f'),'COUNT':_0xca6a('0x60'),'COUNT DISTINCT':_0xca6a('0x61'),'MAX':_0xca6a('0x62'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xca6a('0x65'),'GROUP_CONCAT ASC':_0xca6a('0x66'),'GROUP_CONCAT DESC':_0xca6a('0x67')};var _0x25c3e1={'SEC_TO_TIME':_0xca6a('0x68'),'DATE':_0xca6a('0x69'),'HOUR':_0xca6a('0x6a'),'ROUND':_0xca6a('0x6b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c5636=function(_0x3a2798){return!_[_0xca6a('0x93')]([_0xca6a('0x94'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xca6a('0x6f')],_0x3a2798);};var _0x5a0b0c=function(_0xb2c615){if(!_0xb2c615||!_0xb2c615['rules'][_0xca6a('0x3b')]){return'';}for(var _0x24dc07='(',_0x2f5ca2=0x0;_0x2f5ca2<_0xb2c615[_0xca6a('0x70')][_0xca6a('0x3b')];_0x2f5ca2+=0x1){_0x2f5ca2>0x0&&(_0x24dc07+='\x20'+_0xb2c615[_0xca6a('0x71')]+'\x20');_0x24dc07+=_0xb2c615[_0xca6a('0x70')][_0x2f5ca2][_0xca6a('0x72')]?_0x5a0b0c(_0xb2c615['rules'][_0x2f5ca2][_0xca6a('0x72')]):_0xb2c615['rules'][_0x2f5ca2][_0xca6a('0x73')]+'\x20'+_0xb2c615[_0xca6a('0x70')][_0x2f5ca2]['condition']+(_0x1c5636(_0xb2c615[_0xca6a('0x70')][_0x2f5ca2][_0xca6a('0x74')])?'\x20'+_0xb2c615[_0xca6a('0x70')][_0x2f5ca2]['value']:'');}return _0x24dc07+')';};var _0x64fdff={'where':{'id':_0x23dae3['id']}},_0x2e4d69,_0x4bde61,_0x574e44,_0x47ba73,_0x2fbcab;_0x64fdff=_['merge']({},_0x64fdff,_0x12837e);return db['AnalyticCustomReport'][_0xca6a('0x4f')](_0x64fdff)[_0xca6a('0x26')](function(_0x35eb5e){if(_0x35eb5e){_0x2e4d69=_0x35eb5e;return _0x35eb5e[_0xca6a('0x76')]();}return null;})['then'](function(_0x1f9936){if(_0x1f9936){if(!_0x1f9936['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xca6a('0x79'),0x193);}_0x4bde61=_0x1f9936;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x34a588){if(_0x34a588){_0x574e44=_['keyBy'](_0x34a588,'id');var _0x32674b;var _0x50b9bc=squel[_0xca6a('0x7c')]();_0x50b9bc[_0xca6a('0x95')](_0x2e4d69[_0xca6a('0x7d')]);for(var _0x16a187=0x0;_0x16a187<_0x4bde61['length'];_0x16a187+=0x1){_0x32674b=_0x4bde61[_0x16a187][_0xca6a('0x7e')]?_0x574e44[_0x4bde61[_0x16a187][_0xca6a('0x7e')]][_0xca6a('0x7f')]:_0x4bde61[_0x16a187][_0xca6a('0x73')];_0x32674b=_0x4bde61[_0x16a187][_0xca6a('0x80')]?_[_0xca6a('0x81')](_0x34bac2[_0x4bde61[_0x16a187][_0xca6a('0x80')]],'%s',_0x32674b):_0x32674b;_0x32674b=_0x4bde61[_0x16a187][_0xca6a('0x82')]?_[_0xca6a('0x81')](_0x25c3e1[_0x4bde61[_0x16a187]['format']],'%s',_0x32674b):_0x32674b;if(_0x4bde61[_0x16a187]['groupBy']){_0x50b9bc[_0xca6a('0x72')](_0x32674b);}_0x4bde61[_0x16a187]['orderBy']&&_0x50b9bc[_0xca6a('0x3e')](_0x32674b,_0x4bde61[_0x16a187][_0xca6a('0x84')]==='DESC'?![]:!![]);_0x50b9bc[_0xca6a('0x73')](_0x32674b,_0x4bde61[_0x16a187][_0xca6a('0x85')]||_0x32674b);}if(_0x2e4d69[_0xca6a('0x86')]){_0x2e4d69[_0xca6a('0x86')]=JSON[_0xca6a('0x87')](_0x2e4d69[_0xca6a('0x86')]);for(var _0x3dd397=0x0;_0x3dd397<_0x2e4d69[_0xca6a('0x86')][_0xca6a('0x3b')];_0x3dd397+=0x1){if(_0x2e4d69[_0xca6a('0x86')][_0x3dd397]['type']&&_[_0xca6a('0x93')](_0x3714ac,_0x2e4d69[_0xca6a('0x86')][_0x3dd397][_0xca6a('0x33')])&&_0x2e4d69[_0xca6a('0x86')][_0x3dd397]['parentKey']&&_0x2e4d69['joins'][_0x3dd397][_0xca6a('0x88')]&&_0x2e4d69[_0xca6a('0x86')][_0x3dd397][_0xca6a('0x89')]){_0x50b9bc[_0x2e4d69['joins'][_0x3dd397][_0xca6a('0x33')]](_0x2e4d69[_0xca6a('0x86')][_0x3dd397][_0xca6a('0x88')],null,util['format'](_0xca6a('0x8a'),_0x2e4d69[_0xca6a('0x7d')],_0x2e4d69[_0xca6a('0x86')][_0x3dd397][_0xca6a('0x96')],_0x2e4d69[_0xca6a('0x86')][_0x3dd397][_0xca6a('0x88')],_0x2e4d69[_0xca6a('0x86')][_0x3dd397][_0xca6a('0x89')]));}}}if(_0x2e4d69[_0xca6a('0x8b')]){_0x2e4d69[_0xca6a('0x8b')]=JSON['parse'](_0x2e4d69[_0xca6a('0x8b')]);_0x50b9bc['where'](_0x5a0b0c(_0x2e4d69['conditions']['group']));}_0x2fbcab=_0x50b9bc[_0xca6a('0x8c')]();_0x50b9bc[_0xca6a('0x20')](_0x483954);_0x50b9bc[_0xca6a('0x1e')](0x0);return;}})[_0xca6a('0x26')](function(){if(_0x4bec51[_0xca6a('0x97')]===_0xca6a('0x98')){return null;}var _0x52f80e=_[_0xca6a('0x43')](_0x4bec51,{'name':_0x4bec51[_0xca6a('0x99')]||_0x4bec51['name']||_0x2e4d69[_0xca6a('0x2e')],'basename':_0x1e8525,'savename':util['format'](_0xca6a('0x9a'),_0x4bec51['name']||_0x2e4d69[_0xca6a('0x2e')],require(_0xca6a('0x9b'))[_0xca6a('0x9c')](0x4),_0x4bec51[_0xca6a('0x97')]||_0xca6a('0x9d')),'reportId':_0x2e4d69['id'],'reportType':'custom'});return db[_0xca6a('0x9e')][_0xca6a('0x50')](_0x52f80e,{'raw':!![]});})[_0xca6a('0x26')](function(_0xe191f5){if(_0x2e4d69[_0xca6a('0x7d')]===_0xca6a('0x9f')){_0x2fbcab[_0xca6a('0x40')](_0x2e4d69[_0xca6a('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4bec51['startDate'],_0x4bec51[_0xca6a('0xa0')]);}else{_0x2fbcab[_0xca6a('0x40')](_0x2e4d69[_0xca6a('0x7d')]+_0xca6a('0xa1'),_0x4bec51[_0xca6a('0xa2')],_0x4bec51[_0xca6a('0xa0')]);}if(_0xe191f5){logger[_0xca6a('0xa3')](_0xca6a('0xa4'),_0x2fbcab[_0xca6a('0x8f')]());require('child_process')[_0xca6a('0xa5')](path[_0xca6a('0x5c')](__dirname,_0xca6a('0xa6'),_0xe191f5[_0xca6a('0x97')]),[_0xe191f5['id'],_0x2fbcab[_0xca6a('0x8f')](),path['join'](__dirname,'../../files/reports',_0xe191f5[_0xca6a('0xa7')]),_0x1e8525]);return _0xe191f5;}else{var _0x188b8f=squel['select']();_0x188b8f[_0xca6a('0x95')]('('+_0x2fbcab[_0xca6a('0x8f')]()+')',_0xca6a('0xa8'));_0x188b8f['field']('COUNT(*)','count');_0x2fbcab['limit'](_0x4bec51[_0xca6a('0x20')]||_0x483954);_0x2fbcab[_0xca6a('0x1e')](_0x4bec51[_0xca6a('0x1e')]||0x0);return dbH[_0xca6a('0x90')][_0xca6a('0x36')](_0x188b8f[_0xca6a('0x8f')](),{'type':dbH[_0xca6a('0x90')][_0xca6a('0x91')][_0xca6a('0x92')]})['then'](function(_0x503c43){if(!_0x503c43[_0xca6a('0x3b')]){_0x47ba73=0x0;}else{_0x47ba73=_0x503c43[0x0]['count']||0x0;}return dbH[_0xca6a('0x90')][_0xca6a('0x36')](_0x2fbcab['toString'](),{'type':dbH['sequelize'][_0xca6a('0x91')][_0xca6a('0x92')]});})[_0xca6a('0x26')](function(_0xbe6f96){return{'rows':_0xbe6f96||[],'count':_0x47ba73};});}});}exports[_0xca6a('0xa9')]=function(_0xcdf24c,_0x443a2c){return runReport(_0xcdf24c['params'],_0xcdf24c[_0xca6a('0x36')],_0xcdf24c['options'])[_0xca6a('0x26')](respondWithResult(_0x443a2c,null))[_0xca6a('0x4b')](handleError(_0x443a2c,null));};exports[_0xca6a('0xaa')]=runReport;exports[_0xca6a('0x36')]=function(_0x566e03,_0x305a65){var _0x30e005=0xa;var _0x7013e9=['join','left_join',_0xca6a('0x5e'),_0xca6a('0xab')];var _0x51d7b3={'SUM':'SUM(%s)','COUNT':_0xca6a('0x60'),'COUNT DISTINCT':_0xca6a('0x61'),'MAX':_0xca6a('0x62'),'MIN':_0xca6a('0x63'),'AVG':_0xca6a('0x64'),'GROUP_CONCAT':_0xca6a('0x65'),'GROUP_CONCAT ASC':_0xca6a('0x66'),'GROUP_CONCAT DESC':_0xca6a('0x67')};var _0x58134a={'SEC_TO_TIME':_0xca6a('0x68'),'DATE':'DATE(%s)','HOUR':_0xca6a('0x6a'),'ROUND':_0xca6a('0x6b'),'UNIX_TIMESTAMP':_0xca6a('0x6c')};var _0x568fd3=function(_0xcfe129){return!_['includes']([_0xca6a('0x94'),_0xca6a('0x6d'),_0xca6a('0x6e'),_0xca6a('0x6f')],_0xcfe129);};var _0x450af8=function(_0x5d8a26){if(!_0x5d8a26||!_0x5d8a26[_0xca6a('0x70')][_0xca6a('0x3b')]){return'';}for(var _0xb8c3ae='(',_0x36f80d=0x0;_0x36f80d<_0x5d8a26[_0xca6a('0x70')][_0xca6a('0x3b')];_0x36f80d+=0x1){_0x36f80d>0x0&&(_0xb8c3ae+='\x20'+_0x5d8a26[_0xca6a('0x71')]+'\x20');_0xb8c3ae+=_0x5d8a26['rules'][_0x36f80d][_0xca6a('0x72')]?_0x450af8(_0x5d8a26['rules'][_0x36f80d][_0xca6a('0x72')]):_0x5d8a26[_0xca6a('0x70')][_0x36f80d][_0xca6a('0x73')]+'\x20'+_0x5d8a26[_0xca6a('0x70')][_0x36f80d][_0xca6a('0x74')]+(_0x568fd3(_0x5d8a26['rules'][_0x36f80d][_0xca6a('0x74')])?'\x20'+_0x5d8a26['rules'][_0x36f80d][_0xca6a('0x75')]:'');}return _0xb8c3ae+')';};var _0x3325c7={'where':{'id':_0x566e03[_0xca6a('0x5a')]['id']}},_0x2b74d8,_0x59ee13,_0x4ebf7f,_0x43d2ad,_0x270b8e;_0x3325c7=_['merge']({},_0x3325c7,_0x566e03['options']);return db[_0xca6a('0x47')]['find'](_0x3325c7)[_0xca6a('0x26')](function(_0x2538f8){if(_0x2538f8){_0x2b74d8=_0x2538f8;return _0x2538f8[_0xca6a('0x76')]();}return null;})[_0xca6a('0x26')](function(_0x3db87e){if(_0x3db87e){if(!_0x3db87e[_0xca6a('0x3b')]){throw new db[(_0xca6a('0x77'))][(_0xca6a('0x78'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x59ee13=_0x3db87e;return db[_0xca6a('0x7a')][_0xca6a('0x49')]({'raw':!![]});}return null;})[_0xca6a('0x26')](function(_0x1fef32){if(_0x1fef32){_0x4ebf7f=_[_0xca6a('0x7b')](_0x1fef32,'id');var _0x4c72fc;var _0x51f485=squel[_0xca6a('0x7c')]();_0x51f485[_0xca6a('0x95')](_0x2b74d8[_0xca6a('0x7d')]);for(var _0x3aff12=0x0;_0x3aff12<_0x59ee13[_0xca6a('0x3b')];_0x3aff12+=0x1){_0x4c72fc=_0x59ee13[_0x3aff12][_0xca6a('0x7e')]?_0x4ebf7f[_0x59ee13[_0x3aff12][_0xca6a('0x7e')]][_0xca6a('0x7f')]:_0x59ee13[_0x3aff12][_0xca6a('0x73')];_0x4c72fc=_0x59ee13[_0x3aff12][_0xca6a('0x80')]?_[_0xca6a('0x81')](_0x51d7b3[_0x59ee13[_0x3aff12]['function']],'%s',_0x4c72fc):_0x4c72fc;_0x4c72fc=_0x59ee13[_0x3aff12][_0xca6a('0x82')]?_[_0xca6a('0x81')](_0x58134a[_0x59ee13[_0x3aff12]['format']],'%s',_0x4c72fc):_0x4c72fc;if(_0x59ee13[_0x3aff12][_0xca6a('0x83')]){_0x51f485['group'](_0x4c72fc);}_0x59ee13[_0x3aff12][_0xca6a('0x84')]&&_0x51f485['order'](_0x4c72fc,_0x59ee13[_0x3aff12][_0xca6a('0x84')]==='DESC'?![]:!![]);_0x51f485['field'](_0x4c72fc,_0x59ee13[_0x3aff12]['alias']||_0x4c72fc);}if(_0x2b74d8[_0xca6a('0x86')]){_0x2b74d8[_0xca6a('0x86')]=JSON[_0xca6a('0x87')](_0x2b74d8['joins']);for(var _0x64607c=0x0;_0x64607c<_0x2b74d8[_0xca6a('0x86')][_0xca6a('0x3b')];_0x64607c+=0x1){if(_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x33')]&&_[_0xca6a('0x93')](_0x7013e9,_0x2b74d8[_0xca6a('0x86')][_0x64607c]['type'])&&_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x96')]&&_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x88')]&&_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x89')]){_0x51f485[_0x2b74d8[_0xca6a('0x86')][_0x64607c]['type']](_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x88')],null,util['format'](_0xca6a('0x8a'),_0x2b74d8[_0xca6a('0x7d')],_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x96')],_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x88')],_0x2b74d8[_0xca6a('0x86')][_0x64607c][_0xca6a('0x89')]));}}}if(_0x2b74d8['conditions']){_0x2b74d8[_0xca6a('0x8b')]=JSON[_0xca6a('0x87')](_0x2b74d8[_0xca6a('0x8b')]);_0x51f485[_0xca6a('0x40')](_0x450af8(_0x2b74d8[_0xca6a('0x8b')][_0xca6a('0x72')]));}_0x270b8e=_0x51f485[_0xca6a('0x8c')]();_0x51f485[_0xca6a('0x20')](_0x30e005);_0x51f485[_0xca6a('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x51f485[_0xca6a('0x8f')]());return dbH[_0xca6a('0x90')]['query'](_0x51f485['toString'](),{'type':dbH[_0xca6a('0x90')][_0xca6a('0x91')][_0xca6a('0x92')]});}})['then'](function(){return{'sql':_0x270b8e[_0xca6a('0x8f')]()};})['then'](respondWithResult(_0x305a65,null))[_0xca6a('0x4b')](handleError(_0x305a65,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9607=['AnalyticCustomReport','analytics_custom_reports','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x274ac0,_0x3fe60b){var _0x2cf969=function(_0x1c8dcc){while(--_0x1c8dcc){_0x274ac0['push'](_0x274ac0['shift']());}};_0x2cf969(++_0x3fe60b);}(_0x9607,0x122));var _0x7960=function(_0x1e8e6e,_0x562d6c){_0x1e8e6e=_0x1e8e6e-0x0;var _0x53bff6=_0x9607[_0x1e8e6e];return _0x53bff6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7960('0x0'));var moment=require(_0x7960('0x1'));var BPromise=require(_0x7960('0x2'));var rp=require(_0x7960('0x3'));var fs=require('fs');var path=require(_0x7960('0x4'));var rimraf=require(_0x7960('0x5'));var config=require(_0x7960('0x6'));var attributes=require(_0x7960('0x7'));module[_0x7960('0x8')]=function(_0x1276cc,_0x100c49){return _0x1276cc[_0x7960('0x9')](_0x7960('0xa'),attributes,{'tableName':_0x7960('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x93eb=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport'];(function(_0x43424a,_0x33c533){var _0x4b0664=function(_0x4c5c2c){while(--_0x4c5c2c){_0x43424a['push'](_0x43424a['shift']());}};_0x4b0664(++_0x33c533);}(_0x93eb,0x1c8));var _0xb93e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x93eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb93e('0x0'));var util=require(_0xb93e('0x1'));var logger=require(_0xb93e('0x2'))(_0xb93e('0x3'));var moment=require(_0xb93e('0x4'));var BPromise=require(_0xb93e('0x5'));var rp=require(_0xb93e('0x6'));var fs=require('fs');var path=require(_0xb93e('0x7'));var rimraf=require(_0xb93e('0x8'));var config=require('../../config/environment');var attributes=require(_0xb93e('0x9'));module['exports']=function(_0x53ad8a,_0x215b76){return _0x53ad8a[_0xb93e('0xa')](_0xb93e('0xb'),attributes,{'tableName':_0xb93e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5181=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5181,0x69));var _0x1518=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x5181[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x1518('0x0'));var util=require(_0x1518('0x1'));var moment=require(_0x1518('0x2'));var BPromise=require(_0x1518('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1518('0x4'))['db'];var utils=require(_0x1518('0x5'));var logger=require(_0x1518('0x6'))('rpc');var config=require(_0x1518('0x7'));var jayson=require(_0x1518('0x8'));var client=jayson[_0x1518('0x9')][_0x1518('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d609f,_0x56fa30,_0x25ad4d){return new BPromise(function(_0xb9f733,_0x4b31a3){return client[_0x1518('0xb')](_0x4d609f,_0x25ad4d)[_0x1518('0xc')](function(_0x3e6559){logger[_0x1518('0xd')](_0x1518('0xe'),_0x56fa30,_0x1518('0xf'));logger[_0x1518('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x56fa30,_0x1518('0xf'),JSON[_0x1518('0x11')](_0x3e6559));if(_0x3e6559['error']){if(_0x3e6559[_0x1518('0x12')][_0x1518('0x13')]===0x1f4){logger[_0x1518('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x56fa30,_0x3e6559[_0x1518('0x12')][_0x1518('0x14')]);return _0x4b31a3(_0x3e6559[_0x1518('0x12')][_0x1518('0x14')]);}logger[_0x1518('0x12')](_0x1518('0xe'),_0x56fa30,_0x3e6559[_0x1518('0x12')][_0x1518('0x14')]);return _0xb9f733(_0x3e6559[_0x1518('0x12')]['message']);}else{logger[_0x1518('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x56fa30,'request\x20sent');_0xb9f733(_0x3e6559[_0x1518('0x15')][_0x1518('0x14')]);}})[_0x1518('0x16')](function(_0x187530){logger[_0x1518('0x12')](_0x1518('0xe'),_0x56fa30,_0x187530);_0x4b31a3(_0x187530);});});}
\ No newline at end of file
+var _0x5cec=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x5ac7d7,_0x109040){var _0x23955f=function(_0x52a2ac){while(--_0x52a2ac){_0x5ac7d7['push'](_0x5ac7d7['shift']());}};_0x23955f(++_0x109040);}(_0x5cec,0xf2));var _0xc5ce=function(_0xc976ee,_0x57e744){_0xc976ee=_0xc976ee-0x0;var _0xd9d2e5=_0x5cec[_0xc976ee];return _0xd9d2e5;};'use strict';var _=require(_0xc5ce('0x0'));var util=require(_0xc5ce('0x1'));var moment=require(_0xc5ce('0x2'));var BPromise=require(_0xc5ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5ce('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5ce('0x5'));var logger=require(_0xc5ce('0x6'))('rpc');var config=require(_0xc5ce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc5ce('0x8')][_0xc5ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36dc43,_0x247d71,_0x37942e){return new BPromise(function(_0x3818cd,_0x2e6459){return client[_0xc5ce('0xa')](_0x36dc43,_0x37942e)[_0xc5ce('0xb')](function(_0x4604db){logger[_0xc5ce('0xc')](_0xc5ce('0xd'),_0x247d71,_0xc5ce('0xe'));logger[_0xc5ce('0xf')](_0xc5ce('0x10'),_0x247d71,_0xc5ce('0xe'),JSON['stringify'](_0x4604db));if(_0x4604db['error']){if(_0x4604db[_0xc5ce('0x11')]['code']===0x1f4){logger[_0xc5ce('0x11')](_0xc5ce('0xd'),_0x247d71,_0x4604db[_0xc5ce('0x11')][_0xc5ce('0x12')]);return _0x2e6459(_0x4604db[_0xc5ce('0x11')][_0xc5ce('0x12')]);}logger[_0xc5ce('0x11')](_0xc5ce('0xd'),_0x247d71,_0x4604db[_0xc5ce('0x11')][_0xc5ce('0x12')]);return _0x3818cd(_0x4604db[_0xc5ce('0x11')][_0xc5ce('0x12')]);}else{logger[_0xc5ce('0xc')](_0xc5ce('0xd'),_0x247d71,_0xc5ce('0xe'));_0x3818cd(_0x4604db[_0xc5ce('0x13')][_0xc5ce('0x12')]);}})[_0xc5ce('0x14')](function(_0x3d8c60){logger[_0xc5ce('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x247d71,_0x3d8c60);_0x2e6459(_0x3d8c60);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6af9=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','query','post','create','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0xe3b618,_0x12f3c6){var _0x580c2c=function(_0x5e2ff7){while(--_0x5e2ff7){_0xe3b618['push'](_0xe3b618['shift']());}};_0x580c2c(++_0x12f3c6);}(_0x6af9,0x1dc));var _0x96af=function(_0x42d324,_0x53b865){_0x42d324=_0x42d324-0x0;var _0x5afd74=_0x6af9[_0x42d324];return _0x5afd74;};'use strict';var multer=require(_0x96af('0x0'));var util=require(_0x96af('0x1'));var path=require(_0x96af('0x2'));var timeout=require(_0x96af('0x3'));var express=require(_0x96af('0x4'));var router=express['Router']();var fs_extra=require(_0x96af('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x96af('0x6'));var config=require(_0x96af('0x7'));var controller=require(_0x96af('0x8'));router[_0x96af('0x9')]('/',auth[_0x96af('0xa')](),controller[_0x96af('0xb')]);router[_0x96af('0x9')](_0x96af('0xc'),auth['isAuthenticated'](),controller[_0x96af('0xd')]);router[_0x96af('0x9')](_0x96af('0xe'),auth[_0x96af('0xa')](),controller['preview']);router['get'](_0x96af('0xf'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth[_0x96af('0xa')](),controller[_0x96af('0x10')]);router[_0x96af('0x11')]('/',auth[_0x96af('0xa')](),controller[_0x96af('0x12')]);router[_0x96af('0x13')](_0x96af('0xc'),auth[_0x96af('0xa')](),controller['update']);router[_0x96af('0x14')]('/:id',auth[_0x96af('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x57df=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','delete'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57df,0x1c2));var _0xf57d=function(_0x22eaa3,_0x385af1){_0x22eaa3=_0x22eaa3-0x0;var _0x28fecb=_0x57df[_0x22eaa3];return _0x28fecb;};'use strict';var multer=require(_0xf57d('0x0'));var util=require(_0xf57d('0x1'));var path=require(_0xf57d('0x2'));var timeout=require(_0xf57d('0x3'));var express=require(_0xf57d('0x4'));var router=express[_0xf57d('0x5')]();var fs_extra=require(_0xf57d('0x6'));var auth=require(_0xf57d('0x7'));var interaction=require(_0xf57d('0x8'));var config=require(_0xf57d('0x9'));var controller=require(_0xf57d('0xa'));router[_0xf57d('0xb')]('/',auth[_0xf57d('0xc')](),controller[_0xf57d('0xd')]);router[_0xf57d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf57d('0xe')]);router[_0xf57d('0xb')](_0xf57d('0xf'),auth['isAuthenticated'](),controller[_0xf57d('0x10')]);router[_0xf57d('0xb')](_0xf57d('0x11'),auth['isAuthenticated'](),controller[_0xf57d('0x12')]);router['get'](_0xf57d('0x13'),auth[_0xf57d('0xc')](),controller[_0xf57d('0x14')]);router[_0xf57d('0x15')]('/',auth[_0xf57d('0xc')](),controller[_0xf57d('0x16')]);router[_0xf57d('0x17')](_0xf57d('0x18'),auth[_0xf57d('0xc')](),controller['update']);router[_0xf57d('0x19')](_0xf57d('0x18'),auth['isAuthenticated'](),controller[_0xf57d('0x1a')]);module[_0xf57d('0x1b')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x54058e,_0x3c7806){var _0x2c6ecc=function(_0x435e60){while(--_0x435e60){_0x54058e['push'](_0x54058e['shift']());}};_0x2c6ecc(++_0x3c7806);}(_0xabce,0x103));var _0xeabc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xabce[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x44b0af,_0xdb6975){var _0xafaa74=function(_0xf734d3){while(--_0xf734d3){_0x44b0af['push'](_0x44b0af['shift']());}};_0xafaa74(++_0xdb6975);}(_0x5fab,0x177));var _0xb5fa=function(_0x4fcbbe,_0x55a068){_0x4fcbbe=_0x4fcbbe-0x0;var _0x2ac729=_0x5fab[_0x4fcbbe];return _0x2ac729;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x325be2,_0x4a3e19){var _0x54986c=function(_0x728dc3){while(--_0x728dc3){_0x325be2['push'](_0x325be2['shift']());}};_0x54986c(++_0x4a3e19);}(_0x814b,0x1a2));var _0xb814=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x814b[_0x4d8789];return _0x404e41;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'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 _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x47cafd,_0x461dfd){var _0x437a9d=function(_0x174bf6){while(--_0x174bf6){_0x47cafd['push'](_0x47cafd['shift']());}};_0x437a9d(++_0x461dfd);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4e1833,_0x583e64){_0x4e1833=_0x4e1833-0x0;var _0x3c3916=_0x1cb9[_0x4e1833];return _0x3c3916;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ae7=['rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','path'];(function(_0x1fa2e3,_0x2b920c){var _0x5d1d52=function(_0x545d14){while(--_0x545d14){_0x1fa2e3['push'](_0x1fa2e3['shift']());}};_0x5d1d52(++_0x2b920c);}(_0x4ae7,0xb9));var _0x74ae=function(_0x17e745,_0x48dde5){_0x17e745=_0x17e745-0x0;var _0x232624=_0x4ae7[_0x17e745];return _0x232624;};'use strict';var _=require(_0x74ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x74ae('0x1'));var moment=require(_0x74ae('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74ae('0x3'));var rimraf=require(_0x74ae('0x4'));var config=require(_0x74ae('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x74ae('0x6')]=function(_0x2e8764,_0x56de93){return _0x2e8764['define'](_0x74ae('0x7'),attributes,{'tableName':_0x74ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d4e=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2f5270,_0x51ed0d){var _0x1af773=function(_0x5491e5){while(--_0x5491e5){_0x2f5270['push'](_0x2f5270['shift']());}};_0x1af773(++_0x51ed0d);}(_0x1d4e,0x1f0));var _0xe1d4=function(_0x127d29,_0x3ce433){_0x127d29=_0x127d29-0x0;var _0x4979fc=_0x1d4e[_0x127d29];return _0x4979fc;};'use strict';var _=require(_0xe1d4('0x0'));var util=require(_0xe1d4('0x1'));var logger=require(_0xe1d4('0x2'))(_0xe1d4('0x3'));var moment=require(_0xe1d4('0x4'));var BPromise=require(_0xe1d4('0x5'));var rp=require(_0xe1d4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1d4('0x7'));var config=require(_0xe1d4('0x8'));var attributes=require(_0xe1d4('0x9'));module[_0xe1d4('0xa')]=function(_0x4532d8,_0x1d0efe){return _0x4532d8[_0xe1d4('0xb')](_0xe1d4('0xc'),attributes,{'tableName':_0xe1d4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05f9=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x26bdfc,_0x461e39){var _0x4a387d=function(_0x3a1313){while(--_0x3a1313){_0x26bdfc['push'](_0x26bdfc['shift']());}};_0x4a387d(++_0x461e39);}(_0x05f9,0x67));var _0x905f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x05f9[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x905f('0x0'));var util=require(_0x905f('0x1'));var moment=require(_0x905f('0x2'));var BPromise=require('bluebird');var rs=require(_0x905f('0x3'));var fs=require('fs');var Redis=require(_0x905f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x905f('0x5'));var jayson=require(_0x905f('0x6'));var client=jayson[_0x905f('0x7')][_0x905f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2558e7,_0x114a8c,_0x1e25ed){return new BPromise(function(_0x16292c,_0x1ec41a){return client[_0x905f('0x9')](_0x2558e7,_0x1e25ed)[_0x905f('0xa')](function(_0x2a3752){logger[_0x905f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x114a8c,'request\x20sent');logger['debug'](_0x905f('0xc'),_0x114a8c,_0x905f('0xd'),JSON[_0x905f('0xe')](_0x2a3752));if(_0x2a3752[_0x905f('0xf')]){if(_0x2a3752[_0x905f('0xf')]['code']===0x1f4){logger[_0x905f('0xf')](_0x905f('0x10'),_0x114a8c,_0x2a3752[_0x905f('0xf')]['message']);return _0x1ec41a(_0x2a3752[_0x905f('0xf')][_0x905f('0x11')]);}logger[_0x905f('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x114a8c,_0x2a3752[_0x905f('0xf')][_0x905f('0x11')]);return _0x16292c(_0x2a3752[_0x905f('0xf')]['message']);}else{logger['info'](_0x905f('0x10'),_0x114a8c,'request\x20sent');_0x16292c(_0x2a3752[_0x905f('0x12')][_0x905f('0x11')]);}})[_0x905f('0x13')](function(_0x5f4a11){logger[_0x905f('0xf')](_0x905f('0x10'),_0x114a8c,_0x5f4a11);_0x1ec41a(_0x5f4a11);});});}
\ No newline at end of file
+var _0x5001=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5001,0x6c));var _0x1500=function(_0x2e066e,_0x5e501d){_0x2e066e=_0x2e066e-0x0;var _0x4dd6f1=_0x5001[_0x2e066e];return _0x4dd6f1;};'use strict';var _=require('lodash');var util=require(_0x1500('0x0'));var moment=require(_0x1500('0x1'));var BPromise=require(_0x1500('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1500('0x3'));var db=require(_0x1500('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1500('0x5'))(_0x1500('0x6'));var config=require(_0x1500('0x7'));var jayson=require(_0x1500('0x8'));var client=jayson['client'][_0x1500('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33237d,_0x54f653,_0x5e9c73){return new BPromise(function(_0x4ccbfc,_0x365531){return client[_0x1500('0xa')](_0x33237d,_0x5e9c73)[_0x1500('0xb')](function(_0x2dda81){logger['info'](_0x1500('0xc'),_0x54f653,_0x1500('0xd'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x54f653,_0x1500('0xd'),JSON[_0x1500('0xe')](_0x2dda81));if(_0x2dda81[_0x1500('0xf')]){if(_0x2dda81['error']['code']===0x1f4){logger[_0x1500('0xf')](_0x1500('0xc'),_0x54f653,_0x2dda81['error'][_0x1500('0x10')]);return _0x365531(_0x2dda81[_0x1500('0xf')][_0x1500('0x10')]);}logger['error'](_0x1500('0xc'),_0x54f653,_0x2dda81[_0x1500('0xf')][_0x1500('0x10')]);return _0x4ccbfc(_0x2dda81[_0x1500('0xf')][_0x1500('0x10')]);}else{logger[_0x1500('0x11')](_0x1500('0xc'),_0x54f653,_0x1500('0xd'));_0x4ccbfc(_0x2dda81[_0x1500('0x12')]['message']);}})[_0x1500('0x13')](function(_0x7dc59d){logger[_0x1500('0xf')](_0x1500('0xc'),_0x54f653,_0x7dc59d);_0x365531(_0x7dc59d);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc22b=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','preview','/:id/run','query','create','/:id','delete','destroy','exports','path','connect-timeout','Router','fs-extra'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xc22b,0x1c4));var _0xbc22=function(_0x5db69d,_0x1d693c){_0x5db69d=_0x5db69d-0x0;var _0x37edc0=_0xc22b[_0x5db69d];return _0x37edc0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc22('0x0'));var timeout=require(_0xbc22('0x1'));var express=require('express');var router=express[_0xbc22('0x2')]();var fs_extra=require(_0xbc22('0x3'));var auth=require(_0xbc22('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbc22('0x5'));var controller=require(_0xbc22('0x6'));router[_0xbc22('0x7')]('/',auth[_0xbc22('0x8')](),controller[_0xbc22('0x9')]);router[_0xbc22('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbc22('0xa')]);router[_0xbc22('0x7')]('/:id/preview',auth[_0xbc22('0x8')](),controller[_0xbc22('0xb')]);router[_0xbc22('0x7')](_0xbc22('0xc'),auth[_0xbc22('0x8')](),controller['run']);router[_0xbc22('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0xbc22('0xd')]);router['post']('/',auth[_0xbc22('0x8')](),controller[_0xbc22('0xe')]);router['put'](_0xbc22('0xf'),auth[_0xbc22('0x8')](),controller['update']);router[_0xbc22('0x10')](_0xbc22('0xf'),auth[_0xbc22('0x8')](),controller[_0xbc22('0x11')]);module[_0xbc22('0x12')]=router;
\ No newline at end of file
+var _0x0df6=['/:id','destroy','exports','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0xb1cb8f,_0x5a56cd){var _0xb564bf=function(_0x21b616){while(--_0x21b616){_0xb1cb8f['push'](_0xb1cb8f['shift']());}};_0xb564bf(++_0x5a56cd);}(_0x0df6,0x16b));var _0x60df=function(_0x466424,_0x39b837){_0x466424=_0x466424-0x0;var _0xf0c74c=_0x0df6[_0x466424];return _0xf0c74c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60df('0x0'));var router=express['Router']();var fs_extra=require(_0x60df('0x1'));var auth=require(_0x60df('0x2'));var interaction=require(_0x60df('0x3'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x60df('0x4')]('/',auth[_0x60df('0x5')](),controller[_0x60df('0x6')]);router['get']('/:id',auth[_0x60df('0x5')](),controller[_0x60df('0x7')]);router['get'](_0x60df('0x8'),auth[_0x60df('0x5')](),controller[_0x60df('0x9')]);router[_0x60df('0x4')](_0x60df('0xa'),auth['isAuthenticated'](),controller[_0x60df('0xb')]);router[_0x60df('0x4')](_0x60df('0xc'),auth[_0x60df('0x5')](),controller[_0x60df('0xd')]);router[_0x60df('0xe')]('/',auth['isAuthenticated'](),controller[_0x60df('0xf')]);router[_0x60df('0x10')](_0x60df('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x60df('0x11'),auth[_0x60df('0x5')](),controller[_0x60df('0x12')]);module[_0x60df('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf981=['DATE','scheduled','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x2c56b1,_0x3da648){var _0x57da21=function(_0x30eb4a){while(--_0x30eb4a){_0x2c56b1['push'](_0x2c56b1['shift']());}};_0x57da21(++_0x3da648);}(_0xf981,0x19d));var _0x1f98=function(_0x370ed5,_0x1162cd){_0x370ed5=_0x370ed5-0x0;var _0x2a8e73=_0xf981[_0x370ed5];return _0x2a8e73;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1f98('0x0'));module[_0x1f98('0x1')]={'name':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1f98('0x3')](_0x1f98('0x4'),_0x1f98('0x5'),_0x1f98('0x6')),'allowNull':![],'defaultValue':_0x1f98('0x4')},'savename':{'type':Sequelize[_0x1f98('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1f98('0x7')]},'endDate':{'type':Sequelize[_0x1f98('0x7')]},'status':{'type':Sequelize[_0x1f98('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x1f98('0x3')]('manual',_0x1f98('0x8')),'allowNull':![],'defaultValue':_0x1f98('0x9')},'reportId':{'type':Sequelize[_0x1f98('0xa')](0xb)[_0x1f98('0xb')]},'reportType':{'type':Sequelize[_0x1f98('0x2')]}};
\ No newline at end of file
+var _0x6a98=['ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x6c76cd,_0x5eb183){var _0x13a7b0=function(_0x434579){while(--_0x434579){_0x6c76cd['push'](_0x6c76cd['shift']());}};_0x13a7b0(++_0x5eb183);}(_0x6a98,0x191));var _0x86a9=function(_0x262417,_0x9b9f85){_0x262417=_0x262417-0x0;var _0x4404f7=_0x6a98[_0x262417];return _0x4404f7;};'use strict';var Sequelize=require(_0x86a9('0x0'));var moment=require('moment');module[_0x86a9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x86a9('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x86a9('0x3'),_0x86a9('0x4'),_0x86a9('0x5')),'allowNull':![],'defaultValue':_0x86a9('0x3')},'savename':{'type':Sequelize[_0x86a9('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x86a9('0x6')]},'status':{'type':Sequelize[_0x86a9('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x86a9('0x7')](_0x86a9('0x8'),_0x86a9('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x86a9('0xa')](0xb)[_0x86a9('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc258=['jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','ExtractedReports','then','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','keys','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','existsSync','root','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','join','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x16a8c9,_0x4742ba){var _0x3b701a=function(_0x309e83){while(--_0x309e83){_0x16a8c9['push'](_0x16a8c9['shift']());}};_0x3b701a(++_0x4742ba);}(_0xc258,0x1e1));var _0x8c25=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc258[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x8c25('0x0'));var rimraf=require(_0x8c25('0x1'));var zipdir=require(_0x8c25('0x2'));var jsonpatch=require(_0x8c25('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c25('0x4'));var Mustache=require(_0x8c25('0x5'));var util=require(_0x8c25('0x6'));var path=require(_0x8c25('0x7'));var sox=require(_0x8c25('0x8'));var csv=require(_0x8c25('0x9'));var ejs=require(_0x8c25('0xa'));var fs=require('fs');var fs_extra=require(_0x8c25('0xb'));var _=require('lodash');var squel=require(_0x8c25('0xc'));var crypto=require(_0x8c25('0xd'));var jsforce=require(_0x8c25('0xe'));var deskjs=require(_0x8c25('0xf'));var toCsv=require(_0x8c25('0x9'));var querystring=require(_0x8c25('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c25('0x11'));var as=require(_0x8c25('0x12'));var hardwareService=require(_0x8c25('0x13'));var logger=require(_0x8c25('0x14'))(_0x8c25('0x15'));var utils=require('../../config/utils');var config=require(_0x8c25('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c25('0x17'))['db'];function respondWithStatusCode(_0x50bdbd,_0x36061b){_0x36061b=_0x36061b||0xcc;return function(_0x5dcf83){if(_0x5dcf83){return _0x50bdbd[_0x8c25('0x18')](_0x36061b);}return _0x50bdbd[_0x8c25('0x19')](_0x36061b)[_0x8c25('0x1a')]();};}function respondWithResult(_0x86f8ed,_0x2b3a8a){_0x2b3a8a=_0x2b3a8a||0xc8;return function(_0x1d8484){if(_0x1d8484){return _0x86f8ed[_0x8c25('0x19')](_0x2b3a8a)[_0x8c25('0x1b')](_0x1d8484);}};}function respondWithFilteredResult(_0x5a88c9,_0x2149d4){return function(_0x5cba30){if(_0x5cba30){var _0x74b1d3=typeof _0x2149d4[_0x8c25('0x1c')]===_0x8c25('0x1d')&&typeof _0x2149d4[_0x8c25('0x1e')]===_0x8c25('0x1d');var _0x4b29b1=_0x5cba30['count'];var _0x3e3425=_0x74b1d3?0x0:_0x2149d4[_0x8c25('0x1c')];var _0x11c774=_0x74b1d3?_0x5cba30[_0x8c25('0x1f')]:_0x2149d4['offset']+_0x2149d4['limit'];var _0x55cffa;if(_0x11c774>=_0x4b29b1){_0x11c774=_0x4b29b1;_0x55cffa=0xc8;}else{_0x55cffa=0xce;}_0x5a88c9[_0x8c25('0x19')](_0x55cffa);return _0x5a88c9[_0x8c25('0x20')]('Content-Range',_0x3e3425+'-'+_0x11c774+'/'+_0x4b29b1)[_0x8c25('0x1b')](_0x5cba30);}return null;};}function patchUpdates(_0x168a09){return function(_0x1fd0bf){try{jsonpatch[_0x8c25('0x21')](_0x1fd0bf,_0x168a09,!![]);}catch(_0x301374){return BPromise[_0x8c25('0x22')](_0x301374);}return _0x1fd0bf[_0x8c25('0x23')]();};}function saveUpdates(_0x345db7,_0x2ca804){return function(_0x38402a){if(_0x38402a){return _0x38402a['update'](_0x345db7)['then'](function(_0x58c82d){return _0x58c82d;});}return null;};}function removeEntity(_0x24822b,_0x4deb6e){return function(_0x3d823c){if(_0x3d823c){return _0x3d823c[_0x8c25('0x24')]()['then'](function(){var _0x49f411=_0x3d823c['get']({'plain':!![]});var _0x52a1e1=_0x8c25('0x25');return db['UserProfileResource'][_0x8c25('0x24')]({'where':{'type':_0x52a1e1,'resourceId':_0x49f411['id']}})[_0x8c25('0x26')](function(){return _0x3d823c;});})[_0x8c25('0x26')](function(){_0x24822b[_0x8c25('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13692f,_0xfce54b){return function(_0x46021b){if(!_0x46021b){_0x13692f['sendStatus'](0x194);}return _0x46021b;};}function handleError(_0x2448c7,_0x541d6e){_0x541d6e=_0x541d6e||0x1f4;return function(_0x8fa0b3){logger[_0x8c25('0x27')](_0x8fa0b3[_0x8c25('0x28')]);if(_0x8fa0b3[_0x8c25('0x29')]){delete _0x8fa0b3[_0x8c25('0x29')];}_0x2448c7[_0x8c25('0x19')](_0x541d6e)[_0x8c25('0x2a')](_0x8fa0b3);};}exports[_0x8c25('0x2b')]=function(_0x2a08e8,_0x265c14){var _0x210425={},_0x35cfae={},_0x2608d3={'count':0x0,'rows':[]};var _0x1ac2a4=_[_0x8c25('0x2c')](db[_0x8c25('0x2d')][_0x8c25('0x2e')],function(_0x823f6){return{'name':_0x823f6[_0x8c25('0x2f')],'type':_0x823f6[_0x8c25('0x30')][_0x8c25('0x31')]};});_0x35cfae[_0x8c25('0x32')]=_['map'](_0x1ac2a4,'name');_0x35cfae[_0x8c25('0x33')]=_['keys'](_0x2a08e8['query']);_0x35cfae[_0x8c25('0x34')]=_[_0x8c25('0x35')](_0x35cfae['model'],_0x35cfae['query']);_0x210425[_0x8c25('0x36')]=_['intersection'](_0x35cfae[_0x8c25('0x32')],qs['fields'](_0x2a08e8[_0x8c25('0x33')][_0x8c25('0x37')]));_0x210425[_0x8c25('0x36')]=_0x210425[_0x8c25('0x36')]['length']?_0x210425[_0x8c25('0x36')]:_0x35cfae[_0x8c25('0x32')];if(!_0x2a08e8['query'][_0x8c25('0x38')](_0x8c25('0x39'))){_0x210425[_0x8c25('0x1e')]=qs['limit'](_0x2a08e8['query'][_0x8c25('0x1e')]);_0x210425[_0x8c25('0x1c')]=qs[_0x8c25('0x1c')](_0x2a08e8[_0x8c25('0x33')][_0x8c25('0x1c')]);}_0x210425[_0x8c25('0x3a')]=qs['sort'](_0x2a08e8[_0x8c25('0x33')]['sort']);_0x210425['where']=qs[_0x8c25('0x34')](_[_0x8c25('0x3b')](_0x2a08e8[_0x8c25('0x33')],_0x35cfae['filters']),_0x1ac2a4);if(_0x2a08e8[_0x8c25('0x33')]['filter']){_0x210425[_0x8c25('0x3c')]=_['merge'](_0x210425[_0x8c25('0x3c')],{'$or':_[_0x8c25('0x2c')](_0x1ac2a4,function(_0x298e4d){if(_0x298e4d[_0x8c25('0x30')]!==_0x8c25('0x3d')){var _0x30c151={};_0x30c151[_0x298e4d['name']]={'$like':'%'+_0x2a08e8[_0x8c25('0x33')][_0x8c25('0x3e')]+'%'};return _0x30c151;}})});}_0x210425=_[_0x8c25('0x3f')]({},_0x210425,_0x2a08e8[_0x8c25('0x40')]);var _0x4bb869={'where':_0x210425[_0x8c25('0x3c')]};return db[_0x8c25('0x2d')][_0x8c25('0x1f')](_0x4bb869)[_0x8c25('0x26')](function(_0x4e634e){_0x2608d3[_0x8c25('0x1f')]=_0x4e634e;if(_0x2a08e8['query'][_0x8c25('0x41')]){_0x210425['include']=[{'all':!![]}];}return db[_0x8c25('0x2d')][_0x8c25('0x42')](_0x210425);})['then'](function(_0x4ad1d8){_0x2608d3[_0x8c25('0x43')]=_0x4ad1d8;return _0x2608d3;})[_0x8c25('0x26')](respondWithFilteredResult(_0x265c14,_0x210425))['catch'](handleError(_0x265c14,null));};exports[_0x8c25('0x44')]=function(_0x3f055e,_0x3b5eb5){var _0x2d5454={'raw':!![],'where':{'id':_0x3f055e[_0x8c25('0x45')]['id']}},_0x2c4a3f={};_0x2c4a3f[_0x8c25('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x8c25('0x2e')]);_0x2c4a3f[_0x8c25('0x33')]=_[_0x8c25('0x46')](_0x3f055e[_0x8c25('0x33')]);_0x2c4a3f['filters']=_['intersection'](_0x2c4a3f['model'],_0x2c4a3f[_0x8c25('0x33')]);_0x2d5454[_0x8c25('0x36')]=_[_0x8c25('0x35')](_0x2c4a3f[_0x8c25('0x32')],qs[_0x8c25('0x37')](_0x3f055e[_0x8c25('0x33')][_0x8c25('0x37')]));_0x2d5454['attributes']=_0x2d5454[_0x8c25('0x36')][_0x8c25('0x47')]?_0x2d5454[_0x8c25('0x36')]:_0x2c4a3f[_0x8c25('0x32')];if(_0x3f055e[_0x8c25('0x33')]['includeAll']){_0x2d5454[_0x8c25('0x48')]=[{'all':!![]}];}_0x2d5454=_['merge']({},_0x2d5454,_0x3f055e[_0x8c25('0x40')]);return db[_0x8c25('0x2d')][_0x8c25('0x49')](_0x2d5454)[_0x8c25('0x26')](handleEntityNotFound(_0x3b5eb5,null))['then'](respondWithResult(_0x3b5eb5,null))[_0x8c25('0x4a')](handleError(_0x3b5eb5,null));};exports[_0x8c25('0x4b')]=function(_0x3b72fd,_0x3466ce){return db['AnalyticExtractedReport'][_0x8c25('0x4b')](_0x3b72fd[_0x8c25('0x4c')],{})[_0x8c25('0x26')](function(_0x3b01d0){var _0x28db0e=_0x3b72fd[_0x8c25('0x4d')][_0x8c25('0x4e')]({'plain':!![]});if(!_0x28db0e)throw new Error(_0x8c25('0x4f'));if(_0x28db0e[_0x8c25('0x50')]===_0x8c25('0x4d')){var _0x17f6ed=_0x3b01d0[_0x8c25('0x4e')]({'plain':!![]});var _0xca4c8d=_0x8c25('0x25');return db[_0x8c25('0x51')][_0x8c25('0x49')]({'where':{'name':_0xca4c8d,'userProfileId':_0x28db0e[_0x8c25('0x52')]},'raw':!![]})['then'](function(_0x509333){if(_0x509333&&_0x509333[_0x8c25('0x53')]===0x0){return db[_0x8c25('0x54')][_0x8c25('0x4b')]({'name':_0x17f6ed[_0x8c25('0x29')],'resourceId':_0x17f6ed['id'],'type':_0x509333['name'],'sectionId':_0x509333['id']},{})[_0x8c25('0x26')](function(){return _0x3b01d0;});}else{return _0x3b01d0;}})[_0x8c25('0x4a')](function(_0x50bfe2){logger['error'](_0x8c25('0x55'),_0x50bfe2);throw _0x50bfe2;});}return _0x3b01d0;})[_0x8c25('0x26')](respondWithResult(_0x3466ce,0xc9))[_0x8c25('0x4a')](handleError(_0x3466ce,null));};exports[_0x8c25('0x56')]=function(_0x1cd313,_0x247d87){if(_0x1cd313[_0x8c25('0x4c')]['id']){delete _0x1cd313[_0x8c25('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0x8c25('0x49')]({'where':{'id':_0x1cd313['params']['id']}})[_0x8c25('0x26')](handleEntityNotFound(_0x247d87,null))[_0x8c25('0x26')](saveUpdates(_0x1cd313[_0x8c25('0x4c')],null))[_0x8c25('0x26')](respondWithResult(_0x247d87,null))[_0x8c25('0x4a')](handleError(_0x247d87,null));};exports[_0x8c25('0x24')]=function(_0x529f9b,_0x1df4e5){return db[_0x8c25('0x2d')][_0x8c25('0x49')]({'where':{'id':_0x529f9b[_0x8c25('0x45')]['id']}})['then'](handleEntityNotFound(_0x1df4e5,null))['then'](removeEntity(_0x1df4e5,null))[_0x8c25('0x4a')](handleError(_0x1df4e5,null));};exports[_0x8c25('0x57')]=function(_0xd89a48,_0x443925,_0x17f5cb){return db['AnalyticExtractedReport'][_0x8c25('0x49')]({'where':{'id':_0xd89a48['params']['id']},'attributes':['name',_0x8c25('0x58'),'savename',_0x8c25('0x59')],'raw':!![]})[_0x8c25('0x26')](handleEntityNotFound(_0x443925,null))[_0x8c25('0x26')](function(_0x26d539){if(_0x26d539){if(!fs[_0x8c25('0x5a')](path['join'](config[_0x8c25('0x5b')],'server/files/reports',_0x26d539[_0x8c25('0x5c')]))){throw new db['Sequelize'][(_0x8c25('0x5d'))](_0x8c25('0x5e'));}if(_0xd89a48[_0x8c25('0x33')]['exists']){return _0x443925[_0x8c25('0x18')](0xc8);}return _0x443925[_0x8c25('0x57')](path[_0x8c25('0x5f')](config[_0x8c25('0x5b')],_0x8c25('0x60'),_0x26d539[_0x8c25('0x5c')]),util[_0x8c25('0x61')](_0x8c25('0x62'),_0x26d539[_0x8c25('0x58')]||_0x26d539['name'],_0x26d539['output']['toLowerCase']()));}})['catch'](handleError(_0x443925,null));};
\ No newline at end of file
+var _0x5b43=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','name','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0xe5208c,_0x41b12c){var _0x494ed1=function(_0x4c28c9){while(--_0x4c28c9){_0xe5208c['push'](_0xe5208c['shift']());}};_0x494ed1(++_0x41b12c);}(_0x5b43,0x123));var _0x35b4=function(_0x31a874,_0x515c11){_0x31a874=_0x31a874-0x0;var _0x20d9a6=_0x5b43[_0x31a874];return _0x20d9a6;};'use strict';var emlformat=require(_0x35b4('0x0'));var rimraf=require(_0x35b4('0x1'));var zipdir=require(_0x35b4('0x2'));var jsonpatch=require(_0x35b4('0x3'));var rp=require(_0x35b4('0x4'));var moment=require(_0x35b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35b4('0x6'));var util=require('util');var path=require(_0x35b4('0x7'));var sox=require(_0x35b4('0x8'));var csv=require(_0x35b4('0x9'));var ejs=require(_0x35b4('0xa'));var fs=require('fs');var fs_extra=require(_0x35b4('0xb'));var _=require(_0x35b4('0xc'));var squel=require(_0x35b4('0xd'));var crypto=require(_0x35b4('0xe'));var jsforce=require(_0x35b4('0xf'));var deskjs=require(_0x35b4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35b4('0x11'));var Papa=require('papaparse');var Redis=require(_0x35b4('0x12'));var authService=require(_0x35b4('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35b4('0x14'));var logger=require(_0x35b4('0x15'))(_0x35b4('0x16'));var utils=require(_0x35b4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x35b4('0x18'));var db=require(_0x35b4('0x19'))['db'];function respondWithStatusCode(_0x4ebbb4,_0x40e4a4){_0x40e4a4=_0x40e4a4||0xcc;return function(_0x1b427a){if(_0x1b427a){return _0x4ebbb4[_0x35b4('0x1a')](_0x40e4a4);}return _0x4ebbb4[_0x35b4('0x1b')](_0x40e4a4)['end']();};}function respondWithResult(_0x15a816,_0x5361ee){_0x5361ee=_0x5361ee||0xc8;return function(_0x42342a){if(_0x42342a){return _0x15a816[_0x35b4('0x1b')](_0x5361ee)[_0x35b4('0x1c')](_0x42342a);}};}function respondWithFilteredResult(_0x332dfd,_0x4ee47a){return function(_0xc83826){if(_0xc83826){var _0x22ea6c=typeof _0x4ee47a['offset']==='undefined'&&typeof _0x4ee47a[_0x35b4('0x1d')]===_0x35b4('0x1e');var _0x277e71=_0xc83826[_0x35b4('0x1f')];var _0x2cd5e5=_0x22ea6c?0x0:_0x4ee47a[_0x35b4('0x20')];var _0xda47a9=_0x22ea6c?_0xc83826[_0x35b4('0x1f')]:_0x4ee47a[_0x35b4('0x20')]+_0x4ee47a[_0x35b4('0x1d')];var _0x3927c9;if(_0xda47a9>=_0x277e71){_0xda47a9=_0x277e71;_0x3927c9=0xc8;}else{_0x3927c9=0xce;}_0x332dfd[_0x35b4('0x1b')](_0x3927c9);return _0x332dfd[_0x35b4('0x21')]('Content-Range',_0x2cd5e5+'-'+_0xda47a9+'/'+_0x277e71)[_0x35b4('0x1c')](_0xc83826);}return null;};}function patchUpdates(_0x3ce6da){return function(_0x22784b){try{jsonpatch[_0x35b4('0x22')](_0x22784b,_0x3ce6da,!![]);}catch(_0x2432b6){return BPromise[_0x35b4('0x23')](_0x2432b6);}return _0x22784b[_0x35b4('0x24')]();};}function saveUpdates(_0xfb3e0c,_0x3ac035){return function(_0x3e1b35){if(_0x3e1b35){return _0x3e1b35[_0x35b4('0x25')](_0xfb3e0c)[_0x35b4('0x26')](function(_0x13802d){return _0x13802d;});}return null;};}function removeEntity(_0x49932f,_0xb8bb7a){return function(_0xcca108){if(_0xcca108){return _0xcca108[_0x35b4('0x27')]()[_0x35b4('0x26')](function(){var _0x3ade53=_0xcca108[_0x35b4('0x28')]({'plain':!![]});var _0x20ac4d='ExtractedReports';return db[_0x35b4('0x29')][_0x35b4('0x27')]({'where':{'type':_0x20ac4d,'resourceId':_0x3ade53['id']}})[_0x35b4('0x26')](function(){return _0xcca108;});})[_0x35b4('0x26')](function(){_0x49932f[_0x35b4('0x1b')](0xcc)[_0x35b4('0x2a')]();});}};}function handleEntityNotFound(_0xc604f,_0xb52610){return function(_0x4edd85){if(!_0x4edd85){_0xc604f['sendStatus'](0x194);}return _0x4edd85;};}function handleError(_0x453bfd,_0x11b560){_0x11b560=_0x11b560||0x1f4;return function(_0x705406){logger[_0x35b4('0x2b')](_0x705406[_0x35b4('0x2c')]);if(_0x705406['name']){delete _0x705406['name'];}_0x453bfd[_0x35b4('0x1b')](_0x11b560)['send'](_0x705406);};}exports['index']=function(_0x1d1a6c,_0xda312c){var _0x4feb4c={},_0x2e3218={},_0x4a606c={'count':0x0,'rows':[]};var _0x152e5a=_[_0x35b4('0x2d')](db[_0x35b4('0x2e')][_0x35b4('0x2f')],function(_0x111c00){return{'name':_0x111c00[_0x35b4('0x30')],'type':_0x111c00[_0x35b4('0x31')][_0x35b4('0x32')]};});_0x2e3218['model']=_[_0x35b4('0x2d')](_0x152e5a,_0x35b4('0x33'));_0x2e3218[_0x35b4('0x34')]=_[_0x35b4('0x35')](_0x1d1a6c[_0x35b4('0x34')]);_0x2e3218['filters']=_['intersection'](_0x2e3218[_0x35b4('0x36')],_0x2e3218[_0x35b4('0x34')]);_0x4feb4c[_0x35b4('0x37')]=_[_0x35b4('0x38')](_0x2e3218[_0x35b4('0x36')],qs[_0x35b4('0x39')](_0x1d1a6c[_0x35b4('0x34')][_0x35b4('0x39')]));_0x4feb4c[_0x35b4('0x37')]=_0x4feb4c['attributes']['length']?_0x4feb4c['attributes']:_0x2e3218['model'];if(!_0x1d1a6c[_0x35b4('0x34')][_0x35b4('0x3a')](_0x35b4('0x3b'))){_0x4feb4c[_0x35b4('0x1d')]=qs[_0x35b4('0x1d')](_0x1d1a6c[_0x35b4('0x34')][_0x35b4('0x1d')]);_0x4feb4c[_0x35b4('0x20')]=qs[_0x35b4('0x20')](_0x1d1a6c[_0x35b4('0x34')]['offset']);}_0x4feb4c[_0x35b4('0x3c')]=qs[_0x35b4('0x3d')](_0x1d1a6c['query'][_0x35b4('0x3d')]);_0x4feb4c[_0x35b4('0x3e')]=qs[_0x35b4('0x3f')](_[_0x35b4('0x40')](_0x1d1a6c[_0x35b4('0x34')],_0x2e3218[_0x35b4('0x3f')]),_0x152e5a);if(_0x1d1a6c[_0x35b4('0x34')][_0x35b4('0x41')]){_0x4feb4c[_0x35b4('0x3e')]=_[_0x35b4('0x42')](_0x4feb4c[_0x35b4('0x3e')],{'$or':_[_0x35b4('0x2d')](_0x152e5a,function(_0x2059d6){if(_0x2059d6[_0x35b4('0x31')]!==_0x35b4('0x43')){var _0x57a88a={};_0x57a88a[_0x2059d6[_0x35b4('0x33')]]={'$like':'%'+_0x1d1a6c[_0x35b4('0x34')][_0x35b4('0x41')]+'%'};return _0x57a88a;}})});}_0x4feb4c=_[_0x35b4('0x42')]({},_0x4feb4c,_0x1d1a6c[_0x35b4('0x44')]);var _0x4ebaf8={'where':_0x4feb4c['where']};return db['AnalyticExtractedReport'][_0x35b4('0x1f')](_0x4ebaf8)[_0x35b4('0x26')](function(_0x415eee){_0x4a606c[_0x35b4('0x1f')]=_0x415eee;if(_0x1d1a6c['query'][_0x35b4('0x45')]){_0x4feb4c[_0x35b4('0x46')]=[{'all':!![]}];}return db[_0x35b4('0x2e')][_0x35b4('0x47')](_0x4feb4c);})[_0x35b4('0x26')](function(_0x2712c4){_0x4a606c[_0x35b4('0x48')]=_0x2712c4;return _0x4a606c;})[_0x35b4('0x26')](respondWithFilteredResult(_0xda312c,_0x4feb4c))['catch'](handleError(_0xda312c,null));};exports[_0x35b4('0x49')]=function(_0x5e224b,_0x29ae1a){var _0x56d677={'raw':!![],'where':{'id':_0x5e224b[_0x35b4('0x4a')]['id']}},_0x12281f={};_0x12281f[_0x35b4('0x36')]=_[_0x35b4('0x35')](db[_0x35b4('0x2e')][_0x35b4('0x2f')]);_0x12281f['query']=_['keys'](_0x5e224b[_0x35b4('0x34')]);_0x12281f['filters']=_[_0x35b4('0x38')](_0x12281f[_0x35b4('0x36')],_0x12281f[_0x35b4('0x34')]);_0x56d677[_0x35b4('0x37')]=_[_0x35b4('0x38')](_0x12281f['model'],qs[_0x35b4('0x39')](_0x5e224b['query'][_0x35b4('0x39')]));_0x56d677[_0x35b4('0x37')]=_0x56d677[_0x35b4('0x37')]['length']?_0x56d677['attributes']:_0x12281f[_0x35b4('0x36')];if(_0x5e224b['query']['includeAll']){_0x56d677['include']=[{'all':!![]}];}_0x56d677=_[_0x35b4('0x42')]({},_0x56d677,_0x5e224b['options']);return db[_0x35b4('0x2e')][_0x35b4('0x4b')](_0x56d677)[_0x35b4('0x26')](handleEntityNotFound(_0x29ae1a,null))[_0x35b4('0x26')](respondWithResult(_0x29ae1a,null))[_0x35b4('0x4c')](handleError(_0x29ae1a,null));};exports[_0x35b4('0x4d')]=function(_0x32b603,_0x3fd352){return db[_0x35b4('0x2e')][_0x35b4('0x4d')](_0x32b603['body'],{})[_0x35b4('0x26')](function(_0x12c7b2){var _0x4dcb02=_0x32b603['user']['get']({'plain':!![]});if(!_0x4dcb02)throw new Error(_0x35b4('0x4e'));if(_0x4dcb02[_0x35b4('0x4f')]===_0x35b4('0x50')){var _0x5981f0=_0x12c7b2[_0x35b4('0x28')]({'plain':!![]});var _0x453aab=_0x35b4('0x51');return db[_0x35b4('0x52')][_0x35b4('0x4b')]({'where':{'name':_0x453aab,'userProfileId':_0x4dcb02['userProfileId']},'raw':!![]})['then'](function(_0x414532){if(_0x414532&&_0x414532[_0x35b4('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5981f0['name'],'resourceId':_0x5981f0['id'],'type':_0x414532[_0x35b4('0x33')],'sectionId':_0x414532['id']},{})[_0x35b4('0x26')](function(){return _0x12c7b2;});}else{return _0x12c7b2;}})[_0x35b4('0x4c')](function(_0x4e3809){logger['error'](_0x35b4('0x54'),_0x4e3809);throw _0x4e3809;});}return _0x12c7b2;})[_0x35b4('0x26')](respondWithResult(_0x3fd352,0xc9))[_0x35b4('0x4c')](handleError(_0x3fd352,null));};exports[_0x35b4('0x25')]=function(_0x50dc82,_0x35e7e7){if(_0x50dc82[_0x35b4('0x55')]['id']){delete _0x50dc82[_0x35b4('0x55')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x50dc82[_0x35b4('0x4a')]['id']}})[_0x35b4('0x26')](handleEntityNotFound(_0x35e7e7,null))[_0x35b4('0x26')](saveUpdates(_0x50dc82['body'],null))[_0x35b4('0x26')](respondWithResult(_0x35e7e7,null))[_0x35b4('0x4c')](handleError(_0x35e7e7,null));};exports[_0x35b4('0x27')]=function(_0x26636a,_0x3978dc){return db[_0x35b4('0x2e')][_0x35b4('0x4b')]({'where':{'id':_0x26636a[_0x35b4('0x4a')]['id']}})[_0x35b4('0x26')](handleEntityNotFound(_0x3978dc,null))[_0x35b4('0x26')](removeEntity(_0x3978dc,null))[_0x35b4('0x4c')](handleError(_0x3978dc,null));};exports[_0x35b4('0x56')]=function(_0x634dfe,_0x133f89,_0xefb747){return db['AnalyticExtractedReport'][_0x35b4('0x4b')]({'where':{'id':_0x634dfe[_0x35b4('0x4a')]['id']},'attributes':['name',_0x35b4('0x57'),_0x35b4('0x58'),_0x35b4('0x59')],'raw':!![]})[_0x35b4('0x26')](handleEntityNotFound(_0x133f89,null))[_0x35b4('0x26')](function(_0x487935){if(_0x487935){if(!fs[_0x35b4('0x5a')](path[_0x35b4('0x5b')](config[_0x35b4('0x5c')],_0x35b4('0x5d'),_0x487935['savename']))){throw new db['Sequelize'][(_0x35b4('0x5e'))](_0x35b4('0x5f'));}if(_0x634dfe['query'][_0x35b4('0x60')]){return _0x133f89[_0x35b4('0x1a')](0xc8);}return _0x133f89['download'](path[_0x35b4('0x5b')](config[_0x35b4('0x5c')],_0x35b4('0x5d'),_0x487935[_0x35b4('0x58')]),util[_0x35b4('0x61')](_0x35b4('0x62'),_0x487935[_0x35b4('0x57')]||_0x487935[_0x35b4('0x33')],_0x487935['output'][_0x35b4('0x63')]()));}})[_0x35b4('0x4c')](handleError(_0x133f89,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28be=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x7b3241,_0x2374ca){var _0x58ddbb=function(_0x48ab12){while(--_0x48ab12){_0x7b3241['push'](_0x7b3241['shift']());}};_0x58ddbb(++_0x2374ca);}(_0x28be,0x7a));var _0xe28b=function(_0x465906,_0x8686c6){_0x465906=_0x465906-0x0;var _0xc3f6ab=_0x28be[_0x465906];return _0xc3f6ab;};'use strict';var _=require(_0xe28b('0x0'));var util=require(_0xe28b('0x1'));var logger=require(_0xe28b('0x2'))('api');var moment=require(_0xe28b('0x3'));var BPromise=require(_0xe28b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe28b('0x5'));var rimraf=require('rimraf');var config=require(_0xe28b('0x6'));var attributes=require(_0xe28b('0x7'));module[_0xe28b('0x8')]=function(_0x90b71d,_0x2ccfdb){return _0x90b71d['define'](_0xe28b('0x9'),attributes,{'tableName':_0xe28b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc798=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xc798,0x1b6));var _0x8c79=function(_0x1ec6c6,_0xc5c017){_0x1ec6c6=_0x1ec6c6-0x0;var _0x2b591f=_0xc798[_0x1ec6c6];return _0x2b591f;};'use strict';var _=require('lodash');var util=require(_0x8c79('0x0'));var logger=require(_0x8c79('0x1'))(_0x8c79('0x2'));var moment=require(_0x8c79('0x3'));var BPromise=require(_0x8c79('0x4'));var rp=require(_0x8c79('0x5'));var fs=require('fs');var path=require(_0x8c79('0x6'));var rimraf=require(_0x8c79('0x7'));var config=require(_0x8c79('0x8'));var attributes=require(_0x8c79('0x9'));module[_0x8c79('0xa')]=function(_0x2b9bf7,_0x5198ef){return _0x2b9bf7[_0x8c79('0xb')](_0x8c79('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6330=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x4a397d,_0x5bab1f){var _0x316571=function(_0xa6d65a){while(--_0xa6d65a){_0x4a397d['push'](_0x4a397d['shift']());}};_0x316571(++_0x5bab1f);}(_0x6330,0xcc));var _0x0633=function(_0x10756d,_0x2f324b){_0x10756d=_0x10756d-0x0;var _0x50f5cb=_0x6330[_0x10756d];return _0x50f5cb;};'use strict';var _=require(_0x0633('0x0'));var util=require(_0x0633('0x1'));var moment=require(_0x0633('0x2'));var BPromise=require(_0x0633('0x3'));var rs=require(_0x0633('0x4'));var fs=require('fs');var Redis=require(_0x0633('0x5'));var db=require(_0x0633('0x6'))['db'];var utils=require(_0x0633('0x7'));var logger=require(_0x0633('0x8'))(_0x0633('0x9'));var config=require(_0x0633('0xa'));var jayson=require(_0x0633('0xb'));var client=jayson[_0x0633('0xc')][_0x0633('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xf3fc02,_0x1a33de,_0xb41d0a){return new BPromise(function(_0x2e6b59,_0x58dae2){return client[_0x0633('0xe')](_0xf3fc02,_0xb41d0a)[_0x0633('0xf')](function(_0x277a43){logger[_0x0633('0x10')](_0x0633('0x11'),_0x1a33de,_0x0633('0x12'));logger[_0x0633('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1a33de,_0x0633('0x12'),JSON['stringify'](_0x277a43));if(_0x277a43['error']){if(_0x277a43[_0x0633('0x14')][_0x0633('0x15')]===0x1f4){logger[_0x0633('0x14')](_0x0633('0x11'),_0x1a33de,_0x277a43[_0x0633('0x14')]['message']);return _0x58dae2(_0x277a43[_0x0633('0x14')]['message']);}logger[_0x0633('0x14')](_0x0633('0x11'),_0x1a33de,_0x277a43[_0x0633('0x14')][_0x0633('0x16')]);return _0x2e6b59(_0x277a43[_0x0633('0x14')][_0x0633('0x16')]);}else{logger[_0x0633('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a33de,_0x0633('0x12'));_0x2e6b59(_0x277a43[_0x0633('0x17')][_0x0633('0x16')]);}})[_0x0633('0x18')](function(_0x4b7918){logger[_0x0633('0x14')](_0x0633('0x11'),_0x1a33de,_0x4b7918);_0x58dae2(_0x4b7918);});});}
\ No newline at end of file
+var _0xc359=['error','AnalyticExtractedReport,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','request\x20sent','debug','stringify'];(function(_0x19872b,_0x13e82e){var _0x447ec7=function(_0x32dc19){while(--_0x32dc19){_0x19872b['push'](_0x19872b['shift']());}};_0x447ec7(++_0x13e82e);}(_0xc359,0x93));var _0x9c35=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0xc359[_0xbe40ad];return _0x50fac9;};'use strict';var _=require(_0x9c35('0x0'));var util=require('util');var moment=require(_0x9c35('0x1'));var BPromise=require(_0x9c35('0x2'));var rs=require(_0x9c35('0x3'));var fs=require('fs');var Redis=require(_0x9c35('0x4'));var db=require(_0x9c35('0x5'))['db'];var utils=require(_0x9c35('0x6'));var logger=require('../../config/logger')(_0x9c35('0x7'));var config=require(_0x9c35('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31ddc0,_0x5c3b23,_0x3a11dd){return new BPromise(function(_0x44bd09,_0x64ad94){return client[_0x9c35('0xa')](_0x31ddc0,_0x3a11dd)['then'](function(_0x563c85){logger[_0x9c35('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c3b23,_0x9c35('0xc'));logger[_0x9c35('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5c3b23,'request\x20sent',JSON[_0x9c35('0xe')](_0x563c85));if(_0x563c85[_0x9c35('0xf')]){if(_0x563c85[_0x9c35('0xf')]['code']===0x1f4){logger[_0x9c35('0xf')](_0x9c35('0x10'),_0x5c3b23,_0x563c85[_0x9c35('0xf')][_0x9c35('0x11')]);return _0x64ad94(_0x563c85[_0x9c35('0xf')][_0x9c35('0x11')]);}logger['error'](_0x9c35('0x10'),_0x5c3b23,_0x563c85[_0x9c35('0xf')][_0x9c35('0x11')]);return _0x44bd09(_0x563c85[_0x9c35('0xf')][_0x9c35('0x11')]);}else{logger['info'](_0x9c35('0x10'),_0x5c3b23,_0x9c35('0xc'));_0x44bd09(_0x563c85['result'][_0x9c35('0x11')]);}})['catch'](function(_0x5d6314){logger['error'](_0x9c35('0x10'),_0x5c3b23,_0x5d6314);_0x64ad94(_0x5d6314);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0002=['Router','../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','create','put','destroy','exports','multer','path','connect-timeout'];(function(_0x3db78a,_0x164bc){var _0x13c245=function(_0x4294b9){while(--_0x4294b9){_0x3db78a['push'](_0x3db78a['shift']());}};_0x13c245(++_0x164bc);}(_0x0002,0x9d));var _0x2000=function(_0x22ddc2,_0x53c845){_0x22ddc2=_0x22ddc2-0x0;var _0x1ec24f=_0x0002[_0x22ddc2];return _0x1ec24f;};'use strict';var multer=require(_0x2000('0x0'));var util=require('util');var path=require(_0x2000('0x1'));var timeout=require(_0x2000('0x2'));var express=require('express');var router=express[_0x2000('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2000('0x4'));var config=require('../../config/environment');var controller=require(_0x2000('0x5'));router[_0x2000('0x6')]('/',auth['isAuthenticated'](),controller[_0x2000('0x7')]);router[_0x2000('0x6')](_0x2000('0x8'),auth[_0x2000('0x9')](),controller['show']);router['get'](_0x2000('0xa'),auth[_0x2000('0x9')](),controller['download']);router[_0x2000('0xb')]('/',auth[_0x2000('0x9')](),controller[_0x2000('0xc')]);router[_0x2000('0xd')](_0x2000('0x8'),auth[_0x2000('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2000('0xe')]);module[_0x2000('0xf')]=router;
\ No newline at end of file
+var _0x565f=['get','/:id','/:id/download','download','post','create','put','delete','multer','Router','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x4dc503,_0x523e31){var _0x36f0eb=function(_0x498f2a){while(--_0x498f2a){_0x4dc503['push'](_0x4dc503['shift']());}};_0x36f0eb(++_0x523e31);}(_0x565f,0xcc));var _0xf565=function(_0x3d384f,_0x15ae94){_0x3d384f=_0x3d384f-0x0;var _0x1b6462=_0x565f[_0x3d384f];return _0x1b6462;};'use strict';var multer=require(_0xf565('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf565('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xf565('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf565('0x3'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xf565('0x4')](),controller[_0xf565('0x5')]);router[_0xf565('0x6')](_0xf565('0x7'),auth[_0xf565('0x4')](),controller['show']);router[_0xf565('0x6')](_0xf565('0x8'),auth[_0xf565('0x4')](),controller[_0xf565('0x9')]);router[_0xf565('0xa')]('/',auth['isAuthenticated'](),controller[_0xf565('0xb')]);router[_0xf565('0xc')](_0xf565('0x7'),auth['isAuthenticated'](),controller['update']);router[_0xf565('0xd')](_0xf565('0x7'),auth[_0xf565('0x4')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc8fd=['STRING','BOOLEAN','sequelize'];(function(_0xa73752,_0x2081d4){var _0x5a9219=function(_0x438349){while(--_0x438349){_0xa73752['push'](_0xa73752['shift']());}};_0x5a9219(++_0x2081d4);}(_0xc8fd,0x65));var _0xdc8f=function(_0x201d46,_0x4f7e66){_0x201d46=_0x201d46-0x0;var _0x2c384d=_0xc8fd[_0x201d46];return _0x2c384d;};'use strict';var Sequelize=require(_0xdc8f('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdc8f('0x1')]},'function':{'type':Sequelize[_0xdc8f('0x1')]},'format':{'type':Sequelize[_0xdc8f('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdc8f('0x1')]},'custom':{'type':Sequelize[_0xdc8f('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2736=['TEXT','STRING','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2736,0x65));var _0x6273=function(_0x321730,_0x1fb230){_0x321730=_0x321730-0x0;var _0x4344eb=_0x2736[_0x321730];return _0x4344eb;};'use strict';var Sequelize=require('sequelize');module[_0x6273('0x0')]={'field':{'type':Sequelize[_0x6273('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x6273('0x2')]},'format':{'type':Sequelize[_0x6273('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6273('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x87fa=['fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','transaction','rimraf','zip-dir'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x87fa,0xf4));var _0xa87f=function(_0x1f3f8e,_0x4e8ff4){_0x1f3f8e=_0x1f3f8e-0x0;var _0x6f696a=_0x87fa[_0x1f3f8e];return _0x6f696a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa87f('0x0'));var zipdir=require(_0xa87f('0x1'));var jsonpatch=require(_0xa87f('0x2'));var rp=require('request-promise');var moment=require(_0xa87f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa87f('0x4'));var util=require(_0xa87f('0x5'));var path=require(_0xa87f('0x6'));var sox=require(_0xa87f('0x7'));var csv=require(_0xa87f('0x8'));var ejs=require(_0xa87f('0x9'));var fs=require('fs');var fs_extra=require(_0xa87f('0xa'));var _=require(_0xa87f('0xb'));var squel=require(_0xa87f('0xc'));var crypto=require(_0xa87f('0xd'));var jsforce=require(_0xa87f('0xe'));var deskjs=require(_0xa87f('0xf'));var toCsv=require(_0xa87f('0x8'));var querystring=require('querystring');var Papa=require(_0xa87f('0x10'));var Redis=require('ioredis');var authService=require(_0xa87f('0x11'));var qs=require(_0xa87f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa87f('0x13'));var logger=require('../../config/logger')(_0xa87f('0x14'));var utils=require(_0xa87f('0x15'));var config=require(_0xa87f('0x16'));var licenseUtil=require(_0xa87f('0x17'));var db=require(_0xa87f('0x18'))['db'];function respondWithStatusCode(_0x27bbb9,_0x271554){_0x271554=_0x271554||0xcc;return function(_0x390d55){if(_0x390d55){return _0x27bbb9[_0xa87f('0x19')](_0x271554);}return _0x27bbb9[_0xa87f('0x1a')](_0x271554)[_0xa87f('0x1b')]();};}function respondWithResult(_0x57bb3b,_0x15a868){_0x15a868=_0x15a868||0xc8;return function(_0x46438e){if(_0x46438e){return _0x57bb3b[_0xa87f('0x1a')](_0x15a868)['json'](_0x46438e);}};}function respondWithFilteredResult(_0x4d537e,_0x521071){return function(_0x4d9fae){if(_0x4d9fae){var _0x2f686c=typeof _0x521071[_0xa87f('0x1c')]==='undefined'&&typeof _0x521071[_0xa87f('0x1d')]===_0xa87f('0x1e');var _0x158fad=_0x4d9fae[_0xa87f('0x1f')];var _0x2724c0=_0x2f686c?0x0:_0x521071[_0xa87f('0x1c')];var _0x268636=_0x2f686c?_0x4d9fae[_0xa87f('0x1f')]:_0x521071[_0xa87f('0x1c')]+_0x521071['limit'];var _0x33dc81;if(_0x268636>=_0x158fad){_0x268636=_0x158fad;_0x33dc81=0xc8;}else{_0x33dc81=0xce;}_0x4d537e['status'](_0x33dc81);return _0x4d537e[_0xa87f('0x20')](_0xa87f('0x21'),_0x2724c0+'-'+_0x268636+'/'+_0x158fad)[_0xa87f('0x22')](_0x4d9fae);}return null;};}function patchUpdates(_0x458d48){return function(_0x6484fd){try{jsonpatch[_0xa87f('0x23')](_0x6484fd,_0x458d48,!![]);}catch(_0x4300bf){return BPromise['reject'](_0x4300bf);}return _0x6484fd['save']();};}function saveUpdates(_0x108c93,_0xffd5bc){return function(_0x2caa87){if(_0x2caa87){return _0x2caa87[_0xa87f('0x24')](_0x108c93)[_0xa87f('0x25')](function(_0x5ca629){return _0x5ca629;});}return null;};}function removeEntity(_0x1eca22,_0x5bcc50){return function(_0xd454d5){if(_0xd454d5){return _0xd454d5[_0xa87f('0x26')]()[_0xa87f('0x25')](function(){_0x1eca22[_0xa87f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc79580,_0x209f10){return function(_0x20d851){if(!_0x20d851){_0xc79580[_0xa87f('0x19')](0x194);}return _0x20d851;};}function handleError(_0x337c5b,_0x3e314f){_0x3e314f=_0x3e314f||0x1f4;return function(_0x5b6b67){logger[_0xa87f('0x27')](_0x5b6b67[_0xa87f('0x28')]);if(_0x5b6b67[_0xa87f('0x29')]){delete _0x5b6b67[_0xa87f('0x29')];}_0x337c5b['status'](_0x3e314f)[_0xa87f('0x2a')](_0x5b6b67);};}exports['index']=function(_0x575695,_0x2f130c){var _0x2d728b={},_0x24d387={},_0x3a5757={'count':0x0,'rows':[]};var _0x31b073=_['map'](db[_0xa87f('0x2b')][_0xa87f('0x2c')],function(_0x3602fa){return{'name':_0x3602fa[_0xa87f('0x2d')],'type':_0x3602fa[_0xa87f('0x2e')][_0xa87f('0x2f')]};});_0x24d387[_0xa87f('0x30')]=_[_0xa87f('0x31')](_0x31b073,'name');_0x24d387[_0xa87f('0x32')]=_[_0xa87f('0x33')](_0x575695[_0xa87f('0x32')]);_0x24d387[_0xa87f('0x34')]=_[_0xa87f('0x35')](_0x24d387['model'],_0x24d387[_0xa87f('0x32')]);_0x2d728b[_0xa87f('0x36')]=_['intersection'](_0x24d387[_0xa87f('0x30')],qs['fields'](_0x575695[_0xa87f('0x32')][_0xa87f('0x37')]));_0x2d728b[_0xa87f('0x36')]=_0x2d728b['attributes'][_0xa87f('0x38')]?_0x2d728b['attributes']:_0x24d387['model'];if(!_0x575695[_0xa87f('0x32')][_0xa87f('0x39')](_0xa87f('0x3a'))){_0x2d728b['limit']=qs[_0xa87f('0x1d')](_0x575695[_0xa87f('0x32')]['limit']);_0x2d728b[_0xa87f('0x1c')]=qs[_0xa87f('0x1c')](_0x575695[_0xa87f('0x32')]['offset']);}_0x2d728b['order']=qs[_0xa87f('0x3b')](_0x575695['query'][_0xa87f('0x3b')]);_0x2d728b[_0xa87f('0x3c')]=qs['filters'](_[_0xa87f('0x3d')](_0x575695['query'],_0x24d387['filters']),_0x31b073);if(_0x575695[_0xa87f('0x32')][_0xa87f('0x3e')]){_0x2d728b[_0xa87f('0x3c')]=_[_0xa87f('0x3f')](_0x2d728b[_0xa87f('0x3c')],{'$or':_['map'](_0x31b073,function(_0x26d15d){if(_0x26d15d[_0xa87f('0x2e')]!==_0xa87f('0x40')){var _0x4c65a5={};_0x4c65a5[_0x26d15d[_0xa87f('0x29')]]={'$like':'%'+_0x575695[_0xa87f('0x32')][_0xa87f('0x3e')]+'%'};return _0x4c65a5;}})});}_0x2d728b=_['merge']({},_0x2d728b,_0x575695['options']);var _0x4adb9a={'where':_0x2d728b['where']};return db[_0xa87f('0x2b')][_0xa87f('0x1f')](_0x4adb9a)[_0xa87f('0x25')](function(_0x8912d7){_0x3a5757[_0xa87f('0x1f')]=_0x8912d7;if(_0x575695[_0xa87f('0x32')][_0xa87f('0x41')]){_0x2d728b['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa87f('0x42')](_0x2d728b);})['then'](function(_0x34cb1a){_0x3a5757[_0xa87f('0x43')]=_0x34cb1a;return _0x3a5757;})['then'](respondWithFilteredResult(_0x2f130c,_0x2d728b))[_0xa87f('0x44')](handleError(_0x2f130c,null));};exports[_0xa87f('0x45')]=function(_0x1c22fd,_0x807743){var _0x498ef2={'raw':![],'where':{'id':_0x1c22fd[_0xa87f('0x46')]['id']}},_0x17c17d={};_0x17c17d[_0xa87f('0x30')]=_[_0xa87f('0x33')](db[_0xa87f('0x2b')][_0xa87f('0x2c')]);_0x17c17d['query']=_[_0xa87f('0x33')](_0x1c22fd['query']);_0x17c17d['filters']=_[_0xa87f('0x35')](_0x17c17d[_0xa87f('0x30')],_0x17c17d[_0xa87f('0x32')]);_0x498ef2[_0xa87f('0x36')]=_[_0xa87f('0x35')](_0x17c17d['model'],qs[_0xa87f('0x37')](_0x1c22fd[_0xa87f('0x32')][_0xa87f('0x37')]));_0x498ef2[_0xa87f('0x36')]=_0x498ef2[_0xa87f('0x36')]['length']?_0x498ef2[_0xa87f('0x36')]:_0x17c17d[_0xa87f('0x30')];if(_0x1c22fd[_0xa87f('0x32')][_0xa87f('0x41')]){_0x498ef2[_0xa87f('0x47')]=[{'all':!![]}];}_0x498ef2=_[_0xa87f('0x3f')]({},_0x498ef2,_0x1c22fd[_0xa87f('0x48')]);return db[_0xa87f('0x2b')][_0xa87f('0x49')](_0x498ef2)['then'](handleEntityNotFound(_0x807743,null))[_0xa87f('0x25')](respondWithResult(_0x807743,null))[_0xa87f('0x44')](handleError(_0x807743,null));};exports[_0xa87f('0x4a')]=function(_0x5d6638,_0x1eca3a){return db[_0xa87f('0x2b')][_0xa87f('0x4a')](_0x5d6638[_0xa87f('0x4b')],{})[_0xa87f('0x25')](respondWithResult(_0x1eca3a,0xc9))['catch'](handleError(_0x1eca3a,null));};exports[_0xa87f('0x4c')]=function(_0x37571c,_0x2eb6e0){return db['AnalyticFieldReport'][_0xa87f('0x4c')](_0x37571c[_0xa87f('0x4b')],{'raw':![],'individualHooks':!![]})[_0xa87f('0x25')](respondWithResult(_0x2eb6e0,0xc9))[_0xa87f('0x44')](handleError(_0x2eb6e0,null));};exports[_0xa87f('0x24')]=function(_0x18ec58,_0x34f216){if(_0x18ec58[_0xa87f('0x4b')]['id']){delete _0x18ec58['body']['id'];}return db[_0xa87f('0x2b')][_0xa87f('0x49')]({'where':{'id':_0x18ec58[_0xa87f('0x46')]['id']}})[_0xa87f('0x25')](handleEntityNotFound(_0x34f216,null))[_0xa87f('0x25')](saveUpdates(_0x18ec58['body'],null))['then'](respondWithResult(_0x34f216,null))[_0xa87f('0x44')](handleError(_0x34f216,null));};exports[_0xa87f('0x26')]=function(_0x59063a,_0x4489fa){return db[_0xa87f('0x2b')]['find']({'where':{'id':_0x59063a[_0xa87f('0x46')]['id']}})[_0xa87f('0x25')](handleEntityNotFound(_0x4489fa,null))[_0xa87f('0x25')](removeEntity(_0x4489fa,null))[_0xa87f('0x44')](handleError(_0x4489fa,null));};exports[_0xa87f('0x4d')]=function(_0x44e608,_0x50eaef){return db[_0xa87f('0x2b')][_0xa87f('0x26')]({'where':{'id':_0x44e608['query'][_0xa87f('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xa87f('0x25')](respondWithResult(_0x50eaef,0xcc))[_0xa87f('0x44')](handleError(_0x50eaef,null));};exports[_0xa87f('0x4f')]=function(_0x3ba0af,_0x4aa14a,_0x26dec6){return db['AnalyticCustomReport'][_0xa87f('0x50')]({'where':{'id':_0x3ba0af['params']['id']}})['then'](handleEntityNotFound(_0x4aa14a,null))[_0xa87f('0x25')](function(_0x35c396){if(_0x35c396){return db['sequelize'][_0xa87f('0x51')](function(_0x5b5b0a){return db[_0xa87f('0x2b')][_0xa87f('0x26')]({'where':{'CustomReportId':_0x3ba0af['params']['id']},'transaction':_0x5b5b0a})[_0xa87f('0x25')](function(_0x203fd1){var _0x2d0804=_[_0xa87f('0x31')](_0x3ba0af[_0xa87f('0x4b')],function(_0x3e3c60){delete _0x3e3c60['id'];_0x3e3c60['CustomReportId']=_0x3ba0af['params']['id'];return _0x3e3c60;});return db['AnalyticFieldReport'][_0xa87f('0x4c')](_0x2d0804,{'transaction':_0x5b5b0a});});})[_0xa87f('0x25')](function(){return db[_0xa87f('0x2b')][_0xa87f('0x42')]({'where':{'CustomReportId':_0x3ba0af[_0xa87f('0x46')]['id']}});});}})[_0xa87f('0x25')](respondWithResult(_0x4aa14a,null))['catch'](handleError(_0x4aa14a,null));};
\ No newline at end of file
+var _0x3c2a=['catch','show','params','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x3c2a,0x1b2));var _0xa3c2=function(_0xa9e2b4,_0x44c353){_0xa9e2b4=_0xa9e2b4-0x0;var _0x303e2c=_0x3c2a[_0xa9e2b4];return _0x303e2c;};'use strict';var emlformat=require(_0xa3c2('0x0'));var rimraf=require(_0xa3c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3c2('0x2'));var rp=require('request-promise');var moment=require(_0xa3c2('0x3'));var BPromise=require(_0xa3c2('0x4'));var Mustache=require(_0xa3c2('0x5'));var util=require(_0xa3c2('0x6'));var path=require(_0xa3c2('0x7'));var sox=require(_0xa3c2('0x8'));var csv=require(_0xa3c2('0x9'));var ejs=require(_0xa3c2('0xa'));var fs=require('fs');var fs_extra=require(_0xa3c2('0xb'));var _=require(_0xa3c2('0xc'));var squel=require(_0xa3c2('0xd'));var crypto=require(_0xa3c2('0xe'));var jsforce=require(_0xa3c2('0xf'));var deskjs=require(_0xa3c2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa3c2('0x11'));var Redis=require(_0xa3c2('0x12'));var authService=require(_0xa3c2('0x13'));var qs=require(_0xa3c2('0x14'));var as=require(_0xa3c2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3c2('0x16'))('api');var utils=require(_0xa3c2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa3c2('0x18'))['db'];function respondWithStatusCode(_0x90bd7e,_0x555cfb){_0x555cfb=_0x555cfb||0xcc;return function(_0x1b4075){if(_0x1b4075){return _0x90bd7e[_0xa3c2('0x19')](_0x555cfb);}return _0x90bd7e[_0xa3c2('0x1a')](_0x555cfb)[_0xa3c2('0x1b')]();};}function respondWithResult(_0x2737bd,_0x146392){_0x146392=_0x146392||0xc8;return function(_0x508a4b){if(_0x508a4b){return _0x2737bd[_0xa3c2('0x1a')](_0x146392)[_0xa3c2('0x1c')](_0x508a4b);}};}function respondWithFilteredResult(_0x15f55f,_0x417d67){return function(_0x20c068){if(_0x20c068){var _0x329f71=typeof _0x417d67[_0xa3c2('0x1d')]===_0xa3c2('0x1e')&&typeof _0x417d67[_0xa3c2('0x1f')]===_0xa3c2('0x1e');var _0x47a8e4=_0x20c068[_0xa3c2('0x20')];var _0x27a785=_0x329f71?0x0:_0x417d67['offset'];var _0x546fc8=_0x329f71?_0x20c068['count']:_0x417d67[_0xa3c2('0x1d')]+_0x417d67['limit'];var _0x2d8269;if(_0x546fc8>=_0x47a8e4){_0x546fc8=_0x47a8e4;_0x2d8269=0xc8;}else{_0x2d8269=0xce;}_0x15f55f[_0xa3c2('0x1a')](_0x2d8269);return _0x15f55f[_0xa3c2('0x21')](_0xa3c2('0x22'),_0x27a785+'-'+_0x546fc8+'/'+_0x47a8e4)[_0xa3c2('0x1c')](_0x20c068);}return null;};}function patchUpdates(_0xa604e3){return function(_0x114511){try{jsonpatch[_0xa3c2('0x23')](_0x114511,_0xa604e3,!![]);}catch(_0x5a1fac){return BPromise[_0xa3c2('0x24')](_0x5a1fac);}return _0x114511[_0xa3c2('0x25')]();};}function saveUpdates(_0x37cd2f,_0x461660){return function(_0x234966){if(_0x234966){return _0x234966[_0xa3c2('0x26')](_0x37cd2f)[_0xa3c2('0x27')](function(_0x137328){return _0x137328;});}return null;};}function removeEntity(_0x2008d1,_0x59c622){return function(_0x32d744){if(_0x32d744){return _0x32d744[_0xa3c2('0x28')]()[_0xa3c2('0x27')](function(){_0x2008d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f6887,_0x4ddf6b){return function(_0x5d89c0){if(!_0x5d89c0){_0x1f6887['sendStatus'](0x194);}return _0x5d89c0;};}function handleError(_0x2ee578,_0x1e7aa8){_0x1e7aa8=_0x1e7aa8||0x1f4;return function(_0x4532d2){logger['error'](_0x4532d2['stack']);if(_0x4532d2[_0xa3c2('0x29')]){delete _0x4532d2['name'];}_0x2ee578['status'](_0x1e7aa8)[_0xa3c2('0x2a')](_0x4532d2);};}exports[_0xa3c2('0x2b')]=function(_0x395f74,_0x240bc6){var _0x1733b1={},_0x1e9e6f={},_0x28ffff={'count':0x0,'rows':[]};var _0x2c2ac0=_[_0xa3c2('0x2c')](db[_0xa3c2('0x2d')][_0xa3c2('0x2e')],function(_0x3d3367){return{'name':_0x3d3367[_0xa3c2('0x2f')],'type':_0x3d3367[_0xa3c2('0x30')]['key']};});_0x1e9e6f[_0xa3c2('0x31')]=_['map'](_0x2c2ac0,_0xa3c2('0x29'));_0x1e9e6f[_0xa3c2('0x32')]=_[_0xa3c2('0x33')](_0x395f74['query']);_0x1e9e6f['filters']=_[_0xa3c2('0x34')](_0x1e9e6f['model'],_0x1e9e6f[_0xa3c2('0x32')]);_0x1733b1[_0xa3c2('0x35')]=_[_0xa3c2('0x34')](_0x1e9e6f[_0xa3c2('0x31')],qs[_0xa3c2('0x36')](_0x395f74['query'][_0xa3c2('0x36')]));_0x1733b1[_0xa3c2('0x35')]=_0x1733b1[_0xa3c2('0x35')][_0xa3c2('0x37')]?_0x1733b1[_0xa3c2('0x35')]:_0x1e9e6f[_0xa3c2('0x31')];if(!_0x395f74[_0xa3c2('0x32')][_0xa3c2('0x38')](_0xa3c2('0x39'))){_0x1733b1['limit']=qs[_0xa3c2('0x1f')](_0x395f74[_0xa3c2('0x32')][_0xa3c2('0x1f')]);_0x1733b1['offset']=qs[_0xa3c2('0x1d')](_0x395f74[_0xa3c2('0x32')][_0xa3c2('0x1d')]);}_0x1733b1[_0xa3c2('0x3a')]=qs[_0xa3c2('0x3b')](_0x395f74['query']['sort']);_0x1733b1['where']=qs[_0xa3c2('0x3c')](_[_0xa3c2('0x3d')](_0x395f74[_0xa3c2('0x32')],_0x1e9e6f[_0xa3c2('0x3c')]),_0x2c2ac0);if(_0x395f74[_0xa3c2('0x32')][_0xa3c2('0x3e')]){_0x1733b1[_0xa3c2('0x3f')]=_['merge'](_0x1733b1['where'],{'$or':_[_0xa3c2('0x2c')](_0x2c2ac0,function(_0x219862){if(_0x219862['type']!==_0xa3c2('0x40')){var _0x42c134={};_0x42c134[_0x219862[_0xa3c2('0x29')]]={'$like':'%'+_0x395f74[_0xa3c2('0x32')][_0xa3c2('0x3e')]+'%'};return _0x42c134;}})});}_0x1733b1=_[_0xa3c2('0x41')]({},_0x1733b1,_0x395f74['options']);var _0x3852c3={'where':_0x1733b1[_0xa3c2('0x3f')]};return db['AnalyticFieldReport']['count'](_0x3852c3)[_0xa3c2('0x27')](function(_0x1bd4dc){_0x28ffff[_0xa3c2('0x20')]=_0x1bd4dc;if(_0x395f74['query'][_0xa3c2('0x42')]){_0x1733b1[_0xa3c2('0x43')]=[{'all':!![]}];}return db[_0xa3c2('0x2d')][_0xa3c2('0x44')](_0x1733b1);})[_0xa3c2('0x27')](function(_0x4ce1dd){_0x28ffff[_0xa3c2('0x45')]=_0x4ce1dd;return _0x28ffff;})[_0xa3c2('0x27')](respondWithFilteredResult(_0x240bc6,_0x1733b1))[_0xa3c2('0x46')](handleError(_0x240bc6,null));};exports[_0xa3c2('0x47')]=function(_0x4bfcde,_0x53f8c4){var _0xfe0c9f={'raw':![],'where':{'id':_0x4bfcde[_0xa3c2('0x48')]['id']}},_0x47fcb4={};_0x47fcb4[_0xa3c2('0x31')]=_[_0xa3c2('0x33')](db[_0xa3c2('0x2d')][_0xa3c2('0x2e')]);_0x47fcb4[_0xa3c2('0x32')]=_[_0xa3c2('0x33')](_0x4bfcde[_0xa3c2('0x32')]);_0x47fcb4[_0xa3c2('0x3c')]=_[_0xa3c2('0x34')](_0x47fcb4[_0xa3c2('0x31')],_0x47fcb4[_0xa3c2('0x32')]);_0xfe0c9f[_0xa3c2('0x35')]=_[_0xa3c2('0x34')](_0x47fcb4[_0xa3c2('0x31')],qs['fields'](_0x4bfcde[_0xa3c2('0x32')][_0xa3c2('0x36')]));_0xfe0c9f[_0xa3c2('0x35')]=_0xfe0c9f[_0xa3c2('0x35')][_0xa3c2('0x37')]?_0xfe0c9f[_0xa3c2('0x35')]:_0x47fcb4['model'];if(_0x4bfcde['query'][_0xa3c2('0x42')]){_0xfe0c9f['include']=[{'all':!![]}];}_0xfe0c9f=_[_0xa3c2('0x41')]({},_0xfe0c9f,_0x4bfcde[_0xa3c2('0x49')]);return db['AnalyticFieldReport'][_0xa3c2('0x4a')](_0xfe0c9f)['then'](handleEntityNotFound(_0x53f8c4,null))[_0xa3c2('0x27')](respondWithResult(_0x53f8c4,null))[_0xa3c2('0x46')](handleError(_0x53f8c4,null));};exports[_0xa3c2('0x4b')]=function(_0x181b16,_0x3ef995){return db[_0xa3c2('0x2d')][_0xa3c2('0x4b')](_0x181b16[_0xa3c2('0x4c')],{})[_0xa3c2('0x27')](respondWithResult(_0x3ef995,0xc9))[_0xa3c2('0x46')](handleError(_0x3ef995,null));};exports[_0xa3c2('0x4d')]=function(_0x4ffc02,_0x4a63ea){return db[_0xa3c2('0x2d')][_0xa3c2('0x4d')](_0x4ffc02[_0xa3c2('0x4c')],{'raw':![],'individualHooks':!![]})[_0xa3c2('0x27')](respondWithResult(_0x4a63ea,0xc9))['catch'](handleError(_0x4a63ea,null));};exports[_0xa3c2('0x26')]=function(_0x48b72a,_0x1f570f){if(_0x48b72a[_0xa3c2('0x4c')]['id']){delete _0x48b72a[_0xa3c2('0x4c')]['id'];}return db[_0xa3c2('0x2d')][_0xa3c2('0x4a')]({'where':{'id':_0x48b72a['params']['id']}})[_0xa3c2('0x27')](handleEntityNotFound(_0x1f570f,null))['then'](saveUpdates(_0x48b72a[_0xa3c2('0x4c')],null))[_0xa3c2('0x27')](respondWithResult(_0x1f570f,null))[_0xa3c2('0x46')](handleError(_0x1f570f,null));};exports['destroy']=function(_0x56dc91,_0x46b629){return db[_0xa3c2('0x2d')][_0xa3c2('0x4a')]({'where':{'id':_0x56dc91[_0xa3c2('0x48')]['id']}})[_0xa3c2('0x27')](handleEntityNotFound(_0x46b629,null))['then'](removeEntity(_0x46b629,null))[_0xa3c2('0x46')](handleError(_0x46b629,null));};exports[_0xa3c2('0x4e')]=function(_0x4bc4b6,_0xd03b1f){return db[_0xa3c2('0x2d')][_0xa3c2('0x28')]({'where':{'id':_0x4bc4b6[_0xa3c2('0x32')][_0xa3c2('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xd03b1f,0xcc))[_0xa3c2('0x46')](handleError(_0xd03b1f,null));};exports[_0xa3c2('0x50')]=function(_0x137d10,_0x16bf5d,_0x291863){return db[_0xa3c2('0x51')][_0xa3c2('0x52')]({'where':{'id':_0x137d10[_0xa3c2('0x48')]['id']}})[_0xa3c2('0x27')](handleEntityNotFound(_0x16bf5d,null))['then'](function(_0x37d2e1){if(_0x37d2e1){return db[_0xa3c2('0x53')]['transaction'](function(_0x58e915){return db[_0xa3c2('0x2d')][_0xa3c2('0x28')]({'where':{'CustomReportId':_0x137d10[_0xa3c2('0x48')]['id']},'transaction':_0x58e915})[_0xa3c2('0x27')](function(_0xebe462){var _0x356d5b=_[_0xa3c2('0x2c')](_0x137d10[_0xa3c2('0x4c')],function(_0x2e1a05){delete _0x2e1a05['id'];_0x2e1a05['CustomReportId']=_0x137d10[_0xa3c2('0x48')]['id'];return _0x2e1a05;});return db[_0xa3c2('0x2d')][_0xa3c2('0x4d')](_0x356d5b,{'transaction':_0x58e915});});})[_0xa3c2('0x27')](function(){return db[_0xa3c2('0x2d')][_0xa3c2('0x44')]({'where':{'CustomReportId':_0x137d10[_0xa3c2('0x48')]['id']}});});}})[_0xa3c2('0x27')](respondWithResult(_0x16bf5d,null))[_0xa3c2('0x46')](handleError(_0x16bf5d,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe94c=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x2b3daa,_0xca962b){var _0x3be130=function(_0x2e323f){while(--_0x2e323f){_0x2b3daa['push'](_0x2b3daa['shift']());}};_0x3be130(++_0xca962b);}(_0xe94c,0x181));var _0xce94=function(_0x10aae4,_0x4778e7){_0x10aae4=_0x10aae4-0x0;var _0x5ec719=_0xe94c[_0x10aae4];return _0x5ec719;};'use strict';var _=require(_0xce94('0x0'));var util=require(_0xce94('0x1'));var logger=require(_0xce94('0x2'))(_0xce94('0x3'));var moment=require(_0xce94('0x4'));var BPromise=require('bluebird');var rp=require(_0xce94('0x5'));var fs=require('fs');var path=require(_0xce94('0x6'));var rimraf=require('rimraf');var config=require(_0xce94('0x7'));var attributes=require(_0xce94('0x8'));module[_0xce94('0x9')]=function(_0x1c66bc,_0x1f593c){return _0x1c66bc[_0xce94('0xa')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0359=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0x0359,0x1b8));var _0x9035=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x0359[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x9035('0x0'));var logger=require(_0x9035('0x1'))(_0x9035('0x2'));var moment=require(_0x9035('0x3'));var BPromise=require(_0x9035('0x4'));var rp=require(_0x9035('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9035('0x6'));var config=require(_0x9035('0x7'));var attributes=require(_0x9035('0x8'));module[_0x9035('0x9')]=function(_0x586220,_0x28b094){return _0x586220[_0x9035('0xa')](_0x9035('0xb'),attributes,{'tableName':_0x9035('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf242=['stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x4b4089,_0x3c1da8){var _0x3cbf9a=function(_0x5db149){while(--_0x5db149){_0x4b4089['push'](_0x4b4089['shift']());}};_0x3cbf9a(++_0x3c1da8);}(_0xf242,0x17b));var _0x2f24=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xf242[_0x2742db];return _0x18659e;};'use strict';var _=require(_0x2f24('0x0'));var util=require(_0x2f24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f24('0x2'));var fs=require('fs');var Redis=require(_0x2f24('0x3'));var db=require(_0x2f24('0x4'))['db'];var utils=require(_0x2f24('0x5'));var logger=require(_0x2f24('0x6'))(_0x2f24('0x7'));var config=require(_0x2f24('0x8'));var jayson=require(_0x2f24('0x9'));var client=jayson[_0x2f24('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49397f,_0x5e2da1,_0x1ce934){return new BPromise(function(_0x2846f0,_0x1cda04){return client['request'](_0x49397f,_0x1ce934)[_0x2f24('0xb')](function(_0x3351b1){logger[_0x2f24('0xc')](_0x2f24('0xd'),_0x5e2da1,_0x2f24('0xe'));logger[_0x2f24('0xf')](_0x2f24('0x10'),_0x5e2da1,_0x2f24('0xe'),JSON[_0x2f24('0x11')](_0x3351b1));if(_0x3351b1[_0x2f24('0x12')]){if(_0x3351b1[_0x2f24('0x12')][_0x2f24('0x13')]===0x1f4){logger[_0x2f24('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5e2da1,_0x3351b1['error'][_0x2f24('0x14')]);return _0x1cda04(_0x3351b1[_0x2f24('0x12')][_0x2f24('0x14')]);}logger[_0x2f24('0x12')](_0x2f24('0xd'),_0x5e2da1,_0x3351b1['error'][_0x2f24('0x14')]);return _0x2846f0(_0x3351b1[_0x2f24('0x12')]['message']);}else{logger[_0x2f24('0xc')](_0x2f24('0xd'),_0x5e2da1,_0x2f24('0xe'));_0x2846f0(_0x3351b1['result'][_0x2f24('0x14')]);}})[_0x2f24('0x15')](function(_0x5ad6a9){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5e2da1,_0x5ad6a9);_0x1cda04(_0x5ad6a9);});});}
\ No newline at end of file
+var _0x6209=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6209,0x1cb));var _0x9620=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6209[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x9620('0x0'));var util=require(_0x9620('0x1'));var moment=require(_0x9620('0x2'));var BPromise=require(_0x9620('0x3'));var rs=require(_0x9620('0x4'));var fs=require('fs');var Redis=require(_0x9620('0x5'));var db=require(_0x9620('0x6'))['db'];var utils=require(_0x9620('0x7'));var logger=require(_0x9620('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9620('0x9'));var client=jayson[_0x9620('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa906e4,_0x4cab3f,_0x21c482){return new BPromise(function(_0x47c0cc,_0x44d547){return client[_0x9620('0xb')](_0xa906e4,_0x21c482)['then'](function(_0x596531){logger[_0x9620('0xc')](_0x9620('0xd'),_0x4cab3f,_0x9620('0xe'));logger['debug'](_0x9620('0xf'),_0x4cab3f,'request\x20sent',JSON[_0x9620('0x10')](_0x596531));if(_0x596531[_0x9620('0x11')]){if(_0x596531['error'][_0x9620('0x12')]===0x1f4){logger[_0x9620('0x11')](_0x9620('0xd'),_0x4cab3f,_0x596531[_0x9620('0x11')][_0x9620('0x13')]);return _0x44d547(_0x596531[_0x9620('0x11')][_0x9620('0x13')]);}logger[_0x9620('0x11')](_0x9620('0xd'),_0x4cab3f,_0x596531[_0x9620('0x11')]['message']);return _0x47c0cc(_0x596531[_0x9620('0x11')][_0x9620('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4cab3f,_0x9620('0xe'));_0x47c0cc(_0x596531[_0x9620('0x14')][_0x9620('0x13')]);}})[_0x9620('0x15')](function(_0x293c45){logger[_0x9620('0x11')](_0x9620('0xd'),_0x4cab3f,_0x293c45);_0x44d547(_0x293c45);});});}
\ No newline at end of file
// * 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(_0x165ffc,_0x3f9d50){var _0xe2cb59=function(_0x56877a){while(--_0x56877a){_0x165ffc['push'](_0x165ffc['shift']());}};_0xe2cb59(++_0x3f9d50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x48852e,_0xa2321f){var _0x32c022=function(_0x88309d){while(--_0x88309d){_0x48852e['push'](_0x48852e['shift']());}};_0x32c022(++_0xa2321f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc041=['sequelize','exports','name','TEXT','STRING'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xc041,0x1ea));var _0x1c04=function(_0x2d9f8b,_0x1eca48){_0x2d9f8b=_0x2d9f8b-0x0;var _0x251209=_0xc041[_0x2d9f8b];return _0x251209;};'use strict';var Sequelize=require(_0x1c04('0x0'));module[_0x1c04('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1c04('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c04('0x3')]},'description':{'type':Sequelize[_0x1c04('0x4')]}};
\ No newline at end of file
+var _0x74b1=['STRING','sequelize','exports','name'];(function(_0x2c646f,_0x23c3f8){var _0x2859f6=function(_0x5f2da8){while(--_0x5f2da8){_0x2c646f['push'](_0x2c646f['shift']());}};_0x2859f6(++_0x23c3f8);}(_0x74b1,0xb5));var _0x174b=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x74b1[_0x5b740b];return _0x6f8f4e;};'use strict';var Sequelize=require(_0x174b('0x0'));module[_0x174b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x174b('0x2')},'table':{'type':Sequelize[_0x174b('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x174b('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x41709d,_0x16eb76){var _0x169a7b=function(_0xb6b286){while(--_0xb6b286){_0x41709d['push'](_0x41709d['shift']());}};_0x169a7b(++_0x16eb76);}(_0xa41a,0x6b));var _0xaa41=function(_0xc12adf,_0x155b20){_0xc12adf=_0xc12adf-0x0;var _0x59c398=_0xa41a[_0xc12adf];return _0x59c398;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x291c1b,_0x5216a6){var _0x2109c9=function(_0x498cbf){while(--_0x498cbf){_0x291c1b['push'](_0x291c1b['shift']());}};_0x2109c9(++_0x5216a6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x7f509e,_0x445f20){_0x7f509e=_0x7f509e-0x0;var _0x5bc2ac=_0x8d0e[_0x7f509e];return _0x5bc2ac;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80c3=['define','AnalyticMetric','analytics_metrics','lodash','api','bluebird','request-promise','path','exports'];(function(_0x1fa06d,_0x4976b2){var _0x141b7f=function(_0x54f37f){while(--_0x54f37f){_0x1fa06d['push'](_0x1fa06d['shift']());}};_0x141b7f(++_0x4976b2);}(_0x80c3,0x18f));var _0x380c=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x80c3[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x380c('0x1'));var moment=require('moment');var BPromise=require(_0x380c('0x2'));var rp=require(_0x380c('0x3'));var fs=require('fs');var path=require(_0x380c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x380c('0x5')]=function(_0x595b66,_0x581c96){return _0x595b66[_0x380c('0x6')](_0x380c('0x7'),attributes,{'tableName':_0x380c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa423=['./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0xa423,0x16c));var _0x3a42=function(_0x5013bd,_0x4d4b8d){_0x5013bd=_0x5013bd-0x0;var _0x5d3e13=_0xa423[_0x5013bd];return _0x5d3e13;};'use strict';var _=require(_0x3a42('0x0'));var util=require(_0x3a42('0x1'));var logger=require(_0x3a42('0x2'))(_0x3a42('0x3'));var moment=require(_0x3a42('0x4'));var BPromise=require('bluebird');var rp=require(_0x3a42('0x5'));var fs=require('fs');var path=require(_0x3a42('0x6'));var rimraf=require('rimraf');var config=require(_0x3a42('0x7'));var attributes=require(_0x3a42('0x8'));module[_0x3a42('0x9')]=function(_0x1bbd5b,_0x3a83e1){return _0x1bbd5b['define'](_0x3a42('0xa'),attributes,{'tableName':_0x3a42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9274=['then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1c8767,_0x291edb){var _0x170bc1=function(_0x557b87){while(--_0x557b87){_0x1c8767['push'](_0x1c8767['shift']());}};_0x170bc1(++_0x291edb);}(_0x9274,0x1e6));var _0x4927=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9274[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x4927('0x0'));var util=require(_0x4927('0x1'));var moment=require(_0x4927('0x2'));var BPromise=require(_0x4927('0x3'));var rs=require(_0x4927('0x4'));var fs=require('fs');var Redis=require(_0x4927('0x5'));var db=require(_0x4927('0x6'))['db'];var utils=require(_0x4927('0x7'));var logger=require(_0x4927('0x8'))(_0x4927('0x9'));var config=require(_0x4927('0xa'));var jayson=require(_0x4927('0xb'));var client=jayson[_0x4927('0xc')][_0x4927('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x276c16,_0x1a2e1a,_0x318e47){return new BPromise(function(_0xae5445,_0x5002a8){return client['request'](_0x276c16,_0x318e47)[_0x4927('0xe')](function(_0x4d3ba0){logger[_0x4927('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x1a2e1a,'request\x20sent');logger[_0x4927('0x10')](_0x4927('0x11'),_0x1a2e1a,_0x4927('0x12'),JSON['stringify'](_0x4d3ba0));if(_0x4d3ba0[_0x4927('0x13')]){if(_0x4d3ba0[_0x4927('0x13')][_0x4927('0x14')]===0x1f4){logger[_0x4927('0x13')](_0x4927('0x15'),_0x1a2e1a,_0x4d3ba0['error']['message']);return _0x5002a8(_0x4d3ba0[_0x4927('0x13')][_0x4927('0x16')]);}logger[_0x4927('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1a2e1a,_0x4d3ba0[_0x4927('0x13')][_0x4927('0x16')]);return _0xae5445(_0x4d3ba0[_0x4927('0x13')][_0x4927('0x16')]);}else{logger[_0x4927('0xf')](_0x4927('0x15'),_0x1a2e1a,_0x4927('0x12'));_0xae5445(_0x4d3ba0[_0x4927('0x17')][_0x4927('0x16')]);}})[_0x4927('0x18')](function(_0x2f77bb){logger[_0x4927('0x13')](_0x4927('0x15'),_0x1a2e1a,_0x2f77bb);_0x5002a8(_0x2f77bb);});});}
\ No newline at end of file
+var _0xa205=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa205,0x106));var _0x5a20=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0xa205[_0x71b765];return _0x34cb24;};'use strict';var _=require(_0x5a20('0x0'));var util=require(_0x5a20('0x1'));var moment=require(_0x5a20('0x2'));var BPromise=require(_0x5a20('0x3'));var rs=require(_0x5a20('0x4'));var fs=require('fs');var Redis=require(_0x5a20('0x5'));var db=require(_0x5a20('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a20('0x7'))(_0x5a20('0x8'));var config=require(_0x5a20('0x9'));var jayson=require(_0x5a20('0xa'));var client=jayson[_0x5a20('0xb')][_0x5a20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5df237,_0x4f0d38,_0x4af1c0){return new BPromise(function(_0x231704,_0xddd2d5){return client[_0x5a20('0xd')](_0x5df237,_0x4af1c0)['then'](function(_0x251081){logger[_0x5a20('0xe')](_0x5a20('0xf'),_0x4f0d38,_0x5a20('0x10'));logger[_0x5a20('0x11')](_0x5a20('0x12'),_0x4f0d38,_0x5a20('0x10'),JSON[_0x5a20('0x13')](_0x251081));if(_0x251081[_0x5a20('0x14')]){if(_0x251081[_0x5a20('0x14')][_0x5a20('0x15')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4f0d38,_0x251081[_0x5a20('0x14')]['message']);return _0xddd2d5(_0x251081['error'][_0x5a20('0x16')]);}logger[_0x5a20('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x4f0d38,_0x251081['error']['message']);return _0x231704(_0x251081['error'][_0x5a20('0x16')]);}else{logger[_0x5a20('0xe')](_0x5a20('0xf'),_0x4f0d38,_0x5a20('0x10'));_0x231704(_0x251081[_0x5a20('0x17')][_0x5a20('0x16')]);}})['catch'](function(_0x1429a4){logger['error'](_0x5a20('0xf'),_0x4f0d38,_0x1429a4);_0xddd2d5(_0x1429a4);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','create','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6aa7,0x178));var _0x76aa=function(_0x41dd56,_0x1dc334){_0x41dd56=_0x41dd56-0x0;var _0x50483c=_0x6aa7[_0x41dd56];return _0x50483c;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xb')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xc')]);router['put'](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);module[_0x76aa('0x10')]=router;
\ No newline at end of file
+var _0xf9d5=['get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x2645bd,_0x1527ba){var _0x1858c3=function(_0x4329fc){while(--_0x4329fc){_0x2645bd['push'](_0x2645bd['shift']());}};_0x1858c3(++_0x1527ba);}(_0xf9d5,0x122));var _0x5f9d=function(_0x65980,_0x4aee7d){_0x65980=_0x65980-0x0;var _0x24a560=_0xf9d5[_0x65980];return _0x24a560;};'use strict';var multer=require('multer');var util=require(_0x5f9d('0x0'));var path=require(_0x5f9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x5f9d('0x2'));var router=express[_0x5f9d('0x3')]();var fs_extra=require(_0x5f9d('0x4'));var auth=require(_0x5f9d('0x5'));var interaction=require(_0x5f9d('0x6'));var config=require(_0x5f9d('0x7'));var controller=require(_0x5f9d('0x8'));router['get']('/',auth[_0x5f9d('0x9')](),controller['index']);router[_0x5f9d('0xa')](_0x5f9d('0xb'),auth['isAuthenticated'](),controller[_0x5f9d('0xc')]);router[_0x5f9d('0xd')]('/',auth[_0x5f9d('0x9')](),controller[_0x5f9d('0xe')]);router[_0x5f9d('0xf')](_0x5f9d('0xb'),auth['isAuthenticated'](),controller[_0x5f9d('0x10')]);router[_0x5f9d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5f9d('0x12')]);module[_0x5f9d('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb205=['sequelize','exports','TEXT'];(function(_0x29d09e,_0x4c89ea){var _0x588601=function(_0x59a21e){while(--_0x59a21e){_0x29d09e['push'](_0x29d09e['shift']());}};_0x588601(++_0x4c89ea);}(_0xb205,0xcc));var _0x5b20=function(_0x3722ce,_0x47c628){_0x3722ce=_0x3722ce-0x0;var _0x28ab82=_0xb205[_0x3722ce];return _0x28ab82;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'tree':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x0111=['sequelize','exports','TEXT'];(function(_0x1c7539,_0x52a502){var _0x42bdfa=function(_0xb0ca14){while(--_0xb0ca14){_0x1c7539['push'](_0x1c7539['shift']());}};_0x42bdfa(++_0x52a502);}(_0x0111,0x150));var _0x1011=function(_0x25dcfb,_0x349de8){_0x25dcfb=_0x25dcfb-0x0;var _0x1b4801=_0x0111[_0x25dcfb];return _0x1b4801;};'use strict';var Sequelize=require(_0x1011('0x0'));module[_0x1011('0x1')]={'tree':{'type':Sequelize[_0x1011('0x2')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4622=['VIRTUAL','merge','includeAll','catch','show','params','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x4622,0x9b));var _0x2462=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x4622[_0x19159a];return _0xa677f4;};'use strict';var emlformat=require(_0x2462('0x0'));var rimraf=require(_0x2462('0x1'));var zipdir=require(_0x2462('0x2'));var jsonpatch=require(_0x2462('0x3'));var rp=require(_0x2462('0x4'));var moment=require('moment');var BPromise=require(_0x2462('0x5'));var Mustache=require(_0x2462('0x6'));var util=require('util');var path=require(_0x2462('0x7'));var sox=require('sox');var csv=require(_0x2462('0x8'));var ejs=require(_0x2462('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2462('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2462('0xb'));var deskjs=require(_0x2462('0xc'));var toCsv=require(_0x2462('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2462('0xd'));var qs=require(_0x2462('0xe'));var as=require(_0x2462('0xf'));var hardwareService=require(_0x2462('0x10'));var logger=require(_0x2462('0x11'))('api');var utils=require(_0x2462('0x12'));var config=require(_0x2462('0x13'));var licenseUtil=require(_0x2462('0x14'));var db=require(_0x2462('0x15'))['db'];function respondWithStatusCode(_0x2d9e50,_0x400727){_0x400727=_0x400727||0xcc;return function(_0x30138a){if(_0x30138a){return _0x2d9e50[_0x2462('0x16')](_0x400727);}return _0x2d9e50[_0x2462('0x17')](_0x400727)[_0x2462('0x18')]();};}function respondWithResult(_0x28c624,_0x3f4b74){_0x3f4b74=_0x3f4b74||0xc8;return function(_0xa67212){if(_0xa67212){return _0x28c624[_0x2462('0x17')](_0x3f4b74)['json'](_0xa67212);}};}function respondWithFilteredResult(_0x3c930e,_0x41da10){return function(_0x116736){if(_0x116736){var _0x2388f6=typeof _0x41da10[_0x2462('0x19')]===_0x2462('0x1a')&&typeof _0x41da10[_0x2462('0x1b')]===_0x2462('0x1a');var _0x5d60ee=_0x116736[_0x2462('0x1c')];var _0x420335=_0x2388f6?0x0:_0x41da10[_0x2462('0x19')];var _0x2368f5=_0x2388f6?_0x116736['count']:_0x41da10[_0x2462('0x19')]+_0x41da10[_0x2462('0x1b')];var _0x2eda25;if(_0x2368f5>=_0x5d60ee){_0x2368f5=_0x5d60ee;_0x2eda25=0xc8;}else{_0x2eda25=0xce;}_0x3c930e[_0x2462('0x17')](_0x2eda25);return _0x3c930e[_0x2462('0x1d')](_0x2462('0x1e'),_0x420335+'-'+_0x2368f5+'/'+_0x5d60ee)[_0x2462('0x1f')](_0x116736);}return null;};}function patchUpdates(_0x5c12d8){return function(_0x20a1e2){try{jsonpatch['apply'](_0x20a1e2,_0x5c12d8,!![]);}catch(_0x328fd6){return BPromise[_0x2462('0x20')](_0x328fd6);}return _0x20a1e2[_0x2462('0x21')]();};}function saveUpdates(_0xf51b34,_0x45820a){return function(_0x2e8b49){if(_0x2e8b49){return _0x2e8b49[_0x2462('0x22')](_0xf51b34)['then'](function(_0x5596d1){return _0x5596d1;});}return null;};}function removeEntity(_0x139e95,_0x528b82){return function(_0x28a81b){if(_0x28a81b){return _0x28a81b[_0x2462('0x23')]()[_0x2462('0x24')](function(){_0x139e95['status'](0xcc)[_0x2462('0x18')]();});}};}function handleEntityNotFound(_0x237be7,_0xde06e9){return function(_0xdb517c){if(!_0xdb517c){_0x237be7[_0x2462('0x16')](0x194);}return _0xdb517c;};}function handleError(_0x1b1b9a,_0x1d0f57){_0x1d0f57=_0x1d0f57||0x1f4;return function(_0x558eca){logger[_0x2462('0x25')](_0x558eca[_0x2462('0x26')]);if(_0x558eca[_0x2462('0x27')]){delete _0x558eca[_0x2462('0x27')];}_0x1b1b9a[_0x2462('0x17')](_0x1d0f57)[_0x2462('0x28')](_0x558eca);};}exports[_0x2462('0x29')]=function(_0x466e69,_0x1f378d){var _0xa979d7={},_0x25603c={},_0x4b7147={'count':0x0,'rows':[]};var _0x43318a=_[_0x2462('0x2a')](db[_0x2462('0x2b')][_0x2462('0x2c')],function(_0x12bb42){return{'name':_0x12bb42['fieldName'],'type':_0x12bb42[_0x2462('0x2d')][_0x2462('0x2e')]};});_0x25603c[_0x2462('0x2f')]=_['map'](_0x43318a,'name');_0x25603c['query']=_[_0x2462('0x30')](_0x466e69[_0x2462('0x31')]);_0x25603c[_0x2462('0x32')]=_[_0x2462('0x33')](_0x25603c[_0x2462('0x2f')],_0x25603c['query']);_0xa979d7['attributes']=_[_0x2462('0x33')](_0x25603c['model'],qs['fields'](_0x466e69[_0x2462('0x31')][_0x2462('0x34')]));_0xa979d7['attributes']=_0xa979d7[_0x2462('0x35')][_0x2462('0x36')]?_0xa979d7['attributes']:_0x25603c[_0x2462('0x2f')];if(!_0x466e69[_0x2462('0x31')][_0x2462('0x37')](_0x2462('0x38'))){_0xa979d7[_0x2462('0x1b')]=qs['limit'](_0x466e69['query']['limit']);_0xa979d7[_0x2462('0x19')]=qs['offset'](_0x466e69[_0x2462('0x31')]['offset']);}_0xa979d7['order']=qs[_0x2462('0x39')](_0x466e69[_0x2462('0x31')]['sort']);_0xa979d7[_0x2462('0x3a')]=qs[_0x2462('0x32')](_[_0x2462('0x3b')](_0x466e69[_0x2462('0x31')],_0x25603c[_0x2462('0x32')]),_0x43318a);if(_0x466e69[_0x2462('0x31')][_0x2462('0x3c')]){_0xa979d7[_0x2462('0x3a')]=_['merge'](_0xa979d7[_0x2462('0x3a')],{'$or':_[_0x2462('0x2a')](_0x43318a,function(_0x12ed7d){if(_0x12ed7d[_0x2462('0x2d')]!==_0x2462('0x3d')){var _0x2131c0={};_0x2131c0[_0x12ed7d[_0x2462('0x27')]]={'$like':'%'+_0x466e69[_0x2462('0x31')][_0x2462('0x3c')]+'%'};return _0x2131c0;}})});}_0xa979d7=_[_0x2462('0x3e')]({},_0xa979d7,_0x466e69['options']);var _0x2548e2={'where':_0xa979d7[_0x2462('0x3a')]};return db['AnalyticTreeReport']['count'](_0x2548e2)[_0x2462('0x24')](function(_0x4b4e0b){_0x4b7147['count']=_0x4b4e0b;if(_0x466e69[_0x2462('0x31')][_0x2462('0x3f')]){_0xa979d7['include']=[{'all':!![]}];}return db[_0x2462('0x2b')]['findAll'](_0xa979d7);})[_0x2462('0x24')](function(_0x29fb6c){_0x4b7147['rows']=_0x29fb6c;return _0x4b7147;})[_0x2462('0x24')](respondWithFilteredResult(_0x1f378d,_0xa979d7))[_0x2462('0x40')](handleError(_0x1f378d,null));};exports[_0x2462('0x41')]=function(_0x5b2a63,_0x5b2fd7){var _0x4194b1={'raw':!![],'where':{'id':_0x5b2a63[_0x2462('0x42')]['id']}},_0x4cdd5f={};_0x4cdd5f[_0x2462('0x2f')]=_[_0x2462('0x30')](db[_0x2462('0x2b')][_0x2462('0x2c')]);_0x4cdd5f[_0x2462('0x31')]=_['keys'](_0x5b2a63[_0x2462('0x31')]);_0x4cdd5f[_0x2462('0x32')]=_[_0x2462('0x33')](_0x4cdd5f[_0x2462('0x2f')],_0x4cdd5f[_0x2462('0x31')]);_0x4194b1[_0x2462('0x35')]=_[_0x2462('0x33')](_0x4cdd5f[_0x2462('0x2f')],qs[_0x2462('0x34')](_0x5b2a63['query'][_0x2462('0x34')]));_0x4194b1[_0x2462('0x35')]=_0x4194b1[_0x2462('0x35')][_0x2462('0x36')]?_0x4194b1[_0x2462('0x35')]:_0x4cdd5f['model'];if(_0x5b2a63[_0x2462('0x31')][_0x2462('0x3f')]){_0x4194b1[_0x2462('0x43')]=[{'all':!![]}];}_0x4194b1=_[_0x2462('0x3e')]({},_0x4194b1,_0x5b2a63[_0x2462('0x44')]);return db[_0x2462('0x2b')][_0x2462('0x45')](_0x4194b1)['then'](handleEntityNotFound(_0x5b2fd7,null))[_0x2462('0x24')](respondWithResult(_0x5b2fd7,null))[_0x2462('0x40')](handleError(_0x5b2fd7,null));};exports[_0x2462('0x46')]=function(_0x1ec094,_0x4da2ed){return db['AnalyticTreeReport'][_0x2462('0x46')](_0x1ec094[_0x2462('0x47')],{})[_0x2462('0x24')](respondWithResult(_0x4da2ed,0xc9))[_0x2462('0x40')](handleError(_0x4da2ed,null));};exports[_0x2462('0x22')]=function(_0x1a8624,_0x595178){if(_0x1a8624['body']['id']){delete _0x1a8624['body']['id'];}return db[_0x2462('0x2b')]['find']({'where':{'id':_0x1a8624[_0x2462('0x42')]['id']}})['then'](handleEntityNotFound(_0x595178,null))[_0x2462('0x24')](saveUpdates(_0x1a8624[_0x2462('0x47')],null))[_0x2462('0x24')](respondWithResult(_0x595178,null))[_0x2462('0x40')](handleError(_0x595178,null));};exports[_0x2462('0x23')]=function(_0x27de88,_0x6c4ead){return db[_0x2462('0x2b')][_0x2462('0x45')]({'where':{'id':_0x27de88[_0x2462('0x42')]['id']}})['then'](handleEntityNotFound(_0x6c4ead,null))[_0x2462('0x24')](removeEntity(_0x6c4ead,null))[_0x2462('0x40')](handleError(_0x6c4ead,null));};
\ No newline at end of file
+var _0x8646=['../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','length','catch','create','body','find','params','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x8646,0xd2));var _0x6864=function(_0x141978,_0x55cbc6){_0x141978=_0x141978-0x0;var _0xeb0e2a=_0x8646[_0x141978];return _0xeb0e2a;};'use strict';var emlformat=require(_0x6864('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6864('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6864('0x2'));var moment=require(_0x6864('0x3'));var BPromise=require(_0x6864('0x4'));var Mustache=require(_0x6864('0x5'));var util=require(_0x6864('0x6'));var path=require('path');var sox=require(_0x6864('0x7'));var csv=require(_0x6864('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6864('0x9'));var _=require(_0x6864('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6864('0xb'));var deskjs=require(_0x6864('0xc'));var toCsv=require(_0x6864('0x8'));var querystring=require(_0x6864('0xd'));var Papa=require(_0x6864('0xe'));var Redis=require('ioredis');var authService=require(_0x6864('0xf'));var qs=require(_0x6864('0x10'));var as=require(_0x6864('0x11'));var hardwareService=require(_0x6864('0x12'));var logger=require('../../config/logger')(_0x6864('0x13'));var utils=require(_0x6864('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6864('0x15'));var db=require(_0x6864('0x16'))['db'];function respondWithStatusCode(_0x12f200,_0x55e384){_0x55e384=_0x55e384||0xcc;return function(_0x296cd1){if(_0x296cd1){return _0x12f200['sendStatus'](_0x55e384);}return _0x12f200[_0x6864('0x17')](_0x55e384)[_0x6864('0x18')]();};}function respondWithResult(_0xb842cc,_0x14d6b3){_0x14d6b3=_0x14d6b3||0xc8;return function(_0x4084d1){if(_0x4084d1){return _0xb842cc['status'](_0x14d6b3)['json'](_0x4084d1);}};}function respondWithFilteredResult(_0x579854,_0x3868f0){return function(_0x4f8267){if(_0x4f8267){var _0x211193=typeof _0x3868f0['offset']==='undefined'&&typeof _0x3868f0['limit']===_0x6864('0x19');var _0x328f3e=_0x4f8267[_0x6864('0x1a')];var _0x1de349=_0x211193?0x0:_0x3868f0[_0x6864('0x1b')];var _0x374a12=_0x211193?_0x4f8267['count']:_0x3868f0[_0x6864('0x1b')]+_0x3868f0[_0x6864('0x1c')];var _0x1f91a2;if(_0x374a12>=_0x328f3e){_0x374a12=_0x328f3e;_0x1f91a2=0xc8;}else{_0x1f91a2=0xce;}_0x579854[_0x6864('0x17')](_0x1f91a2);return _0x579854['set'](_0x6864('0x1d'),_0x1de349+'-'+_0x374a12+'/'+_0x328f3e)[_0x6864('0x1e')](_0x4f8267);}return null;};}function patchUpdates(_0x53f7b4){return function(_0x362488){try{jsonpatch[_0x6864('0x1f')](_0x362488,_0x53f7b4,!![]);}catch(_0x5012d4){return BPromise[_0x6864('0x20')](_0x5012d4);}return _0x362488[_0x6864('0x21')]();};}function saveUpdates(_0x4bf3de,_0x521414){return function(_0xe2791d){if(_0xe2791d){return _0xe2791d[_0x6864('0x22')](_0x4bf3de)['then'](function(_0x20c6ee){return _0x20c6ee;});}return null;};}function removeEntity(_0x10de37,_0x1022a){return function(_0x4f3ffd){if(_0x4f3ffd){return _0x4f3ffd['destroy']()[_0x6864('0x23')](function(){_0x10de37[_0x6864('0x17')](0xcc)[_0x6864('0x18')]();});}};}function handleEntityNotFound(_0x4f1400,_0x56e0db){return function(_0x501e61){if(!_0x501e61){_0x4f1400[_0x6864('0x24')](0x194);}return _0x501e61;};}function handleError(_0x52b163,_0x10db5c){_0x10db5c=_0x10db5c||0x1f4;return function(_0x5c86b5){logger[_0x6864('0x25')](_0x5c86b5[_0x6864('0x26')]);if(_0x5c86b5[_0x6864('0x27')]){delete _0x5c86b5[_0x6864('0x27')];}_0x52b163['status'](_0x10db5c)[_0x6864('0x28')](_0x5c86b5);};}exports['index']=function(_0x3a2212,_0x13e9c0){var _0x785a46={},_0x453996={},_0x5ddb68={'count':0x0,'rows':[]};var _0xd742cd=_[_0x6864('0x29')](db[_0x6864('0x2a')][_0x6864('0x2b')],function(_0x4d482d){return{'name':_0x4d482d[_0x6864('0x2c')],'type':_0x4d482d[_0x6864('0x2d')][_0x6864('0x2e')]};});_0x453996['model']=_['map'](_0xd742cd,_0x6864('0x27'));_0x453996[_0x6864('0x2f')]=_['keys'](_0x3a2212[_0x6864('0x2f')]);_0x453996[_0x6864('0x30')]=_[_0x6864('0x31')](_0x453996[_0x6864('0x32')],_0x453996[_0x6864('0x2f')]);_0x785a46[_0x6864('0x33')]=_['intersection'](_0x453996[_0x6864('0x32')],qs[_0x6864('0x34')](_0x3a2212[_0x6864('0x2f')]['fields']));_0x785a46[_0x6864('0x33')]=_0x785a46[_0x6864('0x33')]['length']?_0x785a46[_0x6864('0x33')]:_0x453996['model'];if(!_0x3a2212[_0x6864('0x2f')][_0x6864('0x35')](_0x6864('0x36'))){_0x785a46[_0x6864('0x1c')]=qs[_0x6864('0x1c')](_0x3a2212[_0x6864('0x2f')][_0x6864('0x1c')]);_0x785a46[_0x6864('0x1b')]=qs['offset'](_0x3a2212[_0x6864('0x2f')]['offset']);}_0x785a46[_0x6864('0x37')]=qs[_0x6864('0x38')](_0x3a2212[_0x6864('0x2f')]['sort']);_0x785a46[_0x6864('0x39')]=qs[_0x6864('0x30')](_[_0x6864('0x3a')](_0x3a2212[_0x6864('0x2f')],_0x453996[_0x6864('0x30')]),_0xd742cd);if(_0x3a2212['query'][_0x6864('0x3b')]){_0x785a46[_0x6864('0x39')]=_[_0x6864('0x3c')](_0x785a46[_0x6864('0x39')],{'$or':_[_0x6864('0x29')](_0xd742cd,function(_0x180667){if(_0x180667[_0x6864('0x2d')]!==_0x6864('0x3d')){var _0x220e33={};_0x220e33[_0x180667[_0x6864('0x27')]]={'$like':'%'+_0x3a2212['query'][_0x6864('0x3b')]+'%'};return _0x220e33;}})});}_0x785a46=_[_0x6864('0x3c')]({},_0x785a46,_0x3a2212[_0x6864('0x3e')]);var _0x5587a6={'where':_0x785a46[_0x6864('0x39')]};return db[_0x6864('0x2a')][_0x6864('0x1a')](_0x5587a6)['then'](function(_0xf18b58){_0x5ddb68[_0x6864('0x1a')]=_0xf18b58;if(_0x3a2212[_0x6864('0x2f')][_0x6864('0x3f')]){_0x785a46[_0x6864('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6864('0x41')](_0x785a46);})['then'](function(_0x589e5a){_0x5ddb68[_0x6864('0x42')]=_0x589e5a;return _0x5ddb68;})[_0x6864('0x23')](respondWithFilteredResult(_0x13e9c0,_0x785a46))['catch'](handleError(_0x13e9c0,null));};exports[_0x6864('0x43')]=function(_0x1d85af,_0x1458fc){var _0x336ac7={'raw':!![],'where':{'id':_0x1d85af['params']['id']}},_0x47074c={};_0x47074c['model']=_[_0x6864('0x44')](db[_0x6864('0x2a')][_0x6864('0x2b')]);_0x47074c[_0x6864('0x2f')]=_[_0x6864('0x44')](_0x1d85af[_0x6864('0x2f')]);_0x47074c[_0x6864('0x30')]=_[_0x6864('0x31')](_0x47074c['model'],_0x47074c[_0x6864('0x2f')]);_0x336ac7[_0x6864('0x33')]=_[_0x6864('0x31')](_0x47074c[_0x6864('0x32')],qs[_0x6864('0x34')](_0x1d85af[_0x6864('0x2f')][_0x6864('0x34')]));_0x336ac7[_0x6864('0x33')]=_0x336ac7['attributes'][_0x6864('0x45')]?_0x336ac7[_0x6864('0x33')]:_0x47074c['model'];if(_0x1d85af['query'][_0x6864('0x3f')]){_0x336ac7['include']=[{'all':!![]}];}_0x336ac7=_[_0x6864('0x3c')]({},_0x336ac7,_0x1d85af[_0x6864('0x3e')]);return db[_0x6864('0x2a')]['find'](_0x336ac7)[_0x6864('0x23')](handleEntityNotFound(_0x1458fc,null))[_0x6864('0x23')](respondWithResult(_0x1458fc,null))[_0x6864('0x46')](handleError(_0x1458fc,null));};exports[_0x6864('0x47')]=function(_0x2559a7,_0x2437d9){return db['AnalyticTreeReport']['create'](_0x2559a7['body'],{})[_0x6864('0x23')](respondWithResult(_0x2437d9,0xc9))[_0x6864('0x46')](handleError(_0x2437d9,null));};exports[_0x6864('0x22')]=function(_0x3f3bf1,_0x218008){if(_0x3f3bf1[_0x6864('0x48')]['id']){delete _0x3f3bf1[_0x6864('0x48')]['id'];}return db[_0x6864('0x2a')][_0x6864('0x49')]({'where':{'id':_0x3f3bf1[_0x6864('0x4a')]['id']}})['then'](handleEntityNotFound(_0x218008,null))[_0x6864('0x23')](saveUpdates(_0x3f3bf1[_0x6864('0x48')],null))[_0x6864('0x23')](respondWithResult(_0x218008,null))[_0x6864('0x46')](handleError(_0x218008,null));};exports[_0x6864('0x4b')]=function(_0x1100c1,_0x2f30c9){return db['AnalyticTreeReport'][_0x6864('0x49')]({'where':{'id':_0x1100c1['params']['id']}})[_0x6864('0x23')](handleEntityNotFound(_0x2f30c9,null))[_0x6864('0x23')](removeEntity(_0x2f30c9,null))['catch'](handleError(_0x2f30c9,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8100=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x8100,0x1bc));var _0x0810=function(_0x4aec26,_0x3e5180){_0x4aec26=_0x4aec26-0x0;var _0x2ce511=_0x8100[_0x4aec26];return _0x2ce511;};'use strict';var _=require(_0x0810('0x0'));var util=require(_0x0810('0x1'));var logger=require('../../config/logger')(_0x0810('0x2'));var moment=require(_0x0810('0x3'));var BPromise=require('bluebird');var rp=require(_0x0810('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0810('0x5'));var config=require(_0x0810('0x6'));var attributes=require(_0x0810('0x7'));module[_0x0810('0x8')]=function(_0x36f0c1,_0x5b0603){return _0x36f0c1[_0x0810('0x9')](_0x0810('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e90=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x77ebec,_0x398b27){var _0x499100=function(_0x18e59c){while(--_0x18e59c){_0x77ebec['push'](_0x77ebec['shift']());}};_0x499100(++_0x398b27);}(_0x6e90,0x1d4));var _0x06e9=function(_0x32d7be,_0x1e9ef6){_0x32d7be=_0x32d7be-0x0;var _0x1224f5=_0x6e90[_0x32d7be];return _0x1224f5;};'use strict';var _=require(_0x06e9('0x0'));var util=require(_0x06e9('0x1'));var logger=require(_0x06e9('0x2'))(_0x06e9('0x3'));var moment=require(_0x06e9('0x4'));var BPromise=require('bluebird');var rp=require(_0x06e9('0x5'));var fs=require('fs');var path=require(_0x06e9('0x6'));var rimraf=require(_0x06e9('0x7'));var config=require(_0x06e9('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x06e9('0x9')]=function(_0x5058d8,_0x262c84){return _0x5058d8[_0x06e9('0xa')](_0x06e9('0xb'),attributes,{'tableName':_0x06e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1b56e7,_0x3291e3){var _0x2347d4=function(_0x2f88f7){while(--_0x2f88f7){_0x1b56e7['push'](_0x1b56e7['shift']());}};_0x2347d4(++_0x3291e3);}(_0x2ef3,0xba));var _0x32ef=function(_0x446e62,_0x33bf0c){_0x446e62=_0x446e62-0x0;var _0x3c9b7b=_0x2ef3[_0x446e62];return _0x3c9b7b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+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(_0x5a916c,_0x863d4f){var _0x15792a=function(_0x1f4a50){while(--_0x1f4a50){_0x5a916c['push'](_0x5a916c['shift']());}};_0x15792a(++_0x863d4f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x481a76,_0x4792c5){_0x481a76=_0x481a76-0x0;var _0x13d952=_0x5f2f[_0x481a76];return _0x13d952;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xceb9=['/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x41ad31,_0x4a24e3){var _0x54bf20=function(_0x1f1389){while(--_0x1f1389){_0x41ad31['push'](_0x41ad31['shift']());}};_0x54bf20(++_0x4a24e3);}(_0xceb9,0xd2));var _0x9ceb=function(_0x3c5ce6,_0x3a3a10){_0x3c5ce6=_0x3c5ce6-0x0;var _0x3d7430=_0xceb9[_0x3c5ce6];return _0x3d7430;};'use strict';var multer=require(_0x9ceb('0x0'));var util=require(_0x9ceb('0x1'));var path=require(_0x9ceb('0x2'));var timeout=require(_0x9ceb('0x3'));var express=require(_0x9ceb('0x4'));var router=express['Router']();var fs_extra=require(_0x9ceb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ceb('0x6'));var config=require(_0x9ceb('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x9ceb('0x8')]('/',auth[_0x9ceb('0x9')](),controller[_0x9ceb('0xa')]);router[_0x9ceb('0x8')](_0x9ceb('0xb'),auth[_0x9ceb('0x9')](),controller[_0x9ceb('0xc')]);router[_0x9ceb('0xd')]('/',auth[_0x9ceb('0x9')](),controller['create']);router[_0x9ceb('0xe')](_0x9ceb('0xb'),auth[_0x9ceb('0x9')](),controller[_0x9ceb('0xf')]);router['delete'](_0x9ceb('0xb'),auth[_0x9ceb('0x9')](),controller['destroy']);module[_0x9ceb('0x10')]=router;
\ No newline at end of file
+var _0x26f5=['create','put','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller','get','index','isAuthenticated','post'];(function(_0x4e214a,_0x29ca86){var _0x48fb72=function(_0x25ca77){while(--_0x25ca77){_0x4e214a['push'](_0x4e214a['shift']());}};_0x48fb72(++_0x29ca86);}(_0x26f5,0xd5));var _0x526f=function(_0x282e65,_0xe91451){_0x282e65=_0x282e65-0x0;var _0x4fb467=_0x26f5[_0x282e65];return _0x4fb467;};'use strict';var multer=require(_0x526f('0x0'));var util=require(_0x526f('0x1'));var path=require('path');var timeout=require(_0x526f('0x2'));var express=require(_0x526f('0x3'));var router=express[_0x526f('0x4')]();var fs_extra=require(_0x526f('0x5'));var auth=require(_0x526f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x526f('0x7'));router[_0x526f('0x8')]('/',auth['isAuthenticated'](),controller[_0x526f('0x9')]);router['get']('/:id',auth[_0x526f('0xa')](),controller['show']);router[_0x526f('0xb')]('/',auth[_0x526f('0xa')](),controller[_0x526f('0xc')]);router[_0x526f('0xd')]('/:id',auth[_0x526f('0xa')](),controller['update']);router[_0x526f('0xe')]('/:id',auth[_0x526f('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35aa=['exports','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x35aa,0xbe));var _0xa35a=function(_0x59d32c,_0x306b7a){_0x59d32c=_0x59d32c-0x0;var _0x26e818=_0x35aa[_0x59d32c];return _0x26e818;};'use strict';var Sequelize=require('sequelize');module[_0xa35a('0x0')]={'name':{'type':Sequelize[_0xa35a('0x1')]},'basename':{'type':Sequelize[_0xa35a('0x1')]},'type':{'type':Sequelize[_0xa35a('0x1')]}};
\ No newline at end of file
+var _0xb492=['exports','STRING'];(function(_0x24bed7,_0x452fe6){var _0x506d6a=function(_0x51b919){while(--_0x51b919){_0x24bed7['push'](_0x24bed7['shift']());}};_0x506d6a(++_0x452fe6);}(_0xb492,0x172));var _0x2b49=function(_0x37b311,_0x308ed6){_0x37b311=_0x37b311-0x0;var _0x2f19d1=_0xb492[_0x37b311];return _0x2f19d1;};'use strict';var Sequelize=require('sequelize');module[_0x2b49('0x0')]={'name':{'type':Sequelize[_0x2b49('0x1')]},'basename':{'type':Sequelize[_0x2b49('0x1')]},'type':{'type':Sequelize[_0x2b49('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71c6=['omit','update','create','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','moment','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','Attachment','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','keys','length','find','clone','rawAttributes','get','createdAt','updatedAt','body'];(function(_0x1e2eec,_0x51b5ba){var _0x4b438b=function(_0x150105){while(--_0x150105){_0x1e2eec['push'](_0x1e2eec['shift']());}};_0x4b438b(++_0x51b5ba);}(_0x71c6,0x66));var _0x671c=function(_0xecac3a,_0x404efc){_0xecac3a=_0xecac3a-0x0;var _0x49c859=_0x71c6[_0xecac3a];return _0x49c859;};'use strict';var emlformat=require(_0x671c('0x0'));var rimraf=require(_0x671c('0x1'));var zipdir=require(_0x671c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x671c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x671c('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x671c('0x5'));var fs=require('fs');var fs_extra=require(_0x671c('0x6'));var _=require(_0x671c('0x7'));var squel=require(_0x671c('0x8'));var crypto=require(_0x671c('0x9'));var jsforce=require(_0x671c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x671c('0xb'));var Papa=require(_0x671c('0xc'));var Redis=require(_0x671c('0xd'));var authService=require(_0x671c('0xe'));var qs=require(_0x671c('0xf'));var as=require(_0x671c('0x10'));var hardwareService=require(_0x671c('0x11'));var logger=require('../../config/logger')(_0x671c('0x12'));var utils=require(_0x671c('0x13'));var config=require(_0x671c('0x14'));var licenseUtil=require(_0x671c('0x15'));var db=require(_0x671c('0x16'))['db'];function respondWithStatusCode(_0xb138dc,_0xc7b004){_0xc7b004=_0xc7b004||0xcc;return function(_0x8d55e3){if(_0x8d55e3){return _0xb138dc[_0x671c('0x17')](_0xc7b004);}return _0xb138dc['status'](_0xc7b004)[_0x671c('0x18')]();};}function respondWithResult(_0x1d69ca,_0x1e9cbe){_0x1e9cbe=_0x1e9cbe||0xc8;return function(_0x50b7d6){if(_0x50b7d6){return _0x1d69ca[_0x671c('0x19')](_0x1e9cbe)[_0x671c('0x1a')](_0x50b7d6);}};}function respondWithFilteredResult(_0x4c99d6,_0x14d2db){return function(_0x517080){if(_0x517080){var _0x113d18=typeof _0x14d2db[_0x671c('0x1b')]===_0x671c('0x1c')&&typeof _0x14d2db[_0x671c('0x1d')]===_0x671c('0x1c');var _0x5c2f2d=_0x517080['count'];var _0x5cb7e8=_0x113d18?0x0:_0x14d2db['offset'];var _0x4ec218=_0x113d18?_0x517080[_0x671c('0x1e')]:_0x14d2db[_0x671c('0x1b')]+_0x14d2db['limit'];var _0x51c43c;if(_0x4ec218>=_0x5c2f2d){_0x4ec218=_0x5c2f2d;_0x51c43c=0xc8;}else{_0x51c43c=0xce;}_0x4c99d6[_0x671c('0x19')](_0x51c43c);return _0x4c99d6[_0x671c('0x1f')](_0x671c('0x20'),_0x5cb7e8+'-'+_0x4ec218+'/'+_0x5c2f2d)[_0x671c('0x1a')](_0x517080);}return null;};}function patchUpdates(_0x5a02fa){return function(_0x3ae21d){try{jsonpatch[_0x671c('0x21')](_0x3ae21d,_0x5a02fa,!![]);}catch(_0x13cee8){return BPromise[_0x671c('0x22')](_0x13cee8);}return _0x3ae21d[_0x671c('0x23')]();};}function saveUpdates(_0x2a2dfd,_0x39059a){return function(_0x44590e){if(_0x44590e){return _0x44590e['update'](_0x2a2dfd)[_0x671c('0x24')](function(_0x5bc745){return _0x5bc745;});}return null;};}function removeEntity(_0xc6ed25,_0x23a15a){return function(_0x29f809){if(_0x29f809){return _0x29f809[_0x671c('0x25')]()['then'](function(){_0xc6ed25[_0x671c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5475f5,_0x1df127){return function(_0x1fafba){if(!_0x1fafba){_0x5475f5[_0x671c('0x17')](0x194);}return _0x1fafba;};}function handleError(_0x4ef922,_0x544e90){_0x544e90=_0x544e90||0x1f4;return function(_0x40ab74){logger[_0x671c('0x26')](_0x40ab74[_0x671c('0x27')]);if(_0x40ab74[_0x671c('0x28')]){delete _0x40ab74[_0x671c('0x28')];}_0x4ef922['status'](_0x544e90)[_0x671c('0x29')](_0x40ab74);};}exports[_0x671c('0x2a')]=function(_0x47e106,_0x58d8e1){var _0x1d0df1={},_0x342588={},_0x2779dc={'count':0x0,'rows':[]};var _0x1d9ea7=_[_0x671c('0x2b')](db[_0x671c('0x2c')]['rawAttributes'],function(_0x557200){return{'name':_0x557200['fieldName'],'type':_0x557200[_0x671c('0x2d')]['key']};});_0x342588['model']=_['map'](_0x1d9ea7,'name');_0x342588[_0x671c('0x2e')]=_['keys'](_0x47e106[_0x671c('0x2e')]);_0x342588[_0x671c('0x2f')]=_[_0x671c('0x30')](_0x342588['model'],_0x342588['query']);_0x1d0df1[_0x671c('0x31')]=_[_0x671c('0x30')](_0x342588[_0x671c('0x32')],qs[_0x671c('0x33')](_0x47e106[_0x671c('0x2e')][_0x671c('0x33')]));_0x1d0df1[_0x671c('0x31')]=_0x1d0df1[_0x671c('0x31')]['length']?_0x1d0df1[_0x671c('0x31')]:_0x342588[_0x671c('0x32')];if(!_0x47e106[_0x671c('0x2e')][_0x671c('0x34')](_0x671c('0x35'))){_0x1d0df1[_0x671c('0x1d')]=qs[_0x671c('0x1d')](_0x47e106[_0x671c('0x2e')][_0x671c('0x1d')]);_0x1d0df1['offset']=qs['offset'](_0x47e106[_0x671c('0x2e')][_0x671c('0x1b')]);}_0x1d0df1[_0x671c('0x36')]=qs[_0x671c('0x37')](_0x47e106[_0x671c('0x2e')]['sort']);_0x1d0df1[_0x671c('0x38')]=qs[_0x671c('0x2f')](_[_0x671c('0x39')](_0x47e106[_0x671c('0x2e')],_0x342588[_0x671c('0x2f')]),_0x1d9ea7);if(_0x47e106[_0x671c('0x2e')][_0x671c('0x3a')]){_0x1d0df1[_0x671c('0x38')]=_['merge'](_0x1d0df1['where'],{'$or':_[_0x671c('0x2b')](_0x1d9ea7,function(_0xe945b7){if(_0xe945b7[_0x671c('0x2d')]!=='VIRTUAL'){var _0x444274={};_0x444274[_0xe945b7[_0x671c('0x28')]]={'$like':'%'+_0x47e106[_0x671c('0x2e')][_0x671c('0x3a')]+'%'};return _0x444274;}})});}_0x1d0df1=_[_0x671c('0x3b')]({},_0x1d0df1,_0x47e106[_0x671c('0x3c')]);var _0x472635={'where':_0x1d0df1[_0x671c('0x38')]};return db[_0x671c('0x2c')]['count'](_0x472635)['then'](function(_0x32ac91){_0x2779dc[_0x671c('0x1e')]=_0x32ac91;if(_0x47e106[_0x671c('0x2e')][_0x671c('0x3d')]){_0x1d0df1[_0x671c('0x3e')]=[{'all':!![]}];}return db[_0x671c('0x2c')]['findAll'](_0x1d0df1);})[_0x671c('0x24')](function(_0x2cc8d5){_0x2779dc['rows']=_0x2cc8d5;return _0x2779dc;})[_0x671c('0x24')](respondWithFilteredResult(_0x58d8e1,_0x1d0df1))[_0x671c('0x3f')](handleError(_0x58d8e1,null));};exports['show']=function(_0x1b0feb,_0x1e3286){var _0x1957de={'raw':!![],'where':{'id':_0x1b0feb[_0x671c('0x40')]['id']}},_0x96935={};_0x96935[_0x671c('0x32')]=_[_0x671c('0x41')](db[_0x671c('0x2c')]['rawAttributes']);_0x96935[_0x671c('0x2e')]=_['keys'](_0x1b0feb['query']);_0x96935[_0x671c('0x2f')]=_['intersection'](_0x96935[_0x671c('0x32')],_0x96935[_0x671c('0x2e')]);_0x1957de[_0x671c('0x31')]=_[_0x671c('0x30')](_0x96935[_0x671c('0x32')],qs['fields'](_0x1b0feb[_0x671c('0x2e')]['fields']));_0x1957de['attributes']=_0x1957de[_0x671c('0x31')][_0x671c('0x42')]?_0x1957de[_0x671c('0x31')]:_0x96935[_0x671c('0x32')];if(_0x1b0feb[_0x671c('0x2e')][_0x671c('0x3d')]){_0x1957de[_0x671c('0x3e')]=[{'all':!![]}];}_0x1957de=_['merge']({},_0x1957de,_0x1b0feb[_0x671c('0x3c')]);return db[_0x671c('0x2c')][_0x671c('0x43')](_0x1957de)[_0x671c('0x24')](handleEntityNotFound(_0x1e3286,null))[_0x671c('0x24')](respondWithResult(_0x1e3286,null))['catch'](handleError(_0x1e3286,null));};exports[_0x671c('0x44')]=function(_0x5b31d1,_0x2bf936){var _0x2d07e4={'where':{'id':_0x5b31d1[_0x671c('0x40')]['id']}},_0x510956={};_0x510956[_0x671c('0x32')]=_['keys'](db[_0x671c('0x2c')][_0x671c('0x45')]);_0x2d07e4[_0x671c('0x31')]=_[_0x671c('0x30')](_0x510956['model'],qs[_0x671c('0x33')](_0x5b31d1[_0x671c('0x2e')][_0x671c('0x33')]));_0x2d07e4[_0x671c('0x31')]=_0x2d07e4[_0x671c('0x31')][_0x671c('0x42')]?_0x2d07e4[_0x671c('0x31')]:_0x510956['model'];if(_0x5b31d1[_0x671c('0x2e')][_0x671c('0x3d')]){_0x2d07e4[_0x671c('0x3e')]=[{'all':!![]}];}_0x2d07e4=_['merge']({},_0x2d07e4,_0x5b31d1[_0x671c('0x3c')]);return db[_0x671c('0x2c')][_0x671c('0x43')](_0x2d07e4)[_0x671c('0x24')](handleEntityNotFound(_0x2bf936,null))[_0x671c('0x24')](function(_0x188c4d){if(_0x188c4d){var _0x4aefa3=_0x188c4d[_0x671c('0x46')]({'plain':!![]});_0x4aefa3=qs['omit'](_0x4aefa3,['id',_0x671c('0x47'),_0x671c('0x48')]);_0x5b31d1[_0x671c('0x49')]=_[_0x671c('0x4a')](_0x5b31d1['body'],['id',_0x671c('0x47'),_0x671c('0x48')]);return db[_0x671c('0x2c')]['create'](_[_0x671c('0x3b')](_0x4aefa3,_0x5b31d1[_0x671c('0x49')]),{'include':_0x5b31d1['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x671c('0x24')](respondWithResult(_0x2bf936,0xc9))[_0x671c('0x3f')](handleError(_0x2bf936,null));};exports[_0x671c('0x4b')]=function(_0x52c679,_0x391152){if(_0x52c679[_0x671c('0x49')]['id']){delete _0x52c679[_0x671c('0x49')]['id'];}return db[_0x671c('0x2c')]['find']({'where':{'id':_0x52c679[_0x671c('0x40')]['id']}})['then'](handleEntityNotFound(_0x391152,null))[_0x671c('0x24')](saveUpdates(_0x52c679[_0x671c('0x49')],null))['then'](respondWithResult(_0x391152,null))[_0x671c('0x3f')](handleError(_0x391152,null));};exports['destroy']=function(_0x1ca720,_0x4b8273){return db[_0x671c('0x2c')]['find']({'where':{'id':_0x1ca720[_0x671c('0x40')]['id']}})[_0x671c('0x24')](handleEntityNotFound(_0x4b8273,null))['then'](removeEntity(_0x4b8273,null))[_0x671c('0x3f')](handleError(_0x4b8273,null));};exports[_0x671c('0x4c')]=function(_0x49d438,_0x1a7e2b,_0x3e6746){_0x49d438['body']['name']=_0x49d438[_0x671c('0x4d')][_0x671c('0x4e')];_0x49d438['body']['basename']=_0x49d438[_0x671c('0x4d')][_0x671c('0x4f')];_0x49d438['body'][_0x671c('0x2d')]=_0x49d438[_0x671c('0x4d')][_0x671c('0x50')];return db[_0x671c('0x2c')]['create'](_0x49d438[_0x671c('0x49')])[_0x671c('0x24')](respondWithResult(_0x1a7e2b,0xc9))['catch'](handleError(_0x1a7e2b,null));};exports['download']=function(_0x366deb,_0x233fd4,_0xf36002){return db[_0x671c('0x2c')][_0x671c('0x51')]({'where':{'id':_0x366deb[_0x671c('0x40')]['id']},'raw':!![]})[_0x671c('0x24')](handleEntityNotFound(_0x233fd4,null))[_0x671c('0x24')](function(_0xd00b2a){if(_0xd00b2a){var _0x55524d=_0xd00b2a[_0x671c('0x52')]!==null;var _0xe08f69=path[_0x671c('0x53')](config[_0x671c('0x54')],_0x671c('0x55'));if(_0x55524d){_0xe08f69=path['join'](_0xe08f69,_0x671c('0x56'));}var _0x43151f=path['join'](_0xe08f69,_0xd00b2a['basename']);return _0x233fd4[_0x671c('0x57')](_0x43151f);}})[_0x671c('0x3f')](handleError(_0x233fd4,null));};
\ No newline at end of file
+var _0x9464=['omit','updatedAt','create','update','file','originalname','filename','mimetype','download','findOne','root','server/files/attachments/','join','basename','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','error','stack','name','index','map','Attachment','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','clone','find','get','body'];(function(_0x552284,_0x4ddb09){var _0x4ac092=function(_0x5c2703){while(--_0x5c2703){_0x552284['push'](_0x552284['shift']());}};_0x4ac092(++_0x4ddb09);}(_0x9464,0x14e));var _0x4946=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x9464[_0x13843f];return _0x1063ae;};'use strict';var emlformat=require(_0x4946('0x0'));var rimraf=require(_0x4946('0x1'));var zipdir=require(_0x4946('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4946('0x3'));var moment=require(_0x4946('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4946('0x5'));var path=require('path');var sox=require(_0x4946('0x6'));var csv=require(_0x4946('0x7'));var ejs=require(_0x4946('0x8'));var fs=require('fs');var fs_extra=require(_0x4946('0x9'));var _=require(_0x4946('0xa'));var squel=require('squel');var crypto=require(_0x4946('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4946('0xc'));var toCsv=require(_0x4946('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4946('0xd'));var authService=require(_0x4946('0xe'));var qs=require(_0x4946('0xf'));var as=require(_0x4946('0x10'));var hardwareService=require(_0x4946('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4946('0x12'));var db=require(_0x4946('0x13'))['db'];function respondWithStatusCode(_0x1bbdd2,_0x5edbc3){_0x5edbc3=_0x5edbc3||0xcc;return function(_0x326d31){if(_0x326d31){return _0x1bbdd2[_0x4946('0x14')](_0x5edbc3);}return _0x1bbdd2[_0x4946('0x15')](_0x5edbc3)['end']();};}function respondWithResult(_0x31ba17,_0x215e7c){_0x215e7c=_0x215e7c||0xc8;return function(_0x4e7a0f){if(_0x4e7a0f){return _0x31ba17[_0x4946('0x15')](_0x215e7c)[_0x4946('0x16')](_0x4e7a0f);}};}function respondWithFilteredResult(_0x4e2129,_0x3c4cee){return function(_0x3c4f5f){if(_0x3c4f5f){var _0x569ccb=typeof _0x3c4cee[_0x4946('0x17')]===_0x4946('0x18')&&typeof _0x3c4cee[_0x4946('0x19')]===_0x4946('0x18');var _0x2f454e=_0x3c4f5f[_0x4946('0x1a')];var _0x1d67f9=_0x569ccb?0x0:_0x3c4cee['offset'];var _0x4528e8=_0x569ccb?_0x3c4f5f[_0x4946('0x1a')]:_0x3c4cee[_0x4946('0x17')]+_0x3c4cee[_0x4946('0x19')];var _0x544264;if(_0x4528e8>=_0x2f454e){_0x4528e8=_0x2f454e;_0x544264=0xc8;}else{_0x544264=0xce;}_0x4e2129['status'](_0x544264);return _0x4e2129['set'](_0x4946('0x1b'),_0x1d67f9+'-'+_0x4528e8+'/'+_0x2f454e)[_0x4946('0x16')](_0x3c4f5f);}return null;};}function patchUpdates(_0x41ed70){return function(_0x56dbd8){try{jsonpatch['apply'](_0x56dbd8,_0x41ed70,!![]);}catch(_0x10c3e6){return BPromise[_0x4946('0x1c')](_0x10c3e6);}return _0x56dbd8['save']();};}function saveUpdates(_0xefe30f,_0xfcf0d7){return function(_0x25ca9a){if(_0x25ca9a){return _0x25ca9a['update'](_0xefe30f)[_0x4946('0x1d')](function(_0x2e3879){return _0x2e3879;});}return null;};}function removeEntity(_0x2f7465,_0x18c155){return function(_0x11d537){if(_0x11d537){return _0x11d537[_0x4946('0x1e')]()[_0x4946('0x1d')](function(){_0x2f7465[_0x4946('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f513,_0x27356f){return function(_0x4d5ab3){if(!_0x4d5ab3){_0x11f513[_0x4946('0x14')](0x194);}return _0x4d5ab3;};}function handleError(_0x4aac95,_0x1d3689){_0x1d3689=_0x1d3689||0x1f4;return function(_0x5e3b70){logger[_0x4946('0x1f')](_0x5e3b70[_0x4946('0x20')]);if(_0x5e3b70[_0x4946('0x21')]){delete _0x5e3b70[_0x4946('0x21')];}_0x4aac95['status'](_0x1d3689)['send'](_0x5e3b70);};}exports[_0x4946('0x22')]=function(_0x598cad,_0x204f77){var _0x52079b={},_0xda51a0={},_0x1e4c8b={'count':0x0,'rows':[]};var _0x1d9728=_[_0x4946('0x23')](db[_0x4946('0x24')]['rawAttributes'],function(_0x310140){return{'name':_0x310140['fieldName'],'type':_0x310140[_0x4946('0x25')][_0x4946('0x26')]};});_0xda51a0[_0x4946('0x27')]=_[_0x4946('0x23')](_0x1d9728,_0x4946('0x21'));_0xda51a0[_0x4946('0x28')]=_[_0x4946('0x29')](_0x598cad[_0x4946('0x28')]);_0xda51a0[_0x4946('0x2a')]=_['intersection'](_0xda51a0['model'],_0xda51a0[_0x4946('0x28')]);_0x52079b['attributes']=_[_0x4946('0x2b')](_0xda51a0[_0x4946('0x27')],qs['fields'](_0x598cad[_0x4946('0x28')][_0x4946('0x2c')]));_0x52079b[_0x4946('0x2d')]=_0x52079b[_0x4946('0x2d')][_0x4946('0x2e')]?_0x52079b['attributes']:_0xda51a0[_0x4946('0x27')];if(!_0x598cad[_0x4946('0x28')][_0x4946('0x2f')]('nolimit')){_0x52079b['limit']=qs[_0x4946('0x19')](_0x598cad['query'][_0x4946('0x19')]);_0x52079b[_0x4946('0x17')]=qs[_0x4946('0x17')](_0x598cad['query'][_0x4946('0x17')]);}_0x52079b['order']=qs['sort'](_0x598cad[_0x4946('0x28')][_0x4946('0x30')]);_0x52079b[_0x4946('0x31')]=qs['filters'](_[_0x4946('0x32')](_0x598cad[_0x4946('0x28')],_0xda51a0[_0x4946('0x2a')]),_0x1d9728);if(_0x598cad['query'][_0x4946('0x33')]){_0x52079b[_0x4946('0x31')]=_[_0x4946('0x34')](_0x52079b[_0x4946('0x31')],{'$or':_[_0x4946('0x23')](_0x1d9728,function(_0x382b6f){if(_0x382b6f[_0x4946('0x25')]!==_0x4946('0x35')){var _0x148463={};_0x148463[_0x382b6f['name']]={'$like':'%'+_0x598cad['query'][_0x4946('0x33')]+'%'};return _0x148463;}})});}_0x52079b=_['merge']({},_0x52079b,_0x598cad[_0x4946('0x36')]);var _0xafdc43={'where':_0x52079b[_0x4946('0x31')]};return db[_0x4946('0x24')]['count'](_0xafdc43)['then'](function(_0x11bee8){_0x1e4c8b[_0x4946('0x1a')]=_0x11bee8;if(_0x598cad[_0x4946('0x28')][_0x4946('0x37')]){_0x52079b['include']=[{'all':!![]}];}return db[_0x4946('0x24')][_0x4946('0x38')](_0x52079b);})[_0x4946('0x1d')](function(_0x48b19b){_0x1e4c8b['rows']=_0x48b19b;return _0x1e4c8b;})[_0x4946('0x1d')](respondWithFilteredResult(_0x204f77,_0x52079b))[_0x4946('0x39')](handleError(_0x204f77,null));};exports[_0x4946('0x3a')]=function(_0x55fa66,_0x23cad5){var _0x21189e={'raw':!![],'where':{'id':_0x55fa66[_0x4946('0x3b')]['id']}},_0x885ad5={};_0x885ad5[_0x4946('0x27')]=_[_0x4946('0x29')](db['Attachment'][_0x4946('0x3c')]);_0x885ad5['query']=_[_0x4946('0x29')](_0x55fa66[_0x4946('0x28')]);_0x885ad5['filters']=_[_0x4946('0x2b')](_0x885ad5[_0x4946('0x27')],_0x885ad5['query']);_0x21189e[_0x4946('0x2d')]=_[_0x4946('0x2b')](_0x885ad5[_0x4946('0x27')],qs[_0x4946('0x2c')](_0x55fa66[_0x4946('0x28')][_0x4946('0x2c')]));_0x21189e['attributes']=_0x21189e['attributes'][_0x4946('0x2e')]?_0x21189e[_0x4946('0x2d')]:_0x885ad5['model'];if(_0x55fa66[_0x4946('0x28')][_0x4946('0x37')]){_0x21189e[_0x4946('0x3d')]=[{'all':!![]}];}_0x21189e=_['merge']({},_0x21189e,_0x55fa66[_0x4946('0x36')]);return db[_0x4946('0x24')]['find'](_0x21189e)[_0x4946('0x1d')](handleEntityNotFound(_0x23cad5,null))[_0x4946('0x1d')](respondWithResult(_0x23cad5,null))[_0x4946('0x39')](handleError(_0x23cad5,null));};exports[_0x4946('0x3e')]=function(_0x29ef25,_0x23647b){var _0x3f646f={'where':{'id':_0x29ef25[_0x4946('0x3b')]['id']}},_0xbcdd23={};_0xbcdd23[_0x4946('0x27')]=_[_0x4946('0x29')](db[_0x4946('0x24')][_0x4946('0x3c')]);_0x3f646f['attributes']=_[_0x4946('0x2b')](_0xbcdd23['model'],qs['fields'](_0x29ef25[_0x4946('0x28')][_0x4946('0x2c')]));_0x3f646f[_0x4946('0x2d')]=_0x3f646f[_0x4946('0x2d')][_0x4946('0x2e')]?_0x3f646f[_0x4946('0x2d')]:_0xbcdd23[_0x4946('0x27')];if(_0x29ef25[_0x4946('0x28')]['includeAll']){_0x3f646f[_0x4946('0x3d')]=[{'all':!![]}];}_0x3f646f=_['merge']({},_0x3f646f,_0x29ef25[_0x4946('0x36')]);return db[_0x4946('0x24')][_0x4946('0x3f')](_0x3f646f)[_0x4946('0x1d')](handleEntityNotFound(_0x23647b,null))[_0x4946('0x1d')](function(_0x364b6f){if(_0x364b6f){var _0x1b32ce=_0x364b6f[_0x4946('0x40')]({'plain':!![]});_0x1b32ce=qs['omit'](_0x1b32ce,['id','createdAt','updatedAt']);_0x29ef25[_0x4946('0x41')]=_[_0x4946('0x42')](_0x29ef25['body'],['id','createdAt',_0x4946('0x43')]);return db[_0x4946('0x24')][_0x4946('0x44')](_[_0x4946('0x34')](_0x1b32ce,_0x29ef25[_0x4946('0x41')]),{'include':_0x29ef25[_0x4946('0x28')][_0x4946('0x37')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x23647b,0xc9))[_0x4946('0x39')](handleError(_0x23647b,null));};exports[_0x4946('0x45')]=function(_0xc508b6,_0x98e25){if(_0xc508b6['body']['id']){delete _0xc508b6[_0x4946('0x41')]['id'];}return db[_0x4946('0x24')][_0x4946('0x3f')]({'where':{'id':_0xc508b6[_0x4946('0x3b')]['id']}})[_0x4946('0x1d')](handleEntityNotFound(_0x98e25,null))[_0x4946('0x1d')](saveUpdates(_0xc508b6[_0x4946('0x41')],null))['then'](respondWithResult(_0x98e25,null))[_0x4946('0x39')](handleError(_0x98e25,null));};exports[_0x4946('0x1e')]=function(_0x281431,_0x2f2875){return db[_0x4946('0x24')][_0x4946('0x3f')]({'where':{'id':_0x281431[_0x4946('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2f2875,null))['then'](removeEntity(_0x2f2875,null))[_0x4946('0x39')](handleError(_0x2f2875,null));};exports[_0x4946('0x44')]=function(_0x23bd48,_0x189da0,_0x45fa31){_0x23bd48[_0x4946('0x41')][_0x4946('0x21')]=_0x23bd48[_0x4946('0x46')][_0x4946('0x47')];_0x23bd48['body']['basename']=_0x23bd48[_0x4946('0x46')][_0x4946('0x48')];_0x23bd48[_0x4946('0x41')][_0x4946('0x25')]=_0x23bd48[_0x4946('0x46')][_0x4946('0x49')];return db[_0x4946('0x24')][_0x4946('0x44')](_0x23bd48['body'])[_0x4946('0x1d')](respondWithResult(_0x189da0,0xc9))[_0x4946('0x39')](handleError(_0x189da0,null));};exports[_0x4946('0x4a')]=function(_0x31d967,_0x2fdea9,_0x53bc11){return db[_0x4946('0x24')][_0x4946('0x4b')]({'where':{'id':_0x31d967[_0x4946('0x3b')]['id']},'raw':!![]})[_0x4946('0x1d')](handleEntityNotFound(_0x2fdea9,null))[_0x4946('0x1d')](function(_0x58b0c0){if(_0x58b0c0){var _0x2eb44c=_0x58b0c0['ChatOfflineMessageId']!==null;var _0x24d6fa=path['join'](config[_0x4946('0x4c')],_0x4946('0x4d'));if(_0x2eb44c){_0x24d6fa=path[_0x4946('0x4e')](_0x24d6fa,'offline-chat/');}var _0x2e4cad=path[_0x4946('0x4e')](_0x24d6fa,_0x58b0c0[_0x4946('0x4f')]);return _0x2fdea9[_0x4946('0x4a')](_0x2e4cad);}})['catch'](handleError(_0x2fdea9,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x816d=['util','../../config/logger','moment','bluebird','path','exports','define','Attachment','attachments','lodash'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0x816d,0xd1));var _0xd816=function(_0x225493,_0x4a22eb){_0x225493=_0x225493-0x0;var _0x14fa6c=_0x816d[_0x225493];return _0x14fa6c;};'use strict';var _=require(_0xd816('0x0'));var util=require(_0xd816('0x1'));var logger=require(_0xd816('0x2'))('api');var moment=require(_0xd816('0x3'));var BPromise=require(_0xd816('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd816('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xd816('0x6')]=function(_0x35adcb,_0x47bcaf){return _0x35adcb[_0xd816('0x7')](_0xd816('0x8'),attributes,{'tableName':_0xd816('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6167=['../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x9dde27,_0x4d3cfd){var _0x11b8e2=function(_0x4f8c98){while(--_0x4f8c98){_0x9dde27['push'](_0x9dde27['shift']());}};_0x11b8e2(++_0x4d3cfd);}(_0x6167,0x185));var _0x7616=function(_0x4637e2,_0x298213){_0x4637e2=_0x4637e2-0x0;var _0x4529df=_0x6167[_0x4637e2];return _0x4529df;};'use strict';var _=require(_0x7616('0x0'));var util=require(_0x7616('0x1'));var logger=require(_0x7616('0x2'))('api');var moment=require(_0x7616('0x3'));var BPromise=require(_0x7616('0x4'));var rp=require(_0x7616('0x5'));var fs=require('fs');var path=require(_0x7616('0x6'));var rimraf=require('rimraf');var config=require(_0x7616('0x7'));var attributes=require(_0x7616('0x8'));module[_0x7616('0x9')]=function(_0x1f34a5,_0x11a496){return _0x1f34a5['define'](_0x7616('0xa'),attributes,{'tableName':_0x7616('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x684c=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateAttachment','Attachment','create','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var moment=require('moment');var BPromise=require(_0xc684('0x2'));var rs=require(_0xc684('0x3'));var fs=require('fs');var Redis=require(_0xc684('0x4'));var db=require(_0xc684('0x5'))['db'];var utils=require(_0xc684('0x6'));var logger=require('../../config/logger')(_0xc684('0x7'));var config=require(_0xc684('0x8'));var jayson=require(_0xc684('0x9'));var client=jayson[_0xc684('0xa')][_0xc684('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57a63c,_0x23bd1c,_0x1a96ea){return new BPromise(function(_0x146733,_0xccb771){return client[_0xc684('0xc')](_0x57a63c,_0x1a96ea)[_0xc684('0xd')](function(_0x3b3bc0){logger[_0xc684('0xe')](_0xc684('0xf'),_0x23bd1c,_0xc684('0x10'));logger[_0xc684('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x23bd1c,_0xc684('0x10'),JSON[_0xc684('0x12')](_0x3b3bc0));if(_0x3b3bc0[_0xc684('0x13')]){if(_0x3b3bc0[_0xc684('0x13')][_0xc684('0x14')]===0x1f4){logger[_0xc684('0x13')]('Attachment,\x20%s,\x20%s',_0x23bd1c,_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);return _0xccb771(_0x3b3bc0['error']['message']);}logger[_0xc684('0x13')](_0xc684('0xf'),_0x23bd1c,_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);return _0x146733(_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x23bd1c,_0xc684('0x10'));_0x146733(_0x3b3bc0['result']['message']);}})['catch'](function(_0x47a8eb){logger['error'](_0xc684('0xf'),_0x23bd1c,_0x47a8eb);_0xccb771(_0x47a8eb);});});}exports[_0xc684('0x16')]=function(_0x3b6f5e){var _0x1c1b4a=this;return new Promise(function(_0x1c3af5,_0x4a14a2){return db[_0xc684('0x17')][_0xc684('0x18')](_0x3b6f5e['body'],{'raw':_0x3b6f5e[_0xc684('0x19')]?_0x3b6f5e[_0xc684('0x19')][_0xc684('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x62c4e5){logger[_0xc684('0xe')](_0xc684('0x16'),_0x3b6f5e);logger[_0xc684('0x11')](_0xc684('0x16'),_0x3b6f5e,JSON['stringify'](_0x62c4e5));_0x1c3af5(_0x62c4e5);})[_0xc684('0x1b')](function(_0x39f39a){logger[_0xc684('0x13')]('CreateAttachment',_0x39f39a['message'],_0x3b6f5e);_0x4a14a2(_0x1c1b4a['error'](0x1f4,_0x39f39a[_0xc684('0x15')]));});});};
\ No newline at end of file
+var _0x12fd=['options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment'];(function(_0x5a9284,_0x508aeb){var _0x397691=function(_0x437682){while(--_0x437682){_0x5a9284['push'](_0x5a9284['shift']());}};_0x397691(++_0x508aeb);}(_0x12fd,0x199));var _0xd12f=function(_0x524c16,_0x35ec59){_0x524c16=_0x524c16-0x0;var _0x5f0cc4=_0x12fd[_0x524c16];return _0x5f0cc4;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var moment=require(_0xd12f('0x2'));var BPromise=require(_0xd12f('0x3'));var rs=require(_0xd12f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12f('0x5'))['db'];var utils=require(_0xd12f('0x6'));var logger=require(_0xd12f('0x7'))(_0xd12f('0x8'));var config=require(_0xd12f('0x9'));var jayson=require(_0xd12f('0xa'));var client=jayson['client'][_0xd12f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca6e6,_0x285abf,_0x193e89){return new BPromise(function(_0x62de68,_0x40aaf8){return client['request'](_0x5ca6e6,_0x193e89)[_0xd12f('0xc')](function(_0x539473){logger[_0xd12f('0xd')]('Attachment,\x20%s,\x20%s',_0x285abf,'request\x20sent');logger['debug'](_0xd12f('0xe'),_0x285abf,_0xd12f('0xf'),JSON['stringify'](_0x539473));if(_0x539473['error']){if(_0x539473['error']['code']===0x1f4){logger[_0xd12f('0x10')]('Attachment,\x20%s,\x20%s',_0x285abf,_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);return _0x40aaf8(_0x539473['error'][_0xd12f('0x11')]);}logger[_0xd12f('0x10')]('Attachment,\x20%s,\x20%s',_0x285abf,_0x539473['error']['message']);return _0x62de68(_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);}else{logger[_0xd12f('0xd')](_0xd12f('0x12'),_0x285abf,_0xd12f('0xf'));_0x62de68(_0x539473[_0xd12f('0x13')][_0xd12f('0x11')]);}})[_0xd12f('0x14')](function(_0x4769a2){logger['error']('Attachment,\x20%s,\x20%s',_0x285abf,_0x4769a2);_0x40aaf8(_0x4769a2);});});}exports[_0xd12f('0x15')]=function(_0x45ff4d){var _0x58a653=this;return new Promise(function(_0x14c619,_0x12c884){return db[_0xd12f('0x16')]['create'](_0x45ff4d['body'],{'raw':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![]})[_0xd12f('0xc')](function(_0x410073){logger[_0xd12f('0xd')]('CreateAttachment',_0x45ff4d);logger[_0xd12f('0x19')](_0xd12f('0x15'),_0x45ff4d,JSON[_0xd12f('0x1a')](_0x410073));_0x14c619(_0x410073);})[_0xd12f('0x14')](function(_0x3a0c41){logger[_0xd12f('0x10')](_0xd12f('0x15'),_0x3a0c41[_0xd12f('0x11')],_0x45ff4d);_0x12c884(_0x58a653[_0xd12f('0x10')](0x1f4,_0x3a0c41[_0xd12f('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=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(_0x401c6a,_0x1a3183){_0x401c6a=_0x401c6a-0x0;var _0x38835c=_0xdb28[_0x401c6a];return _0x38835c;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8cf1=['Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','password','salt','role','blocked','blockedAt','online','admin','user','agent','name','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport-local'];(function(_0x2e9344,_0x459c45){var _0x4eccbc=function(_0x19e25b){while(--_0x19e25b){_0x2e9344['push'](_0x2e9344['shift']());}};_0x4eccbc(++_0x459c45);}(_0x8cf1,0xea));var _0x18cf=function(_0x27bba7,_0x1237bd){_0x27bba7=_0x27bba7-0x0;var _0x3066fe=_0x8cf1[_0x27bba7];return _0x3066fe;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x18cf('0x0'))[_0x18cf('0x1')];var moment=require(_0x18cf('0x2'));var ActiveDirectory=require(_0x18cf('0x3'));var BPromise=require(_0x18cf('0x4'));var util=require(_0x18cf('0x5'));var db=require(_0x18cf('0x6'))['db'];var authService=require(_0x18cf('0x7'));var utils=require('../../config/utils');var config=require(_0x18cf('0x8'));var logger=require('../../config/logger')(_0x18cf('0x9'));function isActiveDirectoryConfigured(_0x123a46){var _0x5aa828=![];if(typeof _0x123a46[_0x18cf('0xa')]!==_0x18cf('0xb')){_0x5aa828=_0x123a46[_0x18cf('0xa')][_0x18cf('0xc')]&&_0x123a46[_0x18cf('0xa')]['url']&&_0x123a46[_0x18cf('0xa')][_0x18cf('0xd')];}return _0x5aa828;}function adAuthenticate(_0x34fa6b,_0x343b21,_0x1935d3){return new BPromise(function(_0x1ae7f2,_0x2b69ed){try{var _0x107d6d=new ActiveDirectory(_0x34fa6b);_0x107d6d[_0x18cf('0xe')](_0x343b21,_0x1935d3,function(_0x2a56ad,_0x12ea77){if(_0x2a56ad){logger[_0x18cf('0xf')](_0x18cf('0x10'),_0x343b21,util[_0x18cf('0x11')](_0x2a56ad,{'showHidden':![],'depth':null}));_0x2b69ed(_0x18cf('0x12'));}else if(!_0x12ea77){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x343b21);_0x2b69ed(_0x18cf('0x12'));}else{_0x1ae7f2(_0x12ea77);}});}catch(_0x2a7937){_0x2b69ed(_0x2a7937);}});}function ActiveDirectoryAuthenticate(_0x3a23a6,_0x2ffa5e,_0x6d0e96,_0x25a0e2){var _0x46f165,_0xe03734;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x18cf('0x13'),_0x2ffa5e);return _0x25a0e2(null,![],{'message':_0x18cf('0x12')});}return db['Setting'][_0x18cf('0x14')]({'where':{'id':0x1},'attributes':[_0x18cf('0x15'),'blockDuration'],'raw':!![]})[_0x18cf('0x16')](function(_0x3366fe){_0x46f165=_0x3366fe;if(!_0x46f165[_0x18cf('0x15')]){logger[_0x18cf('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2ffa5e);throw new Error(_0x18cf('0x12'));}return _0x3a23a6['findOne']({'attributes':['id','name',_0x18cf('0x17'),_0x18cf('0x18'),_0x18cf('0x19'),'disabled',_0x18cf('0x1a'),_0x18cf('0x1b'),_0x18cf('0x1c')],'where':{'name':_0x2ffa5e,'role':{'$or':[_0x18cf('0x1d'),_0x18cf('0x1e'),_0x18cf('0x1f')]},'adSsoEnabled':!![]}});})['then'](function(_0x4f6cde){if(!_0x4f6cde||_0x4f6cde&&_0x4f6cde[_0x18cf('0x20')]!==_0x2ffa5e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xe03734=_0x4f6cde;var _0x54e1d6=_0xe03734['name']+'@'+config[_0x18cf('0xa')][_0x18cf('0xd')];return adAuthenticate(config[_0x18cf('0xa')],_0x54e1d6,_0x6d0e96);})['then'](function(_0x698e8e){if(_0xe03734[_0x18cf('0x21')]){throw new Error(_0x18cf('0x12'));}if(_0x46f165[_0x18cf('0x22')]>0x0){if(_0xe03734[_0x18cf('0x1a')]){if(moment(_0xe03734[_0x18cf('0x1b')])[_0x18cf('0x23')](_0x46f165[_0x18cf('0x22')],_0x18cf('0x24'))>moment()){throw new Error(_0x18cf('0x12'));}return utils[_0x18cf('0x25')](_0xe03734,0x0,![],null)['then'](function(){return utils['getLicense'](_0xe03734);})['then'](function(){return _0x25a0e2(null,_0xe03734);});}else{return utils[_0x18cf('0x26')](_0xe03734)[_0x18cf('0x16')](function(){return _0x25a0e2(null,_0xe03734);});}}else{return utils['getLicense'](_0xe03734)['then'](function(){return _0x25a0e2(null,_0xe03734);});}})['catch'](function(_0x428e5d){return _0x25a0e2(null,![],_0x428e5d);});}function handleError(_0x39f85c,_0x51c8be,_0xef99ba){return _0x39f85c[_0x18cf('0x27')](_0x51c8be||0x1f4)['send']({'message':_0xef99ba?_0xef99ba[_0x18cf('0x28')]||_0xef99ba:''});}exports[_0x18cf('0x29')]=function(_0x122c26,_0x4aceb7,_0x3d2c5d){passport[_0x18cf('0xe')](_0x18cf('0x2a'),function(_0x23301b,_0x2f3758,_0x4f1373){var _0x167c9b=_0x23301b||_0x4f1373;if(_0x167c9b){return handleError(_0x4aceb7,0x191,_0x167c9b);}if(!_0x2f3758){return handleError(_0x4aceb7,0x194,{'message':_0x18cf('0x2b')});}else{var _0x1bf0bb={'payload':{'id':_0x2f3758['id'],'role':_0x2f3758[_0x18cf('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x18cf('0x2c')](_0x1bf0bb)[_0x18cf('0x16')](function(_0x4f5c9a){_0x4aceb7[_0x18cf('0x2d')]({'id':_0x2f3758['id'],'token':_0x4f5c9a,'statusCall':'','isAlreadyLogged':_0x2f3758[_0x18cf('0x1c')]});});}})(_0x122c26,_0x4aceb7,_0x3d2c5d);};passport[_0x18cf('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0x18cf('0x20'),'passwordField':_0x18cf('0x17')},function(_0x3aeb5c,_0x38d2ab,_0x520bcf){return ActiveDirectoryAuthenticate(db['User'],_0x3aeb5c,_0x38d2ab,_0x520bcf);}));
\ No newline at end of file
+var _0x55cd=['authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','password','salt','disabled','blocked','blockedAt','admin','user','agent','domain','add','blockDuration','minutes','clearBlockUser','getLicense','catch','status','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','activedirectory','undefined','url'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x55cd,0xdb));var _0xd55c=function(_0x3738ff,_0x5ef210){_0x3738ff=_0x3738ff-0x0;var _0x18ad9c=_0x55cd[_0x3738ff];return _0x18ad9c;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0xd55c('0x0')];var moment=require('moment');var ActiveDirectory=require(_0xd55c('0x1'));var BPromise=require(_0xd55c('0x2'));var util=require(_0xd55c('0x3'));var db=require(_0xd55c('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd55c('0x5'));var config=require(_0xd55c('0x6'));var logger=require('../../config/logger')(_0xd55c('0x7'));function isActiveDirectoryConfigured(_0xd5d74e){var _0x4fc57b=![];if(typeof _0xd5d74e[_0xd55c('0x8')]!==_0xd55c('0x9')){_0x4fc57b=_0xd5d74e[_0xd55c('0x8')]['baseDN']&&_0xd5d74e[_0xd55c('0x8')][_0xd55c('0xa')]&&_0xd5d74e[_0xd55c('0x8')]['domain'];}return _0x4fc57b;}function adAuthenticate(_0x266588,_0x57ba71,_0x281bca){return new BPromise(function(_0x54af95,_0x5d520d){try{var _0x4fc83c=new ActiveDirectory(_0x266588);_0x4fc83c[_0xd55c('0xb')](_0x57ba71,_0x281bca,function(_0xee8ed2,_0x3c830e){if(_0xee8ed2){logger[_0xd55c('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x57ba71,util[_0xd55c('0xd')](_0xee8ed2,{'showHidden':![],'depth':null}));_0x5d520d(_0xd55c('0xe'));}else if(!_0x3c830e){logger[_0xd55c('0xc')](_0xd55c('0xf'),_0x57ba71);_0x5d520d(_0xd55c('0xe'));}else{_0x54af95(_0x3c830e);}});}catch(_0x37532a){_0x5d520d(_0x37532a);}});}function ActiveDirectoryAuthenticate(_0x188fa6,_0x1cf5c5,_0x331c96,_0x22918d){var _0x296957,_0x1e4629;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xd55c('0x10'),_0x1cf5c5);return _0x22918d(null,![],{'message':_0xd55c('0xe')});}return db[_0xd55c('0x11')][_0xd55c('0x12')]({'where':{'id':0x1},'attributes':[_0xd55c('0x13'),'blockDuration'],'raw':!![]})[_0xd55c('0x14')](function(_0x17b148){_0x296957=_0x17b148;if(!_0x296957['adSsoEnabled']){logger[_0xd55c('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x1cf5c5);throw new Error(_0xd55c('0xe'));}return _0x188fa6[_0xd55c('0x12')]({'attributes':['id',_0xd55c('0x15'),_0xd55c('0x16'),_0xd55c('0x17'),'role',_0xd55c('0x18'),_0xd55c('0x19'),_0xd55c('0x1a'),'online'],'where':{'name':_0x1cf5c5,'role':{'$or':[_0xd55c('0x1b'),_0xd55c('0x1c'),_0xd55c('0x1d')]},'adSsoEnabled':!![]}});})['then'](function(_0x24c324){if(!_0x24c324||_0x24c324&&_0x24c324[_0xd55c('0x15')]!==_0x1cf5c5){throw new Error(_0xd55c('0xe'));}_0x1e4629=_0x24c324;var _0x6a07de=_0x1e4629[_0xd55c('0x15')]+'@'+config[_0xd55c('0x8')][_0xd55c('0x1e')];return adAuthenticate(config[_0xd55c('0x8')],_0x6a07de,_0x331c96);})[_0xd55c('0x14')](function(_0x2a252d){if(_0x1e4629['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x296957['blockDuration']>0x0){if(_0x1e4629[_0xd55c('0x19')]){if(moment(_0x1e4629['blockedAt'])[_0xd55c('0x1f')](_0x296957[_0xd55c('0x20')],_0xd55c('0x21'))>moment()){throw new Error(_0xd55c('0xe'));}return utils[_0xd55c('0x22')](_0x1e4629,0x0,![],null)[_0xd55c('0x14')](function(){return utils[_0xd55c('0x23')](_0x1e4629);})['then'](function(){return _0x22918d(null,_0x1e4629);});}else{return utils[_0xd55c('0x23')](_0x1e4629)[_0xd55c('0x14')](function(){return _0x22918d(null,_0x1e4629);});}}else{return utils['getLicense'](_0x1e4629)[_0xd55c('0x14')](function(){return _0x22918d(null,_0x1e4629);});}})[_0xd55c('0x24')](function(_0x4669d8){return _0x22918d(null,![],_0x4669d8);});}function handleError(_0x403b1d,_0x2261c7,_0x3bef54){return _0x403b1d[_0xd55c('0x25')](_0x2261c7||0x1f4)['send']({'message':_0x3bef54?_0x3bef54['message']||_0x3bef54:''});}exports[_0xd55c('0x26')]=function(_0x288ac6,_0x9952e0,_0x5161d8){passport[_0xd55c('0xb')](_0xd55c('0x27'),function(_0x35bbd9,_0x819e2a,_0x43a30e){var _0x42b975=_0x35bbd9||_0x43a30e;if(_0x42b975){return handleError(_0x9952e0,0x191,_0x42b975);}if(!_0x819e2a){return handleError(_0x9952e0,0x194,{'message':_0xd55c('0x28')});}else{var _0x16b8e0={'payload':{'id':_0x819e2a['id'],'role':_0x819e2a[_0xd55c('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0xd55c('0x2a')](_0x16b8e0)[_0xd55c('0x14')](function(_0x53dbae){_0x9952e0[_0xd55c('0x2b')]({'id':_0x819e2a['id'],'token':_0x53dbae,'statusCall':'','isAlreadyLogged':_0x819e2a['online']});});}})(_0x288ac6,_0x9952e0,_0x5161d8);};passport[_0xd55c('0x2c')](_0xd55c('0x27'),new LocalStrategy({'usernameField':_0xd55c('0x15'),'passwordField':_0xd55c('0x16')},function(_0x1ff6e1,_0x54afc4,_0x3994e3){return ActiveDirectoryAuthenticate(db[_0xd55c('0x2d')],_0x1ff6e1,_0x54afc4,_0x3994e3);}));
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8047=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x5f3e62,_0x2fbb2a){var _0x2ea300=function(_0x5250a3){while(--_0x5250a3){_0x5f3e62['push'](_0x5f3e62['shift']());}};_0x2ea300(++_0x2fbb2a);}(_0x8047,0x17b));var _0x7804=function(_0x1c877f,_0x3f060c){_0x1c877f=_0x1c877f-0x0;var _0x3fe5db=_0x8047[_0x1c877f];return _0x3fe5db;};'use strict';var express=require(_0x7804('0x0'));var router=express[_0x7804('0x1')]();var controller=require(_0x7804('0x2'));router[_0x7804('0x3')]('/',controller['login']);module[_0x7804('0x4')]=router;
\ No newline at end of file
+var _0x6652=['exports','express','post','login'];(function(_0x5c26b5,_0xf598c7){var _0x1df389=function(_0x533a5c){while(--_0x533a5c){_0x5c26b5['push'](_0x5c26b5['shift']());}};_0x1df389(++_0xf598c7);}(_0x6652,0x125));var _0x2665=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6652[_0x126558];return _0x1f6d14;};'use strict';var express=require(_0x2665('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x2665('0x1')]('/',controller[_0x2665('0x2')]);module[_0x2665('0x3')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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(_0x2ec06f,_0x3bb56d){var _0x3a1c71=function(_0x5ca631){while(--_0x5ca631){_0x2ec06f['push'](_0x2ec06f['shift']());}};_0x3a1c71(++_0x3bb56d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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
+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(_0x392ca0,_0x15bea8){var _0x29f92e=function(_0x53a767){while(--_0x53a767){_0x392ca0['push'](_0x392ca0['shift']());}};_0x29f92e(++_0x15bea8);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1672=['passport','Router','../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports','express'];(function(_0xc46b80,_0x34da46){var _0x4a7200=function(_0x27f7d6){while(--_0x27f7d6){_0xc46b80['push'](_0xc46b80['shift']());}};_0x4a7200(++_0x34da46);}(_0x1672,0x121));var _0x2167=function(_0x265eb0,_0x2db51e){_0x265eb0=_0x265eb0-0x0;var _0x1f679a=_0x1672[_0x265eb0];return _0x1f679a;};'use strict';var express=require(_0x2167('0x0'));var passport=require(_0x2167('0x1'));var router=express[_0x2167('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x2167('0x3'));var authService=require(_0x2167('0x4'));router[_0x2167('0x5')]('/',controller[_0x2167('0x6')]);router[_0x2167('0x5')]('/callback',controller['callback'],authService[_0x2167('0x7')],userController[_0x2167('0x6')],authService[_0x2167('0x8')]);module[_0x2167('0x9')]=router;
\ No newline at end of file
+var _0x5f58=['/callback','callback','isMiddleware','setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x5d0746,_0x511b2d){var _0x19a392=function(_0x111382){while(--_0x111382){_0x5d0746['push'](_0x5d0746['shift']());}};_0x19a392(++_0x511b2d);}(_0x5f58,0x1a6));var _0x85f5=function(_0x1ce337,_0x2e7814){_0x1ce337=_0x1ce337-0x0;var _0x157500=_0x5f58[_0x1ce337];return _0x157500;};'use strict';var express=require(_0x85f5('0x0'));var passport=require('passport');var router=express[_0x85f5('0x1')]();var controller=require(_0x85f5('0x2'));var userController=require(_0x85f5('0x3'));var authService=require(_0x85f5('0x4'));router[_0x85f5('0x5')]('/',controller[_0x85f5('0x6')]);router['get'](_0x85f5('0x7'),controller[_0x85f5('0x8')],authService[_0x85f5('0x9')],userController[_0x85f5('0x6')],authService[_0x85f5('0xa')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x961a=['message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','generate','body','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','local-login','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','http','findOne','then','password','salt','disabled','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x961a,0x1b3));var _0xa961=function(_0x3bd35b,_0x9fb5d9){_0x3bd35b=_0x3bd35b-0x0;var _0xde13d4=_0x961a[_0x3bd35b];return _0xde13d4;};'use strict';var util=require('util');var passport=require(_0xa961('0x0'));var LocalStrategy=require(_0xa961('0x1'))[_0xa961('0x2')];var jayson=require('jayson/promise');var _=require(_0xa961('0x3'));var rs=require(_0xa961('0x4'));var moment=require(_0xa961('0x5'));var db=require(_0xa961('0x6'))['db'];var authService=require(_0xa961('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0xa961('0x8')]({'port':0x232b});function localAuthenticate(_0x3cfbaa,_0x33257a,_0xe34040,_0x4f0de6){var _0x181739,_0x33cf41;return db['Setting'][_0xa961('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xa961('0xa')](function(_0x1a84f2){_0x181739=_0x1a84f2;return _0x3cfbaa['findOne']({'attributes':['id','name',_0xa961('0xb'),_0xa961('0xc'),'role',_0xa961('0xd'),_0xa961('0xe'),_0xa961('0xf'),'loginAttempts'],'where':{'name':_0x33257a,'role':{'$or':[_0xa961('0x10'),_0xa961('0x11'),_0xa961('0x12')]}}});})['then'](function(_0xaa4330){if(!_0xaa4330||_0xaa4330&&_0xaa4330[_0xa961('0x13')]!==_0x33257a){throw new Error(_0xa961('0x14'));}else{_0x33cf41=_0xaa4330;return _0x33cf41;}})[_0xa961('0xa')](function(){_0x33cf41['authenticate'](_0xe34040,function(_0x5ba0c6,_0x59e3ea){var _0x5cb97b=_0x33cf41['loginAttempts']+0x1;if(_0x5ba0c6){return _0x4f0de6(_0x5ba0c6);}else if(!_0x59e3ea){if(_0x33cf41[_0xa961('0xd')]){return _0x4f0de6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x181739[_0xa961('0x15')]>0x0){if(_0x33cf41[_0xa961('0xe')]){if(_0x181739[_0xa961('0x16')]>0x0){if(moment(_0x33cf41[_0xa961('0xf')])[_0xa961('0x17')](_0x181739[_0xa961('0x16')],_0xa961('0x18'))>moment()){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else{return utils[_0xa961('0x19')](_0x33cf41,_0x5cb97b,![],null)['then'](function(){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});});}}else{return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}}else{if(_0x5cb97b>=_0x181739[_0xa961('0x15')]){return utils[_0xa961('0x19')](_0x33cf41,0x0,!![],moment())[_0xa961('0xa')](function(){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});});}else{return utils[_0xa961('0x19')](_0x33cf41,_0x5cb97b,![],null)['then'](function(){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});});}}}else{return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}}else{if(_0x33cf41[_0xa961('0xd')]){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else if(_0x181739[_0xa961('0x15')]>0x0){if(_0x33cf41['blocked']){if(_0x181739[_0xa961('0x16')]>0x0){if(moment(_0x33cf41[_0xa961('0xf')])[_0xa961('0x17')](_0x181739[_0xa961('0x16')],_0xa961('0x18'))>moment()){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else{return utils['clearBlockUser'](_0x33cf41,0x0,![],null)[_0xa961('0xa')](function(){return utils[_0xa961('0x1a')](_0x33cf41);})[_0xa961('0xa')](function(){return _0x4f0de6(null,_0x33cf41);});}}else{return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}}else{return utils['clearBlockUser'](_0x33cf41,0x0,![],null)[_0xa961('0xa')](function(){return utils['getLicense'](_0x33cf41);})['then'](function(){return _0x4f0de6(null,_0x33cf41);})['catch'](function(_0x4511c4){return _0x4f0de6(null,![],_0x4511c4);});}}else{if(_0x33cf41['blocked']){return _0x4f0de6(null,![],{'message':_0xa961('0x14')});}else{return utils[_0xa961('0x1a')](_0x33cf41)[_0xa961('0xa')](function(){return _0x4f0de6(null,_0x33cf41);});}}}});})['catch'](function(_0x59dec1){return _0x4f0de6(null,![],_0x59dec1);});}function sendServiceMail(_0x46989e){return db['MailAccount'][_0xa961('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xa961('0x13'),_0xa961('0x1c')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0xa961('0x1d')],'as':'CloudProvider'}]}]})[_0xa961('0xa')](function(_0x5b3ff9){if(!_0x5b3ff9){throw new Error(_0xa961('0x1e'));}var _0x542f91=_0x5b3ff9[_0xa961('0x1f')]();var _0x23115f={'account':_0x542f91,'message':_[_0xa961('0x20')]({'from':util[_0xa961('0x21')](_0xa961('0x22'),_0x5b3ff9['name'],_0x5b3ff9[_0xa961('0x1c')]||_0x5b3ff9[_0xa961('0x23')]['user'])},_0x46989e)};return client['request'](_0xa961('0x24'),_0x23115f);})[_0xa961('0xa')](function(_0x365246){if(_0x365246[_0xa961('0x25')]){throw new Error(util[_0xa961('0x21')](_0xa961('0x26'),_0x365246[_0xa961('0x25')][_0xa961('0x27')]||JSON[_0xa961('0x28')](_0x365246[_0xa961('0x25')])));}return!![];});}function handleError(_0x525f76,_0xf96cf1,_0x52015d){return _0x525f76[_0xa961('0x29')](_0xf96cf1||0x1f4)[_0xa961('0x2a')]({'message':_0x52015d?_0x52015d[_0xa961('0x27')]||_0x52015d:''});}exports[_0xa961('0x2b')]=function(_0x525153,_0x4a2ac5,_0x35fdbd){passport['authenticate']('local-login',function(_0x357483,_0x1cb51a,_0x170dbd){var _0x310e4c=_0x357483||_0x170dbd;if(_0x310e4c){return handleError(_0x4a2ac5,0x191,_0x310e4c);}if(!_0x1cb51a){return handleError(_0x4a2ac5,0x194,{'message':_0xa961('0x2c')});}else{var _0x553e92={'payload':{'id':_0x1cb51a['id'],'role':_0x1cb51a[_0xa961('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xa961('0x2e')](_0x553e92)[_0xa961('0xa')](function(_0x5ef28b){_0x4a2ac5[_0xa961('0x2f')]({'id':_0x1cb51a['id'],'token':_0x5ef28b,'statusCall':'','isAlreadyLogged':_0x1cb51a[_0xa961('0x30')]});});}})(_0x525153,_0x4a2ac5,_0x35fdbd);};exports['forgot']=function(_0x59588a,_0x3d11eb){if(!_0x59588a['body'][_0xa961('0x1c')]){return handleError(_0x3d11eb,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2ce79f=rs[_0xa961('0x31')]();_0x59588a[_0xa961('0x32')]['email']=_0x59588a[_0xa961('0x32')][_0xa961('0x1c')][_0xa961('0x33')]()['toLowerCase']();var _0x1678af;return db[_0xa961('0x34')][_0xa961('0x9')]({'where':{'id':0x1},'attributes':[_0xa961('0x15'),_0xa961('0x16')],'raw':!![]})[_0xa961('0xa')](function(_0x298549){_0x1678af=_0x298549;return db[_0xa961('0x35')][_0xa961('0x1b')]({'where':{'email':_0x59588a['body'][_0xa961('0x1c')]}});})['then'](function(_0x525459){if(!_0x525459){throw new Error(_0xa961('0x36'));}if(_0x525459[_0xa961('0xd')]){throw new Error(_0xa961('0x37'));}if(_0x525459[_0xa961('0xe')]){if(moment(_0x525459[_0xa961('0xf')])['add'](_0x1678af[_0xa961('0x16')],'minutes')>moment()){throw new Error(_0xa961('0x38'));}else{_0x525459['blocked']=![];_0x525459[_0xa961('0xf')]=null;}}_0x525459[_0xa961('0x39')]=_0x2ce79f;_0x525459['resetPasswordExpires']=Date[_0xa961('0x3a')]()+0x36ee80;return _0x525459[_0xa961('0x3b')]();})[_0xa961('0xa')](function(){return sendServiceMail({'to':_0x59588a[_0xa961('0x32')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa961('0x3c')+_0xa961('0x3d')+_0xa961('0x3e')+_0x59588a[_0xa961('0x3f')][_0xa961('0x40')]+_0xa961('0x41')+_0x2ce79f+'\x0a\x0a'+_0xa961('0x42')});})[_0xa961('0xa')](function(){_0x3d11eb[_0xa961('0x29')](0xc8)[_0xa961('0x2a')]({'message':_0xa961('0x43')});})[_0xa961('0x44')](function(_0x3273d9){return handleError(_0x3d11eb,0x1f4,_0x3273d9);});};exports[_0xa961('0x45')]=function(_0xa614c5,_0x492241){return db['User'][_0xa961('0x1b')]({'where':{'resetPasswordToken':_0xa614c5['params'][_0xa961('0x46')],'resetPasswordExpires':{'$gt':Date[_0xa961('0x3a')]()}}})[_0xa961('0xa')](function(_0x3c1bb9){if(!_0x3c1bb9){throw new Error(_0xa961('0x47'));}return db[_0xa961('0x34')][_0xa961('0x9')]({'attributes':['id',_0xa961('0x48'),_0xa961('0x49'),_0xa961('0x4a')]})[_0xa961('0xa')](function(_0x5e09e9){if(_0x5e09e9[_0xa961('0x48')])authService['validatePasswordPattern'](_0xa614c5['body'][_0xa961('0xb')]);if(!_0x5e09e9[_0xa961('0x49')]||!_0x3c1bb9[_0xa961('0x4b')])return _0x3c1bb9;authService[_0xa961('0x4c')](_0xa614c5['body']['password'],_0x3c1bb9[_0xa961('0x4b')],_0x5e09e9[_0xa961('0x4a')]);return _0x3c1bb9;})['then'](function(){_0x3c1bb9[_0xa961('0xb')]=_0xa614c5['body'][_0xa961('0xb')];_0x3c1bb9[_0xa961('0x39')]=null;_0x3c1bb9[_0xa961('0x4d')]=null;return _0x3c1bb9[_0xa961('0x3b')]();});})[_0xa961('0xa')](function(){_0x492241[_0xa961('0x29')](0xc8)[_0xa961('0x2a')]({'message':'Password\x20reset!'});})[_0xa961('0x44')](function(_0xa06cf2){return handleError(_0x492241,0x1f4,_0xa06cf2);});};passport['use'](_0xa961('0x4e'),new LocalStrategy({'usernameField':_0xa961('0x13'),'passwordField':_0xa961('0xb')},function(_0x58232c,_0x25583a,_0x1518c6){return localAuthenticate(db[_0xa961('0x35')],_0x58232c,_0x25583a,_0x1518c6);}));
\ No newline at end of file
+var _0x2369=['loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','login','local-login','role','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','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','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../components/auth/service','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','blockedAt'];(function(_0x1fc716,_0x263857){var _0x637fd3=function(_0x1fbfeb){while(--_0x1fbfeb){_0x1fc716['push'](_0x1fc716['shift']());}};_0x637fd3(++_0x263857);}(_0x2369,0x12c));var _0x9236=function(_0x40750d,_0x593094){_0x40750d=_0x40750d-0x0;var _0x42d026=_0x2369[_0x40750d];return _0x42d026;};'use strict';var util=require(_0x9236('0x0'));var passport=require(_0x9236('0x1'));var LocalStrategy=require(_0x9236('0x2'))[_0x9236('0x3')];var jayson=require(_0x9236('0x4'));var _=require(_0x9236('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x9236('0x6'));var utils=require('../../config/utils');var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x32b435,_0x3026c5,_0x138784,_0x1f226d){var _0x54fb80,_0x3a6b3c;return db[_0x9236('0x7')][_0x9236('0x8')]({'where':{'id':0x1},'attributes':[_0x9236('0x9'),_0x9236('0xa')],'raw':!![]})['then'](function(_0x3a353b){_0x54fb80=_0x3a353b;return _0x32b435[_0x9236('0x8')]({'attributes':['id',_0x9236('0xb'),'password',_0x9236('0xc'),'role',_0x9236('0xd'),_0x9236('0xe'),_0x9236('0xf'),_0x9236('0x10')],'where':{'name':_0x3026c5,'role':{'$or':[_0x9236('0x11'),_0x9236('0x12'),_0x9236('0x13')]}}});})[_0x9236('0x14')](function(_0x52ceda){if(!_0x52ceda||_0x52ceda&&_0x52ceda[_0x9236('0xb')]!==_0x3026c5){throw new Error(_0x9236('0x15'));}else{_0x3a6b3c=_0x52ceda;return _0x3a6b3c;}})[_0x9236('0x14')](function(){_0x3a6b3c['authenticate'](_0x138784,function(_0xeddcaf,_0x24dce9){var _0x4ae2b2=_0x3a6b3c[_0x9236('0x10')]+0x1;if(_0xeddcaf){return _0x1f226d(_0xeddcaf);}else if(!_0x24dce9){if(_0x3a6b3c['disabled']){return _0x1f226d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x54fb80['allowedLoginAttempts']>0x0){if(_0x3a6b3c[_0x9236('0xe')]){if(_0x54fb80['blockDuration']>0x0){if(moment(_0x3a6b3c['blockedAt'])[_0x9236('0x16')](_0x54fb80['blockDuration'],'minutes')>moment()){return _0x1f226d(null,![],{'message':_0x9236('0x15')});}else{return utils[_0x9236('0x17')](_0x3a6b3c,_0x4ae2b2,![],null)['then'](function(){return _0x1f226d(null,![],{'message':_0x9236('0x15')});});}}else{return _0x1f226d(null,![],{'message':_0x9236('0x15')});}}else{if(_0x4ae2b2>=_0x54fb80['allowedLoginAttempts']){return utils[_0x9236('0x17')](_0x3a6b3c,0x0,!![],moment())['then'](function(){return _0x1f226d(null,![],{'message':_0x9236('0x15')});});}else{return utils[_0x9236('0x17')](_0x3a6b3c,_0x4ae2b2,![],null)[_0x9236('0x14')](function(){return _0x1f226d(null,![],{'message':_0x9236('0x15')});});}}}else{return _0x1f226d(null,![],{'message':_0x9236('0x15')});}}else{if(_0x3a6b3c[_0x9236('0xd')]){return _0x1f226d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x54fb80[_0x9236('0x9')]>0x0){if(_0x3a6b3c['blocked']){if(_0x54fb80[_0x9236('0xa')]>0x0){if(moment(_0x3a6b3c['blockedAt'])[_0x9236('0x16')](_0x54fb80[_0x9236('0xa')],'minutes')>moment()){return _0x1f226d(null,![],{'message':_0x9236('0x15')});}else{return utils[_0x9236('0x17')](_0x3a6b3c,0x0,![],null)[_0x9236('0x14')](function(){return utils[_0x9236('0x18')](_0x3a6b3c);})[_0x9236('0x14')](function(){return _0x1f226d(null,_0x3a6b3c);});}}else{return _0x1f226d(null,![],{'message':_0x9236('0x15')});}}else{return utils[_0x9236('0x17')](_0x3a6b3c,0x0,![],null)[_0x9236('0x14')](function(){return utils[_0x9236('0x18')](_0x3a6b3c);})[_0x9236('0x14')](function(){return _0x1f226d(null,_0x3a6b3c);})['catch'](function(_0x1ab17c){return _0x1f226d(null,![],_0x1ab17c);});}}else{if(_0x3a6b3c[_0x9236('0xe')]){return _0x1f226d(null,![],{'message':_0x9236('0x15')});}else{return utils[_0x9236('0x18')](_0x3a6b3c)[_0x9236('0x14')](function(){return _0x1f226d(null,_0x3a6b3c);});}}}});})[_0x9236('0x19')](function(_0x1e113f){return _0x1f226d(null,![],_0x1e113f);});}function sendServiceMail(_0x490680){return db[_0x9236('0x1a')][_0x9236('0x1b')]({'where':{'service':!![]},'attributes':['id','name',_0x9236('0x1c')],'include':[{'model':db[_0x9236('0x1d')],'as':_0x9236('0x1e'),'include':[{'model':db[_0x9236('0x1f')],'as':_0x9236('0x1f')}]}]})[_0x9236('0x14')](function(_0x1f1173){if(!_0x1f1173){throw new Error(_0x9236('0x20'));}var _0x3233c0=_0x1f1173[_0x9236('0x21')]();var _0x2951e5={'account':_0x3233c0,'message':_[_0x9236('0x22')]({'from':util[_0x9236('0x23')](_0x9236('0x24'),_0x1f1173[_0x9236('0xb')],_0x1f1173['email']||_0x1f1173[_0x9236('0x1e')][_0x9236('0x12')])},_0x490680)};return client[_0x9236('0x25')](_0x9236('0x26'),_0x2951e5);})[_0x9236('0x14')](function(_0x296946){if(_0x296946[_0x9236('0x27')]){throw new Error(util[_0x9236('0x23')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x296946[_0x9236('0x27')]['message']||JSON[_0x9236('0x28')](_0x296946[_0x9236('0x27')])));}return!![];});}function handleError(_0x1b9799,_0x503ba5,_0xee8ffc){return _0x1b9799[_0x9236('0x29')](_0x503ba5||0x1f4)[_0x9236('0x2a')]({'message':_0xee8ffc?_0xee8ffc['message']||_0xee8ffc:''});}exports[_0x9236('0x2b')]=function(_0x1221fb,_0x42adac,_0x3cae6e){passport['authenticate'](_0x9236('0x2c'),function(_0x213258,_0x213d48,_0x2134ff){var _0x351592=_0x213258||_0x2134ff;if(_0x351592){return handleError(_0x42adac,0x191,_0x351592);}if(!_0x213d48){return handleError(_0x42adac,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2aec37={'payload':{'id':_0x213d48['id'],'role':_0x213d48[_0x9236('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0x9236('0x2e')](_0x2aec37)[_0x9236('0x14')](function(_0x4eaf5e){_0x42adac[_0x9236('0x2f')]({'id':_0x213d48['id'],'token':_0x4eaf5e,'statusCall':'','isAlreadyLogged':_0x213d48['online']});});}})(_0x1221fb,_0x42adac,_0x3cae6e);};exports[_0x9236('0x30')]=function(_0x55078c,_0x9fa7f7){if(!_0x55078c[_0x9236('0x31')][_0x9236('0x1c')]){return handleError(_0x9fa7f7,0x1f4,{'message':_0x9236('0x32')});}var _0x251fff=rs[_0x9236('0x33')]();_0x55078c[_0x9236('0x31')][_0x9236('0x1c')]=_0x55078c['body'][_0x9236('0x1c')][_0x9236('0x34')]()[_0x9236('0x35')]();var _0x272b65;return db['Setting'][_0x9236('0x8')]({'where':{'id':0x1},'attributes':[_0x9236('0x9'),_0x9236('0xa')],'raw':!![]})[_0x9236('0x14')](function(_0x2d7a12){_0x272b65=_0x2d7a12;return db[_0x9236('0x36')][_0x9236('0x1b')]({'where':{'email':_0x55078c[_0x9236('0x31')][_0x9236('0x1c')]}});})[_0x9236('0x14')](function(_0x3baf30){if(!_0x3baf30){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3baf30['disabled']){throw new Error(_0x9236('0x37'));}if(_0x3baf30[_0x9236('0xe')]){if(moment(_0x3baf30[_0x9236('0xf')])[_0x9236('0x16')](_0x272b65[_0x9236('0xa')],_0x9236('0x38'))>moment()){throw new Error(_0x9236('0x39'));}else{_0x3baf30['blocked']=![];_0x3baf30['blockedAt']=null;}}_0x3baf30['resetPasswordToken']=_0x251fff;_0x3baf30[_0x9236('0x3a')]=Date['now']()+0x36ee80;return _0x3baf30[_0x9236('0x3b')]();})[_0x9236('0x14')](function(){return sendServiceMail({'to':_0x55078c[_0x9236('0x31')][_0x9236('0x1c')],'subject':_0x9236('0x3c'),'text':_0x9236('0x3d')+_0x9236('0x3e')+_0x9236('0x3f')+_0x55078c[_0x9236('0x40')]['host']+_0x9236('0x41')+_0x251fff+'\x0a\x0a'+_0x9236('0x42')});})['then'](function(){_0x9fa7f7['status'](0xc8)[_0x9236('0x2a')]({'message':'Reset\x20Email\x20sent!'});})[_0x9236('0x19')](function(_0x276b39){return handleError(_0x9fa7f7,0x1f4,_0x276b39);});};exports['reset']=function(_0xdb2e03,_0x214a1d){return db['User'][_0x9236('0x1b')]({'where':{'resetPasswordToken':_0xdb2e03[_0x9236('0x43')][_0x9236('0x44')],'resetPasswordExpires':{'$gt':Date[_0x9236('0x45')]()}}})[_0x9236('0x14')](function(_0x5243ab){if(!_0x5243ab){throw new Error(_0x9236('0x46'));}return db[_0x9236('0x7')][_0x9236('0x8')]({'attributes':['id','securePassword',_0x9236('0x47'),_0x9236('0x48')]})[_0x9236('0x14')](function(_0x11c569){if(_0x11c569[_0x9236('0x49')])authService[_0x9236('0x4a')](_0xdb2e03['body'][_0x9236('0x4b')]);if(!_0x11c569[_0x9236('0x47')]||!_0x5243ab['previousPasswords'])return _0x5243ab;authService['validatePasswordHistory'](_0xdb2e03[_0x9236('0x31')][_0x9236('0x4b')],_0x5243ab[_0x9236('0x4c')],_0x11c569['passwordHistoryLimit']);return _0x5243ab;})[_0x9236('0x14')](function(){_0x5243ab[_0x9236('0x4b')]=_0xdb2e03[_0x9236('0x31')]['password'];_0x5243ab['resetPasswordToken']=null;_0x5243ab[_0x9236('0x3a')]=null;return _0x5243ab[_0x9236('0x3b')]();});})[_0x9236('0x14')](function(){_0x214a1d[_0x9236('0x29')](0xc8)[_0x9236('0x2a')]({'message':_0x9236('0x4d')});})[_0x9236('0x19')](function(_0xdb17b9){return handleError(_0x214a1d,0x1f4,_0xdb17b9);});};passport[_0x9236('0x4e')](_0x9236('0x2c'),new LocalStrategy({'usernameField':_0x9236('0xb'),'passwordField':_0x9236('0x4b')},function(_0x22ec5f,_0x4d79c9,_0x686dca){return localAuthenticate(db[_0x9236('0x36')],_0x22ec5f,_0x4d79c9,_0x686dca);}));
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcecd=['post','forgot','reset','Router','./authLocal.controller'];(function(_0x2f25c9,_0xabd53a){var _0x58c8f8=function(_0x5b45a4){while(--_0x5b45a4){_0x2f25c9['push'](_0x2f25c9['shift']());}};_0x58c8f8(++_0xabd53a);}(_0xcecd,0x1c5));var _0xdcec=function(_0x15138e,_0x5b963f){_0x15138e=_0x15138e-0x0;var _0x3e79bf=_0xcecd[_0x15138e];return _0x3e79bf;};'use strict';var express=require('express');var router=express[_0xdcec('0x0')]();var controller=require(_0xdcec('0x1'));router[_0xdcec('0x2')]('/',controller['login']);router[_0xdcec('0x2')]('/forgot',controller[_0xdcec('0x3')]);router['post']('/reset/:token',controller[_0xdcec('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0x9695=['forgot','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9695,0xf6));var _0x5969=function(_0xd45a90,_0x263d79){_0xd45a90=_0xd45a90-0x0;var _0x26c03d=_0x9695[_0xd45a90];return _0x26c03d;};'use strict';var express=require(_0x5969('0x0'));var router=express[_0x5969('0x1')]();var controller=require(_0x5969('0x2'));router[_0x5969('0x3')]('/',controller[_0x5969('0x4')]);router[_0x5969('0x3')](_0x5969('0x5'),controller[_0x5969('0x6')]);router['post']('/reset/:token',controller[_0x5969('0x7')]);module[_0x5969('0x8')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe63e=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x277985,_0x4c1c1b){var _0x41f043=function(_0x1af7d5){while(--_0x1af7d5){_0x277985['push'](_0x277985['shift']());}};_0x41f043(++_0x4c1c1b);}(_0xe63e,0x117));var _0xee63=function(_0x4ca4b7,_0x9be8a0){_0x4ca4b7=_0x4ca4b7-0x0;var _0x50a6f3=_0xe63e[_0x4ca4b7];return _0x50a6f3;};'use strict';var Sequelize=require(_0xee63('0x0'));module[_0xee63('0x1')]={'name':{'type':Sequelize[_0xee63('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xee63('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xee63('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xee63('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5960=['BOOLEAN','INTEGER','STRING'];(function(_0x5c5502,_0x47cf47){var _0x359546=function(_0x5b0561){while(--_0x5b0561){_0x5c5502['push'](_0x5c5502['shift']());}};_0x359546(++_0x47cf47);}(_0x5960,0x8f));var _0x0596=function(_0x5db318,_0x5b8ad5){_0x5db318=_0x5db318-0x0;var _0x1184ce=_0x5960[_0x5db318];return _0x1184ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0596('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x0596('0x0')]},'description':{'type':Sequelize[_0x0596('0x0')]},'status':{'type':Sequelize[_0x0596('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0596('0x2')],'defaultValue':0xa}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x48a7=['nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','catch','show','params','options','create','body','find','addConditions','ids','getConditions','findOne','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','Automation','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x48a7,0x111));var _0x748a=function(_0x4cf5f5,_0x218a3f){_0x4cf5f5=_0x4cf5f5-0x0;var _0x2d36a7=_0x48a7[_0x4cf5f5];return _0x2d36a7;};'use strict';var emlformat=require(_0x748a('0x0'));var rimraf=require(_0x748a('0x1'));var zipdir=require(_0x748a('0x2'));var jsonpatch=require(_0x748a('0x3'));var rp=require(_0x748a('0x4'));var moment=require('moment');var BPromise=require(_0x748a('0x5'));var Mustache=require(_0x748a('0x6'));var util=require(_0x748a('0x7'));var path=require(_0x748a('0x8'));var sox=require(_0x748a('0x9'));var csv=require('to-csv');var ejs=require(_0x748a('0xa'));var fs=require('fs');var fs_extra=require(_0x748a('0xb'));var _=require(_0x748a('0xc'));var squel=require(_0x748a('0xd'));var crypto=require(_0x748a('0xe'));var jsforce=require(_0x748a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x748a('0x10'));var querystring=require(_0x748a('0x11'));var Papa=require(_0x748a('0x12'));var Redis=require('ioredis');var authService=require(_0x748a('0x13'));var qs=require(_0x748a('0x14'));var as=require(_0x748a('0x15'));var hardwareService=require(_0x748a('0x16'));var logger=require(_0x748a('0x17'))(_0x748a('0x18'));var utils=require(_0x748a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x748a('0x1a'));var db=require(_0x748a('0x1b'))['db'];function respondWithStatusCode(_0x1e4b64,_0x554a24){_0x554a24=_0x554a24||0xcc;return function(_0x1dc72f){if(_0x1dc72f){return _0x1e4b64['sendStatus'](_0x554a24);}return _0x1e4b64[_0x748a('0x1c')](_0x554a24)[_0x748a('0x1d')]();};}function respondWithResult(_0x3189a6,_0xdf4bcf){_0xdf4bcf=_0xdf4bcf||0xc8;return function(_0x35da98){if(_0x35da98){return _0x3189a6[_0x748a('0x1c')](_0xdf4bcf)[_0x748a('0x1e')](_0x35da98);}};}function respondWithFilteredResult(_0x36da27,_0x546553){return function(_0x2a0b8e){if(_0x2a0b8e){var _0x278b2c=typeof _0x546553[_0x748a('0x1f')]===_0x748a('0x20')&&typeof _0x546553['limit']==='undefined';var _0x2dfa32=_0x2a0b8e[_0x748a('0x21')];var _0x37c1fd=_0x278b2c?0x0:_0x546553[_0x748a('0x1f')];var _0x1cfc87=_0x278b2c?_0x2a0b8e[_0x748a('0x21')]:_0x546553[_0x748a('0x1f')]+_0x546553[_0x748a('0x22')];var _0x272ba7;if(_0x1cfc87>=_0x2dfa32){_0x1cfc87=_0x2dfa32;_0x272ba7=0xc8;}else{_0x272ba7=0xce;}_0x36da27[_0x748a('0x1c')](_0x272ba7);return _0x36da27[_0x748a('0x23')](_0x748a('0x24'),_0x37c1fd+'-'+_0x1cfc87+'/'+_0x2dfa32)[_0x748a('0x1e')](_0x2a0b8e);}return null;};}function patchUpdates(_0xbc2600){return function(_0x34aa0d){try{jsonpatch[_0x748a('0x25')](_0x34aa0d,_0xbc2600,!![]);}catch(_0x278236){return BPromise[_0x748a('0x26')](_0x278236);}return _0x34aa0d['save']();};}function saveUpdates(_0x226ce3,_0x58ac5d){return function(_0x39521e){if(_0x39521e){return _0x39521e[_0x748a('0x27')](_0x226ce3)[_0x748a('0x28')](function(_0xea7328){return _0xea7328;});}return null;};}function removeEntity(_0x44b68d,_0x2bddb6){return function(_0x331c21){if(_0x331c21){return _0x331c21[_0x748a('0x29')]()[_0x748a('0x28')](function(){_0x44b68d[_0x748a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x187519,_0x33217e){return function(_0x19bd3d){if(!_0x19bd3d){_0x187519[_0x748a('0x2a')](0x194);}return _0x19bd3d;};}function handleError(_0x2880f0,_0x508345){_0x508345=_0x508345||0x1f4;return function(_0x367bca){logger['error'](_0x367bca['stack']);if(_0x367bca[_0x748a('0x2b')]){delete _0x367bca[_0x748a('0x2b')];}_0x2880f0['status'](_0x508345)[_0x748a('0x2c')](_0x367bca);};}exports['index']=function(_0x4914e5,_0x4c90d6){var _0x584e0f={},_0xc456e2={},_0x1dead4={'count':0x0,'rows':[]};var _0xa01140=_['map'](db[_0x748a('0x2d')][_0x748a('0x2e')],function(_0x350814){return{'name':_0x350814['fieldName'],'type':_0x350814[_0x748a('0x2f')][_0x748a('0x30')]};});_0xc456e2['model']=_[_0x748a('0x31')](_0xa01140,_0x748a('0x2b'));_0xc456e2[_0x748a('0x32')]=_[_0x748a('0x33')](_0x4914e5[_0x748a('0x32')]);_0xc456e2[_0x748a('0x34')]=_[_0x748a('0x35')](_0xc456e2['model'],_0xc456e2[_0x748a('0x32')]);_0x584e0f[_0x748a('0x36')]=_[_0x748a('0x35')](_0xc456e2['model'],qs[_0x748a('0x37')](_0x4914e5[_0x748a('0x32')][_0x748a('0x37')]));_0x584e0f[_0x748a('0x36')]=_0x584e0f[_0x748a('0x36')][_0x748a('0x38')]?_0x584e0f['attributes']:_0xc456e2[_0x748a('0x39')];if(!_0x4914e5['query'][_0x748a('0x3a')](_0x748a('0x3b'))){_0x584e0f[_0x748a('0x22')]=qs[_0x748a('0x22')](_0x4914e5[_0x748a('0x32')][_0x748a('0x22')]);_0x584e0f[_0x748a('0x1f')]=qs[_0x748a('0x1f')](_0x4914e5[_0x748a('0x32')][_0x748a('0x1f')]);}_0x584e0f[_0x748a('0x3c')]=qs[_0x748a('0x3d')](_0x4914e5[_0x748a('0x32')][_0x748a('0x3d')]);_0x584e0f['where']=qs[_0x748a('0x34')](_[_0x748a('0x3e')](_0x4914e5[_0x748a('0x32')],_0xc456e2[_0x748a('0x34')]),_0xa01140);if(_0x4914e5[_0x748a('0x32')][_0x748a('0x3f')]){_0x584e0f[_0x748a('0x40')]=_[_0x748a('0x41')](_0x584e0f[_0x748a('0x40')],{'$or':_[_0x748a('0x31')](_0xa01140,function(_0x45f1f4){if(_0x45f1f4[_0x748a('0x2f')]!=='VIRTUAL'){var _0x343d74={};_0x343d74[_0x45f1f4['name']]={'$like':'%'+_0x4914e5[_0x748a('0x32')]['filter']+'%'};return _0x343d74;}})});}_0x584e0f=_[_0x748a('0x41')]({},_0x584e0f,_0x4914e5['options']);var _0x446908={'where':_0x584e0f[_0x748a('0x40')]};return db[_0x748a('0x2d')][_0x748a('0x21')](_0x446908)[_0x748a('0x28')](function(_0x330f7b){_0x1dead4['count']=_0x330f7b;if(_0x4914e5[_0x748a('0x32')][_0x748a('0x42')]){_0x584e0f['include']=[{'all':!![]}];}return db[_0x748a('0x2d')][_0x748a('0x43')](_0x584e0f);})[_0x748a('0x28')](function(_0x41e6cf){_0x1dead4['rows']=_0x41e6cf;return _0x1dead4;})[_0x748a('0x28')](respondWithFilteredResult(_0x4c90d6,_0x584e0f))[_0x748a('0x44')](handleError(_0x4c90d6,null));};exports[_0x748a('0x45')]=function(_0x4f3860,_0x38d434){var _0xf0a875={'raw':![],'where':{'id':_0x4f3860[_0x748a('0x46')]['id']}},_0x28a66a={};_0x28a66a[_0x748a('0x39')]=_[_0x748a('0x33')](db[_0x748a('0x2d')][_0x748a('0x2e')]);_0x28a66a[_0x748a('0x32')]=_[_0x748a('0x33')](_0x4f3860['query']);_0x28a66a[_0x748a('0x34')]=_[_0x748a('0x35')](_0x28a66a['model'],_0x28a66a[_0x748a('0x32')]);_0xf0a875[_0x748a('0x36')]=_['intersection'](_0x28a66a[_0x748a('0x39')],qs[_0x748a('0x37')](_0x4f3860['query'][_0x748a('0x37')]));_0xf0a875['attributes']=_0xf0a875[_0x748a('0x36')][_0x748a('0x38')]?_0xf0a875[_0x748a('0x36')]:_0x28a66a[_0x748a('0x39')];if(_0x4f3860['query'][_0x748a('0x42')]){_0xf0a875['include']=[{'all':!![]}];}_0xf0a875=_[_0x748a('0x41')]({},_0xf0a875,_0x4f3860[_0x748a('0x47')]);return db[_0x748a('0x2d')]['find'](_0xf0a875)[_0x748a('0x28')](handleEntityNotFound(_0x38d434,null))[_0x748a('0x28')](respondWithResult(_0x38d434,null))['catch'](handleError(_0x38d434,null));};exports['create']=function(_0x8e62ea,_0x3e133a){return db[_0x748a('0x2d')][_0x748a('0x48')](_0x8e62ea[_0x748a('0x49')],{})[_0x748a('0x28')](respondWithResult(_0x3e133a,0xc9))[_0x748a('0x44')](handleError(_0x3e133a,null));};exports[_0x748a('0x27')]=function(_0x27530d,_0x346b5b){if(_0x27530d[_0x748a('0x49')]['id']){delete _0x27530d[_0x748a('0x49')]['id'];}return db[_0x748a('0x2d')][_0x748a('0x4a')]({'where':{'id':_0x27530d[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x346b5b,null))[_0x748a('0x28')](saveUpdates(_0x27530d[_0x748a('0x49')],null))[_0x748a('0x28')](respondWithResult(_0x346b5b,null))[_0x748a('0x44')](handleError(_0x346b5b,null));};exports[_0x748a('0x29')]=function(_0x509904,_0x33811a){return db[_0x748a('0x2d')]['find']({'where':{'id':_0x509904[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x33811a,null))[_0x748a('0x28')](removeEntity(_0x33811a,null))[_0x748a('0x44')](handleError(_0x33811a,null));};exports[_0x748a('0x4b')]=function(_0x2aa2b2,_0x34be4f,_0x3da4a8){return db['Condition'][_0x748a('0x4a')]({'where':{'id':_0x2aa2b2['params']['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x34be4f,null))[_0x748a('0x28')](function(_0x2ea180){if(_0x2ea180){return _0x2ea180[_0x748a('0x4b')](_0x2aa2b2['body'][_0x748a('0x4c')],_['omit'](_0x2aa2b2[_0x748a('0x49')],['ids','id'])||{});}})[_0x748a('0x28')](respondWithResult(_0x34be4f,null))[_0x748a('0x44')](handleError(_0x34be4f,null));};exports[_0x748a('0x4d')]=function(_0x1830db,_0x23320e,_0x48f86a){var _0x12d943={};var _0x192f7a={};var _0x120f98;var _0xbb9892;return db[_0x748a('0x2d')][_0x748a('0x4e')]({'where':{'id':_0x1830db[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x23320e,null))['then'](function(_0x145960){if(_0x145960){_0x120f98=_0x145960;_0x192f7a['model']=_[_0x748a('0x33')](db['Condition'][_0x748a('0x2e')]);_0x192f7a['query']=_[_0x748a('0x33')](_0x1830db[_0x748a('0x32')]);_0x192f7a[_0x748a('0x34')]=_[_0x748a('0x35')](_0x192f7a[_0x748a('0x39')],_0x192f7a['query']);_0x12d943['attributes']=_[_0x748a('0x35')](_0x192f7a[_0x748a('0x39')],qs[_0x748a('0x37')](_0x1830db[_0x748a('0x32')]['fields']));_0x12d943['attributes']=_0x12d943['attributes'][_0x748a('0x38')]?_0x12d943[_0x748a('0x36')]:_0x192f7a['model'];_0x12d943[_0x748a('0x3c')]=qs[_0x748a('0x3d')](_0x1830db[_0x748a('0x32')][_0x748a('0x3d')]);_0x12d943[_0x748a('0x40')]=qs[_0x748a('0x34')](_[_0x748a('0x3e')](_0x1830db['query'],_0x192f7a[_0x748a('0x34')]));if(_0x1830db[_0x748a('0x32')][_0x748a('0x3f')]){_0x12d943[_0x748a('0x40')]=_[_0x748a('0x41')](_0x12d943[_0x748a('0x40')],{'$or':_[_0x748a('0x31')](_0x12d943[_0x748a('0x36')],function(_0x36ee37){var _0x4b42d1={};_0x4b42d1[_0x36ee37]={'$like':'%'+_0x1830db[_0x748a('0x32')]['filter']+'%'};return _0x4b42d1;})});}_0x12d943=_[_0x748a('0x41')]({},_0x12d943,_0x1830db['options']);return _0x120f98['getConditions'](_0x12d943);}})[_0x748a('0x28')](function(_0x1e5152){if(_0x1e5152){_0xbb9892=_0x1e5152[_0x748a('0x38')];if(!_0x1830db['query'][_0x748a('0x3a')](_0x748a('0x3b'))){_0x12d943[_0x748a('0x22')]=qs[_0x748a('0x22')](_0x1830db[_0x748a('0x32')]['limit']);_0x12d943[_0x748a('0x1f')]=qs[_0x748a('0x1f')](_0x1830db[_0x748a('0x32')]['offset']);}return _0x120f98[_0x748a('0x4d')](_0x12d943);}})[_0x748a('0x28')](function(_0x39d12a){if(_0x39d12a){return _0x39d12a?{'count':_0xbb9892,'rows':_0x39d12a}:null;}})[_0x748a('0x28')](respondWithResult(_0x23320e,null))[_0x748a('0x44')](handleError(_0x23320e,null));};exports[_0x748a('0x4f')]=function(_0x24424c,_0x49c648,_0x5a37df){return db[_0x748a('0x50')][_0x748a('0x4a')]({'where':{'id':_0x24424c[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x49c648,null))[_0x748a('0x28')](function(_0x5646a3){if(_0x5646a3){return _0x5646a3['addActions'](_0x24424c['body'][_0x748a('0x4c')],_[_0x748a('0x51')](_0x24424c[_0x748a('0x49')],['ids','id'])||{});}})[_0x748a('0x28')](respondWithResult(_0x49c648,null))[_0x748a('0x44')](handleError(_0x49c648,null));};exports[_0x748a('0x52')]=function(_0xf3dcca,_0x216661,_0x5c6a3c){var _0x400ff5={};var _0x1ad9e9={};var _0xd5582d;var _0xfaaf44;return db['Automation'][_0x748a('0x4e')]({'where':{'id':_0xf3dcca[_0x748a('0x46')]['id']}})[_0x748a('0x28')](handleEntityNotFound(_0x216661,null))['then'](function(_0x15c3e7){if(_0x15c3e7){_0xd5582d=_0x15c3e7;_0x1ad9e9[_0x748a('0x39')]=_[_0x748a('0x33')](db[_0x748a('0x50')][_0x748a('0x2e')]);_0x1ad9e9[_0x748a('0x32')]=_['keys'](_0xf3dcca['query']);_0x1ad9e9['filters']=_[_0x748a('0x35')](_0x1ad9e9[_0x748a('0x39')],_0x1ad9e9[_0x748a('0x32')]);_0x400ff5['attributes']=_[_0x748a('0x35')](_0x1ad9e9[_0x748a('0x39')],qs[_0x748a('0x37')](_0xf3dcca[_0x748a('0x32')][_0x748a('0x37')]));_0x400ff5[_0x748a('0x36')]=_0x400ff5['attributes']['length']?_0x400ff5['attributes']:_0x1ad9e9[_0x748a('0x39')];_0x400ff5[_0x748a('0x3c')]=qs[_0x748a('0x3d')](_0xf3dcca[_0x748a('0x32')]['sort']);_0x400ff5[_0x748a('0x40')]=qs[_0x748a('0x34')](_[_0x748a('0x3e')](_0xf3dcca[_0x748a('0x32')],_0x1ad9e9[_0x748a('0x34')]));if(_0xf3dcca[_0x748a('0x32')][_0x748a('0x3f')]){_0x400ff5[_0x748a('0x40')]=_['merge'](_0x400ff5['where'],{'$or':_[_0x748a('0x31')](_0x400ff5[_0x748a('0x36')],function(_0x95ce95){var _0xe505a1={};_0xe505a1[_0x95ce95]={'$like':'%'+_0xf3dcca['query']['filter']+'%'};return _0xe505a1;})});}_0x400ff5=_['merge']({},_0x400ff5,_0xf3dcca[_0x748a('0x47')]);return _0xd5582d['getActions'](_0x400ff5);}})[_0x748a('0x28')](function(_0x5d0f62){if(_0x5d0f62){_0xfaaf44=_0x5d0f62[_0x748a('0x38')];if(!_0xf3dcca['query'][_0x748a('0x3a')](_0x748a('0x3b'))){_0x400ff5['limit']=qs[_0x748a('0x22')](_0xf3dcca['query'][_0x748a('0x22')]);_0x400ff5['offset']=qs[_0x748a('0x1f')](_0xf3dcca[_0x748a('0x32')][_0x748a('0x1f')]);}return _0xd5582d[_0x748a('0x52')](_0x400ff5);}})[_0x748a('0x28')](function(_0x92d50f){if(_0x92d50f){return _0x92d50f?{'count':_0xfaaf44,'rows':_0x92d50f}:null;}})[_0x748a('0x28')](respondWithResult(_0x216661,null))[_0x748a('0x44')](handleError(_0x216661,null));};
\ No newline at end of file
+var _0x81b9=['hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','status','error','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne'];(function(_0x12bb4d,_0x43303f){var _0x266f53=function(_0x55e87c){while(--_0x55e87c){_0x12bb4d['push'](_0x12bb4d['shift']());}};_0x266f53(++_0x43303f);}(_0x81b9,0xb0));var _0x981b=function(_0x5ded57,_0x4869cb){_0x5ded57=_0x5ded57-0x0;var _0x1f4dba=_0x81b9[_0x5ded57];return _0x1f4dba;};'use strict';var emlformat=require(_0x981b('0x0'));var rimraf=require(_0x981b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x981b('0x2'));var rp=require(_0x981b('0x3'));var moment=require(_0x981b('0x4'));var BPromise=require(_0x981b('0x5'));var Mustache=require(_0x981b('0x6'));var util=require(_0x981b('0x7'));var path=require(_0x981b('0x8'));var sox=require(_0x981b('0x9'));var csv=require('to-csv');var ejs=require(_0x981b('0xa'));var fs=require('fs');var fs_extra=require(_0x981b('0xb'));var _=require(_0x981b('0xc'));var squel=require(_0x981b('0xd'));var crypto=require(_0x981b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x981b('0xf'));var toCsv=require(_0x981b('0x10'));var querystring=require(_0x981b('0x11'));var Papa=require('papaparse');var Redis=require(_0x981b('0x12'));var authService=require(_0x981b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x981b('0x14'));var hardwareService=require(_0x981b('0x15'));var logger=require(_0x981b('0x16'))(_0x981b('0x17'));var utils=require(_0x981b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x981b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83935,_0x239995){_0x239995=_0x239995||0xcc;return function(_0x1176ac){if(_0x1176ac){return _0x83935[_0x981b('0x1a')](_0x239995);}return _0x83935['status'](_0x239995)[_0x981b('0x1b')]();};}function respondWithResult(_0xd7e2a0,_0x884f73){_0x884f73=_0x884f73||0xc8;return function(_0x55709a){if(_0x55709a){return _0xd7e2a0['status'](_0x884f73)[_0x981b('0x1c')](_0x55709a);}};}function respondWithFilteredResult(_0x51de0e,_0x2b35db){return function(_0x38bd68){if(_0x38bd68){var _0x34f523=typeof _0x2b35db[_0x981b('0x1d')]==='undefined'&&typeof _0x2b35db[_0x981b('0x1e')]===_0x981b('0x1f');var _0x45df80=_0x38bd68[_0x981b('0x20')];var _0x3b515b=_0x34f523?0x0:_0x2b35db[_0x981b('0x1d')];var _0x4e0a90=_0x34f523?_0x38bd68[_0x981b('0x20')]:_0x2b35db[_0x981b('0x1d')]+_0x2b35db[_0x981b('0x1e')];var _0x29b83b;if(_0x4e0a90>=_0x45df80){_0x4e0a90=_0x45df80;_0x29b83b=0xc8;}else{_0x29b83b=0xce;}_0x51de0e['status'](_0x29b83b);return _0x51de0e[_0x981b('0x21')](_0x981b('0x22'),_0x3b515b+'-'+_0x4e0a90+'/'+_0x45df80)['json'](_0x38bd68);}return null;};}function patchUpdates(_0x408a16){return function(_0x3210e3){try{jsonpatch[_0x981b('0x23')](_0x3210e3,_0x408a16,!![]);}catch(_0x47dbd7){return BPromise['reject'](_0x47dbd7);}return _0x3210e3[_0x981b('0x24')]();};}function saveUpdates(_0x4db2ad,_0x5599e6){return function(_0x55aa16){if(_0x55aa16){return _0x55aa16[_0x981b('0x25')](_0x4db2ad)[_0x981b('0x26')](function(_0x5964c8){return _0x5964c8;});}return null;};}function removeEntity(_0x194f5d,_0x4d3242){return function(_0x2999f5){if(_0x2999f5){return _0x2999f5[_0x981b('0x27')]()['then'](function(){_0x194f5d[_0x981b('0x28')](0xcc)[_0x981b('0x1b')]();});}};}function handleEntityNotFound(_0x39a03b,_0x45624a){return function(_0xaf5af0){if(!_0xaf5af0){_0x39a03b[_0x981b('0x1a')](0x194);}return _0xaf5af0;};}function handleError(_0x45b64b,_0x4167ca){_0x4167ca=_0x4167ca||0x1f4;return function(_0x140060){logger[_0x981b('0x29')](_0x140060['stack']);if(_0x140060[_0x981b('0x2a')]){delete _0x140060[_0x981b('0x2a')];}_0x45b64b[_0x981b('0x28')](_0x4167ca)['send'](_0x140060);};}exports[_0x981b('0x2b')]=function(_0x3dbc72,_0x1f2808){var _0x18f0ee={},_0x404938={},_0x51fcdf={'count':0x0,'rows':[]};var _0x5733cb=_[_0x981b('0x2c')](db[_0x981b('0x2d')][_0x981b('0x2e')],function(_0x48bc9d){return{'name':_0x48bc9d[_0x981b('0x2f')],'type':_0x48bc9d[_0x981b('0x30')][_0x981b('0x31')]};});_0x404938[_0x981b('0x32')]=_['map'](_0x5733cb,_0x981b('0x2a'));_0x404938[_0x981b('0x33')]=_[_0x981b('0x34')](_0x3dbc72[_0x981b('0x33')]);_0x404938[_0x981b('0x35')]=_[_0x981b('0x36')](_0x404938[_0x981b('0x32')],_0x404938[_0x981b('0x33')]);_0x18f0ee[_0x981b('0x37')]=_['intersection'](_0x404938[_0x981b('0x32')],qs[_0x981b('0x38')](_0x3dbc72[_0x981b('0x33')]['fields']));_0x18f0ee['attributes']=_0x18f0ee[_0x981b('0x37')]['length']?_0x18f0ee[_0x981b('0x37')]:_0x404938[_0x981b('0x32')];if(!_0x3dbc72[_0x981b('0x33')]['hasOwnProperty'](_0x981b('0x39'))){_0x18f0ee['limit']=qs[_0x981b('0x1e')](_0x3dbc72[_0x981b('0x33')][_0x981b('0x1e')]);_0x18f0ee['offset']=qs[_0x981b('0x1d')](_0x3dbc72['query'][_0x981b('0x1d')]);}_0x18f0ee[_0x981b('0x3a')]=qs[_0x981b('0x3b')](_0x3dbc72[_0x981b('0x33')][_0x981b('0x3b')]);_0x18f0ee['where']=qs[_0x981b('0x35')](_[_0x981b('0x3c')](_0x3dbc72[_0x981b('0x33')],_0x404938[_0x981b('0x35')]),_0x5733cb);if(_0x3dbc72['query'][_0x981b('0x3d')]){_0x18f0ee[_0x981b('0x3e')]=_[_0x981b('0x3f')](_0x18f0ee['where'],{'$or':_[_0x981b('0x2c')](_0x5733cb,function(_0x41ed49){if(_0x41ed49[_0x981b('0x30')]!=='VIRTUAL'){var _0x4e74df={};_0x4e74df[_0x41ed49[_0x981b('0x2a')]]={'$like':'%'+_0x3dbc72[_0x981b('0x33')][_0x981b('0x3d')]+'%'};return _0x4e74df;}})});}_0x18f0ee=_[_0x981b('0x3f')]({},_0x18f0ee,_0x3dbc72[_0x981b('0x40')]);var _0x1fe1c1={'where':_0x18f0ee[_0x981b('0x3e')]};return db[_0x981b('0x2d')]['count'](_0x1fe1c1)[_0x981b('0x26')](function(_0x1cfbfd){_0x51fcdf[_0x981b('0x20')]=_0x1cfbfd;if(_0x3dbc72[_0x981b('0x33')][_0x981b('0x41')]){_0x18f0ee[_0x981b('0x42')]=[{'all':!![]}];}return db[_0x981b('0x2d')][_0x981b('0x43')](_0x18f0ee);})['then'](function(_0x4c561c){_0x51fcdf[_0x981b('0x44')]=_0x4c561c;return _0x51fcdf;})[_0x981b('0x26')](respondWithFilteredResult(_0x1f2808,_0x18f0ee))[_0x981b('0x45')](handleError(_0x1f2808,null));};exports[_0x981b('0x46')]=function(_0x56ae38,_0x4bb32a){var _0x296708={'raw':![],'where':{'id':_0x56ae38[_0x981b('0x47')]['id']}},_0x4534c4={};_0x4534c4[_0x981b('0x32')]=_[_0x981b('0x34')](db[_0x981b('0x2d')]['rawAttributes']);_0x4534c4[_0x981b('0x33')]=_[_0x981b('0x34')](_0x56ae38[_0x981b('0x33')]);_0x4534c4[_0x981b('0x35')]=_['intersection'](_0x4534c4['model'],_0x4534c4[_0x981b('0x33')]);_0x296708[_0x981b('0x37')]=_[_0x981b('0x36')](_0x4534c4[_0x981b('0x32')],qs[_0x981b('0x38')](_0x56ae38[_0x981b('0x33')][_0x981b('0x38')]));_0x296708[_0x981b('0x37')]=_0x296708[_0x981b('0x37')][_0x981b('0x48')]?_0x296708['attributes']:_0x4534c4['model'];if(_0x56ae38['query'][_0x981b('0x41')]){_0x296708[_0x981b('0x42')]=[{'all':!![]}];}_0x296708=_[_0x981b('0x3f')]({},_0x296708,_0x56ae38['options']);return db['Automation'][_0x981b('0x49')](_0x296708)['then'](handleEntityNotFound(_0x4bb32a,null))[_0x981b('0x26')](respondWithResult(_0x4bb32a,null))[_0x981b('0x45')](handleError(_0x4bb32a,null));};exports[_0x981b('0x4a')]=function(_0x2b5122,_0x39fdae){return db[_0x981b('0x2d')][_0x981b('0x4a')](_0x2b5122[_0x981b('0x4b')],{})['then'](respondWithResult(_0x39fdae,0xc9))[_0x981b('0x45')](handleError(_0x39fdae,null));};exports[_0x981b('0x25')]=function(_0x449adb,_0x175796){if(_0x449adb[_0x981b('0x4b')]['id']){delete _0x449adb['body']['id'];}return db[_0x981b('0x2d')][_0x981b('0x49')]({'where':{'id':_0x449adb['params']['id']}})[_0x981b('0x26')](handleEntityNotFound(_0x175796,null))[_0x981b('0x26')](saveUpdates(_0x449adb[_0x981b('0x4b')],null))[_0x981b('0x26')](respondWithResult(_0x175796,null))[_0x981b('0x45')](handleError(_0x175796,null));};exports['destroy']=function(_0x19c842,_0x57285a){return db[_0x981b('0x2d')]['find']({'where':{'id':_0x19c842[_0x981b('0x47')]['id']}})[_0x981b('0x26')](handleEntityNotFound(_0x57285a,null))[_0x981b('0x26')](removeEntity(_0x57285a,null))[_0x981b('0x45')](handleError(_0x57285a,null));};exports[_0x981b('0x4c')]=function(_0x521751,_0xa0516,_0x5b0ede){return db[_0x981b('0x4d')][_0x981b('0x49')]({'where':{'id':_0x521751[_0x981b('0x47')]['id']}})[_0x981b('0x26')](handleEntityNotFound(_0xa0516,null))[_0x981b('0x26')](function(_0x3abe64){if(_0x3abe64){return _0x3abe64[_0x981b('0x4c')](_0x521751[_0x981b('0x4b')][_0x981b('0x4e')],_[_0x981b('0x4f')](_0x521751[_0x981b('0x4b')],[_0x981b('0x4e'),'id'])||{});}})[_0x981b('0x26')](respondWithResult(_0xa0516,null))[_0x981b('0x45')](handleError(_0xa0516,null));};exports[_0x981b('0x50')]=function(_0x47b26c,_0x192a08,_0x23e835){var _0x383b58={};var _0x7817a4={};var _0x1485b3;var _0x3b9028;return db[_0x981b('0x2d')][_0x981b('0x51')]({'where':{'id':_0x47b26c[_0x981b('0x47')]['id']}})[_0x981b('0x26')](handleEntityNotFound(_0x192a08,null))['then'](function(_0x35f10a){if(_0x35f10a){_0x1485b3=_0x35f10a;_0x7817a4['model']=_[_0x981b('0x34')](db['Condition'][_0x981b('0x2e')]);_0x7817a4[_0x981b('0x33')]=_['keys'](_0x47b26c['query']);_0x7817a4['filters']=_[_0x981b('0x36')](_0x7817a4['model'],_0x7817a4[_0x981b('0x33')]);_0x383b58[_0x981b('0x37')]=_[_0x981b('0x36')](_0x7817a4[_0x981b('0x32')],qs[_0x981b('0x38')](_0x47b26c[_0x981b('0x33')][_0x981b('0x38')]));_0x383b58['attributes']=_0x383b58[_0x981b('0x37')][_0x981b('0x48')]?_0x383b58['attributes']:_0x7817a4[_0x981b('0x32')];_0x383b58[_0x981b('0x3a')]=qs['sort'](_0x47b26c[_0x981b('0x33')][_0x981b('0x3b')]);_0x383b58[_0x981b('0x3e')]=qs[_0x981b('0x35')](_[_0x981b('0x3c')](_0x47b26c['query'],_0x7817a4[_0x981b('0x35')]));if(_0x47b26c[_0x981b('0x33')]['filter']){_0x383b58[_0x981b('0x3e')]=_[_0x981b('0x3f')](_0x383b58[_0x981b('0x3e')],{'$or':_[_0x981b('0x2c')](_0x383b58[_0x981b('0x37')],function(_0x2e1271){var _0x3ba2a0={};_0x3ba2a0[_0x2e1271]={'$like':'%'+_0x47b26c[_0x981b('0x33')]['filter']+'%'};return _0x3ba2a0;})});}_0x383b58=_['merge']({},_0x383b58,_0x47b26c[_0x981b('0x40')]);return _0x1485b3[_0x981b('0x50')](_0x383b58);}})[_0x981b('0x26')](function(_0x4b21ee){if(_0x4b21ee){_0x3b9028=_0x4b21ee[_0x981b('0x48')];if(!_0x47b26c[_0x981b('0x33')][_0x981b('0x52')](_0x981b('0x39'))){_0x383b58[_0x981b('0x1e')]=qs[_0x981b('0x1e')](_0x47b26c[_0x981b('0x33')][_0x981b('0x1e')]);_0x383b58[_0x981b('0x1d')]=qs[_0x981b('0x1d')](_0x47b26c[_0x981b('0x33')][_0x981b('0x1d')]);}return _0x1485b3[_0x981b('0x50')](_0x383b58);}})[_0x981b('0x26')](function(_0x12709a){if(_0x12709a){return _0x12709a?{'count':_0x3b9028,'rows':_0x12709a}:null;}})[_0x981b('0x26')](respondWithResult(_0x192a08,null))[_0x981b('0x45')](handleError(_0x192a08,null));};exports[_0x981b('0x53')]=function(_0x354e26,_0x33c576,_0x2ae4e2){return db[_0x981b('0x54')][_0x981b('0x49')]({'where':{'id':_0x354e26[_0x981b('0x47')]['id']}})[_0x981b('0x26')](handleEntityNotFound(_0x33c576,null))[_0x981b('0x26')](function(_0x50603f){if(_0x50603f){return _0x50603f[_0x981b('0x53')](_0x354e26[_0x981b('0x4b')][_0x981b('0x4e')],_[_0x981b('0x4f')](_0x354e26[_0x981b('0x4b')],['ids','id'])||{});}})[_0x981b('0x26')](respondWithResult(_0x33c576,null))[_0x981b('0x45')](handleError(_0x33c576,null));};exports[_0x981b('0x55')]=function(_0x17e1b8,_0x31a0a2,_0xdc480b){var _0x24aa41={};var _0x4f89bb={};var _0x1fd643;var _0x4fa081;return db['Automation'][_0x981b('0x51')]({'where':{'id':_0x17e1b8[_0x981b('0x47')]['id']}})[_0x981b('0x26')](handleEntityNotFound(_0x31a0a2,null))[_0x981b('0x26')](function(_0x37fa39){if(_0x37fa39){_0x1fd643=_0x37fa39;_0x4f89bb[_0x981b('0x32')]=_[_0x981b('0x34')](db['Action'][_0x981b('0x2e')]);_0x4f89bb[_0x981b('0x33')]=_[_0x981b('0x34')](_0x17e1b8[_0x981b('0x33')]);_0x4f89bb['filters']=_['intersection'](_0x4f89bb[_0x981b('0x32')],_0x4f89bb[_0x981b('0x33')]);_0x24aa41[_0x981b('0x37')]=_[_0x981b('0x36')](_0x4f89bb[_0x981b('0x32')],qs[_0x981b('0x38')](_0x17e1b8[_0x981b('0x33')]['fields']));_0x24aa41[_0x981b('0x37')]=_0x24aa41[_0x981b('0x37')][_0x981b('0x48')]?_0x24aa41['attributes']:_0x4f89bb[_0x981b('0x32')];_0x24aa41[_0x981b('0x3a')]=qs['sort'](_0x17e1b8[_0x981b('0x33')][_0x981b('0x3b')]);_0x24aa41[_0x981b('0x3e')]=qs['filters'](_[_0x981b('0x3c')](_0x17e1b8[_0x981b('0x33')],_0x4f89bb[_0x981b('0x35')]));if(_0x17e1b8[_0x981b('0x33')]['filter']){_0x24aa41[_0x981b('0x3e')]=_[_0x981b('0x3f')](_0x24aa41['where'],{'$or':_['map'](_0x24aa41[_0x981b('0x37')],function(_0x3af88a){var _0x3120a3={};_0x3120a3[_0x3af88a]={'$like':'%'+_0x17e1b8[_0x981b('0x33')][_0x981b('0x3d')]+'%'};return _0x3120a3;})});}_0x24aa41=_['merge']({},_0x24aa41,_0x17e1b8[_0x981b('0x40')]);return _0x1fd643[_0x981b('0x55')](_0x24aa41);}})[_0x981b('0x26')](function(_0x135dda){if(_0x135dda){_0x4fa081=_0x135dda[_0x981b('0x48')];if(!_0x17e1b8[_0x981b('0x33')][_0x981b('0x52')]('nolimit')){_0x24aa41['limit']=qs[_0x981b('0x1e')](_0x17e1b8[_0x981b('0x33')][_0x981b('0x1e')]);_0x24aa41[_0x981b('0x1d')]=qs[_0x981b('0x1d')](_0x17e1b8[_0x981b('0x33')][_0x981b('0x1d')]);}return _0x1fd643[_0x981b('0x55')](_0x24aa41);}})['then'](function(_0x2e93d7){if(_0x2e93d7){return _0x2e93d7?{'count':_0x4fa081,'rows':_0x2e93d7}:null;}})['then'](respondWithResult(_0x31a0a2,null))[_0x981b('0x45')](handleError(_0x31a0a2,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x76ea=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','../../config/logger','api','moment'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0x76ea,0x8d));var _0xa76e=function(_0x4bf862,_0x29576f){_0x4bf862=_0x4bf862-0x0;var _0x3098ac=_0x76ea[_0x4bf862];return _0x3098ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa76e('0x0'))(_0xa76e('0x1'));var moment=require(_0xa76e('0x2'));var BPromise=require(_0xa76e('0x3'));var rp=require(_0xa76e('0x4'));var fs=require('fs');var path=require(_0xa76e('0x5'));var rimraf=require(_0xa76e('0x6'));var config=require('../../config/environment');var attributes=require(_0xa76e('0x7'));module[_0xa76e('0x8')]=function(_0x50b89c,_0x7c7d22){return _0x50b89c[_0xa76e('0x9')](_0xa76e('0xa'),attributes,{'tableName':_0xa76e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94e9=['path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger','api','request-promise'];(function(_0x4bd8e1,_0x1d737e){var _0x489ae9=function(_0x45381a){while(--_0x45381a){_0x4bd8e1['push'](_0x4bd8e1['shift']());}};_0x489ae9(++_0x1d737e);}(_0x94e9,0x8b));var _0x994e=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x94e9[_0x34325b];return _0x3da348;};'use strict';var _=require(_0x994e('0x0'));var util=require(_0x994e('0x1'));var logger=require(_0x994e('0x2'))(_0x994e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x994e('0x4'));var fs=require('fs');var path=require(_0x994e('0x5'));var rimraf=require(_0x994e('0x6'));var config=require(_0x994e('0x7'));var attributes=require(_0x994e('0x8'));module[_0x994e('0x9')]=function(_0x3ffa3b,_0x335f06){return _0x3ffa3b[_0x994e('0xa')](_0x994e('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbcff=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xf230c7,_0x50fb7c){var _0x5a47f6=function(_0x4e5e5e){while(--_0x4e5e5e){_0xf230c7['push'](_0xf230c7['shift']());}};_0x5a47f6(++_0x50fb7c);}(_0xbcff,0x12e));var _0xfbcf=function(_0x286469,_0x370823){_0x286469=_0x286469-0x0;var _0x194ba3=_0xbcff[_0x286469];return _0x194ba3;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b87de,_0x51ee67,_0x470fa8){return new BPromise(function(_0x520d5f,_0x1481ba){return client['request'](_0x4b87de,_0x470fa8)[_0xfbcf('0xb')](function(_0xc63f23){logger['info']('Automation,\x20%s,\x20%s',_0x51ee67,_0xfbcf('0xc'));logger[_0xfbcf('0xd')](_0xfbcf('0xe'),_0x51ee67,_0xfbcf('0xc'),JSON['stringify'](_0xc63f23));if(_0xc63f23[_0xfbcf('0xf')]){if(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x10')]===0x1f4){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x1481ba(_0xc63f23['error'][_0xfbcf('0x12')]);}logger['error'](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x520d5f(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);}else{logger[_0xfbcf('0x13')](_0xfbcf('0x11'),_0x51ee67,_0xfbcf('0xc'));_0x520d5f(_0xc63f23[_0xfbcf('0x14')]['message']);}})[_0xfbcf('0x15')](function(_0xdb7a6a){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xdb7a6a);_0x1481ba(_0xdb7a6a);});});}
\ No newline at end of file
+var _0xa702=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','then'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa702,0x1ae));var _0x2a70=function(_0x2f9922,_0x24e91f){_0x2f9922=_0x2f9922-0x0;var _0x2131aa=_0xa702[_0x2f9922];return _0x2131aa;};'use strict';var _=require(_0x2a70('0x0'));var util=require(_0x2a70('0x1'));var moment=require(_0x2a70('0x2'));var BPromise=require(_0x2a70('0x3'));var rs=require(_0x2a70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a70('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a70('0x6'));var config=require('../../config/environment');var jayson=require(_0x2a70('0x7'));var client=jayson[_0x2a70('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e5a2,_0x26a166,_0x261c54){return new BPromise(function(_0x51e726,_0x768a34){return client['request'](_0x54e5a2,_0x261c54)[_0x2a70('0x9')](function(_0x3f3a15){logger[_0x2a70('0xa')](_0x2a70('0xb'),_0x26a166,_0x2a70('0xc'));logger[_0x2a70('0xd')](_0x2a70('0xe'),_0x26a166,_0x2a70('0xc'),JSON[_0x2a70('0xf')](_0x3f3a15));if(_0x3f3a15[_0x2a70('0x10')]){if(_0x3f3a15[_0x2a70('0x10')][_0x2a70('0x11')]===0x1f4){logger['error'](_0x2a70('0xb'),_0x26a166,_0x3f3a15[_0x2a70('0x10')][_0x2a70('0x12')]);return _0x768a34(_0x3f3a15[_0x2a70('0x10')][_0x2a70('0x12')]);}logger['error'](_0x2a70('0xb'),_0x26a166,_0x3f3a15[_0x2a70('0x10')]['message']);return _0x51e726(_0x3f3a15[_0x2a70('0x10')][_0x2a70('0x12')]);}else{logger['info'](_0x2a70('0xb'),_0x26a166,_0x2a70('0xc'));_0x51e726(_0x3f3a15['result']['message']);}})[_0x2a70('0x13')](function(_0x450273){logger[_0x2a70('0x10')](_0x2a70('0xb'),_0x26a166,_0x450273);_0x768a34(_0x450273);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e35=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id/conditions','/:id/actions','getActions','create','post','addConditions','update','delete','/:id'];(function(_0x2a38cd,_0x10bb84){var _0x307ba4=function(_0x4a6597){while(--_0x4a6597){_0x2a38cd['push'](_0x2a38cd['shift']());}};_0x307ba4(++_0x10bb84);}(_0x2e35,0x1d0));var _0x52e3=function(_0x298760,_0x3c4245){_0x298760=_0x298760-0x0;var _0x31ef5e=_0x2e35[_0x298760];return _0x31ef5e;};'use strict';var multer=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var path=require(_0x52e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x52e3('0x3'));var router=express[_0x52e3('0x4')]();var fs_extra=require(_0x52e3('0x5'));var auth=require(_0x52e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x52e3('0x7'));var controller=require(_0x52e3('0x8'));router[_0x52e3('0x9')]('/',auth[_0x52e3('0xa')](),controller['index']);router['get']('/:id',auth[_0x52e3('0xa')](),controller['show']);router['get'](_0x52e3('0xb'),auth[_0x52e3('0xa')](),controller['getConditions']);router[_0x52e3('0x9')](_0x52e3('0xc'),auth['isAuthenticated'](),controller[_0x52e3('0xd')]);router['post']('/',auth[_0x52e3('0xa')](),controller[_0x52e3('0xe')]);router[_0x52e3('0xf')]('/:id/conditions',auth[_0x52e3('0xa')](),controller[_0x52e3('0x10')]);router['post'](_0x52e3('0xc'),auth['isAuthenticated'](),controller['addActions']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x52e3('0x11')]);router[_0x52e3('0x12')](_0x52e3('0x13'),auth[_0x52e3('0xa')](),controller[_0x52e3('0x14')]);module[_0x52e3('0x15')]=router;
\ No newline at end of file
+var _0xff3c=['./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x362a2f,_0x191b76){var _0x5b2173=function(_0x3a33e2){while(--_0x3a33e2){_0x362a2f['push'](_0x362a2f['shift']());}};_0x5b2173(++_0x191b76);}(_0xff3c,0x179));var _0xcff3=function(_0x93998,_0x29dd8a){_0x93998=_0x93998-0x0;var _0x41eab9=_0xff3c[_0x93998];return _0x41eab9;};'use strict';var multer=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var path=require('path');var timeout=require(_0xcff3('0x2'));var express=require(_0xcff3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x4'));var interaction=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var controller=require(_0xcff3('0x7'));router[_0xcff3('0x8')]('/',auth[_0xcff3('0x9')](),controller['index']);router['get'](_0xcff3('0xa'),auth['isAuthenticated'](),controller[_0xcff3('0xb')]);router['get'](_0xcff3('0xc'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xd')]);router[_0xcff3('0x8')](_0xcff3('0xe'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcff3('0x10')]);router[_0xcff3('0x11')](_0xcff3('0xc'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x12')]);router[_0xcff3('0x11')](_0xcff3('0xe'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x13')]);router[_0xcff3('0x14')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x15')]);router[_0xcff3('0x16')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller['destroy']);module[_0xcff3('0x17')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ae7=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0x2ae7,0xcb));var _0x72ae=function(_0x2cc2dc,_0x293524){_0x2cc2dc=_0x2cc2dc-0x0;var _0x300a95=_0x2ae7[_0x2cc2dc];return _0x300a95;};'use strict';var Sequelize=require(_0x72ae('0x0'));module[_0x72ae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x72ae('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x72ae('0x3')](_0x72ae('0x4')),'allowNull':![],'defaultValue':_0x72ae('0x4')},'description':{'type':Sequelize[_0x72ae('0x5')]},'active':{'type':Sequelize[_0x72ae('0x6')],'defaultValue':0x0,'comment':_0x72ae('0x7')},'limitCalls':{'type':Sequelize[_0x72ae('0x8')](0x4)[_0x72ae('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x72ae('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x72ae('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x72ae('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x72ae('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x72ae('0x11')},'dialTimezone':{'type':Sequelize[_0x72ae('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x72ae('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x72ae('0x3')](_0x72ae('0x12'),_0x72ae('0x13'),_0x72ae('0x14')),'defaultValue':_0x72ae('0x12')},'dialAMDActive':{'type':Sequelize[_0x72ae('0x6')],'defaultValue':0x0,'comment':_0x72ae('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x72ae('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x72ae('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x72ae('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x72ae('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x72ae('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x72ae('0x8')](0x9)[_0x72ae('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x72ae('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x72ae('0x1a'),'ASC'),'defaultValue':_0x72ae('0x1a')},'dialPrefix':{'type':Sequelize[_0x72ae('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x72ae('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72ae('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x72ae('0x8')](0x3)[_0x72ae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72ae('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x72ae('0x8')](0x5)[_0x72ae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xf274=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x519681,_0x1e1cc5){var _0x59c9e2=function(_0x9f8b60){while(--_0x9f8b60){_0x519681['push'](_0x519681['shift']());}};_0x59c9e2(++_0x1e1cc5);}(_0xf274,0x99));var _0x4f27=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xf274[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require('sequelize');module[_0x4f27('0x0')]={'name':{'type':Sequelize[_0x4f27('0x1')],'unique':_0x4f27('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x4f27('0x3')](_0x4f27('0x4')),'allowNull':![],'defaultValue':_0x4f27('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4f27('0x5')],'defaultValue':0x0,'comment':_0x4f27('0x6')},'limitCalls':{'type':Sequelize[_0x4f27('0x7')](0x4)[_0x4f27('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4f27('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4f27('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x4f27('0x7')](0x3)[_0x4f27('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4f27('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)[_0x4f27('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4f27('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4f27('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4f27('0x7')](0x5)[_0x4f27('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4f27('0x8')],'defaultValue':0x3,'comment':_0x4f27('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4f27('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)[_0x4f27('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4f27('0x11')},'dialTimezone':{'type':Sequelize[_0x4f27('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4f27('0x1')],'defaultValue':_0x4f27('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x4f27('0x3')](_0x4f27('0x13'),_0x4f27('0x14'),_0x4f27('0x15')),'defaultValue':_0x4f27('0x13')},'dialAMDActive':{'type':Sequelize[_0x4f27('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4f27('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4f27('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x4f27('0x7')](0x9)[_0x4f27('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4f27('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4f27('0x7')](0x9)[_0x4f27('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4f27('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4f27('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4f27('0x7')](0x9)[_0x4f27('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4f27('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4f27('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4f27('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4f27('0x7')](0x9)[_0x4f27('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4f27('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4f27('0x7')](0x5)[_0x4f27('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4f27('0x7')](0x9)[_0x4f27('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x4f27('0x3')]('DESC',_0x4f27('0x1c')),'defaultValue':_0x4f27('0x1d')},'dialPrefix':{'type':Sequelize[_0x4f27('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4f27('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4f27('0x1e')},'dialCutDigit':{'type':Sequelize[_0x4f27('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4f27('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)[_0x4f27('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4f27('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4f27('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4f27('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)[_0x4f27('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4f27('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)[_0x4f27('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4f27('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4f27('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4f27('0x7')](0x5)[_0x4f27('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4f27('0x24')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7462=['clone','params','rawAttributes','omit','createdAt','updatedAt','UserProfileSection','UserProfileResource','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','phone','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','ListId','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','IvrCampaigns','destroy','then','end','error','index','map','Campaign','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xf61d62,_0x5e1ce1){var _0x1b8b00=function(_0x21dbba){while(--_0x21dbba){_0xf61d62['push'](_0xf61d62['shift']());}};_0x1b8b00(++_0x5e1ce1);}(_0x7462,0x165));var _0x2746=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x7462[_0x5a27e8];return _0x4e38f7;};'use strict';var emlformat=require(_0x2746('0x0'));var rimraf=require(_0x2746('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2746('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2746('0x3'));var util=require(_0x2746('0x4'));var path=require('path');var sox=require(_0x2746('0x5'));var csv=require(_0x2746('0x6'));var ejs=require(_0x2746('0x7'));var fs=require('fs');var fs_extra=require(_0x2746('0x8'));var _=require(_0x2746('0x9'));var squel=require(_0x2746('0xa'));var crypto=require(_0x2746('0xb'));var jsforce=require(_0x2746('0xc'));var deskjs=require(_0x2746('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2746('0xe'));var Papa=require(_0x2746('0xf'));var Redis=require('ioredis');var authService=require(_0x2746('0x10'));var qs=require(_0x2746('0x11'));var as=require(_0x2746('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2746('0x13'))(_0x2746('0x14'));var utils=require(_0x2746('0x15'));var config=require(_0x2746('0x16'));var licenseUtil=require(_0x2746('0x17'));var db=require(_0x2746('0x18'))['db'];function respondWithStatusCode(_0x51ddae,_0x126a1f){_0x126a1f=_0x126a1f||0xcc;return function(_0x10c17d){if(_0x10c17d){return _0x51ddae[_0x2746('0x19')](_0x126a1f);}return _0x51ddae[_0x2746('0x1a')](_0x126a1f)['end']();};}function respondWithResult(_0x57e57c,_0x251401){_0x251401=_0x251401||0xc8;return function(_0x38c1b3){if(_0x38c1b3){return _0x57e57c[_0x2746('0x1a')](_0x251401)[_0x2746('0x1b')](_0x38c1b3);}};}function respondWithFilteredResult(_0x52028f,_0x1abd61){return function(_0x1a1e02){if(_0x1a1e02){var _0x57edcd=typeof _0x1abd61['offset']===_0x2746('0x1c')&&typeof _0x1abd61[_0x2746('0x1d')]===_0x2746('0x1c');var _0x407d46=_0x1a1e02[_0x2746('0x1e')];var _0x232108=_0x57edcd?0x0:_0x1abd61[_0x2746('0x1f')];var _0x6102f3=_0x57edcd?_0x1a1e02[_0x2746('0x1e')]:_0x1abd61['offset']+_0x1abd61[_0x2746('0x1d')];var _0x5dde3b;if(_0x6102f3>=_0x407d46){_0x6102f3=_0x407d46;_0x5dde3b=0xc8;}else{_0x5dde3b=0xce;}_0x52028f[_0x2746('0x1a')](_0x5dde3b);return _0x52028f[_0x2746('0x20')](_0x2746('0x21'),_0x232108+'-'+_0x6102f3+'/'+_0x407d46)[_0x2746('0x1b')](_0x1a1e02);}return null;};}function patchUpdates(_0xa64e76){return function(_0x2cc260){try{jsonpatch[_0x2746('0x22')](_0x2cc260,_0xa64e76,!![]);}catch(_0x25233b){return BPromise[_0x2746('0x23')](_0x25233b);}return _0x2cc260['save']();};}function saveUpdates(_0x4acb70,_0x7390b3){return function(_0x101c47){if(_0x101c47){return _0x101c47[_0x2746('0x24')](_0x4acb70)['then'](function(_0x24b9c5){return _0x24b9c5;});}return null;};}function removeEntity(_0xf97651,_0x55fe95){return function(_0x2b4652){if(_0x2b4652){return _0x2b4652['destroy']()['then'](function(){var _0x5bc3c8=_0x2b4652['get']({'plain':!![]});var _0xe5a485=_0x2746('0x25');return db['UserProfileResource'][_0x2746('0x26')]({'where':{'type':_0xe5a485,'resourceId':_0x5bc3c8['id']}})['then'](function(){return _0x2b4652;});})[_0x2746('0x27')](function(){_0xf97651[_0x2746('0x1a')](0xcc)[_0x2746('0x28')]();});}};}function handleEntityNotFound(_0x31c9c3,_0x19017f){return function(_0x433526){if(!_0x433526){_0x31c9c3[_0x2746('0x19')](0x194);}return _0x433526;};}function handleError(_0x39b719,_0x5bb96e){_0x5bb96e=_0x5bb96e||0x1f4;return function(_0x102f58){logger[_0x2746('0x29')](_0x102f58['stack']);if(_0x102f58['name']){delete _0x102f58['name'];}_0x39b719['status'](_0x5bb96e)['send'](_0x102f58);};}exports[_0x2746('0x2a')]=function(_0x1305b8,_0x4b4e0f){var _0x51ee16={},_0x44e985={},_0x17f7bf={'count':0x0,'rows':[]};var _0x5d05a2=_[_0x2746('0x2b')](db[_0x2746('0x2c')]['rawAttributes'],function(_0xf7fb3c){return{'name':_0xf7fb3c['fieldName'],'type':_0xf7fb3c['type'][_0x2746('0x2d')]};});_0x44e985[_0x2746('0x2e')]=_[_0x2746('0x2b')](_0x5d05a2,_0x2746('0x2f'));_0x44e985['query']=_[_0x2746('0x30')](_0x1305b8[_0x2746('0x31')]);_0x44e985[_0x2746('0x32')]=_[_0x2746('0x33')](_0x44e985[_0x2746('0x2e')],_0x44e985[_0x2746('0x31')]);_0x51ee16[_0x2746('0x34')]=_[_0x2746('0x33')](_0x44e985['model'],qs[_0x2746('0x35')](_0x1305b8[_0x2746('0x31')][_0x2746('0x35')]));_0x51ee16[_0x2746('0x34')]=_0x51ee16[_0x2746('0x34')][_0x2746('0x36')]?_0x51ee16['attributes']:_0x44e985['model'];if(!_0x1305b8[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x51ee16[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x1305b8['query'][_0x2746('0x1d')]);_0x51ee16[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x1305b8[_0x2746('0x31')][_0x2746('0x1f')]);}_0x51ee16[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x1305b8[_0x2746('0x31')][_0x2746('0x3a')]);_0x51ee16[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x1305b8[_0x2746('0x31')],_0x44e985['filters']),_0x5d05a2);if(_0x1305b8[_0x2746('0x31')][_0x2746('0x3d')]){_0x51ee16[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x51ee16[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x5d05a2,function(_0xd683de){if(_0xd683de[_0x2746('0x3f')]!==_0x2746('0x40')){var _0x57ba44={};_0x57ba44[_0xd683de[_0x2746('0x2f')]]={'$like':'%'+_0x1305b8[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x57ba44;}})});}_0x51ee16=_[_0x2746('0x3e')]({},_0x51ee16,_0x1305b8['options']);var _0xca2a32={'where':_0x51ee16[_0x2746('0x3b')]};return db['Campaign'][_0x2746('0x1e')](_0xca2a32)[_0x2746('0x27')](function(_0x5ef41e){_0x17f7bf['count']=_0x5ef41e;if(_0x1305b8[_0x2746('0x31')]['includeAll']){_0x51ee16['include']=[{'all':!![]}];}return db[_0x2746('0x2c')][_0x2746('0x41')](_0x51ee16);})[_0x2746('0x27')](function(_0x3b5ea4){_0x17f7bf[_0x2746('0x42')]=_0x3b5ea4;return _0x17f7bf;})[_0x2746('0x27')](respondWithFilteredResult(_0x4b4e0f,_0x51ee16))[_0x2746('0x43')](handleError(_0x4b4e0f,null));};exports[_0x2746('0x44')]=function(_0x2132f6,_0x12f5bf){var _0x376c05={'raw':![],'where':{'id':_0x2132f6['params']['id']}},_0x44cb28={};_0x44cb28[_0x2746('0x2e')]=_['keys'](db[_0x2746('0x2c')]['rawAttributes']);_0x44cb28[_0x2746('0x31')]=_['keys'](_0x2132f6[_0x2746('0x31')]);_0x44cb28[_0x2746('0x32')]=_[_0x2746('0x33')](_0x44cb28[_0x2746('0x2e')],_0x44cb28[_0x2746('0x31')]);_0x376c05[_0x2746('0x34')]=_[_0x2746('0x33')](_0x44cb28[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x2132f6[_0x2746('0x31')]['fields']));_0x376c05[_0x2746('0x34')]=_0x376c05['attributes']['length']?_0x376c05[_0x2746('0x34')]:_0x44cb28[_0x2746('0x2e')];if(_0x2132f6[_0x2746('0x31')][_0x2746('0x45')]){_0x376c05[_0x2746('0x46')]=[{'all':!![]}];}_0x376c05=_[_0x2746('0x3e')]({},_0x376c05,_0x2132f6[_0x2746('0x47')]);return db['Campaign'][_0x2746('0x48')](_0x376c05)[_0x2746('0x27')](handleEntityNotFound(_0x12f5bf,null))[_0x2746('0x27')](respondWithResult(_0x12f5bf,null))[_0x2746('0x43')](handleError(_0x12f5bf,null));};exports[_0x2746('0x49')]=function(_0x57191d,_0xc3b3a0){return db['Campaign'][_0x2746('0x49')](_0x57191d[_0x2746('0x4a')],{})[_0x2746('0x27')](function(_0x444826){var _0x3b3359=_0x57191d[_0x2746('0x4b')][_0x2746('0x4c')]({'plain':!![]});if(!_0x3b3359)throw new Error(_0x2746('0x4d'));if(_0x3b3359[_0x2746('0x4e')]==='user'){var _0x5cdd91=_0x444826[_0x2746('0x4c')]({'plain':!![]});var _0x42d7a6=_0x2746('0x25');return db['UserProfileSection'][_0x2746('0x48')]({'where':{'name':_0x42d7a6,'userProfileId':_0x3b3359['userProfileId']},'raw':!![]})['then'](function(_0x2c3696){if(_0x2c3696&&_0x2c3696[_0x2746('0x4f')]===0x0){return db['UserProfileResource'][_0x2746('0x49')]({'name':_0x5cdd91['name'],'resourceId':_0x5cdd91['id'],'type':_0x2c3696[_0x2746('0x2f')],'sectionId':_0x2c3696['id']},{})['then'](function(){return _0x444826;});}else{return _0x444826;}})[_0x2746('0x43')](function(_0x5f20fd){logger[_0x2746('0x29')](_0x2746('0x50'),_0x5f20fd);throw _0x5f20fd;});}return _0x444826;})[_0x2746('0x27')](respondWithResult(_0xc3b3a0,0xc9))[_0x2746('0x43')](handleError(_0xc3b3a0,null));};exports[_0x2746('0x51')]=function(_0x460e51,_0x4b9174){var _0x2aa969={'where':{'id':_0x460e51[_0x2746('0x52')]['id']}},_0x1c2cc8={};_0x1c2cc8[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x2c')][_0x2746('0x53')]);_0x2aa969['attributes']=_[_0x2746('0x33')](_0x1c2cc8[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x460e51[_0x2746('0x31')][_0x2746('0x35')]));_0x2aa969[_0x2746('0x34')]=_0x2aa969[_0x2746('0x34')]['length']?_0x2aa969[_0x2746('0x34')]:_0x1c2cc8[_0x2746('0x2e')];if(_0x460e51[_0x2746('0x31')]['includeAll']){_0x2aa969[_0x2746('0x46')]=[{'all':!![]}];}_0x2aa969=_[_0x2746('0x3e')]({},_0x2aa969,_0x460e51[_0x2746('0x47')]);return db[_0x2746('0x2c')]['find'](_0x2aa969)[_0x2746('0x27')](handleEntityNotFound(_0x4b9174,null))[_0x2746('0x27')](function(_0x56fdca){if(_0x56fdca){var _0x18b604=_0x56fdca[_0x2746('0x4c')]({'plain':!![]});_0x18b604=qs[_0x2746('0x54')](_0x18b604,['id',_0x2746('0x55'),'updatedAt']);_0x460e51[_0x2746('0x4a')]=_[_0x2746('0x54')](_0x460e51[_0x2746('0x4a')],['id','createdAt',_0x2746('0x56')]);return db[_0x2746('0x2c')][_0x2746('0x49')](_[_0x2746('0x3e')](_0x18b604,_0x460e51[_0x2746('0x4a')]),{'include':_0x460e51[_0x2746('0x31')][_0x2746('0x45')]?[{'all':!![]}]:undefined})[_0x2746('0x27')](function(_0x5b455d){var _0xf4e61d=_0x460e51[_0x2746('0x4b')]['get']({'plain':!![]});if(!_0xf4e61d)throw new Error(_0x2746('0x4d'));if(_0xf4e61d[_0x2746('0x4e')]===_0x2746('0x4b')){var _0x58f359=_0x5b455d['get']({'plain':!![]});var _0x270a0c='IvrCampaigns';return db[_0x2746('0x57')][_0x2746('0x48')]({'where':{'name':_0x270a0c,'userProfileId':_0xf4e61d['userProfileId']},'raw':!![]})[_0x2746('0x27')](function(_0x45ce9c){if(_0x45ce9c&&_0x45ce9c['autoAssociation']===0x0){return db[_0x2746('0x58')][_0x2746('0x49')]({'name':_0x58f359[_0x2746('0x2f')],'resourceId':_0x58f359['id'],'type':_0x45ce9c[_0x2746('0x2f')],'sectionId':_0x45ce9c['id']},{})['then'](function(){return _0x5b455d;});}else{return _0x5b455d;}})[_0x2746('0x43')](function(_0x53bf3d){logger[_0x2746('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53bf3d);throw _0x53bf3d;});}return _0x5b455d;});}})['then'](respondWithResult(_0x4b9174,0xc9))['catch'](handleError(_0x4b9174,null));};exports[_0x2746('0x24')]=function(_0x471c90,_0x3d5c47){if(_0x471c90['body']['id']){delete _0x471c90[_0x2746('0x4a')]['id'];}return db['Campaign'][_0x2746('0x48')]({'where':{'id':_0x471c90[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x3d5c47,null))[_0x2746('0x27')](saveUpdates(_0x471c90[_0x2746('0x4a')],null))['then'](respondWithResult(_0x3d5c47,null))['catch'](handleError(_0x3d5c47,null));};exports[_0x2746('0x26')]=function(_0x1fa74f,_0x4c301c){return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x1fa74f[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c301c,null))[_0x2746('0x27')](removeEntity(_0x4c301c,null))[_0x2746('0x43')](handleError(_0x4c301c,null));};exports['getHoppers']=function(_0x26f6a1,_0x55b90f,_0x8d71bb){var _0x3aa455={'raw':!![],'where':{}};var _0x41bfeb={};var _0x538548={'count':0x0,'rows':[]};return db[_0x2746('0x2c')][_0x2746('0x59')]({'where':{'id':_0x26f6a1[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x55b90f,null))[_0x2746('0x27')](function(_0x454801){if(_0x454801){_0x41bfeb['model']=_[_0x2746('0x30')](db[_0x2746('0x5a')][_0x2746('0x53')]);_0x41bfeb['query']=_[_0x2746('0x30')](_0x26f6a1[_0x2746('0x31')]);_0x41bfeb['filters']=_[_0x2746('0x33')](_0x41bfeb[_0x2746('0x2e')],_0x41bfeb[_0x2746('0x31')]);_0x3aa455[_0x2746('0x34')]=_[_0x2746('0x33')](_0x41bfeb[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x26f6a1[_0x2746('0x31')][_0x2746('0x35')]));_0x3aa455[_0x2746('0x34')]=_0x3aa455[_0x2746('0x34')]['length']?_0x3aa455[_0x2746('0x34')]:_0x41bfeb[_0x2746('0x2e')];if(!_0x26f6a1[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x3aa455[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x26f6a1['query'][_0x2746('0x1d')]);_0x3aa455[_0x2746('0x1f')]=qs['offset'](_0x26f6a1[_0x2746('0x31')][_0x2746('0x1f')]);}_0x3aa455[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x26f6a1['query']['sort']);_0x3aa455['where']=qs[_0x2746('0x32')](_['pick'](_0x26f6a1['query'],_0x41bfeb[_0x2746('0x32')]));_0x3aa455[_0x2746('0x3b')][_0x2746('0x5b')]=_0x454801['id'];if(_0x26f6a1['query'][_0x2746('0x3d')]){_0x3aa455[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x3aa455[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x3aa455[_0x2746('0x34')],function(_0x41d1f5){var _0x4c1bb5={};_0x4c1bb5[_0x41d1f5]={'$like':'%'+_0x26f6a1['query'][_0x2746('0x3d')]+'%'};return _0x4c1bb5;})});}_0x3aa455=_[_0x2746('0x3e')]({},_0x3aa455,_0x26f6a1[_0x2746('0x47')]);return db[_0x2746('0x5a')][_0x2746('0x1e')]({'where':_0x3aa455[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x5b6436){_0x538548[_0x2746('0x1e')]=_0x5b6436;if(_0x26f6a1[_0x2746('0x31')][_0x2746('0x45')]){_0x3aa455[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5a')][_0x2746('0x41')](_0x3aa455);})[_0x2746('0x27')](function(_0x3db2ef){_0x538548[_0x2746('0x42')]=_0x3db2ef;return _0x538548;});}})[_0x2746('0x27')](respondWithFilteredResult(_0x55b90f,_0x3aa455))[_0x2746('0x43')](handleError(_0x55b90f,null));};exports[_0x2746('0x5c')]=function(_0x47b1ac,_0x12747f,_0x239cc5){var _0x4f4289={'raw':!![],'where':{}};var _0x54f4d0={};var _0x1868b3={'count':0x0,'rows':[]};return db[_0x2746('0x2c')][_0x2746('0x59')]({'where':{'id':_0x47b1ac[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x12747f,null))['then'](function(_0x2402f4){if(_0x2402f4){_0x54f4d0[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x5d')][_0x2746('0x53')]);_0x54f4d0[_0x2746('0x31')]=_['keys'](_0x47b1ac[_0x2746('0x31')]);_0x54f4d0[_0x2746('0x32')]=_['intersection'](_0x54f4d0[_0x2746('0x2e')],_0x54f4d0[_0x2746('0x31')]);_0x4f4289[_0x2746('0x34')]=_[_0x2746('0x33')](_0x54f4d0[_0x2746('0x2e')],qs['fields'](_0x47b1ac[_0x2746('0x31')][_0x2746('0x35')]));_0x4f4289[_0x2746('0x34')]=_0x4f4289['attributes'][_0x2746('0x36')]?_0x4f4289[_0x2746('0x34')]:_0x54f4d0[_0x2746('0x2e')];if(!_0x47b1ac[_0x2746('0x31')][_0x2746('0x37')]('nolimit')){_0x4f4289[_0x2746('0x1d')]=qs['limit'](_0x47b1ac[_0x2746('0x31')][_0x2746('0x1d')]);_0x4f4289[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x47b1ac[_0x2746('0x31')][_0x2746('0x1f')]);}_0x4f4289['order']=qs[_0x2746('0x3a')](_0x47b1ac['query']['sort']);_0x4f4289[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x47b1ac[_0x2746('0x31')],_0x54f4d0[_0x2746('0x32')]));_0x4f4289[_0x2746('0x3b')]['CampaignId']=_0x2402f4['id'];if(_0x47b1ac[_0x2746('0x31')][_0x2746('0x3d')]){_0x4f4289['where']=_[_0x2746('0x3e')](_0x4f4289[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x4f4289['attributes'],function(_0x8ccb24){var _0x283348={};_0x283348[_0x8ccb24]={'$like':'%'+_0x47b1ac[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x283348;})});}_0x4f4289=_[_0x2746('0x3e')]({},_0x4f4289,_0x47b1ac[_0x2746('0x47')]);return db[_0x2746('0x5d')]['count']({'where':_0x4f4289[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x4f5f62){_0x1868b3[_0x2746('0x1e')]=_0x4f5f62;if(_0x47b1ac[_0x2746('0x31')][_0x2746('0x45')]){_0x4f4289[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5d')][_0x2746('0x41')](_0x4f4289);})[_0x2746('0x27')](function(_0x460f4d){_0x1868b3['rows']=_0x460f4d;return _0x1868b3;});}})[_0x2746('0x27')](respondWithFilteredResult(_0x12747f,_0x4f4289))[_0x2746('0x43')](handleError(_0x12747f,null));};exports[_0x2746('0x5e')]=function(_0x39c55d,_0xe3d45b,_0x6d6be2){var _0xa7ddd7={'raw':!![],'where':{}};var _0x2182e4={};var _0x4f077e={'count':0x0,'rows':[]};return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x39c55d[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0xe3d45b,null))[_0x2746('0x27')](function(_0x21264e){if(_0x21264e){_0x2182e4[_0x2746('0x2e')]=_['keys'](db['CmHopperFinal'][_0x2746('0x53')]);_0x2182e4['query']=_[_0x2746('0x30')](_0x39c55d['query']);_0x2182e4['filters']=_[_0x2746('0x33')](_0x2182e4[_0x2746('0x2e')],_0x2182e4['query']);_0xa7ddd7[_0x2746('0x34')]=_['intersection'](_0x2182e4[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x39c55d[_0x2746('0x31')][_0x2746('0x35')]));_0xa7ddd7[_0x2746('0x34')]=_0xa7ddd7[_0x2746('0x34')][_0x2746('0x36')]?_0xa7ddd7[_0x2746('0x34')]:_0x2182e4[_0x2746('0x2e')];if(!_0x39c55d['query'][_0x2746('0x37')](_0x2746('0x38'))){_0xa7ddd7[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x39c55d['query'][_0x2746('0x1d')]);_0xa7ddd7[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x39c55d['query'][_0x2746('0x1f')]);}_0xa7ddd7[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x39c55d[_0x2746('0x31')][_0x2746('0x3a')]);_0xa7ddd7['where']=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x39c55d[_0x2746('0x31')],_0x2182e4['filters']));_0xa7ddd7[_0x2746('0x3b')]['CampaignId']=_0x21264e['id'];if(_0x39c55d[_0x2746('0x31')][_0x2746('0x3d')]){_0xa7ddd7[_0x2746('0x3b')]=_['merge'](_0xa7ddd7[_0x2746('0x3b')],{'$or':_['map'](_0xa7ddd7['attributes'],function(_0x4d4e35){var _0x23098b={};_0x23098b[_0x4d4e35]={'$like':'%'+_0x39c55d['query'][_0x2746('0x3d')]+'%'};return _0x23098b;})});}_0xa7ddd7=_[_0x2746('0x3e')]({},_0xa7ddd7,_0x39c55d[_0x2746('0x47')]);return db[_0x2746('0x5f')][_0x2746('0x1e')]({'where':_0xa7ddd7[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x197941){_0x4f077e[_0x2746('0x1e')]=_0x197941;if(_0x39c55d[_0x2746('0x31')][_0x2746('0x45')]){_0xa7ddd7[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5f')][_0x2746('0x41')](_0xa7ddd7);})[_0x2746('0x27')](function(_0x379087){_0x4f077e[_0x2746('0x42')]=_0x379087;return _0x4f077e;});}})[_0x2746('0x27')](respondWithFilteredResult(_0xe3d45b,_0xa7ddd7))['catch'](handleError(_0xe3d45b,null));};exports['getHopperBlacks']=function(_0x5684bf,_0x2030ed,_0x3ce8a1){var _0x4bc154={'raw':!![],'where':{}};var _0x41bc73={};var _0x47ca03={'count':0x0,'rows':[]};return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x5684bf[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x2030ed,null))[_0x2746('0x27')](function(_0x268936){if(_0x268936){_0x41bc73[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x60')][_0x2746('0x53')]);_0x41bc73['query']=_[_0x2746('0x30')](_0x5684bf[_0x2746('0x31')]);_0x41bc73[_0x2746('0x32')]=_[_0x2746('0x33')](_0x41bc73[_0x2746('0x2e')],_0x41bc73[_0x2746('0x31')]);_0x4bc154[_0x2746('0x34')]=_[_0x2746('0x33')](_0x41bc73['model'],qs[_0x2746('0x35')](_0x5684bf[_0x2746('0x31')][_0x2746('0x35')]));_0x4bc154[_0x2746('0x34')]=_0x4bc154[_0x2746('0x34')][_0x2746('0x36')]?_0x4bc154[_0x2746('0x34')]:_0x41bc73[_0x2746('0x2e')];if(!_0x5684bf[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x4bc154['limit']=qs[_0x2746('0x1d')](_0x5684bf[_0x2746('0x31')][_0x2746('0x1d')]);_0x4bc154[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x5684bf[_0x2746('0x31')][_0x2746('0x1f')]);}_0x4bc154[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x5684bf[_0x2746('0x31')][_0x2746('0x3a')]);_0x4bc154[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x5684bf['query'],_0x41bc73[_0x2746('0x32')]));_0x4bc154[_0x2746('0x3b')]['CampaignId']=_0x268936['id'];if(_0x5684bf['query']['filter']){_0x4bc154[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x4bc154[_0x2746('0x3b')],{'$or':_['map'](_0x4bc154[_0x2746('0x34')],function(_0x3732ed){var _0x47a2c9={};_0x47a2c9[_0x3732ed]={'$like':'%'+_0x5684bf[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x47a2c9;})});}_0x4bc154=_[_0x2746('0x3e')]({},_0x4bc154,_0x5684bf[_0x2746('0x47')]);return db[_0x2746('0x60')][_0x2746('0x1e')]({'where':_0x4bc154[_0x2746('0x3b')]})['then'](function(_0x343a2f){_0x47ca03[_0x2746('0x1e')]=_0x343a2f;if(_0x5684bf['query'][_0x2746('0x45')]){_0x4bc154[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x60')]['findAll'](_0x4bc154);})[_0x2746('0x27')](function(_0x416d47){_0x47ca03[_0x2746('0x42')]=_0x416d47;return _0x47ca03;});}})['then'](respondWithFilteredResult(_0x2030ed,_0x4bc154))['catch'](handleError(_0x2030ed,null));};exports[_0x2746('0x61')]=function(_0x4812da,_0x53bc21,_0x9b01a3){var _0x3e358e={};var _0x29b1e3={};var _0x1363f3;var _0x213e80;return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x4812da['params']['id']}})['then'](handleEntityNotFound(_0x53bc21,null))[_0x2746('0x27')](function(_0x25cf86){if(_0x25cf86){_0x1363f3=_0x25cf86;_0x29b1e3[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x62')][_0x2746('0x53')]);_0x29b1e3[_0x2746('0x31')]=_[_0x2746('0x30')](_0x4812da[_0x2746('0x31')]);_0x29b1e3[_0x2746('0x32')]=_[_0x2746('0x33')](_0x29b1e3[_0x2746('0x2e')],_0x29b1e3[_0x2746('0x31')]);_0x3e358e['attributes']=_[_0x2746('0x33')](_0x29b1e3[_0x2746('0x2e')],qs['fields'](_0x4812da[_0x2746('0x31')][_0x2746('0x35')]));_0x3e358e[_0x2746('0x34')]=_0x3e358e[_0x2746('0x34')]['length']?_0x3e358e['attributes']:_0x29b1e3['model'];_0x3e358e[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x4812da['query']['sort']);_0x3e358e['where']=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x4812da[_0x2746('0x31')],_0x29b1e3[_0x2746('0x32')]));if(_0x4812da[_0x2746('0x31')][_0x2746('0x3d')]){_0x3e358e[_0x2746('0x3b')]=_['merge'](_0x3e358e['where'],{'$or':_[_0x2746('0x2b')](_0x3e358e[_0x2746('0x34')],function(_0x576d07){var _0xe05ced={};_0xe05ced[_0x576d07]={'$like':'%'+_0x4812da[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0xe05ced;})});}_0x3e358e=_['merge']({},_0x3e358e,_0x4812da[_0x2746('0x47')]);return _0x1363f3[_0x2746('0x61')](_0x3e358e);}})['then'](function(_0x39f31e){if(_0x39f31e){_0x213e80=_0x39f31e[_0x2746('0x36')];if(!_0x4812da[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x3e358e[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x4812da[_0x2746('0x31')][_0x2746('0x1d')]);_0x3e358e[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x4812da[_0x2746('0x31')][_0x2746('0x1f')]);}return _0x1363f3[_0x2746('0x61')](_0x3e358e);}})['then'](function(_0x39eaa6){if(_0x39eaa6){return _0x39eaa6?{'count':_0x213e80,'rows':_0x39eaa6}:null;}})[_0x2746('0x27')](respondWithResult(_0x53bc21,null))[_0x2746('0x43')](handleError(_0x53bc21,null));};exports[_0x2746('0x63')]=function(_0x125b68,_0x56a140,_0x20849e){var _0x1bddea,_0x512478;var _0xd971ba=[];var _0x1c01a2=moment()[_0x2746('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x125b68[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x56a140,null))[_0x2746('0x27')](function(_0x134307){if(_0x134307){_0x512478=_0x134307;return _0x134307[_0x2746('0x63')](_0x125b68[_0x2746('0x4a')][_0x2746('0x65')],_[_0x2746('0x54')](_0x125b68[_0x2746('0x4a')],[_0x2746('0x65'),'id'])||{});}return null;})[_0x2746('0x66')](function(_0x3b636b){var _0x2f2217;var _0x8a877f;_0x1bddea=_0x3b636b||[];var _0x52cb5c=[];if(_0x3b636b){for(var _0x4d52b0=0x0;_0x4d52b0<_0x3b636b[_0x2746('0x36')];_0x4d52b0+=0x1){var _0x4761f2=_0x3b636b[_0x4d52b0][_0x2746('0x4c')]({'plain':!![]});_0x512478[_0x2746('0x67')]=_0x125b68[_0x2746('0x4a')]['dialCheckDuplicateType']?_0x125b68[_0x2746('0x4a')][_0x2746('0x67')]:_0x512478['dialCheckDuplicateType'];switch(_0x512478['dialCheckDuplicateType']){case _0x2746('0x68'):_0x2f2217=squel[_0x2746('0x69')]()[_0x2746('0x6a')](_0x2746('0x6b'))[_0x2746('0x6c')](['phone',_0x2746('0x6d'),'ContactId','ListId',_0x2746('0x5b'),_0x2746('0x55'),_0x2746('0x56')],squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x70'),_0x2746('0x70'))['field'](_0x2746('0x71'),_0x2746('0x6d'))[_0x2746('0x6f')]('id',_0x2746('0x72'))[_0x2746('0x6f')](_0x4761f2['CmListId'][_0x2746('0x73')](),'ListId')[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id']['toString'](),_0x2746('0x5b'))[_0x2746('0x6f')]('\x27'+_0x1c01a2+'\x27','createdAt')[_0x2746('0x6f')]('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))['from'](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')](_0x2746('0x76'),_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78'))[_0x2746('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2746('0x6e')]()['field'](_0x2746('0x79'))[_0x2746('0x7a')](_0x2746('0x7b'))[_0x2746('0x3b')](_0x2746('0x7c'),_0x125b68['params']['id']['toString']()))['where'](_0x2746('0x7d'),squel[_0x2746('0x6e')]()[_0x2746('0x6f')]('COALESCE(phone,\x27\x27)')[_0x2746('0x7a')](_0x2746('0x6b'))[_0x2746('0x3b')](_0x2746('0x7c'),_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')]())))['toString']();break;case'onlyIfOpen':_0x2f2217=squel[_0x2746('0x69')]()['into'](_0x2746('0x6b'))[_0x2746('0x6c')]([_0x2746('0x70'),_0x2746('0x6d'),_0x2746('0x72'),'ListId',_0x2746('0x5b'),'createdAt',_0x2746('0x56')],squel[_0x2746('0x6e')]()['field'](_0x2746('0x70'),_0x2746('0x70'))[_0x2746('0x6f')]('NOW()',_0x2746('0x6d'))[_0x2746('0x6f')]('id','ContactId')[_0x2746('0x6f')](_0x4761f2['CmListId'][_0x2746('0x73')](),_0x2746('0x7e'))[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))['field']('\x27'+_0x1c01a2+'\x27','createdAt')['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))[_0x2746('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x2746('0x3b')]('ListId\x20=\x20?',_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78'))['where'](_0x2746('0x7d'),squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x7f'))[_0x2746('0x7a')](_0x2746('0x6b'))[_0x2746('0x3b')]('CampaignId\x20=\x20?',_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')]())))[_0x2746('0x73')]();break;default:_0x2f2217=squel['insert']()['into'](_0x2746('0x6b'))['fromQuery'](['phone',_0x2746('0x6d'),'ContactId','ListId',_0x2746('0x5b'),'createdAt','updatedAt'],squel[_0x2746('0x6e')]()['field'](_0x2746('0x70'),_0x2746('0x70'))['field'](_0x2746('0x71'),'scheduledAt')[_0x2746('0x6f')]('id',_0x2746('0x72'))[_0x2746('0x6f')](_0x4761f2[_0x2746('0x77')][_0x2746('0x73')](),_0x2746('0x7e'))[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x55'))['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))[_0x2746('0x7a')](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')](_0x2746('0x76'),_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78')))[_0x2746('0x73')]();}_0x8a877f=squel['insert']()[_0x2746('0x6a')](_0x2746('0x80'))[_0x2746('0x6c')]([_0x2746('0x81'),'scheduledAt',_0x2746('0x70'),'OrderBy',_0x2746('0x55'),_0x2746('0x56')],squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x82'),'id')[_0x2746('0x6f')](_0x2746('0x71'),'scheduledAt')[_0x2746('0x6f')]('ci.item',_0x2746('0x70'))[_0x2746('0x6f')](_0x2746('0x83'),_0x2746('0x84'))['field']('\x27'+_0x1c01a2+'\x27','createdAt')['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))['from'](_0x2746('0x85'),'ci')[_0x2746('0x86')](_0x2746('0x6b'),'h',_0x2746('0x87'))[_0x2746('0x3b')]('h.ListId\x20=\x20?',_0x4761f2[_0x2746('0x77')]['toString']())[_0x2746('0x3b')](_0x2746('0x88'),_0x125b68['params']['id'][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x89'),_0x1c01a2))[_0x2746('0x73')]();_0x52cb5c[_0x2746('0x8a')](db[_0x2746('0x8b')]['query'](_0x2f2217));_0xd971ba['push'](db[_0x2746('0x8b')][_0x2746('0x31')](_0x8a877f));}return BPromise['all'](_0x52cb5c);}})[_0x2746('0x27')](function(){return BPromise[_0x2746('0x8c')](_0xd971ba);})[_0x2746('0x27')](function(){return _0x1bddea;})[_0x2746('0x27')](respondWithResult(_0x56a140,null))[_0x2746('0x43')](handleError(_0x56a140,null));};exports['removeLists']=function(_0x50d591,_0xf7895c,_0x10b3de){return db[_0x2746('0x2c')]['find']({'where':{'id':_0x50d591[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0xf7895c,null))[_0x2746('0x27')](function(_0x3985a1){if(_0x3985a1){return _0x3985a1[_0x2746('0x8d')](_0x50d591[_0x2746('0x31')]['ids']);}})[_0x2746('0x27')](function(_0x309013){if(_0x309013){return db['CmHopper'][_0x2746('0x26')]({'where':{'ListId':_0x50d591[_0x2746('0x31')][_0x2746('0x65')],'CampaignId':_0x50d591[_0x2746('0x52')]['id']}})[_0x2746('0x27')](function(){return _0x309013;});}})[_0x2746('0x27')](respondWithStatusCode(_0xf7895c,null))[_0x2746('0x43')](handleError(_0xf7895c,null));};exports[_0x2746('0x8e')]=function(_0x4d6e33,_0x5e63a4,_0x3e4e4f){var _0x31eeb8={};var _0x97430b={};var _0x3ffb83;var _0x3b3843;return db[_0x2746('0x2c')]['findOne']({'where':{'id':_0x4d6e33[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x5e63a4,null))[_0x2746('0x27')](function(_0x41acbc){if(_0x41acbc){_0x3ffb83=_0x41acbc;_0x97430b[_0x2746('0x2e')]=_['keys'](db[_0x2746('0x62')][_0x2746('0x53')]);_0x97430b[_0x2746('0x31')]=_[_0x2746('0x30')](_0x4d6e33[_0x2746('0x31')]);_0x97430b[_0x2746('0x32')]=_[_0x2746('0x33')](_0x97430b['model'],_0x97430b[_0x2746('0x31')]);_0x31eeb8[_0x2746('0x34')]=_[_0x2746('0x33')](_0x97430b['model'],qs['fields'](_0x4d6e33[_0x2746('0x31')]['fields']));_0x31eeb8[_0x2746('0x34')]=_0x31eeb8[_0x2746('0x34')][_0x2746('0x36')]?_0x31eeb8[_0x2746('0x34')]:_0x97430b[_0x2746('0x2e')];_0x31eeb8[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x3a')]);_0x31eeb8['where']=qs[_0x2746('0x32')](_['pick'](_0x4d6e33[_0x2746('0x31')],_0x97430b['filters']));if(_0x4d6e33[_0x2746('0x31')][_0x2746('0x3d')]){_0x31eeb8[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x31eeb8[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x31eeb8['attributes'],function(_0x49e4c9){var _0x160502={};_0x160502[_0x49e4c9]={'$like':'%'+_0x4d6e33[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x160502;})});}_0x31eeb8=_[_0x2746('0x3e')]({},_0x31eeb8,_0x4d6e33['options']);return _0x3ffb83[_0x2746('0x8e')](_0x31eeb8);}})[_0x2746('0x27')](function(_0x29d02f){if(_0x29d02f){_0x3b3843=_0x29d02f[_0x2746('0x36')];if(!_0x4d6e33[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x31eeb8[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x1d')]);_0x31eeb8[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x1f')]);}return _0x3ffb83[_0x2746('0x8e')](_0x31eeb8);}})[_0x2746('0x27')](function(_0x31ee8d){if(_0x31ee8d){return _0x31ee8d?{'count':_0x3b3843,'rows':_0x31ee8d}:null;}})[_0x2746('0x27')](respondWithResult(_0x5e63a4,null))[_0x2746('0x43')](handleError(_0x5e63a4,null));};exports[_0x2746('0x8f')]=function(_0x278e6d,_0x7ab7f8,_0x374078){var _0x1e2293,_0x190358;var _0x1c102f=[];var _0x4e54e8=moment()[_0x2746('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x278e6d[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x7ab7f8,null))['then'](function(_0x258fe0){if(_0x258fe0){_0x190358=_0x258fe0;return _0x258fe0[_0x2746('0x8f')](_0x278e6d[_0x2746('0x4a')]['ids'],_[_0x2746('0x54')](_0x278e6d[_0x2746('0x4a')],[_0x2746('0x65'),'id'])||{});}return null;})[_0x2746('0x66')](function(_0x51a7ed){var _0xfd070f;var _0x34d8f5;_0x1e2293=_0x51a7ed||[];var _0x469935=[];if(_0x51a7ed){for(var _0x487a6a=0x0;_0x487a6a<_0x51a7ed['length'];_0x487a6a+=0x1){var _0x29d7ea=_0x51a7ed[_0x487a6a][_0x2746('0x4c')]({'plain':!![]});_0xfd070f=squel[_0x2746('0x69')]()['into'](_0x2746('0x90'))[_0x2746('0x6c')]([_0x2746('0x70'),_0x2746('0x72'),_0x2746('0x7e'),_0x2746('0x5b'),_0x2746('0x55'),_0x2746('0x56')],squel['select']()['field'](_0x2746('0x70'),_0x2746('0x70'))[_0x2746('0x6f')]('id','ContactId')[_0x2746('0x6f')](_0x29d7ea[_0x2746('0x77')][_0x2746('0x73')](),'ListId')[_0x2746('0x6f')](_0x278e6d[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))[_0x2746('0x6f')](_0x2746('0x71'),'createdAt')[_0x2746('0x6f')]('NOW()','updatedAt')[_0x2746('0x7a')](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')]('ListId\x20=\x20?',_0x29d7ea[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x469935[_0x2746('0x8a')](db['sequelize']['query'](_0xfd070f));}return BPromise[_0x2746('0x8c')](_0x469935);}})[_0x2746('0x27')](function(){return _0x1e2293;})[_0x2746('0x27')](respondWithResult(_0x7ab7f8,null))[_0x2746('0x43')](handleError(_0x7ab7f8,null));};exports[_0x2746('0x91')]=function(_0x18473b,_0x2a8fc5,_0x5be077){return db['Campaign'][_0x2746('0x48')]({'where':{'id':_0x18473b['params']['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x2a8fc5,null))[_0x2746('0x27')](function(_0x5a086a){if(_0x5a086a){return _0x5a086a[_0x2746('0x91')](_0x18473b[_0x2746('0x31')]['ids']);}})[_0x2746('0x27')](function(_0x2c21e5){if(_0x2c21e5){return db[_0x2746('0x60')]['destroy']({'where':{'ListId':_0x18473b[_0x2746('0x31')][_0x2746('0x65')],'CampaignId':_0x18473b[_0x2746('0x52')]['id']}})[_0x2746('0x27')](function(){return _0x2c21e5;});}})[_0x2746('0x27')](respondWithStatusCode(_0x2a8fc5,null))['catch'](handleError(_0x2a8fc5,null));};
\ No newline at end of file
+var _0x9aea=['save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','Campaign','include','findAll','rows','show','params','rawAttributes','includeAll','options','find','catch','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','createdAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','OrderBy','ci.item','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x12531d,_0x3a5747){var _0x16ea2e=function(_0x59d635){while(--_0x59d635){_0x12531d['push'](_0x12531d['shift']());}};_0x16ea2e(++_0x3a5747);}(_0x9aea,0x196));var _0xa9ae=function(_0x49391f,_0x37f04a){_0x49391f=_0x49391f-0x0;var _0xacedfd=_0x9aea[_0x49391f];return _0xacedfd;};'use strict';var emlformat=require(_0xa9ae('0x0'));var rimraf=require(_0xa9ae('0x1'));var zipdir=require(_0xa9ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9ae('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa9ae('0x4'));var path=require(_0xa9ae('0x5'));var sox=require(_0xa9ae('0x6'));var csv=require('to-csv');var ejs=require(_0xa9ae('0x7'));var fs=require('fs');var fs_extra=require(_0xa9ae('0x8'));var _=require('lodash');var squel=require(_0xa9ae('0x9'));var crypto=require(_0xa9ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa9ae('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa9ae('0xc'));var Papa=require('papaparse');var Redis=require(_0xa9ae('0xd'));var authService=require(_0xa9ae('0xe'));var qs=require(_0xa9ae('0xf'));var as=require(_0xa9ae('0x10'));var hardwareService=require(_0xa9ae('0x11'));var logger=require(_0xa9ae('0x12'))(_0xa9ae('0x13'));var utils=require(_0xa9ae('0x14'));var config=require(_0xa9ae('0x15'));var licenseUtil=require(_0xa9ae('0x16'));var db=require(_0xa9ae('0x17'))['db'];function respondWithStatusCode(_0x3ff5bb,_0x44dfb8){_0x44dfb8=_0x44dfb8||0xcc;return function(_0xc9680f){if(_0xc9680f){return _0x3ff5bb[_0xa9ae('0x18')](_0x44dfb8);}return _0x3ff5bb[_0xa9ae('0x19')](_0x44dfb8)[_0xa9ae('0x1a')]();};}function respondWithResult(_0x9c5924,_0x277ef5){_0x277ef5=_0x277ef5||0xc8;return function(_0x348fcb){if(_0x348fcb){return _0x9c5924['status'](_0x277ef5)[_0xa9ae('0x1b')](_0x348fcb);}};}function respondWithFilteredResult(_0x2df6a9,_0x46df45){return function(_0x4eb1fe){if(_0x4eb1fe){var _0x523459=typeof _0x46df45[_0xa9ae('0x1c')]===_0xa9ae('0x1d')&&typeof _0x46df45[_0xa9ae('0x1e')]===_0xa9ae('0x1d');var _0x54569c=_0x4eb1fe[_0xa9ae('0x1f')];var _0x32b7c4=_0x523459?0x0:_0x46df45[_0xa9ae('0x1c')];var _0x2c7d41=_0x523459?_0x4eb1fe[_0xa9ae('0x1f')]:_0x46df45[_0xa9ae('0x1c')]+_0x46df45['limit'];var _0x2dda43;if(_0x2c7d41>=_0x54569c){_0x2c7d41=_0x54569c;_0x2dda43=0xc8;}else{_0x2dda43=0xce;}_0x2df6a9[_0xa9ae('0x19')](_0x2dda43);return _0x2df6a9[_0xa9ae('0x20')](_0xa9ae('0x21'),_0x32b7c4+'-'+_0x2c7d41+'/'+_0x54569c)[_0xa9ae('0x1b')](_0x4eb1fe);}return null;};}function patchUpdates(_0x37764f){return function(_0x103732){try{jsonpatch[_0xa9ae('0x22')](_0x103732,_0x37764f,!![]);}catch(_0x1594a6){return BPromise['reject'](_0x1594a6);}return _0x103732[_0xa9ae('0x23')]();};}function saveUpdates(_0x42b6da,_0x57bbde){return function(_0x1518b9){if(_0x1518b9){return _0x1518b9[_0xa9ae('0x24')](_0x42b6da)[_0xa9ae('0x25')](function(_0x54d05c){return _0x54d05c;});}return null;};}function removeEntity(_0x4a70f1,_0x40250e){return function(_0x23f2b5){if(_0x23f2b5){return _0x23f2b5[_0xa9ae('0x26')]()[_0xa9ae('0x25')](function(){var _0x473016=_0x23f2b5[_0xa9ae('0x27')]({'plain':!![]});var _0x21c87d=_0xa9ae('0x28');return db['UserProfileResource'][_0xa9ae('0x26')]({'where':{'type':_0x21c87d,'resourceId':_0x473016['id']}})['then'](function(){return _0x23f2b5;});})[_0xa9ae('0x25')](function(){_0x4a70f1[_0xa9ae('0x19')](0xcc)[_0xa9ae('0x1a')]();});}};}function handleEntityNotFound(_0x5b7cd8,_0x32f1b0){return function(_0x108876){if(!_0x108876){_0x5b7cd8[_0xa9ae('0x18')](0x194);}return _0x108876;};}function handleError(_0x406d63,_0x1f1e8d){_0x1f1e8d=_0x1f1e8d||0x1f4;return function(_0x21206d){logger[_0xa9ae('0x29')](_0x21206d[_0xa9ae('0x2a')]);if(_0x21206d[_0xa9ae('0x2b')]){delete _0x21206d[_0xa9ae('0x2b')];}_0x406d63['status'](_0x1f1e8d)[_0xa9ae('0x2c')](_0x21206d);};}exports[_0xa9ae('0x2d')]=function(_0x138ec4,_0x10ddef){var _0x3b8423={},_0x1d0151={},_0x519b35={'count':0x0,'rows':[]};var _0x202d6c=_[_0xa9ae('0x2e')](db['Campaign']['rawAttributes'],function(_0x1f32f5){return{'name':_0x1f32f5[_0xa9ae('0x2f')],'type':_0x1f32f5[_0xa9ae('0x30')][_0xa9ae('0x31')]};});_0x1d0151[_0xa9ae('0x32')]=_['map'](_0x202d6c,_0xa9ae('0x2b'));_0x1d0151[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x138ec4[_0xa9ae('0x33')]);_0x1d0151['filters']=_['intersection'](_0x1d0151[_0xa9ae('0x32')],_0x1d0151[_0xa9ae('0x33')]);_0x3b8423[_0xa9ae('0x35')]=_[_0xa9ae('0x36')](_0x1d0151[_0xa9ae('0x32')],qs['fields'](_0x138ec4[_0xa9ae('0x33')][_0xa9ae('0x37')]));_0x3b8423['attributes']=_0x3b8423[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x3b8423[_0xa9ae('0x35')]:_0x1d0151[_0xa9ae('0x32')];if(!_0x138ec4[_0xa9ae('0x33')][_0xa9ae('0x39')](_0xa9ae('0x3a'))){_0x3b8423['limit']=qs[_0xa9ae('0x1e')](_0x138ec4[_0xa9ae('0x33')][_0xa9ae('0x1e')]);_0x3b8423[_0xa9ae('0x1c')]=qs['offset'](_0x138ec4[_0xa9ae('0x33')][_0xa9ae('0x1c')]);}_0x3b8423[_0xa9ae('0x3b')]=qs[_0xa9ae('0x3c')](_0x138ec4[_0xa9ae('0x33')][_0xa9ae('0x3c')]);_0x3b8423[_0xa9ae('0x3d')]=qs[_0xa9ae('0x3e')](_[_0xa9ae('0x3f')](_0x138ec4['query'],_0x1d0151[_0xa9ae('0x3e')]),_0x202d6c);if(_0x138ec4[_0xa9ae('0x33')]['filter']){_0x3b8423[_0xa9ae('0x3d')]=_[_0xa9ae('0x40')](_0x3b8423[_0xa9ae('0x3d')],{'$or':_['map'](_0x202d6c,function(_0x5a0f9d){if(_0x5a0f9d[_0xa9ae('0x30')]!==_0xa9ae('0x41')){var _0x37a2a8={};_0x37a2a8[_0x5a0f9d[_0xa9ae('0x2b')]]={'$like':'%'+_0x138ec4['query'][_0xa9ae('0x42')]+'%'};return _0x37a2a8;}})});}_0x3b8423=_[_0xa9ae('0x40')]({},_0x3b8423,_0x138ec4['options']);var _0x4b45d6={'where':_0x3b8423['where']};return db[_0xa9ae('0x43')][_0xa9ae('0x1f')](_0x4b45d6)['then'](function(_0x389c0a){_0x519b35[_0xa9ae('0x1f')]=_0x389c0a;if(_0x138ec4[_0xa9ae('0x33')]['includeAll']){_0x3b8423[_0xa9ae('0x44')]=[{'all':!![]}];}return db['Campaign'][_0xa9ae('0x45')](_0x3b8423);})[_0xa9ae('0x25')](function(_0x1e53b7){_0x519b35[_0xa9ae('0x46')]=_0x1e53b7;return _0x519b35;})[_0xa9ae('0x25')](respondWithFilteredResult(_0x10ddef,_0x3b8423))['catch'](handleError(_0x10ddef,null));};exports[_0xa9ae('0x47')]=function(_0x361914,_0x175ee7){var _0x40ded2={'raw':![],'where':{'id':_0x361914[_0xa9ae('0x48')]['id']}},_0x322e6f={};_0x322e6f[_0xa9ae('0x32')]=_[_0xa9ae('0x34')](db[_0xa9ae('0x43')][_0xa9ae('0x49')]);_0x322e6f['query']=_[_0xa9ae('0x34')](_0x361914[_0xa9ae('0x33')]);_0x322e6f[_0xa9ae('0x3e')]=_[_0xa9ae('0x36')](_0x322e6f[_0xa9ae('0x32')],_0x322e6f[_0xa9ae('0x33')]);_0x40ded2[_0xa9ae('0x35')]=_[_0xa9ae('0x36')](_0x322e6f['model'],qs['fields'](_0x361914[_0xa9ae('0x33')][_0xa9ae('0x37')]));_0x40ded2[_0xa9ae('0x35')]=_0x40ded2[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x40ded2['attributes']:_0x322e6f[_0xa9ae('0x32')];if(_0x361914[_0xa9ae('0x33')][_0xa9ae('0x4a')]){_0x40ded2[_0xa9ae('0x44')]=[{'all':!![]}];}_0x40ded2=_[_0xa9ae('0x40')]({},_0x40ded2,_0x361914[_0xa9ae('0x4b')]);return db[_0xa9ae('0x43')][_0xa9ae('0x4c')](_0x40ded2)[_0xa9ae('0x25')](handleEntityNotFound(_0x175ee7,null))[_0xa9ae('0x25')](respondWithResult(_0x175ee7,null))[_0xa9ae('0x4d')](handleError(_0x175ee7,null));};exports['create']=function(_0x3d1a96,_0x35f784){return db[_0xa9ae('0x43')][_0xa9ae('0x4e')](_0x3d1a96[_0xa9ae('0x4f')],{})[_0xa9ae('0x25')](function(_0x3a501c){var _0x286d5e=_0x3d1a96[_0xa9ae('0x50')][_0xa9ae('0x27')]({'plain':!![]});if(!_0x286d5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x286d5e[_0xa9ae('0x51')]===_0xa9ae('0x50')){var _0x2be067=_0x3a501c['get']({'plain':!![]});var _0x1f69bc=_0xa9ae('0x28');return db[_0xa9ae('0x52')][_0xa9ae('0x4c')]({'where':{'name':_0x1f69bc,'userProfileId':_0x286d5e['userProfileId']},'raw':!![]})[_0xa9ae('0x25')](function(_0x1ec0fe){if(_0x1ec0fe&&_0x1ec0fe[_0xa9ae('0x53')]===0x0){return db[_0xa9ae('0x54')][_0xa9ae('0x4e')]({'name':_0x2be067[_0xa9ae('0x2b')],'resourceId':_0x2be067['id'],'type':_0x1ec0fe['name'],'sectionId':_0x1ec0fe['id']},{})['then'](function(){return _0x3a501c;});}else{return _0x3a501c;}})[_0xa9ae('0x4d')](function(_0x3b83f2){logger[_0xa9ae('0x29')](_0xa9ae('0x55'),_0x3b83f2);throw _0x3b83f2;});}return _0x3a501c;})[_0xa9ae('0x25')](respondWithResult(_0x35f784,0xc9))[_0xa9ae('0x4d')](handleError(_0x35f784,null));};exports[_0xa9ae('0x56')]=function(_0xb3a3ed,_0x373158){var _0x1c43e2={'where':{'id':_0xb3a3ed['params']['id']}},_0x57d03b={};_0x57d03b[_0xa9ae('0x32')]=_[_0xa9ae('0x34')](db[_0xa9ae('0x43')][_0xa9ae('0x49')]);_0x1c43e2[_0xa9ae('0x35')]=_['intersection'](_0x57d03b[_0xa9ae('0x32')],qs['fields'](_0xb3a3ed[_0xa9ae('0x33')]['fields']));_0x1c43e2['attributes']=_0x1c43e2[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x1c43e2[_0xa9ae('0x35')]:_0x57d03b[_0xa9ae('0x32')];if(_0xb3a3ed[_0xa9ae('0x33')]['includeAll']){_0x1c43e2[_0xa9ae('0x44')]=[{'all':!![]}];}_0x1c43e2=_[_0xa9ae('0x40')]({},_0x1c43e2,_0xb3a3ed[_0xa9ae('0x4b')]);return db[_0xa9ae('0x43')][_0xa9ae('0x4c')](_0x1c43e2)['then'](handleEntityNotFound(_0x373158,null))[_0xa9ae('0x25')](function(_0x20dffe){if(_0x20dffe){var _0x2df7b5=_0x20dffe[_0xa9ae('0x27')]({'plain':!![]});_0x2df7b5=qs[_0xa9ae('0x57')](_0x2df7b5,['id','createdAt',_0xa9ae('0x58')]);_0xb3a3ed[_0xa9ae('0x4f')]=_[_0xa9ae('0x57')](_0xb3a3ed['body'],['id','createdAt',_0xa9ae('0x58')]);return db[_0xa9ae('0x43')]['create'](_['merge'](_0x2df7b5,_0xb3a3ed[_0xa9ae('0x4f')]),{'include':_0xb3a3ed[_0xa9ae('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2e753d){var _0xc46d6f=_0xb3a3ed[_0xa9ae('0x50')]['get']({'plain':!![]});if(!_0xc46d6f)throw new Error(_0xa9ae('0x59'));if(_0xc46d6f[_0xa9ae('0x51')]===_0xa9ae('0x50')){var _0x2bc12d=_0x2e753d[_0xa9ae('0x27')]({'plain':!![]});var _0x40aa53=_0xa9ae('0x28');return db[_0xa9ae('0x52')][_0xa9ae('0x4c')]({'where':{'name':_0x40aa53,'userProfileId':_0xc46d6f[_0xa9ae('0x5a')]},'raw':!![]})[_0xa9ae('0x25')](function(_0x3da1c3){if(_0x3da1c3&&_0x3da1c3[_0xa9ae('0x53')]===0x0){return db[_0xa9ae('0x54')][_0xa9ae('0x4e')]({'name':_0x2bc12d[_0xa9ae('0x2b')],'resourceId':_0x2bc12d['id'],'type':_0x3da1c3[_0xa9ae('0x2b')],'sectionId':_0x3da1c3['id']},{})[_0xa9ae('0x25')](function(){return _0x2e753d;});}else{return _0x2e753d;}})[_0xa9ae('0x4d')](function(_0x53be24){logger[_0xa9ae('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53be24);throw _0x53be24;});}return _0x2e753d;});}})[_0xa9ae('0x25')](respondWithResult(_0x373158,0xc9))[_0xa9ae('0x4d')](handleError(_0x373158,null));};exports[_0xa9ae('0x24')]=function(_0x31ecff,_0x1f374b){if(_0x31ecff[_0xa9ae('0x4f')]['id']){delete _0x31ecff['body']['id'];}return db[_0xa9ae('0x43')][_0xa9ae('0x4c')]({'where':{'id':_0x31ecff[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x1f374b,null))[_0xa9ae('0x25')](saveUpdates(_0x31ecff[_0xa9ae('0x4f')],null))['then'](respondWithResult(_0x1f374b,null))['catch'](handleError(_0x1f374b,null));};exports[_0xa9ae('0x26')]=function(_0x191e2d,_0x270442){return db['Campaign'][_0xa9ae('0x4c')]({'where':{'id':_0x191e2d[_0xa9ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x270442,null))[_0xa9ae('0x25')](removeEntity(_0x270442,null))['catch'](handleError(_0x270442,null));};exports['getHoppers']=function(_0x1d2b2b,_0x2ab048,_0x5bd2be){var _0x3b3697={'raw':!![],'where':{}};var _0x32be27={};var _0x21fd7b={'count':0x0,'rows':[]};return db['Campaign'][_0xa9ae('0x5b')]({'where':{'id':_0x1d2b2b[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x2ab048,null))[_0xa9ae('0x25')](function(_0x97ea1b){if(_0x97ea1b){_0x32be27[_0xa9ae('0x32')]=_[_0xa9ae('0x34')](db['CmHopper'][_0xa9ae('0x49')]);_0x32be27[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x1d2b2b['query']);_0x32be27[_0xa9ae('0x3e')]=_[_0xa9ae('0x36')](_0x32be27[_0xa9ae('0x32')],_0x32be27[_0xa9ae('0x33')]);_0x3b3697[_0xa9ae('0x35')]=_[_0xa9ae('0x36')](_0x32be27[_0xa9ae('0x32')],qs[_0xa9ae('0x37')](_0x1d2b2b[_0xa9ae('0x33')][_0xa9ae('0x37')]));_0x3b3697[_0xa9ae('0x35')]=_0x3b3697[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x3b3697['attributes']:_0x32be27[_0xa9ae('0x32')];if(!_0x1d2b2b[_0xa9ae('0x33')][_0xa9ae('0x39')](_0xa9ae('0x3a'))){_0x3b3697[_0xa9ae('0x1e')]=qs[_0xa9ae('0x1e')](_0x1d2b2b[_0xa9ae('0x33')][_0xa9ae('0x1e')]);_0x3b3697['offset']=qs[_0xa9ae('0x1c')](_0x1d2b2b[_0xa9ae('0x33')][_0xa9ae('0x1c')]);}_0x3b3697['order']=qs['sort'](_0x1d2b2b[_0xa9ae('0x33')][_0xa9ae('0x3c')]);_0x3b3697[_0xa9ae('0x3d')]=qs[_0xa9ae('0x3e')](_[_0xa9ae('0x3f')](_0x1d2b2b[_0xa9ae('0x33')],_0x32be27[_0xa9ae('0x3e')]));_0x3b3697['where'][_0xa9ae('0x5c')]=_0x97ea1b['id'];if(_0x1d2b2b['query'][_0xa9ae('0x42')]){_0x3b3697['where']=_['merge'](_0x3b3697['where'],{'$or':_[_0xa9ae('0x2e')](_0x3b3697['attributes'],function(_0x5d90f3){var _0x2ee912={};_0x2ee912[_0x5d90f3]={'$like':'%'+_0x1d2b2b['query'][_0xa9ae('0x42')]+'%'};return _0x2ee912;})});}_0x3b3697=_['merge']({},_0x3b3697,_0x1d2b2b[_0xa9ae('0x4b')]);return db[_0xa9ae('0x5d')][_0xa9ae('0x1f')]({'where':_0x3b3697[_0xa9ae('0x3d')]})[_0xa9ae('0x25')](function(_0x51f3c5){_0x21fd7b[_0xa9ae('0x1f')]=_0x51f3c5;if(_0x1d2b2b[_0xa9ae('0x33')]['includeAll']){_0x3b3697['include']=[{'all':!![]}];}return db[_0xa9ae('0x5d')]['findAll'](_0x3b3697);})[_0xa9ae('0x25')](function(_0x5184c0){_0x21fd7b[_0xa9ae('0x46')]=_0x5184c0;return _0x21fd7b;});}})[_0xa9ae('0x25')](respondWithFilteredResult(_0x2ab048,_0x3b3697))[_0xa9ae('0x4d')](handleError(_0x2ab048,null));};exports[_0xa9ae('0x5e')]=function(_0x526e9d,_0x24c12c,_0x4b00d7){var _0x142587={'raw':!![],'where':{}};var _0x3949a0={};var _0x434a49={'count':0x0,'rows':[]};return db[_0xa9ae('0x43')][_0xa9ae('0x5b')]({'where':{'id':_0x526e9d['params']['id']}})['then'](handleEntityNotFound(_0x24c12c,null))[_0xa9ae('0x25')](function(_0x4c56a6){if(_0x4c56a6){_0x3949a0[_0xa9ae('0x32')]=_[_0xa9ae('0x34')](db[_0xa9ae('0x5f')][_0xa9ae('0x49')]);_0x3949a0[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x526e9d[_0xa9ae('0x33')]);_0x3949a0[_0xa9ae('0x3e')]=_[_0xa9ae('0x36')](_0x3949a0[_0xa9ae('0x32')],_0x3949a0[_0xa9ae('0x33')]);_0x142587[_0xa9ae('0x35')]=_[_0xa9ae('0x36')](_0x3949a0[_0xa9ae('0x32')],qs[_0xa9ae('0x37')](_0x526e9d[_0xa9ae('0x33')][_0xa9ae('0x37')]));_0x142587[_0xa9ae('0x35')]=_0x142587[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x142587[_0xa9ae('0x35')]:_0x3949a0['model'];if(!_0x526e9d[_0xa9ae('0x33')][_0xa9ae('0x39')](_0xa9ae('0x3a'))){_0x142587[_0xa9ae('0x1e')]=qs[_0xa9ae('0x1e')](_0x526e9d['query'][_0xa9ae('0x1e')]);_0x142587[_0xa9ae('0x1c')]=qs[_0xa9ae('0x1c')](_0x526e9d[_0xa9ae('0x33')][_0xa9ae('0x1c')]);}_0x142587[_0xa9ae('0x3b')]=qs['sort'](_0x526e9d['query']['sort']);_0x142587['where']=qs[_0xa9ae('0x3e')](_[_0xa9ae('0x3f')](_0x526e9d[_0xa9ae('0x33')],_0x3949a0[_0xa9ae('0x3e')]));_0x142587[_0xa9ae('0x3d')][_0xa9ae('0x5c')]=_0x4c56a6['id'];if(_0x526e9d[_0xa9ae('0x33')]['filter']){_0x142587[_0xa9ae('0x3d')]=_['merge'](_0x142587['where'],{'$or':_[_0xa9ae('0x2e')](_0x142587[_0xa9ae('0x35')],function(_0x52d691){var _0x60d0dc={};_0x60d0dc[_0x52d691]={'$like':'%'+_0x526e9d[_0xa9ae('0x33')][_0xa9ae('0x42')]+'%'};return _0x60d0dc;})});}_0x142587=_['merge']({},_0x142587,_0x526e9d[_0xa9ae('0x4b')]);return db[_0xa9ae('0x5f')]['count']({'where':_0x142587[_0xa9ae('0x3d')]})[_0xa9ae('0x25')](function(_0x50cb2c){_0x434a49[_0xa9ae('0x1f')]=_0x50cb2c;if(_0x526e9d[_0xa9ae('0x33')][_0xa9ae('0x4a')]){_0x142587[_0xa9ae('0x44')]=[{'all':!![]}];}return db[_0xa9ae('0x5f')][_0xa9ae('0x45')](_0x142587);})['then'](function(_0x4355ac){_0x434a49['rows']=_0x4355ac;return _0x434a49;});}})[_0xa9ae('0x25')](respondWithFilteredResult(_0x24c12c,_0x142587))[_0xa9ae('0x4d')](handleError(_0x24c12c,null));};exports[_0xa9ae('0x60')]=function(_0x5419df,_0x313d29,_0x1692d7){var _0x3f99fe={'raw':!![],'where':{}};var _0x2652f9={};var _0x5ba185={'count':0x0,'rows':[]};return db[_0xa9ae('0x43')]['findOne']({'where':{'id':_0x5419df[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x313d29,null))[_0xa9ae('0x25')](function(_0x1ea90b){if(_0x1ea90b){_0x2652f9[_0xa9ae('0x32')]=_[_0xa9ae('0x34')](db['CmHopperFinal']['rawAttributes']);_0x2652f9[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x5419df['query']);_0x2652f9[_0xa9ae('0x3e')]=_['intersection'](_0x2652f9[_0xa9ae('0x32')],_0x2652f9[_0xa9ae('0x33')]);_0x3f99fe['attributes']=_[_0xa9ae('0x36')](_0x2652f9[_0xa9ae('0x32')],qs[_0xa9ae('0x37')](_0x5419df['query'][_0xa9ae('0x37')]));_0x3f99fe['attributes']=_0x3f99fe[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x3f99fe[_0xa9ae('0x35')]:_0x2652f9[_0xa9ae('0x32')];if(!_0x5419df['query'][_0xa9ae('0x39')](_0xa9ae('0x3a'))){_0x3f99fe[_0xa9ae('0x1e')]=qs[_0xa9ae('0x1e')](_0x5419df['query'][_0xa9ae('0x1e')]);_0x3f99fe[_0xa9ae('0x1c')]=qs[_0xa9ae('0x1c')](_0x5419df[_0xa9ae('0x33')][_0xa9ae('0x1c')]);}_0x3f99fe[_0xa9ae('0x3b')]=qs[_0xa9ae('0x3c')](_0x5419df[_0xa9ae('0x33')][_0xa9ae('0x3c')]);_0x3f99fe[_0xa9ae('0x3d')]=qs[_0xa9ae('0x3e')](_['pick'](_0x5419df[_0xa9ae('0x33')],_0x2652f9[_0xa9ae('0x3e')]));_0x3f99fe['where'][_0xa9ae('0x5c')]=_0x1ea90b['id'];if(_0x5419df[_0xa9ae('0x33')][_0xa9ae('0x42')]){_0x3f99fe[_0xa9ae('0x3d')]=_[_0xa9ae('0x40')](_0x3f99fe['where'],{'$or':_[_0xa9ae('0x2e')](_0x3f99fe[_0xa9ae('0x35')],function(_0x190103){var _0x49aa0f={};_0x49aa0f[_0x190103]={'$like':'%'+_0x5419df[_0xa9ae('0x33')][_0xa9ae('0x42')]+'%'};return _0x49aa0f;})});}_0x3f99fe=_[_0xa9ae('0x40')]({},_0x3f99fe,_0x5419df[_0xa9ae('0x4b')]);return db['CmHopperFinal'][_0xa9ae('0x1f')]({'where':_0x3f99fe[_0xa9ae('0x3d')]})[_0xa9ae('0x25')](function(_0x67ffe6){_0x5ba185[_0xa9ae('0x1f')]=_0x67ffe6;if(_0x5419df[_0xa9ae('0x33')][_0xa9ae('0x4a')]){_0x3f99fe[_0xa9ae('0x44')]=[{'all':!![]}];}return db[_0xa9ae('0x61')][_0xa9ae('0x45')](_0x3f99fe);})[_0xa9ae('0x25')](function(_0xf3dba5){_0x5ba185[_0xa9ae('0x46')]=_0xf3dba5;return _0x5ba185;});}})[_0xa9ae('0x25')](respondWithFilteredResult(_0x313d29,_0x3f99fe))['catch'](handleError(_0x313d29,null));};exports[_0xa9ae('0x62')]=function(_0x20de54,_0x3086d5,_0x29e866){var _0x26dffe={'raw':!![],'where':{}};var _0x38aae6={};var _0x373b47={'count':0x0,'rows':[]};return db[_0xa9ae('0x43')][_0xa9ae('0x5b')]({'where':{'id':_0x20de54[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x3086d5,null))[_0xa9ae('0x25')](function(_0x413dae){if(_0x413dae){_0x38aae6[_0xa9ae('0x32')]=_['keys'](db[_0xa9ae('0x63')]['rawAttributes']);_0x38aae6[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x20de54[_0xa9ae('0x33')]);_0x38aae6[_0xa9ae('0x3e')]=_[_0xa9ae('0x36')](_0x38aae6[_0xa9ae('0x32')],_0x38aae6[_0xa9ae('0x33')]);_0x26dffe[_0xa9ae('0x35')]=_[_0xa9ae('0x36')](_0x38aae6[_0xa9ae('0x32')],qs[_0xa9ae('0x37')](_0x20de54['query']['fields']));_0x26dffe[_0xa9ae('0x35')]=_0x26dffe[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x26dffe[_0xa9ae('0x35')]:_0x38aae6['model'];if(!_0x20de54[_0xa9ae('0x33')]['hasOwnProperty'](_0xa9ae('0x3a'))){_0x26dffe[_0xa9ae('0x1e')]=qs[_0xa9ae('0x1e')](_0x20de54[_0xa9ae('0x33')]['limit']);_0x26dffe[_0xa9ae('0x1c')]=qs[_0xa9ae('0x1c')](_0x20de54['query']['offset']);}_0x26dffe[_0xa9ae('0x3b')]=qs[_0xa9ae('0x3c')](_0x20de54[_0xa9ae('0x33')][_0xa9ae('0x3c')]);_0x26dffe[_0xa9ae('0x3d')]=qs[_0xa9ae('0x3e')](_['pick'](_0x20de54[_0xa9ae('0x33')],_0x38aae6['filters']));_0x26dffe['where'][_0xa9ae('0x5c')]=_0x413dae['id'];if(_0x20de54[_0xa9ae('0x33')]['filter']){_0x26dffe[_0xa9ae('0x3d')]=_[_0xa9ae('0x40')](_0x26dffe[_0xa9ae('0x3d')],{'$or':_[_0xa9ae('0x2e')](_0x26dffe[_0xa9ae('0x35')],function(_0x27b236){var _0x36ac5f={};_0x36ac5f[_0x27b236]={'$like':'%'+_0x20de54[_0xa9ae('0x33')]['filter']+'%'};return _0x36ac5f;})});}_0x26dffe=_[_0xa9ae('0x40')]({},_0x26dffe,_0x20de54[_0xa9ae('0x4b')]);return db[_0xa9ae('0x63')][_0xa9ae('0x1f')]({'where':_0x26dffe[_0xa9ae('0x3d')]})[_0xa9ae('0x25')](function(_0x25d042){_0x373b47[_0xa9ae('0x1f')]=_0x25d042;if(_0x20de54[_0xa9ae('0x33')][_0xa9ae('0x4a')]){_0x26dffe[_0xa9ae('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa9ae('0x45')](_0x26dffe);})[_0xa9ae('0x25')](function(_0x55e443){_0x373b47[_0xa9ae('0x46')]=_0x55e443;return _0x373b47;});}})[_0xa9ae('0x25')](respondWithFilteredResult(_0x3086d5,_0x26dffe))[_0xa9ae('0x4d')](handleError(_0x3086d5,null));};exports[_0xa9ae('0x64')]=function(_0x16620f,_0xf21249,_0x202bed){var _0x1442bc={};var _0x340539={};var _0x58890d;var _0x2b2998;return db['Campaign']['findOne']({'where':{'id':_0x16620f[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0xf21249,null))[_0xa9ae('0x25')](function(_0xc61e93){if(_0xc61e93){_0x58890d=_0xc61e93;_0x340539['model']=_[_0xa9ae('0x34')](db[_0xa9ae('0x65')][_0xa9ae('0x49')]);_0x340539[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x16620f[_0xa9ae('0x33')]);_0x340539[_0xa9ae('0x3e')]=_['intersection'](_0x340539[_0xa9ae('0x32')],_0x340539['query']);_0x1442bc[_0xa9ae('0x35')]=_[_0xa9ae('0x36')](_0x340539[_0xa9ae('0x32')],qs[_0xa9ae('0x37')](_0x16620f['query'][_0xa9ae('0x37')]));_0x1442bc[_0xa9ae('0x35')]=_0x1442bc[_0xa9ae('0x35')][_0xa9ae('0x38')]?_0x1442bc[_0xa9ae('0x35')]:_0x340539['model'];_0x1442bc[_0xa9ae('0x3b')]=qs[_0xa9ae('0x3c')](_0x16620f[_0xa9ae('0x33')][_0xa9ae('0x3c')]);_0x1442bc[_0xa9ae('0x3d')]=qs[_0xa9ae('0x3e')](_['pick'](_0x16620f[_0xa9ae('0x33')],_0x340539['filters']));if(_0x16620f[_0xa9ae('0x33')][_0xa9ae('0x42')]){_0x1442bc[_0xa9ae('0x3d')]=_[_0xa9ae('0x40')](_0x1442bc[_0xa9ae('0x3d')],{'$or':_[_0xa9ae('0x2e')](_0x1442bc[_0xa9ae('0x35')],function(_0x2412e4){var _0x13a49b={};_0x13a49b[_0x2412e4]={'$like':'%'+_0x16620f[_0xa9ae('0x33')][_0xa9ae('0x42')]+'%'};return _0x13a49b;})});}_0x1442bc=_[_0xa9ae('0x40')]({},_0x1442bc,_0x16620f[_0xa9ae('0x4b')]);return _0x58890d[_0xa9ae('0x64')](_0x1442bc);}})['then'](function(_0x52b602){if(_0x52b602){_0x2b2998=_0x52b602[_0xa9ae('0x38')];if(!_0x16620f[_0xa9ae('0x33')][_0xa9ae('0x39')](_0xa9ae('0x3a'))){_0x1442bc['limit']=qs['limit'](_0x16620f[_0xa9ae('0x33')]['limit']);_0x1442bc['offset']=qs[_0xa9ae('0x1c')](_0x16620f[_0xa9ae('0x33')][_0xa9ae('0x1c')]);}return _0x58890d[_0xa9ae('0x64')](_0x1442bc);}})['then'](function(_0x5955a0){if(_0x5955a0){return _0x5955a0?{'count':_0x2b2998,'rows':_0x5955a0}:null;}})[_0xa9ae('0x25')](respondWithResult(_0xf21249,null))[_0xa9ae('0x4d')](handleError(_0xf21249,null));};exports[_0xa9ae('0x66')]=function(_0x400866,_0x3cba0f,_0xeaa645){var _0x44642c,_0x48cfbb;var _0x5bd28c=[];var _0x18f701=moment()[_0xa9ae('0x67')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa9ae('0x43')][_0xa9ae('0x4c')]({'where':{'id':_0x400866[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x3cba0f,null))[_0xa9ae('0x25')](function(_0x19d5c7){if(_0x19d5c7){_0x48cfbb=_0x19d5c7;return _0x19d5c7[_0xa9ae('0x66')](_0x400866[_0xa9ae('0x4f')]['ids'],_[_0xa9ae('0x57')](_0x400866['body'],[_0xa9ae('0x68'),'id'])||{});}return null;})[_0xa9ae('0x69')](function(_0x3b6368){var _0x37380f;var _0x3d50e1;_0x44642c=_0x3b6368||[];var _0x2c5f68=[];if(_0x3b6368){for(var _0x4309b4=0x0;_0x4309b4<_0x3b6368[_0xa9ae('0x38')];_0x4309b4+=0x1){var _0x47c40f=_0x3b6368[_0x4309b4][_0xa9ae('0x27')]({'plain':!![]});_0x48cfbb[_0xa9ae('0x6a')]=_0x400866[_0xa9ae('0x4f')][_0xa9ae('0x6a')]?_0x400866['body'][_0xa9ae('0x6a')]:_0x48cfbb[_0xa9ae('0x6a')];switch(_0x48cfbb[_0xa9ae('0x6a')]){case _0xa9ae('0x6b'):_0x37380f=squel[_0xa9ae('0x6c')]()[_0xa9ae('0x6d')](_0xa9ae('0x6e'))[_0xa9ae('0x6f')]([_0xa9ae('0x70'),_0xa9ae('0x71'),_0xa9ae('0x72'),_0xa9ae('0x73'),_0xa9ae('0x5c'),'createdAt',_0xa9ae('0x58')],squel[_0xa9ae('0x74')]()[_0xa9ae('0x75')](_0xa9ae('0x70'),'phone')[_0xa9ae('0x75')](_0xa9ae('0x76'),_0xa9ae('0x71'))[_0xa9ae('0x75')]('id','ContactId')['field'](_0x47c40f['CmListId']['toString'](),_0xa9ae('0x73'))[_0xa9ae('0x75')](_0x400866[_0xa9ae('0x48')]['id'][_0xa9ae('0x77')](),_0xa9ae('0x5c'))[_0xa9ae('0x75')]('\x27'+_0x18f701+'\x27',_0xa9ae('0x78'))[_0xa9ae('0x75')]('\x27'+_0x18f701+'\x27','updatedAt')[_0xa9ae('0x79')](_0xa9ae('0x7a'))['where'](_0xa9ae('0x7b'))[_0xa9ae('0x3d')](_0xa9ae('0x7c'),_0x47c40f[_0xa9ae('0x7d')][_0xa9ae('0x77')]())[_0xa9ae('0x3d')](_0xa9ae('0x7e'))[_0xa9ae('0x3d')](_0xa9ae('0x7f'),squel[_0xa9ae('0x74')]()[_0xa9ae('0x75')](_0xa9ae('0x80'))[_0xa9ae('0x79')](_0xa9ae('0x81'))['where'](_0xa9ae('0x82'),_0x400866[_0xa9ae('0x48')]['id'][_0xa9ae('0x77')]()))[_0xa9ae('0x3d')](_0xa9ae('0x7f'),squel[_0xa9ae('0x74')]()[_0xa9ae('0x75')](_0xa9ae('0x83'))[_0xa9ae('0x79')]('cm_hopper')['where'](_0xa9ae('0x82'),_0x400866[_0xa9ae('0x48')]['id'][_0xa9ae('0x77')]())))[_0xa9ae('0x77')]();break;case _0xa9ae('0x84'):_0x37380f=squel['insert']()[_0xa9ae('0x6d')](_0xa9ae('0x6e'))['fromQuery'](['phone',_0xa9ae('0x71'),_0xa9ae('0x72'),_0xa9ae('0x73'),_0xa9ae('0x5c'),_0xa9ae('0x78'),_0xa9ae('0x58')],squel['select']()[_0xa9ae('0x75')]('phone','phone')[_0xa9ae('0x75')](_0xa9ae('0x76'),'scheduledAt')[_0xa9ae('0x75')]('id',_0xa9ae('0x72'))[_0xa9ae('0x75')](_0x47c40f[_0xa9ae('0x7d')]['toString'](),_0xa9ae('0x73'))['field'](_0x400866['params']['id'][_0xa9ae('0x77')](),_0xa9ae('0x5c'))[_0xa9ae('0x75')]('\x27'+_0x18f701+'\x27',_0xa9ae('0x78'))[_0xa9ae('0x75')]('\x27'+_0x18f701+'\x27',_0xa9ae('0x58'))[_0xa9ae('0x79')](_0xa9ae('0x7a'))[_0xa9ae('0x3d')](_0xa9ae('0x7b'))['where'](_0xa9ae('0x7c'),_0x47c40f['CmListId'][_0xa9ae('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xa9ae('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa9ae('0x74')]()[_0xa9ae('0x75')](_0xa9ae('0x83'))['from'](_0xa9ae('0x6e'))[_0xa9ae('0x3d')](_0xa9ae('0x82'),_0x400866[_0xa9ae('0x48')]['id'][_0xa9ae('0x77')]())))[_0xa9ae('0x77')]();break;default:_0x37380f=squel[_0xa9ae('0x6c')]()['into'](_0xa9ae('0x6e'))['fromQuery'](['phone',_0xa9ae('0x71'),_0xa9ae('0x72'),'ListId','CampaignId',_0xa9ae('0x78'),_0xa9ae('0x58')],squel[_0xa9ae('0x74')]()[_0xa9ae('0x75')](_0xa9ae('0x70'),_0xa9ae('0x70'))[_0xa9ae('0x75')](_0xa9ae('0x76'),_0xa9ae('0x71'))[_0xa9ae('0x75')]('id','ContactId')[_0xa9ae('0x75')](_0x47c40f['CmListId']['toString'](),_0xa9ae('0x73'))['field'](_0x400866['params']['id'][_0xa9ae('0x77')](),_0xa9ae('0x5c'))[_0xa9ae('0x75')]('\x27'+_0x18f701+'\x27',_0xa9ae('0x78'))['field']('\x27'+_0x18f701+'\x27',_0xa9ae('0x58'))[_0xa9ae('0x79')](_0xa9ae('0x7a'))[_0xa9ae('0x3d')](_0xa9ae('0x7b'))[_0xa9ae('0x3d')](_0xa9ae('0x7c'),_0x47c40f[_0xa9ae('0x7d')][_0xa9ae('0x77')]())[_0xa9ae('0x3d')](_0xa9ae('0x7e')))[_0xa9ae('0x77')]();}_0x3d50e1=squel[_0xa9ae('0x6c')]()[_0xa9ae('0x6d')]('cm_hopper_additional_phones')[_0xa9ae('0x6f')](['cmHopperId','scheduledAt',_0xa9ae('0x70'),_0xa9ae('0x85'),_0xa9ae('0x78'),'updatedAt'],squel['select']()[_0xa9ae('0x75')]('h.id','id')['field']('NOW()',_0xa9ae('0x71'))[_0xa9ae('0x75')](_0xa9ae('0x86'),_0xa9ae('0x70'))[_0xa9ae('0x75')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x18f701+'\x27','createdAt')[_0xa9ae('0x75')]('\x27'+_0x18f701+'\x27',_0xa9ae('0x58'))[_0xa9ae('0x79')]('cm_contact_has_items','ci')[_0xa9ae('0x87')](_0xa9ae('0x6e'),'h',_0xa9ae('0x88'))[_0xa9ae('0x3d')]('h.ListId\x20=\x20?',_0x47c40f[_0xa9ae('0x7d')]['toString']())['where']('h.CampaignId=?',_0x400866[_0xa9ae('0x48')]['id'][_0xa9ae('0x77')]())['where'](_0xa9ae('0x89'),_0x18f701))[_0xa9ae('0x77')]();_0x2c5f68[_0xa9ae('0x8a')](db[_0xa9ae('0x8b')]['query'](_0x37380f));_0x5bd28c[_0xa9ae('0x8a')](db['sequelize']['query'](_0x3d50e1));}return BPromise['all'](_0x2c5f68);}})['then'](function(){return BPromise[_0xa9ae('0x8c')](_0x5bd28c);})[_0xa9ae('0x25')](function(){return _0x44642c;})[_0xa9ae('0x25')](respondWithResult(_0x3cba0f,null))['catch'](handleError(_0x3cba0f,null));};exports[_0xa9ae('0x8d')]=function(_0x207a7c,_0x3130ff,_0x45ef92){return db['Campaign']['find']({'where':{'id':_0x207a7c[_0xa9ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x3130ff,null))[_0xa9ae('0x25')](function(_0xd89b59){if(_0xd89b59){return _0xd89b59[_0xa9ae('0x8d')](_0x207a7c[_0xa9ae('0x33')][_0xa9ae('0x68')]);}})[_0xa9ae('0x25')](function(_0x17735f){if(_0x17735f){return db[_0xa9ae('0x5d')][_0xa9ae('0x26')]({'where':{'ListId':_0x207a7c[_0xa9ae('0x33')][_0xa9ae('0x68')],'CampaignId':_0x207a7c[_0xa9ae('0x48')]['id']}})['then'](function(){return _0x17735f;});}})[_0xa9ae('0x25')](respondWithStatusCode(_0x3130ff,null))[_0xa9ae('0x4d')](handleError(_0x3130ff,null));};exports[_0xa9ae('0x8e')]=function(_0x58a4be,_0x5964c8,_0x5336d4){var _0x4759e9={};var _0x38124b={};var _0x2059d3;var _0x1f8a85;return db[_0xa9ae('0x43')][_0xa9ae('0x5b')]({'where':{'id':_0x58a4be['params']['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x5964c8,null))[_0xa9ae('0x25')](function(_0x1ec537){if(_0x1ec537){_0x2059d3=_0x1ec537;_0x38124b['model']=_['keys'](db[_0xa9ae('0x65')]['rawAttributes']);_0x38124b[_0xa9ae('0x33')]=_[_0xa9ae('0x34')](_0x58a4be[_0xa9ae('0x33')]);_0x38124b['filters']=_[_0xa9ae('0x36')](_0x38124b[_0xa9ae('0x32')],_0x38124b[_0xa9ae('0x33')]);_0x4759e9['attributes']=_['intersection'](_0x38124b['model'],qs[_0xa9ae('0x37')](_0x58a4be[_0xa9ae('0x33')][_0xa9ae('0x37')]));_0x4759e9['attributes']=_0x4759e9['attributes'][_0xa9ae('0x38')]?_0x4759e9[_0xa9ae('0x35')]:_0x38124b[_0xa9ae('0x32')];_0x4759e9[_0xa9ae('0x3b')]=qs[_0xa9ae('0x3c')](_0x58a4be[_0xa9ae('0x33')][_0xa9ae('0x3c')]);_0x4759e9[_0xa9ae('0x3d')]=qs['filters'](_[_0xa9ae('0x3f')](_0x58a4be[_0xa9ae('0x33')],_0x38124b[_0xa9ae('0x3e')]));if(_0x58a4be['query'][_0xa9ae('0x42')]){_0x4759e9[_0xa9ae('0x3d')]=_[_0xa9ae('0x40')](_0x4759e9[_0xa9ae('0x3d')],{'$or':_[_0xa9ae('0x2e')](_0x4759e9['attributes'],function(_0x1475e4){var _0x43997d={};_0x43997d[_0x1475e4]={'$like':'%'+_0x58a4be[_0xa9ae('0x33')][_0xa9ae('0x42')]+'%'};return _0x43997d;})});}_0x4759e9=_[_0xa9ae('0x40')]({},_0x4759e9,_0x58a4be[_0xa9ae('0x4b')]);return _0x2059d3[_0xa9ae('0x8e')](_0x4759e9);}})[_0xa9ae('0x25')](function(_0x1661cf){if(_0x1661cf){_0x1f8a85=_0x1661cf['length'];if(!_0x58a4be[_0xa9ae('0x33')]['hasOwnProperty'](_0xa9ae('0x3a'))){_0x4759e9[_0xa9ae('0x1e')]=qs['limit'](_0x58a4be[_0xa9ae('0x33')]['limit']);_0x4759e9[_0xa9ae('0x1c')]=qs['offset'](_0x58a4be[_0xa9ae('0x33')][_0xa9ae('0x1c')]);}return _0x2059d3[_0xa9ae('0x8e')](_0x4759e9);}})[_0xa9ae('0x25')](function(_0x51bc86){if(_0x51bc86){return _0x51bc86?{'count':_0x1f8a85,'rows':_0x51bc86}:null;}})[_0xa9ae('0x25')](respondWithResult(_0x5964c8,null))[_0xa9ae('0x4d')](handleError(_0x5964c8,null));};exports[_0xa9ae('0x8f')]=function(_0x10523b,_0x59af8b,_0x671565){var _0x3541d3,_0x4b6590;var _0x2afe85=[];var _0x1c316c=moment()[_0xa9ae('0x67')](_0xa9ae('0x90'));return db[_0xa9ae('0x43')][_0xa9ae('0x4c')]({'where':{'id':_0x10523b['params']['id']}})[_0xa9ae('0x25')](handleEntityNotFound(_0x59af8b,null))[_0xa9ae('0x25')](function(_0x5b9a87){if(_0x5b9a87){_0x4b6590=_0x5b9a87;return _0x5b9a87[_0xa9ae('0x8f')](_0x10523b[_0xa9ae('0x4f')][_0xa9ae('0x68')],_[_0xa9ae('0x57')](_0x10523b[_0xa9ae('0x4f')],[_0xa9ae('0x68'),'id'])||{});}return null;})[_0xa9ae('0x69')](function(_0x45a1cf){var _0x3be6ae;var _0x22da4a;_0x3541d3=_0x45a1cf||[];var _0x2b8b0e=[];if(_0x45a1cf){for(var _0x339059=0x0;_0x339059<_0x45a1cf['length'];_0x339059+=0x1){var _0x2bcdbc=_0x45a1cf[_0x339059][_0xa9ae('0x27')]({'plain':!![]});_0x3be6ae=squel['insert']()[_0xa9ae('0x6d')](_0xa9ae('0x91'))[_0xa9ae('0x6f')]([_0xa9ae('0x70'),_0xa9ae('0x72'),_0xa9ae('0x73'),_0xa9ae('0x5c'),_0xa9ae('0x78'),_0xa9ae('0x58')],squel['select']()['field'](_0xa9ae('0x70'),_0xa9ae('0x70'))[_0xa9ae('0x75')]('id',_0xa9ae('0x72'))['field'](_0x2bcdbc[_0xa9ae('0x7d')][_0xa9ae('0x77')](),_0xa9ae('0x73'))[_0xa9ae('0x75')](_0x10523b[_0xa9ae('0x48')]['id']['toString'](),_0xa9ae('0x5c'))[_0xa9ae('0x75')](_0xa9ae('0x76'),_0xa9ae('0x78'))[_0xa9ae('0x75')](_0xa9ae('0x76'),'updatedAt')['from']('cm_contacts')['where'](_0xa9ae('0x7b'))['where'](_0xa9ae('0x7c'),_0x2bcdbc[_0xa9ae('0x7d')][_0xa9ae('0x77')]())[_0xa9ae('0x3d')](_0xa9ae('0x7e')))[_0xa9ae('0x77')]();_0x2b8b0e['push'](db[_0xa9ae('0x8b')]['query'](_0x3be6ae));}return BPromise[_0xa9ae('0x8c')](_0x2b8b0e);}})[_0xa9ae('0x25')](function(){return _0x3541d3;})['then'](respondWithResult(_0x59af8b,null))[_0xa9ae('0x4d')](handleError(_0x59af8b,null));};exports[_0xa9ae('0x92')]=function(_0x3db1fe,_0x224128,_0x9580dc){return db[_0xa9ae('0x43')][_0xa9ae('0x4c')]({'where':{'id':_0x3db1fe[_0xa9ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x224128,null))[_0xa9ae('0x25')](function(_0x2458ce){if(_0x2458ce){return _0x2458ce[_0xa9ae('0x92')](_0x3db1fe[_0xa9ae('0x33')][_0xa9ae('0x68')]);}})[_0xa9ae('0x25')](function(_0x1c4091){if(_0x1c4091){return db[_0xa9ae('0x63')][_0xa9ae('0x26')]({'where':{'ListId':_0x3db1fe[_0xa9ae('0x33')][_0xa9ae('0x68')],'CampaignId':_0x3db1fe[_0xa9ae('0x48')]['id']}})[_0xa9ae('0x25')](function(){return _0x1c4091;});}})['then'](respondWithStatusCode(_0x224128,null))[_0xa9ae('0x4d')](handleError(_0x224128,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_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
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x20c4a2,_0x83cf29){var _0x151d44=function(_0x3f2f36){while(--_0x3f2f36){_0x20c4a2['push'](_0x20c4a2['shift']());}};_0x151d44(++_0x83cf29);}(_0x7a54,0x106));var _0x47a5=function(_0x4d4c1e,_0x41aeb4){_0x4d4c1e=_0x4d4c1e-0x0;var _0xdce96e=_0x7a54[_0x4d4c1e];return _0xdce96e;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf3f=['stringify','lodash','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','Campaign','findAll','options','where','limit','include','map','model','attributes','GetCampaign','debug'];(function(_0x39dbc4,_0x29962c){var _0x4fd907=function(_0x1d1733){while(--_0x1d1733){_0x39dbc4['push'](_0x39dbc4['shift']());}};_0x4fd907(++_0x29962c);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfbf3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbf3('0x1'))['db'];var utils=require(_0xfbf3('0x2'));var logger=require(_0xfbf3('0x3'))('rpc');var config=require(_0xfbf3('0x4'));var jayson=require(_0xfbf3('0x5'));var client=jayson[_0xfbf3('0x6')][_0xfbf3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x218007,_0x154f23,_0x7bf395){return new BPromise(function(_0x58460f,_0x2c1143){return client[_0xfbf3('0x8')](_0x218007,_0x7bf395)[_0xfbf3('0x9')](function(_0xfed45a){logger[_0xfbf3('0xa')](_0xfbf3('0xb'),_0x154f23,_0xfbf3('0xc'));logger['debug'](_0xfbf3('0xd'),_0x154f23,_0xfbf3('0xc'),JSON['stringify'](_0xfed45a));if(_0xfed45a[_0xfbf3('0xe')]){if(_0xfed45a[_0xfbf3('0xe')][_0xfbf3('0xf')]===0x1f4){logger[_0xfbf3('0xe')]('Campaign,\x20%s,\x20%s',_0x154f23,_0xfed45a['error'][_0xfbf3('0x10')]);return _0x2c1143(_0xfed45a[_0xfbf3('0xe')][_0xfbf3('0x10')]);}logger[_0xfbf3('0xe')](_0xfbf3('0xb'),_0x154f23,_0xfed45a[_0xfbf3('0xe')][_0xfbf3('0x10')]);return _0x58460f(_0xfed45a[_0xfbf3('0xe')]['message']);}else{logger['info'](_0xfbf3('0xb'),_0x154f23,'request\x20sent');_0x58460f(_0xfed45a[_0xfbf3('0x11')][_0xfbf3('0x10')]);}})['catch'](function(_0x4118e4){logger[_0xfbf3('0xe')](_0xfbf3('0xb'),_0x154f23,_0x4118e4);_0x2c1143(_0x4118e4);});});}exports['GetCampaign']=function(_0x543b69){var _0x3936ee=this;return new Promise(function(_0x51af71,_0xbe46b6){return db[_0xfbf3('0x12')][_0xfbf3('0x13')]({'raw':_0x543b69[_0xfbf3('0x14')]?_0x543b69[_0xfbf3('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x543b69[_0xfbf3('0x14')]?_0x543b69[_0xfbf3('0x14')][_0xfbf3('0x15')]||null:null,'attributes':_0x543b69[_0xfbf3('0x14')]?_0x543b69[_0xfbf3('0x14')]['attributes']||null:null,'limit':_0x543b69['options']?_0x543b69['options'][_0xfbf3('0x16')]||null:null,'include':_0x543b69[_0xfbf3('0x14')]?_0x543b69['options'][_0xfbf3('0x17')]?_[_0xfbf3('0x18')](_0x543b69['options']['include'],function(_0x4f8175){return{'model':db[_0x4f8175[_0xfbf3('0x19')]],'as':_0x4f8175['as'],'attributes':_0x4f8175[_0xfbf3('0x1a')],'include':_0x4f8175[_0xfbf3('0x17')]?_['map'](_0x4f8175['include'],function(_0xf72528){return{'model':db[_0xf72528[_0xfbf3('0x19')]],'as':_0xf72528['as'],'attributes':_0xf72528[_0xfbf3('0x1a')],'include':_0xf72528['include']?_['map'](_0xf72528[_0xfbf3('0x17')],function(_0x5d6a07){return{'model':db[_0x5d6a07[_0xfbf3('0x19')]],'as':_0x5d6a07['as'],'attributes':_0x5d6a07[_0xfbf3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfbf3('0x9')](function(_0x368968){logger['info'](_0xfbf3('0x1b'),_0x543b69);logger[_0xfbf3('0x1c')](_0xfbf3('0x1b'),_0x543b69,JSON[_0xfbf3('0x1d')](_0x368968));_0x51af71(_0x368968);})['catch'](function(_0x2315ba){logger[_0xfbf3('0xe')](_0xfbf3('0x1b'),_0x2315ba[_0xfbf3('0x10')],_0x543b69);_0xbe46b6(_0x3936ee[_0xfbf3('0xe')](0x1f4,_0x2315ba[_0xfbf3('0x10')]));});});};
\ No newline at end of file
+var _0x2bbb=['GetCampaign','Campaign','findAll','options','where','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2d885a,_0x6a5ccf){var _0x125c8a=function(_0x3067d6){while(--_0x3067d6){_0x2d885a['push'](_0x2d885a['shift']());}};_0x125c8a(++_0x6a5ccf);}(_0x2bbb,0x85));var _0xb2bb=function(_0x1c7778,_0x44018f){_0x1c7778=_0x1c7778-0x0;var _0x1ed080=_0x2bbb[_0x1c7778];return _0x1ed080;};'use strict';var _=require('lodash');var util=require(_0xb2bb('0x0'));var moment=require(_0xb2bb('0x1'));var BPromise=require(_0xb2bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2bb('0x3'));var db=require(_0xb2bb('0x4'))['db'];var utils=require(_0xb2bb('0x5'));var logger=require(_0xb2bb('0x6'))(_0xb2bb('0x7'));var config=require(_0xb2bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb2bb('0x9')][_0xb2bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53b48f,_0x12357d,_0x248f27){return new BPromise(function(_0x1738d9,_0x230064){return client['request'](_0x53b48f,_0x248f27)[_0xb2bb('0xb')](function(_0x4c6152){logger[_0xb2bb('0xc')](_0xb2bb('0xd'),_0x12357d,_0xb2bb('0xe'));logger[_0xb2bb('0xf')](_0xb2bb('0x10'),_0x12357d,'request\x20sent',JSON[_0xb2bb('0x11')](_0x4c6152));if(_0x4c6152['error']){if(_0x4c6152[_0xb2bb('0x12')][_0xb2bb('0x13')]===0x1f4){logger[_0xb2bb('0x12')](_0xb2bb('0xd'),_0x12357d,_0x4c6152[_0xb2bb('0x12')][_0xb2bb('0x14')]);return _0x230064(_0x4c6152['error'][_0xb2bb('0x14')]);}logger[_0xb2bb('0x12')](_0xb2bb('0xd'),_0x12357d,_0x4c6152[_0xb2bb('0x12')]['message']);return _0x1738d9(_0x4c6152[_0xb2bb('0x12')][_0xb2bb('0x14')]);}else{logger[_0xb2bb('0xc')](_0xb2bb('0xd'),_0x12357d,_0xb2bb('0xe'));_0x1738d9(_0x4c6152['result'][_0xb2bb('0x14')]);}})[_0xb2bb('0x15')](function(_0xa9bbcd){logger[_0xb2bb('0x12')](_0xb2bb('0xd'),_0x12357d,_0xa9bbcd);_0x230064(_0xa9bbcd);});});}exports[_0xb2bb('0x16')]=function(_0x35c4de){var _0xa4aa74=this;return new Promise(function(_0x8d2033,_0x1b241f){return db[_0xb2bb('0x17')][_0xb2bb('0x18')]({'raw':_0x35c4de['options']?_0x35c4de[_0xb2bb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35c4de[_0xb2bb('0x19')]?_0x35c4de['options'][_0xb2bb('0x1a')]||null:null,'attributes':_0x35c4de[_0xb2bb('0x19')]?_0x35c4de['options'][_0xb2bb('0x1b')]||null:null,'limit':_0x35c4de[_0xb2bb('0x19')]?_0x35c4de['options']['limit']||null:null,'include':_0x35c4de['options']?_0x35c4de[_0xb2bb('0x19')][_0xb2bb('0x1c')]?_[_0xb2bb('0x1d')](_0x35c4de['options'][_0xb2bb('0x1c')],function(_0x2b1f94){return{'model':db[_0x2b1f94[_0xb2bb('0x1e')]],'as':_0x2b1f94['as'],'attributes':_0x2b1f94['attributes'],'include':_0x2b1f94[_0xb2bb('0x1c')]?_[_0xb2bb('0x1d')](_0x2b1f94[_0xb2bb('0x1c')],function(_0x14aba5){return{'model':db[_0x14aba5['model']],'as':_0x14aba5['as'],'attributes':_0x14aba5[_0xb2bb('0x1b')],'include':_0x14aba5[_0xb2bb('0x1c')]?_[_0xb2bb('0x1d')](_0x14aba5['include'],function(_0xa09168){return{'model':db[_0xa09168[_0xb2bb('0x1e')]],'as':_0xa09168['as'],'attributes':_0xa09168[_0xb2bb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb2bb('0xb')](function(_0x149ab2){logger[_0xb2bb('0xc')]('GetCampaign',_0x35c4de);logger[_0xb2bb('0xf')]('GetCampaign',_0x35c4de,JSON[_0xb2bb('0x11')](_0x149ab2));_0x8d2033(_0x149ab2);})['catch'](function(_0x3d82c8){logger[_0xb2bb('0x12')]('GetCampaign',_0x3d82c8[_0xb2bb('0x14')],_0x35c4de);_0x1b241f(_0xa4aa74['error'](0x1f4,_0x3d82c8[_0xb2bb('0x14')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x455f=['getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists'];(function(_0x2b498e,_0x1c3b10){var _0x2d7560=function(_0x45170d){while(--_0x45170d){_0x2b498e['push'](_0x2b498e['shift']());}};_0x2d7560(++_0x1c3b10);}(_0x455f,0x118));var _0xf455=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x455f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf455('0x0'));var util=require(_0xf455('0x1'));var path=require(_0xf455('0x2'));var timeout=require(_0xf455('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf455('0x4'));var auth=require(_0xf455('0x5'));var interaction=require(_0xf455('0x6'));var config=require('../../config/environment');var controller=require(_0xf455('0x7'));router[_0xf455('0x8')]('/',auth[_0xf455('0x9')](),controller[_0xf455('0xa')]);router[_0xf455('0x8')]('/:id',auth[_0xf455('0x9')](),controller[_0xf455('0xb')]);router[_0xf455('0x8')](_0xf455('0xc'),auth[_0xf455('0x9')](),controller['getHoppers']);router[_0xf455('0x8')]('/:id/hopper_histories',auth[_0xf455('0x9')](),controller[_0xf455('0xd')]);router[_0xf455('0x8')](_0xf455('0xe'),auth[_0xf455('0x9')](),controller['getHopperFinals']);router[_0xf455('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xf455('0xf')]);router[_0xf455('0x8')](_0xf455('0x10'),auth[_0xf455('0x9')](),controller[_0xf455('0x11')]);router[_0xf455('0x8')](_0xf455('0x12'),auth['isAuthenticated'](),controller[_0xf455('0x13')]);router[_0xf455('0x14')]('/',auth[_0xf455('0x9')](),controller[_0xf455('0x15')]);router['post'](_0xf455('0x16'),auth['isAuthenticated'](),controller[_0xf455('0x17')]);router[_0xf455('0x14')](_0xf455('0x10'),auth[_0xf455('0x9')](),controller[_0xf455('0x18')]);router[_0xf455('0x14')](_0xf455('0x12'),auth[_0xf455('0x9')](),controller[_0xf455('0x19')]);router[_0xf455('0x1a')](_0xf455('0x1b'),auth[_0xf455('0x9')](),controller[_0xf455('0x1c')]);router[_0xf455('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xf455('0x1e')]);router[_0xf455('0x1d')](_0xf455('0x10'),auth[_0xf455('0x9')](),controller[_0xf455('0x1f')]);router[_0xf455('0x1d')](_0xf455('0x12'),auth['isAuthenticated'](),controller[_0xf455('0x20')]);module['exports']=router;
\ No newline at end of file
+var _0x88b4=['/:id/lists','/:id/blacklists','getBlackLists','create','clone','post','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x254fc1,_0x4fb866){var _0x535591=function(_0x4381fd){while(--_0x4381fd){_0x254fc1['push'](_0x254fc1['shift']());}};_0x535591(++_0x4fb866);}(_0x88b4,0xa8));var _0x488b=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x88b4[_0x595604];return _0x1466f3;};'use strict';var multer=require(_0x488b('0x0'));var util=require(_0x488b('0x1'));var path=require(_0x488b('0x2'));var timeout=require('connect-timeout');var express=require(_0x488b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x488b('0x4'));var interaction=require(_0x488b('0x5'));var config=require(_0x488b('0x6'));var controller=require(_0x488b('0x7'));router[_0x488b('0x8')]('/',auth[_0x488b('0x9')](),controller[_0x488b('0xa')]);router[_0x488b('0x8')](_0x488b('0xb'),auth[_0x488b('0x9')](),controller[_0x488b('0xc')]);router['get']('/:id/hoppers',auth[_0x488b('0x9')](),controller['getHoppers']);router['get'](_0x488b('0xd'),auth[_0x488b('0x9')](),controller['getHopperHistories']);router[_0x488b('0x8')](_0x488b('0xe'),auth[_0x488b('0x9')](),controller[_0x488b('0xf')]);router[_0x488b('0x8')](_0x488b('0x10'),auth[_0x488b('0x9')](),controller[_0x488b('0x11')]);router[_0x488b('0x8')](_0x488b('0x12'),auth[_0x488b('0x9')](),controller['getLists']);router[_0x488b('0x8')](_0x488b('0x13'),auth[_0x488b('0x9')](),controller[_0x488b('0x14')]);router['post']('/',auth[_0x488b('0x9')](),controller[_0x488b('0x15')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x488b('0x16')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x488b('0x17')](_0x488b('0x13'),auth[_0x488b('0x9')](),controller[_0x488b('0x18')]);router[_0x488b('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x488b('0x1a')]);router[_0x488b('0x1b')]('/:id',auth[_0x488b('0x9')](),controller[_0x488b('0x1c')]);router[_0x488b('0x1b')](_0x488b('0x12'),auth[_0x488b('0x9')](),controller['removeLists']);router[_0x488b('0x1b')]('/:id/blacklists',auth[_0x488b('0x9')](),controller[_0x488b('0x1d')]);module[_0x488b('0x1e')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd052=['VIRTUAL','exports','TEXT','medium'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd052,0x139));var _0x2d05=function(_0xd0b573,_0x3cbc25){_0xd0b573=_0xd0b573-0x0;var _0x1d31e0=_0xd052[_0xd0b573];return _0x1d31e0;};'use strict';var Sequelize=require('sequelize');module[_0x2d05('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2d05('0x1')],'length':_0x2d05('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2d05('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0xe8a3=['STRING','TEXT','medium','getDataValue','key','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe8a3,0x113));var _0x3e8a=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0xe8a3[_0x4a563b];return _0x2935ef;};'use strict';var Sequelize=require(_0x3e8a('0x0'));module['exports']={'key':{'type':Sequelize[_0x3e8a('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3e8a('0x2')],'length':_0x3e8a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3e8a('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3e8a('0x4')](_0x3e8a('0x5'));}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29c8=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','end','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','body'];(function(_0x4a7f48,_0x142979){var _0x1e1b80=function(_0xcfcfde){while(--_0xcfcfde){_0x4a7f48['push'](_0x4a7f48['shift']());}};_0x1e1b80(++_0x142979);}(_0x29c8,0x120));var _0x829c=function(_0x1388c9,_0x911c0d){_0x1388c9=_0x1388c9-0x0;var _0x4ccef0=_0x29c8[_0x1388c9];return _0x4ccef0;};'use strict';var emlformat=require(_0x829c('0x0'));var rimraf=require(_0x829c('0x1'));var zipdir=require(_0x829c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x829c('0x3'));var moment=require(_0x829c('0x4'));var BPromise=require(_0x829c('0x5'));var Mustache=require(_0x829c('0x6'));var util=require(_0x829c('0x7'));var path=require(_0x829c('0x8'));var sox=require(_0x829c('0x9'));var csv=require(_0x829c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x829c('0xb'));var squel=require('squel');var crypto=require(_0x829c('0xc'));var jsforce=require(_0x829c('0xd'));var deskjs=require(_0x829c('0xe'));var toCsv=require(_0x829c('0xa'));var querystring=require(_0x829c('0xf'));var Papa=require(_0x829c('0x10'));var Redis=require(_0x829c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x829c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x829c('0x13'))(_0x829c('0x14'));var utils=require(_0x829c('0x15'));var config=require(_0x829c('0x16'));var licenseUtil=require(_0x829c('0x17'));var db=require(_0x829c('0x18'))['db'];function respondWithStatusCode(_0x11a019,_0x124c61){_0x124c61=_0x124c61||0xcc;return function(_0x58d73f){if(_0x58d73f){return _0x11a019[_0x829c('0x19')](_0x124c61);}return _0x11a019[_0x829c('0x1a')](_0x124c61)['end']();};}function respondWithResult(_0x2eb32e,_0x5acb9f){_0x5acb9f=_0x5acb9f||0xc8;return function(_0x53d534){if(_0x53d534){return _0x2eb32e[_0x829c('0x1a')](_0x5acb9f)[_0x829c('0x1b')](_0x53d534);}};}function respondWithFilteredResult(_0x2c60e0,_0x3d9e03){return function(_0x243dc1){if(_0x243dc1){var _0x8211a9=typeof _0x3d9e03['offset']===_0x829c('0x1c')&&typeof _0x3d9e03[_0x829c('0x1d')]===_0x829c('0x1c');var _0x4458ec=_0x243dc1[_0x829c('0x1e')];var _0x31b727=_0x8211a9?0x0:_0x3d9e03[_0x829c('0x1f')];var _0x3e3994=_0x8211a9?_0x243dc1[_0x829c('0x1e')]:_0x3d9e03[_0x829c('0x1f')]+_0x3d9e03['limit'];var _0x3576f3;if(_0x3e3994>=_0x4458ec){_0x3e3994=_0x4458ec;_0x3576f3=0xc8;}else{_0x3576f3=0xce;}_0x2c60e0['status'](_0x3576f3);return _0x2c60e0[_0x829c('0x20')](_0x829c('0x21'),_0x31b727+'-'+_0x3e3994+'/'+_0x4458ec)[_0x829c('0x1b')](_0x243dc1);}return null;};}function patchUpdates(_0x38a2b2){return function(_0x264909){try{jsonpatch[_0x829c('0x22')](_0x264909,_0x38a2b2,!![]);}catch(_0x152f7a){return BPromise['reject'](_0x152f7a);}return _0x264909[_0x829c('0x23')]();};}function saveUpdates(_0x4a727d,_0x3654e8){return function(_0x25bb50){if(_0x25bb50){return _0x25bb50[_0x829c('0x24')](_0x4a727d)[_0x829c('0x25')](function(_0x596baa){return _0x596baa;});}return null;};}function removeEntity(_0x2a04c3,_0x22663c){return function(_0x50f274){if(_0x50f274){return _0x50f274[_0x829c('0x26')]()['then'](function(){var _0x3d2533=_0x50f274['get']({'plain':!![]});var _0x22de81=_0x829c('0x27');return db[_0x829c('0x28')]['destroy']({'where':{'type':_0x22de81,'resourceId':_0x3d2533['id']}})[_0x829c('0x25')](function(){return _0x50f274;});})[_0x829c('0x25')](function(){_0x2a04c3['status'](0xcc)[_0x829c('0x29')]();});}};}function handleEntityNotFound(_0x43f598,_0x222bc9){return function(_0x1d0744){if(!_0x1d0744){_0x43f598[_0x829c('0x19')](0x194);}return _0x1d0744;};}function handleError(_0x264a1e,_0x76e71e){_0x76e71e=_0x76e71e||0x1f4;return function(_0x388547){logger['error'](_0x388547[_0x829c('0x2a')]);if(_0x388547[_0x829c('0x2b')]){delete _0x388547['name'];}_0x264a1e[_0x829c('0x1a')](_0x76e71e)[_0x829c('0x2c')](_0x388547);};}exports[_0x829c('0x2d')]=function(_0xea1565,_0x465ebd){var _0x471200={},_0x425964={},_0xad08f={'count':0x0,'rows':[]};var _0x155747=_[_0x829c('0x2e')](db[_0x829c('0x2f')][_0x829c('0x30')],function(_0x209548){return{'name':_0x209548['fieldName'],'type':_0x209548[_0x829c('0x31')][_0x829c('0x32')]};});_0x425964[_0x829c('0x33')]=_[_0x829c('0x2e')](_0x155747,'name');_0x425964[_0x829c('0x34')]=_[_0x829c('0x35')](_0xea1565['query']);_0x425964[_0x829c('0x36')]=_[_0x829c('0x37')](_0x425964[_0x829c('0x33')],_0x425964[_0x829c('0x34')]);_0x471200[_0x829c('0x38')]=_['intersection'](_0x425964[_0x829c('0x33')],qs[_0x829c('0x39')](_0xea1565[_0x829c('0x34')][_0x829c('0x39')]));_0x471200[_0x829c('0x38')]=_0x471200['attributes'][_0x829c('0x3a')]?_0x471200[_0x829c('0x38')]:_0x425964[_0x829c('0x33')];if(!_0xea1565['query'][_0x829c('0x3b')](_0x829c('0x3c'))){_0x471200['limit']=qs[_0x829c('0x1d')](_0xea1565['query'][_0x829c('0x1d')]);_0x471200[_0x829c('0x1f')]=qs[_0x829c('0x1f')](_0xea1565[_0x829c('0x34')][_0x829c('0x1f')]);}_0x471200[_0x829c('0x3d')]=qs[_0x829c('0x3e')](_0xea1565[_0x829c('0x34')][_0x829c('0x3e')]);_0x471200['where']=qs[_0x829c('0x36')](_[_0x829c('0x3f')](_0xea1565[_0x829c('0x34')],_0x425964[_0x829c('0x36')]),_0x155747);if(_0xea1565[_0x829c('0x34')][_0x829c('0x40')]){_0x471200[_0x829c('0x41')]=_[_0x829c('0x42')](_0x471200['where'],{'$or':[{'key':{'$like':'%'+_0xea1565[_0x829c('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0xea1565[_0x829c('0x34')][_0x829c('0x40')]+'%'}}]});}_0x471200=_[_0x829c('0x42')]({},_0x471200,_0xea1565[_0x829c('0x43')]);var _0x594b3e={'where':_0x471200[_0x829c('0x41')]};return db[_0x829c('0x2f')][_0x829c('0x1e')](_0x594b3e)['then'](function(_0x4ec086){_0xad08f[_0x829c('0x1e')]=_0x4ec086;if(_0xea1565[_0x829c('0x34')][_0x829c('0x44')]){_0x471200[_0x829c('0x45')]=[{'all':!![]}];}return db[_0x829c('0x2f')][_0x829c('0x46')](_0x471200);})[_0x829c('0x25')](function(_0x32f87b){_0xad08f[_0x829c('0x47')]=_0x32f87b;return _0xad08f;})[_0x829c('0x25')](respondWithFilteredResult(_0x465ebd,_0x471200))[_0x829c('0x48')](handleError(_0x465ebd,null));};exports['show']=function(_0x1b6524,_0xe60a){var _0x3f1698={'raw':!![],'where':{'id':_0x1b6524[_0x829c('0x49')]['id']}},_0x23c407={};_0x23c407['model']=_[_0x829c('0x35')](db[_0x829c('0x2f')][_0x829c('0x30')]);_0x23c407[_0x829c('0x34')]=_['keys'](_0x1b6524[_0x829c('0x34')]);_0x23c407['filters']=_['intersection'](_0x23c407[_0x829c('0x33')],_0x23c407[_0x829c('0x34')]);_0x3f1698[_0x829c('0x38')]=_[_0x829c('0x37')](_0x23c407[_0x829c('0x33')],qs[_0x829c('0x39')](_0x1b6524[_0x829c('0x34')]['fields']));_0x3f1698[_0x829c('0x38')]=_0x3f1698['attributes']['length']?_0x3f1698[_0x829c('0x38')]:_0x23c407[_0x829c('0x33')];if(_0x1b6524['query'][_0x829c('0x44')]){_0x3f1698[_0x829c('0x45')]=[{'all':!![]}];}_0x3f1698=_['merge']({},_0x3f1698,_0x1b6524[_0x829c('0x43')]);return db['CannedAnswer'][_0x829c('0x4a')](_0x3f1698)[_0x829c('0x25')](handleEntityNotFound(_0xe60a,null))[_0x829c('0x25')](respondWithResult(_0xe60a,null))['catch'](handleError(_0xe60a,null));};exports[_0x829c('0x24')]=function(_0xde80a2,_0x273275){if(_0xde80a2[_0x829c('0x4b')]['id']){delete _0xde80a2['body']['id'];}return db['CannedAnswer'][_0x829c('0x4a')]({'where':{'id':_0xde80a2[_0x829c('0x49')]['id']}})[_0x829c('0x25')](handleEntityNotFound(_0x273275,null))[_0x829c('0x25')](saveUpdates(_0xde80a2[_0x829c('0x4b')],null))[_0x829c('0x25')](respondWithResult(_0x273275,null))[_0x829c('0x48')](handleError(_0x273275,null));};exports['destroy']=function(_0x24240b,_0x33673e){return db['CannedAnswer'][_0x829c('0x4a')]({'where':{'id':_0x24240b['params']['id']}})[_0x829c('0x25')](handleEntityNotFound(_0x33673e,null))[_0x829c('0x25')](removeEntity(_0x33673e,null))['catch'](handleError(_0x33673e,null));};exports[_0x829c('0x4c')]=function(_0x542909,_0x119929){var _0xdd24c9={'key':_0x542909['body'][_0x829c('0x32')]};if(_0x542909[_0x829c('0x4b')][_0x829c('0x4d')]){_0xdd24c9[_0x829c('0x4d')]=_0x542909[_0x829c('0x4b')][_0x829c('0x4d')];}else if(_0x542909[_0x829c('0x4b')][_0x829c('0x4e')]){_0xdd24c9[_0x829c('0x4e')]=_0x542909['body'][_0x829c('0x4e')];}else if(_0x542909['body'][_0x829c('0x4f')]){_0xdd24c9[_0x829c('0x4f')]=_0x542909['body'][_0x829c('0x4f')];}else if(_0x542909[_0x829c('0x4b')][_0x829c('0x50')]){_0xdd24c9[_0x829c('0x50')]=_0x542909[_0x829c('0x4b')][_0x829c('0x50')];}return db['CannedAnswer']['find']({'where':_0xdd24c9})[_0x829c('0x25')](function(_0x536210){if(_0x536210){throw new db['Sequelize'][(_0x829c('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x829c('0x2f')]['create'](_0x542909[_0x829c('0x4b')]);})['then'](function(_0x5ea117){var _0xa13af1=_0x542909[_0x829c('0x52')][_0x829c('0x53')]({'plain':!![]});if(!_0xa13af1)throw new Error(_0x829c('0x54'));if(_0xa13af1[_0x829c('0x55')]==='user'){var _0x279a09=_0x5ea117[_0x829c('0x53')]({'plain':!![]});return db[_0x829c('0x56')][_0x829c('0x4a')]({'where':{'name':'CannedAnswers','userProfileId':_0xa13af1[_0x829c('0x57')]},'raw':!![]})[_0x829c('0x25')](function(_0x3da605){if(_0x3da605&&_0x3da605[_0x829c('0x58')]===0x0){return db[_0x829c('0x28')][_0x829c('0x4c')]({'name':_0x279a09[_0x829c('0x2b')],'resourceId':_0x279a09['id'],'type':_0x3da605[_0x829c('0x2b')],'sectionId':_0x3da605['id']},{})[_0x829c('0x25')](function(){return _0x5ea117;});}else{return _0x5ea117;}})[_0x829c('0x48')](function(_0x4b60b2){logger[_0x829c('0x59')](_0x829c('0x5a'),_0x4b60b2);throw _0x4b60b2;});}return _0x5ea117;})['then'](respondWithResult(_0x119929,0xc9))[_0x829c('0x48')](handleError(_0x119929,null));};
\ No newline at end of file
+var _0x83bc=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','CannedAnswer','findAll','rows','catch','params','include','body','find','MailAccountId'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x83bc,0x114));var _0xc83b=function(_0x591a4a,_0x395edc){_0x591a4a=_0x591a4a-0x0;var _0x339989=_0x83bc[_0x591a4a];return _0x339989;};'use strict';var emlformat=require(_0xc83b('0x0'));var rimraf=require(_0xc83b('0x1'));var zipdir=require(_0xc83b('0x2'));var jsonpatch=require(_0xc83b('0x3'));var rp=require(_0xc83b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc83b('0x5'));var util=require(_0xc83b('0x6'));var path=require('path');var sox=require(_0xc83b('0x7'));var csv=require(_0xc83b('0x8'));var ejs=require(_0xc83b('0x9'));var fs=require('fs');var fs_extra=require(_0xc83b('0xa'));var _=require('lodash');var squel=require(_0xc83b('0xb'));var crypto=require('crypto');var jsforce=require(_0xc83b('0xc'));var deskjs=require(_0xc83b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc83b('0xe'));var Papa=require(_0xc83b('0xf'));var Redis=require('ioredis');var authService=require(_0xc83b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc83b('0x11'));var logger=require(_0xc83b('0x12'))(_0xc83b('0x13'));var utils=require(_0xc83b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc83b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51816e,_0x4c1b6e){_0x4c1b6e=_0x4c1b6e||0xcc;return function(_0x56cc86){if(_0x56cc86){return _0x51816e[_0xc83b('0x16')](_0x4c1b6e);}return _0x51816e[_0xc83b('0x17')](_0x4c1b6e)[_0xc83b('0x18')]();};}function respondWithResult(_0x4653f2,_0x34448a){_0x34448a=_0x34448a||0xc8;return function(_0xae878f){if(_0xae878f){return _0x4653f2[_0xc83b('0x17')](_0x34448a)[_0xc83b('0x19')](_0xae878f);}};}function respondWithFilteredResult(_0x1473aa,_0x1acbc6){return function(_0x4ae346){if(_0x4ae346){var _0x2bd41f=typeof _0x1acbc6[_0xc83b('0x1a')]===_0xc83b('0x1b')&&typeof _0x1acbc6['limit']===_0xc83b('0x1b');var _0x2e0ce8=_0x4ae346[_0xc83b('0x1c')];var _0x559e51=_0x2bd41f?0x0:_0x1acbc6[_0xc83b('0x1a')];var _0x2fb7ce=_0x2bd41f?_0x4ae346[_0xc83b('0x1c')]:_0x1acbc6[_0xc83b('0x1a')]+_0x1acbc6[_0xc83b('0x1d')];var _0x1df9b0;if(_0x2fb7ce>=_0x2e0ce8){_0x2fb7ce=_0x2e0ce8;_0x1df9b0=0xc8;}else{_0x1df9b0=0xce;}_0x1473aa[_0xc83b('0x17')](_0x1df9b0);return _0x1473aa[_0xc83b('0x1e')](_0xc83b('0x1f'),_0x559e51+'-'+_0x2fb7ce+'/'+_0x2e0ce8)[_0xc83b('0x19')](_0x4ae346);}return null;};}function patchUpdates(_0x29528a){return function(_0x330053){try{jsonpatch[_0xc83b('0x20')](_0x330053,_0x29528a,!![]);}catch(_0xd780a){return BPromise[_0xc83b('0x21')](_0xd780a);}return _0x330053[_0xc83b('0x22')]();};}function saveUpdates(_0x308595,_0x4d73b0){return function(_0x2f7b7c){if(_0x2f7b7c){return _0x2f7b7c[_0xc83b('0x23')](_0x308595)[_0xc83b('0x24')](function(_0x139b06){return _0x139b06;});}return null;};}function removeEntity(_0x112c63,_0x1dc41d){return function(_0x775513){if(_0x775513){return _0x775513[_0xc83b('0x25')]()[_0xc83b('0x24')](function(){var _0xc2e528=_0x775513['get']({'plain':!![]});var _0x3e6a00=_0xc83b('0x26');return db[_0xc83b('0x27')][_0xc83b('0x25')]({'where':{'type':_0x3e6a00,'resourceId':_0xc2e528['id']}})[_0xc83b('0x24')](function(){return _0x775513;});})[_0xc83b('0x24')](function(){_0x112c63[_0xc83b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed660,_0x332d8a){return function(_0x779de){if(!_0x779de){_0x1ed660['sendStatus'](0x194);}return _0x779de;};}function handleError(_0x5553c7,_0x461610){_0x461610=_0x461610||0x1f4;return function(_0x64c1a8){logger[_0xc83b('0x28')](_0x64c1a8[_0xc83b('0x29')]);if(_0x64c1a8['name']){delete _0x64c1a8['name'];}_0x5553c7[_0xc83b('0x17')](_0x461610)[_0xc83b('0x2a')](_0x64c1a8);};}exports['index']=function(_0x5cb773,_0x33bfbe){var _0x551ebd={},_0x33cc50={},_0x5e3dff={'count':0x0,'rows':[]};var _0xd6153a=_[_0xc83b('0x2b')](db['CannedAnswer'][_0xc83b('0x2c')],function(_0x5b6d16){return{'name':_0x5b6d16[_0xc83b('0x2d')],'type':_0x5b6d16[_0xc83b('0x2e')][_0xc83b('0x2f')]};});_0x33cc50['model']=_['map'](_0xd6153a,'name');_0x33cc50[_0xc83b('0x30')]=_[_0xc83b('0x31')](_0x5cb773[_0xc83b('0x30')]);_0x33cc50[_0xc83b('0x32')]=_[_0xc83b('0x33')](_0x33cc50[_0xc83b('0x34')],_0x33cc50[_0xc83b('0x30')]);_0x551ebd[_0xc83b('0x35')]=_['intersection'](_0x33cc50[_0xc83b('0x34')],qs['fields'](_0x5cb773['query'][_0xc83b('0x36')]));_0x551ebd[_0xc83b('0x35')]=_0x551ebd[_0xc83b('0x35')][_0xc83b('0x37')]?_0x551ebd['attributes']:_0x33cc50['model'];if(!_0x5cb773['query'][_0xc83b('0x38')]('nolimit')){_0x551ebd[_0xc83b('0x1d')]=qs['limit'](_0x5cb773[_0xc83b('0x30')][_0xc83b('0x1d')]);_0x551ebd[_0xc83b('0x1a')]=qs[_0xc83b('0x1a')](_0x5cb773['query'][_0xc83b('0x1a')]);}_0x551ebd[_0xc83b('0x39')]=qs[_0xc83b('0x3a')](_0x5cb773['query'][_0xc83b('0x3a')]);_0x551ebd[_0xc83b('0x3b')]=qs[_0xc83b('0x32')](_[_0xc83b('0x3c')](_0x5cb773[_0xc83b('0x30')],_0x33cc50['filters']),_0xd6153a);if(_0x5cb773[_0xc83b('0x30')][_0xc83b('0x3d')]){_0x551ebd[_0xc83b('0x3b')]=_[_0xc83b('0x3e')](_0x551ebd[_0xc83b('0x3b')],{'$or':[{'key':{'$like':'%'+_0x5cb773[_0xc83b('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x5cb773[_0xc83b('0x30')][_0xc83b('0x3d')]+'%'}}]});}_0x551ebd=_[_0xc83b('0x3e')]({},_0x551ebd,_0x5cb773['options']);var _0x1698fe={'where':_0x551ebd['where']};return db[_0xc83b('0x3f')][_0xc83b('0x1c')](_0x1698fe)[_0xc83b('0x24')](function(_0x15666b){_0x5e3dff['count']=_0x15666b;if(_0x5cb773['query']['includeAll']){_0x551ebd['include']=[{'all':!![]}];}return db[_0xc83b('0x3f')][_0xc83b('0x40')](_0x551ebd);})[_0xc83b('0x24')](function(_0x1847c2){_0x5e3dff[_0xc83b('0x41')]=_0x1847c2;return _0x5e3dff;})[_0xc83b('0x24')](respondWithFilteredResult(_0x33bfbe,_0x551ebd))[_0xc83b('0x42')](handleError(_0x33bfbe,null));};exports['show']=function(_0x32aa76,_0x268d18){var _0x276b2d={'raw':!![],'where':{'id':_0x32aa76[_0xc83b('0x43')]['id']}},_0x2131a3={};_0x2131a3[_0xc83b('0x34')]=_[_0xc83b('0x31')](db[_0xc83b('0x3f')][_0xc83b('0x2c')]);_0x2131a3[_0xc83b('0x30')]=_[_0xc83b('0x31')](_0x32aa76['query']);_0x2131a3[_0xc83b('0x32')]=_[_0xc83b('0x33')](_0x2131a3[_0xc83b('0x34')],_0x2131a3[_0xc83b('0x30')]);_0x276b2d[_0xc83b('0x35')]=_[_0xc83b('0x33')](_0x2131a3[_0xc83b('0x34')],qs[_0xc83b('0x36')](_0x32aa76['query']['fields']));_0x276b2d[_0xc83b('0x35')]=_0x276b2d[_0xc83b('0x35')]['length']?_0x276b2d[_0xc83b('0x35')]:_0x2131a3[_0xc83b('0x34')];if(_0x32aa76[_0xc83b('0x30')]['includeAll']){_0x276b2d[_0xc83b('0x44')]=[{'all':!![]}];}_0x276b2d=_['merge']({},_0x276b2d,_0x32aa76['options']);return db[_0xc83b('0x3f')]['find'](_0x276b2d)[_0xc83b('0x24')](handleEntityNotFound(_0x268d18,null))['then'](respondWithResult(_0x268d18,null))[_0xc83b('0x42')](handleError(_0x268d18,null));};exports[_0xc83b('0x23')]=function(_0x3c8cbf,_0x5c6add){if(_0x3c8cbf[_0xc83b('0x45')]['id']){delete _0x3c8cbf[_0xc83b('0x45')]['id'];}return db[_0xc83b('0x3f')][_0xc83b('0x46')]({'where':{'id':_0x3c8cbf['params']['id']}})[_0xc83b('0x24')](handleEntityNotFound(_0x5c6add,null))[_0xc83b('0x24')](saveUpdates(_0x3c8cbf['body'],null))[_0xc83b('0x24')](respondWithResult(_0x5c6add,null))[_0xc83b('0x42')](handleError(_0x5c6add,null));};exports[_0xc83b('0x25')]=function(_0x10eed0,_0x13fa07){return db['CannedAnswer']['find']({'where':{'id':_0x10eed0['params']['id']}})[_0xc83b('0x24')](handleEntityNotFound(_0x13fa07,null))[_0xc83b('0x24')](removeEntity(_0x13fa07,null))[_0xc83b('0x42')](handleError(_0x13fa07,null));};exports['create']=function(_0x495446,_0x5e362c){var _0x765fe4={'key':_0x495446['body'][_0xc83b('0x2f')]};if(_0x495446[_0xc83b('0x45')][_0xc83b('0x47')]){_0x765fe4['MailAccountId']=_0x495446[_0xc83b('0x45')][_0xc83b('0x47')];}else if(_0x495446[_0xc83b('0x45')][_0xc83b('0x48')]){_0x765fe4['SmsAccountId']=_0x495446[_0xc83b('0x45')]['SmsAccountId'];}else if(_0x495446[_0xc83b('0x45')][_0xc83b('0x49')]){_0x765fe4[_0xc83b('0x49')]=_0x495446['body']['OpenchannelAccountId'];}else if(_0x495446[_0xc83b('0x45')][_0xc83b('0x4a')]){_0x765fe4[_0xc83b('0x4a')]=_0x495446['body'][_0xc83b('0x4a')];}return db[_0xc83b('0x3f')]['find']({'where':_0x765fe4})['then'](function(_0x59cf2a){if(_0x59cf2a){throw new db[(_0xc83b('0x4b'))][(_0xc83b('0x4c'))](_0xc83b('0x4d'));}return db[_0xc83b('0x3f')][_0xc83b('0x4e')](_0x495446[_0xc83b('0x45')]);})['then'](function(_0x27e4b7){var _0x2f415b=_0x495446['user'][_0xc83b('0x4f')]({'plain':!![]});if(!_0x2f415b)throw new Error(_0xc83b('0x50'));if(_0x2f415b[_0xc83b('0x51')]===_0xc83b('0x52')){var _0x319466=_0x27e4b7[_0xc83b('0x4f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x2f415b[_0xc83b('0x53')]},'raw':!![]})[_0xc83b('0x24')](function(_0x8b7fe1){if(_0x8b7fe1&&_0x8b7fe1[_0xc83b('0x54')]===0x0){return db[_0xc83b('0x27')][_0xc83b('0x4e')]({'name':_0x319466[_0xc83b('0x55')],'resourceId':_0x319466['id'],'type':_0x8b7fe1[_0xc83b('0x55')],'sectionId':_0x8b7fe1['id']},{})['then'](function(){return _0x27e4b7;});}else{return _0x27e4b7;}})[_0xc83b('0x42')](function(_0xcf54fc){logger[_0xc83b('0x28')](_0xc83b('0x56'),_0xcf54fc);throw _0xcf54fc;});}return _0x27e4b7;})['then'](respondWithResult(_0x5e362c,0xc9))[_0xc83b('0x42')](handleError(_0x5e362c,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5da6=['./cannedAnswer.attributes','CannedAnswer','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x6019a8,_0x4f6a11){var _0x3963f6=function(_0x5b9c30){while(--_0x5b9c30){_0x6019a8['push'](_0x6019a8['shift']());}};_0x3963f6(++_0x4f6a11);}(_0x5da6,0x1ec));var _0x65da=function(_0xd10919,_0x2d66ab){_0xd10919=_0xd10919-0x0;var _0x3e88f4=_0x5da6[_0xd10919];return _0x3e88f4;};'use strict';var _=require(_0x65da('0x0'));var util=require(_0x65da('0x1'));var logger=require(_0x65da('0x2'))('api');var moment=require(_0x65da('0x3'));var BPromise=require(_0x65da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65da('0x5'));var rimraf=require(_0x65da('0x6'));var config=require(_0x65da('0x7'));var attributes=require(_0x65da('0x8'));module['exports']=function(_0x520f64,_0x4cd132){return _0x520f64['define'](_0x65da('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb00d=['path','../../config/environment','./cannedAnswer.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x6a4710,_0x495ea7){var _0x8e31e3=function(_0x438b21){while(--_0x438b21){_0x6a4710['push'](_0x6a4710['shift']());}};_0x8e31e3(++_0x495ea7);}(_0xb00d,0x19e));var _0xdb00=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0xb00d[_0xad57ee];return _0x3eaea9;};'use strict';var _=require(_0xdb00('0x0'));var util=require(_0xdb00('0x1'));var logger=require(_0xdb00('0x2'))(_0xdb00('0x3'));var moment=require(_0xdb00('0x4'));var BPromise=require(_0xdb00('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb00('0x6'));var rimraf=require('rimraf');var config=require(_0xdb00('0x7'));var attributes=require(_0xdb00('0x8'));module['exports']=function(_0x2a6a39,_0x455b1a){return _0x2a6a39[_0xdb00('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb00('0xa'),'collate':_0xdb00('0xb')});};
\ No newline at end of file
// * 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(_0x5d8b34,_0x21be74){var _0x2ec166=function(_0x91c5dd){while(--_0x91c5dd){_0x5d8b34['push'](_0x5d8b34['shift']());}};_0x2ec166(++_0x21be74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x40a92f,_0x384542){var _0x50fc59=function(_0xbc088f){while(--_0xbc088f){_0x40a92f['push'](_0x40a92f['shift']());}};_0x50fc59(++_0x384542);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bca=['post','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x21404a,_0x4fffed){var _0x13ac55=function(_0x1448a5){while(--_0x1448a5){_0x21404a['push'](_0x21404a['shift']());}};_0x13ac55(++_0x4fffed);}(_0x3bca,0xea));var _0xa3bc=function(_0x49f27a,_0x210feb){_0x49f27a=_0x49f27a-0x0;var _0x4482dd=_0x3bca[_0x49f27a];return _0x4482dd;};'use strict';var multer=require(_0xa3bc('0x0'));var util=require(_0xa3bc('0x1'));var path=require('path');var timeout=require(_0xa3bc('0x2'));var express=require(_0xa3bc('0x3'));var router=express['Router']();var fs_extra=require(_0xa3bc('0x4'));var auth=require(_0xa3bc('0x5'));var interaction=require(_0xa3bc('0x6'));var config=require(_0xa3bc('0x7'));var controller=require('./cannedAnswer.controller');router[_0xa3bc('0x8')]('/',auth[_0xa3bc('0x9')](),controller[_0xa3bc('0xa')]);router[_0xa3bc('0x8')](_0xa3bc('0xb'),auth[_0xa3bc('0x9')](),controller[_0xa3bc('0xc')]);router[_0xa3bc('0xd')]('/',auth[_0xa3bc('0x9')](),controller[_0xa3bc('0xe')]);router[_0xa3bc('0xf')](_0xa3bc('0xb'),auth[_0xa3bc('0x9')](),controller[_0xa3bc('0x10')]);router['delete']('/:id',auth[_0xa3bc('0x9')](),controller[_0xa3bc('0x11')]);module[_0xa3bc('0x12')]=router;
\ No newline at end of file
+var _0x9b36=['isAuthenticated','index','show','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get'];(function(_0x5cf149,_0x2a3489){var _0x2f2e8d=function(_0x2685e3){while(--_0x2685e3){_0x5cf149['push'](_0x5cf149['shift']());}};_0x2f2e8d(++_0x2a3489);}(_0x9b36,0x1d1));var _0x69b3=function(_0x282de5,_0x3d834d){_0x282de5=_0x282de5-0x0;var _0x1f8e04=_0x9b36[_0x282de5];return _0x1f8e04;};'use strict';var multer=require(_0x69b3('0x0'));var util=require(_0x69b3('0x1'));var path=require(_0x69b3('0x2'));var timeout=require(_0x69b3('0x3'));var express=require(_0x69b3('0x4'));var router=express['Router']();var fs_extra=require(_0x69b3('0x5'));var auth=require(_0x69b3('0x6'));var interaction=require(_0x69b3('0x7'));var config=require('../../config/environment');var controller=require(_0x69b3('0x8'));router[_0x69b3('0x9')]('/',auth[_0x69b3('0xa')](),controller[_0x69b3('0xb')]);router[_0x69b3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x69b3('0xc')]);router[_0x69b3('0xd')]('/',auth[_0x69b3('0xa')](),controller[_0x69b3('0xe')]);router['put'](_0x69b3('0xf'),auth[_0x69b3('0xa')](),controller[_0x69b3('0x10')]);router['delete'](_0x69b3('0xf'),auth[_0x69b3('0xa')](),controller[_0x69b3('0x11')]);module[_0x69b3('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6085=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x6085,0x15d));var _0x5608=function(_0x3845b1,_0x23a848){_0x3845b1=_0x3845b1-0x0;var _0x544ea6=_0x6085[_0x3845b1];return _0x544ea6;};'use strict';var Sequelize=require(_0x5608('0x0'));module[_0x5608('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5608('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5608('0x3')]},'channel':{'type':Sequelize[_0x5608('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5608('0x3')]},'lastdata':{'type':Sequelize[_0x5608('0x3')]},'duration':{'type':Sequelize[_0x5608('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5608('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5608('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5608('0x3')]},'userfield':{'type':Sequelize[_0x5608('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5608('0x3')]},'sequence':{'type':Sequelize[_0x5608('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5608('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x59e0=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x459251,_0x15df3e){var _0xb791c0=function(_0x46685b){while(--_0x46685b){_0x459251['push'](_0x459251['shift']());}};_0xb791c0(++_0x15df3e);}(_0x59e0,0x1f4));var _0x059e=function(_0xa76e70,_0x2dabfe){_0xa76e70=_0xa76e70-0x0;var _0x41007e=_0x59e0[_0xa76e70];return _0x41007e;};'use strict';var Sequelize=require('sequelize');module[_0x059e('0x0')]={'calldate':{'type':Sequelize[_0x059e('0x1')],'allowNull':![],'defaultValue':_0x059e('0x2')},'clid':{'type':Sequelize[_0x059e('0x3')]},'src':{'type':Sequelize[_0x059e('0x3')]},'dst':{'type':Sequelize[_0x059e('0x3')]},'dcontext':{'type':Sequelize[_0x059e('0x3')]},'channel':{'type':Sequelize[_0x059e('0x3')]},'dstchannel':{'type':Sequelize[_0x059e('0x3')]},'lastapp':{'type':Sequelize[_0x059e('0x3')]},'lastdata':{'type':Sequelize[_0x059e('0x3')]},'duration':{'type':Sequelize[_0x059e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x059e('0x3')]},'amaflags':{'type':Sequelize[_0x059e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x059e('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x059e('0x3')]},'linkedid':{'type':Sequelize[_0x059e('0x3')]},'sequence':{'type':Sequelize[_0x059e('0x3')]},'peeraccount':{'type':Sequelize[_0x059e('0x3')]},'type':{'type':Sequelize[_0x059e('0x3')]},'tag':{'type':Sequelize[_0x059e('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca9e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','find','create','body','describe','eml-format','rimraf'];(function(_0x2c8687,_0x180052){var _0x12fabc=function(_0xbcbbb9){while(--_0xbcbbb9){_0x2c8687['push'](_0x2c8687['shift']());}};_0x12fabc(++_0x180052);}(_0xca9e,0x136));var _0xeca9=function(_0x183dce,_0x3a8024){_0x183dce=_0x183dce-0x0;var _0x4f391e=_0xca9e[_0x183dce];return _0x4f391e;};'use strict';var emlformat=require(_0xeca9('0x0'));var rimraf=require(_0xeca9('0x1'));var zipdir=require(_0xeca9('0x2'));var jsonpatch=require(_0xeca9('0x3'));var rp=require(_0xeca9('0x4'));var moment=require(_0xeca9('0x5'));var BPromise=require(_0xeca9('0x6'));var Mustache=require(_0xeca9('0x7'));var util=require(_0xeca9('0x8'));var path=require(_0xeca9('0x9'));var sox=require(_0xeca9('0xa'));var csv=require(_0xeca9('0xb'));var ejs=require(_0xeca9('0xc'));var fs=require('fs');var fs_extra=require(_0xeca9('0xd'));var _=require('lodash');var squel=require(_0xeca9('0xe'));var crypto=require(_0xeca9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeca9('0xb'));var querystring=require(_0xeca9('0x10'));var Papa=require(_0xeca9('0x11'));var Redis=require('ioredis');var authService=require(_0xeca9('0x12'));var qs=require(_0xeca9('0x13'));var as=require(_0xeca9('0x14'));var hardwareService=require(_0xeca9('0x15'));var logger=require(_0xeca9('0x16'))(_0xeca9('0x17'));var utils=require('../../config/utils');var config=require(_0xeca9('0x18'));var licenseUtil=require(_0xeca9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ca6f,_0x4b2ae1){_0x4b2ae1=_0x4b2ae1||0xcc;return function(_0x3c6cc7){if(_0x3c6cc7){return _0x27ca6f[_0xeca9('0x1a')](_0x4b2ae1);}return _0x27ca6f['status'](_0x4b2ae1)[_0xeca9('0x1b')]();};}function respondWithResult(_0x384ae2,_0x1ba9e9){_0x1ba9e9=_0x1ba9e9||0xc8;return function(_0x4d65ee){if(_0x4d65ee){return _0x384ae2[_0xeca9('0x1c')](_0x1ba9e9)[_0xeca9('0x1d')](_0x4d65ee);}};}function respondWithFilteredResult(_0x910814,_0x6e9fd4){return function(_0x551393){if(_0x551393){var _0x520411=typeof _0x6e9fd4[_0xeca9('0x1e')]===_0xeca9('0x1f')&&typeof _0x6e9fd4['limit']===_0xeca9('0x1f');var _0x11bf78=_0x551393['count'];var _0x517060=_0x520411?0x0:_0x6e9fd4['offset'];var _0x132008=_0x520411?_0x551393[_0xeca9('0x20')]:_0x6e9fd4[_0xeca9('0x1e')]+_0x6e9fd4['limit'];var _0xf1ef9f;if(_0x132008>=_0x11bf78){_0x132008=_0x11bf78;_0xf1ef9f=0xc8;}else{_0xf1ef9f=0xce;}_0x910814['status'](_0xf1ef9f);return _0x910814['set'](_0xeca9('0x21'),_0x517060+'-'+_0x132008+'/'+_0x11bf78)['json'](_0x551393);}return null;};}function patchUpdates(_0x31720b){return function(_0x1c4dd6){try{jsonpatch['apply'](_0x1c4dd6,_0x31720b,!![]);}catch(_0x5a2cca){return BPromise[_0xeca9('0x22')](_0x5a2cca);}return _0x1c4dd6['save']();};}function saveUpdates(_0x3647ed,_0x5279d0){return function(_0x3a3608){if(_0x3a3608){return _0x3a3608[_0xeca9('0x23')](_0x3647ed)[_0xeca9('0x24')](function(_0x5c3495){return _0x5c3495;});}return null;};}function removeEntity(_0x3fcfb8,_0x466883){return function(_0x515e63){if(_0x515e63){return _0x515e63[_0xeca9('0x25')]()[_0xeca9('0x24')](function(){_0x3fcfb8[_0xeca9('0x1c')](0xcc)[_0xeca9('0x1b')]();});}};}function handleEntityNotFound(_0x498f4a,_0x32699b){return function(_0x57e190){if(!_0x57e190){_0x498f4a[_0xeca9('0x1a')](0x194);}return _0x57e190;};}function handleError(_0x251ce4,_0x1702fb){_0x1702fb=_0x1702fb||0x1f4;return function(_0x3e41df){logger[_0xeca9('0x26')](_0x3e41df[_0xeca9('0x27')]);if(_0x3e41df[_0xeca9('0x28')]){delete _0x3e41df[_0xeca9('0x28')];}_0x251ce4[_0xeca9('0x1c')](_0x1702fb)[_0xeca9('0x29')](_0x3e41df);};}exports[_0xeca9('0x2a')]=function(_0x3b0aab,_0x424f7b){var _0x1436d0={},_0x8d9a8d={},_0x4910a3={'count':0x0,'rows':[]};var _0x4db3e2=_['map'](db[_0xeca9('0x2b')]['rawAttributes'],function(_0x2ca943){return{'name':_0x2ca943[_0xeca9('0x2c')],'type':_0x2ca943[_0xeca9('0x2d')][_0xeca9('0x2e')]};});_0x8d9a8d[_0xeca9('0x2f')]=_[_0xeca9('0x30')](_0x4db3e2,'name');_0x8d9a8d[_0xeca9('0x31')]=_['keys'](_0x3b0aab[_0xeca9('0x31')]);_0x8d9a8d[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x8d9a8d['model'],_0x8d9a8d[_0xeca9('0x31')]);_0x1436d0[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x8d9a8d[_0xeca9('0x2f')],qs['fields'](_0x3b0aab[_0xeca9('0x31')]['fields']));_0x1436d0[_0xeca9('0x34')]=_0x1436d0[_0xeca9('0x34')][_0xeca9('0x35')]?_0x1436d0[_0xeca9('0x34')]:_0x8d9a8d[_0xeca9('0x2f')];if(!_0x3b0aab[_0xeca9('0x31')]['hasOwnProperty'](_0xeca9('0x36'))){_0x1436d0[_0xeca9('0x37')]=qs[_0xeca9('0x37')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x37')]);_0x1436d0[_0xeca9('0x1e')]=qs[_0xeca9('0x1e')](_0x3b0aab['query'][_0xeca9('0x1e')]);}_0x1436d0[_0xeca9('0x38')]=qs[_0xeca9('0x39')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x39')]);_0x1436d0[_0xeca9('0x3a')]=qs['filters'](_[_0xeca9('0x3b')](_0x3b0aab['query'],_0x8d9a8d[_0xeca9('0x32')]),_0x4db3e2);if(_0x3b0aab['query'][_0xeca9('0x3c')]){_0x1436d0[_0xeca9('0x3a')]=_['merge'](_0x1436d0[_0xeca9('0x3a')],{'$or':_['map'](_0x4db3e2,function(_0x2a249b){if(_0x2a249b['type']!==_0xeca9('0x3d')){var _0x5aa0b1={};_0x5aa0b1[_0x2a249b[_0xeca9('0x28')]]={'$like':'%'+_0x3b0aab[_0xeca9('0x31')]['filter']+'%'};return _0x5aa0b1;}})});}_0x1436d0=_[_0xeca9('0x3e')]({},_0x1436d0,_0x3b0aab[_0xeca9('0x3f')]);var _0x4e8080={'where':_0x1436d0[_0xeca9('0x3a')]};return db[_0xeca9('0x2b')][_0xeca9('0x20')](_0x4e8080)[_0xeca9('0x24')](function(_0xb1f2fc){_0x4910a3[_0xeca9('0x20')]=_0xb1f2fc;if(_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x40')]){_0x1436d0[_0xeca9('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xeca9('0x42')](_0x1436d0);})[_0xeca9('0x24')](function(_0x15ef4e){_0x4910a3[_0xeca9('0x43')]=_0x15ef4e;return _0x4910a3;})[_0xeca9('0x24')](respondWithFilteredResult(_0x424f7b,_0x1436d0))[_0xeca9('0x44')](handleError(_0x424f7b,null));};exports[_0xeca9('0x45')]=function(_0x5cb0d1,_0x1d3338){var _0x388943={'raw':!![],'where':{'id':_0x5cb0d1[_0xeca9('0x46')]['id']}},_0x188ebc={};_0x188ebc[_0xeca9('0x2f')]=_['keys'](db[_0xeca9('0x2b')][_0xeca9('0x47')]);_0x188ebc[_0xeca9('0x31')]=_[_0xeca9('0x48')](_0x5cb0d1['query']);_0x188ebc[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x188ebc['model'],_0x188ebc[_0xeca9('0x31')]);_0x388943[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x188ebc[_0xeca9('0x2f')],qs[_0xeca9('0x49')](_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x49')]));_0x388943[_0xeca9('0x34')]=_0x388943[_0xeca9('0x34')][_0xeca9('0x35')]?_0x388943[_0xeca9('0x34')]:_0x188ebc[_0xeca9('0x2f')];if(_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x40')]){_0x388943[_0xeca9('0x41')]=[{'all':!![]}];}_0x388943=_['merge']({},_0x388943,_0x5cb0d1[_0xeca9('0x3f')]);return db[_0xeca9('0x2b')][_0xeca9('0x4a')](_0x388943)[_0xeca9('0x24')](handleEntityNotFound(_0x1d3338,null))['then'](respondWithResult(_0x1d3338,null))[_0xeca9('0x44')](handleError(_0x1d3338,null));};exports[_0xeca9('0x4b')]=function(_0x548fab,_0x5e6dc2){return db[_0xeca9('0x2b')][_0xeca9('0x4b')](_0x548fab[_0xeca9('0x4c')],{})[_0xeca9('0x24')](respondWithResult(_0x5e6dc2,0xc9))['catch'](handleError(_0x5e6dc2,null));};exports[_0xeca9('0x23')]=function(_0xa4faf9,_0x346c62){if(_0xa4faf9[_0xeca9('0x4c')]['id']){delete _0xa4faf9[_0xeca9('0x4c')]['id'];}return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0xa4faf9[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x346c62,null))['then'](saveUpdates(_0xa4faf9['body'],null))[_0xeca9('0x24')](respondWithResult(_0x346c62,null))[_0xeca9('0x44')](handleError(_0x346c62,null));};exports['destroy']=function(_0x283d2d,_0x315f54){return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0x283d2d[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x315f54,null))[_0xeca9('0x24')](removeEntity(_0x315f54,null))[_0xeca9('0x44')](handleError(_0x315f54,null));};exports[_0xeca9('0x4d')]=function(_0x56a212,_0x5cd84d){return db['Cdr']['describe']()[_0xeca9('0x24')](respondWithResult(_0x5cd84d,null))['catch'](handleError(_0x5cd84d,null));};
\ No newline at end of file
+var _0x4006=['findAll','catch','show','keys','include','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll'];(function(_0x216466,_0x1bcfe2){var _0x52ed31=function(_0x39c8da){while(--_0x39c8da){_0x216466['push'](_0x216466['shift']());}};_0x52ed31(++_0x1bcfe2);}(_0x4006,0x1c7));var _0x6400=function(_0x197ef7,_0x4b917f){_0x197ef7=_0x197ef7-0x0;var _0x4ff7fa=_0x4006[_0x197ef7];return _0x4ff7fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6400('0x0'));var zipdir=require(_0x6400('0x1'));var jsonpatch=require(_0x6400('0x2'));var rp=require(_0x6400('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6400('0x4'));var util=require('util');var path=require(_0x6400('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6400('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6400('0x7'));var squel=require(_0x6400('0x8'));var crypto=require(_0x6400('0x9'));var jsforce=require(_0x6400('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6400('0xb'));var querystring=require(_0x6400('0xc'));var Papa=require(_0x6400('0xd'));var Redis=require(_0x6400('0xe'));var authService=require(_0x6400('0xf'));var qs=require(_0x6400('0x10'));var as=require(_0x6400('0x11'));var hardwareService=require(_0x6400('0x12'));var logger=require(_0x6400('0x13'))(_0x6400('0x14'));var utils=require(_0x6400('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6400('0x16'));var db=require(_0x6400('0x17'))['db'];function respondWithStatusCode(_0x230c94,_0x36bf00){_0x36bf00=_0x36bf00||0xcc;return function(_0x5a6d31){if(_0x5a6d31){return _0x230c94[_0x6400('0x18')](_0x36bf00);}return _0x230c94[_0x6400('0x19')](_0x36bf00)['end']();};}function respondWithResult(_0x4f8133,_0x559312){_0x559312=_0x559312||0xc8;return function(_0x268f93){if(_0x268f93){return _0x4f8133[_0x6400('0x19')](_0x559312)['json'](_0x268f93);}};}function respondWithFilteredResult(_0x191696,_0x4ae3ea){return function(_0x28eb67){if(_0x28eb67){var _0x5a0c1c=typeof _0x4ae3ea[_0x6400('0x1a')]===_0x6400('0x1b')&&typeof _0x4ae3ea[_0x6400('0x1c')]===_0x6400('0x1b');var _0x49d412=_0x28eb67[_0x6400('0x1d')];var _0x14c036=_0x5a0c1c?0x0:_0x4ae3ea[_0x6400('0x1a')];var _0x50524f=_0x5a0c1c?_0x28eb67[_0x6400('0x1d')]:_0x4ae3ea[_0x6400('0x1a')]+_0x4ae3ea['limit'];var _0x36a8f5;if(_0x50524f>=_0x49d412){_0x50524f=_0x49d412;_0x36a8f5=0xc8;}else{_0x36a8f5=0xce;}_0x191696[_0x6400('0x19')](_0x36a8f5);return _0x191696[_0x6400('0x1e')]('Content-Range',_0x14c036+'-'+_0x50524f+'/'+_0x49d412)[_0x6400('0x1f')](_0x28eb67);}return null;};}function patchUpdates(_0x23c1cd){return function(_0x325bde){try{jsonpatch[_0x6400('0x20')](_0x325bde,_0x23c1cd,!![]);}catch(_0x1c8b72){return BPromise[_0x6400('0x21')](_0x1c8b72);}return _0x325bde[_0x6400('0x22')]();};}function saveUpdates(_0x171e39,_0x22eb63){return function(_0x212f0f){if(_0x212f0f){return _0x212f0f['update'](_0x171e39)[_0x6400('0x23')](function(_0x50c29e){return _0x50c29e;});}return null;};}function removeEntity(_0x589b7c,_0x257d80){return function(_0xb79c62){if(_0xb79c62){return _0xb79c62[_0x6400('0x24')]()[_0x6400('0x23')](function(){_0x589b7c['status'](0xcc)[_0x6400('0x25')]();});}};}function handleEntityNotFound(_0x56d9e6,_0x1acff2){return function(_0x506732){if(!_0x506732){_0x56d9e6[_0x6400('0x18')](0x194);}return _0x506732;};}function handleError(_0x246433,_0x577156){_0x577156=_0x577156||0x1f4;return function(_0x434550){logger[_0x6400('0x26')](_0x434550[_0x6400('0x27')]);if(_0x434550['name']){delete _0x434550[_0x6400('0x28')];}_0x246433['status'](_0x577156)['send'](_0x434550);};}exports[_0x6400('0x29')]=function(_0x4bb214,_0x234670){var _0x197b9d={},_0x50f5e9={},_0x452a2c={'count':0x0,'rows':[]};var _0x52eba1=_['map'](db[_0x6400('0x2a')][_0x6400('0x2b')],function(_0x10005a){return{'name':_0x10005a[_0x6400('0x2c')],'type':_0x10005a[_0x6400('0x2d')]['key']};});_0x50f5e9[_0x6400('0x2e')]=_[_0x6400('0x2f')](_0x52eba1,_0x6400('0x28'));_0x50f5e9[_0x6400('0x30')]=_['keys'](_0x4bb214[_0x6400('0x30')]);_0x50f5e9[_0x6400('0x31')]=_[_0x6400('0x32')](_0x50f5e9['model'],_0x50f5e9[_0x6400('0x30')]);_0x197b9d[_0x6400('0x33')]=_[_0x6400('0x32')](_0x50f5e9[_0x6400('0x2e')],qs['fields'](_0x4bb214[_0x6400('0x30')][_0x6400('0x34')]));_0x197b9d['attributes']=_0x197b9d[_0x6400('0x33')][_0x6400('0x35')]?_0x197b9d['attributes']:_0x50f5e9['model'];if(!_0x4bb214[_0x6400('0x30')][_0x6400('0x36')](_0x6400('0x37'))){_0x197b9d['limit']=qs['limit'](_0x4bb214['query'][_0x6400('0x1c')]);_0x197b9d[_0x6400('0x1a')]=qs[_0x6400('0x1a')](_0x4bb214[_0x6400('0x30')][_0x6400('0x1a')]);}_0x197b9d['order']=qs[_0x6400('0x38')](_0x4bb214[_0x6400('0x30')]['sort']);_0x197b9d['where']=qs[_0x6400('0x31')](_[_0x6400('0x39')](_0x4bb214[_0x6400('0x30')],_0x50f5e9['filters']),_0x52eba1);if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3a')]){_0x197b9d[_0x6400('0x3b')]=_['merge'](_0x197b9d[_0x6400('0x3b')],{'$or':_[_0x6400('0x2f')](_0x52eba1,function(_0xd824bf){if(_0xd824bf['type']!=='VIRTUAL'){var _0x5a0973={};_0x5a0973[_0xd824bf[_0x6400('0x28')]]={'$like':'%'+_0x4bb214['query']['filter']+'%'};return _0x5a0973;}})});}_0x197b9d=_[_0x6400('0x3c')]({},_0x197b9d,_0x4bb214[_0x6400('0x3d')]);var _0x565942={'where':_0x197b9d[_0x6400('0x3b')]};return db[_0x6400('0x2a')][_0x6400('0x1d')](_0x565942)['then'](function(_0x9536e5){_0x452a2c[_0x6400('0x1d')]=_0x9536e5;if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3e')]){_0x197b9d['include']=[{'all':!![]}];}return db['Cdr'][_0x6400('0x3f')](_0x197b9d);})[_0x6400('0x23')](function(_0x1bf820){_0x452a2c['rows']=_0x1bf820;return _0x452a2c;})[_0x6400('0x23')](respondWithFilteredResult(_0x234670,_0x197b9d))[_0x6400('0x40')](handleError(_0x234670,null));};exports[_0x6400('0x41')]=function(_0xe50c96,_0x3069f0){var _0x557133={'raw':!![],'where':{'id':_0xe50c96['params']['id']}},_0x24d0c7={};_0x24d0c7[_0x6400('0x2e')]=_[_0x6400('0x42')](db[_0x6400('0x2a')][_0x6400('0x2b')]);_0x24d0c7['query']=_[_0x6400('0x42')](_0xe50c96[_0x6400('0x30')]);_0x24d0c7[_0x6400('0x31')]=_[_0x6400('0x32')](_0x24d0c7['model'],_0x24d0c7[_0x6400('0x30')]);_0x557133['attributes']=_[_0x6400('0x32')](_0x24d0c7['model'],qs[_0x6400('0x34')](_0xe50c96[_0x6400('0x30')][_0x6400('0x34')]));_0x557133['attributes']=_0x557133[_0x6400('0x33')]['length']?_0x557133[_0x6400('0x33')]:_0x24d0c7[_0x6400('0x2e')];if(_0xe50c96[_0x6400('0x30')][_0x6400('0x3e')]){_0x557133[_0x6400('0x43')]=[{'all':!![]}];}_0x557133=_[_0x6400('0x3c')]({},_0x557133,_0xe50c96[_0x6400('0x3d')]);return db[_0x6400('0x2a')][_0x6400('0x44')](_0x557133)[_0x6400('0x23')](handleEntityNotFound(_0x3069f0,null))[_0x6400('0x23')](respondWithResult(_0x3069f0,null))['catch'](handleError(_0x3069f0,null));};exports[_0x6400('0x45')]=function(_0x3340c7,_0x59a8f2){return db['Cdr'][_0x6400('0x45')](_0x3340c7[_0x6400('0x46')],{})[_0x6400('0x23')](respondWithResult(_0x59a8f2,0xc9))['catch'](handleError(_0x59a8f2,null));};exports[_0x6400('0x47')]=function(_0x54cbfb,_0x518ee4){if(_0x54cbfb['body']['id']){delete _0x54cbfb[_0x6400('0x46')]['id'];}return db[_0x6400('0x2a')]['find']({'where':{'id':_0x54cbfb[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x518ee4,null))['then'](saveUpdates(_0x54cbfb['body'],null))[_0x6400('0x23')](respondWithResult(_0x518ee4,null))[_0x6400('0x40')](handleError(_0x518ee4,null));};exports['destroy']=function(_0x3421b5,_0x205233){return db[_0x6400('0x2a')][_0x6400('0x44')]({'where':{'id':_0x3421b5[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x205233,null))[_0x6400('0x23')](removeEntity(_0x205233,null))['catch'](handleError(_0x205233,null));};exports[_0x6400('0x49')]=function(_0x801179,_0x6905bb){return db[_0x6400('0x2a')][_0x6400('0x49')]()[_0x6400('0x23')](respondWithResult(_0x6905bb,null))[_0x6400('0x40')](handleError(_0x6905bb,null));};
\ No newline at end of file
// * 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(_0x17dd9c,_0x53d048){var _0x6a6ee7=function(_0x16a52e){while(--_0x16a52e){_0x17dd9c['push'](_0x17dd9c['shift']());}};_0x6a6ee7(++_0x53d048);}(_0x7a54,0x106));var _0x47a5=function(_0x50bc84,_0x4370ef){_0x50bc84=_0x50bc84-0x0;var _0x1342ad=_0x7a54[_0x50bc84];return _0x1342ad;};'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(_0x185cf3,_0x3735de){var _0x3eda3d=function(_0x5567b1){while(--_0x5567b1){_0x185cf3['push'](_0x185cf3['shift']());}};_0x3eda3d(++_0x3735de);}(_0x7a54,0x106));var _0x47a5=function(_0x311af,_0x268234){_0x311af=_0x311af-0x0;var _0x187320=_0x7a54[_0x311af];return _0x187320;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x429d=['error','code','Cdr,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c853f,_0x8a009b){var _0x55b2be=function(_0x52f795){while(--_0x52f795){_0x1c853f['push'](_0x1c853f['shift']());}};_0x55b2be(++_0x8a009b);}(_0x429d,0x1bb));var _0xd429=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x429d[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd429('0x0'));var BPromise=require(_0xd429('0x1'));var rs=require(_0xd429('0x2'));var fs=require('fs');var Redis=require(_0xd429('0x3'));var db=require(_0xd429('0x4'))['db'];var utils=require(_0xd429('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd429('0x6'));var jayson=require(_0xd429('0x7'));var client=jayson[_0xd429('0x8')][_0xd429('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dc9f2,_0x4b429a,_0x1dc37e){return new BPromise(function(_0x5da8b8,_0x186e73){return client[_0xd429('0xa')](_0x3dc9f2,_0x1dc37e)[_0xd429('0xb')](function(_0x28d28c){logger[_0xd429('0xc')]('Cdr,\x20%s,\x20%s',_0x4b429a,_0xd429('0xd'));logger[_0xd429('0xe')](_0xd429('0xf'),_0x4b429a,_0xd429('0xd'),JSON[_0xd429('0x10')](_0x28d28c));if(_0x28d28c[_0xd429('0x11')]){if(_0x28d28c[_0xd429('0x11')][_0xd429('0x12')]===0x1f4){logger[_0xd429('0x11')](_0xd429('0x13'),_0x4b429a,_0x28d28c[_0xd429('0x11')][_0xd429('0x14')]);return _0x186e73(_0x28d28c[_0xd429('0x11')]['message']);}logger[_0xd429('0x11')](_0xd429('0x13'),_0x4b429a,_0x28d28c[_0xd429('0x11')][_0xd429('0x14')]);return _0x5da8b8(_0x28d28c[_0xd429('0x11')][_0xd429('0x14')]);}else{logger[_0xd429('0xc')](_0xd429('0x13'),_0x4b429a,_0xd429('0xd'));_0x5da8b8(_0x28d28c[_0xd429('0x15')][_0xd429('0x14')]);}})[_0xd429('0x16')](function(_0x208ff2){logger[_0xd429('0x11')](_0xd429('0x13'),_0x4b429a,_0x208ff2);_0x186e73(_0x208ff2);});});}
\ No newline at end of file
+var _0x16a2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','util'];(function(_0x1fc945,_0x5659db){var _0x31bcf8=function(_0x2705f5){while(--_0x2705f5){_0x1fc945['push'](_0x1fc945['shift']());}};_0x31bcf8(++_0x5659db);}(_0x16a2,0x89));var _0x216a=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x16a2[_0x290fa6];return _0x47f1f3;};'use strict';var _=require('lodash');var util=require(_0x216a('0x0'));var moment=require(_0x216a('0x1'));var BPromise=require(_0x216a('0x2'));var rs=require(_0x216a('0x3'));var fs=require('fs');var Redis=require(_0x216a('0x4'));var db=require(_0x216a('0x5'))['db'];var utils=require(_0x216a('0x6'));var logger=require(_0x216a('0x7'))(_0x216a('0x8'));var config=require('../../config/environment');var jayson=require(_0x216a('0x9'));var client=jayson[_0x216a('0xa')][_0x216a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x77eb24,_0x17f8ea,_0x121894){return new BPromise(function(_0x49c25b,_0x39ecd0){return client[_0x216a('0xc')](_0x77eb24,_0x121894)['then'](function(_0x3a4359){logger[_0x216a('0xd')]('Cdr,\x20%s,\x20%s',_0x17f8ea,_0x216a('0xe'));logger['debug'](_0x216a('0xf'),_0x17f8ea,_0x216a('0xe'),JSON[_0x216a('0x10')](_0x3a4359));if(_0x3a4359[_0x216a('0x11')]){if(_0x3a4359[_0x216a('0x11')][_0x216a('0x12')]===0x1f4){logger[_0x216a('0x11')](_0x216a('0x13'),_0x17f8ea,_0x3a4359[_0x216a('0x11')][_0x216a('0x14')]);return _0x39ecd0(_0x3a4359['error'][_0x216a('0x14')]);}logger['error'](_0x216a('0x13'),_0x17f8ea,_0x3a4359[_0x216a('0x11')][_0x216a('0x14')]);return _0x49c25b(_0x3a4359['error']['message']);}else{logger[_0x216a('0xd')](_0x216a('0x13'),_0x17f8ea,_0x216a('0xe'));_0x49c25b(_0x3a4359[_0x216a('0x15')]['message']);}})[_0x216a('0x16')](function(_0x2570a4){logger[_0x216a('0x11')](_0x216a('0x13'),_0x17f8ea,_0x2570a4);_0x39ecd0(_0x2570a4);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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(_0x1e8189,_0x482c1a){var _0x519ba9=function(_0x261937){while(--_0x261937){_0x1e8189['push'](_0x1e8189['shift']());}};_0x519ba9(++_0x482c1a);}(_0xb10b,0x12a));var _0xbb10=function(_0xd07790,_0x3db009){_0xd07790=_0xd07790-0x0;var _0x32f10e=_0xb10b[_0xd07790];return _0x32f10e;};'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
+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(_0x45f6e2,_0xe72d77){var _0x573b09=function(_0x3aa398){while(--_0x3aa398){_0x45f6e2['push'](_0x45f6e2['shift']());}};_0x573b09(++_0xe72d77);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var 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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9222=['INTEGER','noop','TEXT','*,*,*,*','sequelize'];(function(_0x365c90,_0x39daaf){var _0x1521e0=function(_0x10dba6){while(--_0x10dba6){_0x365c90['push'](_0x365c90['shift']());}};_0x1521e0(++_0x39daaf);}(_0x9222,0x144));var _0x2922=function(_0x5bd1a9,_0x4ceb96){_0x5bd1a9=_0x5bd1a9-0x0;var _0x5ba2cc=_0x9222[_0x5bd1a9];return _0x5ba2cc;};'use strict';var Sequelize=require(_0x2922('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2922('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2922('0x2')},'appdata':{'type':Sequelize[_0x2922('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2922('0x4')}};
\ No newline at end of file
+var _0x74aa=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x123935,_0x1670ba){var _0x1a8ebf=function(_0xa6933e){while(--_0xa6933e){_0x123935['push'](_0x123935['shift']());}};_0x1a8ebf(++_0x1670ba);}(_0x74aa,0x188));var _0xa74a=function(_0x3038b0,_0xb6aa6d){_0x3038b0=_0x3038b0-0x0;var _0x36ddb3=_0x74aa[_0x3038b0];return _0x36ddb3;};'use strict';var Sequelize=require('sequelize');module[_0xa74a('0x0')]={'priority':{'type':Sequelize[_0xa74a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa74a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa74a('0x3')]()},'description':{'type':Sequelize[_0xa74a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa74a('0x4')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9861=['status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','merge','find','catch','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus'];(function(_0x1964c7,_0x49ad27){var _0x284c96=function(_0x594977){while(--_0x594977){_0x1964c7['push'](_0x1964c7['shift']());}};_0x284c96(++_0x49ad27);}(_0x9861,0x176));var _0x1986=function(_0x366c68,_0x554017){_0x366c68=_0x366c68-0x0;var _0x1ff677=_0x9861[_0x366c68];return _0x1ff677;};'use strict';var emlformat=require(_0x1986('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1986('0x1'));var rp=require(_0x1986('0x2'));var moment=require(_0x1986('0x3'));var BPromise=require(_0x1986('0x4'));var Mustache=require(_0x1986('0x5'));var util=require(_0x1986('0x6'));var path=require('path');var sox=require(_0x1986('0x7'));var csv=require(_0x1986('0x8'));var ejs=require(_0x1986('0x9'));var fs=require('fs');var fs_extra=require(_0x1986('0xa'));var _=require(_0x1986('0xb'));var squel=require(_0x1986('0xc'));var crypto=require(_0x1986('0xd'));var jsforce=require(_0x1986('0xe'));var deskjs=require(_0x1986('0xf'));var toCsv=require(_0x1986('0x8'));var querystring=require('querystring');var Papa=require(_0x1986('0x10'));var Redis=require(_0x1986('0x11'));var authService=require(_0x1986('0x12'));var qs=require(_0x1986('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1986('0x14'));var logger=require(_0x1986('0x15'))('api');var utils=require(_0x1986('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1986('0x17'))['db'];function respondWithStatusCode(_0x1f49f6,_0xd87393){_0xd87393=_0xd87393||0xcc;return function(_0x2de9ba){if(_0x2de9ba){return _0x1f49f6[_0x1986('0x18')](_0xd87393);}return _0x1f49f6[_0x1986('0x19')](_0xd87393)[_0x1986('0x1a')]();};}function respondWithResult(_0x448717,_0x455e47){_0x455e47=_0x455e47||0xc8;return function(_0x3a8cca){if(_0x3a8cca){return _0x448717['status'](_0x455e47)['json'](_0x3a8cca);}};}function respondWithFilteredResult(_0x12984d,_0x3d0207){return function(_0x59228f){if(_0x59228f){var _0x3b4244=typeof _0x3d0207[_0x1986('0x1b')]===_0x1986('0x1c')&&typeof _0x3d0207[_0x1986('0x1d')]===_0x1986('0x1c');var _0x44fcf1=_0x59228f[_0x1986('0x1e')];var _0x15f7b9=_0x3b4244?0x0:_0x3d0207[_0x1986('0x1b')];var _0x7dec68=_0x3b4244?_0x59228f[_0x1986('0x1e')]:_0x3d0207[_0x1986('0x1b')]+_0x3d0207[_0x1986('0x1d')];var _0x2ecdf9;if(_0x7dec68>=_0x44fcf1){_0x7dec68=_0x44fcf1;_0x2ecdf9=0xc8;}else{_0x2ecdf9=0xce;}_0x12984d['status'](_0x2ecdf9);return _0x12984d[_0x1986('0x1f')](_0x1986('0x20'),_0x15f7b9+'-'+_0x7dec68+'/'+_0x44fcf1)['json'](_0x59228f);}return null;};}function patchUpdates(_0x3ab28e){return function(_0x693eb2){try{jsonpatch['apply'](_0x693eb2,_0x3ab28e,!![]);}catch(_0x569efa){return BPromise[_0x1986('0x21')](_0x569efa);}return _0x693eb2[_0x1986('0x22')]();};}function saveUpdates(_0x1450d5,_0x530aa1){return function(_0x3c7471){if(_0x3c7471){return _0x3c7471[_0x1986('0x23')](_0x1450d5)[_0x1986('0x24')](function(_0x4f6964){return _0x4f6964;});}return null;};}function removeEntity(_0x2e9bc9,_0xbde8e2){return function(_0x281989){if(_0x281989){return _0x281989[_0x1986('0x25')]()[_0x1986('0x24')](function(){_0x2e9bc9['status'](0xcc)[_0x1986('0x1a')]();});}};}function handleEntityNotFound(_0x518f3c,_0x19fd8a){return function(_0xe23114){if(!_0xe23114){_0x518f3c['sendStatus'](0x194);}return _0xe23114;};}function handleError(_0x2daf0f,_0x37094b){_0x37094b=_0x37094b||0x1f4;return function(_0x3b8f25){logger['error'](_0x3b8f25['stack']);if(_0x3b8f25[_0x1986('0x26')]){delete _0x3b8f25[_0x1986('0x26')];}_0x2daf0f['status'](_0x37094b)[_0x1986('0x27')](_0x3b8f25);};}exports[_0x1986('0x28')]=function(_0x1dcd2c,_0x455937){var _0x4d7ed1={'raw':!![],'where':{'id':_0x1dcd2c[_0x1986('0x29')]['id']}},_0x39796d={};_0x39796d[_0x1986('0x2a')]=_['keys'](db[_0x1986('0x2b')][_0x1986('0x2c')]);_0x39796d[_0x1986('0x2d')]=_[_0x1986('0x2e')](_0x1dcd2c[_0x1986('0x2d')]);_0x39796d[_0x1986('0x2f')]=_[_0x1986('0x30')](_0x39796d['model'],_0x39796d[_0x1986('0x2d')]);_0x4d7ed1[_0x1986('0x31')]=_[_0x1986('0x30')](_0x39796d['model'],qs[_0x1986('0x32')](_0x1dcd2c[_0x1986('0x2d')]['fields']));_0x4d7ed1['attributes']=_0x4d7ed1[_0x1986('0x31')][_0x1986('0x33')]?_0x4d7ed1[_0x1986('0x31')]:_0x39796d[_0x1986('0x2a')];if(_0x1dcd2c['query']['includeAll']){_0x4d7ed1[_0x1986('0x34')]=[{'all':!![]}];}_0x4d7ed1=_[_0x1986('0x35')]({},_0x4d7ed1,_0x1dcd2c['options']);return db['ChatApplication'][_0x1986('0x36')](_0x4d7ed1)[_0x1986('0x24')](handleEntityNotFound(_0x455937,null))['then'](respondWithResult(_0x455937,null))[_0x1986('0x37')](handleError(_0x455937,null));};exports[_0x1986('0x23')]=function(_0xe123c1,_0x1b287f){if(_0xe123c1['body']['id']){delete _0xe123c1[_0x1986('0x38')]['id'];}return db[_0x1986('0x2b')][_0x1986('0x36')]({'where':{'id':_0xe123c1['params']['id']}})['then'](handleEntityNotFound(_0x1b287f,null))[_0x1986('0x24')](saveUpdates(_0xe123c1['body'],null))[_0x1986('0x24')](respondWithResult(_0x1b287f,null))[_0x1986('0x37')](handleError(_0x1b287f,null));};exports[_0x1986('0x25')]=function(_0x290f5a,_0x5326af){return db[_0x1986('0x2b')][_0x1986('0x36')]({'where':{'id':_0x290f5a[_0x1986('0x29')]['id']}})[_0x1986('0x24')](handleEntityNotFound(_0x5326af,null))[_0x1986('0x24')](removeEntity(_0x5326af,null))[_0x1986('0x37')](handleError(_0x5326af,null));};
\ No newline at end of file
+var _0x342e=['zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','stack','name','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','eml-format','rimraf'];(function(_0x273b96,_0x1bbed8){var _0xe25232=function(_0x4aa69b){while(--_0x4aa69b){_0x273b96['push'](_0x273b96['shift']());}};_0xe25232(++_0x1bbed8);}(_0x342e,0xde));var _0xe342=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0x342e[_0x5a187b];return _0x14d601;};'use strict';var emlformat=require(_0xe342('0x0'));var rimraf=require(_0xe342('0x1'));var zipdir=require(_0xe342('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe342('0x5'));var sox=require(_0xe342('0x6'));var csv=require(_0xe342('0x7'));var ejs=require(_0xe342('0x8'));var fs=require('fs');var fs_extra=require(_0xe342('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe342('0xa'));var jsforce=require(_0xe342('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe342('0xc'));var Papa=require(_0xe342('0xd'));var Redis=require(_0xe342('0xe'));var authService=require(_0xe342('0xf'));var qs=require(_0xe342('0x10'));var as=require(_0xe342('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe342('0x12'))(_0xe342('0x13'));var utils=require(_0xe342('0x14'));var config=require(_0xe342('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe342('0x16'))['db'];function respondWithStatusCode(_0x50c16e,_0x2fff81){_0x2fff81=_0x2fff81||0xcc;return function(_0x419815){if(_0x419815){return _0x50c16e[_0xe342('0x17')](_0x2fff81);}return _0x50c16e[_0xe342('0x18')](_0x2fff81)['end']();};}function respondWithResult(_0x428c0b,_0x404989){_0x404989=_0x404989||0xc8;return function(_0x59434c){if(_0x59434c){return _0x428c0b[_0xe342('0x18')](_0x404989)[_0xe342('0x19')](_0x59434c);}};}function respondWithFilteredResult(_0xe384cd,_0x8a23f0){return function(_0xe8b832){if(_0xe8b832){var _0x219f51=typeof _0x8a23f0[_0xe342('0x1a')]===_0xe342('0x1b')&&typeof _0x8a23f0[_0xe342('0x1c')]===_0xe342('0x1b');var _0x144b24=_0xe8b832['count'];var _0xf70e61=_0x219f51?0x0:_0x8a23f0['offset'];var _0x5df492=_0x219f51?_0xe8b832[_0xe342('0x1d')]:_0x8a23f0[_0xe342('0x1a')]+_0x8a23f0[_0xe342('0x1c')];var _0x273865;if(_0x5df492>=_0x144b24){_0x5df492=_0x144b24;_0x273865=0xc8;}else{_0x273865=0xce;}_0xe384cd[_0xe342('0x18')](_0x273865);return _0xe384cd[_0xe342('0x1e')](_0xe342('0x1f'),_0xf70e61+'-'+_0x5df492+'/'+_0x144b24)[_0xe342('0x19')](_0xe8b832);}return null;};}function patchUpdates(_0x420036){return function(_0x5731e8){try{jsonpatch[_0xe342('0x20')](_0x5731e8,_0x420036,!![]);}catch(_0x45d096){return BPromise['reject'](_0x45d096);}return _0x5731e8[_0xe342('0x21')]();};}function saveUpdates(_0x56cd1e,_0x2fe50d){return function(_0x26d2a2){if(_0x26d2a2){return _0x26d2a2[_0xe342('0x22')](_0x56cd1e)[_0xe342('0x23')](function(_0x4e3950){return _0x4e3950;});}return null;};}function removeEntity(_0x2e70f5,_0x415aaf){return function(_0x212a7e){if(_0x212a7e){return _0x212a7e['destroy']()['then'](function(){_0x2e70f5[_0xe342('0x18')](0xcc)[_0xe342('0x24')]();});}};}function handleEntityNotFound(_0x5e6e3f,_0x3bde64){return function(_0x1a79ad){if(!_0x1a79ad){_0x5e6e3f[_0xe342('0x17')](0x194);}return _0x1a79ad;};}function handleError(_0x33078f,_0x294e2){_0x294e2=_0x294e2||0x1f4;return function(_0x20f9cc){logger['error'](_0x20f9cc[_0xe342('0x25')]);if(_0x20f9cc['name']){delete _0x20f9cc[_0xe342('0x26')];}_0x33078f[_0xe342('0x18')](_0x294e2)['send'](_0x20f9cc);};}exports['show']=function(_0x1c7c97,_0x2737a1){var _0x447899={'raw':!![],'where':{'id':_0x1c7c97[_0xe342('0x27')]['id']}},_0x2e4df6={};_0x2e4df6[_0xe342('0x28')]=_[_0xe342('0x29')](db[_0xe342('0x2a')][_0xe342('0x2b')]);_0x2e4df6[_0xe342('0x2c')]=_['keys'](_0x1c7c97[_0xe342('0x2c')]);_0x2e4df6[_0xe342('0x2d')]=_[_0xe342('0x2e')](_0x2e4df6['model'],_0x2e4df6['query']);_0x447899[_0xe342('0x2f')]=_['intersection'](_0x2e4df6[_0xe342('0x28')],qs[_0xe342('0x30')](_0x1c7c97[_0xe342('0x2c')][_0xe342('0x30')]));_0x447899[_0xe342('0x2f')]=_0x447899[_0xe342('0x2f')][_0xe342('0x31')]?_0x447899[_0xe342('0x2f')]:_0x2e4df6[_0xe342('0x28')];if(_0x1c7c97[_0xe342('0x2c')][_0xe342('0x32')]){_0x447899[_0xe342('0x33')]=[{'all':!![]}];}_0x447899=_['merge']({},_0x447899,_0x1c7c97[_0xe342('0x34')]);return db[_0xe342('0x2a')][_0xe342('0x35')](_0x447899)['then'](handleEntityNotFound(_0x2737a1,null))['then'](respondWithResult(_0x2737a1,null))[_0xe342('0x36')](handleError(_0x2737a1,null));};exports[_0xe342('0x22')]=function(_0x5d0ae3,_0xa002ca){if(_0x5d0ae3[_0xe342('0x37')]['id']){delete _0x5d0ae3[_0xe342('0x37')]['id'];}return db[_0xe342('0x2a')][_0xe342('0x35')]({'where':{'id':_0x5d0ae3[_0xe342('0x27')]['id']}})['then'](handleEntityNotFound(_0xa002ca,null))[_0xe342('0x23')](saveUpdates(_0x5d0ae3[_0xe342('0x37')],null))['then'](respondWithResult(_0xa002ca,null))[_0xe342('0x36')](handleError(_0xa002ca,null));};exports['destroy']=function(_0x2000b5,_0xa7c673){return db[_0xe342('0x2a')][_0xe342('0x35')]({'where':{'id':_0x2000b5[_0xe342('0x27')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0xa7c673,null))[_0xe342('0x23')](removeEntity(_0xa7c673,null))['catch'](handleError(_0xa7c673,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7762=['define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','./chatApplication.attributes','exports'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x7762,0x1c6));var _0x2776=function(_0x5cd7a6,_0x59b9cf){_0x5cd7a6=_0x5cd7a6-0x0;var _0x1165b=_0x7762[_0x5cd7a6];return _0x1165b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2776('0x0'))('api');var moment=require(_0x2776('0x1'));var BPromise=require(_0x2776('0x2'));var rp=require(_0x2776('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2776('0x4'));module[_0x2776('0x5')]=function(_0x277e6c,_0x2fadf1){return _0x277e6c[_0x2776('0x6')](_0x2776('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2776('0x8'),'collate':_0x2776('0x9')});};
\ No newline at end of file
+var _0xec6b=['utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf','ChatApplication'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0xec6b,0x129));var _0xbec6=function(_0xe64cd1,_0x34d8dd){_0xe64cd1=_0xe64cd1-0x0;var _0x2f7ac6=_0xec6b[_0xe64cd1];return _0x2f7ac6;};'use strict';var _=require(_0xbec6('0x0'));var util=require(_0xbec6('0x1'));var logger=require('../../config/logger')(_0xbec6('0x2'));var moment=require('moment');var BPromise=require(_0xbec6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbec6('0x4'));var rimraf=require(_0xbec6('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x5c3383,_0x533245){return _0x5c3383['define'](_0xbec6('0x6'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbec6('0x7')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x82e1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x21b6a1,_0x315bb2){var _0x41f387=function(_0x6a10bf){while(--_0x6a10bf){_0x21b6a1['push'](_0x21b6a1['shift']());}};_0x41f387(++_0x315bb2);}(_0x82e1,0x18b));var _0x182e=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x82e1[_0x3e2489];return _0x2254ce;};'use strict';var _=require(_0x182e('0x0'));var util=require(_0x182e('0x1'));var moment=require('moment');var BPromise=require(_0x182e('0x2'));var rs=require(_0x182e('0x3'));var fs=require('fs');var Redis=require(_0x182e('0x4'));var db=require(_0x182e('0x5'))['db'];var utils=require(_0x182e('0x6'));var logger=require(_0x182e('0x7'))('rpc');var config=require(_0x182e('0x8'));var jayson=require(_0x182e('0x9'));var client=jayson[_0x182e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45e6d1,_0x50994f,_0x4bcfb7){return new BPromise(function(_0x118a96,_0x4bda14){return client['request'](_0x45e6d1,_0x4bcfb7)[_0x182e('0xb')](function(_0x5140c6){logger['info'](_0x182e('0xc'),_0x50994f,_0x182e('0xd'));logger[_0x182e('0xe')](_0x182e('0xf'),_0x50994f,_0x182e('0xd'),JSON['stringify'](_0x5140c6));if(_0x5140c6[_0x182e('0x10')]){if(_0x5140c6['error'][_0x182e('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x50994f,_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);return _0x4bda14(_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);}logger[_0x182e('0x10')](_0x182e('0xc'),_0x50994f,_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);return _0x118a96(_0x5140c6[_0x182e('0x10')][_0x182e('0x12')]);}else{logger['info'](_0x182e('0xc'),_0x50994f,_0x182e('0xd'));_0x118a96(_0x5140c6[_0x182e('0x13')]['message']);}})[_0x182e('0x14')](function(_0x5189c4){logger[_0x182e('0x10')]('ChatApplication,\x20%s,\x20%s',_0x50994f,_0x5189c4);_0x4bda14(_0x5189c4);});});}
\ No newline at end of file
+var _0x499c=['ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x499c,0xd9));var _0xc499=function(_0x3247fc,_0x483b93){_0x3247fc=_0x3247fc-0x0;var _0x163dc8=_0x499c[_0x3247fc];return _0x163dc8;};'use strict';var _=require(_0xc499('0x0'));var util=require(_0xc499('0x1'));var moment=require('moment');var BPromise=require(_0xc499('0x2'));var rs=require(_0xc499('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc499('0x4'))['db'];var utils=require(_0xc499('0x5'));var logger=require(_0xc499('0x6'))('rpc');var config=require(_0xc499('0x7'));var jayson=require(_0xc499('0x8'));var client=jayson[_0xc499('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x269eb4,_0x214fb6,_0x486ce3){return new BPromise(function(_0x238340,_0x5a1c29){return client[_0xc499('0xa')](_0x269eb4,_0x486ce3)[_0xc499('0xb')](function(_0x31781a){logger[_0xc499('0xc')](_0xc499('0xd'),_0x214fb6,'request\x20sent');logger['debug'](_0xc499('0xe'),_0x214fb6,_0xc499('0xf'),JSON[_0xc499('0x10')](_0x31781a));if(_0x31781a[_0xc499('0x11')]){if(_0x31781a[_0xc499('0x11')][_0xc499('0x12')]===0x1f4){logger[_0xc499('0x11')](_0xc499('0xd'),_0x214fb6,_0x31781a[_0xc499('0x11')]['message']);return _0x5a1c29(_0x31781a['error'][_0xc499('0x13')]);}logger[_0xc499('0x11')](_0xc499('0xd'),_0x214fb6,_0x31781a[_0xc499('0x11')][_0xc499('0x13')]);return _0x238340(_0x31781a['error']['message']);}else{logger[_0xc499('0xc')]('ChatApplication,\x20%s,\x20%s',_0x214fb6,'request\x20sent');_0x238340(_0x31781a[_0xc499('0x14')][_0xc499('0x13')]);}})['catch'](function(_0x4dc979){logger['error'](_0xc499('0xd'),_0x214fb6,_0x4dc979);_0x5a1c29(_0x4dc979);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa88f=['isAuthenticated','show','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./chatApplication.controller','get','/:id'];(function(_0x786480,_0x1e5b82){var _0x3500a3=function(_0x439ce5){while(--_0x439ce5){_0x786480['push'](_0x786480['shift']());}};_0x3500a3(++_0x1e5b82);}(_0xa88f,0x158));var _0xfa88=function(_0x1e657b,_0x5bde0a){_0x1e657b=_0x1e657b-0x0;var _0x4a425d=_0xa88f[_0x1e657b];return _0x4a425d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa88('0x0'));var timeout=require(_0xfa88('0x1'));var express=require(_0xfa88('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfa88('0x3'));var config=require('../../config/environment');var controller=require(_0xfa88('0x4'));router[_0xfa88('0x5')](_0xfa88('0x6'),auth[_0xfa88('0x7')](),controller[_0xfa88('0x8')]);router['put'](_0xfa88('0x6'),auth['isAuthenticated'](),controller[_0xfa88('0x9')]);router[_0xfa88('0xa')](_0xfa88('0x6'),auth[_0xfa88('0x7')](),controller[_0xfa88('0xb')]);module[_0xfa88('0xc')]=router;
\ No newline at end of file
+var _0xa446=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','/:id','update','delete'];(function(_0x534301,_0x7be8bd){var _0x5dec70=function(_0x4cc0f7){while(--_0x4cc0f7){_0x534301['push'](_0x534301['shift']());}};_0x5dec70(++_0x7be8bd);}(_0xa446,0x1b4));var _0x6a44=function(_0x1cb04a,_0x113577){_0x1cb04a=_0x1cb04a-0x0;var _0x5c3a6b=_0xa446[_0x1cb04a];return _0x5c3a6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a44('0x0'));var timeout=require(_0x6a44('0x1'));var express=require(_0x6a44('0x2'));var router=express[_0x6a44('0x3')]();var fs_extra=require(_0x6a44('0x4'));var auth=require(_0x6a44('0x5'));var interaction=require(_0x6a44('0x6'));var config=require(_0x6a44('0x7'));var controller=require(_0x6a44('0x8'));router[_0x6a44('0x9')]('/:id',auth[_0x6a44('0xa')](),controller['show']);router['put'](_0x6a44('0xb'),auth[_0x6a44('0xa')](),controller[_0x6a44('0xc')]);router[_0x6a44('0xd')]('/:id',auth[_0x6a44('0xa')](),controller[_0x6a44('0xe')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd9ed=['BOOLEAN','sequelize','STRING'];(function(_0x1b692f,_0x4cc467){var _0xef0963=function(_0x5809b5){while(--_0x5809b5){_0x1b692f['push'](_0x1b692f['shift']());}};_0xef0963(++_0x4cc467);}(_0xd9ed,0x18a));var _0xdd9e=function(_0x2b398d,_0x3c67ed){_0x2b398d=_0x2b398d-0x0;var _0x2f68aa=_0xd9ed[_0x2b398d];return _0x2f68aa;};'use strict';var Sequelize=require(_0xdd9e('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd9e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdd9e('0x1')]},'write':{'type':Sequelize[_0xdd9e('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc16d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x113788,_0x527fe5){var _0x9d6f47=function(_0x318d65){while(--_0x318d65){_0x113788['push'](_0x113788['shift']());}};_0x9d6f47(++_0x527fe5);}(_0xc16d,0x145));var _0xdc16=function(_0x4889d7,_0x4d27a3){_0x4889d7=_0x4889d7-0x0;var _0x2d1868=_0xc16d[_0x4889d7];return _0x2d1868;};'use strict';var Sequelize=require(_0xdc16('0x0'));module[_0xdc16('0x1')]={'name':{'type':Sequelize[_0xdc16('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdc16('0x2')]},'write':{'type':Sequelize[_0xdc16('0x3')],'defaultValue':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ac5=['json','offset','undefined','limit','count','set','reject','save','then','destroy','end','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','ChatInternalMessage','addMembers','ids','User','getMembers','nolimit','removeMembers','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status'];(function(_0x492287,_0x38d7e3){var _0x2b07c2=function(_0xa435f0){while(--_0xa435f0){_0x492287['push'](_0x492287['shift']());}};_0x2b07c2(++_0x38d7e3);}(_0x8ac5,0x163));var _0x58ac=function(_0x3c2212,_0x46c371){_0x3c2212=_0x3c2212-0x0;var _0x4d7bbf=_0x8ac5[_0x3c2212];return _0x4d7bbf;};'use strict';var emlformat=require(_0x58ac('0x0'));var rimraf=require(_0x58ac('0x1'));var zipdir=require(_0x58ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58ac('0x3'));var moment=require(_0x58ac('0x4'));var BPromise=require(_0x58ac('0x5'));var Mustache=require(_0x58ac('0x6'));var util=require('util');var path=require(_0x58ac('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x58ac('0x8'));var fs=require('fs');var fs_extra=require(_0x58ac('0x9'));var _=require(_0x58ac('0xa'));var squel=require(_0x58ac('0xb'));var crypto=require(_0x58ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x58ac('0xd'));var toCsv=require(_0x58ac('0xe'));var querystring=require(_0x58ac('0xf'));var Papa=require(_0x58ac('0x10'));var Redis=require(_0x58ac('0x11'));var authService=require(_0x58ac('0x12'));var qs=require(_0x58ac('0x13'));var as=require(_0x58ac('0x14'));var hardwareService=require(_0x58ac('0x15'));var logger=require(_0x58ac('0x16'))(_0x58ac('0x17'));var utils=require('../../config/utils');var config=require(_0x58ac('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x58ac('0x19'))['db'];config[_0x58ac('0x1a')]=_['defaults'](config['redis'],{'host':_0x58ac('0x1b'),'port':0x18eb});var socket=require(_0x58ac('0x1c'))(new Redis(config[_0x58ac('0x1a')]));require(_0x58ac('0x1d'))[_0x58ac('0x1e')](socket);function respondWithStatusCode(_0x1ede80,_0xf59e03){_0xf59e03=_0xf59e03||0xcc;return function(_0x932f38){if(_0x932f38){return _0x1ede80[_0x58ac('0x1f')](_0xf59e03);}return _0x1ede80['status'](_0xf59e03)['end']();};}function respondWithResult(_0x1cab2c,_0x5d4ec4){_0x5d4ec4=_0x5d4ec4||0xc8;return function(_0x38216b){if(_0x38216b){return _0x1cab2c[_0x58ac('0x20')](_0x5d4ec4)[_0x58ac('0x21')](_0x38216b);}};}function respondWithFilteredResult(_0x44f5ac,_0x2a7f93){return function(_0x34b3a8){if(_0x34b3a8){var _0x5d0a51=typeof _0x2a7f93[_0x58ac('0x22')]===_0x58ac('0x23')&&typeof _0x2a7f93[_0x58ac('0x24')]==='undefined';var _0x36482c=_0x34b3a8[_0x58ac('0x25')];var _0x2fcad5=_0x5d0a51?0x0:_0x2a7f93[_0x58ac('0x22')];var _0xaa96fe=_0x5d0a51?_0x34b3a8[_0x58ac('0x25')]:_0x2a7f93[_0x58ac('0x22')]+_0x2a7f93[_0x58ac('0x24')];var _0x9a6093;if(_0xaa96fe>=_0x36482c){_0xaa96fe=_0x36482c;_0x9a6093=0xc8;}else{_0x9a6093=0xce;}_0x44f5ac[_0x58ac('0x20')](_0x9a6093);return _0x44f5ac[_0x58ac('0x26')]('Content-Range',_0x2fcad5+'-'+_0xaa96fe+'/'+_0x36482c)['json'](_0x34b3a8);}return null;};}function patchUpdates(_0x3b34e3){return function(_0x2c0b40){try{jsonpatch['apply'](_0x2c0b40,_0x3b34e3,!![]);}catch(_0x37ebbe){return BPromise[_0x58ac('0x27')](_0x37ebbe);}return _0x2c0b40[_0x58ac('0x28')]();};}function saveUpdates(_0x342cae,_0x420ce8){return function(_0xd803b6){if(_0xd803b6){return _0xd803b6['update'](_0x342cae)[_0x58ac('0x29')](function(_0x306daa){return _0x306daa;});}return null;};}function removeEntity(_0x891e8b,_0x45fd88){return function(_0x31c9b5){if(_0x31c9b5){return _0x31c9b5[_0x58ac('0x2a')]()[_0x58ac('0x29')](function(){_0x891e8b[_0x58ac('0x20')](0xcc)[_0x58ac('0x2b')]();});}};}function handleEntityNotFound(_0x48abce,_0x330688){return function(_0x1c8521){if(!_0x1c8521){_0x48abce['sendStatus'](0x194);}return _0x1c8521;};}function handleError(_0x12c758,_0x2347ae){_0x2347ae=_0x2347ae||0x1f4;return function(_0x1617ae){logger[_0x58ac('0x2c')](_0x1617ae[_0x58ac('0x2d')]);if(_0x1617ae[_0x58ac('0x2e')]){delete _0x1617ae['name'];}_0x12c758[_0x58ac('0x20')](_0x2347ae)[_0x58ac('0x2f')](_0x1617ae);};}exports[_0x58ac('0x30')]=function(_0x191bcc,_0x274d1c){var _0x46d14b={},_0x28d120={},_0x3797f2={'count':0x0,'rows':[]};var _0x2b32c6=_['map'](db[_0x58ac('0x31')][_0x58ac('0x32')],function(_0x191c32){return{'name':_0x191c32[_0x58ac('0x33')],'type':_0x191c32['type'][_0x58ac('0x34')]};});_0x28d120[_0x58ac('0x35')]=_[_0x58ac('0x36')](_0x2b32c6,_0x58ac('0x2e'));_0x28d120[_0x58ac('0x37')]=_[_0x58ac('0x38')](_0x191bcc['query']);_0x28d120['filters']=_[_0x58ac('0x39')](_0x28d120[_0x58ac('0x35')],_0x28d120['query']);_0x46d14b[_0x58ac('0x3a')]=_[_0x58ac('0x39')](_0x28d120[_0x58ac('0x35')],qs[_0x58ac('0x3b')](_0x191bcc[_0x58ac('0x37')][_0x58ac('0x3b')]));_0x46d14b[_0x58ac('0x3a')]=_0x46d14b[_0x58ac('0x3a')][_0x58ac('0x3c')]?_0x46d14b[_0x58ac('0x3a')]:_0x28d120[_0x58ac('0x35')];if(!_0x191bcc[_0x58ac('0x37')][_0x58ac('0x3d')]('nolimit')){_0x46d14b[_0x58ac('0x24')]=qs[_0x58ac('0x24')](_0x191bcc['query'][_0x58ac('0x24')]);_0x46d14b[_0x58ac('0x22')]=qs[_0x58ac('0x22')](_0x191bcc[_0x58ac('0x37')][_0x58ac('0x22')]);}_0x46d14b[_0x58ac('0x3e')]=qs[_0x58ac('0x3f')](_0x191bcc[_0x58ac('0x37')][_0x58ac('0x3f')]);_0x46d14b['where']=qs['filters'](_[_0x58ac('0x40')](_0x191bcc[_0x58ac('0x37')],_0x28d120[_0x58ac('0x41')]),_0x2b32c6);if(_0x191bcc[_0x58ac('0x37')][_0x58ac('0x42')]){_0x46d14b['where']=_[_0x58ac('0x43')](_0x46d14b['where'],{'$or':_[_0x58ac('0x36')](_0x2b32c6,function(_0x50857b){if(_0x50857b[_0x58ac('0x44')]!==_0x58ac('0x45')){var _0x1d78a5={};_0x1d78a5[_0x50857b['name']]={'$like':'%'+_0x191bcc[_0x58ac('0x37')][_0x58ac('0x42')]+'%'};return _0x1d78a5;}})});}_0x46d14b=_[_0x58ac('0x43')]({},_0x46d14b,_0x191bcc[_0x58ac('0x46')]);var _0x5ef14d={'where':_0x46d14b[_0x58ac('0x47')]};return db[_0x58ac('0x31')]['count'](_0x5ef14d)[_0x58ac('0x29')](function(_0x24229f){_0x3797f2[_0x58ac('0x25')]=_0x24229f;if(_0x191bcc[_0x58ac('0x37')][_0x58ac('0x48')]){_0x46d14b[_0x58ac('0x49')]=[{'all':!![]}];}return db['ChatGroup'][_0x58ac('0x4a')](_0x46d14b);})[_0x58ac('0x29')](function(_0x18d1ee){_0x3797f2[_0x58ac('0x4b')]=_0x18d1ee;return _0x3797f2;})[_0x58ac('0x29')](respondWithFilteredResult(_0x274d1c,_0x46d14b))[_0x58ac('0x4c')](handleError(_0x274d1c,null));};exports[_0x58ac('0x4d')]=function(_0x395671,_0x1a88a6){var _0x3cdeec={'raw':!![],'where':{'id':_0x395671[_0x58ac('0x4e')]['id']}},_0x1ade63={};_0x1ade63[_0x58ac('0x35')]=_['keys'](db[_0x58ac('0x31')]['rawAttributes']);_0x1ade63['query']=_['keys'](_0x395671['query']);_0x1ade63[_0x58ac('0x41')]=_[_0x58ac('0x39')](_0x1ade63[_0x58ac('0x35')],_0x1ade63[_0x58ac('0x37')]);_0x3cdeec[_0x58ac('0x3a')]=_['intersection'](_0x1ade63[_0x58ac('0x35')],qs[_0x58ac('0x3b')](_0x395671[_0x58ac('0x37')]['fields']));_0x3cdeec[_0x58ac('0x3a')]=_0x3cdeec['attributes'][_0x58ac('0x3c')]?_0x3cdeec[_0x58ac('0x3a')]:_0x1ade63[_0x58ac('0x35')];if(_0x395671['query'][_0x58ac('0x48')]){_0x3cdeec['include']=[{'all':!![]}];}_0x3cdeec=_[_0x58ac('0x43')]({},_0x3cdeec,_0x395671[_0x58ac('0x46')]);return db[_0x58ac('0x31')][_0x58ac('0x4f')](_0x3cdeec)[_0x58ac('0x29')](handleEntityNotFound(_0x1a88a6,null))[_0x58ac('0x29')](respondWithResult(_0x1a88a6,null))[_0x58ac('0x4c')](handleError(_0x1a88a6,null));};exports[_0x58ac('0x50')]=function(_0x3b223b,_0x4863cf){return db['ChatGroup'][_0x58ac('0x50')](_0x3b223b[_0x58ac('0x51')],{})['then'](respondWithResult(_0x4863cf,0xc9))[_0x58ac('0x4c')](handleError(_0x4863cf,null));};exports[_0x58ac('0x52')]=function(_0x2f3f2f,_0x254964){if(_0x2f3f2f['body']['id']){delete _0x2f3f2f[_0x58ac('0x51')]['id'];}return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x2f3f2f['params']['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x254964,null))[_0x58ac('0x29')](saveUpdates(_0x2f3f2f[_0x58ac('0x51')],null))[_0x58ac('0x29')](respondWithResult(_0x254964,null))['catch'](handleError(_0x254964,null));};exports[_0x58ac('0x2a')]=function(_0xdbb969,_0xe6eb06){return db['ChatGroup'][_0x58ac('0x4f')]({'where':{'id':_0xdbb969[_0x58ac('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe6eb06,null))['then'](removeEntity(_0xe6eb06,null))[_0x58ac('0x4c')](handleError(_0xe6eb06,null));};exports[_0x58ac('0x53')]=function(_0xed2f47,_0x2b791b){return db[_0x58ac('0x31')][_0x58ac('0x53')]()[_0x58ac('0x29')](respondWithResult(_0x2b791b,null))[_0x58ac('0x4c')](handleError(_0x2b791b,null));};exports['getUnread']=function(_0x27c08d,_0x2faf1f,_0x19da17){return db[_0x58ac('0x54')][_0x58ac('0x25')]({'where':{'ChatGroupId':_0x27c08d[_0x58ac('0x4e')]['id'],'ToId':_0x27c08d['user']['id'],'read':![]}})[_0x58ac('0x29')](function(_0x5aa160){return{'id':_['toInteger'](_0x27c08d['params']['id']),'count':_0x5aa160};})[_0x58ac('0x29')](respondWithResult(_0x2faf1f,null))[_0x58ac('0x4c')](handleError(_0x2faf1f,null));};exports[_0x58ac('0x55')]=function(_0x160bc2,_0x6f283,_0x28d2f3){return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x160bc2[_0x58ac('0x4e')]['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x6f283,null))[_0x58ac('0x29')](function(_0x544904){if(_0x544904){return _0x544904[_0x58ac('0x55')](_0x160bc2[_0x58ac('0x51')][_0x58ac('0x56')],_['omit'](_0x160bc2[_0x58ac('0x51')],['ids','id'])||{});}})[_0x58ac('0x29')](respondWithResult(_0x6f283,null))[_0x58ac('0x4c')](handleError(_0x6f283,null));};exports['getMembers']=function(_0x265de8,_0x3fb85a,_0xc0c292){var _0x956cd={};var _0x945532={};var _0x359b69;var _0x28d7af;return db[_0x58ac('0x31')]['findOne']({'where':{'id':_0x265de8['params']['id']}})['then'](handleEntityNotFound(_0x3fb85a,null))[_0x58ac('0x29')](function(_0x496ba1){if(_0x496ba1){_0x359b69=_0x496ba1;_0x945532[_0x58ac('0x35')]=_[_0x58ac('0x38')](db[_0x58ac('0x57')][_0x58ac('0x32')]);_0x945532[_0x58ac('0x37')]=_[_0x58ac('0x38')](_0x265de8[_0x58ac('0x37')]);_0x945532['filters']=_[_0x58ac('0x39')](_0x945532[_0x58ac('0x35')],_0x945532[_0x58ac('0x37')]);_0x956cd[_0x58ac('0x3a')]=_['intersection'](_0x945532['model'],qs[_0x58ac('0x3b')](_0x265de8[_0x58ac('0x37')]['fields']));_0x956cd[_0x58ac('0x3a')]=_0x956cd[_0x58ac('0x3a')][_0x58ac('0x3c')]?_0x956cd[_0x58ac('0x3a')]:_0x945532['model'];_0x956cd[_0x58ac('0x3e')]=qs[_0x58ac('0x3f')](_0x265de8['query'][_0x58ac('0x3f')]);_0x956cd[_0x58ac('0x47')]=qs[_0x58ac('0x41')](_[_0x58ac('0x40')](_0x265de8[_0x58ac('0x37')],_0x945532[_0x58ac('0x41')]));if(_0x265de8[_0x58ac('0x37')]['filter']){_0x956cd[_0x58ac('0x47')]=_[_0x58ac('0x43')](_0x956cd[_0x58ac('0x47')],{'$or':_[_0x58ac('0x36')](_0x956cd[_0x58ac('0x3a')],function(_0x348022){var _0x575e5d={};_0x575e5d[_0x348022]={'$like':'%'+_0x265de8[_0x58ac('0x37')][_0x58ac('0x42')]+'%'};return _0x575e5d;})});}_0x956cd=_[_0x58ac('0x43')]({},_0x956cd,_0x265de8[_0x58ac('0x46')]);return _0x359b69[_0x58ac('0x58')](_0x956cd);}})[_0x58ac('0x29')](function(_0x1b8018){if(_0x1b8018){_0x28d7af=_0x1b8018[_0x58ac('0x3c')];if(!_0x265de8['query'][_0x58ac('0x3d')](_0x58ac('0x59'))){_0x956cd[_0x58ac('0x24')]=qs[_0x58ac('0x24')](_0x265de8[_0x58ac('0x37')][_0x58ac('0x24')]);_0x956cd['offset']=qs[_0x58ac('0x22')](_0x265de8[_0x58ac('0x37')][_0x58ac('0x22')]);}return _0x359b69[_0x58ac('0x58')](_0x956cd);}})['then'](function(_0x3f18cd){if(_0x3f18cd){return _0x3f18cd?{'count':_0x28d7af,'rows':_0x3f18cd}:null;}})['then'](respondWithResult(_0x3fb85a,null))[_0x58ac('0x4c')](handleError(_0x3fb85a,null));};exports['removeMembers']=function(_0x59d3d2,_0x42431f,_0x5dc06e){return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x59d3d2['params']['id']}})['then'](handleEntityNotFound(_0x42431f,null))[_0x58ac('0x29')](function(_0x1e459d){if(_0x1e459d){return _0x1e459d[_0x58ac('0x5a')](_0x59d3d2['query']['ids']);}})[_0x58ac('0x29')](respondWithStatusCode(_0x42431f,null))['catch'](handleError(_0x42431f,null));};exports['addMessage']=function(_0x7babb9,_0x5ad54b,_0x39d17b){if(_0x7babb9[_0x58ac('0x51')]['id']){delete _0x7babb9[_0x58ac('0x51')]['id'];}return db[_0x58ac('0x31')][_0x58ac('0x4f')]({'where':{'id':_0x7babb9['params']['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x5ad54b,null))[_0x58ac('0x29')](function(_0x3c7fed){if(_0x3c7fed){_0x7babb9[_0x58ac('0x51')][_0x58ac('0x5b')]=_0x3c7fed['id'];return db[_0x58ac('0x54')][_0x58ac('0x50')](_0x7babb9['body']);}})[_0x58ac('0x29')](respondWithResult(_0x5ad54b,null))[_0x58ac('0x4c')](handleError(_0x5ad54b,null));};exports[_0x58ac('0x5c')]=function(_0x20c9b5,_0x35f0da,_0x216797){var _0x295402={};var _0x5de71e={};var _0x48f1b8;var _0x2191b7;return db['ChatGroup'][_0x58ac('0x5d')]({'where':{'id':_0x20c9b5[_0x58ac('0x4e')]['id']}})[_0x58ac('0x29')](handleEntityNotFound(_0x35f0da,null))[_0x58ac('0x29')](function(_0x1391e7){if(_0x1391e7){_0x48f1b8=_0x1391e7;_0x5de71e[_0x58ac('0x35')]=_[_0x58ac('0x38')](db[_0x58ac('0x54')][_0x58ac('0x32')]);_0x5de71e[_0x58ac('0x37')]=_[_0x58ac('0x38')](_0x20c9b5[_0x58ac('0x37')]);_0x5de71e[_0x58ac('0x41')]=_[_0x58ac('0x39')](_0x5de71e[_0x58ac('0x35')],_0x5de71e[_0x58ac('0x37')]);_0x295402[_0x58ac('0x3a')]=_['intersection'](_0x5de71e[_0x58ac('0x35')],qs[_0x58ac('0x3b')](_0x20c9b5[_0x58ac('0x37')]['fields']));_0x295402[_0x58ac('0x3a')]=_0x295402[_0x58ac('0x3a')][_0x58ac('0x3c')]?_0x295402['attributes']:_0x5de71e[_0x58ac('0x35')];_0x295402[_0x58ac('0x3e')]=qs[_0x58ac('0x3f')](_0x20c9b5[_0x58ac('0x37')]['sort']);_0x295402['where']=qs[_0x58ac('0x41')](_[_0x58ac('0x40')](_0x20c9b5['query'],_0x5de71e[_0x58ac('0x41')]));if(_0x20c9b5['query'][_0x58ac('0x42')]){_0x295402[_0x58ac('0x47')]=_[_0x58ac('0x43')](_0x295402['where'],{'$or':_[_0x58ac('0x36')](_0x295402[_0x58ac('0x3a')],function(_0x247f86){var _0x423041={};_0x423041[_0x247f86]={'$like':'%'+_0x20c9b5[_0x58ac('0x37')]['filter']+'%'};return _0x423041;})});}if(_0x20c9b5[_0x58ac('0x37')][_0x58ac('0x5e')]){var _0x4a978e=_0x20c9b5['query']['$gte']['split'](',');var _0x1e0ea9={};_0x1e0ea9[_0x4a978e[0x0]]={'$gte':moment(_0x4a978e[0x1])[_0x58ac('0x5f')](_0x58ac('0x60'))};_0x295402[_0x58ac('0x47')]=_[_0x58ac('0x43')](_0x295402[_0x58ac('0x47')],_0x1e0ea9);}_0x295402=_[_0x58ac('0x43')]({},_0x295402,_0x20c9b5[_0x58ac('0x46')]);return _0x48f1b8[_0x58ac('0x5c')](_0x295402);}})[_0x58ac('0x29')](function(_0x21c435){if(_0x21c435){_0x2191b7=_0x21c435[_0x58ac('0x3c')];if(!_0x20c9b5[_0x58ac('0x37')][_0x58ac('0x3d')](_0x58ac('0x59'))){_0x295402['limit']=qs[_0x58ac('0x24')](_0x20c9b5['query'][_0x58ac('0x24')]);_0x295402[_0x58ac('0x22')]=qs[_0x58ac('0x22')](_0x20c9b5[_0x58ac('0x37')][_0x58ac('0x22')]);}return _0x48f1b8[_0x58ac('0x5c')](_0x295402);}})[_0x58ac('0x29')](function(_0x49a4ee){if(_0x49a4ee){return _0x49a4ee?{'count':_0x2191b7,'rows':_0x49a4ee}:null;}})[_0x58ac('0x29')](respondWithResult(_0x35f0da,null))[_0x58ac('0x4c')](handleError(_0x35f0da,null));};
\ No newline at end of file
+var _0x974b=['merge','type','ChatGroup','includeAll','include','findAll','rows','catch','show','params','create','body','describe','user','toInteger','addMembers','find','ids','getMembers','findOne','User','options','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','format','eml-format','rimraf','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0xdbd4f8,_0x254077){var _0x15ba26=function(_0x5e3c44){while(--_0x5e3c44){_0xdbd4f8['push'](_0xdbd4f8['shift']());}};_0x15ba26(++_0x254077);}(_0x974b,0x1da));var _0xb974=function(_0x4fcb07,_0x4a77a4){_0x4fcb07=_0x4fcb07-0x0;var _0xf2eeb=_0x974b[_0x4fcb07];return _0xf2eeb;};'use strict';var emlformat=require(_0xb974('0x0'));var rimraf=require(_0xb974('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb974('0x2'));var moment=require(_0xb974('0x3'));var BPromise=require(_0xb974('0x4'));var Mustache=require('mustache');var util=require(_0xb974('0x5'));var path=require(_0xb974('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb974('0x7'));var fs=require('fs');var fs_extra=require(_0xb974('0x8'));var _=require(_0xb974('0x9'));var squel=require('squel');var crypto=require(_0xb974('0xa'));var jsforce=require(_0xb974('0xb'));var deskjs=require(_0xb974('0xc'));var toCsv=require(_0xb974('0xd'));var querystring=require('querystring');var Papa=require(_0xb974('0xe'));var Redis=require('ioredis');var authService=require(_0xb974('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb974('0x10'));var hardwareService=require(_0xb974('0x11'));var logger=require(_0xb974('0x12'))(_0xb974('0x13'));var utils=require(_0xb974('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb974('0x15'));var db=require(_0xb974('0x16'))['db'];config[_0xb974('0x17')]=_['defaults'](config[_0xb974('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb974('0x18'))(new Redis(config[_0xb974('0x17')]));require('./chatGroup.socket')[_0xb974('0x19')](socket);function respondWithStatusCode(_0x42706b,_0x315e8f){_0x315e8f=_0x315e8f||0xcc;return function(_0x269dbc){if(_0x269dbc){return _0x42706b['sendStatus'](_0x315e8f);}return _0x42706b[_0xb974('0x1a')](_0x315e8f)[_0xb974('0x1b')]();};}function respondWithResult(_0x51117b,_0x460fc4){_0x460fc4=_0x460fc4||0xc8;return function(_0x4593a8){if(_0x4593a8){return _0x51117b['status'](_0x460fc4)[_0xb974('0x1c')](_0x4593a8);}};}function respondWithFilteredResult(_0x5a886d,_0x1279cf){return function(_0x478368){if(_0x478368){var _0x208c9e=typeof _0x1279cf[_0xb974('0x1d')]===_0xb974('0x1e')&&typeof _0x1279cf['limit']===_0xb974('0x1e');var _0x53697f=_0x478368['count'];var _0x3a4556=_0x208c9e?0x0:_0x1279cf['offset'];var _0x29a61f=_0x208c9e?_0x478368[_0xb974('0x1f')]:_0x1279cf[_0xb974('0x1d')]+_0x1279cf[_0xb974('0x20')];var _0x39a418;if(_0x29a61f>=_0x53697f){_0x29a61f=_0x53697f;_0x39a418=0xc8;}else{_0x39a418=0xce;}_0x5a886d[_0xb974('0x1a')](_0x39a418);return _0x5a886d['set']('Content-Range',_0x3a4556+'-'+_0x29a61f+'/'+_0x53697f)['json'](_0x478368);}return null;};}function patchUpdates(_0x4fc5bf){return function(_0x56fe4b){try{jsonpatch['apply'](_0x56fe4b,_0x4fc5bf,!![]);}catch(_0x4a273a){return BPromise[_0xb974('0x21')](_0x4a273a);}return _0x56fe4b[_0xb974('0x22')]();};}function saveUpdates(_0x265d4c,_0xce3cc8){return function(_0xd980a7){if(_0xd980a7){return _0xd980a7[_0xb974('0x23')](_0x265d4c)['then'](function(_0x3de111){return _0x3de111;});}return null;};}function removeEntity(_0x43283f,_0x43ebdd){return function(_0x154bd0){if(_0x154bd0){return _0x154bd0[_0xb974('0x24')]()[_0xb974('0x25')](function(){_0x43283f[_0xb974('0x1a')](0xcc)[_0xb974('0x1b')]();});}};}function handleEntityNotFound(_0x5811c5,_0x307609){return function(_0x4f1714){if(!_0x4f1714){_0x5811c5['sendStatus'](0x194);}return _0x4f1714;};}function handleError(_0x54f298,_0x3da35f){_0x3da35f=_0x3da35f||0x1f4;return function(_0x400a68){logger['error'](_0x400a68[_0xb974('0x26')]);if(_0x400a68[_0xb974('0x27')]){delete _0x400a68[_0xb974('0x27')];}_0x54f298[_0xb974('0x1a')](_0x3da35f)[_0xb974('0x28')](_0x400a68);};}exports[_0xb974('0x29')]=function(_0x4c4053,_0xa81bf4){var _0x53b77b={},_0x27f6c2={},_0x19eeda={'count':0x0,'rows':[]};var _0x8079e7=_[_0xb974('0x2a')](db['ChatGroup'][_0xb974('0x2b')],function(_0x553e87){return{'name':_0x553e87['fieldName'],'type':_0x553e87['type'][_0xb974('0x2c')]};});_0x27f6c2[_0xb974('0x2d')]=_[_0xb974('0x2a')](_0x8079e7,_0xb974('0x27'));_0x27f6c2[_0xb974('0x2e')]=_[_0xb974('0x2f')](_0x4c4053[_0xb974('0x2e')]);_0x27f6c2[_0xb974('0x30')]=_[_0xb974('0x31')](_0x27f6c2['model'],_0x27f6c2[_0xb974('0x2e')]);_0x53b77b[_0xb974('0x32')]=_[_0xb974('0x31')](_0x27f6c2[_0xb974('0x2d')],qs[_0xb974('0x33')](_0x4c4053[_0xb974('0x2e')][_0xb974('0x33')]));_0x53b77b[_0xb974('0x32')]=_0x53b77b[_0xb974('0x32')][_0xb974('0x34')]?_0x53b77b['attributes']:_0x27f6c2['model'];if(!_0x4c4053['query'][_0xb974('0x35')](_0xb974('0x36'))){_0x53b77b[_0xb974('0x20')]=qs[_0xb974('0x20')](_0x4c4053['query'][_0xb974('0x20')]);_0x53b77b[_0xb974('0x1d')]=qs[_0xb974('0x1d')](_0x4c4053[_0xb974('0x2e')]['offset']);}_0x53b77b[_0xb974('0x37')]=qs[_0xb974('0x38')](_0x4c4053[_0xb974('0x2e')][_0xb974('0x38')]);_0x53b77b[_0xb974('0x39')]=qs[_0xb974('0x30')](_[_0xb974('0x3a')](_0x4c4053[_0xb974('0x2e')],_0x27f6c2[_0xb974('0x30')]),_0x8079e7);if(_0x4c4053['query'][_0xb974('0x3b')]){_0x53b77b['where']=_[_0xb974('0x3c')](_0x53b77b[_0xb974('0x39')],{'$or':_[_0xb974('0x2a')](_0x8079e7,function(_0x5dbc46){if(_0x5dbc46[_0xb974('0x3d')]!=='VIRTUAL'){var _0x44d990={};_0x44d990[_0x5dbc46[_0xb974('0x27')]]={'$like':'%'+_0x4c4053[_0xb974('0x2e')][_0xb974('0x3b')]+'%'};return _0x44d990;}})});}_0x53b77b=_[_0xb974('0x3c')]({},_0x53b77b,_0x4c4053['options']);var _0xe1ce2f={'where':_0x53b77b[_0xb974('0x39')]};return db[_0xb974('0x3e')]['count'](_0xe1ce2f)[_0xb974('0x25')](function(_0x408a1a){_0x19eeda['count']=_0x408a1a;if(_0x4c4053['query'][_0xb974('0x3f')]){_0x53b77b[_0xb974('0x40')]=[{'all':!![]}];}return db[_0xb974('0x3e')][_0xb974('0x41')](_0x53b77b);})['then'](function(_0x50807){_0x19eeda[_0xb974('0x42')]=_0x50807;return _0x19eeda;})['then'](respondWithFilteredResult(_0xa81bf4,_0x53b77b))[_0xb974('0x43')](handleError(_0xa81bf4,null));};exports[_0xb974('0x44')]=function(_0x4340c3,_0x353063){var _0x258b9e={'raw':!![],'where':{'id':_0x4340c3[_0xb974('0x45')]['id']}},_0x1f7b25={};_0x1f7b25['model']=_['keys'](db[_0xb974('0x3e')][_0xb974('0x2b')]);_0x1f7b25['query']=_[_0xb974('0x2f')](_0x4340c3[_0xb974('0x2e')]);_0x1f7b25[_0xb974('0x30')]=_['intersection'](_0x1f7b25[_0xb974('0x2d')],_0x1f7b25[_0xb974('0x2e')]);_0x258b9e[_0xb974('0x32')]=_[_0xb974('0x31')](_0x1f7b25['model'],qs[_0xb974('0x33')](_0x4340c3[_0xb974('0x2e')][_0xb974('0x33')]));_0x258b9e[_0xb974('0x32')]=_0x258b9e['attributes'][_0xb974('0x34')]?_0x258b9e[_0xb974('0x32')]:_0x1f7b25[_0xb974('0x2d')];if(_0x4340c3[_0xb974('0x2e')][_0xb974('0x3f')]){_0x258b9e[_0xb974('0x40')]=[{'all':!![]}];}_0x258b9e=_[_0xb974('0x3c')]({},_0x258b9e,_0x4340c3['options']);return db['ChatGroup']['find'](_0x258b9e)[_0xb974('0x25')](handleEntityNotFound(_0x353063,null))[_0xb974('0x25')](respondWithResult(_0x353063,null))[_0xb974('0x43')](handleError(_0x353063,null));};exports[_0xb974('0x46')]=function(_0x448b6d,_0x43ad8e){return db[_0xb974('0x3e')][_0xb974('0x46')](_0x448b6d['body'],{})['then'](respondWithResult(_0x43ad8e,0xc9))['catch'](handleError(_0x43ad8e,null));};exports[_0xb974('0x23')]=function(_0x37047a,_0x5377e9){if(_0x37047a[_0xb974('0x47')]['id']){delete _0x37047a[_0xb974('0x47')]['id'];}return db[_0xb974('0x3e')]['find']({'where':{'id':_0x37047a[_0xb974('0x45')]['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x5377e9,null))[_0xb974('0x25')](saveUpdates(_0x37047a[_0xb974('0x47')],null))['then'](respondWithResult(_0x5377e9,null))['catch'](handleError(_0x5377e9,null));};exports[_0xb974('0x24')]=function(_0x24142a,_0x26ab32){return db[_0xb974('0x3e')]['find']({'where':{'id':_0x24142a[_0xb974('0x45')]['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x26ab32,null))[_0xb974('0x25')](removeEntity(_0x26ab32,null))[_0xb974('0x43')](handleError(_0x26ab32,null));};exports[_0xb974('0x48')]=function(_0x387506,_0x1b2074){return db[_0xb974('0x3e')][_0xb974('0x48')]()[_0xb974('0x25')](respondWithResult(_0x1b2074,null))['catch'](handleError(_0x1b2074,null));};exports['getUnread']=function(_0x31addb,_0x5d41fe,_0x52fdf3){return db['ChatInternalMessage'][_0xb974('0x1f')]({'where':{'ChatGroupId':_0x31addb['params']['id'],'ToId':_0x31addb[_0xb974('0x49')]['id'],'read':![]}})[_0xb974('0x25')](function(_0x360412){return{'id':_[_0xb974('0x4a')](_0x31addb['params']['id']),'count':_0x360412};})[_0xb974('0x25')](respondWithResult(_0x5d41fe,null))[_0xb974('0x43')](handleError(_0x5d41fe,null));};exports[_0xb974('0x4b')]=function(_0x443628,_0x33efa2,_0x1072f4){return db[_0xb974('0x3e')][_0xb974('0x4c')]({'where':{'id':_0x443628[_0xb974('0x45')]['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x33efa2,null))[_0xb974('0x25')](function(_0x3c195c){if(_0x3c195c){return _0x3c195c[_0xb974('0x4b')](_0x443628[_0xb974('0x47')]['ids'],_['omit'](_0x443628[_0xb974('0x47')],[_0xb974('0x4d'),'id'])||{});}})[_0xb974('0x25')](respondWithResult(_0x33efa2,null))[_0xb974('0x43')](handleError(_0x33efa2,null));};exports[_0xb974('0x4e')]=function(_0x3e194a,_0x2f8990,_0x204d31){var _0x707da2={};var _0x4d938a={};var _0x2dd751;var _0xd5b1d7;return db[_0xb974('0x3e')][_0xb974('0x4f')]({'where':{'id':_0x3e194a[_0xb974('0x45')]['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x2f8990,null))[_0xb974('0x25')](function(_0x2ea369){if(_0x2ea369){_0x2dd751=_0x2ea369;_0x4d938a['model']=_[_0xb974('0x2f')](db[_0xb974('0x50')]['rawAttributes']);_0x4d938a[_0xb974('0x2e')]=_[_0xb974('0x2f')](_0x3e194a['query']);_0x4d938a[_0xb974('0x30')]=_['intersection'](_0x4d938a[_0xb974('0x2d')],_0x4d938a[_0xb974('0x2e')]);_0x707da2[_0xb974('0x32')]=_[_0xb974('0x31')](_0x4d938a[_0xb974('0x2d')],qs['fields'](_0x3e194a[_0xb974('0x2e')][_0xb974('0x33')]));_0x707da2[_0xb974('0x32')]=_0x707da2['attributes'][_0xb974('0x34')]?_0x707da2[_0xb974('0x32')]:_0x4d938a[_0xb974('0x2d')];_0x707da2[_0xb974('0x37')]=qs['sort'](_0x3e194a[_0xb974('0x2e')][_0xb974('0x38')]);_0x707da2[_0xb974('0x39')]=qs[_0xb974('0x30')](_[_0xb974('0x3a')](_0x3e194a['query'],_0x4d938a[_0xb974('0x30')]));if(_0x3e194a[_0xb974('0x2e')][_0xb974('0x3b')]){_0x707da2[_0xb974('0x39')]=_[_0xb974('0x3c')](_0x707da2[_0xb974('0x39')],{'$or':_[_0xb974('0x2a')](_0x707da2[_0xb974('0x32')],function(_0x4098c8){var _0x52b20e={};_0x52b20e[_0x4098c8]={'$like':'%'+_0x3e194a[_0xb974('0x2e')][_0xb974('0x3b')]+'%'};return _0x52b20e;})});}_0x707da2=_[_0xb974('0x3c')]({},_0x707da2,_0x3e194a[_0xb974('0x51')]);return _0x2dd751[_0xb974('0x4e')](_0x707da2);}})[_0xb974('0x25')](function(_0x32664f){if(_0x32664f){_0xd5b1d7=_0x32664f[_0xb974('0x34')];if(!_0x3e194a[_0xb974('0x2e')]['hasOwnProperty'](_0xb974('0x36'))){_0x707da2[_0xb974('0x20')]=qs['limit'](_0x3e194a[_0xb974('0x2e')][_0xb974('0x20')]);_0x707da2[_0xb974('0x1d')]=qs[_0xb974('0x1d')](_0x3e194a[_0xb974('0x2e')][_0xb974('0x1d')]);}return _0x2dd751['getMembers'](_0x707da2);}})[_0xb974('0x25')](function(_0x598875){if(_0x598875){return _0x598875?{'count':_0xd5b1d7,'rows':_0x598875}:null;}})[_0xb974('0x25')](respondWithResult(_0x2f8990,null))[_0xb974('0x43')](handleError(_0x2f8990,null));};exports['removeMembers']=function(_0xd01404,_0x23ca08,_0x4d4d51){return db['ChatGroup'][_0xb974('0x4c')]({'where':{'id':_0xd01404['params']['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x23ca08,null))[_0xb974('0x25')](function(_0x24a6ed){if(_0x24a6ed){return _0x24a6ed[_0xb974('0x52')](_0xd01404['query'][_0xb974('0x4d')]);}})[_0xb974('0x25')](respondWithStatusCode(_0x23ca08,null))[_0xb974('0x43')](handleError(_0x23ca08,null));};exports[_0xb974('0x53')]=function(_0x49649d,_0x399300,_0x2d5ad1){if(_0x49649d[_0xb974('0x47')]['id']){delete _0x49649d[_0xb974('0x47')]['id'];}return db[_0xb974('0x3e')][_0xb974('0x4c')]({'where':{'id':_0x49649d['params']['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x399300,null))[_0xb974('0x25')](function(_0xa9f553){if(_0xa9f553){_0x49649d[_0xb974('0x47')][_0xb974('0x54')]=_0xa9f553['id'];return db[_0xb974('0x55')][_0xb974('0x46')](_0x49649d[_0xb974('0x47')]);}})['then'](respondWithResult(_0x399300,null))['catch'](handleError(_0x399300,null));};exports[_0xb974('0x56')]=function(_0x463982,_0x10cce7,_0x2061ed){var _0x248aef={};var _0xc65ee2={};var _0x45e374;var _0x2e1290;return db[_0xb974('0x3e')][_0xb974('0x4f')]({'where':{'id':_0x463982[_0xb974('0x45')]['id']}})[_0xb974('0x25')](handleEntityNotFound(_0x10cce7,null))[_0xb974('0x25')](function(_0x1756d9){if(_0x1756d9){_0x45e374=_0x1756d9;_0xc65ee2['model']=_[_0xb974('0x2f')](db[_0xb974('0x55')][_0xb974('0x2b')]);_0xc65ee2[_0xb974('0x2e')]=_[_0xb974('0x2f')](_0x463982[_0xb974('0x2e')]);_0xc65ee2['filters']=_[_0xb974('0x31')](_0xc65ee2[_0xb974('0x2d')],_0xc65ee2['query']);_0x248aef[_0xb974('0x32')]=_[_0xb974('0x31')](_0xc65ee2['model'],qs['fields'](_0x463982['query'][_0xb974('0x33')]));_0x248aef[_0xb974('0x32')]=_0x248aef[_0xb974('0x32')][_0xb974('0x34')]?_0x248aef['attributes']:_0xc65ee2[_0xb974('0x2d')];_0x248aef[_0xb974('0x37')]=qs[_0xb974('0x38')](_0x463982[_0xb974('0x2e')][_0xb974('0x38')]);_0x248aef['where']=qs[_0xb974('0x30')](_[_0xb974('0x3a')](_0x463982[_0xb974('0x2e')],_0xc65ee2[_0xb974('0x30')]));if(_0x463982[_0xb974('0x2e')][_0xb974('0x3b')]){_0x248aef['where']=_[_0xb974('0x3c')](_0x248aef[_0xb974('0x39')],{'$or':_[_0xb974('0x2a')](_0x248aef[_0xb974('0x32')],function(_0x186cdd){var _0x2c2252={};_0x2c2252[_0x186cdd]={'$like':'%'+_0x463982[_0xb974('0x2e')][_0xb974('0x3b')]+'%'};return _0x2c2252;})});}if(_0x463982[_0xb974('0x2e')][_0xb974('0x57')]){var _0x191c1a=_0x463982[_0xb974('0x2e')][_0xb974('0x57')]['split'](',');var _0x16d659={};_0x16d659[_0x191c1a[0x0]]={'$gte':moment(_0x191c1a[0x1])[_0xb974('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x248aef['where']=_[_0xb974('0x3c')](_0x248aef[_0xb974('0x39')],_0x16d659);}_0x248aef=_[_0xb974('0x3c')]({},_0x248aef,_0x463982[_0xb974('0x51')]);return _0x45e374['getMessages'](_0x248aef);}})['then'](function(_0x4703e6){if(_0x4703e6){_0x2e1290=_0x4703e6['length'];if(!_0x463982['query'][_0xb974('0x35')](_0xb974('0x36'))){_0x248aef['limit']=qs['limit'](_0x463982['query'][_0xb974('0x20')]);_0x248aef[_0xb974('0x1d')]=qs[_0xb974('0x1d')](_0x463982[_0xb974('0x2e')]['offset']);}return _0x45e374[_0xb974('0x56')](_0x248aef);}})['then'](function(_0xda1456){if(_0xda1456){return _0xda1456?{'count':_0x2e1290,'rows':_0xda1456}:null;}})['then'](respondWithResult(_0x10cce7,null))[_0xb974('0x43')](handleError(_0x10cce7,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe75e=['setMaxListeners','emit','exports','events','../../mysqldb','ChatGroup'];(function(_0x5dd93c,_0x570ecc){var _0x4c3142=function(_0x34c6db){while(--_0x34c6db){_0x5dd93c['push'](_0x5dd93c['shift']());}};_0x4c3142(++_0x570ecc);}(_0xe75e,0x15f));var _0xee75=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xe75e[_0x2d126e];return _0xcb04d3;};'use strict';var EventEmitter=require(_0xee75('0x0'));var ChatGroup=require(_0xee75('0x1'))['db'][_0xee75('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xee75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x22ca13){return function(_0x2abe19,_0x4a1a15,_0x373b8c){ChatGroupEvents[_0xee75('0x4')](_0x22ca13+':'+_0x2abe19['id'],_0x2abe19);ChatGroupEvents[_0xee75('0x4')](_0x22ca13,_0x2abe19);_0x373b8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xee75('0x5')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf56c=['setMaxListeners','save','remove','emit','hook','../../mysqldb','ChatGroup'];(function(_0x4f510f,_0x4f1b75){var _0x49227e=function(_0x272911){while(--_0x272911){_0x4f510f['push'](_0x4f510f['shift']());}};_0x49227e(++_0x4f1b75);}(_0xf56c,0x67));var _0xcf56=function(_0x1c2995,_0x9e2edf){_0x1c2995=_0x1c2995-0x0;var _0x1acd48=_0xf56c[_0x1c2995];return _0x1acd48;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xcf56('0x0'))['db'][_0xcf56('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcf56('0x2')](0x0);var events={'afterCreate':_0xcf56('0x3'),'afterUpdate':'update','afterDestroy':_0xcf56('0x4')};function emitEvent(_0x3b4634){return function(_0x20cd37,_0x36d6cd,_0x3e43df){ChatGroupEvents[_0xcf56('0x5')](_0x3b4634+':'+_0x20cd37['id'],_0x20cd37);ChatGroupEvents[_0xcf56('0x5')](_0x3b4634,_0x20cd37);_0x3e43df(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xcf56('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x490a=['../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x490a,0x1a7));var _0xa490=function(_0x5f5375,_0x117568){_0x5f5375=_0x5f5375-0x0;var _0x28e607=_0x490a[_0x5f5375];return _0x28e607;};'use strict';var _=require('lodash');var util=require(_0xa490('0x0'));var logger=require(_0xa490('0x1'))(_0xa490('0x2'));var moment=require(_0xa490('0x3'));var BPromise=require('bluebird');var rp=require(_0xa490('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa490('0x5'));var config=require(_0xa490('0x6'));var attributes=require(_0xa490('0x7'));module[_0xa490('0x8')]=function(_0x56667c,_0x5ebff7){return _0x56667c[_0xa490('0x9')]('ChatGroup',attributes,{'tableName':_0xa490('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25aa=['path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api','bluebird'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x25aa,0x75));var _0xa25a=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x25aa[_0x19d24c];return _0x2fae8d;};'use strict';var _=require(_0xa25a('0x0'));var util=require(_0xa25a('0x1'));var logger=require('../../config/logger')(_0xa25a('0x2'));var moment=require('moment');var BPromise=require(_0xa25a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa25a('0x4'));var rimraf=require(_0xa25a('0x5'));var config=require('../../config/environment');var attributes=require(_0xa25a('0x6'));module[_0xa25a('0x7')]=function(_0x374b3d,_0x2e280e){return _0x374b3d[_0xa25a('0x8')](_0xa25a('0x9'),attributes,{'tableName':_0xa25a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea09=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message','catch','moment'];(function(_0x33c280,_0x222473){var _0x59eb5d=function(_0x965d86){while(--_0x965d86){_0x33c280['push'](_0x33c280['shift']());}};_0x59eb5d(++_0x222473);}(_0xea09,0xd0));var _0x9ea0=function(_0x51981d,_0x656ba){_0x51981d=_0x51981d-0x0;var _0x33e3f8=_0xea09[_0x51981d];return _0x33e3f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9ea0('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ea0('0x1'))['db'];var utils=require(_0x9ea0('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x9ea0('0x3'));var jayson=require(_0x9ea0('0x4'));var client=jayson['client'][_0x9ea0('0x5')]({'port':0x232a});config[_0x9ea0('0x6')]=_[_0x9ea0('0x7')](config[_0x9ea0('0x6')],{'host':_0x9ea0('0x8'),'port':0x18eb});var socket=require(_0x9ea0('0x9'))(new Redis(config[_0x9ea0('0x6')]));require(_0x9ea0('0xa'))['register'](socket);function respondWithRpcPromise(_0x2e1a8a,_0x11e870,_0x30d408){return new BPromise(function(_0x1f9ea5,_0x2bfebe){return client['request'](_0x2e1a8a,_0x30d408)[_0x9ea0('0xb')](function(_0x296562){logger[_0x9ea0('0xc')]('ChatGroup,\x20%s,\x20%s',_0x11e870,_0x9ea0('0xd'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x11e870,_0x9ea0('0xd'),JSON['stringify'](_0x296562));if(_0x296562[_0x9ea0('0xe')]){if(_0x296562[_0x9ea0('0xe')][_0x9ea0('0xf')]===0x1f4){logger[_0x9ea0('0xe')](_0x9ea0('0x10'),_0x11e870,_0x296562[_0x9ea0('0xe')][_0x9ea0('0x11')]);return _0x2bfebe(_0x296562['error'][_0x9ea0('0x11')]);}logger[_0x9ea0('0xe')](_0x9ea0('0x10'),_0x11e870,_0x296562[_0x9ea0('0xe')][_0x9ea0('0x11')]);return _0x1f9ea5(_0x296562[_0x9ea0('0xe')][_0x9ea0('0x11')]);}else{logger['info'](_0x9ea0('0x10'),_0x11e870,'request\x20sent');_0x1f9ea5(_0x296562['result'][_0x9ea0('0x11')]);}})[_0x9ea0('0x12')](function(_0x3e463e){logger[_0x9ea0('0xe')](_0x9ea0('0x10'),_0x11e870,_0x3e463e);_0x2bfebe(_0x3e463e);});});}
\ No newline at end of file
+var _0x8664=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x27e9e9,_0x4c4f84){var _0x1bea27=function(_0x58a90f){while(--_0x58a90f){_0x27e9e9['push'](_0x27e9e9['shift']());}};_0x1bea27(++_0x4c4f84);}(_0x8664,0x11a));var _0x4866=function(_0x3bce31,_0x515dad){_0x3bce31=_0x3bce31-0x0;var _0x3a1932=_0x8664[_0x3bce31];return _0x3a1932;};'use strict';var _=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var moment=require(_0x4866('0x2'));var BPromise=require(_0x4866('0x3'));var rs=require(_0x4866('0x4'));var fs=require('fs');var Redis=require(_0x4866('0x5'));var db=require(_0x4866('0x6'))['db'];var utils=require(_0x4866('0x7'));var logger=require(_0x4866('0x8'))('rpc');var config=require(_0x4866('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4866('0xa')][_0x4866('0xb')]({'port':0x232a});config[_0x4866('0xc')]=_[_0x4866('0xd')](config[_0x4866('0xc')],{'host':_0x4866('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4866('0xc')]));require(_0x4866('0xf'))[_0x4866('0x10')](socket);function respondWithRpcPromise(_0x20a1d7,_0x20fc32,_0x49fad5){return new BPromise(function(_0x35dab1,_0x61028f){return client['request'](_0x20a1d7,_0x49fad5)[_0x4866('0x11')](function(_0x3d80c7){logger['info']('ChatGroup,\x20%s,\x20%s',_0x20fc32,'request\x20sent');logger[_0x4866('0x12')](_0x4866('0x13'),_0x20fc32,_0x4866('0x14'),JSON[_0x4866('0x15')](_0x3d80c7));if(_0x3d80c7[_0x4866('0x16')]){if(_0x3d80c7[_0x4866('0x16')]['code']===0x1f4){logger[_0x4866('0x16')](_0x4866('0x17'),_0x20fc32,_0x3d80c7['error'][_0x4866('0x18')]);return _0x61028f(_0x3d80c7[_0x4866('0x16')][_0x4866('0x18')]);}logger[_0x4866('0x16')](_0x4866('0x17'),_0x20fc32,_0x3d80c7[_0x4866('0x16')][_0x4866('0x18')]);return _0x35dab1(_0x3d80c7[_0x4866('0x16')][_0x4866('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x20fc32,_0x4866('0x14'));_0x35dab1(_0x3d80c7[_0x4866('0x19')][_0x4866('0x18')]);}})['catch'](function(_0x49f816){logger[_0x4866('0x16')](_0x4866('0x17'),_0x20fc32,_0x49f816);_0x61028f(_0x49f816);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf93b=['save','remove','update','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x2db81e,_0x466aea){var _0x1ee08d=function(_0x43a9a1){while(--_0x43a9a1){_0x2db81e['push'](_0x2db81e['shift']());}};_0x1ee08d(++_0x466aea);}(_0xf93b,0x13f));var _0xbf93=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0xf93b[_0x4605dc];return _0x5d3e81;};'use strict';var ChatGroupEvents=require(_0xbf93('0x0'));var events=[_0xbf93('0x1'),_0xbf93('0x2'),_0xbf93('0x3')];function createListener(_0x1e736b,_0x36c728){return function(_0x1ce73a){_0x36c728['emit'](_0x1e736b,_0x1ce73a);};}function removeListener(_0x4eaa8c,_0x2f07d6){return function(){ChatGroupEvents[_0xbf93('0x4')](_0x4eaa8c,_0x2f07d6);};}exports[_0xbf93('0x5')]=function(_0x414d4f){for(var _0x21e825=0x0,_0x542372=events[_0xbf93('0x6')];_0x21e825<_0x542372;_0x21e825++){var _0x235c4f=events[_0x21e825];var _0x194099=createListener(_0xbf93('0x7')+_0x235c4f,_0x414d4f);ChatGroupEvents['on'](_0x235c4f,_0x194099);}};
\ No newline at end of file
+var _0xbf63=['update','emit','removeListener','register','chatGroup:','./chatGroup.events','save'];(function(_0x1aab72,_0x4e5e50){var _0x238639=function(_0x563eaa){while(--_0x563eaa){_0x1aab72['push'](_0x1aab72['shift']());}};_0x238639(++_0x4e5e50);}(_0xbf63,0xde));var _0x3bf6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf63[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x3bf6('0x0'));var events=[_0x3bf6('0x1'),'remove',_0x3bf6('0x2')];function createListener(_0x52c0f3,_0x373bf0){return function(_0xfc3393){_0x373bf0[_0x3bf6('0x3')](_0x52c0f3,_0xfc3393);};}function removeListener(_0x36670f,_0x564c32){return function(){ChatGroupEvents[_0x3bf6('0x4')](_0x36670f,_0x564c32);};}exports[_0x3bf6('0x5')]=function(_0x265fae){for(var _0x4296c5=0x0,_0x44b715=events['length'];_0x4296c5<_0x44b715;_0x4296c5++){var _0x906d23=events[_0x4296c5];var _0x46ca29=createListener(_0x3bf6('0x6')+_0x906d23,_0x265fae);ChatGroupEvents['on'](_0x906d23,_0x46ca29);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30cc=['./chatGroup.controller','get','isAuthenticated','index','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','/:id','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x403d18,_0x512651){var _0x483587=function(_0x325a71){while(--_0x325a71){_0x403d18['push'](_0x403d18['shift']());}};_0x483587(++_0x512651);}(_0x30cc,0x105));var _0xc30c=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x30cc[_0x1e05c1];return _0x15f1ca;};'use strict';var multer=require(_0xc30c('0x0'));var util=require(_0xc30c('0x1'));var path=require(_0xc30c('0x2'));var timeout=require(_0xc30c('0x3'));var express=require(_0xc30c('0x4'));var router=express[_0xc30c('0x5')]();var fs_extra=require(_0xc30c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc30c('0x7'));var config=require(_0xc30c('0x8'));var controller=require(_0xc30c('0x9'));router[_0xc30c('0xa')]('/',auth[_0xc30c('0xb')](),controller[_0xc30c('0xc')]);router[_0xc30c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xc30c('0xd')]);router[_0xc30c('0xa')]('/:id',auth[_0xc30c('0xb')](),controller[_0xc30c('0xe')]);router[_0xc30c('0xa')]('/:id/unread',auth[_0xc30c('0xb')](),controller[_0xc30c('0xf')]);router[_0xc30c('0xa')](_0xc30c('0x10'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x11')]);router[_0xc30c('0xa')](_0xc30c('0x12'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x13')]);router[_0xc30c('0x14')]('/',auth[_0xc30c('0xb')](),controller[_0xc30c('0x15')]);router[_0xc30c('0x14')](_0xc30c('0x10'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x16')]);router[_0xc30c('0x14')](_0xc30c('0x12'),auth[_0xc30c('0xb')](),controller['addMessage']);router[_0xc30c('0x17')]('/:id',auth[_0xc30c('0xb')](),controller[_0xc30c('0x18')]);router[_0xc30c('0x19')](_0xc30c('0x1a'),auth[_0xc30c('0xb')](),controller[_0xc30c('0x1b')]);router['delete']('/:id/members',auth[_0xc30c('0xb')](),controller[_0xc30c('0x1c')]);module[_0xc30c('0x1d')]=router;
\ No newline at end of file
+var _0xf9da=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','put','delete','destroy','removeMembers','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf9da,0x1ae));var _0xaf9d=function(_0x2eb0db,_0x279a33){_0x2eb0db=_0x2eb0db-0x0;var _0x13b1cd=_0xf9da[_0x2eb0db];return _0x13b1cd;};'use strict';var multer=require(_0xaf9d('0x0'));var util=require('util');var path=require(_0xaf9d('0x1'));var timeout=require(_0xaf9d('0x2'));var express=require('express');var router=express[_0xaf9d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf9d('0x4'));var config=require(_0xaf9d('0x5'));var controller=require(_0xaf9d('0x6'));router[_0xaf9d('0x7')]('/',auth[_0xaf9d('0x8')](),controller[_0xaf9d('0x9')]);router[_0xaf9d('0x7')](_0xaf9d('0xa'),auth[_0xaf9d('0x8')](),controller[_0xaf9d('0xb')]);router[_0xaf9d('0x7')](_0xaf9d('0xc'),auth[_0xaf9d('0x8')](),controller[_0xaf9d('0xd')]);router[_0xaf9d('0x7')](_0xaf9d('0xe'),auth[_0xaf9d('0x8')](),controller['getUnread']);router[_0xaf9d('0x7')](_0xaf9d('0xf'),auth['isAuthenticated'](),controller[_0xaf9d('0x10')]);router[_0xaf9d('0x7')](_0xaf9d('0x11'),auth[_0xaf9d('0x8')](),controller[_0xaf9d('0x12')]);router['post']('/',auth[_0xaf9d('0x8')](),controller[_0xaf9d('0x13')]);router[_0xaf9d('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0xaf9d('0x15')]);router[_0xaf9d('0x14')]('/:id/messages',auth[_0xaf9d('0x8')](),controller[_0xaf9d('0x16')]);router[_0xaf9d('0x17')]('/:id',auth[_0xaf9d('0x8')](),controller['update']);router[_0xaf9d('0x18')](_0xaf9d('0xc'),auth[_0xaf9d('0x8')](),controller[_0xaf9d('0x19')]);router[_0xaf9d('0x18')](_0xaf9d('0xf'),auth[_0xaf9d('0x8')](),controller[_0xaf9d('0x1a')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf92a=['DATE','STRING','long','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0xf92a,0x1c7));var _0xaf92=function(_0x7fa8a1,_0x52c9be){_0x7fa8a1=_0x7fa8a1-0x0;var _0x41fa61=_0xf92a[_0x7fa8a1];return _0x41fa61;};'use strict';var Sequelize=require(_0xaf92('0x0'));module[_0xaf92('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaf92('0x2')]},'ratingType':{'type':Sequelize[_0xaf92('0x3')](_0xaf92('0x4'),_0xaf92('0x5')),'defaultValue':_0xaf92('0x4')},'ratingMessage':{'type':Sequelize[_0xaf92('0x6')]},'pathTranscript':{'type':Sequelize[_0xaf92('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xaf92('0x7')]},'disposition':{'type':Sequelize[_0xaf92('0x8')]},'secondDisposition':{'type':Sequelize[_0xaf92('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xaf92('0x8')]},'osName':{'type':Sequelize[_0xaf92('0x8')]},'osVersion':{'type':Sequelize[_0xaf92('0x8')]},'deviceModel':{'type':Sequelize[_0xaf92('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xaf92('0x8')]},'formData':{'type':Sequelize[_0xaf92('0x6')](_0xaf92('0x9'))},'read1stAt':{'type':Sequelize[_0xaf92('0x7')]},'lastMsgAt':{'type':Sequelize[_0xaf92('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xaf92('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xaf92('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xaf92('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xaf92('0x2')]}};
\ No newline at end of file
+var _0x5454=['TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','thumb','star'];(function(_0x78d11b,_0x1c2611){var _0x5f2e27=function(_0x58e6ce){while(--_0x58e6ce){_0x78d11b['push'](_0x78d11b['shift']());}};_0x5f2e27(++_0x1c2611);}(_0x5454,0x94));var _0x4545=function(_0x15019f,_0x47e921){_0x15019f=_0x15019f-0x0;var _0x49bd6d=_0x5454[_0x15019f];return _0x49bd6d;};'use strict';var Sequelize=require(_0x4545('0x0'));module[_0x4545('0x1')]={'closed':{'type':Sequelize[_0x4545('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4545('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x4545('0x4')),'defaultValue':_0x4545('0x5')},'ratingMessage':{'type':Sequelize[_0x4545('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4545('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4545('0x8')]},'disposition':{'type':Sequelize[_0x4545('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4545('0x7')]},'note':{'type':Sequelize[_0x4545('0x7')]},'browserName':{'type':Sequelize[_0x4545('0x7')]},'browserVersion':{'type':Sequelize[_0x4545('0x7')]},'osName':{'type':Sequelize[_0x4545('0x7')]},'osVersion':{'type':Sequelize[_0x4545('0x7')]},'deviceModel':{'type':Sequelize[_0x4545('0x7')]},'deviceVendor':{'type':Sequelize[_0x4545('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4545('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4545('0x6')](_0x4545('0x9'))},'read1stAt':{'type':Sequelize[_0x4545('0x8')]},'lastMsgAt':{'type':Sequelize[_0x4545('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4545('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4545('0x7')]},'customerPort':{'type':Sequelize[_0x4545('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x4545('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x4545('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea4b=['error','code','message','info','result','sendStatus','status','end','offset','undefined','limit','count','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','rawAttributes','type','key','findAll','chat','user','catch','show','model','keys','ChatInteraction','query','intersection','attributes','fields','length','includeAll','include','options','find','create','update','params','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','email','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','root','server/files/attachments/','join','offline-chat/','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','format','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','filters','hasOwnProperty','sort','where','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','order','push','rows','spread','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','Contact','lastName','read','Account','Owner','Chat','N.A.','closedAt','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','value','downloadInteraction.ejs','.pdf','err','unlinkSync','request-promise','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x13515d,_0x5ef9c3){var _0x46ab60=function(_0x11c6ba){while(--_0x11c6ba){_0x13515d['push'](_0x13515d['shift']());}};_0x46ab60(++_0x5ef9c3);}(_0xea4b,0xac));var _0xbea4=function(_0x26bfb0,_0x5b0ffc){_0x26bfb0=_0x26bfb0-0x0;var _0x4454b3=_0xea4b[_0x26bfb0];return _0x4454b3;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0xbea4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbea4('0x1'));var ejs=require(_0xbea4('0x2'));var fs=require('fs');var _=require(_0xbea4('0x3'));var Redis=require('ioredis');var interaction=require(_0xbea4('0x4'));var qs=require(_0xbea4('0x5'));var pdf=require(_0xbea4('0x6'));var logger=require(_0xbea4('0x7'))('api');var config=require(_0xbea4('0x8'));var db=require(_0xbea4('0x9'))['db'];config[_0xbea4('0xa')]=_[_0xbea4('0xb')](config[_0xbea4('0xa')],{'host':_0xbea4('0xc'),'port':0x18eb});var socket=require(_0xbea4('0xd'))(new Redis(config['redis']));require(_0xbea4('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xbea4('0xf')][_0xbea4('0x10')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1fe774,_0x445cc9,_0x8645cb,_0x16b32e){return new BPromise(function(_0x54518b,_0x3d4663){var _0x4558bb=_0x16b32e||client;return _0x4558bb[_0xbea4('0x11')](_0x1fe774,_0x8645cb)[_0xbea4('0x12')](function(_0x2cf478){logger['info'](_0xbea4('0x13'),_0x445cc9,_0xbea4('0x14'));logger['debug'](_0xbea4('0x15'),_0x445cc9,'request\x20sent',JSON['stringify'](_0x2cf478));if(_0x2cf478[_0xbea4('0x16')]){if(_0x2cf478['error'][_0xbea4('0x17')]===0x1f4){logger[_0xbea4('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x445cc9,_0x2cf478[_0xbea4('0x16')][_0xbea4('0x18')]);return _0x3d4663(_0x2cf478['error']['message']);}logger[_0xbea4('0x16')](_0xbea4('0x13'),_0x445cc9,_0x2cf478[_0xbea4('0x16')][_0xbea4('0x18')]);return _0x54518b(_0x2cf478[_0xbea4('0x16')][_0xbea4('0x18')]);}else{logger[_0xbea4('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x445cc9,_0xbea4('0x14'));_0x54518b(_0x2cf478[_0xbea4('0x1a')]['message']);}})['catch'](function(_0x41844c){logger[_0xbea4('0x16')](_0xbea4('0x13'),_0x445cc9,_0x41844c);_0x3d4663(_0x41844c);});});}function respondWithStatusCode(_0x4eddf5,_0x44d1a7){_0x44d1a7=_0x44d1a7||0xcc;return function(_0x396e63){if(_0x396e63){return _0x4eddf5[_0xbea4('0x1b')](_0x44d1a7);}return _0x4eddf5[_0xbea4('0x1c')](_0x44d1a7)[_0xbea4('0x1d')]();};}function respondWithResult(_0x34d840,_0x59fa3b){_0x59fa3b=_0x59fa3b||0xc8;return function(_0x216ab9){if(_0x216ab9){return _0x34d840[_0xbea4('0x1c')](_0x59fa3b)['json'](_0x216ab9);}};}function respondWithFilteredResult(_0x246256,_0x44c3ff){return function(_0x281f4f){if(_0x281f4f){var _0x3f632d=typeof _0x44c3ff[_0xbea4('0x1e')]===_0xbea4('0x1f')&&typeof _0x44c3ff[_0xbea4('0x20')]==='undefined';var _0x404649=_0x281f4f['count'];var _0x1e29f8=_0x3f632d?0x0:_0x44c3ff['offset'];var _0x30286d=_0x3f632d?_0x281f4f[_0xbea4('0x21')]:_0x44c3ff[_0xbea4('0x1e')]+_0x44c3ff[_0xbea4('0x20')];var _0xef65d0;if(_0x30286d>=_0x404649){_0x30286d=_0x404649;_0xef65d0=0xc8;}else{_0xef65d0=0xce;}_0x246256[_0xbea4('0x1c')](_0xef65d0);return _0x246256['set']('Content-Range',_0x1e29f8+'-'+_0x30286d+'/'+_0x404649)['json'](_0x281f4f);}return null;};}function saveUpdates(_0x184d6e){return function(_0x4c512c){if(_0x4c512c){return _0x4c512c['update'](_0x184d6e)[_0xbea4('0x12')](function(_0x2dd1ab){return _0x2dd1ab;});}return null;};}function removeEntity(_0x5ead12){return function(_0x2dc212){if(_0x2dc212){return _0x2dc212[_0xbea4('0x22')]()[_0xbea4('0x12')](function(){_0x5ead12[_0xbea4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c35d9){return function(_0x2e46f5){if(!_0x2e46f5){_0x1c35d9['sendStatus'](0x194);}return _0x2e46f5;};}function handleError(_0x3140e9,_0xa602a4){_0xa602a4=_0xa602a4||0x1f4;return function(_0x1c6d97){logger[_0xbea4('0x16')](_0x1c6d97[_0xbea4('0x23')]);if(_0x1c6d97[_0xbea4('0x24')]){delete _0x1c6d97['name'];}_0x3140e9[_0xbea4('0x1c')](_0xa602a4)[_0xbea4('0x25')](_0x1c6d97);};}function getMustacheRender(_0x26402b,_0x5de493){return Mustache[_0xbea4('0x26')](_0x26402b,_[_0xbea4('0x27')](_0x5de493[_0xbea4('0x28')],{'contact':_0x5de493[_0xbea4('0x29')],'message':_0x5de493[_0xbea4('0x18')],'agent':_0x5de493[_0xbea4('0x2a')],'interaction':_0x5de493[_0xbea4('0x2b')],'account':_0x5de493[_0xbea4('0x2c')]}))||'';}exports[_0xbea4('0x2d')]=function(_0x552072,_0x4b960b){var _0x398764={};var _0x2c7df9=_['map'](db['ChatInteraction'][_0xbea4('0x2e')],function(_0x1aa856){return{'name':_0x1aa856['fieldName'],'type':_0x1aa856[_0xbea4('0x2f')][_0xbea4('0x30')]};});_0x398764=qs['getOptions'](_0x2c7df9,_0x552072);return interaction[_0xbea4('0x31')](_0xbea4('0x32'),_0x552072['query'],_0x552072[_0xbea4('0x33')],_0x398764,_0x2c7df9)[_0xbea4('0x12')](respondWithFilteredResult(_0x4b960b,_0x398764))[_0xbea4('0x34')](handleError(_0x4b960b,null));};exports[_0xbea4('0x35')]=function(_0xb96fce,_0x434fd8){var _0x3ec213={'raw':![],'where':{'id':_0xb96fce['params']['id']}},_0x46246c={};_0x46246c[_0xbea4('0x36')]=_[_0xbea4('0x37')](db[_0xbea4('0x38')]['rawAttributes']);_0x46246c[_0xbea4('0x39')]=_['keys'](_0xb96fce[_0xbea4('0x39')]);_0x46246c['filters']=_[_0xbea4('0x3a')](_0x46246c[_0xbea4('0x36')],_0x46246c[_0xbea4('0x39')]);_0x3ec213[_0xbea4('0x3b')]=_[_0xbea4('0x3a')](_0x46246c[_0xbea4('0x36')],qs[_0xbea4('0x3c')](_0xb96fce['query']['fields']));_0x3ec213[_0xbea4('0x3b')]=_0x3ec213['attributes'][_0xbea4('0x3d')]?_0x3ec213[_0xbea4('0x3b')]:_0x46246c[_0xbea4('0x36')];if(_0xb96fce[_0xbea4('0x39')][_0xbea4('0x3e')]){_0x3ec213[_0xbea4('0x3f')]=[{'all':!![]}];}_0x3ec213=_[_0xbea4('0x27')]({},_0x3ec213,_0xb96fce[_0xbea4('0x40')]);return db[_0xbea4('0x38')][_0xbea4('0x41')](_0x3ec213)[_0xbea4('0x12')](handleEntityNotFound(_0x434fd8,null))[_0xbea4('0x12')](respondWithResult(_0x434fd8,null))[_0xbea4('0x34')](handleError(_0x434fd8,null));};exports['create']=function(_0x333e8f,_0x246036){return db['ChatInteraction'][_0xbea4('0x42')](_0x333e8f[_0xbea4('0x28')],{})[_0xbea4('0x12')](respondWithResult(_0x246036,0xc9))[_0xbea4('0x34')](handleError(_0x246036,null));};exports[_0xbea4('0x43')]=function(_0x556bb6,_0x40b3e4){if(_0x556bb6[_0xbea4('0x28')]['id']){delete _0x556bb6[_0xbea4('0x28')]['id'];}return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x556bb6[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x40b3e4,null))[_0xbea4('0x12')](saveUpdates(_0x556bb6[_0xbea4('0x28')],null))[_0xbea4('0x12')](respondWithResult(_0x40b3e4,null))[_0xbea4('0x34')](handleError(_0x40b3e4,null));};exports[_0xbea4('0x22')]=function(_0x4b9b8b,_0x1a3cfd){return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x4b9b8b[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x1a3cfd,null))[_0xbea4('0x12')](removeEntity(_0x1a3cfd,null))[_0xbea4('0x34')](handleError(_0x1a3cfd,null));};exports['describe']=function(_0x2f249d,_0x8e132){return db['ChatInteraction']['describe']()[_0xbea4('0x12')](respondWithResult(_0x8e132,null))[_0xbea4('0x34')](handleError(_0x8e132,null));};exports[_0xbea4('0x45')]=function(_0x46e03b,_0x21d93d){var _0x23e0b1=_0x46e03b[_0xbea4('0x44')]['id'];var _0x3b4c60;var _0x3a6917;var _0x5ece85;return db[_0xbea4('0x38')][_0xbea4('0x46')]({'where':{'id':_0x23e0b1}})[_0xbea4('0x12')](function(_0xb32b0c){_0x3b4c60=_0xb32b0c;return db['ChatWebsite'][_0xbea4('0x46')]({'where':{'id':_0xb32b0c[_0xbea4('0x47')]},'attributes':['id',_0xbea4('0x48'),_0xbea4('0x49'),_0xbea4('0x4a'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xbea4('0x12')](function(_0xc1c1f1){if(_0xc1c1f1&&_0xc1c1f1['vidaooApiKey']&&_0xc1c1f1[_0xbea4('0x49')]){_0x3a6917=_0xc1c1f1;var _0x51c5a5={'interaction':{'id':_0x23e0b1},'agent':{'id':_0x46e03b['user']['id'],'name':_0x46e03b[_0xbea4('0x33')][_0xbea4('0x24')],'fullname':_0x46e03b[_0xbea4('0x33')]['fullname'],'email':_0x46e03b[_0xbea4('0x33')][_0xbea4('0x4b')]},'contact':_0x46e03b[_0xbea4('0x28')][_0xbea4('0x29')],'account':_0x46e03b[_0xbea4('0x28')]['account']};var _0x4b6443={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0xc1c1f1['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e03b[_0xbea4('0x33')]['email']],'buttons':null,'topic':_0x3a6917[_0xbea4('0x4a')],'note':_[_0xbea4('0x4c')](_0x3a6917[_0xbea4('0x4d')])?null:getMustacheRender(_0x3a6917[_0xbea4('0x4d')],_0x51c5a5),'metadata':null},'redirect':_0xbea4('0x4e'),'json':!![]};try{if(!_['isNull'](_0x3a6917[_0xbea4('0x4f')])){var _0x43efd7=getMustacheRender(_0x3a6917[_0xbea4('0x4f')],_0x51c5a5);var _0x5419d2=JSON[_0xbea4('0x50')](_0x43efd7);_0x4b6443['body'][_0xbea4('0x51')]=_0x5419d2;}}catch(_0x485dd4){throw new db['Sequelize'][(_0xbea4('0x52'))](_0xbea4('0x53'));}return rp(_0x4b6443);}else{throw new db[(_0xbea4('0x54'))][(_0xbea4('0x52'))](_0xbea4('0x55'));}})[_0xbea4('0x12')](function(_0x40b411){_0x5ece85=_0x40b411;if(_0x5ece85['id']){var _0x413196={'body':_0x5ece85[_0xbea4('0x56')],'ChatWebsiteId':_0x3a6917['id'],'ChatInteractionId':_0x3b4c60['id'],'direction':_0xbea4('0x57'),'UserId':_0x46e03b['user']['id']};return db[_0xbea4('0x58')]['create'](_0x413196,{});}else{throw new db[(_0xbea4('0x54'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbea4('0x12')](function(){return _0x3b4c60[_0xbea4('0x59')]({'vidaooSessionId':_0x5ece85['id']});})['then'](respondWithResult(_0x21d93d,null))['catch'](handleError(_0x21d93d,null));};exports[_0xbea4('0x5a')]=function(_0x210664,_0x5dbd02){if(_0x210664[_0xbea4('0x28')]['id']){delete _0x210664[_0xbea4('0x28')]['id'];}return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x210664[_0xbea4('0x44')]['id']},'include':[{'model':db[_0xbea4('0x5b')],'as':'Contact'}]})[_0xbea4('0x12')](handleEntityNotFound(_0x5dbd02,null))[_0xbea4('0x12')](saveUpdates(_0x210664[_0xbea4('0x28')],null))['then'](respondWithResult(_0x5dbd02,null))[_0xbea4('0x34')](handleError(_0x5dbd02,null));};exports['abandon']=function(_0x165380,_0x1fc5ef){if(_0x165380[_0xbea4('0x28')]['id']){delete _0x165380[_0xbea4('0x28')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x165380[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](function(_0x33633e){if(!_0x33633e){logger[_0xbea4('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xbea4('0x5c'),0x194,_0xbea4('0x5d'));_0x1fc5ef['sendStatus'](0x194);}else{if(_0x33633e[_0xbea4('0x5e')]){throw new db[(_0xbea4('0x54'))][(_0xbea4('0x52'))]('Interaction\x20already\x20assigned');}}return _0x33633e;})[_0xbea4('0x12')](function(_0x3d89bb){if(_0x3d89bb){return _0x3d89bb[_0xbea4('0x43')]({'closed':_0x165380[_0xbea4('0x28')][_0xbea4('0x5f')],'disposition':_0x165380['body'][_0xbea4('0x60')]})[_0xbea4('0x12')](function(_0x1fba22){return _0x1fba22;});}})[_0xbea4('0x12')](function(){return respondWithRpcPromise(_0xbea4('0x61'),_0xbea4('0x5c'),_0x165380['body'],client9004);})['then'](respondWithResult(_0x1fc5ef,null))[_0xbea4('0x34')](handleError(_0x1fc5ef,null));};exports[_0xbea4('0x62')]=function(_0x3c917f,_0x5025b4){_0x3c917f[_0xbea4('0x28')]['name']=_0x3c917f['file'][_0xbea4('0x63')];_0x3c917f[_0xbea4('0x28')][_0xbea4('0x64')]=_0x3c917f[_0xbea4('0x65')][_0xbea4('0x66')];_0x3c917f[_0xbea4('0x28')][_0xbea4('0x2f')]=_0x3c917f[_0xbea4('0x65')][_0xbea4('0x67')];return db[_0xbea4('0x68')][_0xbea4('0x42')](_0x3c917f['body'])[_0xbea4('0x12')](respondWithResult(_0x5025b4,0xc9))[_0xbea4('0x34')](handleError(_0x5025b4,null));};exports[_0xbea4('0x69')]=function(_0x1cf83d,_0x25a4be){return db['ChatInteraction'][_0xbea4('0x46')]({'where':{'id':_0x1cf83d[_0xbea4('0x44')]['id']},'raw':!![]})[_0xbea4('0x12')](handleEntityNotFound(_0x25a4be,null))['then'](function(_0x44cf22){if(_0x44cf22){if(_0x44cf22[_0xbea4('0x5f')]){return _0x25a4be[_0xbea4('0x1c')](0x193)[_0xbea4('0x6a')]({'status':0x193,'message':_0xbea4('0x6b')});}return db[_0xbea4('0x68')][_0xbea4('0x46')]({'where':{'id':_0x1cf83d[_0xbea4('0x39')][_0xbea4('0x6c')]},'raw':!![]})['then'](handleEntityNotFound(_0x25a4be,null));}})['then'](function(_0x521193){if(_0x521193){var _0x3eed8b=_0x521193['ChatOfflineMessageId']!==null;var _0x110458=path['join'](config[_0xbea4('0x6d')],_0xbea4('0x6e'));if(_0x3eed8b){_0x110458=path[_0xbea4('0x6f')](_0x110458,_0xbea4('0x70'));}var _0x22afd3=path[_0xbea4('0x6f')](_0x110458,_0x521193[_0xbea4('0x64')]);return _0x25a4be['download'](_0x22afd3);}})[_0xbea4('0x34')](handleError(_0x25a4be,null));};exports['close']=function(_0x5848ed,_0xa50f37){var _0x30c5dd=null;var _0x26c530=null;var _0x4f694a=null;if(_0x5848ed['body']['id']){delete _0x5848ed[_0xbea4('0x28')]['id'];}if(_0x5848ed[_0xbea4('0x28')][_0xbea4('0x71')]){_0x4f694a=path[_0xbea4('0x6f')](config[_0xbea4('0x6d')],_0xbea4('0x72'),util['format'](_0xbea4('0x73'),Date[_0xbea4('0x74')]()));_0x5848ed[_0xbea4('0x28')]['pathTranscript']=_0x4f694a;}return db['ChatInteraction'][_0xbea4('0x41')]({'where':{'id':_0x5848ed[_0xbea4('0x44')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xbea4('0x75')],'as':_0xbea4('0x75')}]}]})[_0xbea4('0x12')](handleEntityNotFound(_0xa50f37,null))[_0xbea4('0x12')](saveUpdates(_0x5848ed[_0xbea4('0x28')],null))[_0xbea4('0x12')](function(_0x4c77b3){if(_0x4c77b3){_0x30c5dd=_0x4c77b3;return db[_0xbea4('0x76')][_0xbea4('0x41')]({'where':{'id':_0x30c5dd[_0xbea4('0x47')]}});}})['then'](function(_0x3dcf32){if(_0x3dcf32){_0x26c530=_0x3dcf32;return db['CmContact'][_0xbea4('0x41')]({'where':{'id':_0x30c5dd[_0xbea4('0x77')]}});}})[_0xbea4('0x12')](function(_0x4504a2){if(_0x4504a2){if(_0x4f694a){var _0x5d6a52=null;for(var _0x126440=0x1;_0x126440<_0x30c5dd[_0xbea4('0x78')]['length'];++_0x126440){_0x5d6a52=_0x30c5dd[_0xbea4('0x78')][_0x126440];var _0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?util['format'](_0xbea4('0x79'),_0x26c530[_0xbea4('0x7a')],_0x5d6a52[_0xbea4('0x5e')]):_0xbea4('0x7b');var _0x57db9d=_0x5848ed[_0xbea4('0x28')][_0xbea4('0x7c')]||util[_0xbea4('0x7d')](_0xbea4('0x79'),'Visitor',_0x5d6a52['ContactId']);switch(_0x26c530['agentIdentifier']){case'website_alias':_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?util['format']('%s%d',_0x26c530[_0xbea4('0x7a')],_0x5d6a52[_0xbea4('0x5e')]):_0xbea4('0x7b');break;case'agent_alias':_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?_0x5d6a52[_0xbea4('0x75')][_0xbea4('0x7e')]||_0x5d6a52['User'][_0xbea4('0x7f')]:_0xbea4('0x7b');break;case _0xbea4('0x80'):_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?_0x5d6a52[_0xbea4('0x75')][_0xbea4('0x7f')]:_0xbea4('0x7b');break;default:_0x3cf449=_0x5d6a52[_0xbea4('0x5e')]?util[_0xbea4('0x7d')](_0xbea4('0x79'),_0x26c530[_0xbea4('0x7a')],_0x5d6a52[_0xbea4('0x5e')]):_0xbea4('0x7b');}var _0x16d2f6=util[_0xbea4('0x7d')](_0xbea4('0x81'),moment(_0x5d6a52[_0xbea4('0x82')])['format'](_0xbea4('0x83')),_0x5d6a52[_0xbea4('0x84')]==='in'?_0x57db9d:_0x3cf449,_0x5d6a52[_0xbea4('0x28')]);if(!_0x5d6a52[_0xbea4('0x85')]){fs[_0xbea4('0x86')](_0x4f694a,_0x16d2f6);}}return db[_0xbea4('0x87')][_0xbea4('0x46')]({'where':{'service':!![]},'include':[{'model':db[_0xbea4('0x88')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xbea4('0x89')],'as':_0xbea4('0x89'),'raw':!![]}]}]});}}})[_0xbea4('0x12')](function(_0x2da295){if(!_0x2da295||!_0x2da295[_0xbea4('0x8a')]||!_0x5848ed[_0xbea4('0x28')])return _0x30c5dd;var _0x43e12b=_0x2da295['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xbea4('0x8b'),{'account':_0x43e12b,'message':{'from':util[_0xbea4('0x7d')](_0xbea4('0x8c'),_0x2da295[_0xbea4('0x24')],_0x2da295[_0xbea4('0x4b')]||_0x2da295['Smtp'][_0xbea4('0x33')]),'to':_0x5848ed[_0xbea4('0x28')]['mailTranscript'],'subject':_0xbea4('0x8d'),'text':util[_0xbea4('0x7d')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5848ed[_0xbea4('0x28')][_0xbea4('0x71')]),'attachments':[{'path':_0x4f694a}]}})[_0xbea4('0x12')](function(){return _0x30c5dd;})['catch'](function(_0x3d9151){logger[_0xbea4('0x16')](_0x3d9151);});})[_0xbea4('0x12')](respondWithStatusCode(_0xa50f37,0xc8))[_0xbea4('0x34')](handleError(_0xa50f37,null));};exports[_0xbea4('0x8e')]=function(_0x7ae010,_0x1342be){return db[_0xbea4('0x58')][_0xbea4('0x41')]({'where':{'id':_0x7ae010['params']['id']}})['then'](handleEntityNotFound(_0x1342be,null))['then'](function(_0xb39f2f){if(_0xb39f2f){return _0xb39f2f[_0xbea4('0x8e')](_0x7ae010['body']['ids'],_[_0xbea4('0x8f')](_0x7ae010[_0xbea4('0x28')],[_0xbea4('0x90'),'id'])||{});}})[_0xbea4('0x12')](respondWithResult(_0x1342be,null))[_0xbea4('0x34')](handleError(_0x1342be,null));};exports[_0xbea4('0x91')]=function(_0x2ed107,_0x3c2833){var _0x2a990c={'raw':![],'where':{}};var _0xaa1d04={};var _0x5c96e0={'count':0x0,'rows':[]};return db[_0xbea4('0x38')][_0xbea4('0x46')]({'where':{'id':_0x2ed107[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x3c2833,null))[_0xbea4('0x12')](function(_0x1fcb20){if(_0x1fcb20){_0xaa1d04[_0xbea4('0x36')]=_[_0xbea4('0x37')](db[_0xbea4('0x58')][_0xbea4('0x2e')]);_0xaa1d04[_0xbea4('0x39')]=_['keys'](_0x2ed107['query']);_0xaa1d04[_0xbea4('0x92')]=_[_0xbea4('0x3a')](_0xaa1d04[_0xbea4('0x36')],_0xaa1d04[_0xbea4('0x39')]);_0x2a990c[_0xbea4('0x3b')]=_[_0xbea4('0x3a')](_0xaa1d04[_0xbea4('0x36')],qs[_0xbea4('0x3c')](_0x2ed107[_0xbea4('0x39')]['fields']));_0x2a990c[_0xbea4('0x3b')]=_0x2a990c[_0xbea4('0x3b')]['length']?_0x2a990c[_0xbea4('0x3b')]:_0xaa1d04[_0xbea4('0x36')];if(!_0x2ed107[_0xbea4('0x39')][_0xbea4('0x93')]('nolimit')){_0x2a990c[_0xbea4('0x20')]=qs[_0xbea4('0x20')](_0x2ed107[_0xbea4('0x39')][_0xbea4('0x20')]);_0x2a990c['offset']=qs[_0xbea4('0x1e')](_0x2ed107[_0xbea4('0x39')][_0xbea4('0x1e')]);}_0x2a990c['order']=qs[_0xbea4('0x94')](_0x2ed107['query'][_0xbea4('0x94')]);_0x2a990c[_0xbea4('0x95')]=qs['filters'](_[_0xbea4('0x96')](_0x2ed107['query'],_0xaa1d04['filters']));_0x2a990c[_0xbea4('0x95')][_0xbea4('0x97')]=_0x1fcb20['id'];if(_0x2ed107[_0xbea4('0x39')][_0xbea4('0x98')]){_0x2a990c[_0xbea4('0x95')]=_[_0xbea4('0x27')](_0x2a990c[_0xbea4('0x95')],{'$or':_[_0xbea4('0x99')](_0x2a990c[_0xbea4('0x3b')],function(_0x123f91){var _0x3741ad={};_0x3741ad[_0x123f91]={'$like':'%'+_0x2ed107[_0xbea4('0x39')][_0xbea4('0x98')]+'%'};return _0x3741ad;})});}if(_0x2ed107[_0xbea4('0x39')][_0xbea4('0x9a')]){var _0xf3d57e=_0x2ed107[_0xbea4('0x39')][_0xbea4('0x9a')][_0xbea4('0x9b')](',');var _0x422a02={};_0x422a02[_0xf3d57e[0x0]]={'$gte':moment(_0xf3d57e[0x1])[_0xbea4('0x7d')](_0xbea4('0x9c'))};_0x2a990c[_0xbea4('0x95')]=_[_0xbea4('0x27')](_0x2a990c[_0xbea4('0x95')],_0x422a02);}_0x2a990c=_[_0xbea4('0x27')]({},_0x2a990c,_0x2ed107[_0xbea4('0x40')]);return db[_0xbea4('0x58')][_0xbea4('0x21')]({'where':_0x2a990c[_0xbea4('0x95')]})['then'](function(_0x4ad23b){_0x5c96e0[_0xbea4('0x21')]=_0x4ad23b;if(_0x2ed107[_0xbea4('0x39')][_0xbea4('0x3e')]){_0x2a990c[_0xbea4('0x3f')]=[{'all':!![]}];}return db[_0xbea4('0x58')][_0xbea4('0x31')](_0x2a990c);})[_0xbea4('0x12')](function(_0xcdb077){_0x5c96e0['rows']=_0xcdb077;return _0x5c96e0;});}})['then'](respondWithFilteredResult(_0x3c2833,_0x2a990c))[_0xbea4('0x34')](handleError(_0x3c2833,null));};exports['getMyMessages']=function(_0x8a3d1d,_0x1ea201){var _0x56da24={'where':{}},_0x1da8a2={},_0x565a75={'count':0x0,'rows':[]};return db[_0xbea4('0x38')][_0xbea4('0x46')]({'where':{'id':_0x8a3d1d[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x1ea201,null))[_0xbea4('0x12')](function(_0x3bbb91){if(_0x3bbb91){_0x1da8a2['model']=_[_0xbea4('0x37')](db[_0xbea4('0x58')][_0xbea4('0x2e')]);_0x1da8a2[_0xbea4('0x39')]=_[_0xbea4('0x37')](_0x8a3d1d[_0xbea4('0x39')]);_0x1da8a2[_0xbea4('0x92')]=_[_0xbea4('0x3a')](_0x1da8a2[_0xbea4('0x36')],_0x1da8a2[_0xbea4('0x39')]);_0x56da24[_0xbea4('0x3b')]=_['intersection'](_0x1da8a2[_0xbea4('0x36')],qs['fields'](_0x8a3d1d[_0xbea4('0x39')][_0xbea4('0x3c')]));_0x56da24[_0xbea4('0x3b')]=_0x56da24[_0xbea4('0x3b')]['length']?_0x56da24[_0xbea4('0x3b')]:_0x1da8a2['model'];if(!_0x8a3d1d[_0xbea4('0x39')][_0xbea4('0x93')]('nolimit')){_0x56da24[_0xbea4('0x20')]=qs[_0xbea4('0x20')](_0x8a3d1d[_0xbea4('0x39')]['limit']);_0x56da24[_0xbea4('0x1e')]=qs[_0xbea4('0x1e')](_0x8a3d1d['query']['offset']);}_0x56da24[_0xbea4('0x9d')]=qs['sort'](_0x8a3d1d['query']['sort']);_0x56da24['where']=qs[_0xbea4('0x92')](_[_0xbea4('0x96')](_0x8a3d1d[_0xbea4('0x39')],_0x1da8a2['filters']));_0x56da24[_0xbea4('0x95')][_0xbea4('0x97')]=_0x3bbb91['id'];if(_0x8a3d1d['query'][_0xbea4('0x98')]){_0x56da24[_0xbea4('0x95')]=_['merge'](_0x56da24[_0xbea4('0x95')],{'$or':_['map'](_0x56da24[_0xbea4('0x3b')],function(_0x58b10f){var _0x307f61={};_0x307f61[_0x58b10f]={'$like':'%'+_0x8a3d1d[_0xbea4('0x39')]['filter']+'%'};return _0x307f61;})});}_0x56da24[_0xbea4('0x95')]['secret']=![];if(_0x8a3d1d[_0xbea4('0x39')]['id']){_0x56da24[_0xbea4('0x95')]['id']={'$gt':_0x8a3d1d[_0xbea4('0x39')]['id']};}_0x56da24=_[_0xbea4('0x27')]({},_0x56da24,_0x8a3d1d['options']);return db['ChatMessage'][_0xbea4('0x21')]({'where':_0x56da24[_0xbea4('0x95')]})['then'](function(_0x55cfa6){_0x565a75[_0xbea4('0x21')]=_0x55cfa6;_0x56da24[_0xbea4('0x3f')]=[];if(_0x8a3d1d[_0xbea4('0x39')]['includeAgent']){_0x56da24[_0xbea4('0x3f')][_0xbea4('0x9e')]({'model':db['User'],'as':'User','attributes':['id',_0xbea4('0x7f'),'alias']});}if(_0x8a3d1d['query'][_0xbea4('0x3e')]){_0x56da24[_0xbea4('0x3f')]=[{'all':!![]}];}return db[_0xbea4('0x58')][_0xbea4('0x31')](_0x56da24);})['then'](function(_0x1192d9){_0x565a75[_0xbea4('0x9f')]=_0x1192d9;return _0x565a75;});}})[_0xbea4('0x12')](respondWithFilteredResult(_0x1ea201,_0x56da24))[_0xbea4('0x34')](handleError(_0x1ea201,null));};exports['addTags']=function(_0x3551d8,_0x2d350d){return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x3551d8[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x2d350d,null))[_0xbea4('0x12')](function(_0xed9830){if(_0xed9830){return _0xed9830['setTags'](_0x3551d8[_0xbea4('0x28')]['ids'],_[_0xbea4('0x8f')](_0x3551d8['body'],[_0xbea4('0x90'),'id'])||{})[_0xbea4('0xa0')](function(){return db['Tag'][_0xbea4('0x31')]({'attributes':['id',_0xbea4('0x24'),_0xbea4('0xa1')],'where':{'id':_0x3551d8[_0xbea4('0x28')][_0xbea4('0x90')]}});})[_0xbea4('0x12')](function(_0x326fe8){socket[_0xbea4('0xa2')](_0xbea4('0xa3'),{'id':Number(_0x3551d8[_0xbea4('0x44')]['id']),'tags':_0x326fe8||[]});return{'id':Number(_0x3551d8[_0xbea4('0x44')]['id']),'tags':_0x326fe8||[]};});}})['then'](respondWithResult(_0x2d350d,null))['catch'](handleError(_0x2d350d,null));};exports['removeTags']=function(_0x3a4ebf,_0x68f42e){return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x3a4ebf[_0xbea4('0x44')]['id']}})[_0xbea4('0x12')](handleEntityNotFound(_0x68f42e,null))[_0xbea4('0x12')](function(_0x5afce9){if(_0x5afce9){return _0x5afce9[_0xbea4('0xa4')](_0x3a4ebf[_0xbea4('0x39')][_0xbea4('0x90')]);}})[_0xbea4('0x12')](respondWithStatusCode(_0x68f42e,null))[_0xbea4('0x34')](handleError(_0x68f42e,null));};exports[_0xbea4('0xa5')]=function(_0x3be5e6,_0x1fdfc3){var _0x1792c8=moment()[_0xbea4('0xa6')]()[_0xbea4('0xa7')]();var _0x4150ad=path[_0xbea4('0x6f')](config['root'],_0xbea4('0xa8'),_0xbea4('0xa9'),'tmp');var _0x1dff0c=path[_0xbea4('0x6f')](config[_0xbea4('0x6d')],_0xbea4('0xa8'),'files',_0xbea4('0xaa'));var _0x36a708=path[_0xbea4('0x6f')](_0x4150ad,_0x1792c8);var _0x1b9a59=util[_0xbea4('0x7d')](_0xbea4('0xab'),_0x3be5e6[_0xbea4('0x44')]['id'],_0x1792c8);var _0x4518ed=path['join'](_0x4150ad,_0x1b9a59);var _0x848132=[];_0x848132[_0xbea4('0x9e')]({'model':db[_0xbea4('0x75')],'as':_0xbea4('0x75'),'attributes':['id',_0xbea4('0x7f')],'raw':!![]});_0x848132[_0xbea4('0x9e')]({'model':db[_0xbea4('0x5b')],'as':_0xbea4('0xac'),'attributes':['id','firstName',_0xbea4('0xad')],'raw':!![]});if(_0x3be5e6['query'][_0xbea4('0xaa')]){_0x848132[_0xbea4('0x9e')]({'model':db[_0xbea4('0x68')],'as':'Attachment','raw':!![]});}var _0x2d7645=[{'model':db['ChatMessage'],'as':_0xbea4('0x78'),'attributes':['id',_0xbea4('0x28'),_0xbea4('0x82'),_0xbea4('0x84'),_0xbea4('0x85'),_0xbea4('0xae')],'include':_0x848132}];_0x2d7645[_0xbea4('0x9e')]({'model':db[_0xbea4('0x76')],'as':_0xbea4('0xaf'),'attributes':['id',_0xbea4('0x24')]});_0x2d7645[_0xbea4('0x9e')]({'model':db['User'],'as':_0xbea4('0xb0'),'attributes':['id',_0xbea4('0x7f')]});return db[_0xbea4('0x38')][_0xbea4('0x41')]({'where':{'id':_0x3be5e6['params']['id']},'include':_0x2d7645})[_0xbea4('0x12')](handleEntityNotFound(_0x1fdfc3,null))[_0xbea4('0x12')](function(_0x2ed9ea){if(_0x2ed9ea){var _0x42d8d8=_0x2ed9ea['get']({'plain':!![]});fs['mkdirSync'](_0x36a708);var _0x462549={'channel':_0xbea4('0xb1'),'account':_0x42d8d8['Account'][_0xbea4('0x24')],'agent':_0x42d8d8[_0xbea4('0xb0')]?_0x42d8d8['Owner'][_0xbea4('0x7f')]:_0xbea4('0xb2'),'createdAt':moment(_0x42d8d8[_0xbea4('0x82')])[_0xbea4('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbea4('0xa7')](),'closedAt':_0x42d8d8[_0xbea4('0x5f')]?moment(_0x42d8d8[_0xbea4('0xb3')])[_0xbea4('0x7d')](_0xbea4('0x9c'))['toString']():'','disposition':_0x42d8d8[_0xbea4('0x60')],'chatInfo':{'browser':_0x42d8d8['browserName'],'os':_0x42d8d8[_0xbea4('0xb4')],'referer':_0x42d8d8[_0xbea4('0xb5')],'customerIp':_0x42d8d8[_0xbea4('0xb6')],'customerPort':_0x42d8d8['customerPort']?_0x42d8d8[_0xbea4('0xb7')]:_0xbea4('0xb2')},'messages':_(_0x42d8d8['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x2c6a13){if(_0x2c6a13[_0xbea4('0x68')]){var _0x456d19=path[_0xbea4('0x6f')](_0x1dff0c,_0x2c6a13[_0xbea4('0x68')][_0xbea4('0x64')]);if(fs[_0xbea4('0xb8')](_0x456d19)){fs[_0xbea4('0xb9')](_0x456d19)[_0xbea4('0xba')](fs[_0xbea4('0xbb')](path[_0xbea4('0x6f')](_0x36a708,_0x2c6a13[_0xbea4('0x68')]['basename'])));}}return{'date':moment(_0x2c6a13[_0xbea4('0x82')])[_0xbea4('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2c6a13[_0xbea4('0x84')]===_0xbea4('0x57')?_0x2c6a13[_0xbea4('0x75')]?_0x2c6a13[_0xbea4('0x75')][_0xbea4('0x7f')]:_0xbea4('0x7b'):_0x2c6a13[_0xbea4('0xac')][_0xbea4('0xbc')]+(_0x2c6a13['Contact'][_0xbea4('0xad')]?'\x20'+_0x2c6a13[_0xbea4('0xac')]['lastName']:''),'body':_0x2c6a13[_0xbea4('0x68')]?_0x2c6a13['Attachment'][_0xbea4('0x64')]:_0x2c6a13[_0xbea4('0x28')],'direction':_0x2c6a13[_0xbea4('0x84')]==='out'?'A':'C','secret':_0x2c6a13[_0xbea4('0x85')],'read':_0x2c6a13[_0xbea4('0xae')],'attachment':_0x2c6a13[_0xbea4('0x68')]};})[_0xbea4('0xbd')]()};return ejs['renderFile'](path[_0xbea4('0x6f')](config[_0xbea4('0x6d')],_0xbea4('0xa8'),'views',_0xbea4('0xbe')),{'interaction':_0x462549})[_0xbea4('0x12')](function(_0x551893){var _0x497354=path['join'](_0x36a708,'transcript-'+_0x42d8d8['id']+'-'+_0x1792c8+_0xbea4('0xbf'));var _0x378354={'path':_0x497354,'channel':_0xbea4('0xb1'),'interactionId':_0x42d8d8['id']};return pdf['createPdfFromHTML'](_0x551893,_0x378354);})['then'](function(){return new Promise(function(_0x35573d,_0x5af036){zipdir(_0x36a708,{'saveTo':_0x4518ed},function(_0x3d5567,_0x54c4d6){if(_0x3d5567)return _0x5af036(_0x3d5567);return _0x35573d(_0x54c4d6);});})[_0xbea4('0x12')](function(){return new BPromise(function(_0x12c5d6,_0x36d8bd){rimraf(_0x36a708,function(_0x140d2c){if(_0x140d2c)_0x36d8bd(_0x140d2c);return _0x12c5d6();});});})[_0xbea4('0x12')](function(){return _0x1fdfc3[_0xbea4('0xa5')](_0x4518ed,_0x1b9a59,function(_0x3183ec){if(_0x3183ec){logger['error'](_0xbea4('0xc0'),_0x3183ec);}else{fs[_0xbea4('0xc1')](_0x4518ed);}});});});}else{return _0x1fdfc3[_0xbea4('0x1b')](0xc8);}})[_0xbea4('0x34')](handleError(_0x1fdfc3,null));};
\ No newline at end of file
+var _0x0dc8=['files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','get','mkdirSync','Chat','Account','Owner','closedAt','browserName','N.A.','createReadStream','pipe','createWriteStream','read','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','stack','name','send','render','body','contact','agent','interaction','account','index','rawAttributes','fieldName','getOptions','findAll','chat','query','catch','show','params','model','ChatInteraction','keys','filters','attributes','fields','includeAll','include','merge','options','find','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','disposition','attachmentUpload','filename','file','mimetype','Attachment','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','root','format','pathTranscript','ChatMessage','Messages','User','ContactId','length','UserId','agentAlias','System','%s%d','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','omit','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','addTags','spread','Tag','color','emit','removeTags','unix','toString'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x0dc8,0x1bc));var _0x80dc=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0x0dc8[_0x15f3c0];return _0x1adfe0;};'use strict';var rimraf=require(_0x80dc('0x0'));var zipdir=require(_0x80dc('0x1'));var rp=require(_0x80dc('0x2'));var moment=require(_0x80dc('0x3'));var BPromise=require(_0x80dc('0x4'));var Mustache=require(_0x80dc('0x5'));var util=require(_0x80dc('0x6'));var path=require(_0x80dc('0x7'));var ejs=require(_0x80dc('0x8'));var fs=require('fs');var _=require(_0x80dc('0x9'));var Redis=require(_0x80dc('0xa'));var interaction=require(_0x80dc('0xb'));var qs=require('../../components/parsers/qs');var pdf=require(_0x80dc('0xc'));var logger=require(_0x80dc('0xd'))('api');var config=require('../../config/environment');var db=require(_0x80dc('0xe'))['db'];config[_0x80dc('0xf')]=_['defaults'](config['redis'],{'host':_0x80dc('0x10'),'port':0x18eb});var socket=require(_0x80dc('0x11'))(new Redis(config[_0x80dc('0xf')]));require('./chatInteraction.socket')[_0x80dc('0x12')](socket);var jayson=require(_0x80dc('0x13'));var client=jayson[_0x80dc('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x80dc('0x14')][_0x80dc('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x5098a1,_0x2fcab5,_0x3788aa,_0x4c6a64){return new BPromise(function(_0x124b3d,_0x4ef98a){var _0x28f3e2=_0x4c6a64||client;return _0x28f3e2[_0x80dc('0x16')](_0x5098a1,_0x3788aa)['then'](function(_0x198531){logger[_0x80dc('0x17')](_0x80dc('0x18'),_0x2fcab5,_0x80dc('0x19'));logger['debug'](_0x80dc('0x1a'),_0x2fcab5,_0x80dc('0x19'),JSON[_0x80dc('0x1b')](_0x198531));if(_0x198531['error']){if(_0x198531['error'][_0x80dc('0x1c')]===0x1f4){logger[_0x80dc('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2fcab5,_0x198531['error']['message']);return _0x4ef98a(_0x198531['error'][_0x80dc('0x1e')]);}logger['error'](_0x80dc('0x18'),_0x2fcab5,_0x198531[_0x80dc('0x1d')][_0x80dc('0x1e')]);return _0x124b3d(_0x198531[_0x80dc('0x1d')][_0x80dc('0x1e')]);}else{logger[_0x80dc('0x17')](_0x80dc('0x18'),_0x2fcab5,_0x80dc('0x19'));_0x124b3d(_0x198531[_0x80dc('0x1f')][_0x80dc('0x1e')]);}})['catch'](function(_0x453f5a){logger[_0x80dc('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2fcab5,_0x453f5a);_0x4ef98a(_0x453f5a);});});}function respondWithStatusCode(_0x517256,_0x2ceb35){_0x2ceb35=_0x2ceb35||0xcc;return function(_0x3d37c7){if(_0x3d37c7){return _0x517256[_0x80dc('0x20')](_0x2ceb35);}return _0x517256[_0x80dc('0x21')](_0x2ceb35)[_0x80dc('0x22')]();};}function respondWithResult(_0x14c3e,_0x4b2b98){_0x4b2b98=_0x4b2b98||0xc8;return function(_0x55357f){if(_0x55357f){return _0x14c3e[_0x80dc('0x21')](_0x4b2b98)[_0x80dc('0x23')](_0x55357f);}};}function respondWithFilteredResult(_0x36751d,_0x325da5){return function(_0x4ad21d){if(_0x4ad21d){var _0x2e6fd6=typeof _0x325da5[_0x80dc('0x24')]===_0x80dc('0x25')&&typeof _0x325da5[_0x80dc('0x26')]===_0x80dc('0x25');var _0x49d113=_0x4ad21d[_0x80dc('0x27')];var _0x1b028d=_0x2e6fd6?0x0:_0x325da5[_0x80dc('0x24')];var _0x248427=_0x2e6fd6?_0x4ad21d[_0x80dc('0x27')]:_0x325da5[_0x80dc('0x24')]+_0x325da5[_0x80dc('0x26')];var _0x5b93c6;if(_0x248427>=_0x49d113){_0x248427=_0x49d113;_0x5b93c6=0xc8;}else{_0x5b93c6=0xce;}_0x36751d['status'](_0x5b93c6);return _0x36751d[_0x80dc('0x28')](_0x80dc('0x29'),_0x1b028d+'-'+_0x248427+'/'+_0x49d113)[_0x80dc('0x23')](_0x4ad21d);}return null;};}function saveUpdates(_0x2837b6){return function(_0x471c11){if(_0x471c11){return _0x471c11['update'](_0x2837b6)['then'](function(_0x2fd578){return _0x2fd578;});}return null;};}function removeEntity(_0x218fbf){return function(_0x2665eb){if(_0x2665eb){return _0x2665eb['destroy']()[_0x80dc('0x2a')](function(){_0x218fbf[_0x80dc('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229c74){return function(_0x43edfc){if(!_0x43edfc){_0x229c74[_0x80dc('0x20')](0x194);}return _0x43edfc;};}function handleError(_0x5b6f70,_0x273302){_0x273302=_0x273302||0x1f4;return function(_0x1c01a9){logger[_0x80dc('0x1d')](_0x1c01a9[_0x80dc('0x2b')]);if(_0x1c01a9['name']){delete _0x1c01a9[_0x80dc('0x2c')];}_0x5b6f70['status'](_0x273302)[_0x80dc('0x2d')](_0x1c01a9);};}function getMustacheRender(_0x5d1107,_0x1ef232){return Mustache[_0x80dc('0x2e')](_0x5d1107,_['merge'](_0x1ef232[_0x80dc('0x2f')],{'contact':_0x1ef232[_0x80dc('0x30')],'message':_0x1ef232[_0x80dc('0x1e')],'agent':_0x1ef232[_0x80dc('0x31')],'interaction':_0x1ef232[_0x80dc('0x32')],'account':_0x1ef232[_0x80dc('0x33')]}))||'';}exports[_0x80dc('0x34')]=function(_0x4b1913,_0x173431){var _0x5dde4d={};var _0x100d7a=_['map'](db['ChatInteraction'][_0x80dc('0x35')],function(_0x1bbd43){return{'name':_0x1bbd43[_0x80dc('0x36')],'type':_0x1bbd43['type']['key']};});_0x5dde4d=qs[_0x80dc('0x37')](_0x100d7a,_0x4b1913);return interaction[_0x80dc('0x38')](_0x80dc('0x39'),_0x4b1913[_0x80dc('0x3a')],_0x4b1913['user'],_0x5dde4d,_0x100d7a)[_0x80dc('0x2a')](respondWithFilteredResult(_0x173431,_0x5dde4d))[_0x80dc('0x3b')](handleError(_0x173431,null));};exports[_0x80dc('0x3c')]=function(_0x3fa5a8,_0xaac901){var _0x5e2fe1={'raw':![],'where':{'id':_0x3fa5a8[_0x80dc('0x3d')]['id']}},_0x16d98c={};_0x16d98c[_0x80dc('0x3e')]=_['keys'](db[_0x80dc('0x3f')]['rawAttributes']);_0x16d98c['query']=_[_0x80dc('0x40')](_0x3fa5a8[_0x80dc('0x3a')]);_0x16d98c[_0x80dc('0x41')]=_['intersection'](_0x16d98c['model'],_0x16d98c[_0x80dc('0x3a')]);_0x5e2fe1[_0x80dc('0x42')]=_['intersection'](_0x16d98c['model'],qs[_0x80dc('0x43')](_0x3fa5a8[_0x80dc('0x3a')]['fields']));_0x5e2fe1['attributes']=_0x5e2fe1[_0x80dc('0x42')]['length']?_0x5e2fe1['attributes']:_0x16d98c[_0x80dc('0x3e')];if(_0x3fa5a8['query'][_0x80dc('0x44')]){_0x5e2fe1[_0x80dc('0x45')]=[{'all':!![]}];}_0x5e2fe1=_[_0x80dc('0x46')]({},_0x5e2fe1,_0x3fa5a8[_0x80dc('0x47')]);return db[_0x80dc('0x3f')][_0x80dc('0x48')](_0x5e2fe1)[_0x80dc('0x2a')](handleEntityNotFound(_0xaac901,null))['then'](respondWithResult(_0xaac901,null))[_0x80dc('0x3b')](handleError(_0xaac901,null));};exports[_0x80dc('0x49')]=function(_0x7dc97,_0x4cd564){return db[_0x80dc('0x3f')][_0x80dc('0x49')](_0x7dc97[_0x80dc('0x2f')],{})[_0x80dc('0x2a')](respondWithResult(_0x4cd564,0xc9))[_0x80dc('0x3b')](handleError(_0x4cd564,null));};exports[_0x80dc('0x4a')]=function(_0x1c5a9d,_0x2dfe14){if(_0x1c5a9d['body']['id']){delete _0x1c5a9d[_0x80dc('0x2f')]['id'];}return db[_0x80dc('0x3f')][_0x80dc('0x48')]({'where':{'id':_0x1c5a9d['params']['id']}})['then'](handleEntityNotFound(_0x2dfe14,null))[_0x80dc('0x2a')](saveUpdates(_0x1c5a9d[_0x80dc('0x2f')],null))['then'](respondWithResult(_0x2dfe14,null))['catch'](handleError(_0x2dfe14,null));};exports[_0x80dc('0x4b')]=function(_0x44c3d6,_0x4f1a7c){return db[_0x80dc('0x3f')][_0x80dc('0x48')]({'where':{'id':_0x44c3d6[_0x80dc('0x3d')]['id']}})[_0x80dc('0x2a')](handleEntityNotFound(_0x4f1a7c,null))['then'](removeEntity(_0x4f1a7c,null))[_0x80dc('0x3b')](handleError(_0x4f1a7c,null));};exports['describe']=function(_0x58d814,_0x140141){return db['ChatInteraction'][_0x80dc('0x4c')]()['then'](respondWithResult(_0x140141,null))[_0x80dc('0x3b')](handleError(_0x140141,null));};exports[_0x80dc('0x4d')]=function(_0x18a518,_0x1a5492){var _0x48935b=_0x18a518[_0x80dc('0x3d')]['id'];var _0x58f96e;var _0x59a498;var _0x538faf;return db['ChatInteraction'][_0x80dc('0x4e')]({'where':{'id':_0x48935b}})[_0x80dc('0x2a')](function(_0x287a4b){_0x58f96e=_0x287a4b;return db[_0x80dc('0x4f')][_0x80dc('0x4e')]({'where':{'id':_0x287a4b[_0x80dc('0x50')]},'attributes':['id',_0x80dc('0x51'),_0x80dc('0x52'),'vidaooTopic',_0x80dc('0x53'),_0x80dc('0x54')],'raw':!![]});})[_0x80dc('0x2a')](function(_0x4dc07c){if(_0x4dc07c&&_0x4dc07c[_0x80dc('0x51')]&&_0x4dc07c[_0x80dc('0x52')]){_0x59a498=_0x4dc07c;var _0x5df886={'interaction':{'id':_0x48935b},'agent':{'id':_0x18a518[_0x80dc('0x55')]['id'],'name':_0x18a518['user'][_0x80dc('0x2c')],'fullname':_0x18a518[_0x80dc('0x55')][_0x80dc('0x56')],'email':_0x18a518[_0x80dc('0x55')][_0x80dc('0x57')]},'contact':_0x18a518[_0x80dc('0x2f')][_0x80dc('0x30')],'account':_0x18a518[_0x80dc('0x2f')][_0x80dc('0x33')]};var _0x2e9846={'rejectUnauthorized':![],'method':_0x80dc('0x58'),'url':_0x80dc('0x59'),'headers':{'X-APIKEY':_0x4dc07c[_0x80dc('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x18a518[_0x80dc('0x55')][_0x80dc('0x57')]],'buttons':null,'topic':_0x59a498['vidaooTopic'],'note':_[_0x80dc('0x5a')](_0x59a498[_0x80dc('0x53')])?null:getMustacheRender(_0x59a498[_0x80dc('0x53')],_0x5df886),'metadata':null},'redirect':_0x80dc('0x5b'),'json':!![]};try{if(!_[_0x80dc('0x5a')](_0x59a498['vidaooMetadata'])){var _0x5d9dec=getMustacheRender(_0x59a498['vidaooMetadata'],_0x5df886);var _0x1f1cb1=JSON[_0x80dc('0x5c')](_0x5d9dec);_0x2e9846[_0x80dc('0x2f')]['metadata']=_0x1f1cb1;}}catch(_0x78fba7){throw new db[(_0x80dc('0x5d'))]['ValidationError'](_0x80dc('0x5e'));}return rp(_0x2e9846);}else{throw new db[(_0x80dc('0x5d'))][(_0x80dc('0x5f'))](_0x80dc('0x60'));}})[_0x80dc('0x2a')](function(_0x21db82){_0x538faf=_0x21db82;if(_0x538faf['id']){var _0x51d9a6={'body':_0x538faf['join_url'],'ChatWebsiteId':_0x59a498['id'],'ChatInteractionId':_0x58f96e['id'],'direction':_0x80dc('0x61'),'UserId':_0x18a518[_0x80dc('0x55')]['id']};return db['ChatMessage']['create'](_0x51d9a6,{});}else{throw new db[(_0x80dc('0x5d'))][(_0x80dc('0x5f'))](_0x80dc('0x62'));}})[_0x80dc('0x2a')](function(){return _0x58f96e[_0x80dc('0x63')]({'vidaooSessionId':_0x538faf['id']});})[_0x80dc('0x2a')](respondWithResult(_0x1a5492,null))['catch'](handleError(_0x1a5492,null));};exports[_0x80dc('0x64')]=function(_0x2027b4,_0x1fc5e1){if(_0x2027b4[_0x80dc('0x2f')]['id']){delete _0x2027b4['body']['id'];}return db[_0x80dc('0x3f')][_0x80dc('0x48')]({'where':{'id':_0x2027b4[_0x80dc('0x3d')]['id']},'include':[{'model':db[_0x80dc('0x65')],'as':_0x80dc('0x66')}]})[_0x80dc('0x2a')](handleEntityNotFound(_0x1fc5e1,null))[_0x80dc('0x2a')](saveUpdates(_0x2027b4[_0x80dc('0x2f')],null))['then'](respondWithResult(_0x1fc5e1,null))[_0x80dc('0x3b')](handleError(_0x1fc5e1,null));};exports[_0x80dc('0x67')]=function(_0x58e675,_0x196990){if(_0x58e675[_0x80dc('0x2f')]['id']){delete _0x58e675[_0x80dc('0x2f')]['id'];}return db[_0x80dc('0x3f')][_0x80dc('0x48')]({'where':{'id':_0x58e675[_0x80dc('0x3d')]['id']}})[_0x80dc('0x2a')](function(_0x216d3f){if(!_0x216d3f){logger['error'](_0x80dc('0x68'),_0x80dc('0x67'),0x194,'entity\x20not\x20found');_0x196990[_0x80dc('0x20')](0x194);}else{if(_0x216d3f['UserId']){throw new db[(_0x80dc('0x5d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x216d3f;})[_0x80dc('0x2a')](function(_0x2872b9){if(_0x2872b9){return _0x2872b9[_0x80dc('0x4a')]({'closed':_0x58e675[_0x80dc('0x2f')]['closed'],'disposition':_0x58e675['body'][_0x80dc('0x69')]})[_0x80dc('0x2a')](function(_0x53849d){return _0x53849d;});}})[_0x80dc('0x2a')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x58e675[_0x80dc('0x2f')],client9004);})[_0x80dc('0x2a')](respondWithResult(_0x196990,null))[_0x80dc('0x3b')](handleError(_0x196990,null));};exports[_0x80dc('0x6a')]=function(_0x1b5b4e,_0x37c0a7){_0x1b5b4e[_0x80dc('0x2f')][_0x80dc('0x2c')]=_0x1b5b4e['file']['originalname'];_0x1b5b4e['body']['basename']=_0x1b5b4e['file'][_0x80dc('0x6b')];_0x1b5b4e[_0x80dc('0x2f')]['type']=_0x1b5b4e[_0x80dc('0x6c')][_0x80dc('0x6d')];return db[_0x80dc('0x6e')][_0x80dc('0x49')](_0x1b5b4e[_0x80dc('0x2f')])[_0x80dc('0x2a')](respondWithResult(_0x37c0a7,0xc9))[_0x80dc('0x3b')](handleError(_0x37c0a7,null));};exports[_0x80dc('0x6f')]=function(_0x3fb03e,_0x3bdaf3){return db['ChatInteraction'][_0x80dc('0x4e')]({'where':{'id':_0x3fb03e[_0x80dc('0x3d')]['id']},'raw':!![]})[_0x80dc('0x2a')](handleEntityNotFound(_0x3bdaf3,null))[_0x80dc('0x2a')](function(_0x5d5484){if(_0x5d5484){if(_0x5d5484[_0x80dc('0x70')]){return _0x3bdaf3['status'](0x193)[_0x80dc('0x23')]({'status':0x193,'message':_0x80dc('0x71')});}return db[_0x80dc('0x6e')]['findOne']({'where':{'id':_0x3fb03e[_0x80dc('0x3a')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3bdaf3,null));}})[_0x80dc('0x2a')](function(_0x1d17c2){if(_0x1d17c2){var _0x391c0e=_0x1d17c2[_0x80dc('0x72')]!==null;var _0x1353f7=path[_0x80dc('0x73')](config['root'],_0x80dc('0x74'));if(_0x391c0e){_0x1353f7=path['join'](_0x1353f7,_0x80dc('0x75'));}var _0x1c8a2b=path[_0x80dc('0x73')](_0x1353f7,_0x1d17c2[_0x80dc('0x76')]);return _0x3bdaf3[_0x80dc('0x77')](_0x1c8a2b);}})['catch'](handleError(_0x3bdaf3,null));};exports[_0x80dc('0x78')]=function(_0x41f112,_0xa8cae4){var _0x2771a3=null;var _0x3ac357=null;var _0x381c79=null;if(_0x41f112[_0x80dc('0x2f')]['id']){delete _0x41f112[_0x80dc('0x2f')]['id'];}if(_0x41f112[_0x80dc('0x2f')]['mailTranscript']){_0x381c79=path['join'](config[_0x80dc('0x79')],'server/files/chat/upload/',util[_0x80dc('0x7a')]('transcript-%s.txt',Date['now']()));_0x41f112['body'][_0x80dc('0x7b')]=_0x381c79;}return db['ChatInteraction'][_0x80dc('0x48')]({'where':{'id':_0x41f112[_0x80dc('0x3d')]['id']},'include':[{'model':db[_0x80dc('0x7c')],'as':_0x80dc('0x7d'),'include':[{'model':db[_0x80dc('0x7e')],'as':_0x80dc('0x7e')}]}]})[_0x80dc('0x2a')](handleEntityNotFound(_0xa8cae4,null))['then'](saveUpdates(_0x41f112[_0x80dc('0x2f')],null))[_0x80dc('0x2a')](function(_0x1619bb){if(_0x1619bb){_0x2771a3=_0x1619bb;return db['ChatWebsite']['find']({'where':{'id':_0x2771a3[_0x80dc('0x50')]}});}})[_0x80dc('0x2a')](function(_0x360d99){if(_0x360d99){_0x3ac357=_0x360d99;return db[_0x80dc('0x65')][_0x80dc('0x48')]({'where':{'id':_0x2771a3[_0x80dc('0x7f')]}});}})[_0x80dc('0x2a')](function(_0x2d60c5){if(_0x2d60c5){if(_0x381c79){var _0x30813b=null;for(var _0x285c67=0x1;_0x285c67<_0x2771a3['Messages'][_0x80dc('0x80')];++_0x285c67){_0x30813b=_0x2771a3['Messages'][_0x285c67];var _0x9b887=_0x30813b[_0x80dc('0x81')]?util['format']('%s%d',_0x3ac357[_0x80dc('0x82')],_0x30813b[_0x80dc('0x81')]):_0x80dc('0x83');var _0x4a3d25=_0x41f112[_0x80dc('0x2f')]['customer']||util['format'](_0x80dc('0x84'),_0x80dc('0x85'),_0x30813b[_0x80dc('0x7f')]);switch(_0x3ac357[_0x80dc('0x86')]){case'website_alias':_0x9b887=_0x30813b['UserId']?util['format'](_0x80dc('0x84'),_0x3ac357[_0x80dc('0x82')],_0x30813b[_0x80dc('0x81')]):'System';break;case _0x80dc('0x87'):_0x9b887=_0x30813b[_0x80dc('0x81')]?_0x30813b[_0x80dc('0x7e')][_0x80dc('0x88')]||_0x30813b['User'][_0x80dc('0x56')]:_0x80dc('0x83');break;case _0x80dc('0x89'):_0x9b887=_0x30813b[_0x80dc('0x81')]?_0x30813b['User'][_0x80dc('0x56')]:_0x80dc('0x83');break;default:_0x9b887=_0x30813b[_0x80dc('0x81')]?util[_0x80dc('0x7a')](_0x80dc('0x84'),_0x3ac357[_0x80dc('0x82')],_0x30813b[_0x80dc('0x81')]):'System';}var _0xb45900=util[_0x80dc('0x7a')](_0x80dc('0x8a'),moment(_0x30813b[_0x80dc('0x8b')])[_0x80dc('0x7a')](_0x80dc('0x8c')),_0x30813b[_0x80dc('0x8d')]==='in'?_0x4a3d25:_0x9b887,_0x30813b[_0x80dc('0x2f')]);if(!_0x30813b['secret']){fs[_0x80dc('0x8e')](_0x381c79,_0xb45900);}}return db[_0x80dc('0x8f')][_0x80dc('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x80dc('0x90')],'as':_0x80dc('0x91'),'raw':!![],'include':[{'model':db[_0x80dc('0x92')],'as':_0x80dc('0x92'),'raw':!![]}]}]});}}})[_0x80dc('0x2a')](function(_0x46510e){if(!_0x46510e||!_0x46510e[_0x80dc('0x91')]||!_0x41f112[_0x80dc('0x2f')])return _0x2771a3;var _0x1996f7=_0x46510e[_0x80dc('0x93')]();return respondWithRpcPromise(_0x80dc('0x94'),_0x80dc('0x95'),{'account':_0x1996f7,'message':{'from':util[_0x80dc('0x7a')](_0x80dc('0x96'),_0x46510e['name'],_0x46510e[_0x80dc('0x57')]||_0x46510e[_0x80dc('0x91')][_0x80dc('0x55')]),'to':_0x41f112[_0x80dc('0x2f')][_0x80dc('0x97')],'subject':_0x80dc('0x98'),'text':util[_0x80dc('0x7a')](_0x80dc('0x99'),_0x41f112['body']['mailTranscript']),'attachments':[{'path':_0x381c79}]}})[_0x80dc('0x2a')](function(){return _0x2771a3;})[_0x80dc('0x3b')](function(_0x1f066d){logger[_0x80dc('0x1d')](_0x1f066d);});})[_0x80dc('0x2a')](respondWithStatusCode(_0xa8cae4,0xc8))[_0x80dc('0x3b')](handleError(_0xa8cae4,null));};exports['addMessage']=function(_0x4d941c,_0x1a66df){return db[_0x80dc('0x7c')][_0x80dc('0x48')]({'where':{'id':_0x4d941c['params']['id']}})[_0x80dc('0x2a')](handleEntityNotFound(_0x1a66df,null))[_0x80dc('0x2a')](function(_0x2423b1){if(_0x2423b1){return _0x2423b1[_0x80dc('0x9a')](_0x4d941c[_0x80dc('0x2f')][_0x80dc('0x9b')],_[_0x80dc('0x9c')](_0x4d941c[_0x80dc('0x2f')],[_0x80dc('0x9b'),'id'])||{});}})['then'](respondWithResult(_0x1a66df,null))['catch'](handleError(_0x1a66df,null));};exports[_0x80dc('0x9d')]=function(_0x12bb5d,_0x13667d){var _0x584ba2={'raw':![],'where':{}};var _0x1f1425={};var _0x532cf2={'count':0x0,'rows':[]};return db[_0x80dc('0x3f')][_0x80dc('0x4e')]({'where':{'id':_0x12bb5d['params']['id']}})[_0x80dc('0x2a')](handleEntityNotFound(_0x13667d,null))['then'](function(_0xbf3539){if(_0xbf3539){_0x1f1425[_0x80dc('0x3e')]=_[_0x80dc('0x40')](db[_0x80dc('0x7c')][_0x80dc('0x35')]);_0x1f1425[_0x80dc('0x3a')]=_[_0x80dc('0x40')](_0x12bb5d[_0x80dc('0x3a')]);_0x1f1425['filters']=_[_0x80dc('0x9e')](_0x1f1425[_0x80dc('0x3e')],_0x1f1425[_0x80dc('0x3a')]);_0x584ba2[_0x80dc('0x42')]=_[_0x80dc('0x9e')](_0x1f1425[_0x80dc('0x3e')],qs[_0x80dc('0x43')](_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0x43')]));_0x584ba2[_0x80dc('0x42')]=_0x584ba2[_0x80dc('0x42')][_0x80dc('0x80')]?_0x584ba2[_0x80dc('0x42')]:_0x1f1425['model'];if(!_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0x9f')](_0x80dc('0xa0'))){_0x584ba2['limit']=qs[_0x80dc('0x26')](_0x12bb5d[_0x80dc('0x3a')]['limit']);_0x584ba2[_0x80dc('0x24')]=qs[_0x80dc('0x24')](_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0x24')]);}_0x584ba2[_0x80dc('0xa1')]=qs['sort'](_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0xa2')]);_0x584ba2[_0x80dc('0xa3')]=qs[_0x80dc('0x41')](_[_0x80dc('0xa4')](_0x12bb5d[_0x80dc('0x3a')],_0x1f1425[_0x80dc('0x41')]));_0x584ba2[_0x80dc('0xa3')][_0x80dc('0xa5')]=_0xbf3539['id'];if(_0x12bb5d['query'][_0x80dc('0xa6')]){_0x584ba2[_0x80dc('0xa3')]=_[_0x80dc('0x46')](_0x584ba2[_0x80dc('0xa3')],{'$or':_[_0x80dc('0xa7')](_0x584ba2[_0x80dc('0x42')],function(_0x171979){var _0x12ed82={};_0x12ed82[_0x171979]={'$like':'%'+_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0xa6')]+'%'};return _0x12ed82;})});}if(_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0xa8')]){var _0x3cade4=_0x12bb5d[_0x80dc('0x3a')][_0x80dc('0xa8')][_0x80dc('0xa9')](',');var _0x5237ce={};_0x5237ce[_0x3cade4[0x0]]={'$gte':moment(_0x3cade4[0x1])[_0x80dc('0x7a')](_0x80dc('0xaa'))};_0x584ba2[_0x80dc('0xa3')]=_[_0x80dc('0x46')](_0x584ba2['where'],_0x5237ce);}_0x584ba2=_[_0x80dc('0x46')]({},_0x584ba2,_0x12bb5d[_0x80dc('0x47')]);return db[_0x80dc('0x7c')]['count']({'where':_0x584ba2['where']})[_0x80dc('0x2a')](function(_0x4b2be6){_0x532cf2['count']=_0x4b2be6;if(_0x12bb5d[_0x80dc('0x3a')]['includeAll']){_0x584ba2['include']=[{'all':!![]}];}return db[_0x80dc('0x7c')][_0x80dc('0x38')](_0x584ba2);})[_0x80dc('0x2a')](function(_0x477946){_0x532cf2[_0x80dc('0xab')]=_0x477946;return _0x532cf2;});}})[_0x80dc('0x2a')](respondWithFilteredResult(_0x13667d,_0x584ba2))[_0x80dc('0x3b')](handleError(_0x13667d,null));};exports[_0x80dc('0xac')]=function(_0x31900d,_0x6a2b43){var _0x550860={'where':{}},_0x371642={},_0x11db60={'count':0x0,'rows':[]};return db[_0x80dc('0x3f')][_0x80dc('0x4e')]({'where':{'id':_0x31900d[_0x80dc('0x3d')]['id']}})[_0x80dc('0x2a')](handleEntityNotFound(_0x6a2b43,null))[_0x80dc('0x2a')](function(_0x590b10){if(_0x590b10){_0x371642['model']=_[_0x80dc('0x40')](db[_0x80dc('0x7c')][_0x80dc('0x35')]);_0x371642[_0x80dc('0x3a')]=_[_0x80dc('0x40')](_0x31900d[_0x80dc('0x3a')]);_0x371642['filters']=_[_0x80dc('0x9e')](_0x371642['model'],_0x371642[_0x80dc('0x3a')]);_0x550860['attributes']=_['intersection'](_0x371642[_0x80dc('0x3e')],qs[_0x80dc('0x43')](_0x31900d[_0x80dc('0x3a')][_0x80dc('0x43')]));_0x550860[_0x80dc('0x42')]=_0x550860[_0x80dc('0x42')][_0x80dc('0x80')]?_0x550860['attributes']:_0x371642[_0x80dc('0x3e')];if(!_0x31900d[_0x80dc('0x3a')][_0x80dc('0x9f')](_0x80dc('0xa0'))){_0x550860[_0x80dc('0x26')]=qs['limit'](_0x31900d[_0x80dc('0x3a')]['limit']);_0x550860[_0x80dc('0x24')]=qs['offset'](_0x31900d[_0x80dc('0x3a')][_0x80dc('0x24')]);}_0x550860[_0x80dc('0xa1')]=qs[_0x80dc('0xa2')](_0x31900d[_0x80dc('0x3a')]['sort']);_0x550860[_0x80dc('0xa3')]=qs['filters'](_[_0x80dc('0xa4')](_0x31900d[_0x80dc('0x3a')],_0x371642[_0x80dc('0x41')]));_0x550860[_0x80dc('0xa3')][_0x80dc('0xa5')]=_0x590b10['id'];if(_0x31900d[_0x80dc('0x3a')][_0x80dc('0xa6')]){_0x550860[_0x80dc('0xa3')]=_[_0x80dc('0x46')](_0x550860['where'],{'$or':_[_0x80dc('0xa7')](_0x550860[_0x80dc('0x42')],function(_0x53c31d){var _0x2f51f0={};_0x2f51f0[_0x53c31d]={'$like':'%'+_0x31900d['query'][_0x80dc('0xa6')]+'%'};return _0x2f51f0;})});}_0x550860['where']['secret']=![];if(_0x31900d['query']['id']){_0x550860[_0x80dc('0xa3')]['id']={'$gt':_0x31900d[_0x80dc('0x3a')]['id']};}_0x550860=_['merge']({},_0x550860,_0x31900d[_0x80dc('0x47')]);return db['ChatMessage'][_0x80dc('0x27')]({'where':_0x550860[_0x80dc('0xa3')]})[_0x80dc('0x2a')](function(_0x44d8c7){_0x11db60['count']=_0x44d8c7;_0x550860[_0x80dc('0x45')]=[];if(_0x31900d[_0x80dc('0x3a')][_0x80dc('0xad')]){_0x550860[_0x80dc('0x45')][_0x80dc('0xae')]({'model':db[_0x80dc('0x7e')],'as':_0x80dc('0x7e'),'attributes':['id',_0x80dc('0x56'),_0x80dc('0x88')]});}if(_0x31900d[_0x80dc('0x3a')][_0x80dc('0x44')]){_0x550860[_0x80dc('0x45')]=[{'all':!![]}];}return db[_0x80dc('0x7c')][_0x80dc('0x38')](_0x550860);})[_0x80dc('0x2a')](function(_0x23219a){_0x11db60[_0x80dc('0xab')]=_0x23219a;return _0x11db60;});}})[_0x80dc('0x2a')](respondWithFilteredResult(_0x6a2b43,_0x550860))[_0x80dc('0x3b')](handleError(_0x6a2b43,null));};exports[_0x80dc('0xaf')]=function(_0x39ddf7,_0xc142b1){return db[_0x80dc('0x3f')]['find']({'where':{'id':_0x39ddf7[_0x80dc('0x3d')]['id']}})[_0x80dc('0x2a')](handleEntityNotFound(_0xc142b1,null))[_0x80dc('0x2a')](function(_0x5e5e86){if(_0x5e5e86){return _0x5e5e86['setTags'](_0x39ddf7['body'][_0x80dc('0x9b')],_[_0x80dc('0x9c')](_0x39ddf7[_0x80dc('0x2f')],['ids','id'])||{})[_0x80dc('0xb0')](function(){return db[_0x80dc('0xb1')][_0x80dc('0x38')]({'attributes':['id',_0x80dc('0x2c'),_0x80dc('0xb2')],'where':{'id':_0x39ddf7['body'][_0x80dc('0x9b')]}});})['then'](function(_0x39ea8b){socket[_0x80dc('0xb3')]('chatInteractionTags:save',{'id':Number(_0x39ddf7[_0x80dc('0x3d')]['id']),'tags':_0x39ea8b||[]});return{'id':Number(_0x39ddf7[_0x80dc('0x3d')]['id']),'tags':_0x39ea8b||[]};});}})[_0x80dc('0x2a')](respondWithResult(_0xc142b1,null))['catch'](handleError(_0xc142b1,null));};exports[_0x80dc('0xb4')]=function(_0x5d5514,_0x29c973){return db[_0x80dc('0x3f')]['find']({'where':{'id':_0x5d5514[_0x80dc('0x3d')]['id']}})[_0x80dc('0x2a')](handleEntityNotFound(_0x29c973,null))[_0x80dc('0x2a')](function(_0x884247){if(_0x884247){return _0x884247['removeTags'](_0x5d5514[_0x80dc('0x3a')][_0x80dc('0x9b')]);}})[_0x80dc('0x2a')](respondWithStatusCode(_0x29c973,null))[_0x80dc('0x3b')](handleError(_0x29c973,null));};exports[_0x80dc('0x77')]=function(_0x402286,_0x15233d){var _0xeca5bf=moment()[_0x80dc('0xb5')]()[_0x80dc('0xb6')]();var _0x10fcd6=path[_0x80dc('0x73')](config[_0x80dc('0x79')],'server',_0x80dc('0xb7'),_0x80dc('0xb8'));var _0x3dcc04=path[_0x80dc('0x73')](config[_0x80dc('0x79')],_0x80dc('0xb9'),_0x80dc('0xb7'),_0x80dc('0xba'));var _0x1b8b83=path[_0x80dc('0x73')](_0x10fcd6,_0xeca5bf);var _0x41891e=util[_0x80dc('0x7a')](_0x80dc('0xbb'),_0x402286[_0x80dc('0x3d')]['id'],_0xeca5bf);var _0x526bda=path[_0x80dc('0x73')](_0x10fcd6,_0x41891e);var _0x2a6170=[];_0x2a6170[_0x80dc('0xae')]({'model':db['User'],'as':'User','attributes':['id',_0x80dc('0x56')],'raw':!![]});_0x2a6170['push']({'model':db[_0x80dc('0x65')],'as':_0x80dc('0x66'),'attributes':['id',_0x80dc('0xbc'),_0x80dc('0xbd')],'raw':!![]});if(_0x402286['query'][_0x80dc('0xba')]){_0x2a6170[_0x80dc('0xae')]({'model':db[_0x80dc('0x6e')],'as':_0x80dc('0x6e'),'raw':!![]});}var _0x27ec7a=[{'model':db[_0x80dc('0x7c')],'as':_0x80dc('0x7d'),'attributes':['id',_0x80dc('0x2f'),_0x80dc('0x8b'),_0x80dc('0x8d'),'secret','read'],'include':_0x2a6170}];_0x27ec7a[_0x80dc('0xae')]({'model':db[_0x80dc('0x4f')],'as':'Account','attributes':['id',_0x80dc('0x2c')]});_0x27ec7a[_0x80dc('0xae')]({'model':db['User'],'as':'Owner','attributes':['id',_0x80dc('0x56')]});return db[_0x80dc('0x3f')][_0x80dc('0x48')]({'where':{'id':_0x402286[_0x80dc('0x3d')]['id']},'include':_0x27ec7a})['then'](handleEntityNotFound(_0x15233d,null))[_0x80dc('0x2a')](function(_0x5a165a){if(_0x5a165a){var _0x19736f=_0x5a165a[_0x80dc('0xbe')]({'plain':!![]});fs[_0x80dc('0xbf')](_0x1b8b83);var _0x430678={'channel':_0x80dc('0xc0'),'account':_0x19736f[_0x80dc('0xc1')][_0x80dc('0x2c')],'agent':_0x19736f[_0x80dc('0xc2')]?_0x19736f[_0x80dc('0xc2')][_0x80dc('0x56')]:'N.A.','createdAt':moment(_0x19736f[_0x80dc('0x8b')])[_0x80dc('0x7a')](_0x80dc('0xaa'))[_0x80dc('0xb6')](),'closedAt':_0x19736f['closed']?moment(_0x19736f[_0x80dc('0xc3')])[_0x80dc('0x7a')](_0x80dc('0xaa'))[_0x80dc('0xb6')]():'','disposition':_0x19736f[_0x80dc('0x69')],'chatInfo':{'browser':_0x19736f[_0x80dc('0xc4')],'os':_0x19736f['osName'],'referer':_0x19736f['referer'],'customerIp':_0x19736f['customerIp'],'customerPort':_0x19736f['customerPort']?_0x19736f['customerPort']:_0x80dc('0xc5')},'messages':_(_0x19736f['Messages'])['tail']()[_0x80dc('0xa6')]({'secret':![]})[_0x80dc('0xa7')](function(_0x5899f1){if(_0x5899f1[_0x80dc('0x6e')]){var _0x3fceeb=path['join'](_0x3dcc04,_0x5899f1['Attachment'][_0x80dc('0x76')]);if(fs['existsSync'](_0x3fceeb)){fs[_0x80dc('0xc6')](_0x3fceeb)[_0x80dc('0xc7')](fs[_0x80dc('0xc8')](path[_0x80dc('0x73')](_0x1b8b83,_0x5899f1[_0x80dc('0x6e')]['basename'])));}}return{'date':moment(_0x5899f1[_0x80dc('0x8b')])['format'](_0x80dc('0xaa'))[_0x80dc('0xb6')](),'sender':_0x5899f1[_0x80dc('0x8d')]===_0x80dc('0x61')?_0x5899f1[_0x80dc('0x7e')]?_0x5899f1['User'][_0x80dc('0x56')]:_0x80dc('0x83'):_0x5899f1['Contact']['firstName']+(_0x5899f1['Contact'][_0x80dc('0xbd')]?'\x20'+_0x5899f1[_0x80dc('0x66')][_0x80dc('0xbd')]:''),'body':_0x5899f1['Attachment']?_0x5899f1[_0x80dc('0x6e')][_0x80dc('0x76')]:_0x5899f1['body'],'direction':_0x5899f1[_0x80dc('0x8d')]===_0x80dc('0x61')?'A':'C','secret':_0x5899f1['secret'],'read':_0x5899f1[_0x80dc('0xc9')],'attachment':_0x5899f1[_0x80dc('0x6e')]};})[_0x80dc('0xca')]()};return ejs[_0x80dc('0xcb')](path[_0x80dc('0x73')](config['root'],'server','views',_0x80dc('0xcc')),{'interaction':_0x430678})[_0x80dc('0x2a')](function(_0x48fe8a){var _0x3ebafb=path[_0x80dc('0x73')](_0x1b8b83,'transcript-'+_0x19736f['id']+'-'+_0xeca5bf+_0x80dc('0xcd'));var _0x35810d={'path':_0x3ebafb,'channel':_0x80dc('0xc0'),'interactionId':_0x19736f['id']};return pdf[_0x80dc('0xce')](_0x48fe8a,_0x35810d);})[_0x80dc('0x2a')](function(){return new Promise(function(_0x113092,_0x230704){zipdir(_0x1b8b83,{'saveTo':_0x526bda},function(_0x2d01a7,_0x45f74f){if(_0x2d01a7)return _0x230704(_0x2d01a7);return _0x113092(_0x45f74f);});})['then'](function(){return new BPromise(function(_0x1dba93,_0x8fc00e){rimraf(_0x1b8b83,function(_0x18a93a){if(_0x18a93a)_0x8fc00e(_0x18a93a);return _0x1dba93();});});})[_0x80dc('0x2a')](function(){return _0x15233d['download'](_0x526bda,_0x41891e,function(_0x16fead){if(_0x16fead){logger['error'](_0x80dc('0xcf'),_0x16fead);}else{fs[_0x80dc('0xd0')](_0x526bda);}});});});}else{return _0x15233d[_0x80dc('0x20')](0xc8);}})[_0x80dc('0x3b')](handleError(_0x15233d,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17d4=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','setDataValue','unreadMessages','length','emit'];(function(_0x372eaf,_0x49ec27){var _0x240471=function(_0x112005){while(--_0x112005){_0x372eaf['push'](_0x372eaf['shift']());}};_0x240471(++_0x49ec27);}(_0x17d4,0xa6));var _0x417d=function(_0x377743,_0x584cab){_0x377743=_0x377743-0x0;var _0x30ae30=_0x17d4[_0x377743];return _0x30ae30;};'use strict';var EventEmitter=require(_0x417d('0x0'));var ChatInteraction=require(_0x417d('0x1'))['db'][_0x417d('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x417d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x417d('0x4')](0x0);var events={'afterCreate':_0x417d('0x5'),'afterUpdate':_0x417d('0x6'),'afterDestroy':'remove'};function emitEvent(_0x37f26b){return function(_0x59fdf0,_0x1eddca,_0x3c0e51){_0x59fdf0[_0x417d('0x7')]({'attributes':['id'],'raw':!![]})[_0x417d('0x8')](function(_0x10e92c){_0x59fdf0['setDataValue'](_0x417d('0x9'),_0x10e92c['map'](function(_0x1b1548){return{'id':_0x1b1548['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x59fdf0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x417d('0x8')](function(_0x104fe0){_0x59fdf0[_0x417d('0xa')](_0x417d('0xb'),_0x104fe0[_0x417d('0xc')]);ChatInteractionEvents[_0x417d('0xd')](_0x37f26b+':'+_0x59fdf0['id'],_0x59fdf0);ChatInteractionEvents[_0x417d('0xd')](_0x37f26b,_0x59fdf0);_0x3c0e51(null);})[_0x417d('0xe')](_0x3c0e51(null));};}for(var e in events){if(events[_0x417d('0xf')](e)){var event=events[e];ChatInteraction[_0x417d('0x10')](e,emitEvent(event));}}module[_0x417d('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x901d=['getUsers','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x4197e8,_0x351ded){var _0x2eb1cb=function(_0x419e18){while(--_0x419e18){_0x4197e8['push'](_0x4197e8['shift']());}};_0x2eb1cb(++_0x351ded);}(_0x901d,0x83));var _0xd901=function(_0x172c19,_0x5c2ee5){_0x172c19=_0x172c19-0x0;var _0x29fc7c=_0x901d[_0x172c19];return _0x29fc7c;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xd901('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xd901('0x0'))['db'][_0xd901('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd901('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd901('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5c6b18){return function(_0x7a20e6,_0x27e84a,_0x3536b7){_0x7a20e6[_0xd901('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x307de0){_0x7a20e6['setDataValue'](_0xd901('0x5'),_0x307de0[_0xd901('0x6')](function(_0x4cb441){return{'id':_0x4cb441['id']};}));return ChatMessage[_0xd901('0x7')]({'where':{'ChatInteractionId':_0x7a20e6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd901('0x8')](function(_0x270332){_0x7a20e6['setDataValue'](_0xd901('0x9'),_0x270332[_0xd901('0xa')]);ChatInteractionEvents[_0xd901('0xb')](_0x5c6b18+':'+_0x7a20e6['id'],_0x7a20e6);ChatInteractionEvents['emit'](_0x5c6b18,_0x7a20e6);_0x3536b7(null);})[_0xd901('0xc')](_0x3536b7(null));};}for(var e in events){if(events[_0xd901('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xd901('0xe')]=ChatInteractionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xe77ed0,_0x1d1db4){var _0x9d5b08=function(_0x2ed60b){while(--_0x2ed60b){_0xe77ed0['push'](_0xe77ed0['shift']());}};_0x9d5b08(++_0x1d1db4);}(_0x008c,0x76));var _0xc008=function(_0x27f569,_0x11892a){_0x27f569=_0x27f569-0x0;var _0x3774c4=_0x008c[_0x27f569];return _0x3774c4;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require(_0xc008('0x5'));var rp=require(_0xc008('0x6'));var fs=require('fs');var path=require(_0xc008('0x7'));var rimraf=require(_0xc008('0x8'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xc008('0x9')]=function(_0x361233,_0x1f4f5f){return _0x361233[_0xc008('0xa')](_0xc008('0xb'),attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x330616,_0x609881,_0xad65f8){if(_0x330616[_0xc008('0xd')](_0xc008('0xe'))){_0x330616[_0xc008('0xf')]=moment()[_0xc008('0x10')](_0xc008('0x11'));}_0xad65f8(null,_0x330616);}},'charset':_0xc008('0x12'),'collate':_0xc008('0x13')});};
\ No newline at end of file
+var _0xe66c=['chat_interactions','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xe66c,0xb9));var _0xce66=function(_0x1bf005,_0x136e33){_0x1bf005=_0x1bf005-0x0;var _0x465c28=_0xe66c[_0x1bf005];return _0x465c28;};'use strict';var _=require(_0xce66('0x0'));var util=require(_0xce66('0x1'));var logger=require(_0xce66('0x2'))(_0xce66('0x3'));var moment=require(_0xce66('0x4'));var BPromise=require(_0xce66('0x5'));var rp=require(_0xce66('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce66('0x7'));var config=require(_0xce66('0x8'));var attributes=require(_0xce66('0x9'));module[_0xce66('0xa')]=function(_0x49d250,_0x19e481){return _0x49d250[_0xce66('0xb')](_0xce66('0xc'),attributes,{'tableName':_0xce66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31066e,_0x7b816d,_0x399c9c){if(_0x31066e['changed']('closed')){_0x31066e[_0xce66('0xe')]=moment()[_0xce66('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x399c9c(null,_0x31066e);}},'charset':_0xce66('0x10'),'collate':_0xce66('0x11')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb650=['UpdateChatInteraction','ChatInteraction','update','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4a8774,_0x538b5d){var _0x413cc3=function(_0x358184){while(--_0x358184){_0x4a8774['push'](_0x4a8774['shift']());}};_0x413cc3(++_0x538b5d);}(_0xb650,0xe2));var _0x0b65=function(_0xc736bb,_0x4f2431){_0xc736bb=_0xc736bb-0x0;var _0x5d9ea4=_0xb650[_0xc736bb];return _0x5d9ea4;};'use strict';var _=require('lodash');var util=require(_0x0b65('0x0'));var moment=require(_0x0b65('0x1'));var BPromise=require(_0x0b65('0x2'));var rs=require(_0x0b65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b65('0x4'))['db'];var utils=require(_0x0b65('0x5'));var logger=require(_0x0b65('0x6'))(_0x0b65('0x7'));var config=require(_0x0b65('0x8'));var jayson=require(_0x0b65('0x9'));var client=jayson[_0x0b65('0xa')][_0x0b65('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0b65('0xc')],{'host':_0x0b65('0xd'),'port':0x18eb});var socket=require(_0x0b65('0xe'))(new Redis(config[_0x0b65('0xc')]));require('./chatInteraction.socket')[_0x0b65('0xf')](socket);function respondWithRpcPromise(_0x2eb399,_0x4d79ce,_0x597d92){return new BPromise(function(_0x3d5b2a,_0x47a90e){return client[_0x0b65('0x10')](_0x2eb399,_0x597d92)[_0x0b65('0x11')](function(_0x2bf2cb){logger[_0x0b65('0x12')](_0x0b65('0x13'),_0x4d79ce,_0x0b65('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4d79ce,'request\x20sent',JSON[_0x0b65('0x15')](_0x2bf2cb));if(_0x2bf2cb[_0x0b65('0x16')]){if(_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x17')]===0x1f4){logger[_0x0b65('0x16')](_0x0b65('0x13'),_0x4d79ce,_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);return _0x47a90e(_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4d79ce,_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);return _0x3d5b2a(_0x2bf2cb[_0x0b65('0x16')][_0x0b65('0x18')]);}else{logger[_0x0b65('0x12')](_0x0b65('0x13'),_0x4d79ce,'request\x20sent');_0x3d5b2a(_0x2bf2cb['result'][_0x0b65('0x18')]);}})[_0x0b65('0x19')](function(_0x566627){logger[_0x0b65('0x16')](_0x0b65('0x13'),_0x4d79ce,_0x566627);_0x47a90e(_0x566627);});});}exports[_0x0b65('0x1a')]=function(_0x15fd28){var _0x399c03=this;return new Promise(function(_0x3c87e0,_0x3e5176){return db[_0x0b65('0x1b')][_0x0b65('0x1c')](_0x15fd28['body'],{'raw':_0x15fd28[_0x0b65('0x1d')]?_0x15fd28[_0x0b65('0x1d')][_0x0b65('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15fd28['options']?_0x15fd28['options'][_0x0b65('0x1f')]||null:null,'attributes':_0x15fd28[_0x0b65('0x1d')]?_0x15fd28[_0x0b65('0x1d')]['attributes']||null:null,'limit':_0x15fd28[_0x0b65('0x1d')]?_0x15fd28[_0x0b65('0x1d')][_0x0b65('0x20')]||null:null})['then'](function(_0x2adde4){logger[_0x0b65('0x12')]('UpdateChatInteraction',_0x15fd28);logger['debug']('UpdateChatInteraction',_0x15fd28,JSON[_0x0b65('0x15')](_0x2adde4));_0x3c87e0(_0x2adde4);})[_0x0b65('0x19')](function(_0x1de20c){logger[_0x0b65('0x16')](_0x0b65('0x1a'),_0x1de20c['message'],_0x15fd28);_0x3e5176(_0x399c03['error'](0x1f4,_0x1de20c[_0x0b65('0x18')]));});});};exports[_0x0b65('0x21')]=function(_0x1fecdf){return new Promise(function(_0x5a503f,_0x4012dd){return db[_0x0b65('0x1b')][_0x0b65('0x22')]({'where':_0x1fecdf['options']?_0x1fecdf['options'][_0x0b65('0x1f')]||null:null})['then'](function(_0x534fb6){if(_0x534fb6){return _0x534fb6[_0x0b65('0x23')](_0x1fecdf[_0x0b65('0x24')][_0x0b65('0x25')],_[_0x0b65('0x26')](_0x1fecdf[_0x0b65('0x24')],[_0x0b65('0x25'),'id'])||{});}})[_0x0b65('0x27')](function(_0x4b40a0){logger[_0x0b65('0x12')](_0x0b65('0x28'),_0x1fecdf);logger[_0x0b65('0x29')]('AddTags',_0x1fecdf,JSON['stringify'](_0x4b40a0));_0x5a503f(_0x4b40a0);})[_0x0b65('0x19')](function(_0xc25c86){logger[_0x0b65('0x16')](_0x0b65('0x28'),_0xc25c86[_0x0b65('0x18')],_0x1fecdf);_0x4012dd(_this[_0x0b65('0x16')](0x1f4,_0xc25c86[_0x0b65('0x18')]));});});};
\ No newline at end of file
+var _0x6fcd=['info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa7c249,_0x599b5e){var _0x1a9b26=function(_0x2b8797){while(--_0x2b8797){_0xa7c249['push'](_0xa7c249['shift']());}};_0x1a9b26(++_0x599b5e);}(_0x6fcd,0x132));var _0xd6fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6fcd[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xd6fc('0x0'));var moment=require('moment');var BPromise=require(_0xd6fc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6fc('0x2'))['db'];var utils=require(_0xd6fc('0x3'));var logger=require(_0xd6fc('0x4'))('rpc');var config=require(_0xd6fc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd6fc('0x6')]['http']({'port':0x232a});config[_0xd6fc('0x7')]=_[_0xd6fc('0x8')](config[_0xd6fc('0x7')],{'host':_0xd6fc('0x9'),'port':0x18eb});var socket=require(_0xd6fc('0xa'))(new Redis(config['redis']));require(_0xd6fc('0xb'))[_0xd6fc('0xc')](socket);function respondWithRpcPromise(_0x529c74,_0x5509f9,_0x372d34){return new BPromise(function(_0xdc8a80,_0x2f1fe6){return client[_0xd6fc('0xd')](_0x529c74,_0x372d34)[_0xd6fc('0xe')](function(_0x12b662){logger['info'](_0xd6fc('0xf'),_0x5509f9,_0xd6fc('0x10'));logger['debug'](_0xd6fc('0x11'),_0x5509f9,_0xd6fc('0x10'),JSON[_0xd6fc('0x12')](_0x12b662));if(_0x12b662[_0xd6fc('0x13')]){if(_0x12b662[_0xd6fc('0x13')][_0xd6fc('0x14')]===0x1f4){logger[_0xd6fc('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x5509f9,_0x12b662[_0xd6fc('0x13')]['message']);return _0x2f1fe6(_0x12b662[_0xd6fc('0x13')][_0xd6fc('0x15')]);}logger[_0xd6fc('0x13')](_0xd6fc('0xf'),_0x5509f9,_0x12b662[_0xd6fc('0x13')][_0xd6fc('0x15')]);return _0xdc8a80(_0x12b662[_0xd6fc('0x13')]['message']);}else{logger[_0xd6fc('0x16')](_0xd6fc('0xf'),_0x5509f9,_0xd6fc('0x10'));_0xdc8a80(_0x12b662['result'][_0xd6fc('0x15')]);}})[_0xd6fc('0x17')](function(_0x3face8){logger[_0xd6fc('0x13')](_0xd6fc('0xf'),_0x5509f9,_0x3face8);_0x2f1fe6(_0x3face8);});});}exports[_0xd6fc('0x18')]=function(_0x148163){var _0x20b8e3=this;return new Promise(function(_0x2d6995,_0x2dbccf){return db[_0xd6fc('0x19')][_0xd6fc('0x1a')](_0x148163[_0xd6fc('0x1b')],{'raw':_0x148163['options']?_0x148163[_0xd6fc('0x1c')][_0xd6fc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x148163[_0xd6fc('0x1c')]?_0x148163[_0xd6fc('0x1c')][_0xd6fc('0x1e')]||null:null,'attributes':_0x148163[_0xd6fc('0x1c')]?_0x148163['options'][_0xd6fc('0x1f')]||null:null,'limit':_0x148163[_0xd6fc('0x1c')]?_0x148163[_0xd6fc('0x1c')][_0xd6fc('0x20')]||null:null})['then'](function(_0x135ec0){logger['info'](_0xd6fc('0x18'),_0x148163);logger[_0xd6fc('0x21')]('UpdateChatInteraction',_0x148163,JSON[_0xd6fc('0x12')](_0x135ec0));_0x2d6995(_0x135ec0);})[_0xd6fc('0x17')](function(_0x5bed98){logger[_0xd6fc('0x13')]('UpdateChatInteraction',_0x5bed98[_0xd6fc('0x15')],_0x148163);_0x2dbccf(_0x20b8e3[_0xd6fc('0x13')](0x1f4,_0x5bed98[_0xd6fc('0x15')]));});});};exports[_0xd6fc('0x22')]=function(_0x5c2d34){return new Promise(function(_0x40a2e8,_0x22603f){return db[_0xd6fc('0x19')][_0xd6fc('0x23')]({'where':_0x5c2d34[_0xd6fc('0x1c')]?_0x5c2d34['options'][_0xd6fc('0x1e')]||null:null})[_0xd6fc('0xe')](function(_0x46ba64){if(_0x46ba64){return _0x46ba64[_0xd6fc('0x24')](_0x5c2d34[_0xd6fc('0x1b')][_0xd6fc('0x25')],_[_0xd6fc('0x26')](_0x5c2d34[_0xd6fc('0x1b')],[_0xd6fc('0x25'),'id'])||{});}})[_0xd6fc('0x27')](function(_0x83086c){logger[_0xd6fc('0x16')](_0xd6fc('0x28'),_0x5c2d34);logger[_0xd6fc('0x21')](_0xd6fc('0x28'),_0x5c2d34,JSON['stringify'](_0x83086c));_0x40a2e8(_0x83086c);})['catch'](function(_0x1068b1){logger['error']('AddTags',_0x1068b1[_0xd6fc('0x15')],_0x5c2d34);_0x22603f(_this[_0xd6fc('0x13')](0x1f4,_0x1068b1[_0xd6fc('0x15')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad81=['length','save','remove','update','emit'];(function(_0x4e2f62,_0x2b51df){var _0x3ae075=function(_0x20928d){while(--_0x20928d){_0x4e2f62['push'](_0x4e2f62['shift']());}};_0x3ae075(++_0x2b51df);}(_0xad81,0xfb));var _0x1ad8=function(_0x4fc492,_0x59451a){_0x4fc492=_0x4fc492-0x0;var _0xeb17f3=_0xad81[_0x4fc492];return _0xeb17f3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x1ad8('0x0'),_0x1ad8('0x1'),_0x1ad8('0x2')];function createListener(_0x561de2,_0x159f54){return function(_0x47b591){_0x159f54[_0x1ad8('0x3')](_0x561de2,_0x47b591);};}function removeListener(_0x177f40,_0x38c831){return function(){ChatInteractionEvents['removeListener'](_0x177f40,_0x38c831);};}exports['register']=function(_0x1f9d38){for(var _0x5ce2c3=0x0,_0x16b6cc=events[_0x1ad8('0x4')];_0x5ce2c3<_0x16b6cc;_0x5ce2c3++){var _0x22792c=events[_0x5ce2c3];var _0x550f0f=createListener('chatInteraction:'+_0x22792c,_0x1f9d38);ChatInteractionEvents['on'](_0x22792c,_0x550f0f);}};
\ No newline at end of file
+var _0xa76e=['removeListener','length','./chatInteraction.events','save','update','emit'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa76e,0x7a));var _0xea76=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xa76e[_0x16b9ed];return _0x66b1f8;};'use strict';var ChatInteractionEvents=require(_0xea76('0x0'));var events=[_0xea76('0x1'),'remove',_0xea76('0x2')];function createListener(_0xbca313,_0x310437){return function(_0x1fe2ac){_0x310437[_0xea76('0x3')](_0xbca313,_0x1fe2ac);};}function removeListener(_0x40f662,_0x3af48c){return function(){ChatInteractionEvents[_0xea76('0x4')](_0x40f662,_0x3af48c);};}exports['register']=function(_0x81f8e){for(var _0x3473d8=0x0,_0x342de8=events[_0xea76('0x5')];_0x3473d8<_0x342de8;_0x3473d8++){var _0x3d1c91=events[_0x3473d8];var _0x5ba34d=createListener('chatInteraction:'+_0x3d1c91,_0x81f8e);ChatInteractionEvents['on'](_0x3d1c91,_0x5ba34d);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb946=['getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','customUpdate','/:id/abandon','abandon','delete','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','describe','get','/:id','show','isChatInteractionAuthorized','getMessages','/:id/my_messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb946,0x127));var _0x6b94=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb946[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x6b94('0x0'));var util=require(_0x6b94('0x1'));var path=require(_0x6b94('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b94('0x3'));var router=express[_0x6b94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b94('0x5'));var interaction=require(_0x6b94('0x6'));var config=require(_0x6b94('0x7'));var controller=require(_0x6b94('0x8'));router['get']('/',auth[_0x6b94('0x9')](),controller['index']);router['get']('/describe',auth[_0x6b94('0x9')](),controller[_0x6b94('0xa')]);router[_0x6b94('0xb')](_0x6b94('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x6b94('0xd')]);router[_0x6b94('0xb')]('/:id/attachment_download',auth[_0x6b94('0xe')](),controller['attachmentDownload']);router[_0x6b94('0xb')]('/:id/messages',auth[_0x6b94('0x9')](),controller[_0x6b94('0xf')]);router[_0x6b94('0xb')](_0x6b94('0x10'),auth[_0x6b94('0xe')](),controller[_0x6b94('0x11')]);router[_0x6b94('0xb')](_0x6b94('0x12'),auth['isAuthenticated'](),controller[_0x6b94('0x13')]);router[_0x6b94('0x14')]('/',auth[_0x6b94('0x9')](),controller[_0x6b94('0x15')]);router[_0x6b94('0x14')](_0x6b94('0x16'),auth['isAuthenticated'](),controller[_0x6b94('0x17')]);var upload=multer({'storage':multer[_0x6b94('0x18')]({'destination':function(_0x47deaf,_0x526da4,_0x442702){_0x442702(null,path[_0x6b94('0x19')](config[_0x6b94('0x1a')],_0x6b94('0x1b')));},'filename':function(_0x472c40,_0x2f032f,_0x3c54d0){_0x3c54d0(null,util[_0x6b94('0x1c')](_0x6b94('0x1d'),Date['now'](),_0x2f032f['originalname'][_0x6b94('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6b94('0x14')](_0x6b94('0x1f'),upload[_0x6b94('0x20')](_0x6b94('0x21')),controller[_0x6b94('0x22')]);router[_0x6b94('0x14')](_0x6b94('0x23'),auth[_0x6b94('0xe')](),controller[_0x6b94('0x24')]);router[_0x6b94('0x14')](_0x6b94('0x25'),auth['isAuthenticated'](),interaction[_0x6b94('0x26')](_0x6b94('0x27'),_0x6b94('0x28')),controller[_0x6b94('0x29')]);router['put'](_0x6b94('0xc'),auth['isAuthenticated'](),interaction[_0x6b94('0x26')]('chat',_0x6b94('0x2a')),controller[_0x6b94('0x2b')]);router[_0x6b94('0x2c')]('/:id/custom_update',controller[_0x6b94('0x2d')]);router[_0x6b94('0x2c')](_0x6b94('0x2e'),auth[_0x6b94('0xe')](),controller[_0x6b94('0x2f')]);router['put']('/:id/close',controller['close']);router[_0x6b94('0x30')](_0x6b94('0xc'),auth[_0x6b94('0x9')](),interaction[_0x6b94('0x26')]('chat','chatinteraction:destroy'),controller[_0x6b94('0x31')]);router[_0x6b94('0x30')](_0x6b94('0x25'),auth[_0x6b94('0x9')](),controller[_0x6b94('0x32')]);module[_0x6b94('0x33')]=router;
\ No newline at end of file
+var _0x0ac3=['customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','/:id','tracked','chatinteraction:update','update','/:id/custom_update'];(function(_0x5e60e4,_0x22236b){var _0x3e9bbd=function(_0x4db31e){while(--_0x4db31e){_0x5e60e4['push'](_0x5e60e4['shift']());}};_0x3e9bbd(++_0x22236b);}(_0x0ac3,0x1af));var _0x30ac=function(_0x5885b6,_0x57ea11){_0x5885b6=_0x5885b6-0x0;var _0x201930=_0x0ac3[_0x5885b6];return _0x201930;};'use strict';var multer=require(_0x30ac('0x0'));var util=require(_0x30ac('0x1'));var path=require('path');var timeout=require(_0x30ac('0x2'));var express=require(_0x30ac('0x3'));var router=express[_0x30ac('0x4')]();var fs_extra=require(_0x30ac('0x5'));var auth=require(_0x30ac('0x6'));var interaction=require(_0x30ac('0x7'));var config=require(_0x30ac('0x8'));var controller=require(_0x30ac('0x9'));router[_0x30ac('0xa')]('/',auth[_0x30ac('0xb')](),controller[_0x30ac('0xc')]);router[_0x30ac('0xa')](_0x30ac('0xd'),auth['isAuthenticated'](),controller[_0x30ac('0xe')]);router[_0x30ac('0xa')]('/:id',auth[_0x30ac('0xf')](),controller['show']);router['get'](_0x30ac('0x10'),auth[_0x30ac('0xf')](),controller['attachmentDownload']);router[_0x30ac('0xa')](_0x30ac('0x11'),auth[_0x30ac('0xb')](),controller[_0x30ac('0x12')]);router[_0x30ac('0xa')]('/:id/my_messages',auth[_0x30ac('0xf')](),controller[_0x30ac('0x13')]);router['get'](_0x30ac('0x14'),auth[_0x30ac('0xb')](),controller[_0x30ac('0x15')]);router[_0x30ac('0x16')]('/',auth[_0x30ac('0xb')](),controller[_0x30ac('0x17')]);router[_0x30ac('0x16')](_0x30ac('0x18'),auth[_0x30ac('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x30ac('0x19')]({'destination':function(_0x489f54,_0x4a4399,_0x345962){_0x345962(null,path['join'](config[_0x30ac('0x1a')],'server/files/attachments/'));},'filename':function(_0x546bce,_0x40d2a6,_0x2c8861){_0x2c8861(null,util['format'](_0x30ac('0x1b'),Date[_0x30ac('0x1c')](),_0x40d2a6[_0x30ac('0x1d')][_0x30ac('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x30ac('0x16')](_0x30ac('0x1f'),upload[_0x30ac('0x20')](_0x30ac('0x21')),controller[_0x30ac('0x22')]);router[_0x30ac('0x16')]('/:id/messages',auth[_0x30ac('0xf')](),controller[_0x30ac('0x23')]);router[_0x30ac('0x16')](_0x30ac('0x24'),auth['isAuthenticated'](),interaction['tracked'](_0x30ac('0x25'),_0x30ac('0x26')),controller[_0x30ac('0x27')]);router[_0x30ac('0x28')](_0x30ac('0x29'),auth['isAuthenticated'](),interaction[_0x30ac('0x2a')](_0x30ac('0x25'),_0x30ac('0x2b')),controller[_0x30ac('0x2c')]);router[_0x30ac('0x28')](_0x30ac('0x2d'),controller[_0x30ac('0x2e')]);router[_0x30ac('0x28')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x30ac('0x2f')]);router[_0x30ac('0x28')](_0x30ac('0x30'),controller['close']);router[_0x30ac('0x31')](_0x30ac('0x29'),auth[_0x30ac('0xb')](),interaction[_0x30ac('0x2a')](_0x30ac('0x25'),_0x30ac('0x32')),controller['destroy']);router[_0x30ac('0x31')]('/:id/tags',auth[_0x30ac('0xb')](),controller[_0x30ac('0x33')]);module[_0x30ac('0x34')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbddc=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xbddc,0x189));var _0xcbdd=function(_0x1acc04,_0x1d4ad3){_0x1acc04=_0x1acc04-0x0;var _0x39e448=_0xbddc[_0x1acc04];return _0x39e448;};'use strict';var Sequelize=require(_0xcbdd('0x0'));module[_0xcbdd('0x1')]={'body':{'type':Sequelize[_0xcbdd('0x2')](_0xcbdd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcbdd('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcbdd('0x5')]}};
\ No newline at end of file
+var _0xbfdf=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1f7120,_0x53456a){var _0x512142=function(_0xae9761){while(--_0xae9761){_0x1f7120['push'](_0x1f7120['shift']());}};_0x512142(++_0x53456a);}(_0xbfdf,0x145));var _0xfbfd=function(_0x357b47,_0x3f2cb2){_0x357b47=_0x357b47-0x0;var _0x33781c=_0xbfdf[_0x357b47];return _0x33781c;};'use strict';var Sequelize=require(_0xfbfd('0x0'));module[_0xfbfd('0x1')]={'body':{'type':Sequelize[_0xfbfd('0x2')](_0xfbfd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfbfd('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xfbfd('0x5')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0293=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','lastLoginAt','allowmessenger','showWebBar','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','user','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0xeec31d,_0x189f0c){var _0x5915e1=function(_0x2cf944){while(--_0x2cf944){_0xeec31d['push'](_0xeec31d['shift']());}};_0x5915e1(++_0x189f0c);}(_0x0293,0x194));var _0x3029=function(_0xe02f54,_0xeb56e6){_0xe02f54=_0xe02f54-0x0;var _0x19e3ef=_0x0293[_0xe02f54];return _0x19e3ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3029('0x0'));var zipdir=require(_0x3029('0x1'));var jsonpatch=require(_0x3029('0x2'));var rp=require('request-promise');var moment=require(_0x3029('0x3'));var BPromise=require(_0x3029('0x4'));var Mustache=require(_0x3029('0x5'));var util=require(_0x3029('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3029('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3029('0x8'));var _=require(_0x3029('0x9'));var squel=require(_0x3029('0xa'));var crypto=require(_0x3029('0xb'));var jsforce=require(_0x3029('0xc'));var deskjs=require(_0x3029('0xd'));var toCsv=require(_0x3029('0x7'));var querystring=require(_0x3029('0xe'));var Papa=require(_0x3029('0xf'));var Redis=require(_0x3029('0x10'));var authService=require(_0x3029('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3029('0x12'));var logger=require(_0x3029('0x13'))(_0x3029('0x14'));var utils=require('../../config/utils');var config=require(_0x3029('0x15'));var licenseUtil=require(_0x3029('0x16'));var db=require(_0x3029('0x17'))['db'];config['redis']=_[_0x3029('0x18')](config[_0x3029('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x3029('0x1a'))(new Redis(config[_0x3029('0x19')]));require(_0x3029('0x1b'))['register'](socket);function respondWithStatusCode(_0x6b7545,_0x3c3dd4){_0x3c3dd4=_0x3c3dd4||0xcc;return function(_0x124ae0){if(_0x124ae0){return _0x6b7545[_0x3029('0x1c')](_0x3c3dd4);}return _0x6b7545[_0x3029('0x1d')](_0x3c3dd4)[_0x3029('0x1e')]();};}function respondWithResult(_0x5c7a97,_0x3816c0){_0x3816c0=_0x3816c0||0xc8;return function(_0x307b3a){if(_0x307b3a){return _0x5c7a97['status'](_0x3816c0)[_0x3029('0x1f')](_0x307b3a);}};}function respondWithFilteredResult(_0x4fbfa7,_0x5c2fa3){return function(_0x337395){if(_0x337395){var _0xbd9b08=typeof _0x5c2fa3[_0x3029('0x20')]===_0x3029('0x21')&&typeof _0x5c2fa3[_0x3029('0x22')]===_0x3029('0x21');var _0x5246df=_0x337395[_0x3029('0x23')];var _0x379e55=_0xbd9b08?0x0:_0x5c2fa3['offset'];var _0x5019e8=_0xbd9b08?_0x337395['count']:_0x5c2fa3[_0x3029('0x20')]+_0x5c2fa3[_0x3029('0x22')];var _0x57d1e6;if(_0x5019e8>=_0x5246df){_0x5019e8=_0x5246df;_0x57d1e6=0xc8;}else{_0x57d1e6=0xce;}_0x4fbfa7['status'](_0x57d1e6);return _0x4fbfa7[_0x3029('0x24')](_0x3029('0x25'),_0x379e55+'-'+_0x5019e8+'/'+_0x5246df)[_0x3029('0x1f')](_0x337395);}return null;};}function patchUpdates(_0x386fe7){return function(_0x30c542){try{jsonpatch[_0x3029('0x26')](_0x30c542,_0x386fe7,!![]);}catch(_0x4b9d92){return BPromise[_0x3029('0x27')](_0x4b9d92);}return _0x30c542['save']();};}function saveUpdates(_0x3a7873,_0x1cd346){return function(_0x94a105){if(_0x94a105){return _0x94a105[_0x3029('0x28')](_0x3a7873)[_0x3029('0x29')](function(_0x3c0ddf){return _0x3c0ddf;});}return null;};}function removeEntity(_0x208992,_0x3b2353){return function(_0x353088){if(_0x353088){return _0x353088[_0x3029('0x2a')]()[_0x3029('0x29')](function(){_0x208992[_0x3029('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333016,_0xfc166c){return function(_0x520ee6){if(!_0x520ee6){_0x333016[_0x3029('0x1c')](0x194);}return _0x520ee6;};}function handleError(_0x319b01,_0x2efed7){_0x2efed7=_0x2efed7||0x1f4;return function(_0x3e8c0b){logger[_0x3029('0x2b')](_0x3e8c0b[_0x3029('0x2c')]);if(_0x3e8c0b[_0x3029('0x2d')]){delete _0x3e8c0b[_0x3029('0x2d')];}_0x319b01[_0x3029('0x1d')](_0x2efed7)[_0x3029('0x2e')](_0x3e8c0b);};}exports[_0x3029('0x2f')]=function(_0x4940c0,_0x55cc1f){var _0x9650be={},_0x51c368={},_0x52a8a8={'count':0x0,'rows':[]};var _0xba2d4a=_[_0x3029('0x30')](db[_0x3029('0x31')]['rawAttributes'],function(_0x25fe8e){return{'name':_0x25fe8e[_0x3029('0x32')],'type':_0x25fe8e[_0x3029('0x33')][_0x3029('0x34')]};});_0x51c368['model']=_[_0x3029('0x30')](_0xba2d4a,_0x3029('0x2d'));_0x51c368[_0x3029('0x35')]=_[_0x3029('0x36')](_0x4940c0[_0x3029('0x35')]);_0x51c368['filters']=_[_0x3029('0x37')](_0x51c368['model'],_0x51c368[_0x3029('0x35')]);_0x9650be[_0x3029('0x38')]=_[_0x3029('0x37')](_0x51c368[_0x3029('0x39')],qs[_0x3029('0x3a')](_0x4940c0[_0x3029('0x35')][_0x3029('0x3a')]));_0x9650be[_0x3029('0x38')]=_0x9650be[_0x3029('0x38')][_0x3029('0x3b')]?_0x9650be['attributes']:_0x51c368[_0x3029('0x39')];if(!_0x4940c0[_0x3029('0x35')][_0x3029('0x3c')](_0x3029('0x3d'))){_0x9650be[_0x3029('0x22')]=qs[_0x3029('0x22')](_0x4940c0['query']['limit']);_0x9650be[_0x3029('0x20')]=qs[_0x3029('0x20')](_0x4940c0[_0x3029('0x35')][_0x3029('0x20')]);}_0x9650be[_0x3029('0x3e')]=qs['sort'](_0x4940c0['query'][_0x3029('0x3f')]);_0x9650be[_0x3029('0x40')]=qs[_0x3029('0x41')](_[_0x3029('0x42')](_0x4940c0['query'],_0x51c368[_0x3029('0x41')]),_0xba2d4a);if(_0x4940c0[_0x3029('0x35')][_0x3029('0x43')]){_0x9650be[_0x3029('0x40')]=_[_0x3029('0x44')](_0x9650be[_0x3029('0x40')],{'$or':_[_0x3029('0x30')](_0xba2d4a,function(_0x167d5e){if(_0x167d5e['type']!==_0x3029('0x45')){var _0x3b7102={};_0x3b7102[_0x167d5e[_0x3029('0x2d')]]={'$like':'%'+_0x4940c0[_0x3029('0x35')][_0x3029('0x43')]+'%'};return _0x3b7102;}})});}_0x9650be=_[_0x3029('0x44')]({},_0x9650be,_0x4940c0[_0x3029('0x46')]);var _0x501603={'where':_0x9650be[_0x3029('0x40')]};return db[_0x3029('0x31')][_0x3029('0x23')](_0x501603)[_0x3029('0x29')](function(_0x47f26a){_0x52a8a8[_0x3029('0x23')]=_0x47f26a;if(_0x4940c0['query'][_0x3029('0x47')]){_0x9650be['include']=[{'all':!![]}];}return db[_0x3029('0x31')][_0x3029('0x48')](_0x9650be);})[_0x3029('0x29')](function(_0x33ca9c){_0x52a8a8[_0x3029('0x49')]=_0x33ca9c;return _0x52a8a8;})[_0x3029('0x29')](respondWithFilteredResult(_0x55cc1f,_0x9650be))[_0x3029('0x4a')](handleError(_0x55cc1f,null));};exports[_0x3029('0x4b')]=function(_0x1e1bda,_0x289dba){var _0x151b5f={'raw':!![],'where':{'id':_0x1e1bda[_0x3029('0x4c')]['id']}},_0x5bb219={};_0x5bb219[_0x3029('0x39')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x5bb219[_0x3029('0x35')]=_['keys'](_0x1e1bda[_0x3029('0x35')]);_0x5bb219[_0x3029('0x41')]=_[_0x3029('0x37')](_0x5bb219['model'],_0x5bb219[_0x3029('0x35')]);_0x151b5f['attributes']=_['intersection'](_0x5bb219[_0x3029('0x39')],qs[_0x3029('0x3a')](_0x1e1bda['query'][_0x3029('0x3a')]));_0x151b5f[_0x3029('0x38')]=_0x151b5f[_0x3029('0x38')][_0x3029('0x3b')]?_0x151b5f[_0x3029('0x38')]:_0x5bb219[_0x3029('0x39')];if(_0x1e1bda[_0x3029('0x35')][_0x3029('0x47')]){_0x151b5f[_0x3029('0x4d')]=[{'all':!![]}];}_0x151b5f=_[_0x3029('0x44')]({},_0x151b5f,_0x1e1bda[_0x3029('0x46')]);return db[_0x3029('0x31')][_0x3029('0x4e')](_0x151b5f)['then'](handleEntityNotFound(_0x289dba,null))[_0x3029('0x29')](respondWithResult(_0x289dba,null))['catch'](handleError(_0x289dba,null));};exports[_0x3029('0x4f')]=function(_0x4e23c2,_0x32a8d0){return db[_0x3029('0x31')][_0x3029('0x4f')](_0x4e23c2['body'],{})['then'](respondWithResult(_0x32a8d0,0xc9))[_0x3029('0x4a')](handleError(_0x32a8d0,null));};exports['update']=function(_0x27e8fa,_0x45e846){if(_0x27e8fa[_0x3029('0x50')]['id']){delete _0x27e8fa[_0x3029('0x50')]['id'];}return db[_0x3029('0x31')]['find']({'where':{'id':_0x27e8fa[_0x3029('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45e846,null))[_0x3029('0x29')](saveUpdates(_0x27e8fa['body'],null))['then'](respondWithResult(_0x45e846,null))['catch'](handleError(_0x45e846,null));};exports[_0x3029('0x2a')]=function(_0x4b9e55,_0x1499e9){return db['ChatInternalMessage'][_0x3029('0x4e')]({'where':{'id':_0x4b9e55[_0x3029('0x4c')]['id']}})[_0x3029('0x29')](handleEntityNotFound(_0x1499e9,null))['then'](removeEntity(_0x1499e9,null))[_0x3029('0x4a')](handleError(_0x1499e9,null));};exports[_0x3029('0x51')]=function(_0x3a736d,_0x2a2df4){return db[_0x3029('0x31')][_0x3029('0x51')]()[_0x3029('0x29')](respondWithResult(_0x2a2df4,null))['catch'](handleError(_0x2a2df4,null));};function wrapUser(_0x29a4f9){return function(_0x28a704){var _0x266315=_0x29a4f9['get']({'plain':!![]});_0x266315[_0x3029('0x52')]=[];if(_0x28a704){_0x266315['lastMessageAt']=_0x28a704[_0x3029('0x53')];_0x266315[_0x3029('0x54')]=_0x28a704;}else{_0x266315[_0x3029('0x55')]=moment(0x0)['format'](_0x3029('0x56'));_0x266315[_0x3029('0x54')]={};}return _0x266315;};}exports[_0x3029('0x57')]=function(_0x1c27ba,_0x3577dd,_0x587f13){var _0x43c44e=[];return db[_0x3029('0x58')][_0x3029('0x48')]({'where':{'role':[_0x3029('0x59'),_0x3029('0x5a'),'user']},'attributes':['id',_0x3029('0x5b'),_0x3029('0x2d'),_0x3029('0x5c'),'userpic','internal','online',_0x3029('0x5d'),_0x3029('0x5e'),_0x3029('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x3029('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x3e0f2d){if(_0x3e0f2d){var _0x8b0107=_0x1c27ba['user'][_0x3029('0x60')]({'plain':!![]});if(!_0x8b0107)throw new Error(_0x3029('0x61'));if(_0x8b0107[_0x3029('0x5c')]==='user'){return db[_0x3029('0x62')][_0x3029('0x4e')]({'where':{'name':_0x3029('0x63'),'userProfileId':_0x8b0107[_0x3029('0x64')]},'raw':!![]})[_0x3029('0x29')](function(_0x33ff74){if(_0x33ff74){if(_0x33ff74['autoAssociation']===0x0){return db[_0x3029('0x65')][_0x3029('0x48')]({'where':{'sectionId':_0x33ff74['id']},'raw':!![]})['then'](function(_0xe9d8a2){var _0x7ee3cf=[];if(_[_0x3029('0x66')](_0xe9d8a2)){_0x7ee3cf=_[_0x3029('0x43')](_0x3e0f2d,function(_0x1a0a3a){if(_0x1a0a3a[_0x3029('0x5c')]!==_0x3029('0x59')){return _0x1a0a3a;}});return _0x7ee3cf;}else{for(var _0x549a59=0x0;_0x549a59<_0x3e0f2d[_0x3029('0x3b')];_0x549a59++){var _0x2f23ae=_0x3e0f2d[_0x549a59];if(_0x2f23ae[_0x3029('0x5c')]===_0x3029('0x59')){var _0x2c8e6a=_[_0x3029('0x4e')](_0xe9d8a2,function(_0x719bd){return _0x719bd[_0x3029('0x67')]===_0x2f23ae['id'];});if(_0x2c8e6a)_0x7ee3cf['push'](_0x2f23ae);}else{_0x7ee3cf[_0x3029('0x68')](_0x2f23ae);}}return _0x7ee3cf;}});}else{return _0x3e0f2d;}}else{var _0x3a7771=_[_0x3029('0x43')](_0x3e0f2d,function(_0x5d67a9){if(_0x5d67a9['role']!==_0x3029('0x59')){return _0x5d67a9;}});return _0x3a7771;}});}else{return _0x3e0f2d;}}})[_0x3029('0x29')](function(_0x2c1e36){var _0x472c54=[];if(_0x2c1e36){_0x43c44e=_0x2c1e36;for(var _0x3e2bcc=0x0;_0x3e2bcc<_0x2c1e36[_0x3029('0x3b')];_0x3e2bcc+=0x1){_0x43c44e[_0x3e2bcc][_0x3029('0x52')]=[];_0x472c54[_0x3029('0x68')](db[_0x3029('0x31')][_0x3029('0x4e')]({'where':{'FromId':[_0x1c27ba[_0x3029('0x69')]['id'],_0x2c1e36[_0x3e2bcc]['id']],'ToId':[_0x1c27ba[_0x3029('0x69')]['id'],_0x2c1e36[_0x3e2bcc]['id']],'ChatGroupId':null},'attributes':['id',_0x3029('0x53'),_0x3029('0x6a'),_0x3029('0x6b'),_0x3029('0x6c'),_0x3029('0x50')],'order':qs['sort'](_0x3029('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3029('0x29')](wrapUser(_0x2c1e36[_0x3e2bcc])));}return BPromise['all'](_0x472c54);}return[];})['then'](function(_0x5dec56){return{'rows':_0x5dec56,'count':_0x5dec56['length']};})[_0x3029('0x29')](respondWithResult(_0x3577dd,null))[_0x3029('0x4a')](handleError(_0x3577dd,null));};
\ No newline at end of file
+var _0xd539=['filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','options','ChatInternalMessage','then','include','findAll','rows','catch','show','params','model','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','end','name','send','index','map','rawAttributes','fieldName','type','query','keys'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xd539,0x17b));var _0x9d53=function(_0x5bf519,_0x4fd73d){_0x5bf519=_0x5bf519-0x0;var _0x456121=_0xd539[_0x5bf519];return _0x456121;};'use strict';var emlformat=require(_0x9d53('0x0'));var rimraf=require(_0x9d53('0x1'));var zipdir=require(_0x9d53('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d53('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d53('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9d53('0x5'));var csv=require(_0x9d53('0x6'));var ejs=require(_0x9d53('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d53('0x8'));var squel=require('squel');var crypto=require(_0x9d53('0x9'));var jsforce=require(_0x9d53('0xa'));var deskjs=require(_0x9d53('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9d53('0xc'));var Papa=require(_0x9d53('0xd'));var Redis=require(_0x9d53('0xe'));var authService=require(_0x9d53('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9d53('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9d53('0x11'));var utils=require(_0x9d53('0x12'));var config=require(_0x9d53('0x13'));var licenseUtil=require(_0x9d53('0x14'));var db=require(_0x9d53('0x15'))['db'];config['redis']=_[_0x9d53('0x16')](config[_0x9d53('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d53('0x18'))(new Redis(config[_0x9d53('0x17')]));require(_0x9d53('0x19'))[_0x9d53('0x1a')](socket);function respondWithStatusCode(_0x17ec45,_0xf60ab7){_0xf60ab7=_0xf60ab7||0xcc;return function(_0x351496){if(_0x351496){return _0x17ec45[_0x9d53('0x1b')](_0xf60ab7);}return _0x17ec45[_0x9d53('0x1c')](_0xf60ab7)['end']();};}function respondWithResult(_0x2bb760,_0x47bb46){_0x47bb46=_0x47bb46||0xc8;return function(_0x386ef7){if(_0x386ef7){return _0x2bb760[_0x9d53('0x1c')](_0x47bb46)['json'](_0x386ef7);}};}function respondWithFilteredResult(_0x1a3261,_0xc03ed){return function(_0x4c3260){if(_0x4c3260){var _0x496aba=typeof _0xc03ed[_0x9d53('0x1d')]===_0x9d53('0x1e')&&typeof _0xc03ed[_0x9d53('0x1f')]===_0x9d53('0x1e');var _0x2d4e99=_0x4c3260[_0x9d53('0x20')];var _0x3b4c9b=_0x496aba?0x0:_0xc03ed['offset'];var _0xd57deb=_0x496aba?_0x4c3260[_0x9d53('0x20')]:_0xc03ed['offset']+_0xc03ed[_0x9d53('0x1f')];var _0x2b8a80;if(_0xd57deb>=_0x2d4e99){_0xd57deb=_0x2d4e99;_0x2b8a80=0xc8;}else{_0x2b8a80=0xce;}_0x1a3261[_0x9d53('0x1c')](_0x2b8a80);return _0x1a3261['set'](_0x9d53('0x21'),_0x3b4c9b+'-'+_0xd57deb+'/'+_0x2d4e99)[_0x9d53('0x22')](_0x4c3260);}return null;};}function patchUpdates(_0x7eabcd){return function(_0x62cb3){try{jsonpatch[_0x9d53('0x23')](_0x62cb3,_0x7eabcd,!![]);}catch(_0x5afc54){return BPromise['reject'](_0x5afc54);}return _0x62cb3[_0x9d53('0x24')]();};}function saveUpdates(_0xc3a864,_0x1431b5){return function(_0x4b5caf){if(_0x4b5caf){return _0x4b5caf[_0x9d53('0x25')](_0xc3a864)['then'](function(_0x563ad3){return _0x563ad3;});}return null;};}function removeEntity(_0x504694,_0x821786){return function(_0x545d36){if(_0x545d36){return _0x545d36[_0x9d53('0x26')]()['then'](function(){_0x504694[_0x9d53('0x1c')](0xcc)[_0x9d53('0x27')]();});}};}function handleEntityNotFound(_0x4e79f1,_0x52d0bb){return function(_0xf1654f){if(!_0xf1654f){_0x4e79f1['sendStatus'](0x194);}return _0xf1654f;};}function handleError(_0x4d5847,_0x532ace){_0x532ace=_0x532ace||0x1f4;return function(_0x344bfb){logger['error'](_0x344bfb['stack']);if(_0x344bfb[_0x9d53('0x28')]){delete _0x344bfb['name'];}_0x4d5847['status'](_0x532ace)[_0x9d53('0x29')](_0x344bfb);};}exports[_0x9d53('0x2a')]=function(_0x945af6,_0x2a597c){var _0x39dfd5={},_0x1c5688={},_0x4b0ad3={'count':0x0,'rows':[]};var _0x4e9d7f=_[_0x9d53('0x2b')](db['ChatInternalMessage'][_0x9d53('0x2c')],function(_0x19d347){return{'name':_0x19d347[_0x9d53('0x2d')],'type':_0x19d347[_0x9d53('0x2e')]['key']};});_0x1c5688['model']=_[_0x9d53('0x2b')](_0x4e9d7f,_0x9d53('0x28'));_0x1c5688[_0x9d53('0x2f')]=_[_0x9d53('0x30')](_0x945af6['query']);_0x1c5688[_0x9d53('0x31')]=_[_0x9d53('0x32')](_0x1c5688['model'],_0x1c5688['query']);_0x39dfd5[_0x9d53('0x33')]=_[_0x9d53('0x32')](_0x1c5688['model'],qs[_0x9d53('0x34')](_0x945af6[_0x9d53('0x2f')]['fields']));_0x39dfd5[_0x9d53('0x33')]=_0x39dfd5[_0x9d53('0x33')][_0x9d53('0x35')]?_0x39dfd5[_0x9d53('0x33')]:_0x1c5688['model'];if(!_0x945af6['query'][_0x9d53('0x36')]('nolimit')){_0x39dfd5[_0x9d53('0x1f')]=qs['limit'](_0x945af6[_0x9d53('0x2f')][_0x9d53('0x1f')]);_0x39dfd5[_0x9d53('0x1d')]=qs['offset'](_0x945af6[_0x9d53('0x2f')][_0x9d53('0x1d')]);}_0x39dfd5[_0x9d53('0x37')]=qs['sort'](_0x945af6['query']['sort']);_0x39dfd5[_0x9d53('0x38')]=qs[_0x9d53('0x31')](_[_0x9d53('0x39')](_0x945af6[_0x9d53('0x2f')],_0x1c5688[_0x9d53('0x31')]),_0x4e9d7f);if(_0x945af6[_0x9d53('0x2f')][_0x9d53('0x3a')]){_0x39dfd5[_0x9d53('0x38')]=_['merge'](_0x39dfd5[_0x9d53('0x38')],{'$or':_['map'](_0x4e9d7f,function(_0x16357c){if(_0x16357c[_0x9d53('0x2e')]!=='VIRTUAL'){var _0x463e45={};_0x463e45[_0x16357c[_0x9d53('0x28')]]={'$like':'%'+_0x945af6[_0x9d53('0x2f')][_0x9d53('0x3a')]+'%'};return _0x463e45;}})});}_0x39dfd5=_[_0x9d53('0x3b')]({},_0x39dfd5,_0x945af6[_0x9d53('0x3c')]);var _0x2fa8ba={'where':_0x39dfd5['where']};return db[_0x9d53('0x3d')][_0x9d53('0x20')](_0x2fa8ba)[_0x9d53('0x3e')](function(_0x1a7157){_0x4b0ad3['count']=_0x1a7157;if(_0x945af6[_0x9d53('0x2f')]['includeAll']){_0x39dfd5[_0x9d53('0x3f')]=[{'all':!![]}];}return db[_0x9d53('0x3d')][_0x9d53('0x40')](_0x39dfd5);})[_0x9d53('0x3e')](function(_0x11380b){_0x4b0ad3[_0x9d53('0x41')]=_0x11380b;return _0x4b0ad3;})[_0x9d53('0x3e')](respondWithFilteredResult(_0x2a597c,_0x39dfd5))[_0x9d53('0x42')](handleError(_0x2a597c,null));};exports[_0x9d53('0x43')]=function(_0x4f4f24,_0x47ba3d){var _0x271d38={'raw':!![],'where':{'id':_0x4f4f24[_0x9d53('0x44')]['id']}},_0x1c77f7={};_0x1c77f7['model']=_[_0x9d53('0x30')](db[_0x9d53('0x3d')]['rawAttributes']);_0x1c77f7[_0x9d53('0x2f')]=_['keys'](_0x4f4f24[_0x9d53('0x2f')]);_0x1c77f7[_0x9d53('0x31')]=_[_0x9d53('0x32')](_0x1c77f7[_0x9d53('0x45')],_0x1c77f7[_0x9d53('0x2f')]);_0x271d38[_0x9d53('0x33')]=_['intersection'](_0x1c77f7['model'],qs['fields'](_0x4f4f24['query'][_0x9d53('0x34')]));_0x271d38[_0x9d53('0x33')]=_0x271d38[_0x9d53('0x33')][_0x9d53('0x35')]?_0x271d38['attributes']:_0x1c77f7[_0x9d53('0x45')];if(_0x4f4f24[_0x9d53('0x2f')][_0x9d53('0x46')]){_0x271d38[_0x9d53('0x3f')]=[{'all':!![]}];}_0x271d38=_[_0x9d53('0x3b')]({},_0x271d38,_0x4f4f24[_0x9d53('0x3c')]);return db[_0x9d53('0x3d')][_0x9d53('0x47')](_0x271d38)[_0x9d53('0x3e')](handleEntityNotFound(_0x47ba3d,null))[_0x9d53('0x3e')](respondWithResult(_0x47ba3d,null))[_0x9d53('0x42')](handleError(_0x47ba3d,null));};exports[_0x9d53('0x48')]=function(_0x223ffa,_0x1d3b7e){return db[_0x9d53('0x3d')][_0x9d53('0x48')](_0x223ffa[_0x9d53('0x49')],{})[_0x9d53('0x3e')](respondWithResult(_0x1d3b7e,0xc9))[_0x9d53('0x42')](handleError(_0x1d3b7e,null));};exports[_0x9d53('0x25')]=function(_0x29cf44,_0x29e872){if(_0x29cf44[_0x9d53('0x49')]['id']){delete _0x29cf44[_0x9d53('0x49')]['id'];}return db['ChatInternalMessage'][_0x9d53('0x47')]({'where':{'id':_0x29cf44['params']['id']}})[_0x9d53('0x3e')](handleEntityNotFound(_0x29e872,null))[_0x9d53('0x3e')](saveUpdates(_0x29cf44[_0x9d53('0x49')],null))[_0x9d53('0x3e')](respondWithResult(_0x29e872,null))[_0x9d53('0x42')](handleError(_0x29e872,null));};exports[_0x9d53('0x26')]=function(_0x5a9e56,_0x2e394e){return db[_0x9d53('0x3d')]['find']({'where':{'id':_0x5a9e56[_0x9d53('0x44')]['id']}})[_0x9d53('0x3e')](handleEntityNotFound(_0x2e394e,null))[_0x9d53('0x3e')](removeEntity(_0x2e394e,null))[_0x9d53('0x42')](handleError(_0x2e394e,null));};exports['describe']=function(_0x38d945,_0xe34bc){return db['ChatInternalMessage'][_0x9d53('0x4a')]()[_0x9d53('0x3e')](respondWithResult(_0xe34bc,null))['catch'](handleError(_0xe34bc,null));};function wrapUser(_0x384e80){return function(_0x585e71){var _0x202200=_0x384e80[_0x9d53('0x4b')]({'plain':!![]});_0x202200[_0x9d53('0x4c')]=[];if(_0x585e71){_0x202200[_0x9d53('0x4d')]=_0x585e71[_0x9d53('0x4e')];_0x202200[_0x9d53('0x4f')]=_0x585e71;}else{_0x202200[_0x9d53('0x4d')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x202200['lastMessage']={};}return _0x202200;};}exports[_0x9d53('0x50')]=function(_0x58a0c4,_0x5072c9,_0x305083){var _0x330b61=[];return db[_0x9d53('0x51')]['findAll']({'where':{'role':[_0x9d53('0x52'),_0x9d53('0x53'),_0x9d53('0x54')]},'attributes':['id',_0x9d53('0x55'),_0x9d53('0x28'),_0x9d53('0x56'),_0x9d53('0x57'),_0x9d53('0x58'),'online','lastLoginAt',_0x9d53('0x59'),_0x9d53('0x5a')],'order':qs[_0x9d53('0x5b')](_0x9d53('0x5c')),'include':[{'model':db[_0x9d53('0x5d')],'as':_0x9d53('0x5e'),'attributes':['id',_0x9d53('0x28'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3e5bf5){if(_0x3e5bf5){var _0x42770c=_0x58a0c4['user']['get']({'plain':!![]});if(!_0x42770c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42770c[_0x9d53('0x56')]===_0x9d53('0x54')){return db[_0x9d53('0x5f')][_0x9d53('0x47')]({'where':{'name':_0x9d53('0x60'),'userProfileId':_0x42770c[_0x9d53('0x61')]},'raw':!![]})[_0x9d53('0x3e')](function(_0x17dee4){if(_0x17dee4){if(_0x17dee4[_0x9d53('0x62')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x17dee4['id']},'raw':!![]})[_0x9d53('0x3e')](function(_0x47876b){var _0x3515a2=[];if(_[_0x9d53('0x63')](_0x47876b)){_0x3515a2=_[_0x9d53('0x3a')](_0x3e5bf5,function(_0x508d6b){if(_0x508d6b['role']!==_0x9d53('0x52')){return _0x508d6b;}});return _0x3515a2;}else{for(var _0x5962e4=0x0;_0x5962e4<_0x3e5bf5[_0x9d53('0x35')];_0x5962e4++){var _0xdadac3=_0x3e5bf5[_0x5962e4];if(_0xdadac3[_0x9d53('0x56')]==='agent'){var _0x1de189=_[_0x9d53('0x47')](_0x47876b,function(_0x3aed55){return _0x3aed55[_0x9d53('0x64')]===_0xdadac3['id'];});if(_0x1de189)_0x3515a2[_0x9d53('0x65')](_0xdadac3);}else{_0x3515a2[_0x9d53('0x65')](_0xdadac3);}}return _0x3515a2;}});}else{return _0x3e5bf5;}}else{var _0x46c21a=_[_0x9d53('0x3a')](_0x3e5bf5,function(_0x2ee529){if(_0x2ee529[_0x9d53('0x56')]!==_0x9d53('0x52')){return _0x2ee529;}});return _0x46c21a;}});}else{return _0x3e5bf5;}}})[_0x9d53('0x3e')](function(_0x12e9d7){var _0x1540dd=[];if(_0x12e9d7){_0x330b61=_0x12e9d7;for(var _0x313e3a=0x0;_0x313e3a<_0x12e9d7['length'];_0x313e3a+=0x1){_0x330b61[_0x313e3a]['messages']=[];_0x1540dd[_0x9d53('0x65')](db[_0x9d53('0x3d')][_0x9d53('0x47')]({'where':{'FromId':[_0x58a0c4[_0x9d53('0x54')]['id'],_0x12e9d7[_0x313e3a]['id']],'ToId':[_0x58a0c4[_0x9d53('0x54')]['id'],_0x12e9d7[_0x313e3a]['id']],'ChatGroupId':null},'attributes':['id',_0x9d53('0x4e'),_0x9d53('0x66'),_0x9d53('0x67'),_0x9d53('0x68'),_0x9d53('0x49')],'order':qs[_0x9d53('0x5b')](_0x9d53('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9d53('0x3e')](wrapUser(_0x12e9d7[_0x313e3a])));}return BPromise[_0x9d53('0x6a')](_0x1540dd);}return[];})[_0x9d53('0x3e')](function(_0x163006){return{'rows':_0x163006,'count':_0x163006[_0x9d53('0x35')]};})['then'](respondWithResult(_0x5072c9,null))[_0x9d53('0x42')](handleError(_0x5072c9,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x105c=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x105c,0x87));var _0xc105=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x105c[_0x25efdf];return _0x22c495;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc105('0x0'))['db'][_0xc105('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc105('0x2')](0x0);var events={'afterCreate':_0xc105('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x36fbda){return function(_0x4855d9,_0x19e45d,_0x41a155){ChatInternalMessageEvents[_0xc105('0x4')](_0x36fbda+':'+_0x4855d9['id'],_0x4855d9);ChatInternalMessageEvents[_0xc105('0x4')](_0x36fbda,_0x4855d9);_0x41a155(null);};}for(var e in events){if(events[_0xc105('0x5')](e)){var event=events[e];ChatInternalMessage[_0xc105('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x53df=['exports','../../mysqldb','ChatInternalMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x229851,_0x1ed375){var _0x38e83a=function(_0x5cb66f){while(--_0x5cb66f){_0x229851['push'](_0x229851['shift']());}};_0x38e83a(++_0x1ed375);}(_0x53df,0xb1));var _0xf53d=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x53df[_0x256b72];return _0x2183e3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xf53d('0x0'))['db'][_0xf53d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf53d('0x2'),'afterDestroy':_0xf53d('0x3')};function emitEvent(_0xb39356){return function(_0x12da43,_0x1072fb,_0x3170dc){ChatInternalMessageEvents['emit'](_0xb39356+':'+_0x12da43['id'],_0x12da43);ChatInternalMessageEvents[_0xf53d('0x4')](_0xb39356,_0x12da43);_0x3170dc(null);};}for(var e in events){if(events[_0xf53d('0x5')](e)){var event=events[e];ChatInternalMessage[_0xf53d('0x6')](e,emitEvent(event));}}module[_0xf53d('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb029=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb029,0x6d));var _0x9b02=function(_0x59522b,_0x49e8e7){_0x59522b=_0x59522b-0x0;var _0x294b92=_0xb029[_0x59522b];return _0x294b92;};'use strict';var _=require(_0x9b02('0x0'));var util=require(_0x9b02('0x1'));var logger=require('../../config/logger')(_0x9b02('0x2'));var moment=require(_0x9b02('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b02('0x4'));var fs=require('fs');var path=require(_0x9b02('0x5'));var rimraf=require(_0x9b02('0x6'));var config=require(_0x9b02('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x2582d7,_0x1eb59a){return _0x2582d7[_0x9b02('0x8')](_0x9b02('0x9'),attributes,{'tableName':_0x9b02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b02('0xb'),'collate':_0x9b02('0xc')});};
\ No newline at end of file
+var _0xd599=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2d7bc4,_0x2ef6e6){var _0x4a40e1=function(_0x55d6e5){while(--_0x55d6e5){_0x2d7bc4['push'](_0x2d7bc4['shift']());}};_0x4a40e1(++_0x2ef6e6);}(_0xd599,0x1f4));var _0x9d59=function(_0xa81276,_0x4e9bdc){_0xa81276=_0xa81276-0x0;var _0x54b627=_0xd599[_0xa81276];return _0x54b627;};'use strict';var _=require(_0x9d59('0x0'));var util=require(_0x9d59('0x1'));var logger=require(_0x9d59('0x2'))(_0x9d59('0x3'));var moment=require(_0x9d59('0x4'));var BPromise=require(_0x9d59('0x5'));var rp=require(_0x9d59('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d59('0x7'));var config=require(_0x9d59('0x8'));var attributes=require(_0x9d59('0x9'));module['exports']=function(_0x455e2b,_0xca8bbe){return _0x455e2b[_0x9d59('0xa')](_0x9d59('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d59('0xc'),'collate':_0x9d59('0xd')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc5a=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xcc5a,0x16e));var _0xacc5=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0xcc5a[_0x5e238b];return _0x389bea;};'use strict';var _=require(_0xacc5('0x0'));var util=require('util');var moment=require(_0xacc5('0x1'));var BPromise=require(_0xacc5('0x2'));var rs=require(_0xacc5('0x3'));var fs=require('fs');var Redis=require(_0xacc5('0x4'));var db=require(_0xacc5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xacc5('0x6'))(_0xacc5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xacc5('0x8')]['http']({'port':0x232a});config[_0xacc5('0x9')]=_['defaults'](config[_0xacc5('0x9')],{'host':_0xacc5('0xa'),'port':0x18eb});var socket=require(_0xacc5('0xb'))(new Redis(config[_0xacc5('0x9')]));require(_0xacc5('0xc'))[_0xacc5('0xd')](socket);function respondWithRpcPromise(_0xf66a80,_0x2710d2,_0x416393){return new BPromise(function(_0x447e1b,_0x5cff39){return client[_0xacc5('0xe')](_0xf66a80,_0x416393)[_0xacc5('0xf')](function(_0x39bf8d){logger[_0xacc5('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x2710d2,_0xacc5('0x11'));logger[_0xacc5('0x12')](_0xacc5('0x13'),_0x2710d2,_0xacc5('0x11'),JSON['stringify'](_0x39bf8d));if(_0x39bf8d[_0xacc5('0x14')]){if(_0x39bf8d[_0xacc5('0x14')][_0xacc5('0x15')]===0x1f4){logger['error'](_0xacc5('0x16'),_0x2710d2,_0x39bf8d['error'][_0xacc5('0x17')]);return _0x5cff39(_0x39bf8d['error'][_0xacc5('0x17')]);}logger[_0xacc5('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x2710d2,_0x39bf8d[_0xacc5('0x14')]['message']);return _0x447e1b(_0x39bf8d[_0xacc5('0x14')][_0xacc5('0x17')]);}else{logger[_0xacc5('0x10')](_0xacc5('0x16'),_0x2710d2,_0xacc5('0x11'));_0x447e1b(_0x39bf8d[_0xacc5('0x18')][_0xacc5('0x17')]);}})[_0xacc5('0x19')](function(_0x2cb572){logger[_0xacc5('0x14')](_0xacc5('0x16'),_0x2710d2,_0x2cb572);_0x5cff39(_0x2cb572);});});}
\ No newline at end of file
+var _0xcbd2=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbd2,0xb9));var _0x2cbd=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xcbd2[_0x237546];return _0x233e29;};'use strict';var _=require(_0x2cbd('0x0'));var util=require(_0x2cbd('0x1'));var moment=require(_0x2cbd('0x2'));var BPromise=require(_0x2cbd('0x3'));var rs=require(_0x2cbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cbd('0x5'))['db'];var utils=require(_0x2cbd('0x6'));var logger=require(_0x2cbd('0x7'))(_0x2cbd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2cbd('0x9')][_0x2cbd('0xa')]({'port':0x232a});config[_0x2cbd('0xb')]=_[_0x2cbd('0xc')](config[_0x2cbd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2cbd('0xd'))(new Redis(config[_0x2cbd('0xb')]));require(_0x2cbd('0xe'))[_0x2cbd('0xf')](socket);function respondWithRpcPromise(_0x3e2e97,_0x2f41d6,_0x3d8b6c){return new BPromise(function(_0x263a34,_0x3b623d){return client[_0x2cbd('0x10')](_0x3e2e97,_0x3d8b6c)['then'](function(_0x43e49a){logger[_0x2cbd('0x11')](_0x2cbd('0x12'),_0x2f41d6,_0x2cbd('0x13'));logger['debug'](_0x2cbd('0x14'),_0x2f41d6,_0x2cbd('0x13'),JSON[_0x2cbd('0x15')](_0x43e49a));if(_0x43e49a[_0x2cbd('0x16')]){if(_0x43e49a[_0x2cbd('0x16')][_0x2cbd('0x17')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x2f41d6,_0x43e49a['error']['message']);return _0x3b623d(_0x43e49a[_0x2cbd('0x16')][_0x2cbd('0x18')]);}logger[_0x2cbd('0x16')](_0x2cbd('0x12'),_0x2f41d6,_0x43e49a['error'][_0x2cbd('0x18')]);return _0x263a34(_0x43e49a['error'][_0x2cbd('0x18')]);}else{logger[_0x2cbd('0x11')](_0x2cbd('0x12'),_0x2f41d6,_0x2cbd('0x13'));_0x263a34(_0x43e49a['result'][_0x2cbd('0x18')]);}})[_0x2cbd('0x19')](function(_0x1d602a){logger[_0x2cbd('0x16')](_0x2cbd('0x12'),_0x2f41d6,_0x1d602a);_0x3b623d(_0x1d602a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe85b=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x842c6b,_0x50959e){var _0x31ede1=function(_0x423d6a){while(--_0x423d6a){_0x842c6b['push'](_0x842c6b['shift']());}};_0x31ede1(++_0x50959e);}(_0xe85b,0x184));var _0xbe85=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0xe85b[_0x107f10];return _0x811cab;};'use strict';var ChatInternalMessageEvents=require(_0xbe85('0x0'));var events=['save',_0xbe85('0x1'),_0xbe85('0x2')];function createListener(_0x380c1a,_0x1343d4){return function(_0x3c74b6){_0x1343d4[_0xbe85('0x3')](_0x380c1a,_0x3c74b6);};}function removeListener(_0x49025d,_0x52fade){return function(){ChatInternalMessageEvents[_0xbe85('0x4')](_0x49025d,_0x52fade);};}exports[_0xbe85('0x5')]=function(_0x30e497){for(var _0x453865=0x0,_0x4659d2=events[_0xbe85('0x6')];_0x453865<_0x4659d2;_0x453865++){var _0x1ea854=events[_0x453865];var _0x2d0153=createListener(_0xbe85('0x7')+_0x1ea854,_0x30e497);ChatInternalMessageEvents['on'](_0x1ea854,_0x2d0153);}};
\ No newline at end of file
+var _0x1471=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0xc1cf7,_0x425f32){var _0x3c39f5=function(_0x3d9d00){while(--_0x3d9d00){_0xc1cf7['push'](_0xc1cf7['shift']());}};_0x3c39f5(++_0x425f32);}(_0x1471,0xd8));var _0x1147=function(_0x2ee935,_0x1f2d9f){_0x2ee935=_0x2ee935-0x0;var _0x4cecbc=_0x1471[_0x2ee935];return _0x4cecbc;};'use strict';var ChatInternalMessageEvents=require(_0x1147('0x0'));var events=['save',_0x1147('0x1'),_0x1147('0x2')];function createListener(_0x5a7dbe,_0x40a31d){return function(_0x2d1140){_0x40a31d[_0x1147('0x3')](_0x5a7dbe,_0x2d1140);};}function removeListener(_0x43cf28,_0x2d6a4b){return function(){ChatInternalMessageEvents[_0x1147('0x4')](_0x43cf28,_0x2d6a4b);};}exports[_0x1147('0x5')]=function(_0x4f80cf){for(var _0x4083b8=0x0,_0x2ee6bc=events[_0x1147('0x6')];_0x4083b8<_0x2ee6bc;_0x4083b8++){var _0x298883=events[_0x4083b8];var _0x5c6381=createListener(_0x1147('0x7')+_0x298883,_0x4f80cf);ChatInternalMessageEvents['on'](_0x298883,_0x5c6381);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc140=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','getUsers','/:id','post','put','update','delete','destroy'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xc140,0xa1));var _0x0c14=function(_0x33ceeb,_0x58b863){_0x33ceeb=_0x33ceeb-0x0;var _0x5b6556=_0xc140[_0x33ceeb];return _0x5b6556;};'use strict';var multer=require(_0x0c14('0x0'));var util=require(_0x0c14('0x1'));var path=require(_0x0c14('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0c14('0x4'));var interaction=require(_0x0c14('0x5'));var config=require(_0x0c14('0x6'));var controller=require(_0x0c14('0x7'));router['get']('/',auth[_0x0c14('0x8')](),controller[_0x0c14('0x9')]);router[_0x0c14('0xa')](_0x0c14('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0c14('0xa')]('/users',auth['isAuthenticated'](),controller[_0x0c14('0xc')]);router[_0x0c14('0xa')](_0x0c14('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0c14('0xe')]('/',auth[_0x0c14('0x8')](),controller['create']);router[_0x0c14('0xf')](_0x0c14('0xd'),controller[_0x0c14('0x10')]);router[_0x0c14('0x11')](_0x0c14('0xd'),auth[_0x0c14('0x8')](),controller[_0x0c14('0x12')]);module[_0x0c14('0x13')]=router;
\ No newline at end of file
+var _0x56c8=['/:id','show','post','create','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','getUsers'];(function(_0x2e466d,_0x28d5f2){var _0x356e6d=function(_0x31db3d){while(--_0x31db3d){_0x2e466d['push'](_0x2e466d['shift']());}};_0x356e6d(++_0x28d5f2);}(_0x56c8,0x196));var _0x856c=function(_0x304aac,_0x17c2d7){_0x304aac=_0x304aac-0x0;var _0x2954a3=_0x56c8[_0x304aac];return _0x2954a3;};'use strict';var multer=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var path=require(_0x856c('0x2'));var timeout=require(_0x856c('0x3'));var express=require(_0x856c('0x4'));var router=express['Router']();var fs_extra=require(_0x856c('0x5'));var auth=require(_0x856c('0x6'));var interaction=require(_0x856c('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x856c('0x8')](),controller[_0x856c('0x9')]);router[_0x856c('0xa')](_0x856c('0xb'),auth[_0x856c('0x8')](),controller[_0x856c('0xc')]);router[_0x856c('0xa')]('/users',auth[_0x856c('0x8')](),controller[_0x856c('0xd')]);router['get'](_0x856c('0xe'),auth[_0x856c('0x8')](),controller[_0x856c('0xf')]);router[_0x856c('0x10')]('/',auth[_0x856c('0x8')](),controller[_0x856c('0x11')]);router['put'](_0x856c('0xe'),controller[_0x856c('0x12')]);router['delete'](_0x856c('0xe'),auth['isAuthenticated'](),controller[_0x856c('0x13')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x196efd,_0x1fb243){var _0x1b35d6=function(_0x2f95ff){while(--_0x2f95ff){_0x196efd['push'](_0x196efd['shift']());}};_0x1b35d6(++_0x1fb243);}(_0xfd6f,0x19d));var _0xffd6=function(_0x53a168,_0x1ab0ef){_0x53a168=_0x53a168-0x0;var _0x45c22b=_0xfd6f[_0x53a168];return _0x45c22b;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}};
\ No newline at end of file
+var _0xd5fc=['sequelize','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd5fc,0xae));var _0xcd5f=function(_0xc45d5d,_0x332847){_0xc45d5d=_0xc45d5d-0x0;var _0x5dc274=_0xd5fc[_0xc45d5d];return _0x5dc274;};'use strict';var Sequelize=require(_0xcd5f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcd5f('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcd5f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd5f('0x2')]('in',_0xcd5f('0x3')),'defaultValue':_0xcd5f('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xcd5f('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xcd5f('0x5')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc278=['query','keys','model','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','create','body','destroy','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','read1stAt','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','rejectmessage','parse','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','offset','undefined','count','status','Content-Range','json','apply','reject','save','update','end','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key'];(function(_0x2a67d5,_0x1fac5b){var _0x55548c=function(_0x49f76c){while(--_0x49f76c){_0x2a67d5['push'](_0x2a67d5['shift']());}};_0x55548c(++_0x1fac5b);}(_0xc278,0x1d6));var _0x8c27=function(_0x415ef9,_0x1a1c9f){_0x415ef9=_0x415ef9-0x0;var _0x41aea6=_0xc278[_0x415ef9];return _0x41aea6;};'use strict';var emlformat=require(_0x8c27('0x0'));var rimraf=require(_0x8c27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c27('0x2'));var moment=require(_0x8c27('0x3'));var BPromise=require(_0x8c27('0x4'));var Mustache=require(_0x8c27('0x5'));var util=require(_0x8c27('0x6'));var path=require('path');var sox=require(_0x8c27('0x7'));var csv=require(_0x8c27('0x8'));var ejs=require(_0x8c27('0x9'));var fs=require('fs');var fs_extra=require(_0x8c27('0xa'));var _=require(_0x8c27('0xb'));var squel=require('squel');var crypto=require(_0x8c27('0xc'));var jsforce=require(_0x8c27('0xd'));var deskjs=require(_0x8c27('0xe'));var toCsv=require(_0x8c27('0x8'));var querystring=require(_0x8c27('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c27('0x10'));var qs=require(_0x8c27('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c27('0x12'));var logger=require(_0x8c27('0x13'))('api');var utils=require(_0x8c27('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8c27('0x15'))['db'];config[_0x8c27('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c27('0x17'))(new Redis(config[_0x8c27('0x16')]));require(_0x8c27('0x18'))[_0x8c27('0x19')](socket);var jayson=require(_0x8c27('0x1a'));var client=jayson[_0x8c27('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x8c27('0x1b')][_0x8c27('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xfc7f10,_0x5e4f37,_0x16d8b4,_0x5c979f){return new BPromise(function(_0x3f7755,_0x11be5a){var _0x5ab3e8=_0x5c979f||client;return _0x5ab3e8[_0x8c27('0x1d')](_0xfc7f10,_0x16d8b4)[_0x8c27('0x1e')](function(_0x2389de){logger['info'](_0x8c27('0x1f'),_0x5e4f37,_0x8c27('0x20'));logger['debug'](_0x8c27('0x21'),_0x5e4f37,'request\x20sent',JSON[_0x8c27('0x22')](_0x2389de));if(_0x2389de[_0x8c27('0x23')]){if(_0x2389de[_0x8c27('0x23')][_0x8c27('0x24')]===0x1f4){logger[_0x8c27('0x23')](_0x8c27('0x1f'),_0x5e4f37,_0x2389de[_0x8c27('0x23')][_0x8c27('0x25')]);return _0x11be5a(_0x2389de['error'][_0x8c27('0x25')]);}logger[_0x8c27('0x23')](_0x8c27('0x1f'),_0x5e4f37,_0x2389de['error'][_0x8c27('0x25')]);return _0x3f7755(_0x2389de['error']['message']);}else{logger['info'](_0x8c27('0x1f'),_0x5e4f37,_0x8c27('0x20'));_0x3f7755(_0x2389de[_0x8c27('0x26')][_0x8c27('0x25')]);}})[_0x8c27('0x27')](function(_0x563fc2){logger[_0x8c27('0x23')](_0x8c27('0x1f'),_0x5e4f37,_0x563fc2);_0x11be5a(_0x563fc2);});});}function respondWithStatusCode(_0x332097,_0xf4433e){_0xf4433e=_0xf4433e||0xcc;return function(_0x427f85){if(_0x427f85){return _0x332097['sendStatus'](_0xf4433e);}return _0x332097['status'](_0xf4433e)['end']();};}function respondWithResult(_0x468ecc,_0x55760b){_0x55760b=_0x55760b||0xc8;return function(_0x4a11c8){if(_0x4a11c8){return _0x468ecc['status'](_0x55760b)['json'](_0x4a11c8);}};}function respondWithFilteredResult(_0x4fc1fd,_0x352a07){return function(_0x4ecba7){if(_0x4ecba7){var _0x248fbb=typeof _0x352a07[_0x8c27('0x28')]===_0x8c27('0x29')&&typeof _0x352a07['limit']===_0x8c27('0x29');var _0x9a8b4f=_0x4ecba7[_0x8c27('0x2a')];var _0x45ab72=_0x248fbb?0x0:_0x352a07[_0x8c27('0x28')];var _0x5b2427=_0x248fbb?_0x4ecba7[_0x8c27('0x2a')]:_0x352a07[_0x8c27('0x28')]+_0x352a07['limit'];var _0x2fea4d;if(_0x5b2427>=_0x9a8b4f){_0x5b2427=_0x9a8b4f;_0x2fea4d=0xc8;}else{_0x2fea4d=0xce;}_0x4fc1fd[_0x8c27('0x2b')](_0x2fea4d);return _0x4fc1fd['set'](_0x8c27('0x2c'),_0x45ab72+'-'+_0x5b2427+'/'+_0x9a8b4f)[_0x8c27('0x2d')](_0x4ecba7);}return null;};}function patchUpdates(_0x51be9){return function(_0x5cae7f){try{jsonpatch[_0x8c27('0x2e')](_0x5cae7f,_0x51be9,!![]);}catch(_0x19549a){return BPromise[_0x8c27('0x2f')](_0x19549a);}return _0x5cae7f[_0x8c27('0x30')]();};}function saveUpdates(_0x3c43c4,_0x3bcfb8){return function(_0x50a778){if(_0x50a778){return _0x50a778[_0x8c27('0x31')](_0x3c43c4)[_0x8c27('0x1e')](function(_0x95f2f6){return _0x95f2f6;});}return null;};}function removeEntity(_0x2f9128,_0x2de948){return function(_0x5b6f19){if(_0x5b6f19){return _0x5b6f19['destroy']()['then'](function(){_0x2f9128[_0x8c27('0x2b')](0xcc)[_0x8c27('0x32')]();});}};}function handleEntityNotFound(_0x5604a9,_0x394612){return function(_0x3306a6){if(!_0x3306a6){_0x5604a9[_0x8c27('0x33')](0x194);}return _0x3306a6;};}function handleError(_0x3b1247,_0x4ec6c5){_0x4ec6c5=_0x4ec6c5||0x1f4;return function(_0x4d6767){logger[_0x8c27('0x23')](_0x4d6767[_0x8c27('0x34')]);if(_0x4d6767[_0x8c27('0x35')]){delete _0x4d6767['name'];}_0x3b1247[_0x8c27('0x2b')](_0x4ec6c5)[_0x8c27('0x36')](_0x4d6767);};}exports[_0x8c27('0x37')]=function(_0xcf4551,_0x41c2e5){var _0x541a85={},_0xd7f3b9={},_0x19c6e2={'count':0x0,'rows':[]};var _0x566a0e=_[_0x8c27('0x38')](db[_0x8c27('0x39')][_0x8c27('0x3a')],function(_0x1ece2f){return{'name':_0x1ece2f[_0x8c27('0x3b')],'type':_0x1ece2f[_0x8c27('0x3c')][_0x8c27('0x3d')]};});_0xd7f3b9['model']=_[_0x8c27('0x38')](_0x566a0e,_0x8c27('0x35'));_0xd7f3b9[_0x8c27('0x3e')]=_[_0x8c27('0x3f')](_0xcf4551[_0x8c27('0x3e')]);_0xd7f3b9['filters']=_['intersection'](_0xd7f3b9[_0x8c27('0x40')],_0xd7f3b9[_0x8c27('0x3e')]);_0x541a85[_0x8c27('0x41')]=_['intersection'](_0xd7f3b9[_0x8c27('0x40')],qs[_0x8c27('0x42')](_0xcf4551[_0x8c27('0x3e')][_0x8c27('0x42')]));_0x541a85[_0x8c27('0x41')]=_0x541a85[_0x8c27('0x41')][_0x8c27('0x43')]?_0x541a85[_0x8c27('0x41')]:_0xd7f3b9[_0x8c27('0x40')];if(!_0xcf4551[_0x8c27('0x3e')]['hasOwnProperty']('nolimit')){_0x541a85[_0x8c27('0x44')]=qs[_0x8c27('0x44')](_0xcf4551[_0x8c27('0x3e')]['limit']);_0x541a85[_0x8c27('0x28')]=qs[_0x8c27('0x28')](_0xcf4551['query'][_0x8c27('0x28')]);}_0x541a85[_0x8c27('0x45')]=qs[_0x8c27('0x46')](_0xcf4551[_0x8c27('0x3e')]['sort']);_0x541a85[_0x8c27('0x47')]=qs[_0x8c27('0x48')](_[_0x8c27('0x49')](_0xcf4551['query'],_0xd7f3b9['filters']),_0x566a0e);if(_0xcf4551['query'][_0x8c27('0x4a')]){_0x541a85['where']=_[_0x8c27('0x4b')](_0x541a85['where'],{'$or':_['map'](_0x566a0e,function(_0x2ce525){if(_0x2ce525[_0x8c27('0x3c')]!==_0x8c27('0x4c')){var _0x423a35={};_0x423a35[_0x2ce525['name']]={'$like':'%'+_0xcf4551['query'][_0x8c27('0x4a')]+'%'};return _0x423a35;}})});}_0x541a85=_['merge']({},_0x541a85,_0xcf4551[_0x8c27('0x4d')]);var _0x2a7c92={'where':_0x541a85[_0x8c27('0x47')]};return db[_0x8c27('0x39')][_0x8c27('0x2a')](_0x2a7c92)[_0x8c27('0x1e')](function(_0x58b901){_0x19c6e2[_0x8c27('0x2a')]=_0x58b901;if(_0xcf4551[_0x8c27('0x3e')][_0x8c27('0x4e')]){_0x541a85[_0x8c27('0x4f')]=[{'all':!![]}];}return db[_0x8c27('0x39')]['findAll'](_0x541a85);})[_0x8c27('0x1e')](function(_0x56e0fd){_0x19c6e2[_0x8c27('0x50')]=_0x56e0fd;return _0x19c6e2;})[_0x8c27('0x1e')](respondWithFilteredResult(_0x41c2e5,_0x541a85))['catch'](handleError(_0x41c2e5,null));};exports[_0x8c27('0x51')]=function(_0x21e31f,_0x4c3378){var _0xcdd607={'raw':!![],'where':{'id':_0x21e31f[_0x8c27('0x52')]['id']}},_0x13e87f={};_0x13e87f[_0x8c27('0x40')]=_[_0x8c27('0x3f')](db['ChatMessage'][_0x8c27('0x3a')]);_0x13e87f['query']=_[_0x8c27('0x3f')](_0x21e31f[_0x8c27('0x3e')]);_0x13e87f[_0x8c27('0x48')]=_[_0x8c27('0x53')](_0x13e87f[_0x8c27('0x40')],_0x13e87f[_0x8c27('0x3e')]);_0xcdd607[_0x8c27('0x41')]=_['intersection'](_0x13e87f[_0x8c27('0x40')],qs[_0x8c27('0x42')](_0x21e31f[_0x8c27('0x3e')]['fields']));_0xcdd607[_0x8c27('0x41')]=_0xcdd607[_0x8c27('0x41')][_0x8c27('0x43')]?_0xcdd607[_0x8c27('0x41')]:_0x13e87f[_0x8c27('0x40')];if(_0x21e31f[_0x8c27('0x3e')][_0x8c27('0x4e')]){_0xcdd607[_0x8c27('0x4f')]=[{'all':!![]}];}_0xcdd607=_[_0x8c27('0x4b')]({},_0xcdd607,_0x21e31f[_0x8c27('0x4d')]);return db[_0x8c27('0x39')][_0x8c27('0x54')](_0xcdd607)[_0x8c27('0x1e')](handleEntityNotFound(_0x4c3378,null))[_0x8c27('0x1e')](respondWithResult(_0x4c3378,null))['catch'](handleError(_0x4c3378,null));};exports['create']=function(_0x46aa39,_0xadb9f0){return db[_0x8c27('0x39')][_0x8c27('0x55')](_0x46aa39[_0x8c27('0x56')],{})[_0x8c27('0x1e')](respondWithResult(_0xadb9f0,0xc9))[_0x8c27('0x27')](handleError(_0xadb9f0,null));};exports[_0x8c27('0x31')]=function(_0x424f0a,_0x2ebc92){if(_0x424f0a[_0x8c27('0x56')]['id']){delete _0x424f0a[_0x8c27('0x56')]['id'];}return db[_0x8c27('0x39')][_0x8c27('0x54')]({'where':{'id':_0x424f0a[_0x8c27('0x52')]['id']}})[_0x8c27('0x1e')](handleEntityNotFound(_0x2ebc92,null))[_0x8c27('0x1e')](saveUpdates(_0x424f0a[_0x8c27('0x56')],null))['then'](respondWithResult(_0x2ebc92,null))[_0x8c27('0x27')](handleError(_0x2ebc92,null));};exports[_0x8c27('0x57')]=function(_0x594e21,_0x408345){return db['ChatMessage'][_0x8c27('0x54')]({'where':{'id':_0x594e21['params']['id']}})[_0x8c27('0x1e')](handleEntityNotFound(_0x408345,null))[_0x8c27('0x1e')](removeEntity(_0x408345,null))[_0x8c27('0x27')](handleError(_0x408345,null));};exports[_0x8c27('0x58')]=function(_0x187dac,_0x10aa21){return db[_0x8c27('0x39')][_0x8c27('0x58')]()[_0x8c27('0x1e')](respondWithResult(_0x10aa21,null))['catch'](handleError(_0x10aa21,null));};var interaction_log=require(_0x8c27('0x13'))(_0x8c27('0x59'));exports[_0x8c27('0x5a')]=function(_0x5a57d2,_0x3b5735,_0x339a70){var _0x59dd95={'agent':{},'channel':_0x8c27('0x5b')};if(_0x5a57d2['body']['id']){delete _0x5a57d2['body']['id'];}_0x5a57d2['body']['read']=!![];_0x5a57d2['body'][_0x8c27('0x5c')]=moment()[_0x8c27('0x5d')](_0x8c27('0x5e'));_0x5a57d2[_0x8c27('0x56')]['UserId']=_0x5a57d2['body'][_0x8c27('0x5f')]||_0x5a57d2['user']['id'];_0x59dd95['agent']['id']=_0x5a57d2['body'][_0x8c27('0x5f')];return db['ChatMessage'][_0x8c27('0x54')]({'where':{'id':_0x5a57d2[_0x8c27('0x52')]['id'],'UserId':null}})[_0x8c27('0x1e')](handleEntityNotFound(_0x3b5735,null))[_0x8c27('0x1e')](saveUpdates(_0x5a57d2[_0x8c27('0x56')],null))['then'](function(_0x45c767){if(_0x45c767){_0x59dd95[_0x8c27('0x25')]=_0x45c767[_0x8c27('0x60')]({'plain':!![]});return db[_0x8c27('0x61')][_0x8c27('0x54')]({'where':{'id':_0x45c767['ChatInteractionId']}});}return null;})[_0x8c27('0x1e')](handleEntityNotFound(_0x3b5735,null))[_0x8c27('0x1e')](function(_0x254073){if(_0x254073){return _0x254073[_0x8c27('0x31')]({'UserId':_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x5f')],'read1stAt':_[_0x8c27('0x62')](_0x254073[_0x8c27('0x63')])?moment()['format'](_0x8c27('0x5e')):undefined});}return null;})[_0x8c27('0x1e')](function(_0x365bd1){if(_0x365bd1){_0x59dd95['interaction']=_0x365bd1[_0x8c27('0x60')]({'plain':!![]});interaction_log[_0x8c27('0x64')](_0x8c27('0x65'),_0x5a57d2['user']['id'],_0x5a57d2['user'][_0x8c27('0x35')],_0x5a57d2[_0x8c27('0x66')]['role'],_0x59dd95[_0x8c27('0x67')]['id'],_0x5a57d2[_0x8c27('0x56')]?JSON[_0x8c27('0x22')](_0x5a57d2[_0x8c27('0x56')]):'null');return respondWithRpcPromise(_0x8c27('0x68'),_0x8c27('0x69'),_0x59dd95);}return null;})[_0x8c27('0x1e')](function(_0x18428f){var _0x3f1149='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x18428f['message'][_0x8c27('0x6a')];return db[_0x8c27('0x6b')][_0x8c27('0x3e')](_0x3f1149,{'type':db[_0x8c27('0x6c')][_0x8c27('0x6d')][_0x8c27('0x6e')],'raw':!![]})[_0x8c27('0x1e')](function(_0x519b91){return _0x519b91;});})[_0x8c27('0x1e')](function(_0x559b18){if(_0x559b18){_0x59dd95[_0x8c27('0x25')][_0x8c27('0x6f')]=_0x559b18[0x0];if(!_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x5f')])return;return db[_0x8c27('0x70')]['find']({'where':{'id':_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x5f')],'role':_0x8c27('0x71')},'attributes':['id','name',_0x8c27('0x72'),_0x8c27('0x73'),_0x8c27('0x74')],'raw':!![]});}return null;})['then'](function(_0x14bff6){if(!_0x14bff6)return null;_0x59dd95[_0x8c27('0x25')][_0x8c27('0x71')]=_0x14bff6;return _0x59dd95;})[_0x8c27('0x1e')](function(_0x43e34d){if(_0x43e34d){if(_0x5a57d2[_0x8c27('0x56')][_0x8c27('0x75')]){_0x59dd95[_0x8c27('0x25')][_0x8c27('0x76')]=util[_0x8c27('0x5d')](_0x8c27('0x77'),_0x5a57d2[_0x8c27('0x66')][_0x8c27('0x35')]);_0x59dd95[_0x8c27('0x25')]['channel']=_0x59dd95[_0x8c27('0x78')];_0x59dd95[_0x8c27('0x25')][_0x8c27('0x79')]=_0x59dd95[_0x8c27('0x78')];_0x59dd95[_0x8c27('0x25')]['event']=_0x8c27('0x5a');return respondWithRpcPromise(_0x8c27('0x7a'),'EventManager',{'event':_0x8c27('0x7b'),'message':_[_0x8c27('0x4b')](_0x59dd95[_0x8c27('0x25')],JSON['parse'](_0x59dd95[_0x8c27('0x67')][_0x8c27('0x7c')]))},client9002)[_0x8c27('0x1e')](function(){return _0x59dd95;});}return _0x59dd95;}return null;})[_0x8c27('0x1e')](respondWithResult(_0x3b5735,null))['catch'](handleError(_0x3b5735,null));};var interaction_log=require(_0x8c27('0x13'))(_0x8c27('0x59'));exports['reject']=function(_0x43fc5d,_0x33243f,_0x33096a){var _0x5f55c9={'agent':{},'channel':_0x8c27('0x5b')};if(_0x43fc5d[_0x8c27('0x56')]['id']){delete _0x43fc5d[_0x8c27('0x56')]['id'];}_0x43fc5d['body']['UserId']=_0x43fc5d['body'][_0x8c27('0x5f')]||_0x43fc5d[_0x8c27('0x66')]['id'];_0x5f55c9[_0x8c27('0x71')]['id']=_0x43fc5d['body'][_0x8c27('0x5f')];return db['ChatMessage'][_0x8c27('0x54')]({'where':{'id':_0x43fc5d[_0x8c27('0x52')]['id'],'UserId':null}})[_0x8c27('0x1e')](handleEntityNotFound(_0x33243f,null))[_0x8c27('0x1e')](function(_0x326e17){if(_0x326e17){_0x5f55c9[_0x8c27('0x25')]=_0x326e17[_0x8c27('0x60')]({'plain':!![]});return db[_0x8c27('0x61')][_0x8c27('0x54')]({'where':{'id':_0x326e17['ChatInteractionId']}});}return null;})[_0x8c27('0x1e')](handleEntityNotFound(_0x33243f,null))['then'](function(_0x4ee883){if(_0x4ee883){_0x5f55c9['interaction']=_0x4ee883['get']({'plain':!![]});interaction_log[_0x8c27('0x64')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43fc5d[_0x8c27('0x66')]['id'],_0x43fc5d[_0x8c27('0x66')][_0x8c27('0x35')],_0x43fc5d['user'][_0x8c27('0x7d')],_0x5f55c9[_0x8c27('0x67')]['id'],_0x43fc5d[_0x8c27('0x56')]?JSON['stringify'](_0x43fc5d[_0x8c27('0x56')]):_0x8c27('0x7e'));return respondWithRpcPromise(_0x8c27('0x7f'),_0x8c27('0x80'),_0x5f55c9);}return null;})[_0x8c27('0x1e')](function(_0x304ddd){var _0x361285=_0x8c27('0x81')+_0x304ddd[_0x8c27('0x25')]['ContactId'];return db[_0x8c27('0x6b')]['query'](_0x361285,{'type':db[_0x8c27('0x6c')][_0x8c27('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x4c6d59){return _0x4c6d59;});})[_0x8c27('0x1e')](function(_0xe7b4e7){if(_0xe7b4e7){_0x5f55c9['message']['contact']=_0xe7b4e7[0x0];if(!_0x43fc5d[_0x8c27('0x56')]['UserId'])return;return db[_0x8c27('0x70')][_0x8c27('0x54')]({'where':{'id':_0x43fc5d[_0x8c27('0x56')][_0x8c27('0x5f')],'role':_0x8c27('0x71')},'attributes':['id',_0x8c27('0x35'),_0x8c27('0x72'),_0x8c27('0x73'),'internal'],'raw':!![]});}return null;})[_0x8c27('0x1e')](function(_0x46cbc5){if(!_0x46cbc5)return null;_0x5f55c9['message'][_0x8c27('0x71')]=_0x46cbc5;return _0x5f55c9;})['then'](function(_0x133c02){if(_0x133c02){_0x133c02['message']['interface']=util[_0x8c27('0x5d')](_0x8c27('0x77'),_0x43fc5d[_0x8c27('0x66')][_0x8c27('0x35')]);_0x133c02['message'][_0x8c27('0x78')]=_0x5f55c9[_0x8c27('0x78')];_0x133c02[_0x8c27('0x25')][_0x8c27('0x79')]=_0x5f55c9[_0x8c27('0x78')];_0x133c02[_0x8c27('0x25')][_0x8c27('0x82')]=_0x8c27('0x2f');respondWithRpcPromise('EventManager','EventManager',{'event':_0x8c27('0x83'),'message':_[_0x8c27('0x4b')](_0x5f55c9[_0x8c27('0x25')],JSON[_0x8c27('0x84')](_0x5f55c9[_0x8c27('0x67')][_0x8c27('0x7c')]))},client9002);return _0x5f55c9;}return null;})['then'](respondWithResult(_0x33243f,null))[_0x8c27('0x27')](handleError(_0x33243f,null));};
\ No newline at end of file
+var _0x08b7=['apply','reject','save','destroy','stack','name','map','ChatMessage','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','params','keys','find','create','body','describe','chat-interactions','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','update','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','internal','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','email','interface','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','then','info','request\x20sent','debug','stringify','code','error','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x08b7,0xce));var _0x708b=function(_0x27a3ff,_0x1525d4){_0x27a3ff=_0x27a3ff-0x0;var _0xdeae4b=_0x08b7[_0x27a3ff];return _0xdeae4b;};'use strict';var emlformat=require(_0x708b('0x0'));var rimraf=require(_0x708b('0x1'));var zipdir=require(_0x708b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x708b('0x3'));var moment=require('moment');var BPromise=require(_0x708b('0x4'));var Mustache=require(_0x708b('0x5'));var util=require('util');var path=require(_0x708b('0x6'));var sox=require('sox');var csv=require(_0x708b('0x7'));var ejs=require(_0x708b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x708b('0x9'));var squel=require(_0x708b('0xa'));var crypto=require(_0x708b('0xb'));var jsforce=require(_0x708b('0xc'));var deskjs=require(_0x708b('0xd'));var toCsv=require(_0x708b('0x7'));var querystring=require(_0x708b('0xe'));var Papa=require(_0x708b('0xf'));var Redis=require(_0x708b('0x10'));var authService=require(_0x708b('0x11'));var qs=require(_0x708b('0x12'));var as=require(_0x708b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x708b('0x14'))(_0x708b('0x15'));var utils=require(_0x708b('0x16'));var config=require(_0x708b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x708b('0x18'))['db'];config[_0x708b('0x19')]=_[_0x708b('0x1a')](config[_0x708b('0x19')],{'host':_0x708b('0x1b'),'port':0x18eb});var socket=require(_0x708b('0x1c'))(new Redis(config[_0x708b('0x19')]));require(_0x708b('0x1d'))['register'](socket);var jayson=require(_0x708b('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf7fd64,_0x3cdbb2,_0x519231,_0x1e6ddc){return new BPromise(function(_0x114633,_0x44e21e){var _0x381348=_0x1e6ddc||client;return _0x381348['request'](_0xf7fd64,_0x519231)[_0x708b('0x1f')](function(_0x4e2838){logger[_0x708b('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3cdbb2,_0x708b('0x21'));logger[_0x708b('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3cdbb2,_0x708b('0x21'),JSON[_0x708b('0x23')](_0x4e2838));if(_0x4e2838['error']){if(_0x4e2838['error'][_0x708b('0x24')]===0x1f4){logger[_0x708b('0x25')]('ChatMessage,\x20%s,\x20%s',_0x3cdbb2,_0x4e2838[_0x708b('0x25')][_0x708b('0x26')]);return _0x44e21e(_0x4e2838[_0x708b('0x25')][_0x708b('0x26')]);}logger[_0x708b('0x25')](_0x708b('0x27'),_0x3cdbb2,_0x4e2838[_0x708b('0x25')][_0x708b('0x26')]);return _0x114633(_0x4e2838['error'][_0x708b('0x26')]);}else{logger[_0x708b('0x20')](_0x708b('0x27'),_0x3cdbb2,_0x708b('0x21'));_0x114633(_0x4e2838[_0x708b('0x28')][_0x708b('0x26')]);}})[_0x708b('0x29')](function(_0x30ad9c){logger[_0x708b('0x25')](_0x708b('0x27'),_0x3cdbb2,_0x30ad9c);_0x44e21e(_0x30ad9c);});});}function respondWithStatusCode(_0x458fe2,_0x368847){_0x368847=_0x368847||0xcc;return function(_0x1e8357){if(_0x1e8357){return _0x458fe2[_0x708b('0x2a')](_0x368847);}return _0x458fe2['status'](_0x368847)[_0x708b('0x2b')]();};}function respondWithResult(_0x5eda15,_0x179606){_0x179606=_0x179606||0xc8;return function(_0x43527d){if(_0x43527d){return _0x5eda15['status'](_0x179606)[_0x708b('0x2c')](_0x43527d);}};}function respondWithFilteredResult(_0x27cd2c,_0x7dfbc5){return function(_0x499eb5){if(_0x499eb5){var _0x1e24fb=typeof _0x7dfbc5[_0x708b('0x2d')]===_0x708b('0x2e')&&typeof _0x7dfbc5[_0x708b('0x2f')]===_0x708b('0x2e');var _0x306595=_0x499eb5[_0x708b('0x30')];var _0x11d542=_0x1e24fb?0x0:_0x7dfbc5[_0x708b('0x2d')];var _0xbe989e=_0x1e24fb?_0x499eb5['count']:_0x7dfbc5[_0x708b('0x2d')]+_0x7dfbc5[_0x708b('0x2f')];var _0xc58ec1;if(_0xbe989e>=_0x306595){_0xbe989e=_0x306595;_0xc58ec1=0xc8;}else{_0xc58ec1=0xce;}_0x27cd2c[_0x708b('0x31')](_0xc58ec1);return _0x27cd2c[_0x708b('0x32')](_0x708b('0x33'),_0x11d542+'-'+_0xbe989e+'/'+_0x306595)['json'](_0x499eb5);}return null;};}function patchUpdates(_0x413c35){return function(_0x3efee2){try{jsonpatch[_0x708b('0x34')](_0x3efee2,_0x413c35,!![]);}catch(_0x1a271c){return BPromise[_0x708b('0x35')](_0x1a271c);}return _0x3efee2[_0x708b('0x36')]();};}function saveUpdates(_0x6b07e1,_0x3367f9){return function(_0x4b34f7){if(_0x4b34f7){return _0x4b34f7['update'](_0x6b07e1)[_0x708b('0x1f')](function(_0x25cfef){return _0x25cfef;});}return null;};}function removeEntity(_0x612f05,_0x3b1096){return function(_0x5b594f){if(_0x5b594f){return _0x5b594f[_0x708b('0x37')]()['then'](function(){_0x612f05[_0x708b('0x31')](0xcc)[_0x708b('0x2b')]();});}};}function handleEntityNotFound(_0x1d436f,_0x5dc0de){return function(_0x189dc4){if(!_0x189dc4){_0x1d436f[_0x708b('0x2a')](0x194);}return _0x189dc4;};}function handleError(_0x1cb515,_0x301e0e){_0x301e0e=_0x301e0e||0x1f4;return function(_0x3c3280){logger['error'](_0x3c3280[_0x708b('0x38')]);if(_0x3c3280[_0x708b('0x39')]){delete _0x3c3280[_0x708b('0x39')];}_0x1cb515[_0x708b('0x31')](_0x301e0e)['send'](_0x3c3280);};}exports['index']=function(_0x5b5940,_0x512f8d){var _0xac7f17={},_0x5f2507={},_0x1fd82f={'count':0x0,'rows':[]};var _0x260982=_[_0x708b('0x3a')](db[_0x708b('0x3b')][_0x708b('0x3c')],function(_0x3b37d5){return{'name':_0x3b37d5['fieldName'],'type':_0x3b37d5['type'][_0x708b('0x3d')]};});_0x5f2507[_0x708b('0x3e')]=_['map'](_0x260982,'name');_0x5f2507[_0x708b('0x3f')]=_['keys'](_0x5b5940[_0x708b('0x3f')]);_0x5f2507[_0x708b('0x40')]=_[_0x708b('0x41')](_0x5f2507[_0x708b('0x3e')],_0x5f2507['query']);_0xac7f17[_0x708b('0x42')]=_[_0x708b('0x41')](_0x5f2507['model'],qs[_0x708b('0x43')](_0x5b5940[_0x708b('0x3f')][_0x708b('0x43')]));_0xac7f17[_0x708b('0x42')]=_0xac7f17[_0x708b('0x42')][_0x708b('0x44')]?_0xac7f17[_0x708b('0x42')]:_0x5f2507[_0x708b('0x3e')];if(!_0x5b5940[_0x708b('0x3f')][_0x708b('0x45')](_0x708b('0x46'))){_0xac7f17[_0x708b('0x2f')]=qs[_0x708b('0x2f')](_0x5b5940['query'][_0x708b('0x2f')]);_0xac7f17[_0x708b('0x2d')]=qs['offset'](_0x5b5940[_0x708b('0x3f')][_0x708b('0x2d')]);}_0xac7f17[_0x708b('0x47')]=qs[_0x708b('0x48')](_0x5b5940['query'][_0x708b('0x48')]);_0xac7f17[_0x708b('0x49')]=qs[_0x708b('0x40')](_['pick'](_0x5b5940['query'],_0x5f2507[_0x708b('0x40')]),_0x260982);if(_0x5b5940[_0x708b('0x3f')][_0x708b('0x4a')]){_0xac7f17['where']=_[_0x708b('0x4b')](_0xac7f17[_0x708b('0x49')],{'$or':_[_0x708b('0x3a')](_0x260982,function(_0x41b83b){if(_0x41b83b[_0x708b('0x4c')]!=='VIRTUAL'){var _0x11aba7={};_0x11aba7[_0x41b83b[_0x708b('0x39')]]={'$like':'%'+_0x5b5940[_0x708b('0x3f')][_0x708b('0x4a')]+'%'};return _0x11aba7;}})});}_0xac7f17=_[_0x708b('0x4b')]({},_0xac7f17,_0x5b5940[_0x708b('0x4d')]);var _0x464263={'where':_0xac7f17['where']};return db['ChatMessage'][_0x708b('0x30')](_0x464263)['then'](function(_0x543771){_0x1fd82f['count']=_0x543771;if(_0x5b5940[_0x708b('0x3f')][_0x708b('0x4e')]){_0xac7f17[_0x708b('0x4f')]=[{'all':!![]}];}return db['ChatMessage'][_0x708b('0x50')](_0xac7f17);})[_0x708b('0x1f')](function(_0x330475){_0x1fd82f[_0x708b('0x51')]=_0x330475;return _0x1fd82f;})[_0x708b('0x1f')](respondWithFilteredResult(_0x512f8d,_0xac7f17))['catch'](handleError(_0x512f8d,null));};exports['show']=function(_0x10921c,_0x48c74b){var _0x7cff3d={'raw':!![],'where':{'id':_0x10921c[_0x708b('0x52')]['id']}},_0x578c40={};_0x578c40[_0x708b('0x3e')]=_[_0x708b('0x53')](db['ChatMessage']['rawAttributes']);_0x578c40[_0x708b('0x3f')]=_[_0x708b('0x53')](_0x10921c[_0x708b('0x3f')]);_0x578c40['filters']=_['intersection'](_0x578c40[_0x708b('0x3e')],_0x578c40[_0x708b('0x3f')]);_0x7cff3d[_0x708b('0x42')]=_[_0x708b('0x41')](_0x578c40[_0x708b('0x3e')],qs[_0x708b('0x43')](_0x10921c['query']['fields']));_0x7cff3d[_0x708b('0x42')]=_0x7cff3d[_0x708b('0x42')][_0x708b('0x44')]?_0x7cff3d['attributes']:_0x578c40[_0x708b('0x3e')];if(_0x10921c['query'][_0x708b('0x4e')]){_0x7cff3d['include']=[{'all':!![]}];}_0x7cff3d=_[_0x708b('0x4b')]({},_0x7cff3d,_0x10921c[_0x708b('0x4d')]);return db[_0x708b('0x3b')][_0x708b('0x54')](_0x7cff3d)['then'](handleEntityNotFound(_0x48c74b,null))[_0x708b('0x1f')](respondWithResult(_0x48c74b,null))[_0x708b('0x29')](handleError(_0x48c74b,null));};exports[_0x708b('0x55')]=function(_0x92584f,_0x8d115f){return db[_0x708b('0x3b')][_0x708b('0x55')](_0x92584f[_0x708b('0x56')],{})[_0x708b('0x1f')](respondWithResult(_0x8d115f,0xc9))[_0x708b('0x29')](handleError(_0x8d115f,null));};exports['update']=function(_0x5cbfcb,_0x4574c5){if(_0x5cbfcb[_0x708b('0x56')]['id']){delete _0x5cbfcb[_0x708b('0x56')]['id'];}return db[_0x708b('0x3b')][_0x708b('0x54')]({'where':{'id':_0x5cbfcb[_0x708b('0x52')]['id']}})[_0x708b('0x1f')](handleEntityNotFound(_0x4574c5,null))['then'](saveUpdates(_0x5cbfcb[_0x708b('0x56')],null))['then'](respondWithResult(_0x4574c5,null))['catch'](handleError(_0x4574c5,null));};exports[_0x708b('0x37')]=function(_0xf29a61,_0x29183b){return db[_0x708b('0x3b')][_0x708b('0x54')]({'where':{'id':_0xf29a61['params']['id']}})[_0x708b('0x1f')](handleEntityNotFound(_0x29183b,null))[_0x708b('0x1f')](removeEntity(_0x29183b,null))[_0x708b('0x29')](handleError(_0x29183b,null));};exports[_0x708b('0x57')]=function(_0x2e715a,_0x47a7bf){return db['ChatMessage']['describe']()[_0x708b('0x1f')](respondWithResult(_0x47a7bf,null))[_0x708b('0x29')](handleError(_0x47a7bf,null));};var interaction_log=require(_0x708b('0x14'))(_0x708b('0x58'));exports['accept']=function(_0xf3c887,_0x535770,_0x2b0835){var _0x5a2dc7={'agent':{},'channel':'chat'};if(_0xf3c887['body']['id']){delete _0xf3c887[_0x708b('0x56')]['id'];}_0xf3c887[_0x708b('0x56')][_0x708b('0x59')]=!![];_0xf3c887[_0x708b('0x56')]['readAt']=moment()[_0x708b('0x5a')](_0x708b('0x5b'));_0xf3c887[_0x708b('0x56')]['UserId']=_0xf3c887[_0x708b('0x56')][_0x708b('0x5c')]||_0xf3c887[_0x708b('0x5d')]['id'];_0x5a2dc7['agent']['id']=_0xf3c887[_0x708b('0x56')][_0x708b('0x5c')];return db['ChatMessage'][_0x708b('0x54')]({'where':{'id':_0xf3c887[_0x708b('0x52')]['id'],'UserId':null}})[_0x708b('0x1f')](handleEntityNotFound(_0x535770,null))[_0x708b('0x1f')](saveUpdates(_0xf3c887[_0x708b('0x56')],null))[_0x708b('0x1f')](function(_0x508090){if(_0x508090){_0x5a2dc7[_0x708b('0x26')]=_0x508090[_0x708b('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x708b('0x54')]({'where':{'id':_0x508090[_0x708b('0x5f')]}});}return null;})[_0x708b('0x1f')](handleEntityNotFound(_0x535770,null))[_0x708b('0x1f')](function(_0x3d34a6){if(_0x3d34a6){return _0x3d34a6[_0x708b('0x60')]({'UserId':_0xf3c887['body'][_0x708b('0x5c')],'read1stAt':_[_0x708b('0x61')](_0x3d34a6[_0x708b('0x62')])?moment()[_0x708b('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x708b('0x1f')](function(_0x39adb4){if(_0x39adb4){_0x5a2dc7['interaction']=_0x39adb4['get']({'plain':!![]});interaction_log[_0x708b('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf3c887[_0x708b('0x5d')]['id'],_0xf3c887[_0x708b('0x5d')][_0x708b('0x39')],_0xf3c887[_0x708b('0x5d')][_0x708b('0x63')],_0x5a2dc7[_0x708b('0x64')]['id'],_0xf3c887[_0x708b('0x56')]?JSON[_0x708b('0x23')](_0xf3c887['body']):_0x708b('0x65'));return respondWithRpcPromise(_0x708b('0x66'),_0x708b('0x67'),_0x5a2dc7);}return null;})[_0x708b('0x1f')](function(_0x459a68){var _0xd5047='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x459a68[_0x708b('0x26')][_0x708b('0x68')];return db[_0x708b('0x69')][_0x708b('0x3f')](_0xd5047,{'type':db[_0x708b('0x6a')][_0x708b('0x6b')]['SELECT'],'raw':!![]})[_0x708b('0x1f')](function(_0x18d7cc){return _0x18d7cc;});})[_0x708b('0x1f')](function(_0x36bec8){if(_0x36bec8){_0x5a2dc7[_0x708b('0x26')][_0x708b('0x6c')]=_0x36bec8[0x0];if(!_0xf3c887[_0x708b('0x56')][_0x708b('0x5c')])return;return db[_0x708b('0x6d')][_0x708b('0x54')]({'where':{'id':_0xf3c887[_0x708b('0x56')]['UserId'],'role':_0x708b('0x6e')},'attributes':['id',_0x708b('0x39'),'fullname','email',_0x708b('0x6f')],'raw':!![]});}return null;})['then'](function(_0x5d941c){if(!_0x5d941c)return null;_0x5a2dc7[_0x708b('0x26')][_0x708b('0x6e')]=_0x5d941c;return _0x5a2dc7;})[_0x708b('0x1f')](function(_0x2d1a62){if(_0x2d1a62){if(_0xf3c887[_0x708b('0x56')]['manual']){_0x5a2dc7[_0x708b('0x26')]['interface']=util[_0x708b('0x5a')]('SIP/%s',_0xf3c887[_0x708b('0x5d')][_0x708b('0x39')]);_0x5a2dc7['message'][_0x708b('0x70')]=_0x5a2dc7[_0x708b('0x70')];_0x5a2dc7[_0x708b('0x26')][_0x708b('0x71')]=_0x5a2dc7[_0x708b('0x70')];_0x5a2dc7[_0x708b('0x26')][_0x708b('0x72')]=_0x708b('0x73');return respondWithRpcPromise(_0x708b('0x74'),'EventManager',{'event':_0x708b('0x75'),'message':_['merge'](_0x5a2dc7[_0x708b('0x26')],JSON[_0x708b('0x76')](_0x5a2dc7['interaction'][_0x708b('0x77')]))},client9002)[_0x708b('0x1f')](function(){return _0x5a2dc7;});}return _0x5a2dc7;}return null;})[_0x708b('0x1f')](respondWithResult(_0x535770,null))[_0x708b('0x29')](handleError(_0x535770,null));};var interaction_log=require(_0x708b('0x14'))('chat-interactions');exports[_0x708b('0x35')]=function(_0x30db3b,_0x207c99,_0x53a288){var _0x5ed698={'agent':{},'channel':'chat'};if(_0x30db3b[_0x708b('0x56')]['id']){delete _0x30db3b['body']['id'];}_0x30db3b[_0x708b('0x56')][_0x708b('0x5c')]=_0x30db3b[_0x708b('0x56')][_0x708b('0x5c')]||_0x30db3b[_0x708b('0x5d')]['id'];_0x5ed698[_0x708b('0x6e')]['id']=_0x30db3b[_0x708b('0x56')][_0x708b('0x5c')];return db[_0x708b('0x3b')][_0x708b('0x54')]({'where':{'id':_0x30db3b['params']['id'],'UserId':null}})[_0x708b('0x1f')](handleEntityNotFound(_0x207c99,null))[_0x708b('0x1f')](function(_0x2a6df1){if(_0x2a6df1){_0x5ed698[_0x708b('0x26')]=_0x2a6df1[_0x708b('0x5e')]({'plain':!![]});return db[_0x708b('0x78')][_0x708b('0x54')]({'where':{'id':_0x2a6df1[_0x708b('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x207c99,null))[_0x708b('0x1f')](function(_0x387a14){if(_0x387a14){_0x5ed698['interaction']=_0x387a14[_0x708b('0x5e')]({'plain':!![]});interaction_log[_0x708b('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30db3b[_0x708b('0x5d')]['id'],_0x30db3b[_0x708b('0x5d')][_0x708b('0x39')],_0x30db3b[_0x708b('0x5d')]['role'],_0x5ed698[_0x708b('0x64')]['id'],_0x30db3b[_0x708b('0x56')]?JSON[_0x708b('0x23')](_0x30db3b[_0x708b('0x56')]):'null');return respondWithRpcPromise(_0x708b('0x79'),_0x708b('0x7a'),_0x5ed698);}return null;})['then'](function(_0xcb0f9e){var _0x497dd2=_0x708b('0x7b')+_0xcb0f9e[_0x708b('0x26')][_0x708b('0x68')];return db['sequelize']['query'](_0x497dd2,{'type':db[_0x708b('0x6a')][_0x708b('0x6b')][_0x708b('0x7c')],'raw':!![]})[_0x708b('0x1f')](function(_0x3723c0){return _0x3723c0;});})[_0x708b('0x1f')](function(_0x31cb4a){if(_0x31cb4a){_0x5ed698[_0x708b('0x26')][_0x708b('0x6c')]=_0x31cb4a[0x0];if(!_0x30db3b[_0x708b('0x56')][_0x708b('0x5c')])return;return db[_0x708b('0x6d')][_0x708b('0x54')]({'where':{'id':_0x30db3b['body'][_0x708b('0x5c')],'role':_0x708b('0x6e')},'attributes':['id',_0x708b('0x39'),'fullname',_0x708b('0x7d'),_0x708b('0x6f')],'raw':!![]});}return null;})[_0x708b('0x1f')](function(_0x458c39){if(!_0x458c39)return null;_0x5ed698[_0x708b('0x26')][_0x708b('0x6e')]=_0x458c39;return _0x5ed698;})[_0x708b('0x1f')](function(_0x3eb198){if(_0x3eb198){_0x3eb198[_0x708b('0x26')][_0x708b('0x7e')]=util[_0x708b('0x5a')](_0x708b('0x7f'),_0x30db3b[_0x708b('0x5d')]['name']);_0x3eb198['message']['channel']=_0x5ed698[_0x708b('0x70')];_0x3eb198[_0x708b('0x26')][_0x708b('0x71')]=_0x5ed698[_0x708b('0x70')];_0x3eb198[_0x708b('0x26')][_0x708b('0x72')]=_0x708b('0x35');respondWithRpcPromise(_0x708b('0x74'),_0x708b('0x74'),{'event':_0x708b('0x80'),'message':_[_0x708b('0x4b')](_0x5ed698['message'],JSON[_0x708b('0x76')](_0x5ed698[_0x708b('0x64')][_0x708b('0x77')]))},client9002);return _0x5ed698;}return null;})[_0x708b('0x1f')](respondWithResult(_0x207c99,null))['catch'](handleError(_0x207c99,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb343=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1ff193,_0x349597){var _0x85b096=function(_0x5d64e7){while(--_0x5d64e7){_0x1ff193['push'](_0x1ff193['shift']());}};_0x85b096(++_0x349597);}(_0xb343,0x1e8));var _0x3b34=function(_0x5d5fad,_0x18e495){_0x5d5fad=_0x5d5fad-0x0;var _0x2285b7=_0xb343[_0x5d5fad];return _0x2285b7;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3b34('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3b34('0x1')](0x0);var events={'afterCreate':_0x3b34('0x2'),'afterUpdate':_0x3b34('0x3'),'afterDestroy':_0x3b34('0x4')};function emitEvent(_0x2031f0){return function(_0x12f577,_0x5f1757,_0x25461c){ChatMessageEvents[_0x3b34('0x5')](_0x2031f0+':'+_0x12f577['id'],_0x12f577);ChatMessageEvents[_0x3b34('0x5')](_0x2031f0,_0x12f577);_0x25461c(null);};}for(var e in events){if(events[_0x3b34('0x6')](e)){var event=events[e];ChatMessage[_0x3b34('0x7')](e,emitEvent(event));}}module[_0x3b34('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x61cf=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x40bc32,_0x428c83){var _0x2351e3=function(_0x3ba9f0){while(--_0x3ba9f0){_0x40bc32['push'](_0x40bc32['shift']());}};_0x2351e3(++_0x428c83);}(_0x61cf,0xf2));var _0xf61c=function(_0x1f67f7,_0x4f60ad){_0x1f67f7=_0x1f67f7-0x0;var _0x33d132=_0x61cf[_0x1f67f7];return _0x33d132;};'use strict';var EventEmitter=require(_0xf61c('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf61c('0x1')](0x0);var events={'afterCreate':_0xf61c('0x2'),'afterUpdate':_0xf61c('0x3'),'afterDestroy':_0xf61c('0x4')};function emitEvent(_0x10d38c){return function(_0x3957ea,_0x336db4,_0xac1a28){ChatMessageEvents[_0xf61c('0x5')](_0x10d38c+':'+_0x3957ea['id'],_0x3957ea);ChatMessageEvents[_0xf61c('0x5')](_0x10d38c,_0x3957ea);_0xac1a28(null);};}for(var e in events){if(events[_0xf61c('0x6')](e)){var event=events[e];ChatMessage[_0xf61c('0x7')](e,emitEvent(event));}}module[_0xf61c('0x8')]=ChatMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x405f=['secret','isNil','findOne','ChatInteractionId','then','catch','error','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','body','FULLTEXT','get','direction','toLowerCase'];(function(_0x41e460,_0x5be232){var _0x4b3605=function(_0x343480){while(--_0x343480){_0x41e460['push'](_0x41e460['shift']());}};_0x4b3605(++_0x5be232);}(_0x405f,0x127));var _0xf405=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x405f[_0x369151];return _0x4292d5;};'use strict';var _=require('lodash');var util=require(_0xf405('0x0'));var logger=require(_0xf405('0x1'))(_0xf405('0x2'));var moment=require(_0xf405('0x3'));var BPromise=require(_0xf405('0x4'));var rp=require(_0xf405('0x5'));var fs=require('fs');var path=require(_0xf405('0x6'));var rimraf=require(_0xf405('0x7'));var config=require(_0xf405('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x179442,_0x56b41f){return _0x179442[_0xf405('0x9')](_0xf405('0xa'),attributes,{'tableName':_0xf405('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xf405('0xc')],'type':_0xf405('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4703a4,_0x70a752,_0x1bcc12){var _0x3b9422=_0x179442['models'];var _0x5aa384=_0x4703a4[_0xf405('0xe')]({'plain':!![]});if(_0x5aa384[_0xf405('0xf')][_0xf405('0x10')]()==='in'||_0x5aa384[_0xf405('0xf')][_0xf405('0x10')]()==='out'&&!_0x5aa384[_0xf405('0x11')]&&!_[_0xf405('0x12')](_0x5aa384['UserId'])){_0x3b9422['ChatInteraction'][_0xf405('0x13')]({'where':{'id':_0x5aa384[_0xf405('0x14')]}})[_0xf405('0x15')](function(_0x292947){if(_0x292947){_0x292947['update']({'lastMsgAt':_0x5aa384['createdAt'],'lastMsgDirection':_0x5aa384[_0xf405('0xf')][_0xf405('0x10')]()});}})[_0xf405('0x16')](function(_0x270a21){console[_0xf405('0x17')](_0x270a21);});}_0x1bcc12();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc07a=['bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0xc07a,0x15c));var _0xac07=function(_0x44edb0,_0x7a1d21){_0x44edb0=_0x44edb0-0x0;var _0x38dbd0=_0xc07a[_0x44edb0];return _0x38dbd0;};'use strict';var _=require(_0xac07('0x0'));var util=require(_0xac07('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xac07('0x2'));var BPromise=require(_0xac07('0x3'));var rp=require(_0xac07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac07('0x5'));var attributes=require(_0xac07('0x6'));module[_0xac07('0x7')]=function(_0x2ea7c6,_0xa82875){return _0x2ea7c6[_0xac07('0x8')](_0xac07('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xac07('0xa'),'fields':[_0xac07('0xb')],'type':_0xac07('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7d016f,_0x5808db,_0x2c920e){var _0x32f8e0=_0x2ea7c6['models'];var _0x47eb42=_0x7d016f[_0xac07('0xd')]({'plain':!![]});if(_0x47eb42[_0xac07('0xe')][_0xac07('0xf')]()==='in'||_0x47eb42['direction'][_0xac07('0xf')]()===_0xac07('0x10')&&!_0x47eb42[_0xac07('0x11')]&&!_['isNil'](_0x47eb42[_0xac07('0x12')])){_0x32f8e0[_0xac07('0x13')][_0xac07('0x14')]({'where':{'id':_0x47eb42['ChatInteractionId']}})[_0xac07('0x15')](function(_0x57e958){if(_0x57e958){_0x57e958[_0xac07('0x16')]({'lastMsgAt':_0x47eb42['createdAt'],'lastMsgDirection':_0x47eb42[_0xac07('0xe')][_0xac07('0xf')]()});}})[_0xac07('0x17')](function(_0xe781ca){console[_0xac07('0x18')](_0xe781ca);});}_0x2c920e();}},'charset':_0xac07('0x19'),'collate':_0xac07('0x1a')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb44=['options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatMessage','body'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfb44,0xb8));var _0x4fb4=function(_0x23d105,_0x4adf80){_0x23d105=_0x23d105-0x0;var _0x2367d9=_0xfb44[_0x23d105];return _0x2367d9;};'use strict';var _=require(_0x4fb4('0x0'));var util=require(_0x4fb4('0x1'));var moment=require(_0x4fb4('0x2'));var BPromise=require(_0x4fb4('0x3'));var rs=require(_0x4fb4('0x4'));var fs=require('fs');var Redis=require(_0x4fb4('0x5'));var db=require(_0x4fb4('0x6'))['db'];var utils=require(_0x4fb4('0x7'));var logger=require(_0x4fb4('0x8'))(_0x4fb4('0x9'));var config=require(_0x4fb4('0xa'));var jayson=require(_0x4fb4('0xb'));var client=jayson['client'][_0x4fb4('0xc')]({'port':0x232a});config[_0x4fb4('0xd')]=_['defaults'](config['redis'],{'host':_0x4fb4('0xe'),'port':0x18eb});var socket=require(_0x4fb4('0xf'))(new Redis(config[_0x4fb4('0xd')]));require(_0x4fb4('0x10'))[_0x4fb4('0x11')](socket);function respondWithRpcPromise(_0x310516,_0x5c7127,_0x322ac0){return new BPromise(function(_0x37a72c,_0x3c12e5){return client[_0x4fb4('0x12')](_0x310516,_0x322ac0)[_0x4fb4('0x13')](function(_0x13cf4a){logger[_0x4fb4('0x14')](_0x4fb4('0x15'),_0x5c7127,_0x4fb4('0x16'));logger[_0x4fb4('0x17')](_0x4fb4('0x18'),_0x5c7127,_0x4fb4('0x16'),JSON['stringify'](_0x13cf4a));if(_0x13cf4a[_0x4fb4('0x19')]){if(_0x13cf4a['error'][_0x4fb4('0x1a')]===0x1f4){logger[_0x4fb4('0x19')](_0x4fb4('0x15'),_0x5c7127,_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);return _0x3c12e5(_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);}logger[_0x4fb4('0x19')]('ChatMessage,\x20%s,\x20%s',_0x5c7127,_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);return _0x37a72c(_0x13cf4a[_0x4fb4('0x19')][_0x4fb4('0x1b')]);}else{logger[_0x4fb4('0x14')](_0x4fb4('0x15'),_0x5c7127,_0x4fb4('0x16'));_0x37a72c(_0x13cf4a[_0x4fb4('0x1c')][_0x4fb4('0x1b')]);}})[_0x4fb4('0x1d')](function(_0x5ad027){logger[_0x4fb4('0x19')](_0x4fb4('0x15'),_0x5c7127,_0x5ad027);_0x3c12e5(_0x5ad027);});});}exports['CreateChatMessage']=function(_0x4b2e48){var _0x31c99f=this;return new Promise(function(_0x44e24c,_0x18c38a){return db[_0x4fb4('0x1e')]['create'](_0x4b2e48[_0x4fb4('0x1f')],{'raw':_0x4b2e48[_0x4fb4('0x20')]?_0x4b2e48['options'][_0x4fb4('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x51d30a){logger['info'](_0x4fb4('0x22'),_0x4b2e48);logger[_0x4fb4('0x17')](_0x4fb4('0x22'),_0x4b2e48,JSON[_0x4fb4('0x23')](_0x51d30a));_0x44e24c(_0x51d30a);})['catch'](function(_0x196423){logger['error'](_0x4fb4('0x22'),_0x196423[_0x4fb4('0x1b')],_0x4b2e48);_0x18c38a(_0x31c99f[_0x4fb4('0x19')](0x1f4,_0x196423[_0x4fb4('0x1b')]));});});};
\ No newline at end of file
+var _0x6941=['catch','CreateChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x6941,0x1e2));var _0x1694=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x6941[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x1694('0x0'));var util=require(_0x1694('0x1'));var moment=require(_0x1694('0x2'));var BPromise=require(_0x1694('0x3'));var rs=require(_0x1694('0x4'));var fs=require('fs');var Redis=require(_0x1694('0x5'));var db=require(_0x1694('0x6'))['db'];var utils=require(_0x1694('0x7'));var logger=require(_0x1694('0x8'))(_0x1694('0x9'));var config=require(_0x1694('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1694('0xb')][_0x1694('0xc')]({'port':0x232a});config[_0x1694('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1694('0xe'))(new Redis(config['redis']));require(_0x1694('0xf'))[_0x1694('0x10')](socket);function respondWithRpcPromise(_0x10f9c5,_0x6140e7,_0x2691b7){return new BPromise(function(_0x2d885b,_0x45c003){return client[_0x1694('0x11')](_0x10f9c5,_0x2691b7)[_0x1694('0x12')](function(_0x29f8ec){logger[_0x1694('0x13')]('ChatMessage,\x20%s,\x20%s',_0x6140e7,_0x1694('0x14'));logger[_0x1694('0x15')](_0x1694('0x16'),_0x6140e7,'request\x20sent',JSON[_0x1694('0x17')](_0x29f8ec));if(_0x29f8ec[_0x1694('0x18')]){if(_0x29f8ec[_0x1694('0x18')][_0x1694('0x19')]===0x1f4){logger[_0x1694('0x18')](_0x1694('0x1a'),_0x6140e7,_0x29f8ec['error'][_0x1694('0x1b')]);return _0x45c003(_0x29f8ec['error'][_0x1694('0x1b')]);}logger[_0x1694('0x18')](_0x1694('0x1a'),_0x6140e7,_0x29f8ec[_0x1694('0x18')][_0x1694('0x1b')]);return _0x2d885b(_0x29f8ec['error'][_0x1694('0x1b')]);}else{logger[_0x1694('0x13')](_0x1694('0x1a'),_0x6140e7,_0x1694('0x14'));_0x2d885b(_0x29f8ec['result'][_0x1694('0x1b')]);}})[_0x1694('0x1c')](function(_0x463021){logger[_0x1694('0x18')](_0x1694('0x1a'),_0x6140e7,_0x463021);_0x45c003(_0x463021);});});}exports[_0x1694('0x1d')]=function(_0xaa91ff){var _0x417e21=this;return new Promise(function(_0x115e52,_0x42c8fa){return db['ChatMessage'][_0x1694('0x1e')](_0xaa91ff[_0x1694('0x1f')],{'raw':_0xaa91ff[_0x1694('0x20')]?_0xaa91ff[_0x1694('0x20')][_0x1694('0x21')]===undefined?!![]:![]:!![]})[_0x1694('0x12')](function(_0x255b43){logger['info']('CreateChatMessage',_0xaa91ff);logger[_0x1694('0x15')]('CreateChatMessage',_0xaa91ff,JSON[_0x1694('0x17')](_0x255b43));_0x115e52(_0x255b43);})[_0x1694('0x1c')](function(_0x326709){logger[_0x1694('0x18')](_0x1694('0x1d'),_0x326709[_0x1694('0x1b')],_0xaa91ff);_0x42c8fa(_0x417e21[_0x1694('0x18')](0x1f4,_0x326709[_0x1694('0x1b')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3561=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register'];(function(_0x3e1c0b,_0x51fa97){var _0x5bfb8b=function(_0x2ed521){while(--_0x2ed521){_0x3e1c0b['push'](_0x3e1c0b['shift']());}};_0x5bfb8b(++_0x51fa97);}(_0x3561,0x94));var _0x1356=function(_0x127ae9,_0x4ef4b4){_0x127ae9=_0x127ae9-0x0;var _0x9671cd=_0x3561[_0x127ae9];return _0x9671cd;};'use strict';var ChatMessageEvents=require(_0x1356('0x0'));var events=['save',_0x1356('0x1'),_0x1356('0x2')];function createListener(_0x8ef5f,_0x14465e){return function(_0x442fbc){_0x14465e[_0x1356('0x3')](_0x8ef5f,_0x442fbc);};}function removeListener(_0x1634de,_0x116ff0){return function(){ChatMessageEvents[_0x1356('0x4')](_0x1634de,_0x116ff0);};}exports[_0x1356('0x5')]=function(_0x417d11){for(var _0x36e81f=0x0,_0x45ac56=events['length'];_0x36e81f<_0x45ac56;_0x36e81f++){var _0x105aaf=events[_0x36e81f];var _0x33529f=createListener(_0x1356('0x6')+_0x105aaf,_0x417d11);ChatMessageEvents['on'](_0x105aaf,_0x33529f);}};
\ No newline at end of file
+var _0x2bd8=['removeListener','register','length','./chatMessage.events','remove','update','emit'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2bd8,0x130));var _0x82bd=function(_0x34b438,_0xbecaf1){_0x34b438=_0x34b438-0x0;var _0x2c0131=_0x2bd8[_0x34b438];return _0x2c0131;};'use strict';var ChatMessageEvents=require(_0x82bd('0x0'));var events=['save',_0x82bd('0x1'),_0x82bd('0x2')];function createListener(_0x208a3d,_0x41dbdf){return function(_0x4681ad){_0x41dbdf[_0x82bd('0x3')](_0x208a3d,_0x4681ad);};}function removeListener(_0x183f76,_0x572a80){return function(){ChatMessageEvents[_0x82bd('0x4')](_0x183f76,_0x572a80);};}exports[_0x82bd('0x5')]=function(_0x3bf810){for(var _0x5ceb60=0x0,_0x19dbb1=events[_0x82bd('0x6')];_0x5ceb60<_0x19dbb1;_0x5ceb60++){var _0x226f60=events[_0x5ceb60];var _0x1f7463=createListener('chatMessage:'+_0x226f60,_0x3bf810);ChatMessageEvents['on'](_0x226f60,_0x1f7463);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8bf9=['post','chat','create','/:id','update','put','accept','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8bf9,0x191));var _0x98bf=function(_0x32b312,_0x4e3f0f){_0x32b312=_0x32b312-0x0;var _0x313368=_0x8bf9[_0x32b312];return _0x313368;};'use strict';var multer=require(_0x98bf('0x0'));var util=require(_0x98bf('0x1'));var path=require('path');var timeout=require(_0x98bf('0x2'));var express=require(_0x98bf('0x3'));var router=express[_0x98bf('0x4')]();var fs_extra=require(_0x98bf('0x5'));var auth=require(_0x98bf('0x6'));var interaction=require(_0x98bf('0x7'));var config=require(_0x98bf('0x8'));var controller=require(_0x98bf('0x9'));router[_0x98bf('0xa')]('/',auth[_0x98bf('0xb')](),controller[_0x98bf('0xc')]);router[_0x98bf('0xa')](_0x98bf('0xd'),auth[_0x98bf('0xb')](),controller[_0x98bf('0xe')]);router[_0x98bf('0xa')]('/:id',auth[_0x98bf('0xb')](),controller['show']);router[_0x98bf('0xf')]('/',auth[_0x98bf('0xb')](),interaction['tracked'](_0x98bf('0x10'),'chatmessage:create'),controller[_0x98bf('0x11')]);router['put'](_0x98bf('0x12'),controller[_0x98bf('0x13')]);router[_0x98bf('0x14')]('/:id/accept',auth[_0x98bf('0xb')](),controller[_0x98bf('0x15')]);router[_0x98bf('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x98bf('0x16')]);router[_0x98bf('0x17')](_0x98bf('0x12'),auth[_0x98bf('0xb')](),controller[_0x98bf('0x18')]);module[_0x98bf('0x19')]=router;
\ No newline at end of file
+var _0x4a1f=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create'];(function(_0xa008b7,_0x56e068){var _0x247f5f=function(_0x106cf7){while(--_0x106cf7){_0xa008b7['push'](_0xa008b7['shift']());}};_0x247f5f(++_0x56e068);}(_0x4a1f,0x105));var _0xf4a1=function(_0x5da398,_0x13a526){_0x5da398=_0x5da398-0x0;var _0x4db43a=_0x4a1f[_0x5da398];return _0x4db43a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf4a1('0x0'));var timeout=require(_0xf4a1('0x1'));var express=require(_0xf4a1('0x2'));var router=express[_0xf4a1('0x3')]();var fs_extra=require(_0xf4a1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf4a1('0x5'));var config=require(_0xf4a1('0x6'));var controller=require('./chatMessage.controller');router[_0xf4a1('0x7')]('/',auth['isAuthenticated'](),controller[_0xf4a1('0x8')]);router[_0xf4a1('0x7')](_0xf4a1('0x9'),auth[_0xf4a1('0xa')](),controller[_0xf4a1('0xb')]);router[_0xf4a1('0x7')](_0xf4a1('0xc'),auth[_0xf4a1('0xa')](),controller[_0xf4a1('0xd')]);router[_0xf4a1('0xe')]('/',auth[_0xf4a1('0xa')](),interaction[_0xf4a1('0xf')](_0xf4a1('0x10'),_0xf4a1('0x11')),controller[_0xf4a1('0x12')]);router[_0xf4a1('0x13')]('/:id',controller[_0xf4a1('0x14')]);router[_0xf4a1('0x13')](_0xf4a1('0x15'),auth[_0xf4a1('0xa')](),controller[_0xf4a1('0x16')]);router[_0xf4a1('0x13')](_0xf4a1('0x17'),auth[_0xf4a1('0xa')](),controller[_0xf4a1('0x18')]);router[_0xf4a1('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xf4a1('0x1a')]);module[_0xf4a1('0x1b')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0xa6cefc,_0x1ffb0b){var _0x1ae289=function(_0x1507a0){while(--_0x1507a0){_0xa6cefc['push'](_0xa6cefc['shift']());}};_0x1ae289(++_0x1ffb0b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x5f2f[_0x56d1b7];return _0x184d91;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x757a=['exports','TEXT'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x757a,0xde));var _0xa757=function(_0x2f58be,_0x1fbb15){_0x2f58be=_0x2f58be-0x0;var _0x3f52f8=_0x757a[_0x2f58be];return _0x3f52f8;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
// * 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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x518b63,_0x3e9c08){_0x518b63=_0x518b63-0x0;var _0x152f98=_0x7a54[_0x518b63];return _0x152f98;};'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 _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(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7a54,0x106));var _0x47a5=function(_0x556418,_0x5c7c38){_0x556418=_0x556418-0x0;var _0x2bc45c=_0x7a54[_0x556418];return _0x2bc45c;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a4f=['hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','remove','emit'];(function(_0xbc1e82,_0x51893d){var _0x9f286d=function(_0x4c110a){while(--_0x4c110a){_0xbc1e82['push'](_0xbc1e82['shift']());}};_0x9f286d(++_0x51893d);}(_0x3a4f,0x18b));var _0xf3a4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a4f[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0xf3a4('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xf3a4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf3a4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf3a4('0x3')};function emitEvent(_0xc1d1d9){return function(_0x5774c4,_0x4c6d11,_0x5a03ec){ChatOfflineMessageEvents['emit'](_0xc1d1d9+':'+_0x5774c4['id'],_0x5774c4);ChatOfflineMessageEvents[_0xf3a4('0x4')](_0xc1d1d9,_0x5774c4);_0x5a03ec(null);};}for(var e in events){if(events[_0xf3a4('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xf3a4('0x6')](e,emitEvent(event));}}module[_0xf3a4('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xdb83=['ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x30b2a8,_0x421eb9){var _0x3cf0e5=function(_0x359f83){while(--_0x359f83){_0x30b2a8['push'](_0x30b2a8['shift']());}};_0x3cf0e5(++_0x421eb9);}(_0xdb83,0xc5));var _0x3db8=function(_0x51ebe0,_0x40946a){_0x51ebe0=_0x51ebe0-0x0;var _0x1a75db=_0xdb83[_0x51ebe0];return _0x1a75db;};'use strict';var EventEmitter=require(_0x3db8('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3db8('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3db8('0x2'),'afterUpdate':_0x3db8('0x3'),'afterDestroy':_0x3db8('0x4')};function emitEvent(_0x4bde1d){return function(_0x2bb269,_0xc0597b,_0x6d3729){ChatOfflineMessageEvents['emit'](_0x4bde1d+':'+_0x2bb269['id'],_0x2bb269);ChatOfflineMessageEvents[_0x3db8('0x5')](_0x4bde1d,_0x2bb269);_0x6d3729(null);};}for(var e in events){if(events[_0x3db8('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3db8('0x7')](e,emitEvent(event));}}module[_0x3db8('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe451=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4e84b8,_0x5094da){var _0x3e00d1=function(_0x9a6831){while(--_0x9a6831){_0x4e84b8['push'](_0x4e84b8['shift']());}};_0x3e00d1(++_0x5094da);}(_0xe451,0x1ec));var _0x1e45=function(_0x385a10,_0xf8377a){_0x385a10=_0x385a10-0x0;var _0x1fa2d7=_0xe451[_0x385a10];return _0x1fa2d7;};'use strict';var attributes=require(_0x1e45('0x0'));module[_0x1e45('0x1')]=function(_0x4c95a9){return _0x4c95a9['define'](_0x1e45('0x2'),attributes,{'tableName':_0x1e45('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e45('0x4'),'collate':_0x1e45('0x5')});};
\ No newline at end of file
+var _0x2a22=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0x2a22,0x148));var _0x22a2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2a22[_0x3ab51d];return _0x29a04e;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x22a2('0x0')]=function(_0x56ddd3){return _0x56ddd3[_0x22a2('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x22a2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22a2('0x3'),'collate':_0x22a2('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe528=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ChatOfflineMessage,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1f622f,_0x52d4e3){var _0x12e56a=function(_0x24749b){while(--_0x24749b){_0x1f622f['push'](_0x1f622f['shift']());}};_0x12e56a(++_0x52d4e3);}(_0xe528,0x9d));var _0x8e52=function(_0x115a8c,_0x3cf74e){_0x115a8c=_0x115a8c-0x0;var _0x42d351=_0xe528[_0x115a8c];return _0x42d351;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e52('0x0'));var BPromise=require(_0x8e52('0x1'));var rs=require(_0x8e52('0x2'));var fs=require('fs');var Redis=require(_0x8e52('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e52('0x4'))(_0x8e52('0x5'));var config=require(_0x8e52('0x6'));var jayson=require(_0x8e52('0x7'));var client=jayson['client'][_0x8e52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2be5b8,_0xa7202a,_0xb3f277){return new BPromise(function(_0x8ef34f,_0x38ac36){return client[_0x8e52('0x9')](_0x2be5b8,_0xb3f277)[_0x8e52('0xa')](function(_0x594e8e){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xa7202a,'request\x20sent');logger[_0x8e52('0xb')](_0x8e52('0xc'),_0xa7202a,_0x8e52('0xd'),JSON[_0x8e52('0xe')](_0x594e8e));if(_0x594e8e['error']){if(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x10')]===0x1f4){logger[_0x8e52('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa7202a,_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);return _0x38ac36(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);}logger[_0x8e52('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa7202a,_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);return _0x8ef34f(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);}else{logger[_0x8e52('0x12')](_0x8e52('0x13'),_0xa7202a,_0x8e52('0xd'));_0x8ef34f(_0x594e8e['result'][_0x8e52('0x11')]);}})[_0x8e52('0x14')](function(_0xd3f736){logger[_0x8e52('0xf')](_0x8e52('0x13'),_0xa7202a,_0xd3f736);_0x38ac36(_0xd3f736);});});}
\ No newline at end of file
+var _0x50e8=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3cb0bf,_0x2bb1cd){var _0x495b0a=function(_0xf90d02){while(--_0xf90d02){_0x3cb0bf['push'](_0x3cb0bf['shift']());}};_0x495b0a(++_0x2bb1cd);}(_0x50e8,0x147));var _0x850e=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0x50e8[_0x543c51];return _0x360555;};'use strict';var _=require(_0x850e('0x0'));var util=require('util');var moment=require(_0x850e('0x1'));var BPromise=require(_0x850e('0x2'));var rs=require(_0x850e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x850e('0x4'))['db'];var utils=require(_0x850e('0x5'));var logger=require(_0x850e('0x6'))(_0x850e('0x7'));var config=require('../../config/environment');var jayson=require(_0x850e('0x8'));var client=jayson[_0x850e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x305a04,_0x17dd51,_0x4fc384){return new BPromise(function(_0x5f3bb2,_0x20c6ce){return client[_0x850e('0xa')](_0x305a04,_0x4fc384)[_0x850e('0xb')](function(_0x1d0ce3){logger[_0x850e('0xc')](_0x850e('0xd'),_0x17dd51,_0x850e('0xe'));logger[_0x850e('0xf')](_0x850e('0x10'),_0x17dd51,_0x850e('0xe'),JSON[_0x850e('0x11')](_0x1d0ce3));if(_0x1d0ce3[_0x850e('0x12')]){if(_0x1d0ce3['error'][_0x850e('0x13')]===0x1f4){logger[_0x850e('0x12')](_0x850e('0xd'),_0x17dd51,_0x1d0ce3[_0x850e('0x12')][_0x850e('0x14')]);return _0x20c6ce(_0x1d0ce3[_0x850e('0x12')][_0x850e('0x14')]);}logger['error'](_0x850e('0xd'),_0x17dd51,_0x1d0ce3[_0x850e('0x12')]['message']);return _0x5f3bb2(_0x1d0ce3[_0x850e('0x12')][_0x850e('0x14')]);}else{logger[_0x850e('0xc')](_0x850e('0xd'),_0x17dd51,_0x850e('0xe'));_0x5f3bb2(_0x1d0ce3[_0x850e('0x15')]['message']);}})[_0x850e('0x16')](function(_0x524e3a){logger[_0x850e('0x12')](_0x850e('0xd'),_0x17dd51,_0x524e3a);_0x20c6ce(_0x524e3a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb17=['get','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatOfflineMessage.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb17,0x1ad));var _0x7fb1=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xfb17[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x7fb1('0x0'));var util=require(_0x7fb1('0x1'));var path=require(_0x7fb1('0x2'));var timeout=require(_0x7fb1('0x3'));var express=require(_0x7fb1('0x4'));var router=express[_0x7fb1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7fb1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7fb1('0x7'));router[_0x7fb1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7fb1('0x9'),auth[_0x7fb1('0xa')](),controller['describe']);router[_0x7fb1('0x8')](_0x7fb1('0xb'),auth[_0x7fb1('0xa')](),controller[_0x7fb1('0xc')]);router[_0x7fb1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7fb1('0xe')](_0x7fb1('0xb'),auth[_0x7fb1('0xa')](),controller[_0x7fb1('0xf')]);router[_0x7fb1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7fb1('0x11')]);module[_0x7fb1('0x12')]=router;
\ No newline at end of file
+var _0xc481=['/describe','/:id','show','post','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','get'];(function(_0x4ee670,_0x4e9d47){var _0x4cfb88=function(_0x568f5e){while(--_0x568f5e){_0x4ee670['push'](_0x4ee670['shift']());}};_0x4cfb88(++_0x4e9d47);}(_0xc481,0x1c2));var _0x1c48=function(_0x49258d,_0x5bcf0e){_0x49258d=_0x49258d-0x0;var _0x2a9044=_0xc481[_0x49258d];return _0x2a9044;};'use strict';var multer=require(_0x1c48('0x0'));var util=require(_0x1c48('0x1'));var path=require(_0x1c48('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c48('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1c48('0x4'));var interaction=require(_0x1c48('0x5'));var config=require('../../config/environment');var controller=require(_0x1c48('0x6'));router['get']('/',auth[_0x1c48('0x7')](),controller['index']);router[_0x1c48('0x8')](_0x1c48('0x9'),auth[_0x1c48('0x7')](),controller['describe']);router['get'](_0x1c48('0xa'),auth[_0x1c48('0x7')](),controller[_0x1c48('0xb')]);router[_0x1c48('0xc')]('/',auth[_0x1c48('0x7')](),controller['create']);router[_0x1c48('0xd')](_0x1c48('0xa'),auth[_0x1c48('0x7')](),controller[_0x1c48('0xe')]);router[_0x1c48('0xf')](_0x1c48('0xa'),auth[_0x1c48('0x7')](),controller['destroy']);module[_0x1c48('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc9f5=['mouseOver','timeout','exports','ENUM'];(function(_0xf0bfe6,_0x5d0357){var _0x3872f6=function(_0x3b5f66){while(--_0x3b5f66){_0xf0bfe6['push'](_0xf0bfe6['shift']());}};_0x3872f6(++_0x5d0357);}(_0xc9f5,0x1f2));var _0x5c9f=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xc9f5[_0x4a9beb];return _0x2d4c58;};'use strict';var Sequelize=require('sequelize');module[_0x5c9f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5c9f('0x1')](_0x5c9f('0x2'),_0x5c9f('0x3')),'defaultValue':_0x5c9f('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xec54=['mouseOver','timeout','STRING','INTEGER','exports'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xec54,0x1e4));var _0x4ec5=function(_0x5d8e7c,_0x2b3efe){_0x5d8e7c=_0x5d8e7c-0x0;var _0xef88d7=_0xec54[_0x5d8e7c];return _0xef88d7;};'use strict';var Sequelize=require('sequelize');module[_0x4ec5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4ec5('0x1'),_0x4ec5('0x2')),'defaultValue':_0x4ec5('0x1')},'selector':{'type':Sequelize[_0x4ec5('0x3')]},'timeout':{'type':Sequelize[_0x4ec5('0x4')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x482d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','fields','includeAll','merge','catch','create','body','params','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x482d,0x16c));var _0xd482=function(_0x3fb002,_0xdccfe3){_0x3fb002=_0x3fb002-0x0;var _0x481669=_0x482d[_0x3fb002];return _0x481669;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd482('0x0'));var jsonpatch=require(_0xd482('0x1'));var rp=require(_0xd482('0x2'));var moment=require(_0xd482('0x3'));var BPromise=require(_0xd482('0x4'));var Mustache=require(_0xd482('0x5'));var util=require('util');var path=require(_0xd482('0x6'));var sox=require(_0xd482('0x7'));var csv=require(_0xd482('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd482('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd482('0xa'));var deskjs=require(_0xd482('0xb'));var toCsv=require(_0xd482('0x8'));var querystring=require('querystring');var Papa=require(_0xd482('0xc'));var Redis=require(_0xd482('0xd'));var authService=require(_0xd482('0xe'));var qs=require(_0xd482('0xf'));var as=require(_0xd482('0x10'));var hardwareService=require(_0xd482('0x11'));var logger=require(_0xd482('0x12'))(_0xd482('0x13'));var utils=require('../../config/utils');var config=require(_0xd482('0x14'));var licenseUtil=require(_0xd482('0x15'));var db=require(_0xd482('0x16'))['db'];function respondWithStatusCode(_0x2bde45,_0x4b2350){_0x4b2350=_0x4b2350||0xcc;return function(_0x276ba4){if(_0x276ba4){return _0x2bde45[_0xd482('0x17')](_0x4b2350);}return _0x2bde45[_0xd482('0x18')](_0x4b2350)['end']();};}function respondWithResult(_0x248c9d,_0x56d516){_0x56d516=_0x56d516||0xc8;return function(_0x5c5eaa){if(_0x5c5eaa){return _0x248c9d[_0xd482('0x18')](_0x56d516)['json'](_0x5c5eaa);}};}function respondWithFilteredResult(_0x3b6849,_0x3e7067){return function(_0x494272){if(_0x494272){var _0x3f4c2f=typeof _0x3e7067[_0xd482('0x19')]===_0xd482('0x1a')&&typeof _0x3e7067[_0xd482('0x1b')]===_0xd482('0x1a');var _0x499dbc=_0x494272[_0xd482('0x1c')];var _0x1816b7=_0x3f4c2f?0x0:_0x3e7067[_0xd482('0x19')];var _0x5dbc03=_0x3f4c2f?_0x494272[_0xd482('0x1c')]:_0x3e7067[_0xd482('0x19')]+_0x3e7067[_0xd482('0x1b')];var _0x155c35;if(_0x5dbc03>=_0x499dbc){_0x5dbc03=_0x499dbc;_0x155c35=0xc8;}else{_0x155c35=0xce;}_0x3b6849[_0xd482('0x18')](_0x155c35);return _0x3b6849['set']('Content-Range',_0x1816b7+'-'+_0x5dbc03+'/'+_0x499dbc)['json'](_0x494272);}return null;};}function patchUpdates(_0x28d660){return function(_0x1897a7){try{jsonpatch[_0xd482('0x1d')](_0x1897a7,_0x28d660,!![]);}catch(_0x5510cd){return BPromise[_0xd482('0x1e')](_0x5510cd);}return _0x1897a7[_0xd482('0x1f')]();};}function saveUpdates(_0x25d72d,_0xc4b518){return function(_0x76b6ea){if(_0x76b6ea){return _0x76b6ea[_0xd482('0x20')](_0x25d72d)[_0xd482('0x21')](function(_0x305251){return _0x305251;});}return null;};}function removeEntity(_0x58ec59,_0x3a6bba){return function(_0x34c646){if(_0x34c646){return _0x34c646[_0xd482('0x22')]()[_0xd482('0x21')](function(){_0x58ec59[_0xd482('0x18')](0xcc)[_0xd482('0x23')]();});}};}function handleEntityNotFound(_0x1e68c2,_0x1545d8){return function(_0x5075b7){if(!_0x5075b7){_0x1e68c2['sendStatus'](0x194);}return _0x5075b7;};}function handleError(_0x40ee1b,_0x5a78cb){_0x5a78cb=_0x5a78cb||0x1f4;return function(_0x111ebd){logger['error'](_0x111ebd['stack']);if(_0x111ebd['name']){delete _0x111ebd[_0xd482('0x24')];}_0x40ee1b[_0xd482('0x18')](_0x5a78cb)[_0xd482('0x25')](_0x111ebd);};}exports[_0xd482('0x26')]=function(_0x3654fa,_0x3426dd){var _0x1bacca={'raw':!![],'where':{'id':_0x3654fa['params']['id']}},_0x53a958={};_0x53a958[_0xd482('0x27')]=_[_0xd482('0x28')](db[_0xd482('0x29')][_0xd482('0x2a')]);_0x53a958['query']=_[_0xd482('0x28')](_0x3654fa[_0xd482('0x2b')]);_0x53a958[_0xd482('0x2c')]=_['intersection'](_0x53a958[_0xd482('0x27')],_0x53a958[_0xd482('0x2b')]);_0x1bacca[_0xd482('0x2d')]=_['intersection'](_0x53a958[_0xd482('0x27')],qs['fields'](_0x3654fa[_0xd482('0x2b')][_0xd482('0x2e')]));_0x1bacca[_0xd482('0x2d')]=_0x1bacca[_0xd482('0x2d')]['length']?_0x1bacca[_0xd482('0x2d')]:_0x53a958[_0xd482('0x27')];if(_0x3654fa['query'][_0xd482('0x2f')]){_0x1bacca['include']=[{'all':!![]}];}_0x1bacca=_[_0xd482('0x30')]({},_0x1bacca,_0x3654fa['options']);return db['ChatProactiveAction']['find'](_0x1bacca)[_0xd482('0x21')](handleEntityNotFound(_0x3426dd,null))['then'](respondWithResult(_0x3426dd,null))[_0xd482('0x31')](handleError(_0x3426dd,null));};exports[_0xd482('0x32')]=function(_0x46d858,_0x52a8d0){return db[_0xd482('0x29')]['create'](_0x46d858[_0xd482('0x33')],{})[_0xd482('0x21')](respondWithResult(_0x52a8d0,0xc9))[_0xd482('0x31')](handleError(_0x52a8d0,null));};exports[_0xd482('0x20')]=function(_0x1ce476,_0x2566a9){if(_0x1ce476[_0xd482('0x33')]['id']){delete _0x1ce476[_0xd482('0x33')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x1ce476[_0xd482('0x34')]['id']}})[_0xd482('0x21')](handleEntityNotFound(_0x2566a9,null))[_0xd482('0x21')](saveUpdates(_0x1ce476['body'],null))['then'](respondWithResult(_0x2566a9,null))[_0xd482('0x31')](handleError(_0x2566a9,null));};exports[_0xd482('0x22')]=function(_0x4b3654,_0x4a1f52){return db[_0xd482('0x29')][_0xd482('0x35')]({'where':{'id':_0x4b3654[_0xd482('0x34')]['id']}})[_0xd482('0x21')](handleEntityNotFound(_0x4a1f52,null))[_0xd482('0x21')](removeEntity(_0x4a1f52,null))[_0xd482('0x31')](handleError(_0x4a1f52,null));};
\ No newline at end of file
+var _0x5455=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','end','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','length','includeAll','include','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js'];(function(_0x5535b2,_0x14c5b9){var _0xe53202=function(_0x557435){while(--_0x557435){_0x5535b2['push'](_0x5535b2['shift']());}};_0xe53202(++_0x14c5b9);}(_0x5455,0x197));var _0x5545=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5455[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5545('0x0'));var zipdir=require(_0x5545('0x1'));var jsonpatch=require(_0x5545('0x2'));var rp=require(_0x5545('0x3'));var moment=require(_0x5545('0x4'));var BPromise=require(_0x5545('0x5'));var Mustache=require(_0x5545('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5545('0x7'));var csv=require(_0x5545('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5545('0x9'));var squel=require(_0x5545('0xa'));var crypto=require('crypto');var jsforce=require(_0x5545('0xb'));var deskjs=require(_0x5545('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5545('0xd'));var Papa=require(_0x5545('0xe'));var Redis=require(_0x5545('0xf'));var authService=require(_0x5545('0x10'));var qs=require(_0x5545('0x11'));var as=require(_0x5545('0x12'));var hardwareService=require(_0x5545('0x13'));var logger=require(_0x5545('0x14'))(_0x5545('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5545('0x16'));var db=require(_0x5545('0x17'))['db'];function respondWithStatusCode(_0x2a844e,_0x1af0c6){_0x1af0c6=_0x1af0c6||0xcc;return function(_0x530be6){if(_0x530be6){return _0x2a844e[_0x5545('0x18')](_0x1af0c6);}return _0x2a844e[_0x5545('0x19')](_0x1af0c6)['end']();};}function respondWithResult(_0x2736a7,_0x167f3d){_0x167f3d=_0x167f3d||0xc8;return function(_0x43f841){if(_0x43f841){return _0x2736a7[_0x5545('0x19')](_0x167f3d)['json'](_0x43f841);}};}function respondWithFilteredResult(_0x182ec5,_0x5ae7e8){return function(_0x30de43){if(_0x30de43){var _0x3fde96=typeof _0x5ae7e8[_0x5545('0x1a')]===_0x5545('0x1b')&&typeof _0x5ae7e8[_0x5545('0x1c')]===_0x5545('0x1b');var _0xf78493=_0x30de43[_0x5545('0x1d')];var _0x3a012e=_0x3fde96?0x0:_0x5ae7e8[_0x5545('0x1a')];var _0x5f0e6f=_0x3fde96?_0x30de43[_0x5545('0x1d')]:_0x5ae7e8['offset']+_0x5ae7e8['limit'];var _0x589033;if(_0x5f0e6f>=_0xf78493){_0x5f0e6f=_0xf78493;_0x589033=0xc8;}else{_0x589033=0xce;}_0x182ec5['status'](_0x589033);return _0x182ec5[_0x5545('0x1e')](_0x5545('0x1f'),_0x3a012e+'-'+_0x5f0e6f+'/'+_0xf78493)[_0x5545('0x20')](_0x30de43);}return null;};}function patchUpdates(_0x58d53d){return function(_0x3c0a2e){try{jsonpatch[_0x5545('0x21')](_0x3c0a2e,_0x58d53d,!![]);}catch(_0x21b9b4){return BPromise[_0x5545('0x22')](_0x21b9b4);}return _0x3c0a2e['save']();};}function saveUpdates(_0x31eb2d,_0x2c2d9e){return function(_0x50a90c){if(_0x50a90c){return _0x50a90c['update'](_0x31eb2d)[_0x5545('0x23')](function(_0x4ab3ff){return _0x4ab3ff;});}return null;};}function removeEntity(_0x4149f7,_0x496a5d){return function(_0xf3e8f4){if(_0xf3e8f4){return _0xf3e8f4[_0x5545('0x24')]()[_0x5545('0x23')](function(){_0x4149f7[_0x5545('0x19')](0xcc)[_0x5545('0x25')]();});}};}function handleEntityNotFound(_0xc420f5,_0x44e203){return function(_0x55aef6){if(!_0x55aef6){_0xc420f5['sendStatus'](0x194);}return _0x55aef6;};}function handleError(_0x33d394,_0x2ef0c1){_0x2ef0c1=_0x2ef0c1||0x1f4;return function(_0x16f633){logger['error'](_0x16f633[_0x5545('0x26')]);if(_0x16f633['name']){delete _0x16f633[_0x5545('0x27')];}_0x33d394[_0x5545('0x19')](_0x2ef0c1)[_0x5545('0x28')](_0x16f633);};}exports[_0x5545('0x29')]=function(_0x4d5102,_0x198667){var _0x41a256={'raw':!![],'where':{'id':_0x4d5102[_0x5545('0x2a')]['id']}},_0x46e78e={};_0x46e78e[_0x5545('0x2b')]=_['keys'](db[_0x5545('0x2c')][_0x5545('0x2d')]);_0x46e78e['query']=_[_0x5545('0x2e')](_0x4d5102[_0x5545('0x2f')]);_0x46e78e[_0x5545('0x30')]=_[_0x5545('0x31')](_0x46e78e[_0x5545('0x2b')],_0x46e78e[_0x5545('0x2f')]);_0x41a256[_0x5545('0x32')]=_[_0x5545('0x31')](_0x46e78e[_0x5545('0x2b')],qs['fields'](_0x4d5102[_0x5545('0x2f')]['fields']));_0x41a256[_0x5545('0x32')]=_0x41a256[_0x5545('0x32')][_0x5545('0x33')]?_0x41a256[_0x5545('0x32')]:_0x46e78e[_0x5545('0x2b')];if(_0x4d5102['query'][_0x5545('0x34')]){_0x41a256[_0x5545('0x35')]=[{'all':!![]}];}_0x41a256=_['merge']({},_0x41a256,_0x4d5102[_0x5545('0x36')]);return db['ChatProactiveAction'][_0x5545('0x37')](_0x41a256)[_0x5545('0x23')](handleEntityNotFound(_0x198667,null))['then'](respondWithResult(_0x198667,null))[_0x5545('0x38')](handleError(_0x198667,null));};exports['create']=function(_0x26fba9,_0x5322fc){return db['ChatProactiveAction'][_0x5545('0x39')](_0x26fba9[_0x5545('0x3a')],{})[_0x5545('0x23')](respondWithResult(_0x5322fc,0xc9))['catch'](handleError(_0x5322fc,null));};exports[_0x5545('0x3b')]=function(_0xa8d51b,_0x3b3197){if(_0xa8d51b['body']['id']){delete _0xa8d51b[_0x5545('0x3a')]['id'];}return db[_0x5545('0x2c')][_0x5545('0x37')]({'where':{'id':_0xa8d51b['params']['id']}})[_0x5545('0x23')](handleEntityNotFound(_0x3b3197,null))[_0x5545('0x23')](saveUpdates(_0xa8d51b[_0x5545('0x3a')],null))[_0x5545('0x23')](respondWithResult(_0x3b3197,null))[_0x5545('0x38')](handleError(_0x3b3197,null));};exports[_0x5545('0x24')]=function(_0x18aefc,_0x27738c){return db[_0x5545('0x2c')][_0x5545('0x37')]({'where':{'id':_0x18aefc[_0x5545('0x2a')]['id']}})[_0x5545('0x23')](handleEntityNotFound(_0x27738c,null))[_0x5545('0x23')](removeEntity(_0x27738c,null))[_0x5545('0x38')](handleError(_0x27738c,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bc5=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x12207c,_0x6c800e){var _0xb3d757=function(_0xf87283){while(--_0xf87283){_0x12207c['push'](_0x12207c['shift']());}};_0xb3d757(++_0x6c800e);}(_0x6bc5,0x68));var _0x56bc=function(_0x5d1702,_0x131b83){_0x5d1702=_0x5d1702-0x0;var _0x5b2ff3=_0x6bc5[_0x5d1702];return _0x5b2ff3;};'use strict';var _=require('lodash');var util=require(_0x56bc('0x0'));var logger=require(_0x56bc('0x1'))(_0x56bc('0x2'));var moment=require(_0x56bc('0x3'));var BPromise=require(_0x56bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56bc('0x5'));var attributes=require(_0x56bc('0x6'));module[_0x56bc('0x7')]=function(_0x11e024,_0x43097e){return _0x11e024[_0x56bc('0x8')](_0x56bc('0x9'),attributes,{'tableName':_0x56bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4acc=['../../config/logger','moment','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4acc,0x196));var _0xc4ac=function(_0x2afb6b,_0x48a357){_0x2afb6b=_0x2afb6b-0x0;var _0x320315=_0x4acc[_0x2afb6b];return _0x320315;};'use strict';var _=require(_0xc4ac('0x0'));var util=require(_0xc4ac('0x1'));var logger=require(_0xc4ac('0x2'))('api');var moment=require(_0xc4ac('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4ac('0x4'));var rimraf=require(_0xc4ac('0x5'));var config=require(_0xc4ac('0x6'));var attributes=require(_0xc4ac('0x7'));module[_0xc4ac('0x8')]=function(_0x4ede8f,_0x119a26){return _0x4ede8f[_0xc4ac('0x9')](_0xc4ac('0xa'),attributes,{'tableName':_0xc4ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b14=['request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x18c887,_0x80c8df){var _0x574b3e=function(_0x15d4b3){while(--_0x15d4b3){_0x18c887['push'](_0x18c887['shift']());}};_0x574b3e(++_0x80c8df);}(_0x2b14,0x9d));var _0x42b1=function(_0x2b8dd7,_0x227f23){_0x2b8dd7=_0x2b8dd7-0x0;var _0x40953d=_0x2b14[_0x2b8dd7];return _0x40953d;};'use strict';var _=require(_0x42b1('0x0'));var util=require(_0x42b1('0x1'));var moment=require('moment');var BPromise=require(_0x42b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42b1('0x3'));var db=require(_0x42b1('0x4'))['db'];var utils=require(_0x42b1('0x5'));var logger=require(_0x42b1('0x6'))(_0x42b1('0x7'));var config=require(_0x42b1('0x8'));var jayson=require(_0x42b1('0x9'));var client=jayson['client'][_0x42b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x413be3,_0x377cfc,_0x2d6089){return new BPromise(function(_0x48427d,_0x1fc9df){return client[_0x42b1('0xb')](_0x413be3,_0x2d6089)['then'](function(_0x297e05){logger[_0x42b1('0xc')](_0x42b1('0xd'),_0x377cfc,_0x42b1('0xe'));logger['debug'](_0x42b1('0xf'),_0x377cfc,_0x42b1('0xe'),JSON['stringify'](_0x297e05));if(_0x297e05[_0x42b1('0x10')]){if(_0x297e05[_0x42b1('0x10')][_0x42b1('0x11')]===0x1f4){logger['error'](_0x42b1('0xd'),_0x377cfc,_0x297e05[_0x42b1('0x10')][_0x42b1('0x12')]);return _0x1fc9df(_0x297e05[_0x42b1('0x10')][_0x42b1('0x12')]);}logger[_0x42b1('0x10')](_0x42b1('0xd'),_0x377cfc,_0x297e05['error']['message']);return _0x48427d(_0x297e05[_0x42b1('0x10')]['message']);}else{logger[_0x42b1('0xc')](_0x42b1('0xd'),_0x377cfc,_0x42b1('0xe'));_0x48427d(_0x297e05[_0x42b1('0x13')][_0x42b1('0x12')]);}})[_0x42b1('0x14')](function(_0x2ecda8){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x377cfc,_0x2ecda8);_0x1fc9df(_0x2ecda8);});});}
\ No newline at end of file
+var _0x3616=['code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3616,0xcb));var _0x6361=function(_0x57a58a,_0x39b0e2){_0x57a58a=_0x57a58a-0x0;var _0x2171bd=_0x3616[_0x57a58a];return _0x2171bd;};'use strict';var _=require(_0x6361('0x0'));var util=require(_0x6361('0x1'));var moment=require(_0x6361('0x2'));var BPromise=require(_0x6361('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6361('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6361('0x5'))('rpc');var config=require(_0x6361('0x6'));var jayson=require(_0x6361('0x7'));var client=jayson['client'][_0x6361('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474f71,_0xb430aa,_0x4a0bc8){return new BPromise(function(_0x4fdfcd,_0x22cd96){return client[_0x6361('0x9')](_0x474f71,_0x4a0bc8)[_0x6361('0xa')](function(_0x5c8d79){logger[_0x6361('0xb')](_0x6361('0xc'),_0xb430aa,'request\x20sent');logger[_0x6361('0xd')](_0x6361('0xe'),_0xb430aa,_0x6361('0xf'),JSON['stringify'](_0x5c8d79));if(_0x5c8d79[_0x6361('0x10')]){if(_0x5c8d79[_0x6361('0x10')][_0x6361('0x11')]===0x1f4){logger[_0x6361('0x10')](_0x6361('0xc'),_0xb430aa,_0x5c8d79[_0x6361('0x10')][_0x6361('0x12')]);return _0x22cd96(_0x5c8d79['error'][_0x6361('0x12')]);}logger[_0x6361('0x10')](_0x6361('0xc'),_0xb430aa,_0x5c8d79['error'][_0x6361('0x12')]);return _0x4fdfcd(_0x5c8d79[_0x6361('0x10')][_0x6361('0x12')]);}else{logger[_0x6361('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0xb430aa,_0x6361('0xf'));_0x4fdfcd(_0x5c8d79['result'][_0x6361('0x12')]);}})[_0x6361('0x13')](function(_0x8fa6bd){logger[_0x6361('0x10')](_0x6361('0xc'),_0xb430aa,_0x8fa6bd);_0x22cd96(_0x8fa6bd);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x102402,_0x4eaaf8){var _0x321b44=function(_0x198c94){while(--_0x198c94){_0x102402['push'](_0x102402['shift']());}};_0x321b44(++_0x4eaaf8);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3e3064,_0x3dd6f5){_0x3e3064=_0x3e3064-0x0;var _0x4547e1=_0xeec6[_0x3e3064];return _0x4547e1;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router;
\ No newline at end of file
+var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x149f86,_0x373607){var _0x596e2c=function(_0x1def4b){while(--_0x1def4b){_0x149f86['push'](_0x149f86['shift']());}};_0x596e2c(++_0x373607);}(_0x1cb9,0x14e));var _0x91cb=function(_0xd23119,_0x10c356){_0xd23119=_0xd23119-0x0;var _0x482445=_0x1cb9[_0xd23119];return _0x482445;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x505b=['rrmemory','sequelize','STRING','name','ENUM'];(function(_0x3fd06c,_0x295baa){var _0x18608a=function(_0x3f7674){while(--_0x3f7674){_0x3fd06c['push'](_0x3fd06c['shift']());}};_0x18608a(++_0x295baa);}(_0x505b,0x155));var _0xb505=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x505b[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xb505('0x0'));module['exports']={'name':{'type':Sequelize[_0xb505('0x1')],'unique':_0xb505('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb505('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb505('0x3')](_0xb505('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0xfc25=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x5e6094,_0x31919b){var _0xf4c05e=function(_0x248a11){while(--_0x248a11){_0x5e6094['push'](_0x5e6094['shift']());}};_0xf4c05e(++_0x31919b);}(_0xfc25,0x15b));var _0x5fc2=function(_0x5da33c,_0x4c9906){_0x5da33c=_0x5da33c-0x0;var _0x3e6a9c=_0xfc25[_0x5da33c];return _0x3e6a9c;};'use strict';var Sequelize=require(_0x5fc2('0x0'));module['exports']={'name':{'type':Sequelize[_0x5fc2('0x1')],'unique':_0x5fc2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5fc2('0x1')]},'timeout':{'type':Sequelize[_0x5fc2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5fc2('0x4')](_0x5fc2('0x5'),_0x5fc2('0x6'),_0x5fc2('0x7'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0100=['addTeams','ids','Agents','online','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','bluebird','lodash','../../config/logger','api','../../config/environment','redis','defaults','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','intersection','model','fields','attributes','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','length','order','sort','pick','filter','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0100,0x184));var _0x0010=function(_0x327607,_0xe7a1a){_0x327607=_0x327607-0x0;var _0x21510=_0x0100[_0x327607];return _0x21510;};'use strict';var BPromise=require(_0x0010('0x0'));var util=require('util');var _=require(_0x0010('0x1'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0010('0x2'))(_0x0010('0x3'));var config=require(_0x0010('0x4'));var db=require('../../mysqldb')['db'];config[_0x0010('0x5')]=_[_0x0010('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0010('0x7')](socket);function respondWithStatusCode(_0x571eda,_0x26be81){_0x26be81=_0x26be81||0xcc;return function(_0x2085a6){if(_0x2085a6){return _0x571eda['sendStatus'](_0x26be81);}return _0x571eda[_0x0010('0x8')](_0x26be81)[_0x0010('0x9')]();};}function respondWithResult(_0xcf0388,_0x3dd787){_0x3dd787=_0x3dd787||0xc8;return function(_0x38ac06){if(_0x38ac06){return _0xcf0388[_0x0010('0x8')](_0x3dd787)[_0x0010('0xa')](_0x38ac06);}};}function respondWithFilteredResult(_0x30f586,_0x47a88c){return function(_0x2f320f){if(_0x2f320f){var _0x5082e1=typeof _0x47a88c[_0x0010('0xb')]===_0x0010('0xc')&&typeof _0x47a88c[_0x0010('0xd')]==='undefined';var _0x13c8af=_0x2f320f['count'];var _0x31e5a5=_0x5082e1?0x0:_0x47a88c[_0x0010('0xb')];var _0x368268=_0x5082e1?_0x2f320f[_0x0010('0xe')]:_0x47a88c[_0x0010('0xb')]+_0x47a88c['limit'];var _0x97f156;if(_0x368268>=_0x13c8af){_0x368268=_0x13c8af;_0x97f156=0xc8;}else{_0x97f156=0xce;}_0x30f586['status'](_0x97f156);return _0x30f586[_0x0010('0xf')](_0x0010('0x10'),_0x31e5a5+'-'+_0x368268+'/'+_0x13c8af)[_0x0010('0xa')](_0x2f320f);}return null;};}function saveUpdates(_0x1d8e9f){return function(_0x190591){if(_0x190591){return _0x190591[_0x0010('0x11')](_0x1d8e9f)[_0x0010('0x12')](function(_0x2bc961){return _0x2bc961;});}return null;};}function removeEntity(_0xc729b8){return function(_0xe4146f){if(_0xe4146f){return _0xe4146f[_0x0010('0x13')]()[_0x0010('0x12')](function(){var _0x1035b8=_0xe4146f[_0x0010('0x14')]({'plain':!![]});var _0x1fe355=_0x0010('0x15');return db['UserProfileResource'][_0x0010('0x13')]({'where':{'type':_0x1fe355,'resourceId':_0x1035b8['id']}})[_0x0010('0x12')](function(){return _0xe4146f;});})[_0x0010('0x12')](function(){_0xc729b8['status'](0xcc)[_0x0010('0x9')]();});}};}function handleEntityNotFound(_0x2f14dc){return function(_0x53e0a9){if(!_0x53e0a9){_0x2f14dc['sendStatus'](0x194);}return _0x53e0a9;};}function handleError(_0x4ac0db,_0x1e7d02){_0x1e7d02=_0x1e7d02||0x1f4;return function(_0x1edc99){logger[_0x0010('0x16')](_0x1edc99[_0x0010('0x17')]);if(_0x1edc99[_0x0010('0x18')]){delete _0x1edc99[_0x0010('0x18')];}_0x4ac0db[_0x0010('0x8')](_0x1e7d02)[_0x0010('0x19')](_0x1edc99);};}exports[_0x0010('0x1a')]=function(_0x514b09,_0x3bfb7f){var _0x13c483={};var _0x48b328={'count':0x0,'rows':[]};var _0x568601=_[_0x0010('0x1b')](db[_0x0010('0x1c')][_0x0010('0x1d')],function(_0x3ff16a){return{'name':_0x3ff16a[_0x0010('0x1e')],'type':_0x3ff16a['type'][_0x0010('0x1f')]};});_0x13c483=qs[_0x0010('0x20')](_0x568601,_0x514b09);var _0x4249fd={'where':_0x13c483[_0x0010('0x21')]};return db[_0x0010('0x1c')][_0x0010('0xe')](_0x4249fd)[_0x0010('0x12')](function(_0x28f813){_0x48b328[_0x0010('0xe')]=_0x28f813;_0x13c483['include']=qs[_0x0010('0x22')](_0x514b09[_0x0010('0x23')]);return db[_0x0010('0x1c')][_0x0010('0x24')](_0x13c483);})[_0x0010('0x12')](function(_0x1fdcf2){_0x48b328[_0x0010('0x25')]=_0x1fdcf2;return _0x48b328;})[_0x0010('0x12')](respondWithFilteredResult(_0x3bfb7f,_0x13c483))[_0x0010('0x26')](handleError(_0x3bfb7f,null));};exports[_0x0010('0x27')]=function(_0x39db37,_0x5b9d5a){var _0x12c2a2={'raw':!![],'where':{'id':_0x39db37[_0x0010('0x28')]['id']}},_0x64b645={};_0x64b645['model']=_['keys'](db[_0x0010('0x1c')]['rawAttributes']);_0x64b645[_0x0010('0x23')]=_[_0x0010('0x29')](_0x39db37['query']);_0x64b645['filters']=_[_0x0010('0x2a')](_0x64b645[_0x0010('0x2b')],_0x64b645[_0x0010('0x23')]);_0x12c2a2['attributes']=_[_0x0010('0x2a')](_0x64b645[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0x39db37[_0x0010('0x23')][_0x0010('0x2c')]));_0x12c2a2[_0x0010('0x2d')]=_0x12c2a2[_0x0010('0x2d')]['length']?_0x12c2a2[_0x0010('0x2d')]:_0x64b645[_0x0010('0x2b')];if(_0x39db37['query'][_0x0010('0x2e')]){_0x12c2a2[_0x0010('0x22')]=[{'all':!![]}];}_0x12c2a2=_[_0x0010('0x2f')]({},_0x12c2a2,_0x39db37[_0x0010('0x30')]);return db['ChatQueue']['find'](_0x12c2a2)['then'](handleEntityNotFound(_0x5b9d5a,null))[_0x0010('0x12')](respondWithResult(_0x5b9d5a,null))[_0x0010('0x26')](handleError(_0x5b9d5a,null));};exports[_0x0010('0x31')]=function(_0x3b3b5c,_0x32ee88){return db[_0x0010('0x1c')][_0x0010('0x31')](_0x3b3b5c[_0x0010('0x32')],{})[_0x0010('0x12')](function(_0x4e352e){var _0x2f9816=_0x3b3b5c[_0x0010('0x33')][_0x0010('0x14')]({'plain':!![]});if(!_0x2f9816)throw new Error(_0x0010('0x34'));if(_0x2f9816[_0x0010('0x35')]==='user'){var _0x47f9e2=_0x4e352e['get']({'plain':!![]});var _0x3d9ed2=_0x0010('0x15');return db[_0x0010('0x36')][_0x0010('0x37')]({'where':{'name':_0x3d9ed2,'userProfileId':_0x2f9816['userProfileId']},'raw':!![]})[_0x0010('0x12')](function(_0x227f12){if(_0x227f12&&_0x227f12['autoAssociation']===0x0){return db[_0x0010('0x38')][_0x0010('0x31')]({'name':_0x47f9e2[_0x0010('0x18')],'resourceId':_0x47f9e2['id'],'type':_0x227f12[_0x0010('0x18')],'sectionId':_0x227f12['id']},{})[_0x0010('0x12')](function(){return _0x4e352e;});}else{return _0x4e352e;}})[_0x0010('0x26')](function(_0xa47fbd){logger['error'](_0x0010('0x39'),_0xa47fbd);throw _0xa47fbd;});}return _0x4e352e;})[_0x0010('0x12')](respondWithResult(_0x32ee88,0xc9))[_0x0010('0x26')](handleError(_0x32ee88,null));};exports[_0x0010('0x11')]=function(_0x1406e4,_0x548be4){if(_0x1406e4[_0x0010('0x32')]['id']){delete _0x1406e4[_0x0010('0x32')]['id'];}return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x1406e4[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x548be4,null))[_0x0010('0x12')](saveUpdates(_0x1406e4[_0x0010('0x32')],null))[_0x0010('0x12')](respondWithResult(_0x548be4,null))['catch'](handleError(_0x548be4,null));};exports[_0x0010('0x13')]=function(_0x5bd82c,_0x6e1cec){return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x5bd82c['params']['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x6e1cec,null))[_0x0010('0x12')](removeEntity(_0x6e1cec,null))[_0x0010('0x26')](handleError(_0x6e1cec,null));};exports[_0x0010('0x3a')]=function(_0xb645f8,_0x23f558){return db[_0x0010('0x1c')][_0x0010('0x3a')]()[_0x0010('0x12')](respondWithResult(_0x23f558,null))['catch'](handleError(_0x23f558,null));};exports[_0x0010('0x3b')]=function(_0xc0f6d2,_0x3bf09d){var _0x49bc80={'raw':!![],'where':{}},_0x3e0c8f={},_0x2b9f65;return db[_0x0010('0x1c')][_0x0010('0x3c')]({'where':{'id':_0xc0f6d2[_0x0010('0x28')]['id']}})['then'](handleEntityNotFound(_0x3bf09d,null))[_0x0010('0x12')](function(_0x54a584){if(_0x54a584){_0x2b9f65=_0x54a584[_0x0010('0x14')]({'plain':!![]});_0x3e0c8f[_0x0010('0x2b')]=_[_0x0010('0x29')](db[_0x0010('0x3d')][_0x0010('0x1d')]);_0x3e0c8f[_0x0010('0x23')]=_[_0x0010('0x29')](_0xc0f6d2['query']);_0x3e0c8f[_0x0010('0x3e')]=_[_0x0010('0x2a')](_0x3e0c8f[_0x0010('0x2b')],_0x3e0c8f['query']);_0x49bc80['attributes']=_[_0x0010('0x2a')](_0x3e0c8f[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0xc0f6d2['query'][_0x0010('0x2c')]));_0x49bc80[_0x0010('0x2d')]=_0x49bc80[_0x0010('0x2d')][_0x0010('0x3f')]?_0x49bc80[_0x0010('0x2d')]:_0x3e0c8f[_0x0010('0x2b')];if(!_0xc0f6d2[_0x0010('0x23')]['hasOwnProperty']('nolimit')){_0x49bc80['limit']=qs[_0x0010('0xd')](_0xc0f6d2['query'][_0x0010('0xd')]);_0x49bc80[_0x0010('0xb')]=qs[_0x0010('0xb')](_0xc0f6d2['query'][_0x0010('0xb')]);}_0x49bc80[_0x0010('0x40')]=qs[_0x0010('0x41')](_0xc0f6d2[_0x0010('0x23')][_0x0010('0x41')]);_0x49bc80[_0x0010('0x21')]=qs[_0x0010('0x3e')](_[_0x0010('0x42')](_0xc0f6d2[_0x0010('0x23')],_0x3e0c8f[_0x0010('0x3e')]));_0x49bc80['where']['ChatQueueId']=_0x54a584['id'];if(_0xc0f6d2[_0x0010('0x23')][_0x0010('0x43')]){_0x49bc80[_0x0010('0x21')]=_[_0x0010('0x2f')](_0x49bc80['where'],{'$or':_[_0x0010('0x1b')](_0x49bc80['attributes'],function(_0x662f09){var _0x27e6cc={};_0x27e6cc[_0x662f09]={'$like':'%'+_0xc0f6d2[_0x0010('0x23')][_0x0010('0x43')]+'%'};return _0x27e6cc;})});}_0x49bc80=_['merge']({},_0x49bc80,_0xc0f6d2[_0x0010('0x30')]);return db[_0x0010('0x3d')][_0x0010('0x24')](_0x49bc80);}})[_0x0010('0x12')](function(_0x5da2ec){if(_0x5da2ec){return db[_0x0010('0x44')][_0x0010('0x45')]({'where':{'id':_[_0x0010('0x1b')](_0x5da2ec,_0x0010('0x46')),'role':'agent'},'attributes':['id',_0x0010('0x18'),_0x0010('0x47'),_0x0010('0x48'),_0x0010('0x49')]});}})[_0x0010('0x12')](function(_0x1722ff){if(_0x1722ff){return{'count':_0x1722ff[_0x0010('0xe')],'rows':_[_0x0010('0x1b')](_0x1722ff[_0x0010('0x25')],function(_0xe3a170){return{'membername':_0xe3a170[_0x0010('0x18')],'UserId':_0xe3a170['id'],'queue_name':_0x2b9f65[_0x0010('0x18')],'ChatQueueId':_0x2b9f65['id'],'interface':util[_0x0010('0x4a')](_0x0010('0x4b'),_0x0010('0x4c'),_0xe3a170[_0x0010('0x18')]),'penalty':0x0,'paused':_0xe3a170[_0x0010('0x47')],'createdAt':_0xe3a170['createdAt'],'updatedAt':_0xe3a170['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0010('0x12')](respondWithFilteredResult(_0x3bf09d,_0x49bc80))[_0x0010('0x26')](handleError(_0x3bf09d,null));};exports[_0x0010('0x4d')]=function(_0x2c2649,_0x539bd9){var _0x34973f={};var _0x307b87={};var _0x4a7559;var _0x9121;return db[_0x0010('0x1c')][_0x0010('0x3c')]({'where':{'id':_0x2c2649[_0x0010('0x28')]['id']}})['then'](handleEntityNotFound(_0x539bd9,null))[_0x0010('0x12')](function(_0x3761da){if(_0x3761da){_0x4a7559=_0x3761da;_0x307b87[_0x0010('0x2b')]=_[_0x0010('0x29')](db[_0x0010('0x4e')]['rawAttributes']);_0x307b87['query']=_[_0x0010('0x29')](_0x2c2649[_0x0010('0x23')]);_0x307b87[_0x0010('0x3e')]=_[_0x0010('0x2a')](_0x307b87[_0x0010('0x2b')],_0x307b87[_0x0010('0x23')]);_0x34973f[_0x0010('0x2d')]=_[_0x0010('0x2a')](_0x307b87[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0x2c2649[_0x0010('0x23')][_0x0010('0x2c')]));_0x34973f[_0x0010('0x2d')]=_0x34973f[_0x0010('0x2d')]['length']?_0x34973f[_0x0010('0x2d')]:_0x307b87[_0x0010('0x2b')];_0x34973f[_0x0010('0x40')]=qs['sort'](_0x2c2649['query'][_0x0010('0x41')]);_0x34973f[_0x0010('0x21')]=qs[_0x0010('0x3e')](_[_0x0010('0x42')](_0x2c2649[_0x0010('0x23')],_0x307b87['filters']));if(_0x2c2649[_0x0010('0x23')][_0x0010('0x43')]){_0x34973f[_0x0010('0x21')]=_['merge'](_0x34973f[_0x0010('0x21')],{'$or':_[_0x0010('0x1b')](_0x34973f[_0x0010('0x2d')],function(_0x19fc7a){var _0x391bd7={};_0x391bd7[_0x19fc7a]={'$like':'%'+_0x2c2649[_0x0010('0x23')][_0x0010('0x43')]+'%'};return _0x391bd7;})});}_0x34973f=_['merge']({},_0x34973f,_0x2c2649[_0x0010('0x30')]);return _0x4a7559['getTeams'](_0x34973f);}})[_0x0010('0x12')](function(_0x456f5a){if(_0x456f5a){_0x9121=_0x456f5a['length'];if(!_0x2c2649['query']['hasOwnProperty'](_0x0010('0x4f'))){_0x34973f[_0x0010('0xd')]=qs[_0x0010('0xd')](_0x2c2649['query']['limit']);_0x34973f['offset']=qs['offset'](_0x2c2649['query'][_0x0010('0xb')]);}return _0x4a7559[_0x0010('0x4d')](_0x34973f);}})[_0x0010('0x12')](function(_0x2c5531){if(_0x2c5531){return _0x2c5531?{'count':_0x9121,'rows':_0x2c5531}:null;}})[_0x0010('0x12')](respondWithResult(_0x539bd9,null))[_0x0010('0x26')](handleError(_0x539bd9,null));};exports[_0x0010('0x50')]=function(_0x15d380,_0x3601d6){var _0x1be7ab=_0x15d380[_0x0010('0x32')][_0x0010('0x51')];return db[_0x0010('0x4e')][_0x0010('0x24')]({'where':{'id':_0x1be7ab},'attributes':['id'],'include':[{'model':db[_0x0010('0x44')],'as':_0x0010('0x52'),'attributes':['id',_0x0010('0x18'),_0x0010('0x53'),'voicePause','interface'],'raw':!![]}]})[_0x0010('0x12')](function(_0x2b0a11){if(_0x2b0a11){var _0x2307c3=_[_0x0010('0x54')](_0x2b0a11,function(_0x4aa559){var _0x336ada=_0x4aa559[_0x0010('0x14')]({'plain':!![]});return _0x336ada[_0x0010('0x52')];});return db['ChatQueue'][_0x0010('0x37')]({'where':{'id':_0x15d380[_0x0010('0x28')]['id']}})[_0x0010('0x12')](function(_0x2c0ee6){return db[_0x0010('0x55')]['transaction'](function(_0x4d6658){return _0x2c0ee6[_0x0010('0x50')](_0x1be7ab,{'transaction':_0x4d6658})['then'](function(){return BPromise[_0x0010('0x56')](_0x2307c3,function(_0x2e99ac){return db[_0x0010('0x3d')][_0x0010('0x57')]({'where':{'UserId':_0x2e99ac['id'],'ChatQueueId':_0x15d380[_0x0010('0x28')]['id']},'transaction':_0x4d6658});});})[_0x0010('0x12')](function(){_0x2307c3[_0x0010('0x58')](function(_0x30a327){socket[_0x0010('0x59')](_0x0010('0x5a'),{'UserId':_0x30a327['id'],'ChatQueueId':_0x2c0ee6['id']});});});});});}})[_0x0010('0x12')](respondWithStatusCode(_0x3601d6,null))[_0x0010('0x26')](handleError(_0x3601d6,null));};exports[_0x0010('0x5b')]=function(_0x24ea4f,_0x5817e1){return db[_0x0010('0x4e')][_0x0010('0x24')]({'where':{'id':_0x24ea4f[_0x0010('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0010('0x44')],'as':_0x0010('0x52'),'attributes':['id'],'raw':!![]}]})[_0x0010('0x12')](handleEntityNotFound(_0x5817e1,null))[_0x0010('0x12')](function(_0x21cabe){var _0x26c603=_[_0x0010('0x1b')](_0x21cabe,'id');var _0x251a11=[];var _0xd60c0c=[];var _0x9564f9=squel[_0x0010('0x5c')]();_0x9564f9['field'](_0x0010('0x5d'))[_0x0010('0x5e')](_0x0010('0x5f'),'tq')['join'](_0x0010('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0010('0x21')](_0x0010('0x61'),_0x24ea4f[_0x0010('0x28')]['id']);for(var _0x586a26=0x0;_0x586a26<_0x21cabe['length'];_0x586a26+=0x1){let _0x1889f2=_0x21cabe[_0x586a26];for(var _0x557d13=0x0;_0x557d13<_0x1889f2[_0x0010('0x52')]['length'];_0x557d13+=0x1){let _0x522aef=_0x1889f2[_0x0010('0x52')][_0x557d13];var _0x180292=_0x9564f9['clone']();_0x180292['where'](_0x0010('0x62'),_0x522aef['id']);_0xd60c0c[_0x0010('0x63')](db[_0x0010('0x55')][_0x0010('0x23')](_0x180292[_0x0010('0x64')](),{'type':db[_0x0010('0x55')][_0x0010('0x65')][_0x0010('0x66')]})[_0x0010('0x12')](function(_0xf27ebf){if(_0xf27ebf[_0x0010('0x3f')]===0x1){return _0x522aef['id'];}else{var _0x3768f3=_[_0x0010('0x67')](_[_0x0010('0x1b')](_0xf27ebf,_0x0010('0x68')),function(_0x290eac){return _[_0x0010('0x69')](_0x26c603,_0x290eac);});if(_0x3768f3){return _0x522aef['id'];}}}));}}return BPromise[_0x0010('0x6a')](_0xd60c0c)['then'](function(_0x22d6f9){_0x251a11=_(_0x251a11)['union'](_0x22d6f9)['compact']()[_0x0010('0x6b')]();return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x24ea4f['params']['id']}})[_0x0010('0x12')](function(_0x2d2698){return db[_0x0010('0x55')][_0x0010('0x6c')](function(_0x29bd41){return _0x2d2698[_0x0010('0x5b')](_0x24ea4f[_0x0010('0x23')][_0x0010('0x51')],{'transaction':_0x29bd41})[_0x0010('0x12')](function(){if(!_[_0x0010('0x6d')](_0x251a11)){return _0x2d2698[_0x0010('0x6e')](_0x251a11,{'transaction':_0x29bd41});}})[_0x0010('0x12')](function(){_0x251a11[_0x0010('0x58')](function(_0x289a20){socket[_0x0010('0x59')](_0x0010('0x6f'),{'UserId':_0x289a20,'ChatQueueId':_0x2d2698['id']});});});});});});})[_0x0010('0x12')](respondWithStatusCode(_0x5817e1,null))['catch'](handleError(_0x5817e1,null));};exports['addAgents']=function(_0x338713,_0x2c9c35){return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x338713[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x2c9c35,null))[_0x0010('0x12')](function(_0x5682bc){if(_0x5682bc){return _0x5682bc[_0x0010('0x70')](_0x338713[_0x0010('0x32')][_0x0010('0x51')],_[_0x0010('0x71')](_0x338713['body'],[_0x0010('0x51'),'id'])||{})['spread'](function(_0x13323b){for(var _0x19aeb5=0x0;_0x19aeb5<_0x338713[_0x0010('0x32')][_0x0010('0x51')][_0x0010('0x3f')];_0x19aeb5+=0x1){socket[_0x0010('0x59')](_0x0010('0x5a'),{'UserId':Number(_0x338713[_0x0010('0x32')][_0x0010('0x51')][_0x19aeb5]),'ChatQueueId':Number(_0x338713[_0x0010('0x28')]['id'])});}return _0x13323b;});}})[_0x0010('0x12')](respondWithResult(_0x2c9c35,null))[_0x0010('0x26')](handleError(_0x2c9c35,null));};exports[_0x0010('0x6e')]=function(_0x2208ed,_0x2b063a){return db[_0x0010('0x1c')][_0x0010('0x37')]({'where':{'id':_0x2208ed[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x2b063a,null))['then'](function(_0x9e41f){if(_0x9e41f){return _0x9e41f[_0x0010('0x6e')](_0x2208ed[_0x0010('0x23')][_0x0010('0x51')])[_0x0010('0x12')](function(){if(_[_0x0010('0x72')](_0x2208ed[_0x0010('0x23')][_0x0010('0x51')])){for(var _0x3be8da=0x0;_0x3be8da<_0x2208ed[_0x0010('0x23')][_0x0010('0x51')]['length'];_0x3be8da+=0x1){socket['emit'](_0x0010('0x6f'),{'UserId':Number(_0x2208ed[_0x0010('0x23')][_0x0010('0x51')][_0x3be8da]),'ChatQueueId':Number(_0x2208ed[_0x0010('0x28')]['id'])});}}else{socket[_0x0010('0x59')](_0x0010('0x6f'),{'UserId':Number(_0x2208ed[_0x0010('0x23')]['ids']),'ChatQueueId':Number(_0x2208ed[_0x0010('0x28')]['id'])});}});}})[_0x0010('0x12')](respondWithStatusCode(_0x2b063a,null))[_0x0010('0x26')](handleError(_0x2b063a,null));};exports[_0x0010('0x73')]=function(_0x558e28,_0x1fc55b){var _0x19ffe4={};var _0x4eb1ea={};var _0x52f35d;var _0x4931b7;return db[_0x0010('0x1c')][_0x0010('0x3c')]({'where':{'id':_0x558e28[_0x0010('0x28')]['id']}})[_0x0010('0x12')](handleEntityNotFound(_0x1fc55b,null))[_0x0010('0x12')](function(_0x2b5ec6){if(_0x2b5ec6){_0x52f35d=_0x2b5ec6;_0x4eb1ea[_0x0010('0x2b')]=_['keys'](db[_0x0010('0x44')][_0x0010('0x1d')]);_0x4eb1ea[_0x0010('0x23')]=_[_0x0010('0x29')](_0x558e28[_0x0010('0x23')]);_0x4eb1ea['filters']=_[_0x0010('0x2a')](_0x4eb1ea['model'],_0x4eb1ea['query']);_0x19ffe4[_0x0010('0x2d')]=_[_0x0010('0x2a')](_0x4eb1ea[_0x0010('0x2b')],qs[_0x0010('0x2c')](_0x558e28[_0x0010('0x23')][_0x0010('0x2c')]));_0x19ffe4[_0x0010('0x2d')]=_0x19ffe4[_0x0010('0x2d')][_0x0010('0x3f')]?_0x19ffe4[_0x0010('0x2d')]:_0x4eb1ea[_0x0010('0x2b')];_0x19ffe4[_0x0010('0x40')]=qs[_0x0010('0x41')](_0x558e28['query'][_0x0010('0x41')]);_0x19ffe4[_0x0010('0x21')]=qs[_0x0010('0x3e')](_[_0x0010('0x42')](_0x558e28[_0x0010('0x23')],_0x4eb1ea[_0x0010('0x3e')]));if(_0x558e28[_0x0010('0x23')]['filter']){_0x19ffe4['where']=_['merge'](_0x19ffe4['where'],{'$or':_['map'](_0x19ffe4[_0x0010('0x2d')],function(_0x21ff4f){var _0x1a891a={};_0x1a891a[_0x21ff4f]={'$like':'%'+_0x558e28[_0x0010('0x23')][_0x0010('0x43')]+'%'};return _0x1a891a;})});}_0x19ffe4=_[_0x0010('0x2f')]({},_0x19ffe4,_0x558e28['options']);return _0x52f35d[_0x0010('0x73')](_0x19ffe4);}})['then'](function(_0x1563df){if(_0x1563df){_0x4931b7=_0x1563df[_0x0010('0x3f')];if(!_0x558e28[_0x0010('0x23')][_0x0010('0x74')](_0x0010('0x4f'))){_0x19ffe4[_0x0010('0xd')]=qs[_0x0010('0xd')](_0x558e28[_0x0010('0x23')][_0x0010('0xd')]);_0x19ffe4[_0x0010('0xb')]=qs['offset'](_0x558e28[_0x0010('0x23')][_0x0010('0xb')]);}return _0x52f35d['getAgents'](_0x19ffe4);}})['then'](function(_0x24642c){if(_0x24642c){return _0x24642c?{'count':_0x4931b7,'rows':_0x24642c}:null;}})[_0x0010('0x12')](respondWithResult(_0x1fc55b,null))[_0x0010('0x26')](handleError(_0x1fc55b,null));};
\ No newline at end of file
+var _0x45d8=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','nolimit','order','sort','ChatQueueId','filter','options','User','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','forEach','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','pick','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','getOptions','where','include','query','findAll','rows','catch','show','params','keys','intersection','model','attributes','fields','length','merge','create'];(function(_0x4d6793,_0x16e290){var _0xa7d29d=function(_0x3dc71e){while(--_0x3dc71e){_0x4d6793['push'](_0x4d6793['shift']());}};_0xa7d29d(++_0x16e290);}(_0x45d8,0x1a3));var _0x845d=function(_0x546ab6,_0x357f23){_0x546ab6=_0x546ab6-0x0;var _0x3952ca=_0x45d8[_0x546ab6];return _0x3952ca;};'use strict';var BPromise=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var _=require(_0x845d('0x2'));var squel=require(_0x845d('0x3'));var Redis=require('ioredis');var qs=require(_0x845d('0x4'));var logger=require(_0x845d('0x5'))(_0x845d('0x6'));var config=require('../../config/environment');var db=require(_0x845d('0x7'))['db'];config[_0x845d('0x8')]=_[_0x845d('0x9')](config[_0x845d('0x8')],{'host':_0x845d('0xa'),'port':0x18eb});var socket=require(_0x845d('0xb'))(new Redis(config[_0x845d('0x8')]));require(_0x845d('0xc'))['register'](socket);function respondWithStatusCode(_0xb88ca2,_0x4c639c){_0x4c639c=_0x4c639c||0xcc;return function(_0x36856b){if(_0x36856b){return _0xb88ca2[_0x845d('0xd')](_0x4c639c);}return _0xb88ca2[_0x845d('0xe')](_0x4c639c)[_0x845d('0xf')]();};}function respondWithResult(_0x254db7,_0x4ce2ce){_0x4ce2ce=_0x4ce2ce||0xc8;return function(_0x57d043){if(_0x57d043){return _0x254db7[_0x845d('0xe')](_0x4ce2ce)[_0x845d('0x10')](_0x57d043);}};}function respondWithFilteredResult(_0x5a9e17,_0x1f6f52){return function(_0x2f7dc7){if(_0x2f7dc7){var _0x436a7c=typeof _0x1f6f52[_0x845d('0x11')]==='undefined'&&typeof _0x1f6f52[_0x845d('0x12')]===_0x845d('0x13');var _0x48a472=_0x2f7dc7[_0x845d('0x14')];var _0x32056b=_0x436a7c?0x0:_0x1f6f52[_0x845d('0x11')];var _0x3c2546=_0x436a7c?_0x2f7dc7['count']:_0x1f6f52['offset']+_0x1f6f52[_0x845d('0x12')];var _0x4b0a52;if(_0x3c2546>=_0x48a472){_0x3c2546=_0x48a472;_0x4b0a52=0xc8;}else{_0x4b0a52=0xce;}_0x5a9e17['status'](_0x4b0a52);return _0x5a9e17['set'](_0x845d('0x15'),_0x32056b+'-'+_0x3c2546+'/'+_0x48a472)[_0x845d('0x10')](_0x2f7dc7);}return null;};}function saveUpdates(_0x206755){return function(_0x670c38){if(_0x670c38){return _0x670c38[_0x845d('0x16')](_0x206755)[_0x845d('0x17')](function(_0x3fb2be){return _0x3fb2be;});}return null;};}function removeEntity(_0x2aa07c){return function(_0x25524e){if(_0x25524e){return _0x25524e[_0x845d('0x18')]()[_0x845d('0x17')](function(){var _0x56f595=_0x25524e[_0x845d('0x19')]({'plain':!![]});var _0x6e706='ChatQueues';return db[_0x845d('0x1a')][_0x845d('0x18')]({'where':{'type':_0x6e706,'resourceId':_0x56f595['id']}})['then'](function(){return _0x25524e;});})['then'](function(){_0x2aa07c[_0x845d('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519c87){return function(_0x29a386){if(!_0x29a386){_0x519c87[_0x845d('0xd')](0x194);}return _0x29a386;};}function handleError(_0x4129a6,_0x1e1f81){_0x1e1f81=_0x1e1f81||0x1f4;return function(_0x1db6bd){logger[_0x845d('0x1b')](_0x1db6bd[_0x845d('0x1c')]);if(_0x1db6bd[_0x845d('0x1d')]){delete _0x1db6bd[_0x845d('0x1d')];}_0x4129a6['status'](_0x1e1f81)['send'](_0x1db6bd);};}exports[_0x845d('0x1e')]=function(_0x2519f1,_0x4f2d56){var _0x1741ad={};var _0x4cfd33={'count':0x0,'rows':[]};var _0x55161b=_[_0x845d('0x1f')](db[_0x845d('0x20')][_0x845d('0x21')],function(_0x48ec1e){return{'name':_0x48ec1e[_0x845d('0x22')],'type':_0x48ec1e[_0x845d('0x23')]['key']};});_0x1741ad=qs[_0x845d('0x24')](_0x55161b,_0x2519f1);var _0x3b6544={'where':_0x1741ad[_0x845d('0x25')]};return db[_0x845d('0x20')][_0x845d('0x14')](_0x3b6544)[_0x845d('0x17')](function(_0x462993){_0x4cfd33[_0x845d('0x14')]=_0x462993;_0x1741ad[_0x845d('0x26')]=qs[_0x845d('0x26')](_0x2519f1[_0x845d('0x27')]);return db[_0x845d('0x20')][_0x845d('0x28')](_0x1741ad);})['then'](function(_0x22a9ab){_0x4cfd33[_0x845d('0x29')]=_0x22a9ab;return _0x4cfd33;})['then'](respondWithFilteredResult(_0x4f2d56,_0x1741ad))[_0x845d('0x2a')](handleError(_0x4f2d56,null));};exports[_0x845d('0x2b')]=function(_0x176131,_0x31a547){var _0x3dfb4e={'raw':!![],'where':{'id':_0x176131[_0x845d('0x2c')]['id']}},_0x4152d7={};_0x4152d7['model']=_[_0x845d('0x2d')](db['ChatQueue'][_0x845d('0x21')]);_0x4152d7[_0x845d('0x27')]=_[_0x845d('0x2d')](_0x176131[_0x845d('0x27')]);_0x4152d7['filters']=_[_0x845d('0x2e')](_0x4152d7[_0x845d('0x2f')],_0x4152d7[_0x845d('0x27')]);_0x3dfb4e[_0x845d('0x30')]=_[_0x845d('0x2e')](_0x4152d7[_0x845d('0x2f')],qs[_0x845d('0x31')](_0x176131[_0x845d('0x27')][_0x845d('0x31')]));_0x3dfb4e[_0x845d('0x30')]=_0x3dfb4e[_0x845d('0x30')][_0x845d('0x32')]?_0x3dfb4e[_0x845d('0x30')]:_0x4152d7[_0x845d('0x2f')];if(_0x176131[_0x845d('0x27')]['includeAll']){_0x3dfb4e[_0x845d('0x26')]=[{'all':!![]}];}_0x3dfb4e=_[_0x845d('0x33')]({},_0x3dfb4e,_0x176131['options']);return db['ChatQueue']['find'](_0x3dfb4e)[_0x845d('0x17')](handleEntityNotFound(_0x31a547,null))['then'](respondWithResult(_0x31a547,null))[_0x845d('0x2a')](handleError(_0x31a547,null));};exports[_0x845d('0x34')]=function(_0x1d06de,_0xe408e6){return db[_0x845d('0x20')]['create'](_0x1d06de[_0x845d('0x35')],{})[_0x845d('0x17')](function(_0x269e9e){var _0x4e397e=_0x1d06de[_0x845d('0x36')][_0x845d('0x19')]({'plain':!![]});if(!_0x4e397e)throw new Error(_0x845d('0x37'));if(_0x4e397e[_0x845d('0x38')]===_0x845d('0x36')){var _0x257296=_0x269e9e[_0x845d('0x19')]({'plain':!![]});var _0x2547c8=_0x845d('0x39');return db['UserProfileSection'][_0x845d('0x3a')]({'where':{'name':_0x2547c8,'userProfileId':_0x4e397e['userProfileId']},'raw':!![]})[_0x845d('0x17')](function(_0xd14f2e){if(_0xd14f2e&&_0xd14f2e['autoAssociation']===0x0){return db[_0x845d('0x1a')][_0x845d('0x34')]({'name':_0x257296[_0x845d('0x1d')],'resourceId':_0x257296['id'],'type':_0xd14f2e[_0x845d('0x1d')],'sectionId':_0xd14f2e['id']},{})[_0x845d('0x17')](function(){return _0x269e9e;});}else{return _0x269e9e;}})[_0x845d('0x2a')](function(_0x25a98a){logger['error'](_0x845d('0x3b'),_0x25a98a);throw _0x25a98a;});}return _0x269e9e;})[_0x845d('0x17')](respondWithResult(_0xe408e6,0xc9))['catch'](handleError(_0xe408e6,null));};exports[_0x845d('0x16')]=function(_0x2aa226,_0x2ebdc2){if(_0x2aa226[_0x845d('0x35')]['id']){delete _0x2aa226[_0x845d('0x35')]['id'];}return db['ChatQueue'][_0x845d('0x3a')]({'where':{'id':_0x2aa226[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](handleEntityNotFound(_0x2ebdc2,null))[_0x845d('0x17')](saveUpdates(_0x2aa226[_0x845d('0x35')],null))[_0x845d('0x17')](respondWithResult(_0x2ebdc2,null))[_0x845d('0x2a')](handleError(_0x2ebdc2,null));};exports[_0x845d('0x18')]=function(_0xd6cb40,_0x459fdd){return db[_0x845d('0x20')][_0x845d('0x3a')]({'where':{'id':_0xd6cb40[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](handleEntityNotFound(_0x459fdd,null))['then'](removeEntity(_0x459fdd,null))[_0x845d('0x2a')](handleError(_0x459fdd,null));};exports[_0x845d('0x3c')]=function(_0x42855a,_0x4519fd){return db['ChatQueue'][_0x845d('0x3c')]()['then'](respondWithResult(_0x4519fd,null))[_0x845d('0x2a')](handleError(_0x4519fd,null));};exports[_0x845d('0x3d')]=function(_0x8b2ae3,_0x153a42){var _0x1415c9={'raw':!![],'where':{}},_0xdb4290={},_0x2d32b4;return db[_0x845d('0x20')][_0x845d('0x3e')]({'where':{'id':_0x8b2ae3[_0x845d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x153a42,null))[_0x845d('0x17')](function(_0x1abc27){if(_0x1abc27){_0x2d32b4=_0x1abc27['get']({'plain':!![]});_0xdb4290[_0x845d('0x2f')]=_[_0x845d('0x2d')](db[_0x845d('0x3f')][_0x845d('0x21')]);_0xdb4290[_0x845d('0x27')]=_[_0x845d('0x2d')](_0x8b2ae3[_0x845d('0x27')]);_0xdb4290[_0x845d('0x40')]=_[_0x845d('0x2e')](_0xdb4290[_0x845d('0x2f')],_0xdb4290[_0x845d('0x27')]);_0x1415c9['attributes']=_['intersection'](_0xdb4290['model'],qs[_0x845d('0x31')](_0x8b2ae3[_0x845d('0x27')][_0x845d('0x31')]));_0x1415c9['attributes']=_0x1415c9[_0x845d('0x30')][_0x845d('0x32')]?_0x1415c9['attributes']:_0xdb4290['model'];if(!_0x8b2ae3[_0x845d('0x27')]['hasOwnProperty'](_0x845d('0x41'))){_0x1415c9[_0x845d('0x12')]=qs[_0x845d('0x12')](_0x8b2ae3[_0x845d('0x27')]['limit']);_0x1415c9[_0x845d('0x11')]=qs[_0x845d('0x11')](_0x8b2ae3['query']['offset']);}_0x1415c9[_0x845d('0x42')]=qs[_0x845d('0x43')](_0x8b2ae3[_0x845d('0x27')][_0x845d('0x43')]);_0x1415c9['where']=qs['filters'](_['pick'](_0x8b2ae3['query'],_0xdb4290[_0x845d('0x40')]));_0x1415c9['where'][_0x845d('0x44')]=_0x1abc27['id'];if(_0x8b2ae3[_0x845d('0x27')]['filter']){_0x1415c9[_0x845d('0x25')]=_[_0x845d('0x33')](_0x1415c9['where'],{'$or':_[_0x845d('0x1f')](_0x1415c9[_0x845d('0x30')],function(_0x26a56a){var _0x347b70={};_0x347b70[_0x26a56a]={'$like':'%'+_0x8b2ae3['query'][_0x845d('0x45')]+'%'};return _0x347b70;})});}_0x1415c9=_[_0x845d('0x33')]({},_0x1415c9,_0x8b2ae3[_0x845d('0x46')]);return db[_0x845d('0x3f')]['findAll'](_0x1415c9);}})[_0x845d('0x17')](function(_0x483d92){if(_0x483d92){return db[_0x845d('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x483d92,'UserId'),'role':'agent'},'attributes':['id',_0x845d('0x1d'),_0x845d('0x48'),'updatedAt',_0x845d('0x49')]});}})[_0x845d('0x17')](function(_0x2fe584){if(_0x2fe584){return{'count':_0x2fe584[_0x845d('0x14')],'rows':_[_0x845d('0x1f')](_0x2fe584[_0x845d('0x29')],function(_0x43e18a){return{'membername':_0x43e18a['name'],'UserId':_0x43e18a['id'],'queue_name':_0x2d32b4[_0x845d('0x1d')],'ChatQueueId':_0x2d32b4['id'],'interface':util['format'](_0x845d('0x4a'),_0x845d('0x4b'),_0x43e18a['name']),'penalty':0x0,'paused':_0x43e18a['chatPause'],'createdAt':_0x43e18a[_0x845d('0x49')],'updatedAt':_0x43e18a[_0x845d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x153a42,_0x1415c9))[_0x845d('0x2a')](handleError(_0x153a42,null));};exports[_0x845d('0x4d')]=function(_0x2199dc,_0x24aa11){var _0x5dc3d4={};var _0x4a1c1b={};var _0x345d38;var _0x35a0c0;return db[_0x845d('0x20')][_0x845d('0x3e')]({'where':{'id':_0x2199dc[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](handleEntityNotFound(_0x24aa11,null))[_0x845d('0x17')](function(_0x29eec4){if(_0x29eec4){_0x345d38=_0x29eec4;_0x4a1c1b[_0x845d('0x2f')]=_['keys'](db['Team'][_0x845d('0x21')]);_0x4a1c1b['query']=_[_0x845d('0x2d')](_0x2199dc[_0x845d('0x27')]);_0x4a1c1b['filters']=_[_0x845d('0x2e')](_0x4a1c1b[_0x845d('0x2f')],_0x4a1c1b['query']);_0x5dc3d4['attributes']=_[_0x845d('0x2e')](_0x4a1c1b[_0x845d('0x2f')],qs[_0x845d('0x31')](_0x2199dc[_0x845d('0x27')]['fields']));_0x5dc3d4[_0x845d('0x30')]=_0x5dc3d4[_0x845d('0x30')][_0x845d('0x32')]?_0x5dc3d4[_0x845d('0x30')]:_0x4a1c1b[_0x845d('0x2f')];_0x5dc3d4[_0x845d('0x42')]=qs[_0x845d('0x43')](_0x2199dc[_0x845d('0x27')]['sort']);_0x5dc3d4['where']=qs[_0x845d('0x40')](_['pick'](_0x2199dc[_0x845d('0x27')],_0x4a1c1b[_0x845d('0x40')]));if(_0x2199dc[_0x845d('0x27')][_0x845d('0x45')]){_0x5dc3d4['where']=_[_0x845d('0x33')](_0x5dc3d4[_0x845d('0x25')],{'$or':_['map'](_0x5dc3d4[_0x845d('0x30')],function(_0x116f4c){var _0x5409a0={};_0x5409a0[_0x116f4c]={'$like':'%'+_0x2199dc[_0x845d('0x27')]['filter']+'%'};return _0x5409a0;})});}_0x5dc3d4=_[_0x845d('0x33')]({},_0x5dc3d4,_0x2199dc[_0x845d('0x46')]);return _0x345d38[_0x845d('0x4d')](_0x5dc3d4);}})['then'](function(_0x168f36){if(_0x168f36){_0x35a0c0=_0x168f36[_0x845d('0x32')];if(!_0x2199dc['query']['hasOwnProperty'](_0x845d('0x41'))){_0x5dc3d4[_0x845d('0x12')]=qs['limit'](_0x2199dc['query'][_0x845d('0x12')]);_0x5dc3d4[_0x845d('0x11')]=qs[_0x845d('0x11')](_0x2199dc[_0x845d('0x27')][_0x845d('0x11')]);}return _0x345d38[_0x845d('0x4d')](_0x5dc3d4);}})[_0x845d('0x17')](function(_0x36dc6d){if(_0x36dc6d){return _0x36dc6d?{'count':_0x35a0c0,'rows':_0x36dc6d}:null;}})[_0x845d('0x17')](respondWithResult(_0x24aa11,null))[_0x845d('0x2a')](handleError(_0x24aa11,null));};exports[_0x845d('0x4e')]=function(_0x26759e,_0x14dfbb){var _0x3d88a9=_0x26759e['body'][_0x845d('0x4f')];return db[_0x845d('0x50')][_0x845d('0x28')]({'where':{'id':_0x3d88a9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x845d('0x51'),'attributes':['id',_0x845d('0x1d'),_0x845d('0x52'),_0x845d('0x53'),'interface'],'raw':!![]}]})['then'](function(_0x44210){if(_0x44210){var _0x1a193d=_[_0x845d('0x54')](_0x44210,function(_0x481b0d){var _0x50c6ef=_0x481b0d[_0x845d('0x19')]({'plain':!![]});return _0x50c6ef[_0x845d('0x51')];});return db[_0x845d('0x20')]['find']({'where':{'id':_0x26759e[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](function(_0x46fa6c){return db[_0x845d('0x55')][_0x845d('0x56')](function(_0x622690){return _0x46fa6c[_0x845d('0x4e')](_0x3d88a9,{'transaction':_0x622690})[_0x845d('0x17')](function(){return BPromise[_0x845d('0x57')](_0x1a193d,function(_0x3f4ab4){return db[_0x845d('0x3f')][_0x845d('0x58')]({'where':{'UserId':_0x3f4ab4['id'],'ChatQueueId':_0x26759e['params']['id']},'transaction':_0x622690});});})['then'](function(){_0x1a193d['forEach'](function(_0x446e10){socket['emit'](_0x845d('0x59'),{'UserId':_0x446e10['id'],'ChatQueueId':_0x46fa6c['id']});});});});});}})[_0x845d('0x17')](respondWithStatusCode(_0x14dfbb,null))[_0x845d('0x2a')](handleError(_0x14dfbb,null));};exports[_0x845d('0x5a')]=function(_0xf4746,_0x1159f8){return db['Team'][_0x845d('0x28')]({'where':{'id':_0xf4746['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x845d('0x47')],'as':_0x845d('0x51'),'attributes':['id'],'raw':!![]}]})[_0x845d('0x17')](handleEntityNotFound(_0x1159f8,null))[_0x845d('0x17')](function(_0x39cf65){var _0x35ebc6=_[_0x845d('0x1f')](_0x39cf65,'id');var _0x146517=[];var _0x5d63bc=[];var _0x176b96=squel['select']();_0x176b96[_0x845d('0x5b')](_0x845d('0x5c'))[_0x845d('0x5d')](_0x845d('0x5e'),'tq')['join']('user_has_teams','ut',_0x845d('0x5f'))[_0x845d('0x25')](_0x845d('0x60'),_0xf4746[_0x845d('0x2c')]['id']);for(var _0x59766f=0x0;_0x59766f<_0x39cf65[_0x845d('0x32')];_0x59766f+=0x1){let _0x14a006=_0x39cf65[_0x59766f];for(var _0x40ec33=0x0;_0x40ec33<_0x14a006['Agents'][_0x845d('0x32')];_0x40ec33+=0x1){let _0x5cda8d=_0x14a006['Agents'][_0x40ec33];var _0x136ade=_0x176b96[_0x845d('0x61')]();_0x136ade[_0x845d('0x25')](_0x845d('0x62'),_0x5cda8d['id']);_0x5d63bc[_0x845d('0x63')](db['sequelize'][_0x845d('0x27')](_0x136ade[_0x845d('0x64')](),{'type':db[_0x845d('0x55')]['QueryTypes'][_0x845d('0x65')]})[_0x845d('0x17')](function(_0x761bbf){if(_0x761bbf[_0x845d('0x32')]===0x1){return _0x5cda8d['id'];}else{var _0x3575a2=_['every'](_[_0x845d('0x1f')](_0x761bbf,_0x845d('0x66')),function(_0x31901b){return _[_0x845d('0x67')](_0x35ebc6,_0x31901b);});if(_0x3575a2){return _0x5cda8d['id'];}}}));}}return BPromise[_0x845d('0x68')](_0x5d63bc)[_0x845d('0x17')](function(_0x472708){_0x146517=_(_0x146517)[_0x845d('0x69')](_0x472708)[_0x845d('0x6a')]()[_0x845d('0x6b')]();return db['ChatQueue']['find']({'where':{'id':_0xf4746[_0x845d('0x2c')]['id']}})['then'](function(_0x1d13bf){return db[_0x845d('0x55')][_0x845d('0x56')](function(_0x267858){return _0x1d13bf[_0x845d('0x5a')](_0xf4746[_0x845d('0x27')][_0x845d('0x4f')],{'transaction':_0x267858})[_0x845d('0x17')](function(){if(!_[_0x845d('0x6c')](_0x146517)){return _0x1d13bf['removeAgents'](_0x146517,{'transaction':_0x267858});}})[_0x845d('0x17')](function(){_0x146517[_0x845d('0x6d')](function(_0x569a13){socket[_0x845d('0x6e')](_0x845d('0x6f'),{'UserId':_0x569a13,'ChatQueueId':_0x1d13bf['id']});});});});});});})[_0x845d('0x17')](respondWithStatusCode(_0x1159f8,null))[_0x845d('0x2a')](handleError(_0x1159f8,null));};exports[_0x845d('0x70')]=function(_0x276c50,_0x5cca2c){return db['ChatQueue'][_0x845d('0x3a')]({'where':{'id':_0x276c50[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](handleEntityNotFound(_0x5cca2c,null))[_0x845d('0x17')](function(_0x3dec68){if(_0x3dec68){return _0x3dec68[_0x845d('0x70')](_0x276c50[_0x845d('0x35')]['ids'],_[_0x845d('0x71')](_0x276c50[_0x845d('0x35')],[_0x845d('0x4f'),'id'])||{})[_0x845d('0x72')](function(_0x2ecd2e){for(var _0x53c471=0x0;_0x53c471<_0x276c50[_0x845d('0x35')][_0x845d('0x4f')][_0x845d('0x32')];_0x53c471+=0x1){socket[_0x845d('0x6e')](_0x845d('0x59'),{'UserId':Number(_0x276c50['body'][_0x845d('0x4f')][_0x53c471]),'ChatQueueId':Number(_0x276c50[_0x845d('0x2c')]['id'])});}return _0x2ecd2e;});}})['then'](respondWithResult(_0x5cca2c,null))[_0x845d('0x2a')](handleError(_0x5cca2c,null));};exports[_0x845d('0x73')]=function(_0x1acb7d,_0x24e54b){return db[_0x845d('0x20')][_0x845d('0x3a')]({'where':{'id':_0x1acb7d[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](handleEntityNotFound(_0x24e54b,null))[_0x845d('0x17')](function(_0x52efe4){if(_0x52efe4){return _0x52efe4[_0x845d('0x73')](_0x1acb7d['query']['ids'])[_0x845d('0x17')](function(){if(_['isArray'](_0x1acb7d[_0x845d('0x27')]['ids'])){for(var _0x578c8d=0x0;_0x578c8d<_0x1acb7d['query']['ids'][_0x845d('0x32')];_0x578c8d+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x1acb7d[_0x845d('0x27')][_0x845d('0x4f')][_0x578c8d]),'ChatQueueId':Number(_0x1acb7d['params']['id'])});}}else{socket[_0x845d('0x6e')](_0x845d('0x6f'),{'UserId':Number(_0x1acb7d[_0x845d('0x27')][_0x845d('0x4f')]),'ChatQueueId':Number(_0x1acb7d[_0x845d('0x2c')]['id'])});}});}})[_0x845d('0x17')](respondWithStatusCode(_0x24e54b,null))[_0x845d('0x2a')](handleError(_0x24e54b,null));};exports['getAgents']=function(_0x8fc45d,_0xe76ff8){var _0x25fd90={};var _0x3d7244={};var _0x13e398;var _0x5a5b67;return db[_0x845d('0x20')][_0x845d('0x3e')]({'where':{'id':_0x8fc45d[_0x845d('0x2c')]['id']}})[_0x845d('0x17')](handleEntityNotFound(_0xe76ff8,null))[_0x845d('0x17')](function(_0x15abe0){if(_0x15abe0){_0x13e398=_0x15abe0;_0x3d7244[_0x845d('0x2f')]=_['keys'](db['User'][_0x845d('0x21')]);_0x3d7244[_0x845d('0x27')]=_[_0x845d('0x2d')](_0x8fc45d[_0x845d('0x27')]);_0x3d7244['filters']=_[_0x845d('0x2e')](_0x3d7244[_0x845d('0x2f')],_0x3d7244[_0x845d('0x27')]);_0x25fd90[_0x845d('0x30')]=_[_0x845d('0x2e')](_0x3d7244[_0x845d('0x2f')],qs['fields'](_0x8fc45d[_0x845d('0x27')][_0x845d('0x31')]));_0x25fd90[_0x845d('0x30')]=_0x25fd90['attributes'][_0x845d('0x32')]?_0x25fd90[_0x845d('0x30')]:_0x3d7244[_0x845d('0x2f')];_0x25fd90[_0x845d('0x42')]=qs[_0x845d('0x43')](_0x8fc45d['query']['sort']);_0x25fd90['where']=qs['filters'](_[_0x845d('0x74')](_0x8fc45d[_0x845d('0x27')],_0x3d7244[_0x845d('0x40')]));if(_0x8fc45d[_0x845d('0x27')][_0x845d('0x45')]){_0x25fd90['where']=_[_0x845d('0x33')](_0x25fd90[_0x845d('0x25')],{'$or':_[_0x845d('0x1f')](_0x25fd90[_0x845d('0x30')],function(_0x2ae83a){var _0x17996c={};_0x17996c[_0x2ae83a]={'$like':'%'+_0x8fc45d[_0x845d('0x27')]['filter']+'%'};return _0x17996c;})});}_0x25fd90=_['merge']({},_0x25fd90,_0x8fc45d[_0x845d('0x46')]);return _0x13e398[_0x845d('0x75')](_0x25fd90);}})['then'](function(_0x673b48){if(_0x673b48){_0x5a5b67=_0x673b48['length'];if(!_0x8fc45d[_0x845d('0x27')]['hasOwnProperty'](_0x845d('0x41'))){_0x25fd90['limit']=qs[_0x845d('0x12')](_0x8fc45d['query'][_0x845d('0x12')]);_0x25fd90[_0x845d('0x11')]=qs['offset'](_0x8fc45d[_0x845d('0x27')][_0x845d('0x11')]);}return _0x13e398[_0x845d('0x75')](_0x25fd90);}})[_0x845d('0x17')](function(_0x367f74){if(_0x367f74){return _0x367f74?{'count':_0x5a5b67,'rows':_0x367f74}:null;}})[_0x845d('0x17')](respondWithResult(_0xe76ff8,null))[_0x845d('0x2a')](handleError(_0xe76ff8,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc726=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x2dd62d,_0x128ccd){var _0x18e1a5=function(_0x3de31){while(--_0x3de31){_0x2dd62d['push'](_0x2dd62d['shift']());}};_0x18e1a5(++_0x128ccd);}(_0xc726,0x185));var _0x6c72=function(_0x397ec9,_0x384f51){_0x397ec9=_0x397ec9-0x0;var _0x381635=_0xc726[_0x397ec9];return _0x381635;};'use strict';var EventEmitter=require(_0x6c72('0x0'));var ChatQueue=require(_0x6c72('0x1'))['db'][_0x6c72('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6c72('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6c72('0x4')};function emitEvent(_0x1a3f1d){return function(_0x553da1,_0x16702a,_0x1fb17d){ChatQueueEvents[_0x6c72('0x5')](_0x1a3f1d+':'+_0x553da1['id'],_0x553da1);ChatQueueEvents[_0x6c72('0x5')](_0x1a3f1d,_0x553da1);_0x1fb17d(null);};}for(var e in events){if(events[_0x6c72('0x6')](e)){var event=events[e];ChatQueue[_0x6c72('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xb20b=['emit','hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x12c3ce,_0x1d248e){var _0x2b06a7=function(_0x3808b9){while(--_0x3808b9){_0x12c3ce['push'](_0x12c3ce['shift']());}};_0x2b06a7(++_0x1d248e);}(_0xb20b,0x93));var _0xbb20=function(_0x2faa5e,_0x1dd1a1){_0x2faa5e=_0x2faa5e-0x0;var _0x4d7c7c=_0xb20b[_0x2faa5e];return _0x4d7c7c;};'use strict';var EventEmitter=require(_0xbb20('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb20('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb20('0x2')](0x0);var events={'afterCreate':_0xbb20('0x3'),'afterUpdate':_0xbb20('0x4'),'afterDestroy':_0xbb20('0x5')};function emitEvent(_0x184b1c){return function(_0x1177a,_0x21017a,_0x4eeb3f){ChatQueueEvents['emit'](_0x184b1c+':'+_0x1177a['id'],_0x1177a);ChatQueueEvents[_0xbb20('0x6')](_0x184b1c,_0x1177a);_0x4eeb3f(null);};}for(var e in events){if(events[_0xbb20('0x7')](e)){var event=events[e];ChatQueue[_0xbb20('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3481=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger'];(function(_0xd7226b,_0x5d5296){var _0x297d39=function(_0x68fb41){while(--_0x68fb41){_0xd7226b['push'](_0xd7226b['shift']());}};_0x297d39(++_0x5d5296);}(_0x3481,0x81));var _0x1348=function(_0x1a797c,_0x45d3a6){_0x1a797c=_0x1a797c-0x0;var _0x1b35d5=_0x3481[_0x1a797c];return _0x1b35d5;};'use strict';var _=require(_0x1348('0x0'));var util=require(_0x1348('0x1'));var logger=require(_0x1348('0x2'))('api');var moment=require(_0x1348('0x3'));var BPromise=require(_0x1348('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1348('0x5'));var rimraf=require(_0x1348('0x6'));var config=require(_0x1348('0x7'));var attributes=require(_0x1348('0x8'));module[_0x1348('0x9')]=function(_0x657a9c,_0x15d0fd){return _0x657a9c[_0x1348('0xa')](_0x1348('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2feb=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2feb,0x81));var _0xb2fe=function(_0x3957dc,_0x525687){_0x3957dc=_0x3957dc-0x0;var _0x107bc4=_0x2feb[_0x3957dc];return _0x107bc4;};'use strict';var _=require(_0xb2fe('0x0'));var util=require(_0xb2fe('0x1'));var logger=require(_0xb2fe('0x2'))(_0xb2fe('0x3'));var moment=require('moment');var BPromise=require(_0xb2fe('0x4'));var rp=require(_0xb2fe('0x5'));var fs=require('fs');var path=require(_0xb2fe('0x6'));var rimraf=require(_0xb2fe('0x7'));var config=require(_0xb2fe('0x8'));var attributes=require(_0xb2fe('0x9'));module['exports']=function(_0x5c06bd,_0x1b51d4){return _0x5c06bd['define'](_0xb2fe('0xa'),attributes,{'tableName':_0xb2fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5cb4=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','ShowChatQueue','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9f46f5,_0xf4cc8){var _0x121a01=function(_0x531bb0){while(--_0x531bb0){_0x9f46f5['push'](_0x9f46f5['shift']());}};_0x121a01(++_0xf4cc8);}(_0x5cb4,0xc6));var _0x45cb=function(_0x3be7d4,_0x2a412f){_0x3be7d4=_0x3be7d4-0x0;var _0x49acbc=_0x5cb4[_0x3be7d4];return _0x49acbc;};'use strict';var _=require(_0x45cb('0x0'));var util=require('util');var moment=require(_0x45cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45cb('0x2'));var db=require(_0x45cb('0x3'))['db'];var utils=require(_0x45cb('0x4'));var logger=require(_0x45cb('0x5'))(_0x45cb('0x6'));var config=require(_0x45cb('0x7'));var jayson=require(_0x45cb('0x8'));var client=jayson[_0x45cb('0x9')][_0x45cb('0xa')]({'port':0x232a});config[_0x45cb('0xb')]=_[_0x45cb('0xc')](config[_0x45cb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x45cb('0xd'))(new Redis(config[_0x45cb('0xb')]));require(_0x45cb('0xe'))[_0x45cb('0xf')](socket);function respondWithRpcPromise(_0x27c3a4,_0x4acbcf,_0x13ed09){return new BPromise(function(_0x2a79a0,_0x2aee1a){return client[_0x45cb('0x10')](_0x27c3a4,_0x13ed09)[_0x45cb('0x11')](function(_0x178c58){logger['info'](_0x45cb('0x12'),_0x4acbcf,_0x45cb('0x13'));logger[_0x45cb('0x14')](_0x45cb('0x15'),_0x4acbcf,_0x45cb('0x13'),JSON[_0x45cb('0x16')](_0x178c58));if(_0x178c58[_0x45cb('0x17')]){if(_0x178c58['error'][_0x45cb('0x18')]===0x1f4){logger[_0x45cb('0x17')](_0x45cb('0x12'),_0x4acbcf,_0x178c58[_0x45cb('0x17')][_0x45cb('0x19')]);return _0x2aee1a(_0x178c58[_0x45cb('0x17')][_0x45cb('0x19')]);}logger[_0x45cb('0x17')](_0x45cb('0x12'),_0x4acbcf,_0x178c58['error'][_0x45cb('0x19')]);return _0x2a79a0(_0x178c58['error'][_0x45cb('0x19')]);}else{logger['info'](_0x45cb('0x12'),_0x4acbcf,_0x45cb('0x13'));_0x2a79a0(_0x178c58[_0x45cb('0x1a')]['message']);}})[_0x45cb('0x1b')](function(_0x24c2d9){logger[_0x45cb('0x17')](_0x45cb('0x12'),_0x4acbcf,_0x24c2d9);_0x2aee1a(_0x24c2d9);});});}exports['GetChatQueue']=function(_0x48f0a6){var _0x46fc46=this;return new Promise(function(_0x436aa6,_0x9efe4){return db[_0x45cb('0x1c')][_0x45cb('0x1d')]({'raw':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6['options'][_0x45cb('0x1f')]===undefined?!![]:![]:!![],'where':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6[_0x45cb('0x1e')][_0x45cb('0x20')]||null:null,'attributes':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6['options'][_0x45cb('0x21')]||null:null,'limit':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6[_0x45cb('0x1e')][_0x45cb('0x22')]||null:null,'include':_0x48f0a6[_0x45cb('0x1e')]?_0x48f0a6[_0x45cb('0x1e')][_0x45cb('0x23')]?_[_0x45cb('0x24')](_0x48f0a6['options']['include'],function(_0x2440d2){return{'model':db[_0x2440d2[_0x45cb('0x25')]],'as':_0x2440d2['as'],'attributes':_0x2440d2[_0x45cb('0x21')],'include':_0x2440d2[_0x45cb('0x23')]?_[_0x45cb('0x24')](_0x2440d2['include'],function(_0x550ebd){return{'model':db[_0x550ebd[_0x45cb('0x25')]],'as':_0x550ebd['as'],'attributes':_0x550ebd['attributes'],'include':_0x550ebd['include']?_[_0x45cb('0x24')](_0x550ebd[_0x45cb('0x23')],function(_0x84b1ec){return{'model':db[_0x84b1ec['model']],'as':_0x84b1ec['as'],'attributes':_0x84b1ec[_0x45cb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x45cb('0x11')](function(_0x31ad38){logger[_0x45cb('0x26')](_0x45cb('0x27'),_0x48f0a6);logger['debug'](_0x45cb('0x27'),_0x48f0a6,JSON[_0x45cb('0x16')](_0x31ad38));_0x436aa6(_0x31ad38);})[_0x45cb('0x1b')](function(_0x25bb3b){logger[_0x45cb('0x17')](_0x45cb('0x27'),_0x25bb3b[_0x45cb('0x19')],_0x48f0a6);_0x9efe4(_0x46fc46['error'](0x1f4,_0x25bb3b['message']));});});};exports[_0x45cb('0x28')]=function(_0x20764e){var _0x3d9a81=this;return new Promise(function(_0x395e7a,_0x404725){return db[_0x45cb('0x1c')]['find']({'raw':_0x20764e[_0x45cb('0x1e')]?_0x20764e[_0x45cb('0x1e')][_0x45cb('0x1f')]===undefined?!![]:![]:!![],'where':_0x20764e[_0x45cb('0x1e')]?_0x20764e['options'][_0x45cb('0x20')]||null:null,'attributes':_0x20764e[_0x45cb('0x1e')]?_0x20764e['options'][_0x45cb('0x21')]||null:null,'include':_0x20764e[_0x45cb('0x1e')]?_0x20764e[_0x45cb('0x1e')]['include']?_[_0x45cb('0x24')](_0x20764e['options'][_0x45cb('0x23')],function(_0x459e16){return{'model':db[_0x459e16[_0x45cb('0x25')]],'as':_0x459e16['as'],'attributes':_0x459e16[_0x45cb('0x21')],'include':_0x459e16[_0x45cb('0x23')]?_['map'](_0x459e16['include'],function(_0x2d4508){return{'model':db[_0x2d4508[_0x45cb('0x25')]],'as':_0x2d4508['as'],'attributes':_0x2d4508['attributes'],'include':_0x2d4508[_0x45cb('0x23')]?_['map'](_0x2d4508[_0x45cb('0x23')],function(_0x3f26da){return{'model':db[_0x3f26da[_0x45cb('0x25')]],'as':_0x3f26da['as'],'attributes':_0x3f26da[_0x45cb('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43f5a3){logger[_0x45cb('0x26')](_0x45cb('0x28'),_0x20764e);logger['debug'](_0x45cb('0x28'),_0x20764e,JSON['stringify'](_0x43f5a3));_0x395e7a(_0x43f5a3);})[_0x45cb('0x1b')](function(_0x53dda6){logger[_0x45cb('0x17')](_0x45cb('0x28'),_0x53dda6[_0x45cb('0x19')],_0x20764e);_0x404725(_0x3d9a81[_0x45cb('0x17')](0x1f4,_0x53dda6[_0x45cb('0x19')]));});});};
\ No newline at end of file
+var _0xd237=['result','ChatQueue','options','raw','where','limit','include','map','model','attributes','then','GetChatQueue','catch','ShowChatQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x32495a,_0x131263){var _0x3f0e9c=function(_0x422db6){while(--_0x422db6){_0x32495a['push'](_0x32495a['shift']());}};_0x3f0e9c(++_0x131263);}(_0xd237,0x14f));var _0x7d23=function(_0x505cf7,_0x5982ff){_0x505cf7=_0x505cf7-0x0;var _0x3e2513=_0xd237[_0x505cf7];return _0x3e2513;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7d23('0xb')],{'host':_0x7d23('0xc'),'port':0x18eb});var socket=require(_0x7d23('0xd'))(new Redis(config[_0x7d23('0xb')]));require(_0x7d23('0xe'))[_0x7d23('0xf')](socket);function respondWithRpcPromise(_0x27dbb2,_0x2bcd72,_0x566db0){return new BPromise(function(_0x25675b,_0x4aebf8){return client[_0x7d23('0x10')](_0x27dbb2,_0x566db0)['then'](function(_0x5bd275){logger['info'](_0x7d23('0x11'),_0x2bcd72,_0x7d23('0x12'));logger[_0x7d23('0x13')](_0x7d23('0x14'),_0x2bcd72,_0x7d23('0x12'),JSON[_0x7d23('0x15')](_0x5bd275));if(_0x5bd275[_0x7d23('0x16')]){if(_0x5bd275['error']['code']===0x1f4){logger[_0x7d23('0x16')](_0x7d23('0x11'),_0x2bcd72,_0x5bd275[_0x7d23('0x16')][_0x7d23('0x17')]);return _0x4aebf8(_0x5bd275['error'][_0x7d23('0x17')]);}logger['error'](_0x7d23('0x11'),_0x2bcd72,_0x5bd275['error'][_0x7d23('0x17')]);return _0x25675b(_0x5bd275[_0x7d23('0x16')][_0x7d23('0x17')]);}else{logger[_0x7d23('0x18')](_0x7d23('0x11'),_0x2bcd72,'request\x20sent');_0x25675b(_0x5bd275[_0x7d23('0x19')][_0x7d23('0x17')]);}})['catch'](function(_0x1a65e8){logger[_0x7d23('0x16')](_0x7d23('0x11'),_0x2bcd72,_0x1a65e8);_0x4aebf8(_0x1a65e8);});});}exports['GetChatQueue']=function(_0x4efcfa){var _0x242812=this;return new Promise(function(_0x3b7005,_0x56b0ba){return db[_0x7d23('0x1a')]['findAll']({'raw':_0x4efcfa[_0x7d23('0x1b')]?_0x4efcfa['options'][_0x7d23('0x1c')]===undefined?!![]:![]:!![],'where':_0x4efcfa[_0x7d23('0x1b')]?_0x4efcfa['options'][_0x7d23('0x1d')]||null:null,'attributes':_0x4efcfa[_0x7d23('0x1b')]?_0x4efcfa[_0x7d23('0x1b')]['attributes']||null:null,'limit':_0x4efcfa[_0x7d23('0x1b')]?_0x4efcfa['options'][_0x7d23('0x1e')]||null:null,'include':_0x4efcfa[_0x7d23('0x1b')]?_0x4efcfa[_0x7d23('0x1b')][_0x7d23('0x1f')]?_[_0x7d23('0x20')](_0x4efcfa[_0x7d23('0x1b')][_0x7d23('0x1f')],function(_0x4196c7){return{'model':db[_0x4196c7[_0x7d23('0x21')]],'as':_0x4196c7['as'],'attributes':_0x4196c7[_0x7d23('0x22')],'include':_0x4196c7[_0x7d23('0x1f')]?_['map'](_0x4196c7[_0x7d23('0x1f')],function(_0x1ee7c2){return{'model':db[_0x1ee7c2[_0x7d23('0x21')]],'as':_0x1ee7c2['as'],'attributes':_0x1ee7c2[_0x7d23('0x22')],'include':_0x1ee7c2[_0x7d23('0x1f')]?_[_0x7d23('0x20')](_0x1ee7c2[_0x7d23('0x1f')],function(_0xc61f31){return{'model':db[_0xc61f31['model']],'as':_0xc61f31['as'],'attributes':_0xc61f31[_0x7d23('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7d23('0x23')](function(_0x4a5136){logger[_0x7d23('0x18')](_0x7d23('0x24'),_0x4efcfa);logger[_0x7d23('0x13')]('GetChatQueue',_0x4efcfa,JSON[_0x7d23('0x15')](_0x4a5136));_0x3b7005(_0x4a5136);})[_0x7d23('0x25')](function(_0x21bc46){logger[_0x7d23('0x16')](_0x7d23('0x24'),_0x21bc46[_0x7d23('0x17')],_0x4efcfa);_0x56b0ba(_0x242812['error'](0x1f4,_0x21bc46[_0x7d23('0x17')]));});});};exports[_0x7d23('0x26')]=function(_0x286bf1){var _0x336feb=this;return new Promise(function(_0x3aef41,_0x5351a9){return db[_0x7d23('0x1a')][_0x7d23('0x27')]({'raw':_0x286bf1['options']?_0x286bf1[_0x7d23('0x1b')][_0x7d23('0x1c')]===undefined?!![]:![]:!![],'where':_0x286bf1[_0x7d23('0x1b')]?_0x286bf1['options'][_0x7d23('0x1d')]||null:null,'attributes':_0x286bf1[_0x7d23('0x1b')]?_0x286bf1['options'][_0x7d23('0x22')]||null:null,'include':_0x286bf1[_0x7d23('0x1b')]?_0x286bf1[_0x7d23('0x1b')][_0x7d23('0x1f')]?_[_0x7d23('0x20')](_0x286bf1['options'][_0x7d23('0x1f')],function(_0x140840){return{'model':db[_0x140840['model']],'as':_0x140840['as'],'attributes':_0x140840[_0x7d23('0x22')],'include':_0x140840[_0x7d23('0x1f')]?_[_0x7d23('0x20')](_0x140840[_0x7d23('0x1f')],function(_0x4caad9){return{'model':db[_0x4caad9['model']],'as':_0x4caad9['as'],'attributes':_0x4caad9[_0x7d23('0x22')],'include':_0x4caad9['include']?_[_0x7d23('0x20')](_0x4caad9['include'],function(_0x4b8f38){return{'model':db[_0x4b8f38['model']],'as':_0x4b8f38['as'],'attributes':_0x4b8f38[_0x7d23('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7d23('0x23')](function(_0x21627a){logger[_0x7d23('0x18')](_0x7d23('0x26'),_0x286bf1);logger[_0x7d23('0x13')](_0x7d23('0x26'),_0x286bf1,JSON[_0x7d23('0x15')](_0x21627a));_0x3aef41(_0x21627a);})[_0x7d23('0x25')](function(_0x441f34){logger[_0x7d23('0x16')](_0x7d23('0x26'),_0x441f34[_0x7d23('0x17')],_0x286bf1);_0x5351a9(_0x336feb[_0x7d23('0x16')](0x1f4,_0x441f34['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x4f6c32,_0x2d8f23){var _0x24ef25=function(_0x569c69){while(--_0x569c69){_0x4f6c32['push'](_0x4f6c32['shift']());}};_0x24ef25(++_0x2d8f23);}(_0x5089,0x1bb));var _0x9508=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x5089[_0x5534fe];return _0x3d1dc2;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}};
\ No newline at end of file
+var _0x4b19=['remove','update','emit','removeListener','register','chatQueue:','./chatQueue.events'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0x4b19,0x195));var _0x94b1=function(_0x19ecb5,_0x8fc0b9){_0x19ecb5=_0x19ecb5-0x0;var _0x4f2ae3=_0x4b19[_0x19ecb5];return _0x4f2ae3;};'use strict';var ChatQueueEvents=require(_0x94b1('0x0'));var events=['save',_0x94b1('0x1'),_0x94b1('0x2')];function createListener(_0x221ab3,_0x577f52){return function(_0x1ffdb7){_0x577f52[_0x94b1('0x3')](_0x221ab3,_0x1ffdb7);};}function removeListener(_0x2240b9,_0x4f607f){return function(){ChatQueueEvents[_0x94b1('0x4')](_0x2240b9,_0x4f607f);};}exports[_0x94b1('0x5')]=function(_0x52d6c1){for(var _0x24df76=0x0,_0x110a52=events['length'];_0x24df76<_0x110a52;_0x24df76++){var _0x40c69c=events[_0x24df76];var _0x201a02=createListener(_0x94b1('0x6')+_0x40c69c,_0x52d6c1);ChatQueueEvents['on'](_0x40c69c,_0x201a02);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-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(_0x421f94,_0x1080b8){var _0x1929b8=function(_0x1452ab){while(--_0x1452ab){_0x421f94['push'](_0x421f94['shift']());}};_0x1929b8(++_0x1080b8);}(_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
+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(_0x2d3246,_0x1dc9e0){var _0x1ba0a5=function(_0x630a4a){while(--_0x630a4a){_0x2d3246['push'](_0x2d3246['shift']());}};_0x1ba0a5(++_0x1dc9e0);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb82a=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb82a,0x82));var _0xab82=function(_0x239cff,_0x4f1d14){_0x239cff=_0x239cff-0x0;var _0x582ca4=_0xb82a[_0x239cff];return _0x582ca4;};'use strict';var moment=require(_0xab82('0x0'));var Sequelize=require(_0xab82('0x1'));module[_0xab82('0x2')]={'uniqueid':{'type':Sequelize[_0xab82('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xab82('0x4')]},'acceptAt':{'type':Sequelize[_0xab82('0x4')]},'exitAt':{'type':Sequelize[_0xab82('0x4')]},'reason':{'type':Sequelize[_0xab82('0x3')]}};
\ No newline at end of file
+var _0x9abf=['moment','sequelize','exports','DATE','STRING'];(function(_0x1891df,_0x13f014){var _0x4547d6=function(_0x2b222e){while(--_0x2b222e){_0x1891df['push'](_0x1891df['shift']());}};_0x4547d6(++_0x13f014);}(_0x9abf,0xd7));var _0xf9ab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9abf[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0xf9ab('0x0'));var Sequelize=require(_0xf9ab('0x1'));module[_0xf9ab('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf9ab('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf9ab('0x3')]},'reason':{'type':Sequelize[_0xf9ab('0x4')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6337=['nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','ChatQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1bbf60,_0x1cc30c){var _0x2008a0=function(_0x51eb57){while(--_0x51eb57){_0x1bbf60['push'](_0x1bbf60['shift']());}};_0x2008a0(++_0x1cc30c);}(_0x6337,0x18a));var _0x7633=function(_0x421c55,_0x169e3a){_0x421c55=_0x421c55-0x0;var _0x589d4c=_0x6337[_0x421c55];return _0x589d4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7633('0x0'));var zipdir=require(_0x7633('0x1'));var jsonpatch=require(_0x7633('0x2'));var rp=require(_0x7633('0x3'));var moment=require(_0x7633('0x4'));var BPromise=require(_0x7633('0x5'));var Mustache=require(_0x7633('0x6'));var util=require(_0x7633('0x7'));var path=require(_0x7633('0x8'));var sox=require('sox');var csv=require(_0x7633('0x9'));var ejs=require(_0x7633('0xa'));var fs=require('fs');var fs_extra=require(_0x7633('0xb'));var _=require('lodash');var squel=require(_0x7633('0xc'));var crypto=require('crypto');var jsforce=require(_0x7633('0xd'));var deskjs=require(_0x7633('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7633('0xf'));var Papa=require('papaparse');var Redis=require(_0x7633('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7633('0x11'));var as=require(_0x7633('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7633('0x13'))(_0x7633('0x14'));var utils=require(_0x7633('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7633('0x16'));var db=require(_0x7633('0x17'))['db'];function respondWithStatusCode(_0xeef065,_0x563006){_0x563006=_0x563006||0xcc;return function(_0x2007bc){if(_0x2007bc){return _0xeef065[_0x7633('0x18')](_0x563006);}return _0xeef065[_0x7633('0x19')](_0x563006)['end']();};}function respondWithResult(_0x5654bc,_0x50e10c){_0x50e10c=_0x50e10c||0xc8;return function(_0x18abe4){if(_0x18abe4){return _0x5654bc[_0x7633('0x19')](_0x50e10c)[_0x7633('0x1a')](_0x18abe4);}};}function respondWithFilteredResult(_0x3666a1,_0x25e7d5){return function(_0x1c9957){if(_0x1c9957){var _0x47e212=typeof _0x25e7d5[_0x7633('0x1b')]===_0x7633('0x1c')&&typeof _0x25e7d5['limit']===_0x7633('0x1c');var _0x4c4e1=_0x1c9957[_0x7633('0x1d')];var _0x321043=_0x47e212?0x0:_0x25e7d5[_0x7633('0x1b')];var _0x5c7609=_0x47e212?_0x1c9957[_0x7633('0x1d')]:_0x25e7d5[_0x7633('0x1b')]+_0x25e7d5[_0x7633('0x1e')];var _0x5988d4;if(_0x5c7609>=_0x4c4e1){_0x5c7609=_0x4c4e1;_0x5988d4=0xc8;}else{_0x5988d4=0xce;}_0x3666a1[_0x7633('0x19')](_0x5988d4);return _0x3666a1[_0x7633('0x1f')](_0x7633('0x20'),_0x321043+'-'+_0x5c7609+'/'+_0x4c4e1)[_0x7633('0x1a')](_0x1c9957);}return null;};}function patchUpdates(_0x14df18){return function(_0x503d13){try{jsonpatch[_0x7633('0x21')](_0x503d13,_0x14df18,!![]);}catch(_0x1140cd){return BPromise[_0x7633('0x22')](_0x1140cd);}return _0x503d13[_0x7633('0x23')]();};}function saveUpdates(_0x1c8efc,_0x55715b){return function(_0x38a915){if(_0x38a915){return _0x38a915[_0x7633('0x24')](_0x1c8efc)[_0x7633('0x25')](function(_0x2471b7){return _0x2471b7;});}return null;};}function removeEntity(_0x531e8f,_0x135a75){return function(_0x9152df){if(_0x9152df){return _0x9152df[_0x7633('0x26')]()[_0x7633('0x25')](function(){_0x531e8f['status'](0xcc)[_0x7633('0x27')]();});}};}function handleEntityNotFound(_0x34aa76,_0x555923){return function(_0x1eb275){if(!_0x1eb275){_0x34aa76['sendStatus'](0x194);}return _0x1eb275;};}function handleError(_0x47f2cb,_0x42b4a7){_0x42b4a7=_0x42b4a7||0x1f4;return function(_0x1b2920){logger[_0x7633('0x28')](_0x1b2920[_0x7633('0x29')]);if(_0x1b2920[_0x7633('0x2a')]){delete _0x1b2920[_0x7633('0x2a')];}_0x47f2cb[_0x7633('0x19')](_0x42b4a7)['send'](_0x1b2920);};}exports[_0x7633('0x2b')]=function(_0x7b9d8b,_0x266944){var _0x3d0b0c={},_0x323e00={},_0x1abaed={'count':0x0,'rows':[]};var _0x5d79ce=_[_0x7633('0x2c')](db[_0x7633('0x2d')]['rawAttributes'],function(_0x8fcf83){return{'name':_0x8fcf83[_0x7633('0x2e')],'type':_0x8fcf83['type']['key']};});_0x323e00[_0x7633('0x2f')]=_['map'](_0x5d79ce,_0x7633('0x2a'));_0x323e00[_0x7633('0x30')]=_[_0x7633('0x31')](_0x7b9d8b[_0x7633('0x30')]);_0x323e00[_0x7633('0x32')]=_[_0x7633('0x33')](_0x323e00['model'],_0x323e00[_0x7633('0x30')]);_0x3d0b0c[_0x7633('0x34')]=_['intersection'](_0x323e00['model'],qs[_0x7633('0x35')](_0x7b9d8b['query'][_0x7633('0x35')]));_0x3d0b0c['attributes']=_0x3d0b0c['attributes'][_0x7633('0x36')]?_0x3d0b0c[_0x7633('0x34')]:_0x323e00[_0x7633('0x2f')];if(!_0x7b9d8b[_0x7633('0x30')][_0x7633('0x37')](_0x7633('0x38'))){_0x3d0b0c['limit']=qs[_0x7633('0x1e')](_0x7b9d8b['query'][_0x7633('0x1e')]);_0x3d0b0c[_0x7633('0x1b')]=qs[_0x7633('0x1b')](_0x7b9d8b[_0x7633('0x30')][_0x7633('0x1b')]);}_0x3d0b0c[_0x7633('0x39')]=qs['sort'](_0x7b9d8b[_0x7633('0x30')][_0x7633('0x3a')]);_0x3d0b0c['where']=qs[_0x7633('0x32')](_[_0x7633('0x3b')](_0x7b9d8b[_0x7633('0x30')],_0x323e00[_0x7633('0x32')]),_0x5d79ce);if(_0x7b9d8b['query'][_0x7633('0x3c')]){_0x3d0b0c[_0x7633('0x3d')]=_[_0x7633('0x3e')](_0x3d0b0c[_0x7633('0x3d')],{'$or':_[_0x7633('0x2c')](_0x5d79ce,function(_0x552927){if(_0x552927[_0x7633('0x3f')]!==_0x7633('0x40')){var _0x2d6459={};_0x2d6459[_0x552927['name']]={'$like':'%'+_0x7b9d8b[_0x7633('0x30')][_0x7633('0x3c')]+'%'};return _0x2d6459;}})});}_0x3d0b0c=_[_0x7633('0x3e')]({},_0x3d0b0c,_0x7b9d8b[_0x7633('0x41')]);var _0x5371d7={'where':_0x3d0b0c['where']};return db[_0x7633('0x2d')][_0x7633('0x1d')](_0x5371d7)[_0x7633('0x25')](function(_0x50856e){_0x1abaed[_0x7633('0x1d')]=_0x50856e;if(_0x7b9d8b[_0x7633('0x30')][_0x7633('0x42')]){_0x3d0b0c[_0x7633('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7633('0x44')](_0x3d0b0c);})['then'](function(_0x25a22e){_0x1abaed['rows']=_0x25a22e;return _0x1abaed;})[_0x7633('0x25')](respondWithFilteredResult(_0x266944,_0x3d0b0c))[_0x7633('0x45')](handleError(_0x266944,null));};exports['show']=function(_0x46e83f,_0x27209e){var _0x3f24b2={'raw':!![],'where':{'id':_0x46e83f[_0x7633('0x46')]['id']}},_0x79c2d0={};_0x79c2d0[_0x7633('0x2f')]=_[_0x7633('0x31')](db['ChatQueueReport']['rawAttributes']);_0x79c2d0[_0x7633('0x30')]=_['keys'](_0x46e83f[_0x7633('0x30')]);_0x79c2d0[_0x7633('0x32')]=_[_0x7633('0x33')](_0x79c2d0[_0x7633('0x2f')],_0x79c2d0[_0x7633('0x30')]);_0x3f24b2[_0x7633('0x34')]=_[_0x7633('0x33')](_0x79c2d0[_0x7633('0x2f')],qs[_0x7633('0x35')](_0x46e83f[_0x7633('0x30')][_0x7633('0x35')]));_0x3f24b2[_0x7633('0x34')]=_0x3f24b2[_0x7633('0x34')]['length']?_0x3f24b2['attributes']:_0x79c2d0[_0x7633('0x2f')];if(_0x46e83f[_0x7633('0x30')][_0x7633('0x42')]){_0x3f24b2[_0x7633('0x43')]=[{'all':!![]}];}_0x3f24b2=_[_0x7633('0x3e')]({},_0x3f24b2,_0x46e83f[_0x7633('0x41')]);return db['ChatQueueReport']['find'](_0x3f24b2)[_0x7633('0x25')](handleEntityNotFound(_0x27209e,null))[_0x7633('0x25')](respondWithResult(_0x27209e,null))[_0x7633('0x45')](handleError(_0x27209e,null));};exports[_0x7633('0x47')]=function(_0x599601,_0x5d9a0d){return db[_0x7633('0x2d')][_0x7633('0x47')](_0x599601[_0x7633('0x48')],{})['then'](respondWithResult(_0x5d9a0d,0xc9))[_0x7633('0x45')](handleError(_0x5d9a0d,null));};exports[_0x7633('0x24')]=function(_0x31f166,_0x3c79cb){if(_0x31f166[_0x7633('0x48')]['id']){delete _0x31f166[_0x7633('0x48')]['id'];}return db['ChatQueueReport'][_0x7633('0x49')]({'where':{'id':_0x31f166[_0x7633('0x46')]['id']}})[_0x7633('0x25')](handleEntityNotFound(_0x3c79cb,null))['then'](saveUpdates(_0x31f166[_0x7633('0x48')],null))[_0x7633('0x25')](respondWithResult(_0x3c79cb,null))[_0x7633('0x45')](handleError(_0x3c79cb,null));};exports['destroy']=function(_0x54d4c1,_0x436788){return db[_0x7633('0x2d')][_0x7633('0x49')]({'where':{'id':_0x54d4c1[_0x7633('0x46')]['id']}})['then'](handleEntityNotFound(_0x436788,null))[_0x7633('0x25')](removeEntity(_0x436788,null))[_0x7633('0x45')](handleError(_0x436788,null));};exports[_0x7633('0x4a')]=function(_0x1169bc,_0x457477){return db[_0x7633('0x2d')][_0x7633('0x4a')]()[_0x7633('0x25')](respondWithResult(_0x457477,null))[_0x7633('0x45')](handleError(_0x457477,null));};
\ No newline at end of file
+var _0x3914=['filter','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','send','index','map','ChatQueueReport','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x48ed91,_0xc36d76){var _0x15d242=function(_0x4d5cfd){while(--_0x4d5cfd){_0x48ed91['push'](_0x48ed91['shift']());}};_0x15d242(++_0xc36d76);}(_0x3914,0xeb));var _0x4391=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x3914[_0x10b48a];return _0x2c4533;};'use strict';var emlformat=require(_0x4391('0x0'));var rimraf=require(_0x4391('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4391('0x2'));var rp=require(_0x4391('0x3'));var moment=require('moment');var BPromise=require(_0x4391('0x4'));var Mustache=require(_0x4391('0x5'));var util=require(_0x4391('0x6'));var path=require('path');var sox=require(_0x4391('0x7'));var csv=require(_0x4391('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4391('0x9'));var _=require('lodash');var squel=require(_0x4391('0xa'));var crypto=require('crypto');var jsforce=require(_0x4391('0xb'));var deskjs=require(_0x4391('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4391('0xd'));var Redis=require(_0x4391('0xe'));var authService=require(_0x4391('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4391('0x10'));var hardwareService=require(_0x4391('0x11'));var logger=require(_0x4391('0x12'))(_0x4391('0x13'));var utils=require('../../config/utils');var config=require(_0x4391('0x14'));var licenseUtil=require(_0x4391('0x15'));var db=require(_0x4391('0x16'))['db'];function respondWithStatusCode(_0x137902,_0x254ffb){_0x254ffb=_0x254ffb||0xcc;return function(_0xdebb72){if(_0xdebb72){return _0x137902[_0x4391('0x17')](_0x254ffb);}return _0x137902[_0x4391('0x18')](_0x254ffb)['end']();};}function respondWithResult(_0x1a49ba,_0x3bd3a7){_0x3bd3a7=_0x3bd3a7||0xc8;return function(_0x3f82fb){if(_0x3f82fb){return _0x1a49ba[_0x4391('0x18')](_0x3bd3a7)['json'](_0x3f82fb);}};}function respondWithFilteredResult(_0x62c763,_0x4ff882){return function(_0x343203){if(_0x343203){var _0x3a1b80=typeof _0x4ff882[_0x4391('0x19')]===_0x4391('0x1a')&&typeof _0x4ff882[_0x4391('0x1b')]===_0x4391('0x1a');var _0x2b5117=_0x343203[_0x4391('0x1c')];var _0x58a311=_0x3a1b80?0x0:_0x4ff882['offset'];var _0x2ecb23=_0x3a1b80?_0x343203['count']:_0x4ff882[_0x4391('0x19')]+_0x4ff882[_0x4391('0x1b')];var _0xa9c97f;if(_0x2ecb23>=_0x2b5117){_0x2ecb23=_0x2b5117;_0xa9c97f=0xc8;}else{_0xa9c97f=0xce;}_0x62c763[_0x4391('0x18')](_0xa9c97f);return _0x62c763[_0x4391('0x1d')]('Content-Range',_0x58a311+'-'+_0x2ecb23+'/'+_0x2b5117)['json'](_0x343203);}return null;};}function patchUpdates(_0x36c34c){return function(_0x37fca4){try{jsonpatch[_0x4391('0x1e')](_0x37fca4,_0x36c34c,!![]);}catch(_0x5570a8){return BPromise[_0x4391('0x1f')](_0x5570a8);}return _0x37fca4[_0x4391('0x20')]();};}function saveUpdates(_0x737d10,_0x3e1e0b){return function(_0x505d2c){if(_0x505d2c){return _0x505d2c[_0x4391('0x21')](_0x737d10)[_0x4391('0x22')](function(_0x3c4c9b){return _0x3c4c9b;});}return null;};}function removeEntity(_0xfee343,_0x24e16c){return function(_0x40ff34){if(_0x40ff34){return _0x40ff34['destroy']()[_0x4391('0x22')](function(){_0xfee343[_0x4391('0x18')](0xcc)[_0x4391('0x23')]();});}};}function handleEntityNotFound(_0x333ca6,_0x540339){return function(_0x4b0c28){if(!_0x4b0c28){_0x333ca6[_0x4391('0x17')](0x194);}return _0x4b0c28;};}function handleError(_0x3aa79f,_0x3f2554){_0x3f2554=_0x3f2554||0x1f4;return function(_0x197408){logger[_0x4391('0x24')](_0x197408['stack']);if(_0x197408['name']){delete _0x197408['name'];}_0x3aa79f['status'](_0x3f2554)[_0x4391('0x25')](_0x197408);};}exports[_0x4391('0x26')]=function(_0x471d43,_0x2f7b18){var _0x49aa36={},_0x34059f={},_0x32ed74={'count':0x0,'rows':[]};var _0x115e36=_[_0x4391('0x27')](db[_0x4391('0x28')]['rawAttributes'],function(_0x1a8df0){return{'name':_0x1a8df0[_0x4391('0x29')],'type':_0x1a8df0[_0x4391('0x2a')][_0x4391('0x2b')]};});_0x34059f[_0x4391('0x2c')]=_[_0x4391('0x27')](_0x115e36,_0x4391('0x2d'));_0x34059f[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x471d43[_0x4391('0x2e')]);_0x34059f[_0x4391('0x30')]=_['intersection'](_0x34059f[_0x4391('0x2c')],_0x34059f['query']);_0x49aa36[_0x4391('0x31')]=_['intersection'](_0x34059f['model'],qs[_0x4391('0x32')](_0x471d43[_0x4391('0x2e')][_0x4391('0x32')]));_0x49aa36[_0x4391('0x31')]=_0x49aa36[_0x4391('0x31')][_0x4391('0x33')]?_0x49aa36[_0x4391('0x31')]:_0x34059f['model'];if(!_0x471d43[_0x4391('0x2e')]['hasOwnProperty'](_0x4391('0x34'))){_0x49aa36['limit']=qs[_0x4391('0x1b')](_0x471d43[_0x4391('0x2e')][_0x4391('0x1b')]);_0x49aa36[_0x4391('0x19')]=qs[_0x4391('0x19')](_0x471d43[_0x4391('0x2e')][_0x4391('0x19')]);}_0x49aa36[_0x4391('0x35')]=qs[_0x4391('0x36')](_0x471d43[_0x4391('0x2e')][_0x4391('0x36')]);_0x49aa36[_0x4391('0x37')]=qs[_0x4391('0x30')](_[_0x4391('0x38')](_0x471d43[_0x4391('0x2e')],_0x34059f[_0x4391('0x30')]),_0x115e36);if(_0x471d43[_0x4391('0x2e')][_0x4391('0x39')]){_0x49aa36['where']=_['merge'](_0x49aa36[_0x4391('0x37')],{'$or':_[_0x4391('0x27')](_0x115e36,function(_0x58e161){if(_0x58e161[_0x4391('0x2a')]!==_0x4391('0x3a')){var _0x1c716c={};_0x1c716c[_0x58e161[_0x4391('0x2d')]]={'$like':'%'+_0x471d43[_0x4391('0x2e')]['filter']+'%'};return _0x1c716c;}})});}_0x49aa36=_[_0x4391('0x3b')]({},_0x49aa36,_0x471d43['options']);var _0x5ec1cf={'where':_0x49aa36['where']};return db['ChatQueueReport'][_0x4391('0x1c')](_0x5ec1cf)[_0x4391('0x22')](function(_0x33736a){_0x32ed74[_0x4391('0x1c')]=_0x33736a;if(_0x471d43['query']['includeAll']){_0x49aa36[_0x4391('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4391('0x3d')](_0x49aa36);})[_0x4391('0x22')](function(_0x3bfcdc){_0x32ed74[_0x4391('0x3e')]=_0x3bfcdc;return _0x32ed74;})[_0x4391('0x22')](respondWithFilteredResult(_0x2f7b18,_0x49aa36))[_0x4391('0x3f')](handleError(_0x2f7b18,null));};exports['show']=function(_0x2708e2,_0x3da701){var _0x361f44={'raw':!![],'where':{'id':_0x2708e2[_0x4391('0x40')]['id']}},_0x13f5f4={};_0x13f5f4[_0x4391('0x2c')]=_[_0x4391('0x2f')](db['ChatQueueReport'][_0x4391('0x41')]);_0x13f5f4[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x2708e2[_0x4391('0x2e')]);_0x13f5f4[_0x4391('0x30')]=_[_0x4391('0x42')](_0x13f5f4[_0x4391('0x2c')],_0x13f5f4['query']);_0x361f44[_0x4391('0x31')]=_['intersection'](_0x13f5f4[_0x4391('0x2c')],qs[_0x4391('0x32')](_0x2708e2[_0x4391('0x2e')][_0x4391('0x32')]));_0x361f44[_0x4391('0x31')]=_0x361f44[_0x4391('0x31')][_0x4391('0x33')]?_0x361f44[_0x4391('0x31')]:_0x13f5f4[_0x4391('0x2c')];if(_0x2708e2[_0x4391('0x2e')][_0x4391('0x43')]){_0x361f44[_0x4391('0x3c')]=[{'all':!![]}];}_0x361f44=_[_0x4391('0x3b')]({},_0x361f44,_0x2708e2['options']);return db['ChatQueueReport'][_0x4391('0x44')](_0x361f44)[_0x4391('0x22')](handleEntityNotFound(_0x3da701,null))[_0x4391('0x22')](respondWithResult(_0x3da701,null))[_0x4391('0x3f')](handleError(_0x3da701,null));};exports[_0x4391('0x45')]=function(_0x25c7f6,_0x4efc22){return db[_0x4391('0x28')]['create'](_0x25c7f6[_0x4391('0x46')],{})['then'](respondWithResult(_0x4efc22,0xc9))[_0x4391('0x3f')](handleError(_0x4efc22,null));};exports[_0x4391('0x21')]=function(_0x738d35,_0x1b07b2){if(_0x738d35[_0x4391('0x46')]['id']){delete _0x738d35[_0x4391('0x46')]['id'];}return db['ChatQueueReport'][_0x4391('0x44')]({'where':{'id':_0x738d35[_0x4391('0x40')]['id']}})[_0x4391('0x22')](handleEntityNotFound(_0x1b07b2,null))[_0x4391('0x22')](saveUpdates(_0x738d35[_0x4391('0x46')],null))[_0x4391('0x22')](respondWithResult(_0x1b07b2,null))[_0x4391('0x3f')](handleError(_0x1b07b2,null));};exports[_0x4391('0x47')]=function(_0x1ca698,_0x294498){return db[_0x4391('0x28')][_0x4391('0x44')]({'where':{'id':_0x1ca698[_0x4391('0x40')]['id']}})['then'](handleEntityNotFound(_0x294498,null))[_0x4391('0x22')](removeEntity(_0x294498,null))[_0x4391('0x3f')](handleError(_0x294498,null));};exports[_0x4391('0x48')]=function(_0x516c64,_0x156614){return db[_0x4391('0x28')][_0x4391('0x48')]()['then'](respondWithResult(_0x156614,null))[_0x4391('0x3f')](handleError(_0x156614,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x147003,_0x36e2e3){var _0x5167b2=function(_0x5b54da){while(--_0x5b54da){_0x147003['push'](_0x147003['shift']());}};_0x5167b2(++_0x36e2e3);}(_0xe706,0xa3));var _0x6e70=function(_0x14e69a,_0x2eac7c){_0x14e69a=_0x14e69a-0x0;var _0x26adb8=_0xe706[_0x14e69a];return _0x26adb8;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x58f8a7,_0xbd36a7){var _0x149b97=function(_0x1def61){while(--_0x1def61){_0x58f8a7['push'](_0x58f8a7['shift']());}};_0x149b97(++_0xbd36a7);}(_0xe706,0xa3));var _0x6e70=function(_0x4742d0,_0x3667bd){_0x4742d0=_0x4742d0-0x0;var _0x43bc00=_0xe706[_0x4742d0];return _0x43bc00;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc022=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','ChatQueueReport','create','body','options','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','lodash'];(function(_0xf8a7d1,_0xb9d6c8){var _0x4b40a0=function(_0x377688){while(--_0x377688){_0xf8a7d1['push'](_0xf8a7d1['shift']());}};_0x4b40a0(++_0xb9d6c8);}(_0xc022,0xd1));var _0x2c02=function(_0x984e97,_0x2c72e7){_0x984e97=_0x984e97-0x0;var _0x3630e5=_0xc022[_0x984e97];return _0x3630e5;};'use strict';var _=require(_0x2c02('0x0'));var util=require(_0x2c02('0x1'));var moment=require('moment');var BPromise=require(_0x2c02('0x2'));var rs=require(_0x2c02('0x3'));var fs=require('fs');var Redis=require(_0x2c02('0x4'));var db=require(_0x2c02('0x5'))['db'];var utils=require(_0x2c02('0x6'));var logger=require(_0x2c02('0x7'))(_0x2c02('0x8'));var config=require(_0x2c02('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2c02('0xa')][_0x2c02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f22ce,_0x53f739,_0x3f4b2f){return new BPromise(function(_0x5151df,_0x11be0a){return client[_0x2c02('0xc')](_0x2f22ce,_0x3f4b2f)[_0x2c02('0xd')](function(_0x318538){logger['info'](_0x2c02('0xe'),_0x53f739,'request\x20sent');logger[_0x2c02('0xf')](_0x2c02('0x10'),_0x53f739,'request\x20sent',JSON[_0x2c02('0x11')](_0x318538));if(_0x318538[_0x2c02('0x12')]){if(_0x318538[_0x2c02('0x12')][_0x2c02('0x13')]===0x1f4){logger[_0x2c02('0x12')](_0x2c02('0xe'),_0x53f739,_0x318538['error'][_0x2c02('0x14')]);return _0x11be0a(_0x318538[_0x2c02('0x12')]['message']);}logger[_0x2c02('0x12')](_0x2c02('0xe'),_0x53f739,_0x318538[_0x2c02('0x12')]['message']);return _0x5151df(_0x318538['error'][_0x2c02('0x14')]);}else{logger[_0x2c02('0x15')](_0x2c02('0xe'),_0x53f739,_0x2c02('0x16'));_0x5151df(_0x318538[_0x2c02('0x17')][_0x2c02('0x14')]);}})[_0x2c02('0x18')](function(_0x4914ca){logger[_0x2c02('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x53f739,_0x4914ca);_0x11be0a(_0x4914ca);});});}exports['CreateChatQueueReport']=function(_0x2b29ad){var _0x137092=this;return new Promise(function(_0x64e4ae,_0x5cd5f5){return db[_0x2c02('0x19')][_0x2c02('0x1a')](_0x2b29ad[_0x2c02('0x1b')],{'raw':_0x2b29ad['options']?_0x2b29ad[_0x2c02('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ee975){logger[_0x2c02('0x15')]('CreateChatQueueReport',_0x2b29ad);logger['debug'](_0x2c02('0x1d'),_0x2b29ad,JSON[_0x2c02('0x11')](_0x5ee975));_0x64e4ae(_0x5ee975);})[_0x2c02('0x18')](function(_0x25264e){logger[_0x2c02('0x12')]('CreateChatQueueReport',_0x25264e['message'],_0x2b29ad);_0x5cd5f5(_0x137092['error'](0x1f4,_0x25264e['message']));});});};exports[_0x2c02('0x1e')]=function(_0x490c7d){var _0x1fb602=this;return new Promise(function(_0x1fe3d9,_0x494860){return db[_0x2c02('0x19')][_0x2c02('0x1f')](_0x490c7d['body'],{'raw':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')][_0x2c02('0x20')]||null:null,'attributes':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')][_0x2c02('0x21')]||null:null,'limit':_0x490c7d[_0x2c02('0x1c')]?_0x490c7d[_0x2c02('0x1c')][_0x2c02('0x22')]||null:null})['then'](function(_0x4b9d9e){logger[_0x2c02('0x15')]('UpdateChatQueueReport',_0x490c7d);logger[_0x2c02('0xf')](_0x2c02('0x1e'),_0x490c7d,JSON[_0x2c02('0x11')](_0x4b9d9e));_0x1fe3d9(_0x4b9d9e);})['catch'](function(_0x1a7389){logger[_0x2c02('0x12')](_0x2c02('0x1e'),_0x1a7389[_0x2c02('0x14')],_0x490c7d);_0x494860(_0x1fb602[_0x2c02('0x12')](0x1f4,_0x1a7389[_0x2c02('0x14')]));});});};
\ No newline at end of file
+var _0xcc4d=['debug','attributes','limit','UpdateChatQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','body','options','raw','CreateChatQueueReport'];(function(_0x10620b,_0x499fb5){var _0x59e078=function(_0x65ee0){while(--_0x65ee0){_0x10620b['push'](_0x10620b['shift']());}};_0x59e078(++_0x499fb5);}(_0xcc4d,0x14e));var _0xdcc4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xcc4d[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0xdcc4('0x0'));var moment=require(_0xdcc4('0x1'));var BPromise=require('bluebird');var rs=require(_0xdcc4('0x2'));var fs=require('fs');var Redis=require(_0xdcc4('0x3'));var db=require(_0xdcc4('0x4'))['db'];var utils=require(_0xdcc4('0x5'));var logger=require(_0xdcc4('0x6'))(_0xdcc4('0x7'));var config=require('../../config/environment');var jayson=require(_0xdcc4('0x8'));var client=jayson['client'][_0xdcc4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d5a18,_0x21585a,_0x429b69){return new BPromise(function(_0x87fde4,_0x25a158){return client['request'](_0x3d5a18,_0x429b69)[_0xdcc4('0xa')](function(_0x51da6b){logger[_0xdcc4('0xb')](_0xdcc4('0xc'),_0x21585a,_0xdcc4('0xd'));logger['debug'](_0xdcc4('0xe'),_0x21585a,_0xdcc4('0xd'),JSON[_0xdcc4('0xf')](_0x51da6b));if(_0x51da6b[_0xdcc4('0x10')]){if(_0x51da6b['error'][_0xdcc4('0x11')]===0x1f4){logger[_0xdcc4('0x10')](_0xdcc4('0xc'),_0x21585a,_0x51da6b[_0xdcc4('0x10')][_0xdcc4('0x12')]);return _0x25a158(_0x51da6b['error'][_0xdcc4('0x12')]);}logger[_0xdcc4('0x10')](_0xdcc4('0xc'),_0x21585a,_0x51da6b[_0xdcc4('0x10')][_0xdcc4('0x12')]);return _0x87fde4(_0x51da6b[_0xdcc4('0x10')]['message']);}else{logger[_0xdcc4('0xb')](_0xdcc4('0xc'),_0x21585a,_0xdcc4('0xd'));_0x87fde4(_0x51da6b[_0xdcc4('0x13')][_0xdcc4('0x12')]);}})[_0xdcc4('0x14')](function(_0x93c374){logger[_0xdcc4('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x21585a,_0x93c374);_0x25a158(_0x93c374);});});}exports['CreateChatQueueReport']=function(_0x1ff044){var _0x44db02=this;return new Promise(function(_0x4b20dc,_0x316726){return db[_0xdcc4('0x15')]['create'](_0x1ff044[_0xdcc4('0x16')],{'raw':_0x1ff044[_0xdcc4('0x17')]?_0x1ff044[_0xdcc4('0x17')][_0xdcc4('0x18')]===undefined?!![]:![]:!![]})[_0xdcc4('0xa')](function(_0x57bef1){logger[_0xdcc4('0xb')](_0xdcc4('0x19'),_0x1ff044);logger[_0xdcc4('0x1a')]('CreateChatQueueReport',_0x1ff044,JSON[_0xdcc4('0xf')](_0x57bef1));_0x4b20dc(_0x57bef1);})[_0xdcc4('0x14')](function(_0x431440){logger[_0xdcc4('0x10')](_0xdcc4('0x19'),_0x431440[_0xdcc4('0x12')],_0x1ff044);_0x316726(_0x44db02[_0xdcc4('0x10')](0x1f4,_0x431440[_0xdcc4('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x4d556e){var _0x4fa9e1=this;return new Promise(function(_0x38f388,_0x17320c){return db['ChatQueueReport']['update'](_0x4d556e['body'],{'raw':_0x4d556e[_0xdcc4('0x17')]?_0x4d556e[_0xdcc4('0x17')][_0xdcc4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d556e[_0xdcc4('0x17')]?_0x4d556e[_0xdcc4('0x17')]['where']||null:null,'attributes':_0x4d556e['options']?_0x4d556e['options'][_0xdcc4('0x1b')]||null:null,'limit':_0x4d556e['options']?_0x4d556e[_0xdcc4('0x17')][_0xdcc4('0x1c')]||null:null})[_0xdcc4('0xa')](function(_0x29760f){logger[_0xdcc4('0xb')](_0xdcc4('0x1d'),_0x4d556e);logger[_0xdcc4('0x1a')](_0xdcc4('0x1d'),_0x4d556e,JSON[_0xdcc4('0xf')](_0x29760f));_0x38f388(_0x29760f);})[_0xdcc4('0x14')](function(_0x419b06){logger[_0xdcc4('0x10')](_0xdcc4('0x1d'),_0x419b06[_0xdcc4('0x12')],_0x4d556e);_0x17320c(_0x4fa9e1[_0xdcc4('0x10')](0x1f4,_0x419b06['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56b7=['index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x56b7,0x156));var _0x756b=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x56b7[_0x1e7701];return _0x3ab707;};'use strict';var multer=require('multer');var util=require(_0x756b('0x0'));var path=require(_0x756b('0x1'));var timeout=require(_0x756b('0x2'));var express=require('express');var router=express[_0x756b('0x3')]();var fs_extra=require(_0x756b('0x4'));var auth=require(_0x756b('0x5'));var interaction=require(_0x756b('0x6'));var config=require(_0x756b('0x7'));var controller=require(_0x756b('0x8'));router[_0x756b('0x9')]('/',auth['isAuthenticated'](),controller[_0x756b('0xa')]);router[_0x756b('0x9')](_0x756b('0xb'),auth['isAuthenticated'](),controller[_0x756b('0xc')]);router['get'](_0x756b('0xd'),auth[_0x756b('0xe')](),controller[_0x756b('0xf')]);router[_0x756b('0x10')]('/',auth[_0x756b('0xe')](),controller[_0x756b('0x11')]);router[_0x756b('0x12')](_0x756b('0xd'),auth[_0x756b('0xe')](),controller[_0x756b('0x13')]);router[_0x756b('0x14')](_0x756b('0xd'),auth[_0x756b('0xe')](),controller['destroy']);module[_0x756b('0x15')]=router;
\ No newline at end of file
+var _0xc0b5=['/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put'];(function(_0x4dc664,_0x3d2a89){var _0x172b9d=function(_0x14f923){while(--_0x14f923){_0x4dc664['push'](_0x4dc664['shift']());}};_0x172b9d(++_0x3d2a89);}(_0xc0b5,0x89));var _0x5c0b=function(_0x5b7eaa,_0x5ef6f3){_0x5b7eaa=_0x5b7eaa-0x0;var _0x5e0f6a=_0xc0b5[_0x5b7eaa];return _0x5e0f6a;};'use strict';var multer=require(_0x5c0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5c0b('0x1'));var express=require(_0x5c0b('0x2'));var router=express[_0x5c0b('0x3')]();var fs_extra=require(_0x5c0b('0x4'));var auth=require(_0x5c0b('0x5'));var interaction=require(_0x5c0b('0x6'));var config=require(_0x5c0b('0x7'));var controller=require(_0x5c0b('0x8'));router['get']('/',auth[_0x5c0b('0x9')](),controller[_0x5c0b('0xa')]);router[_0x5c0b('0xb')](_0x5c0b('0xc'),auth['isAuthenticated'](),controller[_0x5c0b('0xd')]);router[_0x5c0b('0xb')]('/:id',auth[_0x5c0b('0x9')](),controller['show']);router[_0x5c0b('0xe')]('/',auth[_0x5c0b('0x9')](),controller[_0x5c0b('0xf')]);router[_0x5c0b('0x10')](_0x5c0b('0x11'),auth[_0x5c0b('0x9')](),controller[_0x5c0b('0x12')]);router[_0x5c0b('0x13')](_0x5c0b('0x11'),auth[_0x5c0b('0x9')](),controller[_0x5c0b('0x14')]);module[_0x5c0b('0x15')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xe55a92,_0x9c77fe){var _0x608e76=function(_0x4af890){while(--_0x4af890){_0xe55a92['push'](_0xe55a92['shift']());}};_0x608e76(++_0x9c77fe);}(_0xedd9,0xfc));var _0x9edd=function(_0x161171,_0x2aaa5c){_0x161171=_0x161171-0x0;var _0x3c5aef=_0xedd9[_0x161171];return _0x3c5aef;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x10fdc3,_0x2ac01f){var _0xd7c0c2=function(_0x12180d){while(--_0x12180d){_0x10fdc3['push'](_0x10fdc3['shift']());}};_0xd7c0c2(++_0x2ac01f);}(_0x008c,0x188));var _0xc008=function(_0x571339,_0x5bcafb){_0x571339=_0x571339-0x0;var _0x5af8a6=_0x008c[_0x571339];return _0x5af8a6;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5eab=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','include','ChatTransferReport','findAll','catch','show','params','length','includeAll','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash'];(function(_0x490662,_0x1611bd){var _0x5b2ffc=function(_0x1c6ab9){while(--_0x1c6ab9){_0x490662['push'](_0x490662['shift']());}};_0x5b2ffc(++_0x1611bd);}(_0x5eab,0x153));var _0xb5ea=function(_0x2c9220,_0x5b343e){_0x2c9220=_0x2c9220-0x0;var _0x7d7c2a=_0x5eab[_0x2c9220];return _0x7d7c2a;};'use strict';var emlformat=require(_0xb5ea('0x0'));var rimraf=require(_0xb5ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5ea('0x2'));var rp=require(_0xb5ea('0x3'));var moment=require(_0xb5ea('0x4'));var BPromise=require(_0xb5ea('0x5'));var Mustache=require(_0xb5ea('0x6'));var util=require(_0xb5ea('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb5ea('0x8'));var ejs=require(_0xb5ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5ea('0xa'));var squel=require(_0xb5ea('0xb'));var crypto=require('crypto');var jsforce=require(_0xb5ea('0xc'));var deskjs=require(_0xb5ea('0xd'));var toCsv=require(_0xb5ea('0x8'));var querystring=require(_0xb5ea('0xe'));var Papa=require('papaparse');var Redis=require(_0xb5ea('0xf'));var authService=require(_0xb5ea('0x10'));var qs=require(_0xb5ea('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5ea('0x12'))('api');var utils=require(_0xb5ea('0x13'));var config=require(_0xb5ea('0x14'));var licenseUtil=require(_0xb5ea('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f5fa4,_0x4e421b){_0x4e421b=_0x4e421b||0xcc;return function(_0x460c31){if(_0x460c31){return _0x2f5fa4[_0xb5ea('0x16')](_0x4e421b);}return _0x2f5fa4['status'](_0x4e421b)[_0xb5ea('0x17')]();};}function respondWithResult(_0x5f4e35,_0x3eec8e){_0x3eec8e=_0x3eec8e||0xc8;return function(_0x2eb880){if(_0x2eb880){return _0x5f4e35[_0xb5ea('0x18')](_0x3eec8e)[_0xb5ea('0x19')](_0x2eb880);}};}function respondWithFilteredResult(_0x22851c,_0x3a8a92){return function(_0x321aaa){if(_0x321aaa){var _0x24b45c=typeof _0x3a8a92['offset']===_0xb5ea('0x1a')&&typeof _0x3a8a92[_0xb5ea('0x1b')]===_0xb5ea('0x1a');var _0x31aaff=_0x321aaa[_0xb5ea('0x1c')];var _0x5d60ec=_0x24b45c?0x0:_0x3a8a92[_0xb5ea('0x1d')];var _0x394967=_0x24b45c?_0x321aaa[_0xb5ea('0x1c')]:_0x3a8a92['offset']+_0x3a8a92[_0xb5ea('0x1b')];var _0x27eb6e;if(_0x394967>=_0x31aaff){_0x394967=_0x31aaff;_0x27eb6e=0xc8;}else{_0x27eb6e=0xce;}_0x22851c['status'](_0x27eb6e);return _0x22851c[_0xb5ea('0x1e')]('Content-Range',_0x5d60ec+'-'+_0x394967+'/'+_0x31aaff)[_0xb5ea('0x19')](_0x321aaa);}return null;};}function patchUpdates(_0x2c32fb){return function(_0x1e8b87){try{jsonpatch['apply'](_0x1e8b87,_0x2c32fb,!![]);}catch(_0x3020a1){return BPromise[_0xb5ea('0x1f')](_0x3020a1);}return _0x1e8b87[_0xb5ea('0x20')]();};}function saveUpdates(_0x1e7897,_0x4fba2f){return function(_0x310ba4){if(_0x310ba4){return _0x310ba4['update'](_0x1e7897)['then'](function(_0x2ab570){return _0x2ab570;});}return null;};}function removeEntity(_0x3a541c,_0x3f12ff){return function(_0x8b26f7){if(_0x8b26f7){return _0x8b26f7[_0xb5ea('0x21')]()[_0xb5ea('0x22')](function(){_0x3a541c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c21d,_0x2a7dc7){return function(_0x36eede){if(!_0x36eede){_0x30c21d[_0xb5ea('0x16')](0x194);}return _0x36eede;};}function handleError(_0x4a9fa0,_0x4a011d){_0x4a011d=_0x4a011d||0x1f4;return function(_0x387c5c){logger[_0xb5ea('0x23')](_0x387c5c['stack']);if(_0x387c5c['name']){delete _0x387c5c[_0xb5ea('0x24')];}_0x4a9fa0[_0xb5ea('0x18')](_0x4a011d)['send'](_0x387c5c);};}exports[_0xb5ea('0x25')]=function(_0x534f2d,_0xb856b8){var _0x5db8d5={},_0x41f576={},_0x57257b={'count':0x0,'rows':[]};var _0x275a8b=_[_0xb5ea('0x26')](db['ChatTransferReport'][_0xb5ea('0x27')],function(_0x3f9ef4){return{'name':_0x3f9ef4[_0xb5ea('0x28')],'type':_0x3f9ef4[_0xb5ea('0x29')][_0xb5ea('0x2a')]};});_0x41f576[_0xb5ea('0x2b')]=_[_0xb5ea('0x26')](_0x275a8b,_0xb5ea('0x24'));_0x41f576['query']=_[_0xb5ea('0x2c')](_0x534f2d[_0xb5ea('0x2d')]);_0x41f576['filters']=_['intersection'](_0x41f576[_0xb5ea('0x2b')],_0x41f576[_0xb5ea('0x2d')]);_0x5db8d5[_0xb5ea('0x2e')]=_[_0xb5ea('0x2f')](_0x41f576['model'],qs[_0xb5ea('0x30')](_0x534f2d['query']['fields']));_0x5db8d5['attributes']=_0x5db8d5[_0xb5ea('0x2e')]['length']?_0x5db8d5[_0xb5ea('0x2e')]:_0x41f576[_0xb5ea('0x2b')];if(!_0x534f2d[_0xb5ea('0x2d')][_0xb5ea('0x31')](_0xb5ea('0x32'))){_0x5db8d5[_0xb5ea('0x1b')]=qs[_0xb5ea('0x1b')](_0x534f2d[_0xb5ea('0x2d')]['limit']);_0x5db8d5[_0xb5ea('0x1d')]=qs['offset'](_0x534f2d['query'][_0xb5ea('0x1d')]);}_0x5db8d5['order']=qs['sort'](_0x534f2d['query'][_0xb5ea('0x33')]);_0x5db8d5['where']=qs[_0xb5ea('0x34')](_['pick'](_0x534f2d['query'],_0x41f576[_0xb5ea('0x34')]),_0x275a8b);if(_0x534f2d[_0xb5ea('0x2d')][_0xb5ea('0x35')]){_0x5db8d5[_0xb5ea('0x36')]=_['merge'](_0x5db8d5[_0xb5ea('0x36')],{'$or':_[_0xb5ea('0x26')](_0x275a8b,function(_0x15b012){if(_0x15b012[_0xb5ea('0x29')]!=='VIRTUAL'){var _0x111d54={};_0x111d54[_0x15b012[_0xb5ea('0x24')]]={'$like':'%'+_0x534f2d[_0xb5ea('0x2d')][_0xb5ea('0x35')]+'%'};return _0x111d54;}})});}_0x5db8d5=_[_0xb5ea('0x37')]({},_0x5db8d5,_0x534f2d['options']);var _0x9c4708={'where':_0x5db8d5[_0xb5ea('0x36')]};return db['ChatTransferReport'][_0xb5ea('0x1c')](_0x9c4708)[_0xb5ea('0x22')](function(_0x5a8917){_0x57257b['count']=_0x5a8917;if(_0x534f2d[_0xb5ea('0x2d')]['includeAll']){_0x5db8d5[_0xb5ea('0x38')]=[{'all':!![]}];}return db[_0xb5ea('0x39')][_0xb5ea('0x3a')](_0x5db8d5);})[_0xb5ea('0x22')](function(_0x10dded){_0x57257b['rows']=_0x10dded;return _0x57257b;})[_0xb5ea('0x22')](respondWithFilteredResult(_0xb856b8,_0x5db8d5))[_0xb5ea('0x3b')](handleError(_0xb856b8,null));};exports[_0xb5ea('0x3c')]=function(_0x274a60,_0x4e2087){var _0x21b9d0={'raw':!![],'where':{'id':_0x274a60[_0xb5ea('0x3d')]['id']}},_0x535f9f={};_0x535f9f[_0xb5ea('0x2b')]=_[_0xb5ea('0x2c')](db[_0xb5ea('0x39')][_0xb5ea('0x27')]);_0x535f9f[_0xb5ea('0x2d')]=_[_0xb5ea('0x2c')](_0x274a60[_0xb5ea('0x2d')]);_0x535f9f[_0xb5ea('0x34')]=_[_0xb5ea('0x2f')](_0x535f9f['model'],_0x535f9f[_0xb5ea('0x2d')]);_0x21b9d0[_0xb5ea('0x2e')]=_[_0xb5ea('0x2f')](_0x535f9f[_0xb5ea('0x2b')],qs[_0xb5ea('0x30')](_0x274a60[_0xb5ea('0x2d')]['fields']));_0x21b9d0['attributes']=_0x21b9d0[_0xb5ea('0x2e')][_0xb5ea('0x3e')]?_0x21b9d0['attributes']:_0x535f9f[_0xb5ea('0x2b')];if(_0x274a60[_0xb5ea('0x2d')][_0xb5ea('0x3f')]){_0x21b9d0[_0xb5ea('0x38')]=[{'all':!![]}];}_0x21b9d0=_['merge']({},_0x21b9d0,_0x274a60[_0xb5ea('0x40')]);return db[_0xb5ea('0x39')][_0xb5ea('0x41')](_0x21b9d0)[_0xb5ea('0x22')](handleEntityNotFound(_0x4e2087,null))[_0xb5ea('0x22')](respondWithResult(_0x4e2087,null))[_0xb5ea('0x3b')](handleError(_0x4e2087,null));};exports[_0xb5ea('0x42')]=function(_0x472779,_0x21b9bd){return db[_0xb5ea('0x39')][_0xb5ea('0x42')](_0x472779[_0xb5ea('0x43')],{})[_0xb5ea('0x22')](respondWithResult(_0x21b9bd,0xc9))['catch'](handleError(_0x21b9bd,null));};exports[_0xb5ea('0x44')]=function(_0x4e1e49,_0x291fc7){if(_0x4e1e49[_0xb5ea('0x43')]['id']){delete _0x4e1e49[_0xb5ea('0x43')]['id'];}return db['ChatTransferReport'][_0xb5ea('0x41')]({'where':{'id':_0x4e1e49['params']['id']}})['then'](handleEntityNotFound(_0x291fc7,null))[_0xb5ea('0x22')](saveUpdates(_0x4e1e49[_0xb5ea('0x43')],null))['then'](respondWithResult(_0x291fc7,null))[_0xb5ea('0x3b')](handleError(_0x291fc7,null));};exports[_0xb5ea('0x21')]=function(_0x228d89,_0x5b6f17){return db[_0xb5ea('0x39')][_0xb5ea('0x41')]({'where':{'id':_0x228d89[_0xb5ea('0x3d')]['id']}})[_0xb5ea('0x22')](handleEntityNotFound(_0x5b6f17,null))[_0xb5ea('0x22')](removeEntity(_0x5b6f17,null))[_0xb5ea('0x3b')](handleError(_0x5b6f17,null));};exports[_0xb5ea('0x45')]=function(_0xd0b79a,_0xb1a500){return db[_0xb5ea('0x39')][_0xb5ea('0x45')]()[_0xb5ea('0x22')](respondWithResult(_0xb1a500,null))['catch'](handleError(_0xb1a500,null));};
\ No newline at end of file
+var _0x2ba2=['ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','show','params','keys','rawAttributes','length','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x2ba2,0x191));var _0x22ba=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x2ba2[_0x4ec520];return _0xed49d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22ba('0x0'));var zipdir=require(_0x22ba('0x1'));var jsonpatch=require(_0x22ba('0x2'));var rp=require(_0x22ba('0x3'));var moment=require(_0x22ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x22ba('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x22ba('0x6'));var ejs=require(_0x22ba('0x7'));var fs=require('fs');var fs_extra=require(_0x22ba('0x8'));var _=require(_0x22ba('0x9'));var squel=require(_0x22ba('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x22ba('0xb'));var toCsv=require(_0x22ba('0x6'));var querystring=require(_0x22ba('0xc'));var Papa=require(_0x22ba('0xd'));var Redis=require(_0x22ba('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x22ba('0xf'));var as=require(_0x22ba('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x22ba('0x11'));var licenseUtil=require(_0x22ba('0x12'));var db=require(_0x22ba('0x13'))['db'];function respondWithStatusCode(_0x2ffc3a,_0x5c420a){_0x5c420a=_0x5c420a||0xcc;return function(_0x5d466b){if(_0x5d466b){return _0x2ffc3a[_0x22ba('0x14')](_0x5c420a);}return _0x2ffc3a[_0x22ba('0x15')](_0x5c420a)['end']();};}function respondWithResult(_0x8ea65e,_0x2a9e18){_0x2a9e18=_0x2a9e18||0xc8;return function(_0x5bd00a){if(_0x5bd00a){return _0x8ea65e[_0x22ba('0x15')](_0x2a9e18)[_0x22ba('0x16')](_0x5bd00a);}};}function respondWithFilteredResult(_0x1be771,_0x24a22b){return function(_0x2e20f5){if(_0x2e20f5){var _0x2b338f=typeof _0x24a22b['offset']===_0x22ba('0x17')&&typeof _0x24a22b['limit']==='undefined';var _0x2418bb=_0x2e20f5[_0x22ba('0x18')];var _0xe92476=_0x2b338f?0x0:_0x24a22b[_0x22ba('0x19')];var _0x5be018=_0x2b338f?_0x2e20f5['count']:_0x24a22b['offset']+_0x24a22b[_0x22ba('0x1a')];var _0x13f91b;if(_0x5be018>=_0x2418bb){_0x5be018=_0x2418bb;_0x13f91b=0xc8;}else{_0x13f91b=0xce;}_0x1be771[_0x22ba('0x15')](_0x13f91b);return _0x1be771['set'](_0x22ba('0x1b'),_0xe92476+'-'+_0x5be018+'/'+_0x2418bb)[_0x22ba('0x16')](_0x2e20f5);}return null;};}function patchUpdates(_0x400199){return function(_0x242da4){try{jsonpatch[_0x22ba('0x1c')](_0x242da4,_0x400199,!![]);}catch(_0x5e59bd){return BPromise[_0x22ba('0x1d')](_0x5e59bd);}return _0x242da4[_0x22ba('0x1e')]();};}function saveUpdates(_0x24fa13,_0x1b7081){return function(_0x498ee6){if(_0x498ee6){return _0x498ee6[_0x22ba('0x1f')](_0x24fa13)['then'](function(_0x5c098d){return _0x5c098d;});}return null;};}function removeEntity(_0x13c83c,_0x3e2c51){return function(_0x312972){if(_0x312972){return _0x312972[_0x22ba('0x20')]()[_0x22ba('0x21')](function(){_0x13c83c[_0x22ba('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd098,_0x27f0ec){return function(_0x5a2376){if(!_0x5a2376){_0x2fd098[_0x22ba('0x14')](0x194);}return _0x5a2376;};}function handleError(_0x11a30b,_0x3632b3){_0x3632b3=_0x3632b3||0x1f4;return function(_0x4b80dd){logger[_0x22ba('0x22')](_0x4b80dd[_0x22ba('0x23')]);if(_0x4b80dd[_0x22ba('0x24')]){delete _0x4b80dd[_0x22ba('0x24')];}_0x11a30b[_0x22ba('0x15')](_0x3632b3)['send'](_0x4b80dd);};}exports['index']=function(_0x1dffae,_0x30fc7f){var _0x9daa2a={},_0x593e5b={},_0x50295e={'count':0x0,'rows':[]};var _0x55bbdc=_[_0x22ba('0x25')](db[_0x22ba('0x26')]['rawAttributes'],function(_0x56368f){return{'name':_0x56368f[_0x22ba('0x27')],'type':_0x56368f[_0x22ba('0x28')][_0x22ba('0x29')]};});_0x593e5b[_0x22ba('0x2a')]=_[_0x22ba('0x25')](_0x55bbdc,_0x22ba('0x24'));_0x593e5b[_0x22ba('0x2b')]=_['keys'](_0x1dffae[_0x22ba('0x2b')]);_0x593e5b[_0x22ba('0x2c')]=_[_0x22ba('0x2d')](_0x593e5b[_0x22ba('0x2a')],_0x593e5b['query']);_0x9daa2a['attributes']=_['intersection'](_0x593e5b[_0x22ba('0x2a')],qs[_0x22ba('0x2e')](_0x1dffae[_0x22ba('0x2b')][_0x22ba('0x2e')]));_0x9daa2a[_0x22ba('0x2f')]=_0x9daa2a[_0x22ba('0x2f')]['length']?_0x9daa2a[_0x22ba('0x2f')]:_0x593e5b['model'];if(!_0x1dffae['query'][_0x22ba('0x30')]('nolimit')){_0x9daa2a['limit']=qs[_0x22ba('0x1a')](_0x1dffae[_0x22ba('0x2b')][_0x22ba('0x1a')]);_0x9daa2a['offset']=qs[_0x22ba('0x19')](_0x1dffae['query'][_0x22ba('0x19')]);}_0x9daa2a['order']=qs[_0x22ba('0x31')](_0x1dffae[_0x22ba('0x2b')][_0x22ba('0x31')]);_0x9daa2a[_0x22ba('0x32')]=qs[_0x22ba('0x2c')](_[_0x22ba('0x33')](_0x1dffae[_0x22ba('0x2b')],_0x593e5b[_0x22ba('0x2c')]),_0x55bbdc);if(_0x1dffae[_0x22ba('0x2b')][_0x22ba('0x34')]){_0x9daa2a[_0x22ba('0x32')]=_['merge'](_0x9daa2a[_0x22ba('0x32')],{'$or':_[_0x22ba('0x25')](_0x55bbdc,function(_0x46fc70){if(_0x46fc70['type']!==_0x22ba('0x35')){var _0x21f197={};_0x21f197[_0x46fc70['name']]={'$like':'%'+_0x1dffae[_0x22ba('0x2b')][_0x22ba('0x34')]+'%'};return _0x21f197;}})});}_0x9daa2a=_[_0x22ba('0x36')]({},_0x9daa2a,_0x1dffae[_0x22ba('0x37')]);var _0x4d48a5={'where':_0x9daa2a[_0x22ba('0x32')]};return db[_0x22ba('0x26')]['count'](_0x4d48a5)[_0x22ba('0x21')](function(_0xf7b04b){_0x50295e['count']=_0xf7b04b;if(_0x1dffae[_0x22ba('0x2b')][_0x22ba('0x38')]){_0x9daa2a['include']=[{'all':!![]}];}return db[_0x22ba('0x26')]['findAll'](_0x9daa2a);})[_0x22ba('0x21')](function(_0x1eba8b){_0x50295e['rows']=_0x1eba8b;return _0x50295e;})[_0x22ba('0x21')](respondWithFilteredResult(_0x30fc7f,_0x9daa2a))[_0x22ba('0x39')](handleError(_0x30fc7f,null));};exports[_0x22ba('0x3a')]=function(_0x47e663,_0x2f7a81){var _0x1e58c0={'raw':!![],'where':{'id':_0x47e663[_0x22ba('0x3b')]['id']}},_0x2891ac={};_0x2891ac[_0x22ba('0x2a')]=_[_0x22ba('0x3c')](db[_0x22ba('0x26')][_0x22ba('0x3d')]);_0x2891ac['query']=_[_0x22ba('0x3c')](_0x47e663[_0x22ba('0x2b')]);_0x2891ac[_0x22ba('0x2c')]=_[_0x22ba('0x2d')](_0x2891ac['model'],_0x2891ac['query']);_0x1e58c0[_0x22ba('0x2f')]=_['intersection'](_0x2891ac[_0x22ba('0x2a')],qs['fields'](_0x47e663['query']['fields']));_0x1e58c0[_0x22ba('0x2f')]=_0x1e58c0[_0x22ba('0x2f')][_0x22ba('0x3e')]?_0x1e58c0['attributes']:_0x2891ac[_0x22ba('0x2a')];if(_0x47e663[_0x22ba('0x2b')]['includeAll']){_0x1e58c0[_0x22ba('0x3f')]=[{'all':!![]}];}_0x1e58c0=_[_0x22ba('0x36')]({},_0x1e58c0,_0x47e663[_0x22ba('0x37')]);return db[_0x22ba('0x26')][_0x22ba('0x40')](_0x1e58c0)['then'](handleEntityNotFound(_0x2f7a81,null))[_0x22ba('0x21')](respondWithResult(_0x2f7a81,null))[_0x22ba('0x39')](handleError(_0x2f7a81,null));};exports[_0x22ba('0x41')]=function(_0x506810,_0x2e184d){return db[_0x22ba('0x26')]['create'](_0x506810[_0x22ba('0x42')],{})['then'](respondWithResult(_0x2e184d,0xc9))[_0x22ba('0x39')](handleError(_0x2e184d,null));};exports[_0x22ba('0x1f')]=function(_0x5a3f42,_0x88194f){if(_0x5a3f42[_0x22ba('0x42')]['id']){delete _0x5a3f42[_0x22ba('0x42')]['id'];}return db[_0x22ba('0x26')][_0x22ba('0x40')]({'where':{'id':_0x5a3f42[_0x22ba('0x3b')]['id']}})['then'](handleEntityNotFound(_0x88194f,null))[_0x22ba('0x21')](saveUpdates(_0x5a3f42[_0x22ba('0x42')],null))[_0x22ba('0x21')](respondWithResult(_0x88194f,null))[_0x22ba('0x39')](handleError(_0x88194f,null));};exports['destroy']=function(_0x1675d9,_0x3486db){return db[_0x22ba('0x26')][_0x22ba('0x40')]({'where':{'id':_0x1675d9[_0x22ba('0x3b')]['id']}})[_0x22ba('0x21')](handleEntityNotFound(_0x3486db,null))[_0x22ba('0x21')](removeEntity(_0x3486db,null))[_0x22ba('0x39')](handleError(_0x3486db,null));};exports[_0x22ba('0x43')]=function(_0x129c4a,_0x25b820){return db['ChatTransferReport'][_0x22ba('0x43')]()[_0x22ba('0x21')](respondWithResult(_0x25b820,null))[_0x22ba('0x39')](handleError(_0x25b820,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda00=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xda00,0x1ba));var _0x0da0=function(_0xc37fab,_0xaf1029){_0xc37fab=_0xc37fab-0x0;var _0x6efaff=_0xda00[_0xc37fab];return _0x6efaff;};'use strict';var _=require(_0x0da0('0x0'));var util=require(_0x0da0('0x1'));var logger=require('../../config/logger')(_0x0da0('0x2'));var moment=require(_0x0da0('0x3'));var BPromise=require('bluebird');var rp=require(_0x0da0('0x4'));var fs=require('fs');var path=require(_0x0da0('0x5'));var rimraf=require(_0x0da0('0x6'));var config=require(_0x0da0('0x7'));var attributes=require(_0x0da0('0x8'));module['exports']=function(_0x4472c7,_0x2ec832){return _0x4472c7[_0x0da0('0x9')](_0x0da0('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0da0('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x68d6=['rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x11a578,_0x4b39ce){var _0x5aa296=function(_0x59d7ca){while(--_0x59d7ca){_0x11a578['push'](_0x11a578['shift']());}};_0x5aa296(++_0x4b39ce);}(_0x68d6,0x72));var _0x668d=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x68d6[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x668d('0x0'));var util=require(_0x668d('0x1'));var logger=require(_0x668d('0x2'))('api');var moment=require(_0x668d('0x3'));var BPromise=require(_0x668d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x668d('0x5'));var rimraf=require(_0x668d('0x6'));var config=require(_0x668d('0x7'));var attributes=require(_0x668d('0x8'));module['exports']=function(_0x16ec43,_0x32bafc){return _0x16ec43[_0x668d('0x9')]('ChatTransferReport',attributes,{'tableName':_0x668d('0xa'),'paranoid':![],'indexes':[{'name':_0x668d('0xb'),'fields':[_0x668d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0bdd=['request\x20sent','debug','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x2a6ab4,_0x3f927c){var _0x37ba31=function(_0x4d44f1){while(--_0x4d44f1){_0x2a6ab4['push'](_0x2a6ab4['shift']());}};_0x37ba31(++_0x3f927c);}(_0x0bdd,0x17d));var _0xd0bd=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0x0bdd[_0x4f83ca];return _0x1fbac3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd0bd('0x0'));var BPromise=require(_0xd0bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0bd('0x2'))['db'];var utils=require(_0xd0bd('0x3'));var logger=require(_0xd0bd('0x4'))(_0xd0bd('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0bd('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc620e,_0x142341,_0x1a9b91){return new BPromise(function(_0x2b94dc,_0x33de02){return client[_0xd0bd('0x7')](_0xc620e,_0x1a9b91)[_0xd0bd('0x8')](function(_0x36ed8c){logger['info'](_0xd0bd('0x9'),_0x142341,_0xd0bd('0xa'));logger[_0xd0bd('0xb')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x142341,_0xd0bd('0xa'),JSON['stringify'](_0x36ed8c));if(_0x36ed8c[_0xd0bd('0xc')]){if(_0x36ed8c[_0xd0bd('0xc')][_0xd0bd('0xd')]===0x1f4){logger[_0xd0bd('0xc')](_0xd0bd('0x9'),_0x142341,_0x36ed8c[_0xd0bd('0xc')]['message']);return _0x33de02(_0x36ed8c['error'][_0xd0bd('0xe')]);}logger[_0xd0bd('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x142341,_0x36ed8c[_0xd0bd('0xc')][_0xd0bd('0xe')]);return _0x2b94dc(_0x36ed8c[_0xd0bd('0xc')][_0xd0bd('0xe')]);}else{logger['info'](_0xd0bd('0x9'),_0x142341,_0xd0bd('0xa'));_0x2b94dc(_0x36ed8c[_0xd0bd('0xf')][_0xd0bd('0xe')]);}})[_0xd0bd('0x10')](function(_0x2cf6e1){logger[_0xd0bd('0xc')](_0xd0bd('0x9'),_0x142341,_0x2cf6e1);_0x33de02(_0x2cf6e1);});});}
\ No newline at end of file
+var _0x14c9=['stringify','error','code','message','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x14c9,0xb8));var _0x914c=function(_0x57c3c8,_0xbd96c8){_0x57c3c8=_0x57c3c8-0x0;var _0x19aff1=_0x14c9[_0x57c3c8];return _0x19aff1;};'use strict';var _=require('lodash');var util=require(_0x914c('0x0'));var moment=require(_0x914c('0x1'));var BPromise=require(_0x914c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x914c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x914c('0x4'));var logger=require('../../config/logger')(_0x914c('0x5'));var config=require(_0x914c('0x6'));var jayson=require(_0x914c('0x7'));var client=jayson[_0x914c('0x8')][_0x914c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42142d,_0x2b760a,_0x417c4d){return new BPromise(function(_0x46c54b,_0x39e012){return client[_0x914c('0xa')](_0x42142d,_0x417c4d)['then'](function(_0x35113d){logger[_0x914c('0xb')](_0x914c('0xc'),_0x2b760a,_0x914c('0xd'));logger[_0x914c('0xe')](_0x914c('0xf'),_0x2b760a,_0x914c('0xd'),JSON[_0x914c('0x10')](_0x35113d));if(_0x35113d['error']){if(_0x35113d[_0x914c('0x11')][_0x914c('0x12')]===0x1f4){logger['error'](_0x914c('0xc'),_0x2b760a,_0x35113d[_0x914c('0x11')]['message']);return _0x39e012(_0x35113d['error'][_0x914c('0x13')]);}logger[_0x914c('0x11')](_0x914c('0xc'),_0x2b760a,_0x35113d[_0x914c('0x11')][_0x914c('0x13')]);return _0x46c54b(_0x35113d[_0x914c('0x11')][_0x914c('0x13')]);}else{logger['info'](_0x914c('0xc'),_0x2b760a,_0x914c('0xd'));_0x46c54b(_0x35113d['result'][_0x914c('0x13')]);}})['catch'](function(_0xc7223c){logger[_0x914c('0x11')](_0x914c('0xc'),_0x2b760a,_0xc7223c);_0x39e012(_0xc7223c);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ad0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xaa7e97,_0x58f5e1){var _0x5b7a56=function(_0x56f705){while(--_0x56f705){_0xaa7e97['push'](_0xaa7e97['shift']());}};_0x5b7a56(++_0x58f5e1);}(_0x0ad0,0x124));var _0x00ad=function(_0xd01d7b,_0x2921b4){_0xd01d7b=_0xd01d7b-0x0;var _0x68549c=_0x0ad0[_0xd01d7b];return _0x68549c;};'use strict';var multer=require(_0x00ad('0x0'));var util=require(_0x00ad('0x1'));var path=require(_0x00ad('0x2'));var timeout=require(_0x00ad('0x3'));var express=require(_0x00ad('0x4'));var router=express[_0x00ad('0x5')]();var fs_extra=require(_0x00ad('0x6'));var auth=require(_0x00ad('0x7'));var interaction=require(_0x00ad('0x8'));var config=require(_0x00ad('0x9'));var controller=require(_0x00ad('0xa'));router[_0x00ad('0xb')]('/',auth['isAuthenticated'](),controller[_0x00ad('0xc')]);router['get'](_0x00ad('0xd'),auth[_0x00ad('0xe')](),controller[_0x00ad('0xf')]);router['get'](_0x00ad('0x10'),auth['isAuthenticated'](),controller[_0x00ad('0x11')]);router[_0x00ad('0x12')]('/',auth[_0x00ad('0xe')](),controller[_0x00ad('0x13')]);router[_0x00ad('0x14')](_0x00ad('0x10'),auth[_0x00ad('0xe')](),controller['update']);router['delete'](_0x00ad('0x10'),auth['isAuthenticated'](),controller[_0x00ad('0x15')]);module[_0x00ad('0x16')]=router;
\ No newline at end of file
+var _0xada8=['../../components/auth/service','../../config/environment','get','isAuthenticated','describe','post','put','/:id','delete','destroy','exports','util','path','express'];(function(_0x4b54fb,_0x2150e4){var _0x375eb4=function(_0x461679){while(--_0x461679){_0x4b54fb['push'](_0x4b54fb['shift']());}};_0x375eb4(++_0x2150e4);}(_0xada8,0xcf));var _0x8ada=function(_0x40c685,_0x19a332){_0x40c685=_0x40c685-0x0;var _0x1fb12d=_0xada8[_0x40c685];return _0x1fb12d;};'use strict';var multer=require('multer');var util=require(_0x8ada('0x0'));var path=require(_0x8ada('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ada('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ada('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8ada('0x4'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8ada('0x5')]('/describe',auth[_0x8ada('0x6')](),controller[_0x8ada('0x7')]);router['get']('/:id',auth[_0x8ada('0x6')](),controller['show']);router[_0x8ada('0x8')]('/',auth[_0x8ada('0x6')](),controller['create']);router[_0x8ada('0x9')](_0x8ada('0xa'),auth[_0x8ada('0x6')](),controller['update']);router[_0x8ada('0xb')](_0x8ada('0xa'),auth[_0x8ada('0x6')](),controller[_0x8ada('0xc')]);module[_0x8ada('0xd')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x90d9=['We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared'];(function(_0x4c117f,_0x51e880){var _0x49bc6e=function(_0x5eb7f3){while(--_0x5eb7f3){_0x4c117f['push'](_0x4c117f['shift']());}};_0x49bc6e(++_0x51e880);}(_0x90d9,0x152));var _0x990d=function(_0x519c7f,_0x1dc5f9){_0x519c7f=_0x519c7f-0x0;var _0x69ce5c=_0x90d9[_0x519c7f];return _0x69ce5c;};'use strict';var Sequelize=require(_0x990d('0x0'));var rs=require(_0x990d('0x1'));module[_0x990d('0x2')]={'name':{'type':Sequelize[_0x990d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x990d('0x3')]},'mapKey':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x4')},'mapKeyOffline':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x4')},'key':{'type':Sequelize[_0x990d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x5')},'customerAlias':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':_0x990d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':_0x990d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x990d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x990d('0x9')](_0x990d('0xa'),_0x990d('0xb')),'defaultValue':_0x990d('0xa')},'header_online':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0xc')},'start_chat_button':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0x11')},'noteTitle':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x13')},'closingMessageButton':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x14')},'conditionAgreement':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x990d('0x9')](_0x990d('0x15'),_0x990d('0x16')),'defaultValue':_0x990d('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x990d('0x17')]({'items':[{'type':_0x990d('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x990d('0x19'),'required':!![]},'props':{'title':_0x990d('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x990d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x990d('0x4'),'type':_0x990d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x990d('0x1b')](_0x990d('0x1c'))?JSON[_0x990d('0x1d')](this[_0x990d('0x1b')]('onlineForm')):{};},'set':function(_0x39d0c9){return this[_0x990d('0x1e')]('onlineForm',JSON['stringify'](_0x39d0c9));}},'offlineForm':{'type':Sequelize[_0x990d('0x1f')],'defaultValue':function(){return JSON[_0x990d('0x17')]({'items':[{'type':'input','props':{'title':_0x990d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x990d('0x4'),'type':_0x990d('0x4')},'variable':null},{'type':_0x990d('0x20'),'config':{'placeholder':_0x990d('0x21')},'props':{'title':'Comments','helpText':_0x990d('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON['parse'](this['getDataValue'](_0x990d('0x23'))):{};},'set':function(_0x3669c9){return this[_0x990d('0x1e')](_0x990d('0x23'),JSON[_0x990d('0x17')](_0x3669c9));}},'token':{'type':Sequelize[_0x990d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x990d('0x3')]},'forwardOffline':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x990d('0x3')]},'waitingTitle':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x24')},'waitingMessage':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0x25')},'offlineMessageBody':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x26')},'skipUnmanaged':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x14')},'sendUnmanaged':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x990d('0x1f')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x990d('0x1f')],'defaultValue':function(){return _0x990d('0x27');}},'notificationSound':{'type':Sequelize[_0x990d('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x990d('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x990d('0x28')},'verticalAlignment':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x29')},'messagesAlignment':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x2a')},'defaultTitle':{'type':Sequelize[_0x990d('0x3')]},'customerAvatar':{'type':Sequelize[_0x990d('0x1f')]},'showCustomerAvatar':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x990d('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x990d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x990d('0x3')],'defaultValue':_0x990d('0x2b')},'systemAvatar':{'type':Sequelize[_0x990d('0x1f')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x990d('0xf')],'comment':_0x990d('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![],'comment':_0x990d('0x2d'),'set':function(_0x4dd73d){if(!_0x4dd73d)this[_0x990d('0x1e')](_0x990d('0x2e'),null);this[_0x990d('0x1e')](_0x990d('0x2f'),_0x4dd73d);}},'vidaooEscalation':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x990d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x990d('0x3')],'allowNull':![],'defaultValue':_0x990d('0x30')},'vidaooNote':{'type':Sequelize[_0x990d('0x3')],'defaultValue':function(){return _0x990d('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x990d('0x1f')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x990d('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x990d('0x1f')]}};
\ No newline at end of file
+var _0xbbf7=['#ffffff','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','text','email','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','Agent','#011F6A'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbbf7,0x158));var _0x7bbf=function(_0x4db25e,_0x19a97a){_0x4db25e=_0x4db25e-0x0;var _0x39782d=_0xbbf7[_0x4db25e];return _0x39782d;};'use strict';var Sequelize=require(_0x7bbf('0x0'));var rs=require(_0x7bbf('0x1'));module[_0x7bbf('0x2')]={'name':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x7bbf('0x3')]},'mapKey':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7bbf('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7bbf('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![],'defaultValue':_0x7bbf('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7bbf('0x3')]},'animation':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x7bbf('0x8'),'squared'),'defaultValue':_0x7bbf('0x8')},'header_online':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x9')},'start_chat_button':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0xa')},'offline_chat_button':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0xb')},'header_offline':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7bbf('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x7bbf('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7bbf('0xf')]},'closingQuestion':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x11')},'noteTitle':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7bbf('0x12')},'closingMessage':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x13')},'closingMessageButton':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0x7bbf('0x15'),_0x7bbf('0x16')),'defaultValue':_0x7bbf('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x7bbf('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7bbf('0xf')],'defaultValue':function(){return JSON[_0x7bbf('0x17')]({'items':[{'type':_0x7bbf('0x18'),'variable':null,'config':{'placeholder':_0x7bbf('0x19'),'type':_0x7bbf('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x7bbf('0x18'),'props':{'title':_0x7bbf('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x7bbf('0x1b'),'type':_0x7bbf('0x1b')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7bbf('0x1c')](_0x7bbf('0x1d'))?JSON[_0x7bbf('0x1e')](this[_0x7bbf('0x1c')]('onlineForm')):{};},'set':function(_0x2da20b){return this[_0x7bbf('0x1f')](_0x7bbf('0x1d'),JSON[_0x7bbf('0x17')](_0x2da20b));}},'offlineForm':{'type':Sequelize[_0x7bbf('0xf')],'defaultValue':function(){return JSON[_0x7bbf('0x17')]({'items':[{'type':'input','props':{'title':_0x7bbf('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x7bbf('0x1b'),'type':_0x7bbf('0x1b')},'variable':null},{'type':'textarea','config':{'placeholder':_0x7bbf('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x7bbf('0x1c')]('offlineForm')?JSON[_0x7bbf('0x1e')](this[_0x7bbf('0x1c')](_0x7bbf('0x21'))):{};},'set':function(_0x5c6216){return this[_0x7bbf('0x1f')](_0x7bbf('0x21'),JSON[_0x7bbf('0x17')](_0x5c6216));}},'token':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':function(){return rs[_0x7bbf('0x22')]();}},'autoclose':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7bbf('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x23')},'waitingMessage':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x26')},'sendUnmanaged':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7bbf('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7bbf('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7bbf('0xf')],'defaultValue':function(){return _0x7bbf('0x27');}},'notificationSound':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x7bbf('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7bbf('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7bbf('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x29')},'verticalAlignment':{'type':Sequelize[_0x7bbf('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x7bbf('0x2a')},'messagesAlignment':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x7bbf('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7bbf('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![],'defaultValue':_0x7bbf('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7bbf('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7bbf('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7bbf('0x3')],'defaultValue':_0x7bbf('0x2c')},'systemAvatar':{'type':Sequelize[_0x7bbf('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7bbf('0xd')],'comment':_0x7bbf('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x253d06){if(!_0x253d06)this[_0x7bbf('0x1f')](_0x7bbf('0x2e'),null);this[_0x7bbf('0x1f')](_0x7bbf('0x2f'),_0x253d06);}},'vidaooEscalation':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7bbf('0x3')]},'vidaooTopic':{'type':Sequelize[_0x7bbf('0x3')],'allowNull':![],'defaultValue':_0x7bbf('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x7bbf('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x7bbf('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7bbf('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9487=['emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','../../config/logger','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','set','Content-Range','destroy','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','map','Interval','get','all','some','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','sort','removeDispositions','ids','getAnswers','CannedAnswer','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','root','download','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','defaults','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','Smtp','openNewInteraction','mimetype','mapValues','subjectOffline','email','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Contact','User','internal','Tag','Tags','color','tag','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','URL','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents'];(function(_0x5a1e0a,_0x84f951){var _0x369626=function(_0x70b9c5){while(--_0x70b9c5){_0x5a1e0a['push'](_0x5a1e0a['shift']());}};_0x369626(++_0x84f951);}(_0x9487,0x13c));var _0x7948=function(_0x5a1fba,_0x54bd31){_0x5a1fba=_0x5a1fba-0x0;var _0x5bfa4a=_0x9487[_0x5a1fba];return _0x5bfa4a;};'use strict';var Mustache=require(_0x7948('0x0'));var util=require(_0x7948('0x1'));var path=require('path');var ejs=require(_0x7948('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7948('0x3'));var querystring=require(_0x7948('0x4'));var htmlToText=require(_0x7948('0x5'));var Redis=require(_0x7948('0x6'));var jayson=require('jayson/promise');var url=require(_0x7948('0x7'));var qs=require(_0x7948('0x8'));var logger=require(_0x7948('0x9'))('api');var config=require(_0x7948('0xa'));var APIOutOfIntervalError=require('../../errors/api')[_0x7948('0xb')];var APINotFoundError=require(_0x7948('0xc'))[_0x7948('0xd')];var APIHandleError=require(_0x7948('0xc'))[_0x7948('0xe')];var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x7948('0xf')],{'host':_0x7948('0x10'),'port':0x18eb});var socket=require(_0x7948('0x11'))(new Redis(config['redis']));require(_0x7948('0x12'))[_0x7948('0x13')](socket);var client=jayson[_0x7948('0x14')]['http']({'port':0x232c});var client9002=jayson[_0x7948('0x14')][_0x7948('0x15')]({'port':0x232a});var client9003=jayson['client'][_0x7948('0x15')]({'port':0x232b});var client9001=jayson[_0x7948('0x14')][_0x7948('0x15')]({'port':0x2329});function respondWithRpcPromise(_0xe14f87,_0x1a8628,_0x315553,_0xbe9a42){return new Promise(function(_0x424137,_0x5cdbbb){var _0x49f25d=_0xbe9a42||client;return _0x49f25d['request'](_0xe14f87,_0x315553)[_0x7948('0x16')](function(_0x3cb4a9){logger[_0x7948('0x17')](_0x7948('0x18'),_0x1a8628,'request\x20sent');logger[_0x7948('0x19')](_0x7948('0x1a'),_0x1a8628,_0x7948('0x1b'),JSON[_0x7948('0x1c')](_0x3cb4a9));if(_0x3cb4a9[_0x7948('0x1d')]){if(_0x3cb4a9['error'][_0x7948('0x1e')]===0x1f4){logger[_0x7948('0x1d')](_0x7948('0x18'),_0x1a8628,_0x3cb4a9['error'][_0x7948('0x1f')]);return _0x5cdbbb(_0x3cb4a9[_0x7948('0x1d')]['message']);}logger[_0x7948('0x1d')](_0x7948('0x18'),_0x1a8628,_0x3cb4a9['error'][_0x7948('0x1f')]);return _0x424137(_0x3cb4a9[_0x7948('0x1d')][_0x7948('0x1f')]);}else{logger[_0x7948('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a8628,_0x7948('0x1b'));_0x424137(_0x3cb4a9[_0x7948('0x20')][_0x7948('0x1f')]);}})[_0x7948('0x21')](function(_0x587297){logger[_0x7948('0x1d')](_0x7948('0x18'),_0x1a8628,_0x587297);_0x5cdbbb(_0x587297);});});}function respondWithStatusCode(_0x366f97,_0x5058f7){_0x5058f7=_0x5058f7||0xcc;return function(_0x4700e3){if(_0x4700e3){return _0x366f97['sendStatus'](_0x5058f7);}return _0x366f97['status'](_0x5058f7)['end']();};}function respondWithResult(_0x1a8b27,_0x46c938){_0x46c938=_0x46c938||0xc8;return function(_0x14be04){if(_0x14be04){return _0x1a8b27[_0x7948('0x22')](_0x46c938)['json'](_0x14be04);}};}function respondWithFilteredResult(_0x3b267a,_0x4d8f1f){return function(_0x20cafb){if(_0x20cafb){var _0x497f35=typeof _0x4d8f1f[_0x7948('0x23')]===_0x7948('0x24')&&typeof _0x4d8f1f['limit']===_0x7948('0x24');var _0x56f8f4=_0x20cafb['count'];var _0xe59f51=_0x497f35?0x0:_0x4d8f1f[_0x7948('0x23')];var _0x10e4b1=_0x497f35?_0x20cafb[_0x7948('0x25')]:_0x4d8f1f[_0x7948('0x23')]+_0x4d8f1f[_0x7948('0x26')];var _0x3fc3d3;if(_0x10e4b1>=_0x56f8f4){_0x10e4b1=_0x56f8f4;_0x3fc3d3=0xc8;}else{_0x3fc3d3=0xce;}_0x3b267a['status'](_0x3fc3d3);return _0x3b267a[_0x7948('0x27')](_0x7948('0x28'),_0xe59f51+'-'+_0x10e4b1+'/'+_0x56f8f4)['json'](_0x20cafb);}return null;};}function saveUpdates(_0xe6c897){return function(_0x53c29d){if(_0x53c29d){return _0x53c29d['update'](_0xe6c897)[_0x7948('0x16')](function(_0x2efe39){return _0x2efe39;});}return null;};}function removeEntity(_0x476d9a){return function(_0x4f4792){if(_0x4f4792){return _0x4f4792[_0x7948('0x29')]()['then'](function(){var _0x4e9086=_0x4f4792['get']({'plain':!![]});var _0x48fdd6=_0x7948('0x2a');return db[_0x7948('0x2b')][_0x7948('0x29')]({'where':{'type':_0x48fdd6,'resourceId':_0x4e9086['id']}})[_0x7948('0x16')](function(){return _0x4f4792;});})['then'](function(){_0x476d9a[_0x7948('0x22')](0xcc)[_0x7948('0x2c')]();});}};}function handleEntityNotFound(_0xa154){return function(_0x3e7d2a){if(!_0x3e7d2a){_0xa154[_0x7948('0x2d')](0x194);}return _0x3e7d2a;};}function handleError(_0x7e8a98,_0x5634ee){_0x5634ee=_0x5634ee||0x1f4;return function(_0x443640){logger[_0x7948('0x1d')](_0x443640[_0x7948('0x2e')]);if(_0x443640[_0x7948('0x2f')]){delete _0x443640[_0x7948('0x2f')];}_0x7e8a98[_0x7948('0x22')](_0x5634ee)['send'](_0x443640);};}function iftimePromise(_0x48b9c8,_0x442388){return respondWithRpcPromise(_0x7948('0x30'),_0x7948('0x31'),{'command':_0x442388[_0x7948('0x32')]?util[_0x7948('0x33')](_0x7948('0x34'),_0x48b9c8['interval'],_0x442388[_0x7948('0x32')]):util['format']('iftime\x20%s',_0x48b9c8[_0x7948('0x35')])},client9002)['then'](function(_0x1d6d41){var _0x30fdc6=_0x1d6d41&&_0x1d6d41[_0x7948('0x36')](_0x7948('0x37'))>=0x0?!![]:![];logger[_0x7948('0x17')](_0x7948('0x38'),_0x442388['id'],_0x48b9c8['id'],_0x48b9c8[_0x7948('0x35')],_0x30fdc6?_0x7948('0x39'):'OFFLINE',_0x442388[_0x7948('0x32')]?_0x442388[_0x7948('0x32')]:_0x7948('0x3a'));return _0x30fdc6;})[_0x7948('0x21')](function(_0x44de44){logger[_0x7948('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x442388['id'],_0x48b9c8['id'],_0x48b9c8[_0x7948('0x35')],util['inspect'](_0x44de44,{'showHidden':![],'depth':null}),_0x442388['timezone']?_0x442388['timezone']:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x37efef){var _0x43d199=_[_0x7948('0x3b')](_0x37efef[_0x7948('0x3c')]['Intervals'],function(_0x31b5a3){var _0x1476e7=_0x31b5a3[_0x7948('0x3d')]({'plain':!![]});return iftimePromise(_0x1476e7,_0x37efef);});return Promise[_0x7948('0x3e')](_0x43d199)[_0x7948('0x16')](function(_0x5b769d){return _[_0x7948('0x3f')](_0x5b769d);});}function createInteractionObject(_0x40b271,_0x8c098a,_0x200cda,_0x2a969f){var _0x51a5a0=require(_0x7948('0x40'));var _0x534273=new _0x51a5a0();var _0x51b46c=_0x534273[_0x7948('0x41')](_0x200cda[_0x7948('0x42')])['getResult']();var _0x526dca=_0x8c098a[_0x7948('0x43')];if(_0x200cda[_0x7948('0x44')]){_0x526dca=_0x200cda[_0x7948('0x44')];}else if(_0x200cda['x-forwarded-for']){_0x526dca=_[_0x7948('0x45')](_0x200cda[_0x7948('0x46')][_0x7948('0x47')](','));}return{'ContactId':_0x2a969f['id'],'ChatWebsiteId':_0x40b271,'from':(_0x2a969f[_0x7948('0x48')]||'')+'\x20'+(_0x2a969f[_0x7948('0x49')]||''),'customerIp':_0x526dca,'customerPort':_0x200cda[_0x7948('0x4a')]?_0x200cda['x-real-port']:null,'referer':_0x8c098a['referer'],'browserName':_0x51b46c['browser']['name']&&_0x51b46c[_0x7948('0x4b')][_0x7948('0x4c')]?util[_0x7948('0x33')](_0x7948('0x4d'),_0x51b46c[_0x7948('0x4b')][_0x7948('0x2f')],_0x51b46c['browser'][_0x7948('0x4c')]):_0x7948('0x4e'),'browserVersion':_0x51b46c['browser'][_0x7948('0x4c')]||_0x7948('0x4e'),'osName':util['format'](_0x7948('0x4d'),_0x51b46c['os'][_0x7948('0x2f')],_0x51b46c['os'][_0x7948('0x4c')]),'osVersion':_0x51b46c['os'][_0x7948('0x4c')],'deviceModel':_0x51b46c[_0x7948('0x4f')][_0x7948('0x50')]&&_0x51b46c[_0x7948('0x4f')][_0x7948('0x51')]?util[_0x7948('0x33')](_0x7948('0x52'),_0x51b46c['device'][_0x7948('0x50')],_0x51b46c[_0x7948('0x4f')][_0x7948('0x51')],_0x51b46c[_0x7948('0x4f')][_0x7948('0x53')]):null,'deviceVendor':_0x51b46c[_0x7948('0x4f')][_0x7948('0x51')],'deviceType':_0x51b46c[_0x7948('0x4f')][_0x7948('0x53')],'formData':JSON[_0x7948('0x1c')](_0x8c098a)};}exports[_0x7948('0x54')]=function(_0xfcf68d,_0xb195d1){var _0x349ac4={'include':[{'model':db['Pause'],'as':_0x7948('0x55')}]},_0x2a87af={},_0xe5d8f7={'count':0x0,'rows':[]};var _0x2cd8be=_[_0x7948('0x3b')](db[_0x7948('0x56')][_0x7948('0x57')],function(_0x55edb5){return{'name':_0x55edb5[_0x7948('0x58')],'type':_0x55edb5[_0x7948('0x53')][_0x7948('0x59')]};});_0x2a87af['model']=_['map'](_0x2cd8be,_0x7948('0x2f'));_0x2a87af['query']=_[_0x7948('0x5a')](_0xfcf68d[_0x7948('0x5b')]);_0x2a87af[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x2a87af[_0x7948('0x50')],_0x2a87af[_0x7948('0x5b')]);_0x349ac4[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x2a87af[_0x7948('0x50')],qs[_0x7948('0x5f')](_0xfcf68d[_0x7948('0x5b')][_0x7948('0x5f')]));_0x349ac4[_0x7948('0x5e')]=_0x349ac4['attributes'][_0x7948('0x60')]?_0x349ac4[_0x7948('0x5e')]:_0x2a87af['model'];if(!_0xfcf68d['query']['hasOwnProperty'](_0x7948('0x61'))){_0x349ac4[_0x7948('0x26')]=qs[_0x7948('0x26')](_0xfcf68d['query'][_0x7948('0x26')]);_0x349ac4[_0x7948('0x23')]=qs['offset'](_0xfcf68d[_0x7948('0x5b')][_0x7948('0x23')]);}_0x349ac4['order']=qs['sort'](_0xfcf68d[_0x7948('0x5b')]['sort']);_0x349ac4[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0xfcf68d[_0x7948('0x5b')],_0x2a87af[_0x7948('0x5c')]),_0x2cd8be);if(_0xfcf68d[_0x7948('0x5b')][_0x7948('0x64')]){_0x349ac4[_0x7948('0x62')]=_[_0x7948('0x65')](_0x349ac4[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x2cd8be,function(_0x2ef17b){if(_0x2ef17b['type']!==_0x7948('0x66')){var _0x53d091={};_0x53d091[_0x2ef17b[_0x7948('0x2f')]]={'$like':'%'+_0xfcf68d['query'][_0x7948('0x64')]+'%'};return _0x53d091;}})});}_0x349ac4=_['merge']({},_0x349ac4,_0xfcf68d[_0x7948('0x67')]);var _0x27b09b={'where':_0x349ac4[_0x7948('0x62')]};return db[_0x7948('0x56')][_0x7948('0x25')](_0x27b09b)['then'](function(_0x3093f6){_0xe5d8f7[_0x7948('0x25')]=_0x3093f6;if(_0xfcf68d[_0x7948('0x5b')][_0x7948('0x68')]){_0x349ac4[_0x7948('0x69')]=[{'all':!![]}];}return db[_0x7948('0x56')][_0x7948('0x6a')](_0x349ac4);})['then'](function(_0x2f61b1){_0xe5d8f7[_0x7948('0x6b')]=_0x2f61b1;return _0xe5d8f7;})[_0x7948('0x16')](respondWithFilteredResult(_0xb195d1,_0x349ac4))[_0x7948('0x21')](handleError(_0xb195d1,null));};exports[_0x7948('0x6c')]=function(_0x22ede8,_0x15680){var _0x3a04f3={'raw':![],'where':{'id':_0x22ede8[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0x6e')],'as':_0x7948('0x55')}]},_0x4a3b56={};_0x4a3b56['model']=_[_0x7948('0x5a')](db[_0x7948('0x56')][_0x7948('0x57')]);_0x4a3b56[_0x7948('0x5b')]=_['keys'](_0x22ede8[_0x7948('0x5b')]);_0x4a3b56['filters']=_[_0x7948('0x5d')](_0x4a3b56[_0x7948('0x50')],_0x4a3b56[_0x7948('0x5b')]);_0x3a04f3[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x4a3b56[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x22ede8[_0x7948('0x5b')][_0x7948('0x5f')]));_0x3a04f3[_0x7948('0x5e')]=_0x3a04f3['attributes'][_0x7948('0x60')]?_0x3a04f3[_0x7948('0x5e')]:_0x4a3b56[_0x7948('0x50')];if(_0x22ede8[_0x7948('0x5b')][_0x7948('0x68')]){_0x3a04f3[_0x7948('0x69')]=[{'all':!![]}];}_0x3a04f3=_[_0x7948('0x65')]({},_0x3a04f3,_0x22ede8[_0x7948('0x67')]);return db[_0x7948('0x56')][_0x7948('0x6f')](_0x3a04f3)[_0x7948('0x16')](handleEntityNotFound(_0x15680,null))[_0x7948('0x16')](respondWithResult(_0x15680,null))['catch'](handleError(_0x15680,null));};exports[_0x7948('0x70')]=function(_0x5ec4f9,_0xd50a6a){return db['ChatWebsite'][_0x7948('0x70')](_0x5ec4f9[_0x7948('0x71')],{})['then'](function(_0x15d14f){var _0x35bfdf=_0x5ec4f9['user'][_0x7948('0x3d')]({'plain':!![]});if(!_0x35bfdf)throw new Error(_0x7948('0x72'));if(_0x35bfdf[_0x7948('0x73')]===_0x7948('0x74')){var _0x186b1d=_0x15d14f[_0x7948('0x3d')]({'plain':!![]});var _0x4e36c0=_0x7948('0x2a');return db[_0x7948('0x75')]['find']({'where':{'name':_0x4e36c0,'userProfileId':_0x35bfdf[_0x7948('0x76')]},'raw':!![]})[_0x7948('0x16')](function(_0x45f2eb){if(_0x45f2eb&&_0x45f2eb[_0x7948('0x77')]===0x0){return db['UserProfileResource'][_0x7948('0x70')]({'name':_0x186b1d[_0x7948('0x2f')],'resourceId':_0x186b1d['id'],'type':_0x45f2eb['name'],'sectionId':_0x45f2eb['id']},{})[_0x7948('0x16')](function(){return _0x15d14f;});}else{return _0x15d14f;}})[_0x7948('0x21')](function(_0x52e0f3){logger['error'](_0x7948('0x78'),_0x52e0f3);throw _0x52e0f3;});}return _0x15d14f;})['then'](respondWithResult(_0xd50a6a,0xc9))[_0x7948('0x21')](handleError(_0xd50a6a,null));};exports[_0x7948('0x79')]=function(_0x535902,_0x372939){if(_0x535902['body']['id']){delete _0x535902['body']['id'];}return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x535902[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0x6e')],'as':_0x7948('0x55')}]})['then'](handleEntityNotFound(_0x372939,null))['then'](saveUpdates(_0x535902['body'],null))[_0x7948('0x16')](respondWithResult(_0x372939,null))[_0x7948('0x21')](handleError(_0x372939,null));};exports[_0x7948('0x29')]=function(_0x3748c3,_0x141dba){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x3748c3[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x141dba,null))[_0x7948('0x16')](removeEntity(_0x141dba,null))['catch'](handleError(_0x141dba,null));};exports[_0x7948('0x7a')]=function(_0xdfff7,_0x25db4e){return db[_0x7948('0x56')][_0x7948('0x7a')]()['then'](respondWithResult(_0x25db4e,null))[_0x7948('0x21')](handleError(_0x25db4e,null));};exports[_0x7948('0x7b')]=function(_0x21e6c9,_0x11a304){if(_0x21e6c9['body']['id']){delete _0x21e6c9['body']['id'];}return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x21e6c9[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x11a304,null))['then'](function(_0x1271d7){if(_0x1271d7){_0x21e6c9[_0x7948('0x71')][_0x7948('0x7c')]=_0x1271d7['id'];return db[_0x7948('0x7d')][_0x7948('0x70')](_0x21e6c9[_0x7948('0x71')]);}})[_0x7948('0x16')](respondWithResult(_0x11a304,null))[_0x7948('0x21')](handleError(_0x11a304,null));};exports[_0x7948('0x7e')]=function(_0x3cd2ae,_0x95216e){var _0x5f0385={'raw':![],'where':{}};var _0x270949={};var _0x4dcadf={'count':0x0,'rows':[]};return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x3cd2ae[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x95216e,null))[_0x7948('0x16')](function(_0x1a4689){if(_0x1a4689){_0x270949[_0x7948('0x50')]=_['keys'](db[_0x7948('0x7d')]['rawAttributes']);_0x270949['query']=_[_0x7948('0x5a')](_0x3cd2ae['query']);_0x270949[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x270949[_0x7948('0x50')],_0x270949[_0x7948('0x5b')]);_0x5f0385[_0x7948('0x5e')]=_['intersection'](_0x270949[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x3cd2ae[_0x7948('0x5b')]['fields']));_0x5f0385[_0x7948('0x5e')]=_0x5f0385[_0x7948('0x5e')][_0x7948('0x60')]?_0x5f0385[_0x7948('0x5e')]:_0x270949[_0x7948('0x50')];if(!_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x5f0385[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x26')]);_0x5f0385[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x23')]);}_0x5f0385[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x82')]);_0x5f0385['where']=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x3cd2ae['query'],_0x270949['filters']));_0x5f0385['where'][_0x7948('0x7c')]=_0x1a4689['id'];if(_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x64')]){_0x5f0385[_0x7948('0x62')]=_['merge'](_0x5f0385[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x5f0385[_0x7948('0x5e')],function(_0x33b80b){var _0x405e55={};_0x405e55[_0x33b80b]={'$like':'%'+_0x3cd2ae[_0x7948('0x5b')]['filter']+'%'};return _0x405e55;})});}_0x5f0385=_[_0x7948('0x65')]({},_0x5f0385,_0x3cd2ae[_0x7948('0x67')]);return db['Disposition'][_0x7948('0x25')]({'where':_0x5f0385['where']})['then'](function(_0x5733e4){_0x4dcadf[_0x7948('0x25')]=_0x5733e4;if(_0x3cd2ae[_0x7948('0x5b')][_0x7948('0x68')]){_0x5f0385[_0x7948('0x69')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5f0385);})[_0x7948('0x16')](function(_0x4d8aac){_0x4dcadf[_0x7948('0x6b')]=_0x4d8aac;return _0x4dcadf;});}})[_0x7948('0x16')](respondWithFilteredResult(_0x95216e,_0x5f0385))[_0x7948('0x21')](handleError(_0x95216e,null));};exports['removeDispositions']=function(_0x3cbbd9,_0x2935ea){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x3cbbd9[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x2935ea,null))[_0x7948('0x16')](function(_0x3fb943){if(_0x3fb943){return _0x3fb943[_0x7948('0x83')](_0x3cbbd9[_0x7948('0x5b')][_0x7948('0x84')]);}})[_0x7948('0x16')](respondWithStatusCode(_0x2935ea,null))[_0x7948('0x21')](handleError(_0x2935ea,null));};exports['addAnswer']=function(_0x313fe1,_0x3f632f){if(_0x313fe1['body']['id']){delete _0x313fe1[_0x7948('0x71')]['id'];}return db[_0x7948('0x56')]['find']({'where':{'id':_0x313fe1[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x3f632f,null))['then'](function(_0xdfbbff){if(_0xdfbbff){_0x313fe1[_0x7948('0x71')][_0x7948('0x7c')]=_0xdfbbff['id'];return db['CannedAnswer'][_0x7948('0x70')](_0x313fe1[_0x7948('0x71')]);}})[_0x7948('0x16')](respondWithResult(_0x3f632f,null))[_0x7948('0x21')](handleError(_0x3f632f,null));};exports[_0x7948('0x85')]=function(_0x4340bc,_0x118e05){var _0x962ee7={'raw':![],'where':{}};var _0x37ccd8={};var _0x294a59={'count':0x0,'rows':[]};return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x4340bc[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x118e05,null))[_0x7948('0x16')](function(_0x5dfbbe){if(_0x5dfbbe){_0x37ccd8[_0x7948('0x50')]=_[_0x7948('0x5a')](db['CannedAnswer'][_0x7948('0x57')]);_0x37ccd8[_0x7948('0x5b')]=_[_0x7948('0x5a')](_0x4340bc[_0x7948('0x5b')]);_0x37ccd8[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x37ccd8[_0x7948('0x50')],_0x37ccd8[_0x7948('0x5b')]);_0x962ee7[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x37ccd8[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x4340bc['query'][_0x7948('0x5f')]));_0x962ee7[_0x7948('0x5e')]=_0x962ee7[_0x7948('0x5e')][_0x7948('0x60')]?_0x962ee7[_0x7948('0x5e')]:_0x37ccd8[_0x7948('0x50')];if(!_0x4340bc[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x962ee7[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x4340bc['query']['limit']);_0x962ee7[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x4340bc['query'][_0x7948('0x23')]);}_0x962ee7[_0x7948('0x81')]=qs['sort'](_0x4340bc['query'][_0x7948('0x82')]);_0x962ee7[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x4340bc['query'],_0x37ccd8[_0x7948('0x5c')]));_0x962ee7[_0x7948('0x62')][_0x7948('0x7c')]=_0x5dfbbe['id'];if(_0x4340bc[_0x7948('0x5b')][_0x7948('0x64')]){_0x962ee7[_0x7948('0x62')]=_[_0x7948('0x65')](_0x962ee7[_0x7948('0x62')],{'$or':_['map'](_0x962ee7[_0x7948('0x5e')],function(_0x477fdf){var _0x23a85b={};_0x23a85b[_0x477fdf]={'$like':'%'+_0x4340bc[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x23a85b;})});}_0x962ee7=_[_0x7948('0x65')]({},_0x962ee7,_0x4340bc[_0x7948('0x67')]);return db[_0x7948('0x86')][_0x7948('0x25')]({'where':_0x962ee7[_0x7948('0x62')]})[_0x7948('0x16')](function(_0x4c6392){_0x294a59[_0x7948('0x25')]=_0x4c6392;if(_0x4340bc[_0x7948('0x5b')]['includeAll']){_0x962ee7[_0x7948('0x69')]=[{'all':!![]}];}return db[_0x7948('0x86')]['findAll'](_0x962ee7);})['then'](function(_0x239640){_0x294a59[_0x7948('0x6b')]=_0x239640;return _0x294a59;});}})['then'](respondWithFilteredResult(_0x118e05,_0x962ee7))['catch'](handleError(_0x118e05,null));};exports['removeAnswers']=function(_0x2bc53c,_0xe86df9){return db[_0x7948('0x56')]['find']({'where':{'id':_0x2bc53c[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0xe86df9,null))[_0x7948('0x16')](function(_0x21728f){if(_0x21728f){return _0x21728f['removeAnswers'](_0x2bc53c['query'][_0x7948('0x84')]);}})[_0x7948('0x16')](respondWithStatusCode(_0xe86df9,null))[_0x7948('0x21')](handleError(_0xe86df9,null));};exports[_0x7948('0x87')]=function(_0x3be840,_0x441645){_0x3be840[_0x7948('0x71')][_0x7948('0x88')]=_0x3be840[_0x7948('0x89')][_0x7948('0x8a')];return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x3be840[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x441645,null))[_0x7948('0x16')](saveUpdates(_0x3be840[_0x7948('0x71')],null))[_0x7948('0x16')](respondWithResult(_0x441645,null))[_0x7948('0x21')](handleError(_0x441645,null));};exports[_0x7948('0x8b')]=function(_0x4925fb,_0x27ab0c){_0x4925fb[_0x7948('0x71')][_0x7948('0x8c')]=_0x4925fb[_0x7948('0x89')][_0x7948('0x8a')];return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x4925fb[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x27ab0c,null))[_0x7948('0x16')](saveUpdates(_0x4925fb[_0x7948('0x71')],null))[_0x7948('0x16')](respondWithResult(_0x27ab0c,null))[_0x7948('0x21')](handleError(_0x27ab0c,null));};exports['addCustomerAvatar']=function(_0x4ed5a1,_0x588bce){_0x4ed5a1[_0x7948('0x71')][_0x7948('0x8d')]=_0x4ed5a1[_0x7948('0x89')]['filename'];return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x4ed5a1[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x588bce,null))[_0x7948('0x16')](saveUpdates(_0x4ed5a1[_0x7948('0x71')],null))[_0x7948('0x16')](respondWithResult(_0x588bce,null))[_0x7948('0x21')](handleError(_0x588bce,null));};exports['addSystemAvatar']=function(_0x43f116,_0x389a47){_0x43f116['body'][_0x7948('0x8e')]=_0x43f116['file']['filename'];return db['ChatWebsite'][_0x7948('0x6f')]({'where':{'id':_0x43f116[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x389a47,null))['then'](saveUpdates(_0x43f116['body'],null))[_0x7948('0x16')](respondWithResult(_0x389a47,null))['catch'](handleError(_0x389a47,null));};exports['getLogo']=function(_0x302e68,_0x371b97){var _0x5f1ede=path[_0x7948('0x8f')](config['root'],_0x7948('0x90'));var _0x4658b2={'where':{'id':_0x302e68[_0x7948('0x6d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x21da48=![];return require(_0x7948('0x91'))[_0x7948('0x92')]()['then'](function(_0x51a8ad){if(_0x51a8ad){_0x21da48=_0x51a8ad['custom'];}})['then'](function(){return db[_0x7948('0x56')][_0x7948('0x6f')](_0x4658b2);})['then'](handleEntityNotFound(_0x371b97,null))['then'](function(_0x535cd2){if(_0x535cd2){if(!_['isNil'](_0x535cd2[_0x7948('0x88')])){if(fs['existsSync'](path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/logos/',_0x535cd2[_0x7948('0x88')]))&&_0x21da48){_0x5f1ede=path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/logos/',_0x535cd2[_0x7948('0x88')]);}}return _0x371b97[_0x7948('0x94')](_0x5f1ede);}})['catch'](handleError(_0x371b97,null));};exports['getAvatar']=function(_0x16d547,_0x14e945){var _0xd7120f=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x231ed4={'where':{'id':_0x16d547[_0x7948('0x6d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7948('0x56')][_0x7948('0x6f')](_0x231ed4)[_0x7948('0x16')](handleEntityNotFound(_0x14e945,null))['then'](function(_0x22efb0){if(_0x22efb0){if(!_[_0x7948('0x95')](_0x22efb0[_0x7948('0x8c')])){if(fs[_0x7948('0x96')](path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0x97'),_0x22efb0[_0x7948('0x8c')]))){_0xd7120f=path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/avatars/',_0x22efb0['agentAvatar']);}}return _0x14e945['download'](_0xd7120f);}})[_0x7948('0x21')](handleError(_0x14e945,null));};exports[_0x7948('0x98')]=function(_0x2bb0ce,_0x26179e){var _0x3494ff=path[_0x7948('0x8f')](config[_0x7948('0x93')],'server/files/images/avatars/customer_avatar.png');var _0x211634={'where':{'id':_0x2bb0ce[_0x7948('0x6d')]['id']},'attributes':['id',_0x7948('0x8d'),_0x7948('0x99')],'raw':!![]};return db[_0x7948('0x56')][_0x7948('0x6f')](_0x211634)['then'](handleEntityNotFound(_0x26179e,null))[_0x7948('0x16')](function(_0x165eb6){if(_0x165eb6){if(!_[_0x7948('0x95')](_0x165eb6[_0x7948('0x8d')])){if(fs[_0x7948('0x96')](path['join'](config['root'],_0x7948('0x97'),_0x165eb6[_0x7948('0x8d')]))&&_0x165eb6[_0x7948('0x99')]){_0x3494ff=path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0x97'),_0x165eb6[_0x7948('0x8d')]);}}return _0x26179e[_0x7948('0x94')](_0x3494ff);}})['catch'](handleError(_0x26179e,null));};exports[_0x7948('0x9a')]=function(_0x7914ca,_0x2a4182){var _0x34974d=path[_0x7948('0x8f')](config['root'],_0x7948('0x9b'));var _0x208124={'where':{'id':_0x7914ca['params']['id']},'attributes':['id',_0x7948('0x8e')],'raw':!![]};return db['ChatWebsite']['find'](_0x208124)[_0x7948('0x16')](handleEntityNotFound(_0x2a4182,null))[_0x7948('0x16')](function(_0x36b9ad){if(_0x36b9ad){if(!_[_0x7948('0x95')](_0x36b9ad[_0x7948('0x8e')])){if(fs[_0x7948('0x96')](path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0x97'),_0x36b9ad[_0x7948('0x8e')]))){_0x34974d=path[_0x7948('0x8f')](config['root'],_0x7948('0x97'),_0x36b9ad[_0x7948('0x8e')]);}}return _0x2a4182[_0x7948('0x94')](_0x34974d);}})[_0x7948('0x21')](handleError(_0x2a4182,null));};exports[_0x7948('0x9c')]=function(_0x305f0a,_0x36e8d1){var _0x30f159={'body':_0x305f0a[_0x7948('0x71')],'channel':_0x7948('0x9d')};var _0x2d8984=[];var _0x5c180e=[];var _0x3c625e={};var _0x320c3d=![];return db[_0x7948('0x9e')]['describe']()['then'](function(_0xe26e2d){if(!_0xe26e2d){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xa1'));}_0x2d8984=_['difference'](_['keys'](_0xe26e2d),[_0x7948('0xa2'),_0x7948('0xa3')]);_0x5c180e=_[_0x7948('0xa4')](_[_0x7948('0x5a')](_0xe26e2d),[_0x7948('0xa2'),_0x7948('0xa3'),_0x7948('0xa5'),_0x7948('0xa6')]);if(_0x305f0a['body']['id']){delete _0x305f0a[_0x7948('0x71')]['id'];}if(_[_0x7948('0x95')](_0x305f0a[_0x7948('0x71')][_0x7948('0xa7')])){throw new db[(_0x7948('0x9f'))]['ValidationError'](_0x7948('0xa8'));}if(_[_0x7948('0x95')](_0x305f0a[_0x7948('0x71')][_0x7948('0x71')])||_0x305f0a[_0x7948('0x71')][_0x7948('0x71')]===''){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x305f0a['body'][_0x7948('0xa9')])){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xaa')+_0x5c180e);}if(!_[_0x7948('0xab')](_0x5c180e,_0x305f0a[_0x7948('0x71')][_0x7948('0xa9')])){throw new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c180e);}_0x3c625e[_0x305f0a[_0x7948('0x71')]['mapKey']]=_0x305f0a[_0x7948('0x71')][_0x7948('0xa7')];})['then'](function(){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x305f0a['params']['id']},'include':[{'model':db['CmList'],'as':_0x7948('0xac'),'include':[{'model':db[_0x7948('0x9e')],'as':_0x7948('0xad'),'where':_0x3c625e,'limit':0x1,'order':[['updatedAt',_0x7948('0xae')]]}]},{'model':db[_0x7948('0xaf')],'as':_0x7948('0xb0')},{'model':db[_0x7948('0x3c')],'as':_0x7948('0x3c'),'include':[{'model':db[_0x7948('0x3c')],'as':_0x7948('0xb1'),'attributes':['id',_0x7948('0x35')],'raw':!![]}]}]});})[_0x7948('0x16')](function(_0x5ef2a6){if(!_0x5ef2a6)throw new APINotFoundError(util['format'](_0x7948('0xb2'),_0x305f0a[_0x7948('0x6d')]['id']));if(!_0x5ef2a6[_0x7948('0x3c')]||!_0x5ef2a6[_0x7948('0x3c')]['Intervals'])return[_0x5ef2a6,!![]];return[_0x5ef2a6,checkWebsiteIntervals(_0x5ef2a6)];})[_0x7948('0xb3')](function(_0x4ca859,_0x4ff341){if(!_0x4ff341)throw new APIOutOfIntervalError();if(!_0x4ca859['List'])return;_0x30f159[_0x7948('0xb4')]=_0x4ca859;_0x30f159[_0x7948('0xb5')]=_0x4ca859[_0x7948('0xac')];_0x30f159[_0x7948('0xb6')]=_[_0x7948('0xb7')](_0x4ca859[_0x7948('0xb0')],[_0x7948('0xb8')],[_0x7948('0xb9')]);if(_0x30f159['account'][_0x7948('0xb0')]){delete _0x30f159['account'][_0x7948('0xb0')];}if(_0x30f159[_0x7948('0xb4')][_0x7948('0xac')]&&_0x30f159[_0x7948('0xb4')][_0x7948('0xac')][_0x7948('0xad')]['length']){return _0x30f159[_0x7948('0xb4')]['List'][_0x7948('0xad')][0x0];}var _0x3dd076=_[_0x7948('0xba')](_0x305f0a[_0x7948('0x71')],{'firstName':_0x305f0a['body'][_0x7948('0xa7')],'ListId':_0x4ca859[_0x7948('0xa6')]});_0x3dd076[_0x305f0a['body']['mapKey']]=_0x305f0a[_0x7948('0x71')][_0x7948('0xa7')];return db[_0x7948('0x9e')][_0x7948('0x70')](_0x3dd076,{'fields':_0x2d8984,'raw':!![]});})[_0x7948('0x16')](function(_0x5960c2){_0x30f159[_0x7948('0xbb')]=_0x5960c2;var _0x59097b=createInteractionObject(_0x305f0a[_0x7948('0x6d')]['id'],_0x305f0a[_0x7948('0x71')],_0x305f0a[_0x7948('0xbc')],_0x5960c2);var _0x450ddd={'ChatWebsiteId':_0x305f0a[_0x7948('0x6d')]['id'],'closed':![]};if(_0x305f0a[_0x7948('0x71')][_0x7948('0xbd')]){_0x450ddd[_0x7948('0xbd')]=_0x305f0a[_0x7948('0x71')][_0x7948('0xbd')];return db[_0x7948('0xbe')][_0x7948('0x6f')]({'where':_0x450ddd})[_0x7948('0x16')](function(_0x3fb9c9){if(_0x3fb9c9){_0x320c3d=!![];return _0x3fb9c9;}_0x59097b[_0x7948('0xbd')]=_0x305f0a[_0x7948('0x71')][_0x7948('0xbd')];_0x59097b[_0x7948('0xbf')]=_0x305f0a[_0x7948('0x71')][_0x7948('0xbf')];return db[_0x7948('0xbe')][_0x7948('0x70')](_0x59097b);});}_0x450ddd[_0x7948('0xc0')]=_0x5960c2['id'];if(_0x305f0a[_0x7948('0x71')]['interaction']&&_0x305f0a[_0x7948('0x71')]['interaction']['id']){_0x450ddd['id']=_0x305f0a[_0x7948('0x71')][_0x7948('0xc1')]['id'];return db[_0x7948('0xbe')][_0x7948('0x6f')]({'where':_0x450ddd})['then'](function(_0xb3da40){if(_0xb3da40){_0x320c3d=!![];return _0xb3da40;}return db['ChatInteraction']['create'](_0x59097b);});}return db[_0x7948('0xbe')][_0x7948('0x70')](_0x59097b);})[_0x7948('0x16')](function(_0x369c13){if(!_0x320c3d)return _0x369c13;var _0x1f36fd={'from':(_0x30f159[_0x7948('0xbb')][_0x7948('0x48')]||'')+'\x20'+(_0x30f159[_0x7948('0xbb')][_0x7948('0x49')]||'')};if(_0x305f0a['body'][_0x7948('0xbd')]&&_0x305f0a[_0x7948('0x71')][_0x7948('0xc2')]&&_0x305f0a['body'][_0x7948('0xbd')]!=_0x305f0a[_0x7948('0x71')][_0x7948('0xc2')]){_0x1f36fd['threadId']=_0x305f0a['body'][_0x7948('0xc2')];}return _0x369c13['update'](_0x1f36fd);})[_0x7948('0x16')](function(_0x283470){_0x30f159['interaction']=_0x283470['get']({'plain':!![]});_0x30f159[_0x7948('0xc1')][_0x7948('0xc3')]=!_0x320c3d;if(_0x30f159[_0x7948('0xc1')][_0x7948('0xc3')]){if(_0x30f159[_0x7948('0xb4')][_0x7948('0xc4')]){_0x30f159[_0x7948('0xb6')][_0x7948('0xc5')]({'id':0x0,'priority':_0x30f159[_0x7948('0xb6')][_0x7948('0x60')]+0x1,'app':_0x7948('0xc6'),'appdata':'unmanaged','interval':_0x7948('0xc7')});}}return db[_0x7948('0xc8')][_0x7948('0x70')]({'body':_0x305f0a['body'][_0x7948('0x71')],'ChatWebsiteId':_0x305f0a[_0x7948('0x6d')]['id'],'ChatInteractionId':_0x283470['id'],'direction':'in','ContactId':_0x30f159[_0x7948('0xbb')]['id'],'AttachmentId':_0x305f0a[_0x7948('0x71')][_0x7948('0xc9')]});})[_0x7948('0x16')](function(_0x31f928){_0x30f159[_0x7948('0x1f')]=_0x31f928;if(!_0x30f159['interaction']['UserId']){return;}return db['User'][_0x7948('0x6f')]({'attributes':['id',_0x7948('0x2f')],'where':{'id':_0x30f159['interaction'][_0x7948('0xca')]}});})[_0x7948('0x16')](function(_0x34b2ce){if(_0x34b2ce){_0x30f159['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x7948('0xcb'),'appdata':_0x34b2ce['name']+','+(_0x30f159['account'][_0x7948('0xcc')]||0xa),'interval':_0x7948('0xc7')});_0x30f159[_0x7948('0xcd')]=!![];}if(!_0x30f159[_0x7948('0xc1')][_0x7948('0xce')]){return;}return db['ChatQueue'][_0x7948('0x6f')]({'attributes':['id',_0x7948('0x2f')],'where':{'id':_0x30f159[_0x7948('0xc1')][_0x7948('0xce')]}});})[_0x7948('0x16')](function(_0x4f6961){if(_0x4f6961){_0x30f159['applications'][_0x7948('0xcf')]({'id':0x0,'priority':0x1,'app':_0x7948('0xd0'),'appdata':_0x4f6961[_0x7948('0x2f')]+','+(_0x30f159[_0x7948('0xb4')][_0x7948('0xd1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7948('0xd2'),_0x7948('0xd3'),_0x30f159);})[_0x7948('0x16')](function(_0x5a57d5){respondWithRpcPromise(_0x7948('0xd4'),_0x7948('0xd4'),{'event':_0x7948('0x9c'),'message':_0x5a57d5},client9002);return _0x5a57d5;})[_0x7948('0x16')](respondWithResult(_0x36e8d1,null))[_0x7948('0x21')](APIHandleError(_0x36e8d1));};exports[_0x7948('0xd5')]=function(_0x1a12c1,_0x2b5b9d){var _0x30f8a5,_0x7e86ab,_0x81425b;var _0x8c0e4f=[];var _0x3cde0b={};var _0x2d7d00=_0x1a12c1['files']||[];var _0x14513=[];var _0x4e9eef;return db['CmContact']['describe']()['then'](function(_0x4a64c9){if(!_0x4a64c9){throw new db['Sequelize'][(_0x7948('0xa0'))](_0x7948('0xa1'));}_0x8c0e4f=_[_0x7948('0xa4')](_['keys'](_0x4a64c9),[_0x7948('0xa2'),_0x7948('0xa3'),_0x7948('0xa5'),'ListId']);if(_0x1a12c1[_0x7948('0x71')]['id']){delete _0x1a12c1[_0x7948('0x71')]['id'];}if(_[_0x7948('0x95')](_0x1a12c1[_0x7948('0x71')][_0x7948('0xa7')])){throw _0x2b5b9d['status'](0x1f4)[_0x7948('0xd6')](new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xa8')));}if(_[_0x7948('0x95')](_0x1a12c1[_0x7948('0x71')][_0x7948('0x71')])||_0x1a12c1[_0x7948('0x71')][_0x7948('0x71')]===''){throw _0x2b5b9d[_0x7948('0x22')](0x1f4)[_0x7948('0xd6')](new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xd7')));}if(_[_0x7948('0x95')](_0x1a12c1['body'][_0x7948('0xd8')])){throw _0x2b5b9d[_0x7948('0x22')](0x1f4)['send'](new db[(_0x7948('0x9f'))][(_0x7948('0xa0'))](_0x7948('0xd9')+_0x8c0e4f));}if(!_[_0x7948('0xab')](_0x8c0e4f,_0x1a12c1[_0x7948('0x71')][_0x7948('0xd8')])){throw _0x2b5b9d[_0x7948('0x22')](0x1f4)[_0x7948('0xd6')](new db['Sequelize'][(_0x7948('0xa0'))](_0x7948('0xda')+_0x8c0e4f));}_0x3cde0b[_0x1a12c1[_0x7948('0x71')][_0x7948('0xd8')]]=_0x1a12c1['body'][_0x7948('0xa7')];})[_0x7948('0x16')](function(){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x1a12c1[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0xdb')],'as':_0x7948('0xac')},{'model':db[_0x7948('0xdc')],'as':'MailAccount'}]});})[_0x7948('0x16')](handleEntityNotFound(_0x2b5b9d,null))[_0x7948('0x16')](function(_0x5c439e){if(_0x5c439e&&_0x5c439e[_0x7948('0xac')]){_0x7e86ab=_0x5c439e;var _0x1776e9=_[_0x7948('0xba')](_0x1a12c1[_0x7948('0x71')],{'firstName':_0x1a12c1['body'][_0x7948('0xa7')],'phone':_0x1a12c1['body']['from'],'ListId':_0x5c439e[_0x7948('0xa6')]});_0x1776e9[_0x1a12c1['body'][_0x7948('0xd8')]]=_0x1a12c1[_0x7948('0x71')]['from'];return db[_0x7948('0x9e')][_0x7948('0xdd')]({'where':_0x3cde0b,'defaults':_0x1776e9});}})[_0x7948('0xb3')](function(_0x508e47){if(_0x508e47){_0x81425b=_0x508e47;var _0x22396a=fs[_0x7948('0xde')](path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0xdf')),_0x7948('0xe0'));var _0x391d11=ejs[_0x7948('0xe1')](_0x22396a,{'body':_[_0x7948('0xe2')](_0x1a12c1['body'][_0x7948('0x71')]),'bodyTitle':_0x7e86ab[_0x7948('0xe3')]});return db[_0x7948('0xe4')][_0x7948('0x70')]({'body':_0x391d11,'plainBody':htmlToText[_0x7948('0xe5')](_0x391d11),'ContactId':_0x508e47['id'],'ChatWebsiteId':_0x7e86ab['id']});}})[_0x7948('0x16')](function(_0x366a2d){_0x4e9eef=_0x366a2d;if(_0x2d7d00[_0x7948('0x60')]){var _0x12c7ad=_0x2d7d00[_0x7948('0x3b')](function(_0x39ecfd){return{'name':_0x39ecfd[_0x7948('0xe6')],'basename':_0x39ecfd[_0x7948('0x8a')],'type':_0x39ecfd['mimetype'],'ChatOfflineMessageId':_0x366a2d['id']};});_0x14513=_0x12c7ad['map'](_0x203919=>{var _0x56bcd0={'filename':_0x203919[_0x7948('0x2f')],'path':path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0xe7'),_0x7948('0xe8'),_0x7948('0xe9'),_0x7948('0xea'),_0x203919[_0x7948('0xeb')])};return _0x56bcd0;});if(!_0x7e86ab['openNewInteraction']){return db['sequelize'][_0x7948('0xec')](function(_0x48b85c){return db[_0x7948('0xed')][_0x7948('0xee')](_0x12c7ad,{'transaction':_0x48b85c});});}}})[_0x7948('0x16')](function(){if(_0x4e9eef){_0x30f8a5=_0x4e9eef;return db['MailAccount'][_0x7948('0x7f')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7948('0xef')],'as':_0x7948('0xef'),'raw':!![]}]}]});}})[_0x7948('0x16')](function(_0x1e226c){if(_0x1e226c&&_0x1e226c['Smtp']&&_0x7e86ab['forwardOffline']&&_0x7e86ab[_0x7948('0xf0')]){var _0xf33154=_0x1e226c[_0x7948('0xf1')]();return respondWithRpcPromise(_0x7948('0xf2'),_0x7948('0xf3'),{'account':_0xf33154,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1e226c[_0x7948('0x2f')],_0x1e226c['email']||_0x1e226c[_0x7948('0xf4')][_0x7948('0x74')]),'to':_0x7e86ab[_0x7948('0xf0')],'subject':_0x7e86ab['offlineMessageSubject'],'html':_0x30f8a5[_0x7948('0x71')],'attachments':_0x14513}},client9003)['then'](function(){return _0x30f8a5;})['catch'](function(_0x8d06f4){logger[_0x7948('0x1d')](_0x8d06f4);});}})[_0x7948('0x16')](function(){if(_0x7e86ab&&_0x7e86ab[_0x7948('0xf5')]&&_0x7e86ab['MailAccountId']){var _0x5886d6=[];if(_0x2d7d00[_0x7948('0x60')]){_0x5886d6=_0x2d7d00[_0x7948('0x3b')](function(_0x454b46){return{'name':_0x454b46[_0x7948('0xe6')],'basename':_0x454b46[_0x7948('0x8a')],'type':_0x454b46[_0x7948('0xf6')],'ChatOfflineMessageId':_0x4e9eef['id']};});}var _0x4562c7;if(!_['isNil'](_0x7e86ab['subjectOffline'])){var _0x121549=_['map'](_0x1a12c1[_0x7948('0x71')],function(_0x2c8bf8){return _0x2c8bf8;});var _0x4cb23a=_['toPairsIn'](_0x121549)[0x0];var _0xf8c0a4=_[_0x7948('0xf7')](_0x4cb23a,function(_0x5363df){return _0x5363df;});_0x4562c7=_0xf8c0a4[0x1][_0x7e86ab[_0x7948('0xf8')]];}var _0x53b399={'from':_0x81425b[_0x7948('0xf9')],'firstName':_0x81425b[_0x7948('0x48')],'lastName':_0x81425b[_0x7948('0x49')],'mapKey':_0x7948('0xf9'),'message':{'from':_0x81425b[_0x7948('0xf9')],'to':_0x7e86ab['MailAccount'][_0x7948('0xf9')],'cc':'','subject':_[_0x7948('0x95')](_0x4562c7)?_0x7e86ab[_0x7948('0xfa')]:_0x4562c7,'messageId':'','sentAt':new Date(),'attach':_0x5886d6[_0x7948('0x60')],'attachments':_0x5886d6,'originChannel':_0x7948('0xfb'),'ChatWebsiteId':_0x7e86ab['id'],'ChatOfflineMessageId':_0x30f8a5['id'],'originTo':_0x7e86ab[_0x7948('0xdc')]['email']},'body':_0x30f8a5['body']};var _0x242f35={'account':{'id':_0x7e86ab[_0x7948('0xfc')]},'body':_0x53b399,'log':_0x7948('0xfd')};return respondWithRpcPromise('NotifyMailAccount',_0x7948('0xfe'),_0x242f35,client9001)['then'](function(){return _0x30f8a5;})[_0x7948('0x21')](function(_0x4b4764){logger[_0x7948('0x1d')](_0x4b4764);});}return;})[_0x7948('0x16')](function(){if(_0x30f8a5){return _0x30f8a5;}})[_0x7948('0x16')](respondWithResult(_0x2b5b9d,null))['catch'](function(){for(var _0x5b1dfd of _0x2d7d00){var _0x46130d=path[_0x7948('0x8f')](config[_0x7948('0x93')],_0x7948('0xe7'),_0x7948('0xe8'),_0x7948('0xe9'),_0x7948('0xea'),_0x5b1dfd[_0x7948('0x8a')]);fs_extra['remove'](_0x46130d)[_0x7948('0x21')](function(_0x263db9){logger[_0x7948('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x46130d,_0x263db9);});}});};exports[_0x7948('0xff')]=function(_0x21d56f,_0x35d2fe){return db[_0x7948('0xbe')]['find']({'where':{'id':_0x21d56f[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x35d2fe,null))['then'](function(_0x571840){if(_0x571840){return _0x571840['addInteraction'](_0x21d56f[_0x7948('0x71')]['ids'],_[_0x7948('0x100')](_0x21d56f[_0x7948('0x71')],[_0x7948('0x84'),'id'])||{});}})[_0x7948('0x16')](respondWithResult(_0x35d2fe,null))['catch'](handleError(_0x35d2fe,null));};exports[_0x7948('0x101')]=function(_0x2a7a06,_0xa7eacb){var _0x438c78={'raw':![],'where':{}};var _0x48beba={};var _0x4b624f={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2a7a06[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0xa7eacb,null))[_0x7948('0x16')](function(_0x599fc2){if(_0x599fc2){_0x48beba['model']=_[_0x7948('0x5a')](db['ChatInteraction']['rawAttributes']);_0x48beba['query']=_[_0x7948('0x5a')](_0x2a7a06['query']);_0x48beba['filters']=_[_0x7948('0x5d')](_0x48beba[_0x7948('0x50')],_0x48beba[_0x7948('0x5b')]);_0x438c78[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x48beba['model'],qs[_0x7948('0x5f')](_0x2a7a06[_0x7948('0x5b')][_0x7948('0x5f')]));_0x438c78[_0x7948('0x5e')]=_0x438c78[_0x7948('0x5e')][_0x7948('0x60')]?_0x438c78[_0x7948('0x5e')]:_0x48beba[_0x7948('0x50')];if(!_0x2a7a06[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x438c78[_0x7948('0x26')]=qs['limit'](_0x2a7a06['query'][_0x7948('0x26')]);_0x438c78[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x2a7a06[_0x7948('0x5b')][_0x7948('0x23')]);}_0x438c78[_0x7948('0x81')]=qs['sort'](_0x2a7a06[_0x7948('0x5b')]['sort']);_0x438c78[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x2a7a06[_0x7948('0x5b')],_0x48beba['filters']));_0x438c78['where']['ChatWebsiteId']=_0x599fc2['id'];if(_0x2a7a06[_0x7948('0x5b')]['filter']){_0x438c78['where']=_[_0x7948('0x65')](_0x438c78[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x438c78[_0x7948('0x5e')],function(_0x26bfc3){var _0x7578a6={};_0x7578a6[_0x26bfc3]={'$like':'%'+_0x2a7a06[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x7578a6;})});}_0x438c78=_[_0x7948('0x65')]({},_0x438c78,_0x2a7a06[_0x7948('0x67')]);return db[_0x7948('0xbe')][_0x7948('0x25')]({'where':_0x438c78[_0x7948('0x62')]})['then'](function(_0x4832de){_0x4b624f[_0x7948('0x25')]=_0x4832de;if(_0x2a7a06['query'][_0x7948('0x68')]){_0x438c78[_0x7948('0x69')]=[{'model':db[_0x7948('0x9e')],'as':_0x7948('0x102'),'required':![]},{'model':db[_0x7948('0x103')],'as':'Owner','attributes':[_0x7948('0x2f'),'fullname',_0x7948('0x104')],'required':![]},{'model':db[_0x7948('0x105')],'as':_0x7948('0x106'),'attributes':['id','name',_0x7948('0x107')],'where':_0x2a7a06[_0x7948('0x5b')]['tag']?{'id':_0x2a7a06[_0x7948('0x5b')][_0x7948('0x108')]}:undefined,'required':_0x2a7a06['query'][_0x7948('0x108')]?!![]:![]}];}return db[_0x7948('0xbe')][_0x7948('0x6a')](_0x438c78);})[_0x7948('0x16')](function(_0x4f9394){_0x4b624f['rows']=_0x4f9394;return _0x4b624f;});}})[_0x7948('0x16')](respondWithFilteredResult(_0xa7eacb,_0x438c78))[_0x7948('0x21')](handleError(_0xa7eacb,null));};exports[_0x7948('0x31')]=function(_0x423b45,_0x356126){var _0x2319ef=0x0;var _0x2b7922=0x0;var _0x9d0a89=![];var _0x599c92;var _0x5cd732;return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x423b45[_0x7948('0x6d')]['id']},'include':[{'model':db[_0x7948('0x3c')],'as':'Interval','include':[{'model':db[_0x7948('0x3c')],'as':'Intervals','attributes':['id',_0x7948('0x35')]}]}]})[_0x7948('0x16')](handleEntityNotFound(_0x356126,null))[_0x7948('0x16')](function(_0x203e64){if(_0x203e64){_0x599c92=_0x203e64;return _0x203e64[_0x7948('0x109')]({'raw':!![]});}})[_0x7948('0x16')](function(_0x5dd9ed){if(_0x599c92){if(_0x5dd9ed){_0x5cd732=_0x5dd9ed;}}return require(_0x7948('0x91'))['getLicense']();})['then'](function(_0x1013d2){if(_0x1013d2){_0x2b7922=_0x1013d2[_0x7948('0x10a')];_0x9d0a89=_0x1013d2[_0x7948('0x10b')];}})[_0x7948('0x16')](function(){return db[_0x7948('0xbe')]['count']({'where':{'closed':![]}});})[_0x7948('0x16')](function(_0xe0d3b4){_0x2319ef=_0xe0d3b4;if(_0x2b7922&&_0xe0d3b4>_0x2b7922){return db[_0x7948('0x10c')][_0x7948('0x7f')]({'where':{'id':0x1}})[_0x7948('0x16')](function(_0x5c1dab){if(_0x5c1dab){_0x5c1dab[_0x7948('0x10d')](_0x7948('0x10e'));}});}})[_0x7948('0x16')](function(){if(!_0x599c92[_0x7948('0x3c')]||!_0x599c92[_0x7948('0x3c')][_0x7948('0xb1')])return!![];return checkWebsiteIntervals(_0x599c92);})[_0x7948('0x16')](function(_0x137b61){var _0x15cabd=fs[_0x7948('0xde')](path['join'](config['root'],'server/files/chat/iframe.ejs'),_0x7948('0xe0'));var _0x375a1a=new url[(_0x7948('0x10f'))](_0x599c92['address'])['origin'];var _0x238366='3.5.0';var _0x44ce32=![];var _0x953603={'chatVersion':_0x238366,'chatWebsiteAddressOrigin':_0x375a1a,'remote':_0x599c92[_0x7948('0x110')],'query':querystring[_0x7948('0x1c')](_[_0x7948('0x65')](_0x599c92[_0x7948('0x3d')]({'plain':!![]}),{'customerIp':_0x423b45[_0x7948('0xbc')][_0x7948('0x46')]||_0x423b45['headers'][_0x7948('0x111')]||_0x423b45[_0x7948('0x112')][_0x7948('0x113')]||_0x423b45['ip'],'referer':_0x423b45[_0x7948('0xbc')][_0x7948('0x114')],'openedInteractions':_0x2319ef,'maxInteractions':_0x2b7922,'virtual':_0x9d0a89['virtual'],'online':_0x137b61,'custom':_0x9d0a89}))['replace'](/'/g,'\x5c\x27')};_0x356126['send'](ejs[_0x7948('0xe1')](Mustache[_0x7948('0xe1')](_0x15cabd,_0x953603),{'proactiveActions':_0x5cd732,'alignment':_0x599c92[_0x7948('0x115')],'verticalAlignment':_0x599c92[_0x7948('0x116')],'div_color':_0x599c92[_0x7948('0x107')],'labelText':_0x599c92['labelText'],'text_color':_0x599c92[_0x7948('0x117')],'text_button_color':_0x599c92[_0x7948('0x118')],'button_color':_0x599c92[_0x7948('0x119')],'background_color':_0x599c92[_0x7948('0x11a')],'hideWhenOffline':_0x599c92[_0x7948('0x11b')],'intervalId':_0x599c92['IntervalId'],'isDevelopment':_0x44ce32,'chatVersion':_0x238366}));})['catch'](handleError(_0x356126,null));};exports[_0x7948('0x11c')]=function(_0x10adef,_0x31f764){var _0xe56cf8=_0x10adef[_0x7948('0x6d')]['id'];var _0x3ffea7=_0x10adef[_0x7948('0x71')];var _0x28a84e=0xc8;var _0x13e239=null;return db[_0x7948('0x11d')]['transaction']({'isolationLevel':db['sequelize'][_0x7948('0x11e')][_0x7948('0x11f')][_0x7948('0x120')]},function(_0x277e85){return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0xe56cf8},'transaction':_0x277e85})[_0x7948('0x16')](function(_0xbb7ab1){if(_0xbb7ab1){return db[_0x7948('0xaf')][_0x7948('0x29')]({'where':{'ChatWebsiteId':_0xe56cf8},'transaction':_0x277e85})[_0x7948('0x16')](function(){var _0x574dd6=_[_0x7948('0x3b')](_0x3ffea7,function(_0x492049){_0x492049[_0x7948('0x7c')]=_0xe56cf8;return _0x492049;});return db[_0x7948('0xaf')][_0x7948('0xee')](_0x574dd6,{'transaction':_0x277e85});});}else{_0x28a84e=0x194;_0x13e239=[];}});})['then'](function(){if(_0x28a84e!==0x194){return db[_0x7948('0xaf')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xe56cf8},'order':_0x7948('0xb8')})[_0x7948('0x16')](function(_0xdd114f){_0x13e239=_0xdd114f;});}})[_0x7948('0x21')](function(_0x129b93){_0x28a84e=0x1f4;logger[_0x7948('0x1d')](_0x129b93[_0x7948('0x2e')]);if(_0x129b93[_0x7948('0x2f')]){delete _0x129b93[_0x7948('0x2f')];}_0x13e239=_0x129b93;})[_0x7948('0x121')](function(){if(_0x13e239===null){_0x31f764[_0x7948('0x2d')](_0x28a84e);}else{if(_0x28a84e===0x1f4){_0x31f764[_0x7948('0x22')](_0x28a84e)[_0x7948('0xd6')](_0x13e239);}else{_0x31f764[_0x7948('0x22')](_0x28a84e)[_0x7948('0x122')](_0x13e239);}}});};exports[_0x7948('0x123')]=function(_0x5c405d,_0x121afa){var _0x340128={};var _0x23ac21={};var _0x22a403;var _0x568182;return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x5c405d[_0x7948('0x6d')]['id']}})['then'](handleEntityNotFound(_0x121afa,null))[_0x7948('0x16')](function(_0x22a968){if(_0x22a968){_0x22a403=_0x22a968;_0x23ac21[_0x7948('0x50')]=_[_0x7948('0x5a')](db[_0x7948('0xaf')]['rawAttributes']);_0x23ac21[_0x7948('0x5b')]=_['keys'](_0x5c405d[_0x7948('0x5b')]);_0x23ac21[_0x7948('0x5c')]=_[_0x7948('0x5d')](_0x23ac21[_0x7948('0x50')],_0x23ac21[_0x7948('0x5b')]);_0x340128[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x23ac21[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x5c405d[_0x7948('0x5b')][_0x7948('0x5f')]));_0x340128[_0x7948('0x5e')]=_0x340128[_0x7948('0x5e')]['length']?_0x340128['attributes']:_0x23ac21['model'];_0x340128[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x5c405d[_0x7948('0x5b')][_0x7948('0x82')]);_0x340128['where']=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x5c405d[_0x7948('0x5b')],_0x23ac21['filters']));if(_0x5c405d['query'][_0x7948('0x64')]){_0x340128['where']=_[_0x7948('0x65')](_0x340128[_0x7948('0x62')],{'$or':_['map'](_0x340128['attributes'],function(_0x1e2913){var _0x4b9c82={};_0x4b9c82[_0x1e2913]={'$like':'%'+_0x5c405d[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x4b9c82;})});}_0x340128=_[_0x7948('0x65')]({},_0x340128,_0x5c405d['options']);return _0x22a403[_0x7948('0x123')](_0x340128);}})[_0x7948('0x16')](function(_0x2272ea){if(_0x2272ea){_0x568182=_0x2272ea[_0x7948('0x60')];if(!_0x5c405d[_0x7948('0x5b')][_0x7948('0x80')]('nolimit')){_0x340128[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x5c405d[_0x7948('0x5b')]['limit']);_0x340128['offset']=qs[_0x7948('0x23')](_0x5c405d[_0x7948('0x5b')][_0x7948('0x23')]);}return _0x22a403[_0x7948('0x123')](_0x340128);}})['then'](function(_0x24b811){if(_0x24b811){return _0x24b811?{'count':_0x568182,'rows':_0x24b811}:null;}})[_0x7948('0x16')](respondWithResult(_0x121afa,null))['catch'](handleError(_0x121afa,null));};exports[_0x7948('0x124')]=function(_0x24d890,_0x23a25e){return db[_0x7948('0x125')]['find']({'where':{'id':_0x24d890[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x23a25e,null))[_0x7948('0x16')](function(_0x3ac360){if(_0x3ac360){return _0x3ac360['addProactiveActions'](_0x24d890[_0x7948('0x71')][_0x7948('0x84')],_[_0x7948('0x100')](_0x24d890[_0x7948('0x71')],[_0x7948('0x84'),'id'])||{});}})[_0x7948('0x16')](respondWithResult(_0x23a25e,null))[_0x7948('0x21')](handleError(_0x23a25e,null));};exports[_0x7948('0x109')]=function(_0x4a1922,_0xe1eaf0){var _0x5739dc={};var _0x3f87e8={};var _0x5b7633;var _0x2f536c;return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x4a1922[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0xe1eaf0,null))['then'](function(_0x499327){if(_0x499327){_0x5b7633=_0x499327;_0x3f87e8[_0x7948('0x50')]=_['keys'](db[_0x7948('0x126')]['rawAttributes']);_0x3f87e8[_0x7948('0x5b')]=_['keys'](_0x4a1922[_0x7948('0x5b')]);_0x3f87e8['filters']=_['intersection'](_0x3f87e8[_0x7948('0x50')],_0x3f87e8[_0x7948('0x5b')]);_0x5739dc[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x3f87e8['model'],qs[_0x7948('0x5f')](_0x4a1922[_0x7948('0x5b')][_0x7948('0x5f')]));_0x5739dc['attributes']=_0x5739dc[_0x7948('0x5e')][_0x7948('0x60')]?_0x5739dc[_0x7948('0x5e')]:_0x3f87e8[_0x7948('0x50')];_0x5739dc[_0x7948('0x81')]=qs['sort'](_0x4a1922[_0x7948('0x5b')][_0x7948('0x82')]);_0x5739dc['where']=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x4a1922[_0x7948('0x5b')],_0x3f87e8[_0x7948('0x5c')]));if(_0x4a1922[_0x7948('0x5b')][_0x7948('0x64')]){_0x5739dc[_0x7948('0x62')]=_[_0x7948('0x65')](_0x5739dc[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x5739dc['attributes'],function(_0x375dae){var _0xeb4f4e={};_0xeb4f4e[_0x375dae]={'$like':'%'+_0x4a1922[_0x7948('0x5b')]['filter']+'%'};return _0xeb4f4e;})});}_0x5739dc=_['merge']({},_0x5739dc,_0x4a1922['options']);return _0x5b7633[_0x7948('0x109')](_0x5739dc);}})[_0x7948('0x16')](function(_0x295274){if(_0x295274){_0x2f536c=_0x295274[_0x7948('0x60')];if(!_0x4a1922[_0x7948('0x5b')][_0x7948('0x80')](_0x7948('0x61'))){_0x5739dc[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x4a1922[_0x7948('0x5b')][_0x7948('0x26')]);_0x5739dc[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x4a1922[_0x7948('0x5b')][_0x7948('0x23')]);}return _0x5b7633[_0x7948('0x109')](_0x5739dc);}})[_0x7948('0x16')](function(_0x47daf2){if(_0x47daf2){return _0x47daf2?{'count':_0x2f536c,'rows':_0x47daf2}:null;}})[_0x7948('0x16')](respondWithResult(_0xe1eaf0,null))[_0x7948('0x21')](handleError(_0xe1eaf0,null));};exports[_0x7948('0x127')]=function(_0xbc1b74,_0x541e7d){var _0x1aa6fb=_0xbc1b74[_0x7948('0x5b')][_0x7948('0x128')]===_0x7948('0x129')?_0x7948('0x12a'):_0x7948('0x12b');return db[_0x7948('0x56')][_0x7948('0x6f')]({'attributes':['id',_0x1aa6fb],'where':{'id':_0xbc1b74['params']['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x541e7d,null))['then'](function(_0x2fc1db){if(_0x2fc1db){var _0x3ccc7b=_0x2fc1db[_0x1aa6fb];var _0x532a15=_0x3ccc7b&&_0x3ccc7b['items']?_0x3ccc7b[_0x7948('0x12c')]:[];_0x541e7d[_0x7948('0xd6')]({'fromKey':_[_0x7948('0x95')](_0x3ccc7b[_0x7948('0x12d')])?undefined:_0x3ccc7b[_0x7948('0x12d')],'count':_0x532a15[_0x7948('0x60')],'rows':_0x532a15});}})[_0x7948('0x21')](handleError(_0x541e7d,null));};exports[_0x7948('0x12e')]=function(_0x21cee3,_0x40c212){var _0x13f5ed={'raw':![],'where':{}};var _0x587613={};var _0x1213fb={'count':0x0,'rows':[]};return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x21cee3['params']['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x40c212,null))[_0x7948('0x16')](function(_0x22fc4e){if(_0x22fc4e){_0x587613[_0x7948('0x50')]=_[_0x7948('0x5a')](db[_0x7948('0xe4')][_0x7948('0x57')]);_0x587613['query']=_['keys'](_0x21cee3[_0x7948('0x5b')]);_0x587613['filters']=_['intersection'](_0x587613[_0x7948('0x50')],_0x587613[_0x7948('0x5b')]);_0x13f5ed['attributes']=_[_0x7948('0x5d')](_0x587613[_0x7948('0x50')],qs[_0x7948('0x5f')](_0x21cee3[_0x7948('0x5b')]['fields']));_0x13f5ed[_0x7948('0x5e')]=_0x13f5ed['attributes'][_0x7948('0x60')]?_0x13f5ed['attributes']:_0x587613['model'];if(!_0x21cee3[_0x7948('0x5b')]['hasOwnProperty'](_0x7948('0x61'))){_0x13f5ed[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x21cee3[_0x7948('0x5b')][_0x7948('0x26')]);_0x13f5ed[_0x7948('0x23')]=qs[_0x7948('0x23')](_0x21cee3[_0x7948('0x5b')][_0x7948('0x23')]);}_0x13f5ed[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x21cee3[_0x7948('0x5b')][_0x7948('0x82')]);_0x13f5ed[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x21cee3[_0x7948('0x5b')],_0x587613[_0x7948('0x5c')]));_0x13f5ed['where'][_0x7948('0x7c')]=_0x22fc4e['id'];if(_0x21cee3['query'][_0x7948('0x64')]){_0x13f5ed[_0x7948('0x62')]=_[_0x7948('0x65')](_0x13f5ed[_0x7948('0x62')],{'$or':_['map'](_0x13f5ed[_0x7948('0x5e')],function(_0x3533bd){var _0x366d84={};_0x366d84[_0x3533bd]={'$like':'%'+_0x21cee3['query']['filter']+'%'};return _0x366d84;})});}_0x13f5ed=_[_0x7948('0x65')]({},_0x13f5ed,_0x21cee3[_0x7948('0x67')]);return db[_0x7948('0xe4')][_0x7948('0x25')]({'where':_0x13f5ed['where']})[_0x7948('0x16')](function(_0x1bbbb4){_0x1213fb['count']=_0x1bbbb4;if(_0x21cee3[_0x7948('0x5b')][_0x7948('0x68')]){_0x13f5ed[_0x7948('0x69')]=[{'all':!![]}];}else{_0x13f5ed[_0x7948('0x69')]=[{'model':db[_0x7948('0x9e')],'as':_0x7948('0x102'),'required':![]},{'model':db[_0x7948('0xed')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x7948('0x6a')](_0x13f5ed);})[_0x7948('0x16')](function(_0x5acfb1){_0x1213fb[_0x7948('0x6b')]=_0x5acfb1;return _0x1213fb;});}})[_0x7948('0x16')](respondWithFilteredResult(_0x40c212,_0x13f5ed))[_0x7948('0x21')](handleError(_0x40c212,null));};exports[_0x7948('0x12f')]=function(_0x4f9e2e,_0x550968){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x4f9e2e['params']['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x550968,null))['then'](function(_0x6cc925){if(_0x6cc925){return _0x6cc925[_0x7948('0x12f')](_0x4f9e2e[_0x7948('0x71')][_0x7948('0x84')],_[_0x7948('0x100')](_0x4f9e2e[_0x7948('0x71')],[_0x7948('0x84'),'id'])||{})[_0x7948('0xb3')](function(_0x347fe2){for(var _0x5ebc57=0x0;_0x5ebc57<_0x4f9e2e['body'][_0x7948('0x84')][_0x7948('0x60')];_0x5ebc57+=0x1){socket[_0x7948('0x130')](_0x7948('0x131'),{'UserId':Number(_0x4f9e2e['body'][_0x7948('0x84')][_0x5ebc57]),'ChatWebsiteId':Number(_0x4f9e2e[_0x7948('0x6d')]['id'])});}return _0x347fe2;});}})['then'](respondWithResult(_0x550968,null))[_0x7948('0x21')](handleError(_0x550968,null));};exports[_0x7948('0x132')]=function(_0x2ce850,_0x2d3975){return db[_0x7948('0x56')][_0x7948('0x6f')]({'where':{'id':_0x2ce850[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x2d3975,null))[_0x7948('0x16')](function(_0x53646e){if(_0x53646e){return _0x53646e[_0x7948('0x132')](_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')])[_0x7948('0x16')](function(){if(_[_0x7948('0x133')](_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')])){for(var _0x4c9708=0x0;_0x4c9708<_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')]['length'];_0x4c9708+=0x1){socket[_0x7948('0x130')](_0x7948('0x134'),{'UserId':Number(_0x2ce850[_0x7948('0x5b')][_0x7948('0x84')][_0x4c9708]),'ChatWebsiteId':Number(_0x2ce850[_0x7948('0x6d')]['id'])});}}else{socket[_0x7948('0x130')](_0x7948('0x134'),{'UserId':Number(_0x2ce850['query'][_0x7948('0x84')]),'ChatWebsiteId':Number(_0x2ce850[_0x7948('0x6d')]['id'])});}});}})[_0x7948('0x16')](respondWithStatusCode(_0x2d3975,null))['catch'](handleError(_0x2d3975,null));};exports[_0x7948('0x135')]=function(_0x341a38,_0x5b3ffe){var _0x21412c={};var _0x59690b={};var _0x2b2307;var _0x45fbab;return db[_0x7948('0x56')][_0x7948('0x7f')]({'where':{'id':_0x341a38[_0x7948('0x6d')]['id']}})[_0x7948('0x16')](handleEntityNotFound(_0x5b3ffe,null))[_0x7948('0x16')](function(_0x40524f){if(_0x40524f){_0x2b2307=_0x40524f;_0x59690b['model']=_['keys'](db[_0x7948('0x103')]['rawAttributes']);_0x59690b[_0x7948('0x5b')]=_[_0x7948('0x5a')](_0x341a38['query']);_0x59690b['filters']=_[_0x7948('0x5d')](_0x59690b['model'],_0x59690b['query']);_0x21412c[_0x7948('0x5e')]=_[_0x7948('0x5d')](_0x59690b['model'],qs['fields'](_0x341a38[_0x7948('0x5b')][_0x7948('0x5f')]));_0x21412c[_0x7948('0x5e')]=_0x21412c[_0x7948('0x5e')]['length']?_0x21412c[_0x7948('0x5e')]:_0x59690b[_0x7948('0x50')];_0x21412c[_0x7948('0x81')]=qs[_0x7948('0x82')](_0x341a38['query'][_0x7948('0x82')]);_0x21412c[_0x7948('0x62')]=qs[_0x7948('0x5c')](_[_0x7948('0x63')](_0x341a38[_0x7948('0x5b')],_0x59690b[_0x7948('0x5c')]));if(_0x341a38[_0x7948('0x5b')][_0x7948('0x64')]){_0x21412c[_0x7948('0x62')]=_[_0x7948('0x65')](_0x21412c[_0x7948('0x62')],{'$or':_[_0x7948('0x3b')](_0x21412c[_0x7948('0x5e')],function(_0x136639){var _0x5976e1={};_0x5976e1[_0x136639]={'$like':'%'+_0x341a38[_0x7948('0x5b')][_0x7948('0x64')]+'%'};return _0x5976e1;})});}_0x21412c=_[_0x7948('0x65')]({},_0x21412c,_0x341a38[_0x7948('0x67')]);return _0x2b2307[_0x7948('0x135')](_0x21412c);}})[_0x7948('0x16')](function(_0x2524f0){if(_0x2524f0){_0x45fbab=_0x2524f0[_0x7948('0x60')];if(!_0x341a38[_0x7948('0x5b')][_0x7948('0x80')]('nolimit')){_0x21412c[_0x7948('0x26')]=qs[_0x7948('0x26')](_0x341a38[_0x7948('0x5b')][_0x7948('0x26')]);_0x21412c['offset']=qs['offset'](_0x341a38[_0x7948('0x5b')][_0x7948('0x23')]);}return _0x2b2307[_0x7948('0x135')](_0x21412c);}})[_0x7948('0x16')](function(_0x13a361){if(_0x13a361){return _0x13a361?{'count':_0x45fbab,'rows':_0x13a361}:null;}})[_0x7948('0x16')](respondWithResult(_0x5b3ffe,null))[_0x7948('0x21')](handleError(_0x5b3ffe,null));};
\ No newline at end of file
+var _0xd8b0=['agentAvatar','file','addCustomerAvatar','customerAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','ChatApplication','Applications','spread','List','account','applications','Contacts','ChatInteraction','externalUrl','interaction','closed','Writing\x20on\x20closed\x20interaction','contact','lastName','messageId','threadId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','originalname','subjectOffline','toPairsIn','mapValues','MailAccountId','NotifyMailAccount','notifyMail','attachments','remove','addInteraction','omit','getInteractions','hasOwnProperty','Contact','Owner','fullname','internal','Tag','Tags','color','tag','virtual','License','increment','readFileSync','URL','address','3.8.0','remote','headers','x-real-ip','connection','remoteAddress','alignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','lodash','querystring','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','update','destroy','get','ChatWebsites','end','name','send','Command','getSnippet','iftime\x20%s,%s','format','iftime\x20%s','interval','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','map','Interval','Intervals','user-agent-parser','user-agent','getResult','cf-connecting-ip','x-forwarded-for','split','firstName','browser','%s\x20%s','version','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','ChatWebsite','fieldName','key','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','filename','addAvatar'];(function(_0x225b4e,_0x179ee4){var _0x24237a=function(_0x4ac970){while(--_0x4ac970){_0x225b4e['push'](_0x225b4e['shift']());}};_0x24237a(++_0x179ee4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d8b('0x2'));var querystring=require(_0x0d8b('0x3'));var htmlToText=require(_0x0d8b('0x4'));var Redis=require(_0x0d8b('0x5'));var jayson=require(_0x0d8b('0x6'));var url=require('url');var qs=require('../../components/parsers/qs');var logger=require(_0x0d8b('0x7'))(_0x0d8b('0x8'));var config=require(_0x0d8b('0x9'));var APIBadRequestError=require('../../errors/api')[_0x0d8b('0xa')];var APIOutOfIntervalError=require(_0x0d8b('0xb'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x0d8b('0xb'))[_0x0d8b('0xc')];var APIHandleError=require(_0x0d8b('0xb'))[_0x0d8b('0xd')];var db=require(_0x0d8b('0xe'))['db'];config[_0x0d8b('0xf')]=_[_0x0d8b('0x10')](config[_0x0d8b('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d8b('0x11'))(new Redis(config['redis']));require(_0x0d8b('0x12'))[_0x0d8b('0x13')](socket);var client=jayson[_0x0d8b('0x14')][_0x0d8b('0x15')]({'port':0x232c});var client9002=jayson[_0x0d8b('0x14')][_0x0d8b('0x15')]({'port':0x232a});var client9003=jayson[_0x0d8b('0x14')][_0x0d8b('0x15')]({'port':0x232b});var client9001=jayson[_0x0d8b('0x14')][_0x0d8b('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x5ad086,_0xe65334,_0x1567ce,_0x2d4e1c){return new Promise(function(_0x4f6f21,_0x23eb7b){var _0xa86349=_0x2d4e1c||client;return _0xa86349[_0x0d8b('0x16')](_0x5ad086,_0x1567ce)[_0x0d8b('0x17')](function(_0x2cb03c){logger['info'](_0x0d8b('0x18'),_0xe65334,_0x0d8b('0x19'));logger[_0x0d8b('0x1a')](_0x0d8b('0x1b'),_0xe65334,_0x0d8b('0x19'),JSON[_0x0d8b('0x1c')](_0x2cb03c));if(_0x2cb03c[_0x0d8b('0x1d')]){if(_0x2cb03c[_0x0d8b('0x1d')]['code']===0x1f4){logger[_0x0d8b('0x1d')](_0x0d8b('0x18'),_0xe65334,_0x2cb03c[_0x0d8b('0x1d')][_0x0d8b('0x1e')]);return _0x23eb7b(_0x2cb03c[_0x0d8b('0x1d')][_0x0d8b('0x1e')]);}logger[_0x0d8b('0x1d')](_0x0d8b('0x18'),_0xe65334,_0x2cb03c['error']['message']);return _0x4f6f21(_0x2cb03c[_0x0d8b('0x1d')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0xe65334,_0x0d8b('0x19'));_0x4f6f21(_0x2cb03c[_0x0d8b('0x1f')][_0x0d8b('0x1e')]);}})[_0x0d8b('0x20')](function(_0x221071){logger[_0x0d8b('0x1d')](_0x0d8b('0x18'),_0xe65334,_0x221071);_0x23eb7b(_0x221071);});});}function respondWithStatusCode(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0xcc;return function(_0x5e5bc3){if(_0x5e5bc3){return _0x4562cb[_0x0d8b('0x21')](_0x27b695);}return _0x4562cb[_0x0d8b('0x22')](_0x27b695)['end']();};}function respondWithResult(_0xe1ef20,_0x4a0ae4){_0x4a0ae4=_0x4a0ae4||0xc8;return function(_0x3dd149){if(_0x3dd149){return _0xe1ef20[_0x0d8b('0x22')](_0x4a0ae4)[_0x0d8b('0x23')](_0x3dd149);}};}function respondWithFilteredResult(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(_0x28f639){var _0x3ef745=typeof _0x59a905['offset']===_0x0d8b('0x24')&&typeof _0x59a905['limit']===_0x0d8b('0x24');var _0x4b59e5=_0x28f639[_0x0d8b('0x25')];var _0x48f24f=_0x3ef745?0x0:_0x59a905[_0x0d8b('0x26')];var _0x546bf6=_0x3ef745?_0x28f639[_0x0d8b('0x25')]:_0x59a905['offset']+_0x59a905[_0x0d8b('0x27')];var _0x106e4c;if(_0x546bf6>=_0x4b59e5){_0x546bf6=_0x4b59e5;_0x106e4c=0xc8;}else{_0x106e4c=0xce;}_0x4fe6f9[_0x0d8b('0x22')](_0x106e4c);return _0x4fe6f9['set']('Content-Range',_0x48f24f+'-'+_0x546bf6+'/'+_0x4b59e5)['json'](_0x28f639);}return null;};}function saveUpdates(_0x4e8992){return function(_0x5515d2){if(_0x5515d2){return _0x5515d2[_0x0d8b('0x28')](_0x4e8992)['then'](function(_0x5d05fc){return _0x5d05fc;});}return null;};}function removeEntity(_0x36017a){return function(_0x1b6920){if(_0x1b6920){return _0x1b6920[_0x0d8b('0x29')]()[_0x0d8b('0x17')](function(){var _0x183220=_0x1b6920[_0x0d8b('0x2a')]({'plain':!![]});var _0x4a99d3=_0x0d8b('0x2b');return db['UserProfileResource'][_0x0d8b('0x29')]({'where':{'type':_0x4a99d3,'resourceId':_0x183220['id']}})[_0x0d8b('0x17')](function(){return _0x1b6920;});})['then'](function(){_0x36017a[_0x0d8b('0x22')](0xcc)[_0x0d8b('0x2c')]();});}};}function handleEntityNotFound(_0x18a905){return function(_0x4f2ed2){if(!_0x4f2ed2){_0x18a905[_0x0d8b('0x21')](0x194);}return _0x4f2ed2;};}function handleError(_0x2c507e,_0x206157){_0x206157=_0x206157||0x1f4;return function(_0x31ceba){logger[_0x0d8b('0x1d')](_0x31ceba['stack']);if(_0x31ceba[_0x0d8b('0x2d')]){delete _0x31ceba[_0x0d8b('0x2d')];}_0x2c507e['status'](_0x206157)[_0x0d8b('0x2e')](_0x31ceba);};}function iftimePromise(_0x3cc3ee,_0x188af2){return respondWithRpcPromise(_0x0d8b('0x2f'),_0x0d8b('0x30'),{'command':_0x188af2['timezone']?util['format'](_0x0d8b('0x31'),_0x3cc3ee['interval'],_0x188af2['timezone']):util[_0x0d8b('0x32')](_0x0d8b('0x33'),_0x3cc3ee[_0x0d8b('0x34')])},client9002)[_0x0d8b('0x17')](function(_0xc1ac4a){var _0x24c789=_0xc1ac4a&&_0xc1ac4a['indexOf'](_0x0d8b('0x35'))>=0x0?!![]:![];logger[_0x0d8b('0x36')](_0x0d8b('0x37'),_0x188af2['id'],_0x3cc3ee['id'],_0x3cc3ee[_0x0d8b('0x34')],_0x24c789?_0x0d8b('0x38'):_0x0d8b('0x39'),_0x188af2[_0x0d8b('0x3a')]?_0x188af2['timezone']:_0x0d8b('0x3b'));return _0x24c789;})[_0x0d8b('0x20')](function(_0x3fa955){logger[_0x0d8b('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x188af2['id'],_0x3cc3ee['id'],_0x3cc3ee[_0x0d8b('0x34')],util['inspect'](_0x3fa955,{'showHidden':![],'depth':null}),_0x188af2[_0x0d8b('0x3a')]?_0x188af2[_0x0d8b('0x3a')]:_0x0d8b('0x3b'));return![];});}function checkWebsiteIntervals(_0x26ac10){var _0x35fa7e=_[_0x0d8b('0x3c')](_0x26ac10[_0x0d8b('0x3d')][_0x0d8b('0x3e')],function(_0x89ab0d){var _0x2c3c84=_0x89ab0d['get']({'plain':!![]});return iftimePromise(_0x2c3c84,_0x26ac10);});return Promise['all'](_0x35fa7e)['then'](function(_0x4d0811){return _['some'](_0x4d0811);});}function createInteractionObject(_0x1a46f6,_0x402fe0,_0x1e2433,_0x5100cf){var _0x4a76a3=require(_0x0d8b('0x3f'));var _0x192de1=new _0x4a76a3();var _0x344278=_0x192de1['setUA'](_0x1e2433[_0x0d8b('0x40')])[_0x0d8b('0x41')]();var _0x5059ad=_0x402fe0['customerIp'];if(_0x1e2433[_0x0d8b('0x42')]){_0x5059ad=_0x1e2433['cf-connecting-ip'];}else if(_0x1e2433[_0x0d8b('0x43')]){_0x5059ad=_['first'](_0x1e2433['x-forwarded-for'][_0x0d8b('0x44')](','));}return{'ContactId':_0x5100cf['id'],'ChatWebsiteId':_0x1a46f6,'from':(_0x5100cf[_0x0d8b('0x45')]||'')+'\x20'+(_0x5100cf['lastName']||''),'customerIp':_0x5059ad,'customerPort':_0x1e2433['x-real-port']?_0x1e2433['x-real-port']:null,'referer':_0x402fe0['referer'],'browserName':_0x344278[_0x0d8b('0x46')][_0x0d8b('0x2d')]&&_0x344278[_0x0d8b('0x46')]['version']?util[_0x0d8b('0x32')](_0x0d8b('0x47'),_0x344278[_0x0d8b('0x46')][_0x0d8b('0x2d')],_0x344278[_0x0d8b('0x46')][_0x0d8b('0x48')]):_0x0d8b('0x49'),'browserVersion':_0x344278[_0x0d8b('0x46')][_0x0d8b('0x48')]||_0x0d8b('0x49'),'osName':util[_0x0d8b('0x32')](_0x0d8b('0x47'),_0x344278['os'][_0x0d8b('0x2d')],_0x344278['os'][_0x0d8b('0x48')]),'osVersion':_0x344278['os'][_0x0d8b('0x48')],'deviceModel':_0x344278[_0x0d8b('0x4a')][_0x0d8b('0x4b')]&&_0x344278[_0x0d8b('0x4a')][_0x0d8b('0x4c')]?util['format'](_0x0d8b('0x4d'),_0x344278['device']['model'],_0x344278[_0x0d8b('0x4a')][_0x0d8b('0x4c')],_0x344278[_0x0d8b('0x4a')][_0x0d8b('0x4e')]):null,'deviceVendor':_0x344278['device'][_0x0d8b('0x4c')],'deviceType':_0x344278[_0x0d8b('0x4a')][_0x0d8b('0x4e')],'formData':JSON[_0x0d8b('0x1c')](_0x402fe0)};}exports[_0x0d8b('0x4f')]=function(_0x4cd85a,_0x5c0824){var _0x4e4d5f={'include':[{'model':db[_0x0d8b('0x50')],'as':'mandatoryDispositionPause'}]},_0x573f4f={},_0x368ede={'count':0x0,'rows':[]};var _0x4950a8=_[_0x0d8b('0x3c')](db[_0x0d8b('0x51')]['rawAttributes'],function(_0x5ef6c3){return{'name':_0x5ef6c3[_0x0d8b('0x52')],'type':_0x5ef6c3[_0x0d8b('0x4e')][_0x0d8b('0x53')]};});_0x573f4f[_0x0d8b('0x4b')]=_[_0x0d8b('0x3c')](_0x4950a8,'name');_0x573f4f[_0x0d8b('0x54')]=_[_0x0d8b('0x55')](_0x4cd85a['query']);_0x573f4f['filters']=_[_0x0d8b('0x56')](_0x573f4f[_0x0d8b('0x4b')],_0x573f4f['query']);_0x4e4d5f['attributes']=_[_0x0d8b('0x56')](_0x573f4f[_0x0d8b('0x4b')],qs[_0x0d8b('0x57')](_0x4cd85a[_0x0d8b('0x54')]['fields']));_0x4e4d5f[_0x0d8b('0x58')]=_0x4e4d5f['attributes']['length']?_0x4e4d5f[_0x0d8b('0x58')]:_0x573f4f[_0x0d8b('0x4b')];if(!_0x4cd85a['query']['hasOwnProperty'](_0x0d8b('0x59'))){_0x4e4d5f[_0x0d8b('0x27')]=qs[_0x0d8b('0x27')](_0x4cd85a[_0x0d8b('0x54')][_0x0d8b('0x27')]);_0x4e4d5f[_0x0d8b('0x26')]=qs[_0x0d8b('0x26')](_0x4cd85a[_0x0d8b('0x54')]['offset']);}_0x4e4d5f[_0x0d8b('0x5a')]=qs[_0x0d8b('0x5b')](_0x4cd85a[_0x0d8b('0x54')][_0x0d8b('0x5b')]);_0x4e4d5f[_0x0d8b('0x5c')]=qs[_0x0d8b('0x5d')](_[_0x0d8b('0x5e')](_0x4cd85a[_0x0d8b('0x54')],_0x573f4f[_0x0d8b('0x5d')]),_0x4950a8);if(_0x4cd85a['query'][_0x0d8b('0x5f')]){_0x4e4d5f[_0x0d8b('0x5c')]=_[_0x0d8b('0x60')](_0x4e4d5f[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0x4950a8,function(_0x577951){if(_0x577951[_0x0d8b('0x4e')]!==_0x0d8b('0x61')){var _0x181d49={};_0x181d49[_0x577951[_0x0d8b('0x2d')]]={'$like':'%'+_0x4cd85a[_0x0d8b('0x54')]['filter']+'%'};return _0x181d49;}})});}_0x4e4d5f=_['merge']({},_0x4e4d5f,_0x4cd85a[_0x0d8b('0x62')]);var _0x291b83={'where':_0x4e4d5f[_0x0d8b('0x5c')]};return db[_0x0d8b('0x51')]['count'](_0x291b83)[_0x0d8b('0x17')](function(_0x12aef7){_0x368ede[_0x0d8b('0x25')]=_0x12aef7;if(_0x4cd85a['query'][_0x0d8b('0x63')]){_0x4e4d5f['include']=[{'all':!![]}];}return db[_0x0d8b('0x51')][_0x0d8b('0x64')](_0x4e4d5f);})[_0x0d8b('0x17')](function(_0x26ccf0){_0x368ede[_0x0d8b('0x65')]=_0x26ccf0;return _0x368ede;})[_0x0d8b('0x17')](respondWithFilteredResult(_0x5c0824,_0x4e4d5f))['catch'](handleError(_0x5c0824,null));};exports[_0x0d8b('0x66')]=function(_0x4c074d,_0x71e8d8){var _0x4577c8={'raw':![],'where':{'id':_0x4c074d[_0x0d8b('0x67')]['id']},'include':[{'model':db['Pause'],'as':_0x0d8b('0x68')}]},_0xafeeb0={};_0xafeeb0[_0x0d8b('0x4b')]=_[_0x0d8b('0x55')](db[_0x0d8b('0x51')][_0x0d8b('0x69')]);_0xafeeb0[_0x0d8b('0x54')]=_[_0x0d8b('0x55')](_0x4c074d[_0x0d8b('0x54')]);_0xafeeb0[_0x0d8b('0x5d')]=_[_0x0d8b('0x56')](_0xafeeb0['model'],_0xafeeb0['query']);_0x4577c8[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0xafeeb0['model'],qs[_0x0d8b('0x57')](_0x4c074d['query']['fields']));_0x4577c8[_0x0d8b('0x58')]=_0x4577c8[_0x0d8b('0x58')]['length']?_0x4577c8['attributes']:_0xafeeb0[_0x0d8b('0x4b')];if(_0x4c074d[_0x0d8b('0x54')][_0x0d8b('0x63')]){_0x4577c8[_0x0d8b('0x6a')]=[{'all':!![]}];}_0x4577c8=_[_0x0d8b('0x60')]({},_0x4577c8,_0x4c074d[_0x0d8b('0x62')]);return db[_0x0d8b('0x51')]['find'](_0x4577c8)[_0x0d8b('0x17')](handleEntityNotFound(_0x71e8d8,null))['then'](respondWithResult(_0x71e8d8,null))[_0x0d8b('0x20')](handleError(_0x71e8d8,null));};exports[_0x0d8b('0x6b')]=function(_0x2bb690,_0x14a34b){return db['ChatWebsite'][_0x0d8b('0x6b')](_0x2bb690['body'],{})[_0x0d8b('0x17')](function(_0x2c6c5f){var _0x1c5fe2=_0x2bb690[_0x0d8b('0x6c')][_0x0d8b('0x2a')]({'plain':!![]});if(!_0x1c5fe2)throw new Error(_0x0d8b('0x6d'));if(_0x1c5fe2[_0x0d8b('0x6e')]===_0x0d8b('0x6c')){var _0x266a69=_0x2c6c5f[_0x0d8b('0x2a')]({'plain':!![]});var _0x4eb07e=_0x0d8b('0x2b');return db['UserProfileSection'][_0x0d8b('0x6f')]({'where':{'name':_0x4eb07e,'userProfileId':_0x1c5fe2[_0x0d8b('0x70')]},'raw':!![]})['then'](function(_0x1a62b9){if(_0x1a62b9&&_0x1a62b9['autoAssociation']===0x0){return db[_0x0d8b('0x71')][_0x0d8b('0x6b')]({'name':_0x266a69[_0x0d8b('0x2d')],'resourceId':_0x266a69['id'],'type':_0x1a62b9[_0x0d8b('0x2d')],'sectionId':_0x1a62b9['id']},{})[_0x0d8b('0x17')](function(){return _0x2c6c5f;});}else{return _0x2c6c5f;}})[_0x0d8b('0x20')](function(_0x3a073b){logger[_0x0d8b('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a073b);throw _0x3a073b;});}return _0x2c6c5f;})[_0x0d8b('0x17')](respondWithResult(_0x14a34b,0xc9))[_0x0d8b('0x20')](handleError(_0x14a34b,null));};exports['update']=function(_0x191a5a,_0x105df9){if(_0x191a5a[_0x0d8b('0x72')]['id']){delete _0x191a5a[_0x0d8b('0x72')]['id'];}return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x191a5a[_0x0d8b('0x67')]['id']},'include':[{'model':db[_0x0d8b('0x50')],'as':_0x0d8b('0x68')}]})[_0x0d8b('0x17')](handleEntityNotFound(_0x105df9,null))[_0x0d8b('0x17')](saveUpdates(_0x191a5a[_0x0d8b('0x72')],null))['then'](respondWithResult(_0x105df9,null))[_0x0d8b('0x20')](handleError(_0x105df9,null));};exports[_0x0d8b('0x29')]=function(_0x3acffa,_0x58525c){return db['ChatWebsite'][_0x0d8b('0x6f')]({'where':{'id':_0x3acffa[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x58525c,null))['then'](removeEntity(_0x58525c,null))['catch'](handleError(_0x58525c,null));};exports[_0x0d8b('0x73')]=function(_0x130159,_0x305b87){return db[_0x0d8b('0x51')][_0x0d8b('0x73')]()[_0x0d8b('0x17')](respondWithResult(_0x305b87,null))[_0x0d8b('0x20')](handleError(_0x305b87,null));};exports[_0x0d8b('0x74')]=function(_0x20a3dd,_0x3a5aea){if(_0x20a3dd[_0x0d8b('0x72')]['id']){delete _0x20a3dd[_0x0d8b('0x72')]['id'];}return db[_0x0d8b('0x51')]['find']({'where':{'id':_0x20a3dd[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x3a5aea,null))['then'](function(_0x51c41b){if(_0x51c41b){_0x20a3dd[_0x0d8b('0x72')][_0x0d8b('0x75')]=_0x51c41b['id'];return db[_0x0d8b('0x76')][_0x0d8b('0x6b')](_0x20a3dd[_0x0d8b('0x72')]);}})[_0x0d8b('0x17')](respondWithResult(_0x3a5aea,null))['catch'](handleError(_0x3a5aea,null));};exports['getDispositions']=function(_0x581d8e,_0x1f1eae){var _0xce759e={'raw':![],'where':{}};var _0x466442={};var _0x28f9b7={'count':0x0,'rows':[]};return db[_0x0d8b('0x51')][_0x0d8b('0x77')]({'where':{'id':_0x581d8e['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x1f1eae,null))[_0x0d8b('0x17')](function(_0x4b3363){if(_0x4b3363){_0x466442[_0x0d8b('0x4b')]=_['keys'](db[_0x0d8b('0x76')][_0x0d8b('0x69')]);_0x466442[_0x0d8b('0x54')]=_[_0x0d8b('0x55')](_0x581d8e[_0x0d8b('0x54')]);_0x466442[_0x0d8b('0x5d')]=_[_0x0d8b('0x56')](_0x466442[_0x0d8b('0x4b')],_0x466442[_0x0d8b('0x54')]);_0xce759e[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x466442[_0x0d8b('0x4b')],qs['fields'](_0x581d8e['query'][_0x0d8b('0x57')]));_0xce759e[_0x0d8b('0x58')]=_0xce759e[_0x0d8b('0x58')][_0x0d8b('0x78')]?_0xce759e[_0x0d8b('0x58')]:_0x466442[_0x0d8b('0x4b')];if(!_0x581d8e[_0x0d8b('0x54')]['hasOwnProperty'](_0x0d8b('0x59'))){_0xce759e['limit']=qs[_0x0d8b('0x27')](_0x581d8e['query']['limit']);_0xce759e[_0x0d8b('0x26')]=qs[_0x0d8b('0x26')](_0x581d8e[_0x0d8b('0x54')][_0x0d8b('0x26')]);}_0xce759e[_0x0d8b('0x5a')]=qs[_0x0d8b('0x5b')](_0x581d8e[_0x0d8b('0x54')][_0x0d8b('0x5b')]);_0xce759e[_0x0d8b('0x5c')]=qs[_0x0d8b('0x5d')](_[_0x0d8b('0x5e')](_0x581d8e[_0x0d8b('0x54')],_0x466442['filters']));_0xce759e[_0x0d8b('0x5c')][_0x0d8b('0x75')]=_0x4b3363['id'];if(_0x581d8e[_0x0d8b('0x54')]['filter']){_0xce759e['where']=_[_0x0d8b('0x60')](_0xce759e[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0xce759e[_0x0d8b('0x58')],function(_0xae81df){var _0xb8ffcb={};_0xb8ffcb[_0xae81df]={'$like':'%'+_0x581d8e['query'][_0x0d8b('0x5f')]+'%'};return _0xb8ffcb;})});}_0xce759e=_[_0x0d8b('0x60')]({},_0xce759e,_0x581d8e[_0x0d8b('0x62')]);return db[_0x0d8b('0x76')][_0x0d8b('0x25')]({'where':_0xce759e['where']})['then'](function(_0x2d9ce6){_0x28f9b7[_0x0d8b('0x25')]=_0x2d9ce6;if(_0x581d8e[_0x0d8b('0x54')]['includeAll']){_0xce759e[_0x0d8b('0x6a')]=[{'all':!![]}];}return db[_0x0d8b('0x76')][_0x0d8b('0x64')](_0xce759e);})['then'](function(_0xb61d4b){_0x28f9b7[_0x0d8b('0x65')]=_0xb61d4b;return _0x28f9b7;});}})[_0x0d8b('0x17')](respondWithFilteredResult(_0x1f1eae,_0xce759e))[_0x0d8b('0x20')](handleError(_0x1f1eae,null));};exports[_0x0d8b('0x79')]=function(_0x150e9f,_0x117d5d){return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x150e9f['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x117d5d,null))[_0x0d8b('0x17')](function(_0x499e9f){if(_0x499e9f){return _0x499e9f[_0x0d8b('0x79')](_0x150e9f[_0x0d8b('0x54')][_0x0d8b('0x7a')]);}})[_0x0d8b('0x17')](respondWithStatusCode(_0x117d5d,null))[_0x0d8b('0x20')](handleError(_0x117d5d,null));};exports[_0x0d8b('0x7b')]=function(_0x4b3a37,_0x4a6847){if(_0x4b3a37[_0x0d8b('0x72')]['id']){delete _0x4b3a37[_0x0d8b('0x72')]['id'];}return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x4b3a37['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x4a6847,null))[_0x0d8b('0x17')](function(_0x4e7c89){if(_0x4e7c89){_0x4b3a37[_0x0d8b('0x72')]['ChatWebsiteId']=_0x4e7c89['id'];return db[_0x0d8b('0x7c')][_0x0d8b('0x6b')](_0x4b3a37[_0x0d8b('0x72')]);}})[_0x0d8b('0x17')](respondWithResult(_0x4a6847,null))[_0x0d8b('0x20')](handleError(_0x4a6847,null));};exports[_0x0d8b('0x7d')]=function(_0x242e6c,_0xcf8ed4){var _0x4ceb3a={'raw':![],'where':{}};var _0x39df85={};var _0x5cc226={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0d8b('0x77')]({'where':{'id':_0x242e6c['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0xcf8ed4,null))[_0x0d8b('0x17')](function(_0x4b1038){if(_0x4b1038){_0x39df85[_0x0d8b('0x4b')]=_['keys'](db['CannedAnswer'][_0x0d8b('0x69')]);_0x39df85[_0x0d8b('0x54')]=_[_0x0d8b('0x55')](_0x242e6c[_0x0d8b('0x54')]);_0x39df85[_0x0d8b('0x5d')]=_['intersection'](_0x39df85['model'],_0x39df85[_0x0d8b('0x54')]);_0x4ceb3a[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x39df85[_0x0d8b('0x4b')],qs[_0x0d8b('0x57')](_0x242e6c[_0x0d8b('0x54')][_0x0d8b('0x57')]));_0x4ceb3a[_0x0d8b('0x58')]=_0x4ceb3a['attributes']['length']?_0x4ceb3a[_0x0d8b('0x58')]:_0x39df85[_0x0d8b('0x4b')];if(!_0x242e6c['query']['hasOwnProperty']('nolimit')){_0x4ceb3a[_0x0d8b('0x27')]=qs[_0x0d8b('0x27')](_0x242e6c[_0x0d8b('0x54')]['limit']);_0x4ceb3a[_0x0d8b('0x26')]=qs[_0x0d8b('0x26')](_0x242e6c[_0x0d8b('0x54')]['offset']);}_0x4ceb3a[_0x0d8b('0x5a')]=qs['sort'](_0x242e6c[_0x0d8b('0x54')]['sort']);_0x4ceb3a[_0x0d8b('0x5c')]=qs[_0x0d8b('0x5d')](_[_0x0d8b('0x5e')](_0x242e6c[_0x0d8b('0x54')],_0x39df85[_0x0d8b('0x5d')]));_0x4ceb3a['where'][_0x0d8b('0x75')]=_0x4b1038['id'];if(_0x242e6c['query'][_0x0d8b('0x5f')]){_0x4ceb3a['where']=_[_0x0d8b('0x60')](_0x4ceb3a['where'],{'$or':_['map'](_0x4ceb3a[_0x0d8b('0x58')],function(_0x47b916){var _0x567422={};_0x567422[_0x47b916]={'$like':'%'+_0x242e6c[_0x0d8b('0x54')][_0x0d8b('0x5f')]+'%'};return _0x567422;})});}_0x4ceb3a=_[_0x0d8b('0x60')]({},_0x4ceb3a,_0x242e6c['options']);return db['CannedAnswer']['count']({'where':_0x4ceb3a[_0x0d8b('0x5c')]})[_0x0d8b('0x17')](function(_0x313c47){_0x5cc226[_0x0d8b('0x25')]=_0x313c47;if(_0x242e6c[_0x0d8b('0x54')][_0x0d8b('0x63')]){_0x4ceb3a[_0x0d8b('0x6a')]=[{'all':!![]}];}return db[_0x0d8b('0x7c')][_0x0d8b('0x64')](_0x4ceb3a);})[_0x0d8b('0x17')](function(_0x4dc5bd){_0x5cc226[_0x0d8b('0x65')]=_0x4dc5bd;return _0x5cc226;});}})[_0x0d8b('0x17')](respondWithFilteredResult(_0xcf8ed4,_0x4ceb3a))[_0x0d8b('0x20')](handleError(_0xcf8ed4,null));};exports['removeAnswers']=function(_0x33e268,_0x1da3d1){return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x33e268[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x1da3d1,null))[_0x0d8b('0x17')](function(_0xc8e34e){if(_0xc8e34e){return _0xc8e34e[_0x0d8b('0x7e')](_0x33e268[_0x0d8b('0x54')][_0x0d8b('0x7a')]);}})[_0x0d8b('0x17')](respondWithStatusCode(_0x1da3d1,null))['catch'](handleError(_0x1da3d1,null));};exports[_0x0d8b('0x7f')]=function(_0x38a559,_0x400245){_0x38a559[_0x0d8b('0x72')]['sitepic']=_0x38a559['file'][_0x0d8b('0x80')];return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x38a559['params']['id']}})['then'](handleEntityNotFound(_0x400245,null))['then'](saveUpdates(_0x38a559[_0x0d8b('0x72')],null))['then'](respondWithResult(_0x400245,null))[_0x0d8b('0x20')](handleError(_0x400245,null));};exports[_0x0d8b('0x81')]=function(_0x42acad,_0x319533){_0x42acad[_0x0d8b('0x72')][_0x0d8b('0x82')]=_0x42acad[_0x0d8b('0x83')][_0x0d8b('0x80')];return db['ChatWebsite'][_0x0d8b('0x6f')]({'where':{'id':_0x42acad[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x319533,null))[_0x0d8b('0x17')](saveUpdates(_0x42acad['body'],null))[_0x0d8b('0x17')](respondWithResult(_0x319533,null))[_0x0d8b('0x20')](handleError(_0x319533,null));};exports[_0x0d8b('0x84')]=function(_0x401827,_0x5918e7){_0x401827[_0x0d8b('0x72')][_0x0d8b('0x85')]=_0x401827[_0x0d8b('0x83')][_0x0d8b('0x80')];return db['ChatWebsite'][_0x0d8b('0x6f')]({'where':{'id':_0x401827['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x5918e7,null))['then'](saveUpdates(_0x401827[_0x0d8b('0x72')],null))['then'](respondWithResult(_0x5918e7,null))[_0x0d8b('0x20')](handleError(_0x5918e7,null));};exports['addSystemAvatar']=function(_0x71dc6,_0x4f1027){_0x71dc6[_0x0d8b('0x72')]['systemAvatar']=_0x71dc6[_0x0d8b('0x83')]['filename'];return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x71dc6['params']['id']}})['then'](handleEntityNotFound(_0x4f1027,null))['then'](saveUpdates(_0x71dc6[_0x0d8b('0x72')],null))['then'](respondWithResult(_0x4f1027,null))[_0x0d8b('0x20')](handleError(_0x4f1027,null));};exports['getLogo']=function(_0x28e73b,_0x1c34d8){var _0x120350=path[_0x0d8b('0x86')](config[_0x0d8b('0x87')],_0x0d8b('0x88'));var _0x59d5f9={'where':{'id':_0x28e73b['params']['id']},'attributes':['id',_0x0d8b('0x89')],'raw':!![]};var _0x576767=![];return require(_0x0d8b('0x8a'))[_0x0d8b('0x8b')]()[_0x0d8b('0x17')](function(_0x5908d4){if(_0x5908d4){_0x576767=_0x5908d4[_0x0d8b('0x8c')];}})['then'](function(){return db[_0x0d8b('0x51')][_0x0d8b('0x6f')](_0x59d5f9);})[_0x0d8b('0x17')](handleEntityNotFound(_0x1c34d8,null))[_0x0d8b('0x17')](function(_0x58957d){if(_0x58957d){if(!_[_0x0d8b('0x8d')](_0x58957d[_0x0d8b('0x89')])){if(fs[_0x0d8b('0x8e')](path['join'](config[_0x0d8b('0x87')],'server/files/images/logos/',_0x58957d[_0x0d8b('0x89')]))&&_0x576767){_0x120350=path[_0x0d8b('0x86')](config[_0x0d8b('0x87')],_0x0d8b('0x8f'),_0x58957d[_0x0d8b('0x89')]);}}return _0x1c34d8[_0x0d8b('0x90')](_0x120350);}})[_0x0d8b('0x20')](handleError(_0x1c34d8,null));};exports[_0x0d8b('0x91')]=function(_0x222ed3,_0x47019a){var _0x33af2d=path[_0x0d8b('0x86')](config['root'],_0x0d8b('0x92'));var _0xb816d7={'where':{'id':_0x222ed3['params']['id']},'attributes':['id',_0x0d8b('0x82')],'raw':!![]};return db['ChatWebsite'][_0x0d8b('0x6f')](_0xb816d7)['then'](handleEntityNotFound(_0x47019a,null))[_0x0d8b('0x17')](function(_0x5d3c38){if(_0x5d3c38){if(!_['isNil'](_0x5d3c38[_0x0d8b('0x82')])){if(fs[_0x0d8b('0x8e')](path['join'](config['root'],'server/files/images/avatars/',_0x5d3c38['agentAvatar']))){_0x33af2d=path[_0x0d8b('0x86')](config[_0x0d8b('0x87')],_0x0d8b('0x93'),_0x5d3c38[_0x0d8b('0x82')]);}}return _0x47019a[_0x0d8b('0x90')](_0x33af2d);}})[_0x0d8b('0x20')](handleError(_0x47019a,null));};exports[_0x0d8b('0x94')]=function(_0x44ac53,_0x53de32){var _0x19e8d4=path['join'](config[_0x0d8b('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x435c38={'where':{'id':_0x44ac53[_0x0d8b('0x67')]['id']},'attributes':['id',_0x0d8b('0x85'),_0x0d8b('0x95')],'raw':!![]};return db[_0x0d8b('0x51')][_0x0d8b('0x6f')](_0x435c38)[_0x0d8b('0x17')](handleEntityNotFound(_0x53de32,null))[_0x0d8b('0x17')](function(_0x3d7623){if(_0x3d7623){if(!_[_0x0d8b('0x8d')](_0x3d7623[_0x0d8b('0x85')])){if(fs[_0x0d8b('0x8e')](path[_0x0d8b('0x86')](config['root'],_0x0d8b('0x93'),_0x3d7623['customerAvatar']))&&_0x3d7623[_0x0d8b('0x95')]){_0x19e8d4=path[_0x0d8b('0x86')](config['root'],_0x0d8b('0x93'),_0x3d7623['customerAvatar']);}}return _0x53de32[_0x0d8b('0x90')](_0x19e8d4);}})['catch'](handleError(_0x53de32,null));};exports[_0x0d8b('0x96')]=function(_0x2d7b26,_0x30e1d0){var _0x3e7cc7=path[_0x0d8b('0x86')](config[_0x0d8b('0x87')],'server/files/images/avatars/system_avatar.png');var _0x29cbf1={'where':{'id':_0x2d7b26['params']['id']},'attributes':['id',_0x0d8b('0x97')],'raw':!![]};return db[_0x0d8b('0x51')][_0x0d8b('0x6f')](_0x29cbf1)[_0x0d8b('0x17')](handleEntityNotFound(_0x30e1d0,null))[_0x0d8b('0x17')](function(_0x5cfca3){if(_0x5cfca3){if(!_[_0x0d8b('0x8d')](_0x5cfca3[_0x0d8b('0x97')])){if(fs['existsSync'](path[_0x0d8b('0x86')](config[_0x0d8b('0x87')],_0x0d8b('0x93'),_0x5cfca3[_0x0d8b('0x97')]))){_0x3e7cc7=path['join'](config[_0x0d8b('0x87')],'server/files/images/avatars/',_0x5cfca3[_0x0d8b('0x97')]);}}return _0x30e1d0['download'](_0x3e7cc7);}})[_0x0d8b('0x20')](handleError(_0x30e1d0,null));};exports[_0x0d8b('0x98')]=function(_0x5eed31,_0x8df3fe){var _0x3f0803={'body':_0x5eed31[_0x0d8b('0x72')],'channel':_0x0d8b('0x99')};var _0x4ce0c9=[];var _0x195762=[];var _0x552747={};var _0x3b95b4=![];return db[_0x0d8b('0x9a')]['describe']()[_0x0d8b('0x17')](function(_0x12b23d){if(!_0x12b23d){throw new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))](_0x0d8b('0x9d'));}_0x4ce0c9=_[_0x0d8b('0x9e')](_[_0x0d8b('0x55')](_0x12b23d),[_0x0d8b('0x9f'),'updatedAt']);_0x195762=_[_0x0d8b('0x9e')](_['keys'](_0x12b23d),[_0x0d8b('0x9f'),_0x0d8b('0xa0'),_0x0d8b('0xa1'),_0x0d8b('0xa2')]);if(_0x5eed31[_0x0d8b('0x72')]['id']){delete _0x5eed31[_0x0d8b('0x72')]['id'];}if(_[_0x0d8b('0x8d')](_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa3')])){throw new db['Sequelize'][(_0x0d8b('0x9c'))](_0x0d8b('0xa4'));}if(_['isNil'](_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0x72')])||_0x5eed31['body'][_0x0d8b('0x72')]===''){throw new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))](_0x0d8b('0xa5'));}if(_[_0x0d8b('0x8d')](_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa6')])){throw new db[(_0x0d8b('0x9b'))]['ValidationError'](_0x0d8b('0xa7')+_0x195762);}if(!_[_0x0d8b('0xa8')](_0x195762,_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa6')])){throw new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))](_0x0d8b('0xa9')+_0x195762);}_0x552747[_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa6')]]=_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa3')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5eed31['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0d8b('0x9a')],'as':'Contacts','where':_0x552747,'limit':0x1,'order':[[_0x0d8b('0xa0'),_0x0d8b('0xaa')]]}]},{'model':db[_0x0d8b('0xab')],'as':_0x0d8b('0xac')},{'model':db[_0x0d8b('0x3d')],'as':_0x0d8b('0x3d'),'include':[{'model':db[_0x0d8b('0x3d')],'as':_0x0d8b('0x3e'),'attributes':['id',_0x0d8b('0x34')],'raw':!![]}]}]});})[_0x0d8b('0x17')](function(_0x167029){if(!_0x167029)throw new APINotFoundError(util[_0x0d8b('0x32')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x5eed31[_0x0d8b('0x67')]['id']));if(!_0x167029['Interval']||!_0x167029[_0x0d8b('0x3d')]['Intervals'])return[_0x167029,!![]];return[_0x167029,checkWebsiteIntervals(_0x167029)];})[_0x0d8b('0xad')](function(_0x16656d,_0x3bc098){if(!_0x3bc098)throw new APIOutOfIntervalError();if(!_0x16656d[_0x0d8b('0xae')])return;_0x3f0803[_0x0d8b('0xaf')]=_0x16656d;_0x3f0803['list']=_0x16656d[_0x0d8b('0xae')];_0x3f0803[_0x0d8b('0xb0')]=_['orderBy'](_0x16656d[_0x0d8b('0xac')],['priority'],['asc']);if(_0x3f0803[_0x0d8b('0xaf')][_0x0d8b('0xac')]){delete _0x3f0803[_0x0d8b('0xaf')][_0x0d8b('0xac')];}if(_0x3f0803[_0x0d8b('0xaf')]['List']&&_0x3f0803['account']['List'][_0x0d8b('0xb1')][_0x0d8b('0x78')]){return _0x3f0803[_0x0d8b('0xaf')][_0x0d8b('0xae')][_0x0d8b('0xb1')][0x0];}var _0x1088d9=_['defaults'](_0x5eed31[_0x0d8b('0x72')],{'firstName':_0x5eed31[_0x0d8b('0x72')]['from'],'ListId':_0x16656d[_0x0d8b('0xa2')]});_0x1088d9[_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa6')]]=_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xa3')];return db['CmContact']['create'](_0x1088d9,{'fields':_0x4ce0c9,'raw':!![]});})[_0x0d8b('0x17')](function(_0xaf1c9c){_0x3f0803['contact']=_0xaf1c9c;var _0x3c5a61=createInteractionObject(_0x5eed31[_0x0d8b('0x67')]['id'],_0x5eed31[_0x0d8b('0x72')],_0x5eed31['headers'],_0xaf1c9c);var _0x52f5cc={'ChatWebsiteId':_0x5eed31[_0x0d8b('0x67')]['id'],'closed':![]};if(_0x5eed31[_0x0d8b('0x72')]['threadId']){_0x52f5cc['threadId']=_0x5eed31[_0x0d8b('0x72')]['threadId'];return db[_0x0d8b('0xb2')]['find']({'where':_0x52f5cc})[_0x0d8b('0x17')](function(_0xda1a38){if(_0xda1a38){_0x3b95b4=!![];return _0xda1a38;}_0x3c5a61['threadId']=_0x5eed31[_0x0d8b('0x72')]['threadId'];_0x3c5a61[_0x0d8b('0xb3')]=_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xb3')];return db[_0x0d8b('0xb2')][_0x0d8b('0x6b')](_0x3c5a61);});}_0x52f5cc['ContactId']=_0xaf1c9c['id'];if(_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xb4')]&&_0x5eed31[_0x0d8b('0x72')]['interaction']['id']){delete _0x52f5cc[_0x0d8b('0xb5')];_0x52f5cc['id']=_0x5eed31['body'][_0x0d8b('0xb4')]['id'];return db[_0x0d8b('0xb2')]['find']({'where':_0x52f5cc})['then'](function(_0x4b69b6){if(_0x4b69b6&&_0x4b69b6[_0x0d8b('0xb5')]){throw new APIBadRequestError(_0x0d8b('0xb6'),'Bad\x20request');}else if(_0x4b69b6&&!_0x4b69b6[_0x0d8b('0xb5')]){_0x3b95b4=!![];return _0x4b69b6;}return db['ChatInteraction'][_0x0d8b('0x6b')](_0x3c5a61);});}return db[_0x0d8b('0xb2')][_0x0d8b('0x6b')](_0x3c5a61);})[_0x0d8b('0x17')](function(_0x2c6aed){if(!_0x3b95b4)return _0x2c6aed;var _0x1cba06={'from':(_0x3f0803[_0x0d8b('0xb7')][_0x0d8b('0x45')]||'')+'\x20'+(_0x3f0803['contact'][_0x0d8b('0xb8')]||'')};if(_0x5eed31['body']['threadId']&&_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xb9')]&&_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xba')]!=_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xb9')]){_0x1cba06[_0x0d8b('0xba')]=_0x5eed31['body'][_0x0d8b('0xb9')];}return _0x2c6aed['update'](_0x1cba06);})['then'](function(_0x3bdb03){_0x3f0803['interaction']=_0x3bdb03[_0x0d8b('0x2a')]({'plain':!![]});_0x3f0803['interaction']['created']=!_0x3b95b4;if(_0x3f0803[_0x0d8b('0xb4')][_0x0d8b('0xbb')]){if(_0x3f0803[_0x0d8b('0xaf')][_0x0d8b('0xbc')]){_0x3f0803[_0x0d8b('0xb0')][_0x0d8b('0xbd')]({'id':0x0,'priority':_0x3f0803['applications']['length']+0x1,'app':_0x0d8b('0xbe'),'appdata':_0x0d8b('0xbf'),'interval':_0x0d8b('0xc0')});}}return db[_0x0d8b('0xc1')][_0x0d8b('0x6b')]({'body':_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0x72')],'ChatWebsiteId':_0x5eed31[_0x0d8b('0x67')]['id'],'ChatInteractionId':_0x3bdb03['id'],'direction':'in','ContactId':_0x3f0803[_0x0d8b('0xb7')]['id'],'AttachmentId':_0x5eed31[_0x0d8b('0x72')][_0x0d8b('0xc2')]});})[_0x0d8b('0x17')](function(_0xdfc859){_0x3f0803['message']=_0xdfc859;if(!_0x3f0803['interaction']['UserId']){return;}return db[_0x0d8b('0xc3')][_0x0d8b('0x6f')]({'attributes':['id',_0x0d8b('0x2d')],'where':{'id':_0x3f0803[_0x0d8b('0xb4')][_0x0d8b('0xc4')]}});})[_0x0d8b('0x17')](function(_0x4635f5){if(_0x4635f5){_0x3f0803[_0x0d8b('0xb0')][_0x0d8b('0xc5')]({'id':0x0,'priority':0x0,'app':_0x0d8b('0xc6'),'appdata':_0x4635f5[_0x0d8b('0x2d')]+','+(_0x3f0803[_0x0d8b('0xaf')][_0x0d8b('0xc7')]||0xa),'interval':_0x0d8b('0xc0')});_0x3f0803[_0x0d8b('0xc8')]=!![];}if(!_0x3f0803[_0x0d8b('0xb4')][_0x0d8b('0xc9')]){return;}return db['ChatQueue']['find']({'attributes':['id',_0x0d8b('0x2d')],'where':{'id':_0x3f0803['interaction']['queueId']}});})['then'](function(_0x17f24b){if(_0x17f24b){_0x3f0803[_0x0d8b('0xb0')][_0x0d8b('0xc5')]({'id':0x0,'priority':0x1,'app':_0x0d8b('0xca'),'appdata':_0x17f24b[_0x0d8b('0x2d')]+','+(_0x3f0803['account'][_0x0d8b('0xcb')]||0x12c),'interval':_0x0d8b('0xc0')});}return respondWithRpcPromise(_0x0d8b('0xcc'),_0x0d8b('0xcd'),_0x3f0803);})['then'](function(_0x540a6d){respondWithRpcPromise(_0x0d8b('0xce'),'EventManager',{'event':_0x0d8b('0x98'),'message':_0x540a6d},client9002);return _0x540a6d;})[_0x0d8b('0x17')](respondWithResult(_0x8df3fe,null))[_0x0d8b('0x20')](APIHandleError(_0x8df3fe));};exports[_0x0d8b('0xcf')]=function(_0x340ed8,_0xbb1ca4){var _0x5ddb79,_0xf915d5,_0x55b232;var _0x47f938=[];var _0x2da429={};var _0x432894=_0x340ed8[_0x0d8b('0xd0')]||[];var _0x5ea468=[];var _0x5c6240;return db['CmContact']['describe']()[_0x0d8b('0x17')](function(_0x2f4067){if(!_0x2f4067){throw new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))](_0x0d8b('0x9d'));}_0x47f938=_[_0x0d8b('0x9e')](_['keys'](_0x2f4067),['createdAt','updatedAt','CompanyId',_0x0d8b('0xa2')]);if(_0x340ed8[_0x0d8b('0x72')]['id']){delete _0x340ed8['body']['id'];}if(_[_0x0d8b('0x8d')](_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0xa3')])){throw _0xbb1ca4[_0x0d8b('0x22')](0x1f4)[_0x0d8b('0x2e')](new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))]('from\x20is\x20mandatory'));}if(_[_0x0d8b('0x8d')](_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0x72')])||_0x340ed8['body'][_0x0d8b('0x72')]===''){throw _0xbb1ca4[_0x0d8b('0x22')](0x1f4)[_0x0d8b('0x2e')](new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))](_0x0d8b('0xa5')));}if(_[_0x0d8b('0x8d')](_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0xd1')])){throw _0xbb1ca4['status'](0x1f4)['send'](new db['Sequelize'][(_0x0d8b('0x9c'))](_0x0d8b('0xd2')+_0x47f938));}if(!_[_0x0d8b('0xa8')](_0x47f938,_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0xd1')])){throw _0xbb1ca4[_0x0d8b('0x22')](0x1f4)[_0x0d8b('0x2e')](new db[(_0x0d8b('0x9b'))][(_0x0d8b('0x9c'))](_0x0d8b('0xd3')+_0x47f938));}_0x2da429[_0x340ed8['body']['mapKeyOffline']]=_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0xa3')];})[_0x0d8b('0x17')](function(){return db[_0x0d8b('0x51')]['find']({'where':{'id':_0x340ed8['params']['id']},'include':[{'model':db[_0x0d8b('0xd4')],'as':_0x0d8b('0xae')},{'model':db[_0x0d8b('0xd5')],'as':_0x0d8b('0xd5')}]});})[_0x0d8b('0x17')](handleEntityNotFound(_0xbb1ca4,null))['then'](function(_0x4c7054){if(_0x4c7054&&_0x4c7054[_0x0d8b('0xae')]){_0xf915d5=_0x4c7054;var _0xd8870b=_[_0x0d8b('0x10')](_0x340ed8[_0x0d8b('0x72')],{'firstName':_0x340ed8['body'][_0x0d8b('0xa3')],'phone':_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0xa3')],'ListId':_0x4c7054[_0x0d8b('0xa2')]});_0xd8870b[_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0xd1')]]=_0x340ed8['body'][_0x0d8b('0xa3')];return db[_0x0d8b('0x9a')][_0x0d8b('0xd6')]({'where':_0x2da429,'defaults':_0xd8870b});}})['spread'](function(_0x9ca3d8){if(_0x9ca3d8){_0x55b232=_0x9ca3d8;var _0xd37e13=fs['readFileSync'](path['join'](config[_0x0d8b('0x87')],_0x0d8b('0xd7')),_0x0d8b('0xd8'));var _0x1f4f88=ejs[_0x0d8b('0xd9')](_0xd37e13,{'body':_['toPairs'](_0x340ed8[_0x0d8b('0x72')][_0x0d8b('0x72')]),'bodyTitle':_0xf915d5['offlineMessageBody']});return db[_0x0d8b('0xda')][_0x0d8b('0x6b')]({'body':_0x1f4f88,'plainBody':htmlToText[_0x0d8b('0xdb')](_0x1f4f88),'ContactId':_0x9ca3d8['id'],'ChatWebsiteId':_0xf915d5['id']});}})[_0x0d8b('0x17')](function(_0x436239){_0x5c6240=_0x436239;if(_0x432894['length']){var _0x510e01=_0x432894['map'](function(_0x106aad){return{'name':_0x106aad['originalname'],'basename':_0x106aad[_0x0d8b('0x80')],'type':_0x106aad[_0x0d8b('0xdc')],'ChatOfflineMessageId':_0x436239['id']};});_0x5ea468=_0x510e01['map'](_0x300252=>{var _0x1e397d={'filename':_0x300252[_0x0d8b('0x2d')],'path':path['join'](config['root'],_0x0d8b('0xdd'),'files','attachments',_0x0d8b('0xde'),_0x300252[_0x0d8b('0xdf')])};return _0x1e397d;});if(!_0xf915d5[_0x0d8b('0xe0')]){return db[_0x0d8b('0xe1')][_0x0d8b('0xe2')](function(_0x532d3f){return db[_0x0d8b('0xe3')]['bulkCreate'](_0x510e01,{'transaction':_0x532d3f});});}}})[_0x0d8b('0x17')](function(){if(_0x5c6240){_0x5ddb79=_0x5c6240;return db['MailAccount'][_0x0d8b('0x77')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x0d8b('0xe4'),'raw':!![],'include':[{'model':db[_0x0d8b('0xe5')],'as':_0x0d8b('0xe5'),'raw':!![]}]}]});}})[_0x0d8b('0x17')](function(_0x38a06b){if(_0x38a06b&&_0x38a06b[_0x0d8b('0xe4')]&&_0xf915d5[_0x0d8b('0xe6')]&&_0xf915d5['forwardOfflineAddress']){var _0x25d367=_0x38a06b[_0x0d8b('0xe7')]();return respondWithRpcPromise(_0x0d8b('0xe8'),_0x0d8b('0xe9'),{'account':_0x25d367,'message':{'from':util[_0x0d8b('0x32')](_0x0d8b('0xea'),_0x38a06b[_0x0d8b('0x2d')],_0x38a06b[_0x0d8b('0xeb')]||_0x38a06b['Smtp']['user']),'to':_0xf915d5[_0x0d8b('0xec')],'subject':_0xf915d5[_0x0d8b('0xed')],'html':_0x5ddb79[_0x0d8b('0x72')],'attachments':_0x5ea468}},client9003)['then'](function(){return _0x5ddb79;})['catch'](function(_0x16c13b){logger[_0x0d8b('0x1d')](_0x16c13b);});}})[_0x0d8b('0x17')](function(){if(_0xf915d5&&_0xf915d5[_0x0d8b('0xe0')]&&_0xf915d5['MailAccountId']){var _0x5b41e8=[];if(_0x432894[_0x0d8b('0x78')]){_0x5b41e8=_0x432894[_0x0d8b('0x3c')](function(_0x3abb2b){return{'name':_0x3abb2b[_0x0d8b('0xee')],'basename':_0x3abb2b[_0x0d8b('0x80')],'type':_0x3abb2b[_0x0d8b('0xdc')],'ChatOfflineMessageId':_0x5c6240['id']};});}var _0x4cafc3;if(!_[_0x0d8b('0x8d')](_0xf915d5[_0x0d8b('0xef')])){var _0x11325c=_[_0x0d8b('0x3c')](_0x340ed8[_0x0d8b('0x72')],function(_0x270ce3){return _0x270ce3;});var _0x5525f1=_[_0x0d8b('0xf0')](_0x11325c)[0x0];var _0x35d322=_[_0x0d8b('0xf1')](_0x5525f1,function(_0x5ea9b9){return _0x5ea9b9;});_0x4cafc3=_0x35d322[0x1][_0xf915d5[_0x0d8b('0xef')]];}var _0x52d26a={'from':_0x55b232[_0x0d8b('0xeb')],'firstName':_0x55b232[_0x0d8b('0x45')],'lastName':_0x55b232[_0x0d8b('0xb8')],'mapKey':_0x0d8b('0xeb'),'message':{'from':_0x55b232[_0x0d8b('0xeb')],'to':_0xf915d5['MailAccount'][_0x0d8b('0xeb')],'cc':'','subject':_['isNil'](_0x4cafc3)?_0xf915d5[_0x0d8b('0xed')]:_0x4cafc3,'messageId':'','sentAt':new Date(),'attach':_0x5b41e8['length'],'attachments':_0x5b41e8,'originChannel':'Chat','ChatWebsiteId':_0xf915d5['id'],'ChatOfflineMessageId':_0x5ddb79['id'],'originTo':_0xf915d5[_0x0d8b('0xd5')][_0x0d8b('0xeb')]},'body':_0x5ddb79[_0x0d8b('0x72')]};var _0x5d9f5d={'account':{'id':_0xf915d5[_0x0d8b('0xf2')]},'body':_0x52d26a,'log':_0x0d8b('0xf3')};return respondWithRpcPromise(_0x0d8b('0xf3'),_0x0d8b('0xf4'),_0x5d9f5d,client9001)['then'](function(){return _0x5ddb79;})['catch'](function(_0x3ab063){logger[_0x0d8b('0x1d')](_0x3ab063);});}return;})[_0x0d8b('0x17')](function(){if(_0x5ddb79){return _0x5ddb79;}})['then'](respondWithResult(_0xbb1ca4,null))[_0x0d8b('0x20')](function(){for(var _0x38c227 of _0x432894){var _0x5dd9a0=path[_0x0d8b('0x86')](config[_0x0d8b('0x87')],'server','files',_0x0d8b('0xf5'),_0x0d8b('0xde'),_0x38c227['filename']);fs_extra[_0x0d8b('0xf6')](_0x5dd9a0)['catch'](function(_0x3277a1){logger[_0x0d8b('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x5dd9a0,_0x3277a1);});}});};exports[_0x0d8b('0xf7')]=function(_0x1177e7,_0xb53b8c){return db[_0x0d8b('0xb2')][_0x0d8b('0x6f')]({'where':{'id':_0x1177e7[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0xb53b8c,null))[_0x0d8b('0x17')](function(_0x1e8517){if(_0x1e8517){return _0x1e8517[_0x0d8b('0xf7')](_0x1177e7[_0x0d8b('0x72')][_0x0d8b('0x7a')],_[_0x0d8b('0xf8')](_0x1177e7[_0x0d8b('0x72')],['ids','id'])||{});}})[_0x0d8b('0x17')](respondWithResult(_0xb53b8c,null))[_0x0d8b('0x20')](handleError(_0xb53b8c,null));};exports[_0x0d8b('0xf9')]=function(_0x22e74,_0x8d9b41){var _0x5ab3be={'raw':![],'where':{}};var _0x580671={};var _0x4b81a6={'count':0x0,'rows':[]};return db[_0x0d8b('0x51')]['findOne']({'where':{'id':_0x22e74['params']['id']}})['then'](handleEntityNotFound(_0x8d9b41,null))['then'](function(_0xc8203c){if(_0xc8203c){_0x580671[_0x0d8b('0x4b')]=_['keys'](db[_0x0d8b('0xb2')][_0x0d8b('0x69')]);_0x580671['query']=_[_0x0d8b('0x55')](_0x22e74['query']);_0x580671[_0x0d8b('0x5d')]=_[_0x0d8b('0x56')](_0x580671[_0x0d8b('0x4b')],_0x580671['query']);_0x5ab3be[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x580671['model'],qs['fields'](_0x22e74[_0x0d8b('0x54')][_0x0d8b('0x57')]));_0x5ab3be['attributes']=_0x5ab3be[_0x0d8b('0x58')][_0x0d8b('0x78')]?_0x5ab3be[_0x0d8b('0x58')]:_0x580671['model'];if(!_0x22e74[_0x0d8b('0x54')][_0x0d8b('0xfa')](_0x0d8b('0x59'))){_0x5ab3be['limit']=qs[_0x0d8b('0x27')](_0x22e74[_0x0d8b('0x54')][_0x0d8b('0x27')]);_0x5ab3be[_0x0d8b('0x26')]=qs['offset'](_0x22e74[_0x0d8b('0x54')]['offset']);}_0x5ab3be['order']=qs[_0x0d8b('0x5b')](_0x22e74[_0x0d8b('0x54')][_0x0d8b('0x5b')]);_0x5ab3be['where']=qs[_0x0d8b('0x5d')](_[_0x0d8b('0x5e')](_0x22e74['query'],_0x580671[_0x0d8b('0x5d')]));_0x5ab3be['where'][_0x0d8b('0x75')]=_0xc8203c['id'];if(_0x22e74[_0x0d8b('0x54')]['filter']){_0x5ab3be[_0x0d8b('0x5c')]=_[_0x0d8b('0x60')](_0x5ab3be[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0x5ab3be[_0x0d8b('0x58')],function(_0x519ff1){var _0x56a9e9={};_0x56a9e9[_0x519ff1]={'$like':'%'+_0x22e74['query'][_0x0d8b('0x5f')]+'%'};return _0x56a9e9;})});}_0x5ab3be=_[_0x0d8b('0x60')]({},_0x5ab3be,_0x22e74[_0x0d8b('0x62')]);return db[_0x0d8b('0xb2')][_0x0d8b('0x25')]({'where':_0x5ab3be[_0x0d8b('0x5c')]})[_0x0d8b('0x17')](function(_0x21dac1){_0x4b81a6[_0x0d8b('0x25')]=_0x21dac1;if(_0x22e74[_0x0d8b('0x54')][_0x0d8b('0x63')]){_0x5ab3be[_0x0d8b('0x6a')]=[{'model':db['CmContact'],'as':_0x0d8b('0xfb'),'required':![]},{'model':db['User'],'as':_0x0d8b('0xfc'),'attributes':[_0x0d8b('0x2d'),_0x0d8b('0xfd'),_0x0d8b('0xfe')],'required':![]},{'model':db[_0x0d8b('0xff')],'as':_0x0d8b('0x100'),'attributes':['id','name',_0x0d8b('0x101')],'where':_0x22e74[_0x0d8b('0x54')]['tag']?{'id':_0x22e74[_0x0d8b('0x54')][_0x0d8b('0x102')]}:undefined,'required':_0x22e74[_0x0d8b('0x54')][_0x0d8b('0x102')]?!![]:![]}];}return db[_0x0d8b('0xb2')][_0x0d8b('0x64')](_0x5ab3be);})[_0x0d8b('0x17')](function(_0x274b38){_0x4b81a6['rows']=_0x274b38;return _0x4b81a6;});}})[_0x0d8b('0x17')](respondWithFilteredResult(_0x8d9b41,_0x5ab3be))[_0x0d8b('0x20')](handleError(_0x8d9b41,null));};exports[_0x0d8b('0x30')]=function(_0x1309fa,_0x693e1f){var _0x4fa689=0x0;var _0x4d6de6=0x0;var _0x31119d=![];var _0x1ad0e6;var _0x31f4a2;return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x1309fa['params']['id']},'include':[{'model':db[_0x0d8b('0x3d')],'as':_0x0d8b('0x3d'),'include':[{'model':db['Interval'],'as':_0x0d8b('0x3e'),'attributes':['id','interval']}]}]})[_0x0d8b('0x17')](handleEntityNotFound(_0x693e1f,null))['then'](function(_0x1d98df){if(_0x1d98df){_0x1ad0e6=_0x1d98df;return _0x1d98df['getProactiveActions']({'raw':!![]});}})['then'](function(_0x2b4116){if(_0x1ad0e6){if(_0x2b4116){_0x31f4a2=_0x2b4116;}}return require(_0x0d8b('0x8a'))[_0x0d8b('0x8b')]();})['then'](function(_0x573032){if(_0x573032){_0x4d6de6=_0x573032[_0x0d8b('0x103')];_0x31119d=_0x573032[_0x0d8b('0x8c')];}})[_0x0d8b('0x17')](function(){return db[_0x0d8b('0xb2')][_0x0d8b('0x25')]({'where':{'closed':![]}});})[_0x0d8b('0x17')](function(_0x4fca7f){_0x4fa689=_0x4fca7f;if(_0x4d6de6&&_0x4fca7f>_0x4d6de6){return db[_0x0d8b('0x104')]['findOne']({'where':{'id':0x1}})[_0x0d8b('0x17')](function(_0x4d0b96){if(_0x4d0b96){_0x4d0b96[_0x0d8b('0x105')]('chatLicenseExceeded');}});}})[_0x0d8b('0x17')](function(){if(!_0x1ad0e6[_0x0d8b('0x3d')]||!_0x1ad0e6['Interval'][_0x0d8b('0x3e')])return!![];return checkWebsiteIntervals(_0x1ad0e6);})[_0x0d8b('0x17')](function(_0x146fb7){var _0x17d06d=fs[_0x0d8b('0x106')](path[_0x0d8b('0x86')](config['root'],'server/files/chat/iframe.ejs'),_0x0d8b('0xd8'));var _0x1dc64d=new url[(_0x0d8b('0x107'))](_0x1ad0e6[_0x0d8b('0x108')])['origin'];var _0x5e4888=_0x0d8b('0x109');var _0x279b39=![];var _0x59792a={'chatVersion':_0x5e4888,'chatWebsiteAddressOrigin':_0x1dc64d,'remote':_0x1ad0e6[_0x0d8b('0x10a')],'query':querystring[_0x0d8b('0x1c')](_[_0x0d8b('0x60')](_0x1ad0e6[_0x0d8b('0x2a')]({'plain':!![]}),{'customerIp':_0x1309fa[_0x0d8b('0x10b')][_0x0d8b('0x43')]||_0x1309fa[_0x0d8b('0x10b')][_0x0d8b('0x10c')]||_0x1309fa[_0x0d8b('0x10d')][_0x0d8b('0x10e')]||_0x1309fa['ip'],'referer':_0x1309fa[_0x0d8b('0x10b')]['referer'],'openedInteractions':_0x4fa689,'maxInteractions':_0x4d6de6,'virtual':_0x31119d[_0x0d8b('0x103')],'online':_0x146fb7,'custom':_0x31119d}))['replace'](/'/g,'\x5c\x27')};_0x693e1f[_0x0d8b('0x2e')](ejs['render'](Mustache[_0x0d8b('0xd9')](_0x17d06d,_0x59792a),{'proactiveActions':_0x31f4a2,'alignment':_0x1ad0e6[_0x0d8b('0x10f')],'verticalAlignment':_0x1ad0e6['verticalAlignment'],'div_color':_0x1ad0e6[_0x0d8b('0x101')],'labelText':_0x1ad0e6[_0x0d8b('0x110')],'text_color':_0x1ad0e6['textColor'],'text_button_color':_0x1ad0e6[_0x0d8b('0x111')],'button_color':_0x1ad0e6['color_button'],'background_color':_0x1ad0e6[_0x0d8b('0x112')],'hideWhenOffline':_0x1ad0e6[_0x0d8b('0x113')],'intervalId':_0x1ad0e6[_0x0d8b('0x114')],'isDevelopment':_0x279b39,'chatVersion':_0x5e4888}));})['catch'](handleError(_0x693e1f,null));};exports[_0x0d8b('0x115')]=function(_0x41ef06,_0x3328cd){var _0x11e851=_0x41ef06[_0x0d8b('0x67')]['id'];var _0x24986d=_0x41ef06[_0x0d8b('0x72')];var _0x1f326f=0xc8;var _0x376d7e=null;return db['sequelize'][_0x0d8b('0xe2')]({'isolationLevel':db[_0x0d8b('0xe1')][_0x0d8b('0x116')]['ISOLATION_LEVELS'][_0x0d8b('0x117')]},function(_0x1e3992){return db['ChatWebsite'][_0x0d8b('0x77')]({'where':{'id':_0x11e851},'transaction':_0x1e3992})['then'](function(_0x1009f9){if(_0x1009f9){return db[_0x0d8b('0xab')][_0x0d8b('0x29')]({'where':{'ChatWebsiteId':_0x11e851},'transaction':_0x1e3992})['then'](function(){var _0x2e51ab=_[_0x0d8b('0x3c')](_0x24986d,function(_0x49cb7d){_0x49cb7d[_0x0d8b('0x75')]=_0x11e851;return _0x49cb7d;});return db[_0x0d8b('0xab')][_0x0d8b('0x118')](_0x2e51ab,{'transaction':_0x1e3992});});}else{_0x1f326f=0x194;_0x376d7e=[];}});})[_0x0d8b('0x17')](function(){if(_0x1f326f!==0x194){return db[_0x0d8b('0xab')][_0x0d8b('0x119')]({'where':{'ChatWebsiteId':_0x11e851},'order':_0x0d8b('0x11a')})['then'](function(_0x2f3b1d){_0x376d7e=_0x2f3b1d;});}})['catch'](function(_0x55bf2c){_0x1f326f=0x1f4;logger[_0x0d8b('0x1d')](_0x55bf2c['stack']);if(_0x55bf2c[_0x0d8b('0x2d')]){delete _0x55bf2c[_0x0d8b('0x2d')];}_0x376d7e=_0x55bf2c;})['finally'](function(){if(_0x376d7e===null){_0x3328cd[_0x0d8b('0x21')](_0x1f326f);}else{if(_0x1f326f===0x1f4){_0x3328cd[_0x0d8b('0x22')](_0x1f326f)[_0x0d8b('0x2e')](_0x376d7e);}else{_0x3328cd['status'](_0x1f326f)[_0x0d8b('0x23')](_0x376d7e);}}});};exports[_0x0d8b('0x11b')]=function(_0x4fd6bd,_0x3053ec){var _0x5865d5={};var _0x2187f7={};var _0x42c8d1;var _0x19eae4;return db[_0x0d8b('0x51')]['findOne']({'where':{'id':_0x4fd6bd[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x3053ec,null))[_0x0d8b('0x17')](function(_0x4e54a2){if(_0x4e54a2){_0x42c8d1=_0x4e54a2;_0x2187f7['model']=_[_0x0d8b('0x55')](db[_0x0d8b('0xab')][_0x0d8b('0x69')]);_0x2187f7['query']=_[_0x0d8b('0x55')](_0x4fd6bd['query']);_0x2187f7['filters']=_[_0x0d8b('0x56')](_0x2187f7[_0x0d8b('0x4b')],_0x2187f7[_0x0d8b('0x54')]);_0x5865d5[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x2187f7['model'],qs['fields'](_0x4fd6bd[_0x0d8b('0x54')][_0x0d8b('0x57')]));_0x5865d5[_0x0d8b('0x58')]=_0x5865d5['attributes'][_0x0d8b('0x78')]?_0x5865d5[_0x0d8b('0x58')]:_0x2187f7[_0x0d8b('0x4b')];_0x5865d5[_0x0d8b('0x5a')]=qs[_0x0d8b('0x5b')](_0x4fd6bd['query'][_0x0d8b('0x5b')]);_0x5865d5['where']=qs[_0x0d8b('0x5d')](_[_0x0d8b('0x5e')](_0x4fd6bd[_0x0d8b('0x54')],_0x2187f7[_0x0d8b('0x5d')]));if(_0x4fd6bd[_0x0d8b('0x54')][_0x0d8b('0x5f')]){_0x5865d5[_0x0d8b('0x5c')]=_['merge'](_0x5865d5[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0x5865d5[_0x0d8b('0x58')],function(_0x445265){var _0x50a7e0={};_0x50a7e0[_0x445265]={'$like':'%'+_0x4fd6bd[_0x0d8b('0x54')][_0x0d8b('0x5f')]+'%'};return _0x50a7e0;})});}_0x5865d5=_['merge']({},_0x5865d5,_0x4fd6bd[_0x0d8b('0x62')]);return _0x42c8d1[_0x0d8b('0x11b')](_0x5865d5);}})[_0x0d8b('0x17')](function(_0x175e55){if(_0x175e55){_0x19eae4=_0x175e55[_0x0d8b('0x78')];if(!_0x4fd6bd['query'][_0x0d8b('0xfa')]('nolimit')){_0x5865d5['limit']=qs[_0x0d8b('0x27')](_0x4fd6bd[_0x0d8b('0x54')][_0x0d8b('0x27')]);_0x5865d5[_0x0d8b('0x26')]=qs[_0x0d8b('0x26')](_0x4fd6bd[_0x0d8b('0x54')][_0x0d8b('0x26')]);}return _0x42c8d1[_0x0d8b('0x11b')](_0x5865d5);}})['then'](function(_0xacf1c3){if(_0xacf1c3){return _0xacf1c3?{'count':_0x19eae4,'rows':_0xacf1c3}:null;}})[_0x0d8b('0x17')](respondWithResult(_0x3053ec,null))['catch'](handleError(_0x3053ec,null));};exports[_0x0d8b('0x11c')]=function(_0x5cc557,_0x24ed4d){return db[_0x0d8b('0x11d')]['find']({'where':{'id':_0x5cc557['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x24ed4d,null))[_0x0d8b('0x17')](function(_0x2059a4){if(_0x2059a4){return _0x2059a4['addProactiveActions'](_0x5cc557[_0x0d8b('0x72')][_0x0d8b('0x7a')],_[_0x0d8b('0xf8')](_0x5cc557[_0x0d8b('0x72')],[_0x0d8b('0x7a'),'id'])||{});}})['then'](respondWithResult(_0x24ed4d,null))[_0x0d8b('0x20')](handleError(_0x24ed4d,null));};exports[_0x0d8b('0x11e')]=function(_0x3fb5db,_0x39c27b){var _0x40967e={};var _0x26f2c8={};var _0x388bbf;var _0x5d4c1e;return db[_0x0d8b('0x51')][_0x0d8b('0x77')]({'where':{'id':_0x3fb5db[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x39c27b,null))['then'](function(_0x1cefce){if(_0x1cefce){_0x388bbf=_0x1cefce;_0x26f2c8[_0x0d8b('0x4b')]=_[_0x0d8b('0x55')](db[_0x0d8b('0x11f')][_0x0d8b('0x69')]);_0x26f2c8['query']=_[_0x0d8b('0x55')](_0x3fb5db[_0x0d8b('0x54')]);_0x26f2c8['filters']=_[_0x0d8b('0x56')](_0x26f2c8[_0x0d8b('0x4b')],_0x26f2c8['query']);_0x40967e[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x26f2c8[_0x0d8b('0x4b')],qs[_0x0d8b('0x57')](_0x3fb5db[_0x0d8b('0x54')]['fields']));_0x40967e[_0x0d8b('0x58')]=_0x40967e['attributes'][_0x0d8b('0x78')]?_0x40967e[_0x0d8b('0x58')]:_0x26f2c8[_0x0d8b('0x4b')];_0x40967e['order']=qs[_0x0d8b('0x5b')](_0x3fb5db[_0x0d8b('0x54')][_0x0d8b('0x5b')]);_0x40967e[_0x0d8b('0x5c')]=qs[_0x0d8b('0x5d')](_[_0x0d8b('0x5e')](_0x3fb5db[_0x0d8b('0x54')],_0x26f2c8[_0x0d8b('0x5d')]));if(_0x3fb5db[_0x0d8b('0x54')][_0x0d8b('0x5f')]){_0x40967e[_0x0d8b('0x5c')]=_[_0x0d8b('0x60')](_0x40967e[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0x40967e[_0x0d8b('0x58')],function(_0x34fbe9){var _0x43193a={};_0x43193a[_0x34fbe9]={'$like':'%'+_0x3fb5db[_0x0d8b('0x54')][_0x0d8b('0x5f')]+'%'};return _0x43193a;})});}_0x40967e=_[_0x0d8b('0x60')]({},_0x40967e,_0x3fb5db[_0x0d8b('0x62')]);return _0x388bbf[_0x0d8b('0x11e')](_0x40967e);}})['then'](function(_0x28bd25){if(_0x28bd25){_0x5d4c1e=_0x28bd25[_0x0d8b('0x78')];if(!_0x3fb5db[_0x0d8b('0x54')][_0x0d8b('0xfa')](_0x0d8b('0x59'))){_0x40967e[_0x0d8b('0x27')]=qs['limit'](_0x3fb5db['query']['limit']);_0x40967e[_0x0d8b('0x26')]=qs[_0x0d8b('0x26')](_0x3fb5db['query'][_0x0d8b('0x26')]);}return _0x388bbf['getProactiveActions'](_0x40967e);}})[_0x0d8b('0x17')](function(_0xda2e43){if(_0xda2e43){return _0xda2e43?{'count':_0x5d4c1e,'rows':_0xda2e43}:null;}})[_0x0d8b('0x17')](respondWithResult(_0x39c27b,null))[_0x0d8b('0x20')](handleError(_0x39c27b,null));};exports[_0x0d8b('0x120')]=function(_0x14030f,_0x3351a0){var _0x14c6fe=_0x14030f['query'][_0x0d8b('0x121')]===_0x0d8b('0x122')?_0x0d8b('0x123'):_0x0d8b('0x124');return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'attributes':['id',_0x14c6fe],'where':{'id':_0x14030f['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x3351a0,null))[_0x0d8b('0x17')](function(_0x23efde){if(_0x23efde){var _0x5984e9=_0x23efde[_0x14c6fe];var _0x5b586d=_0x5984e9&&_0x5984e9[_0x0d8b('0x125')]?_0x5984e9['items']:[];_0x3351a0[_0x0d8b('0x2e')]({'fromKey':_[_0x0d8b('0x8d')](_0x5984e9[_0x0d8b('0x126')])?undefined:_0x5984e9['fromKey'],'count':_0x5b586d[_0x0d8b('0x78')],'rows':_0x5b586d});}})[_0x0d8b('0x20')](handleError(_0x3351a0,null));};exports[_0x0d8b('0x127')]=function(_0x310a39,_0x1d94ce){var _0x12504e={'raw':![],'where':{}};var _0x189e37={};var _0x491a13={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0d8b('0x77')]({'where':{'id':_0x310a39[_0x0d8b('0x67')]['id']}})['then'](handleEntityNotFound(_0x1d94ce,null))[_0x0d8b('0x17')](function(_0x481f8c){if(_0x481f8c){_0x189e37['model']=_[_0x0d8b('0x55')](db['ChatOfflineMessage'][_0x0d8b('0x69')]);_0x189e37[_0x0d8b('0x54')]=_[_0x0d8b('0x55')](_0x310a39[_0x0d8b('0x54')]);_0x189e37[_0x0d8b('0x5d')]=_[_0x0d8b('0x56')](_0x189e37[_0x0d8b('0x4b')],_0x189e37['query']);_0x12504e[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x189e37[_0x0d8b('0x4b')],qs[_0x0d8b('0x57')](_0x310a39[_0x0d8b('0x54')]['fields']));_0x12504e[_0x0d8b('0x58')]=_0x12504e[_0x0d8b('0x58')]['length']?_0x12504e[_0x0d8b('0x58')]:_0x189e37[_0x0d8b('0x4b')];if(!_0x310a39[_0x0d8b('0x54')][_0x0d8b('0xfa')]('nolimit')){_0x12504e[_0x0d8b('0x27')]=qs[_0x0d8b('0x27')](_0x310a39['query'][_0x0d8b('0x27')]);_0x12504e[_0x0d8b('0x26')]=qs[_0x0d8b('0x26')](_0x310a39[_0x0d8b('0x54')][_0x0d8b('0x26')]);}_0x12504e[_0x0d8b('0x5a')]=qs['sort'](_0x310a39['query'][_0x0d8b('0x5b')]);_0x12504e[_0x0d8b('0x5c')]=qs['filters'](_[_0x0d8b('0x5e')](_0x310a39['query'],_0x189e37[_0x0d8b('0x5d')]));_0x12504e[_0x0d8b('0x5c')][_0x0d8b('0x75')]=_0x481f8c['id'];if(_0x310a39[_0x0d8b('0x54')][_0x0d8b('0x5f')]){_0x12504e[_0x0d8b('0x5c')]=_[_0x0d8b('0x60')](_0x12504e[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0x12504e['attributes'],function(_0x4e270d){var _0x427d75={};_0x427d75[_0x4e270d]={'$like':'%'+_0x310a39['query']['filter']+'%'};return _0x427d75;})});}_0x12504e=_[_0x0d8b('0x60')]({},_0x12504e,_0x310a39['options']);return db[_0x0d8b('0xda')][_0x0d8b('0x25')]({'where':_0x12504e[_0x0d8b('0x5c')]})['then'](function(_0x1868d9){_0x491a13[_0x0d8b('0x25')]=_0x1868d9;if(_0x310a39[_0x0d8b('0x54')][_0x0d8b('0x63')]){_0x12504e[_0x0d8b('0x6a')]=[{'all':!![]}];}else{_0x12504e[_0x0d8b('0x6a')]=[{'model':db[_0x0d8b('0x9a')],'as':'Contact','required':![]},{'model':db[_0x0d8b('0xe3')],'as':'Attachments','required':![]}];}return db[_0x0d8b('0xda')][_0x0d8b('0x64')](_0x12504e);})['then'](function(_0x316570){_0x491a13['rows']=_0x316570;return _0x491a13;});}})[_0x0d8b('0x17')](respondWithFilteredResult(_0x1d94ce,_0x12504e))[_0x0d8b('0x20')](handleError(_0x1d94ce,null));};exports[_0x0d8b('0x128')]=function(_0x193907,_0xea561){return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x193907[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0xea561,null))[_0x0d8b('0x17')](function(_0x4d4ecd){if(_0x4d4ecd){return _0x4d4ecd[_0x0d8b('0x128')](_0x193907[_0x0d8b('0x72')][_0x0d8b('0x7a')],_['omit'](_0x193907[_0x0d8b('0x72')],[_0x0d8b('0x7a'),'id'])||{})[_0x0d8b('0xad')](function(_0x4465a6){for(var _0x54aaf2=0x0;_0x54aaf2<_0x193907[_0x0d8b('0x72')]['ids'][_0x0d8b('0x78')];_0x54aaf2+=0x1){socket[_0x0d8b('0x129')](_0x0d8b('0x12a'),{'UserId':Number(_0x193907[_0x0d8b('0x72')][_0x0d8b('0x7a')][_0x54aaf2]),'ChatWebsiteId':Number(_0x193907[_0x0d8b('0x67')]['id'])});}return _0x4465a6;});}})['then'](respondWithResult(_0xea561,null))[_0x0d8b('0x20')](handleError(_0xea561,null));};exports['removeAgents']=function(_0x3b2601,_0x5befc9){return db[_0x0d8b('0x51')][_0x0d8b('0x6f')]({'where':{'id':_0x3b2601['params']['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x5befc9,null))[_0x0d8b('0x17')](function(_0x5c6312){if(_0x5c6312){return _0x5c6312[_0x0d8b('0x12b')](_0x3b2601['query'][_0x0d8b('0x7a')])[_0x0d8b('0x17')](function(){if(_[_0x0d8b('0x12c')](_0x3b2601[_0x0d8b('0x54')][_0x0d8b('0x7a')])){for(var _0x48ac58=0x0;_0x48ac58<_0x3b2601['query']['ids'][_0x0d8b('0x78')];_0x48ac58+=0x1){socket[_0x0d8b('0x129')](_0x0d8b('0x12d'),{'UserId':Number(_0x3b2601[_0x0d8b('0x54')]['ids'][_0x48ac58]),'ChatWebsiteId':Number(_0x3b2601[_0x0d8b('0x67')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3b2601['query']['ids']),'ChatWebsiteId':Number(_0x3b2601['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5befc9,null))[_0x0d8b('0x20')](handleError(_0x5befc9,null));};exports['getAgents']=function(_0x480bd0,_0x4b002e){var _0x22d782={};var _0x23d5fd={};var _0x11db6c;var _0x4771b0;return db[_0x0d8b('0x51')][_0x0d8b('0x77')]({'where':{'id':_0x480bd0[_0x0d8b('0x67')]['id']}})[_0x0d8b('0x17')](handleEntityNotFound(_0x4b002e,null))[_0x0d8b('0x17')](function(_0x1dd4e1){if(_0x1dd4e1){_0x11db6c=_0x1dd4e1;_0x23d5fd[_0x0d8b('0x4b')]=_['keys'](db[_0x0d8b('0xc3')][_0x0d8b('0x69')]);_0x23d5fd['query']=_[_0x0d8b('0x55')](_0x480bd0['query']);_0x23d5fd[_0x0d8b('0x5d')]=_[_0x0d8b('0x56')](_0x23d5fd[_0x0d8b('0x4b')],_0x23d5fd[_0x0d8b('0x54')]);_0x22d782[_0x0d8b('0x58')]=_[_0x0d8b('0x56')](_0x23d5fd[_0x0d8b('0x4b')],qs['fields'](_0x480bd0[_0x0d8b('0x54')][_0x0d8b('0x57')]));_0x22d782[_0x0d8b('0x58')]=_0x22d782[_0x0d8b('0x58')][_0x0d8b('0x78')]?_0x22d782[_0x0d8b('0x58')]:_0x23d5fd['model'];_0x22d782[_0x0d8b('0x5a')]=qs[_0x0d8b('0x5b')](_0x480bd0[_0x0d8b('0x54')][_0x0d8b('0x5b')]);_0x22d782[_0x0d8b('0x5c')]=qs[_0x0d8b('0x5d')](_['pick'](_0x480bd0['query'],_0x23d5fd[_0x0d8b('0x5d')]));if(_0x480bd0['query'][_0x0d8b('0x5f')]){_0x22d782[_0x0d8b('0x5c')]=_[_0x0d8b('0x60')](_0x22d782[_0x0d8b('0x5c')],{'$or':_[_0x0d8b('0x3c')](_0x22d782[_0x0d8b('0x58')],function(_0x2ef164){var _0x3de7b8={};_0x3de7b8[_0x2ef164]={'$like':'%'+_0x480bd0['query'][_0x0d8b('0x5f')]+'%'};return _0x3de7b8;})});}_0x22d782=_[_0x0d8b('0x60')]({},_0x22d782,_0x480bd0[_0x0d8b('0x62')]);return _0x11db6c[_0x0d8b('0x12e')](_0x22d782);}})[_0x0d8b('0x17')](function(_0xc90307){if(_0xc90307){_0x4771b0=_0xc90307['length'];if(!_0x480bd0[_0x0d8b('0x54')]['hasOwnProperty'](_0x0d8b('0x59'))){_0x22d782['limit']=qs[_0x0d8b('0x27')](_0x480bd0[_0x0d8b('0x54')][_0x0d8b('0x27')]);_0x22d782['offset']=qs['offset'](_0x480bd0[_0x0d8b('0x54')][_0x0d8b('0x26')]);}return _0x11db6c[_0x0d8b('0x12e')](_0x22d782);}})[_0x0d8b('0x17')](function(_0x4a5261){if(_0x4a5261){return _0x4a5261?{'count':_0x4771b0,'rows':_0x4a5261}:null;}})[_0x0d8b('0x17')](respondWithResult(_0x4b002e,null))[_0x0d8b('0x20')](handleError(_0x4b002e,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa8eb=['exports','events','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa8eb,0x179));var _0xba8e=function(_0x4e2db8,_0x145135){_0x4e2db8=_0x4e2db8-0x0;var _0x4231f6=_0xa8eb[_0x4e2db8];return _0x4231f6;};'use strict';var EventEmitter=require(_0xba8e('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xba8e('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba8e('0x2'),'afterUpdate':_0xba8e('0x3'),'afterDestroy':_0xba8e('0x4')};function emitEvent(_0x5c94e6){return function(_0x353df2,_0x368ce6,_0x4c5cd0){ChatWebsiteEvents[_0xba8e('0x5')](_0x5c94e6+':'+_0x353df2['id'],_0x353df2);ChatWebsiteEvents['emit'](_0x5c94e6,_0x353df2);_0x4c5cd0(null);};}for(var e in events){if(events[_0xba8e('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xba8e('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xaeab=['exports','events','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaeab,0x91));var _0xbaea=function(_0x59289b,_0x15f71d){_0x59289b=_0x59289b-0x0;var _0x5ea529=_0xaeab[_0x59289b];return _0x5ea529;};'use strict';var EventEmitter=require(_0xbaea('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xbaea('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbaea('0x2'),'afterUpdate':_0xbaea('0x3'),'afterDestroy':_0xbaea('0x4')};function emitEvent(_0x36fbeb){return function(_0x36e839,_0xbe1ff5,_0x3d39f5){ChatWebsiteEvents[_0xbaea('0x5')](_0x36fbeb+':'+_0x36e839['id'],_0x36e839);ChatWebsiteEvents[_0xbaea('0x5')](_0x36fbeb,_0x36e839);_0x3d39f5(null);};}for(var e in events){if(events[_0xbaea('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xbaea('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb50e=['ChatWebsite','lodash','util','../../config/logger','bluebird','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x80ac62,_0xfcf410){var _0x983e30=function(_0x39a46b){while(--_0x39a46b){_0x80ac62['push'](_0x80ac62['shift']());}};_0x983e30(++_0xfcf410);}(_0xb50e,0x91));var _0xeb50=function(_0x21f089,_0x5ebacd){_0x21f089=_0x21f089-0x0;var _0x59c5e7=_0xb50e[_0x21f089];return _0x59c5e7;};'use strict';var _=require(_0xeb50('0x0'));var util=require(_0xeb50('0x1'));var logger=require(_0xeb50('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb50('0x4'));var rimraf=require('rimraf');var config=require(_0xeb50('0x5'));var attributes=require(_0xeb50('0x6'));module[_0xeb50('0x7')]=function(_0x41b93b,_0x32b4a6){return _0x41b93b['define'](_0xeb50('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e1a=['exports','define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x5b9b45,_0x457eb3){var _0x3bdb18=function(_0x2534f7){while(--_0x2534f7){_0x5b9b45['push'](_0x5b9b45['shift']());}};_0x3bdb18(++_0x457eb3);}(_0x2e1a,0x17c));var _0xa2e1=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x2e1a[_0x340756];return _0x2ef745;};'use strict';var _=require(_0xa2e1('0x0'));var util=require(_0xa2e1('0x1'));var logger=require(_0xa2e1('0x2'))(_0xa2e1('0x3'));var moment=require(_0xa2e1('0x4'));var BPromise=require(_0xa2e1('0x5'));var rp=require(_0xa2e1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2e1('0x7'));var config=require(_0xa2e1('0x8'));var attributes=require(_0xa2e1('0x9'));module[_0xa2e1('0xa')]=function(_0x46fba0,_0x593d85){return _0x46fba0[_0xa2e1('0xb')]('ChatWebsite',attributes,{'tableName':_0xa2e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0272=['info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatWebsite.socket','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0272,0xd1));var _0x2027=function(_0xbcc57,_0x3e25f1){_0xbcc57=_0xbcc57-0x0;var _0x73f607=_0x0272[_0xbcc57];return _0x73f607;};'use strict';var _=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var moment=require('moment');var BPromise=require(_0x2027('0x2'));var rs=require(_0x2027('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2027('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2027('0x5'))(_0x2027('0x6'));var config=require(_0x2027('0x7'));var jayson=require(_0x2027('0x8'));var client=jayson[_0x2027('0x9')][_0x2027('0xa')]({'port':0x232a});config[_0x2027('0xb')]=_[_0x2027('0xc')](config[_0x2027('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2027('0xd'))['register'](socket);function respondWithRpcPromise(_0x3d75f8,_0x4bc6a7,_0xa5d623){return new BPromise(function(_0xc6932e,_0x1ad058){return client[_0x2027('0xe')](_0x3d75f8,_0xa5d623)[_0x2027('0xf')](function(_0x2b6a18){logger[_0x2027('0x10')](_0x2027('0x11'),_0x4bc6a7,'request\x20sent');logger['debug'](_0x2027('0x12'),_0x4bc6a7,_0x2027('0x13'),JSON['stringify'](_0x2b6a18));if(_0x2b6a18[_0x2027('0x14')]){if(_0x2b6a18['error'][_0x2027('0x15')]===0x1f4){logger[_0x2027('0x14')](_0x2027('0x11'),_0x4bc6a7,_0x2b6a18[_0x2027('0x14')][_0x2027('0x16')]);return _0x1ad058(_0x2b6a18['error']['message']);}logger[_0x2027('0x14')](_0x2027('0x11'),_0x4bc6a7,_0x2b6a18[_0x2027('0x14')][_0x2027('0x16')]);return _0xc6932e(_0x2b6a18[_0x2027('0x14')][_0x2027('0x16')]);}else{logger[_0x2027('0x10')](_0x2027('0x11'),_0x4bc6a7,_0x2027('0x13'));_0xc6932e(_0x2b6a18[_0x2027('0x17')][_0x2027('0x16')]);}})[_0x2027('0x18')](function(_0x4009f4){logger[_0x2027('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4bc6a7,_0x4009f4);_0x1ad058(_0x4009f4);});});}
\ No newline at end of file
+var _0x38dc=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48a375,_0x42fd2b){var _0x3b3e84=function(_0x3c6311){while(--_0x3c6311){_0x48a375['push'](_0x48a375['shift']());}};_0x3b3e84(++_0x42fd2b);}(_0x38dc,0x17d));var _0xc38d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x38dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc38d('0x0'));var moment=require(_0xc38d('0x1'));var BPromise=require(_0xc38d('0x2'));var rs=require(_0xc38d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc38d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc38d('0x5'))(_0xc38d('0x6'));var config=require(_0xc38d('0x7'));var jayson=require(_0xc38d('0x8'));var client=jayson[_0xc38d('0x9')][_0xc38d('0xa')]({'port':0x232a});config['redis']=_[_0xc38d('0xb')](config[_0xc38d('0xc')],{'host':_0xc38d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0xc38d('0xe')](socket);function respondWithRpcPromise(_0x234210,_0x2bbd75,_0x334cad){return new BPromise(function(_0x4f9ea8,_0x1c5b57){return client[_0xc38d('0xf')](_0x234210,_0x334cad)[_0xc38d('0x10')](function(_0x366ba5){logger['info'](_0xc38d('0x11'),_0x2bbd75,_0xc38d('0x12'));logger[_0xc38d('0x13')](_0xc38d('0x14'),_0x2bbd75,'request\x20sent',JSON[_0xc38d('0x15')](_0x366ba5));if(_0x366ba5[_0xc38d('0x16')]){if(_0x366ba5[_0xc38d('0x16')][_0xc38d('0x17')]===0x1f4){logger[_0xc38d('0x16')](_0xc38d('0x11'),_0x2bbd75,_0x366ba5['error'][_0xc38d('0x18')]);return _0x1c5b57(_0x366ba5[_0xc38d('0x16')]['message']);}logger[_0xc38d('0x16')](_0xc38d('0x11'),_0x2bbd75,_0x366ba5[_0xc38d('0x16')]['message']);return _0x4f9ea8(_0x366ba5[_0xc38d('0x16')]['message']);}else{logger['info'](_0xc38d('0x11'),_0x2bbd75,'request\x20sent');_0x4f9ea8(_0x366ba5[_0xc38d('0x19')][_0xc38d('0x18')]);}})[_0xc38d('0x1a')](function(_0x166983){logger[_0xc38d('0x16')](_0xc38d('0x11'),_0x2bbd75,_0x166983);_0x1c5b57(_0x166983);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5898=['chatWebsite:','./chatWebsite.events','remove','update','emit','register','length'];(function(_0x34c956,_0x2eed30){var _0x1bf1d0=function(_0x8beb67){while(--_0x8beb67){_0x34c956['push'](_0x34c956['shift']());}};_0x1bf1d0(++_0x2eed30);}(_0x5898,0x14a));var _0x8589=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x5898[_0x5de214];return _0x4df627;};'use strict';var ChatWebsiteEvents=require(_0x8589('0x0'));var events=['save',_0x8589('0x1'),_0x8589('0x2')];function createListener(_0x24b1f2,_0x5937a5){return function(_0x242075){_0x5937a5[_0x8589('0x3')](_0x24b1f2,_0x242075);};}function removeListener(_0x3eff73,_0x414632){return function(){ChatWebsiteEvents['removeListener'](_0x3eff73,_0x414632);};}exports[_0x8589('0x4')]=function(_0x441469){for(var _0x14f416=0x0,_0x545f37=events[_0x8589('0x5')];_0x14f416<_0x545f37;_0x14f416++){var _0xd0e405=events[_0x14f416];var _0x4c458c=createListener(_0x8589('0x6')+_0xd0e405,_0x441469);ChatWebsiteEvents['on'](_0xd0e405,_0x4c458c);}};
\ No newline at end of file
+var _0xcd1a=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x1b580b,_0x256058){var _0x193939=function(_0x495860){while(--_0x495860){_0x1b580b['push'](_0x1b580b['shift']());}};_0x193939(++_0x256058);}(_0xcd1a,0xd2));var _0xacd1=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xcd1a[_0x11005e];return _0x29338f;};'use strict';var ChatWebsiteEvents=require(_0xacd1('0x0'));var events=[_0xacd1('0x1'),_0xacd1('0x2'),_0xacd1('0x3')];function createListener(_0x4359dc,_0x3f2823){return function(_0x4c9279){_0x3f2823[_0xacd1('0x4')](_0x4359dc,_0x4c9279);};}function removeListener(_0x3f9396,_0x149636){return function(){ChatWebsiteEvents[_0xacd1('0x5')](_0x3f9396,_0x149636);};}exports[_0xacd1('0x6')]=function(_0xeb1172){for(var _0xc62d3=0x0,_0x545ef1=events[_0xacd1('0x7')];_0xc62d3<_0x545ef1;_0xc62d3++){var _0x9d14ef=events[_0xc62d3];var _0x35cfc4=createListener(_0xacd1('0x8')+_0x9d14ef,_0xeb1172);ChatWebsiteEvents['on'](_0x9d14ef,_0x35cfc4);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a07=['create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','file','server/files/images/avatars/','single','/:id/customer_avatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post'];(function(_0x2dde26,_0x30ddaa){var _0x4e05de=function(_0xfe222e){while(--_0xfe222e){_0x2dde26['push'](_0x2dde26['shift']());}};_0x4e05de(++_0x30ddaa);}(_0x0a07,0x13b));var _0x70a0=function(_0x1423e6,_0x164fe9){_0x1423e6=_0x1423e6-0x0;var _0x2a5341=_0x0a07[_0x1423e6];return _0x2a5341;};'use strict';var multer=require(_0x70a0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x70a0('0x1'));var router=express['Router']();var fs_extra=require(_0x70a0('0x2'));var auth=require(_0x70a0('0x3'));var interaction=require(_0x70a0('0x4'));var config=require('../../config/environment');var controller=require(_0x70a0('0x5'));router[_0x70a0('0x6')]('/',auth[_0x70a0('0x7')](),controller[_0x70a0('0x8')]);router['get'](_0x70a0('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x70a0('0x6')](_0x70a0('0xa'),auth['isAuthenticated'](),controller[_0x70a0('0xb')]);router[_0x70a0('0x6')](_0x70a0('0xc'),auth[_0x70a0('0x7')](),controller[_0x70a0('0xd')]);router[_0x70a0('0x6')](_0x70a0('0xe'),auth[_0x70a0('0x7')](),controller[_0x70a0('0xf')]);router[_0x70a0('0x6')]('/:id/logo',controller[_0x70a0('0x10')]);router[_0x70a0('0x6')](_0x70a0('0x11'),controller[_0x70a0('0x12')]);router['get']('/:id/customer_avatar',controller[_0x70a0('0x13')]);router[_0x70a0('0x6')](_0x70a0('0x14'),controller[_0x70a0('0x15')]);router[_0x70a0('0x6')](_0x70a0('0x16'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x17')]);router[_0x70a0('0x6')](_0x70a0('0x18'),controller[_0x70a0('0x19')]);router[_0x70a0('0x6')](_0x70a0('0x1a'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x1b')]);router['get'](_0x70a0('0x1c'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x1d')]);router['get'](_0x70a0('0x1e'),controller[_0x70a0('0x1f')]);router[_0x70a0('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x70a0('0x6')](_0x70a0('0x20'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x21')]);router[_0x70a0('0x22')]('/',auth[_0x70a0('0x7')](),controller[_0x70a0('0x23')]);router[_0x70a0('0x22')](_0x70a0('0xc'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x24')]);router[_0x70a0('0x22')](_0x70a0('0xe'),auth[_0x70a0('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0x4687b7,_0x13d925,_0x1dc93c){_0x1dc93c(null,path[_0x70a0('0x26')](config[_0x70a0('0x27')],_0x70a0('0x28')));},'filename':function(_0xd9951a,_0x348bb8,_0x5eae64){_0x5eae64(null,util[_0x70a0('0x29')](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0x348bb8[_0x70a0('0x2c')]));}})});router[_0x70a0('0x22')](_0x70a0('0x2d'),upload['single'](_0x70a0('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0xba70be,_0x46a3af,_0x40292d){_0x40292d(null,path[_0x70a0('0x26')](config['root'],_0x70a0('0x2f')));},'filename':function(_0x4c17fd,_0xb3f363,_0x2f1ce1){_0x2f1ce1(null,util[_0x70a0('0x29')](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0xb3f363[_0x70a0('0x2c')]));}})});router[_0x70a0('0x22')](_0x70a0('0x11'),upload[_0x70a0('0x30')](_0x70a0('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x549b48,_0x18907a,_0x312488){_0x312488(null,path[_0x70a0('0x26')](config[_0x70a0('0x27')],_0x70a0('0x2f')));},'filename':function(_0x240105,_0x5c2b6c,_0x3fc085){_0x3fc085(null,util['format'](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0x5c2b6c['originalname']));}})});router[_0x70a0('0x22')](_0x70a0('0x31'),upload[_0x70a0('0x30')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0x3c1619,_0x5ed8bc,_0x1eb55d){_0x1eb55d(null,path[_0x70a0('0x26')](config['root'],_0x70a0('0x2f')));},'filename':function(_0x199a6f,_0x2e6676,_0x34f9e5){_0x34f9e5(null,util[_0x70a0('0x29')](_0x70a0('0x2a'),Date[_0x70a0('0x2b')](),_0x2e6676['originalname']));}})});router[_0x70a0('0x22')]('/:id/system_avatar',upload[_0x70a0('0x30')]('file'),controller[_0x70a0('0x32')]);router[_0x70a0('0x22')]('/:id/notify',controller[_0x70a0('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x70a0('0x25')]({'destination':function(_0x4e5f06,_0xf67276,_0x1eb46a){const _0x5501bb=path[_0x70a0('0x26')](config[_0x70a0('0x27')],_0x70a0('0x34'),'attachments',_0x70a0('0x35'));fs_extra[_0x70a0('0x36')](_0x5501bb,function(){_0x1eb46a(null,_0x5501bb);});},'filename':function(_0x1d9945,_0x1a4ce9,_0x55d7e6){const _0x3a5be7=_0x1a4ce9[_0x70a0('0x2c')][_0x70a0('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2bc976=path[_0x70a0('0x38')](_0x3a5be7);const _0x548cdd=Date[_0x70a0('0x2b')]()+'-'+_0x3a5be7[_0x70a0('0x37')](_0x2bc976,'')+_0x2bc976;_0x55d7e6(null,_0x548cdd);}})});router['post'](_0x70a0('0x39'),offlineUploadMulter[_0x70a0('0x3a')](),controller['offline']);router[_0x70a0('0x22')](_0x70a0('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x70a0('0x22')](_0x70a0('0x1a'),auth['isAuthenticated'](),controller[_0x70a0('0x3b')]);router['post'](_0x70a0('0x1c'),auth['isAuthenticated'](),controller[_0x70a0('0x3c')]);router[_0x70a0('0x22')]('/:id/users',auth[_0x70a0('0x7')](),controller[_0x70a0('0x3d')]);router[_0x70a0('0x3e')](_0x70a0('0xa'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x3f')]);router[_0x70a0('0x40')](_0x70a0('0xa'),auth[_0x70a0('0x7')](),controller[_0x70a0('0x41')]);router['delete']('/:id/dispositions',auth[_0x70a0('0x7')](),controller[_0x70a0('0x42')]);router[_0x70a0('0x40')](_0x70a0('0xe'),auth['isAuthenticated'](),controller[_0x70a0('0x43')]);router[_0x70a0('0x40')]('/:id/users',auth['isAuthenticated'](),controller[_0x70a0('0x44')]);module[_0x70a0('0x45')]=router;
\ No newline at end of file
+var _0x285a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','getCustomerAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','join','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','Router'];(function(_0x4d1830,_0x10c9a8){var _0x5411cd=function(_0x2e2d1c){while(--_0x2e2d1c){_0x4d1830['push'](_0x4d1830['shift']());}};_0x5411cd(++_0x10c9a8);}(_0x285a,0x1ec));var _0xa285=function(_0x58c7c1,_0x1b3ad2){_0x58c7c1=_0x58c7c1-0x0;var _0x26a7d4=_0x285a[_0x58c7c1];return _0x26a7d4;};'use strict';var multer=require(_0xa285('0x0'));var util=require(_0xa285('0x1'));var path=require(_0xa285('0x2'));var timeout=require('connect-timeout');var express=require(_0xa285('0x3'));var router=express[_0xa285('0x4')]();var fs_extra=require(_0xa285('0x5'));var auth=require(_0xa285('0x6'));var interaction=require(_0xa285('0x7'));var config=require(_0xa285('0x8'));var controller=require('./chatWebsite.controller');router[_0xa285('0x9')]('/',auth['isAuthenticated'](),controller[_0xa285('0xa')]);router[_0xa285('0x9')](_0xa285('0xb'),auth[_0xa285('0xc')](),controller['describe']);router[_0xa285('0x9')](_0xa285('0xd'),auth[_0xa285('0xc')](),controller[_0xa285('0xe')]);router[_0xa285('0x9')](_0xa285('0xf'),auth['isAuthenticated'](),controller[_0xa285('0x10')]);router[_0xa285('0x9')](_0xa285('0x11'),auth['isAuthenticated'](),controller[_0xa285('0x12')]);router[_0xa285('0x9')]('/:id/logo',controller['getLogo']);router['get'](_0xa285('0x13'),controller[_0xa285('0x14')]);router[_0xa285('0x9')]('/:id/customer_avatar',controller[_0xa285('0x15')]);router[_0xa285('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xa285('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xa285('0x16')]);router['get'](_0xa285('0x17'),controller[_0xa285('0x18')]);router[_0xa285('0x9')](_0xa285('0x19'),auth['isAuthenticated'](),controller[_0xa285('0x1a')]);router[_0xa285('0x9')](_0xa285('0x1b'),auth[_0xa285('0xc')](),controller[_0xa285('0x1c')]);router[_0xa285('0x9')]('/:id/fields',controller[_0xa285('0x1d')]);router[_0xa285('0x9')](_0xa285('0x1e'),auth['isAuthenticated'](),controller[_0xa285('0x1f')]);router[_0xa285('0x9')](_0xa285('0x20'),auth[_0xa285('0xc')](),controller[_0xa285('0x21')]);router[_0xa285('0x22')]('/',auth[_0xa285('0xc')](),controller['create']);router[_0xa285('0x22')](_0xa285('0xf'),auth[_0xa285('0xc')](),controller[_0xa285('0x23')]);router[_0xa285('0x22')](_0xa285('0x11'),auth[_0xa285('0xc')](),controller[_0xa285('0x24')]);var upload=multer({'storage':multer[_0xa285('0x25')]({'destination':function(_0x229ca3,_0x16fe21,_0x42cafd){_0x42cafd(null,path['join'](config[_0xa285('0x26')],_0xa285('0x27')));},'filename':function(_0x938c5f,_0x5ead89,_0x48c56b){_0x48c56b(null,util[_0xa285('0x28')](_0xa285('0x29'),Date['now'](),_0x5ead89[_0xa285('0x2a')]));}})});router[_0xa285('0x22')](_0xa285('0x2b'),upload[_0xa285('0x2c')](_0xa285('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0xa285('0x25')]({'destination':function(_0x877b09,_0x429363,_0x5dc2c1){_0x5dc2c1(null,path[_0xa285('0x2e')](config[_0xa285('0x26')],_0xa285('0x2f')));},'filename':function(_0x3694b3,_0x1ca26f,_0x5cbbdb){_0x5cbbdb(null,util[_0xa285('0x28')](_0xa285('0x29'),Date[_0xa285('0x30')](),_0x1ca26f['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0xa285('0x2d')),controller[_0xa285('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x260259,_0x545964,_0x40a6fa){_0x40a6fa(null,path[_0xa285('0x2e')](config['root'],_0xa285('0x2f')));},'filename':function(_0x9f81aa,_0x19e3b6,_0x357950){_0x357950(null,util['format'](_0xa285('0x29'),Date[_0xa285('0x30')](),_0x19e3b6['originalname']));}})});router[_0xa285('0x22')](_0xa285('0x32'),upload[_0xa285('0x2c')](_0xa285('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xa285('0x25')]({'destination':function(_0x13dc1b,_0xbbc9ce,_0x2aa809){_0x2aa809(null,path[_0xa285('0x2e')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x22c037,_0x28592d,_0x328e28){_0x328e28(null,util[_0xa285('0x28')]('%s-%s',Date['now'](),_0x28592d[_0xa285('0x2a')]));}})});router[_0xa285('0x22')]('/:id/system_avatar',upload[_0xa285('0x2c')](_0xa285('0x2d')),controller[_0xa285('0x33')]);router[_0xa285('0x22')](_0xa285('0x34'),controller[_0xa285('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xa285('0x25')]({'destination':function(_0x55c306,_0x51d921,_0x22479c){const _0x56f32d=path[_0xa285('0x2e')](config[_0xa285('0x26')],_0xa285('0x36'),_0xa285('0x37'),_0xa285('0x38'));fs_extra[_0xa285('0x39')](_0x56f32d,function(){_0x22479c(null,_0x56f32d);});},'filename':function(_0x3dad7e,_0x309235,_0x4a5788){const _0x2cb397=_0x309235[_0xa285('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x13458d=path[_0xa285('0x3a')](_0x2cb397);const _0x45e994=Date[_0xa285('0x30')]()+'-'+_0x2cb397['replace'](_0x13458d,'')+_0x13458d;_0x4a5788(null,_0x45e994);}})});router[_0xa285('0x22')](_0xa285('0x3b'),offlineUploadMulter['any'](),controller[_0xa285('0x3c')]);router['post'](_0xa285('0x3d'),auth['isAuthenticated'](),controller[_0xa285('0x3e')]);router[_0xa285('0x22')]('/:id/applications',auth['isAuthenticated'](),controller[_0xa285('0x3f')]);router[_0xa285('0x22')](_0xa285('0x1b'),auth[_0xa285('0xc')](),controller['addProactiveActions']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xa285('0x40')](_0xa285('0xd'),auth[_0xa285('0xc')](),controller[_0xa285('0x41')]);router[_0xa285('0x42')](_0xa285('0xd'),auth[_0xa285('0xc')](),controller[_0xa285('0x43')]);router[_0xa285('0x42')](_0xa285('0xf'),auth[_0xa285('0xc')](),controller[_0xa285('0x44')]);router[_0xa285('0x42')]('/:id/canned_answers',auth[_0xa285('0xc')](),controller['removeAnswers']);router[_0xa285('0x42')](_0xa285('0x20'),auth[_0xa285('0xc')](),controller[_0xa285('0x45')]);module[_0xa285('0x46')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9657=['env','app','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router'];(function(_0x1b3761,_0x54b964){var _0x147d69=function(_0x3fa4fb){while(--_0x3fa4fb){_0x1b3761['push'](_0x1b3761['shift']());}};_0x147d69(++_0x54b964);}(_0x9657,0x167));var _0x7965=function(_0x2119ae,_0x3757a5){_0x2119ae=_0x2119ae-0x0;var _0x4d5811=_0x9657[_0x2119ae];return _0x4d5811;};var beaverLogger=require(_0x7965('0x0'));var express=require(_0x7965('0x1'));var auth=require(_0x7965('0x2'));var config=require(_0x7965('0x3'));var router=express[_0x7965('0x4')]();var isProduction=config[_0x7965('0x5')]==='production'||![];function clientSideLogs(_0x5270c4,_0x39aad7,_0x5e32bd){var _0x686954=_0x5270c4[_0x7965('0x6')][_0x7965('0x7')](_0x7965('0x8'));if(!_0x686954){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x7965('0x9')]({'uri':'/client-logs','logger':_0x686954,'enableCors':!isProduction})(_0x5270c4,_0x39aad7,_0x5e32bd);}router[_0x7965('0xa')](auth[_0x7965('0xb')](),clientSideLogs);module[_0x7965('0xc')]=router;
\ No newline at end of file
+var _0xd804=['expressEndpoint','use','beaver-logger/server','../components/auth/service','../config/environment','env','production','app','get','client-side-logger'];(function(_0x1b8b81,_0xb30fc5){var _0x4a84ca=function(_0xb5b0d2){while(--_0xb5b0d2){_0x1b8b81['push'](_0x1b8b81['shift']());}};_0x4a84ca(++_0xb30fc5);}(_0xd804,0x174));var _0x4d80=function(_0x4e731b,_0x535e94){_0x4e731b=_0x4e731b-0x0;var _0x4831bd=_0xd804[_0x4e731b];return _0x4831bd;};var beaverLogger=require(_0x4d80('0x0'));var express=require('express');var auth=require(_0x4d80('0x1'));var config=require(_0x4d80('0x2'));var router=express['Router']();var isProduction=config[_0x4d80('0x3')]===_0x4d80('0x4')||![];function clientSideLogs(_0x581d58,_0x4eb627,_0x12d2b1){var _0x2b9e5b=_0x581d58[_0x4d80('0x5')][_0x4d80('0x6')](_0x4d80('0x7'));if(!_0x2b9e5b){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x4d80('0x8')]({'uri':'/client-logs','logger':_0x2b9e5b,'enableCors':!isProduction})(_0x581d58,_0x4eb627,_0x12d2b1);}router[_0x4d80('0x9')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12cc=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','Google'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x12cc,0x80));var _0xc12c=function(_0x325ffc,_0x105c82){_0x325ffc=_0x325ffc-0x0;var _0x91fa5=_0x12cc[_0x325ffc];return _0x91fa5;};'use strict';var Sequelize=require('sequelize');module[_0xc12c('0x0')]={'name':{'type':Sequelize[_0xc12c('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc12c('0x2')]('AmazonAWS',_0xc12c('0x3'),_0xc12c('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc12c('0x2')](_0xc12c('0x5'),_0xc12c('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xc12c('0x1')],'comment':_0xc12c('0x7')},'data3':{'type':Sequelize[_0xc12c('0x1')],'comment':_0xc12c('0x8')},'data4':{'type':Sequelize[_0xc12c('0x1')],'comment':_0xc12c('0x9')},'data5':{'type':Sequelize[_0xc12c('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xc12c('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0xc12c('0xb')}};
\ No newline at end of file
+var _0x1c0b=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1c0b,0xc8));var _0xb1c0=function(_0x1f6b97,_0x1bec41){_0x1f6b97=_0x1f6b97-0x0;var _0xa6375a=_0x1c0b[_0x1f6b97];return _0xa6375a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb1c0('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb1c0('0x1')](_0xb1c0('0x2'),_0xb1c0('0x3'),_0xb1c0('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb1c0('0x1')]('Outlook365',_0xb1c0('0x5'))},'data1':{'type':Sequelize[_0xb1c0('0x0')],'comment':_0xb1c0('0x6')},'data2':{'type':Sequelize[_0xb1c0('0x0')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xb1c0('0x0')],'comment':_0xb1c0('0x7')},'data4':{'type':Sequelize[_0xb1c0('0x0')],'comment':_0xb1c0('0x8')},'data5':{'type':Sequelize[_0xb1c0('0x9')],'comment':_0xb1c0('0xa')},'data6':{'type':Sequelize[_0xb1c0('0x9')],'comment':_0xb1c0('0xb')},'data7':{'type':Sequelize[_0xb1c0('0x9')],'comment':_0xb1c0('0xc')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1438=['socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','destroy','then','error','stack','name','send','slice','map','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','CloudProvider','findAll','rows','service','decryptString','data3','catch','params','rawAttributes','include','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x1438,0xb6));var _0x8143=function(_0xacbfa5,_0xfe352){_0xacbfa5=_0xacbfa5-0x0;var _0x5a8a3d=_0x1438[_0xacbfa5];return _0x5a8a3d;};'use strict';var _=require(_0x8143('0x0'));var Redis=require('ioredis');var qs=require(_0x8143('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x8143('0x2'));var logger=require(_0x8143('0x3'))(_0x8143('0x4'));var db=require(_0x8143('0x5'))['db'];var oauth=require(_0x8143('0x6'));config[_0x8143('0x7')]=_[_0x8143('0x8')](config[_0x8143('0x7')],{'host':_0x8143('0x9'),'port':0x18eb});var socket=require(_0x8143('0xa'))(new Redis(config[_0x8143('0x7')]));var redis=new Redis(config[_0x8143('0x7')]);function respondWithStatusCode(_0x2ff159,_0x44f8a5){_0x44f8a5=_0x44f8a5||0xcc;return function(_0xc3ed6c){if(_0xc3ed6c){return _0x2ff159[_0x8143('0xb')](_0x44f8a5);}return _0x2ff159[_0x8143('0xc')](_0x44f8a5)[_0x8143('0xd')]();};}function respondWithResult(_0x2e4a37,_0x232a85){_0x232a85=_0x232a85||0xc8;return function(_0x15cc50){if(_0x15cc50){return _0x2e4a37[_0x8143('0xc')](_0x232a85)['json'](_0x15cc50);}};}function respondWithFilteredResult(_0x5ebb3b,_0x5bb370){return function(_0x2ed4fa){if(_0x2ed4fa){var _0x4b78d7=typeof _0x5bb370['offset']==='undefined'&&typeof _0x5bb370['limit']===_0x8143('0xe');var _0x3f3012=_0x2ed4fa[_0x8143('0xf')];var _0x5bd82a=_0x4b78d7?0x0:_0x5bb370[_0x8143('0x10')];var _0xe74e8b=_0x4b78d7?_0x2ed4fa[_0x8143('0xf')]:_0x5bb370[_0x8143('0x10')]+_0x5bb370[_0x8143('0x11')];var _0x26e40c;if(_0xe74e8b>=_0x3f3012){_0xe74e8b=_0x3f3012;_0x26e40c=0xc8;}else{_0x26e40c=0xce;}_0x5ebb3b['status'](_0x26e40c);return _0x5ebb3b[_0x8143('0x12')](_0x8143('0x13'),_0x5bd82a+'-'+_0xe74e8b+'/'+_0x3f3012)['json'](_0x2ed4fa);}return null;};}function saveUpdates(_0x13f6e4){return function(_0x11e78f){if(_0x11e78f){return _0x11e78f['update'](_0x13f6e4)['then'](function(_0x204e01){return _0x204e01;});}return null;};}function removeEntity(_0x55df0b){return function(_0x1c8680){if(_0x1c8680){return _0x1c8680[_0x8143('0x14')]()[_0x8143('0x15')](function(){_0x55df0b[_0x8143('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24534c){return function(_0x34e4a4){if(!_0x34e4a4){_0x24534c[_0x8143('0xb')](0x194);}return _0x34e4a4;};}function handleError(_0x470f29,_0x543b79){_0x543b79=_0x543b79||0x1f4;return function(_0x3f5bf5){logger[_0x8143('0x16')](_0x3f5bf5[_0x8143('0x17')]);if(_0x3f5bf5[_0x8143('0x18')]){delete _0x3f5bf5[_0x8143('0x18')];}_0x470f29[_0x8143('0xc')](_0x543b79)[_0x8143('0x19')](_0x3f5bf5);};}function maskClientSecret(_0x76230f){return _['padEnd'](_0x76230f[_0x8143('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x163026,_0x336b3d){var _0xa18cc6={},_0x300b59={},_0x138721={'count':0x0,'rows':[]};var _0x4f3894=_[_0x8143('0x1b')](db['CloudProvider']['rawAttributes'],function(_0x4b29c8){return{'name':_0x4b29c8['fieldName'],'type':_0x4b29c8['type'][_0x8143('0x1c')]};});_0x300b59[_0x8143('0x1d')]=_['map'](_0x4f3894,'name');_0x300b59[_0x8143('0x1e')]=_[_0x8143('0x1f')](_0x163026[_0x8143('0x1e')]);_0x300b59[_0x8143('0x20')]=_[_0x8143('0x21')](_0x300b59[_0x8143('0x1d')],_0x300b59[_0x8143('0x1e')]);_0xa18cc6['attributes']=_[_0x8143('0x21')](_0x300b59[_0x8143('0x1d')],qs[_0x8143('0x22')](_0x163026[_0x8143('0x1e')]['fields']));_0xa18cc6[_0x8143('0x23')]=_0xa18cc6[_0x8143('0x23')][_0x8143('0x24')]?_0xa18cc6[_0x8143('0x23')]:_0x300b59[_0x8143('0x1d')];if(!_0x163026[_0x8143('0x1e')][_0x8143('0x25')](_0x8143('0x26'))){_0xa18cc6[_0x8143('0x11')]=qs['limit'](_0x163026['query'][_0x8143('0x11')]);_0xa18cc6[_0x8143('0x10')]=qs[_0x8143('0x10')](_0x163026[_0x8143('0x1e')][_0x8143('0x10')]);}_0xa18cc6['order']=qs['sort'](_0x163026[_0x8143('0x1e')][_0x8143('0x27')]);_0xa18cc6[_0x8143('0x28')]=qs[_0x8143('0x20')](_[_0x8143('0x29')](_0x163026['query'],_0x300b59[_0x8143('0x20')]),_0x4f3894);if(_0x163026['query'][_0x8143('0x2a')]){_0xa18cc6[_0x8143('0x28')]=_['merge'](_0xa18cc6[_0x8143('0x28')],{'$or':_[_0x8143('0x1b')](_0x4f3894,function(_0x56e65e){if(_0x56e65e[_0x8143('0x2b')]!==_0x8143('0x2c')){var _0x2382d9={};_0x2382d9[_0x56e65e[_0x8143('0x18')]]={'$like':'%'+_0x163026[_0x8143('0x1e')]['filter']+'%'};return _0x2382d9;}})});}_0xa18cc6=_[_0x8143('0x2d')]({},_0xa18cc6,_0x163026[_0x8143('0x2e')]);var _0x171bed={'where':_0xa18cc6[_0x8143('0x28')]};return db[_0x8143('0x2f')]['count'](_0x171bed)[_0x8143('0x15')](function(_0x1dcafa){_0x138721[_0x8143('0xf')]=_0x1dcafa;if(_0x163026[_0x8143('0x1e')]['includeAll']){_0xa18cc6['include']=[{'all':!![]}];}return db[_0x8143('0x2f')][_0x8143('0x30')](_0xa18cc6);})[_0x8143('0x15')](function(_0x367d54){_0x138721[_0x8143('0x31')]=_[_0x8143('0x1b')](_0x367d54,function(_0x2b6f03){if(_0x2b6f03[_0x8143('0x32')]==='MicrosoftAzure'){var _0x2715ba=encryptor[_0x8143('0x33')](_0x2b6f03[_0x8143('0x34')]);_0x2b6f03['data3']=maskClientSecret(_0x2715ba);}return _0x2b6f03;});return _0x138721;})['then'](respondWithFilteredResult(_0x336b3d,_0xa18cc6))[_0x8143('0x35')](handleError(_0x336b3d,null));};exports['show']=function(_0x279f63,_0x28f8df){var _0x3377e4={'raw':!![],'where':{'id':_0x279f63[_0x8143('0x36')]['id']}},_0x2701b6={};_0x2701b6[_0x8143('0x1d')]=_[_0x8143('0x1f')](db[_0x8143('0x2f')][_0x8143('0x37')]);_0x2701b6[_0x8143('0x1e')]=_[_0x8143('0x1f')](_0x279f63[_0x8143('0x1e')]);_0x2701b6['filters']=_['intersection'](_0x2701b6[_0x8143('0x1d')],_0x2701b6[_0x8143('0x1e')]);_0x3377e4[_0x8143('0x23')]=_['intersection'](_0x2701b6[_0x8143('0x1d')],qs[_0x8143('0x22')](_0x279f63[_0x8143('0x1e')][_0x8143('0x22')]));_0x3377e4['attributes']=_0x3377e4[_0x8143('0x23')][_0x8143('0x24')]?_0x3377e4['attributes']:_0x2701b6['model'];if(_0x279f63[_0x8143('0x1e')]['includeAll']){_0x3377e4[_0x8143('0x38')]=[{'all':!![]}];}_0x3377e4=_[_0x8143('0x2d')]({},_0x3377e4,_0x279f63[_0x8143('0x2e')]);return db[_0x8143('0x2f')][_0x8143('0x39')](_0x3377e4)['then'](handleEntityNotFound(_0x28f8df,null))[_0x8143('0x15')](function(_0x5a5b83){if(_0x5a5b83[_0x8143('0x32')]===_0x8143('0x3a')){var _0x1caddf=encryptor[_0x8143('0x33')](_0x5a5b83[_0x8143('0x34')]);_0x5a5b83[_0x8143('0x34')]=maskClientSecret(_0x1caddf);}return _0x5a5b83;})[_0x8143('0x15')](respondWithResult(_0x28f8df,null))['catch'](handleError(_0x28f8df,null));};exports[_0x8143('0x3b')]=function(_0x559925,_0x43af86){if(!_0x559925[_0x8143('0x3c')]['name'])throw new Error(_0x8143('0x3d'));if(!_0x559925[_0x8143('0x3c')][_0x8143('0x32')])throw new Error(_0x8143('0x3e'));var _0x58437f=db['CloudProvider'][_0x8143('0x37')][_0x8143('0x32')][_0x8143('0x3f')];if(!_0x58437f['includes'](_0x559925['body'][_0x8143('0x32')]))throw new Error(_0x8143('0x40')+_0x58437f[_0x8143('0x41')](',\x20'));if(_0x559925['body'][_0x8143('0x32')]===_0x8143('0x3a')&&_0x559925[_0x8143('0x3c')]['data3']){_0x559925[_0x8143('0x3c')][_0x8143('0x34')]=encryptor[_0x8143('0x42')](_0x559925[_0x8143('0x3c')]['data3']);}return db['CloudProvider'][_0x8143('0x3b')](_0x559925[_0x8143('0x3c')],{})[_0x8143('0x15')](respondWithResult(_0x43af86,0xc9))[_0x8143('0x35')](handleError(_0x43af86,null));};exports['update']=function(_0x4d8645,_0x36af9c){if(_0x4d8645[_0x8143('0x3c')]['id']){delete _0x4d8645['body']['id'];}return db['CloudProvider']['find']({'where':{'id':_0x4d8645[_0x8143('0x36')]['id']}})['then'](handleEntityNotFound(_0x36af9c,null))[_0x8143('0x15')](function(_0x2394aa){if(_0x2394aa['service']===_0x8143('0x3a')&&_0x4d8645['body']['data3']){_0x4d8645['body'][_0x8143('0x34')]=encryptor[_0x8143('0x42')](_0x4d8645[_0x8143('0x3c')][_0x8143('0x34')]);}return _0x2394aa;})['then'](saveUpdates(_0x4d8645[_0x8143('0x3c')],null))[_0x8143('0x15')](respondWithResult(_0x36af9c,null))[_0x8143('0x35')](handleError(_0x36af9c,null));};exports[_0x8143('0x14')]=function(_0x554a5d,_0x13c8cf){return db['CloudProvider'][_0x8143('0x39')]({'where':{'id':_0x554a5d[_0x8143('0x36')]['id']}})[_0x8143('0x15')](handleEntityNotFound(_0x13c8cf,null))[_0x8143('0x15')](removeEntity(_0x13c8cf,null))[_0x8143('0x35')](handleError(_0x13c8cf,null));};exports[_0x8143('0x43')]=function(_0x1c6296,_0x104c7b){return db[_0x8143('0x2f')][_0x8143('0x44')]({'where':{'id':_0x1c6296[_0x8143('0x36')]['id']},'raw':!![]})[_0x8143('0x15')](function(_0x1d290b){if(!_0x1d290b)return _0x104c7b[_0x8143('0xb')](0x194);return{'url':oauth[_0x8143('0x45')](_0x1d290b,_0x1c6296[_0x8143('0x46')]['id'])};})[_0x8143('0x15')](respondWithResult(_0x104c7b,null))[_0x8143('0x35')](handleError(_0x104c7b,null));};exports['oauth2MicrosoftCallback']=function(_0x3b1962,_0x4396bb){var _0x4014d9=_0x3b1962[_0x8143('0x3c')];var _0x1e7425;var _0x18e804;if(_0x4014d9['error'])throw _0x4014d9;redis[_0x8143('0x47')](_0x4014d9[_0x8143('0x48')])[_0x8143('0x15')](function(_0x42a6c9){if(!_0x42a6c9)throw new Error(_0x8143('0x49'));_0x1e7425=JSON[_0x8143('0x4a')](_0x42a6c9);var _0x287447=Buffer[_0x8143('0x4b')](_0x4014d9[_0x8143('0x48')],_0x8143('0x4c'))[_0x8143('0x4d')](_0x8143('0x4e'));_0x18e804=JSON[_0x8143('0x4a')](_0x287447);if(!oauth[_0x8143('0x4f')](_0x4014d9['id_token'],_0x1e7425[_0x8143('0x50')]))throw new Error(_0x8143('0x51'));redis[_0x8143('0x52')](_0x4014d9[_0x8143('0x48')]);return oauth[_0x8143('0x53')](_0x4014d9[_0x8143('0x54')],_0x1e7425);})[_0x8143('0x15')](function(_0x3c034d){_0x1e7425[_0x8143('0x55')]=_0x3c034d[_0x8143('0x56')];_0x1e7425['data6']=_0x3c034d[_0x8143('0x57')];return db[_0x8143('0x2f')]['update']({'data5':_0x1e7425[_0x8143('0x55')],'data6':_0x1e7425[_0x8143('0x58')]},{'where':{'id':_0x1e7425['id']}});})[_0x8143('0x15')](function(){oauth[_0x8143('0x59')](_0x1e7425);socket[_0x8143('0x5a')](_0x8143('0x5b'),{'id':_0x18e804['id']});return;})[_0x8143('0x15')](respondWithStatusCode(_0x4396bb,null))['catch'](function(_0x15d5da){if(_0x18e804){socket[_0x8143('0x5a')](_0x8143('0x5c'),{'id':_0x18e804['id']});}if(!_0x1e7425){logger[_0x8143('0x16')](_0x8143('0x5d'),_0x15d5da);return _0x4396bb['status'](0x1f4)[_0x8143('0x19')](_0x15d5da['message']);}logger['error'](_0x8143('0x5e'),_0x1e7425['id'],JSON[_0x8143('0x5f')](_0x15d5da));});};
\ No newline at end of file
+var _0x38bd=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','map','service','MicrosoftAzure','decryptString','data3','catch','show','params','includeAll','find','body','Name\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','end','status','undefined','offset','count','limit','set','Content-Range','json','update','then','destroy','sendStatus','name','send','padEnd','slice','index','CloudProvider','rawAttributes','type','key','query','keys','filters','model','attributes','intersection'];(function(_0x10a50e,_0x48b844){var _0x296260=function(_0x2a4a94){while(--_0x2a4a94){_0x10a50e['push'](_0x10a50e['shift']());}};_0x296260(++_0x48b844);}(_0x38bd,0x1c3));var _0xd38b=function(_0x918086,_0x1e9fd7){_0x918086=_0x918086-0x0;var _0x55467b=_0x38bd[_0x918086];return _0x55467b;};'use strict';var _=require('lodash');var Redis=require(_0xd38b('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xd38b('0x1'));var config=require(_0xd38b('0x2'));var logger=require(_0xd38b('0x3'))(_0xd38b('0x4'));var db=require(_0xd38b('0x5'))['db'];var oauth=require(_0xd38b('0x6'));config['redis']=_[_0xd38b('0x7')](config[_0xd38b('0x8')],{'host':_0xd38b('0x9'),'port':0x18eb});var socket=require(_0xd38b('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0xd38b('0x8')]);function respondWithStatusCode(_0x595e83,_0x3e058b){_0x3e058b=_0x3e058b||0xcc;return function(_0x387b72){if(_0x387b72){return _0x595e83['sendStatus'](_0x3e058b);}return _0x595e83['status'](_0x3e058b)[_0xd38b('0xb')]();};}function respondWithResult(_0x572782,_0x2ae8f5){_0x2ae8f5=_0x2ae8f5||0xc8;return function(_0x5c5f62){if(_0x5c5f62){return _0x572782[_0xd38b('0xc')](_0x2ae8f5)['json'](_0x5c5f62);}};}function respondWithFilteredResult(_0x139de5,_0x1567cf){return function(_0x97e7d2){if(_0x97e7d2){var _0x3c8b80=typeof _0x1567cf['offset']===_0xd38b('0xd')&&typeof _0x1567cf['limit']==='undefined';var _0x4383ef=_0x97e7d2['count'];var _0x259661=_0x3c8b80?0x0:_0x1567cf[_0xd38b('0xe')];var _0x58e805=_0x3c8b80?_0x97e7d2[_0xd38b('0xf')]:_0x1567cf[_0xd38b('0xe')]+_0x1567cf[_0xd38b('0x10')];var _0x597440;if(_0x58e805>=_0x4383ef){_0x58e805=_0x4383ef;_0x597440=0xc8;}else{_0x597440=0xce;}_0x139de5['status'](_0x597440);return _0x139de5[_0xd38b('0x11')](_0xd38b('0x12'),_0x259661+'-'+_0x58e805+'/'+_0x4383ef)[_0xd38b('0x13')](_0x97e7d2);}return null;};}function saveUpdates(_0x123b34){return function(_0x57d901){if(_0x57d901){return _0x57d901[_0xd38b('0x14')](_0x123b34)[_0xd38b('0x15')](function(_0x96b557){return _0x96b557;});}return null;};}function removeEntity(_0x45db37){return function(_0x5e63d6){if(_0x5e63d6){return _0x5e63d6[_0xd38b('0x16')]()[_0xd38b('0x15')](function(){_0x45db37[_0xd38b('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d610){return function(_0x46ba29){if(!_0x46ba29){_0x31d610[_0xd38b('0x17')](0x194);}return _0x46ba29;};}function handleError(_0x3393eb,_0x122458){_0x122458=_0x122458||0x1f4;return function(_0xa3dac4){logger['error'](_0xa3dac4['stack']);if(_0xa3dac4[_0xd38b('0x18')]){delete _0xa3dac4[_0xd38b('0x18')];}_0x3393eb[_0xd38b('0xc')](_0x122458)[_0xd38b('0x19')](_0xa3dac4);};}function maskClientSecret(_0x1e8222){return _[_0xd38b('0x1a')](_0x1e8222[_0xd38b('0x1b')](0x0,0x3),0x14,'*');}exports[_0xd38b('0x1c')]=function(_0x43a59b,_0x4cb5da){var _0x1b0c20={},_0x5c7223={},_0x1f4cf4={'count':0x0,'rows':[]};var _0x44bac6=_['map'](db[_0xd38b('0x1d')][_0xd38b('0x1e')],function(_0x3adb59){return{'name':_0x3adb59['fieldName'],'type':_0x3adb59[_0xd38b('0x1f')][_0xd38b('0x20')]};});_0x5c7223['model']=_['map'](_0x44bac6,_0xd38b('0x18'));_0x5c7223[_0xd38b('0x21')]=_[_0xd38b('0x22')](_0x43a59b[_0xd38b('0x21')]);_0x5c7223[_0xd38b('0x23')]=_['intersection'](_0x5c7223[_0xd38b('0x24')],_0x5c7223[_0xd38b('0x21')]);_0x1b0c20[_0xd38b('0x25')]=_[_0xd38b('0x26')](_0x5c7223[_0xd38b('0x24')],qs[_0xd38b('0x27')](_0x43a59b[_0xd38b('0x21')][_0xd38b('0x27')]));_0x1b0c20[_0xd38b('0x25')]=_0x1b0c20[_0xd38b('0x25')][_0xd38b('0x28')]?_0x1b0c20[_0xd38b('0x25')]:_0x5c7223[_0xd38b('0x24')];if(!_0x43a59b[_0xd38b('0x21')][_0xd38b('0x29')](_0xd38b('0x2a'))){_0x1b0c20[_0xd38b('0x10')]=qs[_0xd38b('0x10')](_0x43a59b['query'][_0xd38b('0x10')]);_0x1b0c20[_0xd38b('0xe')]=qs['offset'](_0x43a59b['query'][_0xd38b('0xe')]);}_0x1b0c20[_0xd38b('0x2b')]=qs[_0xd38b('0x2c')](_0x43a59b[_0xd38b('0x21')][_0xd38b('0x2c')]);_0x1b0c20[_0xd38b('0x2d')]=qs[_0xd38b('0x23')](_[_0xd38b('0x2e')](_0x43a59b[_0xd38b('0x21')],_0x5c7223[_0xd38b('0x23')]),_0x44bac6);if(_0x43a59b[_0xd38b('0x21')][_0xd38b('0x2f')]){_0x1b0c20[_0xd38b('0x2d')]=_[_0xd38b('0x30')](_0x1b0c20[_0xd38b('0x2d')],{'$or':_['map'](_0x44bac6,function(_0x2b71f5){if(_0x2b71f5[_0xd38b('0x1f')]!==_0xd38b('0x31')){var _0x2e311a={};_0x2e311a[_0x2b71f5[_0xd38b('0x18')]]={'$like':'%'+_0x43a59b[_0xd38b('0x21')]['filter']+'%'};return _0x2e311a;}})});}_0x1b0c20=_['merge']({},_0x1b0c20,_0x43a59b[_0xd38b('0x32')]);var _0x58d1d2={'where':_0x1b0c20[_0xd38b('0x2d')]};return db[_0xd38b('0x1d')][_0xd38b('0xf')](_0x58d1d2)[_0xd38b('0x15')](function(_0x4f089b){_0x1f4cf4['count']=_0x4f089b;if(_0x43a59b[_0xd38b('0x21')]['includeAll']){_0x1b0c20[_0xd38b('0x33')]=[{'all':!![]}];}return db[_0xd38b('0x1d')][_0xd38b('0x34')](_0x1b0c20);})[_0xd38b('0x15')](function(_0x3dfa7d){_0x1f4cf4[_0xd38b('0x35')]=_[_0xd38b('0x36')](_0x3dfa7d,function(_0x543d87){if(_0x543d87[_0xd38b('0x37')]===_0xd38b('0x38')){var _0x59c1de=encryptor[_0xd38b('0x39')](_0x543d87[_0xd38b('0x3a')]);_0x543d87[_0xd38b('0x3a')]=maskClientSecret(_0x59c1de);}return _0x543d87;});return _0x1f4cf4;})[_0xd38b('0x15')](respondWithFilteredResult(_0x4cb5da,_0x1b0c20))[_0xd38b('0x3b')](handleError(_0x4cb5da,null));};exports[_0xd38b('0x3c')]=function(_0x25e23e,_0x4b24c3){var _0xfc4d8f={'raw':!![],'where':{'id':_0x25e23e[_0xd38b('0x3d')]['id']}},_0x2759e0={};_0x2759e0[_0xd38b('0x24')]=_[_0xd38b('0x22')](db[_0xd38b('0x1d')][_0xd38b('0x1e')]);_0x2759e0[_0xd38b('0x21')]=_['keys'](_0x25e23e[_0xd38b('0x21')]);_0x2759e0[_0xd38b('0x23')]=_[_0xd38b('0x26')](_0x2759e0[_0xd38b('0x24')],_0x2759e0[_0xd38b('0x21')]);_0xfc4d8f[_0xd38b('0x25')]=_[_0xd38b('0x26')](_0x2759e0[_0xd38b('0x24')],qs[_0xd38b('0x27')](_0x25e23e[_0xd38b('0x21')][_0xd38b('0x27')]));_0xfc4d8f['attributes']=_0xfc4d8f[_0xd38b('0x25')][_0xd38b('0x28')]?_0xfc4d8f['attributes']:_0x2759e0[_0xd38b('0x24')];if(_0x25e23e['query'][_0xd38b('0x3e')]){_0xfc4d8f[_0xd38b('0x33')]=[{'all':!![]}];}_0xfc4d8f=_[_0xd38b('0x30')]({},_0xfc4d8f,_0x25e23e[_0xd38b('0x32')]);return db[_0xd38b('0x1d')][_0xd38b('0x3f')](_0xfc4d8f)[_0xd38b('0x15')](handleEntityNotFound(_0x4b24c3,null))[_0xd38b('0x15')](function(_0x2e6871){if(_0x2e6871[_0xd38b('0x37')]===_0xd38b('0x38')){var _0x2e565e=encryptor['decryptString'](_0x2e6871['data3']);_0x2e6871['data3']=maskClientSecret(_0x2e565e);}return _0x2e6871;})['then'](respondWithResult(_0x4b24c3,null))[_0xd38b('0x3b')](handleError(_0x4b24c3,null));};exports['create']=function(_0x55cceb,_0xbf19a7){if(!_0x55cceb[_0xd38b('0x40')][_0xd38b('0x18')])throw new Error(_0xd38b('0x41'));if(!_0x55cceb['body'][_0xd38b('0x37')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x1b0309=db[_0xd38b('0x1d')][_0xd38b('0x1e')][_0xd38b('0x37')][_0xd38b('0x42')];if(!_0x1b0309['includes'](_0x55cceb[_0xd38b('0x40')][_0xd38b('0x37')]))throw new Error(_0xd38b('0x43')+_0x1b0309[_0xd38b('0x44')](',\x20'));if(_0x55cceb[_0xd38b('0x40')][_0xd38b('0x37')]==='MicrosoftAzure'&&_0x55cceb[_0xd38b('0x40')][_0xd38b('0x3a')]){_0x55cceb[_0xd38b('0x40')][_0xd38b('0x3a')]=encryptor[_0xd38b('0x45')](_0x55cceb['body']['data3']);}return db[_0xd38b('0x1d')][_0xd38b('0x46')](_0x55cceb[_0xd38b('0x40')],{})['then'](respondWithResult(_0xbf19a7,0xc9))[_0xd38b('0x3b')](handleError(_0xbf19a7,null));};exports['update']=function(_0x968baa,_0x4026f3){if(_0x968baa[_0xd38b('0x40')]['id']){delete _0x968baa[_0xd38b('0x40')]['id'];}return db[_0xd38b('0x1d')][_0xd38b('0x3f')]({'where':{'id':_0x968baa[_0xd38b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4026f3,null))[_0xd38b('0x15')](function(_0x2b6439){if(_0x2b6439[_0xd38b('0x37')]==='MicrosoftAzure'&&_0x968baa[_0xd38b('0x40')][_0xd38b('0x3a')]){_0x968baa[_0xd38b('0x40')][_0xd38b('0x3a')]=encryptor[_0xd38b('0x45')](_0x968baa[_0xd38b('0x40')][_0xd38b('0x3a')]);}return _0x2b6439;})[_0xd38b('0x15')](saveUpdates(_0x968baa[_0xd38b('0x40')],null))[_0xd38b('0x15')](respondWithResult(_0x4026f3,null))[_0xd38b('0x3b')](handleError(_0x4026f3,null));};exports['destroy']=function(_0x1e82d4,_0x4e4c2c){return db[_0xd38b('0x1d')][_0xd38b('0x3f')]({'where':{'id':_0x1e82d4[_0xd38b('0x3d')]['id']}})[_0xd38b('0x15')](handleEntityNotFound(_0x4e4c2c,null))[_0xd38b('0x15')](removeEntity(_0x4e4c2c,null))[_0xd38b('0x3b')](handleError(_0x4e4c2c,null));};exports[_0xd38b('0x47')]=function(_0x56babd,_0x237b81){return db[_0xd38b('0x1d')][_0xd38b('0x48')]({'where':{'id':_0x56babd[_0xd38b('0x3d')]['id']},'raw':!![]})['then'](function(_0xb51871){if(!_0xb51871)return _0x237b81['sendStatus'](0x194);return{'url':oauth[_0xd38b('0x49')](_0xb51871,_0x56babd['user']['id'])};})[_0xd38b('0x15')](respondWithResult(_0x237b81,null))[_0xd38b('0x3b')](handleError(_0x237b81,null));};exports[_0xd38b('0x4a')]=function(_0x1fc3aa,_0x3c2fad){var _0x2aacfc=_0x1fc3aa['body'];var _0x300504;var _0x3a3061;if(_0x2aacfc[_0xd38b('0x4b')])throw _0x2aacfc;redis[_0xd38b('0x4c')](_0x2aacfc[_0xd38b('0x4d')])[_0xd38b('0x15')](function(_0x438054){if(!_0x438054)throw new Error(_0xd38b('0x4e'));_0x300504=JSON[_0xd38b('0x4f')](_0x438054);var _0x1be51b=Buffer[_0xd38b('0x50')](_0x2aacfc[_0xd38b('0x4d')],_0xd38b('0x51'))[_0xd38b('0x52')]('ascii');_0x3a3061=JSON[_0xd38b('0x4f')](_0x1be51b);if(!oauth[_0xd38b('0x53')](_0x2aacfc[_0xd38b('0x54')],_0x300504['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xd38b('0x55')](_0x2aacfc[_0xd38b('0x4d')]);return oauth[_0xd38b('0x56')](_0x2aacfc[_0xd38b('0x57')],_0x300504);})[_0xd38b('0x15')](function(_0x7c9dcb){_0x300504[_0xd38b('0x58')]=_0x7c9dcb['access_token'];_0x300504[_0xd38b('0x59')]=_0x7c9dcb[_0xd38b('0x5a')];return db[_0xd38b('0x1d')][_0xd38b('0x14')]({'data5':_0x300504[_0xd38b('0x58')],'data6':_0x300504[_0xd38b('0x59')]},{'where':{'id':_0x300504['id']}});})[_0xd38b('0x15')](function(){oauth[_0xd38b('0x5b')](_0x300504);socket[_0xd38b('0x5c')]('microsoftAuthorization:success',{'id':_0x3a3061['id']});return;})['then'](respondWithStatusCode(_0x3c2fad,null))[_0xd38b('0x3b')](function(_0x817910){if(_0x3a3061){socket[_0xd38b('0x5c')](_0xd38b('0x5d'),{'id':_0x3a3061['id']});}if(!_0x300504){logger['error'](_0xd38b('0x5e'),_0x817910);return _0x3c2fad['status'](0x1f4)[_0xd38b('0x19')](_0x817910[_0xd38b('0x5f')]);}logger['error'](_0xd38b('0x60'),_0x300504['id'],JSON[_0xd38b('0x61')](_0x817910));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e4b=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','path'];(function(_0x17fc3e,_0x196b84){var _0x35341a=function(_0x68b1e1){while(--_0x68b1e1){_0x17fc3e['push'](_0x17fc3e['shift']());}};_0x35341a(++_0x196b84);}(_0x6e4b,0x192));var _0xb6e4=function(_0x1d8fba,_0x529150){_0x1d8fba=_0x1d8fba-0x0;var _0xfc4196=_0x6e4b[_0x1d8fba];return _0xfc4196;};'use strict';var _=require(_0xb6e4('0x0'));var util=require(_0xb6e4('0x1'));var logger=require(_0xb6e4('0x2'))(_0xb6e4('0x3'));var moment=require(_0xb6e4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6e4('0x5'));var rimraf=require('rimraf');var config=require(_0xb6e4('0x6'));var attributes=require(_0xb6e4('0x7'));module[_0xb6e4('0x8')]=function(_0x276b95,_0x407130){return _0x276b95[_0xb6e4('0x9')](_0xb6e4('0xa'),attributes,{'tableName':_0xb6e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f6d=['moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','api'];(function(_0x12d72f,_0x4b8dd2){var _0x419316=function(_0x3a93fd){while(--_0x3a93fd){_0x12d72f['push'](_0x12d72f['shift']());}};_0x419316(++_0x4b8dd2);}(_0x3f6d,0xee));var _0xd3f6=function(_0x5eb88f,_0x5b0442){_0x5eb88f=_0x5eb88f-0x0;var _0x2f086b=_0x3f6d[_0x5eb88f];return _0x2f086b;};'use strict';var _=require('lodash');var util=require(_0xd3f6('0x0'));var logger=require('../../config/logger')(_0xd3f6('0x1'));var moment=require(_0xd3f6('0x2'));var BPromise=require('bluebird');var rp=require(_0xd3f6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3f6('0x4'));var config=require(_0xd3f6('0x5'));var attributes=require(_0xd3f6('0x6'));module[_0xd3f6('0x7')]=function(_0x22ccd2,_0x339303){return _0x22ccd2[_0xd3f6('0x8')](_0xd3f6('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97b8=['findOne','refresh_token','data6','decryptString','data5','access_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','map','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','stringify','toString','base64','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','aud','isAfter','unix','exp','resolve','then','data3','CloudProvider'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x97b8,0x1eb));var _0x897b=function(_0x14f08a,_0x125286){_0x14f08a=_0x14f08a-0x0;var _0x448ac8=_0x97b8[_0x14f08a];return _0x448ac8;};'use strict';var _=require('lodash');var crypto=require(_0x897b('0x0'));var jwt=require(_0x897b('0x1'));var moment=require(_0x897b('0x2'));var Redis=require(_0x897b('0x3'));var rp=require('request-promise');var util=require(_0x897b('0x4'));var encryptor=require(_0x897b('0x5'));var config=require(_0x897b('0x6'));var logger=require(_0x897b('0x7'))(_0x897b('0x8'));var schedule=require(_0x897b('0x9'));var db=require('../../mysqldb')['db'];config[_0x897b('0xa')]=_[_0x897b('0xb')](config[_0x897b('0xa')],{'host':_0x897b('0xc'),'port':0x18eb});var redis=new Redis(config[_0x897b('0xa')]);var MICROSOFT_AUTH_URL=_0x897b('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x897b('0xe'),_0x897b('0xf'),_0x897b('0x10'),_0x897b('0x11'),_0x897b('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x897b('0x13')],'Dynamics365':[_0x897b('0xe'),_0x897b('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x897b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x897b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48c909){var _0x296e92=_['map'](AZURE_AUTH_SCOPES[_0x48c909[_0x897b('0x16')]]);if(_0x48c909['type']===_0x897b('0x17'))_0x296e92[_0x897b('0x18')](_0x48c909[_0x897b('0x19')]+_0x897b('0x1a'));return _0x296e92[_0x897b('0x1b')]('\x20');}function getAccessTokenScope(_0x56fda1){if(_0x56fda1[_0x897b('0x16')]===_0x897b('0x1c'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x56fda1['type']==='Dynamics365')return _0x56fda1[_0x897b('0x19')]+_0x897b('0x1a');}function generateMicrosoftAuthorizationUrl(_0x146426,_0x5cc574){var _0x2100e6=MICROSOFT_AUTH_URL[_0x897b('0x1d')](_0x897b('0x1e'),_0x146426[_0x897b('0x1f')]);var _0x4f5ce8=['code',_0x897b('0x20')];var _0x298bdd=Buffer['from'](JSON[_0x897b('0x21')]({'id':_0x5cc574}))[_0x897b('0x22')](_0x897b('0x23'));var _0x449981=crypto['randomBytes'](0x10)[_0x897b('0x22')](_0x897b('0x24'));var _0x4409ab=getAuthorizationScopes(_0x146426);var _0x57152f=[{'key':_0x897b('0x25'),'value':_0x146426[_0x897b('0x26')]},{'key':_0x897b('0x27'),'value':encodeURIComponent(_0x4f5ce8[_0x897b('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x146426[_0x897b('0x28')]},{'key':_0x897b('0x29'),'value':_0x897b('0x2a')},{'key':_0x897b('0x2b'),'value':encodeURIComponent(_0x4409ab)},{'key':_0x897b('0x2c'),'value':_0x298bdd},{'key':_0x897b('0x2d'),'value':_0x449981},{'key':'prompt','value':'login'}];var _0x3c6b1f=_0x2100e6+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x57152f,function(_0x7a1d57){return _0x7a1d57[_0x897b('0x2e')]+'='+_0x7a1d57[_0x897b('0x2f')];})[_0x897b('0x1b')]('&');_0x146426[_0x897b('0x30')]={'issuer':_0x2100e6['replace'](_0x897b('0x31'),''),'audience':_0x146426[_0x897b('0x26')],'state':_0x298bdd,'nonce':_0x449981};redis[_0x897b('0x32')](_0x298bdd,JSON['stringify'](_0x146426));return _0x3c6b1f;}function isValidIdToken(_0x560598,_0x161593){try{var _0x497d96=jwt[_0x897b('0x33')](_0x560598,{'complete':!![]});var _0x3a8ec5=_0x497d96[_0x897b('0x34')];if(_0x3a8ec5[_0x897b('0x35')]!==_0x161593['issuer'])return![];if(_0x3a8ec5[_0x897b('0x36')]!==_0x161593['audience'])return![];if(_0x3a8ec5[_0x897b('0x2d')]!==_0x161593[_0x897b('0x2d')])return![];if(moment()[_0x897b('0x37')](moment[_0x897b('0x38')](_0x3a8ec5[_0x897b('0x39')])))return![];return!![];}catch(_0xb19836){throw _0xb19836;}}function refreshOauth2MicrosoftAccessToken(_0x17fc51){return Promise[_0x897b('0x3a')]()[_0x897b('0x3b')](function(){if(_0x17fc51[_0x897b('0x3c')])return _0x17fc51;return db[_0x897b('0x3d')][_0x897b('0x3e')]({'where':{'id':_0x17fc51['id']},'raw':!![]});})[_0x897b('0x3b')](function(_0x499955){var _0x49755c={'grant_type':_0x897b('0x3f'),'refresh_token':_0x499955[_0x897b('0x40')],'scope':getAccessTokenScope(_0x499955),'redirect_uri':_0x499955[_0x897b('0x28')],'client_id':_0x499955[_0x897b('0x26')],'client_secret':encryptor[_0x897b('0x41')](_0x499955[_0x897b('0x3c')])};var _0xe1d4a4={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x897b('0x1d')]('{TENANT_ID}',_0x499955[_0x897b('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x49755c,'json':!![]};return rp(_0xe1d4a4);})['then'](function(_0x234361){_0x17fc51[_0x897b('0x42')]=_0x234361[_0x897b('0x43')];_0x17fc51[_0x897b('0x40')]=_0x234361[_0x897b('0x3f')];return db['CloudProvider'][_0x897b('0x44')]({'data5':_0x17fc51[_0x897b('0x42')],'data6':_0x17fc51[_0x897b('0x40')]},{'where':{'id':_0x17fc51['id']}});})[_0x897b('0x3b')](function(){return _0x17fc51;})['catch'](function(_0x3fa75b){logger['error'](_0x897b('0x45'),_0x17fc51['id'],_0x3fa75b);});}function getOauth2MicrosoftAccessToken(_0x3be814,_0x22e299){var _0x38a2aa={'grant_type':_0x897b('0x46'),'code':_0x3be814,'scope':getAccessTokenScope(_0x22e299),'redirect_uri':_0x22e299[_0x897b('0x28')],'client_id':_0x22e299[_0x897b('0x26')],'client_secret':encryptor[_0x897b('0x41')](_0x22e299['data3'])};var _0x23c4f3={'method':_0x897b('0x47'),'uri':MICROSOFT_AUTH_URL[_0x897b('0x1d')](_0x897b('0x1e'),_0x22e299[_0x897b('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x38a2aa,'json':!![]};return rp(_0x23c4f3);}function startRefreshInterval(_0x547789){var _0x4908ed=schedule[_0x897b('0x48')];if(_0x4908ed[_0x547789['id']])clearInterval(_0x4908ed[_0x547789['id']]);_0x4908ed[_0x547789['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x897b('0x49')](this,{'id':_0x547789['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4908ed;}function startAllRefreshIntervals(){return db[_0x897b('0x3d')][_0x897b('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x897b('0x3b')](function(_0x2e6e1e){var _0x36bbe2=_0x2e6e1e[_0x897b('0x4b')](function(_0x4703bc){return refreshOauth2MicrosoftAccessToken(_0x4703bc)[_0x897b('0x3b')](function(_0x33ce86){startRefreshInterval(_0x33ce86);});});return Promise[_0x897b('0x4c')](_0x36bbe2);})['catch'](function(_0x3301a7){var _0x3acee4=_0x3301a7?util['inspect'](_0x3301a7,{'showHidden':![],'depth':null}):'';logger[_0x897b('0x4d')](_0x897b('0x4e'),_0x3acee4);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xb85e=['bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','{TENANT_ID}','data2','id_token','from','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','key','value','replace','oauth2/','stringify','decode','payload','iss','issuer','audience','isAfter','unix','then','data3','CloudProvider','refresh_token','data6','data4','decryptString','POST','access_token','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals'];(function(_0x2bbb77,_0x34c703){var _0x8e3c85=function(_0x3d2c5b){while(--_0x3d2c5b){_0x2bbb77['push'](_0x2bbb77['shift']());}};_0x8e3c85(++_0x34c703);}(_0xb85e,0x1ce));var _0xeb85=function(_0x344272,_0x245de9){_0x344272=_0x344272-0x0;var _0x11562a=_0xb85e[_0x344272];return _0x11562a;};'use strict';var _=require(_0xeb85('0x0'));var crypto=require(_0xeb85('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0xeb85('0x2'));var Redis=require(_0xeb85('0x3'));var rp=require(_0xeb85('0x4'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require('../../config/logger')(_0xeb85('0x5'));var schedule=require(_0xeb85('0x6'));var db=require(_0xeb85('0x7'))['db'];config[_0xeb85('0x8')]=_['defaults'](config[_0xeb85('0x8')],{'host':_0xeb85('0x9'),'port':0x18eb});var redis=new Redis(config[_0xeb85('0x8')]);var MICROSOFT_AUTH_URL=_0xeb85('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xeb85('0xb'),'profile',_0xeb85('0xc'),_0xeb85('0xd'),_0xeb85('0xe'),_0xeb85('0xf'),_0xeb85('0x10')],'Dynamics365':[_0xeb85('0xb'),_0xeb85('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xeb85('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xeb85('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1bb7c2){var _0x264b81=_[_0xeb85('0x13')](AZURE_AUTH_SCOPES[_0x1bb7c2['type']]);if(_0x1bb7c2[_0xeb85('0x14')]===_0xeb85('0x15'))_0x264b81[_0xeb85('0x16')](_0x1bb7c2['data7']+_0xeb85('0x17'));return _0x264b81[_0xeb85('0x18')]('\x20');}function getAccessTokenScope(_0x111b48){if(_0x111b48[_0xeb85('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x111b48[_0xeb85('0x14')]===_0xeb85('0x15'))return _0x111b48['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0xe12a70,_0x38df82){var _0x5afe84=MICROSOFT_AUTH_URL['replace'](_0xeb85('0x19'),_0xe12a70[_0xeb85('0x1a')]);var _0x165d2c=['code',_0xeb85('0x1b')];var _0x3cb5f1=Buffer[_0xeb85('0x1c')](JSON['stringify']({'id':_0x38df82}))[_0xeb85('0x1d')](_0xeb85('0x1e'));var _0xf551ea=crypto[_0xeb85('0x1f')](0x10)[_0xeb85('0x1d')](_0xeb85('0x20'));var _0x2ac13c=getAuthorizationScopes(_0xe12a70);var _0x3ee3ed=[{'key':_0xeb85('0x21'),'value':_0xe12a70[_0xeb85('0x22')]},{'key':_0xeb85('0x23'),'value':encodeURIComponent(_0x165d2c['join']('\x20'))},{'key':_0xeb85('0x24'),'value':_0xe12a70['data4']},{'key':_0xeb85('0x25'),'value':_0xeb85('0x26')},{'key':_0xeb85('0x27'),'value':encodeURIComponent(_0x2ac13c)},{'key':_0xeb85('0x28'),'value':_0x3cb5f1},{'key':_0xeb85('0x29'),'value':_0xf551ea},{'key':_0xeb85('0x2a'),'value':'login'}];var _0x51bd81=_0x5afe84+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xeb85('0x13')](_0x3ee3ed,function(_0x5a9ab2){return _0x5a9ab2[_0xeb85('0x2b')]+'='+_0x5a9ab2[_0xeb85('0x2c')];})['join']('&');_0xe12a70['oauth2Claims']={'issuer':_0x5afe84[_0xeb85('0x2d')](_0xeb85('0x2e'),''),'audience':_0xe12a70[_0xeb85('0x22')],'state':_0x3cb5f1,'nonce':_0xf551ea};redis['set'](_0x3cb5f1,JSON[_0xeb85('0x2f')](_0xe12a70));return _0x51bd81;}function isValidIdToken(_0x8493f1,_0x27cc5e){try{var _0x292c2b=jwt[_0xeb85('0x30')](_0x8493f1,{'complete':!![]});var _0x3d6c81=_0x292c2b[_0xeb85('0x31')];if(_0x3d6c81[_0xeb85('0x32')]!==_0x27cc5e[_0xeb85('0x33')])return![];if(_0x3d6c81['aud']!==_0x27cc5e[_0xeb85('0x34')])return![];if(_0x3d6c81['nonce']!==_0x27cc5e[_0xeb85('0x29')])return![];if(moment()[_0xeb85('0x35')](moment[_0xeb85('0x36')](_0x3d6c81['exp'])))return![];return!![];}catch(_0x359381){throw _0x359381;}}function refreshOauth2MicrosoftAccessToken(_0x2addf9){return Promise['resolve']()[_0xeb85('0x37')](function(){if(_0x2addf9[_0xeb85('0x38')])return _0x2addf9;return db[_0xeb85('0x39')]['findOne']({'where':{'id':_0x2addf9['id']},'raw':!![]});})[_0xeb85('0x37')](function(_0x11a46a){var _0x5dab18={'grant_type':_0xeb85('0x3a'),'refresh_token':_0x11a46a[_0xeb85('0x3b')],'scope':getAccessTokenScope(_0x11a46a),'redirect_uri':_0x11a46a[_0xeb85('0x3c')],'client_id':_0x11a46a['data1'],'client_secret':encryptor[_0xeb85('0x3d')](_0x11a46a[_0xeb85('0x38')])};var _0x1def3e={'method':_0xeb85('0x3e'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x11a46a[_0xeb85('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5dab18,'json':!![]};return rp(_0x1def3e);})['then'](function(_0x1349cc){_0x2addf9['data5']=_0x1349cc[_0xeb85('0x3f')];_0x2addf9['data6']=_0x1349cc[_0xeb85('0x3a')];return db[_0xeb85('0x39')][_0xeb85('0x40')]({'data5':_0x2addf9[_0xeb85('0x41')],'data6':_0x2addf9[_0xeb85('0x3b')]},{'where':{'id':_0x2addf9['id']}});})[_0xeb85('0x37')](function(){return _0x2addf9;})['catch'](function(_0x4f7377){logger[_0xeb85('0x42')](_0xeb85('0x43'),_0x2addf9['id'],_0x4f7377);});}function getOauth2MicrosoftAccessToken(_0x29c63d,_0x24b930){var _0x5c1088={'grant_type':_0xeb85('0x44'),'code':_0x29c63d,'scope':getAccessTokenScope(_0x24b930),'redirect_uri':_0x24b930[_0xeb85('0x3c')],'client_id':_0x24b930['data1'],'client_secret':encryptor['decryptString'](_0x24b930['data3'])};var _0x53b97d={'method':_0xeb85('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xeb85('0x2d')](_0xeb85('0x19'),_0x24b930[_0xeb85('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5c1088,'json':!![]};return rp(_0x53b97d);}function startRefreshInterval(_0x1bb763){var _0x227dc8=schedule[_0xeb85('0x45')];if(_0x227dc8[_0x1bb763['id']])clearInterval(_0x227dc8[_0x1bb763['id']]);_0x227dc8[_0x1bb763['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xeb85('0x46')](this,{'id':_0x1bb763['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xeb85('0x45')]=_0x227dc8;}function startAllRefreshIntervals(){return db[_0xeb85('0x39')][_0xeb85('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xeb85('0x37')](function(_0x37549c){var _0x7185fe=_0x37549c['map'](function(_0x2d8a2e){return refreshOauth2MicrosoftAccessToken(_0x2d8a2e)[_0xeb85('0x37')](function(_0xd0d780){startRefreshInterval(_0xd0d780);});});return Promise[_0xeb85('0x48')](_0x7185fe);})[_0xeb85('0x49')](function(_0x42bc2e){var _0x1e8809=_0x42bc2e?util['inspect'](_0x42bc2e,{'showHidden':![],'depth':null}):'';logger[_0xeb85('0x42')](_0xeb85('0x4a'),_0x1e8809);});}module[_0xeb85('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd8e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbd8e[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xebd8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebd8('0x3'))['db'];var utils=require(_0xebd8('0x4'));var logger=require(_0xebd8('0x5'))(_0xebd8('0x6'));var config=require(_0xebd8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xebd8('0x8')][_0xebd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f2b2e,_0x3740bd,_0x3b92b9){return new BPromise(function(_0x4ac0d0,_0x19c8ee){return client[_0xebd8('0xa')](_0x3f2b2e,_0x3b92b9)[_0xebd8('0xb')](function(_0x13afa5){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3740bd,'request\x20sent');logger[_0xebd8('0xc')](_0xebd8('0xd'),_0x3740bd,_0xebd8('0xe'),JSON[_0xebd8('0xf')](_0x13afa5));if(_0x13afa5[_0xebd8('0x10')]){if(_0x13afa5['error'][_0xebd8('0x11')]===0x1f4){logger['error'](_0xebd8('0x12'),_0x3740bd,_0x13afa5[_0xebd8('0x10')]['message']);return _0x19c8ee(_0x13afa5[_0xebd8('0x10')][_0xebd8('0x13')]);}logger[_0xebd8('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3740bd,_0x13afa5[_0xebd8('0x10')]['message']);return _0x4ac0d0(_0x13afa5[_0xebd8('0x10')]['message']);}else{logger['info'](_0xebd8('0x12'),_0x3740bd,_0xebd8('0xe'));_0x4ac0d0(_0x13afa5[_0xebd8('0x14')][_0xebd8('0x13')]);}})[_0xebd8('0x15')](function(_0x2b6ac4){logger[_0xebd8('0x10')](_0xebd8('0x12'),_0x3740bd,_0x2b6ac4);_0x19c8ee(_0x2b6ac4);});});}
\ No newline at end of file
+var _0xa5c1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x17d4ad,_0x3ff30d){_0x17d4ad=_0x17d4ad-0x0;var _0x1113dd=_0xa5c1[_0x17d4ad];return _0x1113dd;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9853,_0x580a2e,_0x438f8f){return new BPromise(function(_0x43a2ed,_0x1702ce){return client['request'](_0x9853,_0x438f8f)[_0x1a5c('0xa')](function(_0x4c0bd2){logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');logger[_0x1a5c('0xd')](_0x1a5c('0xe'),_0x580a2e,'request\x20sent',JSON[_0x1a5c('0xf')](_0x4c0bd2));if(_0x4c0bd2[_0x1a5c('0x10')]){if(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x11')]===0x1f4){logger[_0x1a5c('0x10')](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x1702ce(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}logger['error'](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x43a2ed(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}else{logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');_0x43a2ed(_0x4c0bd2[_0x1a5c('0x13')]['message']);}})[_0x1a5c('0x14')](function(_0x44648a){logger[_0x1a5c('0x10')]('CloudProvider,\x20%s,\x20%s',_0x580a2e,_0x44648a);_0x1702ce(_0x44648a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x561bfe,_0x1324f6){var _0x30281d=function(_0x3145c9){while(--_0x3145c9){_0x561bfe['push'](_0x561bfe['shift']());}};_0x30281d(++_0x1324f6);}(_0xadb5,0xad));var _0x5adb=function(_0x1d8f49,_0x4d145e){_0x1d8f49=_0x1d8f49-0x0;var _0x23a0fc=_0xadb5[_0x1d8f49];return _0x23a0fc;};'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
+var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x58e7a1,_0x154e10){var _0x4b0734=function(_0x5ea5f3){while(--_0x5ea5f3){_0x58e7a1['push'](_0x58e7a1['shift']());}};_0x4b0734(++_0x154e10);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49d2=['exports','STRING','name','sequelize'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x49d2,0xa7));var _0x249d=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x49d2[_0x64aff8];return _0x5488a3;};'use strict';var Sequelize=require(_0x249d('0x0'));module[_0x249d('0x1')]={'name':{'type':Sequelize[_0x249d('0x2')],'unique':_0x249d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x249d('0x2')]},'companyId':{'type':Sequelize[_0x249d('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x249d('0x2')]},'street':{'type':Sequelize[_0x249d('0x2')]},'postalCode':{'type':Sequelize[_0x249d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x249d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x249d('0x2')]},'sStreet':{'type':Sequelize[_0x249d('0x2')]},'sPostalCode':{'type':Sequelize[_0x249d('0x2')]},'sCity':{'type':Sequelize[_0x249d('0x2')]},'sCountry':{'type':Sequelize[_0x249d('0x2')]},'description':{'type':Sequelize[_0x249d('0x2')]}};
\ No newline at end of file
+var _0x94f8=['exports','STRING'];(function(_0x5d425f,_0x1f8874){var _0xec2011=function(_0xf89354){while(--_0xf89354){_0x5d425f['push'](_0x5d425f['shift']());}};_0xec2011(++_0x1f8874);}(_0x94f8,0x19e));var _0x894f=function(_0x2d1406,_0x8a575e){_0x2d1406=_0x2d1406-0x0;var _0x31a9fb=_0x94f8[_0x2d1406];return _0x31a9fb;};'use strict';var Sequelize=require('sequelize');module[_0x894f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x894f('0x1')]},'phone':{'type':Sequelize[_0x894f('0x1')]},'fax':{'type':Sequelize[_0x894f('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x894f('0x1')]},'postalCode':{'type':Sequelize[_0x894f('0x1')]},'city':{'type':Sequelize[_0x894f('0x1')]},'country':{'type':Sequelize[_0x894f('0x1')]},'email':{'type':Sequelize[_0x894f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x894f('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x894f('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x894f('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7acd=['reject','then','get','UserProfileResource','destroy','error','stack','name','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','addContacts','CmContact','ids','getContacts','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x7acd,0x11b));var _0xd7ac=function(_0x168f14,_0x518aba){_0x168f14=_0x168f14-0x0;var _0x542ae6=_0x7acd[_0x168f14];return _0x542ae6;};'use strict';var emlformat=require(_0xd7ac('0x0'));var rimraf=require(_0xd7ac('0x1'));var zipdir=require(_0xd7ac('0x2'));var jsonpatch=require(_0xd7ac('0x3'));var rp=require('request-promise');var moment=require(_0xd7ac('0x4'));var BPromise=require(_0xd7ac('0x5'));var Mustache=require('mustache');var util=require(_0xd7ac('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd7ac('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd7ac('0x8'));var _=require(_0xd7ac('0x9'));var squel=require(_0xd7ac('0xa'));var crypto=require('crypto');var jsforce=require(_0xd7ac('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd7ac('0x7'));var querystring=require(_0xd7ac('0xc'));var Papa=require(_0xd7ac('0xd'));var Redis=require(_0xd7ac('0xe'));var authService=require(_0xd7ac('0xf'));var qs=require(_0xd7ac('0x10'));var as=require(_0xd7ac('0x11'));var hardwareService=require(_0xd7ac('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd7ac('0x13'));var licenseUtil=require(_0xd7ac('0x14'));var db=require(_0xd7ac('0x15'))['db'];function respondWithStatusCode(_0x3aa602,_0x46e3bc){_0x46e3bc=_0x46e3bc||0xcc;return function(_0x2d500d){if(_0x2d500d){return _0x3aa602[_0xd7ac('0x16')](_0x46e3bc);}return _0x3aa602[_0xd7ac('0x17')](_0x46e3bc)[_0xd7ac('0x18')]();};}function respondWithResult(_0x219e74,_0x30b8ca){_0x30b8ca=_0x30b8ca||0xc8;return function(_0x458158){if(_0x458158){return _0x219e74[_0xd7ac('0x17')](_0x30b8ca)[_0xd7ac('0x19')](_0x458158);}};}function respondWithFilteredResult(_0x5daed0,_0xa45ff){return function(_0x7a0576){if(_0x7a0576){var _0x394255=typeof _0xa45ff['offset']===_0xd7ac('0x1a')&&typeof _0xa45ff[_0xd7ac('0x1b')]===_0xd7ac('0x1a');var _0x32187c=_0x7a0576[_0xd7ac('0x1c')];var _0x2f391f=_0x394255?0x0:_0xa45ff['offset'];var _0x2eeb50=_0x394255?_0x7a0576[_0xd7ac('0x1c')]:_0xa45ff[_0xd7ac('0x1d')]+_0xa45ff[_0xd7ac('0x1b')];var _0x46e8c4;if(_0x2eeb50>=_0x32187c){_0x2eeb50=_0x32187c;_0x46e8c4=0xc8;}else{_0x46e8c4=0xce;}_0x5daed0['status'](_0x46e8c4);return _0x5daed0[_0xd7ac('0x1e')](_0xd7ac('0x1f'),_0x2f391f+'-'+_0x2eeb50+'/'+_0x32187c)[_0xd7ac('0x19')](_0x7a0576);}return null;};}function patchUpdates(_0x5e9ddf){return function(_0x46553e){try{jsonpatch[_0xd7ac('0x20')](_0x46553e,_0x5e9ddf,!![]);}catch(_0x3589ee){return BPromise[_0xd7ac('0x21')](_0x3589ee);}return _0x46553e['save']();};}function saveUpdates(_0x4bdd16,_0x168e83){return function(_0x499136){if(_0x499136){return _0x499136['update'](_0x4bdd16)[_0xd7ac('0x22')](function(_0xb7246f){return _0xb7246f;});}return null;};}function removeEntity(_0x3ecffc,_0x3b9b30){return function(_0xea3bc1){if(_0xea3bc1){return _0xea3bc1['destroy']()[_0xd7ac('0x22')](function(){var _0x4e5d2c=_0xea3bc1[_0xd7ac('0x23')]({'plain':!![]});var _0x3e0daa='Companies';return db[_0xd7ac('0x24')][_0xd7ac('0x25')]({'where':{'type':_0x3e0daa,'resourceId':_0x4e5d2c['id']}})['then'](function(){return _0xea3bc1;});})[_0xd7ac('0x22')](function(){_0x3ecffc[_0xd7ac('0x17')](0xcc)[_0xd7ac('0x18')]();});}};}function handleEntityNotFound(_0x344bfb,_0x346edf){return function(_0x20569c){if(!_0x20569c){_0x344bfb[_0xd7ac('0x16')](0x194);}return _0x20569c;};}function handleError(_0x1a2ff1,_0x425d92){_0x425d92=_0x425d92||0x1f4;return function(_0x123a96){logger[_0xd7ac('0x26')](_0x123a96[_0xd7ac('0x27')]);if(_0x123a96['name']){delete _0x123a96[_0xd7ac('0x28')];}_0x1a2ff1['status'](_0x425d92)[_0xd7ac('0x29')](_0x123a96);};}exports[_0xd7ac('0x2a')]=function(_0x44d844,_0xc1e2ba){var _0x37298e={},_0x1320f3={},_0x543daf={'count':0x0,'rows':[]};return db['CmCompany'][_0xd7ac('0x2b')]()[_0xd7ac('0x22')](function(_0x3cf363){_0x1320f3[_0xd7ac('0x2c')]=_[_0xd7ac('0x2d')](_0x3cf363);_0x1320f3[_0xd7ac('0x2e')]=_[_0xd7ac('0x2d')](_0x44d844[_0xd7ac('0x2e')]);_0x1320f3[_0xd7ac('0x2f')]=_[_0xd7ac('0x30')](_0x1320f3[_0xd7ac('0x2c')],_0x1320f3[_0xd7ac('0x2e')]);_0x37298e['attributes']=_['intersection'](_0x1320f3['model'],qs['fields'](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x31')]));_0x37298e[_0xd7ac('0x32')]=_0x37298e[_0xd7ac('0x32')][_0xd7ac('0x33')]?_0x37298e[_0xd7ac('0x32')]:_0x1320f3[_0xd7ac('0x2c')];if(!_0x44d844['query'][_0xd7ac('0x34')]('nolimit')){_0x37298e[_0xd7ac('0x1b')]=qs[_0xd7ac('0x1b')](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x1b')]);_0x37298e['offset']=qs['offset'](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x1d')]);}_0x37298e['order']=qs[_0xd7ac('0x35')](_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x35')]);_0x37298e[_0xd7ac('0x36')]=qs[_0xd7ac('0x2f')](_[_0xd7ac('0x37')](_0x44d844[_0xd7ac('0x2e')],_0x1320f3['filters']),_0x3cf363);if(_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x38')]){_0x37298e[_0xd7ac('0x36')]=_[_0xd7ac('0x39')](_0x37298e[_0xd7ac('0x36')],{'$or':_[_0xd7ac('0x3a')](_0x37298e['attributes'],function(_0x1c03e5){var _0x4c4d0c={};_0x4c4d0c[_0x1c03e5]={'$like':'%'+_0x44d844['query'][_0xd7ac('0x38')]+'%'};return _0x4c4d0c;})});}_0x37298e=_[_0xd7ac('0x39')]({},_0x37298e,_0x44d844[_0xd7ac('0x3b')]);var _0x2f66cc={'where':_0x37298e[_0xd7ac('0x36')]};return db[_0xd7ac('0x3c')][_0xd7ac('0x1c')](_0x2f66cc)[_0xd7ac('0x22')](function(_0x19b703){_0x543daf[_0xd7ac('0x1c')]=_0x19b703;if(_0x44d844[_0xd7ac('0x2e')][_0xd7ac('0x3d')]){_0x37298e['include']=[{'all':!![]}];}return db[_0xd7ac('0x3c')]['findAll'](_0x37298e);})[_0xd7ac('0x22')](function(_0xb1d2b2){_0x543daf['rows']=_0xb1d2b2;return _0x543daf;})['then'](respondWithFilteredResult(_0xc1e2ba,_0x37298e))['catch'](handleError(_0xc1e2ba,null));})[_0xd7ac('0x3e')](handleError(_0xc1e2ba,null));};exports[_0xd7ac('0x3f')]=function(_0x336236,_0x415a9e){var _0x5886c8={'raw':![],'where':{'id':_0x336236[_0xd7ac('0x40')]['id']}},_0x37e861={};_0x37e861['model']=_['keys'](db[_0xd7ac('0x3c')]['rawAttributes']);_0x37e861[_0xd7ac('0x2e')]=_['keys'](_0x336236[_0xd7ac('0x2e')]);_0x37e861['filters']=_[_0xd7ac('0x30')](_0x37e861['model'],_0x37e861[_0xd7ac('0x2e')]);_0x5886c8[_0xd7ac('0x32')]=_[_0xd7ac('0x30')](_0x37e861['model'],qs['fields'](_0x336236[_0xd7ac('0x2e')][_0xd7ac('0x31')]));_0x5886c8[_0xd7ac('0x32')]=_0x5886c8[_0xd7ac('0x32')]['length']?_0x5886c8[_0xd7ac('0x32')]:_0x37e861[_0xd7ac('0x2c')];if(_0x336236[_0xd7ac('0x2e')][_0xd7ac('0x3d')]){_0x5886c8['include']=[{'all':!![]}];}_0x5886c8=_[_0xd7ac('0x39')]({},_0x5886c8,_0x336236['options']);return db['CmCompany']['find'](_0x5886c8)[_0xd7ac('0x22')](handleEntityNotFound(_0x415a9e,null))['then'](respondWithResult(_0x415a9e,null))[_0xd7ac('0x3e')](handleError(_0x415a9e,null));};exports[_0xd7ac('0x41')]=function(_0x2eebbc,_0x4f04ea){return db[_0xd7ac('0x3c')][_0xd7ac('0x41')](_0x2eebbc[_0xd7ac('0x42')],{})['then'](function(_0x2173b3){var _0x4f8de0=_0x2eebbc[_0xd7ac('0x43')]['get']({'plain':!![]});if(!_0x4f8de0)throw new Error(_0xd7ac('0x44'));if(_0x4f8de0[_0xd7ac('0x45')]===_0xd7ac('0x43')){var _0x35f3e2=_0x2173b3[_0xd7ac('0x23')]({'plain':!![]});var _0x16865e='Companies';return db[_0xd7ac('0x46')][_0xd7ac('0x47')]({'where':{'name':_0x16865e,'userProfileId':_0x4f8de0[_0xd7ac('0x48')]},'raw':!![]})['then'](function(_0x50f7d7){if(_0x50f7d7&&_0x50f7d7['autoAssociation']===0x0){return db[_0xd7ac('0x24')][_0xd7ac('0x41')]({'name':_0x35f3e2['name'],'resourceId':_0x35f3e2['id'],'type':_0x50f7d7[_0xd7ac('0x28')],'sectionId':_0x50f7d7['id']},{})[_0xd7ac('0x22')](function(){return _0x2173b3;});}else{return _0x2173b3;}})['catch'](function(_0x4049e7){logger[_0xd7ac('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4049e7);throw _0x4049e7;});}return _0x2173b3;})['then'](respondWithResult(_0x4f04ea,0xc9))['catch'](handleError(_0x4f04ea,null));};exports['update']=function(_0x29a5d0,_0xa0bd50){if(_0x29a5d0[_0xd7ac('0x42')]['id']){delete _0x29a5d0[_0xd7ac('0x42')]['id'];}return db[_0xd7ac('0x3c')][_0xd7ac('0x47')]({'where':{'id':_0x29a5d0[_0xd7ac('0x40')]['id']}})[_0xd7ac('0x22')](handleEntityNotFound(_0xa0bd50,null))[_0xd7ac('0x22')](saveUpdates(_0x29a5d0[_0xd7ac('0x42')],null))[_0xd7ac('0x22')](respondWithResult(_0xa0bd50,null))[_0xd7ac('0x3e')](handleError(_0xa0bd50,null));};exports[_0xd7ac('0x25')]=function(_0x373c5f,_0x4a1516){return db[_0xd7ac('0x3c')][_0xd7ac('0x47')]({'where':{'id':_0x373c5f[_0xd7ac('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a1516,null))[_0xd7ac('0x22')](removeEntity(_0x4a1516,null))[_0xd7ac('0x3e')](handleError(_0x4a1516,null));};exports[_0xd7ac('0x2b')]=function(_0xf033b,_0x29e477){return db[_0xd7ac('0x3c')][_0xd7ac('0x2b')]()[_0xd7ac('0x22')](respondWithResult(_0x29e477,null))[_0xd7ac('0x3e')](handleError(_0x29e477,null));};exports[_0xd7ac('0x49')]=function(_0x4ec11c,_0x478c28,_0x5c7461){return db[_0xd7ac('0x4a')][_0xd7ac('0x47')]({'where':{'id':_0x4ec11c[_0xd7ac('0x40')]['id']}})[_0xd7ac('0x22')](handleEntityNotFound(_0x478c28,null))[_0xd7ac('0x22')](function(_0x3f664a){if(_0x3f664a){return _0x3f664a['addContacts'](_0x4ec11c[_0xd7ac('0x42')][_0xd7ac('0x4b')],_['omit'](_0x4ec11c[_0xd7ac('0x42')],['ids','id'])||{});}})['then'](respondWithResult(_0x478c28,null))[_0xd7ac('0x3e')](handleError(_0x478c28,null));};exports[_0xd7ac('0x4c')]=function(_0x3f5eea,_0x2ceabc,_0x381c8d){var _0x24027e={};var _0x8d177c={};var _0x65bb36;var _0x338abd;return db[_0xd7ac('0x3c')]['findOne']({'where':{'id':_0x3f5eea[_0xd7ac('0x40')]['id']}})[_0xd7ac('0x22')](handleEntityNotFound(_0x2ceabc,null))[_0xd7ac('0x22')](function(_0x57e821){if(_0x57e821){_0x65bb36=_0x57e821;_0x8d177c[_0xd7ac('0x2c')]=_[_0xd7ac('0x2d')](db[_0xd7ac('0x4a')]['rawAttributes']);_0x8d177c[_0xd7ac('0x2e')]=_[_0xd7ac('0x2d')](_0x3f5eea[_0xd7ac('0x2e')]);_0x8d177c[_0xd7ac('0x2f')]=_[_0xd7ac('0x30')](_0x8d177c[_0xd7ac('0x2c')],_0x8d177c[_0xd7ac('0x2e')]);_0x24027e[_0xd7ac('0x32')]=_['intersection'](_0x8d177c[_0xd7ac('0x2c')],qs[_0xd7ac('0x31')](_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x31')]));_0x24027e[_0xd7ac('0x32')]=_0x24027e[_0xd7ac('0x32')][_0xd7ac('0x33')]?_0x24027e[_0xd7ac('0x32')]:_0x8d177c['model'];_0x24027e[_0xd7ac('0x4d')]=qs[_0xd7ac('0x35')](_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x35')]);_0x24027e[_0xd7ac('0x36')]=qs[_0xd7ac('0x2f')](_[_0xd7ac('0x37')](_0x3f5eea[_0xd7ac('0x2e')],_0x8d177c[_0xd7ac('0x2f')]));if(_0x3f5eea[_0xd7ac('0x2e')]['filter']){_0x24027e[_0xd7ac('0x36')]=_[_0xd7ac('0x39')](_0x24027e[_0xd7ac('0x36')],{'$or':_[_0xd7ac('0x3a')](_0x24027e['attributes'],function(_0x43d6ad){var _0x5ac8f1={};_0x5ac8f1[_0x43d6ad]={'$like':'%'+_0x3f5eea['query']['filter']+'%'};return _0x5ac8f1;})});}_0x24027e=_['merge']({},_0x24027e,_0x3f5eea['options']);return _0x65bb36[_0xd7ac('0x4c')](_0x24027e);}})[_0xd7ac('0x22')](function(_0x41ac57){if(_0x41ac57){_0x338abd=_0x41ac57[_0xd7ac('0x33')];if(!_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x34')](_0xd7ac('0x4e'))){_0x24027e[_0xd7ac('0x1b')]=qs[_0xd7ac('0x1b')](_0x3f5eea['query'][_0xd7ac('0x1b')]);_0x24027e[_0xd7ac('0x1d')]=qs[_0xd7ac('0x1d')](_0x3f5eea[_0xd7ac('0x2e')][_0xd7ac('0x1d')]);}return _0x65bb36[_0xd7ac('0x4c')](_0x24027e);}})[_0xd7ac('0x22')](function(_0x1302ac){if(_0x1302ac){return _0x1302ac?{'count':_0x338abd,'rows':_0x1302ac}:null;}})[_0xd7ac('0x22')](respondWithResult(_0x2ceabc,null))['catch'](handleError(_0x2ceabc,null));};
\ No newline at end of file
+var _0x9191=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','update','then','destroy','get','Companies','end','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','include','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','rawAttributes','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x103fc0,_0x3cc10d){var _0x26cd8b=function(_0x3e459d){while(--_0x3e459d){_0x103fc0['push'](_0x103fc0['shift']());}};_0x26cd8b(++_0x3cc10d);}(_0x9191,0x1a9));var _0x1919=function(_0x2f4d41,_0x525047){_0x2f4d41=_0x2f4d41-0x0;var _0x3b0bb2=_0x9191[_0x2f4d41];return _0x3b0bb2;};'use strict';var emlformat=require(_0x1919('0x0'));var rimraf=require(_0x1919('0x1'));var zipdir=require(_0x1919('0x2'));var jsonpatch=require(_0x1919('0x3'));var rp=require(_0x1919('0x4'));var moment=require(_0x1919('0x5'));var BPromise=require(_0x1919('0x6'));var Mustache=require(_0x1919('0x7'));var util=require(_0x1919('0x8'));var path=require(_0x1919('0x9'));var sox=require(_0x1919('0xa'));var csv=require('to-csv');var ejs=require(_0x1919('0xb'));var fs=require('fs');var fs_extra=require(_0x1919('0xc'));var _=require('lodash');var squel=require(_0x1919('0xd'));var crypto=require(_0x1919('0xe'));var jsforce=require(_0x1919('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1919('0x10'));var querystring=require(_0x1919('0x11'));var Papa=require('papaparse');var Redis=require(_0x1919('0x12'));var authService=require(_0x1919('0x13'));var qs=require(_0x1919('0x14'));var as=require(_0x1919('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1919('0x16'))(_0x1919('0x17'));var utils=require(_0x1919('0x18'));var config=require(_0x1919('0x19'));var licenseUtil=require(_0x1919('0x1a'));var db=require(_0x1919('0x1b'))['db'];function respondWithStatusCode(_0x33b642,_0x1bd325){_0x1bd325=_0x1bd325||0xcc;return function(_0x48764b){if(_0x48764b){return _0x33b642[_0x1919('0x1c')](_0x1bd325);}return _0x33b642[_0x1919('0x1d')](_0x1bd325)['end']();};}function respondWithResult(_0x448001,_0x338ea7){_0x338ea7=_0x338ea7||0xc8;return function(_0x3d327b){if(_0x3d327b){return _0x448001[_0x1919('0x1d')](_0x338ea7)[_0x1919('0x1e')](_0x3d327b);}};}function respondWithFilteredResult(_0x9d07a7,_0x435d34){return function(_0x27469c){if(_0x27469c){var _0x3f977a=typeof _0x435d34['offset']===_0x1919('0x1f')&&typeof _0x435d34[_0x1919('0x20')]===_0x1919('0x1f');var _0x20e82d=_0x27469c['count'];var _0x3d0fcc=_0x3f977a?0x0:_0x435d34[_0x1919('0x21')];var _0x462db3=_0x3f977a?_0x27469c[_0x1919('0x22')]:_0x435d34['offset']+_0x435d34[_0x1919('0x20')];var _0x46dc8e;if(_0x462db3>=_0x20e82d){_0x462db3=_0x20e82d;_0x46dc8e=0xc8;}else{_0x46dc8e=0xce;}_0x9d07a7['status'](_0x46dc8e);return _0x9d07a7[_0x1919('0x23')]('Content-Range',_0x3d0fcc+'-'+_0x462db3+'/'+_0x20e82d)[_0x1919('0x1e')](_0x27469c);}return null;};}function patchUpdates(_0x3ad6e4){return function(_0xec922c){try{jsonpatch[_0x1919('0x24')](_0xec922c,_0x3ad6e4,!![]);}catch(_0x4b9d74){return BPromise[_0x1919('0x25')](_0x4b9d74);}return _0xec922c['save']();};}function saveUpdates(_0x1d48a4,_0x3fd649){return function(_0x41ebce){if(_0x41ebce){return _0x41ebce[_0x1919('0x26')](_0x1d48a4)[_0x1919('0x27')](function(_0x3288ed){return _0x3288ed;});}return null;};}function removeEntity(_0x239b9f,_0x29475b){return function(_0x56b637){if(_0x56b637){return _0x56b637[_0x1919('0x28')]()[_0x1919('0x27')](function(){var _0x4cfefe=_0x56b637[_0x1919('0x29')]({'plain':!![]});var _0x306312=_0x1919('0x2a');return db['UserProfileResource'][_0x1919('0x28')]({'where':{'type':_0x306312,'resourceId':_0x4cfefe['id']}})[_0x1919('0x27')](function(){return _0x56b637;});})[_0x1919('0x27')](function(){_0x239b9f['status'](0xcc)[_0x1919('0x2b')]();});}};}function handleEntityNotFound(_0x540ced,_0x9c5844){return function(_0x43acad){if(!_0x43acad){_0x540ced[_0x1919('0x1c')](0x194);}return _0x43acad;};}function handleError(_0x20503b,_0xa0da37){_0xa0da37=_0xa0da37||0x1f4;return function(_0xe5ef32){logger[_0x1919('0x2c')](_0xe5ef32[_0x1919('0x2d')]);if(_0xe5ef32[_0x1919('0x2e')]){delete _0xe5ef32[_0x1919('0x2e')];}_0x20503b['status'](_0xa0da37)[_0x1919('0x2f')](_0xe5ef32);};}exports[_0x1919('0x30')]=function(_0x14f18c,_0x474593){var _0xc52e00={},_0x790cab={},_0x2c1a1a={'count':0x0,'rows':[]};return db[_0x1919('0x31')][_0x1919('0x32')]()[_0x1919('0x27')](function(_0x18c98d){_0x790cab['model']=_[_0x1919('0x33')](_0x18c98d);_0x790cab['query']=_[_0x1919('0x33')](_0x14f18c[_0x1919('0x34')]);_0x790cab[_0x1919('0x35')]=_[_0x1919('0x36')](_0x790cab[_0x1919('0x37')],_0x790cab[_0x1919('0x34')]);_0xc52e00[_0x1919('0x38')]=_['intersection'](_0x790cab[_0x1919('0x37')],qs[_0x1919('0x39')](_0x14f18c[_0x1919('0x34')][_0x1919('0x39')]));_0xc52e00[_0x1919('0x38')]=_0xc52e00[_0x1919('0x38')][_0x1919('0x3a')]?_0xc52e00[_0x1919('0x38')]:_0x790cab[_0x1919('0x37')];if(!_0x14f18c[_0x1919('0x34')][_0x1919('0x3b')]('nolimit')){_0xc52e00[_0x1919('0x20')]=qs[_0x1919('0x20')](_0x14f18c[_0x1919('0x34')][_0x1919('0x20')]);_0xc52e00['offset']=qs['offset'](_0x14f18c[_0x1919('0x34')]['offset']);}_0xc52e00[_0x1919('0x3c')]=qs[_0x1919('0x3d')](_0x14f18c[_0x1919('0x34')]['sort']);_0xc52e00[_0x1919('0x3e')]=qs['filters'](_[_0x1919('0x3f')](_0x14f18c[_0x1919('0x34')],_0x790cab[_0x1919('0x35')]),_0x18c98d);if(_0x14f18c[_0x1919('0x34')][_0x1919('0x40')]){_0xc52e00[_0x1919('0x3e')]=_[_0x1919('0x41')](_0xc52e00['where'],{'$or':_[_0x1919('0x42')](_0xc52e00[_0x1919('0x38')],function(_0x3ff396){var _0x1f8893={};_0x1f8893[_0x3ff396]={'$like':'%'+_0x14f18c['query'][_0x1919('0x40')]+'%'};return _0x1f8893;})});}_0xc52e00=_['merge']({},_0xc52e00,_0x14f18c['options']);var _0x1559e8={'where':_0xc52e00[_0x1919('0x3e')]};return db[_0x1919('0x31')][_0x1919('0x22')](_0x1559e8)[_0x1919('0x27')](function(_0x365a4f){_0x2c1a1a[_0x1919('0x22')]=_0x365a4f;if(_0x14f18c[_0x1919('0x34')]['includeAll']){_0xc52e00[_0x1919('0x43')]=[{'all':!![]}];}return db[_0x1919('0x31')]['findAll'](_0xc52e00);})['then'](function(_0x571308){_0x2c1a1a[_0x1919('0x44')]=_0x571308;return _0x2c1a1a;})['then'](respondWithFilteredResult(_0x474593,_0xc52e00))[_0x1919('0x45')](handleError(_0x474593,null));})[_0x1919('0x45')](handleError(_0x474593,null));};exports[_0x1919('0x46')]=function(_0x285d2a,_0x50fcfd){var _0x42b0cf={'raw':![],'where':{'id':_0x285d2a[_0x1919('0x47')]['id']}},_0x21c7a6={};_0x21c7a6[_0x1919('0x37')]=_[_0x1919('0x33')](db[_0x1919('0x31')]['rawAttributes']);_0x21c7a6[_0x1919('0x34')]=_[_0x1919('0x33')](_0x285d2a[_0x1919('0x34')]);_0x21c7a6[_0x1919('0x35')]=_[_0x1919('0x36')](_0x21c7a6[_0x1919('0x37')],_0x21c7a6[_0x1919('0x34')]);_0x42b0cf[_0x1919('0x38')]=_['intersection'](_0x21c7a6['model'],qs['fields'](_0x285d2a[_0x1919('0x34')]['fields']));_0x42b0cf[_0x1919('0x38')]=_0x42b0cf[_0x1919('0x38')][_0x1919('0x3a')]?_0x42b0cf['attributes']:_0x21c7a6['model'];if(_0x285d2a[_0x1919('0x34')][_0x1919('0x48')]){_0x42b0cf[_0x1919('0x43')]=[{'all':!![]}];}_0x42b0cf=_[_0x1919('0x41')]({},_0x42b0cf,_0x285d2a[_0x1919('0x49')]);return db[_0x1919('0x31')]['find'](_0x42b0cf)[_0x1919('0x27')](handleEntityNotFound(_0x50fcfd,null))[_0x1919('0x27')](respondWithResult(_0x50fcfd,null))[_0x1919('0x45')](handleError(_0x50fcfd,null));};exports[_0x1919('0x4a')]=function(_0x5d86e9,_0x299645){return db[_0x1919('0x31')][_0x1919('0x4a')](_0x5d86e9[_0x1919('0x4b')],{})[_0x1919('0x27')](function(_0x2d731f){var _0xafdd48=_0x5d86e9[_0x1919('0x4c')][_0x1919('0x29')]({'plain':!![]});if(!_0xafdd48)throw new Error(_0x1919('0x4d'));if(_0xafdd48['role']==='user'){var _0x3876c5=_0x2d731f[_0x1919('0x29')]({'plain':!![]});var _0x2bf6da=_0x1919('0x2a');return db['UserProfileSection'][_0x1919('0x4e')]({'where':{'name':_0x2bf6da,'userProfileId':_0xafdd48[_0x1919('0x4f')]},'raw':!![]})[_0x1919('0x27')](function(_0x5a6b25){if(_0x5a6b25&&_0x5a6b25[_0x1919('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x3876c5[_0x1919('0x2e')],'resourceId':_0x3876c5['id'],'type':_0x5a6b25[_0x1919('0x2e')],'sectionId':_0x5a6b25['id']},{})[_0x1919('0x27')](function(){return _0x2d731f;});}else{return _0x2d731f;}})['catch'](function(_0x2a8b5a){logger[_0x1919('0x2c')](_0x1919('0x51'),_0x2a8b5a);throw _0x2a8b5a;});}return _0x2d731f;})[_0x1919('0x27')](respondWithResult(_0x299645,0xc9))[_0x1919('0x45')](handleError(_0x299645,null));};exports['update']=function(_0x2dad70,_0x2dc84e){if(_0x2dad70[_0x1919('0x4b')]['id']){delete _0x2dad70[_0x1919('0x4b')]['id'];}return db[_0x1919('0x31')][_0x1919('0x4e')]({'where':{'id':_0x2dad70['params']['id']}})[_0x1919('0x27')](handleEntityNotFound(_0x2dc84e,null))[_0x1919('0x27')](saveUpdates(_0x2dad70[_0x1919('0x4b')],null))[_0x1919('0x27')](respondWithResult(_0x2dc84e,null))[_0x1919('0x45')](handleError(_0x2dc84e,null));};exports[_0x1919('0x28')]=function(_0x513797,_0x191c79){return db[_0x1919('0x31')][_0x1919('0x4e')]({'where':{'id':_0x513797['params']['id']}})[_0x1919('0x27')](handleEntityNotFound(_0x191c79,null))[_0x1919('0x27')](removeEntity(_0x191c79,null))['catch'](handleError(_0x191c79,null));};exports[_0x1919('0x32')]=function(_0x16990f,_0x2c25c8){return db[_0x1919('0x31')]['describe']()[_0x1919('0x27')](respondWithResult(_0x2c25c8,null))[_0x1919('0x45')](handleError(_0x2c25c8,null));};exports[_0x1919('0x52')]=function(_0x20315a,_0x5a6e8e,_0x54360e){return db[_0x1919('0x53')][_0x1919('0x4e')]({'where':{'id':_0x20315a[_0x1919('0x47')]['id']}})[_0x1919('0x27')](handleEntityNotFound(_0x5a6e8e,null))[_0x1919('0x27')](function(_0x241687){if(_0x241687){return _0x241687['addContacts'](_0x20315a[_0x1919('0x4b')][_0x1919('0x54')],_[_0x1919('0x55')](_0x20315a[_0x1919('0x4b')],[_0x1919('0x54'),'id'])||{});}})[_0x1919('0x27')](respondWithResult(_0x5a6e8e,null))[_0x1919('0x45')](handleError(_0x5a6e8e,null));};exports['getContacts']=function(_0x33a7bd,_0x18fe3d,_0x267b05){var _0x10de18={};var _0x4f43d3={};var _0x2fc53f;var _0x2ef71a;return db[_0x1919('0x31')][_0x1919('0x56')]({'where':{'id':_0x33a7bd['params']['id']}})[_0x1919('0x27')](handleEntityNotFound(_0x18fe3d,null))[_0x1919('0x27')](function(_0x572078){if(_0x572078){_0x2fc53f=_0x572078;_0x4f43d3[_0x1919('0x37')]=_['keys'](db['CmContact'][_0x1919('0x57')]);_0x4f43d3[_0x1919('0x34')]=_[_0x1919('0x33')](_0x33a7bd[_0x1919('0x34')]);_0x4f43d3[_0x1919('0x35')]=_[_0x1919('0x36')](_0x4f43d3['model'],_0x4f43d3['query']);_0x10de18[_0x1919('0x38')]=_[_0x1919('0x36')](_0x4f43d3[_0x1919('0x37')],qs['fields'](_0x33a7bd[_0x1919('0x34')]['fields']));_0x10de18['attributes']=_0x10de18[_0x1919('0x38')][_0x1919('0x3a')]?_0x10de18[_0x1919('0x38')]:_0x4f43d3[_0x1919('0x37')];_0x10de18[_0x1919('0x3c')]=qs['sort'](_0x33a7bd[_0x1919('0x34')][_0x1919('0x3d')]);_0x10de18[_0x1919('0x3e')]=qs[_0x1919('0x35')](_[_0x1919('0x3f')](_0x33a7bd[_0x1919('0x34')],_0x4f43d3[_0x1919('0x35')]));if(_0x33a7bd[_0x1919('0x34')][_0x1919('0x40')]){_0x10de18[_0x1919('0x3e')]=_[_0x1919('0x41')](_0x10de18['where'],{'$or':_['map'](_0x10de18['attributes'],function(_0x36c7c4){var _0x315f3a={};_0x315f3a[_0x36c7c4]={'$like':'%'+_0x33a7bd[_0x1919('0x34')][_0x1919('0x40')]+'%'};return _0x315f3a;})});}_0x10de18=_['merge']({},_0x10de18,_0x33a7bd['options']);return _0x2fc53f[_0x1919('0x58')](_0x10de18);}})['then'](function(_0x21a2fb){if(_0x21a2fb){_0x2ef71a=_0x21a2fb[_0x1919('0x3a')];if(!_0x33a7bd['query'][_0x1919('0x3b')]('nolimit')){_0x10de18[_0x1919('0x20')]=qs[_0x1919('0x20')](_0x33a7bd[_0x1919('0x34')][_0x1919('0x20')]);_0x10de18[_0x1919('0x21')]=qs['offset'](_0x33a7bd['query'][_0x1919('0x21')]);}return _0x2fc53f[_0x1919('0x58')](_0x10de18);}})[_0x1919('0x27')](function(_0xf3e1f0){if(_0xf3e1f0){return _0xf3e1f0?{'count':_0x2ef71a,'rows':_0xf3e1f0}:null;}})[_0x1919('0x27')](respondWithResult(_0x18fe3d,null))[_0x1919('0x45')](handleError(_0x18fe3d,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf76f=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x182b57,_0x599ae8){var _0x2fe443=function(_0x3d6614){while(--_0x3d6614){_0x182b57['push'](_0x182b57['shift']());}};_0x2fe443(++_0x599ae8);}(_0xf76f,0x127));var _0xff76=function(_0xc8069a,_0x2968fc){_0xc8069a=_0xc8069a-0x0;var _0x16bc69=_0xf76f[_0xc8069a];return _0x16bc69;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xff76('0x0'))('api');var moment=require('moment');var BPromise=require(_0xff76('0x1'));var rp=require(_0xff76('0x2'));var fs=require('fs');var path=require(_0xff76('0x3'));var rimraf=require(_0xff76('0x4'));var config=require(_0xff76('0x5'));var attributes=require(_0xff76('0x6'));module[_0xff76('0x7')]=function(_0x38880c,_0x40c86a){return _0x38880c['define'](_0xff76('0x8'),attributes,{'tableName':_0xff76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f3b=['../../config/environment','exports','define','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x5f3b,0x7c));var _0xb5f3=function(_0x4aa39,_0x3fdd7c){_0x4aa39=_0x4aa39-0x0;var _0x38ac72=_0x5f3b[_0x4aa39];return _0x38ac72;};'use strict';var _=require(_0xb5f3('0x0'));var util=require(_0xb5f3('0x1'));var logger=require(_0xb5f3('0x2'))(_0xb5f3('0x3'));var moment=require('moment');var BPromise=require(_0xb5f3('0x4'));var rp=require(_0xb5f3('0x5'));var fs=require('fs');var path=require(_0xb5f3('0x6'));var rimraf=require(_0xb5f3('0x7'));var config=require(_0xb5f3('0x8'));var attributes=require('./cmCompany.attributes');module[_0xb5f3('0x9')]=function(_0x1e42c9,_0x1bab34){return _0x1e42c9[_0xb5f3('0xa')]('CmCompany',attributes,{'tableName':_0xb5f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45f4=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x23f8af,_0x53bf47){var _0x18af50=function(_0x174697){while(--_0x174697){_0x23f8af['push'](_0x23f8af['shift']());}};_0x18af50(++_0x53bf47);}(_0x45f4,0x7a));var _0x445f=function(_0x3c202d,_0x5171ff){_0x3c202d=_0x3c202d-0x0;var _0x99199=_0x45f4[_0x3c202d];return _0x99199;};'use strict';var _=require(_0x445f('0x0'));var util=require(_0x445f('0x1'));var moment=require(_0x445f('0x2'));var BPromise=require(_0x445f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x445f('0x4'));var db=require(_0x445f('0x5'))['db'];var utils=require(_0x445f('0x6'));var logger=require('../../config/logger')(_0x445f('0x7'));var config=require(_0x445f('0x8'));var jayson=require(_0x445f('0x9'));var client=jayson['client'][_0x445f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328307,_0x14f32b,_0x15f107){return new BPromise(function(_0x58af8a,_0x3b974a){return client[_0x445f('0xb')](_0x328307,_0x15f107)[_0x445f('0xc')](function(_0x1cac8a){logger[_0x445f('0xd')](_0x445f('0xe'),_0x14f32b,_0x445f('0xf'));logger[_0x445f('0x10')](_0x445f('0x11'),_0x14f32b,'request\x20sent',JSON[_0x445f('0x12')](_0x1cac8a));if(_0x1cac8a[_0x445f('0x13')]){if(_0x1cac8a[_0x445f('0x13')][_0x445f('0x14')]===0x1f4){logger[_0x445f('0x13')](_0x445f('0xe'),_0x14f32b,_0x1cac8a[_0x445f('0x13')]['message']);return _0x3b974a(_0x1cac8a['error'][_0x445f('0x15')]);}logger[_0x445f('0x13')](_0x445f('0xe'),_0x14f32b,_0x1cac8a[_0x445f('0x13')]['message']);return _0x58af8a(_0x1cac8a[_0x445f('0x13')][_0x445f('0x15')]);}else{logger[_0x445f('0xd')](_0x445f('0xe'),_0x14f32b,_0x445f('0xf'));_0x58af8a(_0x1cac8a[_0x445f('0x16')][_0x445f('0x15')]);}})[_0x445f('0x17')](function(_0x1b09a9){logger[_0x445f('0x13')](_0x445f('0xe'),_0x14f32b,_0x1b09a9);_0x3b974a(_0x1b09a9);});});}
\ No newline at end of file
+var _0x8f51=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8f51,0x104));var _0x18f5=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x8f51[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var util=require(_0x18f5('0x0'));var moment=require('moment');var BPromise=require(_0x18f5('0x1'));var rs=require(_0x18f5('0x2'));var fs=require('fs');var Redis=require(_0x18f5('0x3'));var db=require(_0x18f5('0x4'))['db'];var utils=require(_0x18f5('0x5'));var logger=require(_0x18f5('0x6'))('rpc');var config=require(_0x18f5('0x7'));var jayson=require(_0x18f5('0x8'));var client=jayson[_0x18f5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38383d,_0x55b981,_0x394a91){return new BPromise(function(_0x2cbfad,_0x348e6b){return client['request'](_0x38383d,_0x394a91)[_0x18f5('0xa')](function(_0x35d806){logger[_0x18f5('0xb')](_0x18f5('0xc'),_0x55b981,_0x18f5('0xd'));logger[_0x18f5('0xe')](_0x18f5('0xf'),_0x55b981,'request\x20sent',JSON[_0x18f5('0x10')](_0x35d806));if(_0x35d806[_0x18f5('0x11')]){if(_0x35d806['error']['code']===0x1f4){logger[_0x18f5('0x11')](_0x18f5('0xc'),_0x55b981,_0x35d806[_0x18f5('0x11')][_0x18f5('0x12')]);return _0x348e6b(_0x35d806[_0x18f5('0x11')][_0x18f5('0x12')]);}logger[_0x18f5('0x11')](_0x18f5('0xc'),_0x55b981,_0x35d806[_0x18f5('0x11')][_0x18f5('0x12')]);return _0x2cbfad(_0x35d806[_0x18f5('0x11')][_0x18f5('0x12')]);}else{logger[_0x18f5('0xb')](_0x18f5('0xc'),_0x55b981,_0x18f5('0xd'));_0x2cbfad(_0x35d806['result']['message']);}})[_0x18f5('0x13')](function(_0x34e2ec){logger['error']('CmCompany,\x20%s,\x20%s',_0x55b981,_0x34e2ec);_0x348e6b(_0x34e2ec);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf6c9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x440dab,_0xd7b5fc){var _0x318c2f=function(_0x5518b8){while(--_0x5518b8){_0x440dab['push'](_0x440dab['shift']());}};_0x318c2f(++_0xd7b5fc);}(_0xf6c9,0x10d));var _0x9f6c=function(_0x4f0f7b,_0x290974){_0x4f0f7b=_0x4f0f7b-0x0;var _0x2d155e=_0xf6c9[_0x4f0f7b];return _0x2d155e;};'use strict';var multer=require(_0x9f6c('0x0'));var util=require(_0x9f6c('0x1'));var path=require(_0x9f6c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f6c('0x3'));var router=express[_0x9f6c('0x4')]();var fs_extra=require(_0x9f6c('0x5'));var auth=require(_0x9f6c('0x6'));var interaction=require(_0x9f6c('0x7'));var config=require(_0x9f6c('0x8'));var controller=require(_0x9f6c('0x9'));router[_0x9f6c('0xa')]('/',auth[_0x9f6c('0xb')](),controller[_0x9f6c('0xc')]);router[_0x9f6c('0xa')]('/describe',auth[_0x9f6c('0xb')](),controller[_0x9f6c('0xd')]);router[_0x9f6c('0xa')](_0x9f6c('0xe'),auth[_0x9f6c('0xb')](),controller[_0x9f6c('0xf')]);router[_0x9f6c('0xa')](_0x9f6c('0x10'),auth['isAuthenticated'](),controller[_0x9f6c('0x11')]);router[_0x9f6c('0x12')]('/',auth[_0x9f6c('0xb')](),controller[_0x9f6c('0x13')]);router[_0x9f6c('0x12')](_0x9f6c('0x10'),auth[_0x9f6c('0xb')](),controller[_0x9f6c('0x14')]);router[_0x9f6c('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9f6c('0x16')]);router[_0x9f6c('0x17')](_0x9f6c('0xe'),auth[_0x9f6c('0xb')](),controller[_0x9f6c('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x4213=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts'];(function(_0x3b5640,_0x56ba9b){var _0x196661=function(_0xd5772b){while(--_0xd5772b){_0x3b5640['push'](_0x3b5640['shift']());}};_0x196661(++_0x56ba9b);}(_0x4213,0x174));var _0x3421=function(_0x27e22e,_0x5b157d){_0x27e22e=_0x27e22e-0x0;var _0x262198=_0x4213[_0x27e22e];return _0x262198;};'use strict';var multer=require(_0x3421('0x0'));var util=require('util');var path=require(_0x3421('0x1'));var timeout=require(_0x3421('0x2'));var express=require(_0x3421('0x3'));var router=express[_0x3421('0x4')]();var fs_extra=require(_0x3421('0x5'));var auth=require(_0x3421('0x6'));var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller['index']);router[_0x3421('0x8')](_0x3421('0xa'),auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0xd')]);router['get'](_0x3421('0xe'),auth[_0x3421('0x9')](),controller[_0x3421('0xf')]);router[_0x3421('0x10')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0x11')]);router[_0x3421('0x10')](_0x3421('0xe'),auth[_0x3421('0x9')](),controller[_0x3421('0x12')]);router[_0x3421('0x13')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x14')]);router[_0x3421('0x15')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x16')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6687=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6687,0xac));var _0x7668=function(_0x21bb6a,_0x57fb37){_0x21bb6a=_0x21bb6a-0x0;var _0x21d589=_0x6687[_0x21bb6a];return _0x21d589;};'use strict';var _=require(_0x7668('0x0'));var Sequelize=require(_0x7668('0x1'));module[_0x7668('0x2')]={'firstName':{'type':Sequelize[_0x7668('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7668('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7668('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7668('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7668('0x4')]},'phone':{'type':Sequelize[_0x7668('0x3')]},'mobile':{'type':Sequelize[_0x7668('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x7668('0x3')]},'facebook':{'type':Sequelize[_0x7668('0x3')]},'fb_data':{'type':Sequelize[_0x7668('0x3')]},'twitter':{'type':Sequelize[_0x7668('0x3')]},'skype':{'type':Sequelize[_0x7668('0x3')]},'teams':{'type':Sequelize[_0x7668('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x7668('0x3')]},'wechat':{'type':Sequelize[_0x7668('0x3')]},'telegram':{'type':Sequelize[_0x7668('0x3')]},'UserId':{'type':Sequelize[_0x7668('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x7668('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x7668('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7668('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x7668('0x3')]},'utcOffset':{'type':Sequelize[_0x7668('0x5')]}};
\ No newline at end of file
+var _0xb9c8=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xb9c8,0x1ca));var _0x8b9c=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xb9c8[_0x31eb67];return _0x2a8cb8;};'use strict';var _=require(_0x8b9c('0x0'));var Sequelize=require(_0x8b9c('0x1'));module[_0x8b9c('0x2')]={'firstName':{'type':Sequelize[_0x8b9c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8b9c('0x3')]},'street':{'type':Sequelize[_0x8b9c('0x3')]},'postalCode':{'type':Sequelize[_0x8b9c('0x3')]},'city':{'type':Sequelize[_0x8b9c('0x3')]},'country':{'type':Sequelize[_0x8b9c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x8b9c('0x3')]},'description':{'type':Sequelize[_0x8b9c('0x4')]},'phone':{'type':Sequelize[_0x8b9c('0x3')]},'mobile':{'type':Sequelize[_0x8b9c('0x3')]},'fax':{'type':Sequelize[_0x8b9c('0x3')]},'email':{'type':Sequelize[_0x8b9c('0x3')]},'url':{'type':Sequelize[_0x8b9c('0x3')]},'facebook':{'type':Sequelize[_0x8b9c('0x3')]},'fb_data':{'type':Sequelize[_0x8b9c('0x3')]},'twitter':{'type':Sequelize[_0x8b9c('0x3')]},'skype':{'type':Sequelize[_0x8b9c('0x3')]},'teams':{'type':Sequelize[_0x8b9c('0x3')]},'viber':{'type':Sequelize[_0x8b9c('0x3')]},'line':{'type':Sequelize[_0x8b9c('0x3')]},'wechat':{'type':Sequelize[_0x8b9c('0x3')]},'telegram':{'type':Sequelize[_0x8b9c('0x3')]},'UserId':{'type':Sequelize[_0x8b9c('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x8b9c('0x3')]},'priority':{'type':Sequelize[_0x8b9c('0x5')](0x2)[_0x8b9c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8b9c('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x8b9c('0x3')]},'utcOffset':{'type':Sequelize[_0x8b9c('0x5')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd77=['create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','show','params','Tag','tag','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','map','format','cf_%d','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','model','rawAttributes','filters','intersection','fields','attributes','order','sort','pick','filter','merge','getTags','setTags','findOne','ids','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','literal','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','options','include','rows','getHopperHistories','ContactId','getHopperFinals','includeAll','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','split','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','User','agent','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','importUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','source','destination','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','UserId','DESC','createdAt','findAndCountAll','fullname','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','color','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','subject','substatus','openchannel','externalUrl','threadId','startCase','Interaction','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','squel','../../components/contacts','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','register','status','json','offset','count','limit','set','Content-Range','update','then','destroy','end','sendStatus','name','send','index','findAll','query','user','CmContact','find','catch','describe','tags','keys','length','startsWith','cf_','columnName','analytics','CmCustomField','alias','type','values','info','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s'];(function(_0x3415d5,_0xf7cd6c){var _0xe2007a=function(_0x92e1e0){while(--_0x92e1e0){_0x3415d5['push'](_0x3415d5['shift']());}};_0xe2007a(++_0xf7cd6c);}(_0xbd77,0x1b5));var _0x7bd7=function(_0x487887,_0x478f12){_0x487887=_0x487887-0x0;var _0x2304a0=_0xbd77[_0x487887];return _0x2304a0;};'use strict';var moment=require(_0x7bd7('0x0'));var BPromise=require(_0x7bd7('0x1'));var util=require(_0x7bd7('0x2'));var path=require(_0x7bd7('0x3'));var fs=require('fs');var _=require(_0x7bd7('0x4'));var squel=require(_0x7bd7('0x5'));var Papa=require('papaparse');var Redis=require('ioredis');var contacts=require(_0x7bd7('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x7bd7('0x7'))(_0x7bd7('0x8'));var config=require(_0x7bd7('0x9'));var shared=require('../../config/environment/shared');var db=require(_0x7bd7('0xa'))['db'];config['redis']=_[_0x7bd7('0xb')](config['redis'],{'host':_0x7bd7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0x7bd7('0xd')](socket);function respondWithResult(_0xfff3bb,_0x22d5b4){_0x22d5b4=_0x22d5b4||0xc8;return function(_0x5d05ce){if(_0x5d05ce){return _0xfff3bb[_0x7bd7('0xe')](_0x22d5b4)[_0x7bd7('0xf')](_0x5d05ce);}};}function respondWithFilteredResult(_0x1a87f9,_0x22f279){return function(_0x1bee61){if(_0x1bee61){var _0x12a44f=typeof _0x22f279[_0x7bd7('0x10')]==='undefined'&&typeof _0x22f279['limit']==='undefined';var _0x3ce8ef=_0x1bee61[_0x7bd7('0x11')];var _0x18d7c5=_0x12a44f?0x0:_0x22f279[_0x7bd7('0x10')];var _0x242495=_0x12a44f?_0x1bee61['count']:_0x22f279[_0x7bd7('0x10')]+_0x22f279[_0x7bd7('0x12')];var _0x3a63b8;if(_0x242495>=_0x3ce8ef){_0x242495=_0x3ce8ef;_0x3a63b8=0xc8;}else{_0x3a63b8=0xce;}_0x1a87f9[_0x7bd7('0xe')](_0x3a63b8);return _0x1a87f9[_0x7bd7('0x13')](_0x7bd7('0x14'),_0x18d7c5+'-'+_0x242495+'/'+_0x3ce8ef)[_0x7bd7('0xf')](_0x1bee61);}return null;};}function saveUpdates(_0x4a4e98){return function(_0x53006a){if(_0x53006a){return _0x53006a[_0x7bd7('0x15')](_0x4a4e98)[_0x7bd7('0x16')](function(_0x357df1){return _0x357df1;});}return null;};}function removeEntity(_0x5e7bab){return function(_0xbda442){if(_0xbda442){return _0xbda442[_0x7bd7('0x17')]()[_0x7bd7('0x16')](function(){_0x5e7bab['status'](0xcc)[_0x7bd7('0x18')]();});}};}function handleEntityNotFound(_0xd1f930){return function(_0x28ce4b){if(!_0x28ce4b){_0xd1f930[_0x7bd7('0x19')](0x194);}return _0x28ce4b;};}function handleError(_0x56b9c4,_0x19b3ea){_0x19b3ea=_0x19b3ea||0x1f4;return function(_0x4675d8){logger['error'](_0x4675d8['stack']);if(_0x4675d8[_0x7bd7('0x1a')]){delete _0x4675d8[_0x7bd7('0x1a')];}_0x56b9c4[_0x7bd7('0xe')](_0x19b3ea)[_0x7bd7('0x1b')](_0x4675d8);};}exports[_0x7bd7('0x1c')]=function(_0x3804cf,_0x1f4d3d){var _0x330535={};return contacts['describe']()['then'](function(_0xcdbee8){_0x330535=qs['getOptions'](_0xcdbee8,_0x3804cf);return contacts[_0x7bd7('0x1d')](_0x3804cf[_0x7bd7('0x1e')],_0x3804cf[_0x7bd7('0x1f')],_0x330535,_0xcdbee8);})['then'](respondWithFilteredResult(_0x1f4d3d,_0x330535))['catch'](handleError(_0x1f4d3d,null));};exports[_0x7bd7('0x17')]=function(_0x2b60db,_0x2c37a7){return db[_0x7bd7('0x20')][_0x7bd7('0x21')]({'where':{'id':_0x2b60db['params']['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x2c37a7,null))[_0x7bd7('0x16')](removeEntity(_0x2c37a7,null))[_0x7bd7('0x22')](handleError(_0x2c37a7,null));};exports[_0x7bd7('0x23')]=function(_0x3a5e2c,_0x40c240){return db[_0x7bd7('0x20')]['describe']()['then'](function(_0x1b3934){delete _0x1b3934[_0x7bd7('0x24')];for(var _0x5ed15a=0x0;_0x5ed15a<Object[_0x7bd7('0x25')](_0x1b3934)[_0x7bd7('0x26')];_0x5ed15a++){var _0xbdd5ad=Object[_0x7bd7('0x25')](_0x1b3934)[_0x5ed15a];if(!_[_0x7bd7('0x27')](_0xbdd5ad,_0x7bd7('0x28'))){_0x1b3934[_0xbdd5ad][_0x7bd7('0x29')]=_0xbdd5ad;_0x1b3934[_0xbdd5ad]['displayName']=_0xbdd5ad;}}return _0x1b3934;})[_0x7bd7('0x16')](function(_0x373606){var _0x2af9a7={'where':Boolean(_0x3a5e2c[_0x7bd7('0x1e')][_0x7bd7('0x2a')])===!![]?undefined:{'$or':[{'ListId':_0x3a5e2c[_0x7bd7('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x7bd7('0x2b')][_0x7bd7('0x1d')](_0x2af9a7)[_0x7bd7('0x16')](function(_0x23282d){for(var _0x409643=0x0;_0x409643<_0x23282d[_0x7bd7('0x26')];_0x409643++){var _0x252092='cf_'+_0x23282d[_0x409643]['id'];if(_0x373606[_0x252092]){_0x373606[_0x252092]['columnName']=_0x252092;_0x373606[_0x252092]['displayName']=_0x23282d[_0x409643][_0x7bd7('0x2c')];_0x373606[_0x252092]['custom']={'type':_0x23282d[_0x409643][_0x7bd7('0x2d')],'values':_0x23282d[_0x409643][_0x7bd7('0x2e')]};}else{logger[_0x7bd7('0x2f')]('Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table',_0x252092);}}Object[_0x7bd7('0x25')](_0x373606)[_0x7bd7('0x30')](function(_0x475cde){if(!_0x373606[_0x475cde][_0x7bd7('0x31')]('columnName')){delete _0x373606[_0x475cde];}});return _0x373606;});})[_0x7bd7('0x16')](respondWithResult(_0x40c240,null))[_0x7bd7('0x22')](handleError(_0x40c240,null));};exports['merge']=function(_0x38c121,_0x32acf9){var _0x1b7483;var _0x3a1c80;var _0x3a0de2;if(_0x38c121[_0x7bd7('0x32')]['id']){delete _0x38c121['body']['id'];}return db[_0x7bd7('0x20')][_0x7bd7('0x1d')]({'where':{'id':[_0x38c121['body']['to'],_0x38c121[_0x7bd7('0x32')][_0x7bd7('0x33')]]}})[_0x7bd7('0x16')](function(_0x4d70a7){if(_0x4d70a7){if(_0x4d70a7[_0x7bd7('0x26')]!==0x2){return null;}_0x4d70a7[0x0]=_0x4d70a7[0x0][_0x7bd7('0x34')]({'plain':!![]});_0x4d70a7[0x1]=_0x4d70a7[0x1]['get']({'plain':!![]});delete _0x4d70a7[0x0]['id'];delete _0x4d70a7[0x1]['id'];return _[_0x7bd7('0x35')](_0x4d70a7[0x0],_0x4d70a7[0x1],function(_0x390b56,_0x282594){if(Array['isArray'](_0x282594)&&!_0x282594[_0x7bd7('0x26')]){return _0x390b56;}else if(!_0x282594){return _0x390b56;}});}})[_0x7bd7('0x16')](handleEntityNotFound(_0x32acf9,null))['then'](function(_0xdbc503){if(_0xdbc503){if(_0xdbc503['tags']&&_[_0x7bd7('0x36')](_0xdbc503[_0x7bd7('0x24')])){_0xdbc503[_0x7bd7('0x24')]=_0xdbc503[_0x7bd7('0x24')][_0x7bd7('0x37')]();}logger[_0x7bd7('0x2f')](_0x7bd7('0x38'),_0x38c121['body']['to'],_0x38c121[_0x7bd7('0x32')][_0x7bd7('0x33')]);return db[_0x7bd7('0x39')][_0x7bd7('0x17')]({'where':{'ContactId':[_0x38c121['body']['to'],_0x38c121['body']['from']]}})[_0x7bd7('0x16')](function(_0x4e495b){logger[_0x7bd7('0x2f')](_0x7bd7('0x3a'),_0x4e495b);return db[_0x7bd7('0x3b')][_0x7bd7('0x17')]({'where':{'ContactId':[_0x38c121[_0x7bd7('0x32')]['to'],_0x38c121[_0x7bd7('0x32')][_0x7bd7('0x33')]]}})[_0x7bd7('0x16')](function(_0x4d1da9){logger[_0x7bd7('0x2f')](_0x7bd7('0x3c'),_0x4d1da9);return db['CmContact'][_0x7bd7('0x3d')](_0xdbc503);});});}})[_0x7bd7('0x16')](function(_0x2e2826){if(_0x2e2826){_0x1b7483=_0x2e2826;_0x3a1c80={'ContactId':_0x1b7483['id']};_0x3a0de2={'where':{'ContactId':[_0x38c121['body']['to'],_0x38c121['body']['from']]}};return db[_0x7bd7('0x3e')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db[_0x7bd7('0x3f')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db[_0x7bd7('0x40')]['update'](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x41')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x42')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db[_0x7bd7('0x41')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db['MailMessage'][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x43')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x44')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db[_0x7bd7('0x45')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db['FaxMessage'][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x46')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db[_0x7bd7('0x47')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x48')][_0x7bd7('0x15')]({'CmContactId':_0x1b7483['id']},{'where':{'CmContactId':[_0x38c121[_0x7bd7('0x32')]['to'],_0x38c121[_0x7bd7('0x32')][_0x7bd7('0x33')]]}});}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x49')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x4a')]['update'](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x4b')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db[_0x7bd7('0x4c')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x4d')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db['FaxQueueReport'][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x4e')][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db['OpenchannelQueueReport'][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db['SmsQueueReport']['update'](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x4f')]['update'](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x50')]['update'](_0x3a1c80,_0x3a0de2);}})['then'](function(){if(_0x1b7483){return db['WhatsappMessage']['update'](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db['WhatsappQueueReport'][_0x7bd7('0x15')](_0x3a1c80,_0x3a0de2);}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return db[_0x7bd7('0x20')][_0x7bd7('0x17')]({'where':{'id':[_0x38c121[_0x7bd7('0x32')]['to'],_0x38c121[_0x7bd7('0x32')]['from']]}});}})[_0x7bd7('0x16')](function(){if(_0x1b7483){return _0x1b7483;}})[_0x7bd7('0x16')](respondWithResult(_0x32acf9,null))[_0x7bd7('0x22')](handleError(_0x32acf9,null));};exports[_0x7bd7('0x3d')]=function(_0x45dc5c,_0x16a71a){return db[_0x7bd7('0x20')][_0x7bd7('0x23')]()[_0x7bd7('0x16')](function(_0x30f13a){if(_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x24')]&&_['isArray'](_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x24')])){if(_0x45dc5c[_0x7bd7('0x32')]['tags'][_0x7bd7('0x26')]){_0x45dc5c['body'][_0x7bd7('0x24')]=_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x24')][_0x7bd7('0x37')](';')+';';}else{_0x45dc5c[_0x7bd7('0x32')]['tags']=null;}}else{_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x24')]=null;}if(!_[_0x7bd7('0x51')](_0x45dc5c[_0x7bd7('0x32')]['dialTimezone'])){var _0x4677d5=_0x45dc5c['body'][_0x7bd7('0x52')];if(!_[_0x7bd7('0x51')](shared['timezones'][_0x4677d5]))_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x53')]=shared[_0x7bd7('0x54')][_0x4677d5]['utcOffset'];}return db[_0x7bd7('0x20')][_0x7bd7('0x3d')](_0x45dc5c[_0x7bd7('0x32')],{'fields':_[_0x7bd7('0x25')](_0x30f13a),'raw':!![]});})['then'](function(_0x3c7867){if(_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x55')]){return insertAdditionalPhones(_0x3c7867,_0x45dc5c[_0x7bd7('0x32')][_0x7bd7('0x55')]);}else{return _0x3c7867;}})['then'](respondWithResult(_0x16a71a,0xc9))[_0x7bd7('0x22')](handleError(_0x16a71a,null));};exports[_0x7bd7('0x56')]=function(_0x5743da,_0x15354a){var _0x79ad7d=0x0;var _0x6a777=0x0;var _0x27ed28=0x0;var _0x4d32d8=[];return db['CmContact']['describe']()[_0x7bd7('0x16')](function(_0x2864c2){return BPromise['each'](_0x5743da['body'],function(_0x4f7861){var _0x275de0={'where':{'$or':[]},'defaults':_0x4f7861,'fields':_[_0x7bd7('0x25')](_0x2864c2),'raw':!![]};if(_0x4f7861['duplicates']){for(var _0x2bff69=0x0;_0x2bff69<_0x4f7861['duplicates'][_0x7bd7('0x26')];_0x2bff69++){var _0x58e017={};_0x58e017[_0x4f7861[_0x7bd7('0x57')][_0x2bff69]]=_0x4f7861[_0x4f7861['duplicates'][_0x2bff69]];_0x275de0[_0x7bd7('0x58')][_0x7bd7('0x59')][_0x7bd7('0x5a')](_0x58e017);}_0x275de0[_0x7bd7('0x58')]['ListId']=_0x4f7861[_0x7bd7('0x5b')];}return db['CmContact'][_0x7bd7('0x5c')](_0x275de0)[_0x7bd7('0x5d')](function(_0x141e0c,_0x280652){if(_0x280652){if(_0x4f7861[_0x7bd7('0x31')]('additionalPhones')){_0x4d32d8[_0x7bd7('0x5a')]({'contact':_0x141e0c,'additionalPhones':_0x4f7861[_0x7bd7('0x55')]});}_0x79ad7d++;}else{_0x27ed28++;}})['catch'](function(){_0x6a777++;});});})[_0x7bd7('0x16')](function(_0x27c710){if(_0x27c710){if(_0x4d32d8[_0x7bd7('0x26')]>0x0){return new Promise(function(_0x25fd4d){var _0x4d4221=[];for(var _0x4794a8=0x0;_0x4794a8<_0x4d32d8['length'];_0x4794a8++){_0x4d4221[_0x7bd7('0x5a')](insertAdditionalPhones(_0x4d32d8[_0x4794a8][_0x7bd7('0x5e')],_0x4d32d8[_0x4794a8][_0x7bd7('0x55')]));}Promise['all'](_0x4d4221)[_0x7bd7('0x16')](function(){_0x25fd4d(0x1);});})['then'](function(){return{'success':_0x79ad7d,'failure':_0x6a777,'duplicates':_0x27ed28};});}else{return{'success':_0x79ad7d,'failure':_0x6a777,'duplicates':_0x27ed28};}}})['then'](respondWithResult(_0x15354a,0xc9))[_0x7bd7('0x22')](handleError(_0x15354a,null));};exports[_0x7bd7('0x5f')]=function(_0x281607,_0x29d975){var _0x5b9235;return db[_0x7bd7('0x20')][_0x7bd7('0x23')]()['then'](function(_0x3622e2){return db[_0x7bd7('0x20')][_0x7bd7('0x21')]({'where':{'id':_0x281607[_0x7bd7('0x60')]['id']},'include':[{'model':db[_0x7bd7('0x61')],'as':'Tags','attributes':['id','name','color'],'required':_0x281607['query'][_0x7bd7('0x62')]?!![]:![]},{'model':db[_0x7bd7('0x48')],'as':_0x7bd7('0x63'),'where':{'CmContactId':_0x281607['params']['id']},'required':![],'include':[{'model':db[_0x7bd7('0x64')],'as':_0x7bd7('0x65')}]}],'order':[db[_0x7bd7('0x66')]['literal'](_0x7bd7('0x67'))],'attributes':_['keys'](_0x3622e2)});})[_0x7bd7('0x16')](function(_0x4bf6e2){if(!_[_0x7bd7('0x51')](_0x4bf6e2)){_0x5b9235=_0x4bf6e2[_0x7bd7('0x34')]({'plain':!![]});var _0x30bd5f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4bf6e2&&_0x4bf6e2[_0x7bd7('0x5b')]){if(_0x4bf6e2[_0x7bd7('0x5b')]){_0x30bd5f[_0x7bd7('0x58')][_0x7bd7('0x68')]['push']({'ListId':{'$ne':_0x4bf6e2[_0x7bd7('0x5b')]}});}}return db['CmCustomField'][_0x7bd7('0x1d')](_0x30bd5f);}})[_0x7bd7('0x16')](function(_0x29d680){if(!_[_0x7bd7('0x51')](_0x29d680)){return _[_0x7bd7('0x69')](_0x5b9235,_[_0x7bd7('0x6a')](_0x29d680,function(_0x233b91){return util[_0x7bd7('0x6b')](_0x7bd7('0x6c'),_0x233b91['id']);}));}})[_0x7bd7('0x16')](handleEntityNotFound(_0x29d975,null))[_0x7bd7('0x16')](respondWithResult(_0x29d975,null))[_0x7bd7('0x22')](handleError(_0x29d975,null));};exports['update']=function(_0x1853cd,_0x4e859a){var _0x693f44;if(_0x1853cd[_0x7bd7('0x32')]['id']){delete _0x1853cd['body']['id'];}if(!_['isNil'](_0x1853cd[_0x7bd7('0x32')]['dialTimezone'])){var _0x269100=_0x1853cd[_0x7bd7('0x32')][_0x7bd7('0x52')];if(!_[_0x7bd7('0x51')](shared[_0x7bd7('0x54')][_0x269100]))_0x1853cd[_0x7bd7('0x32')]['utcOffset']=shared[_0x7bd7('0x54')][_0x269100][_0x7bd7('0x53')];}return db[_0x7bd7('0x20')][_0x7bd7('0x21')]({'where':{'id':_0x1853cd['params']['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x4e859a,null))[_0x7bd7('0x16')](saveUpdates(_0x1853cd[_0x7bd7('0x32')],null))[_0x7bd7('0x16')](function(_0x4c68f1){_0x693f44=_0x4c68f1;var _0x5d6458={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4c68f1&&_0x4c68f1[_0x7bd7('0x5b')]){if(_0x4c68f1['ListId']){_0x5d6458[_0x7bd7('0x58')][_0x7bd7('0x68')][_0x7bd7('0x5a')]({'ListId':{'$ne':_0x4c68f1[_0x7bd7('0x5b')]}});}}return db[_0x7bd7('0x2b')]['findAll'](_0x5d6458);})['then'](function(_0x48825a){if(_0x48825a){return _['omit'](_['pickBy'](_0x1853cd[_0x7bd7('0x32')],function(_0x77a6b2,_0x3d0a7a){return _[_0x7bd7('0x27')](_0x3d0a7a,_0x7bd7('0x28'));}),_['map'](_0x48825a,function(_0x3e8db6){return util[_0x7bd7('0x6b')](_0x7bd7('0x6c'),_0x3e8db6['id']);}));}})[_0x7bd7('0x16')](function(_0x5e2fa5){if(_0x5e2fa5&&!_[_0x7bd7('0x6d')](_0x5e2fa5)){var _0x42eb37=squel[_0x7bd7('0x15')]()[_0x7bd7('0x6e')](_0x7bd7('0x6f'))[_0x7bd7('0x70')](_0x5e2fa5)[_0x7bd7('0x58')](_0x7bd7('0x71'),_0x1853cd[_0x7bd7('0x60')]['id'])[_0x7bd7('0x72')]();return db[_0x7bd7('0x66')][_0x7bd7('0x1e')](_0x42eb37[_0x7bd7('0x73')],{'replacements':_0x42eb37['values']});}})['then'](function(){if(_0x1853cd[_0x7bd7('0x32')]['phone']&&_0x693f44){return db[_0x7bd7('0x39')]['update']({'phone':_0x1853cd[_0x7bd7('0x32')][_0x7bd7('0x74')],'OrderBy':0x0},{'where':{'ContactId':_0x693f44['id']}});}})['then'](function(){return _0x693f44;})[_0x7bd7('0x16')](respondWithResult(_0x4e859a,null))[_0x7bd7('0x22')](handleError(_0x4e859a,null));};exports['getTags']=function(_0x1fb1ed,_0x59a3f0){var _0xef3f68={};var _0x4b1788={};var _0x5b0d32;var _0x572199;return db[_0x7bd7('0x20')]['findOne']({'where':{'id':_0x1fb1ed[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x59a3f0,null))[_0x7bd7('0x16')](function(_0x390052){if(_0x390052){_0x5b0d32=_0x390052;_0x4b1788[_0x7bd7('0x75')]=_['keys'](db[_0x7bd7('0x61')][_0x7bd7('0x76')]);_0x4b1788[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x1fb1ed[_0x7bd7('0x1e')]);_0x4b1788[_0x7bd7('0x77')]=_['intersection'](_0x4b1788[_0x7bd7('0x75')],_0x4b1788[_0x7bd7('0x1e')]);_0xef3f68['attributes']=_[_0x7bd7('0x78')](_0x4b1788[_0x7bd7('0x75')],qs[_0x7bd7('0x79')](_0x1fb1ed[_0x7bd7('0x1e')]['fields']));_0xef3f68['attributes']=_0xef3f68[_0x7bd7('0x7a')]['length']?_0xef3f68[_0x7bd7('0x7a')]:_0x4b1788['model'];_0xef3f68[_0x7bd7('0x7b')]=qs['sort'](_0x1fb1ed['query'][_0x7bd7('0x7c')]);_0xef3f68[_0x7bd7('0x58')]=qs[_0x7bd7('0x77')](_[_0x7bd7('0x7d')](_0x1fb1ed[_0x7bd7('0x1e')],_0x4b1788[_0x7bd7('0x77')]));if(_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0xef3f68[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0xef3f68['where'],{'$or':_['map'](_0xef3f68[_0x7bd7('0x7a')],function(_0x5d6362){var _0x229e33={};_0x229e33[_0x5d6362]={'$like':'%'+_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x7e')]+'%'};return _0x229e33;})});}_0xef3f68=_[_0x7bd7('0x7f')]({},_0xef3f68,_0x1fb1ed['options']);return _0x5b0d32[_0x7bd7('0x80')](_0xef3f68);}})[_0x7bd7('0x16')](function(_0x122eb8){if(_0x122eb8){_0x572199=_0x122eb8['length'];if(!_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x31')]('nolimit')){_0xef3f68[_0x7bd7('0x12')]=qs['limit'](_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x12')]);_0xef3f68[_0x7bd7('0x10')]=qs[_0x7bd7('0x10')](_0x1fb1ed[_0x7bd7('0x1e')][_0x7bd7('0x10')]);}return _0x5b0d32[_0x7bd7('0x80')](_0xef3f68);}})[_0x7bd7('0x16')](function(_0x2b725a){if(_0x2b725a){return _0x2b725a?{'count':_0x572199,'rows':_0x2b725a}:null;}})['then'](respondWithResult(_0x59a3f0,null))[_0x7bd7('0x22')](handleError(_0x59a3f0,null));};exports[_0x7bd7('0x81')]=function(_0x56a120,_0x326289){if(_0x56a120['body']['id']){delete _0x56a120[_0x7bd7('0x32')]['id'];}return db['CmContact'][_0x7bd7('0x82')]({'where':{'id':_0x56a120[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x326289,null))['then'](function(_0xe6400e){if(_0xe6400e){return _0xe6400e['setTags'](_0x56a120['body'][_0x7bd7('0x83')]||[]);}return null;})[_0x7bd7('0x16')](respondWithResult(_0x326289,null))[_0x7bd7('0x22')](handleError(_0x326289,null));};exports['setAdditionalPhones']=function(_0xcd8c05,_0x406301){var _0x3306b2=[];_0x3306b2[_0x7bd7('0x5a')](addAdditionalPhones(_0xcd8c05[_0x7bd7('0x32')]));Promise[_0x7bd7('0x84')](_0x3306b2)[_0x7bd7('0x16')](function(){_0x3306b2=[];_0x3306b2[_0x7bd7('0x5a')](deleteCmHopperPhones(_0xcd8c05['body']['id']));_0x3306b2[_0x7bd7('0x5a')](addCmHopperPhones(_0xcd8c05[_0x7bd7('0x32')]['id']));Promise['all'](_0x3306b2)[_0x7bd7('0x16')](function(){return[0x1];})[_0x7bd7('0x16')](respondWithResult(_0x406301,null));});};function addAdditionalPhones(_0x559c1d){var _0x259360;return new Promise(function(_0x3cb784){return db[_0x7bd7('0x48')][_0x7bd7('0x17')]({'where':{'CmContactId':_0x559c1d['id']}})[_0x7bd7('0x16')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x7bd7('0x85')]})[_0x7bd7('0x16')](function(_0xac10e6){var _0x7f9e05=[];for(var _0x44caac=0x0;_0x44caac<_0x559c1d[_0x7bd7('0x86')][_0x7bd7('0x26')];_0x44caac++){var _0x54fa7f=_0x559c1d[_0x7bd7('0x87')]?_[_0x7bd7('0x51')](_0x559c1d['item_types'][_0x44caac])?'':_0x559c1d[_0x7bd7('0x87')][_0x44caac]:_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x88')]?_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x88')]:'';var _0x33098b=_[_0x7bd7('0x51')](_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x89')])?'':_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x89')];var _0x53fadd=_0x54fa7f+':'+_0x559c1d[_0x7bd7('0x86')][_0x44caac][_0x7bd7('0x74')]+'§'+_0x33098b;if(_[_0x7bd7('0x51')](_0x259360))_0x259360=_0x53fadd;else _0x259360+=';'+_0x53fadd;var _0xa84539=null;var _0x230ccf=null;if(_0x559c1d[_0x7bd7('0x87')]){if(!_[_0x7bd7('0x51')](_0x559c1d[_0x7bd7('0x87')][_0x44caac])){_0x230ccf=_[_0x7bd7('0x21')](_0xac10e6,function(_0xdea420){return _0xdea420['id']===_0x559c1d[_0x7bd7('0x87')][_0x44caac];});if(!_['isNil'](_0x230ccf)){_0xa84539=_0x230ccf[_0x7bd7('0x85')];}}}else{if(!_['isNil'](_0x559c1d[_0x7bd7('0x86')][_0x44caac])){_0x230ccf=_[_0x7bd7('0x21')](_0xac10e6,function(_0x34f1f8){return _0x34f1f8['id']===_0x559c1d[_0x7bd7('0x86')][_0x44caac]['ItemTypeId'];});if(!_[_0x7bd7('0x51')](_0x230ccf)){_0xa84539=_0x44caac;}}}if(_['isNil'](_0xa84539)){_0xa84539=0x64;}_0x7f9e05[_0x7bd7('0x5a')](addAdditionalPhone(_0x559c1d['id'],_0x559c1d['items'][_0x44caac][_0x7bd7('0x74')],_0x559c1d['item_types']?_['isNil'](_0x559c1d[_0x7bd7('0x87')][_0x44caac])?null:_0x559c1d['item_types'][_0x44caac]:_0x559c1d['items'][_0x44caac][_0x7bd7('0x88')]?_0x559c1d['items'][_0x44caac]['ItemTypeId']:null,_0xa84539,_0x33098b));}Promise[_0x7bd7('0x84')](_0x7f9e05)[_0x7bd7('0x16')](function(){db[_0x7bd7('0x20')][_0x7bd7('0x15')]({'AdditionalPhones':_0x259360},{'where':{'id':_0x559c1d['id']}})['then'](function(){_0x3cb784(0x1);});});});});});}function addAdditionalPhone(_0x5362b9,_0x5ccdb9,_0x490dd1,_0x3c82a9,_0x381d46){return db[_0x7bd7('0x48')][_0x7bd7('0x21')]({'where':{'CmContactId':_0x5362b9,'item':_0x5ccdb9}})['then'](function(_0x55dbe8){if(_0x55dbe8)logger[_0x7bd7('0x2f')](_0x7bd7('0x8a'),_0x55dbe8);else{db[_0x7bd7('0x48')][_0x7bd7('0x3d')]({'CmContactId':_0x5362b9,'item':_0x5ccdb9,'ItemTypeId':_0x490dd1,'OrderBy':_0x3c82a9,'ItemClass':'PHONE','description':_0x381d46});}});}function deleteCmHopperPhones(_0x449dea){return new Promise(function(_0x58db1a){return db[_0x7bd7('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x449dea}})[_0x7bd7('0x16')](function(_0x21f756){db[_0x7bd7('0x8b')][_0x7bd7('0x17')]({'where':{'CmHopperId':{'$in':_['map'](_0x21f756,'id')}}});})[_0x7bd7('0x16')](function(){_0x58db1a(0x1);});});}function addCmHopperPhones(_0xcb1cd9){return new Promise(function(_0x2d9120){return db['CmHopper'][_0x7bd7('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xcb1cd9}})[_0x7bd7('0x16')](function(_0x8b5da){var _0xf9ee6b=[];_['map'](_0x8b5da,function(_0x320c86){_0xf9ee6b[_0x7bd7('0x5a')](createCmHopperPhone(_0xcb1cd9,_0x320c86['id']));});Promise[_0x7bd7('0x84')](_0xf9ee6b)['then'](function(){_0x2d9120(0x1);});});});}function createCmHopperPhone(_0xb18bb1,_0x556b0d){return new Promise(function(_0x3d3886){db['CmContactHasItem'][_0x7bd7('0x1d')]({'raw':!![],'attributes':[_0x7bd7('0x8c'),'OrderBy'],'where':{'CmContactId':_0xb18bb1,'ItemClass':_0x7bd7('0x8d')},'include':[{'model':db[_0x7bd7('0x64')],'attributes':[_0x7bd7('0x85')],'as':_0x7bd7('0x65')}],'order':[_0x7bd7('0x85'),db['sequelize'][_0x7bd7('0x8e')]('`ItemType`.OrderBy')]})[_0x7bd7('0x16')](function(_0x3a7a41){var _0x20483a=0x1;var _0x42e09e=_['map'](_0x3a7a41,function(_0x53112e){_0x53112e['CmHopperId']=_0x556b0d;_0x53112e['phone']=_0x53112e[_0x7bd7('0x8c')];_0x53112e[_0x7bd7('0x85')]=_0x20483a;delete _0x53112e[_0x7bd7('0x8f')];_0x20483a=_0x20483a+0x1;return _0x53112e;});return db[_0x7bd7('0x8b')][_0x7bd7('0x56')](_0x42e09e,{});})[_0x7bd7('0x16')](function(){_0x3d3886(0x1);});});}function insertAdditionalPhones(_0x4735e3,_0x161c78){return new Promise(function(_0x20634d){var _0xe529ee=[];for(var _0x432eb6=0x0;_0x432eb6<_0x161c78[_0x7bd7('0x26')];_0x432eb6++){var _0x4bac7f=_0x161c78[_0x432eb6];_0xe529ee['push'](parseContactItemType(_0x4bac7f));}Promise[_0x7bd7('0x84')](_0xe529ee)[_0x7bd7('0x16')](function(){var _0x1d1f92={'id':_0x4735e3['id'],'items':_0x161c78};return addAdditionalPhones(_0x1d1f92)[_0x7bd7('0x16')](function(){return addCmHopperPhones(_0x4735e3['id']);});})[_0x7bd7('0x16')](function(){_0x20634d(_0x4735e3);});});}function parseContactItemType(_0x45a374){return new Promise(function(_0x1d49fe){if(_0x45a374[_0x7bd7('0x31')](_0x7bd7('0x88'))){_0x1d49fe(_0x45a374);}else{return db[_0x7bd7('0x64')]['find']({'where':{'name':_0x45a374['ItemType']}})[_0x7bd7('0x16')](function(_0x1d25af){if(_['isNil'](_0x1d25af))_0x45a374['ItemTypeId']=null;else _0x45a374[_0x7bd7('0x88')]=_0x1d25af['id'];_0x1d49fe(_0x45a374);});}});}exports[_0x7bd7('0x90')]=function(_0xdfe129,_0xc87db0){return db[_0x7bd7('0x48')][_0x7bd7('0x1d')]({'raw':!![],'where':{'CmContactId':_0xdfe129['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':_0x7bd7('0x65')}],'order':[[_0x7bd7('0x85')],[db[_0x7bd7('0x66')]['literal']('`ItemType`.OrderBy')]]})[_0x7bd7('0x16')](function(_0x1aa7aa){return _0x1aa7aa;})[_0x7bd7('0x16')](respondWithResult(_0xc87db0,null))[_0x7bd7('0x22')](handleError(_0xc87db0,null));};exports[_0x7bd7('0x91')]=function(_0x153a94,_0x28c878){return db[_0x7bd7('0x48')][_0x7bd7('0x1d')]({'raw':!![],'where':{'CmContactId':_0x153a94[_0x7bd7('0x32')][_0x7bd7('0x92')]}})[_0x7bd7('0x16')](function(_0x39713d){var _0x4de4c3=_[_0x7bd7('0x6a')](_0x39713d,function(_0x234ccf){_0x234ccf[_0x7bd7('0x93')]=_0x153a94[_0x7bd7('0x32')]['toContactId'];return _0x234ccf;});return db[_0x7bd7('0x48')][_0x7bd7('0x56')](_0x4de4c3,{});})[_0x7bd7('0x16')](function(){return addCmHopperPhones(_0x153a94[_0x7bd7('0x32')][_0x7bd7('0x94')]);})[_0x7bd7('0x16')](function(){return['ok'];})[_0x7bd7('0x16')](respondWithResult(_0x28c878,null))['catch'](handleError(_0x28c878,null));};exports[_0x7bd7('0x95')]=function(_0xa1683c,_0x1bd95a){var _0x502614=[];_0x502614[_0x7bd7('0x5a')](createCmHopperPhone(_0xa1683c['body']['id'],_0xa1683c[_0x7bd7('0x32')][_0x7bd7('0x96')]));Promise[_0x7bd7('0x84')](_0x502614)[_0x7bd7('0x16')](function(){return[0x1];})[_0x7bd7('0x16')](respondWithResult(_0x1bd95a,null));};exports[_0x7bd7('0x97')]=function(_0x5a69da,_0x2d6348){var _0xbbe185={'raw':![],'where':{}};var _0x135de2={};var _0x2a6a40={'count':0x0,'rows':[]};return db[_0x7bd7('0x20')][_0x7bd7('0x82')]({'where':{'id':_0x5a69da[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x2d6348,null))['then'](function(_0x201599){if(_0x201599){_0x135de2[_0x7bd7('0x75')]=_[_0x7bd7('0x25')](db['CmHopper'][_0x7bd7('0x76')]);_0x135de2[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x5a69da[_0x7bd7('0x1e')]);_0x135de2[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0x135de2[_0x7bd7('0x75')],_0x135de2[_0x7bd7('0x1e')]);_0xbbe185[_0x7bd7('0x7a')]=_['intersection'](_0x135de2[_0x7bd7('0x75')],qs['fields'](_0x5a69da['query'][_0x7bd7('0x79')]));_0xbbe185[_0x7bd7('0x7a')]=_0xbbe185['attributes'][_0x7bd7('0x26')]?_0xbbe185[_0x7bd7('0x7a')]:_0x135de2['model'];if(!_0x5a69da['query'][_0x7bd7('0x31')](_0x7bd7('0x98'))){_0xbbe185[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x5a69da[_0x7bd7('0x1e')]['limit']);_0xbbe185[_0x7bd7('0x10')]=qs['offset'](_0x5a69da['query']['offset']);}_0xbbe185[_0x7bd7('0x7b')]=qs['sort'](_0x5a69da[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0xbbe185['where']=qs[_0x7bd7('0x77')](_[_0x7bd7('0x7d')](_0x5a69da[_0x7bd7('0x1e')],_0x135de2[_0x7bd7('0x77')]));_0xbbe185[_0x7bd7('0x58')]['ContactId']=_0x201599['id'];if(_0x5a69da[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0xbbe185[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0xbbe185[_0x7bd7('0x58')],{'$or':_[_0x7bd7('0x6a')](_0xbbe185[_0x7bd7('0x7a')],function(_0x4c0d7d){var _0x10cbc3={};_0x10cbc3[_0x4c0d7d]={'$like':'%'+_0x5a69da[_0x7bd7('0x1e')]['filter']+'%'};return _0x10cbc3;})});}_0xbbe185=_[_0x7bd7('0x7f')]({},_0xbbe185,_0x5a69da[_0x7bd7('0x99')]);return db[_0x7bd7('0x39')][_0x7bd7('0x11')]({'where':_0xbbe185[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0x52cc8e){_0x2a6a40[_0x7bd7('0x11')]=_0x52cc8e;if(_0x5a69da[_0x7bd7('0x1e')]['includeAll']){_0xbbe185[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x39')][_0x7bd7('0x1d')](_0xbbe185);})[_0x7bd7('0x16')](function(_0x40e6ac){_0x2a6a40[_0x7bd7('0x9b')]=_0x40e6ac;return _0x2a6a40;});}})['then'](respondWithFilteredResult(_0x2d6348,_0xbbe185))[_0x7bd7('0x22')](handleError(_0x2d6348,null));};exports[_0x7bd7('0x9c')]=function(_0x133488,_0x4f0653){var _0xa1a741={'raw':!![],'where':{}};var _0x11387c={};var _0x3755b9={'count':0x0,'rows':[]};return db['CmContact'][_0x7bd7('0x82')]({'where':{'id':_0x133488[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x4f0653,null))[_0x7bd7('0x16')](function(_0xc3604c){if(_0xc3604c){_0x11387c[_0x7bd7('0x75')]=_[_0x7bd7('0x25')](db[_0x7bd7('0x4a')]['rawAttributes']);_0x11387c[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x133488[_0x7bd7('0x1e')]);_0x11387c[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0x11387c[_0x7bd7('0x75')],_0x11387c['query']);_0xa1a741[_0x7bd7('0x7a')]=_[_0x7bd7('0x78')](_0x11387c[_0x7bd7('0x75')],qs[_0x7bd7('0x79')](_0x133488['query']['fields']));_0xa1a741[_0x7bd7('0x7a')]=_0xa1a741[_0x7bd7('0x7a')][_0x7bd7('0x26')]?_0xa1a741['attributes']:_0x11387c[_0x7bd7('0x75')];if(!_0x133488[_0x7bd7('0x1e')]['hasOwnProperty'](_0x7bd7('0x98'))){_0xa1a741[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x133488['query'][_0x7bd7('0x12')]);_0xa1a741[_0x7bd7('0x10')]=qs[_0x7bd7('0x10')](_0x133488['query'][_0x7bd7('0x10')]);}_0xa1a741[_0x7bd7('0x7b')]=qs['sort'](_0x133488[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0xa1a741[_0x7bd7('0x58')]=qs[_0x7bd7('0x77')](_[_0x7bd7('0x7d')](_0x133488[_0x7bd7('0x1e')],_0x11387c['filters']));_0xa1a741[_0x7bd7('0x58')][_0x7bd7('0x9d')]=_0xc3604c['id'];if(_0x133488[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0xa1a741[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0xa1a741['where'],{'$or':_['map'](_0xa1a741['attributes'],function(_0x214b52){var _0x2c173c={};_0x2c173c[_0x214b52]={'$like':'%'+_0x133488[_0x7bd7('0x1e')]['filter']+'%'};return _0x2c173c;})});}_0xa1a741=_['merge']({},_0xa1a741,_0x133488[_0x7bd7('0x99')]);return db[_0x7bd7('0x4a')][_0x7bd7('0x11')]({'where':_0xa1a741[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0xf0771f){_0x3755b9['count']=_0xf0771f;if(_0x133488[_0x7bd7('0x1e')]['includeAll']){_0xa1a741[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x4a')]['findAll'](_0xa1a741);})[_0x7bd7('0x16')](function(_0x19c09e){_0x3755b9['rows']=_0x19c09e;return _0x3755b9;});}})[_0x7bd7('0x16')](respondWithFilteredResult(_0x4f0653,_0xa1a741))['catch'](handleError(_0x4f0653,null));};exports[_0x7bd7('0x9e')]=function(_0x9218b6,_0x2b55ec){var _0x42f507={'raw':!![],'where':{}};var _0xae4b2d={};var _0x32454a={'count':0x0,'rows':[]};return db[_0x7bd7('0x20')][_0x7bd7('0x82')]({'where':{'id':_0x9218b6['params']['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x2b55ec,null))[_0x7bd7('0x16')](function(_0x5ec873){if(_0x5ec873){_0xae4b2d['model']=_[_0x7bd7('0x25')](db[_0x7bd7('0x49')]['rawAttributes']);_0xae4b2d[_0x7bd7('0x1e')]=_[_0x7bd7('0x25')](_0x9218b6[_0x7bd7('0x1e')]);_0xae4b2d[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0xae4b2d[_0x7bd7('0x75')],_0xae4b2d['query']);_0x42f507[_0x7bd7('0x7a')]=_['intersection'](_0xae4b2d[_0x7bd7('0x75')],qs[_0x7bd7('0x79')](_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x79')]));_0x42f507[_0x7bd7('0x7a')]=_0x42f507[_0x7bd7('0x7a')]['length']?_0x42f507['attributes']:_0xae4b2d[_0x7bd7('0x75')];if(!_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x31')](_0x7bd7('0x98'))){_0x42f507[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x12')]);_0x42f507[_0x7bd7('0x10')]=qs[_0x7bd7('0x10')](_0x9218b6['query']['offset']);}_0x42f507['order']=qs[_0x7bd7('0x7c')](_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0x42f507['where']=qs[_0x7bd7('0x77')](_['pick'](_0x9218b6[_0x7bd7('0x1e')],_0xae4b2d[_0x7bd7('0x77')]));_0x42f507[_0x7bd7('0x58')][_0x7bd7('0x9d')]=_0x5ec873['id'];if(_0x9218b6[_0x7bd7('0x1e')][_0x7bd7('0x7e')]){_0x42f507[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0x42f507[_0x7bd7('0x58')],{'$or':_[_0x7bd7('0x6a')](_0x42f507[_0x7bd7('0x7a')],function(_0x4d8f1d){var _0x8df59d={};_0x8df59d[_0x4d8f1d]={'$like':'%'+_0x9218b6[_0x7bd7('0x1e')]['filter']+'%'};return _0x8df59d;})});}_0x42f507=_[_0x7bd7('0x7f')]({},_0x42f507,_0x9218b6[_0x7bd7('0x99')]);return db[_0x7bd7('0x49')]['count']({'where':_0x42f507[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0x352f57){_0x32454a['count']=_0x352f57;if(_0x9218b6['query'][_0x7bd7('0x9f')]){_0x42f507[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x49')][_0x7bd7('0x1d')](_0x42f507);})[_0x7bd7('0x16')](function(_0x5a4fb9){_0x32454a['rows']=_0x5a4fb9;return _0x32454a;});}})['then'](respondWithFilteredResult(_0x2b55ec,_0x42f507))[_0x7bd7('0x22')](handleError(_0x2b55ec,null));};exports['getJscriptySessions']=function(_0x4a308c,_0x812910){var _0x3b591c={'raw':!![],'where':{}};var _0x26548b={};var _0x46fa2a={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x4a308c[_0x7bd7('0x60')]['id']}})[_0x7bd7('0x16')](handleEntityNotFound(_0x812910,null))[_0x7bd7('0x16')](function(_0x5ef6d6){if(_0x5ef6d6){_0x26548b['model']=_[_0x7bd7('0x25')](db[_0x7bd7('0x4f')][_0x7bd7('0x76')]);_0x26548b[_0x7bd7('0x1e')]=_['keys'](_0x4a308c['query']);_0x26548b[_0x7bd7('0x77')]=_[_0x7bd7('0x78')](_0x26548b[_0x7bd7('0x75')],_0x26548b[_0x7bd7('0x1e')]);_0x3b591c['attributes']=_[_0x7bd7('0x78')](_0x26548b[_0x7bd7('0x75')],qs['fields'](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x79')]));_0x3b591c[_0x7bd7('0x7a')]=_0x3b591c[_0x7bd7('0x7a')]['length']?_0x3b591c['attributes']:_0x26548b[_0x7bd7('0x75')];if(!_0x4a308c[_0x7bd7('0x1e')]['hasOwnProperty'](_0x7bd7('0x98'))){_0x3b591c[_0x7bd7('0x12')]=qs[_0x7bd7('0x12')](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x12')]);_0x3b591c['offset']=qs[_0x7bd7('0x10')](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x10')]);}_0x3b591c[_0x7bd7('0x7b')]=qs[_0x7bd7('0x7c')](_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x7c')]);_0x3b591c[_0x7bd7('0x58')]=qs[_0x7bd7('0x77')](_['pick'](_0x4a308c[_0x7bd7('0x1e')],_0x26548b[_0x7bd7('0x77')]));_0x3b591c[_0x7bd7('0x58')][_0x7bd7('0x9d')]=_0x5ef6d6['id'];if(_0x4a308c[_0x7bd7('0x1e')]['filter']){_0x3b591c[_0x7bd7('0x58')]=_[_0x7bd7('0x7f')](_0x3b591c['where'],{'$or':_[_0x7bd7('0x6a')](_0x3b591c[_0x7bd7('0x7a')],function(_0x2da92f){var _0x2c277e={};_0x2c277e[_0x2da92f]={'$like':'%'+_0x4a308c[_0x7bd7('0x1e')][_0x7bd7('0x7e')]+'%'};return _0x2c277e;})});}_0x3b591c=_[_0x7bd7('0x7f')]({},_0x3b591c,_0x4a308c['options']);return db[_0x7bd7('0x4f')]['count']({'where':_0x3b591c[_0x7bd7('0x58')]})[_0x7bd7('0x16')](function(_0x6503b){_0x46fa2a[_0x7bd7('0x11')]=_0x6503b;if(_0x4a308c['query'][_0x7bd7('0x9f')]){_0x3b591c[_0x7bd7('0x9a')]=[{'all':!![]}];}return db[_0x7bd7('0x4f')][_0x7bd7('0x1d')](_0x3b591c);})[_0x7bd7('0x16')](function(_0x8029dd){_0x46fa2a[_0x7bd7('0x9b')]=_0x8029dd;return _0x46fa2a;});}})['then'](respondWithFilteredResult(_0x812910,_0x3b591c))['catch'](handleError(_0x812910,null));};exports['uploadCsv']=function(_0x3557f8,_0x3fe36b){try{if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0x5b')]){throw new Error(_0x7bd7('0xa0'));}if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0xa1')]){throw new Error(_0x7bd7('0xa2'));}if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0xa3')]){throw new Error(_0x7bd7('0xa4'));}if(!_0x3557f8[_0x7bd7('0x32')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3fca6b=_0x3557f8['body']['binding_keys'][_0x7bd7('0xa5')](',');var _0x24a2da=_0x3557f8['body'][_0x7bd7('0xa3')]['split'](',');if(!_0x3fca6b['length']||!_0x24a2da['length']||_0x3fca6b['length']!==_0x24a2da[_0x7bd7('0x26')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3557f8['body']['fields']=_['zipObject'](_0x3fca6b,_0x24a2da);if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0x79')][_0x7bd7('0x74')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3557f8[_0x7bd7('0x32')][_0x7bd7('0x79')][_0x7bd7('0xa6')]){throw new Error(_0x7bd7('0xa7'));}var _0x24b82e=path[_0x7bd7('0x37')](config['root'],_0x7bd7('0xa8'),_0x3557f8[_0x7bd7('0xa9')][_0x7bd7('0xaa')]);fs[_0x7bd7('0xab')](_0x24b82e,parseInt(_0x7bd7('0xac'),0x8));var _0x56bec4=require(_0x7bd7('0xad'))[_0x7bd7('0xae')](path[_0x7bd7('0x37')](__dirname,_0x7bd7('0xaf')),[_0x24b82e,_0x3557f8[_0x7bd7('0x32')]['binding_keys'],_0x3557f8[_0x7bd7('0x32')]['binding_values'],_0x3557f8[_0x7bd7('0x32')]['ListId'],_0x3557f8[_0x7bd7('0x32')]['CompanyId'],_0x3557f8['body']['duplicates'],_0x3557f8['body'][_0x7bd7('0xb0')]]);return _0x3fe36b[_0x7bd7('0xe')](0xc8)[_0x7bd7('0xf')]({'message':_0x7bd7('0xb1'),'pid':_0x56bec4['pid']});}catch(_0x49f162){return _0x3fe36b[_0x7bd7('0xe')](0x1f4)[_0x7bd7('0x1b')](_0x49f162);}};exports[_0x7bd7('0xb2')]=function(_0x223e0b,_0x235688){var _0x92b3da=fs[_0x7bd7('0xb3')](_0x223e0b[_0x7bd7('0xa9')][_0x7bd7('0x3')]);Papa[_0x7bd7('0xb4')](_0x92b3da,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3ed666){return _0x235688[_0x7bd7('0xe')](0xc8)['json']({'file':_0x223e0b[_0x7bd7('0xa9')],'fields':_0x3ed666[_0x7bd7('0xb5')][_0x7bd7('0x79')]});}});};exports[_0x7bd7('0xb6')]=function(_0x226ac8,_0x1b4339){return db[_0x7bd7('0xb7')][_0x7bd7('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7bd7('0xb8')}})['then'](function(_0x222ede){var _0xe7f5bc=![];if(!_0x226ac8['body'][_0x7bd7('0x5b')]){throw new Error(_0x7bd7('0xa0'));}if(!_0x226ac8[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0x74')]){throw new Error(_0x7bd7('0xba'));}if(!_0x226ac8[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0xa6')]){throw new Error(_0x7bd7('0xa7'));}if(!_0x226ac8[_0x7bd7('0x32')]['socket_timestamp']){throw new Error(_0x7bd7('0xbb'));}var _0x220ce4=require('child_process')['fork'](path['join'](__dirname,'../../components/import/cm/csv2'),[_0x226ac8[_0x7bd7('0x60')]['id'],JSON[_0x7bd7('0xbc')](_0x226ac8[_0x7bd7('0x32')]),JSON[_0x7bd7('0xbc')](_0x222ede)]);_0x220ce4['on']('message',function(){_0xe7f5bc=!![];return _0x1b4339['status'](0xc8)[_0x7bd7('0xf')]({'message':_0x7bd7('0xbd'),'pid':_0x220ce4['pid']});});_0x220ce4['on'](_0x7bd7('0xbe'),function(_0x532432){if(_0x532432&&!_0xe7f5bc){return _0x1b4339[_0x7bd7('0xe')](0x1f4)[_0x7bd7('0xf')]({'message':_0x7bd7('0xbf'),'pid':_0x220ce4[_0x7bd7('0xc0')]});}});})['catch'](handleError(_0x1b4339,null));};exports[_0x7bd7('0xc1')]=function(_0x12a16a,_0x1c525e){return db[_0x7bd7('0xb7')][_0x7bd7('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7bd7('0xb8')}})[_0x7bd7('0x16')](function(_0x35d70c){var _0x5cc05e=![];if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0x5b')]){throw new Error(_0x7bd7('0xa0'));}if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0x74')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0xb9')][_0x7bd7('0xa6')]){throw new Error(_0x7bd7('0xa7'));}if(!_0x12a16a[_0x7bd7('0x32')][_0x7bd7('0xb0')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x62f3bc=require('child_process')[_0x7bd7('0xae')](path[_0x7bd7('0x37')](__dirname,'../../components/import/cm/csvUpdates'),[_0x12a16a[_0x7bd7('0x60')]['id'],JSON[_0x7bd7('0xbc')](_0x12a16a[_0x7bd7('0x32')]),JSON['stringify'](_0x35d70c)]);_0x62f3bc['on']('message',function(){_0x5cc05e=!![];return _0x1c525e[_0x7bd7('0xe')](0xc8)[_0x7bd7('0xf')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x62f3bc[_0x7bd7('0xc0')]});});_0x62f3bc['on'](_0x7bd7('0xbe'),function(_0x46f25d){if(_0x46f25d&&!_0x5cc05e){return _0x1c525e[_0x7bd7('0xe')](0x1f4)[_0x7bd7('0xf')]({'message':'error\x20child\x20process','pid':_0x62f3bc['pid']});}});})[_0x7bd7('0x22')](handleError(_0x1c525e,null));};exports[_0x7bd7('0xc2')]=function(_0x30ebfa,_0xbd37da){var _0x305ded=[_0x7bd7('0xc3'),_0x7bd7('0xc4'),_0x7bd7('0xc5'),'openchannel',_0x7bd7('0xc6'),_0x7bd7('0xc7'),_0x7bd7('0xc8')];var _0x49e4a8={'offset':0x0,'order':qs[_0x7bd7('0x7c')](_0x7bd7('0xc9'))},_0x1d90fe={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x30ebfa['query'][_0x7bd7('0xca')]){if(!_[_0x7bd7('0xcb')](_0x305ded,_0x30ebfa[_0x7bd7('0x1e')]['channel'][_0x7bd7('0xcc')]())){throw new Error(_0x7bd7('0xcd'));}_0x305ded=[_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xca')][_0x7bd7('0xcc')]()];}if(_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xce')]){try{var _0x5477b0=JSON['parse'](_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xce')]);if(!moment(_0x5477b0['from'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x5477b0['to'])[_0x7bd7('0xcf')]()){throw new Error(_0x7bd7('0xd0'));}}catch(_0x36b5ba){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x30ebfa[_0x7bd7('0x1e')]['hasOwnProperty'](_0x7bd7('0x98'))){_0x49e4a8['limit']=qs[_0x7bd7('0x12')](_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0x12')]||0xa);_0x49e4a8['offset']=qs['offset'](_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0x10')]);}var _0x1ec1e5=_0x305ded['map'](function(_0x544ad8){if(_0x544ad8===_0x7bd7('0xc8')){var _0x7a7fe={'attributes':['id','uniqueid','type',_0x7bd7('0xd1'),_0x7bd7('0xd2'),_0x7bd7('0xd3'),_0x7bd7('0xd4'),_0x7bd7('0xd5'),_0x7bd7('0xd6'),_0x7bd7('0xd7'),'createdAt',_0x7bd7('0xd8'),_0x7bd7('0xd9'),'userThirdDisposition',_0x7bd7('0xda')],'where':{'ContactId':_0x30ebfa['params']['id']},'include':[{'model':db[_0x7bd7('0xb7')],'as':_0x7bd7('0xb7'),'attributes':['id',_0x7bd7('0x1a'),'fullname',_0x7bd7('0x2c')]}],'order':[['createdAt',_0x7bd7('0xdb')]]};if(_0x30ebfa[_0x7bd7('0x1e')][_0x7bd7('0xce')]){_0x7a7fe[_0x7bd7('0x58')][_0x7bd7('0xdc')]={'$gte':_0x5477b0[_0x7bd7('0x33')],'$lte':_0x5477b0['to']};}return db[_0x7bd7('0x4c')][_0x7bd7('0xdd')](_0x7a7fe)[_0x7bd7('0x16')](function(_0x2e0217){_0x1d90fe[_0x7bd7('0x11')]+=_0x2e0217[_0x7bd7('0x11')];return _[_0x7bd7('0x6a')](_0x2e0217[_0x7bd7('0x9b')],function(_0xa3b0aa){var _0x2220bf=_0xa3b0aa[_0x7bd7('0x34')]({'plain':!![]});_0x2220bf[_0x7bd7('0xca')]=_0x544ad8;if(_0x2220bf[_0x7bd7('0xb7')]){_0x2220bf[_0x7bd7('0xb7')]={'id':_0x2220bf['User']['id'],'name':_0x2220bf[_0x7bd7('0xb7')]['name'],'fullname':_0x2220bf['User'][_0x7bd7('0xde')],'alias':_0x2220bf[_0x7bd7('0xb7')]['alias']};}return _0x2220bf;});});}else{var _0x47b854=_['startCase'](_0x544ad8)+(_0x544ad8===_0x7bd7('0xc4')?_0x7bd7('0xdf'):_0x7bd7('0xe0'));var _0x4807ee={'attributes':['id',_0x7bd7('0xe1'),'closedAt',_0x7bd7('0xdc'),_0x7bd7('0xd7'),_0x7bd7('0xe2'),_0x7bd7('0xe3'),_0x7bd7('0xe4'),_0x7bd7('0xda'),_0x47b854+'Id'],'where':{'ContactId':_0x30ebfa[_0x7bd7('0x60')]['id']},'include':[{'model':db[_0x47b854],'as':_0x7bd7('0xe0'),'attributes':['id',_0x7bd7('0x1a'),_0x7bd7('0xe5')]},{'model':db[_0x7bd7('0xb7')],'as':_0x7bd7('0xe6'),'attributes':['id',_0x7bd7('0x1a'),_0x7bd7('0xde')]},{'model':db[_0x7bd7('0x61')],'as':'Tags','attributes':['id',_0x7bd7('0x1a'),_0x7bd7('0xe7')],'through':{'attributes':[]}}],'order':[[_0x7bd7('0xdc'),'DESC']]};if(_0x30ebfa[_0x7bd7('0x1e')]['range']){_0x4807ee['where']['createdAt']={'$gte':_0x5477b0['from'],'$lte':_0x5477b0['to']};}switch(_0x544ad8){case _0x7bd7('0xc4'):_0x4807ee['attributes'][_0x7bd7('0x5a')]('browserName',_0x7bd7('0xe8'),_0x7bd7('0xe9'),_0x7bd7('0xea'),'osName',_0x7bd7('0xeb'),_0x7bd7('0xec'),_0x7bd7('0xed'),'referer');break;case _0x7bd7('0xc3'):_0x4807ee[_0x7bd7('0x7a')][_0x7bd7('0x5a')](_0x7bd7('0xee'),_0x7bd7('0xef'));break;case _0x7bd7('0xf0'):_0x4807ee['attributes'][_0x7bd7('0x5a')](_0x7bd7('0xf1'),_0x7bd7('0xf2'));break;}return db[_[_0x7bd7('0xf3')](_0x544ad8)+_0x7bd7('0xf4')][_0x7bd7('0xdd')](_0x4807ee)[_0x7bd7('0x16')](function(_0x1dc8ea){_0x1d90fe[_0x7bd7('0x11')]+=_0x1dc8ea[_0x7bd7('0x11')];return _[_0x7bd7('0x6a')](_0x1dc8ea[_0x7bd7('0x9b')],function(_0x1bab0b){var _0x4564fd=_0x1bab0b['get']({'plain':!![]});_0x4564fd['channel']=_0x544ad8;if(_0x4564fd[_0x7bd7('0xe6')]){_0x4564fd[_0x7bd7('0xe6')]={'id':_0x4564fd['Owner']['id'],'name':_0x4564fd['Owner'][_0x7bd7('0x1a')],'fullname':_0x4564fd[_0x7bd7('0xe6')][_0x7bd7('0xde')]};}return _0x4564fd;});});}});return Promise[_0x7bd7('0x84')](_0x1ec1e5);})[_0x7bd7('0x16')](function(_0x438f5a){return _(_0x438f5a)['flatten']()[_0x7bd7('0xf5')](_0x7bd7('0xdc'))[_0x7bd7('0xf6')]()[_0x7bd7('0xf7')]();})[_0x7bd7('0x16')](function(_0x3ed7a9){_0x1d90fe[_0x7bd7('0x9b')]=_0x49e4a8[_0x7bd7('0x12')]?_0x3ed7a9[_0x7bd7('0xf8')](_0x49e4a8[_0x7bd7('0x10')],_0x49e4a8[_0x7bd7('0x10')]+_0x49e4a8[_0x7bd7('0x12')]):_0x3ed7a9;return _0x1d90fe;})[_0x7bd7('0x16')](respondWithFilteredResult(_0xbd37da,_0x49e4a8))[_0x7bd7('0x22')](handleError(_0xbd37da,null));};
\ No newline at end of file
+var _0x9ed7=['startsWith','cf_','columnName','displayName','analytics','alias','custom','info','forEach','hasOwnProperty','body','length','get','mergeWith','isArray','join','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','Tag','Tags','name','color','query','tag','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','omit','map','format','cf_%d','find','$and','CmCustomField','pickBy','setFields','id\x20=\x20?','toParam','text','values','phone','getTags','model','rawAttributes','filters','intersection','fields','attributes','order','sort','filter','merge','options','nolimit','findOne','setTags','ids','setAdditionalPhones','all','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','item','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','pick','ContactId','count','includeAll','include','rows','getHopperHistories','getJscriptySessions','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','chmodSync','child_process','CompanyId','File\x20uploaded\x20correctly!','pid','upload','parse','import','agent','binding','fork','../../components/import/cm/csv2','stringify','message','exit','importUpdates','User','No\x20phone\x20column\x20specified','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','type','source','destination','callerid','starttime','endtime','note','createdAt','userSecondDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','mail','subject','substatus','externalUrl','threadId','Interaction','Owner','sortBy','reverse','value','moment','bluebird','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','set','Content-Range','json','update','destroy','then','error','send','describe','findAll','user','CmContact','params','catch','tags','keys'];(function(_0x2c019a,_0x385779){var _0x2fb9b2=function(_0x37fe09){while(--_0x37fe09){_0x2c019a['push'](_0x2c019a['shift']());}};_0x2fb9b2(++_0x385779);}(_0x9ed7,0x1ce));var _0x79ed=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x9ed7[_0x20b29c];return _0x20d81b;};'use strict';var moment=require(_0x79ed('0x0'));var BPromise=require(_0x79ed('0x1'));var util=require(_0x79ed('0x2'));var path=require(_0x79ed('0x3'));var fs=require('fs');var _=require(_0x79ed('0x4'));var squel=require(_0x79ed('0x5'));var Papa=require('papaparse');var Redis=require(_0x79ed('0x6'));var contacts=require(_0x79ed('0x7'));var qs=require(_0x79ed('0x8'));var logger=require(_0x79ed('0x9'))(_0x79ed('0xa'));var config=require(_0x79ed('0xb'));var shared=require('../../config/environment/shared');var db=require(_0x79ed('0xc'))['db'];config['redis']=_[_0x79ed('0xd')](config[_0x79ed('0xe')],{'host':_0x79ed('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79ed('0xe')]));require(_0x79ed('0x10'))[_0x79ed('0x11')](socket);function respondWithResult(_0x45110c,_0x39e174){_0x39e174=_0x39e174||0xc8;return function(_0x12eca8){if(_0x12eca8){return _0x45110c[_0x79ed('0x12')](_0x39e174)['json'](_0x12eca8);}};}function respondWithFilteredResult(_0x33c45f,_0x42d420){return function(_0x248152){if(_0x248152){var _0x2b09f8=typeof _0x42d420[_0x79ed('0x13')]===_0x79ed('0x14')&&typeof _0x42d420[_0x79ed('0x15')]===_0x79ed('0x14');var _0x3de061=_0x248152['count'];var _0x84ead=_0x2b09f8?0x0:_0x42d420[_0x79ed('0x13')];var _0xb8308e=_0x2b09f8?_0x248152['count']:_0x42d420[_0x79ed('0x13')]+_0x42d420[_0x79ed('0x15')];var _0x1361d8;if(_0xb8308e>=_0x3de061){_0xb8308e=_0x3de061;_0x1361d8=0xc8;}else{_0x1361d8=0xce;}_0x33c45f['status'](_0x1361d8);return _0x33c45f[_0x79ed('0x16')](_0x79ed('0x17'),_0x84ead+'-'+_0xb8308e+'/'+_0x3de061)[_0x79ed('0x18')](_0x248152);}return null;};}function saveUpdates(_0x317183){return function(_0x2589ba){if(_0x2589ba){return _0x2589ba[_0x79ed('0x19')](_0x317183)['then'](function(_0x4bf4d3){return _0x4bf4d3;});}return null;};}function removeEntity(_0x4d2841){return function(_0x45d1b2){if(_0x45d1b2){return _0x45d1b2[_0x79ed('0x1a')]()[_0x79ed('0x1b')](function(){_0x4d2841[_0x79ed('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3781c9){return function(_0x2bdd75){if(!_0x2bdd75){_0x3781c9['sendStatus'](0x194);}return _0x2bdd75;};}function handleError(_0x149e82,_0xc8f1f9){_0xc8f1f9=_0xc8f1f9||0x1f4;return function(_0x38d948){logger[_0x79ed('0x1c')](_0x38d948['stack']);if(_0x38d948['name']){delete _0x38d948['name'];}_0x149e82[_0x79ed('0x12')](_0xc8f1f9)[_0x79ed('0x1d')](_0x38d948);};}exports['index']=function(_0x14600e,_0x500604){var _0xcc011f={};return contacts[_0x79ed('0x1e')]()[_0x79ed('0x1b')](function(_0x5c4afa){_0xcc011f=qs['getOptions'](_0x5c4afa,_0x14600e);return contacts[_0x79ed('0x1f')](_0x14600e['query'],_0x14600e[_0x79ed('0x20')],_0xcc011f,_0x5c4afa);})[_0x79ed('0x1b')](respondWithFilteredResult(_0x500604,_0xcc011f))['catch'](handleError(_0x500604,null));};exports[_0x79ed('0x1a')]=function(_0x5c5cec,_0x3efa59){return db[_0x79ed('0x21')]['find']({'where':{'id':_0x5c5cec[_0x79ed('0x22')]['id']}})[_0x79ed('0x1b')](handleEntityNotFound(_0x3efa59,null))[_0x79ed('0x1b')](removeEntity(_0x3efa59,null))[_0x79ed('0x23')](handleError(_0x3efa59,null));};exports['describe']=function(_0x53907e,_0x285ae5){return db['CmContact'][_0x79ed('0x1e')]()[_0x79ed('0x1b')](function(_0x3ea915){delete _0x3ea915[_0x79ed('0x24')];for(var _0x227daf=0x0;_0x227daf<Object['keys'](_0x3ea915)['length'];_0x227daf++){var _0x12f958=Object[_0x79ed('0x25')](_0x3ea915)[_0x227daf];if(!_[_0x79ed('0x26')](_0x12f958,_0x79ed('0x27'))){_0x3ea915[_0x12f958][_0x79ed('0x28')]=_0x12f958;_0x3ea915[_0x12f958][_0x79ed('0x29')]=_0x12f958;}}return _0x3ea915;})[_0x79ed('0x1b')](function(_0x23c11d){var _0x10ef80={'where':Boolean(_0x53907e['query'][_0x79ed('0x2a')])===!![]?undefined:{'$or':[{'ListId':_0x53907e['query']['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField']['findAll'](_0x10ef80)[_0x79ed('0x1b')](function(_0x5a4a5b){for(var _0x4c5cbe=0x0;_0x4c5cbe<_0x5a4a5b['length'];_0x4c5cbe++){var _0x3d4f0b=_0x79ed('0x27')+_0x5a4a5b[_0x4c5cbe]['id'];if(_0x23c11d[_0x3d4f0b]){_0x23c11d[_0x3d4f0b][_0x79ed('0x28')]=_0x3d4f0b;_0x23c11d[_0x3d4f0b]['displayName']=_0x5a4a5b[_0x4c5cbe][_0x79ed('0x2b')];_0x23c11d[_0x3d4f0b][_0x79ed('0x2c')]={'type':_0x5a4a5b[_0x4c5cbe]['type'],'values':_0x5a4a5b[_0x4c5cbe]['values']};}else{logger[_0x79ed('0x2d')]('Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table',_0x3d4f0b);}}Object[_0x79ed('0x25')](_0x23c11d)[_0x79ed('0x2e')](function(_0x2d1899){if(!_0x23c11d[_0x2d1899][_0x79ed('0x2f')](_0x79ed('0x28'))){delete _0x23c11d[_0x2d1899];}});return _0x23c11d;});})[_0x79ed('0x1b')](respondWithResult(_0x285ae5,null))['catch'](handleError(_0x285ae5,null));};exports['merge']=function(_0x42ea5d,_0x2caf4f){var _0x9032a2;var _0x5c37af;var _0x47a1eb;if(_0x42ea5d[_0x79ed('0x30')]['id']){delete _0x42ea5d['body']['id'];}return db[_0x79ed('0x21')][_0x79ed('0x1f')]({'where':{'id':[_0x42ea5d[_0x79ed('0x30')]['to'],_0x42ea5d[_0x79ed('0x30')]['from']]}})[_0x79ed('0x1b')](function(_0x1864d0){if(_0x1864d0){if(_0x1864d0[_0x79ed('0x31')]!==0x2){return null;}_0x1864d0[0x0]=_0x1864d0[0x0]['get']({'plain':!![]});_0x1864d0[0x1]=_0x1864d0[0x1][_0x79ed('0x32')]({'plain':!![]});delete _0x1864d0[0x0]['id'];delete _0x1864d0[0x1]['id'];return _[_0x79ed('0x33')](_0x1864d0[0x0],_0x1864d0[0x1],function(_0x50056b,_0x35282d){if(Array[_0x79ed('0x34')](_0x35282d)&&!_0x35282d[_0x79ed('0x31')]){return _0x50056b;}else if(!_0x35282d){return _0x50056b;}});}})[_0x79ed('0x1b')](handleEntityNotFound(_0x2caf4f,null))[_0x79ed('0x1b')](function(_0x1f50aa){if(_0x1f50aa){if(_0x1f50aa['tags']&&_[_0x79ed('0x34')](_0x1f50aa['tags'])){_0x1f50aa[_0x79ed('0x24')]=_0x1f50aa[_0x79ed('0x24')][_0x79ed('0x35')]();}logger[_0x79ed('0x2d')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x42ea5d[_0x79ed('0x30')]['to'],_0x42ea5d[_0x79ed('0x30')][_0x79ed('0x36')]);return db[_0x79ed('0x37')][_0x79ed('0x1a')]({'where':{'ContactId':[_0x42ea5d[_0x79ed('0x30')]['to'],_0x42ea5d[_0x79ed('0x30')][_0x79ed('0x36')]]}})[_0x79ed('0x1b')](function(_0x311735){logger[_0x79ed('0x2d')](_0x79ed('0x38'),_0x311735);return db[_0x79ed('0x39')][_0x79ed('0x1a')]({'where':{'ContactId':[_0x42ea5d[_0x79ed('0x30')]['to'],_0x42ea5d['body'][_0x79ed('0x36')]]}})['then'](function(_0x1e219d){logger[_0x79ed('0x2d')](_0x79ed('0x3a'),_0x1e219d);return db[_0x79ed('0x21')][_0x79ed('0x3b')](_0x1f50aa);});});}})[_0x79ed('0x1b')](function(_0x273e00){if(_0x273e00){_0x9032a2=_0x273e00;_0x5c37af={'ContactId':_0x9032a2['id']};_0x47a1eb={'where':{'ContactId':[_0x42ea5d[_0x79ed('0x30')]['to'],_0x42ea5d['body'][_0x79ed('0x36')]]}};return db[_0x79ed('0x3c')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x3d')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x3e')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['MailInteraction']['update'](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x3f')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x40')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x3f')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x41')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['SmsMessage']['update'](_0x5c37af,_0x47a1eb);}})['then'](function(){if(_0x9032a2){return db['FaxInteraction'][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x42')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})['then'](function(){if(_0x9032a2){return db[_0x79ed('0x43')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['OpenchannelMessage'][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['CmContactHasItem'][_0x79ed('0x19')]({'CmContactId':_0x9032a2['id']},{'where':{'CmContactId':[_0x42ea5d['body']['to'],_0x42ea5d[_0x79ed('0x30')][_0x79ed('0x36')]]}});}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x44')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})['then'](function(){if(_0x9032a2){return db[_0x79ed('0x45')]['update'](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['ReportAgentPreview']['update'](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x46')]['update'](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x47')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['FaxQueueReport'][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x48')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x49')]['update'](_0x5c37af,_0x47a1eb);}})['then'](function(){if(_0x9032a2){return db[_0x79ed('0x4a')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x4b')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x4c')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db[_0x79ed('0x4d')][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['WhatsappQueueReport'][_0x79ed('0x19')](_0x5c37af,_0x47a1eb);}})[_0x79ed('0x1b')](function(){if(_0x9032a2){return db['CmContact']['destroy']({'where':{'id':[_0x42ea5d[_0x79ed('0x30')]['to'],_0x42ea5d[_0x79ed('0x30')]['from']]}});}})['then'](function(){if(_0x9032a2){return _0x9032a2;}})[_0x79ed('0x1b')](respondWithResult(_0x2caf4f,null))['catch'](handleError(_0x2caf4f,null));};exports[_0x79ed('0x3b')]=function(_0x3a7534,_0xd7fae3){return db['CmContact'][_0x79ed('0x1e')]()[_0x79ed('0x1b')](function(_0x2b5bd6){if(_0x3a7534[_0x79ed('0x30')][_0x79ed('0x24')]&&_[_0x79ed('0x34')](_0x3a7534[_0x79ed('0x30')]['tags'])){if(_0x3a7534[_0x79ed('0x30')][_0x79ed('0x24')][_0x79ed('0x31')]){_0x3a7534[_0x79ed('0x30')]['tags']=_0x3a7534[_0x79ed('0x30')][_0x79ed('0x24')][_0x79ed('0x35')](';')+';';}else{_0x3a7534[_0x79ed('0x30')]['tags']=null;}}else{_0x3a7534[_0x79ed('0x30')][_0x79ed('0x24')]=null;}if(!_[_0x79ed('0x4e')](_0x3a7534[_0x79ed('0x30')][_0x79ed('0x4f')])){var _0x3edb2e=_0x3a7534[_0x79ed('0x30')][_0x79ed('0x4f')];if(!_[_0x79ed('0x4e')](shared['timezones'][_0x3edb2e]))_0x3a7534['body'][_0x79ed('0x50')]=shared[_0x79ed('0x51')][_0x3edb2e]['utcOffset'];}return db[_0x79ed('0x21')][_0x79ed('0x3b')](_0x3a7534['body'],{'fields':_[_0x79ed('0x25')](_0x2b5bd6),'raw':!![]});})['then'](function(_0x28a71c){if(_0x3a7534[_0x79ed('0x30')][_0x79ed('0x52')]){return insertAdditionalPhones(_0x28a71c,_0x3a7534[_0x79ed('0x30')][_0x79ed('0x52')]);}else{return _0x28a71c;}})[_0x79ed('0x1b')](respondWithResult(_0xd7fae3,0xc9))[_0x79ed('0x23')](handleError(_0xd7fae3,null));};exports[_0x79ed('0x53')]=function(_0x34495b,_0x5777cd){var _0x4e861e=0x0;var _0x2142c9=0x0;var _0x4e7bff=0x0;var _0x44ceac=[];return db[_0x79ed('0x21')][_0x79ed('0x1e')]()[_0x79ed('0x1b')](function(_0x6637e2){return BPromise[_0x79ed('0x54')](_0x34495b[_0x79ed('0x30')],function(_0x2faae5){var _0x18eedc={'where':{'$or':[]},'defaults':_0x2faae5,'fields':_['keys'](_0x6637e2),'raw':!![]};if(_0x2faae5[_0x79ed('0x55')]){for(var _0x345ad1=0x0;_0x345ad1<_0x2faae5[_0x79ed('0x55')][_0x79ed('0x31')];_0x345ad1++){var _0x38576f={};_0x38576f[_0x2faae5[_0x79ed('0x55')][_0x345ad1]]=_0x2faae5[_0x2faae5['duplicates'][_0x345ad1]];_0x18eedc[_0x79ed('0x56')][_0x79ed('0x57')][_0x79ed('0x58')](_0x38576f);}_0x18eedc[_0x79ed('0x56')][_0x79ed('0x59')]=_0x2faae5[_0x79ed('0x59')];}return db[_0x79ed('0x21')][_0x79ed('0x5a')](_0x18eedc)[_0x79ed('0x5b')](function(_0x59169b,_0x212484){if(_0x212484){if(_0x2faae5['hasOwnProperty']('additionalPhones')){_0x44ceac[_0x79ed('0x58')]({'contact':_0x59169b,'additionalPhones':_0x2faae5[_0x79ed('0x52')]});}_0x4e861e++;}else{_0x4e7bff++;}})[_0x79ed('0x23')](function(){_0x2142c9++;});});})['then'](function(_0x1f944e){if(_0x1f944e){if(_0x44ceac[_0x79ed('0x31')]>0x0){return new Promise(function(_0x136df1){var _0x12211f=[];for(var _0x29cab9=0x0;_0x29cab9<_0x44ceac[_0x79ed('0x31')];_0x29cab9++){_0x12211f['push'](insertAdditionalPhones(_0x44ceac[_0x29cab9][_0x79ed('0x5c')],_0x44ceac[_0x29cab9][_0x79ed('0x52')]));}Promise['all'](_0x12211f)[_0x79ed('0x1b')](function(){_0x136df1(0x1);});})[_0x79ed('0x1b')](function(){return{'success':_0x4e861e,'failure':_0x2142c9,'duplicates':_0x4e7bff};});}else{return{'success':_0x4e861e,'failure':_0x2142c9,'duplicates':_0x4e7bff};}}})['then'](respondWithResult(_0x5777cd,0xc9))[_0x79ed('0x23')](handleError(_0x5777cd,null));};exports['show']=function(_0x4c8c76,_0x47ed58){var _0x43bd5e;return db[_0x79ed('0x21')][_0x79ed('0x1e')]()[_0x79ed('0x1b')](function(_0x43447c){return db[_0x79ed('0x21')]['find']({'where':{'id':_0x4c8c76['params']['id']},'include':[{'model':db[_0x79ed('0x5d')],'as':_0x79ed('0x5e'),'attributes':['id',_0x79ed('0x5f'),_0x79ed('0x60')],'required':_0x4c8c76[_0x79ed('0x61')][_0x79ed('0x62')]?!![]:![]},{'model':db[_0x79ed('0x63')],'as':_0x79ed('0x64'),'where':{'CmContactId':_0x4c8c76[_0x79ed('0x22')]['id']},'required':![],'include':[{'model':db[_0x79ed('0x65')],'as':_0x79ed('0x66')}]}],'order':[db[_0x79ed('0x67')]['literal'](_0x79ed('0x68'))],'attributes':_[_0x79ed('0x25')](_0x43447c)});})[_0x79ed('0x1b')](function(_0x14fa85){if(!_[_0x79ed('0x4e')](_0x14fa85)){_0x43bd5e=_0x14fa85[_0x79ed('0x32')]({'plain':!![]});var _0x4e7343={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x14fa85&&_0x14fa85[_0x79ed('0x59')]){if(_0x14fa85[_0x79ed('0x59')]){_0x4e7343[_0x79ed('0x56')]['$and']['push']({'ListId':{'$ne':_0x14fa85[_0x79ed('0x59')]}});}}return db['CmCustomField'][_0x79ed('0x1f')](_0x4e7343);}})['then'](function(_0x7166ee){if(!_[_0x79ed('0x4e')](_0x7166ee)){return _[_0x79ed('0x69')](_0x43bd5e,_[_0x79ed('0x6a')](_0x7166ee,function(_0x5df8f7){return util[_0x79ed('0x6b')](_0x79ed('0x6c'),_0x5df8f7['id']);}));}})[_0x79ed('0x1b')](handleEntityNotFound(_0x47ed58,null))[_0x79ed('0x1b')](respondWithResult(_0x47ed58,null))[_0x79ed('0x23')](handleError(_0x47ed58,null));};exports[_0x79ed('0x19')]=function(_0x2ec361,_0x490eeb){var _0x5d57fc;if(_0x2ec361[_0x79ed('0x30')]['id']){delete _0x2ec361['body']['id'];}if(!_[_0x79ed('0x4e')](_0x2ec361[_0x79ed('0x30')][_0x79ed('0x4f')])){var _0x291c35=_0x2ec361['body'][_0x79ed('0x4f')];if(!_[_0x79ed('0x4e')](shared[_0x79ed('0x51')][_0x291c35]))_0x2ec361[_0x79ed('0x30')][_0x79ed('0x50')]=shared[_0x79ed('0x51')][_0x291c35][_0x79ed('0x50')];}return db[_0x79ed('0x21')][_0x79ed('0x6d')]({'where':{'id':_0x2ec361[_0x79ed('0x22')]['id']}})[_0x79ed('0x1b')](handleEntityNotFound(_0x490eeb,null))['then'](saveUpdates(_0x2ec361[_0x79ed('0x30')],null))['then'](function(_0x2460bb){_0x5d57fc=_0x2460bb;var _0x5f92e7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2460bb&&_0x2460bb[_0x79ed('0x59')]){if(_0x2460bb[_0x79ed('0x59')]){_0x5f92e7[_0x79ed('0x56')][_0x79ed('0x6e')]['push']({'ListId':{'$ne':_0x2460bb[_0x79ed('0x59')]}});}}return db[_0x79ed('0x6f')][_0x79ed('0x1f')](_0x5f92e7);})[_0x79ed('0x1b')](function(_0x5e3402){if(_0x5e3402){return _[_0x79ed('0x69')](_[_0x79ed('0x70')](_0x2ec361[_0x79ed('0x30')],function(_0x15aab3,_0x26eafa){return _[_0x79ed('0x26')](_0x26eafa,'cf_');}),_[_0x79ed('0x6a')](_0x5e3402,function(_0x57f30e){return util[_0x79ed('0x6b')](_0x79ed('0x6c'),_0x57f30e['id']);}));}})[_0x79ed('0x1b')](function(_0xdac578){if(_0xdac578&&!_['isEmpty'](_0xdac578)){var _0x127687=squel[_0x79ed('0x19')]()['table']('cm_contacts')[_0x79ed('0x71')](_0xdac578)[_0x79ed('0x56')](_0x79ed('0x72'),_0x2ec361['params']['id'])[_0x79ed('0x73')]();return db[_0x79ed('0x67')][_0x79ed('0x61')](_0x127687[_0x79ed('0x74')],{'replacements':_0x127687[_0x79ed('0x75')]});}})['then'](function(){if(_0x2ec361[_0x79ed('0x30')]['phone']&&_0x5d57fc){return db['CmHopper'][_0x79ed('0x19')]({'phone':_0x2ec361[_0x79ed('0x30')][_0x79ed('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x5d57fc['id']}});}})[_0x79ed('0x1b')](function(){return _0x5d57fc;})['then'](respondWithResult(_0x490eeb,null))[_0x79ed('0x23')](handleError(_0x490eeb,null));};exports[_0x79ed('0x77')]=function(_0x3fcaab,_0xf150ea){var _0x282758={};var _0x5f3ad6={};var _0x137d8f;var _0x3bc5f0;return db[_0x79ed('0x21')]['findOne']({'where':{'id':_0x3fcaab['params']['id']}})['then'](handleEntityNotFound(_0xf150ea,null))['then'](function(_0x1adce2){if(_0x1adce2){_0x137d8f=_0x1adce2;_0x5f3ad6[_0x79ed('0x78')]=_[_0x79ed('0x25')](db[_0x79ed('0x5d')][_0x79ed('0x79')]);_0x5f3ad6[_0x79ed('0x61')]=_[_0x79ed('0x25')](_0x3fcaab[_0x79ed('0x61')]);_0x5f3ad6[_0x79ed('0x7a')]=_[_0x79ed('0x7b')](_0x5f3ad6[_0x79ed('0x78')],_0x5f3ad6[_0x79ed('0x61')]);_0x282758['attributes']=_['intersection'](_0x5f3ad6[_0x79ed('0x78')],qs[_0x79ed('0x7c')](_0x3fcaab[_0x79ed('0x61')][_0x79ed('0x7c')]));_0x282758['attributes']=_0x282758['attributes'][_0x79ed('0x31')]?_0x282758[_0x79ed('0x7d')]:_0x5f3ad6[_0x79ed('0x78')];_0x282758[_0x79ed('0x7e')]=qs[_0x79ed('0x7f')](_0x3fcaab[_0x79ed('0x61')][_0x79ed('0x7f')]);_0x282758[_0x79ed('0x56')]=qs[_0x79ed('0x7a')](_['pick'](_0x3fcaab[_0x79ed('0x61')],_0x5f3ad6['filters']));if(_0x3fcaab[_0x79ed('0x61')][_0x79ed('0x80')]){_0x282758[_0x79ed('0x56')]=_[_0x79ed('0x81')](_0x282758[_0x79ed('0x56')],{'$or':_[_0x79ed('0x6a')](_0x282758[_0x79ed('0x7d')],function(_0x5ddeef){var _0xc7d3ff={};_0xc7d3ff[_0x5ddeef]={'$like':'%'+_0x3fcaab[_0x79ed('0x61')][_0x79ed('0x80')]+'%'};return _0xc7d3ff;})});}_0x282758=_[_0x79ed('0x81')]({},_0x282758,_0x3fcaab[_0x79ed('0x82')]);return _0x137d8f[_0x79ed('0x77')](_0x282758);}})[_0x79ed('0x1b')](function(_0x1144bf){if(_0x1144bf){_0x3bc5f0=_0x1144bf['length'];if(!_0x3fcaab[_0x79ed('0x61')][_0x79ed('0x2f')](_0x79ed('0x83'))){_0x282758[_0x79ed('0x15')]=qs[_0x79ed('0x15')](_0x3fcaab['query'][_0x79ed('0x15')]);_0x282758[_0x79ed('0x13')]=qs[_0x79ed('0x13')](_0x3fcaab[_0x79ed('0x61')][_0x79ed('0x13')]);}return _0x137d8f[_0x79ed('0x77')](_0x282758);}})[_0x79ed('0x1b')](function(_0x147d73){if(_0x147d73){return _0x147d73?{'count':_0x3bc5f0,'rows':_0x147d73}:null;}})[_0x79ed('0x1b')](respondWithResult(_0xf150ea,null))[_0x79ed('0x23')](handleError(_0xf150ea,null));};exports['setTags']=function(_0x3c748c,_0x57dd86){if(_0x3c748c[_0x79ed('0x30')]['id']){delete _0x3c748c['body']['id'];}return db[_0x79ed('0x21')][_0x79ed('0x84')]({'where':{'id':_0x3c748c[_0x79ed('0x22')]['id']}})[_0x79ed('0x1b')](handleEntityNotFound(_0x57dd86,null))[_0x79ed('0x1b')](function(_0x3d73e8){if(_0x3d73e8){return _0x3d73e8[_0x79ed('0x85')](_0x3c748c[_0x79ed('0x30')][_0x79ed('0x86')]||[]);}return null;})[_0x79ed('0x1b')](respondWithResult(_0x57dd86,null))['catch'](handleError(_0x57dd86,null));};exports[_0x79ed('0x87')]=function(_0x5660bf,_0x15785e){var _0x496dc0=[];_0x496dc0[_0x79ed('0x58')](addAdditionalPhones(_0x5660bf[_0x79ed('0x30')]));Promise[_0x79ed('0x88')](_0x496dc0)['then'](function(){_0x496dc0=[];_0x496dc0[_0x79ed('0x58')](deleteCmHopperPhones(_0x5660bf['body']['id']));_0x496dc0[_0x79ed('0x58')](addCmHopperPhones(_0x5660bf[_0x79ed('0x30')]['id']));Promise[_0x79ed('0x88')](_0x496dc0)['then'](function(){return[0x1];})[_0x79ed('0x1b')](respondWithResult(_0x15785e,null));});};function addAdditionalPhones(_0xa255aa){var _0x383666;return new Promise(function(_0x4cab44){return db[_0x79ed('0x63')][_0x79ed('0x1a')]({'where':{'CmContactId':_0xa255aa['id']}})[_0x79ed('0x1b')](function(){db[_0x79ed('0x65')]['findAll']({'raw':!![],'attributes':['id',_0x79ed('0x89')]})[_0x79ed('0x1b')](function(_0x506704){var _0x4f9127=[];for(var _0x23ea12=0x0;_0x23ea12<_0xa255aa['items'][_0x79ed('0x31')];_0x23ea12++){var _0x36c642=_0xa255aa[_0x79ed('0x8a')]?_[_0x79ed('0x4e')](_0xa255aa[_0x79ed('0x8a')][_0x23ea12])?'':_0xa255aa['item_types'][_0x23ea12]:_0xa255aa[_0x79ed('0x8b')][_0x23ea12][_0x79ed('0x8c')]?_0xa255aa[_0x79ed('0x8b')][_0x23ea12][_0x79ed('0x8c')]:'';var _0x3ef932=_['isNil'](_0xa255aa[_0x79ed('0x8b')][_0x23ea12]['description'])?'':_0xa255aa[_0x79ed('0x8b')][_0x23ea12][_0x79ed('0x8d')];var _0xaf4f87=_0x36c642+':'+_0xa255aa[_0x79ed('0x8b')][_0x23ea12][_0x79ed('0x76')]+'§'+_0x3ef932;if(_[_0x79ed('0x4e')](_0x383666))_0x383666=_0xaf4f87;else _0x383666+=';'+_0xaf4f87;var _0xad5e66=null;var _0x2071ad=null;if(_0xa255aa[_0x79ed('0x8a')]){if(!_[_0x79ed('0x4e')](_0xa255aa['item_types'][_0x23ea12])){_0x2071ad=_[_0x79ed('0x6d')](_0x506704,function(_0x1f8cd8){return _0x1f8cd8['id']===_0xa255aa[_0x79ed('0x8a')][_0x23ea12];});if(!_[_0x79ed('0x4e')](_0x2071ad)){_0xad5e66=_0x2071ad[_0x79ed('0x89')];}}}else{if(!_[_0x79ed('0x4e')](_0xa255aa[_0x79ed('0x8b')][_0x23ea12])){_0x2071ad=_[_0x79ed('0x6d')](_0x506704,function(_0x35db74){return _0x35db74['id']===_0xa255aa['items'][_0x23ea12][_0x79ed('0x8c')];});if(!_[_0x79ed('0x4e')](_0x2071ad)){_0xad5e66=_0x23ea12;}}}if(_[_0x79ed('0x4e')](_0xad5e66)){_0xad5e66=0x64;}_0x4f9127[_0x79ed('0x58')](addAdditionalPhone(_0xa255aa['id'],_0xa255aa[_0x79ed('0x8b')][_0x23ea12][_0x79ed('0x76')],_0xa255aa[_0x79ed('0x8a')]?_['isNil'](_0xa255aa[_0x79ed('0x8a')][_0x23ea12])?null:_0xa255aa[_0x79ed('0x8a')][_0x23ea12]:_0xa255aa[_0x79ed('0x8b')][_0x23ea12][_0x79ed('0x8c')]?_0xa255aa['items'][_0x23ea12][_0x79ed('0x8c')]:null,_0xad5e66,_0x3ef932));}Promise[_0x79ed('0x88')](_0x4f9127)[_0x79ed('0x1b')](function(){db[_0x79ed('0x21')]['update']({'AdditionalPhones':_0x383666},{'where':{'id':_0xa255aa['id']}})[_0x79ed('0x1b')](function(){_0x4cab44(0x1);});});});});});}function addAdditionalPhone(_0x8b1819,_0x3c5ca4,_0x8f9e76,_0x22ff23,_0x547976){return db[_0x79ed('0x63')][_0x79ed('0x6d')]({'where':{'CmContactId':_0x8b1819,'item':_0x3c5ca4}})[_0x79ed('0x1b')](function(_0x3934c8){if(_0x3934c8)logger['info'](_0x79ed('0x8e'),_0x3934c8);else{db[_0x79ed('0x63')]['create']({'CmContactId':_0x8b1819,'item':_0x3c5ca4,'ItemTypeId':_0x8f9e76,'OrderBy':_0x22ff23,'ItemClass':_0x79ed('0x8f'),'description':_0x547976});}});}function deleteCmHopperPhones(_0x15b14d){return new Promise(function(_0x22c173){return db['CmHopper'][_0x79ed('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x15b14d}})[_0x79ed('0x1b')](function(_0xd05d14){db[_0x79ed('0x90')][_0x79ed('0x1a')]({'where':{'CmHopperId':{'$in':_[_0x79ed('0x6a')](_0xd05d14,'id')}}});})[_0x79ed('0x1b')](function(){_0x22c173(0x1);});});}function addCmHopperPhones(_0x16c70b){return new Promise(function(_0x5a5be3){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x16c70b}})['then'](function(_0x5f4b3d){var _0x370e91=[];_[_0x79ed('0x6a')](_0x5f4b3d,function(_0x3a5b70){_0x370e91['push'](createCmHopperPhone(_0x16c70b,_0x3a5b70['id']));});Promise[_0x79ed('0x88')](_0x370e91)[_0x79ed('0x1b')](function(){_0x5a5be3(0x1);});});});}function createCmHopperPhone(_0x4e18f1,_0x3434c6){return new Promise(function(_0xf675a7){db[_0x79ed('0x63')][_0x79ed('0x1f')]({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0x4e18f1,'ItemClass':_0x79ed('0x8f')},'include':[{'model':db[_0x79ed('0x65')],'attributes':['OrderBy'],'as':_0x79ed('0x66')}],'order':[_0x79ed('0x89'),db[_0x79ed('0x67')]['literal'](_0x79ed('0x91'))]})[_0x79ed('0x1b')](function(_0x50774f){var _0x5867ff=0x1;var _0x531cbe=_[_0x79ed('0x6a')](_0x50774f,function(_0x12492b){_0x12492b['CmHopperId']=_0x3434c6;_0x12492b['phone']=_0x12492b[_0x79ed('0x92')];_0x12492b[_0x79ed('0x89')]=_0x5867ff;delete _0x12492b['ItemType.OrderBy'];_0x5867ff=_0x5867ff+0x1;return _0x12492b;});return db[_0x79ed('0x90')]['bulkCreate'](_0x531cbe,{});})['then'](function(){_0xf675a7(0x1);});});}function insertAdditionalPhones(_0x49d3a5,_0x1b064f){return new Promise(function(_0xe2d316){var _0x5eb22f=[];for(var _0x4bcef9=0x0;_0x4bcef9<_0x1b064f[_0x79ed('0x31')];_0x4bcef9++){var _0xaac72d=_0x1b064f[_0x4bcef9];_0x5eb22f[_0x79ed('0x58')](parseContactItemType(_0xaac72d));}Promise[_0x79ed('0x88')](_0x5eb22f)[_0x79ed('0x1b')](function(){var _0x2328ee={'id':_0x49d3a5['id'],'items':_0x1b064f};return addAdditionalPhones(_0x2328ee)[_0x79ed('0x1b')](function(){return addCmHopperPhones(_0x49d3a5['id']);});})[_0x79ed('0x1b')](function(){_0xe2d316(_0x49d3a5);});});}function parseContactItemType(_0x1b19c8){return new Promise(function(_0x145468){if(_0x1b19c8[_0x79ed('0x2f')](_0x79ed('0x8c'))){_0x145468(_0x1b19c8);}else{return db[_0x79ed('0x65')][_0x79ed('0x6d')]({'where':{'name':_0x1b19c8[_0x79ed('0x66')]}})[_0x79ed('0x1b')](function(_0xed7dfe){if(_[_0x79ed('0x4e')](_0xed7dfe))_0x1b19c8['ItemTypeId']=null;else _0x1b19c8[_0x79ed('0x8c')]=_0xed7dfe['id'];_0x145468(_0x1b19c8);});}});}exports[_0x79ed('0x93')]=function(_0x18b9ba,_0xfce0f9){return db[_0x79ed('0x63')][_0x79ed('0x1f')]({'raw':!![],'where':{'CmContactId':_0x18b9ba[_0x79ed('0x22')]['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[['OrderBy'],[db['sequelize']['literal']('`ItemType`.OrderBy')]]})[_0x79ed('0x1b')](function(_0x985e10){return _0x985e10;})['then'](respondWithResult(_0xfce0f9,null))[_0x79ed('0x23')](handleError(_0xfce0f9,null));};exports[_0x79ed('0x94')]=function(_0x400d19,_0x18a8b9){return db['CmContactHasItem'][_0x79ed('0x1f')]({'raw':!![],'where':{'CmContactId':_0x400d19['body']['fromContactId']}})['then'](function(_0x5642ef){var _0x5c44d1=_[_0x79ed('0x6a')](_0x5642ef,function(_0x35225c){_0x35225c[_0x79ed('0x95')]=_0x400d19[_0x79ed('0x30')][_0x79ed('0x96')];return _0x35225c;});return db['CmContactHasItem'][_0x79ed('0x53')](_0x5c44d1,{});})[_0x79ed('0x1b')](function(){return addCmHopperPhones(_0x400d19[_0x79ed('0x30')][_0x79ed('0x96')]);})['then'](function(){return['ok'];})[_0x79ed('0x1b')](respondWithResult(_0x18a8b9,null))[_0x79ed('0x23')](handleError(_0x18a8b9,null));};exports[_0x79ed('0x97')]=function(_0x3f330a,_0x23eadc){var _0x12b599=[];_0x12b599[_0x79ed('0x58')](createCmHopperPhone(_0x3f330a[_0x79ed('0x30')]['id'],_0x3f330a['body'][_0x79ed('0x98')]));Promise[_0x79ed('0x88')](_0x12b599)['then'](function(){return[0x1];})[_0x79ed('0x1b')](respondWithResult(_0x23eadc,null));};exports[_0x79ed('0x99')]=function(_0x5f111a,_0x4de4ca){var _0x105e29={'raw':![],'where':{}};var _0x5a19a6={};var _0x2c9986={'count':0x0,'rows':[]};return db[_0x79ed('0x21')][_0x79ed('0x84')]({'where':{'id':_0x5f111a['params']['id']}})[_0x79ed('0x1b')](handleEntityNotFound(_0x4de4ca,null))[_0x79ed('0x1b')](function(_0x56ece6){if(_0x56ece6){_0x5a19a6['model']=_[_0x79ed('0x25')](db[_0x79ed('0x37')][_0x79ed('0x79')]);_0x5a19a6[_0x79ed('0x61')]=_['keys'](_0x5f111a['query']);_0x5a19a6['filters']=_[_0x79ed('0x7b')](_0x5a19a6[_0x79ed('0x78')],_0x5a19a6[_0x79ed('0x61')]);_0x105e29[_0x79ed('0x7d')]=_[_0x79ed('0x7b')](_0x5a19a6[_0x79ed('0x78')],qs[_0x79ed('0x7c')](_0x5f111a[_0x79ed('0x61')][_0x79ed('0x7c')]));_0x105e29[_0x79ed('0x7d')]=_0x105e29[_0x79ed('0x7d')][_0x79ed('0x31')]?_0x105e29['attributes']:_0x5a19a6[_0x79ed('0x78')];if(!_0x5f111a['query'][_0x79ed('0x2f')](_0x79ed('0x83'))){_0x105e29[_0x79ed('0x15')]=qs[_0x79ed('0x15')](_0x5f111a['query']['limit']);_0x105e29['offset']=qs[_0x79ed('0x13')](_0x5f111a['query'][_0x79ed('0x13')]);}_0x105e29[_0x79ed('0x7e')]=qs[_0x79ed('0x7f')](_0x5f111a[_0x79ed('0x61')][_0x79ed('0x7f')]);_0x105e29[_0x79ed('0x56')]=qs['filters'](_[_0x79ed('0x9a')](_0x5f111a[_0x79ed('0x61')],_0x5a19a6[_0x79ed('0x7a')]));_0x105e29[_0x79ed('0x56')][_0x79ed('0x9b')]=_0x56ece6['id'];if(_0x5f111a[_0x79ed('0x61')][_0x79ed('0x80')]){_0x105e29[_0x79ed('0x56')]=_[_0x79ed('0x81')](_0x105e29[_0x79ed('0x56')],{'$or':_[_0x79ed('0x6a')](_0x105e29['attributes'],function(_0x42a796){var _0x655909={};_0x655909[_0x42a796]={'$like':'%'+_0x5f111a[_0x79ed('0x61')][_0x79ed('0x80')]+'%'};return _0x655909;})});}_0x105e29=_[_0x79ed('0x81')]({},_0x105e29,_0x5f111a[_0x79ed('0x82')]);return db['CmHopper'][_0x79ed('0x9c')]({'where':_0x105e29[_0x79ed('0x56')]})['then'](function(_0x3d7a56){_0x2c9986[_0x79ed('0x9c')]=_0x3d7a56;if(_0x5f111a[_0x79ed('0x61')][_0x79ed('0x9d')]){_0x105e29[_0x79ed('0x9e')]=[{'all':!![]}];}return db[_0x79ed('0x37')][_0x79ed('0x1f')](_0x105e29);})[_0x79ed('0x1b')](function(_0x31e80b){_0x2c9986[_0x79ed('0x9f')]=_0x31e80b;return _0x2c9986;});}})[_0x79ed('0x1b')](respondWithFilteredResult(_0x4de4ca,_0x105e29))['catch'](handleError(_0x4de4ca,null));};exports[_0x79ed('0xa0')]=function(_0x136830,_0x2456d4){var _0x3220ff={'raw':!![],'where':{}};var _0x54bea7={};var _0x4ba11a={'count':0x0,'rows':[]};return db[_0x79ed('0x21')][_0x79ed('0x84')]({'where':{'id':_0x136830['params']['id']}})[_0x79ed('0x1b')](handleEntityNotFound(_0x2456d4,null))[_0x79ed('0x1b')](function(_0x2f98a1){if(_0x2f98a1){_0x54bea7[_0x79ed('0x78')]=_[_0x79ed('0x25')](db[_0x79ed('0x45')][_0x79ed('0x79')]);_0x54bea7['query']=_[_0x79ed('0x25')](_0x136830[_0x79ed('0x61')]);_0x54bea7['filters']=_['intersection'](_0x54bea7[_0x79ed('0x78')],_0x54bea7[_0x79ed('0x61')]);_0x3220ff[_0x79ed('0x7d')]=_[_0x79ed('0x7b')](_0x54bea7[_0x79ed('0x78')],qs[_0x79ed('0x7c')](_0x136830[_0x79ed('0x61')][_0x79ed('0x7c')]));_0x3220ff[_0x79ed('0x7d')]=_0x3220ff['attributes'][_0x79ed('0x31')]?_0x3220ff[_0x79ed('0x7d')]:_0x54bea7[_0x79ed('0x78')];if(!_0x136830['query'][_0x79ed('0x2f')](_0x79ed('0x83'))){_0x3220ff[_0x79ed('0x15')]=qs[_0x79ed('0x15')](_0x136830['query']['limit']);_0x3220ff[_0x79ed('0x13')]=qs[_0x79ed('0x13')](_0x136830['query']['offset']);}_0x3220ff[_0x79ed('0x7e')]=qs[_0x79ed('0x7f')](_0x136830['query']['sort']);_0x3220ff[_0x79ed('0x56')]=qs[_0x79ed('0x7a')](_[_0x79ed('0x9a')](_0x136830[_0x79ed('0x61')],_0x54bea7['filters']));_0x3220ff[_0x79ed('0x56')][_0x79ed('0x9b')]=_0x2f98a1['id'];if(_0x136830[_0x79ed('0x61')][_0x79ed('0x80')]){_0x3220ff[_0x79ed('0x56')]=_[_0x79ed('0x81')](_0x3220ff[_0x79ed('0x56')],{'$or':_[_0x79ed('0x6a')](_0x3220ff[_0x79ed('0x7d')],function(_0x30d16b){var _0x119e24={};_0x119e24[_0x30d16b]={'$like':'%'+_0x136830['query'][_0x79ed('0x80')]+'%'};return _0x119e24;})});}_0x3220ff=_['merge']({},_0x3220ff,_0x136830[_0x79ed('0x82')]);return db[_0x79ed('0x45')][_0x79ed('0x9c')]({'where':_0x3220ff[_0x79ed('0x56')]})[_0x79ed('0x1b')](function(_0x4d9e10){_0x4ba11a[_0x79ed('0x9c')]=_0x4d9e10;if(_0x136830[_0x79ed('0x61')]['includeAll']){_0x3220ff[_0x79ed('0x9e')]=[{'all':!![]}];}return db[_0x79ed('0x45')]['findAll'](_0x3220ff);})[_0x79ed('0x1b')](function(_0x358972){_0x4ba11a[_0x79ed('0x9f')]=_0x358972;return _0x4ba11a;});}})['then'](respondWithFilteredResult(_0x2456d4,_0x3220ff))[_0x79ed('0x23')](handleError(_0x2456d4,null));};exports['getHopperFinals']=function(_0x13eb09,_0x467c3b){var _0x27fbfa={'raw':!![],'where':{}};var _0x4a0d41={};var _0x22c016={'count':0x0,'rows':[]};return db[_0x79ed('0x21')][_0x79ed('0x84')]({'where':{'id':_0x13eb09[_0x79ed('0x22')]['id']}})[_0x79ed('0x1b')](handleEntityNotFound(_0x467c3b,null))['then'](function(_0x390832){if(_0x390832){_0x4a0d41['model']=_[_0x79ed('0x25')](db[_0x79ed('0x44')]['rawAttributes']);_0x4a0d41['query']=_[_0x79ed('0x25')](_0x13eb09[_0x79ed('0x61')]);_0x4a0d41[_0x79ed('0x7a')]=_[_0x79ed('0x7b')](_0x4a0d41[_0x79ed('0x78')],_0x4a0d41[_0x79ed('0x61')]);_0x27fbfa[_0x79ed('0x7d')]=_['intersection'](_0x4a0d41[_0x79ed('0x78')],qs[_0x79ed('0x7c')](_0x13eb09[_0x79ed('0x61')][_0x79ed('0x7c')]));_0x27fbfa[_0x79ed('0x7d')]=_0x27fbfa[_0x79ed('0x7d')][_0x79ed('0x31')]?_0x27fbfa[_0x79ed('0x7d')]:_0x4a0d41['model'];if(!_0x13eb09[_0x79ed('0x61')][_0x79ed('0x2f')]('nolimit')){_0x27fbfa['limit']=qs[_0x79ed('0x15')](_0x13eb09[_0x79ed('0x61')][_0x79ed('0x15')]);_0x27fbfa['offset']=qs['offset'](_0x13eb09[_0x79ed('0x61')][_0x79ed('0x13')]);}_0x27fbfa[_0x79ed('0x7e')]=qs[_0x79ed('0x7f')](_0x13eb09[_0x79ed('0x61')][_0x79ed('0x7f')]);_0x27fbfa['where']=qs[_0x79ed('0x7a')](_[_0x79ed('0x9a')](_0x13eb09[_0x79ed('0x61')],_0x4a0d41['filters']));_0x27fbfa['where'][_0x79ed('0x9b')]=_0x390832['id'];if(_0x13eb09['query']['filter']){_0x27fbfa[_0x79ed('0x56')]=_[_0x79ed('0x81')](_0x27fbfa[_0x79ed('0x56')],{'$or':_[_0x79ed('0x6a')](_0x27fbfa[_0x79ed('0x7d')],function(_0x30d40a){var _0x1e9c13={};_0x1e9c13[_0x30d40a]={'$like':'%'+_0x13eb09[_0x79ed('0x61')][_0x79ed('0x80')]+'%'};return _0x1e9c13;})});}_0x27fbfa=_[_0x79ed('0x81')]({},_0x27fbfa,_0x13eb09[_0x79ed('0x82')]);return db[_0x79ed('0x44')][_0x79ed('0x9c')]({'where':_0x27fbfa[_0x79ed('0x56')]})[_0x79ed('0x1b')](function(_0x26ddc3){_0x22c016['count']=_0x26ddc3;if(_0x13eb09[_0x79ed('0x61')][_0x79ed('0x9d')]){_0x27fbfa[_0x79ed('0x9e')]=[{'all':!![]}];}return db[_0x79ed('0x44')][_0x79ed('0x1f')](_0x27fbfa);})['then'](function(_0x391702){_0x22c016[_0x79ed('0x9f')]=_0x391702;return _0x22c016;});}})[_0x79ed('0x1b')](respondWithFilteredResult(_0x467c3b,_0x27fbfa))[_0x79ed('0x23')](handleError(_0x467c3b,null));};exports[_0x79ed('0xa1')]=function(_0x5dc966,_0x12784b){var _0x39ca7b={'raw':!![],'where':{}};var _0x3d10f4={};var _0xe46fbb={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x5dc966['params']['id']}})['then'](handleEntityNotFound(_0x12784b,null))[_0x79ed('0x1b')](function(_0x2df02d){if(_0x2df02d){_0x3d10f4[_0x79ed('0x78')]=_[_0x79ed('0x25')](db[_0x79ed('0x4b')][_0x79ed('0x79')]);_0x3d10f4[_0x79ed('0x61')]=_[_0x79ed('0x25')](_0x5dc966[_0x79ed('0x61')]);_0x3d10f4[_0x79ed('0x7a')]=_[_0x79ed('0x7b')](_0x3d10f4['model'],_0x3d10f4['query']);_0x39ca7b[_0x79ed('0x7d')]=_[_0x79ed('0x7b')](_0x3d10f4[_0x79ed('0x78')],qs[_0x79ed('0x7c')](_0x5dc966['query'][_0x79ed('0x7c')]));_0x39ca7b['attributes']=_0x39ca7b[_0x79ed('0x7d')][_0x79ed('0x31')]?_0x39ca7b[_0x79ed('0x7d')]:_0x3d10f4[_0x79ed('0x78')];if(!_0x5dc966[_0x79ed('0x61')][_0x79ed('0x2f')]('nolimit')){_0x39ca7b[_0x79ed('0x15')]=qs[_0x79ed('0x15')](_0x5dc966[_0x79ed('0x61')]['limit']);_0x39ca7b['offset']=qs[_0x79ed('0x13')](_0x5dc966['query'][_0x79ed('0x13')]);}_0x39ca7b[_0x79ed('0x7e')]=qs[_0x79ed('0x7f')](_0x5dc966[_0x79ed('0x61')][_0x79ed('0x7f')]);_0x39ca7b[_0x79ed('0x56')]=qs['filters'](_[_0x79ed('0x9a')](_0x5dc966[_0x79ed('0x61')],_0x3d10f4[_0x79ed('0x7a')]));_0x39ca7b[_0x79ed('0x56')]['ContactId']=_0x2df02d['id'];if(_0x5dc966[_0x79ed('0x61')]['filter']){_0x39ca7b[_0x79ed('0x56')]=_[_0x79ed('0x81')](_0x39ca7b[_0x79ed('0x56')],{'$or':_[_0x79ed('0x6a')](_0x39ca7b[_0x79ed('0x7d')],function(_0x49e666){var _0x5a64c8={};_0x5a64c8[_0x49e666]={'$like':'%'+_0x5dc966[_0x79ed('0x61')][_0x79ed('0x80')]+'%'};return _0x5a64c8;})});}_0x39ca7b=_[_0x79ed('0x81')]({},_0x39ca7b,_0x5dc966['options']);return db[_0x79ed('0x4b')][_0x79ed('0x9c')]({'where':_0x39ca7b[_0x79ed('0x56')]})[_0x79ed('0x1b')](function(_0x2928df){_0xe46fbb[_0x79ed('0x9c')]=_0x2928df;if(_0x5dc966[_0x79ed('0x61')][_0x79ed('0x9d')]){_0x39ca7b[_0x79ed('0x9e')]=[{'all':!![]}];}return db[_0x79ed('0x4b')][_0x79ed('0x1f')](_0x39ca7b);})[_0x79ed('0x1b')](function(_0x48ee93){_0xe46fbb[_0x79ed('0x9f')]=_0x48ee93;return _0xe46fbb;});}})[_0x79ed('0x1b')](respondWithFilteredResult(_0x12784b,_0x39ca7b))[_0x79ed('0x23')](handleError(_0x12784b,null));};exports['uploadCsv']=function(_0x193e1c,_0x348292){try{if(!_0x193e1c[_0x79ed('0x30')][_0x79ed('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x193e1c['body'][_0x79ed('0xa2')]){throw new Error(_0x79ed('0xa3'));}if(!_0x193e1c[_0x79ed('0x30')]['binding_values']){throw new Error(_0x79ed('0xa4'));}if(!_0x193e1c['body'][_0x79ed('0xa5')]){throw new Error(_0x79ed('0xa6'));}var _0x34fc70=_0x193e1c['body'][_0x79ed('0xa2')][_0x79ed('0xa7')](',');var _0x1f543e=_0x193e1c[_0x79ed('0x30')][_0x79ed('0xa8')][_0x79ed('0xa7')](',');if(!_0x34fc70['length']||!_0x1f543e[_0x79ed('0x31')]||_0x34fc70[_0x79ed('0x31')]!==_0x1f543e['length']){throw new Error(_0x79ed('0xa9'));}_0x193e1c[_0x79ed('0x30')][_0x79ed('0x7c')]=_[_0x79ed('0xaa')](_0x34fc70,_0x1f543e);if(!_0x193e1c[_0x79ed('0x30')]['fields'][_0x79ed('0x76')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x193e1c[_0x79ed('0x30')][_0x79ed('0x7c')][_0x79ed('0xab')]){throw new Error(_0x79ed('0xac'));}var _0x62d9ad=path[_0x79ed('0x35')](config[_0x79ed('0xad')],'server/files/tmp',_0x193e1c['file']['filename']);fs[_0x79ed('0xae')](_0x62d9ad,parseInt('0777',0x8));var _0x2fa961=require(_0x79ed('0xaf'))['fork'](path[_0x79ed('0x35')](__dirname,'../../components/import/cm/csv'),[_0x62d9ad,_0x193e1c['body'][_0x79ed('0xa2')],_0x193e1c[_0x79ed('0x30')][_0x79ed('0xa8')],_0x193e1c[_0x79ed('0x30')][_0x79ed('0x59')],_0x193e1c['body'][_0x79ed('0xb0')],_0x193e1c['body'][_0x79ed('0x55')],_0x193e1c['body']['socket_timestamp']]);return _0x348292['status'](0xc8)['json']({'message':_0x79ed('0xb1'),'pid':_0x2fa961[_0x79ed('0xb2')]});}catch(_0x134c5c){return _0x348292[_0x79ed('0x12')](0x1f4)[_0x79ed('0x1d')](_0x134c5c);}};exports[_0x79ed('0xb3')]=function(_0x1e4829,_0x319d98){var _0x4856cd=fs['createReadStream'](_0x1e4829['file'][_0x79ed('0x3')]);Papa[_0x79ed('0xb4')](_0x4856cd,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2cefe4){return _0x319d98[_0x79ed('0x12')](0xc8)[_0x79ed('0x18')]({'file':_0x1e4829['file'],'fields':_0x2cefe4['meta'][_0x79ed('0x7c')]});}});};exports[_0x79ed('0xb5')]=function(_0x10e921,_0x526f59){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x79ed('0xb6')}})['then'](function(_0x6b96b3){var _0x302dc5=![];if(!_0x10e921[_0x79ed('0x30')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x10e921[_0x79ed('0x30')][_0x79ed('0xb7')][_0x79ed('0x76')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x10e921[_0x79ed('0x30')]['binding']['firstName']){throw new Error(_0x79ed('0xac'));}if(!_0x10e921[_0x79ed('0x30')][_0x79ed('0xa5')]){throw new Error(_0x79ed('0xa6'));}var _0xb91e4d=require(_0x79ed('0xaf'))[_0x79ed('0xb8')](path[_0x79ed('0x35')](__dirname,_0x79ed('0xb9')),[_0x10e921['params']['id'],JSON[_0x79ed('0xba')](_0x10e921[_0x79ed('0x30')]),JSON[_0x79ed('0xba')](_0x6b96b3)]);_0xb91e4d['on'](_0x79ed('0xbb'),function(){_0x302dc5=!![];return _0x526f59[_0x79ed('0x12')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0xb91e4d[_0x79ed('0xb2')]});});_0xb91e4d['on'](_0x79ed('0xbc'),function(_0x4ada24){if(_0x4ada24&&!_0x302dc5){return _0x526f59[_0x79ed('0x12')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0xb91e4d[_0x79ed('0xb2')]});}});})['catch'](handleError(_0x526f59,null));};exports[_0x79ed('0xbd')]=function(_0xa6a29a,_0x7c6a0f){return db[_0x79ed('0xbe')][_0x79ed('0x1f')]({'raw':!![],'attributes':['id'],'where':{'role':_0x79ed('0xb6')}})[_0x79ed('0x1b')](function(_0x4ac0c4){var _0x48c9cc=![];if(!_0xa6a29a[_0x79ed('0x30')][_0x79ed('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0xa6a29a['body'][_0x79ed('0xb7')][_0x79ed('0x76')]){throw new Error(_0x79ed('0xbf'));}if(!_0xa6a29a[_0x79ed('0x30')][_0x79ed('0xb7')]['firstName']){throw new Error(_0x79ed('0xac'));}if(!_0xa6a29a['body'][_0x79ed('0xa5')]){throw new Error(_0x79ed('0xa6'));}var _0x38eed9=require('child_process')[_0x79ed('0xb8')](path['join'](__dirname,'../../components/import/cm/csvUpdates'),[_0xa6a29a[_0x79ed('0x22')]['id'],JSON[_0x79ed('0xba')](_0xa6a29a[_0x79ed('0x30')]),JSON['stringify'](_0x4ac0c4)]);_0x38eed9['on'](_0x79ed('0xbb'),function(){_0x48c9cc=!![];return _0x7c6a0f[_0x79ed('0x12')](0xc8)[_0x79ed('0x18')]({'message':_0x79ed('0xc0'),'pid':_0x38eed9[_0x79ed('0xb2')]});});_0x38eed9['on'](_0x79ed('0xbc'),function(_0x1cbcea){if(_0x1cbcea&&!_0x48c9cc){return _0x7c6a0f[_0x79ed('0x12')](0x1f4)[_0x79ed('0x18')]({'message':_0x79ed('0xc1'),'pid':_0x38eed9['pid']});}});})[_0x79ed('0x23')](handleError(_0x7c6a0f,null));};exports[_0x79ed('0xc2')]=function(_0x59ea5d,_0x586fe1){var _0x24144a=['mail',_0x79ed('0xc3'),'sms',_0x79ed('0xc4'),_0x79ed('0xc5'),_0x79ed('0xc6'),_0x79ed('0xc7')];var _0x54c78d={'offset':0x0,'order':qs['sort'](_0x79ed('0xc8'))},_0x1cee71={'count':0x0,'rows':[]};Promise[_0x79ed('0xc9')]()[_0x79ed('0x1b')](function(){if(_0x59ea5d[_0x79ed('0x61')][_0x79ed('0xca')]){if(!_[_0x79ed('0xcb')](_0x24144a,_0x59ea5d[_0x79ed('0x61')]['channel'][_0x79ed('0xcc')]())){throw new Error(_0x79ed('0xcd'));}_0x24144a=[_0x59ea5d[_0x79ed('0x61')]['channel'][_0x79ed('0xcc')]()];}if(_0x59ea5d[_0x79ed('0x61')][_0x79ed('0xce')]){try{var _0x51bb93=JSON['parse'](_0x59ea5d[_0x79ed('0x61')][_0x79ed('0xce')]);if(!moment(_0x51bb93[_0x79ed('0x36')])[_0x79ed('0xcf')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x51bb93['to'])['isValid']()){throw new Error(_0x79ed('0xd0'));}}catch(_0xddbefe){throw new Error(_0x79ed('0xd1'));}}if(!_0x59ea5d['query'][_0x79ed('0x2f')](_0x79ed('0x83'))){_0x54c78d['limit']=qs['limit'](_0x59ea5d[_0x79ed('0x61')][_0x79ed('0x15')]||0xa);_0x54c78d[_0x79ed('0x13')]=qs[_0x79ed('0x13')](_0x59ea5d['query']['offset']);}var _0x16de92=_0x24144a[_0x79ed('0x6a')](function(_0x268dba){if(_0x268dba===_0x79ed('0xc7')){var _0x3e399f={'attributes':['id','uniqueid',_0x79ed('0xd2'),_0x79ed('0xd3'),_0x79ed('0xd4'),_0x79ed('0xd5'),_0x79ed('0xd6'),_0x79ed('0xd7'),'duration',_0x79ed('0xd8'),_0x79ed('0xd9'),'userDisposition',_0x79ed('0xda'),'userThirdDisposition',_0x79ed('0xdb')],'where':{'ContactId':_0x59ea5d[_0x79ed('0x22')]['id']},'include':[{'model':db['User'],'as':_0x79ed('0xbe'),'attributes':['id',_0x79ed('0x5f'),_0x79ed('0xdc'),_0x79ed('0x2b')]}],'order':[['createdAt','DESC']]};if(_0x59ea5d['query'][_0x79ed('0xce')]){_0x3e399f[_0x79ed('0x56')][_0x79ed('0xd9')]={'$gte':_0x51bb93[_0x79ed('0x36')],'$lte':_0x51bb93['to']};}return db[_0x79ed('0x46')][_0x79ed('0xdd')](_0x3e399f)[_0x79ed('0x1b')](function(_0x2760fb){_0x1cee71['count']+=_0x2760fb[_0x79ed('0x9c')];return _['map'](_0x2760fb[_0x79ed('0x9f')],function(_0x20b1e5){var _0x25e09e=_0x20b1e5['get']({'plain':!![]});_0x25e09e[_0x79ed('0xca')]=_0x268dba;if(_0x25e09e[_0x79ed('0xbe')]){_0x25e09e['User']={'id':_0x25e09e['User']['id'],'name':_0x25e09e[_0x79ed('0xbe')][_0x79ed('0x5f')],'fullname':_0x25e09e[_0x79ed('0xbe')][_0x79ed('0xdc')],'alias':_0x25e09e[_0x79ed('0xbe')][_0x79ed('0x2b')]};}return _0x25e09e;});});}else{var _0x172c00=_[_0x79ed('0xde')](_0x268dba)+(_0x268dba==='chat'?_0x79ed('0xdf'):_0x79ed('0xe0'));var _0x50e955={'attributes':['id',_0x79ed('0xe1'),_0x79ed('0xe2'),_0x79ed('0xd9'),_0x79ed('0xd8'),_0x79ed('0xe3'),_0x79ed('0xe4'),_0x79ed('0xe5'),_0x79ed('0xdb'),_0x172c00+'Id'],'where':{'ContactId':_0x59ea5d['params']['id']},'include':[{'model':db[_0x172c00],'as':_0x79ed('0xe0'),'attributes':['id',_0x79ed('0x5f'),_0x79ed('0xe6')]},{'model':db[_0x79ed('0xbe')],'as':'Owner','attributes':['id',_0x79ed('0x5f'),_0x79ed('0xdc')]},{'model':db[_0x79ed('0x5d')],'as':_0x79ed('0x5e'),'attributes':['id',_0x79ed('0x5f'),_0x79ed('0x60')],'through':{'attributes':[]}}],'order':[[_0x79ed('0xd9'),_0x79ed('0xe7')]]};if(_0x59ea5d['query'][_0x79ed('0xce')]){_0x50e955[_0x79ed('0x56')]['createdAt']={'$gte':_0x51bb93[_0x79ed('0x36')],'$lte':_0x51bb93['to']};}switch(_0x268dba){case _0x79ed('0xc3'):_0x50e955[_0x79ed('0x7d')]['push'](_0x79ed('0xe8'),_0x79ed('0xe9'),_0x79ed('0xea'),_0x79ed('0xeb'),_0x79ed('0xec'),_0x79ed('0xed'),_0x79ed('0xee'),_0x79ed('0xef'),'referer');break;case _0x79ed('0xf0'):_0x50e955['attributes']['push'](_0x79ed('0xf1'),_0x79ed('0xf2'));break;case _0x79ed('0xc4'):_0x50e955['attributes'][_0x79ed('0x58')](_0x79ed('0xf3'),_0x79ed('0xf4'));break;}return db[_[_0x79ed('0xde')](_0x268dba)+_0x79ed('0xf5')][_0x79ed('0xdd')](_0x50e955)['then'](function(_0x48d04f){_0x1cee71[_0x79ed('0x9c')]+=_0x48d04f['count'];return _[_0x79ed('0x6a')](_0x48d04f[_0x79ed('0x9f')],function(_0x44ca0a){var _0x4f32d6=_0x44ca0a[_0x79ed('0x32')]({'plain':!![]});_0x4f32d6[_0x79ed('0xca')]=_0x268dba;if(_0x4f32d6[_0x79ed('0xf6')]){_0x4f32d6[_0x79ed('0xf6')]={'id':_0x4f32d6[_0x79ed('0xf6')]['id'],'name':_0x4f32d6[_0x79ed('0xf6')][_0x79ed('0x5f')],'fullname':_0x4f32d6[_0x79ed('0xf6')]['fullname']};}return _0x4f32d6;});});}});return Promise['all'](_0x16de92);})['then'](function(_0x3f78f7){return _(_0x3f78f7)['flatten']()[_0x79ed('0xf7')](_0x79ed('0xd9'))[_0x79ed('0xf8')]()[_0x79ed('0xf9')]();})[_0x79ed('0x1b')](function(_0x4ffa0b){_0x1cee71['rows']=_0x54c78d[_0x79ed('0x15')]?_0x4ffa0b['slice'](_0x54c78d[_0x79ed('0x13')],_0x54c78d['offset']+_0x54c78d['limit']):_0x4ffa0b;return _0x1cee71;})['then'](respondWithFilteredResult(_0x586fe1,_0x54c78d))[_0x79ed('0x23')](handleError(_0x586fe1,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad58=['hook','exports','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xad58,0x1ec));var _0x8ad5=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0xad58[_0x96b6a];return _0x3e16f3;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x8ad5('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ad5('0x1'),'afterDestroy':_0x8ad5('0x2')};function emitEvent(_0x1f8c50){return function(_0x4f6dc6,_0x467b34,_0xc7e608){CmContactEvents[_0x8ad5('0x3')](_0x1f8c50+':'+_0x4f6dc6['id'],_0x4f6dc6);CmContactEvents[_0x8ad5('0x3')](_0x1f8c50,_0x4f6dc6);_0xc7e608(null);};}for(var e in events){if(events[_0x8ad5('0x4')](e)){var event=events[e];CmContact[_0x8ad5('0x5')](e,emitEvent(event));}}module[_0x8ad5('0x6')]=CmContactEvents;
\ No newline at end of file
+var _0x374a=['CmContact','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x12d0bb,_0x56430a){var _0x44e5af=function(_0x1c0db0){while(--_0x1c0db0){_0x12d0bb['push'](_0x12d0bb['shift']());}};_0x44e5af(++_0x56430a);}(_0x374a,0x187));var _0xa374=function(_0x223826,_0x5a9b25){_0x223826=_0x223826-0x0;var _0x2a6329=_0x374a[_0x223826];return _0x2a6329;};'use strict';var EventEmitter=require(_0xa374('0x0'));var CmContact=require('../../mysqldb')['db'][_0xa374('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xa374('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa374('0x3'),'afterDestroy':_0xa374('0x4')};function emitEvent(_0x1fdb5f){return function(_0x59a9c6,_0x55e7ca,_0xcb702e){CmContactEvents['emit'](_0x1fdb5f+':'+_0x59a9c6['id'],_0x59a9c6);CmContactEvents[_0xa374('0x5')](_0x1fdb5f,_0x59a9c6);_0xcb702e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xa374('0x6')](e,emitEvent(event));}}module[_0xa374('0x7')]=CmContactEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17b3=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','Campaign','add','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','message','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','define','cm_contacts','fti_cm_contacts','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','then','isNil','timezones','utcOffset','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','phone','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch'];(function(_0x2c887f,_0x35ec5a){var _0x448b2e=function(_0x195483){while(--_0x195483){_0x2c887f['push'](_0x2c887f['shift']());}};_0x448b2e(++_0x35ec5a);}(_0x17b3,0x68));var _0x317b=function(_0x159aa2,_0x24eb0b){_0x159aa2=_0x159aa2-0x0;var _0x3a8e1e=_0x17b3[_0x159aa2];return _0x3a8e1e;};'use strict';var _=require(_0x317b('0x0'));var util=require(_0x317b('0x1'));var logger=require(_0x317b('0x2'))(_0x317b('0x3'));var moment=require(_0x317b('0x4'));var BPromise=require('bluebird');var rp=require(_0x317b('0x5'));var fs=require('fs');var path=require(_0x317b('0x6'));var rimraf=require(_0x317b('0x7'));var config=require(_0x317b('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x317b('0x9'));module['exports']=function(_0x379ff3,_0x50b8e5){return _0x379ff3[_0x317b('0xa')]('CmContact',attributes,{'tableName':_0x317b('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x317b('0xc'),'fields':['firstName','lastName','phone',_0x317b('0xd'),_0x317b('0xe'),'email'],'type':_0x317b('0xf')}],'timestamps':!![],'charset':_0x317b('0x10'),'collate':_0x317b('0x11'),'hooks':{'afterCreate':function(_0x2c0058,_0x2f1c13,_0xa2f089){var _0x5d4444=_0x379ff3['models'];var _0x247670=_0x2c0058[_0x317b('0x12')]({'plain':!![]});function _0x9dee0a(){return function(_0x32a0e8){logger[_0x317b('0x13')](_0x317b('0x14'),_0x317b('0x15'),util[_0x317b('0x16')](_0x32a0e8,{'showHidden':![],'depth':null}));};}function _0x27bb62(_0xd9f8fc,_0x595269){var _0x2543f9=_0x595269[_0x317b('0x17')]?_0x595269[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19'));return new BPromise(function(_0x3429c0,_0x27a0a3){if(_['isNil'](_0x595269[_0x317b('0x1a')])){_0x3429c0({'ret':_0x2543f9});}else{_0x5d4444['VoiceQueue']['findOne']({'where':{'id':_0xd9f8fc['id']}})[_0x317b('0x1b')](function(_0x5932a5){if(!_[_0x317b('0x1c')](_0x5932a5)){var _0x3c30c4=_0x5932a5['dialTimezone'];if(!_[_0x317b('0x1c')](_0x3c30c4)){var _0xd15f8a=shared[_0x317b('0x1d')];var _0x7db3e4=_0xd15f8a[_0x3c30c4];var _0x117ebd=_0xd15f8a[_0x595269[_0x317b('0x1a')]];if(!_[_0x317b('0x1c')](_0x7db3e4)&&!_[_0x317b('0x1c')](_0x117ebd)){var _0x1a8a66=_0x7db3e4[_0x317b('0x1e')]-_0x117ebd[_0x317b('0x1e')];_0x2543f9=_0x595269[_0x317b('0x17')]?_0x595269[_0x317b('0x17')]:moment();var _0x3d0a9e=moment(_0x2543f9)['add'](_0x1a8a66,'minutes');_0x3429c0({'ret':_0x3d0a9e[_0x317b('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x3429c0({'ret':_0x2543f9});}else _0x3429c0({'ret':_0x2543f9});}else{_0x3429c0({'ret':_0x2543f9});}});}});return 0xa;}var _0x58532e=function(_0x1a7c74){return new BPromise(function(_0x48e8db,_0x11f5b5){_0x27bb62(_0x1a7c74,_0x247670)['then'](function(_0x453ce5){_0x247670[_0x317b('0x17')]=_0x453ce5[_0x317b('0x1f')];_0x5d4444[_0x317b('0x20')][_0x317b('0x21')]({'where':{'phone':_0x247670['phone'],'VoiceQueueId':_0x1a7c74['id']}})['then'](function(_0x72356c){if(!_[_0x317b('0x1c')](_0x72356c)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+_0x317b('0x24')+_0x1a7c74['id']);}return _0x5d4444['CmHopper'][_0x317b('0x25')]({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670[_0x317b('0x27')]?_0x247670[_0x317b('0x27')]:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19')),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670['callbackUniqueid']?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'VoiceQueueId':_0x1a7c74['id']});})[_0x317b('0x29')](function(_0x1991f8){_0x11f5b5(_0x1991f8);});});});};var _0x3d7eff=function(_0xd2ab6f){return new BPromise(function(_0x47c667,_0x268f28){_0x27bb62(_0xd2ab6f,_0x247670)['then'](function(_0x4a51f9){_0x247670['scheduledat']=_0x4a51f9['ret'];_0x5d4444[_0x317b('0x20')][_0x317b('0x21')]({'where':{'phone':_0x247670[_0x317b('0x23')],'VoiceQueueId':_0xd2ab6f['id']}})[_0x317b('0x1b')](function(_0x3fe9af){if(!_[_0x317b('0x1c')](_0x3fe9af)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+_0x317b('0x2a')+_0xd2ab6f['id']);}return _0x5d4444['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x247670['phone'],'VoiceQueueId':_0xd2ab6f['id']}});})[_0x317b('0x1b')](function(_0x1dacbd){if(!_['isNil'](_0x1dacbd)){throw new Error(_0x317b('0x2b')+_0x247670[_0x317b('0x23')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0xd2ab6f['id']);}return _0x5d4444[_0x317b('0x20')]['create']({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670[_0x317b('0x27')]?_0x247670['priority']:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19')),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670['callbackUniqueid']?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'VoiceQueueId':_0xd2ab6f['id']});})[_0x317b('0x29')](function(_0x40e4fb){_0x268f28(_0x40e4fb);});});});};function _0x4a11a0(){return function(_0x3b4713){logger[_0x317b('0x13')]('cmContact','afterCreate',util[_0x317b('0x16')](_0x3b4713,{'showHidden':![],'depth':null}));};}function _0x5c219e(_0x8c7362,_0x5b6cba){var _0x323ea8=_0x5b6cba[_0x317b('0x17')]?_0x5b6cba[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19'));return new BPromise(function(_0x8d47a3,_0x1e911d){if(_[_0x317b('0x1c')](_0x5b6cba[_0x317b('0x1a')])){_0x8d47a3({'ret':_0x323ea8});}else{_0x5d4444[_0x317b('0x2c')][_0x317b('0x21')]({'where':{'id':_0x8c7362['id']}})[_0x317b('0x1b')](function(_0xd9b063){if(!_['isNil'](_0xd9b063)){var _0x3b037b=_0xd9b063[_0x317b('0x1a')];if(!_[_0x317b('0x1c')](_0x3b037b)){var _0xcbdd13=shared[_0x317b('0x1d')];var _0x3f247d=_0xcbdd13[_0x3b037b];var _0x3df8cc=_0xcbdd13[_0x5b6cba[_0x317b('0x1a')]];if(!_['isNil'](_0x3f247d)&&!_[_0x317b('0x1c')](_0x3df8cc)){var _0x46c6a3=_0x3f247d['utcOffset']-_0x3df8cc[_0x317b('0x1e')];_0x323ea8=_0x5b6cba['scheduledat']?_0x5b6cba['scheduledat']:moment();var _0x4f9180=moment(_0x323ea8)[_0x317b('0x2d')](_0x46c6a3,_0x317b('0x2e'));_0x8d47a3({'ret':_0x4f9180[_0x317b('0x18')](_0x317b('0x19'))});}else _0x8d47a3({'ret':_0x323ea8});}else _0x8d47a3({'ret':_0x323ea8});}else{_0x8d47a3({'ret':_0x323ea8});}});}});return 0xa;}var _0x22e617=function(_0x478d32){return new BPromise(function(_0x3841bd,_0x4f200c){_0x5c219e(_0x478d32,_0x247670)[_0x317b('0x1b')](function(_0x26e988){_0x247670[_0x317b('0x17')]=_0x26e988['ret'];_0x5d4444[_0x317b('0x20')]['findOne']({'where':{'phone':_0x247670[_0x317b('0x23')],'CampaignId':_0x478d32['id']}})[_0x317b('0x1b')](function(_0x15f123){if(!_['isNil'](_0x15f123)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x478d32['id']);}return _0x5d4444[_0x317b('0x20')][_0x317b('0x25')]({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670['priority']?_0x247670[_0x317b('0x27')]:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')](_0x317b('0x19')),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()['format'](_0x317b('0x19')):undefined,'CampaignId':_0x478d32['id']});})[_0x317b('0x29')](function(_0x46c7b3){_0x4f200c(_0x46c7b3);});});});};var _0x205565=function(_0x5722e2){return new BPromise(function(_0x3d0a67,_0x406fb6){_0x5c219e(_0x5722e2,_0x247670)[_0x317b('0x1b')](function(_0xd20281){_0x247670[_0x317b('0x17')]=_0xd20281[_0x317b('0x1f')];_0x5d4444[_0x317b('0x20')][_0x317b('0x21')]({'where':{'phone':_0x247670[_0x317b('0x23')],'CampaignId':_0x5722e2['id']}})[_0x317b('0x1b')](function(_0x439123){if(!_[_0x317b('0x1c')](_0x439123)){throw new Error(_0x317b('0x22')+_0x247670[_0x317b('0x23')]+_0x317b('0x2f')+_0x5722e2['id']);}return _0x5d4444[_0x317b('0x30')][_0x317b('0x21')]({'where':{'calleridnum':_0x247670['phone'],'CampaignId':_0x5722e2['id']}});})[_0x317b('0x1b')](function(_0x1c72b0){if(!_[_0x317b('0x1c')](_0x1c72b0)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x247670[_0x317b('0x23')]+_0x317b('0x31')+_0x5722e2['id']);}return _0x5d4444['CmHopper']['create']({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'priority':_0x247670[_0x317b('0x27')]?_0x247670['priority']:0x2,'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670['callbackUniqueid']:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5722e2['id']});})[_0x317b('0x29')](function(_0x3694dd){_0x406fb6(_0x3694dd);});});});};if(_0x247670['ListId']){_0x5d4444[_0x317b('0x32')][_0x317b('0x33')]({'where':{'type':_0x317b('0x34')},'attributes':['id','dialCheckDuplicateType',_0x317b('0x1a')],'include':[{'model':_0x5d4444[_0x317b('0x35')],'as':_0x317b('0x36'),'where':{'id':_0x247670[_0x317b('0x26')]}}]})[_0x317b('0x1b')](function(_0xa62679){if(_0xa62679){var _0x273911=[];for(var _0x2240b2=0x0,_0x19266a;_0x2240b2<_0xa62679[_0x317b('0x37')];_0x2240b2+=0x1){_0x19266a=_0xa62679[_0x2240b2][_0x317b('0x12')]({'plain':!![]});switch(_0x19266a[_0x317b('0x38')]){case _0x317b('0x39'):_0x3d7eff(_0x19266a)['catch'](_0x9dee0a());break;case _0x317b('0x3a'):_0x58532e(_0x19266a)['catch'](_0x9dee0a());break;default:_0x5c219e(_0x19266a,_0x247670)[_0x317b('0x1b')](function(_0x2122c5){_0x247670[_0x317b('0x17')]=_0x2122c5[_0x317b('0x1f')];_0x5d4444[_0x317b('0x20')]['create']({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670['scheduledat']:moment()[_0x317b('0x18')](_0x317b('0x19')),'priority':_0x247670[_0x317b('0x27')]?_0x247670[_0x317b('0x27')]:0x2,'callback':_0x247670['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670[_0x317b('0x28')]:undefined,'callbackat':_0x247670[_0x317b('0x28')]?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'VoiceQueueId':_0x19266a['id']})[_0x317b('0x29')](_0x9dee0a());});}}}})['then'](function(){return _0x5d4444[_0x317b('0x32')][_0x317b('0x33')]({'where':{'type':_0x317b('0x34')},'attributes':['id'],'include':[{'model':_0x5d4444[_0x317b('0x35')],'as':_0x317b('0x3b'),'where':{'id':_0x247670['ListId']}}]})[_0x317b('0x1b')](function(_0x594eac){if(_0x594eac){var _0x362fc3=[];for(var _0x1c0397=0x0,_0x2b9fe2;_0x1c0397<_0x594eac[_0x317b('0x37')];_0x1c0397+=0x1){_0x2b9fe2=_0x594eac[_0x1c0397][_0x317b('0x12')]({'plain':!![]});_0x5d4444['CmHopperBlack'][_0x317b('0x25')]({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'VoiceQueueId':_0x2b9fe2['id']})['catch'](function(_0x45c5d0){logger[_0x317b('0x13')](_0x317b('0x3c'),'afterCreate',_0x45c5d0[_0x317b('0x3d')]);});}}});})[_0x317b('0x1b')](function(){return _0x5d4444[_0x317b('0x2c')][_0x317b('0x33')]({'attributes':['id','dialCheckDuplicateType',_0x317b('0x1a')],'include':[{'model':_0x5d4444['CmList'],'as':_0x317b('0x36'),'where':{'id':_0x247670[_0x317b('0x26')]}}]})[_0x317b('0x1b')](function(_0x5e850b){if(_0x5e850b){var _0x117e25=[];for(var _0x5128e8=0x0,_0xcba1d8;_0x5128e8<_0x5e850b[_0x317b('0x37')];_0x5128e8+=0x1){_0xcba1d8=_0x5e850b[_0x5128e8][_0x317b('0x12')]({'plain':!![]});switch(_0xcba1d8[_0x317b('0x38')]){case _0x317b('0x39'):_0x205565(_0xcba1d8)[_0x317b('0x29')](_0x4a11a0());break;case _0x317b('0x3a'):_0x22e617(_0xcba1d8)[_0x317b('0x29')](_0x4a11a0());break;default:_0x5d4444[_0x317b('0x20')][_0x317b('0x25')]({'phone':_0x247670['phone'],'ContactId':_0x247670['id'],'ListId':_0x247670[_0x317b('0x26')],'scheduledat':_0x247670[_0x317b('0x17')]?_0x247670[_0x317b('0x17')]:moment()[_0x317b('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x247670['priority']?_0x247670['priority']:0x2,'callback':_0x247670[_0x317b('0x28')]?!![]:![],'callbackuniqueid':_0x247670[_0x317b('0x28')]?_0x247670['callbackUniqueid']:undefined,'callbackat':_0x247670['callbackUniqueid']?moment()[_0x317b('0x18')](_0x317b('0x19')):undefined,'CampaignId':_0xcba1d8['id']})[_0x317b('0x29')](_0x4a11a0());}}}});})['then'](function(){return _0x5d4444[_0x317b('0x2c')]['findAll']({'attributes':['id'],'include':[{'model':_0x5d4444['CmList'],'as':_0x317b('0x3b'),'where':{'id':_0x247670['ListId']}}]})[_0x317b('0x1b')](function(_0x240674){if(_0x240674){var _0x41ab5f=[];for(var _0x3d2d3b=0x0,_0xbcddc9;_0x3d2d3b<_0x240674[_0x317b('0x37')];_0x3d2d3b+=0x1){_0xbcddc9=_0x240674[_0x3d2d3b][_0x317b('0x12')]({'plain':!![]});_0x5d4444[_0x317b('0x3e')][_0x317b('0x25')]({'phone':_0x247670[_0x317b('0x23')],'ContactId':_0x247670['id'],'ListId':_0x247670['ListId'],'CampaignId':_0xbcddc9['id']})[_0x317b('0x29')](function(_0x104166){logger[_0x317b('0x13')](_0x317b('0x3c'),_0x317b('0x15'),_0x104166['message']);});}}});})[_0x317b('0x1b')](function(){_0xa2f089();})[_0x317b('0x29')](function(_0x265bfd){logger[_0x317b('0x13')](_0x317b('0x3c'),_0x317b('0x15'),_0x265bfd['message']);_0xa2f089(_0x265bfd);});}else{_0xa2f089(new Error(_0x317b('0x3f')));}},'afterDestroy':function(_0x55d40e,_0x1a10c9,_0x39d33b){var _0x1ea6ee=_0x379ff3['models'];var _0x301161=_0x55d40e['get']({'plain':!![]});return _0x1ea6ee['CmHopper'][_0x317b('0x33')]({'raw':!![],'where':{'ListId':_0x301161[_0x317b('0x26')],'ContactId':_0x301161['id']}})[_0x317b('0x1b')](function(_0x30bfc5){if(!_[_0x317b('0x40')](_0x30bfc5)){var _0xc411c1=[];for(var _0x497821=0x0;_0x497821<_0x30bfc5[_0x317b('0x37')];_0x497821+=0x1){var _0x3cf4b9=_0x1ea6ee['CmHopper'][_0x317b('0x41')]({'where':{'ListId':_0x30bfc5[_0x497821][_0x317b('0x26')],'ContactId':_0x30bfc5[_0x497821][_0x317b('0x42')],'VoiceQueueId':_0x30bfc5[_0x497821][_0x317b('0x43')],'CampaignId':_0x30bfc5[_0x497821][_0x317b('0x44')]}});_0xc411c1[_0x317b('0x45')](_0x3cf4b9);}return BPromise[_0x317b('0x46')](_0xc411c1);}})[_0x317b('0x1b')](function(_0x2b6f90){logger['info'](_0x317b('0x47'),util[_0x317b('0x16')](_0x2b6f90,{'showHidden':![],'depth':null}));_0x39d33b();})[_0x317b('0x29')](function(_0x164f36){logger[_0x317b('0x13')](_0x317b('0x48'),util[_0x317b('0x16')](_0x164f36,{'showHidden':![],'depth':null}));_0x39d33b(_0x164f36);});}}});};
\ No newline at end of file
+var _0x176d=['callbackUniqueid','catch','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','error','cmContact','Campaign','timezones','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','Lists','length','get','always','outbound','CmList','CmHopperBlack','afterCreate','message','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','inspect','scheduledat','format','isNil','VoiceQueue','findOne','then','dialTimezone','utcOffset','add','YYYY-MM-DD\x20HH:mm:ss','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority'];(function(_0x1c79e3,_0x575c14){var _0x297ad7=function(_0x301e66){while(--_0x301e66){_0x1c79e3['push'](_0x1c79e3['shift']());}};_0x297ad7(++_0x575c14);}(_0x176d,0x1b4));var _0xd176=function(_0x61a85d,_0x5c9285){_0x61a85d=_0x61a85d-0x0;var _0x2b7adb=_0x176d[_0x61a85d];return _0x2b7adb;};'use strict';var _=require(_0xd176('0x0'));var util=require(_0xd176('0x1'));var logger=require(_0xd176('0x2'))(_0xd176('0x3'));var moment=require(_0xd176('0x4'));var BPromise=require(_0xd176('0x5'));var rp=require(_0xd176('0x6'));var fs=require('fs');var path=require(_0xd176('0x7'));var rimraf=require('rimraf');var config=require(_0xd176('0x8'));var shared=require(_0xd176('0x9'));var attributes=require(_0xd176('0xa'));module[_0xd176('0xb')]=function(_0x410fcd,_0x1cfa3d){return _0x410fcd[_0xd176('0xc')](_0xd176('0xd'),attributes,{'tableName':_0xd176('0xe'),'paranoid':!![],'indexes':[{'name':_0xd176('0xf'),'fields':[_0xd176('0xf')]},{'name':_0xd176('0x10'),'fields':['firstName',_0xd176('0x11'),_0xd176('0xf'),_0xd176('0x12'),_0xd176('0x13'),_0xd176('0x14')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xd176('0x15'),'collate':_0xd176('0x16'),'hooks':{'afterCreate':function(_0x1861a9,_0x3510cf,_0x19658b){var _0x2e920b=_0x410fcd['models'];var _0x205460=_0x1861a9['get']({'plain':!![]});function _0x1bd4a3(){return function(_0x410147){logger['error']('cmContact','afterCreate',util[_0xd176('0x17')](_0x410147,{'showHidden':![],'depth':null}));};}function _0x2a7bdc(_0x14a05c,_0x2a6193){var _0x48da57=_0x2a6193[_0xd176('0x18')]?_0x2a6193[_0xd176('0x18')]:moment()[_0xd176('0x19')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x52033e,_0x13cda2){if(_[_0xd176('0x1a')](_0x2a6193['dialTimezone'])){_0x52033e({'ret':_0x48da57});}else{_0x2e920b[_0xd176('0x1b')][_0xd176('0x1c')]({'where':{'id':_0x14a05c['id']}})[_0xd176('0x1d')](function(_0x31c9a5){if(!_['isNil'](_0x31c9a5)){var _0x6b6fa8=_0x31c9a5[_0xd176('0x1e')];if(!_[_0xd176('0x1a')](_0x6b6fa8)){var _0x5c0fef=shared['timezones'];var _0x7fc1d1=_0x5c0fef[_0x6b6fa8];var _0x5b30b0=_0x5c0fef[_0x2a6193[_0xd176('0x1e')]];if(!_['isNil'](_0x7fc1d1)&&!_[_0xd176('0x1a')](_0x5b30b0)){var _0x56a8f1=_0x7fc1d1['utcOffset']-_0x5b30b0[_0xd176('0x1f')];_0x48da57=_0x2a6193[_0xd176('0x18')]?_0x2a6193['scheduledat']:moment();var _0x42aebd=moment(_0x48da57)[_0xd176('0x20')](_0x56a8f1,'minutes');_0x52033e({'ret':_0x42aebd['format'](_0xd176('0x21'))});}else _0x52033e({'ret':_0x48da57});}else _0x52033e({'ret':_0x48da57});}else{_0x52033e({'ret':_0x48da57});}});}});return 0xa;}var _0x19de32=function(_0x186ad3){return new BPromise(function(_0x32e481,_0x46a0bf){_0x2a7bdc(_0x186ad3,_0x205460)[_0xd176('0x1d')](function(_0x53154f){_0x205460[_0xd176('0x18')]=_0x53154f[_0xd176('0x22')];_0x2e920b['CmHopper'][_0xd176('0x1c')]({'where':{'phone':_0x205460[_0xd176('0xf')],'VoiceQueueId':_0x186ad3['id']}})[_0xd176('0x1d')](function(_0x2b9ff3){if(!_['isNil'](_0x2b9ff3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x205460['phone']+_0xd176('0x23')+_0x186ad3['id']);}return _0x2e920b['CmHopper']['create']({'phone':_0x205460[_0xd176('0xf')],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'priority':_0x205460['priority']?_0x205460[_0xd176('0x25')]:0x2,'scheduledat':_0x205460[_0xd176('0x18')]?_0x205460[_0xd176('0x18')]:moment()[_0xd176('0x19')](_0xd176('0x21')),'callback':_0x205460[_0xd176('0x26')]?!![]:![],'callbackuniqueid':_0x205460['callbackUniqueid']?_0x205460[_0xd176('0x26')]:undefined,'callbackat':_0x205460[_0xd176('0x26')]?moment()[_0xd176('0x19')](_0xd176('0x21')):undefined,'VoiceQueueId':_0x186ad3['id']});})[_0xd176('0x27')](function(_0x2928d2){_0x46a0bf(_0x2928d2);});});});};var _0x41a0f3=function(_0x598ad3){return new BPromise(function(_0x2d08b8,_0x3123ba){_0x2a7bdc(_0x598ad3,_0x205460)[_0xd176('0x1d')](function(_0x309f7d){_0x205460[_0xd176('0x18')]=_0x309f7d[_0xd176('0x22')];_0x2e920b[_0xd176('0x28')][_0xd176('0x1c')]({'where':{'phone':_0x205460[_0xd176('0xf')],'VoiceQueueId':_0x598ad3['id']}})[_0xd176('0x1d')](function(_0x3dcbc0){if(!_['isNil'](_0x3dcbc0)){throw new Error(_0xd176('0x29')+_0x205460[_0xd176('0xf')]+_0xd176('0x2a')+_0x598ad3['id']);}return _0x2e920b[_0xd176('0x2b')][_0xd176('0x1c')]({'where':{'calleridnum':_0x205460[_0xd176('0xf')],'VoiceQueueId':_0x598ad3['id']}});})[_0xd176('0x1d')](function(_0x169d39){if(!_[_0xd176('0x1a')](_0x169d39)){throw new Error(_0xd176('0x2c')+_0x205460[_0xd176('0xf')]+_0xd176('0x2d')+_0x598ad3['id']);}return _0x2e920b['CmHopper'][_0xd176('0x2e')]({'phone':_0x205460[_0xd176('0xf')],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'priority':_0x205460[_0xd176('0x25')]?_0x205460[_0xd176('0x25')]:0x2,'scheduledat':_0x205460[_0xd176('0x18')]?_0x205460[_0xd176('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x205460['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x205460[_0xd176('0x26')]?_0x205460[_0xd176('0x26')]:undefined,'callbackat':_0x205460[_0xd176('0x26')]?moment()[_0xd176('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x598ad3['id']});})[_0xd176('0x27')](function(_0x3e80f3){_0x3123ba(_0x3e80f3);});});});};function _0x186dff(){return function(_0x3b1daf){logger[_0xd176('0x2f')](_0xd176('0x30'),'afterCreate',util[_0xd176('0x17')](_0x3b1daf,{'showHidden':![],'depth':null}));};}function _0x300ea6(_0x42a250,_0x5e8c3){var _0x332b61=_0x5e8c3[_0xd176('0x18')]?_0x5e8c3[_0xd176('0x18')]:moment()[_0xd176('0x19')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x58b8a0,_0x279223){if(_['isNil'](_0x5e8c3[_0xd176('0x1e')])){_0x58b8a0({'ret':_0x332b61});}else{_0x2e920b[_0xd176('0x31')][_0xd176('0x1c')]({'where':{'id':_0x42a250['id']}})[_0xd176('0x1d')](function(_0x3e0aee){if(!_[_0xd176('0x1a')](_0x3e0aee)){var _0x36d753=_0x3e0aee[_0xd176('0x1e')];if(!_[_0xd176('0x1a')](_0x36d753)){var _0x59ff20=shared[_0xd176('0x32')];var _0x93e30f=_0x59ff20[_0x36d753];var _0x39182d=_0x59ff20[_0x5e8c3['dialTimezone']];if(!_[_0xd176('0x1a')](_0x93e30f)&&!_[_0xd176('0x1a')](_0x39182d)){var _0x2ac91c=_0x93e30f[_0xd176('0x1f')]-_0x39182d[_0xd176('0x1f')];_0x332b61=_0x5e8c3[_0xd176('0x18')]?_0x5e8c3[_0xd176('0x18')]:moment();var _0xa238d5=moment(_0x332b61)[_0xd176('0x20')](_0x2ac91c,_0xd176('0x33'));_0x58b8a0({'ret':_0xa238d5[_0xd176('0x19')](_0xd176('0x21'))});}else _0x58b8a0({'ret':_0x332b61});}else _0x58b8a0({'ret':_0x332b61});}else{_0x58b8a0({'ret':_0x332b61});}});}});return 0xa;}var _0x11f915=function(_0x430973){return new BPromise(function(_0x17a04f,_0x495bda){_0x300ea6(_0x430973,_0x205460)[_0xd176('0x1d')](function(_0x553610){_0x205460['scheduledat']=_0x553610[_0xd176('0x22')];_0x2e920b[_0xd176('0x28')][_0xd176('0x1c')]({'where':{'phone':_0x205460[_0xd176('0xf')],'CampaignId':_0x430973['id']}})[_0xd176('0x1d')](function(_0x5d57db){if(!_[_0xd176('0x1a')](_0x5d57db)){throw new Error(_0xd176('0x29')+_0x205460[_0xd176('0xf')]+_0xd176('0x34')+_0x430973['id']);}return _0x2e920b['CmHopper'][_0xd176('0x2e')]({'phone':_0x205460[_0xd176('0xf')],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'priority':_0x205460[_0xd176('0x25')]?_0x205460[_0xd176('0x25')]:0x2,'scheduledat':_0x205460['scheduledat']?_0x205460[_0xd176('0x18')]:moment()[_0xd176('0x19')](_0xd176('0x21')),'callback':_0x205460['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x205460[_0xd176('0x26')]?_0x205460[_0xd176('0x26')]:undefined,'callbackat':_0x205460[_0xd176('0x26')]?moment()[_0xd176('0x19')](_0xd176('0x21')):undefined,'CampaignId':_0x430973['id']});})[_0xd176('0x27')](function(_0x5b7e58){_0x495bda(_0x5b7e58);});});});};var _0x362cfe=function(_0x3627cb){return new BPromise(function(_0x45f70f,_0x180075){_0x300ea6(_0x3627cb,_0x205460)[_0xd176('0x1d')](function(_0x1e3ff6){_0x205460[_0xd176('0x18')]=_0x1e3ff6[_0xd176('0x22')];_0x2e920b[_0xd176('0x28')]['findOne']({'where':{'phone':_0x205460[_0xd176('0xf')],'CampaignId':_0x3627cb['id']}})[_0xd176('0x1d')](function(_0x51d282){if(!_[_0xd176('0x1a')](_0x51d282)){throw new Error('cmContact,\x20afterCreate\x20'+_0x205460[_0xd176('0xf')]+_0xd176('0x35')+_0x3627cb['id']);}return _0x2e920b[_0xd176('0x2b')][_0xd176('0x1c')]({'where':{'calleridnum':_0x205460[_0xd176('0xf')],'CampaignId':_0x3627cb['id']}});})['then'](function(_0x5974ef){if(!_['isNil'](_0x5974ef)){throw new Error(_0xd176('0x2c')+_0x205460['phone']+_0xd176('0x36')+_0x3627cb['id']);}return _0x2e920b['CmHopper'][_0xd176('0x2e')]({'phone':_0x205460[_0xd176('0xf')],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'priority':_0x205460['priority']?_0x205460[_0xd176('0x25')]:0x2,'scheduledat':_0x205460[_0xd176('0x18')]?_0x205460[_0xd176('0x18')]:moment()[_0xd176('0x19')](_0xd176('0x21')),'callback':_0x205460['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x205460['callbackUniqueid']?_0x205460[_0xd176('0x26')]:undefined,'callbackat':_0x205460[_0xd176('0x26')]?moment()['format'](_0xd176('0x21')):undefined,'CampaignId':_0x3627cb['id']});})['catch'](function(_0x461f0b){_0x180075(_0x461f0b);});});});};if(_0x205460['ListId']){_0x2e920b['VoiceQueue'][_0xd176('0x37')]({'where':{'type':'outbound'},'attributes':['id',_0xd176('0x38'),_0xd176('0x1e')],'include':[{'model':_0x2e920b['CmList'],'as':_0xd176('0x39'),'where':{'id':_0x205460['ListId']}}]})[_0xd176('0x1d')](function(_0x4eb7d3){if(_0x4eb7d3){var _0x411abb=[];for(var _0x28082c=0x0,_0xcff381;_0x28082c<_0x4eb7d3[_0xd176('0x3a')];_0x28082c+=0x1){_0xcff381=_0x4eb7d3[_0x28082c][_0xd176('0x3b')]({'plain':!![]});switch(_0xcff381[_0xd176('0x38')]){case _0xd176('0x3c'):_0x41a0f3(_0xcff381)['catch'](_0x1bd4a3());break;case'onlyIfOpen':_0x19de32(_0xcff381)[_0xd176('0x27')](_0x1bd4a3());break;default:_0x300ea6(_0xcff381,_0x205460)[_0xd176('0x1d')](function(_0x305882){_0x205460[_0xd176('0x18')]=_0x305882[_0xd176('0x22')];_0x2e920b[_0xd176('0x28')]['create']({'phone':_0x205460[_0xd176('0xf')],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'scheduledat':_0x205460[_0xd176('0x18')]?_0x205460[_0xd176('0x18')]:moment()[_0xd176('0x19')](_0xd176('0x21')),'priority':_0x205460[_0xd176('0x25')]?_0x205460[_0xd176('0x25')]:0x2,'callback':_0x205460[_0xd176('0x26')]?!![]:![],'callbackuniqueid':_0x205460[_0xd176('0x26')]?_0x205460['callbackUniqueid']:undefined,'callbackat':_0x205460['callbackUniqueid']?moment()[_0xd176('0x19')](_0xd176('0x21')):undefined,'VoiceQueueId':_0xcff381['id']})[_0xd176('0x27')](_0x1bd4a3());});}}}})[_0xd176('0x1d')](function(){return _0x2e920b[_0xd176('0x1b')][_0xd176('0x37')]({'where':{'type':_0xd176('0x3d')},'attributes':['id'],'include':[{'model':_0x2e920b[_0xd176('0x3e')],'as':'BlackLists','where':{'id':_0x205460[_0xd176('0x24')]}}]})[_0xd176('0x1d')](function(_0x5729b0){if(_0x5729b0){var _0x204d53=[];for(var _0x171ea0=0x0,_0x4d321b;_0x171ea0<_0x5729b0[_0xd176('0x3a')];_0x171ea0+=0x1){_0x4d321b=_0x5729b0[_0x171ea0]['get']({'plain':!![]});_0x2e920b[_0xd176('0x3f')][_0xd176('0x2e')]({'phone':_0x205460[_0xd176('0xf')],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'VoiceQueueId':_0x4d321b['id']})[_0xd176('0x27')](function(_0x40adf2){logger['error']('cmContact,\x20%s,\x20%s',_0xd176('0x40'),_0x40adf2[_0xd176('0x41')]);});}}});})[_0xd176('0x1d')](function(){return _0x2e920b[_0xd176('0x31')][_0xd176('0x37')]({'attributes':['id',_0xd176('0x38'),_0xd176('0x1e')],'include':[{'model':_0x2e920b[_0xd176('0x3e')],'as':_0xd176('0x39'),'where':{'id':_0x205460[_0xd176('0x24')]}}]})[_0xd176('0x1d')](function(_0x2a0769){if(_0x2a0769){var _0x2ff217=[];for(var _0x234eb2=0x0,_0x980856;_0x234eb2<_0x2a0769[_0xd176('0x3a')];_0x234eb2+=0x1){_0x980856=_0x2a0769[_0x234eb2][_0xd176('0x3b')]({'plain':!![]});switch(_0x980856[_0xd176('0x38')]){case _0xd176('0x3c'):_0x362cfe(_0x980856)[_0xd176('0x27')](_0x186dff());break;case _0xd176('0x42'):_0x11f915(_0x980856)[_0xd176('0x27')](_0x186dff());break;default:_0x2e920b[_0xd176('0x28')][_0xd176('0x2e')]({'phone':_0x205460['phone'],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'scheduledat':_0x205460[_0xd176('0x18')]?_0x205460[_0xd176('0x18')]:moment()[_0xd176('0x19')](_0xd176('0x21')),'priority':_0x205460[_0xd176('0x25')]?_0x205460['priority']:0x2,'callback':_0x205460[_0xd176('0x26')]?!![]:![],'callbackuniqueid':_0x205460[_0xd176('0x26')]?_0x205460[_0xd176('0x26')]:undefined,'callbackat':_0x205460[_0xd176('0x26')]?moment()[_0xd176('0x19')](_0xd176('0x21')):undefined,'CampaignId':_0x980856['id']})[_0xd176('0x27')](_0x186dff());}}}});})[_0xd176('0x1d')](function(){return _0x2e920b[_0xd176('0x31')][_0xd176('0x37')]({'attributes':['id'],'include':[{'model':_0x2e920b['CmList'],'as':_0xd176('0x43'),'where':{'id':_0x205460[_0xd176('0x24')]}}]})['then'](function(_0x55ce67){if(_0x55ce67){var _0x5c253d=[];for(var _0x56d9c6=0x0,_0x58cec8;_0x56d9c6<_0x55ce67[_0xd176('0x3a')];_0x56d9c6+=0x1){_0x58cec8=_0x55ce67[_0x56d9c6][_0xd176('0x3b')]({'plain':!![]});_0x2e920b[_0xd176('0x3f')][_0xd176('0x2e')]({'phone':_0x205460['phone'],'ContactId':_0x205460['id'],'ListId':_0x205460[_0xd176('0x24')],'CampaignId':_0x58cec8['id']})[_0xd176('0x27')](function(_0x342b69){logger['error'](_0xd176('0x44'),'afterCreate',_0x342b69[_0xd176('0x41')]);});}}});})[_0xd176('0x1d')](function(){_0x19658b();})['catch'](function(_0x438b4f){logger[_0xd176('0x2f')](_0xd176('0x44'),_0xd176('0x40'),_0x438b4f[_0xd176('0x41')]);_0x19658b(_0x438b4f);});}else{_0x19658b(new Error(_0xd176('0x45')));}},'afterDestroy':function(_0x572319,_0x55a7f4,_0x56e6cb){var _0x5927c4=_0x410fcd[_0xd176('0x46')];var _0xabc764=_0x572319['get']({'plain':!![]});return _0x5927c4[_0xd176('0x28')][_0xd176('0x37')]({'raw':!![],'where':{'ListId':_0xabc764[_0xd176('0x24')],'ContactId':_0xabc764['id']}})['then'](function(_0x226a4b){if(!_[_0xd176('0x47')](_0x226a4b)){var _0x18b44c=[];for(var _0x5a195e=0x0;_0x5a195e<_0x226a4b['length'];_0x5a195e+=0x1){var _0x30bd2a=_0x5927c4['CmHopper'][_0xd176('0x48')]({'where':{'ListId':_0x226a4b[_0x5a195e][_0xd176('0x24')],'ContactId':_0x226a4b[_0x5a195e][_0xd176('0x49')],'VoiceQueueId':_0x226a4b[_0x5a195e][_0xd176('0x4a')],'CampaignId':_0x226a4b[_0x5a195e]['CampaignId']}});_0x18b44c['push'](_0x30bd2a);}return BPromise[_0xd176('0x4b')](_0x18b44c);}})[_0xd176('0x1d')](function(_0x1cdd9e){logger[_0xd176('0x4c')](_0xd176('0x4d'),util[_0xd176('0x17')](_0x1cdd9e,{'showHidden':![],'depth':null}));_0x56e6cb();})['catch'](function(_0x1a90f2){logger['error'](_0xd176('0x4e'),util['inspect'](_0x1a90f2,{'showHidden':![],'depth':null}));_0x56e6cb(_0x1a90f2);});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x13acb9,_0x40a0c5){var _0x540521=function(_0x2dc98a){while(--_0x2dc98a){_0x13acb9['push'](_0x13acb9['shift']());}};_0x540521(++_0x40a0c5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
+var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});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 respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a<Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x0a9e('0x2e')];_0x24936a++){var _0x4f41ae=Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x24936a];if(_0x4f41ae[_0x0a9e('0x2f')]('cf_')){_0x5640eb=squel[_0x0a9e('0x30')]()[_0x0a9e('0x31')](_0x0a9e('0x32'))['set'](_0x4f41ae,_0x2cc7a0['body'][_0x4f41ae])[_0x0a9e('0x1d')](_0x0a9e('0x33'),_0x1e8694['id'])['toString']();break;}}if(!_0x5640eb)return _0x1e8694;return db[_0x0a9e('0x34')][_0x0a9e('0x35')](_0x5640eb)[_0x0a9e('0x23')](function(){return _0x1e8694;});})[_0x0a9e('0x23')](function(_0x4b38d9){logger['info'](_0x0a9e('0x36'),_0x2cc7a0);logger[_0x0a9e('0x12')]('CreateCmContact',_0x2cc7a0,JSON[_0x0a9e('0x24')](_0x4b38d9));_0x2b7e7f(_0x4b38d9);})[_0x0a9e('0x18')](function(_0x1459bb){logger['error'](_0x0a9e('0x36'),_0x1459bb[_0x0a9e('0x16')],_0x2cc7a0);_0x3f3d41(_0x14b13f[_0x0a9e('0x14')](0x1f4,_0x1459bb[_0x0a9e('0x16')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x56b02e,_0x20d04f){var _0x416666=function(_0x2ede93){while(--_0x2ede93){_0x56b02e['push'](_0x56b02e['shift']());}};_0x416666(++_0x20d04f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
+var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x2dda7e,_0x9da665){var _0x4b954a=function(_0x213db6){while(--_0x213db6){_0x2dda7e['push'](_0x2dda7e['shift']());}};_0x4b954a(++_0x9da665);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5089=['STRING','INTEGER','PHONE','sequelize','exports'];(function(_0x371646,_0x3b06ba){var _0x21385e=function(_0x3fe625){while(--_0x3fe625){_0x371646['push'](_0x371646['shift']());}};_0x21385e(++_0x3b06ba);}(_0x5089,0x1bb));var _0x9508=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x5089[_0x9d1e6b];return _0x2b3070;};'use strict';var Sequelize=require(_0x9508('0x0'));module[_0x9508('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x9508('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x9508('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x9508('0x2')],'defaultValue':_0x9508('0x4')},'OrderBy':{'type':Sequelize[_0x9508('0x3')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}};
\ No newline at end of file
+var _0x3756=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x3a6c7f,_0x1c9118){var _0x449679=function(_0x2b547f){while(--_0x2b547f){_0x3a6c7f['push'](_0x3a6c7f['shift']());}};_0x449679(++_0x1c9118);}(_0x3756,0x116));var _0x6375=function(_0x2ce7d0,_0x31f4ae){_0x2ce7d0=_0x2ce7d0-0x0;var _0x5d8277=_0x3756[_0x2ce7d0];return _0x5d8277;};'use strict';var Sequelize=require(_0x6375('0x0'));module[_0x6375('0x1')]={'CmContactId':{'type':Sequelize[_0x6375('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x6375('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x6375('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6375('0x3')],'defaultValue':_0x6375('0x4')},'OrderBy':{'type':Sequelize[_0x6375('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x6375('0x3')],'defaultValue':null}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc402=['rawAttributes','type','key','model','name','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','stack','send','index','map','CmContactHasItem'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xc402,0xca));var _0x2c40=function(_0x2cf7a3,_0x5f4e4b){_0x2cf7a3=_0x2cf7a3-0x0;var _0x2df1f1=_0xc402[_0x2cf7a3];return _0x2df1f1;};'use strict';var emlformat=require(_0x2c40('0x0'));var rimraf=require(_0x2c40('0x1'));var zipdir=require(_0x2c40('0x2'));var jsonpatch=require(_0x2c40('0x3'));var rp=require('request-promise');var moment=require(_0x2c40('0x4'));var BPromise=require(_0x2c40('0x5'));var Mustache=require(_0x2c40('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2c40('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c40('0x8'));var _=require('lodash');var squel=require(_0x2c40('0x9'));var crypto=require(_0x2c40('0xa'));var jsforce=require(_0x2c40('0xb'));var deskjs=require(_0x2c40('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2c40('0xd'));var Papa=require('papaparse');var Redis=require(_0x2c40('0xe'));var authService=require(_0x2c40('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c40('0x10'));var logger=require(_0x2c40('0x11'))(_0x2c40('0x12'));var utils=require(_0x2c40('0x13'));var config=require(_0x2c40('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27fa0c,_0x5bf683){_0x5bf683=_0x5bf683||0xcc;return function(_0x32a078){if(_0x32a078){return _0x27fa0c[_0x2c40('0x15')](_0x5bf683);}return _0x27fa0c[_0x2c40('0x16')](_0x5bf683)[_0x2c40('0x17')]();};}function respondWithResult(_0x4ee8f5,_0x3b60cd){_0x3b60cd=_0x3b60cd||0xc8;return function(_0x8b11c9){if(_0x8b11c9){return _0x4ee8f5[_0x2c40('0x16')](_0x3b60cd)[_0x2c40('0x18')](_0x8b11c9);}};}function respondWithFilteredResult(_0x5148de,_0x4e9ff4){return function(_0x5d0884){if(_0x5d0884){var _0x2255b1=typeof _0x4e9ff4[_0x2c40('0x19')]===_0x2c40('0x1a')&&typeof _0x4e9ff4[_0x2c40('0x1b')]===_0x2c40('0x1a');var _0x1fadc2=_0x5d0884[_0x2c40('0x1c')];var _0x51a750=_0x2255b1?0x0:_0x4e9ff4[_0x2c40('0x19')];var _0x32334e=_0x2255b1?_0x5d0884['count']:_0x4e9ff4[_0x2c40('0x19')]+_0x4e9ff4[_0x2c40('0x1b')];var _0x36d06c;if(_0x32334e>=_0x1fadc2){_0x32334e=_0x1fadc2;_0x36d06c=0xc8;}else{_0x36d06c=0xce;}_0x5148de[_0x2c40('0x16')](_0x36d06c);return _0x5148de[_0x2c40('0x1d')](_0x2c40('0x1e'),_0x51a750+'-'+_0x32334e+'/'+_0x1fadc2)[_0x2c40('0x18')](_0x5d0884);}return null;};}function patchUpdates(_0x4c2116){return function(_0xe77015){try{jsonpatch[_0x2c40('0x1f')](_0xe77015,_0x4c2116,!![]);}catch(_0x2acec4){return BPromise[_0x2c40('0x20')](_0x2acec4);}return _0xe77015[_0x2c40('0x21')]();};}function saveUpdates(_0x3856eb,_0x4b17b8){return function(_0x357c87){if(_0x357c87){return _0x357c87[_0x2c40('0x22')](_0x3856eb)[_0x2c40('0x23')](function(_0x4b83c6){return _0x4b83c6;});}return null;};}function removeEntity(_0x4333b4,_0x3fd702){return function(_0x55630e){if(_0x55630e){return _0x55630e[_0x2c40('0x24')]()[_0x2c40('0x23')](function(){var _0x1818e3=_0x55630e['get']({'plain':!![]});var _0x3e807e=_0x2c40('0x25');return db[_0x2c40('0x26')]['destroy']({'where':{'type':_0x3e807e,'resourceId':_0x1818e3['id']}})[_0x2c40('0x23')](function(){return _0x55630e;});})[_0x2c40('0x23')](function(){_0x4333b4[_0x2c40('0x16')](0xcc)[_0x2c40('0x17')]();});}};}function handleEntityNotFound(_0x3770ce,_0x358254){return function(_0x1fda96){if(!_0x1fda96){_0x3770ce['sendStatus'](0x194);}return _0x1fda96;};}function handleError(_0x92969d,_0x1c4572){_0x1c4572=_0x1c4572||0x1f4;return function(_0x5087c2){logger['error'](_0x5087c2[_0x2c40('0x27')]);if(_0x5087c2['name']){delete _0x5087c2['name'];}_0x92969d[_0x2c40('0x16')](_0x1c4572)[_0x2c40('0x28')](_0x5087c2);};}exports[_0x2c40('0x29')]=function(_0x3d0079,_0x31364e){var _0x37c144={},_0x3d68c5={},_0x501c11={'count':0x0,'rows':[]};var _0x27ebac=_[_0x2c40('0x2a')](db[_0x2c40('0x2b')][_0x2c40('0x2c')],function(_0x30da81){return{'name':_0x30da81['fieldName'],'type':_0x30da81[_0x2c40('0x2d')][_0x2c40('0x2e')]};});_0x3d68c5[_0x2c40('0x2f')]=_[_0x2c40('0x2a')](_0x27ebac,_0x2c40('0x30'));_0x3d68c5['query']=_[_0x2c40('0x31')](_0x3d0079['query']);_0x3d68c5['filters']=_[_0x2c40('0x32')](_0x3d68c5[_0x2c40('0x2f')],_0x3d68c5[_0x2c40('0x33')]);_0x37c144['attributes']=_[_0x2c40('0x32')](_0x3d68c5[_0x2c40('0x2f')],qs[_0x2c40('0x34')](_0x3d0079[_0x2c40('0x33')][_0x2c40('0x34')]));_0x37c144['attributes']=_0x37c144[_0x2c40('0x35')][_0x2c40('0x36')]?_0x37c144[_0x2c40('0x35')]:_0x3d68c5[_0x2c40('0x2f')];if(!_0x3d0079[_0x2c40('0x33')][_0x2c40('0x37')](_0x2c40('0x38'))){_0x37c144[_0x2c40('0x1b')]=qs[_0x2c40('0x1b')](_0x3d0079['query'][_0x2c40('0x1b')]);_0x37c144[_0x2c40('0x19')]=qs[_0x2c40('0x19')](_0x3d0079[_0x2c40('0x33')][_0x2c40('0x19')]);}_0x37c144[_0x2c40('0x39')]=qs[_0x2c40('0x3a')](_0x3d0079[_0x2c40('0x33')][_0x2c40('0x3a')]);_0x37c144[_0x2c40('0x3b')]=qs[_0x2c40('0x3c')](_[_0x2c40('0x3d')](_0x3d0079[_0x2c40('0x33')],_0x3d68c5['filters']),_0x27ebac);if(_0x3d0079['query'][_0x2c40('0x3e')]){_0x37c144[_0x2c40('0x3b')]=_[_0x2c40('0x3f')](_0x37c144[_0x2c40('0x3b')],{'$or':_[_0x2c40('0x2a')](_0x27ebac,function(_0x1437f1){if(_0x1437f1[_0x2c40('0x2d')]!==_0x2c40('0x40')){var _0x2b3253={};_0x2b3253[_0x1437f1[_0x2c40('0x30')]]={'$like':'%'+_0x3d0079['query'][_0x2c40('0x3e')]+'%'};return _0x2b3253;}})});}_0x37c144=_[_0x2c40('0x3f')]({},_0x37c144,_0x3d0079[_0x2c40('0x41')]);var _0x5cddc5={'where':_0x37c144[_0x2c40('0x3b')]};return db[_0x2c40('0x2b')][_0x2c40('0x1c')](_0x5cddc5)['then'](function(_0x142081){_0x501c11['count']=_0x142081;if(_0x3d0079[_0x2c40('0x33')]['includeAll']){_0x37c144[_0x2c40('0x42')]=[{'all':!![]}];}return db[_0x2c40('0x2b')]['findAll'](_0x37c144);})[_0x2c40('0x23')](function(_0x211516){_0x501c11[_0x2c40('0x43')]=_0x211516;return _0x501c11;})['then'](respondWithFilteredResult(_0x31364e,_0x37c144))[_0x2c40('0x44')](handleError(_0x31364e,null));};exports['show']=function(_0x439d75,_0x17e149){var _0x4258cf={'raw':!![],'where':{'id':_0x439d75[_0x2c40('0x45')]['id']}},_0x497c11={};_0x497c11[_0x2c40('0x2f')]=_[_0x2c40('0x31')](db[_0x2c40('0x2b')][_0x2c40('0x2c')]);_0x497c11['query']=_['keys'](_0x439d75[_0x2c40('0x33')]);_0x497c11['filters']=_[_0x2c40('0x32')](_0x497c11['model'],_0x497c11[_0x2c40('0x33')]);_0x4258cf[_0x2c40('0x35')]=_[_0x2c40('0x32')](_0x497c11[_0x2c40('0x2f')],qs[_0x2c40('0x34')](_0x439d75[_0x2c40('0x33')][_0x2c40('0x34')]));_0x4258cf['attributes']=_0x4258cf[_0x2c40('0x35')][_0x2c40('0x36')]?_0x4258cf[_0x2c40('0x35')]:_0x497c11[_0x2c40('0x2f')];if(_0x439d75[_0x2c40('0x33')][_0x2c40('0x46')]){_0x4258cf[_0x2c40('0x42')]=[{'all':!![]}];}_0x4258cf=_['merge']({},_0x4258cf,_0x439d75['options']);return db[_0x2c40('0x2b')][_0x2c40('0x47')](_0x4258cf)[_0x2c40('0x23')](handleEntityNotFound(_0x17e149,null))['then'](respondWithResult(_0x17e149,null))[_0x2c40('0x44')](handleError(_0x17e149,null));};exports[_0x2c40('0x48')]=function(_0x3a344f,_0x55c4e4){return db[_0x2c40('0x2b')][_0x2c40('0x48')](_0x3a344f[_0x2c40('0x49')],{})['then'](function(_0x5c0786){var _0x3a246a=_0x3a344f['user'][_0x2c40('0x4a')]({'plain':!![]});if(!_0x3a246a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a246a[_0x2c40('0x4b')]===_0x2c40('0x4c')){var _0x2f0710=_0x5c0786[_0x2c40('0x4a')]({'plain':!![]});var _0x49f774=_0x2c40('0x25');return db[_0x2c40('0x4d')][_0x2c40('0x47')]({'where':{'name':_0x49f774,'userProfileId':_0x3a246a[_0x2c40('0x4e')]},'raw':!![]})[_0x2c40('0x23')](function(_0x8f11d4){if(_0x8f11d4&&_0x8f11d4[_0x2c40('0x4f')]===0x0){return db[_0x2c40('0x26')]['create']({'name':_0x2f0710[_0x2c40('0x30')],'resourceId':_0x2f0710['id'],'type':_0x8f11d4[_0x2c40('0x30')],'sectionId':_0x8f11d4['id']},{})[_0x2c40('0x23')](function(){return _0x5c0786;});}else{return _0x5c0786;}})[_0x2c40('0x44')](function(_0x207a9d){logger[_0x2c40('0x50')](_0x2c40('0x51'),_0x207a9d);throw _0x207a9d;});}return _0x5c0786;})[_0x2c40('0x23')](respondWithResult(_0x55c4e4,0xc9))[_0x2c40('0x44')](handleError(_0x55c4e4,null));};exports[_0x2c40('0x22')]=function(_0x4fe737,_0x5a7dc2){if(_0x4fe737['body']['id']){delete _0x4fe737[_0x2c40('0x49')]['id'];}return db[_0x2c40('0x2b')][_0x2c40('0x47')]({'where':{'id':_0x4fe737[_0x2c40('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a7dc2,null))[_0x2c40('0x23')](saveUpdates(_0x4fe737[_0x2c40('0x49')],null))[_0x2c40('0x23')](respondWithResult(_0x5a7dc2,null))[_0x2c40('0x44')](handleError(_0x5a7dc2,null));};exports['destroy']=function(_0x2c5de4,_0x4259f5){return db[_0x2c40('0x2b')]['find']({'where':{'id':_0x2c5de4['params']['id']}})[_0x2c40('0x23')](handleEntityNotFound(_0x4259f5,null))['then'](removeEntity(_0x4259f5,null))[_0x2c40('0x44')](handleError(_0x4259f5,null));};
\ No newline at end of file
+var _0x970a=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','CmContactHasItem','includeAll','include','findAll','rows','params','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x27949b,_0x32ff8d){var _0x269ac8=function(_0x15276e){while(--_0x15276e){_0x27949b['push'](_0x27949b['shift']());}};_0x269ac8(++_0x32ff8d);}(_0x970a,0xec));var _0xa970=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x970a[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa970('0x0'));var jsonpatch=require(_0xa970('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa970('0x2'));var Mustache=require(_0xa970('0x3'));var util=require(_0xa970('0x4'));var path=require(_0xa970('0x5'));var sox=require(_0xa970('0x6'));var csv=require(_0xa970('0x7'));var ejs=require(_0xa970('0x8'));var fs=require('fs');var fs_extra=require(_0xa970('0x9'));var _=require('lodash');var squel=require(_0xa970('0xa'));var crypto=require(_0xa970('0xb'));var jsforce=require(_0xa970('0xc'));var deskjs=require(_0xa970('0xd'));var toCsv=require(_0xa970('0x7'));var querystring=require(_0xa970('0xe'));var Papa=require('papaparse');var Redis=require(_0xa970('0xf'));var authService=require(_0xa970('0x10'));var qs=require(_0xa970('0x11'));var as=require(_0xa970('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa970('0x13'))(_0xa970('0x14'));var utils=require(_0xa970('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa970('0x16'));var db=require(_0xa970('0x17'))['db'];function respondWithStatusCode(_0x3b93f2,_0x41d6e6){_0x41d6e6=_0x41d6e6||0xcc;return function(_0x583a81){if(_0x583a81){return _0x3b93f2[_0xa970('0x18')](_0x41d6e6);}return _0x3b93f2[_0xa970('0x19')](_0x41d6e6)[_0xa970('0x1a')]();};}function respondWithResult(_0x1cdabb,_0x484542){_0x484542=_0x484542||0xc8;return function(_0x5b7eff){if(_0x5b7eff){return _0x1cdabb[_0xa970('0x19')](_0x484542)['json'](_0x5b7eff);}};}function respondWithFilteredResult(_0x445e06,_0x2a0393){return function(_0x2e69ea){if(_0x2e69ea){var _0x5ccb21=typeof _0x2a0393[_0xa970('0x1b')]==='undefined'&&typeof _0x2a0393[_0xa970('0x1c')]===_0xa970('0x1d');var _0x320f58=_0x2e69ea[_0xa970('0x1e')];var _0x569bb9=_0x5ccb21?0x0:_0x2a0393[_0xa970('0x1b')];var _0x1870c5=_0x5ccb21?_0x2e69ea[_0xa970('0x1e')]:_0x2a0393[_0xa970('0x1b')]+_0x2a0393[_0xa970('0x1c')];var _0x4c959d;if(_0x1870c5>=_0x320f58){_0x1870c5=_0x320f58;_0x4c959d=0xc8;}else{_0x4c959d=0xce;}_0x445e06[_0xa970('0x19')](_0x4c959d);return _0x445e06[_0xa970('0x1f')](_0xa970('0x20'),_0x569bb9+'-'+_0x1870c5+'/'+_0x320f58)[_0xa970('0x21')](_0x2e69ea);}return null;};}function patchUpdates(_0x245859){return function(_0x4436b6){try{jsonpatch[_0xa970('0x22')](_0x4436b6,_0x245859,!![]);}catch(_0x43ce74){return BPromise[_0xa970('0x23')](_0x43ce74);}return _0x4436b6[_0xa970('0x24')]();};}function saveUpdates(_0x5a4041,_0x36d0cc){return function(_0x5b367a){if(_0x5b367a){return _0x5b367a[_0xa970('0x25')](_0x5a4041)[_0xa970('0x26')](function(_0x1ba5f5){return _0x1ba5f5;});}return null;};}function removeEntity(_0x13a31d,_0x12663e){return function(_0x2e24de){if(_0x2e24de){return _0x2e24de[_0xa970('0x27')]()['then'](function(){var _0x59f674=_0x2e24de['get']({'plain':!![]});var _0x10dbc8='CmContactHasItems';return db[_0xa970('0x28')][_0xa970('0x27')]({'where':{'type':_0x10dbc8,'resourceId':_0x59f674['id']}})['then'](function(){return _0x2e24de;});})['then'](function(){_0x13a31d[_0xa970('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4819b8,_0x2209da){return function(_0x565744){if(!_0x565744){_0x4819b8[_0xa970('0x18')](0x194);}return _0x565744;};}function handleError(_0x4e71f6,_0x548f4b){_0x548f4b=_0x548f4b||0x1f4;return function(_0x47a8a3){logger[_0xa970('0x29')](_0x47a8a3['stack']);if(_0x47a8a3['name']){delete _0x47a8a3[_0xa970('0x2a')];}_0x4e71f6[_0xa970('0x19')](_0x548f4b)[_0xa970('0x2b')](_0x47a8a3);};}exports[_0xa970('0x2c')]=function(_0x118744,_0x4736c9){var _0xb762d={},_0x43d5a4={},_0x4c36e9={'count':0x0,'rows':[]};var _0x258b0a=_[_0xa970('0x2d')](db['CmContactHasItem'][_0xa970('0x2e')],function(_0x497853){return{'name':_0x497853[_0xa970('0x2f')],'type':_0x497853[_0xa970('0x30')][_0xa970('0x31')]};});_0x43d5a4[_0xa970('0x32')]=_[_0xa970('0x2d')](_0x258b0a,_0xa970('0x2a'));_0x43d5a4[_0xa970('0x33')]=_[_0xa970('0x34')](_0x118744['query']);_0x43d5a4[_0xa970('0x35')]=_[_0xa970('0x36')](_0x43d5a4[_0xa970('0x32')],_0x43d5a4[_0xa970('0x33')]);_0xb762d[_0xa970('0x37')]=_['intersection'](_0x43d5a4['model'],qs['fields'](_0x118744[_0xa970('0x33')][_0xa970('0x38')]));_0xb762d[_0xa970('0x37')]=_0xb762d[_0xa970('0x37')][_0xa970('0x39')]?_0xb762d[_0xa970('0x37')]:_0x43d5a4[_0xa970('0x32')];if(!_0x118744[_0xa970('0x33')][_0xa970('0x3a')]('nolimit')){_0xb762d[_0xa970('0x1c')]=qs[_0xa970('0x1c')](_0x118744['query'][_0xa970('0x1c')]);_0xb762d['offset']=qs[_0xa970('0x1b')](_0x118744['query'][_0xa970('0x1b')]);}_0xb762d['order']=qs['sort'](_0x118744[_0xa970('0x33')][_0xa970('0x3b')]);_0xb762d[_0xa970('0x3c')]=qs[_0xa970('0x35')](_[_0xa970('0x3d')](_0x118744[_0xa970('0x33')],_0x43d5a4[_0xa970('0x35')]),_0x258b0a);if(_0x118744['query'][_0xa970('0x3e')]){_0xb762d[_0xa970('0x3c')]=_[_0xa970('0x3f')](_0xb762d[_0xa970('0x3c')],{'$or':_[_0xa970('0x2d')](_0x258b0a,function(_0x21768a){if(_0x21768a[_0xa970('0x30')]!=='VIRTUAL'){var _0x520685={};_0x520685[_0x21768a[_0xa970('0x2a')]]={'$like':'%'+_0x118744['query'][_0xa970('0x3e')]+'%'};return _0x520685;}})});}_0xb762d=_[_0xa970('0x3f')]({},_0xb762d,_0x118744[_0xa970('0x40')]);var _0x4794df={'where':_0xb762d[_0xa970('0x3c')]};return db[_0xa970('0x41')]['count'](_0x4794df)[_0xa970('0x26')](function(_0x5692f2){_0x4c36e9[_0xa970('0x1e')]=_0x5692f2;if(_0x118744[_0xa970('0x33')][_0xa970('0x42')]){_0xb762d[_0xa970('0x43')]=[{'all':!![]}];}return db[_0xa970('0x41')][_0xa970('0x44')](_0xb762d);})[_0xa970('0x26')](function(_0x25b3f1){_0x4c36e9[_0xa970('0x45')]=_0x25b3f1;return _0x4c36e9;})[_0xa970('0x26')](respondWithFilteredResult(_0x4736c9,_0xb762d))['catch'](handleError(_0x4736c9,null));};exports['show']=function(_0x53e72a,_0x440fba){var _0x1aaa26={'raw':!![],'where':{'id':_0x53e72a[_0xa970('0x46')]['id']}},_0x1282db={};_0x1282db['model']=_['keys'](db[_0xa970('0x41')][_0xa970('0x2e')]);_0x1282db['query']=_[_0xa970('0x34')](_0x53e72a[_0xa970('0x33')]);_0x1282db['filters']=_[_0xa970('0x36')](_0x1282db[_0xa970('0x32')],_0x1282db[_0xa970('0x33')]);_0x1aaa26[_0xa970('0x37')]=_[_0xa970('0x36')](_0x1282db['model'],qs['fields'](_0x53e72a[_0xa970('0x33')][_0xa970('0x38')]));_0x1aaa26[_0xa970('0x37')]=_0x1aaa26[_0xa970('0x37')]['length']?_0x1aaa26[_0xa970('0x37')]:_0x1282db[_0xa970('0x32')];if(_0x53e72a[_0xa970('0x33')][_0xa970('0x42')]){_0x1aaa26[_0xa970('0x43')]=[{'all':!![]}];}_0x1aaa26=_[_0xa970('0x3f')]({},_0x1aaa26,_0x53e72a['options']);return db['CmContactHasItem'][_0xa970('0x47')](_0x1aaa26)[_0xa970('0x26')](handleEntityNotFound(_0x440fba,null))[_0xa970('0x26')](respondWithResult(_0x440fba,null))[_0xa970('0x48')](handleError(_0x440fba,null));};exports[_0xa970('0x49')]=function(_0x46bbf3,_0x1c4d52){return db[_0xa970('0x41')][_0xa970('0x49')](_0x46bbf3[_0xa970('0x4a')],{})[_0xa970('0x26')](function(_0x3c0e1a){var _0x4acbcb=_0x46bbf3[_0xa970('0x4b')][_0xa970('0x4c')]({'plain':!![]});if(!_0x4acbcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4acbcb[_0xa970('0x4d')]===_0xa970('0x4b')){var _0x4d5955=_0x3c0e1a['get']({'plain':!![]});var _0x385bee='CmContactHasItems';return db[_0xa970('0x4e')]['find']({'where':{'name':_0x385bee,'userProfileId':_0x4acbcb[_0xa970('0x4f')]},'raw':!![]})[_0xa970('0x26')](function(_0x6d52ac){if(_0x6d52ac&&_0x6d52ac[_0xa970('0x50')]===0x0){return db[_0xa970('0x28')]['create']({'name':_0x4d5955[_0xa970('0x2a')],'resourceId':_0x4d5955['id'],'type':_0x6d52ac[_0xa970('0x2a')],'sectionId':_0x6d52ac['id']},{})['then'](function(){return _0x3c0e1a;});}else{return _0x3c0e1a;}})[_0xa970('0x48')](function(_0x3eebfb){logger['error'](_0xa970('0x51'),_0x3eebfb);throw _0x3eebfb;});}return _0x3c0e1a;})[_0xa970('0x26')](respondWithResult(_0x1c4d52,0xc9))[_0xa970('0x48')](handleError(_0x1c4d52,null));};exports['update']=function(_0x16ed7f,_0x378508){if(_0x16ed7f[_0xa970('0x4a')]['id']){delete _0x16ed7f[_0xa970('0x4a')]['id'];}return db[_0xa970('0x41')][_0xa970('0x47')]({'where':{'id':_0x16ed7f[_0xa970('0x46')]['id']}})[_0xa970('0x26')](handleEntityNotFound(_0x378508,null))[_0xa970('0x26')](saveUpdates(_0x16ed7f[_0xa970('0x4a')],null))[_0xa970('0x26')](respondWithResult(_0x378508,null))[_0xa970('0x48')](handleError(_0x378508,null));};exports[_0xa970('0x27')]=function(_0x3d6221,_0x390c81){return db[_0xa970('0x41')][_0xa970('0x47')]({'where':{'id':_0x3d6221['params']['id']}})['then'](handleEntityNotFound(_0x390c81,null))['then'](removeEntity(_0x390c81,null))['catch'](handleError(_0x390c81,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a13=['api','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','util','../../config/logger'];(function(_0x5d1a3f,_0x3df1c0){var _0xbb4d27=function(_0x450caf){while(--_0x450caf){_0x5d1a3f['push'](_0x5d1a3f['shift']());}};_0xbb4d27(++_0x3df1c0);}(_0x4a13,0xa3));var _0x34a1=function(_0x4a4028,_0x1fdbd7){_0x4a4028=_0x4a4028-0x0;var _0x12985d=_0x4a13[_0x4a4028];return _0x12985d;};'use strict';var _=require('lodash');var util=require(_0x34a1('0x0'));var logger=require(_0x34a1('0x1'))(_0x34a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x34a1('0x3'));var fs=require('fs');var path=require(_0x34a1('0x4'));var rimraf=require(_0x34a1('0x5'));var config=require(_0x34a1('0x6'));var attributes=require(_0x34a1('0x7'));module[_0x34a1('0x8')]=function(_0x42525e,_0x2edfd7){return _0x42525e[_0x34a1('0x9')]('CmContactHasItem',attributes,{'tableName':_0x34a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ca6=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7ca6,0x1d9));var _0x67ca=function(_0x4d3735,_0x12aa11){_0x4d3735=_0x4d3735-0x0;var _0x5c733e=_0x7ca6[_0x4d3735];return _0x5c733e;};'use strict';var _=require(_0x67ca('0x0'));var util=require('util');var logger=require(_0x67ca('0x1'))(_0x67ca('0x2'));var moment=require('moment');var BPromise=require(_0x67ca('0x3'));var rp=require(_0x67ca('0x4'));var fs=require('fs');var path=require(_0x67ca('0x5'));var rimraf=require(_0x67ca('0x6'));var config=require('../../config/environment');var attributes=require(_0x67ca('0x7'));module[_0x67ca('0x8')]=function(_0x51204f,_0x450893){return _0x51204f[_0x67ca('0x9')](_0x67ca('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8337=['rpc','jayson/promise','http','request','then','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmContactHasItem,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f7116,_0x22a118){var _0x407cc8=function(_0x963773){while(--_0x963773){_0x4f7116['push'](_0x4f7116['shift']());}};_0x407cc8(++_0x22a118);}(_0x8337,0xaa));var _0x7833=function(_0x532169,_0x40bc6c){_0x532169=_0x532169-0x0;var _0x26a17d=_0x8337[_0x532169];return _0x26a17d;};'use strict';var _=require(_0x7833('0x0'));var util=require(_0x7833('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7833('0x2'));var fs=require('fs');var Redis=require(_0x7833('0x3'));var db=require(_0x7833('0x4'))['db'];var utils=require(_0x7833('0x5'));var logger=require('../../config/logger')(_0x7833('0x6'));var config=require('../../config/environment');var jayson=require(_0x7833('0x7'));var client=jayson['client'][_0x7833('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2eb78c,_0x3d4ff7,_0x95a14f){return new BPromise(function(_0x5e6d51,_0x2fc699){return client[_0x7833('0x9')](_0x2eb78c,_0x95a14f)[_0x7833('0xa')](function(_0x37e655){logger[_0x7833('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x3d4ff7,'request\x20sent');logger[_0x7833('0xc')](_0x7833('0xd'),_0x3d4ff7,_0x7833('0xe'),JSON[_0x7833('0xf')](_0x37e655));if(_0x37e655[_0x7833('0x10')]){if(_0x37e655[_0x7833('0x10')][_0x7833('0x11')]===0x1f4){logger[_0x7833('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3d4ff7,_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);return _0x2fc699(_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);}logger[_0x7833('0x10')](_0x7833('0x13'),_0x3d4ff7,_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);return _0x5e6d51(_0x37e655[_0x7833('0x10')][_0x7833('0x12')]);}else{logger[_0x7833('0xb')](_0x7833('0x13'),_0x3d4ff7,_0x7833('0xe'));_0x5e6d51(_0x37e655[_0x7833('0x14')][_0x7833('0x12')]);}})[_0x7833('0x15')](function(_0x4ad22f){logger[_0x7833('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3d4ff7,_0x4ad22f);_0x2fc699(_0x4ad22f);});});}
\ No newline at end of file
+var _0x4b51=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x502f40,_0x51124f){var _0x28a473=function(_0xc2350c){while(--_0xc2350c){_0x502f40['push'](_0x502f40['shift']());}};_0x28a473(++_0x51124f);}(_0x4b51,0x83));var _0x14b5=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x4b51[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0x14b5('0x0'));var util=require(_0x14b5('0x1'));var moment=require(_0x14b5('0x2'));var BPromise=require(_0x14b5('0x3'));var rs=require(_0x14b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14b5('0x5'))['db'];var utils=require(_0x14b5('0x6'));var logger=require(_0x14b5('0x7'))(_0x14b5('0x8'));var config=require(_0x14b5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x14b5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a6ba1,_0x3eb39d,_0x13a73b){return new BPromise(function(_0x4fe2cf,_0x39001d){return client[_0x14b5('0xb')](_0x2a6ba1,_0x13a73b)[_0x14b5('0xc')](function(_0x52ff21){logger[_0x14b5('0xd')](_0x14b5('0xe'),_0x3eb39d,_0x14b5('0xf'));logger[_0x14b5('0x10')](_0x14b5('0x11'),_0x3eb39d,_0x14b5('0xf'),JSON[_0x14b5('0x12')](_0x52ff21));if(_0x52ff21[_0x14b5('0x13')]){if(_0x52ff21[_0x14b5('0x13')]['code']===0x1f4){logger[_0x14b5('0x13')](_0x14b5('0xe'),_0x3eb39d,_0x52ff21['error'][_0x14b5('0x14')]);return _0x39001d(_0x52ff21[_0x14b5('0x13')]['message']);}logger[_0x14b5('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x3eb39d,_0x52ff21[_0x14b5('0x13')]['message']);return _0x4fe2cf(_0x52ff21['error'][_0x14b5('0x14')]);}else{logger[_0x14b5('0xd')](_0x14b5('0xe'),_0x3eb39d,_0x14b5('0xf'));_0x4fe2cf(_0x52ff21[_0x14b5('0x15')][_0x14b5('0x14')]);}})['catch'](function(_0x2bfe73){logger['error'](_0x14b5('0xe'),_0x3eb39d,_0x2bfe73);_0x39001d(_0x2bfe73);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a27=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','show','post','create','put','/:id','multer','util','path','connect-timeout'];(function(_0x1de6e1,_0x35c25b){var _0x5e895f=function(_0x39eeb7){while(--_0x39eeb7){_0x1de6e1['push'](_0x1de6e1['shift']());}};_0x5e895f(++_0x35c25b);}(_0x7a27,0x172));var _0x77a2=function(_0x107179,_0x46e138){_0x107179=_0x107179-0x0;var _0x31f40e=_0x7a27[_0x107179];return _0x31f40e;};'use strict';var multer=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var path=require(_0x77a2('0x2'));var timeout=require(_0x77a2('0x3'));var express=require('express');var router=express[_0x77a2('0x4')]();var fs_extra=require(_0x77a2('0x5'));var auth=require(_0x77a2('0x6'));var interaction=require(_0x77a2('0x7'));var config=require('../../config/environment');var controller=require(_0x77a2('0x8'));router[_0x77a2('0x9')]('/',auth[_0x77a2('0xa')](),controller[_0x77a2('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x77a2('0xc')]);router[_0x77a2('0xd')]('/',auth[_0x77a2('0xa')](),controller[_0x77a2('0xe')]);router[_0x77a2('0xf')]('/:id',auth[_0x77a2('0xa')](),controller['update']);router['delete'](_0x77a2('0x10'),auth[_0x77a2('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbe99=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','show','post','isAuthenticated'];(function(_0x18af94,_0x5e1a88){var _0x61a29a=function(_0x413c27){while(--_0x413c27){_0x18af94['push'](_0x18af94['shift']());}};_0x61a29a(++_0x5e1a88);}(_0xbe99,0x196));var _0x9be9=function(_0x73b80e,_0x4daa4a){_0x73b80e=_0x73b80e-0x0;var _0x4c31cd=_0xbe99[_0x73b80e];return _0x4c31cd;};'use strict';var multer=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var path=require(_0x9be9('0x2'));var timeout=require(_0x9be9('0x3'));var express=require(_0x9be9('0x4'));var router=express['Router']();var fs_extra=require(_0x9be9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9be9('0x6'));var config=require(_0x9be9('0x7'));var controller=require(_0x9be9('0x8'));router[_0x9be9('0x9')]('/',auth['isAuthenticated'](),controller[_0x9be9('0xa')]);router[_0x9be9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9be9('0xb')]);router[_0x9be9('0xc')]('/',auth[_0x9be9('0xd')](),controller[_0x9be9('0xe')]);router[_0x9be9('0xf')](_0x9be9('0x10'),auth[_0x9be9('0xd')](),controller[_0x9be9('0x11')]);router[_0x9be9('0x12')](_0x9be9('0x10'),auth[_0x9be9('0xd')](),controller[_0x9be9('0x13')]);module[_0x9be9('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0295=['BOOLEAN','voice','sequelize','lodash','VIRTUAL','alias','STRING','setDataValue','name','TEXT','type','select','parse','getDataValue','values'];(function(_0x4dff34,_0x49f98a){var _0x395029=function(_0x4031ee){while(--_0x4031ee){_0x4dff34['push'](_0x4dff34['shift']());}};_0x395029(++_0x49f98a);}(_0x0295,0x11f));var _0x5029=function(_0xff8595,_0x39341d){_0xff8595=_0xff8595-0x0;var _0x31e49e=_0x0295[_0xff8595];return _0x31e49e;};'use strict';var Sequelize=require(_0x5029('0x0'));var _=require(_0x5029('0x1'));module['exports']={'name':{'type':Sequelize[_0x5029('0x2')],'get':function(_0x9d4f24){return this['getDataValue'](_0x5029('0x3'));}},'alias':{'type':Sequelize[_0x5029('0x4')],'allowNull':![],'set':function(_0x4cd251){this[_0x5029('0x5')]('alias',_0x4cd251?_0x4cd251:this['getDataValue'](_0x5029('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x5029('0x7')]('long'),'get':function(){if(this['getDataValue'](_0x5029('0x8'))===_0x5029('0x9')){return JSON[_0x5029('0xa')](this[_0x5029('0xb')](_0x5029('0xc')));}else{return this['getDataValue'](_0x5029('0xc'));}},'set':function(_0x9022a6){if(Array['isArray'](_0x9022a6)){this[_0x5029('0x5')]('values',JSON['stringify'](_0x9022a6));}else{this[_0x5029('0x5')]('values',_0x9022a6);}}},'required':{'type':Sequelize[_0x5029('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x5029('0xe'))}};
\ No newline at end of file
+var _0x83d7=['voice','sequelize','lodash','exports','alias','STRING','setDataValue','getDataValue','TEXT','long','select','parse','values','isArray','stringify','BOOLEAN'];(function(_0x3d4144,_0x1b0203){var _0x434b4d=function(_0x2ff3a0){while(--_0x2ff3a0){_0x3d4144['push'](_0x3d4144['shift']());}};_0x434b4d(++_0x1b0203);}(_0x83d7,0xb1));var _0x783d=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x83d7[_0x57975f];return _0x4793b8;};'use strict';var Sequelize=require(_0x783d('0x0'));var _=require(_0x783d('0x1'));module[_0x783d('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x495526){return this['getDataValue'](_0x783d('0x3'));}},'alias':{'type':Sequelize[_0x783d('0x4')],'allowNull':![],'set':function(_0x3b127c){this[_0x783d('0x5')](_0x783d('0x3'),_0x3b127c?_0x3b127c:this[_0x783d('0x6')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x783d('0x7')](_0x783d('0x8')),'get':function(){if(this[_0x783d('0x6')]('type')===_0x783d('0x9')){return JSON[_0x783d('0xa')](this[_0x783d('0x6')](_0x783d('0xb')));}else{return this[_0x783d('0x6')](_0x783d('0xb'));}},'set':function(_0x1c05ce){if(Array[_0x783d('0xc')](_0x1c05ce)){this[_0x783d('0x5')]('values',JSON[_0x783d('0xd')](_0x1c05ce));}else{this[_0x783d('0x5')](_0x783d('0xb'),_0x1c05ce);}}},'required':{'type':Sequelize[_0x783d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x783d('0xf'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32bf=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','fieldName','type','key','model','differenceBy','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','filter','options','CmCustomField','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','length','merge','find','body','params','create','sequelize','Sequelize','text','INTEGER','switch','defaultValue','queryInterface','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x7d3603,_0x38dbd8){var _0x157464=function(_0x52a990){while(--_0x52a990){_0x7d3603['push'](_0x7d3603['shift']());}};_0x157464(++_0x38dbd8);}(_0x32bf,0xf5));var _0xf32b=function(_0x4a40dd,_0x37a7d4){_0x4a40dd=_0x4a40dd-0x0;var _0xfdfa08=_0x32bf[_0x4a40dd];return _0xfdfa08;};'use strict';var emlformat=require(_0xf32b('0x0'));var rimraf=require(_0xf32b('0x1'));var zipdir=require(_0xf32b('0x2'));var jsonpatch=require(_0xf32b('0x3'));var rp=require(_0xf32b('0x4'));var moment=require(_0xf32b('0x5'));var BPromise=require(_0xf32b('0x6'));var Mustache=require(_0xf32b('0x7'));var util=require(_0xf32b('0x8'));var path=require(_0xf32b('0x9'));var sox=require(_0xf32b('0xa'));var csv=require(_0xf32b('0xb'));var ejs=require(_0xf32b('0xc'));var fs=require('fs');var fs_extra=require(_0xf32b('0xd'));var _=require(_0xf32b('0xe'));var squel=require(_0xf32b('0xf'));var crypto=require(_0xf32b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf32b('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf32b('0x12'));var Redis=require('ioredis');var authService=require(_0xf32b('0x13'));var qs=require(_0xf32b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf32b('0x15'));var logger=require(_0xf32b('0x16'))(_0xf32b('0x17'));var utils=require(_0xf32b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf32b('0x19'))['db'];function respondWithStatusCode(_0x430fc5,_0x2476a2){_0x2476a2=_0x2476a2||0xcc;return function(_0x3a3f7f){if(_0x3a3f7f){return _0x430fc5[_0xf32b('0x1a')](_0x2476a2);}return _0x430fc5['status'](_0x2476a2)['end']();};}function respondWithResult(_0x4fd49e,_0x27a5aa){_0x27a5aa=_0x27a5aa||0xc8;return function(_0x266909){if(_0x266909){return _0x4fd49e[_0xf32b('0x1b')](_0x27a5aa)[_0xf32b('0x1c')](_0x266909);}};}function respondWithFilteredResult(_0x2767ed,_0x5a89b6){return function(_0x408749){if(_0x408749){var _0xdf6f99=typeof _0x5a89b6['offset']===_0xf32b('0x1d')&&typeof _0x5a89b6[_0xf32b('0x1e')]===_0xf32b('0x1d');var _0x1ff2b3=_0x408749[_0xf32b('0x1f')];var _0x4803f0=_0xdf6f99?0x0:_0x5a89b6['offset'];var _0x1b008d=_0xdf6f99?_0x408749['count']:_0x5a89b6[_0xf32b('0x20')]+_0x5a89b6['limit'];var _0x220800;if(_0x1b008d>=_0x1ff2b3){_0x1b008d=_0x1ff2b3;_0x220800=0xc8;}else{_0x220800=0xce;}_0x2767ed[_0xf32b('0x1b')](_0x220800);return _0x2767ed['set'](_0xf32b('0x21'),_0x4803f0+'-'+_0x1b008d+'/'+_0x1ff2b3)['json'](_0x408749);}return null;};}function patchUpdates(_0x11e74c){return function(_0x482578){try{jsonpatch[_0xf32b('0x22')](_0x482578,_0x11e74c,!![]);}catch(_0x460f32){return BPromise[_0xf32b('0x23')](_0x460f32);}return _0x482578[_0xf32b('0x24')]();};}function saveUpdates(_0x3ff141,_0x144e6){return function(_0x1b6268){if(_0x1b6268){return _0x1b6268[_0xf32b('0x25')](_0x3ff141)['then'](function(_0x13df20){return _0x13df20;});}return null;};}function removeEntity(_0x21e910,_0x1b81db){return function(_0x1cba41){if(_0x1cba41){return _0x1cba41[_0xf32b('0x26')]()[_0xf32b('0x27')](function(){_0x21e910[_0xf32b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc86a0,_0x4974d2){return function(_0x231899){if(!_0x231899){_0xc86a0[_0xf32b('0x1a')](0x194);}return _0x231899;};}function handleError(_0x34c99d,_0x20b7fe){_0x20b7fe=_0x20b7fe||0x1f4;return function(_0x2fc377){logger[_0xf32b('0x28')](_0x2fc377[_0xf32b('0x29')]);if(_0x2fc377[_0xf32b('0x2a')]){delete _0x2fc377['name'];}_0x34c99d[_0xf32b('0x1b')](_0x20b7fe)['send'](_0x2fc377);};}exports[_0xf32b('0x2b')]=function(_0x335314,_0xf2b907){var _0x33d438={},_0x432a3c={},_0x4acac4={'count':0x0,'rows':[]};var _0x647dbc=_[_0xf32b('0x2c')](db['CmCustomField']['rawAttributes'],function(_0x3c9e9b){return{'name':_0x3c9e9b[_0xf32b('0x2d')],'type':_0x3c9e9b[_0xf32b('0x2e')][_0xf32b('0x2f')]};});_0x432a3c[_0xf32b('0x30')]=_[_0xf32b('0x31')](_[_0xf32b('0x2c')](_0x647dbc,_0xf32b('0x2a')),[_0xf32b('0x2a')]);_0x432a3c[_0xf32b('0x32')]=_[_0xf32b('0x33')](_0x335314['query']);_0x432a3c[_0xf32b('0x34')]=_['intersection'](_0x432a3c[_0xf32b('0x30')],_0x432a3c[_0xf32b('0x32')]);_0x33d438['attributes']=_['intersection'](_0x432a3c[_0xf32b('0x30')],qs[_0xf32b('0x35')](_0x335314[_0xf32b('0x32')][_0xf32b('0x35')]));_0x33d438[_0xf32b('0x36')]=_0x33d438[_0xf32b('0x36')]['length']?_0x33d438[_0xf32b('0x36')]:_0x432a3c[_0xf32b('0x30')];if(!_0x335314[_0xf32b('0x32')]['hasOwnProperty'](_0xf32b('0x37'))){_0x33d438[_0xf32b('0x1e')]=qs['limit'](_0x335314['query']['limit']);_0x33d438[_0xf32b('0x20')]=qs[_0xf32b('0x20')](_0x335314[_0xf32b('0x32')][_0xf32b('0x20')]);}_0x33d438[_0xf32b('0x38')]=qs[_0xf32b('0x39')](_0x335314['query']['sort']);_0x33d438[_0xf32b('0x3a')]=qs[_0xf32b('0x34')](_[_0xf32b('0x3b')](_0x335314[_0xf32b('0x32')],_0x432a3c[_0xf32b('0x34')]),_0x647dbc);if(_0x335314[_0xf32b('0x32')][_0xf32b('0x3c')]){_0x33d438[_0xf32b('0x3a')]=_['merge'](_0x33d438['where'],{'$or':_[_0xf32b('0x2c')](_0x647dbc,function(_0x1671a4){if(_0x1671a4['type']!=='VIRTUAL'){var _0x712a4a={};_0x712a4a[_0x1671a4[_0xf32b('0x2a')]]={'$like':'%'+_0x335314[_0xf32b('0x32')][_0xf32b('0x3c')]+'%'};return _0x712a4a;}})});}_0x33d438=_['merge']({},_0x33d438,_0x335314[_0xf32b('0x3d')]);var _0x153292={'where':_0x33d438[_0xf32b('0x3a')]};return db[_0xf32b('0x3e')][_0xf32b('0x1f')](_0x153292)[_0xf32b('0x27')](function(_0x51987b){_0x4acac4['count']=_0x51987b;if(_0x335314[_0xf32b('0x32')][_0xf32b('0x3f')]){_0x33d438[_0xf32b('0x40')]=[{'all':!![]}];}return db[_0xf32b('0x3e')][_0xf32b('0x41')](_0x33d438);})['then'](function(_0x5dc2ea){_0x4acac4[_0xf32b('0x42')]=_0x5dc2ea;return _0x4acac4;})[_0xf32b('0x27')](respondWithFilteredResult(_0xf2b907,_0x33d438))[_0xf32b('0x43')](handleError(_0xf2b907,null));};exports[_0xf32b('0x44')]=function(_0x21f1d5,_0x341587){var _0x513d42={'raw':!![],'where':{'id':_0x21f1d5['params']['id']}},_0x427f7c={};_0x427f7c[_0xf32b('0x30')]=_[_0xf32b('0x33')](db[_0xf32b('0x3e')][_0xf32b('0x45')]);_0x427f7c[_0xf32b('0x32')]=_[_0xf32b('0x33')](_0x21f1d5[_0xf32b('0x32')]);_0x427f7c[_0xf32b('0x34')]=_[_0xf32b('0x46')](_0x427f7c[_0xf32b('0x30')],_0x427f7c['query']);_0x513d42[_0xf32b('0x36')]=_['intersection'](_0x427f7c[_0xf32b('0x30')],qs[_0xf32b('0x35')](_0x21f1d5[_0xf32b('0x32')][_0xf32b('0x35')]));_0x513d42[_0xf32b('0x36')]=_0x513d42[_0xf32b('0x36')][_0xf32b('0x47')]?_0x513d42[_0xf32b('0x36')]:_0x427f7c[_0xf32b('0x30')];if(_0x21f1d5[_0xf32b('0x32')][_0xf32b('0x3f')]){_0x513d42[_0xf32b('0x40')]=[{'all':!![]}];}_0x513d42=_[_0xf32b('0x48')]({},_0x513d42,_0x21f1d5[_0xf32b('0x3d')]);return db[_0xf32b('0x3e')][_0xf32b('0x49')](_0x513d42)['then'](handleEntityNotFound(_0x341587,null))[_0xf32b('0x27')](respondWithResult(_0x341587,null))['catch'](handleError(_0x341587,null));};exports[_0xf32b('0x25')]=function(_0x4e042a,_0x40a8eb){if(_0x4e042a['body']['id']){delete _0x4e042a[_0xf32b('0x4a')]['id'];}return db[_0xf32b('0x3e')][_0xf32b('0x49')]({'where':{'id':_0x4e042a[_0xf32b('0x4b')]['id']}})[_0xf32b('0x27')](handleEntityNotFound(_0x40a8eb,null))[_0xf32b('0x27')](saveUpdates(_0x4e042a[_0xf32b('0x4a')],null))['then'](respondWithResult(_0x40a8eb,null))['catch'](handleError(_0x40a8eb,null));};exports[_0xf32b('0x26')]=function(_0x397f6f,_0x5e41e7){return db[_0xf32b('0x3e')][_0xf32b('0x49')]({'where':{'id':_0x397f6f[_0xf32b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e41e7,null))[_0xf32b('0x27')](removeEntity(_0x5e41e7,null))['catch'](handleError(_0x5e41e7,null));};exports[_0xf32b('0x4c')]=function(_0xe8eb55,_0x5da270){var _0x384d51;return db[_0xf32b('0x4d')]['transaction'](function(_0x226ed9){return db['CmCustomField'][_0xf32b('0x4c')](_0xe8eb55['body'],{'transaction':_0x226ed9})[_0xf32b('0x27')](function(_0x5b888d){_0x384d51=_0x5b888d;var _0x4cd76c={'type':db[_0xf32b('0x4e')]['TEXT'],'transaction':_0x226ed9};switch(_0xe8eb55[_0xf32b('0x4a')][_0xf32b('0x2e')]){case _0xf32b('0x4f'):_0x4cd76c[_0xf32b('0x2e')]=db[_0xf32b('0x4e')]['TEXT'];break;case'number':_0x4cd76c[_0xf32b('0x2e')]=db[_0xf32b('0x4e')][_0xf32b('0x50')];break;case _0xf32b('0x51'):_0x4cd76c['type']=db[_0xf32b('0x4e')]['BOOLEAN'];_0x4cd76c[_0xf32b('0x52')]=![];break;default:}return db['sequelize'][_0xf32b('0x53')]['addColumn']('cm_contacts',util['format'](_0xf32b('0x54'),_0x384d51['id']),_0x4cd76c);})[_0xf32b('0x27')](function(){return _0x384d51;});})[_0xf32b('0x27')](respondWithResult(_0x5da270,0xc9))['catch'](handleError(_0x5da270,null));};
\ No newline at end of file
+var _0x58d3=['update','body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','then','destroy','end','name','send','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options'];(function(_0x1a3ca2,_0xe144e7){var _0x30ea08=function(_0x37a9f6){while(--_0x37a9f6){_0x1a3ca2['push'](_0x1a3ca2['shift']());}};_0x30ea08(++_0xe144e7);}(_0x58d3,0x66));var _0x358d=function(_0x47eac3,_0x32de46){_0x47eac3=_0x47eac3-0x0;var _0x285837=_0x58d3[_0x47eac3];return _0x285837;};'use strict';var emlformat=require(_0x358d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x358d('0x1'));var jsonpatch=require(_0x358d('0x2'));var rp=require(_0x358d('0x3'));var moment=require(_0x358d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x358d('0x5'));var util=require('util');var path=require(_0x358d('0x6'));var sox=require(_0x358d('0x7'));var csv=require(_0x358d('0x8'));var ejs=require(_0x358d('0x9'));var fs=require('fs');var fs_extra=require(_0x358d('0xa'));var _=require(_0x358d('0xb'));var squel=require(_0x358d('0xc'));var crypto=require('crypto');var jsforce=require(_0x358d('0xd'));var deskjs=require(_0x358d('0xe'));var toCsv=require(_0x358d('0x8'));var querystring=require(_0x358d('0xf'));var Papa=require(_0x358d('0x10'));var Redis=require(_0x358d('0x11'));var authService=require(_0x358d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x358d('0x13'));var hardwareService=require(_0x358d('0x14'));var logger=require(_0x358d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x358d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x358d('0x17'))['db'];function respondWithStatusCode(_0x44caef,_0x5a665b){_0x5a665b=_0x5a665b||0xcc;return function(_0x5222e8){if(_0x5222e8){return _0x44caef[_0x358d('0x18')](_0x5a665b);}return _0x44caef['status'](_0x5a665b)['end']();};}function respondWithResult(_0x7a0ce2,_0x588a56){_0x588a56=_0x588a56||0xc8;return function(_0x4c5ced){if(_0x4c5ced){return _0x7a0ce2[_0x358d('0x19')](_0x588a56)[_0x358d('0x1a')](_0x4c5ced);}};}function respondWithFilteredResult(_0x502e3b,_0x573cc6){return function(_0x303ed4){if(_0x303ed4){var _0x2a81dc=typeof _0x573cc6[_0x358d('0x1b')]==='undefined'&&typeof _0x573cc6[_0x358d('0x1c')]===_0x358d('0x1d');var _0x707593=_0x303ed4[_0x358d('0x1e')];var _0x1845e7=_0x2a81dc?0x0:_0x573cc6[_0x358d('0x1b')];var _0x4e5f76=_0x2a81dc?_0x303ed4[_0x358d('0x1e')]:_0x573cc6['offset']+_0x573cc6[_0x358d('0x1c')];var _0x3d8003;if(_0x4e5f76>=_0x707593){_0x4e5f76=_0x707593;_0x3d8003=0xc8;}else{_0x3d8003=0xce;}_0x502e3b[_0x358d('0x19')](_0x3d8003);return _0x502e3b[_0x358d('0x1f')]('Content-Range',_0x1845e7+'-'+_0x4e5f76+'/'+_0x707593)[_0x358d('0x1a')](_0x303ed4);}return null;};}function patchUpdates(_0x2502f9){return function(_0x593e97){try{jsonpatch[_0x358d('0x20')](_0x593e97,_0x2502f9,!![]);}catch(_0x18ba7c){return BPromise[_0x358d('0x21')](_0x18ba7c);}return _0x593e97['save']();};}function saveUpdates(_0x567498,_0x3202dd){return function(_0x431b6d){if(_0x431b6d){return _0x431b6d['update'](_0x567498)[_0x358d('0x22')](function(_0xe11a94){return _0xe11a94;});}return null;};}function removeEntity(_0xca235a,_0x5521a4){return function(_0x21629e){if(_0x21629e){return _0x21629e[_0x358d('0x23')]()[_0x358d('0x22')](function(){_0xca235a[_0x358d('0x19')](0xcc)[_0x358d('0x24')]();});}};}function handleEntityNotFound(_0x223eb4,_0x313ede){return function(_0x21d992){if(!_0x21d992){_0x223eb4[_0x358d('0x18')](0x194);}return _0x21d992;};}function handleError(_0x370c51,_0x4ab646){_0x4ab646=_0x4ab646||0x1f4;return function(_0x3b317c){logger['error'](_0x3b317c['stack']);if(_0x3b317c[_0x358d('0x25')]){delete _0x3b317c['name'];}_0x370c51['status'](_0x4ab646)[_0x358d('0x26')](_0x3b317c);};}exports['index']=function(_0x27ec14,_0x3af3c7){var _0x204279={},_0x5220ed={},_0x2654a7={'count':0x0,'rows':[]};var _0x28647b=_['map'](db[_0x358d('0x27')][_0x358d('0x28')],function(_0x5a06ca){return{'name':_0x5a06ca[_0x358d('0x29')],'type':_0x5a06ca[_0x358d('0x2a')][_0x358d('0x2b')]};});_0x5220ed[_0x358d('0x2c')]=_[_0x358d('0x2d')](_[_0x358d('0x2e')](_0x28647b,_0x358d('0x25')),['name']);_0x5220ed[_0x358d('0x2f')]=_['keys'](_0x27ec14[_0x358d('0x2f')]);_0x5220ed[_0x358d('0x30')]=_[_0x358d('0x31')](_0x5220ed[_0x358d('0x2c')],_0x5220ed['query']);_0x204279['attributes']=_[_0x358d('0x31')](_0x5220ed['model'],qs[_0x358d('0x32')](_0x27ec14['query'][_0x358d('0x32')]));_0x204279[_0x358d('0x33')]=_0x204279['attributes']['length']?_0x204279['attributes']:_0x5220ed[_0x358d('0x2c')];if(!_0x27ec14[_0x358d('0x2f')][_0x358d('0x34')](_0x358d('0x35'))){_0x204279[_0x358d('0x1c')]=qs[_0x358d('0x1c')](_0x27ec14[_0x358d('0x2f')][_0x358d('0x1c')]);_0x204279[_0x358d('0x1b')]=qs[_0x358d('0x1b')](_0x27ec14[_0x358d('0x2f')][_0x358d('0x1b')]);}_0x204279[_0x358d('0x36')]=qs[_0x358d('0x37')](_0x27ec14[_0x358d('0x2f')][_0x358d('0x37')]);_0x204279[_0x358d('0x38')]=qs[_0x358d('0x30')](_[_0x358d('0x39')](_0x27ec14[_0x358d('0x2f')],_0x5220ed[_0x358d('0x30')]),_0x28647b);if(_0x27ec14['query'][_0x358d('0x3a')]){_0x204279[_0x358d('0x38')]=_[_0x358d('0x3b')](_0x204279[_0x358d('0x38')],{'$or':_[_0x358d('0x2e')](_0x28647b,function(_0xcb8c64){if(_0xcb8c64['type']!==_0x358d('0x3c')){var _0x1db2bb={};_0x1db2bb[_0xcb8c64[_0x358d('0x25')]]={'$like':'%'+_0x27ec14[_0x358d('0x2f')][_0x358d('0x3a')]+'%'};return _0x1db2bb;}})});}_0x204279=_[_0x358d('0x3b')]({},_0x204279,_0x27ec14['options']);var _0x1d579b={'where':_0x204279['where']};return db[_0x358d('0x27')][_0x358d('0x1e')](_0x1d579b)['then'](function(_0x3f741f){_0x2654a7[_0x358d('0x1e')]=_0x3f741f;if(_0x27ec14[_0x358d('0x2f')][_0x358d('0x3d')]){_0x204279[_0x358d('0x3e')]=[{'all':!![]}];}return db[_0x358d('0x27')][_0x358d('0x3f')](_0x204279);})['then'](function(_0x35907e){_0x2654a7[_0x358d('0x40')]=_0x35907e;return _0x2654a7;})[_0x358d('0x22')](respondWithFilteredResult(_0x3af3c7,_0x204279))[_0x358d('0x41')](handleError(_0x3af3c7,null));};exports[_0x358d('0x42')]=function(_0x5949b0,_0x59e33a){var _0x1b0f54={'raw':!![],'where':{'id':_0x5949b0[_0x358d('0x43')]['id']}},_0x470d9d={};_0x470d9d[_0x358d('0x2c')]=_[_0x358d('0x44')](db[_0x358d('0x27')][_0x358d('0x28')]);_0x470d9d[_0x358d('0x2f')]=_[_0x358d('0x44')](_0x5949b0['query']);_0x470d9d[_0x358d('0x30')]=_['intersection'](_0x470d9d['model'],_0x470d9d[_0x358d('0x2f')]);_0x1b0f54[_0x358d('0x33')]=_['intersection'](_0x470d9d[_0x358d('0x2c')],qs[_0x358d('0x32')](_0x5949b0['query'][_0x358d('0x32')]));_0x1b0f54[_0x358d('0x33')]=_0x1b0f54['attributes']['length']?_0x1b0f54[_0x358d('0x33')]:_0x470d9d['model'];if(_0x5949b0[_0x358d('0x2f')]['includeAll']){_0x1b0f54[_0x358d('0x3e')]=[{'all':!![]}];}_0x1b0f54=_[_0x358d('0x3b')]({},_0x1b0f54,_0x5949b0[_0x358d('0x45')]);return db[_0x358d('0x27')]['find'](_0x1b0f54)[_0x358d('0x22')](handleEntityNotFound(_0x59e33a,null))[_0x358d('0x22')](respondWithResult(_0x59e33a,null))[_0x358d('0x41')](handleError(_0x59e33a,null));};exports[_0x358d('0x46')]=function(_0x2e1e26,_0x4f0500){if(_0x2e1e26[_0x358d('0x47')]['id']){delete _0x2e1e26[_0x358d('0x47')]['id'];}return db[_0x358d('0x27')][_0x358d('0x48')]({'where':{'id':_0x2e1e26[_0x358d('0x43')]['id']}})[_0x358d('0x22')](handleEntityNotFound(_0x4f0500,null))[_0x358d('0x22')](saveUpdates(_0x2e1e26[_0x358d('0x47')],null))[_0x358d('0x22')](respondWithResult(_0x4f0500,null))[_0x358d('0x41')](handleError(_0x4f0500,null));};exports[_0x358d('0x23')]=function(_0x2f7265,_0x4ea167){return db['CmCustomField'][_0x358d('0x48')]({'where':{'id':_0x2f7265[_0x358d('0x43')]['id']}})[_0x358d('0x22')](handleEntityNotFound(_0x4ea167,null))[_0x358d('0x22')](removeEntity(_0x4ea167,null))['catch'](handleError(_0x4ea167,null));};exports[_0x358d('0x49')]=function(_0xecc190,_0x1013f3){var _0x55d156;return db[_0x358d('0x4a')][_0x358d('0x4b')](function(_0x2c0013){return db[_0x358d('0x27')]['create'](_0xecc190[_0x358d('0x47')],{'transaction':_0x2c0013})['then'](function(_0x5b4483){_0x55d156=_0x5b4483;var _0x436ed0={'type':db[_0x358d('0x4c')][_0x358d('0x4d')],'transaction':_0x2c0013};switch(_0xecc190[_0x358d('0x47')][_0x358d('0x2a')]){case _0x358d('0x4e'):_0x436ed0[_0x358d('0x2a')]=db['Sequelize'][_0x358d('0x4d')];break;case _0x358d('0x4f'):_0x436ed0[_0x358d('0x2a')]=db['Sequelize'][_0x358d('0x50')];break;case _0x358d('0x51'):_0x436ed0[_0x358d('0x2a')]=db['Sequelize'][_0x358d('0x52')];_0x436ed0[_0x358d('0x53')]=![];break;default:}return db[_0x358d('0x4a')][_0x358d('0x54')]['addColumn']('cm_contacts',util[_0x358d('0x55')]('cf_%d',_0x55d156['id']),_0x436ed0);})[_0x358d('0x22')](function(){return _0x55d156;});})[_0x358d('0x22')](respondWithResult(_0x1013f3,0xc9))[_0x358d('0x41')](handleError(_0x1013f3,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6fa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','cm_custom_fields','lodash','../../config/logger'];(function(_0x4d98e6,_0x290e7a){var _0x1c648d=function(_0x2003ba){while(--_0x2003ba){_0x4d98e6['push'](_0x4d98e6['shift']());}};_0x1c648d(++_0x290e7a);}(_0xa6fa,0x196));var _0xaa6f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa6fa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xaa6f('0x0'));var util=require('util');var logger=require(_0xaa6f('0x1'))(_0xaa6f('0x2'));var moment=require(_0xaa6f('0x3'));var BPromise=require(_0xaa6f('0x4'));var rp=require(_0xaa6f('0x5'));var fs=require('fs');var path=require(_0xaa6f('0x6'));var rimraf=require(_0xaa6f('0x7'));var config=require(_0xaa6f('0x8'));var attributes=require(_0xaa6f('0x9'));module[_0xaa6f('0xa')]=function(_0x3ed08f,_0x3f64f5){return _0x3ed08f['define']('CmCustomField',attributes,{'tableName':_0xaa6f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc49b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc49b,0x1da));var _0xbc49=function(_0x5cdbc4,_0xdc831b){_0x5cdbc4=_0x5cdbc4-0x0;var _0x35c946=_0xc49b[_0x5cdbc4];return _0x35c946;};'use strict';var _=require(_0xbc49('0x0'));var util=require(_0xbc49('0x1'));var logger=require(_0xbc49('0x2'))(_0xbc49('0x3'));var moment=require(_0xbc49('0x4'));var BPromise=require(_0xbc49('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc49('0x6'));var rimraf=require(_0xbc49('0x7'));var config=require(_0xbc49('0x8'));var attributes=require(_0xbc49('0x9'));module[_0xbc49('0xa')]=function(_0x222481,_0x13731e){return _0x222481[_0xbc49('0xb')](_0xbc49('0xc'),attributes,{'tableName':_0xbc49('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4a7=['CmCustomField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x117026,_0xde804f){var _0x5b70f3=function(_0x16ac91){while(--_0x16ac91){_0x117026['push'](_0x117026['shift']());}};_0x5b70f3(++_0xde804f);}(_0xc4a7,0x163));var _0x7c4a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4a7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var moment=require(_0x7c4a('0x2'));var BPromise=require(_0x7c4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c4a('0x4'));var db=require(_0x7c4a('0x5'))['db'];var utils=require(_0x7c4a('0x6'));var logger=require(_0x7c4a('0x7'))(_0x7c4a('0x8'));var config=require(_0x7c4a('0x9'));var jayson=require(_0x7c4a('0xa'));var client=jayson[_0x7c4a('0xb')][_0x7c4a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31fb00,_0xc6851d,_0x1d9e6c){return new BPromise(function(_0x4696a7,_0x27a14f){return client[_0x7c4a('0xd')](_0x31fb00,_0x1d9e6c)[_0x7c4a('0xe')](function(_0xc66d54){logger['info']('CmCustomField,\x20%s,\x20%s',_0xc6851d,_0x7c4a('0xf'));logger[_0x7c4a('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xc6851d,_0x7c4a('0xf'),JSON[_0x7c4a('0x11')](_0xc66d54));if(_0xc66d54[_0x7c4a('0x12')]){if(_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x13')]===0x1f4){logger[_0x7c4a('0x12')](_0x7c4a('0x14'),_0xc6851d,_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);return _0x27a14f(_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);}logger[_0x7c4a('0x12')]('CmCustomField,\x20%s,\x20%s',_0xc6851d,_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);return _0x4696a7(_0xc66d54[_0x7c4a('0x12')][_0x7c4a('0x15')]);}else{logger[_0x7c4a('0x16')]('CmCustomField,\x20%s,\x20%s',_0xc6851d,_0x7c4a('0xf'));_0x4696a7(_0xc66d54[_0x7c4a('0x17')][_0x7c4a('0x15')]);}})[_0x7c4a('0x18')](function(_0x48cd52){logger[_0x7c4a('0x12')](_0x7c4a('0x14'),_0xc6851d,_0x48cd52);_0x27a14f(_0x48cd52);});});}
\ No newline at end of file
+var _0x8bb3=['client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x56d550,_0x1c3fd0){var _0x5e6a91=function(_0x28fde4){while(--_0x28fde4){_0x56d550['push'](_0x56d550['shift']());}};_0x5e6a91(++_0x1c3fd0);}(_0x8bb3,0xb3));var _0x38bb=function(_0x56a191,_0xf1eedb){_0x56a191=_0x56a191-0x0;var _0x2da33b=_0x8bb3[_0x56a191];return _0x2da33b;};'use strict';var _=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x38bb('0x2'));var fs=require('fs');var Redis=require(_0x38bb('0x3'));var db=require(_0x38bb('0x4'))['db'];var utils=require(_0x38bb('0x5'));var logger=require(_0x38bb('0x6'))(_0x38bb('0x7'));var config=require(_0x38bb('0x8'));var jayson=require(_0x38bb('0x9'));var client=jayson[_0x38bb('0xa')][_0x38bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f4d7e,_0x19df70,_0x39ff56){return new BPromise(function(_0x5a7de2,_0x2f6041){return client['request'](_0x2f4d7e,_0x39ff56)[_0x38bb('0xc')](function(_0x4e5bf5){logger[_0x38bb('0xd')](_0x38bb('0xe'),_0x19df70,_0x38bb('0xf'));logger[_0x38bb('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x19df70,'request\x20sent',JSON[_0x38bb('0x11')](_0x4e5bf5));if(_0x4e5bf5[_0x38bb('0x12')]){if(_0x4e5bf5[_0x38bb('0x12')]['code']===0x1f4){logger['error'](_0x38bb('0xe'),_0x19df70,_0x4e5bf5['error'][_0x38bb('0x13')]);return _0x2f6041(_0x4e5bf5[_0x38bb('0x12')][_0x38bb('0x13')]);}logger[_0x38bb('0x12')](_0x38bb('0xe'),_0x19df70,_0x4e5bf5['error']['message']);return _0x5a7de2(_0x4e5bf5[_0x38bb('0x12')][_0x38bb('0x13')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x19df70,_0x38bb('0xf'));_0x5a7de2(_0x4e5bf5[_0x38bb('0x14')][_0x38bb('0x13')]);}})['catch'](function(_0x2622ec){logger[_0x38bb('0x12')](_0x38bb('0xe'),_0x19df70,_0x2622ec);_0x2f6041(_0x2622ec);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8585=['../../config/environment','./cmCustomField.controller','index','get','/:id','post','isAuthenticated','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x4e538e,_0x2f2a57){var _0x276652=function(_0x5b3a81){while(--_0x5b3a81){_0x4e538e['push'](_0x4e538e['shift']());}};_0x276652(++_0x2f2a57);}(_0x8585,0x64));var _0x5858=function(_0x47d6b2,_0x35b42d){_0x47d6b2=_0x47d6b2-0x0;var _0x395b74=_0x8585[_0x47d6b2];return _0x395b74;};'use strict';var multer=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var path=require(_0x5858('0x2'));var timeout=require('connect-timeout');var express=require(_0x5858('0x3'));var router=express[_0x5858('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5858('0x5'));var controller=require(_0x5858('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5858('0x7')]);router[_0x5858('0x8')](_0x5858('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5858('0xa')]('/',auth[_0x5858('0xb')](),controller['create']);router['put'](_0x5858('0x9'),auth[_0x5858('0xb')](),controller['update']);router[_0x5858('0xc')](_0x5858('0x9'),auth[_0x5858('0xb')](),controller[_0x5858('0xd')]);module[_0x5858('0xe')]=router;
\ No newline at end of file
+var _0x510e=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0x510e,0x1ed));var _0xe510=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x510e[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xe510('0x0'));var util=require(_0xe510('0x1'));var path=require(_0xe510('0x2'));var timeout=require(_0xe510('0x3'));var express=require(_0xe510('0x4'));var router=express[_0xe510('0x5')]();var fs_extra=require(_0xe510('0x6'));var auth=require(_0xe510('0x7'));var interaction=require(_0xe510('0x8'));var config=require('../../config/environment');var controller=require(_0xe510('0x9'));router[_0xe510('0xa')]('/',auth[_0xe510('0xb')](),controller[_0xe510('0xc')]);router[_0xe510('0xa')](_0xe510('0xd'),auth[_0xe510('0xb')](),controller[_0xe510('0xe')]);router[_0xe510('0xf')]('/',auth[_0xe510('0xb')](),controller[_0xe510('0x10')]);router[_0xe510('0x11')](_0xe510('0xd'),auth[_0xe510('0xb')](),controller['update']);router[_0xe510('0x12')](_0xe510('0xd'),auth[_0xe510('0xb')](),controller[_0xe510('0x13')]);module[_0xe510('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e4c=['INTEGER','STRING','DATE','contactListQueue','moment','sequelize','exports','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x0e4c,0x90));var _0xc0e4=function(_0x25db72,_0x46274d){_0x25db72=_0x25db72-0x0;var _0x108a0f=_0x0e4c[_0x25db72];return _0x108a0f;};'use strict';var moment=require(_0xc0e4('0x0'));var Sequelize=require(_0xc0e4('0x1'));module[_0xc0e4('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xc0e4('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc0e4('0x4')](_0xc0e4('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc0e4('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc0e4('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc0e4('0x8')]},'priority':{'type':Sequelize[_0xc0e4('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc0e4('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc0e4('0x6')],'unique':_0xc0e4('0x9')},'ListId':{'type':Sequelize[_0xc0e4('0x6')],'unique':_0xc0e4('0x9')},'UserId':{'type':Sequelize[_0xc0e4('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xc0e4('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc0e4('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xc0e4('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x7b4f=['contactListQueue','exports','BOOLEAN','DATE','INTEGER','STRING'];(function(_0x4e87ba,_0x2d95f9){var _0x212b08=function(_0x763e51){while(--_0x763e51){_0x4e87ba['push'](_0x4e87ba['shift']());}};_0x212b08(++_0x2d95f9);}(_0x7b4f,0x91));var _0xf7b4=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0x7b4f[_0x15f3c0];return _0x1adfe0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xf7b4('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xf7b4('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf7b4('0x2')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf7b4('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf7b4('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf7b4('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf7b4('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf7b4('0x3')],'unique':_0xf7b4('0x5')},'ListId':{'type':Sequelize[_0xf7b4('0x3')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xf7b4('0x3')]},'VoiceQueueId':{'type':Sequelize[_0xf7b4('0x3')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xf7b4('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf7b4('0x3')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xf7b4('0x2')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6737=['$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','CmHopper','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','calleridname','isNil','lastName','finally','CmHopperFinal','end','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','recallme','CmCompany','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','limit','count','offset','set','Content-Range','json','update','then','sendStatus','error','stack','send','rawAttributes','type','key','model','map','name','query','filters','intersection','$and','$or','$gt','$gte','$lt'];(function(_0x23a04d,_0x18c735){var _0x30b21c=function(_0x3ff497){while(--_0x3ff497){_0x23a04d['push'](_0x23a04d['shift']());}};_0x30b21c(++_0x18c735);}(_0x6737,0xe2));var _0x7673=function(_0x30f45e,_0x2d09a4){_0x30f45e=_0x30f45e-0x0;var _0xad0513=_0x6737[_0x30f45e];return _0xad0513;};'use strict';var moment=require('moment');var _=require(_0x7673('0x0'));var qs=require(_0x7673('0x1'));var logger=require('../../config/logger')(_0x7673('0x2'));var shared=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];function respondWithResult(_0x12efff,_0x54002e){_0x54002e=_0x54002e||0xc8;return function(_0x32e6f2){if(_0x32e6f2){return _0x12efff[_0x7673('0x5')](_0x54002e)['json'](_0x32e6f2);}};}function respondWithFilteredResult(_0x2f5edc,_0x15230f){return function(_0x5af802){if(_0x5af802){var _0x4e4b24=typeof _0x15230f['offset']==='undefined'&&typeof _0x15230f[_0x7673('0x6')]==='undefined';var _0x3b3184=_0x5af802[_0x7673('0x7')];var _0x5bfae2=_0x4e4b24?0x0:_0x15230f[_0x7673('0x8')];var _0x331f57=_0x4e4b24?_0x5af802[_0x7673('0x7')]:_0x15230f['offset']+_0x15230f['limit'];var _0x3ca258;if(_0x331f57>=_0x3b3184){_0x331f57=_0x3b3184;_0x3ca258=0xc8;}else{_0x3ca258=0xce;}_0x2f5edc['status'](_0x3ca258);return _0x2f5edc[_0x7673('0x9')](_0x7673('0xa'),_0x5bfae2+'-'+_0x331f57+'/'+_0x3b3184)[_0x7673('0xb')](_0x5af802);}return null;};}function saveUpdates(_0x451c87,_0x41d6bd){return function(_0x119e42){if(_0x119e42){return _0x119e42[_0x7673('0xc')](_0x451c87)[_0x7673('0xd')](function(_0x1da115){return _0x1da115;});}return null;};}function handleEntityNotFound(_0x20a649,_0x5c8626){return function(_0x26f0c4){if(!_0x26f0c4){_0x20a649[_0x7673('0xe')](0x194);}return _0x26f0c4;};}function handleError(_0x408470,_0x2c83d){_0x2c83d=_0x2c83d||0x1f4;return function(_0x224cea){logger[_0x7673('0xf')](_0x224cea[_0x7673('0x10')]);if(_0x224cea['name']){delete _0x224cea['name'];}_0x408470[_0x7673('0x5')](_0x2c83d)[_0x7673('0x11')](_0x224cea);};}exports['index']=function(_0x3afbb3,_0x17699a){var _0x58a821={},_0x33ff7d={},_0x44704d={'count':0x0,'rows':[]};var _0x1015ba=_['map'](db['CmHopper'][_0x7673('0x12')],function(_0x267fa3){return{'name':_0x267fa3['fieldName'],'type':_0x267fa3[_0x7673('0x13')][_0x7673('0x14')]};});_0x33ff7d[_0x7673('0x15')]=_[_0x7673('0x16')](_0x1015ba,_0x7673('0x17'));_0x33ff7d[_0x7673('0x18')]=_['keys'](_0x3afbb3['query']);_0x33ff7d[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],_0x33ff7d[_0x7673('0x18')]);_0x33ff7d[_0x7673('0x19')]=_['concat'](_0x33ff7d[_0x7673('0x19')],[_0x7673('0x1b'),_0x7673('0x1c'),_0x7673('0x1d'),_0x7673('0x1e'),_0x7673('0x1f'),'$lte',_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),'$notBetween','$in',_0x7673('0x24'),_0x7673('0x25'),_0x7673('0x26'),_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x25'),_0x7673('0x29'),'$contains','$contained',_0x7673('0x2a')]);_0x58a821[_0x7673('0x2b')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],qs[_0x7673('0x2c')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x2c')]));_0x58a821['attributes']=_0x58a821['attributes'][_0x7673('0x2d')]?_0x58a821[_0x7673('0x2b')]:_0x33ff7d[_0x7673('0x15')];if(!_0x3afbb3[_0x7673('0x18')]['hasOwnProperty'](_0x7673('0x2e'))){_0x58a821['limit']=qs[_0x7673('0x6')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x6')]);_0x58a821[_0x7673('0x8')]=qs[_0x7673('0x8')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x8')]);}_0x58a821[_0x7673('0x2f')]=qs[_0x7673('0x30')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x30')]);_0x58a821[_0x7673('0x31')]=qs[_0x7673('0x19')](_['pick'](_0x3afbb3[_0x7673('0x18')],_0x33ff7d[_0x7673('0x19')]),_0x1015ba);if(_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]){_0x58a821[_0x7673('0x31')]=_[_0x7673('0x33')](_0x58a821[_0x7673('0x31')],{'$or':_['map'](_0x1015ba,function(_0x563e2d){if(_0x563e2d[_0x7673('0x13')]!==_0x7673('0x34')){var _0x2d34cb={};_0x2d34cb[_0x563e2d[_0x7673('0x17')]]={'$like':'%'+_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]+'%'};return _0x2d34cb;}})});}_0x58a821=_[_0x7673('0x33')]({},_0x58a821,_0x3afbb3['options']);var _0x2845f6={'where':_0x58a821[_0x7673('0x31')]};return db['CmHopper'][_0x7673('0x7')](_0x2845f6)[_0x7673('0xd')](function(_0x287eee){_0x44704d[_0x7673('0x7')]=_0x287eee;if(_0x3afbb3['query'][_0x7673('0x35')]){_0x58a821[_0x7673('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0x7673('0x37')](_0x58a821);})[_0x7673('0xd')](function(_0x1be04a){_0x44704d['rows']=_0x1be04a;return _0x44704d;})[_0x7673('0xd')](respondWithFilteredResult(_0x17699a,_0x58a821))[_0x7673('0x38')](handleError(_0x17699a,null));};exports[_0x7673('0x39')]=function(_0x5dfb9a,_0x4c6106){var _0x13ce30={'raw':!![],'where':{'id':_0x5dfb9a['params']['id']}},_0x5efdf6={};_0x5efdf6[_0x7673('0x15')]=_[_0x7673('0x3a')](db['CmHopper'][_0x7673('0x12')]);_0x5efdf6[_0x7673('0x18')]=_[_0x7673('0x3a')](_0x5dfb9a[_0x7673('0x18')]);_0x5efdf6[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x5efdf6['model'],_0x5efdf6[_0x7673('0x18')]);_0x13ce30['attributes']=_[_0x7673('0x1a')](_0x5efdf6['model'],qs[_0x7673('0x2c')](_0x5dfb9a[_0x7673('0x18')]['fields']));_0x13ce30['attributes']=_0x13ce30[_0x7673('0x2b')]['length']?_0x13ce30[_0x7673('0x2b')]:_0x5efdf6[_0x7673('0x15')];if(_0x5dfb9a[_0x7673('0x18')][_0x7673('0x35')]){_0x13ce30[_0x7673('0x36')]=[{'all':!![]}];}_0x13ce30=_['merge']({},_0x13ce30,_0x5dfb9a['options']);return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x13ce30)['then'](handleEntityNotFound(_0x4c6106,null))[_0x7673('0xd')](respondWithResult(_0x4c6106,null))[_0x7673('0x38')](handleError(_0x4c6106,null));};exports[_0x7673('0x3d')]=function(_0x5991d7,_0x1a9017){return db[_0x7673('0x3b')][_0x7673('0x3d')](_0x5991d7[_0x7673('0x3e')],{})[_0x7673('0xd')](respondWithResult(_0x1a9017,0xc9))[_0x7673('0x38')](handleError(_0x1a9017,null));};exports[_0x7673('0xc')]=function(_0x232576,_0x58e17d){if(_0x232576['body']['id']){delete _0x232576[_0x7673('0x3e')]['id'];}return db[_0x7673('0x3b')][_0x7673('0x3c')]({'where':{'id':_0x232576[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x58e17d,null))[_0x7673('0xd')](saveUpdates(_0x232576[_0x7673('0x3e')],null))['then'](respondWithResult(_0x58e17d,null))[_0x7673('0x38')](handleError(_0x58e17d,null));};exports[_0x7673('0x40')]=function(_0x461ac3,_0x2de2e9){return db[_0x7673('0x3b')]['describe']()[_0x7673('0xd')](respondWithResult(_0x2de2e9,null))[_0x7673('0x38')](handleError(_0x2de2e9,null));};exports[_0x7673('0x41')]=function(_0x2397fb,_0x3f76a3){var _0x4c022d;var _0x56cd7a=_0x2397fb[_0x7673('0x3f')]['id'];return db[_0x7673('0x3b')]['find']({'where':{'id':_0x2397fb[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x3f76a3,null))[_0x7673('0xd')](function(_0x32a5e7){if(_0x32a5e7){return _0x32a5e7[_0x7673('0x41')]()['then'](function(_0x23789d){return _0x23789d;});}})[_0x7673('0xd')](function(_0x2a275b){_0x4c022d=_0x2a275b;if(_0x2a275b){if(_0x2a275b[_0x7673('0x42')]||_0x2a275b['CampaignId']){return db[_0x2a275b[_0x7673('0x42')]?_0x7673('0x43'):_0x7673('0x44')][_0x7673('0x3c')]({'where':{'id':_0x2a275b[_0x7673('0x42')]?_0x2a275b[_0x7673('0x42')]:_0x2a275b[_0x7673('0x45')]},'attributes':['id',_0x7673('0x17')],'raw':!![]});}}})[_0x7673('0xd')](function(_0x362409){var _0xcb9e0b={};if(_0x362409){_['merge'](_0xcb9e0b,_[_0x7673('0x46')](_0x4c022d['dataValues'],[_0x7673('0x47'),_0x7673('0x48'),'id']));_0xcb9e0b[_0x7673('0x49')]=0x15;_0xcb9e0b['statedesc']=_0x7673('0x4a');_0xcb9e0b[_0x7673('0x4b')]=_0x362409[_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4c')]=_0x2397fb[_0x7673('0x4d')][_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4e')]=_0x2397fb[_0x7673('0x4d')]['id'];_0xcb9e0b[_0x7673('0x4a')]=!![];_0xcb9e0b[_0x7673('0x4f')]=moment()[_0x7673('0x50')](_0x7673('0x51'));_0xcb9e0b[_0x7673('0x52')]=_0x4c022d[_0x7673('0x53')];_0xcb9e0b['campaigntype']=_0x4c022d[_0x7673('0x42')]?'queue':_0x7673('0x54');return db[_0x7673('0x55')][_0x7673('0x3c')]({'where':{'id':_0xcb9e0b['ContactId']},'attributes':[_0x7673('0x56'),'lastName']})['then'](function(_0x1804a4){if(!_['isNil'](_0x3f76a3)&&!_['isNil'](_0x1804a4[_0x7673('0x56')])){_0xcb9e0b[_0x7673('0x57')]=_0x1804a4[_0x7673('0x56')];if(!_[_0x7673('0x58')](_0x1804a4[_0x7673('0x59')])){_0xcb9e0b[_0x7673('0x57')]+='\x20'+_0x1804a4[_0x7673('0x59')];}}})[_0x7673('0x5a')](function(){return db[_0x7673('0x5b')][_0x7673('0x3d')](_0xcb9e0b);});}})[_0x7673('0xd')](function(_0x5e1985){return db['CmHopperAdditionalPhone'][_0x7673('0x41')]({'where':{'CmHopperId':_0x56cd7a}});})[_0x7673('0xd')](function(){return _0x3f76a3[_0x7673('0x5')](0xcc)[_0x7673('0x5c')]();})[_0x7673('0x38')](handleError(_0x3f76a3,null));};exports['getPreview']=function(_0x5caca9,_0x44fa26){var _0x7ac2d=[];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x47b5b3){_0x7ac2d=_[_0x7673('0x3a')](_0x47b5b3);return _0x5caca9[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x7673('0x5f')],'raw':!![]});})[_0x7673('0xd')](function(_0x31be3a){if(_0x31be3a&&_0x31be3a['length']){return db[_0x7673('0x60')][_0x7673('0x61')](function(_0x562a20){var _0x53c638={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x31be3a,'id')},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x40776d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31be3a)['filter']([_0x7673('0x5f'),0x0])['map']('id')[_0x7673('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x12cfe7={'$or':[_0x53c638,_0x40776d]};var _0x2a8feb=[];if(_0x5caca9['body'][_0x7673('0x63')]&&_0x5caca9[_0x7673('0x3e')][_0x7673('0x63')]==='prev'){if(!_['isEmpty'](_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')])){_0x12cfe7['id']={'$in':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'ASC'],[_0x7673('0x66'),_0x31be3a[0x0][_0x7673('0x67')]==='ASC'?'DESC':'ASC'],db[_0x7673('0x60')][_0x7673('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7673('0x69')]];}else{if(!_['isEmpty'](_0x5caca9['body'][_0x7673('0x64')])){_0x12cfe7['id']={'$notIn':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'DESC'],[_0x7673('0x66'),_0x31be3a[0x0]['dialOrderByScheduledAt']],db[_0x7673('0x60')][_0x7673('0x68')](_0x7673('0x6a')),['id',_0x7673('0x6b')]];}return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),'phone','recallme'],'where':_0x12cfe7,'order':_0x2a8feb,'transaction':_0x562a20,'lock':_0x562a20[_0x7673('0x6e')][_0x7673('0x6f')],'include':[{'model':db[_0x7673('0x55')],'as':_0x7673('0x70'),'attributes':_0x7ac2d,'include':[{'model':db['CmCompany'],'as':_0x7673('0x71'),'attributes':['id',_0x7673('0x17')]}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id',_0x7673('0x17'),_0x7673('0x75')]}]})['then'](function(_0x376f42){if(_0x376f42){return _0x376f42[_0x7673('0xc')]({'UserId':_0x5caca9[_0x7673('0x4d')]['id']},{'transaction':_0x562a20});}});});}})[_0x7673('0xd')](handleEntityNotFound(_0x44fa26,null))[_0x7673('0xd')](respondWithResult(_0x44fa26,null))[_0x7673('0x38')](handleError(_0x44fa26,null));};exports['getPreviewRecall']=function(_0xc74a16,_0x36a751,_0xc6660d){var _0x413d2a=[];var _0x1a32e3=_0xc74a16[_0x7673('0x3f')]['id'];var _0x533e5b=_0xc74a16[_0x7673('0x4d')]['id'];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x52de39){_0x413d2a=_[_0x7673('0x3a')](_0x52de39);return db[_0x7673('0x60')][_0x7673('0x61')](function(_0xc4e03e){const _0xfed5e5={'id':_0x1a32e3};return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),_0x7673('0x76')],'where':_0xfed5e5,'transaction':_0xc4e03e,'lock':_0xc4e03e[_0x7673('0x6e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x7673('0x70'),'attributes':_0x413d2a,'include':[{'model':db[_0x7673('0x77')],'as':_0x7673('0x71'),'attributes':['id','name']}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id','name',_0x7673('0x75')]}]})[_0x7673('0xd')](function(_0x4c7b28){if(_0x4c7b28){return _0x4c7b28['update']({'UserId':_0x533e5b},{'transaction':_0xc4e03e});}});});})[_0x7673('0xd')](handleEntityNotFound(_0x36a751,null))[_0x7673('0xd')](respondWithResult(_0x36a751,null))['catch'](handleError(_0x36a751,null));};exports['getOpenContacts']=function(_0x384aac,_0x595493){return _0x384aac[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':_0x7673('0x78'),'dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id'],'raw':!![]})[_0x7673('0xd')](function(_0x3c82d3){if(_0x3c82d3&&_0x3c82d3[_0x7673('0x2d')]){return db[_0x7673('0x3b')][_0x7673('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x3c82d3,'id')},'$or':[{'UserId':null},{'UserId':_0x384aac[_0x7673('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1cc5c2){if(!_[_0x7673('0x58')](_0x1cc5c2)&&_[_0x7673('0x79')](_0x1cc5c2)){return _0x595493[_0x7673('0x5')](0xc8)[_0x7673('0xb')]({'contacts':_0x1cc5c2});}else{logger[_0x7673('0xf')](_0x7673('0x7a'),'getOpenContacts',0x194,_0x7673('0x7b'));_0x595493['sendStatus'](0x194);}})[_0x7673('0x38')](handleError(_0x595493,null));};exports[_0x7673('0x7c')]=function(_0x1c61f9,_0x3a7767){var _0x4ed050=shared[_0x7673('0x7d')];var _0x31e97c=[];_[_0x7673('0x16')](_0x4ed050,function(_0x541a8a){_0x31e97c[_0x7673('0x7e')]({'id':_0x541a8a[_0x7673('0x17')],'name':_0x541a8a[_0x7673('0x17')],'utcOffset':_0x541a8a[_0x7673('0x7f')]});});return _0x3a7767['status'](0xc8)[_0x7673('0xb')]({'tz':_0x31e97c});};exports[_0x7673('0x80')]=function(_0x493c4d,_0x2d3583){var _0x332c63=shared['timezones'];var _0x3ba1aa={};if(!_['isNil'](_0x332c63[_0x493c4d[_0x7673('0x3e')]['id']]))_0x3ba1aa=_0x332c63[_0x493c4d['body']['id']];return _0x2d3583[_0x7673('0x5')](0xc8)[_0x7673('0xb')](_0x3ba1aa);};
\ No newline at end of file
+var _0xbd50=['set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','query','keys','filters','intersection','concat','$and','$gte','$lt','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','create','catch','body','find','describe','destroy','CampaignId','Campaign','VoiceQueueId','createdAt','updatedAt','state','deleted','campaign','membername','UserId','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','CmContact','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','getPreviewRecall','findOne','dialActive','getOpenContacts','getVoiceQueues','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','json','getTimezone','moment','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','offset','undefined','count','limit','status'];(function(_0x7eb23a,_0x5ccc80){var _0xc7b39e=function(_0x27ee63){while(--_0x27ee63){_0x7eb23a['push'](_0x7eb23a['shift']());}};_0xc7b39e(++_0x5ccc80);}(_0xbd50,0x196));var _0x0bd5=function(_0x3dfb56,_0xfe844d){_0x3dfb56=_0x3dfb56-0x0;var _0x5e6e1b=_0xbd50[_0x3dfb56];return _0x5e6e1b;};'use strict';var moment=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var qs=require(_0x0bd5('0x2'));var logger=require('../../config/logger')(_0x0bd5('0x3'));var shared=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];function respondWithResult(_0x1e9877,_0x15620d){_0x15620d=_0x15620d||0xc8;return function(_0x4c17ee){if(_0x4c17ee){return _0x1e9877['status'](_0x15620d)['json'](_0x4c17ee);}};}function respondWithFilteredResult(_0x376024,_0x2ef1d0){return function(_0xcc6cfa){if(_0xcc6cfa){var _0x2c0db1=typeof _0x2ef1d0[_0x0bd5('0x6')]==='undefined'&&typeof _0x2ef1d0['limit']===_0x0bd5('0x7');var _0x25e31e=_0xcc6cfa[_0x0bd5('0x8')];var _0x5f5a0c=_0x2c0db1?0x0:_0x2ef1d0[_0x0bd5('0x6')];var _0x2fa7d1=_0x2c0db1?_0xcc6cfa['count']:_0x2ef1d0[_0x0bd5('0x6')]+_0x2ef1d0[_0x0bd5('0x9')];var _0x4d7d17;if(_0x2fa7d1>=_0x25e31e){_0x2fa7d1=_0x25e31e;_0x4d7d17=0xc8;}else{_0x4d7d17=0xce;}_0x376024[_0x0bd5('0xa')](_0x4d7d17);return _0x376024[_0x0bd5('0xb')](_0x0bd5('0xc'),_0x5f5a0c+'-'+_0x2fa7d1+'/'+_0x25e31e)['json'](_0xcc6cfa);}return null;};}function saveUpdates(_0x2f7a0c,_0x23982f){return function(_0x2f9588){if(_0x2f9588){return _0x2f9588[_0x0bd5('0xd')](_0x2f7a0c)[_0x0bd5('0xe')](function(_0x557be0){return _0x557be0;});}return null;};}function handleEntityNotFound(_0x30765e,_0x1e961d){return function(_0x4f485b){if(!_0x4f485b){_0x30765e[_0x0bd5('0xf')](0x194);}return _0x4f485b;};}function handleError(_0x325e43,_0x574315){_0x574315=_0x574315||0x1f4;return function(_0x31349f){logger[_0x0bd5('0x10')](_0x31349f[_0x0bd5('0x11')]);if(_0x31349f[_0x0bd5('0x12')]){delete _0x31349f['name'];}_0x325e43[_0x0bd5('0xa')](_0x574315)[_0x0bd5('0x13')](_0x31349f);};}exports[_0x0bd5('0x14')]=function(_0x277b32,_0x833c14){var _0x23be38={},_0xc58e12={},_0x19fe20={'count':0x0,'rows':[]};var _0x29fa4c=_[_0x0bd5('0x15')](db[_0x0bd5('0x16')][_0x0bd5('0x17')],function(_0x4008bd){return{'name':_0x4008bd[_0x0bd5('0x18')],'type':_0x4008bd['type']['key']};});_0xc58e12['model']=_['map'](_0x29fa4c,'name');_0xc58e12[_0x0bd5('0x19')]=_[_0x0bd5('0x1a')](_0x277b32[_0x0bd5('0x19')]);_0xc58e12[_0x0bd5('0x1b')]=_[_0x0bd5('0x1c')](_0xc58e12['model'],_0xc58e12[_0x0bd5('0x19')]);_0xc58e12[_0x0bd5('0x1b')]=_[_0x0bd5('0x1d')](_0xc58e12['filters'],[_0x0bd5('0x1e'),'$or','$gt',_0x0bd5('0x1f'),_0x0bd5('0x20'),_0x0bd5('0x21'),'$ne',_0x0bd5('0x22'),'$not',_0x0bd5('0x23'),_0x0bd5('0x24'),_0x0bd5('0x25'),_0x0bd5('0x26'),_0x0bd5('0x27'),_0x0bd5('0x28'),_0x0bd5('0x29'),_0x0bd5('0x2a'),_0x0bd5('0x27'),_0x0bd5('0x2b'),_0x0bd5('0x2c'),_0x0bd5('0x2d'),_0x0bd5('0x2e')]);_0x23be38[_0x0bd5('0x2f')]=_['intersection'](_0xc58e12[_0x0bd5('0x30')],qs[_0x0bd5('0x31')](_0x277b32['query'][_0x0bd5('0x31')]));_0x23be38[_0x0bd5('0x2f')]=_0x23be38['attributes'][_0x0bd5('0x32')]?_0x23be38[_0x0bd5('0x2f')]:_0xc58e12[_0x0bd5('0x30')];if(!_0x277b32[_0x0bd5('0x19')]['hasOwnProperty'](_0x0bd5('0x33'))){_0x23be38[_0x0bd5('0x9')]=qs[_0x0bd5('0x9')](_0x277b32[_0x0bd5('0x19')][_0x0bd5('0x9')]);_0x23be38[_0x0bd5('0x6')]=qs['offset'](_0x277b32[_0x0bd5('0x19')]['offset']);}_0x23be38[_0x0bd5('0x34')]=qs[_0x0bd5('0x35')](_0x277b32[_0x0bd5('0x19')][_0x0bd5('0x35')]);_0x23be38[_0x0bd5('0x36')]=qs[_0x0bd5('0x1b')](_[_0x0bd5('0x37')](_0x277b32[_0x0bd5('0x19')],_0xc58e12[_0x0bd5('0x1b')]),_0x29fa4c);if(_0x277b32[_0x0bd5('0x19')][_0x0bd5('0x38')]){_0x23be38[_0x0bd5('0x36')]=_[_0x0bd5('0x39')](_0x23be38['where'],{'$or':_[_0x0bd5('0x15')](_0x29fa4c,function(_0x10750c){if(_0x10750c['type']!=='VIRTUAL'){var _0x6b93ed={};_0x6b93ed[_0x10750c[_0x0bd5('0x12')]]={'$like':'%'+_0x277b32[_0x0bd5('0x19')][_0x0bd5('0x38')]+'%'};return _0x6b93ed;}})});}_0x23be38=_[_0x0bd5('0x39')]({},_0x23be38,_0x277b32[_0x0bd5('0x3a')]);var _0x22c10c={'where':_0x23be38[_0x0bd5('0x36')]};return db[_0x0bd5('0x16')][_0x0bd5('0x8')](_0x22c10c)[_0x0bd5('0xe')](function(_0x3c6aa5){_0x19fe20[_0x0bd5('0x8')]=_0x3c6aa5;if(_0x277b32['query'][_0x0bd5('0x3b')]){_0x23be38['include']=[{'all':!![]}];}return db[_0x0bd5('0x16')][_0x0bd5('0x3c')](_0x23be38);})[_0x0bd5('0xe')](function(_0x1fcc49){_0x19fe20[_0x0bd5('0x3d')]=_0x1fcc49;return _0x19fe20;})[_0x0bd5('0xe')](respondWithFilteredResult(_0x833c14,_0x23be38))['catch'](handleError(_0x833c14,null));};exports[_0x0bd5('0x3e')]=function(_0x975fff,_0x11b1e1){var _0x1a9dda={'raw':!![],'where':{'id':_0x975fff[_0x0bd5('0x3f')]['id']}},_0x1c73be={};_0x1c73be[_0x0bd5('0x30')]=_[_0x0bd5('0x1a')](db[_0x0bd5('0x16')]['rawAttributes']);_0x1c73be[_0x0bd5('0x19')]=_['keys'](_0x975fff[_0x0bd5('0x19')]);_0x1c73be[_0x0bd5('0x1b')]=_['intersection'](_0x1c73be[_0x0bd5('0x30')],_0x1c73be[_0x0bd5('0x19')]);_0x1a9dda[_0x0bd5('0x2f')]=_[_0x0bd5('0x1c')](_0x1c73be[_0x0bd5('0x30')],qs[_0x0bd5('0x31')](_0x975fff[_0x0bd5('0x19')]['fields']));_0x1a9dda['attributes']=_0x1a9dda[_0x0bd5('0x2f')]['length']?_0x1a9dda['attributes']:_0x1c73be[_0x0bd5('0x30')];if(_0x975fff[_0x0bd5('0x19')]['includeAll']){_0x1a9dda['include']=[{'all':!![]}];}_0x1a9dda=_['merge']({},_0x1a9dda,_0x975fff[_0x0bd5('0x3a')]);return db['CmHopper']['find'](_0x1a9dda)[_0x0bd5('0xe')](handleEntityNotFound(_0x11b1e1,null))[_0x0bd5('0xe')](respondWithResult(_0x11b1e1,null))['catch'](handleError(_0x11b1e1,null));};exports['create']=function(_0xb46d84,_0x3f645b){return db[_0x0bd5('0x16')][_0x0bd5('0x40')](_0xb46d84['body'],{})[_0x0bd5('0xe')](respondWithResult(_0x3f645b,0xc9))[_0x0bd5('0x41')](handleError(_0x3f645b,null));};exports[_0x0bd5('0xd')]=function(_0x39956f,_0x1a9c33){if(_0x39956f[_0x0bd5('0x42')]['id']){delete _0x39956f['body']['id'];}return db[_0x0bd5('0x16')][_0x0bd5('0x43')]({'where':{'id':_0x39956f[_0x0bd5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a9c33,null))[_0x0bd5('0xe')](saveUpdates(_0x39956f[_0x0bd5('0x42')],null))[_0x0bd5('0xe')](respondWithResult(_0x1a9c33,null))['catch'](handleError(_0x1a9c33,null));};exports[_0x0bd5('0x44')]=function(_0x45240c,_0x54cd78){return db[_0x0bd5('0x16')][_0x0bd5('0x44')]()['then'](respondWithResult(_0x54cd78,null))[_0x0bd5('0x41')](handleError(_0x54cd78,null));};exports[_0x0bd5('0x45')]=function(_0x4d00c3,_0x2db9b0){var _0x20960a;var _0x146bdc=_0x4d00c3[_0x0bd5('0x3f')]['id'];return db[_0x0bd5('0x16')]['find']({'where':{'id':_0x4d00c3[_0x0bd5('0x3f')]['id']}})[_0x0bd5('0xe')](handleEntityNotFound(_0x2db9b0,null))['then'](function(_0x70d7ce){if(_0x70d7ce){return _0x70d7ce['destroy']()[_0x0bd5('0xe')](function(_0x14b74b){return _0x14b74b;});}})[_0x0bd5('0xe')](function(_0x1151ea){_0x20960a=_0x1151ea;if(_0x1151ea){if(_0x1151ea['VoiceQueueId']||_0x1151ea[_0x0bd5('0x46')]){return db[_0x1151ea['VoiceQueueId']?'VoiceQueue':_0x0bd5('0x47')][_0x0bd5('0x43')]({'where':{'id':_0x1151ea[_0x0bd5('0x48')]?_0x1151ea['VoiceQueueId']:_0x1151ea[_0x0bd5('0x46')]},'attributes':['id','name'],'raw':!![]});}}})[_0x0bd5('0xe')](function(_0x128934){var _0x473701={};if(_0x128934){_['merge'](_0x473701,_['omit'](_0x20960a['dataValues'],[_0x0bd5('0x49'),_0x0bd5('0x4a'),'id']));_0x473701[_0x0bd5('0x4b')]=0x15;_0x473701['statedesc']=_0x0bd5('0x4c');_0x473701[_0x0bd5('0x4d')]=_0x128934['name'];_0x473701[_0x0bd5('0x4e')]=_0x4d00c3['user']['name'];_0x473701[_0x0bd5('0x4f')]=_0x4d00c3[_0x0bd5('0x50')]['id'];_0x473701[_0x0bd5('0x4c')]=!![];_0x473701[_0x0bd5('0x51')]=moment()['format'](_0x0bd5('0x52'));_0x473701[_0x0bd5('0x53')]=_0x20960a[_0x0bd5('0x54')];_0x473701['campaigntype']=_0x20960a[_0x0bd5('0x48')]?_0x0bd5('0x55'):_0x0bd5('0x56');return db['CmContact']['find']({'where':{'id':_0x473701[_0x0bd5('0x57')]},'attributes':['firstName',_0x0bd5('0x58')]})[_0x0bd5('0xe')](function(_0x25e70){if(!_['isNil'](_0x2db9b0)&&!_[_0x0bd5('0x59')](_0x25e70[_0x0bd5('0x5a')])){_0x473701[_0x0bd5('0x5b')]=_0x25e70[_0x0bd5('0x5a')];if(!_['isNil'](_0x25e70[_0x0bd5('0x58')])){_0x473701[_0x0bd5('0x5b')]+='\x20'+_0x25e70[_0x0bd5('0x58')];}}})[_0x0bd5('0x5c')](function(){return db[_0x0bd5('0x5d')]['create'](_0x473701);});}})[_0x0bd5('0xe')](function(_0x4e6b26){return db[_0x0bd5('0x5e')]['destroy']({'where':{'CmHopperId':_0x146bdc}});})['then'](function(){return _0x2db9b0[_0x0bd5('0xa')](0xcc)['end']();})[_0x0bd5('0x41')](handleError(_0x2db9b0,null));};exports[_0x0bd5('0x5f')]=function(_0x6ed5,_0x5c84f9){var _0x4f7e86=[];return db[_0x0bd5('0x60')]['describe']()[_0x0bd5('0xe')](function(_0x134504){_0x4f7e86=_['keys'](_0x134504);return _0x6ed5[_0x0bd5('0x50')]['getVoiceQueues']({'where':{'type':_0x0bd5('0x61'),'dialActive':!![],'dialMethod':_0x0bd5('0x62')},'attributes':['id',_0x0bd5('0x63'),_0x0bd5('0x64')],'raw':!![]});})[_0x0bd5('0xe')](function(_0x467488){if(_0x467488&&_0x467488[_0x0bd5('0x32')]){return db['sequelize'][_0x0bd5('0x65')](function(_0x1e5e7d){var _0x33c5eb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x0bd5('0x15')](_0x467488,'id')},'$or':[{'UserId':null},{'UserId':_0x6ed5[_0x0bd5('0x50')]['id']}]};var _0x2d7d01={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x467488)[_0x0bd5('0x38')]([_0x0bd5('0x64'),0x0])[_0x0bd5('0x15')]('id')[_0x0bd5('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x6ed5[_0x0bd5('0x50')]['id']}]};var _0x38687d={'$or':[_0x33c5eb,_0x2d7d01]};var _0x13b37b=[];if(_0x6ed5[_0x0bd5('0x42')][_0x0bd5('0x67')]&&_0x6ed5[_0x0bd5('0x42')][_0x0bd5('0x67')]===_0x0bd5('0x68')){if(!_[_0x0bd5('0x69')](_0x6ed5[_0x0bd5('0x42')][_0x0bd5('0x6a')])){_0x38687d['id']={'$in':_0x6ed5['body'][_0x0bd5('0x6a')]};}_0x13b37b=[[_0x0bd5('0x6b'),'ASC'],[_0x0bd5('0x6c'),_0x467488[0x0]['dialOrderByScheduledAt']===_0x0bd5('0x6d')?_0x0bd5('0x6e'):'ASC'],db[_0x0bd5('0x6f')][_0x0bd5('0x70')](_0x0bd5('0x71')),['id',_0x0bd5('0x6e')]];}else{if(!_[_0x0bd5('0x69')](_0x6ed5[_0x0bd5('0x42')][_0x0bd5('0x6a')])){_0x38687d['id']={'$notIn':_0x6ed5[_0x0bd5('0x42')][_0x0bd5('0x6a')]};}_0x13b37b=[['priority',_0x0bd5('0x6e')],[_0x0bd5('0x6c'),_0x467488[0x0]['dialOrderByScheduledAt']],db[_0x0bd5('0x6f')][_0x0bd5('0x70')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x0bd5('0x6d')]];}return db[_0x0bd5('0x16')]['findOne']({'attributes':['id',_0x0bd5('0x72'),'phone',_0x0bd5('0x73')],'where':_0x38687d,'order':_0x13b37b,'transaction':_0x1e5e7d,'lock':_0x1e5e7d[_0x0bd5('0x74')][_0x0bd5('0x75')],'include':[{'model':db[_0x0bd5('0x60')],'as':_0x0bd5('0x76'),'attributes':_0x4f7e86,'include':[{'model':db[_0x0bd5('0x77')],'as':_0x0bd5('0x78'),'attributes':['id',_0x0bd5('0x12')]}]},{'model':db[_0x0bd5('0x79')],'as':_0x0bd5('0x7a'),'attributes':['id',_0x0bd5('0x12')]},{'model':db[_0x0bd5('0x7b')],'as':_0x0bd5('0x7c'),'attributes':['id',_0x0bd5('0x12'),'dialActive']}]})[_0x0bd5('0xe')](function(_0x2bf49b){if(_0x2bf49b){return _0x2bf49b[_0x0bd5('0xd')]({'UserId':_0x6ed5[_0x0bd5('0x50')]['id']},{'transaction':_0x1e5e7d});}});});}})[_0x0bd5('0xe')](handleEntityNotFound(_0x5c84f9,null))[_0x0bd5('0xe')](respondWithResult(_0x5c84f9,null))['catch'](handleError(_0x5c84f9,null));};exports[_0x0bd5('0x7d')]=function(_0x37066a,_0x3a4d13,_0x371b77){var _0x3bc8cc=[];var _0x116e67=_0x37066a[_0x0bd5('0x3f')]['id'];var _0x47cd59=_0x37066a['user']['id'];return db['CmContact'][_0x0bd5('0x44')]()[_0x0bd5('0xe')](function(_0x341b28){_0x3bc8cc=_[_0x0bd5('0x1a')](_0x341b28);return db[_0x0bd5('0x6f')]['transaction'](function(_0x231792){const _0x559469={'id':_0x116e67};return db['CmHopper'][_0x0bd5('0x7e')]({'attributes':['id',_0x0bd5('0x72'),_0x0bd5('0x73')],'where':_0x559469,'transaction':_0x231792,'lock':_0x231792[_0x0bd5('0x74')][_0x0bd5('0x75')],'include':[{'model':db[_0x0bd5('0x60')],'as':_0x0bd5('0x76'),'attributes':_0x3bc8cc,'include':[{'model':db[_0x0bd5('0x77')],'as':_0x0bd5('0x78'),'attributes':['id',_0x0bd5('0x12')]}]},{'model':db[_0x0bd5('0x79')],'as':'List','attributes':['id',_0x0bd5('0x12')]},{'model':db[_0x0bd5('0x7b')],'as':_0x0bd5('0x7c'),'attributes':['id',_0x0bd5('0x12'),_0x0bd5('0x7f')]}]})['then'](function(_0x40f1a1){if(_0x40f1a1){return _0x40f1a1[_0x0bd5('0xd')]({'UserId':_0x47cd59},{'transaction':_0x231792});}});});})[_0x0bd5('0xe')](handleEntityNotFound(_0x3a4d13,null))[_0x0bd5('0xe')](respondWithResult(_0x3a4d13,null))[_0x0bd5('0x41')](handleError(_0x3a4d13,null));};exports[_0x0bd5('0x80')]=function(_0x1265ac,_0x1dca49){return _0x1265ac[_0x0bd5('0x50')][_0x0bd5('0x81')]({'where':{'type':_0x0bd5('0x61'),'dialActive':!![],'dialMethod':_0x0bd5('0x62')},'attributes':['id'],'raw':!![]})[_0x0bd5('0xe')](function(_0xcbb2fc){if(_0xcbb2fc&&_0xcbb2fc[_0x0bd5('0x32')]){return db[_0x0bd5('0x16')][_0x0bd5('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0bd5('0x82')](_0x0bd5('0x52'))},'VoiceQueueId':{'$in':_['map'](_0xcbb2fc,'id')},'$or':[{'UserId':null},{'UserId':_0x1265ac['user']['id']}]}});}return 0x0;})[_0x0bd5('0xe')](function(_0x2004fa){if(!_[_0x0bd5('0x59')](_0x2004fa)&&_[_0x0bd5('0x83')](_0x2004fa)){return _0x1dca49[_0x0bd5('0xa')](0xc8)['json']({'contacts':_0x2004fa});}else{logger[_0x0bd5('0x10')](_0x0bd5('0x84'),_0x0bd5('0x80'),0x194,_0x0bd5('0x85'));_0x1dca49[_0x0bd5('0xf')](0x194);}})['catch'](handleError(_0x1dca49,null));};exports[_0x0bd5('0x86')]=function(_0xf8ab6e,_0x7c1d11){var _0x200df8=shared[_0x0bd5('0x87')];var _0x2791b3=[];_[_0x0bd5('0x15')](_0x200df8,function(_0x23f5d0){_0x2791b3[_0x0bd5('0x88')]({'id':_0x23f5d0[_0x0bd5('0x12')],'name':_0x23f5d0[_0x0bd5('0x12')],'utcOffset':_0x23f5d0['utcOffset']});});return _0x7c1d11[_0x0bd5('0xa')](0xc8)[_0x0bd5('0x89')]({'tz':_0x2791b3});};exports[_0x0bd5('0x8a')]=function(_0xc086d0,_0x2c77eb){var _0x46a5ee=shared[_0x0bd5('0x87')];var _0x1157fd={};if(!_['isNil'](_0x46a5ee[_0xc086d0[_0x0bd5('0x42')]['id']]))_0x1157fd=_0x46a5ee[_0xc086d0[_0x0bd5('0x42')]['id']];return _0x2c77eb[_0x0bd5('0xa')](0xc8)[_0x0bd5('0x89')](_0x1157fd);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x54f64b,_0x30ef9f){var _0x25523c=function(_0x20b211){while(--_0x20b211){_0x54f64b['push'](_0x54f64b['shift']());}};_0x25523c(++_0x30ef9f);}(_0xafc4,0x69));var _0x4afc=function(_0x5db096,_0x3c6406){_0x5db096=_0x5db096-0x0;var _0x4c5d3d=_0xafc4[_0x5db096];return _0x4c5d3d;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x2cb73b,_0x1bb76d){var _0x46d639=function(_0x5abceb){while(--_0x5abceb){_0x2cb73b['push'](_0x2cb73b['shift']());}};_0x46d639(++_0x1bb76d);}(_0x2542,0x169));var _0x2254=function(_0x19f7d8,_0x823de8){_0x19f7d8=_0x19f7d8-0x0;var _0x410d96=_0x2542[_0x19f7d8];return _0x410d96;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x304a=['options','raw','where','attributes','map','include','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','limit','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','UserId','push','update','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll'];(function(_0x5968e4,_0x5c185c){var _0x409a7c=function(_0x2768c0){while(--_0x2768c0){_0x5968e4['push'](_0x5968e4['shift']());}};_0x409a7c(++_0x5c185c);}(_0x304a,0x19a));var _0xa304=function(_0x4c5237,_0x1125c0){_0x4c5237=_0x4c5237-0x0;var _0x5cb8e0=_0x304a[_0x4c5237];return _0x5cb8e0;};'use strict';var _=require(_0xa304('0x0'));var util=require(_0xa304('0x1'));var moment=require(_0xa304('0x2'));var BPromise=require(_0xa304('0x3'));var db=require(_0xa304('0x4'))['db'];var logger=require(_0xa304('0x5'))(_0xa304('0x6'));exports[_0xa304('0x7')]=function(_0x4409a3){var _0x150cb0=this;return new Promise(function(_0x4628a9,_0x4ef358){return db[_0xa304('0x8')][_0xa304('0x9')]({'raw':_0x4409a3[_0xa304('0xa')]?_0x4409a3[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'where':_0x4409a3[_0xa304('0xa')]?_0x4409a3[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x4409a3['options']?_0x4409a3[_0xa304('0xa')][_0xa304('0xd')]||null:null,'limit':_0x4409a3[_0xa304('0xa')]?_0x4409a3[_0xa304('0xa')]['limit']||null:null,'include':_0x4409a3['options']?_0x4409a3[_0xa304('0xa')]['include']?_[_0xa304('0xe')](_0x4409a3[_0xa304('0xa')][_0xa304('0xf')],function(_0x2acc50){return{'model':db[_0x2acc50[_0xa304('0x10')]],'as':_0x2acc50['as'],'attributes':_0x2acc50[_0xa304('0xd')],'include':_0x2acc50[_0xa304('0xf')]?_[_0xa304('0xe')](_0x2acc50['include'],function(_0x3ab97a){return{'model':db[_0x3ab97a['model']],'as':_0x3ab97a['as'],'attributes':_0x3ab97a[_0xa304('0xd')],'include':_0x3ab97a[_0xa304('0xf')]?_[_0xa304('0xe')](_0x3ab97a['include'],function(_0x1c79ca){return{'model':db[_0x1c79ca[_0xa304('0x10')]],'as':_0x1c79ca['as'],'attributes':_0x1c79ca[_0xa304('0xd')]};}):[]};}):[]};}):[]:[]})[_0xa304('0x11')](function(_0x3d6506){logger[_0xa304('0x12')](_0xa304('0x7'),_0x4409a3);logger[_0xa304('0x13')](_0xa304('0x7'),_0x4409a3,JSON[_0xa304('0x14')](_0x3d6506));_0x4628a9(_0x3d6506);})[_0xa304('0x15')](function(_0x6fe98d){logger[_0xa304('0x16')](_0xa304('0x7'),_0x6fe98d[_0xa304('0x17')],_0x4409a3);_0x4ef358(_0x150cb0['error'](0x1f4,_0x6fe98d['message']));});});};exports[_0xa304('0x18')]=function(_0x461ba2){var _0x3626fd=this;return new Promise(function(_0x37b317,_0x510cfc){return db[_0xa304('0x8')][_0xa304('0x19')]({'raw':_0x461ba2[_0xa304('0xa')]?_0x461ba2[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'where':_0x461ba2['options']?_0x461ba2[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x461ba2[_0xa304('0xa')]?_0x461ba2[_0xa304('0xa')][_0xa304('0xd')]||null:null,'include':_0x461ba2[_0xa304('0xa')]?_0x461ba2['options'][_0xa304('0xf')]?_[_0xa304('0xe')](_0x461ba2[_0xa304('0xa')][_0xa304('0xf')],function(_0x314da2){return{'model':db[_0x314da2[_0xa304('0x10')]],'as':_0x314da2['as'],'attributes':_0x314da2[_0xa304('0xd')],'include':_0x314da2['include']?_['map'](_0x314da2[_0xa304('0xf')],function(_0x26f037){return{'model':db[_0x26f037[_0xa304('0x10')]],'as':_0x26f037['as'],'attributes':_0x26f037['attributes'],'include':_0x26f037[_0xa304('0xf')]?_['map'](_0x26f037['include'],function(_0x42dac0){return{'model':db[_0x42dac0[_0xa304('0x10')]],'as':_0x42dac0['as'],'attributes':_0x42dac0[_0xa304('0xd')]};}):[]};}):[]};}):[]:[]})[_0xa304('0x11')](function(_0x109fef){logger['info'](_0xa304('0x18'),_0x461ba2);logger[_0xa304('0x13')](_0xa304('0x18'),_0x461ba2,JSON[_0xa304('0x14')](_0x109fef));_0x37b317(_0x109fef);})[_0xa304('0x15')](function(_0x1ac30e){logger[_0xa304('0x16')]('ShowCmHopper',_0x1ac30e[_0xa304('0x17')],_0x461ba2);_0x510cfc(_0x3626fd[_0xa304('0x16')](0x1f4,_0x1ac30e[_0xa304('0x17')]));});});};exports[_0xa304('0x1a')]=function(_0x41f011){var _0x365bc0=this;return new Promise(function(_0x330102,_0x25485f){return db[_0xa304('0x8')][_0xa304('0x1b')](_0x41f011[_0xa304('0x1c')],{'raw':_0x41f011['options']?_0x41f011[_0xa304('0xa')]['raw']===undefined?!![]:![]:!![]})[_0xa304('0x11')](function(_0x444d31){logger[_0xa304('0x12')](_0xa304('0x1a'),_0x41f011);logger['debug']('CreateCmHopper',_0x41f011,JSON[_0xa304('0x14')](_0x444d31));_0x330102(_0x444d31);})['catch'](function(_0x5e4615){logger[_0xa304('0x16')](_0xa304('0x1a'),_0x5e4615['message'],_0x41f011);_0x25485f(_0x365bc0['error'](0x1f4,_0x5e4615[_0xa304('0x17')]));});});};exports['UpdateCmHopper']=function(_0x47daa9){var _0x5b6dcf=this;return new Promise(function(_0x3dcbf7,_0x5828f2){return db[_0xa304('0x8')]['update'](_0x47daa9[_0xa304('0x1c')],{'raw':_0x47daa9[_0xa304('0xa')]?_0x47daa9[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47daa9[_0xa304('0xa')]?_0x47daa9[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x47daa9[_0xa304('0xa')]?_0x47daa9[_0xa304('0xa')]['attributes']||null:null,'limit':_0x47daa9['options']?_0x47daa9[_0xa304('0xa')]['limit']||null:null})[_0xa304('0x11')](function(_0x18b183){logger[_0xa304('0x12')](_0xa304('0x1d'),_0x47daa9);logger[_0xa304('0x12')](_0xa304('0x1e'),JSON['stringify'](_0x47daa9[_0xa304('0xa')][_0xa304('0xc')]),_0x47daa9[_0xa304('0x1c')][_0xa304('0x1f')]);logger[_0xa304('0x13')](_0xa304('0x1d'),_0x47daa9,JSON['stringify'](_0x18b183));_0x3dcbf7(_0x18b183);})[_0xa304('0x15')](function(_0x5d2ac7){logger['error'](_0xa304('0x1d'),_0x5d2ac7[_0xa304('0x17')],_0x47daa9);_0x5828f2(_0x5b6dcf[_0xa304('0x16')](0x1f4,_0x5d2ac7[_0xa304('0x17')]));});});};exports[_0xa304('0x20')]=function(_0x1d72c4){var _0x25f9cd=this;return new Promise(function(_0x32f8ef,_0x59f339){return db[_0xa304('0x8')][_0xa304('0x21')]({'where':_0x1d72c4[_0xa304('0xa')]?_0x1d72c4['options']['where']||null:null})[_0xa304('0x11')](function(_0x4c3aaa){logger[_0xa304('0x12')]('DestroyCmHopper',_0x1d72c4);logger[_0xa304('0x13')](_0xa304('0x20'),_0x1d72c4,JSON['stringify'](_0x4c3aaa));_0x32f8ef(_0x4c3aaa);})[_0xa304('0x15')](function(_0x3884b1){logger[_0xa304('0x16')](_0xa304('0x20'),_0x3884b1[_0xa304('0x17')],_0x1d72c4);_0x59f339(_0x25f9cd[_0xa304('0x16')](0x1f4,_0x3884b1['message']));});});};exports['GetContactDialer']=function(_0x549d04){var _0x2b046f=this;return new Promise(function(_0x2ca424,_0x5f35cb){return db[_0xa304('0x22')][_0xa304('0x23')]()[_0xa304('0x11')](function(_0x535a89){return db[_0xa304('0x24')][_0xa304('0x25')](function(_0x1ed1e7){return db[_0xa304('0x8')]['findAll']({'where':_0x549d04['options']?_0x549d04[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x549d04[_0xa304('0xa')]?_0x549d04['options'][_0xa304('0xd')]||null:null,'limit':_0x549d04['options']?_0x549d04[_0xa304('0xa')][_0xa304('0x26')]||null:null,'order':_0x549d04[_0xa304('0xa')]?_0x549d04[_0xa304('0xa')][_0xa304('0x27')]||null:null,'transaction':_0x1ed1e7,'lock':_0x1ed1e7[_0xa304('0x28')][_0xa304('0x29')],'include':[{'model':db['CmContact'],'as':_0xa304('0x2a'),'attributes':_[_0xa304('0x2b')](_0x535a89)},{'model':db[_0xa304('0x2c')],'as':'Agent','attributes':['id',_0xa304('0x2d'),_0xa304('0x2e')]}]})[_0xa304('0x11')](function(_0x4e6c1d){var _0x4b11f1=[];var _0x126477=[];for(var _0x7319db=0x0;_0x7319db<_0x4e6c1d['length'];_0x7319db+=0x1){var _0x58c94e=_0x4e6c1d[_0x7319db][_0xa304('0x2f')];if(_0x58c94e===null){_0x4b11f1[_0xa304('0x30')](_0x4e6c1d[_0x7319db][_0xa304('0x31')](_0x549d04[_0xa304('0x1c')],{'transaction':_0x1ed1e7}));}else if(!_0x126477[_0xa304('0x32')](_0x58c94e)){_0x126477[_0xa304('0x30')](_0x58c94e);_0x4b11f1[_0xa304('0x30')](_0x4e6c1d[_0x7319db][_0xa304('0x31')](_0x549d04[_0xa304('0x1c')],{'transaction':_0x1ed1e7}));}}return BPromise[_0xa304('0x33')](_0x4b11f1);});})[_0xa304('0x11')](function(_0x53c220){logger[_0xa304('0x12')](_0xa304('0x34'),_0x549d04);if(_0x53c220[_0xa304('0x35')]>0x0){logger[_0xa304('0x12')](_0xa304('0x36'),_0x53c220[0x0][_0xa304('0x37')]['id'],_0x53c220[0x0][_0xa304('0x37')][_0xa304('0x38')],_0x53c220[0x0]['dataValues'][_0xa304('0x1f')]);}logger[_0xa304('0x13')]('GetContactDialer',_0x549d04,JSON[_0xa304('0x14')](_0x53c220));_0x2ca424(_0x53c220);})[_0xa304('0x15')](function(_0x321602){logger[_0xa304('0x16')](_0xa304('0x34'),_0x321602['message'],_0x549d04);_0x5f35cb(_0x2b046f[_0xa304('0x16')](0x1f4,_0x321602['message']));});});});};exports['MoveContactManagedDialer']=function(_0x216ebc){var _0x1119b3=this;return new Promise(function(_0x343d1d,_0x36a977){return db[_0xa304('0x24')]['transaction'](function(_0x3ed75c){return db[_0xa304('0x39')][_0xa304('0x1b')](_0x216ebc[_0xa304('0x1c')],{'raw':_0x216ebc[_0xa304('0xa')]?_0x216ebc['options'][_0xa304('0xb')]===undefined?!![]:![]:!![],'transaction':_0x3ed75c})[_0xa304('0x11')](function(){logger[_0xa304('0x12')](_0xa304('0x3a'),JSON[_0xa304('0x14')](_0x216ebc[_0xa304('0xa')][_0xa304('0xc')]),_0x216ebc[_0xa304('0xa')][_0xa304('0xc')][_0xa304('0x1f')]);return db[_0xa304('0x8')][_0xa304('0x21')]({'where':_0x216ebc['options']?_0x216ebc[_0xa304('0xa')][_0xa304('0xc')]||null:null,'transaction':_0x3ed75c});});})[_0xa304('0x11')](function(_0x5996c1){logger[_0xa304('0x12')](_0xa304('0x3b'),_0x216ebc);logger[_0xa304('0x13')](_0xa304('0x3b'),_0x216ebc,JSON[_0xa304('0x14')](_0x5996c1));_0x343d1d(_0x5996c1);})[_0xa304('0x15')](function(_0x1c36a5){logger[_0xa304('0x16')](_0xa304('0x3b'),_0x1c36a5[_0xa304('0x17')],_0x216ebc);_0x36a977(_0x1119b3[_0xa304('0x16')](0x1f4,_0x1c36a5['message']));});});};exports[_0xa304('0x3c')]=function(_0xad4d7c){var _0x2bdaa8=this;return new Promise(function(_0x8d0652,_0x4139de){return db[_0xa304('0x8')][_0xa304('0x9')]({'raw':_0xad4d7c[_0xa304('0xa')]?_0xad4d7c[_0xa304('0xa')][_0xa304('0xb')]===undefined?!![]:![]:!![],'where':_0xad4d7c[_0xa304('0xa')]?_0xad4d7c['options'][_0xa304('0xc')]||null:null,'attributes':[[db[_0xa304('0x24')]['fn'](_0xa304('0x3d'),db[_0xa304('0x24')]['fn']('IF',db[_0xa304('0x24')][_0xa304('0x3e')](_0xa304('0x3f')+util[_0xa304('0x40')]('\x22%s\x22',moment()[_0xa304('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xa304('0x41')))),_0xa304('0x42')]]})['then'](function(_0x3b8db5){logger[_0xa304('0x12')](_0xa304('0x3c'),_0xad4d7c);logger[_0xa304('0x13')](_0xa304('0x3c'),_0xad4d7c,JSON[_0xa304('0x14')](_0x3b8db5));_0x8d0652(_0x3b8db5);})['catch'](function(_0x36de63){logger[_0xa304('0x16')](_0xa304('0x3c'),_0x36de63[_0xa304('0x17')],_0xad4d7c);_0x4139de(_0x2bdaa8[_0xa304('0x16')](0x1f4,_0x36de63[_0xa304('0x17')]));});});};exports[_0xa304('0x43')]=function(_0x79c83c){var _0x3d6dd8=this;return new Promise(function(_0x59c7d7,_0x4290ca){return db[_0xa304('0x22')][_0xa304('0x23')]()[_0xa304('0x11')](function(){return db[_0xa304('0x24')][_0xa304('0x25')](function(_0x316273){return db[_0xa304('0x8')][_0xa304('0x9')]({'where':_0x79c83c['options']?_0x79c83c['options']['where']||null:null,'attributes':_0x79c83c['options']?_0x79c83c[_0xa304('0xa')]['attributes']||null:null,'limit':0x1,'order':_0x79c83c[_0xa304('0xa')]?_0x79c83c[_0xa304('0xa')][_0xa304('0x27')]||null:null,'group':db[_0xa304('0x8')][_0xa304('0x2f')],'transaction':_0x316273,'lock':_0x316273[_0xa304('0x28')][_0xa304('0x29')],'include':_0x79c83c[_0xa304('0xa')]?_0x79c83c[_0xa304('0xa')][_0xa304('0xf')]?_[_0xa304('0xe')](_0x79c83c['options'][_0xa304('0xf')],function(_0x27ec1e){return{'model':db[_0x27ec1e[_0xa304('0x10')]],'as':_0x27ec1e['as'],'attributes':_0x27ec1e[_0xa304('0xd')],'include':_0x27ec1e[_0xa304('0xf')]?_[_0xa304('0xe')](_0x27ec1e['include'],function(_0x230d8e){return{'model':db[_0x230d8e['model']],'as':_0x230d8e['as'],'attributes':_0x230d8e[_0xa304('0xd')],'include':_0x230d8e[_0xa304('0xf')]?_[_0xa304('0xe')](_0x230d8e[_0xa304('0xf')],function(_0x507843){return{'model':db[_0x507843['model']],'as':_0x507843['as'],'attributes':_0x507843['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1aba17){var _0x50ec26=[];for(var _0xd877e8=0x0;_0xd877e8<_0x1aba17[_0xa304('0x35')];_0xd877e8+=0x1){_0x50ec26[_0xa304('0x30')](_0x1aba17[_0xd877e8]['update'](_0x79c83c['body'],{'transaction':_0x316273}));}return BPromise[_0xa304('0x33')](_0x50ec26);});})[_0xa304('0x11')](function(_0x265148){logger[_0xa304('0x12')]('GetContactRecallMe',_0x79c83c);logger['debug'](_0xa304('0x43'),_0x79c83c,JSON['stringify'](_0x265148));_0x59c7d7(_0x265148);})['catch'](function(_0x17964f){logger['error']('GetContactRecallMe',_0x17964f[_0xa304('0x17')],_0x79c83c);_0x4290ca(_0x3d6dd8['error'](0x1f4,_0x17964f['message']));});});});};exports[_0xa304('0x44')]=function(_0x59b7ca){var _0x19137d=this;return new Promise(function(_0x3d58e4,_0x298f6b){db[_0xa304('0x22')][_0xa304('0x23')]()[_0xa304('0x11')](function(_0x1885a3){return db[_0xa304('0x8')]['findAll']({'raw':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca[_0xa304('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca[_0xa304('0xa')][_0xa304('0xc')]||null:null,'attributes':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca['options']['attributes']||null:null,'limit':_0x59b7ca[_0xa304('0xa')]?_0x59b7ca[_0xa304('0xa')]['limit']||null:null,'include':_0x59b7ca['options']?_0x59b7ca[_0xa304('0xa')]['include']?_[_0xa304('0xe')](_0x59b7ca[_0xa304('0xa')]['include'],function(_0x5403d7){return{'model':db[_0x5403d7['model']],'as':_0x5403d7['as'],'attributes':_0x5403d7['as']===_0xa304('0x2a')?_[_0xa304('0x2b')](_0x1885a3):_0x5403d7['attributes'],'include':_0x5403d7['include']?_['map'](_0x5403d7['include'],function(_0x34caef){return{'model':db[_0x34caef[_0xa304('0x10')]],'as':_0x34caef['as'],'attributes':_0x34caef['attributes'],'include':_0x34caef[_0xa304('0xf')]?_[_0xa304('0xe')](_0x34caef[_0xa304('0xf')],function(_0x164149){return{'model':db[_0x164149[_0xa304('0x10')]],'as':_0x164149['as'],'attributes':_0x164149['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34881d){logger[_0xa304('0x12')](_0xa304('0x7'),_0x59b7ca);logger[_0xa304('0x13')](_0xa304('0x7'),_0x59b7ca,JSON['stringify'](_0x34881d));_0x3d58e4(_0x34881d);})['catch'](function(_0x6f1163){logger[_0xa304('0x16')](_0xa304('0x7'),_0x6f1163['message'],_0x59b7ca);_0x298f6b(_0x19137d[_0xa304('0x16')](0x1f4,_0x6f1163[_0xa304('0x17')]));});});});};exports[_0xa304('0x45')]=function(_0x91ace7){var _0x3d7a04=this;return new Promise(function(_0x543028,_0x4c60fb){return db['CmContact'][_0xa304('0x46')]({'raw':!![],'where':{'phone':_0x91ace7[_0xa304('0xa')][_0xa304('0xc')][_0xa304('0x47')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0xa304('0x11')](function(_0x56149a){logger[_0xa304('0x12')](_0xa304('0x48'),_0x91ace7);logger[_0xa304('0x13')](_0xa304('0x48'),_0x91ace7,JSON[_0xa304('0x14')](_0x56149a));_0x543028(_0x56149a);})[_0xa304('0x15')](function(_0x5494a1){logger[_0xa304('0x16')](_0xa304('0x48'),_0x5494a1[_0xa304('0x17')],_0x91ace7);_0x4c60fb(_0x3d7a04[_0xa304('0x16')](0x1f4,_0x5494a1['message']));});});};exports[_0xa304('0x49')]=function(_0x460b90){var _0x4f3bc0=this;return new Promise(function(_0x4128d0,_0x157850){return db['sequelize'][_0xa304('0x25')](function(_0x217bd2){var _0x3d6904=_0x460b90[_0xa304('0xa')]&&_0x460b90[_0xa304('0xa')][_0xa304('0xc')]?_0x460b90[_0xa304('0xa')][_0xa304('0xc')]:{};return db[_0xa304('0x8')]['update'](_0x460b90[_0xa304('0x1c')],{'where':_0x3d6904,'transaction':_0x217bd2})['then'](function(_0x5554f0){logger['info'](_0xa304('0x49'),_0x460b90);logger[_0xa304('0x13')](_0xa304('0x49'),_0x460b90,JSON[_0xa304('0x14')](_0x5554f0));_0x4128d0(_0x5554f0);})[_0xa304('0x15')](function(_0x418c45){logger[_0xa304('0x16')](_0xa304('0x49'),_0x418c45[_0xa304('0x17')],_0x460b90);_0x157850(_0x4f3bc0['error'](0x1f4,_0x418c45[_0xa304('0x17')]));});});});};exports[_0xa304('0x4a')]=function(_0x4ddb81){var _0x37fef1=this;var _0x4076bd=_0x4ddb81['body'][_0xa304('0xc')][_0xa304('0x4b')];var _0x40d388=_0x4ddb81[_0xa304('0x1c')][_0xa304('0xc')][_0xa304('0x4c')];var _0x48db6e=_0x4ddb81[_0xa304('0x1c')][_0xa304('0xc')][_0xa304('0x4d')];return new Promise(function(_0x3fcf63,_0x5505a2){return db['CmHopper'][_0xa304('0x9')]({'where':{'voiceQueueId':{'$in':_0x4076bd},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa304('0x24')]['literal'](_0xa304('0x4e')+_0x40d388+_0xa304('0x4f')),'$gt':db[_0xa304('0x24')][_0xa304('0x3e')](_0xa304('0x50'))}},'UserId':{'$in':_0x48db6e}},'include':[{'model':db[_0xa304('0x22')],'as':_0xa304('0x2a')},{'model':db[_0xa304('0x2c')],'as':_0xa304('0x51'),'attributes':['id',_0xa304('0x2d'),_0xa304('0x2e')]},{'model':db[_0xa304('0x52')],'as':_0xa304('0x53')}]})[_0xa304('0x11')](function(_0x416801){if(_0x416801[_0xa304('0x35')]>0x0){return db[_0xa304('0x24')]['transaction'](function(_0x42db8c){return db[_0xa304('0x8')]['update']({'recallmeNotifiedDate':db[_0xa304('0x24')][_0xa304('0x3e')](_0xa304('0x50'))},{'where':{'id':{'$in':_[_0xa304('0xe')](_0x416801,'id')}},'transaction':_0x42db8c})['then'](function(){_0x3fcf63(_0x416801);})[_0xa304('0x15')](function(_0x196ec4){logger[_0xa304('0x16')](_0xa304('0x4a'),_0x196ec4['message'],_0x4ddb81);_0x5505a2(_0x37fef1[_0xa304('0x16')](0x1f4,_0x196ec4['message']));});})['catch'](function(_0x20096a){logger[_0xa304('0x16')](_0xa304('0x4a'),_0x20096a[_0xa304('0x17')],_0x4ddb81);_0x5505a2(_0x37fef1[_0xa304('0x16')](0x1f4,_0x20096a[_0xa304('0x17')]));});}else{_0x3fcf63(_0x416801);}});});};
\ No newline at end of file
+var _0xb4b4=['MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','CmContact','UPDATE','limit','GetContactByPhone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','NOW()','name','CmList','lodash','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','map','include','model','then','info','stringify','catch','error','message','ShowCmHopper','debug','body','CreateCmHopper','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','findAll','LOCK','Contact','keys','User','Agent','voicePause','length','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','create'];(function(_0x1ff11e,_0x16f5b7){var _0x33f2c2=function(_0x193668){while(--_0x193668){_0x1ff11e['push'](_0x1ff11e['shift']());}};_0x33f2c2(++_0x16f5b7);}(_0xb4b4,0xb1));var _0x4b4b=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xb4b4[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x4b4b('0x0'));var util=require(_0x4b4b('0x1'));var moment=require(_0x4b4b('0x2'));var BPromise=require('bluebird');var db=require(_0x4b4b('0x3'))['db'];var logger=require(_0x4b4b('0x4'))(_0x4b4b('0x5'));exports[_0x4b4b('0x6')]=function(_0x4c6d9e){var _0x9b5777=this;return new Promise(function(_0x3db175,_0x2135cb){return db[_0x4b4b('0x7')]['findAll']({'raw':_0x4c6d9e[_0x4b4b('0x8')]?_0x4c6d9e[_0x4b4b('0x8')][_0x4b4b('0x9')]===undefined?!![]:![]:!![],'where':_0x4c6d9e[_0x4b4b('0x8')]?_0x4c6d9e[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null,'attributes':_0x4c6d9e['options']?_0x4c6d9e[_0x4b4b('0x8')][_0x4b4b('0xb')]||null:null,'limit':_0x4c6d9e[_0x4b4b('0x8')]?_0x4c6d9e[_0x4b4b('0x8')]['limit']||null:null,'include':_0x4c6d9e[_0x4b4b('0x8')]?_0x4c6d9e['options']['include']?_[_0x4b4b('0xc')](_0x4c6d9e[_0x4b4b('0x8')][_0x4b4b('0xd')],function(_0x38b6b4){return{'model':db[_0x38b6b4[_0x4b4b('0xe')]],'as':_0x38b6b4['as'],'attributes':_0x38b6b4[_0x4b4b('0xb')],'include':_0x38b6b4['include']?_[_0x4b4b('0xc')](_0x38b6b4['include'],function(_0x117fa5){return{'model':db[_0x117fa5[_0x4b4b('0xe')]],'as':_0x117fa5['as'],'attributes':_0x117fa5['attributes'],'include':_0x117fa5[_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x117fa5[_0x4b4b('0xd')],function(_0x3e6871){return{'model':db[_0x3e6871[_0x4b4b('0xe')]],'as':_0x3e6871['as'],'attributes':_0x3e6871['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b4b('0xf')](function(_0x165b78){logger[_0x4b4b('0x10')](_0x4b4b('0x6'),_0x4c6d9e);logger['debug'](_0x4b4b('0x6'),_0x4c6d9e,JSON[_0x4b4b('0x11')](_0x165b78));_0x3db175(_0x165b78);})[_0x4b4b('0x12')](function(_0x28a558){logger[_0x4b4b('0x13')]('GetCmHopper',_0x28a558[_0x4b4b('0x14')],_0x4c6d9e);_0x2135cb(_0x9b5777['error'](0x1f4,_0x28a558[_0x4b4b('0x14')]));});});};exports[_0x4b4b('0x15')]=function(_0x4c655f){var _0x5200c4=this;return new Promise(function(_0x23ef3d,_0x2e5c50){return db[_0x4b4b('0x7')]['find']({'raw':_0x4c655f['options']?_0x4c655f['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c655f[_0x4b4b('0x8')]?_0x4c655f['options'][_0x4b4b('0xa')]||null:null,'attributes':_0x4c655f[_0x4b4b('0x8')]?_0x4c655f[_0x4b4b('0x8')][_0x4b4b('0xb')]||null:null,'include':_0x4c655f[_0x4b4b('0x8')]?_0x4c655f['options'][_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x4c655f[_0x4b4b('0x8')][_0x4b4b('0xd')],function(_0x169811){return{'model':db[_0x169811[_0x4b4b('0xe')]],'as':_0x169811['as'],'attributes':_0x169811[_0x4b4b('0xb')],'include':_0x169811[_0x4b4b('0xd')]?_['map'](_0x169811[_0x4b4b('0xd')],function(_0x55dfd7){return{'model':db[_0x55dfd7['model']],'as':_0x55dfd7['as'],'attributes':_0x55dfd7[_0x4b4b('0xb')],'include':_0x55dfd7[_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x55dfd7[_0x4b4b('0xd')],function(_0xa3028){return{'model':db[_0xa3028[_0x4b4b('0xe')]],'as':_0xa3028['as'],'attributes':_0xa3028[_0x4b4b('0xb')]};}):[]};}):[]};}):[]:[]})[_0x4b4b('0xf')](function(_0x48fd43){logger[_0x4b4b('0x10')](_0x4b4b('0x15'),_0x4c655f);logger[_0x4b4b('0x16')]('ShowCmHopper',_0x4c655f,JSON[_0x4b4b('0x11')](_0x48fd43));_0x23ef3d(_0x48fd43);})[_0x4b4b('0x12')](function(_0x38e3ec){logger[_0x4b4b('0x13')](_0x4b4b('0x15'),_0x38e3ec['message'],_0x4c655f);_0x2e5c50(_0x5200c4['error'](0x1f4,_0x38e3ec[_0x4b4b('0x14')]));});});};exports['CreateCmHopper']=function(_0x314018){var _0xfc303c=this;return new Promise(function(_0x6fb64a,_0x691035){return db[_0x4b4b('0x7')]['create'](_0x314018[_0x4b4b('0x17')],{'raw':_0x314018[_0x4b4b('0x8')]?_0x314018[_0x4b4b('0x8')][_0x4b4b('0x9')]===undefined?!![]:![]:!![]})[_0x4b4b('0xf')](function(_0x2750fb){logger[_0x4b4b('0x10')](_0x4b4b('0x18'),_0x314018);logger[_0x4b4b('0x16')](_0x4b4b('0x18'),_0x314018,JSON[_0x4b4b('0x11')](_0x2750fb));_0x6fb64a(_0x2750fb);})[_0x4b4b('0x12')](function(_0x41296f){logger[_0x4b4b('0x13')]('CreateCmHopper',_0x41296f[_0x4b4b('0x14')],_0x314018);_0x691035(_0xfc303c[_0x4b4b('0x13')](0x1f4,_0x41296f[_0x4b4b('0x14')]));});});};exports['UpdateCmHopper']=function(_0x4c7550){var _0x323604=this;return new Promise(function(_0x1a2d48,_0x10c5cf){return db[_0x4b4b('0x7')][_0x4b4b('0x19')](_0x4c7550[_0x4b4b('0x17')],{'raw':_0x4c7550[_0x4b4b('0x8')]?_0x4c7550[_0x4b4b('0x8')][_0x4b4b('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7550[_0x4b4b('0x8')]?_0x4c7550[_0x4b4b('0x8')]['where']||null:null,'attributes':_0x4c7550[_0x4b4b('0x8')]?_0x4c7550[_0x4b4b('0x8')][_0x4b4b('0xb')]||null:null,'limit':_0x4c7550[_0x4b4b('0x8')]?_0x4c7550[_0x4b4b('0x8')]['limit']||null:null})[_0x4b4b('0xf')](function(_0x3ecf17){logger[_0x4b4b('0x10')](_0x4b4b('0x1a'),_0x4c7550);logger[_0x4b4b('0x10')](_0x4b4b('0x1b'),JSON[_0x4b4b('0x11')](_0x4c7550[_0x4b4b('0x8')][_0x4b4b('0xa')]),_0x4c7550['body'][_0x4b4b('0x1c')]);logger[_0x4b4b('0x16')](_0x4b4b('0x1a'),_0x4c7550,JSON[_0x4b4b('0x11')](_0x3ecf17));_0x1a2d48(_0x3ecf17);})[_0x4b4b('0x12')](function(_0x162458){logger[_0x4b4b('0x13')](_0x4b4b('0x1a'),_0x162458[_0x4b4b('0x14')],_0x4c7550);_0x10c5cf(_0x323604['error'](0x1f4,_0x162458[_0x4b4b('0x14')]));});});};exports[_0x4b4b('0x1d')]=function(_0x862fdf){var _0x59c0be=this;return new Promise(function(_0x280433,_0x424ebb){return db['CmHopper'][_0x4b4b('0x1e')]({'where':_0x862fdf[_0x4b4b('0x8')]?_0x862fdf[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null})[_0x4b4b('0xf')](function(_0x31f0d3){logger['info']('DestroyCmHopper',_0x862fdf);logger[_0x4b4b('0x16')]('DestroyCmHopper',_0x862fdf,JSON[_0x4b4b('0x11')](_0x31f0d3));_0x280433(_0x31f0d3);})[_0x4b4b('0x12')](function(_0x274bf7){logger[_0x4b4b('0x13')](_0x4b4b('0x1d'),_0x274bf7[_0x4b4b('0x14')],_0x862fdf);_0x424ebb(_0x59c0be['error'](0x1f4,_0x274bf7['message']));});});};exports[_0x4b4b('0x1f')]=function(_0x1b16e6){var _0x315c05=this;return new Promise(function(_0x4c9be1,_0x2dc538){return db['CmContact'][_0x4b4b('0x20')]()[_0x4b4b('0xf')](function(_0x30b1c5){return db[_0x4b4b('0x21')][_0x4b4b('0x22')](function(_0x56f62a){return db[_0x4b4b('0x7')][_0x4b4b('0x23')]({'where':_0x1b16e6[_0x4b4b('0x8')]?_0x1b16e6[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null,'attributes':_0x1b16e6[_0x4b4b('0x8')]?_0x1b16e6[_0x4b4b('0x8')]['attributes']||null:null,'limit':_0x1b16e6['options']?_0x1b16e6[_0x4b4b('0x8')]['limit']||null:null,'order':_0x1b16e6['options']?_0x1b16e6[_0x4b4b('0x8')]['order']||null:null,'transaction':_0x56f62a,'lock':_0x56f62a[_0x4b4b('0x24')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x4b4b('0x25'),'attributes':_[_0x4b4b('0x26')](_0x30b1c5)},{'model':db[_0x4b4b('0x27')],'as':_0x4b4b('0x28'),'attributes':['id','name',_0x4b4b('0x29')]}]})[_0x4b4b('0xf')](function(_0x19c6ff){var _0x2dee4b=[];var _0x3f1a7c=[];for(var _0x155be6=0x0;_0x155be6<_0x19c6ff[_0x4b4b('0x2a')];_0x155be6+=0x1){var _0x1c9ebd=_0x19c6ff[_0x155be6]['UserId'];if(_0x1c9ebd===null){_0x2dee4b[_0x4b4b('0x2b')](_0x19c6ff[_0x155be6][_0x4b4b('0x19')](_0x1b16e6[_0x4b4b('0x17')],{'transaction':_0x56f62a}));}else if(!_0x3f1a7c[_0x4b4b('0x2c')](_0x1c9ebd)){_0x3f1a7c['push'](_0x1c9ebd);_0x2dee4b[_0x4b4b('0x2b')](_0x19c6ff[_0x155be6][_0x4b4b('0x19')](_0x1b16e6['body'],{'transaction':_0x56f62a}));}}return BPromise[_0x4b4b('0x2d')](_0x2dee4b);});})[_0x4b4b('0xf')](function(_0x3839d9){logger[_0x4b4b('0x10')](_0x4b4b('0x1f'),_0x1b16e6);if(_0x3839d9[_0x4b4b('0x2a')]>0x0){logger[_0x4b4b('0x10')](_0x4b4b('0x2e'),_0x3839d9[0x0][_0x4b4b('0x2f')]['id'],_0x3839d9[0x0][_0x4b4b('0x2f')][_0x4b4b('0x30')],_0x3839d9[0x0]['dataValues'][_0x4b4b('0x1c')]);}logger[_0x4b4b('0x16')](_0x4b4b('0x1f'),_0x1b16e6,JSON[_0x4b4b('0x11')](_0x3839d9));_0x4c9be1(_0x3839d9);})[_0x4b4b('0x12')](function(_0x276840){logger[_0x4b4b('0x13')](_0x4b4b('0x1f'),_0x276840[_0x4b4b('0x14')],_0x1b16e6);_0x2dc538(_0x315c05[_0x4b4b('0x13')](0x1f4,_0x276840[_0x4b4b('0x14')]));});});});};exports[_0x4b4b('0x31')]=function(_0x3e99d5){var _0x162600=this;return new Promise(function(_0x15137a,_0x25fe9c){return db[_0x4b4b('0x21')]['transaction'](function(_0x21689c){return db['CmHopperFinal'][_0x4b4b('0x32')](_0x3e99d5['body'],{'raw':_0x3e99d5[_0x4b4b('0x8')]?_0x3e99d5[_0x4b4b('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x21689c})[_0x4b4b('0xf')](function(){logger[_0x4b4b('0x10')](_0x4b4b('0x33'),JSON['stringify'](_0x3e99d5[_0x4b4b('0x8')]['where']),_0x3e99d5[_0x4b4b('0x8')][_0x4b4b('0xa')][_0x4b4b('0x1c')]);return db['CmHopper'][_0x4b4b('0x1e')]({'where':_0x3e99d5[_0x4b4b('0x8')]?_0x3e99d5[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null,'transaction':_0x21689c});});})[_0x4b4b('0xf')](function(_0x4acac8){logger[_0x4b4b('0x10')](_0x4b4b('0x31'),_0x3e99d5);logger[_0x4b4b('0x16')](_0x4b4b('0x31'),_0x3e99d5,JSON['stringify'](_0x4acac8));_0x15137a(_0x4acac8);})[_0x4b4b('0x12')](function(_0x119d65){logger['error'](_0x4b4b('0x31'),_0x119d65[_0x4b4b('0x14')],_0x3e99d5);_0x25fe9c(_0x162600[_0x4b4b('0x13')](0x1f4,_0x119d65[_0x4b4b('0x14')]));});});};exports[_0x4b4b('0x34')]=function(_0x1b4ddd){var _0x31f3e6=this;return new Promise(function(_0xac820a,_0x4fd957){return db[_0x4b4b('0x7')][_0x4b4b('0x23')]({'raw':_0x1b4ddd[_0x4b4b('0x8')]?_0x1b4ddd[_0x4b4b('0x8')][_0x4b4b('0x9')]===undefined?!![]:![]:!![],'where':_0x1b4ddd['options']?_0x1b4ddd[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null,'attributes':[[db[_0x4b4b('0x21')]['fn'](_0x4b4b('0x35'),db['sequelize']['fn']('IF',db[_0x4b4b('0x21')][_0x4b4b('0x36')](_0x4b4b('0x37')+util[_0x4b4b('0x38')](_0x4b4b('0x39'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x4b4b('0x3a')))),_0x4b4b('0x3b')]]})['then'](function(_0x404270){logger[_0x4b4b('0x10')](_0x4b4b('0x34'),_0x1b4ddd);logger[_0x4b4b('0x16')](_0x4b4b('0x34'),_0x1b4ddd,JSON['stringify'](_0x404270));_0xac820a(_0x404270);})[_0x4b4b('0x12')](function(_0x55b908){logger[_0x4b4b('0x13')](_0x4b4b('0x34'),_0x55b908[_0x4b4b('0x14')],_0x1b4ddd);_0x4fd957(_0x31f3e6['error'](0x1f4,_0x55b908['message']));});});};exports[_0x4b4b('0x3c')]=function(_0x4cc4a4){var _0x55231d=this;return new Promise(function(_0x1a8663,_0x3f1714){return db[_0x4b4b('0x3d')][_0x4b4b('0x20')]()[_0x4b4b('0xf')](function(){return db[_0x4b4b('0x21')][_0x4b4b('0x22')](function(_0x5b3a09){return db['CmHopper'][_0x4b4b('0x23')]({'where':_0x4cc4a4['options']?_0x4cc4a4[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null,'attributes':_0x4cc4a4[_0x4b4b('0x8')]?_0x4cc4a4[_0x4b4b('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x4cc4a4[_0x4b4b('0x8')]?_0x4cc4a4['options']['order']||null:null,'group':db[_0x4b4b('0x7')]['UserId'],'transaction':_0x5b3a09,'lock':_0x5b3a09[_0x4b4b('0x24')][_0x4b4b('0x3e')],'include':_0x4cc4a4[_0x4b4b('0x8')]?_0x4cc4a4[_0x4b4b('0x8')][_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x4cc4a4['options']['include'],function(_0x2a537c){return{'model':db[_0x2a537c[_0x4b4b('0xe')]],'as':_0x2a537c['as'],'attributes':_0x2a537c[_0x4b4b('0xb')],'include':_0x2a537c[_0x4b4b('0xd')]?_['map'](_0x2a537c[_0x4b4b('0xd')],function(_0x4a8a84){return{'model':db[_0x4a8a84[_0x4b4b('0xe')]],'as':_0x4a8a84['as'],'attributes':_0x4a8a84[_0x4b4b('0xb')],'include':_0x4a8a84[_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x4a8a84[_0x4b4b('0xd')],function(_0x36f89d){return{'model':db[_0x36f89d[_0x4b4b('0xe')]],'as':_0x36f89d['as'],'attributes':_0x36f89d[_0x4b4b('0xb')]};}):[]};}):[]};}):[]:[]})[_0x4b4b('0xf')](function(_0x5a34e0){var _0x1956e8=[];for(var _0x22b595=0x0;_0x22b595<_0x5a34e0[_0x4b4b('0x2a')];_0x22b595+=0x1){_0x1956e8[_0x4b4b('0x2b')](_0x5a34e0[_0x22b595]['update'](_0x4cc4a4['body'],{'transaction':_0x5b3a09}));}return BPromise[_0x4b4b('0x2d')](_0x1956e8);});})['then'](function(_0x294e02){logger[_0x4b4b('0x10')](_0x4b4b('0x3c'),_0x4cc4a4);logger[_0x4b4b('0x16')](_0x4b4b('0x3c'),_0x4cc4a4,JSON[_0x4b4b('0x11')](_0x294e02));_0x1a8663(_0x294e02);})['catch'](function(_0x3a6810){logger[_0x4b4b('0x13')]('GetContactRecallMe',_0x3a6810[_0x4b4b('0x14')],_0x4cc4a4);_0x3f1714(_0x55231d['error'](0x1f4,_0x3a6810[_0x4b4b('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x180606){var _0xf4306f=this;return new Promise(function(_0x47e10c,_0x251046){db['CmContact'][_0x4b4b('0x20')]()[_0x4b4b('0xf')](function(_0x260764){return db[_0x4b4b('0x7')]['findAll']({'raw':_0x180606[_0x4b4b('0x8')]?_0x180606['options'][_0x4b4b('0x9')]===undefined?!![]:![]:!![],'where':_0x180606[_0x4b4b('0x8')]?_0x180606[_0x4b4b('0x8')][_0x4b4b('0xa')]||null:null,'attributes':_0x180606[_0x4b4b('0x8')]?_0x180606[_0x4b4b('0x8')][_0x4b4b('0xb')]||null:null,'limit':_0x180606[_0x4b4b('0x8')]?_0x180606['options'][_0x4b4b('0x3f')]||null:null,'include':_0x180606[_0x4b4b('0x8')]?_0x180606['options'][_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x180606['options'][_0x4b4b('0xd')],function(_0x5ea1cc){return{'model':db[_0x5ea1cc[_0x4b4b('0xe')]],'as':_0x5ea1cc['as'],'attributes':_0x5ea1cc['as']==='Contact'?_[_0x4b4b('0x26')](_0x260764):_0x5ea1cc[_0x4b4b('0xb')],'include':_0x5ea1cc[_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x5ea1cc[_0x4b4b('0xd')],function(_0x45edfa){return{'model':db[_0x45edfa[_0x4b4b('0xe')]],'as':_0x45edfa['as'],'attributes':_0x45edfa[_0x4b4b('0xb')],'include':_0x45edfa[_0x4b4b('0xd')]?_[_0x4b4b('0xc')](_0x45edfa['include'],function(_0x4a0204){return{'model':db[_0x4a0204[_0x4b4b('0xe')]],'as':_0x4a0204['as'],'attributes':_0x4a0204['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b4b('0xf')](function(_0x4cd254){logger[_0x4b4b('0x10')](_0x4b4b('0x6'),_0x180606);logger[_0x4b4b('0x16')](_0x4b4b('0x6'),_0x180606,JSON['stringify'](_0x4cd254));_0x47e10c(_0x4cd254);})['catch'](function(_0x26f50b){logger['error'](_0x4b4b('0x6'),_0x26f50b['message'],_0x180606);_0x251046(_0xf4306f[_0x4b4b('0x13')](0x1f4,_0x26f50b[_0x4b4b('0x14')]));});});});};exports[_0x4b4b('0x40')]=function(_0x405951){var _0x1a3989=this;return new Promise(function(_0x882235,_0x5dd37e){return db[_0x4b4b('0x3d')]['findOne']({'raw':!![],'where':{'phone':_0x405951[_0x4b4b('0x8')]['where']['phone']},'attributes':['id',_0x4b4b('0x41')],'order':[['id',_0x4b4b('0x42')]]})[_0x4b4b('0xf')](function(_0x3714ec){logger['info'](_0x4b4b('0x43'),_0x405951);logger[_0x4b4b('0x16')](_0x4b4b('0x43'),_0x405951,JSON[_0x4b4b('0x11')](_0x3714ec));_0x882235(_0x3714ec);})[_0x4b4b('0x12')](function(_0x2c4efe){logger[_0x4b4b('0x13')]('getContactByPhone',_0x2c4efe[_0x4b4b('0x14')],_0x405951);_0x5dd37e(_0x1a3989[_0x4b4b('0x13')](0x1f4,_0x2c4efe[_0x4b4b('0x14')]));});});};exports['ResetActiveCalls']=function(_0x267464){var _0x2ad91b=this;return new Promise(function(_0x1691a1,_0x2122c7){return db[_0x4b4b('0x21')][_0x4b4b('0x22')](function(_0x23bc19){var _0x22a85b=_0x267464['options']&&_0x267464[_0x4b4b('0x8')][_0x4b4b('0xa')]?_0x267464[_0x4b4b('0x8')]['where']:{};return db[_0x4b4b('0x7')][_0x4b4b('0x19')](_0x267464[_0x4b4b('0x17')],{'where':_0x22a85b,'transaction':_0x23bc19})[_0x4b4b('0xf')](function(_0x514330){logger[_0x4b4b('0x10')](_0x4b4b('0x44'),_0x267464);logger['debug'](_0x4b4b('0x44'),_0x267464,JSON[_0x4b4b('0x11')](_0x514330));_0x1691a1(_0x514330);})[_0x4b4b('0x12')](function(_0x580417){logger[_0x4b4b('0x13')](_0x4b4b('0x44'),_0x580417['message'],_0x267464);_0x2122c7(_0x2ad91b[_0x4b4b('0x13')](0x1f4,_0x580417[_0x4b4b('0x14')]));});});});};exports[_0x4b4b('0x45')]=function(_0x20970a){var _0x1af7aa=this;var _0x149e9e=_0x20970a['body']['where'][_0x4b4b('0x46')];var _0x4585dd=_0x20970a[_0x4b4b('0x17')][_0x4b4b('0xa')][_0x4b4b('0x47')];var _0xacbcc2=_0x20970a[_0x4b4b('0x17')]['where']['availableAgentsIds'];return new Promise(function(_0x4ef6ec,_0x3c52d0){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x149e9e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4b4b('0x21')][_0x4b4b('0x36')](_0x4b4b('0x48')+_0x4585dd+'\x20MINUTE'),'$gt':db[_0x4b4b('0x21')][_0x4b4b('0x36')](_0x4b4b('0x49'))}},'UserId':{'$in':_0xacbcc2}},'include':[{'model':db[_0x4b4b('0x3d')],'as':_0x4b4b('0x25')},{'model':db[_0x4b4b('0x27')],'as':_0x4b4b('0x28'),'attributes':['id',_0x4b4b('0x4a'),_0x4b4b('0x29')]},{'model':db[_0x4b4b('0x4b')],'as':'List'}]})[_0x4b4b('0xf')](function(_0x3266b1){if(_0x3266b1['length']>0x0){return db[_0x4b4b('0x21')]['transaction'](function(_0x27b1a7){return db[_0x4b4b('0x7')][_0x4b4b('0x19')]({'recallmeNotifiedDate':db[_0x4b4b('0x21')][_0x4b4b('0x36')](_0x4b4b('0x49'))},{'where':{'id':{'$in':_[_0x4b4b('0xc')](_0x3266b1,'id')}},'transaction':_0x27b1a7})[_0x4b4b('0xf')](function(){_0x4ef6ec(_0x3266b1);})[_0x4b4b('0x12')](function(_0x5fc1c){logger[_0x4b4b('0x13')](_0x4b4b('0x45'),_0x5fc1c[_0x4b4b('0x14')],_0x20970a);_0x3c52d0(_0x1af7aa[_0x4b4b('0x13')](0x1f4,_0x5fc1c['message']));});})['catch'](function(_0x3be986){logger[_0x4b4b('0x13')](_0x4b4b('0x45'),_0x3be986[_0x4b4b('0x14')],_0x20970a);_0x3c52d0(_0x1af7aa[_0x4b4b('0x13')](0x1f4,_0x3be986['message']));});}else{_0x4ef6ec(_0x3266b1);}});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bdf=['post','/preview','getPreview','/timezone','put','/:id','delete','express','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall'];(function(_0x3dd92b,_0x4d1139){var _0x5e1d23=function(_0x5d866f){while(--_0x5d866f){_0x3dd92b['push'](_0x3dd92b['shift']());}};_0x5e1d23(++_0x4d1139);}(_0x2bdf,0x1cf));var _0xf2bd=function(_0x1f531e,_0x3b694c){_0x1f531e=_0x1f531e-0x0;var _0x83e774=_0x2bdf[_0x1f531e];return _0x83e774;};'use strict';var express=require(_0xf2bd('0x0'));var router=express[_0xf2bd('0x1')]();var auth=require(_0xf2bd('0x2'));var controller=require('./cmHopper.controller');router[_0xf2bd('0x3')]('/',auth[_0xf2bd('0x4')](),controller['index']);router['get'](_0xf2bd('0x5'),auth['isAuthenticated'](),controller[_0xf2bd('0x6')]);router[_0xf2bd('0x3')]('/opencontacts',auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xf2bd('0x3')](_0xf2bd('0x7'),auth[_0xf2bd('0x4')](),controller[_0xf2bd('0x8')]);router[_0xf2bd('0x3')]('/:id',auth[_0xf2bd('0x4')](),controller[_0xf2bd('0x9')]);router[_0xf2bd('0x3')](_0xf2bd('0xa'),auth[_0xf2bd('0x4')](),controller[_0xf2bd('0xb')]);router[_0xf2bd('0xc')]('/',auth[_0xf2bd('0x4')](),controller['create']);router['post'](_0xf2bd('0xd'),auth[_0xf2bd('0x4')](),controller[_0xf2bd('0xe')]);router[_0xf2bd('0xc')](_0xf2bd('0xf'),auth[_0xf2bd('0x4')](),controller['getTimezone']);router[_0xf2bd('0x10')](_0xf2bd('0x11'),auth[_0xf2bd('0x4')](),controller['update']);router[_0xf2bd('0x12')](_0xf2bd('0x11'),auth[_0xf2bd('0x4')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbb2b=['getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0xbb2b,0x130));var _0xbbb2=function(_0x2b4712,_0x1c0039){_0x2b4712=_0x2b4712-0x0;var _0x17c47b=_0xbb2b[_0x2b4712];return _0x17c47b;};'use strict';var express=require(_0xbbb2('0x0'));var router=express[_0xbbb2('0x1')]();var auth=require(_0xbbb2('0x2'));var controller=require(_0xbbb2('0x3'));router[_0xbbb2('0x4')]('/',auth[_0xbbb2('0x5')](),controller['index']);router[_0xbbb2('0x4')](_0xbbb2('0x6'),auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x7')]);router[_0xbbb2('0x4')]('/opencontacts',auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x8')]);router['get'](_0xbbb2('0x9'),auth[_0xbbb2('0x5')](),controller[_0xbbb2('0xa')]);router[_0xbbb2('0x4')](_0xbbb2('0xb'),auth[_0xbbb2('0x5')](),controller[_0xbbb2('0xc')]);router[_0xbbb2('0x4')](_0xbbb2('0xd'),auth['isAuthenticated'](),controller[_0xbbb2('0xe')]);router[_0xbbb2('0xf')]('/',auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x10')]);router[_0xbbb2('0xf')](_0xbbb2('0x11'),auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x12')]);router[_0xbbb2('0xf')]('/timezone',auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x13')]);router['put'](_0xbbb2('0xb'),auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x14')]);router[_0xbbb2('0x15')]('/:id',auth[_0xbbb2('0x5')](),controller[_0xbbb2('0x16')]);module[_0xbbb2('0x17')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8cba=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','DATE'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8cba,0xc2));var _0xa8cb=function(_0x13d2a5,_0x5016a4){_0x13d2a5=_0x13d2a5-0x0;var _0x437a87=_0x8cba[_0x13d2a5];return _0x437a87;};'use strict';var moment=require(_0xa8cb('0x0'));var Sequelize=require(_0xa8cb('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xa8cb('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa8cb('0x3')],'defaultValue':moment()[_0xa8cb('0x4')](_0xa8cb('0x5'))},'countbusyretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa8cb('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5854=['INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x5854,0x1b4));var _0x4585=function(_0x3d4c8b,_0x3e6ad6){_0x3d4c8b=_0x3d4c8b-0x0;var _0x1d1bc3=_0x5854[_0x3d4c8b];return _0x1d1bc3;};'use strict';var moment=require('moment');var Sequelize=require(_0x4585('0x0'));module[_0x4585('0x1')]={'CmHopperId':{'type':Sequelize[_0x4585('0x2')]},'phone':{'type':Sequelize[_0x4585('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x4585('0x4')](_0x4585('0x5'))},'countbusyretry':{'type':Sequelize[_0x4585('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4585('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4585('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4585('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4585('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4585('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf33d=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','sendStatus','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','find','body','user','role','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring'];(function(_0x9f39fc,_0x520816){var _0x29658c=function(_0xbc2d82){while(--_0xbc2d82){_0x9f39fc['push'](_0x9f39fc['shift']());}};_0x29658c(++_0x520816);}(_0xf33d,0x12d));var _0xdf33=function(_0x44769c,_0x4b2cc6){_0x44769c=_0x44769c-0x0;var _0x216eb5=_0xf33d[_0x44769c];return _0x216eb5;};'use strict';var emlformat=require(_0xdf33('0x0'));var rimraf=require(_0xdf33('0x1'));var zipdir=require(_0xdf33('0x2'));var jsonpatch=require(_0xdf33('0x3'));var rp=require(_0xdf33('0x4'));var moment=require('moment');var BPromise=require(_0xdf33('0x5'));var Mustache=require(_0xdf33('0x6'));var util=require(_0xdf33('0x7'));var path=require('path');var sox=require(_0xdf33('0x8'));var csv=require(_0xdf33('0x9'));var ejs=require(_0xdf33('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdf33('0xb'));var crypto=require(_0xdf33('0xc'));var jsforce=require(_0xdf33('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf33('0xe'));var Papa=require(_0xdf33('0xf'));var Redis=require('ioredis');var authService=require(_0xdf33('0x10'));var qs=require(_0xdf33('0x11'));var as=require(_0xdf33('0x12'));var hardwareService=require(_0xdf33('0x13'));var logger=require('../../config/logger')(_0xdf33('0x14'));var utils=require('../../config/utils');var config=require(_0xdf33('0x15'));var licenseUtil=require(_0xdf33('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x533f9b,_0x46c1d3){_0x46c1d3=_0x46c1d3||0xcc;return function(_0x46ff9c){if(_0x46ff9c){return _0x533f9b['sendStatus'](_0x46c1d3);}return _0x533f9b[_0xdf33('0x17')](_0x46c1d3)[_0xdf33('0x18')]();};}function respondWithResult(_0x379c32,_0x3a4ed1){_0x3a4ed1=_0x3a4ed1||0xc8;return function(_0x4b1ec8){if(_0x4b1ec8){return _0x379c32[_0xdf33('0x17')](_0x3a4ed1)[_0xdf33('0x19')](_0x4b1ec8);}};}function respondWithFilteredResult(_0x5e420c,_0x572c77){return function(_0x3b3a72){if(_0x3b3a72){var _0x32c8bb=typeof _0x572c77[_0xdf33('0x1a')]===_0xdf33('0x1b')&&typeof _0x572c77['limit']===_0xdf33('0x1b');var _0x5948e7=_0x3b3a72[_0xdf33('0x1c')];var _0x2d47b0=_0x32c8bb?0x0:_0x572c77[_0xdf33('0x1a')];var _0x22bede=_0x32c8bb?_0x3b3a72['count']:_0x572c77['offset']+_0x572c77[_0xdf33('0x1d')];var _0x1b36f7;if(_0x22bede>=_0x5948e7){_0x22bede=_0x5948e7;_0x1b36f7=0xc8;}else{_0x1b36f7=0xce;}_0x5e420c[_0xdf33('0x17')](_0x1b36f7);return _0x5e420c[_0xdf33('0x1e')]('Content-Range',_0x2d47b0+'-'+_0x22bede+'/'+_0x5948e7)[_0xdf33('0x19')](_0x3b3a72);}return null;};}function patchUpdates(_0x16e606){return function(_0x43732e){try{jsonpatch['apply'](_0x43732e,_0x16e606,!![]);}catch(_0x435d44){return BPromise[_0xdf33('0x1f')](_0x435d44);}return _0x43732e[_0xdf33('0x20')]();};}function saveUpdates(_0x4a0bf6,_0x5399ee){return function(_0x9a0b3){if(_0x9a0b3){return _0x9a0b3['update'](_0x4a0bf6)[_0xdf33('0x21')](function(_0xa1324d){return _0xa1324d;});}return null;};}function removeEntity(_0x5f0235,_0x25ab0a){return function(_0x284e5c){if(_0x284e5c){return _0x284e5c[_0xdf33('0x22')]()[_0xdf33('0x21')](function(){var _0x330668=_0x284e5c[_0xdf33('0x23')]({'plain':!![]});var _0x5ea292=_0xdf33('0x24');return db[_0xdf33('0x25')][_0xdf33('0x22')]({'where':{'type':_0x5ea292,'resourceId':_0x330668['id']}})[_0xdf33('0x21')](function(){return _0x284e5c;});})['then'](function(){_0x5f0235[_0xdf33('0x17')](0xcc)[_0xdf33('0x18')]();});}};}function handleEntityNotFound(_0x50a63d,_0x1c88a8){return function(_0x1b5538){if(!_0x1b5538){_0x50a63d[_0xdf33('0x26')](0x194);}return _0x1b5538;};}function handleError(_0x163ec8,_0x424855){_0x424855=_0x424855||0x1f4;return function(_0x309eed){logger[_0xdf33('0x27')](_0x309eed[_0xdf33('0x28')]);if(_0x309eed[_0xdf33('0x29')]){delete _0x309eed['name'];}_0x163ec8['status'](_0x424855)[_0xdf33('0x2a')](_0x309eed);};}exports[_0xdf33('0x2b')]=function(_0x2b5cbc,_0x2008bb){var _0x464df4={},_0x1ac378={},_0x436beb={'count':0x0,'rows':[]};var _0x586511=_['map'](db[_0xdf33('0x2c')][_0xdf33('0x2d')],function(_0x1b5e4d){return{'name':_0x1b5e4d[_0xdf33('0x2e')],'type':_0x1b5e4d[_0xdf33('0x2f')]['key']};});_0x1ac378[_0xdf33('0x30')]=_[_0xdf33('0x31')](_0x586511,'name');_0x1ac378[_0xdf33('0x32')]=_[_0xdf33('0x33')](_0x2b5cbc['query']);_0x1ac378[_0xdf33('0x34')]=_[_0xdf33('0x35')](_0x1ac378[_0xdf33('0x30')],_0x1ac378[_0xdf33('0x32')]);_0x464df4['attributes']=_[_0xdf33('0x35')](_0x1ac378[_0xdf33('0x30')],qs[_0xdf33('0x36')](_0x2b5cbc[_0xdf33('0x32')]['fields']));_0x464df4[_0xdf33('0x37')]=_0x464df4[_0xdf33('0x37')]['length']?_0x464df4['attributes']:_0x1ac378[_0xdf33('0x30')];if(!_0x2b5cbc[_0xdf33('0x32')]['hasOwnProperty']('nolimit')){_0x464df4[_0xdf33('0x1d')]=qs['limit'](_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x1d')]);_0x464df4[_0xdf33('0x1a')]=qs[_0xdf33('0x1a')](_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x1a')]);}_0x464df4[_0xdf33('0x38')]=qs['sort'](_0x2b5cbc['query'][_0xdf33('0x39')]);_0x464df4[_0xdf33('0x3a')]=qs[_0xdf33('0x34')](_[_0xdf33('0x3b')](_0x2b5cbc['query'],_0x1ac378['filters']),_0x586511);if(_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x3c')]){_0x464df4['where']=_['merge'](_0x464df4['where'],{'$or':_['map'](_0x586511,function(_0x39b25e){if(_0x39b25e['type']!==_0xdf33('0x3d')){var _0x229059={};_0x229059[_0x39b25e[_0xdf33('0x29')]]={'$like':'%'+_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x3c')]+'%'};return _0x229059;}})});}_0x464df4=_[_0xdf33('0x3e')]({},_0x464df4,_0x2b5cbc[_0xdf33('0x3f')]);var _0x4a13fb={'where':_0x464df4[_0xdf33('0x3a')]};return db[_0xdf33('0x2c')][_0xdf33('0x1c')](_0x4a13fb)[_0xdf33('0x21')](function(_0x11e1e4){_0x436beb['count']=_0x11e1e4;if(_0x2b5cbc[_0xdf33('0x32')][_0xdf33('0x40')]){_0x464df4[_0xdf33('0x41')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x464df4);})[_0xdf33('0x21')](function(_0x1e365b){_0x436beb[_0xdf33('0x42')]=_0x1e365b;return _0x436beb;})[_0xdf33('0x21')](respondWithFilteredResult(_0x2008bb,_0x464df4))['catch'](handleError(_0x2008bb,null));};exports[_0xdf33('0x43')]=function(_0x5d2cf6,_0x164b25){var _0x1632f1={'raw':!![],'where':{'id':_0x5d2cf6[_0xdf33('0x44')]['id']}},_0x424518={};_0x424518[_0xdf33('0x30')]=_[_0xdf33('0x33')](db[_0xdf33('0x2c')][_0xdf33('0x2d')]);_0x424518['query']=_['keys'](_0x5d2cf6[_0xdf33('0x32')]);_0x424518[_0xdf33('0x34')]=_[_0xdf33('0x35')](_0x424518[_0xdf33('0x30')],_0x424518[_0xdf33('0x32')]);_0x1632f1[_0xdf33('0x37')]=_[_0xdf33('0x35')](_0x424518['model'],qs['fields'](_0x5d2cf6[_0xdf33('0x32')][_0xdf33('0x36')]));_0x1632f1['attributes']=_0x1632f1['attributes'][_0xdf33('0x45')]?_0x1632f1[_0xdf33('0x37')]:_0x424518[_0xdf33('0x30')];if(_0x5d2cf6[_0xdf33('0x32')][_0xdf33('0x40')]){_0x1632f1[_0xdf33('0x41')]=[{'all':!![]}];}_0x1632f1=_[_0xdf33('0x3e')]({},_0x1632f1,_0x5d2cf6[_0xdf33('0x3f')]);return db[_0xdf33('0x2c')][_0xdf33('0x46')](_0x1632f1)[_0xdf33('0x21')](handleEntityNotFound(_0x164b25,null))[_0xdf33('0x21')](respondWithResult(_0x164b25,null))['catch'](handleError(_0x164b25,null));};exports['create']=function(_0x470883,_0x213135){return db[_0xdf33('0x2c')]['create'](_0x470883[_0xdf33('0x47')],{})['then'](function(_0x45a4e6){var _0x1a9e27=_0x470883[_0xdf33('0x48')][_0xdf33('0x23')]({'plain':!![]});if(!_0x1a9e27)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a9e27[_0xdf33('0x49')]===_0xdf33('0x48')){var _0x587031=_0x45a4e6[_0xdf33('0x23')]({'plain':!![]});var _0x3a217a=_0xdf33('0x24');return db['UserProfileSection'][_0xdf33('0x46')]({'where':{'name':_0x3a217a,'userProfileId':_0x1a9e27[_0xdf33('0x4a')]},'raw':!![]})[_0xdf33('0x21')](function(_0x225f38){if(_0x225f38&&_0x225f38[_0xdf33('0x4b')]===0x0){return db[_0xdf33('0x25')][_0xdf33('0x4c')]({'name':_0x587031[_0xdf33('0x29')],'resourceId':_0x587031['id'],'type':_0x225f38['name'],'sectionId':_0x225f38['id']},{})[_0xdf33('0x21')](function(){return _0x45a4e6;});}else{return _0x45a4e6;}})[_0xdf33('0x4d')](function(_0x2427fe){logger['error'](_0xdf33('0x4e'),_0x2427fe);throw _0x2427fe;});}return _0x45a4e6;})[_0xdf33('0x21')](respondWithResult(_0x213135,0xc9))['catch'](handleError(_0x213135,null));};exports['update']=function(_0x3e28c4,_0x37a640){if(_0x3e28c4[_0xdf33('0x47')]['id']){delete _0x3e28c4[_0xdf33('0x47')]['id'];}return db[_0xdf33('0x2c')][_0xdf33('0x46')]({'where':{'id':_0x3e28c4[_0xdf33('0x44')]['id']}})[_0xdf33('0x21')](handleEntityNotFound(_0x37a640,null))[_0xdf33('0x21')](saveUpdates(_0x3e28c4[_0xdf33('0x47')],null))['then'](respondWithResult(_0x37a640,null))[_0xdf33('0x4d')](handleError(_0x37a640,null));};exports[_0xdf33('0x22')]=function(_0x127699,_0x55f7d9){return db[_0xdf33('0x2c')][_0xdf33('0x46')]({'where':{'id':_0x127699[_0xdf33('0x44')]['id']}})[_0xdf33('0x21')](handleEntityNotFound(_0x55f7d9,null))[_0xdf33('0x21')](removeEntity(_0x55f7d9,null))[_0xdf33('0x4d')](handleError(_0x55f7d9,null));};
\ No newline at end of file
+var _0x7ec9=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','stack','name','send','map','CmHopperAdditionalPhone','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create'];(function(_0x2ff04f,_0x4df3c7){var _0x585742=function(_0x2885ed){while(--_0x2885ed){_0x2ff04f['push'](_0x2ff04f['shift']());}};_0x585742(++_0x4df3c7);}(_0x7ec9,0x1e4));var _0x97ec=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x7ec9[_0x2cfb48];return _0xc4594f;};'use strict';var emlformat=require(_0x97ec('0x0'));var rimraf=require(_0x97ec('0x1'));var zipdir=require(_0x97ec('0x2'));var jsonpatch=require(_0x97ec('0x3'));var rp=require('request-promise');var moment=require(_0x97ec('0x4'));var BPromise=require(_0x97ec('0x5'));var Mustache=require(_0x97ec('0x6'));var util=require(_0x97ec('0x7'));var path=require(_0x97ec('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x97ec('0x9'));var fs=require('fs');var fs_extra=require(_0x97ec('0xa'));var _=require(_0x97ec('0xb'));var squel=require(_0x97ec('0xc'));var crypto=require(_0x97ec('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97ec('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x97ec('0xf'));var authService=require(_0x97ec('0x10'));var qs=require(_0x97ec('0x11'));var as=require(_0x97ec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97ec('0x13'))('api');var utils=require(_0x97ec('0x14'));var config=require(_0x97ec('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a9598,_0x1c31f0){_0x1c31f0=_0x1c31f0||0xcc;return function(_0x3baf02){if(_0x3baf02){return _0x4a9598[_0x97ec('0x16')](_0x1c31f0);}return _0x4a9598[_0x97ec('0x17')](_0x1c31f0)['end']();};}function respondWithResult(_0x59705f,_0x15e248){_0x15e248=_0x15e248||0xc8;return function(_0x239b7b){if(_0x239b7b){return _0x59705f[_0x97ec('0x17')](_0x15e248)[_0x97ec('0x18')](_0x239b7b);}};}function respondWithFilteredResult(_0x2e10f2,_0x1f5f6f){return function(_0x2bb144){if(_0x2bb144){var _0x3af04c=typeof _0x1f5f6f[_0x97ec('0x19')]===_0x97ec('0x1a')&&typeof _0x1f5f6f[_0x97ec('0x1b')]===_0x97ec('0x1a');var _0x23c946=_0x2bb144[_0x97ec('0x1c')];var _0xa27de9=_0x3af04c?0x0:_0x1f5f6f[_0x97ec('0x19')];var _0x18d5ac=_0x3af04c?_0x2bb144['count']:_0x1f5f6f[_0x97ec('0x19')]+_0x1f5f6f[_0x97ec('0x1b')];var _0x126fbd;if(_0x18d5ac>=_0x23c946){_0x18d5ac=_0x23c946;_0x126fbd=0xc8;}else{_0x126fbd=0xce;}_0x2e10f2[_0x97ec('0x17')](_0x126fbd);return _0x2e10f2['set'](_0x97ec('0x1d'),_0xa27de9+'-'+_0x18d5ac+'/'+_0x23c946)['json'](_0x2bb144);}return null;};}function patchUpdates(_0x10290d){return function(_0x28d7ff){try{jsonpatch['apply'](_0x28d7ff,_0x10290d,!![]);}catch(_0x16eb24){return BPromise[_0x97ec('0x1e')](_0x16eb24);}return _0x28d7ff[_0x97ec('0x1f')]();};}function saveUpdates(_0xd0bee5,_0x2fc108){return function(_0x20e9a5){if(_0x20e9a5){return _0x20e9a5[_0x97ec('0x20')](_0xd0bee5)[_0x97ec('0x21')](function(_0xfad260){return _0xfad260;});}return null;};}function removeEntity(_0x6a3792,_0x7192bd){return function(_0x15830b){if(_0x15830b){return _0x15830b[_0x97ec('0x22')]()[_0x97ec('0x21')](function(){var _0x46350b=_0x15830b['get']({'plain':!![]});var _0x57cad2=_0x97ec('0x23');return db[_0x97ec('0x24')][_0x97ec('0x22')]({'where':{'type':_0x57cad2,'resourceId':_0x46350b['id']}})[_0x97ec('0x21')](function(){return _0x15830b;});})[_0x97ec('0x21')](function(){_0x6a3792[_0x97ec('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18b188,_0x7355f7){return function(_0x29176b){if(!_0x29176b){_0x18b188[_0x97ec('0x16')](0x194);}return _0x29176b;};}function handleError(_0x49101f,_0x363b8b){_0x363b8b=_0x363b8b||0x1f4;return function(_0x1d2a65){logger['error'](_0x1d2a65[_0x97ec('0x25')]);if(_0x1d2a65[_0x97ec('0x26')]){delete _0x1d2a65['name'];}_0x49101f[_0x97ec('0x17')](_0x363b8b)[_0x97ec('0x27')](_0x1d2a65);};}exports['index']=function(_0x29e17d,_0x3f44d7){var _0x2d9391={},_0x59996b={},_0x537ef7={'count':0x0,'rows':[]};var _0x1334f9=_[_0x97ec('0x28')](db[_0x97ec('0x29')]['rawAttributes'],function(_0x149047){return{'name':_0x149047[_0x97ec('0x2a')],'type':_0x149047[_0x97ec('0x2b')][_0x97ec('0x2c')]};});_0x59996b[_0x97ec('0x2d')]=_[_0x97ec('0x28')](_0x1334f9,_0x97ec('0x26'));_0x59996b[_0x97ec('0x2e')]=_[_0x97ec('0x2f')](_0x29e17d[_0x97ec('0x2e')]);_0x59996b['filters']=_[_0x97ec('0x30')](_0x59996b[_0x97ec('0x2d')],_0x59996b[_0x97ec('0x2e')]);_0x2d9391[_0x97ec('0x31')]=_[_0x97ec('0x30')](_0x59996b[_0x97ec('0x2d')],qs[_0x97ec('0x32')](_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x32')]));_0x2d9391[_0x97ec('0x31')]=_0x2d9391[_0x97ec('0x31')][_0x97ec('0x33')]?_0x2d9391[_0x97ec('0x31')]:_0x59996b['model'];if(!_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x34')](_0x97ec('0x35'))){_0x2d9391[_0x97ec('0x1b')]=qs[_0x97ec('0x1b')](_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x1b')]);_0x2d9391[_0x97ec('0x19')]=qs['offset'](_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x19')]);}_0x2d9391[_0x97ec('0x36')]=qs[_0x97ec('0x37')](_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x37')]);_0x2d9391[_0x97ec('0x38')]=qs[_0x97ec('0x39')](_[_0x97ec('0x3a')](_0x29e17d[_0x97ec('0x2e')],_0x59996b[_0x97ec('0x39')]),_0x1334f9);if(_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x3b')]){_0x2d9391[_0x97ec('0x38')]=_[_0x97ec('0x3c')](_0x2d9391['where'],{'$or':_[_0x97ec('0x28')](_0x1334f9,function(_0x6f59b5){if(_0x6f59b5[_0x97ec('0x2b')]!=='VIRTUAL'){var _0x5e7f33={};_0x5e7f33[_0x6f59b5[_0x97ec('0x26')]]={'$like':'%'+_0x29e17d[_0x97ec('0x2e')]['filter']+'%'};return _0x5e7f33;}})});}_0x2d9391=_['merge']({},_0x2d9391,_0x29e17d[_0x97ec('0x3d')]);var _0x4d72f7={'where':_0x2d9391['where']};return db[_0x97ec('0x29')]['count'](_0x4d72f7)[_0x97ec('0x21')](function(_0x593d79){_0x537ef7['count']=_0x593d79;if(_0x29e17d[_0x97ec('0x2e')][_0x97ec('0x3e')]){_0x2d9391[_0x97ec('0x3f')]=[{'all':!![]}];}return db[_0x97ec('0x29')][_0x97ec('0x40')](_0x2d9391);})[_0x97ec('0x21')](function(_0x4e7ecf){_0x537ef7[_0x97ec('0x41')]=_0x4e7ecf;return _0x537ef7;})['then'](respondWithFilteredResult(_0x3f44d7,_0x2d9391))[_0x97ec('0x42')](handleError(_0x3f44d7,null));};exports['show']=function(_0x98061a,_0x3e1392){var _0x1d92e6={'raw':!![],'where':{'id':_0x98061a['params']['id']}},_0x1975b6={};_0x1975b6[_0x97ec('0x2d')]=_[_0x97ec('0x2f')](db[_0x97ec('0x29')]['rawAttributes']);_0x1975b6['query']=_['keys'](_0x98061a[_0x97ec('0x2e')]);_0x1975b6[_0x97ec('0x39')]=_[_0x97ec('0x30')](_0x1975b6[_0x97ec('0x2d')],_0x1975b6[_0x97ec('0x2e')]);_0x1d92e6[_0x97ec('0x31')]=_[_0x97ec('0x30')](_0x1975b6['model'],qs[_0x97ec('0x32')](_0x98061a['query'][_0x97ec('0x32')]));_0x1d92e6[_0x97ec('0x31')]=_0x1d92e6[_0x97ec('0x31')][_0x97ec('0x33')]?_0x1d92e6['attributes']:_0x1975b6[_0x97ec('0x2d')];if(_0x98061a[_0x97ec('0x2e')]['includeAll']){_0x1d92e6[_0x97ec('0x3f')]=[{'all':!![]}];}_0x1d92e6=_[_0x97ec('0x3c')]({},_0x1d92e6,_0x98061a[_0x97ec('0x3d')]);return db[_0x97ec('0x29')][_0x97ec('0x43')](_0x1d92e6)[_0x97ec('0x21')](handleEntityNotFound(_0x3e1392,null))['then'](respondWithResult(_0x3e1392,null))[_0x97ec('0x42')](handleError(_0x3e1392,null));};exports[_0x97ec('0x44')]=function(_0x5debf1,_0x5b0a92){return db[_0x97ec('0x29')][_0x97ec('0x44')](_0x5debf1[_0x97ec('0x45')],{})[_0x97ec('0x21')](function(_0x38dfd0){var _0x411679=_0x5debf1[_0x97ec('0x46')][_0x97ec('0x47')]({'plain':!![]});if(!_0x411679)throw new Error(_0x97ec('0x48'));if(_0x411679[_0x97ec('0x49')]==='user'){var _0x119d1d=_0x38dfd0[_0x97ec('0x47')]({'plain':!![]});var _0x62a0d8=_0x97ec('0x23');return db[_0x97ec('0x4a')][_0x97ec('0x43')]({'where':{'name':_0x62a0d8,'userProfileId':_0x411679[_0x97ec('0x4b')]},'raw':!![]})[_0x97ec('0x21')](function(_0x2f78f4){if(_0x2f78f4&&_0x2f78f4[_0x97ec('0x4c')]===0x0){return db[_0x97ec('0x24')][_0x97ec('0x44')]({'name':_0x119d1d[_0x97ec('0x26')],'resourceId':_0x119d1d['id'],'type':_0x2f78f4['name'],'sectionId':_0x2f78f4['id']},{})[_0x97ec('0x21')](function(){return _0x38dfd0;});}else{return _0x38dfd0;}})[_0x97ec('0x42')](function(_0x4d9eb3){logger[_0x97ec('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d9eb3);throw _0x4d9eb3;});}return _0x38dfd0;})[_0x97ec('0x21')](respondWithResult(_0x5b0a92,0xc9))['catch'](handleError(_0x5b0a92,null));};exports['update']=function(_0x1cbbf4,_0x4da0c0){if(_0x1cbbf4[_0x97ec('0x45')]['id']){delete _0x1cbbf4[_0x97ec('0x45')]['id'];}return db[_0x97ec('0x29')]['find']({'where':{'id':_0x1cbbf4[_0x97ec('0x4e')]['id']}})[_0x97ec('0x21')](handleEntityNotFound(_0x4da0c0,null))[_0x97ec('0x21')](saveUpdates(_0x1cbbf4[_0x97ec('0x45')],null))['then'](respondWithResult(_0x4da0c0,null))['catch'](handleError(_0x4da0c0,null));};exports[_0x97ec('0x22')]=function(_0x37c08b,_0x195911){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x37c08b[_0x97ec('0x4e')]['id']}})[_0x97ec('0x21')](handleEntityNotFound(_0x195911,null))[_0x97ec('0x21')](removeEntity(_0x195911,null))[_0x97ec('0x42')](handleError(_0x195911,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7be4=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x12ea1e,_0x5e965f){var _0x2c1505=function(_0x38e952){while(--_0x38e952){_0x12ea1e['push'](_0x12ea1e['shift']());}};_0x2c1505(++_0x5e965f);}(_0x7be4,0x16e));var _0x47be=function(_0x52063b,_0x125b81){_0x52063b=_0x52063b-0x0;var _0xc94b04=_0x7be4[_0x52063b];return _0xc94b04;};'use strict';var _=require(_0x47be('0x0'));var util=require(_0x47be('0x1'));var logger=require(_0x47be('0x2'))(_0x47be('0x3'));var moment=require(_0x47be('0x4'));var BPromise=require(_0x47be('0x5'));var rp=require(_0x47be('0x6'));var fs=require('fs');var path=require(_0x47be('0x7'));var rimraf=require(_0x47be('0x8'));var config=require(_0x47be('0x9'));var attributes=require(_0x47be('0xa'));module[_0x47be('0xb')]=function(_0x4c5a08,_0x475ba7){return _0x4c5a08[_0x47be('0xc')](_0x47be('0xd'),attributes,{'tableName':_0x47be('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d84=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x357ab5,_0x2c534f){var _0x299b28=function(_0x1ab12f){while(--_0x1ab12f){_0x357ab5['push'](_0x357ab5['shift']());}};_0x299b28(++_0x2c534f);}(_0x4d84,0xad));var _0x44d8=function(_0x53145f,_0x47e237){_0x53145f=_0x53145f-0x0;var _0x4a4dd1=_0x4d84[_0x53145f];return _0x4a4dd1;};'use strict';var _=require(_0x44d8('0x0'));var util=require(_0x44d8('0x1'));var logger=require(_0x44d8('0x2'))(_0x44d8('0x3'));var moment=require(_0x44d8('0x4'));var BPromise=require(_0x44d8('0x5'));var rp=require(_0x44d8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44d8('0x7'));module[_0x44d8('0x8')]=function(_0x2cade6,_0x4ade8b){return _0x2cade6[_0x44d8('0x9')](_0x44d8('0xa'),attributes,{'tableName':_0x44d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc5c2=['minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','request\x20sent','debug','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','SwapAdditionalPhones','duration','isNil','scheduledat','add'];(function(_0x2fc834,_0x3aff52){var _0x12e7f9=function(_0x59ac43){while(--_0x59ac43){_0x2fc834['push'](_0x2fc834['shift']());}};_0x12e7f9(++_0x3aff52);}(_0xc5c2,0x14d));var _0x2c5c=function(_0x56b508,_0x4d642a){_0x56b508=_0x56b508-0x0;var _0x2a0b8e=_0xc5c2[_0x56b508];return _0x2a0b8e;};'use strict';var _=require(_0x2c5c('0x0'));var util=require(_0x2c5c('0x1'));var moment=require(_0x2c5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c5c('0x3'))['db'];var utils=require(_0x2c5c('0x4'));var logger=require(_0x2c5c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2c5c('0x6'));var client=jayson[_0x2c5c('0x7')][_0x2c5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dd75e,_0x370475,_0x3e6735){return new BPromise(function(_0x13bd7b,_0x2bd5b3){return client['request'](_0x4dd75e,_0x3e6735)['then'](function(_0x30652f){logger[_0x2c5c('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x370475,_0x2c5c('0xa'));logger[_0x2c5c('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x370475,_0x2c5c('0xa'),JSON['stringify'](_0x30652f));if(_0x30652f['error']){if(_0x30652f[_0x2c5c('0xc')][_0x2c5c('0xd')]===0x1f4){logger[_0x2c5c('0xc')](_0x2c5c('0xe'),_0x370475,_0x30652f['error'][_0x2c5c('0xf')]);return _0x2bd5b3(_0x30652f[_0x2c5c('0xc')]['message']);}logger['error'](_0x2c5c('0xe'),_0x370475,_0x30652f[_0x2c5c('0xc')][_0x2c5c('0xf')]);return _0x13bd7b(_0x30652f[_0x2c5c('0xc')][_0x2c5c('0xf')]);}else{logger[_0x2c5c('0x9')](_0x2c5c('0xe'),_0x370475,_0x2c5c('0xa'));_0x13bd7b(_0x30652f[_0x2c5c('0x10')][_0x2c5c('0xf')]);}})[_0x2c5c('0x11')](function(_0x1f6d7c){logger[_0x2c5c('0xc')](_0x2c5c('0xe'),_0x370475,_0x1f6d7c);_0x2bd5b3(_0x1f6d7c);});});}exports[_0x2c5c('0x12')]=function(_0x144fae){var _0x108568=this;return new Promise(function(_0xc3a0c6,_0x52ad2b){return db[_0x2c5c('0x13')][_0x2c5c('0x14')]({'raw':!![],'where':{'ContactId':_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x16')],'ListId':_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x17')],'VoiceQueueId':_0x144fae['body'][_0x2c5c('0x18')]===undefined?null:_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x18')],'CampaignId':_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x19')]===undefined?null:_0x144fae[_0x2c5c('0x15')][_0x2c5c('0x19')]}})['then'](function(_0x3aa590){if(_0x3aa590!=null){return db[_0x2c5c('0x1a')][_0x2c5c('0x14')]({'raw':!![],'where':{'CmHopperId':_0x3aa590['id'],'OrderBy':{'$gt':_0x3aa590[_0x2c5c('0x1b')]}},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})[_0x2c5c('0x1d')](function(_0x381a76){var _0x54dfb1=0x0;if(_0x381a76){if(_0x381a76[_0x2c5c('0x1e')]+_0x381a76['countcongestionretry']+_0x381a76['countnoanswerretry']+_0x381a76['countnosuchnumberretry']+_0x381a76[_0x2c5c('0x1f')]+_0x381a76[_0x2c5c('0x20')]+_0x381a76[_0x2c5c('0x21')]+_0x381a76[_0x2c5c('0x22')]<_0x144fae[_0x2c5c('0x23')]['dialGlobalMaxRetry'])_0x54dfb1=0x1;_0xc3a0c6({'additional':_0x54dfb1});}else{return db[_0x2c5c('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3aa590['id']},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})['then'](function(_0x5624f3){var _0x2af96f=0x0;if(_0x5624f3){if(_0x5624f3[_0x2c5c('0x1e')]+_0x5624f3[_0x2c5c('0x24')]+_0x5624f3[_0x2c5c('0x25')]+_0x5624f3[_0x2c5c('0x26')]+_0x5624f3['countdropretry']+_0x5624f3['countabandonedretry']+_0x5624f3[_0x2c5c('0x21')]+_0x5624f3[_0x2c5c('0x22')]<_0x144fae[_0x2c5c('0x23')][_0x2c5c('0x27')])_0x2af96f=0x1;_0xc3a0c6({'additional':_0x2af96f});}else{_0xc3a0c6({'additional':0x0});}})[_0x2c5c('0x11')](function(_0x15d1d9){logger[_0x2c5c('0xc')](_0x2c5c('0x12'),_0x15d1d9['message']);_0x52ad2b(_0x108568[_0x2c5c('0xc')](0x1f4,_0x15d1d9[_0x2c5c('0xf')]));});}})['catch'](function(_0x187333){logger[_0x2c5c('0xc')](_0x2c5c('0x12'),_0x187333[_0x2c5c('0xf')]);_0x52ad2b(_0x108568[_0x2c5c('0xc')](0x1f4,_0x187333['message']));});}else _0xc3a0c6({'additional':0x0});});});};exports[_0x2c5c('0x28')]=function(_0x473fe8){var _0x5c2249=this;return new Promise(function(_0x3bf52c,_0x3095a2){return db[_0x2c5c('0x13')][_0x2c5c('0x14')]({'raw':!![],'where':{'ContactId':_0x473fe8['body']['ContactId'],'ListId':_0x473fe8[_0x2c5c('0x15')]['ListId'],'VoiceQueueId':_0x473fe8[_0x2c5c('0x15')][_0x2c5c('0x18')]===undefined?null:_0x473fe8[_0x2c5c('0x15')][_0x2c5c('0x18')],'CampaignId':_0x473fe8['body'][_0x2c5c('0x19')]===undefined?null:_0x473fe8['body'][_0x2c5c('0x19')]}})[_0x2c5c('0x1d')](function(_0x5853f0){if(_0x5853f0!=null){return db[_0x2c5c('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5853f0['id'],'OrderBy':{'$gte':_0x5853f0[_0x2c5c('0x1b')]}},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})[_0x2c5c('0x1d')](function(_0x426178){if(_0x426178)return activateAdditionalPhone(_0x5853f0,_0x473fe8['body'],_0x426178,_0x473fe8['duration'],_0x473fe8['waitTime'])[_0x2c5c('0x1d')](function(_0x5856e6){_0x3bf52c(_0x5856e6);});else{return db[_0x2c5c('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5853f0['id']},'order':[[_0x2c5c('0x1b'),_0x2c5c('0x1c')]]})[_0x2c5c('0x1d')](function(_0x424a1e){if(_0x424a1e)return activateAdditionalPhone(_0x5853f0,_0x473fe8[_0x2c5c('0x15')],_0x424a1e,_0x473fe8[_0x2c5c('0x29')],_0x473fe8['waitTime'])[_0x2c5c('0x1d')](function(_0x198ee1){_0x3bf52c(_0x198ee1);});else{_0x3bf52c({'id':_0x5853f0['id'],'phone':''});}})[_0x2c5c('0x11')](function(_0x8f22f6){logger[_0x2c5c('0xc')](_0x2c5c('0x12'),_0x8f22f6[_0x2c5c('0xf')]);_0x3095a2(_0x5c2249[_0x2c5c('0xc')](0x1f4,_0x8f22f6[_0x2c5c('0xf')]));});}})[_0x2c5c('0x11')](function(_0x3ccb6f){logger['error'](_0x2c5c('0x12'),_0x3ccb6f[_0x2c5c('0xf')]);_0x3095a2(_0x5c2249[_0x2c5c('0xc')](0x1f4,_0x3ccb6f['message']));});}else _0x3bf52c(0x1);});});};function activateAdditionalPhone(_0x13769e,_0x340fd7,_0x2f3822,_0x10dcec,_0x1558d8){return new Promise(function(_0x3e93ba,_0xaa2642){var _0x3e3402;if(_[_0x2c5c('0x2a')](_0x2f3822[_0x2c5c('0x2b')])){_0x2f3822[_0x2c5c('0x2b')]=moment();}if(moment()>moment(_0x2f3822[_0x2c5c('0x2b')])){_0x3e3402=moment()[_0x2c5c('0x2c')](_0x1558d8||0x3,_0x2c5c('0x2d'));}else{if(_0x2f3822[_0x2c5c('0x1b')]==0x0){_0x3e3402=moment(_0x2f3822[_0x2c5c('0x2b')]);}else{_0x3e3402=moment()[_0x2c5c('0x2c')](_0x1558d8||0x3,'minutes');}}if(_[_0x2c5c('0x2a')](_0x3e3402)){_0x3e3402=moment()[_0x2c5c('0x2c')](_0x1558d8||0x3,_0x2c5c('0x2d'));}var _0x451879={'phone':_0x13769e[_0x2c5c('0x2e')],'active':0x0,'OrderBy':_[_0x2c5c('0x2a')](_0x13769e[_0x2c5c('0x1b')])?0x0:_0x13769e[_0x2c5c('0x1b')],'scheduledat':moment()[_0x2c5c('0x2c')](_0x10dcec||0x1,_0x2c5c('0x2d')),'countbusyretry':_0x340fd7[_0x2c5c('0x1e')],'countcongestionretry':_0x340fd7[_0x2c5c('0x24')],'countnoanswerretry':_0x340fd7[_0x2c5c('0x25')],'countnosuchnumberretry':_0x340fd7[_0x2c5c('0x26')],'countdropretry':_0x340fd7['countdropretry'],'countabandonedretry':_0x340fd7[_0x2c5c('0x20')],'countmachineretry':_0x340fd7[_0x2c5c('0x21')],'countagentrejectretry':_0x340fd7['countagentrejectretry'],'createdAt':_0x340fd7[_0x2c5c('0x2f')],'updatedAt':_0x340fd7[_0x2c5c('0x30')]};var _0x271ab0={'CmHopperId':_0x13769e['id'],'phone':_0x2f3822[_0x2c5c('0x2e')],'active':0x0,'OrderBy':_[_0x2c5c('0x2a')](_0x2f3822[_0x2c5c('0x1b')])?0x0:_0x2f3822['OrderBy'],'scheduledat':_0x3e3402,'countbusyretry':_0x2f3822[_0x2c5c('0x1e')],'countcongestionretry':_0x2f3822['countcongestionretry'],'countnoanswerretry':_0x2f3822[_0x2c5c('0x25')],'countnosuchnumberretry':_0x2f3822[_0x2c5c('0x26')],'countdropretry':_0x2f3822[_0x2c5c('0x1f')],'countabandonedretry':_0x2f3822[_0x2c5c('0x20')],'countmachineretry':_0x2f3822[_0x2c5c('0x21')],'countagentrejectretry':_0x2f3822['countagentrejectretry'],'createdAt':_0x2f3822[_0x2c5c('0x2f')],'updatedAt':_0x2f3822['updatedAt']};return db[_0x2c5c('0x31')][_0x2c5c('0x32')](function(_0x529780){return db[_0x2c5c('0x1a')]['update'](_0x451879,{'where':{'id':_0x2f3822['id']}},{'transaction':_0x529780})[_0x2c5c('0x1d')](function(){return db[_0x2c5c('0x13')][_0x2c5c('0x33')](_0x271ab0,{'where':{'id':_0x13769e['id']}},{'transaction':_0x529780});});})['then'](function(_0x23f5f2){_0x3e93ba({'id':_0x13769e['id'],'phone':_0x2f3822[_0x2c5c('0x2e')]});})['catch'](function(_0x3cbf0f){logger['error'](_0x2c5c('0x34'),_0x3cbf0f[_0x2c5c('0xf')]);_0xaa2642({'error':_0x3cbf0f[_0x2c5c('0xf')]});});});}exports[_0x2c5c('0x35')]=function(_0x43c435){var _0x592f4c=this;return new Promise(function(_0x24e914,_0x18d361){return db['CmHopper'][_0x2c5c('0x33')](_0x43c435[_0x2c5c('0x15')]['field'],{'where':{'id':_0x43c435[_0x2c5c('0x15')]['id']}})[_0x2c5c('0x1d')](function(_0x1f4f08){_0x24e914(_0x1f4f08);})['catch'](function(_0x8ca65b){logger['error']('IncrementPreviewCounters',_0x8ca65b[_0x2c5c('0xf')]);_0x18d361(_0x592f4c[_0x2c5c('0xc')](0x1f4,_0x8ca65b[_0x2c5c('0xf')]));});});};
\ No newline at end of file
+var _0xa3dd=['VoiceQueueId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','then','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','ListId','CampaignId','duration','waitTime','isNil','scheduledat','add','minutes','phone','countnoanswerretry','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','error','code','message','VerifyAdditionalPhones','CmHopper','body','ContactId'];(function(_0x56c37d,_0x486618){var _0x120476=function(_0x125e54){while(--_0x125e54){_0x56c37d['push'](_0x56c37d['shift']());}};_0x120476(++_0x486618);}(_0xa3dd,0x1e1));var _0xda3d=function(_0x309bde,_0x3ef7f5){_0x309bde=_0x309bde-0x0;var _0x5fa8bc=_0xa3dd[_0x309bde];return _0x5fa8bc;};'use strict';var _=require(_0xda3d('0x0'));var util=require(_0xda3d('0x1'));var moment=require('moment');var BPromise=require(_0xda3d('0x2'));var rs=require(_0xda3d('0x3'));var fs=require('fs');var Redis=require(_0xda3d('0x4'));var db=require(_0xda3d('0x5'))['db'];var utils=require(_0xda3d('0x6'));var logger=require(_0xda3d('0x7'))(_0xda3d('0x8'));var config=require(_0xda3d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda3d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16dee5,_0x494d6d,_0x1453e9){return new BPromise(function(_0xe6ff9,_0x68938e){return client[_0xda3d('0xb')](_0x16dee5,_0x1453e9)['then'](function(_0x1ff055){logger[_0xda3d('0xc')](_0xda3d('0xd'),_0x494d6d,_0xda3d('0xe'));logger[_0xda3d('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x494d6d,_0xda3d('0xe'),JSON['stringify'](_0x1ff055));if(_0x1ff055[_0xda3d('0x10')]){if(_0x1ff055[_0xda3d('0x10')][_0xda3d('0x11')]===0x1f4){logger['error'](_0xda3d('0xd'),_0x494d6d,_0x1ff055[_0xda3d('0x10')][_0xda3d('0x12')]);return _0x68938e(_0x1ff055[_0xda3d('0x10')][_0xda3d('0x12')]);}logger[_0xda3d('0x10')](_0xda3d('0xd'),_0x494d6d,_0x1ff055[_0xda3d('0x10')][_0xda3d('0x12')]);return _0xe6ff9(_0x1ff055['error'][_0xda3d('0x12')]);}else{logger[_0xda3d('0xc')](_0xda3d('0xd'),_0x494d6d,_0xda3d('0xe'));_0xe6ff9(_0x1ff055['result'][_0xda3d('0x12')]);}})['catch'](function(_0x34187c){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x494d6d,_0x34187c);_0x68938e(_0x34187c);});});}exports[_0xda3d('0x13')]=function(_0x3d3f05){var _0x180ff4=this;return new Promise(function(_0x4d7447,_0x1de3cb){return db[_0xda3d('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x3d3f05[_0xda3d('0x15')][_0xda3d('0x16')],'ListId':_0x3d3f05[_0xda3d('0x15')]['ListId'],'VoiceQueueId':_0x3d3f05[_0xda3d('0x15')][_0xda3d('0x17')]===undefined?null:_0x3d3f05[_0xda3d('0x15')][_0xda3d('0x17')],'CampaignId':_0x3d3f05['body']['CampaignId']===undefined?null:_0x3d3f05['body']['CampaignId']}})['then'](function(_0x53c23){if(_0x53c23!=null){return db[_0xda3d('0x18')][_0xda3d('0x19')]({'raw':!![],'where':{'CmHopperId':_0x53c23['id'],'OrderBy':{'$gt':_0x53c23[_0xda3d('0x1a')]}},'order':[['OrderBy',_0xda3d('0x1b')]]})[_0xda3d('0x1c')](function(_0x4dc72c){var _0x276841=0x0;if(_0x4dc72c){if(_0x4dc72c[_0xda3d('0x1d')]+_0x4dc72c[_0xda3d('0x1e')]+_0x4dc72c['countnoanswerretry']+_0x4dc72c[_0xda3d('0x1f')]+_0x4dc72c[_0xda3d('0x20')]+_0x4dc72c[_0xda3d('0x21')]+_0x4dc72c[_0xda3d('0x22')]+_0x4dc72c[_0xda3d('0x23')]<_0x3d3f05['entity'][_0xda3d('0x24')])_0x276841=0x1;_0x4d7447({'additional':_0x276841});}else{return db[_0xda3d('0x18')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x53c23['id']},'order':[[_0xda3d('0x1a'),_0xda3d('0x1b')]]})[_0xda3d('0x1c')](function(_0x3a7d27){var _0x46f087=0x0;if(_0x3a7d27){if(_0x3a7d27[_0xda3d('0x1d')]+_0x3a7d27[_0xda3d('0x1e')]+_0x3a7d27['countnoanswerretry']+_0x3a7d27[_0xda3d('0x1f')]+_0x3a7d27['countdropretry']+_0x3a7d27[_0xda3d('0x21')]+_0x3a7d27[_0xda3d('0x22')]+_0x3a7d27['countagentrejectretry']<_0x3d3f05['entity'][_0xda3d('0x24')])_0x46f087=0x1;_0x4d7447({'additional':_0x46f087});}else{_0x4d7447({'additional':0x0});}})['catch'](function(_0xdc21fd){logger['error'](_0xda3d('0x13'),_0xdc21fd[_0xda3d('0x12')]);_0x1de3cb(_0x180ff4[_0xda3d('0x10')](0x1f4,_0xdc21fd[_0xda3d('0x12')]));});}})[_0xda3d('0x25')](function(_0x399fee){logger['error'](_0xda3d('0x13'),_0x399fee[_0xda3d('0x12')]);_0x1de3cb(_0x180ff4[_0xda3d('0x10')](0x1f4,_0x399fee['message']));});}else _0x4d7447({'additional':0x0});});});};exports[_0xda3d('0x26')]=function(_0x3aff16){var _0x3704d4=this;return new Promise(function(_0xf38e55,_0x18272d){return db[_0xda3d('0x14')][_0xda3d('0x19')]({'raw':!![],'where':{'ContactId':_0x3aff16[_0xda3d('0x15')][_0xda3d('0x16')],'ListId':_0x3aff16[_0xda3d('0x15')][_0xda3d('0x27')],'VoiceQueueId':_0x3aff16[_0xda3d('0x15')]['VoiceQueueId']===undefined?null:_0x3aff16[_0xda3d('0x15')][_0xda3d('0x17')],'CampaignId':_0x3aff16[_0xda3d('0x15')][_0xda3d('0x28')]===undefined?null:_0x3aff16[_0xda3d('0x15')][_0xda3d('0x28')]}})[_0xda3d('0x1c')](function(_0x22f61f){if(_0x22f61f!=null){return db[_0xda3d('0x18')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x22f61f['id'],'OrderBy':{'$gte':_0x22f61f[_0xda3d('0x1a')]}},'order':[['OrderBy','ASC']]})[_0xda3d('0x1c')](function(_0x18164e){if(_0x18164e)return activateAdditionalPhone(_0x22f61f,_0x3aff16[_0xda3d('0x15')],_0x18164e,_0x3aff16[_0xda3d('0x29')],_0x3aff16['waitTime'])[_0xda3d('0x1c')](function(_0x36a525){_0xf38e55(_0x36a525);});else{return db[_0xda3d('0x18')][_0xda3d('0x19')]({'raw':!![],'where':{'CmHopperId':_0x22f61f['id']},'order':[[_0xda3d('0x1a'),'ASC']]})[_0xda3d('0x1c')](function(_0x1d9c6c){if(_0x1d9c6c)return activateAdditionalPhone(_0x22f61f,_0x3aff16[_0xda3d('0x15')],_0x1d9c6c,_0x3aff16[_0xda3d('0x29')],_0x3aff16[_0xda3d('0x2a')])[_0xda3d('0x1c')](function(_0x23a75b){_0xf38e55(_0x23a75b);});else{_0xf38e55({'id':_0x22f61f['id'],'phone':''});}})['catch'](function(_0x1344f2){logger[_0xda3d('0x10')](_0xda3d('0x13'),_0x1344f2[_0xda3d('0x12')]);_0x18272d(_0x3704d4[_0xda3d('0x10')](0x1f4,_0x1344f2[_0xda3d('0x12')]));});}})[_0xda3d('0x25')](function(_0x1feef9){logger[_0xda3d('0x10')]('VerifyAdditionalPhones',_0x1feef9[_0xda3d('0x12')]);_0x18272d(_0x3704d4['error'](0x1f4,_0x1feef9[_0xda3d('0x12')]));});}else _0xf38e55(0x1);});});};function activateAdditionalPhone(_0x23d4dd,_0x55f96c,_0x230208,_0x36e340,_0x3ebe2d){return new Promise(function(_0x5599e1,_0x32ac59){var _0x292249;if(_[_0xda3d('0x2b')](_0x230208[_0xda3d('0x2c')])){_0x230208[_0xda3d('0x2c')]=moment();}if(moment()>moment(_0x230208[_0xda3d('0x2c')])){_0x292249=moment()[_0xda3d('0x2d')](_0x3ebe2d||0x3,_0xda3d('0x2e'));}else{if(_0x230208[_0xda3d('0x1a')]==0x0){_0x292249=moment(_0x230208[_0xda3d('0x2c')]);}else{_0x292249=moment()['add'](_0x3ebe2d||0x3,'minutes');}}if(_[_0xda3d('0x2b')](_0x292249)){_0x292249=moment()[_0xda3d('0x2d')](_0x3ebe2d||0x3,_0xda3d('0x2e'));}var _0x2ad7e7={'phone':_0x23d4dd[_0xda3d('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x23d4dd[_0xda3d('0x1a')])?0x0:_0x23d4dd[_0xda3d('0x1a')],'scheduledat':moment()['add'](_0x36e340||0x1,'minutes'),'countbusyretry':_0x55f96c[_0xda3d('0x1d')],'countcongestionretry':_0x55f96c['countcongestionretry'],'countnoanswerretry':_0x55f96c[_0xda3d('0x30')],'countnosuchnumberretry':_0x55f96c[_0xda3d('0x1f')],'countdropretry':_0x55f96c[_0xda3d('0x20')],'countabandonedretry':_0x55f96c[_0xda3d('0x21')],'countmachineretry':_0x55f96c[_0xda3d('0x22')],'countagentrejectretry':_0x55f96c['countagentrejectretry'],'createdAt':_0x55f96c[_0xda3d('0x31')],'updatedAt':_0x55f96c[_0xda3d('0x32')]};var _0x52c7e1={'CmHopperId':_0x23d4dd['id'],'phone':_0x230208[_0xda3d('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x230208[_0xda3d('0x1a')])?0x0:_0x230208[_0xda3d('0x1a')],'scheduledat':_0x292249,'countbusyretry':_0x230208['countbusyretry'],'countcongestionretry':_0x230208[_0xda3d('0x1e')],'countnoanswerretry':_0x230208[_0xda3d('0x30')],'countnosuchnumberretry':_0x230208['countnosuchnumberretry'],'countdropretry':_0x230208[_0xda3d('0x20')],'countabandonedretry':_0x230208[_0xda3d('0x21')],'countmachineretry':_0x230208[_0xda3d('0x22')],'countagentrejectretry':_0x230208[_0xda3d('0x23')],'createdAt':_0x230208[_0xda3d('0x31')],'updatedAt':_0x230208[_0xda3d('0x32')]};return db[_0xda3d('0x33')]['transaction'](function(_0x3f1868){return db[_0xda3d('0x18')][_0xda3d('0x34')](_0x2ad7e7,{'where':{'id':_0x230208['id']}},{'transaction':_0x3f1868})[_0xda3d('0x1c')](function(){return db[_0xda3d('0x14')]['update'](_0x52c7e1,{'where':{'id':_0x23d4dd['id']}},{'transaction':_0x3f1868});});})[_0xda3d('0x1c')](function(_0x46feb8){_0x5599e1({'id':_0x23d4dd['id'],'phone':_0x230208['phone']});})[_0xda3d('0x25')](function(_0x4febcc){logger[_0xda3d('0x10')](_0xda3d('0x35'),_0x4febcc[_0xda3d('0x12')]);_0x32ac59({'error':_0x4febcc[_0xda3d('0x12')]});});});}exports[_0xda3d('0x36')]=function(_0x50ea51){var _0x477d6b=this;return new Promise(function(_0x31fb72,_0x5a5ff1){return db[_0xda3d('0x14')]['update'](_0x50ea51[_0xda3d('0x15')][_0xda3d('0x37')],{'where':{'id':_0x50ea51[_0xda3d('0x15')]['id']}})[_0xda3d('0x1c')](function(_0x14d23a){_0x31fb72(_0x14d23a);})[_0xda3d('0x25')](function(_0x3e1267){logger[_0xda3d('0x10')]('IncrementPreviewCounters',_0x3e1267[_0xda3d('0x12')]);_0x5a5ff1(_0x477d6b[_0xda3d('0x10')](0x1f4,_0x3e1267[_0xda3d('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe140=['Router','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xe140,0xf7));var _0x0e14=function(_0x5d6b8d,_0x59b787){_0x5d6b8d=_0x5d6b8d-0x0;var _0x123b7d=_0xe140[_0x5d6b8d];return _0x123b7d;};'use strict';var multer=require(_0x0e14('0x0'));var util=require(_0x0e14('0x1'));var path=require(_0x0e14('0x2'));var timeout=require(_0x0e14('0x3'));var express=require(_0x0e14('0x4'));var router=express[_0x0e14('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e14('0x6'));var config=require(_0x0e14('0x7'));var controller=require(_0x0e14('0x8'));router['get']('/',auth[_0x0e14('0x9')](),controller[_0x0e14('0xa')]);router[_0x0e14('0xb')](_0x0e14('0xc'),auth[_0x0e14('0x9')](),controller[_0x0e14('0xd')]);router[_0x0e14('0xe')]('/',auth[_0x0e14('0x9')](),controller['create']);router[_0x0e14('0xf')](_0x0e14('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0e14('0xc'),auth[_0x0e14('0x9')](),controller[_0x0e14('0x10')]);module[_0x0e14('0x11')]=router;
\ No newline at end of file
+var _0xada7=['/:id','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index'];(function(_0x5e971c,_0x5004e9){var _0x24e475=function(_0x5c841b){while(--_0x5c841b){_0x5e971c['push'](_0x5e971c['shift']());}};_0x24e475(++_0x5004e9);}(_0xada7,0x120));var _0x7ada=function(_0x27e59e,_0x25a388){_0x27e59e=_0x27e59e-0x0;var _0x1225c7=_0xada7[_0x27e59e];return _0x1225c7;};'use strict';var multer=require(_0x7ada('0x0'));var util=require('util');var path=require(_0x7ada('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ada('0x2'));var router=express[_0x7ada('0x3')]();var fs_extra=require(_0x7ada('0x4'));var auth=require(_0x7ada('0x5'));var interaction=require(_0x7ada('0x6'));var config=require(_0x7ada('0x7'));var controller=require(_0x7ada('0x8'));router[_0x7ada('0x9')]('/',auth[_0x7ada('0xa')](),controller[_0x7ada('0xb')]);router['get'](_0x7ada('0xc'),auth[_0x7ada('0xa')](),controller['show']);router[_0x7ada('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ada('0xe')]);router[_0x7ada('0xf')]('/:id',auth[_0x7ada('0xa')](),controller[_0x7ada('0x10')]);router[_0x7ada('0x11')](_0x7ada('0xc'),auth['isAuthenticated'](),controller[_0x7ada('0x12')]);module[_0x7ada('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e1e=['STRING','contactListQueue','INTEGER','moment','sequelize','exports'];(function(_0x1103fb,_0x3d767e){var _0x42a03f=function(_0x53b927){while(--_0x53b927){_0x1103fb['push'](_0x1103fb['shift']());}};_0x42a03f(++_0x3d767e);}(_0x7e1e,0x183));var _0xe7e1=function(_0x323d9d,_0x4ac6f4){_0x323d9d=_0x323d9d-0x0;var _0x4683a0=_0x7e1e[_0x323d9d];return _0x4683a0;};'use strict';var moment=require(_0xe7e1('0x0'));var Sequelize=require(_0xe7e1('0x1'));module[_0xe7e1('0x2')]={'phone':{'type':Sequelize[_0xe7e1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe7e1('0x4')},'ListId':{'type':Sequelize[_0xe7e1('0x5')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xe7e1('0x5')],'unique':_0xe7e1('0x4')}};
\ No newline at end of file
+var _0x3714=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x59155a,_0x13c84f){var _0x41e78b=function(_0x1f2ea9){while(--_0x1f2ea9){_0x59155a['push'](_0x59155a['shift']());}};_0x41e78b(++_0x13c84f);}(_0x3714,0x95));var _0x4371=function(_0x237747,_0x1de77b){_0x237747=_0x237747-0x0;var _0x168cf2=_0x3714[_0x237747];return _0x168cf2;};'use strict';var moment=require(_0x4371('0x0'));var Sequelize=require(_0x4371('0x1'));module['exports']={'phone':{'type':Sequelize[_0x4371('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4371('0x3')],'unique':_0x4371('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x4371('0x4')},'VoiceQueueId':{'type':Sequelize[_0x4371('0x3')],'unique':_0x4371('0x4')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dc9=['describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','map','CmHopperBlack','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','rawAttributes','find','update','body','params'];(function(_0xdb1afd,_0x18e372){var _0x1f17aa=function(_0x4c8627){while(--_0x4c8627){_0xdb1afd['push'](_0xdb1afd['shift']());}};_0x1f17aa(++_0x18e372);}(_0x3dc9,0x164));var _0x93dc=function(_0x4883a2,_0x387e16){_0x4883a2=_0x4883a2-0x0;var _0x337ba4=_0x3dc9[_0x4883a2];return _0x337ba4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93dc('0x0'));var jsonpatch=require(_0x93dc('0x1'));var rp=require(_0x93dc('0x2'));var moment=require(_0x93dc('0x3'));var BPromise=require(_0x93dc('0x4'));var Mustache=require(_0x93dc('0x5'));var util=require(_0x93dc('0x6'));var path=require(_0x93dc('0x7'));var sox=require(_0x93dc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93dc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x93dc('0xa'));var jsforce=require(_0x93dc('0xb'));var deskjs=require(_0x93dc('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x93dc('0xd'));var Redis=require(_0x93dc('0xe'));var authService=require(_0x93dc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x93dc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93dc('0x11'))('api');var utils=require(_0x93dc('0x12'));var config=require(_0x93dc('0x13'));var licenseUtil=require(_0x93dc('0x14'));var db=require(_0x93dc('0x15'))['db'];function respondWithStatusCode(_0x509ea9,_0x23832a){_0x23832a=_0x23832a||0xcc;return function(_0x2760ef){if(_0x2760ef){return _0x509ea9['sendStatus'](_0x23832a);}return _0x509ea9[_0x93dc('0x16')](_0x23832a)[_0x93dc('0x17')]();};}function respondWithResult(_0x497822,_0x3617aa){_0x3617aa=_0x3617aa||0xc8;return function(_0x556462){if(_0x556462){return _0x497822['status'](_0x3617aa)[_0x93dc('0x18')](_0x556462);}};}function respondWithFilteredResult(_0x2c4785,_0x55343c){return function(_0x3312c1){if(_0x3312c1){var _0x453c12=typeof _0x55343c[_0x93dc('0x19')]===_0x93dc('0x1a')&&typeof _0x55343c[_0x93dc('0x1b')]===_0x93dc('0x1a');var _0x974b39=_0x3312c1[_0x93dc('0x1c')];var _0x1414fc=_0x453c12?0x0:_0x55343c['offset'];var _0x416ad6=_0x453c12?_0x3312c1[_0x93dc('0x1c')]:_0x55343c[_0x93dc('0x19')]+_0x55343c[_0x93dc('0x1b')];var _0xcb8c55;if(_0x416ad6>=_0x974b39){_0x416ad6=_0x974b39;_0xcb8c55=0xc8;}else{_0xcb8c55=0xce;}_0x2c4785['status'](_0xcb8c55);return _0x2c4785[_0x93dc('0x1d')](_0x93dc('0x1e'),_0x1414fc+'-'+_0x416ad6+'/'+_0x974b39)[_0x93dc('0x18')](_0x3312c1);}return null;};}function patchUpdates(_0x347582){return function(_0x342496){try{jsonpatch['apply'](_0x342496,_0x347582,!![]);}catch(_0x189d9f){return BPromise[_0x93dc('0x1f')](_0x189d9f);}return _0x342496[_0x93dc('0x20')]();};}function saveUpdates(_0x196ead,_0x5d0aa1){return function(_0x2c7ae2){if(_0x2c7ae2){return _0x2c7ae2['update'](_0x196ead)[_0x93dc('0x21')](function(_0x1e20a2){return _0x1e20a2;});}return null;};}function removeEntity(_0x2427ab,_0x90bf26){return function(_0x222a81){if(_0x222a81){return _0x222a81[_0x93dc('0x22')]()[_0x93dc('0x21')](function(){_0x2427ab['status'](0xcc)[_0x93dc('0x17')]();});}};}function handleEntityNotFound(_0x32a4bd,_0x214e10){return function(_0x338577){if(!_0x338577){_0x32a4bd[_0x93dc('0x23')](0x194);}return _0x338577;};}function handleError(_0x258070,_0xa82992){_0xa82992=_0xa82992||0x1f4;return function(_0x46dea4){logger[_0x93dc('0x24')](_0x46dea4['stack']);if(_0x46dea4[_0x93dc('0x25')]){delete _0x46dea4['name'];}_0x258070['status'](_0xa82992)[_0x93dc('0x26')](_0x46dea4);};}exports['index']=function(_0x5b7310,_0x3e6197){var _0x320261={},_0x40bc5a={},_0x2dc65b={'count':0x0,'rows':[]};var _0x237bdf=_[_0x93dc('0x27')](db[_0x93dc('0x28')]['rawAttributes'],function(_0x5f15b0){return{'name':_0x5f15b0[_0x93dc('0x29')],'type':_0x5f15b0[_0x93dc('0x2a')][_0x93dc('0x2b')]};});_0x40bc5a[_0x93dc('0x2c')]=_['map'](_0x237bdf,_0x93dc('0x25'));_0x40bc5a[_0x93dc('0x2d')]=_[_0x93dc('0x2e')](_0x5b7310[_0x93dc('0x2d')]);_0x40bc5a['filters']=_[_0x93dc('0x2f')](_0x40bc5a[_0x93dc('0x2c')],_0x40bc5a['query']);_0x320261[_0x93dc('0x30')]=_[_0x93dc('0x2f')](_0x40bc5a[_0x93dc('0x2c')],qs[_0x93dc('0x31')](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x31')]));_0x320261['attributes']=_0x320261[_0x93dc('0x30')][_0x93dc('0x32')]?_0x320261[_0x93dc('0x30')]:_0x40bc5a[_0x93dc('0x2c')];if(!_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x33')](_0x93dc('0x34'))){_0x320261[_0x93dc('0x1b')]=qs[_0x93dc('0x1b')](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x1b')]);_0x320261[_0x93dc('0x19')]=qs['offset'](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x19')]);}_0x320261[_0x93dc('0x35')]=qs[_0x93dc('0x36')](_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x36')]);_0x320261['where']=qs[_0x93dc('0x37')](_['pick'](_0x5b7310[_0x93dc('0x2d')],_0x40bc5a[_0x93dc('0x37')]),_0x237bdf);if(_0x5b7310['query']['filter']){_0x320261[_0x93dc('0x38')]=_[_0x93dc('0x39')](_0x320261[_0x93dc('0x38')],{'$or':_[_0x93dc('0x27')](_0x237bdf,function(_0x766683){if(_0x766683[_0x93dc('0x2a')]!==_0x93dc('0x3a')){var _0x557f6e={};_0x557f6e[_0x766683[_0x93dc('0x25')]]={'$like':'%'+_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x3b')]+'%'};return _0x557f6e;}})});}_0x320261=_[_0x93dc('0x39')]({},_0x320261,_0x5b7310[_0x93dc('0x3c')]);var _0x43510c={'where':_0x320261[_0x93dc('0x38')]};return db[_0x93dc('0x28')][_0x93dc('0x1c')](_0x43510c)['then'](function(_0x5642b6){_0x2dc65b[_0x93dc('0x1c')]=_0x5642b6;if(_0x5b7310[_0x93dc('0x2d')][_0x93dc('0x3d')]){_0x320261[_0x93dc('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x93dc('0x3f')](_0x320261);})[_0x93dc('0x21')](function(_0x118707){_0x2dc65b['rows']=_0x118707;return _0x2dc65b;})[_0x93dc('0x21')](respondWithFilteredResult(_0x3e6197,_0x320261))[_0x93dc('0x40')](handleError(_0x3e6197,null));};exports['show']=function(_0x114676,_0x386e7f){var _0x35da65={'raw':!![],'where':{'id':_0x114676['params']['id']}},_0x17c512={};_0x17c512[_0x93dc('0x2c')]=_[_0x93dc('0x2e')](db[_0x93dc('0x28')][_0x93dc('0x41')]);_0x17c512[_0x93dc('0x2d')]=_[_0x93dc('0x2e')](_0x114676[_0x93dc('0x2d')]);_0x17c512[_0x93dc('0x37')]=_[_0x93dc('0x2f')](_0x17c512['model'],_0x17c512[_0x93dc('0x2d')]);_0x35da65[_0x93dc('0x30')]=_['intersection'](_0x17c512[_0x93dc('0x2c')],qs[_0x93dc('0x31')](_0x114676[_0x93dc('0x2d')][_0x93dc('0x31')]));_0x35da65[_0x93dc('0x30')]=_0x35da65[_0x93dc('0x30')][_0x93dc('0x32')]?_0x35da65[_0x93dc('0x30')]:_0x17c512[_0x93dc('0x2c')];if(_0x114676[_0x93dc('0x2d')]['includeAll']){_0x35da65['include']=[{'all':!![]}];}_0x35da65=_[_0x93dc('0x39')]({},_0x35da65,_0x114676[_0x93dc('0x3c')]);return db[_0x93dc('0x28')][_0x93dc('0x42')](_0x35da65)['then'](handleEntityNotFound(_0x386e7f,null))['then'](respondWithResult(_0x386e7f,null))[_0x93dc('0x40')](handleError(_0x386e7f,null));};exports[_0x93dc('0x43')]=function(_0x2ccaa9,_0x57a423){if(_0x2ccaa9['body']['id']){delete _0x2ccaa9['body']['id'];}return db['CmHopperBlack'][_0x93dc('0x42')]({'where':{'id':_0x2ccaa9['params']['id']}})[_0x93dc('0x21')](handleEntityNotFound(_0x57a423,null))[_0x93dc('0x21')](saveUpdates(_0x2ccaa9[_0x93dc('0x44')],null))[_0x93dc('0x21')](respondWithResult(_0x57a423,null))[_0x93dc('0x40')](handleError(_0x57a423,null));};exports['destroy']=function(_0x34ed83,_0xea1da2){return db[_0x93dc('0x28')]['find']({'where':{'id':_0x34ed83[_0x93dc('0x45')]['id']}})[_0x93dc('0x21')](handleEntityNotFound(_0xea1da2,null))[_0x93dc('0x21')](removeEntity(_0xea1da2,null))[_0x93dc('0x40')](handleError(_0xea1da2,null));};exports[_0x93dc('0x46')]=function(_0x1fe042,_0x2dcac3){return db[_0x93dc('0x28')]['describe']()['then'](respondWithResult(_0x2dcac3,null))[_0x93dc('0x40')](handleError(_0x2dcac3,null));};
\ No newline at end of file
+var _0x6ab9=['CmHopperBlack','rawAttributes','fieldName','key','model','intersection','query','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x13a912,_0x2548e2){var _0x33e3f5=function(_0x268667){while(--_0x268667){_0x13a912['push'](_0x13a912['shift']());}};_0x33e3f5(++_0x2548e2);}(_0x6ab9,0x19a));var _0x96ab=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6ab9[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x96ab('0x0'));var rimraf=require(_0x96ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96ab('0x2'));var rp=require(_0x96ab('0x3'));var moment=require(_0x96ab('0x4'));var BPromise=require(_0x96ab('0x5'));var Mustache=require(_0x96ab('0x6'));var util=require('util');var path=require('path');var sox=require(_0x96ab('0x7'));var csv=require(_0x96ab('0x8'));var ejs=require(_0x96ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96ab('0xa'));var squel=require(_0x96ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x96ab('0xc'));var deskjs=require(_0x96ab('0xd'));var toCsv=require(_0x96ab('0x8'));var querystring=require(_0x96ab('0xe'));var Papa=require(_0x96ab('0xf'));var Redis=require(_0x96ab('0x10'));var authService=require(_0x96ab('0x11'));var qs=require(_0x96ab('0x12'));var as=require(_0x96ab('0x13'));var hardwareService=require(_0x96ab('0x14'));var logger=require(_0x96ab('0x15'))(_0x96ab('0x16'));var utils=require(_0x96ab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x96ab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9204,_0x1131b5){_0x1131b5=_0x1131b5||0xcc;return function(_0x2d3ec3){if(_0x2d3ec3){return _0x2c9204[_0x96ab('0x19')](_0x1131b5);}return _0x2c9204[_0x96ab('0x1a')](_0x1131b5)[_0x96ab('0x1b')]();};}function respondWithResult(_0x3ff9a9,_0x24e2c4){_0x24e2c4=_0x24e2c4||0xc8;return function(_0x126761){if(_0x126761){return _0x3ff9a9[_0x96ab('0x1a')](_0x24e2c4)[_0x96ab('0x1c')](_0x126761);}};}function respondWithFilteredResult(_0x4df67b,_0x4ec844){return function(_0x3b54cc){if(_0x3b54cc){var _0x8d5c87=typeof _0x4ec844[_0x96ab('0x1d')]==='undefined'&&typeof _0x4ec844[_0x96ab('0x1e')]===_0x96ab('0x1f');var _0x56f92b=_0x3b54cc[_0x96ab('0x20')];var _0x4eca78=_0x8d5c87?0x0:_0x4ec844[_0x96ab('0x1d')];var _0x1a502a=_0x8d5c87?_0x3b54cc[_0x96ab('0x20')]:_0x4ec844[_0x96ab('0x1d')]+_0x4ec844[_0x96ab('0x1e')];var _0x1577bb;if(_0x1a502a>=_0x56f92b){_0x1a502a=_0x56f92b;_0x1577bb=0xc8;}else{_0x1577bb=0xce;}_0x4df67b[_0x96ab('0x1a')](_0x1577bb);return _0x4df67b[_0x96ab('0x21')](_0x96ab('0x22'),_0x4eca78+'-'+_0x1a502a+'/'+_0x56f92b)[_0x96ab('0x1c')](_0x3b54cc);}return null;};}function patchUpdates(_0x2aa3c4){return function(_0x4f3bb4){try{jsonpatch['apply'](_0x4f3bb4,_0x2aa3c4,!![]);}catch(_0x347b91){return BPromise[_0x96ab('0x23')](_0x347b91);}return _0x4f3bb4[_0x96ab('0x24')]();};}function saveUpdates(_0x583be2,_0x41936c){return function(_0x5ccaaa){if(_0x5ccaaa){return _0x5ccaaa[_0x96ab('0x25')](_0x583be2)['then'](function(_0x33c140){return _0x33c140;});}return null;};}function removeEntity(_0x90fa22,_0x5a02d0){return function(_0x1deef7){if(_0x1deef7){return _0x1deef7[_0x96ab('0x26')]()[_0x96ab('0x27')](function(){_0x90fa22[_0x96ab('0x1a')](0xcc)[_0x96ab('0x1b')]();});}};}function handleEntityNotFound(_0x27d6d5,_0x9cb9b6){return function(_0x2837a7){if(!_0x2837a7){_0x27d6d5[_0x96ab('0x19')](0x194);}return _0x2837a7;};}function handleError(_0x53869e,_0x215f09){_0x215f09=_0x215f09||0x1f4;return function(_0x524e1c){logger[_0x96ab('0x28')](_0x524e1c[_0x96ab('0x29')]);if(_0x524e1c[_0x96ab('0x2a')]){delete _0x524e1c[_0x96ab('0x2a')];}_0x53869e[_0x96ab('0x1a')](_0x215f09)[_0x96ab('0x2b')](_0x524e1c);};}exports[_0x96ab('0x2c')]=function(_0x435613,_0x4f954c){var _0xefb070={},_0x269c51={},_0xa5c503={'count':0x0,'rows':[]};var _0x5a998e=_[_0x96ab('0x2d')](db[_0x96ab('0x2e')][_0x96ab('0x2f')],function(_0x575664){return{'name':_0x575664[_0x96ab('0x30')],'type':_0x575664['type'][_0x96ab('0x31')]};});_0x269c51[_0x96ab('0x32')]=_['map'](_0x5a998e,_0x96ab('0x2a'));_0x269c51['query']=_['keys'](_0x435613['query']);_0x269c51['filters']=_[_0x96ab('0x33')](_0x269c51['model'],_0x269c51[_0x96ab('0x34')]);_0xefb070[_0x96ab('0x35')]=_[_0x96ab('0x33')](_0x269c51[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x435613['query']['fields']));_0xefb070[_0x96ab('0x35')]=_0xefb070[_0x96ab('0x35')]['length']?_0xefb070[_0x96ab('0x35')]:_0x269c51[_0x96ab('0x32')];if(!_0x435613['query']['hasOwnProperty'](_0x96ab('0x37'))){_0xefb070[_0x96ab('0x1e')]=qs[_0x96ab('0x1e')](_0x435613[_0x96ab('0x34')]['limit']);_0xefb070[_0x96ab('0x1d')]=qs['offset'](_0x435613['query'][_0x96ab('0x1d')]);}_0xefb070['order']=qs[_0x96ab('0x38')](_0x435613[_0x96ab('0x34')][_0x96ab('0x38')]);_0xefb070[_0x96ab('0x39')]=qs['filters'](_[_0x96ab('0x3a')](_0x435613[_0x96ab('0x34')],_0x269c51[_0x96ab('0x3b')]),_0x5a998e);if(_0x435613[_0x96ab('0x34')][_0x96ab('0x3c')]){_0xefb070['where']=_[_0x96ab('0x3d')](_0xefb070['where'],{'$or':_[_0x96ab('0x2d')](_0x5a998e,function(_0x4dae51){if(_0x4dae51[_0x96ab('0x3e')]!==_0x96ab('0x3f')){var _0x3f2305={};_0x3f2305[_0x4dae51[_0x96ab('0x2a')]]={'$like':'%'+_0x435613['query'][_0x96ab('0x3c')]+'%'};return _0x3f2305;}})});}_0xefb070=_[_0x96ab('0x3d')]({},_0xefb070,_0x435613[_0x96ab('0x40')]);var _0x3c7e5d={'where':_0xefb070[_0x96ab('0x39')]};return db[_0x96ab('0x2e')][_0x96ab('0x20')](_0x3c7e5d)[_0x96ab('0x27')](function(_0x14bcbf){_0xa5c503[_0x96ab('0x20')]=_0x14bcbf;if(_0x435613[_0x96ab('0x34')][_0x96ab('0x41')]){_0xefb070['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x96ab('0x42')](_0xefb070);})[_0x96ab('0x27')](function(_0xb541d8){_0xa5c503[_0x96ab('0x43')]=_0xb541d8;return _0xa5c503;})[_0x96ab('0x27')](respondWithFilteredResult(_0x4f954c,_0xefb070))[_0x96ab('0x44')](handleError(_0x4f954c,null));};exports[_0x96ab('0x45')]=function(_0x4b73d7,_0x347957){var _0x53f848={'raw':!![],'where':{'id':_0x4b73d7[_0x96ab('0x46')]['id']}},_0x5e8109={};_0x5e8109[_0x96ab('0x32')]=_['keys'](db[_0x96ab('0x2e')][_0x96ab('0x2f')]);_0x5e8109[_0x96ab('0x34')]=_[_0x96ab('0x47')](_0x4b73d7[_0x96ab('0x34')]);_0x5e8109['filters']=_[_0x96ab('0x33')](_0x5e8109['model'],_0x5e8109['query']);_0x53f848[_0x96ab('0x35')]=_['intersection'](_0x5e8109[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x4b73d7[_0x96ab('0x34')]['fields']));_0x53f848[_0x96ab('0x35')]=_0x53f848[_0x96ab('0x35')][_0x96ab('0x48')]?_0x53f848[_0x96ab('0x35')]:_0x5e8109[_0x96ab('0x32')];if(_0x4b73d7['query'][_0x96ab('0x41')]){_0x53f848['include']=[{'all':!![]}];}_0x53f848=_[_0x96ab('0x3d')]({},_0x53f848,_0x4b73d7['options']);return db[_0x96ab('0x2e')]['find'](_0x53f848)[_0x96ab('0x27')](handleEntityNotFound(_0x347957,null))[_0x96ab('0x27')](respondWithResult(_0x347957,null))[_0x96ab('0x44')](handleError(_0x347957,null));};exports[_0x96ab('0x25')]=function(_0x25d387,_0x42dbd7){if(_0x25d387['body']['id']){delete _0x25d387[_0x96ab('0x49')]['id'];}return db[_0x96ab('0x2e')]['find']({'where':{'id':_0x25d387[_0x96ab('0x46')]['id']}})['then'](handleEntityNotFound(_0x42dbd7,null))[_0x96ab('0x27')](saveUpdates(_0x25d387[_0x96ab('0x49')],null))[_0x96ab('0x27')](respondWithResult(_0x42dbd7,null))['catch'](handleError(_0x42dbd7,null));};exports[_0x96ab('0x26')]=function(_0x2955be,_0x492e4a){return db[_0x96ab('0x2e')][_0x96ab('0x4a')]({'where':{'id':_0x2955be[_0x96ab('0x46')]['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x492e4a,null))[_0x96ab('0x27')](removeEntity(_0x492e4a,null))[_0x96ab('0x44')](handleError(_0x492e4a,null));};exports[_0x96ab('0x4b')]=function(_0x5f2521,_0x3fe014){return db[_0x96ab('0x2e')]['describe']()[_0x96ab('0x27')](respondWithResult(_0x3fe014,null))[_0x96ab('0x44')](handleError(_0x3fe014,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x782a=['CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports'];(function(_0x581a8f,_0x3d274f){var _0x3729fa=function(_0x3842a7){while(--_0x3842a7){_0x581a8f['push'](_0x581a8f['shift']());}};_0x3729fa(++_0x3d274f);}(_0x782a,0x1a4));var _0xa782=function(_0x40d20e,_0x5518cd){_0x40d20e=_0x40d20e-0x0;var _0x8812de=_0x782a[_0x40d20e];return _0x8812de;};'use strict';var _=require(_0xa782('0x0'));var util=require('util');var logger=require(_0xa782('0x1'))(_0xa782('0x2'));var moment=require('moment');var BPromise=require(_0xa782('0x3'));var rp=require(_0xa782('0x4'));var fs=require('fs');var path=require(_0xa782('0x5'));var rimraf=require(_0xa782('0x6'));var config=require('../../config/environment');var attributes=require(_0xa782('0x7'));module[_0xa782('0x8')]=function(_0x9ba4e6,_0x228df2){return _0x9ba4e6['define'](_0xa782('0x9'),attributes,{'tableName':_0xa782('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf44=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcf44,0x153));var _0x4cf4=function(_0x1ee350,_0x3e86b8){_0x1ee350=_0x1ee350-0x0;var _0x36a436=_0xcf44[_0x1ee350];return _0x36a436;};'use strict';var _=require(_0x4cf4('0x0'));var util=require(_0x4cf4('0x1'));var logger=require(_0x4cf4('0x2'))(_0x4cf4('0x3'));var moment=require(_0x4cf4('0x4'));var BPromise=require(_0x4cf4('0x5'));var rp=require(_0x4cf4('0x6'));var fs=require('fs');var path=require(_0x4cf4('0x7'));var rimraf=require(_0x4cf4('0x8'));var config=require(_0x4cf4('0x9'));var attributes=require('./cmHopperBlack.attributes');module[_0x4cf4('0xa')]=function(_0x5b65f8,_0x4290b4){return _0x5b65f8[_0x4cf4('0xb')](_0x4cf4('0xc'),attributes,{'tableName':_0x4cf4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed2f=['result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','map','include','model','attributes','info','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message'];(function(_0x3429b9,_0x2624f2){var _0x31e4f6=function(_0x1b2741){while(--_0x1b2741){_0x3429b9['push'](_0x3429b9['shift']());}};_0x31e4f6(++_0x2624f2);}(_0xed2f,0x14b));var _0xfed2=function(_0x50c2a9,_0x49ed47){_0x50c2a9=_0x50c2a9-0x0;var _0x205bd7=_0xed2f[_0x50c2a9];return _0x205bd7;};'use strict';var _=require(_0xfed2('0x0'));var util=require(_0xfed2('0x1'));var moment=require(_0xfed2('0x2'));var BPromise=require(_0xfed2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfed2('0x4'));var db=require(_0xfed2('0x5'))['db'];var utils=require(_0xfed2('0x6'));var logger=require(_0xfed2('0x7'))(_0xfed2('0x8'));var config=require(_0xfed2('0x9'));var jayson=require(_0xfed2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7a12b2,_0x1e1b9c,_0x427930){return new BPromise(function(_0x276d32,_0x41250e){return client['request'](_0x7a12b2,_0x427930)[_0xfed2('0xb')](function(_0x57807a){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x1e1b9c,'request\x20sent');logger[_0xfed2('0xc')](_0xfed2('0xd'),_0x1e1b9c,_0xfed2('0xe'),JSON[_0xfed2('0xf')](_0x57807a));if(_0x57807a[_0xfed2('0x10')]){if(_0x57807a['error'][_0xfed2('0x11')]===0x1f4){logger[_0xfed2('0x10')](_0xfed2('0x12'),_0x1e1b9c,_0x57807a['error'][_0xfed2('0x13')]);return _0x41250e(_0x57807a[_0xfed2('0x10')][_0xfed2('0x13')]);}logger[_0xfed2('0x10')](_0xfed2('0x12'),_0x1e1b9c,_0x57807a[_0xfed2('0x10')][_0xfed2('0x13')]);return _0x276d32(_0x57807a[_0xfed2('0x10')][_0xfed2('0x13')]);}else{logger['info'](_0xfed2('0x12'),_0x1e1b9c,_0xfed2('0xe'));_0x276d32(_0x57807a[_0xfed2('0x14')][_0xfed2('0x13')]);}})[_0xfed2('0x15')](function(_0x327018){logger['error'](_0xfed2('0x12'),_0x1e1b9c,_0x327018);_0x41250e(_0x327018);});});}exports[_0xfed2('0x16')]=function(_0x5616fd){var _0x45dfbd=this;return new Promise(function(_0x2156c4,_0x3eebbb){return db[_0xfed2('0x17')][_0xfed2('0x18')]({'raw':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1a')]===undefined?!![]:![]:!![],'where':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1b')]||null:null,'attributes':_0x5616fd[_0xfed2('0x19')]?_0x5616fd['options']['attributes']||null:null,'limit':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1c')]||null:null,'include':_0x5616fd[_0xfed2('0x19')]?_0x5616fd[_0xfed2('0x19')]['include']?_[_0xfed2('0x1d')](_0x5616fd[_0xfed2('0x19')][_0xfed2('0x1e')],function(_0x27a655){return{'model':db[_0x27a655[_0xfed2('0x1f')]],'as':_0x27a655['as'],'attributes':_0x27a655[_0xfed2('0x20')],'include':_0x27a655[_0xfed2('0x1e')]?_['map'](_0x27a655['include'],function(_0x1cf1b6){return{'model':db[_0x1cf1b6[_0xfed2('0x1f')]],'as':_0x1cf1b6['as'],'attributes':_0x1cf1b6[_0xfed2('0x20')],'include':_0x1cf1b6[_0xfed2('0x1e')]?_[_0xfed2('0x1d')](_0x1cf1b6['include'],function(_0xb29b9f){return{'model':db[_0xb29b9f[_0xfed2('0x1f')]],'as':_0xb29b9f['as'],'attributes':_0xb29b9f[_0xfed2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfed2('0xb')](function(_0x5741f4){logger[_0xfed2('0x21')](_0xfed2('0x16'),_0x5616fd);logger['debug']('GetCmHopperBlack',_0x5616fd,JSON[_0xfed2('0xf')](_0x5741f4));_0x2156c4(_0x5741f4);})[_0xfed2('0x15')](function(_0x6e1199){logger[_0xfed2('0x10')](_0xfed2('0x16'),_0x6e1199[_0xfed2('0x13')],_0x5616fd);_0x3eebbb(_0x45dfbd['error'](0x1f4,_0x6e1199[_0xfed2('0x13')]));});});};exports[_0xfed2('0x22')]=function(_0x28d530){var _0x4e939b=this;return new Promise(function(_0x4418dd,_0x2637b2){return db[_0xfed2('0x17')][_0xfed2('0x23')](_0x28d530[_0xfed2('0x24')],{'raw':_0x28d530[_0xfed2('0x19')]?_0x28d530['options'][_0xfed2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28d530['options']?_0x28d530[_0xfed2('0x19')]['where']||null:null,'attributes':_0x28d530['options']?_0x28d530[_0xfed2('0x19')][_0xfed2('0x20')]||null:null,'limit':_0x28d530[_0xfed2('0x19')]?_0x28d530['options'][_0xfed2('0x1c')]||null:null})[_0xfed2('0xb')](function(_0x4d806f){logger[_0xfed2('0x21')](_0xfed2('0x22'),_0x28d530);logger['debug'](_0xfed2('0x22'),_0x28d530,JSON[_0xfed2('0xf')](_0x4d806f));_0x4418dd(_0x4d806f);})[_0xfed2('0x15')](function(_0x2e2509){logger[_0xfed2('0x10')](_0xfed2('0x22'),_0x2e2509['message'],_0x28d530);_0x2637b2(_0x4e939b[_0xfed2('0x10')](0x1f4,_0x2e2509[_0xfed2('0x13')]));});});};exports[_0xfed2('0x25')]=function(_0x5157b9){var _0x41c809=this;return new Promise(function(_0x2a9e59,_0x16de10){return db[_0xfed2('0x17')][_0xfed2('0x26')]({'where':_0x5157b9[_0xfed2('0x19')]?_0x5157b9[_0xfed2('0x19')]['where']||null:null})['then'](function(_0x370bab){logger[_0xfed2('0x21')](_0xfed2('0x25'),_0x5157b9);logger[_0xfed2('0xc')](_0xfed2('0x25'),_0x5157b9,JSON['stringify'](_0x370bab));_0x2a9e59(_0x370bab);})['catch'](function(_0x561dfa){logger[_0xfed2('0x10')](_0xfed2('0x25'),_0x561dfa[_0xfed2('0x13')],_0x5157b9);_0x16de10(_0x41c809['error'](0x1f4,_0x561dfa['message']));});});};
\ No newline at end of file
+var _0x7eca=['debug','GetCmHopperBlack','catch','update','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model'];(function(_0x1dd2d4,_0x1d9a26){var _0x4944b9=function(_0x1fef53){while(--_0x1fef53){_0x1dd2d4['push'](_0x1dd2d4['shift']());}};_0x4944b9(++_0x1d9a26);}(_0x7eca,0xa3));var _0xa7ec=function(_0x560d1c,_0x51b301){_0x560d1c=_0x560d1c-0x0;var _0x5e9684=_0x7eca[_0x560d1c];return _0x5e9684;};'use strict';var _=require('lodash');var util=require(_0xa7ec('0x0'));var moment=require(_0xa7ec('0x1'));var BPromise=require(_0xa7ec('0x2'));var rs=require(_0xa7ec('0x3'));var fs=require('fs');var Redis=require(_0xa7ec('0x4'));var db=require(_0xa7ec('0x5'))['db'];var utils=require(_0xa7ec('0x6'));var logger=require(_0xa7ec('0x7'))(_0xa7ec('0x8'));var config=require('../../config/environment');var jayson=require(_0xa7ec('0x9'));var client=jayson[_0xa7ec('0xa')][_0xa7ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c3a52,_0x419a86,_0x4532b0){return new BPromise(function(_0x327f28,_0x990be5){return client[_0xa7ec('0xc')](_0x4c3a52,_0x4532b0)[_0xa7ec('0xd')](function(_0x231ceb){logger[_0xa7ec('0xe')](_0xa7ec('0xf'),_0x419a86,_0xa7ec('0x10'));logger['debug'](_0xa7ec('0x11'),_0x419a86,'request\x20sent',JSON[_0xa7ec('0x12')](_0x231ceb));if(_0x231ceb[_0xa7ec('0x13')]){if(_0x231ceb[_0xa7ec('0x13')][_0xa7ec('0x14')]===0x1f4){logger['error'](_0xa7ec('0xf'),_0x419a86,_0x231ceb[_0xa7ec('0x13')]['message']);return _0x990be5(_0x231ceb[_0xa7ec('0x13')][_0xa7ec('0x15')]);}logger[_0xa7ec('0x13')](_0xa7ec('0xf'),_0x419a86,_0x231ceb[_0xa7ec('0x13')]['message']);return _0x327f28(_0x231ceb[_0xa7ec('0x13')]['message']);}else{logger['info'](_0xa7ec('0xf'),_0x419a86,'request\x20sent');_0x327f28(_0x231ceb[_0xa7ec('0x16')][_0xa7ec('0x15')]);}})['catch'](function(_0x5d73f7){logger[_0xa7ec('0x13')](_0xa7ec('0xf'),_0x419a86,_0x5d73f7);_0x990be5(_0x5d73f7);});});}exports['GetCmHopperBlack']=function(_0xe6ae79){var _0x2ebc2e=this;return new Promise(function(_0x4207f9,_0x567f77){return db[_0xa7ec('0x17')][_0xa7ec('0x18')]({'raw':_0xe6ae79[_0xa7ec('0x19')]?_0xe6ae79[_0xa7ec('0x19')][_0xa7ec('0x1a')]===undefined?!![]:![]:!![],'where':_0xe6ae79[_0xa7ec('0x19')]?_0xe6ae79['options'][_0xa7ec('0x1b')]||null:null,'attributes':_0xe6ae79[_0xa7ec('0x19')]?_0xe6ae79[_0xa7ec('0x19')][_0xa7ec('0x1c')]||null:null,'limit':_0xe6ae79['options']?_0xe6ae79[_0xa7ec('0x19')]['limit']||null:null,'include':_0xe6ae79['options']?_0xe6ae79[_0xa7ec('0x19')][_0xa7ec('0x1d')]?_[_0xa7ec('0x1e')](_0xe6ae79['options'][_0xa7ec('0x1d')],function(_0x38c4f3){return{'model':db[_0x38c4f3['model']],'as':_0x38c4f3['as'],'attributes':_0x38c4f3[_0xa7ec('0x1c')],'include':_0x38c4f3['include']?_['map'](_0x38c4f3[_0xa7ec('0x1d')],function(_0x4821ea){return{'model':db[_0x4821ea[_0xa7ec('0x1f')]],'as':_0x4821ea['as'],'attributes':_0x4821ea[_0xa7ec('0x1c')],'include':_0x4821ea[_0xa7ec('0x1d')]?_[_0xa7ec('0x1e')](_0x4821ea[_0xa7ec('0x1d')],function(_0x2db10c){return{'model':db[_0x2db10c[_0xa7ec('0x1f')]],'as':_0x2db10c['as'],'attributes':_0x2db10c['attributes']};}):[]};}):[]};}):[]:[]})[_0xa7ec('0xd')](function(_0x1fd90c){logger['info']('GetCmHopperBlack',_0xe6ae79);logger[_0xa7ec('0x20')](_0xa7ec('0x21'),_0xe6ae79,JSON[_0xa7ec('0x12')](_0x1fd90c));_0x4207f9(_0x1fd90c);})[_0xa7ec('0x22')](function(_0x537b17){logger[_0xa7ec('0x13')](_0xa7ec('0x21'),_0x537b17[_0xa7ec('0x15')],_0xe6ae79);_0x567f77(_0x2ebc2e['error'](0x1f4,_0x537b17[_0xa7ec('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x5624e1){var _0x510753=this;return new Promise(function(_0x20785e,_0x3fc586){return db['CmHopperBlack'][_0xa7ec('0x23')](_0x5624e1['body'],{'raw':_0x5624e1[_0xa7ec('0x19')]?_0x5624e1[_0xa7ec('0x19')][_0xa7ec('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5624e1[_0xa7ec('0x19')]?_0x5624e1[_0xa7ec('0x19')]['where']||null:null,'attributes':_0x5624e1[_0xa7ec('0x19')]?_0x5624e1[_0xa7ec('0x19')][_0xa7ec('0x1c')]||null:null,'limit':_0x5624e1[_0xa7ec('0x19')]?_0x5624e1[_0xa7ec('0x19')][_0xa7ec('0x24')]||null:null})['then'](function(_0x1790dd){logger['info'](_0xa7ec('0x25'),_0x5624e1);logger['debug'](_0xa7ec('0x25'),_0x5624e1,JSON[_0xa7ec('0x12')](_0x1790dd));_0x20785e(_0x1790dd);})[_0xa7ec('0x22')](function(_0x236633){logger['error']('UpdateCmHopperBlack',_0x236633[_0xa7ec('0x15')],_0x5624e1);_0x3fc586(_0x510753[_0xa7ec('0x13')](0x1f4,_0x236633[_0xa7ec('0x15')]));});});};exports[_0xa7ec('0x26')]=function(_0x5dff9f){var _0x12609b=this;return new Promise(function(_0x2eeae9,_0x143385){return db[_0xa7ec('0x17')]['destroy']({'where':_0x5dff9f[_0xa7ec('0x19')]?_0x5dff9f[_0xa7ec('0x19')][_0xa7ec('0x1b')]||null:null})[_0xa7ec('0xd')](function(_0x45d829){logger[_0xa7ec('0xe')](_0xa7ec('0x26'),_0x5dff9f);logger['debug'](_0xa7ec('0x26'),_0x5dff9f,JSON[_0xa7ec('0x12')](_0x45d829));_0x2eeae9(_0x45d829);})[_0xa7ec('0x22')](function(_0x2d42bd){logger['error']('DestroyCmHopperBlack',_0x2d42bd[_0xa7ec('0x15')],_0x5dff9f);_0x143385(_0x12609b[_0xa7ec('0x13')](0x1f4,_0x2d42bd[_0xa7ec('0x15')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2c7=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','update','delete'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xc2c7,0x134));var _0x7c2c=function(_0x34d9a2,_0x167cdb){_0x34d9a2=_0x34d9a2-0x0;var _0x5727ad=_0xc2c7[_0x34d9a2];return _0x5727ad;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['put'](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);module[_0x7c2c('0x11')]=router;
\ No newline at end of file
+var _0x3c6c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','put','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x38e331,_0x4eb7ea){var _0x21e34f=function(_0x5272ff){while(--_0x5272ff){_0x38e331['push'](_0x38e331['shift']());}};_0x21e34f(++_0x4eb7ea);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x2691e8,_0x397a46){_0x2691e8=_0x2691e8-0x0;var _0x55794d=_0x3c6c[_0x2691e8];return _0x55794d;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var fs_extra=require(_0xc3c6('0x5'));var auth=require(_0xc3c6('0x6'));var interaction=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var controller=require('./cmHopperBlack.controller');router[_0xc3c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller['show']);router[_0xc3c6('0xd')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xe')]);router['delete'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xf')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56a2=['diff','BOOLEAN','sequelize','moment','INTEGER','DATE','STRING','setDataValue','followuptime'];(function(_0x267cf4,_0xcbcf72){var _0x4824cf=function(_0x3e53d6){while(--_0x3e53d6){_0x267cf4['push'](_0x267cf4['shift']());}};_0x4824cf(++_0xcbcf72);}(_0x56a2,0x158));var _0x256a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x56a2[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0x256a('0x0'));var moment=require(_0x256a('0x1'));module['exports']={'state':{'type':Sequelize[_0x256a('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x256a('0x3')]},'countbusyretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x256a('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x256a('0x4')]},'originatecalleridname':{'type':Sequelize[_0x256a('0x4')]},'calleridnum':{'type':Sequelize[_0x256a('0x4')]},'calleridname':{'type':Sequelize[_0x256a('0x4')]},'starttime':{'type':Sequelize[_0x256a('0x3')]},'responsetime':{'type':Sequelize[_0x256a('0x3')]},'answertime':{'type':Sequelize[_0x256a('0x3')]},'droptime':{'type':Sequelize[_0x256a('0x3')]},'endtime':{'type':Sequelize[_0x256a('0x3')]},'ringtime':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x256a('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x256a('0x4')]},'membername':{'type':Sequelize[_0x256a('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x256a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x256a('0x4')]},'dispositionat':{'type':Sequelize[_0x256a('0x3')],'set':function(_0x168bd1){var _0x4baab3=this['getDataValue']('endtime');if(_0x4baab3&&_0x168bd1){this[_0x256a('0x5')](_0x256a('0x6'),moment(_0x168bd1)[_0x256a('0x7')](moment(_0x4baab3),'seconds'));}}},'amd':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x256a('0x3')]},'callback':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x256a('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x256a('0x3')]},'deleted':{'type':Sequelize[_0x256a('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x256a('0x3')]},'recallme':{'type':Sequelize[_0x256a('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x256a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa4e4=['diff','seconds','BOOLEAN','sequelize','moment','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue'];(function(_0x1a344b,_0x2ef37b){var _0xc847e2=function(_0x390065){while(--_0x390065){_0x1a344b['push'](_0x1a344b['shift']());}};_0xc847e2(++_0x2ef37b);}(_0xa4e4,0xa8));var _0x4a4e=function(_0xfacee2,_0x29c3b0){_0xfacee2=_0xfacee2-0x0;var _0x4cc9ea=_0xa4e4[_0xfacee2];return _0x4cc9ea;};'use strict';var Sequelize=require(_0x4a4e('0x0'));var moment=require(_0x4a4e('0x1'));module['exports']={'state':{'type':Sequelize[_0x4a4e('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4a4e('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4a4e('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x4a4e('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4a4e('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4a4e('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4a4e('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4a4e('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4a4e('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x4a4e('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4a4e('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4a4e('0x4')]},'dispositionat':{'type':Sequelize[_0x4a4e('0x3')],'set':function(_0x472efc){var _0x26b3b5=this[_0x4a4e('0x5')](_0x4a4e('0x6'));if(_0x26b3b5&&_0x472efc){this[_0x4a4e('0x7')]('followuptime',moment(_0x472efc)[_0x4a4e('0x8')](moment(_0x26b3b5),_0x4a4e('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x4a4e('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x4a4e('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x4a4e('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4a4e('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4a4e('0x3')]},'deleted':{'type':Sequelize[_0x4a4e('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4a4e('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4a4e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x480326,_0x3f7891){var _0x288327=function(_0x3ae295){while(--_0x3ae295){_0x480326['push'](_0x480326['shift']());}};_0x288327(++_0x3f7891);}(_0x4c60,0xc1));var _0x04c6=function(_0x5b2e19,_0x46636e){_0x5b2e19=_0x5b2e19-0x0;var _0x4c36c1=_0x4c60[_0x5b2e19];return _0x4c36c1;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['CmHopperFinal'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['CmHopperFinal'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,null));};
\ No newline at end of file
+var _0xeff8=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','noAnswerContacts','`state`\x20=\x2011\x20,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','toString','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne'];(function(_0x430526,_0x5309c3){var _0x399ce1=function(_0xbdc0c3){while(--_0xbdc0c3){_0x430526['push'](_0x430526['shift']());}};_0x399ce1(++_0x5309c3);}(_0xeff8,0x186));var _0x8eff=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xeff8[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['CmHopperFinal'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['CmHopperFinal']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')]()[_0x8eff('0x26')](respondWithResult(_0x1b5fda,null))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x3287d6,_0x4c7013){if(_0x3287d6[_0x8eff('0x4a')]['uniqueid']){delete _0x3287d6[_0x8eff('0x4a')][_0x8eff('0x4b')];}return db[_0x8eff('0x2d')][_0x8eff('0x4c')]({'where':{'uniqueid':_0x3287d6[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x4c7013,null))[_0x8eff('0x26')](saveUpdates(_0x3287d6[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x4c7013,null))[_0x8eff('0x44')](handleError(_0x4c7013,null));};exports[_0x8eff('0x4d')]=function(_0x452f7a,_0x47b28d,_0x13ae7c){return db[_0x8eff('0x2d')][_0x8eff('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x452f7a[_0x8eff('0x46')]['id']},'attributes':[[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x51')))),'noAnswerContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db['sequelize'][_0x8eff('0x50')](_0x8eff('0x52')))),_0x8eff('0x53')],[db[_0x8eff('0x4e')]['fn']('COUNT',db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x54')))),_0x8eff('0x55')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x56')))),_0x8eff('0x57')],[db[_0x8eff('0x4e')]['fn']('COUNT',db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x8eff('0x58')],[db['sequelize']['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x59')))),_0x8eff('0x5a')],[db[_0x8eff('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eff('0x4e')]['literal'](_0x8eff('0x5b')))),_0x8eff('0x5c')]]})[_0x8eff('0x26')](handleEntityNotFound(_0x47b28d,null))[_0x8eff('0x26')](respondWithResult(_0x47b28d,null))[_0x8eff('0x44')](handleError(_0x47b28d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x4064bd,_0x36afc3,_0x1813df){return db[_0x8eff('0x2d')][_0x8eff('0x42')]({'raw':![],'where':{'CampaignId':_0x4064bd[_0x8eff('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0x8eff('0x5d')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x51')))),_0x8eff('0x5e')],[db['sequelize']['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0x8eff('0x50')](_0x8eff('0x52')))),'busyContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eff('0x55')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x5f')))),_0x8eff('0x58')],[db[_0x8eff('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eff('0x4e')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x5b')))),_0x8eff('0x5c')]]})[_0x8eff('0x26')](handleEntityNotFound(_0x36afc3,null))['then'](respondWithResult(_0x36afc3,null))[_0x8eff('0x44')](handleError(_0x36afc3,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x42efc6,_0x35a221,_0x12ebd1){return db[_0x8eff('0x60')][_0x8eff('0x4c')]({'where':{'id':_0x42efc6[_0x8eff('0x46')]['id']}})['then'](handleEntityNotFound(_0x35a221,null))[_0x8eff('0x26')](function(_0x545fcf){var _0x1d8d8f;if(_0x545fcf){_0x1d8d8f=squel[_0x8eff('0x61')]()[_0x8eff('0x62')](_0x8eff('0x63'))[_0x8eff('0x64')]([_0x8eff('0x65'),_0x8eff('0x66'),_0x8eff('0x67'),_0x8eff('0x68'),'VoiceQueueId',_0x8eff('0x69'),_0x8eff('0x6a')],squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')](_0x8eff('0x6d'),_0x8eff('0x65'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x66'))[_0x8eff('0x6c')]('ANY_VALUE(ContactId)','ContactId')['field']('ANY_VALUE(ListId)',_0x8eff('0x68'))[_0x8eff('0x6c')](_0x8eff('0x6f'),_0x8eff('0x70'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x69'))['field'](_0x8eff('0x6e'),_0x8eff('0x6a'))[_0x8eff('0x71')](_0x8eff('0x72'))['where'](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id']['toString']())[_0x8eff('0x3b')](_0x8eff('0x74'),_0x42efc6[_0x8eff('0x4a')]['state']['toString']())['where'](_0x8eff('0x75'))[_0x8eff('0x3b')](_0x8eff('0x76'),squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')](_0x8eff('0x65'))[_0x8eff('0x71')](_0x8eff('0x63'))[_0x8eff('0x3b')](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id']['toString']()))[_0x8eff('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')]('calleridnum')[_0x8eff('0x71')]('cm_hopper_final')[_0x8eff('0x3b')](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id'][_0x8eff('0x77')]())[_0x8eff('0x3b')]('state\x20=\x204'))[_0x8eff('0x78')](_0x8eff('0x67')))[_0x8eff('0x77')]();return db[_0x8eff('0x4e')][_0x8eff('0x33')](_0x1d8d8f);}return[];})[_0x8eff('0x26')](respondWithResult(_0x35a221,null))[_0x8eff('0x44')](handleError(_0x35a221,null));};exports[_0x8eff('0x79')]=function(_0x23a771,_0x452b90,_0x43bbce){return db['Campaign'][_0x8eff('0x4c')]({'where':{'id':_0x23a771[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452b90,null))[_0x8eff('0x26')](function(_0x17f63b){var _0x582478;if(_0x17f63b){_0x582478=squel[_0x8eff('0x61')]()[_0x8eff('0x62')]('cm_hopper')['fromQuery']([_0x8eff('0x65'),_0x8eff('0x66'),_0x8eff('0x67'),_0x8eff('0x68'),_0x8eff('0x7a'),_0x8eff('0x69'),'updatedAt'],squel[_0x8eff('0x6b')]()['field'](_0x8eff('0x6d'),_0x8eff('0x65'))['field'](_0x8eff('0x6e'),'scheduledAt')['field'](_0x8eff('0x7b'),'ContactId')[_0x8eff('0x6c')](_0x8eff('0x7c'),'ListId')[_0x8eff('0x6c')](_0x8eff('0x7d'),'CampaignId')[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x69'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x6a'))[_0x8eff('0x71')](_0x8eff('0x72'))[_0x8eff('0x3b')]('CampaignId\x20=\x20?',_0x23a771['params']['id']['toString']())[_0x8eff('0x3b')](_0x8eff('0x74'),_0x23a771[_0x8eff('0x4a')]['state'][_0x8eff('0x77')]())[_0x8eff('0x3b')](_0x8eff('0x75'))[_0x8eff('0x3b')](_0x8eff('0x76'),squel[_0x8eff('0x6b')]()['field'](_0x8eff('0x65'))['from'](_0x8eff('0x63'))[_0x8eff('0x3b')](_0x8eff('0x7e'),_0x23a771[_0x8eff('0x46')]['id'][_0x8eff('0x77')]()))[_0x8eff('0x3b')](_0x8eff('0x76'),squel['select']()[_0x8eff('0x6c')](_0x8eff('0x7f'))[_0x8eff('0x71')](_0x8eff('0x72'))[_0x8eff('0x3b')]('CampaignId\x20=\x20?',_0x23a771[_0x8eff('0x46')]['id'][_0x8eff('0x77')]())[_0x8eff('0x3b')]('state\x20=\x204'))['group'](_0x8eff('0x67')))[_0x8eff('0x77')]();return db[_0x8eff('0x4e')]['query'](_0x582478);}return[];})[_0x8eff('0x26')](respondWithResult(_0x452b90,null))['catch'](handleError(_0x452b90,null));};exports['checkContactHopper']=function(_0x10b9ac,_0x6bc93b,_0x10ade6){return db[_0x8eff('0x80')][_0x8eff('0x81')]({'where':{'VoiceQueueId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x70')],'CampaignId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x7a')],'ContactId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x67')]}})[_0x8eff('0x26')](handleEntityNotFound(_0x6bc93b,null))['then'](function(_0x34a0f7){if(_0x34a0f7){return _0x34a0f7;}return null;})[_0x8eff('0x26')](respondWithResult(_0x6bc93b,null))[_0x8eff('0x44')](handleError(_0x6bc93b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65d7=['path','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x166f63,_0x47ed87){var _0x51862b=function(_0x378ec8){while(--_0x378ec8){_0x166f63['push'](_0x166f63['shift']());}};_0x51862b(++_0x47ed87);}(_0x65d7,0x70));var _0x765d=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x65d7[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x765d('0x0'));var util=require(_0x765d('0x1'));var logger=require('../../config/logger')(_0x765d('0x2'));var moment=require(_0x765d('0x3'));var BPromise=require('bluebird');var rp=require(_0x765d('0x4'));var fs=require('fs');var path=require(_0x765d('0x5'));var rimraf=require('rimraf');var config=require(_0x765d('0x6'));var attributes=require(_0x765d('0x7'));module['exports']=function(_0x3a465e,_0x3ee63d){return _0x3a465e[_0x765d('0x8')](_0x765d('0x9'),attributes,{'tableName':_0x765d('0xa'),'paranoid':![],'indexes':[{'name':_0x765d('0xb'),'fields':[_0x765d('0xb')]},{'name':_0x765d('0xc'),'fields':[_0x765d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3162=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x3162,0xc1));var _0x2316=function(_0x4e6cbb,_0x3450f0){_0x4e6cbb=_0x4e6cbb-0x0;var _0x15ced4=_0x3162[_0x4e6cbb];return _0x15ced4;};'use strict';var _=require(_0x2316('0x0'));var util=require(_0x2316('0x1'));var logger=require(_0x2316('0x2'))(_0x2316('0x3'));var moment=require(_0x2316('0x4'));var BPromise=require(_0x2316('0x5'));var rp=require(_0x2316('0x6'));var fs=require('fs');var path=require(_0x2316('0x7'));var rimraf=require(_0x2316('0x8'));var config=require(_0x2316('0x9'));var attributes=require(_0x2316('0xa'));module[_0x2316('0xb')]=function(_0x3ad36c,_0x43013d){return _0x3ad36c[_0x2316('0xc')](_0x2316('0xd'),attributes,{'tableName':_0x2316('0xe'),'paranoid':![],'indexes':[{'name':_0x2316('0xf'),'fields':['calleridnum']},{'name':_0x2316('0x10'),'fields':[_0x2316('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x59df8b,_0xa63331){var _0x18f62c=function(_0x58986f){while(--_0x58986f){_0x59df8b['push'](_0x59df8b['shift']());}};_0x18f62c(++_0xa63331);}(_0xb10b,0x12a));var _0xbb10=function(_0x382500,_0x43e04e){_0x382500=_0x382500-0x0;var _0x4aa842=_0xb10b[_0x382500];return _0x4aa842;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x223c22,_0x2692e3){var _0x2c59fa=function(_0x3d1eda){while(--_0x3d1eda){_0x223c22['push'](_0x223c22['shift']());}};_0x2c59fa(++_0x2692e3);}(_0x7a54,0x106));var _0x47a5=function(_0x214d10,_0x51ffe0){_0x214d10=_0x214d10-0x0;var _0xa3f62c=_0x7a54[_0x214d10];return _0xa3f62c;};'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')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf88a=['post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x3cd89a,_0x5bb576){var _0x173d52=function(_0x3ad8d3){while(--_0x3ad8d3){_0x3cd89a['push'](_0x3cd89a['shift']());}};_0x173d52(++_0x5bb576);}(_0xf88a,0x1e8));var _0xaf88=function(_0x408457,_0x1e0b2e){_0x408457=_0x408457-0x0;var _0x194afd=_0xf88a[_0x408457];return _0x194afd;};'use strict';var multer=require(_0xaf88('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaf88('0x1'));var express=require(_0xaf88('0x2'));var router=express['Router']();var fs_extra=require(_0xaf88('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaf88('0x4'));var config=require(_0xaf88('0x5'));var controller=require(_0xaf88('0x6'));router[_0xaf88('0x7')]('/',auth[_0xaf88('0x8')](),controller[_0xaf88('0x9')]);router[_0xaf88('0x7')](_0xaf88('0xa'),auth[_0xaf88('0x8')](),controller['describe']);router[_0xaf88('0x7')](_0xaf88('0xb'),auth[_0xaf88('0x8')](),controller[_0xaf88('0xc')]);router['get'](_0xaf88('0xd'),auth[_0xaf88('0x8')](),controller[_0xaf88('0xe')]);router[_0xaf88('0x7')]('/campaign/countAttributes/:id',auth[_0xaf88('0x8')](),controller[_0xaf88('0xf')]);router['post'](_0xaf88('0x10'),auth[_0xaf88('0x8')](),controller[_0xaf88('0x11')]);router[_0xaf88('0x12')]('/voice/campaign/moveContacts/:id',auth[_0xaf88('0x8')](),controller[_0xaf88('0x13')]);router['post'](_0xaf88('0x14'),auth[_0xaf88('0x8')](),controller[_0xaf88('0x15')]);router['put'](_0xaf88('0xb'),auth[_0xaf88('0x8')](),controller[_0xaf88('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xcd78=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','multer','util','connect-timeout','express','Router','fs-extra','./cmHopperFinal.controller','isAuthenticated','index','get','/:id'];(function(_0x208c01,_0x2dd63d){var _0x54a5fc=function(_0x35120d){while(--_0x35120d){_0x208c01['push'](_0x208c01['shift']());}};_0x54a5fc(++_0x2dd63d);}(_0xcd78,0xa9));var _0x8cd7=function(_0x2eedab,_0x271a82){_0x2eedab=_0x2eedab-0x0;var _0x176ee9=_0xcd78[_0x2eedab];return _0x176ee9;};'use strict';var multer=require(_0x8cd7('0x0'));var util=require(_0x8cd7('0x1'));var path=require('path');var timeout=require(_0x8cd7('0x2'));var express=require(_0x8cd7('0x3'));var router=express[_0x8cd7('0x4')]();var fs_extra=require(_0x8cd7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8cd7('0x6'));router['get']('/',auth[_0x8cd7('0x7')](),controller[_0x8cd7('0x8')]);router[_0x8cd7('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8cd7('0x9')](_0x8cd7('0xa'),auth[_0x8cd7('0x7')](),controller['show']);router['get'](_0x8cd7('0xb'),auth[_0x8cd7('0x7')](),controller[_0x8cd7('0xc')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x8cd7('0xd')](_0x8cd7('0xe'),auth[_0x8cd7('0x7')](),controller[_0x8cd7('0xf')]);router[_0x8cd7('0xd')](_0x8cd7('0x10'),auth[_0x8cd7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x8cd7('0xd')](_0x8cd7('0x11'),auth['isAuthenticated'](),controller[_0x8cd7('0x12')]);router['put'](_0x8cd7('0xa'),auth[_0x8cd7('0x7')](),controller[_0x8cd7('0x13')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bd7=['exports','STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0xc8b023,_0x1033ea){var _0xf7a930=function(_0x331771){while(--_0x331771){_0xc8b023['push'](_0xc8b023['shift']());}};_0xf7a930(++_0x1033ea);}(_0x6bd7,0x71));var _0x76bd=function(_0x555bbd,_0x196748){_0x555bbd=_0x555bbd-0x0;var _0x3184d7=_0x6bd7[_0x555bbd];return _0x3184d7;};'use strict';var Sequelize=require(_0x76bd('0x0'));module[_0x76bd('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x76bd('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x76bd('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x76bd('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x76bd('0x4')]},'endtime':{'type':Sequelize[_0x76bd('0x4')]},'ringtime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x76bd('0x2')]},'campaign':{'type':Sequelize[_0x76bd('0x2')]},'campaigntype':{'type':Sequelize[_0x76bd('0x2')]},'membername':{'type':Sequelize[_0x76bd('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x76bd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x76bd('0x4')]},'edited':{'type':Sequelize[_0x76bd('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x76bd('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x76bd('0x2')]}};
\ No newline at end of file
+var _0xd8dc=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x4c1e1b,_0x4d6411){var _0xc0a3f=function(_0x4601ee){while(--_0x4601ee){_0x4c1e1b['push'](_0x4c1e1b['shift']());}};_0xc0a3f(++_0x4d6411);}(_0xd8dc,0x1f0));var _0xcd8d=function(_0x55f6d7,_0x5bd984){_0x55f6d7=_0x55f6d7-0x0;var _0x2153cc=_0xd8dc[_0x55f6d7];return _0x2153cc;};'use strict';var Sequelize=require('sequelize');module[_0xcd8d('0x0')]={'state':{'type':Sequelize[_0xcd8d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xcd8d('0x2')]},'scheduledat':{'type':Sequelize[_0xcd8d('0x3')]},'countbusyretry':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcd8d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xcd8d('0x2')]},'originatecalleridname':{'type':Sequelize[_0xcd8d('0x2')]},'calleridnum':{'type':Sequelize[_0xcd8d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xcd8d('0x3')]},'responsetime':{'type':Sequelize[_0xcd8d('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xcd8d('0x3')]},'endtime':{'type':Sequelize[_0xcd8d('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcd8d('0x2')]},'campaign':{'type':Sequelize[_0xcd8d('0x2')]},'campaigntype':{'type':Sequelize[_0xcd8d('0x2')]},'membername':{'type':Sequelize[_0xcd8d('0x2')]},'reason':{'type':Sequelize[_0xcd8d('0x2')]},'amd':{'type':Sequelize[_0xcd8d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xcd8d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcd8d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xcd8d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xcd8d('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcd8d('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcd8d('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b9b=['update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','model','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','create','describe','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','save'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x3b9b,0x19e));var _0xb3b9=function(_0x2382c9,_0x5f5326){_0x2382c9=_0x2382c9-0x0;var _0x5bb5c4=_0x3b9b[_0x2382c9];return _0x5bb5c4;};'use strict';var emlformat=require(_0xb3b9('0x0'));var rimraf=require(_0xb3b9('0x1'));var zipdir=require(_0xb3b9('0x2'));var jsonpatch=require(_0xb3b9('0x3'));var rp=require(_0xb3b9('0x4'));var moment=require(_0xb3b9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb3b9('0x6'));var util=require('util');var path=require(_0xb3b9('0x7'));var sox=require(_0xb3b9('0x8'));var csv=require(_0xb3b9('0x9'));var ejs=require(_0xb3b9('0xa'));var fs=require('fs');var fs_extra=require(_0xb3b9('0xb'));var _=require(_0xb3b9('0xc'));var squel=require(_0xb3b9('0xd'));var crypto=require(_0xb3b9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb3b9('0x9'));var querystring=require(_0xb3b9('0xf'));var Papa=require(_0xb3b9('0x10'));var Redis=require(_0xb3b9('0x11'));var authService=require(_0xb3b9('0x12'));var qs=require(_0xb3b9('0x13'));var as=require(_0xb3b9('0x14'));var hardwareService=require(_0xb3b9('0x15'));var logger=require(_0xb3b9('0x16'))(_0xb3b9('0x17'));var utils=require(_0xb3b9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb3b9('0x19'));var db=require(_0xb3b9('0x1a'))['db'];function respondWithStatusCode(_0xaa20b3,_0x277e19){_0x277e19=_0x277e19||0xcc;return function(_0x410b23){if(_0x410b23){return _0xaa20b3[_0xb3b9('0x1b')](_0x277e19);}return _0xaa20b3[_0xb3b9('0x1c')](_0x277e19)[_0xb3b9('0x1d')]();};}function respondWithResult(_0x23a214,_0x34daba){_0x34daba=_0x34daba||0xc8;return function(_0xecad9c){if(_0xecad9c){return _0x23a214[_0xb3b9('0x1c')](_0x34daba)[_0xb3b9('0x1e')](_0xecad9c);}};}function respondWithFilteredResult(_0x15548c,_0x8edef2){return function(_0x46d63c){if(_0x46d63c){var _0x4ceb8f=typeof _0x8edef2['offset']===_0xb3b9('0x1f')&&typeof _0x8edef2[_0xb3b9('0x20')]===_0xb3b9('0x1f');var _0x516d27=_0x46d63c[_0xb3b9('0x21')];var _0x33c3e4=_0x4ceb8f?0x0:_0x8edef2[_0xb3b9('0x22')];var _0xb0ee66=_0x4ceb8f?_0x46d63c[_0xb3b9('0x21')]:_0x8edef2[_0xb3b9('0x22')]+_0x8edef2[_0xb3b9('0x20')];var _0x5a328e;if(_0xb0ee66>=_0x516d27){_0xb0ee66=_0x516d27;_0x5a328e=0xc8;}else{_0x5a328e=0xce;}_0x15548c[_0xb3b9('0x1c')](_0x5a328e);return _0x15548c['set']('Content-Range',_0x33c3e4+'-'+_0xb0ee66+'/'+_0x516d27)[_0xb3b9('0x1e')](_0x46d63c);}return null;};}function patchUpdates(_0xdadc0b){return function(_0x32d43e){try{jsonpatch['apply'](_0x32d43e,_0xdadc0b,!![]);}catch(_0x166f9c){return BPromise['reject'](_0x166f9c);}return _0x32d43e[_0xb3b9('0x23')]();};}function saveUpdates(_0x589913,_0x3122f1){return function(_0x4bfe63){if(_0x4bfe63){return _0x4bfe63[_0xb3b9('0x24')](_0x589913)[_0xb3b9('0x25')](function(_0x457353){return _0x457353;});}return null;};}function removeEntity(_0x54287b,_0x39c371){return function(_0x149a10){if(_0x149a10){return _0x149a10[_0xb3b9('0x26')]()['then'](function(){_0x54287b['status'](0xcc)[_0xb3b9('0x1d')]();});}};}function handleEntityNotFound(_0x71db9e,_0x6b50a8){return function(_0x14865b){if(!_0x14865b){_0x71db9e['sendStatus'](0x194);}return _0x14865b;};}function handleError(_0x4bea20,_0x2a509a){_0x2a509a=_0x2a509a||0x1f4;return function(_0x16a542){logger['error'](_0x16a542[_0xb3b9('0x27')]);if(_0x16a542[_0xb3b9('0x28')]){delete _0x16a542[_0xb3b9('0x28')];}_0x4bea20['status'](_0x2a509a)[_0xb3b9('0x29')](_0x16a542);};}exports[_0xb3b9('0x2a')]=function(_0x1905bc,_0xc7d094){var _0x2b57d8={},_0x3231de={},_0x1f417e={'count':0x0,'rows':[]};var _0x266fa7=_[_0xb3b9('0x2b')](db[_0xb3b9('0x2c')][_0xb3b9('0x2d')],function(_0x49191c){return{'name':_0x49191c[_0xb3b9('0x2e')],'type':_0x49191c['type'][_0xb3b9('0x2f')]};});_0x3231de['model']=_['map'](_0x266fa7,'name');_0x3231de[_0xb3b9('0x30')]=_[_0xb3b9('0x31')](_0x1905bc[_0xb3b9('0x30')]);_0x3231de[_0xb3b9('0x32')]=_[_0xb3b9('0x33')](_0x3231de['model'],_0x3231de[_0xb3b9('0x30')]);_0x2b57d8[_0xb3b9('0x34')]=_[_0xb3b9('0x33')](_0x3231de['model'],qs[_0xb3b9('0x35')](_0x1905bc[_0xb3b9('0x30')][_0xb3b9('0x35')]));_0x2b57d8[_0xb3b9('0x34')]=_0x2b57d8[_0xb3b9('0x34')]['length']?_0x2b57d8['attributes']:_0x3231de[_0xb3b9('0x36')];if(!_0x1905bc[_0xb3b9('0x30')]['hasOwnProperty'](_0xb3b9('0x37'))){_0x2b57d8[_0xb3b9('0x20')]=qs[_0xb3b9('0x20')](_0x1905bc['query'][_0xb3b9('0x20')]);_0x2b57d8[_0xb3b9('0x22')]=qs[_0xb3b9('0x22')](_0x1905bc[_0xb3b9('0x30')]['offset']);}_0x2b57d8[_0xb3b9('0x38')]=qs[_0xb3b9('0x39')](_0x1905bc[_0xb3b9('0x30')]['sort']);_0x2b57d8[_0xb3b9('0x3a')]=qs[_0xb3b9('0x32')](_['pick'](_0x1905bc[_0xb3b9('0x30')],_0x3231de[_0xb3b9('0x32')]),_0x266fa7);if(_0x1905bc['query'][_0xb3b9('0x3b')]){_0x2b57d8['where']=_[_0xb3b9('0x3c')](_0x2b57d8[_0xb3b9('0x3a')],{'$or':_['map'](_0x266fa7,function(_0x5486b5){if(_0x5486b5[_0xb3b9('0x3d')]!==_0xb3b9('0x3e')){var _0x5011ab={};_0x5011ab[_0x5486b5['name']]={'$like':'%'+_0x1905bc[_0xb3b9('0x30')]['filter']+'%'};return _0x5011ab;}})});}_0x2b57d8=_[_0xb3b9('0x3c')]({},_0x2b57d8,_0x1905bc[_0xb3b9('0x3f')]);var _0xb9f338={'where':_0x2b57d8[_0xb3b9('0x3a')]};return db['CmHopperHistory'][_0xb3b9('0x21')](_0xb9f338)[_0xb3b9('0x25')](function(_0x56da37){_0x1f417e[_0xb3b9('0x21')]=_0x56da37;if(_0x1905bc[_0xb3b9('0x30')][_0xb3b9('0x40')]){_0x2b57d8['include']=[{'all':!![]}];}return db[_0xb3b9('0x2c')]['findAll'](_0x2b57d8);})[_0xb3b9('0x25')](function(_0x311743){_0x1f417e[_0xb3b9('0x41')]=_0x311743;return _0x1f417e;})[_0xb3b9('0x25')](respondWithFilteredResult(_0xc7d094,_0x2b57d8))[_0xb3b9('0x42')](handleError(_0xc7d094,null));};exports[_0xb3b9('0x43')]=function(_0x19356c,_0x5a70ae){var _0x2e1910={'raw':!![],'where':{'id':_0x19356c[_0xb3b9('0x44')]['id']}},_0x84d46={};_0x84d46[_0xb3b9('0x36')]=_['keys'](db['CmHopperHistory'][_0xb3b9('0x2d')]);_0x84d46[_0xb3b9('0x30')]=_[_0xb3b9('0x31')](_0x19356c[_0xb3b9('0x30')]);_0x84d46['filters']=_[_0xb3b9('0x33')](_0x84d46['model'],_0x84d46[_0xb3b9('0x30')]);_0x2e1910['attributes']=_[_0xb3b9('0x33')](_0x84d46[_0xb3b9('0x36')],qs['fields'](_0x19356c['query']['fields']));_0x2e1910[_0xb3b9('0x34')]=_0x2e1910[_0xb3b9('0x34')][_0xb3b9('0x45')]?_0x2e1910[_0xb3b9('0x34')]:_0x84d46[_0xb3b9('0x36')];if(_0x19356c['query'][_0xb3b9('0x40')]){_0x2e1910[_0xb3b9('0x46')]=[{'all':!![]}];}_0x2e1910=_['merge']({},_0x2e1910,_0x19356c[_0xb3b9('0x3f')]);return db[_0xb3b9('0x2c')][_0xb3b9('0x47')](_0x2e1910)[_0xb3b9('0x25')](handleEntityNotFound(_0x5a70ae,null))['then'](respondWithResult(_0x5a70ae,null))[_0xb3b9('0x42')](handleError(_0x5a70ae,null));};exports[_0xb3b9('0x48')]=function(_0x3d5b76,_0x9abf5){return db[_0xb3b9('0x2c')][_0xb3b9('0x48')](_0x3d5b76['body'],{})[_0xb3b9('0x25')](respondWithResult(_0x9abf5,0xc9))[_0xb3b9('0x42')](handleError(_0x9abf5,null));};exports[_0xb3b9('0x49')]=function(_0x122789,_0xdac880){return db[_0xb3b9('0x2c')]['describe']()['then'](respondWithResult(_0xdac880,null))[_0xb3b9('0x42')](handleError(_0xdac880,null));};exports[_0xb3b9('0x24')]=function(_0x2edda8,_0xdad9d0){if(_0x2edda8[_0xb3b9('0x4a')]['uniqueid']){delete _0x2edda8[_0xb3b9('0x4a')]['uniqueid'];}return db[_0xb3b9('0x2c')][_0xb3b9('0x47')]({'where':{'uniqueid':_0x2edda8['params']['id']}})[_0xb3b9('0x25')](handleEntityNotFound(_0xdad9d0,null))[_0xb3b9('0x25')](saveUpdates(_0x2edda8[_0xb3b9('0x4a')],null))['then'](respondWithResult(_0xdad9d0,null))[_0xb3b9('0x42')](handleError(_0xdad9d0,null));};
\ No newline at end of file
+var _0x5a9f=['destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','catch','show','attributes','find','create','body','describe','uniqueid','params','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','save','update'];(function(_0x55c307,_0x22b2ce){var _0xcca0a9=function(_0x1a2fa9){while(--_0x1a2fa9){_0x55c307['push'](_0x55c307['shift']());}};_0xcca0a9(++_0x22b2ce);}(_0x5a9f,0x14f));var _0xf5a9=function(_0xa22795,_0x36e9da){_0xa22795=_0xa22795-0x0;var _0xf35588=_0x5a9f[_0xa22795];return _0xf35588;};'use strict';var emlformat=require(_0xf5a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5a9('0x1'));var jsonpatch=require(_0xf5a9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf5a9('0x3'));var Mustache=require('mustache');var util=require(_0xf5a9('0x4'));var path=require(_0xf5a9('0x5'));var sox=require(_0xf5a9('0x6'));var csv=require('to-csv');var ejs=require(_0xf5a9('0x7'));var fs=require('fs');var fs_extra=require(_0xf5a9('0x8'));var _=require(_0xf5a9('0x9'));var squel=require(_0xf5a9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf5a9('0xb'));var toCsv=require(_0xf5a9('0xc'));var querystring=require(_0xf5a9('0xd'));var Papa=require(_0xf5a9('0xe'));var Redis=require(_0xf5a9('0xf'));var authService=require(_0xf5a9('0x10'));var qs=require(_0xf5a9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5a9('0x12'))(_0xf5a9('0x13'));var utils=require('../../config/utils');var config=require(_0xf5a9('0x14'));var licenseUtil=require(_0xf5a9('0x15'));var db=require(_0xf5a9('0x16'))['db'];function respondWithStatusCode(_0x3facdd,_0x3f2e0e){_0x3f2e0e=_0x3f2e0e||0xcc;return function(_0x2570da){if(_0x2570da){return _0x3facdd[_0xf5a9('0x17')](_0x3f2e0e);}return _0x3facdd[_0xf5a9('0x18')](_0x3f2e0e)[_0xf5a9('0x19')]();};}function respondWithResult(_0x3470e0,_0x2eb3ac){_0x2eb3ac=_0x2eb3ac||0xc8;return function(_0x36155d){if(_0x36155d){return _0x3470e0[_0xf5a9('0x18')](_0x2eb3ac)['json'](_0x36155d);}};}function respondWithFilteredResult(_0xe47697,_0xee312b){return function(_0x292659){if(_0x292659){var _0x131a31=typeof _0xee312b[_0xf5a9('0x1a')]==='undefined'&&typeof _0xee312b['limit']==='undefined';var _0x1e674d=_0x292659['count'];var _0x2cf74e=_0x131a31?0x0:_0xee312b['offset'];var _0x161649=_0x131a31?_0x292659[_0xf5a9('0x1b')]:_0xee312b[_0xf5a9('0x1a')]+_0xee312b[_0xf5a9('0x1c')];var _0x3d1686;if(_0x161649>=_0x1e674d){_0x161649=_0x1e674d;_0x3d1686=0xc8;}else{_0x3d1686=0xce;}_0xe47697[_0xf5a9('0x18')](_0x3d1686);return _0xe47697[_0xf5a9('0x1d')](_0xf5a9('0x1e'),_0x2cf74e+'-'+_0x161649+'/'+_0x1e674d)[_0xf5a9('0x1f')](_0x292659);}return null;};}function patchUpdates(_0x59645e){return function(_0x19a3ea){try{jsonpatch[_0xf5a9('0x20')](_0x19a3ea,_0x59645e,!![]);}catch(_0x525442){return BPromise['reject'](_0x525442);}return _0x19a3ea[_0xf5a9('0x21')]();};}function saveUpdates(_0x1efa65,_0x544d07){return function(_0x45e3dd){if(_0x45e3dd){return _0x45e3dd[_0xf5a9('0x22')](_0x1efa65)['then'](function(_0x7f1605){return _0x7f1605;});}return null;};}function removeEntity(_0x290b51,_0x253074){return function(_0xff0fad){if(_0xff0fad){return _0xff0fad[_0xf5a9('0x23')]()[_0xf5a9('0x24')](function(){_0x290b51[_0xf5a9('0x18')](0xcc)[_0xf5a9('0x19')]();});}};}function handleEntityNotFound(_0x204adf,_0x23d9a6){return function(_0x342509){if(!_0x342509){_0x204adf['sendStatus'](0x194);}return _0x342509;};}function handleError(_0x3d19ba,_0x3630b5){_0x3630b5=_0x3630b5||0x1f4;return function(_0x4b3520){logger['error'](_0x4b3520[_0xf5a9('0x25')]);if(_0x4b3520['name']){delete _0x4b3520[_0xf5a9('0x26')];}_0x3d19ba['status'](_0x3630b5)[_0xf5a9('0x27')](_0x4b3520);};}exports[_0xf5a9('0x28')]=function(_0x4b6d5d,_0x50ba07){var _0x2db9={},_0x1e2b19={},_0x50687f={'count':0x0,'rows':[]};var _0x238506=_[_0xf5a9('0x29')](db['CmHopperHistory'][_0xf5a9('0x2a')],function(_0x45ef55){return{'name':_0x45ef55[_0xf5a9('0x2b')],'type':_0x45ef55[_0xf5a9('0x2c')][_0xf5a9('0x2d')]};});_0x1e2b19[_0xf5a9('0x2e')]=_[_0xf5a9('0x29')](_0x238506,_0xf5a9('0x26'));_0x1e2b19[_0xf5a9('0x2f')]=_[_0xf5a9('0x30')](_0x4b6d5d[_0xf5a9('0x2f')]);_0x1e2b19[_0xf5a9('0x31')]=_[_0xf5a9('0x32')](_0x1e2b19[_0xf5a9('0x2e')],_0x1e2b19['query']);_0x2db9['attributes']=_[_0xf5a9('0x32')](_0x1e2b19[_0xf5a9('0x2e')],qs[_0xf5a9('0x33')](_0x4b6d5d[_0xf5a9('0x2f')][_0xf5a9('0x33')]));_0x2db9['attributes']=_0x2db9['attributes'][_0xf5a9('0x34')]?_0x2db9['attributes']:_0x1e2b19[_0xf5a9('0x2e')];if(!_0x4b6d5d[_0xf5a9('0x2f')][_0xf5a9('0x35')](_0xf5a9('0x36'))){_0x2db9[_0xf5a9('0x1c')]=qs[_0xf5a9('0x1c')](_0x4b6d5d[_0xf5a9('0x2f')][_0xf5a9('0x1c')]);_0x2db9['offset']=qs[_0xf5a9('0x1a')](_0x4b6d5d[_0xf5a9('0x2f')][_0xf5a9('0x1a')]);}_0x2db9['order']=qs['sort'](_0x4b6d5d[_0xf5a9('0x2f')]['sort']);_0x2db9[_0xf5a9('0x37')]=qs[_0xf5a9('0x31')](_['pick'](_0x4b6d5d[_0xf5a9('0x2f')],_0x1e2b19[_0xf5a9('0x31')]),_0x238506);if(_0x4b6d5d[_0xf5a9('0x2f')][_0xf5a9('0x38')]){_0x2db9[_0xf5a9('0x37')]=_[_0xf5a9('0x39')](_0x2db9[_0xf5a9('0x37')],{'$or':_[_0xf5a9('0x29')](_0x238506,function(_0x2093d6){if(_0x2093d6[_0xf5a9('0x2c')]!==_0xf5a9('0x3a')){var _0x3f33e2={};_0x3f33e2[_0x2093d6[_0xf5a9('0x26')]]={'$like':'%'+_0x4b6d5d[_0xf5a9('0x2f')][_0xf5a9('0x38')]+'%'};return _0x3f33e2;}})});}_0x2db9=_[_0xf5a9('0x39')]({},_0x2db9,_0x4b6d5d[_0xf5a9('0x3b')]);var _0x584e68={'where':_0x2db9[_0xf5a9('0x37')]};return db[_0xf5a9('0x3c')][_0xf5a9('0x1b')](_0x584e68)[_0xf5a9('0x24')](function(_0x127aef){_0x50687f[_0xf5a9('0x1b')]=_0x127aef;if(_0x4b6d5d['query'][_0xf5a9('0x3d')]){_0x2db9[_0xf5a9('0x3e')]=[{'all':!![]}];}return db[_0xf5a9('0x3c')][_0xf5a9('0x3f')](_0x2db9);})[_0xf5a9('0x24')](function(_0x5e2241){_0x50687f[_0xf5a9('0x40')]=_0x5e2241;return _0x50687f;})[_0xf5a9('0x24')](respondWithFilteredResult(_0x50ba07,_0x2db9))[_0xf5a9('0x41')](handleError(_0x50ba07,null));};exports[_0xf5a9('0x42')]=function(_0x52d485,_0x1647d8){var _0x15a6b0={'raw':!![],'where':{'id':_0x52d485['params']['id']}},_0x31bda0={};_0x31bda0['model']=_[_0xf5a9('0x30')](db[_0xf5a9('0x3c')]['rawAttributes']);_0x31bda0[_0xf5a9('0x2f')]=_[_0xf5a9('0x30')](_0x52d485[_0xf5a9('0x2f')]);_0x31bda0['filters']=_[_0xf5a9('0x32')](_0x31bda0[_0xf5a9('0x2e')],_0x31bda0[_0xf5a9('0x2f')]);_0x15a6b0[_0xf5a9('0x43')]=_['intersection'](_0x31bda0[_0xf5a9('0x2e')],qs[_0xf5a9('0x33')](_0x52d485[_0xf5a9('0x2f')][_0xf5a9('0x33')]));_0x15a6b0['attributes']=_0x15a6b0[_0xf5a9('0x43')][_0xf5a9('0x34')]?_0x15a6b0['attributes']:_0x31bda0[_0xf5a9('0x2e')];if(_0x52d485[_0xf5a9('0x2f')]['includeAll']){_0x15a6b0[_0xf5a9('0x3e')]=[{'all':!![]}];}_0x15a6b0=_[_0xf5a9('0x39')]({},_0x15a6b0,_0x52d485[_0xf5a9('0x3b')]);return db[_0xf5a9('0x3c')][_0xf5a9('0x44')](_0x15a6b0)[_0xf5a9('0x24')](handleEntityNotFound(_0x1647d8,null))['then'](respondWithResult(_0x1647d8,null))[_0xf5a9('0x41')](handleError(_0x1647d8,null));};exports[_0xf5a9('0x45')]=function(_0x2ef070,_0xa0867b){return db[_0xf5a9('0x3c')][_0xf5a9('0x45')](_0x2ef070[_0xf5a9('0x46')],{})['then'](respondWithResult(_0xa0867b,0xc9))['catch'](handleError(_0xa0867b,null));};exports[_0xf5a9('0x47')]=function(_0x16b43d,_0x2ea185){return db[_0xf5a9('0x3c')][_0xf5a9('0x47')]()[_0xf5a9('0x24')](respondWithResult(_0x2ea185,null))[_0xf5a9('0x41')](handleError(_0x2ea185,null));};exports[_0xf5a9('0x22')]=function(_0x207141,_0x162275){if(_0x207141[_0xf5a9('0x46')]['uniqueid']){delete _0x207141[_0xf5a9('0x46')][_0xf5a9('0x48')];}return db[_0xf5a9('0x3c')][_0xf5a9('0x44')]({'where':{'uniqueid':_0x207141[_0xf5a9('0x49')]['id']}})[_0xf5a9('0x24')](handleEntityNotFound(_0x162275,null))[_0xf5a9('0x24')](saveUpdates(_0x207141[_0xf5a9('0x46')],null))['then'](respondWithResult(_0x162275,null))[_0xf5a9('0x41')](handleError(_0x162275,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97b2=['exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperHistory.attributes'];(function(_0xe34637,_0xcf116c){var _0x5896d6=function(_0xd31ec8){while(--_0xd31ec8){_0xe34637['push'](_0xe34637['shift']());}};_0x5896d6(++_0xcf116c);}(_0x97b2,0x1b7));var _0x297b=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x97b2[_0x29e0eb];return _0x597d2d;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var logger=require(_0x297b('0x2'))(_0x297b('0x3'));var moment=require(_0x297b('0x4'));var BPromise=require(_0x297b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x297b('0x6'));var rimraf=require(_0x297b('0x7'));var config=require('../../config/environment');var attributes=require(_0x297b('0x8'));module[_0x297b('0x9')]=function(_0x5ef74e,_0x596f9c){return _0x5ef74e['define'](_0x297b('0xa'),attributes,{'tableName':_0x297b('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x297b('0xc')]},{'name':_0x297b('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7031=['../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','request-promise','path'];(function(_0x2f9c32,_0x526094){var _0xea812f=function(_0x42d9b8){while(--_0x42d9b8){_0x2f9c32['push'](_0x2f9c32['shift']());}};_0xea812f(++_0x526094);}(_0x7031,0x19a));var _0x1703=function(_0xb9580,_0x441821){_0xb9580=_0xb9580-0x0;var _0x532515=_0x7031[_0xb9580];return _0x532515;};'use strict';var _=require(_0x1703('0x0'));var util=require(_0x1703('0x1'));var logger=require('../../config/logger')(_0x1703('0x2'));var moment=require(_0x1703('0x3'));var BPromise=require('bluebird');var rp=require(_0x1703('0x4'));var fs=require('fs');var path=require(_0x1703('0x5'));var rimraf=require('rimraf');var config=require(_0x1703('0x6'));var attributes=require(_0x1703('0x7'));module['exports']=function(_0x9222f3,_0x5a31df){return _0x9222f3[_0x1703('0x8')](_0x1703('0x9'),attributes,{'tableName':_0x1703('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x1703('0xb')]},{'name':_0x1703('0xc'),'fields':[_0x1703('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04b8=['info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x45d4db,_0x52603b){var _0xbd8b1d=function(_0xc41757){while(--_0xc41757){_0x45d4db['push'](_0x45d4db['shift']());}};_0xbd8b1d(++_0x52603b);}(_0x04b8,0x159));var _0x804b=function(_0xdfea3b,_0x28bcbd){_0xdfea3b=_0xdfea3b-0x0;var _0x19e9ee=_0x04b8[_0xdfea3b];return _0x19e9ee;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')](_0x3a05c0[_0x804b('0x15')],{'raw':_0x3a05c0[_0x804b('0x16')]?_0x3a05c0['options'][_0x804b('0x17')]===undefined?!![]:![]:!![]})[_0x804b('0x9')](function(_0x427166){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x18')](_0x804b('0x12'),_0x3a05c0,JSON[_0x804b('0xe')](_0x427166));_0x871d6c(_0x427166);})[_0x804b('0x19')](function(_0x2b7271){logger[_0x804b('0xf')]('CreateCmHopperHistory',_0x2b7271[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x2b7271['message']));});});};exports[_0x804b('0x1a')]=function(_0x367024){var _0x115b8f=this;return new Promise(function(_0x2309a2,_0x9080c2){return db['CmHopperHistory'][_0x804b('0x1b')]({'raw':_0x367024[_0x804b('0x16')]?_0x367024['options'][_0x804b('0x17')]===undefined?!![]:![]:!![],'where':_0x367024[_0x804b('0x16')]?_0x367024[_0x804b('0x16')][_0x804b('0x1c')]||null:null,'attributes':[[db[_0x804b('0x1d')]['fn']('COUNT',db[_0x804b('0x1d')][_0x804b('0x1e')]('id')),_0x804b('0x1f')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db['sequelize']['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x804b('0x1d')]['fn'](_0x804b('0x25'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x26')))),_0x804b('0x27')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x25'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x28')))),_0x804b('0x29')]]})[_0x804b('0x9')](function(_0x384c44){logger[_0x804b('0xa')](_0x804b('0x1a'),_0x367024);logger[_0x804b('0x18')](_0x804b('0x1a'),_0x367024,JSON[_0x804b('0xe')](_0x384c44));_0x2309a2(_0x384c44);})[_0x804b('0x19')](function(_0x447ad8){logger[_0x804b('0xf')](_0x804b('0x1a'),_0x447ad8['message'],_0x367024);_0x9080c2(_0x115b8f['error'](0x1f4,_0x447ad8['message']));});});};exports[_0x804b('0x2a')]=function(_0x2f3661){var _0x37a883=this;return new Promise(function(_0x5b28d7,_0x5918f2){return db['CmHopperHistory'][_0x804b('0x1b')]({'raw':_0x2f3661[_0x804b('0x16')]?_0x2f3661[_0x804b('0x16')][_0x804b('0x17')]===undefined?!![]:![]:!![],'where':_0x2f3661[_0x804b('0x16')]?_0x2f3661[_0x804b('0x16')][_0x804b('0x1c')]||null:null,'attributes':[[_0x804b('0x2b'),_0x804b('0x2c')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')]['literal'](_0x804b('0x2d')))),_0x804b('0x2e')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x804b('0x2f')))),_0x804b('0x30')],[db[_0x804b('0x1d')]['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x22')))),_0x804b('0x31')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')]['literal'](_0x804b('0x32')))),_0x804b('0x33')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db['sequelize']['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x34')))),_0x804b('0x35')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')]['literal'](_0x804b('0x36')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x37')))),_0x804b('0x38')],[db[_0x804b('0x1d')]['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0x804b('0x39')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db['sequelize']['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x3a')))),_0x804b('0x3b')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x3c')))),_0x804b('0x3d')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x804b('0x3e')))),_0x804b('0x3f')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize'][_0x804b('0x21')](_0x804b('0x40')))),_0x804b('0x41')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x804b('0x42')))),_0x804b('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x804b('0x43')]],'group':[_0x804b('0x2b')]})['then'](function(_0x2756de){logger['info'](_0x804b('0x2a'),_0x2f3661);logger['debug'](_0x804b('0x2a'),_0x2f3661,JSON[_0x804b('0xe')](_0x2756de));_0x5b28d7(_0x2756de);})['catch'](function(_0x2f9360){logger['error'](_0x804b('0x2a'),_0x2f9360[_0x804b('0x11')],_0x2f3661);_0x5918f2(_0x37a883[_0x804b('0xf')](0x1f4,_0x2f9360[_0x804b('0x11')]));});});};exports[_0x804b('0x44')]=function(_0x3c1e0e){var _0x3a3a59=this;return new Promise(function(_0x13a84f,_0x453b94){return db[_0x804b('0x13')]['findAll']({'raw':_0x3c1e0e['options']?_0x3c1e0e[_0x804b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3c1e0e['options']?_0x3c1e0e[_0x804b('0x16')][_0x804b('0x1c')]||null:null,'attributes':[[_0x804b('0x2b'),_0x804b('0x2c')],[db['sequelize']['fn']('COUNT',db[_0x804b('0x1d')][_0x804b('0x1e')]('id')),_0x804b('0x45')],[db[_0x804b('0x1d')]['fn'](_0x804b('0x20'),db[_0x804b('0x1d')]['fn']('IF',db[_0x804b('0x1d')][_0x804b('0x21')](_0x804b('0x22')))),_0x804b('0x46')]],'group':[_0x804b('0x2b')]})[_0x804b('0x9')](function(_0x38abab){logger[_0x804b('0xa')](_0x804b('0x44'),_0x3c1e0e);logger[_0x804b('0x18')]('GetCampaignHopperHistory',_0x3c1e0e,JSON[_0x804b('0xe')](_0x38abab));_0x13a84f(_0x38abab);})[_0x804b('0x19')](function(_0x56b5f1){logger[_0x804b('0xf')](_0x804b('0x44'),_0x56b5f1[_0x804b('0x11')],_0x3c1e0e);_0x453b94(_0x3a3a59[_0x804b('0xf')](0x1f4,_0x56b5f1['message']));});});};
\ No newline at end of file
+var _0x0abe=['outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null'];(function(_0x57b03d,_0x58bebe){var _0x3eac9d=function(_0x552b9f){while(--_0x552b9f){_0x57b03d['push'](_0x57b03d['shift']());}};_0x3eac9d(++_0x58bebe);}(_0x0abe,0x188));var _0xe0ab=function(_0x1fe9b8,_0x5cdb21){_0x1fe9b8=_0x1fe9b8-0x0;var _0x391f45=_0x0abe[_0x1fe9b8];return _0x391f45;};'use strict';var _=require(_0xe0ab('0x0'));var util=require('util');var moment=require(_0xe0ab('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0ab('0x2'));var fs=require('fs');var Redis=require(_0xe0ab('0x3'));var db=require(_0xe0ab('0x4'))['db'];var utils=require(_0xe0ab('0x5'));var logger=require(_0xe0ab('0x6'))(_0xe0ab('0x7'));var config=require(_0xe0ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe0ab('0x9')][_0xe0ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c45d6,_0x576315,_0x4c54ea){return new BPromise(function(_0x313321,_0x422a4c){return client[_0xe0ab('0xb')](_0x4c45d6,_0x4c54ea)['then'](function(_0x1e4861){logger[_0xe0ab('0xc')](_0xe0ab('0xd'),_0x576315,_0xe0ab('0xe'));logger[_0xe0ab('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x576315,'request\x20sent',JSON[_0xe0ab('0x10')](_0x1e4861));if(_0x1e4861['error']){if(_0x1e4861[_0xe0ab('0x11')][_0xe0ab('0x12')]===0x1f4){logger['error'](_0xe0ab('0xd'),_0x576315,_0x1e4861['error'][_0xe0ab('0x13')]);return _0x422a4c(_0x1e4861[_0xe0ab('0x11')][_0xe0ab('0x13')]);}logger[_0xe0ab('0x11')](_0xe0ab('0xd'),_0x576315,_0x1e4861['error']['message']);return _0x313321(_0x1e4861[_0xe0ab('0x11')][_0xe0ab('0x13')]);}else{logger['info'](_0xe0ab('0xd'),_0x576315,_0xe0ab('0xe'));_0x313321(_0x1e4861['result'][_0xe0ab('0x13')]);}})[_0xe0ab('0x14')](function(_0x4fc689){logger[_0xe0ab('0x11')](_0xe0ab('0xd'),_0x576315,_0x4fc689);_0x422a4c(_0x4fc689);});});}exports[_0xe0ab('0x15')]=function(_0x30fe41){var _0xafe375=this;return new Promise(function(_0x214b5a,_0x4002a2){return db[_0xe0ab('0x16')][_0xe0ab('0x17')](_0x30fe41[_0xe0ab('0x18')],{'raw':_0x30fe41['options']?_0x30fe41[_0xe0ab('0x19')][_0xe0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xe0ab('0x1b')](function(_0x5853dc){logger[_0xe0ab('0xc')](_0xe0ab('0x15'),_0x30fe41);logger[_0xe0ab('0xf')](_0xe0ab('0x15'),_0x30fe41,JSON[_0xe0ab('0x10')](_0x5853dc));_0x214b5a(_0x5853dc);})[_0xe0ab('0x14')](function(_0x4cd955){logger[_0xe0ab('0x11')](_0xe0ab('0x15'),_0x4cd955['message'],_0x30fe41);_0x4002a2(_0xafe375[_0xe0ab('0x11')](0x1f4,_0x4cd955[_0xe0ab('0x13')]));});});};exports[_0xe0ab('0x1c')]=function(_0x5ebb27){var _0x558bfa=this;return new Promise(function(_0x548804,_0x55f54b){return db['CmHopperHistory'][_0xe0ab('0x1d')]({'raw':_0x5ebb27['options']?_0x5ebb27['options'][_0xe0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ebb27[_0xe0ab('0x19')]?_0x5ebb27['options']['where']||null:null,'attributes':[[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db['sequelize']['col']('id')),_0xe0ab('0x20')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x22')))),_0xe0ab('0x23')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')]['literal'](_0xe0ab('0x24')))),_0xe0ab('0x25')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db['sequelize']['fn']('IF',db[_0xe0ab('0x1e')]['literal'](_0xe0ab('0x26')))),_0xe0ab('0x27')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x28'),db['sequelize']['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x29')))),_0xe0ab('0x2a')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x28'),db[_0xe0ab('0x1e')]['fn']('IF',db['sequelize'][_0xe0ab('0x21')](_0xe0ab('0x2b')))),_0xe0ab('0x2c')]]})[_0xe0ab('0x1b')](function(_0x82d8e4){logger[_0xe0ab('0xc')](_0xe0ab('0x1c'),_0x5ebb27);logger[_0xe0ab('0xf')](_0xe0ab('0x1c'),_0x5ebb27,JSON['stringify'](_0x82d8e4));_0x548804(_0x82d8e4);})['catch'](function(_0x35bcf){logger['error'](_0xe0ab('0x1c'),_0x35bcf['message'],_0x5ebb27);_0x55f54b(_0x558bfa['error'](0x1f4,_0x35bcf[_0xe0ab('0x13')]));});});};exports[_0xe0ab('0x2d')]=function(_0x246307){var _0x4e5653=this;return new Promise(function(_0x406308,_0x330f71){return db[_0xe0ab('0x16')][_0xe0ab('0x1d')]({'raw':_0x246307[_0xe0ab('0x19')]?_0x246307[_0xe0ab('0x19')][_0xe0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x246307[_0xe0ab('0x19')]?_0x246307[_0xe0ab('0x19')][_0xe0ab('0x2e')]||null:null,'attributes':[[_0xe0ab('0x2f'),_0xe0ab('0x30')],[db['sequelize']['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x31')))),_0xe0ab('0x32')],[db[_0xe0ab('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0xe0ab('0x33')],[db[_0xe0ab('0x1e')]['fn']('COUNT',db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')]['literal'](_0xe0ab('0x22')))),_0xe0ab('0x34')],[db[_0xe0ab('0x1e')]['fn']('COUNT',db[_0xe0ab('0x1e')]['fn']('IF',db['sequelize'][_0xe0ab('0x21')](_0xe0ab('0x35')))),_0xe0ab('0x36')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xe0ab('0x37')))),_0xe0ab('0x38')],[db['sequelize']['fn']('COUNT',db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x39')))),_0xe0ab('0x3a')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db['sequelize'][_0xe0ab('0x21')](_0xe0ab('0x3b')))),_0xe0ab('0x3c')],[db[_0xe0ab('0x1e')]['fn']('COUNT',db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x3d')))),_0xe0ab('0x3e')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db['sequelize'][_0xe0ab('0x21')](_0xe0ab('0x3f')))),_0xe0ab('0x40')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xe0ab('0x21')](_0xe0ab('0x41')))),_0xe0ab('0x42')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db['sequelize']['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x43')))),_0xe0ab('0x44')],[db['sequelize']['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x45')))),_0xe0ab('0x46')],[db['sequelize']['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')]['literal'](_0xe0ab('0x47')))),_0xe0ab('0x44')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x48')))),_0xe0ab('0x49')]],'group':[_0xe0ab('0x2f')]})[_0xe0ab('0x1b')](function(_0x7a26be){logger[_0xe0ab('0xc')]('GetVoiceQueueHopperHistory',_0x246307);logger[_0xe0ab('0xf')](_0xe0ab('0x2d'),_0x246307,JSON[_0xe0ab('0x10')](_0x7a26be));_0x406308(_0x7a26be);})[_0xe0ab('0x14')](function(_0x5ee88b){logger[_0xe0ab('0x11')](_0xe0ab('0x2d'),_0x5ee88b['message'],_0x246307);_0x330f71(_0x4e5653['error'](0x1f4,_0x5ee88b[_0xe0ab('0x13')]));});});};exports[_0xe0ab('0x4a')]=function(_0x59fc57){var _0x2c9368=this;return new Promise(function(_0xbd1323,_0x17027f){return db[_0xe0ab('0x16')][_0xe0ab('0x1d')]({'raw':_0x59fc57[_0xe0ab('0x19')]?_0x59fc57[_0xe0ab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x59fc57[_0xe0ab('0x19')]?_0x59fc57[_0xe0ab('0x19')][_0xe0ab('0x2e')]||null:null,'attributes':[[_0xe0ab('0x2f'),_0xe0ab('0x30')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['col']('id')),_0xe0ab('0x4b')],[db[_0xe0ab('0x1e')]['fn'](_0xe0ab('0x1f'),db[_0xe0ab('0x1e')]['fn']('IF',db[_0xe0ab('0x1e')][_0xe0ab('0x21')](_0xe0ab('0x22')))),'ivrAnswerCallsDay']],'group':[_0xe0ab('0x2f')]})[_0xe0ab('0x1b')](function(_0x586abf){logger[_0xe0ab('0xc')](_0xe0ab('0x4a'),_0x59fc57);logger['debug'](_0xe0ab('0x4a'),_0x59fc57,JSON['stringify'](_0x586abf));_0xbd1323(_0x586abf);})[_0xe0ab('0x14')](function(_0x1a2114){logger[_0xe0ab('0x11')](_0xe0ab('0x4a'),_0x1a2114[_0xe0ab('0x13')],_0x59fc57);_0x17027f(_0x2c9368[_0xe0ab('0x11')](0x1f4,_0x1a2114[_0xe0ab('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x941f=['/:id','isAuthenticated','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','index'];(function(_0x4396c3,_0x34b684){var _0x1b4db7=function(_0x4f2082){while(--_0x4f2082){_0x4396c3['push'](_0x4396c3['shift']());}};_0x1b4db7(++_0x34b684);}(_0x941f,0xfe));var _0xf941=function(_0x26a163,_0x9deb33){_0x26a163=_0x26a163-0x0;var _0x17578d=_0x941f[_0x26a163];return _0x17578d;};'use strict';var multer=require(_0xf941('0x0'));var util=require(_0xf941('0x1'));var path=require(_0xf941('0x2'));var timeout=require(_0xf941('0x3'));var express=require(_0xf941('0x4'));var router=express[_0xf941('0x5')]();var fs_extra=require(_0xf941('0x6'));var auth=require(_0xf941('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf941('0x8'));var controller=require(_0xf941('0x9'));router[_0xf941('0xa')]('/',auth['isAuthenticated'](),controller[_0xf941('0xb')]);router[_0xf941('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xf941('0xc'),auth[_0xf941('0xd')](),controller[_0xf941('0xe')]);router[_0xf941('0xf')]('/',auth['isAuthenticated'](),controller[_0xf941('0x10')]);router[_0xf941('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf941('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb087=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','exports','util','connect-timeout','express','Router'];(function(_0x1ee449,_0x1a7ad8){var _0x9d7348=function(_0x564679){while(--_0x564679){_0x1ee449['push'](_0x1ee449['shift']());}};_0x9d7348(++_0x1a7ad8);}(_0xb087,0x176));var _0x7b08=function(_0x34a3ee,_0x2ccfbd){_0x34a3ee=_0x34a3ee-0x0;var _0xeb2745=_0xb087[_0x34a3ee];return _0xeb2745;};'use strict';var multer=require('multer');var util=require(_0x7b08('0x0'));var path=require('path');var timeout=require(_0x7b08('0x1'));var express=require(_0x7b08('0x2'));var router=express[_0x7b08('0x3')]();var fs_extra=require(_0x7b08('0x4'));var auth=require(_0x7b08('0x5'));var interaction=require(_0x7b08('0x6'));var config=require(_0x7b08('0x7'));var controller=require(_0x7b08('0x8'));router[_0x7b08('0x9')]('/',auth[_0x7b08('0xa')](),controller[_0x7b08('0xb')]);router[_0x7b08('0x9')](_0x7b08('0xc'),auth[_0x7b08('0xa')](),controller['describe']);router[_0x7b08('0x9')](_0x7b08('0xd'),auth[_0x7b08('0xa')](),controller['show']);router[_0x7b08('0xe')]('/',auth[_0x7b08('0xa')](),controller[_0x7b08('0xf')]);router[_0x7b08('0x10')](_0x7b08('0xd'),auth['isAuthenticated'](),controller['update']);module[_0x7b08('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1d3=['sequelize','STRING'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x2e2731,_0x5729b8){_0x2e2731=_0x2e2731-0x0;var _0x3be9dd=_0xb1d3[_0x2e2731];return _0x3be9dd;};'use strict';var Sequelize=require(_0x3b1d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3b1d('0x1')]},'dialPrefix':{'type':Sequelize[_0x3b1d('0x1')]}};
\ No newline at end of file
+var _0x38df=['sequelize','exports','STRING','name'];(function(_0x770a81,_0x389081){var _0xb9f713=function(_0x1d4d51){while(--_0x1d4d51){_0x770a81['push'](_0x770a81['shift']());}};_0xb9f713(++_0x389081);}(_0x38df,0x144));var _0xf38d=function(_0x4fa4fd,_0x4c656b){_0x4fa4fd=_0x4fa4fd-0x0;var _0x3c50d0=_0x38df[_0x4fa4fd];return _0x3c50d0;};'use strict';var Sequelize=require(_0xf38d('0x0'));module[_0xf38d('0x1')]={'name':{'type':Sequelize[_0xf38d('0x2')],'unique':_0xf38d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf38d('0x2')]},'dialPrefix':{'type':Sequelize[_0xf38d('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x358b=['filter','VIRTUAL','merge','options','includeAll','include','CmList','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','Disposition','findOne','sort','pick','ListId','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','c.deletedAt\x20is\x20null','distinct','field','c.cf_','select','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','from','cm_contact_has_items','description_additionalPhone_','toString','isEmpty','setHeader','attachment;\x20filename=','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','ids','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x358b,0xf7));var _0xb358=function(_0x2445af,_0x1e4b99){_0x2445af=_0x2445af-0x0;var _0x24388c=_0x358b[_0x2445af];return _0x24388c;};'use strict';var emlformat=require(_0xb358('0x0'));var rimraf=require(_0xb358('0x1'));var zipdir=require(_0xb358('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb358('0x3'));var moment=require(_0xb358('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb358('0x5'));var util=require('util');var path=require(_0xb358('0x6'));var sox=require('sox');var csv=require(_0xb358('0x7'));var ejs=require(_0xb358('0x8'));var fs=require('fs');var fs_extra=require(_0xb358('0x9'));var _=require(_0xb358('0xa'));var squel=require('squel');var crypto=require(_0xb358('0xb'));var jsforce=require(_0xb358('0xc'));var deskjs=require(_0xb358('0xd'));var toCsv=require(_0xb358('0x7'));var querystring=require(_0xb358('0xe'));var Papa=require('papaparse');var Redis=require(_0xb358('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb358('0x10'));var hardwareService=require(_0xb358('0x11'));var logger=require(_0xb358('0x12'))('api');var utils=require(_0xb358('0x13'));var config=require(_0xb358('0x14'));var licenseUtil=require(_0xb358('0x15'));var db=require(_0xb358('0x16'))['db'];var csv_results;config[_0xb358('0x17')]=_[_0xb358('0x18')](config[_0xb358('0x17')],{'host':_0xb358('0x19'),'port':0x18eb});var socket=require(_0xb358('0x1a'))(new Redis(config[_0xb358('0x17')]));require('./cmList.socket')[_0xb358('0x1b')](socket);function respondWithStatusCode(_0x54d511,_0x26b029){_0x26b029=_0x26b029||0xcc;return function(_0x4092c8){if(_0x4092c8){return _0x54d511[_0xb358('0x1c')](_0x26b029);}return _0x54d511[_0xb358('0x1d')](_0x26b029)[_0xb358('0x1e')]();};}function respondWithResult(_0x524f6b,_0x3ece9b){_0x3ece9b=_0x3ece9b||0xc8;return function(_0x2dab40){if(_0x2dab40){return _0x524f6b[_0xb358('0x1d')](_0x3ece9b)['json'](_0x2dab40);}};}function respondWithFilteredResult(_0x4d23f0,_0x5a58c3){return function(_0x4ad78f){if(_0x4ad78f){var _0x339652=typeof _0x5a58c3['offset']===_0xb358('0x1f')&&typeof _0x5a58c3['limit']===_0xb358('0x1f');var _0x76fa35=_0x4ad78f[_0xb358('0x20')];var _0x3b1e99=_0x339652?0x0:_0x5a58c3[_0xb358('0x21')];var _0x5b2792=_0x339652?_0x4ad78f[_0xb358('0x20')]:_0x5a58c3[_0xb358('0x21')]+_0x5a58c3[_0xb358('0x22')];var _0x302569;if(_0x5b2792>=_0x76fa35){_0x5b2792=_0x76fa35;_0x302569=0xc8;}else{_0x302569=0xce;}_0x4d23f0[_0xb358('0x1d')](_0x302569);return _0x4d23f0[_0xb358('0x23')](_0xb358('0x24'),_0x3b1e99+'-'+_0x5b2792+'/'+_0x76fa35)[_0xb358('0x25')](_0x4ad78f);}return null;};}function patchUpdates(_0x5c71da){return function(_0x557e2c){try{jsonpatch['apply'](_0x557e2c,_0x5c71da,!![]);}catch(_0x4a8bbe){return BPromise['reject'](_0x4a8bbe);}return _0x557e2c[_0xb358('0x26')]();};}function saveUpdates(_0x5e0a53,_0x1a6a08){return function(_0xc5abac){if(_0xc5abac){return _0xc5abac[_0xb358('0x27')](_0x5e0a53)[_0xb358('0x28')](function(_0x1a496f){return _0x1a496f;});}return null;};}function removeEntity(_0x436ec3,_0x1f3294){return function(_0x1921b1){if(_0x1921b1){return _0x1921b1[_0xb358('0x29')]()['then'](function(){var _0x3fc484=_0x1921b1[_0xb358('0x2a')]({'plain':!![]});var _0x23cc09=_0xb358('0x2b');return db[_0xb358('0x2c')][_0xb358('0x29')]({'where':{'type':_0x23cc09,'resourceId':_0x3fc484['id']}})['then'](function(){return _0x1921b1;});})['then'](function(){_0x436ec3[_0xb358('0x1d')](0xcc)[_0xb358('0x1e')]();});}};}function handleEntityNotFound(_0x2973c3,_0x38c3c6){return function(_0x5c03d4){if(!_0x5c03d4){_0x2973c3['sendStatus'](0x194);}return _0x5c03d4;};}function handleError(_0x322017,_0x1bbd6d){_0x1bbd6d=_0x1bbd6d||0x1f4;return function(_0x46565b){logger[_0xb358('0x2d')](_0x46565b[_0xb358('0x2e')]);if(_0x46565b[_0xb358('0x2f')]){delete _0x46565b[_0xb358('0x2f')];}_0x322017[_0xb358('0x1d')](_0x1bbd6d)[_0xb358('0x30')](_0x46565b);};}exports['index']=function(_0x3e18a2,_0x25bb3a){var _0x19298e={},_0x2581fc={},_0x59f80a={'count':0x0,'rows':[]};var _0x590eb4=_[_0xb358('0x31')](db['CmList']['rawAttributes'],function(_0x42d978){return{'name':_0x42d978[_0xb358('0x32')],'type':_0x42d978[_0xb358('0x33')][_0xb358('0x34')]};});_0x2581fc['model']=_[_0xb358('0x31')](_0x590eb4,_0xb358('0x2f'));_0x2581fc[_0xb358('0x35')]=_[_0xb358('0x36')](_0x3e18a2[_0xb358('0x35')]);_0x2581fc[_0xb358('0x37')]=_[_0xb358('0x38')](_0x2581fc[_0xb358('0x39')],_0x2581fc[_0xb358('0x35')]);_0x19298e[_0xb358('0x3a')]=_['intersection'](_0x2581fc['model'],qs[_0xb358('0x3b')](_0x3e18a2[_0xb358('0x35')][_0xb358('0x3b')]));_0x19298e[_0xb358('0x3a')]=_0x19298e[_0xb358('0x3a')][_0xb358('0x3c')]?_0x19298e[_0xb358('0x3a')]:_0x2581fc['model'];if(!_0x3e18a2[_0xb358('0x35')][_0xb358('0x3d')](_0xb358('0x3e'))){_0x19298e[_0xb358('0x22')]=qs[_0xb358('0x22')](_0x3e18a2[_0xb358('0x35')][_0xb358('0x22')]);_0x19298e[_0xb358('0x21')]=qs[_0xb358('0x21')](_0x3e18a2[_0xb358('0x35')][_0xb358('0x21')]);}_0x19298e[_0xb358('0x3f')]=qs['sort'](_0x3e18a2[_0xb358('0x35')]['sort']);_0x19298e[_0xb358('0x40')]=qs[_0xb358('0x37')](_['pick'](_0x3e18a2[_0xb358('0x35')],_0x2581fc[_0xb358('0x37')]),_0x590eb4);if(_0x3e18a2[_0xb358('0x35')][_0xb358('0x41')]){_0x19298e['where']=_['merge'](_0x19298e['where'],{'$or':_[_0xb358('0x31')](_0x590eb4,function(_0x3da02c){if(_0x3da02c[_0xb358('0x33')]!==_0xb358('0x42')){var _0x51df37={};_0x51df37[_0x3da02c[_0xb358('0x2f')]]={'$like':'%'+_0x3e18a2[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x51df37;}})});}_0x19298e=_[_0xb358('0x43')]({},_0x19298e,_0x3e18a2[_0xb358('0x44')]);var _0x4ae402={'where':_0x19298e['where']};return db['CmList'][_0xb358('0x20')](_0x4ae402)[_0xb358('0x28')](function(_0x519bdc){_0x59f80a[_0xb358('0x20')]=_0x519bdc;if(_0x3e18a2[_0xb358('0x35')][_0xb358('0x45')]){_0x19298e[_0xb358('0x46')]=[{'all':!![]}];}return db[_0xb358('0x47')][_0xb358('0x48')](_0x19298e);})['then'](function(_0x10d09f){_0x59f80a[_0xb358('0x49')]=_0x10d09f;return _0x59f80a;})[_0xb358('0x28')](respondWithFilteredResult(_0x25bb3a,_0x19298e))[_0xb358('0x4a')](handleError(_0x25bb3a,null));};exports[_0xb358('0x4b')]=function(_0x48c451,_0x60b2ca){var _0x464290={'raw':![],'where':{'id':_0x48c451[_0xb358('0x4c')]['id']}},_0x564f08={};_0x564f08[_0xb358('0x39')]=_[_0xb358('0x36')](db['CmList'][_0xb358('0x4d')]);_0x564f08[_0xb358('0x35')]=_[_0xb358('0x36')](_0x48c451[_0xb358('0x35')]);_0x564f08[_0xb358('0x37')]=_[_0xb358('0x38')](_0x564f08[_0xb358('0x39')],_0x564f08[_0xb358('0x35')]);_0x464290['attributes']=_[_0xb358('0x38')](_0x564f08[_0xb358('0x39')],qs[_0xb358('0x3b')](_0x48c451[_0xb358('0x35')]['fields']));_0x464290['attributes']=_0x464290[_0xb358('0x3a')][_0xb358('0x3c')]?_0x464290[_0xb358('0x3a')]:_0x564f08[_0xb358('0x39')];if(_0x48c451[_0xb358('0x35')][_0xb358('0x45')]){_0x464290[_0xb358('0x46')]=[{'all':!![]}];}_0x464290=_[_0xb358('0x43')]({},_0x464290,_0x48c451['options']);return db[_0xb358('0x47')][_0xb358('0x4e')](_0x464290)['then'](handleEntityNotFound(_0x60b2ca,null))[_0xb358('0x28')](respondWithResult(_0x60b2ca,null))[_0xb358('0x4a')](handleError(_0x60b2ca,null));};exports[_0xb358('0x4f')]=function(_0x45e287,_0x5e58a2){return db[_0xb358('0x47')][_0xb358('0x4f')](_0x45e287[_0xb358('0x50')],{})[_0xb358('0x28')](function(_0x38584d){var _0xa29a79=_0x45e287[_0xb358('0x51')][_0xb358('0x2a')]({'plain':!![]});if(!_0xa29a79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa29a79[_0xb358('0x52')]===_0xb358('0x51')){var _0x2d959b=_0x38584d[_0xb358('0x2a')]({'plain':!![]});var _0x3a6d20='Lists';return db[_0xb358('0x53')]['find']({'where':{'name':_0x3a6d20,'userProfileId':_0xa29a79[_0xb358('0x54')]},'raw':!![]})['then'](function(_0x28b28b){if(_0x28b28b&&_0x28b28b[_0xb358('0x55')]===0x0){return db[_0xb358('0x2c')][_0xb358('0x4f')]({'name':_0x2d959b[_0xb358('0x2f')],'resourceId':_0x2d959b['id'],'type':_0x28b28b[_0xb358('0x2f')],'sectionId':_0x28b28b['id']},{})[_0xb358('0x28')](function(){return _0x38584d;});}else{return _0x38584d;}})[_0xb358('0x4a')](function(_0x27bd01){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27bd01);throw _0x27bd01;});}return _0x38584d;})[_0xb358('0x28')](respondWithResult(_0x5e58a2,0xc9))[_0xb358('0x4a')](handleError(_0x5e58a2,null));};exports[_0xb358('0x27')]=function(_0x4b4f46,_0x1fb8a6){if(_0x4b4f46['body']['id']){delete _0x4b4f46[_0xb358('0x50')]['id'];}return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0x4b4f46['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x1fb8a6,null))[_0xb358('0x28')](saveUpdates(_0x4b4f46[_0xb358('0x50')],null))[_0xb358('0x28')](respondWithResult(_0x1fb8a6,null))['catch'](handleError(_0x1fb8a6,null));};exports[_0xb358('0x29')]=function(_0x59290e,_0x2ba23b){return db[_0xb358('0x47')]['find']({'where':{'id':_0x59290e[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x2ba23b,null))[_0xb358('0x28')](removeEntity(_0x2ba23b,null))['catch'](handleError(_0x2ba23b,null));};exports[_0xb358('0x56')]=function(_0x1fdb7e,_0x2f674a){return db['CmList'][_0xb358('0x56')]()[_0xb358('0x28')](respondWithResult(_0x2f674a,null))[_0xb358('0x4a')](handleError(_0x2f674a,null));};exports[_0xb358('0x57')]=function(_0x1d78bd,_0x25a420,_0x5dcd42){if(_0x1d78bd['body']['id']){delete _0x1d78bd[_0xb358('0x50')]['id'];}return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0x1d78bd[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x25a420,null))[_0xb358('0x28')](function(_0x1a76dd){if(_0x1a76dd){_0x1d78bd[_0xb358('0x50')]['ListId']=_0x1a76dd['id'];return db[_0xb358('0x58')][_0xb358('0x4f')](_0x1d78bd['body']);}})[_0xb358('0x28')](respondWithResult(_0x25a420,null))['catch'](handleError(_0x25a420,null));};exports['getDispositions']=function(_0x15f98d,_0x4c2284,_0x1cc733){var _0x52a1da={'raw':![],'where':{}};var _0xc968a3={};var _0x21308e={'count':0x0,'rows':[]};return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x15f98d['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x4c2284,null))[_0xb358('0x28')](function(_0x4ba320){if(_0x4ba320){_0xc968a3[_0xb358('0x39')]=_[_0xb358('0x36')](db['Disposition'][_0xb358('0x4d')]);_0xc968a3['query']=_['keys'](_0x15f98d[_0xb358('0x35')]);_0xc968a3['filters']=_['intersection'](_0xc968a3[_0xb358('0x39')],_0xc968a3[_0xb358('0x35')]);_0x52a1da['attributes']=_['intersection'](_0xc968a3['model'],qs['fields'](_0x15f98d[_0xb358('0x35')][_0xb358('0x3b')]));_0x52a1da[_0xb358('0x3a')]=_0x52a1da['attributes']['length']?_0x52a1da[_0xb358('0x3a')]:_0xc968a3[_0xb358('0x39')];if(!_0x15f98d[_0xb358('0x35')][_0xb358('0x3d')](_0xb358('0x3e'))){_0x52a1da[_0xb358('0x22')]=qs[_0xb358('0x22')](_0x15f98d['query'][_0xb358('0x22')]);_0x52a1da['offset']=qs[_0xb358('0x21')](_0x15f98d[_0xb358('0x35')][_0xb358('0x21')]);}_0x52a1da[_0xb358('0x3f')]=qs[_0xb358('0x5a')](_0x15f98d[_0xb358('0x35')][_0xb358('0x5a')]);_0x52a1da[_0xb358('0x40')]=qs['filters'](_[_0xb358('0x5b')](_0x15f98d['query'],_0xc968a3[_0xb358('0x37')]));_0x52a1da['where'][_0xb358('0x5c')]=_0x4ba320['id'];if(_0x15f98d[_0xb358('0x35')]['filter']){_0x52a1da[_0xb358('0x40')]=_[_0xb358('0x43')](_0x52a1da[_0xb358('0x40')],{'$or':_[_0xb358('0x31')](_0x52a1da['attributes'],function(_0x46832f){var _0x17806a={};_0x17806a[_0x46832f]={'$like':'%'+_0x15f98d[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x17806a;})});}_0x52a1da=_['merge']({},_0x52a1da,_0x15f98d[_0xb358('0x44')]);return db[_0xb358('0x58')][_0xb358('0x20')]({'where':_0x52a1da['where']})[_0xb358('0x28')](function(_0x490d56){_0x21308e['count']=_0x490d56;if(_0x15f98d[_0xb358('0x35')][_0xb358('0x45')]){_0x52a1da[_0xb358('0x46')]=[{'all':!![]}];}return db[_0xb358('0x58')][_0xb358('0x48')](_0x52a1da);})['then'](function(_0x35e292){_0x21308e[_0xb358('0x49')]=_0x35e292;return _0x21308e;});}})[_0xb358('0x28')](respondWithFilteredResult(_0x4c2284,_0x52a1da))[_0xb358('0x4a')](handleError(_0x4c2284,null));};exports[_0xb358('0x5d')]=function(_0x13bdf2,_0xb0d8eb,_0x533529){return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0x13bdf2[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0xb0d8eb,null))['then'](function(_0x210e2f){if(_0x210e2f){return _0x210e2f[_0xb358('0x5d')](_0x13bdf2['query']['ids']);}})[_0xb358('0x28')](respondWithStatusCode(_0xb0d8eb,null))[_0xb358('0x4a')](handleError(_0xb0d8eb,null));};exports[_0xb358('0x5e')]=function(_0x3eda8d,_0x2c6fcf,_0x396a57){return db['CmList'][_0xb358('0x4e')]({'where':{'id':_0x3eda8d[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x2c6fcf,null))[_0xb358('0x28')](function(_0x443872){if(_0x443872){var _0xd04da8=[];var _0x53a85b={'success':[],'errors':[]};return db[_0xb358('0x5f')][_0xb358('0x56')]()[_0xb358('0x28')](function(_0x21b7c9){if(_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')]&&_[_0xb358('0x61')](_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')])){if(_0x3eda8d[_0xb358('0x50')]['tags']['length']){_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')]=_0x3eda8d['body'][_0xb358('0x60')][_0xb358('0x62')](';')+';';}else{_0x3eda8d['body'][_0xb358('0x60')]=null;}}else{_0x3eda8d[_0xb358('0x50')][_0xb358('0x60')]=null;}if(_0x3eda8d['body']&&_[_0xb358('0x61')](_0x3eda8d[_0xb358('0x50')])){for(var _0x44827b=0x0;_0x44827b<_0x3eda8d[_0xb358('0x50')][_0xb358('0x3c')];_0x44827b+=0x1){_0x3eda8d[_0xb358('0x50')][_0x44827b]['ListId']=_0x3eda8d[_0xb358('0x4c')]['id'];_0xd04da8[_0xb358('0x63')](_0x3eda8d[_0xb358('0x50')][_0x44827b]);}return BPromise[_0xb358('0x64')](_0xd04da8,function(_0x4ecb8d){return db[_0xb358('0x5f')][_0xb358('0x4f')](_[_0xb358('0x65')](_0x4ecb8d,['ids','id'])||{},{'fields':_[_0xb358('0x36')](_0x21b7c9),'raw':!![]})[_0xb358('0x28')](function(_0x532e5f){_0x53a85b[_0xb358('0x66')][_0xb358('0x63')](_0x532e5f['dataValues']);})[_0xb358('0x4a')](function(_0x21435a){_0x53a85b[_0xb358('0x67')][_0xb358('0x63')]({'data':_0x4ecb8d,'error':_0x21435a[_0xb358('0x68')]});});})['then'](function(_0x26dad9){return _0x53a85b;})[_0xb358('0x4a')](function(_0x43b75f){return _0x43b75f;});}else{_0x2c6fcf[_0xb358('0x1d')](0x190)[_0xb358('0x25')]({'message':_0xb358('0x69')});}});}})[_0xb358('0x28')](respondWithResult(_0x2c6fcf,null))['catch'](handleError(_0x2c6fcf,null));};exports[_0xb358('0x6a')]=function(_0x27d9a1,_0x29eacc,_0x59b32d){var _0x326853;return db['CmList'][_0xb358('0x4e')]({'where':{'id':_0x27d9a1[_0xb358('0x4c')]['id']},'include':[{'model':db[_0xb358('0x6b')],'as':_0xb358('0x6c')}]})[_0xb358('0x28')](handleEntityNotFound(_0x29eacc,null))['then'](function(_0x28a146){if(_0x28a146){_0x326853=_0x28a146;return db[_0xb358('0x5f')]['rawAttributes'];}})[_0xb358('0x28')](function(_0x3243aa){if(_0x3243aa){var _0x174cc1={};var _0x13e03e={};_0x13e03e[_0xb358('0x39')]=_['concat'](_['keys'](_0x3243aa),_[_0xb358('0x31')](_0x326853[_0xb358('0x6c')],function(_0x37943b){return util[_0xb358('0x6d')](_0xb358('0x6e'),_0x37943b['id']);}));_0x13e03e['query']=_[_0xb358('0x36')](_0x27d9a1['query']);_0x13e03e[_0xb358('0x37')]=_[_0xb358('0x38')](_0x13e03e[_0xb358('0x39')],_0x13e03e[_0xb358('0x35')]);_0x174cc1['attributes']=_[_0xb358('0x38')](_0x13e03e['model'],qs[_0xb358('0x3b')](_0x27d9a1[_0xb358('0x35')]['fields']));_0x174cc1[_0xb358('0x3a')]=_0x174cc1[_0xb358('0x3a')]['length']?_0x174cc1[_0xb358('0x3a')]:_0x13e03e[_0xb358('0x39')];if(!_0x27d9a1['query'][_0xb358('0x3d')](_0xb358('0x3e'))){_0x174cc1[_0xb358('0x22')]=qs['limit'](_0x27d9a1[_0xb358('0x35')][_0xb358('0x22')]);_0x174cc1[_0xb358('0x21')]=qs[_0xb358('0x21')](_0x27d9a1[_0xb358('0x35')][_0xb358('0x21')]);}_0x174cc1[_0xb358('0x3f')]=qs[_0xb358('0x5a')](_0x27d9a1[_0xb358('0x35')][_0xb358('0x5a')]);_0x174cc1[_0xb358('0x40')]=qs[_0xb358('0x37')](_[_0xb358('0x5b')](_0x27d9a1[_0xb358('0x35')],_0x13e03e[_0xb358('0x37')]));_0x174cc1[_0xb358('0x6f')]=!![];if(_0x27d9a1[_0xb358('0x35')][_0xb358('0x41')]){_0x174cc1['where']=_[_0xb358('0x43')](_0x174cc1['where'],{'$or':_[_0xb358('0x31')](_0x174cc1[_0xb358('0x3a')],function(_0x1d24ae){var _0xba932e={};_0xba932e[_0x1d24ae]={'$like':'%'+_0x27d9a1[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0xba932e;})});}_0x174cc1=_[_0xb358('0x43')]({},_0x174cc1,_0x27d9a1[_0xb358('0x44')]);return _0x326853[_0xb358('0x6a')](_0x174cc1);}})[_0xb358('0x28')](respondWithResult(_0x29eacc,null))['catch'](handleError(_0x29eacc,null));};exports[_0xb358('0x70')]=function(_0x4a60d8,_0x152c04,_0x213cda){var _0x2e3267;var _0x2abf91;var _0x2a36fa;var _0x151e3a=_0x4a60d8['params']['id'];csv_results=[];return db[_0xb358('0x71')][_0xb358('0x48')]({'attributes':['id',_0xb358('0x2f')],'raw':!![],'order':[_0xb358('0x72')]})[_0xb358('0x28')](function(_0x35a18c){_0x2e3267=_0x35a18c;var _0x42c01a=_['keys'](db['CmContact'][_0xb358('0x4d')]);return db['CmCustomField'][_0xb358('0x48')]({'raw':!![],'attributes':['id',_0xb358('0x73')]})[_0xb358('0x28')](function(_0x585436){_0x2abf91=_0x585436;var _0x559b3f=squel['select']()[_0xb358('0x3b')](_0x42c01a)['from']('cm_contacts','c')['where']('c.ListId\x20=\x20?',_0x151e3a)[_0xb358('0x40')](_0xb358('0x74'))[_0xb358('0x75')]();for(var _0x3c57d4=0x0;_0x3c57d4<_0x2abf91[_0xb358('0x3c')];_0x3c57d4++){_0x559b3f[_0xb358('0x76')](_0xb358('0x77')+_0x2abf91[_0x3c57d4]['id'],'customField_'+_0x2abf91[_0x3c57d4][_0xb358('0x73')]);}for(var _0x3c57d4=0x0;_0x3c57d4<_0x2e3267[_0xb358('0x3c')];_0x3c57d4++){_0x559b3f['field'](squel[_0xb358('0x78')]()[_0xb358('0x76')]('item')['from']('cm_contact_has_items')['where'](_0xb358('0x79'),_0x2e3267[_0x3c57d4]['id'])['where'](_0xb358('0x7a')),_0xb358('0x7b')+_0x2e3267[_0x3c57d4][_0xb358('0x2f')]);_0x559b3f['field'](squel[_0xb358('0x78')]()[_0xb358('0x76')](_0xb358('0x7c'))[_0xb358('0x7d')](_0xb358('0x7e'))[_0xb358('0x40')]('ItemTypeId\x20=\x20?',_0x2e3267[_0x3c57d4]['id'])[_0xb358('0x40')](_0xb358('0x7a')),_0xb358('0x7f')+_0x2e3267[_0x3c57d4][_0xb358('0x2f')]);}var _0x4b49d4=[];_0x4b49d4[_0xb358('0x63')](_0x559b3f[_0xb358('0x80')]());BPromise['each'](_0x4b49d4,handleQuery)['then'](function(_0x14841f){handleQuery(_0x559b3f[_0xb358('0x80')]());var _0x45885f=csv_results[0x0];if(!_[_0xb358('0x81')](_0x45885f)){var _0x1504cb=toCsv(_0x45885f);var _0x27fb03=Date['now']();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x151e3a,_0x27fb03),_0x1504cb);_0x152c04[_0xb358('0x82')]('Content-disposition',_0xb358('0x83')+util[_0xb358('0x6d')]('list_%d_%s.csv',_0x151e3a,_0x27fb03));_0x152c04['setHeader']('Content-type',_0xb358('0x84'));return _0x152c04[_0xb358('0x85')](util[_0xb358('0x6d')](_0xb358('0x86'),_0x151e3a,_0x27fb03));}else{return _0x152c04[_0xb358('0x1c')](0xcc);}});});});};exports[_0xb358('0x87')]=function(_0x47611f,_0x1f3694,_0x5663fe){var _0x41ad1a;delete _0x47611f[_0xb358('0x50')]['id'];return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x47611f['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x1f3694,null))[_0xb358('0x28')](function(_0x16f7f9){if(_0x16f7f9){return db[_0xb358('0x88')]['transaction'](function(_0x37b872){return db[_0xb358('0x6b')][_0xb358('0x4f')](_0x47611f[_0xb358('0x50')],{'transaction':_0x37b872})[_0xb358('0x28')](function(_0x2f3ca5){_0x41ad1a=_0x2f3ca5;return _0x16f7f9['addCustomFields'](_0x2f3ca5,{'transaction':_0x37b872});})['then'](function(){var _0x3b3d94={'type':db['Sequelize'][_0xb358('0x89')],'transaction':_0x37b872};switch(_0x47611f['body']['type']){case'text':_0x3b3d94[_0xb358('0x33')]=db[_0xb358('0x8a')]['TEXT'];break;case _0xb358('0x8b'):_0x3b3d94[_0xb358('0x33')]=db[_0xb358('0x8a')][_0xb358('0x8c')];break;case'switch':_0x3b3d94['type']=db[_0xb358('0x8a')][_0xb358('0x8d')];_0x3b3d94[_0xb358('0x8e')]=![];break;default:}return db[_0xb358('0x88')][_0xb358('0x8f')][_0xb358('0x90')]('cm_contacts',util['format'](_0xb358('0x91'),_0x41ad1a['id']),_0x3b3d94);})[_0xb358('0x28')](function(){return _0x41ad1a;});});}})[_0xb358('0x28')](respondWithResult(_0x1f3694,null))[_0xb358('0x4a')](handleError(_0x1f3694,null));};exports[_0xb358('0x92')]=function(_0x1c0c0e,_0x43af1c,_0x52f0eb){var _0x5a5f22={};var _0x320bc1={};var _0x285713;var _0x4eabd5;return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x1c0c0e[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x43af1c,null))[_0xb358('0x28')](function(_0x3a40ab){if(_0x3a40ab){_0x285713=_0x3a40ab;_0x320bc1[_0xb358('0x39')]=_[_0xb358('0x36')](db[_0xb358('0x6b')][_0xb358('0x4d')]);_0x320bc1['query']=_[_0xb358('0x36')](_0x1c0c0e['query']);_0x320bc1['filters']=_[_0xb358('0x38')](_0x320bc1[_0xb358('0x39')],_0x320bc1['query']);_0x5a5f22['attributes']=_[_0xb358('0x38')](_0x320bc1[_0xb358('0x39')],qs[_0xb358('0x3b')](_0x1c0c0e['query'][_0xb358('0x3b')]));_0x5a5f22[_0xb358('0x3a')]=_0x5a5f22[_0xb358('0x3a')]['length']?_0x5a5f22['attributes']:_0x320bc1[_0xb358('0x39')];_0x5a5f22['order']=qs[_0xb358('0x5a')](_0x1c0c0e['query']['sort']);_0x5a5f22[_0xb358('0x40')]=qs[_0xb358('0x37')](_[_0xb358('0x5b')](_0x1c0c0e[_0xb358('0x35')],_0x320bc1[_0xb358('0x37')]));_0x5a5f22[_0xb358('0x40')]=_[_0xb358('0x43')](_0x5a5f22['where'],{'$or':[{'ListId':_0x3a40ab['id']},{'ListId':null}]});if(_0x1c0c0e[_0xb358('0x35')]['filter']){_0x5a5f22[_0xb358('0x40')]=_['merge'](_0x5a5f22[_0xb358('0x40')],{'$or':_[_0xb358('0x31')](_0x5a5f22[_0xb358('0x3a')],function(_0x1b8425){var _0x53ee27={};_0x53ee27[_0x1b8425]={'$like':'%'+_0x1c0c0e[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x53ee27;})});}_0x5a5f22=_[_0xb358('0x43')]({},_0x5a5f22,_0x1c0c0e[_0xb358('0x44')]);return db[_0xb358('0x6b')]['findAndCountAll'](_0x5a5f22);}})['then'](respondWithResult(_0x43af1c,null))['catch'](handleError(_0x43af1c,null));};exports[_0xb358('0x93')]=function(_0x3fcb20,_0x3783eb){return db['CmCustomField'][_0xb358('0x94')]({'where':{'ListId':null}})[_0xb358('0x28')](handleEntityNotFound(_0x3783eb,null))[_0xb358('0x28')](function(_0x405ac6){return _0x405ac6;})['then'](respondWithResult(_0x3783eb,null))[_0xb358('0x4a')](handleError(_0x3783eb,null));};exports[_0xb358('0x95')]=function(_0x15e775,_0x518960,_0x5d7add){return db[_0xb358('0x47')]['find']({'where':{'id':_0x15e775[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x518960,null))[_0xb358('0x28')](function(_0x5e4a8b){if(_0x5e4a8b){return _0x5e4a8b[_0xb358('0x95')](_0x15e775[_0xb358('0x50')][_0xb358('0x96')],_[_0xb358('0x65')](_0x15e775[_0xb358('0x50')],[_0xb358('0x96'),'id'])||{})['spread'](function(_0x382d08){for(var _0x40baee=0x0;_0x40baee<_0x15e775[_0xb358('0x50')][_0xb358('0x96')]['length'];_0x40baee+=0x1){socket['emit'](_0xb358('0x97'),{'UserId':Number(_0x15e775[_0xb358('0x50')][_0xb358('0x96')][_0x40baee]),'CmListId':Number(_0x15e775['params']['id'])});}return _0x382d08;});}})[_0xb358('0x28')](respondWithResult(_0x518960,null))['catch'](handleError(_0x518960,null));};exports[_0xb358('0x98')]=function(_0xed5a55,_0x111826,_0x566b75){return db[_0xb358('0x47')][_0xb358('0x4e')]({'where':{'id':_0xed5a55['params']['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x111826,null))[_0xb358('0x28')](function(_0x3cc141){if(_0x3cc141){return _0x3cc141[_0xb358('0x98')](_0xed5a55[_0xb358('0x35')][_0xb358('0x96')])[_0xb358('0x28')](function(){if(_[_0xb358('0x61')](_0xed5a55['query'][_0xb358('0x96')])){for(var _0x4d4a65=0x0;_0x4d4a65<_0xed5a55[_0xb358('0x35')][_0xb358('0x96')][_0xb358('0x3c')];_0x4d4a65+=0x1){socket[_0xb358('0x99')](_0xb358('0x9a'),{'UserId':Number(_0xed5a55['query'][_0xb358('0x96')][_0x4d4a65]),'CmListId':Number(_0xed5a55['params']['id'])});}}else{socket['emit'](_0xb358('0x9a'),{'UserId':Number(_0xed5a55[_0xb358('0x35')][_0xb358('0x96')]),'CmListId':Number(_0xed5a55[_0xb358('0x4c')]['id'])});}});}})[_0xb358('0x28')](respondWithStatusCode(_0x111826,null))[_0xb358('0x4a')](handleError(_0x111826,null));};exports[_0xb358('0x9b')]=function(_0x26e1db,_0x4ec369,_0x235e0b){var _0x53fd4c={};var _0x1e415d={};var _0x78fc2b;var _0x25eea5;return db[_0xb358('0x47')][_0xb358('0x59')]({'where':{'id':_0x26e1db[_0xb358('0x4c')]['id']}})[_0xb358('0x28')](handleEntityNotFound(_0x4ec369,null))['then'](function(_0x4d2b46){if(_0x4d2b46){_0x78fc2b=_0x4d2b46;_0x1e415d[_0xb358('0x39')]=_[_0xb358('0x36')](db['User'][_0xb358('0x4d')]);_0x1e415d['query']=_[_0xb358('0x36')](_0x26e1db[_0xb358('0x35')]);_0x1e415d[_0xb358('0x37')]=_[_0xb358('0x38')](_0x1e415d['model'],_0x1e415d[_0xb358('0x35')]);_0x53fd4c[_0xb358('0x3a')]=_['intersection'](_0x1e415d[_0xb358('0x39')],qs['fields'](_0x26e1db[_0xb358('0x35')][_0xb358('0x3b')]));_0x53fd4c[_0xb358('0x3a')]=_0x53fd4c[_0xb358('0x3a')]['length']?_0x53fd4c[_0xb358('0x3a')]:_0x1e415d[_0xb358('0x39')];_0x53fd4c['order']=qs['sort'](_0x26e1db[_0xb358('0x35')][_0xb358('0x5a')]);_0x53fd4c['where']=qs[_0xb358('0x37')](_[_0xb358('0x5b')](_0x26e1db[_0xb358('0x35')],_0x1e415d['filters']));if(_0x26e1db[_0xb358('0x35')][_0xb358('0x41')]){_0x53fd4c[_0xb358('0x40')]=_[_0xb358('0x43')](_0x53fd4c['where'],{'$or':_[_0xb358('0x31')](_0x53fd4c[_0xb358('0x3a')],function(_0x26849c){var _0x4ddc2b={};_0x4ddc2b[_0x26849c]={'$like':'%'+_0x26e1db[_0xb358('0x35')][_0xb358('0x41')]+'%'};return _0x4ddc2b;})});}_0x53fd4c=_[_0xb358('0x43')]({},_0x53fd4c,_0x26e1db[_0xb358('0x44')]);return _0x78fc2b[_0xb358('0x9b')](_0x53fd4c);}})[_0xb358('0x28')](function(_0x5df729){if(_0x5df729){_0x25eea5=_0x5df729['length'];if(!_0x26e1db[_0xb358('0x35')][_0xb358('0x3d')](_0xb358('0x3e'))){_0x53fd4c[_0xb358('0x22')]=qs[_0xb358('0x22')](_0x26e1db['query'][_0xb358('0x22')]);_0x53fd4c[_0xb358('0x21')]=qs[_0xb358('0x21')](_0x26e1db[_0xb358('0x35')]['offset']);}return _0x78fc2b['getAgents'](_0x53fd4c);}})[_0xb358('0x28')](function(_0x2248ff){if(_0x2248ff){return _0x2248ff?{'count':_0x25eea5,'rows':_0x2248ff}:null;}})[_0xb358('0x28')](respondWithResult(_0x4ec369,null))[_0xb358('0x4a')](handleError(_0x4ec369,null));};function handleQuery(_0x3e9ac4){logger['info'](_0x3e9ac4);return db[_0xb358('0x88')][_0xb358('0x35')](_0x3e9ac4)['spread'](function(_0x4b97a0){csv_results[_0xb358('0x63')](_0x4b97a0);})['catch'](function(_0x3b0fac){logger['error'](_0x3b0fac[_0xb358('0x68')]);});}
\ No newline at end of file
+var _0xb19d=['userCmList:save','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','UserProfileResource','error','stack','name','CmList','rawAttributes','fieldName','key','map','query','keys','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','tags','isArray','push','CmContact','omit','ids','dataValues','errors','message','Malformed\x20request\x20syntax','CustomFields','concat','format','cf_%d','nolimit','getContacts','getContactsCsv','ContactItemType','OrderBy','CmCustomField','alias','select','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','toString','isEmpty','now','setHeader','Content-disposition','download','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','spread','emit'];(function(_0x5cf526,_0x39862c){var _0x46a07c=function(_0x1a768f){while(--_0x1a768f){_0x5cf526['push'](_0x5cf526['shift']());}};_0x46a07c(++_0x39862c);}(_0xb19d,0x1dc));var _0xdb19=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0xb19d[_0x337a10];return _0x575f98;};'use strict';var emlformat=require(_0xdb19('0x0'));var rimraf=require(_0xdb19('0x1'));var zipdir=require(_0xdb19('0x2'));var jsonpatch=require(_0xdb19('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdb19('0x4'));var util=require('util');var path=require(_0xdb19('0x5'));var sox=require('sox');var csv=require(_0xdb19('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb19('0x7'));var _=require(_0xdb19('0x8'));var squel=require(_0xdb19('0x9'));var crypto=require(_0xdb19('0xa'));var jsforce=require(_0xdb19('0xb'));var deskjs=require(_0xdb19('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdb19('0xd'));var Papa=require(_0xdb19('0xe'));var Redis=require(_0xdb19('0xf'));var authService=require(_0xdb19('0x10'));var qs=require(_0xdb19('0x11'));var as=require(_0xdb19('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb19('0x13'))(_0xdb19('0x14'));var utils=require(_0xdb19('0x15'));var config=require(_0xdb19('0x16'));var licenseUtil=require(_0xdb19('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xdb19('0x18')]=_[_0xdb19('0x19')](config[_0xdb19('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb19('0x1a'))(new Redis(config[_0xdb19('0x18')]));require(_0xdb19('0x1b'))[_0xdb19('0x1c')](socket);function respondWithStatusCode(_0x11739e,_0x4ac83b){_0x4ac83b=_0x4ac83b||0xcc;return function(_0x6809ac){if(_0x6809ac){return _0x11739e[_0xdb19('0x1d')](_0x4ac83b);}return _0x11739e[_0xdb19('0x1e')](_0x4ac83b)[_0xdb19('0x1f')]();};}function respondWithResult(_0x8cdd1e,_0x41f581){_0x41f581=_0x41f581||0xc8;return function(_0x2f5885){if(_0x2f5885){return _0x8cdd1e[_0xdb19('0x1e')](_0x41f581)[_0xdb19('0x20')](_0x2f5885);}};}function respondWithFilteredResult(_0x4a6381,_0x544708){return function(_0x3d5f57){if(_0x3d5f57){var _0x2ea4c0=typeof _0x544708[_0xdb19('0x21')]==='undefined'&&typeof _0x544708[_0xdb19('0x22')]===_0xdb19('0x23');var _0x1459ae=_0x3d5f57[_0xdb19('0x24')];var _0x387656=_0x2ea4c0?0x0:_0x544708['offset'];var _0xcaee21=_0x2ea4c0?_0x3d5f57[_0xdb19('0x24')]:_0x544708[_0xdb19('0x21')]+_0x544708[_0xdb19('0x22')];var _0x55d67d;if(_0xcaee21>=_0x1459ae){_0xcaee21=_0x1459ae;_0x55d67d=0xc8;}else{_0x55d67d=0xce;}_0x4a6381[_0xdb19('0x1e')](_0x55d67d);return _0x4a6381[_0xdb19('0x25')](_0xdb19('0x26'),_0x387656+'-'+_0xcaee21+'/'+_0x1459ae)['json'](_0x3d5f57);}return null;};}function patchUpdates(_0x4f7100){return function(_0x4eff5f){try{jsonpatch['apply'](_0x4eff5f,_0x4f7100,!![]);}catch(_0xa2772){return BPromise['reject'](_0xa2772);}return _0x4eff5f[_0xdb19('0x27')]();};}function saveUpdates(_0x2aa3b6,_0x4f3d18){return function(_0xcec966){if(_0xcec966){return _0xcec966[_0xdb19('0x28')](_0x2aa3b6)[_0xdb19('0x29')](function(_0x2f2fa9){return _0x2f2fa9;});}return null;};}function removeEntity(_0x21d95a,_0x513850){return function(_0x3f6ea9){if(_0x3f6ea9){return _0x3f6ea9[_0xdb19('0x2a')]()[_0xdb19('0x29')](function(){var _0x2a6d2c=_0x3f6ea9['get']({'plain':!![]});var _0x331c03='Lists';return db[_0xdb19('0x2b')][_0xdb19('0x2a')]({'where':{'type':_0x331c03,'resourceId':_0x2a6d2c['id']}})[_0xdb19('0x29')](function(){return _0x3f6ea9;});})['then'](function(){_0x21d95a['status'](0xcc)[_0xdb19('0x1f')]();});}};}function handleEntityNotFound(_0x1eeb7f,_0x419772){return function(_0x248cc7){if(!_0x248cc7){_0x1eeb7f[_0xdb19('0x1d')](0x194);}return _0x248cc7;};}function handleError(_0x487ac6,_0x278b65){_0x278b65=_0x278b65||0x1f4;return function(_0x188063){logger[_0xdb19('0x2c')](_0x188063[_0xdb19('0x2d')]);if(_0x188063[_0xdb19('0x2e')]){delete _0x188063[_0xdb19('0x2e')];}_0x487ac6['status'](_0x278b65)['send'](_0x188063);};}exports['index']=function(_0x25d3c8,_0x29d79b){var _0x574b6e={},_0x619517={},_0x3f7b2b={'count':0x0,'rows':[]};var _0x2a6449=_['map'](db[_0xdb19('0x2f')][_0xdb19('0x30')],function(_0x36fbdd){return{'name':_0x36fbdd[_0xdb19('0x31')],'type':_0x36fbdd['type'][_0xdb19('0x32')]};});_0x619517['model']=_[_0xdb19('0x33')](_0x2a6449,_0xdb19('0x2e'));_0x619517[_0xdb19('0x34')]=_[_0xdb19('0x35')](_0x25d3c8['query']);_0x619517['filters']=_['intersection'](_0x619517[_0xdb19('0x36')],_0x619517[_0xdb19('0x34')]);_0x574b6e[_0xdb19('0x37')]=_['intersection'](_0x619517[_0xdb19('0x36')],qs[_0xdb19('0x38')](_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x38')]));_0x574b6e['attributes']=_0x574b6e[_0xdb19('0x37')][_0xdb19('0x39')]?_0x574b6e[_0xdb19('0x37')]:_0x619517[_0xdb19('0x36')];if(!_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x3a')]('nolimit')){_0x574b6e['limit']=qs['limit'](_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x22')]);_0x574b6e[_0xdb19('0x21')]=qs['offset'](_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x21')]);}_0x574b6e[_0xdb19('0x3b')]=qs[_0xdb19('0x3c')](_0x25d3c8['query'][_0xdb19('0x3c')]);_0x574b6e['where']=qs[_0xdb19('0x3d')](_[_0xdb19('0x3e')](_0x25d3c8['query'],_0x619517[_0xdb19('0x3d')]),_0x2a6449);if(_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x3f')]){_0x574b6e['where']=_[_0xdb19('0x40')](_0x574b6e[_0xdb19('0x41')],{'$or':_[_0xdb19('0x33')](_0x2a6449,function(_0x25936a){if(_0x25936a['type']!==_0xdb19('0x42')){var _0x15e3aa={};_0x15e3aa[_0x25936a[_0xdb19('0x2e')]]={'$like':'%'+_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x3f')]+'%'};return _0x15e3aa;}})});}_0x574b6e=_[_0xdb19('0x40')]({},_0x574b6e,_0x25d3c8[_0xdb19('0x43')]);var _0x50f401={'where':_0x574b6e[_0xdb19('0x41')]};return db['CmList']['count'](_0x50f401)['then'](function(_0x599577){_0x3f7b2b[_0xdb19('0x24')]=_0x599577;if(_0x25d3c8[_0xdb19('0x34')][_0xdb19('0x44')]){_0x574b6e['include']=[{'all':!![]}];}return db[_0xdb19('0x2f')][_0xdb19('0x45')](_0x574b6e);})[_0xdb19('0x29')](function(_0x403d47){_0x3f7b2b[_0xdb19('0x46')]=_0x403d47;return _0x3f7b2b;})[_0xdb19('0x29')](respondWithFilteredResult(_0x29d79b,_0x574b6e))[_0xdb19('0x47')](handleError(_0x29d79b,null));};exports[_0xdb19('0x48')]=function(_0x39e7b9,_0x1c0dc2){var _0x2afc6c={'raw':![],'where':{'id':_0x39e7b9['params']['id']}},_0x50fd24={};_0x50fd24[_0xdb19('0x36')]=_['keys'](db[_0xdb19('0x2f')]['rawAttributes']);_0x50fd24[_0xdb19('0x34')]=_[_0xdb19('0x35')](_0x39e7b9[_0xdb19('0x34')]);_0x50fd24[_0xdb19('0x3d')]=_[_0xdb19('0x49')](_0x50fd24[_0xdb19('0x36')],_0x50fd24['query']);_0x2afc6c[_0xdb19('0x37')]=_[_0xdb19('0x49')](_0x50fd24[_0xdb19('0x36')],qs['fields'](_0x39e7b9[_0xdb19('0x34')]['fields']));_0x2afc6c[_0xdb19('0x37')]=_0x2afc6c[_0xdb19('0x37')]['length']?_0x2afc6c[_0xdb19('0x37')]:_0x50fd24[_0xdb19('0x36')];if(_0x39e7b9[_0xdb19('0x34')]['includeAll']){_0x2afc6c[_0xdb19('0x4a')]=[{'all':!![]}];}_0x2afc6c=_['merge']({},_0x2afc6c,_0x39e7b9['options']);return db['CmList'][_0xdb19('0x4b')](_0x2afc6c)['then'](handleEntityNotFound(_0x1c0dc2,null))[_0xdb19('0x29')](respondWithResult(_0x1c0dc2,null))[_0xdb19('0x47')](handleError(_0x1c0dc2,null));};exports[_0xdb19('0x4c')]=function(_0x31389b,_0x58a96e){return db[_0xdb19('0x2f')]['create'](_0x31389b[_0xdb19('0x4d')],{})[_0xdb19('0x29')](function(_0x374978){var _0x1d0233=_0x31389b[_0xdb19('0x4e')][_0xdb19('0x4f')]({'plain':!![]});if(!_0x1d0233)throw new Error(_0xdb19('0x50'));if(_0x1d0233[_0xdb19('0x51')]===_0xdb19('0x4e')){var _0x55d006=_0x374978[_0xdb19('0x4f')]({'plain':!![]});var _0x31fc9c=_0xdb19('0x52');return db[_0xdb19('0x53')][_0xdb19('0x4b')]({'where':{'name':_0x31fc9c,'userProfileId':_0x1d0233[_0xdb19('0x54')]},'raw':!![]})['then'](function(_0x37cd04){if(_0x37cd04&&_0x37cd04[_0xdb19('0x55')]===0x0){return db['UserProfileResource'][_0xdb19('0x4c')]({'name':_0x55d006[_0xdb19('0x2e')],'resourceId':_0x55d006['id'],'type':_0x37cd04['name'],'sectionId':_0x37cd04['id']},{})[_0xdb19('0x29')](function(){return _0x374978;});}else{return _0x374978;}})[_0xdb19('0x47')](function(_0x37e2c8){logger['error'](_0xdb19('0x56'),_0x37e2c8);throw _0x37e2c8;});}return _0x374978;})[_0xdb19('0x29')](respondWithResult(_0x58a96e,0xc9))['catch'](handleError(_0x58a96e,null));};exports[_0xdb19('0x28')]=function(_0x1a7228,_0x4c3a1c){if(_0x1a7228[_0xdb19('0x4d')]['id']){delete _0x1a7228[_0xdb19('0x4d')]['id'];}return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0x1a7228[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x4c3a1c,null))[_0xdb19('0x29')](saveUpdates(_0x1a7228[_0xdb19('0x4d')],null))[_0xdb19('0x29')](respondWithResult(_0x4c3a1c,null))[_0xdb19('0x47')](handleError(_0x4c3a1c,null));};exports['destroy']=function(_0x4323ca,_0x56fab8){return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0x4323ca[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x56fab8,null))[_0xdb19('0x29')](removeEntity(_0x56fab8,null))['catch'](handleError(_0x56fab8,null));};exports[_0xdb19('0x58')]=function(_0x2150f0,_0x4a1afe){return db[_0xdb19('0x2f')]['describe']()[_0xdb19('0x29')](respondWithResult(_0x4a1afe,null))[_0xdb19('0x47')](handleError(_0x4a1afe,null));};exports[_0xdb19('0x59')]=function(_0x26eef0,_0xa87436,_0x4baf39){if(_0x26eef0[_0xdb19('0x4d')]['id']){delete _0x26eef0['body']['id'];}return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0x26eef0[_0xdb19('0x57')]['id']}})['then'](handleEntityNotFound(_0xa87436,null))[_0xdb19('0x29')](function(_0x53e685){if(_0x53e685){_0x26eef0[_0xdb19('0x4d')][_0xdb19('0x5a')]=_0x53e685['id'];return db[_0xdb19('0x5b')][_0xdb19('0x4c')](_0x26eef0['body']);}})[_0xdb19('0x29')](respondWithResult(_0xa87436,null))[_0xdb19('0x47')](handleError(_0xa87436,null));};exports['getDispositions']=function(_0x85060b,_0x504e51,_0x451369){var _0x24851b={'raw':![],'where':{}};var _0x2af8cb={};var _0x1c7af5={'count':0x0,'rows':[]};return db['CmList'][_0xdb19('0x5c')]({'where':{'id':_0x85060b[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x504e51,null))[_0xdb19('0x29')](function(_0x121358){if(_0x121358){_0x2af8cb[_0xdb19('0x36')]=_[_0xdb19('0x35')](db[_0xdb19('0x5b')][_0xdb19('0x30')]);_0x2af8cb[_0xdb19('0x34')]=_[_0xdb19('0x35')](_0x85060b[_0xdb19('0x34')]);_0x2af8cb[_0xdb19('0x3d')]=_[_0xdb19('0x49')](_0x2af8cb['model'],_0x2af8cb[_0xdb19('0x34')]);_0x24851b[_0xdb19('0x37')]=_[_0xdb19('0x49')](_0x2af8cb['model'],qs['fields'](_0x85060b[_0xdb19('0x34')][_0xdb19('0x38')]));_0x24851b[_0xdb19('0x37')]=_0x24851b[_0xdb19('0x37')][_0xdb19('0x39')]?_0x24851b[_0xdb19('0x37')]:_0x2af8cb[_0xdb19('0x36')];if(!_0x85060b['query']['hasOwnProperty']('nolimit')){_0x24851b[_0xdb19('0x22')]=qs[_0xdb19('0x22')](_0x85060b['query'][_0xdb19('0x22')]);_0x24851b['offset']=qs['offset'](_0x85060b[_0xdb19('0x34')][_0xdb19('0x21')]);}_0x24851b[_0xdb19('0x3b')]=qs[_0xdb19('0x3c')](_0x85060b[_0xdb19('0x34')][_0xdb19('0x3c')]);_0x24851b[_0xdb19('0x41')]=qs['filters'](_[_0xdb19('0x3e')](_0x85060b['query'],_0x2af8cb[_0xdb19('0x3d')]));_0x24851b[_0xdb19('0x41')][_0xdb19('0x5a')]=_0x121358['id'];if(_0x85060b[_0xdb19('0x34')][_0xdb19('0x3f')]){_0x24851b[_0xdb19('0x41')]=_[_0xdb19('0x40')](_0x24851b[_0xdb19('0x41')],{'$or':_[_0xdb19('0x33')](_0x24851b[_0xdb19('0x37')],function(_0x40b3f2){var _0x57b417={};_0x57b417[_0x40b3f2]={'$like':'%'+_0x85060b['query']['filter']+'%'};return _0x57b417;})});}_0x24851b=_[_0xdb19('0x40')]({},_0x24851b,_0x85060b['options']);return db[_0xdb19('0x5b')][_0xdb19('0x24')]({'where':_0x24851b[_0xdb19('0x41')]})[_0xdb19('0x29')](function(_0x30ec7a){_0x1c7af5[_0xdb19('0x24')]=_0x30ec7a;if(_0x85060b[_0xdb19('0x34')][_0xdb19('0x44')]){_0x24851b[_0xdb19('0x4a')]=[{'all':!![]}];}return db[_0xdb19('0x5b')][_0xdb19('0x45')](_0x24851b);})['then'](function(_0x51a27c){_0x1c7af5[_0xdb19('0x46')]=_0x51a27c;return _0x1c7af5;});}})[_0xdb19('0x29')](respondWithFilteredResult(_0x504e51,_0x24851b))[_0xdb19('0x47')](handleError(_0x504e51,null));};exports[_0xdb19('0x5d')]=function(_0x5f3fd3,_0x479989,_0x4640ff){return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0x5f3fd3[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x479989,null))['then'](function(_0x4fd349){if(_0x4fd349){return _0x4fd349[_0xdb19('0x5d')](_0x5f3fd3[_0xdb19('0x34')]['ids']);}})[_0xdb19('0x29')](respondWithStatusCode(_0x479989,null))[_0xdb19('0x47')](handleError(_0x479989,null));};exports['addContacts']=function(_0xc0301e,_0x5f1d00,_0x3afbf3){return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0xc0301e[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x5f1d00,null))['then'](function(_0x34d4a4){if(_0x34d4a4){var _0x47b6ea=[];var _0x2a3362={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xdb19('0x29')](function(_0x3e83a9){if(_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x5e')]&&_[_0xdb19('0x5f')](_0xc0301e[_0xdb19('0x4d')]['tags'])){if(_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x5e')][_0xdb19('0x39')]){_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x5e')]=_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x5e')]['join'](';')+';';}else{_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x5e')]=null;}}else{_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x5e')]=null;}if(_0xc0301e[_0xdb19('0x4d')]&&_[_0xdb19('0x5f')](_0xc0301e['body'])){for(var _0x4a3442=0x0;_0x4a3442<_0xc0301e[_0xdb19('0x4d')][_0xdb19('0x39')];_0x4a3442+=0x1){_0xc0301e['body'][_0x4a3442][_0xdb19('0x5a')]=_0xc0301e[_0xdb19('0x57')]['id'];_0x47b6ea[_0xdb19('0x60')](_0xc0301e[_0xdb19('0x4d')][_0x4a3442]);}return BPromise['each'](_0x47b6ea,function(_0x58ce68){return db[_0xdb19('0x61')][_0xdb19('0x4c')](_[_0xdb19('0x62')](_0x58ce68,[_0xdb19('0x63'),'id'])||{},{'fields':_['keys'](_0x3e83a9),'raw':!![]})[_0xdb19('0x29')](function(_0x14b5b9){_0x2a3362['success']['push'](_0x14b5b9[_0xdb19('0x64')]);})['catch'](function(_0x3b8be8){_0x2a3362[_0xdb19('0x65')][_0xdb19('0x60')]({'data':_0x58ce68,'error':_0x3b8be8[_0xdb19('0x66')]});});})[_0xdb19('0x29')](function(_0x166edb){return _0x2a3362;})[_0xdb19('0x47')](function(_0x239252){return _0x239252;});}else{_0x5f1d00['status'](0x190)['json']({'message':_0xdb19('0x67')});}});}})[_0xdb19('0x29')](respondWithResult(_0x5f1d00,null))[_0xdb19('0x47')](handleError(_0x5f1d00,null));};exports['getContacts']=function(_0x172370,_0x2f1918,_0x55d1e0){var _0x709a2a;return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0x172370['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xdb19('0x68')}]})[_0xdb19('0x29')](handleEntityNotFound(_0x2f1918,null))[_0xdb19('0x29')](function(_0x15e234){if(_0x15e234){_0x709a2a=_0x15e234;return db[_0xdb19('0x61')][_0xdb19('0x30')];}})[_0xdb19('0x29')](function(_0x14f6d9){if(_0x14f6d9){var _0x8bc4d={};var _0x2615e0={};_0x2615e0[_0xdb19('0x36')]=_[_0xdb19('0x69')](_[_0xdb19('0x35')](_0x14f6d9),_['map'](_0x709a2a[_0xdb19('0x68')],function(_0x587827){return util[_0xdb19('0x6a')](_0xdb19('0x6b'),_0x587827['id']);}));_0x2615e0[_0xdb19('0x34')]=_[_0xdb19('0x35')](_0x172370[_0xdb19('0x34')]);_0x2615e0[_0xdb19('0x3d')]=_[_0xdb19('0x49')](_0x2615e0[_0xdb19('0x36')],_0x2615e0['query']);_0x8bc4d[_0xdb19('0x37')]=_[_0xdb19('0x49')](_0x2615e0[_0xdb19('0x36')],qs[_0xdb19('0x38')](_0x172370['query'][_0xdb19('0x38')]));_0x8bc4d[_0xdb19('0x37')]=_0x8bc4d[_0xdb19('0x37')]['length']?_0x8bc4d['attributes']:_0x2615e0[_0xdb19('0x36')];if(!_0x172370[_0xdb19('0x34')][_0xdb19('0x3a')](_0xdb19('0x6c'))){_0x8bc4d[_0xdb19('0x22')]=qs[_0xdb19('0x22')](_0x172370[_0xdb19('0x34')][_0xdb19('0x22')]);_0x8bc4d[_0xdb19('0x21')]=qs[_0xdb19('0x21')](_0x172370[_0xdb19('0x34')][_0xdb19('0x21')]);}_0x8bc4d[_0xdb19('0x3b')]=qs[_0xdb19('0x3c')](_0x172370[_0xdb19('0x34')][_0xdb19('0x3c')]);_0x8bc4d[_0xdb19('0x41')]=qs[_0xdb19('0x3d')](_[_0xdb19('0x3e')](_0x172370[_0xdb19('0x34')],_0x2615e0[_0xdb19('0x3d')]));_0x8bc4d['raw']=!![];if(_0x172370[_0xdb19('0x34')][_0xdb19('0x3f')]){_0x8bc4d[_0xdb19('0x41')]=_['merge'](_0x8bc4d[_0xdb19('0x41')],{'$or':_[_0xdb19('0x33')](_0x8bc4d[_0xdb19('0x37')],function(_0x212c3f){var _0x131de8={};_0x131de8[_0x212c3f]={'$like':'%'+_0x172370['query'][_0xdb19('0x3f')]+'%'};return _0x131de8;})});}_0x8bc4d=_['merge']({},_0x8bc4d,_0x172370['options']);return _0x709a2a[_0xdb19('0x6d')](_0x8bc4d);}})['then'](respondWithResult(_0x2f1918,null))[_0xdb19('0x47')](handleError(_0x2f1918,null));};exports[_0xdb19('0x6e')]=function(_0x48e855,_0x53da11,_0x575c59){var _0x385423;var _0x45c3ef;var _0x4dd83b;var _0x55be39=_0x48e855[_0xdb19('0x57')]['id'];csv_results=[];return db[_0xdb19('0x6f')]['findAll']({'attributes':['id','name'],'raw':!![],'order':[_0xdb19('0x70')]})[_0xdb19('0x29')](function(_0x792b2f){_0x385423=_0x792b2f;var _0x32e3ad=_['keys'](db[_0xdb19('0x61')][_0xdb19('0x30')]);return db[_0xdb19('0x71')][_0xdb19('0x45')]({'raw':!![],'attributes':['id',_0xdb19('0x72')]})['then'](function(_0x5da0c4){_0x45c3ef=_0x5da0c4;var _0x4703af=squel[_0xdb19('0x73')]()[_0xdb19('0x38')](_0x32e3ad)['from'](_0xdb19('0x74'),'c')[_0xdb19('0x41')]('c.ListId\x20=\x20?',_0x55be39)[_0xdb19('0x41')](_0xdb19('0x75'))['distinct']();for(var _0x4e2600=0x0;_0x4e2600<_0x45c3ef[_0xdb19('0x39')];_0x4e2600++){_0x4703af[_0xdb19('0x76')](_0xdb19('0x77')+_0x45c3ef[_0x4e2600]['id'],_0xdb19('0x78')+_0x45c3ef[_0x4e2600]['alias']);}for(var _0x4e2600=0x0;_0x4e2600<_0x385423[_0xdb19('0x39')];_0x4e2600++){_0x4703af[_0xdb19('0x76')](squel[_0xdb19('0x73')]()['field']('item')[_0xdb19('0x79')](_0xdb19('0x7a'))[_0xdb19('0x41')](_0xdb19('0x7b'),_0x385423[_0x4e2600]['id'])[_0xdb19('0x41')](_0xdb19('0x7c')),_0xdb19('0x7d')+_0x385423[_0x4e2600][_0xdb19('0x2e')]);_0x4703af[_0xdb19('0x76')](squel['select']()[_0xdb19('0x76')]('description')[_0xdb19('0x79')](_0xdb19('0x7a'))['where'](_0xdb19('0x7b'),_0x385423[_0x4e2600]['id'])[_0xdb19('0x41')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x385423[_0x4e2600][_0xdb19('0x2e')]);}var _0x4f3e34=[];_0x4f3e34[_0xdb19('0x60')](_0x4703af[_0xdb19('0x7e')]());BPromise['each'](_0x4f3e34,handleQuery)['then'](function(_0x2333ff){handleQuery(_0x4703af[_0xdb19('0x7e')]());var _0x3a4a03=csv_results[0x0];if(!_[_0xdb19('0x7f')](_0x3a4a03)){var _0x1b5454=toCsv(_0x3a4a03);var _0x4c6d79=Date[_0xdb19('0x80')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x55be39,_0x4c6d79),_0x1b5454);_0x53da11[_0xdb19('0x81')](_0xdb19('0x82'),'attachment;\x20filename='+util[_0xdb19('0x6a')]('list_%d_%s.csv',_0x55be39,_0x4c6d79));_0x53da11[_0xdb19('0x81')]('Content-type','text/csv');return _0x53da11[_0xdb19('0x83')](util['format'](_0xdb19('0x84'),_0x55be39,_0x4c6d79));}else{return _0x53da11[_0xdb19('0x1d')](0xcc);}});});});};exports[_0xdb19('0x85')]=function(_0x5ff44b,_0x292f58,_0x2230a7){var _0x50c3fa;delete _0x5ff44b[_0xdb19('0x4d')]['id'];return db['CmList']['findOne']({'where':{'id':_0x5ff44b[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x292f58,null))[_0xdb19('0x29')](function(_0x17e54e){if(_0x17e54e){return db['sequelize']['transaction'](function(_0x1d0d3a){return db[_0xdb19('0x71')][_0xdb19('0x4c')](_0x5ff44b['body'],{'transaction':_0x1d0d3a})['then'](function(_0x16cc30){_0x50c3fa=_0x16cc30;return _0x17e54e[_0xdb19('0x86')](_0x16cc30,{'transaction':_0x1d0d3a});})['then'](function(){var _0x159926={'type':db[_0xdb19('0x87')][_0xdb19('0x88')],'transaction':_0x1d0d3a};switch(_0x5ff44b[_0xdb19('0x4d')][_0xdb19('0x89')]){case _0xdb19('0x8a'):_0x159926['type']=db[_0xdb19('0x87')][_0xdb19('0x88')];break;case _0xdb19('0x8b'):_0x159926[_0xdb19('0x89')]=db['Sequelize'][_0xdb19('0x8c')];break;case _0xdb19('0x8d'):_0x159926[_0xdb19('0x89')]=db[_0xdb19('0x87')][_0xdb19('0x8e')];_0x159926['defaultValue']=![];break;default:}return db[_0xdb19('0x8f')][_0xdb19('0x90')][_0xdb19('0x91')](_0xdb19('0x74'),util[_0xdb19('0x6a')](_0xdb19('0x92'),_0x50c3fa['id']),_0x159926);})[_0xdb19('0x29')](function(){return _0x50c3fa;});});}})[_0xdb19('0x29')](respondWithResult(_0x292f58,null))['catch'](handleError(_0x292f58,null));};exports[_0xdb19('0x93')]=function(_0x535718,_0x1ced36,_0x4dd1d6){var _0x185284={};var _0x52cbf2={};var _0x25c484;var _0x42fd7c;return db[_0xdb19('0x2f')][_0xdb19('0x5c')]({'where':{'id':_0x535718[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x1ced36,null))['then'](function(_0x65a930){if(_0x65a930){_0x25c484=_0x65a930;_0x52cbf2[_0xdb19('0x36')]=_[_0xdb19('0x35')](db[_0xdb19('0x71')][_0xdb19('0x30')]);_0x52cbf2[_0xdb19('0x34')]=_[_0xdb19('0x35')](_0x535718[_0xdb19('0x34')]);_0x52cbf2[_0xdb19('0x3d')]=_[_0xdb19('0x49')](_0x52cbf2[_0xdb19('0x36')],_0x52cbf2[_0xdb19('0x34')]);_0x185284[_0xdb19('0x37')]=_['intersection'](_0x52cbf2[_0xdb19('0x36')],qs[_0xdb19('0x38')](_0x535718[_0xdb19('0x34')][_0xdb19('0x38')]));_0x185284['attributes']=_0x185284[_0xdb19('0x37')][_0xdb19('0x39')]?_0x185284['attributes']:_0x52cbf2[_0xdb19('0x36')];_0x185284['order']=qs['sort'](_0x535718[_0xdb19('0x34')][_0xdb19('0x3c')]);_0x185284[_0xdb19('0x41')]=qs['filters'](_[_0xdb19('0x3e')](_0x535718[_0xdb19('0x34')],_0x52cbf2[_0xdb19('0x3d')]));_0x185284[_0xdb19('0x41')]=_['merge'](_0x185284[_0xdb19('0x41')],{'$or':[{'ListId':_0x65a930['id']},{'ListId':null}]});if(_0x535718[_0xdb19('0x34')][_0xdb19('0x3f')]){_0x185284[_0xdb19('0x41')]=_['merge'](_0x185284[_0xdb19('0x41')],{'$or':_[_0xdb19('0x33')](_0x185284['attributes'],function(_0x174d29){var _0x4dbc8d={};_0x4dbc8d[_0x174d29]={'$like':'%'+_0x535718[_0xdb19('0x34')][_0xdb19('0x3f')]+'%'};return _0x4dbc8d;})});}_0x185284=_['merge']({},_0x185284,_0x535718[_0xdb19('0x43')]);return db[_0xdb19('0x71')][_0xdb19('0x94')](_0x185284);}})[_0xdb19('0x29')](respondWithResult(_0x1ced36,null))['catch'](handleError(_0x1ced36,null));};exports[_0xdb19('0x95')]=function(_0xe8fba5,_0x9c96ed){return db[_0xdb19('0x71')][_0xdb19('0x94')]({'where':{'ListId':null}})[_0xdb19('0x29')](handleEntityNotFound(_0x9c96ed,null))['then'](function(_0x42999b){return _0x42999b;})[_0xdb19('0x29')](respondWithResult(_0x9c96ed,null))[_0xdb19('0x47')](handleError(_0x9c96ed,null));};exports['addAgents']=function(_0x12f279,_0x86d218,_0x2ce8f8){return db[_0xdb19('0x2f')]['find']({'where':{'id':_0x12f279[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x86d218,null))[_0xdb19('0x29')](function(_0x5cdb53){if(_0x5cdb53){return _0x5cdb53['addAgents'](_0x12f279[_0xdb19('0x4d')][_0xdb19('0x63')],_[_0xdb19('0x62')](_0x12f279[_0xdb19('0x4d')],[_0xdb19('0x63'),'id'])||{})[_0xdb19('0x96')](function(_0x403df0){for(var _0x5e2bea=0x0;_0x5e2bea<_0x12f279['body'][_0xdb19('0x63')][_0xdb19('0x39')];_0x5e2bea+=0x1){socket[_0xdb19('0x97')](_0xdb19('0x98'),{'UserId':Number(_0x12f279[_0xdb19('0x4d')][_0xdb19('0x63')][_0x5e2bea]),'CmListId':Number(_0x12f279[_0xdb19('0x57')]['id'])});}return _0x403df0;});}})[_0xdb19('0x29')](respondWithResult(_0x86d218,null))[_0xdb19('0x47')](handleError(_0x86d218,null));};exports['removeAgents']=function(_0x1d8c6a,_0x12ead4,_0x4c350e){return db[_0xdb19('0x2f')][_0xdb19('0x4b')]({'where':{'id':_0x1d8c6a[_0xdb19('0x57')]['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x12ead4,null))[_0xdb19('0x29')](function(_0x2709a5){if(_0x2709a5){return _0x2709a5['removeAgents'](_0x1d8c6a[_0xdb19('0x34')][_0xdb19('0x63')])['then'](function(){if(_[_0xdb19('0x5f')](_0x1d8c6a[_0xdb19('0x34')][_0xdb19('0x63')])){for(var _0x46f79d=0x0;_0x46f79d<_0x1d8c6a[_0xdb19('0x34')][_0xdb19('0x63')][_0xdb19('0x39')];_0x46f79d+=0x1){socket[_0xdb19('0x97')](_0xdb19('0x99'),{'UserId':Number(_0x1d8c6a[_0xdb19('0x34')][_0xdb19('0x63')][_0x46f79d]),'CmListId':Number(_0x1d8c6a['params']['id'])});}}else{socket[_0xdb19('0x97')](_0xdb19('0x99'),{'UserId':Number(_0x1d8c6a['query']['ids']),'CmListId':Number(_0x1d8c6a[_0xdb19('0x57')]['id'])});}});}})[_0xdb19('0x29')](respondWithStatusCode(_0x12ead4,null))[_0xdb19('0x47')](handleError(_0x12ead4,null));};exports[_0xdb19('0x9a')]=function(_0x5c7749,_0x506ce8,_0x583e34){var _0x8341d4={};var _0x261249={};var _0x32ac40;var _0x21d119;return db[_0xdb19('0x2f')][_0xdb19('0x5c')]({'where':{'id':_0x5c7749['params']['id']}})[_0xdb19('0x29')](handleEntityNotFound(_0x506ce8,null))[_0xdb19('0x29')](function(_0x4580cd){if(_0x4580cd){_0x32ac40=_0x4580cd;_0x261249['model']=_[_0xdb19('0x35')](db[_0xdb19('0x9b')][_0xdb19('0x30')]);_0x261249[_0xdb19('0x34')]=_[_0xdb19('0x35')](_0x5c7749['query']);_0x261249[_0xdb19('0x3d')]=_[_0xdb19('0x49')](_0x261249[_0xdb19('0x36')],_0x261249[_0xdb19('0x34')]);_0x8341d4[_0xdb19('0x37')]=_['intersection'](_0x261249[_0xdb19('0x36')],qs[_0xdb19('0x38')](_0x5c7749['query'][_0xdb19('0x38')]));_0x8341d4[_0xdb19('0x37')]=_0x8341d4[_0xdb19('0x37')][_0xdb19('0x39')]?_0x8341d4[_0xdb19('0x37')]:_0x261249[_0xdb19('0x36')];_0x8341d4['order']=qs[_0xdb19('0x3c')](_0x5c7749[_0xdb19('0x34')][_0xdb19('0x3c')]);_0x8341d4[_0xdb19('0x41')]=qs[_0xdb19('0x3d')](_[_0xdb19('0x3e')](_0x5c7749[_0xdb19('0x34')],_0x261249[_0xdb19('0x3d')]));if(_0x5c7749[_0xdb19('0x34')]['filter']){_0x8341d4[_0xdb19('0x41')]=_[_0xdb19('0x40')](_0x8341d4[_0xdb19('0x41')],{'$or':_[_0xdb19('0x33')](_0x8341d4[_0xdb19('0x37')],function(_0x34a685){var _0x50a69e={};_0x50a69e[_0x34a685]={'$like':'%'+_0x5c7749['query']['filter']+'%'};return _0x50a69e;})});}_0x8341d4=_[_0xdb19('0x40')]({},_0x8341d4,_0x5c7749[_0xdb19('0x43')]);return _0x32ac40[_0xdb19('0x9a')](_0x8341d4);}})[_0xdb19('0x29')](function(_0x50416f){if(_0x50416f){_0x21d119=_0x50416f[_0xdb19('0x39')];if(!_0x5c7749['query'][_0xdb19('0x3a')](_0xdb19('0x6c'))){_0x8341d4['limit']=qs[_0xdb19('0x22')](_0x5c7749[_0xdb19('0x34')][_0xdb19('0x22')]);_0x8341d4[_0xdb19('0x21')]=qs[_0xdb19('0x21')](_0x5c7749[_0xdb19('0x34')][_0xdb19('0x21')]);}return _0x32ac40[_0xdb19('0x9a')](_0x8341d4);}})[_0xdb19('0x29')](function(_0x34827a){if(_0x34827a){return _0x34827a?{'count':_0x21d119,'rows':_0x34827a}:null;}})['then'](respondWithResult(_0x506ce8,null))[_0xdb19('0x47')](handleError(_0x506ce8,null));};function handleQuery(_0x3ef50e){logger[_0xdb19('0x9c')](_0x3ef50e);return db[_0xdb19('0x8f')][_0xdb19('0x34')](_0x3ef50e)[_0xdb19('0x96')](function(_0x5d8315){csv_results[_0xdb19('0x60')](_0x5d8315);})[_0xdb19('0x47')](function(_0x253445){logger[_0xdb19('0x2c')](_0x253445['message']);});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x53d01b,_0x1d5d9c){var _0x5973bd=function(_0x210bc1){while(--_0x210bc1){_0x53d01b['push'](_0x53d01b['shift']());}};_0x5973bd(++_0x1d5d9c);}(_0x814b,0x1a2));var _0xb814=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x814b[_0x2850c0];return _0x21e830;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
+var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x200427,_0x5119c3){var _0x88b56b=function(_0x105743){while(--_0x105743){_0x200427['push'](_0x200427['shift']());}};_0x88b56b(++_0x5119c3);}(_0x814b,0x1a2));var _0xb814=function(_0x499d15,_0x5376c1){_0x499d15=_0x499d15-0x0;var _0x189291=_0x814b[_0x499d15];return _0x189291;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x3686a6,_0x4adc12){var _0x51e284=function(_0x2f2613){while(--_0x2f2613){_0x3686a6['push'](_0x3686a6['shift']());}};_0x51e284(++_0x4adc12);}(_0x2dae,0xc3));var _0xe2da=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x2dae[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x369811,_0x37e9df){var _0x1de129=function(_0x4b0969){while(--_0x4b0969){_0x369811['push'](_0x369811['shift']());}};_0x1de129(++_0x37e9df);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0xe5b5[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf812=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','then','request\x20sent','debug','error','CmList,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf812,0x10b));var _0x2f81=function(_0x560fdb,_0xe678c1){_0x560fdb=_0x560fdb-0x0;var _0x18ef38=_0xf812[_0x560fdb];return _0x18ef38;};'use strict';var _=require(_0x2f81('0x0'));var util=require('util');var moment=require(_0x2f81('0x1'));var BPromise=require(_0x2f81('0x2'));var rs=require(_0x2f81('0x3'));var fs=require('fs');var Redis=require(_0x2f81('0x4'));var db=require(_0x2f81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f81('0x6'))(_0x2f81('0x7'));var config=require(_0x2f81('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2f81('0x9')][_0x2f81('0xa')]({'port':0x232a});config[_0x2f81('0xb')]=_[_0x2f81('0xc')](config[_0x2f81('0xb')],{'host':_0x2f81('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f81('0xb')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x3cd2e9,_0x4c6436,_0x2f0819){return new BPromise(function(_0x38eb3b,_0x1d9cfd){return client['request'](_0x3cd2e9,_0x2f0819)[_0x2f81('0xe')](function(_0x54699d){logger['info']('CmList,\x20%s,\x20%s',_0x4c6436,_0x2f81('0xf'));logger[_0x2f81('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0x4c6436,_0x2f81('0xf'),JSON['stringify'](_0x54699d));if(_0x54699d[_0x2f81('0x11')]){if(_0x54699d[_0x2f81('0x11')]['code']===0x1f4){logger[_0x2f81('0x11')](_0x2f81('0x12'),_0x4c6436,_0x54699d[_0x2f81('0x11')][_0x2f81('0x13')]);return _0x1d9cfd(_0x54699d[_0x2f81('0x11')]['message']);}logger['error'](_0x2f81('0x12'),_0x4c6436,_0x54699d['error'][_0x2f81('0x13')]);return _0x38eb3b(_0x54699d[_0x2f81('0x11')]['message']);}else{logger['info'](_0x2f81('0x12'),_0x4c6436,_0x2f81('0xf'));_0x38eb3b(_0x54699d['result']['message']);}})[_0x2f81('0x14')](function(_0x5565b5){logger[_0x2f81('0x11')](_0x2f81('0x12'),_0x4c6436,_0x5565b5);_0x1d9cfd(_0x5565b5);});});}
\ No newline at end of file
+var _0x6ef1=['message','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a7862,_0x5d456d){var _0x1e2629=function(_0x3f6459){while(--_0x3f6459){_0x5a7862['push'](_0x5a7862['shift']());}};_0x1e2629(++_0x5d456d);}(_0x6ef1,0x112));var _0x16ef=function(_0x3a354c,_0x2df08a){_0x3a354c=_0x3a354c-0x0;var _0x56908b=_0x6ef1[_0x3a354c];return _0x56908b;};'use strict';var _=require('lodash');var util=require(_0x16ef('0x0'));var moment=require('moment');var BPromise=require(_0x16ef('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x16ef('0x2'));var logger=require(_0x16ef('0x3'))(_0x16ef('0x4'));var config=require(_0x16ef('0x5'));var jayson=require(_0x16ef('0x6'));var client=jayson[_0x16ef('0x7')]['http']({'port':0x232a});config[_0x16ef('0x8')]=_[_0x16ef('0x9')](config[_0x16ef('0x8')],{'host':_0x16ef('0xa'),'port':0x18eb});var socket=require(_0x16ef('0xb'))(new Redis(config[_0x16ef('0x8')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x35a175,_0x247b9e,_0x385973){return new BPromise(function(_0x37a6f4,_0x581f2a){return client[_0x16ef('0xc')](_0x35a175,_0x385973)['then'](function(_0x4b401c){logger[_0x16ef('0xd')](_0x16ef('0xe'),_0x247b9e,_0x16ef('0xf'));logger[_0x16ef('0x10')](_0x16ef('0x11'),_0x247b9e,'request\x20sent',JSON[_0x16ef('0x12')](_0x4b401c));if(_0x4b401c[_0x16ef('0x13')]){if(_0x4b401c[_0x16ef('0x13')]['code']===0x1f4){logger['error'](_0x16ef('0xe'),_0x247b9e,_0x4b401c[_0x16ef('0x13')][_0x16ef('0x14')]);return _0x581f2a(_0x4b401c[_0x16ef('0x13')][_0x16ef('0x14')]);}logger[_0x16ef('0x13')](_0x16ef('0xe'),_0x247b9e,_0x4b401c[_0x16ef('0x13')][_0x16ef('0x14')]);return _0x37a6f4(_0x4b401c[_0x16ef('0x13')]['message']);}else{logger[_0x16ef('0xd')](_0x16ef('0xe'),_0x247b9e,_0x16ef('0xf'));_0x37a6f4(_0x4b401c['result'][_0x16ef('0x14')]);}})['catch'](function(_0x146aeb){logger['error']('CmList,\x20%s,\x20%s',_0x247b9e,_0x146aeb);_0x581f2a(_0x146aeb);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0263=['removeListener','register','save','remove','update'];(function(_0x3fea87,_0x5917e4){var _0x5c5a53=function(_0x3b8ceb){while(--_0x3b8ceb){_0x3fea87['push'](_0x3fea87['shift']());}};_0x5c5a53(++_0x5917e4);}(_0x0263,0x75));var _0x3026=function(_0x3e5ec1,_0x3a7e8e){_0x3e5ec1=_0x3e5ec1-0x0;var _0x6c561c=_0x0263[_0x3e5ec1];return _0x6c561c;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3026('0x0'),_0x3026('0x1'),_0x3026('0x2')];function createListener(_0x415ce4,_0x552bc2){return function(_0x24e791){_0x552bc2['emit'](_0x415ce4,_0x24e791);};}function removeListener(_0x1a04bb,_0x445355){return function(){CmListEvents[_0x3026('0x3')](_0x1a04bb,_0x445355);};}exports[_0x3026('0x4')]=function(_0x582e84){for(var _0x2b0923=0x0,_0x5651f5=events['length'];_0x2b0923<_0x5651f5;_0x2b0923++){var _0x2ae3d7=events[_0x2b0923];var _0x2528a7=createListener('cmList:'+_0x2ae3d7,_0x582e84);CmListEvents['on'](_0x2ae3d7,_0x2528a7);}};
\ No newline at end of file
+var _0xfa17=['removeListener','register','cmList:','./cmList.events','save'];(function(_0x242861,_0x5c9dd4){var _0x56ef13=function(_0x49c12c){while(--_0x49c12c){_0x242861['push'](_0x242861['shift']());}};_0x56ef13(++_0x5c9dd4);}(_0xfa17,0x14d));var _0x7fa1=function(_0x553488,_0x10097c){_0x553488=_0x553488-0x0;var _0x28d027=_0xfa17[_0x553488];return _0x28d027;};'use strict';var CmListEvents=require(_0x7fa1('0x0'));var events=[_0x7fa1('0x1'),'remove','update'];function createListener(_0x4a7edb,_0xee56a3){return function(_0x444716){_0xee56a3['emit'](_0x4a7edb,_0x444716);};}function removeListener(_0x3ed09b,_0x10d379){return function(){CmListEvents[_0x7fa1('0x2')](_0x3ed09b,_0x10d379);};}exports[_0x7fa1('0x3')]=function(_0x25aedb){for(var _0x142965=0x0,_0x3055ee=events['length'];_0x142965<_0x3055ee;_0x142965++){var _0x40e2ec=events[_0x142965];var _0x36a003=createListener(_0x7fa1('0x4')+_0x40e2ec,_0x25aedb);CmListEvents['on'](_0x40e2ec,_0x36a003);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08af=['post','create','addDisposition','/:id/contacts','addAgents','put','delete','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0x40354b,_0x16b710){var _0x3021ef=function(_0x36c3a5){while(--_0x36c3a5){_0x40354b['push'](_0x40354b['shift']());}};_0x3021ef(++_0x16b710);}(_0x08af,0xff));var _0xf08a=function(_0x4de2de,_0x2171db){_0x4de2de=_0x4de2de-0x0;var _0x2e3372=_0x08af[_0x4de2de];return _0x2e3372;};'use strict';var multer=require('multer');var util=require(_0xf08a('0x0'));var path=require(_0xf08a('0x1'));var timeout=require('connect-timeout');var express=require(_0xf08a('0x2'));var router=express[_0xf08a('0x3')]();var fs_extra=require(_0xf08a('0x4'));var auth=require(_0xf08a('0x5'));var interaction=require(_0xf08a('0x6'));var config=require(_0xf08a('0x7'));var controller=require('./cmList.controller');router[_0xf08a('0x8')]('/',auth[_0xf08a('0x9')](),controller[_0xf08a('0xa')]);router[_0xf08a('0x8')](_0xf08a('0xb'),auth['isAuthenticated'](),controller[_0xf08a('0xc')]);router[_0xf08a('0x8')](_0xf08a('0xd'),auth['isAuthenticated'](),controller[_0xf08a('0xe')]);router[_0xf08a('0x8')](_0xf08a('0xf'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x10')]);router[_0xf08a('0x8')](_0xf08a('0x11'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x12')]);router[_0xf08a('0x8')]('/:id/contacts',auth[_0xf08a('0x9')](),controller[_0xf08a('0x13')]);router['get'](_0xf08a('0x14'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xf08a('0x8')](_0xf08a('0x15'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x16')]);router[_0xf08a('0x8')](_0xf08a('0x17'),auth['isAuthenticated'](),controller[_0xf08a('0x18')]);router[_0xf08a('0x19')]('/',auth[_0xf08a('0x9')](),controller[_0xf08a('0x1a')]);router['post']('/:id/dispositions',auth[_0xf08a('0x9')](),controller[_0xf08a('0x1b')]);router['post'](_0xf08a('0x1c'),auth[_0xf08a('0x9')](),controller['addContacts']);router[_0xf08a('0x19')]('/:id/fields',auth[_0xf08a('0x9')](),controller['addCustomField']);router[_0xf08a('0x19')](_0xf08a('0x17'),auth['isAuthenticated'](),controller[_0xf08a('0x1d')]);router[_0xf08a('0x1e')](_0xf08a('0xf'),auth[_0xf08a('0x9')](),controller['update']);router[_0xf08a('0x1f')](_0xf08a('0xf'),auth[_0xf08a('0x9')](),controller[_0xf08a('0x20')]);router['delete'](_0xf08a('0x11'),auth[_0xf08a('0x9')](),controller['removeDispositions']);router[_0xf08a('0x1f')](_0xf08a('0x17'),auth['isAuthenticated'](),controller[_0xf08a('0x21')]);module[_0xf08a('0x22')]=router;
\ No newline at end of file
+var _0x907a=['post','addDisposition','addContacts','addCustomField','addAgents','/:id','update','delete','destroy','removeDispositions','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','/describe','describe','get','/global_fields','getGlobalCustomFields','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','create'];(function(_0x22afe9,_0x9a3f34){var _0x55f5b0=function(_0x48144f){while(--_0x48144f){_0x22afe9['push'](_0x22afe9['shift']());}};_0x55f5b0(++_0x9a3f34);}(_0x907a,0xe9));var _0xa907=function(_0x3e9676,_0x3bb97a){_0x3e9676=_0x3e9676-0x0;var _0x6c3022=_0x907a[_0x3e9676];return _0x6c3022;};'use strict';var multer=require('multer');var util=require(_0xa907('0x0'));var path=require(_0xa907('0x1'));var timeout=require(_0xa907('0x2'));var express=require(_0xa907('0x3'));var router=express[_0xa907('0x4')]();var fs_extra=require(_0xa907('0x5'));var auth=require(_0xa907('0x6'));var interaction=require(_0xa907('0x7'));var config=require(_0xa907('0x8'));var controller=require(_0xa907('0x9'));router['get']('/',auth[_0xa907('0xa')](),controller['index']);router['get'](_0xa907('0xb'),auth[_0xa907('0xa')](),controller[_0xa907('0xc')]);router[_0xa907('0xd')](_0xa907('0xe'),auth['isAuthenticated'](),controller[_0xa907('0xf')]);router[_0xa907('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa907('0x10')]);router[_0xa907('0xd')](_0xa907('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xa907('0xd')](_0xa907('0x12'),auth[_0xa907('0xa')](),controller[_0xa907('0x13')]);router[_0xa907('0xd')](_0xa907('0x14'),auth[_0xa907('0xa')](),controller['getContactsCsv']);router[_0xa907('0xd')](_0xa907('0x15'),auth[_0xa907('0xa')](),controller[_0xa907('0x16')]);router['get'](_0xa907('0x17'),auth[_0xa907('0xa')](),controller[_0xa907('0x18')]);router['post']('/',auth[_0xa907('0xa')](),controller[_0xa907('0x19')]);router[_0xa907('0x1a')](_0xa907('0x11'),auth[_0xa907('0xa')](),controller[_0xa907('0x1b')]);router['post'](_0xa907('0x12'),auth['isAuthenticated'](),controller[_0xa907('0x1c')]);router['post'](_0xa907('0x15'),auth[_0xa907('0xa')](),controller[_0xa907('0x1d')]);router[_0xa907('0x1a')](_0xa907('0x17'),auth[_0xa907('0xa')](),controller[_0xa907('0x1e')]);router['put'](_0xa907('0x1f'),auth[_0xa907('0xa')](),controller[_0xa907('0x20')]);router[_0xa907('0x21')](_0xa907('0x1f'),auth[_0xa907('0xa')](),controller[_0xa907('0x22')]);router['delete'](_0xa907('0x11'),auth['isAuthenticated'](),controller[_0xa907('0x23')]);router[_0xa907('0x21')](_0xa907('0x17'),auth[_0xa907('0xa')](),controller[_0xa907('0x24')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef46=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x590ec2,_0x236838){var _0x362434=function(_0xd8de48){while(--_0xd8de48){_0x590ec2['push'](_0x590ec2['shift']());}};_0x362434(++_0x236838);}(_0xef46,0x1f2));var _0x6ef4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xef46[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x6ef4('0x0'));module[_0x6ef4('0x1')]={'name':{'type':Sequelize[_0x6ef4('0x2')],'get':function(_0x18612c){return this[_0x6ef4('0x3')](_0x6ef4('0x4'));}},'field':{'type':Sequelize[_0x6ef4('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x6ef4('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xf211=['exports','field','STRING'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xf211,0xae));var _0x1f21=function(_0x5ccdd5,_0x137596){_0x5ccdd5=_0x5ccdd5-0x0;var _0x2bb303=_0xf211[_0x5ccdd5];return _0x2bb303;};'use strict';var Sequelize=require('sequelize');module[_0x1f21('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f3511){return this['getDataValue'](_0x1f21('0x1'));}},'field':{'type':Sequelize[_0x1f21('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x1f21('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1f21('0x2')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['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','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x36af77,_0x227ccf){var _0x3d98cf=function(_0x20efbe){while(--_0x20efbe){_0x36af77['push'](_0x36af77['shift']());}};_0x3d98cf(++_0x227ccf);}(_0x7a54,0x106));var _0x47a5=function(_0x2cfaa5,_0x2cb7c4){_0x2cfaa5=_0x2cfaa5-0x0;var _0x244c32=_0x7a54[_0x2cfaa5];return _0x244c32;};'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('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['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','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x37dfc0,_0x1609bf){var _0x1cc5ec=function(_0x57d0b2){while(--_0x57d0b2){_0x37dfc0['push'](_0x37dfc0['shift']());}};_0x1cc5ec(++_0x1609bf);}(_0x7a54,0x106));var _0x47a5=function(_0x434a12,_0x25600b){_0x434a12=_0x434a12-0x0;var _0x541bcd=_0x7a54[_0x434a12];return _0x541bcd;};'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('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6197=['exports','define','tools_conditions','../../config/logger','api','bluebird','request-promise','path','./condition.attributes'];(function(_0x257d2e,_0x40507d){var _0x50c7cd=function(_0x3be08a){while(--_0x3be08a){_0x257d2e['push'](_0x257d2e['shift']());}};_0x50c7cd(++_0x40507d);}(_0x6197,0x8a));var _0x7619=function(_0x483448,_0x54957d){_0x483448=_0x483448-0x0;var _0x8be9a=_0x6197[_0x483448];return _0x8be9a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7619('0x0'))(_0x7619('0x1'));var moment=require('moment');var BPromise=require(_0x7619('0x2'));var rp=require(_0x7619('0x3'));var fs=require('fs');var path=require(_0x7619('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7619('0x5'));module[_0x7619('0x6')]=function(_0x12ae6a,_0x115776){return _0x12ae6a[_0x7619('0x7')]('Condition',attributes,{'tableName':_0x7619('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0daa=['../../config/environment','define','tools_conditions','util','api','bluebird','request-promise','rimraf'];(function(_0x101076,_0x5c8f3f){var _0x2d873d=function(_0xac9f4f){while(--_0xac9f4f){_0x101076['push'](_0x101076['shift']());}};_0x2d873d(++_0x5c8f3f);}(_0x0daa,0x1f3));var _0xa0da=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0daa[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa0da('0x0'));var logger=require('../../config/logger')(_0xa0da('0x1'));var moment=require('moment');var BPromise=require(_0xa0da('0x2'));var rp=require(_0xa0da('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0da('0x4'));var config=require(_0xa0da('0x5'));var attributes=require('./condition.attributes');module['exports']=function(_0x40663d,_0x5d4601){return _0x40663d[_0xa0da('0x6')]('Condition',attributes,{'tableName':_0xa0da('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16fc=['stringify','error','Condition,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x348295,_0x3daf50){var _0x32b929=function(_0x621b4a){while(--_0x621b4a){_0x348295['push'](_0x348295['shift']());}};_0x32b929(++_0x3daf50);}(_0x16fc,0x9e));var _0xc16f=function(_0x281cfd,_0x1ce59a){_0x281cfd=_0x281cfd-0x0;var _0x1d42ca=_0x16fc[_0x281cfd];return _0x1d42ca;};'use strict';var _=require(_0xc16f('0x0'));var util=require(_0xc16f('0x1'));var moment=require(_0xc16f('0x2'));var BPromise=require(_0xc16f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc16f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc16f('0x5'))('rpc');var config=require(_0xc16f('0x6'));var jayson=require(_0xc16f('0x7'));var client=jayson[_0xc16f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399ef3,_0x28f356,_0x7baa81){return new BPromise(function(_0x2f74e1,_0x17bd12){return client[_0xc16f('0x9')](_0x399ef3,_0x7baa81)['then'](function(_0xe93f1f){logger[_0xc16f('0xa')]('Condition,\x20%s,\x20%s',_0x28f356,'request\x20sent');logger[_0xc16f('0xb')](_0xc16f('0xc'),_0x28f356,'request\x20sent',JSON[_0xc16f('0xd')](_0xe93f1f));if(_0xe93f1f[_0xc16f('0xe')]){if(_0xe93f1f[_0xc16f('0xe')]['code']===0x1f4){logger[_0xc16f('0xe')](_0xc16f('0xf'),_0x28f356,_0xe93f1f[_0xc16f('0xe')]['message']);return _0x17bd12(_0xe93f1f['error'][_0xc16f('0x10')]);}logger[_0xc16f('0xe')](_0xc16f('0xf'),_0x28f356,_0xe93f1f[_0xc16f('0xe')][_0xc16f('0x10')]);return _0x2f74e1(_0xe93f1f[_0xc16f('0xe')][_0xc16f('0x10')]);}else{logger['info'](_0xc16f('0xf'),_0x28f356,_0xc16f('0x11'));_0x2f74e1(_0xe93f1f['result'][_0xc16f('0x10')]);}})[_0xc16f('0x12')](function(_0xa9ffdb){logger[_0xc16f('0xe')](_0xc16f('0xf'),_0x28f356,_0xa9ffdb);_0x17bd12(_0xa9ffdb);});});}
\ No newline at end of file
+var _0xf5b7=['message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3d22d7,_0x2898c1){var _0x3766e9=function(_0x201fb0){while(--_0x201fb0){_0x3d22d7['push'](_0x3d22d7['shift']());}};_0x3766e9(++_0x2898c1);}(_0xf5b7,0x145));var _0x7f5b=function(_0x519b50,_0x416873){_0x519b50=_0x519b50-0x0;var _0x451046=_0xf5b7[_0x519b50];return _0x451046;};'use strict';var _=require(_0x7f5b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7f5b('0x1'));var rs=require(_0x7f5b('0x2'));var fs=require('fs');var Redis=require(_0x7f5b('0x3'));var db=require(_0x7f5b('0x4'))['db'];var utils=require(_0x7f5b('0x5'));var logger=require(_0x7f5b('0x6'))(_0x7f5b('0x7'));var config=require(_0x7f5b('0x8'));var jayson=require(_0x7f5b('0x9'));var client=jayson[_0x7f5b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x189824,_0x291020,_0x23eab6){return new BPromise(function(_0x181ab4,_0x185271){return client['request'](_0x189824,_0x23eab6)[_0x7f5b('0xb')](function(_0x157237){logger['info'](_0x7f5b('0xc'),_0x291020,'request\x20sent');logger['debug'](_0x7f5b('0xd'),_0x291020,_0x7f5b('0xe'),JSON['stringify'](_0x157237));if(_0x157237[_0x7f5b('0xf')]){if(_0x157237[_0x7f5b('0xf')][_0x7f5b('0x10')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x291020,_0x157237[_0x7f5b('0xf')][_0x7f5b('0x11')]);return _0x185271(_0x157237[_0x7f5b('0xf')][_0x7f5b('0x11')]);}logger['error']('Condition,\x20%s,\x20%s',_0x291020,_0x157237[_0x7f5b('0xf')]['message']);return _0x181ab4(_0x157237['error'][_0x7f5b('0x11')]);}else{logger['info'](_0x7f5b('0xc'),_0x291020,'request\x20sent');_0x181ab4(_0x157237['result']['message']);}})[_0x7f5b('0x12')](function(_0x321c2a){logger['error'](_0x7f5b('0xc'),_0x291020,_0x321c2a);_0x185271(_0x321c2a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6eeb=['../../components/interaction/service','../../config/environment','put','/:id','update','delete','destroy','exports','multer','util','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eeb,0x97));var _0xb6ee=function(_0xf10ab2,_0x4139fa){_0xf10ab2=_0xf10ab2-0x0;var _0x4c6629=_0x6eeb[_0xf10ab2];return _0x4c6629;};'use strict';var multer=require(_0xb6ee('0x0'));var util=require(_0xb6ee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb6ee('0x2'));var interaction=require(_0xb6ee('0x3'));var config=require(_0xb6ee('0x4'));var controller=require('./condition.controller');router[_0xb6ee('0x5')](_0xb6ee('0x6'),auth['isAuthenticated'](),controller[_0xb6ee('0x7')]);router[_0xb6ee('0x8')](_0xb6ee('0x6'),auth['isAuthenticated'](),controller[_0xb6ee('0x9')]);module[_0xb6ee('0xa')]=router;
\ No newline at end of file
+var _0xc0a5=['put','/:id','isAuthenticated','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0x33651a,_0x4dd695){var _0x524faf=function(_0x1bb6a5){while(--_0x1bb6a5){_0x33651a['push'](_0x33651a['shift']());}};_0x524faf(++_0x4dd695);}(_0xc0a5,0x132));var _0x5c0a=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xc0a5[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x5c0a('0x0'));var util=require('util');var path=require(_0x5c0a('0x1'));var timeout=require(_0x5c0a('0x2'));var express=require(_0x5c0a('0x3'));var router=express['Router']();var fs_extra=require(_0x5c0a('0x4'));var auth=require(_0x5c0a('0x5'));var interaction=require(_0x5c0a('0x6'));var config=require(_0x5c0a('0x7'));var controller=require(_0x5c0a('0x8'));router[_0x5c0a('0x9')](_0x5c0a('0xa'),auth[_0x5c0a('0xb')](),controller['update']);router[_0x5c0a('0xc')]('/:id',auth[_0x5c0a('0xb')](),controller[_0x5c0a('0xd')]);module[_0x5c0a('0xe')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ea8=['name','INTEGER','exports','STRING'];(function(_0x39bd1e,_0x443871){var _0x81a2eb=function(_0x17153e){while(--_0x17153e){_0x39bd1e['push'](_0x39bd1e['shift']());}};_0x81a2eb(++_0x443871);}(_0x1ea8,0x19e));var _0x81ea=function(_0x4a00a9,_0x487257){_0x4a00a9=_0x4a00a9-0x0;var _0x46b8d5=_0x1ea8[_0x4a00a9];return _0x46b8d5;};'use strict';var Sequelize=require('sequelize');module[_0x81ea('0x0')]={'name':{'type':Sequelize[_0x81ea('0x1')],'allowNull':![],'unique':_0x81ea('0x2')},'OrderBy':{'type':Sequelize[_0x81ea('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x81ea('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xfa69=['INTEGER','sequelize','exports','STRING'];(function(_0x7bf970,_0x35da28){var _0xeab646=function(_0x4b67ba){while(--_0x4b67ba){_0x7bf970['push'](_0x7bf970['shift']());}};_0xeab646(++_0x35da28);}(_0xfa69,0x1ed));var _0x9fa6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa69[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x9fa6('0x0'));module[_0x9fa6('0x1')]={'name':{'type':Sequelize[_0x9fa6('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x9fa6('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x9fa6('0x2')],'allowNull':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4213=['model','map','query','keys','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','filters','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','destroy','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','get','UserProfileResource','error','name','send','ContactItemType','fieldName','type','key'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x4213,0x77));var _0x3421=function(_0x2c7d91,_0x24c096){_0x2c7d91=_0x2c7d91-0x0;var _0x24ff3f=_0x4213[_0x2c7d91];return _0x24ff3f;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3421('0x12'));var logger=require(_0x3421('0x13'))(_0x3421('0x14'));var utils=require(_0x3421('0x15'));var config=require(_0x3421('0x16'));var licenseUtil=require(_0x3421('0x17'));var db=require(_0x3421('0x18'))['db'];function respondWithStatusCode(_0x59eaf1,_0x26d459){_0x26d459=_0x26d459||0xcc;return function(_0x3e2ecd){if(_0x3e2ecd){return _0x59eaf1[_0x3421('0x19')](_0x26d459);}return _0x59eaf1[_0x3421('0x1a')](_0x26d459)[_0x3421('0x1b')]();};}function respondWithResult(_0x3f4672,_0x25ffd4){_0x25ffd4=_0x25ffd4||0xc8;return function(_0x59ea4a){if(_0x59ea4a){return _0x3f4672[_0x3421('0x1a')](_0x25ffd4)['json'](_0x59ea4a);}};}function respondWithFilteredResult(_0x372d21,_0x5257ad){return function(_0x59ae45){if(_0x59ae45){var _0x1e33ab=typeof _0x5257ad['offset']===_0x3421('0x1c')&&typeof _0x5257ad[_0x3421('0x1d')]==='undefined';var _0x3584d6=_0x59ae45[_0x3421('0x1e')];var _0x130d3c=_0x1e33ab?0x0:_0x5257ad[_0x3421('0x1f')];var _0x18acc1=_0x1e33ab?_0x59ae45[_0x3421('0x1e')]:_0x5257ad[_0x3421('0x1f')]+_0x5257ad[_0x3421('0x1d')];var _0x197b83;if(_0x18acc1>=_0x3584d6){_0x18acc1=_0x3584d6;_0x197b83=0xc8;}else{_0x197b83=0xce;}_0x372d21[_0x3421('0x1a')](_0x197b83);return _0x372d21[_0x3421('0x20')]('Content-Range',_0x130d3c+'-'+_0x18acc1+'/'+_0x3584d6)[_0x3421('0x21')](_0x59ae45);}return null;};}function patchUpdates(_0x4b59a5){return function(_0x5820f6){try{jsonpatch['apply'](_0x5820f6,_0x4b59a5,!![]);}catch(_0x33155b){return BPromise[_0x3421('0x22')](_0x33155b);}return _0x5820f6[_0x3421('0x23')]();};}function saveUpdates(_0x256cc5,_0x132e8e){return function(_0x39bed4){if(_0x39bed4){return _0x39bed4[_0x3421('0x24')](_0x256cc5)[_0x3421('0x25')](function(_0xb9af5f){return _0xb9af5f;});}return null;};}function removeEntity(_0x34389e,_0x48fb3d){return function(_0x57a4af){if(_0x57a4af){return _0x57a4af['destroy']()[_0x3421('0x25')](function(){var _0x958899=_0x57a4af[_0x3421('0x26')]({'plain':!![]});var _0x5bc28a='ContactItemTypes';return db[_0x3421('0x27')]['destroy']({'where':{'type':_0x5bc28a,'resourceId':_0x958899['id']}})[_0x3421('0x25')](function(){return _0x57a4af;});})['then'](function(){_0x34389e[_0x3421('0x1a')](0xcc)[_0x3421('0x1b')]();});}};}function handleEntityNotFound(_0x36d75f,_0x2e6a75){return function(_0x186885){if(!_0x186885){_0x36d75f['sendStatus'](0x194);}return _0x186885;};}function handleError(_0x332017,_0x52fd41){_0x52fd41=_0x52fd41||0x1f4;return function(_0x5efe73){logger[_0x3421('0x28')](_0x5efe73['stack']);if(_0x5efe73['name']){delete _0x5efe73[_0x3421('0x29')];}_0x332017['status'](_0x52fd41)[_0x3421('0x2a')](_0x5efe73);};}exports['index']=function(_0xc7f9fb,_0xbe9f09){var _0x48d828={},_0x3f7c0b={},_0x3bc7c1={'count':0x0,'rows':[]};var _0x420349=_['map'](db[_0x3421('0x2b')]['rawAttributes'],function(_0x2b5af4){return{'name':_0x2b5af4[_0x3421('0x2c')],'type':_0x2b5af4[_0x3421('0x2d')][_0x3421('0x2e')]};});_0x3f7c0b[_0x3421('0x2f')]=_[_0x3421('0x30')](_0x420349,_0x3421('0x29'));_0x3f7c0b[_0x3421('0x31')]=_[_0x3421('0x32')](_0xc7f9fb[_0x3421('0x31')]);_0x3f7c0b['filters']=_['intersection'](_0x3f7c0b[_0x3421('0x2f')],_0x3f7c0b[_0x3421('0x31')]);_0x48d828['attributes']=_[_0x3421('0x33')](_0x3f7c0b[_0x3421('0x2f')],qs[_0x3421('0x34')](_0xc7f9fb[_0x3421('0x31')][_0x3421('0x34')]));_0x48d828['attributes']=_0x48d828[_0x3421('0x35')][_0x3421('0x36')]?_0x48d828[_0x3421('0x35')]:_0x3f7c0b['model'];if(!_0xc7f9fb[_0x3421('0x31')]['hasOwnProperty'](_0x3421('0x37'))){_0x48d828[_0x3421('0x1d')]=qs[_0x3421('0x1d')](_0xc7f9fb[_0x3421('0x31')][_0x3421('0x1d')]);_0x48d828[_0x3421('0x1f')]=qs[_0x3421('0x1f')](_0xc7f9fb['query']['offset']);}_0x48d828['order']=qs[_0x3421('0x38')](_0xc7f9fb['query']['sort']);_0x48d828[_0x3421('0x39')]=qs['filters'](_[_0x3421('0x3a')](_0xc7f9fb[_0x3421('0x31')],_0x3f7c0b['filters']),_0x420349);if(_0xc7f9fb[_0x3421('0x31')][_0x3421('0x3b')]){_0x48d828[_0x3421('0x39')]=_[_0x3421('0x3c')](_0x48d828['where'],{'$or':_[_0x3421('0x30')](_0x420349,function(_0x2745c9){if(_0x2745c9[_0x3421('0x2d')]!==_0x3421('0x3d')){var _0x25de09={};_0x25de09[_0x2745c9['name']]={'$like':'%'+_0xc7f9fb[_0x3421('0x31')][_0x3421('0x3b')]+'%'};return _0x25de09;}})});}_0x48d828=_['merge']({},_0x48d828,_0xc7f9fb[_0x3421('0x3e')]);var _0x5daa14={'where':_0x48d828['where']};return db['ContactItemType'][_0x3421('0x1e')](_0x5daa14)[_0x3421('0x25')](function(_0x41bdb7){_0x3bc7c1[_0x3421('0x1e')]=_0x41bdb7;if(_0xc7f9fb[_0x3421('0x31')][_0x3421('0x3f')]){_0x48d828[_0x3421('0x40')]=[{'all':!![]}];}return db[_0x3421('0x2b')][_0x3421('0x41')](_0x48d828);})[_0x3421('0x25')](function(_0x3b9d15){_0x3bc7c1[_0x3421('0x42')]=_0x3b9d15;return _0x3bc7c1;})[_0x3421('0x25')](respondWithFilteredResult(_0xbe9f09,_0x48d828))[_0x3421('0x43')](handleError(_0xbe9f09,null));};exports['show']=function(_0x3076eb,_0x2e7c59){var _0x139d55={'raw':!![],'where':{'id':_0x3076eb['params']['id']}},_0x4466be={};_0x4466be[_0x3421('0x2f')]=_['keys'](db[_0x3421('0x2b')][_0x3421('0x44')]);_0x4466be[_0x3421('0x31')]=_[_0x3421('0x32')](_0x3076eb[_0x3421('0x31')]);_0x4466be[_0x3421('0x45')]=_[_0x3421('0x33')](_0x4466be[_0x3421('0x2f')],_0x4466be[_0x3421('0x31')]);_0x139d55[_0x3421('0x35')]=_[_0x3421('0x33')](_0x4466be[_0x3421('0x2f')],qs[_0x3421('0x34')](_0x3076eb['query'][_0x3421('0x34')]));_0x139d55['attributes']=_0x139d55[_0x3421('0x35')][_0x3421('0x36')]?_0x139d55[_0x3421('0x35')]:_0x4466be[_0x3421('0x2f')];if(_0x3076eb[_0x3421('0x31')][_0x3421('0x3f')]){_0x139d55[_0x3421('0x40')]=[{'all':!![]}];}_0x139d55=_[_0x3421('0x3c')]({},_0x139d55,_0x3076eb[_0x3421('0x3e')]);return db[_0x3421('0x2b')]['find'](_0x139d55)[_0x3421('0x25')](handleEntityNotFound(_0x2e7c59,null))[_0x3421('0x25')](respondWithResult(_0x2e7c59,null))[_0x3421('0x43')](handleError(_0x2e7c59,null));};exports['create']=function(_0x566f95,_0x43a94f){return db[_0x3421('0x2b')][_0x3421('0x46')](_0x566f95['body'],{})[_0x3421('0x25')](function(_0x18eba6){var _0x213e27=_0x566f95[_0x3421('0x47')]['get']({'plain':!![]});if(!_0x213e27)throw new Error(_0x3421('0x48'));if(_0x213e27[_0x3421('0x49')]===_0x3421('0x47')){var _0x51a21f=_0x18eba6['get']({'plain':!![]});var _0x5a2004=_0x3421('0x4a');return db[_0x3421('0x4b')]['find']({'where':{'name':_0x5a2004,'userProfileId':_0x213e27['userProfileId']},'raw':!![]})[_0x3421('0x25')](function(_0x42934d){if(_0x42934d&&_0x42934d[_0x3421('0x4c')]===0x0){return db[_0x3421('0x27')][_0x3421('0x46')]({'name':_0x51a21f['name'],'resourceId':_0x51a21f['id'],'type':_0x42934d[_0x3421('0x29')],'sectionId':_0x42934d['id']},{})[_0x3421('0x25')](function(){return _0x18eba6;});}else{return _0x18eba6;}})[_0x3421('0x43')](function(_0x2f9ce1){logger['error'](_0x3421('0x4d'),_0x2f9ce1);throw _0x2f9ce1;});}return _0x18eba6;})[_0x3421('0x25')](respondWithResult(_0x43a94f,0xc9))[_0x3421('0x43')](handleError(_0x43a94f,null));};exports['update']=function(_0x5f97d5,_0x5c73ae){if(_0x5f97d5['body']['id']){delete _0x5f97d5[_0x3421('0x4e')]['id'];}return db['ContactItemType'][_0x3421('0x4f')]({'where':{'id':_0x5f97d5[_0x3421('0x50')]['id']}})[_0x3421('0x25')](handleEntityNotFound(_0x5c73ae,null))['then'](saveUpdates(_0x5f97d5[_0x3421('0x4e')],null))[_0x3421('0x25')](respondWithResult(_0x5c73ae,null))[_0x3421('0x43')](handleError(_0x5c73ae,null));};exports[_0x3421('0x51')]=function(_0x1c73b9,_0x4738e7){return db[_0x3421('0x2b')][_0x3421('0x4f')]({'where':{'id':_0x1c73b9[_0x3421('0x50')]['id']}})['then'](handleEntityNotFound(_0x4738e7,null))[_0x3421('0x25')](db[_0x3421('0x52')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1c73b9[_0x3421('0x50')]['id']}}))[_0x3421('0x25')](removeEntity(_0x4738e7,null))[_0x3421('0x43')](handleError(_0x4738e7,null));};
\ No newline at end of file
+var _0xc2c7=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','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'];(function(_0x5c587a,_0x4dba89){var _0x28d19e=function(_0x4e8056){while(--_0x4e8056){_0x5c587a['push'](_0x5c587a['shift']());}};_0x28d19e(++_0x4dba89);}(_0xc2c7,0x134));var _0x7c2c=function(_0x543815,_0x140135){_0x543815=_0x543815-0x0;var _0x4a7e27=_0xc2c7[_0x543815];return _0x4a7e27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){var _0x3126d=_0x57f510['get']({'plain':!![]});var _0x4d6ec7=_0x7c2c('0x27');return db[_0x7c2c('0x28')][_0x7c2c('0x25')]({'where':{'type':_0x4d6ec7,'resourceId':_0x3126d['id']}})[_0x7c2c('0x26')](function(){return _0x57f510;});})[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)[_0x7c2c('0x1b')]();});}};}function handleEntityNotFound(_0x4b1dd0,_0x358c67){return function(_0xf39941){if(!_0xf39941){_0x4b1dd0[_0x7c2c('0x19')](0x194);}return _0xf39941;};}function handleError(_0x22d03f,_0x145788){_0x145788=_0x145788||0x1f4;return function(_0x1f8846){logger[_0x7c2c('0x29')](_0x1f8846[_0x7c2c('0x2a')]);if(_0x1f8846[_0x7c2c('0x2b')]){delete _0x1f8846['name'];}_0x22d03f[_0x7c2c('0x1a')](_0x145788)[_0x7c2c('0x2c')](_0x1f8846);};}exports[_0x7c2c('0x2d')]=function(_0x720667,_0x53ad23){var _0xcb98ba={},_0x30dd1c={},_0x4192c8={'count':0x0,'rows':[]};var _0x1ef88b=_[_0x7c2c('0x2e')](db[_0x7c2c('0x2f')][_0x7c2c('0x30')],function(_0x57af44){return{'name':_0x57af44[_0x7c2c('0x31')],'type':_0x57af44[_0x7c2c('0x32')][_0x7c2c('0x33')]};});_0x30dd1c[_0x7c2c('0x34')]=_[_0x7c2c('0x2e')](_0x1ef88b,'name');_0x30dd1c['query']=_[_0x7c2c('0x35')](_0x720667['query']);_0x30dd1c['filters']=_[_0x7c2c('0x36')](_0x30dd1c[_0x7c2c('0x34')],_0x30dd1c[_0x7c2c('0x37')]);_0xcb98ba[_0x7c2c('0x38')]=_['intersection'](_0x30dd1c[_0x7c2c('0x34')],qs[_0x7c2c('0x39')](_0x720667[_0x7c2c('0x37')][_0x7c2c('0x39')]));_0xcb98ba[_0x7c2c('0x38')]=_0xcb98ba[_0x7c2c('0x38')][_0x7c2c('0x3a')]?_0xcb98ba[_0x7c2c('0x38')]:_0x30dd1c[_0x7c2c('0x34')];if(!_0x720667[_0x7c2c('0x37')][_0x7c2c('0x3b')](_0x7c2c('0x3c'))){_0xcb98ba[_0x7c2c('0x1e')]=qs['limit'](_0x720667['query'][_0x7c2c('0x1e')]);_0xcb98ba['offset']=qs['offset'](_0x720667['query'][_0x7c2c('0x1d')]);}_0xcb98ba[_0x7c2c('0x3d')]=qs[_0x7c2c('0x3e')](_0x720667[_0x7c2c('0x37')][_0x7c2c('0x3e')]);_0xcb98ba[_0x7c2c('0x3f')]=qs[_0x7c2c('0x40')](_[_0x7c2c('0x41')](_0x720667[_0x7c2c('0x37')],_0x30dd1c[_0x7c2c('0x40')]),_0x1ef88b);if(_0x720667[_0x7c2c('0x37')]['filter']){_0xcb98ba['where']=_[_0x7c2c('0x42')](_0xcb98ba[_0x7c2c('0x3f')],{'$or':_[_0x7c2c('0x2e')](_0x1ef88b,function(_0x57bead){if(_0x57bead['type']!==_0x7c2c('0x43')){var _0x19c3fb={};_0x19c3fb[_0x57bead[_0x7c2c('0x2b')]]={'$like':'%'+_0x720667[_0x7c2c('0x37')][_0x7c2c('0x44')]+'%'};return _0x19c3fb;}})});}_0xcb98ba=_[_0x7c2c('0x42')]({},_0xcb98ba,_0x720667[_0x7c2c('0x45')]);var _0x2e4093={'where':_0xcb98ba[_0x7c2c('0x3f')]};return db['ContactItemType'][_0x7c2c('0x1f')](_0x2e4093)['then'](function(_0x2c3f40){_0x4192c8[_0x7c2c('0x1f')]=_0x2c3f40;if(_0x720667['query'][_0x7c2c('0x46')]){_0xcb98ba['include']=[{'all':!![]}];}return db[_0x7c2c('0x2f')][_0x7c2c('0x47')](_0xcb98ba);})[_0x7c2c('0x26')](function(_0x26351e){_0x4192c8['rows']=_0x26351e;return _0x4192c8;})[_0x7c2c('0x26')](respondWithFilteredResult(_0x53ad23,_0xcb98ba))['catch'](handleError(_0x53ad23,null));};exports['show']=function(_0x8f2cfe,_0xd0a1d3){var _0x106a13={'raw':!![],'where':{'id':_0x8f2cfe[_0x7c2c('0x48')]['id']}},_0x4c239b={};_0x4c239b[_0x7c2c('0x34')]=_['keys'](db[_0x7c2c('0x2f')]['rawAttributes']);_0x4c239b[_0x7c2c('0x37')]=_[_0x7c2c('0x35')](_0x8f2cfe['query']);_0x4c239b['filters']=_[_0x7c2c('0x36')](_0x4c239b[_0x7c2c('0x34')],_0x4c239b['query']);_0x106a13[_0x7c2c('0x38')]=_['intersection'](_0x4c239b['model'],qs[_0x7c2c('0x39')](_0x8f2cfe[_0x7c2c('0x37')][_0x7c2c('0x39')]));_0x106a13[_0x7c2c('0x38')]=_0x106a13[_0x7c2c('0x38')][_0x7c2c('0x3a')]?_0x106a13[_0x7c2c('0x38')]:_0x4c239b[_0x7c2c('0x34')];if(_0x8f2cfe[_0x7c2c('0x37')]['includeAll']){_0x106a13['include']=[{'all':!![]}];}_0x106a13=_[_0x7c2c('0x42')]({},_0x106a13,_0x8f2cfe[_0x7c2c('0x45')]);return db[_0x7c2c('0x2f')]['find'](_0x106a13)['then'](handleEntityNotFound(_0xd0a1d3,null))[_0x7c2c('0x26')](respondWithResult(_0xd0a1d3,null))[_0x7c2c('0x49')](handleError(_0xd0a1d3,null));};exports[_0x7c2c('0x4a')]=function(_0x2b79d5,_0x5f3de8){return db['ContactItemType']['create'](_0x2b79d5[_0x7c2c('0x4b')],{})[_0x7c2c('0x26')](function(_0x1d0140){var _0x27a096=_0x2b79d5[_0x7c2c('0x4c')]['get']({'plain':!![]});if(!_0x27a096)throw new Error(_0x7c2c('0x4d'));if(_0x27a096[_0x7c2c('0x4e')]==='user'){var _0x19621a=_0x1d0140['get']({'plain':!![]});var _0xfba6a7=_0x7c2c('0x27');return db[_0x7c2c('0x4f')]['find']({'where':{'name':_0xfba6a7,'userProfileId':_0x27a096['userProfileId']},'raw':!![]})[_0x7c2c('0x26')](function(_0x5e4bc3){if(_0x5e4bc3&&_0x5e4bc3[_0x7c2c('0x50')]===0x0){return db[_0x7c2c('0x28')]['create']({'name':_0x19621a[_0x7c2c('0x2b')],'resourceId':_0x19621a['id'],'type':_0x5e4bc3[_0x7c2c('0x2b')],'sectionId':_0x5e4bc3['id']},{})['then'](function(){return _0x1d0140;});}else{return _0x1d0140;}})[_0x7c2c('0x49')](function(_0x5d4d02){logger['error'](_0x7c2c('0x51'),_0x5d4d02);throw _0x5d4d02;});}return _0x1d0140;})[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,0xc9))[_0x7c2c('0x49')](handleError(_0x5f3de8,null));};exports['update']=function(_0x2bede2,_0x5baa8c){if(_0x2bede2[_0x7c2c('0x4b')]['id']){delete _0x2bede2[_0x7c2c('0x4b')]['id'];}return db['ContactItemType'][_0x7c2c('0x52')]({'where':{'id':_0x2bede2[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5baa8c,null))[_0x7c2c('0x26')](saveUpdates(_0x2bede2['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5baa8c,null))[_0x7c2c('0x49')](handleError(_0x5baa8c,null));};exports['destroy']=function(_0x43abec,_0x497dfb){return db[_0x7c2c('0x2f')][_0x7c2c('0x52')]({'where':{'id':_0x43abec[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x497dfb,null))[_0x7c2c('0x26')](db['CmContactHasItem'][_0x7c2c('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x43abec[_0x7c2c('0x48')]['id']}}))['then'](removeEntity(_0x497dfb,null))['catch'](handleError(_0x497dfb,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9cdb=['tools_contact_item_types','../../config/logger','api','bluebird','request-promise','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x9cdb,0x14b));var _0xb9cd=function(_0x120a47,_0xeb0bbf){_0x120a47=_0x120a47-0x0;var _0x30f714=_0x9cdb[_0x120a47];return _0x30f714;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9cd('0x0'))(_0xb9cd('0x1'));var moment=require('moment');var BPromise=require(_0xb9cd('0x2'));var rp=require(_0xb9cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb9cd('0x4'));var attributes=require(_0xb9cd('0x5'));module[_0xb9cd('0x6')]=function(_0x5c77f4,_0x29cbb6){return _0x5c77f4[_0xb9cd('0x7')](_0xb9cd('0x8'),attributes,{'tableName':_0xb9cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8aec=['rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x54c907,_0x4bd103){var _0x12a465=function(_0x28f0d4){while(--_0x28f0d4){_0x54c907['push'](_0x54c907['shift']());}};_0x12a465(++_0x4bd103);}(_0x8aec,0x1a6));var _0xc8ae=function(_0x2adebb,_0xbdab21){_0x2adebb=_0x2adebb-0x0;var _0x1f4afc=_0x8aec[_0x2adebb];return _0x1f4afc;};'use strict';var _=require(_0xc8ae('0x0'));var util=require('util');var logger=require(_0xc8ae('0x1'))(_0xc8ae('0x2'));var moment=require(_0xc8ae('0x3'));var BPromise=require(_0xc8ae('0x4'));var rp=require(_0xc8ae('0x5'));var fs=require('fs');var path=require(_0xc8ae('0x6'));var rimraf=require(_0xc8ae('0x7'));var config=require(_0xc8ae('0x8'));var attributes=require('./contactItemType.attributes');module[_0xc8ae('0x9')]=function(_0x3309ae,_0xe0d782){return _0x3309ae[_0xc8ae('0xa')](_0xc8ae('0xb'),attributes,{'tableName':_0xc8ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe664=['then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','rpc','../../config/environment','client','request'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xe664,0x1c4));var _0x4e66=function(_0x435379,_0x507bf0){_0x435379=_0x435379-0x0;var _0x2cf12b=_0xe664[_0x435379];return _0x2cf12b;};'use strict';var _=require(_0x4e66('0x0'));var util=require(_0x4e66('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4e66('0x2'));var fs=require('fs');var Redis=require(_0x4e66('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e66('0x4'));var config=require(_0x4e66('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4e66('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531df6,_0x6f981f,_0x42365f){return new BPromise(function(_0x2c645a,_0x436928){return client[_0x4e66('0x7')](_0x531df6,_0x42365f)[_0x4e66('0x8')](function(_0x6a1ae3){logger[_0x4e66('0x9')](_0x4e66('0xa'),_0x6f981f,'request\x20sent');logger[_0x4e66('0xb')](_0x4e66('0xc'),_0x6f981f,'request\x20sent',JSON[_0x4e66('0xd')](_0x6a1ae3));if(_0x6a1ae3[_0x4e66('0xe')]){if(_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0xf')]===0x1f4){logger['error'](_0x4e66('0xa'),_0x6f981f,_0x6a1ae3['error']['message']);return _0x436928(_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0x10')]);}logger[_0x4e66('0xe')](_0x4e66('0xa'),_0x6f981f,_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0x10')]);return _0x2c645a(_0x6a1ae3[_0x4e66('0xe')][_0x4e66('0x10')]);}else{logger[_0x4e66('0x9')](_0x4e66('0xa'),_0x6f981f,_0x4e66('0x11'));_0x2c645a(_0x6a1ae3[_0x4e66('0x12')]['message']);}})[_0x4e66('0x13')](function(_0x3c4a78){logger['error'](_0x4e66('0xa'),_0x6f981f,_0x3c4a78);_0x436928(_0x3c4a78);});});}
\ No newline at end of file
+var _0x15fd=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x4eac4c,_0x22442f){var _0x582951=function(_0x411184){while(--_0x411184){_0x4eac4c['push'](_0x4eac4c['shift']());}};_0x582951(++_0x22442f);}(_0x15fd,0x1d4));var _0xd15f=function(_0x709a09,_0x5b2c5d){_0x709a09=_0x709a09-0x0;var _0x2c08f7=_0x15fd[_0x709a09];return _0x2c08f7;};'use strict';var _=require(_0xd15f('0x0'));var util=require(_0xd15f('0x1'));var moment=require(_0xd15f('0x2'));var BPromise=require(_0xd15f('0x3'));var rs=require(_0xd15f('0x4'));var fs=require('fs');var Redis=require(_0xd15f('0x5'));var db=require(_0xd15f('0x6'))['db'];var utils=require(_0xd15f('0x7'));var logger=require(_0xd15f('0x8'))(_0xd15f('0x9'));var config=require('../../config/environment');var jayson=require(_0xd15f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e9b68,_0x1aaf73,_0x421780){return new BPromise(function(_0x33ba78,_0xd009aa){return client[_0xd15f('0xb')](_0x1e9b68,_0x421780)[_0xd15f('0xc')](function(_0xdc09a5){logger[_0xd15f('0xd')](_0xd15f('0xe'),_0x1aaf73,_0xd15f('0xf'));logger[_0xd15f('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x1aaf73,'request\x20sent',JSON[_0xd15f('0x11')](_0xdc09a5));if(_0xdc09a5['error']){if(_0xdc09a5[_0xd15f('0x12')]['code']===0x1f4){logger['error'](_0xd15f('0xe'),_0x1aaf73,_0xdc09a5[_0xd15f('0x12')][_0xd15f('0x13')]);return _0xd009aa(_0xdc09a5[_0xd15f('0x12')][_0xd15f('0x13')]);}logger[_0xd15f('0x12')](_0xd15f('0xe'),_0x1aaf73,_0xdc09a5['error'][_0xd15f('0x13')]);return _0x33ba78(_0xdc09a5[_0xd15f('0x12')][_0xd15f('0x13')]);}else{logger[_0xd15f('0xd')](_0xd15f('0xe'),_0x1aaf73,'request\x20sent');_0x33ba78(_0xdc09a5[_0xd15f('0x14')]['message']);}})[_0xd15f('0x15')](function(_0x368a65){logger[_0xd15f('0x12')]('ContactItemType,\x20%s,\x20%s',_0x1aaf73,_0x368a65);_0xd009aa(_0x368a65);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe36=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x289330,_0x54f85a){var _0x22d2d0=function(_0x4bdcf9){while(--_0x4bdcf9){_0x289330['push'](_0x289330['shift']());}};_0x22d2d0(++_0x54f85a);}(_0xbe36,0xd7));var _0x6be3=function(_0x1c6c8e,_0x2ef74c){_0x1c6c8e=_0x1c6c8e-0x0;var _0x354d96=_0xbe36[_0x1c6c8e];return _0x354d96;};'use strict';var multer=require('multer');var util=require(_0x6be3('0x0'));var path=require(_0x6be3('0x1'));var timeout=require(_0x6be3('0x2'));var express=require(_0x6be3('0x3'));var router=express[_0x6be3('0x4')]();var fs_extra=require(_0x6be3('0x5'));var auth=require(_0x6be3('0x6'));var interaction=require(_0x6be3('0x7'));var config=require(_0x6be3('0x8'));var controller=require(_0x6be3('0x9'));router[_0x6be3('0xa')]('/',auth['isAuthenticated'](),controller[_0x6be3('0xb')]);router[_0x6be3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6be3('0xc')]);router[_0x6be3('0xd')]('/',auth[_0x6be3('0xe')](),controller[_0x6be3('0xf')]);router[_0x6be3('0x10')](_0x6be3('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x6be3('0x12')](_0x6be3('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x6be3('0x13')]=router;
\ No newline at end of file
+var _0xadf2=['/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated'];(function(_0x1d68d4,_0x2a8e17){var _0x31fa8c=function(_0x2bc7ae){while(--_0x2bc7ae){_0x1d68d4['push'](_0x1d68d4['shift']());}};_0x31fa8c(++_0x2a8e17);}(_0xadf2,0x15c));var _0x2adf=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xadf2[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0x2adf('0x0'));var util=require('util');var path=require(_0x2adf('0x1'));var timeout=require(_0x2adf('0x2'));var express=require('express');var router=express[_0x2adf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2adf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2adf('0x5'));var controller=require(_0x2adf('0x6'));router[_0x2adf('0x7')]('/',auth[_0x2adf('0x8')](),controller['index']);router['get'](_0x2adf('0x9'),auth[_0x2adf('0x8')](),controller['show']);router[_0x2adf('0xa')]('/',auth[_0x2adf('0x8')](),controller[_0x2adf('0xb')]);router[_0x2adf('0xc')](_0x2adf('0x9'),auth[_0x2adf('0x8')](),controller[_0x2adf('0xd')]);router[_0x2adf('0xe')](_0x2adf('0x9'),auth['isAuthenticated'](),controller[_0x2adf('0xf')]);module[_0x2adf('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['STRING','sequelize','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe706,0xa3));var _0x6e70=function(_0x56503a,_0x1c4b81){_0x56503a=_0x56503a-0x0;var _0x52e0d4=_0xe706[_0x56503a];return _0x52e0d4;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x4874b3,_0x16c4e5){var _0x544c96=function(_0x689df3){while(--_0x689df3){_0x4874b3['push'](_0x4874b3['shift']());}};_0x544c96(++_0x16c4e5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e7d=['params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','role','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrFaxAccounts','web-report','reportType','attrReport','attrRefresh','stringify','getItems','findOne','DashboardItem','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','redis','socket.io-emitter','./dashboard.socket','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3a5a50,_0x2f87ca){var _0x3b0f7e=function(_0x37f954){while(--_0x37f954){_0x3a5a50['push'](_0x3a5a50['shift']());}};_0x3b0f7e(++_0x2f87ca);}(_0x6e7d,0xb9));var _0xd6e7=function(_0x532dd0,_0xff1a19){_0x532dd0=_0x532dd0-0x0;var _0x10fef2=_0x6e7d[_0x532dd0];return _0x10fef2;};'use strict';var emlformat=require(_0xd6e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6e7('0x1'));var jsonpatch=require(_0xd6e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd6e7('0x3'));var Mustache=require(_0xd6e7('0x4'));var util=require(_0xd6e7('0x5'));var path=require(_0xd6e7('0x6'));var sox=require('sox');var csv=require(_0xd6e7('0x7'));var ejs=require(_0xd6e7('0x8'));var fs=require('fs');var fs_extra=require(_0xd6e7('0x9'));var _=require('lodash');var squel=require(_0xd6e7('0xa'));var crypto=require(_0xd6e7('0xb'));var jsforce=require(_0xd6e7('0xc'));var deskjs=require(_0xd6e7('0xd'));var toCsv=require(_0xd6e7('0x7'));var querystring=require(_0xd6e7('0xe'));var Papa=require(_0xd6e7('0xf'));var Redis=require(_0xd6e7('0x10'));var authService=require(_0xd6e7('0x11'));var qs=require(_0xd6e7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6e7('0x13'));var logger=require(_0xd6e7('0x14'))(_0xd6e7('0x15'));var utils=require(_0xd6e7('0x16'));var config=require(_0xd6e7('0x17'));var licenseUtil=require(_0xd6e7('0x18'));var db=require(_0xd6e7('0x19'))['db'];config[_0xd6e7('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd6e7('0x1b'))(new Redis(config[_0xd6e7('0x1a')]));require(_0xd6e7('0x1c'))['register'](socket);function respondWithStatusCode(_0x5b9145,_0x71e88e){_0x71e88e=_0x71e88e||0xcc;return function(_0x25c5f2){if(_0x25c5f2){return _0x5b9145[_0xd6e7('0x1d')](_0x71e88e);}return _0x5b9145['status'](_0x71e88e)[_0xd6e7('0x1e')]();};}function respondWithResult(_0x51cf7c,_0x118b60){_0x118b60=_0x118b60||0xc8;return function(_0x467760){if(_0x467760){return _0x51cf7c[_0xd6e7('0x1f')](_0x118b60)[_0xd6e7('0x20')](_0x467760);}};}function respondWithFilteredResult(_0x4f900a,_0x4202ce){return function(_0x3e907b){if(_0x3e907b){var _0xae9186=typeof _0x4202ce['offset']===_0xd6e7('0x21')&&typeof _0x4202ce[_0xd6e7('0x22')]===_0xd6e7('0x21');var _0x5a5f78=_0x3e907b['count'];var _0x322245=_0xae9186?0x0:_0x4202ce['offset'];var _0x10ed74=_0xae9186?_0x3e907b[_0xd6e7('0x23')]:_0x4202ce[_0xd6e7('0x24')]+_0x4202ce[_0xd6e7('0x22')];var _0x4545e2;if(_0x10ed74>=_0x5a5f78){_0x10ed74=_0x5a5f78;_0x4545e2=0xc8;}else{_0x4545e2=0xce;}_0x4f900a['status'](_0x4545e2);return _0x4f900a['set'](_0xd6e7('0x25'),_0x322245+'-'+_0x10ed74+'/'+_0x5a5f78)['json'](_0x3e907b);}return null;};}function patchUpdates(_0x495cd3){return function(_0x4450d3){try{jsonpatch[_0xd6e7('0x26')](_0x4450d3,_0x495cd3,!![]);}catch(_0x3c4a0a){return BPromise[_0xd6e7('0x27')](_0x3c4a0a);}return _0x4450d3[_0xd6e7('0x28')]();};}function saveUpdates(_0x3d24f1,_0xa39b91){return function(_0x18bc84){if(_0x18bc84){return _0x18bc84[_0xd6e7('0x29')](_0x3d24f1)[_0xd6e7('0x2a')](function(_0x33e768){return _0x33e768;});}return null;};}function removeEntity(_0x2168c2,_0x125922){return function(_0x46a5c6){if(_0x46a5c6){return _0x46a5c6['destroy']()[_0xd6e7('0x2a')](function(){var _0x25e480=_0x46a5c6[_0xd6e7('0x2b')]({'plain':!![]});var _0xaa389d='CustomDashboards';return db[_0xd6e7('0x2c')][_0xd6e7('0x2d')]({'where':{'type':_0xaa389d,'resourceId':_0x25e480['id']}})[_0xd6e7('0x2a')](function(){return _0x46a5c6;});})[_0xd6e7('0x2a')](function(){_0x2168c2[_0xd6e7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x242bad,_0x3354ab){return function(_0x42fcce){if(!_0x42fcce){_0x242bad['sendStatus'](0x194);}return _0x42fcce;};}function handleError(_0x8e7a6b,_0x1b1bec){_0x1b1bec=_0x1b1bec||0x1f4;return function(_0x414d25){logger['error'](_0x414d25[_0xd6e7('0x2e')]);if(_0x414d25[_0xd6e7('0x2f')]){delete _0x414d25[_0xd6e7('0x2f')];}_0x8e7a6b[_0xd6e7('0x1f')](_0x1b1bec)[_0xd6e7('0x30')](_0x414d25);};}exports[_0xd6e7('0x31')]=function(_0x51b0e0,_0x42947c){var _0x165039={},_0x4f8ff9={},_0x106ff9={'count':0x0,'rows':[]};var _0xb895a5=_['map'](db[_0xd6e7('0x32')][_0xd6e7('0x33')],function(_0x27ee99){return{'name':_0x27ee99[_0xd6e7('0x34')],'type':_0x27ee99[_0xd6e7('0x35')]['key']};});_0x4f8ff9[_0xd6e7('0x36')]=_['map'](_0xb895a5,_0xd6e7('0x2f'));_0x4f8ff9['query']=_[_0xd6e7('0x37')](_0x51b0e0[_0xd6e7('0x38')]);_0x4f8ff9[_0xd6e7('0x39')]=_[_0xd6e7('0x3a')](_0x4f8ff9[_0xd6e7('0x36')],_0x4f8ff9['query']);_0x165039[_0xd6e7('0x3b')]=_[_0xd6e7('0x3a')](_0x4f8ff9[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x51b0e0[_0xd6e7('0x38')]['fields']));_0x165039[_0xd6e7('0x3b')]=_0x165039[_0xd6e7('0x3b')][_0xd6e7('0x3d')]?_0x165039[_0xd6e7('0x3b')]:_0x4f8ff9[_0xd6e7('0x36')];if(!_0x51b0e0[_0xd6e7('0x38')][_0xd6e7('0x3e')](_0xd6e7('0x3f'))){_0x165039[_0xd6e7('0x22')]=qs[_0xd6e7('0x22')](_0x51b0e0['query'][_0xd6e7('0x22')]);_0x165039[_0xd6e7('0x24')]=qs[_0xd6e7('0x24')](_0x51b0e0['query'][_0xd6e7('0x24')]);}_0x165039[_0xd6e7('0x40')]=qs[_0xd6e7('0x41')](_0x51b0e0['query'][_0xd6e7('0x41')]);_0x165039[_0xd6e7('0x42')]=qs[_0xd6e7('0x39')](_[_0xd6e7('0x43')](_0x51b0e0[_0xd6e7('0x38')],_0x4f8ff9[_0xd6e7('0x39')]),_0xb895a5);if(_0x51b0e0['query'][_0xd6e7('0x44')]){_0x165039['where']=_['merge'](_0x165039[_0xd6e7('0x42')],{'$or':_[_0xd6e7('0x45')](_0xb895a5,function(_0xd10c21){if(_0xd10c21[_0xd6e7('0x35')]!==_0xd6e7('0x46')){var _0x3bb68c={};_0x3bb68c[_0xd10c21['name']]={'$like':'%'+_0x51b0e0[_0xd6e7('0x38')]['filter']+'%'};return _0x3bb68c;}})});}_0x165039=_[_0xd6e7('0x47')]({},_0x165039,_0x51b0e0[_0xd6e7('0x48')]);var _0x158d98={'where':_0x165039[_0xd6e7('0x42')]};return db[_0xd6e7('0x32')][_0xd6e7('0x23')](_0x158d98)[_0xd6e7('0x2a')](function(_0x2cbecc){_0x106ff9[_0xd6e7('0x23')]=_0x2cbecc;if(_0x51b0e0[_0xd6e7('0x38')][_0xd6e7('0x49')]){_0x165039[_0xd6e7('0x4a')]=[{'all':!![]}];}return db['Dashboard'][_0xd6e7('0x4b')](_0x165039);})['then'](function(_0x368dcb){_0x106ff9[_0xd6e7('0x4c')]=_0x368dcb;return _0x106ff9;})[_0xd6e7('0x2a')](respondWithFilteredResult(_0x42947c,_0x165039))[_0xd6e7('0x4d')](handleError(_0x42947c,null));};exports[_0xd6e7('0x4e')]=function(_0x33dd23,_0x225f08){var _0x3d6667={'raw':![],'where':{'id':_0x33dd23[_0xd6e7('0x4f')]['id']}},_0x5c71da={};_0x5c71da[_0xd6e7('0x36')]=_[_0xd6e7('0x37')](db['Dashboard'][_0xd6e7('0x33')]);_0x5c71da['query']=_[_0xd6e7('0x37')](_0x33dd23[_0xd6e7('0x38')]);_0x5c71da[_0xd6e7('0x39')]=_[_0xd6e7('0x3a')](_0x5c71da['model'],_0x5c71da[_0xd6e7('0x38')]);_0x3d6667[_0xd6e7('0x3b')]=_[_0xd6e7('0x3a')](_0x5c71da[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x33dd23[_0xd6e7('0x38')][_0xd6e7('0x3c')]));_0x3d6667[_0xd6e7('0x3b')]=_0x3d6667[_0xd6e7('0x3b')][_0xd6e7('0x3d')]?_0x3d6667['attributes']:_0x5c71da[_0xd6e7('0x36')];if(_0x33dd23[_0xd6e7('0x38')][_0xd6e7('0x49')]){_0x3d6667[_0xd6e7('0x4a')]=[{'all':!![]}];}_0x3d6667=_[_0xd6e7('0x47')]({},_0x3d6667,_0x33dd23['options']);return db[_0xd6e7('0x32')][_0xd6e7('0x50')](_0x3d6667)[_0xd6e7('0x2a')](handleEntityNotFound(_0x225f08,null))[_0xd6e7('0x2a')](respondWithResult(_0x225f08,null))['catch'](handleError(_0x225f08,null));};exports[_0xd6e7('0x51')]=function(_0x42ffc0,_0x436e88){return db[_0xd6e7('0x32')]['create'](_0x42ffc0['body'],{})[_0xd6e7('0x2a')](function(_0x1b051c){var _0x9268d7=_0x42ffc0[_0xd6e7('0x52')][_0xd6e7('0x2b')]({'plain':!![]});if(!_0x9268d7)throw new Error(_0xd6e7('0x53'));if(_0x9268d7['role']===_0xd6e7('0x52')){var _0x36ad97=_0x1b051c['get']({'plain':!![]});var _0x3d8f16=_0xd6e7('0x54');return db[_0xd6e7('0x55')][_0xd6e7('0x50')]({'where':{'name':_0x3d8f16,'userProfileId':_0x9268d7[_0xd6e7('0x56')]},'raw':!![]})['then'](function(_0xa1a19f){if(_0xa1a19f&&_0xa1a19f[_0xd6e7('0x57')]===0x0){return db[_0xd6e7('0x2c')][_0xd6e7('0x51')]({'name':_0x36ad97[_0xd6e7('0x2f')],'resourceId':_0x36ad97['id'],'type':_0xa1a19f[_0xd6e7('0x2f')],'sectionId':_0xa1a19f['id']},{})['then'](function(){return _0x1b051c;});}else{return _0x1b051c;}})[_0xd6e7('0x4d')](function(_0x514750){logger[_0xd6e7('0x58')](_0xd6e7('0x59'),_0x514750);throw _0x514750;});}return _0x1b051c;})[_0xd6e7('0x2a')](respondWithResult(_0x436e88,0xc9))[_0xd6e7('0x4d')](handleError(_0x436e88,null));};exports[_0xd6e7('0x5a')]=function(_0x118226,_0x5ce207){var _0x318891={'where':{'id':_0x118226[_0xd6e7('0x4f')]['id']}},_0x174587={};_0x174587[_0xd6e7('0x36')]=_[_0xd6e7('0x37')](db[_0xd6e7('0x32')][_0xd6e7('0x33')]);_0x318891[_0xd6e7('0x3b')]=_[_0xd6e7('0x3a')](_0x174587[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x118226['query']['fields']));_0x318891[_0xd6e7('0x3b')]=_0x318891[_0xd6e7('0x3b')]['length']?_0x318891[_0xd6e7('0x3b')]:_0x174587[_0xd6e7('0x36')];if(_0x118226[_0xd6e7('0x38')][_0xd6e7('0x49')]){_0x318891[_0xd6e7('0x4a')]=[{'all':!![]}];}_0x318891=_[_0xd6e7('0x47')]({},_0x318891,_0x118226[_0xd6e7('0x48')]);return db[_0xd6e7('0x32')][_0xd6e7('0x50')](_0x318891)[_0xd6e7('0x2a')](handleEntityNotFound(_0x5ce207,null))[_0xd6e7('0x2a')](function(_0x5b57e2){if(_0x5b57e2){var _0x5152f8=_0x5b57e2[_0xd6e7('0x2b')]({'plain':!![]});_0x5152f8=qs[_0xd6e7('0x5b')](_0x5152f8,['id','createdAt',_0xd6e7('0x5c')]);_0x118226[_0xd6e7('0x5d')]=_['omit'](_0x118226[_0xd6e7('0x5d')],['id',_0xd6e7('0x5e'),'updatedAt']);return db[_0xd6e7('0x32')]['create'](_[_0xd6e7('0x47')](_0x5152f8,_0x118226['body']),{'include':_0x118226[_0xd6e7('0x38')][_0xd6e7('0x49')]?[{'all':!![]}]:undefined})[_0xd6e7('0x2a')](function(_0x386afc){var _0x4f5ffe=_0x118226['user']['get']({'plain':!![]});if(!_0x4f5ffe)throw new Error(_0xd6e7('0x53'));if(_0x4f5ffe[_0xd6e7('0x5f')]===_0xd6e7('0x52')){var _0x25a7b8=_0x386afc[_0xd6e7('0x2b')]({'plain':!![]});var _0x345e64=_0xd6e7('0x54');return db[_0xd6e7('0x55')][_0xd6e7('0x50')]({'where':{'name':_0x345e64,'userProfileId':_0x4f5ffe[_0xd6e7('0x56')]},'raw':!![]})[_0xd6e7('0x2a')](function(_0x306dd6){if(_0x306dd6&&_0x306dd6['autoAssociation']===0x0){return db[_0xd6e7('0x2c')][_0xd6e7('0x51')]({'name':_0x25a7b8[_0xd6e7('0x2f')],'resourceId':_0x25a7b8['id'],'type':_0x306dd6[_0xd6e7('0x2f')],'sectionId':_0x306dd6['id']},{})[_0xd6e7('0x2a')](function(){return _0x386afc;});}else{return _0x386afc;}})[_0xd6e7('0x4d')](function(_0x5bd2f1){logger['error'](_0xd6e7('0x59'),_0x5bd2f1);throw _0x5bd2f1;});}return _0x386afc;});}})['then'](respondWithResult(_0x5ce207,0xc9))[_0xd6e7('0x4d')](handleError(_0x5ce207,null));};exports['update']=function(_0x35424d,_0x2c7966){if(_0x35424d[_0xd6e7('0x5d')]['id']){delete _0x35424d[_0xd6e7('0x5d')]['id'];}return db[_0xd6e7('0x32')]['find']({'where':{'id':_0x35424d[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x2c7966,null))['then'](saveUpdates(_0x35424d[_0xd6e7('0x5d')],null))[_0xd6e7('0x2a')](respondWithResult(_0x2c7966,null))[_0xd6e7('0x4d')](handleError(_0x2c7966,null));};exports[_0xd6e7('0x2d')]=function(_0x1d1f7e,_0x4b9d31){return db['Dashboard'][_0xd6e7('0x50')]({'where':{'id':_0x1d1f7e[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x4b9d31,null))[_0xd6e7('0x2a')](removeEntity(_0x4b9d31,null))[_0xd6e7('0x4d')](handleError(_0x4b9d31,null));};function widgetAttributes(_0x529ba8){try{switch(_0x529ba8[_0xd6e7('0x35')]){case _0xd6e7('0x60'):return[{'name':'attrUrl','value':_0x529ba8[_0xd6e7('0x61')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x64')}];case _0xd6e7('0x65'):return[{'name':'attrPath','value':_0x529ba8[_0xd6e7('0x66')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8['attrs'][0x0][_0xd6e7('0x63')]:undefined)||''}];case'clock':return[{'name':_0xd6e7('0x67'),'value':_0x529ba8[_0xd6e7('0x67')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x68')},{'name':_0xd6e7('0x69'),'value':_0x529ba8[_0xd6e7('0x69')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x6a')},{'name':'attrFontSize','value':_0x529ba8[_0xd6e7('0x6b')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x2]?_0x529ba8[_0xd6e7('0x62')][0x2][_0xd6e7('0x63')]:undefined)||0xc}];case _0xd6e7('0x6c'):return[{'name':_0xd6e7('0x6d'),'value':_0x529ba8[_0xd6e7('0x6d')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x6e')},{'name':_0xd6e7('0x6f'),'value':_0x529ba8['attrVoiceQueues']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||[]},{'name':_0xd6e7('0x6b'),'value':_0x529ba8[_0xd6e7('0x6b')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x2]?_0x529ba8[_0xd6e7('0x62')][0x2][_0xd6e7('0x63')]:undefined)||0x14},{'name':_0xd6e7('0x70'),'value':_0x529ba8[_0xd6e7('0x70')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x3]?_0x529ba8[_0xd6e7('0x62')][0x3][_0xd6e7('0x63')]:undefined)||_0xd6e7('0x71')},{'name':_0xd6e7('0x72'),'value':_0x529ba8[_0xd6e7('0x72')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x4]?_0x529ba8[_0xd6e7('0x62')][0x4][_0xd6e7('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x529ba8['attrFaxAccounts']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x5]?_0x529ba8['attrs'][0x5]['value']:undefined)||''},{'name':_0xd6e7('0x73'),'value':_0x529ba8['attrSmsAccounts']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x6]?_0x529ba8[_0xd6e7('0x62')][0x6]['value']:undefined)||''},{'name':_0xd6e7('0x74'),'value':_0x529ba8[_0xd6e7('0x74')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x7]?_0x529ba8[_0xd6e7('0x62')][0x7]['value']:undefined)||''},{'name':_0xd6e7('0x75'),'value':_0x529ba8[_0xd6e7('0x75')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x8]?_0x529ba8[_0xd6e7('0x62')][0x8][_0xd6e7('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x529ba8[_0xd6e7('0x76')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x9]?_0x529ba8[_0xd6e7('0x62')][0x9][_0xd6e7('0x63')]:undefined)||''}];case _0xd6e7('0x77'):case'pie-chart':return[{'name':'attrSerie1','value':_0x529ba8[_0xd6e7('0x78')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||'total'},{'name':_0xd6e7('0x79'),'value':_0x529ba8[_0xd6e7('0x79')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||null},{'name':_0xd6e7('0x7a'),'value':_0x529ba8[_0xd6e7('0x7a')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x2]?_0x529ba8[_0xd6e7('0x62')][0x2][_0xd6e7('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x529ba8[_0xd6e7('0x6f')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x3]?_0x529ba8[_0xd6e7('0x62')][0x3][_0xd6e7('0x63')]:undefined)||[]},{'name':_0xd6e7('0x70'),'value':_0x529ba8[_0xd6e7('0x70')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x4]?_0x529ba8[_0xd6e7('0x62')][0x4]['value']:undefined)||_0xd6e7('0x71')},{'name':'attrEmailAccounts','value':_0x529ba8['attrEmailAccounts']||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0x5]?_0x529ba8[_0xd6e7('0x62')][0x5]['value']:undefined)||''},{'name':_0xd6e7('0x7b'),'value':_0x529ba8[_0xd6e7('0x7b')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x6]?_0x529ba8[_0xd6e7('0x62')][0x6][_0xd6e7('0x63')]:undefined)||''},{'name':_0xd6e7('0x73'),'value':_0x529ba8[_0xd6e7('0x73')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x7]?_0x529ba8[_0xd6e7('0x62')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x529ba8[_0xd6e7('0x74')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x8]?_0x529ba8[_0xd6e7('0x62')][0x8]['value']:undefined)||''},{'name':_0xd6e7('0x75'),'value':_0x529ba8[_0xd6e7('0x75')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x9]?_0x529ba8[_0xd6e7('0x62')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x529ba8[_0xd6e7('0x76')]||(_0x529ba8['attrs']&&_0x529ba8[_0xd6e7('0x62')][0xa]?_0x529ba8['attrs'][0xa][_0xd6e7('0x63')]:undefined)||''}];case _0xd6e7('0x7c'):return[{'name':'attrReport','type':_0x529ba8[_0xd6e7('0x7d')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x35')]:undefined)||null,'value':_0x529ba8[_0xd6e7('0x7e')]||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8[_0xd6e7('0x62')][0x0]?_0x529ba8[_0xd6e7('0x62')][0x0][_0xd6e7('0x63')]:undefined)||null},{'name':_0xd6e7('0x7f'),'value':_0x529ba8['attrRefresh']||(_0x529ba8[_0xd6e7('0x62')]&&_0x529ba8['attrs'][0x1]?_0x529ba8[_0xd6e7('0x62')][0x1][_0xd6e7('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x4f9cb5){logger[_0xd6e7('0x58')]('widgetAttributes:\x20%s',JSON[_0xd6e7('0x80')](_0x4f9cb5));return[];}}exports['addItem']=function(_0x57ff64,_0x5abd05,_0xee280d){if(_0x57ff64[_0xd6e7('0x5d')]['id']){delete _0x57ff64[_0xd6e7('0x5d')]['id'];}return db[_0xd6e7('0x32')][_0xd6e7('0x50')]({'where':{'id':_0x57ff64[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x5abd05,null))['then'](function(_0x2eafa4){if(_0x2eafa4){_0x57ff64[_0xd6e7('0x5d')]['DashboardId']=_0x2eafa4['id'];_0x57ff64['body'][_0xd6e7('0x62')]=widgetAttributes(_0x57ff64[_0xd6e7('0x5d')]);return db['DashboardItem'][_0xd6e7('0x51')](_0x57ff64[_0xd6e7('0x5d')]);}})[_0xd6e7('0x2a')](respondWithResult(_0x5abd05,null))[_0xd6e7('0x4d')](handleError(_0x5abd05,null));};exports[_0xd6e7('0x81')]=function(_0x51c482,_0x3c272a,_0x7d20c4){var _0x52c542={};var _0x3a19ca={};var _0x4b94c4;var _0x5f1ba6;return db[_0xd6e7('0x32')][_0xd6e7('0x82')]({'where':{'id':_0x51c482[_0xd6e7('0x4f')]['id']}})[_0xd6e7('0x2a')](handleEntityNotFound(_0x3c272a,null))[_0xd6e7('0x2a')](function(_0x7e2308){if(_0x7e2308){_0x4b94c4=_0x7e2308;_0x3a19ca[_0xd6e7('0x36')]=_[_0xd6e7('0x37')](db[_0xd6e7('0x83')][_0xd6e7('0x33')]);_0x3a19ca[_0xd6e7('0x38')]=_[_0xd6e7('0x37')](_0x51c482[_0xd6e7('0x38')]);_0x3a19ca[_0xd6e7('0x39')]=_[_0xd6e7('0x3a')](_0x3a19ca['model'],_0x3a19ca[_0xd6e7('0x38')]);_0x52c542[_0xd6e7('0x3b')]=_['intersection'](_0x3a19ca[_0xd6e7('0x36')],qs[_0xd6e7('0x3c')](_0x51c482[_0xd6e7('0x38')]['fields']));_0x52c542[_0xd6e7('0x3b')]=_0x52c542[_0xd6e7('0x3b')][_0xd6e7('0x3d')]?_0x52c542[_0xd6e7('0x3b')]:_0x3a19ca[_0xd6e7('0x36')];_0x52c542[_0xd6e7('0x40')]=qs[_0xd6e7('0x41')](_0x51c482['query']['sort']);_0x52c542[_0xd6e7('0x42')]=qs[_0xd6e7('0x39')](_['pick'](_0x51c482[_0xd6e7('0x38')],_0x3a19ca[_0xd6e7('0x39')]));if(_0x51c482['query'][_0xd6e7('0x44')]){_0x52c542[_0xd6e7('0x42')]=_[_0xd6e7('0x47')](_0x52c542[_0xd6e7('0x42')],{'$or':_[_0xd6e7('0x45')](_0x52c542[_0xd6e7('0x3b')],function(_0x1424de){var _0x29ad4b={};_0x29ad4b[_0x1424de]={'$like':'%'+_0x51c482[_0xd6e7('0x38')]['filter']+'%'};return _0x29ad4b;})});}_0x52c542=_['merge']({},_0x52c542,_0x51c482[_0xd6e7('0x48')]);return _0x4b94c4[_0xd6e7('0x81')](_0x52c542);}})[_0xd6e7('0x2a')](function(_0x4f681c){if(_0x4f681c){_0x5f1ba6=_0x4f681c[_0xd6e7('0x3d')];if(!_0x51c482[_0xd6e7('0x38')][_0xd6e7('0x3e')]('nolimit')){_0x52c542[_0xd6e7('0x22')]=qs[_0xd6e7('0x22')](_0x51c482[_0xd6e7('0x38')]['limit']);_0x52c542[_0xd6e7('0x24')]=qs[_0xd6e7('0x24')](_0x51c482[_0xd6e7('0x38')]['offset']);}return _0x4b94c4[_0xd6e7('0x81')](_0x52c542);}})[_0xd6e7('0x2a')](function(_0x328806){if(_0x328806){return _0x328806?{'count':_0x5f1ba6,'rows':_0x328806}:null;}})['then'](respondWithResult(_0x3c272a,null))[_0xd6e7('0x4d')](handleError(_0x3c272a,null));};
\ No newline at end of file
+var _0xc4a2=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','params','length','omit','createdAt','updatedAt','update','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','CustomDashboards','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Dashboard','includeAll','include','findAll','rows','show','options','find','catch','create','body','user'];(function(_0x2aab70,_0x204207){var _0x1c1dfa=function(_0x4a8baf){while(--_0x4a8baf){_0x2aab70['push'](_0x2aab70['shift']());}};_0x1c1dfa(++_0x204207);}(_0xc4a2,0xb5));var _0x2c4a=function(_0x11fd3d,_0x59308b){_0x11fd3d=_0x11fd3d-0x0;var _0x15fdd7=_0xc4a2[_0x11fd3d];return _0x15fdd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c4a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c4a('0x1'));var rp=require(_0x2c4a('0x2'));var moment=require(_0x2c4a('0x3'));var BPromise=require(_0x2c4a('0x4'));var Mustache=require(_0x2c4a('0x5'));var util=require(_0x2c4a('0x6'));var path=require(_0x2c4a('0x7'));var sox=require(_0x2c4a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c4a('0x9'));var squel=require(_0x2c4a('0xa'));var crypto=require(_0x2c4a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2c4a('0xc'));var toCsv=require(_0x2c4a('0xd'));var querystring=require(_0x2c4a('0xe'));var Papa=require(_0x2c4a('0xf'));var Redis=require(_0x2c4a('0x10'));var authService=require(_0x2c4a('0x11'));var qs=require(_0x2c4a('0x12'));var as=require(_0x2c4a('0x13'));var hardwareService=require(_0x2c4a('0x14'));var logger=require(_0x2c4a('0x15'))('api');var utils=require(_0x2c4a('0x16'));var config=require(_0x2c4a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c4a('0x18'))['db'];config['redis']=_[_0x2c4a('0x19')](config[_0x2c4a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c4a('0x1b'))(new Redis(config[_0x2c4a('0x1a')]));require('./dashboard.socket')[_0x2c4a('0x1c')](socket);function respondWithStatusCode(_0x11598a,_0x2a9a2c){_0x2a9a2c=_0x2a9a2c||0xcc;return function(_0x308f32){if(_0x308f32){return _0x11598a[_0x2c4a('0x1d')](_0x2a9a2c);}return _0x11598a[_0x2c4a('0x1e')](_0x2a9a2c)['end']();};}function respondWithResult(_0x34c496,_0x6f8b06){_0x6f8b06=_0x6f8b06||0xc8;return function(_0x429f8d){if(_0x429f8d){return _0x34c496[_0x2c4a('0x1e')](_0x6f8b06)[_0x2c4a('0x1f')](_0x429f8d);}};}function respondWithFilteredResult(_0x2fa3eb,_0x151838){return function(_0x19e700){if(_0x19e700){var _0x447842=typeof _0x151838[_0x2c4a('0x20')]===_0x2c4a('0x21')&&typeof _0x151838[_0x2c4a('0x22')]===_0x2c4a('0x21');var _0x5ce2c6=_0x19e700[_0x2c4a('0x23')];var _0x3b5938=_0x447842?0x0:_0x151838[_0x2c4a('0x20')];var _0x368392=_0x447842?_0x19e700['count']:_0x151838[_0x2c4a('0x20')]+_0x151838[_0x2c4a('0x22')];var _0x21ab2f;if(_0x368392>=_0x5ce2c6){_0x368392=_0x5ce2c6;_0x21ab2f=0xc8;}else{_0x21ab2f=0xce;}_0x2fa3eb[_0x2c4a('0x1e')](_0x21ab2f);return _0x2fa3eb['set'](_0x2c4a('0x24'),_0x3b5938+'-'+_0x368392+'/'+_0x5ce2c6)['json'](_0x19e700);}return null;};}function patchUpdates(_0x4bc879){return function(_0x5c9232){try{jsonpatch[_0x2c4a('0x25')](_0x5c9232,_0x4bc879,!![]);}catch(_0x4c5f11){return BPromise['reject'](_0x4c5f11);}return _0x5c9232[_0x2c4a('0x26')]();};}function saveUpdates(_0x49d30c,_0x195270){return function(_0x5bab3a){if(_0x5bab3a){return _0x5bab3a['update'](_0x49d30c)[_0x2c4a('0x27')](function(_0x168d95){return _0x168d95;});}return null;};}function removeEntity(_0x5ee115,_0x206cc7){return function(_0xa26fec){if(_0xa26fec){return _0xa26fec['destroy']()[_0x2c4a('0x27')](function(){var _0x278562=_0xa26fec[_0x2c4a('0x28')]({'plain':!![]});var _0x29a1ae=_0x2c4a('0x29');return db[_0x2c4a('0x2a')][_0x2c4a('0x2b')]({'where':{'type':_0x29a1ae,'resourceId':_0x278562['id']}})[_0x2c4a('0x27')](function(){return _0xa26fec;});})[_0x2c4a('0x27')](function(){_0x5ee115[_0x2c4a('0x1e')](0xcc)[_0x2c4a('0x2c')]();});}};}function handleEntityNotFound(_0x4e5855,_0x53e986){return function(_0x39e564){if(!_0x39e564){_0x4e5855[_0x2c4a('0x1d')](0x194);}return _0x39e564;};}function handleError(_0x1fee5f,_0x533ba0){_0x533ba0=_0x533ba0||0x1f4;return function(_0x5e0a64){logger[_0x2c4a('0x2d')](_0x5e0a64[_0x2c4a('0x2e')]);if(_0x5e0a64[_0x2c4a('0x2f')]){delete _0x5e0a64[_0x2c4a('0x2f')];}_0x1fee5f[_0x2c4a('0x1e')](_0x533ba0)[_0x2c4a('0x30')](_0x5e0a64);};}exports[_0x2c4a('0x31')]=function(_0x144373,_0x4ceef4){var _0x26ead5={},_0x4fbcf3={},_0x3e35ba={'count':0x0,'rows':[]};var _0x3a0ce0=_[_0x2c4a('0x32')](db['Dashboard'][_0x2c4a('0x33')],function(_0x5ce211){return{'name':_0x5ce211[_0x2c4a('0x34')],'type':_0x5ce211[_0x2c4a('0x35')][_0x2c4a('0x36')]};});_0x4fbcf3[_0x2c4a('0x37')]=_[_0x2c4a('0x32')](_0x3a0ce0,_0x2c4a('0x2f'));_0x4fbcf3[_0x2c4a('0x38')]=_[_0x2c4a('0x39')](_0x144373['query']);_0x4fbcf3[_0x2c4a('0x3a')]=_[_0x2c4a('0x3b')](_0x4fbcf3[_0x2c4a('0x37')],_0x4fbcf3[_0x2c4a('0x38')]);_0x26ead5[_0x2c4a('0x3c')]=_[_0x2c4a('0x3b')](_0x4fbcf3[_0x2c4a('0x37')],qs[_0x2c4a('0x3d')](_0x144373[_0x2c4a('0x38')]['fields']));_0x26ead5['attributes']=_0x26ead5[_0x2c4a('0x3c')]['length']?_0x26ead5[_0x2c4a('0x3c')]:_0x4fbcf3['model'];if(!_0x144373[_0x2c4a('0x38')][_0x2c4a('0x3e')](_0x2c4a('0x3f'))){_0x26ead5[_0x2c4a('0x22')]=qs[_0x2c4a('0x22')](_0x144373[_0x2c4a('0x38')][_0x2c4a('0x22')]);_0x26ead5[_0x2c4a('0x20')]=qs[_0x2c4a('0x20')](_0x144373[_0x2c4a('0x38')]['offset']);}_0x26ead5[_0x2c4a('0x40')]=qs['sort'](_0x144373[_0x2c4a('0x38')][_0x2c4a('0x41')]);_0x26ead5[_0x2c4a('0x42')]=qs[_0x2c4a('0x3a')](_[_0x2c4a('0x43')](_0x144373['query'],_0x4fbcf3[_0x2c4a('0x3a')]),_0x3a0ce0);if(_0x144373[_0x2c4a('0x38')][_0x2c4a('0x44')]){_0x26ead5[_0x2c4a('0x42')]=_[_0x2c4a('0x45')](_0x26ead5[_0x2c4a('0x42')],{'$or':_[_0x2c4a('0x32')](_0x3a0ce0,function(_0x28bf9a){if(_0x28bf9a[_0x2c4a('0x35')]!==_0x2c4a('0x46')){var _0x4e03a5={};_0x4e03a5[_0x28bf9a['name']]={'$like':'%'+_0x144373[_0x2c4a('0x38')][_0x2c4a('0x44')]+'%'};return _0x4e03a5;}})});}_0x26ead5=_[_0x2c4a('0x45')]({},_0x26ead5,_0x144373['options']);var _0x38ab45={'where':_0x26ead5[_0x2c4a('0x42')]};return db[_0x2c4a('0x47')]['count'](_0x38ab45)[_0x2c4a('0x27')](function(_0x2cdaf9){_0x3e35ba[_0x2c4a('0x23')]=_0x2cdaf9;if(_0x144373[_0x2c4a('0x38')][_0x2c4a('0x48')]){_0x26ead5[_0x2c4a('0x49')]=[{'all':!![]}];}return db[_0x2c4a('0x47')][_0x2c4a('0x4a')](_0x26ead5);})['then'](function(_0x376aa9){_0x3e35ba[_0x2c4a('0x4b')]=_0x376aa9;return _0x3e35ba;})[_0x2c4a('0x27')](respondWithFilteredResult(_0x4ceef4,_0x26ead5))['catch'](handleError(_0x4ceef4,null));};exports[_0x2c4a('0x4c')]=function(_0xc1a4d2,_0x1c0a82){var _0x938cff={'raw':![],'where':{'id':_0xc1a4d2['params']['id']}},_0x4b8b41={};_0x4b8b41['model']=_[_0x2c4a('0x39')](db['Dashboard'][_0x2c4a('0x33')]);_0x4b8b41[_0x2c4a('0x38')]=_[_0x2c4a('0x39')](_0xc1a4d2[_0x2c4a('0x38')]);_0x4b8b41[_0x2c4a('0x3a')]=_['intersection'](_0x4b8b41[_0x2c4a('0x37')],_0x4b8b41[_0x2c4a('0x38')]);_0x938cff[_0x2c4a('0x3c')]=_[_0x2c4a('0x3b')](_0x4b8b41[_0x2c4a('0x37')],qs[_0x2c4a('0x3d')](_0xc1a4d2[_0x2c4a('0x38')]['fields']));_0x938cff['attributes']=_0x938cff['attributes']['length']?_0x938cff['attributes']:_0x4b8b41[_0x2c4a('0x37')];if(_0xc1a4d2[_0x2c4a('0x38')][_0x2c4a('0x48')]){_0x938cff[_0x2c4a('0x49')]=[{'all':!![]}];}_0x938cff=_[_0x2c4a('0x45')]({},_0x938cff,_0xc1a4d2[_0x2c4a('0x4d')]);return db[_0x2c4a('0x47')][_0x2c4a('0x4e')](_0x938cff)[_0x2c4a('0x27')](handleEntityNotFound(_0x1c0a82,null))[_0x2c4a('0x27')](respondWithResult(_0x1c0a82,null))[_0x2c4a('0x4f')](handleError(_0x1c0a82,null));};exports[_0x2c4a('0x50')]=function(_0x1f8ab6,_0x1d57db){return db[_0x2c4a('0x47')][_0x2c4a('0x50')](_0x1f8ab6[_0x2c4a('0x51')],{})['then'](function(_0x34774b){var _0x367b99=_0x1f8ab6[_0x2c4a('0x52')][_0x2c4a('0x28')]({'plain':!![]});if(!_0x367b99)throw new Error(_0x2c4a('0x53'));if(_0x367b99[_0x2c4a('0x54')]===_0x2c4a('0x52')){var _0x3af207=_0x34774b[_0x2c4a('0x28')]({'plain':!![]});var _0x47be5c='CustomDashboards';return db[_0x2c4a('0x55')][_0x2c4a('0x4e')]({'where':{'name':_0x47be5c,'userProfileId':_0x367b99[_0x2c4a('0x56')]},'raw':!![]})['then'](function(_0x87e60a){if(_0x87e60a&&_0x87e60a[_0x2c4a('0x57')]===0x0){return db[_0x2c4a('0x2a')][_0x2c4a('0x50')]({'name':_0x3af207[_0x2c4a('0x2f')],'resourceId':_0x3af207['id'],'type':_0x87e60a['name'],'sectionId':_0x87e60a['id']},{})[_0x2c4a('0x27')](function(){return _0x34774b;});}else{return _0x34774b;}})[_0x2c4a('0x4f')](function(_0x2aacdf){logger[_0x2c4a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aacdf);throw _0x2aacdf;});}return _0x34774b;})['then'](respondWithResult(_0x1d57db,0xc9))[_0x2c4a('0x4f')](handleError(_0x1d57db,null));};exports[_0x2c4a('0x58')]=function(_0x578bbc,_0x54b47b){var _0x3d625e={'where':{'id':_0x578bbc[_0x2c4a('0x59')]['id']}},_0x3b79fb={};_0x3b79fb[_0x2c4a('0x37')]=_[_0x2c4a('0x39')](db['Dashboard'][_0x2c4a('0x33')]);_0x3d625e[_0x2c4a('0x3c')]=_[_0x2c4a('0x3b')](_0x3b79fb[_0x2c4a('0x37')],qs[_0x2c4a('0x3d')](_0x578bbc['query'][_0x2c4a('0x3d')]));_0x3d625e['attributes']=_0x3d625e[_0x2c4a('0x3c')][_0x2c4a('0x5a')]?_0x3d625e['attributes']:_0x3b79fb['model'];if(_0x578bbc[_0x2c4a('0x38')]['includeAll']){_0x3d625e[_0x2c4a('0x49')]=[{'all':!![]}];}_0x3d625e=_['merge']({},_0x3d625e,_0x578bbc[_0x2c4a('0x4d')]);return db[_0x2c4a('0x47')]['find'](_0x3d625e)[_0x2c4a('0x27')](handleEntityNotFound(_0x54b47b,null))[_0x2c4a('0x27')](function(_0x19cee9){if(_0x19cee9){var _0x4cec07=_0x19cee9[_0x2c4a('0x28')]({'plain':!![]});_0x4cec07=qs[_0x2c4a('0x5b')](_0x4cec07,['id',_0x2c4a('0x5c'),_0x2c4a('0x5d')]);_0x578bbc[_0x2c4a('0x51')]=_[_0x2c4a('0x5b')](_0x578bbc[_0x2c4a('0x51')],['id',_0x2c4a('0x5c'),'updatedAt']);return db[_0x2c4a('0x47')][_0x2c4a('0x50')](_[_0x2c4a('0x45')](_0x4cec07,_0x578bbc[_0x2c4a('0x51')]),{'include':_0x578bbc[_0x2c4a('0x38')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2595cb){var _0x47e0d2=_0x578bbc[_0x2c4a('0x52')]['get']({'plain':!![]});if(!_0x47e0d2)throw new Error(_0x2c4a('0x53'));if(_0x47e0d2[_0x2c4a('0x54')]===_0x2c4a('0x52')){var _0x1666e1=_0x2595cb[_0x2c4a('0x28')]({'plain':!![]});var _0x26c20b=_0x2c4a('0x29');return db[_0x2c4a('0x55')][_0x2c4a('0x4e')]({'where':{'name':_0x26c20b,'userProfileId':_0x47e0d2[_0x2c4a('0x56')]},'raw':!![]})[_0x2c4a('0x27')](function(_0x409b1a){if(_0x409b1a&&_0x409b1a['autoAssociation']===0x0){return db[_0x2c4a('0x2a')]['create']({'name':_0x1666e1[_0x2c4a('0x2f')],'resourceId':_0x1666e1['id'],'type':_0x409b1a[_0x2c4a('0x2f')],'sectionId':_0x409b1a['id']},{})[_0x2c4a('0x27')](function(){return _0x2595cb;});}else{return _0x2595cb;}})['catch'](function(_0x5e1b96){logger[_0x2c4a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e1b96);throw _0x5e1b96;});}return _0x2595cb;});}})['then'](respondWithResult(_0x54b47b,0xc9))['catch'](handleError(_0x54b47b,null));};exports[_0x2c4a('0x5e')]=function(_0x2a3964,_0x41d231){if(_0x2a3964[_0x2c4a('0x51')]['id']){delete _0x2a3964['body']['id'];}return db[_0x2c4a('0x47')]['find']({'where':{'id':_0x2a3964[_0x2c4a('0x59')]['id']}})['then'](handleEntityNotFound(_0x41d231,null))[_0x2c4a('0x27')](saveUpdates(_0x2a3964[_0x2c4a('0x51')],null))[_0x2c4a('0x27')](respondWithResult(_0x41d231,null))[_0x2c4a('0x4f')](handleError(_0x41d231,null));};exports[_0x2c4a('0x2b')]=function(_0x1c12c2,_0x1f72fd){return db[_0x2c4a('0x47')][_0x2c4a('0x4e')]({'where':{'id':_0x1c12c2[_0x2c4a('0x59')]['id']}})[_0x2c4a('0x27')](handleEntityNotFound(_0x1f72fd,null))['then'](removeEntity(_0x1f72fd,null))[_0x2c4a('0x4f')](handleError(_0x1f72fd,null));};function widgetAttributes(_0x6ed5cb){try{switch(_0x6ed5cb[_0x2c4a('0x35')]){case _0x2c4a('0x5f'):return[{'name':_0x2c4a('0x60'),'value':_0x6ed5cb['attrUrl']||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x62')]:undefined)||'https://'}];case'custom':return[{'name':_0x2c4a('0x63'),'value':_0x6ed5cb[_0x2c4a('0x63')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb['attrs'][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x62')]:undefined)||''}];case _0x2c4a('0x64'):return[{'name':_0x2c4a('0x65'),'value':_0x6ed5cb[_0x2c4a('0x65')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x62')]:undefined)||_0x2c4a('0x66')},{'name':_0x2c4a('0x67'),'value':_0x6ed5cb[_0x2c4a('0x67')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x1]?_0x6ed5cb['attrs'][0x1][_0x2c4a('0x62')]:undefined)||'0.00'},{'name':_0x2c4a('0x68'),'value':_0x6ed5cb[_0x2c4a('0x68')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x2]?_0x6ed5cb[_0x2c4a('0x61')][0x2][_0x2c4a('0x62')]:undefined)||0xc}];case _0x2c4a('0x69'):return[{'name':_0x2c4a('0x6a'),'value':_0x6ed5cb[_0x2c4a('0x6a')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x62')]:undefined)||_0x2c4a('0x6b')},{'name':_0x2c4a('0x6c'),'value':_0x6ed5cb[_0x2c4a('0x6c')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x1]?_0x6ed5cb[_0x2c4a('0x61')][0x1][_0x2c4a('0x62')]:undefined)||[]},{'name':_0x2c4a('0x68'),'value':_0x6ed5cb[_0x2c4a('0x68')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb['attrs'][0x2]?_0x6ed5cb[_0x2c4a('0x61')][0x2]['value']:undefined)||0x14},{'name':_0x2c4a('0x6d'),'value':_0x6ed5cb['attrChannel']||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x3]?_0x6ed5cb['attrs'][0x3]['value']:undefined)||_0x2c4a('0x6e')},{'name':_0x2c4a('0x6f'),'value':_0x6ed5cb[_0x2c4a('0x6f')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x4]?_0x6ed5cb[_0x2c4a('0x61')][0x4][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x70'),'value':_0x6ed5cb[_0x2c4a('0x70')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x5]?_0x6ed5cb['attrs'][0x5][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x71'),'value':_0x6ed5cb[_0x2c4a('0x71')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x6]?_0x6ed5cb[_0x2c4a('0x61')][0x6][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x72'),'value':_0x6ed5cb[_0x2c4a('0x72')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x7]?_0x6ed5cb[_0x2c4a('0x61')][0x7]['value']:undefined)||''},{'name':_0x2c4a('0x73'),'value':_0x6ed5cb[_0x2c4a('0x73')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x8]?_0x6ed5cb[_0x2c4a('0x61')][0x8][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x74'),'value':_0x6ed5cb[_0x2c4a('0x74')]||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x9]?_0x6ed5cb[_0x2c4a('0x61')][0x9]['value']:undefined)||''}];case _0x2c4a('0x75'):case _0x2c4a('0x76'):return[{'name':_0x2c4a('0x77'),'value':_0x6ed5cb[_0x2c4a('0x77')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x62')]:undefined)||'total'},{'name':_0x2c4a('0x78'),'value':_0x6ed5cb['attrSerie2']||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x1]?_0x6ed5cb['attrs'][0x1][_0x2c4a('0x62')]:undefined)||null},{'name':_0x2c4a('0x79'),'value':_0x6ed5cb[_0x2c4a('0x79')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x2]?_0x6ed5cb[_0x2c4a('0x61')][0x2]['value']:undefined)||null},{'name':_0x2c4a('0x6c'),'value':_0x6ed5cb[_0x2c4a('0x6c')]||(_0x6ed5cb['attrs']&&_0x6ed5cb['attrs'][0x3]?_0x6ed5cb[_0x2c4a('0x61')][0x3]['value']:undefined)||[]},{'name':_0x2c4a('0x6d'),'value':_0x6ed5cb[_0x2c4a('0x6d')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x4]?_0x6ed5cb[_0x2c4a('0x61')][0x4][_0x2c4a('0x62')]:undefined)||'voice'},{'name':_0x2c4a('0x6f'),'value':_0x6ed5cb['attrEmailAccounts']||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x5]?_0x6ed5cb[_0x2c4a('0x61')][0x5][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x70'),'value':_0x6ed5cb['attrFaxAccounts']||(_0x6ed5cb['attrs']&&_0x6ed5cb[_0x2c4a('0x61')][0x6]?_0x6ed5cb[_0x2c4a('0x61')][0x6][_0x2c4a('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x6ed5cb[_0x2c4a('0x71')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x7]?_0x6ed5cb['attrs'][0x7][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x72'),'value':_0x6ed5cb[_0x2c4a('0x72')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb['attrs'][0x8]?_0x6ed5cb[_0x2c4a('0x61')][0x8]['value']:undefined)||''},{'name':_0x2c4a('0x73'),'value':_0x6ed5cb[_0x2c4a('0x73')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb['attrs'][0x9]?_0x6ed5cb['attrs'][0x9][_0x2c4a('0x62')]:undefined)||''},{'name':_0x2c4a('0x74'),'value':_0x6ed5cb['attrChatWebsites']||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0xa]?_0x6ed5cb[_0x2c4a('0x61')][0xa][_0x2c4a('0x62')]:undefined)||''}];case _0x2c4a('0x7a'):return[{'name':_0x2c4a('0x7b'),'type':_0x6ed5cb[_0x2c4a('0x7c')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x35')]:undefined)||null,'value':_0x6ed5cb[_0x2c4a('0x7b')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x0]?_0x6ed5cb[_0x2c4a('0x61')][0x0][_0x2c4a('0x62')]:undefined)||null},{'name':_0x2c4a('0x7d'),'value':_0x6ed5cb[_0x2c4a('0x7d')]||(_0x6ed5cb[_0x2c4a('0x61')]&&_0x6ed5cb[_0x2c4a('0x61')][0x1]?_0x6ed5cb[_0x2c4a('0x61')][0x1][_0x2c4a('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x4fcb47){logger[_0x2c4a('0x2d')](_0x2c4a('0x7e'),JSON[_0x2c4a('0x7f')](_0x4fcb47));return[];}}exports[_0x2c4a('0x80')]=function(_0x26002a,_0x380370,_0x3cd9c5){if(_0x26002a[_0x2c4a('0x51')]['id']){delete _0x26002a['body']['id'];}return db[_0x2c4a('0x47')][_0x2c4a('0x4e')]({'where':{'id':_0x26002a[_0x2c4a('0x59')]['id']}})['then'](handleEntityNotFound(_0x380370,null))[_0x2c4a('0x27')](function(_0x91b75e){if(_0x91b75e){_0x26002a['body']['DashboardId']=_0x91b75e['id'];_0x26002a[_0x2c4a('0x51')]['attrs']=widgetAttributes(_0x26002a[_0x2c4a('0x51')]);return db[_0x2c4a('0x81')][_0x2c4a('0x50')](_0x26002a[_0x2c4a('0x51')]);}})[_0x2c4a('0x27')](respondWithResult(_0x380370,null))['catch'](handleError(_0x380370,null));};exports[_0x2c4a('0x82')]=function(_0x23c002,_0x5958e7,_0x1ae5b3){var _0x21881b={};var _0x5460ae={};var _0xf195fb;var _0x443ed7;return db['Dashboard'][_0x2c4a('0x83')]({'where':{'id':_0x23c002[_0x2c4a('0x59')]['id']}})[_0x2c4a('0x27')](handleEntityNotFound(_0x5958e7,null))['then'](function(_0xe25b31){if(_0xe25b31){_0xf195fb=_0xe25b31;_0x5460ae[_0x2c4a('0x37')]=_[_0x2c4a('0x39')](db['DashboardItem'][_0x2c4a('0x33')]);_0x5460ae['query']=_[_0x2c4a('0x39')](_0x23c002[_0x2c4a('0x38')]);_0x5460ae['filters']=_['intersection'](_0x5460ae[_0x2c4a('0x37')],_0x5460ae[_0x2c4a('0x38')]);_0x21881b[_0x2c4a('0x3c')]=_[_0x2c4a('0x3b')](_0x5460ae['model'],qs['fields'](_0x23c002[_0x2c4a('0x38')]['fields']));_0x21881b[_0x2c4a('0x3c')]=_0x21881b[_0x2c4a('0x3c')]['length']?_0x21881b[_0x2c4a('0x3c')]:_0x5460ae[_0x2c4a('0x37')];_0x21881b[_0x2c4a('0x40')]=qs[_0x2c4a('0x41')](_0x23c002['query'][_0x2c4a('0x41')]);_0x21881b[_0x2c4a('0x42')]=qs[_0x2c4a('0x3a')](_[_0x2c4a('0x43')](_0x23c002[_0x2c4a('0x38')],_0x5460ae[_0x2c4a('0x3a')]));if(_0x23c002['query']['filter']){_0x21881b[_0x2c4a('0x42')]=_[_0x2c4a('0x45')](_0x21881b[_0x2c4a('0x42')],{'$or':_[_0x2c4a('0x32')](_0x21881b[_0x2c4a('0x3c')],function(_0x7bf88a){var _0x21da04={};_0x21da04[_0x7bf88a]={'$like':'%'+_0x23c002[_0x2c4a('0x38')][_0x2c4a('0x44')]+'%'};return _0x21da04;})});}_0x21881b=_['merge']({},_0x21881b,_0x23c002[_0x2c4a('0x4d')]);return _0xf195fb[_0x2c4a('0x82')](_0x21881b);}})[_0x2c4a('0x27')](function(_0xc79576){if(_0xc79576){_0x443ed7=_0xc79576[_0x2c4a('0x5a')];if(!_0x23c002['query'][_0x2c4a('0x3e')](_0x2c4a('0x3f'))){_0x21881b[_0x2c4a('0x22')]=qs[_0x2c4a('0x22')](_0x23c002[_0x2c4a('0x38')][_0x2c4a('0x22')]);_0x21881b[_0x2c4a('0x20')]=qs[_0x2c4a('0x20')](_0x23c002[_0x2c4a('0x38')][_0x2c4a('0x20')]);}return _0xf195fb[_0x2c4a('0x82')](_0x21881b);}})[_0x2c4a('0x27')](function(_0x54124d){if(_0x54124d){return _0x54124d?{'count':_0x443ed7,'rows':_0x54124d}:null;}})[_0x2c4a('0x27')](respondWithResult(_0x5958e7,null))['catch'](handleError(_0x5958e7,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad08=['Dashboard','save','update','remove','emit','hook','events'];(function(_0x400d32,_0x3a9508){var _0x2f88db=function(_0x11ab61){while(--_0x11ab61){_0x400d32['push'](_0x400d32['shift']());}};_0x2f88db(++_0x3a9508);}(_0xad08,0x1c6));var _0x8ad0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xad08[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x8ad0('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x8ad0('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8ad0('0x2'),'afterUpdate':_0x8ad0('0x3'),'afterDestroy':_0x8ad0('0x4')};function emitEvent(_0x4cc96b){return function(_0x1c233d,_0xb35f8,_0x15e573){DashboardEvents[_0x8ad0('0x5')](_0x4cc96b+':'+_0x1c233d['id'],_0x1c233d);DashboardEvents[_0x8ad0('0x5')](_0x4cc96b,_0x1c233d);_0x15e573(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8ad0('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0xdf93=['events','../../mysqldb','Dashboard','save','update','emit','hook'];(function(_0x370c7a,_0x1bde76){var _0x4a7779=function(_0x4b67f5){while(--_0x4b67f5){_0x370c7a['push'](_0x370c7a['shift']());}};_0x4a7779(++_0x1bde76);}(_0xdf93,0x13b));var _0x3df9=function(_0x3180ca,_0x336464){_0x3180ca=_0x3180ca-0x0;var _0x7ddfc3=_0xdf93[_0x3180ca];return _0x7ddfc3;};'use strict';var EventEmitter=require(_0x3df9('0x0'));var Dashboard=require(_0x3df9('0x1'))['db'][_0x3df9('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3df9('0x3'),'afterUpdate':_0x3df9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13c872){return function(_0x29d6b7,_0x237735,_0x1de094){DashboardEvents[_0x3df9('0x5')](_0x13c872+':'+_0x29d6b7['id'],_0x29d6b7);DashboardEvents[_0x3df9('0x5')](_0x13c872,_0x29d6b7);_0x1de094(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x3df9('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66e6=['exports','define','Dashboard','dashboards','util','api','moment','bluebird','rimraf','./dashboard.attributes'];(function(_0x7f516c,_0x3a9deb){var _0xe554db=function(_0x4424f9){while(--_0x4424f9){_0x7f516c['push'](_0x7f516c['shift']());}};_0xe554db(++_0x3a9deb);}(_0x66e6,0xfe));var _0x666e=function(_0x903cb9,_0x4f7d16){_0x903cb9=_0x903cb9-0x0;var _0x30f5ed=_0x66e6[_0x903cb9];return _0x30f5ed;};'use strict';var _=require('lodash');var util=require(_0x666e('0x0'));var logger=require('../../config/logger')(_0x666e('0x1'));var moment=require(_0x666e('0x2'));var BPromise=require(_0x666e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x666e('0x4'));var config=require('../../config/environment');var attributes=require(_0x666e('0x5'));module[_0x666e('0x6')]=function(_0x201944,_0x38082e){return _0x201944[_0x666e('0x7')](_0x666e('0x8'),attributes,{'tableName':_0x666e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdeb1=['Dashboard','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define'];(function(_0x5a6a16,_0x17d883){var _0x5a6311=function(_0x343069){while(--_0x343069){_0x5a6a16['push'](_0x5a6a16['shift']());}};_0x5a6311(++_0x17d883);}(_0xdeb1,0xde));var _0x1deb=function(_0x15ac49,_0x3550df){_0x15ac49=_0x15ac49-0x0;var _0x2f499c=_0xdeb1[_0x15ac49];return _0x2f499c;};'use strict';var _=require(_0x1deb('0x0'));var util=require(_0x1deb('0x1'));var logger=require(_0x1deb('0x2'))(_0x1deb('0x3'));var moment=require(_0x1deb('0x4'));var BPromise=require(_0x1deb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1deb('0x6'));var rimraf=require(_0x1deb('0x7'));var config=require(_0x1deb('0x8'));var attributes=require(_0x1deb('0x9'));module[_0x1deb('0xa')]=function(_0x43cfde,_0x67c3e2){return _0x43cfde[_0x1deb('0xb')](_0x1deb('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x687d=['request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s'];(function(_0x228aa5,_0x56aad3){var _0x4b329b=function(_0x1a44f7){while(--_0x1a44f7){_0x228aa5['push'](_0x228aa5['shift']());}};_0x4b329b(++_0x56aad3);}(_0x687d,0x191));var _0xd687=function(_0x59137b,_0x20880e){_0x59137b=_0x59137b-0x0;var _0x267490=_0x687d[_0x59137b];return _0x267490;};'use strict';var _=require('lodash');var util=require(_0xd687('0x0'));var moment=require(_0xd687('0x1'));var BPromise=require(_0xd687('0x2'));var rs=require(_0xd687('0x3'));var fs=require('fs');var Redis=require(_0xd687('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd687('0x5'));var logger=require(_0xd687('0x6'))(_0xd687('0x7'));var config=require('../../config/environment');var jayson=require(_0xd687('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xd687('0x9')]=_[_0xd687('0xa')](config[_0xd687('0x9')],{'host':_0xd687('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd687('0xc'))[_0xd687('0xd')](socket);function respondWithRpcPromise(_0x5be5f1,_0x1fa53d,_0xb79bef){return new BPromise(function(_0x203461,_0x15ad73){return client[_0xd687('0xe')](_0x5be5f1,_0xb79bef)['then'](function(_0x4a1f5f){logger[_0xd687('0xf')](_0xd687('0x10'),_0x1fa53d,'request\x20sent');logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1fa53d,_0xd687('0x11'),JSON['stringify'](_0x4a1f5f));if(_0x4a1f5f[_0xd687('0x12')]){if(_0x4a1f5f[_0xd687('0x12')][_0xd687('0x13')]===0x1f4){logger[_0xd687('0x12')](_0xd687('0x10'),_0x1fa53d,_0x4a1f5f[_0xd687('0x12')][_0xd687('0x14')]);return _0x15ad73(_0x4a1f5f[_0xd687('0x12')]['message']);}logger[_0xd687('0x12')](_0xd687('0x10'),_0x1fa53d,_0x4a1f5f[_0xd687('0x12')][_0xd687('0x14')]);return _0x203461(_0x4a1f5f['error']['message']);}else{logger[_0xd687('0xf')]('Dashboard,\x20%s,\x20%s',_0x1fa53d,_0xd687('0x11'));_0x203461(_0x4a1f5f[_0xd687('0x15')]['message']);}})['catch'](function(_0x3d5281){logger[_0xd687('0x12')](_0xd687('0x10'),_0x1fa53d,_0x3d5281);_0x15ad73(_0x3d5281);});});}
\ No newline at end of file
+var _0x73da=['../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x73da,0xfc));var _0xa73d=function(_0x19bf9c,_0xa5ef2){_0x19bf9c=_0x19bf9c-0x0;var _0x2fd6a6=_0x73da[_0x19bf9c];return _0x2fd6a6;};'use strict';var _=require(_0xa73d('0x0'));var util=require(_0xa73d('0x1'));var moment=require(_0xa73d('0x2'));var BPromise=require(_0xa73d('0x3'));var rs=require(_0xa73d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa73d('0x5'));var logger=require(_0xa73d('0x6'))(_0xa73d('0x7'));var config=require(_0xa73d('0x8'));var jayson=require(_0xa73d('0x9'));var client=jayson[_0xa73d('0xa')][_0xa73d('0xb')]({'port':0x232a});config['redis']=_[_0xa73d('0xc')](config['redis'],{'host':_0xa73d('0xd'),'port':0x18eb});var socket=require(_0xa73d('0xe'))(new Redis(config['redis']));require(_0xa73d('0xf'))[_0xa73d('0x10')](socket);function respondWithRpcPromise(_0x3365c7,_0x586b0d,_0xa55d81){return new BPromise(function(_0xe266d7,_0x6905c1){return client['request'](_0x3365c7,_0xa55d81)[_0xa73d('0x11')](function(_0x3576f0){logger['info'](_0xa73d('0x12'),_0x586b0d,'request\x20sent');logger[_0xa73d('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x586b0d,_0xa73d('0x14'),JSON['stringify'](_0x3576f0));if(_0x3576f0[_0xa73d('0x15')]){if(_0x3576f0[_0xa73d('0x15')]['code']===0x1f4){logger[_0xa73d('0x15')](_0xa73d('0x12'),_0x586b0d,_0x3576f0['error'][_0xa73d('0x16')]);return _0x6905c1(_0x3576f0[_0xa73d('0x15')][_0xa73d('0x16')]);}logger['error'](_0xa73d('0x12'),_0x586b0d,_0x3576f0[_0xa73d('0x15')][_0xa73d('0x16')]);return _0xe266d7(_0x3576f0[_0xa73d('0x15')][_0xa73d('0x16')]);}else{logger[_0xa73d('0x17')](_0xa73d('0x12'),_0x586b0d,_0xa73d('0x14'));_0xe266d7(_0x3576f0[_0xa73d('0x18')][_0xa73d('0x16')]);}})[_0xa73d('0x19')](function(_0x3bb146){logger[_0xa73d('0x15')](_0xa73d('0x12'),_0x586b0d,_0x3bb146);_0x6905c1(_0x3bb146);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3715=['save','remove','update','emit','length','./dashboard.events'];(function(_0x262f7d,_0xc206ad){var _0x25a1d6=function(_0x3a59d4){while(--_0x3a59d4){_0x262f7d['push'](_0x262f7d['shift']());}};_0x25a1d6(++_0xc206ad);}(_0x3715,0x1a9));var _0x5371=function(_0x57a109,_0x574bf4){_0x57a109=_0x57a109-0x0;var _0x47a582=_0x3715[_0x57a109];return _0x47a582;};'use strict';var DashboardEvents=require(_0x5371('0x0'));var events=[_0x5371('0x1'),_0x5371('0x2'),_0x5371('0x3')];function createListener(_0x4a9532,_0xd46829){return function(_0x5313bc){_0xd46829[_0x5371('0x4')](_0x4a9532,_0x5313bc);};}function removeListener(_0x22d1b3,_0xb718b3){return function(){DashboardEvents['removeListener'](_0x22d1b3,_0xb718b3);};}exports['register']=function(_0x1c1ad2){for(var _0x45109f=0x0,_0x547e3a=events[_0x5371('0x5')];_0x45109f<_0x547e3a;_0x45109f++){var _0x2bcbb2=events[_0x45109f];var _0x552781=createListener('dashboard:'+_0x2bcbb2,_0x1c1ad2);DashboardEvents['on'](_0x2bcbb2,_0x552781);}};
\ No newline at end of file
+var _0x626a=['save','remove','emit','removeListener','register','length','dashboard:'];(function(_0x3452ca,_0x51e20b){var _0x2b2b5b=function(_0x264294){while(--_0x264294){_0x3452ca['push'](_0x3452ca['shift']());}};_0x2b2b5b(++_0x51e20b);}(_0x626a,0x196));var _0xa626=function(_0x2c266a,_0x2ea2d8){_0x2c266a=_0x2c266a-0x0;var _0xc97c46=_0x626a[_0x2c266a];return _0xc97c46;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xa626('0x0'),_0xa626('0x1'),'update'];function createListener(_0x486e88,_0x44248d){return function(_0x23214e){_0x44248d[_0xa626('0x2')](_0x486e88,_0x23214e);};}function removeListener(_0x1ce32c,_0x39abf1){return function(){DashboardEvents[_0xa626('0x3')](_0x1ce32c,_0x39abf1);};}exports[_0xa626('0x4')]=function(_0xd3c4c){for(var _0x24ca5e=0x0,_0x17ef3c=events[_0xa626('0x5')];_0x24ca5e<_0x17ef3c;_0x24ca5e++){var _0x385617=events[_0x24ca5e];var _0xca04b5=createListener(_0xa626('0x6')+_0x385617,_0xd3c4c);DashboardEvents['on'](_0x385617,_0xca04b5);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe8bb=['isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','clone','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x110bb7,_0x56c479){var _0x1e6ac2=function(_0x27ca58){while(--_0x27ca58){_0x110bb7['push'](_0x110bb7['shift']());}};_0x1e6ac2(++_0x56c479);}(_0xe8bb,0xdb));var _0xbe8b=function(_0x2e01f4,_0x2120b2){_0x2e01f4=_0x2e01f4-0x0;var _0x9937c2=_0xe8bb[_0x2e01f4];return _0x9937c2;};'use strict';var multer=require(_0xbe8b('0x0'));var util=require(_0xbe8b('0x1'));var path=require(_0xbe8b('0x2'));var timeout=require(_0xbe8b('0x3'));var express=require(_0xbe8b('0x4'));var router=express['Router']();var fs_extra=require(_0xbe8b('0x5'));var auth=require(_0xbe8b('0x6'));var interaction=require(_0xbe8b('0x7'));var config=require(_0xbe8b('0x8'));var controller=require(_0xbe8b('0x9'));router[_0xbe8b('0xa')]('/',auth[_0xbe8b('0xb')](),controller[_0xbe8b('0xc')]);router[_0xbe8b('0xa')](_0xbe8b('0xd'),auth[_0xbe8b('0xb')](),controller[_0xbe8b('0xe')]);router[_0xbe8b('0xa')](_0xbe8b('0xf'),auth[_0xbe8b('0xb')](),controller['getItems']);router[_0xbe8b('0x10')]('/',auth[_0xbe8b('0xb')](),controller[_0xbe8b('0x11')]);router[_0xbe8b('0x10')](_0xbe8b('0x12'),auth['isAuthenticated'](),controller[_0xbe8b('0x13')]);router[_0xbe8b('0x10')](_0xbe8b('0xf'),auth[_0xbe8b('0xb')](),controller['addItem']);router['put'](_0xbe8b('0xd'),auth['isAuthenticated'](),controller[_0xbe8b('0x14')]);router[_0xbe8b('0x15')]('/:id',auth[_0xbe8b('0xb')](),controller[_0xbe8b('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xc0e5=['create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','post'];(function(_0x4a2577,_0x56a573){var _0x2f15bd=function(_0x3744e0){while(--_0x3744e0){_0x4a2577['push'](_0x4a2577['shift']());}};_0x2f15bd(++_0x56a573);}(_0xc0e5,0xe9));var _0x5c0e=function(_0x5ecc63,_0x110d0d){_0x5ecc63=_0x5ecc63-0x0;var _0x56e65f=_0xc0e5[_0x5ecc63];return _0x56e65f;};'use strict';var multer=require(_0x5c0e('0x0'));var util=require(_0x5c0e('0x1'));var path=require(_0x5c0e('0x2'));var timeout=require(_0x5c0e('0x3'));var express=require(_0x5c0e('0x4'));var router=express[_0x5c0e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c0e('0x6'));var interaction=require(_0x5c0e('0x7'));var config=require(_0x5c0e('0x8'));var controller=require(_0x5c0e('0x9'));router['get']('/',auth[_0x5c0e('0xa')](),controller[_0x5c0e('0xb')]);router[_0x5c0e('0xc')](_0x5c0e('0xd'),auth[_0x5c0e('0xa')](),controller[_0x5c0e('0xe')]);router[_0x5c0e('0xc')](_0x5c0e('0xf'),auth[_0x5c0e('0xa')](),controller['getItems']);router[_0x5c0e('0x10')]('/',auth[_0x5c0e('0xa')](),controller[_0x5c0e('0x11')]);router[_0x5c0e('0x10')](_0x5c0e('0x12'),auth[_0x5c0e('0xa')](),controller[_0x5c0e('0x13')]);router[_0x5c0e('0x10')]('/:id/items',auth[_0x5c0e('0xa')](),controller['addItem']);router[_0x5c0e('0x14')](_0x5c0e('0xd'),auth['isAuthenticated'](),controller[_0x5c0e('0x15')]);router[_0x5c0e('0x16')](_0x5c0e('0xd'),auth['isAuthenticated'](),controller[_0x5c0e('0x17')]);module[_0x5c0e('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46ed=['sequelize','squel','exports','STRING','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x152b25,_0x5da2a5){var _0x41b54a=function(_0x515690){while(--_0x515690){_0x152b25['push'](_0x152b25['shift']());}};_0x41b54a(++_0x5da2a5);}(_0x46ed,0x168));var _0xd46e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x46ed[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xd46e('0x0'));var squel=require(_0xd46e('0x1'));var _=require('lodash');module[_0xd46e('0x2')]={'title':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd46e('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xd46e('0x4')),'get':function(){try{return JSON[_0xd46e('0x5')](this['getDataValue'](_0xd46e('0x6')));}catch(_0x1926d9){return[];}},'set':function(_0x160bcf){try{this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')](_0x160bcf));}catch(_0x437ea0){this[_0xd46e('0x7')](_0xd46e('0x6'),JSON[_0xd46e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xd46e('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd46e('0x9')]},'col':{'type':Sequelize[_0xd46e('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd46e('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd46e('0x3')],'allowNull':![],'defaultValue':_0xd46e('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd46e('0x3')]},'titleFontSize':{'type':Sequelize[_0xd46e('0x9')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x187d=['stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue'];(function(_0x10e1d1,_0x32b9ad){var _0x379abc=function(_0x1cf055){while(--_0x1cf055){_0x10e1d1['push'](_0x10e1d1['shift']());}};_0x379abc(++_0x32b9ad);}(_0x187d,0x93));var _0xd187=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x187d[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0xd187('0x0'));var squel=require('squel');var _=require(_0xd187('0x1'));module[_0xd187('0x2')]={'title':{'type':Sequelize[_0xd187('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x5')),'get':function(){try{return JSON['parse'](this[_0xd187('0x6')](_0xd187('0x7')));}catch(_0x4ebc8d){return[];}},'set':function(_0x1d2533){try{this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')](_0x1d2533));}catch(_0x28ce2f){this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd187('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd187('0xa')]},'col':{'type':Sequelize[_0xd187('0xa')]},'background':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':_0xd187('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd187('0x3')]},'titleFontSize':{'type':Sequelize[_0xd187('0xa')],'defaultValue':0xc}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa786=['total','attrSerie2','attrSerie3','attrChatWebsites','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','catch','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','type','iframe','attrUrl','attrs','value','https://','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart'];(function(_0x3b45d7,_0xbc2848){var _0x4690e8=function(_0x209c3b){while(--_0x209c3b){_0x3b45d7['push'](_0x3b45d7['shift']());}};_0x4690e8(++_0xbc2848);}(_0xa786,0x71));var _0x6a78=function(_0x394c71,_0x582fe8){_0x394c71=_0x394c71-0x0;var _0x5d6e42=_0xa786[_0x394c71];return _0x5d6e42;};'use strict';var emlformat=require(_0x6a78('0x0'));var rimraf=require(_0x6a78('0x1'));var zipdir=require(_0x6a78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a78('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a78('0x4'));var util=require(_0x6a78('0x5'));var path=require(_0x6a78('0x6'));var sox=require(_0x6a78('0x7'));var csv=require(_0x6a78('0x8'));var ejs=require(_0x6a78('0x9'));var fs=require('fs');var fs_extra=require(_0x6a78('0xa'));var _=require('lodash');var squel=require(_0x6a78('0xb'));var crypto=require(_0x6a78('0xc'));var jsforce=require(_0x6a78('0xd'));var deskjs=require(_0x6a78('0xe'));var toCsv=require(_0x6a78('0x8'));var querystring=require(_0x6a78('0xf'));var Papa=require(_0x6a78('0x10'));var Redis=require(_0x6a78('0x11'));var authService=require(_0x6a78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6a78('0x13'));var hardwareService=require(_0x6a78('0x14'));var logger=require(_0x6a78('0x15'))('api');var utils=require(_0x6a78('0x16'));var config=require(_0x6a78('0x17'));var licenseUtil=require(_0x6a78('0x18'));var db=require(_0x6a78('0x19'))['db'];config[_0x6a78('0x1a')]=_['defaults'](config[_0x6a78('0x1a')],{'host':_0x6a78('0x1b'),'port':0x18eb});var socket=require(_0x6a78('0x1c'))(new Redis(config['redis']));require(_0x6a78('0x1d'))[_0x6a78('0x1e')](socket);function respondWithStatusCode(_0x4c5351,_0x476d18){_0x476d18=_0x476d18||0xcc;return function(_0x42ae6f){if(_0x42ae6f){return _0x4c5351[_0x6a78('0x1f')](_0x476d18);}return _0x4c5351[_0x6a78('0x20')](_0x476d18)[_0x6a78('0x21')]();};}function respondWithResult(_0x36e824,_0x4e9031){_0x4e9031=_0x4e9031||0xc8;return function(_0x27d687){if(_0x27d687){return _0x36e824[_0x6a78('0x20')](_0x4e9031)[_0x6a78('0x22')](_0x27d687);}};}function respondWithFilteredResult(_0x265f90,_0x4fa916){return function(_0x5e3616){if(_0x5e3616){var _0x460991=typeof _0x4fa916['offset']==='undefined'&&typeof _0x4fa916['limit']===_0x6a78('0x23');var _0xed3863=_0x5e3616[_0x6a78('0x24')];var _0x5e7922=_0x460991?0x0:_0x4fa916['offset'];var _0xcc06ea=_0x460991?_0x5e3616[_0x6a78('0x24')]:_0x4fa916[_0x6a78('0x25')]+_0x4fa916[_0x6a78('0x26')];var _0x5dc3fa;if(_0xcc06ea>=_0xed3863){_0xcc06ea=_0xed3863;_0x5dc3fa=0xc8;}else{_0x5dc3fa=0xce;}_0x265f90['status'](_0x5dc3fa);return _0x265f90['set'](_0x6a78('0x27'),_0x5e7922+'-'+_0xcc06ea+'/'+_0xed3863)['json'](_0x5e3616);}return null;};}function patchUpdates(_0xd938cd){return function(_0x2fbfd1){try{jsonpatch[_0x6a78('0x28')](_0x2fbfd1,_0xd938cd,!![]);}catch(_0x4b47b6){return BPromise[_0x6a78('0x29')](_0x4b47b6);}return _0x2fbfd1[_0x6a78('0x2a')]();};}function saveUpdates(_0x89fd2b,_0x2a363f){return function(_0x246f6c){if(_0x246f6c){return _0x246f6c[_0x6a78('0x2b')](_0x89fd2b)[_0x6a78('0x2c')](function(_0xefaa55){return _0xefaa55;});}return null;};}function removeEntity(_0x4ea33e,_0x28cbbf){return function(_0xf17e35){if(_0xf17e35){return _0xf17e35[_0x6a78('0x2d')]()['then'](function(){_0x4ea33e[_0x6a78('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbe2627,_0x196b81){return function(_0x5cef13){if(!_0x5cef13){_0xbe2627[_0x6a78('0x1f')](0x194);}return _0x5cef13;};}function handleError(_0x159b96,_0xfdd266){_0xfdd266=_0xfdd266||0x1f4;return function(_0x149105){logger['error'](_0x149105[_0x6a78('0x2e')]);if(_0x149105[_0x6a78('0x2f')]){delete _0x149105[_0x6a78('0x2f')];}_0x159b96[_0x6a78('0x20')](_0xfdd266)['send'](_0x149105);};}exports[_0x6a78('0x30')]=function(_0x9bc18,_0x3299c2){var _0x4cc569={'raw':![],'where':{'id':_0x9bc18[_0x6a78('0x31')]['id']}},_0x118f6c={};_0x118f6c['model']=_[_0x6a78('0x32')](db[_0x6a78('0x33')][_0x6a78('0x34')]);_0x118f6c[_0x6a78('0x35')]=_[_0x6a78('0x32')](_0x9bc18['query']);_0x118f6c[_0x6a78('0x36')]=_[_0x6a78('0x37')](_0x118f6c['model'],_0x118f6c[_0x6a78('0x35')]);_0x4cc569[_0x6a78('0x38')]=_[_0x6a78('0x37')](_0x118f6c[_0x6a78('0x39')],qs[_0x6a78('0x3a')](_0x9bc18[_0x6a78('0x35')]['fields']));_0x4cc569[_0x6a78('0x38')]=_0x4cc569['attributes'][_0x6a78('0x3b')]?_0x4cc569[_0x6a78('0x38')]:_0x118f6c[_0x6a78('0x39')];if(_0x9bc18[_0x6a78('0x35')][_0x6a78('0x3c')]){_0x4cc569[_0x6a78('0x3d')]=[{'all':!![]}];}_0x4cc569=_[_0x6a78('0x3e')]({},_0x4cc569,_0x9bc18[_0x6a78('0x3f')]);return db[_0x6a78('0x33')]['find'](_0x4cc569)['then'](handleEntityNotFound(_0x3299c2,null))[_0x6a78('0x2c')](respondWithResult(_0x3299c2,null))['catch'](handleError(_0x3299c2,null));};exports[_0x6a78('0x2d')]=function(_0x50cc5b,_0x1c1514){return db[_0x6a78('0x33')][_0x6a78('0x40')]({'where':{'id':_0x50cc5b[_0x6a78('0x31')]['id']}})[_0x6a78('0x2c')](handleEntityNotFound(_0x1c1514,null))[_0x6a78('0x2c')](removeEntity(_0x1c1514,null))['catch'](handleError(_0x1c1514,null));};function widgetAttributes(_0x34cb3a){try{switch(_0x34cb3a[_0x6a78('0x41')]){case _0x6a78('0x42'):return[{'name':'attrUrl','value':_0x34cb3a[_0x6a78('0x43')]||(_0x34cb3a['attrs']&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0][_0x6a78('0x45')]:undefined)||_0x6a78('0x46')}];case'custom':return[{'name':'attrPath','value':_0x34cb3a['attrPath']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a['attrs'][0x0][_0x6a78('0x45')]:undefined)||''}];case _0x6a78('0x47'):return[{'name':_0x6a78('0x48'),'value':_0x34cb3a[_0x6a78('0x48')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a['attrs'][0x0][_0x6a78('0x45')]:undefined)||_0x6a78('0x49')},{'name':_0x6a78('0x4a'),'value':_0x34cb3a[_0x6a78('0x4a')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1]['value']:undefined)||_0x6a78('0x4b')},{'name':'attrFontSize','value':_0x34cb3a[_0x6a78('0x4c')]||(_0x34cb3a['attrs']&&_0x34cb3a['attrs'][0x2]?_0x34cb3a[_0x6a78('0x44')][0x2][_0x6a78('0x45')]:undefined)||0xc}];case'counter':return[{'name':_0x6a78('0x4d'),'value':_0x34cb3a[_0x6a78('0x4d')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0]['value']:undefined)||'total'},{'name':_0x6a78('0x4e'),'value':_0x34cb3a[_0x6a78('0x4e')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1][_0x6a78('0x45')]:undefined)||[]},{'name':_0x6a78('0x4c'),'value':_0x34cb3a['attrFontSize']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x2]?_0x34cb3a['attrs'][0x2][_0x6a78('0x45')]:undefined)||0x14},{'name':_0x6a78('0x4f'),'value':_0x34cb3a[_0x6a78('0x4f')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x3]?_0x34cb3a[_0x6a78('0x44')][0x3]['value']:undefined)||_0x6a78('0x50')},{'name':_0x6a78('0x51'),'value':_0x34cb3a[_0x6a78('0x51')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x4]?_0x34cb3a['attrs'][0x4][_0x6a78('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x34cb3a[_0x6a78('0x52')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x5]?_0x34cb3a[_0x6a78('0x44')][0x5]['value']:undefined)||''},{'name':_0x6a78('0x53'),'value':_0x34cb3a[_0x6a78('0x53')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x6]?_0x34cb3a[_0x6a78('0x44')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x34cb3a[_0x6a78('0x54')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x7]?_0x34cb3a[_0x6a78('0x44')][0x7]['value']:undefined)||''},{'name':_0x6a78('0x55'),'value':_0x34cb3a[_0x6a78('0x55')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x8]?_0x34cb3a['attrs'][0x8][_0x6a78('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x34cb3a['attrChatWebsites']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x9]?_0x34cb3a[_0x6a78('0x44')][0x9][_0x6a78('0x45')]:undefined)||''}];case _0x6a78('0x56'):case'pie-chart':return[{'name':'attrSerie1','value':_0x34cb3a['attrSerie1']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0]['value']:undefined)||_0x6a78('0x57')},{'name':_0x6a78('0x58'),'value':_0x34cb3a['attrSerie2']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1][_0x6a78('0x45')]:undefined)||null},{'name':_0x6a78('0x59'),'value':_0x34cb3a[_0x6a78('0x59')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x2]?_0x34cb3a['attrs'][0x2]['value']:undefined)||null},{'name':_0x6a78('0x4e'),'value':_0x34cb3a['attrVoiceQueues']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x3]?_0x34cb3a[_0x6a78('0x44')][0x3][_0x6a78('0x45')]:undefined)||[]},{'name':'attrChannel','value':_0x34cb3a[_0x6a78('0x4f')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a['attrs'][0x4]?_0x34cb3a[_0x6a78('0x44')][0x4][_0x6a78('0x45')]:undefined)||_0x6a78('0x50')},{'name':_0x6a78('0x51'),'value':_0x34cb3a[_0x6a78('0x51')]||(_0x34cb3a['attrs']&&_0x34cb3a[_0x6a78('0x44')][0x5]?_0x34cb3a[_0x6a78('0x44')][0x5][_0x6a78('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x34cb3a['attrFaxAccounts']||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x6]?_0x34cb3a['attrs'][0x6][_0x6a78('0x45')]:undefined)||''},{'name':_0x6a78('0x53'),'value':_0x34cb3a[_0x6a78('0x53')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x7]?_0x34cb3a[_0x6a78('0x44')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x34cb3a[_0x6a78('0x54')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x8]?_0x34cb3a[_0x6a78('0x44')][0x8][_0x6a78('0x45')]:undefined)||''},{'name':_0x6a78('0x55'),'value':_0x34cb3a[_0x6a78('0x55')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x9]?_0x34cb3a[_0x6a78('0x44')][0x9][_0x6a78('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x34cb3a[_0x6a78('0x5a')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0xa]?_0x34cb3a[_0x6a78('0x44')][0xa][_0x6a78('0x45')]:undefined)||''}];case'web-report':return[{'name':_0x6a78('0x5b'),'type':_0x34cb3a[_0x6a78('0x5c')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a[_0x6a78('0x44')][0x0][_0x6a78('0x41')]:undefined)||null,'value':_0x34cb3a[_0x6a78('0x5b')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x0]?_0x34cb3a['attrs'][0x0][_0x6a78('0x45')]:undefined)||null},{'name':_0x6a78('0x5d'),'value':_0x34cb3a[_0x6a78('0x5d')]||(_0x34cb3a[_0x6a78('0x44')]&&_0x34cb3a[_0x6a78('0x44')][0x1]?_0x34cb3a[_0x6a78('0x44')][0x1][_0x6a78('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x2f7807){logger[_0x6a78('0x5e')](_0x6a78('0x5f'),JSON[_0x6a78('0x60')](_0x2f7807));return[];}}exports[_0x6a78('0x61')]=function(_0x245acb,_0x3fe964){if(_0x245acb['body']){_0x245acb[_0x6a78('0x62')][_0x6a78('0x44')]=widgetAttributes(_0x245acb[_0x6a78('0x62')]);}return db[_0x6a78('0x33')]['create'](_0x245acb['body'],{})[_0x6a78('0x2c')](respondWithResult(_0x3fe964,0xc9))[_0x6a78('0x63')](handleError(_0x3fe964,null));};exports[_0x6a78('0x2b')]=function(_0x9dfae6,_0x14282a){if(_0x9dfae6['body']['id']){delete _0x9dfae6[_0x6a78('0x62')]['id'];}_0x9dfae6[_0x6a78('0x62')][_0x6a78('0x44')]=widgetAttributes(_0x9dfae6[_0x6a78('0x62')]);return db['DashboardItem'][_0x6a78('0x40')]({'where':{'id':_0x9dfae6[_0x6a78('0x31')]['id']}})[_0x6a78('0x2c')](handleEntityNotFound(_0x14282a,null))['then'](saveUpdates(_0x9dfae6['body'],null))[_0x6a78('0x2c')](respondWithResult(_0x14282a,null))['catch'](handleError(_0x14282a,null));};
\ No newline at end of file
+var _0xed1f=['attrRefresh','stringify','create','body','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','catch','find','params','type','attrUrl','attrs','https://','custom','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrEmailAccounts','attrSmsAccounts','web-report','reportType','attrReport'];(function(_0x40cd3a,_0x3b00ae){var _0x385666=function(_0x4a8850){while(--_0x4a8850){_0x40cd3a['push'](_0x40cd3a['shift']());}};_0x385666(++_0x3b00ae);}(_0xed1f,0x170));var _0xfed1=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xed1f[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfed1('0x2'));var moment=require('moment');var BPromise=require(_0xfed1('0x3'));var Mustache=require('mustache');var util=require(_0xfed1('0x4'));var path=require(_0xfed1('0x5'));var sox=require(_0xfed1('0x6'));var csv=require(_0xfed1('0x7'));var ejs=require(_0xfed1('0x8'));var fs=require('fs');var fs_extra=require(_0xfed1('0x9'));var _=require(_0xfed1('0xa'));var squel=require(_0xfed1('0xb'));var crypto=require(_0xfed1('0xc'));var jsforce=require(_0xfed1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0x7'));var querystring=require(_0xfed1('0xe'));var Papa=require(_0xfed1('0xf'));var Redis=require('ioredis');var authService=require(_0xfed1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfed1('0x11'));var logger=require(_0xfed1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfed1('0x13'));var licenseUtil=require(_0xfed1('0x14'));var db=require('../../mysqldb')['db'];config[_0xfed1('0x15')]=_['defaults'](config[_0xfed1('0x15')],{'host':_0xfed1('0x16'),'port':0x18eb});var socket=require(_0xfed1('0x17'))(new Redis(config[_0xfed1('0x15')]));require('./dashboardItem.socket')[_0xfed1('0x18')](socket);function respondWithStatusCode(_0x3754c2,_0x4a0f51){_0x4a0f51=_0x4a0f51||0xcc;return function(_0x51631c){if(_0x51631c){return _0x3754c2[_0xfed1('0x19')](_0x4a0f51);}return _0x3754c2[_0xfed1('0x1a')](_0x4a0f51)[_0xfed1('0x1b')]();};}function respondWithResult(_0x5ed220,_0x223f42){_0x223f42=_0x223f42||0xc8;return function(_0x2218d5){if(_0x2218d5){return _0x5ed220[_0xfed1('0x1a')](_0x223f42)[_0xfed1('0x1c')](_0x2218d5);}};}function respondWithFilteredResult(_0x5ab809,_0x31ff97){return function(_0x4c492e){if(_0x4c492e){var _0x34512d=typeof _0x31ff97[_0xfed1('0x1d')]===_0xfed1('0x1e')&&typeof _0x31ff97[_0xfed1('0x1f')]===_0xfed1('0x1e');var _0x2926ac=_0x4c492e[_0xfed1('0x20')];var _0x10cc18=_0x34512d?0x0:_0x31ff97[_0xfed1('0x1d')];var _0x568405=_0x34512d?_0x4c492e[_0xfed1('0x20')]:_0x31ff97['offset']+_0x31ff97[_0xfed1('0x1f')];var _0x3e5ada;if(_0x568405>=_0x2926ac){_0x568405=_0x2926ac;_0x3e5ada=0xc8;}else{_0x3e5ada=0xce;}_0x5ab809[_0xfed1('0x1a')](_0x3e5ada);return _0x5ab809[_0xfed1('0x21')](_0xfed1('0x22'),_0x10cc18+'-'+_0x568405+'/'+_0x2926ac)[_0xfed1('0x1c')](_0x4c492e);}return null;};}function patchUpdates(_0x1748f5){return function(_0x15965d){try{jsonpatch['apply'](_0x15965d,_0x1748f5,!![]);}catch(_0x578aaa){return BPromise[_0xfed1('0x23')](_0x578aaa);}return _0x15965d['save']();};}function saveUpdates(_0x36a818,_0x4388f3){return function(_0x4cd3b8){if(_0x4cd3b8){return _0x4cd3b8[_0xfed1('0x24')](_0x36a818)[_0xfed1('0x25')](function(_0x472dbc){return _0x472dbc;});}return null;};}function removeEntity(_0x5bce5d,_0x1e8c3e){return function(_0xea7a81){if(_0xea7a81){return _0xea7a81['destroy']()[_0xfed1('0x25')](function(){_0x5bce5d[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x5705b9,_0x1337d6){return function(_0x425a47){if(!_0x425a47){_0x5705b9[_0xfed1('0x19')](0x194);}return _0x425a47;};}function handleError(_0x5ab942,_0x3cd60e){_0x3cd60e=_0x3cd60e||0x1f4;return function(_0x46cf02){logger[_0xfed1('0x26')](_0x46cf02[_0xfed1('0x27')]);if(_0x46cf02[_0xfed1('0x28')]){delete _0x46cf02[_0xfed1('0x28')];}_0x5ab942['status'](_0x3cd60e)[_0xfed1('0x29')](_0x46cf02);};}exports[_0xfed1('0x2a')]=function(_0x55b555,_0x34e47b){var _0x3c971d={'raw':![],'where':{'id':_0x55b555['params']['id']}},_0x2d3e62={};_0x2d3e62[_0xfed1('0x2b')]=_[_0xfed1('0x2c')](db[_0xfed1('0x2d')][_0xfed1('0x2e')]);_0x2d3e62['query']=_[_0xfed1('0x2c')](_0x55b555[_0xfed1('0x2f')]);_0x2d3e62[_0xfed1('0x30')]=_[_0xfed1('0x31')](_0x2d3e62[_0xfed1('0x2b')],_0x2d3e62['query']);_0x3c971d[_0xfed1('0x32')]=_[_0xfed1('0x31')](_0x2d3e62[_0xfed1('0x2b')],qs[_0xfed1('0x33')](_0x55b555[_0xfed1('0x2f')][_0xfed1('0x33')]));_0x3c971d[_0xfed1('0x32')]=_0x3c971d[_0xfed1('0x32')]['length']?_0x3c971d['attributes']:_0x2d3e62['model'];if(_0x55b555[_0xfed1('0x2f')][_0xfed1('0x34')]){_0x3c971d['include']=[{'all':!![]}];}_0x3c971d=_[_0xfed1('0x35')]({},_0x3c971d,_0x55b555['options']);return db['DashboardItem']['find'](_0x3c971d)[_0xfed1('0x25')](handleEntityNotFound(_0x34e47b,null))[_0xfed1('0x25')](respondWithResult(_0x34e47b,null))[_0xfed1('0x36')](handleError(_0x34e47b,null));};exports['destroy']=function(_0x4d7e32,_0x2b59f7){return db[_0xfed1('0x2d')][_0xfed1('0x37')]({'where':{'id':_0x4d7e32[_0xfed1('0x38')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x2b59f7,null))[_0xfed1('0x25')](removeEntity(_0x2b59f7,null))[_0xfed1('0x36')](handleError(_0x2b59f7,null));};function widgetAttributes(_0x50375a){try{switch(_0x50375a[_0xfed1('0x39')]){case'iframe':return[{'name':_0xfed1('0x3a'),'value':_0x50375a[_0xfed1('0x3a')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0]['value']:undefined)||_0xfed1('0x3c')}];case _0xfed1('0x3d'):return[{'name':'attrPath','value':_0x50375a['attrPath']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||''}];case'clock':return[{'name':_0xfed1('0x3f'),'value':_0x50375a['attrHourFormat']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||_0xfed1('0x40')},{'name':_0xfed1('0x41'),'value':_0x50375a[_0xfed1('0x41')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a[_0xfed1('0x3b')][0x1][_0xfed1('0x3e')]:undefined)||_0xfed1('0x42')},{'name':_0xfed1('0x43'),'value':_0x50375a['attrFontSize']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x2]?_0x50375a[_0xfed1('0x3b')][0x2][_0xfed1('0x3e')]:undefined)||0xc}];case _0xfed1('0x44'):return[{'name':_0xfed1('0x45'),'value':_0x50375a[_0xfed1('0x45')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a['attrs'][0x0][_0xfed1('0x3e')]:undefined)||_0xfed1('0x46')},{'name':_0xfed1('0x47'),'value':_0x50375a[_0xfed1('0x47')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a[_0xfed1('0x3b')][0x1]['value']:undefined)||[]},{'name':_0xfed1('0x43'),'value':_0x50375a[_0xfed1('0x43')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x2]?_0x50375a[_0xfed1('0x3b')][0x2][_0xfed1('0x3e')]:undefined)||0x14},{'name':_0xfed1('0x48'),'value':_0x50375a['attrChannel']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x3]?_0x50375a[_0xfed1('0x3b')][0x3]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x50375a['attrEmailAccounts']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x4]?_0x50375a[_0xfed1('0x3b')][0x4][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x49'),'value':_0x50375a['attrFaxAccounts']||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x5]?_0x50375a[_0xfed1('0x3b')][0x5][_0xfed1('0x3e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x50375a['attrSmsAccounts']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x6]?_0x50375a[_0xfed1('0x3b')][0x6][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4a'),'value':_0x50375a[_0xfed1('0x4a')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x7]?_0x50375a['attrs'][0x7][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4b'),'value':_0x50375a['attrWhatsappAccounts']||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x8]?_0x50375a[_0xfed1('0x3b')][0x8][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4c'),'value':_0x50375a['attrChatWebsites']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x9]?_0x50375a['attrs'][0x9][_0xfed1('0x3e')]:undefined)||''}];case _0xfed1('0x4d'):case'pie-chart':return[{'name':'attrSerie1','value':_0x50375a[_0xfed1('0x4e')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||_0xfed1('0x46')},{'name':_0xfed1('0x4f'),'value':_0x50375a['attrSerie2']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a['attrs'][0x1][_0xfed1('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x50375a[_0xfed1('0x50')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0x2]?_0x50375a[_0xfed1('0x3b')][0x2][_0xfed1('0x3e')]:undefined)||null},{'name':_0xfed1('0x47'),'value':_0x50375a[_0xfed1('0x47')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x3]?_0x50375a[_0xfed1('0x3b')][0x3][_0xfed1('0x3e')]:undefined)||[]},{'name':'attrChannel','value':_0x50375a['attrChannel']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x4]?_0x50375a['attrs'][0x4][_0xfed1('0x3e')]:undefined)||_0xfed1('0x51')},{'name':_0xfed1('0x52'),'value':_0x50375a['attrEmailAccounts']||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x5]?_0x50375a[_0xfed1('0x3b')][0x5]['value']:undefined)||''},{'name':_0xfed1('0x49'),'value':_0x50375a[_0xfed1('0x49')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x6]?_0x50375a[_0xfed1('0x3b')][0x6][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x53'),'value':_0x50375a[_0xfed1('0x53')]||(_0x50375a['attrs']&&_0x50375a['attrs'][0x7]?_0x50375a[_0xfed1('0x3b')][0x7]['value']:undefined)||''},{'name':_0xfed1('0x4a'),'value':_0x50375a[_0xfed1('0x4a')]||(_0x50375a['attrs']&&_0x50375a['attrs'][0x8]?_0x50375a[_0xfed1('0x3b')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x50375a[_0xfed1('0x4b')]||(_0x50375a['attrs']&&_0x50375a[_0xfed1('0x3b')][0x9]?_0x50375a['attrs'][0x9][_0xfed1('0x3e')]:undefined)||''},{'name':_0xfed1('0x4c'),'value':_0x50375a[_0xfed1('0x4c')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0xa]?_0x50375a[_0xfed1('0x3b')][0xa][_0xfed1('0x3e')]:undefined)||''}];case _0xfed1('0x54'):return[{'name':'attrReport','type':_0x50375a[_0xfed1('0x55')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a['attrs'][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x39')]:undefined)||null,'value':_0x50375a[_0xfed1('0x56')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x0]?_0x50375a[_0xfed1('0x3b')][0x0][_0xfed1('0x3e')]:undefined)||null},{'name':_0xfed1('0x57'),'value':_0x50375a[_0xfed1('0x57')]||(_0x50375a[_0xfed1('0x3b')]&&_0x50375a[_0xfed1('0x3b')][0x1]?_0x50375a['attrs'][0x1][_0xfed1('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x5a8c89){logger[_0xfed1('0x26')]('widgetAttributes:\x20%s',JSON[_0xfed1('0x58')](_0x5a8c89));return[];}}exports[_0xfed1('0x59')]=function(_0xeb4848,_0x5b387a){if(_0xeb4848['body']){_0xeb4848[_0xfed1('0x5a')][_0xfed1('0x3b')]=widgetAttributes(_0xeb4848[_0xfed1('0x5a')]);}return db[_0xfed1('0x2d')][_0xfed1('0x59')](_0xeb4848['body'],{})[_0xfed1('0x25')](respondWithResult(_0x5b387a,0xc9))[_0xfed1('0x36')](handleError(_0x5b387a,null));};exports['update']=function(_0x515b23,_0x3387fc){if(_0x515b23[_0xfed1('0x5a')]['id']){delete _0x515b23[_0xfed1('0x5a')]['id'];}_0x515b23[_0xfed1('0x5a')][_0xfed1('0x3b')]=widgetAttributes(_0x515b23[_0xfed1('0x5a')]);return db[_0xfed1('0x2d')][_0xfed1('0x37')]({'where':{'id':_0x515b23[_0xfed1('0x38')]['id']}})['then'](handleEntityNotFound(_0x3387fc,null))[_0xfed1('0x25')](saveUpdates(_0x515b23[_0xfed1('0x5a')],null))['then'](respondWithResult(_0x3387fc,null))['catch'](handleError(_0x3387fc,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c84=['DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5c84,0x1ca));var _0x45c8=function(_0x203fa3,_0x1acde1){_0x203fa3=_0x203fa3-0x0;var _0x293831=_0x5c84[_0x203fa3];return _0x293831;};'use strict';var EventEmitter=require(_0x45c8('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x45c8('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x45c8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x45c8('0x3'),'afterDestroy':_0x45c8('0x4')};function emitEvent(_0x574115){return function(_0x281a51,_0x4d0715,_0x23b847){DashboardItemEvents[_0x45c8('0x5')](_0x574115+':'+_0x281a51['id'],_0x281a51);DashboardItemEvents[_0x45c8('0x5')](_0x574115,_0x281a51);_0x23b847(null);};}for(var e in events){if(events[_0x45c8('0x6')](e)){var event=events[e];DashboardItem[_0x45c8('0x7')](e,emitEvent(event));}}module[_0x45c8('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0x4c47=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4c47,0x7b));var _0x74c4=function(_0xe81bf6,_0x2322a6){_0xe81bf6=_0xe81bf6-0x0;var _0x1ee4e4=_0x4c47[_0xe81bf6];return _0x1ee4e4;};'use strict';var EventEmitter=require(_0x74c4('0x0'));var DashboardItem=require(_0x74c4('0x1'))['db'][_0x74c4('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x74c4('0x3'),'afterUpdate':_0x74c4('0x4'),'afterDestroy':_0x74c4('0x5')};function emitEvent(_0x5b2f2d){return function(_0x35acac,_0x30b6b8,_0x38f901){DashboardItemEvents[_0x74c4('0x6')](_0x5b2f2d+':'+_0x35acac['id'],_0x35acac);DashboardItemEvents['emit'](_0x5b2f2d,_0x35acac);_0x38f901(null);};}for(var e in events){if(events[_0x74c4('0x7')](e)){var event=events[e];DashboardItem[_0x74c4('0x8')](e,emitEvent(event));}}module[_0x74c4('0x9')]=DashboardItemEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2516=['define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x2516,0x9d));var _0x6251=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x2516[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var logger=require(_0x6251('0x2'))(_0x6251('0x3'));var moment=require(_0x6251('0x4'));var BPromise=require('bluebird');var rp=require(_0x6251('0x5'));var fs=require('fs');var path=require(_0x6251('0x6'));var rimraf=require(_0x6251('0x7'));var config=require(_0x6251('0x8'));var attributes=require(_0x6251('0x9'));module[_0x6251('0xa')]=function(_0x52d3b7,_0x3be691){return _0x52d3b7[_0x6251('0xb')](_0x6251('0xc'),attributes,{'tableName':_0x6251('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d5c=['exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','rimraf','./dashboardItem.attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1d5c,0xeb));var _0xc1d5=function(_0x1cde38,_0x4b85b9){_0x1cde38=_0x1cde38-0x0;var _0x42af72=_0x1d5c[_0x1cde38];return _0x42af72;};'use strict';var _=require(_0xc1d5('0x0'));var util=require(_0xc1d5('0x1'));var logger=require(_0xc1d5('0x2'))(_0xc1d5('0x3'));var moment=require(_0xc1d5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d5('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1d5('0x6'));module[_0xc1d5('0x7')]=function(_0x4a80ad,_0x2accf0){return _0x4a80ad[_0xc1d5('0x8')](_0xc1d5('0x9'),attributes,{'tableName':_0xc1d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a4a=['catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','DashboardItem,\x20%s,\x20%s','message'];(function(_0x530c80,_0x554bb1){var _0x43c149=function(_0x1e66d3){while(--_0x1e66d3){_0x530c80['push'](_0x530c80['shift']());}};_0x43c149(++_0x554bb1);}(_0x4a4a,0x1b1));var _0xa4a4=function(_0x404682,_0x547c67){_0x404682=_0x404682-0x0;var _0x85dadd=_0x4a4a[_0x404682];return _0x85dadd;};'use strict';var _=require('lodash');var util=require(_0xa4a4('0x0'));var moment=require(_0xa4a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xa4a4('0x2'));var fs=require('fs');var Redis=require(_0xa4a4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4a4('0x4'));var logger=require(_0xa4a4('0x5'))('rpc');var config=require(_0xa4a4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4a4('0x7')][_0xa4a4('0x8')]({'port':0x232a});config[_0xa4a4('0x9')]=_[_0xa4a4('0xa')](config[_0xa4a4('0x9')],{'host':_0xa4a4('0xb'),'port':0x18eb});var socket=require(_0xa4a4('0xc'))(new Redis(config[_0xa4a4('0x9')]));require(_0xa4a4('0xd'))['register'](socket);function respondWithRpcPromise(_0x488cf7,_0x47f415,_0x58d164){return new BPromise(function(_0x49efdf,_0x2906b9){return client[_0xa4a4('0xe')](_0x488cf7,_0x58d164)['then'](function(_0x1276e4){logger[_0xa4a4('0xf')]('DashboardItem,\x20%s,\x20%s',_0x47f415,'request\x20sent');logger[_0xa4a4('0x10')](_0xa4a4('0x11'),_0x47f415,_0xa4a4('0x12'),JSON[_0xa4a4('0x13')](_0x1276e4));if(_0x1276e4[_0xa4a4('0x14')]){if(_0x1276e4['error']['code']===0x1f4){logger[_0xa4a4('0x14')](_0xa4a4('0x15'),_0x47f415,_0x1276e4[_0xa4a4('0x14')]['message']);return _0x2906b9(_0x1276e4[_0xa4a4('0x14')]['message']);}logger[_0xa4a4('0x14')](_0xa4a4('0x15'),_0x47f415,_0x1276e4[_0xa4a4('0x14')][_0xa4a4('0x16')]);return _0x49efdf(_0x1276e4[_0xa4a4('0x14')][_0xa4a4('0x16')]);}else{logger[_0xa4a4('0xf')](_0xa4a4('0x15'),_0x47f415,_0xa4a4('0x12'));_0x49efdf(_0x1276e4['result'][_0xa4a4('0x16')]);}})[_0xa4a4('0x17')](function(_0x58bd97){logger[_0xa4a4('0x14')](_0xa4a4('0x15'),_0x47f415,_0x58bd97);_0x2906b9(_0x58bd97);});});}
\ No newline at end of file
+var _0x0dfc=['localhost','socket.io-emitter','./dashboardItem.socket','request','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults'];(function(_0x46b36c,_0x2442eb){var _0x26d722=function(_0x101214){while(--_0x101214){_0x46b36c['push'](_0x46b36c['shift']());}};_0x26d722(++_0x2442eb);}(_0x0dfc,0xb0));var _0xc0df=function(_0x121a5c,_0x480485){_0x121a5c=_0x121a5c-0x0;var _0x38c5b6=_0x0dfc[_0x121a5c];return _0x38c5b6;};'use strict';var _=require(_0xc0df('0x0'));var util=require('util');var moment=require(_0xc0df('0x1'));var BPromise=require(_0xc0df('0x2'));var rs=require(_0xc0df('0x3'));var fs=require('fs');var Redis=require(_0xc0df('0x4'));var db=require(_0xc0df('0x5'))['db'];var utils=require(_0xc0df('0x6'));var logger=require(_0xc0df('0x7'))(_0xc0df('0x8'));var config=require(_0xc0df('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc0df('0xa')][_0xc0df('0xb')]({'port':0x232a});config['redis']=_[_0xc0df('0xc')](config['redis'],{'host':_0xc0df('0xd'),'port':0x18eb});var socket=require(_0xc0df('0xe'))(new Redis(config['redis']));require(_0xc0df('0xf'))['register'](socket);function respondWithRpcPromise(_0x300f76,_0xd7a979,_0x4c8009){return new BPromise(function(_0x302ab9,_0x499394){return client[_0xc0df('0x10')](_0x300f76,_0x4c8009)['then'](function(_0x20c9ca){logger[_0xc0df('0x11')]('DashboardItem,\x20%s,\x20%s',_0xd7a979,_0xc0df('0x12'));logger[_0xc0df('0x13')](_0xc0df('0x14'),_0xd7a979,_0xc0df('0x12'),JSON['stringify'](_0x20c9ca));if(_0x20c9ca[_0xc0df('0x15')]){if(_0x20c9ca['error'][_0xc0df('0x16')]===0x1f4){logger[_0xc0df('0x15')](_0xc0df('0x17'),_0xd7a979,_0x20c9ca[_0xc0df('0x15')]['message']);return _0x499394(_0x20c9ca['error'][_0xc0df('0x18')]);}logger[_0xc0df('0x15')](_0xc0df('0x17'),_0xd7a979,_0x20c9ca[_0xc0df('0x15')]['message']);return _0x302ab9(_0x20c9ca[_0xc0df('0x15')][_0xc0df('0x18')]);}else{logger[_0xc0df('0x11')](_0xc0df('0x17'),_0xd7a979,_0xc0df('0x12'));_0x302ab9(_0x20c9ca[_0xc0df('0x19')][_0xc0df('0x18')]);}})[_0xc0df('0x1a')](function(_0x120ff2){logger[_0xc0df('0x15')](_0xc0df('0x17'),_0xd7a979,_0x120ff2);_0x499394(_0x120ff2);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e61=['./dashboardItem.events','save','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x469fa0,_0x43695c){var _0x3fa3b4=function(_0xfb0465){while(--_0xfb0465){_0x469fa0['push'](_0x469fa0['shift']());}};_0x3fa3b4(++_0x43695c);}(_0x9e61,0x15f));var _0x19e6=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x9e61[_0x59d89e];return _0x554e93;};'use strict';var DashboardItemEvents=require(_0x19e6('0x0'));var events=[_0x19e6('0x1'),_0x19e6('0x2'),_0x19e6('0x3')];function createListener(_0x26484f,_0x591cde){return function(_0x4c5396){_0x591cde[_0x19e6('0x4')](_0x26484f,_0x4c5396);};}function removeListener(_0x292925,_0x49e553){return function(){DashboardItemEvents[_0x19e6('0x5')](_0x292925,_0x49e553);};}exports[_0x19e6('0x6')]=function(_0x5bfc12){for(var _0x6ac887=0x0,_0x127866=events[_0x19e6('0x7')];_0x6ac887<_0x127866;_0x6ac887++){var _0x59a228=events[_0x6ac887];var _0x5362bf=createListener(_0x19e6('0x8')+_0x59a228,_0x5bfc12);DashboardItemEvents['on'](_0x59a228,_0x5362bf);}};
\ No newline at end of file
+var _0x99c0=['save','remove','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x558262,_0x586fa4){var _0x3300c5=function(_0x1c3f69){while(--_0x1c3f69){_0x558262['push'](_0x558262['shift']());}};_0x3300c5(++_0x586fa4);}(_0x99c0,0xca));var _0x099c=function(_0x5ac15e,_0x4af04b){_0x5ac15e=_0x5ac15e-0x0;var _0x2130de=_0x99c0[_0x5ac15e];return _0x2130de;};'use strict';var DashboardItemEvents=require(_0x099c('0x0'));var events=[_0x099c('0x1'),_0x099c('0x2'),'update'];function createListener(_0x31cede,_0x1e6e50){return function(_0x1290d8){_0x1e6e50[_0x099c('0x3')](_0x31cede,_0x1290d8);};}function removeListener(_0x26db3b,_0x3c0fbd){return function(){DashboardItemEvents[_0x099c('0x4')](_0x26db3b,_0x3c0fbd);};}exports[_0x099c('0x5')]=function(_0x278147){for(var _0x549177=0x0,_0x5df603=events['length'];_0x549177<_0x5df603;_0x549177++){var _0x3adcc9=events[_0x549177];var _0x938ade=createListener(_0x099c('0x6')+_0x3adcc9,_0x278147);DashboardItemEvents['on'](_0x3adcc9,_0x938ade);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7eec=['/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','get'];(function(_0x48b01c,_0x493709){var _0x5442e3=function(_0x5623b6){while(--_0x5623b6){_0x48b01c['push'](_0x48b01c['shift']());}};_0x5442e3(++_0x493709);}(_0x7eec,0x79));var _0xc7ee=function(_0x10b533,_0x53ea06){_0x10b533=_0x10b533-0x0;var _0x4f6059=_0x7eec[_0x10b533];return _0x4f6059;};'use strict';var multer=require('multer');var util=require(_0xc7ee('0x0'));var path=require(_0xc7ee('0x1'));var timeout=require(_0xc7ee('0x2'));var express=require(_0xc7ee('0x3'));var router=express[_0xc7ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7ee('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xc7ee('0x6')](_0xc7ee('0x7'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc7ee('0xa')]);router[_0xc7ee('0xb')](_0xc7ee('0x7'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xc')]);router[_0xc7ee('0xd')](_0xc7ee('0x7'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xe')]);module[_0xc7ee('0xf')]=router;
\ No newline at end of file
+var _0xff58=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','create','put','isAuthenticated','delete','multer','util','path'];(function(_0x47b9f3,_0x24b3b1){var _0x2d47aa=function(_0x30bcf4){while(--_0x30bcf4){_0x47b9f3['push'](_0x47b9f3['shift']());}};_0x2d47aa(++_0x24b3b1);}(_0xff58,0x141));var _0x8ff5=function(_0x541a55,_0x6edd1c){_0x541a55=_0x541a55-0x0;var _0x3706cc=_0xff58[_0x541a55];return _0x3706cc;};'use strict';var multer=require(_0x8ff5('0x0'));var util=require(_0x8ff5('0x1'));var path=require(_0x8ff5('0x2'));var timeout=require('connect-timeout');var express=require(_0x8ff5('0x3'));var router=express[_0x8ff5('0x4')]();var fs_extra=require(_0x8ff5('0x5'));var auth=require(_0x8ff5('0x6'));var interaction=require(_0x8ff5('0x7'));var config=require(_0x8ff5('0x8'));var controller=require(_0x8ff5('0x9'));router[_0x8ff5('0xa')](_0x8ff5('0xb'),auth['isAuthenticated'](),controller[_0x8ff5('0xc')]);router[_0x8ff5('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ff5('0xe')]);router[_0x8ff5('0xf')](_0x8ff5('0xb'),auth[_0x8ff5('0x10')](),controller['update']);router[_0x8ff5('0x11')]('/:id',auth[_0x8ff5('0x10')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef32=['STRING','ENUM','second','third','sequelize','exports'];(function(_0x29b8cc,_0x404aba){var _0x880a7d=function(_0x2eae8a){while(--_0x2eae8a){_0x29b8cc['push'](_0x29b8cc['shift']());}};_0x880a7d(++_0x404aba);}(_0xef32,0x112));var _0x2ef3=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xef32[_0x26f1b2];return _0x1624a4;};'use strict';var Sequelize=require(_0x2ef3('0x0'));module[_0x2ef3('0x1')]={'name':{'type':Sequelize[_0x2ef3('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x2ef3('0x3')]('first',_0x2ef3('0x4'),_0x2ef3('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x2ef3('0x2')]}};
\ No newline at end of file
+var _0x935b=['first','second','STRING','sequelize','exports'];(function(_0x453ea4,_0x4165e6){var _0x59dd10=function(_0x4c1c16){while(--_0x4c1c16){_0x453ea4['push'](_0x453ea4['shift']());}};_0x59dd10(++_0x4165e6);}(_0x935b,0x80));var _0xb935=function(_0x505082,_0xf56392){_0x505082=_0x505082-0x0;var _0x29365a=_0x935b[_0x505082];return _0x29365a;};'use strict';var Sequelize=require(_0xb935('0x0'));module[_0xb935('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb935('0x2'),_0xb935('0x3'),'third'),'allowNull':![],'defaultValue':_0xb935('0x2')},'description':{'type':Sequelize[_0xb935('0x4')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ba4=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','Disposition','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','length','nolimit','offset','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','attributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x748f0a,_0x4a5884){var _0x31929b=function(_0xac8200){while(--_0xac8200){_0x748f0a['push'](_0x748f0a['shift']());}};_0x31929b(++_0x4a5884);}(_0x8ba4,0x1ec));var _0x48ba=function(_0x134bfc,_0x144d5f){_0x134bfc=_0x134bfc-0x0;var _0x2f4dcc=_0x8ba4[_0x134bfc];return _0x2f4dcc;};'use strict';var emlformat=require(_0x48ba('0x0'));var rimraf=require(_0x48ba('0x1'));var zipdir=require(_0x48ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48ba('0x3'));var moment=require(_0x48ba('0x4'));var BPromise=require(_0x48ba('0x5'));var Mustache=require(_0x48ba('0x6'));var util=require(_0x48ba('0x7'));var path=require(_0x48ba('0x8'));var sox=require('sox');var csv=require(_0x48ba('0x9'));var ejs=require(_0x48ba('0xa'));var fs=require('fs');var fs_extra=require(_0x48ba('0xb'));var _=require(_0x48ba('0xc'));var squel=require(_0x48ba('0xd'));var crypto=require(_0x48ba('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x48ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x48ba('0x10'));var Papa=require(_0x48ba('0x11'));var Redis=require(_0x48ba('0x12'));var authService=require(_0x48ba('0x13'));var qs=require(_0x48ba('0x14'));var as=require(_0x48ba('0x15'));var hardwareService=require(_0x48ba('0x16'));var logger=require('../../config/logger')(_0x48ba('0x17'));var utils=require('../../config/utils');var config=require(_0x48ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x48ba('0x19'))['db'];function respondWithStatusCode(_0x145e9b,_0x13002c){_0x13002c=_0x13002c||0xcc;return function(_0x802aa6){if(_0x802aa6){return _0x145e9b['sendStatus'](_0x13002c);}return _0x145e9b[_0x48ba('0x1a')](_0x13002c)[_0x48ba('0x1b')]();};}function respondWithResult(_0x11420d,_0x40dfd8){_0x40dfd8=_0x40dfd8||0xc8;return function(_0x21c51c){if(_0x21c51c){return _0x11420d[_0x48ba('0x1a')](_0x40dfd8)[_0x48ba('0x1c')](_0x21c51c);}};}function respondWithFilteredResult(_0x359e9b,_0x14bf1c){return function(_0x1a6346){if(_0x1a6346){var _0x2cca2d=typeof _0x14bf1c['offset']===_0x48ba('0x1d')&&typeof _0x14bf1c[_0x48ba('0x1e')]===_0x48ba('0x1d');var _0x1b4185=_0x1a6346[_0x48ba('0x1f')];var _0x450633=_0x2cca2d?0x0:_0x14bf1c['offset'];var _0x1eef13=_0x2cca2d?_0x1a6346[_0x48ba('0x1f')]:_0x14bf1c['offset']+_0x14bf1c[_0x48ba('0x1e')];var _0x8013cc;if(_0x1eef13>=_0x1b4185){_0x1eef13=_0x1b4185;_0x8013cc=0xc8;}else{_0x8013cc=0xce;}_0x359e9b[_0x48ba('0x1a')](_0x8013cc);return _0x359e9b[_0x48ba('0x20')](_0x48ba('0x21'),_0x450633+'-'+_0x1eef13+'/'+_0x1b4185)[_0x48ba('0x1c')](_0x1a6346);}return null;};}function patchUpdates(_0x396a8f){return function(_0x4092ce){try{jsonpatch[_0x48ba('0x22')](_0x4092ce,_0x396a8f,!![]);}catch(_0x55af07){return BPromise['reject'](_0x55af07);}return _0x4092ce[_0x48ba('0x23')]();};}function saveUpdates(_0x42f1fa,_0x19ce1e){return function(_0x1f4472){if(_0x1f4472){return _0x1f4472[_0x48ba('0x24')](_0x42f1fa)[_0x48ba('0x25')](function(_0xf7ad86){return _0xf7ad86;});}return null;};}function removeEntity(_0x11bf67,_0x453c04){return function(_0x778ef4){if(_0x778ef4){return _0x778ef4['destroy']()[_0x48ba('0x25')](function(){var _0x274dfe=_0x778ef4[_0x48ba('0x26')]({'plain':!![]});var _0x2d384c='Dispositions';return db[_0x48ba('0x27')][_0x48ba('0x28')]({'where':{'type':_0x2d384c,'resourceId':_0x274dfe['id']}})[_0x48ba('0x25')](function(){return _0x778ef4;});})[_0x48ba('0x25')](function(){_0x11bf67[_0x48ba('0x1a')](0xcc)[_0x48ba('0x1b')]();});}};}function handleEntityNotFound(_0x4b967c,_0x59602f){return function(_0xe53cb3){if(!_0xe53cb3){_0x4b967c[_0x48ba('0x29')](0x194);}return _0xe53cb3;};}function handleError(_0x46d274,_0x1a469a){_0x1a469a=_0x1a469a||0x1f4;return function(_0x495e07){logger[_0x48ba('0x2a')](_0x495e07[_0x48ba('0x2b')]);if(_0x495e07[_0x48ba('0x2c')]){delete _0x495e07[_0x48ba('0x2c')];}_0x46d274[_0x48ba('0x1a')](_0x1a469a)[_0x48ba('0x2d')](_0x495e07);};}exports['index']=function(_0x4775c9,_0x2bc5ff){var _0x53490d={},_0x14a214={},_0x2be2ed={'count':0x0,'rows':[]};var _0x37d8a1=_['map'](db[_0x48ba('0x2e')][_0x48ba('0x2f')],function(_0x2735fa){return{'name':_0x2735fa[_0x48ba('0x30')],'type':_0x2735fa[_0x48ba('0x31')]['key']};});_0x14a214[_0x48ba('0x32')]=_[_0x48ba('0x33')](_0x37d8a1,_0x48ba('0x2c'));_0x14a214[_0x48ba('0x34')]=_[_0x48ba('0x35')](_0x4775c9[_0x48ba('0x34')]);_0x14a214[_0x48ba('0x36')]=_[_0x48ba('0x37')](_0x14a214[_0x48ba('0x32')],_0x14a214[_0x48ba('0x34')]);_0x53490d['attributes']=_[_0x48ba('0x37')](_0x14a214[_0x48ba('0x32')],qs['fields'](_0x4775c9[_0x48ba('0x34')][_0x48ba('0x38')]));_0x53490d['attributes']=_0x53490d['attributes'][_0x48ba('0x39')]?_0x53490d['attributes']:_0x14a214[_0x48ba('0x32')];if(!_0x4775c9['query']['hasOwnProperty'](_0x48ba('0x3a'))){_0x53490d[_0x48ba('0x1e')]=qs['limit'](_0x4775c9['query'][_0x48ba('0x1e')]);_0x53490d[_0x48ba('0x3b')]=qs[_0x48ba('0x3b')](_0x4775c9['query']['offset']);}_0x53490d[_0x48ba('0x3c')]=qs[_0x48ba('0x3d')](_0x4775c9[_0x48ba('0x34')]['sort']);_0x53490d[_0x48ba('0x3e')]=qs['filters'](_[_0x48ba('0x3f')](_0x4775c9[_0x48ba('0x34')],_0x14a214['filters']),_0x37d8a1);if(_0x4775c9['query']['filter']){_0x53490d[_0x48ba('0x3e')]=_[_0x48ba('0x40')](_0x53490d['where'],{'$or':_[_0x48ba('0x33')](_0x37d8a1,function(_0x2f343a){if(_0x2f343a[_0x48ba('0x31')]!=='VIRTUAL'){var _0x52c60e={};_0x52c60e[_0x2f343a['name']]={'$like':'%'+_0x4775c9[_0x48ba('0x34')]['filter']+'%'};return _0x52c60e;}})});}_0x53490d=_[_0x48ba('0x40')]({},_0x53490d,_0x4775c9[_0x48ba('0x41')]);var _0xf7f7f5={'where':_0x53490d[_0x48ba('0x3e')]};return db[_0x48ba('0x2e')][_0x48ba('0x1f')](_0xf7f7f5)[_0x48ba('0x25')](function(_0x5eb46a){_0x2be2ed['count']=_0x5eb46a;if(_0x4775c9[_0x48ba('0x34')][_0x48ba('0x42')]){_0x53490d['include']=[{'all':!![]}];}return db[_0x48ba('0x2e')][_0x48ba('0x43')](_0x53490d);})[_0x48ba('0x25')](function(_0x154d38){_0x2be2ed[_0x48ba('0x44')]=_0x154d38;return _0x2be2ed;})[_0x48ba('0x25')](respondWithFilteredResult(_0x2bc5ff,_0x53490d))[_0x48ba('0x45')](handleError(_0x2bc5ff,null));};exports[_0x48ba('0x46')]=function(_0x4b3625,_0x4e56aa){var _0xe37981={'raw':!![],'where':{'id':_0x4b3625['params']['id']}},_0x286f10={};_0x286f10[_0x48ba('0x32')]=_['keys'](db['Disposition'][_0x48ba('0x2f')]);_0x286f10[_0x48ba('0x34')]=_['keys'](_0x4b3625['query']);_0x286f10[_0x48ba('0x36')]=_[_0x48ba('0x37')](_0x286f10[_0x48ba('0x32')],_0x286f10[_0x48ba('0x34')]);_0xe37981[_0x48ba('0x47')]=_[_0x48ba('0x37')](_0x286f10[_0x48ba('0x32')],qs[_0x48ba('0x38')](_0x4b3625[_0x48ba('0x34')][_0x48ba('0x38')]));_0xe37981[_0x48ba('0x47')]=_0xe37981[_0x48ba('0x47')]['length']?_0xe37981[_0x48ba('0x47')]:_0x286f10['model'];if(_0x4b3625[_0x48ba('0x34')][_0x48ba('0x42')]){_0xe37981[_0x48ba('0x48')]=[{'all':!![]}];}_0xe37981=_[_0x48ba('0x40')]({},_0xe37981,_0x4b3625[_0x48ba('0x41')]);return db[_0x48ba('0x2e')]['find'](_0xe37981)['then'](handleEntityNotFound(_0x4e56aa,null))[_0x48ba('0x25')](respondWithResult(_0x4e56aa,null))[_0x48ba('0x45')](handleError(_0x4e56aa,null));};exports[_0x48ba('0x49')]=function(_0x5ba0b5,_0x5d542b){return db[_0x48ba('0x2e')][_0x48ba('0x49')](_0x5ba0b5[_0x48ba('0x4a')],{})[_0x48ba('0x25')](function(_0x2b4b3a){var _0x31ba26=_0x5ba0b5['user'][_0x48ba('0x26')]({'plain':!![]});if(!_0x31ba26)throw new Error(_0x48ba('0x4b'));if(_0x31ba26[_0x48ba('0x4c')]===_0x48ba('0x4d')){var _0x559d2f=_0x2b4b3a[_0x48ba('0x26')]({'plain':!![]});var _0x5bdade='Dispositions';return db[_0x48ba('0x4e')][_0x48ba('0x4f')]({'where':{'name':_0x5bdade,'userProfileId':_0x31ba26[_0x48ba('0x50')]},'raw':!![]})[_0x48ba('0x25')](function(_0x21e27f){if(_0x21e27f&&_0x21e27f[_0x48ba('0x51')]===0x0){return db['UserProfileResource'][_0x48ba('0x49')]({'name':_0x559d2f[_0x48ba('0x2c')],'resourceId':_0x559d2f['id'],'type':_0x21e27f[_0x48ba('0x2c')],'sectionId':_0x21e27f['id']},{})['then'](function(){return _0x2b4b3a;});}else{return _0x2b4b3a;}})[_0x48ba('0x45')](function(_0xaa4f){logger[_0x48ba('0x2a')](_0x48ba('0x52'),_0xaa4f);throw _0xaa4f;});}return _0x2b4b3a;})[_0x48ba('0x25')](respondWithResult(_0x5d542b,0xc9))[_0x48ba('0x45')](handleError(_0x5d542b,null));};exports[_0x48ba('0x24')]=function(_0x18e634,_0x18085c){if(_0x18e634[_0x48ba('0x4a')]['id']){delete _0x18e634[_0x48ba('0x4a')]['id'];}return db['Disposition']['find']({'where':{'id':_0x18e634['params']['id']}})[_0x48ba('0x25')](handleEntityNotFound(_0x18085c,null))[_0x48ba('0x25')](saveUpdates(_0x18e634[_0x48ba('0x4a')],null))[_0x48ba('0x25')](respondWithResult(_0x18085c,null))['catch'](handleError(_0x18085c,null));};exports[_0x48ba('0x28')]=function(_0x16af32,_0x429825){return db[_0x48ba('0x2e')]['find']({'where':{'id':_0x16af32[_0x48ba('0x53')]['id']}})[_0x48ba('0x25')](handleEntityNotFound(_0x429825,null))[_0x48ba('0x25')](removeEntity(_0x429825,null))['catch'](handleError(_0x429825,null));};
\ No newline at end of file
+var _0x277c=['findAll','rows','show','params','rawAttributes','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','end','stack','name','send','Disposition','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x277c,0x153));var _0xc277=function(_0x1e6ac0,_0x4fdb5c){_0x1e6ac0=_0x1e6ac0-0x0;var _0xbcbf6a=_0x277c[_0x1e6ac0];return _0xbcbf6a;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){var _0x48124d=_0x54b2e1[_0xc277('0x25')]({'plain':!![]});var _0x57b03=_0xc277('0x26');return db[_0xc277('0x27')][_0xc277('0x24')]({'where':{'type':_0x57b03,'resourceId':_0x48124d['id']}})[_0xc277('0x23')](function(){return _0x54b2e1;});})[_0xc277('0x23')](function(){_0x2b9936[_0xc277('0x19')](0xcc)[_0xc277('0x28')]();});}};}function handleEntityNotFound(_0x3e04cb,_0x40d17a){return function(_0x5e480e){if(!_0x5e480e){_0x3e04cb['sendStatus'](0x194);}return _0x5e480e;};}function handleError(_0x31b6d4,_0x4318f4){_0x4318f4=_0x4318f4||0x1f4;return function(_0x4ebb0f){logger['error'](_0x4ebb0f[_0xc277('0x29')]);if(_0x4ebb0f[_0xc277('0x2a')]){delete _0x4ebb0f[_0xc277('0x2a')];}_0x31b6d4[_0xc277('0x19')](_0x4318f4)[_0xc277('0x2b')](_0x4ebb0f);};}exports['index']=function(_0x43757c,_0x5edf7e){var _0x12c2f9={},_0x74ff17={},_0x4348d9={'count':0x0,'rows':[]};var _0x881e70=_['map'](db[_0xc277('0x2c')]['rawAttributes'],function(_0x211379){return{'name':_0x211379[_0xc277('0x2d')],'type':_0x211379[_0xc277('0x2e')][_0xc277('0x2f')]};});_0x74ff17['model']=_[_0xc277('0x30')](_0x881e70,_0xc277('0x2a'));_0x74ff17['query']=_[_0xc277('0x31')](_0x43757c['query']);_0x74ff17[_0xc277('0x32')]=_[_0xc277('0x33')](_0x74ff17[_0xc277('0x34')],_0x74ff17[_0xc277('0x35')]);_0x12c2f9[_0xc277('0x36')]=_[_0xc277('0x33')](_0x74ff17[_0xc277('0x34')],qs[_0xc277('0x37')](_0x43757c[_0xc277('0x35')][_0xc277('0x37')]));_0x12c2f9[_0xc277('0x36')]=_0x12c2f9['attributes'][_0xc277('0x38')]?_0x12c2f9[_0xc277('0x36')]:_0x74ff17[_0xc277('0x34')];if(!_0x43757c['query'][_0xc277('0x39')](_0xc277('0x3a'))){_0x12c2f9[_0xc277('0x1c')]=qs[_0xc277('0x1c')](_0x43757c[_0xc277('0x35')]['limit']);_0x12c2f9['offset']=qs[_0xc277('0x1a')](_0x43757c['query'][_0xc277('0x1a')]);}_0x12c2f9[_0xc277('0x3b')]=qs[_0xc277('0x3c')](_0x43757c[_0xc277('0x35')][_0xc277('0x3c')]);_0x12c2f9[_0xc277('0x3d')]=qs[_0xc277('0x32')](_[_0xc277('0x3e')](_0x43757c[_0xc277('0x35')],_0x74ff17[_0xc277('0x32')]),_0x881e70);if(_0x43757c[_0xc277('0x35')]['filter']){_0x12c2f9[_0xc277('0x3d')]=_[_0xc277('0x3f')](_0x12c2f9[_0xc277('0x3d')],{'$or':_['map'](_0x881e70,function(_0x1dcd88){if(_0x1dcd88[_0xc277('0x2e')]!=='VIRTUAL'){var _0x48a22c={};_0x48a22c[_0x1dcd88[_0xc277('0x2a')]]={'$like':'%'+_0x43757c[_0xc277('0x35')][_0xc277('0x40')]+'%'};return _0x48a22c;}})});}_0x12c2f9=_[_0xc277('0x3f')]({},_0x12c2f9,_0x43757c[_0xc277('0x41')]);var _0x3d1975={'where':_0x12c2f9[_0xc277('0x3d')]};return db['Disposition'][_0xc277('0x1d')](_0x3d1975)[_0xc277('0x23')](function(_0x142ca6){_0x4348d9['count']=_0x142ca6;if(_0x43757c['query']['includeAll']){_0x12c2f9['include']=[{'all':!![]}];}return db['Disposition'][_0xc277('0x42')](_0x12c2f9);})['then'](function(_0x46fda3){_0x4348d9[_0xc277('0x43')]=_0x46fda3;return _0x4348d9;})[_0xc277('0x23')](respondWithFilteredResult(_0x5edf7e,_0x12c2f9))['catch'](handleError(_0x5edf7e,null));};exports[_0xc277('0x44')]=function(_0x92643c,_0x2a3881){var _0x28afc7={'raw':!![],'where':{'id':_0x92643c[_0xc277('0x45')]['id']}},_0x512391={};_0x512391[_0xc277('0x34')]=_['keys'](db[_0xc277('0x2c')][_0xc277('0x46')]);_0x512391[_0xc277('0x35')]=_[_0xc277('0x31')](_0x92643c[_0xc277('0x35')]);_0x512391[_0xc277('0x32')]=_[_0xc277('0x33')](_0x512391[_0xc277('0x34')],_0x512391[_0xc277('0x35')]);_0x28afc7[_0xc277('0x36')]=_[_0xc277('0x33')](_0x512391['model'],qs[_0xc277('0x37')](_0x92643c[_0xc277('0x35')][_0xc277('0x37')]));_0x28afc7[_0xc277('0x36')]=_0x28afc7['attributes'][_0xc277('0x38')]?_0x28afc7['attributes']:_0x512391[_0xc277('0x34')];if(_0x92643c[_0xc277('0x35')][_0xc277('0x47')]){_0x28afc7[_0xc277('0x48')]=[{'all':!![]}];}_0x28afc7=_[_0xc277('0x3f')]({},_0x28afc7,_0x92643c['options']);return db[_0xc277('0x2c')][_0xc277('0x49')](_0x28afc7)[_0xc277('0x23')](handleEntityNotFound(_0x2a3881,null))[_0xc277('0x23')](respondWithResult(_0x2a3881,null))['catch'](handleError(_0x2a3881,null));};exports[_0xc277('0x4a')]=function(_0x9c910a,_0x150876){return db['Disposition'][_0xc277('0x4a')](_0x9c910a['body'],{})[_0xc277('0x23')](function(_0x10de8b){var _0x2265d3=_0x9c910a[_0xc277('0x4b')][_0xc277('0x25')]({'plain':!![]});if(!_0x2265d3)throw new Error(_0xc277('0x4c'));if(_0x2265d3[_0xc277('0x4d')]===_0xc277('0x4b')){var _0x8752f2=_0x10de8b[_0xc277('0x25')]({'plain':!![]});var _0x44b325=_0xc277('0x26');return db['UserProfileSection'][_0xc277('0x49')]({'where':{'name':_0x44b325,'userProfileId':_0x2265d3['userProfileId']},'raw':!![]})[_0xc277('0x23')](function(_0x3cd5a1){if(_0x3cd5a1&&_0x3cd5a1[_0xc277('0x4e')]===0x0){return db[_0xc277('0x27')][_0xc277('0x4a')]({'name':_0x8752f2['name'],'resourceId':_0x8752f2['id'],'type':_0x3cd5a1[_0xc277('0x2a')],'sectionId':_0x3cd5a1['id']},{})[_0xc277('0x23')](function(){return _0x10de8b;});}else{return _0x10de8b;}})['catch'](function(_0x5efcd6){logger[_0xc277('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5efcd6);throw _0x5efcd6;});}return _0x10de8b;})[_0xc277('0x23')](respondWithResult(_0x150876,0xc9))[_0xc277('0x50')](handleError(_0x150876,null));};exports[_0xc277('0x22')]=function(_0x3bcb7b,_0x1f1a7d){if(_0x3bcb7b['body']['id']){delete _0x3bcb7b['body']['id'];}return db[_0xc277('0x2c')][_0xc277('0x49')]({'where':{'id':_0x3bcb7b[_0xc277('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f1a7d,null))[_0xc277('0x23')](saveUpdates(_0x3bcb7b['body'],null))[_0xc277('0x23')](respondWithResult(_0x1f1a7d,null))[_0xc277('0x50')](handleError(_0x1f1a7d,null));};exports[_0xc277('0x24')]=function(_0x4e229f,_0x5f5d03){return db['Disposition'][_0xc277('0x49')]({'where':{'id':_0x4e229f[_0xc277('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f5d03,null))['then'](removeEntity(_0x5f5d03,null))[_0xc277('0x50')](handleError(_0x5f5d03,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f37=['rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','MailAccountId','name_sms','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3f37,0x78));var _0x73f3=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x3f37[_0x491faa];return _0x414440;};'use strict';var _=require(_0x73f3('0x0'));var util=require('util');var logger=require(_0x73f3('0x1'))('api');var moment=require(_0x73f3('0x2'));var BPromise=require(_0x73f3('0x3'));var rp=require(_0x73f3('0x4'));var fs=require('fs');var path=require(_0x73f3('0x5'));var rimraf=require(_0x73f3('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x73f3('0x7')]=function(_0x3e1906,_0x40953f){return _0x3e1906[_0x73f3('0x8')](_0x73f3('0x9'),attributes,{'tableName':_0x73f3('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x73f3('0xb'),'fields':[_0x73f3('0xc'),_0x73f3('0xd')]},{'unique':!![],'name':_0x73f3('0xe'),'fields':[_0x73f3('0xc'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x73f3('0xc'),_0x73f3('0xf')]},{'unique':!![],'name':_0x73f3('0x10'),'fields':[_0x73f3('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x73f3('0x11'),'fields':[_0x73f3('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x73f3('0xc'),_0x73f3('0x12')]},{'unique':!![],'name':_0x73f3('0x13'),'fields':[_0x73f3('0xc'),_0x73f3('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2cf9=['path','rimraf','../../config/environment','./disposition.attributes','exports','define','ListId','name_chat','name','ChatWebsiteId','name_mail','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xaa18d9,_0x26a897){var _0x11ee1f=function(_0x39ed32){while(--_0x39ed32){_0xaa18d9['push'](_0xaa18d9['shift']());}};_0x11ee1f(++_0x26a897);}(_0x2cf9,0x1c2));var _0x92cf=function(_0x3674f2,_0x4802c9){_0x3674f2=_0x3674f2-0x0;var _0x5b7aeb=_0x2cf9[_0x3674f2];return _0x5b7aeb;};'use strict';var _=require(_0x92cf('0x0'));var util=require(_0x92cf('0x1'));var logger=require(_0x92cf('0x2'))(_0x92cf('0x3'));var moment=require(_0x92cf('0x4'));var BPromise=require('bluebird');var rp=require(_0x92cf('0x5'));var fs=require('fs');var path=require(_0x92cf('0x6'));var rimraf=require(_0x92cf('0x7'));var config=require(_0x92cf('0x8'));var attributes=require(_0x92cf('0x9'));module[_0x92cf('0xa')]=function(_0x33b32c,_0x37b775){return _0x33b32c[_0x92cf('0xb')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x92cf('0xc')]},{'unique':!![],'name':_0x92cf('0xd'),'fields':[_0x92cf('0xe'),_0x92cf('0xf')]},{'unique':!![],'name':_0x92cf('0x10'),'fields':[_0x92cf('0xe'),'MailAccountId']},{'unique':!![],'name':_0x92cf('0x11'),'fields':[_0x92cf('0xe'),'SmsAccountId']},{'unique':!![],'name':_0x92cf('0x12'),'fields':['name',_0x92cf('0x13')]},{'unique':!![],'name':_0x92cf('0x14'),'fields':[_0x92cf('0xe'),_0x92cf('0x15')]},{'unique':!![],'name':_0x92cf('0x16'),'fields':[_0x92cf('0xe'),_0x92cf('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x2ed3b0,_0x3b73aa){var _0x362ca0=function(_0x449446){while(--_0x449446){_0x2ed3b0['push'](_0x2ed3b0['shift']());}};_0x362ca0(++_0x3b73aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x58916d,_0x4f78c5){var _0x271540=function(_0x15f547){while(--_0x15f547){_0x58916d['push'](_0x58916d['shift']());}};_0x271540(++_0x4f78c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb14a=['./disposition.controller','get','isAuthenticated','/:id','post','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2f4767,_0x4f317b){var _0x3d8aae=function(_0xa3ebf0){while(--_0xa3ebf0){_0x2f4767['push'](_0x2f4767['shift']());}};_0x3d8aae(++_0x4f317b);}(_0xb14a,0x69));var _0xab14=function(_0x288e4e,_0x20e652){_0x288e4e=_0x288e4e-0x0;var _0x48a60c=_0xb14a[_0x288e4e];return _0x48a60c;};'use strict';var multer=require(_0xab14('0x0'));var util=require(_0xab14('0x1'));var path=require(_0xab14('0x2'));var timeout=require('connect-timeout');var express=require(_0xab14('0x3'));var router=express[_0xab14('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xab14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab14('0x6'));var controller=require(_0xab14('0x7'));router[_0xab14('0x8')]('/',auth[_0xab14('0x9')](),controller['index']);router[_0xab14('0x8')](_0xab14('0xa'),auth[_0xab14('0x9')](),controller['show']);router[_0xab14('0xb')]('/',auth[_0xab14('0x9')](),controller['create']);router[_0xab14('0xc')]('/:id',auth[_0xab14('0x9')](),controller[_0xab14('0xd')]);router[_0xab14('0xe')](_0xab14('0xa'),auth[_0xab14('0x9')](),controller['destroy']);module[_0xab14('0xf')]=router;
\ No newline at end of file
+var _0x0d56=['isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x217f37,_0x3489bf){var _0x2bf37e=function(_0x2f6a29){while(--_0x2f6a29){_0x217f37['push'](_0x217f37['shift']());}};_0x2bf37e(++_0x3489bf);}(_0x0d56,0xe8));var _0x60d5=function(_0x5d5eba,_0x31053b){_0x5d5eba=_0x5d5eba-0x0;var _0x34921c=_0x0d56[_0x5d5eba];return _0x34921c;};'use strict';var multer=require(_0x60d5('0x0'));var util=require(_0x60d5('0x1'));var path=require(_0x60d5('0x2'));var timeout=require('connect-timeout');var express=require(_0x60d5('0x3'));var router=express[_0x60d5('0x4')]();var fs_extra=require(_0x60d5('0x5'));var auth=require(_0x60d5('0x6'));var interaction=require(_0x60d5('0x7'));var config=require('../../config/environment');var controller=require('./disposition.controller');router['get']('/',auth[_0x60d5('0x8')](),controller['index']);router['get'](_0x60d5('0x9'),auth[_0x60d5('0x8')](),controller[_0x60d5('0xa')]);router['post']('/',auth[_0x60d5('0x8')](),controller[_0x60d5('0xb')]);router[_0x60d5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x60d5('0xd')]);router['delete'](_0x60d5('0x9'),auth[_0x60d5('0x8')](),controller[_0x60d5('0xe')]);module[_0x60d5('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0adf=['KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','SIP','IAX'];(function(_0xa41047,_0x333992){var _0x7d80ce=function(_0x3886ad){while(--_0x3886ad){_0xa41047['push'](_0xa41047['shift']());}};_0x7d80ce(++_0x333992);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x9ffc13,_0x285220){_0x9ffc13=_0x9ffc13-0x0;var _0x49acae=_0x0adf[_0x9ffc13];return _0x49acae;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xf0ad('0x3')](_0xf0ad('0x4'),'no'),'defaultValue':_0xf0ad('0x4')},'headerinfo':{'type':Sequelize[_0xf0ad('0x2')],'defaultValue':_0xf0ad('0x5')},'localstationid':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x6')},'minrate':{'type':Sequelize['ENUM'](_0xf0ad('0x7'),'4800',_0xf0ad('0x8'),_0xf0ad('0x9'),_0xf0ad('0xa'),_0xf0ad('0xb')),'defaultValue':_0xf0ad('0xc')},'maxrate':{'type':Sequelize[_0xf0ad('0x3')](_0xf0ad('0x7'),'4800',_0xf0ad('0x8'),'9600',_0xf0ad('0xa'),_0xf0ad('0xb')),'defaultValue':_0xf0ad('0xb')},'modem':{'type':Sequelize[_0xf0ad('0x2')],'defaultValue':_0xf0ad('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf0ad('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf0ad('0x3')](_0xf0ad('0xf'),_0xf0ad('0x10'),'DADHI',_0xf0ad('0x11')),'defaultValue':_0xf0ad('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf0ad('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf0ad('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf0ad('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf0ad('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xf0ad('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xf0ad('0x12')],'defaultValue':![],'comment':_0xf0ad('0x14'),'set':function(_0x47fa2b){if(!_0x47fa2b)this['setDataValue'](_0xf0ad('0x15'),null);this[_0xf0ad('0x16')]('mandatoryDisposition',_0x47fa2b);}}};
\ No newline at end of file
+var _0x8958=['7200','9600','12000','ENUM','14400','INTEGER','SIP','IAX','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','yes','xCALLY\x20Motion\x20Fax','STRING','localstationid','2400','4800'];(function(_0x3064ab,_0xf56762){var _0x2ca5b1=function(_0x14fb1a){while(--_0x14fb1a){_0x3064ab['push'](_0x3064ab['shift']());}};_0x2ca5b1(++_0xf56762);}(_0x8958,0x93));var _0x8895=function(_0x38a3e9,_0x37b5ab){_0x38a3e9=_0x38a3e9-0x0;var _0x126b1f=_0x8958[_0x38a3e9];return _0x126b1f;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8895('0x1')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x8895('0x2')},'localstationid':{'type':Sequelize[_0x8895('0x3')],'unique':_0x8895('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),'14400'),'defaultValue':_0x8895('0x6')},'maxrate':{'type':Sequelize[_0x8895('0xa')](_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),_0x8895('0xb')),'defaultValue':_0x8895('0xb')},'modem':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8895('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8895('0xa')](_0x8895('0xd'),_0x8895('0xe'),'DADHI',_0x8895('0xf')),'defaultValue':_0x8895('0xd')},'key':{'type':Sequelize[_0x8895('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8895('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8895('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x8895('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![],'comment':_0x8895('0x12'),'set':function(_0x2848b7){if(!_0x2848b7)this[_0x8895('0x13')](_0x8895('0x14'),null);this[_0x8895('0x13')](_0x8895('0x15'),_0x2848b7);}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x635d=['fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','Pause','find','body','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','pick','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','hasOwnProperty','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','findAndCountAll','finally','getApplications','from-voip-provider','localstationid','app','description','Fax\x20Extension','priority','push','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','ListId','findById','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','CmContact','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0x635d,0x78));var _0xd635=function(_0x486a8b,_0x1d918f){_0x486a8b=_0x486a8b-0x0;var _0x2e1dd9=_0x635d[_0x486a8b];return _0x2e1dd9;};'use strict';var emlformat=require(_0xd635('0x0'));var rimraf=require(_0xd635('0x1'));var zipdir=require(_0xd635('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd635('0x3'));var moment=require(_0xd635('0x4'));var BPromise=require(_0xd635('0x5'));var Mustache=require(_0xd635('0x6'));var util=require(_0xd635('0x7'));var path=require('path');var sox=require(_0xd635('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd635('0x9'));var squel=require(_0xd635('0xa'));var crypto=require('crypto');var jsforce=require(_0xd635('0xb'));var deskjs=require(_0xd635('0xc'));var toCsv=require(_0xd635('0xd'));var querystring=require(_0xd635('0xe'));var Papa=require(_0xd635('0xf'));var Redis=require('ioredis');var authService=require(_0xd635('0x10'));var qs=require(_0xd635('0x11'));var as=require(_0xd635('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd635('0x13'));var utils=require('../../config/utils');var config=require(_0xd635('0x14'));var licenseUtil=require(_0xd635('0x15'));var db=require(_0xd635('0x16'))['db'];config[_0xd635('0x17')]=_['defaults'](config[_0xd635('0x17')],{'host':_0xd635('0x18'),'port':0x18eb});var socket=require(_0xd635('0x19'))(new Redis(config[_0xd635('0x17')]));require(_0xd635('0x1a'))[_0xd635('0x1b')](socket);var jayson=require(_0xd635('0x1c'));var client=jayson[_0xd635('0x1d')][_0xd635('0x1e')]({'port':0x232c});var client9002=jayson[_0xd635('0x1d')][_0xd635('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x108676,_0x2860e0,_0x33f401,_0x2465e8){return new BPromise(function(_0x179049,_0x20eaff){var _0x145a67=_0x2465e8||client;return _0x145a67[_0xd635('0x1f')](_0x108676,_0x33f401)[_0xd635('0x20')](function(_0x13dd43){logger[_0xd635('0x21')](_0xd635('0x22'),_0x2860e0,_0xd635('0x23'));logger[_0xd635('0x24')](_0xd635('0x25'),_0x2860e0,'request\x20sent',JSON[_0xd635('0x26')](_0x13dd43));if(_0x13dd43[_0xd635('0x27')]){if(_0x13dd43['error'][_0xd635('0x28')]===0x1f4){logger[_0xd635('0x27')](_0xd635('0x22'),_0x2860e0,_0x13dd43[_0xd635('0x27')]['message']);return _0x20eaff(_0x13dd43[_0xd635('0x27')][_0xd635('0x29')]);}logger[_0xd635('0x27')]('FaxAccount,\x20%s,\x20%s',_0x2860e0,_0x13dd43['error'][_0xd635('0x29')]);return _0x179049(_0x13dd43[_0xd635('0x27')][_0xd635('0x29')]);}else{logger[_0xd635('0x21')](_0xd635('0x22'),_0x2860e0,_0xd635('0x23'));_0x179049(_0x13dd43[_0xd635('0x2a')][_0xd635('0x29')]);}})['catch'](function(_0x4b624a){logger[_0xd635('0x27')]('FaxAccount,\x20%s,\x20%s',_0x2860e0,_0x4b624a);_0x20eaff(_0x4b624a);});});}function respondWithStatusCode(_0x53db79,_0x29c30f){_0x29c30f=_0x29c30f||0xcc;return function(_0x49f655){if(_0x49f655){return _0x53db79[_0xd635('0x2b')](_0x29c30f);}return _0x53db79[_0xd635('0x2c')](_0x29c30f)['end']();};}function respondWithResult(_0x1c88d4,_0x1f5b8d){_0x1f5b8d=_0x1f5b8d||0xc8;return function(_0x16f979){if(_0x16f979){return _0x1c88d4[_0xd635('0x2c')](_0x1f5b8d)[_0xd635('0x2d')](_0x16f979);}};}function respondWithFilteredResult(_0x13e59b,_0x56fb0d){return function(_0xe98f9d){if(_0xe98f9d){var _0x5e3674=typeof _0x56fb0d[_0xd635('0x2e')]===_0xd635('0x2f')&&typeof _0x56fb0d[_0xd635('0x30')]==='undefined';var _0x544618=_0xe98f9d[_0xd635('0x31')];var _0xa3870e=_0x5e3674?0x0:_0x56fb0d[_0xd635('0x2e')];var _0x4db4b1=_0x5e3674?_0xe98f9d['count']:_0x56fb0d['offset']+_0x56fb0d[_0xd635('0x30')];var _0x292b9f;if(_0x4db4b1>=_0x544618){_0x4db4b1=_0x544618;_0x292b9f=0xc8;}else{_0x292b9f=0xce;}_0x13e59b[_0xd635('0x2c')](_0x292b9f);return _0x13e59b['set'](_0xd635('0x32'),_0xa3870e+'-'+_0x4db4b1+'/'+_0x544618)[_0xd635('0x2d')](_0xe98f9d);}return null;};}function patchUpdates(_0x3b3ccc){return function(_0x374b1a){try{jsonpatch[_0xd635('0x33')](_0x374b1a,_0x3b3ccc,!![]);}catch(_0x2a364a){return BPromise[_0xd635('0x34')](_0x2a364a);}return _0x374b1a['save']();};}function saveUpdates(_0x14899e,_0x55b262){return function(_0x4357d5){if(_0x4357d5){return _0x4357d5['update'](_0x14899e)[_0xd635('0x20')](function(_0x10da22){return _0x10da22;});}return null;};}function removeEntity(_0x3ef9a0,_0x44597c){return function(_0x19b4e5){if(_0x19b4e5){return _0x19b4e5[_0xd635('0x35')]()['then'](function(){var _0x2d94cd=_0x19b4e5[_0xd635('0x36')]({'plain':!![]});var _0x39ba86=_0xd635('0x37');return db[_0xd635('0x38')][_0xd635('0x35')]({'where':{'type':_0x39ba86,'resourceId':_0x2d94cd['id']}})[_0xd635('0x20')](function(){return _0x19b4e5;});})[_0xd635('0x20')](function(){_0x3ef9a0[_0xd635('0x2c')](0xcc)[_0xd635('0x39')]();});}};}function handleEntityNotFound(_0x4c84b0,_0x4890ed){return function(_0x4a3bb5){if(!_0x4a3bb5){_0x4c84b0[_0xd635('0x2b')](0x194);}return _0x4a3bb5;};}function handleError(_0x193036,_0x595eae){_0x595eae=_0x595eae||0x1f4;return function(_0x2cdece){logger['error'](_0x2cdece[_0xd635('0x3a')]);if(_0x2cdece[_0xd635('0x3b')]){delete _0x2cdece[_0xd635('0x3b')];}_0x193036[_0xd635('0x2c')](_0x595eae)[_0xd635('0x3c')](_0x2cdece);};}exports[_0xd635('0x3d')]=function(_0x1eb947,_0x3998ce){var _0x4c79da={'include':[{'model':db['Pause'],'as':_0xd635('0x3e')}]},_0x1caf7b={},_0x2664e0={'count':0x0,'rows':[]};var _0x420539=_[_0xd635('0x3f')](db[_0xd635('0x40')][_0xd635('0x41')],function(_0x2bc590){return{'name':_0x2bc590['fieldName'],'type':_0x2bc590[_0xd635('0x42')][_0xd635('0x43')]};});_0x1caf7b['model']=_[_0xd635('0x3f')](_0x420539,_0xd635('0x3b'));_0x1caf7b[_0xd635('0x44')]=_[_0xd635('0x45')](_0x1eb947['query']);_0x1caf7b[_0xd635('0x46')]=_[_0xd635('0x47')](_0x1caf7b[_0xd635('0x48')],_0x1caf7b['query']);_0x4c79da['attributes']=_[_0xd635('0x47')](_0x1caf7b[_0xd635('0x48')],qs[_0xd635('0x49')](_0x1eb947[_0xd635('0x44')][_0xd635('0x49')]));_0x4c79da[_0xd635('0x4a')]=_0x4c79da[_0xd635('0x4a')][_0xd635('0x4b')]?_0x4c79da['attributes']:_0x1caf7b[_0xd635('0x48')];if(!_0x1eb947['query']['hasOwnProperty'](_0xd635('0x4c'))){_0x4c79da[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x1eb947[_0xd635('0x44')][_0xd635('0x30')]);_0x4c79da['offset']=qs[_0xd635('0x2e')](_0x1eb947['query'][_0xd635('0x2e')]);}_0x4c79da[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x1eb947[_0xd635('0x44')]['sort']);_0x4c79da[_0xd635('0x4f')]=qs[_0xd635('0x46')](_['pick'](_0x1eb947[_0xd635('0x44')],_0x1caf7b['filters']),_0x420539);if(_0x1eb947[_0xd635('0x44')][_0xd635('0x50')]){_0x4c79da[_0xd635('0x4f')]=_['merge'](_0x4c79da[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x420539,function(_0x15c963){if(_0x15c963[_0xd635('0x42')]!==_0xd635('0x51')){var _0x34621b={};_0x34621b[_0x15c963['name']]={'$like':'%'+_0x1eb947['query']['filter']+'%'};return _0x34621b;}})});}_0x4c79da=_[_0xd635('0x52')]({},_0x4c79da,_0x1eb947[_0xd635('0x53')]);var _0x19289c={'where':_0x4c79da[_0xd635('0x4f')]};return db['FaxAccount'][_0xd635('0x31')](_0x19289c)[_0xd635('0x20')](function(_0x5d55fc){_0x2664e0[_0xd635('0x31')]=_0x5d55fc;if(_0x1eb947[_0xd635('0x44')][_0xd635('0x54')]){_0x4c79da[_0xd635('0x55')]=[{'all':!![]}];}return db[_0xd635('0x40')]['findAll'](_0x4c79da);})['then'](function(_0x328285){_0x2664e0[_0xd635('0x56')]=_0x328285;return _0x2664e0;})[_0xd635('0x20')](respondWithFilteredResult(_0x3998ce,_0x4c79da))[_0xd635('0x57')](handleError(_0x3998ce,null));};exports[_0xd635('0x58')]=function(_0x416336,_0x4523c2){var _0x5ea18e={'raw':![],'where':{'id':_0x416336[_0xd635('0x59')]['id']},'include':[{'model':db[_0xd635('0x5a')],'as':_0xd635('0x3e')}]},_0x585cbe={};_0x585cbe[_0xd635('0x48')]=_['keys'](db['FaxAccount'][_0xd635('0x41')]);_0x585cbe[_0xd635('0x44')]=_[_0xd635('0x45')](_0x416336['query']);_0x585cbe[_0xd635('0x46')]=_[_0xd635('0x47')](_0x585cbe[_0xd635('0x48')],_0x585cbe[_0xd635('0x44')]);_0x5ea18e[_0xd635('0x4a')]=_['intersection'](_0x585cbe[_0xd635('0x48')],qs[_0xd635('0x49')](_0x416336[_0xd635('0x44')][_0xd635('0x49')]));_0x5ea18e['attributes']=_0x5ea18e['attributes'][_0xd635('0x4b')]?_0x5ea18e['attributes']:_0x585cbe[_0xd635('0x48')];if(_0x416336[_0xd635('0x44')]['includeAll']){_0x5ea18e['include']=[{'all':!![]}];}_0x5ea18e=_[_0xd635('0x52')]({},_0x5ea18e,_0x416336['options']);return db[_0xd635('0x40')][_0xd635('0x5b')](_0x5ea18e)[_0xd635('0x20')](handleEntityNotFound(_0x4523c2,null))[_0xd635('0x20')](respondWithResult(_0x4523c2,null))[_0xd635('0x57')](handleError(_0x4523c2,null));};exports['create']=function(_0x1425d2,_0x5e066c){return db[_0xd635('0x40')]['create'](_0x1425d2[_0xd635('0x5c')],{})[_0xd635('0x20')](function(_0x2d00e5){var _0x1ce463=_0x1425d2[_0xd635('0x5d')]['get']({'plain':!![]});if(!_0x1ce463)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ce463[_0xd635('0x5e')]===_0xd635('0x5d')){var _0x545428=_0x2d00e5[_0xd635('0x36')]({'plain':!![]});var _0x427f91=_0xd635('0x37');return db[_0xd635('0x5f')][_0xd635('0x5b')]({'where':{'name':_0x427f91,'userProfileId':_0x1ce463[_0xd635('0x60')]},'raw':!![]})[_0xd635('0x20')](function(_0x3d6663){if(_0x3d6663&&_0x3d6663['autoAssociation']===0x0){return db[_0xd635('0x38')][_0xd635('0x61')]({'name':_0x545428[_0xd635('0x3b')],'resourceId':_0x545428['id'],'type':_0x3d6663[_0xd635('0x3b')],'sectionId':_0x3d6663['id']},{})[_0xd635('0x20')](function(){return _0x2d00e5;});}else{return _0x2d00e5;}})[_0xd635('0x57')](function(_0x4ed439){logger['error'](_0xd635('0x62'),_0x4ed439);throw _0x4ed439;});}return _0x2d00e5;})[_0xd635('0x20')](respondWithResult(_0x5e066c,0xc9))[_0xd635('0x57')](handleError(_0x5e066c,null));};exports[_0xd635('0x63')]=function(_0x3f06ce,_0x12a3f4){if(_0x3f06ce[_0xd635('0x5c')]['id']){delete _0x3f06ce[_0xd635('0x5c')]['id'];}return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x3f06ce['params']['id']},'include':[{'model':db[_0xd635('0x5a')],'as':_0xd635('0x3e')}]})[_0xd635('0x20')](handleEntityNotFound(_0x12a3f4,null))['then'](saveUpdates(_0x3f06ce['body'],null))[_0xd635('0x20')](respondWithResult(_0x12a3f4,null))[_0xd635('0x57')](handleError(_0x12a3f4,null));};exports[_0xd635('0x35')]=function(_0x552edf,_0x340d95){return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x552edf['params']['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x340d95,null))[_0xd635('0x20')](removeEntity(_0x340d95,null))[_0xd635('0x57')](handleError(_0x340d95,null));};exports[_0xd635('0x64')]=function(_0x5aabce,_0x1ad80f){return db[_0xd635('0x40')][_0xd635('0x64')]()[_0xd635('0x20')](respondWithResult(_0x1ad80f,null))[_0xd635('0x57')](handleError(_0x1ad80f,null));};exports[_0xd635('0x65')]=function(_0x4af2e1,_0x601e74,_0x141fbe){if(_0x4af2e1['body']['id']){delete _0x4af2e1['body']['id'];}return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x4af2e1[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x601e74,null))[_0xd635('0x20')](function(_0x185d1d){if(_0x185d1d){_0x4af2e1[_0xd635('0x5c')][_0xd635('0x66')]=_0x185d1d['id'];return db[_0xd635('0x67')]['create'](_0x4af2e1[_0xd635('0x5c')]);}})[_0xd635('0x20')](respondWithResult(_0x601e74,null))[_0xd635('0x57')](handleError(_0x601e74,null));};exports[_0xd635('0x68')]=function(_0x350ba4,_0x2aa774,_0xbd1bfe){var _0x128c74={'raw':![],'where':{}};var _0x5687de={};var _0xcda8e4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x350ba4['params']['id']}})['then'](handleEntityNotFound(_0x2aa774,null))['then'](function(_0x4734ed){if(_0x4734ed){_0x5687de[_0xd635('0x48')]=_['keys'](db[_0xd635('0x67')][_0xd635('0x41')]);_0x5687de[_0xd635('0x44')]=_[_0xd635('0x45')](_0x350ba4[_0xd635('0x44')]);_0x5687de['filters']=_[_0xd635('0x47')](_0x5687de[_0xd635('0x48')],_0x5687de[_0xd635('0x44')]);_0x128c74[_0xd635('0x4a')]=_[_0xd635('0x47')](_0x5687de[_0xd635('0x48')],qs[_0xd635('0x49')](_0x350ba4['query'][_0xd635('0x49')]));_0x128c74['attributes']=_0x128c74[_0xd635('0x4a')][_0xd635('0x4b')]?_0x128c74[_0xd635('0x4a')]:_0x5687de[_0xd635('0x48')];if(!_0x350ba4['query']['hasOwnProperty'](_0xd635('0x4c'))){_0x128c74[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x350ba4['query']['limit']);_0x128c74[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x350ba4[_0xd635('0x44')]['offset']);}_0x128c74[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x350ba4[_0xd635('0x44')][_0xd635('0x4e')]);_0x128c74['where']=qs['filters'](_[_0xd635('0x69')](_0x350ba4[_0xd635('0x44')],_0x5687de[_0xd635('0x46')]));_0x128c74[_0xd635('0x4f')]['FaxAccountId']=_0x4734ed['id'];if(_0x350ba4[_0xd635('0x44')][_0xd635('0x50')]){_0x128c74['where']=_[_0xd635('0x52')](_0x128c74[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x128c74[_0xd635('0x4a')],function(_0x3e35e8){var _0x2e17f8={};_0x2e17f8[_0x3e35e8]={'$like':'%'+_0x350ba4['query'][_0xd635('0x50')]+'%'};return _0x2e17f8;})});}_0x128c74=_[_0xd635('0x52')]({},_0x128c74,_0x350ba4[_0xd635('0x53')]);return db[_0xd635('0x67')][_0xd635('0x31')]({'where':_0x128c74[_0xd635('0x4f')]})['then'](function(_0x1bdf20){_0xcda8e4[_0xd635('0x31')]=_0x1bdf20;if(_0x350ba4[_0xd635('0x44')][_0xd635('0x54')]){_0x128c74[_0xd635('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xd635('0x6a')](_0x128c74);})['then'](function(_0x522c37){_0xcda8e4[_0xd635('0x56')]=_0x522c37;return _0xcda8e4;});}})[_0xd635('0x20')](respondWithFilteredResult(_0x2aa774,_0x128c74))[_0xd635('0x57')](handleError(_0x2aa774,null));};exports['removeDispositions']=function(_0x5ca5d4,_0x27c25b,_0x41f8fc){return db[_0xd635('0x40')]['find']({'where':{'id':_0x5ca5d4[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x27c25b,null))[_0xd635('0x20')](function(_0x37cca7){if(_0x37cca7){return _0x37cca7[_0xd635('0x6b')](_0x5ca5d4['query']['ids']);}})[_0xd635('0x20')](respondWithStatusCode(_0x27c25b,null))[_0xd635('0x57')](handleError(_0x27c25b,null));};exports[_0xd635('0x6c')]=function(_0x1dca5d,_0x32e03c,_0x487003){if(_0x1dca5d['body']['id']){delete _0x1dca5d['body']['id'];}return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x1dca5d[_0xd635('0x59')]['id']}})['then'](handleEntityNotFound(_0x32e03c,null))[_0xd635('0x20')](function(_0xcbc7b){if(_0xcbc7b){_0x1dca5d[_0xd635('0x5c')]['FaxAccountId']=_0xcbc7b['id'];return db[_0xd635('0x6d')][_0xd635('0x61')](_0x1dca5d[_0xd635('0x5c')]);}})[_0xd635('0x20')](respondWithResult(_0x32e03c,null))[_0xd635('0x57')](handleError(_0x32e03c,null));};exports['getAnswers']=function(_0x25ff0c,_0xbd8183,_0x461dbb){var _0x2b0f67={'raw':![],'where':{}};var _0x300fe6={};var _0x19bb98={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd635('0x6e')]({'where':{'id':_0x25ff0c[_0xd635('0x59')]['id']}})['then'](handleEntityNotFound(_0xbd8183,null))[_0xd635('0x20')](function(_0x567545){if(_0x567545){_0x300fe6[_0xd635('0x48')]=_[_0xd635('0x45')](db[_0xd635('0x6d')]['rawAttributes']);_0x300fe6[_0xd635('0x44')]=_[_0xd635('0x45')](_0x25ff0c[_0xd635('0x44')]);_0x300fe6['filters']=_['intersection'](_0x300fe6['model'],_0x300fe6[_0xd635('0x44')]);_0x2b0f67['attributes']=_[_0xd635('0x47')](_0x300fe6['model'],qs[_0xd635('0x49')](_0x25ff0c[_0xd635('0x44')][_0xd635('0x49')]));_0x2b0f67[_0xd635('0x4a')]=_0x2b0f67[_0xd635('0x4a')][_0xd635('0x4b')]?_0x2b0f67[_0xd635('0x4a')]:_0x300fe6[_0xd635('0x48')];if(!_0x25ff0c[_0xd635('0x44')][_0xd635('0x6f')]('nolimit')){_0x2b0f67[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x25ff0c['query'][_0xd635('0x30')]);_0x2b0f67[_0xd635('0x2e')]=qs['offset'](_0x25ff0c['query'][_0xd635('0x2e')]);}_0x2b0f67[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x25ff0c['query'][_0xd635('0x4e')]);_0x2b0f67[_0xd635('0x4f')]=qs['filters'](_[_0xd635('0x69')](_0x25ff0c['query'],_0x300fe6[_0xd635('0x46')]));_0x2b0f67[_0xd635('0x4f')][_0xd635('0x66')]=_0x567545['id'];if(_0x25ff0c[_0xd635('0x44')][_0xd635('0x50')]){_0x2b0f67[_0xd635('0x4f')]=_[_0xd635('0x52')](_0x2b0f67[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x2b0f67[_0xd635('0x4a')],function(_0x28c157){var _0x23c683={};_0x23c683[_0x28c157]={'$like':'%'+_0x25ff0c['query'][_0xd635('0x50')]+'%'};return _0x23c683;})});}_0x2b0f67=_[_0xd635('0x52')]({},_0x2b0f67,_0x25ff0c[_0xd635('0x53')]);return db['CannedAnswer']['count']({'where':_0x2b0f67['where']})[_0xd635('0x20')](function(_0x22d39f){_0x19bb98[_0xd635('0x31')]=_0x22d39f;if(_0x25ff0c[_0xd635('0x44')][_0xd635('0x54')]){_0x2b0f67[_0xd635('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2b0f67);})[_0xd635('0x20')](function(_0x330e53){_0x19bb98[_0xd635('0x56')]=_0x330e53;return _0x19bb98;});}})['then'](respondWithFilteredResult(_0xbd8183,_0x2b0f67))['catch'](handleError(_0xbd8183,null));};exports[_0xd635('0x70')]=function(_0x295c6f,_0x2120fc,_0xb46161){return db['FaxAccount'][_0xd635('0x5b')]({'where':{'id':_0x295c6f[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x2120fc,null))[_0xd635('0x20')](function(_0x427e64){if(_0x427e64){return _0x427e64['removeAnswers'](_0x295c6f['query'][_0xd635('0x71')]);}})['then'](respondWithStatusCode(_0x2120fc,null))[_0xd635('0x57')](handleError(_0x2120fc,null));};exports[_0xd635('0x72')]=function(_0x4446d5,_0x2910be,_0x321229){return db[_0xd635('0x73')]['find']({'where':{'id':_0x4446d5[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x2910be,null))[_0xd635('0x20')](function(_0x164bb6){if(_0x164bb6){return _0x164bb6[_0xd635('0x72')](_0x4446d5[_0xd635('0x5c')][_0xd635('0x71')],_[_0xd635('0x74')](_0x4446d5[_0xd635('0x5c')],[_0xd635('0x71'),'id'])||{});}})['then'](respondWithResult(_0x2910be,null))[_0xd635('0x57')](handleError(_0x2910be,null));};exports[_0xd635('0x75')]=function(_0x51ec3c,_0x15da4b,_0x4c1010){var _0x320acb={'raw':![],'where':{}};var _0x408c3b={};var _0x495ea5={'count':0x0,'rows':[]};return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x51ec3c[_0xd635('0x59')]['id']}})['then'](handleEntityNotFound(_0x15da4b,null))[_0xd635('0x20')](function(_0x162848){if(_0x162848){_0x408c3b['model']=_[_0xd635('0x45')](db[_0xd635('0x73')][_0xd635('0x41')]);_0x408c3b['query']=_['keys'](_0x51ec3c['query']);_0x408c3b[_0xd635('0x46')]=_[_0xd635('0x47')](_0x408c3b[_0xd635('0x48')],_0x408c3b['query']);_0x320acb[_0xd635('0x4a')]=_[_0xd635('0x47')](_0x408c3b[_0xd635('0x48')],qs['fields'](_0x51ec3c[_0xd635('0x44')]['fields']));_0x320acb[_0xd635('0x4a')]=_0x320acb['attributes'][_0xd635('0x4b')]?_0x320acb['attributes']:_0x408c3b[_0xd635('0x48')];if(!_0x51ec3c[_0xd635('0x44')][_0xd635('0x6f')](_0xd635('0x4c'))){_0x320acb['limit']=qs[_0xd635('0x30')](_0x51ec3c['query'][_0xd635('0x30')]);_0x320acb[_0xd635('0x2e')]=qs['offset'](_0x51ec3c[_0xd635('0x44')]['offset']);}_0x320acb[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x51ec3c[_0xd635('0x44')][_0xd635('0x4e')]);_0x320acb[_0xd635('0x4f')]=qs[_0xd635('0x46')](_[_0xd635('0x69')](_0x51ec3c[_0xd635('0x44')],_0x408c3b[_0xd635('0x46')]));_0x320acb['where'][_0xd635('0x66')]=_0x162848['id'];if(_0x51ec3c[_0xd635('0x44')][_0xd635('0x50')]){_0x320acb[_0xd635('0x4f')]=_[_0xd635('0x52')](_0x320acb['where'],{'$or':_['map'](_0x320acb[_0xd635('0x4a')],function(_0x325257){var _0x20eb94={};_0x20eb94[_0x325257]={'$like':'%'+_0x51ec3c[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x20eb94;})});}_0x320acb=_[_0xd635('0x52')]({},_0x320acb,_0x51ec3c[_0xd635('0x53')]);return db[_0xd635('0x73')][_0xd635('0x31')]({'where':_0x320acb['where']})[_0xd635('0x20')](function(_0x2814c2){_0x495ea5[_0xd635('0x31')]=_0x2814c2;if(_0x51ec3c[_0xd635('0x44')]['includeAll']){_0x320acb[_0xd635('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xd635('0x76')],'as':_0xd635('0x77'),'attributes':['name',_0xd635('0x78'),_0xd635('0x79')],'required':![]},{'model':db['Tag'],'as':_0xd635('0x7a'),'attributes':['id',_0xd635('0x3b'),'color'],'where':_0x51ec3c[_0xd635('0x44')][_0xd635('0x7b')]?{'id':_0x51ec3c[_0xd635('0x44')][_0xd635('0x7b')]}:undefined,'required':_0x51ec3c[_0xd635('0x44')][_0xd635('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0xd635('0x6a')](_0x320acb);})[_0xd635('0x20')](function(_0x40a6ff){_0x495ea5['rows']=_0x40a6ff;return _0x495ea5;});}})['then'](respondWithFilteredResult(_0x15da4b,_0x320acb))[_0xd635('0x57')](handleError(_0x15da4b,null));};exports['addApplications']=function(_0x3a610a,_0x2f77bc){var _0x441a21=_0x3a610a[_0xd635('0x59')]['id'];var _0x218f9b=_0x3a610a['body'];var _0x2fd2e6=0xc8;var _0x502780=null;return db[_0xd635('0x7c')][_0xd635('0x7d')]({'isolationLevel':db[_0xd635('0x7c')][_0xd635('0x7e')][_0xd635('0x7f')][_0xd635('0x80')]},function(_0x2b6282){return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x441a21},'transaction':_0x2b6282})['then'](function(_0xcf6132){if(_0xcf6132){return db['FaxApplication'][_0xd635('0x35')]({'where':{'FaxAccountId':_0x441a21},'transaction':_0x2b6282})[_0xd635('0x20')](function(){var _0x42538e=_[_0xd635('0x3f')](_0x218f9b,function(_0x55f9a0){_0x55f9a0[_0xd635('0x66')]=_0x441a21;return _0x55f9a0;});return db['FaxApplication'][_0xd635('0x81')](_0x42538e,{'transaction':_0x2b6282});});}else{_0x2fd2e6=0x194;_0x502780=[];}});})[_0xd635('0x20')](function(){if(_0x2fd2e6!==0x194){return db[_0xd635('0x82')][_0xd635('0x83')]({'where':{'FaxAccountId':_0x441a21},'order':'priority'})[_0xd635('0x20')](function(_0x31f264){_0x502780=_0x31f264;});}})['catch'](function(_0xfbe969){_0x2fd2e6=0x1f4;logger[_0xd635('0x27')](_0xfbe969[_0xd635('0x3a')]);if(_0xfbe969['name']){delete _0xfbe969[_0xd635('0x3b')];}_0x502780=_0xfbe969;})[_0xd635('0x84')](function(){if(_0x502780===null){_0x2f77bc['sendStatus'](_0x2fd2e6);}else{if(_0x2fd2e6===0x1f4){_0x2f77bc[_0xd635('0x2c')](_0x2fd2e6)[_0xd635('0x3c')](_0x502780);}else{_0x2f77bc['status'](_0x2fd2e6)[_0xd635('0x2d')](_0x502780);}}});};exports['getApplications']=function(_0x1f4c37,_0x38ab34,_0x2035b7){var _0x35cb12={};var _0x34e953={};var _0x3f323a;var _0x15140b;return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x1f4c37[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x38ab34,null))[_0xd635('0x20')](function(_0x5c253b){if(_0x5c253b){_0x3f323a=_0x5c253b;_0x34e953[_0xd635('0x48')]=_['keys'](db['FaxApplication'][_0xd635('0x41')]);_0x34e953[_0xd635('0x44')]=_[_0xd635('0x45')](_0x1f4c37[_0xd635('0x44')]);_0x34e953['filters']=_[_0xd635('0x47')](_0x34e953[_0xd635('0x48')],_0x34e953[_0xd635('0x44')]);_0x35cb12[_0xd635('0x4a')]=_[_0xd635('0x47')](_0x34e953[_0xd635('0x48')],qs['fields'](_0x1f4c37['query'][_0xd635('0x49')]));_0x35cb12['attributes']=_0x35cb12[_0xd635('0x4a')][_0xd635('0x4b')]?_0x35cb12[_0xd635('0x4a')]:_0x34e953[_0xd635('0x48')];_0x35cb12['order']=qs[_0xd635('0x4e')](_0x1f4c37[_0xd635('0x44')][_0xd635('0x4e')]);_0x35cb12[_0xd635('0x4f')]=qs['filters'](_[_0xd635('0x69')](_0x1f4c37[_0xd635('0x44')],_0x34e953[_0xd635('0x46')]));if(_0x1f4c37[_0xd635('0x44')][_0xd635('0x50')]){_0x35cb12['where']=_[_0xd635('0x52')](_0x35cb12[_0xd635('0x4f')],{'$or':_[_0xd635('0x3f')](_0x35cb12['attributes'],function(_0x1f0197){var _0x149d17={};_0x149d17[_0x1f0197]={'$like':'%'+_0x1f4c37[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x149d17;})});}_0x35cb12=_[_0xd635('0x52')]({},_0x35cb12,_0x1f4c37['options']);return _0x3f323a[_0xd635('0x85')](_0x35cb12);}})[_0xd635('0x20')](function(_0x5bbe2a){if(_0x5bbe2a){_0x15140b=_0x5bbe2a[_0xd635('0x4b')];if(!_0x1f4c37[_0xd635('0x44')][_0xd635('0x6f')](_0xd635('0x4c'))){_0x35cb12[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x1f4c37['query'][_0xd635('0x30')]);_0x35cb12[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x1f4c37[_0xd635('0x44')][_0xd635('0x2e')]);}return _0x3f323a[_0xd635('0x85')](_0x35cb12);}})['then'](function(_0x5ac8f9){if(_0x5ac8f9){return _0x5ac8f9?{'count':_0x15140b,'rows':_0x5ac8f9}:null;}})[_0xd635('0x20')](respondWithResult(_0x38ab34,null))[_0xd635('0x57')](handleError(_0x38ab34,null));};function Extension(_0x3211b4,_0x1d9dd7,_0x111664,_0x15564e){this['context']=_0xd635('0x86');this['exten']=_0x3211b4[_0xd635('0x87')];this[_0xd635('0x88')]=_0x15564e;this[_0xd635('0x42')]='system';this[_0xd635('0x89')]=_0xd635('0x8a');this[_0xd635('0x66')]=_0x3211b4['id'];this[_0xd635('0x8b')]=_0x1d9dd7;this['appdata']=_0x111664;}function createExtensionsReciveFax(_0x1a7a20){var _0x12b5b9=0x1;var _0x5e8b0a=[];_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,'','Answer'));_0x12b5b9+=0x1;_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,'CDR(type)=inbound-fax','Set'));_0x12b5b9+=0x1;for(var _0x3aa788 in _0x1a7a20){if(_0x1a7a20[_0xd635('0x6f')](_0x3aa788)&&(_0x3aa788===_0xd635('0x8d')||_0x3aa788==='localstationid'||_0x3aa788===_0xd635('0x8e')||_0x3aa788===_0xd635('0x8f')||_0x3aa788===_0xd635('0x90')||_0x3aa788===_0xd635('0x91')||_0x3aa788===_0xd635('0x92')||_0x3aa788==='modem'||_0x3aa788===_0xd635('0x93'))){_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,_0xd635('0x94')+_0x3aa788+')='+_0x1a7a20[_0x3aa788],'Set'));_0x12b5b9+=0x1;}}_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,'6',_0xd635('0x95')));_0x12b5b9+=0x1;_0x5e8b0a[_0xd635('0x8c')](new Extension(_0x1a7a20,_0x12b5b9,_0xd635('0x96'),_0xd635('0x97')));_0x12b5b9=0x0;return _0x5e8b0a;}exports[_0xd635('0x98')]=function(_0x364172,_0x33bdd6,_0x4a0c50){var _0x45f9c2;return db[_0xd635('0x7c')][_0xd635('0x7d')](function(_0x2bbe00){return db[_0xd635('0x40')][_0xd635('0x61')](_0x364172['body'],{'transaction':_0x2bbe00})[_0xd635('0x20')](function(_0x5ec4be){_0x45f9c2=_0x5ec4be['get']({'plain':!![]});return db[_0xd635('0x99')][_0xd635('0x81')](createExtensionsReciveFax(_0x45f9c2),{'transaction':_0x2bbe00});});})[_0xd635('0x20')](function(){return _0x45f9c2;})['then'](respondWithResult(_0x33bdd6,null))['catch'](handleError(_0x33bdd6,null));};exports[_0xd635('0x9a')]=function(_0x5136ca,_0x4b6cf0,_0x529344){var _0x2d4b81;return db['sequelize']['transaction'](function(_0x5b1f60){return db[_0xd635('0x40')]['update'](_0x5136ca[_0xd635('0x5c')],{'where':{'id':_0x5136ca[_0xd635('0x5c')]['id']},'transaction':_0x5b1f60})['then'](function(_0x145488){return db[_0xd635('0x99')][_0xd635('0x35')]({'where':{'FaxAccountId':_0x5136ca[_0xd635('0x5c')]['id']},'transaction':_0x5b1f60})[_0xd635('0x20')](function(_0x457289){return db[_0xd635('0x99')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x5136ca['body'],[_0xd635('0x9b'),_0xd635('0x43'),_0xd635('0x9c'),'updatedAt','TrunkId',_0xd635('0x9d')])),{'transaction':_0x5b1f60});});});})[_0xd635('0x20')](function(){return db[_0xd635('0x40')][_0xd635('0x9e')](_0x5136ca[_0xd635('0x5c')]['id']);})[_0xd635('0x20')](respondWithResult(_0x4b6cf0,null))[_0xd635('0x57')](handleError(_0x4b6cf0,null));};exports[_0xd635('0x9f')]=function(_0x4c6477,_0x282049,_0x258b42){var _0x5d91cf={'raw':!![],'where':{}};var _0x39e485={};var _0x195e1e={'count':0x0,'rows':[]};return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x4c6477['params']['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x282049,null))[_0xd635('0x20')](function(_0x77dc64){if(_0x77dc64){_0x39e485[_0xd635('0x48')]=_[_0xd635('0x45')](db['FaxMessage'][_0xd635('0x41')]);_0x39e485[_0xd635('0x44')]=_[_0xd635('0x45')](_0x4c6477[_0xd635('0x44')]);_0x39e485[_0xd635('0x46')]=_[_0xd635('0x47')](_0x39e485[_0xd635('0x48')],_0x39e485[_0xd635('0x44')]);_0x5d91cf[_0xd635('0x4a')]=_['intersection'](_0x39e485[_0xd635('0x48')],qs[_0xd635('0x49')](_0x4c6477[_0xd635('0x44')][_0xd635('0x49')]));_0x5d91cf['attributes']=_0x5d91cf['attributes'][_0xd635('0x4b')]?_0x5d91cf[_0xd635('0x4a')]:_0x39e485[_0xd635('0x48')];if(!_0x4c6477['query']['hasOwnProperty'](_0xd635('0x4c'))){_0x5d91cf[_0xd635('0x30')]=qs[_0xd635('0x30')](_0x4c6477['query']['limit']);_0x5d91cf[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x4c6477[_0xd635('0x44')]['offset']);}_0x5d91cf[_0xd635('0x4d')]=qs[_0xd635('0x4e')](_0x4c6477[_0xd635('0x44')][_0xd635('0x4e')]);_0x5d91cf[_0xd635('0x4f')]=qs[_0xd635('0x46')](_[_0xd635('0x69')](_0x4c6477[_0xd635('0x44')],_0x39e485['filters']));_0x5d91cf['where'][_0xd635('0x66')]=_0x77dc64['id'];if(_0x4c6477['query'][_0xd635('0x50')]){_0x5d91cf[_0xd635('0x4f')]=_[_0xd635('0x52')](_0x5d91cf['where'],{'$or':_[_0xd635('0x3f')](_0x5d91cf[_0xd635('0x4a')],function(_0x2e4063){var _0x3ed3b4={};_0x3ed3b4[_0x2e4063]={'$like':'%'+_0x4c6477[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x3ed3b4;})});}if(_0x4c6477[_0xd635('0x44')][_0xd635('0xa0')]){var _0x1d2a6a=_0x4c6477[_0xd635('0x44')][_0xd635('0xa0')]['split'](',');var _0x639a84={};_0x639a84[_0x1d2a6a[0x0]]={'$gte':moment(_0x1d2a6a[0x1])[_0xd635('0xa1')](_0xd635('0xa2'))};_0x5d91cf['where']=_[_0xd635('0x52')](_0x5d91cf[_0xd635('0x4f')],_0x639a84);}_0x5d91cf=_[_0xd635('0x52')]({},_0x5d91cf,_0x4c6477[_0xd635('0x53')]);return db[_0xd635('0xa3')]['count']({'where':_0x5d91cf['where']})['then'](function(_0x2e5e3c){_0x195e1e['count']=_0x2e5e3c;if(_0x4c6477[_0xd635('0x44')]['includeAll']){_0x5d91cf[_0xd635('0x55')]=[{'all':!![]}];}return db[_0xd635('0xa3')][_0xd635('0x6a')](_0x5d91cf);})[_0xd635('0x20')](function(_0x29b300){_0x195e1e[_0xd635('0x56')]=_0x29b300;return _0x195e1e;});}})[_0xd635('0x20')](respondWithFilteredResult(_0x282049,_0x5d91cf))[_0xd635('0x57')](handleError(_0x282049,null));};exports[_0xd635('0x3c')]=function(_0x59f04a,_0x5f086c,_0x1873eb){var _0x2913c5,_0x3e494f={},_0x3bab32;if(_0x59f04a[_0xd635('0x5c')]['to']){_0x3bab32=_0x59f04a[_0xd635('0x5c')]['to'][0x0];}return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x59f04a[_0xd635('0x59')]['id']},'include':[{'model':db[_0xd635('0xa4')],'as':'List','include':[{'model':db[_0xd635('0xa5')],'as':_0xd635('0xa6'),'where':{'fax':_0x3bab32},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x5f086c,null))['then'](function(_0x1d149f){_0x2913c5=_0x1d149f;if(_0x59f04a[_0xd635('0x5c')]['attachments']&&_0x59f04a['body'][_0xd635('0xa7')][_0xd635('0x4b')]){for(var _0x33396a=0x0;_0x33396a<_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][_0xd635('0x4b')];_0x33396a+=0x1){_0x59f04a['body'][_0xd635('0xa7')][_0x33396a]={'filename':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][_0x33396a][_0xd635('0x3b')],'id':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][_0x33396a]['id'],'path':path[_0xd635('0xa8')](config['root'],_0xd635('0xa9'),_0x59f04a['body']['attachments'][_0x33396a][_0xd635('0xaa')])};}}return respondWithRpcPromise(_0xd635('0xab'),_0xd635('0xab'),{'FaxAccountId':_[_0xd635('0xac')](_0x59f04a[_0xd635('0x59')]['id'])?undefined:_0x59f04a['params']['id'],'path':_[_0xd635('0xac')](_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['path'])?undefined:_0x59f04a['body'][_0xd635('0xa7')][0x0][_0xd635('0xad')],'fax':_[_0xd635('0xac')](_0x59f04a[_0xd635('0x5c')]['to'][0x0])?undefined:_0x59f04a[_0xd635('0x5c')]['to'][0x0]},client9002);})[_0xd635('0x20')](function(){if(_0x2913c5){if(_['isNil'](_0x59f04a[_0xd635('0x5c')][_0xd635('0xae')])){_0x59f04a['body'][_0xd635('0xae')]=util[_0xd635('0xa1')](_0xd635('0xaf'),_0x2913c5[_0xd635('0x3b')],_0x2913c5['fax']);}if(_0x2913c5[_0xd635('0xb0')]){if(_0x2913c5[_0xd635('0xb0')][_0xd635('0xa6')][_0xd635('0x4b')]){return _0x2913c5['List'][_0xd635('0xa6')][0x0];}else{return db[_0xd635('0xa5')][_0xd635('0x61')](_['defaults'](_0x59f04a['body'],{'firstName':_0x59f04a['body']['to'][0x0],'phone':_0x59f04a[_0xd635('0x5c')]['to'][0x0],'fax':_0x59f04a[_0xd635('0x5c')]['to'][0x0],'ListId':_0x2913c5[_0xd635('0x9d')]}));}}else{throw new Error(_0xd635('0xb1'));}}else{throw new Error(_0xd635('0xb2'));}})[_0xd635('0x20')](function(_0x6b8d07){if(_0x6b8d07){return db['FaxInteraction']['find']({'where':{'ContactId':_0x6b8d07['id'],'closed':![],'FaxAccountId':_0x2913c5['id']}})[_0xd635('0x20')](function(_0xa67898){if(_0xa67898){return[_0xa67898,![]];}return db[_0xd635('0x73')]['create']({'UserId':_0x59f04a[_0xd635('0x5d')]['id'],'ContactId':_0x6b8d07['id'],'FaxAccountId':_0x2913c5['id'],'fax':_0x59f04a['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xd635('0x52')](_0x59f04a[_0xd635('0x5c')],{'read':![],'body':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0][_0xd635('0xb3')],'FaxAccountId':_0x2913c5['id'],'UserId':_0x59f04a['user']['id'],'ContactId':_0x6b8d07['id'],'AttachmentId':_0x59f04a['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xd635('0xa3')],'as':'Messages'}]})['then'](function(_0x182c10){return[_0x182c10,!![]];});});}else{throw new Error(_0xd635('0xb4'));}})[_0xd635('0xb5')](function(_0x44330c,_0x5c160){if(_0x5c160){return _0x44330c;}return db[_0xd635('0xa3')][_0xd635('0x61')]({'direction':_0xd635('0xb6'),'read':![],'body':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0][_0xd635('0xb3')],'FaxAccountId':_0x2913c5['id'],'FaxInteractionId':_0x44330c['id'],'UserId':_0x59f04a[_0xd635('0x5d')]['id'],'ContactId':_0x44330c[_0xd635('0xb7')],'AttachmentId':_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['id']})[_0xd635('0x20')](function(_0xa2d895){_0x44330c[_0xd635('0xb8')]['Messages']=[];_0x44330c[_0xd635('0xb8')]['Messages'][_0xd635('0x8c')](_0xa2d895['dataValues']);return _0x44330c;});})[_0xd635('0x20')](function(_0x45fc7c){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xd635('0xac')](_0x59f04a['params']['id'])?undefined:_0x59f04a['params']['id'],'path':_['isNil'](_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['path'])?undefined:_0x59f04a[_0xd635('0x5c')][_0xd635('0xa7')][0x0]['path'],'fax':_['isNil'](_0x59f04a[_0xd635('0x5c')]['to'][0x0])?undefined:_0x59f04a['body']['to'][0x0],'AttachmentId':_0x59f04a['body'][_0xd635('0xa7')][0x0]['id']},client9002)['then'](function(_0x5480d6){logger[_0xd635('0x21')](_0xd635('0xb9'),_0x5480d6);})[_0xd635('0x57')](function(_0x42a06e){logger[_0xd635('0x21')]('SendFaxRpc,\x20%s',_0x42a06e);});return _0x45fc7c;})[_0xd635('0x20')](respondWithResult(_0x5f086c,null))['catch'](handleError(_0x5f086c,null));};exports['addAgents']=function(_0x1e8709,_0x127e8e,_0x51bb4a){return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x1e8709[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x127e8e,null))[_0xd635('0x20')](function(_0x10fb01){if(_0x10fb01){return _0x10fb01[_0xd635('0xba')](_0x1e8709[_0xd635('0x5c')][_0xd635('0x71')],_[_0xd635('0x74')](_0x1e8709['body'],[_0xd635('0x71'),'id'])||{})[_0xd635('0xb5')](function(_0x1aea75){for(var _0x35270f=0x0;_0x35270f<_0x1e8709[_0xd635('0x5c')][_0xd635('0x71')][_0xd635('0x4b')];_0x35270f+=0x1){socket['emit'](_0xd635('0xbb'),{'UserId':Number(_0x1e8709['body'][_0xd635('0x71')][_0x35270f]),'FaxAccountId':Number(_0x1e8709[_0xd635('0x59')]['id'])});}return _0x1aea75;});}})[_0xd635('0x20')](respondWithResult(_0x127e8e,null))[_0xd635('0x57')](handleError(_0x127e8e,null));};exports[_0xd635('0xbc')]=function(_0x43640e,_0x5c723e,_0x1c9cb8){return db[_0xd635('0x40')][_0xd635('0x5b')]({'where':{'id':_0x43640e['params']['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x5c723e,null))[_0xd635('0x20')](function(_0x54cd33){if(_0x54cd33){return _0x54cd33[_0xd635('0xbc')](_0x43640e[_0xd635('0x44')][_0xd635('0x71')])[_0xd635('0x20')](function(){if(_[_0xd635('0xbd')](_0x43640e[_0xd635('0x44')][_0xd635('0x71')])){for(var _0x433cd8=0x0;_0x433cd8<_0x43640e[_0xd635('0x44')][_0xd635('0x71')]['length'];_0x433cd8+=0x1){socket[_0xd635('0xbe')](_0xd635('0xbf'),{'UserId':Number(_0x43640e[_0xd635('0x44')][_0xd635('0x71')][_0x433cd8]),'FaxAccountId':Number(_0x43640e[_0xd635('0x59')]['id'])});}}else{socket['emit'](_0xd635('0xbf'),{'UserId':Number(_0x43640e[_0xd635('0x44')][_0xd635('0x71')]),'FaxAccountId':Number(_0x43640e[_0xd635('0x59')]['id'])});}});}})[_0xd635('0x20')](respondWithStatusCode(_0x5c723e,null))[_0xd635('0x57')](handleError(_0x5c723e,null));};exports['getAgents']=function(_0x5afe70,_0x420018,_0x293cef){var _0x108dc5={};var _0x1adbec={};var _0x454267;var _0x323dc6;return db[_0xd635('0x40')][_0xd635('0x6e')]({'where':{'id':_0x5afe70[_0xd635('0x59')]['id']}})[_0xd635('0x20')](handleEntityNotFound(_0x420018,null))[_0xd635('0x20')](function(_0x1df836){if(_0x1df836){_0x454267=_0x1df836;_0x1adbec[_0xd635('0x48')]=_[_0xd635('0x45')](db['User'][_0xd635('0x41')]);_0x1adbec['query']=_[_0xd635('0x45')](_0x5afe70[_0xd635('0x44')]);_0x1adbec['filters']=_['intersection'](_0x1adbec['model'],_0x1adbec[_0xd635('0x44')]);_0x108dc5[_0xd635('0x4a')]=_['intersection'](_0x1adbec[_0xd635('0x48')],qs[_0xd635('0x49')](_0x5afe70['query'][_0xd635('0x49')]));_0x108dc5[_0xd635('0x4a')]=_0x108dc5['attributes'][_0xd635('0x4b')]?_0x108dc5[_0xd635('0x4a')]:_0x1adbec[_0xd635('0x48')];_0x108dc5['order']=qs[_0xd635('0x4e')](_0x5afe70[_0xd635('0x44')][_0xd635('0x4e')]);_0x108dc5[_0xd635('0x4f')]=qs[_0xd635('0x46')](_[_0xd635('0x69')](_0x5afe70['query'],_0x1adbec['filters']));if(_0x5afe70['query'][_0xd635('0x50')]){_0x108dc5['where']=_['merge'](_0x108dc5['where'],{'$or':_[_0xd635('0x3f')](_0x108dc5['attributes'],function(_0x4de6b4){var _0x1e93d7={};_0x1e93d7[_0x4de6b4]={'$like':'%'+_0x5afe70[_0xd635('0x44')][_0xd635('0x50')]+'%'};return _0x1e93d7;})});}_0x108dc5=_[_0xd635('0x52')]({},_0x108dc5,_0x5afe70[_0xd635('0x53')]);return _0x454267[_0xd635('0xc0')](_0x108dc5);}})[_0xd635('0x20')](function(_0x35c263){if(_0x35c263){_0x323dc6=_0x35c263[_0xd635('0x4b')];if(!_0x5afe70[_0xd635('0x44')]['hasOwnProperty'](_0xd635('0x4c'))){_0x108dc5['limit']=qs[_0xd635('0x30')](_0x5afe70[_0xd635('0x44')][_0xd635('0x30')]);_0x108dc5[_0xd635('0x2e')]=qs[_0xd635('0x2e')](_0x5afe70[_0xd635('0x44')][_0xd635('0x2e')]);}return _0x454267[_0xd635('0xc0')](_0x108dc5);}})[_0xd635('0x20')](function(_0x1a42f5){if(_0x1a42f5){return _0x1a42f5?{'count':_0x323dc6,'rows':_0x1a42f5}:null;}})[_0xd635('0x20')](respondWithResult(_0x420018,null))[_0xd635('0x57')](handleError(_0x420018,null));};
\ No newline at end of file
+var _0xa061=['ReceiveFax','addAccountApplications','sequelize','transaction','updateAccountApplications','VoiceExtension','tech','createdAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','rows','show','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','User','Owner','fullname','Tags','color','tag','addApplications','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d'];(function(_0x4ce928,_0x36b7bc){var _0x4bfe80=function(_0xd84da9){while(--_0xd84da9){_0x4ce928['push'](_0x4ce928['shift']());}};_0x4bfe80(++_0x36b7bc);}(_0xa061,0x1b7));var _0x1a06=function(_0x211f66,_0x6d409f){_0x211f66=_0x211f66-0x0;var _0x324240=_0xa061[_0x211f66];return _0x324240;};'use strict';var emlformat=require(_0x1a06('0x0'));var rimraf=require(_0x1a06('0x1'));var zipdir=require(_0x1a06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1a06('0x3'));var Mustache=require(_0x1a06('0x4'));var util=require(_0x1a06('0x5'));var path=require(_0x1a06('0x6'));var sox=require('sox');var csv=require(_0x1a06('0x7'));var ejs=require(_0x1a06('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a06('0x9'));var squel=require(_0x1a06('0xa'));var crypto=require(_0x1a06('0xb'));var jsforce=require(_0x1a06('0xc'));var deskjs=require(_0x1a06('0xd'));var toCsv=require(_0x1a06('0x7'));var querystring=require(_0x1a06('0xe'));var Papa=require(_0x1a06('0xf'));var Redis=require(_0x1a06('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1a06('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a06('0x12'));var logger=require(_0x1a06('0x13'))(_0x1a06('0x14'));var utils=require(_0x1a06('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a06('0x16'))['db'];config['redis']=_[_0x1a06('0x17')](config[_0x1a06('0x18')],{'host':_0x1a06('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a06('0x18')]));require(_0x1a06('0x1a'))['register'](socket);var jayson=require(_0x1a06('0x1b'));var client=jayson[_0x1a06('0x1c')][_0x1a06('0x1d')]({'port':0x232c});var client9002=jayson[_0x1a06('0x1c')][_0x1a06('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x376bac,_0x37cc79,_0x5a051c,_0x5351c1){return new BPromise(function(_0x879102,_0x28bdb8){var _0x53aa08=_0x5351c1||client;return _0x53aa08[_0x1a06('0x1e')](_0x376bac,_0x5a051c)[_0x1a06('0x1f')](function(_0x63949e){logger[_0x1a06('0x20')](_0x1a06('0x21'),_0x37cc79,_0x1a06('0x22'));logger['debug'](_0x1a06('0x23'),_0x37cc79,_0x1a06('0x22'),JSON[_0x1a06('0x24')](_0x63949e));if(_0x63949e[_0x1a06('0x25')]){if(_0x63949e[_0x1a06('0x25')][_0x1a06('0x26')]===0x1f4){logger[_0x1a06('0x25')](_0x1a06('0x21'),_0x37cc79,_0x63949e[_0x1a06('0x25')][_0x1a06('0x27')]);return _0x28bdb8(_0x63949e[_0x1a06('0x25')][_0x1a06('0x27')]);}logger[_0x1a06('0x25')]('FaxAccount,\x20%s,\x20%s',_0x37cc79,_0x63949e[_0x1a06('0x25')]['message']);return _0x879102(_0x63949e['error'][_0x1a06('0x27')]);}else{logger[_0x1a06('0x20')](_0x1a06('0x21'),_0x37cc79,_0x1a06('0x22'));_0x879102(_0x63949e[_0x1a06('0x28')][_0x1a06('0x27')]);}})[_0x1a06('0x29')](function(_0x35ad51){logger[_0x1a06('0x25')](_0x1a06('0x21'),_0x37cc79,_0x35ad51);_0x28bdb8(_0x35ad51);});});}function respondWithStatusCode(_0x4d26cb,_0xb5bb4e){_0xb5bb4e=_0xb5bb4e||0xcc;return function(_0x36245a){if(_0x36245a){return _0x4d26cb[_0x1a06('0x2a')](_0xb5bb4e);}return _0x4d26cb['status'](_0xb5bb4e)[_0x1a06('0x2b')]();};}function respondWithResult(_0x5e34b2,_0x1e68cb){_0x1e68cb=_0x1e68cb||0xc8;return function(_0x4dd2a9){if(_0x4dd2a9){return _0x5e34b2[_0x1a06('0x2c')](_0x1e68cb)[_0x1a06('0x2d')](_0x4dd2a9);}};}function respondWithFilteredResult(_0x8143b4,_0x2861d7){return function(_0x27ad1a){if(_0x27ad1a){var _0x2e6498=typeof _0x2861d7[_0x1a06('0x2e')]===_0x1a06('0x2f')&&typeof _0x2861d7['limit']===_0x1a06('0x2f');var _0xdac765=_0x27ad1a['count'];var _0x383b84=_0x2e6498?0x0:_0x2861d7[_0x1a06('0x2e')];var _0x1a89bc=_0x2e6498?_0x27ad1a[_0x1a06('0x30')]:_0x2861d7[_0x1a06('0x2e')]+_0x2861d7[_0x1a06('0x31')];var _0x5b9578;if(_0x1a89bc>=_0xdac765){_0x1a89bc=_0xdac765;_0x5b9578=0xc8;}else{_0x5b9578=0xce;}_0x8143b4['status'](_0x5b9578);return _0x8143b4['set'](_0x1a06('0x32'),_0x383b84+'-'+_0x1a89bc+'/'+_0xdac765)[_0x1a06('0x2d')](_0x27ad1a);}return null;};}function patchUpdates(_0x4f6a00){return function(_0x2b6871){try{jsonpatch[_0x1a06('0x33')](_0x2b6871,_0x4f6a00,!![]);}catch(_0x48647a){return BPromise[_0x1a06('0x34')](_0x48647a);}return _0x2b6871[_0x1a06('0x35')]();};}function saveUpdates(_0x5bafb7,_0x3c7f01){return function(_0x123d97){if(_0x123d97){return _0x123d97[_0x1a06('0x36')](_0x5bafb7)[_0x1a06('0x1f')](function(_0x158d2f){return _0x158d2f;});}return null;};}function removeEntity(_0x3705b9,_0x5250c2){return function(_0x35c8a8){if(_0x35c8a8){return _0x35c8a8['destroy']()[_0x1a06('0x1f')](function(){var _0x58ac8c=_0x35c8a8[_0x1a06('0x37')]({'plain':!![]});var _0x1ec556=_0x1a06('0x38');return db[_0x1a06('0x39')][_0x1a06('0x3a')]({'where':{'type':_0x1ec556,'resourceId':_0x58ac8c['id']}})[_0x1a06('0x1f')](function(){return _0x35c8a8;});})[_0x1a06('0x1f')](function(){_0x3705b9[_0x1a06('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dab5d,_0x29a857){return function(_0x4b5b58){if(!_0x4b5b58){_0x3dab5d[_0x1a06('0x2a')](0x194);}return _0x4b5b58;};}function handleError(_0x5b8128,_0x4dda09){_0x4dda09=_0x4dda09||0x1f4;return function(_0x496f28){logger[_0x1a06('0x25')](_0x496f28[_0x1a06('0x3b')]);if(_0x496f28[_0x1a06('0x3c')]){delete _0x496f28[_0x1a06('0x3c')];}_0x5b8128[_0x1a06('0x2c')](_0x4dda09)[_0x1a06('0x3d')](_0x496f28);};}exports[_0x1a06('0x3e')]=function(_0x31173f,_0x2972f2){var _0x553731={'include':[{'model':db['Pause'],'as':_0x1a06('0x3f')}]},_0x1db315={},_0xfd9ef8={'count':0x0,'rows':[]};var _0x38d941=_[_0x1a06('0x40')](db['FaxAccount'][_0x1a06('0x41')],function(_0x38e48a){return{'name':_0x38e48a[_0x1a06('0x42')],'type':_0x38e48a[_0x1a06('0x43')][_0x1a06('0x44')]};});_0x1db315['model']=_[_0x1a06('0x40')](_0x38d941,_0x1a06('0x3c'));_0x1db315[_0x1a06('0x45')]=_[_0x1a06('0x46')](_0x31173f[_0x1a06('0x45')]);_0x1db315[_0x1a06('0x47')]=_[_0x1a06('0x48')](_0x1db315[_0x1a06('0x49')],_0x1db315[_0x1a06('0x45')]);_0x553731[_0x1a06('0x4a')]=_[_0x1a06('0x48')](_0x1db315[_0x1a06('0x49')],qs[_0x1a06('0x4b')](_0x31173f[_0x1a06('0x45')]['fields']));_0x553731[_0x1a06('0x4a')]=_0x553731[_0x1a06('0x4a')][_0x1a06('0x4c')]?_0x553731[_0x1a06('0x4a')]:_0x1db315[_0x1a06('0x49')];if(!_0x31173f['query'][_0x1a06('0x4d')](_0x1a06('0x4e'))){_0x553731[_0x1a06('0x31')]=qs[_0x1a06('0x31')](_0x31173f[_0x1a06('0x45')][_0x1a06('0x31')]);_0x553731[_0x1a06('0x2e')]=qs['offset'](_0x31173f['query'][_0x1a06('0x2e')]);}_0x553731[_0x1a06('0x4f')]=qs['sort'](_0x31173f['query']['sort']);_0x553731['where']=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0x31173f[_0x1a06('0x45')],_0x1db315[_0x1a06('0x47')]),_0x38d941);if(_0x31173f[_0x1a06('0x45')][_0x1a06('0x51')]){_0x553731[_0x1a06('0x52')]=_[_0x1a06('0x53')](_0x553731[_0x1a06('0x52')],{'$or':_[_0x1a06('0x40')](_0x38d941,function(_0x553d6f){if(_0x553d6f['type']!==_0x1a06('0x54')){var _0x2f9cf7={};_0x2f9cf7[_0x553d6f[_0x1a06('0x3c')]]={'$like':'%'+_0x31173f[_0x1a06('0x45')][_0x1a06('0x51')]+'%'};return _0x2f9cf7;}})});}_0x553731=_[_0x1a06('0x53')]({},_0x553731,_0x31173f[_0x1a06('0x55')]);var _0x316602={'where':_0x553731[_0x1a06('0x52')]};return db[_0x1a06('0x56')][_0x1a06('0x30')](_0x316602)['then'](function(_0x394326){_0xfd9ef8[_0x1a06('0x30')]=_0x394326;if(_0x31173f[_0x1a06('0x45')][_0x1a06('0x57')]){_0x553731[_0x1a06('0x58')]=[{'all':!![]}];}return db[_0x1a06('0x56')][_0x1a06('0x59')](_0x553731);})['then'](function(_0x39e691){_0xfd9ef8[_0x1a06('0x5a')]=_0x39e691;return _0xfd9ef8;})['then'](respondWithFilteredResult(_0x2972f2,_0x553731))['catch'](handleError(_0x2972f2,null));};exports[_0x1a06('0x5b')]=function(_0x476ad9,_0x18c1ed){var _0x56267a={'raw':![],'where':{'id':_0x476ad9['params']['id']},'include':[{'model':db[_0x1a06('0x5c')],'as':_0x1a06('0x3f')}]},_0x5b89d2={};_0x5b89d2[_0x1a06('0x49')]=_[_0x1a06('0x46')](db[_0x1a06('0x56')]['rawAttributes']);_0x5b89d2[_0x1a06('0x45')]=_[_0x1a06('0x46')](_0x476ad9[_0x1a06('0x45')]);_0x5b89d2[_0x1a06('0x47')]=_[_0x1a06('0x48')](_0x5b89d2[_0x1a06('0x49')],_0x5b89d2[_0x1a06('0x45')]);_0x56267a[_0x1a06('0x4a')]=_[_0x1a06('0x48')](_0x5b89d2['model'],qs['fields'](_0x476ad9[_0x1a06('0x45')][_0x1a06('0x4b')]));_0x56267a[_0x1a06('0x4a')]=_0x56267a[_0x1a06('0x4a')][_0x1a06('0x4c')]?_0x56267a[_0x1a06('0x4a')]:_0x5b89d2[_0x1a06('0x49')];if(_0x476ad9[_0x1a06('0x45')][_0x1a06('0x57')]){_0x56267a[_0x1a06('0x58')]=[{'all':!![]}];}_0x56267a=_[_0x1a06('0x53')]({},_0x56267a,_0x476ad9[_0x1a06('0x55')]);return db[_0x1a06('0x56')][_0x1a06('0x5d')](_0x56267a)['then'](handleEntityNotFound(_0x18c1ed,null))[_0x1a06('0x1f')](respondWithResult(_0x18c1ed,null))[_0x1a06('0x29')](handleError(_0x18c1ed,null));};exports[_0x1a06('0x5e')]=function(_0x1f4c99,_0x508432){return db[_0x1a06('0x56')][_0x1a06('0x5e')](_0x1f4c99[_0x1a06('0x5f')],{})[_0x1a06('0x1f')](function(_0x1b17b9){var _0x110327=_0x1f4c99[_0x1a06('0x60')][_0x1a06('0x37')]({'plain':!![]});if(!_0x110327)throw new Error(_0x1a06('0x61'));if(_0x110327[_0x1a06('0x62')]===_0x1a06('0x60')){var _0x31f60c=_0x1b17b9['get']({'plain':!![]});var _0x270d42=_0x1a06('0x38');return db[_0x1a06('0x63')][_0x1a06('0x5d')]({'where':{'name':_0x270d42,'userProfileId':_0x110327['userProfileId']},'raw':!![]})[_0x1a06('0x1f')](function(_0x3a12cf){if(_0x3a12cf&&_0x3a12cf[_0x1a06('0x64')]===0x0){return db[_0x1a06('0x39')][_0x1a06('0x5e')]({'name':_0x31f60c[_0x1a06('0x3c')],'resourceId':_0x31f60c['id'],'type':_0x3a12cf[_0x1a06('0x3c')],'sectionId':_0x3a12cf['id']},{})[_0x1a06('0x1f')](function(){return _0x1b17b9;});}else{return _0x1b17b9;}})[_0x1a06('0x29')](function(_0x26e7ae){logger[_0x1a06('0x25')](_0x1a06('0x65'),_0x26e7ae);throw _0x26e7ae;});}return _0x1b17b9;})[_0x1a06('0x1f')](respondWithResult(_0x508432,0xc9))[_0x1a06('0x29')](handleError(_0x508432,null));};exports['update']=function(_0xf698ef,_0x32f279){if(_0xf698ef[_0x1a06('0x5f')]['id']){delete _0xf698ef[_0x1a06('0x5f')]['id'];}return db[_0x1a06('0x56')][_0x1a06('0x5d')]({'where':{'id':_0xf698ef[_0x1a06('0x66')]['id']},'include':[{'model':db[_0x1a06('0x5c')],'as':_0x1a06('0x3f')}]})[_0x1a06('0x1f')](handleEntityNotFound(_0x32f279,null))[_0x1a06('0x1f')](saveUpdates(_0xf698ef[_0x1a06('0x5f')],null))['then'](respondWithResult(_0x32f279,null))[_0x1a06('0x29')](handleError(_0x32f279,null));};exports['destroy']=function(_0x4f99cb,_0x1cc505){return db[_0x1a06('0x56')][_0x1a06('0x5d')]({'where':{'id':_0x4f99cb[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x1cc505,null))['then'](removeEntity(_0x1cc505,null))[_0x1a06('0x29')](handleError(_0x1cc505,null));};exports[_0x1a06('0x67')]=function(_0xf97664,_0xb7ffeb){return db['FaxAccount']['describe']()[_0x1a06('0x1f')](respondWithResult(_0xb7ffeb,null))[_0x1a06('0x29')](handleError(_0xb7ffeb,null));};exports[_0x1a06('0x68')]=function(_0x531ee1,_0x1a35bf,_0x4f779c){if(_0x531ee1[_0x1a06('0x5f')]['id']){delete _0x531ee1[_0x1a06('0x5f')]['id'];}return db['FaxAccount'][_0x1a06('0x5d')]({'where':{'id':_0x531ee1['params']['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x1a35bf,null))[_0x1a06('0x1f')](function(_0x3b6b30){if(_0x3b6b30){_0x531ee1[_0x1a06('0x5f')][_0x1a06('0x69')]=_0x3b6b30['id'];return db[_0x1a06('0x6a')]['create'](_0x531ee1[_0x1a06('0x5f')]);}})[_0x1a06('0x1f')](respondWithResult(_0x1a35bf,null))[_0x1a06('0x29')](handleError(_0x1a35bf,null));};exports[_0x1a06('0x6b')]=function(_0x4b01f8,_0x5a0772,_0x4540be){var _0x5edf5f={'raw':![],'where':{}};var _0x3fbd6b={};var _0x3d3f74={'count':0x0,'rows':[]};return db[_0x1a06('0x56')][_0x1a06('0x6c')]({'where':{'id':_0x4b01f8[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x5a0772,null))[_0x1a06('0x1f')](function(_0x1317a4){if(_0x1317a4){_0x3fbd6b[_0x1a06('0x49')]=_[_0x1a06('0x46')](db[_0x1a06('0x6a')][_0x1a06('0x41')]);_0x3fbd6b['query']=_[_0x1a06('0x46')](_0x4b01f8['query']);_0x3fbd6b['filters']=_[_0x1a06('0x48')](_0x3fbd6b['model'],_0x3fbd6b[_0x1a06('0x45')]);_0x5edf5f[_0x1a06('0x4a')]=_[_0x1a06('0x48')](_0x3fbd6b['model'],qs[_0x1a06('0x4b')](_0x4b01f8[_0x1a06('0x45')][_0x1a06('0x4b')]));_0x5edf5f[_0x1a06('0x4a')]=_0x5edf5f['attributes']['length']?_0x5edf5f[_0x1a06('0x4a')]:_0x3fbd6b['model'];if(!_0x4b01f8[_0x1a06('0x45')][_0x1a06('0x4d')]('nolimit')){_0x5edf5f[_0x1a06('0x31')]=qs[_0x1a06('0x31')](_0x4b01f8[_0x1a06('0x45')]['limit']);_0x5edf5f[_0x1a06('0x2e')]=qs['offset'](_0x4b01f8[_0x1a06('0x45')]['offset']);}_0x5edf5f[_0x1a06('0x4f')]=qs[_0x1a06('0x6d')](_0x4b01f8['query'][_0x1a06('0x6d')]);_0x5edf5f[_0x1a06('0x52')]=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0x4b01f8[_0x1a06('0x45')],_0x3fbd6b[_0x1a06('0x47')]));_0x5edf5f['where'][_0x1a06('0x69')]=_0x1317a4['id'];if(_0x4b01f8[_0x1a06('0x45')][_0x1a06('0x51')]){_0x5edf5f[_0x1a06('0x52')]=_['merge'](_0x5edf5f[_0x1a06('0x52')],{'$or':_[_0x1a06('0x40')](_0x5edf5f['attributes'],function(_0x24800d){var _0x2502f1={};_0x2502f1[_0x24800d]={'$like':'%'+_0x4b01f8['query']['filter']+'%'};return _0x2502f1;})});}_0x5edf5f=_[_0x1a06('0x53')]({},_0x5edf5f,_0x4b01f8[_0x1a06('0x55')]);return db[_0x1a06('0x6a')]['count']({'where':_0x5edf5f[_0x1a06('0x52')]})[_0x1a06('0x1f')](function(_0xc9bea9){_0x3d3f74['count']=_0xc9bea9;if(_0x4b01f8['query']['includeAll']){_0x5edf5f[_0x1a06('0x58')]=[{'all':!![]}];}return db[_0x1a06('0x6a')][_0x1a06('0x59')](_0x5edf5f);})['then'](function(_0x7d7320){_0x3d3f74[_0x1a06('0x5a')]=_0x7d7320;return _0x3d3f74;});}})[_0x1a06('0x1f')](respondWithFilteredResult(_0x5a0772,_0x5edf5f))[_0x1a06('0x29')](handleError(_0x5a0772,null));};exports[_0x1a06('0x6e')]=function(_0x416af8,_0x586126,_0x5a2a44){return db[_0x1a06('0x56')][_0x1a06('0x5d')]({'where':{'id':_0x416af8[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x586126,null))['then'](function(_0x1dd974){if(_0x1dd974){return _0x1dd974[_0x1a06('0x6e')](_0x416af8[_0x1a06('0x45')][_0x1a06('0x6f')]);}})[_0x1a06('0x1f')](respondWithStatusCode(_0x586126,null))['catch'](handleError(_0x586126,null));};exports[_0x1a06('0x70')]=function(_0x3c1720,_0x5664f0,_0x2b5664){if(_0x3c1720[_0x1a06('0x5f')]['id']){delete _0x3c1720[_0x1a06('0x5f')]['id'];}return db[_0x1a06('0x56')][_0x1a06('0x5d')]({'where':{'id':_0x3c1720['params']['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x5664f0,null))[_0x1a06('0x1f')](function(_0x1e9cf6){if(_0x1e9cf6){_0x3c1720[_0x1a06('0x5f')][_0x1a06('0x69')]=_0x1e9cf6['id'];return db[_0x1a06('0x71')][_0x1a06('0x5e')](_0x3c1720['body']);}})[_0x1a06('0x1f')](respondWithResult(_0x5664f0,null))[_0x1a06('0x29')](handleError(_0x5664f0,null));};exports[_0x1a06('0x72')]=function(_0x3b627d,_0x3577f4,_0x1ae181){var _0xbf54aa={'raw':![],'where':{}};var _0x4e1219={};var _0x275fee={'count':0x0,'rows':[]};return db[_0x1a06('0x56')][_0x1a06('0x6c')]({'where':{'id':_0x3b627d[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x3577f4,null))[_0x1a06('0x1f')](function(_0x2b774f){if(_0x2b774f){_0x4e1219['model']=_[_0x1a06('0x46')](db[_0x1a06('0x71')]['rawAttributes']);_0x4e1219[_0x1a06('0x45')]=_[_0x1a06('0x46')](_0x3b627d[_0x1a06('0x45')]);_0x4e1219[_0x1a06('0x47')]=_['intersection'](_0x4e1219[_0x1a06('0x49')],_0x4e1219[_0x1a06('0x45')]);_0xbf54aa[_0x1a06('0x4a')]=_[_0x1a06('0x48')](_0x4e1219[_0x1a06('0x49')],qs['fields'](_0x3b627d[_0x1a06('0x45')]['fields']));_0xbf54aa[_0x1a06('0x4a')]=_0xbf54aa[_0x1a06('0x4a')][_0x1a06('0x4c')]?_0xbf54aa[_0x1a06('0x4a')]:_0x4e1219['model'];if(!_0x3b627d[_0x1a06('0x45')][_0x1a06('0x4d')](_0x1a06('0x4e'))){_0xbf54aa[_0x1a06('0x31')]=qs[_0x1a06('0x31')](_0x3b627d[_0x1a06('0x45')][_0x1a06('0x31')]);_0xbf54aa[_0x1a06('0x2e')]=qs[_0x1a06('0x2e')](_0x3b627d[_0x1a06('0x45')]['offset']);}_0xbf54aa[_0x1a06('0x4f')]=qs['sort'](_0x3b627d[_0x1a06('0x45')][_0x1a06('0x6d')]);_0xbf54aa['where']=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0x3b627d[_0x1a06('0x45')],_0x4e1219[_0x1a06('0x47')]));_0xbf54aa[_0x1a06('0x52')][_0x1a06('0x69')]=_0x2b774f['id'];if(_0x3b627d[_0x1a06('0x45')][_0x1a06('0x51')]){_0xbf54aa[_0x1a06('0x52')]=_['merge'](_0xbf54aa['where'],{'$or':_[_0x1a06('0x40')](_0xbf54aa[_0x1a06('0x4a')],function(_0x1daa9f){var _0x45e0e1={};_0x45e0e1[_0x1daa9f]={'$like':'%'+_0x3b627d['query']['filter']+'%'};return _0x45e0e1;})});}_0xbf54aa=_['merge']({},_0xbf54aa,_0x3b627d[_0x1a06('0x55')]);return db['CannedAnswer'][_0x1a06('0x30')]({'where':_0xbf54aa[_0x1a06('0x52')]})[_0x1a06('0x1f')](function(_0x1fd417){_0x275fee[_0x1a06('0x30')]=_0x1fd417;if(_0x3b627d[_0x1a06('0x45')][_0x1a06('0x57')]){_0xbf54aa[_0x1a06('0x58')]=[{'all':!![]}];}return db[_0x1a06('0x71')][_0x1a06('0x59')](_0xbf54aa);})[_0x1a06('0x1f')](function(_0x1434a0){_0x275fee[_0x1a06('0x5a')]=_0x1434a0;return _0x275fee;});}})[_0x1a06('0x1f')](respondWithFilteredResult(_0x3577f4,_0xbf54aa))['catch'](handleError(_0x3577f4,null));};exports[_0x1a06('0x73')]=function(_0x21968a,_0xe915bb,_0x2910bf){return db['FaxAccount'][_0x1a06('0x5d')]({'where':{'id':_0x21968a['params']['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0xe915bb,null))[_0x1a06('0x1f')](function(_0x58089d){if(_0x58089d){return _0x58089d['removeAnswers'](_0x21968a[_0x1a06('0x45')]['ids']);}})['then'](respondWithStatusCode(_0xe915bb,null))[_0x1a06('0x29')](handleError(_0xe915bb,null));};exports[_0x1a06('0x74')]=function(_0x385e75,_0x1392dc,_0x1b452d){return db[_0x1a06('0x75')][_0x1a06('0x5d')]({'where':{'id':_0x385e75['params']['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x1392dc,null))['then'](function(_0x165034){if(_0x165034){return _0x165034[_0x1a06('0x74')](_0x385e75[_0x1a06('0x5f')][_0x1a06('0x6f')],_['omit'](_0x385e75['body'],[_0x1a06('0x6f'),'id'])||{});}})[_0x1a06('0x1f')](respondWithResult(_0x1392dc,null))[_0x1a06('0x29')](handleError(_0x1392dc,null));};exports[_0x1a06('0x76')]=function(_0x10d357,_0x18ff74,_0x4cdd8f){var _0x1bc3bb={'raw':![],'where':{}};var _0x39c867={};var _0x123f8e={'count':0x0,'rows':[]};return db[_0x1a06('0x56')][_0x1a06('0x6c')]({'where':{'id':_0x10d357[_0x1a06('0x66')]['id']}})['then'](handleEntityNotFound(_0x18ff74,null))[_0x1a06('0x1f')](function(_0x12b183){if(_0x12b183){_0x39c867[_0x1a06('0x49')]=_[_0x1a06('0x46')](db['FaxInteraction'][_0x1a06('0x41')]);_0x39c867[_0x1a06('0x45')]=_[_0x1a06('0x46')](_0x10d357[_0x1a06('0x45')]);_0x39c867[_0x1a06('0x47')]=_[_0x1a06('0x48')](_0x39c867[_0x1a06('0x49')],_0x39c867[_0x1a06('0x45')]);_0x1bc3bb[_0x1a06('0x4a')]=_['intersection'](_0x39c867['model'],qs[_0x1a06('0x4b')](_0x10d357[_0x1a06('0x45')][_0x1a06('0x4b')]));_0x1bc3bb['attributes']=_0x1bc3bb[_0x1a06('0x4a')]['length']?_0x1bc3bb[_0x1a06('0x4a')]:_0x39c867[_0x1a06('0x49')];if(!_0x10d357[_0x1a06('0x45')][_0x1a06('0x4d')](_0x1a06('0x4e'))){_0x1bc3bb['limit']=qs[_0x1a06('0x31')](_0x10d357['query'][_0x1a06('0x31')]);_0x1bc3bb[_0x1a06('0x2e')]=qs[_0x1a06('0x2e')](_0x10d357[_0x1a06('0x45')][_0x1a06('0x2e')]);}_0x1bc3bb['order']=qs[_0x1a06('0x6d')](_0x10d357['query'][_0x1a06('0x6d')]);_0x1bc3bb[_0x1a06('0x52')]=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0x10d357['query'],_0x39c867[_0x1a06('0x47')]));_0x1bc3bb[_0x1a06('0x52')][_0x1a06('0x69')]=_0x12b183['id'];if(_0x10d357[_0x1a06('0x45')]['filter']){_0x1bc3bb[_0x1a06('0x52')]=_[_0x1a06('0x53')](_0x1bc3bb['where'],{'$or':_[_0x1a06('0x40')](_0x1bc3bb[_0x1a06('0x4a')],function(_0x42fca8){var _0x2d0e44={};_0x2d0e44[_0x42fca8]={'$like':'%'+_0x10d357[_0x1a06('0x45')][_0x1a06('0x51')]+'%'};return _0x2d0e44;})});}_0x1bc3bb=_[_0x1a06('0x53')]({},_0x1bc3bb,_0x10d357[_0x1a06('0x55')]);return db[_0x1a06('0x75')]['count']({'where':_0x1bc3bb[_0x1a06('0x52')]})[_0x1a06('0x1f')](function(_0x2bae3d){_0x123f8e['count']=_0x2bae3d;if(_0x10d357[_0x1a06('0x45')][_0x1a06('0x57')]){_0x1bc3bb[_0x1a06('0x58')]=[{'model':db[_0x1a06('0x77')],'as':'Contact','required':![]},{'model':db[_0x1a06('0x78')],'as':_0x1a06('0x79'),'attributes':[_0x1a06('0x3c'),_0x1a06('0x7a'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x1a06('0x7b'),'attributes':['id',_0x1a06('0x3c'),_0x1a06('0x7c')],'where':_0x10d357[_0x1a06('0x45')][_0x1a06('0x7d')]?{'id':_0x10d357[_0x1a06('0x45')][_0x1a06('0x7d')]}:undefined,'required':_0x10d357[_0x1a06('0x45')]['tag']?!![]:![]}];}return db[_0x1a06('0x75')]['findAll'](_0x1bc3bb);})[_0x1a06('0x1f')](function(_0x2d870d){_0x123f8e[_0x1a06('0x5a')]=_0x2d870d;return _0x123f8e;});}})[_0x1a06('0x1f')](respondWithFilteredResult(_0x18ff74,_0x1bc3bb))[_0x1a06('0x29')](handleError(_0x18ff74,null));};exports[_0x1a06('0x7e')]=function(_0x7f040c,_0x4d1ddf){var _0x1eda73=_0x7f040c[_0x1a06('0x66')]['id'];var _0x42f9e7=_0x7f040c['body'];var _0x2d40b7=0xc8;var _0x57674f=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x1a06('0x7f')][_0x1a06('0x80')]},function(_0xbe7c9c){return db[_0x1a06('0x56')]['findOne']({'where':{'id':_0x1eda73},'transaction':_0xbe7c9c})[_0x1a06('0x1f')](function(_0x3485f7){if(_0x3485f7){return db[_0x1a06('0x81')]['destroy']({'where':{'FaxAccountId':_0x1eda73},'transaction':_0xbe7c9c})[_0x1a06('0x1f')](function(){var _0x109d02=_[_0x1a06('0x40')](_0x42f9e7,function(_0xbfade2){_0xbfade2[_0x1a06('0x69')]=_0x1eda73;return _0xbfade2;});return db['FaxApplication'][_0x1a06('0x82')](_0x109d02,{'transaction':_0xbe7c9c});});}else{_0x2d40b7=0x194;_0x57674f=[];}});})['then'](function(){if(_0x2d40b7!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x1eda73},'order':_0x1a06('0x83')})[_0x1a06('0x1f')](function(_0x278948){_0x57674f=_0x278948;});}})[_0x1a06('0x29')](function(_0x2c78fa){_0x2d40b7=0x1f4;logger['error'](_0x2c78fa[_0x1a06('0x3b')]);if(_0x2c78fa[_0x1a06('0x3c')]){delete _0x2c78fa[_0x1a06('0x3c')];}_0x57674f=_0x2c78fa;})['finally'](function(){if(_0x57674f===null){_0x4d1ddf[_0x1a06('0x2a')](_0x2d40b7);}else{if(_0x2d40b7===0x1f4){_0x4d1ddf[_0x1a06('0x2c')](_0x2d40b7)['send'](_0x57674f);}else{_0x4d1ddf[_0x1a06('0x2c')](_0x2d40b7)[_0x1a06('0x2d')](_0x57674f);}}});};exports[_0x1a06('0x84')]=function(_0x2ba596,_0x1f2eae,_0x2230f0){var _0x43217f={};var _0x57365c={};var _0x5ec389;var _0x212df7;return db[_0x1a06('0x56')][_0x1a06('0x6c')]({'where':{'id':_0x2ba596['params']['id']}})['then'](handleEntityNotFound(_0x1f2eae,null))[_0x1a06('0x1f')](function(_0x1e48ab){if(_0x1e48ab){_0x5ec389=_0x1e48ab;_0x57365c[_0x1a06('0x49')]=_['keys'](db['FaxApplication'][_0x1a06('0x41')]);_0x57365c[_0x1a06('0x45')]=_['keys'](_0x2ba596['query']);_0x57365c[_0x1a06('0x47')]=_[_0x1a06('0x48')](_0x57365c['model'],_0x57365c[_0x1a06('0x45')]);_0x43217f[_0x1a06('0x4a')]=_[_0x1a06('0x48')](_0x57365c['model'],qs[_0x1a06('0x4b')](_0x2ba596[_0x1a06('0x45')][_0x1a06('0x4b')]));_0x43217f[_0x1a06('0x4a')]=_0x43217f[_0x1a06('0x4a')][_0x1a06('0x4c')]?_0x43217f[_0x1a06('0x4a')]:_0x57365c[_0x1a06('0x49')];_0x43217f['order']=qs[_0x1a06('0x6d')](_0x2ba596[_0x1a06('0x45')]['sort']);_0x43217f[_0x1a06('0x52')]=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0x2ba596[_0x1a06('0x45')],_0x57365c[_0x1a06('0x47')]));if(_0x2ba596[_0x1a06('0x45')][_0x1a06('0x51')]){_0x43217f[_0x1a06('0x52')]=_[_0x1a06('0x53')](_0x43217f[_0x1a06('0x52')],{'$or':_['map'](_0x43217f[_0x1a06('0x4a')],function(_0x32ef56){var _0x4ce98e={};_0x4ce98e[_0x32ef56]={'$like':'%'+_0x2ba596[_0x1a06('0x45')][_0x1a06('0x51')]+'%'};return _0x4ce98e;})});}_0x43217f=_[_0x1a06('0x53')]({},_0x43217f,_0x2ba596[_0x1a06('0x55')]);return _0x5ec389[_0x1a06('0x84')](_0x43217f);}})[_0x1a06('0x1f')](function(_0x582090){if(_0x582090){_0x212df7=_0x582090['length'];if(!_0x2ba596[_0x1a06('0x45')][_0x1a06('0x4d')](_0x1a06('0x4e'))){_0x43217f[_0x1a06('0x31')]=qs[_0x1a06('0x31')](_0x2ba596['query'][_0x1a06('0x31')]);_0x43217f[_0x1a06('0x2e')]=qs[_0x1a06('0x2e')](_0x2ba596['query'][_0x1a06('0x2e')]);}return _0x5ec389[_0x1a06('0x84')](_0x43217f);}})[_0x1a06('0x1f')](function(_0x29c583){if(_0x29c583){return _0x29c583?{'count':_0x212df7,'rows':_0x29c583}:null;}})['then'](respondWithResult(_0x1f2eae,null))[_0x1a06('0x29')](handleError(_0x1f2eae,null));};function Extension(_0x2b3e32,_0xbcda61,_0x143133,_0x34ea66){this['context']=_0x1a06('0x85');this[_0x1a06('0x86')]=_0x2b3e32[_0x1a06('0x87')];this[_0x1a06('0x88')]=_0x34ea66;this[_0x1a06('0x43')]=_0x1a06('0x89');this['description']=_0x1a06('0x8a');this[_0x1a06('0x69')]=_0x2b3e32['id'];this[_0x1a06('0x83')]=_0xbcda61;this[_0x1a06('0x8b')]=_0x143133;}function createExtensionsReciveFax(_0x157fa4){var _0x3a59a9=0x1;var _0xe97bc5=[];_0xe97bc5[_0x1a06('0x8c')](new Extension(_0x157fa4,_0x3a59a9,'',_0x1a06('0x8d')));_0x3a59a9+=0x1;_0xe97bc5[_0x1a06('0x8c')](new Extension(_0x157fa4,_0x3a59a9,_0x1a06('0x8e'),_0x1a06('0x8f')));_0x3a59a9+=0x1;for(var _0x539829 in _0x157fa4){if(_0x157fa4[_0x1a06('0x4d')](_0x539829)&&(_0x539829==='ecm'||_0x539829==='localstationid'||_0x539829===_0x1a06('0x90')||_0x539829===_0x1a06('0x91')||_0x539829==='headerinfo'||_0x539829===_0x1a06('0x92')||_0x539829===_0x1a06('0x93')||_0x539829==='modem'||_0x539829===_0x1a06('0x94'))){_0xe97bc5[_0x1a06('0x8c')](new Extension(_0x157fa4,_0x3a59a9,_0x1a06('0x95')+_0x539829+')='+_0x157fa4[_0x539829],_0x1a06('0x8f')));_0x3a59a9+=0x1;}}_0xe97bc5[_0x1a06('0x8c')](new Extension(_0x157fa4,_0x3a59a9,'6',_0x1a06('0x96')));_0x3a59a9+=0x1;_0xe97bc5['push'](new Extension(_0x157fa4,_0x3a59a9,_0x1a06('0x97'),_0x1a06('0x98')));_0x3a59a9=0x0;return _0xe97bc5;}exports[_0x1a06('0x99')]=function(_0xa58513,_0x42dfbc,_0x3dbcdf){var _0x460572;return db[_0x1a06('0x9a')][_0x1a06('0x9b')](function(_0x1b8d2){return db['FaxAccount']['create'](_0xa58513[_0x1a06('0x5f')],{'transaction':_0x1b8d2})[_0x1a06('0x1f')](function(_0xa389bb){_0x460572=_0xa389bb[_0x1a06('0x37')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x460572),{'transaction':_0x1b8d2});});})['then'](function(){return _0x460572;})['then'](respondWithResult(_0x42dfbc,null))[_0x1a06('0x29')](handleError(_0x42dfbc,null));};exports[_0x1a06('0x9c')]=function(_0x39e495,_0x1bcd3f,_0x3fdfad){var _0x2a8626;return db[_0x1a06('0x9a')][_0x1a06('0x9b')](function(_0x50ed0e){return db['FaxAccount'][_0x1a06('0x36')](_0x39e495[_0x1a06('0x5f')],{'where':{'id':_0x39e495[_0x1a06('0x5f')]['id']},'transaction':_0x50ed0e})['then'](function(_0x519c11){return db[_0x1a06('0x9d')][_0x1a06('0x3a')]({'where':{'FaxAccountId':_0x39e495[_0x1a06('0x5f')]['id']},'transaction':_0x50ed0e})[_0x1a06('0x1f')](function(_0x4fd5f4){return db[_0x1a06('0x9d')][_0x1a06('0x82')](createExtensionsReciveFax(_['omit'](_0x39e495[_0x1a06('0x5f')],[_0x1a06('0x9e'),_0x1a06('0x44'),_0x1a06('0x9f'),'updatedAt',_0x1a06('0xa0'),_0x1a06('0xa1')])),{'transaction':_0x50ed0e});});});})[_0x1a06('0x1f')](function(){return db[_0x1a06('0x56')][_0x1a06('0xa2')](_0x39e495[_0x1a06('0x5f')]['id']);})['then'](respondWithResult(_0x1bcd3f,null))[_0x1a06('0x29')](handleError(_0x1bcd3f,null));};exports['getMessages']=function(_0xbf71dc,_0x5b96d3,_0x3c86e9){var _0xaf768d={'raw':!![],'where':{}};var _0x1a9956={};var _0x1a0344={'count':0x0,'rows':[]};return db[_0x1a06('0x56')][_0x1a06('0x6c')]({'where':{'id':_0xbf71dc['params']['id']}})['then'](handleEntityNotFound(_0x5b96d3,null))[_0x1a06('0x1f')](function(_0x3d7b47){if(_0x3d7b47){_0x1a9956[_0x1a06('0x49')]=_[_0x1a06('0x46')](db[_0x1a06('0xa3')][_0x1a06('0x41')]);_0x1a9956[_0x1a06('0x45')]=_[_0x1a06('0x46')](_0xbf71dc[_0x1a06('0x45')]);_0x1a9956[_0x1a06('0x47')]=_[_0x1a06('0x48')](_0x1a9956[_0x1a06('0x49')],_0x1a9956[_0x1a06('0x45')]);_0xaf768d[_0x1a06('0x4a')]=_[_0x1a06('0x48')](_0x1a9956[_0x1a06('0x49')],qs['fields'](_0xbf71dc[_0x1a06('0x45')][_0x1a06('0x4b')]));_0xaf768d[_0x1a06('0x4a')]=_0xaf768d['attributes'][_0x1a06('0x4c')]?_0xaf768d[_0x1a06('0x4a')]:_0x1a9956[_0x1a06('0x49')];if(!_0xbf71dc[_0x1a06('0x45')][_0x1a06('0x4d')]('nolimit')){_0xaf768d[_0x1a06('0x31')]=qs[_0x1a06('0x31')](_0xbf71dc[_0x1a06('0x45')][_0x1a06('0x31')]);_0xaf768d['offset']=qs[_0x1a06('0x2e')](_0xbf71dc[_0x1a06('0x45')]['offset']);}_0xaf768d['order']=qs['sort'](_0xbf71dc['query']['sort']);_0xaf768d[_0x1a06('0x52')]=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0xbf71dc[_0x1a06('0x45')],_0x1a9956['filters']));_0xaf768d[_0x1a06('0x52')]['FaxAccountId']=_0x3d7b47['id'];if(_0xbf71dc[_0x1a06('0x45')][_0x1a06('0x51')]){_0xaf768d['where']=_['merge'](_0xaf768d[_0x1a06('0x52')],{'$or':_[_0x1a06('0x40')](_0xaf768d[_0x1a06('0x4a')],function(_0x266369){var _0x19e12f={};_0x19e12f[_0x266369]={'$like':'%'+_0xbf71dc['query'][_0x1a06('0x51')]+'%'};return _0x19e12f;})});}if(_0xbf71dc['query']['$gte']){var _0x203a71=_0xbf71dc['query'][_0x1a06('0xa4')][_0x1a06('0xa5')](',');var _0x2ae219={};_0x2ae219[_0x203a71[0x0]]={'$gte':moment(_0x203a71[0x1])[_0x1a06('0xa6')](_0x1a06('0xa7'))};_0xaf768d['where']=_[_0x1a06('0x53')](_0xaf768d[_0x1a06('0x52')],_0x2ae219);}_0xaf768d=_[_0x1a06('0x53')]({},_0xaf768d,_0xbf71dc[_0x1a06('0x55')]);return db['FaxMessage']['count']({'where':_0xaf768d[_0x1a06('0x52')]})['then'](function(_0xc067b7){_0x1a0344[_0x1a06('0x30')]=_0xc067b7;if(_0xbf71dc['query']['includeAll']){_0xaf768d[_0x1a06('0x58')]=[{'all':!![]}];}return db[_0x1a06('0xa3')][_0x1a06('0x59')](_0xaf768d);})[_0x1a06('0x1f')](function(_0x5f53c0){_0x1a0344[_0x1a06('0x5a')]=_0x5f53c0;return _0x1a0344;});}})['then'](respondWithFilteredResult(_0x5b96d3,_0xaf768d))['catch'](handleError(_0x5b96d3,null));};exports[_0x1a06('0x3d')]=function(_0x5ca12a,_0x246dfc,_0x585ebc){var _0x33d94a,_0x3c0af0={},_0x334440;if(_0x5ca12a['body']['to']){_0x334440=_0x5ca12a[_0x1a06('0x5f')]['to'][0x0];}return db[_0x1a06('0x56')]['find']({'where':{'id':_0x5ca12a['params']['id']},'include':[{'model':db[_0x1a06('0xa8')],'as':_0x1a06('0xa9'),'include':[{'model':db[_0x1a06('0x77')],'as':_0x1a06('0xaa'),'where':{'fax':_0x334440},'limit':0x1,'order':[[_0x1a06('0xab'),_0x1a06('0xac')]]}]}]})['then'](handleEntityNotFound(_0x246dfc,null))[_0x1a06('0x1f')](function(_0x47fa22){_0x33d94a=_0x47fa22;if(_0x5ca12a['body'][_0x1a06('0xad')]&&_0x5ca12a['body'][_0x1a06('0xad')][_0x1a06('0x4c')]){for(var _0x3e9a7c=0x0;_0x3e9a7c<_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')]['length'];_0x3e9a7c+=0x1){_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][_0x3e9a7c]={'filename':_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][_0x3e9a7c][_0x1a06('0x3c')],'id':_0x5ca12a['body'][_0x1a06('0xad')][_0x3e9a7c]['id'],'path':path[_0x1a06('0xae')](config['root'],_0x1a06('0xaf'),_0x5ca12a[_0x1a06('0x5f')]['attachments'][_0x3e9a7c][_0x1a06('0xb0')])};}}return respondWithRpcPromise(_0x1a06('0xb1'),_0x1a06('0xb1'),{'FaxAccountId':_[_0x1a06('0xb2')](_0x5ca12a[_0x1a06('0x66')]['id'])?undefined:_0x5ca12a[_0x1a06('0x66')]['id'],'path':_['isNil'](_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][0x0]['path'])?undefined:_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][0x0][_0x1a06('0x6')],'fax':_[_0x1a06('0xb2')](_0x5ca12a[_0x1a06('0x5f')]['to'][0x0])?undefined:_0x5ca12a['body']['to'][0x0]},client9002);})['then'](function(){if(_0x33d94a){if(_['isNil'](_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xb3')])){_0x5ca12a[_0x1a06('0x5f')]['from']=util[_0x1a06('0xa6')](_0x1a06('0xb4'),_0x33d94a[_0x1a06('0x3c')],_0x33d94a['fax']);}if(_0x33d94a[_0x1a06('0xa9')]){if(_0x33d94a[_0x1a06('0xa9')][_0x1a06('0xaa')][_0x1a06('0x4c')]){return _0x33d94a['List']['Contacts'][0x0];}else{return db['CmContact'][_0x1a06('0x5e')](_[_0x1a06('0x17')](_0x5ca12a[_0x1a06('0x5f')],{'firstName':_0x5ca12a[_0x1a06('0x5f')]['to'][0x0],'phone':_0x5ca12a[_0x1a06('0x5f')]['to'][0x0],'fax':_0x5ca12a[_0x1a06('0x5f')]['to'][0x0],'ListId':_0x33d94a['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x1a06('0x1f')](function(_0x5bd841){if(_0x5bd841){return db[_0x1a06('0x75')][_0x1a06('0x5d')]({'where':{'ContactId':_0x5bd841['id'],'closed':![],'FaxAccountId':_0x33d94a['id']}})[_0x1a06('0x1f')](function(_0x25039f){if(_0x25039f){return[_0x25039f,![]];}return db[_0x1a06('0x75')][_0x1a06('0x5e')]({'UserId':_0x5ca12a[_0x1a06('0x60')]['id'],'ContactId':_0x5bd841['id'],'FaxAccountId':_0x33d94a['id'],'fax':_0x5ca12a[_0x1a06('0x5f')]['to'][0x0],'firstMsgDirection':_0x1a06('0xb5'),'Messages':[_[_0x1a06('0x53')](_0x5ca12a[_0x1a06('0x5f')],{'read':![],'body':_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][0x0][_0x1a06('0xb6')],'FaxAccountId':_0x33d94a['id'],'UserId':_0x5ca12a[_0x1a06('0x60')]['id'],'ContactId':_0x5bd841['id'],'AttachmentId':_0x5ca12a['body'][_0x1a06('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1a06('0xb7')}]})['then'](function(_0x3a16a4){return[_0x3a16a4,!![]];});});}else{throw new Error(_0x1a06('0xb8'));}})[_0x1a06('0xb9')](function(_0x1dbbcc,_0x4a3094){if(_0x4a3094){return _0x1dbbcc;}return db['FaxMessage'][_0x1a06('0x5e')]({'direction':_0x1a06('0xb5'),'read':![],'body':_0x5ca12a[_0x1a06('0x5f')]['attachments'][0x0][_0x1a06('0xb6')],'FaxAccountId':_0x33d94a['id'],'FaxInteractionId':_0x1dbbcc['id'],'UserId':_0x5ca12a[_0x1a06('0x60')]['id'],'ContactId':_0x1dbbcc[_0x1a06('0xba')],'AttachmentId':_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][0x0]['id']})[_0x1a06('0x1f')](function(_0x3daddf){_0x1dbbcc['dataValues'][_0x1a06('0xb7')]=[];_0x1dbbcc[_0x1a06('0xbb')]['Messages']['push'](_0x3daddf['dataValues']);return _0x1dbbcc;});})['then'](function(_0x3783cb){respondWithRpcPromise('SendFax',_0x1a06('0xbc'),{'FaxAccountId':_[_0x1a06('0xb2')](_0x5ca12a['params']['id'])?undefined:_0x5ca12a[_0x1a06('0x66')]['id'],'path':_[_0x1a06('0xb2')](_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][0x0][_0x1a06('0x6')])?undefined:_0x5ca12a[_0x1a06('0x5f')][_0x1a06('0xad')][0x0][_0x1a06('0x6')],'fax':_[_0x1a06('0xb2')](_0x5ca12a[_0x1a06('0x5f')]['to'][0x0])?undefined:_0x5ca12a[_0x1a06('0x5f')]['to'][0x0],'AttachmentId':_0x5ca12a['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x4be03a){logger[_0x1a06('0x20')](_0x1a06('0xbd'),_0x4be03a);})['catch'](function(_0x42b423){logger[_0x1a06('0x20')](_0x1a06('0xbd'),_0x42b423);});return _0x3783cb;})[_0x1a06('0x1f')](respondWithResult(_0x246dfc,null))[_0x1a06('0x29')](handleError(_0x246dfc,null));};exports[_0x1a06('0xbe')]=function(_0x128022,_0x5aa0bd,_0x19b222){return db['FaxAccount'][_0x1a06('0x5d')]({'where':{'id':_0x128022[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x5aa0bd,null))['then'](function(_0x32264c){if(_0x32264c){return _0x32264c[_0x1a06('0xbe')](_0x128022[_0x1a06('0x5f')][_0x1a06('0x6f')],_[_0x1a06('0xbf')](_0x128022[_0x1a06('0x5f')],[_0x1a06('0x6f'),'id'])||{})['spread'](function(_0x1470b4){for(var _0xd3173c=0x0;_0xd3173c<_0x128022[_0x1a06('0x5f')][_0x1a06('0x6f')][_0x1a06('0x4c')];_0xd3173c+=0x1){socket[_0x1a06('0xc0')]('userFaxAccount:save',{'UserId':Number(_0x128022[_0x1a06('0x5f')][_0x1a06('0x6f')][_0xd3173c]),'FaxAccountId':Number(_0x128022[_0x1a06('0x66')]['id'])});}return _0x1470b4;});}})[_0x1a06('0x1f')](respondWithResult(_0x5aa0bd,null))[_0x1a06('0x29')](handleError(_0x5aa0bd,null));};exports[_0x1a06('0xc1')]=function(_0x365ed8,_0x4ca222,_0x6377b9){return db['FaxAccount'][_0x1a06('0x5d')]({'where':{'id':_0x365ed8[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x4ca222,null))[_0x1a06('0x1f')](function(_0x4ce2fa){if(_0x4ce2fa){return _0x4ce2fa[_0x1a06('0xc1')](_0x365ed8[_0x1a06('0x45')][_0x1a06('0x6f')])[_0x1a06('0x1f')](function(){if(_[_0x1a06('0xc2')](_0x365ed8[_0x1a06('0x45')][_0x1a06('0x6f')])){for(var _0xc7bb01=0x0;_0xc7bb01<_0x365ed8[_0x1a06('0x45')][_0x1a06('0x6f')]['length'];_0xc7bb01+=0x1){socket[_0x1a06('0xc0')](_0x1a06('0xc3'),{'UserId':Number(_0x365ed8[_0x1a06('0x45')][_0x1a06('0x6f')][_0xc7bb01]),'FaxAccountId':Number(_0x365ed8[_0x1a06('0x66')]['id'])});}}else{socket[_0x1a06('0xc0')]('userFaxAccount:remove',{'UserId':Number(_0x365ed8[_0x1a06('0x45')]['ids']),'FaxAccountId':Number(_0x365ed8[_0x1a06('0x66')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ca222,null))[_0x1a06('0x29')](handleError(_0x4ca222,null));};exports[_0x1a06('0xc4')]=function(_0x518861,_0x44562c,_0x364b66){var _0x2414d2={};var _0x395c95={};var _0x1dab1c;var _0x341be7;return db[_0x1a06('0x56')]['findOne']({'where':{'id':_0x518861[_0x1a06('0x66')]['id']}})[_0x1a06('0x1f')](handleEntityNotFound(_0x44562c,null))[_0x1a06('0x1f')](function(_0x186ec9){if(_0x186ec9){_0x1dab1c=_0x186ec9;_0x395c95[_0x1a06('0x49')]=_[_0x1a06('0x46')](db[_0x1a06('0x78')][_0x1a06('0x41')]);_0x395c95[_0x1a06('0x45')]=_[_0x1a06('0x46')](_0x518861[_0x1a06('0x45')]);_0x395c95['filters']=_[_0x1a06('0x48')](_0x395c95[_0x1a06('0x49')],_0x395c95[_0x1a06('0x45')]);_0x2414d2['attributes']=_[_0x1a06('0x48')](_0x395c95[_0x1a06('0x49')],qs['fields'](_0x518861[_0x1a06('0x45')]['fields']));_0x2414d2[_0x1a06('0x4a')]=_0x2414d2['attributes']['length']?_0x2414d2[_0x1a06('0x4a')]:_0x395c95['model'];_0x2414d2[_0x1a06('0x4f')]=qs[_0x1a06('0x6d')](_0x518861['query'][_0x1a06('0x6d')]);_0x2414d2[_0x1a06('0x52')]=qs[_0x1a06('0x47')](_[_0x1a06('0x50')](_0x518861[_0x1a06('0x45')],_0x395c95[_0x1a06('0x47')]));if(_0x518861[_0x1a06('0x45')][_0x1a06('0x51')]){_0x2414d2[_0x1a06('0x52')]=_[_0x1a06('0x53')](_0x2414d2[_0x1a06('0x52')],{'$or':_['map'](_0x2414d2['attributes'],function(_0x25f34f){var _0x5b5f36={};_0x5b5f36[_0x25f34f]={'$like':'%'+_0x518861[_0x1a06('0x45')][_0x1a06('0x51')]+'%'};return _0x5b5f36;})});}_0x2414d2=_['merge']({},_0x2414d2,_0x518861[_0x1a06('0x55')]);return _0x1dab1c[_0x1a06('0xc4')](_0x2414d2);}})['then'](function(_0xd4cf39){if(_0xd4cf39){_0x341be7=_0xd4cf39[_0x1a06('0x4c')];if(!_0x518861['query']['hasOwnProperty'](_0x1a06('0x4e'))){_0x2414d2[_0x1a06('0x31')]=qs[_0x1a06('0x31')](_0x518861[_0x1a06('0x45')][_0x1a06('0x31')]);_0x2414d2['offset']=qs['offset'](_0x518861['query'][_0x1a06('0x2e')]);}return _0x1dab1c[_0x1a06('0xc4')](_0x2414d2);}})['then'](function(_0x4ecd26){if(_0x4ecd26){return _0x4ecd26?{'count':_0x341be7,'rows':_0x4ecd26}:null;}})[_0x1a06('0x1f')](respondWithResult(_0x44562c,null))['catch'](handleError(_0x44562c,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa88b=['hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x256e40,_0x6e651d){var _0x15a4a6=function(_0x1c8bbf){while(--_0x1c8bbf){_0x256e40['push'](_0x256e40['shift']());}};_0x15a4a6(++_0x6e651d);}(_0xa88b,0x133));var _0xba88=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0xa88b[_0x3e21f4];return _0x40fc49;};'use strict';var EventEmitter=require(_0xba88('0x0'));var FaxAccount=require(_0xba88('0x1'))['db'][_0xba88('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xba88('0x3')](0x0);var events={'afterCreate':_0xba88('0x4'),'afterUpdate':_0xba88('0x5'),'afterDestroy':'remove'};function emitEvent(_0x299ee7){return function(_0x4ccd49,_0x58ae2b,_0x2bc008){FaxAccountEvents['emit'](_0x299ee7+':'+_0x4ccd49['id'],_0x4ccd49);FaxAccountEvents[_0xba88('0x6')](_0x299ee7,_0x4ccd49);_0x2bc008(null);};}for(var e in events){if(events[_0xba88('0x7')](e)){var event=events[e];FaxAccount[_0xba88('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x4a95=['exports','../../mysqldb','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xe69eac,_0x3534f7){var _0x3751ad=function(_0x5f350d){while(--_0x5f350d){_0xe69eac['push'](_0xe69eac['shift']());}};_0x3751ad(++_0x3534f7);}(_0x4a95,0x91));var _0x54a9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4a95[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x54a9('0x0'))['db'][_0x54a9('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x54a9('0x2')](0x0);var events={'afterCreate':_0x54a9('0x3'),'afterUpdate':'update','afterDestroy':_0x54a9('0x4')};function emitEvent(_0x257a8f){return function(_0x2faee1,_0x4ab40a,_0x495a7c){FaxAccountEvents['emit'](_0x257a8f+':'+_0x2faee1['id'],_0x2faee1);FaxAccountEvents[_0x54a9('0x5')](_0x257a8f,_0x2faee1);_0x495a7c(null);};}for(var e in events){if(events[_0x54a9('0x6')](e)){var event=events[e];FaxAccount[_0x54a9('0x7')](e,emitEvent(event));}}module[_0x54a9('0x8')]=FaxAccountEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4038=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4d2ed7,_0x1999e5){var _0x12af27=function(_0x28e2d4){while(--_0x28e2d4){_0x4d2ed7['push'](_0x4d2ed7['shift']());}};_0x12af27(++_0x1999e5);}(_0x4038,0x1a8));var _0x8403=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x4038[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0x8403('0x0'));var util=require(_0x8403('0x1'));var logger=require(_0x8403('0x2'))('api');var moment=require(_0x8403('0x3'));var BPromise=require(_0x8403('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8403('0x5'));var rimraf=require(_0x8403('0x6'));var config=require(_0x8403('0x7'));var attributes=require('./faxAccount.attributes');module[_0x8403('0x8')]=function(_0x3435d1,_0x353d3a){return _0x3435d1[_0x8403('0x9')](_0x8403('0xa'),attributes,{'tableName':_0x8403('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8269=['api','bluebird','request-promise','path','rimraf','exports','FaxAccount','lodash','util','../../config/logger'];(function(_0x28b97f,_0x2e82a1){var _0x3a4513=function(_0x40a3a5){while(--_0x40a3a5){_0x28b97f['push'](_0x28b97f['shift']());}};_0x3a4513(++_0x2e82a1);}(_0x8269,0xed));var _0x9826=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x8269[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x9826('0x0'));var util=require(_0x9826('0x1'));var logger=require(_0x9826('0x2'))(_0x9826('0x3'));var moment=require('moment');var BPromise=require(_0x9826('0x4'));var rp=require(_0x9826('0x5'));var fs=require('fs');var path=require(_0x9826('0x6'));var rimraf=require(_0x9826('0x7'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x9826('0x8')]=function(_0x576dec,_0x144a5a){return _0x576dec['define'](_0x9826('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c45=['unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','agent','queueId','FaxQueue','name','unshift','queue','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','attributes','map','model','NotifyFaxAccount','body','CmContact','describe','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','list','applications','orderBy','priority','asc','length','from','create','contact','fax','FaxInteraction','autoclose'];(function(_0x2023e1,_0xeca985){var _0x1fe133=function(_0x526d5f){while(--_0x526d5f){_0x2023e1['push'](_0x2023e1['shift']());}};_0x1fe133(++_0xeca985);}(_0x9c45,0x1c6));var _0x59c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x59c4('0x0'));var util=require(_0x59c4('0x1'));var moment=require('moment');var BPromise=require(_0x59c4('0x2'));var rs=require(_0x59c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x59c4('0x4'));var logger=require(_0x59c4('0x5'))('rpc');var config=require(_0x59c4('0x6'));var jayson=require(_0x59c4('0x7'));var client=jayson[_0x59c4('0x8')]['http']({'port':0x232c});config[_0x59c4('0x9')]=_[_0x59c4('0xa')](config[_0x59c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x59c4('0xb'))(new Redis(config[_0x59c4('0x9')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x9a45fc,_0x431913,_0x33af0f){return new BPromise(function(_0x31fc2b,_0x530bcd){return client[_0x59c4('0xc')](_0x9a45fc,_0x33af0f)['then'](function(_0x1d677c){logger[_0x59c4('0xd')](_0x59c4('0xe'),_0x431913,_0x59c4('0xf'));logger[_0x59c4('0x10')](_0x59c4('0x11'),_0x431913,_0x59c4('0xf'),JSON[_0x59c4('0x12')](_0x1d677c));if(_0x1d677c[_0x59c4('0x13')]){if(_0x1d677c[_0x59c4('0x13')][_0x59c4('0x14')]===0x1f4){logger[_0x59c4('0x13')](_0x59c4('0xe'),_0x431913,_0x1d677c['error'][_0x59c4('0x15')]);return _0x530bcd(_0x1d677c[_0x59c4('0x13')][_0x59c4('0x15')]);}logger[_0x59c4('0x13')](_0x59c4('0xe'),_0x431913,_0x1d677c[_0x59c4('0x13')][_0x59c4('0x15')]);return _0x31fc2b(_0x1d677c[_0x59c4('0x13')][_0x59c4('0x15')]);}else{logger[_0x59c4('0xd')](_0x59c4('0xe'),_0x431913,'request\x20sent');_0x31fc2b(_0x1d677c[_0x59c4('0x16')][_0x59c4('0x15')]);}})[_0x59c4('0x17')](function(_0x52015f){logger[_0x59c4('0x13')](_0x59c4('0xe'),_0x431913,_0x52015f);_0x530bcd(_0x52015f);});});}exports[_0x59c4('0x18')]=function(_0x171d8a){var _0x2a6923=this;return new Promise(function(_0x5e3599,_0x1c5b5f){return db[_0x59c4('0x19')]['findAll']({'raw':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1b')]===undefined?!![]:![]:!![],'where':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1c')]||null:null,'attributes':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')]['attributes']||null:null,'limit':_0x171d8a[_0x59c4('0x1a')]?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1d')]||null:null,'include':_0x171d8a['options']?_0x171d8a[_0x59c4('0x1a')][_0x59c4('0x1e')]?_['map'](_0x171d8a['options'][_0x59c4('0x1e')],function(_0x306a6a){return{'model':db[_0x306a6a['model']],'as':_0x306a6a['as'],'attributes':_0x306a6a[_0x59c4('0x1f')],'include':_0x306a6a[_0x59c4('0x1e')]?_['map'](_0x306a6a[_0x59c4('0x1e')],function(_0x13229f){return{'model':db[_0x13229f['model']],'as':_0x13229f['as'],'attributes':_0x13229f[_0x59c4('0x1f')],'include':_0x13229f[_0x59c4('0x1e')]?_[_0x59c4('0x20')](_0x13229f[_0x59c4('0x1e')],function(_0x30cd94){return{'model':db[_0x30cd94[_0x59c4('0x21')]],'as':_0x30cd94['as'],'attributes':_0x30cd94[_0x59c4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d45aa){logger[_0x59c4('0xd')](_0x59c4('0x18'),_0x171d8a);logger['debug'](_0x59c4('0x18'),_0x171d8a,JSON[_0x59c4('0x12')](_0x4d45aa));_0x5e3599(_0x4d45aa);})[_0x59c4('0x17')](function(_0x51b3d7){logger['error'](_0x59c4('0x18'),_0x51b3d7['message'],_0x171d8a);_0x1c5b5f(_0x2a6923['error'](0x1f4,_0x51b3d7['message']));});});};exports[_0x59c4('0x22')]=function(_0x4ab591,_0x902a64,_0x32f13e){var _0x1d8d67=this;return new Promise(function(_0x53f3fd,_0x3fdeee){var _0x4c9ab9={'body':_0x4ab591[_0x59c4('0x23')],'channel':'fax'};var _0x45b1ee=[];var _0x21b1e2=[];var _0x5cb914={};return db[_0x59c4('0x24')][_0x59c4('0x25')]()[_0x59c4('0x26')](function(_0x412c3f){if(!_0x412c3f){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x29'));}_0x45b1ee=_[_0x59c4('0x2a')](_[_0x59c4('0x2b')](_0x412c3f),[_0x59c4('0x2c'),_0x59c4('0x2d')]);_0x21b1e2=_[_0x59c4('0x2a')](_[_0x59c4('0x2b')](_0x412c3f),[_0x59c4('0x2c'),_0x59c4('0x2d'),_0x59c4('0x2e'),'ListId']);if(_0x4ab591[_0x59c4('0x23')]['id']){delete _0x4ab591['body']['id'];}if(_[_0x59c4('0x2f')](_0x4ab591[_0x59c4('0x23')]['from'])){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x30'));}if(_[_0x59c4('0x2f')](_0x4ab591[_0x59c4('0x23')][_0x59c4('0x23')])||_0x4ab591[_0x59c4('0x23')][_0x59c4('0x23')]===''){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x59c4('0x2f')](_0x4ab591['body']['mapKey'])){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x31')+_0x21b1e2);}if(!_[_0x59c4('0x32')](_0x21b1e2,_0x4ab591[_0x59c4('0x23')][_0x59c4('0x33')])){throw new db[(_0x59c4('0x27'))][(_0x59c4('0x28'))](_0x59c4('0x34')+_0x21b1e2);}_0x5cb914[_0x4ab591[_0x59c4('0x23')]['mapKey']]=_0x4ab591[_0x59c4('0x23')]['from'];})[_0x59c4('0x26')](function(){return db[_0x59c4('0x19')][_0x59c4('0x35')]({'where':{'id':_0x4ab591[_0x59c4('0x36')]['id']},'include':[{'model':db[_0x59c4('0x37')],'as':'List','include':[{'model':db[_0x59c4('0x24')],'as':_0x59c4('0x38'),'where':_0x5cb914,'limit':0x1,'order':[[_0x59c4('0x2d'),_0x59c4('0x39')]]}]},{'model':db[_0x59c4('0x3a')],'as':_0x59c4('0x3b')}]});})[_0x59c4('0x26')](function(_0x7018b5){if(_0x7018b5&&_0x7018b5[_0x59c4('0x3c')]){var _0x42cc2e=_0x7018b5[_0x59c4('0x3d')]({'plain':!![]});_0x4c9ab9[_0x59c4('0x36')]=_0x42cc2e;_0x4c9ab9['applications']=_0x42cc2e[_0x59c4('0x3b')];_0x4c9ab9[_0x59c4('0x3e')]=_0x42cc2e[_0x59c4('0x3c')];_0x4c9ab9[_0x59c4('0x3f')]=_[_0x59c4('0x40')](_0x4c9ab9['applications'],[_0x59c4('0x41')],[_0x59c4('0x42')]);if(_0x4c9ab9['account'][_0x59c4('0x3b')]){delete _0x4c9ab9[_0x59c4('0x36')][_0x59c4('0x3b')];}if(_0x4c9ab9[_0x59c4('0x36')][_0x59c4('0x3c')]&&_0x4c9ab9[_0x59c4('0x36')]['List'][_0x59c4('0x38')][_0x59c4('0x43')]){return _0x4c9ab9['account'][_0x59c4('0x3c')][_0x59c4('0x38')][0x0];}var _0x8c4c34=_[_0x59c4('0xa')](_0x4ab591['body'],{'firstName':_0x4ab591[_0x59c4('0x23')]['from'],'ListId':_0x42cc2e['ListId']});_0x8c4c34[_0x4ab591[_0x59c4('0x23')][_0x59c4('0x33')]]=_0x4ab591[_0x59c4('0x23')][_0x59c4('0x44')];return db[_0x59c4('0x24')][_0x59c4('0x45')](_0x8c4c34,{'fields':_0x45b1ee,'raw':!![]});}})[_0x59c4('0x26')](function(_0x112a5f){_0x4c9ab9[_0x59c4('0x46')]=_0x112a5f;if(_0x112a5f){var _0x324494={'ContactId':_0x112a5f['id'],'FaxAccountId':_0x4ab591[_0x59c4('0x36')]['id'],'fax':_0x112a5f[_0x59c4('0x47')]};return db[_0x59c4('0x48')][_0x59c4('0x35')]({'where':{'ContactId':_0x112a5f['id'],'closed':![],'FaxAccountId':_0x4ab591[_0x59c4('0x36')]['id']}})[_0x59c4('0x26')](function(_0x443ac3){if(_0x443ac3){return[_0x443ac3,![]];}return db[_0x59c4('0x48')][_0x59c4('0x45')](_0x324494)[_0x59c4('0x26')](function(_0x47f542){return[_0x47f542,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x87d9cd,_0x1caf9d){var _0x4cb23d=_0x87d9cd[_0x59c4('0x3d')]({'plain':!![]});if(_0x1caf9d){if(_0x4c9ab9[_0x59c4('0x36')][_0x59c4('0x49')]){_0x4c9ab9['applications']['push']({'id':0x0,'priority':_0x4c9ab9[_0x59c4('0x3f')][_0x59c4('0x43')]+0x1,'app':'close','appdata':_0x59c4('0x4a'),'interval':_0x59c4('0x4b')});}_0x4cb23d[_0x59c4('0x4c')]=!![];}else{_0x4cb23d[_0x59c4('0x4c')]=![];}_0x4c9ab9[_0x59c4('0x4d')]=_0x4cb23d;return db[_0x59c4('0x4e')]['create']({'body':_0x4ab591[_0x59c4('0x23')][_0x59c4('0x23')],'FaxAccountId':_0x4ab591[_0x59c4('0x36')]['id'],'FaxInteractionId':_0x87d9cd['id'],'direction':'in','ContactId':_0x87d9cd['ContactId'],'AttachmentId':_0x4ab591[_0x59c4('0x23')][_0x59c4('0x4f')]});})['then'](function(_0x3b5c40){_0x4c9ab9[_0x59c4('0x15')]=_0x3b5c40;if(!_0x4c9ab9[_0x59c4('0x4d')][_0x59c4('0x50')])return;return db[_0x59c4('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x4c9ab9[_0x59c4('0x4d')]['UserId']}});})['then'](function(_0x20582c){if(_0x20582c){_0x4c9ab9[_0x59c4('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x59c4('0x52'),'appdata':_0x20582c['name']+','+(_0x4c9ab9[_0x59c4('0x36')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x4c9ab9[_0x59c4('0x4d')][_0x59c4('0x53')])return;return db[_0x59c4('0x54')][_0x59c4('0x35')]({'attributes':['id',_0x59c4('0x55')],'where':{'id':_0x4c9ab9[_0x59c4('0x4d')][_0x59c4('0x53')]}});})[_0x59c4('0x26')](function(_0x4e95b1){if(_0x4e95b1){_0x4c9ab9[_0x59c4('0x3f')][_0x59c4('0x56')]({'id':0x0,'priority':0x1,'app':_0x59c4('0x57'),'appdata':_0x4e95b1['name']+','+(_0x4c9ab9['account']['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x4c9ab9);})[_0x59c4('0x26')](function(_0x1695b4){_0x53f3fd(_0x1695b4);})['catch'](function(_0x3338bb){_0x3fdeee(_0x1d8d67[_0x59c4('0x13')](0x1f4,_0x3338bb[_0x59c4('0x15')]));});});};
\ No newline at end of file
+var _0xcc71=['CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','list','priority','asc','length','create','FaxInteraction','spread','get','close','unmanaged','*,*,*,*','FaxMessage','interaction','name','UserId','waitForTheAssignedAgent','FaxQueue','queueId','unshift','queue','Start','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','attributes','limit','include','map','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcc71,0x11a));var _0x1cc7=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xcc71[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require(_0x1cc7('0x0'));var moment=require('moment');var BPromise=require(_0x1cc7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cc7('0x2'));var db=require(_0x1cc7('0x3'))['db'];var utils=require(_0x1cc7('0x4'));var logger=require(_0x1cc7('0x5'))(_0x1cc7('0x6'));var config=require('../../config/environment');var jayson=require(_0x1cc7('0x7'));var client=jayson['client'][_0x1cc7('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0x1cc7('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cc7('0x9')]));require('./faxAccount.socket')[_0x1cc7('0xa')](socket);function respondWithRpcPromise(_0x5c76aa,_0x42f5f9,_0x340de9){return new BPromise(function(_0x4844ac,_0x3b45c1){return client['request'](_0x5c76aa,_0x340de9)[_0x1cc7('0xb')](function(_0x2841c3){logger[_0x1cc7('0xc')](_0x1cc7('0xd'),_0x42f5f9,_0x1cc7('0xe'));logger['debug'](_0x1cc7('0xf'),_0x42f5f9,'request\x20sent',JSON[_0x1cc7('0x10')](_0x2841c3));if(_0x2841c3[_0x1cc7('0x11')]){if(_0x2841c3[_0x1cc7('0x11')][_0x1cc7('0x12')]===0x1f4){logger[_0x1cc7('0x11')](_0x1cc7('0xd'),_0x42f5f9,_0x2841c3[_0x1cc7('0x11')][_0x1cc7('0x13')]);return _0x3b45c1(_0x2841c3['error'][_0x1cc7('0x13')]);}logger[_0x1cc7('0x11')](_0x1cc7('0xd'),_0x42f5f9,_0x2841c3[_0x1cc7('0x11')]['message']);return _0x4844ac(_0x2841c3[_0x1cc7('0x11')][_0x1cc7('0x13')]);}else{logger[_0x1cc7('0xc')](_0x1cc7('0xd'),_0x42f5f9,_0x1cc7('0xe'));_0x4844ac(_0x2841c3[_0x1cc7('0x14')]['message']);}})[_0x1cc7('0x15')](function(_0x26f7c5){logger[_0x1cc7('0x11')]('FaxAccount,\x20%s,\x20%s',_0x42f5f9,_0x26f7c5);_0x3b45c1(_0x26f7c5);});});}exports[_0x1cc7('0x16')]=function(_0x12ccdb){var _0x497568=this;return new Promise(function(_0x5c7be2,_0x555753){return db[_0x1cc7('0x17')]['findAll']({'raw':_0x12ccdb[_0x1cc7('0x18')]?_0x12ccdb[_0x1cc7('0x18')][_0x1cc7('0x19')]===undefined?!![]:![]:!![],'where':_0x12ccdb['options']?_0x12ccdb[_0x1cc7('0x18')]['where']||null:null,'attributes':_0x12ccdb[_0x1cc7('0x18')]?_0x12ccdb['options'][_0x1cc7('0x1a')]||null:null,'limit':_0x12ccdb['options']?_0x12ccdb[_0x1cc7('0x18')][_0x1cc7('0x1b')]||null:null,'include':_0x12ccdb['options']?_0x12ccdb[_0x1cc7('0x18')][_0x1cc7('0x1c')]?_[_0x1cc7('0x1d')](_0x12ccdb[_0x1cc7('0x18')][_0x1cc7('0x1c')],function(_0x12f824){return{'model':db[_0x12f824['model']],'as':_0x12f824['as'],'attributes':_0x12f824[_0x1cc7('0x1a')],'include':_0x12f824[_0x1cc7('0x1c')]?_['map'](_0x12f824[_0x1cc7('0x1c')],function(_0x19f82b){return{'model':db[_0x19f82b['model']],'as':_0x19f82b['as'],'attributes':_0x19f82b[_0x1cc7('0x1a')],'include':_0x19f82b[_0x1cc7('0x1c')]?_['map'](_0x19f82b[_0x1cc7('0x1c')],function(_0x38f3a4){return{'model':db[_0x38f3a4['model']],'as':_0x38f3a4['as'],'attributes':_0x38f3a4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1cc7('0xb')](function(_0xbe5c8a){logger[_0x1cc7('0xc')]('GetFaxAccount',_0x12ccdb);logger['debug'](_0x1cc7('0x16'),_0x12ccdb,JSON[_0x1cc7('0x10')](_0xbe5c8a));_0x5c7be2(_0xbe5c8a);})[_0x1cc7('0x15')](function(_0x10df3d){logger[_0x1cc7('0x11')](_0x1cc7('0x16'),_0x10df3d[_0x1cc7('0x13')],_0x12ccdb);_0x555753(_0x497568[_0x1cc7('0x11')](0x1f4,_0x10df3d[_0x1cc7('0x13')]));});});};exports[_0x1cc7('0x1e')]=function(_0x8cc3dc,_0x1481ec,_0x290807){var _0xe973f5=this;return new Promise(function(_0x564001,_0xde1ad6){var _0x316508={'body':_0x8cc3dc[_0x1cc7('0x1f')],'channel':_0x1cc7('0x20')};var _0x13eb8f=[];var _0x29f835=[];var _0x2ed7df={};return db[_0x1cc7('0x21')][_0x1cc7('0x22')]()['then'](function(_0xa9eb90){if(!_0xa9eb90){throw new db[(_0x1cc7('0x23'))][(_0x1cc7('0x24'))](_0x1cc7('0x25'));}_0x13eb8f=_[_0x1cc7('0x26')](_['keys'](_0xa9eb90),[_0x1cc7('0x27'),_0x1cc7('0x28')]);_0x29f835=_[_0x1cc7('0x26')](_[_0x1cc7('0x29')](_0xa9eb90),[_0x1cc7('0x27'),'updatedAt',_0x1cc7('0x2a'),_0x1cc7('0x2b')]);if(_0x8cc3dc[_0x1cc7('0x1f')]['id']){delete _0x8cc3dc[_0x1cc7('0x1f')]['id'];}if(_[_0x1cc7('0x2c')](_0x8cc3dc[_0x1cc7('0x1f')]['from'])){throw new db[(_0x1cc7('0x23'))][(_0x1cc7('0x24'))](_0x1cc7('0x2d'));}if(_[_0x1cc7('0x2c')](_0x8cc3dc[_0x1cc7('0x1f')][_0x1cc7('0x1f')])||_0x8cc3dc['body']['body']===''){throw new db[(_0x1cc7('0x23'))]['ValidationError'](_0x1cc7('0x2e'));}if(_[_0x1cc7('0x2c')](_0x8cc3dc[_0x1cc7('0x1f')][_0x1cc7('0x2f')])){throw new db['Sequelize'][(_0x1cc7('0x24'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x29f835);}if(!_[_0x1cc7('0x30')](_0x29f835,_0x8cc3dc[_0x1cc7('0x1f')]['mapKey'])){throw new db[(_0x1cc7('0x23'))][(_0x1cc7('0x24'))](_0x1cc7('0x31')+_0x29f835);}_0x2ed7df[_0x8cc3dc['body'][_0x1cc7('0x2f')]]=_0x8cc3dc[_0x1cc7('0x1f')][_0x1cc7('0x32')];})[_0x1cc7('0xb')](function(){return db[_0x1cc7('0x17')][_0x1cc7('0x33')]({'where':{'id':_0x8cc3dc[_0x1cc7('0x34')]['id']},'include':[{'model':db[_0x1cc7('0x35')],'as':_0x1cc7('0x36'),'include':[{'model':db[_0x1cc7('0x21')],'as':_0x1cc7('0x37'),'where':_0x2ed7df,'limit':0x1,'order':[[_0x1cc7('0x28'),_0x1cc7('0x38')]]}]},{'model':db[_0x1cc7('0x39')],'as':_0x1cc7('0x3a')}]});})['then'](function(_0x1a8700){if(_0x1a8700&&_0x1a8700[_0x1cc7('0x36')]){var _0x1f5625=_0x1a8700['get']({'plain':!![]});_0x316508[_0x1cc7('0x34')]=_0x1f5625;_0x316508[_0x1cc7('0x3b')]=_0x1f5625['Applications'];_0x316508[_0x1cc7('0x3c')]=_0x1f5625[_0x1cc7('0x36')];_0x316508[_0x1cc7('0x3b')]=_['orderBy'](_0x316508[_0x1cc7('0x3b')],[_0x1cc7('0x3d')],[_0x1cc7('0x3e')]);if(_0x316508[_0x1cc7('0x34')][_0x1cc7('0x3a')]){delete _0x316508['account'][_0x1cc7('0x3a')];}if(_0x316508[_0x1cc7('0x34')][_0x1cc7('0x36')]&&_0x316508[_0x1cc7('0x34')]['List'][_0x1cc7('0x37')][_0x1cc7('0x3f')]){return _0x316508['account'][_0x1cc7('0x36')][_0x1cc7('0x37')][0x0];}var _0x489051=_['defaults'](_0x8cc3dc[_0x1cc7('0x1f')],{'firstName':_0x8cc3dc['body']['from'],'ListId':_0x1f5625['ListId']});_0x489051[_0x8cc3dc[_0x1cc7('0x1f')][_0x1cc7('0x2f')]]=_0x8cc3dc[_0x1cc7('0x1f')][_0x1cc7('0x32')];return db['CmContact'][_0x1cc7('0x40')](_0x489051,{'fields':_0x13eb8f,'raw':!![]});}})['then'](function(_0x67e024){_0x316508['contact']=_0x67e024;if(_0x67e024){var _0x1d5bfa={'ContactId':_0x67e024['id'],'FaxAccountId':_0x8cc3dc['account']['id'],'fax':_0x67e024['fax']};return db[_0x1cc7('0x41')]['find']({'where':{'ContactId':_0x67e024['id'],'closed':![],'FaxAccountId':_0x8cc3dc[_0x1cc7('0x34')]['id']}})['then'](function(_0x23eb69){if(_0x23eb69){return[_0x23eb69,![]];}return db[_0x1cc7('0x41')][_0x1cc7('0x40')](_0x1d5bfa)[_0x1cc7('0xb')](function(_0x159dba){return[_0x159dba,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1cc7('0x42')](function(_0x12b631,_0x2d0bbc){var _0x2e5c40=_0x12b631[_0x1cc7('0x43')]({'plain':!![]});if(_0x2d0bbc){if(_0x316508[_0x1cc7('0x34')]['autoclose']){_0x316508[_0x1cc7('0x3b')]['push']({'id':0x0,'priority':_0x316508[_0x1cc7('0x3b')]['length']+0x1,'app':_0x1cc7('0x44'),'appdata':_0x1cc7('0x45'),'interval':_0x1cc7('0x46')});}_0x2e5c40['created']=!![];}else{_0x2e5c40['created']=![];}_0x316508['interaction']=_0x2e5c40;return db[_0x1cc7('0x47')]['create']({'body':_0x8cc3dc[_0x1cc7('0x1f')][_0x1cc7('0x1f')],'FaxAccountId':_0x8cc3dc['account']['id'],'FaxInteractionId':_0x12b631['id'],'direction':'in','ContactId':_0x12b631['ContactId'],'AttachmentId':_0x8cc3dc[_0x1cc7('0x1f')]['AttachmentId']});})[_0x1cc7('0xb')](function(_0x3e5501){_0x316508[_0x1cc7('0x13')]=_0x3e5501;if(!_0x316508[_0x1cc7('0x48')]['UserId'])return;return db['User'][_0x1cc7('0x33')]({'attributes':['id',_0x1cc7('0x49')],'where':{'id':_0x316508[_0x1cc7('0x48')][_0x1cc7('0x4a')]}});})[_0x1cc7('0xb')](function(_0x5bb67e){if(_0x5bb67e){_0x316508[_0x1cc7('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5bb67e['name']+','+(_0x316508['account'][_0x1cc7('0x4b')]||0xa),'interval':_0x1cc7('0x46')});}if(!_0x316508[_0x1cc7('0x48')]['queueId'])return;return db[_0x1cc7('0x4c')][_0x1cc7('0x33')]({'attributes':['id','name'],'where':{'id':_0x316508[_0x1cc7('0x48')][_0x1cc7('0x4d')]}});})['then'](function(_0x5811a9){if(_0x5811a9){_0x316508['applications'][_0x1cc7('0x4e')]({'id':0x0,'priority':0x1,'app':_0x1cc7('0x4f'),'appdata':_0x5811a9[_0x1cc7('0x49')]+','+(_0x316508['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x1cc7('0x46')});}return respondWithRpcPromise(_0x1cc7('0x50'),'startRouting',_0x316508);})[_0x1cc7('0xb')](function(_0x399618){_0x564001(_0x399618);})[_0x1cc7('0x15')](function(_0x49de0b){_0xde1ad6(_0xe973f5[_0x1cc7('0x11')](0x1f4,_0x49de0b[_0x1cc7('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83cd=['save','remove','update','removeListener','length','faxAccount:','./faxAccount.events'];(function(_0x478bf5,_0x40ec46){var _0x243c14=function(_0x46d305){while(--_0x46d305){_0x478bf5['push'](_0x478bf5['shift']());}};_0x243c14(++_0x40ec46);}(_0x83cd,0x6f));var _0xd83c=function(_0x1a5182,_0x25b2dd){_0x1a5182=_0x1a5182-0x0;var _0x37d275=_0x83cd[_0x1a5182];return _0x37d275;};'use strict';var FaxAccountEvents=require(_0xd83c('0x0'));var events=[_0xd83c('0x1'),_0xd83c('0x2'),_0xd83c('0x3')];function createListener(_0x310e25,_0x552584){return function(_0x5f1ea6){_0x552584['emit'](_0x310e25,_0x5f1ea6);};}function removeListener(_0x5857fe,_0x10cb85){return function(){FaxAccountEvents[_0xd83c('0x4')](_0x5857fe,_0x10cb85);};}exports['register']=function(_0x5c1658){for(var _0x3c752d=0x0,_0x3d3e1b=events[_0xd83c('0x5')];_0x3c752d<_0x3d3e1b;_0x3c752d++){var _0x5af261=events[_0x3c752d];var _0x4d652c=createListener(_0xd83c('0x6')+_0x5af261,_0x5c1658);FaxAccountEvents['on'](_0x5af261,_0x4d652c);}};
\ No newline at end of file
+var _0x4155=['emit','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0xe955fe,_0x33379c){var _0x5f3210=function(_0x4a0830){while(--_0x4a0830){_0xe955fe['push'](_0xe955fe['shift']());}};_0x5f3210(++_0x33379c);}(_0x4155,0x19c));var _0x5415=function(_0x581acd,_0xe95057){_0x581acd=_0x581acd-0x0;var _0x4e686c=_0x4155[_0x581acd];return _0x4e686c;};'use strict';var FaxAccountEvents=require(_0x5415('0x0'));var events=[_0x5415('0x1'),_0x5415('0x2'),_0x5415('0x3')];function createListener(_0x37e70d,_0x4f0392){return function(_0x57a987){_0x4f0392[_0x5415('0x4')](_0x37e70d,_0x57a987);};}function removeListener(_0x3990f1,_0x2d6d79){return function(){FaxAccountEvents['removeListener'](_0x3990f1,_0x2d6d79);};}exports[_0x5415('0x5')]=function(_0x42ac9d){for(var _0x724da6=0x0,_0x3e2d60=events[_0x5415('0x6')];_0x724da6<_0x3e2d60;_0x724da6++){var _0x2df3cb=events[_0x724da6];var _0x447b1f=createListener(_0x5415('0x7')+_0x2df3cb,_0x42ac9d);FaxAccountEvents['on'](_0x2df3cb,_0x447b1f);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x74fa=['create','post','addDisposition','addAnswer','/:id/interactions','addInteraction','/:id/applications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/messages','getMessages','/:id/users','getAgents'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x74fa,0x6e));var _0xa74f=function(_0x347c98,_0x19aefa){_0x347c98=_0x347c98-0x0;var _0x315569=_0x74fa[_0x347c98];return _0x315569;};'use strict';var multer=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var path=require(_0xa74f('0x2'));var timeout=require(_0xa74f('0x3'));var express=require(_0xa74f('0x4'));var router=express[_0xa74f('0x5')]();var fs_extra=require(_0xa74f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa74f('0x7'));var config=require(_0xa74f('0x8'));var controller=require(_0xa74f('0x9'));router[_0xa74f('0xa')]('/',auth[_0xa74f('0xb')](),controller['index']);router[_0xa74f('0xa')](_0xa74f('0xc'),auth[_0xa74f('0xb')](),controller[_0xa74f('0xd')]);router['get'](_0xa74f('0xe'),auth[_0xa74f('0xb')](),controller[_0xa74f('0xf')]);router[_0xa74f('0xa')](_0xa74f('0x10'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x11')]);router[_0xa74f('0xa')](_0xa74f('0x12'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x13')]);router['get']('/:id/interactions',auth[_0xa74f('0xb')](),controller['getInteractions']);router[_0xa74f('0xa')]('/:id/applications',auth[_0xa74f('0xb')](),controller[_0xa74f('0x14')]);router[_0xa74f('0xa')](_0xa74f('0x15'),auth['isAuthenticated'](),controller[_0xa74f('0x16')]);router['get'](_0xa74f('0x17'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x18')]);router['post']('/',auth[_0xa74f('0xb')](),controller[_0xa74f('0x19')]);router[_0xa74f('0x1a')](_0xa74f('0x10'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x1b')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa74f('0x1c')]);router[_0xa74f('0x1a')](_0xa74f('0x1d'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x1e')]);router[_0xa74f('0x1a')](_0xa74f('0x1f'),auth[_0xa74f('0xb')](),controller['addApplications']);router[_0xa74f('0x1a')](_0xa74f('0x20'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x21')]);router['post'](_0xa74f('0x22'),auth['isAuthenticated'](),controller[_0xa74f('0x23')]);router['post'](_0xa74f('0x24'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x25')]);router['post'](_0xa74f('0x17'),auth['isAuthenticated'](),controller[_0xa74f('0x26')]);router['put'](_0xa74f('0xe'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x27')]);router[_0xa74f('0x28')](_0xa74f('0xe'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x29')]);router[_0xa74f('0x28')](_0xa74f('0x10'),auth['isAuthenticated'](),controller[_0xa74f('0x2a')]);router[_0xa74f('0x28')](_0xa74f('0x12'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x2b')]);router['delete'](_0xa74f('0x17'),auth[_0xa74f('0xb')](),controller[_0xa74f('0x2c')]);module['exports']=router;
\ No newline at end of file
+var _0x0e33=['removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','create','post','/:id/dispositions','addDisposition','addAnswer','/:id/interactions','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0e33,0x1e6));var _0x30e3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0e33[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30e3('0x0'));var timeout=require(_0x30e3('0x1'));var express=require(_0x30e3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30e3('0x3'));var interaction=require(_0x30e3('0x4'));var config=require(_0x30e3('0x5'));var controller=require(_0x30e3('0x6'));router['get']('/',auth[_0x30e3('0x7')](),controller[_0x30e3('0x8')]);router[_0x30e3('0x9')](_0x30e3('0xa'),auth[_0x30e3('0x7')](),controller[_0x30e3('0xb')]);router[_0x30e3('0x9')](_0x30e3('0xc'),auth[_0x30e3('0x7')](),controller[_0x30e3('0xd')]);router[_0x30e3('0x9')]('/:id/dispositions',auth[_0x30e3('0x7')](),controller[_0x30e3('0xe')]);router[_0x30e3('0x9')](_0x30e3('0xf'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x10')]);router[_0x30e3('0x9')]('/:id/interactions',auth[_0x30e3('0x7')](),controller[_0x30e3('0x11')]);router[_0x30e3('0x9')](_0x30e3('0x12'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x13')]);router[_0x30e3('0x9')](_0x30e3('0x14'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x15')]);router[_0x30e3('0x9')](_0x30e3('0x16'),auth[_0x30e3('0x7')](),controller['getAgents']);router['post']('/',auth[_0x30e3('0x7')](),controller[_0x30e3('0x17')]);router[_0x30e3('0x18')](_0x30e3('0x19'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x1a')]);router['post'](_0x30e3('0xf'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x1b')]);router[_0x30e3('0x18')](_0x30e3('0x1c'),auth[_0x30e3('0x7')](),controller['addInteraction']);router['post'](_0x30e3('0x12'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x1d')]);router[_0x30e3('0x18')](_0x30e3('0x1e'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x1f')]);router[_0x30e3('0x18')]('/updateaccountapplications',auth[_0x30e3('0x7')](),controller[_0x30e3('0x20')]);router['post'](_0x30e3('0x21'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x22')]);router[_0x30e3('0x18')](_0x30e3('0x16'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x23')]);router[_0x30e3('0x24')](_0x30e3('0xc'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x25')]);router[_0x30e3('0x26')]('/:id',auth[_0x30e3('0x7')](),controller[_0x30e3('0x27')]);router[_0x30e3('0x26')](_0x30e3('0x19'),auth['isAuthenticated'](),controller[_0x30e3('0x28')]);router[_0x30e3('0x26')](_0x30e3('0xf'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x29')]);router['delete'](_0x30e3('0x16'),auth[_0x30e3('0x7')](),controller[_0x30e3('0x2a')]);module[_0x30e3('0x2b')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa69=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x66f307,_0x2be928){var _0x422a86=function(_0x508487){while(--_0x508487){_0x66f307['push'](_0x66f307['shift']());}};_0x422a86(++_0x2be928);}(_0xfa69,0x137));var _0x9fa6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa69[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x9fa6('0x0'));module[_0x9fa6('0x1')]={'priority':{'type':Sequelize[_0x9fa6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9fa6('0x3')],'allowNull':![],'defaultValue':_0x9fa6('0x4')},'appdata':{'type':Sequelize[_0x9fa6('0x5')]()},'description':{'type':Sequelize[_0x9fa6('0x3')]},'interval':{'type':Sequelize[_0x9fa6('0x3')],'defaultValue':_0x9fa6('0x6')}};
\ No newline at end of file
+var _0x1817=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x22ea49,_0x4a785c){var _0x580ac8=function(_0x2f717a){while(--_0x2f717a){_0x22ea49['push'](_0x22ea49['shift']());}};_0x580ac8(++_0x4a785c);}(_0x1817,0x77));var _0x7181=function(_0x56f922,_0x9fbc8a){_0x56f922=_0x56f922-0x0;var _0x27a50c=_0x1817[_0x56f922];return _0x27a50c;};'use strict';var Sequelize=require(_0x7181('0x0'));module[_0x7181('0x1')]={'priority':{'type':Sequelize[_0x7181('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7181('0x3')],'allowNull':![],'defaultValue':_0x7181('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7181('0x3')]},'interval':{'type':Sequelize[_0x7181('0x3')],'defaultValue':_0x7181('0x5')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8da9=['create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxApplication','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','show','rawAttributes','catch'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x8da9,0x1ae));var _0x98da=function(_0x435681,_0x5e6a4a){_0x435681=_0x435681-0x0;var _0x157d07=_0x8da9[_0x435681];return _0x157d07;};'use strict';var emlformat=require(_0x98da('0x0'));var rimraf=require(_0x98da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x98da('0x2'));var moment=require(_0x98da('0x3'));var BPromise=require(_0x98da('0x4'));var Mustache=require(_0x98da('0x5'));var util=require(_0x98da('0x6'));var path=require('path');var sox=require(_0x98da('0x7'));var csv=require(_0x98da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98da('0x9'));var squel=require(_0x98da('0xa'));var crypto=require(_0x98da('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x98da('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x98da('0xd'));var Redis=require(_0x98da('0xe'));var authService=require(_0x98da('0xf'));var qs=require(_0x98da('0x10'));var as=require(_0x98da('0x11'));var hardwareService=require(_0x98da('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x98da('0x13'));var config=require(_0x98da('0x14'));var licenseUtil=require(_0x98da('0x15'));var db=require(_0x98da('0x16'))['db'];function respondWithStatusCode(_0x124dcb,_0x1c51aa){_0x1c51aa=_0x1c51aa||0xcc;return function(_0x14eb59){if(_0x14eb59){return _0x124dcb['sendStatus'](_0x1c51aa);}return _0x124dcb[_0x98da('0x17')](_0x1c51aa)[_0x98da('0x18')]();};}function respondWithResult(_0x4ded0d,_0x4bb0b9){_0x4bb0b9=_0x4bb0b9||0xc8;return function(_0x33e616){if(_0x33e616){return _0x4ded0d[_0x98da('0x17')](_0x4bb0b9)['json'](_0x33e616);}};}function respondWithFilteredResult(_0x43b8c8,_0x319558){return function(_0xa851f3){if(_0xa851f3){var _0x251da5=typeof _0x319558['offset']===_0x98da('0x19')&&typeof _0x319558['limit']===_0x98da('0x19');var _0x337a36=_0xa851f3[_0x98da('0x1a')];var _0x4558ec=_0x251da5?0x0:_0x319558[_0x98da('0x1b')];var _0x458cbd=_0x251da5?_0xa851f3['count']:_0x319558[_0x98da('0x1b')]+_0x319558[_0x98da('0x1c')];var _0x503b2a;if(_0x458cbd>=_0x337a36){_0x458cbd=_0x337a36;_0x503b2a=0xc8;}else{_0x503b2a=0xce;}_0x43b8c8[_0x98da('0x17')](_0x503b2a);return _0x43b8c8['set'](_0x98da('0x1d'),_0x4558ec+'-'+_0x458cbd+'/'+_0x337a36)[_0x98da('0x1e')](_0xa851f3);}return null;};}function patchUpdates(_0x42b08e){return function(_0x340b5c){try{jsonpatch[_0x98da('0x1f')](_0x340b5c,_0x42b08e,!![]);}catch(_0x3cbb91){return BPromise['reject'](_0x3cbb91);}return _0x340b5c[_0x98da('0x20')]();};}function saveUpdates(_0x915fda,_0x4ea46d){return function(_0x3a6ad2){if(_0x3a6ad2){return _0x3a6ad2[_0x98da('0x21')](_0x915fda)[_0x98da('0x22')](function(_0x2b2076){return _0x2b2076;});}return null;};}function removeEntity(_0x30cea1,_0x34f3b7){return function(_0x56f7f5){if(_0x56f7f5){return _0x56f7f5[_0x98da('0x23')]()[_0x98da('0x22')](function(){_0x30cea1[_0x98da('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x87cdb5,_0xb3b383){return function(_0x68161){if(!_0x68161){_0x87cdb5[_0x98da('0x24')](0x194);}return _0x68161;};}function handleError(_0x373be1,_0x160277){_0x160277=_0x160277||0x1f4;return function(_0x49c4aa){logger[_0x98da('0x25')](_0x49c4aa[_0x98da('0x26')]);if(_0x49c4aa[_0x98da('0x27')]){delete _0x49c4aa[_0x98da('0x27')];}_0x373be1[_0x98da('0x17')](_0x160277)[_0x98da('0x28')](_0x49c4aa);};}exports[_0x98da('0x29')]=function(_0x4c421d,_0x24139f){var _0x332851={},_0x53d3a6={},_0x6a5144={'count':0x0,'rows':[]};var _0x3d4a37=_['map'](db[_0x98da('0x2a')]['rawAttributes'],function(_0x1a96ad){return{'name':_0x1a96ad['fieldName'],'type':_0x1a96ad[_0x98da('0x2b')][_0x98da('0x2c')]};});_0x53d3a6[_0x98da('0x2d')]=_[_0x98da('0x2e')](_0x3d4a37,_0x98da('0x27'));_0x53d3a6['query']=_[_0x98da('0x2f')](_0x4c421d[_0x98da('0x30')]);_0x53d3a6[_0x98da('0x31')]=_[_0x98da('0x32')](_0x53d3a6[_0x98da('0x2d')],_0x53d3a6[_0x98da('0x30')]);_0x332851[_0x98da('0x33')]=_[_0x98da('0x32')](_0x53d3a6[_0x98da('0x2d')],qs[_0x98da('0x34')](_0x4c421d['query'][_0x98da('0x34')]));_0x332851['attributes']=_0x332851[_0x98da('0x33')][_0x98da('0x35')]?_0x332851[_0x98da('0x33')]:_0x53d3a6['model'];if(!_0x4c421d[_0x98da('0x30')][_0x98da('0x36')]('nolimit')){_0x332851[_0x98da('0x1c')]=qs['limit'](_0x4c421d['query']['limit']);_0x332851['offset']=qs[_0x98da('0x1b')](_0x4c421d[_0x98da('0x30')]['offset']);}_0x332851[_0x98da('0x37')]=qs[_0x98da('0x38')](_0x4c421d[_0x98da('0x30')][_0x98da('0x38')]);_0x332851[_0x98da('0x39')]=qs['filters'](_['pick'](_0x4c421d[_0x98da('0x30')],_0x53d3a6[_0x98da('0x31')]),_0x3d4a37);if(_0x4c421d[_0x98da('0x30')][_0x98da('0x3a')]){_0x332851[_0x98da('0x39')]=_[_0x98da('0x3b')](_0x332851['where'],{'$or':_['map'](_0x3d4a37,function(_0x402e59){if(_0x402e59[_0x98da('0x2b')]!=='VIRTUAL'){var _0x391909={};_0x391909[_0x402e59[_0x98da('0x27')]]={'$like':'%'+_0x4c421d[_0x98da('0x30')][_0x98da('0x3a')]+'%'};return _0x391909;}})});}_0x332851=_[_0x98da('0x3b')]({},_0x332851,_0x4c421d[_0x98da('0x3c')]);var _0x4b2fb3={'where':_0x332851[_0x98da('0x39')]};return db[_0x98da('0x2a')][_0x98da('0x1a')](_0x4b2fb3)[_0x98da('0x22')](function(_0x478a2d){_0x6a5144[_0x98da('0x1a')]=_0x478a2d;if(_0x4c421d[_0x98da('0x30')][_0x98da('0x3d')]){_0x332851[_0x98da('0x3e')]=[{'all':!![]}];}return db[_0x98da('0x2a')][_0x98da('0x3f')](_0x332851);})[_0x98da('0x22')](function(_0xee121a){_0x6a5144['rows']=_0xee121a;return _0x6a5144;})[_0x98da('0x22')](respondWithFilteredResult(_0x24139f,_0x332851))['catch'](handleError(_0x24139f,null));};exports[_0x98da('0x40')]=function(_0x133c62,_0x5dc487){var _0x481245={'raw':!![],'where':{'id':_0x133c62['params']['id']}},_0x8e41eb={};_0x8e41eb['model']=_['keys'](db['FaxApplication'][_0x98da('0x41')]);_0x8e41eb['query']=_[_0x98da('0x2f')](_0x133c62['query']);_0x8e41eb[_0x98da('0x31')]=_[_0x98da('0x32')](_0x8e41eb[_0x98da('0x2d')],_0x8e41eb['query']);_0x481245[_0x98da('0x33')]=_[_0x98da('0x32')](_0x8e41eb[_0x98da('0x2d')],qs[_0x98da('0x34')](_0x133c62[_0x98da('0x30')][_0x98da('0x34')]));_0x481245[_0x98da('0x33')]=_0x481245[_0x98da('0x33')]['length']?_0x481245[_0x98da('0x33')]:_0x8e41eb[_0x98da('0x2d')];if(_0x133c62[_0x98da('0x30')][_0x98da('0x3d')]){_0x481245[_0x98da('0x3e')]=[{'all':!![]}];}_0x481245=_[_0x98da('0x3b')]({},_0x481245,_0x133c62[_0x98da('0x3c')]);return db[_0x98da('0x2a')]['find'](_0x481245)[_0x98da('0x22')](handleEntityNotFound(_0x5dc487,null))[_0x98da('0x22')](respondWithResult(_0x5dc487,null))[_0x98da('0x42')](handleError(_0x5dc487,null));};exports['create']=function(_0x37be2b,_0x191cc6){return db[_0x98da('0x2a')][_0x98da('0x43')](_0x37be2b['body'],{})[_0x98da('0x22')](respondWithResult(_0x191cc6,0xc9))[_0x98da('0x42')](handleError(_0x191cc6,null));};exports[_0x98da('0x21')]=function(_0x1d6c23,_0x40eb7b){if(_0x1d6c23[_0x98da('0x44')]['id']){delete _0x1d6c23[_0x98da('0x44')]['id'];}return db['FaxApplication'][_0x98da('0x45')]({'where':{'id':_0x1d6c23[_0x98da('0x46')]['id']}})[_0x98da('0x22')](handleEntityNotFound(_0x40eb7b,null))[_0x98da('0x22')](saveUpdates(_0x1d6c23['body'],null))[_0x98da('0x22')](respondWithResult(_0x40eb7b,null))[_0x98da('0x42')](handleError(_0x40eb7b,null));};exports[_0x98da('0x23')]=function(_0x54ead6,_0x1fce7){return db[_0x98da('0x2a')][_0x98da('0x45')]({'where':{'id':_0x54ead6[_0x98da('0x46')]['id']}})[_0x98da('0x22')](handleEntityNotFound(_0x1fce7,null))[_0x98da('0x22')](removeEntity(_0x1fce7,null))[_0x98da('0x42')](handleError(_0x1fce7,null));};
\ No newline at end of file
+var _0x3717=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x3717,0x150));var _0x7371=function(_0x42b2a9,_0x56c32a){_0x42b2a9=_0x42b2a9-0x0;var _0x181e01=_0x3717[_0x42b2a9];return _0x181e01;};'use strict';var emlformat=require(_0x7371('0x0'));var rimraf=require(_0x7371('0x1'));var zipdir=require(_0x7371('0x2'));var jsonpatch=require(_0x7371('0x3'));var rp=require(_0x7371('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7371('0x5'));var util=require('util');var path=require(_0x7371('0x6'));var sox=require(_0x7371('0x7'));var csv=require('to-csv');var ejs=require(_0x7371('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7371('0x9'));var crypto=require(_0x7371('0xa'));var jsforce=require(_0x7371('0xb'));var deskjs=require(_0x7371('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7371('0xd'));var Redis=require(_0x7371('0xe'));var authService=require(_0x7371('0xf'));var qs=require(_0x7371('0x10'));var as=require(_0x7371('0x11'));var hardwareService=require(_0x7371('0x12'));var logger=require(_0x7371('0x13'))(_0x7371('0x14'));var utils=require(_0x7371('0x15'));var config=require(_0x7371('0x16'));var licenseUtil=require(_0x7371('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b0ee6,_0x249597){_0x249597=_0x249597||0xcc;return function(_0x393cd9){if(_0x393cd9){return _0x2b0ee6['sendStatus'](_0x249597);}return _0x2b0ee6[_0x7371('0x18')](_0x249597)[_0x7371('0x19')]();};}function respondWithResult(_0x57dfaf,_0x3d2eb6){_0x3d2eb6=_0x3d2eb6||0xc8;return function(_0x547cb6){if(_0x547cb6){return _0x57dfaf['status'](_0x3d2eb6)[_0x7371('0x1a')](_0x547cb6);}};}function respondWithFilteredResult(_0x4e13d1,_0x19b195){return function(_0x3883ef){if(_0x3883ef){var _0x50798d=typeof _0x19b195[_0x7371('0x1b')]===_0x7371('0x1c')&&typeof _0x19b195[_0x7371('0x1d')]===_0x7371('0x1c');var _0xc07973=_0x3883ef[_0x7371('0x1e')];var _0x34397b=_0x50798d?0x0:_0x19b195[_0x7371('0x1b')];var _0x3c0465=_0x50798d?_0x3883ef[_0x7371('0x1e')]:_0x19b195[_0x7371('0x1b')]+_0x19b195[_0x7371('0x1d')];var _0x25c253;if(_0x3c0465>=_0xc07973){_0x3c0465=_0xc07973;_0x25c253=0xc8;}else{_0x25c253=0xce;}_0x4e13d1['status'](_0x25c253);return _0x4e13d1[_0x7371('0x1f')](_0x7371('0x20'),_0x34397b+'-'+_0x3c0465+'/'+_0xc07973)[_0x7371('0x1a')](_0x3883ef);}return null;};}function patchUpdates(_0x4f1d5c){return function(_0x23d21e){try{jsonpatch[_0x7371('0x21')](_0x23d21e,_0x4f1d5c,!![]);}catch(_0x7b3b26){return BPromise[_0x7371('0x22')](_0x7b3b26);}return _0x23d21e[_0x7371('0x23')]();};}function saveUpdates(_0x3078b3,_0x978480){return function(_0x49610c){if(_0x49610c){return _0x49610c[_0x7371('0x24')](_0x3078b3)[_0x7371('0x25')](function(_0x55fd36){return _0x55fd36;});}return null;};}function removeEntity(_0x3384d1,_0x4c6194){return function(_0x428b99){if(_0x428b99){return _0x428b99[_0x7371('0x26')]()[_0x7371('0x25')](function(){_0x3384d1[_0x7371('0x18')](0xcc)[_0x7371('0x19')]();});}};}function handleEntityNotFound(_0x3cbd06,_0x157fa8){return function(_0x38aaf6){if(!_0x38aaf6){_0x3cbd06[_0x7371('0x27')](0x194);}return _0x38aaf6;};}function handleError(_0x426654,_0x4955b0){_0x4955b0=_0x4955b0||0x1f4;return function(_0x219cc8){logger[_0x7371('0x28')](_0x219cc8['stack']);if(_0x219cc8[_0x7371('0x29')]){delete _0x219cc8[_0x7371('0x29')];}_0x426654[_0x7371('0x18')](_0x4955b0)[_0x7371('0x2a')](_0x219cc8);};}exports[_0x7371('0x2b')]=function(_0x4a31f8,_0x1a8e53){var _0x53084e={},_0x41eb09={},_0x330c7d={'count':0x0,'rows':[]};var _0x57480d=_[_0x7371('0x2c')](db[_0x7371('0x2d')][_0x7371('0x2e')],function(_0xe8adf5){return{'name':_0xe8adf5[_0x7371('0x2f')],'type':_0xe8adf5[_0x7371('0x30')][_0x7371('0x31')]};});_0x41eb09['model']=_[_0x7371('0x2c')](_0x57480d,_0x7371('0x29'));_0x41eb09['query']=_['keys'](_0x4a31f8[_0x7371('0x32')]);_0x41eb09[_0x7371('0x33')]=_['intersection'](_0x41eb09['model'],_0x41eb09[_0x7371('0x32')]);_0x53084e[_0x7371('0x34')]=_[_0x7371('0x35')](_0x41eb09[_0x7371('0x36')],qs[_0x7371('0x37')](_0x4a31f8['query']['fields']));_0x53084e[_0x7371('0x34')]=_0x53084e['attributes']['length']?_0x53084e[_0x7371('0x34')]:_0x41eb09[_0x7371('0x36')];if(!_0x4a31f8['query']['hasOwnProperty']('nolimit')){_0x53084e[_0x7371('0x1d')]=qs[_0x7371('0x1d')](_0x4a31f8[_0x7371('0x32')]['limit']);_0x53084e['offset']=qs['offset'](_0x4a31f8[_0x7371('0x32')][_0x7371('0x1b')]);}_0x53084e[_0x7371('0x38')]=qs[_0x7371('0x39')](_0x4a31f8[_0x7371('0x32')][_0x7371('0x39')]);_0x53084e['where']=qs['filters'](_[_0x7371('0x3a')](_0x4a31f8[_0x7371('0x32')],_0x41eb09[_0x7371('0x33')]),_0x57480d);if(_0x4a31f8[_0x7371('0x32')][_0x7371('0x3b')]){_0x53084e[_0x7371('0x3c')]=_[_0x7371('0x3d')](_0x53084e[_0x7371('0x3c')],{'$or':_['map'](_0x57480d,function(_0x4cffe7){if(_0x4cffe7['type']!==_0x7371('0x3e')){var _0x192f60={};_0x192f60[_0x4cffe7[_0x7371('0x29')]]={'$like':'%'+_0x4a31f8[_0x7371('0x32')][_0x7371('0x3b')]+'%'};return _0x192f60;}})});}_0x53084e=_[_0x7371('0x3d')]({},_0x53084e,_0x4a31f8[_0x7371('0x3f')]);var _0x2b8598={'where':_0x53084e[_0x7371('0x3c')]};return db[_0x7371('0x2d')][_0x7371('0x1e')](_0x2b8598)['then'](function(_0x596768){_0x330c7d[_0x7371('0x1e')]=_0x596768;if(_0x4a31f8['query']['includeAll']){_0x53084e['include']=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x53084e);})[_0x7371('0x25')](function(_0x1c70cc){_0x330c7d['rows']=_0x1c70cc;return _0x330c7d;})[_0x7371('0x25')](respondWithFilteredResult(_0x1a8e53,_0x53084e))[_0x7371('0x40')](handleError(_0x1a8e53,null));};exports[_0x7371('0x41')]=function(_0x396f4e,_0x4deada){var _0x389b61={'raw':!![],'where':{'id':_0x396f4e[_0x7371('0x42')]['id']}},_0x3759cb={};_0x3759cb[_0x7371('0x36')]=_[_0x7371('0x43')](db[_0x7371('0x2d')][_0x7371('0x2e')]);_0x3759cb['query']=_[_0x7371('0x43')](_0x396f4e[_0x7371('0x32')]);_0x3759cb['filters']=_[_0x7371('0x35')](_0x3759cb[_0x7371('0x36')],_0x3759cb[_0x7371('0x32')]);_0x389b61[_0x7371('0x34')]=_[_0x7371('0x35')](_0x3759cb['model'],qs[_0x7371('0x37')](_0x396f4e[_0x7371('0x32')]['fields']));_0x389b61['attributes']=_0x389b61[_0x7371('0x34')]['length']?_0x389b61[_0x7371('0x34')]:_0x3759cb[_0x7371('0x36')];if(_0x396f4e[_0x7371('0x32')][_0x7371('0x44')]){_0x389b61['include']=[{'all':!![]}];}_0x389b61=_[_0x7371('0x3d')]({},_0x389b61,_0x396f4e[_0x7371('0x3f')]);return db[_0x7371('0x2d')][_0x7371('0x45')](_0x389b61)[_0x7371('0x25')](handleEntityNotFound(_0x4deada,null))[_0x7371('0x25')](respondWithResult(_0x4deada,null))['catch'](handleError(_0x4deada,null));};exports[_0x7371('0x46')]=function(_0x4e86d4,_0xad1bba){return db[_0x7371('0x2d')]['create'](_0x4e86d4[_0x7371('0x47')],{})[_0x7371('0x25')](respondWithResult(_0xad1bba,0xc9))[_0x7371('0x40')](handleError(_0xad1bba,null));};exports[_0x7371('0x24')]=function(_0x3b222d,_0x3401ad){if(_0x3b222d[_0x7371('0x47')]['id']){delete _0x3b222d[_0x7371('0x47')]['id'];}return db[_0x7371('0x2d')]['find']({'where':{'id':_0x3b222d['params']['id']}})[_0x7371('0x25')](handleEntityNotFound(_0x3401ad,null))[_0x7371('0x25')](saveUpdates(_0x3b222d[_0x7371('0x47')],null))[_0x7371('0x25')](respondWithResult(_0x3401ad,null))[_0x7371('0x40')](handleError(_0x3401ad,null));};exports[_0x7371('0x26')]=function(_0x46ab45,_0x51c9dc){return db['FaxApplication'][_0x7371('0x45')]({'where':{'id':_0x46ab45[_0x7371('0x42')]['id']}})[_0x7371('0x25')](handleEntityNotFound(_0x51c9dc,null))[_0x7371('0x25')](removeEntity(_0x51c9dc,null))[_0x7371('0x40')](handleError(_0x51c9dc,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc8f=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./faxApplication.attributes','define'];(function(_0xc4966b,_0x6cd5e0){var _0x1802bb=function(_0x12f623){while(--_0x12f623){_0xc4966b['push'](_0xc4966b['shift']());}};_0x1802bb(++_0x6cd5e0);}(_0xcc8f,0x1cb));var _0xfcc8=function(_0x50fb12,_0x39c2a3){_0x50fb12=_0x50fb12-0x0;var _0x37c6a2=_0xcc8f[_0x50fb12];return _0x37c6a2;};'use strict';var _=require(_0xfcc8('0x0'));var util=require(_0xfcc8('0x1'));var logger=require(_0xfcc8('0x2'))(_0xfcc8('0x3'));var moment=require('moment');var BPromise=require(_0xfcc8('0x4'));var rp=require(_0xfcc8('0x5'));var fs=require('fs');var path=require(_0xfcc8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfcc8('0x7'));module['exports']=function(_0x5ad357,_0xb50e0d){return _0x5ad357[_0xfcc8('0x8')](_0xfcc8('0x9'),attributes,{'tableName':_0xfcc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfcc8('0xb'),'collate':_0xfcc8('0xc')});};
\ No newline at end of file
+var _0x01dc=['define','FaxApplication','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports'];(function(_0x6243bb,_0x269bd7){var _0x16ef17=function(_0x5771f1){while(--_0x5771f1){_0x6243bb['push'](_0x6243bb['shift']());}};_0x16ef17(++_0x269bd7);}(_0x01dc,0x6b));var _0xc01d=function(_0x34a5d7,_0x34c401){_0x34a5d7=_0x34a5d7-0x0;var _0x5b2de5=_0x01dc[_0x34a5d7];return _0x5b2de5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc01d('0x0'))(_0xc01d('0x1'));var moment=require(_0xc01d('0x2'));var BPromise=require(_0xc01d('0x3'));var rp=require(_0xc01d('0x4'));var fs=require('fs');var path=require(_0xc01d('0x5'));var rimraf=require(_0xc01d('0x6'));var config=require(_0xc01d('0x7'));var attributes=require(_0xc01d('0x8'));module[_0xc01d('0x9')]=function(_0x262159,_0x5958f9){return _0x262159[_0xc01d('0xa')](_0xc01d('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc01d('0xc')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6068=['FaxApplication,\x20%s,\x20%s','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x6068,0x66));var _0x8606=function(_0x3338e3,_0x4b1ab0){_0x3338e3=_0x3338e3-0x0;var _0x5cd9d2=_0x6068[_0x3338e3];return _0x5cd9d2;};'use strict';var _=require(_0x8606('0x0'));var util=require(_0x8606('0x1'));var moment=require(_0x8606('0x2'));var BPromise=require(_0x8606('0x3'));var rs=require(_0x8606('0x4'));var fs=require('fs');var Redis=require(_0x8606('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8606('0x6'));var logger=require(_0x8606('0x7'))(_0x8606('0x8'));var config=require('../../config/environment');var jayson=require(_0x8606('0x9'));var client=jayson[_0x8606('0xa')][_0x8606('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c6e20,_0x2327e2,_0x106957){return new BPromise(function(_0x524049,_0x4350e6){return client[_0x8606('0xc')](_0x1c6e20,_0x106957)[_0x8606('0xd')](function(_0x467899){logger[_0x8606('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,_0x8606('0xf'));logger[_0x8606('0x10')](_0x8606('0x11'),_0x2327e2,'request\x20sent',JSON[_0x8606('0x12')](_0x467899));if(_0x467899[_0x8606('0x13')]){if(_0x467899[_0x8606('0x13')][_0x8606('0x14')]===0x1f4){logger[_0x8606('0x13')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,_0x467899[_0x8606('0x13')][_0x8606('0x15')]);return _0x4350e6(_0x467899[_0x8606('0x13')]['message']);}logger[_0x8606('0x13')](_0x8606('0x16'),_0x2327e2,_0x467899[_0x8606('0x13')][_0x8606('0x15')]);return _0x524049(_0x467899[_0x8606('0x13')]['message']);}else{logger[_0x8606('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,'request\x20sent');_0x524049(_0x467899['result']['message']);}})['catch'](function(_0x31902c){logger[_0x8606('0x13')]('FaxApplication,\x20%s,\x20%s',_0x2327e2,_0x31902c);_0x4350e6(_0x31902c);});});}exports[_0x8606('0x17')]=function(_0x240e3b){var _0x2da381=this;return new Promise(function(_0x107648,_0x39ddb7){return db[_0x8606('0x18')][_0x8606('0x19')](_0x240e3b[_0x8606('0x1a')],{'raw':_0x240e3b[_0x8606('0x1b')]?_0x240e3b[_0x8606('0x1b')][_0x8606('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240e3b[_0x8606('0x1b')]?_0x240e3b[_0x8606('0x1b')]['where']||null:null,'attributes':_0x240e3b['options']?_0x240e3b[_0x8606('0x1b')][_0x8606('0x1d')]||null:null,'limit':_0x240e3b[_0x8606('0x1b')]?_0x240e3b[_0x8606('0x1b')]['limit']||null:null})[_0x8606('0xd')](function(_0x52b66){logger[_0x8606('0xe')](_0x8606('0x17'),_0x240e3b);logger[_0x8606('0x10')](_0x8606('0x17'),_0x240e3b,JSON[_0x8606('0x12')](_0x52b66));_0x107648(_0x52b66);})[_0x8606('0x1e')](function(_0x2a9626){logger[_0x8606('0x13')](_0x8606('0x17'),_0x2a9626[_0x8606('0x15')],_0x240e3b);_0x39ddb7(_0x2da381[_0x8606('0x13')](0x1f4,_0x2a9626[_0x8606('0x15')]));});});};
\ No newline at end of file
+var _0x1f09=['catch','body','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1f09,0x134));var _0x91f0=function(_0x2ea707,_0x4909b8){_0x2ea707=_0x2ea707-0x0;var _0x2844ef=_0x1f09[_0x2ea707];return _0x2844ef;};'use strict';var _=require(_0x91f0('0x0'));var util=require(_0x91f0('0x1'));var moment=require(_0x91f0('0x2'));var BPromise=require('bluebird');var rs=require(_0x91f0('0x3'));var fs=require('fs');var Redis=require(_0x91f0('0x4'));var db=require(_0x91f0('0x5'))['db'];var utils=require(_0x91f0('0x6'));var logger=require(_0x91f0('0x7'))('rpc');var config=require(_0x91f0('0x8'));var jayson=require(_0x91f0('0x9'));var client=jayson[_0x91f0('0xa')][_0x91f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32561f,_0x20aec1,_0x380c19){return new BPromise(function(_0x1783e8,_0x5a3b9c){return client['request'](_0x32561f,_0x380c19)[_0x91f0('0xc')](function(_0x17083b){logger['info'](_0x91f0('0xd'),_0x20aec1,_0x91f0('0xe'));logger['debug'](_0x91f0('0xf'),_0x20aec1,_0x91f0('0xe'),JSON[_0x91f0('0x10')](_0x17083b));if(_0x17083b['error']){if(_0x17083b['error'][_0x91f0('0x11')]===0x1f4){logger[_0x91f0('0x12')](_0x91f0('0xd'),_0x20aec1,_0x17083b[_0x91f0('0x12')][_0x91f0('0x13')]);return _0x5a3b9c(_0x17083b[_0x91f0('0x12')][_0x91f0('0x13')]);}logger[_0x91f0('0x12')](_0x91f0('0xd'),_0x20aec1,_0x17083b[_0x91f0('0x12')][_0x91f0('0x13')]);return _0x1783e8(_0x17083b[_0x91f0('0x12')]['message']);}else{logger[_0x91f0('0x14')](_0x91f0('0xd'),_0x20aec1,'request\x20sent');_0x1783e8(_0x17083b[_0x91f0('0x15')]['message']);}})[_0x91f0('0x16')](function(_0x3f689c){logger[_0x91f0('0x12')](_0x91f0('0xd'),_0x20aec1,_0x3f689c);_0x5a3b9c(_0x3f689c);});});}exports['UpdateFaxApplication']=function(_0x29ab45){var _0x2fd56a=this;return new Promise(function(_0x3ab950,_0x5e43a9){return db['FaxApplication']['update'](_0x29ab45[_0x91f0('0x17')],{'raw':_0x29ab45['options']?_0x29ab45[_0x91f0('0x18')][_0x91f0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29ab45['options']?_0x29ab45[_0x91f0('0x18')][_0x91f0('0x1a')]||null:null,'attributes':_0x29ab45['options']?_0x29ab45[_0x91f0('0x18')][_0x91f0('0x1b')]||null:null,'limit':_0x29ab45[_0x91f0('0x18')]?_0x29ab45['options'][_0x91f0('0x1c')]||null:null})[_0x91f0('0xc')](function(_0x4c07d7){logger[_0x91f0('0x14')]('UpdateFaxApplication',_0x29ab45);logger['debug'](_0x91f0('0x1d'),_0x29ab45,JSON['stringify'](_0x4c07d7));_0x3ab950(_0x4c07d7);})[_0x91f0('0x16')](function(_0x235cef){logger[_0x91f0('0x12')](_0x91f0('0x1d'),_0x235cef['message'],_0x29ab45);_0x5e43a9(_0x2fd56a[_0x91f0('0x12')](0x1f4,_0x235cef[_0x91f0('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x087b=['destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x1a3495,_0x5eb05e){var _0x5045a7=function(_0x52e904){while(--_0x52e904){_0x1a3495['push'](_0x1a3495['shift']());}};_0x5045a7(++_0x5eb05e);}(_0x087b,0x11a));var _0xb087=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x087b[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0xd')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0xf')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);module[_0xb087('0x13')]=router;
\ No newline at end of file
+var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x492445,_0x1454f9){var _0x34ca20=function(_0x33e606){while(--_0x33e606){_0x492445['push'](_0x492445['shift']());}};_0x34ca20(++_0x1454f9);}(_0xda3f,0xec));var _0xfda3=function(_0x57e239,_0x340166){_0x57e239=_0x57e239-0x0;var _0x5d9902=_0xda3f[_0x57e239];return _0x5d9902;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./faxApplication.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x150fd1,_0x5b314b){var _0x52538a=function(_0x27886e){while(--_0x27886e){_0x150fd1['push'](_0x150fd1['shift']());}};_0x52538a(++_0x5b314b);}(_0x2ef3,0xba));var _0x32ef=function(_0x4520a3,_0x120646){_0x4520a3=_0x4520a3-0x0;var _0x326fdc=_0x2ef3[_0x4520a3];return _0x326fdc;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'closed':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x32ef('0x3')]},'disposition':{'type':Sequelize[_0x32ef('0x4')]},'secondDisposition':{'type':Sequelize[_0x32ef('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x32ef('0x4')]},'read1stAt':{'type':Sequelize[_0x32ef('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x32ef('0x5')]('in',_0x32ef('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x32ef('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x32ef('0x7')]}};
\ No newline at end of file
+var _0x0b0e=['out','sequelize','BOOLEAN','STRING','DATE','ENUM'];(function(_0x48fcf0,_0x3883d4){var _0x34b0e2=function(_0x44822c){while(--_0x44822c){_0x48fcf0['push'](_0x48fcf0['shift']());}};_0x34b0e2(++_0x3883d4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x0b0e[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'closed':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe0b0('0x2')]},'secondDisposition':{'type':Sequelize[_0xe0b0('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe0b0('0x2')]},'note':{'type':Sequelize[_0xe0b0('0x2')]},'read1stAt':{'type':Sequelize[_0xe0b0('0x3')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xe0b0('0x4')]('in',_0xe0b0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe0b0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe0b0('0x4')]('in',_0xe0b0('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa11=['index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','fax','user','catch','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','include','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','filters','pick','FaxInteractionId','filter','where','$gte','split','merge','options','findAll','rows','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ioredis','../../components/interaction/service','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','update','then','destroy','end','error','name','send'];(function(_0x2ac1ee,_0x5e87eb){var _0x3f164b=function(_0x520d24){while(--_0x520d24){_0x2ac1ee['push'](_0x2ac1ee['shift']());}};_0x3f164b(++_0x5e87eb);}(_0xaa11,0x17f));var _0x1aa1=function(_0x143b68,_0x31a28b){_0x143b68=_0x143b68-0x0;var _0x58524d=_0xaa11[_0x143b68];return _0x58524d;};'use strict';var rimraf=require(_0x1aa1('0x0'));var zipdir=require(_0x1aa1('0x1'));var moment=require(_0x1aa1('0x2'));var BPromise=require(_0x1aa1('0x3'));var util=require(_0x1aa1('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x1aa1('0x5'));var interaction=require(_0x1aa1('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x1aa1('0x7'))('api');var config=require('../../config/environment');var db=require(_0x1aa1('0x8'))['db'];config[_0x1aa1('0x9')]=_[_0x1aa1('0xa')](config['redis'],{'host':_0x1aa1('0xb'),'port':0x18eb});var socket=require(_0x1aa1('0xc'))(new Redis(config[_0x1aa1('0x9')]));require('./faxInteraction.socket')[_0x1aa1('0xd')](socket);function respondWithStatusCode(_0x252daa,_0xc670e9){_0xc670e9=_0xc670e9||0xcc;return function(_0x15277f){if(_0x15277f){return _0x252daa[_0x1aa1('0xe')](_0xc670e9);}return _0x252daa[_0x1aa1('0xf')](_0xc670e9)['end']();};}function respondWithResult(_0x238b12,_0x5d9593){_0x5d9593=_0x5d9593||0xc8;return function(_0xcf8f7f){if(_0xcf8f7f){return _0x238b12[_0x1aa1('0xf')](_0x5d9593)[_0x1aa1('0x10')](_0xcf8f7f);}};}function respondWithFilteredResult(_0x407b8d,_0x1c1f2d){return function(_0x280617){if(_0x280617){var _0x49acc3=typeof _0x1c1f2d['offset']===_0x1aa1('0x11')&&typeof _0x1c1f2d[_0x1aa1('0x12')]===_0x1aa1('0x11');var _0x1621bc=_0x280617[_0x1aa1('0x13')];var _0x21ece3=_0x49acc3?0x0:_0x1c1f2d[_0x1aa1('0x14')];var _0xd80d78=_0x49acc3?_0x280617[_0x1aa1('0x13')]:_0x1c1f2d[_0x1aa1('0x14')]+_0x1c1f2d[_0x1aa1('0x12')];var _0x3e59c7;if(_0xd80d78>=_0x1621bc){_0xd80d78=_0x1621bc;_0x3e59c7=0xc8;}else{_0x3e59c7=0xce;}_0x407b8d['status'](_0x3e59c7);return _0x407b8d[_0x1aa1('0x15')]('Content-Range',_0x21ece3+'-'+_0xd80d78+'/'+_0x1621bc)[_0x1aa1('0x10')](_0x280617);}return null;};}function saveUpdates(_0x2719bb){return function(_0x21c39b){if(_0x21c39b){return _0x21c39b[_0x1aa1('0x16')](_0x2719bb)[_0x1aa1('0x17')](function(_0x5dc8f6){return _0x5dc8f6;});}return null;};}function removeEntity(_0x5d84d3){return function(_0x46686f){if(_0x46686f){return _0x46686f[_0x1aa1('0x18')]()[_0x1aa1('0x17')](function(){_0x5d84d3['status'](0xcc)[_0x1aa1('0x19')]();});}};}function handleEntityNotFound(_0x27dae6){return function(_0x3a49a3){if(!_0x3a49a3){_0x27dae6[_0x1aa1('0xe')](0x194);}return _0x3a49a3;};}function handleError(_0x786758,_0x5cdec4){_0x5cdec4=_0x5cdec4||0x1f4;return function(_0x2275bf){logger[_0x1aa1('0x1a')](_0x2275bf['stack']);if(_0x2275bf[_0x1aa1('0x1b')]){delete _0x2275bf[_0x1aa1('0x1b')];}_0x786758[_0x1aa1('0xf')](_0x5cdec4)[_0x1aa1('0x1c')](_0x2275bf);};}exports[_0x1aa1('0x1d')]=function(_0x33487b,_0x3d9d25){var _0x559f3b={};var _0x18b158=_[_0x1aa1('0x1e')](db[_0x1aa1('0x1f')][_0x1aa1('0x20')],function(_0x483e8b){return{'name':_0x483e8b[_0x1aa1('0x21')],'type':_0x483e8b['type'][_0x1aa1('0x22')]};});_0x559f3b=qs[_0x1aa1('0x23')](_0x18b158,_0x33487b);return interaction['findAll'](_0x1aa1('0x24'),_0x33487b['query'],_0x33487b[_0x1aa1('0x25')],_0x559f3b,_0x18b158)[_0x1aa1('0x17')](respondWithFilteredResult(_0x3d9d25,_0x559f3b))[_0x1aa1('0x26')](handleError(_0x3d9d25,null));};exports[_0x1aa1('0x27')]=function(_0x13e255,_0x5ceec6){var _0x562310={'raw':![],'where':{'id':_0x13e255[_0x1aa1('0x28')]['id']}},_0x11dccb={};_0x11dccb[_0x1aa1('0x29')]=_[_0x1aa1('0x2a')](db[_0x1aa1('0x1f')][_0x1aa1('0x20')]);_0x11dccb[_0x1aa1('0x2b')]=_[_0x1aa1('0x2a')](_0x13e255[_0x1aa1('0x2b')]);_0x11dccb['filters']=_[_0x1aa1('0x2c')](_0x11dccb[_0x1aa1('0x29')],_0x11dccb[_0x1aa1('0x2b')]);_0x562310[_0x1aa1('0x2d')]=_[_0x1aa1('0x2c')](_0x11dccb[_0x1aa1('0x29')],qs[_0x1aa1('0x2e')](_0x13e255['query']['fields']));_0x562310[_0x1aa1('0x2d')]=_0x562310[_0x1aa1('0x2d')][_0x1aa1('0x2f')]?_0x562310[_0x1aa1('0x2d')]:_0x11dccb['model'];if(_0x13e255[_0x1aa1('0x2b')][_0x1aa1('0x30')]){_0x562310[_0x1aa1('0x31')]=[{'all':!![]}];}_0x562310=_['merge']({},_0x562310,_0x13e255['options']);return db[_0x1aa1('0x1f')][_0x1aa1('0x32')](_0x562310)['then'](handleEntityNotFound(_0x5ceec6,null))[_0x1aa1('0x17')](respondWithResult(_0x5ceec6,null))[_0x1aa1('0x26')](handleError(_0x5ceec6,null));};exports[_0x1aa1('0x33')]=function(_0x49c76c,_0x5696cc){return db['FaxInteraction'][_0x1aa1('0x33')](_0x49c76c[_0x1aa1('0x34')],{})['then'](respondWithResult(_0x5696cc,0xc9))[_0x1aa1('0x26')](handleError(_0x5696cc,null));};exports[_0x1aa1('0x16')]=function(_0x3e9813,_0x21b0e7){if(_0x3e9813[_0x1aa1('0x34')]['id']){delete _0x3e9813[_0x1aa1('0x34')]['id'];}return db[_0x1aa1('0x1f')]['find']({'where':{'id':_0x3e9813['params']['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x21b0e7,null))['then'](saveUpdates(_0x3e9813[_0x1aa1('0x34')],null))[_0x1aa1('0x17')](respondWithResult(_0x21b0e7,null))[_0x1aa1('0x26')](handleError(_0x21b0e7,null));};exports[_0x1aa1('0x18')]=function(_0x4ec997,_0x357345){return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x4ec997[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x357345,null))[_0x1aa1('0x17')](removeEntity(_0x357345,null))['catch'](handleError(_0x357345,null));};exports['describe']=function(_0x14d1ed,_0x18fb5f){return db[_0x1aa1('0x1f')][_0x1aa1('0x35')]()['then'](respondWithResult(_0x18fb5f,null))[_0x1aa1('0x26')](handleError(_0x18fb5f,null));};exports[_0x1aa1('0x36')]=function(_0x35f744,_0x24d489){return db[_0x1aa1('0x37')][_0x1aa1('0x32')]({'where':{'id':_0x35f744[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x24d489,null))['then'](function(_0x6279bb){if(_0x6279bb){return _0x6279bb[_0x1aa1('0x36')](_0x35f744[_0x1aa1('0x34')][_0x1aa1('0x38')],_[_0x1aa1('0x39')](_0x35f744[_0x1aa1('0x34')],[_0x1aa1('0x38'),'id'])||{});}})['then'](respondWithResult(_0x24d489,null))[_0x1aa1('0x26')](handleError(_0x24d489,null));};exports[_0x1aa1('0x3a')]=function(_0x2cd0ce,_0x25e7bf){var _0x4277f4={'raw':![],'where':{}};var _0x46a036={};var _0x478f7d={'count':0x0,'rows':[]};return db[_0x1aa1('0x1f')][_0x1aa1('0x3b')]({'where':{'id':_0x2cd0ce[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x25e7bf,null))['then'](function(_0x40597b){if(_0x40597b){_0x46a036[_0x1aa1('0x29')]=_['keys'](db[_0x1aa1('0x37')]['rawAttributes']);_0x46a036[_0x1aa1('0x2b')]=_['keys'](_0x2cd0ce[_0x1aa1('0x2b')]);_0x46a036['filters']=_['intersection'](_0x46a036[_0x1aa1('0x29')],_0x46a036[_0x1aa1('0x2b')]);_0x4277f4['attributes']=_[_0x1aa1('0x2c')](_0x46a036[_0x1aa1('0x29')],qs[_0x1aa1('0x2e')](_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x2e')]));_0x4277f4[_0x1aa1('0x2d')]=_0x4277f4[_0x1aa1('0x2d')][_0x1aa1('0x2f')]?_0x4277f4[_0x1aa1('0x2d')]:_0x46a036['model'];if(!_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x3c')]('nolimit')){_0x4277f4[_0x1aa1('0x12')]=qs[_0x1aa1('0x12')](_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x12')]);_0x4277f4[_0x1aa1('0x14')]=qs['offset'](_0x2cd0ce['query'][_0x1aa1('0x14')]);}_0x4277f4[_0x1aa1('0x3d')]=qs[_0x1aa1('0x3e')](_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x3e')]);_0x4277f4['where']=qs[_0x1aa1('0x3f')](_[_0x1aa1('0x40')](_0x2cd0ce[_0x1aa1('0x2b')],_0x46a036[_0x1aa1('0x3f')]));_0x4277f4['where'][_0x1aa1('0x41')]=_0x40597b['id'];if(_0x2cd0ce['query'][_0x1aa1('0x42')]){_0x4277f4[_0x1aa1('0x43')]=_['merge'](_0x4277f4['where'],{'$or':_['map'](_0x4277f4['attributes'],function(_0x317633){var _0x5d7e9d={};_0x5d7e9d[_0x317633]={'$like':'%'+_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x42')]+'%'};return _0x5d7e9d;})});}if(_0x2cd0ce['query'][_0x1aa1('0x44')]){var _0x2452f8=_0x2cd0ce[_0x1aa1('0x2b')][_0x1aa1('0x44')][_0x1aa1('0x45')](',');var _0x3f6ad3={};_0x3f6ad3[_0x2452f8[0x0]]={'$gte':moment(_0x2452f8[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4277f4[_0x1aa1('0x43')]=_[_0x1aa1('0x46')](_0x4277f4[_0x1aa1('0x43')],_0x3f6ad3);}_0x4277f4=_['merge']({},_0x4277f4,_0x2cd0ce[_0x1aa1('0x47')]);return db['FaxMessage'][_0x1aa1('0x13')]({'where':_0x4277f4[_0x1aa1('0x43')]})['then'](function(_0x5773d1){_0x478f7d[_0x1aa1('0x13')]=_0x5773d1;if(_0x2cd0ce[_0x1aa1('0x2b')]['includeAll']){_0x4277f4[_0x1aa1('0x31')]=[{'all':!![]}];}return db[_0x1aa1('0x37')][_0x1aa1('0x48')](_0x4277f4);})['then'](function(_0x376458){_0x478f7d[_0x1aa1('0x49')]=_0x376458;return _0x478f7d;});}})['then'](respondWithFilteredResult(_0x25e7bf,_0x4277f4))[_0x1aa1('0x26')](handleError(_0x25e7bf,null));};exports['addTags']=function(_0x4214eb,_0x356d4b){return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x4214eb[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x356d4b,null))[_0x1aa1('0x17')](function(_0x27cabe){if(_0x27cabe){return _0x27cabe[_0x1aa1('0x4a')](_0x4214eb[_0x1aa1('0x34')][_0x1aa1('0x38')],_[_0x1aa1('0x39')](_0x4214eb['body'],[_0x1aa1('0x38'),'id'])||{})[_0x1aa1('0x4b')](function(){return db[_0x1aa1('0x4c')][_0x1aa1('0x48')]({'attributes':['id',_0x1aa1('0x1b'),_0x1aa1('0x4d')],'where':{'id':_0x4214eb[_0x1aa1('0x34')][_0x1aa1('0x38')]}});})['then'](function(_0xfe5377){socket[_0x1aa1('0x4e')](_0x1aa1('0x4f'),{'id':Number(_0x4214eb[_0x1aa1('0x28')]['id']),'tags':_0xfe5377||[]});return{'id':Number(_0x4214eb[_0x1aa1('0x28')]['id']),'tags':_0xfe5377||[]};});}})['then'](respondWithResult(_0x356d4b,null))['catch'](handleError(_0x356d4b,null));};exports['removeTags']=function(_0x3ceb2a,_0x106e54){return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x3ceb2a[_0x1aa1('0x28')]['id']}})[_0x1aa1('0x17')](handleEntityNotFound(_0x106e54,null))[_0x1aa1('0x17')](function(_0x4b07af){if(_0x4b07af){return _0x4b07af[_0x1aa1('0x50')](_0x3ceb2a['query'][_0x1aa1('0x38')]);}})[_0x1aa1('0x17')](respondWithStatusCode(_0x106e54,null))[_0x1aa1('0x26')](handleError(_0x106e54,null));};exports[_0x1aa1('0x51')]=function(_0x3cc834,_0x26c1a2){var _0x38161c=moment()[_0x1aa1('0x52')]()[_0x1aa1('0x53')]();var _0x1f5eb8=path[_0x1aa1('0x54')](config[_0x1aa1('0x55')],_0x1aa1('0x56'),_0x1aa1('0x57'),'tmp');var _0x366cf2=path[_0x1aa1('0x54')](config[_0x1aa1('0x55')],'server',_0x1aa1('0x57'),_0x1aa1('0x58'));var _0x3e3820=path[_0x1aa1('0x54')](_0x1f5eb8,_0x38161c);var _0x2023b3=util[_0x1aa1('0x59')](_0x1aa1('0x5a'),_0x3cc834['params']['id'],_0x38161c);var _0x369414=path[_0x1aa1('0x54')](_0x1f5eb8,_0x2023b3);var _0x34c2a1=[];_0x34c2a1[_0x1aa1('0x5b')]({'model':db[_0x1aa1('0x5c')],'as':'Attachment','raw':!![]});var _0x164db7=[{'model':db[_0x1aa1('0x37')],'as':_0x1aa1('0x5d'),'attributes':['id',_0x1aa1('0x34'),_0x1aa1('0x5e')],'include':_0x34c2a1}];return db[_0x1aa1('0x1f')][_0x1aa1('0x32')]({'where':{'id':_0x3cc834['params']['id']},'include':_0x164db7})[_0x1aa1('0x17')](handleEntityNotFound(_0x26c1a2,null))[_0x1aa1('0x17')](function(_0x31e0b8){if(_0x31e0b8&&_0x31e0b8[_0x1aa1('0x5d')]){var _0x3a946d=_0x31e0b8[_0x1aa1('0x5f')]({'plain':!![]});fs[_0x1aa1('0x60')](_0x3e3820);for(var _0x48e94a=0x0;_0x48e94a<_0x3a946d['Messages']['length'];_0x48e94a++){var _0x40b57e=_0x3a946d[_0x1aa1('0x5d')][_0x48e94a]['Attachment'];if(_0x40b57e){var _0x2d40f7=path[_0x1aa1('0x54')](_0x366cf2,_0x40b57e[_0x1aa1('0x61')]);if(fs[_0x1aa1('0x62')](_0x2d40f7)){fs[_0x1aa1('0x63')](_0x2d40f7)['pipe'](fs['createWriteStream'](path[_0x1aa1('0x54')](_0x3e3820,_0x40b57e[_0x1aa1('0x61')])));}}}return BPromise['resolve']()[_0x1aa1('0x17')](function(){return new BPromise(function(_0x10e2bd,_0x24ddc3){zipdir(_0x3e3820,{'saveTo':_0x369414},function(_0xc08798,_0x5f1175){if(_0xc08798)return _0x24ddc3(_0xc08798);return _0x10e2bd(_0x5f1175);});})[_0x1aa1('0x17')](function(){return new BPromise(function(_0xf678ba,_0x5a2224){rimraf(_0x3e3820,function(_0x3ef5e5){if(_0x3ef5e5)_0x5a2224(_0x3ef5e5);return _0xf678ba();});});})[_0x1aa1('0x17')](function(){return _0x26c1a2['download'](_0x369414,_0x2023b3,function(_0x3b2ce5){if(_0x3b2ce5){console[_0x1aa1('0x64')](_0x1aa1('0x65'),_0x3b2ce5);}else{fs[_0x1aa1('0x66')](_0x369414);}});});});}else{return _0x26c1a2['sendStatus'](0xc8);}})[_0x1aa1('0x26')](handleError(_0x26c1a2,null));};
\ No newline at end of file
+var _0xf377=['Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','err','rimraf','zip-dir','moment','bluebird','util','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','limit','count','offset','set','Content-Range','json','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','findAll','fax','query','user','params','keys','FaxInteraction','filters','model','attributes','fields','length','includeAll','merge','options','find','catch','create','body','describe','addMessage','ids','omit','intersection','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','include','addTags','setTags','spread','Tag','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment'];(function(_0x34b24d,_0x58ada7){var _0xecafca=function(_0x141b19){while(--_0x141b19){_0x34b24d['push'](_0x34b24d['shift']());}};_0xecafca(++_0x58ada7);}(_0xf377,0xd2));var _0x7f37=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xf377[_0x373dee];return _0x46798f;};'use strict';var rimraf=require(_0x7f37('0x0'));var zipdir=require(_0x7f37('0x1'));var moment=require(_0x7f37('0x2'));var BPromise=require(_0x7f37('0x3'));var util=require(_0x7f37('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x7f37('0x5'));var Redis=require('ioredis');var interaction=require(_0x7f37('0x6'));var qs=require(_0x7f37('0x7'));var logger=require(_0x7f37('0x8'))(_0x7f37('0x9'));var config=require(_0x7f37('0xa'));var db=require(_0x7f37('0xb'))['db'];config['redis']=_['defaults'](config[_0x7f37('0xc')],{'host':_0x7f37('0xd'),'port':0x18eb});var socket=require(_0x7f37('0xe'))(new Redis(config[_0x7f37('0xc')]));require(_0x7f37('0xf'))['register'](socket);function respondWithStatusCode(_0x38216c,_0x1f48d3){_0x1f48d3=_0x1f48d3||0xcc;return function(_0x589335){if(_0x589335){return _0x38216c[_0x7f37('0x10')](_0x1f48d3);}return _0x38216c[_0x7f37('0x11')](_0x1f48d3)[_0x7f37('0x12')]();};}function respondWithResult(_0x8d5a87,_0x5808af){_0x5808af=_0x5808af||0xc8;return function(_0x4d1161){if(_0x4d1161){return _0x8d5a87[_0x7f37('0x11')](_0x5808af)['json'](_0x4d1161);}};}function respondWithFilteredResult(_0x47f434,_0x59f49f){return function(_0x278d9f){if(_0x278d9f){var _0x179b62=typeof _0x59f49f['offset']==='undefined'&&typeof _0x59f49f[_0x7f37('0x13')]==='undefined';var _0x117d5a=_0x278d9f[_0x7f37('0x14')];var _0x820cd1=_0x179b62?0x0:_0x59f49f[_0x7f37('0x15')];var _0x15ab3a=_0x179b62?_0x278d9f[_0x7f37('0x14')]:_0x59f49f[_0x7f37('0x15')]+_0x59f49f[_0x7f37('0x13')];var _0xef104e;if(_0x15ab3a>=_0x117d5a){_0x15ab3a=_0x117d5a;_0xef104e=0xc8;}else{_0xef104e=0xce;}_0x47f434[_0x7f37('0x11')](_0xef104e);return _0x47f434[_0x7f37('0x16')](_0x7f37('0x17'),_0x820cd1+'-'+_0x15ab3a+'/'+_0x117d5a)[_0x7f37('0x18')](_0x278d9f);}return null;};}function saveUpdates(_0x1b952c){return function(_0x4af2ed){if(_0x4af2ed){return _0x4af2ed[_0x7f37('0x19')](_0x1b952c)['then'](function(_0x4c7933){return _0x4c7933;});}return null;};}function removeEntity(_0x53b27c){return function(_0x3e956b){if(_0x3e956b){return _0x3e956b[_0x7f37('0x1a')]()[_0x7f37('0x1b')](function(){_0x53b27c[_0x7f37('0x11')](0xcc)[_0x7f37('0x12')]();});}};}function handleEntityNotFound(_0x13491d){return function(_0x222fbf){if(!_0x222fbf){_0x13491d[_0x7f37('0x10')](0x194);}return _0x222fbf;};}function handleError(_0xd00828,_0x347902){_0x347902=_0x347902||0x1f4;return function(_0x4c7648){logger[_0x7f37('0x1c')](_0x4c7648[_0x7f37('0x1d')]);if(_0x4c7648[_0x7f37('0x1e')]){delete _0x4c7648[_0x7f37('0x1e')];}_0xd00828[_0x7f37('0x11')](_0x347902)[_0x7f37('0x1f')](_0x4c7648);};}exports[_0x7f37('0x20')]=function(_0x30f392,_0x1902c3){var _0x2f1e09={};var _0x23cbce=_[_0x7f37('0x21')](db['FaxInteraction'][_0x7f37('0x22')],function(_0x2f4a40){return{'name':_0x2f4a40[_0x7f37('0x23')],'type':_0x2f4a40[_0x7f37('0x24')][_0x7f37('0x25')]};});_0x2f1e09=qs['getOptions'](_0x23cbce,_0x30f392);return interaction[_0x7f37('0x26')](_0x7f37('0x27'),_0x30f392[_0x7f37('0x28')],_0x30f392[_0x7f37('0x29')],_0x2f1e09,_0x23cbce)['then'](respondWithFilteredResult(_0x1902c3,_0x2f1e09))['catch'](handleError(_0x1902c3,null));};exports['show']=function(_0x30f096,_0x2737c2){var _0x85d64d={'raw':![],'where':{'id':_0x30f096[_0x7f37('0x2a')]['id']}},_0x19fcd4={};_0x19fcd4['model']=_[_0x7f37('0x2b')](db[_0x7f37('0x2c')]['rawAttributes']);_0x19fcd4['query']=_['keys'](_0x30f096[_0x7f37('0x28')]);_0x19fcd4[_0x7f37('0x2d')]=_['intersection'](_0x19fcd4[_0x7f37('0x2e')],_0x19fcd4[_0x7f37('0x28')]);_0x85d64d[_0x7f37('0x2f')]=_['intersection'](_0x19fcd4[_0x7f37('0x2e')],qs[_0x7f37('0x30')](_0x30f096[_0x7f37('0x28')][_0x7f37('0x30')]));_0x85d64d[_0x7f37('0x2f')]=_0x85d64d['attributes'][_0x7f37('0x31')]?_0x85d64d[_0x7f37('0x2f')]:_0x19fcd4[_0x7f37('0x2e')];if(_0x30f096[_0x7f37('0x28')][_0x7f37('0x32')]){_0x85d64d['include']=[{'all':!![]}];}_0x85d64d=_[_0x7f37('0x33')]({},_0x85d64d,_0x30f096[_0x7f37('0x34')]);return db['FaxInteraction'][_0x7f37('0x35')](_0x85d64d)[_0x7f37('0x1b')](handleEntityNotFound(_0x2737c2,null))[_0x7f37('0x1b')](respondWithResult(_0x2737c2,null))[_0x7f37('0x36')](handleError(_0x2737c2,null));};exports[_0x7f37('0x37')]=function(_0x5e6f1e,_0x7eabf6){return db[_0x7f37('0x2c')][_0x7f37('0x37')](_0x5e6f1e[_0x7f37('0x38')],{})[_0x7f37('0x1b')](respondWithResult(_0x7eabf6,0xc9))[_0x7f37('0x36')](handleError(_0x7eabf6,null));};exports[_0x7f37('0x19')]=function(_0x4597bc,_0x2331e4){if(_0x4597bc['body']['id']){delete _0x4597bc['body']['id'];}return db[_0x7f37('0x2c')][_0x7f37('0x35')]({'where':{'id':_0x4597bc[_0x7f37('0x2a')]['id']}})[_0x7f37('0x1b')](handleEntityNotFound(_0x2331e4,null))['then'](saveUpdates(_0x4597bc[_0x7f37('0x38')],null))[_0x7f37('0x1b')](respondWithResult(_0x2331e4,null))[_0x7f37('0x36')](handleError(_0x2331e4,null));};exports['destroy']=function(_0x3a1e94,_0x1bc035){return db[_0x7f37('0x2c')]['find']({'where':{'id':_0x3a1e94[_0x7f37('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1bc035,null))['then'](removeEntity(_0x1bc035,null))[_0x7f37('0x36')](handleError(_0x1bc035,null));};exports[_0x7f37('0x39')]=function(_0x2c5af7,_0x44c1cb){return db[_0x7f37('0x2c')]['describe']()[_0x7f37('0x1b')](respondWithResult(_0x44c1cb,null))[_0x7f37('0x36')](handleError(_0x44c1cb,null));};exports[_0x7f37('0x3a')]=function(_0x440850,_0x165262){return db['FaxMessage']['find']({'where':{'id':_0x440850['params']['id']}})['then'](handleEntityNotFound(_0x165262,null))['then'](function(_0x1b7fb2){if(_0x1b7fb2){return _0x1b7fb2[_0x7f37('0x3a')](_0x440850['body'][_0x7f37('0x3b')],_[_0x7f37('0x3c')](_0x440850[_0x7f37('0x38')],[_0x7f37('0x3b'),'id'])||{});}})[_0x7f37('0x1b')](respondWithResult(_0x165262,null))['catch'](handleError(_0x165262,null));};exports['getMessages']=function(_0x31e66d,_0x23c08d){var _0x5028d4={'raw':![],'where':{}};var _0xd790cd={};var _0x38b9bc={'count':0x0,'rows':[]};return db[_0x7f37('0x2c')]['findOne']({'where':{'id':_0x31e66d['params']['id']}})[_0x7f37('0x1b')](handleEntityNotFound(_0x23c08d,null))[_0x7f37('0x1b')](function(_0x2768b1){if(_0x2768b1){_0xd790cd[_0x7f37('0x2e')]=_[_0x7f37('0x2b')](db['FaxMessage'][_0x7f37('0x22')]);_0xd790cd['query']=_['keys'](_0x31e66d[_0x7f37('0x28')]);_0xd790cd['filters']=_[_0x7f37('0x3d')](_0xd790cd[_0x7f37('0x2e')],_0xd790cd[_0x7f37('0x28')]);_0x5028d4['attributes']=_[_0x7f37('0x3d')](_0xd790cd[_0x7f37('0x2e')],qs[_0x7f37('0x30')](_0x31e66d['query'][_0x7f37('0x30')]));_0x5028d4[_0x7f37('0x2f')]=_0x5028d4[_0x7f37('0x2f')][_0x7f37('0x31')]?_0x5028d4['attributes']:_0xd790cd['model'];if(!_0x31e66d[_0x7f37('0x28')][_0x7f37('0x3e')](_0x7f37('0x3f'))){_0x5028d4[_0x7f37('0x13')]=qs['limit'](_0x31e66d['query'][_0x7f37('0x13')]);_0x5028d4['offset']=qs[_0x7f37('0x15')](_0x31e66d[_0x7f37('0x28')][_0x7f37('0x15')]);}_0x5028d4[_0x7f37('0x40')]=qs[_0x7f37('0x41')](_0x31e66d[_0x7f37('0x28')]['sort']);_0x5028d4[_0x7f37('0x42')]=qs['filters'](_[_0x7f37('0x43')](_0x31e66d['query'],_0xd790cd[_0x7f37('0x2d')]));_0x5028d4[_0x7f37('0x42')][_0x7f37('0x44')]=_0x2768b1['id'];if(_0x31e66d[_0x7f37('0x28')][_0x7f37('0x45')]){_0x5028d4[_0x7f37('0x42')]=_[_0x7f37('0x33')](_0x5028d4['where'],{'$or':_[_0x7f37('0x21')](_0x5028d4[_0x7f37('0x2f')],function(_0x10709c){var _0x2c1592={};_0x2c1592[_0x10709c]={'$like':'%'+_0x31e66d['query'][_0x7f37('0x45')]+'%'};return _0x2c1592;})});}if(_0x31e66d[_0x7f37('0x28')][_0x7f37('0x46')]){var _0xca249a=_0x31e66d['query']['$gte'][_0x7f37('0x47')](',');var _0x22deb5={};_0x22deb5[_0xca249a[0x0]]={'$gte':moment(_0xca249a[0x1])[_0x7f37('0x48')](_0x7f37('0x49'))};_0x5028d4[_0x7f37('0x42')]=_['merge'](_0x5028d4[_0x7f37('0x42')],_0x22deb5);}_0x5028d4=_['merge']({},_0x5028d4,_0x31e66d[_0x7f37('0x34')]);return db[_0x7f37('0x4a')][_0x7f37('0x14')]({'where':_0x5028d4[_0x7f37('0x42')]})['then'](function(_0x365add){_0x38b9bc['count']=_0x365add;if(_0x31e66d[_0x7f37('0x28')][_0x7f37('0x32')]){_0x5028d4[_0x7f37('0x4b')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5028d4);})[_0x7f37('0x1b')](function(_0x22c18d){_0x38b9bc['rows']=_0x22c18d;return _0x38b9bc;});}})[_0x7f37('0x1b')](respondWithFilteredResult(_0x23c08d,_0x5028d4))[_0x7f37('0x36')](handleError(_0x23c08d,null));};exports[_0x7f37('0x4c')]=function(_0x37094d,_0x1afb46){return db[_0x7f37('0x2c')][_0x7f37('0x35')]({'where':{'id':_0x37094d['params']['id']}})[_0x7f37('0x1b')](handleEntityNotFound(_0x1afb46,null))[_0x7f37('0x1b')](function(_0x321b0c){if(_0x321b0c){return _0x321b0c[_0x7f37('0x4d')](_0x37094d[_0x7f37('0x38')]['ids'],_[_0x7f37('0x3c')](_0x37094d['body'],[_0x7f37('0x3b'),'id'])||{})[_0x7f37('0x4e')](function(){return db[_0x7f37('0x4f')][_0x7f37('0x26')]({'attributes':['id',_0x7f37('0x1e'),'color'],'where':{'id':_0x37094d[_0x7f37('0x38')]['ids']}});})[_0x7f37('0x1b')](function(_0x55a77b){socket[_0x7f37('0x50')]('faxInteractionTags:save',{'id':Number(_0x37094d[_0x7f37('0x2a')]['id']),'tags':_0x55a77b||[]});return{'id':Number(_0x37094d[_0x7f37('0x2a')]['id']),'tags':_0x55a77b||[]};});}})['then'](respondWithResult(_0x1afb46,null))['catch'](handleError(_0x1afb46,null));};exports[_0x7f37('0x51')]=function(_0x5319bb,_0x4616cb){return db[_0x7f37('0x2c')][_0x7f37('0x35')]({'where':{'id':_0x5319bb['params']['id']}})[_0x7f37('0x1b')](handleEntityNotFound(_0x4616cb,null))[_0x7f37('0x1b')](function(_0x3578e4){if(_0x3578e4){return _0x3578e4[_0x7f37('0x51')](_0x5319bb[_0x7f37('0x28')][_0x7f37('0x3b')]);}})['then'](respondWithStatusCode(_0x4616cb,null))[_0x7f37('0x36')](handleError(_0x4616cb,null));};exports[_0x7f37('0x52')]=function(_0xdeffbd,_0x538d08){var _0x1a9d95=moment()[_0x7f37('0x53')]()[_0x7f37('0x54')]();var _0x51308e=path['join'](config[_0x7f37('0x55')],_0x7f37('0x56'),_0x7f37('0x57'),_0x7f37('0x58'));var _0x51825c=path[_0x7f37('0x59')](config[_0x7f37('0x55')],_0x7f37('0x56'),_0x7f37('0x57'),_0x7f37('0x5a'));var _0x2e587a=path[_0x7f37('0x59')](_0x51308e,_0x1a9d95);var _0x46bab3=util[_0x7f37('0x48')](_0x7f37('0x5b'),_0xdeffbd[_0x7f37('0x2a')]['id'],_0x1a9d95);var _0x47926d=path[_0x7f37('0x59')](_0x51308e,_0x46bab3);var _0x4bcbad=[];_0x4bcbad['push']({'model':db[_0x7f37('0x5c')],'as':_0x7f37('0x5c'),'raw':!![]});var _0x4d22e8=[{'model':db[_0x7f37('0x4a')],'as':_0x7f37('0x5d'),'attributes':['id',_0x7f37('0x38'),_0x7f37('0x5e')],'include':_0x4bcbad}];return db[_0x7f37('0x2c')]['find']({'where':{'id':_0xdeffbd['params']['id']},'include':_0x4d22e8})[_0x7f37('0x1b')](handleEntityNotFound(_0x538d08,null))[_0x7f37('0x1b')](function(_0x111004){if(_0x111004&&_0x111004[_0x7f37('0x5d')]){var _0x304b18=_0x111004[_0x7f37('0x5f')]({'plain':!![]});fs[_0x7f37('0x60')](_0x2e587a);for(var _0x55a091=0x0;_0x55a091<_0x304b18['Messages'][_0x7f37('0x31')];_0x55a091++){var _0x1bc6f7=_0x304b18[_0x7f37('0x5d')][_0x55a091][_0x7f37('0x5c')];if(_0x1bc6f7){var _0x510433=path[_0x7f37('0x59')](_0x51825c,_0x1bc6f7[_0x7f37('0x61')]);if(fs['existsSync'](_0x510433)){fs[_0x7f37('0x62')](_0x510433)[_0x7f37('0x63')](fs['createWriteStream'](path['join'](_0x2e587a,_0x1bc6f7['basename'])));}}}return BPromise['resolve']()[_0x7f37('0x1b')](function(){return new BPromise(function(_0x201f9e,_0x1a9566){zipdir(_0x2e587a,{'saveTo':_0x47926d},function(_0x53d6e6,_0xd6d4ca){if(_0x53d6e6)return _0x1a9566(_0x53d6e6);return _0x201f9e(_0xd6d4ca);});})[_0x7f37('0x1b')](function(){return new BPromise(function(_0x39dbf7,_0xd862d){rimraf(_0x2e587a,function(_0x419350){if(_0x419350)_0xd862d(_0x419350);return _0x39dbf7();});});})[_0x7f37('0x1b')](function(){return _0x538d08['download'](_0x47926d,_0x46bab3,function(_0x4ca6df){if(_0x4ca6df){console['log'](_0x7f37('0x64'),_0x4ca6df);}else{fs['unlinkSync'](_0x47926d);}});});});}else{return _0x538d08['sendStatus'](0xc8);}})[_0x7f37('0x36')](handleError(_0x538d08,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98b8=['update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x98b8,0x92));var _0x898b=function(_0x3b375e,_0x565734){_0x3b375e=_0x3b375e-0x0;var _0x55419f=_0x98b8[_0x3b375e];return _0x55419f;};'use strict';var EventEmitter=require(_0x898b('0x0'));var FaxInteraction=require(_0x898b('0x1'))['db'][_0x898b('0x2')];var FaxMessage=require(_0x898b('0x1'))['db'][_0x898b('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x898b('0x4')](0x0);var events={'afterCreate':_0x898b('0x5'),'afterUpdate':_0x898b('0x6'),'afterDestroy':_0x898b('0x7')};function emitEvent(_0x3b22ae){return function(_0x2ef732,_0x4ec78d,_0x323bfd){_0x2ef732[_0x898b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e9282){_0x2ef732[_0x898b('0x9')](_0x898b('0xa'),_0x1e9282['map'](function(_0x4502d9){return{'id':_0x4502d9['id']};}));return FaxMessage[_0x898b('0xb')]({'where':{'FaxInteractionId':_0x2ef732['id'],'direction':'in','read':![]},'raw':!![]});})[_0x898b('0xc')](function(_0x2e5cb3){_0x2ef732['setDataValue'](_0x898b('0xd'),_0x2e5cb3[_0x898b('0xe')]);FaxInteractionEvents[_0x898b('0xf')](_0x3b22ae+':'+_0x2ef732['id'],_0x2ef732);FaxInteractionEvents[_0x898b('0xf')](_0x3b22ae,_0x2ef732);_0x323bfd(null);})[_0x898b('0x10')](_0x323bfd(null));};}for(var e in events){if(events[_0x898b('0x11')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x898b('0x12')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x1741=['getUsers','Users','map','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','save','update','remove'];(function(_0x513eca,_0x593007){var _0x2c4e0b=function(_0x8886da){while(--_0x8886da){_0x513eca['push'](_0x513eca['shift']());}};_0x2c4e0b(++_0x593007);}(_0x1741,0x127));var _0x1174=function(_0x22342c,_0x218835){_0x22342c=_0x22342c-0x0;var _0xd3b434=_0x1741[_0x22342c];return _0xd3b434;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1174('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x1174('0x0'))['db'][_0x1174('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1174('0x2'),'afterUpdate':_0x1174('0x3'),'afterDestroy':_0x1174('0x4')};function emitEvent(_0x2aa63c){return function(_0x5b8165,_0x219db3,_0x2ddcfc){_0x5b8165[_0x1174('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4010ad){_0x5b8165['setDataValue'](_0x1174('0x6'),_0x4010ad[_0x1174('0x7')](function(_0x57ab81){return{'id':_0x57ab81['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5b8165['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1174('0x8')](function(_0x5311cb){_0x5b8165['setDataValue'](_0x1174('0x9'),_0x5311cb['length']);FaxInteractionEvents[_0x1174('0xa')](_0x2aa63c+':'+_0x5b8165['id'],_0x5b8165);FaxInteractionEvents[_0x1174('0xa')](_0x2aa63c,_0x5b8165);_0x2ddcfc(null);})[_0x1174('0xb')](_0x2ddcfc(null));};}for(var e in events){if(events[_0x1174('0xc')](e)){var event=events[e];FaxInteraction[_0x1174('0xd')](e,emitEvent(event));}}module[_0x1174('0xe')]=FaxInteractionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9fa0=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','closed','format'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x9fa0,0x6c));var _0x09fa=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9fa0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x09fa('0x0'));var moment=require(_0x09fa('0x1'));var BPromise=require(_0x09fa('0x2'));var rp=require(_0x09fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09fa('0x4'));var config=require(_0x09fa('0x5'));var attributes=require(_0x09fa('0x6'));module['exports']=function(_0xe2e03d,_0x5c10d2){return _0xe2e03d[_0x09fa('0x7')](_0x09fa('0x8'),attributes,{'tableName':_0x09fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1aefdb,_0x576a7c,_0x182728){if(_0x1aefdb['changed'](_0x09fa('0xa'))){_0x1aefdb['closedAt']=moment()[_0x09fa('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x182728(null,_0x1aefdb);}}});};
\ No newline at end of file
+var _0xfa7e=['bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment'];(function(_0x14917d,_0x2eb365){var _0x55630f=function(_0x125027){while(--_0x125027){_0x14917d['push'](_0x14917d['shift']());}};_0x55630f(++_0x2eb365);}(_0xfa7e,0xfc));var _0xefa7=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xfa7e[_0x339129];return _0x1570df;};'use strict';var _=require('lodash');var util=require(_0xefa7('0x0'));var logger=require('../../config/logger')(_0xefa7('0x1'));var moment=require(_0xefa7('0x2'));var BPromise=require(_0xefa7('0x3'));var rp=require(_0xefa7('0x4'));var fs=require('fs');var path=require(_0xefa7('0x5'));var rimraf=require('rimraf');var config=require(_0xefa7('0x6'));var attributes=require(_0xefa7('0x7'));module[_0xefa7('0x8')]=function(_0x3b9b84,_0x17babf){return _0x3b9b84[_0xefa7('0x9')](_0xefa7('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x519e65,_0x3f40a3,_0x289a78){if(_0x519e65[_0xefa7('0xb')]('closed')){_0x519e65[_0xefa7('0xc')]=moment()[_0xefa7('0xd')](_0xefa7('0xe'));}_0x289a78(null,_0x519e65);}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x306b=['then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x125f8b,_0x192ef7){var _0x54372d=function(_0xa9053c){while(--_0xa9053c){_0x125f8b['push'](_0x125f8b['shift']());}};_0x54372d(++_0x192ef7);}(_0x306b,0x73));var _0xb306=function(_0x47258d,_0x2dd8b8){_0x47258d=_0x47258d-0x0;var _0x1ed4ed=_0x306b[_0x47258d];return _0x1ed4ed;};'use strict';var _=require(_0xb306('0x0'));var util=require(_0xb306('0x1'));var moment=require(_0xb306('0x2'));var BPromise=require('bluebird');var rs=require(_0xb306('0x3'));var fs=require('fs');var Redis=require(_0xb306('0x4'));var db=require(_0xb306('0x5'))['db'];var utils=require(_0xb306('0x6'));var logger=require(_0xb306('0x7'))(_0xb306('0x8'));var config=require('../../config/environment');var jayson=require(_0xb306('0x9'));var client=jayson[_0xb306('0xa')][_0xb306('0xb')]({'port':0x232a});config[_0xb306('0xc')]=_[_0xb306('0xd')](config[_0xb306('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb306('0xe'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xb306('0xf')](socket);function respondWithRpcPromise(_0x35b409,_0x28beb3,_0x2ee090){return new BPromise(function(_0x5b62b8,_0x13e3e1){return client[_0xb306('0x10')](_0x35b409,_0x2ee090)[_0xb306('0x11')](function(_0x2213b8){logger[_0xb306('0x12')](_0xb306('0x13'),_0x28beb3,_0xb306('0x14'));logger[_0xb306('0x15')](_0xb306('0x16'),_0x28beb3,_0xb306('0x14'),JSON[_0xb306('0x17')](_0x2213b8));if(_0x2213b8[_0xb306('0x18')]){if(_0x2213b8[_0xb306('0x18')][_0xb306('0x19')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x28beb3,_0x2213b8[_0xb306('0x18')][_0xb306('0x1a')]);return _0x13e3e1(_0x2213b8[_0xb306('0x18')][_0xb306('0x1a')]);}logger[_0xb306('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x28beb3,_0x2213b8[_0xb306('0x18')]['message']);return _0x5b62b8(_0x2213b8['error'][_0xb306('0x1a')]);}else{logger[_0xb306('0x12')](_0xb306('0x13'),_0x28beb3,_0xb306('0x14'));_0x5b62b8(_0x2213b8[_0xb306('0x1b')][_0xb306('0x1a')]);}})['catch'](function(_0x455e83){logger['error'](_0xb306('0x13'),_0x28beb3,_0x455e83);_0x13e3e1(_0x455e83);});});}exports[_0xb306('0x1c')]=function(_0x5f27ce){var _0x282260=this;return new Promise(function(_0xd35892,_0x123a5d){return db[_0xb306('0x1d')][_0xb306('0x1e')](_0x5f27ce[_0xb306('0x1f')],{'raw':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce[_0xb306('0x20')][_0xb306('0x21')]||null:null,'attributes':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce[_0xb306('0x20')][_0xb306('0x22')]||null:null,'limit':_0x5f27ce[_0xb306('0x20')]?_0x5f27ce['options'][_0xb306('0x23')]||null:null})[_0xb306('0x11')](function(_0x5ed0cc){logger[_0xb306('0x12')](_0xb306('0x1c'),_0x5f27ce);logger[_0xb306('0x15')](_0xb306('0x1c'),_0x5f27ce,JSON[_0xb306('0x17')](_0x5ed0cc));_0xd35892(_0x5ed0cc);})[_0xb306('0x24')](function(_0xe61c2c){logger['error'](_0xb306('0x1c'),_0xe61c2c[_0xb306('0x1a')],_0x5f27ce);_0x123a5d(_0x282260[_0xb306('0x18')](0x1f4,_0xe61c2c[_0xb306('0x1a')]));});});};exports[_0xb306('0x25')]=function(_0x53990f){return new Promise(function(_0x3b3c6a,_0x4e7a4d){return db[_0xb306('0x1d')][_0xb306('0x26')]({'where':_0x53990f[_0xb306('0x20')]?_0x53990f[_0xb306('0x20')]['where']||null:null})[_0xb306('0x11')](function(_0x375b42){if(_0x375b42){return _0x375b42[_0xb306('0x27')](_0x53990f['body'][_0xb306('0x28')],_[_0xb306('0x29')](_0x53990f['body'],['ids','id'])||{});}})[_0xb306('0x2a')](function(_0x24685d){logger[_0xb306('0x12')](_0xb306('0x2b'),_0x53990f);logger[_0xb306('0x15')](_0xb306('0x2b'),_0x53990f,JSON['stringify'](_0x24685d));_0x3b3c6a(_0x24685d);})[_0xb306('0x24')](function(_0x50f494){logger[_0xb306('0x18')](_0xb306('0x2b'),_0x50f494[_0xb306('0x1a')],_0x53990f);_0x4e7a4d(_this[_0xb306('0x18')](0x1f4,_0x50f494[_0xb306('0x1a')]));});});};
\ No newline at end of file
+var _0x17c8=['FaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','update','body','options','where','limit'];(function(_0x438ccd,_0x570dc9){var _0x23c664=function(_0x24e125){while(--_0x24e125){_0x438ccd['push'](_0x438ccd['shift']());}};_0x23c664(++_0x570dc9);}(_0x17c8,0xc9));var _0x817c=function(_0x18e0f0,_0x25cd76){_0x18e0f0=_0x18e0f0-0x0;var _0x2ba2fc=_0x17c8[_0x18e0f0];return _0x2ba2fc;};'use strict';var _=require(_0x817c('0x0'));var util=require(_0x817c('0x1'));var moment=require('moment');var BPromise=require(_0x817c('0x2'));var rs=require(_0x817c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x817c('0x4'))['db'];var utils=require(_0x817c('0x5'));var logger=require(_0x817c('0x6'))(_0x817c('0x7'));var config=require(_0x817c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x817c('0x9')][_0x817c('0xa')]({'port':0x232a});config[_0x817c('0xb')]=_['defaults'](config[_0x817c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x817c('0xc'))(new Redis(config[_0x817c('0xb')]));require(_0x817c('0xd'))['register'](socket);function respondWithRpcPromise(_0x5a5c94,_0x4fd8dd,_0x44a80d){return new BPromise(function(_0x1fcfbf,_0x52d054){return client[_0x817c('0xe')](_0x5a5c94,_0x44a80d)[_0x817c('0xf')](function(_0x23c7ca){logger['info'](_0x817c('0x10'),_0x4fd8dd,'request\x20sent');logger[_0x817c('0x11')](_0x817c('0x12'),_0x4fd8dd,_0x817c('0x13'),JSON[_0x817c('0x14')](_0x23c7ca));if(_0x23c7ca[_0x817c('0x15')]){if(_0x23c7ca[_0x817c('0x15')][_0x817c('0x16')]===0x1f4){logger[_0x817c('0x15')](_0x817c('0x10'),_0x4fd8dd,_0x23c7ca['error'][_0x817c('0x17')]);return _0x52d054(_0x23c7ca['error'][_0x817c('0x17')]);}logger[_0x817c('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x4fd8dd,_0x23c7ca['error'][_0x817c('0x17')]);return _0x1fcfbf(_0x23c7ca[_0x817c('0x15')]['message']);}else{logger[_0x817c('0x18')](_0x817c('0x10'),_0x4fd8dd,'request\x20sent');_0x1fcfbf(_0x23c7ca[_0x817c('0x19')]['message']);}})[_0x817c('0x1a')](function(_0x3f6f05){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x4fd8dd,_0x3f6f05);_0x52d054(_0x3f6f05);});});}exports[_0x817c('0x1b')]=function(_0x1dacfa){var _0x38717a=this;return new Promise(function(_0xdcae30,_0x30a544){return db['FaxInteraction'][_0x817c('0x1c')](_0x1dacfa[_0x817c('0x1d')],{'raw':_0x1dacfa['options']?_0x1dacfa[_0x817c('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dacfa['options']?_0x1dacfa[_0x817c('0x1e')][_0x817c('0x1f')]||null:null,'attributes':_0x1dacfa[_0x817c('0x1e')]?_0x1dacfa['options']['attributes']||null:null,'limit':_0x1dacfa['options']?_0x1dacfa[_0x817c('0x1e')][_0x817c('0x20')]||null:null})[_0x817c('0xf')](function(_0xe4e553){logger[_0x817c('0x18')](_0x817c('0x1b'),_0x1dacfa);logger[_0x817c('0x11')](_0x817c('0x1b'),_0x1dacfa,JSON[_0x817c('0x14')](_0xe4e553));_0xdcae30(_0xe4e553);})['catch'](function(_0x56c235){logger[_0x817c('0x15')](_0x817c('0x1b'),_0x56c235[_0x817c('0x17')],_0x1dacfa);_0x30a544(_0x38717a[_0x817c('0x15')](0x1f4,_0x56c235['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x23cbfd){return new Promise(function(_0x53c8e7,_0x34d57b){return db[_0x817c('0x21')][_0x817c('0x22')]({'where':_0x23cbfd[_0x817c('0x1e')]?_0x23cbfd[_0x817c('0x1e')][_0x817c('0x1f')]||null:null})[_0x817c('0xf')](function(_0x17da97){if(_0x17da97){return _0x17da97[_0x817c('0x23')](_0x23cbfd['body'][_0x817c('0x24')],_['omit'](_0x23cbfd[_0x817c('0x1d')],[_0x817c('0x24'),'id'])||{});}})[_0x817c('0x25')](function(_0x36ecdd){logger[_0x817c('0x18')](_0x817c('0x26'),_0x23cbfd);logger[_0x817c('0x11')](_0x817c('0x26'),_0x23cbfd,JSON[_0x817c('0x14')](_0x36ecdd));_0x53c8e7(_0x36ecdd);})[_0x817c('0x1a')](function(_0x30accd){logger['error'](_0x817c('0x26'),_0x30accd[_0x817c('0x17')],_0x23cbfd);_0x34d57b(_this['error'](0x1f4,_0x30accd['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc90a=['update','register','length','./faxInteraction.events','save','remove'];(function(_0x1d0626,_0x4b460){var _0x550c0a=function(_0xc345d6){while(--_0xc345d6){_0x1d0626['push'](_0x1d0626['shift']());}};_0x550c0a(++_0x4b460);}(_0xc90a,0x99));var _0xac90=function(_0x3fe9f5,_0x2c302b){_0x3fe9f5=_0x3fe9f5-0x0;var _0x5acbb4=_0xc90a[_0x3fe9f5];return _0x5acbb4;};'use strict';var FaxInteractionEvents=require(_0xac90('0x0'));var events=[_0xac90('0x1'),_0xac90('0x2'),_0xac90('0x3')];function createListener(_0x4a6228,_0x3c0966){return function(_0x48e5cc){_0x3c0966['emit'](_0x4a6228,_0x48e5cc);};}function removeListener(_0x1171ea,_0x15f908){return function(){FaxInteractionEvents['removeListener'](_0x1171ea,_0x15f908);};}exports[_0xac90('0x4')]=function(_0x1cf4c9){for(var _0x1cfc4c=0x0,_0x1d39da=events[_0xac90('0x5')];_0x1cfc4c<_0x1d39da;_0x1cfc4c++){var _0x4092a1=events[_0x1cfc4c];var _0x5b66c3=createListener('faxInteraction:'+_0x4092a1,_0x1cf4c9);FaxInteractionEvents['on'](_0x4092a1,_0x5b66c3);}};
\ No newline at end of file
+var _0x879a=['./faxInteraction.events','save','remove','emit','removeListener','length','faxInteraction:'];(function(_0x350851,_0x38caca){var _0x3ad08e=function(_0x56ed05){while(--_0x56ed05){_0x350851['push'](_0x350851['shift']());}};_0x3ad08e(++_0x38caca);}(_0x879a,0xd2));var _0xa879=function(_0x285e30,_0x2e8e67){_0x285e30=_0x285e30-0x0;var _0x4c3e20=_0x879a[_0x285e30];return _0x4c3e20;};'use strict';var FaxInteractionEvents=require(_0xa879('0x0'));var events=[_0xa879('0x1'),_0xa879('0x2'),'update'];function createListener(_0x47dc91,_0x3616b6){return function(_0x148d0a){_0x3616b6[_0xa879('0x3')](_0x47dc91,_0x148d0a);};}function removeListener(_0x266e82,_0x37a88f){return function(){FaxInteractionEvents[_0xa879('0x4')](_0x266e82,_0x37a88f);};}exports['register']=function(_0x487295){for(var _0x3a527d=0x0,_0x573d3c=events[_0xa879('0x5')];_0x3a527d<_0x573d3c;_0x3a527d++){var _0x1a9b37=events[_0x3a527d];var _0x315171=createListener(_0xa879('0x6')+_0x1a9b37,_0x487295);FaxInteractionEvents['on'](_0x1a9b37,_0x315171);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd36=['faxinteraction:update','update','delete','tracked','faxinteraction:destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','fax','faxinteraction:addtags','addTags','put'];(function(_0x460998,_0x31c609){var _0x53b613=function(_0x261787){while(--_0x261787){_0x460998['push'](_0x460998['shift']());}};_0x53b613(++_0x31c609);}(_0xbd36,0x127));var _0x6bd3=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xbd36[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6bd3('0x0'));var timeout=require(_0x6bd3('0x1'));var express=require(_0x6bd3('0x2'));var router=express['Router']();var fs_extra=require(_0x6bd3('0x3'));var auth=require(_0x6bd3('0x4'));var interaction=require(_0x6bd3('0x5'));var config=require(_0x6bd3('0x6'));var controller=require(_0x6bd3('0x7'));router[_0x6bd3('0x8')]('/',auth[_0x6bd3('0x9')](),controller[_0x6bd3('0xa')]);router[_0x6bd3('0x8')](_0x6bd3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6bd3('0x8')](_0x6bd3('0xc'),auth[_0x6bd3('0x9')](),controller[_0x6bd3('0xd')]);router[_0x6bd3('0x8')](_0x6bd3('0xe'),auth[_0x6bd3('0x9')](),controller[_0x6bd3('0xf')]);router[_0x6bd3('0x8')](_0x6bd3('0x10'),auth[_0x6bd3('0x9')](),controller[_0x6bd3('0x11')]);router[_0x6bd3('0x12')]('/',auth['isAuthenticated'](),controller[_0x6bd3('0x13')]);router[_0x6bd3('0x12')](_0x6bd3('0xe'),auth[_0x6bd3('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x6bd3('0x9')](),interaction['tracked'](_0x6bd3('0x14'),_0x6bd3('0x15')),controller[_0x6bd3('0x16')]);router[_0x6bd3('0x17')](_0x6bd3('0xc'),auth[_0x6bd3('0x9')](),interaction['tracked']('fax',_0x6bd3('0x18')),controller[_0x6bd3('0x19')]);router[_0x6bd3('0x1a')](_0x6bd3('0xc'),auth['isAuthenticated'](),interaction[_0x6bd3('0x1b')](_0x6bd3('0x14'),_0x6bd3('0x1c')),controller['destroy']);router[_0x6bd3('0x1a')]('/:id/tags',auth[_0x6bd3('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x5977=['faxinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','tracked','faxinteraction:update','update','delete','/:id'];(function(_0xfadded,_0x5070c1){var _0x4e7edf=function(_0x1765c3){while(--_0x1765c3){_0xfadded['push'](_0xfadded['shift']());}};_0x4e7edf(++_0x5070c1);}(_0x5977,0xeb));var _0x7597=function(_0x20d230,_0x3e119f){_0x20d230=_0x20d230-0x0;var _0x479091=_0x5977[_0x20d230];return _0x479091;};'use strict';var multer=require(_0x7597('0x0'));var util=require(_0x7597('0x1'));var path=require(_0x7597('0x2'));var timeout=require('connect-timeout');var express=require(_0x7597('0x3'));var router=express[_0x7597('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7597('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7597('0x6'));var controller=require('./faxInteraction.controller');router[_0x7597('0x7')]('/',auth[_0x7597('0x8')](),controller['index']);router['get']('/describe',auth[_0x7597('0x8')](),controller[_0x7597('0x9')]);router['get']('/:id',auth[_0x7597('0x8')](),controller['show']);router['get'](_0x7597('0xa'),auth[_0x7597('0x8')](),controller[_0x7597('0xb')]);router[_0x7597('0x7')](_0x7597('0xc'),auth['isAuthenticated'](),controller[_0x7597('0xd')]);router[_0x7597('0xe')]('/',auth[_0x7597('0x8')](),controller[_0x7597('0xf')]);router[_0x7597('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0x7597('0x10')]);router[_0x7597('0xe')](_0x7597('0x11'),auth[_0x7597('0x8')](),interaction['tracked'](_0x7597('0x12'),_0x7597('0x13')),controller[_0x7597('0x14')]);router['put']('/:id',auth[_0x7597('0x8')](),interaction[_0x7597('0x15')]('fax',_0x7597('0x16')),controller[_0x7597('0x17')]);router[_0x7597('0x18')](_0x7597('0x19'),auth[_0x7597('0x8')](),interaction[_0x7597('0x15')](_0x7597('0x12'),_0x7597('0x1a')),controller[_0x7597('0x1b')]);router[_0x7597('0x18')]('/:id/tags',auth[_0x7597('0x8')](),controller[_0x7597('0x1c')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x94dc=['ENUM','out','DATE','sequelize','TEXT','BOOLEAN'];(function(_0x1f6390,_0x42ac64){var _0x563851=function(_0x80b9fa){while(--_0x80b9fa){_0x1f6390['push'](_0x1f6390['shift']());}};_0x563851(++_0x42ac64);}(_0x94dc,0xb1));var _0xc94d=function(_0x37cedc,_0x494316){_0x37cedc=_0x37cedc-0x0;var _0x3a6f33=_0x94dc[_0x37cedc];return _0x3a6f33;};'use strict';var Sequelize=require(_0xc94d('0x0'));module['exports']={'body':{'type':Sequelize[_0xc94d('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc94d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc94d('0x3')]('in',_0xc94d('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xc94d('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xc94d('0x5')]}};
\ No newline at end of file
+var _0xcab6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4413a1,_0x55a868){var _0x184cf3=function(_0x52db9b){while(--_0x52db9b){_0x4413a1['push'](_0x4413a1['shift']());}};_0x184cf3(++_0x55a868);}(_0xcab6,0xd4));var _0x6cab=function(_0x4bf459,_0x590e83){_0x4bf459=_0x4bf459-0x0;var _0x1cea91=_0xcab6[_0x4bf459];return _0x1cea91;};'use strict';var Sequelize=require(_0x6cab('0x0'));module['exports']={'body':{'type':Sequelize[_0x6cab('0x1')](_0x6cab('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6cab('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6cab('0x4')]('in',_0x6cab('0x5')),'defaultValue':_0x6cab('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6cab('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5b5=['moment','bluebird','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','sendStatus','stack','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','body','FaxMessage','find','params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','rejectMessage','Sequelize','QueryTypes','contact','EventManager','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0xf5b5,0x115));var _0x5f5b=function(_0x744f1a,_0xb0ba39){_0x744f1a=_0x744f1a-0x0;var _0x212ce6=_0xf5b5[_0x744f1a];return _0x212ce6;};'use strict';var emlformat=require(_0x5f5b('0x0'));var rimraf=require(_0x5f5b('0x1'));var zipdir=require(_0x5f5b('0x2'));var jsonpatch=require(_0x5f5b('0x3'));var rp=require(_0x5f5b('0x4'));var moment=require(_0x5f5b('0x5'));var BPromise=require(_0x5f5b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5f5b('0x7'));var sox=require('sox');var csv=require(_0x5f5b('0x8'));var ejs=require(_0x5f5b('0x9'));var fs=require('fs');var fs_extra=require(_0x5f5b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f5b('0xb'));var jsforce=require(_0x5f5b('0xc'));var deskjs=require(_0x5f5b('0xd'));var toCsv=require(_0x5f5b('0x8'));var querystring=require('querystring');var Papa=require(_0x5f5b('0xe'));var Redis=require(_0x5f5b('0xf'));var authService=require(_0x5f5b('0x10'));var qs=require(_0x5f5b('0x11'));var as=require(_0x5f5b('0x12'));var hardwareService=require(_0x5f5b('0x13'));var logger=require(_0x5f5b('0x14'))('api');var utils=require(_0x5f5b('0x15'));var config=require(_0x5f5b('0x16'));var licenseUtil=require(_0x5f5b('0x17'));var db=require(_0x5f5b('0x18'))['db'];config[_0x5f5b('0x19')]=_[_0x5f5b('0x1a')](config[_0x5f5b('0x19')],{'host':_0x5f5b('0x1b'),'port':0x18eb});var socket=require(_0x5f5b('0x1c'))(new Redis(config['redis']));require(_0x5f5b('0x1d'))['register'](socket);var jayson=require(_0x5f5b('0x1e'));var client=jayson[_0x5f5b('0x1f')][_0x5f5b('0x20')]({'port':0x232c});var client9002=jayson[_0x5f5b('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3676a6,_0xee9da3,_0xcd7fc7,_0x1f5dfb){return new BPromise(function(_0x2e660c,_0x181499){var _0x354edb=_0x1f5dfb||client;return _0x354edb[_0x5f5b('0x21')](_0x3676a6,_0xcd7fc7)[_0x5f5b('0x22')](function(_0x268571){logger[_0x5f5b('0x23')](_0x5f5b('0x24'),_0xee9da3,'request\x20sent');logger[_0x5f5b('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xee9da3,_0x5f5b('0x26'),JSON[_0x5f5b('0x27')](_0x268571));if(_0x268571[_0x5f5b('0x28')]){if(_0x268571[_0x5f5b('0x28')][_0x5f5b('0x29')]===0x1f4){logger[_0x5f5b('0x28')]('FaxMessage,\x20%s,\x20%s',_0xee9da3,_0x268571['error']['message']);return _0x181499(_0x268571[_0x5f5b('0x28')][_0x5f5b('0x2a')]);}logger[_0x5f5b('0x28')](_0x5f5b('0x24'),_0xee9da3,_0x268571[_0x5f5b('0x28')][_0x5f5b('0x2a')]);return _0x2e660c(_0x268571[_0x5f5b('0x28')][_0x5f5b('0x2a')]);}else{logger[_0x5f5b('0x23')](_0x5f5b('0x24'),_0xee9da3,_0x5f5b('0x26'));_0x2e660c(_0x268571[_0x5f5b('0x2b')][_0x5f5b('0x2a')]);}})[_0x5f5b('0x2c')](function(_0x54da1e){logger[_0x5f5b('0x28')](_0x5f5b('0x24'),_0xee9da3,_0x54da1e);_0x181499(_0x54da1e);});});}function respondWithStatusCode(_0x39c77d,_0x403293){_0x403293=_0x403293||0xcc;return function(_0x2de4d3){if(_0x2de4d3){return _0x39c77d['sendStatus'](_0x403293);}return _0x39c77d[_0x5f5b('0x2d')](_0x403293)[_0x5f5b('0x2e')]();};}function respondWithResult(_0x39ee81,_0x382592){_0x382592=_0x382592||0xc8;return function(_0x3c5aa1){if(_0x3c5aa1){return _0x39ee81[_0x5f5b('0x2d')](_0x382592)[_0x5f5b('0x2f')](_0x3c5aa1);}};}function respondWithFilteredResult(_0x2c8f11,_0x36b94f){return function(_0x4f6394){if(_0x4f6394){var _0x1c4d98=typeof _0x36b94f[_0x5f5b('0x30')]==='undefined'&&typeof _0x36b94f[_0x5f5b('0x31')]===_0x5f5b('0x32');var _0xe314fe=_0x4f6394['count'];var _0x2d618a=_0x1c4d98?0x0:_0x36b94f[_0x5f5b('0x30')];var _0x5f3484=_0x1c4d98?_0x4f6394[_0x5f5b('0x33')]:_0x36b94f[_0x5f5b('0x30')]+_0x36b94f[_0x5f5b('0x31')];var _0x442549;if(_0x5f3484>=_0xe314fe){_0x5f3484=_0xe314fe;_0x442549=0xc8;}else{_0x442549=0xce;}_0x2c8f11[_0x5f5b('0x2d')](_0x442549);return _0x2c8f11['set'](_0x5f5b('0x34'),_0x2d618a+'-'+_0x5f3484+'/'+_0xe314fe)[_0x5f5b('0x2f')](_0x4f6394);}return null;};}function patchUpdates(_0x14301b){return function(_0x2cae84){try{jsonpatch['apply'](_0x2cae84,_0x14301b,!![]);}catch(_0x4e91d0){return BPromise[_0x5f5b('0x35')](_0x4e91d0);}return _0x2cae84['save']();};}function saveUpdates(_0x3a9588,_0x2e5bc4){return function(_0x5b4ab5){if(_0x5b4ab5){return _0x5b4ab5[_0x5f5b('0x36')](_0x3a9588)[_0x5f5b('0x22')](function(_0x4c7b32){return _0x4c7b32;});}return null;};}function removeEntity(_0x5b4a70,_0x279c5c){return function(_0x55c839){if(_0x55c839){return _0x55c839[_0x5f5b('0x37')]()['then'](function(){_0x5b4a70[_0x5f5b('0x2d')](0xcc)[_0x5f5b('0x2e')]();});}};}function handleEntityNotFound(_0x1ebd59,_0x46e5ee){return function(_0x409970){if(!_0x409970){_0x1ebd59[_0x5f5b('0x38')](0x194);}return _0x409970;};}function handleError(_0x404299,_0x111720){_0x111720=_0x111720||0x1f4;return function(_0xe27594){logger[_0x5f5b('0x28')](_0xe27594[_0x5f5b('0x39')]);if(_0xe27594['name']){delete _0xe27594['name'];}_0x404299[_0x5f5b('0x2d')](_0x111720)['send'](_0xe27594);};}exports[_0x5f5b('0x3a')]=function(_0x35ad66,_0x183832){var _0x777827={},_0x278e46={},_0x2d6a41={'count':0x0,'rows':[]};var _0x5a9199=_[_0x5f5b('0x3b')](db['FaxMessage']['rawAttributes'],function(_0x36dd82){return{'name':_0x36dd82[_0x5f5b('0x3c')],'type':_0x36dd82[_0x5f5b('0x3d')][_0x5f5b('0x3e')]};});_0x278e46[_0x5f5b('0x3f')]=_[_0x5f5b('0x3b')](_0x5a9199,_0x5f5b('0x40'));_0x278e46[_0x5f5b('0x41')]=_[_0x5f5b('0x42')](_0x35ad66[_0x5f5b('0x41')]);_0x278e46[_0x5f5b('0x43')]=_[_0x5f5b('0x44')](_0x278e46[_0x5f5b('0x3f')],_0x278e46[_0x5f5b('0x41')]);_0x777827[_0x5f5b('0x45')]=_[_0x5f5b('0x44')](_0x278e46['model'],qs[_0x5f5b('0x46')](_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x46')]));_0x777827[_0x5f5b('0x45')]=_0x777827[_0x5f5b('0x45')][_0x5f5b('0x47')]?_0x777827[_0x5f5b('0x45')]:_0x278e46[_0x5f5b('0x3f')];if(!_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x48')]('nolimit')){_0x777827[_0x5f5b('0x31')]=qs[_0x5f5b('0x31')](_0x35ad66['query'][_0x5f5b('0x31')]);_0x777827[_0x5f5b('0x30')]=qs[_0x5f5b('0x30')](_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x30')]);}_0x777827[_0x5f5b('0x49')]=qs[_0x5f5b('0x4a')](_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x4a')]);_0x777827[_0x5f5b('0x4b')]=qs['filters'](_[_0x5f5b('0x4c')](_0x35ad66['query'],_0x278e46['filters']),_0x5a9199);if(_0x35ad66[_0x5f5b('0x41')]['filter']){_0x777827[_0x5f5b('0x4b')]=_[_0x5f5b('0x4d')](_0x777827[_0x5f5b('0x4b')],{'$or':_['map'](_0x5a9199,function(_0x53a283){if(_0x53a283[_0x5f5b('0x3d')]!==_0x5f5b('0x4e')){var _0xe4c696={};_0xe4c696[_0x53a283['name']]={'$like':'%'+_0x35ad66[_0x5f5b('0x41')][_0x5f5b('0x4f')]+'%'};return _0xe4c696;}})});}_0x777827=_['merge']({},_0x777827,_0x35ad66[_0x5f5b('0x50')]);var _0x4c21de={'where':_0x777827[_0x5f5b('0x4b')]};return db['FaxMessage'][_0x5f5b('0x33')](_0x4c21de)['then'](function(_0x305077){_0x2d6a41['count']=_0x305077;if(_0x35ad66['query'][_0x5f5b('0x51')]){_0x777827[_0x5f5b('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x777827);})[_0x5f5b('0x22')](function(_0x23db78){_0x2d6a41[_0x5f5b('0x53')]=_0x23db78;return _0x2d6a41;})[_0x5f5b('0x22')](respondWithFilteredResult(_0x183832,_0x777827))[_0x5f5b('0x2c')](handleError(_0x183832,null));};exports[_0x5f5b('0x54')]=function(_0x54592a,_0x3e3b55){var _0x255d59={'raw':!![],'where':{'id':_0x54592a['params']['id']}},_0x22908f={};_0x22908f['model']=_[_0x5f5b('0x42')](db['FaxMessage']['rawAttributes']);_0x22908f[_0x5f5b('0x41')]=_[_0x5f5b('0x42')](_0x54592a[_0x5f5b('0x41')]);_0x22908f['filters']=_[_0x5f5b('0x44')](_0x22908f[_0x5f5b('0x3f')],_0x22908f[_0x5f5b('0x41')]);_0x255d59[_0x5f5b('0x45')]=_[_0x5f5b('0x44')](_0x22908f[_0x5f5b('0x3f')],qs[_0x5f5b('0x46')](_0x54592a[_0x5f5b('0x41')][_0x5f5b('0x46')]));_0x255d59['attributes']=_0x255d59[_0x5f5b('0x45')][_0x5f5b('0x47')]?_0x255d59[_0x5f5b('0x45')]:_0x22908f[_0x5f5b('0x3f')];if(_0x54592a[_0x5f5b('0x41')][_0x5f5b('0x51')]){_0x255d59[_0x5f5b('0x52')]=[{'all':!![]}];}_0x255d59=_[_0x5f5b('0x4d')]({},_0x255d59,_0x54592a[_0x5f5b('0x50')]);return db['FaxMessage']['find'](_0x255d59)[_0x5f5b('0x22')](handleEntityNotFound(_0x3e3b55,null))[_0x5f5b('0x22')](respondWithResult(_0x3e3b55,null))['catch'](handleError(_0x3e3b55,null));};exports[_0x5f5b('0x36')]=function(_0x502f17,_0x3049d6){if(_0x502f17['body']['id']){delete _0x502f17[_0x5f5b('0x55')]['id'];}return db[_0x5f5b('0x56')][_0x5f5b('0x57')]({'where':{'id':_0x502f17[_0x5f5b('0x58')]['id']}})[_0x5f5b('0x22')](handleEntityNotFound(_0x3049d6,null))[_0x5f5b('0x22')](saveUpdates(_0x502f17[_0x5f5b('0x55')],null))[_0x5f5b('0x22')](respondWithResult(_0x3049d6,null))[_0x5f5b('0x2c')](handleError(_0x3049d6,null));};exports['destroy']=function(_0x584ab7,_0xa283e7){return db['FaxMessage'][_0x5f5b('0x57')]({'where':{'id':_0x584ab7[_0x5f5b('0x58')]['id']}})[_0x5f5b('0x22')](handleEntityNotFound(_0xa283e7,null))['then'](removeEntity(_0xa283e7,null))[_0x5f5b('0x2c')](handleError(_0xa283e7,null));};exports[_0x5f5b('0x59')]=function(_0x57d983,_0x641b0d){return db[_0x5f5b('0x56')][_0x5f5b('0x59')]()['then'](respondWithResult(_0x641b0d,null))[_0x5f5b('0x2c')](handleError(_0x641b0d,null));};var interaction_log=require(_0x5f5b('0x14'))(_0x5f5b('0x5a'));exports[_0x5f5b('0x5b')]=function(_0x2b4230,_0x1dbfd9,_0x53ab36){var _0x20f9d1={'agent':{},'channel':_0x5f5b('0x5c')};if(_0x2b4230[_0x5f5b('0x55')]['id']){delete _0x2b4230[_0x5f5b('0x55')]['id'];}_0x2b4230['body']['read']=!![];_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x5d')]=moment()[_0x5f5b('0x5e')](_0x5f5b('0x5f'));_0x2b4230['body'][_0x5f5b('0x60')]=_0x2b4230['body'][_0x5f5b('0x60')]||_0x2b4230['user']['id'];_0x20f9d1['agent']['id']=_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')];return db[_0x5f5b('0x56')][_0x5f5b('0x57')]({'where':{'id':_0x2b4230[_0x5f5b('0x58')]['id'],'UserId':null}})[_0x5f5b('0x22')](handleEntityNotFound(_0x1dbfd9,null))[_0x5f5b('0x22')](saveUpdates(_0x2b4230[_0x5f5b('0x55')],null))[_0x5f5b('0x22')](function(_0x316b5f){if(_0x316b5f){_0x20f9d1[_0x5f5b('0x2a')]=_0x316b5f['get']({'plain':!![]});return db[_0x5f5b('0x61')][_0x5f5b('0x57')]({'where':{'id':_0x316b5f[_0x5f5b('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1dbfd9,null))[_0x5f5b('0x22')](function(_0x2a9ff7){if(_0x2a9ff7){return _0x2a9ff7['update']({'UserId':_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')],'read1stAt':_[_0x5f5b('0x63')](_0x2a9ff7[_0x5f5b('0x64')])?moment()[_0x5f5b('0x5e')](_0x5f5b('0x5f')):undefined});}return null;})[_0x5f5b('0x22')](function(_0x183096){if(_0x183096){_0x20f9d1[_0x5f5b('0x65')]=_0x183096[_0x5f5b('0x66')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b4230[_0x5f5b('0x67')]['id'],_0x2b4230[_0x5f5b('0x67')]['name'],_0x2b4230[_0x5f5b('0x67')][_0x5f5b('0x68')],_0x20f9d1['interaction']['id'],_0x2b4230[_0x5f5b('0x55')]?JSON[_0x5f5b('0x27')](_0x2b4230[_0x5f5b('0x55')]):_0x5f5b('0x69'));return respondWithRpcPromise(_0x5f5b('0x6a'),_0x5f5b('0x6b'),_0x20f9d1);}return null;})[_0x5f5b('0x22')](function(_0x3c9718){var _0x2a93c3=_0x5f5b('0x6c')+_0x3c9718[_0x5f5b('0x2a')][_0x5f5b('0x6d')];return db[_0x5f5b('0x6e')][_0x5f5b('0x41')](_0x2a93c3,{'type':db['Sequelize']['QueryTypes'][_0x5f5b('0x6f')],'raw':!![]})[_0x5f5b('0x22')](function(_0x5d2aeb){return _0x5d2aeb;});})[_0x5f5b('0x22')](function(_0x44c94a){if(_0x44c94a){_0x20f9d1[_0x5f5b('0x2a')]['contact']=_0x44c94a[0x0];if(!_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')])return;return db[_0x5f5b('0x70')][_0x5f5b('0x57')]({'where':{'id':_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x60')],'role':_0x5f5b('0x71')},'attributes':['id',_0x5f5b('0x40'),_0x5f5b('0x72'),_0x5f5b('0x73'),_0x5f5b('0x74')],'raw':!![]});}return null;})[_0x5f5b('0x22')](function(_0x341b2a){if(!_0x341b2a)return null;_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x71')]=_0x341b2a;return _0x20f9d1;})['then'](function(_0x59f2b3){if(_0x59f2b3){if(_0x2b4230[_0x5f5b('0x55')][_0x5f5b('0x75')]){_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x76')]=util['format'](_0x5f5b('0x77'),_0x2b4230[_0x5f5b('0x67')][_0x5f5b('0x40')]);_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x78')]=_0x20f9d1[_0x5f5b('0x78')];_0x20f9d1[_0x5f5b('0x2a')][_0x5f5b('0x79')]=_0x20f9d1[_0x5f5b('0x78')];_0x20f9d1[_0x5f5b('0x2a')]['event']=_0x5f5b('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5f5b('0x7a'),'message':_0x20f9d1['message']},client9002)[_0x5f5b('0x22')](function(){return _0x20f9d1;});}return _0x20f9d1;}return null;})[_0x5f5b('0x22')](respondWithResult(_0x1dbfd9,null))[_0x5f5b('0x2c')](handleError(_0x1dbfd9,null));};var interaction_log=require(_0x5f5b('0x14'))(_0x5f5b('0x5a'));exports['reject']=function(_0x12d3fd,_0x224783,_0x28e682){var _0x11b85f={'agent':{},'channel':_0x5f5b('0x5c')};if(_0x12d3fd['body']['id']){delete _0x12d3fd[_0x5f5b('0x55')]['id'];}_0x12d3fd[_0x5f5b('0x55')]['UserId']=_0x12d3fd[_0x5f5b('0x55')][_0x5f5b('0x60')]||_0x12d3fd[_0x5f5b('0x67')]['id'];_0x11b85f[_0x5f5b('0x71')]['id']=_0x12d3fd[_0x5f5b('0x55')][_0x5f5b('0x60')];return db['FaxMessage']['find']({'where':{'id':_0x12d3fd[_0x5f5b('0x58')]['id'],'UserId':null}})[_0x5f5b('0x22')](handleEntityNotFound(_0x224783,null))[_0x5f5b('0x22')](function(_0x5db7ee){if(_0x5db7ee){_0x11b85f[_0x5f5b('0x2a')]=_0x5db7ee[_0x5f5b('0x66')]({'plain':!![]});return db[_0x5f5b('0x61')][_0x5f5b('0x57')]({'where':{'id':_0x5db7ee[_0x5f5b('0x62')]}});}return null;})[_0x5f5b('0x22')](handleEntityNotFound(_0x224783,null))[_0x5f5b('0x22')](function(_0x179ef1){if(_0x179ef1){_0x11b85f[_0x5f5b('0x65')]=_0x179ef1[_0x5f5b('0x66')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12d3fd[_0x5f5b('0x67')]['id'],_0x12d3fd[_0x5f5b('0x67')][_0x5f5b('0x40')],_0x12d3fd[_0x5f5b('0x67')][_0x5f5b('0x68')],_0x11b85f[_0x5f5b('0x65')]['id'],_0x12d3fd[_0x5f5b('0x55')]?JSON['stringify'](_0x12d3fd['body']):_0x5f5b('0x69'));return respondWithRpcPromise('RejectMessage',_0x5f5b('0x7b'),_0x11b85f);}return null;})[_0x5f5b('0x22')](function(_0x165e40){var _0x486cee=_0x5f5b('0x6c')+_0x165e40['message'][_0x5f5b('0x6d')];return db[_0x5f5b('0x6e')][_0x5f5b('0x41')](_0x486cee,{'type':db[_0x5f5b('0x7c')][_0x5f5b('0x7d')][_0x5f5b('0x6f')],'raw':!![]})[_0x5f5b('0x22')](function(_0x560950){return _0x560950;});})['then'](function(_0x468f7b){if(_0x468f7b){_0x11b85f[_0x5f5b('0x2a')][_0x5f5b('0x7e')]=_0x468f7b[0x0];if(!_0x12d3fd['body']['UserId'])return;return db[_0x5f5b('0x70')]['find']({'where':{'id':_0x12d3fd[_0x5f5b('0x55')][_0x5f5b('0x60')],'role':'agent'},'attributes':['id','name',_0x5f5b('0x72'),_0x5f5b('0x73'),_0x5f5b('0x74')],'raw':!![]});}return null;})[_0x5f5b('0x22')](function(_0x148120){if(!_0x148120)return null;_0x11b85f[_0x5f5b('0x2a')][_0x5f5b('0x71')]=_0x148120;return _0x11b85f;})['then'](function(_0xe328b3){if(_0xe328b3){_0xe328b3[_0x5f5b('0x2a')][_0x5f5b('0x76')]=util[_0x5f5b('0x5e')](_0x5f5b('0x77'),_0x12d3fd[_0x5f5b('0x67')][_0x5f5b('0x40')]);_0xe328b3[_0x5f5b('0x2a')][_0x5f5b('0x78')]=_0x11b85f[_0x5f5b('0x78')];_0xe328b3[_0x5f5b('0x2a')][_0x5f5b('0x79')]=_0x11b85f[_0x5f5b('0x78')];_0xe328b3[_0x5f5b('0x2a')]['event']=_0x5f5b('0x35');respondWithRpcPromise(_0x5f5b('0x7f'),_0x5f5b('0x7f'),{'event':'rejectmessage','message':_0xe328b3[_0x5f5b('0x2a')]},client9002);return _0x11b85f;}return null;})['then'](respondWithResult(_0x224783,null))['catch'](handleError(_0x224783,null));};exports[_0x5f5b('0x80')]=function(_0x280955,_0x3f6a14){var _0x13d71b;return db[_0x5f5b('0x56')][_0x5f5b('0x80')](_0x280955[_0x5f5b('0x55')],{})[_0x5f5b('0x22')](function(_0x3c74eb){_0x13d71b=_0x3c74eb;return db[_0x5f5b('0x81')]['findOne']({'where':{'id':_0x13d71b[_0x5f5b('0x6d')]}});})[_0x5f5b('0x22')](function(_0x1b9ac8){if(_['isNil'](_0x1b9ac8)){return;}else{_0x13d71b[_0x5f5b('0x5c')]=_0x1b9ac8[_0x5f5b('0x5c')];return db[_0x5f5b('0x82')][_0x5f5b('0x83')]({'where':{'id':_0x13d71b[_0x5f5b('0x84')]}});}})[_0x5f5b('0x22')](function(_0x3baaa5){return respondWithRpcPromise(_0x5f5b('0x85'),_0x5f5b('0x85'),{'FaxAccountId':_[_0x5f5b('0x63')](_0x280955['body'])?undefined:_0x280955[_0x5f5b('0x55')][_0x5f5b('0x86')],'path':_[_0x5f5b('0x63')](_0x3baaa5)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x3baaa5['basename']),'fax':_['isNil'](_0x13d71b[_0x5f5b('0x5c')])?undefined:_0x13d71b[_0x5f5b('0x5c')],'AttachmentId':_0x13d71b[_0x5f5b('0x84')]},client9002);})['then'](respondWithResult(_0x3f6a14,0xc9))[_0x5f5b('0x2c')](handleError(_0x3f6a14,null));};exports[_0x5f5b('0x87')]=function(_0x38b51d,_0x5e347f){var _0x39f11b=path[_0x5f5b('0x88')](config[_0x5f5b('0x89')],_0x5f5b('0x8a'),_0x5f5b('0x8b'),_0x5f5b('0x8c'));return db[_0x5f5b('0x56')][_0x5f5b('0x57')]({'where':{'id':_0x38b51d[_0x5f5b('0x58')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x5e347f,null))['then'](function(_0x2cda91){if(_0x2cda91){return _0x5e347f[_0x5f5b('0x87')](path[_0x5f5b('0x88')](_0x39f11b,_0x2cda91[_0x5f5b('0x82')]['basename']));}})['catch'](handleError(_0x5e347f,null));};
\ No newline at end of file
+var _0xedb2=['email','internal','agent','manual','interface','channel','motionChannel','EventManager','acceptmessage','get','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SIP/%s','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','update','body','params','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname'];(function(_0x311cf6,_0xdfb12e){var _0xf3f371=function(_0x1bc589){while(--_0x1bc589){_0x311cf6['push'](_0x311cf6['shift']());}};_0xf3f371(++_0xdfb12e);}(_0xedb2,0xad));var _0x2edb=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xedb2[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x2edb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2edb('0x1'));var jsonpatch=require(_0x2edb('0x2'));var rp=require(_0x2edb('0x3'));var moment=require(_0x2edb('0x4'));var BPromise=require(_0x2edb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2edb('0x6'));var sox=require('sox');var csv=require(_0x2edb('0x7'));var ejs=require(_0x2edb('0x8'));var fs=require('fs');var fs_extra=require(_0x2edb('0x9'));var _=require(_0x2edb('0xa'));var squel=require(_0x2edb('0xb'));var crypto=require('crypto');var jsforce=require(_0x2edb('0xc'));var deskjs=require(_0x2edb('0xd'));var toCsv=require(_0x2edb('0x7'));var querystring=require(_0x2edb('0xe'));var Papa=require('papaparse');var Redis=require(_0x2edb('0xf'));var authService=require(_0x2edb('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2edb('0x11'))('api');var utils=require(_0x2edb('0x12'));var config=require(_0x2edb('0x13'));var licenseUtil=require(_0x2edb('0x14'));var db=require(_0x2edb('0x15'))['db'];config['redis']=_['defaults'](config[_0x2edb('0x16')],{'host':_0x2edb('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2edb('0x16')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2edb('0x18')][_0x2edb('0x19')]({'port':0x232c});var client9002=jayson[_0x2edb('0x18')][_0x2edb('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4eac89,_0x4a1581,_0x559b09,_0xfdbd94){return new BPromise(function(_0x4be224,_0x2c574e){var _0x584e14=_0xfdbd94||client;return _0x584e14[_0x2edb('0x1a')](_0x4eac89,_0x559b09)[_0x2edb('0x1b')](function(_0x536498){logger[_0x2edb('0x1c')](_0x2edb('0x1d'),_0x4a1581,_0x2edb('0x1e'));logger[_0x2edb('0x1f')](_0x2edb('0x20'),_0x4a1581,_0x2edb('0x1e'),JSON[_0x2edb('0x21')](_0x536498));if(_0x536498[_0x2edb('0x22')]){if(_0x536498['error']['code']===0x1f4){logger['error'](_0x2edb('0x1d'),_0x4a1581,_0x536498[_0x2edb('0x22')]['message']);return _0x2c574e(_0x536498[_0x2edb('0x22')]['message']);}logger['error'](_0x2edb('0x1d'),_0x4a1581,_0x536498['error'][_0x2edb('0x23')]);return _0x4be224(_0x536498[_0x2edb('0x22')][_0x2edb('0x23')]);}else{logger['info'](_0x2edb('0x1d'),_0x4a1581,_0x2edb('0x1e'));_0x4be224(_0x536498['result']['message']);}})[_0x2edb('0x24')](function(_0x1cac2a){logger[_0x2edb('0x22')](_0x2edb('0x1d'),_0x4a1581,_0x1cac2a);_0x2c574e(_0x1cac2a);});});}function respondWithStatusCode(_0x4b0850,_0x58eca9){_0x58eca9=_0x58eca9||0xcc;return function(_0x24b372){if(_0x24b372){return _0x4b0850[_0x2edb('0x25')](_0x58eca9);}return _0x4b0850[_0x2edb('0x26')](_0x58eca9)['end']();};}function respondWithResult(_0x2d3b1d,_0x10946e){_0x10946e=_0x10946e||0xc8;return function(_0xf3d134){if(_0xf3d134){return _0x2d3b1d[_0x2edb('0x26')](_0x10946e)[_0x2edb('0x27')](_0xf3d134);}};}function respondWithFilteredResult(_0x618ea6,_0x497dde){return function(_0x419533){if(_0x419533){var _0x3cac27=typeof _0x497dde[_0x2edb('0x28')]==='undefined'&&typeof _0x497dde[_0x2edb('0x29')]===_0x2edb('0x2a');var _0x1af21f=_0x419533[_0x2edb('0x2b')];var _0x4caa62=_0x3cac27?0x0:_0x497dde[_0x2edb('0x28')];var _0x3dadba=_0x3cac27?_0x419533[_0x2edb('0x2b')]:_0x497dde['offset']+_0x497dde['limit'];var _0x20d358;if(_0x3dadba>=_0x1af21f){_0x3dadba=_0x1af21f;_0x20d358=0xc8;}else{_0x20d358=0xce;}_0x618ea6['status'](_0x20d358);return _0x618ea6['set'](_0x2edb('0x2c'),_0x4caa62+'-'+_0x3dadba+'/'+_0x1af21f)[_0x2edb('0x27')](_0x419533);}return null;};}function patchUpdates(_0x2d0dbf){return function(_0x210e96){try{jsonpatch[_0x2edb('0x2d')](_0x210e96,_0x2d0dbf,!![]);}catch(_0x1fe5cf){return BPromise[_0x2edb('0x2e')](_0x1fe5cf);}return _0x210e96[_0x2edb('0x2f')]();};}function saveUpdates(_0xc4627e,_0x525c17){return function(_0x266edd){if(_0x266edd){return _0x266edd['update'](_0xc4627e)[_0x2edb('0x1b')](function(_0x5cbece){return _0x5cbece;});}return null;};}function removeEntity(_0x81ef75,_0x58cbc7){return function(_0x521962){if(_0x521962){return _0x521962[_0x2edb('0x30')]()['then'](function(){_0x81ef75[_0x2edb('0x26')](0xcc)[_0x2edb('0x31')]();});}};}function handleEntityNotFound(_0x266d55,_0x38de35){return function(_0x2b7b9e){if(!_0x2b7b9e){_0x266d55[_0x2edb('0x25')](0x194);}return _0x2b7b9e;};}function handleError(_0x1310c4,_0x17dab8){_0x17dab8=_0x17dab8||0x1f4;return function(_0x37fd3f){logger[_0x2edb('0x22')](_0x37fd3f[_0x2edb('0x32')]);if(_0x37fd3f[_0x2edb('0x33')]){delete _0x37fd3f[_0x2edb('0x33')];}_0x1310c4[_0x2edb('0x26')](_0x17dab8)['send'](_0x37fd3f);};}exports[_0x2edb('0x34')]=function(_0x1397f1,_0x18b683){var _0x39b6df={},_0x1d4228={},_0x178747={'count':0x0,'rows':[]};var _0x346171=_[_0x2edb('0x35')](db[_0x2edb('0x36')][_0x2edb('0x37')],function(_0x1e8302){return{'name':_0x1e8302['fieldName'],'type':_0x1e8302['type']['key']};});_0x1d4228['model']=_[_0x2edb('0x35')](_0x346171,_0x2edb('0x33'));_0x1d4228[_0x2edb('0x38')]=_[_0x2edb('0x39')](_0x1397f1[_0x2edb('0x38')]);_0x1d4228[_0x2edb('0x3a')]=_[_0x2edb('0x3b')](_0x1d4228[_0x2edb('0x3c')],_0x1d4228['query']);_0x39b6df[_0x2edb('0x3d')]=_[_0x2edb('0x3b')](_0x1d4228[_0x2edb('0x3c')],qs[_0x2edb('0x3e')](_0x1397f1[_0x2edb('0x38')][_0x2edb('0x3e')]));_0x39b6df[_0x2edb('0x3d')]=_0x39b6df['attributes'][_0x2edb('0x3f')]?_0x39b6df[_0x2edb('0x3d')]:_0x1d4228['model'];if(!_0x1397f1[_0x2edb('0x38')][_0x2edb('0x40')](_0x2edb('0x41'))){_0x39b6df['limit']=qs[_0x2edb('0x29')](_0x1397f1[_0x2edb('0x38')][_0x2edb('0x29')]);_0x39b6df['offset']=qs[_0x2edb('0x28')](_0x1397f1[_0x2edb('0x38')][_0x2edb('0x28')]);}_0x39b6df[_0x2edb('0x42')]=qs[_0x2edb('0x43')](_0x1397f1['query'][_0x2edb('0x43')]);_0x39b6df['where']=qs[_0x2edb('0x3a')](_[_0x2edb('0x44')](_0x1397f1['query'],_0x1d4228['filters']),_0x346171);if(_0x1397f1['query'][_0x2edb('0x45')]){_0x39b6df['where']=_[_0x2edb('0x46')](_0x39b6df[_0x2edb('0x47')],{'$or':_[_0x2edb('0x35')](_0x346171,function(_0x4c914a){if(_0x4c914a[_0x2edb('0x48')]!==_0x2edb('0x49')){var _0x3b8311={};_0x3b8311[_0x4c914a[_0x2edb('0x33')]]={'$like':'%'+_0x1397f1[_0x2edb('0x38')][_0x2edb('0x45')]+'%'};return _0x3b8311;}})});}_0x39b6df=_[_0x2edb('0x46')]({},_0x39b6df,_0x1397f1[_0x2edb('0x4a')]);var _0x55613f={'where':_0x39b6df[_0x2edb('0x47')]};return db['FaxMessage'][_0x2edb('0x2b')](_0x55613f)[_0x2edb('0x1b')](function(_0x4fd28a){_0x178747[_0x2edb('0x2b')]=_0x4fd28a;if(_0x1397f1[_0x2edb('0x38')][_0x2edb('0x4b')]){_0x39b6df[_0x2edb('0x4c')]=[{'all':!![]}];}return db[_0x2edb('0x36')][_0x2edb('0x4d')](_0x39b6df);})[_0x2edb('0x1b')](function(_0x2180ca){_0x178747[_0x2edb('0x4e')]=_0x2180ca;return _0x178747;})['then'](respondWithFilteredResult(_0x18b683,_0x39b6df))[_0x2edb('0x24')](handleError(_0x18b683,null));};exports[_0x2edb('0x4f')]=function(_0x25fdf3,_0x141be5){var _0x4f0be5={'raw':!![],'where':{'id':_0x25fdf3['params']['id']}},_0x24cb28={};_0x24cb28['model']=_[_0x2edb('0x39')](db['FaxMessage'][_0x2edb('0x37')]);_0x24cb28[_0x2edb('0x38')]=_[_0x2edb('0x39')](_0x25fdf3[_0x2edb('0x38')]);_0x24cb28[_0x2edb('0x3a')]=_['intersection'](_0x24cb28[_0x2edb('0x3c')],_0x24cb28[_0x2edb('0x38')]);_0x4f0be5[_0x2edb('0x3d')]=_['intersection'](_0x24cb28['model'],qs[_0x2edb('0x3e')](_0x25fdf3[_0x2edb('0x38')][_0x2edb('0x3e')]));_0x4f0be5['attributes']=_0x4f0be5['attributes'][_0x2edb('0x3f')]?_0x4f0be5[_0x2edb('0x3d')]:_0x24cb28[_0x2edb('0x3c')];if(_0x25fdf3[_0x2edb('0x38')][_0x2edb('0x4b')]){_0x4f0be5[_0x2edb('0x4c')]=[{'all':!![]}];}_0x4f0be5=_[_0x2edb('0x46')]({},_0x4f0be5,_0x25fdf3[_0x2edb('0x4a')]);return db[_0x2edb('0x36')][_0x2edb('0x50')](_0x4f0be5)[_0x2edb('0x1b')](handleEntityNotFound(_0x141be5,null))[_0x2edb('0x1b')](respondWithResult(_0x141be5,null))[_0x2edb('0x24')](handleError(_0x141be5,null));};exports[_0x2edb('0x51')]=function(_0x4c744e,_0x431489){if(_0x4c744e[_0x2edb('0x52')]['id']){delete _0x4c744e[_0x2edb('0x52')]['id'];}return db[_0x2edb('0x36')][_0x2edb('0x50')]({'where':{'id':_0x4c744e['params']['id']}})[_0x2edb('0x1b')](handleEntityNotFound(_0x431489,null))['then'](saveUpdates(_0x4c744e['body'],null))[_0x2edb('0x1b')](respondWithResult(_0x431489,null))[_0x2edb('0x24')](handleError(_0x431489,null));};exports[_0x2edb('0x30')]=function(_0x9af85d,_0x292743){return db['FaxMessage'][_0x2edb('0x50')]({'where':{'id':_0x9af85d[_0x2edb('0x53')]['id']}})[_0x2edb('0x1b')](handleEntityNotFound(_0x292743,null))['then'](removeEntity(_0x292743,null))[_0x2edb('0x24')](handleError(_0x292743,null));};exports[_0x2edb('0x54')]=function(_0x27287c,_0x5139e5){return db[_0x2edb('0x36')][_0x2edb('0x54')]()[_0x2edb('0x1b')](respondWithResult(_0x5139e5,null))[_0x2edb('0x24')](handleError(_0x5139e5,null));};var interaction_log=require(_0x2edb('0x11'))(_0x2edb('0x55'));exports[_0x2edb('0x56')]=function(_0x3027fe,_0x40508a,_0x742ab6){var _0x36a661={'agent':{},'channel':_0x2edb('0x57')};if(_0x3027fe[_0x2edb('0x52')]['id']){delete _0x3027fe[_0x2edb('0x52')]['id'];}_0x3027fe[_0x2edb('0x52')][_0x2edb('0x58')]=!![];_0x3027fe[_0x2edb('0x52')][_0x2edb('0x59')]=moment()[_0x2edb('0x5a')](_0x2edb('0x5b'));_0x3027fe['body'][_0x2edb('0x5c')]=_0x3027fe[_0x2edb('0x52')][_0x2edb('0x5c')]||_0x3027fe[_0x2edb('0x5d')]['id'];_0x36a661['agent']['id']=_0x3027fe[_0x2edb('0x52')][_0x2edb('0x5c')];return db[_0x2edb('0x36')][_0x2edb('0x50')]({'where':{'id':_0x3027fe[_0x2edb('0x53')]['id'],'UserId':null}})[_0x2edb('0x1b')](handleEntityNotFound(_0x40508a,null))[_0x2edb('0x1b')](saveUpdates(_0x3027fe[_0x2edb('0x52')],null))[_0x2edb('0x1b')](function(_0x73ead8){if(_0x73ead8){_0x36a661[_0x2edb('0x23')]=_0x73ead8['get']({'plain':!![]});return db[_0x2edb('0x5e')]['find']({'where':{'id':_0x73ead8['FaxInteractionId']}});}return null;})[_0x2edb('0x1b')](handleEntityNotFound(_0x40508a,null))[_0x2edb('0x1b')](function(_0x479ea8){if(_0x479ea8){return _0x479ea8[_0x2edb('0x51')]({'UserId':_0x3027fe[_0x2edb('0x52')][_0x2edb('0x5c')],'read1stAt':_[_0x2edb('0x5f')](_0x479ea8[_0x2edb('0x60')])?moment()[_0x2edb('0x5a')](_0x2edb('0x5b')):undefined});}return null;})['then'](function(_0x40e187){if(_0x40e187){_0x36a661[_0x2edb('0x61')]=_0x40e187['get']({'plain':!![]});interaction_log[_0x2edb('0x1c')](_0x2edb('0x62'),_0x3027fe['user']['id'],_0x3027fe[_0x2edb('0x5d')][_0x2edb('0x33')],_0x3027fe[_0x2edb('0x5d')][_0x2edb('0x63')],_0x36a661[_0x2edb('0x61')]['id'],_0x3027fe[_0x2edb('0x52')]?JSON[_0x2edb('0x21')](_0x3027fe[_0x2edb('0x52')]):_0x2edb('0x64'));return respondWithRpcPromise(_0x2edb('0x65'),_0x2edb('0x66'),_0x36a661);}return null;})[_0x2edb('0x1b')](function(_0x5d722a){var _0x1fb775='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d722a['message'][_0x2edb('0x67')];return db[_0x2edb('0x68')]['query'](_0x1fb775,{'type':db[_0x2edb('0x69')][_0x2edb('0x6a')][_0x2edb('0x6b')],'raw':!![]})[_0x2edb('0x1b')](function(_0x5a4ace){return _0x5a4ace;});})[_0x2edb('0x1b')](function(_0x1bd58f){if(_0x1bd58f){_0x36a661['message'][_0x2edb('0x6c')]=_0x1bd58f[0x0];if(!_0x3027fe[_0x2edb('0x52')][_0x2edb('0x5c')])return;return db[_0x2edb('0x6d')]['find']({'where':{'id':_0x3027fe[_0x2edb('0x52')]['UserId'],'role':'agent'},'attributes':['id',_0x2edb('0x33'),_0x2edb('0x6e'),_0x2edb('0x6f'),_0x2edb('0x70')],'raw':!![]});}return null;})[_0x2edb('0x1b')](function(_0x48eb50){if(!_0x48eb50)return null;_0x36a661['message'][_0x2edb('0x71')]=_0x48eb50;return _0x36a661;})['then'](function(_0x2fc8aa){if(_0x2fc8aa){if(_0x3027fe[_0x2edb('0x52')][_0x2edb('0x72')]){_0x36a661['message'][_0x2edb('0x73')]=util[_0x2edb('0x5a')]('SIP/%s',_0x3027fe[_0x2edb('0x5d')][_0x2edb('0x33')]);_0x36a661[_0x2edb('0x23')][_0x2edb('0x74')]=_0x36a661[_0x2edb('0x74')];_0x36a661[_0x2edb('0x23')][_0x2edb('0x75')]=_0x36a661['channel'];_0x36a661[_0x2edb('0x23')]['event']=_0x2edb('0x56');return respondWithRpcPromise(_0x2edb('0x76'),'EventManager',{'event':_0x2edb('0x77'),'message':_0x36a661['message']},client9002)[_0x2edb('0x1b')](function(){return _0x36a661;});}return _0x36a661;}return null;})[_0x2edb('0x1b')](respondWithResult(_0x40508a,null))['catch'](handleError(_0x40508a,null));};var interaction_log=require(_0x2edb('0x11'))(_0x2edb('0x55'));exports[_0x2edb('0x2e')]=function(_0x50f786,_0x5a5388,_0x593c64){var _0x57f995={'agent':{},'channel':_0x2edb('0x57')};if(_0x50f786['body']['id']){delete _0x50f786[_0x2edb('0x52')]['id'];}_0x50f786[_0x2edb('0x52')][_0x2edb('0x5c')]=_0x50f786['body'][_0x2edb('0x5c')]||_0x50f786[_0x2edb('0x5d')]['id'];_0x57f995[_0x2edb('0x71')]['id']=_0x50f786['body'][_0x2edb('0x5c')];return db[_0x2edb('0x36')][_0x2edb('0x50')]({'where':{'id':_0x50f786['params']['id'],'UserId':null}})[_0x2edb('0x1b')](handleEntityNotFound(_0x5a5388,null))[_0x2edb('0x1b')](function(_0x4949f8){if(_0x4949f8){_0x57f995[_0x2edb('0x23')]=_0x4949f8[_0x2edb('0x78')]({'plain':!![]});return db[_0x2edb('0x5e')][_0x2edb('0x50')]({'where':{'id':_0x4949f8[_0x2edb('0x79')]}});}return null;})[_0x2edb('0x1b')](handleEntityNotFound(_0x5a5388,null))[_0x2edb('0x1b')](function(_0x57474b){if(_0x57474b){_0x57f995[_0x2edb('0x61')]=_0x57474b['get']({'plain':!![]});interaction_log['info'](_0x2edb('0x7a'),_0x50f786[_0x2edb('0x5d')]['id'],_0x50f786[_0x2edb('0x5d')][_0x2edb('0x33')],_0x50f786['user']['role'],_0x57f995[_0x2edb('0x61')]['id'],_0x50f786[_0x2edb('0x52')]?JSON[_0x2edb('0x21')](_0x50f786[_0x2edb('0x52')]):'null');return respondWithRpcPromise(_0x2edb('0x7b'),_0x2edb('0x7c'),_0x57f995);}return null;})['then'](function(_0x2fc140){var _0xfb90af=_0x2edb('0x7d')+_0x2fc140[_0x2edb('0x23')][_0x2edb('0x67')];return db[_0x2edb('0x68')][_0x2edb('0x38')](_0xfb90af,{'type':db[_0x2edb('0x69')][_0x2edb('0x6a')][_0x2edb('0x6b')],'raw':!![]})[_0x2edb('0x1b')](function(_0x402283){return _0x402283;});})[_0x2edb('0x1b')](function(_0x1083bb){if(_0x1083bb){_0x57f995['message']['contact']=_0x1083bb[0x0];if(!_0x50f786[_0x2edb('0x52')][_0x2edb('0x5c')])return;return db[_0x2edb('0x6d')][_0x2edb('0x50')]({'where':{'id':_0x50f786[_0x2edb('0x52')][_0x2edb('0x5c')],'role':_0x2edb('0x71')},'attributes':['id',_0x2edb('0x33'),'fullname','email',_0x2edb('0x70')],'raw':!![]});}return null;})['then'](function(_0x1e7d30){if(!_0x1e7d30)return null;_0x57f995[_0x2edb('0x23')]['agent']=_0x1e7d30;return _0x57f995;})[_0x2edb('0x1b')](function(_0x555c31){if(_0x555c31){_0x555c31[_0x2edb('0x23')][_0x2edb('0x73')]=util[_0x2edb('0x5a')](_0x2edb('0x7e'),_0x50f786[_0x2edb('0x5d')][_0x2edb('0x33')]);_0x555c31[_0x2edb('0x23')]['channel']=_0x57f995[_0x2edb('0x74')];_0x555c31[_0x2edb('0x23')][_0x2edb('0x75')]=_0x57f995[_0x2edb('0x74')];_0x555c31['message']['event']='reject';respondWithRpcPromise(_0x2edb('0x76'),_0x2edb('0x76'),{'event':_0x2edb('0x7f'),'message':_0x555c31[_0x2edb('0x23')]},client9002);return _0x57f995;}return null;})[_0x2edb('0x1b')](respondWithResult(_0x5a5388,null))[_0x2edb('0x24')](handleError(_0x5a5388,null));};exports['create']=function(_0x2a64f7,_0x40071f){var _0x426dc3;return db[_0x2edb('0x36')][_0x2edb('0x80')](_0x2a64f7['body'],{})[_0x2edb('0x1b')](function(_0x56df41){_0x426dc3=_0x56df41;return db['CmContact']['findOne']({'where':{'id':_0x426dc3[_0x2edb('0x67')]}});})[_0x2edb('0x1b')](function(_0x140fc6){if(_[_0x2edb('0x5f')](_0x140fc6)){return;}else{_0x426dc3[_0x2edb('0x57')]=_0x140fc6[_0x2edb('0x57')];return db[_0x2edb('0x81')][_0x2edb('0x82')]({'where':{'id':_0x426dc3[_0x2edb('0x83')]}});}})[_0x2edb('0x1b')](function(_0xbf1180){return respondWithRpcPromise('SendFax',_0x2edb('0x84'),{'FaxAccountId':_['isNil'](_0x2a64f7[_0x2edb('0x52')])?undefined:_0x2a64f7[_0x2edb('0x52')][_0x2edb('0x85')],'path':_[_0x2edb('0x5f')](_0xbf1180)?undefined:util[_0x2edb('0x5a')](_0x2edb('0x86'),_0xbf1180['basename']),'fax':_[_0x2edb('0x5f')](_0x426dc3['fax'])?undefined:_0x426dc3[_0x2edb('0x57')],'AttachmentId':_0x426dc3[_0x2edb('0x83')]},client9002);})[_0x2edb('0x1b')](respondWithResult(_0x40071f,0xc9))[_0x2edb('0x24')](handleError(_0x40071f,null));};exports[_0x2edb('0x87')]=function(_0x31f0ff,_0x430b38){var _0x54ee09=path[_0x2edb('0x88')](config[_0x2edb('0x89')],_0x2edb('0x8a'),_0x2edb('0x8b'),_0x2edb('0x8c'));return db[_0x2edb('0x36')]['find']({'where':{'id':_0x31f0ff['params']['id']},'include':[{'model':db[_0x2edb('0x81')],'as':_0x2edb('0x81')}]})[_0x2edb('0x1b')](handleEntityNotFound(_0x430b38,null))['then'](function(_0x510dee){if(_0x510dee){return _0x430b38[_0x2edb('0x87')](path['join'](_0x54ee09,_0x510dee[_0x2edb('0x81')][_0x2edb('0x8d')]));}})['catch'](handleError(_0x430b38,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf435=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0xf435,0x174));var _0x5f43=function(_0xc96929,_0x4097c9){_0xc96929=_0xc96929-0x0;var _0x744a38=_0xf435[_0xc96929];return _0x744a38;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x5f43('0x0'))['db'][_0x5f43('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5f43('0x2')](0x0);var events={'afterCreate':_0x5f43('0x3'),'afterUpdate':_0x5f43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x286c03){return function(_0x968d6a,_0x312c99,_0x140bd7){FaxMessageEvents['emit'](_0x286c03+':'+_0x968d6a['id'],_0x968d6a);FaxMessageEvents[_0x5f43('0x5')](_0x286c03,_0x968d6a);_0x140bd7(null);};}for(var e in events){if(events[_0x5f43('0x6')](e)){var event=events[e];FaxMessage[_0x5f43('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0xf435=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xf435,0x174));var _0x5f43=function(_0x3d7b14,_0x2ad5c3){_0x3d7b14=_0x3d7b14-0x0;var _0x1c9b00=_0xf435[_0x3d7b14];return _0x1c9b00;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x5f43('0x0'))['db'][_0x5f43('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5f43('0x2')](0x0);var events={'afterCreate':_0x5f43('0x3'),'afterUpdate':_0x5f43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x286c03){return function(_0x968d6a,_0x312c99,_0x140bd7){FaxMessageEvents['emit'](_0x286c03+':'+_0x968d6a['id'],_0x968d6a);FaxMessageEvents[_0x5f43('0x5')](_0x286c03,_0x968d6a);_0x140bd7(null);};}for(var e in events){if(events[_0x5f43('0x6')](e)){var event=events[e];FaxMessage[_0x5f43('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2dc=['FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe2dc,0x19f));var _0xce2d=function(_0x3416a8,_0x4b32b7){_0x3416a8=_0x3416a8-0x0;var _0x2ff995=_0xe2dc[_0x3416a8];return _0x2ff995;};'use strict';var _=require(_0xce2d('0x0'));var util=require(_0xce2d('0x1'));var logger=require('../../config/logger')(_0xce2d('0x2'));var moment=require(_0xce2d('0x3'));var BPromise=require(_0xce2d('0x4'));var rp=require(_0xce2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce2d('0x6'));var config=require(_0xce2d('0x7'));var attributes=require(_0xce2d('0x8'));module[_0xce2d('0x9')]=function(_0x47848d,_0x13994e){return _0x47848d['define'](_0xce2d('0xa'),attributes,{'tableName':_0xce2d('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xce2d('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5658ec,_0x281efb,_0x133a01){var _0x2e7e92=_0x47848d['models'];var _0x1488db=_0x5658ec[_0xce2d('0xd')]({'plain':!![]});if(_0x1488db[_0xce2d('0xe')][_0xce2d('0xf')]()==='in'||_0x1488db['direction'][_0xce2d('0xf')]()===_0xce2d('0x10')&&!_0x1488db[_0xce2d('0x11')]&&!_[_0xce2d('0x12')](_0x1488db[_0xce2d('0x13')])){_0x2e7e92[_0xce2d('0x14')][_0xce2d('0x15')]({'where':{'id':_0x1488db['FaxInteractionId']}})[_0xce2d('0x16')](function(_0x39d874){if(_0x39d874){_0x39d874[_0xce2d('0x17')]({'lastMsgAt':_0x1488db[_0xce2d('0x18')],'lastMsgDirection':_0x1488db[_0xce2d('0xe')][_0xce2d('0xf')]()});}})[_0xce2d('0x19')](function(_0xdb39d1){console[_0xce2d('0x1a')](_0xdb39d1);});}_0x133a01();}},'charset':_0xce2d('0x1b'),'collate':_0xce2d('0x1c')});};
\ No newline at end of file
+var _0x1f86=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch'];(function(_0x32d3d4,_0x4533e9){var _0x5a1425=function(_0x84dbf6){while(--_0x84dbf6){_0x32d3d4['push'](_0x32d3d4['shift']());}};_0x5a1425(++_0x4533e9);}(_0x1f86,0xcd));var _0x61f8=function(_0x1075d5,_0x5a8dd6){_0x1075d5=_0x1075d5-0x0;var _0x4eb04b=_0x1f86[_0x1075d5];return _0x4eb04b;};'use strict';var _=require(_0x61f8('0x0'));var util=require(_0x61f8('0x1'));var logger=require('../../config/logger')(_0x61f8('0x2'));var moment=require(_0x61f8('0x3'));var BPromise=require(_0x61f8('0x4'));var rp=require(_0x61f8('0x5'));var fs=require('fs');var path=require(_0x61f8('0x6'));var rimraf=require(_0x61f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x61f8('0x8'));module[_0x61f8('0x9')]=function(_0x77c15d,_0x33bdde){return _0x77c15d[_0x61f8('0xa')](_0x61f8('0xb'),attributes,{'tableName':_0x61f8('0xc'),'paranoid':![],'indexes':[{'name':_0x61f8('0xd'),'fields':['body'],'type':_0x61f8('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x229f22,_0xa4fd60,_0x4bb6e1){var _0x45b11e=_0x77c15d['models'];var _0x533075=_0x229f22['get']({'plain':!![]});if(_0x533075[_0x61f8('0xf')][_0x61f8('0x10')]()==='in'||_0x533075[_0x61f8('0xf')][_0x61f8('0x10')]()===_0x61f8('0x11')&&!_0x533075[_0x61f8('0x12')]&&!_[_0x61f8('0x13')](_0x533075[_0x61f8('0x14')])){_0x45b11e[_0x61f8('0x15')][_0x61f8('0x16')]({'where':{'id':_0x533075[_0x61f8('0x17')]}})['then'](function(_0x39f1e0){if(_0x39f1e0){_0x39f1e0[_0x61f8('0x18')]({'lastMsgAt':_0x533075[_0x61f8('0x19')],'lastMsgDirection':_0x533075[_0x61f8('0xf')]['toLowerCase']()});}})[_0x61f8('0x1a')](function(_0x4f7637){console['error'](_0x4f7637);});}_0x4bb6e1();}},'charset':_0x61f8('0x1b'),'collate':_0x61f8('0x1c')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xed1f,0x6a));var _0xfed1=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xed1f[_0x576170];return _0x397c70;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});};
\ No newline at end of file
+var _0xf3cd=['redis','defaults','socket.io-emitter','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','body','options','raw','UpdateFaxMessage','FaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4cc6d9,_0xccc75c){var _0x187cdb=function(_0x34248e){while(--_0x34248e){_0x4cc6d9['push'](_0x4cc6d9['shift']());}};_0x187cdb(++_0xccc75c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xf3cd[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});config[_0xdf3c('0xc')]=_[_0xdf3c('0xd')](config[_0xdf3c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf3c('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xdf3c('0xf')](socket);function respondWithRpcPromise(_0x981616,_0x5ef936,_0x1dba4c){return new BPromise(function(_0x205f33,_0x2d420c){return client[_0xdf3c('0x10')](_0x981616,_0x1dba4c)[_0xdf3c('0x11')](function(_0x1c456b){logger[_0xdf3c('0x12')](_0xdf3c('0x13'),_0x5ef936,'request\x20sent');logger[_0xdf3c('0x14')](_0xdf3c('0x15'),_0x5ef936,_0xdf3c('0x16'),JSON[_0xdf3c('0x17')](_0x1c456b));if(_0x1c456b['error']){if(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x19')]===0x1f4){logger[_0xdf3c('0x18')]('FaxMessage,\x20%s,\x20%s',_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x2d420c(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);return _0x205f33(_0x1c456b[_0xdf3c('0x18')][_0xdf3c('0x1a')]);}else{logger['info'](_0xdf3c('0x13'),_0x5ef936,_0xdf3c('0x16'));_0x205f33(_0x1c456b[_0xdf3c('0x1b')][_0xdf3c('0x1a')]);}})[_0xdf3c('0x1c')](function(_0x113b56){logger[_0xdf3c('0x18')](_0xdf3c('0x13'),_0x5ef936,_0x113b56);_0x2d420c(_0x113b56);});});}exports[_0xdf3c('0x1d')]=function(_0x18fb5f){var _0x267488=this;return new Promise(function(_0x3d14cc,_0x25487c){return db['FaxMessage']['create'](_0x18fb5f[_0xdf3c('0x1e')],{'raw':_0x18fb5f['options']?_0x18fb5f[_0xdf3c('0x1f')][_0xdf3c('0x20')]===undefined?!![]:![]:!![]})[_0xdf3c('0x11')](function(_0x38b319){logger[_0xdf3c('0x12')](_0xdf3c('0x1d'),_0x18fb5f);logger['debug'](_0xdf3c('0x1d'),_0x18fb5f,JSON[_0xdf3c('0x17')](_0x38b319));_0x3d14cc(_0x38b319);})[_0xdf3c('0x1c')](function(_0x24754a){logger[_0xdf3c('0x18')](_0xdf3c('0x1d'),_0x24754a[_0xdf3c('0x1a')],_0x18fb5f);_0x25487c(_0x267488[_0xdf3c('0x18')](0x1f4,_0x24754a[_0xdf3c('0x1a')]));});});};exports[_0xdf3c('0x21')]=function(_0x4c076c){var _0xd284d7=this;return new Promise(function(_0x153daa,_0x4b57a4){return db[_0xdf3c('0x22')]['update'](_0x4c076c['body'],{'raw':_0x4c076c['options']?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c076c['options']?_0x4c076c['options'][_0xdf3c('0x23')]||null:null,'attributes':_0x4c076c[_0xdf3c('0x1f')]?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x24')]||null:null,'limit':_0x4c076c['options']?_0x4c076c[_0xdf3c('0x1f')][_0xdf3c('0x25')]||null:null})['then'](function(_0x51e0a4){logger[_0xdf3c('0x12')](_0xdf3c('0x21'),_0x4c076c);logger[_0xdf3c('0x14')]('UpdateFaxMessage',_0x4c076c,JSON[_0xdf3c('0x17')](_0x51e0a4));_0x153daa(_0x51e0a4);})[_0xdf3c('0x1c')](function(_0x21e7b8){logger[_0xdf3c('0x18')]('UpdateFaxMessage',_0x21e7b8[_0xdf3c('0x1a')],_0x4c076c);_0x4b57a4(_0xd284d7[_0xdf3c('0x18')](0x1f4,_0x21e7b8['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x845c=['emit','removeListener','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x45d032,_0x1d9fd1){var _0x25d880=function(_0x1eeb8e){while(--_0x1eeb8e){_0x45d032['push'](_0x45d032['shift']());}};_0x25d880(++_0x1d9fd1);}(_0x845c,0xe4));var _0xc845=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x845c[_0x3ab51d];return _0x29a04e;};'use strict';var FaxMessageEvents=require(_0xc845('0x0'));var events=[_0xc845('0x1'),_0xc845('0x2'),_0xc845('0x3')];function createListener(_0x4d09f7,_0x5c5099){return function(_0x4834b3){_0x5c5099[_0xc845('0x4')](_0x4d09f7,_0x4834b3);};}function removeListener(_0x2499f4,_0x1646ba){return function(){FaxMessageEvents[_0xc845('0x5')](_0x2499f4,_0x1646ba);};}exports['register']=function(_0x1e8d8a){for(var _0x4943df=0x0,_0x3d9b1b=events[_0xc845('0x6')];_0x4943df<_0x3d9b1b;_0x4943df++){var _0x16dd86=events[_0x4943df];var _0x36cb8c=createListener(_0xc845('0x7')+_0x16dd86,_0x1e8d8a);FaxMessageEvents['on'](_0x16dd86,_0x36cb8c);}};
\ No newline at end of file
+var _0xeb4f=['register','length','./faxMessage.events','save','update','emit','removeListener'];(function(_0x1c7d97,_0x501a3f){var _0x498ff0=function(_0x427133){while(--_0x427133){_0x1c7d97['push'](_0x1c7d97['shift']());}};_0x498ff0(++_0x501a3f);}(_0xeb4f,0x113));var _0xfeb4=function(_0x14f868,_0x299d37){_0x14f868=_0x14f868-0x0;var _0x455257=_0xeb4f[_0x14f868];return _0x455257;};'use strict';var FaxMessageEvents=require(_0xfeb4('0x0'));var events=[_0xfeb4('0x1'),'remove',_0xfeb4('0x2')];function createListener(_0x29374a,_0x49028b){return function(_0x41f264){_0x49028b[_0xfeb4('0x3')](_0x29374a,_0x41f264);};}function removeListener(_0x18d1ff,_0x393060){return function(){FaxMessageEvents[_0xfeb4('0x4')](_0x18d1ff,_0x393060);};}exports[_0xfeb4('0x5')]=function(_0x4c46c7){for(var _0x23dea0=0x0,_0x5b661e=events[_0xfeb4('0x6')];_0x23dea0<_0x5b661e;_0x23dea0++){var _0x3526d4=events[_0x23dea0];var _0x332700=createListener('faxMessage:'+_0x3526d4,_0x4c46c7);FaxMessageEvents['on'](_0x3526d4,_0x332700);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9354=['describe','/:id','show','/:id/download','download','post','fax','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x582780,_0x227ce6){var _0x815a16=function(_0x2b5cca){while(--_0x2b5cca){_0x582780['push'](_0x582780['shift']());}};_0x815a16(++_0x227ce6);}(_0x9354,0x96));var _0x4935=function(_0x2e7c1b,_0x232f79){_0x2e7c1b=_0x2e7c1b-0x0;var _0x42f565=_0x9354[_0x2e7c1b];return _0x42f565;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4935('0x12'),'faxmessage:create'),controller['create']);router[_0x4935('0x13')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);router[_0x4935('0x13')](_0x4935('0x17'),auth[_0x4935('0x9')](),controller[_0x4935('0x18')]);router[_0x4935('0x19')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x579c=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x15c73e,_0x661f5){var _0x53355a=function(_0x3d8cdf){while(--_0x3d8cdf){_0x15c73e['push'](_0x15c73e['shift']());}};_0x53355a(++_0x661f5);}(_0x579c,0xda));var _0xc579=function(_0x17c8bf,_0x45276){_0x17c8bf=_0x17c8bf-0x0;var _0xfbbb4c=_0x579c[_0x17c8bf];return _0xfbbb4c;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/describe',auth[_0xc579('0xa')](),controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth['isAuthenticated'](),controller[_0xc579('0x10')]);router[_0xc579('0x11')]('/',auth[_0xc579('0xa')](),interaction[_0xc579('0x12')](_0xc579('0x13'),_0xc579('0x14')),controller[_0xc579('0x15')]);router[_0xc579('0x16')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x17')]);router['put'](_0xc579('0x18'),auth['isAuthenticated'](),controller[_0xc579('0x19')]);router['put'](_0xc579('0x1a'),auth['isAuthenticated'](),controller[_0xc579('0x1b')]);router['delete'](_0xc579('0xd'),auth[_0xc579('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f6d=['name','INTEGER','rrmemory','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6f6d,0x141));var _0xd6f6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6f6d[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xd6f6('0x0'));module[_0xd6f6('0x1')]={'name':{'type':Sequelize[_0xd6f6('0x2')],'unique':_0xd6f6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd6f6('0x2')]},'timeout':{'type':Sequelize[_0xd6f6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd6f6('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x297f=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x6fb27c,_0x4efa17){var _0x2af78d=function(_0x4c05f9){while(--_0x4c05f9){_0x6fb27c['push'](_0x6fb27c['shift']());}};_0x2af78d(++_0x4efa17);}(_0x297f,0x1f0));var _0xf297=function(_0x2cd554,_0x4f9f0d){_0x2cd554=_0x2cd554-0x0;var _0x1fa135=_0x297f[_0x2cd554];return _0x1fa135;};'use strict';var Sequelize=require(_0xf297('0x0'));module[_0xf297('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf297('0x2')]},'timeout':{'type':Sequelize[_0xf297('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf297('0x4')](_0xf297('0x5'),'beepall',_0xf297('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x202a=['include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','length','includeAll','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','sort','FaxQueueId','filter','options','User','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','order','getTeams','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','userFaxQueue:save','field','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','compact','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','pick','getAgents','util','lodash','squel','../../components/parsers/qs','../../mysqldb','redis','localhost','register','end','json','undefined','limit','count','offset','set','Content-Range','update','then','get','FaxQueues','destroy','status','sendStatus','error','stack','send','map','FaxQueue','rawAttributes','where'];(function(_0x47b4c8,_0x4effd4){var _0x480e8c=function(_0x523b12){while(--_0x523b12){_0x47b4c8['push'](_0x47b4c8['shift']());}};_0x480e8c(++_0x4effd4);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0xa202('0x0'));var _=require(_0xa202('0x1'));var squel=require(_0xa202('0x2'));var Redis=require('ioredis');var qs=require(_0xa202('0x3'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xa202('0x4'))['db'];config[_0xa202('0x5')]=_['defaults'](config['redis'],{'host':_0xa202('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xa202('0x7')](socket);function respondWithStatusCode(_0xcd59fb,_0x26ad43){_0x26ad43=_0x26ad43||0xcc;return function(_0x16951a){if(_0x16951a){return _0xcd59fb['sendStatus'](_0x26ad43);}return _0xcd59fb['status'](_0x26ad43)[_0xa202('0x8')]();};}function respondWithResult(_0x351e18,_0x32ae0b){_0x32ae0b=_0x32ae0b||0xc8;return function(_0x2c4250){if(_0x2c4250){return _0x351e18['status'](_0x32ae0b)[_0xa202('0x9')](_0x2c4250);}};}function respondWithFilteredResult(_0x5e7899,_0x202c0f){return function(_0x256601){if(_0x256601){var _0x64324c=typeof _0x202c0f['offset']===_0xa202('0xa')&&typeof _0x202c0f[_0xa202('0xb')]===_0xa202('0xa');var _0x417e31=_0x256601[_0xa202('0xc')];var _0x29969e=_0x64324c?0x0:_0x202c0f['offset'];var _0x13510c=_0x64324c?_0x256601[_0xa202('0xc')]:_0x202c0f[_0xa202('0xd')]+_0x202c0f[_0xa202('0xb')];var _0x2e1790;if(_0x13510c>=_0x417e31){_0x13510c=_0x417e31;_0x2e1790=0xc8;}else{_0x2e1790=0xce;}_0x5e7899['status'](_0x2e1790);return _0x5e7899[_0xa202('0xe')](_0xa202('0xf'),_0x29969e+'-'+_0x13510c+'/'+_0x417e31)[_0xa202('0x9')](_0x256601);}return null;};}function saveUpdates(_0x3fcc66){return function(_0x2c191f){if(_0x2c191f){return _0x2c191f[_0xa202('0x10')](_0x3fcc66)['then'](function(_0x44a1b6){return _0x44a1b6;});}return null;};}function removeEntity(_0x53ff78){return function(_0x130df2){if(_0x130df2){return _0x130df2['destroy']()[_0xa202('0x11')](function(){var _0x33b91f=_0x130df2[_0xa202('0x12')]({'plain':!![]});var _0xfce413=_0xa202('0x13');return db['UserProfileResource'][_0xa202('0x14')]({'where':{'type':_0xfce413,'resourceId':_0x33b91f['id']}})[_0xa202('0x11')](function(){return _0x130df2;});})[_0xa202('0x11')](function(){_0x53ff78[_0xa202('0x15')](0xcc)[_0xa202('0x8')]();});}};}function handleEntityNotFound(_0x587cb7){return function(_0x55c9a5){if(!_0x55c9a5){_0x587cb7[_0xa202('0x16')](0x194);}return _0x55c9a5;};}function handleError(_0x46cfa4,_0x44801a){_0x44801a=_0x44801a||0x1f4;return function(_0x5845f5){logger[_0xa202('0x17')](_0x5845f5[_0xa202('0x18')]);if(_0x5845f5['name']){delete _0x5845f5['name'];}_0x46cfa4[_0xa202('0x15')](_0x44801a)[_0xa202('0x19')](_0x5845f5);};}exports['index']=function(_0x27101e,_0x5a1ea3){var _0x5373b6={};var _0x72fe3e={'count':0x0,'rows':[]};var _0x268ee9=_[_0xa202('0x1a')](db[_0xa202('0x1b')][_0xa202('0x1c')],function(_0x1d6704){return{'name':_0x1d6704['fieldName'],'type':_0x1d6704['type']['key']};});_0x5373b6=qs['getOptions'](_0x268ee9,_0x27101e);var _0x406716={'where':_0x5373b6[_0xa202('0x1d')]};return db[_0xa202('0x1b')]['count'](_0x406716)[_0xa202('0x11')](function(_0x390633){_0x72fe3e[_0xa202('0xc')]=_0x390633;_0x5373b6[_0xa202('0x1e')]=qs[_0xa202('0x1e')](_0x27101e[_0xa202('0x1f')]);return db[_0xa202('0x1b')][_0xa202('0x20')](_0x5373b6);})[_0xa202('0x11')](function(_0x106b89){_0x72fe3e[_0xa202('0x21')]=_0x106b89;return _0x72fe3e;})[_0xa202('0x11')](respondWithFilteredResult(_0x5a1ea3,_0x5373b6))[_0xa202('0x22')](handleError(_0x5a1ea3,null));};exports[_0xa202('0x23')]=function(_0xcea252,_0x3bb9ab){var _0x5b3b40={'raw':!![],'where':{'id':_0xcea252[_0xa202('0x24')]['id']}},_0x418ff0={};_0x418ff0[_0xa202('0x25')]=_[_0xa202('0x26')](db[_0xa202('0x1b')][_0xa202('0x1c')]);_0x418ff0['query']=_[_0xa202('0x26')](_0xcea252[_0xa202('0x1f')]);_0x418ff0['filters']=_[_0xa202('0x27')](_0x418ff0[_0xa202('0x25')],_0x418ff0['query']);_0x5b3b40['attributes']=_['intersection'](_0x418ff0[_0xa202('0x25')],qs[_0xa202('0x28')](_0xcea252[_0xa202('0x1f')][_0xa202('0x28')]));_0x5b3b40[_0xa202('0x29')]=_0x5b3b40['attributes'][_0xa202('0x2a')]?_0x5b3b40['attributes']:_0x418ff0[_0xa202('0x25')];if(_0xcea252[_0xa202('0x1f')][_0xa202('0x2b')]){_0x5b3b40['include']=[{'all':!![]}];}_0x5b3b40=_[_0xa202('0x2c')]({},_0x5b3b40,_0xcea252['options']);return db['FaxQueue'][_0xa202('0x2d')](_0x5b3b40)[_0xa202('0x11')](handleEntityNotFound(_0x3bb9ab,null))['then'](respondWithResult(_0x3bb9ab,null))[_0xa202('0x22')](handleError(_0x3bb9ab,null));};exports['create']=function(_0x56cd45,_0x20369c){return db[_0xa202('0x1b')]['create'](_0x56cd45[_0xa202('0x2e')],{})[_0xa202('0x11')](function(_0xc5cc0c){var _0x527921=_0x56cd45[_0xa202('0x2f')][_0xa202('0x12')]({'plain':!![]});if(!_0x527921)throw new Error(_0xa202('0x30'));if(_0x527921[_0xa202('0x31')]===_0xa202('0x2f')){var _0x2f9674=_0xc5cc0c[_0xa202('0x12')]({'plain':!![]});var _0x3c480f=_0xa202('0x13');return db[_0xa202('0x32')][_0xa202('0x2d')]({'where':{'name':_0x3c480f,'userProfileId':_0x527921[_0xa202('0x33')]},'raw':!![]})['then'](function(_0x5bd528){if(_0x5bd528&&_0x5bd528[_0xa202('0x34')]===0x0){return db[_0xa202('0x35')][_0xa202('0x36')]({'name':_0x2f9674[_0xa202('0x37')],'resourceId':_0x2f9674['id'],'type':_0x5bd528[_0xa202('0x37')],'sectionId':_0x5bd528['id']},{})[_0xa202('0x11')](function(){return _0xc5cc0c;});}else{return _0xc5cc0c;}})[_0xa202('0x22')](function(_0x3bca66){logger[_0xa202('0x17')](_0xa202('0x38'),_0x3bca66);throw _0x3bca66;});}return _0xc5cc0c;})['then'](respondWithResult(_0x20369c,0xc9))[_0xa202('0x22')](handleError(_0x20369c,null));};exports[_0xa202('0x10')]=function(_0x51c551,_0x48a546){if(_0x51c551['body']['id']){delete _0x51c551[_0xa202('0x2e')]['id'];}return db[_0xa202('0x1b')][_0xa202('0x2d')]({'where':{'id':_0x51c551[_0xa202('0x24')]['id']}})['then'](handleEntityNotFound(_0x48a546,null))[_0xa202('0x11')](saveUpdates(_0x51c551[_0xa202('0x2e')],null))[_0xa202('0x11')](respondWithResult(_0x48a546,null))[_0xa202('0x22')](handleError(_0x48a546,null));};exports['destroy']=function(_0x169a02,_0x201e51){return db[_0xa202('0x1b')]['find']({'where':{'id':_0x169a02[_0xa202('0x24')]['id']}})[_0xa202('0x11')](handleEntityNotFound(_0x201e51,null))[_0xa202('0x11')](removeEntity(_0x201e51,null))[_0xa202('0x22')](handleError(_0x201e51,null));};exports[_0xa202('0x39')]=function(_0x36046d,_0x46f873){return db[_0xa202('0x1b')][_0xa202('0x39')]()[_0xa202('0x11')](respondWithResult(_0x46f873,null))[_0xa202('0x22')](handleError(_0x46f873,null));};exports[_0xa202('0x3a')]=function(_0x4b771b,_0x1f906a){var _0x1dca0c={'raw':!![],'where':{}},_0x2608a2={},_0x26c959;return db[_0xa202('0x1b')][_0xa202('0x3b')]({'where':{'id':_0x4b771b[_0xa202('0x24')]['id']}})[_0xa202('0x11')](handleEntityNotFound(_0x1f906a,null))['then'](function(_0x232941){if(_0x232941){_0x26c959=_0x232941[_0xa202('0x12')]({'plain':!![]});_0x2608a2[_0xa202('0x25')]=_['keys'](db[_0xa202('0x3c')][_0xa202('0x1c')]);_0x2608a2[_0xa202('0x1f')]=_['keys'](_0x4b771b[_0xa202('0x1f')]);_0x2608a2[_0xa202('0x3d')]=_[_0xa202('0x27')](_0x2608a2[_0xa202('0x25')],_0x2608a2[_0xa202('0x1f')]);_0x1dca0c[_0xa202('0x29')]=_[_0xa202('0x27')](_0x2608a2[_0xa202('0x25')],qs[_0xa202('0x28')](_0x4b771b[_0xa202('0x1f')][_0xa202('0x28')]));_0x1dca0c['attributes']=_0x1dca0c[_0xa202('0x29')][_0xa202('0x2a')]?_0x1dca0c[_0xa202('0x29')]:_0x2608a2['model'];if(!_0x4b771b['query'][_0xa202('0x3e')](_0xa202('0x3f'))){_0x1dca0c['limit']=qs[_0xa202('0xb')](_0x4b771b[_0xa202('0x1f')]['limit']);_0x1dca0c[_0xa202('0xd')]=qs[_0xa202('0xd')](_0x4b771b[_0xa202('0x1f')][_0xa202('0xd')]);}_0x1dca0c['order']=qs[_0xa202('0x40')](_0x4b771b['query']['sort']);_0x1dca0c[_0xa202('0x1d')]=qs['filters'](_['pick'](_0x4b771b[_0xa202('0x1f')],_0x2608a2['filters']));_0x1dca0c['where'][_0xa202('0x41')]=_0x232941['id'];if(_0x4b771b[_0xa202('0x1f')][_0xa202('0x42')]){_0x1dca0c[_0xa202('0x1d')]=_[_0xa202('0x2c')](_0x1dca0c[_0xa202('0x1d')],{'$or':_[_0xa202('0x1a')](_0x1dca0c['attributes'],function(_0x45a54b){var _0x35b091={};_0x35b091[_0x45a54b]={'$like':'%'+_0x4b771b[_0xa202('0x1f')][_0xa202('0x42')]+'%'};return _0x35b091;})});}_0x1dca0c=_[_0xa202('0x2c')]({},_0x1dca0c,_0x4b771b[_0xa202('0x43')]);return db[_0xa202('0x3c')]['findAll'](_0x1dca0c);}})[_0xa202('0x11')](function(_0x3905de){if(_0x3905de){return db[_0xa202('0x44')]['findAndCountAll']({'where':{'id':_['map'](_0x3905de,'UserId'),'role':_0xa202('0x45')},'attributes':['id',_0xa202('0x37'),_0xa202('0x46'),_0xa202('0x47'),_0xa202('0x48')]});}})[_0xa202('0x11')](function(_0x3b1efe){if(_0x3b1efe){return{'count':_0x3b1efe[_0xa202('0xc')],'rows':_[_0xa202('0x1a')](_0x3b1efe['rows'],function(_0x209634){return{'membername':_0x209634['name'],'UserId':_0x209634['id'],'queue_name':_0x26c959[_0xa202('0x37')],'FaxQueueId':_0x26c959['id'],'interface':util[_0xa202('0x49')](_0xa202('0x4a'),_0xa202('0x4b'),_0x209634[_0xa202('0x37')]),'penalty':0x0,'paused':_0x209634['faxPause'],'createdAt':_0x209634[_0xa202('0x48')],'updatedAt':_0x209634[_0xa202('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1f906a,_0x1dca0c))[_0xa202('0x22')](handleError(_0x1f906a,null));};exports['getTeams']=function(_0x41ed29,_0x530b90){var _0x4d26fe={};var _0x248d1c={};var _0x24e526;var _0x3a3c54;return db[_0xa202('0x1b')][_0xa202('0x3b')]({'where':{'id':_0x41ed29['params']['id']}})['then'](handleEntityNotFound(_0x530b90,null))['then'](function(_0x584072){if(_0x584072){_0x24e526=_0x584072;_0x248d1c[_0xa202('0x25')]=_[_0xa202('0x26')](db[_0xa202('0x4c')][_0xa202('0x1c')]);_0x248d1c['query']=_['keys'](_0x41ed29['query']);_0x248d1c[_0xa202('0x3d')]=_[_0xa202('0x27')](_0x248d1c['model'],_0x248d1c[_0xa202('0x1f')]);_0x4d26fe[_0xa202('0x29')]=_['intersection'](_0x248d1c['model'],qs[_0xa202('0x28')](_0x41ed29['query'][_0xa202('0x28')]));_0x4d26fe[_0xa202('0x29')]=_0x4d26fe[_0xa202('0x29')]['length']?_0x4d26fe[_0xa202('0x29')]:_0x248d1c[_0xa202('0x25')];_0x4d26fe[_0xa202('0x4d')]=qs['sort'](_0x41ed29[_0xa202('0x1f')][_0xa202('0x40')]);_0x4d26fe[_0xa202('0x1d')]=qs[_0xa202('0x3d')](_['pick'](_0x41ed29[_0xa202('0x1f')],_0x248d1c[_0xa202('0x3d')]));if(_0x41ed29['query'][_0xa202('0x42')]){_0x4d26fe[_0xa202('0x1d')]=_['merge'](_0x4d26fe['where'],{'$or':_[_0xa202('0x1a')](_0x4d26fe[_0xa202('0x29')],function(_0x5496b7){var _0x5ac40c={};_0x5ac40c[_0x5496b7]={'$like':'%'+_0x41ed29['query'][_0xa202('0x42')]+'%'};return _0x5ac40c;})});}_0x4d26fe=_['merge']({},_0x4d26fe,_0x41ed29[_0xa202('0x43')]);return _0x24e526[_0xa202('0x4e')](_0x4d26fe);}})[_0xa202('0x11')](function(_0x14d17d){if(_0x14d17d){_0x3a3c54=_0x14d17d[_0xa202('0x2a')];if(!_0x41ed29[_0xa202('0x1f')][_0xa202('0x3e')](_0xa202('0x3f'))){_0x4d26fe[_0xa202('0xb')]=qs[_0xa202('0xb')](_0x41ed29[_0xa202('0x1f')][_0xa202('0xb')]);_0x4d26fe[_0xa202('0xd')]=qs[_0xa202('0xd')](_0x41ed29[_0xa202('0x1f')][_0xa202('0xd')]);}return _0x24e526[_0xa202('0x4e')](_0x4d26fe);}})[_0xa202('0x11')](function(_0x56d398){if(_0x56d398){return _0x56d398?{'count':_0x3a3c54,'rows':_0x56d398}:null;}})[_0xa202('0x11')](respondWithResult(_0x530b90,null))[_0xa202('0x22')](handleError(_0x530b90,null));};exports[_0xa202('0x4f')]=function(_0x5e0f99,_0x516ac5){var _0xc28dd2=_0x5e0f99[_0xa202('0x2e')][_0xa202('0x50')];return db[_0xa202('0x4c')][_0xa202('0x20')]({'where':{'id':_0xc28dd2},'attributes':['id'],'include':[{'model':db[_0xa202('0x44')],'as':_0xa202('0x51'),'attributes':['id',_0xa202('0x37'),_0xa202('0x52'),_0xa202('0x53'),_0xa202('0x54')],'raw':!![]}]})[_0xa202('0x11')](function(_0x874371){if(_0x874371){var _0x268914=_['flatMap'](_0x874371,function(_0x1ff0db){var _0x19c6a5=_0x1ff0db['get']({'plain':!![]});return _0x19c6a5[_0xa202('0x51')];});return db[_0xa202('0x1b')]['find']({'where':{'id':_0x5e0f99['params']['id']}})[_0xa202('0x11')](function(_0x46bf07){return db['sequelize'][_0xa202('0x55')](function(_0x228bb8){return _0x46bf07['addTeams'](_0xc28dd2,{'transaction':_0x228bb8})['then'](function(){return BPromise[_0xa202('0x56')](_0x268914,function(_0x4310c5){return db['UserFaxQueue'][_0xa202('0x57')]({'where':{'UserId':_0x4310c5['id'],'FaxQueueId':_0x5e0f99['params']['id']},'transaction':_0x228bb8});});})[_0xa202('0x11')](function(){_0x268914['forEach'](function(_0x51c055){socket['emit'](_0xa202('0x58'),{'UserId':_0x51c055['id'],'FaxQueueId':_0x46bf07['id']});});});});});}})[_0xa202('0x11')](respondWithStatusCode(_0x516ac5,null))[_0xa202('0x22')](handleError(_0x516ac5,null));};exports['removeTeams']=function(_0x620c8d,_0x38f9a6){return db[_0xa202('0x4c')][_0xa202('0x20')]({'where':{'id':_0x620c8d[_0xa202('0x1f')][_0xa202('0x50')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa202('0x51'),'attributes':['id'],'raw':!![]}]})[_0xa202('0x11')](handleEntityNotFound(_0x38f9a6,null))[_0xa202('0x11')](function(_0x1ee182){var _0x46383d=_[_0xa202('0x1a')](_0x1ee182,'id');var _0x20e056=[];var _0x2c3584=[];var _0x4e2851=squel['select']();_0x4e2851[_0xa202('0x59')](_0xa202('0x5a'))[_0xa202('0x5b')]('team_has_fax_queues','tq')[_0xa202('0x5c')](_0xa202('0x5d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa202('0x1d')](_0xa202('0x5e'),_0x620c8d[_0xa202('0x24')]['id']);for(var _0x597bc0=0x0;_0x597bc0<_0x1ee182[_0xa202('0x2a')];_0x597bc0+=0x1){let _0x4c97d7=_0x1ee182[_0x597bc0];for(var _0x4c466d=0x0;_0x4c466d<_0x4c97d7[_0xa202('0x51')]['length'];_0x4c466d+=0x1){let _0x211521=_0x4c97d7[_0xa202('0x51')][_0x4c466d];var _0x40c2a7=_0x4e2851['clone']();_0x40c2a7[_0xa202('0x1d')]('ut.UserId\x20=\x20?',_0x211521['id']);_0x2c3584['push'](db[_0xa202('0x5f')][_0xa202('0x1f')](_0x40c2a7['toString'](),{'type':db[_0xa202('0x5f')][_0xa202('0x60')][_0xa202('0x61')]})['then'](function(_0x29fcb1){if(_0x29fcb1[_0xa202('0x2a')]===0x1){return _0x211521['id'];}else{var _0x46b74d=_[_0xa202('0x62')](_[_0xa202('0x1a')](_0x29fcb1,_0xa202('0x63')),function(_0xadb16f){return _[_0xa202('0x64')](_0x46383d,_0xadb16f);});if(_0x46b74d){return _0x211521['id'];}}}));}}return BPromise['all'](_0x2c3584)[_0xa202('0x11')](function(_0x57a47a){_0x20e056=_(_0x20e056)['union'](_0x57a47a)[_0xa202('0x65')]()['value']();return db['FaxQueue']['find']({'where':{'id':_0x620c8d[_0xa202('0x24')]['id']}})[_0xa202('0x11')](function(_0x406805){return db['sequelize'][_0xa202('0x55')](function(_0x432dfb){return _0x406805['removeTeams'](_0x620c8d[_0xa202('0x1f')][_0xa202('0x50')],{'transaction':_0x432dfb})['then'](function(){if(!_[_0xa202('0x66')](_0x20e056)){return _0x406805[_0xa202('0x67')](_0x20e056,{'transaction':_0x432dfb});}})['then'](function(){_0x20e056['forEach'](function(_0x13699b){socket[_0xa202('0x68')](_0xa202('0x69'),{'UserId':_0x13699b,'FaxQueueId':_0x406805['id']});});});});});});})['then'](respondWithStatusCode(_0x38f9a6,null))[_0xa202('0x22')](handleError(_0x38f9a6,null));};exports[_0xa202('0x6a')]=function(_0x5e0d4e,_0x1c2c22){return db[_0xa202('0x1b')][_0xa202('0x2d')]({'where':{'id':_0x5e0d4e[_0xa202('0x24')]['id']}})[_0xa202('0x11')](handleEntityNotFound(_0x1c2c22,null))[_0xa202('0x11')](function(_0x490303){if(_0x490303){return _0x490303['addAgents'](_0x5e0d4e[_0xa202('0x2e')][_0xa202('0x50')],_['omit'](_0x5e0d4e['body'],[_0xa202('0x50'),'id'])||{})[_0xa202('0x6b')](function(_0x151b03){for(var _0x1c480b=0x0;_0x1c480b<_0x5e0d4e['body'][_0xa202('0x50')][_0xa202('0x2a')];_0x1c480b+=0x1){socket[_0xa202('0x68')](_0xa202('0x58'),{'UserId':Number(_0x5e0d4e[_0xa202('0x2e')][_0xa202('0x50')][_0x1c480b]),'FaxQueueId':Number(_0x5e0d4e[_0xa202('0x24')]['id'])});}return _0x151b03;});}})[_0xa202('0x11')](respondWithResult(_0x1c2c22,null))['catch'](handleError(_0x1c2c22,null));};exports['removeAgents']=function(_0xadc091,_0x35d046){return db['FaxQueue']['find']({'where':{'id':_0xadc091['params']['id']}})['then'](handleEntityNotFound(_0x35d046,null))[_0xa202('0x11')](function(_0x4fa0b3){if(_0x4fa0b3){return _0x4fa0b3['removeAgents'](_0xadc091['query'][_0xa202('0x50')])['then'](function(){if(_[_0xa202('0x6c')](_0xadc091[_0xa202('0x1f')][_0xa202('0x50')])){for(var _0x381008=0x0;_0x381008<_0xadc091[_0xa202('0x1f')][_0xa202('0x50')][_0xa202('0x2a')];_0x381008+=0x1){socket[_0xa202('0x68')]('userFaxQueue:remove',{'UserId':Number(_0xadc091[_0xa202('0x1f')][_0xa202('0x50')][_0x381008]),'FaxQueueId':Number(_0xadc091[_0xa202('0x24')]['id'])});}}else{socket[_0xa202('0x68')](_0xa202('0x69'),{'UserId':Number(_0xadc091[_0xa202('0x1f')][_0xa202('0x50')]),'FaxQueueId':Number(_0xadc091[_0xa202('0x24')]['id'])});}});}})[_0xa202('0x11')](respondWithStatusCode(_0x35d046,null))[_0xa202('0x22')](handleError(_0x35d046,null));};exports['getAgents']=function(_0x138203,_0x66b533){var _0x3b7beb={};var _0xbc129b={};var _0x34a9c1;var _0x425467;return db[_0xa202('0x1b')][_0xa202('0x3b')]({'where':{'id':_0x138203[_0xa202('0x24')]['id']}})['then'](handleEntityNotFound(_0x66b533,null))[_0xa202('0x11')](function(_0x1a2d95){if(_0x1a2d95){_0x34a9c1=_0x1a2d95;_0xbc129b['model']=_['keys'](db[_0xa202('0x44')][_0xa202('0x1c')]);_0xbc129b[_0xa202('0x1f')]=_['keys'](_0x138203['query']);_0xbc129b[_0xa202('0x3d')]=_[_0xa202('0x27')](_0xbc129b[_0xa202('0x25')],_0xbc129b[_0xa202('0x1f')]);_0x3b7beb['attributes']=_[_0xa202('0x27')](_0xbc129b[_0xa202('0x25')],qs[_0xa202('0x28')](_0x138203[_0xa202('0x1f')][_0xa202('0x28')]));_0x3b7beb[_0xa202('0x29')]=_0x3b7beb[_0xa202('0x29')]['length']?_0x3b7beb[_0xa202('0x29')]:_0xbc129b[_0xa202('0x25')];_0x3b7beb[_0xa202('0x4d')]=qs[_0xa202('0x40')](_0x138203[_0xa202('0x1f')][_0xa202('0x40')]);_0x3b7beb['where']=qs[_0xa202('0x3d')](_[_0xa202('0x6d')](_0x138203[_0xa202('0x1f')],_0xbc129b[_0xa202('0x3d')]));if(_0x138203[_0xa202('0x1f')]['filter']){_0x3b7beb[_0xa202('0x1d')]=_[_0xa202('0x2c')](_0x3b7beb[_0xa202('0x1d')],{'$or':_['map'](_0x3b7beb[_0xa202('0x29')],function(_0x49b059){var _0x50f88c={};_0x50f88c[_0x49b059]={'$like':'%'+_0x138203['query'][_0xa202('0x42')]+'%'};return _0x50f88c;})});}_0x3b7beb=_[_0xa202('0x2c')]({},_0x3b7beb,_0x138203[_0xa202('0x43')]);return _0x34a9c1[_0xa202('0x6e')](_0x3b7beb);}})[_0xa202('0x11')](function(_0xfc5594){if(_0xfc5594){_0x425467=_0xfc5594[_0xa202('0x2a')];if(!_0x138203['query']['hasOwnProperty'](_0xa202('0x3f'))){_0x3b7beb[_0xa202('0xb')]=qs[_0xa202('0xb')](_0x138203[_0xa202('0x1f')]['limit']);_0x3b7beb[_0xa202('0xd')]=qs[_0xa202('0xd')](_0x138203[_0xa202('0x1f')][_0xa202('0xd')]);}return _0x34a9c1[_0xa202('0x6e')](_0x3b7beb);}})[_0xa202('0x11')](function(_0x7de4dd){if(_0x7de4dd){return _0x7de4dd?{'count':_0x425467,'rows':_0x7de4dd}:null;}})['then'](respondWithResult(_0x66b533,null))[_0xa202('0x22')](handleError(_0x66b533,null));};
\ No newline at end of file
+var _0x57ca=['userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','compact','value','userFaxQueue:remove','addAgents','removeAgents','getAgents','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','get','FaxQueues','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','catch','params','model','keys','filters','intersection','attributes','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','fields','length','nolimit','sort','pick','where','FaxQueueId','filter','UserFaxQueue','findAll','User','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','order','hasOwnProperty','addTeams','ids','Team','Agents','online','voicePause','transaction','each','findOrCreate','forEach','emit'];(function(_0x569407,_0x115d0f){var _0x51d1e3=function(_0x191efb){while(--_0x191efb){_0x569407['push'](_0x569407['shift']());}};_0x51d1e3(++_0x115d0f);}(_0x57ca,0x108));var _0xa57c=function(_0x1e0b67,_0x270727){_0x1e0b67=_0x1e0b67-0x0;var _0x1f3214=_0x57ca[_0x1e0b67];return _0x1f3214;};'use strict';var BPromise=require('bluebird');var util=require(_0xa57c('0x0'));var _=require(_0xa57c('0x1'));var squel=require('squel');var Redis=require(_0xa57c('0x2'));var qs=require(_0xa57c('0x3'));var logger=require(_0xa57c('0x4'))(_0xa57c('0x5'));var config=require(_0xa57c('0x6'));var db=require('../../mysqldb')['db'];config[_0xa57c('0x7')]=_[_0xa57c('0x8')](config[_0xa57c('0x7')],{'host':_0xa57c('0x9'),'port':0x18eb});var socket=require(_0xa57c('0xa'))(new Redis(config[_0xa57c('0x7')]));require(_0xa57c('0xb'))[_0xa57c('0xc')](socket);function respondWithStatusCode(_0x5e3962,_0x13dad8){_0x13dad8=_0x13dad8||0xcc;return function(_0x4b51d8){if(_0x4b51d8){return _0x5e3962[_0xa57c('0xd')](_0x13dad8);}return _0x5e3962[_0xa57c('0xe')](_0x13dad8)['end']();};}function respondWithResult(_0x156bca,_0x51f287){_0x51f287=_0x51f287||0xc8;return function(_0x554101){if(_0x554101){return _0x156bca[_0xa57c('0xe')](_0x51f287)['json'](_0x554101);}};}function respondWithFilteredResult(_0x2ed4c6,_0x5a8952){return function(_0x4200c1){if(_0x4200c1){var _0x4ca5b2=typeof _0x5a8952[_0xa57c('0xf')]===_0xa57c('0x10')&&typeof _0x5a8952[_0xa57c('0x11')]==='undefined';var _0x2644a1=_0x4200c1['count'];var _0x30d23d=_0x4ca5b2?0x0:_0x5a8952[_0xa57c('0xf')];var _0x30940d=_0x4ca5b2?_0x4200c1[_0xa57c('0x12')]:_0x5a8952[_0xa57c('0xf')]+_0x5a8952[_0xa57c('0x11')];var _0x3f900a;if(_0x30940d>=_0x2644a1){_0x30940d=_0x2644a1;_0x3f900a=0xc8;}else{_0x3f900a=0xce;}_0x2ed4c6['status'](_0x3f900a);return _0x2ed4c6[_0xa57c('0x13')](_0xa57c('0x14'),_0x30d23d+'-'+_0x30940d+'/'+_0x2644a1)[_0xa57c('0x15')](_0x4200c1);}return null;};}function saveUpdates(_0x5a6024){return function(_0x2746a0){if(_0x2746a0){return _0x2746a0['update'](_0x5a6024)[_0xa57c('0x16')](function(_0x3d781d){return _0x3d781d;});}return null;};}function removeEntity(_0x93462c){return function(_0xe3d505){if(_0xe3d505){return _0xe3d505[_0xa57c('0x17')]()[_0xa57c('0x16')](function(){var _0x6f3f89=_0xe3d505[_0xa57c('0x18')]({'plain':!![]});var _0x4e4399=_0xa57c('0x19');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e4399,'resourceId':_0x6f3f89['id']}})[_0xa57c('0x16')](function(){return _0xe3d505;});})[_0xa57c('0x16')](function(){_0x93462c[_0xa57c('0xe')](0xcc)[_0xa57c('0x1a')]();});}};}function handleEntityNotFound(_0x49242c){return function(_0x348211){if(!_0x348211){_0x49242c[_0xa57c('0xd')](0x194);}return _0x348211;};}function handleError(_0x34d1bc,_0x2213b2){_0x2213b2=_0x2213b2||0x1f4;return function(_0x3bb969){logger[_0xa57c('0x1b')](_0x3bb969[_0xa57c('0x1c')]);if(_0x3bb969[_0xa57c('0x1d')]){delete _0x3bb969[_0xa57c('0x1d')];}_0x34d1bc[_0xa57c('0xe')](_0x2213b2)[_0xa57c('0x1e')](_0x3bb969);};}exports[_0xa57c('0x1f')]=function(_0x241dcc,_0x10a33d){var _0x431bec={};var _0x511a26={'count':0x0,'rows':[]};var _0x2db443=_[_0xa57c('0x20')](db[_0xa57c('0x21')][_0xa57c('0x22')],function(_0x315ad7){return{'name':_0x315ad7[_0xa57c('0x23')],'type':_0x315ad7[_0xa57c('0x24')][_0xa57c('0x25')]};});_0x431bec=qs[_0xa57c('0x26')](_0x2db443,_0x241dcc);var _0x1d59c2={'where':_0x431bec['where']};return db[_0xa57c('0x21')]['count'](_0x1d59c2)['then'](function(_0x257661){_0x511a26[_0xa57c('0x12')]=_0x257661;_0x431bec['include']=qs[_0xa57c('0x27')](_0x241dcc[_0xa57c('0x28')]);return db[_0xa57c('0x21')]['findAll'](_0x431bec);})[_0xa57c('0x16')](function(_0x58d46f){_0x511a26[_0xa57c('0x29')]=_0x58d46f;return _0x511a26;})['then'](respondWithFilteredResult(_0x10a33d,_0x431bec))[_0xa57c('0x2a')](handleError(_0x10a33d,null));};exports['show']=function(_0xd4c5d4,_0x532164){var _0x9e02bb={'raw':!![],'where':{'id':_0xd4c5d4[_0xa57c('0x2b')]['id']}},_0x1d82d9={};_0x1d82d9[_0xa57c('0x2c')]=_[_0xa57c('0x2d')](db[_0xa57c('0x21')][_0xa57c('0x22')]);_0x1d82d9['query']=_[_0xa57c('0x2d')](_0xd4c5d4['query']);_0x1d82d9[_0xa57c('0x2e')]=_[_0xa57c('0x2f')](_0x1d82d9[_0xa57c('0x2c')],_0x1d82d9['query']);_0x9e02bb[_0xa57c('0x30')]=_['intersection'](_0x1d82d9[_0xa57c('0x2c')],qs['fields'](_0xd4c5d4[_0xa57c('0x28')]['fields']));_0x9e02bb[_0xa57c('0x30')]=_0x9e02bb[_0xa57c('0x30')]['length']?_0x9e02bb[_0xa57c('0x30')]:_0x1d82d9['model'];if(_0xd4c5d4[_0xa57c('0x28')]['includeAll']){_0x9e02bb[_0xa57c('0x27')]=[{'all':!![]}];}_0x9e02bb=_[_0xa57c('0x31')]({},_0x9e02bb,_0xd4c5d4[_0xa57c('0x32')]);return db[_0xa57c('0x21')][_0xa57c('0x33')](_0x9e02bb)[_0xa57c('0x16')](handleEntityNotFound(_0x532164,null))['then'](respondWithResult(_0x532164,null))['catch'](handleError(_0x532164,null));};exports[_0xa57c('0x34')]=function(_0x13e390,_0x2c70d6){return db['FaxQueue'][_0xa57c('0x34')](_0x13e390['body'],{})[_0xa57c('0x16')](function(_0x4184f3){var _0x5c8256=_0x13e390['user']['get']({'plain':!![]});if(!_0x5c8256)throw new Error(_0xa57c('0x35'));if(_0x5c8256[_0xa57c('0x36')]===_0xa57c('0x37')){var _0x21e4df=_0x4184f3[_0xa57c('0x18')]({'plain':!![]});var _0x1b98a0='FaxQueues';return db[_0xa57c('0x38')][_0xa57c('0x33')]({'where':{'name':_0x1b98a0,'userProfileId':_0x5c8256['userProfileId']},'raw':!![]})['then'](function(_0x5e10b){if(_0x5e10b&&_0x5e10b[_0xa57c('0x39')]===0x0){return db['UserProfileResource'][_0xa57c('0x34')]({'name':_0x21e4df[_0xa57c('0x1d')],'resourceId':_0x21e4df['id'],'type':_0x5e10b[_0xa57c('0x1d')],'sectionId':_0x5e10b['id']},{})[_0xa57c('0x16')](function(){return _0x4184f3;});}else{return _0x4184f3;}})[_0xa57c('0x2a')](function(_0x43c1d7){logger['error'](_0xa57c('0x3a'),_0x43c1d7);throw _0x43c1d7;});}return _0x4184f3;})['then'](respondWithResult(_0x2c70d6,0xc9))['catch'](handleError(_0x2c70d6,null));};exports['update']=function(_0x520383,_0x588199){if(_0x520383[_0xa57c('0x3b')]['id']){delete _0x520383[_0xa57c('0x3b')]['id'];}return db[_0xa57c('0x21')]['find']({'where':{'id':_0x520383['params']['id']}})['then'](handleEntityNotFound(_0x588199,null))[_0xa57c('0x16')](saveUpdates(_0x520383[_0xa57c('0x3b')],null))[_0xa57c('0x16')](respondWithResult(_0x588199,null))[_0xa57c('0x2a')](handleError(_0x588199,null));};exports[_0xa57c('0x17')]=function(_0x17c5dd,_0x48d2a7){return db[_0xa57c('0x21')][_0xa57c('0x33')]({'where':{'id':_0x17c5dd[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](handleEntityNotFound(_0x48d2a7,null))[_0xa57c('0x16')](removeEntity(_0x48d2a7,null))[_0xa57c('0x2a')](handleError(_0x48d2a7,null));};exports['describe']=function(_0x246f84,_0xcf1c29){return db[_0xa57c('0x21')][_0xa57c('0x3c')]()[_0xa57c('0x16')](respondWithResult(_0xcf1c29,null))['catch'](handleError(_0xcf1c29,null));};exports[_0xa57c('0x3d')]=function(_0x13ede7,_0xa18f64){var _0x17aae4={'raw':!![],'where':{}},_0x7ba8ab={},_0x11fccc;return db['FaxQueue'][_0xa57c('0x3e')]({'where':{'id':_0x13ede7[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](handleEntityNotFound(_0xa18f64,null))[_0xa57c('0x16')](function(_0x2ea6af){if(_0x2ea6af){_0x11fccc=_0x2ea6af[_0xa57c('0x18')]({'plain':!![]});_0x7ba8ab['model']=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x7ba8ab[_0xa57c('0x28')]=_['keys'](_0x13ede7[_0xa57c('0x28')]);_0x7ba8ab[_0xa57c('0x2e')]=_['intersection'](_0x7ba8ab[_0xa57c('0x2c')],_0x7ba8ab[_0xa57c('0x28')]);_0x17aae4[_0xa57c('0x30')]=_[_0xa57c('0x2f')](_0x7ba8ab[_0xa57c('0x2c')],qs['fields'](_0x13ede7[_0xa57c('0x28')][_0xa57c('0x3f')]));_0x17aae4[_0xa57c('0x30')]=_0x17aae4[_0xa57c('0x30')][_0xa57c('0x40')]?_0x17aae4['attributes']:_0x7ba8ab[_0xa57c('0x2c')];if(!_0x13ede7['query']['hasOwnProperty'](_0xa57c('0x41'))){_0x17aae4[_0xa57c('0x11')]=qs[_0xa57c('0x11')](_0x13ede7['query']['limit']);_0x17aae4[_0xa57c('0xf')]=qs[_0xa57c('0xf')](_0x13ede7[_0xa57c('0x28')][_0xa57c('0xf')]);}_0x17aae4['order']=qs[_0xa57c('0x42')](_0x13ede7[_0xa57c('0x28')][_0xa57c('0x42')]);_0x17aae4['where']=qs['filters'](_[_0xa57c('0x43')](_0x13ede7[_0xa57c('0x28')],_0x7ba8ab['filters']));_0x17aae4[_0xa57c('0x44')][_0xa57c('0x45')]=_0x2ea6af['id'];if(_0x13ede7[_0xa57c('0x28')][_0xa57c('0x46')]){_0x17aae4[_0xa57c('0x44')]=_[_0xa57c('0x31')](_0x17aae4[_0xa57c('0x44')],{'$or':_['map'](_0x17aae4['attributes'],function(_0x2f93fd){var _0x14f3d6={};_0x14f3d6[_0x2f93fd]={'$like':'%'+_0x13ede7[_0xa57c('0x28')][_0xa57c('0x46')]+'%'};return _0x14f3d6;})});}_0x17aae4=_[_0xa57c('0x31')]({},_0x17aae4,_0x13ede7[_0xa57c('0x32')]);return db[_0xa57c('0x47')][_0xa57c('0x48')](_0x17aae4);}})['then'](function(_0x4da028){if(_0x4da028){return db[_0xa57c('0x49')]['findAndCountAll']({'where':{'id':_[_0xa57c('0x20')](_0x4da028,_0xa57c('0x4a')),'role':_0xa57c('0x4b')},'attributes':['id','name',_0xa57c('0x4c'),'updatedAt',_0xa57c('0x4d')]});}})['then'](function(_0x39484d){if(_0x39484d){return{'count':_0x39484d[_0xa57c('0x12')],'rows':_[_0xa57c('0x20')](_0x39484d[_0xa57c('0x29')],function(_0x4c192d){return{'membername':_0x4c192d[_0xa57c('0x1d')],'UserId':_0x4c192d['id'],'queue_name':_0x11fccc[_0xa57c('0x1d')],'FaxQueueId':_0x11fccc['id'],'interface':util[_0xa57c('0x4e')](_0xa57c('0x4f'),_0xa57c('0x50'),_0x4c192d['name']),'penalty':0x0,'paused':_0x4c192d[_0xa57c('0x4c')],'createdAt':_0x4c192d[_0xa57c('0x4d')],'updatedAt':_0x4c192d[_0xa57c('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa57c('0x16')](respondWithFilteredResult(_0xa18f64,_0x17aae4))[_0xa57c('0x2a')](handleError(_0xa18f64,null));};exports[_0xa57c('0x52')]=function(_0x143ec3,_0x419527){var _0x3424a7={};var _0x41041f={};var _0x5a046e;var _0x261c99;return db[_0xa57c('0x21')][_0xa57c('0x3e')]({'where':{'id':_0x143ec3[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](handleEntityNotFound(_0x419527,null))[_0xa57c('0x16')](function(_0x5440c2){if(_0x5440c2){_0x5a046e=_0x5440c2;_0x41041f[_0xa57c('0x2c')]=_[_0xa57c('0x2d')](db['Team'][_0xa57c('0x22')]);_0x41041f[_0xa57c('0x28')]=_[_0xa57c('0x2d')](_0x143ec3[_0xa57c('0x28')]);_0x41041f[_0xa57c('0x2e')]=_[_0xa57c('0x2f')](_0x41041f[_0xa57c('0x2c')],_0x41041f['query']);_0x3424a7[_0xa57c('0x30')]=_['intersection'](_0x41041f[_0xa57c('0x2c')],qs['fields'](_0x143ec3[_0xa57c('0x28')]['fields']));_0x3424a7[_0xa57c('0x30')]=_0x3424a7[_0xa57c('0x30')]['length']?_0x3424a7[_0xa57c('0x30')]:_0x41041f[_0xa57c('0x2c')];_0x3424a7[_0xa57c('0x53')]=qs[_0xa57c('0x42')](_0x143ec3['query'][_0xa57c('0x42')]);_0x3424a7[_0xa57c('0x44')]=qs[_0xa57c('0x2e')](_[_0xa57c('0x43')](_0x143ec3[_0xa57c('0x28')],_0x41041f[_0xa57c('0x2e')]));if(_0x143ec3[_0xa57c('0x28')][_0xa57c('0x46')]){_0x3424a7[_0xa57c('0x44')]=_[_0xa57c('0x31')](_0x3424a7[_0xa57c('0x44')],{'$or':_[_0xa57c('0x20')](_0x3424a7[_0xa57c('0x30')],function(_0x83e9c7){var _0x23552a={};_0x23552a[_0x83e9c7]={'$like':'%'+_0x143ec3[_0xa57c('0x28')]['filter']+'%'};return _0x23552a;})});}_0x3424a7=_[_0xa57c('0x31')]({},_0x3424a7,_0x143ec3['options']);return _0x5a046e[_0xa57c('0x52')](_0x3424a7);}})[_0xa57c('0x16')](function(_0x245238){if(_0x245238){_0x261c99=_0x245238['length'];if(!_0x143ec3[_0xa57c('0x28')][_0xa57c('0x54')](_0xa57c('0x41'))){_0x3424a7['limit']=qs['limit'](_0x143ec3[_0xa57c('0x28')][_0xa57c('0x11')]);_0x3424a7[_0xa57c('0xf')]=qs[_0xa57c('0xf')](_0x143ec3[_0xa57c('0x28')][_0xa57c('0xf')]);}return _0x5a046e[_0xa57c('0x52')](_0x3424a7);}})[_0xa57c('0x16')](function(_0x37cbaf){if(_0x37cbaf){return _0x37cbaf?{'count':_0x261c99,'rows':_0x37cbaf}:null;}})['then'](respondWithResult(_0x419527,null))[_0xa57c('0x2a')](handleError(_0x419527,null));};exports[_0xa57c('0x55')]=function(_0x55f526,_0x2e37d7){var _0x1df5f6=_0x55f526[_0xa57c('0x3b')][_0xa57c('0x56')];return db[_0xa57c('0x57')][_0xa57c('0x48')]({'where':{'id':_0x1df5f6},'attributes':['id'],'include':[{'model':db[_0xa57c('0x49')],'as':_0xa57c('0x58'),'attributes':['id','name',_0xa57c('0x59'),_0xa57c('0x5a'),'interface'],'raw':!![]}]})[_0xa57c('0x16')](function(_0x4a74d7){if(_0x4a74d7){var _0x5454cb=_['flatMap'](_0x4a74d7,function(_0x30dac7){var _0x3a5e2d=_0x30dac7[_0xa57c('0x18')]({'plain':!![]});return _0x3a5e2d[_0xa57c('0x58')];});return db[_0xa57c('0x21')]['find']({'where':{'id':_0x55f526[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](function(_0x2fd797){return db['sequelize'][_0xa57c('0x5b')](function(_0x5a3611){return _0x2fd797[_0xa57c('0x55')](_0x1df5f6,{'transaction':_0x5a3611})[_0xa57c('0x16')](function(){return BPromise[_0xa57c('0x5c')](_0x5454cb,function(_0x2bd081){return db['UserFaxQueue'][_0xa57c('0x5d')]({'where':{'UserId':_0x2bd081['id'],'FaxQueueId':_0x55f526[_0xa57c('0x2b')]['id']},'transaction':_0x5a3611});});})[_0xa57c('0x16')](function(){_0x5454cb[_0xa57c('0x5e')](function(_0x5b0ce6){socket[_0xa57c('0x5f')](_0xa57c('0x60'),{'UserId':_0x5b0ce6['id'],'FaxQueueId':_0x2fd797['id']});});});});});}})[_0xa57c('0x16')](respondWithStatusCode(_0x2e37d7,null))['catch'](handleError(_0x2e37d7,null));};exports[_0xa57c('0x61')]=function(_0x448afd,_0x2ed4f4){return db['Team'][_0xa57c('0x48')]({'where':{'id':_0x448afd[_0xa57c('0x28')][_0xa57c('0x56')]},'attributes':['id'],'include':[{'model':db[_0xa57c('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa57c('0x16')](handleEntityNotFound(_0x2ed4f4,null))[_0xa57c('0x16')](function(_0x5c92ec){var _0x2dac12=_[_0xa57c('0x20')](_0x5c92ec,'id');var _0x59d2a2=[];var _0x29a4e0=[];var _0x4d4524=squel[_0xa57c('0x62')]();_0x4d4524[_0xa57c('0x63')](_0xa57c('0x64'))[_0xa57c('0x65')]('team_has_fax_queues','tq')[_0xa57c('0x66')](_0xa57c('0x67'),'ut',_0xa57c('0x68'))[_0xa57c('0x44')](_0xa57c('0x69'),_0x448afd[_0xa57c('0x2b')]['id']);for(var _0x18b36e=0x0;_0x18b36e<_0x5c92ec[_0xa57c('0x40')];_0x18b36e+=0x1){let _0x1129f=_0x5c92ec[_0x18b36e];for(var _0x2c4e6c=0x0;_0x2c4e6c<_0x1129f[_0xa57c('0x58')]['length'];_0x2c4e6c+=0x1){let _0x488c35=_0x1129f['Agents'][_0x2c4e6c];var _0x29b491=_0x4d4524['clone']();_0x29b491[_0xa57c('0x44')](_0xa57c('0x6a'),_0x488c35['id']);_0x29a4e0[_0xa57c('0x6b')](db['sequelize'][_0xa57c('0x28')](_0x29b491[_0xa57c('0x6c')](),{'type':db[_0xa57c('0x6d')][_0xa57c('0x6e')][_0xa57c('0x6f')]})[_0xa57c('0x16')](function(_0x1cde94){if(_0x1cde94['length']===0x1){return _0x488c35['id'];}else{var _0xcebd5e=_[_0xa57c('0x70')](_['map'](_0x1cde94,'TeamId'),function(_0x1d0d13){return _[_0xa57c('0x71')](_0x2dac12,_0x1d0d13);});if(_0xcebd5e){return _0x488c35['id'];}}}));}}return BPromise['all'](_0x29a4e0)['then'](function(_0xc5f17e){_0x59d2a2=_(_0x59d2a2)['union'](_0xc5f17e)[_0xa57c('0x72')]()[_0xa57c('0x73')]();return db['FaxQueue'][_0xa57c('0x33')]({'where':{'id':_0x448afd[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](function(_0x3df8f5){return db[_0xa57c('0x6d')]['transaction'](function(_0x17fc78){return _0x3df8f5['removeTeams'](_0x448afd[_0xa57c('0x28')][_0xa57c('0x56')],{'transaction':_0x17fc78})['then'](function(){if(!_['isEmpty'](_0x59d2a2)){return _0x3df8f5['removeAgents'](_0x59d2a2,{'transaction':_0x17fc78});}})[_0xa57c('0x16')](function(){_0x59d2a2['forEach'](function(_0x502309){socket[_0xa57c('0x5f')](_0xa57c('0x74'),{'UserId':_0x502309,'FaxQueueId':_0x3df8f5['id']});});});});});});})[_0xa57c('0x16')](respondWithStatusCode(_0x2ed4f4,null))['catch'](handleError(_0x2ed4f4,null));};exports[_0xa57c('0x75')]=function(_0x1f28e9,_0x11e592){return db['FaxQueue']['find']({'where':{'id':_0x1f28e9[_0xa57c('0x2b')]['id']}})['then'](handleEntityNotFound(_0x11e592,null))[_0xa57c('0x16')](function(_0x41d535){if(_0x41d535){return _0x41d535['addAgents'](_0x1f28e9[_0xa57c('0x3b')]['ids'],_['omit'](_0x1f28e9['body'],[_0xa57c('0x56'),'id'])||{})['spread'](function(_0x5143c0){for(var _0x542194=0x0;_0x542194<_0x1f28e9[_0xa57c('0x3b')][_0xa57c('0x56')]['length'];_0x542194+=0x1){socket[_0xa57c('0x5f')](_0xa57c('0x60'),{'UserId':Number(_0x1f28e9[_0xa57c('0x3b')]['ids'][_0x542194]),'FaxQueueId':Number(_0x1f28e9[_0xa57c('0x2b')]['id'])});}return _0x5143c0;});}})[_0xa57c('0x16')](respondWithResult(_0x11e592,null))[_0xa57c('0x2a')](handleError(_0x11e592,null));};exports[_0xa57c('0x76')]=function(_0x54bf3d,_0x5e0db8){return db[_0xa57c('0x21')]['find']({'where':{'id':_0x54bf3d[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](handleEntityNotFound(_0x5e0db8,null))[_0xa57c('0x16')](function(_0x4dc6ac){if(_0x4dc6ac){return _0x4dc6ac[_0xa57c('0x76')](_0x54bf3d['query']['ids'])[_0xa57c('0x16')](function(){if(_['isArray'](_0x54bf3d[_0xa57c('0x28')][_0xa57c('0x56')])){for(var _0x536e87=0x0;_0x536e87<_0x54bf3d['query'][_0xa57c('0x56')][_0xa57c('0x40')];_0x536e87+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x54bf3d[_0xa57c('0x28')][_0xa57c('0x56')][_0x536e87]),'FaxQueueId':Number(_0x54bf3d[_0xa57c('0x2b')]['id'])});}}else{socket['emit'](_0xa57c('0x74'),{'UserId':Number(_0x54bf3d[_0xa57c('0x28')][_0xa57c('0x56')]),'FaxQueueId':Number(_0x54bf3d[_0xa57c('0x2b')]['id'])});}});}})[_0xa57c('0x16')](respondWithStatusCode(_0x5e0db8,null))[_0xa57c('0x2a')](handleError(_0x5e0db8,null));};exports[_0xa57c('0x77')]=function(_0x4133f7,_0x39e5d6){var _0x75888e={};var _0x46b223={};var _0x2fa5fe;var _0x3c82d7;return db['FaxQueue'][_0xa57c('0x3e')]({'where':{'id':_0x4133f7[_0xa57c('0x2b')]['id']}})[_0xa57c('0x16')](handleEntityNotFound(_0x39e5d6,null))[_0xa57c('0x16')](function(_0x159b00){if(_0x159b00){_0x2fa5fe=_0x159b00;_0x46b223[_0xa57c('0x2c')]=_['keys'](db['User'][_0xa57c('0x22')]);_0x46b223['query']=_['keys'](_0x4133f7[_0xa57c('0x28')]);_0x46b223[_0xa57c('0x2e')]=_[_0xa57c('0x2f')](_0x46b223['model'],_0x46b223[_0xa57c('0x28')]);_0x75888e[_0xa57c('0x30')]=_[_0xa57c('0x2f')](_0x46b223[_0xa57c('0x2c')],qs[_0xa57c('0x3f')](_0x4133f7['query']['fields']));_0x75888e[_0xa57c('0x30')]=_0x75888e[_0xa57c('0x30')][_0xa57c('0x40')]?_0x75888e['attributes']:_0x46b223[_0xa57c('0x2c')];_0x75888e['order']=qs[_0xa57c('0x42')](_0x4133f7[_0xa57c('0x28')][_0xa57c('0x42')]);_0x75888e[_0xa57c('0x44')]=qs[_0xa57c('0x2e')](_[_0xa57c('0x43')](_0x4133f7[_0xa57c('0x28')],_0x46b223['filters']));if(_0x4133f7['query'][_0xa57c('0x46')]){_0x75888e[_0xa57c('0x44')]=_[_0xa57c('0x31')](_0x75888e['where'],{'$or':_['map'](_0x75888e[_0xa57c('0x30')],function(_0xfff76a){var _0x169e6a={};_0x169e6a[_0xfff76a]={'$like':'%'+_0x4133f7[_0xa57c('0x28')][_0xa57c('0x46')]+'%'};return _0x169e6a;})});}_0x75888e=_['merge']({},_0x75888e,_0x4133f7[_0xa57c('0x32')]);return _0x2fa5fe[_0xa57c('0x77')](_0x75888e);}})[_0xa57c('0x16')](function(_0x5dd496){if(_0x5dd496){_0x3c82d7=_0x5dd496[_0xa57c('0x40')];if(!_0x4133f7[_0xa57c('0x28')]['hasOwnProperty'](_0xa57c('0x41'))){_0x75888e[_0xa57c('0x11')]=qs[_0xa57c('0x11')](_0x4133f7[_0xa57c('0x28')][_0xa57c('0x11')]);_0x75888e[_0xa57c('0xf')]=qs[_0xa57c('0xf')](_0x4133f7[_0xa57c('0x28')][_0xa57c('0xf')]);}return _0x2fa5fe['getAgents'](_0x75888e);}})[_0xa57c('0x16')](function(_0x56121){if(_0x56121){return _0x56121?{'count':_0x3c82d7,'rows':_0x56121}:null;}})[_0xa57c('0x16')](respondWithResult(_0x39e5d6,null))[_0xa57c('0x2a')](handleError(_0x39e5d6,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa50a=['hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x411c22,_0x5ea879){var _0x522561=function(_0x33af00){while(--_0x33af00){_0x411c22['push'](_0x411c22['shift']());}};_0x522561(++_0x5ea879);}(_0xa50a,0x1ec));var _0xaa50=function(_0x54203e,_0x1db8db){_0x54203e=_0x54203e-0x0;var _0xe307cf=_0xa50a[_0x54203e];return _0xe307cf;};'use strict';var EventEmitter=require(_0xaa50('0x0'));var FaxQueue=require(_0xaa50('0x1'))['db'][_0xaa50('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xaa50('0x3')](0x0);var events={'afterCreate':_0xaa50('0x4'),'afterUpdate':_0xaa50('0x5'),'afterDestroy':_0xaa50('0x6')};function emitEvent(_0x242e36){return function(_0x1eba54,_0x456b0c,_0x2b21d6){FaxQueueEvents[_0xaa50('0x7')](_0x242e36+':'+_0x1eba54['id'],_0x1eba54);FaxQueueEvents['emit'](_0x242e36,_0x1eba54);_0x2b21d6(null);};}for(var e in events){if(events[_0xaa50('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xaa50('0x9')]=FaxQueueEvents;
\ No newline at end of file
+var _0xf0ed=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','hook'];(function(_0x103478,_0x353eca){var _0x55d015=function(_0x5a8665){while(--_0x5a8665){_0x103478['push'](_0x103478['shift']());}};_0x55d015(++_0x353eca);}(_0xf0ed,0x181));var _0xdf0e=function(_0x57f7d7,_0x41443c){_0x57f7d7=_0x57f7d7-0x0;var _0x11b297=_0xf0ed[_0x57f7d7];return _0x11b297;};'use strict';var EventEmitter=require(_0xdf0e('0x0'));var FaxQueue=require(_0xdf0e('0x1'))['db'][_0xdf0e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xdf0e('0x3')](0x0);var events={'afterCreate':_0xdf0e('0x4'),'afterUpdate':_0xdf0e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5464f8){return function(_0x39f2bc,_0x3789a4,_0x412534){FaxQueueEvents['emit'](_0x5464f8+':'+_0x39f2bc['id'],_0x39f2bc);FaxQueueEvents['emit'](_0x5464f8,_0x39f2bc);_0x412534(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xdf0e('0x6')](e,emitEvent(event));}}module[_0xdf0e('0x7')]=FaxQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc1f5=['request-promise','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','../../config/logger','bluebird'];(function(_0x42ad6b,_0x39a94){var _0x442838=function(_0x4dc38c){while(--_0x4dc38c){_0x42ad6b['push'](_0x42ad6b['shift']());}};_0x442838(++_0x39a94);}(_0xc1f5,0x11d));var _0x5c1f=function(_0x56e9c1,_0x2024ff){_0x56e9c1=_0x56e9c1-0x0;var _0x2b18da=_0xc1f5[_0x56e9c1];return _0x2b18da;};'use strict';var _=require(_0x5c1f('0x0'));var util=require('util');var logger=require(_0x5c1f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5c1f('0x2'));var rp=require(_0x5c1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5c1f('0x4'));module['exports']=function(_0x1339df,_0x5681cb){return _0x1339df[_0x5c1f('0x5')](_0x5c1f('0x6'),attributes,{'tableName':_0x5c1f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fdc=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash'];(function(_0x5bd3c3,_0x188a86){var _0x205066=function(_0x96f056){while(--_0x96f056){_0x5bd3c3['push'](_0x5bd3c3['shift']());}};_0x205066(++_0x188a86);}(_0x3fdc,0xcf));var _0xc3fd=function(_0x370745,_0x35975d){_0x370745=_0x370745-0x0;var _0x26e4ad=_0x3fdc[_0x370745];return _0x26e4ad;};'use strict';var _=require(_0xc3fd('0x0'));var util=require(_0xc3fd('0x1'));var logger=require(_0xc3fd('0x2'))('api');var moment=require(_0xc3fd('0x3'));var BPromise=require(_0xc3fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3fd('0x5'));var rimraf=require(_0xc3fd('0x6'));var config=require(_0xc3fd('0x7'));var attributes=require(_0xc3fd('0x8'));module[_0xc3fd('0x9')]=function(_0x29b483,_0x2a3832){return _0x29b483[_0xc3fd('0xa')](_0xc3fd('0xb'),attributes,{'tableName':_0xc3fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd18f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowFaxQueue','find','info','debug','lodash','util','moment','randomstring'];(function(_0x21a7ec,_0x450563){var _0x391fbf=function(_0x2abbd3){while(--_0x2abbd3){_0x21a7ec['push'](_0x21a7ec['shift']());}};_0x391fbf(++_0x450563);}(_0xd18f,0x1bf));var _0xfd18=function(_0x135d2a,_0x546cd1){_0x135d2a=_0x135d2a-0x0;var _0xae488=_0xd18f[_0x135d2a];return _0xae488;};'use strict';var _=require(_0xfd18('0x0'));var util=require(_0xfd18('0x1'));var moment=require(_0xfd18('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd18('0x3'));var fs=require('fs');var Redis=require(_0xfd18('0x4'));var db=require(_0xfd18('0x5'))['db'];var utils=require(_0xfd18('0x6'));var logger=require(_0xfd18('0x7'))(_0xfd18('0x8'));var config=require(_0xfd18('0x9'));var jayson=require(_0xfd18('0xa'));var client=jayson[_0xfd18('0xb')][_0xfd18('0xc')]({'port':0x232a});config[_0xfd18('0xd')]=_['defaults'](config[_0xfd18('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd18('0xd')]));require(_0xfd18('0xe'))['register'](socket);function respondWithRpcPromise(_0x42ab22,_0x11dbe8,_0x489bfd){return new BPromise(function(_0x43f85d,_0x377f59){return client[_0xfd18('0xf')](_0x42ab22,_0x489bfd)[_0xfd18('0x10')](function(_0x2eebab){logger['info'](_0xfd18('0x11'),_0x11dbe8,_0xfd18('0x12'));logger['debug'](_0xfd18('0x13'),_0x11dbe8,_0xfd18('0x12'),JSON[_0xfd18('0x14')](_0x2eebab));if(_0x2eebab[_0xfd18('0x15')]){if(_0x2eebab[_0xfd18('0x15')][_0xfd18('0x16')]===0x1f4){logger[_0xfd18('0x15')](_0xfd18('0x11'),_0x11dbe8,_0x2eebab[_0xfd18('0x15')]['message']);return _0x377f59(_0x2eebab['error'][_0xfd18('0x17')]);}logger['error'](_0xfd18('0x11'),_0x11dbe8,_0x2eebab[_0xfd18('0x15')][_0xfd18('0x17')]);return _0x43f85d(_0x2eebab[_0xfd18('0x15')][_0xfd18('0x17')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x11dbe8,'request\x20sent');_0x43f85d(_0x2eebab[_0xfd18('0x18')][_0xfd18('0x17')]);}})[_0xfd18('0x19')](function(_0x4ce29d){logger['error'](_0xfd18('0x11'),_0x11dbe8,_0x4ce29d);_0x377f59(_0x4ce29d);});});}exports[_0xfd18('0x1a')]=function(_0x549eb2){var _0x5d456a=this;return new Promise(function(_0x272e03,_0x3086a1){return db[_0xfd18('0x1b')][_0xfd18('0x1c')]({'raw':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x1e')]===undefined?!![]:![]:!![],'where':_0x549eb2['options']?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x1f')]||null:null,'attributes':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x20')]||null:null,'limit':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')][_0xfd18('0x21')]||null:null,'include':_0x549eb2[_0xfd18('0x1d')]?_0x549eb2[_0xfd18('0x1d')]['include']?_['map'](_0x549eb2['options'][_0xfd18('0x22')],function(_0x566a51){return{'model':db[_0x566a51[_0xfd18('0x23')]],'as':_0x566a51['as'],'attributes':_0x566a51['attributes'],'include':_0x566a51[_0xfd18('0x22')]?_['map'](_0x566a51['include'],function(_0x220687){return{'model':db[_0x220687[_0xfd18('0x23')]],'as':_0x220687['as'],'attributes':_0x220687[_0xfd18('0x20')],'include':_0x220687[_0xfd18('0x22')]?_[_0xfd18('0x24')](_0x220687[_0xfd18('0x22')],function(_0x269417){return{'model':db[_0x269417[_0xfd18('0x23')]],'as':_0x269417['as'],'attributes':_0x269417[_0xfd18('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfd18('0x10')](function(_0x4301a0){logger['info']('GetFaxQueue',_0x549eb2);logger['debug'](_0xfd18('0x1a'),_0x549eb2,JSON['stringify'](_0x4301a0));_0x272e03(_0x4301a0);})['catch'](function(_0xcebd4e){logger['error'](_0xfd18('0x1a'),_0xcebd4e[_0xfd18('0x17')],_0x549eb2);_0x3086a1(_0x5d456a[_0xfd18('0x15')](0x1f4,_0xcebd4e['message']));});});};exports[_0xfd18('0x25')]=function(_0x11a4b3){var _0x3688c4=this;return new Promise(function(_0x2842c7,_0x1edecb){return db['FaxQueue'][_0xfd18('0x26')]({'raw':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3[_0xfd18('0x1d')][_0xfd18('0x1e')]===undefined?!![]:![]:!![],'where':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3[_0xfd18('0x1d')][_0xfd18('0x1f')]||null:null,'attributes':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3['options'][_0xfd18('0x20')]||null:null,'include':_0x11a4b3[_0xfd18('0x1d')]?_0x11a4b3[_0xfd18('0x1d')][_0xfd18('0x22')]?_[_0xfd18('0x24')](_0x11a4b3['options'][_0xfd18('0x22')],function(_0x3d34a4){return{'model':db[_0x3d34a4[_0xfd18('0x23')]],'as':_0x3d34a4['as'],'attributes':_0x3d34a4['attributes'],'include':_0x3d34a4[_0xfd18('0x22')]?_[_0xfd18('0x24')](_0x3d34a4[_0xfd18('0x22')],function(_0xddffcb){return{'model':db[_0xddffcb[_0xfd18('0x23')]],'as':_0xddffcb['as'],'attributes':_0xddffcb[_0xfd18('0x20')],'include':_0xddffcb[_0xfd18('0x22')]?_[_0xfd18('0x24')](_0xddffcb[_0xfd18('0x22')],function(_0x572a7c){return{'model':db[_0x572a7c['model']],'as':_0x572a7c['as'],'attributes':_0x572a7c[_0xfd18('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfd18('0x10')](function(_0x476a23){logger[_0xfd18('0x27')](_0xfd18('0x25'),_0x11a4b3);logger[_0xfd18('0x28')](_0xfd18('0x25'),_0x11a4b3,JSON[_0xfd18('0x14')](_0x476a23));_0x2842c7(_0x476a23);})['catch'](function(_0x455d75){logger['error'](_0xfd18('0x25'),_0x455d75[_0xfd18('0x17')],_0x11a4b3);_0x1edecb(_0x3688c4[_0xfd18('0x15')](0x1f4,_0x455d75[_0xfd18('0x17')]));});});};
\ No newline at end of file
+var _0xf86e=['client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','then','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3a466d,_0x4c06f5){var _0x14ecde=function(_0x61a666){while(--_0x61a666){_0x3a466d['push'](_0x3a466d['shift']());}};_0x14ecde(++_0x4c06f5);}(_0xf86e,0x137));var _0xef86=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0xf86e[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0xef86('0x0'));var util=require(_0xef86('0x1'));var moment=require(_0xef86('0x2'));var BPromise=require('bluebird');var rs=require(_0xef86('0x3'));var fs=require('fs');var Redis=require(_0xef86('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef86('0x5'));var logger=require(_0xef86('0x6'))(_0xef86('0x7'));var config=require('../../config/environment');var jayson=require(_0xef86('0x8'));var client=jayson[_0xef86('0x9')][_0xef86('0xa')]({'port':0x232a});config[_0xef86('0xb')]=_[_0xef86('0xc')](config[_0xef86('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xef86('0xd'))(new Redis(config[_0xef86('0xb')]));require(_0xef86('0xe'))[_0xef86('0xf')](socket);function respondWithRpcPromise(_0x4b6a79,_0x334c31,_0x2b29ed){return new BPromise(function(_0x411a27,_0x509d41){return client[_0xef86('0x10')](_0x4b6a79,_0x2b29ed)['then'](function(_0x2265a1){logger[_0xef86('0x11')]('FaxQueue,\x20%s,\x20%s',_0x334c31,_0xef86('0x12'));logger[_0xef86('0x13')](_0xef86('0x14'),_0x334c31,'request\x20sent',JSON[_0xef86('0x15')](_0x2265a1));if(_0x2265a1['error']){if(_0x2265a1[_0xef86('0x16')][_0xef86('0x17')]===0x1f4){logger['error'](_0xef86('0x18'),_0x334c31,_0x2265a1[_0xef86('0x16')][_0xef86('0x19')]);return _0x509d41(_0x2265a1[_0xef86('0x16')][_0xef86('0x19')]);}logger[_0xef86('0x16')](_0xef86('0x18'),_0x334c31,_0x2265a1[_0xef86('0x16')][_0xef86('0x19')]);return _0x411a27(_0x2265a1[_0xef86('0x16')][_0xef86('0x19')]);}else{logger['info'](_0xef86('0x18'),_0x334c31,_0xef86('0x12'));_0x411a27(_0x2265a1['result'][_0xef86('0x19')]);}})[_0xef86('0x1a')](function(_0x25ece1){logger['error'](_0xef86('0x18'),_0x334c31,_0x25ece1);_0x509d41(_0x25ece1);});});}exports[_0xef86('0x1b')]=function(_0x3b576d){var _0x18ab1b=this;return new Promise(function(_0x201cb3,_0x56d114){return db[_0xef86('0x1c')]['findAll']({'raw':_0x3b576d[_0xef86('0x1d')]?_0x3b576d[_0xef86('0x1d')][_0xef86('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b576d['options']?_0x3b576d[_0xef86('0x1d')][_0xef86('0x1f')]||null:null,'attributes':_0x3b576d[_0xef86('0x1d')]?_0x3b576d[_0xef86('0x1d')][_0xef86('0x20')]||null:null,'limit':_0x3b576d[_0xef86('0x1d')]?_0x3b576d[_0xef86('0x1d')][_0xef86('0x21')]||null:null,'include':_0x3b576d[_0xef86('0x1d')]?_0x3b576d['options'][_0xef86('0x22')]?_[_0xef86('0x23')](_0x3b576d[_0xef86('0x1d')]['include'],function(_0x3c28db){return{'model':db[_0x3c28db[_0xef86('0x24')]],'as':_0x3c28db['as'],'attributes':_0x3c28db[_0xef86('0x20')],'include':_0x3c28db['include']?_[_0xef86('0x23')](_0x3c28db[_0xef86('0x22')],function(_0x4f8e1e){return{'model':db[_0x4f8e1e[_0xef86('0x24')]],'as':_0x4f8e1e['as'],'attributes':_0x4f8e1e[_0xef86('0x20')],'include':_0x4f8e1e[_0xef86('0x22')]?_[_0xef86('0x23')](_0x4f8e1e[_0xef86('0x22')],function(_0x2e793a){return{'model':db[_0x2e793a['model']],'as':_0x2e793a['as'],'attributes':_0x2e793a[_0xef86('0x20')]};}):[]};}):[]};}):[]:[]})[_0xef86('0x25')](function(_0x5aa51d){logger['info'](_0xef86('0x1b'),_0x3b576d);logger[_0xef86('0x13')](_0xef86('0x1b'),_0x3b576d,JSON[_0xef86('0x15')](_0x5aa51d));_0x201cb3(_0x5aa51d);})[_0xef86('0x1a')](function(_0x4294c8){logger['error'](_0xef86('0x1b'),_0x4294c8[_0xef86('0x19')],_0x3b576d);_0x56d114(_0x18ab1b[_0xef86('0x16')](0x1f4,_0x4294c8['message']));});});};exports[_0xef86('0x26')]=function(_0x3f05de){var _0x474ca7=this;return new Promise(function(_0x514481,_0x39a4c0){return db[_0xef86('0x1c')][_0xef86('0x27')]({'raw':_0x3f05de[_0xef86('0x1d')]?_0x3f05de[_0xef86('0x1d')][_0xef86('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f05de[_0xef86('0x1d')]?_0x3f05de[_0xef86('0x1d')][_0xef86('0x1f')]||null:null,'attributes':_0x3f05de[_0xef86('0x1d')]?_0x3f05de['options'][_0xef86('0x20')]||null:null,'include':_0x3f05de[_0xef86('0x1d')]?_0x3f05de['options'][_0xef86('0x22')]?_[_0xef86('0x23')](_0x3f05de[_0xef86('0x1d')]['include'],function(_0x36e493){return{'model':db[_0x36e493['model']],'as':_0x36e493['as'],'attributes':_0x36e493['attributes'],'include':_0x36e493[_0xef86('0x22')]?_['map'](_0x36e493['include'],function(_0x390842){return{'model':db[_0x390842[_0xef86('0x24')]],'as':_0x390842['as'],'attributes':_0x390842[_0xef86('0x20')],'include':_0x390842[_0xef86('0x22')]?_[_0xef86('0x23')](_0x390842[_0xef86('0x22')],function(_0x57ae39){return{'model':db[_0x57ae39[_0xef86('0x24')]],'as':_0x57ae39['as'],'attributes':_0x57ae39[_0xef86('0x20')]};}):[]};}):[]};}):[]:[]})[_0xef86('0x25')](function(_0x198408){logger[_0xef86('0x11')](_0xef86('0x26'),_0x3f05de);logger[_0xef86('0x13')](_0xef86('0x26'),_0x3f05de,JSON[_0xef86('0x15')](_0x198408));_0x514481(_0x198408);})[_0xef86('0x1a')](function(_0x116ff7){logger[_0xef86('0x16')](_0xef86('0x26'),_0x116ff7[_0xef86('0x19')],_0x3f05de);_0x39a4c0(_0x474ca7[_0xef86('0x16')](0x1f4,_0x116ff7[_0xef86('0x19')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf555=['faxQueue:','./faxQueue.events','save','remove','update','emit','register','length'];(function(_0x29117d,_0x1b884e){var _0x157c92=function(_0x2947eb){while(--_0x2947eb){_0x29117d['push'](_0x29117d['shift']());}};_0x157c92(++_0x1b884e);}(_0xf555,0xc1));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x5f55('0x0'));var events=[_0x5f55('0x1'),_0x5f55('0x2'),_0x5f55('0x3')];function createListener(_0x1303e2,_0x527045){return function(_0x40e97d){_0x527045[_0x5f55('0x4')](_0x1303e2,_0x40e97d);};}function removeListener(_0x3f4299,_0x5371d6){return function(){FaxQueueEvents['removeListener'](_0x3f4299,_0x5371d6);};}exports[_0x5f55('0x5')]=function(_0x2ea7e1){for(var _0x4b1c0a=0x0,_0x4b0466=events[_0x5f55('0x6')];_0x4b1c0a<_0x4b0466;_0x4b1c0a++){var _0x50ef6e=events[_0x4b1c0a];var _0x2f93a0=createListener(_0x5f55('0x7')+_0x50ef6e,_0x2ea7e1);FaxQueueEvents['on'](_0x50ef6e,_0x2f93a0);}};
\ No newline at end of file
+var _0x9559=['remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x2e1d3d,_0x719bf0){var _0x3d81df=function(_0x3ddfa3){while(--_0x3ddfa3){_0x2e1d3d['push'](_0x2e1d3d['shift']());}};_0x3d81df(++_0x719bf0);}(_0x9559,0x12b));var _0x9955=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x9559[_0xce6f11];return _0x35b709;};'use strict';var FaxQueueEvents=require(_0x9955('0x0'));var events=['save',_0x9955('0x1'),'update'];function createListener(_0x6c0c51,_0x9736a0){return function(_0x52f499){_0x9736a0[_0x9955('0x2')](_0x6c0c51,_0x52f499);};}function removeListener(_0x14a6a9,_0x4b4dc8){return function(){FaxQueueEvents[_0x9955('0x3')](_0x14a6a9,_0x4b4dc8);};}exports['register']=function(_0x64d0be){for(var _0x406788=0x0,_0x59d3c8=events[_0x9955('0x4')];_0x406788<_0x59d3c8;_0x406788++){var _0x489056=events[_0x406788];var _0x2ceb68=createListener(_0x9955('0x5')+_0x489056,_0x64d0be);FaxQueueEvents['on'](_0x489056,_0x2ceb68);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x07e8=['post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','fs-extra','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x1c1820,_0x18bb79){var _0x6690e6=function(_0x11ae54){while(--_0x11ae54){_0x1c1820['push'](_0x1c1820['shift']());}};_0x6690e6(++_0x18bb79);}(_0x07e8,0x10f));var _0x807e=function(_0x5e8394,_0x2e0c21){_0x5e8394=_0x5e8394-0x0;var _0x1e469d=_0x07e8[_0x5e8394];return _0x1e469d;};'use strict';var multer=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var path=require(_0x807e('0x2'));var timeout=require('connect-timeout');var express=require(_0x807e('0x3'));var router=express['Router']();var fs_extra=require(_0x807e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x807e('0x5'));var controller=require(_0x807e('0x6'));router[_0x807e('0x7')]('/',auth['isAuthenticated'](),controller[_0x807e('0x8')]);router[_0x807e('0x7')](_0x807e('0x9'),auth[_0x807e('0xa')](),controller[_0x807e('0xb')]);router['get'](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0xd')]);router[_0x807e('0x7')](_0x807e('0xe'),auth[_0x807e('0xa')](),controller[_0x807e('0xf')]);router[_0x807e('0x7')](_0x807e('0x10'),auth[_0x807e('0xa')](),controller[_0x807e('0x11')]);router[_0x807e('0x7')](_0x807e('0x12'),auth[_0x807e('0xa')](),controller['getAgents']);router[_0x807e('0x13')]('/',auth[_0x807e('0xa')](),controller[_0x807e('0x14')]);router[_0x807e('0x13')](_0x807e('0x10'),auth[_0x807e('0xa')](),controller[_0x807e('0x15')]);router['post']('/:id/users',auth[_0x807e('0xa')](),controller[_0x807e('0x16')]);router[_0x807e('0x17')](_0x807e('0xc'),auth['isAuthenticated'](),controller[_0x807e('0x18')]);router[_0x807e('0x19')](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0x1a')]);router[_0x807e('0x19')]('/:id/teams',auth[_0x807e('0xa')](),controller['removeTeams']);router[_0x807e('0x19')](_0x807e('0x12'),auth[_0x807e('0xa')](),controller[_0x807e('0x1b')]);module[_0x807e('0x1c')]=router;
\ No newline at end of file
+var _0x4888=['/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index'];(function(_0xe73909,_0x19d53f){var _0x2b849b=function(_0x1c3525){while(--_0x1c3525){_0xe73909['push'](_0xe73909['shift']());}};_0x2b849b(++_0x19d53f);}(_0x4888,0x198));var _0x8488=function(_0x5becd6,_0x13e651){_0x5becd6=_0x5becd6-0x0;var _0x3b7b78=_0x4888[_0x5becd6];return _0x3b7b78;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['show']);router[_0x8488('0x9')](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router['get'](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x9')](_0x8488('0x11'),auth['isAuthenticated'](),controller[_0x8488('0x12')]);router[_0x8488('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8488('0x13')]('/:id/teams',auth[_0x8488('0xa')](),controller['addTeams']);router['post'](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x14')]);router[_0x8488('0x15')](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x16')]);router['delete'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x17')]);router[_0x8488('0x18')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x19')]);router[_0x8488('0x18')](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x1a')]);module[_0x8488('0x1b')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75fc=['exports','STRING','DATE','moment','sequelize'];(function(_0x27fecd,_0x490a88){var _0x458423=function(_0x1df95f){while(--_0x1df95f){_0x27fecd['push'](_0x27fecd['shift']());}};_0x458423(++_0x490a88);}(_0x75fc,0x8a));var _0xc75f=function(_0x3bb744,_0x18cdeb){_0x3bb744=_0x3bb744-0x0;var _0x374564=_0x75fc[_0x3bb744];return _0x374564;};'use strict';var moment=require(_0xc75f('0x0'));var Sequelize=require(_0xc75f('0x1'));module[_0xc75f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc75f('0x3')]},'joinAt':{'type':Sequelize[_0xc75f('0x4')]},'leaveAt':{'type':Sequelize[_0xc75f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc75f('0x3')]}};
\ No newline at end of file
+var _0xb8ec=['STRING','DATE','moment'];(function(_0x424f10,_0x238dc9){var _0x2f268d=function(_0x1902e2){while(--_0x1902e2){_0x424f10['push'](_0x424f10['shift']());}};_0x2f268d(++_0x238dc9);}(_0xb8ec,0x98));var _0xcb8e=function(_0x50d373,_0x4724f3){_0x50d373=_0x50d373-0x0;var _0x2d731a=_0xb8ec[_0x50d373];return _0x2d731a;};'use strict';var moment=require(_0xcb8e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcb8e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xcb8e('0x1')]},'joinAt':{'type':Sequelize[_0xcb8e('0x2')]},'leaveAt':{'type':Sequelize[_0xcb8e('0x2')]},'acceptAt':{'type':Sequelize[_0xcb8e('0x2')]},'exitAt':{'type':Sequelize[_0xcb8e('0x2')]},'reason':{'type':Sequelize[_0xcb8e('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0851=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','json','reject','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','keys','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1d3642,_0x48fdc2){var _0x5de26=function(_0x91373e){while(--_0x91373e){_0x1d3642['push'](_0x1d3642['shift']());}};_0x5de26(++_0x48fdc2);}(_0x0851,0x8a));var _0x1085=function(_0x119ded,_0x497e72){_0x119ded=_0x119ded-0x0;var _0x22108b=_0x0851[_0x119ded];return _0x22108b;};'use strict';var emlformat=require(_0x1085('0x0'));var rimraf=require(_0x1085('0x1'));var zipdir=require(_0x1085('0x2'));var jsonpatch=require(_0x1085('0x3'));var rp=require('request-promise');var moment=require(_0x1085('0x4'));var BPromise=require(_0x1085('0x5'));var Mustache=require(_0x1085('0x6'));var util=require(_0x1085('0x7'));var path=require(_0x1085('0x8'));var sox=require(_0x1085('0x9'));var csv=require(_0x1085('0xa'));var ejs=require(_0x1085('0xb'));var fs=require('fs');var fs_extra=require(_0x1085('0xc'));var _=require(_0x1085('0xd'));var squel=require(_0x1085('0xe'));var crypto=require(_0x1085('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1085('0xa'));var querystring=require(_0x1085('0x10'));var Papa=require(_0x1085('0x11'));var Redis=require(_0x1085('0x12'));var authService=require(_0x1085('0x13'));var qs=require(_0x1085('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1085('0x15'));var logger=require(_0x1085('0x16'))(_0x1085('0x17'));var utils=require(_0x1085('0x18'));var config=require(_0x1085('0x19'));var licenseUtil=require(_0x1085('0x1a'));var db=require(_0x1085('0x1b'))['db'];function respondWithStatusCode(_0x4c7520,_0x3664c9){_0x3664c9=_0x3664c9||0xcc;return function(_0x95194a){if(_0x95194a){return _0x4c7520[_0x1085('0x1c')](_0x3664c9);}return _0x4c7520['status'](_0x3664c9)[_0x1085('0x1d')]();};}function respondWithResult(_0x59802d,_0x4754c9){_0x4754c9=_0x4754c9||0xc8;return function(_0x23dcd7){if(_0x23dcd7){return _0x59802d[_0x1085('0x1e')](_0x4754c9)['json'](_0x23dcd7);}};}function respondWithFilteredResult(_0x334c3a,_0x27b8d9){return function(_0x1332ad){if(_0x1332ad){var _0x41e4d7=typeof _0x27b8d9['offset']===_0x1085('0x1f')&&typeof _0x27b8d9['limit']===_0x1085('0x1f');var _0x5877e9=_0x1332ad[_0x1085('0x20')];var _0x37b760=_0x41e4d7?0x0:_0x27b8d9[_0x1085('0x21')];var _0x5e2270=_0x41e4d7?_0x1332ad[_0x1085('0x20')]:_0x27b8d9['offset']+_0x27b8d9[_0x1085('0x22')];var _0x5b715a;if(_0x5e2270>=_0x5877e9){_0x5e2270=_0x5877e9;_0x5b715a=0xc8;}else{_0x5b715a=0xce;}_0x334c3a['status'](_0x5b715a);return _0x334c3a['set']('Content-Range',_0x37b760+'-'+_0x5e2270+'/'+_0x5877e9)[_0x1085('0x23')](_0x1332ad);}return null;};}function patchUpdates(_0x5c89f2){return function(_0x5460cb){try{jsonpatch['apply'](_0x5460cb,_0x5c89f2,!![]);}catch(_0x17aed6){return BPromise[_0x1085('0x24')](_0x17aed6);}return _0x5460cb[_0x1085('0x25')]();};}function saveUpdates(_0x50d3d6,_0x146a78){return function(_0x3c77f2){if(_0x3c77f2){return _0x3c77f2['update'](_0x50d3d6)[_0x1085('0x26')](function(_0x55a0eb){return _0x55a0eb;});}return null;};}function removeEntity(_0x32efc1,_0x54f32c){return function(_0xafd7df){if(_0xafd7df){return _0xafd7df[_0x1085('0x27')]()[_0x1085('0x26')](function(){_0x32efc1['status'](0xcc)[_0x1085('0x1d')]();});}};}function handleEntityNotFound(_0x1698e2,_0x2712c9){return function(_0x552876){if(!_0x552876){_0x1698e2[_0x1085('0x1c')](0x194);}return _0x552876;};}function handleError(_0xbf3272,_0x3f788b){_0x3f788b=_0x3f788b||0x1f4;return function(_0x4b3ca1){logger[_0x1085('0x28')](_0x4b3ca1[_0x1085('0x29')]);if(_0x4b3ca1[_0x1085('0x2a')]){delete _0x4b3ca1[_0x1085('0x2a')];}_0xbf3272[_0x1085('0x1e')](_0x3f788b)[_0x1085('0x2b')](_0x4b3ca1);};}exports[_0x1085('0x2c')]=function(_0x2a90d1,_0x22f3d9){var _0x417cb6={},_0x1881d5={},_0x5c5ed1={'count':0x0,'rows':[]};var _0x24959b=_[_0x1085('0x2d')](db[_0x1085('0x2e')][_0x1085('0x2f')],function(_0x41da9b){return{'name':_0x41da9b[_0x1085('0x30')],'type':_0x41da9b[_0x1085('0x31')][_0x1085('0x32')]};});_0x1881d5[_0x1085('0x33')]=_[_0x1085('0x2d')](_0x24959b,_0x1085('0x2a'));_0x1881d5[_0x1085('0x34')]=_['keys'](_0x2a90d1[_0x1085('0x34')]);_0x1881d5[_0x1085('0x35')]=_['intersection'](_0x1881d5[_0x1085('0x33')],_0x1881d5[_0x1085('0x34')]);_0x417cb6[_0x1085('0x36')]=_[_0x1085('0x37')](_0x1881d5[_0x1085('0x33')],qs['fields'](_0x2a90d1[_0x1085('0x34')][_0x1085('0x38')]));_0x417cb6['attributes']=_0x417cb6[_0x1085('0x36')][_0x1085('0x39')]?_0x417cb6[_0x1085('0x36')]:_0x1881d5[_0x1085('0x33')];if(!_0x2a90d1['query'][_0x1085('0x3a')](_0x1085('0x3b'))){_0x417cb6[_0x1085('0x22')]=qs[_0x1085('0x22')](_0x2a90d1['query'][_0x1085('0x22')]);_0x417cb6[_0x1085('0x21')]=qs[_0x1085('0x21')](_0x2a90d1['query'][_0x1085('0x21')]);}_0x417cb6['order']=qs[_0x1085('0x3c')](_0x2a90d1['query'][_0x1085('0x3c')]);_0x417cb6[_0x1085('0x3d')]=qs['filters'](_[_0x1085('0x3e')](_0x2a90d1[_0x1085('0x34')],_0x1881d5['filters']),_0x24959b);if(_0x2a90d1[_0x1085('0x34')]['filter']){_0x417cb6['where']=_[_0x1085('0x3f')](_0x417cb6[_0x1085('0x3d')],{'$or':_['map'](_0x24959b,function(_0x2b34b9){if(_0x2b34b9[_0x1085('0x31')]!==_0x1085('0x40')){var _0x34b696={};_0x34b696[_0x2b34b9['name']]={'$like':'%'+_0x2a90d1[_0x1085('0x34')][_0x1085('0x41')]+'%'};return _0x34b696;}})});}_0x417cb6=_[_0x1085('0x3f')]({},_0x417cb6,_0x2a90d1[_0x1085('0x42')]);var _0x3d11f4={'where':_0x417cb6['where']};return db[_0x1085('0x2e')]['count'](_0x3d11f4)['then'](function(_0x3b7482){_0x5c5ed1['count']=_0x3b7482;if(_0x2a90d1['query']['includeAll']){_0x417cb6[_0x1085('0x43')]=[{'all':!![]}];}return db[_0x1085('0x2e')][_0x1085('0x44')](_0x417cb6);})[_0x1085('0x26')](function(_0x3bda3b){_0x5c5ed1[_0x1085('0x45')]=_0x3bda3b;return _0x5c5ed1;})[_0x1085('0x26')](respondWithFilteredResult(_0x22f3d9,_0x417cb6))['catch'](handleError(_0x22f3d9,null));};exports['show']=function(_0x26fefd,_0x47a10c){var _0x4e8ccf={'raw':!![],'where':{'id':_0x26fefd[_0x1085('0x46')]['id']}},_0x2fbad5={};_0x2fbad5[_0x1085('0x33')]=_[_0x1085('0x47')](db[_0x1085('0x2e')][_0x1085('0x2f')]);_0x2fbad5[_0x1085('0x34')]=_['keys'](_0x26fefd['query']);_0x2fbad5[_0x1085('0x35')]=_['intersection'](_0x2fbad5['model'],_0x2fbad5[_0x1085('0x34')]);_0x4e8ccf[_0x1085('0x36')]=_[_0x1085('0x37')](_0x2fbad5[_0x1085('0x33')],qs[_0x1085('0x38')](_0x26fefd[_0x1085('0x34')][_0x1085('0x38')]));_0x4e8ccf[_0x1085('0x36')]=_0x4e8ccf['attributes'][_0x1085('0x39')]?_0x4e8ccf['attributes']:_0x2fbad5[_0x1085('0x33')];if(_0x26fefd[_0x1085('0x34')][_0x1085('0x48')]){_0x4e8ccf[_0x1085('0x43')]=[{'all':!![]}];}_0x4e8ccf=_[_0x1085('0x3f')]({},_0x4e8ccf,_0x26fefd['options']);return db[_0x1085('0x2e')][_0x1085('0x49')](_0x4e8ccf)[_0x1085('0x26')](handleEntityNotFound(_0x47a10c,null))[_0x1085('0x26')](respondWithResult(_0x47a10c,null))[_0x1085('0x4a')](handleError(_0x47a10c,null));};exports['create']=function(_0x3b004d,_0x32c07d){return db[_0x1085('0x2e')][_0x1085('0x4b')](_0x3b004d[_0x1085('0x4c')],{})[_0x1085('0x26')](respondWithResult(_0x32c07d,0xc9))['catch'](handleError(_0x32c07d,null));};exports[_0x1085('0x4d')]=function(_0x43ccd2,_0x7338f9){if(_0x43ccd2[_0x1085('0x4c')]['id']){delete _0x43ccd2[_0x1085('0x4c')]['id'];}return db['FaxQueueReport'][_0x1085('0x49')]({'where':{'id':_0x43ccd2[_0x1085('0x46')]['id']}})[_0x1085('0x26')](handleEntityNotFound(_0x7338f9,null))[_0x1085('0x26')](saveUpdates(_0x43ccd2['body'],null))['then'](respondWithResult(_0x7338f9,null))[_0x1085('0x4a')](handleError(_0x7338f9,null));};exports['destroy']=function(_0x329804,_0x279d0b){return db[_0x1085('0x2e')][_0x1085('0x49')]({'where':{'id':_0x329804['params']['id']}})[_0x1085('0x26')](handleEntityNotFound(_0x279d0b,null))[_0x1085('0x26')](removeEntity(_0x279d0b,null))[_0x1085('0x4a')](handleError(_0x279d0b,null));};exports['describe']=function(_0x1c9d86,_0x1ccbb5){return db[_0x1085('0x2e')][_0x1085('0x4e')]()[_0x1085('0x26')](respondWithResult(_0x1ccbb5,null))[_0x1085('0x4a')](handleError(_0x1ccbb5,null));};
\ No newline at end of file
+var _0xfe60=['update','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','body'];(function(_0x297490,_0x4b6acb){var _0x2015bf=function(_0x88acef){while(--_0x88acef){_0x297490['push'](_0x297490['shift']());}};_0x2015bf(++_0x4b6acb);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x2c3a20,_0xcb5a6c){_0x2c3a20=_0x2c3a20-0x0;var _0xed5322=_0xfe60[_0x2c3a20];return _0xed5322;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fe6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fe6('0x1'));var rp=require(_0x0fe6('0x2'));var moment=require(_0x0fe6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0fe6('0x4'));var util=require(_0x0fe6('0x5'));var path=require(_0x0fe6('0x6'));var sox=require(_0x0fe6('0x7'));var csv=require(_0x0fe6('0x8'));var ejs=require(_0x0fe6('0x9'));var fs=require('fs');var fs_extra=require(_0x0fe6('0xa'));var _=require(_0x0fe6('0xb'));var squel=require(_0x0fe6('0xc'));var crypto=require(_0x0fe6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0fe6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0fe6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0fe6('0x10'));var as=require(_0x0fe6('0x11'));var hardwareService=require(_0x0fe6('0x12'));var logger=require(_0x0fe6('0x13'))(_0x0fe6('0x14'));var utils=require(_0x0fe6('0x15'));var config=require(_0x0fe6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fe6('0x17'))['db'];function respondWithStatusCode(_0xa43382,_0x469b27){_0x469b27=_0x469b27||0xcc;return function(_0x51eda9){if(_0x51eda9){return _0xa43382['sendStatus'](_0x469b27);}return _0xa43382[_0x0fe6('0x18')](_0x469b27)['end']();};}function respondWithResult(_0x5c4e63,_0x500e06){_0x500e06=_0x500e06||0xc8;return function(_0x225253){if(_0x225253){return _0x5c4e63[_0x0fe6('0x18')](_0x500e06)[_0x0fe6('0x19')](_0x225253);}};}function respondWithFilteredResult(_0x156aff,_0x3ab844){return function(_0x16f2f6){if(_0x16f2f6){var _0x44011a=typeof _0x3ab844[_0x0fe6('0x1a')]===_0x0fe6('0x1b')&&typeof _0x3ab844[_0x0fe6('0x1c')]===_0x0fe6('0x1b');var _0x347ebb=_0x16f2f6['count'];var _0x469a48=_0x44011a?0x0:_0x3ab844[_0x0fe6('0x1a')];var _0x34fc0c=_0x44011a?_0x16f2f6[_0x0fe6('0x1d')]:_0x3ab844[_0x0fe6('0x1a')]+_0x3ab844[_0x0fe6('0x1c')];var _0xf351d5;if(_0x34fc0c>=_0x347ebb){_0x34fc0c=_0x347ebb;_0xf351d5=0xc8;}else{_0xf351d5=0xce;}_0x156aff[_0x0fe6('0x18')](_0xf351d5);return _0x156aff[_0x0fe6('0x1e')](_0x0fe6('0x1f'),_0x469a48+'-'+_0x34fc0c+'/'+_0x347ebb)[_0x0fe6('0x19')](_0x16f2f6);}return null;};}function patchUpdates(_0x288bd6){return function(_0x4e13f9){try{jsonpatch[_0x0fe6('0x20')](_0x4e13f9,_0x288bd6,!![]);}catch(_0x270fc2){return BPromise[_0x0fe6('0x21')](_0x270fc2);}return _0x4e13f9[_0x0fe6('0x22')]();};}function saveUpdates(_0x4e2892,_0x124214){return function(_0x35a5da){if(_0x35a5da){return _0x35a5da['update'](_0x4e2892)[_0x0fe6('0x23')](function(_0x57198d){return _0x57198d;});}return null;};}function removeEntity(_0x3f9071,_0x224741){return function(_0x447086){if(_0x447086){return _0x447086[_0x0fe6('0x24')]()['then'](function(){_0x3f9071[_0x0fe6('0x18')](0xcc)[_0x0fe6('0x25')]();});}};}function handleEntityNotFound(_0x7f855d,_0x19370b){return function(_0x18431d){if(!_0x18431d){_0x7f855d['sendStatus'](0x194);}return _0x18431d;};}function handleError(_0x2a7f1e,_0x45a708){_0x45a708=_0x45a708||0x1f4;return function(_0x3428a7){logger[_0x0fe6('0x26')](_0x3428a7[_0x0fe6('0x27')]);if(_0x3428a7[_0x0fe6('0x28')]){delete _0x3428a7['name'];}_0x2a7f1e[_0x0fe6('0x18')](_0x45a708)[_0x0fe6('0x29')](_0x3428a7);};}exports[_0x0fe6('0x2a')]=function(_0x167d17,_0x2ede48){var _0x1bb6c0={},_0x18fad1={},_0x156593={'count':0x0,'rows':[]};var _0x3151b0=_['map'](db[_0x0fe6('0x2b')][_0x0fe6('0x2c')],function(_0x5e0839){return{'name':_0x5e0839[_0x0fe6('0x2d')],'type':_0x5e0839[_0x0fe6('0x2e')][_0x0fe6('0x2f')]};});_0x18fad1[_0x0fe6('0x30')]=_[_0x0fe6('0x31')](_0x3151b0,_0x0fe6('0x28'));_0x18fad1[_0x0fe6('0x32')]=_[_0x0fe6('0x33')](_0x167d17[_0x0fe6('0x32')]);_0x18fad1[_0x0fe6('0x34')]=_[_0x0fe6('0x35')](_0x18fad1[_0x0fe6('0x30')],_0x18fad1[_0x0fe6('0x32')]);_0x1bb6c0[_0x0fe6('0x36')]=_[_0x0fe6('0x35')](_0x18fad1[_0x0fe6('0x30')],qs[_0x0fe6('0x37')](_0x167d17['query']['fields']));_0x1bb6c0[_0x0fe6('0x36')]=_0x1bb6c0[_0x0fe6('0x36')][_0x0fe6('0x38')]?_0x1bb6c0[_0x0fe6('0x36')]:_0x18fad1[_0x0fe6('0x30')];if(!_0x167d17['query'][_0x0fe6('0x39')](_0x0fe6('0x3a'))){_0x1bb6c0[_0x0fe6('0x1c')]=qs[_0x0fe6('0x1c')](_0x167d17[_0x0fe6('0x32')][_0x0fe6('0x1c')]);_0x1bb6c0['offset']=qs['offset'](_0x167d17[_0x0fe6('0x32')][_0x0fe6('0x1a')]);}_0x1bb6c0[_0x0fe6('0x3b')]=qs['sort'](_0x167d17[_0x0fe6('0x32')][_0x0fe6('0x3c')]);_0x1bb6c0[_0x0fe6('0x3d')]=qs['filters'](_[_0x0fe6('0x3e')](_0x167d17[_0x0fe6('0x32')],_0x18fad1[_0x0fe6('0x34')]),_0x3151b0);if(_0x167d17[_0x0fe6('0x32')]['filter']){_0x1bb6c0[_0x0fe6('0x3d')]=_[_0x0fe6('0x3f')](_0x1bb6c0[_0x0fe6('0x3d')],{'$or':_[_0x0fe6('0x31')](_0x3151b0,function(_0x1aab12){if(_0x1aab12[_0x0fe6('0x2e')]!=='VIRTUAL'){var _0x13bb46={};_0x13bb46[_0x1aab12[_0x0fe6('0x28')]]={'$like':'%'+_0x167d17[_0x0fe6('0x32')][_0x0fe6('0x40')]+'%'};return _0x13bb46;}})});}_0x1bb6c0=_[_0x0fe6('0x3f')]({},_0x1bb6c0,_0x167d17[_0x0fe6('0x41')]);var _0x31aa98={'where':_0x1bb6c0['where']};return db[_0x0fe6('0x2b')][_0x0fe6('0x1d')](_0x31aa98)[_0x0fe6('0x23')](function(_0x562e91){_0x156593[_0x0fe6('0x1d')]=_0x562e91;if(_0x167d17[_0x0fe6('0x32')]['includeAll']){_0x1bb6c0[_0x0fe6('0x42')]=[{'all':!![]}];}return db[_0x0fe6('0x2b')][_0x0fe6('0x43')](_0x1bb6c0);})[_0x0fe6('0x23')](function(_0xaf4224){_0x156593[_0x0fe6('0x44')]=_0xaf4224;return _0x156593;})[_0x0fe6('0x23')](respondWithFilteredResult(_0x2ede48,_0x1bb6c0))[_0x0fe6('0x45')](handleError(_0x2ede48,null));};exports[_0x0fe6('0x46')]=function(_0x4533d0,_0x334be5){var _0x3242bb={'raw':!![],'where':{'id':_0x4533d0[_0x0fe6('0x47')]['id']}},_0x13ad07={};_0x13ad07[_0x0fe6('0x30')]=_[_0x0fe6('0x33')](db['FaxQueueReport'][_0x0fe6('0x2c')]);_0x13ad07[_0x0fe6('0x32')]=_[_0x0fe6('0x33')](_0x4533d0[_0x0fe6('0x32')]);_0x13ad07[_0x0fe6('0x34')]=_[_0x0fe6('0x35')](_0x13ad07['model'],_0x13ad07['query']);_0x3242bb[_0x0fe6('0x36')]=_[_0x0fe6('0x35')](_0x13ad07[_0x0fe6('0x30')],qs['fields'](_0x4533d0[_0x0fe6('0x32')][_0x0fe6('0x37')]));_0x3242bb['attributes']=_0x3242bb[_0x0fe6('0x36')]['length']?_0x3242bb['attributes']:_0x13ad07[_0x0fe6('0x30')];if(_0x4533d0[_0x0fe6('0x32')]['includeAll']){_0x3242bb[_0x0fe6('0x42')]=[{'all':!![]}];}_0x3242bb=_['merge']({},_0x3242bb,_0x4533d0['options']);return db[_0x0fe6('0x2b')]['find'](_0x3242bb)['then'](handleEntityNotFound(_0x334be5,null))[_0x0fe6('0x23')](respondWithResult(_0x334be5,null))['catch'](handleError(_0x334be5,null));};exports['create']=function(_0x4f7f7f,_0x1560a3){return db[_0x0fe6('0x2b')]['create'](_0x4f7f7f[_0x0fe6('0x48')],{})[_0x0fe6('0x23')](respondWithResult(_0x1560a3,0xc9))[_0x0fe6('0x45')](handleError(_0x1560a3,null));};exports[_0x0fe6('0x49')]=function(_0x36a692,_0x365504){if(_0x36a692[_0x0fe6('0x48')]['id']){delete _0x36a692[_0x0fe6('0x48')]['id'];}return db['FaxQueueReport'][_0x0fe6('0x4a')]({'where':{'id':_0x36a692['params']['id']}})[_0x0fe6('0x23')](handleEntityNotFound(_0x365504,null))['then'](saveUpdates(_0x36a692[_0x0fe6('0x48')],null))[_0x0fe6('0x23')](respondWithResult(_0x365504,null))[_0x0fe6('0x45')](handleError(_0x365504,null));};exports[_0x0fe6('0x24')]=function(_0x2e47a1,_0x167ff5){return db[_0x0fe6('0x2b')]['find']({'where':{'id':_0x2e47a1[_0x0fe6('0x47')]['id']}})[_0x0fe6('0x23')](handleEntityNotFound(_0x167ff5,null))[_0x0fe6('0x23')](removeEntity(_0x167ff5,null))[_0x0fe6('0x45')](handleError(_0x167ff5,null));};exports[_0x0fe6('0x4b')]=function(_0x119315,_0x2ed628){return db[_0x0fe6('0x2b')][_0x0fe6('0x4b')]()[_0x0fe6('0x23')](respondWithResult(_0x2ed628,null))['catch'](handleError(_0x2ed628,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x27736f,_0x41fefb){var _0x2c1933=function(_0x5ba49e){while(--_0x5ba49e){_0x27736f['push'](_0x27736f['shift']());}};_0x2c1933(++_0x41fefb);}(_0xe14b,0x93));var _0xbe14=function(_0x246a50,_0x4f18c8){_0x246a50=_0x246a50-0x0;var _0x3f9a77=_0xe14b[_0x246a50];return _0x3f9a77;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2d21c8,_0x35b36e){var _0x2039a8=function(_0x306790){while(--_0x306790){_0x2d21c8['push'](_0x2d21c8['shift']());}};_0x2039a8(++_0x35b36e);}(_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 logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b1b=['request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','update','where','attributes','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x130c00,_0x3a2054){var _0x173ba7=function(_0x4808b){while(--_0x4808b){_0x130c00['push'](_0x130c00['shift']());}};_0x173ba7(++_0x3a2054);}(_0x0b1b,0x105));var _0xb0b1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x0b1b[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xb0b1('0x0'));var util=require('util');var moment=require(_0xb0b1('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0b1('0x2'));var fs=require('fs');var Redis=require(_0xb0b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0b1('0x4'))(_0xb0b1('0x5'));var config=require('../../config/environment');var jayson=require(_0xb0b1('0x6'));var client=jayson[_0xb0b1('0x7')][_0xb0b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c7838,_0x20bebb,_0x3ea549){return new BPromise(function(_0x393ccb,_0x170533){return client[_0xb0b1('0x9')](_0x3c7838,_0x3ea549)[_0xb0b1('0xa')](function(_0x37eb7c){logger[_0xb0b1('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x20bebb,_0xb0b1('0xc'));logger[_0xb0b1('0xd')](_0xb0b1('0xe'),_0x20bebb,_0xb0b1('0xc'),JSON[_0xb0b1('0xf')](_0x37eb7c));if(_0x37eb7c[_0xb0b1('0x10')]){if(_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x11')]===0x1f4){logger['error'](_0xb0b1('0x12'),_0x20bebb,_0x37eb7c['error'][_0xb0b1('0x13')]);return _0x170533(_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x13')]);}logger[_0xb0b1('0x10')](_0xb0b1('0x12'),_0x20bebb,_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x13')]);return _0x393ccb(_0x37eb7c[_0xb0b1('0x10')][_0xb0b1('0x13')]);}else{logger[_0xb0b1('0xb')](_0xb0b1('0x12'),_0x20bebb,_0xb0b1('0xc'));_0x393ccb(_0x37eb7c['result'][_0xb0b1('0x13')]);}})[_0xb0b1('0x14')](function(_0x52d76f){logger['error'](_0xb0b1('0x12'),_0x20bebb,_0x52d76f);_0x170533(_0x52d76f);});});}exports[_0xb0b1('0x15')]=function(_0x40ef35){var _0x4dc9c3=this;return new Promise(function(_0x488ca4,_0x6ddf54){return db[_0xb0b1('0x16')]['create'](_0x40ef35[_0xb0b1('0x17')],{'raw':_0x40ef35[_0xb0b1('0x18')]?_0x40ef35['options'][_0xb0b1('0x19')]===undefined?!![]:![]:!![]})[_0xb0b1('0xa')](function(_0xd83ab5){logger[_0xb0b1('0xb')]('CreateFaxQueueReport',_0x40ef35);logger[_0xb0b1('0xd')](_0xb0b1('0x15'),_0x40ef35,JSON[_0xb0b1('0xf')](_0xd83ab5));_0x488ca4(_0xd83ab5);})['catch'](function(_0x2d372e){logger[_0xb0b1('0x10')](_0xb0b1('0x15'),_0x2d372e[_0xb0b1('0x13')],_0x40ef35);_0x6ddf54(_0x4dc9c3[_0xb0b1('0x10')](0x1f4,_0x2d372e['message']));});});};exports[_0xb0b1('0x1a')]=function(_0x228deb){var _0xcb02bd=this;return new Promise(function(_0x31dcf1,_0x31a395){return db[_0xb0b1('0x16')][_0xb0b1('0x1b')](_0x228deb[_0xb0b1('0x17')],{'raw':_0x228deb[_0xb0b1('0x18')]?_0x228deb[_0xb0b1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228deb[_0xb0b1('0x18')]?_0x228deb[_0xb0b1('0x18')][_0xb0b1('0x1c')]||null:null,'attributes':_0x228deb[_0xb0b1('0x18')]?_0x228deb['options'][_0xb0b1('0x1d')]||null:null,'limit':_0x228deb[_0xb0b1('0x18')]?_0x228deb[_0xb0b1('0x18')]['limit']||null:null})[_0xb0b1('0xa')](function(_0x5938fe){logger[_0xb0b1('0xb')]('UpdateFaxQueueReport',_0x228deb);logger[_0xb0b1('0xd')](_0xb0b1('0x1a'),_0x228deb,JSON[_0xb0b1('0xf')](_0x5938fe));_0x31dcf1(_0x5938fe);})[_0xb0b1('0x14')](function(_0x127ddf){logger['error'](_0xb0b1('0x1a'),_0x127ddf[_0xb0b1('0x13')],_0x228deb);_0x31a395(_0xcb02bd[_0xb0b1('0x10')](0x1f4,_0x127ddf[_0xb0b1('0x13')]));});});};
\ No newline at end of file
+var _0x848f=['message','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','update','body','attributes','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x564e6a,_0x352220){var _0x14210c=function(_0x650e9b){while(--_0x650e9b){_0x564e6a['push'](_0x564e6a['shift']());}};_0x14210c(++_0x352220);}(_0x848f,0x106));var _0xf848=function(_0x3aa403,_0x4ef40f){_0x3aa403=_0x3aa403-0x0;var _0x4c0fcb=_0x848f[_0x3aa403];return _0x4c0fcb;};'use strict';var _=require(_0xf848('0x0'));var util=require('util');var moment=require(_0xf848('0x1'));var BPromise=require(_0xf848('0x2'));var rs=require(_0xf848('0x3'));var fs=require('fs');var Redis=require(_0xf848('0x4'));var db=require(_0xf848('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf848('0x6'));var config=require(_0xf848('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf848('0x8')][_0xf848('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8dfd51,_0x289176,_0x3f6943){return new BPromise(function(_0x3517d3,_0x512d48){return client[_0xf848('0xa')](_0x8dfd51,_0x3f6943)['then'](function(_0x6d5d94){logger[_0xf848('0xb')](_0xf848('0xc'),_0x289176,_0xf848('0xd'));logger[_0xf848('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x289176,_0xf848('0xd'),JSON[_0xf848('0xf')](_0x6d5d94));if(_0x6d5d94[_0xf848('0x10')]){if(_0x6d5d94['error'][_0xf848('0x11')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x289176,_0x6d5d94[_0xf848('0x10')][_0xf848('0x12')]);return _0x512d48(_0x6d5d94[_0xf848('0x10')][_0xf848('0x12')]);}logger[_0xf848('0x10')](_0xf848('0xc'),_0x289176,_0x6d5d94['error'][_0xf848('0x12')]);return _0x3517d3(_0x6d5d94[_0xf848('0x10')][_0xf848('0x12')]);}else{logger[_0xf848('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x289176,_0xf848('0xd'));_0x3517d3(_0x6d5d94['result'][_0xf848('0x12')]);}})[_0xf848('0x13')](function(_0x39fc30){logger[_0xf848('0x10')](_0xf848('0xc'),_0x289176,_0x39fc30);_0x512d48(_0x39fc30);});});}exports[_0xf848('0x14')]=function(_0x51e659){var _0x15a9e1=this;return new Promise(function(_0x286ae7,_0x382834){return db[_0xf848('0x15')]['create'](_0x51e659['body'],{'raw':_0x51e659[_0xf848('0x16')]?_0x51e659[_0xf848('0x16')][_0xf848('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x138730){logger[_0xf848('0xb')](_0xf848('0x14'),_0x51e659);logger[_0xf848('0xe')]('CreateFaxQueueReport',_0x51e659,JSON[_0xf848('0xf')](_0x138730));_0x286ae7(_0x138730);})[_0xf848('0x13')](function(_0x36f5b2){logger[_0xf848('0x10')](_0xf848('0x14'),_0x36f5b2[_0xf848('0x12')],_0x51e659);_0x382834(_0x15a9e1[_0xf848('0x10')](0x1f4,_0x36f5b2['message']));});});};exports['UpdateFaxQueueReport']=function(_0x579904){var _0x365146=this;return new Promise(function(_0x192203,_0x1b7cd5){return db[_0xf848('0x15')][_0xf848('0x18')](_0x579904[_0xf848('0x19')],{'raw':_0x579904[_0xf848('0x16')]?_0x579904[_0xf848('0x16')][_0xf848('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579904[_0xf848('0x16')]?_0x579904[_0xf848('0x16')]['where']||null:null,'attributes':_0x579904[_0xf848('0x16')]?_0x579904[_0xf848('0x16')][_0xf848('0x1a')]||null:null,'limit':_0x579904['options']?_0x579904['options']['limit']||null:null})['then'](function(_0x5b83d9){logger['info'](_0xf848('0x1b'),_0x579904);logger[_0xf848('0xe')](_0xf848('0x1b'),_0x579904,JSON[_0xf848('0xf')](_0x5b83d9));_0x192203(_0x5b83d9);})['catch'](function(_0x39ddcb){logger[_0xf848('0x10')](_0xf848('0x1b'),_0x39ddcb[_0xf848('0x12')],_0x579904);_0x1b7cd5(_0x365146[_0xf848('0x10')](0x1f4,_0x39ddcb['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdba8=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer'];(function(_0x3a1a18,_0x44c3c1){var _0x373922=function(_0x120e66){while(--_0x120e66){_0x3a1a18['push'](_0x3a1a18['shift']());}};_0x373922(++_0x44c3c1);}(_0xdba8,0x153));var _0x8dba=function(_0xe088d9,_0x2116af){_0xe088d9=_0xe088d9-0x0;var _0x2bce66=_0xdba8[_0xe088d9];return _0x2bce66;};'use strict';var multer=require(_0x8dba('0x0'));var util=require(_0x8dba('0x1'));var path=require(_0x8dba('0x2'));var timeout=require(_0x8dba('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8dba('0x4'));var auth=require(_0x8dba('0x5'));var interaction=require(_0x8dba('0x6'));var config=require(_0x8dba('0x7'));var controller=require('./faxQueueReport.controller');router[_0x8dba('0x8')]('/',auth[_0x8dba('0x9')](),controller[_0x8dba('0xa')]);router[_0x8dba('0x8')](_0x8dba('0xb'),auth[_0x8dba('0x9')](),controller[_0x8dba('0xc')]);router['get'](_0x8dba('0xd'),auth[_0x8dba('0x9')](),controller['show']);router[_0x8dba('0xe')]('/',auth['isAuthenticated'](),controller[_0x8dba('0xf')]);router[_0x8dba('0x10')]('/:id',auth[_0x8dba('0x9')](),controller[_0x8dba('0x11')]);router['delete'](_0x8dba('0xd'),auth[_0x8dba('0x9')](),controller[_0x8dba('0x12')]);module[_0x8dba('0x13')]=router;
\ No newline at end of file
+var _0x1546=['../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x40ae74,_0xa3fd61){var _0x48d6b4=function(_0xc3eb0){while(--_0xc3eb0){_0x40ae74['push'](_0x40ae74['shift']());}};_0x48d6b4(++_0xa3fd61);}(_0x1546,0x185));var _0x6154=function(_0x5f3248,_0x25ad3b){_0x5f3248=_0x5f3248-0x0;var _0x330cc4=_0x1546[_0x5f3248];return _0x330cc4;};'use strict';var multer=require(_0x6154('0x0'));var util=require('util');var path=require(_0x6154('0x1'));var timeout=require(_0x6154('0x2'));var express=require(_0x6154('0x3'));var router=express[_0x6154('0x4')]();var fs_extra=require(_0x6154('0x5'));var auth=require(_0x6154('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6154('0x7'));var controller=require(_0x6154('0x8'));router[_0x6154('0x9')]('/',auth[_0x6154('0xa')](),controller[_0x6154('0xb')]);router[_0x6154('0x9')](_0x6154('0xc'),auth[_0x6154('0xa')](),controller[_0x6154('0xd')]);router[_0x6154('0x9')](_0x6154('0xe'),auth[_0x6154('0xa')](),controller[_0x6154('0xf')]);router['post']('/',auth[_0x6154('0xa')](),controller[_0x6154('0x10')]);router[_0x6154('0x11')]('/:id',auth[_0x6154('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x234e7e,_0xf82c84){var _0x23319a=function(_0x3e6e30){while(--_0x3e6e30){_0x234e7e['push'](_0x234e7e['shift']());}};_0x23319a(++_0xf82c84);}(_0x008c,0x188));var _0xc008=function(_0x1614c2,_0x1fccfc){_0x1614c2=_0x1614c2-0x0;var _0x182c4c=_0x008c[_0x1614c2];return _0x182c4c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2ab0fb,_0xf21f9e){var _0x578c50=function(_0x1223b3){while(--_0x1223b3){_0x2ab0fb['push'](_0x2ab0fb['shift']());}};_0x578c50(++_0xf21f9e);}(_0x008c,0x188));var _0xc008=function(_0x1e24b1,_0x14ab30){_0x1e24b1=_0x1e24b1-0x0;var _0x212baf=_0x008c[_0x1e24b1];return _0x212baf;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd1fc=['error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','length','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end'];(function(_0x3d713d,_0x26eea2){var _0x269b08=function(_0x5ad4b7){while(--_0x5ad4b7){_0x3d713d['push'](_0x3d713d['shift']());}};_0x269b08(++_0x26eea2);}(_0xd1fc,0x196));var _0xcd1f=function(_0x2b9e64,_0x405a2d){_0x2b9e64=_0x2b9e64-0x0;var _0x452cbe=_0xd1fc[_0x2b9e64];return _0x452cbe;};'use strict';var emlformat=require(_0xcd1f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd1f('0x1'));var jsonpatch=require(_0xcd1f('0x2'));var rp=require(_0xcd1f('0x3'));var moment=require(_0xcd1f('0x4'));var BPromise=require(_0xcd1f('0x5'));var Mustache=require(_0xcd1f('0x6'));var util=require('util');var path=require(_0xcd1f('0x7'));var sox=require('sox');var csv=require(_0xcd1f('0x8'));var ejs=require(_0xcd1f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd1f('0xa'));var squel=require(_0xcd1f('0xb'));var crypto=require(_0xcd1f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd1f('0xd'));var Papa=require(_0xcd1f('0xe'));var Redis=require(_0xcd1f('0xf'));var authService=require(_0xcd1f('0x10'));var qs=require(_0xcd1f('0x11'));var as=require(_0xcd1f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd1f('0x13'))(_0xcd1f('0x14'));var utils=require(_0xcd1f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd1f('0x16'));var db=require(_0xcd1f('0x17'))['db'];function respondWithStatusCode(_0x3f73cf,_0x2500a2){_0x2500a2=_0x2500a2||0xcc;return function(_0x2bfccc){if(_0x2bfccc){return _0x3f73cf[_0xcd1f('0x18')](_0x2500a2);}return _0x3f73cf[_0xcd1f('0x19')](_0x2500a2)['end']();};}function respondWithResult(_0x5440a2,_0x49e2f7){_0x49e2f7=_0x49e2f7||0xc8;return function(_0x215ad1){if(_0x215ad1){return _0x5440a2[_0xcd1f('0x19')](_0x49e2f7)[_0xcd1f('0x1a')](_0x215ad1);}};}function respondWithFilteredResult(_0x4d28bc,_0x72246d){return function(_0x3ae67f){if(_0x3ae67f){var _0x4bd120=typeof _0x72246d[_0xcd1f('0x1b')]===_0xcd1f('0x1c')&&typeof _0x72246d[_0xcd1f('0x1d')]===_0xcd1f('0x1c');var _0x487dc3=_0x3ae67f['count'];var _0x172d95=_0x4bd120?0x0:_0x72246d[_0xcd1f('0x1b')];var _0x460675=_0x4bd120?_0x3ae67f[_0xcd1f('0x1e')]:_0x72246d['offset']+_0x72246d[_0xcd1f('0x1d')];var _0x3d39a3;if(_0x460675>=_0x487dc3){_0x460675=_0x487dc3;_0x3d39a3=0xc8;}else{_0x3d39a3=0xce;}_0x4d28bc[_0xcd1f('0x19')](_0x3d39a3);return _0x4d28bc['set']('Content-Range',_0x172d95+'-'+_0x460675+'/'+_0x487dc3)[_0xcd1f('0x1a')](_0x3ae67f);}return null;};}function patchUpdates(_0x58a07a){return function(_0x185d7d){try{jsonpatch[_0xcd1f('0x1f')](_0x185d7d,_0x58a07a,!![]);}catch(_0x2595d6){return BPromise[_0xcd1f('0x20')](_0x2595d6);}return _0x185d7d[_0xcd1f('0x21')]();};}function saveUpdates(_0x21429e,_0x17bd87){return function(_0x1df970){if(_0x1df970){return _0x1df970[_0xcd1f('0x22')](_0x21429e)[_0xcd1f('0x23')](function(_0x1506e3){return _0x1506e3;});}return null;};}function removeEntity(_0x5227a6,_0x428d32){return function(_0x33b8a8){if(_0x33b8a8){return _0x33b8a8[_0xcd1f('0x24')]()[_0xcd1f('0x23')](function(){_0x5227a6[_0xcd1f('0x19')](0xcc)[_0xcd1f('0x25')]();});}};}function handleEntityNotFound(_0x2e7921,_0x2955ad){return function(_0x18a041){if(!_0x18a041){_0x2e7921[_0xcd1f('0x18')](0x194);}return _0x18a041;};}function handleError(_0xa21a4,_0x3612b6){_0x3612b6=_0x3612b6||0x1f4;return function(_0x369abd){logger[_0xcd1f('0x26')](_0x369abd['stack']);if(_0x369abd['name']){delete _0x369abd[_0xcd1f('0x27')];}_0xa21a4['status'](_0x3612b6)[_0xcd1f('0x28')](_0x369abd);};}exports[_0xcd1f('0x29')]=function(_0x2d1111,_0x3264c4){var _0x54d63e={},_0x5c95a8={},_0x5b6280={'count':0x0,'rows':[]};var _0x356096=_[_0xcd1f('0x2a')](db[_0xcd1f('0x2b')][_0xcd1f('0x2c')],function(_0x234fd4){return{'name':_0x234fd4[_0xcd1f('0x2d')],'type':_0x234fd4[_0xcd1f('0x2e')]['key']};});_0x5c95a8[_0xcd1f('0x2f')]=_['map'](_0x356096,'name');_0x5c95a8[_0xcd1f('0x30')]=_[_0xcd1f('0x31')](_0x2d1111[_0xcd1f('0x30')]);_0x5c95a8[_0xcd1f('0x32')]=_[_0xcd1f('0x33')](_0x5c95a8['model'],_0x5c95a8[_0xcd1f('0x30')]);_0x54d63e[_0xcd1f('0x34')]=_[_0xcd1f('0x33')](_0x5c95a8[_0xcd1f('0x2f')],qs[_0xcd1f('0x35')](_0x2d1111['query']['fields']));_0x54d63e[_0xcd1f('0x34')]=_0x54d63e[_0xcd1f('0x34')]['length']?_0x54d63e[_0xcd1f('0x34')]:_0x5c95a8['model'];if(!_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x36')](_0xcd1f('0x37'))){_0x54d63e[_0xcd1f('0x1d')]=qs[_0xcd1f('0x1d')](_0x2d1111[_0xcd1f('0x30')]['limit']);_0x54d63e[_0xcd1f('0x1b')]=qs['offset'](_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x1b')]);}_0x54d63e[_0xcd1f('0x38')]=qs['sort'](_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x39')]);_0x54d63e['where']=qs[_0xcd1f('0x32')](_[_0xcd1f('0x3a')](_0x2d1111[_0xcd1f('0x30')],_0x5c95a8['filters']),_0x356096);if(_0x2d1111['query'][_0xcd1f('0x3b')]){_0x54d63e[_0xcd1f('0x3c')]=_[_0xcd1f('0x3d')](_0x54d63e[_0xcd1f('0x3c')],{'$or':_[_0xcd1f('0x2a')](_0x356096,function(_0x49caed){if(_0x49caed['type']!==_0xcd1f('0x3e')){var _0x42a61f={};_0x42a61f[_0x49caed[_0xcd1f('0x27')]]={'$like':'%'+_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x3b')]+'%'};return _0x42a61f;}})});}_0x54d63e=_[_0xcd1f('0x3d')]({},_0x54d63e,_0x2d1111[_0xcd1f('0x3f')]);var _0x4c6b4e={'where':_0x54d63e[_0xcd1f('0x3c')]};return db['FaxTransferReport'][_0xcd1f('0x1e')](_0x4c6b4e)[_0xcd1f('0x23')](function(_0x43a3b0){_0x5b6280[_0xcd1f('0x1e')]=_0x43a3b0;if(_0x2d1111[_0xcd1f('0x30')][_0xcd1f('0x40')]){_0x54d63e['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x54d63e);})[_0xcd1f('0x23')](function(_0x260e22){_0x5b6280[_0xcd1f('0x41')]=_0x260e22;return _0x5b6280;})[_0xcd1f('0x23')](respondWithFilteredResult(_0x3264c4,_0x54d63e))[_0xcd1f('0x42')](handleError(_0x3264c4,null));};exports['show']=function(_0x2d7b2d,_0x270de6){var _0x2a391c={'raw':!![],'where':{'id':_0x2d7b2d[_0xcd1f('0x43')]['id']}},_0x353008={};_0x353008['model']=_[_0xcd1f('0x31')](db[_0xcd1f('0x2b')][_0xcd1f('0x2c')]);_0x353008[_0xcd1f('0x30')]=_[_0xcd1f('0x31')](_0x2d7b2d['query']);_0x353008[_0xcd1f('0x32')]=_[_0xcd1f('0x33')](_0x353008[_0xcd1f('0x2f')],_0x353008[_0xcd1f('0x30')]);_0x2a391c[_0xcd1f('0x34')]=_[_0xcd1f('0x33')](_0x353008[_0xcd1f('0x2f')],qs[_0xcd1f('0x35')](_0x2d7b2d[_0xcd1f('0x30')][_0xcd1f('0x35')]));_0x2a391c[_0xcd1f('0x34')]=_0x2a391c[_0xcd1f('0x34')][_0xcd1f('0x44')]?_0x2a391c['attributes']:_0x353008[_0xcd1f('0x2f')];if(_0x2d7b2d[_0xcd1f('0x30')]['includeAll']){_0x2a391c[_0xcd1f('0x45')]=[{'all':!![]}];}_0x2a391c=_[_0xcd1f('0x3d')]({},_0x2a391c,_0x2d7b2d['options']);return db[_0xcd1f('0x2b')][_0xcd1f('0x46')](_0x2a391c)[_0xcd1f('0x23')](handleEntityNotFound(_0x270de6,null))[_0xcd1f('0x23')](respondWithResult(_0x270de6,null))[_0xcd1f('0x42')](handleError(_0x270de6,null));};exports['create']=function(_0x2a4ef8,_0x155bb3){return db[_0xcd1f('0x2b')][_0xcd1f('0x47')](_0x2a4ef8[_0xcd1f('0x48')],{})[_0xcd1f('0x23')](respondWithResult(_0x155bb3,0xc9))['catch'](handleError(_0x155bb3,null));};exports[_0xcd1f('0x22')]=function(_0xa4855f,_0x4118b1){if(_0xa4855f[_0xcd1f('0x48')]['id']){delete _0xa4855f[_0xcd1f('0x48')]['id'];}return db['FaxTransferReport'][_0xcd1f('0x46')]({'where':{'id':_0xa4855f['params']['id']}})[_0xcd1f('0x23')](handleEntityNotFound(_0x4118b1,null))[_0xcd1f('0x23')](saveUpdates(_0xa4855f[_0xcd1f('0x48')],null))['then'](respondWithResult(_0x4118b1,null))[_0xcd1f('0x42')](handleError(_0x4118b1,null));};exports[_0xcd1f('0x24')]=function(_0x1ded41,_0x1eb41c){return db[_0xcd1f('0x2b')][_0xcd1f('0x46')]({'where':{'id':_0x1ded41[_0xcd1f('0x43')]['id']}})[_0xcd1f('0x23')](handleEntityNotFound(_0x1eb41c,null))[_0xcd1f('0x23')](removeEntity(_0x1eb41c,null))[_0xcd1f('0x42')](handleError(_0x1eb41c,null));};exports[_0xcd1f('0x49')]=function(_0x48c606,_0xa0fe33){return db[_0xcd1f('0x2b')][_0xcd1f('0x49')]()['then'](respondWithResult(_0xa0fe33,null))[_0xcd1f('0x42')](handleError(_0xa0fe33,null));};
\ No newline at end of file
+var _0xafd4=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','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','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','key','model','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafd4,0x1d7));var _0x4afd=function(_0xc9b026,_0x1a9335){_0xc9b026=_0xc9b026-0x0;var _0x202bac=_0xafd4[_0xc9b026];return _0x202bac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4afd('0x0'));var zipdir=require(_0x4afd('0x1'));var jsonpatch=require(_0x4afd('0x2'));var rp=require(_0x4afd('0x3'));var moment=require(_0x4afd('0x4'));var BPromise=require(_0x4afd('0x5'));var Mustache=require(_0x4afd('0x6'));var util=require(_0x4afd('0x7'));var path=require(_0x4afd('0x8'));var sox=require(_0x4afd('0x9'));var csv=require('to-csv');var ejs=require(_0x4afd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4afd('0xb'));var crypto=require('crypto');var jsforce=require(_0x4afd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4afd('0xd'));var Redis=require(_0x4afd('0xe'));var authService=require(_0x4afd('0xf'));var qs=require(_0x4afd('0x10'));var as=require(_0x4afd('0x11'));var hardwareService=require(_0x4afd('0x12'));var logger=require(_0x4afd('0x13'))(_0x4afd('0x14'));var utils=require(_0x4afd('0x15'));var config=require(_0x4afd('0x16'));var licenseUtil=require(_0x4afd('0x17'));var db=require(_0x4afd('0x18'))['db'];function respondWithStatusCode(_0x1fc2e4,_0x2617be){_0x2617be=_0x2617be||0xcc;return function(_0x1c77c2){if(_0x1c77c2){return _0x1fc2e4[_0x4afd('0x19')](_0x2617be);}return _0x1fc2e4['status'](_0x2617be)[_0x4afd('0x1a')]();};}function respondWithResult(_0x549c6c,_0x4e10b7){_0x4e10b7=_0x4e10b7||0xc8;return function(_0x283b97){if(_0x283b97){return _0x549c6c[_0x4afd('0x1b')](_0x4e10b7)[_0x4afd('0x1c')](_0x283b97);}};}function respondWithFilteredResult(_0x14f280,_0x311336){return function(_0x4be94b){if(_0x4be94b){var _0xf71c17=typeof _0x311336[_0x4afd('0x1d')]==='undefined'&&typeof _0x311336['limit']===_0x4afd('0x1e');var _0xef3dd2=_0x4be94b[_0x4afd('0x1f')];var _0xe1bad7=_0xf71c17?0x0:_0x311336[_0x4afd('0x1d')];var _0x583020=_0xf71c17?_0x4be94b[_0x4afd('0x1f')]:_0x311336[_0x4afd('0x1d')]+_0x311336[_0x4afd('0x20')];var _0x1ad95d;if(_0x583020>=_0xef3dd2){_0x583020=_0xef3dd2;_0x1ad95d=0xc8;}else{_0x1ad95d=0xce;}_0x14f280[_0x4afd('0x1b')](_0x1ad95d);return _0x14f280[_0x4afd('0x21')](_0x4afd('0x22'),_0xe1bad7+'-'+_0x583020+'/'+_0xef3dd2)['json'](_0x4be94b);}return null;};}function patchUpdates(_0x57f267){return function(_0x47c8a3){try{jsonpatch[_0x4afd('0x23')](_0x47c8a3,_0x57f267,!![]);}catch(_0x52a8c4){return BPromise['reject'](_0x52a8c4);}return _0x47c8a3[_0x4afd('0x24')]();};}function saveUpdates(_0x5cc314,_0x475e15){return function(_0xe7664c){if(_0xe7664c){return _0xe7664c[_0x4afd('0x25')](_0x5cc314)[_0x4afd('0x26')](function(_0x2086aa){return _0x2086aa;});}return null;};}function removeEntity(_0x1a93f5,_0x4a6a73){return function(_0x5de1f6){if(_0x5de1f6){return _0x5de1f6[_0x4afd('0x27')]()[_0x4afd('0x26')](function(){_0x1a93f5[_0x4afd('0x1b')](0xcc)[_0x4afd('0x1a')]();});}};}function handleEntityNotFound(_0x27a941,_0x333368){return function(_0x317b17){if(!_0x317b17){_0x27a941[_0x4afd('0x19')](0x194);}return _0x317b17;};}function handleError(_0x485723,_0x2d1f1d){_0x2d1f1d=_0x2d1f1d||0x1f4;return function(_0x1b92db){logger[_0x4afd('0x28')](_0x1b92db[_0x4afd('0x29')]);if(_0x1b92db[_0x4afd('0x2a')]){delete _0x1b92db[_0x4afd('0x2a')];}_0x485723[_0x4afd('0x1b')](_0x2d1f1d)[_0x4afd('0x2b')](_0x1b92db);};}exports['index']=function(_0x87a4b3,_0x2e0673){var _0x1aedba={},_0x3fea25={},_0x247a00={'count':0x0,'rows':[]};var _0x2aae62=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0xf447e5){return{'name':_0xf447e5['fieldName'],'type':_0xf447e5['type'][_0x4afd('0x2c')]};});_0x3fea25[_0x4afd('0x2d')]=_[_0x4afd('0x2e')](_0x2aae62,_0x4afd('0x2a'));_0x3fea25['query']=_[_0x4afd('0x2f')](_0x87a4b3[_0x4afd('0x30')]);_0x3fea25[_0x4afd('0x31')]=_[_0x4afd('0x32')](_0x3fea25[_0x4afd('0x2d')],_0x3fea25[_0x4afd('0x30')]);_0x1aedba['attributes']=_['intersection'](_0x3fea25[_0x4afd('0x2d')],qs[_0x4afd('0x33')](_0x87a4b3['query']['fields']));_0x1aedba[_0x4afd('0x34')]=_0x1aedba[_0x4afd('0x34')][_0x4afd('0x35')]?_0x1aedba[_0x4afd('0x34')]:_0x3fea25[_0x4afd('0x2d')];if(!_0x87a4b3[_0x4afd('0x30')][_0x4afd('0x36')](_0x4afd('0x37'))){_0x1aedba[_0x4afd('0x20')]=qs[_0x4afd('0x20')](_0x87a4b3[_0x4afd('0x30')][_0x4afd('0x20')]);_0x1aedba[_0x4afd('0x1d')]=qs[_0x4afd('0x1d')](_0x87a4b3[_0x4afd('0x30')][_0x4afd('0x1d')]);}_0x1aedba['order']=qs[_0x4afd('0x38')](_0x87a4b3['query']['sort']);_0x1aedba['where']=qs[_0x4afd('0x31')](_['pick'](_0x87a4b3[_0x4afd('0x30')],_0x3fea25['filters']),_0x2aae62);if(_0x87a4b3[_0x4afd('0x30')][_0x4afd('0x39')]){_0x1aedba[_0x4afd('0x3a')]=_[_0x4afd('0x3b')](_0x1aedba[_0x4afd('0x3a')],{'$or':_[_0x4afd('0x2e')](_0x2aae62,function(_0x506e81){if(_0x506e81['type']!=='VIRTUAL'){var _0xce2f8b={};_0xce2f8b[_0x506e81[_0x4afd('0x2a')]]={'$like':'%'+_0x87a4b3[_0x4afd('0x30')][_0x4afd('0x39')]+'%'};return _0xce2f8b;}})});}_0x1aedba=_['merge']({},_0x1aedba,_0x87a4b3[_0x4afd('0x3c')]);var _0x5531e7={'where':_0x1aedba[_0x4afd('0x3a')]};return db[_0x4afd('0x3d')]['count'](_0x5531e7)[_0x4afd('0x26')](function(_0x588321){_0x247a00['count']=_0x588321;if(_0x87a4b3[_0x4afd('0x30')][_0x4afd('0x3e')]){_0x1aedba[_0x4afd('0x3f')]=[{'all':!![]}];}return db[_0x4afd('0x3d')][_0x4afd('0x40')](_0x1aedba);})[_0x4afd('0x26')](function(_0x12fed4){_0x247a00[_0x4afd('0x41')]=_0x12fed4;return _0x247a00;})[_0x4afd('0x26')](respondWithFilteredResult(_0x2e0673,_0x1aedba))[_0x4afd('0x42')](handleError(_0x2e0673,null));};exports[_0x4afd('0x43')]=function(_0x19cae4,_0x22352f){var _0xdaa725={'raw':!![],'where':{'id':_0x19cae4[_0x4afd('0x44')]['id']}},_0x5e86d9={};_0x5e86d9['model']=_[_0x4afd('0x2f')](db[_0x4afd('0x3d')][_0x4afd('0x45')]);_0x5e86d9[_0x4afd('0x30')]=_['keys'](_0x19cae4['query']);_0x5e86d9[_0x4afd('0x31')]=_[_0x4afd('0x32')](_0x5e86d9[_0x4afd('0x2d')],_0x5e86d9[_0x4afd('0x30')]);_0xdaa725['attributes']=_['intersection'](_0x5e86d9[_0x4afd('0x2d')],qs['fields'](_0x19cae4[_0x4afd('0x30')][_0x4afd('0x33')]));_0xdaa725[_0x4afd('0x34')]=_0xdaa725[_0x4afd('0x34')][_0x4afd('0x35')]?_0xdaa725['attributes']:_0x5e86d9['model'];if(_0x19cae4[_0x4afd('0x30')]['includeAll']){_0xdaa725[_0x4afd('0x3f')]=[{'all':!![]}];}_0xdaa725=_[_0x4afd('0x3b')]({},_0xdaa725,_0x19cae4[_0x4afd('0x3c')]);return db[_0x4afd('0x3d')][_0x4afd('0x46')](_0xdaa725)['then'](handleEntityNotFound(_0x22352f,null))[_0x4afd('0x26')](respondWithResult(_0x22352f,null))['catch'](handleError(_0x22352f,null));};exports[_0x4afd('0x47')]=function(_0x346d21,_0x156090){return db[_0x4afd('0x3d')][_0x4afd('0x47')](_0x346d21['body'],{})[_0x4afd('0x26')](respondWithResult(_0x156090,0xc9))[_0x4afd('0x42')](handleError(_0x156090,null));};exports[_0x4afd('0x25')]=function(_0xfd4779,_0x596992){if(_0xfd4779['body']['id']){delete _0xfd4779[_0x4afd('0x48')]['id'];}return db[_0x4afd('0x3d')][_0x4afd('0x46')]({'where':{'id':_0xfd4779[_0x4afd('0x44')]['id']}})[_0x4afd('0x26')](handleEntityNotFound(_0x596992,null))[_0x4afd('0x26')](saveUpdates(_0xfd4779[_0x4afd('0x48')],null))[_0x4afd('0x26')](respondWithResult(_0x596992,null))[_0x4afd('0x42')](handleError(_0x596992,null));};exports[_0x4afd('0x27')]=function(_0x1afc9b,_0x4b7fbd){return db['FaxTransferReport']['find']({'where':{'id':_0x1afc9b['params']['id']}})[_0x4afd('0x26')](handleEntityNotFound(_0x4b7fbd,null))[_0x4afd('0x26')](removeEntity(_0x4b7fbd,null))[_0x4afd('0x42')](handleError(_0x4b7fbd,null));};exports['describe']=function(_0x1a486f,_0x536f9b){return db[_0x4afd('0x3d')][_0x4afd('0x49')]()[_0x4afd('0x26')](respondWithResult(_0x536f9b,null))[_0x4afd('0x42')](handleError(_0x536f9b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7a1=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','define'];(function(_0x457e12,_0x3ba321){var _0xa4de6c=function(_0x47c78d){while(--_0x47c78d){_0x457e12['push'](_0x457e12['shift']());}};_0xa4de6c(++_0x3ba321);}(_0xf7a1,0xed));var _0x1f7a=function(_0x21d0a5,_0x242625){_0x21d0a5=_0x21d0a5-0x0;var _0x3619ee=_0xf7a1[_0x21d0a5];return _0x3619ee;};'use strict';var _=require(_0x1f7a('0x0'));var util=require(_0x1f7a('0x1'));var logger=require(_0x1f7a('0x2'))(_0x1f7a('0x3'));var moment=require(_0x1f7a('0x4'));var BPromise=require(_0x1f7a('0x5'));var rp=require(_0x1f7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f7a('0x7'));var config=require('../../config/environment');var attributes=require(_0x1f7a('0x8'));module['exports']=function(_0x4e22a8,_0x44bfb0){return _0x4e22a8[_0x1f7a('0x9')](_0x1f7a('0xa'),attributes,{'tableName':_0x1f7a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1f7a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x457b=['path','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x326b44,_0x335b42){var _0x266cbb=function(_0x1e732c){while(--_0x1e732c){_0x326b44['push'](_0x326b44['shift']());}};_0x266cbb(++_0x335b42);}(_0x457b,0xca));var _0xb457=function(_0x569708,_0x338eff){_0x569708=_0x569708-0x0;var _0x256704=_0x457b[_0x569708];return _0x256704;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var logger=require('../../config/logger')(_0xb457('0x2'));var moment=require(_0xb457('0x3'));var BPromise=require(_0xb457('0x4'));var rp=require(_0xb457('0x5'));var fs=require('fs');var path=require(_0xb457('0x6'));var rimraf=require('rimraf');var config=require(_0xb457('0x7'));var attributes=require(_0xb457('0x8'));module[_0xb457('0x9')]=function(_0x3823c7,_0x3cefc3){return _0x3823c7['define'](_0xb457('0xa'),attributes,{'tableName':_0xb457('0xb'),'paranoid':![],'indexes':[{'name':_0xb457('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9be4=['request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ba5cb,_0x4429ec){var _0x22cd08=function(_0x4d9ea8){while(--_0x4d9ea8){_0x4ba5cb['push'](_0x4ba5cb['shift']());}};_0x22cd08(++_0x4429ec);}(_0x9be4,0x165));var _0x49be=function(_0x1dbc40,_0x46b1a7){_0x1dbc40=_0x1dbc40-0x0;var _0x1b995b=_0x9be4[_0x1dbc40];return _0x1b995b;};'use strict';var _=require(_0x49be('0x0'));var util=require(_0x49be('0x1'));var moment=require(_0x49be('0x2'));var BPromise=require(_0x49be('0x3'));var rs=require(_0x49be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49be('0x5'))['db'];var utils=require(_0x49be('0x6'));var logger=require(_0x49be('0x7'))(_0x49be('0x8'));var config=require(_0x49be('0x9'));var jayson=require(_0x49be('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f2366,_0x50d9e7,_0x37fb24){return new BPromise(function(_0xb0de42,_0xdd17e9){return client[_0x49be('0xb')](_0x2f2366,_0x37fb24)[_0x49be('0xc')](function(_0x115d77){logger['info'](_0x49be('0xd'),_0x50d9e7,_0x49be('0xe'));logger[_0x49be('0xf')](_0x49be('0x10'),_0x50d9e7,_0x49be('0xe'),JSON[_0x49be('0x11')](_0x115d77));if(_0x115d77[_0x49be('0x12')]){if(_0x115d77[_0x49be('0x12')]['code']===0x1f4){logger[_0x49be('0x12')](_0x49be('0xd'),_0x50d9e7,_0x115d77[_0x49be('0x12')][_0x49be('0x13')]);return _0xdd17e9(_0x115d77[_0x49be('0x12')]['message']);}logger['error'](_0x49be('0xd'),_0x50d9e7,_0x115d77[_0x49be('0x12')][_0x49be('0x13')]);return _0xb0de42(_0x115d77[_0x49be('0x12')][_0x49be('0x13')]);}else{logger[_0x49be('0x14')](_0x49be('0xd'),_0x50d9e7,_0x49be('0xe'));_0xb0de42(_0x115d77[_0x49be('0x15')]['message']);}})[_0x49be('0x16')](function(_0x47ec12){logger[_0x49be('0x12')](_0x49be('0xd'),_0x50d9e7,_0x47ec12);_0xdd17e9(_0x47ec12);});});}
\ No newline at end of file
+var _0xbbd6=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent'];(function(_0x37788d,_0x17e188){var _0x47ffc7=function(_0x528e01){while(--_0x528e01){_0x37788d['push'](_0x37788d['shift']());}};_0x47ffc7(++_0x17e188);}(_0xbbd6,0x1d8));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6bbd('0x0'));var moment=require(_0x6bbd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6bbd('0x2'))['db'];var utils=require(_0x6bbd('0x3'));var logger=require('../../config/logger')(_0x6bbd('0x4'));var config=require(_0x6bbd('0x5'));var jayson=require(_0x6bbd('0x6'));var client=jayson['client'][_0x6bbd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x100a02,_0x1d2500,_0x329197){return new BPromise(function(_0x3cbc8f,_0x2a8488){return client[_0x6bbd('0x8')](_0x100a02,_0x329197)[_0x6bbd('0x9')](function(_0x577530){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x1d2500,_0x6bbd('0xa'));logger[_0x6bbd('0xb')](_0x6bbd('0xc'),_0x1d2500,_0x6bbd('0xa'),JSON[_0x6bbd('0xd')](_0x577530));if(_0x577530['error']){if(_0x577530[_0x6bbd('0xe')][_0x6bbd('0xf')]===0x1f4){logger[_0x6bbd('0xe')](_0x6bbd('0x10'),_0x1d2500,_0x577530[_0x6bbd('0xe')][_0x6bbd('0x11')]);return _0x2a8488(_0x577530['error']['message']);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1d2500,_0x577530[_0x6bbd('0xe')][_0x6bbd('0x11')]);return _0x3cbc8f(_0x577530[_0x6bbd('0xe')][_0x6bbd('0x11')]);}else{logger[_0x6bbd('0x12')](_0x6bbd('0x10'),_0x1d2500,_0x6bbd('0xa'));_0x3cbc8f(_0x577530[_0x6bbd('0x13')][_0x6bbd('0x11')]);}})[_0x6bbd('0x14')](function(_0x41caa1){logger[_0x6bbd('0xe')](_0x6bbd('0x10'),_0x1d2500,_0x41caa1);_0x2a8488(_0x41caa1);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f68=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','connect-timeout','express'];(function(_0x5ecfa8,_0x231ca0){var _0x138228=function(_0x23c076){while(--_0x23c076){_0x5ecfa8['push'](_0x5ecfa8['shift']());}};_0x138228(++_0x231ca0);}(_0x7f68,0x1c6));var _0x87f6=function(_0x384070,_0x56cd7f){_0x384070=_0x384070-0x0;var _0x2fe1bb=_0x7f68[_0x384070];return _0x2fe1bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x87f6('0x0'));var express=require(_0x87f6('0x1'));var router=express[_0x87f6('0x2')]();var fs_extra=require(_0x87f6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x87f6('0x4'));var config=require(_0x87f6('0x5'));var controller=require(_0x87f6('0x6'));router['get']('/',auth[_0x87f6('0x7')](),controller['index']);router[_0x87f6('0x8')](_0x87f6('0x9'),auth['isAuthenticated'](),controller[_0x87f6('0xa')]);router['get'](_0x87f6('0xb'),auth[_0x87f6('0x7')](),controller[_0x87f6('0xc')]);router['post']('/',auth[_0x87f6('0x7')](),controller[_0x87f6('0xd')]);router[_0x87f6('0xe')](_0x87f6('0xb'),auth[_0x87f6('0x7')](),controller[_0x87f6('0xf')]);router[_0x87f6('0x10')](_0x87f6('0xb'),auth[_0x87f6('0x7')](),controller[_0x87f6('0x11')]);module[_0x87f6('0x12')]=router;
\ No newline at end of file
+var _0x7727=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','isAuthenticated','/:id','post','create','put','destroy','multer','util','path','Router'];(function(_0x148983,_0x353e9c){var _0x3bf5e8=function(_0x2812dd){while(--_0x2812dd){_0x148983['push'](_0x148983['shift']());}};_0x3bf5e8(++_0x353e9c);}(_0x7727,0x10c));var _0x7772=function(_0xfadc1a,_0xc6a189){_0xfadc1a=_0xfadc1a-0x0;var _0x1be3a4=_0x7727[_0xfadc1a];return _0x1be3a4;};'use strict';var multer=require(_0x7772('0x0'));var util=require(_0x7772('0x1'));var path=require(_0x7772('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7772('0x3')]();var fs_extra=require(_0x7772('0x4'));var auth=require(_0x7772('0x5'));var interaction=require(_0x7772('0x6'));var config=require(_0x7772('0x7'));var controller=require(_0x7772('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7772('0x9')](_0x7772('0xa'),auth[_0x7772('0xb')](),controller['describe']);router['get'](_0x7772('0xc'),auth[_0x7772('0xb')](),controller['show']);router[_0x7772('0xd')]('/',auth['isAuthenticated'](),controller[_0x7772('0xe')]);router[_0x7772('0xf')](_0x7772('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7772('0xc'),auth[_0x7772('0xb')](),controller[_0x7772('0x10')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05bb=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','create','post','addConfiguration','put'];(function(_0x10a546,_0x5ea132){var _0x30e897=function(_0x54964b){while(--_0x54964b){_0x10a546['push'](_0x10a546['shift']());}};_0x30e897(++_0x5ea132);}(_0x05bb,0x1a4));var _0xb05b=function(_0xf70695,_0x4932a6){_0xf70695=_0xf70695-0x0;var _0x57a642=_0x05bb[_0xf70695];return _0x57a642;};'use strict';var multer=require(_0xb05b('0x0'));var util=require(_0xb05b('0x1'));var path=require(_0xb05b('0x2'));var timeout=require(_0xb05b('0x3'));var express=require(_0xb05b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb05b('0x5'));var interaction=require(_0xb05b('0x6'));var config=require(_0xb05b('0x7'));var controller=require(_0xb05b('0x8'));router[_0xb05b('0x9')]('/',auth[_0xb05b('0xa')](),controller[_0xb05b('0xb')]);router['get'](_0xb05b('0xc'),auth[_0xb05b('0xa')](),controller[_0xb05b('0xd')]);router[_0xb05b('0x9')](_0xb05b('0xe'),auth[_0xb05b('0xa')](),controller['getConfigurations']);router[_0xb05b('0x9')]('/:id/fields',auth[_0xb05b('0xa')](),controller[_0xb05b('0xf')]);router['post']('/',auth[_0xb05b('0xa')](),controller[_0xb05b('0x10')]);router[_0xb05b('0x11')](_0xb05b('0xe'),auth[_0xb05b('0xa')](),controller[_0xb05b('0x12')]);router[_0xb05b('0x13')]('/:id',auth[_0xb05b('0xa')](),controller['update']);router[_0xb05b('0x14')](_0xb05b('0xc'),auth[_0xb05b('0xa')](),controller[_0xb05b('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x984a=['/:id','show','/:id/configurations','/:id/fields','getFields','post','create','put','destroy','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x35d06e,_0x2e3503){var _0x9e9053=function(_0x1546d3){while(--_0x1546d3){_0x35d06e['push'](_0x35d06e['shift']());}};_0x9e9053(++_0x2e3503);}(_0x984a,0x1b2));var _0xa984=function(_0x7245f1,_0x50fab1){_0x7245f1=_0x7245f1-0x0;var _0x4d143d=_0x984a[_0x7245f1];return _0x4d143d;};'use strict';var multer=require('multer');var util=require(_0xa984('0x0'));var path=require(_0xa984('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa984('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa984('0x3'));var config=require(_0xa984('0x4'));var controller=require('./intDeskAccount.controller');router[_0xa984('0x5')]('/',auth[_0xa984('0x6')](),controller[_0xa984('0x7')]);router[_0xa984('0x5')](_0xa984('0x8'),auth[_0xa984('0x6')](),controller[_0xa984('0x9')]);router[_0xa984('0x5')](_0xa984('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xa984('0x5')](_0xa984('0xb'),auth['isAuthenticated'](),controller[_0xa984('0xc')]);router[_0xa984('0xd')]('/',auth[_0xa984('0x6')](),controller[_0xa984('0xe')]);router[_0xa984('0xd')](_0xa984('0xa'),auth[_0xa984('0x6')](),controller['addConfiguration']);router[_0xa984('0xf')](_0xa984('0x8'),auth[_0xa984('0x6')](),controller['update']);router['delete'](_0xa984('0x8'),auth[_0xa984('0x6')](),controller[_0xa984('0x10')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef85=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x44b517,_0x5d0ed5){var _0x82d9b5=function(_0x4fb0fc){while(--_0x4fb0fc){_0x44b517['push'](_0x44b517['shift']());}};_0x82d9b5(++_0x5d0ed5);}(_0xef85,0xe7));var _0x5ef8=function(_0x55f5ca,_0x29da4b){_0x55f5ca=_0x55f5ca-0x0;var _0x1dfe24=_0xef85[_0x55f5ca];return _0x1dfe24;};'use strict';var Sequelize=require(_0x5ef8('0x0'));module[_0x5ef8('0x1')]={'name':{'type':Sequelize[_0x5ef8('0x2')]},'description':{'type':Sequelize[_0x5ef8('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5ef8('0x2')]},'authType':{'type':Sequelize[_0x5ef8('0x3')](_0x5ef8('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x5ef8('0x2')]},'consumerKey':{'type':Sequelize[_0x5ef8('0x2')]},'consumerSecret':{'type':Sequelize[_0x5ef8('0x2')]},'token':{'type':Sequelize[_0x5ef8('0x2')]},'tokenSecret':{'type':Sequelize[_0x5ef8('0x2')]},'serverUrl':{'type':Sequelize[_0x5ef8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5ef8('0x3')](_0x5ef8('0x5'),'newTab'),'defaultValue':_0x5ef8('0x5')}};
\ No newline at end of file
+var _0x8175=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x2514ec,_0x51e1c2){var _0x4a4ec3=function(_0x2915ee){while(--_0x2915ee){_0x2514ec['push'](_0x2514ec['shift']());}};_0x4a4ec3(++_0x51e1c2);}(_0x8175,0xa1));var _0x5817=function(_0x70841e,_0x1e002d){_0x70841e=_0x70841e-0x0;var _0x4f15a8=_0x8175[_0x70841e];return _0x4f15a8;};'use strict';var Sequelize=require(_0x5817('0x0'));module[_0x5817('0x1')]={'name':{'type':Sequelize[_0x5817('0x2')]},'description':{'type':Sequelize[_0x5817('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5817('0x2')]},'authType':{'type':Sequelize[_0x5817('0x3')](_0x5817('0x4')),'defaultValue':_0x5817('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x5817('0x2')]},'consumerSecret':{'type':Sequelize[_0x5817('0x2')]},'token':{'type':Sequelize[_0x5817('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5817('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5817('0x5'),_0x5817('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f8c=['authType','format','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','DeskConfiguration','getConfigurations','AccountId','Subjects','channel','DeskField','Descriptions','priority','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','GET','%s/custom_fields','application/json'];(function(_0x444335,_0x927a8c){var _0x1a5612=function(_0x47b662){while(--_0x47b662){_0x444335['push'](_0x444335['shift']());}};_0x1a5612(++_0x927a8c);}(_0x9f8c,0xeb));var _0xc9f8=function(_0x324f9f,_0x22ff81){_0x324f9f=_0x324f9f-0x0;var _0x3047b0=_0x9f8c[_0x324f9f];return _0x3047b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9f8('0x0'));var zipdir=require(_0xc9f8('0x1'));var jsonpatch=require(_0xc9f8('0x2'));var rp=require('request-promise');var moment=require(_0xc9f8('0x3'));var BPromise=require(_0xc9f8('0x4'));var Mustache=require(_0xc9f8('0x5'));var util=require(_0xc9f8('0x6'));var path=require(_0xc9f8('0x7'));var sox=require('sox');var csv=require(_0xc9f8('0x8'));var ejs=require(_0xc9f8('0x9'));var fs=require('fs');var fs_extra=require(_0xc9f8('0xa'));var _=require(_0xc9f8('0xb'));var squel=require(_0xc9f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xc9f8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9f8('0xe'));var Papa=require(_0xc9f8('0xf'));var Redis=require('ioredis');var authService=require(_0xc9f8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9f8('0x11'));var logger=require(_0xc9f8('0x12'))(_0xc9f8('0x13'));var utils=require(_0xc9f8('0x14'));var config=require(_0xc9f8('0x15'));var licenseUtil=require(_0xc9f8('0x16'));var db=require(_0xc9f8('0x17'))['db'];var integrations=require(_0xc9f8('0x18'));function respondWithStatusCode(_0x39942a,_0x553f87){_0x553f87=_0x553f87||0xcc;return function(_0x1e716b){if(_0x1e716b){return _0x39942a['sendStatus'](_0x553f87);}return _0x39942a[_0xc9f8('0x19')](_0x553f87)[_0xc9f8('0x1a')]();};}function respondWithResult(_0x4a6db8,_0x4740d6){_0x4740d6=_0x4740d6||0xc8;return function(_0xbdda15){if(_0xbdda15){return _0x4a6db8[_0xc9f8('0x19')](_0x4740d6)['json'](_0xbdda15);}};}function respondWithFilteredResult(_0x3f673a,_0x2fa078){return function(_0x131b6f){if(_0x131b6f){var _0x26dda5=typeof _0x2fa078[_0xc9f8('0x1b')]===_0xc9f8('0x1c')&&typeof _0x2fa078[_0xc9f8('0x1d')]===_0xc9f8('0x1c');var _0x5e0a32=_0x131b6f[_0xc9f8('0x1e')];var _0x3dfd1f=_0x26dda5?0x0:_0x2fa078[_0xc9f8('0x1b')];var _0xa88f5f=_0x26dda5?_0x131b6f[_0xc9f8('0x1e')]:_0x2fa078['offset']+_0x2fa078[_0xc9f8('0x1d')];var _0x2ecf42;if(_0xa88f5f>=_0x5e0a32){_0xa88f5f=_0x5e0a32;_0x2ecf42=0xc8;}else{_0x2ecf42=0xce;}_0x3f673a[_0xc9f8('0x19')](_0x2ecf42);return _0x3f673a[_0xc9f8('0x1f')](_0xc9f8('0x20'),_0x3dfd1f+'-'+_0xa88f5f+'/'+_0x5e0a32)[_0xc9f8('0x21')](_0x131b6f);}return null;};}function patchUpdates(_0x4304e1){return function(_0x7f9661){try{jsonpatch[_0xc9f8('0x22')](_0x7f9661,_0x4304e1,!![]);}catch(_0x223272){return BPromise['reject'](_0x223272);}return _0x7f9661[_0xc9f8('0x23')]();};}function saveUpdates(_0x4fc7b0,_0x5f1c88){return function(_0x9be31c){if(_0x9be31c){return _0x9be31c[_0xc9f8('0x24')](_0x4fc7b0)[_0xc9f8('0x25')](function(_0x367675){return _0x367675;});}return null;};}function removeEntity(_0x42d30c,_0x1b6daa){return function(_0x4b58df){if(_0x4b58df){return _0x4b58df['destroy']()['then'](function(){_0x42d30c[_0xc9f8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x831d88,_0x3ac152){return function(_0x5b4d9d){if(!_0x5b4d9d){_0x831d88['sendStatus'](0x194);}return _0x5b4d9d;};}function handleError(_0x3b6cb3,_0x4ac038){_0x4ac038=_0x4ac038||0x1f4;return function(_0x4cd242){logger[_0xc9f8('0x26')](_0x4cd242[_0xc9f8('0x27')]);if(_0x4cd242['name']){delete _0x4cd242[_0xc9f8('0x28')];}_0x3b6cb3[_0xc9f8('0x19')](_0x4ac038)[_0xc9f8('0x29')](_0x4cd242);};}exports['index']=function(_0x2ac1ac,_0xa5c390){var _0x380696={},_0x1f6a8d={},_0x32fb4d={'count':0x0,'rows':[]};var _0x51f8a5=_[_0xc9f8('0x2a')](db[_0xc9f8('0x2b')][_0xc9f8('0x2c')],function(_0x40ae2d){return{'name':_0x40ae2d[_0xc9f8('0x2d')],'type':_0x40ae2d['type']['key']};});_0x1f6a8d[_0xc9f8('0x2e')]=_[_0xc9f8('0x2a')](_0x51f8a5,_0xc9f8('0x28'));_0x1f6a8d[_0xc9f8('0x2f')]=_[_0xc9f8('0x30')](_0x2ac1ac['query']);_0x1f6a8d[_0xc9f8('0x31')]=_['intersection'](_0x1f6a8d['model'],_0x1f6a8d[_0xc9f8('0x2f')]);_0x380696[_0xc9f8('0x32')]=_[_0xc9f8('0x33')](_0x1f6a8d['model'],qs[_0xc9f8('0x34')](_0x2ac1ac[_0xc9f8('0x2f')]['fields']));_0x380696['attributes']=_0x380696[_0xc9f8('0x32')][_0xc9f8('0x35')]?_0x380696[_0xc9f8('0x32')]:_0x1f6a8d[_0xc9f8('0x2e')];if(!_0x2ac1ac['query'][_0xc9f8('0x36')](_0xc9f8('0x37'))){_0x380696[_0xc9f8('0x1d')]=qs[_0xc9f8('0x1d')](_0x2ac1ac[_0xc9f8('0x2f')][_0xc9f8('0x1d')]);_0x380696[_0xc9f8('0x1b')]=qs['offset'](_0x2ac1ac[_0xc9f8('0x2f')]['offset']);}_0x380696[_0xc9f8('0x38')]=qs[_0xc9f8('0x39')](_0x2ac1ac[_0xc9f8('0x2f')][_0xc9f8('0x39')]);_0x380696[_0xc9f8('0x3a')]=qs['filters'](_[_0xc9f8('0x3b')](_0x2ac1ac[_0xc9f8('0x2f')],_0x1f6a8d['filters']),_0x51f8a5);if(_0x2ac1ac[_0xc9f8('0x2f')][_0xc9f8('0x3c')]){_0x380696[_0xc9f8('0x3a')]=_[_0xc9f8('0x3d')](_0x380696[_0xc9f8('0x3a')],{'$or':_[_0xc9f8('0x2a')](_0x51f8a5,function(_0x430227){if(_0x430227[_0xc9f8('0x3e')]!==_0xc9f8('0x3f')){var _0x75570d={};_0x75570d[_0x430227[_0xc9f8('0x28')]]={'$like':'%'+_0x2ac1ac[_0xc9f8('0x2f')]['filter']+'%'};return _0x75570d;}})});}_0x380696=_[_0xc9f8('0x3d')]({},_0x380696,_0x2ac1ac[_0xc9f8('0x40')]);var _0x306f41={'where':_0x380696[_0xc9f8('0x3a')]};return db[_0xc9f8('0x2b')][_0xc9f8('0x1e')](_0x306f41)['then'](function(_0x436a5d){_0x32fb4d[_0xc9f8('0x1e')]=_0x436a5d;if(_0x2ac1ac['query'][_0xc9f8('0x41')]){_0x380696[_0xc9f8('0x42')]=[{'all':!![]}];}return db[_0xc9f8('0x2b')][_0xc9f8('0x43')](_0x380696);})[_0xc9f8('0x25')](function(_0x43be04){_0x32fb4d[_0xc9f8('0x44')]=_0x43be04;return _0x32fb4d;})[_0xc9f8('0x25')](respondWithFilteredResult(_0xa5c390,_0x380696))[_0xc9f8('0x45')](handleError(_0xa5c390,null));};exports[_0xc9f8('0x46')]=function(_0x3e8889,_0x23cf36){var _0x59d128={'raw':![],'where':{'id':_0x3e8889['params']['id']}},_0x2d5f2a={};_0x2d5f2a[_0xc9f8('0x2e')]=_[_0xc9f8('0x30')](db[_0xc9f8('0x2b')]['rawAttributes']);_0x2d5f2a[_0xc9f8('0x2f')]=_[_0xc9f8('0x30')](_0x3e8889[_0xc9f8('0x2f')]);_0x2d5f2a[_0xc9f8('0x31')]=_[_0xc9f8('0x33')](_0x2d5f2a[_0xc9f8('0x2e')],_0x2d5f2a[_0xc9f8('0x2f')]);_0x59d128[_0xc9f8('0x32')]=_['intersection'](_0x2d5f2a[_0xc9f8('0x2e')],qs['fields'](_0x3e8889[_0xc9f8('0x2f')][_0xc9f8('0x34')]));_0x59d128[_0xc9f8('0x32')]=_0x59d128[_0xc9f8('0x32')][_0xc9f8('0x35')]?_0x59d128[_0xc9f8('0x32')]:_0x2d5f2a[_0xc9f8('0x2e')];if(_0x3e8889[_0xc9f8('0x2f')]['includeAll']){_0x59d128[_0xc9f8('0x42')]=[{'all':!![]}];}_0x59d128=_[_0xc9f8('0x3d')]({},_0x59d128,_0x3e8889[_0xc9f8('0x40')]);return db[_0xc9f8('0x2b')][_0xc9f8('0x47')](_0x59d128)[_0xc9f8('0x25')](handleEntityNotFound(_0x23cf36,null))[_0xc9f8('0x25')](respondWithResult(_0x23cf36,null))[_0xc9f8('0x45')](handleError(_0x23cf36,null));};exports[_0xc9f8('0x48')]=function(_0x4783fa,_0x4fd271){return db[_0xc9f8('0x2b')][_0xc9f8('0x48')](_0x4783fa[_0xc9f8('0x49')],{})[_0xc9f8('0x25')](respondWithResult(_0x4fd271,0xc9))[_0xc9f8('0x45')](handleError(_0x4fd271,null));};exports[_0xc9f8('0x24')]=function(_0x16444c,_0xb9c16f){if(_0x16444c[_0xc9f8('0x49')]['id']){delete _0x16444c[_0xc9f8('0x49')]['id'];}return db[_0xc9f8('0x2b')]['find']({'where':{'id':_0x16444c[_0xc9f8('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb9c16f,null))[_0xc9f8('0x25')](saveUpdates(_0x16444c['body'],null))[_0xc9f8('0x25')](respondWithResult(_0xb9c16f,null))['catch'](handleError(_0xb9c16f,null));};exports[_0xc9f8('0x4b')]=function(_0x22aec8,_0x44a664){return db[_0xc9f8('0x2b')][_0xc9f8('0x47')]({'where':{'id':_0x22aec8[_0xc9f8('0x4a')]['id']}})[_0xc9f8('0x25')](handleEntityNotFound(_0x44a664,null))[_0xc9f8('0x25')](removeEntity(_0x44a664,null))[_0xc9f8('0x45')](handleError(_0x44a664,null));};exports['getConfigurations']=function(_0x1d88d2,_0x506ac4,_0x354a85){var _0x32d69f={};var _0x342cbd={};var _0x43a311;var _0x128cb9;return db[_0xc9f8('0x2b')]['findOne']({'where':{'id':_0x1d88d2[_0xc9f8('0x4a')]['id']}})[_0xc9f8('0x25')](handleEntityNotFound(_0x506ac4,null))[_0xc9f8('0x25')](function(_0x123d85){if(_0x123d85){_0x43a311=_0x123d85;_0x342cbd[_0xc9f8('0x2e')]=_[_0xc9f8('0x30')](db[_0xc9f8('0x4c')]['rawAttributes']);_0x342cbd[_0xc9f8('0x2f')]=_[_0xc9f8('0x30')](_0x1d88d2[_0xc9f8('0x2f')]);_0x342cbd[_0xc9f8('0x31')]=_['intersection'](_0x342cbd[_0xc9f8('0x2e')],_0x342cbd['query']);_0x32d69f[_0xc9f8('0x32')]=_[_0xc9f8('0x33')](_0x342cbd[_0xc9f8('0x2e')],qs[_0xc9f8('0x34')](_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x34')]));_0x32d69f[_0xc9f8('0x32')]=_0x32d69f[_0xc9f8('0x32')][_0xc9f8('0x35')]?_0x32d69f[_0xc9f8('0x32')]:_0x342cbd[_0xc9f8('0x2e')];_0x32d69f[_0xc9f8('0x38')]=qs['sort'](_0x1d88d2[_0xc9f8('0x2f')]['sort']);_0x32d69f[_0xc9f8('0x3a')]=qs[_0xc9f8('0x31')](_[_0xc9f8('0x3b')](_0x1d88d2['query'],_0x342cbd['filters']));if(_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x3c')]){_0x32d69f['where']=_['merge'](_0x32d69f[_0xc9f8('0x3a')],{'$or':_[_0xc9f8('0x2a')](_0x32d69f[_0xc9f8('0x32')],function(_0x500b9a){var _0x17bb40={};_0x17bb40[_0x500b9a]={'$like':'%'+_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x3c')]+'%'};return _0x17bb40;})});}_0x32d69f=_['merge']({},_0x32d69f,_0x1d88d2[_0xc9f8('0x40')]);return _0x43a311[_0xc9f8('0x4d')](_0x32d69f);}})['then'](function(_0x14017f){if(_0x14017f){_0x128cb9=_0x14017f[_0xc9f8('0x35')];if(!_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x36')]('nolimit')){_0x32d69f[_0xc9f8('0x1d')]=qs[_0xc9f8('0x1d')](_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x1d')]);_0x32d69f['offset']=qs[_0xc9f8('0x1b')](_0x1d88d2[_0xc9f8('0x2f')][_0xc9f8('0x1b')]);}return _0x43a311[_0xc9f8('0x4d')](_0x32d69f);}})[_0xc9f8('0x25')](function(_0x25466a){if(_0x25466a){return _0x25466a?{'count':_0x128cb9,'rows':_0x25466a}:null;}})[_0xc9f8('0x25')](respondWithResult(_0x506ac4,null))[_0xc9f8('0x45')](handleError(_0x506ac4,null));};exports['addConfiguration']=function(_0x400b74,_0x2d91ab,_0x5eb5b0){if(_0x400b74[_0xc9f8('0x49')]['id']){delete _0x400b74[_0xc9f8('0x49')]['id'];}return db[_0xc9f8('0x2b')]['findOne']({'where':{'id':_0x400b74[_0xc9f8('0x4a')]['id']}})[_0xc9f8('0x25')](handleEntityNotFound(_0x2d91ab,null))['then'](function(_0x4b677a){if(_0x4b677a){_0x400b74['body'][_0xc9f8('0x4e')]=_0x4b677a['id'];_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x4f')]=integrations['getSubjects'](_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x50')],_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x3e')]);_0x400b74[_0xc9f8('0x49')]['Descriptions']=integrations['getDescriptions'](_0x400b74[_0xc9f8('0x49')]['channel'],_0x400b74[_0xc9f8('0x49')][_0xc9f8('0x3e')]);return db['DeskConfiguration'][_0xc9f8('0x48')](_0x400b74[_0xc9f8('0x49')],{'include':[{'model':db[_0xc9f8('0x51')],'as':_0xc9f8('0x4f')},{'model':db['DeskField'],'as':_0xc9f8('0x52')}]});}return null;})[_0xc9f8('0x25')](respondWithResult(_0x2d91ab,null))[_0xc9f8('0x45')](handleError(_0x2d91ab,null));};exports['getFields']=function(_0x2cafc0,_0x1003bf,_0x7646e7){var _0x5be1d7=[{'name':'priority','label':_0xc9f8('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x46e7b7='';return db[_0xc9f8('0x2b')]['findOne']({'where':{'id':_0x2cafc0[_0xc9f8('0x4a')]['id']},'attributes':['id','remoteUri','authType',_0xc9f8('0x54'),_0xc9f8('0x55'),_0xc9f8('0x56'),_0xc9f8('0x57'),_0xc9f8('0x58'),_0xc9f8('0x59')]})[_0xc9f8('0x25')](handleEntityNotFound(_0x1003bf,null))[_0xc9f8('0x25')](function(_0x2aef58){if(_0x2aef58){_0x46e7b7=_0x2aef58[_0xc9f8('0x5a')];var _0x12e1e6=_0x46e7b7[_0xc9f8('0x5b')](-0x1);if(_0x12e1e6==='/'){_0x46e7b7=_0x46e7b7['substring'](0x0,_0x46e7b7['lastIndexOf'](_0x12e1e6));}var _0x56009d={'method':_0xc9f8('0x5c'),'uri':util['format'](_0xc9f8('0x5d'),_0x46e7b7),'headers':{'Content-Type':'application/json','Accept':_0xc9f8('0x5e')},'json':!![]};if(_0x2aef58[_0xc9f8('0x5f')]==='basic'){_0x56009d['headers']['Authorization']=util[_0xc9f8('0x60')](_0xc9f8('0x61'),new Buffer(util[_0xc9f8('0x60')](_0xc9f8('0x62'),_0x2aef58[_0xc9f8('0x54')],_0x2aef58['password']))[_0xc9f8('0x63')](_0xc9f8('0x64')));}return rp(_0x56009d)[_0xc9f8('0x25')](function(_0x371038){return _0x5be1d7[_0xc9f8('0x65')](_['map'](_0x371038[_0xc9f8('0x66')]['entries'],function(_0x3e4ad0){return{'id':_0x3e4ad0[_0xc9f8('0x28')],'name':_0x3e4ad0[_0xc9f8('0x28')],'type':_0x3e4ad0[_0xc9f8('0x3e')],'active':_0x3e4ad0[_0xc9f8('0x67')],'label':_0x3e4ad0['label'],'custom':!![]};}));});}})['then'](function(_0x275a3f){return{'count':_0x275a3f[_0xc9f8('0x35')],'rows':_0x275a3f};})[_0xc9f8('0x25')](respondWithResult(_0x1003bf,null))['catch'](function(_0x33be32){var _0x525afa=_0x2cafc0[_0xc9f8('0x2f')][_0xc9f8('0x68')]?0x1f4:_0x33be32[_0xc9f8('0x69')]||0x1f4;logger[_0xc9f8('0x26')](_0xc9f8('0x6a'),_0xc9f8('0x6b'),_0x525afa,JSON[_0xc9f8('0x6c')](_0x33be32));delete _0x33be32[_0xc9f8('0x28')];if(_0x525afa===0x191){_0x525afa=0x190;}_0x1003bf['status'](_0x525afa)[_0xc9f8('0x29')](_0x2cafc0['query'][_0xc9f8('0x68')]?{'message':_0xc9f8('0x6d'),'statusCode':_0x33be32[_0xc9f8('0x69')]}:_0x33be32);});};
\ No newline at end of file
+var _0xd389=['toString','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','DeskAccount','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','include','rows','catch','show','params','rawAttributes','intersection','includeAll','options','find','create','body','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','GET','format','%s/custom_fields','application/json','headers','Authorization','%s:%s'];(function(_0x1d7138,_0x1a9ffa){var _0x4008b8=function(_0x4c7227){while(--_0x4c7227){_0x1d7138['push'](_0x1d7138['shift']());}};_0x4008b8(++_0x1a9ffa);}(_0xd389,0x78));var _0x9d38=function(_0x396f51,_0xd07fcb){_0x396f51=_0x396f51-0x0;var _0x1ee499=_0xd389[_0x396f51];return _0x1ee499;};'use strict';var emlformat=require(_0x9d38('0x0'));var rimraf=require(_0x9d38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d38('0x2'));var rp=require(_0x9d38('0x3'));var moment=require(_0x9d38('0x4'));var BPromise=require(_0x9d38('0x5'));var Mustache=require(_0x9d38('0x6'));var util=require(_0x9d38('0x7'));var path=require(_0x9d38('0x8'));var sox=require(_0x9d38('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d38('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d38('0xb'));var deskjs=require(_0x9d38('0xc'));var toCsv=require(_0x9d38('0xd'));var querystring=require(_0x9d38('0xe'));var Papa=require(_0x9d38('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d38('0x10'));var hardwareService=require(_0x9d38('0x11'));var logger=require('../../config/logger')(_0x9d38('0x12'));var utils=require('../../config/utils');var config=require(_0x9d38('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d38('0x14'))['db'];var integrations=require(_0x9d38('0x15'));function respondWithStatusCode(_0x59b1fe,_0x468525){_0x468525=_0x468525||0xcc;return function(_0x42b5ec){if(_0x42b5ec){return _0x59b1fe[_0x9d38('0x16')](_0x468525);}return _0x59b1fe[_0x9d38('0x17')](_0x468525)['end']();};}function respondWithResult(_0x7d28ea,_0xdadb90){_0xdadb90=_0xdadb90||0xc8;return function(_0x5321e6){if(_0x5321e6){return _0x7d28ea[_0x9d38('0x17')](_0xdadb90)[_0x9d38('0x18')](_0x5321e6);}};}function respondWithFilteredResult(_0x376aa0,_0x1dce91){return function(_0x3c1ba1){if(_0x3c1ba1){var _0x4431a1=typeof _0x1dce91['offset']===_0x9d38('0x19')&&typeof _0x1dce91[_0x9d38('0x1a')]===_0x9d38('0x19');var _0x5c3c29=_0x3c1ba1['count'];var _0x5c08ad=_0x4431a1?0x0:_0x1dce91['offset'];var _0xfa7c5=_0x4431a1?_0x3c1ba1['count']:_0x1dce91[_0x9d38('0x1b')]+_0x1dce91[_0x9d38('0x1a')];var _0x46bc14;if(_0xfa7c5>=_0x5c3c29){_0xfa7c5=_0x5c3c29;_0x46bc14=0xc8;}else{_0x46bc14=0xce;}_0x376aa0[_0x9d38('0x17')](_0x46bc14);return _0x376aa0[_0x9d38('0x1c')](_0x9d38('0x1d'),_0x5c08ad+'-'+_0xfa7c5+'/'+_0x5c3c29)['json'](_0x3c1ba1);}return null;};}function patchUpdates(_0x110560){return function(_0x24cc3d){try{jsonpatch[_0x9d38('0x1e')](_0x24cc3d,_0x110560,!![]);}catch(_0x1f3ce3){return BPromise[_0x9d38('0x1f')](_0x1f3ce3);}return _0x24cc3d[_0x9d38('0x20')]();};}function saveUpdates(_0x3dbc79,_0x5b0b1d){return function(_0x271005){if(_0x271005){return _0x271005['update'](_0x3dbc79)[_0x9d38('0x21')](function(_0x440b38){return _0x440b38;});}return null;};}function removeEntity(_0x3791b7,_0x229991){return function(_0x332a3c){if(_0x332a3c){return _0x332a3c[_0x9d38('0x22')]()[_0x9d38('0x21')](function(){_0x3791b7[_0x9d38('0x17')](0xcc)[_0x9d38('0x23')]();});}};}function handleEntityNotFound(_0x54ff3f,_0x2a9e3c){return function(_0x1930c3){if(!_0x1930c3){_0x54ff3f[_0x9d38('0x16')](0x194);}return _0x1930c3;};}function handleError(_0x5e6d53,_0x128763){_0x128763=_0x128763||0x1f4;return function(_0x879d2){logger[_0x9d38('0x24')](_0x879d2[_0x9d38('0x25')]);if(_0x879d2[_0x9d38('0x26')]){delete _0x879d2[_0x9d38('0x26')];}_0x5e6d53[_0x9d38('0x17')](_0x128763)[_0x9d38('0x27')](_0x879d2);};}exports[_0x9d38('0x28')]=function(_0x8d6c24,_0x2d7b69){var _0xc3fd01={},_0x58249b={},_0x317c72={'count':0x0,'rows':[]};var _0x17ba27=_[_0x9d38('0x29')](db[_0x9d38('0x2a')]['rawAttributes'],function(_0x55132d){return{'name':_0x55132d['fieldName'],'type':_0x55132d[_0x9d38('0x2b')][_0x9d38('0x2c')]};});_0x58249b[_0x9d38('0x2d')]=_[_0x9d38('0x29')](_0x17ba27,_0x9d38('0x26'));_0x58249b[_0x9d38('0x2e')]=_[_0x9d38('0x2f')](_0x8d6c24[_0x9d38('0x2e')]);_0x58249b[_0x9d38('0x30')]=_['intersection'](_0x58249b[_0x9d38('0x2d')],_0x58249b[_0x9d38('0x2e')]);_0xc3fd01['attributes']=_['intersection'](_0x58249b[_0x9d38('0x2d')],qs[_0x9d38('0x31')](_0x8d6c24[_0x9d38('0x2e')][_0x9d38('0x31')]));_0xc3fd01[_0x9d38('0x32')]=_0xc3fd01[_0x9d38('0x32')][_0x9d38('0x33')]?_0xc3fd01[_0x9d38('0x32')]:_0x58249b[_0x9d38('0x2d')];if(!_0x8d6c24[_0x9d38('0x2e')][_0x9d38('0x34')](_0x9d38('0x35'))){_0xc3fd01[_0x9d38('0x1a')]=qs[_0x9d38('0x1a')](_0x8d6c24[_0x9d38('0x2e')][_0x9d38('0x1a')]);_0xc3fd01['offset']=qs['offset'](_0x8d6c24[_0x9d38('0x2e')]['offset']);}_0xc3fd01[_0x9d38('0x36')]=qs[_0x9d38('0x37')](_0x8d6c24[_0x9d38('0x2e')][_0x9d38('0x37')]);_0xc3fd01['where']=qs['filters'](_[_0x9d38('0x38')](_0x8d6c24[_0x9d38('0x2e')],_0x58249b[_0x9d38('0x30')]),_0x17ba27);if(_0x8d6c24[_0x9d38('0x2e')]['filter']){_0xc3fd01[_0x9d38('0x39')]=_[_0x9d38('0x3a')](_0xc3fd01[_0x9d38('0x39')],{'$or':_[_0x9d38('0x29')](_0x17ba27,function(_0x425913){if(_0x425913[_0x9d38('0x2b')]!==_0x9d38('0x3b')){var _0xdb67de={};_0xdb67de[_0x425913['name']]={'$like':'%'+_0x8d6c24['query'][_0x9d38('0x3c')]+'%'};return _0xdb67de;}})});}_0xc3fd01=_['merge']({},_0xc3fd01,_0x8d6c24['options']);var _0x79cbdd={'where':_0xc3fd01[_0x9d38('0x39')]};return db['DeskAccount']['count'](_0x79cbdd)['then'](function(_0x3ccf0d){_0x317c72[_0x9d38('0x3d')]=_0x3ccf0d;if(_0x8d6c24[_0x9d38('0x2e')]['includeAll']){_0xc3fd01[_0x9d38('0x3e')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0xc3fd01);})[_0x9d38('0x21')](function(_0x4be5b6){_0x317c72[_0x9d38('0x3f')]=_0x4be5b6;return _0x317c72;})['then'](respondWithFilteredResult(_0x2d7b69,_0xc3fd01))[_0x9d38('0x40')](handleError(_0x2d7b69,null));};exports[_0x9d38('0x41')]=function(_0x220d72,_0x4135ca){var _0xb37733={'raw':![],'where':{'id':_0x220d72[_0x9d38('0x42')]['id']}},_0x2d8cdb={};_0x2d8cdb[_0x9d38('0x2d')]=_[_0x9d38('0x2f')](db[_0x9d38('0x2a')][_0x9d38('0x43')]);_0x2d8cdb[_0x9d38('0x2e')]=_[_0x9d38('0x2f')](_0x220d72[_0x9d38('0x2e')]);_0x2d8cdb[_0x9d38('0x30')]=_[_0x9d38('0x44')](_0x2d8cdb['model'],_0x2d8cdb[_0x9d38('0x2e')]);_0xb37733[_0x9d38('0x32')]=_['intersection'](_0x2d8cdb['model'],qs['fields'](_0x220d72[_0x9d38('0x2e')][_0x9d38('0x31')]));_0xb37733['attributes']=_0xb37733[_0x9d38('0x32')][_0x9d38('0x33')]?_0xb37733[_0x9d38('0x32')]:_0x2d8cdb[_0x9d38('0x2d')];if(_0x220d72[_0x9d38('0x2e')][_0x9d38('0x45')]){_0xb37733[_0x9d38('0x3e')]=[{'all':!![]}];}_0xb37733=_[_0x9d38('0x3a')]({},_0xb37733,_0x220d72[_0x9d38('0x46')]);return db[_0x9d38('0x2a')][_0x9d38('0x47')](_0xb37733)[_0x9d38('0x21')](handleEntityNotFound(_0x4135ca,null))[_0x9d38('0x21')](respondWithResult(_0x4135ca,null))[_0x9d38('0x40')](handleError(_0x4135ca,null));};exports[_0x9d38('0x48')]=function(_0x1f3b85,_0x2cfcf4){return db[_0x9d38('0x2a')][_0x9d38('0x48')](_0x1f3b85[_0x9d38('0x49')],{})[_0x9d38('0x21')](respondWithResult(_0x2cfcf4,0xc9))['catch'](handleError(_0x2cfcf4,null));};exports['update']=function(_0x595646,_0x190852){if(_0x595646[_0x9d38('0x49')]['id']){delete _0x595646['body']['id'];}return db[_0x9d38('0x2a')][_0x9d38('0x47')]({'where':{'id':_0x595646[_0x9d38('0x42')]['id']}})[_0x9d38('0x21')](handleEntityNotFound(_0x190852,null))[_0x9d38('0x21')](saveUpdates(_0x595646['body'],null))[_0x9d38('0x21')](respondWithResult(_0x190852,null))[_0x9d38('0x40')](handleError(_0x190852,null));};exports[_0x9d38('0x22')]=function(_0x221426,_0x23d2c3){return db['DeskAccount'][_0x9d38('0x47')]({'where':{'id':_0x221426[_0x9d38('0x42')]['id']}})[_0x9d38('0x21')](handleEntityNotFound(_0x23d2c3,null))['then'](removeEntity(_0x23d2c3,null))[_0x9d38('0x40')](handleError(_0x23d2c3,null));};exports[_0x9d38('0x4a')]=function(_0x41cd72,_0x56b528,_0x16727e){var _0x319f52={};var _0x53b3f8={};var _0x18af9a;var _0x1b1475;return db['DeskAccount'][_0x9d38('0x4b')]({'where':{'id':_0x41cd72[_0x9d38('0x42')]['id']}})[_0x9d38('0x21')](handleEntityNotFound(_0x56b528,null))[_0x9d38('0x21')](function(_0x2c71ea){if(_0x2c71ea){_0x18af9a=_0x2c71ea;_0x53b3f8[_0x9d38('0x2d')]=_['keys'](db[_0x9d38('0x4c')]['rawAttributes']);_0x53b3f8[_0x9d38('0x2e')]=_[_0x9d38('0x2f')](_0x41cd72['query']);_0x53b3f8[_0x9d38('0x30')]=_[_0x9d38('0x44')](_0x53b3f8['model'],_0x53b3f8[_0x9d38('0x2e')]);_0x319f52[_0x9d38('0x32')]=_[_0x9d38('0x44')](_0x53b3f8[_0x9d38('0x2d')],qs[_0x9d38('0x31')](_0x41cd72[_0x9d38('0x2e')][_0x9d38('0x31')]));_0x319f52['attributes']=_0x319f52['attributes'][_0x9d38('0x33')]?_0x319f52[_0x9d38('0x32')]:_0x53b3f8['model'];_0x319f52[_0x9d38('0x36')]=qs[_0x9d38('0x37')](_0x41cd72[_0x9d38('0x2e')][_0x9d38('0x37')]);_0x319f52['where']=qs[_0x9d38('0x30')](_[_0x9d38('0x38')](_0x41cd72[_0x9d38('0x2e')],_0x53b3f8[_0x9d38('0x30')]));if(_0x41cd72[_0x9d38('0x2e')]['filter']){_0x319f52[_0x9d38('0x39')]=_[_0x9d38('0x3a')](_0x319f52[_0x9d38('0x39')],{'$or':_[_0x9d38('0x29')](_0x319f52[_0x9d38('0x32')],function(_0x3ecf99){var _0x1fe52e={};_0x1fe52e[_0x3ecf99]={'$like':'%'+_0x41cd72[_0x9d38('0x2e')][_0x9d38('0x3c')]+'%'};return _0x1fe52e;})});}_0x319f52=_[_0x9d38('0x3a')]({},_0x319f52,_0x41cd72[_0x9d38('0x46')]);return _0x18af9a['getConfigurations'](_0x319f52);}})[_0x9d38('0x21')](function(_0x5db9d3){if(_0x5db9d3){_0x1b1475=_0x5db9d3[_0x9d38('0x33')];if(!_0x41cd72['query'][_0x9d38('0x34')]('nolimit')){_0x319f52[_0x9d38('0x1a')]=qs[_0x9d38('0x1a')](_0x41cd72['query']['limit']);_0x319f52[_0x9d38('0x1b')]=qs[_0x9d38('0x1b')](_0x41cd72['query']['offset']);}return _0x18af9a[_0x9d38('0x4a')](_0x319f52);}})['then'](function(_0x2f51ae){if(_0x2f51ae){return _0x2f51ae?{'count':_0x1b1475,'rows':_0x2f51ae}:null;}})[_0x9d38('0x21')](respondWithResult(_0x56b528,null))['catch'](handleError(_0x56b528,null));};exports['addConfiguration']=function(_0x515aff,_0x432104,_0x130e26){if(_0x515aff['body']['id']){delete _0x515aff['body']['id'];}return db[_0x9d38('0x2a')][_0x9d38('0x4b')]({'where':{'id':_0x515aff['params']['id']}})[_0x9d38('0x21')](handleEntityNotFound(_0x432104,null))['then'](function(_0x3657a1){if(_0x3657a1){_0x515aff[_0x9d38('0x49')][_0x9d38('0x4d')]=_0x3657a1['id'];_0x515aff['body'][_0x9d38('0x4e')]=integrations[_0x9d38('0x4f')](_0x515aff['body'][_0x9d38('0x50')],_0x515aff[_0x9d38('0x49')][_0x9d38('0x2b')]);_0x515aff[_0x9d38('0x49')][_0x9d38('0x51')]=integrations['getDescriptions'](_0x515aff[_0x9d38('0x49')][_0x9d38('0x50')],_0x515aff[_0x9d38('0x49')][_0x9d38('0x2b')]);return db['DeskConfiguration']['create'](_0x515aff['body'],{'include':[{'model':db[_0x9d38('0x52')],'as':_0x9d38('0x4e')},{'model':db[_0x9d38('0x52')],'as':_0x9d38('0x51')}]});}return null;})[_0x9d38('0x21')](respondWithResult(_0x432104,null))['catch'](handleError(_0x432104,null));};exports[_0x9d38('0x53')]=function(_0x4b50bd,_0x209534,_0x554f42){var _0x4196a5=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x13b106='';return db[_0x9d38('0x2a')][_0x9d38('0x4b')]({'where':{'id':_0x4b50bd[_0x9d38('0x42')]['id']},'attributes':['id','remoteUri',_0x9d38('0x54'),_0x9d38('0x55'),_0x9d38('0x56'),_0x9d38('0x57'),_0x9d38('0x58'),_0x9d38('0x59'),_0x9d38('0x5a')]})[_0x9d38('0x21')](handleEntityNotFound(_0x209534,null))[_0x9d38('0x21')](function(_0x4c83e5){if(_0x4c83e5){_0x13b106=_0x4c83e5[_0x9d38('0x5b')];var _0x1f610c=_0x13b106[_0x9d38('0x5c')](-0x1);if(_0x1f610c==='/'){_0x13b106=_0x13b106['substring'](0x0,_0x13b106['lastIndexOf'](_0x1f610c));}var _0x4ddfce={'method':_0x9d38('0x5d'),'uri':util[_0x9d38('0x5e')](_0x9d38('0x5f'),_0x13b106),'headers':{'Content-Type':_0x9d38('0x60'),'Accept':_0x9d38('0x60')},'json':!![]};if(_0x4c83e5[_0x9d38('0x54')]==='basic'){_0x4ddfce[_0x9d38('0x61')][_0x9d38('0x62')]=util['format']('Basic\x20%s',new Buffer(util[_0x9d38('0x5e')](_0x9d38('0x63'),_0x4c83e5[_0x9d38('0x55')],_0x4c83e5['password']))[_0x9d38('0x64')](_0x9d38('0x65')));}return rp(_0x4ddfce)[_0x9d38('0x21')](function(_0x2a72b7){return _0x4196a5[_0x9d38('0x66')](_['map'](_0x2a72b7['_embedded'][_0x9d38('0x67')],function(_0x5557bf){return{'id':_0x5557bf['name'],'name':_0x5557bf[_0x9d38('0x26')],'type':_0x5557bf[_0x9d38('0x2b')],'active':_0x5557bf[_0x9d38('0x68')],'label':_0x5557bf[_0x9d38('0x69')],'custom':!![]};}));});}})['then'](function(_0x2d729c){return{'count':_0x2d729c[_0x9d38('0x33')],'rows':_0x2d729c};})[_0x9d38('0x21')](respondWithResult(_0x209534,null))[_0x9d38('0x40')](function(_0x311246){var _0x52a68c=_0x4b50bd[_0x9d38('0x2e')][_0x9d38('0x6a')]?0x1f4:_0x311246[_0x9d38('0x6b')]||0x1f4;logger[_0x9d38('0x24')](_0x9d38('0x6c'),'getFields',_0x52a68c,JSON[_0x9d38('0x6d')](_0x311246));delete _0x311246[_0x9d38('0x26')];if(_0x52a68c===0x191){_0x52a68c=0x190;}_0x209534[_0x9d38('0x17')](_0x52a68c)[_0x9d38('0x27')](_0x4b50bd[_0x9d38('0x2e')][_0x9d38('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x311246[_0x9d38('0x6b')]}:_0x311246);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8655=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','define','DeskAccount','api','moment'];(function(_0x3f6c4b,_0x2f89b5){var _0x4da1ab=function(_0x44a7eb){while(--_0x44a7eb){_0x3f6c4b['push'](_0x3f6c4b['shift']());}};_0x4da1ab(++_0x2f89b5);}(_0x8655,0x17e));var _0x5865=function(_0x4c2a0f,_0x11fb52){_0x4c2a0f=_0x4c2a0f-0x0;var _0x2c8aac=_0x8655[_0x4c2a0f];return _0x2c8aac;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5865('0x0'));var moment=require(_0x5865('0x1'));var BPromise=require('bluebird');var rp=require(_0x5865('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5865('0x3'));var config=require(_0x5865('0x4'));var attributes=require(_0x5865('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xb2425c,_0x46e0cb){return _0xb2425c[_0x5865('0x6')](_0x5865('0x7'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3787=['../../config/logger','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util'];(function(_0x173214,_0x274d53){var _0x1deb3b=function(_0xba987d){while(--_0xba987d){_0x173214['push'](_0x173214['shift']());}};_0x1deb3b(++_0x274d53);}(_0x3787,0x1de));var _0x7378=function(_0x128c95,_0xbbd27a){_0x128c95=_0x128c95-0x0;var _0x2e3102=_0x3787[_0x128c95];return _0x2e3102;};'use strict';var _=require(_0x7378('0x0'));var util=require(_0x7378('0x1'));var logger=require(_0x7378('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7378('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7378('0x4'));var rimraf=require(_0x7378('0x5'));var config=require(_0x7378('0x6'));var attributes=require(_0x7378('0x7'));var integrations=require(_0x7378('0x8'));module[_0x7378('0x9')]=function(_0x311fb3,_0x47ab6c){return _0x311fb3[_0x7378('0xa')]('DeskAccount',attributes,{'tableName':_0x7378('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf36b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDeskAccount','options','where','attributes','limit','include','map','model','debug','catch','DeskAccount','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0xf36b,0x14f));var _0xbf36=function(_0x15145d,_0x58bde5){_0x15145d=_0x15145d-0x0;var _0x89ebb2=_0xf36b[_0x15145d];return _0x89ebb2;};'use strict';var _=require(_0xbf36('0x0'));var util=require('util');var moment=require(_0xbf36('0x1'));var BPromise=require(_0xbf36('0x2'));var rs=require(_0xbf36('0x3'));var fs=require('fs');var Redis=require(_0xbf36('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf36('0x5'));var logger=require(_0xbf36('0x6'))('rpc');var config=require(_0xbf36('0x7'));var jayson=require(_0xbf36('0x8'));var client=jayson[_0xbf36('0x9')][_0xbf36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3af23e,_0x19f968,_0x41245c){return new BPromise(function(_0x2eee68,_0x574bec){return client[_0xbf36('0xb')](_0x3af23e,_0x41245c)[_0xbf36('0xc')](function(_0x4a1ff5){logger[_0xbf36('0xd')](_0xbf36('0xe'),_0x19f968,'request\x20sent');logger['debug'](_0xbf36('0xf'),_0x19f968,_0xbf36('0x10'),JSON[_0xbf36('0x11')](_0x4a1ff5));if(_0x4a1ff5[_0xbf36('0x12')]){if(_0x4a1ff5[_0xbf36('0x12')][_0xbf36('0x13')]===0x1f4){logger['error'](_0xbf36('0xe'),_0x19f968,_0x4a1ff5[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x574bec(_0x4a1ff5['error']['message']);}logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x19f968,_0x4a1ff5[_0xbf36('0x12')][_0xbf36('0x14')]);return _0x2eee68(_0x4a1ff5[_0xbf36('0x12')]['message']);}else{logger[_0xbf36('0xd')]('DeskAccount,\x20%s,\x20%s',_0x19f968,_0xbf36('0x10'));_0x2eee68(_0x4a1ff5[_0xbf36('0x15')][_0xbf36('0x14')]);}})['catch'](function(_0x2d59af){logger[_0xbf36('0x12')](_0xbf36('0xe'),_0x19f968,_0x2d59af);_0x574bec(_0x2d59af);});});}exports[_0xbf36('0x16')]=function(_0x5f1a57){var _0x53e239=this;return new Promise(function(_0x166e41,_0x267234){return db['DeskAccount']['findAll']({'raw':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57[_0xbf36('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57[_0xbf36('0x17')][_0xbf36('0x18')]||null:null,'attributes':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57['options'][_0xbf36('0x19')]||null:null,'limit':_0x5f1a57['options']?_0x5f1a57['options'][_0xbf36('0x1a')]||null:null,'include':_0x5f1a57[_0xbf36('0x17')]?_0x5f1a57[_0xbf36('0x17')][_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x5f1a57['options'][_0xbf36('0x1b')],function(_0x5ca88a){return{'model':db[_0x5ca88a[_0xbf36('0x1d')]],'as':_0x5ca88a['as'],'attributes':_0x5ca88a['attributes'],'include':_0x5ca88a['include']?_['map'](_0x5ca88a[_0xbf36('0x1b')],function(_0x20f81d){return{'model':db[_0x20f81d[_0xbf36('0x1d')]],'as':_0x20f81d['as'],'attributes':_0x20f81d[_0xbf36('0x19')],'include':_0x20f81d[_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x20f81d[_0xbf36('0x1b')],function(_0x5ecdf2){return{'model':db[_0x5ecdf2[_0xbf36('0x1d')]],'as':_0x5ecdf2['as'],'attributes':_0x5ecdf2[_0xbf36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbf36('0xc')](function(_0x5e8d4a){logger['info'](_0xbf36('0x16'),_0x5f1a57);logger[_0xbf36('0x1e')](_0xbf36('0x16'),_0x5f1a57,JSON['stringify'](_0x5e8d4a));_0x166e41(_0x5e8d4a);})[_0xbf36('0x1f')](function(_0x12725c){logger['error'](_0xbf36('0x16'),_0x12725c['message'],_0x5f1a57);_0x267234(_0x53e239['error'](0x1f4,_0x12725c['message']));});});};exports['ShowDeskAccount']=function(_0x103e8f){var _0x4f5fec=this;return new Promise(function(_0x1bdaa7,_0x380c7a){return db[_0xbf36('0x20')]['find']({'raw':_0x103e8f[_0xbf36('0x17')]?_0x103e8f['options']['raw']===undefined?!![]:![]:!![],'where':_0x103e8f[_0xbf36('0x17')]?_0x103e8f[_0xbf36('0x17')][_0xbf36('0x18')]||null:null,'attributes':_0x103e8f[_0xbf36('0x17')]?_0x103e8f[_0xbf36('0x17')]['attributes']||null:null,'include':_0x103e8f[_0xbf36('0x17')]?_0x103e8f[_0xbf36('0x17')][_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x103e8f['options']['include'],function(_0x16b8b7){return{'model':db[_0x16b8b7['model']],'as':_0x16b8b7['as'],'attributes':_0x16b8b7['attributes'],'include':_0x16b8b7[_0xbf36('0x1b')]?_[_0xbf36('0x1c')](_0x16b8b7[_0xbf36('0x1b')],function(_0x4ef2c2){return{'model':db[_0x4ef2c2[_0xbf36('0x1d')]],'as':_0x4ef2c2['as'],'attributes':_0x4ef2c2[_0xbf36('0x19')],'include':_0x4ef2c2['include']?_[_0xbf36('0x1c')](_0x4ef2c2[_0xbf36('0x1b')],function(_0x5c030e){return{'model':db[_0x5c030e['model']],'as':_0x5c030e['as'],'attributes':_0x5c030e[_0xbf36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbf36('0xc')](function(_0x461da1){logger[_0xbf36('0xd')](_0xbf36('0x21'),_0x103e8f);logger[_0xbf36('0x1e')](_0xbf36('0x21'),_0x103e8f,JSON['stringify'](_0x461da1));_0x1bdaa7(_0x461da1);})[_0xbf36('0x1f')](function(_0x5b30bc){logger[_0xbf36('0x12')]('ShowDeskAccount',_0x5b30bc['message'],_0x103e8f);_0x380c7a(_0x4f5fec['error'](0x1f4,_0x5b30bc[_0xbf36('0x14')]));});});};
\ No newline at end of file
+var _0x8b2e=['find','lodash','util','bluebird','rpc','../../config/environment','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','raw','options','where','limit','include','map','attributes','model','GetDeskAccount','catch','ShowDeskAccount'];(function(_0x191975,_0x3c5c0e){var _0x4a50d8=function(_0x3bd761){while(--_0x3bd761){_0x191975['push'](_0x191975['shift']());}};_0x4a50d8(++_0x3c5c0e);}(_0x8b2e,0xc5));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8b2('0x0'));var util=require(_0xe8b2('0x1'));var moment=require('moment');var BPromise=require(_0xe8b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe8b2('0x3'));var config=require(_0xe8b2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe8b2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36885d,_0x572836,_0x3cbad3){return new BPromise(function(_0x2f6122,_0x1f83ac){return client[_0xe8b2('0x6')](_0x36885d,_0x3cbad3)[_0xe8b2('0x7')](function(_0x524b15){logger[_0xe8b2('0x8')](_0xe8b2('0x9'),_0x572836,_0xe8b2('0xa'));logger[_0xe8b2('0xb')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x572836,_0xe8b2('0xa'),JSON[_0xe8b2('0xc')](_0x524b15));if(_0x524b15[_0xe8b2('0xd')]){if(_0x524b15[_0xe8b2('0xd')][_0xe8b2('0xe')]===0x1f4){logger[_0xe8b2('0xd')](_0xe8b2('0x9'),_0x572836,_0x524b15[_0xe8b2('0xd')]['message']);return _0x1f83ac(_0x524b15['error'][_0xe8b2('0xf')]);}logger[_0xe8b2('0xd')](_0xe8b2('0x9'),_0x572836,_0x524b15[_0xe8b2('0xd')][_0xe8b2('0xf')]);return _0x2f6122(_0x524b15['error'][_0xe8b2('0xf')]);}else{logger[_0xe8b2('0x8')](_0xe8b2('0x9'),_0x572836,_0xe8b2('0xa'));_0x2f6122(_0x524b15['result'][_0xe8b2('0xf')]);}})['catch'](function(_0x54ed84){logger[_0xe8b2('0xd')](_0xe8b2('0x9'),_0x572836,_0x54ed84);_0x1f83ac(_0x54ed84);});});}exports['GetDeskAccount']=function(_0x3c1fcf){var _0x2e749b=this;return new Promise(function(_0x2290ba,_0x2a8e4f){return db['DeskAccount']['findAll']({'raw':_0x3c1fcf['options']?_0x3c1fcf['options'][_0xe8b2('0x10')]===undefined?!![]:![]:!![],'where':_0x3c1fcf[_0xe8b2('0x11')]?_0x3c1fcf[_0xe8b2('0x11')][_0xe8b2('0x12')]||null:null,'attributes':_0x3c1fcf[_0xe8b2('0x11')]?_0x3c1fcf['options']['attributes']||null:null,'limit':_0x3c1fcf[_0xe8b2('0x11')]?_0x3c1fcf[_0xe8b2('0x11')][_0xe8b2('0x13')]||null:null,'include':_0x3c1fcf['options']?_0x3c1fcf[_0xe8b2('0x11')][_0xe8b2('0x14')]?_[_0xe8b2('0x15')](_0x3c1fcf[_0xe8b2('0x11')][_0xe8b2('0x14')],function(_0x33af87){return{'model':db[_0x33af87['model']],'as':_0x33af87['as'],'attributes':_0x33af87[_0xe8b2('0x16')],'include':_0x33af87[_0xe8b2('0x14')]?_[_0xe8b2('0x15')](_0x33af87[_0xe8b2('0x14')],function(_0x568ec9){return{'model':db[_0x568ec9['model']],'as':_0x568ec9['as'],'attributes':_0x568ec9[_0xe8b2('0x16')],'include':_0x568ec9[_0xe8b2('0x14')]?_[_0xe8b2('0x15')](_0x568ec9['include'],function(_0x21d744){return{'model':db[_0x21d744[_0xe8b2('0x17')]],'as':_0x21d744['as'],'attributes':_0x21d744[_0xe8b2('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe8b2('0x7')](function(_0x481b83){logger[_0xe8b2('0x8')](_0xe8b2('0x18'),_0x3c1fcf);logger['debug'](_0xe8b2('0x18'),_0x3c1fcf,JSON['stringify'](_0x481b83));_0x2290ba(_0x481b83);})[_0xe8b2('0x19')](function(_0x1dffb6){logger[_0xe8b2('0xd')](_0xe8b2('0x18'),_0x1dffb6[_0xe8b2('0xf')],_0x3c1fcf);_0x2a8e4f(_0x2e749b[_0xe8b2('0xd')](0x1f4,_0x1dffb6[_0xe8b2('0xf')]));});});};exports[_0xe8b2('0x1a')]=function(_0x3049c9){var _0x13c9d4=this;return new Promise(function(_0x317f63,_0x1c5f4b){return db['DeskAccount'][_0xe8b2('0x1b')]({'raw':_0x3049c9[_0xe8b2('0x11')]?_0x3049c9[_0xe8b2('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x3049c9[_0xe8b2('0x11')]?_0x3049c9[_0xe8b2('0x11')][_0xe8b2('0x12')]||null:null,'attributes':_0x3049c9['options']?_0x3049c9[_0xe8b2('0x11')][_0xe8b2('0x16')]||null:null,'include':_0x3049c9[_0xe8b2('0x11')]?_0x3049c9[_0xe8b2('0x11')][_0xe8b2('0x14')]?_[_0xe8b2('0x15')](_0x3049c9[_0xe8b2('0x11')]['include'],function(_0xdf24eb){return{'model':db[_0xdf24eb[_0xe8b2('0x17')]],'as':_0xdf24eb['as'],'attributes':_0xdf24eb['attributes'],'include':_0xdf24eb[_0xe8b2('0x14')]?_['map'](_0xdf24eb['include'],function(_0x2293ce){return{'model':db[_0x2293ce['model']],'as':_0x2293ce['as'],'attributes':_0x2293ce[_0xe8b2('0x16')],'include':_0x2293ce[_0xe8b2('0x14')]?_[_0xe8b2('0x15')](_0x2293ce[_0xe8b2('0x14')],function(_0x286c88){return{'model':db[_0x286c88[_0xe8b2('0x17')]],'as':_0x286c88['as'],'attributes':_0x286c88['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x507c7f){logger['info'](_0xe8b2('0x1a'),_0x3049c9);logger[_0xe8b2('0xb')](_0xe8b2('0x1a'),_0x3049c9,JSON['stringify'](_0x507c7f));_0x317f63(_0x507c7f);})[_0xe8b2('0x19')](function(_0x5a6481){logger[_0xe8b2('0xd')](_0xe8b2('0x1a'),_0x5a6481[_0xe8b2('0xf')],_0x3049c9);_0x1c5f4b(_0x13c9d4[_0xe8b2('0xd')](0x1f4,_0x5a6481['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a978d,_0x2178bc){var _0x573415=function(_0x54c997){while(--_0x54c997){_0x4a978d['push'](_0x4a978d['shift']());}};_0x573415(++_0x2178bc);}(_0x34e8,0x12c));var _0x834e=function(_0x2acdf2,_0x3a4380){_0x2acdf2=_0x2acdf2-0x0;var _0x91715d=_0x34e8[_0x2acdf2];return _0x91715d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router;
\ No newline at end of file
+var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x584b9d,_0x1cb5c5){var _0x172053=function(_0x5036ec){while(--_0x5036ec){_0x584b9d['push'](_0x584b9d['shift']());}};_0x172053(++_0x1cb5c5);}(_0x55ca,0x126));var _0xa55c=function(_0x4b7d87,_0x238711){_0x4b7d87=_0x4b7d87-0x0;var _0x3b9f82=_0x55ca[_0x4b7d87];return _0x3b9f82;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b30=['exports','STRING','sequelize'];(function(_0xb9404d,_0xb9c541){var _0x5cfcf7=function(_0x1732d2){while(--_0x1732d2){_0xb9404d['push'](_0xb9404d['shift']());}};_0x5cfcf7(++_0xb9c541);}(_0x2b30,0xe0));var _0x02b3=function(_0x5e08b4,_0x4d0e31){_0x5e08b4=_0x5e08b4-0x0;var _0x2c8b90=_0x2b30[_0x5e08b4];return _0x2c8b90;};'use strict';var Sequelize=require(_0x02b3('0x0'));module[_0x02b3('0x1')]={'name':{'type':Sequelize[_0x02b3('0x2')]},'description':{'type':Sequelize[_0x02b3('0x2')]}};
\ No newline at end of file
+var _0xedf6=['STRING'];(function(_0x213285,_0xf6ecc5){var _0x3c4ca5=function(_0x4a82dd){while(--_0x4a82dd){_0x213285['push'](_0x213285['shift']());}};_0x3c4ca5(++_0xf6ecc5);}(_0xedf6,0x12f));var _0x6edf=function(_0x236906,_0x1c2803){_0x236906=_0x236906-0x0;var _0x21199e=_0xedf6[_0x236906];return _0x21199e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6edf('0x0')]},'description':{'type':Sequelize[_0x6edf('0x0')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1fca=['update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','options','DeskConfiguration','include','findAll','rows','catch','params','find','create','body','destroy','findOne','DeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','status','json','offset','undefined','count','Content-Range','apply','reject','save'];(function(_0x7d248c,_0x7bffaf){var _0x536715=function(_0x35ced2){while(--_0x35ced2){_0x7d248c['push'](_0x7d248c['shift']());}};_0x536715(++_0x7bffaf);}(_0x1fca,0x130));var _0xa1fc=function(_0x1960b5,_0x1835a4){_0x1960b5=_0x1960b5-0x0;var _0x18f387=_0x1fca[_0x1960b5];return _0x18f387;};'use strict';var emlformat=require(_0xa1fc('0x0'));var rimraf=require(_0xa1fc('0x1'));var zipdir=require(_0xa1fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1fc('0x3'));var moment=require(_0xa1fc('0x4'));var BPromise=require(_0xa1fc('0x5'));var Mustache=require(_0xa1fc('0x6'));var util=require(_0xa1fc('0x7'));var path=require(_0xa1fc('0x8'));var sox=require(_0xa1fc('0x9'));var csv=require(_0xa1fc('0xa'));var ejs=require(_0xa1fc('0xb'));var fs=require('fs');var fs_extra=require(_0xa1fc('0xc'));var _=require(_0xa1fc('0xd'));var squel=require(_0xa1fc('0xe'));var crypto=require(_0xa1fc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa1fc('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1fc('0x11'));var Papa=require(_0xa1fc('0x12'));var Redis=require('ioredis');var authService=require(_0xa1fc('0x13'));var qs=require(_0xa1fc('0x14'));var as=require(_0xa1fc('0x15'));var hardwareService=require(_0xa1fc('0x16'));var logger=require(_0xa1fc('0x17'))(_0xa1fc('0x18'));var utils=require(_0xa1fc('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa1fc('0x1a'))['db'];function respondWithStatusCode(_0x25143a,_0x346750){_0x346750=_0x346750||0xcc;return function(_0x577cef){if(_0x577cef){return _0x25143a['sendStatus'](_0x346750);}return _0x25143a[_0xa1fc('0x1b')](_0x346750)['end']();};}function respondWithResult(_0x53af5a,_0xa21cf0){_0xa21cf0=_0xa21cf0||0xc8;return function(_0x129d55){if(_0x129d55){return _0x53af5a[_0xa1fc('0x1b')](_0xa21cf0)[_0xa1fc('0x1c')](_0x129d55);}};}function respondWithFilteredResult(_0x447ccc,_0x412ad9){return function(_0x1c1c82){if(_0x1c1c82){var _0x47973a=typeof _0x412ad9[_0xa1fc('0x1d')]==='undefined'&&typeof _0x412ad9['limit']===_0xa1fc('0x1e');var _0x418e0b=_0x1c1c82[_0xa1fc('0x1f')];var _0x44f2d6=_0x47973a?0x0:_0x412ad9['offset'];var _0x2365d3=_0x47973a?_0x1c1c82[_0xa1fc('0x1f')]:_0x412ad9[_0xa1fc('0x1d')]+_0x412ad9['limit'];var _0xb11cd1;if(_0x2365d3>=_0x418e0b){_0x2365d3=_0x418e0b;_0xb11cd1=0xc8;}else{_0xb11cd1=0xce;}_0x447ccc[_0xa1fc('0x1b')](_0xb11cd1);return _0x447ccc['set'](_0xa1fc('0x20'),_0x44f2d6+'-'+_0x2365d3+'/'+_0x418e0b)['json'](_0x1c1c82);}return null;};}function patchUpdates(_0x42f912){return function(_0x5cacb0){try{jsonpatch[_0xa1fc('0x21')](_0x5cacb0,_0x42f912,!![]);}catch(_0x40d46c){return BPromise[_0xa1fc('0x22')](_0x40d46c);}return _0x5cacb0[_0xa1fc('0x23')]();};}function saveUpdates(_0x592340,_0x3d41bf){return function(_0x562a7){if(_0x562a7){return _0x562a7[_0xa1fc('0x24')](_0x592340)[_0xa1fc('0x25')](function(_0x5c9d99){return _0x5c9d99;});}return null;};}function removeEntity(_0x180fa4,_0x7980bb){return function(_0x5eb5b3){if(_0x5eb5b3){return _0x5eb5b3['destroy']()[_0xa1fc('0x25')](function(){_0x180fa4['status'](0xcc)[_0xa1fc('0x26')]();});}};}function handleEntityNotFound(_0x5549fd,_0x2790e9){return function(_0x4b8c85){if(!_0x4b8c85){_0x5549fd[_0xa1fc('0x27')](0x194);}return _0x4b8c85;};}function handleError(_0x326484,_0x58476b){_0x58476b=_0x58476b||0x1f4;return function(_0x524844){logger['error'](_0x524844[_0xa1fc('0x28')]);if(_0x524844['name']){delete _0x524844[_0xa1fc('0x29')];}_0x326484[_0xa1fc('0x1b')](_0x58476b)[_0xa1fc('0x2a')](_0x524844);};}exports[_0xa1fc('0x2b')]=function(_0x3e6f6a,_0x201d9b){var _0x563f24={},_0x41799f={},_0x598705={'count':0x0,'rows':[]};var _0x57092d=_['map'](db['DeskConfiguration'][_0xa1fc('0x2c')],function(_0x1cfa63){return{'name':_0x1cfa63[_0xa1fc('0x2d')],'type':_0x1cfa63[_0xa1fc('0x2e')][_0xa1fc('0x2f')]};});_0x41799f[_0xa1fc('0x30')]=_[_0xa1fc('0x31')](_0x57092d,'name');_0x41799f[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0x3e6f6a[_0xa1fc('0x32')]);_0x41799f['filters']=_['intersection'](_0x41799f[_0xa1fc('0x30')],_0x41799f['query']);_0x563f24[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x41799f[_0xa1fc('0x30')],qs['fields'](_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x563f24[_0xa1fc('0x34')]=_0x563f24[_0xa1fc('0x34')][_0xa1fc('0x37')]?_0x563f24[_0xa1fc('0x34')]:_0x41799f['model'];if(!_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x38')]('nolimit')){_0x563f24['limit']=qs['limit'](_0x3e6f6a['query'][_0xa1fc('0x39')]);_0x563f24['offset']=qs[_0xa1fc('0x1d')](_0x3e6f6a['query'][_0xa1fc('0x1d')]);}_0x563f24[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x3b')]);_0x563f24[_0xa1fc('0x3c')]=qs['filters'](_[_0xa1fc('0x3d')](_0x3e6f6a[_0xa1fc('0x32')],_0x41799f[_0xa1fc('0x3e')]),_0x57092d);if(_0x3e6f6a[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x563f24[_0xa1fc('0x3c')]=_[_0xa1fc('0x40')](_0x563f24[_0xa1fc('0x3c')],{'$or':_[_0xa1fc('0x31')](_0x57092d,function(_0x4340a3){if(_0x4340a3['type']!=='VIRTUAL'){var _0x4f8956={};_0x4f8956[_0x4340a3[_0xa1fc('0x29')]]={'$like':'%'+_0x3e6f6a['query']['filter']+'%'};return _0x4f8956;}})});}_0x563f24=_[_0xa1fc('0x40')]({},_0x563f24,_0x3e6f6a[_0xa1fc('0x41')]);var _0x1463e1={'where':_0x563f24[_0xa1fc('0x3c')]};return db[_0xa1fc('0x42')][_0xa1fc('0x1f')](_0x1463e1)[_0xa1fc('0x25')](function(_0x4d3442){_0x598705[_0xa1fc('0x1f')]=_0x4d3442;if(_0x3e6f6a[_0xa1fc('0x32')]['includeAll']){_0x563f24[_0xa1fc('0x43')]=[{'all':!![]}];}return db[_0xa1fc('0x42')][_0xa1fc('0x44')](_0x563f24);})[_0xa1fc('0x25')](function(_0x48c88a){_0x598705[_0xa1fc('0x45')]=_0x48c88a;return _0x598705;})[_0xa1fc('0x25')](respondWithFilteredResult(_0x201d9b,_0x563f24))[_0xa1fc('0x46')](handleError(_0x201d9b,null));};exports['show']=function(_0x562aa4,_0x20a37d){var _0x1f44c2={'raw':![],'where':{'id':_0x562aa4[_0xa1fc('0x47')]['id']}},_0x2c1f6d={};_0x2c1f6d[_0xa1fc('0x30')]=_['keys'](db[_0xa1fc('0x42')][_0xa1fc('0x2c')]);_0x2c1f6d[_0xa1fc('0x32')]=_['keys'](_0x562aa4['query']);_0x2c1f6d[_0xa1fc('0x3e')]=_['intersection'](_0x2c1f6d['model'],_0x2c1f6d['query']);_0x1f44c2[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x2c1f6d[_0xa1fc('0x30')],qs[_0xa1fc('0x36')](_0x562aa4['query'][_0xa1fc('0x36')]));_0x1f44c2['attributes']=_0x1f44c2[_0xa1fc('0x34')]['length']?_0x1f44c2[_0xa1fc('0x34')]:_0x2c1f6d[_0xa1fc('0x30')];if(_0x562aa4[_0xa1fc('0x32')]['includeAll']){_0x1f44c2['include']=[{'all':!![]}];}_0x1f44c2=_[_0xa1fc('0x40')]({},_0x1f44c2,_0x562aa4[_0xa1fc('0x41')]);return db[_0xa1fc('0x42')][_0xa1fc('0x48')](_0x1f44c2)[_0xa1fc('0x25')](handleEntityNotFound(_0x20a37d,null))[_0xa1fc('0x25')](respondWithResult(_0x20a37d,null))[_0xa1fc('0x46')](handleError(_0x20a37d,null));};exports['create']=function(_0x1f4828,_0x324b16){return db['DeskConfiguration'][_0xa1fc('0x49')](_0x1f4828[_0xa1fc('0x4a')],{})[_0xa1fc('0x25')](respondWithResult(_0x324b16,0xc9))[_0xa1fc('0x46')](handleError(_0x324b16,null));};exports[_0xa1fc('0x24')]=function(_0x56bb2a,_0x4867c7){if(_0x56bb2a['body']['id']){delete _0x56bb2a['body']['id'];}return db[_0xa1fc('0x42')]['find']({'where':{'id':_0x56bb2a[_0xa1fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x4867c7,null))['then'](saveUpdates(_0x56bb2a[_0xa1fc('0x4a')],null))[_0xa1fc('0x25')](respondWithResult(_0x4867c7,null))[_0xa1fc('0x46')](handleError(_0x4867c7,null));};exports[_0xa1fc('0x4b')]=function(_0x53ff10,_0x1f5a2b){return db[_0xa1fc('0x42')][_0xa1fc('0x48')]({'where':{'id':_0x53ff10[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x1f5a2b,null))[_0xa1fc('0x25')](removeEntity(_0x1f5a2b,null))['catch'](handleError(_0x1f5a2b,null));};exports['getFields']=function(_0xb7c194,_0x21016c,_0x215080){var _0x3e7ad2={};var _0x1f70af={};var _0xbc518e;var _0x2cece9;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0xb7c194[_0xa1fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x21016c,null))[_0xa1fc('0x25')](function(_0x1bd50e){if(_0x1bd50e){_0xbc518e=_0x1bd50e;_0x1f70af[_0xa1fc('0x30')]=_[_0xa1fc('0x33')](db[_0xa1fc('0x4d')][_0xa1fc('0x2c')]);_0x1f70af[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0xb7c194[_0xa1fc('0x32')]);_0x1f70af[_0xa1fc('0x3e')]=_[_0xa1fc('0x35')](_0x1f70af['model'],_0x1f70af['query']);_0x3e7ad2[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x1f70af[_0xa1fc('0x30')],qs[_0xa1fc('0x36')](_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x3e7ad2[_0xa1fc('0x34')]=_0x3e7ad2['attributes'][_0xa1fc('0x37')]?_0x3e7ad2['attributes']:_0x1f70af[_0xa1fc('0x30')];_0x3e7ad2[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0xb7c194['query']['sort']);_0x3e7ad2['where']=qs[_0xa1fc('0x3e')](_['pick'](_0xb7c194[_0xa1fc('0x32')],_0x1f70af[_0xa1fc('0x3e')]));if(_0xb7c194['query']['filter']){_0x3e7ad2[_0xa1fc('0x3c')]=_['merge'](_0x3e7ad2[_0xa1fc('0x3c')],{'$or':_['map'](_0x3e7ad2[_0xa1fc('0x34')],function(_0x2a6003){var _0x16ce33={};_0x16ce33[_0x2a6003]={'$like':'%'+_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x3f')]+'%'};return _0x16ce33;})});}_0x3e7ad2=_['merge']({},_0x3e7ad2,_0xb7c194[_0xa1fc('0x41')]);return _0xbc518e[_0xa1fc('0x4e')](_0x3e7ad2);}})['then'](function(_0x12980f){if(_0x12980f){_0x2cece9=_0x12980f[_0xa1fc('0x37')];if(!_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x3e7ad2[_0xa1fc('0x39')]=qs[_0xa1fc('0x39')](_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x3e7ad2[_0xa1fc('0x1d')]=qs[_0xa1fc('0x1d')](_0xb7c194[_0xa1fc('0x32')][_0xa1fc('0x1d')]);}return _0xbc518e[_0xa1fc('0x4e')](_0x3e7ad2);}})[_0xa1fc('0x25')](function(_0x53172b){if(_0x53172b){return _0x53172b?{'count':_0x2cece9,'rows':_0x53172b}:null;}})[_0xa1fc('0x25')](respondWithResult(_0x21016c,null))[_0xa1fc('0x46')](handleError(_0x21016c,null));};exports[_0xa1fc('0x50')]=function(_0x4daedd,_0x5146ed,_0x3929c8){var _0x3237af={};var _0x580be3={};var _0x1d0f5f;var _0x5aa289;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0x4daedd['params']['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x5146ed,null))[_0xa1fc('0x25')](function(_0x512633){if(_0x512633){_0x1d0f5f=_0x512633;_0x580be3[_0xa1fc('0x30')]=_[_0xa1fc('0x33')](db[_0xa1fc('0x4d')][_0xa1fc('0x2c')]);_0x580be3[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0x4daedd[_0xa1fc('0x32')]);_0x580be3['filters']=_[_0xa1fc('0x35')](_0x580be3['model'],_0x580be3['query']);_0x3237af[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x580be3[_0xa1fc('0x30')],qs['fields'](_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x3237af[_0xa1fc('0x34')]=_0x3237af['attributes']['length']?_0x3237af[_0xa1fc('0x34')]:_0x580be3[_0xa1fc('0x30')];_0x3237af[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0x4daedd[_0xa1fc('0x32')]['sort']);_0x3237af[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3e')](_[_0xa1fc('0x3d')](_0x4daedd[_0xa1fc('0x32')],_0x580be3[_0xa1fc('0x3e')]));if(_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x3237af[_0xa1fc('0x3c')]=_[_0xa1fc('0x40')](_0x3237af[_0xa1fc('0x3c')],{'$or':_[_0xa1fc('0x31')](_0x3237af[_0xa1fc('0x34')],function(_0x723c06){var _0x26b6f8={};_0x26b6f8[_0x723c06]={'$like':'%'+_0x4daedd[_0xa1fc('0x32')]['filter']+'%'};return _0x26b6f8;})});}_0x3237af=_[_0xa1fc('0x40')]({},_0x3237af,_0x4daedd[_0xa1fc('0x41')]);return _0x1d0f5f[_0xa1fc('0x50')](_0x3237af);}})[_0xa1fc('0x25')](function(_0x4f4295){if(_0x4f4295){_0x5aa289=_0x4f4295[_0xa1fc('0x37')];if(!_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x3237af[_0xa1fc('0x39')]=qs['limit'](_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x3237af[_0xa1fc('0x1d')]=qs[_0xa1fc('0x1d')](_0x4daedd[_0xa1fc('0x32')][_0xa1fc('0x1d')]);}return _0x1d0f5f['getSubjects'](_0x3237af);}})[_0xa1fc('0x25')](function(_0x43cbd9){if(_0x43cbd9){return _0x43cbd9?{'count':_0x5aa289,'rows':_0x43cbd9}:null;}})['then'](respondWithResult(_0x5146ed,null))[_0xa1fc('0x46')](handleError(_0x5146ed,null));};exports[_0xa1fc('0x51')]=function(_0x3ccf9a,_0x40770c,_0x912c68){var _0x2dcea7={};var _0x3b7cd2={};var _0xf054b5;var _0x476e91;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0x3ccf9a[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x40770c,null))[_0xa1fc('0x25')](function(_0x4ba82b){if(_0x4ba82b){_0xf054b5=_0x4ba82b;_0x3b7cd2[_0xa1fc('0x30')]=_['keys'](db[_0xa1fc('0x4d')][_0xa1fc('0x2c')]);_0x3b7cd2[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0x3ccf9a[_0xa1fc('0x32')]);_0x3b7cd2[_0xa1fc('0x3e')]=_[_0xa1fc('0x35')](_0x3b7cd2[_0xa1fc('0x30')],_0x3b7cd2[_0xa1fc('0x32')]);_0x2dcea7[_0xa1fc('0x34')]=_[_0xa1fc('0x35')](_0x3b7cd2[_0xa1fc('0x30')],qs[_0xa1fc('0x36')](_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x36')]));_0x2dcea7[_0xa1fc('0x34')]=_0x2dcea7[_0xa1fc('0x34')][_0xa1fc('0x37')]?_0x2dcea7[_0xa1fc('0x34')]:_0x3b7cd2['model'];_0x2dcea7[_0xa1fc('0x3a')]=qs['sort'](_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x3b')]);_0x2dcea7[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3e')](_[_0xa1fc('0x3d')](_0x3ccf9a[_0xa1fc('0x32')],_0x3b7cd2['filters']));if(_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x2dcea7[_0xa1fc('0x3c')]=_[_0xa1fc('0x40')](_0x2dcea7['where'],{'$or':_['map'](_0x2dcea7[_0xa1fc('0x34')],function(_0x2bfb14){var _0x1775a4={};_0x1775a4[_0x2bfb14]={'$like':'%'+_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x3f')]+'%'};return _0x1775a4;})});}_0x2dcea7=_[_0xa1fc('0x40')]({},_0x2dcea7,_0x3ccf9a[_0xa1fc('0x41')]);return _0xf054b5[_0xa1fc('0x51')](_0x2dcea7);}})[_0xa1fc('0x25')](function(_0x5ccac1){if(_0x5ccac1){_0x476e91=_0x5ccac1[_0xa1fc('0x37')];if(!_0x3ccf9a['query'][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x2dcea7[_0xa1fc('0x39')]=qs[_0xa1fc('0x39')](_0x3ccf9a[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x2dcea7[_0xa1fc('0x1d')]=qs['offset'](_0x3ccf9a['query'][_0xa1fc('0x1d')]);}return _0xf054b5[_0xa1fc('0x51')](_0x2dcea7);}})[_0xa1fc('0x25')](function(_0x4698d7){if(_0x4698d7){return _0x4698d7?{'count':_0x476e91,'rows':_0x4698d7}:null;}})['then'](respondWithResult(_0x40770c,null))[_0xa1fc('0x46')](handleError(_0x40770c,null));};exports[_0xa1fc('0x52')]=function(_0xfe51dc,_0x306f00,_0x1998c5){var _0x444ae3={};var _0x4d7426={};var _0x1c2875;var _0x24ca7b;return db[_0xa1fc('0x42')][_0xa1fc('0x4c')]({'where':{'id':_0xfe51dc[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x306f00,null))[_0xa1fc('0x25')](function(_0x3c63e0){if(_0x3c63e0){_0x1c2875=_0x3c63e0;_0x4d7426['model']=_[_0xa1fc('0x33')](db[_0xa1fc('0x53')][_0xa1fc('0x2c')]);_0x4d7426[_0xa1fc('0x32')]=_[_0xa1fc('0x33')](_0xfe51dc[_0xa1fc('0x32')]);_0x4d7426[_0xa1fc('0x3e')]=_['intersection'](_0x4d7426[_0xa1fc('0x30')],_0x4d7426[_0xa1fc('0x32')]);_0x444ae3[_0xa1fc('0x34')]=_['intersection'](_0x4d7426[_0xa1fc('0x30')],qs['fields'](_0xfe51dc['query'][_0xa1fc('0x36')]));_0x444ae3[_0xa1fc('0x34')]=_0x444ae3[_0xa1fc('0x34')][_0xa1fc('0x37')]?_0x444ae3[_0xa1fc('0x34')]:_0x4d7426[_0xa1fc('0x30')];_0x444ae3[_0xa1fc('0x3a')]=qs[_0xa1fc('0x3b')](_0xfe51dc[_0xa1fc('0x32')]['sort']);_0x444ae3['where']=qs[_0xa1fc('0x3e')](_[_0xa1fc('0x3d')](_0xfe51dc[_0xa1fc('0x32')],_0x4d7426[_0xa1fc('0x3e')]));if(_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x3f')]){_0x444ae3['where']=_['merge'](_0x444ae3[_0xa1fc('0x3c')],{'$or':_[_0xa1fc('0x31')](_0x444ae3[_0xa1fc('0x34')],function(_0x43d2dd){var _0x6efff1={};_0x6efff1[_0x43d2dd]={'$like':'%'+_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x3f')]+'%'};return _0x6efff1;})});}_0x444ae3=_[_0xa1fc('0x40')]({},_0x444ae3,_0xfe51dc[_0xa1fc('0x41')]);return _0x1c2875[_0xa1fc('0x52')](_0x444ae3);}})[_0xa1fc('0x25')](function(_0x4a8d10){if(_0x4a8d10){_0x24ca7b=_0x4a8d10[_0xa1fc('0x37')];if(!_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x38')](_0xa1fc('0x4f'))){_0x444ae3[_0xa1fc('0x39')]=qs['limit'](_0xfe51dc[_0xa1fc('0x32')][_0xa1fc('0x39')]);_0x444ae3['offset']=qs['offset'](_0xfe51dc[_0xa1fc('0x32')]['offset']);}return _0x1c2875[_0xa1fc('0x52')](_0x444ae3);}})[_0xa1fc('0x25')](function(_0x106b82){if(_0x106b82){return _0x106b82?{'count':_0x24ca7b,'rows':_0x106b82}:null;}})[_0xa1fc('0x25')](respondWithResult(_0x306f00,null))[_0xa1fc('0x46')](handleError(_0x306f00,null));};exports['setTags']=function(_0x3d48e7,_0x512405,_0x270889){if(_0x3d48e7['body']['id']){delete _0x3d48e7[_0xa1fc('0x4a')]['id'];}return db['DeskConfiguration'][_0xa1fc('0x4c')]({'where':{'id':_0x3d48e7['params']['id']}})[_0xa1fc('0x25')](handleEntityNotFound(_0x512405,null))[_0xa1fc('0x25')](function(_0x1c9a06){if(_0x1c9a06){return _0x1c9a06['setTags'](_0x3d48e7[_0xa1fc('0x4a')][_0xa1fc('0x54')]||[]);}return null;})[_0xa1fc('0x25')](respondWithResult(_0x512405,null))[_0xa1fc('0x46')](handleError(_0x512405,null));};
\ No newline at end of file
+var _0x52ef=['sendStatus','status','json','offset','limit','undefined','count','Content-Range','save','update','end','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','DeskConfiguration','findAll','then','rows','catch','show','fields','length','merge','options','create','body','find','params','destroy','getFields','findOne','DeskField','getSubjects','pick','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x50eb4a,_0x4cc832){var _0x1acc16=function(_0x6c9f0d){while(--_0x6c9f0d){_0x50eb4a['push'](_0x50eb4a['shift']());}};_0x1acc16(++_0x4cc832);}(_0x52ef,0x1d9));var _0xf52e=function(_0x30c23c,_0x643d71){_0x30c23c=_0x30c23c-0x0;var _0x16c2dd=_0x52ef[_0x30c23c];return _0x16c2dd;};'use strict';var emlformat=require(_0xf52e('0x0'));var rimraf=require(_0xf52e('0x1'));var zipdir=require(_0xf52e('0x2'));var jsonpatch=require(_0xf52e('0x3'));var rp=require(_0xf52e('0x4'));var moment=require(_0xf52e('0x5'));var BPromise=require(_0xf52e('0x6'));var Mustache=require(_0xf52e('0x7'));var util=require(_0xf52e('0x8'));var path=require(_0xf52e('0x9'));var sox=require('sox');var csv=require(_0xf52e('0xa'));var ejs=require(_0xf52e('0xb'));var fs=require('fs');var fs_extra=require(_0xf52e('0xc'));var _=require(_0xf52e('0xd'));var squel=require(_0xf52e('0xe'));var crypto=require(_0xf52e('0xf'));var jsforce=require(_0xf52e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf52e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf52e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf52e('0x12'));var hardwareService=require(_0xf52e('0x13'));var logger=require('../../config/logger')(_0xf52e('0x14'));var utils=require(_0xf52e('0x15'));var config=require(_0xf52e('0x16'));var licenseUtil=require(_0xf52e('0x17'));var db=require(_0xf52e('0x18'))['db'];function respondWithStatusCode(_0x540456,_0x252e26){_0x252e26=_0x252e26||0xcc;return function(_0x3d54cd){if(_0x3d54cd){return _0x540456[_0xf52e('0x19')](_0x252e26);}return _0x540456[_0xf52e('0x1a')](_0x252e26)['end']();};}function respondWithResult(_0x4a33f0,_0x3d44a3){_0x3d44a3=_0x3d44a3||0xc8;return function(_0x2641d8){if(_0x2641d8){return _0x4a33f0[_0xf52e('0x1a')](_0x3d44a3)[_0xf52e('0x1b')](_0x2641d8);}};}function respondWithFilteredResult(_0x581062,_0x4479e1){return function(_0x13b6ed){if(_0x13b6ed){var _0x56f937=typeof _0x4479e1[_0xf52e('0x1c')]==='undefined'&&typeof _0x4479e1[_0xf52e('0x1d')]===_0xf52e('0x1e');var _0x6ef067=_0x13b6ed[_0xf52e('0x1f')];var _0x12e5d3=_0x56f937?0x0:_0x4479e1['offset'];var _0x528bd2=_0x56f937?_0x13b6ed[_0xf52e('0x1f')]:_0x4479e1[_0xf52e('0x1c')]+_0x4479e1['limit'];var _0x16b3a8;if(_0x528bd2>=_0x6ef067){_0x528bd2=_0x6ef067;_0x16b3a8=0xc8;}else{_0x16b3a8=0xce;}_0x581062[_0xf52e('0x1a')](_0x16b3a8);return _0x581062['set'](_0xf52e('0x20'),_0x12e5d3+'-'+_0x528bd2+'/'+_0x6ef067)['json'](_0x13b6ed);}return null;};}function patchUpdates(_0x272e01){return function(_0xc34358){try{jsonpatch['apply'](_0xc34358,_0x272e01,!![]);}catch(_0x218359){return BPromise['reject'](_0x218359);}return _0xc34358[_0xf52e('0x21')]();};}function saveUpdates(_0x2db53a,_0x26face){return function(_0x51317e){if(_0x51317e){return _0x51317e[_0xf52e('0x22')](_0x2db53a)['then'](function(_0x2f6153){return _0x2f6153;});}return null;};}function removeEntity(_0x134064,_0x598741){return function(_0x19aec8){if(_0x19aec8){return _0x19aec8['destroy']()['then'](function(){_0x134064[_0xf52e('0x1a')](0xcc)[_0xf52e('0x23')]();});}};}function handleEntityNotFound(_0x52d202,_0x53314d){return function(_0x57b023){if(!_0x57b023){_0x52d202['sendStatus'](0x194);}return _0x57b023;};}function handleError(_0x81bf0c,_0x4c5deb){_0x4c5deb=_0x4c5deb||0x1f4;return function(_0x15dea7){logger['error'](_0x15dea7['stack']);if(_0x15dea7[_0xf52e('0x24')]){delete _0x15dea7['name'];}_0x81bf0c[_0xf52e('0x1a')](_0x4c5deb)[_0xf52e('0x25')](_0x15dea7);};}exports[_0xf52e('0x26')]=function(_0x316b20,_0x298ab3){var _0x101dd7={},_0x4d4f7f={},_0x1dc417={'count':0x0,'rows':[]};var _0x42417f=_[_0xf52e('0x27')](db['DeskConfiguration'][_0xf52e('0x28')],function(_0x26b59f){return{'name':_0x26b59f[_0xf52e('0x29')],'type':_0x26b59f['type'][_0xf52e('0x2a')]};});_0x4d4f7f[_0xf52e('0x2b')]=_['map'](_0x42417f,_0xf52e('0x24'));_0x4d4f7f[_0xf52e('0x2c')]=_[_0xf52e('0x2d')](_0x316b20[_0xf52e('0x2c')]);_0x4d4f7f[_0xf52e('0x2e')]=_[_0xf52e('0x2f')](_0x4d4f7f[_0xf52e('0x2b')],_0x4d4f7f[_0xf52e('0x2c')]);_0x101dd7['attributes']=_['intersection'](_0x4d4f7f['model'],qs['fields'](_0x316b20[_0xf52e('0x2c')]['fields']));_0x101dd7[_0xf52e('0x30')]=_0x101dd7[_0xf52e('0x30')]['length']?_0x101dd7[_0xf52e('0x30')]:_0x4d4f7f[_0xf52e('0x2b')];if(!_0x316b20[_0xf52e('0x2c')][_0xf52e('0x31')](_0xf52e('0x32'))){_0x101dd7['limit']=qs[_0xf52e('0x1d')](_0x316b20[_0xf52e('0x2c')][_0xf52e('0x1d')]);_0x101dd7[_0xf52e('0x1c')]=qs[_0xf52e('0x1c')](_0x316b20['query']['offset']);}_0x101dd7[_0xf52e('0x33')]=qs[_0xf52e('0x34')](_0x316b20[_0xf52e('0x2c')]['sort']);_0x101dd7[_0xf52e('0x35')]=qs[_0xf52e('0x2e')](_['pick'](_0x316b20[_0xf52e('0x2c')],_0x4d4f7f[_0xf52e('0x2e')]),_0x42417f);if(_0x316b20[_0xf52e('0x2c')][_0xf52e('0x36')]){_0x101dd7[_0xf52e('0x35')]=_['merge'](_0x101dd7[_0xf52e('0x35')],{'$or':_[_0xf52e('0x27')](_0x42417f,function(_0x4bb395){if(_0x4bb395[_0xf52e('0x37')]!==_0xf52e('0x38')){var _0x388332={};_0x388332[_0x4bb395[_0xf52e('0x24')]]={'$like':'%'+_0x316b20['query'][_0xf52e('0x36')]+'%'};return _0x388332;}})});}_0x101dd7=_['merge']({},_0x101dd7,_0x316b20['options']);var _0xb267b5={'where':_0x101dd7['where']};return db['DeskConfiguration']['count'](_0xb267b5)['then'](function(_0x5962cb){_0x1dc417[_0xf52e('0x1f')]=_0x5962cb;if(_0x316b20['query'][_0xf52e('0x39')]){_0x101dd7[_0xf52e('0x3a')]=[{'all':!![]}];}return db[_0xf52e('0x3b')][_0xf52e('0x3c')](_0x101dd7);})[_0xf52e('0x3d')](function(_0x245c8a){_0x1dc417[_0xf52e('0x3e')]=_0x245c8a;return _0x1dc417;})[_0xf52e('0x3d')](respondWithFilteredResult(_0x298ab3,_0x101dd7))[_0xf52e('0x3f')](handleError(_0x298ab3,null));};exports[_0xf52e('0x40')]=function(_0x17064d,_0x58489a){var _0x5b7b8c={'raw':![],'where':{'id':_0x17064d['params']['id']}},_0x58e7d7={};_0x58e7d7[_0xf52e('0x2b')]=_[_0xf52e('0x2d')](db[_0xf52e('0x3b')][_0xf52e('0x28')]);_0x58e7d7[_0xf52e('0x2c')]=_[_0xf52e('0x2d')](_0x17064d['query']);_0x58e7d7[_0xf52e('0x2e')]=_[_0xf52e('0x2f')](_0x58e7d7['model'],_0x58e7d7[_0xf52e('0x2c')]);_0x5b7b8c[_0xf52e('0x30')]=_['intersection'](_0x58e7d7[_0xf52e('0x2b')],qs[_0xf52e('0x41')](_0x17064d['query']['fields']));_0x5b7b8c[_0xf52e('0x30')]=_0x5b7b8c[_0xf52e('0x30')][_0xf52e('0x42')]?_0x5b7b8c[_0xf52e('0x30')]:_0x58e7d7['model'];if(_0x17064d[_0xf52e('0x2c')][_0xf52e('0x39')]){_0x5b7b8c[_0xf52e('0x3a')]=[{'all':!![]}];}_0x5b7b8c=_[_0xf52e('0x43')]({},_0x5b7b8c,_0x17064d[_0xf52e('0x44')]);return db['DeskConfiguration']['find'](_0x5b7b8c)['then'](handleEntityNotFound(_0x58489a,null))[_0xf52e('0x3d')](respondWithResult(_0x58489a,null))[_0xf52e('0x3f')](handleError(_0x58489a,null));};exports['create']=function(_0x5f6cfa,_0x22fd80){return db[_0xf52e('0x3b')][_0xf52e('0x45')](_0x5f6cfa[_0xf52e('0x46')],{})[_0xf52e('0x3d')](respondWithResult(_0x22fd80,0xc9))[_0xf52e('0x3f')](handleError(_0x22fd80,null));};exports[_0xf52e('0x22')]=function(_0xe8af8a,_0x499b33){if(_0xe8af8a['body']['id']){delete _0xe8af8a[_0xf52e('0x46')]['id'];}return db[_0xf52e('0x3b')][_0xf52e('0x47')]({'where':{'id':_0xe8af8a[_0xf52e('0x48')]['id']}})[_0xf52e('0x3d')](handleEntityNotFound(_0x499b33,null))[_0xf52e('0x3d')](saveUpdates(_0xe8af8a[_0xf52e('0x46')],null))[_0xf52e('0x3d')](respondWithResult(_0x499b33,null))[_0xf52e('0x3f')](handleError(_0x499b33,null));};exports[_0xf52e('0x49')]=function(_0xbef5d7,_0x109617){return db[_0xf52e('0x3b')][_0xf52e('0x47')]({'where':{'id':_0xbef5d7[_0xf52e('0x48')]['id']}})[_0xf52e('0x3d')](handleEntityNotFound(_0x109617,null))[_0xf52e('0x3d')](removeEntity(_0x109617,null))[_0xf52e('0x3f')](handleError(_0x109617,null));};exports[_0xf52e('0x4a')]=function(_0x277857,_0x40b5b3,_0x34e6de){var _0x31f218={};var _0x24ba7a={};var _0x9fe19e;var _0x391f32;return db[_0xf52e('0x3b')][_0xf52e('0x4b')]({'where':{'id':_0x277857[_0xf52e('0x48')]['id']}})['then'](handleEntityNotFound(_0x40b5b3,null))['then'](function(_0x44af22){if(_0x44af22){_0x9fe19e=_0x44af22;_0x24ba7a[_0xf52e('0x2b')]=_[_0xf52e('0x2d')](db[_0xf52e('0x4c')][_0xf52e('0x28')]);_0x24ba7a[_0xf52e('0x2c')]=_[_0xf52e('0x2d')](_0x277857[_0xf52e('0x2c')]);_0x24ba7a[_0xf52e('0x2e')]=_[_0xf52e('0x2f')](_0x24ba7a[_0xf52e('0x2b')],_0x24ba7a[_0xf52e('0x2c')]);_0x31f218['attributes']=_[_0xf52e('0x2f')](_0x24ba7a[_0xf52e('0x2b')],qs[_0xf52e('0x41')](_0x277857[_0xf52e('0x2c')][_0xf52e('0x41')]));_0x31f218[_0xf52e('0x30')]=_0x31f218[_0xf52e('0x30')][_0xf52e('0x42')]?_0x31f218['attributes']:_0x24ba7a['model'];_0x31f218[_0xf52e('0x33')]=qs['sort'](_0x277857[_0xf52e('0x2c')][_0xf52e('0x34')]);_0x31f218[_0xf52e('0x35')]=qs[_0xf52e('0x2e')](_['pick'](_0x277857[_0xf52e('0x2c')],_0x24ba7a['filters']));if(_0x277857['query'][_0xf52e('0x36')]){_0x31f218[_0xf52e('0x35')]=_['merge'](_0x31f218['where'],{'$or':_['map'](_0x31f218[_0xf52e('0x30')],function(_0x183b92){var _0x267667={};_0x267667[_0x183b92]={'$like':'%'+_0x277857[_0xf52e('0x2c')][_0xf52e('0x36')]+'%'};return _0x267667;})});}_0x31f218=_['merge']({},_0x31f218,_0x277857[_0xf52e('0x44')]);return _0x9fe19e[_0xf52e('0x4a')](_0x31f218);}})['then'](function(_0x2b1be9){if(_0x2b1be9){_0x391f32=_0x2b1be9[_0xf52e('0x42')];if(!_0x277857[_0xf52e('0x2c')]['hasOwnProperty'](_0xf52e('0x32'))){_0x31f218[_0xf52e('0x1d')]=qs[_0xf52e('0x1d')](_0x277857[_0xf52e('0x2c')]['limit']);_0x31f218[_0xf52e('0x1c')]=qs[_0xf52e('0x1c')](_0x277857[_0xf52e('0x2c')]['offset']);}return _0x9fe19e['getFields'](_0x31f218);}})[_0xf52e('0x3d')](function(_0x5847c3){if(_0x5847c3){return _0x5847c3?{'count':_0x391f32,'rows':_0x5847c3}:null;}})[_0xf52e('0x3d')](respondWithResult(_0x40b5b3,null))['catch'](handleError(_0x40b5b3,null));};exports[_0xf52e('0x4d')]=function(_0x9d3acd,_0x5dec12,_0x3457ed){var _0x379eaa={};var _0x28806c={};var _0x1aa3bc;var _0x3a80c8;return db[_0xf52e('0x3b')][_0xf52e('0x4b')]({'where':{'id':_0x9d3acd[_0xf52e('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dec12,null))[_0xf52e('0x3d')](function(_0x28ca71){if(_0x28ca71){_0x1aa3bc=_0x28ca71;_0x28806c['model']=_['keys'](db[_0xf52e('0x4c')][_0xf52e('0x28')]);_0x28806c[_0xf52e('0x2c')]=_[_0xf52e('0x2d')](_0x9d3acd['query']);_0x28806c['filters']=_[_0xf52e('0x2f')](_0x28806c['model'],_0x28806c[_0xf52e('0x2c')]);_0x379eaa[_0xf52e('0x30')]=_[_0xf52e('0x2f')](_0x28806c['model'],qs[_0xf52e('0x41')](_0x9d3acd[_0xf52e('0x2c')][_0xf52e('0x41')]));_0x379eaa[_0xf52e('0x30')]=_0x379eaa[_0xf52e('0x30')][_0xf52e('0x42')]?_0x379eaa[_0xf52e('0x30')]:_0x28806c[_0xf52e('0x2b')];_0x379eaa[_0xf52e('0x33')]=qs[_0xf52e('0x34')](_0x9d3acd[_0xf52e('0x2c')][_0xf52e('0x34')]);_0x379eaa[_0xf52e('0x35')]=qs['filters'](_[_0xf52e('0x4e')](_0x9d3acd['query'],_0x28806c['filters']));if(_0x9d3acd[_0xf52e('0x2c')][_0xf52e('0x36')]){_0x379eaa[_0xf52e('0x35')]=_[_0xf52e('0x43')](_0x379eaa[_0xf52e('0x35')],{'$or':_[_0xf52e('0x27')](_0x379eaa[_0xf52e('0x30')],function(_0x22fbfe){var _0x624782={};_0x624782[_0x22fbfe]={'$like':'%'+_0x9d3acd[_0xf52e('0x2c')][_0xf52e('0x36')]+'%'};return _0x624782;})});}_0x379eaa=_[_0xf52e('0x43')]({},_0x379eaa,_0x9d3acd[_0xf52e('0x44')]);return _0x1aa3bc['getSubjects'](_0x379eaa);}})[_0xf52e('0x3d')](function(_0x2626a1){if(_0x2626a1){_0x3a80c8=_0x2626a1[_0xf52e('0x42')];if(!_0x9d3acd['query'][_0xf52e('0x31')](_0xf52e('0x32'))){_0x379eaa['limit']=qs[_0xf52e('0x1d')](_0x9d3acd[_0xf52e('0x2c')][_0xf52e('0x1d')]);_0x379eaa[_0xf52e('0x1c')]=qs['offset'](_0x9d3acd[_0xf52e('0x2c')][_0xf52e('0x1c')]);}return _0x1aa3bc[_0xf52e('0x4d')](_0x379eaa);}})['then'](function(_0x134843){if(_0x134843){return _0x134843?{'count':_0x3a80c8,'rows':_0x134843}:null;}})['then'](respondWithResult(_0x5dec12,null))[_0xf52e('0x3f')](handleError(_0x5dec12,null));};exports[_0xf52e('0x4f')]=function(_0x45a65d,_0xc1d7c3,_0x40916e){var _0x6df352={};var _0x1fea8c={};var _0x331201;var _0x3fe61e;return db[_0xf52e('0x3b')][_0xf52e('0x4b')]({'where':{'id':_0x45a65d[_0xf52e('0x48')]['id']}})['then'](handleEntityNotFound(_0xc1d7c3,null))[_0xf52e('0x3d')](function(_0xaad2d2){if(_0xaad2d2){_0x331201=_0xaad2d2;_0x1fea8c[_0xf52e('0x2b')]=_[_0xf52e('0x2d')](db[_0xf52e('0x4c')][_0xf52e('0x28')]);_0x1fea8c[_0xf52e('0x2c')]=_[_0xf52e('0x2d')](_0x45a65d[_0xf52e('0x2c')]);_0x1fea8c[_0xf52e('0x2e')]=_['intersection'](_0x1fea8c[_0xf52e('0x2b')],_0x1fea8c['query']);_0x6df352['attributes']=_[_0xf52e('0x2f')](_0x1fea8c[_0xf52e('0x2b')],qs[_0xf52e('0x41')](_0x45a65d[_0xf52e('0x2c')][_0xf52e('0x41')]));_0x6df352[_0xf52e('0x30')]=_0x6df352['attributes'][_0xf52e('0x42')]?_0x6df352[_0xf52e('0x30')]:_0x1fea8c[_0xf52e('0x2b')];_0x6df352['order']=qs[_0xf52e('0x34')](_0x45a65d[_0xf52e('0x2c')][_0xf52e('0x34')]);_0x6df352[_0xf52e('0x35')]=qs[_0xf52e('0x2e')](_[_0xf52e('0x4e')](_0x45a65d[_0xf52e('0x2c')],_0x1fea8c[_0xf52e('0x2e')]));if(_0x45a65d[_0xf52e('0x2c')][_0xf52e('0x36')]){_0x6df352[_0xf52e('0x35')]=_[_0xf52e('0x43')](_0x6df352[_0xf52e('0x35')],{'$or':_[_0xf52e('0x27')](_0x6df352[_0xf52e('0x30')],function(_0x324cfc){var _0x5394e7={};_0x5394e7[_0x324cfc]={'$like':'%'+_0x45a65d[_0xf52e('0x2c')][_0xf52e('0x36')]+'%'};return _0x5394e7;})});}_0x6df352=_[_0xf52e('0x43')]({},_0x6df352,_0x45a65d[_0xf52e('0x44')]);return _0x331201[_0xf52e('0x4f')](_0x6df352);}})[_0xf52e('0x3d')](function(_0x4ee12b){if(_0x4ee12b){_0x3fe61e=_0x4ee12b[_0xf52e('0x42')];if(!_0x45a65d[_0xf52e('0x2c')][_0xf52e('0x31')](_0xf52e('0x32'))){_0x6df352[_0xf52e('0x1d')]=qs['limit'](_0x45a65d[_0xf52e('0x2c')]['limit']);_0x6df352[_0xf52e('0x1c')]=qs[_0xf52e('0x1c')](_0x45a65d[_0xf52e('0x2c')][_0xf52e('0x1c')]);}return _0x331201[_0xf52e('0x4f')](_0x6df352);}})[_0xf52e('0x3d')](function(_0x5e26e8){if(_0x5e26e8){return _0x5e26e8?{'count':_0x3fe61e,'rows':_0x5e26e8}:null;}})[_0xf52e('0x3d')](respondWithResult(_0xc1d7c3,null))[_0xf52e('0x3f')](handleError(_0xc1d7c3,null));};exports[_0xf52e('0x50')]=function(_0x2b9d61,_0x1270e2,_0x3e4de3){var _0x2931d9={};var _0x50c58c={};var _0x101fd2;var _0x2385d0;return db[_0xf52e('0x3b')][_0xf52e('0x4b')]({'where':{'id':_0x2b9d61[_0xf52e('0x48')]['id']}})[_0xf52e('0x3d')](handleEntityNotFound(_0x1270e2,null))['then'](function(_0x4e2295){if(_0x4e2295){_0x101fd2=_0x4e2295;_0x50c58c[_0xf52e('0x2b')]=_['keys'](db['Tag'][_0xf52e('0x28')]);_0x50c58c[_0xf52e('0x2c')]=_[_0xf52e('0x2d')](_0x2b9d61[_0xf52e('0x2c')]);_0x50c58c[_0xf52e('0x2e')]=_[_0xf52e('0x2f')](_0x50c58c[_0xf52e('0x2b')],_0x50c58c[_0xf52e('0x2c')]);_0x2931d9['attributes']=_[_0xf52e('0x2f')](_0x50c58c[_0xf52e('0x2b')],qs['fields'](_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x41')]));_0x2931d9[_0xf52e('0x30')]=_0x2931d9[_0xf52e('0x30')][_0xf52e('0x42')]?_0x2931d9['attributes']:_0x50c58c[_0xf52e('0x2b')];_0x2931d9[_0xf52e('0x33')]=qs[_0xf52e('0x34')](_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x34')]);_0x2931d9[_0xf52e('0x35')]=qs['filters'](_['pick'](_0x2b9d61[_0xf52e('0x2c')],_0x50c58c[_0xf52e('0x2e')]));if(_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x36')]){_0x2931d9[_0xf52e('0x35')]=_[_0xf52e('0x43')](_0x2931d9['where'],{'$or':_[_0xf52e('0x27')](_0x2931d9[_0xf52e('0x30')],function(_0x49d32d){var _0x3edae6={};_0x3edae6[_0x49d32d]={'$like':'%'+_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x36')]+'%'};return _0x3edae6;})});}_0x2931d9=_['merge']({},_0x2931d9,_0x2b9d61['options']);return _0x101fd2[_0xf52e('0x50')](_0x2931d9);}})['then'](function(_0x247d4b){if(_0x247d4b){_0x2385d0=_0x247d4b[_0xf52e('0x42')];if(!_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x31')](_0xf52e('0x32'))){_0x2931d9[_0xf52e('0x1d')]=qs[_0xf52e('0x1d')](_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x1d')]);_0x2931d9[_0xf52e('0x1c')]=qs[_0xf52e('0x1c')](_0x2b9d61[_0xf52e('0x2c')][_0xf52e('0x1c')]);}return _0x101fd2[_0xf52e('0x50')](_0x2931d9);}})[_0xf52e('0x3d')](function(_0x3b77bd){if(_0x3b77bd){return _0x3b77bd?{'count':_0x2385d0,'rows':_0x3b77bd}:null;}})['then'](respondWithResult(_0x1270e2,null))['catch'](handleError(_0x1270e2,null));};exports['setTags']=function(_0x1055f0,_0x386181,_0x213610){if(_0x1055f0[_0xf52e('0x46')]['id']){delete _0x1055f0[_0xf52e('0x46')]['id'];}return db[_0xf52e('0x3b')][_0xf52e('0x4b')]({'where':{'id':_0x1055f0[_0xf52e('0x48')]['id']}})[_0xf52e('0x3d')](handleEntityNotFound(_0x386181,null))[_0xf52e('0x3d')](function(_0x25673a){if(_0x25673a){return _0x25673a[_0xf52e('0x51')](_0x1055f0[_0xf52e('0x46')][_0xf52e('0x52')]||[]);}return null;})['then'](respondWithResult(_0x386181,null))[_0xf52e('0x3f')](handleError(_0x386181,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc92f=['util','api','moment','bluebird','request-promise','../../config/environment','define','DeskConfiguration'];(function(_0x3c3c13,_0x34598c){var _0x2f7928=function(_0x1af637){while(--_0x1af637){_0x3c3c13['push'](_0x3c3c13['shift']());}};_0x2f7928(++_0x34598c);}(_0xc92f,0x140));var _0xfc92=function(_0x4735dc,_0x2c6039){_0x4735dc=_0x4735dc-0x0;var _0x22e40e=_0xc92f[_0x4735dc];return _0x22e40e;};'use strict';var _=require('lodash');var util=require(_0xfc92('0x0'));var logger=require('../../config/logger')(_0xfc92('0x1'));var moment=require(_0xfc92('0x2'));var BPromise=require(_0xfc92('0x3'));var rp=require(_0xfc92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfc92('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x4a23ca,_0xe54672){return _0x4a23ca[_0xfc92('0x6')](_0xfc92('0x7'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd62=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration'];(function(_0xcb2fb8,_0x2eff45){var _0x10d0fa=function(_0x1d6d99){while(--_0x1d6d99){_0xcb2fb8['push'](_0xcb2fb8['shift']());}};_0x10d0fa(++_0x2eff45);}(_0xfd62,0xd2));var _0x2fd6=function(_0x34d57a,_0x32f4fb){_0x34d57a=_0x34d57a-0x0;var _0x4af5a6=_0xfd62[_0x34d57a];return _0x4af5a6;};'use strict';var _=require(_0x2fd6('0x0'));var util=require(_0x2fd6('0x1'));var logger=require(_0x2fd6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2fd6('0x3'));var rp=require(_0x2fd6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2fd6('0x5'));var config=require(_0x2fd6('0x6'));var attributes=require(_0x2fd6('0x7'));module['exports']=function(_0x2ebce4,_0xd691ab){return _0x2ebce4[_0x2fd6('0x8')](_0x2fd6('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdac7=['error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa522f,_0x5debbc){var _0x2083b0=function(_0x288f01){while(--_0x288f01){_0xa522f['push'](_0xa522f['shift']());}};_0x2083b0(++_0x5debbc);}(_0xdac7,0x180));var _0x7dac=function(_0x3f276e,_0x3c4891){_0x3f276e=_0x3f276e-0x0;var _0x135142=_0xdac7[_0x3f276e];return _0x135142;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});}
\ No newline at end of file
+var _0x00f4=['http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x00f4,0x137));var _0x400f=function(_0x390976,_0xb59147){_0x390976=_0x390976-0x0;var _0x41906d=_0x00f4[_0x390976];return _0x41906d;};'use strict';var _=require(_0x400f('0x0'));var util=require('util');var moment=require(_0x400f('0x1'));var BPromise=require(_0x400f('0x2'));var rs=require(_0x400f('0x3'));var fs=require('fs');var Redis=require(_0x400f('0x4'));var db=require(_0x400f('0x5'))['db'];var utils=require(_0x400f('0x6'));var logger=require(_0x400f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x400f('0x8'));var client=jayson['client'][_0x400f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x360f0e,_0x2efbc4,_0x1b9b4f){return new BPromise(function(_0x32a24e,_0x3e2cfb){return client[_0x400f('0xa')](_0x360f0e,_0x1b9b4f)['then'](function(_0x4c4174){logger[_0x400f('0xb')](_0x400f('0xc'),_0x2efbc4,_0x400f('0xd'));logger['debug'](_0x400f('0xe'),_0x2efbc4,_0x400f('0xd'),JSON['stringify'](_0x4c4174));if(_0x4c4174[_0x400f('0xf')]){if(_0x4c4174['error'][_0x400f('0x10')]===0x1f4){logger[_0x400f('0xf')](_0x400f('0xc'),_0x2efbc4,_0x4c4174[_0x400f('0xf')]['message']);return _0x3e2cfb(_0x4c4174['error']['message']);}logger[_0x400f('0xf')](_0x400f('0xc'),_0x2efbc4,_0x4c4174[_0x400f('0xf')][_0x400f('0x11')]);return _0x32a24e(_0x4c4174['error'][_0x400f('0x11')]);}else{logger[_0x400f('0xb')](_0x400f('0xc'),_0x2efbc4,_0x400f('0xd'));_0x32a24e(_0x4c4174[_0x400f('0x12')]['message']);}})[_0x400f('0x13')](function(_0x133f24){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2efbc4,_0x133f24);_0x3e2cfb(_0x133f24);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb68a=['./intDeskField.controller','isAuthenticated','index','get','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5733e8,_0x3e3080){var _0x99327e=function(_0x3fc6ae){while(--_0x3fc6ae){_0x5733e8['push'](_0x5733e8['shift']());}};_0x99327e(++_0x3e3080);}(_0xb68a,0x93));var _0xab68=function(_0x11f1f4,_0x189cf3){_0x11f1f4=_0x11f1f4-0x0;var _0x6d3dec=_0xb68a[_0x11f1f4];return _0x6d3dec;};'use strict';var multer=require(_0xab68('0x0'));var util=require('util');var path=require(_0xab68('0x1'));var timeout=require('connect-timeout');var express=require(_0xab68('0x2'));var router=express[_0xab68('0x3')]();var fs_extra=require(_0xab68('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xab68('0x5'));var config=require('../../config/environment');var controller=require(_0xab68('0x6'));router['get']('/',auth[_0xab68('0x7')](),controller[_0xab68('0x8')]);router[_0xab68('0x9')]('/:id',auth[_0xab68('0x7')](),controller['show']);router[_0xab68('0xa')]('/',auth[_0xab68('0x7')](),controller[_0xab68('0xb')]);router[_0xab68('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xab68('0xd')]);router[_0xab68('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xab68('0xf')]);module[_0xab68('0x10')]=router;
\ No newline at end of file
+var _0xa552=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3108d9,_0xf08d6){var _0x1455e6=function(_0xfd5906){while(--_0xfd5906){_0x3108d9['push'](_0x3108d9['shift']());}};_0x1455e6(++_0xf08d6);}(_0xa552,0x147));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2a55('0x0'));var util=require(_0x2a55('0x1'));var path=require(_0x2a55('0x2'));var timeout=require(_0x2a55('0x3'));var express=require('express');var router=express[_0x2a55('0x4')]();var fs_extra=require(_0x2a55('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2a55('0x6'));var controller=require(_0x2a55('0x7'));router[_0x2a55('0x8')]('/',auth[_0x2a55('0x9')](),controller[_0x2a55('0xa')]);router[_0x2a55('0x8')](_0x2a55('0xb'),auth['isAuthenticated'](),controller[_0x2a55('0xc')]);router[_0x2a55('0xd')]('/',auth['isAuthenticated'](),controller[_0x2a55('0xe')]);router[_0x2a55('0xf')]('/:id',auth[_0x2a55('0x9')](),controller[_0x2a55('0x10')]);router[_0x2a55('0x11')](_0x2a55('0xb'),auth[_0x2a55('0x9')](),controller[_0x2a55('0x12')]);module[_0x2a55('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15fd=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','STRING','string'];(function(_0xbe7320,_0x106a76){var _0x43f0a9=function(_0x1ecd82){while(--_0x1ecd82){_0xbe7320['push'](_0xbe7320['shift']());}};_0x43f0a9(++_0x106a76);}(_0x15fd,0xf4));var _0xd15f=function(_0x1c99d7,_0x47744c){_0x1c99d7=_0x1c99d7-0x0;var _0x513a7b=_0x15fd[_0x1c99d7];return _0x513a7b;};'use strict';var Sequelize=require(_0xd15f('0x0'));module[_0xd15f('0x1')]={'type':{'type':Sequelize[_0xd15f('0x2')]('string',_0xd15f('0x3'),'customVariable',_0xd15f('0x4'),_0xd15f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd15f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd15f('0x7'),_0xd15f('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd15f('0x6')]},'idField':{'type':Sequelize[_0xd15f('0x6')]},'nameField':{'type':Sequelize[_0xd15f('0x6')]},'customField':{'type':Sequelize[_0xd15f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd15f('0x6')]}};
\ No newline at end of file
+var _0x1e7a=['picklist','string','STRING','ENUM','customVariable','exports','variable','keyValue'];(function(_0x5cdb35,_0x49aefe){var _0x1ed77e=function(_0x52261b){while(--_0x52261b){_0x5cdb35['push'](_0x5cdb35['shift']());}};_0x1ed77e(++_0x49aefe);}(_0x1e7a,0x85));var _0xa1e7=function(_0x1f550a,_0x3b141e){_0x1f550a=_0x1f550a-0x0;var _0x38e6c0=_0x1e7a[_0x1f550a];return _0x38e6c0;};'use strict';var Sequelize=require('sequelize');module[_0xa1e7('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa1e7('0x1'),'customVariable',_0xa1e7('0x2'),_0xa1e7('0x3')),'defaultValue':_0xa1e7('0x4')},'content':{'type':Sequelize[_0xa1e7('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa1e7('0x6')]('string','variable',_0xa1e7('0x7'))},'keyContent':{'type':Sequelize[_0xa1e7('0x5')]},'idField':{'type':Sequelize[_0xa1e7('0x5')]},'nameField':{'type':Sequelize[_0xa1e7('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf603=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','find','catch','body'];(function(_0x5b7b39,_0xd7c076){var _0x2037b5=function(_0x4d8903){while(--_0x4d8903){_0x5b7b39['push'](_0x5b7b39['shift']());}};_0x2037b5(++_0xd7c076);}(_0xf603,0x124));var _0x3f60=function(_0x5004b9,_0x3f29c5){_0x5004b9=_0x5004b9-0x0;var _0x5a6701=_0xf603[_0x5004b9];return _0x5a6701;};'use strict';var emlformat=require(_0x3f60('0x0'));var rimraf=require(_0x3f60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f60('0x2'));var rp=require(_0x3f60('0x3'));var moment=require(_0x3f60('0x4'));var BPromise=require(_0x3f60('0x5'));var Mustache=require(_0x3f60('0x6'));var util=require(_0x3f60('0x7'));var path=require(_0x3f60('0x8'));var sox=require(_0x3f60('0x9'));var csv=require(_0x3f60('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f60('0xb'));var crypto=require(_0x3f60('0xc'));var jsforce=require(_0x3f60('0xd'));var deskjs=require(_0x3f60('0xe'));var toCsv=require(_0x3f60('0xa'));var querystring=require(_0x3f60('0xf'));var Papa=require(_0x3f60('0x10'));var Redis=require(_0x3f60('0x11'));var authService=require(_0x3f60('0x12'));var qs=require(_0x3f60('0x13'));var as=require(_0x3f60('0x14'));var hardwareService=require(_0x3f60('0x15'));var logger=require(_0x3f60('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f60('0x17'));var db=require(_0x3f60('0x18'))['db'];function respondWithStatusCode(_0x2e79e8,_0x58e120){_0x58e120=_0x58e120||0xcc;return function(_0xeb6151){if(_0xeb6151){return _0x2e79e8[_0x3f60('0x19')](_0x58e120);}return _0x2e79e8['status'](_0x58e120)[_0x3f60('0x1a')]();};}function respondWithResult(_0x1b3e74,_0x53ec7a){_0x53ec7a=_0x53ec7a||0xc8;return function(_0x1ec7f4){if(_0x1ec7f4){return _0x1b3e74['status'](_0x53ec7a)[_0x3f60('0x1b')](_0x1ec7f4);}};}function respondWithFilteredResult(_0x2cd28f,_0x5e7718){return function(_0x3c0e9d){if(_0x3c0e9d){var _0x4e84b5=typeof _0x5e7718[_0x3f60('0x1c')]==='undefined'&&typeof _0x5e7718[_0x3f60('0x1d')]===_0x3f60('0x1e');var _0xbc26c=_0x3c0e9d[_0x3f60('0x1f')];var _0x3ae771=_0x4e84b5?0x0:_0x5e7718[_0x3f60('0x1c')];var _0x52aa44=_0x4e84b5?_0x3c0e9d[_0x3f60('0x1f')]:_0x5e7718[_0x3f60('0x1c')]+_0x5e7718[_0x3f60('0x1d')];var _0x9c845f;if(_0x52aa44>=_0xbc26c){_0x52aa44=_0xbc26c;_0x9c845f=0xc8;}else{_0x9c845f=0xce;}_0x2cd28f[_0x3f60('0x20')](_0x9c845f);return _0x2cd28f[_0x3f60('0x21')]('Content-Range',_0x3ae771+'-'+_0x52aa44+'/'+_0xbc26c)[_0x3f60('0x1b')](_0x3c0e9d);}return null;};}function patchUpdates(_0x2f1735){return function(_0x4dace9){try{jsonpatch[_0x3f60('0x22')](_0x4dace9,_0x2f1735,!![]);}catch(_0x2dba08){return BPromise[_0x3f60('0x23')](_0x2dba08);}return _0x4dace9[_0x3f60('0x24')]();};}function saveUpdates(_0x1d23bb,_0x1b161e){return function(_0x44b665){if(_0x44b665){return _0x44b665[_0x3f60('0x25')](_0x1d23bb)[_0x3f60('0x26')](function(_0x31847d){return _0x31847d;});}return null;};}function removeEntity(_0x3f6fa7,_0x35b8f6){return function(_0x1f9390){if(_0x1f9390){return _0x1f9390[_0x3f60('0x27')]()[_0x3f60('0x26')](function(){_0x3f6fa7['status'](0xcc)[_0x3f60('0x1a')]();});}};}function handleEntityNotFound(_0x3cdef4,_0x15315b){return function(_0x4581d6){if(!_0x4581d6){_0x3cdef4[_0x3f60('0x19')](0x194);}return _0x4581d6;};}function handleError(_0x36dfdb,_0xc106a9){_0xc106a9=_0xc106a9||0x1f4;return function(_0x23e265){logger['error'](_0x23e265[_0x3f60('0x28')]);if(_0x23e265[_0x3f60('0x29')]){delete _0x23e265[_0x3f60('0x29')];}_0x36dfdb[_0x3f60('0x20')](_0xc106a9)[_0x3f60('0x2a')](_0x23e265);};}exports[_0x3f60('0x2b')]=function(_0x39e14c,_0x4520a5){var _0x16b590={},_0x3cd0a7={},_0x2f1bc9={'count':0x0,'rows':[]};var _0x457e5b=_[_0x3f60('0x2c')](db[_0x3f60('0x2d')][_0x3f60('0x2e')],function(_0x14d83c){return{'name':_0x14d83c[_0x3f60('0x2f')],'type':_0x14d83c[_0x3f60('0x30')][_0x3f60('0x31')]};});_0x3cd0a7[_0x3f60('0x32')]=_[_0x3f60('0x2c')](_0x457e5b,_0x3f60('0x29'));_0x3cd0a7[_0x3f60('0x33')]=_[_0x3f60('0x34')](_0x39e14c[_0x3f60('0x33')]);_0x3cd0a7[_0x3f60('0x35')]=_[_0x3f60('0x36')](_0x3cd0a7[_0x3f60('0x32')],_0x3cd0a7[_0x3f60('0x33')]);_0x16b590[_0x3f60('0x37')]=_[_0x3f60('0x36')](_0x3cd0a7['model'],qs[_0x3f60('0x38')](_0x39e14c[_0x3f60('0x33')]['fields']));_0x16b590[_0x3f60('0x37')]=_0x16b590[_0x3f60('0x37')][_0x3f60('0x39')]?_0x16b590[_0x3f60('0x37')]:_0x3cd0a7['model'];if(!_0x39e14c[_0x3f60('0x33')][_0x3f60('0x3a')]('nolimit')){_0x16b590['limit']=qs[_0x3f60('0x1d')](_0x39e14c['query'][_0x3f60('0x1d')]);_0x16b590[_0x3f60('0x1c')]=qs[_0x3f60('0x1c')](_0x39e14c[_0x3f60('0x33')]['offset']);}_0x16b590['order']=qs[_0x3f60('0x3b')](_0x39e14c[_0x3f60('0x33')][_0x3f60('0x3b')]);_0x16b590[_0x3f60('0x3c')]=qs[_0x3f60('0x35')](_[_0x3f60('0x3d')](_0x39e14c['query'],_0x3cd0a7[_0x3f60('0x35')]),_0x457e5b);if(_0x39e14c['query'][_0x3f60('0x3e')]){_0x16b590['where']=_[_0x3f60('0x3f')](_0x16b590[_0x3f60('0x3c')],{'$or':_[_0x3f60('0x2c')](_0x457e5b,function(_0x466d05){if(_0x466d05[_0x3f60('0x30')]!=='VIRTUAL'){var _0x4fa98d={};_0x4fa98d[_0x466d05[_0x3f60('0x29')]]={'$like':'%'+_0x39e14c[_0x3f60('0x33')][_0x3f60('0x3e')]+'%'};return _0x4fa98d;}})});}_0x16b590=_['merge']({},_0x16b590,_0x39e14c[_0x3f60('0x40')]);var _0x42f82d={'where':_0x16b590['where']};return db['DeskField'][_0x3f60('0x1f')](_0x42f82d)[_0x3f60('0x26')](function(_0x3f2129){_0x2f1bc9[_0x3f60('0x1f')]=_0x3f2129;if(_0x39e14c[_0x3f60('0x33')]['includeAll']){_0x16b590[_0x3f60('0x41')]=[{'all':!![]}];}return db[_0x3f60('0x2d')][_0x3f60('0x42')](_0x16b590);})[_0x3f60('0x26')](function(_0x4c6346){_0x2f1bc9[_0x3f60('0x43')]=_0x4c6346;return _0x2f1bc9;})['then'](respondWithFilteredResult(_0x4520a5,_0x16b590))['catch'](handleError(_0x4520a5,null));};exports[_0x3f60('0x44')]=function(_0x20422a,_0x4ef8f2){var _0x5cfc2f={'raw':!![],'where':{'id':_0x20422a[_0x3f60('0x45')]['id']}},_0x4f0752={};_0x4f0752[_0x3f60('0x32')]=_['keys'](db['DeskField']['rawAttributes']);_0x4f0752[_0x3f60('0x33')]=_['keys'](_0x20422a['query']);_0x4f0752[_0x3f60('0x35')]=_[_0x3f60('0x36')](_0x4f0752['model'],_0x4f0752['query']);_0x5cfc2f[_0x3f60('0x37')]=_['intersection'](_0x4f0752[_0x3f60('0x32')],qs['fields'](_0x20422a[_0x3f60('0x33')][_0x3f60('0x38')]));_0x5cfc2f[_0x3f60('0x37')]=_0x5cfc2f[_0x3f60('0x37')][_0x3f60('0x39')]?_0x5cfc2f['attributes']:_0x4f0752[_0x3f60('0x32')];if(_0x20422a[_0x3f60('0x33')]['includeAll']){_0x5cfc2f['include']=[{'all':!![]}];}_0x5cfc2f=_[_0x3f60('0x3f')]({},_0x5cfc2f,_0x20422a[_0x3f60('0x40')]);return db[_0x3f60('0x2d')][_0x3f60('0x46')](_0x5cfc2f)[_0x3f60('0x26')](handleEntityNotFound(_0x4ef8f2,null))['then'](respondWithResult(_0x4ef8f2,null))[_0x3f60('0x47')](handleError(_0x4ef8f2,null));};exports['create']=function(_0xe5a2a6,_0x253d2f){return db[_0x3f60('0x2d')]['create'](_0xe5a2a6[_0x3f60('0x48')],{})[_0x3f60('0x26')](respondWithResult(_0x253d2f,0xc9))[_0x3f60('0x47')](handleError(_0x253d2f,null));};exports['update']=function(_0x217348,_0x55f75f){if(_0x217348[_0x3f60('0x48')]['id']){delete _0x217348[_0x3f60('0x48')]['id'];}return db[_0x3f60('0x2d')][_0x3f60('0x46')]({'where':{'id':_0x217348['params']['id']}})[_0x3f60('0x26')](handleEntityNotFound(_0x55f75f,null))[_0x3f60('0x26')](saveUpdates(_0x217348['body'],null))[_0x3f60('0x26')](respondWithResult(_0x55f75f,null))['catch'](handleError(_0x55f75f,null));};exports['destroy']=function(_0x4ce17d,_0x55dd97){return db['DeskField'][_0x3f60('0x46')]({'where':{'id':_0x4ce17d['params']['id']}})[_0x3f60('0x26')](handleEntityNotFound(_0x55dd97,null))[_0x3f60('0x26')](removeEntity(_0x55dd97,null))[_0x3f60('0x47')](handleError(_0x55dd97,null));};
\ No newline at end of file
+var _0x4667=['../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2e0c00,_0x2246ca){var _0x3f8712=function(_0x5402ac){while(--_0x5402ac){_0x2e0c00['push'](_0x2e0c00['shift']());}};_0x3f8712(++_0x2246ca);}(_0x4667,0x10f));var _0x7466=function(_0x2f0195,_0x185bbb){_0x2f0195=_0x2f0195-0x0;var _0x3a43ec=_0x4667[_0x2f0195];return _0x3a43ec;};'use strict';var emlformat=require(_0x7466('0x0'));var rimraf=require(_0x7466('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7466('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7466('0x3'));var Mustache=require(_0x7466('0x4'));var util=require(_0x7466('0x5'));var path=require('path');var sox=require(_0x7466('0x6'));var csv=require(_0x7466('0x7'));var ejs=require(_0x7466('0x8'));var fs=require('fs');var fs_extra=require(_0x7466('0x9'));var _=require(_0x7466('0xa'));var squel=require(_0x7466('0xb'));var crypto=require(_0x7466('0xc'));var jsforce=require(_0x7466('0xd'));var deskjs=require(_0x7466('0xe'));var toCsv=require(_0x7466('0x7'));var querystring=require('querystring');var Papa=require(_0x7466('0xf'));var Redis=require(_0x7466('0x10'));var authService=require(_0x7466('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7466('0x12'));var hardwareService=require(_0x7466('0x13'));var logger=require(_0x7466('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7466('0x15'));var licenseUtil=require(_0x7466('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a0974,_0x476686){_0x476686=_0x476686||0xcc;return function(_0x18bfee){if(_0x18bfee){return _0x5a0974[_0x7466('0x17')](_0x476686);}return _0x5a0974[_0x7466('0x18')](_0x476686)['end']();};}function respondWithResult(_0x4a0272,_0x48142d){_0x48142d=_0x48142d||0xc8;return function(_0x3c5fb2){if(_0x3c5fb2){return _0x4a0272[_0x7466('0x18')](_0x48142d)['json'](_0x3c5fb2);}};}function respondWithFilteredResult(_0x2c0767,_0x4fc327){return function(_0x41f4fb){if(_0x41f4fb){var _0x5af76b=typeof _0x4fc327['offset']===_0x7466('0x19')&&typeof _0x4fc327[_0x7466('0x1a')]==='undefined';var _0xf6d72c=_0x41f4fb[_0x7466('0x1b')];var _0x28fefa=_0x5af76b?0x0:_0x4fc327[_0x7466('0x1c')];var _0x4d5e85=_0x5af76b?_0x41f4fb[_0x7466('0x1b')]:_0x4fc327[_0x7466('0x1c')]+_0x4fc327[_0x7466('0x1a')];var _0x31ec5a;if(_0x4d5e85>=_0xf6d72c){_0x4d5e85=_0xf6d72c;_0x31ec5a=0xc8;}else{_0x31ec5a=0xce;}_0x2c0767[_0x7466('0x18')](_0x31ec5a);return _0x2c0767[_0x7466('0x1d')](_0x7466('0x1e'),_0x28fefa+'-'+_0x4d5e85+'/'+_0xf6d72c)['json'](_0x41f4fb);}return null;};}function patchUpdates(_0x4fbf3e){return function(_0x2ffd99){try{jsonpatch[_0x7466('0x1f')](_0x2ffd99,_0x4fbf3e,!![]);}catch(_0x36cd13){return BPromise[_0x7466('0x20')](_0x36cd13);}return _0x2ffd99[_0x7466('0x21')]();};}function saveUpdates(_0x8cbc15,_0x5a1f9a){return function(_0x18c686){if(_0x18c686){return _0x18c686[_0x7466('0x22')](_0x8cbc15)[_0x7466('0x23')](function(_0x5f4f14){return _0x5f4f14;});}return null;};}function removeEntity(_0x1cde6c,_0x5879c4){return function(_0x4c1ad6){if(_0x4c1ad6){return _0x4c1ad6['destroy']()[_0x7466('0x23')](function(){_0x1cde6c[_0x7466('0x18')](0xcc)[_0x7466('0x24')]();});}};}function handleEntityNotFound(_0x3dc811,_0x3531d1){return function(_0x5566bb){if(!_0x5566bb){_0x3dc811['sendStatus'](0x194);}return _0x5566bb;};}function handleError(_0x144f78,_0x5ecc4c){_0x5ecc4c=_0x5ecc4c||0x1f4;return function(_0x5bc082){logger[_0x7466('0x25')](_0x5bc082[_0x7466('0x26')]);if(_0x5bc082[_0x7466('0x27')]){delete _0x5bc082[_0x7466('0x27')];}_0x144f78[_0x7466('0x18')](_0x5ecc4c)[_0x7466('0x28')](_0x5bc082);};}exports[_0x7466('0x29')]=function(_0x112598,_0x36ff83){var _0x48106a={},_0x2dbd7f={},_0x3b6742={'count':0x0,'rows':[]};var _0x4568ae=_[_0x7466('0x2a')](db[_0x7466('0x2b')][_0x7466('0x2c')],function(_0x3b82f7){return{'name':_0x3b82f7[_0x7466('0x2d')],'type':_0x3b82f7['type'][_0x7466('0x2e')]};});_0x2dbd7f[_0x7466('0x2f')]=_[_0x7466('0x2a')](_0x4568ae,_0x7466('0x27'));_0x2dbd7f[_0x7466('0x30')]=_['keys'](_0x112598[_0x7466('0x30')]);_0x2dbd7f['filters']=_['intersection'](_0x2dbd7f[_0x7466('0x2f')],_0x2dbd7f[_0x7466('0x30')]);_0x48106a[_0x7466('0x31')]=_[_0x7466('0x32')](_0x2dbd7f[_0x7466('0x2f')],qs[_0x7466('0x33')](_0x112598[_0x7466('0x30')][_0x7466('0x33')]));_0x48106a['attributes']=_0x48106a[_0x7466('0x31')][_0x7466('0x34')]?_0x48106a[_0x7466('0x31')]:_0x2dbd7f['model'];if(!_0x112598[_0x7466('0x30')][_0x7466('0x35')]('nolimit')){_0x48106a[_0x7466('0x1a')]=qs[_0x7466('0x1a')](_0x112598[_0x7466('0x30')][_0x7466('0x1a')]);_0x48106a[_0x7466('0x1c')]=qs[_0x7466('0x1c')](_0x112598[_0x7466('0x30')][_0x7466('0x1c')]);}_0x48106a[_0x7466('0x36')]=qs[_0x7466('0x37')](_0x112598['query'][_0x7466('0x37')]);_0x48106a[_0x7466('0x38')]=qs[_0x7466('0x39')](_['pick'](_0x112598['query'],_0x2dbd7f[_0x7466('0x39')]),_0x4568ae);if(_0x112598[_0x7466('0x30')][_0x7466('0x3a')]){_0x48106a[_0x7466('0x38')]=_['merge'](_0x48106a[_0x7466('0x38')],{'$or':_[_0x7466('0x2a')](_0x4568ae,function(_0x3f0ef4){if(_0x3f0ef4[_0x7466('0x3b')]!==_0x7466('0x3c')){var _0x3fe969={};_0x3fe969[_0x3f0ef4['name']]={'$like':'%'+_0x112598[_0x7466('0x30')]['filter']+'%'};return _0x3fe969;}})});}_0x48106a=_[_0x7466('0x3d')]({},_0x48106a,_0x112598[_0x7466('0x3e')]);var _0x351c5e={'where':_0x48106a[_0x7466('0x38')]};return db[_0x7466('0x2b')][_0x7466('0x1b')](_0x351c5e)['then'](function(_0x1f0abe){_0x3b6742[_0x7466('0x1b')]=_0x1f0abe;if(_0x112598[_0x7466('0x30')][_0x7466('0x3f')]){_0x48106a[_0x7466('0x40')]=[{'all':!![]}];}return db[_0x7466('0x2b')]['findAll'](_0x48106a);})[_0x7466('0x23')](function(_0x29d0e7){_0x3b6742['rows']=_0x29d0e7;return _0x3b6742;})[_0x7466('0x23')](respondWithFilteredResult(_0x36ff83,_0x48106a))[_0x7466('0x41')](handleError(_0x36ff83,null));};exports[_0x7466('0x42')]=function(_0x59abfe,_0x286a92){var _0x2bd9f9={'raw':!![],'where':{'id':_0x59abfe[_0x7466('0x43')]['id']}},_0x1baceb={};_0x1baceb[_0x7466('0x2f')]=_[_0x7466('0x44')](db['DeskField'][_0x7466('0x2c')]);_0x1baceb[_0x7466('0x30')]=_[_0x7466('0x44')](_0x59abfe[_0x7466('0x30')]);_0x1baceb[_0x7466('0x39')]=_[_0x7466('0x32')](_0x1baceb[_0x7466('0x2f')],_0x1baceb[_0x7466('0x30')]);_0x2bd9f9[_0x7466('0x31')]=_[_0x7466('0x32')](_0x1baceb['model'],qs[_0x7466('0x33')](_0x59abfe[_0x7466('0x30')][_0x7466('0x33')]));_0x2bd9f9[_0x7466('0x31')]=_0x2bd9f9[_0x7466('0x31')]['length']?_0x2bd9f9[_0x7466('0x31')]:_0x1baceb[_0x7466('0x2f')];if(_0x59abfe[_0x7466('0x30')]['includeAll']){_0x2bd9f9[_0x7466('0x40')]=[{'all':!![]}];}_0x2bd9f9=_[_0x7466('0x3d')]({},_0x2bd9f9,_0x59abfe[_0x7466('0x3e')]);return db[_0x7466('0x2b')][_0x7466('0x45')](_0x2bd9f9)['then'](handleEntityNotFound(_0x286a92,null))['then'](respondWithResult(_0x286a92,null))[_0x7466('0x41')](handleError(_0x286a92,null));};exports[_0x7466('0x46')]=function(_0x1de9c6,_0x1b4a41){return db['DeskField'][_0x7466('0x46')](_0x1de9c6['body'],{})[_0x7466('0x23')](respondWithResult(_0x1b4a41,0xc9))[_0x7466('0x41')](handleError(_0x1b4a41,null));};exports['update']=function(_0x36f584,_0x2e3c9d){if(_0x36f584[_0x7466('0x47')]['id']){delete _0x36f584[_0x7466('0x47')]['id'];}return db[_0x7466('0x2b')]['find']({'where':{'id':_0x36f584[_0x7466('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e3c9d,null))['then'](saveUpdates(_0x36f584[_0x7466('0x47')],null))[_0x7466('0x23')](respondWithResult(_0x2e3c9d,null))['catch'](handleError(_0x2e3c9d,null));};exports[_0x7466('0x48')]=function(_0x3a74d4,_0xba38bf){return db[_0x7466('0x2b')][_0x7466('0x45')]({'where':{'id':_0x3a74d4[_0x7466('0x43')]['id']}})['then'](handleEntityNotFound(_0xba38bf,null))[_0x7466('0x23')](removeEntity(_0xba38bf,null))['catch'](handleError(_0xba38bf,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a09=['define','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x7a09,0x1d5));var _0x97a0=function(_0x4dbdc3,_0x5a525d){_0x4dbdc3=_0x4dbdc3-0x0;var _0x1765ad=_0x7a09[_0x4dbdc3];return _0x1765ad;};'use strict';var _=require(_0x97a0('0x0'));var util=require(_0x97a0('0x1'));var logger=require(_0x97a0('0x2'))(_0x97a0('0x3'));var moment=require('moment');var BPromise=require(_0x97a0('0x4'));var rp=require(_0x97a0('0x5'));var fs=require('fs');var path=require(_0x97a0('0x6'));var rimraf=require(_0x97a0('0x7'));var config=require(_0x97a0('0x8'));var attributes=require(_0x97a0('0x9'));module[_0x97a0('0xa')]=function(_0x556309,_0x10ec4c){return _0x556309[_0x97a0('0xb')](_0x97a0('0xc'),attributes,{'tableName':_0x97a0('0xd'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x97a0('0xe'),_0x97a0('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d94=['./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x0d94,0x151));var _0x40d9=function(_0x4260d9,_0x798704){_0x4260d9=_0x4260d9-0x0;var _0x56aa24=_0x0d94[_0x4260d9];return _0x56aa24;};'use strict';var _=require(_0x40d9('0x0'));var util=require('util');var logger=require(_0x40d9('0x1'))('api');var moment=require(_0x40d9('0x2'));var BPromise=require(_0x40d9('0x3'));var rp=require(_0x40d9('0x4'));var fs=require('fs');var path=require(_0x40d9('0x5'));var rimraf=require(_0x40d9('0x6'));var config=require(_0x40d9('0x7'));var attributes=require(_0x40d9('0x8'));module[_0x40d9('0x9')]=function(_0x29a4dd,_0x4a75eb){return _0x29a4dd[_0x40d9('0xa')](_0x40d9('0xb'),attributes,{'tableName':_0x40d9('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x40d9('0xd'),_0x40d9('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a9d=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','then','DeskField,\x20%s,\x20%s'];(function(_0x44c844,_0x1e3d7d){var _0x1d51b7=function(_0x575840){while(--_0x575840){_0x44c844['push'](_0x44c844['shift']());}};_0x1d51b7(++_0x1e3d7d);}(_0x5a9d,0x199));var _0xd5a9=function(_0x1e2369,_0x238ba9){_0x1e2369=_0x1e2369-0x0;var _0x40350f=_0x5a9d[_0x1e2369];return _0x40350f;};'use strict';var _=require('lodash');var util=require(_0xd5a9('0x0'));var moment=require('moment');var BPromise=require(_0xd5a9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5a9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd5a9('0x3'))(_0xd5a9('0x4'));var config=require('../../config/environment');var jayson=require(_0xd5a9('0x5'));var client=jayson['client'][_0xd5a9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58774a,_0xf5f429,_0x80c1b3){return new BPromise(function(_0x51745e,_0x179b00){return client['request'](_0x58774a,_0x80c1b3)[_0xd5a9('0x7')](function(_0x143295){logger['info'](_0xd5a9('0x8'),_0xf5f429,_0xd5a9('0x9'));logger[_0xd5a9('0xa')](_0xd5a9('0xb'),_0xf5f429,_0xd5a9('0x9'),JSON[_0xd5a9('0xc')](_0x143295));if(_0x143295[_0xd5a9('0xd')]){if(_0x143295['error'][_0xd5a9('0xe')]===0x1f4){logger['error'](_0xd5a9('0x8'),_0xf5f429,_0x143295[_0xd5a9('0xd')][_0xd5a9('0xf')]);return _0x179b00(_0x143295[_0xd5a9('0xd')][_0xd5a9('0xf')]);}logger[_0xd5a9('0xd')]('DeskField,\x20%s,\x20%s',_0xf5f429,_0x143295[_0xd5a9('0xd')][_0xd5a9('0xf')]);return _0x51745e(_0x143295['error'][_0xd5a9('0xf')]);}else{logger[_0xd5a9('0x10')](_0xd5a9('0x8'),_0xf5f429,_0xd5a9('0x9'));_0x51745e(_0x143295[_0xd5a9('0x11')][_0xd5a9('0xf')]);}})[_0xd5a9('0x12')](function(_0x3aa30c){logger[_0xd5a9('0xd')](_0xd5a9('0x8'),_0xf5f429,_0x3aa30c);_0x179b00(_0x3aa30c);});});}
\ No newline at end of file
+var _0x5abe=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','DeskField,\x20%s,\x20%s','result','catch','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5abe,0x15f));var _0xe5ab=function(_0x58a6ae,_0x4c92bf){_0x58a6ae=_0x58a6ae-0x0;var _0xc01c5a=_0x5abe[_0x58a6ae];return _0xc01c5a;};'use strict';var _=require(_0xe5ab('0x0'));var util=require('util');var moment=require(_0xe5ab('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5ab('0x2'))['db'];var utils=require(_0xe5ab('0x3'));var logger=require(_0xe5ab('0x4'))(_0xe5ab('0x5'));var config=require(_0xe5ab('0x6'));var jayson=require(_0xe5ab('0x7'));var client=jayson[_0xe5ab('0x8')][_0xe5ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47e5a8,_0x55ea58,_0x4d904f){return new BPromise(function(_0x540553,_0x22af39){return client[_0xe5ab('0xa')](_0x47e5a8,_0x4d904f)[_0xe5ab('0xb')](function(_0x21d65e){logger[_0xe5ab('0xc')]('DeskField,\x20%s,\x20%s',_0x55ea58,_0xe5ab('0xd'));logger[_0xe5ab('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x55ea58,_0xe5ab('0xd'),JSON[_0xe5ab('0xf')](_0x21d65e));if(_0x21d65e[_0xe5ab('0x10')]){if(_0x21d65e[_0xe5ab('0x10')][_0xe5ab('0x11')]===0x1f4){logger[_0xe5ab('0x10')]('DeskField,\x20%s,\x20%s',_0x55ea58,_0x21d65e['error'][_0xe5ab('0x12')]);return _0x22af39(_0x21d65e['error']['message']);}logger[_0xe5ab('0x10')]('DeskField,\x20%s,\x20%s',_0x55ea58,_0x21d65e['error'][_0xe5ab('0x12')]);return _0x540553(_0x21d65e[_0xe5ab('0x10')]['message']);}else{logger['info'](_0xe5ab('0x13'),_0x55ea58,_0xe5ab('0xd'));_0x540553(_0x21d65e[_0xe5ab('0x14')][_0xe5ab('0x12')]);}})[_0xe5ab('0x15')](function(_0x393ddb){logger[_0xe5ab('0x10')]('DeskField,\x20%s,\x20%s',_0x55ea58,_0x393ddb);_0x22af39(_0x393ddb);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb332=['show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id'];(function(_0x1bbb5c,_0x233593){var _0x11550c=function(_0x1befb8){while(--_0x1befb8){_0x1bbb5c['push'](_0x1bbb5c['shift']());}};_0x11550c(++_0x233593);}(_0xb332,0x181));var _0x2b33=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0xb332[_0x5a7f64];return _0x3d30f1;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2b33('0x1'));var express=require(_0x2b33('0x2'));var router=express['Router']();var fs_extra=require(_0x2b33('0x3'));var auth=require(_0x2b33('0x4'));var interaction=require(_0x2b33('0x5'));var config=require('../../config/environment');var controller=require(_0x2b33('0x6'));router[_0x2b33('0x7')]('/',auth[_0x2b33('0x8')](),controller[_0x2b33('0x9')]);router[_0x2b33('0x7')](_0x2b33('0xa'),auth[_0x2b33('0x8')](),controller[_0x2b33('0xb')]);router[_0x2b33('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x2b33('0xc')]);router[_0x2b33('0x7')](_0x2b33('0xd'),auth[_0x2b33('0x8')](),controller[_0x2b33('0xe')]);router[_0x2b33('0xf')]('/',auth[_0x2b33('0x8')](),controller[_0x2b33('0x10')]);router[_0x2b33('0xf')](_0x2b33('0x11'),auth[_0x2b33('0x8')](),controller['addConfiguration']);router['put'](_0x2b33('0xa'),auth[_0x2b33('0x8')](),controller[_0x2b33('0x12')]);router[_0x2b33('0x13')](_0x2b33('0xa'),auth[_0x2b33('0x8')](),controller[_0x2b33('0x14')]);module[_0x2b33('0x15')]=router;
\ No newline at end of file
+var _0xc547=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','destroy','util'];(function(_0x5e21ae,_0x5cfb60){var _0x2d9da8=function(_0x172a63){while(--_0x172a63){_0x5e21ae['push'](_0x5e21ae['shift']());}};_0x2d9da8(++_0x5cfb60);}(_0xc547,0xd7));var _0x7c54=function(_0x4ff845,_0x53caa8){_0x4ff845=_0x4ff845-0x0;var _0x221498=_0xc547[_0x4ff845];return _0x221498;};'use strict';var multer=require('multer');var util=require(_0x7c54('0x0'));var path=require(_0x7c54('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c54('0x2'));var router=express['Router']();var fs_extra=require(_0x7c54('0x3'));var auth=require(_0x7c54('0x4'));var interaction=require(_0x7c54('0x5'));var config=require(_0x7c54('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x7c54('0x7')]('/',auth[_0x7c54('0x8')](),controller['index']);router[_0x7c54('0x7')](_0x7c54('0x9'),auth[_0x7c54('0x8')](),controller['show']);router[_0x7c54('0x7')](_0x7c54('0xa'),auth[_0x7c54('0x8')](),controller[_0x7c54('0xb')]);router[_0x7c54('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7c54('0xc')]);router['post']('/',auth[_0x7c54('0x8')](),controller['create']);router[_0x7c54('0xd')](_0x7c54('0xa'),auth[_0x7c54('0x8')](),controller[_0x7c54('0xe')]);router[_0x7c54('0xf')](_0x7c54('0x9'),auth[_0x7c54('0x8')](),controller[_0x7c54('0x10')]);router['delete'](_0x7c54('0x9'),auth[_0x7c54('0x8')](),controller[_0x7c54('0x11')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbd0=['sequelize','exports','STRING','BOOLEAN'];(function(_0x13c083,_0x5ba7f1){var _0xdc9a12=function(_0x4f2f4a){while(--_0x4f2f4a){_0x13c083['push'](_0x13c083['shift']());}};_0xdc9a12(++_0x5ba7f1);}(_0xdbd0,0x88));var _0x0dbd=function(_0x3fc0af,_0x87bf3a){_0x3fc0af=_0x3fc0af-0x0;var _0x19f17f=_0xdbd0[_0x3fc0af];return _0x19f17f;};'use strict';var Sequelize=require(_0x0dbd('0x0'));module[_0x0dbd('0x1')]={'name':{'type':Sequelize[_0x0dbd('0x2')]},'username':{'type':Sequelize[_0x0dbd('0x2')]},'password':{'type':Sequelize[_0x0dbd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x0dbd('0x2')]},'clientId':{'type':Sequelize[_0x0dbd('0x2')]},'clientSecret':{'type':Sequelize[_0x0dbd('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0dbd('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0dbd('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8085=['STRING','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8085,0x71));var _0x5808=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8085[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5808('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5808('0x1')]},'password':{'type':Sequelize[_0x5808('0x1')]},'remoteUri':{'type':Sequelize[_0x5808('0x1')]},'tenantId':{'type':Sequelize[_0x5808('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5808('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5808('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x959e=['Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','title','description','customerid','ownerid','subject','directioncode','accountidname','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','username','password','access_token','GET','Bearer\x20','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','error','test','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','OptionSet','false','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','limit','count','offset','set','Content-Range','json','update','destroy','then','end','sendStatus','stack','name','send','index','map','Dynamics365Account','key','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','model','keys','rawAttributes','include','find','create','body','findOne','order','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel'];(function(_0x258206,_0x22b992){var _0x3e87e1=function(_0x4f8f22){while(--_0x4f8f22){_0x258206['push'](_0x258206['shift']());}};_0x3e87e1(++_0x22b992);}(_0x959e,0x1e2));var _0xe959=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x959e[_0x1ccbcc];return _0x1e873f;};'use strict';var rp=require(_0xe959('0x0'));var util=require(_0xe959('0x1'));var _=require(_0xe959('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xe959('0x3'))(_0xe959('0x4'));var db=require(_0xe959('0x5'))['db'];var integrations=require(_0xe959('0x6'));function respondWithResult(_0x19c802,_0xec5f35){_0xec5f35=_0xec5f35||0xc8;return function(_0x58ecbf){if(_0x58ecbf){return _0x19c802[_0xe959('0x7')](_0xec5f35)['json'](_0x58ecbf);}};}function respondWithFilteredResult(_0x29a59a,_0xd2bb6e){return function(_0x2df805){if(_0x2df805){var _0x36fe93=typeof _0xd2bb6e['offset']==='undefined'&&typeof _0xd2bb6e[_0xe959('0x8')]==='undefined';var _0x4de475=_0x2df805[_0xe959('0x9')];var _0x264816=_0x36fe93?0x0:_0xd2bb6e[_0xe959('0xa')];var _0x507982=_0x36fe93?_0x2df805[_0xe959('0x9')]:_0xd2bb6e[_0xe959('0xa')]+_0xd2bb6e[_0xe959('0x8')];var _0x58ca1c;if(_0x507982>=_0x4de475){_0x507982=_0x4de475;_0x58ca1c=0xc8;}else{_0x58ca1c=0xce;}_0x29a59a[_0xe959('0x7')](_0x58ca1c);return _0x29a59a[_0xe959('0xb')](_0xe959('0xc'),_0x264816+'-'+_0x507982+'/'+_0x4de475)[_0xe959('0xd')](_0x2df805);}return null;};}function saveUpdates(_0x1fa963){return function(_0x5c7a12){if(_0x5c7a12){return _0x5c7a12[_0xe959('0xe')](_0x1fa963)['then'](function(_0x1f1e6f){return _0x1f1e6f;});}return null;};}function removeEntity(_0x5bd09e){return function(_0x468f60){if(_0x468f60){return _0x468f60[_0xe959('0xf')]()[_0xe959('0x10')](function(){_0x5bd09e[_0xe959('0x7')](0xcc)[_0xe959('0x11')]();});}};}function handleEntityNotFound(_0x3bd45f){return function(_0x16835a){if(!_0x16835a){_0x3bd45f[_0xe959('0x12')](0x194);}return _0x16835a;};}function handleError(_0x53d2e0,_0x58078c){_0x58078c=_0x58078c||0x1f4;return function(_0x1d56ad){logger['error'](_0x1d56ad[_0xe959('0x13')]);if(_0x1d56ad[_0xe959('0x14')]){delete _0x1d56ad[_0xe959('0x14')];}_0x53d2e0['status'](_0x58078c)[_0xe959('0x15')](_0x1d56ad);};}exports[_0xe959('0x16')]=function(_0x19d8d5,_0x5430bf){var _0x7cd26d={},_0x5ae319={},_0x299035={'count':0x0,'rows':[]};var _0xe499c7=_[_0xe959('0x17')](db[_0xe959('0x18')]['rawAttributes'],function(_0x463f24){return{'name':_0x463f24['fieldName'],'type':_0x463f24['type'][_0xe959('0x19')]};});_0x5ae319['model']=_['map'](_0xe499c7,_0xe959('0x14'));_0x5ae319[_0xe959('0x1a')]=_['keys'](_0x19d8d5[_0xe959('0x1a')]);_0x5ae319[_0xe959('0x1b')]=_['intersection'](_0x5ae319['model'],_0x5ae319['query']);_0x7cd26d['attributes']=_[_0xe959('0x1c')](_0x5ae319['model'],qs[_0xe959('0x1d')](_0x19d8d5[_0xe959('0x1a')][_0xe959('0x1d')]));_0x7cd26d['attributes']=_0x7cd26d[_0xe959('0x1e')][_0xe959('0x1f')]?_0x7cd26d[_0xe959('0x1e')]:_0x5ae319['model'];if(!_0x19d8d5[_0xe959('0x1a')][_0xe959('0x20')](_0xe959('0x21'))){_0x7cd26d[_0xe959('0x8')]=qs[_0xe959('0x8')](_0x19d8d5[_0xe959('0x1a')]['limit']);_0x7cd26d['offset']=qs[_0xe959('0xa')](_0x19d8d5[_0xe959('0x1a')][_0xe959('0xa')]);}_0x7cd26d['order']=qs[_0xe959('0x22')](_0x19d8d5[_0xe959('0x1a')][_0xe959('0x22')]);_0x7cd26d[_0xe959('0x23')]=qs[_0xe959('0x1b')](_['pick'](_0x19d8d5['query'],_0x5ae319[_0xe959('0x1b')]),_0xe499c7);if(_0x19d8d5['query'][_0xe959('0x24')]){_0x7cd26d[_0xe959('0x23')]=_[_0xe959('0x25')](_0x7cd26d[_0xe959('0x23')],{'$or':_[_0xe959('0x17')](_0xe499c7,function(_0x348f3a){if(_0x348f3a[_0xe959('0x26')]!=='VIRTUAL'){var _0x5612a6={};_0x5612a6[_0x348f3a[_0xe959('0x14')]]={'$like':'%'+_0x19d8d5[_0xe959('0x1a')][_0xe959('0x24')]+'%'};return _0x5612a6;}})});}_0x7cd26d=_[_0xe959('0x25')]({},_0x7cd26d,_0x19d8d5[_0xe959('0x27')]);var _0x3de0ba={'where':_0x7cd26d[_0xe959('0x23')]};return db[_0xe959('0x18')][_0xe959('0x9')](_0x3de0ba)['then'](function(_0x1d1376){_0x299035['count']=_0x1d1376;if(_0x19d8d5[_0xe959('0x1a')][_0xe959('0x28')]){_0x7cd26d['include']=[{'all':!![]}];}return db[_0xe959('0x18')][_0xe959('0x29')](_0x7cd26d);})[_0xe959('0x10')](function(_0x3d05ca){_0x299035[_0xe959('0x2a')]=_0x3d05ca;return _0x299035;})['then'](respondWithFilteredResult(_0x5430bf,_0x7cd26d))[_0xe959('0x2b')](handleError(_0x5430bf,null));};exports[_0xe959('0x2c')]=function(_0xff9199,_0x505fb4){var _0x5af3b0={'raw':![],'where':{'id':_0xff9199[_0xe959('0x2d')]['id']}},_0x11fe41={};_0x11fe41[_0xe959('0x2e')]=_[_0xe959('0x2f')](db[_0xe959('0x18')][_0xe959('0x30')]);_0x11fe41[_0xe959('0x1a')]=_[_0xe959('0x2f')](_0xff9199[_0xe959('0x1a')]);_0x11fe41['filters']=_[_0xe959('0x1c')](_0x11fe41[_0xe959('0x2e')],_0x11fe41[_0xe959('0x1a')]);_0x5af3b0[_0xe959('0x1e')]=_[_0xe959('0x1c')](_0x11fe41[_0xe959('0x2e')],qs['fields'](_0xff9199[_0xe959('0x1a')]['fields']));_0x5af3b0[_0xe959('0x1e')]=_0x5af3b0[_0xe959('0x1e')][_0xe959('0x1f')]?_0x5af3b0['attributes']:_0x11fe41[_0xe959('0x2e')];if(_0xff9199[_0xe959('0x1a')]['includeAll']){_0x5af3b0[_0xe959('0x31')]=[{'all':!![]}];}_0x5af3b0=_['merge']({},_0x5af3b0,_0xff9199[_0xe959('0x27')]);return db[_0xe959('0x18')][_0xe959('0x32')](_0x5af3b0)['then'](handleEntityNotFound(_0x505fb4,null))[_0xe959('0x10')](respondWithResult(_0x505fb4,null))[_0xe959('0x2b')](handleError(_0x505fb4,null));};exports[_0xe959('0x33')]=function(_0x1b729e,_0x3a1926){return db[_0xe959('0x18')][_0xe959('0x33')](_0x1b729e[_0xe959('0x34')],{})[_0xe959('0x10')](respondWithResult(_0x3a1926,0xc9))['catch'](handleError(_0x3a1926,null));};exports['update']=function(_0x256225,_0x291532){if(_0x256225[_0xe959('0x34')]['id']){delete _0x256225[_0xe959('0x34')]['id'];}return db[_0xe959('0x18')][_0xe959('0x32')]({'where':{'id':_0x256225[_0xe959('0x2d')]['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x291532,null))[_0xe959('0x10')](saveUpdates(_0x256225[_0xe959('0x34')],null))[_0xe959('0x10')](respondWithResult(_0x291532,null))[_0xe959('0x2b')](handleError(_0x291532,null));};exports[_0xe959('0xf')]=function(_0x563699,_0x28ba99){return db[_0xe959('0x18')][_0xe959('0x32')]({'where':{'id':_0x563699[_0xe959('0x2d')]['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x28ba99,null))['then'](removeEntity(_0x28ba99,null))['catch'](handleError(_0x28ba99,null));};exports['getConfigurations']=function(_0x159221,_0x219c23){var _0x30c760={};var _0x2bdf38={};var _0x3ea236;var _0x305191;return db[_0xe959('0x18')][_0xe959('0x35')]({'where':{'id':_0x159221[_0xe959('0x2d')]['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x219c23,null))[_0xe959('0x10')](function(_0x4ebacf){if(_0x4ebacf){_0x3ea236=_0x4ebacf;_0x2bdf38[_0xe959('0x2e')]=_['keys'](db['Dynamics365Configuration'][_0xe959('0x30')]);_0x2bdf38['query']=_[_0xe959('0x2f')](_0x159221[_0xe959('0x1a')]);_0x2bdf38['filters']=_[_0xe959('0x1c')](_0x2bdf38[_0xe959('0x2e')],_0x2bdf38[_0xe959('0x1a')]);_0x30c760[_0xe959('0x1e')]=_['intersection'](_0x2bdf38[_0xe959('0x2e')],qs['fields'](_0x159221[_0xe959('0x1a')][_0xe959('0x1d')]));_0x30c760['attributes']=_0x30c760[_0xe959('0x1e')][_0xe959('0x1f')]?_0x30c760[_0xe959('0x1e')]:_0x2bdf38[_0xe959('0x2e')];_0x30c760[_0xe959('0x36')]=qs[_0xe959('0x22')](_0x159221[_0xe959('0x1a')][_0xe959('0x22')]);_0x30c760[_0xe959('0x23')]=qs[_0xe959('0x1b')](_[_0xe959('0x37')](_0x159221[_0xe959('0x1a')],_0x2bdf38['filters']));if(_0x159221['query']['filter']){_0x30c760[_0xe959('0x23')]=_[_0xe959('0x25')](_0x30c760['where'],{'$or':_[_0xe959('0x17')](_0x30c760[_0xe959('0x1e')],function(_0xe78287){var _0x4b0088={};_0x4b0088[_0xe78287]={'$like':'%'+_0x159221['query']['filter']+'%'};return _0x4b0088;})});}_0x30c760=_['merge']({},_0x30c760,_0x159221['options']);return _0x3ea236[_0xe959('0x38')](_0x30c760);}})[_0xe959('0x10')](function(_0x1592e5){if(_0x1592e5){_0x305191=_0x1592e5[_0xe959('0x1f')];if(!_0x159221[_0xe959('0x1a')][_0xe959('0x20')](_0xe959('0x21'))){_0x30c760[_0xe959('0x8')]=qs[_0xe959('0x8')](_0x159221[_0xe959('0x1a')][_0xe959('0x8')]);_0x30c760[_0xe959('0xa')]=qs[_0xe959('0xa')](_0x159221['query']['offset']);}return _0x3ea236[_0xe959('0x38')](_0x30c760);}})[_0xe959('0x10')](function(_0x256b72){if(_0x256b72){return _0x256b72?{'count':_0x305191,'rows':_0x256b72}:null;}})['then'](respondWithResult(_0x219c23,null))['catch'](handleError(_0x219c23,null));};exports[_0xe959('0x39')]=function(_0x301917,_0x31c99c){if(_0x301917[_0xe959('0x34')]['id']){delete _0x301917[_0xe959('0x34')]['id'];}return db[_0xe959('0x18')][_0xe959('0x35')]({'where':{'id':_0x301917['params']['id']}})[_0xe959('0x10')](handleEntityNotFound(_0x31c99c,null))[_0xe959('0x10')](function(_0xfe6e34){if(_0xfe6e34){_0x301917[_0xe959('0x34')][_0xe959('0x3a')]=_0xfe6e34['id'];_0x301917[_0xe959('0x34')][_0xe959('0x3b')]=integrations[_0xe959('0x3c')](_0x301917[_0xe959('0x34')]['channel'],_0x301917[_0xe959('0x34')]['type']);_0x301917['body'][_0xe959('0x3d')]=integrations[_0xe959('0x3e')](_0x301917['body'][_0xe959('0x3f')],_0x301917[_0xe959('0x34')][_0xe959('0x26')]);return db[_0xe959('0x40')][_0xe959('0x33')](_0x301917['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0xe959('0x3b')},{'model':db[_0xe959('0x41')],'as':_0xe959('0x3d')}]});}return null;})[_0xe959('0x10')](respondWithResult(_0x31c99c,null))[_0xe959('0x2b')](handleError(_0x31c99c,null));};function sanitizeRemoteUri(_0x52dc46){var _0x1c529c=_0x52dc46[_0xe959('0x42')](-0x1);if(_0x1c529c==='/')return _0x52dc46['substring'](0x0,_0x52dc46[_0xe959('0x43')](_0x1c529c));return _0x52dc46;}function getWebApiUrl(_0x10af2d){return util['format'](_0xe959('0x44'),_0x10af2d);}exports[_0xe959('0x45')]=function(_0x4dec93,_0x2cfeca){var _0x4de8cd=_0x4dec93[_0xe959('0x1a')][_0xe959('0x46')];var _0x29e174=_0x4de8cd==='incident'?'Incident':'PhoneCall';var _0x222d97='';var _0x17e185='';var _0x56308e='';var _0x703af5='';var _0x2dd054='';var _0xa28d1d='';var _0x19db05='';var _0xe131d8='';var _0x70aa68=[_0xe959('0x47'),_0xe959('0x48'),_0xe959('0x49'),_0xe959('0x4a'),'caseorigincode',_0xe959('0x4b'),'phonenumber','regardingobjectid',_0xe959('0x4c'),'phonecall_activity_parties'];var _0x391863=[_0xe959('0x4d'),'accountidyominame','actualserviceunits','billedserviceunits',_0xe959('0x4e'),_0xe959('0x4f'),_0xe959('0x50'),'contractidname',_0xe959('0x51'),_0xe959('0x52'),'createdbyname',_0xe959('0x53'),'createdon',_0xe959('0x54'),_0xe959('0x55'),_0xe959('0x56'),'customeridtype',_0xe959('0x57'),_0xe959('0x58'),_0xe959('0x59'),'entityimage_timestamp',_0xe959('0x5a'),_0xe959('0x5b'),_0xe959('0x5c'),_0xe959('0x5d'),_0xe959('0x5e'),_0xe959('0x5f'),'influencescore',_0xe959('0x60'),_0xe959('0x61'),_0xe959('0x62'),_0xe959('0x63'),'modifiedbyexternalpartyyominame',_0xe959('0x64'),'modifiedbyyominame',_0xe959('0x65'),'modifiedonbehalfbyname',_0xe959('0x66'),_0xe959('0x67'),_0xe959('0x68'),_0xe959('0x69'),_0xe959('0x6a'),_0xe959('0x6b'),_0xe959('0x6c'),_0xe959('0x6d'),_0xe959('0x6e'),_0xe959('0x6f'),_0xe959('0x70'),_0xe959('0x71'),_0xe959('0x72'),_0xe959('0x73'),'productserialnumber',_0xe959('0x74'),_0xe959('0x75'),'responseby',_0xe959('0x76'),_0xe959('0x77'),'sentimentvalue','slainvokedidname','slaname','socialprofileidname',_0xe959('0x78'),_0xe959('0x79'),_0xe959('0x7a'),_0xe959('0x7b'),_0xe959('0x7c'),_0xe959('0x7d'),_0xe959('0x7e'),_0xe959('0x7f'),_0xe959('0x80')];var _0x400fad=_0x70aa68[_0xe959('0x81')](_0x391863);return db[_0xe959('0x18')]['findOne']({'where':{'id':_0x4dec93[_0xe959('0x2d')]['id']},'attributes':['id','username','password',_0xe959('0x82'),_0xe959('0x83'),_0xe959('0x84'),_0xe959('0x85'),_0xe959('0x86')],'include':[{'model':db[_0xe959('0x87')],'as':_0xe959('0x87'),'attributes':['id',_0xe959('0x88'),_0xe959('0x89')]}]})[_0xe959('0x10')](handleEntityNotFound(_0x2cfeca,null))[_0xe959('0x10')](function(_0x5afa59){if(_0x5afa59){if(_0x5afa59['modernAuthentication']){_0x5afa59['access_token']=_0x5afa59[_0xe959('0x87')][_0xe959('0x88')];_0xe131d8=sanitizeRemoteUri(_0x5afa59[_0xe959('0x87')]['data7']);_0x19db05=getWebApiUrl(_0xe131d8);return _0x5afa59;}_0xe131d8=sanitizeRemoteUri(_0x5afa59['remoteUri']);_0x19db05=getWebApiUrl(_0xe131d8);var _0x40ff76={'method':_0xe959('0x8a'),'uri':_0xe959('0x8b')+_0x5afa59[_0xe959('0x83')]+_0xe959('0x8c'),'form':{'client_id':_0x5afa59[_0xe959('0x84')],'resource':_0xe131d8,'username':_0x5afa59[_0xe959('0x8d')],'password':_0x5afa59[_0xe959('0x8e')],'grant_type':_0xe959('0x8e'),'client_secret':_0x5afa59[_0xe959('0x85')]},'json':!![]};return rp(_0x40ff76);}})['then'](function(_0x3dfb59){_0xa28d1d=_0x3dfb59[_0xe959('0x8f')];var _0x4aef81={'method':_0xe959('0x90'),'uri':encodeURI(_0x19db05+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x29e174+'\x27'),'headers':{'Authorization':_0xe959('0x91')+_0xa28d1d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4aef81);})[_0xe959('0x10')](function(_0x53394d){var _0x2fb93c=_0x53394d[_0xe959('0x92')][0x0];var _0x2f0c7f=_0x2fb93c[_0xe959('0x93')];var _0x4c8872={'method':'GET','uri':_0x19db05+'EntityDefinitions('+_0x2f0c7f+_0xe959('0x94'),'headers':{'Authorization':_0xe959('0x91')+_0xa28d1d,'If-None-Match':null,'OData-Version':_0xe959('0x95')},'json':!![]};return rp(_0x4c8872);})['then'](function(_0x256f73){_0x222d97=_0x256f73;_0x17e185=_0x222d97[_0xe959('0x96')];_0x17e185=_[_0xe959('0x97')](_0x17e185,function(_0x130a02){return!_0x400fad[_0xe959('0x98')](_0x130a02[_0xe959('0x99')]);});var _0xb2fd50=[];var _0x56b8cb=[];_0x17e185[_0xe959('0x9a')](function(_0x129413){if(_0x129413[_0xe959('0x9b')]){var _0x3a7044=_0x129413[_0xe959('0x9b')][_0xe959('0x9c')](_0x129413[_0xe959('0x9b')][_0xe959('0x43')]('.')+0x1);if(_0x3a7044==='PicklistAttributeMetadata'){_0xb2fd50['push'](getSelectList(_0x19db05,_0x4de8cd,_0x56b8cb,_0x222d97[_0xe959('0x93')],_0x129413[_0xe959('0x93')],_0xa28d1d));}}});return Promise['all'](_0xb2fd50);})['then'](function(_0xa2894d){_0x56308e=_0xa2894d[0x0];var _0x1a59cd=[];var _0x325362=[];_0x17e185['forEach'](function(_0x41a7ad){if(!_[_0xe959('0x9d')](_0x41a7ad[_0xe959('0x9b')])){var _0x261c54=_0x41a7ad['@odata.type'][_0xe959('0x9c')](_0x41a7ad[_0xe959('0x9b')][_0xe959('0x43')]('.')+0x1);if(_0x261c54===_0xe959('0x9e')){_0x1a59cd[_0xe959('0x9f')](getBooleanList(_0x19db05,_0x4de8cd,_0x325362,_0x222d97[_0xe959('0x93')],_0x41a7ad[_0xe959('0x93')],_0xa28d1d));}}});return Promise[_0xe959('0xa0')](_0x1a59cd);})[_0xe959('0x10')](function(_0x23d12e){_0x703af5=_0x23d12e[0x0];var _0x24337d=[];var _0x3d65ee=[];_0x17e185[_0xe959('0x9a')](function(_0x56d435){if(_0x56d435[_0xe959('0x9b')]){var _0x5a3d83=_0x56d435[_0xe959('0x9b')][_0xe959('0x9c')](_0x56d435[_0xe959('0x9b')][_0xe959('0x43')]('.')+0x1);if(_0x5a3d83===_0xe959('0xa1')||_0x5a3d83==='DoubleAttributeMetadata'||_0x5a3d83===_0xe959('0xa2')||_0x5a3d83===_0xe959('0xa3')||_0x5a3d83==='MemoAttributeMetadata'||_0x5a3d83==='DateTimeAttributeMetadata'||_0x5a3d83==='StatusAttributeMetadata'||_0x5a3d83===_0xe959('0xa4')||_0x5a3d83==='StateAttributeMetadata'||_0x5a3d83===_0xe959('0xa5')){_0x24337d[_0xe959('0x9f')](getInputList(_0x19db05,_0x4de8cd,_0x5a3d83,_0x3d65ee,_0x222d97[_0xe959('0x93')],_0x56d435[_0xe959('0x93')],_0xa28d1d));}}});return Promise[_0xe959('0xa0')](_0x24337d);})[_0xe959('0x10')](function(_0x4bfd40){_0x2dd054=_0x4bfd40[0x0];var _0x5519a5=_0x56308e[_0xe959('0x81')](_0x703af5)['concat'](_0x2dd054);var _0xcbe4f2={'count':_0x5519a5[_0xe959('0x1f')],'rows':_0x5519a5};return _0xcbe4f2;})['then'](respondWithResult(_0x2cfeca,null))['catch'](function(_0x1cf87c){var _0x2d41e7=_0x4dec93[_0xe959('0x1a')]['test']?0x1f4:_0x1cf87c[_0xe959('0xa6')]||0x1f4;logger[_0xe959('0xa7')](_0x1cf87c[_0xe959('0x13')]);delete _0x1cf87c[_0xe959('0x14')];if(_0x2d41e7===0x191){_0x2d41e7=0x190;}_0x2cfeca[_0xe959('0x7')](_0x2d41e7)['send'](_0x4dec93[_0xe959('0x1a')][_0xe959('0xa8')]?{'message':'Wrong\x20credentials','statusCode':_0x1cf87c['statusCode']}:_0x1cf87c);});};function getSelectList(_0xeb634d,_0x116017,_0x28b8cc,_0x474818,_0xd858b6,_0x1fbb9f){var _0x418391={'method':_0xe959('0x90'),'uri':_0xeb634d+_0xe959('0xa9')+_0x474818+')/Attributes('+_0xd858b6+_0xe959('0xaa')+_0xe959('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x1fbb9f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x418391)['then'](function(_0x564576){var _0x2cd72e=[];var _0x2200e2=_0x564576['OptionSet']['Options'];_0x2200e2[_0xe959('0x9a')](function(_0x4fe6de){_0x2cd72e[_0xe959('0x9f')]({'name':_0x4fe6de[_0xe959('0xac')]['UserLocalizedLabel'][_0xe959('0xac')],'value':String(_0x4fe6de[_0xe959('0xad')])});});var _0x1f2f8a={'id':_0x116017+'_'+_0x564576[_0xe959('0x99')],'name':_0x564576[_0xe959('0xae')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x2cd72e};_0x28b8cc[_0xe959('0x9f')](_0x1f2f8a);return _0x28b8cc;});}function getBooleanList(_0x20b8e6,_0x5a9d71,_0x2f86c2,_0x378c6d,_0x460dd7,_0x335437){var _0x18d23f={'method':_0xe959('0x90'),'uri':_0x20b8e6+_0xe959('0xa9')+_0x378c6d+_0xe959('0xaf')+_0x460dd7+_0xe959('0xb0'),'headers':{'Authorization':_0xe959('0x91')+_0x335437,'If-None-Match':null,'OData-Version':_0xe959('0x95')},'json':!![]};return rp(_0x18d23f)[_0xe959('0x10')](function(_0x2de441){var _0x1a7e33=[];_0x1a7e33[_0xe959('0x9f')]({'name':_0x2de441['OptionSet'][_0xe959('0xb1')][_0xe959('0xac')][_0xe959('0xb2')][_0xe959('0xac')],'value':_0xe959('0xb3')},{'name':_0x2de441[_0xe959('0xb4')]['FalseOption'][_0xe959('0xac')][_0xe959('0xb2')][_0xe959('0xac')],'value':_0xe959('0xb5')});var _0xf9682={'id':_0x5a9d71+'_'+_0x2de441[_0xe959('0x99')],'name':_0x2de441['DisplayName'][_0xe959('0xb2')][_0xe959('0xac')],'custom':![],'options':_0x1a7e33};_0x2f86c2[_0xe959('0x9f')](_0xf9682);return _0x2f86c2;});}function getInputList(_0x371898,_0x58776b,_0x381f24,_0x4ee9d6,_0x18f739,_0x5e190a,_0x1170b3){var _0x345ffc={'method':'GET','uri':_0x371898+'EntityDefinitions('+_0x18f739+_0xe959('0xaf')+_0x5e190a+')/Microsoft.Dynamics.CRM.'+_0x381f24+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xe959('0x91')+_0x1170b3,'If-None-Match':null,'OData-Version':_0xe959('0x95')},'json':!![]};return rp(_0x345ffc)[_0xe959('0x10')](function(_0x1ecc72){var _0x355a60={'id':_0x58776b+'_'+_0x1ecc72[_0xe959('0x99')],'name':_0x1ecc72[_0xe959('0xae')][_0xe959('0xb2')]?_0x1ecc72['DisplayName'][_0xe959('0xb2')]['Label']:_0x1ecc72[_0xe959('0x99')],'custom':![],'options':[]};_0x4ee9d6['push'](_0x355a60);return _0x4ee9d6;});}
\ No newline at end of file
+var _0xa6e1=['actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','tenantId','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','type','options','Dynamics365Account','includeAll','include','findAll','rows','catch','params','find','create','getConfigurations','findOne','Dynamics365Configuration','filter','hasOwnProperty','nolimit','addConfiguration','body','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6e1,0x12d));var _0x1a6e=function(_0x2f943e,_0xc5a074){_0x2f943e=_0x2f943e-0x0;var _0x36bdd7=_0xa6e1[_0x2f943e];return _0x36bdd7;};'use strict';var rp=require(_0x1a6e('0x0'));var util=require(_0x1a6e('0x1'));var _=require(_0x1a6e('0x2'));var qs=require(_0x1a6e('0x3'));var logger=require(_0x1a6e('0x4'))('api');var db=require(_0x1a6e('0x5'))['db'];var integrations=require(_0x1a6e('0x6'));function respondWithResult(_0x27dd9b,_0x2eb6bd){_0x2eb6bd=_0x2eb6bd||0xc8;return function(_0x468255){if(_0x468255){return _0x27dd9b['status'](_0x2eb6bd)[_0x1a6e('0x7')](_0x468255);}};}function respondWithFilteredResult(_0x456e34,_0x20df50){return function(_0x3b4a83){if(_0x3b4a83){var _0x4d2c6b=typeof _0x20df50[_0x1a6e('0x8')]===_0x1a6e('0x9')&&typeof _0x20df50[_0x1a6e('0xa')]===_0x1a6e('0x9');var _0xb3d3d4=_0x3b4a83[_0x1a6e('0xb')];var _0x1c73f6=_0x4d2c6b?0x0:_0x20df50[_0x1a6e('0x8')];var _0x320c94=_0x4d2c6b?_0x3b4a83[_0x1a6e('0xb')]:_0x20df50[_0x1a6e('0x8')]+_0x20df50['limit'];var _0x518457;if(_0x320c94>=_0xb3d3d4){_0x320c94=_0xb3d3d4;_0x518457=0xc8;}else{_0x518457=0xce;}_0x456e34[_0x1a6e('0xc')](_0x518457);return _0x456e34[_0x1a6e('0xd')](_0x1a6e('0xe'),_0x1c73f6+'-'+_0x320c94+'/'+_0xb3d3d4)[_0x1a6e('0x7')](_0x3b4a83);}return null;};}function saveUpdates(_0x2bf53a){return function(_0x33b67f){if(_0x33b67f){return _0x33b67f[_0x1a6e('0xf')](_0x2bf53a)[_0x1a6e('0x10')](function(_0x29bd4e){return _0x29bd4e;});}return null;};}function removeEntity(_0x553556){return function(_0x3dd3d9){if(_0x3dd3d9){return _0x3dd3d9[_0x1a6e('0x11')]()['then'](function(){_0x553556[_0x1a6e('0xc')](0xcc)[_0x1a6e('0x12')]();});}};}function handleEntityNotFound(_0x5117a8){return function(_0x4d08d5){if(!_0x4d08d5){_0x5117a8[_0x1a6e('0x13')](0x194);}return _0x4d08d5;};}function handleError(_0x21eb04,_0x1d9fe2){_0x1d9fe2=_0x1d9fe2||0x1f4;return function(_0x2a83a9){logger[_0x1a6e('0x14')](_0x2a83a9[_0x1a6e('0x15')]);if(_0x2a83a9[_0x1a6e('0x16')]){delete _0x2a83a9['name'];}_0x21eb04['status'](_0x1d9fe2)[_0x1a6e('0x17')](_0x2a83a9);};}exports[_0x1a6e('0x18')]=function(_0x4be991,_0x42d4b3){var _0x21049c={},_0x2007fb={},_0x1efea4={'count':0x0,'rows':[]};var _0x24f38b=_['map'](db['Dynamics365Account'][_0x1a6e('0x19')],function(_0x5e9e2f){return{'name':_0x5e9e2f[_0x1a6e('0x1a')],'type':_0x5e9e2f['type'][_0x1a6e('0x1b')]};});_0x2007fb[_0x1a6e('0x1c')]=_[_0x1a6e('0x1d')](_0x24f38b,'name');_0x2007fb[_0x1a6e('0x1e')]=_[_0x1a6e('0x1f')](_0x4be991[_0x1a6e('0x1e')]);_0x2007fb[_0x1a6e('0x20')]=_[_0x1a6e('0x21')](_0x2007fb['model'],_0x2007fb[_0x1a6e('0x1e')]);_0x21049c[_0x1a6e('0x22')]=_[_0x1a6e('0x21')](_0x2007fb[_0x1a6e('0x1c')],qs['fields'](_0x4be991['query'][_0x1a6e('0x23')]));_0x21049c[_0x1a6e('0x22')]=_0x21049c[_0x1a6e('0x22')][_0x1a6e('0x24')]?_0x21049c[_0x1a6e('0x22')]:_0x2007fb[_0x1a6e('0x1c')];if(!_0x4be991[_0x1a6e('0x1e')]['hasOwnProperty']('nolimit')){_0x21049c[_0x1a6e('0xa')]=qs[_0x1a6e('0xa')](_0x4be991[_0x1a6e('0x1e')][_0x1a6e('0xa')]);_0x21049c[_0x1a6e('0x8')]=qs[_0x1a6e('0x8')](_0x4be991[_0x1a6e('0x1e')]['offset']);}_0x21049c['order']=qs[_0x1a6e('0x25')](_0x4be991[_0x1a6e('0x1e')][_0x1a6e('0x25')]);_0x21049c[_0x1a6e('0x26')]=qs[_0x1a6e('0x20')](_[_0x1a6e('0x27')](_0x4be991[_0x1a6e('0x1e')],_0x2007fb['filters']),_0x24f38b);if(_0x4be991[_0x1a6e('0x1e')]['filter']){_0x21049c[_0x1a6e('0x26')]=_[_0x1a6e('0x28')](_0x21049c[_0x1a6e('0x26')],{'$or':_['map'](_0x24f38b,function(_0x17eb03){if(_0x17eb03[_0x1a6e('0x29')]!=='VIRTUAL'){var _0x47d8fe={};_0x47d8fe[_0x17eb03[_0x1a6e('0x16')]]={'$like':'%'+_0x4be991['query']['filter']+'%'};return _0x47d8fe;}})});}_0x21049c=_[_0x1a6e('0x28')]({},_0x21049c,_0x4be991[_0x1a6e('0x2a')]);var _0x4ca7bd={'where':_0x21049c[_0x1a6e('0x26')]};return db[_0x1a6e('0x2b')][_0x1a6e('0xb')](_0x4ca7bd)[_0x1a6e('0x10')](function(_0x486902){_0x1efea4[_0x1a6e('0xb')]=_0x486902;if(_0x4be991[_0x1a6e('0x1e')][_0x1a6e('0x2c')]){_0x21049c[_0x1a6e('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x1a6e('0x2e')](_0x21049c);})['then'](function(_0x8a12f6){_0x1efea4[_0x1a6e('0x2f')]=_0x8a12f6;return _0x1efea4;})[_0x1a6e('0x10')](respondWithFilteredResult(_0x42d4b3,_0x21049c))[_0x1a6e('0x30')](handleError(_0x42d4b3,null));};exports['show']=function(_0x18e6c9,_0x15fcd7){var _0x385902={'raw':![],'where':{'id':_0x18e6c9[_0x1a6e('0x31')]['id']}},_0x355408={};_0x355408[_0x1a6e('0x1c')]=_['keys'](db[_0x1a6e('0x2b')][_0x1a6e('0x19')]);_0x355408[_0x1a6e('0x1e')]=_['keys'](_0x18e6c9[_0x1a6e('0x1e')]);_0x355408['filters']=_['intersection'](_0x355408['model'],_0x355408[_0x1a6e('0x1e')]);_0x385902[_0x1a6e('0x22')]=_[_0x1a6e('0x21')](_0x355408[_0x1a6e('0x1c')],qs[_0x1a6e('0x23')](_0x18e6c9['query'][_0x1a6e('0x23')]));_0x385902['attributes']=_0x385902[_0x1a6e('0x22')][_0x1a6e('0x24')]?_0x385902[_0x1a6e('0x22')]:_0x355408[_0x1a6e('0x1c')];if(_0x18e6c9[_0x1a6e('0x1e')][_0x1a6e('0x2c')]){_0x385902[_0x1a6e('0x2d')]=[{'all':!![]}];}_0x385902=_[_0x1a6e('0x28')]({},_0x385902,_0x18e6c9[_0x1a6e('0x2a')]);return db[_0x1a6e('0x2b')][_0x1a6e('0x32')](_0x385902)[_0x1a6e('0x10')](handleEntityNotFound(_0x15fcd7,null))[_0x1a6e('0x10')](respondWithResult(_0x15fcd7,null))[_0x1a6e('0x30')](handleError(_0x15fcd7,null));};exports[_0x1a6e('0x33')]=function(_0x14564f,_0x21f56d){return db[_0x1a6e('0x2b')][_0x1a6e('0x33')](_0x14564f['body'],{})[_0x1a6e('0x10')](respondWithResult(_0x21f56d,0xc9))[_0x1a6e('0x30')](handleError(_0x21f56d,null));};exports[_0x1a6e('0xf')]=function(_0x6a2e01,_0x3e04cc){if(_0x6a2e01['body']['id']){delete _0x6a2e01['body']['id'];}return db[_0x1a6e('0x2b')][_0x1a6e('0x32')]({'where':{'id':_0x6a2e01[_0x1a6e('0x31')]['id']}})[_0x1a6e('0x10')](handleEntityNotFound(_0x3e04cc,null))['then'](saveUpdates(_0x6a2e01['body'],null))[_0x1a6e('0x10')](respondWithResult(_0x3e04cc,null))['catch'](handleError(_0x3e04cc,null));};exports[_0x1a6e('0x11')]=function(_0xfb9aff,_0x17b4c1){return db[_0x1a6e('0x2b')]['find']({'where':{'id':_0xfb9aff['params']['id']}})[_0x1a6e('0x10')](handleEntityNotFound(_0x17b4c1,null))[_0x1a6e('0x10')](removeEntity(_0x17b4c1,null))[_0x1a6e('0x30')](handleError(_0x17b4c1,null));};exports[_0x1a6e('0x34')]=function(_0x42ea75,_0x58d764){var _0x494f9b={};var _0x26502f={};var _0x56aa74;var _0x5cfa50;return db[_0x1a6e('0x2b')][_0x1a6e('0x35')]({'where':{'id':_0x42ea75[_0x1a6e('0x31')]['id']}})[_0x1a6e('0x10')](handleEntityNotFound(_0x58d764,null))[_0x1a6e('0x10')](function(_0x3a464a){if(_0x3a464a){_0x56aa74=_0x3a464a;_0x26502f['model']=_[_0x1a6e('0x1f')](db[_0x1a6e('0x36')]['rawAttributes']);_0x26502f['query']=_['keys'](_0x42ea75['query']);_0x26502f[_0x1a6e('0x20')]=_[_0x1a6e('0x21')](_0x26502f[_0x1a6e('0x1c')],_0x26502f[_0x1a6e('0x1e')]);_0x494f9b[_0x1a6e('0x22')]=_[_0x1a6e('0x21')](_0x26502f[_0x1a6e('0x1c')],qs[_0x1a6e('0x23')](_0x42ea75[_0x1a6e('0x1e')][_0x1a6e('0x23')]));_0x494f9b[_0x1a6e('0x22')]=_0x494f9b[_0x1a6e('0x22')][_0x1a6e('0x24')]?_0x494f9b[_0x1a6e('0x22')]:_0x26502f[_0x1a6e('0x1c')];_0x494f9b['order']=qs['sort'](_0x42ea75['query'][_0x1a6e('0x25')]);_0x494f9b['where']=qs[_0x1a6e('0x20')](_[_0x1a6e('0x27')](_0x42ea75[_0x1a6e('0x1e')],_0x26502f[_0x1a6e('0x20')]));if(_0x42ea75[_0x1a6e('0x1e')][_0x1a6e('0x37')]){_0x494f9b[_0x1a6e('0x26')]=_[_0x1a6e('0x28')](_0x494f9b[_0x1a6e('0x26')],{'$or':_[_0x1a6e('0x1d')](_0x494f9b[_0x1a6e('0x22')],function(_0x496c13){var _0x2f6c66={};_0x2f6c66[_0x496c13]={'$like':'%'+_0x42ea75[_0x1a6e('0x1e')][_0x1a6e('0x37')]+'%'};return _0x2f6c66;})});}_0x494f9b=_[_0x1a6e('0x28')]({},_0x494f9b,_0x42ea75['options']);return _0x56aa74['getConfigurations'](_0x494f9b);}})['then'](function(_0x539413){if(_0x539413){_0x5cfa50=_0x539413[_0x1a6e('0x24')];if(!_0x42ea75[_0x1a6e('0x1e')][_0x1a6e('0x38')](_0x1a6e('0x39'))){_0x494f9b[_0x1a6e('0xa')]=qs[_0x1a6e('0xa')](_0x42ea75['query'][_0x1a6e('0xa')]);_0x494f9b[_0x1a6e('0x8')]=qs[_0x1a6e('0x8')](_0x42ea75[_0x1a6e('0x1e')][_0x1a6e('0x8')]);}return _0x56aa74[_0x1a6e('0x34')](_0x494f9b);}})[_0x1a6e('0x10')](function(_0x2e302a){if(_0x2e302a){return _0x2e302a?{'count':_0x5cfa50,'rows':_0x2e302a}:null;}})[_0x1a6e('0x10')](respondWithResult(_0x58d764,null))[_0x1a6e('0x30')](handleError(_0x58d764,null));};exports[_0x1a6e('0x3a')]=function(_0x351555,_0x4a12e8){if(_0x351555[_0x1a6e('0x3b')]['id']){delete _0x351555['body']['id'];}return db[_0x1a6e('0x2b')][_0x1a6e('0x35')]({'where':{'id':_0x351555[_0x1a6e('0x31')]['id']}})[_0x1a6e('0x10')](handleEntityNotFound(_0x4a12e8,null))[_0x1a6e('0x10')](function(_0x18d27b){if(_0x18d27b){_0x351555['body'][_0x1a6e('0x3c')]=_0x18d27b['id'];_0x351555['body'][_0x1a6e('0x3d')]=integrations['getSubjects'](_0x351555['body'][_0x1a6e('0x3e')],_0x351555[_0x1a6e('0x3b')][_0x1a6e('0x29')]);_0x351555[_0x1a6e('0x3b')]['Descriptions']=integrations[_0x1a6e('0x3f')](_0x351555['body'][_0x1a6e('0x3e')],_0x351555[_0x1a6e('0x3b')][_0x1a6e('0x29')]);return db[_0x1a6e('0x36')]['create'](_0x351555[_0x1a6e('0x3b')],{'include':[{'model':db[_0x1a6e('0x40')],'as':_0x1a6e('0x3d')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x1a6e('0x10')](respondWithResult(_0x4a12e8,null))[_0x1a6e('0x30')](handleError(_0x4a12e8,null));};function sanitizeRemoteUri(_0xb68d75){var _0x1f7d8d=_0xb68d75['slice'](-0x1);if(_0x1f7d8d==='/')return _0xb68d75[_0x1a6e('0x41')](0x0,_0xb68d75[_0x1a6e('0x42')](_0x1f7d8d));return _0xb68d75;}function getWebApiUrl(_0x4a30ab){return util[_0x1a6e('0x43')](_0x1a6e('0x44'),_0x4a30ab);}exports[_0x1a6e('0x45')]=function(_0x51e8a8,_0x4f80b3){var _0x3d85aa=_0x51e8a8[_0x1a6e('0x1e')][_0x1a6e('0x46')];var _0x264917=_0x3d85aa===_0x1a6e('0x47')?_0x1a6e('0x48'):'PhoneCall';var _0x3cde56='';var _0x16e93f='';var _0x22e7ad='';var _0x4aa251='';var _0x1aefa4='';var _0x591d35='';var _0x420cd8='';var _0x27288d='';var _0x73826d=['title',_0x1a6e('0x49'),'customerid',_0x1a6e('0x4a'),_0x1a6e('0x4b'),_0x1a6e('0x4c'),_0x1a6e('0x4d'),_0x1a6e('0x4e'),_0x1a6e('0x4f'),_0x1a6e('0x50')];var _0x35ce0f=[_0x1a6e('0x51'),_0x1a6e('0x52'),_0x1a6e('0x53'),_0x1a6e('0x54'),'contactidname',_0x1a6e('0x55'),'contractdetailidname',_0x1a6e('0x56'),_0x1a6e('0x57'),_0x1a6e('0x58'),'createdbyname',_0x1a6e('0x59'),_0x1a6e('0x5a'),_0x1a6e('0x5b'),_0x1a6e('0x5c'),_0x1a6e('0x5d'),_0x1a6e('0x5e'),_0x1a6e('0x5f'),'emailaddress',_0x1a6e('0x60'),_0x1a6e('0x61'),_0x1a6e('0x62'),'escalatedon',_0x1a6e('0x63'),'firstresponsebykpiidname',_0x1a6e('0x64'),'importsequencenumber',_0x1a6e('0x65'),_0x1a6e('0x66'),_0x1a6e('0x67'),_0x1a6e('0x68'),_0x1a6e('0x69'),_0x1a6e('0x6a'),_0x1a6e('0x6b'),_0x1a6e('0x6c'),_0x1a6e('0x6d'),_0x1a6e('0x6e'),_0x1a6e('0x6f'),_0x1a6e('0x70'),_0x1a6e('0x71'),_0x1a6e('0x72'),'onholdtime','overriddencreatedon',_0x1a6e('0x73'),_0x1a6e('0x74'),'owneridyominame','parentcaseidname',_0x1a6e('0x75'),_0x1a6e('0x76'),_0x1a6e('0x77'),_0x1a6e('0x78'),'productserialnumber',_0x1a6e('0x79'),_0x1a6e('0x7a'),_0x1a6e('0x7b'),'responsiblecontactidname','responsiblecontactidyominame',_0x1a6e('0x7c'),_0x1a6e('0x7d'),_0x1a6e('0x7e'),'socialprofileidname',_0x1a6e('0x7f'),_0x1a6e('0x80'),_0x1a6e('0x81'),_0x1a6e('0x82'),_0x1a6e('0x83'),_0x1a6e('0x84'),_0x1a6e('0x85'),_0x1a6e('0x86'),_0x1a6e('0x87')];var _0x4e075c=_0x73826d['concat'](_0x35ce0f);return db[_0x1a6e('0x2b')]['findOne']({'where':{'id':_0x51e8a8[_0x1a6e('0x31')]['id']},'attributes':['id',_0x1a6e('0x88'),_0x1a6e('0x89'),_0x1a6e('0x8a'),'tenantId',_0x1a6e('0x8b'),_0x1a6e('0x8c'),_0x1a6e('0x8d')],'include':[{'model':db[_0x1a6e('0x8e')],'as':'CloudProvider','attributes':['id',_0x1a6e('0x8f'),_0x1a6e('0x90')]}]})[_0x1a6e('0x10')](handleEntityNotFound(_0x4f80b3,null))[_0x1a6e('0x10')](function(_0x576b09){if(_0x576b09){if(_0x576b09[_0x1a6e('0x8d')]){_0x576b09[_0x1a6e('0x91')]=_0x576b09[_0x1a6e('0x8e')][_0x1a6e('0x8f')];_0x27288d=sanitizeRemoteUri(_0x576b09[_0x1a6e('0x8e')]['data7']);_0x420cd8=getWebApiUrl(_0x27288d);return _0x576b09;}_0x27288d=sanitizeRemoteUri(_0x576b09[_0x1a6e('0x8a')]);_0x420cd8=getWebApiUrl(_0x27288d);var _0x37bca9={'method':_0x1a6e('0x92'),'uri':_0x1a6e('0x93')+_0x576b09[_0x1a6e('0x94')]+'/oauth2/token','form':{'client_id':_0x576b09[_0x1a6e('0x8b')],'resource':_0x27288d,'username':_0x576b09['username'],'password':_0x576b09[_0x1a6e('0x89')],'grant_type':'password','client_secret':_0x576b09['clientSecret']},'json':!![]};return rp(_0x37bca9);}})[_0x1a6e('0x10')](function(_0x869cc8){_0x591d35=_0x869cc8[_0x1a6e('0x91')];var _0x105261={'method':'GET','uri':encodeURI(_0x420cd8+_0x1a6e('0x95')+_0x264917+'\x27'),'headers':{'Authorization':_0x1a6e('0x96')+_0x591d35,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x105261);})[_0x1a6e('0x10')](function(_0x415631){var _0x30c81e=_0x415631[_0x1a6e('0x97')][0x0];var _0x1295f9=_0x30c81e[_0x1a6e('0x98')];var _0x42e942={'method':_0x1a6e('0x99'),'uri':_0x420cd8+_0x1a6e('0x9a')+_0x1295f9+_0x1a6e('0x9b'),'headers':{'Authorization':_0x1a6e('0x96')+_0x591d35,'If-None-Match':null,'OData-Version':_0x1a6e('0x9c')},'json':!![]};return rp(_0x42e942);})['then'](function(_0x192237){_0x3cde56=_0x192237;_0x16e93f=_0x3cde56[_0x1a6e('0x9d')];_0x16e93f=_[_0x1a6e('0x9e')](_0x16e93f,function(_0xb41feb){return!_0x4e075c[_0x1a6e('0x9f')](_0xb41feb['LogicalName']);});var _0x55e6dc=[];var _0x43209f=[];_0x16e93f[_0x1a6e('0xa0')](function(_0x55c7fc){if(_0x55c7fc[_0x1a6e('0xa1')]){var _0xbdef6e=_0x55c7fc[_0x1a6e('0xa1')]['substring'](_0x55c7fc['@odata.type'][_0x1a6e('0x42')]('.')+0x1);if(_0xbdef6e===_0x1a6e('0xa2')){_0x55e6dc['push'](getSelectList(_0x420cd8,_0x3d85aa,_0x43209f,_0x3cde56[_0x1a6e('0x98')],_0x55c7fc[_0x1a6e('0x98')],_0x591d35));}}});return Promise[_0x1a6e('0xa3')](_0x55e6dc);})['then'](function(_0x236638){_0x22e7ad=_0x236638[0x0];var _0x552f52=[];var _0x2147f5=[];_0x16e93f[_0x1a6e('0xa0')](function(_0x532a69){if(!_[_0x1a6e('0xa4')](_0x532a69[_0x1a6e('0xa1')])){var _0x13a90e=_0x532a69[_0x1a6e('0xa1')][_0x1a6e('0x41')](_0x532a69[_0x1a6e('0xa1')]['lastIndexOf']('.')+0x1);if(_0x13a90e===_0x1a6e('0xa5')){_0x552f52[_0x1a6e('0xa6')](getBooleanList(_0x420cd8,_0x3d85aa,_0x2147f5,_0x3cde56[_0x1a6e('0x98')],_0x532a69[_0x1a6e('0x98')],_0x591d35));}}});return Promise[_0x1a6e('0xa3')](_0x552f52);})[_0x1a6e('0x10')](function(_0x4c2c39){_0x4aa251=_0x4c2c39[0x0];var _0x526f28=[];var _0x35f902=[];_0x16e93f['forEach'](function(_0x1a1012){if(_0x1a1012[_0x1a6e('0xa1')]){var _0x50efcf=_0x1a1012[_0x1a6e('0xa1')]['substring'](_0x1a1012[_0x1a6e('0xa1')][_0x1a6e('0x42')]('.')+0x1);if(_0x50efcf==='StringAttributeMetadata'||_0x50efcf==='DoubleAttributeMetadata'||_0x50efcf==='BigIntAttributeMetadata'||_0x50efcf===_0x1a6e('0xa7')||_0x50efcf==='MemoAttributeMetadata'||_0x50efcf===_0x1a6e('0xa8')||_0x50efcf===_0x1a6e('0xa9')||_0x50efcf===_0x1a6e('0xaa')||_0x50efcf===_0x1a6e('0xab')||_0x50efcf===_0x1a6e('0xac')){_0x526f28[_0x1a6e('0xa6')](getInputList(_0x420cd8,_0x3d85aa,_0x50efcf,_0x35f902,_0x3cde56[_0x1a6e('0x98')],_0x1a1012[_0x1a6e('0x98')],_0x591d35));}}});return Promise[_0x1a6e('0xa3')](_0x526f28);})['then'](function(_0x1cb273){_0x1aefa4=_0x1cb273[0x0];var _0x19de91=_0x22e7ad[_0x1a6e('0xad')](_0x4aa251)['concat'](_0x1aefa4);var _0x3ffc53={'count':_0x19de91['length'],'rows':_0x19de91};return _0x3ffc53;})[_0x1a6e('0x10')](respondWithResult(_0x4f80b3,null))[_0x1a6e('0x30')](function(_0x53de9a){var _0x2669a4=_0x51e8a8[_0x1a6e('0x1e')][_0x1a6e('0xae')]?0x1f4:_0x53de9a[_0x1a6e('0xaf')]||0x1f4;logger['error'](_0x53de9a['stack']);delete _0x53de9a[_0x1a6e('0x16')];if(_0x2669a4===0x191){_0x2669a4=0x190;}_0x4f80b3[_0x1a6e('0xc')](_0x2669a4)[_0x1a6e('0x17')](_0x51e8a8[_0x1a6e('0x1e')][_0x1a6e('0xae')]?{'message':_0x1a6e('0xb0'),'statusCode':_0x53de9a[_0x1a6e('0xaf')]}:_0x53de9a);});};function getSelectList(_0xdc870e,_0x1d630c,_0xf396c0,_0x9fa2bb,_0x108ef4,_0x482d8){var _0x1ee102={'method':_0x1a6e('0x99'),'uri':_0xdc870e+_0x1a6e('0x9a')+_0x9fa2bb+_0x1a6e('0xb1')+_0x108ef4+_0x1a6e('0xb2')+_0x1a6e('0xb3'),'headers':{'Authorization':_0x1a6e('0x96')+_0x482d8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1ee102)[_0x1a6e('0x10')](function(_0x3fb90d){var _0x1471cb=[];var _0x17205e=_0x3fb90d['OptionSet']['Options'];_0x17205e[_0x1a6e('0xa0')](function(_0xba5349){_0x1471cb[_0x1a6e('0xa6')]({'name':_0xba5349[_0x1a6e('0xb4')][_0x1a6e('0xb5')]['Label'],'value':String(_0xba5349[_0x1a6e('0xb6')])});});var _0x1162ea={'id':_0x1d630c+'_'+_0x3fb90d[_0x1a6e('0xb7')],'name':_0x3fb90d[_0x1a6e('0xb8')][_0x1a6e('0xb5')][_0x1a6e('0xb4')],'custom':![],'options':_0x1471cb};_0xf396c0[_0x1a6e('0xa6')](_0x1162ea);return _0xf396c0;});}function getBooleanList(_0x150820,_0x147cfc,_0x220de6,_0x1efa4a,_0x36bcf9,_0x55c962){var _0x1db72f={'method':'GET','uri':_0x150820+'EntityDefinitions('+_0x1efa4a+_0x1a6e('0xb1')+_0x36bcf9+_0x1a6e('0xb9'),'headers':{'Authorization':_0x1a6e('0x96')+_0x55c962,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1db72f)[_0x1a6e('0x10')](function(_0x21712d){var _0x49a4ec=[];_0x49a4ec[_0x1a6e('0xa6')]({'name':_0x21712d['OptionSet'][_0x1a6e('0xba')]['Label'][_0x1a6e('0xb5')][_0x1a6e('0xb4')],'value':'true'},{'name':_0x21712d[_0x1a6e('0xbb')][_0x1a6e('0xbc')][_0x1a6e('0xb4')][_0x1a6e('0xb5')][_0x1a6e('0xb4')],'value':_0x1a6e('0xbd')});var _0x1a3697={'id':_0x147cfc+'_'+_0x21712d[_0x1a6e('0xb7')],'name':_0x21712d[_0x1a6e('0xb8')][_0x1a6e('0xb5')][_0x1a6e('0xb4')],'custom':![],'options':_0x49a4ec};_0x220de6[_0x1a6e('0xa6')](_0x1a3697);return _0x220de6;});}function getInputList(_0x118391,_0x222c4f,_0x22e63f,_0x345e12,_0x21c878,_0x3d0d65,_0x4d79fd){var _0x5693d0={'method':_0x1a6e('0x99'),'uri':_0x118391+_0x1a6e('0x9a')+_0x21c878+_0x1a6e('0xb1')+_0x3d0d65+_0x1a6e('0xbe')+_0x22e63f+_0x1a6e('0xbf'),'headers':{'Authorization':_0x1a6e('0x96')+_0x4d79fd,'If-None-Match':null,'OData-Version':_0x1a6e('0x9c')},'json':!![]};return rp(_0x5693d0)[_0x1a6e('0x10')](function(_0x3e6eb5){var _0x348b24={'id':_0x222c4f+'_'+_0x3e6eb5[_0x1a6e('0xb7')],'name':_0x3e6eb5[_0x1a6e('0xb8')][_0x1a6e('0xb5')]?_0x3e6eb5[_0x1a6e('0xb8')]['UserLocalizedLabel'][_0x1a6e('0xb4')]:_0x3e6eb5['LogicalName'],'custom':![],'options':[]};_0x345e12[_0x1a6e('0xa6')](_0x348b24);return _0x345e12;});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x336ab8,_0x1af16e){var _0x23df86=function(_0x179d59){while(--_0x179d59){_0x336ab8['push'](_0x336ab8['shift']());}};_0x23df86(++_0x1af16e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xcb91[_0x280ae7];return _0x418b9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1caf16,_0x1c68c9){var _0xf15157=function(_0x36690f){while(--_0x36690f){_0x1caf16['push'](_0x1caf16['shift']());}};_0xf15157(++_0x1c68c9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x826d=['map','model','attributes','stringify','ShowDynamics365Account','Dynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','Dynamics365Account,\x20%s,\x20%s','catch','GetDynamics365Account','findAll','options','raw','limit','include'];(function(_0x496023,_0x57f3ee){var _0x31403c=function(_0xf53c70){while(--_0xf53c70){_0x496023['push'](_0x496023['shift']());}};_0x31403c(++_0x57f3ee);}(_0x826d,0x1dc));var _0xd826=function(_0x39a3f4,_0x7f4ae8){_0x39a3f4=_0x39a3f4-0x0;var _0x4a894d=_0x826d[_0x39a3f4];return _0x4a894d;};'use strict';var _=require(_0xd826('0x0'));var util=require(_0xd826('0x1'));var moment=require(_0xd826('0x2'));var BPromise=require(_0xd826('0x3'));var rs=require(_0xd826('0x4'));var fs=require('fs');var Redis=require(_0xd826('0x5'));var db=require(_0xd826('0x6'))['db'];var utils=require(_0xd826('0x7'));var logger=require(_0xd826('0x8'))('rpc');var config=require(_0xd826('0x9'));var jayson=require(_0xd826('0xa'));var client=jayson[_0xd826('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51deff,_0x2d53e1,_0x239f9f){return new BPromise(function(_0x18598e,_0x4e8f29){return client[_0xd826('0xc')](_0x51deff,_0x239f9f)[_0xd826('0xd')](function(_0x3e6612){logger[_0xd826('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2d53e1,_0xd826('0xf'));logger[_0xd826('0x10')](_0xd826('0x11'),_0x2d53e1,_0xd826('0xf'),JSON['stringify'](_0x3e6612));if(_0x3e6612[_0xd826('0x12')]){if(_0x3e6612['error']['code']===0x1f4){logger[_0xd826('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2d53e1,_0x3e6612[_0xd826('0x12')]['message']);return _0x4e8f29(_0x3e6612['error'][_0xd826('0x13')]);}logger[_0xd826('0x12')](_0xd826('0x14'),_0x2d53e1,_0x3e6612[_0xd826('0x12')][_0xd826('0x13')]);return _0x18598e(_0x3e6612[_0xd826('0x12')][_0xd826('0x13')]);}else{logger[_0xd826('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x2d53e1,_0xd826('0xf'));_0x18598e(_0x3e6612['result']['message']);}})[_0xd826('0x15')](function(_0x28b4b9){logger[_0xd826('0x12')](_0xd826('0x14'),_0x2d53e1,_0x28b4b9);_0x4e8f29(_0x28b4b9);});});}exports[_0xd826('0x16')]=function(_0x369d2e){var _0x20f3cc=this;return new Promise(function(_0x479530,_0x592818){return db['Dynamics365Account'][_0xd826('0x17')]({'raw':_0x369d2e['options']?_0x369d2e[_0xd826('0x18')][_0xd826('0x19')]===undefined?!![]:![]:!![],'where':_0x369d2e[_0xd826('0x18')]?_0x369d2e['options']['where']||null:null,'attributes':_0x369d2e[_0xd826('0x18')]?_0x369d2e[_0xd826('0x18')]['attributes']||null:null,'limit':_0x369d2e[_0xd826('0x18')]?_0x369d2e[_0xd826('0x18')][_0xd826('0x1a')]||null:null,'include':_0x369d2e[_0xd826('0x18')]?_0x369d2e[_0xd826('0x18')][_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x369d2e['options']['include'],function(_0x5457b7){return{'model':db[_0x5457b7[_0xd826('0x1d')]],'as':_0x5457b7['as'],'attributes':_0x5457b7['attributes'],'include':_0x5457b7[_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x5457b7[_0xd826('0x1b')],function(_0x35df1e){return{'model':db[_0x35df1e['model']],'as':_0x35df1e['as'],'attributes':_0x35df1e['attributes'],'include':_0x35df1e[_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x35df1e[_0xd826('0x1b')],function(_0x2a9b6f){return{'model':db[_0x2a9b6f['model']],'as':_0x2a9b6f['as'],'attributes':_0x2a9b6f[_0xd826('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4767fc){logger[_0xd826('0xe')]('GetDynamics365Account',_0x369d2e);logger[_0xd826('0x10')](_0xd826('0x16'),_0x369d2e,JSON[_0xd826('0x1f')](_0x4767fc));_0x479530(_0x4767fc);})['catch'](function(_0x1d5a23){logger[_0xd826('0x12')](_0xd826('0x16'),_0x1d5a23['message'],_0x369d2e);_0x592818(_0x20f3cc[_0xd826('0x12')](0x1f4,_0x1d5a23['message']));});});};exports[_0xd826('0x20')]=function(_0x576692){var _0x1b3e73=this;return new Promise(function(_0x33f30f,_0x31262d){return db[_0xd826('0x21')][_0xd826('0x22')]({'raw':_0x576692[_0xd826('0x18')]?_0x576692[_0xd826('0x18')][_0xd826('0x19')]===undefined?!![]:![]:!![],'where':_0x576692[_0xd826('0x18')]?_0x576692['options'][_0xd826('0x23')]||null:null,'attributes':_0x576692[_0xd826('0x18')]?_0x576692['options'][_0xd826('0x1e')]||null:null,'include':_0x576692[_0xd826('0x18')]?_0x576692[_0xd826('0x18')][_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x576692[_0xd826('0x18')]['include'],function(_0x21b98a){return{'model':db[_0x21b98a[_0xd826('0x1d')]],'as':_0x21b98a['as'],'attributes':_0x21b98a[_0xd826('0x1e')],'include':_0x21b98a[_0xd826('0x1b')]?_[_0xd826('0x1c')](_0x21b98a['include'],function(_0x58c058){return{'model':db[_0x58c058['model']],'as':_0x58c058['as'],'attributes':_0x58c058[_0xd826('0x1e')],'include':_0x58c058['include']?_[_0xd826('0x1c')](_0x58c058[_0xd826('0x1b')],function(_0x349c6a){return{'model':db[_0x349c6a[_0xd826('0x1d')]],'as':_0x349c6a['as'],'attributes':_0x349c6a[_0xd826('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd826('0xd')](function(_0x4b5033){logger[_0xd826('0xe')]('ShowDynamics365Account',_0x576692);logger[_0xd826('0x10')](_0xd826('0x20'),_0x576692,JSON[_0xd826('0x1f')](_0x4b5033));_0x33f30f(_0x4b5033);})[_0xd826('0x15')](function(_0x59881e){logger[_0xd826('0x12')](_0xd826('0x20'),_0x59881e[_0xd826('0x13')],_0x576692);_0x31262d(_0x1b3e73[_0xd826('0x12')](0x1f4,_0x59881e[_0xd826('0x13')]));});});};
\ No newline at end of file
+var _0x1fa9=['error','code','message','info','result','GetDynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','then','catch','ShowDynamics365Account','Dynamics365Account','find','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15107c,_0x36a23f){var _0x532ac0=function(_0x292471){while(--_0x292471){_0x15107c['push'](_0x15107c['shift']());}};_0x532ac0(++_0x36a23f);}(_0x1fa9,0xa9));var _0x91fa=function(_0x21846c,_0x117e1c){_0x21846c=_0x21846c-0x0;var _0x2eecd1=_0x1fa9[_0x21846c];return _0x2eecd1;};'use strict';var _=require(_0x91fa('0x0'));var util=require(_0x91fa('0x1'));var moment=require(_0x91fa('0x2'));var BPromise=require(_0x91fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91fa('0x5'))(_0x91fa('0x6'));var config=require(_0x91fa('0x7'));var jayson=require(_0x91fa('0x8'));var client=jayson[_0x91fa('0x9')][_0x91fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b5372,_0xb0fe81,_0x52e0d4){return new BPromise(function(_0x341726,_0x5029eb){return client[_0x91fa('0xb')](_0x2b5372,_0x52e0d4)['then'](function(_0x1330ca){logger['info'](_0x91fa('0xc'),_0xb0fe81,_0x91fa('0xd'));logger['debug'](_0x91fa('0xe'),_0xb0fe81,'request\x20sent',JSON[_0x91fa('0xf')](_0x1330ca));if(_0x1330ca[_0x91fa('0x10')]){if(_0x1330ca['error'][_0x91fa('0x11')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xb0fe81,_0x1330ca[_0x91fa('0x10')][_0x91fa('0x12')]);return _0x5029eb(_0x1330ca[_0x91fa('0x10')][_0x91fa('0x12')]);}logger['error'](_0x91fa('0xc'),_0xb0fe81,_0x1330ca[_0x91fa('0x10')][_0x91fa('0x12')]);return _0x341726(_0x1330ca[_0x91fa('0x10')]['message']);}else{logger[_0x91fa('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0xb0fe81,_0x91fa('0xd'));_0x341726(_0x1330ca[_0x91fa('0x14')][_0x91fa('0x12')]);}})['catch'](function(_0x79ce13){logger[_0x91fa('0x10')](_0x91fa('0xc'),_0xb0fe81,_0x79ce13);_0x5029eb(_0x79ce13);});});}exports[_0x91fa('0x15')]=function(_0x376f29){var _0x1a215f=this;return new Promise(function(_0x2c1bd7,_0x44049b){return db['Dynamics365Account'][_0x91fa('0x16')]({'raw':_0x376f29[_0x91fa('0x17')]?_0x376f29['options'][_0x91fa('0x18')]===undefined?!![]:![]:!![],'where':_0x376f29[_0x91fa('0x17')]?_0x376f29[_0x91fa('0x17')][_0x91fa('0x19')]||null:null,'attributes':_0x376f29[_0x91fa('0x17')]?_0x376f29[_0x91fa('0x17')]['attributes']||null:null,'limit':_0x376f29['options']?_0x376f29[_0x91fa('0x17')][_0x91fa('0x1a')]||null:null,'include':_0x376f29[_0x91fa('0x17')]?_0x376f29[_0x91fa('0x17')][_0x91fa('0x1b')]?_[_0x91fa('0x1c')](_0x376f29['options'][_0x91fa('0x1b')],function(_0xbdc67b){return{'model':db[_0xbdc67b[_0x91fa('0x1d')]],'as':_0xbdc67b['as'],'attributes':_0xbdc67b['attributes'],'include':_0xbdc67b[_0x91fa('0x1b')]?_['map'](_0xbdc67b[_0x91fa('0x1b')],function(_0x53a575){return{'model':db[_0x53a575[_0x91fa('0x1d')]],'as':_0x53a575['as'],'attributes':_0x53a575['attributes'],'include':_0x53a575[_0x91fa('0x1b')]?_['map'](_0x53a575[_0x91fa('0x1b')],function(_0xb6ec15){return{'model':db[_0xb6ec15[_0x91fa('0x1d')]],'as':_0xb6ec15['as'],'attributes':_0xb6ec15[_0x91fa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x91fa('0x1f')](function(_0xb3a8da){logger[_0x91fa('0x13')](_0x91fa('0x15'),_0x376f29);logger['debug'](_0x91fa('0x15'),_0x376f29,JSON[_0x91fa('0xf')](_0xb3a8da));_0x2c1bd7(_0xb3a8da);})[_0x91fa('0x20')](function(_0x279e25){logger[_0x91fa('0x10')](_0x91fa('0x15'),_0x279e25[_0x91fa('0x12')],_0x376f29);_0x44049b(_0x1a215f[_0x91fa('0x10')](0x1f4,_0x279e25[_0x91fa('0x12')]));});});};exports[_0x91fa('0x21')]=function(_0x3b80d1){var _0x2e8a5d=this;return new Promise(function(_0x355c4a,_0x4f4f2c){return db[_0x91fa('0x22')][_0x91fa('0x23')]({'raw':_0x3b80d1[_0x91fa('0x17')]?_0x3b80d1[_0x91fa('0x17')][_0x91fa('0x18')]===undefined?!![]:![]:!![],'where':_0x3b80d1[_0x91fa('0x17')]?_0x3b80d1['options'][_0x91fa('0x19')]||null:null,'attributes':_0x3b80d1['options']?_0x3b80d1['options'][_0x91fa('0x1e')]||null:null,'include':_0x3b80d1[_0x91fa('0x17')]?_0x3b80d1[_0x91fa('0x17')][_0x91fa('0x1b')]?_[_0x91fa('0x1c')](_0x3b80d1[_0x91fa('0x17')][_0x91fa('0x1b')],function(_0x5f11e8){return{'model':db[_0x5f11e8[_0x91fa('0x1d')]],'as':_0x5f11e8['as'],'attributes':_0x5f11e8[_0x91fa('0x1e')],'include':_0x5f11e8[_0x91fa('0x1b')]?_['map'](_0x5f11e8['include'],function(_0x3153f9){return{'model':db[_0x3153f9['model']],'as':_0x3153f9['as'],'attributes':_0x3153f9[_0x91fa('0x1e')],'include':_0x3153f9[_0x91fa('0x1b')]?_[_0x91fa('0x1c')](_0x3153f9[_0x91fa('0x1b')],function(_0x45d9b7){return{'model':db[_0x45d9b7['model']],'as':_0x45d9b7['as'],'attributes':_0x45d9b7[_0x91fa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x91fa('0x1f')](function(_0x5d0d73){logger['info'](_0x91fa('0x21'),_0x3b80d1);logger[_0x91fa('0x24')]('ShowDynamics365Account',_0x3b80d1,JSON[_0x91fa('0xf')](_0x5d0d73));_0x355c4a(_0x5d0d73);})[_0x91fa('0x20')](function(_0x33725b){logger[_0x91fa('0x10')]('ShowDynamics365Account',_0x33725b['message'],_0x3b80d1);_0x4f4f2c(_0x2e8a5d[_0x91fa('0x10')](0x1f4,_0x33725b[_0x91fa('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f08=['get','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x4f08,0x194));var _0x84f0=function(_0x3adf13,_0x33a98e){_0x3adf13=_0x3adf13-0x0;var _0xc80a8c=_0x4f08[_0x3adf13];return _0xc80a8c;};'use strict';var multer=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var path=require('path');var timeout=require(_0x84f0('0x2'));var express=require(_0x84f0('0x3'));var router=express['Router']();var fs_extra=require(_0x84f0('0x4'));var auth=require(_0x84f0('0x5'));var interaction=require(_0x84f0('0x6'));var config=require('../../config/environment');var controller=require(_0x84f0('0x7'));router['get']('/',auth[_0x84f0('0x8')](),controller[_0x84f0('0x9')]);router[_0x84f0('0xa')]('/:id',auth[_0x84f0('0x8')](),controller[_0x84f0('0xb')]);router[_0x84f0('0xa')](_0x84f0('0xc'),auth[_0x84f0('0x8')](),controller[_0x84f0('0xd')]);router['get']('/:id/subjects',auth[_0x84f0('0x8')](),controller[_0x84f0('0xe')]);router[_0x84f0('0xa')](_0x84f0('0xf'),auth[_0x84f0('0x8')](),controller[_0x84f0('0x10')]);router[_0x84f0('0x11')]('/',auth[_0x84f0('0x8')](),controller[_0x84f0('0x12')]);router['put'](_0x84f0('0x13'),auth['isAuthenticated'](),controller[_0x84f0('0x14')]);router['delete'](_0x84f0('0x13'),auth[_0x84f0('0x8')](),controller[_0x84f0('0x15')]);module[_0x84f0('0x16')]=router;
\ No newline at end of file
+var _0xc021=['./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5660c2,_0x27a453){var _0x59d3da=function(_0x27ad41){while(--_0x27ad41){_0x5660c2['push'](_0x5660c2['shift']());}};_0x59d3da(++_0x27a453);}(_0xc021,0x19b));var _0x1c02=function(_0x5a073b,_0x510954){_0x5a073b=_0x5a073b-0x0;var _0x28ea69=_0xc021[_0x5a073b];return _0x28ea69;};'use strict';var multer=require(_0x1c02('0x0'));var util=require(_0x1c02('0x1'));var path=require(_0x1c02('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c02('0x3'));var router=express[_0x1c02('0x4')]();var fs_extra=require(_0x1c02('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c02('0x6'));var config=require('../../config/environment');var controller=require(_0x1c02('0x7'));router[_0x1c02('0x8')]('/',auth[_0x1c02('0x9')](),controller[_0x1c02('0xa')]);router[_0x1c02('0x8')](_0x1c02('0xb'),auth[_0x1c02('0x9')](),controller[_0x1c02('0xc')]);router[_0x1c02('0x8')]('/:id/fields',auth[_0x1c02('0x9')](),controller['getFields']);router[_0x1c02('0x8')](_0x1c02('0xd'),auth[_0x1c02('0x9')](),controller['getSubjects']);router['get'](_0x1c02('0xe'),auth[_0x1c02('0x9')](),controller[_0x1c02('0xf')]);router['post']('/',auth[_0x1c02('0x9')](),controller[_0x1c02('0x10')]);router[_0x1c02('0x11')](_0x1c02('0xb'),auth[_0x1c02('0x9')](),controller[_0x1c02('0x12')]);router[_0x1c02('0x13')](_0x1c02('0xb'),auth[_0x1c02('0x9')](),controller[_0x1c02('0x14')]);module[_0x1c02('0x15')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x522e=['incident','phonecall','contact','nothing','STRING','BOOLEAN','exports','ENUM'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x522e,0x1e6));var _0xe522=function(_0x3f68b5,_0x3b7e58){_0x3f68b5=_0x3f68b5-0x0;var _0x5dad5d=_0x522e[_0x3f68b5];return _0x5dad5d;};'use strict';var Sequelize=require('sequelize');module[_0xe522('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe522('0x1')](_0xe522('0x2'),_0xe522('0x3')),'defaultValue':_0xe522('0x2')},'moduleCreate':{'type':Sequelize[_0xe522('0x1')](_0xe522('0x4'),_0xe522('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xe522('0x6')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe522('0x7')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5739=['contact','BOOLEAN','STRING','ENUM','phonecall','incident','nothing'];(function(_0xc1b20b,_0x36cf2f){var _0x1432c1=function(_0x54c489){while(--_0x54c489){_0xc1b20b['push'](_0xc1b20b['shift']());}};_0x1432c1(++_0x36cf2f);}(_0x5739,0x18a));var _0x9573=function(_0x15791b,_0xabe5fb){_0x15791b=_0x15791b-0x0;var _0x4278a2=_0x5739[_0x15791b];return _0x4278a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9573('0x0')]},'description':{'type':Sequelize[_0x9573('0x0')]},'ticketType':{'type':Sequelize[_0x9573('0x1')]('incident',_0x9573('0x2')),'defaultValue':_0x9573('0x3')},'moduleCreate':{'type':Sequelize[_0x9573('0x1')]('contact',_0x9573('0x4')),'defaultValue':_0x9573('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9573('0x6')],'defaultValue':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0cf6=['then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','getFields','sort','getSubjects','findOne','Dynamics365Field','length','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','count','limit','Content-Range','apply','reject','save','update'];(function(_0x249d0a,_0x14daee){var _0x9d309c=function(_0x32fbc8){while(--_0x32fbc8){_0x249d0a['push'](_0x249d0a['shift']());}};_0x9d309c(++_0x14daee);}(_0x0cf6,0x11b));var _0x60cf=function(_0x597351,_0x5aed9f){_0x597351=_0x597351-0x0;var _0x410cd7=_0x0cf6[_0x597351];return _0x410cd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60cf('0x1'));var rp=require(_0x60cf('0x2'));var moment=require('moment');var BPromise=require(_0x60cf('0x3'));var Mustache=require(_0x60cf('0x4'));var util=require(_0x60cf('0x5'));var path=require(_0x60cf('0x6'));var sox=require(_0x60cf('0x7'));var csv=require('to-csv');var ejs=require(_0x60cf('0x8'));var fs=require('fs');var fs_extra=require(_0x60cf('0x9'));var _=require('lodash');var squel=require(_0x60cf('0xa'));var crypto=require(_0x60cf('0xb'));var jsforce=require(_0x60cf('0xc'));var deskjs=require(_0x60cf('0xd'));var toCsv=require(_0x60cf('0xe'));var querystring=require(_0x60cf('0xf'));var Papa=require(_0x60cf('0x10'));var Redis=require(_0x60cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x60cf('0x12'));var as=require(_0x60cf('0x13'));var hardwareService=require(_0x60cf('0x14'));var logger=require(_0x60cf('0x15'))(_0x60cf('0x16'));var utils=require('../../config/utils');var config=require(_0x60cf('0x17'));var licenseUtil=require(_0x60cf('0x18'));var db=require(_0x60cf('0x19'))['db'];function respondWithStatusCode(_0x28d99e,_0x48fd94){_0x48fd94=_0x48fd94||0xcc;return function(_0x32973e){if(_0x32973e){return _0x28d99e[_0x60cf('0x1a')](_0x48fd94);}return _0x28d99e['status'](_0x48fd94)[_0x60cf('0x1b')]();};}function respondWithResult(_0x1f8700,_0x57948c){_0x57948c=_0x57948c||0xc8;return function(_0x51b604){if(_0x51b604){return _0x1f8700[_0x60cf('0x1c')](_0x57948c)['json'](_0x51b604);}};}function respondWithFilteredResult(_0x3e8f50,_0xfb132f){return function(_0x965017){if(_0x965017){var _0x17e6ae=typeof _0xfb132f[_0x60cf('0x1d')]==='undefined'&&typeof _0xfb132f['limit']==='undefined';var _0x2eddb9=_0x965017[_0x60cf('0x1e')];var _0x48d1f8=_0x17e6ae?0x0:_0xfb132f['offset'];var _0x2ca23e=_0x17e6ae?_0x965017[_0x60cf('0x1e')]:_0xfb132f[_0x60cf('0x1d')]+_0xfb132f[_0x60cf('0x1f')];var _0x3f4f38;if(_0x2ca23e>=_0x2eddb9){_0x2ca23e=_0x2eddb9;_0x3f4f38=0xc8;}else{_0x3f4f38=0xce;}_0x3e8f50[_0x60cf('0x1c')](_0x3f4f38);return _0x3e8f50['set'](_0x60cf('0x20'),_0x48d1f8+'-'+_0x2ca23e+'/'+_0x2eddb9)['json'](_0x965017);}return null;};}function patchUpdates(_0x4026c9){return function(_0x36c7bc){try{jsonpatch[_0x60cf('0x21')](_0x36c7bc,_0x4026c9,!![]);}catch(_0x2b33a8){return BPromise[_0x60cf('0x22')](_0x2b33a8);}return _0x36c7bc[_0x60cf('0x23')]();};}function saveUpdates(_0x4c7a52,_0x43417b){return function(_0x349798){if(_0x349798){return _0x349798[_0x60cf('0x24')](_0x4c7a52)[_0x60cf('0x25')](function(_0x29599c){return _0x29599c;});}return null;};}function removeEntity(_0x799534,_0x5c999e){return function(_0x1869c8){if(_0x1869c8){return _0x1869c8[_0x60cf('0x26')]()[_0x60cf('0x25')](function(){_0x799534['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34cd8f,_0x2c504a){return function(_0x3ebc8b){if(!_0x3ebc8b){_0x34cd8f[_0x60cf('0x1a')](0x194);}return _0x3ebc8b;};}function handleError(_0x5b4cb7,_0x1e980f){_0x1e980f=_0x1e980f||0x1f4;return function(_0x5460a7){logger[_0x60cf('0x27')](_0x5460a7[_0x60cf('0x28')]);if(_0x5460a7[_0x60cf('0x29')]){delete _0x5460a7['name'];}_0x5b4cb7[_0x60cf('0x1c')](_0x1e980f)[_0x60cf('0x2a')](_0x5460a7);};}exports['index']=function(_0x40fe35,_0x153ded){var _0x2a8551={},_0x3d3c24={},_0x4ef601={'count':0x0,'rows':[]};var _0xc9b0e4=_[_0x60cf('0x2b')](db[_0x60cf('0x2c')][_0x60cf('0x2d')],function(_0x2d759b){return{'name':_0x2d759b['fieldName'],'type':_0x2d759b[_0x60cf('0x2e')][_0x60cf('0x2f')]};});_0x3d3c24[_0x60cf('0x30')]=_[_0x60cf('0x2b')](_0xc9b0e4,_0x60cf('0x29'));_0x3d3c24[_0x60cf('0x31')]=_['keys'](_0x40fe35['query']);_0x3d3c24['filters']=_[_0x60cf('0x32')](_0x3d3c24[_0x60cf('0x30')],_0x3d3c24[_0x60cf('0x31')]);_0x2a8551[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x3d3c24[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x40fe35['query'][_0x60cf('0x34')]));_0x2a8551[_0x60cf('0x33')]=_0x2a8551[_0x60cf('0x33')]['length']?_0x2a8551['attributes']:_0x3d3c24[_0x60cf('0x30')];if(!_0x40fe35[_0x60cf('0x31')][_0x60cf('0x35')](_0x60cf('0x36'))){_0x2a8551[_0x60cf('0x1f')]=qs[_0x60cf('0x1f')](_0x40fe35[_0x60cf('0x31')][_0x60cf('0x1f')]);_0x2a8551[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x40fe35[_0x60cf('0x31')][_0x60cf('0x1d')]);}_0x2a8551[_0x60cf('0x37')]=qs['sort'](_0x40fe35[_0x60cf('0x31')]['sort']);_0x2a8551[_0x60cf('0x38')]=qs['filters'](_[_0x60cf('0x39')](_0x40fe35[_0x60cf('0x31')],_0x3d3c24[_0x60cf('0x3a')]),_0xc9b0e4);if(_0x40fe35[_0x60cf('0x31')][_0x60cf('0x3b')]){_0x2a8551[_0x60cf('0x38')]=_[_0x60cf('0x3c')](_0x2a8551['where'],{'$or':_[_0x60cf('0x2b')](_0xc9b0e4,function(_0x334c25){if(_0x334c25[_0x60cf('0x2e')]!==_0x60cf('0x3d')){var _0x3f5af3={};_0x3f5af3[_0x334c25[_0x60cf('0x29')]]={'$like':'%'+_0x40fe35['query'][_0x60cf('0x3b')]+'%'};return _0x3f5af3;}})});}_0x2a8551=_[_0x60cf('0x3c')]({},_0x2a8551,_0x40fe35[_0x60cf('0x3e')]);var _0x42696e={'where':_0x2a8551['where']};return db[_0x60cf('0x2c')][_0x60cf('0x1e')](_0x42696e)[_0x60cf('0x25')](function(_0x49b261){_0x4ef601[_0x60cf('0x1e')]=_0x49b261;if(_0x40fe35['query'][_0x60cf('0x3f')]){_0x2a8551[_0x60cf('0x40')]=[{'all':!![]}];}return db[_0x60cf('0x2c')][_0x60cf('0x41')](_0x2a8551);})['then'](function(_0x498043){_0x4ef601['rows']=_0x498043;return _0x4ef601;})[_0x60cf('0x25')](respondWithFilteredResult(_0x153ded,_0x2a8551))['catch'](handleError(_0x153ded,null));};exports[_0x60cf('0x42')]=function(_0x3f5e91,_0x177e56){var _0x2dcfe4={'raw':![],'where':{'id':_0x3f5e91[_0x60cf('0x43')]['id']}},_0x506d26={};_0x506d26['model']=_[_0x60cf('0x44')](db['Dynamics365Configuration']['rawAttributes']);_0x506d26[_0x60cf('0x31')]=_[_0x60cf('0x44')](_0x3f5e91['query']);_0x506d26['filters']=_[_0x60cf('0x32')](_0x506d26[_0x60cf('0x30')],_0x506d26[_0x60cf('0x31')]);_0x2dcfe4[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x506d26[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x3f5e91[_0x60cf('0x31')][_0x60cf('0x34')]));_0x2dcfe4[_0x60cf('0x33')]=_0x2dcfe4[_0x60cf('0x33')]['length']?_0x2dcfe4[_0x60cf('0x33')]:_0x506d26[_0x60cf('0x30')];if(_0x3f5e91[_0x60cf('0x31')][_0x60cf('0x3f')]){_0x2dcfe4['include']=[{'all':!![]}];}_0x2dcfe4=_['merge']({},_0x2dcfe4,_0x3f5e91[_0x60cf('0x3e')]);return db[_0x60cf('0x2c')]['find'](_0x2dcfe4)['then'](handleEntityNotFound(_0x177e56,null))[_0x60cf('0x25')](respondWithResult(_0x177e56,null))[_0x60cf('0x45')](handleError(_0x177e56,null));};exports[_0x60cf('0x46')]=function(_0x5657dd,_0x276d6d){return db['Dynamics365Configuration'][_0x60cf('0x46')](_0x5657dd['body'],{})[_0x60cf('0x25')](respondWithResult(_0x276d6d,0xc9))['catch'](handleError(_0x276d6d,null));};exports[_0x60cf('0x24')]=function(_0x4705c3,_0x3e7daf){if(_0x4705c3[_0x60cf('0x47')]['id']){delete _0x4705c3[_0x60cf('0x47')]['id'];}return db[_0x60cf('0x2c')][_0x60cf('0x48')]({'where':{'id':_0x4705c3[_0x60cf('0x43')]['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x3e7daf,null))[_0x60cf('0x25')](saveUpdates(_0x4705c3[_0x60cf('0x47')],null))[_0x60cf('0x25')](respondWithResult(_0x3e7daf,null))[_0x60cf('0x45')](handleError(_0x3e7daf,null));};exports['destroy']=function(_0x199a3e,_0x231f34){return db[_0x60cf('0x2c')][_0x60cf('0x48')]({'where':{'id':_0x199a3e[_0x60cf('0x43')]['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x231f34,null))['then'](removeEntity(_0x231f34,null))[_0x60cf('0x45')](handleError(_0x231f34,null));};exports[_0x60cf('0x49')]=function(_0x4afaf9,_0x4a4ea6,_0x321cc0){var _0x203f68={};var _0x26d227={};var _0x106f34;var _0x4f60cb;return db[_0x60cf('0x2c')]['findOne']({'where':{'id':_0x4afaf9[_0x60cf('0x43')]['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x4a4ea6,null))[_0x60cf('0x25')](function(_0x287a10){if(_0x287a10){_0x106f34=_0x287a10;_0x26d227[_0x60cf('0x30')]=_['keys'](db['Dynamics365Field'][_0x60cf('0x2d')]);_0x26d227[_0x60cf('0x31')]=_['keys'](_0x4afaf9[_0x60cf('0x31')]);_0x26d227[_0x60cf('0x3a')]=_[_0x60cf('0x32')](_0x26d227[_0x60cf('0x30')],_0x26d227['query']);_0x203f68[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x26d227[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x4afaf9['query'][_0x60cf('0x34')]));_0x203f68[_0x60cf('0x33')]=_0x203f68['attributes']['length']?_0x203f68['attributes']:_0x26d227[_0x60cf('0x30')];_0x203f68[_0x60cf('0x37')]=qs[_0x60cf('0x4a')](_0x4afaf9[_0x60cf('0x31')]['sort']);_0x203f68[_0x60cf('0x38')]=qs[_0x60cf('0x3a')](_[_0x60cf('0x39')](_0x4afaf9['query'],_0x26d227[_0x60cf('0x3a')]));if(_0x4afaf9['query'][_0x60cf('0x3b')]){_0x203f68[_0x60cf('0x38')]=_['merge'](_0x203f68['where'],{'$or':_[_0x60cf('0x2b')](_0x203f68[_0x60cf('0x33')],function(_0x194be9){var _0x51a9fb={};_0x51a9fb[_0x194be9]={'$like':'%'+_0x4afaf9[_0x60cf('0x31')][_0x60cf('0x3b')]+'%'};return _0x51a9fb;})});}_0x203f68=_['merge']({},_0x203f68,_0x4afaf9[_0x60cf('0x3e')]);return _0x106f34[_0x60cf('0x49')](_0x203f68);}})[_0x60cf('0x25')](function(_0x5047e4){if(_0x5047e4){_0x4f60cb=_0x5047e4['length'];if(!_0x4afaf9[_0x60cf('0x31')][_0x60cf('0x35')](_0x60cf('0x36'))){_0x203f68[_0x60cf('0x1f')]=qs[_0x60cf('0x1f')](_0x4afaf9[_0x60cf('0x31')][_0x60cf('0x1f')]);_0x203f68[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x4afaf9[_0x60cf('0x31')]['offset']);}return _0x106f34[_0x60cf('0x49')](_0x203f68);}})[_0x60cf('0x25')](function(_0x56486c){if(_0x56486c){return _0x56486c?{'count':_0x4f60cb,'rows':_0x56486c}:null;}})[_0x60cf('0x25')](respondWithResult(_0x4a4ea6,null))[_0x60cf('0x45')](handleError(_0x4a4ea6,null));};exports[_0x60cf('0x4b')]=function(_0x144f06,_0x5805af,_0x391d7e){var _0x36c2d3={};var _0x1f8fe7={};var _0x16c581;var _0x4c7dc1;return db[_0x60cf('0x2c')][_0x60cf('0x4c')]({'where':{'id':_0x144f06['params']['id']}})[_0x60cf('0x25')](handleEntityNotFound(_0x5805af,null))[_0x60cf('0x25')](function(_0x34c12d){if(_0x34c12d){_0x16c581=_0x34c12d;_0x1f8fe7[_0x60cf('0x30')]=_[_0x60cf('0x44')](db[_0x60cf('0x4d')][_0x60cf('0x2d')]);_0x1f8fe7[_0x60cf('0x31')]=_[_0x60cf('0x44')](_0x144f06[_0x60cf('0x31')]);_0x1f8fe7[_0x60cf('0x3a')]=_['intersection'](_0x1f8fe7[_0x60cf('0x30')],_0x1f8fe7[_0x60cf('0x31')]);_0x36c2d3[_0x60cf('0x33')]=_[_0x60cf('0x32')](_0x1f8fe7[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x144f06[_0x60cf('0x31')][_0x60cf('0x34')]));_0x36c2d3[_0x60cf('0x33')]=_0x36c2d3[_0x60cf('0x33')][_0x60cf('0x4e')]?_0x36c2d3[_0x60cf('0x33')]:_0x1f8fe7[_0x60cf('0x30')];_0x36c2d3[_0x60cf('0x37')]=qs[_0x60cf('0x4a')](_0x144f06[_0x60cf('0x31')][_0x60cf('0x4a')]);_0x36c2d3[_0x60cf('0x38')]=qs[_0x60cf('0x3a')](_['pick'](_0x144f06[_0x60cf('0x31')],_0x1f8fe7[_0x60cf('0x3a')]));if(_0x144f06['query'][_0x60cf('0x3b')]){_0x36c2d3[_0x60cf('0x38')]=_[_0x60cf('0x3c')](_0x36c2d3[_0x60cf('0x38')],{'$or':_[_0x60cf('0x2b')](_0x36c2d3[_0x60cf('0x33')],function(_0x495fe3){var _0xa6548b={};_0xa6548b[_0x495fe3]={'$like':'%'+_0x144f06[_0x60cf('0x31')][_0x60cf('0x3b')]+'%'};return _0xa6548b;})});}_0x36c2d3=_[_0x60cf('0x3c')]({},_0x36c2d3,_0x144f06[_0x60cf('0x3e')]);return _0x16c581[_0x60cf('0x4b')](_0x36c2d3);}})[_0x60cf('0x25')](function(_0x355a1c){if(_0x355a1c){_0x4c7dc1=_0x355a1c['length'];if(!_0x144f06[_0x60cf('0x31')][_0x60cf('0x35')]('nolimit')){_0x36c2d3['limit']=qs['limit'](_0x144f06[_0x60cf('0x31')][_0x60cf('0x1f')]);_0x36c2d3[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x144f06[_0x60cf('0x31')]['offset']);}return _0x16c581[_0x60cf('0x4b')](_0x36c2d3);}})['then'](function(_0xb4eec6){if(_0xb4eec6){return _0xb4eec6?{'count':_0x4c7dc1,'rows':_0xb4eec6}:null;}})[_0x60cf('0x25')](respondWithResult(_0x5805af,null))[_0x60cf('0x45')](handleError(_0x5805af,null));};exports[_0x60cf('0x4f')]=function(_0x5ec604,_0x55059d,_0x32226b){var _0x43b42f={};var _0x2eee17={};var _0x2fcdbc;var _0x26b6d5;return db['Dynamics365Configuration'][_0x60cf('0x4c')]({'where':{'id':_0x5ec604[_0x60cf('0x43')]['id']}})['then'](handleEntityNotFound(_0x55059d,null))['then'](function(_0x322ff8){if(_0x322ff8){_0x2fcdbc=_0x322ff8;_0x2eee17['model']=_['keys'](db[_0x60cf('0x4d')][_0x60cf('0x2d')]);_0x2eee17[_0x60cf('0x31')]=_[_0x60cf('0x44')](_0x5ec604['query']);_0x2eee17[_0x60cf('0x3a')]=_[_0x60cf('0x32')](_0x2eee17[_0x60cf('0x30')],_0x2eee17['query']);_0x43b42f['attributes']=_[_0x60cf('0x32')](_0x2eee17[_0x60cf('0x30')],qs[_0x60cf('0x34')](_0x5ec604[_0x60cf('0x31')][_0x60cf('0x34')]));_0x43b42f['attributes']=_0x43b42f[_0x60cf('0x33')]['length']?_0x43b42f[_0x60cf('0x33')]:_0x2eee17[_0x60cf('0x30')];_0x43b42f[_0x60cf('0x37')]=qs[_0x60cf('0x4a')](_0x5ec604[_0x60cf('0x31')][_0x60cf('0x4a')]);_0x43b42f['where']=qs[_0x60cf('0x3a')](_['pick'](_0x5ec604[_0x60cf('0x31')],_0x2eee17[_0x60cf('0x3a')]));if(_0x5ec604[_0x60cf('0x31')][_0x60cf('0x3b')]){_0x43b42f[_0x60cf('0x38')]=_[_0x60cf('0x3c')](_0x43b42f[_0x60cf('0x38')],{'$or':_[_0x60cf('0x2b')](_0x43b42f['attributes'],function(_0x271b6b){var _0x5840f2={};_0x5840f2[_0x271b6b]={'$like':'%'+_0x5ec604[_0x60cf('0x31')][_0x60cf('0x3b')]+'%'};return _0x5840f2;})});}_0x43b42f=_['merge']({},_0x43b42f,_0x5ec604[_0x60cf('0x3e')]);return _0x2fcdbc[_0x60cf('0x4f')](_0x43b42f);}})[_0x60cf('0x25')](function(_0x261bfe){if(_0x261bfe){_0x26b6d5=_0x261bfe['length'];if(!_0x5ec604['query'][_0x60cf('0x35')](_0x60cf('0x36'))){_0x43b42f['limit']=qs[_0x60cf('0x1f')](_0x5ec604['query'][_0x60cf('0x1f')]);_0x43b42f[_0x60cf('0x1d')]=qs[_0x60cf('0x1d')](_0x5ec604[_0x60cf('0x31')]['offset']);}return _0x2fcdbc[_0x60cf('0x4f')](_0x43b42f);}})['then'](function(_0x1d3890){if(_0x1d3890){return _0x1d3890?{'count':_0x26b6d5,'rows':_0x1d3890}:null;}})['then'](respondWithResult(_0x55059d,null))[_0x60cf('0x45')](handleError(_0x55059d,null));};
\ No newline at end of file
+var _0xc351=['params','length','catch','create','body','find','getFields','Dynamics365Field','sort','pick','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show'];(function(_0x484d82,_0x2be97){var _0x134005=function(_0x56dd4e){while(--_0x56dd4e){_0x484d82['push'](_0x484d82['shift']());}};_0x134005(++_0x2be97);}(_0xc351,0x19d));var _0x1c35=function(_0x136ed6,_0x1df16d){_0x136ed6=_0x136ed6-0x0;var _0x3bbfb9=_0xc351[_0x136ed6];return _0x3bbfb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c35('0x0'));var zipdir=require(_0x1c35('0x1'));var jsonpatch=require(_0x1c35('0x2'));var rp=require('request-promise');var moment=require(_0x1c35('0x3'));var BPromise=require(_0x1c35('0x4'));var Mustache=require(_0x1c35('0x5'));var util=require(_0x1c35('0x6'));var path=require(_0x1c35('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1c35('0x8'));var fs=require('fs');var fs_extra=require(_0x1c35('0x9'));var _=require(_0x1c35('0xa'));var squel=require(_0x1c35('0xb'));var crypto=require(_0x1c35('0xc'));var jsforce=require(_0x1c35('0xd'));var deskjs=require(_0x1c35('0xe'));var toCsv=require(_0x1c35('0xf'));var querystring=require(_0x1c35('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1c35('0x11'));var qs=require(_0x1c35('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c35('0x13'));var logger=require('../../config/logger')(_0x1c35('0x14'));var utils=require(_0x1c35('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1c35('0x16'));var db=require(_0x1c35('0x17'))['db'];function respondWithStatusCode(_0x371308,_0x398f47){_0x398f47=_0x398f47||0xcc;return function(_0x3b31fb){if(_0x3b31fb){return _0x371308['sendStatus'](_0x398f47);}return _0x371308[_0x1c35('0x18')](_0x398f47)['end']();};}function respondWithResult(_0x4a3cfd,_0x4f658d){_0x4f658d=_0x4f658d||0xc8;return function(_0x526b39){if(_0x526b39){return _0x4a3cfd[_0x1c35('0x18')](_0x4f658d)['json'](_0x526b39);}};}function respondWithFilteredResult(_0x2d04b3,_0x101bc2){return function(_0x55f68c){if(_0x55f68c){var _0x31b282=typeof _0x101bc2[_0x1c35('0x19')]===_0x1c35('0x1a')&&typeof _0x101bc2[_0x1c35('0x1b')]===_0x1c35('0x1a');var _0x1231e5=_0x55f68c[_0x1c35('0x1c')];var _0x591289=_0x31b282?0x0:_0x101bc2[_0x1c35('0x19')];var _0x1ef2db=_0x31b282?_0x55f68c['count']:_0x101bc2[_0x1c35('0x19')]+_0x101bc2['limit'];var _0x586557;if(_0x1ef2db>=_0x1231e5){_0x1ef2db=_0x1231e5;_0x586557=0xc8;}else{_0x586557=0xce;}_0x2d04b3[_0x1c35('0x18')](_0x586557);return _0x2d04b3[_0x1c35('0x1d')](_0x1c35('0x1e'),_0x591289+'-'+_0x1ef2db+'/'+_0x1231e5)[_0x1c35('0x1f')](_0x55f68c);}return null;};}function patchUpdates(_0x4e9c8f){return function(_0x5d8846){try{jsonpatch['apply'](_0x5d8846,_0x4e9c8f,!![]);}catch(_0x2ebd92){return BPromise[_0x1c35('0x20')](_0x2ebd92);}return _0x5d8846[_0x1c35('0x21')]();};}function saveUpdates(_0x2faf8d,_0x54dfa0){return function(_0x5e04e0){if(_0x5e04e0){return _0x5e04e0['update'](_0x2faf8d)[_0x1c35('0x22')](function(_0x66c121){return _0x66c121;});}return null;};}function removeEntity(_0x205e04,_0x25f9cd){return function(_0x1da025){if(_0x1da025){return _0x1da025[_0x1c35('0x23')]()['then'](function(){_0x205e04[_0x1c35('0x18')](0xcc)[_0x1c35('0x24')]();});}};}function handleEntityNotFound(_0x52545b,_0x2d31e4){return function(_0x480a20){if(!_0x480a20){_0x52545b[_0x1c35('0x25')](0x194);}return _0x480a20;};}function handleError(_0x53aa86,_0x5990fb){_0x5990fb=_0x5990fb||0x1f4;return function(_0x1521d5){logger[_0x1c35('0x26')](_0x1521d5[_0x1c35('0x27')]);if(_0x1521d5['name']){delete _0x1521d5[_0x1c35('0x28')];}_0x53aa86[_0x1c35('0x18')](_0x5990fb)[_0x1c35('0x29')](_0x1521d5);};}exports[_0x1c35('0x2a')]=function(_0x12f544,_0x27d6f2){var _0x202486={},_0x318e93={},_0x46e2a3={'count':0x0,'rows':[]};var _0x16a231=_[_0x1c35('0x2b')](db[_0x1c35('0x2c')][_0x1c35('0x2d')],function(_0x4a4152){return{'name':_0x4a4152[_0x1c35('0x2e')],'type':_0x4a4152[_0x1c35('0x2f')]['key']};});_0x318e93[_0x1c35('0x30')]=_['map'](_0x16a231,_0x1c35('0x28'));_0x318e93[_0x1c35('0x31')]=_[_0x1c35('0x32')](_0x12f544[_0x1c35('0x31')]);_0x318e93['filters']=_[_0x1c35('0x33')](_0x318e93['model'],_0x318e93[_0x1c35('0x31')]);_0x202486[_0x1c35('0x34')]=_[_0x1c35('0x33')](_0x318e93[_0x1c35('0x30')],qs[_0x1c35('0x35')](_0x12f544[_0x1c35('0x31')][_0x1c35('0x35')]));_0x202486[_0x1c35('0x34')]=_0x202486[_0x1c35('0x34')]['length']?_0x202486[_0x1c35('0x34')]:_0x318e93[_0x1c35('0x30')];if(!_0x12f544['query'][_0x1c35('0x36')](_0x1c35('0x37'))){_0x202486['limit']=qs['limit'](_0x12f544[_0x1c35('0x31')][_0x1c35('0x1b')]);_0x202486[_0x1c35('0x19')]=qs[_0x1c35('0x19')](_0x12f544[_0x1c35('0x31')][_0x1c35('0x19')]);}_0x202486[_0x1c35('0x38')]=qs['sort'](_0x12f544[_0x1c35('0x31')]['sort']);_0x202486[_0x1c35('0x39')]=qs[_0x1c35('0x3a')](_['pick'](_0x12f544[_0x1c35('0x31')],_0x318e93[_0x1c35('0x3a')]),_0x16a231);if(_0x12f544[_0x1c35('0x31')][_0x1c35('0x3b')]){_0x202486[_0x1c35('0x39')]=_[_0x1c35('0x3c')](_0x202486[_0x1c35('0x39')],{'$or':_[_0x1c35('0x2b')](_0x16a231,function(_0x2f40a6){if(_0x2f40a6['type']!==_0x1c35('0x3d')){var _0x5cc79c={};_0x5cc79c[_0x2f40a6[_0x1c35('0x28')]]={'$like':'%'+_0x12f544[_0x1c35('0x31')][_0x1c35('0x3b')]+'%'};return _0x5cc79c;}})});}_0x202486=_['merge']({},_0x202486,_0x12f544[_0x1c35('0x3e')]);var _0x590a37={'where':_0x202486['where']};return db[_0x1c35('0x2c')][_0x1c35('0x1c')](_0x590a37)[_0x1c35('0x22')](function(_0x2660af){_0x46e2a3[_0x1c35('0x1c')]=_0x2660af;if(_0x12f544[_0x1c35('0x31')][_0x1c35('0x3f')]){_0x202486[_0x1c35('0x40')]=[{'all':!![]}];}return db[_0x1c35('0x2c')]['findAll'](_0x202486);})[_0x1c35('0x22')](function(_0x555888){_0x46e2a3[_0x1c35('0x41')]=_0x555888;return _0x46e2a3;})['then'](respondWithFilteredResult(_0x27d6f2,_0x202486))['catch'](handleError(_0x27d6f2,null));};exports[_0x1c35('0x42')]=function(_0x41aaed,_0x25fae3){var _0x8233a5={'raw':![],'where':{'id':_0x41aaed[_0x1c35('0x43')]['id']}},_0x1da35f={};_0x1da35f[_0x1c35('0x30')]=_[_0x1c35('0x32')](db['Dynamics365Configuration']['rawAttributes']);_0x1da35f[_0x1c35('0x31')]=_['keys'](_0x41aaed[_0x1c35('0x31')]);_0x1da35f[_0x1c35('0x3a')]=_[_0x1c35('0x33')](_0x1da35f[_0x1c35('0x30')],_0x1da35f['query']);_0x8233a5[_0x1c35('0x34')]=_['intersection'](_0x1da35f['model'],qs[_0x1c35('0x35')](_0x41aaed[_0x1c35('0x31')][_0x1c35('0x35')]));_0x8233a5[_0x1c35('0x34')]=_0x8233a5[_0x1c35('0x34')][_0x1c35('0x44')]?_0x8233a5[_0x1c35('0x34')]:_0x1da35f[_0x1c35('0x30')];if(_0x41aaed[_0x1c35('0x31')][_0x1c35('0x3f')]){_0x8233a5[_0x1c35('0x40')]=[{'all':!![]}];}_0x8233a5=_[_0x1c35('0x3c')]({},_0x8233a5,_0x41aaed[_0x1c35('0x3e')]);return db['Dynamics365Configuration']['find'](_0x8233a5)[_0x1c35('0x22')](handleEntityNotFound(_0x25fae3,null))[_0x1c35('0x22')](respondWithResult(_0x25fae3,null))[_0x1c35('0x45')](handleError(_0x25fae3,null));};exports['create']=function(_0x2b7b32,_0x26b4b8){return db['Dynamics365Configuration'][_0x1c35('0x46')](_0x2b7b32[_0x1c35('0x47')],{})[_0x1c35('0x22')](respondWithResult(_0x26b4b8,0xc9))['catch'](handleError(_0x26b4b8,null));};exports['update']=function(_0xc79c2f,_0x338a1e){if(_0xc79c2f['body']['id']){delete _0xc79c2f[_0x1c35('0x47')]['id'];}return db[_0x1c35('0x2c')][_0x1c35('0x48')]({'where':{'id':_0xc79c2f[_0x1c35('0x43')]['id']}})[_0x1c35('0x22')](handleEntityNotFound(_0x338a1e,null))['then'](saveUpdates(_0xc79c2f['body'],null))[_0x1c35('0x22')](respondWithResult(_0x338a1e,null))[_0x1c35('0x45')](handleError(_0x338a1e,null));};exports[_0x1c35('0x23')]=function(_0x31b6a8,_0x7d10ca){return db['Dynamics365Configuration'][_0x1c35('0x48')]({'where':{'id':_0x31b6a8[_0x1c35('0x43')]['id']}})['then'](handleEntityNotFound(_0x7d10ca,null))['then'](removeEntity(_0x7d10ca,null))['catch'](handleError(_0x7d10ca,null));};exports[_0x1c35('0x49')]=function(_0x54bdc0,_0x4f2dfd,_0x25f6ba){var _0x326b5c={};var _0x8be767={};var _0x16a420;var _0x29b1a3;return db[_0x1c35('0x2c')]['findOne']({'where':{'id':_0x54bdc0[_0x1c35('0x43')]['id']}})[_0x1c35('0x22')](handleEntityNotFound(_0x4f2dfd,null))[_0x1c35('0x22')](function(_0x3dcd08){if(_0x3dcd08){_0x16a420=_0x3dcd08;_0x8be767[_0x1c35('0x30')]=_[_0x1c35('0x32')](db[_0x1c35('0x4a')][_0x1c35('0x2d')]);_0x8be767[_0x1c35('0x31')]=_[_0x1c35('0x32')](_0x54bdc0[_0x1c35('0x31')]);_0x8be767[_0x1c35('0x3a')]=_[_0x1c35('0x33')](_0x8be767[_0x1c35('0x30')],_0x8be767[_0x1c35('0x31')]);_0x326b5c['attributes']=_['intersection'](_0x8be767[_0x1c35('0x30')],qs[_0x1c35('0x35')](_0x54bdc0[_0x1c35('0x31')][_0x1c35('0x35')]));_0x326b5c[_0x1c35('0x34')]=_0x326b5c[_0x1c35('0x34')][_0x1c35('0x44')]?_0x326b5c[_0x1c35('0x34')]:_0x8be767['model'];_0x326b5c['order']=qs[_0x1c35('0x4b')](_0x54bdc0['query'][_0x1c35('0x4b')]);_0x326b5c[_0x1c35('0x39')]=qs[_0x1c35('0x3a')](_[_0x1c35('0x4c')](_0x54bdc0[_0x1c35('0x31')],_0x8be767[_0x1c35('0x3a')]));if(_0x54bdc0[_0x1c35('0x31')][_0x1c35('0x3b')]){_0x326b5c['where']=_['merge'](_0x326b5c['where'],{'$or':_['map'](_0x326b5c['attributes'],function(_0x306ae9){var _0x26be0a={};_0x26be0a[_0x306ae9]={'$like':'%'+_0x54bdc0[_0x1c35('0x31')][_0x1c35('0x3b')]+'%'};return _0x26be0a;})});}_0x326b5c=_[_0x1c35('0x3c')]({},_0x326b5c,_0x54bdc0['options']);return _0x16a420[_0x1c35('0x49')](_0x326b5c);}})[_0x1c35('0x22')](function(_0x5c8b84){if(_0x5c8b84){_0x29b1a3=_0x5c8b84['length'];if(!_0x54bdc0['query']['hasOwnProperty'](_0x1c35('0x37'))){_0x326b5c[_0x1c35('0x1b')]=qs['limit'](_0x54bdc0[_0x1c35('0x31')][_0x1c35('0x1b')]);_0x326b5c[_0x1c35('0x19')]=qs['offset'](_0x54bdc0[_0x1c35('0x31')][_0x1c35('0x19')]);}return _0x16a420[_0x1c35('0x49')](_0x326b5c);}})[_0x1c35('0x22')](function(_0xb31133){if(_0xb31133){return _0xb31133?{'count':_0x29b1a3,'rows':_0xb31133}:null;}})[_0x1c35('0x22')](respondWithResult(_0x4f2dfd,null))['catch'](handleError(_0x4f2dfd,null));};exports[_0x1c35('0x4d')]=function(_0x130792,_0x57b82e,_0x1b94d8){var _0x310506={};var _0x9135dc={};var _0x5d0976;var _0x124064;return db[_0x1c35('0x2c')][_0x1c35('0x4e')]({'where':{'id':_0x130792['params']['id']}})[_0x1c35('0x22')](handleEntityNotFound(_0x57b82e,null))['then'](function(_0x12f989){if(_0x12f989){_0x5d0976=_0x12f989;_0x9135dc[_0x1c35('0x30')]=_[_0x1c35('0x32')](db[_0x1c35('0x4a')][_0x1c35('0x2d')]);_0x9135dc[_0x1c35('0x31')]=_[_0x1c35('0x32')](_0x130792[_0x1c35('0x31')]);_0x9135dc[_0x1c35('0x3a')]=_[_0x1c35('0x33')](_0x9135dc['model'],_0x9135dc['query']);_0x310506[_0x1c35('0x34')]=_['intersection'](_0x9135dc['model'],qs['fields'](_0x130792[_0x1c35('0x31')]['fields']));_0x310506[_0x1c35('0x34')]=_0x310506[_0x1c35('0x34')][_0x1c35('0x44')]?_0x310506[_0x1c35('0x34')]:_0x9135dc['model'];_0x310506[_0x1c35('0x38')]=qs[_0x1c35('0x4b')](_0x130792['query'][_0x1c35('0x4b')]);_0x310506['where']=qs[_0x1c35('0x3a')](_[_0x1c35('0x4c')](_0x130792[_0x1c35('0x31')],_0x9135dc['filters']));if(_0x130792[_0x1c35('0x31')][_0x1c35('0x3b')]){_0x310506[_0x1c35('0x39')]=_['merge'](_0x310506[_0x1c35('0x39')],{'$or':_['map'](_0x310506[_0x1c35('0x34')],function(_0x18cb38){var _0x17724d={};_0x17724d[_0x18cb38]={'$like':'%'+_0x130792[_0x1c35('0x31')]['filter']+'%'};return _0x17724d;})});}_0x310506=_[_0x1c35('0x3c')]({},_0x310506,_0x130792[_0x1c35('0x3e')]);return _0x5d0976['getSubjects'](_0x310506);}})[_0x1c35('0x22')](function(_0x3a59b1){if(_0x3a59b1){_0x124064=_0x3a59b1[_0x1c35('0x44')];if(!_0x130792[_0x1c35('0x31')]['hasOwnProperty']('nolimit')){_0x310506[_0x1c35('0x1b')]=qs[_0x1c35('0x1b')](_0x130792[_0x1c35('0x31')][_0x1c35('0x1b')]);_0x310506['offset']=qs[_0x1c35('0x19')](_0x130792['query']['offset']);}return _0x5d0976[_0x1c35('0x4d')](_0x310506);}})[_0x1c35('0x22')](function(_0x34483f){if(_0x34483f){return _0x34483f?{'count':_0x124064,'rows':_0x34483f}:null;}})['then'](respondWithResult(_0x57b82e,null))['catch'](handleError(_0x57b82e,null));};exports[_0x1c35('0x4f')]=function(_0x24b69e,_0x50ac92,_0x319e56){var _0x2d04bd={};var _0x3904ae={};var _0x15345d;var _0x13a106;return db[_0x1c35('0x2c')][_0x1c35('0x4e')]({'where':{'id':_0x24b69e[_0x1c35('0x43')]['id']}})[_0x1c35('0x22')](handleEntityNotFound(_0x50ac92,null))[_0x1c35('0x22')](function(_0x561127){if(_0x561127){_0x15345d=_0x561127;_0x3904ae[_0x1c35('0x30')]=_[_0x1c35('0x32')](db[_0x1c35('0x4a')][_0x1c35('0x2d')]);_0x3904ae[_0x1c35('0x31')]=_['keys'](_0x24b69e[_0x1c35('0x31')]);_0x3904ae[_0x1c35('0x3a')]=_[_0x1c35('0x33')](_0x3904ae[_0x1c35('0x30')],_0x3904ae[_0x1c35('0x31')]);_0x2d04bd[_0x1c35('0x34')]=_[_0x1c35('0x33')](_0x3904ae['model'],qs[_0x1c35('0x35')](_0x24b69e['query'][_0x1c35('0x35')]));_0x2d04bd[_0x1c35('0x34')]=_0x2d04bd['attributes'][_0x1c35('0x44')]?_0x2d04bd[_0x1c35('0x34')]:_0x3904ae[_0x1c35('0x30')];_0x2d04bd[_0x1c35('0x38')]=qs[_0x1c35('0x4b')](_0x24b69e[_0x1c35('0x31')]['sort']);_0x2d04bd[_0x1c35('0x39')]=qs[_0x1c35('0x3a')](_[_0x1c35('0x4c')](_0x24b69e[_0x1c35('0x31')],_0x3904ae[_0x1c35('0x3a')]));if(_0x24b69e[_0x1c35('0x31')][_0x1c35('0x3b')]){_0x2d04bd[_0x1c35('0x39')]=_[_0x1c35('0x3c')](_0x2d04bd[_0x1c35('0x39')],{'$or':_[_0x1c35('0x2b')](_0x2d04bd['attributes'],function(_0x2de9d5){var _0x264952={};_0x264952[_0x2de9d5]={'$like':'%'+_0x24b69e[_0x1c35('0x31')][_0x1c35('0x3b')]+'%'};return _0x264952;})});}_0x2d04bd=_[_0x1c35('0x3c')]({},_0x2d04bd,_0x24b69e[_0x1c35('0x3e')]);return _0x15345d[_0x1c35('0x4f')](_0x2d04bd);}})[_0x1c35('0x22')](function(_0x38cf86){if(_0x38cf86){_0x13a106=_0x38cf86['length'];if(!_0x24b69e[_0x1c35('0x31')]['hasOwnProperty'](_0x1c35('0x37'))){_0x2d04bd[_0x1c35('0x1b')]=qs['limit'](_0x24b69e['query'][_0x1c35('0x1b')]);_0x2d04bd[_0x1c35('0x19')]=qs[_0x1c35('0x19')](_0x24b69e[_0x1c35('0x31')][_0x1c35('0x19')]);}return _0x15345d['getDescriptions'](_0x2d04bd);}})[_0x1c35('0x22')](function(_0x5b0960){if(_0x5b0960){return _0x5b0960?{'count':_0x13a106,'rows':_0x5b0960}:null;}})[_0x1c35('0x22')](respondWithResult(_0x50ac92,null))['catch'](handleError(_0x50ac92,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x1c43dc,_0x42c937){var _0x5c0698=function(_0x59b8dc){while(--_0x59b8dc){_0x1c43dc['push'](_0x1c43dc['shift']());}};_0x5c0698(++_0x42c937);}(_0xedd9,0xfc));var _0x9edd=function(_0x588fbf,_0x367c67){_0x588fbf=_0x588fbf-0x0;var _0x3d3de5=_0xedd9[_0x588fbf];return _0x3d3de5;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2d6dc4,_0x5e2d29){_0x2d6dc4=_0x2d6dc4-0x0;var _0x52991e=_0x6f0d[_0x2d6dc4];return _0x52991e;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x465e=['jayson/promise','client','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x475c6f,_0x3df83b){var _0x94f69b=function(_0x4a95f1){while(--_0x4a95f1){_0x475c6f['push'](_0x475c6f['shift']());}};_0x94f69b(++_0x3df83b);}(_0x465e,0x1cf));var _0xe465=function(_0x1a9b94,_0x4d763e){_0x1a9b94=_0x1a9b94-0x0;var _0x379102=_0x465e[_0x1a9b94];return _0x379102;};'use strict';var _=require(_0xe465('0x0'));var util=require('util');var moment=require(_0xe465('0x1'));var BPromise=require(_0xe465('0x2'));var rs=require(_0xe465('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe465('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe465('0x5'));var client=jayson[_0xe465('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf7f575,_0x1a1790,_0x753899){return new BPromise(function(_0x479496,_0x3148d7){return client['request'](_0xf7f575,_0x753899)['then'](function(_0x4d8730){logger['info'](_0xe465('0x7'),_0x1a1790,_0xe465('0x8'));logger[_0xe465('0x9')](_0xe465('0xa'),_0x1a1790,_0xe465('0x8'),JSON[_0xe465('0xb')](_0x4d8730));if(_0x4d8730['error']){if(_0x4d8730[_0xe465('0xc')][_0xe465('0xd')]===0x1f4){logger[_0xe465('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a1790,_0x4d8730['error'][_0xe465('0xe')]);return _0x3148d7(_0x4d8730['error'][_0xe465('0xe')]);}logger[_0xe465('0xc')](_0xe465('0x7'),_0x1a1790,_0x4d8730['error'][_0xe465('0xe')]);return _0x479496(_0x4d8730['error'][_0xe465('0xe')]);}else{logger[_0xe465('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a1790,_0xe465('0x8'));_0x479496(_0x4d8730[_0xe465('0x10')][_0xe465('0xe')]);}})[_0xe465('0x11')](function(_0x4957fa){logger['error'](_0xe465('0x7'),_0x1a1790,_0x4957fa);_0x3148d7(_0x4957fa);});});}
\ No newline at end of file
+var _0x05b4=['Dynamics365Configuration,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x05b4,0x111));var _0x405b=function(_0x200bfa,_0x31f023){_0x200bfa=_0x200bfa-0x0;var _0xcd0273=_0x05b4[_0x200bfa];return _0xcd0273;};'use strict';var _=require('lodash');var util=require(_0x405b('0x0'));var moment=require(_0x405b('0x1'));var BPromise=require('bluebird');var rs=require(_0x405b('0x2'));var fs=require('fs');var Redis=require(_0x405b('0x3'));var db=require(_0x405b('0x4'))['db'];var utils=require(_0x405b('0x5'));var logger=require('../../config/logger')(_0x405b('0x6'));var config=require('../../config/environment');var jayson=require(_0x405b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f89be,_0x3918de,_0x454713){return new BPromise(function(_0x2b3a7b,_0xce5ce8){return client['request'](_0x1f89be,_0x454713)[_0x405b('0x8')](function(_0x57997a){logger[_0x405b('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3918de,'request\x20sent');logger[_0x405b('0xa')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3918de,_0x405b('0xb'),JSON[_0x405b('0xc')](_0x57997a));if(_0x57997a['error']){if(_0x57997a[_0x405b('0xd')][_0x405b('0xe')]===0x1f4){logger[_0x405b('0xd')](_0x405b('0xf'),_0x3918de,_0x57997a[_0x405b('0xd')][_0x405b('0x10')]);return _0xce5ce8(_0x57997a['error'][_0x405b('0x10')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3918de,_0x57997a[_0x405b('0xd')][_0x405b('0x10')]);return _0x2b3a7b(_0x57997a['error'][_0x405b('0x10')]);}else{logger['info'](_0x405b('0xf'),_0x3918de,'request\x20sent');_0x2b3a7b(_0x57997a['result'][_0x405b('0x10')]);}})[_0x405b('0x11')](function(_0x202a94){logger[_0x405b('0xd')](_0x405b('0xf'),_0x3918de,_0x202a94);_0xce5ce8(_0x202a94);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68df=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x298de3,_0x43e88d){var _0x2bcf0a=function(_0x4ac970){while(--_0x4ac970){_0x298de3['push'](_0x298de3['shift']());}};_0x2bcf0a(++_0x43e88d);}(_0x68df,0x86));var _0xf68d=function(_0x447b23,_0x49c577){_0x447b23=_0x447b23-0x0;var _0x2f37c7=_0x68df[_0x447b23];return _0x2f37c7;};'use strict';var multer=require(_0xf68d('0x0'));var util=require(_0xf68d('0x1'));var path=require(_0xf68d('0x2'));var timeout=require(_0xf68d('0x3'));var express=require(_0xf68d('0x4'));var router=express[_0xf68d('0x5')]();var fs_extra=require(_0xf68d('0x6'));var auth=require(_0xf68d('0x7'));var interaction=require(_0xf68d('0x8'));var config=require(_0xf68d('0x9'));var controller=require(_0xf68d('0xa'));router[_0xf68d('0xb')]('/',auth[_0xf68d('0xc')](),controller['index']);router[_0xf68d('0xb')](_0xf68d('0xd'),auth[_0xf68d('0xc')](),controller[_0xf68d('0xe')]);router[_0xf68d('0xf')]('/',auth[_0xf68d('0xc')](),controller[_0xf68d('0x10')]);router[_0xf68d('0x11')](_0xf68d('0xd'),auth[_0xf68d('0xc')](),controller[_0xf68d('0x12')]);router['delete'](_0xf68d('0xd'),auth[_0xf68d('0xc')](),controller[_0xf68d('0x13')]);module[_0xf68d('0x14')]=router;
\ No newline at end of file
+var _0x854c=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x854c,0x76));var _0xc854=function(_0x3f6464,_0x3b8b2e){_0x3f6464=_0x3f6464-0x0;var _0x14fa55=_0x854c[_0x3f6464];return _0x14fa55;};'use strict';var multer=require(_0xc854('0x0'));var util=require(_0xc854('0x1'));var path=require(_0xc854('0x2'));var timeout=require(_0xc854('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc854('0x4'));var auth=require(_0xc854('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc854('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xc854('0x7')]('/',auth['isAuthenticated'](),controller[_0xc854('0x8')]);router['get']('/:id',auth[_0xc854('0x9')](),controller['show']);router[_0xc854('0xa')]('/',auth[_0xc854('0x9')](),controller[_0xc854('0xb')]);router[_0xc854('0xc')]('/:id',auth[_0xc854('0x9')](),controller[_0xc854('0xd')]);router[_0xc854('0xe')]('/:id',auth[_0xc854('0x9')](),controller['destroy']);module[_0xc854('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bd2=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x108def,_0x31c7ed){var _0x7bd739=function(_0x371b92){while(--_0x371b92){_0x108def['push'](_0x108def['shift']());}};_0x7bd739(++_0x31c7ed);}(_0x3bd2,0x8e));var _0x23bd=function(_0x1e7633,_0x529a56){_0x1e7633=_0x1e7633-0x0;var _0x44f860=_0x3bd2[_0x1e7633];return _0x44f860;};'use strict';var Sequelize=require('sequelize');module[_0x23bd('0x0')]={'type':{'type':Sequelize[_0x23bd('0x1')](_0x23bd('0x2'),_0x23bd('0x3'),_0x23bd('0x4'),_0x23bd('0x5'),_0x23bd('0x6')),'defaultValue':_0x23bd('0x2')},'content':{'type':Sequelize[_0x23bd('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x23bd('0x1')](_0x23bd('0x2'),_0x23bd('0x3'),_0x23bd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x23bd('0x7')]},'customField':{'type':Sequelize[_0x23bd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23bd('0x7')]}};
\ No newline at end of file
+var _0x68a8=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x243c93,_0x12196b){var _0xed2e6c=function(_0x54f10d){while(--_0x54f10d){_0x243c93['push'](_0x243c93['shift']());}};_0xed2e6c(++_0x12196b);}(_0x68a8,0x12d));var _0x868a=function(_0x6b1b36,_0x24e0e8){_0x6b1b36=_0x6b1b36-0x0;var _0xee8904=_0x68a8[_0x6b1b36];return _0xee8904;};'use strict';var Sequelize=require('sequelize');module[_0x868a('0x0')]={'type':{'type':Sequelize[_0x868a('0x1')](_0x868a('0x2'),'variable',_0x868a('0x3'),_0x868a('0x4'),_0x868a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x868a('0x2'),'variable',_0x868a('0x3'))},'keyContent':{'type':Sequelize[_0x868a('0x6')]},'idField':{'type':Sequelize[_0x868a('0x6')]},'nameField':{'type':Sequelize[_0x868a('0x6')]},'customField':{'type':Sequelize[_0x868a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x868a('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b18=['filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','filters','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','then','destroy','end','stack','name','send','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick'];(function(_0x3c38b0,_0x4256d3){var _0x4484eb=function(_0x4aa25c){while(--_0x4aa25c){_0x3c38b0['push'](_0x3c38b0['shift']());}};_0x4484eb(++_0x4256d3);}(_0x1b18,0x1cb));var _0x81b1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1b18[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x81b1('0x0'));var rimraf=require(_0x81b1('0x1'));var zipdir=require(_0x81b1('0x2'));var jsonpatch=require(_0x81b1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81b1('0x4'));var util=require(_0x81b1('0x5'));var path=require(_0x81b1('0x6'));var sox=require(_0x81b1('0x7'));var csv=require(_0x81b1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x81b1('0x9'));var _=require(_0x81b1('0xa'));var squel=require('squel');var crypto=require(_0x81b1('0xb'));var jsforce=require(_0x81b1('0xc'));var deskjs=require(_0x81b1('0xd'));var toCsv=require(_0x81b1('0x8'));var querystring=require(_0x81b1('0xe'));var Papa=require(_0x81b1('0xf'));var Redis=require(_0x81b1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x81b1('0x11'));var as=require(_0x81b1('0x12'));var hardwareService=require(_0x81b1('0x13'));var logger=require(_0x81b1('0x14'))('api');var utils=require(_0x81b1('0x15'));var config=require(_0x81b1('0x16'));var licenseUtil=require(_0x81b1('0x17'));var db=require(_0x81b1('0x18'))['db'];function respondWithStatusCode(_0x1707da,_0x4bffc6){_0x4bffc6=_0x4bffc6||0xcc;return function(_0x1388f7){if(_0x1388f7){return _0x1707da[_0x81b1('0x19')](_0x4bffc6);}return _0x1707da[_0x81b1('0x1a')](_0x4bffc6)['end']();};}function respondWithResult(_0x5ce75e,_0x29559e){_0x29559e=_0x29559e||0xc8;return function(_0x56fb43){if(_0x56fb43){return _0x5ce75e['status'](_0x29559e)[_0x81b1('0x1b')](_0x56fb43);}};}function respondWithFilteredResult(_0x1e3d55,_0x4c5eed){return function(_0x5ce066){if(_0x5ce066){var _0x212c5b=typeof _0x4c5eed[_0x81b1('0x1c')]===_0x81b1('0x1d')&&typeof _0x4c5eed['limit']===_0x81b1('0x1d');var _0x469ed9=_0x5ce066['count'];var _0x296fe2=_0x212c5b?0x0:_0x4c5eed[_0x81b1('0x1c')];var _0x122973=_0x212c5b?_0x5ce066[_0x81b1('0x1e')]:_0x4c5eed[_0x81b1('0x1c')]+_0x4c5eed[_0x81b1('0x1f')];var _0x2c4aef;if(_0x122973>=_0x469ed9){_0x122973=_0x469ed9;_0x2c4aef=0xc8;}else{_0x2c4aef=0xce;}_0x1e3d55[_0x81b1('0x1a')](_0x2c4aef);return _0x1e3d55[_0x81b1('0x20')]('Content-Range',_0x296fe2+'-'+_0x122973+'/'+_0x469ed9)[_0x81b1('0x1b')](_0x5ce066);}return null;};}function patchUpdates(_0x57c953){return function(_0x209198){try{jsonpatch['apply'](_0x209198,_0x57c953,!![]);}catch(_0xd37841){return BPromise[_0x81b1('0x21')](_0xd37841);}return _0x209198[_0x81b1('0x22')]();};}function saveUpdates(_0x47acad,_0x4dfade){return function(_0x2d2b2f){if(_0x2d2b2f){return _0x2d2b2f['update'](_0x47acad)[_0x81b1('0x23')](function(_0x2d8db8){return _0x2d8db8;});}return null;};}function removeEntity(_0x160b05,_0x534ea2){return function(_0x1a8c14){if(_0x1a8c14){return _0x1a8c14[_0x81b1('0x24')]()['then'](function(){_0x160b05[_0x81b1('0x1a')](0xcc)[_0x81b1('0x25')]();});}};}function handleEntityNotFound(_0xdf1374,_0x54af96){return function(_0x19e446){if(!_0x19e446){_0xdf1374[_0x81b1('0x19')](0x194);}return _0x19e446;};}function handleError(_0x504694,_0x5963b0){_0x5963b0=_0x5963b0||0x1f4;return function(_0x4614d0){logger['error'](_0x4614d0[_0x81b1('0x26')]);if(_0x4614d0['name']){delete _0x4614d0[_0x81b1('0x27')];}_0x504694[_0x81b1('0x1a')](_0x5963b0)[_0x81b1('0x28')](_0x4614d0);};}exports['index']=function(_0x36e0e8,_0x47cce2){var _0x347047={},_0x4df08a={},_0x19d578={'count':0x0,'rows':[]};var _0x3a9e3a=_['map'](db[_0x81b1('0x29')][_0x81b1('0x2a')],function(_0x422b31){return{'name':_0x422b31[_0x81b1('0x2b')],'type':_0x422b31[_0x81b1('0x2c')][_0x81b1('0x2d')]};});_0x4df08a[_0x81b1('0x2e')]=_[_0x81b1('0x2f')](_0x3a9e3a,_0x81b1('0x27'));_0x4df08a[_0x81b1('0x30')]=_[_0x81b1('0x31')](_0x36e0e8[_0x81b1('0x30')]);_0x4df08a['filters']=_[_0x81b1('0x32')](_0x4df08a[_0x81b1('0x2e')],_0x4df08a[_0x81b1('0x30')]);_0x347047['attributes']=_[_0x81b1('0x32')](_0x4df08a[_0x81b1('0x2e')],qs[_0x81b1('0x33')](_0x36e0e8[_0x81b1('0x30')]['fields']));_0x347047['attributes']=_0x347047[_0x81b1('0x34')][_0x81b1('0x35')]?_0x347047['attributes']:_0x4df08a[_0x81b1('0x2e')];if(!_0x36e0e8['query'][_0x81b1('0x36')](_0x81b1('0x37'))){_0x347047[_0x81b1('0x1f')]=qs['limit'](_0x36e0e8[_0x81b1('0x30')]['limit']);_0x347047[_0x81b1('0x1c')]=qs['offset'](_0x36e0e8[_0x81b1('0x30')][_0x81b1('0x1c')]);}_0x347047[_0x81b1('0x38')]=qs['sort'](_0x36e0e8[_0x81b1('0x30')]['sort']);_0x347047[_0x81b1('0x39')]=qs['filters'](_[_0x81b1('0x3a')](_0x36e0e8[_0x81b1('0x30')],_0x4df08a['filters']),_0x3a9e3a);if(_0x36e0e8[_0x81b1('0x30')][_0x81b1('0x3b')]){_0x347047['where']=_['merge'](_0x347047[_0x81b1('0x39')],{'$or':_['map'](_0x3a9e3a,function(_0x1f7884){if(_0x1f7884[_0x81b1('0x2c')]!==_0x81b1('0x3c')){var _0x9560b9={};_0x9560b9[_0x1f7884[_0x81b1('0x27')]]={'$like':'%'+_0x36e0e8['query'][_0x81b1('0x3b')]+'%'};return _0x9560b9;}})});}_0x347047=_[_0x81b1('0x3d')]({},_0x347047,_0x36e0e8[_0x81b1('0x3e')]);var _0x24aa48={'where':_0x347047[_0x81b1('0x39')]};return db[_0x81b1('0x29')][_0x81b1('0x1e')](_0x24aa48)[_0x81b1('0x23')](function(_0x371949){_0x19d578[_0x81b1('0x1e')]=_0x371949;if(_0x36e0e8['query'][_0x81b1('0x3f')]){_0x347047[_0x81b1('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x81b1('0x41')](_0x347047);})[_0x81b1('0x23')](function(_0x3c144c){_0x19d578[_0x81b1('0x42')]=_0x3c144c;return _0x19d578;})[_0x81b1('0x23')](respondWithFilteredResult(_0x47cce2,_0x347047))['catch'](handleError(_0x47cce2,null));};exports[_0x81b1('0x43')]=function(_0x259236,_0x3937b2){var _0x3333cf={'raw':!![],'where':{'id':_0x259236[_0x81b1('0x44')]['id']}},_0x1e61f1={};_0x1e61f1['model']=_[_0x81b1('0x31')](db[_0x81b1('0x29')]['rawAttributes']);_0x1e61f1['query']=_[_0x81b1('0x31')](_0x259236[_0x81b1('0x30')]);_0x1e61f1[_0x81b1('0x45')]=_['intersection'](_0x1e61f1['model'],_0x1e61f1[_0x81b1('0x30')]);_0x3333cf[_0x81b1('0x34')]=_[_0x81b1('0x32')](_0x1e61f1[_0x81b1('0x2e')],qs[_0x81b1('0x33')](_0x259236['query']['fields']));_0x3333cf[_0x81b1('0x34')]=_0x3333cf[_0x81b1('0x34')][_0x81b1('0x35')]?_0x3333cf[_0x81b1('0x34')]:_0x1e61f1[_0x81b1('0x2e')];if(_0x259236['query'][_0x81b1('0x3f')]){_0x3333cf[_0x81b1('0x40')]=[{'all':!![]}];}_0x3333cf=_[_0x81b1('0x3d')]({},_0x3333cf,_0x259236[_0x81b1('0x3e')]);return db[_0x81b1('0x29')][_0x81b1('0x46')](_0x3333cf)['then'](handleEntityNotFound(_0x3937b2,null))[_0x81b1('0x23')](respondWithResult(_0x3937b2,null))[_0x81b1('0x47')](handleError(_0x3937b2,null));};exports[_0x81b1('0x48')]=function(_0xc1bb34,_0xf98314){return db['Dynamics365Field']['create'](_0xc1bb34['body'],{})[_0x81b1('0x23')](respondWithResult(_0xf98314,0xc9))[_0x81b1('0x47')](handleError(_0xf98314,null));};exports['update']=function(_0x52e90,_0x1679cc){if(_0x52e90[_0x81b1('0x49')]['id']){delete _0x52e90['body']['id'];}return db['Dynamics365Field'][_0x81b1('0x46')]({'where':{'id':_0x52e90[_0x81b1('0x44')]['id']}})[_0x81b1('0x23')](handleEntityNotFound(_0x1679cc,null))[_0x81b1('0x23')](saveUpdates(_0x52e90[_0x81b1('0x49')],null))[_0x81b1('0x23')](respondWithResult(_0x1679cc,null))[_0x81b1('0x47')](handleError(_0x1679cc,null));};exports[_0x81b1('0x24')]=function(_0x35e616,_0x586cfd){return db['Dynamics365Field'][_0x81b1('0x46')]({'where':{'id':_0x35e616[_0x81b1('0x44')]['id']}})['then'](handleEntityNotFound(_0x586cfd,null))[_0x81b1('0x23')](removeEntity(_0x586cfd,null))[_0x81b1('0x47')](handleError(_0x586cfd,null));};
\ No newline at end of file
+var _0x4860=['rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','options','Dynamics365Field','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map'];(function(_0x15f236,_0x59a12b){var _0x3645c0=function(_0x574879){while(--_0x574879){_0x15f236['push'](_0x15f236['shift']());}};_0x3645c0(++_0x59a12b);}(_0x4860,0x1c7));var _0x0486=function(_0x4320a1,_0x151d94){_0x4320a1=_0x4320a1-0x0;var _0x2ed966=_0x4860[_0x4320a1];return _0x2ed966;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0486('0x0'));var zipdir=require(_0x0486('0x1'));var jsonpatch=require(_0x0486('0x2'));var rp=require(_0x0486('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0486('0x4'));var util=require(_0x0486('0x5'));var path=require(_0x0486('0x6'));var sox=require('sox');var csv=require(_0x0486('0x7'));var ejs=require(_0x0486('0x8'));var fs=require('fs');var fs_extra=require(_0x0486('0x9'));var _=require(_0x0486('0xa'));var squel=require('squel');var crypto=require(_0x0486('0xb'));var jsforce=require(_0x0486('0xc'));var deskjs=require(_0x0486('0xd'));var toCsv=require(_0x0486('0x7'));var querystring=require(_0x0486('0xe'));var Papa=require(_0x0486('0xf'));var Redis=require(_0x0486('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0486('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0486('0x12'));var logger=require(_0x0486('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0486('0x14'));var db=require(_0x0486('0x15'))['db'];function respondWithStatusCode(_0x37663d,_0x545254){_0x545254=_0x545254||0xcc;return function(_0x166ef9){if(_0x166ef9){return _0x37663d['sendStatus'](_0x545254);}return _0x37663d[_0x0486('0x16')](_0x545254)[_0x0486('0x17')]();};}function respondWithResult(_0x322e3b,_0x564bd1){_0x564bd1=_0x564bd1||0xc8;return function(_0x302717){if(_0x302717){return _0x322e3b[_0x0486('0x16')](_0x564bd1)['json'](_0x302717);}};}function respondWithFilteredResult(_0x8ab88e,_0x5c911d){return function(_0x20d417){if(_0x20d417){var _0x3016c7=typeof _0x5c911d[_0x0486('0x18')]===_0x0486('0x19')&&typeof _0x5c911d['limit']==='undefined';var _0xf96566=_0x20d417[_0x0486('0x1a')];var _0x3ab48f=_0x3016c7?0x0:_0x5c911d[_0x0486('0x18')];var _0x34bc1d=_0x3016c7?_0x20d417[_0x0486('0x1a')]:_0x5c911d['offset']+_0x5c911d[_0x0486('0x1b')];var _0x5d9ed9;if(_0x34bc1d>=_0xf96566){_0x34bc1d=_0xf96566;_0x5d9ed9=0xc8;}else{_0x5d9ed9=0xce;}_0x8ab88e[_0x0486('0x16')](_0x5d9ed9);return _0x8ab88e[_0x0486('0x1c')]('Content-Range',_0x3ab48f+'-'+_0x34bc1d+'/'+_0xf96566)[_0x0486('0x1d')](_0x20d417);}return null;};}function patchUpdates(_0x3dc139){return function(_0x4b8475){try{jsonpatch[_0x0486('0x1e')](_0x4b8475,_0x3dc139,!![]);}catch(_0x38fd96){return BPromise[_0x0486('0x1f')](_0x38fd96);}return _0x4b8475[_0x0486('0x20')]();};}function saveUpdates(_0x33c99c,_0x2f0a12){return function(_0x403e9d){if(_0x403e9d){return _0x403e9d[_0x0486('0x21')](_0x33c99c)[_0x0486('0x22')](function(_0x55d10a){return _0x55d10a;});}return null;};}function removeEntity(_0x16ed5e,_0x371e80){return function(_0x49795e){if(_0x49795e){return _0x49795e[_0x0486('0x23')]()[_0x0486('0x22')](function(){_0x16ed5e[_0x0486('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fba71,_0x10ba4f){return function(_0x47d44f){if(!_0x47d44f){_0x3fba71[_0x0486('0x24')](0x194);}return _0x47d44f;};}function handleError(_0x2ffb1e,_0x167ea3){_0x167ea3=_0x167ea3||0x1f4;return function(_0xf22f4e){logger['error'](_0xf22f4e[_0x0486('0x25')]);if(_0xf22f4e[_0x0486('0x26')]){delete _0xf22f4e[_0x0486('0x26')];}_0x2ffb1e[_0x0486('0x16')](_0x167ea3)[_0x0486('0x27')](_0xf22f4e);};}exports[_0x0486('0x28')]=function(_0x435149,_0x4bfb68){var _0x2fd3f2={},_0x57d725={},_0xd40cc2={'count':0x0,'rows':[]};var _0x4d23c1=_[_0x0486('0x29')](db['Dynamics365Field'][_0x0486('0x2a')],function(_0x165216){return{'name':_0x165216[_0x0486('0x2b')],'type':_0x165216['type'][_0x0486('0x2c')]};});_0x57d725[_0x0486('0x2d')]=_[_0x0486('0x29')](_0x4d23c1,_0x0486('0x26'));_0x57d725[_0x0486('0x2e')]=_[_0x0486('0x2f')](_0x435149[_0x0486('0x2e')]);_0x57d725[_0x0486('0x30')]=_[_0x0486('0x31')](_0x57d725[_0x0486('0x2d')],_0x57d725[_0x0486('0x2e')]);_0x2fd3f2[_0x0486('0x32')]=_['intersection'](_0x57d725[_0x0486('0x2d')],qs[_0x0486('0x33')](_0x435149[_0x0486('0x2e')][_0x0486('0x33')]));_0x2fd3f2['attributes']=_0x2fd3f2[_0x0486('0x32')][_0x0486('0x34')]?_0x2fd3f2[_0x0486('0x32')]:_0x57d725['model'];if(!_0x435149[_0x0486('0x2e')][_0x0486('0x35')](_0x0486('0x36'))){_0x2fd3f2[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x435149[_0x0486('0x2e')][_0x0486('0x1b')]);_0x2fd3f2['offset']=qs[_0x0486('0x18')](_0x435149[_0x0486('0x2e')][_0x0486('0x18')]);}_0x2fd3f2[_0x0486('0x37')]=qs['sort'](_0x435149[_0x0486('0x2e')]['sort']);_0x2fd3f2[_0x0486('0x38')]=qs[_0x0486('0x30')](_[_0x0486('0x39')](_0x435149['query'],_0x57d725[_0x0486('0x30')]),_0x4d23c1);if(_0x435149[_0x0486('0x2e')]['filter']){_0x2fd3f2[_0x0486('0x38')]=_[_0x0486('0x3a')](_0x2fd3f2[_0x0486('0x38')],{'$or':_['map'](_0x4d23c1,function(_0x2279c1){if(_0x2279c1[_0x0486('0x3b')]!=='VIRTUAL'){var _0x72b3fc={};_0x72b3fc[_0x2279c1[_0x0486('0x26')]]={'$like':'%'+_0x435149['query']['filter']+'%'};return _0x72b3fc;}})});}_0x2fd3f2=_[_0x0486('0x3a')]({},_0x2fd3f2,_0x435149[_0x0486('0x3c')]);var _0x4bf0ca={'where':_0x2fd3f2[_0x0486('0x38')]};return db[_0x0486('0x3d')][_0x0486('0x1a')](_0x4bf0ca)[_0x0486('0x22')](function(_0x32f097){_0xd40cc2['count']=_0x32f097;if(_0x435149['query']['includeAll']){_0x2fd3f2[_0x0486('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x0486('0x3f')](_0x2fd3f2);})['then'](function(_0x272468){_0xd40cc2[_0x0486('0x40')]=_0x272468;return _0xd40cc2;})[_0x0486('0x22')](respondWithFilteredResult(_0x4bfb68,_0x2fd3f2))[_0x0486('0x41')](handleError(_0x4bfb68,null));};exports[_0x0486('0x42')]=function(_0x488457,_0x2b6720){var _0x41bb7d={'raw':!![],'where':{'id':_0x488457[_0x0486('0x43')]['id']}},_0x49b0b2={};_0x49b0b2[_0x0486('0x2d')]=_[_0x0486('0x2f')](db[_0x0486('0x3d')][_0x0486('0x2a')]);_0x49b0b2[_0x0486('0x2e')]=_[_0x0486('0x2f')](_0x488457['query']);_0x49b0b2[_0x0486('0x30')]=_[_0x0486('0x31')](_0x49b0b2['model'],_0x49b0b2[_0x0486('0x2e')]);_0x41bb7d[_0x0486('0x32')]=_[_0x0486('0x31')](_0x49b0b2[_0x0486('0x2d')],qs[_0x0486('0x33')](_0x488457[_0x0486('0x2e')][_0x0486('0x33')]));_0x41bb7d[_0x0486('0x32')]=_0x41bb7d[_0x0486('0x32')][_0x0486('0x34')]?_0x41bb7d[_0x0486('0x32')]:_0x49b0b2[_0x0486('0x2d')];if(_0x488457[_0x0486('0x2e')]['includeAll']){_0x41bb7d[_0x0486('0x3e')]=[{'all':!![]}];}_0x41bb7d=_[_0x0486('0x3a')]({},_0x41bb7d,_0x488457[_0x0486('0x3c')]);return db[_0x0486('0x3d')][_0x0486('0x44')](_0x41bb7d)[_0x0486('0x22')](handleEntityNotFound(_0x2b6720,null))[_0x0486('0x22')](respondWithResult(_0x2b6720,null))['catch'](handleError(_0x2b6720,null));};exports[_0x0486('0x45')]=function(_0x51cc1e,_0x120430){return db[_0x0486('0x3d')][_0x0486('0x45')](_0x51cc1e[_0x0486('0x46')],{})[_0x0486('0x22')](respondWithResult(_0x120430,0xc9))[_0x0486('0x41')](handleError(_0x120430,null));};exports[_0x0486('0x21')]=function(_0x628381,_0x481356){if(_0x628381['body']['id']){delete _0x628381[_0x0486('0x46')]['id'];}return db[_0x0486('0x3d')][_0x0486('0x44')]({'where':{'id':_0x628381[_0x0486('0x43')]['id']}})[_0x0486('0x22')](handleEntityNotFound(_0x481356,null))[_0x0486('0x22')](saveUpdates(_0x628381[_0x0486('0x46')],null))[_0x0486('0x22')](respondWithResult(_0x481356,null))[_0x0486('0x41')](handleError(_0x481356,null));};exports[_0x0486('0x23')]=function(_0x38d705,_0x3bc8d8){return db[_0x0486('0x3d')][_0x0486('0x44')]({'where':{'id':_0x38d705['params']['id']}})[_0x0486('0x22')](handleEntityNotFound(_0x3bc8d8,null))[_0x0486('0x22')](removeEntity(_0x3bc8d8,null))['catch'](handleError(_0x3bc8d8,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b87=['FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','idField'];(function(_0x406a4b,_0x466e37){var _0x419ee3=function(_0x3ca4de){while(--_0x3ca4de){_0x406a4b['push'](_0x406a4b['shift']());}};_0x419ee3(++_0x466e37);}(_0x1b87,0x189));var _0x71b8=function(_0x2f036e,_0x408b81){_0x2f036e=_0x2f036e-0x0;var _0x260ba1=_0x1b87[_0x2f036e];return _0x260ba1;};'use strict';var _=require(_0x71b8('0x0'));var util=require(_0x71b8('0x1'));var logger=require('../../config/logger')(_0x71b8('0x2'));var moment=require('moment');var BPromise=require(_0x71b8('0x3'));var rp=require(_0x71b8('0x4'));var fs=require('fs');var path=require(_0x71b8('0x5'));var rimraf=require(_0x71b8('0x6'));var config=require(_0x71b8('0x7'));var attributes=require(_0x71b8('0x8'));module[_0x71b8('0x9')]=function(_0x1f097e,_0xedd87a){return _0x1f097e[_0x71b8('0xa')](_0x71b8('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x71b8('0xc'),_0x71b8('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x91fd=['moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x140d60,_0x26f24f){var _0x10231d=function(_0x380f13){while(--_0x380f13){_0x140d60['push'](_0x140d60['shift']());}};_0x10231d(++_0x26f24f);}(_0x91fd,0x1af));var _0xd91f=function(_0x5b88c2,_0x3515bf){_0x5b88c2=_0x5b88c2-0x0;var _0x278b84=_0x91fd[_0x5b88c2];return _0x278b84;};'use strict';var _=require(_0xd91f('0x0'));var util=require(_0xd91f('0x1'));var logger=require(_0xd91f('0x2'))(_0xd91f('0x3'));var moment=require(_0xd91f('0x4'));var BPromise=require(_0xd91f('0x5'));var rp=require(_0xd91f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd91f('0x7'));var config=require(_0xd91f('0x8'));var attributes=require(_0xd91f('0x9'));module[_0xd91f('0xa')]=function(_0x2ac05c,_0xf31b73){return _0x2ac05c[_0xd91f('0xb')]('Dynamics365Field',attributes,{'tableName':_0xd91f('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xd91f('0xd'),_0xd91f('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x60d1=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x1ac658,_0x3dd4c5){var _0x5598e3=function(_0x39d6b){while(--_0x39d6b){_0x1ac658['push'](_0x1ac658['shift']());}};_0x5598e3(++_0x3dd4c5);}(_0x60d1,0x1cf));var _0x160d=function(_0x1ea9dd,_0x1798f1){_0x1ea9dd=_0x1ea9dd-0x0;var _0x1409af=_0x60d1[_0x1ea9dd];return _0x1409af;};'use strict';var _=require(_0x160d('0x0'));var util=require(_0x160d('0x1'));var moment=require('moment');var BPromise=require(_0x160d('0x2'));var rs=require(_0x160d('0x3'));var fs=require('fs');var Redis=require(_0x160d('0x4'));var db=require(_0x160d('0x5'))['db'];var utils=require(_0x160d('0x6'));var logger=require(_0x160d('0x7'))(_0x160d('0x8'));var config=require(_0x160d('0x9'));var jayson=require(_0x160d('0xa'));var client=jayson[_0x160d('0xb')][_0x160d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x429c40,_0x4d6974,_0x33181d){return new BPromise(function(_0x4610d3,_0x5806e6){return client[_0x160d('0xd')](_0x429c40,_0x33181d)['then'](function(_0x5a3caa){logger[_0x160d('0xe')](_0x160d('0xf'),_0x4d6974,_0x160d('0x10'));logger[_0x160d('0x11')](_0x160d('0x12'),_0x4d6974,_0x160d('0x10'),JSON['stringify'](_0x5a3caa));if(_0x5a3caa[_0x160d('0x13')]){if(_0x5a3caa[_0x160d('0x13')][_0x160d('0x14')]===0x1f4){logger[_0x160d('0x13')](_0x160d('0xf'),_0x4d6974,_0x5a3caa[_0x160d('0x13')][_0x160d('0x15')]);return _0x5806e6(_0x5a3caa[_0x160d('0x13')]['message']);}logger[_0x160d('0x13')](_0x160d('0xf'),_0x4d6974,_0x5a3caa[_0x160d('0x13')][_0x160d('0x15')]);return _0x4610d3(_0x5a3caa[_0x160d('0x13')][_0x160d('0x15')]);}else{logger[_0x160d('0xe')](_0x160d('0xf'),_0x4d6974,_0x160d('0x10'));_0x4610d3(_0x5a3caa[_0x160d('0x16')]['message']);}})[_0x160d('0x17')](function(_0x588f32){logger['error'](_0x160d('0xf'),_0x4d6974,_0x588f32);_0x5806e6(_0x588f32);});});}
\ No newline at end of file
+var _0xa72a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x5b9a68,_0x5df294){var _0x4f49ea=function(_0x5db2fb){while(--_0x5db2fb){_0x5b9a68['push'](_0x5b9a68['shift']());}};_0x4f49ea(++_0x5df294);}(_0xa72a,0x13b));var _0xaa72=function(_0x499caf,_0x34744f){_0x499caf=_0x499caf-0x0;var _0x47b9bb=_0xa72a[_0x499caf];return _0x47b9bb;};'use strict';var _=require(_0xaa72('0x0'));var util=require(_0xaa72('0x1'));var moment=require(_0xaa72('0x2'));var BPromise=require(_0xaa72('0x3'));var rs=require(_0xaa72('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa72('0x5'));var logger=require(_0xaa72('0x6'))(_0xaa72('0x7'));var config=require(_0xaa72('0x8'));var jayson=require(_0xaa72('0x9'));var client=jayson[_0xaa72('0xa')][_0xaa72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a57d5,_0x5e9152,_0x23ccf6){return new BPromise(function(_0x52f661,_0x1c2138){return client[_0xaa72('0xc')](_0x2a57d5,_0x23ccf6)[_0xaa72('0xd')](function(_0x631b5b){logger[_0xaa72('0xe')](_0xaa72('0xf'),_0x5e9152,_0xaa72('0x10'));logger[_0xaa72('0x11')](_0xaa72('0x12'),_0x5e9152,_0xaa72('0x10'),JSON[_0xaa72('0x13')](_0x631b5b));if(_0x631b5b[_0xaa72('0x14')]){if(_0x631b5b[_0xaa72('0x14')]['code']===0x1f4){logger[_0xaa72('0x14')](_0xaa72('0xf'),_0x5e9152,_0x631b5b[_0xaa72('0x14')][_0xaa72('0x15')]);return _0x1c2138(_0x631b5b[_0xaa72('0x14')][_0xaa72('0x15')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x5e9152,_0x631b5b[_0xaa72('0x14')][_0xaa72('0x15')]);return _0x52f661(_0x631b5b[_0xaa72('0x14')][_0xaa72('0x15')]);}else{logger['info'](_0xaa72('0xf'),_0x5e9152,_0xaa72('0x10'));_0x52f661(_0x631b5b[_0xaa72('0x16')]['message']);}})['catch'](function(_0x220b4d){logger[_0xaa72('0x14')](_0xaa72('0xf'),_0x5e9152,_0x220b4d);_0x1c2138(_0x220b4d);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','addConfiguration','put','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x4f33cb,_0x46c73d){var _0x2b2dbd=function(_0x2e4abf){while(--_0x2e4abf){_0x4f33cb['push'](_0x4f33cb['shift']());}};_0x2b2dbd(++_0x46c73d);}(_0x24a8,0x1c5));var _0x824a=function(_0x32e0ca,_0x169682){_0x32e0ca=_0x32e0ca-0x0;var _0x24c7ac=_0x24a8[_0x32e0ca];return _0x24c7ac;};'use strict';var multer=require(_0x824a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x824a('0x1'));var express=require(_0x824a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x824a('0x3'));var interaction=require(_0x824a('0x4'));var config=require(_0x824a('0x5'));var controller=require(_0x824a('0x6'));router[_0x824a('0x7')]('/',auth['isAuthenticated'](),controller[_0x824a('0x8')]);router['get'](_0x824a('0x9'),auth[_0x824a('0xa')](),controller['show']);router['get'](_0x824a('0xb'),auth[_0x824a('0xa')](),controller[_0x824a('0xc')]);router['get'](_0x824a('0xd'),auth[_0x824a('0xa')](),controller['getFields']);router['post']('/',auth[_0x824a('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0x824a('0xa')](),controller[_0x824a('0xe')]);router[_0x824a('0xf')](_0x824a('0x9'),auth[_0x824a('0xa')](),controller['update']);router[_0x824a('0x10')](_0x824a('0x9'),auth[_0x824a('0xa')](),controller[_0x824a('0x11')]);module[_0x824a('0x12')]=router;
\ No newline at end of file
+var _0xeb36=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer'];(function(_0x8afd3a,_0x2773a2){var _0x142833=function(_0x5c97ae){while(--_0x5c97ae){_0x8afd3a['push'](_0x8afd3a['shift']());}};_0x142833(++_0x2773a2);}(_0xeb36,0x77));var _0x6eb3=function(_0x7a9d95,_0xde9516){_0x7a9d95=_0x7a9d95-0x0;var _0x52c6f1=_0xeb36[_0x7a9d95];return _0x52c6f1;};'use strict';var multer=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var path=require(_0x6eb3('0x2'));var timeout=require(_0x6eb3('0x3'));var express=require('express');var router=express[_0x6eb3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6eb3('0x5'));var interaction=require(_0x6eb3('0x6'));var config=require('../../config/environment');var controller=require(_0x6eb3('0x7'));router[_0x6eb3('0x8')]('/',auth[_0x6eb3('0x9')](),controller[_0x6eb3('0xa')]);router[_0x6eb3('0x8')](_0x6eb3('0xb'),auth['isAuthenticated'](),controller[_0x6eb3('0xc')]);router[_0x6eb3('0x8')](_0x6eb3('0xd'),auth[_0x6eb3('0x9')](),controller[_0x6eb3('0xe')]);router['get'](_0x6eb3('0xf'),auth[_0x6eb3('0x9')](),controller[_0x6eb3('0x10')]);router[_0x6eb3('0x11')]('/',auth['isAuthenticated'](),controller[_0x6eb3('0x12')]);router[_0x6eb3('0x11')](_0x6eb3('0xd'),auth[_0x6eb3('0x9')](),controller[_0x6eb3('0x13')]);router[_0x6eb3('0x14')]('/:id',auth[_0x6eb3('0x9')](),controller['update']);router[_0x6eb3('0x15')]('/:id',auth[_0x6eb3('0x9')](),controller[_0x6eb3('0x16')]);module[_0x6eb3('0x17')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c9a=['sequelize','STRING','username','remoteUri'];(function(_0x292a35,_0x5a325f){var _0xb5d07a=function(_0x18e078){while(--_0x18e078){_0x292a35['push'](_0x292a35['shift']());}};_0xb5d07a(++_0x5a325f);}(_0x1c9a,0x98));var _0xa1c9=function(_0x4b7aca,_0x5cfe48){_0x4b7aca=_0x4b7aca-0x0;var _0x542539=_0x1c9a[_0x4b7aca];return _0x542539;};'use strict';var Sequelize=require(_0xa1c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa1c9('0x1')],'unique':_0xa1c9('0x2')},'apiKey':{'type':Sequelize[_0xa1c9('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa1c9('0x3')},'serverUrl':{'type':Sequelize[_0xa1c9('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['STRING','username','remoteUri','sequelize'];(function(_0x43c913,_0x198c3d){var _0x4a4945=function(_0x59e7e2){while(--_0x59e7e2){_0x43c913['push'](_0x43c913['shift']());}};_0x4a4945(++_0x198c3d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x0b0e[_0x246115];return _0x385878;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x2')},'apiKey':{'type':Sequelize[_0xe0b0('0x1')]},'remoteUri':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x3')},'serverUrl':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbefe=['remoteUri','slice','lastIndexOf','GET','format','api/v2/ticket_fields','apiKey','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','capitalize','statusCode','stringify','send','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','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','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','map','rawAttributes','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','filters','merge','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields'];(function(_0x57ccb9,_0x3db5a2){var _0x2a6fe3=function(_0x9ae573){while(--_0x9ae573){_0x57ccb9['push'](_0x57ccb9['shift']());}};_0x2a6fe3(++_0x3db5a2);}(_0xbefe,0x168));var _0xebef=function(_0x274208,_0x3182ff){_0x274208=_0x274208-0x0;var _0x209164=_0xbefe[_0x274208];return _0x209164;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];var integrations=require(_0xebef('0x1a'));function respondWithStatusCode(_0x566dbe,_0x584ac2){_0x584ac2=_0x584ac2||0xcc;return function(_0x5dd833){if(_0x5dd833){return _0x566dbe['sendStatus'](_0x584ac2);}return _0x566dbe[_0xebef('0x1b')](_0x584ac2)[_0xebef('0x1c')]();};}function respondWithResult(_0x31772a,_0x35cd7a){_0x35cd7a=_0x35cd7a||0xc8;return function(_0x2f53e5){if(_0x2f53e5){return _0x31772a[_0xebef('0x1b')](_0x35cd7a)['json'](_0x2f53e5);}};}function respondWithFilteredResult(_0x32ec37,_0x9411d4){return function(_0x1921aa){if(_0x1921aa){var _0x46849f=typeof _0x9411d4[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x9411d4[_0xebef('0x1f')]===_0xebef('0x1e');var _0x2e5efa=_0x1921aa[_0xebef('0x20')];var _0x458e83=_0x46849f?0x0:_0x9411d4['offset'];var _0x1a99ba=_0x46849f?_0x1921aa[_0xebef('0x20')]:_0x9411d4[_0xebef('0x1d')]+_0x9411d4['limit'];var _0xc3518f;if(_0x1a99ba>=_0x2e5efa){_0x1a99ba=_0x2e5efa;_0xc3518f=0xc8;}else{_0xc3518f=0xce;}_0x32ec37[_0xebef('0x1b')](_0xc3518f);return _0x32ec37[_0xebef('0x21')](_0xebef('0x22'),_0x458e83+'-'+_0x1a99ba+'/'+_0x2e5efa)[_0xebef('0x23')](_0x1921aa);}return null;};}function patchUpdates(_0x138760){return function(_0x2f72e3){try{jsonpatch['apply'](_0x2f72e3,_0x138760,!![]);}catch(_0x4dcc76){return BPromise['reject'](_0x4dcc76);}return _0x2f72e3[_0xebef('0x24')]();};}function saveUpdates(_0x2f1193,_0x38f0b8){return function(_0x221a7e){if(_0x221a7e){return _0x221a7e[_0xebef('0x25')](_0x2f1193)[_0xebef('0x26')](function(_0xe8dcbf){return _0xe8dcbf;});}return null;};}function removeEntity(_0x5c5091,_0x460104){return function(_0x449767){if(_0x449767){return _0x449767[_0xebef('0x27')]()[_0xebef('0x26')](function(){_0x5c5091[_0xebef('0x1b')](0xcc)[_0xebef('0x1c')]();});}};}function handleEntityNotFound(_0x36ca6b,_0x42d2af){return function(_0x45bb67){if(!_0x45bb67){_0x36ca6b[_0xebef('0x28')](0x194);}return _0x45bb67;};}function handleError(_0x456a81,_0x4fb77f){_0x4fb77f=_0x4fb77f||0x1f4;return function(_0xc068de){logger['error'](_0xc068de['stack']);if(_0xc068de['name']){delete _0xc068de['name'];}_0x456a81['status'](_0x4fb77f)['send'](_0xc068de);};}exports['index']=function(_0x5703fc,_0x506e64){var _0x5a9249={},_0x54001c={},_0x136ac3={'count':0x0,'rows':[]};var _0x49a6fb=_[_0xebef('0x29')](db['FreshdeskAccount'][_0xebef('0x2a')],function(_0xa0a713){return{'name':_0xa0a713['fieldName'],'type':_0xa0a713[_0xebef('0x2b')]['key']};});_0x54001c[_0xebef('0x2c')]=_[_0xebef('0x29')](_0x49a6fb,_0xebef('0x2d'));_0x54001c[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5703fc[_0xebef('0x2e')]);_0x54001c['filters']=_[_0xebef('0x30')](_0x54001c['model'],_0x54001c[_0xebef('0x2e')]);_0x5a9249[_0xebef('0x31')]=_[_0xebef('0x30')](_0x54001c[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x32')]));_0x5a9249['attributes']=_0x5a9249[_0xebef('0x31')][_0xebef('0x33')]?_0x5a9249[_0xebef('0x31')]:_0x54001c[_0xebef('0x2c')];if(!_0x5703fc[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x5a9249['limit']=qs[_0xebef('0x1f')](_0x5703fc[_0xebef('0x2e')]['limit']);_0x5a9249[_0xebef('0x1d')]=qs[_0xebef('0x1d')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x1d')]);}_0x5a9249[_0xebef('0x36')]=qs['sort'](_0x5703fc[_0xebef('0x2e')][_0xebef('0x37')]);_0x5a9249['where']=qs['filters'](_[_0xebef('0x38')](_0x5703fc['query'],_0x54001c['filters']),_0x49a6fb);if(_0x5703fc['query'][_0xebef('0x39')]){_0x5a9249['where']=_['merge'](_0x5a9249[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x49a6fb,function(_0x1348a4){if(_0x1348a4['type']!==_0xebef('0x3b')){var _0x4d61c1={};_0x4d61c1[_0x1348a4['name']]={'$like':'%'+_0x5703fc['query'][_0xebef('0x39')]+'%'};return _0x4d61c1;}})});}_0x5a9249=_['merge']({},_0x5a9249,_0x5703fc[_0xebef('0x3c')]);var _0x5078ec={'where':_0x5a9249['where']};return db[_0xebef('0x3d')][_0xebef('0x20')](_0x5078ec)[_0xebef('0x26')](function(_0x297ee0){_0x136ac3[_0xebef('0x20')]=_0x297ee0;if(_0x5703fc[_0xebef('0x2e')]['includeAll']){_0x5a9249[_0xebef('0x3e')]=[{'all':!![]}];}return db[_0xebef('0x3d')][_0xebef('0x3f')](_0x5a9249);})[_0xebef('0x26')](function(_0x32b93c){_0x136ac3[_0xebef('0x40')]=_0x32b93c;return _0x136ac3;})[_0xebef('0x26')](respondWithFilteredResult(_0x506e64,_0x5a9249))[_0xebef('0x41')](handleError(_0x506e64,null));};exports[_0xebef('0x42')]=function(_0xa69151,_0x56fe84){var _0x5cf908={'raw':![],'where':{'id':_0xa69151['params']['id']}},_0x4e3f60={};_0x4e3f60[_0xebef('0x2c')]=_[_0xebef('0x2f')](db[_0xebef('0x3d')][_0xebef('0x2a')]);_0x4e3f60[_0xebef('0x2e')]=_['keys'](_0xa69151['query']);_0x4e3f60[_0xebef('0x43')]=_['intersection'](_0x4e3f60['model'],_0x4e3f60[_0xebef('0x2e')]);_0x5cf908[_0xebef('0x31')]=_[_0xebef('0x30')](_0x4e3f60[_0xebef('0x2c')],qs[_0xebef('0x32')](_0xa69151[_0xebef('0x2e')][_0xebef('0x32')]));_0x5cf908[_0xebef('0x31')]=_0x5cf908[_0xebef('0x31')][_0xebef('0x33')]?_0x5cf908[_0xebef('0x31')]:_0x4e3f60[_0xebef('0x2c')];if(_0xa69151[_0xebef('0x2e')]['includeAll']){_0x5cf908[_0xebef('0x3e')]=[{'all':!![]}];}_0x5cf908=_[_0xebef('0x44')]({},_0x5cf908,_0xa69151[_0xebef('0x3c')]);return db[_0xebef('0x3d')][_0xebef('0x45')](_0x5cf908)[_0xebef('0x26')](handleEntityNotFound(_0x56fe84,null))['then'](respondWithResult(_0x56fe84,null))[_0xebef('0x41')](handleError(_0x56fe84,null));};exports[_0xebef('0x46')]=function(_0x1c7c81,_0x4ce35e){return db['FreshdeskAccount'][_0xebef('0x46')](_0x1c7c81['body'],{})[_0xebef('0x26')](respondWithResult(_0x4ce35e,0xc9))[_0xebef('0x41')](handleError(_0x4ce35e,null));};exports[_0xebef('0x25')]=function(_0x1d70e8,_0x297550){if(_0x1d70e8[_0xebef('0x47')]['id']){delete _0x1d70e8[_0xebef('0x47')]['id'];}return db['FreshdeskAccount'][_0xebef('0x45')]({'where':{'id':_0x1d70e8['params']['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x297550,null))[_0xebef('0x26')](saveUpdates(_0x1d70e8[_0xebef('0x47')],null))[_0xebef('0x26')](respondWithResult(_0x297550,null))['catch'](handleError(_0x297550,null));};exports[_0xebef('0x27')]=function(_0x52f067,_0x5f1ce5){return db[_0xebef('0x3d')][_0xebef('0x45')]({'where':{'id':_0x52f067[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x5f1ce5,null))[_0xebef('0x26')](removeEntity(_0x5f1ce5,null))[_0xebef('0x41')](handleError(_0x5f1ce5,null));};exports[_0xebef('0x49')]=function(_0x35a755,_0x25bd2,_0x1189ff){var _0x255b01={};var _0xb1d606={};var _0x4321d4;var _0x766610;return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x35a755[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x25bd2,null))[_0xebef('0x26')](function(_0x59db6d){if(_0x59db6d){_0x4321d4=_0x59db6d;_0xb1d606['model']=_['keys'](db[_0xebef('0x4b')]['rawAttributes']);_0xb1d606['query']=_[_0xebef('0x2f')](_0x35a755[_0xebef('0x2e')]);_0xb1d606[_0xebef('0x43')]=_['intersection'](_0xb1d606[_0xebef('0x2c')],_0xb1d606[_0xebef('0x2e')]);_0x255b01[_0xebef('0x31')]=_[_0xebef('0x30')](_0xb1d606[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x35a755['query'][_0xebef('0x32')]));_0x255b01[_0xebef('0x31')]=_0x255b01['attributes']['length']?_0x255b01['attributes']:_0xb1d606[_0xebef('0x2c')];_0x255b01[_0xebef('0x36')]=qs[_0xebef('0x37')](_0x35a755[_0xebef('0x2e')][_0xebef('0x37')]);_0x255b01[_0xebef('0x3a')]=qs['filters'](_[_0xebef('0x38')](_0x35a755[_0xebef('0x2e')],_0xb1d606[_0xebef('0x43')]));if(_0x35a755['query'][_0xebef('0x39')]){_0x255b01['where']=_['merge'](_0x255b01[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x255b01[_0xebef('0x31')],function(_0x380206){var _0x353fe2={};_0x353fe2[_0x380206]={'$like':'%'+_0x35a755[_0xebef('0x2e')][_0xebef('0x39')]+'%'};return _0x353fe2;})});}_0x255b01=_['merge']({},_0x255b01,_0x35a755[_0xebef('0x3c')]);return _0x4321d4[_0xebef('0x49')](_0x255b01);}})[_0xebef('0x26')](function(_0x2f390a){if(_0x2f390a){_0x766610=_0x2f390a['length'];if(!_0x35a755[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x255b01[_0xebef('0x1f')]=qs['limit'](_0x35a755[_0xebef('0x2e')]['limit']);_0x255b01[_0xebef('0x1d')]=qs['offset'](_0x35a755[_0xebef('0x2e')][_0xebef('0x1d')]);}return _0x4321d4[_0xebef('0x49')](_0x255b01);}})['then'](function(_0x46d421){if(_0x46d421){return _0x46d421?{'count':_0x766610,'rows':_0x46d421}:null;}})['then'](respondWithResult(_0x25bd2,null))[_0xebef('0x41')](handleError(_0x25bd2,null));};exports[_0xebef('0x4c')]=function(_0xb117cf,_0x40ee9d,_0x424fc1){if(_0xb117cf['body']['id']){delete _0xb117cf[_0xebef('0x47')]['id'];}return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0xb117cf['params']['id']}})['then'](handleEntityNotFound(_0x40ee9d,null))[_0xebef('0x26')](function(_0xb0a7d6){if(_0xb0a7d6){_0xb117cf[_0xebef('0x47')][_0xebef('0x4d')]=_0xb0a7d6['id'];_0xb117cf[_0xebef('0x47')][_0xebef('0x4e')]=integrations[_0xebef('0x4f')](_0xb117cf[_0xebef('0x47')]['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);_0xb117cf[_0xebef('0x47')][_0xebef('0x50')]=integrations[_0xebef('0x51')](_0xb117cf['body']['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);return db[_0xebef('0x4b')]['create'](_0xb117cf[_0xebef('0x47')],{'include':[{'model':db[_0xebef('0x52')],'as':_0xebef('0x4e')},{'model':db[_0xebef('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x40ee9d,null))[_0xebef('0x41')](handleError(_0x40ee9d,null));};exports[_0xebef('0x53')]=function(_0x214bea,_0x41958a,_0x109a21){var _0x2c91c5='';return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x214bea[_0xebef('0x48')]['id']},'attributes':['id',_0xebef('0x54'),'apiKey']})[_0xebef('0x26')](handleEntityNotFound(_0x41958a,null))[_0xebef('0x26')](function(_0x1f7bc4){if(_0x1f7bc4){_0x2c91c5=_0x1f7bc4[_0xebef('0x54')];var _0x1c0eb6=_0x2c91c5[_0xebef('0x55')](-0x1);if(_0x1c0eb6==='/'){_0x2c91c5=_0x2c91c5['substring'](0x0,_0x2c91c5[_0xebef('0x56')](_0x1c0eb6));}return rp({'method':_0xebef('0x57'),'uri':util[_0xebef('0x58')]('%s/%s',_0x2c91c5,_0xebef('0x59')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xebef('0x58')]('%s:X',_0x1f7bc4[_0xebef('0x5a')]))['toString'](_0xebef('0x5b')))},'json':!![]});}})[_0xebef('0x26')](function(_0x2e4ca8){if(_0x2e4ca8){var _0x225aa1=[_0xebef('0x5c'),_0xebef('0x5d'),_0xebef('0x5e'),_0xebef('0x5f'),_0xebef('0x1b'),_0xebef('0x60'),_0xebef('0x61'),'source',_0xebef('0x62'),_0xebef('0x61'),_0xebef('0x63')];_[_0xebef('0x64')](_0x2e4ca8,function(_0x575591){return _0x225aa1[_0xebef('0x65')](_0x575591['name'])||!_0x575591[_0xebef('0x66')]&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x67')&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x68');});return{'count':_0x2e4ca8[_0xebef('0x33')],'rows':_[_0xebef('0x29')](_0x2e4ca8,function(_0x25d845){return{'id':_0x25d845[_0xebef('0x2d')],'name':_0x25d845['label'],'custom':!_0x25d845[_0xebef('0x66')],'options':_0x25d845['choices']?_[_0xebef('0x29')](_0x25d845['choices'],function(_0x110e23){return{'name':_[_0xebef('0x69')](_0x110e23),'value':_0x110e23};}):[]};})};}})['then'](respondWithResult(_0x41958a,null))[_0xebef('0x41')](function(_0x54a0b3){var _0x1209fc=_0x214bea[_0xebef('0x2e')]['test']?0x1f4:_0x54a0b3[_0xebef('0x6a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xebef('0x53'),_0x1209fc,JSON[_0xebef('0x6b')](_0x54a0b3));delete _0x54a0b3[_0xebef('0x2d')];if(_0x1209fc===0x191){_0x1209fc=0x190;}_0x41958a[_0xebef('0x1b')](_0x1209fc)[_0xebef('0x6c')](_0x214bea[_0xebef('0x2e')][_0xebef('0x6d')]?{'message':_0xebef('0x6e'),'statusCode':_0x54a0b3[_0xebef('0x6a')]}:_0x54a0b3);});};
\ No newline at end of file
+var _0xbf1a=['ticket_type','company','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','error','stack','name','send','FreshdeskAccount','rawAttributes','fieldName','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','apiKey','base64','subject','agent','description','priority','group'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xbf1a,0x7c));var _0xabf1=function(_0x30549b,_0x26d2f6){_0x30549b=_0x30549b-0x0;var _0x157be0=_0xbf1a[_0x30549b];return _0x157be0;};'use strict';var emlformat=require(_0xabf1('0x0'));var rimraf=require(_0xabf1('0x1'));var zipdir=require(_0xabf1('0x2'));var jsonpatch=require(_0xabf1('0x3'));var rp=require(_0xabf1('0x4'));var moment=require('moment');var BPromise=require(_0xabf1('0x5'));var Mustache=require('mustache');var util=require(_0xabf1('0x6'));var path=require(_0xabf1('0x7'));var sox=require(_0xabf1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabf1('0x9'));var _=require('lodash');var squel=require(_0xabf1('0xa'));var crypto=require(_0xabf1('0xb'));var jsforce=require(_0xabf1('0xc'));var deskjs=require(_0xabf1('0xd'));var toCsv=require(_0xabf1('0xe'));var querystring=require(_0xabf1('0xf'));var Papa=require('papaparse');var Redis=require(_0xabf1('0x10'));var authService=require(_0xabf1('0x11'));var qs=require(_0xabf1('0x12'));var as=require(_0xabf1('0x13'));var hardwareService=require(_0xabf1('0x14'));var logger=require(_0xabf1('0x15'))('api');var utils=require(_0xabf1('0x16'));var config=require(_0xabf1('0x17'));var licenseUtil=require(_0xabf1('0x18'));var db=require(_0xabf1('0x19'))['db'];var integrations=require(_0xabf1('0x1a'));function respondWithStatusCode(_0x1186b7,_0x27ade4){_0x27ade4=_0x27ade4||0xcc;return function(_0x4853d5){if(_0x4853d5){return _0x1186b7[_0xabf1('0x1b')](_0x27ade4);}return _0x1186b7[_0xabf1('0x1c')](_0x27ade4)['end']();};}function respondWithResult(_0x783976,_0xcbe7da){_0xcbe7da=_0xcbe7da||0xc8;return function(_0x248705){if(_0x248705){return _0x783976['status'](_0xcbe7da)[_0xabf1('0x1d')](_0x248705);}};}function respondWithFilteredResult(_0x3dd81a,_0x719d3e){return function(_0x3537e4){if(_0x3537e4){var _0x49cfe3=typeof _0x719d3e[_0xabf1('0x1e')]==='undefined'&&typeof _0x719d3e[_0xabf1('0x1f')]===_0xabf1('0x20');var _0x392c5f=_0x3537e4[_0xabf1('0x21')];var _0x26e9f8=_0x49cfe3?0x0:_0x719d3e[_0xabf1('0x1e')];var _0x3cfc35=_0x49cfe3?_0x3537e4[_0xabf1('0x21')]:_0x719d3e[_0xabf1('0x1e')]+_0x719d3e[_0xabf1('0x1f')];var _0x2d34db;if(_0x3cfc35>=_0x392c5f){_0x3cfc35=_0x392c5f;_0x2d34db=0xc8;}else{_0x2d34db=0xce;}_0x3dd81a[_0xabf1('0x1c')](_0x2d34db);return _0x3dd81a[_0xabf1('0x22')](_0xabf1('0x23'),_0x26e9f8+'-'+_0x3cfc35+'/'+_0x392c5f)[_0xabf1('0x1d')](_0x3537e4);}return null;};}function patchUpdates(_0x5a0413){return function(_0x5444b4){try{jsonpatch[_0xabf1('0x24')](_0x5444b4,_0x5a0413,!![]);}catch(_0x167d5d){return BPromise[_0xabf1('0x25')](_0x167d5d);}return _0x5444b4['save']();};}function saveUpdates(_0x216862,_0x3fbce0){return function(_0x3bd4b6){if(_0x3bd4b6){return _0x3bd4b6['update'](_0x216862)[_0xabf1('0x26')](function(_0x57fea6){return _0x57fea6;});}return null;};}function removeEntity(_0x30fac8,_0x551401){return function(_0x5ccb6f){if(_0x5ccb6f){return _0x5ccb6f['destroy']()[_0xabf1('0x26')](function(){_0x30fac8[_0xabf1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c6f0,_0x69ddb8){return function(_0x577b0f){if(!_0x577b0f){_0x14c6f0['sendStatus'](0x194);}return _0x577b0f;};}function handleError(_0x25d432,_0x175678){_0x175678=_0x175678||0x1f4;return function(_0x3e58f6){logger[_0xabf1('0x27')](_0x3e58f6[_0xabf1('0x28')]);if(_0x3e58f6['name']){delete _0x3e58f6[_0xabf1('0x29')];}_0x25d432['status'](_0x175678)[_0xabf1('0x2a')](_0x3e58f6);};}exports['index']=function(_0xb54b63,_0x582fbf){var _0x45e64f={},_0x139540={},_0xe3ecbb={'count':0x0,'rows':[]};var _0x139802=_['map'](db[_0xabf1('0x2b')][_0xabf1('0x2c')],function(_0x4d3dd7){return{'name':_0x4d3dd7[_0xabf1('0x2d')],'type':_0x4d3dd7['type']['key']};});_0x139540['model']=_[_0xabf1('0x2e')](_0x139802,_0xabf1('0x29'));_0x139540[_0xabf1('0x2f')]=_[_0xabf1('0x30')](_0xb54b63['query']);_0x139540[_0xabf1('0x31')]=_[_0xabf1('0x32')](_0x139540[_0xabf1('0x33')],_0x139540[_0xabf1('0x2f')]);_0x45e64f['attributes']=_[_0xabf1('0x32')](_0x139540['model'],qs[_0xabf1('0x34')](_0xb54b63['query']['fields']));_0x45e64f[_0xabf1('0x35')]=_0x45e64f[_0xabf1('0x35')][_0xabf1('0x36')]?_0x45e64f[_0xabf1('0x35')]:_0x139540[_0xabf1('0x33')];if(!_0xb54b63[_0xabf1('0x2f')][_0xabf1('0x37')](_0xabf1('0x38'))){_0x45e64f['limit']=qs[_0xabf1('0x1f')](_0xb54b63[_0xabf1('0x2f')]['limit']);_0x45e64f['offset']=qs['offset'](_0xb54b63[_0xabf1('0x2f')]['offset']);}_0x45e64f[_0xabf1('0x39')]=qs[_0xabf1('0x3a')](_0xb54b63[_0xabf1('0x2f')][_0xabf1('0x3a')]);_0x45e64f['where']=qs[_0xabf1('0x31')](_['pick'](_0xb54b63[_0xabf1('0x2f')],_0x139540[_0xabf1('0x31')]),_0x139802);if(_0xb54b63[_0xabf1('0x2f')][_0xabf1('0x3b')]){_0x45e64f['where']=_[_0xabf1('0x3c')](_0x45e64f[_0xabf1('0x3d')],{'$or':_[_0xabf1('0x2e')](_0x139802,function(_0x284a36){if(_0x284a36[_0xabf1('0x3e')]!==_0xabf1('0x3f')){var _0x378b54={};_0x378b54[_0x284a36[_0xabf1('0x29')]]={'$like':'%'+_0xb54b63[_0xabf1('0x2f')][_0xabf1('0x3b')]+'%'};return _0x378b54;}})});}_0x45e64f=_['merge']({},_0x45e64f,_0xb54b63['options']);var _0x3d52bc={'where':_0x45e64f[_0xabf1('0x3d')]};return db[_0xabf1('0x2b')][_0xabf1('0x21')](_0x3d52bc)[_0xabf1('0x26')](function(_0x588e20){_0xe3ecbb[_0xabf1('0x21')]=_0x588e20;if(_0xb54b63['query'][_0xabf1('0x40')]){_0x45e64f[_0xabf1('0x41')]=[{'all':!![]}];}return db[_0xabf1('0x2b')][_0xabf1('0x42')](_0x45e64f);})[_0xabf1('0x26')](function(_0x6719e0){_0xe3ecbb['rows']=_0x6719e0;return _0xe3ecbb;})['then'](respondWithFilteredResult(_0x582fbf,_0x45e64f))[_0xabf1('0x43')](handleError(_0x582fbf,null));};exports['show']=function(_0x2500d5,_0xdf51f2){var _0x14368a={'raw':![],'where':{'id':_0x2500d5[_0xabf1('0x44')]['id']}},_0x3757fb={};_0x3757fb['model']=_[_0xabf1('0x30')](db[_0xabf1('0x2b')]['rawAttributes']);_0x3757fb[_0xabf1('0x2f')]=_[_0xabf1('0x30')](_0x2500d5[_0xabf1('0x2f')]);_0x3757fb[_0xabf1('0x31')]=_['intersection'](_0x3757fb[_0xabf1('0x33')],_0x3757fb['query']);_0x14368a[_0xabf1('0x35')]=_[_0xabf1('0x32')](_0x3757fb[_0xabf1('0x33')],qs['fields'](_0x2500d5[_0xabf1('0x2f')][_0xabf1('0x34')]));_0x14368a['attributes']=_0x14368a['attributes'][_0xabf1('0x36')]?_0x14368a[_0xabf1('0x35')]:_0x3757fb[_0xabf1('0x33')];if(_0x2500d5['query']['includeAll']){_0x14368a['include']=[{'all':!![]}];}_0x14368a=_[_0xabf1('0x3c')]({},_0x14368a,_0x2500d5[_0xabf1('0x45')]);return db[_0xabf1('0x2b')][_0xabf1('0x46')](_0x14368a)['then'](handleEntityNotFound(_0xdf51f2,null))['then'](respondWithResult(_0xdf51f2,null))[_0xabf1('0x43')](handleError(_0xdf51f2,null));};exports[_0xabf1('0x47')]=function(_0xb1bb2e,_0x47df69){return db[_0xabf1('0x2b')][_0xabf1('0x47')](_0xb1bb2e['body'],{})['then'](respondWithResult(_0x47df69,0xc9))['catch'](handleError(_0x47df69,null));};exports['update']=function(_0x4771b5,_0x307507){if(_0x4771b5[_0xabf1('0x48')]['id']){delete _0x4771b5[_0xabf1('0x48')]['id'];}return db[_0xabf1('0x2b')][_0xabf1('0x46')]({'where':{'id':_0x4771b5[_0xabf1('0x44')]['id']}})[_0xabf1('0x26')](handleEntityNotFound(_0x307507,null))[_0xabf1('0x26')](saveUpdates(_0x4771b5['body'],null))['then'](respondWithResult(_0x307507,null))['catch'](handleError(_0x307507,null));};exports['destroy']=function(_0x2ba3d1,_0x565122){return db[_0xabf1('0x2b')]['find']({'where':{'id':_0x2ba3d1['params']['id']}})['then'](handleEntityNotFound(_0x565122,null))['then'](removeEntity(_0x565122,null))[_0xabf1('0x43')](handleError(_0x565122,null));};exports[_0xabf1('0x49')]=function(_0x2d8259,_0x390f9b,_0x529a08){var _0x2dace7={};var _0x3ee213={};var _0x1cd6d8;var _0x40210b;return db[_0xabf1('0x2b')][_0xabf1('0x4a')]({'where':{'id':_0x2d8259[_0xabf1('0x44')]['id']}})['then'](handleEntityNotFound(_0x390f9b,null))[_0xabf1('0x26')](function(_0x192d92){if(_0x192d92){_0x1cd6d8=_0x192d92;_0x3ee213[_0xabf1('0x33')]=_['keys'](db['FreshdeskConfiguration'][_0xabf1('0x2c')]);_0x3ee213[_0xabf1('0x2f')]=_['keys'](_0x2d8259['query']);_0x3ee213[_0xabf1('0x31')]=_[_0xabf1('0x32')](_0x3ee213[_0xabf1('0x33')],_0x3ee213[_0xabf1('0x2f')]);_0x2dace7[_0xabf1('0x35')]=_[_0xabf1('0x32')](_0x3ee213[_0xabf1('0x33')],qs[_0xabf1('0x34')](_0x2d8259['query']['fields']));_0x2dace7['attributes']=_0x2dace7['attributes'][_0xabf1('0x36')]?_0x2dace7[_0xabf1('0x35')]:_0x3ee213[_0xabf1('0x33')];_0x2dace7['order']=qs[_0xabf1('0x3a')](_0x2d8259['query']['sort']);_0x2dace7[_0xabf1('0x3d')]=qs['filters'](_[_0xabf1('0x4b')](_0x2d8259[_0xabf1('0x2f')],_0x3ee213[_0xabf1('0x31')]));if(_0x2d8259[_0xabf1('0x2f')][_0xabf1('0x3b')]){_0x2dace7[_0xabf1('0x3d')]=_[_0xabf1('0x3c')](_0x2dace7[_0xabf1('0x3d')],{'$or':_['map'](_0x2dace7[_0xabf1('0x35')],function(_0xd7be58){var _0x4a2b0b={};_0x4a2b0b[_0xd7be58]={'$like':'%'+_0x2d8259[_0xabf1('0x2f')]['filter']+'%'};return _0x4a2b0b;})});}_0x2dace7=_['merge']({},_0x2dace7,_0x2d8259[_0xabf1('0x45')]);return _0x1cd6d8['getConfigurations'](_0x2dace7);}})[_0xabf1('0x26')](function(_0x2beb5b){if(_0x2beb5b){_0x40210b=_0x2beb5b[_0xabf1('0x36')];if(!_0x2d8259[_0xabf1('0x2f')][_0xabf1('0x37')](_0xabf1('0x38'))){_0x2dace7['limit']=qs[_0xabf1('0x1f')](_0x2d8259[_0xabf1('0x2f')][_0xabf1('0x1f')]);_0x2dace7['offset']=qs[_0xabf1('0x1e')](_0x2d8259['query']['offset']);}return _0x1cd6d8[_0xabf1('0x49')](_0x2dace7);}})['then'](function(_0x429aa8){if(_0x429aa8){return _0x429aa8?{'count':_0x40210b,'rows':_0x429aa8}:null;}})[_0xabf1('0x26')](respondWithResult(_0x390f9b,null))[_0xabf1('0x43')](handleError(_0x390f9b,null));};exports[_0xabf1('0x4c')]=function(_0x51725e,_0x451489,_0x34bff8){if(_0x51725e['body']['id']){delete _0x51725e[_0xabf1('0x48')]['id'];}return db['FreshdeskAccount'][_0xabf1('0x4a')]({'where':{'id':_0x51725e[_0xabf1('0x44')]['id']}})[_0xabf1('0x26')](handleEntityNotFound(_0x451489,null))[_0xabf1('0x26')](function(_0x204feb){if(_0x204feb){_0x51725e[_0xabf1('0x48')][_0xabf1('0x4d')]=_0x204feb['id'];_0x51725e[_0xabf1('0x48')][_0xabf1('0x4e')]=integrations[_0xabf1('0x4f')](_0x51725e[_0xabf1('0x48')][_0xabf1('0x50')],_0x51725e[_0xabf1('0x48')]['type']);_0x51725e[_0xabf1('0x48')]['Descriptions']=integrations[_0xabf1('0x51')](_0x51725e[_0xabf1('0x48')][_0xabf1('0x50')],_0x51725e[_0xabf1('0x48')]['type']);return db['FreshdeskConfiguration']['create'](_0x51725e[_0xabf1('0x48')],{'include':[{'model':db[_0xabf1('0x52')],'as':'Subjects'},{'model':db[_0xabf1('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x451489,null))[_0xabf1('0x43')](handleError(_0x451489,null));};exports[_0xabf1('0x53')]=function(_0x3e1f8e,_0x41e78f,_0x23d9a4){var _0x54979b='';return db[_0xabf1('0x2b')]['findOne']({'where':{'id':_0x3e1f8e[_0xabf1('0x44')]['id']},'attributes':['id',_0xabf1('0x54'),'apiKey']})[_0xabf1('0x26')](handleEntityNotFound(_0x41e78f,null))[_0xabf1('0x26')](function(_0x86f04e){if(_0x86f04e){_0x54979b=_0x86f04e['remoteUri'];var _0x2e15d2=_0x54979b[_0xabf1('0x55')](-0x1);if(_0x2e15d2==='/'){_0x54979b=_0x54979b[_0xabf1('0x56')](0x0,_0x54979b[_0xabf1('0x57')](_0x2e15d2));}return rp({'method':_0xabf1('0x58'),'uri':util[_0xabf1('0x59')](_0xabf1('0x5a'),_0x54979b,_0xabf1('0x5b')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xabf1('0x59')](_0xabf1('0x5c'),_0x86f04e[_0xabf1('0x5d')]))['toString'](_0xabf1('0x5e')))},'json':!![]});}})[_0xabf1('0x26')](function(_0xce15a1){if(_0xce15a1){var _0x4af8c2=['requester',_0xabf1('0x5f'),_0xabf1('0x60'),_0xabf1('0x61'),_0xabf1('0x1c'),_0xabf1('0x62'),_0xabf1('0x63'),'source',_0xabf1('0x64'),_0xabf1('0x63'),_0xabf1('0x65')];_['remove'](_0xce15a1,function(_0x4a0c54){return _0x4af8c2['includes'](_0x4a0c54[_0xabf1('0x29')])||!_0x4a0c54[_0xabf1('0x66')]&&_0x4a0c54[_0xabf1('0x3e')]!==_0xabf1('0x67')&&_0x4a0c54[_0xabf1('0x3e')]!==_0xabf1('0x68');});return{'count':_0xce15a1[_0xabf1('0x36')],'rows':_[_0xabf1('0x2e')](_0xce15a1,function(_0x5c771e){return{'id':_0x5c771e['name'],'name':_0x5c771e[_0xabf1('0x69')],'custom':!_0x5c771e[_0xabf1('0x66')],'options':_0x5c771e[_0xabf1('0x6a')]?_[_0xabf1('0x2e')](_0x5c771e[_0xabf1('0x6a')],function(_0x4f2143){return{'name':_['capitalize'](_0x4f2143),'value':_0x4f2143};}):[]};})};}})['then'](respondWithResult(_0x41e78f,null))[_0xabf1('0x43')](function(_0x4cd09a){var _0xde5c57=_0x3e1f8e[_0xabf1('0x2f')][_0xabf1('0x6b')]?0x1f4:_0x4cd09a[_0xabf1('0x6c')]||0x1f4;logger[_0xabf1('0x27')](_0xabf1('0x6d'),_0xabf1('0x53'),_0xde5c57,JSON[_0xabf1('0x6e')](_0x4cd09a));delete _0x4cd09a[_0xabf1('0x29')];if(_0xde5c57===0x191){_0xde5c57=0x190;}_0x41e78f['status'](_0xde5c57)[_0xabf1('0x2a')](_0x3e1f8e[_0xabf1('0x2f')][_0xabf1('0x6b')]?{'message':_0xabf1('0x6f'),'statusCode':_0x4cd09a[_0xabf1('0x6c')]}:_0x4cd09a);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedab=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x1eae62,_0x5e69dc){var _0x2750a3=function(_0x26dec3){while(--_0x26dec3){_0x1eae62['push'](_0x1eae62['shift']());}};_0x2750a3(++_0x5e69dc);}(_0xedab,0x13d));var _0xbeda=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0xedab[_0x2d460c];return _0xf6fc4c;};'use strict';var _=require(_0xbeda('0x0'));var util=require(_0xbeda('0x1'));var logger=require(_0xbeda('0x2'))(_0xbeda('0x3'));var moment=require(_0xbeda('0x4'));var BPromise=require(_0xbeda('0x5'));var rp=require(_0xbeda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbeda('0x7'));var config=require('../../config/environment');var attributes=require(_0xbeda('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1c9447,_0x35d61f){return _0x1c9447['define'](_0xbeda('0x9'),attributes,{'tableName':_0xbeda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb80=['request-promise','../../components/integrations/configuration','exports','api'];(function(_0x53d897,_0x4d2a12){var _0x559e3d=function(_0x253750){while(--_0x253750){_0x53d897['push'](_0x53d897['shift']());}};_0x559e3d(++_0x4d2a12);}(_0xeb80,0x1db));var _0x0eb8=function(_0x57440a,_0x157be8){_0x57440a=_0x57440a-0x0;var _0x955d90=_0xeb80[_0x57440a];return _0x955d90;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0eb8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0eb8('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0eb8('0x2'));module[_0x0eb8('0x3')]=function(_0x4590d1,_0x30a4ee){return _0x4590d1['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fdb=['FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','raw','options','where','attributes','limit','map','include','model','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x51695d,_0x4d7e62){_0x51695d=_0x51695d-0x0;var _0x2a0194=_0x4fdb[_0x51695d];return _0x2a0194;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});}exports[_0xb4fd('0x17')]=function(_0x44f0f0){var _0x28ecef=this;return new Promise(function(_0x233044,_0x19f7b0){return db['FreshdeskAccount']['findAll']({'raw':_0x44f0f0['options']?_0x44f0f0['options'][_0xb4fd('0x18')]===undefined?!![]:![]:!![],'where':_0x44f0f0[_0xb4fd('0x19')]?_0x44f0f0[_0xb4fd('0x19')][_0xb4fd('0x1a')]||null:null,'attributes':_0x44f0f0[_0xb4fd('0x19')]?_0x44f0f0[_0xb4fd('0x19')][_0xb4fd('0x1b')]||null:null,'limit':_0x44f0f0['options']?_0x44f0f0['options'][_0xb4fd('0x1c')]||null:null,'include':_0x44f0f0[_0xb4fd('0x19')]?_0x44f0f0[_0xb4fd('0x19')]['include']?_[_0xb4fd('0x1d')](_0x44f0f0['options'][_0xb4fd('0x1e')],function(_0x4f5032){return{'model':db[_0x4f5032[_0xb4fd('0x1f')]],'as':_0x4f5032['as'],'attributes':_0x4f5032[_0xb4fd('0x1b')],'include':_0x4f5032[_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x4f5032[_0xb4fd('0x1e')],function(_0x456f35){return{'model':db[_0x456f35[_0xb4fd('0x1f')]],'as':_0x456f35['as'],'attributes':_0x456f35[_0xb4fd('0x1b')],'include':_0x456f35['include']?_['map'](_0x456f35['include'],function(_0x453982){return{'model':db[_0x453982['model']],'as':_0x453982['as'],'attributes':_0x453982[_0xb4fd('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5738c2){logger[_0xb4fd('0xc')](_0xb4fd('0x17'),_0x44f0f0);logger[_0xb4fd('0xe')]('GetFreshdeskAccount',_0x44f0f0,JSON[_0xb4fd('0x10')](_0x5738c2));_0x233044(_0x5738c2);})[_0xb4fd('0x16')](function(_0x68776){logger[_0xb4fd('0x11')]('GetFreshdeskAccount',_0x68776[_0xb4fd('0x14')],_0x44f0f0);_0x19f7b0(_0x28ecef[_0xb4fd('0x11')](0x1f4,_0x68776['message']));});});};exports[_0xb4fd('0x20')]=function(_0x421c89){var _0xbe7d2c=this;return new Promise(function(_0x597874,_0xe73e10){return db[_0xb4fd('0x21')][_0xb4fd('0x22')]({'raw':_0x421c89['options']?_0x421c89['options']['raw']===undefined?!![]:![]:!![],'where':_0x421c89['options']?_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1a')]||null:null,'attributes':_0x421c89[_0xb4fd('0x19')]?_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1b')]||null:null,'include':_0x421c89[_0xb4fd('0x19')]?_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x421c89[_0xb4fd('0x19')][_0xb4fd('0x1e')],function(_0x37415b){return{'model':db[_0x37415b[_0xb4fd('0x1f')]],'as':_0x37415b['as'],'attributes':_0x37415b[_0xb4fd('0x1b')],'include':_0x37415b[_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x37415b[_0xb4fd('0x1e')],function(_0x194c14){return{'model':db[_0x194c14['model']],'as':_0x194c14['as'],'attributes':_0x194c14['attributes'],'include':_0x194c14[_0xb4fd('0x1e')]?_[_0xb4fd('0x1d')](_0x194c14[_0xb4fd('0x1e')],function(_0x24ae37){return{'model':db[_0x24ae37[_0xb4fd('0x1f')]],'as':_0x24ae37['as'],'attributes':_0x24ae37['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4fd('0xb')](function(_0x265634){logger[_0xb4fd('0xc')](_0xb4fd('0x20'),_0x421c89);logger[_0xb4fd('0xe')]('ShowFreshdeskAccount',_0x421c89,JSON[_0xb4fd('0x10')](_0x265634));_0x597874(_0x265634);})['catch'](function(_0xcda359){logger[_0xb4fd('0x11')]('ShowFreshdeskAccount',_0xcda359['message'],_0x421c89);_0xe73e10(_0xbe7d2c[_0xb4fd('0x11')](0x1f4,_0xcda359[_0xb4fd('0x14')]));});});};
\ No newline at end of file
+var _0xe0e8=['attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetFreshdeskAccount','findAll','options','raw'];(function(_0x262bd5,_0x4bc904){var _0x52fbbe=function(_0x22a3fc){while(--_0x22a3fc){_0x262bd5['push'](_0x262bd5['shift']());}};_0x52fbbe(++_0x4bc904);}(_0xe0e8,0x1c8));var _0x8e0e=function(_0x9f0743,_0x3c9fd8){_0x9f0743=_0x9f0743-0x0;var _0x46ead5=_0xe0e8[_0x9f0743];return _0x46ead5;};'use strict';var _=require(_0x8e0e('0x0'));var util=require('util');var moment=require(_0x8e0e('0x1'));var BPromise=require(_0x8e0e('0x2'));var rs=require(_0x8e0e('0x3'));var fs=require('fs');var Redis=require(_0x8e0e('0x4'));var db=require(_0x8e0e('0x5'))['db'];var utils=require(_0x8e0e('0x6'));var logger=require('../../config/logger')(_0x8e0e('0x7'));var config=require(_0x8e0e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e0e('0x9')][_0x8e0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b4c8c,_0x36a988,_0x442342){return new BPromise(function(_0x7b66f5,_0x845b4d){return client['request'](_0x7b4c8c,_0x442342)[_0x8e0e('0xb')](function(_0x1ce843){logger[_0x8e0e('0xc')](_0x8e0e('0xd'),_0x36a988,_0x8e0e('0xe'));logger[_0x8e0e('0xf')](_0x8e0e('0x10'),_0x36a988,_0x8e0e('0xe'),JSON['stringify'](_0x1ce843));if(_0x1ce843['error']){if(_0x1ce843[_0x8e0e('0x11')]['code']===0x1f4){logger[_0x8e0e('0x11')](_0x8e0e('0xd'),_0x36a988,_0x1ce843[_0x8e0e('0x11')][_0x8e0e('0x12')]);return _0x845b4d(_0x1ce843['error'][_0x8e0e('0x12')]);}logger[_0x8e0e('0x11')](_0x8e0e('0xd'),_0x36a988,_0x1ce843['error']['message']);return _0x7b66f5(_0x1ce843[_0x8e0e('0x11')]['message']);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x36a988,'request\x20sent');_0x7b66f5(_0x1ce843['result']['message']);}})[_0x8e0e('0x13')](function(_0x331c07){logger[_0x8e0e('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x36a988,_0x331c07);_0x845b4d(_0x331c07);});});}exports[_0x8e0e('0x14')]=function(_0x557b86){var _0x575752=this;return new Promise(function(_0x5a70ea,_0x55b02b){return db['FreshdeskAccount'][_0x8e0e('0x15')]({'raw':_0x557b86[_0x8e0e('0x16')]?_0x557b86[_0x8e0e('0x16')][_0x8e0e('0x17')]===undefined?!![]:![]:!![],'where':_0x557b86[_0x8e0e('0x16')]?_0x557b86[_0x8e0e('0x16')]['where']||null:null,'attributes':_0x557b86[_0x8e0e('0x16')]?_0x557b86['options'][_0x8e0e('0x18')]||null:null,'limit':_0x557b86['options']?_0x557b86[_0x8e0e('0x16')][_0x8e0e('0x19')]||null:null,'include':_0x557b86['options']?_0x557b86[_0x8e0e('0x16')][_0x8e0e('0x1a')]?_[_0x8e0e('0x1b')](_0x557b86['options']['include'],function(_0x266f35){return{'model':db[_0x266f35[_0x8e0e('0x1c')]],'as':_0x266f35['as'],'attributes':_0x266f35[_0x8e0e('0x18')],'include':_0x266f35[_0x8e0e('0x1a')]?_[_0x8e0e('0x1b')](_0x266f35['include'],function(_0x4d1309){return{'model':db[_0x4d1309[_0x8e0e('0x1c')]],'as':_0x4d1309['as'],'attributes':_0x4d1309[_0x8e0e('0x18')],'include':_0x4d1309['include']?_[_0x8e0e('0x1b')](_0x4d1309['include'],function(_0x1fa12a){return{'model':db[_0x1fa12a[_0x8e0e('0x1c')]],'as':_0x1fa12a['as'],'attributes':_0x1fa12a[_0x8e0e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8e0e('0xb')](function(_0x2ccc77){logger['info'](_0x8e0e('0x14'),_0x557b86);logger['debug'](_0x8e0e('0x14'),_0x557b86,JSON[_0x8e0e('0x1d')](_0x2ccc77));_0x5a70ea(_0x2ccc77);})[_0x8e0e('0x13')](function(_0x385569){logger['error'](_0x8e0e('0x14'),_0x385569[_0x8e0e('0x12')],_0x557b86);_0x55b02b(_0x575752[_0x8e0e('0x11')](0x1f4,_0x385569[_0x8e0e('0x12')]));});});};exports[_0x8e0e('0x1e')]=function(_0x19eaf6){var _0x2806cb=this;return new Promise(function(_0x1b853f,_0x37b152){return db['FreshdeskAccount']['find']({'raw':_0x19eaf6[_0x8e0e('0x16')]?_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x17')]===undefined?!![]:![]:!![],'where':_0x19eaf6[_0x8e0e('0x16')]?_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x1f')]||null:null,'attributes':_0x19eaf6['options']?_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x18')]||null:null,'include':_0x19eaf6['options']?_0x19eaf6[_0x8e0e('0x16')]['include']?_['map'](_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x1a')],function(_0x24b05c){return{'model':db[_0x24b05c['model']],'as':_0x24b05c['as'],'attributes':_0x24b05c[_0x8e0e('0x18')],'include':_0x24b05c[_0x8e0e('0x1a')]?_['map'](_0x24b05c[_0x8e0e('0x1a')],function(_0x59364f){return{'model':db[_0x59364f[_0x8e0e('0x1c')]],'as':_0x59364f['as'],'attributes':_0x59364f['attributes'],'include':_0x59364f[_0x8e0e('0x1a')]?_[_0x8e0e('0x1b')](_0x59364f[_0x8e0e('0x1a')],function(_0x127986){return{'model':db[_0x127986[_0x8e0e('0x1c')]],'as':_0x127986['as'],'attributes':_0x127986[_0x8e0e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8e0e('0xb')](function(_0x2191ff){logger[_0x8e0e('0xc')]('ShowFreshdeskAccount',_0x19eaf6);logger['debug']('ShowFreshdeskAccount',_0x19eaf6,JSON['stringify'](_0x2191ff));_0x1b853f(_0x2191ff);})[_0x8e0e('0x13')](function(_0xacd722){logger[_0x8e0e('0x11')](_0x8e0e('0x1e'),_0xacd722['message'],_0x19eaf6);_0x37b152(_0x2806cb[_0x8e0e('0x11')](0x1f4,_0xacd722[_0x8e0e('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5c8=['connect-timeout','express','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','destroy','exports','multer','util','path'];(function(_0x267fe3,_0x12cd9e){var _0x235c96=function(_0x5445c7){while(--_0x5445c7){_0x267fe3['push'](_0x267fe3['shift']());}};_0x235c96(++_0x12cd9e);}(_0xa5c8,0xac));var _0x8a5c=function(_0x1a1e99,_0x562ccf){_0x1a1e99=_0x1a1e99-0x0;var _0x353107=_0xa5c8[_0x1a1e99];return _0x353107;};'use strict';var multer=require(_0x8a5c('0x0'));var util=require(_0x8a5c('0x1'));var path=require(_0x8a5c('0x2'));var timeout=require(_0x8a5c('0x3'));var express=require(_0x8a5c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8a5c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a5c('0x6'));var controller=require(_0x8a5c('0x7'));router[_0x8a5c('0x8')]('/',auth[_0x8a5c('0x9')](),controller[_0x8a5c('0xa')]);router[_0x8a5c('0x8')](_0x8a5c('0xb'),auth[_0x8a5c('0x9')](),controller['show']);router[_0x8a5c('0x8')](_0x8a5c('0xc'),auth[_0x8a5c('0x9')](),controller[_0x8a5c('0xd')]);router[_0x8a5c('0x8')]('/:id/subjects',auth[_0x8a5c('0x9')](),controller[_0x8a5c('0xe')]);router[_0x8a5c('0x8')](_0x8a5c('0xf'),auth[_0x8a5c('0x9')](),controller[_0x8a5c('0x10')]);router[_0x8a5c('0x8')]('/:id/tags',auth[_0x8a5c('0x9')](),controller[_0x8a5c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8a5c('0x12')](_0x8a5c('0x13'),auth['isAuthenticated'](),controller[_0x8a5c('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8a5c('0x15')]);router[_0x8a5c('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x8a5c('0x17')]);module[_0x8a5c('0x18')]=router;
\ No newline at end of file
+var _0x8de9=['getTags','post','create','/:id/tags','setTags','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x15c76d,_0x44e5f7){var _0x5b3f46=function(_0x492897){while(--_0x492897){_0x15c76d['push'](_0x15c76d['shift']());}};_0x5b3f46(++_0x44e5f7);}(_0x8de9,0x15b));var _0x98de=function(_0x504656,_0x43f3d5){_0x504656=_0x504656-0x0;var _0x423172=_0x8de9[_0x504656];return _0x423172;};'use strict';var multer=require(_0x98de('0x0'));var util=require(_0x98de('0x1'));var path=require(_0x98de('0x2'));var timeout=require('connect-timeout');var express=require(_0x98de('0x3'));var router=express['Router']();var fs_extra=require(_0x98de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x98de('0x5'));var config=require(_0x98de('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x98de('0x7')]('/',auth['isAuthenticated'](),controller[_0x98de('0x8')]);router[_0x98de('0x7')](_0x98de('0x9'),auth[_0x98de('0xa')](),controller[_0x98de('0xb')]);router[_0x98de('0x7')](_0x98de('0xc'),auth[_0x98de('0xa')](),controller[_0x98de('0xd')]);router['get']('/:id/subjects',auth[_0x98de('0xa')](),controller[_0x98de('0xe')]);router[_0x98de('0x7')](_0x98de('0xf'),auth[_0x98de('0xa')](),controller[_0x98de('0x10')]);router[_0x98de('0x7')]('/:id/tags',auth[_0x98de('0xa')](),controller[_0x98de('0x11')]);router[_0x98de('0x12')]('/',auth[_0x98de('0xa')](),controller[_0x98de('0x13')]);router['post'](_0x98de('0x14'),auth['isAuthenticated'](),controller[_0x98de('0x15')]);router[_0x98de('0x16')](_0x98de('0x9'),auth[_0x98de('0xa')](),controller[_0x98de('0x17')]);router['delete'](_0x98de('0x9'),auth[_0x98de('0xa')](),controller[_0x98de('0x18')]);module[_0x98de('0x19')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x154d=['exports','STRING','sequelize'];(function(_0x10fee3,_0xb55ea5){var _0x2b0289=function(_0x3d2b0e){while(--_0x3d2b0e){_0x10fee3['push'](_0x10fee3['shift']());}};_0x2b0289(++_0xb55ea5);}(_0x154d,0xfb));var _0xd154=function(_0x190536,_0xe88383){_0x190536=_0x190536-0x0;var _0x176c17=_0x154d[_0x190536];return _0x176c17;};'use strict';var Sequelize=require(_0xd154('0x0'));module[_0xd154('0x1')]={'name':{'type':Sequelize[_0xd154('0x2')]},'description':{'type':Sequelize[_0xd154('0x2')]}};
\ No newline at end of file
+var _0x612b=['STRING','exports'];(function(_0x2407b1,_0x1e1bfe){var _0x14e9b4=function(_0x28a691){while(--_0x28a691){_0x2407b1['push'](_0x2407b1['shift']());}};_0x14e9b4(++_0x1e1bfe);}(_0x612b,0x18b));var _0xb612=function(_0xa35e82,_0x9b27ba){_0xa35e82=_0xa35e82-0x0;var _0x557e70=_0x612b[_0xa35e82];return _0x557e70;};'use strict';var Sequelize=require('sequelize');module[_0xb612('0x0')]={'name':{'type':Sequelize[_0xb612('0x1')]},'description':{'type':Sequelize[_0xb612('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa20f=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','find','getFields','FreshdeskField','getSubjects','getDescriptions','findOne','pick','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5de818,_0x7c4485){var _0x345670=function(_0x5e268d){while(--_0x5e268d){_0x5de818['push'](_0x5de818['shift']());}};_0x345670(++_0x7c4485);}(_0xa20f,0xfb));var _0xfa20=function(_0x58dd18,_0x4e6fa0){_0x58dd18=_0x58dd18-0x0;var _0x1bc723=_0xa20f[_0x58dd18];return _0x1bc723;};'use strict';var emlformat=require(_0xfa20('0x0'));var rimraf=require(_0xfa20('0x1'));var zipdir=require(_0xfa20('0x2'));var jsonpatch=require(_0xfa20('0x3'));var rp=require(_0xfa20('0x4'));var moment=require('moment');var BPromise=require(_0xfa20('0x5'));var Mustache=require(_0xfa20('0x6'));var util=require(_0xfa20('0x7'));var path=require('path');var sox=require(_0xfa20('0x8'));var csv=require(_0xfa20('0x9'));var ejs=require(_0xfa20('0xa'));var fs=require('fs');var fs_extra=require(_0xfa20('0xb'));var _=require(_0xfa20('0xc'));var squel=require(_0xfa20('0xd'));var crypto=require(_0xfa20('0xe'));var jsforce=require(_0xfa20('0xf'));var deskjs=require(_0xfa20('0x10'));var toCsv=require(_0xfa20('0x9'));var querystring=require(_0xfa20('0x11'));var Papa=require('papaparse');var Redis=require(_0xfa20('0x12'));var authService=require(_0xfa20('0x13'));var qs=require(_0xfa20('0x14'));var as=require(_0xfa20('0x15'));var hardwareService=require(_0xfa20('0x16'));var logger=require(_0xfa20('0x17'))('api');var utils=require(_0xfa20('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfa20('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455c06,_0x4591e8){_0x4591e8=_0x4591e8||0xcc;return function(_0x293d49){if(_0x293d49){return _0x455c06[_0xfa20('0x1a')](_0x4591e8);}return _0x455c06[_0xfa20('0x1b')](_0x4591e8)[_0xfa20('0x1c')]();};}function respondWithResult(_0x1de3a3,_0x61593f){_0x61593f=_0x61593f||0xc8;return function(_0x16dc71){if(_0x16dc71){return _0x1de3a3[_0xfa20('0x1b')](_0x61593f)[_0xfa20('0x1d')](_0x16dc71);}};}function respondWithFilteredResult(_0xc54356,_0x3420e1){return function(_0x493d8b){if(_0x493d8b){var _0x2bb7a3=typeof _0x3420e1[_0xfa20('0x1e')]===_0xfa20('0x1f')&&typeof _0x3420e1[_0xfa20('0x20')]===_0xfa20('0x1f');var _0x32d27b=_0x493d8b['count'];var _0x50e534=_0x2bb7a3?0x0:_0x3420e1[_0xfa20('0x1e')];var _0x35cedb=_0x2bb7a3?_0x493d8b['count']:_0x3420e1['offset']+_0x3420e1[_0xfa20('0x20')];var _0x1fe533;if(_0x35cedb>=_0x32d27b){_0x35cedb=_0x32d27b;_0x1fe533=0xc8;}else{_0x1fe533=0xce;}_0xc54356[_0xfa20('0x1b')](_0x1fe533);return _0xc54356['set'](_0xfa20('0x21'),_0x50e534+'-'+_0x35cedb+'/'+_0x32d27b)[_0xfa20('0x1d')](_0x493d8b);}return null;};}function patchUpdates(_0x42b19d){return function(_0x107a46){try{jsonpatch[_0xfa20('0x22')](_0x107a46,_0x42b19d,!![]);}catch(_0xd8693b){return BPromise[_0xfa20('0x23')](_0xd8693b);}return _0x107a46[_0xfa20('0x24')]();};}function saveUpdates(_0x4f621d,_0x2dee4d){return function(_0x3341a8){if(_0x3341a8){return _0x3341a8[_0xfa20('0x25')](_0x4f621d)[_0xfa20('0x26')](function(_0x42bc08){return _0x42bc08;});}return null;};}function removeEntity(_0x368c5d,_0x19fc3c){return function(_0x258828){if(_0x258828){return _0x258828[_0xfa20('0x27')]()[_0xfa20('0x26')](function(){_0x368c5d[_0xfa20('0x1b')](0xcc)[_0xfa20('0x1c')]();});}};}function handleEntityNotFound(_0x5b867b,_0x97a4da){return function(_0x25cf2d){if(!_0x25cf2d){_0x5b867b[_0xfa20('0x1a')](0x194);}return _0x25cf2d;};}function handleError(_0x3e135f,_0x3828a3){_0x3828a3=_0x3828a3||0x1f4;return function(_0x501036){logger[_0xfa20('0x28')](_0x501036[_0xfa20('0x29')]);if(_0x501036[_0xfa20('0x2a')]){delete _0x501036[_0xfa20('0x2a')];}_0x3e135f[_0xfa20('0x1b')](_0x3828a3)[_0xfa20('0x2b')](_0x501036);};}exports[_0xfa20('0x2c')]=function(_0xb3234f,_0x28050a){var _0x306da6={},_0x4fe564={},_0x4b96ab={'count':0x0,'rows':[]};var _0x383e24=_[_0xfa20('0x2d')](db[_0xfa20('0x2e')][_0xfa20('0x2f')],function(_0x4a9c11){return{'name':_0x4a9c11['fieldName'],'type':_0x4a9c11[_0xfa20('0x30')][_0xfa20('0x31')]};});_0x4fe564[_0xfa20('0x32')]=_[_0xfa20('0x2d')](_0x383e24,_0xfa20('0x2a'));_0x4fe564[_0xfa20('0x33')]=_[_0xfa20('0x34')](_0xb3234f['query']);_0x4fe564['filters']=_[_0xfa20('0x35')](_0x4fe564[_0xfa20('0x32')],_0x4fe564[_0xfa20('0x33')]);_0x306da6['attributes']=_[_0xfa20('0x35')](_0x4fe564[_0xfa20('0x32')],qs['fields'](_0xb3234f[_0xfa20('0x33')][_0xfa20('0x36')]));_0x306da6[_0xfa20('0x37')]=_0x306da6[_0xfa20('0x37')][_0xfa20('0x38')]?_0x306da6[_0xfa20('0x37')]:_0x4fe564['model'];if(!_0xb3234f[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x306da6['limit']=qs[_0xfa20('0x20')](_0xb3234f[_0xfa20('0x33')]['limit']);_0x306da6[_0xfa20('0x1e')]=qs['offset'](_0xb3234f['query'][_0xfa20('0x1e')]);}_0x306da6[_0xfa20('0x3b')]=qs[_0xfa20('0x3c')](_0xb3234f[_0xfa20('0x33')]['sort']);_0x306da6[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_['pick'](_0xb3234f[_0xfa20('0x33')],_0x4fe564[_0xfa20('0x3e')]),_0x383e24);if(_0xb3234f[_0xfa20('0x33')][_0xfa20('0x3f')]){_0x306da6['where']=_[_0xfa20('0x40')](_0x306da6['where'],{'$or':_['map'](_0x383e24,function(_0x14cb91){if(_0x14cb91[_0xfa20('0x30')]!==_0xfa20('0x41')){var _0x3023bb={};_0x3023bb[_0x14cb91[_0xfa20('0x2a')]]={'$like':'%'+_0xb3234f['query'][_0xfa20('0x3f')]+'%'};return _0x3023bb;}})});}_0x306da6=_['merge']({},_0x306da6,_0xb3234f[_0xfa20('0x42')]);var _0x37da60={'where':_0x306da6['where']};return db[_0xfa20('0x2e')]['count'](_0x37da60)[_0xfa20('0x26')](function(_0x13672f){_0x4b96ab[_0xfa20('0x43')]=_0x13672f;if(_0xb3234f[_0xfa20('0x33')][_0xfa20('0x44')]){_0x306da6[_0xfa20('0x45')]=[{'all':!![]}];}return db[_0xfa20('0x2e')][_0xfa20('0x46')](_0x306da6);})[_0xfa20('0x26')](function(_0x50c128){_0x4b96ab['rows']=_0x50c128;return _0x4b96ab;})[_0xfa20('0x26')](respondWithFilteredResult(_0x28050a,_0x306da6))[_0xfa20('0x47')](handleError(_0x28050a,null));};exports[_0xfa20('0x48')]=function(_0x8fe30c,_0x482349){var _0x2282d1={'raw':![],'where':{'id':_0x8fe30c[_0xfa20('0x49')]['id']}},_0x5c74ab={};_0x5c74ab[_0xfa20('0x32')]=_[_0xfa20('0x34')](db[_0xfa20('0x2e')][_0xfa20('0x2f')]);_0x5c74ab['query']=_['keys'](_0x8fe30c['query']);_0x5c74ab[_0xfa20('0x3e')]=_[_0xfa20('0x35')](_0x5c74ab[_0xfa20('0x32')],_0x5c74ab['query']);_0x2282d1[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x5c74ab[_0xfa20('0x32')],qs[_0xfa20('0x36')](_0x8fe30c[_0xfa20('0x33')][_0xfa20('0x36')]));_0x2282d1[_0xfa20('0x37')]=_0x2282d1['attributes'][_0xfa20('0x38')]?_0x2282d1[_0xfa20('0x37')]:_0x5c74ab['model'];if(_0x8fe30c[_0xfa20('0x33')]['includeAll']){_0x2282d1[_0xfa20('0x45')]=[{'all':!![]}];}_0x2282d1=_[_0xfa20('0x40')]({},_0x2282d1,_0x8fe30c[_0xfa20('0x42')]);return db[_0xfa20('0x2e')]['find'](_0x2282d1)[_0xfa20('0x26')](handleEntityNotFound(_0x482349,null))['then'](respondWithResult(_0x482349,null))['catch'](handleError(_0x482349,null));};exports[_0xfa20('0x4a')]=function(_0xfb19a0,_0x147dfc){return db['FreshdeskConfiguration'][_0xfa20('0x4a')](_0xfb19a0[_0xfa20('0x4b')],{})['then'](respondWithResult(_0x147dfc,0xc9))[_0xfa20('0x47')](handleError(_0x147dfc,null));};exports[_0xfa20('0x25')]=function(_0x494d23,_0x1ed924){if(_0x494d23[_0xfa20('0x4b')]['id']){delete _0x494d23[_0xfa20('0x4b')]['id'];}return db[_0xfa20('0x2e')][_0xfa20('0x4c')]({'where':{'id':_0x494d23[_0xfa20('0x49')]['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x1ed924,null))[_0xfa20('0x26')](saveUpdates(_0x494d23[_0xfa20('0x4b')],null))[_0xfa20('0x26')](respondWithResult(_0x1ed924,null))['catch'](handleError(_0x1ed924,null));};exports['destroy']=function(_0x4f151f,_0x77d4da){return db[_0xfa20('0x2e')][_0xfa20('0x4c')]({'where':{'id':_0x4f151f[_0xfa20('0x49')]['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x77d4da,null))[_0xfa20('0x26')](removeEntity(_0x77d4da,null))[_0xfa20('0x47')](handleError(_0x77d4da,null));};exports[_0xfa20('0x4d')]=function(_0x40f070,_0x2c169b,_0x2b696b){var _0x4eedb6={};var _0x2909ec={};var _0x6e2c3;var _0xdf3f66;return db[_0xfa20('0x2e')]['findOne']({'where':{'id':_0x40f070[_0xfa20('0x49')]['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x2c169b,null))[_0xfa20('0x26')](function(_0x196a9e){if(_0x196a9e){_0x6e2c3=_0x196a9e;_0x2909ec[_0xfa20('0x32')]=_[_0xfa20('0x34')](db[_0xfa20('0x4e')][_0xfa20('0x2f')]);_0x2909ec['query']=_[_0xfa20('0x34')](_0x40f070[_0xfa20('0x33')]);_0x2909ec['filters']=_[_0xfa20('0x35')](_0x2909ec[_0xfa20('0x32')],_0x2909ec[_0xfa20('0x33')]);_0x4eedb6['attributes']=_[_0xfa20('0x35')](_0x2909ec[_0xfa20('0x32')],qs[_0xfa20('0x36')](_0x40f070['query'][_0xfa20('0x36')]));_0x4eedb6['attributes']=_0x4eedb6[_0xfa20('0x37')]['length']?_0x4eedb6[_0xfa20('0x37')]:_0x2909ec['model'];_0x4eedb6[_0xfa20('0x3b')]=qs['sort'](_0x40f070[_0xfa20('0x33')]['sort']);_0x4eedb6[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_['pick'](_0x40f070[_0xfa20('0x33')],_0x2909ec[_0xfa20('0x3e')]));if(_0x40f070['query']['filter']){_0x4eedb6[_0xfa20('0x3d')]=_[_0xfa20('0x40')](_0x4eedb6[_0xfa20('0x3d')],{'$or':_[_0xfa20('0x2d')](_0x4eedb6[_0xfa20('0x37')],function(_0x2e0495){var _0x46ddbe={};_0x46ddbe[_0x2e0495]={'$like':'%'+_0x40f070[_0xfa20('0x33')]['filter']+'%'};return _0x46ddbe;})});}_0x4eedb6=_[_0xfa20('0x40')]({},_0x4eedb6,_0x40f070[_0xfa20('0x42')]);return _0x6e2c3[_0xfa20('0x4d')](_0x4eedb6);}})[_0xfa20('0x26')](function(_0x4141a8){if(_0x4141a8){_0xdf3f66=_0x4141a8['length'];if(!_0x40f070[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x4eedb6[_0xfa20('0x20')]=qs['limit'](_0x40f070[_0xfa20('0x33')]['limit']);_0x4eedb6[_0xfa20('0x1e')]=qs[_0xfa20('0x1e')](_0x40f070['query'][_0xfa20('0x1e')]);}return _0x6e2c3[_0xfa20('0x4d')](_0x4eedb6);}})[_0xfa20('0x26')](function(_0x5e7dd2){if(_0x5e7dd2){return _0x5e7dd2?{'count':_0xdf3f66,'rows':_0x5e7dd2}:null;}})[_0xfa20('0x26')](respondWithResult(_0x2c169b,null))[_0xfa20('0x47')](handleError(_0x2c169b,null));};exports[_0xfa20('0x4f')]=function(_0xdabd60,_0x82077c,_0xd467f3){var _0x29e7f2={};var _0x465567={};var _0x160dfe;var _0x11b78b;return db[_0xfa20('0x2e')]['findOne']({'where':{'id':_0xdabd60['params']['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x82077c,null))[_0xfa20('0x26')](function(_0x1a37eb){if(_0x1a37eb){_0x160dfe=_0x1a37eb;_0x465567['model']=_[_0xfa20('0x34')](db[_0xfa20('0x4e')]['rawAttributes']);_0x465567[_0xfa20('0x33')]=_[_0xfa20('0x34')](_0xdabd60[_0xfa20('0x33')]);_0x465567[_0xfa20('0x3e')]=_[_0xfa20('0x35')](_0x465567[_0xfa20('0x32')],_0x465567[_0xfa20('0x33')]);_0x29e7f2[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x465567[_0xfa20('0x32')],qs['fields'](_0xdabd60[_0xfa20('0x33')]['fields']));_0x29e7f2[_0xfa20('0x37')]=_0x29e7f2['attributes'][_0xfa20('0x38')]?_0x29e7f2[_0xfa20('0x37')]:_0x465567[_0xfa20('0x32')];_0x29e7f2[_0xfa20('0x3b')]=qs['sort'](_0xdabd60[_0xfa20('0x33')]['sort']);_0x29e7f2[_0xfa20('0x3d')]=qs['filters'](_['pick'](_0xdabd60[_0xfa20('0x33')],_0x465567['filters']));if(_0xdabd60['query'][_0xfa20('0x3f')]){_0x29e7f2[_0xfa20('0x3d')]=_[_0xfa20('0x40')](_0x29e7f2[_0xfa20('0x3d')],{'$or':_[_0xfa20('0x2d')](_0x29e7f2[_0xfa20('0x37')],function(_0x18b642){var _0x516c5b={};_0x516c5b[_0x18b642]={'$like':'%'+_0xdabd60[_0xfa20('0x33')][_0xfa20('0x3f')]+'%'};return _0x516c5b;})});}_0x29e7f2=_[_0xfa20('0x40')]({},_0x29e7f2,_0xdabd60['options']);return _0x160dfe[_0xfa20('0x4f')](_0x29e7f2);}})[_0xfa20('0x26')](function(_0x3b3f64){if(_0x3b3f64){_0x11b78b=_0x3b3f64['length'];if(!_0xdabd60[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x29e7f2['limit']=qs[_0xfa20('0x20')](_0xdabd60[_0xfa20('0x33')][_0xfa20('0x20')]);_0x29e7f2['offset']=qs[_0xfa20('0x1e')](_0xdabd60[_0xfa20('0x33')][_0xfa20('0x1e')]);}return _0x160dfe[_0xfa20('0x4f')](_0x29e7f2);}})[_0xfa20('0x26')](function(_0x4223a9){if(_0x4223a9){return _0x4223a9?{'count':_0x11b78b,'rows':_0x4223a9}:null;}})[_0xfa20('0x26')](respondWithResult(_0x82077c,null))[_0xfa20('0x47')](handleError(_0x82077c,null));};exports[_0xfa20('0x50')]=function(_0x3aa3fe,_0x31507b,_0x1fd032){var _0x4f16a6={};var _0x5a6430={};var _0x1b3f67;var _0x215ec9;return db[_0xfa20('0x2e')][_0xfa20('0x51')]({'where':{'id':_0x3aa3fe['params']['id']}})['then'](handleEntityNotFound(_0x31507b,null))[_0xfa20('0x26')](function(_0x19f612){if(_0x19f612){_0x1b3f67=_0x19f612;_0x5a6430[_0xfa20('0x32')]=_[_0xfa20('0x34')](db[_0xfa20('0x4e')][_0xfa20('0x2f')]);_0x5a6430[_0xfa20('0x33')]=_[_0xfa20('0x34')](_0x3aa3fe[_0xfa20('0x33')]);_0x5a6430['filters']=_[_0xfa20('0x35')](_0x5a6430['model'],_0x5a6430['query']);_0x4f16a6[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x5a6430[_0xfa20('0x32')],qs['fields'](_0x3aa3fe['query'][_0xfa20('0x36')]));_0x4f16a6['attributes']=_0x4f16a6['attributes']['length']?_0x4f16a6['attributes']:_0x5a6430[_0xfa20('0x32')];_0x4f16a6[_0xfa20('0x3b')]=qs[_0xfa20('0x3c')](_0x3aa3fe[_0xfa20('0x33')]['sort']);_0x4f16a6[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_[_0xfa20('0x52')](_0x3aa3fe['query'],_0x5a6430['filters']));if(_0x3aa3fe['query'][_0xfa20('0x3f')]){_0x4f16a6[_0xfa20('0x3d')]=_[_0xfa20('0x40')](_0x4f16a6['where'],{'$or':_['map'](_0x4f16a6[_0xfa20('0x37')],function(_0x332ed5){var _0x31e388={};_0x31e388[_0x332ed5]={'$like':'%'+_0x3aa3fe[_0xfa20('0x33')][_0xfa20('0x3f')]+'%'};return _0x31e388;})});}_0x4f16a6=_[_0xfa20('0x40')]({},_0x4f16a6,_0x3aa3fe[_0xfa20('0x42')]);return _0x1b3f67[_0xfa20('0x50')](_0x4f16a6);}})[_0xfa20('0x26')](function(_0x59a9ad){if(_0x59a9ad){_0x215ec9=_0x59a9ad[_0xfa20('0x38')];if(!_0x3aa3fe[_0xfa20('0x33')][_0xfa20('0x39')](_0xfa20('0x3a'))){_0x4f16a6[_0xfa20('0x20')]=qs[_0xfa20('0x20')](_0x3aa3fe['query'][_0xfa20('0x20')]);_0x4f16a6[_0xfa20('0x1e')]=qs[_0xfa20('0x1e')](_0x3aa3fe['query'][_0xfa20('0x1e')]);}return _0x1b3f67['getDescriptions'](_0x4f16a6);}})['then'](function(_0xc6d6f0){if(_0xc6d6f0){return _0xc6d6f0?{'count':_0x215ec9,'rows':_0xc6d6f0}:null;}})[_0xfa20('0x26')](respondWithResult(_0x31507b,null))[_0xfa20('0x47')](handleError(_0x31507b,null));};exports['getTags']=function(_0x2ec3a1,_0x16491c,_0x7ae94b){var _0x4842fa={};var _0x17584d={};var _0x36822a;var _0x38d919;return db['FreshdeskConfiguration'][_0xfa20('0x51')]({'where':{'id':_0x2ec3a1['params']['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0x16491c,null))[_0xfa20('0x26')](function(_0x99affe){if(_0x99affe){_0x36822a=_0x99affe;_0x17584d[_0xfa20('0x32')]=_[_0xfa20('0x34')](db['Tag']['rawAttributes']);_0x17584d['query']=_[_0xfa20('0x34')](_0x2ec3a1[_0xfa20('0x33')]);_0x17584d[_0xfa20('0x3e')]=_[_0xfa20('0x35')](_0x17584d[_0xfa20('0x32')],_0x17584d[_0xfa20('0x33')]);_0x4842fa[_0xfa20('0x37')]=_[_0xfa20('0x35')](_0x17584d[_0xfa20('0x32')],qs[_0xfa20('0x36')](_0x2ec3a1[_0xfa20('0x33')]['fields']));_0x4842fa[_0xfa20('0x37')]=_0x4842fa[_0xfa20('0x37')][_0xfa20('0x38')]?_0x4842fa['attributes']:_0x17584d[_0xfa20('0x32')];_0x4842fa[_0xfa20('0x3b')]=qs[_0xfa20('0x3c')](_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x3c')]);_0x4842fa[_0xfa20('0x3d')]=qs[_0xfa20('0x3e')](_[_0xfa20('0x52')](_0x2ec3a1['query'],_0x17584d['filters']));if(_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x3f')]){_0x4842fa[_0xfa20('0x3d')]=_['merge'](_0x4842fa[_0xfa20('0x3d')],{'$or':_[_0xfa20('0x2d')](_0x4842fa[_0xfa20('0x37')],function(_0x540821){var _0x294ad8={};_0x294ad8[_0x540821]={'$like':'%'+_0x2ec3a1['query'][_0xfa20('0x3f')]+'%'};return _0x294ad8;})});}_0x4842fa=_['merge']({},_0x4842fa,_0x2ec3a1[_0xfa20('0x42')]);return _0x36822a['getTags'](_0x4842fa);}})[_0xfa20('0x26')](function(_0x56b248){if(_0x56b248){_0x38d919=_0x56b248[_0xfa20('0x38')];if(!_0x2ec3a1['query'][_0xfa20('0x39')]('nolimit')){_0x4842fa[_0xfa20('0x20')]=qs[_0xfa20('0x20')](_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x20')]);_0x4842fa['offset']=qs['offset'](_0x2ec3a1[_0xfa20('0x33')][_0xfa20('0x1e')]);}return _0x36822a['getTags'](_0x4842fa);}})[_0xfa20('0x26')](function(_0x484b56){if(_0x484b56){return _0x484b56?{'count':_0x38d919,'rows':_0x484b56}:null;}})['then'](respondWithResult(_0x16491c,null))[_0xfa20('0x47')](handleError(_0x16491c,null));};exports[_0xfa20('0x53')]=function(_0x1baea1,_0xf7ef19,_0x218b02){if(_0x1baea1[_0xfa20('0x4b')]['id']){delete _0x1baea1[_0xfa20('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0xfa20('0x51')]({'where':{'id':_0x1baea1['params']['id']}})[_0xfa20('0x26')](handleEntityNotFound(_0xf7ef19,null))['then'](function(_0x32b1de){if(_0x32b1de){return _0x32b1de['setTags'](_0x1baea1['body'][_0xfa20('0x54')]||[]);}return null;})[_0xfa20('0x26')](respondWithResult(_0xf7ef19,null))['catch'](handleError(_0xf7ef19,null));};
\ No newline at end of file
+var _0x5183=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','find','catch','create','body','getFields','findOne','FreshdeskField','getSubjects','options','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x5183,0xe1));var _0x3518=function(_0x5f2321,_0x36485d){_0x5f2321=_0x5f2321-0x0;var _0xe63882=_0x5183[_0x5f2321];return _0xe63882;};'use strict';var emlformat=require(_0x3518('0x0'));var rimraf=require(_0x3518('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3518('0x2'));var rp=require(_0x3518('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3518('0x4'));var util=require(_0x3518('0x5'));var path=require(_0x3518('0x6'));var sox=require(_0x3518('0x7'));var csv=require(_0x3518('0x8'));var ejs=require(_0x3518('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3518('0xa'));var squel=require(_0x3518('0xb'));var crypto=require(_0x3518('0xc'));var jsforce=require(_0x3518('0xd'));var deskjs=require(_0x3518('0xe'));var toCsv=require(_0x3518('0x8'));var querystring=require(_0x3518('0xf'));var Papa=require('papaparse');var Redis=require(_0x3518('0x10'));var authService=require(_0x3518('0x11'));var qs=require(_0x3518('0x12'));var as=require(_0x3518('0x13'));var hardwareService=require(_0x3518('0x14'));var logger=require(_0x3518('0x15'))(_0x3518('0x16'));var utils=require(_0x3518('0x17'));var config=require(_0x3518('0x18'));var licenseUtil=require(_0x3518('0x19'));var db=require(_0x3518('0x1a'))['db'];function respondWithStatusCode(_0xfb3137,_0x348eb6){_0x348eb6=_0x348eb6||0xcc;return function(_0x1cdaed){if(_0x1cdaed){return _0xfb3137[_0x3518('0x1b')](_0x348eb6);}return _0xfb3137[_0x3518('0x1c')](_0x348eb6)['end']();};}function respondWithResult(_0x15e482,_0x55c90){_0x55c90=_0x55c90||0xc8;return function(_0x313892){if(_0x313892){return _0x15e482[_0x3518('0x1c')](_0x55c90)[_0x3518('0x1d')](_0x313892);}};}function respondWithFilteredResult(_0x46ee47,_0x3a4eb0){return function(_0xbd2ae){if(_0xbd2ae){var _0x29970f=typeof _0x3a4eb0['offset']===_0x3518('0x1e')&&typeof _0x3a4eb0[_0x3518('0x1f')]==='undefined';var _0x2d1711=_0xbd2ae[_0x3518('0x20')];var _0x586fbc=_0x29970f?0x0:_0x3a4eb0[_0x3518('0x21')];var _0x4d72c8=_0x29970f?_0xbd2ae[_0x3518('0x20')]:_0x3a4eb0['offset']+_0x3a4eb0['limit'];var _0x470d7c;if(_0x4d72c8>=_0x2d1711){_0x4d72c8=_0x2d1711;_0x470d7c=0xc8;}else{_0x470d7c=0xce;}_0x46ee47[_0x3518('0x1c')](_0x470d7c);return _0x46ee47[_0x3518('0x22')](_0x3518('0x23'),_0x586fbc+'-'+_0x4d72c8+'/'+_0x2d1711)['json'](_0xbd2ae);}return null;};}function patchUpdates(_0x3d28cd){return function(_0x1704f2){try{jsonpatch['apply'](_0x1704f2,_0x3d28cd,!![]);}catch(_0x54d209){return BPromise['reject'](_0x54d209);}return _0x1704f2['save']();};}function saveUpdates(_0x580b73,_0x2eb1c1){return function(_0x29154c){if(_0x29154c){return _0x29154c[_0x3518('0x24')](_0x580b73)[_0x3518('0x25')](function(_0xaf3921){return _0xaf3921;});}return null;};}function removeEntity(_0x57f4b3,_0x41b88a){return function(_0x5b1fe5){if(_0x5b1fe5){return _0x5b1fe5[_0x3518('0x26')]()[_0x3518('0x25')](function(){_0x57f4b3[_0x3518('0x1c')](0xcc)[_0x3518('0x27')]();});}};}function handleEntityNotFound(_0x52f786,_0x5090d8){return function(_0x5903ef){if(!_0x5903ef){_0x52f786['sendStatus'](0x194);}return _0x5903ef;};}function handleError(_0x1b6a29,_0x4b9269){_0x4b9269=_0x4b9269||0x1f4;return function(_0x2f6ecc){logger['error'](_0x2f6ecc['stack']);if(_0x2f6ecc['name']){delete _0x2f6ecc[_0x3518('0x28')];}_0x1b6a29[_0x3518('0x1c')](_0x4b9269)['send'](_0x2f6ecc);};}exports[_0x3518('0x29')]=function(_0x1fe386,_0x13aac1){var _0x138435={},_0x5d1c89={},_0x3fe8c0={'count':0x0,'rows':[]};var _0x115f0d=_['map'](db[_0x3518('0x2a')][_0x3518('0x2b')],function(_0x1a86c4){return{'name':_0x1a86c4[_0x3518('0x2c')],'type':_0x1a86c4[_0x3518('0x2d')][_0x3518('0x2e')]};});_0x5d1c89['model']=_[_0x3518('0x2f')](_0x115f0d,'name');_0x5d1c89[_0x3518('0x30')]=_[_0x3518('0x31')](_0x1fe386['query']);_0x5d1c89['filters']=_[_0x3518('0x32')](_0x5d1c89[_0x3518('0x33')],_0x5d1c89[_0x3518('0x30')]);_0x138435[_0x3518('0x34')]=_[_0x3518('0x32')](_0x5d1c89[_0x3518('0x33')],qs[_0x3518('0x35')](_0x1fe386[_0x3518('0x30')][_0x3518('0x35')]));_0x138435[_0x3518('0x34')]=_0x138435['attributes'][_0x3518('0x36')]?_0x138435[_0x3518('0x34')]:_0x5d1c89[_0x3518('0x33')];if(!_0x1fe386[_0x3518('0x30')][_0x3518('0x37')](_0x3518('0x38'))){_0x138435[_0x3518('0x1f')]=qs['limit'](_0x1fe386[_0x3518('0x30')]['limit']);_0x138435['offset']=qs[_0x3518('0x21')](_0x1fe386[_0x3518('0x30')][_0x3518('0x21')]);}_0x138435[_0x3518('0x39')]=qs[_0x3518('0x3a')](_0x1fe386[_0x3518('0x30')][_0x3518('0x3a')]);_0x138435[_0x3518('0x3b')]=qs[_0x3518('0x3c')](_[_0x3518('0x3d')](_0x1fe386[_0x3518('0x30')],_0x5d1c89[_0x3518('0x3c')]),_0x115f0d);if(_0x1fe386['query'][_0x3518('0x3e')]){_0x138435[_0x3518('0x3b')]=_[_0x3518('0x3f')](_0x138435[_0x3518('0x3b')],{'$or':_[_0x3518('0x2f')](_0x115f0d,function(_0x128170){if(_0x128170[_0x3518('0x2d')]!==_0x3518('0x40')){var _0x27a3e6={};_0x27a3e6[_0x128170[_0x3518('0x28')]]={'$like':'%'+_0x1fe386[_0x3518('0x30')]['filter']+'%'};return _0x27a3e6;}})});}_0x138435=_[_0x3518('0x3f')]({},_0x138435,_0x1fe386['options']);var _0xecb7ba={'where':_0x138435[_0x3518('0x3b')]};return db[_0x3518('0x2a')][_0x3518('0x20')](_0xecb7ba)['then'](function(_0x416806){_0x3fe8c0[_0x3518('0x20')]=_0x416806;if(_0x1fe386['query'][_0x3518('0x41')]){_0x138435[_0x3518('0x42')]=[{'all':!![]}];}return db[_0x3518('0x2a')][_0x3518('0x43')](_0x138435);})[_0x3518('0x25')](function(_0x2ebae6){_0x3fe8c0['rows']=_0x2ebae6;return _0x3fe8c0;})[_0x3518('0x25')](respondWithFilteredResult(_0x13aac1,_0x138435))['catch'](handleError(_0x13aac1,null));};exports[_0x3518('0x44')]=function(_0x5832f2,_0x3f2be1){var _0x59497d={'raw':![],'where':{'id':_0x5832f2[_0x3518('0x45')]['id']}},_0x4a1788={};_0x4a1788['model']=_[_0x3518('0x31')](db[_0x3518('0x2a')][_0x3518('0x2b')]);_0x4a1788[_0x3518('0x30')]=_['keys'](_0x5832f2[_0x3518('0x30')]);_0x4a1788[_0x3518('0x3c')]=_[_0x3518('0x32')](_0x4a1788[_0x3518('0x33')],_0x4a1788['query']);_0x59497d[_0x3518('0x34')]=_[_0x3518('0x32')](_0x4a1788[_0x3518('0x33')],qs[_0x3518('0x35')](_0x5832f2['query']['fields']));_0x59497d[_0x3518('0x34')]=_0x59497d[_0x3518('0x34')]['length']?_0x59497d[_0x3518('0x34')]:_0x4a1788['model'];if(_0x5832f2[_0x3518('0x30')][_0x3518('0x41')]){_0x59497d['include']=[{'all':!![]}];}_0x59497d=_[_0x3518('0x3f')]({},_0x59497d,_0x5832f2['options']);return db['FreshdeskConfiguration'][_0x3518('0x46')](_0x59497d)[_0x3518('0x25')](handleEntityNotFound(_0x3f2be1,null))[_0x3518('0x25')](respondWithResult(_0x3f2be1,null))[_0x3518('0x47')](handleError(_0x3f2be1,null));};exports['create']=function(_0x379505,_0x4007aa){return db[_0x3518('0x2a')][_0x3518('0x48')](_0x379505[_0x3518('0x49')],{})[_0x3518('0x25')](respondWithResult(_0x4007aa,0xc9))['catch'](handleError(_0x4007aa,null));};exports[_0x3518('0x24')]=function(_0x1b7333,_0x21a818){if(_0x1b7333[_0x3518('0x49')]['id']){delete _0x1b7333[_0x3518('0x49')]['id'];}return db[_0x3518('0x2a')][_0x3518('0x46')]({'where':{'id':_0x1b7333[_0x3518('0x45')]['id']}})[_0x3518('0x25')](handleEntityNotFound(_0x21a818,null))[_0x3518('0x25')](saveUpdates(_0x1b7333['body'],null))['then'](respondWithResult(_0x21a818,null))[_0x3518('0x47')](handleError(_0x21a818,null));};exports[_0x3518('0x26')]=function(_0x253f7f,_0xc84903){return db[_0x3518('0x2a')][_0x3518('0x46')]({'where':{'id':_0x253f7f[_0x3518('0x45')]['id']}})[_0x3518('0x25')](handleEntityNotFound(_0xc84903,null))['then'](removeEntity(_0xc84903,null))[_0x3518('0x47')](handleError(_0xc84903,null));};exports[_0x3518('0x4a')]=function(_0x5b8abd,_0x39b1c2,_0x4a852c){var _0x4bbfaf={};var _0x54004d={};var _0x5aeaff;var _0x8e9a43;return db[_0x3518('0x2a')][_0x3518('0x4b')]({'where':{'id':_0x5b8abd[_0x3518('0x45')]['id']}})[_0x3518('0x25')](handleEntityNotFound(_0x39b1c2,null))[_0x3518('0x25')](function(_0xfebe3a){if(_0xfebe3a){_0x5aeaff=_0xfebe3a;_0x54004d[_0x3518('0x33')]=_[_0x3518('0x31')](db[_0x3518('0x4c')][_0x3518('0x2b')]);_0x54004d['query']=_[_0x3518('0x31')](_0x5b8abd[_0x3518('0x30')]);_0x54004d['filters']=_[_0x3518('0x32')](_0x54004d[_0x3518('0x33')],_0x54004d['query']);_0x4bbfaf['attributes']=_['intersection'](_0x54004d['model'],qs[_0x3518('0x35')](_0x5b8abd['query'][_0x3518('0x35')]));_0x4bbfaf[_0x3518('0x34')]=_0x4bbfaf['attributes'][_0x3518('0x36')]?_0x4bbfaf[_0x3518('0x34')]:_0x54004d['model'];_0x4bbfaf[_0x3518('0x39')]=qs[_0x3518('0x3a')](_0x5b8abd[_0x3518('0x30')][_0x3518('0x3a')]);_0x4bbfaf[_0x3518('0x3b')]=qs['filters'](_['pick'](_0x5b8abd[_0x3518('0x30')],_0x54004d['filters']));if(_0x5b8abd['query']['filter']){_0x4bbfaf[_0x3518('0x3b')]=_[_0x3518('0x3f')](_0x4bbfaf[_0x3518('0x3b')],{'$or':_[_0x3518('0x2f')](_0x4bbfaf[_0x3518('0x34')],function(_0x3974a5){var _0xe3ef8e={};_0xe3ef8e[_0x3974a5]={'$like':'%'+_0x5b8abd[_0x3518('0x30')][_0x3518('0x3e')]+'%'};return _0xe3ef8e;})});}_0x4bbfaf=_['merge']({},_0x4bbfaf,_0x5b8abd['options']);return _0x5aeaff[_0x3518('0x4a')](_0x4bbfaf);}})[_0x3518('0x25')](function(_0x4e962a){if(_0x4e962a){_0x8e9a43=_0x4e962a[_0x3518('0x36')];if(!_0x5b8abd[_0x3518('0x30')][_0x3518('0x37')](_0x3518('0x38'))){_0x4bbfaf['limit']=qs[_0x3518('0x1f')](_0x5b8abd['query'][_0x3518('0x1f')]);_0x4bbfaf[_0x3518('0x21')]=qs[_0x3518('0x21')](_0x5b8abd[_0x3518('0x30')][_0x3518('0x21')]);}return _0x5aeaff[_0x3518('0x4a')](_0x4bbfaf);}})['then'](function(_0x397fb8){if(_0x397fb8){return _0x397fb8?{'count':_0x8e9a43,'rows':_0x397fb8}:null;}})[_0x3518('0x25')](respondWithResult(_0x39b1c2,null))['catch'](handleError(_0x39b1c2,null));};exports[_0x3518('0x4d')]=function(_0xed26b6,_0x30b4b9,_0x3ac1d0){var _0x36a99f={};var _0x18e92e={};var _0x2b27a2;var _0x2169ea;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0xed26b6[_0x3518('0x45')]['id']}})['then'](handleEntityNotFound(_0x30b4b9,null))[_0x3518('0x25')](function(_0x39039a){if(_0x39039a){_0x2b27a2=_0x39039a;_0x18e92e[_0x3518('0x33')]=_[_0x3518('0x31')](db['FreshdeskField'][_0x3518('0x2b')]);_0x18e92e[_0x3518('0x30')]=_[_0x3518('0x31')](_0xed26b6[_0x3518('0x30')]);_0x18e92e[_0x3518('0x3c')]=_[_0x3518('0x32')](_0x18e92e[_0x3518('0x33')],_0x18e92e[_0x3518('0x30')]);_0x36a99f['attributes']=_[_0x3518('0x32')](_0x18e92e['model'],qs['fields'](_0xed26b6[_0x3518('0x30')][_0x3518('0x35')]));_0x36a99f['attributes']=_0x36a99f[_0x3518('0x34')][_0x3518('0x36')]?_0x36a99f['attributes']:_0x18e92e['model'];_0x36a99f[_0x3518('0x39')]=qs['sort'](_0xed26b6[_0x3518('0x30')]['sort']);_0x36a99f[_0x3518('0x3b')]=qs[_0x3518('0x3c')](_[_0x3518('0x3d')](_0xed26b6[_0x3518('0x30')],_0x18e92e[_0x3518('0x3c')]));if(_0xed26b6['query'][_0x3518('0x3e')]){_0x36a99f[_0x3518('0x3b')]=_[_0x3518('0x3f')](_0x36a99f[_0x3518('0x3b')],{'$or':_[_0x3518('0x2f')](_0x36a99f['attributes'],function(_0x260fdf){var _0x3eaf9c={};_0x3eaf9c[_0x260fdf]={'$like':'%'+_0xed26b6['query'][_0x3518('0x3e')]+'%'};return _0x3eaf9c;})});}_0x36a99f=_[_0x3518('0x3f')]({},_0x36a99f,_0xed26b6[_0x3518('0x4e')]);return _0x2b27a2[_0x3518('0x4d')](_0x36a99f);}})[_0x3518('0x25')](function(_0x38180e){if(_0x38180e){_0x2169ea=_0x38180e[_0x3518('0x36')];if(!_0xed26b6[_0x3518('0x30')][_0x3518('0x37')](_0x3518('0x38'))){_0x36a99f[_0x3518('0x1f')]=qs[_0x3518('0x1f')](_0xed26b6['query'][_0x3518('0x1f')]);_0x36a99f[_0x3518('0x21')]=qs[_0x3518('0x21')](_0xed26b6[_0x3518('0x30')]['offset']);}return _0x2b27a2['getSubjects'](_0x36a99f);}})[_0x3518('0x25')](function(_0x63abe7){if(_0x63abe7){return _0x63abe7?{'count':_0x2169ea,'rows':_0x63abe7}:null;}})['then'](respondWithResult(_0x30b4b9,null))['catch'](handleError(_0x30b4b9,null));};exports[_0x3518('0x4f')]=function(_0x42e336,_0x94a50c,_0x279bc3){var _0x23e450={};var _0x36edc8={};var _0x466df7;var _0x543bff;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x42e336['params']['id']}})['then'](handleEntityNotFound(_0x94a50c,null))[_0x3518('0x25')](function(_0x48cd2e){if(_0x48cd2e){_0x466df7=_0x48cd2e;_0x36edc8[_0x3518('0x33')]=_[_0x3518('0x31')](db[_0x3518('0x4c')]['rawAttributes']);_0x36edc8[_0x3518('0x30')]=_[_0x3518('0x31')](_0x42e336[_0x3518('0x30')]);_0x36edc8[_0x3518('0x3c')]=_[_0x3518('0x32')](_0x36edc8[_0x3518('0x33')],_0x36edc8[_0x3518('0x30')]);_0x23e450[_0x3518('0x34')]=_['intersection'](_0x36edc8[_0x3518('0x33')],qs[_0x3518('0x35')](_0x42e336['query'][_0x3518('0x35')]));_0x23e450[_0x3518('0x34')]=_0x23e450[_0x3518('0x34')][_0x3518('0x36')]?_0x23e450['attributes']:_0x36edc8[_0x3518('0x33')];_0x23e450[_0x3518('0x39')]=qs['sort'](_0x42e336[_0x3518('0x30')][_0x3518('0x3a')]);_0x23e450[_0x3518('0x3b')]=qs[_0x3518('0x3c')](_[_0x3518('0x3d')](_0x42e336[_0x3518('0x30')],_0x36edc8[_0x3518('0x3c')]));if(_0x42e336[_0x3518('0x30')][_0x3518('0x3e')]){_0x23e450[_0x3518('0x3b')]=_['merge'](_0x23e450[_0x3518('0x3b')],{'$or':_[_0x3518('0x2f')](_0x23e450['attributes'],function(_0x2b5366){var _0x46db24={};_0x46db24[_0x2b5366]={'$like':'%'+_0x42e336[_0x3518('0x30')][_0x3518('0x3e')]+'%'};return _0x46db24;})});}_0x23e450=_[_0x3518('0x3f')]({},_0x23e450,_0x42e336['options']);return _0x466df7[_0x3518('0x4f')](_0x23e450);}})[_0x3518('0x25')](function(_0x28a578){if(_0x28a578){_0x543bff=_0x28a578[_0x3518('0x36')];if(!_0x42e336[_0x3518('0x30')][_0x3518('0x37')](_0x3518('0x38'))){_0x23e450[_0x3518('0x1f')]=qs[_0x3518('0x1f')](_0x42e336['query'][_0x3518('0x1f')]);_0x23e450[_0x3518('0x21')]=qs[_0x3518('0x21')](_0x42e336[_0x3518('0x30')]['offset']);}return _0x466df7[_0x3518('0x4f')](_0x23e450);}})[_0x3518('0x25')](function(_0x59d42f){if(_0x59d42f){return _0x59d42f?{'count':_0x543bff,'rows':_0x59d42f}:null;}})[_0x3518('0x25')](respondWithResult(_0x94a50c,null))[_0x3518('0x47')](handleError(_0x94a50c,null));};exports['getTags']=function(_0x63a205,_0x46984a,_0x1d8362){var _0x9c0ff1={};var _0x4996e8={};var _0x17ef95;var _0x16a74d;return db[_0x3518('0x2a')][_0x3518('0x4b')]({'where':{'id':_0x63a205['params']['id']}})['then'](handleEntityNotFound(_0x46984a,null))[_0x3518('0x25')](function(_0x11f975){if(_0x11f975){_0x17ef95=_0x11f975;_0x4996e8['model']=_['keys'](db[_0x3518('0x50')][_0x3518('0x2b')]);_0x4996e8['query']=_[_0x3518('0x31')](_0x63a205[_0x3518('0x30')]);_0x4996e8[_0x3518('0x3c')]=_[_0x3518('0x32')](_0x4996e8['model'],_0x4996e8[_0x3518('0x30')]);_0x9c0ff1['attributes']=_[_0x3518('0x32')](_0x4996e8[_0x3518('0x33')],qs['fields'](_0x63a205[_0x3518('0x30')]['fields']));_0x9c0ff1[_0x3518('0x34')]=_0x9c0ff1[_0x3518('0x34')][_0x3518('0x36')]?_0x9c0ff1['attributes']:_0x4996e8[_0x3518('0x33')];_0x9c0ff1['order']=qs[_0x3518('0x3a')](_0x63a205['query'][_0x3518('0x3a')]);_0x9c0ff1[_0x3518('0x3b')]=qs[_0x3518('0x3c')](_[_0x3518('0x3d')](_0x63a205['query'],_0x4996e8[_0x3518('0x3c')]));if(_0x63a205[_0x3518('0x30')][_0x3518('0x3e')]){_0x9c0ff1[_0x3518('0x3b')]=_['merge'](_0x9c0ff1[_0x3518('0x3b')],{'$or':_[_0x3518('0x2f')](_0x9c0ff1['attributes'],function(_0x23ac4b){var _0x1daf0a={};_0x1daf0a[_0x23ac4b]={'$like':'%'+_0x63a205[_0x3518('0x30')][_0x3518('0x3e')]+'%'};return _0x1daf0a;})});}_0x9c0ff1=_['merge']({},_0x9c0ff1,_0x63a205[_0x3518('0x4e')]);return _0x17ef95['getTags'](_0x9c0ff1);}})[_0x3518('0x25')](function(_0x14f702){if(_0x14f702){_0x16a74d=_0x14f702[_0x3518('0x36')];if(!_0x63a205[_0x3518('0x30')][_0x3518('0x37')](_0x3518('0x38'))){_0x9c0ff1[_0x3518('0x1f')]=qs[_0x3518('0x1f')](_0x63a205[_0x3518('0x30')][_0x3518('0x1f')]);_0x9c0ff1[_0x3518('0x21')]=qs[_0x3518('0x21')](_0x63a205[_0x3518('0x30')][_0x3518('0x21')]);}return _0x17ef95[_0x3518('0x51')](_0x9c0ff1);}})[_0x3518('0x25')](function(_0x433690){if(_0x433690){return _0x433690?{'count':_0x16a74d,'rows':_0x433690}:null;}})[_0x3518('0x25')](respondWithResult(_0x46984a,null))['catch'](handleError(_0x46984a,null));};exports[_0x3518('0x52')]=function(_0x325b07,_0x5cabf5,_0x3e1a37){if(_0x325b07[_0x3518('0x49')]['id']){delete _0x325b07[_0x3518('0x49')]['id'];}return db[_0x3518('0x2a')]['findOne']({'where':{'id':_0x325b07['params']['id']}})['then'](handleEntityNotFound(_0x5cabf5,null))[_0x3518('0x25')](function(_0x117827){if(_0x117827){return _0x117827['setTags'](_0x325b07[_0x3518('0x49')][_0x3518('0x53')]||[]);}return null;})[_0x3518('0x25')](respondWithResult(_0x5cabf5,null))['catch'](handleError(_0x5cabf5,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dcd=['int_freshdesk_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x6dcd,0x1d5));var _0xd6dc=function(_0x450823,_0x154330){_0x450823=_0x450823-0x0;var _0x288a89=_0x6dcd[_0x450823];return _0x288a89;};'use strict';var _=require(_0xd6dc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd6dc('0x1'));var moment=require(_0xd6dc('0x2'));var BPromise=require(_0xd6dc('0x3'));var rp=require(_0xd6dc('0x4'));var fs=require('fs');var path=require(_0xd6dc('0x5'));var rimraf=require(_0xd6dc('0x6'));var config=require('../../config/environment');var attributes=require(_0xd6dc('0x7'));module[_0xd6dc('0x8')]=function(_0x3b6512,_0x5568fc){return _0x3b6512[_0xd6dc('0x9')](_0xd6dc('0xa'),attributes,{'tableName':_0xd6dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96a7=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x96a7,0xce));var _0x796a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x96a7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x796a('0x0'));var util=require('util');var logger=require(_0x796a('0x1'))(_0x796a('0x2'));var moment=require(_0x796a('0x3'));var BPromise=require(_0x796a('0x4'));var rp=require(_0x796a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x796a('0x6'));var attributes=require(_0x796a('0x7'));module[_0x796a('0x8')]=function(_0xe30655,_0x386851){return _0xe30655[_0x796a('0x9')](_0x796a('0xa'),attributes,{'tableName':_0x796a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa344=['error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x169bd5,_0xab64e8){var _0x356002=function(_0x36648a){while(--_0x36648a){_0x169bd5['push'](_0x169bd5['shift']());}};_0x356002(++_0xab64e8);}(_0xa344,0x1f4));var _0x4a34=function(_0x2dd1cf,_0x33bf28){_0x2dd1cf=_0x2dd1cf-0x0;var _0x46b969=_0xa344[_0x2dd1cf];return _0x46b969;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a34('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a34('0x1'));var db=require(_0x4a34('0x2'))['db'];var utils=require(_0x4a34('0x3'));var logger=require(_0x4a34('0x4'))(_0x4a34('0x5'));var config=require('../../config/environment');var jayson=require(_0x4a34('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa76b9a,_0x37d7d2,_0x38d85){return new BPromise(function(_0x513edc,_0x43c6ff){return client[_0x4a34('0x7')](_0xa76b9a,_0x38d85)['then'](function(_0x3094f6){logger[_0x4a34('0x8')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x37d7d2,_0x4a34('0x9'));logger[_0x4a34('0xa')](_0x4a34('0xb'),_0x37d7d2,_0x4a34('0x9'),JSON[_0x4a34('0xc')](_0x3094f6));if(_0x3094f6['error']){if(_0x3094f6[_0x4a34('0xd')][_0x4a34('0xe')]===0x1f4){logger[_0x4a34('0xd')](_0x4a34('0xf'),_0x37d7d2,_0x3094f6[_0x4a34('0xd')]['message']);return _0x43c6ff(_0x3094f6['error'][_0x4a34('0x10')]);}logger[_0x4a34('0xd')](_0x4a34('0xf'),_0x37d7d2,_0x3094f6['error'][_0x4a34('0x10')]);return _0x513edc(_0x3094f6[_0x4a34('0xd')][_0x4a34('0x10')]);}else{logger[_0x4a34('0x8')](_0x4a34('0xf'),_0x37d7d2,_0x4a34('0x9'));_0x513edc(_0x3094f6[_0x4a34('0x11')][_0x4a34('0x10')]);}})[_0x4a34('0x12')](function(_0xe1dc84){logger[_0x4a34('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x37d7d2,_0xe1dc84);_0x43c6ff(_0xe1dc84);});});}
\ No newline at end of file
+var _0xbe63=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x6ab292,_0x54fe0e){var _0x172b74=function(_0x3186ee){while(--_0x3186ee){_0x6ab292['push'](_0x6ab292['shift']());}};_0x172b74(++_0x54fe0e);}(_0xbe63,0xe0));var _0x3be6=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xbe63[_0x2cde0a];return _0x260610;};'use strict';var _=require(_0x3be6('0x0'));var util=require(_0x3be6('0x1'));var moment=require(_0x3be6('0x2'));var BPromise=require(_0x3be6('0x3'));var rs=require(_0x3be6('0x4'));var fs=require('fs');var Redis=require(_0x3be6('0x5'));var db=require(_0x3be6('0x6'))['db'];var utils=require(_0x3be6('0x7'));var logger=require(_0x3be6('0x8'))('rpc');var config=require(_0x3be6('0x9'));var jayson=require(_0x3be6('0xa'));var client=jayson['client'][_0x3be6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12acf5,_0x565bfe,_0x1f7d67){return new BPromise(function(_0x26d50d,_0x1a671c){return client['request'](_0x12acf5,_0x1f7d67)[_0x3be6('0xc')](function(_0x443477){logger['info'](_0x3be6('0xd'),_0x565bfe,_0x3be6('0xe'));logger[_0x3be6('0xf')](_0x3be6('0x10'),_0x565bfe,'request\x20sent',JSON['stringify'](_0x443477));if(_0x443477[_0x3be6('0x11')]){if(_0x443477[_0x3be6('0x11')]['code']===0x1f4){logger[_0x3be6('0x11')](_0x3be6('0xd'),_0x565bfe,_0x443477['error'][_0x3be6('0x12')]);return _0x1a671c(_0x443477[_0x3be6('0x11')][_0x3be6('0x12')]);}logger['error'](_0x3be6('0xd'),_0x565bfe,_0x443477[_0x3be6('0x11')][_0x3be6('0x12')]);return _0x26d50d(_0x443477[_0x3be6('0x11')]['message']);}else{logger[_0x3be6('0x13')](_0x3be6('0xd'),_0x565bfe,_0x3be6('0xe'));_0x26d50d(_0x443477[_0x3be6('0x14')][_0x3be6('0x12')]);}})[_0x3be6('0x15')](function(_0x2a40d5){logger[_0x3be6('0x11')](_0x3be6('0xd'),_0x565bfe,_0x2a40d5);_0x1a671c(_0x2a40d5);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9719=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3ad23d,_0x1b343f){var _0x231d9e=function(_0x46d7fe){while(--_0x46d7fe){_0x3ad23d['push'](_0x3ad23d['shift']());}};_0x231d9e(++_0x1b343f);}(_0x9719,0x12c));var _0x9971=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9719[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x9971('0x0'));var util=require(_0x9971('0x1'));var path=require(_0x9971('0x2'));var timeout=require(_0x9971('0x3'));var express=require(_0x9971('0x4'));var router=express[_0x9971('0x5')]();var fs_extra=require(_0x9971('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9971('0x7'));var config=require(_0x9971('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x9971('0x9')]('/',auth[_0x9971('0xa')](),controller[_0x9971('0xb')]);router[_0x9971('0x9')](_0x9971('0xc'),auth[_0x9971('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9971('0xd')]);router[_0x9971('0xe')](_0x9971('0xc'),auth[_0x9971('0xa')](),controller[_0x9971('0xf')]);router[_0x9971('0x10')](_0x9971('0xc'),auth[_0x9971('0xa')](),controller[_0x9971('0x11')]);module[_0x9971('0x12')]=router;
\ No newline at end of file
+var _0xa2f5=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','update','/:id','exports','path'];(function(_0x186065,_0x36f803){var _0x46304b=function(_0x56fa58){while(--_0x56fa58){_0x186065['push'](_0x186065['shift']());}};_0x46304b(++_0x36f803);}(_0xa2f5,0x1a3));var _0x5a2f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa2f5[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a2f('0x0'));var timeout=require(_0x5a2f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5a2f('0x2'));var auth=require(_0x5a2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5a2f('0x4'));var controller=require(_0x5a2f('0x5'));router[_0x5a2f('0x6')]('/',auth[_0x5a2f('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5a2f('0x8')]);router[_0x5a2f('0x9')]('/',auth['isAuthenticated'](),controller[_0x5a2f('0xa')]);router[_0x5a2f('0xb')]('/:id',auth[_0x5a2f('0x7')](),controller[_0x5a2f('0xc')]);router['delete'](_0x5a2f('0xd'),auth[_0x5a2f('0x7')](),controller['destroy']);module[_0x5a2f('0xe')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d3f=['sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0xa45f73,_0x268db4){var _0x4ba1cd=function(_0x5fa3ce){while(--_0x5fa3ce){_0xa45f73['push'](_0xa45f73['shift']());}};_0x4ba1cd(++_0x268db4);}(_0x9d3f,0x1ea));var _0xf9d3=function(_0x1695b1,_0x46b72d){_0x1695b1=_0x1695b1-0x0;var _0x236682=_0x9d3f[_0x1695b1];return _0x236682;};'use strict';var Sequelize=require(_0xf9d3('0x0'));module[_0xf9d3('0x1')]={'type':{'type':Sequelize[_0xf9d3('0x2')]('string',_0xf9d3('0x3'),_0xf9d3('0x4'),_0xf9d3('0x5'),_0xf9d3('0x6')),'defaultValue':_0xf9d3('0x7')},'content':{'type':Sequelize[_0xf9d3('0x8')]},'key':{'type':Sequelize[_0xf9d3('0x8')]},'keyType':{'type':Sequelize[_0xf9d3('0x2')]('string',_0xf9d3('0x3'),_0xf9d3('0x4'))},'keyContent':{'type':Sequelize[_0xf9d3('0x8')]},'idField':{'type':Sequelize[_0xf9d3('0x8')]},'nameField':{'type':Sequelize[_0xf9d3('0x8')]},'customField':{'type':Sequelize[_0xf9d3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf9d3('0x8')]}};
\ No newline at end of file
+var _0xc41a=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3c0da1,_0x53d3e9){var _0x1b8c79=function(_0x525ba8){while(--_0x525ba8){_0x3c0da1['push'](_0x3c0da1['shift']());}};_0x1b8c79(++_0x53d3e9);}(_0xc41a,0xf6));var _0xac41=function(_0x26dcc5,_0x5cf1d0){_0x26dcc5=_0x26dcc5-0x0;var _0x4f09b0=_0xc41a[_0x26dcc5];return _0x4f09b0;};'use strict';var Sequelize=require('sequelize');module[_0xac41('0x0')]={'type':{'type':Sequelize[_0xac41('0x1')](_0xac41('0x2'),_0xac41('0x3'),_0xac41('0x4'),_0xac41('0x5'),_0xac41('0x6')),'defaultValue':_0xac41('0x2')},'content':{'type':Sequelize[_0xac41('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xac41('0x1')](_0xac41('0x2'),'variable',_0xac41('0x4'))},'keyContent':{'type':Sequelize[_0xac41('0x7')]},'idField':{'type':Sequelize[_0xac41('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xac41('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xac41('0x7')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc29b=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','FreshdeskField','fieldName','type','key','model','query','keys','filters','attributes','fields','length','offset','sort','where','pick','VIRTUAL','filter','options','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','include','create','body','find','eml-format','rimraf','zip-dir'];(function(_0x5caee5,_0x3454b0){var _0x41fe57=function(_0x2c8d9b){while(--_0x2c8d9b){_0x5caee5['push'](_0x5caee5['shift']());}};_0x41fe57(++_0x3454b0);}(_0xc29b,0x12d));var _0xbc29=function(_0x3940bb,_0x3f56b2){_0x3940bb=_0x3940bb-0x0;var _0x8ca868=_0xc29b[_0x3940bb];return _0x8ca868;};'use strict';var emlformat=require(_0xbc29('0x0'));var rimraf=require(_0xbc29('0x1'));var zipdir=require(_0xbc29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc29('0x3'));var moment=require(_0xbc29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc29('0x5'));var util=require(_0xbc29('0x6'));var path=require(_0xbc29('0x7'));var sox=require(_0xbc29('0x8'));var csv=require(_0xbc29('0x9'));var ejs=require(_0xbc29('0xa'));var fs=require('fs');var fs_extra=require(_0xbc29('0xb'));var _=require(_0xbc29('0xc'));var squel=require(_0xbc29('0xd'));var crypto=require(_0xbc29('0xe'));var jsforce=require(_0xbc29('0xf'));var deskjs=require(_0xbc29('0x10'));var toCsv=require(_0xbc29('0x9'));var querystring=require(_0xbc29('0x11'));var Papa=require(_0xbc29('0x12'));var Redis=require(_0xbc29('0x13'));var authService=require(_0xbc29('0x14'));var qs=require(_0xbc29('0x15'));var as=require(_0xbc29('0x16'));var hardwareService=require(_0xbc29('0x17'));var logger=require('../../config/logger')(_0xbc29('0x18'));var utils=require(_0xbc29('0x19'));var config=require(_0xbc29('0x1a'));var licenseUtil=require(_0xbc29('0x1b'));var db=require(_0xbc29('0x1c'))['db'];function respondWithStatusCode(_0x2794c6,_0x352c9e){_0x352c9e=_0x352c9e||0xcc;return function(_0x5e581f){if(_0x5e581f){return _0x2794c6[_0xbc29('0x1d')](_0x352c9e);}return _0x2794c6[_0xbc29('0x1e')](_0x352c9e)[_0xbc29('0x1f')]();};}function respondWithResult(_0x515ea8,_0x483fbe){_0x483fbe=_0x483fbe||0xc8;return function(_0x1892fc){if(_0x1892fc){return _0x515ea8['status'](_0x483fbe)[_0xbc29('0x20')](_0x1892fc);}};}function respondWithFilteredResult(_0x3f0264,_0x46eb03){return function(_0x490030){if(_0x490030){var _0x3b31b1=typeof _0x46eb03['offset']===_0xbc29('0x21')&&typeof _0x46eb03[_0xbc29('0x22')]===_0xbc29('0x21');var _0x1e7f15=_0x490030[_0xbc29('0x23')];var _0x42b0be=_0x3b31b1?0x0:_0x46eb03['offset'];var _0x9e84e3=_0x3b31b1?_0x490030[_0xbc29('0x23')]:_0x46eb03['offset']+_0x46eb03['limit'];var _0x30c251;if(_0x9e84e3>=_0x1e7f15){_0x9e84e3=_0x1e7f15;_0x30c251=0xc8;}else{_0x30c251=0xce;}_0x3f0264['status'](_0x30c251);return _0x3f0264['set'](_0xbc29('0x24'),_0x42b0be+'-'+_0x9e84e3+'/'+_0x1e7f15)[_0xbc29('0x20')](_0x490030);}return null;};}function patchUpdates(_0x1912ea){return function(_0x371adc){try{jsonpatch[_0xbc29('0x25')](_0x371adc,_0x1912ea,!![]);}catch(_0x3b6304){return BPromise[_0xbc29('0x26')](_0x3b6304);}return _0x371adc[_0xbc29('0x27')]();};}function saveUpdates(_0x5cdc9e,_0x115592){return function(_0x35920d){if(_0x35920d){return _0x35920d[_0xbc29('0x28')](_0x5cdc9e)[_0xbc29('0x29')](function(_0x1ae3f2){return _0x1ae3f2;});}return null;};}function removeEntity(_0x5c6f6d,_0x24523f){return function(_0x3ca9dc){if(_0x3ca9dc){return _0x3ca9dc[_0xbc29('0x2a')]()[_0xbc29('0x29')](function(){_0x5c6f6d['status'](0xcc)[_0xbc29('0x1f')]();});}};}function handleEntityNotFound(_0x3ad136,_0x536bd2){return function(_0xd3d9a5){if(!_0xd3d9a5){_0x3ad136[_0xbc29('0x1d')](0x194);}return _0xd3d9a5;};}function handleError(_0x511fa7,_0x4983b5){_0x4983b5=_0x4983b5||0x1f4;return function(_0x2c7b63){logger['error'](_0x2c7b63['stack']);if(_0x2c7b63[_0xbc29('0x2b')]){delete _0x2c7b63[_0xbc29('0x2b')];}_0x511fa7[_0xbc29('0x1e')](_0x4983b5)['send'](_0x2c7b63);};}exports[_0xbc29('0x2c')]=function(_0x3febdf,_0x1e11b3){var _0x2f23c2={},_0x1797c9={},_0x549cb5={'count':0x0,'rows':[]};var _0x55971f=_[_0xbc29('0x2d')](db[_0xbc29('0x2e')]['rawAttributes'],function(_0x2d89e1){return{'name':_0x2d89e1[_0xbc29('0x2f')],'type':_0x2d89e1[_0xbc29('0x30')][_0xbc29('0x31')]};});_0x1797c9[_0xbc29('0x32')]=_[_0xbc29('0x2d')](_0x55971f,'name');_0x1797c9[_0xbc29('0x33')]=_[_0xbc29('0x34')](_0x3febdf[_0xbc29('0x33')]);_0x1797c9[_0xbc29('0x35')]=_['intersection'](_0x1797c9[_0xbc29('0x32')],_0x1797c9[_0xbc29('0x33')]);_0x2f23c2[_0xbc29('0x36')]=_['intersection'](_0x1797c9['model'],qs[_0xbc29('0x37')](_0x3febdf[_0xbc29('0x33')][_0xbc29('0x37')]));_0x2f23c2['attributes']=_0x2f23c2[_0xbc29('0x36')][_0xbc29('0x38')]?_0x2f23c2[_0xbc29('0x36')]:_0x1797c9[_0xbc29('0x32')];if(!_0x3febdf['query']['hasOwnProperty']('nolimit')){_0x2f23c2[_0xbc29('0x22')]=qs[_0xbc29('0x22')](_0x3febdf[_0xbc29('0x33')]['limit']);_0x2f23c2['offset']=qs[_0xbc29('0x39')](_0x3febdf[_0xbc29('0x33')]['offset']);}_0x2f23c2['order']=qs[_0xbc29('0x3a')](_0x3febdf[_0xbc29('0x33')][_0xbc29('0x3a')]);_0x2f23c2[_0xbc29('0x3b')]=qs[_0xbc29('0x35')](_[_0xbc29('0x3c')](_0x3febdf['query'],_0x1797c9['filters']),_0x55971f);if(_0x3febdf[_0xbc29('0x33')]['filter']){_0x2f23c2[_0xbc29('0x3b')]=_['merge'](_0x2f23c2[_0xbc29('0x3b')],{'$or':_[_0xbc29('0x2d')](_0x55971f,function(_0x37afc4){if(_0x37afc4[_0xbc29('0x30')]!==_0xbc29('0x3d')){var _0x1d2e98={};_0x1d2e98[_0x37afc4[_0xbc29('0x2b')]]={'$like':'%'+_0x3febdf[_0xbc29('0x33')][_0xbc29('0x3e')]+'%'};return _0x1d2e98;}})});}_0x2f23c2=_['merge']({},_0x2f23c2,_0x3febdf[_0xbc29('0x3f')]);var _0x202804={'where':_0x2f23c2[_0xbc29('0x3b')]};return db[_0xbc29('0x2e')][_0xbc29('0x23')](_0x202804)['then'](function(_0x1e91bd){_0x549cb5[_0xbc29('0x23')]=_0x1e91bd;if(_0x3febdf[_0xbc29('0x33')]['includeAll']){_0x2f23c2['include']=[{'all':!![]}];}return db[_0xbc29('0x2e')][_0xbc29('0x40')](_0x2f23c2);})[_0xbc29('0x29')](function(_0xf8bd18){_0x549cb5[_0xbc29('0x41')]=_0xf8bd18;return _0x549cb5;})[_0xbc29('0x29')](respondWithFilteredResult(_0x1e11b3,_0x2f23c2))[_0xbc29('0x42')](handleError(_0x1e11b3,null));};exports[_0xbc29('0x43')]=function(_0x38f119,_0x3522f1){var _0x86bad5={'raw':!![],'where':{'id':_0x38f119[_0xbc29('0x44')]['id']}},_0x33508d={};_0x33508d['model']=_[_0xbc29('0x34')](db['FreshdeskField'][_0xbc29('0x45')]);_0x33508d[_0xbc29('0x33')]=_[_0xbc29('0x34')](_0x38f119[_0xbc29('0x33')]);_0x33508d['filters']=_[_0xbc29('0x46')](_0x33508d[_0xbc29('0x32')],_0x33508d[_0xbc29('0x33')]);_0x86bad5[_0xbc29('0x36')]=_[_0xbc29('0x46')](_0x33508d['model'],qs[_0xbc29('0x37')](_0x38f119[_0xbc29('0x33')][_0xbc29('0x37')]));_0x86bad5[_0xbc29('0x36')]=_0x86bad5[_0xbc29('0x36')]['length']?_0x86bad5['attributes']:_0x33508d[_0xbc29('0x32')];if(_0x38f119[_0xbc29('0x33')][_0xbc29('0x47')]){_0x86bad5[_0xbc29('0x48')]=[{'all':!![]}];}_0x86bad5=_['merge']({},_0x86bad5,_0x38f119[_0xbc29('0x3f')]);return db[_0xbc29('0x2e')]['find'](_0x86bad5)[_0xbc29('0x29')](handleEntityNotFound(_0x3522f1,null))['then'](respondWithResult(_0x3522f1,null))[_0xbc29('0x42')](handleError(_0x3522f1,null));};exports['create']=function(_0x54a625,_0x2866b2){return db[_0xbc29('0x2e')][_0xbc29('0x49')](_0x54a625[_0xbc29('0x4a')],{})['then'](respondWithResult(_0x2866b2,0xc9))[_0xbc29('0x42')](handleError(_0x2866b2,null));};exports['update']=function(_0x55c0cc,_0x2ff594){if(_0x55c0cc[_0xbc29('0x4a')]['id']){delete _0x55c0cc[_0xbc29('0x4a')]['id'];}return db[_0xbc29('0x2e')][_0xbc29('0x4b')]({'where':{'id':_0x55c0cc[_0xbc29('0x44')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x2ff594,null))[_0xbc29('0x29')](saveUpdates(_0x55c0cc['body'],null))[_0xbc29('0x29')](respondWithResult(_0x2ff594,null))[_0xbc29('0x42')](handleError(_0x2ff594,null));};exports[_0xbc29('0x2a')]=function(_0x599ba7,_0x3f4323){return db[_0xbc29('0x2e')]['find']({'where':{'id':_0x599ba7[_0xbc29('0x44')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x3f4323,null))[_0xbc29('0x29')](removeEntity(_0x3f4323,null))[_0xbc29('0x42')](handleError(_0x3f4323,null));};
\ No newline at end of file
+var _0xc6d8=['params','find','create','body','update','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','then','includeAll','include','findAll','catch','show'];(function(_0x572e89,_0x5a9050){var _0x3fcad8=function(_0x559f93){while(--_0x559f93){_0x572e89['push'](_0x572e89['shift']());}};_0x3fcad8(++_0x5a9050);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x1a077a,_0xe2bb6b){_0x1a077a=_0x1a077a-0x0;var _0x2d6e4c=_0xc6d8[_0x1a077a];return _0x2d6e4c;};'use strict';var emlformat=require(_0x8c6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c6d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c6d('0x2'));var moment=require('moment');var BPromise=require(_0x8c6d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c6d('0x4'));var sox=require(_0x8c6d('0x5'));var csv=require(_0x8c6d('0x6'));var ejs=require(_0x8c6d('0x7'));var fs=require('fs');var fs_extra=require(_0x8c6d('0x8'));var _=require(_0x8c6d('0x9'));var squel=require(_0x8c6d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8c6d('0xb'));var deskjs=require(_0x8c6d('0xc'));var toCsv=require(_0x8c6d('0x6'));var querystring=require('querystring');var Papa=require(_0x8c6d('0xd'));var Redis=require(_0x8c6d('0xe'));var authService=require(_0x8c6d('0xf'));var qs=require(_0x8c6d('0x10'));var as=require(_0x8c6d('0x11'));var hardwareService=require(_0x8c6d('0x12'));var logger=require(_0x8c6d('0x13'))(_0x8c6d('0x14'));var utils=require('../../config/utils');var config=require(_0x8c6d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22d0fb,_0x890e85){_0x890e85=_0x890e85||0xcc;return function(_0x131d97){if(_0x131d97){return _0x22d0fb[_0x8c6d('0x16')](_0x890e85);}return _0x22d0fb[_0x8c6d('0x17')](_0x890e85)[_0x8c6d('0x18')]();};}function respondWithResult(_0x42d746,_0x103699){_0x103699=_0x103699||0xc8;return function(_0x14c1ee){if(_0x14c1ee){return _0x42d746[_0x8c6d('0x17')](_0x103699)['json'](_0x14c1ee);}};}function respondWithFilteredResult(_0x16c6b5,_0x4b2bb1){return function(_0x16af06){if(_0x16af06){var _0x4dd4b6=typeof _0x4b2bb1[_0x8c6d('0x19')]===_0x8c6d('0x1a')&&typeof _0x4b2bb1['limit']===_0x8c6d('0x1a');var _0x2b8a26=_0x16af06['count'];var _0x3e5495=_0x4dd4b6?0x0:_0x4b2bb1['offset'];var _0x4c2f8d=_0x4dd4b6?_0x16af06[_0x8c6d('0x1b')]:_0x4b2bb1['offset']+_0x4b2bb1[_0x8c6d('0x1c')];var _0x174a4f;if(_0x4c2f8d>=_0x2b8a26){_0x4c2f8d=_0x2b8a26;_0x174a4f=0xc8;}else{_0x174a4f=0xce;}_0x16c6b5[_0x8c6d('0x17')](_0x174a4f);return _0x16c6b5[_0x8c6d('0x1d')](_0x8c6d('0x1e'),_0x3e5495+'-'+_0x4c2f8d+'/'+_0x2b8a26)['json'](_0x16af06);}return null;};}function patchUpdates(_0x5512be){return function(_0x550079){try{jsonpatch[_0x8c6d('0x1f')](_0x550079,_0x5512be,!![]);}catch(_0x507e0c){return BPromise[_0x8c6d('0x20')](_0x507e0c);}return _0x550079['save']();};}function saveUpdates(_0x4c378b,_0x37fd7c){return function(_0x8cebeb){if(_0x8cebeb){return _0x8cebeb['update'](_0x4c378b)['then'](function(_0x51bb08){return _0x51bb08;});}return null;};}function removeEntity(_0x47d3a0,_0x2a85b5){return function(_0xd16c91){if(_0xd16c91){return _0xd16c91[_0x8c6d('0x21')]()['then'](function(){_0x47d3a0[_0x8c6d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a9c4,_0x490b46){return function(_0x23c893){if(!_0x23c893){_0x15a9c4[_0x8c6d('0x16')](0x194);}return _0x23c893;};}function handleError(_0x353ba5,_0x2b6d18){_0x2b6d18=_0x2b6d18||0x1f4;return function(_0x1e6755){logger[_0x8c6d('0x22')](_0x1e6755[_0x8c6d('0x23')]);if(_0x1e6755[_0x8c6d('0x24')]){delete _0x1e6755[_0x8c6d('0x24')];}_0x353ba5['status'](_0x2b6d18)['send'](_0x1e6755);};}exports[_0x8c6d('0x25')]=function(_0x93a094,_0xfc6000){var _0x42a7db={},_0x370626={},_0x316ca7={'count':0x0,'rows':[]};var _0x2bc94a=_[_0x8c6d('0x26')](db[_0x8c6d('0x27')][_0x8c6d('0x28')],function(_0x3375dd){return{'name':_0x3375dd[_0x8c6d('0x29')],'type':_0x3375dd['type'][_0x8c6d('0x2a')]};});_0x370626[_0x8c6d('0x2b')]=_[_0x8c6d('0x26')](_0x2bc94a,_0x8c6d('0x24'));_0x370626[_0x8c6d('0x2c')]=_[_0x8c6d('0x2d')](_0x93a094[_0x8c6d('0x2c')]);_0x370626[_0x8c6d('0x2e')]=_[_0x8c6d('0x2f')](_0x370626['model'],_0x370626[_0x8c6d('0x2c')]);_0x42a7db['attributes']=_[_0x8c6d('0x2f')](_0x370626[_0x8c6d('0x2b')],qs[_0x8c6d('0x30')](_0x93a094[_0x8c6d('0x2c')][_0x8c6d('0x30')]));_0x42a7db[_0x8c6d('0x31')]=_0x42a7db['attributes']['length']?_0x42a7db[_0x8c6d('0x31')]:_0x370626[_0x8c6d('0x2b')];if(!_0x93a094[_0x8c6d('0x2c')][_0x8c6d('0x32')]('nolimit')){_0x42a7db[_0x8c6d('0x1c')]=qs[_0x8c6d('0x1c')](_0x93a094[_0x8c6d('0x2c')][_0x8c6d('0x1c')]);_0x42a7db[_0x8c6d('0x19')]=qs[_0x8c6d('0x19')](_0x93a094['query'][_0x8c6d('0x19')]);}_0x42a7db[_0x8c6d('0x33')]=qs[_0x8c6d('0x34')](_0x93a094[_0x8c6d('0x2c')][_0x8c6d('0x34')]);_0x42a7db[_0x8c6d('0x35')]=qs[_0x8c6d('0x2e')](_[_0x8c6d('0x36')](_0x93a094[_0x8c6d('0x2c')],_0x370626[_0x8c6d('0x2e')]),_0x2bc94a);if(_0x93a094[_0x8c6d('0x2c')][_0x8c6d('0x37')]){_0x42a7db['where']=_[_0x8c6d('0x38')](_0x42a7db[_0x8c6d('0x35')],{'$or':_[_0x8c6d('0x26')](_0x2bc94a,function(_0x454e96){if(_0x454e96[_0x8c6d('0x39')]!=='VIRTUAL'){var _0x26027f={};_0x26027f[_0x454e96[_0x8c6d('0x24')]]={'$like':'%'+_0x93a094['query'][_0x8c6d('0x37')]+'%'};return _0x26027f;}})});}_0x42a7db=_[_0x8c6d('0x38')]({},_0x42a7db,_0x93a094[_0x8c6d('0x3a')]);var _0x4869dc={'where':_0x42a7db[_0x8c6d('0x35')]};return db[_0x8c6d('0x27')][_0x8c6d('0x1b')](_0x4869dc)[_0x8c6d('0x3b')](function(_0x2f54a2){_0x316ca7[_0x8c6d('0x1b')]=_0x2f54a2;if(_0x93a094[_0x8c6d('0x2c')][_0x8c6d('0x3c')]){_0x42a7db[_0x8c6d('0x3d')]=[{'all':!![]}];}return db[_0x8c6d('0x27')][_0x8c6d('0x3e')](_0x42a7db);})['then'](function(_0x58af06){_0x316ca7['rows']=_0x58af06;return _0x316ca7;})[_0x8c6d('0x3b')](respondWithFilteredResult(_0xfc6000,_0x42a7db))[_0x8c6d('0x3f')](handleError(_0xfc6000,null));};exports[_0x8c6d('0x40')]=function(_0x3d69c3,_0x3409eb){var _0x546f04={'raw':!![],'where':{'id':_0x3d69c3[_0x8c6d('0x41')]['id']}},_0x274d01={};_0x274d01[_0x8c6d('0x2b')]=_['keys'](db[_0x8c6d('0x27')][_0x8c6d('0x28')]);_0x274d01['query']=_['keys'](_0x3d69c3['query']);_0x274d01['filters']=_['intersection'](_0x274d01[_0x8c6d('0x2b')],_0x274d01[_0x8c6d('0x2c')]);_0x546f04[_0x8c6d('0x31')]=_[_0x8c6d('0x2f')](_0x274d01[_0x8c6d('0x2b')],qs['fields'](_0x3d69c3['query']['fields']));_0x546f04['attributes']=_0x546f04[_0x8c6d('0x31')]['length']?_0x546f04[_0x8c6d('0x31')]:_0x274d01[_0x8c6d('0x2b')];if(_0x3d69c3[_0x8c6d('0x2c')][_0x8c6d('0x3c')]){_0x546f04[_0x8c6d('0x3d')]=[{'all':!![]}];}_0x546f04=_[_0x8c6d('0x38')]({},_0x546f04,_0x3d69c3['options']);return db[_0x8c6d('0x27')][_0x8c6d('0x42')](_0x546f04)['then'](handleEntityNotFound(_0x3409eb,null))[_0x8c6d('0x3b')](respondWithResult(_0x3409eb,null))[_0x8c6d('0x3f')](handleError(_0x3409eb,null));};exports['create']=function(_0x2fd4ea,_0xb6e94){return db[_0x8c6d('0x27')][_0x8c6d('0x43')](_0x2fd4ea[_0x8c6d('0x44')],{})[_0x8c6d('0x3b')](respondWithResult(_0xb6e94,0xc9))[_0x8c6d('0x3f')](handleError(_0xb6e94,null));};exports[_0x8c6d('0x45')]=function(_0x1f1609,_0x1d6c29){if(_0x1f1609[_0x8c6d('0x44')]['id']){delete _0x1f1609[_0x8c6d('0x44')]['id'];}return db[_0x8c6d('0x27')][_0x8c6d('0x42')]({'where':{'id':_0x1f1609[_0x8c6d('0x41')]['id']}})[_0x8c6d('0x3b')](handleEntityNotFound(_0x1d6c29,null))['then'](saveUpdates(_0x1f1609['body'],null))['then'](respondWithResult(_0x1d6c29,null))[_0x8c6d('0x3f')](handleError(_0x1d6c29,null));};exports[_0x8c6d('0x21')]=function(_0x4919b8,_0x574b08){return db['FreshdeskField'][_0x8c6d('0x42')]({'where':{'id':_0x4919b8['params']['id']}})[_0x8c6d('0x3b')](handleEntityNotFound(_0x574b08,null))[_0x8c6d('0x3b')](removeEntity(_0x574b08,null))[_0x8c6d('0x3f')](handleError(_0x574b08,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd25=['bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','api','moment'];(function(_0x5040b0,_0x53c900){var _0x32d66e=function(_0x10451b){while(--_0x10451b){_0x5040b0['push'](_0x5040b0['shift']());}};_0x32d66e(++_0x53c900);}(_0xfd25,0x169));var _0x5fd2=function(_0x393996,_0x4ec58a){_0x393996=_0x393996-0x0;var _0x5c59f3=_0xfd25[_0x393996];return _0x5c59f3;};'use strict';var _=require(_0x5fd2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5fd2('0x1'));var moment=require(_0x5fd2('0x2'));var BPromise=require(_0x5fd2('0x3'));var rp=require(_0x5fd2('0x4'));var fs=require('fs');var path=require(_0x5fd2('0x5'));var rimraf=require(_0x5fd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fd2('0x7'));module[_0x5fd2('0x8')]=function(_0x31ddb3,_0xbee3e){return _0x31ddb3[_0x5fd2('0x9')]('FreshdeskField',attributes,{'tableName':_0x5fd2('0xa'),'paranoid':![],'indexes':[{'name':_0x5fd2('0xb'),'fields':['idField',_0x5fd2('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x023f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x15298c,_0x23e752){var _0x41eb89=function(_0x5695d2){while(--_0x5695d2){_0x15298c['push'](_0x15298c['shift']());}};_0x41eb89(++_0x23e752);}(_0x023f,0x69));var _0xf023=function(_0x1310d4,_0x27f013){_0x1310d4=_0x1310d4-0x0;var _0x18ddcc=_0x023f[_0x1310d4];return _0x18ddcc;};'use strict';var _=require(_0xf023('0x0'));var util=require(_0xf023('0x1'));var logger=require(_0xf023('0x2'))(_0xf023('0x3'));var moment=require(_0xf023('0x4'));var BPromise=require(_0xf023('0x5'));var rp=require(_0xf023('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf023('0x7'));var config=require(_0xf023('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0xf5c75f,_0x491415){return _0xf5c75f[_0xf023('0x9')](_0xf023('0xa'),attributes,{'tableName':_0xf023('0xb'),'paranoid':![],'indexes':[{'name':_0xf023('0xc'),'fields':[_0xf023('0xd'),_0xf023('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x229d=['FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x229d,0xb8));var _0xd229=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x229d[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xd229('0x0'));var util=require(_0xd229('0x1'));var moment=require(_0xd229('0x2'));var BPromise=require(_0xd229('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd229('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd229('0x5'));var logger=require('../../config/logger')(_0xd229('0x6'));var config=require(_0xd229('0x7'));var jayson=require(_0xd229('0x8'));var client=jayson[_0xd229('0x9')][_0xd229('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f1656,_0x51259a,_0x154f62){return new BPromise(function(_0x270464,_0x56a3ef){return client['request'](_0x3f1656,_0x154f62)[_0xd229('0xb')](function(_0x1a1f47){logger[_0xd229('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x51259a,'request\x20sent');logger[_0xd229('0xd')](_0xd229('0xe'),_0x51259a,_0xd229('0xf'),JSON[_0xd229('0x10')](_0x1a1f47));if(_0x1a1f47['error']){if(_0x1a1f47[_0xd229('0x11')][_0xd229('0x12')]===0x1f4){logger[_0xd229('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x51259a,_0x1a1f47['error']['message']);return _0x56a3ef(_0x1a1f47['error'][_0xd229('0x13')]);}logger[_0xd229('0x11')](_0xd229('0x14'),_0x51259a,_0x1a1f47[_0xd229('0x11')]['message']);return _0x270464(_0x1a1f47[_0xd229('0x11')]['message']);}else{logger['info'](_0xd229('0x14'),_0x51259a,_0xd229('0xf'));_0x270464(_0x1a1f47[_0xd229('0x15')][_0xd229('0x13')]);}})['catch'](function(_0x53157c){logger['error'](_0xd229('0x14'),_0x51259a,_0x53157c);_0x56a3ef(_0x53157c);});});}
\ No newline at end of file
+var _0x4d01=['result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent'];(function(_0x2336ea,_0x46e872){var _0x216bf9=function(_0x14a50d){while(--_0x14a50d){_0x2336ea['push'](_0x2336ea['shift']());}};_0x216bf9(++_0x46e872);}(_0x4d01,0x1a6));var _0x14d0=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x4d01[_0x352d28];return _0x387d7e;};'use strict';var _=require('lodash');var util=require(_0x14d0('0x0'));var moment=require(_0x14d0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d0('0x2'));var db=require(_0x14d0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x14d0('0x4'))(_0x14d0('0x5'));var config=require('../../config/environment');var jayson=require(_0x14d0('0x6'));var client=jayson[_0x14d0('0x7')][_0x14d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20e632,_0x53db79,_0x5983ad){return new BPromise(function(_0x2a312c,_0x5ee58c){return client[_0x14d0('0x9')](_0x20e632,_0x5983ad)[_0x14d0('0xa')](function(_0x418bac){logger[_0x14d0('0xb')](_0x14d0('0xc'),_0x53db79,'request\x20sent');logger[_0x14d0('0xd')](_0x14d0('0xe'),_0x53db79,'request\x20sent',JSON[_0x14d0('0xf')](_0x418bac));if(_0x418bac[_0x14d0('0x10')]){if(_0x418bac[_0x14d0('0x10')]['code']===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x53db79,_0x418bac[_0x14d0('0x10')]['message']);return _0x5ee58c(_0x418bac['error'][_0x14d0('0x11')]);}logger['error'](_0x14d0('0xc'),_0x53db79,_0x418bac[_0x14d0('0x10')][_0x14d0('0x11')]);return _0x2a312c(_0x418bac[_0x14d0('0x10')][_0x14d0('0x11')]);}else{logger[_0x14d0('0xb')](_0x14d0('0xc'),_0x53db79,_0x14d0('0x12'));_0x2a312c(_0x418bac[_0x14d0('0x13')]['message']);}})[_0x14d0('0x14')](function(_0x3a1d81){logger[_0x14d0('0x10')](_0x14d0('0xc'),_0x53db79,_0x3a1d81);_0x5ee58c(_0x3a1d81);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7334=['put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x4c89cd,_0x2c57e2){var _0x1090d2=function(_0x1e9dda){while(--_0x1e9dda){_0x4c89cd['push'](_0x4c89cd['shift']());}};_0x1090d2(++_0x2c57e2);}(_0x7334,0x184));var _0x4733=function(_0x172c6d,_0x313d4c){_0x172c6d=_0x172c6d-0x0;var _0x2d63c0=_0x7334[_0x172c6d];return _0x2d63c0;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0x8')](_0x4733('0xf'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router[_0x4733('0x11')]('/',auth['isAuthenticated'](),controller[_0x4733('0x12')]);router['post'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router[_0x4733('0x14')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router['delete'](_0x4733('0xb'),auth['isAuthenticated'](),controller[_0x4733('0x16')]);module[_0x4733('0x17')]=router;
\ No newline at end of file
+var _0xf4eb=['getFields','create','put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x5abf3a,_0xbdfcbd){var _0xa9e9d4=function(_0xdd83aa){while(--_0xdd83aa){_0x5abf3a['push'](_0x5abf3a['shift']());}};_0xa9e9d4(++_0xbdfcbd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x46d968,_0x555738){_0x46d968=_0x46d968-0x0;var _0x43b538=_0xf4eb[_0x46d968];return _0x43b538;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xc')]);router['post'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['addConfiguration']);router[_0xbf4e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);module[_0xbf4e('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b12=['STRING','sequelize','exports'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x5b12,0xa3));var _0x25b1=function(_0x5cd362,_0x450511){_0x5cd362=_0x5cd362-0x0;var _0x539114=_0x5b12[_0x5cd362];return _0x539114;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x25b1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x25b1('0x2')]},'remoteUri':{'type':Sequelize[_0x25b1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x1967=['STRING','username','remoteUri','exports'];(function(_0x2dc735,_0x5b3890){var _0x1c3693=function(_0x50dcda){while(--_0x50dcda){_0x2dc735['push'](_0x2dc735['shift']());}};_0x1c3693(++_0x5b3890);}(_0x1967,0x173));var _0x7196=function(_0x21728c,_0x5a3f80){_0x21728c=_0x21728c-0x0;var _0x1e50e5=_0x1967[_0x21728c];return _0x1e50e5;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'apiKey':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x119c=['FreshsalesField','Subjects','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','merge','find','catch','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','pick','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions'];(function(_0x5aae4b,_0x4d0da6){var _0xf4485=function(_0x53c067){while(--_0x53c067){_0x5aae4b['push'](_0x5aae4b['shift']());}};_0xf4485(++_0x4d0da6);}(_0x119c,0x7f));var _0xc119=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0x119c[_0x158a58];return _0x4935d9;};'use strict';var emlformat=require(_0xc119('0x0'));var rimraf=require(_0xc119('0x1'));var zipdir=require(_0xc119('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc119('0x3'));var moment=require('moment');var BPromise=require(_0xc119('0x4'));var Mustache=require('mustache');var util=require(_0xc119('0x5'));var path=require('path');var sox=require(_0xc119('0x6'));var csv=require('to-csv');var ejs=require(_0xc119('0x7'));var fs=require('fs');var fs_extra=require(_0xc119('0x8'));var _=require(_0xc119('0x9'));var squel=require('squel');var crypto=require(_0xc119('0xa'));var jsforce=require(_0xc119('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc119('0xc'));var querystring=require(_0xc119('0xd'));var Papa=require('papaparse');var Redis=require(_0xc119('0xe'));var authService=require(_0xc119('0xf'));var qs=require(_0xc119('0x10'));var as=require(_0xc119('0x11'));var hardwareService=require(_0xc119('0x12'));var logger=require(_0xc119('0x13'))(_0xc119('0x14'));var utils=require(_0xc119('0x15'));var config=require(_0xc119('0x16'));var licenseUtil=require(_0xc119('0x17'));var db=require(_0xc119('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x163ae9,_0x229314){_0x229314=_0x229314||0xcc;return function(_0x2a3b9c){if(_0x2a3b9c){return _0x163ae9['sendStatus'](_0x229314);}return _0x163ae9[_0xc119('0x19')](_0x229314)[_0xc119('0x1a')]();};}function respondWithResult(_0x403cf3,_0x443173){_0x443173=_0x443173||0xc8;return function(_0x4cf0b6){if(_0x4cf0b6){return _0x403cf3[_0xc119('0x19')](_0x443173)[_0xc119('0x1b')](_0x4cf0b6);}};}function respondWithFilteredResult(_0x59d9dd,_0x15102b){return function(_0x3cf4b4){if(_0x3cf4b4){var _0xb7bc29=typeof _0x15102b[_0xc119('0x1c')]===_0xc119('0x1d')&&typeof _0x15102b[_0xc119('0x1e')]===_0xc119('0x1d');var _0x426735=_0x3cf4b4[_0xc119('0x1f')];var _0x4fee62=_0xb7bc29?0x0:_0x15102b[_0xc119('0x1c')];var _0x32c7a9=_0xb7bc29?_0x3cf4b4[_0xc119('0x1f')]:_0x15102b['offset']+_0x15102b['limit'];var _0xccc11f;if(_0x32c7a9>=_0x426735){_0x32c7a9=_0x426735;_0xccc11f=0xc8;}else{_0xccc11f=0xce;}_0x59d9dd[_0xc119('0x19')](_0xccc11f);return _0x59d9dd[_0xc119('0x20')]('Content-Range',_0x4fee62+'-'+_0x32c7a9+'/'+_0x426735)[_0xc119('0x1b')](_0x3cf4b4);}return null;};}function patchUpdates(_0x5201c7){return function(_0x2bb419){try{jsonpatch[_0xc119('0x21')](_0x2bb419,_0x5201c7,!![]);}catch(_0x1c8426){return BPromise['reject'](_0x1c8426);}return _0x2bb419[_0xc119('0x22')]();};}function saveUpdates(_0x3336aa,_0x12fe78){return function(_0x5198bd){if(_0x5198bd){return _0x5198bd[_0xc119('0x23')](_0x3336aa)[_0xc119('0x24')](function(_0xdc139){return _0xdc139;});}return null;};}function removeEntity(_0x281be4,_0x1d605f){return function(_0x1936ec){if(_0x1936ec){return _0x1936ec['destroy']()['then'](function(){_0x281be4['status'](0xcc)[_0xc119('0x1a')]();});}};}function handleEntityNotFound(_0x1d79ec,_0x295b7b){return function(_0x94afc6){if(!_0x94afc6){_0x1d79ec[_0xc119('0x25')](0x194);}return _0x94afc6;};}function handleError(_0x134b28,_0x50a5ff){_0x50a5ff=_0x50a5ff||0x1f4;return function(_0x4194f6){logger['error'](_0x4194f6[_0xc119('0x26')]);if(_0x4194f6[_0xc119('0x27')]){delete _0x4194f6[_0xc119('0x27')];}_0x134b28[_0xc119('0x19')](_0x50a5ff)[_0xc119('0x28')](_0x4194f6);};}exports[_0xc119('0x29')]=function(_0x66029d,_0x560082){var _0x4886de={},_0x799c8c={},_0x518ce8={'count':0x0,'rows':[]};var _0x33a95f=_[_0xc119('0x2a')](db[_0xc119('0x2b')][_0xc119('0x2c')],function(_0x4e7c3a){return{'name':_0x4e7c3a[_0xc119('0x2d')],'type':_0x4e7c3a[_0xc119('0x2e')]['key']};});_0x799c8c[_0xc119('0x2f')]=_[_0xc119('0x2a')](_0x33a95f,_0xc119('0x27'));_0x799c8c[_0xc119('0x30')]=_['keys'](_0x66029d[_0xc119('0x30')]);_0x799c8c[_0xc119('0x31')]=_[_0xc119('0x32')](_0x799c8c[_0xc119('0x2f')],_0x799c8c[_0xc119('0x30')]);_0x4886de[_0xc119('0x33')]=_[_0xc119('0x32')](_0x799c8c[_0xc119('0x2f')],qs[_0xc119('0x34')](_0x66029d['query'][_0xc119('0x34')]));_0x4886de[_0xc119('0x33')]=_0x4886de[_0xc119('0x33')][_0xc119('0x35')]?_0x4886de[_0xc119('0x33')]:_0x799c8c['model'];if(!_0x66029d[_0xc119('0x30')][_0xc119('0x36')]('nolimit')){_0x4886de[_0xc119('0x1e')]=qs['limit'](_0x66029d[_0xc119('0x30')][_0xc119('0x1e')]);_0x4886de['offset']=qs[_0xc119('0x1c')](_0x66029d[_0xc119('0x30')][_0xc119('0x1c')]);}_0x4886de[_0xc119('0x37')]=qs[_0xc119('0x38')](_0x66029d['query'][_0xc119('0x38')]);_0x4886de[_0xc119('0x39')]=qs[_0xc119('0x31')](_['pick'](_0x66029d[_0xc119('0x30')],_0x799c8c['filters']),_0x33a95f);if(_0x66029d['query']['filter']){_0x4886de[_0xc119('0x39')]=_['merge'](_0x4886de[_0xc119('0x39')],{'$or':_[_0xc119('0x2a')](_0x33a95f,function(_0x2728dc){if(_0x2728dc[_0xc119('0x2e')]!==_0xc119('0x3a')){var _0x1bdde2={};_0x1bdde2[_0x2728dc[_0xc119('0x27')]]={'$like':'%'+_0x66029d[_0xc119('0x30')][_0xc119('0x3b')]+'%'};return _0x1bdde2;}})});}_0x4886de=_['merge']({},_0x4886de,_0x66029d[_0xc119('0x3c')]);var _0x586119={'where':_0x4886de[_0xc119('0x39')]};return db[_0xc119('0x2b')]['count'](_0x586119)[_0xc119('0x24')](function(_0x35540f){_0x518ce8[_0xc119('0x1f')]=_0x35540f;if(_0x66029d[_0xc119('0x30')][_0xc119('0x3d')]){_0x4886de[_0xc119('0x3e')]=[{'all':!![]}];}return db[_0xc119('0x2b')][_0xc119('0x3f')](_0x4886de);})[_0xc119('0x24')](function(_0x2da5d7){_0x518ce8['rows']=_0x2da5d7;return _0x518ce8;})[_0xc119('0x24')](respondWithFilteredResult(_0x560082,_0x4886de))['catch'](handleError(_0x560082,null));};exports[_0xc119('0x40')]=function(_0x4142a0,_0x4ad999){var _0x49ad65={'raw':![],'where':{'id':_0x4142a0[_0xc119('0x41')]['id']}},_0x35abde={};_0x35abde[_0xc119('0x2f')]=_[_0xc119('0x42')](db[_0xc119('0x2b')]['rawAttributes']);_0x35abde[_0xc119('0x30')]=_['keys'](_0x4142a0[_0xc119('0x30')]);_0x35abde[_0xc119('0x31')]=_[_0xc119('0x32')](_0x35abde[_0xc119('0x2f')],_0x35abde['query']);_0x49ad65[_0xc119('0x33')]=_[_0xc119('0x32')](_0x35abde['model'],qs[_0xc119('0x34')](_0x4142a0['query']['fields']));_0x49ad65[_0xc119('0x33')]=_0x49ad65['attributes'][_0xc119('0x35')]?_0x49ad65[_0xc119('0x33')]:_0x35abde[_0xc119('0x2f')];if(_0x4142a0['query'][_0xc119('0x3d')]){_0x49ad65[_0xc119('0x3e')]=[{'all':!![]}];}_0x49ad65=_[_0xc119('0x43')]({},_0x49ad65,_0x4142a0[_0xc119('0x3c')]);return db[_0xc119('0x2b')][_0xc119('0x44')](_0x49ad65)[_0xc119('0x24')](handleEntityNotFound(_0x4ad999,null))[_0xc119('0x24')](respondWithResult(_0x4ad999,null))[_0xc119('0x45')](handleError(_0x4ad999,null));};exports[_0xc119('0x46')]=function(_0x3ba832,_0x5ad086){return db[_0xc119('0x2b')][_0xc119('0x46')](_0x3ba832[_0xc119('0x47')],{})[_0xc119('0x24')](respondWithResult(_0x5ad086,0xc9))[_0xc119('0x45')](handleError(_0x5ad086,null));};exports[_0xc119('0x23')]=function(_0x2c8de1,_0x1a2eb9){if(_0x2c8de1[_0xc119('0x47')]['id']){delete _0x2c8de1[_0xc119('0x47')]['id'];}return db['FreshsalesAccount'][_0xc119('0x44')]({'where':{'id':_0x2c8de1['params']['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x1a2eb9,null))['then'](saveUpdates(_0x2c8de1['body'],null))[_0xc119('0x24')](respondWithResult(_0x1a2eb9,null))[_0xc119('0x45')](handleError(_0x1a2eb9,null));};exports[_0xc119('0x48')]=function(_0x115b29,_0x5f1f83){return db[_0xc119('0x2b')]['find']({'where':{'id':_0x115b29[_0xc119('0x41')]['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x5f1f83,null))[_0xc119('0x24')](removeEntity(_0x5f1f83,null))[_0xc119('0x45')](handleError(_0x5f1f83,null));};exports[_0xc119('0x49')]=function(_0x2b7dbb,_0x20453e,_0x850d4a){var _0x111598={};var _0x5c4572={};var _0x59bdb1;var _0x560935;return db[_0xc119('0x2b')][_0xc119('0x4a')]({'where':{'id':_0x2b7dbb[_0xc119('0x41')]['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x20453e,null))[_0xc119('0x24')](function(_0x3ffcdd){if(_0x3ffcdd){_0x59bdb1=_0x3ffcdd;_0x5c4572[_0xc119('0x2f')]=_[_0xc119('0x42')](db[_0xc119('0x4b')]['rawAttributes']);_0x5c4572[_0xc119('0x30')]=_[_0xc119('0x42')](_0x2b7dbb['query']);_0x5c4572[_0xc119('0x31')]=_[_0xc119('0x32')](_0x5c4572[_0xc119('0x2f')],_0x5c4572[_0xc119('0x30')]);_0x111598['attributes']=_['intersection'](_0x5c4572[_0xc119('0x2f')],qs['fields'](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x34')]));_0x111598['attributes']=_0x111598[_0xc119('0x33')][_0xc119('0x35')]?_0x111598[_0xc119('0x33')]:_0x5c4572[_0xc119('0x2f')];_0x111598[_0xc119('0x37')]=qs[_0xc119('0x38')](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x38')]);_0x111598[_0xc119('0x39')]=qs[_0xc119('0x31')](_[_0xc119('0x4c')](_0x2b7dbb[_0xc119('0x30')],_0x5c4572[_0xc119('0x31')]));if(_0x2b7dbb[_0xc119('0x30')][_0xc119('0x3b')]){_0x111598[_0xc119('0x39')]=_['merge'](_0x111598[_0xc119('0x39')],{'$or':_['map'](_0x111598['attributes'],function(_0x169ba9){var _0x3ae07a={};_0x3ae07a[_0x169ba9]={'$like':'%'+_0x2b7dbb['query'][_0xc119('0x3b')]+'%'};return _0x3ae07a;})});}_0x111598=_[_0xc119('0x43')]({},_0x111598,_0x2b7dbb['options']);return _0x59bdb1[_0xc119('0x49')](_0x111598);}})[_0xc119('0x24')](function(_0x22b5c1){if(_0x22b5c1){_0x560935=_0x22b5c1[_0xc119('0x35')];if(!_0x2b7dbb[_0xc119('0x30')][_0xc119('0x36')](_0xc119('0x4d'))){_0x111598['limit']=qs[_0xc119('0x1e')](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x1e')]);_0x111598['offset']=qs[_0xc119('0x1c')](_0x2b7dbb[_0xc119('0x30')][_0xc119('0x1c')]);}return _0x59bdb1[_0xc119('0x49')](_0x111598);}})[_0xc119('0x24')](function(_0x598c6f){if(_0x598c6f){return _0x598c6f?{'count':_0x560935,'rows':_0x598c6f}:null;}})[_0xc119('0x24')](respondWithResult(_0x20453e,null))[_0xc119('0x45')](handleError(_0x20453e,null));};exports[_0xc119('0x4e')]=function(_0x1fdfa7,_0x2bb624,_0x27b108){if(_0x1fdfa7[_0xc119('0x47')]['id']){delete _0x1fdfa7[_0xc119('0x47')]['id'];}return db[_0xc119('0x2b')][_0xc119('0x4a')]({'where':{'id':_0x1fdfa7['params']['id']}})[_0xc119('0x24')](handleEntityNotFound(_0x2bb624,null))[_0xc119('0x24')](function(_0x30951e){if(_0x30951e){_0x1fdfa7[_0xc119('0x47')][_0xc119('0x4f')]=_0x30951e['id'];_0x1fdfa7[_0xc119('0x47')]['Subjects']=integrations[_0xc119('0x50')](_0x1fdfa7['body'][_0xc119('0x51')],_0x1fdfa7[_0xc119('0x47')][_0xc119('0x2e')]);_0x1fdfa7[_0xc119('0x47')][_0xc119('0x52')]=integrations['getDescriptions'](_0x1fdfa7['body'][_0xc119('0x51')],_0x1fdfa7[_0xc119('0x47')][_0xc119('0x2e')]);return db[_0xc119('0x4b')][_0xc119('0x46')](_0x1fdfa7[_0xc119('0x47')],{'include':[{'model':db[_0xc119('0x53')],'as':_0xc119('0x54')},{'model':db[_0xc119('0x53')],'as':_0xc119('0x52')}]});}return null;})[_0xc119('0x24')](respondWithResult(_0x2bb624,null))[_0xc119('0x45')](handleError(_0x2bb624,null));};exports[_0xc119('0x55')]=function(_0x99279f,_0x3ed90f,_0x4f8c43){var _0x47e717='';var _0x454082='';return db[_0xc119('0x2b')][_0xc119('0x4a')]({'where':{'id':_0x99279f['params']['id']},'attributes':['id',_0xc119('0x56'),_0xc119('0x57'),'apiKey']})['then'](handleEntityNotFound(_0x3ed90f,null))[_0xc119('0x24')](function(_0x541fad){if(_0x541fad){_0x454082=_0x541fad['username'];_0x47e717=_0x541fad[_0xc119('0x57')];var _0x5e8c0c=_0x541fad['remoteUri'][_0xc119('0x58')](-0x1);if(_0x5e8c0c==='/'){_0x47e717=_0x47e717[_0xc119('0x59')](0x0,_0x47e717[_0xc119('0x5a')](_0x5e8c0c));}return rp({'method':_0xc119('0x5b'),'uri':util[_0xc119('0x5c')](_0xc119('0x5d'),_0x47e717,_0xc119('0x5e')),'headers':{'Authorization':_0xc119('0x5f')+_0x541fad[_0xc119('0x60')]},'json':!![]});}})[_0xc119('0x24')](function(_0x844791){if(_0x844791){var _0x5e1b9b=_0x844791[_0xc119('0x61')];var _0x1faa17=![];var _0x2168f3=null;for(_0x2168f3=0x0;_0x2168f3<_0x5e1b9b[_0xc119('0x35')];_0x2168f3++){if(_0x5e1b9b[_0x2168f3][_0xc119('0x62')]===_0x454082){_0x1faa17=!![];}}if(_0x1faa17){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc119('0x63')});}}})['then'](respondWithResult(_0x3ed90f,null))[_0xc119('0x45')](function(_0x4fa364){var _0x2b1e61=_0x99279f['query'][_0xc119('0x64')]?0x1f4:_0x4fa364[_0xc119('0x65')]||0x1f4;logger['error'](_0xc119('0x66'),_0xc119('0x55'),_0x2b1e61,JSON[_0xc119('0x67')](_0x4fa364));delete _0x4fa364[_0xc119('0x27')];if(_0x2b1e61===0x191){_0x2b1e61=0x190;}_0x3ed90f[_0xc119('0x19')](_0x2b1e61)[_0xc119('0x28')](_0x99279f['query']['test']?{'message':_0xc119('0x68'),'statusCode':_0x4fa364['statusCode']}:_0x4fa364);});};
\ No newline at end of file
+var _0xc2fa=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','FreshsalesAccount','rawAttributes','fieldName','type','key','query','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','update','getConfigurations','merge','map','addConfiguration','findOne','getSubjects','channel','Descriptions','FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','slice','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1cf870,_0x5f172d){var _0x439018=function(_0x4e0f93){while(--_0x4e0f93){_0x1cf870['push'](_0x1cf870['shift']());}};_0x439018(++_0x5f172d);}(_0xc2fa,0x123));var _0xac2f=function(_0x319c08,_0x353bb7){_0x319c08=_0x319c08-0x0;var _0x135ef5=_0xc2fa[_0x319c08];return _0x135ef5;};'use strict';var emlformat=require(_0xac2f('0x0'));var rimraf=require(_0xac2f('0x1'));var zipdir=require(_0xac2f('0x2'));var jsonpatch=require(_0xac2f('0x3'));var rp=require(_0xac2f('0x4'));var moment=require(_0xac2f('0x5'));var BPromise=require(_0xac2f('0x6'));var Mustache=require(_0xac2f('0x7'));var util=require('util');var path=require(_0xac2f('0x8'));var sox=require(_0xac2f('0x9'));var csv=require(_0xac2f('0xa'));var ejs=require(_0xac2f('0xb'));var fs=require('fs');var fs_extra=require(_0xac2f('0xc'));var _=require(_0xac2f('0xd'));var squel=require(_0xac2f('0xe'));var crypto=require('crypto');var jsforce=require(_0xac2f('0xf'));var deskjs=require(_0xac2f('0x10'));var toCsv=require(_0xac2f('0xa'));var querystring=require(_0xac2f('0x11'));var Papa=require(_0xac2f('0x12'));var Redis=require(_0xac2f('0x13'));var authService=require(_0xac2f('0x14'));var qs=require(_0xac2f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac2f('0x16'));var logger=require(_0xac2f('0x17'))('api');var utils=require(_0xac2f('0x18'));var config=require(_0xac2f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xac2f('0x1a'))['db'];var integrations=require(_0xac2f('0x1b'));function respondWithStatusCode(_0x3e4a5c,_0x1ae942){_0x1ae942=_0x1ae942||0xcc;return function(_0x38c8d7){if(_0x38c8d7){return _0x3e4a5c[_0xac2f('0x1c')](_0x1ae942);}return _0x3e4a5c[_0xac2f('0x1d')](_0x1ae942)[_0xac2f('0x1e')]();};}function respondWithResult(_0x37d403,_0x4b1739){_0x4b1739=_0x4b1739||0xc8;return function(_0x454a8d){if(_0x454a8d){return _0x37d403[_0xac2f('0x1d')](_0x4b1739)[_0xac2f('0x1f')](_0x454a8d);}};}function respondWithFilteredResult(_0x22d88a,_0x30ad07){return function(_0x200f91){if(_0x200f91){var _0xaa8a58=typeof _0x30ad07[_0xac2f('0x20')]===_0xac2f('0x21')&&typeof _0x30ad07[_0xac2f('0x22')]===_0xac2f('0x21');var _0x5064cd=_0x200f91[_0xac2f('0x23')];var _0x5b3be4=_0xaa8a58?0x0:_0x30ad07[_0xac2f('0x20')];var _0x3f40f9=_0xaa8a58?_0x200f91['count']:_0x30ad07[_0xac2f('0x20')]+_0x30ad07[_0xac2f('0x22')];var _0x5f19e9;if(_0x3f40f9>=_0x5064cd){_0x3f40f9=_0x5064cd;_0x5f19e9=0xc8;}else{_0x5f19e9=0xce;}_0x22d88a[_0xac2f('0x1d')](_0x5f19e9);return _0x22d88a['set'](_0xac2f('0x24'),_0x5b3be4+'-'+_0x3f40f9+'/'+_0x5064cd)['json'](_0x200f91);}return null;};}function patchUpdates(_0x18beea){return function(_0x442f45){try{jsonpatch[_0xac2f('0x25')](_0x442f45,_0x18beea,!![]);}catch(_0x53eacf){return BPromise[_0xac2f('0x26')](_0x53eacf);}return _0x442f45[_0xac2f('0x27')]();};}function saveUpdates(_0x3c2014,_0x413f4f){return function(_0xc5ee46){if(_0xc5ee46){return _0xc5ee46['update'](_0x3c2014)[_0xac2f('0x28')](function(_0x54c538){return _0x54c538;});}return null;};}function removeEntity(_0x33b540,_0x571295){return function(_0x9fa8d9){if(_0x9fa8d9){return _0x9fa8d9[_0xac2f('0x29')]()[_0xac2f('0x28')](function(){_0x33b540['status'](0xcc)[_0xac2f('0x1e')]();});}};}function handleEntityNotFound(_0xbc1414,_0x258e09){return function(_0x1105d3){if(!_0x1105d3){_0xbc1414[_0xac2f('0x1c')](0x194);}return _0x1105d3;};}function handleError(_0x43127f,_0x1f9e39){_0x1f9e39=_0x1f9e39||0x1f4;return function(_0x322fec){logger[_0xac2f('0x2a')](_0x322fec['stack']);if(_0x322fec[_0xac2f('0x2b')]){delete _0x322fec[_0xac2f('0x2b')];}_0x43127f['status'](_0x1f9e39)['send'](_0x322fec);};}exports['index']=function(_0x2bcced,_0x3099a1){var _0x166cd4={},_0x129f25={},_0x497525={'count':0x0,'rows':[]};var _0x392bb2=_['map'](db[_0xac2f('0x2c')][_0xac2f('0x2d')],function(_0x59a833){return{'name':_0x59a833[_0xac2f('0x2e')],'type':_0x59a833[_0xac2f('0x2f')][_0xac2f('0x30')]};});_0x129f25['model']=_['map'](_0x392bb2,'name');_0x129f25[_0xac2f('0x31')]=_['keys'](_0x2bcced[_0xac2f('0x31')]);_0x129f25['filters']=_['intersection'](_0x129f25['model'],_0x129f25[_0xac2f('0x31')]);_0x166cd4['attributes']=_[_0xac2f('0x32')](_0x129f25[_0xac2f('0x33')],qs['fields'](_0x2bcced[_0xac2f('0x31')][_0xac2f('0x34')]));_0x166cd4['attributes']=_0x166cd4['attributes'][_0xac2f('0x35')]?_0x166cd4[_0xac2f('0x36')]:_0x129f25[_0xac2f('0x33')];if(!_0x2bcced[_0xac2f('0x31')][_0xac2f('0x37')](_0xac2f('0x38'))){_0x166cd4[_0xac2f('0x22')]=qs[_0xac2f('0x22')](_0x2bcced[_0xac2f('0x31')][_0xac2f('0x22')]);_0x166cd4[_0xac2f('0x20')]=qs[_0xac2f('0x20')](_0x2bcced['query']['offset']);}_0x166cd4[_0xac2f('0x39')]=qs[_0xac2f('0x3a')](_0x2bcced['query'][_0xac2f('0x3a')]);_0x166cd4[_0xac2f('0x3b')]=qs['filters'](_[_0xac2f('0x3c')](_0x2bcced[_0xac2f('0x31')],_0x129f25[_0xac2f('0x3d')]),_0x392bb2);if(_0x2bcced[_0xac2f('0x31')][_0xac2f('0x3e')]){_0x166cd4[_0xac2f('0x3b')]=_['merge'](_0x166cd4[_0xac2f('0x3b')],{'$or':_['map'](_0x392bb2,function(_0x146d9e){if(_0x146d9e['type']!==_0xac2f('0x3f')){var _0xbc76d8={};_0xbc76d8[_0x146d9e['name']]={'$like':'%'+_0x2bcced[_0xac2f('0x31')][_0xac2f('0x3e')]+'%'};return _0xbc76d8;}})});}_0x166cd4=_['merge']({},_0x166cd4,_0x2bcced[_0xac2f('0x40')]);var _0x17b12d={'where':_0x166cd4[_0xac2f('0x3b')]};return db[_0xac2f('0x2c')][_0xac2f('0x23')](_0x17b12d)[_0xac2f('0x28')](function(_0x2898ec){_0x497525['count']=_0x2898ec;if(_0x2bcced[_0xac2f('0x31')][_0xac2f('0x41')]){_0x166cd4['include']=[{'all':!![]}];}return db[_0xac2f('0x2c')]['findAll'](_0x166cd4);})[_0xac2f('0x28')](function(_0x558121){_0x497525[_0xac2f('0x42')]=_0x558121;return _0x497525;})[_0xac2f('0x28')](respondWithFilteredResult(_0x3099a1,_0x166cd4))[_0xac2f('0x43')](handleError(_0x3099a1,null));};exports['show']=function(_0x28de91,_0x308f68){var _0x155daa={'raw':![],'where':{'id':_0x28de91[_0xac2f('0x44')]['id']}},_0x4ecb8f={};_0x4ecb8f[_0xac2f('0x33')]=_['keys'](db[_0xac2f('0x2c')][_0xac2f('0x2d')]);_0x4ecb8f[_0xac2f('0x31')]=_[_0xac2f('0x45')](_0x28de91[_0xac2f('0x31')]);_0x4ecb8f['filters']=_[_0xac2f('0x32')](_0x4ecb8f[_0xac2f('0x33')],_0x4ecb8f['query']);_0x155daa[_0xac2f('0x36')]=_[_0xac2f('0x32')](_0x4ecb8f['model'],qs[_0xac2f('0x34')](_0x28de91[_0xac2f('0x31')][_0xac2f('0x34')]));_0x155daa[_0xac2f('0x36')]=_0x155daa[_0xac2f('0x36')][_0xac2f('0x35')]?_0x155daa[_0xac2f('0x36')]:_0x4ecb8f[_0xac2f('0x33')];if(_0x28de91['query'][_0xac2f('0x41')]){_0x155daa[_0xac2f('0x46')]=[{'all':!![]}];}_0x155daa=_['merge']({},_0x155daa,_0x28de91[_0xac2f('0x40')]);return db[_0xac2f('0x2c')][_0xac2f('0x47')](_0x155daa)[_0xac2f('0x28')](handleEntityNotFound(_0x308f68,null))[_0xac2f('0x28')](respondWithResult(_0x308f68,null))[_0xac2f('0x43')](handleError(_0x308f68,null));};exports[_0xac2f('0x48')]=function(_0x45d2da,_0x28dd24){return db[_0xac2f('0x2c')][_0xac2f('0x48')](_0x45d2da[_0xac2f('0x49')],{})[_0xac2f('0x28')](respondWithResult(_0x28dd24,0xc9))[_0xac2f('0x43')](handleError(_0x28dd24,null));};exports[_0xac2f('0x4a')]=function(_0x3faacb,_0x20d37b){if(_0x3faacb[_0xac2f('0x49')]['id']){delete _0x3faacb[_0xac2f('0x49')]['id'];}return db['FreshsalesAccount'][_0xac2f('0x47')]({'where':{'id':_0x3faacb[_0xac2f('0x44')]['id']}})[_0xac2f('0x28')](handleEntityNotFound(_0x20d37b,null))[_0xac2f('0x28')](saveUpdates(_0x3faacb[_0xac2f('0x49')],null))[_0xac2f('0x28')](respondWithResult(_0x20d37b,null))[_0xac2f('0x43')](handleError(_0x20d37b,null));};exports[_0xac2f('0x29')]=function(_0x2c2789,_0x579beb){return db[_0xac2f('0x2c')][_0xac2f('0x47')]({'where':{'id':_0x2c2789[_0xac2f('0x44')]['id']}})[_0xac2f('0x28')](handleEntityNotFound(_0x579beb,null))['then'](removeEntity(_0x579beb,null))[_0xac2f('0x43')](handleError(_0x579beb,null));};exports[_0xac2f('0x4b')]=function(_0x193cca,_0x5add68,_0x446bb2){var _0x584a1e={};var _0x386a04={};var _0xe01ac;var _0xc0ea48;return db[_0xac2f('0x2c')]['findOne']({'where':{'id':_0x193cca[_0xac2f('0x44')]['id']}})[_0xac2f('0x28')](handleEntityNotFound(_0x5add68,null))[_0xac2f('0x28')](function(_0x5cd1fc){if(_0x5cd1fc){_0xe01ac=_0x5cd1fc;_0x386a04[_0xac2f('0x33')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x386a04['query']=_[_0xac2f('0x45')](_0x193cca[_0xac2f('0x31')]);_0x386a04[_0xac2f('0x3d')]=_['intersection'](_0x386a04[_0xac2f('0x33')],_0x386a04[_0xac2f('0x31')]);_0x584a1e[_0xac2f('0x36')]=_['intersection'](_0x386a04['model'],qs[_0xac2f('0x34')](_0x193cca[_0xac2f('0x31')][_0xac2f('0x34')]));_0x584a1e[_0xac2f('0x36')]=_0x584a1e['attributes'][_0xac2f('0x35')]?_0x584a1e['attributes']:_0x386a04['model'];_0x584a1e[_0xac2f('0x39')]=qs['sort'](_0x193cca[_0xac2f('0x31')][_0xac2f('0x3a')]);_0x584a1e['where']=qs[_0xac2f('0x3d')](_[_0xac2f('0x3c')](_0x193cca[_0xac2f('0x31')],_0x386a04[_0xac2f('0x3d')]));if(_0x193cca[_0xac2f('0x31')]['filter']){_0x584a1e[_0xac2f('0x3b')]=_[_0xac2f('0x4c')](_0x584a1e['where'],{'$or':_[_0xac2f('0x4d')](_0x584a1e[_0xac2f('0x36')],function(_0xbef209){var _0x24d583={};_0x24d583[_0xbef209]={'$like':'%'+_0x193cca['query'][_0xac2f('0x3e')]+'%'};return _0x24d583;})});}_0x584a1e=_['merge']({},_0x584a1e,_0x193cca[_0xac2f('0x40')]);return _0xe01ac[_0xac2f('0x4b')](_0x584a1e);}})[_0xac2f('0x28')](function(_0x4d29f3){if(_0x4d29f3){_0xc0ea48=_0x4d29f3[_0xac2f('0x35')];if(!_0x193cca[_0xac2f('0x31')][_0xac2f('0x37')](_0xac2f('0x38'))){_0x584a1e['limit']=qs['limit'](_0x193cca[_0xac2f('0x31')]['limit']);_0x584a1e[_0xac2f('0x20')]=qs[_0xac2f('0x20')](_0x193cca[_0xac2f('0x31')][_0xac2f('0x20')]);}return _0xe01ac[_0xac2f('0x4b')](_0x584a1e);}})[_0xac2f('0x28')](function(_0x37c03f){if(_0x37c03f){return _0x37c03f?{'count':_0xc0ea48,'rows':_0x37c03f}:null;}})[_0xac2f('0x28')](respondWithResult(_0x5add68,null))[_0xac2f('0x43')](handleError(_0x5add68,null));};exports[_0xac2f('0x4e')]=function(_0x41d6bb,_0xfd03ec,_0x450b0){if(_0x41d6bb[_0xac2f('0x49')]['id']){delete _0x41d6bb[_0xac2f('0x49')]['id'];}return db[_0xac2f('0x2c')][_0xac2f('0x4f')]({'where':{'id':_0x41d6bb[_0xac2f('0x44')]['id']}})[_0xac2f('0x28')](handleEntityNotFound(_0xfd03ec,null))[_0xac2f('0x28')](function(_0x5a101b){if(_0x5a101b){_0x41d6bb[_0xac2f('0x49')]['AccountId']=_0x5a101b['id'];_0x41d6bb[_0xac2f('0x49')]['Subjects']=integrations[_0xac2f('0x50')](_0x41d6bb['body'][_0xac2f('0x51')],_0x41d6bb['body']['type']);_0x41d6bb[_0xac2f('0x49')][_0xac2f('0x52')]=integrations['getDescriptions'](_0x41d6bb[_0xac2f('0x49')]['channel'],_0x41d6bb[_0xac2f('0x49')][_0xac2f('0x2f')]);return db[_0xac2f('0x53')]['create'](_0x41d6bb['body'],{'include':[{'model':db[_0xac2f('0x54')],'as':_0xac2f('0x55')},{'model':db[_0xac2f('0x54')],'as':_0xac2f('0x52')}]});}return null;})['then'](respondWithResult(_0xfd03ec,null))[_0xac2f('0x43')](handleError(_0xfd03ec,null));};exports[_0xac2f('0x56')]=function(_0x22ad88,_0x5888f1,_0x118851){var _0xa6069c='';var _0x21dee8='';return db[_0xac2f('0x2c')][_0xac2f('0x4f')]({'where':{'id':_0x22ad88[_0xac2f('0x44')]['id']},'attributes':['id',_0xac2f('0x57'),'remoteUri',_0xac2f('0x58')]})[_0xac2f('0x28')](handleEntityNotFound(_0x5888f1,null))[_0xac2f('0x28')](function(_0x534629){if(_0x534629){_0x21dee8=_0x534629[_0xac2f('0x57')];_0xa6069c=_0x534629['remoteUri'];var _0x3d0878=_0x534629[_0xac2f('0x59')][_0xac2f('0x5a')](-0x1);if(_0x3d0878==='/'){_0xa6069c=_0xa6069c['substring'](0x0,_0xa6069c[_0xac2f('0x5b')](_0x3d0878));}return rp({'method':'GET','uri':util['format'](_0xac2f('0x5c'),_0xa6069c,_0xac2f('0x5d')),'headers':{'Authorization':_0xac2f('0x5e')+_0x534629[_0xac2f('0x58')]},'json':!![]});}})[_0xac2f('0x28')](function(_0x1f49ca){if(_0x1f49ca){var _0x42db52=_0x1f49ca[_0xac2f('0x5f')];var _0xc67975=![];var _0x5b99b5=null;for(_0x5b99b5=0x0;_0x5b99b5<_0x42db52[_0xac2f('0x35')];_0x5b99b5++){if(_0x42db52[_0x5b99b5][_0xac2f('0x60')]===_0x21dee8){_0xc67975=!![];}}if(_0xc67975){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xac2f('0x61')});}}})[_0xac2f('0x28')](respondWithResult(_0x5888f1,null))[_0xac2f('0x43')](function(_0x213ceb){var _0x1ebcd4=_0x22ad88['query'][_0xac2f('0x62')]?0x1f4:_0x213ceb['statusCode']||0x1f4;logger[_0xac2f('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0xac2f('0x56'),_0x1ebcd4,JSON[_0xac2f('0x63')](_0x213ceb));delete _0x213ceb['name'];if(_0x1ebcd4===0x191){_0x1ebcd4=0x190;}_0x5888f1[_0xac2f('0x1d')](_0x1ebcd4)['send'](_0x22ad88[_0xac2f('0x31')][_0xac2f('0x62')]?{'message':_0xac2f('0x64'),'statusCode':_0x213ceb[_0xac2f('0x65')]}:_0x213ceb);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b65ce,_0x3726ce){var _0x3df39f=function(_0x23e272){while(--_0x23e272){_0x3b65ce['push'](_0x3b65ce['shift']());}};_0x3df39f(++_0x3726ce);}(_0x4745,0x1e7));var _0x5474=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x4745[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd943=['int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesAccount'];(function(_0x580916,_0x3ee315){var _0x3b9f57=function(_0xd53ba8){while(--_0xd53ba8){_0x580916['push'](_0x580916['shift']());}};_0x3b9f57(++_0x3ee315);}(_0xd943,0x15d));var _0x3d94=function(_0x4eb720,_0x1774c0){_0x4eb720=_0x4eb720-0x0;var _0x6f71b0=_0xd943[_0x4eb720];return _0x6f71b0;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3d94('0x9')]=function(_0x51cf1f,_0x54e81f){return _0x51cf1f['define'](_0x3d94('0xa'),attributes,{'tableName':_0x3d94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4137=['stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4ddd6f,_0x433c74){var _0x15fce3=function(_0x29330c){while(--_0x29330c){_0x4ddd6f['push'](_0x4ddd6f['shift']());}};_0x15fce3(++_0x433c74);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['FreshsalesAccount'][_0x7413('0x18')]({'raw':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1a')]===undefined?!![]:![]:!![],'where':_0x19157f['options']?_0x19157f[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1d')]||null:null,'include':_0x19157f['options']?_0x19157f['options'][_0x7413('0x1e')]?_['map'](_0x19157f[_0x7413('0x19')][_0x7413('0x1e')],function(_0x3b0c81){return{'model':db[_0x3b0c81[_0x7413('0x1f')]],'as':_0x3b0c81['as'],'attributes':_0x3b0c81[_0x7413('0x1c')],'include':_0x3b0c81[_0x7413('0x1e')]?_[_0x7413('0x20')](_0x3b0c81[_0x7413('0x1e')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x1e')]?_['map'](_0x1d455b[_0x7413('0x1e')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x1f')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7413('0x21')](function(_0x896552){logger[_0x7413('0xe')](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON['stringify'](_0x896552));_0x2a3417(_0x896552);})[_0x7413('0x22')](function(_0x4ed662){logger[_0x7413('0x13')](_0x7413('0x17'),_0x4ed662[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e[_0x7413('0x13')](0x1f4,_0x4ed662[_0x7413('0x16')]));});});};exports[_0x7413('0x23')]=function(_0x5bb3ea){var _0x1ffb6f=this;return new Promise(function(_0x17c342,_0x39db32){return db[_0x7413('0x24')][_0x7413('0x25')]({'raw':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['attributes']||null:null,'include':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea['options'][_0x7413('0x1e')]?_[_0x7413('0x20')](_0x5bb3ea[_0x7413('0x19')]['include'],function(_0xe6b096){return{'model':db[_0xe6b096['model']],'as':_0xe6b096['as'],'attributes':_0xe6b096[_0x7413('0x1c')],'include':_0xe6b096[_0x7413('0x1e')]?_['map'](_0xe6b096['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x1f')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x1c')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x1e')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ad12d){logger[_0x7413('0xe')](_0x7413('0x23'),_0x5bb3ea);logger[_0x7413('0x10')](_0x7413('0x23'),_0x5bb3ea,JSON['stringify'](_0x3ad12d));_0x17c342(_0x3ad12d);})[_0x7413('0x22')](function(_0x8dc047){logger[_0x7413('0x13')](_0x7413('0x23'),_0x8dc047[_0x7413('0x16')],_0x5bb3ea);_0x39db32(_0x1ffb6f[_0x7413('0x13')](0x1f4,_0x8dc047[_0x7413('0x16')]));});});};
\ No newline at end of file
+var _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x4fb22c,_0x3a67ef){_0x4fb22c=_0x4fb22c-0x0;var _0x819153=_0x0a6b[_0x4fb22c];return _0x819153;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x50e6=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x50e6,0xd6));var _0x650e=function(_0x2ebffa,_0x27f4ec){_0x2ebffa=_0x2ebffa-0x0;var _0xd49421=_0x50e6[_0x2ebffa];return _0xd49421;};'use strict';var multer=require(_0x650e('0x0'));var util=require(_0x650e('0x1'));var path=require(_0x650e('0x2'));var timeout=require(_0x650e('0x3'));var express=require(_0x650e('0x4'));var router=express[_0x650e('0x5')]();var fs_extra=require(_0x650e('0x6'));var auth=require(_0x650e('0x7'));var interaction=require(_0x650e('0x8'));var config=require(_0x650e('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x650e('0xa')]('/',auth[_0x650e('0xb')](),controller[_0x650e('0xc')]);router[_0x650e('0xa')](_0x650e('0xd'),auth['isAuthenticated'](),controller[_0x650e('0xe')]);router[_0x650e('0xa')](_0x650e('0xf'),auth[_0x650e('0xb')](),controller[_0x650e('0x10')]);router['get'](_0x650e('0x11'),auth[_0x650e('0xb')](),controller['getDescriptions']);router['get'](_0x650e('0x12'),auth[_0x650e('0xb')](),controller[_0x650e('0x13')]);router['post']('/',auth[_0x650e('0xb')](),controller[_0x650e('0x14')]);router[_0x650e('0x15')](_0x650e('0xd'),auth[_0x650e('0xb')](),controller['update']);router['delete'](_0x650e('0xd'),auth[_0x650e('0xb')](),controller[_0x650e('0x16')]);module[_0x650e('0x17')]=router;
\ No newline at end of file
+var _0x86cd=['getDescriptions','getFields','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x86cd,0x142));var _0xd86c=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x86cd[_0x4d40dd];return _0x1c51f2;};'use strict';var multer=require(_0xd86c('0x0'));var util=require('util');var path=require(_0xd86c('0x1'));var timeout=require(_0xd86c('0x2'));var express=require(_0xd86c('0x3'));var router=express[_0xd86c('0x4')]();var fs_extra=require(_0xd86c('0x5'));var auth=require(_0xd86c('0x6'));var interaction=require(_0xd86c('0x7'));var config=require(_0xd86c('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xd86c('0x9')]('/',auth[_0xd86c('0xa')](),controller[_0xd86c('0xb')]);router['get'](_0xd86c('0xc'),auth[_0xd86c('0xa')](),controller[_0xd86c('0xd')]);router['get']('/:id/subjects',auth[_0xd86c('0xa')](),controller['getSubjects']);router[_0xd86c('0x9')]('/:id/descriptions',auth[_0xd86c('0xa')](),controller[_0xd86c('0xe')]);router['get']('/:id/fields',auth[_0xd86c('0xa')](),controller[_0xd86c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd86c('0x10')](_0xd86c('0xc'),auth[_0xd86c('0xa')](),controller[_0xd86c('0x11')]);router[_0xd86c('0x12')](_0xd86c('0xc'),auth[_0xd86c('0xa')](),controller[_0xd86c('0x13')]);module[_0xd86c('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa89c=['exports','STRING','sequelize'];(function(_0xdb4e73,_0x30b446){var _0x4578b4=function(_0x119eb5){while(--_0x119eb5){_0xdb4e73['push'](_0xdb4e73['shift']());}};_0x4578b4(++_0x30b446);}(_0xa89c,0x74));var _0xca89=function(_0x311497,_0x51883d){_0x311497=_0x311497-0x0;var _0x39f937=_0xa89c[_0x311497];return _0x39f937;};'use strict';var Sequelize=require(_0xca89('0x0'));module[_0xca89('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca89('0x2')]}};
\ No newline at end of file
+var _0xe35e=['STRING','exports'];(function(_0x53e198,_0x4e0e84){var _0x3fae6f=function(_0x8e3943){while(--_0x8e3943){_0x53e198['push'](_0x53e198['shift']());}};_0x3fae6f(++_0x4e0e84);}(_0xe35e,0xa7));var _0xee35=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0xe35e[_0x5c1345];return _0x1c070d;};'use strict';var Sequelize=require('sequelize');module[_0xee35('0x0')]={'name':{'type':Sequelize[_0xee35('0x1')]},'description':{'type':Sequelize[_0xee35('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd5f2=['to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','end','sendStatus','error','name','FreshsalesConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','find','create','body','getSubjects','findOne','params','FreshsalesField','order','sort','options','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x1ee1d4,_0x425984){var _0x128ccc=function(_0x2e1efb){while(--_0x2e1efb){_0x1ee1d4['push'](_0x1ee1d4['shift']());}};_0x128ccc(++_0x425984);}(_0xd5f2,0x8a));var _0x2d5f=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xd5f2[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require(_0x2d5f('0x0'));var rimraf=require(_0x2d5f('0x1'));var zipdir=require(_0x2d5f('0x2'));var jsonpatch=require(_0x2d5f('0x3'));var rp=require(_0x2d5f('0x4'));var moment=require(_0x2d5f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2d5f('0x6'));var util=require(_0x2d5f('0x7'));var path=require(_0x2d5f('0x8'));var sox=require(_0x2d5f('0x9'));var csv=require(_0x2d5f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d5f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2d5f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2d5f('0xe'));var Papa=require(_0x2d5f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d5f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d5f('0x11'))(_0x2d5f('0x12'));var utils=require(_0x2d5f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d5f('0x14'))['db'];function respondWithStatusCode(_0xcc3ddf,_0x5a1e0e){_0x5a1e0e=_0x5a1e0e||0xcc;return function(_0x84e51d){if(_0x84e51d){return _0xcc3ddf['sendStatus'](_0x5a1e0e);}return _0xcc3ddf['status'](_0x5a1e0e)['end']();};}function respondWithResult(_0x20bce3,_0x42e59b){_0x42e59b=_0x42e59b||0xc8;return function(_0x4370a0){if(_0x4370a0){return _0x20bce3[_0x2d5f('0x15')](_0x42e59b)['json'](_0x4370a0);}};}function respondWithFilteredResult(_0x420111,_0x4cfa64){return function(_0x214fab){if(_0x214fab){var _0x215da9=typeof _0x4cfa64[_0x2d5f('0x16')]===_0x2d5f('0x17')&&typeof _0x4cfa64[_0x2d5f('0x18')]===_0x2d5f('0x17');var _0x476815=_0x214fab[_0x2d5f('0x19')];var _0x2bc66b=_0x215da9?0x0:_0x4cfa64[_0x2d5f('0x16')];var _0x4c6492=_0x215da9?_0x214fab[_0x2d5f('0x19')]:_0x4cfa64[_0x2d5f('0x16')]+_0x4cfa64['limit'];var _0x534080;if(_0x4c6492>=_0x476815){_0x4c6492=_0x476815;_0x534080=0xc8;}else{_0x534080=0xce;}_0x420111[_0x2d5f('0x15')](_0x534080);return _0x420111[_0x2d5f('0x1a')](_0x2d5f('0x1b'),_0x2bc66b+'-'+_0x4c6492+'/'+_0x476815)[_0x2d5f('0x1c')](_0x214fab);}return null;};}function patchUpdates(_0x285424){return function(_0x58f623){try{jsonpatch[_0x2d5f('0x1d')](_0x58f623,_0x285424,!![]);}catch(_0x20591d){return BPromise['reject'](_0x20591d);}return _0x58f623['save']();};}function saveUpdates(_0x45e64a,_0x54294b){return function(_0x467897){if(_0x467897){return _0x467897[_0x2d5f('0x1e')](_0x45e64a)[_0x2d5f('0x1f')](function(_0x562f3b){return _0x562f3b;});}return null;};}function removeEntity(_0x1f600f,_0x50e417){return function(_0x4cac4f){if(_0x4cac4f){return _0x4cac4f[_0x2d5f('0x20')]()['then'](function(){_0x1f600f[_0x2d5f('0x15')](0xcc)[_0x2d5f('0x21')]();});}};}function handleEntityNotFound(_0x36eb0e,_0x3c1ead){return function(_0x2f2f8f){if(!_0x2f2f8f){_0x36eb0e[_0x2d5f('0x22')](0x194);}return _0x2f2f8f;};}function handleError(_0x4e437d,_0x15e192){_0x15e192=_0x15e192||0x1f4;return function(_0x5d0630){logger[_0x2d5f('0x23')](_0x5d0630['stack']);if(_0x5d0630[_0x2d5f('0x24')]){delete _0x5d0630['name'];}_0x4e437d[_0x2d5f('0x15')](_0x15e192)['send'](_0x5d0630);};}exports['index']=function(_0x2acce0,_0x25c29b){var _0x264bd4={},_0x5739e7={},_0x58576e={'count':0x0,'rows':[]};var _0x256066=_['map'](db[_0x2d5f('0x25')][_0x2d5f('0x26')],function(_0x3b4932){return{'name':_0x3b4932[_0x2d5f('0x27')],'type':_0x3b4932[_0x2d5f('0x28')]['key']};});_0x5739e7[_0x2d5f('0x29')]=_[_0x2d5f('0x2a')](_0x256066,_0x2d5f('0x24'));_0x5739e7[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x2acce0[_0x2d5f('0x2b')]);_0x5739e7[_0x2d5f('0x2d')]=_[_0x2d5f('0x2e')](_0x5739e7[_0x2d5f('0x29')],_0x5739e7['query']);_0x264bd4['attributes']=_[_0x2d5f('0x2e')](_0x5739e7[_0x2d5f('0x29')],qs[_0x2d5f('0x2f')](_0x2acce0[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x264bd4['attributes']=_0x264bd4['attributes'][_0x2d5f('0x30')]?_0x264bd4[_0x2d5f('0x31')]:_0x5739e7[_0x2d5f('0x29')];if(!_0x2acce0['query'][_0x2d5f('0x32')](_0x2d5f('0x33'))){_0x264bd4[_0x2d5f('0x18')]=qs[_0x2d5f('0x18')](_0x2acce0[_0x2d5f('0x2b')]['limit']);_0x264bd4[_0x2d5f('0x16')]=qs['offset'](_0x2acce0[_0x2d5f('0x2b')]['offset']);}_0x264bd4['order']=qs['sort'](_0x2acce0[_0x2d5f('0x2b')]['sort']);_0x264bd4['where']=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x2acce0[_0x2d5f('0x2b')],_0x5739e7[_0x2d5f('0x2d')]),_0x256066);if(_0x2acce0['query'][_0x2d5f('0x35')]){_0x264bd4[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x264bd4['where'],{'$or':_[_0x2d5f('0x2a')](_0x256066,function(_0x5abb1e){if(_0x5abb1e[_0x2d5f('0x28')]!==_0x2d5f('0x38')){var _0x2cabff={};_0x2cabff[_0x5abb1e[_0x2d5f('0x24')]]={'$like':'%'+_0x2acce0[_0x2d5f('0x2b')][_0x2d5f('0x35')]+'%'};return _0x2cabff;}})});}_0x264bd4=_[_0x2d5f('0x37')]({},_0x264bd4,_0x2acce0['options']);var _0x41858f={'where':_0x264bd4[_0x2d5f('0x36')]};return db[_0x2d5f('0x25')][_0x2d5f('0x19')](_0x41858f)['then'](function(_0x30b2e1){_0x58576e[_0x2d5f('0x19')]=_0x30b2e1;if(_0x2acce0['query'][_0x2d5f('0x39')]){_0x264bd4[_0x2d5f('0x3a')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x2d5f('0x3b')](_0x264bd4);})[_0x2d5f('0x1f')](function(_0xe2c083){_0x58576e[_0x2d5f('0x3c')]=_0xe2c083;return _0x58576e;})[_0x2d5f('0x1f')](respondWithFilteredResult(_0x25c29b,_0x264bd4))[_0x2d5f('0x3d')](handleError(_0x25c29b,null));};exports['show']=function(_0x533e66,_0x3adac2){var _0x26e400={'raw':![],'where':{'id':_0x533e66['params']['id']}},_0x596bd5={};_0x596bd5[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x25')][_0x2d5f('0x26')]);_0x596bd5[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x533e66[_0x2d5f('0x2b')]);_0x596bd5[_0x2d5f('0x2d')]=_[_0x2d5f('0x2e')](_0x596bd5[_0x2d5f('0x29')],_0x596bd5[_0x2d5f('0x2b')]);_0x26e400['attributes']=_[_0x2d5f('0x2e')](_0x596bd5[_0x2d5f('0x29')],qs['fields'](_0x533e66[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x26e400['attributes']=_0x26e400[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x26e400[_0x2d5f('0x31')]:_0x596bd5[_0x2d5f('0x29')];if(_0x533e66[_0x2d5f('0x2b')][_0x2d5f('0x39')]){_0x26e400[_0x2d5f('0x3a')]=[{'all':!![]}];}_0x26e400=_[_0x2d5f('0x37')]({},_0x26e400,_0x533e66['options']);return db[_0x2d5f('0x25')][_0x2d5f('0x3e')](_0x26e400)['then'](handleEntityNotFound(_0x3adac2,null))[_0x2d5f('0x1f')](respondWithResult(_0x3adac2,null))['catch'](handleError(_0x3adac2,null));};exports[_0x2d5f('0x3f')]=function(_0x258472,_0x41f5b2){return db[_0x2d5f('0x25')][_0x2d5f('0x3f')](_0x258472['body'],{})['then'](respondWithResult(_0x41f5b2,0xc9))['catch'](handleError(_0x41f5b2,null));};exports[_0x2d5f('0x1e')]=function(_0x3a0276,_0x135c48){if(_0x3a0276['body']['id']){delete _0x3a0276[_0x2d5f('0x40')]['id'];}return db[_0x2d5f('0x25')][_0x2d5f('0x3e')]({'where':{'id':_0x3a0276['params']['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x135c48,null))[_0x2d5f('0x1f')](saveUpdates(_0x3a0276[_0x2d5f('0x40')],null))['then'](respondWithResult(_0x135c48,null))[_0x2d5f('0x3d')](handleError(_0x135c48,null));};exports[_0x2d5f('0x20')]=function(_0x1b61e5,_0x4c0613){return db['FreshsalesConfiguration'][_0x2d5f('0x3e')]({'where':{'id':_0x1b61e5['params']['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x4c0613,null))[_0x2d5f('0x1f')](removeEntity(_0x4c0613,null))[_0x2d5f('0x3d')](handleError(_0x4c0613,null));};exports[_0x2d5f('0x41')]=function(_0x582afb,_0x3e68c8,_0xbc646a){var _0x394403={};var _0x24102c={};var _0x15d5c8;var _0x3d77b1;return db[_0x2d5f('0x25')][_0x2d5f('0x42')]({'where':{'id':_0x582afb[_0x2d5f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e68c8,null))[_0x2d5f('0x1f')](function(_0x481638){if(_0x481638){_0x15d5c8=_0x481638;_0x24102c[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x44')][_0x2d5f('0x26')]);_0x24102c[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x582afb[_0x2d5f('0x2b')]);_0x24102c['filters']=_[_0x2d5f('0x2e')](_0x24102c[_0x2d5f('0x29')],_0x24102c['query']);_0x394403[_0x2d5f('0x31')]=_[_0x2d5f('0x2e')](_0x24102c[_0x2d5f('0x29')],qs[_0x2d5f('0x2f')](_0x582afb[_0x2d5f('0x2b')]['fields']));_0x394403[_0x2d5f('0x31')]=_0x394403[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x394403['attributes']:_0x24102c[_0x2d5f('0x29')];_0x394403[_0x2d5f('0x45')]=qs[_0x2d5f('0x46')](_0x582afb[_0x2d5f('0x2b')][_0x2d5f('0x46')]);_0x394403['where']=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x582afb['query'],_0x24102c[_0x2d5f('0x2d')]));if(_0x582afb[_0x2d5f('0x2b')]['filter']){_0x394403[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x394403[_0x2d5f('0x36')],{'$or':_[_0x2d5f('0x2a')](_0x394403[_0x2d5f('0x31')],function(_0xaa11d4){var _0x4b14b5={};_0x4b14b5[_0xaa11d4]={'$like':'%'+_0x582afb[_0x2d5f('0x2b')]['filter']+'%'};return _0x4b14b5;})});}_0x394403=_['merge']({},_0x394403,_0x582afb[_0x2d5f('0x47')]);return _0x15d5c8[_0x2d5f('0x41')](_0x394403);}})[_0x2d5f('0x1f')](function(_0x584526){if(_0x584526){_0x3d77b1=_0x584526['length'];if(!_0x582afb[_0x2d5f('0x2b')][_0x2d5f('0x32')]('nolimit')){_0x394403[_0x2d5f('0x18')]=qs['limit'](_0x582afb['query']['limit']);_0x394403[_0x2d5f('0x16')]=qs[_0x2d5f('0x16')](_0x582afb[_0x2d5f('0x2b')][_0x2d5f('0x16')]);}return _0x15d5c8[_0x2d5f('0x41')](_0x394403);}})[_0x2d5f('0x1f')](function(_0x292ed6){if(_0x292ed6){return _0x292ed6?{'count':_0x3d77b1,'rows':_0x292ed6}:null;}})['then'](respondWithResult(_0x3e68c8,null))[_0x2d5f('0x3d')](handleError(_0x3e68c8,null));};exports[_0x2d5f('0x48')]=function(_0x4c1543,_0x1cfc9c,_0x1428b0){var _0x4067d0={};var _0x199ad6={};var _0x7c0551;var _0x5dda6a;return db[_0x2d5f('0x25')]['findOne']({'where':{'id':_0x4c1543[_0x2d5f('0x43')]['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x1cfc9c,null))[_0x2d5f('0x1f')](function(_0x170500){if(_0x170500){_0x7c0551=_0x170500;_0x199ad6[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x44')][_0x2d5f('0x26')]);_0x199ad6[_0x2d5f('0x2b')]=_[_0x2d5f('0x2c')](_0x4c1543[_0x2d5f('0x2b')]);_0x199ad6[_0x2d5f('0x2d')]=_[_0x2d5f('0x2e')](_0x199ad6['model'],_0x199ad6[_0x2d5f('0x2b')]);_0x4067d0[_0x2d5f('0x31')]=_[_0x2d5f('0x2e')](_0x199ad6[_0x2d5f('0x29')],qs['fields'](_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x4067d0[_0x2d5f('0x31')]=_0x4067d0[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x4067d0[_0x2d5f('0x31')]:_0x199ad6[_0x2d5f('0x29')];_0x4067d0[_0x2d5f('0x45')]=qs[_0x2d5f('0x46')](_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x46')]);_0x4067d0['where']=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x4c1543[_0x2d5f('0x2b')],_0x199ad6[_0x2d5f('0x2d')]));if(_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x35')]){_0x4067d0[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x4067d0[_0x2d5f('0x36')],{'$or':_[_0x2d5f('0x2a')](_0x4067d0[_0x2d5f('0x31')],function(_0x3e6400){var _0x2b495e={};_0x2b495e[_0x3e6400]={'$like':'%'+_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x35')]+'%'};return _0x2b495e;})});}_0x4067d0=_[_0x2d5f('0x37')]({},_0x4067d0,_0x4c1543[_0x2d5f('0x47')]);return _0x7c0551[_0x2d5f('0x48')](_0x4067d0);}})[_0x2d5f('0x1f')](function(_0x223ee1){if(_0x223ee1){_0x5dda6a=_0x223ee1[_0x2d5f('0x30')];if(!_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x32')]('nolimit')){_0x4067d0[_0x2d5f('0x18')]=qs[_0x2d5f('0x18')](_0x4c1543[_0x2d5f('0x2b')][_0x2d5f('0x18')]);_0x4067d0[_0x2d5f('0x16')]=qs[_0x2d5f('0x16')](_0x4c1543['query'][_0x2d5f('0x16')]);}return _0x7c0551['getDescriptions'](_0x4067d0);}})[_0x2d5f('0x1f')](function(_0x4f4b5f){if(_0x4f4b5f){return _0x4f4b5f?{'count':_0x5dda6a,'rows':_0x4f4b5f}:null;}})[_0x2d5f('0x1f')](respondWithResult(_0x1cfc9c,null))['catch'](handleError(_0x1cfc9c,null));};exports[_0x2d5f('0x49')]=function(_0x4a846a,_0x274aae,_0x304c10){var _0x350b40={};var _0x59ac59={};var _0x501a43;var _0x1e7cc5;return db['FreshsalesConfiguration'][_0x2d5f('0x42')]({'where':{'id':_0x4a846a[_0x2d5f('0x43')]['id']}})[_0x2d5f('0x1f')](handleEntityNotFound(_0x274aae,null))['then'](function(_0x45ff34){if(_0x45ff34){_0x501a43=_0x45ff34;_0x59ac59[_0x2d5f('0x29')]=_[_0x2d5f('0x2c')](db[_0x2d5f('0x44')]['rawAttributes']);_0x59ac59['query']=_['keys'](_0x4a846a['query']);_0x59ac59[_0x2d5f('0x2d')]=_['intersection'](_0x59ac59[_0x2d5f('0x29')],_0x59ac59['query']);_0x350b40[_0x2d5f('0x31')]=_['intersection'](_0x59ac59[_0x2d5f('0x29')],qs[_0x2d5f('0x2f')](_0x4a846a[_0x2d5f('0x2b')][_0x2d5f('0x2f')]));_0x350b40['attributes']=_0x350b40[_0x2d5f('0x31')][_0x2d5f('0x30')]?_0x350b40[_0x2d5f('0x31')]:_0x59ac59[_0x2d5f('0x29')];_0x350b40[_0x2d5f('0x45')]=qs[_0x2d5f('0x46')](_0x4a846a[_0x2d5f('0x2b')]['sort']);_0x350b40[_0x2d5f('0x36')]=qs[_0x2d5f('0x2d')](_[_0x2d5f('0x34')](_0x4a846a[_0x2d5f('0x2b')],_0x59ac59['filters']));if(_0x4a846a['query']['filter']){_0x350b40[_0x2d5f('0x36')]=_[_0x2d5f('0x37')](_0x350b40[_0x2d5f('0x36')],{'$or':_[_0x2d5f('0x2a')](_0x350b40[_0x2d5f('0x31')],function(_0x749345){var _0xf7e225={};_0xf7e225[_0x749345]={'$like':'%'+_0x4a846a[_0x2d5f('0x2b')]['filter']+'%'};return _0xf7e225;})});}_0x350b40=_[_0x2d5f('0x37')]({},_0x350b40,_0x4a846a['options']);return _0x501a43[_0x2d5f('0x49')](_0x350b40);}})[_0x2d5f('0x1f')](function(_0x2131d2){if(_0x2131d2){_0x1e7cc5=_0x2131d2[_0x2d5f('0x30')];if(!_0x4a846a[_0x2d5f('0x2b')][_0x2d5f('0x32')](_0x2d5f('0x33'))){_0x350b40[_0x2d5f('0x18')]=qs[_0x2d5f('0x18')](_0x4a846a['query']['limit']);_0x350b40[_0x2d5f('0x16')]=qs[_0x2d5f('0x16')](_0x4a846a[_0x2d5f('0x2b')]['offset']);}return _0x501a43[_0x2d5f('0x49')](_0x350b40);}})['then'](function(_0x218140){if(_0x218140){return _0x218140?{'count':_0x1e7cc5,'rows':_0x218140}:null;}})[_0x2d5f('0x1f')](respondWithResult(_0x274aae,null))['catch'](handleError(_0x274aae,null));};
\ No newline at end of file
+var _0x96e0=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0xec3602,_0xb723b){var _0x26378f=function(_0x18411a){while(--_0x18411a){_0xec3602['push'](_0xec3602['shift']());}};_0x26378f(++_0xb723b);}(_0x96e0,0x132));var _0x096e=function(_0x3f9c75,_0xadc141){_0x3f9c75=_0x3f9c75-0x0;var _0x38bbc1=_0x96e0[_0x3f9c75];return _0x38bbc1;};'use strict';var emlformat=require(_0x096e('0x0'));var rimraf=require(_0x096e('0x1'));var zipdir=require(_0x096e('0x2'));var jsonpatch=require(_0x096e('0x3'));var rp=require(_0x096e('0x4'));var moment=require(_0x096e('0x5'));var BPromise=require(_0x096e('0x6'));var Mustache=require(_0x096e('0x7'));var util=require('util');var path=require(_0x096e('0x8'));var sox=require('sox');var csv=require(_0x096e('0x9'));var ejs=require(_0x096e('0xa'));var fs=require('fs');var fs_extra=require(_0x096e('0xb'));var _=require(_0x096e('0xc'));var squel=require(_0x096e('0xd'));var crypto=require(_0x096e('0xe'));var jsforce=require(_0x096e('0xf'));var deskjs=require(_0x096e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x096e('0x11'));var Papa=require(_0x096e('0x12'));var Redis=require('ioredis');var authService=require(_0x096e('0x13'));var qs=require(_0x096e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x096e('0x15'))('api');var utils=require(_0x096e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x096e('0x17'));var db=require(_0x096e('0x18'))['db'];function respondWithStatusCode(_0x5315a5,_0x23a250){_0x23a250=_0x23a250||0xcc;return function(_0x22985c){if(_0x22985c){return _0x5315a5['sendStatus'](_0x23a250);}return _0x5315a5[_0x096e('0x19')](_0x23a250)[_0x096e('0x1a')]();};}function respondWithResult(_0x8243f2,_0x3eb6b9){_0x3eb6b9=_0x3eb6b9||0xc8;return function(_0x26832c){if(_0x26832c){return _0x8243f2['status'](_0x3eb6b9)[_0x096e('0x1b')](_0x26832c);}};}function respondWithFilteredResult(_0x1c4629,_0xd5606c){return function(_0x11ef91){if(_0x11ef91){var _0x53b342=typeof _0xd5606c['offset']===_0x096e('0x1c')&&typeof _0xd5606c[_0x096e('0x1d')]==='undefined';var _0x243bad=_0x11ef91[_0x096e('0x1e')];var _0x20625c=_0x53b342?0x0:_0xd5606c[_0x096e('0x1f')];var _0x3466a2=_0x53b342?_0x11ef91['count']:_0xd5606c[_0x096e('0x1f')]+_0xd5606c[_0x096e('0x1d')];var _0x386f34;if(_0x3466a2>=_0x243bad){_0x3466a2=_0x243bad;_0x386f34=0xc8;}else{_0x386f34=0xce;}_0x1c4629[_0x096e('0x19')](_0x386f34);return _0x1c4629[_0x096e('0x20')](_0x096e('0x21'),_0x20625c+'-'+_0x3466a2+'/'+_0x243bad)[_0x096e('0x1b')](_0x11ef91);}return null;};}function patchUpdates(_0x544d80){return function(_0x3f4f83){try{jsonpatch[_0x096e('0x22')](_0x3f4f83,_0x544d80,!![]);}catch(_0x14a29a){return BPromise[_0x096e('0x23')](_0x14a29a);}return _0x3f4f83[_0x096e('0x24')]();};}function saveUpdates(_0x33d433,_0x534c30){return function(_0x32ad15){if(_0x32ad15){return _0x32ad15[_0x096e('0x25')](_0x33d433)[_0x096e('0x26')](function(_0x4cc866){return _0x4cc866;});}return null;};}function removeEntity(_0x1be89d,_0x427474){return function(_0x392b51){if(_0x392b51){return _0x392b51['destroy']()['then'](function(){_0x1be89d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d6ac,_0x523af4){return function(_0x144aec){if(!_0x144aec){_0x26d6ac[_0x096e('0x27')](0x194);}return _0x144aec;};}function handleError(_0x4019c8,_0x1aaa36){_0x1aaa36=_0x1aaa36||0x1f4;return function(_0xe92f2a){logger[_0x096e('0x28')](_0xe92f2a[_0x096e('0x29')]);if(_0xe92f2a[_0x096e('0x2a')]){delete _0xe92f2a[_0x096e('0x2a')];}_0x4019c8[_0x096e('0x19')](_0x1aaa36)['send'](_0xe92f2a);};}exports[_0x096e('0x2b')]=function(_0x59e457,_0x839879){var _0x2d6b21={},_0x365619={},_0x25d5bd={'count':0x0,'rows':[]};var _0x285573=_[_0x096e('0x2c')](db['FreshsalesConfiguration'][_0x096e('0x2d')],function(_0x2eb59c){return{'name':_0x2eb59c[_0x096e('0x2e')],'type':_0x2eb59c['type'][_0x096e('0x2f')]};});_0x365619[_0x096e('0x30')]=_['map'](_0x285573,_0x096e('0x2a'));_0x365619['query']=_[_0x096e('0x31')](_0x59e457[_0x096e('0x32')]);_0x365619[_0x096e('0x33')]=_['intersection'](_0x365619[_0x096e('0x30')],_0x365619[_0x096e('0x32')]);_0x2d6b21['attributes']=_[_0x096e('0x34')](_0x365619[_0x096e('0x30')],qs[_0x096e('0x35')](_0x59e457[_0x096e('0x32')][_0x096e('0x35')]));_0x2d6b21[_0x096e('0x36')]=_0x2d6b21[_0x096e('0x36')]['length']?_0x2d6b21['attributes']:_0x365619['model'];if(!_0x59e457[_0x096e('0x32')][_0x096e('0x37')](_0x096e('0x38'))){_0x2d6b21[_0x096e('0x1d')]=qs[_0x096e('0x1d')](_0x59e457['query'][_0x096e('0x1d')]);_0x2d6b21['offset']=qs[_0x096e('0x1f')](_0x59e457[_0x096e('0x32')][_0x096e('0x1f')]);}_0x2d6b21[_0x096e('0x39')]=qs[_0x096e('0x3a')](_0x59e457['query']['sort']);_0x2d6b21[_0x096e('0x3b')]=qs['filters'](_['pick'](_0x59e457['query'],_0x365619[_0x096e('0x33')]),_0x285573);if(_0x59e457[_0x096e('0x32')][_0x096e('0x3c')]){_0x2d6b21[_0x096e('0x3b')]=_[_0x096e('0x3d')](_0x2d6b21[_0x096e('0x3b')],{'$or':_[_0x096e('0x2c')](_0x285573,function(_0x5e3e3a){if(_0x5e3e3a['type']!==_0x096e('0x3e')){var _0x432803={};_0x432803[_0x5e3e3a[_0x096e('0x2a')]]={'$like':'%'+_0x59e457['query']['filter']+'%'};return _0x432803;}})});}_0x2d6b21=_[_0x096e('0x3d')]({},_0x2d6b21,_0x59e457[_0x096e('0x3f')]);var _0x344ff5={'where':_0x2d6b21[_0x096e('0x3b')]};return db[_0x096e('0x40')]['count'](_0x344ff5)['then'](function(_0x279a26){_0x25d5bd['count']=_0x279a26;if(_0x59e457[_0x096e('0x32')]['includeAll']){_0x2d6b21[_0x096e('0x41')]=[{'all':!![]}];}return db[_0x096e('0x40')][_0x096e('0x42')](_0x2d6b21);})[_0x096e('0x26')](function(_0x5b9aa5){_0x25d5bd[_0x096e('0x43')]=_0x5b9aa5;return _0x25d5bd;})[_0x096e('0x26')](respondWithFilteredResult(_0x839879,_0x2d6b21))[_0x096e('0x44')](handleError(_0x839879,null));};exports[_0x096e('0x45')]=function(_0x1ac65f,_0x504dd3){var _0x57620d={'raw':![],'where':{'id':_0x1ac65f[_0x096e('0x46')]['id']}},_0x5ec758={};_0x5ec758[_0x096e('0x30')]=_[_0x096e('0x31')](db[_0x096e('0x40')][_0x096e('0x2d')]);_0x5ec758['query']=_[_0x096e('0x31')](_0x1ac65f[_0x096e('0x32')]);_0x5ec758[_0x096e('0x33')]=_[_0x096e('0x34')](_0x5ec758[_0x096e('0x30')],_0x5ec758[_0x096e('0x32')]);_0x57620d[_0x096e('0x36')]=_[_0x096e('0x34')](_0x5ec758[_0x096e('0x30')],qs[_0x096e('0x35')](_0x1ac65f[_0x096e('0x32')]['fields']));_0x57620d[_0x096e('0x36')]=_0x57620d[_0x096e('0x36')][_0x096e('0x47')]?_0x57620d[_0x096e('0x36')]:_0x5ec758['model'];if(_0x1ac65f[_0x096e('0x32')][_0x096e('0x48')]){_0x57620d[_0x096e('0x41')]=[{'all':!![]}];}_0x57620d=_[_0x096e('0x3d')]({},_0x57620d,_0x1ac65f[_0x096e('0x3f')]);return db[_0x096e('0x40')][_0x096e('0x49')](_0x57620d)[_0x096e('0x26')](handleEntityNotFound(_0x504dd3,null))[_0x096e('0x26')](respondWithResult(_0x504dd3,null))[_0x096e('0x44')](handleError(_0x504dd3,null));};exports[_0x096e('0x4a')]=function(_0xdaa2ab,_0x51b1d0){return db['FreshsalesConfiguration'][_0x096e('0x4a')](_0xdaa2ab[_0x096e('0x4b')],{})[_0x096e('0x26')](respondWithResult(_0x51b1d0,0xc9))['catch'](handleError(_0x51b1d0,null));};exports['update']=function(_0x36f19a,_0x110f4){if(_0x36f19a[_0x096e('0x4b')]['id']){delete _0x36f19a['body']['id'];}return db[_0x096e('0x40')]['find']({'where':{'id':_0x36f19a[_0x096e('0x46')]['id']}})[_0x096e('0x26')](handleEntityNotFound(_0x110f4,null))['then'](saveUpdates(_0x36f19a['body'],null))[_0x096e('0x26')](respondWithResult(_0x110f4,null))[_0x096e('0x44')](handleError(_0x110f4,null));};exports[_0x096e('0x4c')]=function(_0x5b327d,_0x373214){return db[_0x096e('0x40')]['find']({'where':{'id':_0x5b327d[_0x096e('0x46')]['id']}})[_0x096e('0x26')](handleEntityNotFound(_0x373214,null))[_0x096e('0x26')](removeEntity(_0x373214,null))['catch'](handleError(_0x373214,null));};exports[_0x096e('0x4d')]=function(_0x244057,_0x161dc6,_0x29ebcd){var _0x20af26={};var _0x5c4050={};var _0x326ae4;var _0x35c3ad;return db[_0x096e('0x40')][_0x096e('0x4e')]({'where':{'id':_0x244057[_0x096e('0x46')]['id']}})['then'](handleEntityNotFound(_0x161dc6,null))['then'](function(_0x42e6bc){if(_0x42e6bc){_0x326ae4=_0x42e6bc;_0x5c4050['model']=_[_0x096e('0x31')](db[_0x096e('0x4f')][_0x096e('0x2d')]);_0x5c4050[_0x096e('0x32')]=_[_0x096e('0x31')](_0x244057['query']);_0x5c4050[_0x096e('0x33')]=_['intersection'](_0x5c4050['model'],_0x5c4050['query']);_0x20af26[_0x096e('0x36')]=_[_0x096e('0x34')](_0x5c4050['model'],qs[_0x096e('0x35')](_0x244057[_0x096e('0x32')][_0x096e('0x35')]));_0x20af26['attributes']=_0x20af26[_0x096e('0x36')][_0x096e('0x47')]?_0x20af26[_0x096e('0x36')]:_0x5c4050[_0x096e('0x30')];_0x20af26[_0x096e('0x39')]=qs[_0x096e('0x3a')](_0x244057[_0x096e('0x32')][_0x096e('0x3a')]);_0x20af26[_0x096e('0x3b')]=qs[_0x096e('0x33')](_[_0x096e('0x50')](_0x244057[_0x096e('0x32')],_0x5c4050['filters']));if(_0x244057[_0x096e('0x32')]['filter']){_0x20af26[_0x096e('0x3b')]=_['merge'](_0x20af26['where'],{'$or':_[_0x096e('0x2c')](_0x20af26[_0x096e('0x36')],function(_0x24ce93){var _0x22d268={};_0x22d268[_0x24ce93]={'$like':'%'+_0x244057[_0x096e('0x32')][_0x096e('0x3c')]+'%'};return _0x22d268;})});}_0x20af26=_['merge']({},_0x20af26,_0x244057[_0x096e('0x3f')]);return _0x326ae4['getSubjects'](_0x20af26);}})[_0x096e('0x26')](function(_0x16f287){if(_0x16f287){_0x35c3ad=_0x16f287[_0x096e('0x47')];if(!_0x244057['query']['hasOwnProperty']('nolimit')){_0x20af26[_0x096e('0x1d')]=qs['limit'](_0x244057[_0x096e('0x32')][_0x096e('0x1d')]);_0x20af26[_0x096e('0x1f')]=qs['offset'](_0x244057[_0x096e('0x32')][_0x096e('0x1f')]);}return _0x326ae4['getSubjects'](_0x20af26);}})['then'](function(_0x40a76d){if(_0x40a76d){return _0x40a76d?{'count':_0x35c3ad,'rows':_0x40a76d}:null;}})[_0x096e('0x26')](respondWithResult(_0x161dc6,null))['catch'](handleError(_0x161dc6,null));};exports[_0x096e('0x51')]=function(_0x41f69a,_0x227dde,_0x1f31a3){var _0x36e31f={};var _0x4c50b5={};var _0x3c7bb9;var _0x4e839f;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x41f69a[_0x096e('0x46')]['id']}})[_0x096e('0x26')](handleEntityNotFound(_0x227dde,null))[_0x096e('0x26')](function(_0x1ae257){if(_0x1ae257){_0x3c7bb9=_0x1ae257;_0x4c50b5[_0x096e('0x30')]=_['keys'](db[_0x096e('0x4f')][_0x096e('0x2d')]);_0x4c50b5[_0x096e('0x32')]=_['keys'](_0x41f69a[_0x096e('0x32')]);_0x4c50b5[_0x096e('0x33')]=_[_0x096e('0x34')](_0x4c50b5[_0x096e('0x30')],_0x4c50b5[_0x096e('0x32')]);_0x36e31f[_0x096e('0x36')]=_['intersection'](_0x4c50b5['model'],qs[_0x096e('0x35')](_0x41f69a[_0x096e('0x32')][_0x096e('0x35')]));_0x36e31f['attributes']=_0x36e31f[_0x096e('0x36')][_0x096e('0x47')]?_0x36e31f['attributes']:_0x4c50b5['model'];_0x36e31f['order']=qs[_0x096e('0x3a')](_0x41f69a[_0x096e('0x32')][_0x096e('0x3a')]);_0x36e31f['where']=qs['filters'](_[_0x096e('0x50')](_0x41f69a[_0x096e('0x32')],_0x4c50b5[_0x096e('0x33')]));if(_0x41f69a[_0x096e('0x32')][_0x096e('0x3c')]){_0x36e31f[_0x096e('0x3b')]=_[_0x096e('0x3d')](_0x36e31f[_0x096e('0x3b')],{'$or':_[_0x096e('0x2c')](_0x36e31f[_0x096e('0x36')],function(_0x37a695){var _0x2c6246={};_0x2c6246[_0x37a695]={'$like':'%'+_0x41f69a[_0x096e('0x32')]['filter']+'%'};return _0x2c6246;})});}_0x36e31f=_['merge']({},_0x36e31f,_0x41f69a[_0x096e('0x3f')]);return _0x3c7bb9[_0x096e('0x51')](_0x36e31f);}})[_0x096e('0x26')](function(_0x3f687d){if(_0x3f687d){_0x4e839f=_0x3f687d['length'];if(!_0x41f69a['query'][_0x096e('0x37')](_0x096e('0x38'))){_0x36e31f[_0x096e('0x1d')]=qs[_0x096e('0x1d')](_0x41f69a[_0x096e('0x32')][_0x096e('0x1d')]);_0x36e31f[_0x096e('0x1f')]=qs[_0x096e('0x1f')](_0x41f69a['query']['offset']);}return _0x3c7bb9[_0x096e('0x51')](_0x36e31f);}})[_0x096e('0x26')](function(_0x34798e){if(_0x34798e){return _0x34798e?{'count':_0x4e839f,'rows':_0x34798e}:null;}})[_0x096e('0x26')](respondWithResult(_0x227dde,null))['catch'](handleError(_0x227dde,null));};exports['getFields']=function(_0x51aec4,_0x2d2e79,_0x69cc5f){var _0x2acd1a={};var _0x2126ad={};var _0x173e43;var _0x34052c;return db['FreshsalesConfiguration'][_0x096e('0x4e')]({'where':{'id':_0x51aec4[_0x096e('0x46')]['id']}})[_0x096e('0x26')](handleEntityNotFound(_0x2d2e79,null))['then'](function(_0x13e784){if(_0x13e784){_0x173e43=_0x13e784;_0x2126ad['model']=_['keys'](db[_0x096e('0x4f')]['rawAttributes']);_0x2126ad[_0x096e('0x32')]=_['keys'](_0x51aec4[_0x096e('0x32')]);_0x2126ad['filters']=_[_0x096e('0x34')](_0x2126ad[_0x096e('0x30')],_0x2126ad[_0x096e('0x32')]);_0x2acd1a[_0x096e('0x36')]=_[_0x096e('0x34')](_0x2126ad['model'],qs['fields'](_0x51aec4[_0x096e('0x32')][_0x096e('0x35')]));_0x2acd1a[_0x096e('0x36')]=_0x2acd1a[_0x096e('0x36')][_0x096e('0x47')]?_0x2acd1a[_0x096e('0x36')]:_0x2126ad[_0x096e('0x30')];_0x2acd1a['order']=qs[_0x096e('0x3a')](_0x51aec4['query'][_0x096e('0x3a')]);_0x2acd1a[_0x096e('0x3b')]=qs[_0x096e('0x33')](_['pick'](_0x51aec4['query'],_0x2126ad[_0x096e('0x33')]));if(_0x51aec4[_0x096e('0x32')][_0x096e('0x3c')]){_0x2acd1a[_0x096e('0x3b')]=_[_0x096e('0x3d')](_0x2acd1a[_0x096e('0x3b')],{'$or':_['map'](_0x2acd1a[_0x096e('0x36')],function(_0x49ac9b){var _0x413596={};_0x413596[_0x49ac9b]={'$like':'%'+_0x51aec4[_0x096e('0x32')][_0x096e('0x3c')]+'%'};return _0x413596;})});}_0x2acd1a=_[_0x096e('0x3d')]({},_0x2acd1a,_0x51aec4['options']);return _0x173e43[_0x096e('0x52')](_0x2acd1a);}})['then'](function(_0x47ebe8){if(_0x47ebe8){_0x34052c=_0x47ebe8[_0x096e('0x47')];if(!_0x51aec4[_0x096e('0x32')][_0x096e('0x37')](_0x096e('0x38'))){_0x2acd1a[_0x096e('0x1d')]=qs[_0x096e('0x1d')](_0x51aec4[_0x096e('0x32')][_0x096e('0x1d')]);_0x2acd1a['offset']=qs[_0x096e('0x1f')](_0x51aec4['query']['offset']);}return _0x173e43[_0x096e('0x52')](_0x2acd1a);}})[_0x096e('0x26')](function(_0x2e31ad){if(_0x2e31ad){return _0x2e31ad?{'count':_0x34052c,'rows':_0x2e31ad}:null;}})[_0x096e('0x26')](respondWithResult(_0x2d2e79,null))[_0x096e('0x44')](handleError(_0x2d2e79,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6fe=['../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x36cba4,_0x53a452){var _0xcc6047=function(_0x20b2a5){while(--_0x20b2a5){_0x36cba4['push'](_0x36cba4['shift']());}};_0xcc6047(++_0x53a452);}(_0xc6fe,0x158));var _0xec6f=function(_0x418780,_0x28b7d7){_0x418780=_0x418780-0x0;var _0x5dd67a=_0xc6fe[_0x418780];return _0x5dd67a;};'use strict';var _=require(_0xec6f('0x0'));var util=require(_0xec6f('0x1'));var logger=require(_0xec6f('0x2'))(_0xec6f('0x3'));var moment=require('moment');var BPromise=require(_0xec6f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec6f('0x5'));var config=require(_0xec6f('0x6'));var attributes=require(_0xec6f('0x7'));module['exports']=function(_0x45dde3,_0x2c3244){return _0x45dde3[_0xec6f('0x8')](_0xec6f('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b97=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8b97,0x1bb));var _0x78b9=function(_0x3b39f2,_0x5d0240){_0x3b39f2=_0x3b39f2-0x0;var _0x4093f0=_0x8b97[_0x3b39f2];return _0x4093f0;};'use strict';var _=require(_0x78b9('0x0'));var util=require(_0x78b9('0x1'));var logger=require(_0x78b9('0x2'))(_0x78b9('0x3'));var moment=require(_0x78b9('0x4'));var BPromise=require(_0x78b9('0x5'));var rp=require(_0x78b9('0x6'));var fs=require('fs');var path=require(_0x78b9('0x7'));var rimraf=require(_0x78b9('0x8'));var config=require(_0x78b9('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x78b9('0xa')]=function(_0x1efd2b,_0x4665b2){return _0x1efd2b[_0x78b9('0xb')](_0x78b9('0xc'),attributes,{'tableName':_0x78b9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb26=['info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xeb26,0x82));var _0x6eb2=function(_0x3f7363,_0x1fb679){_0x3f7363=_0x3f7363-0x0;var _0x1945de=_0xeb26[_0x3f7363];return _0x1945de;};'use strict';var _=require(_0x6eb2('0x0'));var util=require('util');var moment=require(_0x6eb2('0x1'));var BPromise=require('bluebird');var rs=require(_0x6eb2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eb2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eb2('0x4'))(_0x6eb2('0x5'));var config=require(_0x6eb2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6eb2('0x7')][_0x6eb2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30122c,_0x5245a2,_0x52875c){return new BPromise(function(_0x366f55,_0x5786eb){return client[_0x6eb2('0x9')](_0x30122c,_0x52875c)['then'](function(_0x377690){logger[_0x6eb2('0xa')](_0x6eb2('0xb'),_0x5245a2,_0x6eb2('0xc'));logger[_0x6eb2('0xd')](_0x6eb2('0xe'),_0x5245a2,'request\x20sent',JSON[_0x6eb2('0xf')](_0x377690));if(_0x377690[_0x6eb2('0x10')]){if(_0x377690[_0x6eb2('0x10')][_0x6eb2('0x11')]===0x1f4){logger[_0x6eb2('0x10')](_0x6eb2('0xb'),_0x5245a2,_0x377690['error']['message']);return _0x5786eb(_0x377690[_0x6eb2('0x10')][_0x6eb2('0x12')]);}logger[_0x6eb2('0x10')](_0x6eb2('0xb'),_0x5245a2,_0x377690[_0x6eb2('0x10')][_0x6eb2('0x12')]);return _0x366f55(_0x377690['error']['message']);}else{logger[_0x6eb2('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5245a2,'request\x20sent');_0x366f55(_0x377690[_0x6eb2('0x13')]['message']);}})['catch'](function(_0x3be28b){logger[_0x6eb2('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5245a2,_0x3be28b);_0x5786eb(_0x3be28b);});});}
\ No newline at end of file
+var _0x2532=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x40a5bd,_0x126145){var _0x6ba3b8=function(_0x473d42){while(--_0x473d42){_0x40a5bd['push'](_0x40a5bd['shift']());}};_0x6ba3b8(++_0x126145);}(_0x2532,0x119));var _0x2253=function(_0x13de77,_0x355400){_0x13de77=_0x13de77-0x0;var _0x1b564c=_0x2532[_0x13de77];return _0x1b564c;};'use strict';var _=require(_0x2253('0x0'));var util=require(_0x2253('0x1'));var moment=require(_0x2253('0x2'));var BPromise=require(_0x2253('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2253('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2253('0x5'));var logger=require(_0x2253('0x6'))('rpc');var config=require(_0x2253('0x7'));var jayson=require(_0x2253('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4095cd,_0x506fbb,_0x50f0b8){return new BPromise(function(_0x52d8bb,_0x6034e7){return client[_0x2253('0x9')](_0x4095cd,_0x50f0b8)[_0x2253('0xa')](function(_0x4f93d8){logger['info'](_0x2253('0xb'),_0x506fbb,_0x2253('0xc'));logger[_0x2253('0xd')](_0x2253('0xe'),_0x506fbb,_0x2253('0xc'),JSON[_0x2253('0xf')](_0x4f93d8));if(_0x4f93d8[_0x2253('0x10')]){if(_0x4f93d8[_0x2253('0x10')]['code']===0x1f4){logger[_0x2253('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x506fbb,_0x4f93d8[_0x2253('0x10')][_0x2253('0x11')]);return _0x6034e7(_0x4f93d8[_0x2253('0x10')][_0x2253('0x11')]);}logger[_0x2253('0x10')](_0x2253('0xb'),_0x506fbb,_0x4f93d8[_0x2253('0x10')]['message']);return _0x52d8bb(_0x4f93d8[_0x2253('0x10')][_0x2253('0x11')]);}else{logger[_0x2253('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x506fbb,'request\x20sent');_0x52d8bb(_0x4f93d8['result']['message']);}})[_0x2253('0x13')](function(_0x366597){logger[_0x2253('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x506fbb,_0x366597);_0x6034e7(_0x366597);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf874=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xf874,0x177));var _0x4f87=function(_0x70ab2,_0x24d78a){_0x70ab2=_0x70ab2-0x0;var _0xa9f079=_0xf874[_0x70ab2];return _0xa9f079;};'use strict';var multer=require(_0x4f87('0x0'));var util=require('util');var path=require(_0x4f87('0x1'));var timeout=require(_0x4f87('0x2'));var express=require(_0x4f87('0x3'));var router=express[_0x4f87('0x4')]();var fs_extra=require(_0x4f87('0x5'));var auth=require(_0x4f87('0x6'));var interaction=require(_0x4f87('0x7'));var config=require('../../config/environment');var controller=require(_0x4f87('0x8'));router[_0x4f87('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4f87('0xa')]);router['post']('/',auth[_0x4f87('0xb')](),controller[_0x4f87('0xc')]);router[_0x4f87('0xd')](_0x4f87('0xe'),auth['isAuthenticated'](),controller[_0x4f87('0xf')]);router[_0x4f87('0x10')](_0x4f87('0xe'),auth[_0x4f87('0xb')](),controller[_0x4f87('0x11')]);module[_0x4f87('0x12')]=router;
\ No newline at end of file
+var _0x502a=['isAuthenticated','index','/:id','create','update','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x190848,_0x3dad9b){var _0x5b3ad5=function(_0x4403aa){while(--_0x4403aa){_0x190848['push'](_0x190848['shift']());}};_0x5b3ad5(++_0x3dad9b);}(_0x502a,0xd8));var _0xa502=function(_0x5e1347,_0x5f0e93){_0x5e1347=_0x5e1347-0x0;var _0x39d36b=_0x502a[_0x5e1347];return _0x39d36b;};'use strict';var multer=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var path=require('path');var timeout=require(_0xa502('0x2'));var express=require(_0xa502('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa502('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa502('0x5'));var controller=require(_0xa502('0x6'));router[_0xa502('0x7')]('/',auth[_0xa502('0x8')](),controller[_0xa502('0x9')]);router['get'](_0xa502('0xa'),auth[_0xa502('0x8')](),controller['show']);router['post']('/',auth[_0xa502('0x8')](),controller[_0xa502('0xb')]);router['put'](_0xa502('0xa'),auth[_0xa502('0x8')](),controller[_0xa502('0xc')]);router['delete'](_0xa502('0xa'),auth[_0xa502('0x8')](),controller[_0xa502('0xd')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa58=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2dd2ca,_0x3f4560){var _0x3bd7aa=function(_0x10e8f5){while(--_0x10e8f5){_0x2dd2ca['push'](_0x2dd2ca['shift']());}};_0x3bd7aa(++_0x3f4560);}(_0xfa58,0x169));var _0x8fa5=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0xfa58[_0x3c487b];return _0x1d65f6;};'use strict';var Sequelize=require(_0x8fa5('0x0'));module['exports']={'type':{'type':Sequelize[_0x8fa5('0x1')](_0x8fa5('0x2'),_0x8fa5('0x3'),_0x8fa5('0x4'),_0x8fa5('0x5'),_0x8fa5('0x6')),'defaultValue':_0x8fa5('0x2')},'content':{'type':Sequelize[_0x8fa5('0x7')]},'key':{'type':Sequelize[_0x8fa5('0x7')]},'keyType':{'type':Sequelize[_0x8fa5('0x1')]('string',_0x8fa5('0x3'),_0x8fa5('0x4'))},'keyContent':{'type':Sequelize[_0x8fa5('0x7')]},'idField':{'type':Sequelize[_0x8fa5('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8fa5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x84fe=['ENUM','customVariable','keyValue','picklist','string','STRING','exports'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x84fe,0x76));var _0xe84f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84fe[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xe84f('0x0')]={'type':{'type':Sequelize[_0xe84f('0x1')]('string','variable',_0xe84f('0x2'),_0xe84f('0x3'),_0xe84f('0x4')),'defaultValue':_0xe84f('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe84f('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xe84f('0x2'))},'keyContent':{'type':Sequelize[_0xe84f('0x6')]},'idField':{'type':Sequelize[_0xe84f('0x6')]},'nameField':{'type':Sequelize[_0xe84f('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x756f=['Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0x756f,0x152));var _0xf756=function(_0x4f1b5c,_0x32cf90){_0x4f1b5c=_0x4f1b5c-0x0;var _0x2b0463=_0x756f[_0x4f1b5c];return _0x2b0463;};'use strict';var emlformat=require(_0xf756('0x0'));var rimraf=require(_0xf756('0x1'));var zipdir=require(_0xf756('0x2'));var jsonpatch=require(_0xf756('0x3'));var rp=require(_0xf756('0x4'));var moment=require(_0xf756('0x5'));var BPromise=require(_0xf756('0x6'));var Mustache=require(_0xf756('0x7'));var util=require(_0xf756('0x8'));var path=require(_0xf756('0x9'));var sox=require(_0xf756('0xa'));var csv=require(_0xf756('0xb'));var ejs=require(_0xf756('0xc'));var fs=require('fs');var fs_extra=require(_0xf756('0xd'));var _=require(_0xf756('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf756('0xf'));var toCsv=require(_0xf756('0xb'));var querystring=require(_0xf756('0x10'));var Papa=require(_0xf756('0x11'));var Redis=require('ioredis');var authService=require(_0xf756('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf756('0x13'));var hardwareService=require(_0xf756('0x14'));var logger=require(_0xf756('0x15'))(_0xf756('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf756('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb15e0a,_0x15061e){_0x15061e=_0x15061e||0xcc;return function(_0x4c4b42){if(_0x4c4b42){return _0xb15e0a[_0xf756('0x18')](_0x15061e);}return _0xb15e0a[_0xf756('0x19')](_0x15061e)[_0xf756('0x1a')]();};}function respondWithResult(_0xdf9f0b,_0x4a6ef9){_0x4a6ef9=_0x4a6ef9||0xc8;return function(_0x10ba5e){if(_0x10ba5e){return _0xdf9f0b[_0xf756('0x19')](_0x4a6ef9)[_0xf756('0x1b')](_0x10ba5e);}};}function respondWithFilteredResult(_0x4e0a5e,_0x3b2c74){return function(_0x25a7cf){if(_0x25a7cf){var _0x5d7db4=typeof _0x3b2c74[_0xf756('0x1c')]==='undefined'&&typeof _0x3b2c74[_0xf756('0x1d')]==='undefined';var _0x4dc946=_0x25a7cf[_0xf756('0x1e')];var _0x593030=_0x5d7db4?0x0:_0x3b2c74['offset'];var _0x432722=_0x5d7db4?_0x25a7cf[_0xf756('0x1e')]:_0x3b2c74[_0xf756('0x1c')]+_0x3b2c74[_0xf756('0x1d')];var _0x1855c9;if(_0x432722>=_0x4dc946){_0x432722=_0x4dc946;_0x1855c9=0xc8;}else{_0x1855c9=0xce;}_0x4e0a5e[_0xf756('0x19')](_0x1855c9);return _0x4e0a5e[_0xf756('0x1f')](_0xf756('0x20'),_0x593030+'-'+_0x432722+'/'+_0x4dc946)[_0xf756('0x1b')](_0x25a7cf);}return null;};}function patchUpdates(_0x30de53){return function(_0x2c0c88){try{jsonpatch[_0xf756('0x21')](_0x2c0c88,_0x30de53,!![]);}catch(_0x3004b2){return BPromise[_0xf756('0x22')](_0x3004b2);}return _0x2c0c88['save']();};}function saveUpdates(_0x4eda74,_0xd0ff52){return function(_0x49f0f7){if(_0x49f0f7){return _0x49f0f7['update'](_0x4eda74)['then'](function(_0x396fb9){return _0x396fb9;});}return null;};}function removeEntity(_0x1eaca4,_0x3102e){return function(_0x333a97){if(_0x333a97){return _0x333a97[_0xf756('0x23')]()[_0xf756('0x24')](function(){_0x1eaca4[_0xf756('0x19')](0xcc)[_0xf756('0x1a')]();});}};}function handleEntityNotFound(_0x1cc642,_0x482604){return function(_0xc99b03){if(!_0xc99b03){_0x1cc642[_0xf756('0x18')](0x194);}return _0xc99b03;};}function handleError(_0x1f1d98,_0x7a90a7){_0x7a90a7=_0x7a90a7||0x1f4;return function(_0x39f35e){logger[_0xf756('0x25')](_0x39f35e[_0xf756('0x26')]);if(_0x39f35e['name']){delete _0x39f35e[_0xf756('0x27')];}_0x1f1d98[_0xf756('0x19')](_0x7a90a7)[_0xf756('0x28')](_0x39f35e);};}exports[_0xf756('0x29')]=function(_0x542a47,_0x172958){var _0x901768={},_0x1aeb63={},_0x968427={'count':0x0,'rows':[]};var _0x5d9475=_[_0xf756('0x2a')](db[_0xf756('0x2b')][_0xf756('0x2c')],function(_0x3ac597){return{'name':_0x3ac597[_0xf756('0x2d')],'type':_0x3ac597[_0xf756('0x2e')]['key']};});_0x1aeb63[_0xf756('0x2f')]=_['map'](_0x5d9475,_0xf756('0x27'));_0x1aeb63[_0xf756('0x30')]=_[_0xf756('0x31')](_0x542a47['query']);_0x1aeb63[_0xf756('0x32')]=_[_0xf756('0x33')](_0x1aeb63[_0xf756('0x2f')],_0x1aeb63[_0xf756('0x30')]);_0x901768[_0xf756('0x34')]=_[_0xf756('0x33')](_0x1aeb63[_0xf756('0x2f')],qs[_0xf756('0x35')](_0x542a47[_0xf756('0x30')][_0xf756('0x35')]));_0x901768['attributes']=_0x901768[_0xf756('0x34')][_0xf756('0x36')]?_0x901768[_0xf756('0x34')]:_0x1aeb63[_0xf756('0x2f')];if(!_0x542a47['query'][_0xf756('0x37')](_0xf756('0x38'))){_0x901768[_0xf756('0x1d')]=qs[_0xf756('0x1d')](_0x542a47[_0xf756('0x30')][_0xf756('0x1d')]);_0x901768[_0xf756('0x1c')]=qs[_0xf756('0x1c')](_0x542a47['query']['offset']);}_0x901768[_0xf756('0x39')]=qs['sort'](_0x542a47[_0xf756('0x30')][_0xf756('0x3a')]);_0x901768['where']=qs[_0xf756('0x32')](_[_0xf756('0x3b')](_0x542a47['query'],_0x1aeb63[_0xf756('0x32')]),_0x5d9475);if(_0x542a47[_0xf756('0x30')]['filter']){_0x901768[_0xf756('0x3c')]=_[_0xf756('0x3d')](_0x901768[_0xf756('0x3c')],{'$or':_[_0xf756('0x2a')](_0x5d9475,function(_0x242938){if(_0x242938[_0xf756('0x2e')]!=='VIRTUAL'){var _0x4f1fad={};_0x4f1fad[_0x242938[_0xf756('0x27')]]={'$like':'%'+_0x542a47[_0xf756('0x30')][_0xf756('0x3e')]+'%'};return _0x4f1fad;}})});}_0x901768=_[_0xf756('0x3d')]({},_0x901768,_0x542a47[_0xf756('0x3f')]);var _0x3e7fac={'where':_0x901768[_0xf756('0x3c')]};return db['FreshsalesField'][_0xf756('0x1e')](_0x3e7fac)['then'](function(_0x681a3a){_0x968427[_0xf756('0x1e')]=_0x681a3a;if(_0x542a47[_0xf756('0x30')][_0xf756('0x40')]){_0x901768[_0xf756('0x41')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x901768);})[_0xf756('0x24')](function(_0x18400b){_0x968427[_0xf756('0x42')]=_0x18400b;return _0x968427;})[_0xf756('0x24')](respondWithFilteredResult(_0x172958,_0x901768))[_0xf756('0x43')](handleError(_0x172958,null));};exports[_0xf756('0x44')]=function(_0x145104,_0x1e8880){var _0x558e59={'raw':!![],'where':{'id':_0x145104[_0xf756('0x45')]['id']}},_0x1163eb={};_0x1163eb[_0xf756('0x2f')]=_[_0xf756('0x31')](db[_0xf756('0x2b')]['rawAttributes']);_0x1163eb[_0xf756('0x30')]=_[_0xf756('0x31')](_0x145104[_0xf756('0x30')]);_0x1163eb[_0xf756('0x32')]=_[_0xf756('0x33')](_0x1163eb[_0xf756('0x2f')],_0x1163eb[_0xf756('0x30')]);_0x558e59['attributes']=_['intersection'](_0x1163eb[_0xf756('0x2f')],qs[_0xf756('0x35')](_0x145104[_0xf756('0x30')][_0xf756('0x35')]));_0x558e59[_0xf756('0x34')]=_0x558e59[_0xf756('0x34')][_0xf756('0x36')]?_0x558e59[_0xf756('0x34')]:_0x1163eb[_0xf756('0x2f')];if(_0x145104[_0xf756('0x30')][_0xf756('0x40')]){_0x558e59[_0xf756('0x41')]=[{'all':!![]}];}_0x558e59=_[_0xf756('0x3d')]({},_0x558e59,_0x145104[_0xf756('0x3f')]);return db['FreshsalesField'][_0xf756('0x46')](_0x558e59)[_0xf756('0x24')](handleEntityNotFound(_0x1e8880,null))[_0xf756('0x24')](respondWithResult(_0x1e8880,null))['catch'](handleError(_0x1e8880,null));};exports[_0xf756('0x47')]=function(_0x401131,_0x5b99bc){return db[_0xf756('0x2b')][_0xf756('0x47')](_0x401131[_0xf756('0x48')],{})[_0xf756('0x24')](respondWithResult(_0x5b99bc,0xc9))['catch'](handleError(_0x5b99bc,null));};exports[_0xf756('0x49')]=function(_0x2eb92f,_0xd69939){if(_0x2eb92f['body']['id']){delete _0x2eb92f['body']['id'];}return db[_0xf756('0x2b')][_0xf756('0x46')]({'where':{'id':_0x2eb92f[_0xf756('0x45')]['id']}})[_0xf756('0x24')](handleEntityNotFound(_0xd69939,null))[_0xf756('0x24')](saveUpdates(_0x2eb92f[_0xf756('0x48')],null))['then'](respondWithResult(_0xd69939,null))[_0xf756('0x43')](handleError(_0xd69939,null));};exports[_0xf756('0x23')]=function(_0x3ec293,_0x4739d0){return db[_0xf756('0x2b')]['find']({'where':{'id':_0x3ec293[_0xf756('0x45')]['id']}})[_0xf756('0x24')](handleEntityNotFound(_0x4739d0,null))[_0xf756('0x24')](removeEntity(_0x4739d0,null))[_0xf756('0x43')](handleError(_0x4739d0,null));};
\ No newline at end of file
+var _0x63e9=['save','update','then','destroy','error','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','FreshsalesField','rawAttributes','find','catch','create','body','rimraf','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject'];(function(_0x858382,_0xda09c9){var _0xca7a0b=function(_0x2dc134){while(--_0x2dc134){_0x858382['push'](_0x858382['shift']());}};_0xca7a0b(++_0xda09c9);}(_0x63e9,0x139));var _0x963e=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0x63e9[_0x2afb44];return _0x15ccc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x963e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x963e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x963e('0x2'));var path=require(_0x963e('0x3'));var sox=require(_0x963e('0x4'));var csv=require(_0x963e('0x5'));var ejs=require(_0x963e('0x6'));var fs=require('fs');var fs_extra=require(_0x963e('0x7'));var _=require('lodash');var squel=require(_0x963e('0x8'));var crypto=require(_0x963e('0x9'));var jsforce=require(_0x963e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x963e('0x5'));var querystring=require(_0x963e('0xb'));var Papa=require(_0x963e('0xc'));var Redis=require(_0x963e('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x963e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x963e('0xf'))(_0x963e('0x10'));var utils=require(_0x963e('0x11'));var config=require(_0x963e('0x12'));var licenseUtil=require(_0x963e('0x13'));var db=require(_0x963e('0x14'))['db'];function respondWithStatusCode(_0x4c1ac5,_0x398fcb){_0x398fcb=_0x398fcb||0xcc;return function(_0x5a1bc8){if(_0x5a1bc8){return _0x4c1ac5[_0x963e('0x15')](_0x398fcb);}return _0x4c1ac5[_0x963e('0x16')](_0x398fcb)[_0x963e('0x17')]();};}function respondWithResult(_0xebc965,_0x38998e){_0x38998e=_0x38998e||0xc8;return function(_0x2e9519){if(_0x2e9519){return _0xebc965[_0x963e('0x16')](_0x38998e)['json'](_0x2e9519);}};}function respondWithFilteredResult(_0x3f2d34,_0x1f5722){return function(_0x4ae633){if(_0x4ae633){var _0x2ca70d=typeof _0x1f5722['offset']==='undefined'&&typeof _0x1f5722[_0x963e('0x18')]===_0x963e('0x19');var _0x49d66c=_0x4ae633[_0x963e('0x1a')];var _0x3ed050=_0x2ca70d?0x0:_0x1f5722[_0x963e('0x1b')];var _0x1655a4=_0x2ca70d?_0x4ae633[_0x963e('0x1a')]:_0x1f5722['offset']+_0x1f5722[_0x963e('0x18')];var _0x39183e;if(_0x1655a4>=_0x49d66c){_0x1655a4=_0x49d66c;_0x39183e=0xc8;}else{_0x39183e=0xce;}_0x3f2d34['status'](_0x39183e);return _0x3f2d34['set'](_0x963e('0x1c'),_0x3ed050+'-'+_0x1655a4+'/'+_0x49d66c)[_0x963e('0x1d')](_0x4ae633);}return null;};}function patchUpdates(_0x3c3c54){return function(_0x2028aa){try{jsonpatch[_0x963e('0x1e')](_0x2028aa,_0x3c3c54,!![]);}catch(_0x4b8d23){return BPromise[_0x963e('0x1f')](_0x4b8d23);}return _0x2028aa[_0x963e('0x20')]();};}function saveUpdates(_0x1604f7,_0x281c81){return function(_0x1edc35){if(_0x1edc35){return _0x1edc35[_0x963e('0x21')](_0x1604f7)[_0x963e('0x22')](function(_0x3f0248){return _0x3f0248;});}return null;};}function removeEntity(_0x6107c0,_0x3e9200){return function(_0x274234){if(_0x274234){return _0x274234[_0x963e('0x23')]()[_0x963e('0x22')](function(){_0x6107c0[_0x963e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267e53,_0x5ed099){return function(_0x851c7a){if(!_0x851c7a){_0x267e53[_0x963e('0x15')](0x194);}return _0x851c7a;};}function handleError(_0x7db815,_0x545eeb){_0x545eeb=_0x545eeb||0x1f4;return function(_0x3b87b1){logger[_0x963e('0x24')](_0x3b87b1['stack']);if(_0x3b87b1[_0x963e('0x25')]){delete _0x3b87b1[_0x963e('0x25')];}_0x7db815['status'](_0x545eeb)['send'](_0x3b87b1);};}exports[_0x963e('0x26')]=function(_0xe0ed55,_0x4a1e6f){var _0x4641cd={},_0x2cc8aa={},_0x130342={'count':0x0,'rows':[]};var _0x54456f=_[_0x963e('0x27')](db['FreshsalesField']['rawAttributes'],function(_0x2573ce){return{'name':_0x2573ce[_0x963e('0x28')],'type':_0x2573ce[_0x963e('0x29')][_0x963e('0x2a')]};});_0x2cc8aa[_0x963e('0x2b')]=_[_0x963e('0x27')](_0x54456f,_0x963e('0x25'));_0x2cc8aa['query']=_[_0x963e('0x2c')](_0xe0ed55[_0x963e('0x2d')]);_0x2cc8aa[_0x963e('0x2e')]=_[_0x963e('0x2f')](_0x2cc8aa[_0x963e('0x2b')],_0x2cc8aa[_0x963e('0x2d')]);_0x4641cd[_0x963e('0x30')]=_[_0x963e('0x2f')](_0x2cc8aa[_0x963e('0x2b')],qs[_0x963e('0x31')](_0xe0ed55[_0x963e('0x2d')][_0x963e('0x31')]));_0x4641cd[_0x963e('0x30')]=_0x4641cd[_0x963e('0x30')]['length']?_0x4641cd[_0x963e('0x30')]:_0x2cc8aa[_0x963e('0x2b')];if(!_0xe0ed55[_0x963e('0x2d')]['hasOwnProperty']('nolimit')){_0x4641cd[_0x963e('0x18')]=qs[_0x963e('0x18')](_0xe0ed55[_0x963e('0x2d')][_0x963e('0x18')]);_0x4641cd[_0x963e('0x1b')]=qs[_0x963e('0x1b')](_0xe0ed55['query'][_0x963e('0x1b')]);}_0x4641cd[_0x963e('0x32')]=qs[_0x963e('0x33')](_0xe0ed55['query']['sort']);_0x4641cd[_0x963e('0x34')]=qs['filters'](_[_0x963e('0x35')](_0xe0ed55[_0x963e('0x2d')],_0x2cc8aa[_0x963e('0x2e')]),_0x54456f);if(_0xe0ed55['query']['filter']){_0x4641cd['where']=_[_0x963e('0x36')](_0x4641cd[_0x963e('0x34')],{'$or':_[_0x963e('0x27')](_0x54456f,function(_0x5f323d){if(_0x5f323d['type']!==_0x963e('0x37')){var _0x2356a6={};_0x2356a6[_0x5f323d[_0x963e('0x25')]]={'$like':'%'+_0xe0ed55[_0x963e('0x2d')]['filter']+'%'};return _0x2356a6;}})});}_0x4641cd=_[_0x963e('0x36')]({},_0x4641cd,_0xe0ed55[_0x963e('0x38')]);var _0x84402a={'where':_0x4641cd['where']};return db['FreshsalesField'][_0x963e('0x1a')](_0x84402a)[_0x963e('0x22')](function(_0x3a724e){_0x130342['count']=_0x3a724e;if(_0xe0ed55['query'][_0x963e('0x39')]){_0x4641cd[_0x963e('0x3a')]=[{'all':!![]}];}return db['FreshsalesField'][_0x963e('0x3b')](_0x4641cd);})['then'](function(_0x5a8a4e){_0x130342[_0x963e('0x3c')]=_0x5a8a4e;return _0x130342;})[_0x963e('0x22')](respondWithFilteredResult(_0x4a1e6f,_0x4641cd))['catch'](handleError(_0x4a1e6f,null));};exports[_0x963e('0x3d')]=function(_0x3fc05e,_0x3d0a07){var _0x6d7737={'raw':!![],'where':{'id':_0x3fc05e[_0x963e('0x3e')]['id']}},_0x4b1ce3={};_0x4b1ce3[_0x963e('0x2b')]=_['keys'](db[_0x963e('0x3f')][_0x963e('0x40')]);_0x4b1ce3[_0x963e('0x2d')]=_['keys'](_0x3fc05e['query']);_0x4b1ce3[_0x963e('0x2e')]=_[_0x963e('0x2f')](_0x4b1ce3[_0x963e('0x2b')],_0x4b1ce3[_0x963e('0x2d')]);_0x6d7737[_0x963e('0x30')]=_[_0x963e('0x2f')](_0x4b1ce3[_0x963e('0x2b')],qs[_0x963e('0x31')](_0x3fc05e[_0x963e('0x2d')]['fields']));_0x6d7737['attributes']=_0x6d7737[_0x963e('0x30')]['length']?_0x6d7737['attributes']:_0x4b1ce3[_0x963e('0x2b')];if(_0x3fc05e[_0x963e('0x2d')][_0x963e('0x39')]){_0x6d7737['include']=[{'all':!![]}];}_0x6d7737=_['merge']({},_0x6d7737,_0x3fc05e[_0x963e('0x38')]);return db['FreshsalesField'][_0x963e('0x41')](_0x6d7737)['then'](handleEntityNotFound(_0x3d0a07,null))['then'](respondWithResult(_0x3d0a07,null))[_0x963e('0x42')](handleError(_0x3d0a07,null));};exports[_0x963e('0x43')]=function(_0x3f33b4,_0x5a5f3c){return db[_0x963e('0x3f')][_0x963e('0x43')](_0x3f33b4[_0x963e('0x44')],{})['then'](respondWithResult(_0x5a5f3c,0xc9))[_0x963e('0x42')](handleError(_0x5a5f3c,null));};exports[_0x963e('0x21')]=function(_0x32bb1f,_0x2319ba){if(_0x32bb1f[_0x963e('0x44')]['id']){delete _0x32bb1f[_0x963e('0x44')]['id'];}return db[_0x963e('0x3f')][_0x963e('0x41')]({'where':{'id':_0x32bb1f[_0x963e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2319ba,null))[_0x963e('0x22')](saveUpdates(_0x32bb1f['body'],null))[_0x963e('0x22')](respondWithResult(_0x2319ba,null))[_0x963e('0x42')](handleError(_0x2319ba,null));};exports[_0x963e('0x23')]=function(_0x3025be,_0x4e473b){return db['FreshsalesField'][_0x963e('0x41')]({'where':{'id':_0x3025be['params']['id']}})['then'](handleEntityNotFound(_0x4e473b,null))['then'](removeEntity(_0x4e473b,null))[_0x963e('0x42')](handleError(_0x4e473b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x110f=['freshsales_unique_index','FieldId','lodash','util','bluebird','path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields'];(function(_0x5a5113,_0x1c008b){var _0x16a596=function(_0x2726d8){while(--_0x2726d8){_0x5a5113['push'](_0x5a5113['shift']());}};_0x16a596(++_0x1c008b);}(_0x110f,0x1e6));var _0xf110=function(_0x3e17df,_0x1922dd){_0x3e17df=_0x3e17df-0x0;var _0x2decc1=_0x110f[_0x3e17df];return _0x2decc1;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf110('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf110('0x3'));var rimraf=require(_0xf110('0x4'));var config=require(_0xf110('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0xf110('0x6')]=function(_0x3147fd,_0xc27675){return _0x3147fd['define'](_0xf110('0x7'),attributes,{'tableName':_0xf110('0x8'),'paranoid':![],'indexes':[{'name':_0xf110('0x9'),'fields':['idField',_0xf110('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x68b7=['moment','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','lodash','../../config/logger','api'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x68b7,0x8c));var _0x768b=function(_0x5e7e51,_0x273a91){_0x5e7e51=_0x5e7e51-0x0;var _0x1f436d=_0x68b7[_0x5e7e51];return _0x1f436d;};'use strict';var _=require(_0x768b('0x0'));var util=require('util');var logger=require(_0x768b('0x1'))(_0x768b('0x2'));var moment=require(_0x768b('0x3'));var BPromise=require('bluebird');var rp=require(_0x768b('0x4'));var fs=require('fs');var path=require(_0x768b('0x5'));var rimraf=require(_0x768b('0x6'));var config=require('../../config/environment');var attributes=require(_0x768b('0x7'));module[_0x768b('0x8')]=function(_0x18aaaa,_0x31aba4){return _0x18aaaa[_0x768b('0x9')](_0x768b('0xa'),attributes,{'tableName':_0x768b('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x768b('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18e737,_0x4dbe54){var _0x24955b=function(_0x4282c9){while(--_0x4282c9){_0x18e737['push'](_0x18e737['shift']());}};_0x24955b(++_0x4dbe54);}(_0x1623,0xab));var _0x3162=function(_0x5c12ed,_0x178d37){_0x5c12ed=_0x5c12ed-0x0;var _0x7985c6=_0x1623[_0x5c12ed];return _0x7985c6;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}
\ No newline at end of file
+var _0x46ed=['FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x46ed,0x168));var _0xd46e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x46ed[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1f4f64,_0x8ec8a6){var _0x3ae24a=function(_0x31429b){while(--_0x31429b){_0x1f4f64['push'](_0x1f4f64['shift']());}};_0x3ae24a(++_0x8ec8a6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x38f739,_0x24afbc){var _0x348cde=function(_0x5e23aa){while(--_0x5e23aa){_0x38f739['push'](_0x38f739['shift']());}};_0x348cde(++_0x24afbc);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd5d=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xbd5d,0x118));var _0xdbd5=function(_0x4b4cb5,_0x5916db){_0x4b4cb5=_0x4b4cb5-0x0;var _0x4fb22e=_0xbd5d[_0x4b4cb5];return _0x4fb22e;};'use strict';var Sequelize=require(_0xdbd5('0x0'));module[_0xdbd5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdbd5('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xdbd5('0x2')]},'password':{'type':Sequelize[_0xdbd5('0x2')]},'clientId':{'type':Sequelize[_0xdbd5('0x2')]},'clientSecret':{'type':Sequelize[_0xdbd5('0x2')]},'securityToken':{'type':Sequelize[_0xdbd5('0x2')]},'serverUrl':{'type':Sequelize[_0xdbd5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdbd5('0x3')](_0xdbd5('0x4'),_0xdbd5('0x5')),'defaultValue':_0xdbd5('0x4')}};
\ No newline at end of file
+var _0xf29d=['STRING','username','ENUM','integrationTab','sequelize','exports'];(function(_0x10624b,_0x42ff0a){var _0x1a6f91=function(_0x3a45a7){while(--_0x3a45a7){_0x10624b['push'](_0x10624b['shift']());}};_0x1a6f91(++_0x42ff0a);}(_0xf29d,0xc4));var _0xdf29=function(_0x1005bc,_0x5ec18){_0x1005bc=_0x1005bc-0x0;var _0xa1e6c4=_0xf29d[_0x1005bc];return _0xa1e6c4;};'use strict';var Sequelize=require(_0xdf29('0x0'));module[_0xdf29('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdf29('0x2')]},'username':{'type':Sequelize[_0xdf29('0x2')],'unique':_0xdf29('0x3')},'remoteUri':{'type':Sequelize[_0xdf29('0x2')]},'password':{'type':Sequelize[_0xdf29('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xdf29('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdf29('0x4')](_0xdf29('0x5'),'newTab'),'defaultValue':_0xdf29('0x5')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e0b=['util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','rawAttributes','options','find','catch','create','body','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','remoteUri','clientId','username','password','securityToken','slice','substring','Connection','clientSecret','concat','isNil','ticketType','sobject','OwnerId','Subject','Description','int','picklist','email','textarea','remove','includes','custom','picklistValues','label','boolean','True','true','False','false','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x502661,_0x2c112f){var _0x37dc28=function(_0x2a05d5){while(--_0x2a05d5){_0x502661['push'](_0x502661['shift']());}};_0x37dc28(++_0x2c112f);}(_0x7e0b,0xeb));var _0xb7e0=function(_0x330955,_0x434849){_0x330955=_0x330955-0x0;var _0x4e7e9e=_0x7e0b[_0x330955];return _0x4e7e9e;};'use strict';var emlformat=require(_0xb7e0('0x0'));var rimraf=require(_0xb7e0('0x1'));var zipdir=require(_0xb7e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7e0('0x3'));var moment=require('moment');var BPromise=require(_0xb7e0('0x4'));var Mustache=require('mustache');var util=require(_0xb7e0('0x5'));var path=require(_0xb7e0('0x6'));var sox=require(_0xb7e0('0x7'));var csv=require(_0xb7e0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7e0('0x9'));var _=require(_0xb7e0('0xa'));var squel=require(_0xb7e0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb7e0('0xc'));var toCsv=require(_0xb7e0('0x8'));var querystring=require(_0xb7e0('0xd'));var Papa=require(_0xb7e0('0xe'));var Redis=require(_0xb7e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb7e0('0x10'));var as=require(_0xb7e0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7e0('0x12'))(_0xb7e0('0x13'));var utils=require(_0xb7e0('0x14'));var config=require(_0xb7e0('0x15'));var licenseUtil=require(_0xb7e0('0x16'));var db=require(_0xb7e0('0x17'))['db'];var integrations=require(_0xb7e0('0x18'));function respondWithStatusCode(_0x2a2660,_0x46c925){_0x46c925=_0x46c925||0xcc;return function(_0x49c7ad){if(_0x49c7ad){return _0x2a2660[_0xb7e0('0x19')](_0x46c925);}return _0x2a2660[_0xb7e0('0x1a')](_0x46c925)[_0xb7e0('0x1b')]();};}function respondWithResult(_0x359703,_0x4e0389){_0x4e0389=_0x4e0389||0xc8;return function(_0x5cdb03){if(_0x5cdb03){return _0x359703[_0xb7e0('0x1a')](_0x4e0389)['json'](_0x5cdb03);}};}function respondWithFilteredResult(_0xfb7e85,_0x538a07){return function(_0x3d63bd){if(_0x3d63bd){var _0x3f0926=typeof _0x538a07[_0xb7e0('0x1c')]===_0xb7e0('0x1d')&&typeof _0x538a07[_0xb7e0('0x1e')]==='undefined';var _0x39df90=_0x3d63bd[_0xb7e0('0x1f')];var _0xcbdbe3=_0x3f0926?0x0:_0x538a07[_0xb7e0('0x1c')];var _0x30ad72=_0x3f0926?_0x3d63bd[_0xb7e0('0x1f')]:_0x538a07[_0xb7e0('0x1c')]+_0x538a07[_0xb7e0('0x1e')];var _0x22b7ac;if(_0x30ad72>=_0x39df90){_0x30ad72=_0x39df90;_0x22b7ac=0xc8;}else{_0x22b7ac=0xce;}_0xfb7e85[_0xb7e0('0x1a')](_0x22b7ac);return _0xfb7e85[_0xb7e0('0x20')](_0xb7e0('0x21'),_0xcbdbe3+'-'+_0x30ad72+'/'+_0x39df90)[_0xb7e0('0x22')](_0x3d63bd);}return null;};}function patchUpdates(_0x316998){return function(_0x30c49a){try{jsonpatch[_0xb7e0('0x23')](_0x30c49a,_0x316998,!![]);}catch(_0x2014c3){return BPromise[_0xb7e0('0x24')](_0x2014c3);}return _0x30c49a[_0xb7e0('0x25')]();};}function saveUpdates(_0x5e0c06,_0x2e78e6){return function(_0x1e3d6d){if(_0x1e3d6d){return _0x1e3d6d['update'](_0x5e0c06)[_0xb7e0('0x26')](function(_0x515771){return _0x515771;});}return null;};}function removeEntity(_0x3aad54,_0x39a145){return function(_0x330e40){if(_0x330e40){return _0x330e40['destroy']()[_0xb7e0('0x26')](function(){_0x3aad54[_0xb7e0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9948f5,_0x2e4866){return function(_0x211753){if(!_0x211753){_0x9948f5[_0xb7e0('0x19')](0x194);}return _0x211753;};}function handleError(_0x598c41,_0x1eff37){_0x1eff37=_0x1eff37||0x1f4;return function(_0x2f151f){logger[_0xb7e0('0x27')](_0x2f151f[_0xb7e0('0x28')]);if(_0x2f151f[_0xb7e0('0x29')]){delete _0x2f151f[_0xb7e0('0x29')];}_0x598c41['status'](_0x1eff37)[_0xb7e0('0x2a')](_0x2f151f);};}exports['index']=function(_0x5c0075,_0x1fb910){var _0xb11174={},_0x152e0f={},_0x619728={'count':0x0,'rows':[]};var _0x31b676=_[_0xb7e0('0x2b')](db[_0xb7e0('0x2c')]['rawAttributes'],function(_0x44aa07){return{'name':_0x44aa07[_0xb7e0('0x2d')],'type':_0x44aa07[_0xb7e0('0x2e')][_0xb7e0('0x2f')]};});_0x152e0f[_0xb7e0('0x30')]=_[_0xb7e0('0x2b')](_0x31b676,_0xb7e0('0x29'));_0x152e0f[_0xb7e0('0x31')]=_[_0xb7e0('0x32')](_0x5c0075['query']);_0x152e0f[_0xb7e0('0x33')]=_[_0xb7e0('0x34')](_0x152e0f[_0xb7e0('0x30')],_0x152e0f[_0xb7e0('0x31')]);_0xb11174[_0xb7e0('0x35')]=_[_0xb7e0('0x34')](_0x152e0f[_0xb7e0('0x30')],qs[_0xb7e0('0x36')](_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x36')]));_0xb11174[_0xb7e0('0x35')]=_0xb11174['attributes'][_0xb7e0('0x37')]?_0xb11174['attributes']:_0x152e0f[_0xb7e0('0x30')];if(!_0x5c0075['query'][_0xb7e0('0x38')](_0xb7e0('0x39'))){_0xb11174[_0xb7e0('0x1e')]=qs[_0xb7e0('0x1e')](_0x5c0075['query'][_0xb7e0('0x1e')]);_0xb11174[_0xb7e0('0x1c')]=qs['offset'](_0x5c0075[_0xb7e0('0x31')]['offset']);}_0xb11174[_0xb7e0('0x3a')]=qs[_0xb7e0('0x3b')](_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x3b')]);_0xb11174['where']=qs['filters'](_['pick'](_0x5c0075[_0xb7e0('0x31')],_0x152e0f[_0xb7e0('0x33')]),_0x31b676);if(_0x5c0075['query'][_0xb7e0('0x3c')]){_0xb11174[_0xb7e0('0x3d')]=_[_0xb7e0('0x3e')](_0xb11174[_0xb7e0('0x3d')],{'$or':_[_0xb7e0('0x2b')](_0x31b676,function(_0x2e7e82){if(_0x2e7e82[_0xb7e0('0x2e')]!==_0xb7e0('0x3f')){var _0x388ebe={};_0x388ebe[_0x2e7e82[_0xb7e0('0x29')]]={'$like':'%'+_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x3c')]+'%'};return _0x388ebe;}})});}_0xb11174=_[_0xb7e0('0x3e')]({},_0xb11174,_0x5c0075['options']);var _0x264ceb={'where':_0xb11174[_0xb7e0('0x3d')]};return db[_0xb7e0('0x2c')][_0xb7e0('0x1f')](_0x264ceb)[_0xb7e0('0x26')](function(_0xbb5571){_0x619728[_0xb7e0('0x1f')]=_0xbb5571;if(_0x5c0075[_0xb7e0('0x31')][_0xb7e0('0x40')]){_0xb11174[_0xb7e0('0x41')]=[{'all':!![]}];}return db[_0xb7e0('0x2c')][_0xb7e0('0x42')](_0xb11174);})[_0xb7e0('0x26')](function(_0x25a274){_0x619728[_0xb7e0('0x43')]=_0x25a274;return _0x619728;})['then'](respondWithFilteredResult(_0x1fb910,_0xb11174))['catch'](handleError(_0x1fb910,null));};exports['show']=function(_0x3d908e,_0x214884){var _0x57c92f={'raw':![],'where':{'id':_0x3d908e['params']['id']}},_0x4328bf={};_0x4328bf[_0xb7e0('0x30')]=_[_0xb7e0('0x32')](db['SalesforceAccount'][_0xb7e0('0x44')]);_0x4328bf['query']=_['keys'](_0x3d908e[_0xb7e0('0x31')]);_0x4328bf[_0xb7e0('0x33')]=_[_0xb7e0('0x34')](_0x4328bf[_0xb7e0('0x30')],_0x4328bf[_0xb7e0('0x31')]);_0x57c92f[_0xb7e0('0x35')]=_[_0xb7e0('0x34')](_0x4328bf['model'],qs['fields'](_0x3d908e['query'][_0xb7e0('0x36')]));_0x57c92f[_0xb7e0('0x35')]=_0x57c92f[_0xb7e0('0x35')][_0xb7e0('0x37')]?_0x57c92f[_0xb7e0('0x35')]:_0x4328bf[_0xb7e0('0x30')];if(_0x3d908e[_0xb7e0('0x31')][_0xb7e0('0x40')]){_0x57c92f[_0xb7e0('0x41')]=[{'all':!![]}];}_0x57c92f=_[_0xb7e0('0x3e')]({},_0x57c92f,_0x3d908e[_0xb7e0('0x45')]);return db[_0xb7e0('0x2c')][_0xb7e0('0x46')](_0x57c92f)[_0xb7e0('0x26')](handleEntityNotFound(_0x214884,null))[_0xb7e0('0x26')](respondWithResult(_0x214884,null))[_0xb7e0('0x47')](handleError(_0x214884,null));};exports['create']=function(_0x3fe820,_0x254297){return db[_0xb7e0('0x2c')][_0xb7e0('0x48')](_0x3fe820['body'],{})[_0xb7e0('0x26')](respondWithResult(_0x254297,0xc9))[_0xb7e0('0x47')](handleError(_0x254297,null));};exports['update']=function(_0x45b770,_0x198ddd){if(_0x45b770[_0xb7e0('0x49')]['id']){delete _0x45b770['body']['id'];}return db[_0xb7e0('0x2c')]['find']({'where':{'id':_0x45b770[_0xb7e0('0x4a')]['id']}})[_0xb7e0('0x26')](handleEntityNotFound(_0x198ddd,null))[_0xb7e0('0x26')](saveUpdates(_0x45b770['body'],null))[_0xb7e0('0x26')](respondWithResult(_0x198ddd,null))['catch'](handleError(_0x198ddd,null));};exports['destroy']=function(_0x56766b,_0x4a9fbf){return db['SalesforceAccount']['find']({'where':{'id':_0x56766b[_0xb7e0('0x4a')]['id']}})[_0xb7e0('0x26')](handleEntityNotFound(_0x4a9fbf,null))['then'](removeEntity(_0x4a9fbf,null))[_0xb7e0('0x47')](handleError(_0x4a9fbf,null));};exports[_0xb7e0('0x4b')]=function(_0x304db5,_0x4a1b56,_0x1f0a7f){var _0x440cb8={};var _0x1fe25a={};var _0x1de893;var _0x74a6ef;return db[_0xb7e0('0x2c')][_0xb7e0('0x4c')]({'where':{'id':_0x304db5[_0xb7e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a1b56,null))['then'](function(_0xdc3c97){if(_0xdc3c97){_0x1de893=_0xdc3c97;_0x1fe25a['model']=_[_0xb7e0('0x32')](db['SalesforceConfiguration'][_0xb7e0('0x44')]);_0x1fe25a[_0xb7e0('0x31')]=_['keys'](_0x304db5[_0xb7e0('0x31')]);_0x1fe25a[_0xb7e0('0x33')]=_[_0xb7e0('0x34')](_0x1fe25a[_0xb7e0('0x30')],_0x1fe25a[_0xb7e0('0x31')]);_0x440cb8[_0xb7e0('0x35')]=_[_0xb7e0('0x34')](_0x1fe25a[_0xb7e0('0x30')],qs[_0xb7e0('0x36')](_0x304db5['query'][_0xb7e0('0x36')]));_0x440cb8['attributes']=_0x440cb8[_0xb7e0('0x35')][_0xb7e0('0x37')]?_0x440cb8['attributes']:_0x1fe25a[_0xb7e0('0x30')];_0x440cb8['order']=qs[_0xb7e0('0x3b')](_0x304db5[_0xb7e0('0x31')]['sort']);_0x440cb8['where']=qs[_0xb7e0('0x33')](_[_0xb7e0('0x4d')](_0x304db5[_0xb7e0('0x31')],_0x1fe25a[_0xb7e0('0x33')]));if(_0x304db5[_0xb7e0('0x31')][_0xb7e0('0x3c')]){_0x440cb8[_0xb7e0('0x3d')]=_[_0xb7e0('0x3e')](_0x440cb8[_0xb7e0('0x3d')],{'$or':_[_0xb7e0('0x2b')](_0x440cb8['attributes'],function(_0x5997e6){var _0x4d70e3={};_0x4d70e3[_0x5997e6]={'$like':'%'+_0x304db5[_0xb7e0('0x31')][_0xb7e0('0x3c')]+'%'};return _0x4d70e3;})});}_0x440cb8=_[_0xb7e0('0x3e')]({},_0x440cb8,_0x304db5[_0xb7e0('0x45')]);return _0x1de893[_0xb7e0('0x4b')](_0x440cb8);}})[_0xb7e0('0x26')](function(_0x1967a8){if(_0x1967a8){_0x74a6ef=_0x1967a8[_0xb7e0('0x37')];if(!_0x304db5['query'][_0xb7e0('0x38')](_0xb7e0('0x39'))){_0x440cb8[_0xb7e0('0x1e')]=qs[_0xb7e0('0x1e')](_0x304db5['query']['limit']);_0x440cb8[_0xb7e0('0x1c')]=qs['offset'](_0x304db5[_0xb7e0('0x31')][_0xb7e0('0x1c')]);}return _0x1de893[_0xb7e0('0x4b')](_0x440cb8);}})[_0xb7e0('0x26')](function(_0x25bd6f){if(_0x25bd6f){return _0x25bd6f?{'count':_0x74a6ef,'rows':_0x25bd6f}:null;}})[_0xb7e0('0x26')](respondWithResult(_0x4a1b56,null))['catch'](handleError(_0x4a1b56,null));};exports[_0xb7e0('0x4e')]=function(_0x700a52,_0x546159,_0xabdf90){if(_0x700a52[_0xb7e0('0x49')]['id']){delete _0x700a52['body']['id'];}return db['SalesforceAccount'][_0xb7e0('0x4c')]({'where':{'id':_0x700a52[_0xb7e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x546159,null))['then'](function(_0x360d88){if(_0x360d88){_0x700a52[_0xb7e0('0x49')][_0xb7e0('0x4f')]=_0x360d88['id'];_0x700a52[_0xb7e0('0x49')][_0xb7e0('0x50')]=integrations[_0xb7e0('0x51')](_0x700a52[_0xb7e0('0x49')]['channel'],_0x700a52[_0xb7e0('0x49')]['type']);_0x700a52[_0xb7e0('0x49')][_0xb7e0('0x52')]=integrations[_0xb7e0('0x53')](_0x700a52['body']['channel'],_0x700a52['body'][_0xb7e0('0x2e')]);return db[_0xb7e0('0x54')]['create'](_0x700a52[_0xb7e0('0x49')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xb7e0('0x55')],'as':_0xb7e0('0x52')}]});}return null;})[_0xb7e0('0x26')](respondWithResult(_0x546159,null))[_0xb7e0('0x47')](handleError(_0x546159,null));};exports['getFields']=function(_0xf5ff86,_0x5e1b7c,_0x178b57){var _0x227846;var _0x2d9c2d='';var _0x12f713='Task';return db[_0xb7e0('0x2c')][_0xb7e0('0x4c')]({'where':{'id':_0xf5ff86[_0xb7e0('0x4a')]['id']},'attributes':['id',_0xb7e0('0x56'),_0xb7e0('0x57'),'clientSecret',_0xb7e0('0x58'),_0xb7e0('0x59'),_0xb7e0('0x5a')]})[_0xb7e0('0x26')](handleEntityNotFound(_0x5e1b7c,null))[_0xb7e0('0x26')](function(_0x57cc2a){if(_0x57cc2a){_0x2d9c2d=_0x57cc2a[_0xb7e0('0x56')];var _0x53abc5=_0x2d9c2d[_0xb7e0('0x5b')](-0x1);if(_0x53abc5==='/'){_0x2d9c2d=_0x2d9c2d[_0xb7e0('0x5c')](0x0,_0x2d9c2d['lastIndexOf'](_0x53abc5));}_0x227846=new jsforce[(_0xb7e0('0x5d'))]({'oauth2':{'loginUrl':_0x2d9c2d,'clientId':_0x57cc2a[_0xb7e0('0x57')],'clientSecret':_0x57cc2a[_0xb7e0('0x5e')]}});return _0x227846['login'](_0x57cc2a[_0xb7e0('0x58')],_0x57cc2a[_0xb7e0('0x59')][_0xb7e0('0x5f')](_0x57cc2a[_0xb7e0('0x5a')]));}})[_0xb7e0('0x26')](function(_0x5b77d5){if(_0x5b77d5){if(!_[_0xb7e0('0x60')](_0xf5ff86['query'][_0xb7e0('0x61')])){_0x12f713=_0xf5ff86['query']['ticketType'];}return _0x227846[_0xb7e0('0x62')](_0x12f713)['describe']();}})['then'](function(_0x559b07){var _0x49df06=[_0xb7e0('0x63'),'ActivityDate','IsReminderSet','IsRecurrence',_0xb7e0('0x64'),_0xb7e0('0x65')];var _0x5c1905=['string',_0xb7e0('0x66'),_0xb7e0('0x67'),'boolean',_0xb7e0('0x68'),_0xb7e0('0x69'),'phone'];if(_0x559b07){_[_0xb7e0('0x6a')](_0x559b07[_0xb7e0('0x36')],function(_0x1df160){return _0x49df06[_0xb7e0('0x6b')](_0x1df160[_0xb7e0('0x29')])||!_0x5c1905['includes'](_0x1df160[_0xb7e0('0x2e')]);});return{'count':_0x559b07['fields'][_0xb7e0('0x37')],'rows':_[_0xb7e0('0x2b')](_0x559b07[_0xb7e0('0x36')],function(_0x22357c){return{'id':_0x22357c[_0xb7e0('0x29')],'name':_0x22357c['label'],'custom':_0x22357c[_0xb7e0('0x6c')],'options':_0x22357c[_0xb7e0('0x6d')]['length']>0x0?_[_0xb7e0('0x2b')](_0x22357c[_0xb7e0('0x6d')],function(_0x1ba46f){return{'name':_0x1ba46f[_0xb7e0('0x6e')],'value':_0x1ba46f['value']};}):_0x22357c[_0xb7e0('0x2e')]==_0xb7e0('0x6f')?[{'name':_0xb7e0('0x70'),'value':_0xb7e0('0x71')},{'name':_0xb7e0('0x72'),'value':_0xb7e0('0x73')}]:[]};})};}})[_0xb7e0('0x26')](respondWithResult(_0x5e1b7c,null))['catch'](function(_0x2c984b){var _0x33ce79=_0xf5ff86['query'][_0xb7e0('0x74')]?0x1f4:_0x2c984b[_0xb7e0('0x75')]||0x1f4;logger[_0xb7e0('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xb7e0('0x76'),_0x33ce79,JSON[_0xb7e0('0x77')](_0x2c984b));delete _0x2c984b[_0xb7e0('0x29')];if(_0x33ce79===0x191){_0x33ce79=0x190;}_0x5e1b7c[_0xb7e0('0x1a')](_0x33ce79)[_0xb7e0('0x2a')](_0xf5ff86['query'][_0xb7e0('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x2c984b['statusCode']}:_0x2c984b);});};
\ No newline at end of file
+var _0x19bf=['isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','value','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','catch','create','body','find','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','clientId','clientSecret','password','securityToken','slice','lastIndexOf','Connection','login','concat'];(function(_0x477193,_0x18aed0){var _0x1f298a=function(_0x35319a){while(--_0x35319a){_0x477193['push'](_0x477193['shift']());}};_0x1f298a(++_0x18aed0);}(_0x19bf,0x114));var _0xf19b=function(_0x5d394a,_0x1abed0){_0x5d394a=_0x5d394a-0x0;var _0x558b32=_0x19bf[_0x5d394a];return _0x558b32;};'use strict';var emlformat=require(_0xf19b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf19b('0x1'));var jsonpatch=require(_0xf19b('0x2'));var rp=require(_0xf19b('0x3'));var moment=require(_0xf19b('0x4'));var BPromise=require(_0xf19b('0x5'));var Mustache=require(_0xf19b('0x6'));var util=require(_0xf19b('0x7'));var path=require(_0xf19b('0x8'));var sox=require(_0xf19b('0x9'));var csv=require('to-csv');var ejs=require(_0xf19b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf19b('0xb'));var squel=require(_0xf19b('0xc'));var crypto=require(_0xf19b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf19b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf19b('0xf'));var Redis=require('ioredis');var authService=require(_0xf19b('0x10'));var qs=require(_0xf19b('0x11'));var as=require(_0xf19b('0x12'));var hardwareService=require(_0xf19b('0x13'));var logger=require(_0xf19b('0x14'))(_0xf19b('0x15'));var utils=require(_0xf19b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf19b('0x17'));var db=require(_0xf19b('0x18'))['db'];var integrations=require(_0xf19b('0x19'));function respondWithStatusCode(_0x3df55d,_0x2c375f){_0x2c375f=_0x2c375f||0xcc;return function(_0x9c773c){if(_0x9c773c){return _0x3df55d[_0xf19b('0x1a')](_0x2c375f);}return _0x3df55d['status'](_0x2c375f)['end']();};}function respondWithResult(_0x551160,_0x1a2c66){_0x1a2c66=_0x1a2c66||0xc8;return function(_0x3ac0eb){if(_0x3ac0eb){return _0x551160[_0xf19b('0x1b')](_0x1a2c66)[_0xf19b('0x1c')](_0x3ac0eb);}};}function respondWithFilteredResult(_0xe8b113,_0x520eaf){return function(_0x37d99d){if(_0x37d99d){var _0x38ff1c=typeof _0x520eaf[_0xf19b('0x1d')]===_0xf19b('0x1e')&&typeof _0x520eaf[_0xf19b('0x1f')]===_0xf19b('0x1e');var _0x49fb59=_0x37d99d['count'];var _0x4d6b7f=_0x38ff1c?0x0:_0x520eaf[_0xf19b('0x1d')];var _0x1fb439=_0x38ff1c?_0x37d99d[_0xf19b('0x20')]:_0x520eaf['offset']+_0x520eaf[_0xf19b('0x1f')];var _0x3a80cf;if(_0x1fb439>=_0x49fb59){_0x1fb439=_0x49fb59;_0x3a80cf=0xc8;}else{_0x3a80cf=0xce;}_0xe8b113[_0xf19b('0x1b')](_0x3a80cf);return _0xe8b113[_0xf19b('0x21')](_0xf19b('0x22'),_0x4d6b7f+'-'+_0x1fb439+'/'+_0x49fb59)[_0xf19b('0x1c')](_0x37d99d);}return null;};}function patchUpdates(_0x355d12){return function(_0xe129d8){try{jsonpatch[_0xf19b('0x23')](_0xe129d8,_0x355d12,!![]);}catch(_0x1296ba){return BPromise['reject'](_0x1296ba);}return _0xe129d8[_0xf19b('0x24')]();};}function saveUpdates(_0x48ef3b,_0x280918){return function(_0x1e01b4){if(_0x1e01b4){return _0x1e01b4[_0xf19b('0x25')](_0x48ef3b)[_0xf19b('0x26')](function(_0x554959){return _0x554959;});}return null;};}function removeEntity(_0x2d0e6d,_0x1ba866){return function(_0x3f3f32){if(_0x3f3f32){return _0x3f3f32[_0xf19b('0x27')]()[_0xf19b('0x26')](function(){_0x2d0e6d[_0xf19b('0x1b')](0xcc)[_0xf19b('0x28')]();});}};}function handleEntityNotFound(_0x41dc19,_0x2fa4e4){return function(_0x3c4812){if(!_0x3c4812){_0x41dc19[_0xf19b('0x1a')](0x194);}return _0x3c4812;};}function handleError(_0x5e3acf,_0x5818ae){_0x5818ae=_0x5818ae||0x1f4;return function(_0x57db22){logger[_0xf19b('0x29')](_0x57db22[_0xf19b('0x2a')]);if(_0x57db22[_0xf19b('0x2b')]){delete _0x57db22[_0xf19b('0x2b')];}_0x5e3acf[_0xf19b('0x1b')](_0x5818ae)[_0xf19b('0x2c')](_0x57db22);};}exports[_0xf19b('0x2d')]=function(_0xdbcff2,_0x30516b){var _0x5992ea={},_0x522d9e={},_0x1922b5={'count':0x0,'rows':[]};var _0x3fd951=_['map'](db[_0xf19b('0x2e')][_0xf19b('0x2f')],function(_0x471b47){return{'name':_0x471b47[_0xf19b('0x30')],'type':_0x471b47[_0xf19b('0x31')]['key']};});_0x522d9e[_0xf19b('0x32')]=_[_0xf19b('0x33')](_0x3fd951,_0xf19b('0x2b'));_0x522d9e[_0xf19b('0x34')]=_[_0xf19b('0x35')](_0xdbcff2[_0xf19b('0x34')]);_0x522d9e[_0xf19b('0x36')]=_[_0xf19b('0x37')](_0x522d9e[_0xf19b('0x32')],_0x522d9e[_0xf19b('0x34')]);_0x5992ea['attributes']=_[_0xf19b('0x37')](_0x522d9e[_0xf19b('0x32')],qs['fields'](_0xdbcff2[_0xf19b('0x34')][_0xf19b('0x38')]));_0x5992ea['attributes']=_0x5992ea[_0xf19b('0x39')][_0xf19b('0x3a')]?_0x5992ea['attributes']:_0x522d9e['model'];if(!_0xdbcff2[_0xf19b('0x34')][_0xf19b('0x3b')](_0xf19b('0x3c'))){_0x5992ea[_0xf19b('0x1f')]=qs['limit'](_0xdbcff2[_0xf19b('0x34')]['limit']);_0x5992ea[_0xf19b('0x1d')]=qs['offset'](_0xdbcff2[_0xf19b('0x34')]['offset']);}_0x5992ea[_0xf19b('0x3d')]=qs[_0xf19b('0x3e')](_0xdbcff2[_0xf19b('0x34')][_0xf19b('0x3e')]);_0x5992ea[_0xf19b('0x3f')]=qs[_0xf19b('0x36')](_[_0xf19b('0x40')](_0xdbcff2[_0xf19b('0x34')],_0x522d9e[_0xf19b('0x36')]),_0x3fd951);if(_0xdbcff2[_0xf19b('0x34')]['filter']){_0x5992ea[_0xf19b('0x3f')]=_['merge'](_0x5992ea[_0xf19b('0x3f')],{'$or':_[_0xf19b('0x33')](_0x3fd951,function(_0x203f65){if(_0x203f65['type']!=='VIRTUAL'){var _0x31b09f={};_0x31b09f[_0x203f65[_0xf19b('0x2b')]]={'$like':'%'+_0xdbcff2[_0xf19b('0x34')][_0xf19b('0x41')]+'%'};return _0x31b09f;}})});}_0x5992ea=_[_0xf19b('0x42')]({},_0x5992ea,_0xdbcff2[_0xf19b('0x43')]);var _0x345461={'where':_0x5992ea[_0xf19b('0x3f')]};return db['SalesforceAccount'][_0xf19b('0x20')](_0x345461)['then'](function(_0x464e3e){_0x1922b5[_0xf19b('0x20')]=_0x464e3e;if(_0xdbcff2[_0xf19b('0x34')][_0xf19b('0x44')]){_0x5992ea[_0xf19b('0x45')]=[{'all':!![]}];}return db[_0xf19b('0x2e')]['findAll'](_0x5992ea);})['then'](function(_0x32e2cc){_0x1922b5[_0xf19b('0x46')]=_0x32e2cc;return _0x1922b5;})[_0xf19b('0x26')](respondWithFilteredResult(_0x30516b,_0x5992ea))['catch'](handleError(_0x30516b,null));};exports[_0xf19b('0x47')]=function(_0x304a17,_0x17dd68){var _0x2609a0={'raw':![],'where':{'id':_0x304a17[_0xf19b('0x48')]['id']}},_0x230e31={};_0x230e31[_0xf19b('0x32')]=_[_0xf19b('0x35')](db[_0xf19b('0x2e')][_0xf19b('0x2f')]);_0x230e31[_0xf19b('0x34')]=_['keys'](_0x304a17[_0xf19b('0x34')]);_0x230e31[_0xf19b('0x36')]=_['intersection'](_0x230e31[_0xf19b('0x32')],_0x230e31[_0xf19b('0x34')]);_0x2609a0[_0xf19b('0x39')]=_[_0xf19b('0x37')](_0x230e31[_0xf19b('0x32')],qs[_0xf19b('0x38')](_0x304a17[_0xf19b('0x34')]['fields']));_0x2609a0[_0xf19b('0x39')]=_0x2609a0[_0xf19b('0x39')]['length']?_0x2609a0[_0xf19b('0x39')]:_0x230e31[_0xf19b('0x32')];if(_0x304a17['query'][_0xf19b('0x44')]){_0x2609a0[_0xf19b('0x45')]=[{'all':!![]}];}_0x2609a0=_['merge']({},_0x2609a0,_0x304a17['options']);return db[_0xf19b('0x2e')]['find'](_0x2609a0)[_0xf19b('0x26')](handleEntityNotFound(_0x17dd68,null))[_0xf19b('0x26')](respondWithResult(_0x17dd68,null))[_0xf19b('0x49')](handleError(_0x17dd68,null));};exports['create']=function(_0x23a194,_0x46cc9c){return db['SalesforceAccount'][_0xf19b('0x4a')](_0x23a194['body'],{})[_0xf19b('0x26')](respondWithResult(_0x46cc9c,0xc9))[_0xf19b('0x49')](handleError(_0x46cc9c,null));};exports['update']=function(_0x120d0b,_0x26c967){if(_0x120d0b[_0xf19b('0x4b')]['id']){delete _0x120d0b[_0xf19b('0x4b')]['id'];}return db[_0xf19b('0x2e')][_0xf19b('0x4c')]({'where':{'id':_0x120d0b['params']['id']}})[_0xf19b('0x26')](handleEntityNotFound(_0x26c967,null))[_0xf19b('0x26')](saveUpdates(_0x120d0b[_0xf19b('0x4b')],null))[_0xf19b('0x26')](respondWithResult(_0x26c967,null))[_0xf19b('0x49')](handleError(_0x26c967,null));};exports[_0xf19b('0x27')]=function(_0x285cb5,_0xefaa7a){return db[_0xf19b('0x2e')][_0xf19b('0x4c')]({'where':{'id':_0x285cb5[_0xf19b('0x48')]['id']}})[_0xf19b('0x26')](handleEntityNotFound(_0xefaa7a,null))[_0xf19b('0x26')](removeEntity(_0xefaa7a,null))['catch'](handleError(_0xefaa7a,null));};exports['getConfigurations']=function(_0x3757b4,_0x51b48a,_0x4d28b9){var _0x19d750={};var _0x2312b8={};var _0x1d5dae;var _0x460729;return db['SalesforceAccount'][_0xf19b('0x4d')]({'where':{'id':_0x3757b4[_0xf19b('0x48')]['id']}})['then'](handleEntityNotFound(_0x51b48a,null))[_0xf19b('0x26')](function(_0x3b2142){if(_0x3b2142){_0x1d5dae=_0x3b2142;_0x2312b8[_0xf19b('0x32')]=_[_0xf19b('0x35')](db[_0xf19b('0x4e')]['rawAttributes']);_0x2312b8[_0xf19b('0x34')]=_[_0xf19b('0x35')](_0x3757b4[_0xf19b('0x34')]);_0x2312b8['filters']=_[_0xf19b('0x37')](_0x2312b8['model'],_0x2312b8[_0xf19b('0x34')]);_0x19d750[_0xf19b('0x39')]=_[_0xf19b('0x37')](_0x2312b8[_0xf19b('0x32')],qs['fields'](_0x3757b4[_0xf19b('0x34')][_0xf19b('0x38')]));_0x19d750[_0xf19b('0x39')]=_0x19d750['attributes'][_0xf19b('0x3a')]?_0x19d750[_0xf19b('0x39')]:_0x2312b8[_0xf19b('0x32')];_0x19d750[_0xf19b('0x3d')]=qs[_0xf19b('0x3e')](_0x3757b4[_0xf19b('0x34')][_0xf19b('0x3e')]);_0x19d750[_0xf19b('0x3f')]=qs[_0xf19b('0x36')](_['pick'](_0x3757b4[_0xf19b('0x34')],_0x2312b8[_0xf19b('0x36')]));if(_0x3757b4[_0xf19b('0x34')][_0xf19b('0x41')]){_0x19d750[_0xf19b('0x3f')]=_[_0xf19b('0x42')](_0x19d750[_0xf19b('0x3f')],{'$or':_[_0xf19b('0x33')](_0x19d750[_0xf19b('0x39')],function(_0x49c1cb){var _0x46faef={};_0x46faef[_0x49c1cb]={'$like':'%'+_0x3757b4[_0xf19b('0x34')][_0xf19b('0x41')]+'%'};return _0x46faef;})});}_0x19d750=_[_0xf19b('0x42')]({},_0x19d750,_0x3757b4['options']);return _0x1d5dae['getConfigurations'](_0x19d750);}})['then'](function(_0x3717c9){if(_0x3717c9){_0x460729=_0x3717c9[_0xf19b('0x3a')];if(!_0x3757b4[_0xf19b('0x34')][_0xf19b('0x3b')](_0xf19b('0x3c'))){_0x19d750[_0xf19b('0x1f')]=qs['limit'](_0x3757b4[_0xf19b('0x34')]['limit']);_0x19d750[_0xf19b('0x1d')]=qs[_0xf19b('0x1d')](_0x3757b4[_0xf19b('0x34')][_0xf19b('0x1d')]);}return _0x1d5dae[_0xf19b('0x4f')](_0x19d750);}})[_0xf19b('0x26')](function(_0x14adfd){if(_0x14adfd){return _0x14adfd?{'count':_0x460729,'rows':_0x14adfd}:null;}})['then'](respondWithResult(_0x51b48a,null))[_0xf19b('0x49')](handleError(_0x51b48a,null));};exports[_0xf19b('0x50')]=function(_0x1096ae,_0x2be1f1,_0x415cdb){if(_0x1096ae[_0xf19b('0x4b')]['id']){delete _0x1096ae[_0xf19b('0x4b')]['id'];}return db[_0xf19b('0x2e')]['findOne']({'where':{'id':_0x1096ae[_0xf19b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2be1f1,null))[_0xf19b('0x26')](function(_0x4fb510){if(_0x4fb510){_0x1096ae[_0xf19b('0x4b')]['AccountId']=_0x4fb510['id'];_0x1096ae['body'][_0xf19b('0x51')]=integrations['getSubjects'](_0x1096ae['body'][_0xf19b('0x52')],_0x1096ae[_0xf19b('0x4b')][_0xf19b('0x31')]);_0x1096ae[_0xf19b('0x4b')][_0xf19b('0x53')]=integrations[_0xf19b('0x54')](_0x1096ae[_0xf19b('0x4b')][_0xf19b('0x52')],_0x1096ae[_0xf19b('0x4b')]['type']);return db[_0xf19b('0x4e')][_0xf19b('0x4a')](_0x1096ae[_0xf19b('0x4b')],{'include':[{'model':db[_0xf19b('0x55')],'as':'Subjects'},{'model':db[_0xf19b('0x55')],'as':_0xf19b('0x53')}]});}return null;})[_0xf19b('0x26')](respondWithResult(_0x2be1f1,null))[_0xf19b('0x49')](handleError(_0x2be1f1,null));};exports[_0xf19b('0x56')]=function(_0x463b14,_0x38fee2,_0x121763){var _0x2d328d;var _0x251402='';var _0x11629c='Task';return db[_0xf19b('0x2e')][_0xf19b('0x4d')]({'where':{'id':_0x463b14['params']['id']},'attributes':['id','remoteUri',_0xf19b('0x57'),_0xf19b('0x58'),'username',_0xf19b('0x59'),_0xf19b('0x5a')]})[_0xf19b('0x26')](handleEntityNotFound(_0x38fee2,null))[_0xf19b('0x26')](function(_0x4d1e48){if(_0x4d1e48){_0x251402=_0x4d1e48['remoteUri'];var _0x44f9ea=_0x251402[_0xf19b('0x5b')](-0x1);if(_0x44f9ea==='/'){_0x251402=_0x251402['substring'](0x0,_0x251402[_0xf19b('0x5c')](_0x44f9ea));}_0x2d328d=new jsforce[(_0xf19b('0x5d'))]({'oauth2':{'loginUrl':_0x251402,'clientId':_0x4d1e48[_0xf19b('0x57')],'clientSecret':_0x4d1e48[_0xf19b('0x58')]}});return _0x2d328d[_0xf19b('0x5e')](_0x4d1e48['username'],_0x4d1e48[_0xf19b('0x59')][_0xf19b('0x5f')](_0x4d1e48[_0xf19b('0x5a')]));}})['then'](function(_0x1a7e4c){if(_0x1a7e4c){if(!_[_0xf19b('0x60')](_0x463b14[_0xf19b('0x34')][_0xf19b('0x61')])){_0x11629c=_0x463b14[_0xf19b('0x34')][_0xf19b('0x61')];}return _0x2d328d[_0xf19b('0x62')](_0x11629c)[_0xf19b('0x63')]();}})[_0xf19b('0x26')](function(_0x90ee22){var _0x42f8a6=[_0xf19b('0x64'),_0xf19b('0x65'),_0xf19b('0x66'),_0xf19b('0x67'),_0xf19b('0x68'),_0xf19b('0x69')];var _0x865e55=[_0xf19b('0x6a'),'int',_0xf19b('0x6b'),_0xf19b('0x6c'),_0xf19b('0x6d'),_0xf19b('0x6e'),_0xf19b('0x6f')];if(_0x90ee22){_[_0xf19b('0x70')](_0x90ee22['fields'],function(_0x1a48ff){return _0x42f8a6[_0xf19b('0x71')](_0x1a48ff['name'])||!_0x865e55['includes'](_0x1a48ff[_0xf19b('0x31')]);});return{'count':_0x90ee22[_0xf19b('0x38')]['length'],'rows':_[_0xf19b('0x33')](_0x90ee22[_0xf19b('0x38')],function(_0x47ccae){return{'id':_0x47ccae[_0xf19b('0x2b')],'name':_0x47ccae[_0xf19b('0x72')],'custom':_0x47ccae[_0xf19b('0x73')],'options':_0x47ccae['picklistValues']['length']>0x0?_[_0xf19b('0x33')](_0x47ccae['picklistValues'],function(_0x2064e0){return{'name':_0x2064e0['label'],'value':_0x2064e0[_0xf19b('0x74')]};}):_0x47ccae[_0xf19b('0x31')]=='boolean'?[{'name':_0xf19b('0x75'),'value':_0xf19b('0x76')},{'name':_0xf19b('0x77'),'value':_0xf19b('0x78')}]:[]};})};}})[_0xf19b('0x26')](respondWithResult(_0x38fee2,null))[_0xf19b('0x49')](function(_0x43d6c9){var _0x5d7843=_0x463b14['query'][_0xf19b('0x79')]?0x1f4:_0x43d6c9[_0xf19b('0x7a')]||0x1f4;logger[_0xf19b('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xf19b('0x56'),_0x5d7843,JSON['stringify'](_0x43d6c9));delete _0x43d6c9['name'];if(_0x5d7843===0x191){_0x5d7843=0x190;}_0x38fee2[_0xf19b('0x1b')](_0x5d7843)[_0xf19b('0x2c')](_0x463b14[_0xf19b('0x34')][_0xf19b('0x79')]?{'message':_0xf19b('0x7b'),'statusCode':_0x43d6c9[_0xf19b('0x7a')]}:_0x43d6c9);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x851f=['api','bluebird','request-promise','path','./intSalesforceAccount.attributes','exports','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x13451f,_0x30c84c){var _0x5cddfe=function(_0x42e86c){while(--_0x42e86c){_0x13451f['push'](_0x13451f['shift']());}};_0x5cddfe(++_0x30c84c);}(_0x851f,0xbb));var _0xf851=function(_0x39db05,_0x3868d0){_0x39db05=_0x39db05-0x0;var _0x3f0e22=_0x851f[_0x39db05];return _0x3f0e22;};'use strict';var _=require(_0xf851('0x0'));var util=require(_0xf851('0x1'));var logger=require(_0xf851('0x2'))(_0xf851('0x3'));var moment=require('moment');var BPromise=require(_0xf851('0x4'));var rp=require(_0xf851('0x5'));var fs=require('fs');var path=require(_0xf851('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf851('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf851('0x8')]=function(_0x6a8c18,_0x33f9cf){return _0x6a8c18['define'](_0xf851('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c92=['SalesforceAccount','int_salesforce_accounts','util','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x15888e,_0x1e80e8){var _0x3f9f4e=function(_0x1c3a18){while(--_0x1c3a18){_0x15888e['push'](_0x15888e['shift']());}};_0x3f9f4e(++_0x1e80e8);}(_0x1c92,0xac));var _0x21c9=function(_0x36aad0,_0x3d2e17){_0x36aad0=_0x36aad0-0x0;var _0x31e987=_0x1c92[_0x36aad0];return _0x31e987;};'use strict';var _=require('lodash');var util=require(_0x21c9('0x0'));var logger=require('../../config/logger')(_0x21c9('0x1'));var moment=require('moment');var BPromise=require(_0x21c9('0x2'));var rp=require(_0x21c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21c9('0x4'));var config=require(_0x21c9('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x21c9('0x6')]=function(_0x5117ce,_0x2925ef){return _0x5117ce[_0x21c9('0x7')](_0x21c9('0x8'),attributes,{'tableName':_0x21c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb725=['client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SalesforceAccount','findAll','options','raw','limit','include','map','attributes','model','GetSalesforceAccount','find','where','ShowSalesforceAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0xb725,0x86));var _0x5b72=function(_0x26f798,_0x49f65b){_0x26f798=_0x26f798-0x0;var _0x1da5bc=_0xb725[_0x26f798];return _0x1da5bc;};'use strict';var _=require('lodash');var util=require(_0x5b72('0x0'));var moment=require('moment');var BPromise=require(_0x5b72('0x1'));var rs=require(_0x5b72('0x2'));var fs=require('fs');var Redis=require(_0x5b72('0x3'));var db=require(_0x5b72('0x4'))['db'];var utils=require(_0x5b72('0x5'));var logger=require(_0x5b72('0x6'))(_0x5b72('0x7'));var config=require(_0x5b72('0x8'));var jayson=require(_0x5b72('0x9'));var client=jayson[_0x5b72('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4749f2,_0x1b6cca,_0x379572){return new BPromise(function(_0x215658,_0x30d4e6){return client[_0x5b72('0xb')](_0x4749f2,_0x379572)[_0x5b72('0xc')](function(_0x47ba42){logger[_0x5b72('0xd')](_0x5b72('0xe'),_0x1b6cca,_0x5b72('0xf'));logger[_0x5b72('0x10')](_0x5b72('0x11'),_0x1b6cca,_0x5b72('0xf'),JSON[_0x5b72('0x12')](_0x47ba42));if(_0x47ba42[_0x5b72('0x13')]){if(_0x47ba42[_0x5b72('0x13')]['code']===0x1f4){logger['error'](_0x5b72('0xe'),_0x1b6cca,_0x47ba42['error'][_0x5b72('0x14')]);return _0x30d4e6(_0x47ba42[_0x5b72('0x13')][_0x5b72('0x14')]);}logger[_0x5b72('0x13')](_0x5b72('0xe'),_0x1b6cca,_0x47ba42[_0x5b72('0x13')]['message']);return _0x215658(_0x47ba42[_0x5b72('0x13')][_0x5b72('0x14')]);}else{logger[_0x5b72('0xd')](_0x5b72('0xe'),_0x1b6cca,_0x5b72('0xf'));_0x215658(_0x47ba42[_0x5b72('0x15')][_0x5b72('0x14')]);}})[_0x5b72('0x16')](function(_0x330562){logger[_0x5b72('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x1b6cca,_0x330562);_0x30d4e6(_0x330562);});});}exports['GetSalesforceAccount']=function(_0x56c23f){var _0x271bdd=this;return new Promise(function(_0x4b3455,_0x32f31e){return db[_0x5b72('0x17')][_0x5b72('0x18')]({'raw':_0x56c23f['options']?_0x56c23f[_0x5b72('0x19')][_0x5b72('0x1a')]===undefined?!![]:![]:!![],'where':_0x56c23f[_0x5b72('0x19')]?_0x56c23f[_0x5b72('0x19')]['where']||null:null,'attributes':_0x56c23f['options']?_0x56c23f[_0x5b72('0x19')]['attributes']||null:null,'limit':_0x56c23f['options']?_0x56c23f[_0x5b72('0x19')][_0x5b72('0x1b')]||null:null,'include':_0x56c23f[_0x5b72('0x19')]?_0x56c23f['options'][_0x5b72('0x1c')]?_[_0x5b72('0x1d')](_0x56c23f[_0x5b72('0x19')][_0x5b72('0x1c')],function(_0x10ed20){return{'model':db[_0x10ed20['model']],'as':_0x10ed20['as'],'attributes':_0x10ed20[_0x5b72('0x1e')],'include':_0x10ed20[_0x5b72('0x1c')]?_['map'](_0x10ed20['include'],function(_0x52fc1d){return{'model':db[_0x52fc1d[_0x5b72('0x1f')]],'as':_0x52fc1d['as'],'attributes':_0x52fc1d[_0x5b72('0x1e')],'include':_0x52fc1d['include']?_['map'](_0x52fc1d[_0x5b72('0x1c')],function(_0x1ac7a7){return{'model':db[_0x1ac7a7[_0x5b72('0x1f')]],'as':_0x1ac7a7['as'],'attributes':_0x1ac7a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b72('0xc')](function(_0x2dc35d){logger[_0x5b72('0xd')](_0x5b72('0x20'),_0x56c23f);logger[_0x5b72('0x10')]('GetSalesforceAccount',_0x56c23f,JSON[_0x5b72('0x12')](_0x2dc35d));_0x4b3455(_0x2dc35d);})[_0x5b72('0x16')](function(_0x2919a4){logger[_0x5b72('0x13')]('GetSalesforceAccount',_0x2919a4[_0x5b72('0x14')],_0x56c23f);_0x32f31e(_0x271bdd[_0x5b72('0x13')](0x1f4,_0x2919a4[_0x5b72('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0xabf919){var _0x54d5dc=this;return new Promise(function(_0xa455f9,_0x4d0dbc){return db[_0x5b72('0x17')][_0x5b72('0x21')]({'raw':_0xabf919['options']?_0xabf919['options'][_0x5b72('0x1a')]===undefined?!![]:![]:!![],'where':_0xabf919[_0x5b72('0x19')]?_0xabf919['options'][_0x5b72('0x22')]||null:null,'attributes':_0xabf919['options']?_0xabf919[_0x5b72('0x19')][_0x5b72('0x1e')]||null:null,'include':_0xabf919[_0x5b72('0x19')]?_0xabf919[_0x5b72('0x19')]['include']?_[_0x5b72('0x1d')](_0xabf919['options'][_0x5b72('0x1c')],function(_0x5b2505){return{'model':db[_0x5b2505['model']],'as':_0x5b2505['as'],'attributes':_0x5b2505['attributes'],'include':_0x5b2505[_0x5b72('0x1c')]?_[_0x5b72('0x1d')](_0x5b2505[_0x5b72('0x1c')],function(_0x98d697){return{'model':db[_0x98d697['model']],'as':_0x98d697['as'],'attributes':_0x98d697[_0x5b72('0x1e')],'include':_0x98d697[_0x5b72('0x1c')]?_['map'](_0x98d697['include'],function(_0x10d31c){return{'model':db[_0x10d31c['model']],'as':_0x10d31c['as'],'attributes':_0x10d31c[_0x5b72('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5b72('0xc')](function(_0x24da69){logger[_0x5b72('0xd')](_0x5b72('0x23'),_0xabf919);logger['debug'](_0x5b72('0x23'),_0xabf919,JSON[_0x5b72('0x12')](_0x24da69));_0xa455f9(_0x24da69);})['catch'](function(_0x5dba3e){logger[_0x5b72('0x13')]('ShowSalesforceAccount',_0x5dba3e['message'],_0xabf919);_0x4d0dbc(_0x54d5dc[_0x5b72('0x13')](0x1f4,_0x5dba3e['message']));});});};
\ No newline at end of file
+var _0xe7ae=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','SalesforceAccount','findAll','options','where','attributes','limit','map','include','model','GetSalesforceAccount','ShowSalesforceAccount','raw','moment'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe7ae,0x192));var _0xee7a=function(_0x814c4,_0xad4af){_0x814c4=_0x814c4-0x0;var _0x21d1dd=_0xe7ae[_0x814c4];return _0x21d1dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee7a('0x0'));var BPromise=require(_0xee7a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xee7a('0x3'));var logger=require(_0xee7a('0x4'))(_0xee7a('0x5'));var config=require(_0xee7a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xee7a('0x7')][_0xee7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c8bf7,_0x201690,_0x31673b){return new BPromise(function(_0x306564,_0x41a2eb){return client[_0xee7a('0x9')](_0x1c8bf7,_0x31673b)[_0xee7a('0xa')](function(_0x57ba62){logger[_0xee7a('0xb')](_0xee7a('0xc'),_0x201690,_0xee7a('0xd'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x201690,_0xee7a('0xd'),JSON[_0xee7a('0xe')](_0x57ba62));if(_0x57ba62['error']){if(_0x57ba62[_0xee7a('0xf')][_0xee7a('0x10')]===0x1f4){logger[_0xee7a('0xf')](_0xee7a('0xc'),_0x201690,_0x57ba62[_0xee7a('0xf')][_0xee7a('0x11')]);return _0x41a2eb(_0x57ba62[_0xee7a('0xf')][_0xee7a('0x11')]);}logger[_0xee7a('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x201690,_0x57ba62[_0xee7a('0xf')][_0xee7a('0x11')]);return _0x306564(_0x57ba62[_0xee7a('0xf')][_0xee7a('0x11')]);}else{logger[_0xee7a('0xb')](_0xee7a('0xc'),_0x201690,_0xee7a('0xd'));_0x306564(_0x57ba62[_0xee7a('0x12')][_0xee7a('0x11')]);}})['catch'](function(_0x50b1ed){logger[_0xee7a('0xf')](_0xee7a('0xc'),_0x201690,_0x50b1ed);_0x41a2eb(_0x50b1ed);});});}exports['GetSalesforceAccount']=function(_0x3736b5){var _0x56d2f=this;return new Promise(function(_0x49b32e,_0x2f6f12){return db[_0xee7a('0x13')][_0xee7a('0x14')]({'raw':_0x3736b5[_0xee7a('0x15')]?_0x3736b5[_0xee7a('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3736b5[_0xee7a('0x15')]?_0x3736b5[_0xee7a('0x15')][_0xee7a('0x16')]||null:null,'attributes':_0x3736b5[_0xee7a('0x15')]?_0x3736b5[_0xee7a('0x15')][_0xee7a('0x17')]||null:null,'limit':_0x3736b5['options']?_0x3736b5[_0xee7a('0x15')][_0xee7a('0x18')]||null:null,'include':_0x3736b5[_0xee7a('0x15')]?_0x3736b5['options']['include']?_[_0xee7a('0x19')](_0x3736b5[_0xee7a('0x15')][_0xee7a('0x1a')],function(_0xa06401){return{'model':db[_0xa06401[_0xee7a('0x1b')]],'as':_0xa06401['as'],'attributes':_0xa06401[_0xee7a('0x17')],'include':_0xa06401[_0xee7a('0x1a')]?_[_0xee7a('0x19')](_0xa06401[_0xee7a('0x1a')],function(_0x3b53e0){return{'model':db[_0x3b53e0[_0xee7a('0x1b')]],'as':_0x3b53e0['as'],'attributes':_0x3b53e0['attributes'],'include':_0x3b53e0[_0xee7a('0x1a')]?_[_0xee7a('0x19')](_0x3b53e0[_0xee7a('0x1a')],function(_0x5765d6){return{'model':db[_0x5765d6[_0xee7a('0x1b')]],'as':_0x5765d6['as'],'attributes':_0x5765d6[_0xee7a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8103ff){logger['info'](_0xee7a('0x1c'),_0x3736b5);logger['debug']('GetSalesforceAccount',_0x3736b5,JSON[_0xee7a('0xe')](_0x8103ff));_0x49b32e(_0x8103ff);})['catch'](function(_0x4dfc26){logger['error']('GetSalesforceAccount',_0x4dfc26[_0xee7a('0x11')],_0x3736b5);_0x2f6f12(_0x56d2f[_0xee7a('0xf')](0x1f4,_0x4dfc26[_0xee7a('0x11')]));});});};exports[_0xee7a('0x1d')]=function(_0xe6c79f){var _0x3474fa=this;return new Promise(function(_0x4e93ca,_0x476f2a){return db[_0xee7a('0x13')]['find']({'raw':_0xe6c79f[_0xee7a('0x15')]?_0xe6c79f['options'][_0xee7a('0x1e')]===undefined?!![]:![]:!![],'where':_0xe6c79f[_0xee7a('0x15')]?_0xe6c79f[_0xee7a('0x15')][_0xee7a('0x16')]||null:null,'attributes':_0xe6c79f[_0xee7a('0x15')]?_0xe6c79f[_0xee7a('0x15')][_0xee7a('0x17')]||null:null,'include':_0xe6c79f['options']?_0xe6c79f[_0xee7a('0x15')]['include']?_[_0xee7a('0x19')](_0xe6c79f[_0xee7a('0x15')][_0xee7a('0x1a')],function(_0x57e291){return{'model':db[_0x57e291[_0xee7a('0x1b')]],'as':_0x57e291['as'],'attributes':_0x57e291['attributes'],'include':_0x57e291[_0xee7a('0x1a')]?_[_0xee7a('0x19')](_0x57e291[_0xee7a('0x1a')],function(_0x52cb5e){return{'model':db[_0x52cb5e[_0xee7a('0x1b')]],'as':_0x52cb5e['as'],'attributes':_0x52cb5e['attributes'],'include':_0x52cb5e[_0xee7a('0x1a')]?_[_0xee7a('0x19')](_0x52cb5e['include'],function(_0x22c00e){return{'model':db[_0x22c00e[_0xee7a('0x1b')]],'as':_0x22c00e['as'],'attributes':_0x22c00e[_0xee7a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xee7a('0xa')](function(_0x305d26){logger[_0xee7a('0xb')]('ShowSalesforceAccount',_0xe6c79f);logger['debug'](_0xee7a('0x1d'),_0xe6c79f,JSON[_0xee7a('0xe')](_0x305d26));_0x4e93ca(_0x305d26);})['catch'](function(_0x326fd9){logger[_0xee7a('0xf')](_0xee7a('0x1d'),_0x326fd9[_0xee7a('0x11')],_0xe6c79f);_0x476f2a(_0x3474fa[_0xee7a('0xf')](0x1f4,_0x326fd9[_0xee7a('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x28f822,_0x18d742){var _0x61ab9d=function(_0x183248){while(--_0x183248){_0x28f822['push'](_0x28f822['shift']());}};_0x61ab9d(++_0x18d742);}(_0x2ef3,0xba));var _0x32ef=function(_0x3d9f9d,_0x2691b2){_0x3d9f9d=_0x3d9f9d-0x0;var _0x48b423=_0x2ef3[_0x3d9f9d];return _0x48b423;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router;
\ No newline at end of file
+var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x5bbe37,_0x528d90){_0x5bbe37=_0x5bbe37-0x0;var _0x237047=_0x2032[_0x5bbe37];return _0x237047;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ecd=['STRING','Task','ENUM','contact_lead','contact','lead','account_contact_lead','account','nothing','exports'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x9ecd,0x185));var _0xd9ec=function(_0x224e4b,_0x4d255e){_0x224e4b=_0x224e4b-0x0;var _0x3c13cd=_0x9ecd[_0x224e4b];return _0x3c13cd;};'use strict';var Sequelize=require('sequelize');module[_0xd9ec('0x0')]={'name':{'type':Sequelize[_0xd9ec('0x1')]},'description':{'type':Sequelize[_0xd9ec('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xd9ec('0x2'),'Case'),'defaultValue':_0xd9ec('0x2')},'moduleSearch':{'type':Sequelize[_0xd9ec('0x3')](_0xd9ec('0x4'),_0xd9ec('0x5'),_0xd9ec('0x6'),_0xd9ec('0x7'),_0xd9ec('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xd9ec('0x3')](_0xd9ec('0x9'),_0xd9ec('0x5'),'lead',_0xd9ec('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xd9ec('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xd9ec('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xd9ec('0x1')]}};
\ No newline at end of file
+var _0xa63f=['sequelize','exports','STRING','ENUM','Case','contact_lead','contact','account_contact_lead','account','nothing','lead'];(function(_0x535b09,_0x4d9819){var _0x30f750=function(_0x3136e3){while(--_0x3136e3){_0x535b09['push'](_0x535b09['shift']());}};_0x30f750(++_0x4d9819);}(_0xa63f,0x1b8));var _0xfa63=function(_0x5e5b5e,_0x1d4bde){_0x5e5b5e=_0x5e5b5e-0x0;var _0x296489=_0xa63f[_0x5e5b5e];return _0x296489;};'use strict';var Sequelize=require(_0xfa63('0x0'));module[_0xfa63('0x1')]={'name':{'type':Sequelize[_0xfa63('0x2')]},'description':{'type':Sequelize[_0xfa63('0x2')]},'ticketType':{'type':Sequelize[_0xfa63('0x3')]('Task',_0xfa63('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xfa63('0x3')](_0xfa63('0x5'),_0xfa63('0x6'),'lead',_0xfa63('0x7'),_0xfa63('0x8')),'defaultValue':_0xfa63('0x5')},'moduleCreate':{'type':Sequelize[_0xfa63('0x3')](_0xfa63('0x9'),_0xfa63('0x6'),_0xfa63('0xa'),_0xfa63('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xfa63('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xfa63('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xfa63('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x855e=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','params','getFields','SalesforceField','sort','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x2dbd3d,_0x1881a8){var _0x14e894=function(_0x2745e2){while(--_0x2745e2){_0x2dbd3d['push'](_0x2dbd3d['shift']());}};_0x14e894(++_0x1881a8);}(_0x855e,0x1af));var _0xe855=function(_0x472072,_0x5add18){_0x472072=_0x472072-0x0;var _0x38ca35=_0x855e[_0x472072];return _0x38ca35;};'use strict';var emlformat=require(_0xe855('0x0'));var rimraf=require(_0xe855('0x1'));var zipdir=require(_0xe855('0x2'));var jsonpatch=require(_0xe855('0x3'));var rp=require(_0xe855('0x4'));var moment=require('moment');var BPromise=require(_0xe855('0x5'));var Mustache=require(_0xe855('0x6'));var util=require(_0xe855('0x7'));var path=require(_0xe855('0x8'));var sox=require(_0xe855('0x9'));var csv=require(_0xe855('0xa'));var ejs=require(_0xe855('0xb'));var fs=require('fs');var fs_extra=require(_0xe855('0xc'));var _=require('lodash');var squel=require(_0xe855('0xd'));var crypto=require(_0xe855('0xe'));var jsforce=require(_0xe855('0xf'));var deskjs=require(_0xe855('0x10'));var toCsv=require(_0xe855('0xa'));var querystring=require(_0xe855('0x11'));var Papa=require(_0xe855('0x12'));var Redis=require(_0xe855('0x13'));var authService=require(_0xe855('0x14'));var qs=require(_0xe855('0x15'));var as=require(_0xe855('0x16'));var hardwareService=require(_0xe855('0x17'));var logger=require(_0xe855('0x18'))(_0xe855('0x19'));var utils=require(_0xe855('0x1a'));var config=require(_0xe855('0x1b'));var licenseUtil=require(_0xe855('0x1c'));var db=require(_0xe855('0x1d'))['db'];function respondWithStatusCode(_0x1a4e9c,_0x3b38cd){_0x3b38cd=_0x3b38cd||0xcc;return function(_0x4b19b8){if(_0x4b19b8){return _0x1a4e9c[_0xe855('0x1e')](_0x3b38cd);}return _0x1a4e9c[_0xe855('0x1f')](_0x3b38cd)[_0xe855('0x20')]();};}function respondWithResult(_0x287779,_0x55af02){_0x55af02=_0x55af02||0xc8;return function(_0x548226){if(_0x548226){return _0x287779[_0xe855('0x1f')](_0x55af02)['json'](_0x548226);}};}function respondWithFilteredResult(_0x322bd9,_0x84321f){return function(_0x41be03){if(_0x41be03){var _0x51c301=typeof _0x84321f['offset']==='undefined'&&typeof _0x84321f[_0xe855('0x21')]===_0xe855('0x22');var _0x1dd64d=_0x41be03[_0xe855('0x23')];var _0xfca61b=_0x51c301?0x0:_0x84321f[_0xe855('0x24')];var _0x4e25db=_0x51c301?_0x41be03[_0xe855('0x23')]:_0x84321f[_0xe855('0x24')]+_0x84321f[_0xe855('0x21')];var _0x488806;if(_0x4e25db>=_0x1dd64d){_0x4e25db=_0x1dd64d;_0x488806=0xc8;}else{_0x488806=0xce;}_0x322bd9[_0xe855('0x1f')](_0x488806);return _0x322bd9[_0xe855('0x25')](_0xe855('0x26'),_0xfca61b+'-'+_0x4e25db+'/'+_0x1dd64d)['json'](_0x41be03);}return null;};}function patchUpdates(_0x123966){return function(_0x4abaef){try{jsonpatch['apply'](_0x4abaef,_0x123966,!![]);}catch(_0x52c2b8){return BPromise[_0xe855('0x27')](_0x52c2b8);}return _0x4abaef[_0xe855('0x28')]();};}function saveUpdates(_0x594c92,_0x14662b){return function(_0x1521e2){if(_0x1521e2){return _0x1521e2[_0xe855('0x29')](_0x594c92)[_0xe855('0x2a')](function(_0x41fca2){return _0x41fca2;});}return null;};}function removeEntity(_0x4ff8d7,_0x1600b9){return function(_0x4c7b37){if(_0x4c7b37){return _0x4c7b37[_0xe855('0x2b')]()['then'](function(){_0x4ff8d7[_0xe855('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21779b,_0x19ce35){return function(_0x3cfda5){if(!_0x3cfda5){_0x21779b[_0xe855('0x1e')](0x194);}return _0x3cfda5;};}function handleError(_0x229288,_0x264098){_0x264098=_0x264098||0x1f4;return function(_0x4bf7ee){logger[_0xe855('0x2c')](_0x4bf7ee[_0xe855('0x2d')]);if(_0x4bf7ee[_0xe855('0x2e')]){delete _0x4bf7ee[_0xe855('0x2e')];}_0x229288[_0xe855('0x1f')](_0x264098)[_0xe855('0x2f')](_0x4bf7ee);};}exports[_0xe855('0x30')]=function(_0xd1839a,_0x4f0435){var _0x279f50={},_0x24c5a7={},_0x960783={'count':0x0,'rows':[]};var _0x46a01f=_[_0xe855('0x31')](db[_0xe855('0x32')][_0xe855('0x33')],function(_0x29905d){return{'name':_0x29905d[_0xe855('0x34')],'type':_0x29905d['type'][_0xe855('0x35')]};});_0x24c5a7['model']=_['map'](_0x46a01f,'name');_0x24c5a7['query']=_[_0xe855('0x36')](_0xd1839a[_0xe855('0x37')]);_0x24c5a7[_0xe855('0x38')]=_[_0xe855('0x39')](_0x24c5a7[_0xe855('0x3a')],_0x24c5a7[_0xe855('0x37')]);_0x279f50[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x24c5a7[_0xe855('0x3a')],qs['fields'](_0xd1839a['query']['fields']));_0x279f50['attributes']=_0x279f50['attributes']['length']?_0x279f50[_0xe855('0x3b')]:_0x24c5a7[_0xe855('0x3a')];if(!_0xd1839a[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x279f50['limit']=qs[_0xe855('0x21')](_0xd1839a[_0xe855('0x37')][_0xe855('0x21')]);_0x279f50[_0xe855('0x24')]=qs[_0xe855('0x24')](_0xd1839a[_0xe855('0x37')]['offset']);}_0x279f50[_0xe855('0x3e')]=qs['sort'](_0xd1839a[_0xe855('0x37')]['sort']);_0x279f50['where']=qs[_0xe855('0x38')](_[_0xe855('0x3f')](_0xd1839a[_0xe855('0x37')],_0x24c5a7[_0xe855('0x38')]),_0x46a01f);if(_0xd1839a['query'][_0xe855('0x40')]){_0x279f50[_0xe855('0x41')]=_['merge'](_0x279f50[_0xe855('0x41')],{'$or':_['map'](_0x46a01f,function(_0x310b69){if(_0x310b69[_0xe855('0x42')]!==_0xe855('0x43')){var _0xa00ab2={};_0xa00ab2[_0x310b69[_0xe855('0x2e')]]={'$like':'%'+_0xd1839a[_0xe855('0x37')][_0xe855('0x40')]+'%'};return _0xa00ab2;}})});}_0x279f50=_[_0xe855('0x44')]({},_0x279f50,_0xd1839a[_0xe855('0x45')]);var _0xbfde21={'where':_0x279f50[_0xe855('0x41')]};return db[_0xe855('0x32')][_0xe855('0x23')](_0xbfde21)[_0xe855('0x2a')](function(_0x235264){_0x960783[_0xe855('0x23')]=_0x235264;if(_0xd1839a[_0xe855('0x37')][_0xe855('0x46')]){_0x279f50[_0xe855('0x47')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xe855('0x48')](_0x279f50);})[_0xe855('0x2a')](function(_0x5f28a9){_0x960783[_0xe855('0x49')]=_0x5f28a9;return _0x960783;})[_0xe855('0x2a')](respondWithFilteredResult(_0x4f0435,_0x279f50))[_0xe855('0x4a')](handleError(_0x4f0435,null));};exports[_0xe855('0x4b')]=function(_0xa84374,_0x1890c5){var _0x4a1c9d={'raw':![],'where':{'id':_0xa84374['params']['id']}},_0x1c213e={};_0x1c213e[_0xe855('0x3a')]=_[_0xe855('0x36')](db[_0xe855('0x32')]['rawAttributes']);_0x1c213e[_0xe855('0x37')]=_['keys'](_0xa84374[_0xe855('0x37')]);_0x1c213e[_0xe855('0x38')]=_[_0xe855('0x39')](_0x1c213e[_0xe855('0x3a')],_0x1c213e[_0xe855('0x37')]);_0x4a1c9d[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x1c213e['model'],qs[_0xe855('0x4c')](_0xa84374[_0xe855('0x37')][_0xe855('0x4c')]));_0x4a1c9d[_0xe855('0x3b')]=_0x4a1c9d[_0xe855('0x3b')][_0xe855('0x4d')]?_0x4a1c9d[_0xe855('0x3b')]:_0x1c213e[_0xe855('0x3a')];if(_0xa84374['query'][_0xe855('0x46')]){_0x4a1c9d[_0xe855('0x47')]=[{'all':!![]}];}_0x4a1c9d=_[_0xe855('0x44')]({},_0x4a1c9d,_0xa84374['options']);return db[_0xe855('0x32')][_0xe855('0x4e')](_0x4a1c9d)[_0xe855('0x2a')](handleEntityNotFound(_0x1890c5,null))[_0xe855('0x2a')](respondWithResult(_0x1890c5,null))['catch'](handleError(_0x1890c5,null));};exports['create']=function(_0x2e0e88,_0x27f14a){return db[_0xe855('0x32')][_0xe855('0x4f')](_0x2e0e88[_0xe855('0x50')],{})[_0xe855('0x2a')](respondWithResult(_0x27f14a,0xc9))[_0xe855('0x4a')](handleError(_0x27f14a,null));};exports[_0xe855('0x29')]=function(_0x567f25,_0x21511e){if(_0x567f25[_0xe855('0x50')]['id']){delete _0x567f25['body']['id'];}return db['SalesforceConfiguration'][_0xe855('0x4e')]({'where':{'id':_0x567f25[_0xe855('0x51')]['id']}})[_0xe855('0x2a')](handleEntityNotFound(_0x21511e,null))['then'](saveUpdates(_0x567f25[_0xe855('0x50')],null))[_0xe855('0x2a')](respondWithResult(_0x21511e,null))[_0xe855('0x4a')](handleError(_0x21511e,null));};exports['destroy']=function(_0x647b50,_0x7733b9){return db[_0xe855('0x32')][_0xe855('0x4e')]({'where':{'id':_0x647b50[_0xe855('0x51')]['id']}})[_0xe855('0x2a')](handleEntityNotFound(_0x7733b9,null))[_0xe855('0x2a')](removeEntity(_0x7733b9,null))[_0xe855('0x4a')](handleError(_0x7733b9,null));};exports[_0xe855('0x52')]=function(_0x59dbe2,_0x52afd1,_0x89d6cf){var _0x539957={};var _0x51e81e={};var _0x2ea5d8;var _0x430833;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x59dbe2['params']['id']}})[_0xe855('0x2a')](handleEntityNotFound(_0x52afd1,null))[_0xe855('0x2a')](function(_0x8c5910){if(_0x8c5910){_0x2ea5d8=_0x8c5910;_0x51e81e[_0xe855('0x3a')]=_[_0xe855('0x36')](db[_0xe855('0x53')]['rawAttributes']);_0x51e81e['query']=_[_0xe855('0x36')](_0x59dbe2['query']);_0x51e81e[_0xe855('0x38')]=_[_0xe855('0x39')](_0x51e81e['model'],_0x51e81e['query']);_0x539957[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x51e81e[_0xe855('0x3a')],qs[_0xe855('0x4c')](_0x59dbe2['query'][_0xe855('0x4c')]));_0x539957[_0xe855('0x3b')]=_0x539957[_0xe855('0x3b')]['length']?_0x539957[_0xe855('0x3b')]:_0x51e81e[_0xe855('0x3a')];_0x539957[_0xe855('0x3e')]=qs[_0xe855('0x54')](_0x59dbe2['query'][_0xe855('0x54')]);_0x539957[_0xe855('0x41')]=qs[_0xe855('0x38')](_[_0xe855('0x3f')](_0x59dbe2[_0xe855('0x37')],_0x51e81e['filters']));if(_0x59dbe2[_0xe855('0x37')][_0xe855('0x40')]){_0x539957[_0xe855('0x41')]=_[_0xe855('0x44')](_0x539957[_0xe855('0x41')],{'$or':_['map'](_0x539957[_0xe855('0x3b')],function(_0x584136){var _0x4c86e9={};_0x4c86e9[_0x584136]={'$like':'%'+_0x59dbe2['query'][_0xe855('0x40')]+'%'};return _0x4c86e9;})});}_0x539957=_[_0xe855('0x44')]({},_0x539957,_0x59dbe2[_0xe855('0x45')]);return _0x2ea5d8[_0xe855('0x52')](_0x539957);}})[_0xe855('0x2a')](function(_0x15b4bc){if(_0x15b4bc){_0x430833=_0x15b4bc[_0xe855('0x4d')];if(!_0x59dbe2[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x539957[_0xe855('0x21')]=qs[_0xe855('0x21')](_0x59dbe2[_0xe855('0x37')][_0xe855('0x21')]);_0x539957[_0xe855('0x24')]=qs[_0xe855('0x24')](_0x59dbe2[_0xe855('0x37')][_0xe855('0x24')]);}return _0x2ea5d8[_0xe855('0x52')](_0x539957);}})[_0xe855('0x2a')](function(_0x194f0f){if(_0x194f0f){return _0x194f0f?{'count':_0x430833,'rows':_0x194f0f}:null;}})[_0xe855('0x2a')](respondWithResult(_0x52afd1,null))[_0xe855('0x4a')](handleError(_0x52afd1,null));};exports[_0xe855('0x55')]=function(_0x307713,_0x12e0b3,_0xef4483){var _0x5c3fa3={};var _0x5ce068={};var _0x518d40;var _0xd1d9b2;return db[_0xe855('0x32')][_0xe855('0x56')]({'where':{'id':_0x307713[_0xe855('0x51')]['id']}})['then'](handleEntityNotFound(_0x12e0b3,null))['then'](function(_0x2c7721){if(_0x2c7721){_0x518d40=_0x2c7721;_0x5ce068['model']=_[_0xe855('0x36')](db[_0xe855('0x53')][_0xe855('0x33')]);_0x5ce068['query']=_[_0xe855('0x36')](_0x307713[_0xe855('0x37')]);_0x5ce068['filters']=_['intersection'](_0x5ce068[_0xe855('0x3a')],_0x5ce068['query']);_0x5c3fa3[_0xe855('0x3b')]=_[_0xe855('0x39')](_0x5ce068[_0xe855('0x3a')],qs[_0xe855('0x4c')](_0x307713[_0xe855('0x37')][_0xe855('0x4c')]));_0x5c3fa3[_0xe855('0x3b')]=_0x5c3fa3[_0xe855('0x3b')][_0xe855('0x4d')]?_0x5c3fa3[_0xe855('0x3b')]:_0x5ce068[_0xe855('0x3a')];_0x5c3fa3[_0xe855('0x3e')]=qs['sort'](_0x307713['query'][_0xe855('0x54')]);_0x5c3fa3[_0xe855('0x41')]=qs[_0xe855('0x38')](_[_0xe855('0x3f')](_0x307713[_0xe855('0x37')],_0x5ce068[_0xe855('0x38')]));if(_0x307713[_0xe855('0x37')]['filter']){_0x5c3fa3[_0xe855('0x41')]=_[_0xe855('0x44')](_0x5c3fa3['where'],{'$or':_[_0xe855('0x31')](_0x5c3fa3['attributes'],function(_0x27d36f){var _0x274374={};_0x274374[_0x27d36f]={'$like':'%'+_0x307713[_0xe855('0x37')]['filter']+'%'};return _0x274374;})});}_0x5c3fa3=_[_0xe855('0x44')]({},_0x5c3fa3,_0x307713[_0xe855('0x45')]);return _0x518d40[_0xe855('0x55')](_0x5c3fa3);}})[_0xe855('0x2a')](function(_0x406c79){if(_0x406c79){_0xd1d9b2=_0x406c79[_0xe855('0x4d')];if(!_0x307713[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x5c3fa3['limit']=qs[_0xe855('0x21')](_0x307713[_0xe855('0x37')][_0xe855('0x21')]);_0x5c3fa3[_0xe855('0x24')]=qs[_0xe855('0x24')](_0x307713[_0xe855('0x37')][_0xe855('0x24')]);}return _0x518d40[_0xe855('0x55')](_0x5c3fa3);}})[_0xe855('0x2a')](function(_0x115958){if(_0x115958){return _0x115958?{'count':_0xd1d9b2,'rows':_0x115958}:null;}})['then'](respondWithResult(_0x12e0b3,null))[_0xe855('0x4a')](handleError(_0x12e0b3,null));};exports[_0xe855('0x57')]=function(_0x2c44a3,_0x38146d,_0x34ef7e){var _0x26e151={};var _0x3c7d09={};var _0x3d847a;var _0x1c194d;return db['SalesforceConfiguration'][_0xe855('0x56')]({'where':{'id':_0x2c44a3[_0xe855('0x51')]['id']}})['then'](handleEntityNotFound(_0x38146d,null))['then'](function(_0x4a4999){if(_0x4a4999){_0x3d847a=_0x4a4999;_0x3c7d09[_0xe855('0x3a')]=_[_0xe855('0x36')](db['SalesforceField'][_0xe855('0x33')]);_0x3c7d09[_0xe855('0x37')]=_[_0xe855('0x36')](_0x2c44a3[_0xe855('0x37')]);_0x3c7d09[_0xe855('0x38')]=_[_0xe855('0x39')](_0x3c7d09[_0xe855('0x3a')],_0x3c7d09[_0xe855('0x37')]);_0x26e151['attributes']=_[_0xe855('0x39')](_0x3c7d09['model'],qs['fields'](_0x2c44a3[_0xe855('0x37')]['fields']));_0x26e151[_0xe855('0x3b')]=_0x26e151[_0xe855('0x3b')][_0xe855('0x4d')]?_0x26e151['attributes']:_0x3c7d09['model'];_0x26e151[_0xe855('0x3e')]=qs[_0xe855('0x54')](_0x2c44a3['query']['sort']);_0x26e151[_0xe855('0x41')]=qs['filters'](_[_0xe855('0x3f')](_0x2c44a3[_0xe855('0x37')],_0x3c7d09[_0xe855('0x38')]));if(_0x2c44a3[_0xe855('0x37')]['filter']){_0x26e151[_0xe855('0x41')]=_[_0xe855('0x44')](_0x26e151[_0xe855('0x41')],{'$or':_['map'](_0x26e151['attributes'],function(_0x2e0e8e){var _0x337ee7={};_0x337ee7[_0x2e0e8e]={'$like':'%'+_0x2c44a3['query'][_0xe855('0x40')]+'%'};return _0x337ee7;})});}_0x26e151=_[_0xe855('0x44')]({},_0x26e151,_0x2c44a3[_0xe855('0x45')]);return _0x3d847a[_0xe855('0x57')](_0x26e151);}})[_0xe855('0x2a')](function(_0x13c8b8){if(_0x13c8b8){_0x1c194d=_0x13c8b8['length'];if(!_0x2c44a3[_0xe855('0x37')][_0xe855('0x3c')](_0xe855('0x3d'))){_0x26e151['limit']=qs[_0xe855('0x21')](_0x2c44a3['query'][_0xe855('0x21')]);_0x26e151[_0xe855('0x24')]=qs['offset'](_0x2c44a3[_0xe855('0x37')][_0xe855('0x24')]);}return _0x3d847a['getDescriptions'](_0x26e151);}})[_0xe855('0x2a')](function(_0xf2281){if(_0xf2281){return _0xf2281?{'count':_0x1c194d,'rows':_0xf2281}:null;}})[_0xe855('0x2a')](respondWithResult(_0x38146d,null))[_0xe855('0x4a')](handleError(_0x38146d,null));};
\ No newline at end of file
+var _0x4755=['error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SalesforceConfiguration','then','includeAll','findAll','rows','catch','show','params','options','find','create','body','findOne','SalesforceField','hasOwnProperty','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x4755,0x11e));var _0x5475=function(_0x114bdf,_0x119ada){_0x114bdf=_0x114bdf-0x0;var _0x5658f6=_0x4755[_0x114bdf];return _0x5658f6;};'use strict';var emlformat=require(_0x5475('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5475('0x1'));var jsonpatch=require(_0x5475('0x2'));var rp=require(_0x5475('0x3'));var moment=require(_0x5475('0x4'));var BPromise=require(_0x5475('0x5'));var Mustache=require('mustache');var util=require(_0x5475('0x6'));var path=require(_0x5475('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5475('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5475('0x9'));var squel=require(_0x5475('0xa'));var crypto=require(_0x5475('0xb'));var jsforce=require(_0x5475('0xc'));var deskjs=require(_0x5475('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5475('0xe'));var Papa=require(_0x5475('0xf'));var Redis=require('ioredis');var authService=require(_0x5475('0x10'));var qs=require(_0x5475('0x11'));var as=require(_0x5475('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5475('0x13'))(_0x5475('0x14'));var utils=require('../../config/utils');var config=require(_0x5475('0x15'));var licenseUtil=require(_0x5475('0x16'));var db=require(_0x5475('0x17'))['db'];function respondWithStatusCode(_0x5c8115,_0x31d077){_0x31d077=_0x31d077||0xcc;return function(_0xbaa7e1){if(_0xbaa7e1){return _0x5c8115[_0x5475('0x18')](_0x31d077);}return _0x5c8115['status'](_0x31d077)['end']();};}function respondWithResult(_0x193846,_0x5b8f79){_0x5b8f79=_0x5b8f79||0xc8;return function(_0x3e73df){if(_0x3e73df){return _0x193846[_0x5475('0x19')](_0x5b8f79)[_0x5475('0x1a')](_0x3e73df);}};}function respondWithFilteredResult(_0x53eef5,_0x5d6fed){return function(_0x1550b6){if(_0x1550b6){var _0xbc8e7c=typeof _0x5d6fed[_0x5475('0x1b')]===_0x5475('0x1c')&&typeof _0x5d6fed[_0x5475('0x1d')]===_0x5475('0x1c');var _0x312c87=_0x1550b6[_0x5475('0x1e')];var _0x88e129=_0xbc8e7c?0x0:_0x5d6fed[_0x5475('0x1b')];var _0x24d893=_0xbc8e7c?_0x1550b6['count']:_0x5d6fed[_0x5475('0x1b')]+_0x5d6fed['limit'];var _0x438ff8;if(_0x24d893>=_0x312c87){_0x24d893=_0x312c87;_0x438ff8=0xc8;}else{_0x438ff8=0xce;}_0x53eef5[_0x5475('0x19')](_0x438ff8);return _0x53eef5[_0x5475('0x1f')]('Content-Range',_0x88e129+'-'+_0x24d893+'/'+_0x312c87)[_0x5475('0x1a')](_0x1550b6);}return null;};}function patchUpdates(_0x507319){return function(_0x2c4a0a){try{jsonpatch[_0x5475('0x20')](_0x2c4a0a,_0x507319,!![]);}catch(_0x52c586){return BPromise[_0x5475('0x21')](_0x52c586);}return _0x2c4a0a[_0x5475('0x22')]();};}function saveUpdates(_0x59f2c5,_0x1f7f12){return function(_0x1e205e){if(_0x1e205e){return _0x1e205e[_0x5475('0x23')](_0x59f2c5)['then'](function(_0x5292bd){return _0x5292bd;});}return null;};}function removeEntity(_0x55fbd0,_0xda8d5f){return function(_0x3d78c0){if(_0x3d78c0){return _0x3d78c0[_0x5475('0x24')]()['then'](function(){_0x55fbd0[_0x5475('0x19')](0xcc)[_0x5475('0x25')]();});}};}function handleEntityNotFound(_0xfd353a,_0x56dbf2){return function(_0x2aefab){if(!_0x2aefab){_0xfd353a[_0x5475('0x18')](0x194);}return _0x2aefab;};}function handleError(_0x34f839,_0x36cc4a){_0x36cc4a=_0x36cc4a||0x1f4;return function(_0x40a79c){logger[_0x5475('0x26')](_0x40a79c[_0x5475('0x27')]);if(_0x40a79c[_0x5475('0x28')]){delete _0x40a79c[_0x5475('0x28')];}_0x34f839[_0x5475('0x19')](_0x36cc4a)[_0x5475('0x29')](_0x40a79c);};}exports['index']=function(_0x357ef4,_0x158915){var _0x39578c={},_0x1f7613={},_0x5cc94d={'count':0x0,'rows':[]};var _0x51c422=_['map'](db['SalesforceConfiguration'][_0x5475('0x2a')],function(_0x57cd3e){return{'name':_0x57cd3e[_0x5475('0x2b')],'type':_0x57cd3e[_0x5475('0x2c')][_0x5475('0x2d')]};});_0x1f7613[_0x5475('0x2e')]=_[_0x5475('0x2f')](_0x51c422,_0x5475('0x28'));_0x1f7613[_0x5475('0x30')]=_[_0x5475('0x31')](_0x357ef4[_0x5475('0x30')]);_0x1f7613['filters']=_[_0x5475('0x32')](_0x1f7613['model'],_0x1f7613[_0x5475('0x30')]);_0x39578c[_0x5475('0x33')]=_['intersection'](_0x1f7613[_0x5475('0x2e')],qs[_0x5475('0x34')](_0x357ef4['query'][_0x5475('0x34')]));_0x39578c[_0x5475('0x33')]=_0x39578c[_0x5475('0x33')][_0x5475('0x35')]?_0x39578c[_0x5475('0x33')]:_0x1f7613[_0x5475('0x2e')];if(!_0x357ef4[_0x5475('0x30')]['hasOwnProperty'](_0x5475('0x36'))){_0x39578c[_0x5475('0x1d')]=qs[_0x5475('0x1d')](_0x357ef4[_0x5475('0x30')][_0x5475('0x1d')]);_0x39578c[_0x5475('0x1b')]=qs['offset'](_0x357ef4[_0x5475('0x30')][_0x5475('0x1b')]);}_0x39578c[_0x5475('0x37')]=qs[_0x5475('0x38')](_0x357ef4[_0x5475('0x30')]['sort']);_0x39578c[_0x5475('0x39')]=qs[_0x5475('0x3a')](_[_0x5475('0x3b')](_0x357ef4[_0x5475('0x30')],_0x1f7613['filters']),_0x51c422);if(_0x357ef4[_0x5475('0x30')][_0x5475('0x3c')]){_0x39578c[_0x5475('0x39')]=_[_0x5475('0x3d')](_0x39578c['where'],{'$or':_[_0x5475('0x2f')](_0x51c422,function(_0x21ea39){if(_0x21ea39[_0x5475('0x2c')]!==_0x5475('0x3e')){var _0x554f2f={};_0x554f2f[_0x21ea39[_0x5475('0x28')]]={'$like':'%'+_0x357ef4[_0x5475('0x30')][_0x5475('0x3c')]+'%'};return _0x554f2f;}})});}_0x39578c=_[_0x5475('0x3d')]({},_0x39578c,_0x357ef4['options']);var _0x48943d={'where':_0x39578c[_0x5475('0x39')]};return db[_0x5475('0x3f')]['count'](_0x48943d)[_0x5475('0x40')](function(_0x5c7708){_0x5cc94d['count']=_0x5c7708;if(_0x357ef4['query'][_0x5475('0x41')]){_0x39578c['include']=[{'all':!![]}];}return db[_0x5475('0x3f')][_0x5475('0x42')](_0x39578c);})[_0x5475('0x40')](function(_0x3e57b3){_0x5cc94d[_0x5475('0x43')]=_0x3e57b3;return _0x5cc94d;})[_0x5475('0x40')](respondWithFilteredResult(_0x158915,_0x39578c))[_0x5475('0x44')](handleError(_0x158915,null));};exports[_0x5475('0x45')]=function(_0x3313a7,_0x4f5a23){var _0x46767e={'raw':![],'where':{'id':_0x3313a7[_0x5475('0x46')]['id']}},_0x46f79d={};_0x46f79d[_0x5475('0x2e')]=_['keys'](db['SalesforceConfiguration'][_0x5475('0x2a')]);_0x46f79d[_0x5475('0x30')]=_['keys'](_0x3313a7[_0x5475('0x30')]);_0x46f79d['filters']=_[_0x5475('0x32')](_0x46f79d[_0x5475('0x2e')],_0x46f79d[_0x5475('0x30')]);_0x46767e[_0x5475('0x33')]=_[_0x5475('0x32')](_0x46f79d[_0x5475('0x2e')],qs[_0x5475('0x34')](_0x3313a7['query'][_0x5475('0x34')]));_0x46767e[_0x5475('0x33')]=_0x46767e['attributes'][_0x5475('0x35')]?_0x46767e[_0x5475('0x33')]:_0x46f79d['model'];if(_0x3313a7[_0x5475('0x30')][_0x5475('0x41')]){_0x46767e['include']=[{'all':!![]}];}_0x46767e=_[_0x5475('0x3d')]({},_0x46767e,_0x3313a7[_0x5475('0x47')]);return db[_0x5475('0x3f')][_0x5475('0x48')](_0x46767e)[_0x5475('0x40')](handleEntityNotFound(_0x4f5a23,null))['then'](respondWithResult(_0x4f5a23,null))[_0x5475('0x44')](handleError(_0x4f5a23,null));};exports[_0x5475('0x49')]=function(_0x36e02d,_0x20edf4){return db[_0x5475('0x3f')][_0x5475('0x49')](_0x36e02d[_0x5475('0x4a')],{})[_0x5475('0x40')](respondWithResult(_0x20edf4,0xc9))[_0x5475('0x44')](handleError(_0x20edf4,null));};exports[_0x5475('0x23')]=function(_0x46a4d9,_0x15ba8c){if(_0x46a4d9[_0x5475('0x4a')]['id']){delete _0x46a4d9['body']['id'];}return db[_0x5475('0x3f')][_0x5475('0x48')]({'where':{'id':_0x46a4d9[_0x5475('0x46')]['id']}})['then'](handleEntityNotFound(_0x15ba8c,null))[_0x5475('0x40')](saveUpdates(_0x46a4d9[_0x5475('0x4a')],null))['then'](respondWithResult(_0x15ba8c,null))[_0x5475('0x44')](handleError(_0x15ba8c,null));};exports['destroy']=function(_0xd7fd25,_0x3fdd9f){return db[_0x5475('0x3f')][_0x5475('0x48')]({'where':{'id':_0xd7fd25[_0x5475('0x46')]['id']}})[_0x5475('0x40')](handleEntityNotFound(_0x3fdd9f,null))['then'](removeEntity(_0x3fdd9f,null))['catch'](handleError(_0x3fdd9f,null));};exports['getFields']=function(_0x3e1e8e,_0xb068bc,_0x7a152a){var _0x59172e={};var _0x12918f={};var _0x2ee6bf;var _0x11dc23;return db[_0x5475('0x3f')][_0x5475('0x4b')]({'where':{'id':_0x3e1e8e[_0x5475('0x46')]['id']}})[_0x5475('0x40')](handleEntityNotFound(_0xb068bc,null))[_0x5475('0x40')](function(_0x39ec1e){if(_0x39ec1e){_0x2ee6bf=_0x39ec1e;_0x12918f[_0x5475('0x2e')]=_[_0x5475('0x31')](db[_0x5475('0x4c')]['rawAttributes']);_0x12918f[_0x5475('0x30')]=_['keys'](_0x3e1e8e['query']);_0x12918f[_0x5475('0x3a')]=_[_0x5475('0x32')](_0x12918f[_0x5475('0x2e')],_0x12918f['query']);_0x59172e[_0x5475('0x33')]=_[_0x5475('0x32')](_0x12918f[_0x5475('0x2e')],qs['fields'](_0x3e1e8e[_0x5475('0x30')][_0x5475('0x34')]));_0x59172e[_0x5475('0x33')]=_0x59172e[_0x5475('0x33')]['length']?_0x59172e[_0x5475('0x33')]:_0x12918f['model'];_0x59172e[_0x5475('0x37')]=qs['sort'](_0x3e1e8e[_0x5475('0x30')]['sort']);_0x59172e['where']=qs['filters'](_['pick'](_0x3e1e8e['query'],_0x12918f[_0x5475('0x3a')]));if(_0x3e1e8e[_0x5475('0x30')][_0x5475('0x3c')]){_0x59172e[_0x5475('0x39')]=_[_0x5475('0x3d')](_0x59172e['where'],{'$or':_[_0x5475('0x2f')](_0x59172e['attributes'],function(_0x5caa52){var _0x1886bc={};_0x1886bc[_0x5caa52]={'$like':'%'+_0x3e1e8e[_0x5475('0x30')][_0x5475('0x3c')]+'%'};return _0x1886bc;})});}_0x59172e=_['merge']({},_0x59172e,_0x3e1e8e[_0x5475('0x47')]);return _0x2ee6bf['getFields'](_0x59172e);}})[_0x5475('0x40')](function(_0x53deaa){if(_0x53deaa){_0x11dc23=_0x53deaa[_0x5475('0x35')];if(!_0x3e1e8e['query'][_0x5475('0x4d')]('nolimit')){_0x59172e['limit']=qs[_0x5475('0x1d')](_0x3e1e8e[_0x5475('0x30')][_0x5475('0x1d')]);_0x59172e[_0x5475('0x1b')]=qs[_0x5475('0x1b')](_0x3e1e8e['query']['offset']);}return _0x2ee6bf[_0x5475('0x4e')](_0x59172e);}})[_0x5475('0x40')](function(_0x2becf8){if(_0x2becf8){return _0x2becf8?{'count':_0x11dc23,'rows':_0x2becf8}:null;}})[_0x5475('0x40')](respondWithResult(_0xb068bc,null))[_0x5475('0x44')](handleError(_0xb068bc,null));};exports[_0x5475('0x4f')]=function(_0x3153f3,_0x3b0415,_0x2dd231){var _0x56ef44={};var _0x50c1ef={};var _0x1ff68c;var _0x5cc6d2;return db[_0x5475('0x3f')][_0x5475('0x4b')]({'where':{'id':_0x3153f3['params']['id']}})[_0x5475('0x40')](handleEntityNotFound(_0x3b0415,null))[_0x5475('0x40')](function(_0x314cae){if(_0x314cae){_0x1ff68c=_0x314cae;_0x50c1ef['model']=_[_0x5475('0x31')](db['SalesforceField'][_0x5475('0x2a')]);_0x50c1ef[_0x5475('0x30')]=_['keys'](_0x3153f3[_0x5475('0x30')]);_0x50c1ef[_0x5475('0x3a')]=_[_0x5475('0x32')](_0x50c1ef['model'],_0x50c1ef[_0x5475('0x30')]);_0x56ef44[_0x5475('0x33')]=_[_0x5475('0x32')](_0x50c1ef['model'],qs[_0x5475('0x34')](_0x3153f3[_0x5475('0x30')]['fields']));_0x56ef44['attributes']=_0x56ef44[_0x5475('0x33')][_0x5475('0x35')]?_0x56ef44['attributes']:_0x50c1ef[_0x5475('0x2e')];_0x56ef44[_0x5475('0x37')]=qs['sort'](_0x3153f3[_0x5475('0x30')][_0x5475('0x38')]);_0x56ef44[_0x5475('0x39')]=qs[_0x5475('0x3a')](_[_0x5475('0x3b')](_0x3153f3['query'],_0x50c1ef[_0x5475('0x3a')]));if(_0x3153f3[_0x5475('0x30')][_0x5475('0x3c')]){_0x56ef44['where']=_[_0x5475('0x3d')](_0x56ef44[_0x5475('0x39')],{'$or':_[_0x5475('0x2f')](_0x56ef44[_0x5475('0x33')],function(_0x43607a){var _0x497557={};_0x497557[_0x43607a]={'$like':'%'+_0x3153f3[_0x5475('0x30')][_0x5475('0x3c')]+'%'};return _0x497557;})});}_0x56ef44=_[_0x5475('0x3d')]({},_0x56ef44,_0x3153f3['options']);return _0x1ff68c[_0x5475('0x4f')](_0x56ef44);}})[_0x5475('0x40')](function(_0x22d3a4){if(_0x22d3a4){_0x5cc6d2=_0x22d3a4[_0x5475('0x35')];if(!_0x3153f3[_0x5475('0x30')][_0x5475('0x4d')](_0x5475('0x36'))){_0x56ef44[_0x5475('0x1d')]=qs['limit'](_0x3153f3[_0x5475('0x30')][_0x5475('0x1d')]);_0x56ef44['offset']=qs['offset'](_0x3153f3['query'][_0x5475('0x1b')]);}return _0x1ff68c[_0x5475('0x4f')](_0x56ef44);}})[_0x5475('0x40')](function(_0x18243e){if(_0x18243e){return _0x18243e?{'count':_0x5cc6d2,'rows':_0x18243e}:null;}})[_0x5475('0x40')](respondWithResult(_0x3b0415,null))[_0x5475('0x44')](handleError(_0x3b0415,null));};exports[_0x5475('0x50')]=function(_0x754887,_0x5d533f,_0x40ae0c){var _0x209e73={};var _0x5afd14={};var _0x2c77a9;var _0x48ebe1;return db[_0x5475('0x3f')][_0x5475('0x4b')]({'where':{'id':_0x754887[_0x5475('0x46')]['id']}})[_0x5475('0x40')](handleEntityNotFound(_0x5d533f,null))[_0x5475('0x40')](function(_0x509cd){if(_0x509cd){_0x2c77a9=_0x509cd;_0x5afd14[_0x5475('0x2e')]=_[_0x5475('0x31')](db['SalesforceField']['rawAttributes']);_0x5afd14[_0x5475('0x30')]=_[_0x5475('0x31')](_0x754887[_0x5475('0x30')]);_0x5afd14['filters']=_[_0x5475('0x32')](_0x5afd14['model'],_0x5afd14[_0x5475('0x30')]);_0x209e73[_0x5475('0x33')]=_[_0x5475('0x32')](_0x5afd14[_0x5475('0x2e')],qs[_0x5475('0x34')](_0x754887[_0x5475('0x30')]['fields']));_0x209e73[_0x5475('0x33')]=_0x209e73[_0x5475('0x33')][_0x5475('0x35')]?_0x209e73['attributes']:_0x5afd14[_0x5475('0x2e')];_0x209e73['order']=qs[_0x5475('0x38')](_0x754887[_0x5475('0x30')][_0x5475('0x38')]);_0x209e73[_0x5475('0x39')]=qs[_0x5475('0x3a')](_['pick'](_0x754887[_0x5475('0x30')],_0x5afd14[_0x5475('0x3a')]));if(_0x754887[_0x5475('0x30')][_0x5475('0x3c')]){_0x209e73[_0x5475('0x39')]=_[_0x5475('0x3d')](_0x209e73['where'],{'$or':_['map'](_0x209e73[_0x5475('0x33')],function(_0x5395b0){var _0x34d948={};_0x34d948[_0x5395b0]={'$like':'%'+_0x754887[_0x5475('0x30')][_0x5475('0x3c')]+'%'};return _0x34d948;})});}_0x209e73=_['merge']({},_0x209e73,_0x754887[_0x5475('0x47')]);return _0x2c77a9[_0x5475('0x50')](_0x209e73);}})[_0x5475('0x40')](function(_0x414ebb){if(_0x414ebb){_0x48ebe1=_0x414ebb['length'];if(!_0x754887[_0x5475('0x30')]['hasOwnProperty'](_0x5475('0x36'))){_0x209e73[_0x5475('0x1d')]=qs[_0x5475('0x1d')](_0x754887[_0x5475('0x30')][_0x5475('0x1d')]);_0x209e73['offset']=qs[_0x5475('0x1b')](_0x754887[_0x5475('0x30')][_0x5475('0x1b')]);}return _0x2c77a9['getDescriptions'](_0x209e73);}})['then'](function(_0x42e553){if(_0x42e553){return _0x42e553?{'count':_0x48ebe1,'rows':_0x42e553}:null;}})[_0x5475('0x40')](respondWithResult(_0x5d533f,null))[_0x5475('0x44')](handleError(_0x5d533f,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1ed=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','../../config/logger'];(function(_0x5375fd,_0x50887f){var _0x142671=function(_0x1f6139){while(--_0x1f6139){_0x5375fd['push'](_0x5375fd['shift']());}};_0x142671(++_0x50887f);}(_0xb1ed,0x8b));var _0xdb1e=function(_0x96691d,_0x544a9d){_0x96691d=_0x96691d-0x0;var _0x5a79ca=_0xb1ed[_0x96691d];return _0x5a79ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb1e('0x0'))('api');var moment=require('moment');var BPromise=require(_0xdb1e('0x1'));var rp=require(_0xdb1e('0x2'));var fs=require('fs');var path=require(_0xdb1e('0x3'));var rimraf=require(_0xdb1e('0x4'));var config=require(_0xdb1e('0x5'));var attributes=require(_0xdb1e('0x6'));module[_0xdb1e('0x7')]=function(_0x5bcc39,_0x250622){return _0x5bcc39[_0xdb1e('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xdb1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe7e=['api','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','util','../../config/logger'];(function(_0x10f662,_0xf8258a){var _0x1523bb=function(_0x148211){while(--_0x148211){_0x10f662['push'](_0x10f662['shift']());}};_0x1523bb(++_0xf8258a);}(_0xfe7e,0x1e2));var _0xefe7=function(_0x271ee4,_0x456d3b){_0x271ee4=_0x271ee4-0x0;var _0x512256=_0xfe7e[_0x271ee4];return _0x512256;};'use strict';var _=require('lodash');var util=require(_0xefe7('0x0'));var logger=require(_0xefe7('0x1'))(_0xefe7('0x2'));var moment=require('moment');var BPromise=require(_0xefe7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefe7('0x4'));var rimraf=require(_0xefe7('0x5'));var config=require(_0xefe7('0x6'));var attributes=require(_0xefe7('0x7'));module[_0xefe7('0x8')]=function(_0x3022d0,_0x51a86f){return _0x3022d0[_0xefe7('0x9')](_0xefe7('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd6ef=['SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45cd1e,_0x43d3be){var _0x861aed=function(_0x242c86){while(--_0x242c86){_0x45cd1e['push'](_0x45cd1e['shift']());}};_0x861aed(++_0x43d3be);}(_0xd6ef,0x167));var _0xfd6e=function(_0x4985d6,_0x2aa916){_0x4985d6=_0x4985d6-0x0;var _0x94b0db=_0xd6ef[_0x4985d6];return _0x94b0db;};'use strict';var _=require(_0xfd6e('0x0'));var util=require(_0xfd6e('0x1'));var moment=require(_0xfd6e('0x2'));var BPromise=require(_0xfd6e('0x3'));var rs=require(_0xfd6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd6e('0x5'))['db'];var utils=require(_0xfd6e('0x6'));var logger=require(_0xfd6e('0x7'))(_0xfd6e('0x8'));var config=require(_0xfd6e('0x9'));var jayson=require(_0xfd6e('0xa'));var client=jayson[_0xfd6e('0xb')][_0xfd6e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ce61e,_0x5a7c98,_0x4fa6d7){return new BPromise(function(_0x253f92,_0x3c26df){return client[_0xfd6e('0xd')](_0x2ce61e,_0x4fa6d7)[_0xfd6e('0xe')](function(_0x55f76c){logger[_0xfd6e('0xf')](_0xfd6e('0x10'),_0x5a7c98,'request\x20sent');logger[_0xfd6e('0x11')](_0xfd6e('0x12'),_0x5a7c98,'request\x20sent',JSON[_0xfd6e('0x13')](_0x55f76c));if(_0x55f76c[_0xfd6e('0x14')]){if(_0x55f76c[_0xfd6e('0x14')][_0xfd6e('0x15')]===0x1f4){logger[_0xfd6e('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a7c98,_0x55f76c[_0xfd6e('0x14')]['message']);return _0x3c26df(_0x55f76c[_0xfd6e('0x14')][_0xfd6e('0x16')]);}logger[_0xfd6e('0x14')](_0xfd6e('0x10'),_0x5a7c98,_0x55f76c[_0xfd6e('0x14')][_0xfd6e('0x16')]);return _0x253f92(_0x55f76c['error'][_0xfd6e('0x16')]);}else{logger[_0xfd6e('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a7c98,_0xfd6e('0x17'));_0x253f92(_0x55f76c['result'][_0xfd6e('0x16')]);}})[_0xfd6e('0x18')](function(_0x3a6714){logger[_0xfd6e('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a7c98,_0x3a6714);_0x3c26df(_0x3a6714);});});}
\ No newline at end of file
+var _0x2f17=['jayson/promise','client','http','request','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f17,0x1b1));var _0x72f1=function(_0x52cba5,_0x108107){_0x52cba5=_0x52cba5-0x0;var _0x191995=_0x2f17[_0x52cba5];return _0x191995;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x72f1('0x0'));var BPromise=require(_0x72f1('0x1'));var rs=require(_0x72f1('0x2'));var fs=require('fs');var Redis=require(_0x72f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x72f1('0x4'))(_0x72f1('0x5'));var config=require(_0x72f1('0x6'));var jayson=require(_0x72f1('0x7'));var client=jayson[_0x72f1('0x8')][_0x72f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27a601,_0x2c8797,_0x4eb11f){return new BPromise(function(_0xb2ff40,_0x29305f){return client[_0x72f1('0xa')](_0x27a601,_0x4eb11f)['then'](function(_0x142481){logger[_0x72f1('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2c8797,_0x72f1('0xc'));logger['debug'](_0x72f1('0xd'),_0x2c8797,_0x72f1('0xc'),JSON[_0x72f1('0xe')](_0x142481));if(_0x142481['error']){if(_0x142481[_0x72f1('0xf')][_0x72f1('0x10')]===0x1f4){logger['error'](_0x72f1('0x11'),_0x2c8797,_0x142481[_0x72f1('0xf')][_0x72f1('0x12')]);return _0x29305f(_0x142481['error']['message']);}logger[_0x72f1('0xf')](_0x72f1('0x11'),_0x2c8797,_0x142481[_0x72f1('0xf')][_0x72f1('0x12')]);return _0xb2ff40(_0x142481[_0x72f1('0xf')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2c8797,'request\x20sent');_0xb2ff40(_0x142481['result'][_0x72f1('0x12')]);}})[_0x72f1('0x13')](function(_0x58dea4){logger[_0x72f1('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2c8797,_0x58dea4);_0x29305f(_0x58dea4);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1417=['show','post','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1b17b2,_0x3cd228){var _0x2d1db6=function(_0x283073){while(--_0x283073){_0x1b17b2['push'](_0x1b17b2['shift']());}};_0x2d1db6(++_0x3cd228);}(_0x1417,0x113));var _0x7141=function(_0x513f94,_0x3133ef){_0x513f94=_0x513f94-0x0;var _0x3ff78e=_0x1417[_0x513f94];return _0x3ff78e;};'use strict';var multer=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var path=require(_0x7141('0x2'));var timeout=require(_0x7141('0x3'));var express=require(_0x7141('0x4'));var router=express[_0x7141('0x5')]();var fs_extra=require(_0x7141('0x6'));var auth=require(_0x7141('0x7'));var interaction=require(_0x7141('0x8'));var config=require(_0x7141('0x9'));var controller=require('./intSalesforceField.controller');router[_0x7141('0xa')]('/',auth[_0x7141('0xb')](),controller[_0x7141('0xc')]);router['get']('/:id',auth[_0x7141('0xb')](),controller[_0x7141('0xd')]);router[_0x7141('0xe')]('/',auth[_0x7141('0xb')](),controller['create']);router['put'](_0x7141('0xf'),auth[_0x7141('0xb')](),controller['update']);router['delete'](_0x7141('0xf'),auth[_0x7141('0xb')](),controller[_0x7141('0x10')]);module[_0x7141('0x11')]=router;
\ No newline at end of file
+var _0x5ca0=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a25d4,_0x1fc976){var _0x61cdad=function(_0x2fcbf2){while(--_0x2fcbf2){_0x2a25d4['push'](_0x2a25d4['shift']());}};_0x61cdad(++_0x1fc976);}(_0x5ca0,0x189));var _0x05ca=function(_0x322ccc,_0x2270e3){_0x322ccc=_0x322ccc-0x0;var _0x4a4d3f=_0x5ca0[_0x322ccc];return _0x4a4d3f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x05ca('0x0'));var timeout=require(_0x05ca('0x1'));var express=require(_0x05ca('0x2'));var router=express[_0x05ca('0x3')]();var fs_extra=require(_0x05ca('0x4'));var auth=require(_0x05ca('0x5'));var interaction=require(_0x05ca('0x6'));var config=require(_0x05ca('0x7'));var controller=require(_0x05ca('0x8'));router[_0x05ca('0x9')]('/',auth[_0x05ca('0xa')](),controller[_0x05ca('0xb')]);router[_0x05ca('0x9')](_0x05ca('0xc'),auth[_0x05ca('0xa')](),controller[_0x05ca('0xd')]);router[_0x05ca('0xe')]('/',auth[_0x05ca('0xa')](),controller[_0x05ca('0xf')]);router[_0x05ca('0x10')](_0x05ca('0xc'),auth[_0x05ca('0xa')](),controller[_0x05ca('0x11')]);router['delete'](_0x05ca('0xc'),auth['isAuthenticated'](),controller[_0x05ca('0x12')]);module[_0x05ca('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb4f=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0xe92c5a,_0x18e52f){var _0x40c1bc=function(_0x5eb609){while(--_0x5eb609){_0xe92c5a['push'](_0xe92c5a['shift']());}};_0x40c1bc(++_0x18e52f);}(_0xbb4f,0x192));var _0xfbb4=function(_0x3d3a2a,_0x83b460){_0x3d3a2a=_0x3d3a2a-0x0;var _0x428045=_0xbb4f[_0x3d3a2a];return _0x428045;};'use strict';var Sequelize=require(_0xfbb4('0x0'));module[_0xfbb4('0x1')]={'type':{'type':Sequelize[_0xfbb4('0x2')](_0xfbb4('0x3'),_0xfbb4('0x4'),_0xfbb4('0x5'),_0xfbb4('0x6'),_0xfbb4('0x7')),'defaultValue':_0xfbb4('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfbb4('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfbb4('0x4'),_0xfbb4('0x5'))},'keyContent':{'type':Sequelize[_0xfbb4('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xfbb4('0x8')]}};
\ No newline at end of file
+var _0x5967=['picklist','string','STRING','customVariable','sequelize','exports','ENUM','variable','keyValue'];(function(_0x135e9e,_0x3b939c){var _0x4c625e=function(_0x2e978e){while(--_0x2e978e){_0x135e9e['push'](_0x135e9e['shift']());}};_0x4c625e(++_0x3b939c);}(_0x5967,0x1ea));var _0x7596=function(_0x31b913,_0x3383b5){_0x31b913=_0x31b913-0x0;var _0x198a80=_0x5967[_0x31b913];return _0x198a80;};'use strict';var Sequelize=require(_0x7596('0x0'));module[_0x7596('0x1')]={'type':{'type':Sequelize[_0x7596('0x2')]('string',_0x7596('0x3'),'customVariable',_0x7596('0x4'),_0x7596('0x5')),'defaultValue':_0x7596('0x6')},'content':{'type':Sequelize[_0x7596('0x7')]},'key':{'type':Sequelize[_0x7596('0x7')]},'keyType':{'type':Sequelize[_0x7596('0x2')](_0x7596('0x6'),'variable',_0x7596('0x8'))},'keyContent':{'type':Sequelize[_0x7596('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc9f=['jsforce','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','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','include','findAll','catch','keys','intersection','create','body','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x45029d,_0x3c7d08){var _0x5af9a9=function(_0x24c1cf){while(--_0x24c1cf){_0x45029d['push'](_0x45029d['shift']());}};_0x5af9a9(++_0x3c7d08);}(_0xfc9f,0x11d));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xffc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffc9('0x1'));var jsonpatch=require(_0xffc9('0x2'));var rp=require(_0xffc9('0x3'));var moment=require(_0xffc9('0x4'));var BPromise=require(_0xffc9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xffc9('0x6'));var ejs=require(_0xffc9('0x7'));var fs=require('fs');var fs_extra=require(_0xffc9('0x8'));var _=require('lodash');var squel=require(_0xffc9('0x9'));var crypto=require(_0xffc9('0xa'));var jsforce=require(_0xffc9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xffc9('0x6'));var querystring=require('querystring');var Papa=require(_0xffc9('0xc'));var Redis=require(_0xffc9('0xd'));var authService=require(_0xffc9('0xe'));var qs=require(_0xffc9('0xf'));var as=require(_0xffc9('0x10'));var hardwareService=require(_0xffc9('0x11'));var logger=require(_0xffc9('0x12'))(_0xffc9('0x13'));var utils=require(_0xffc9('0x14'));var config=require(_0xffc9('0x15'));var licenseUtil=require(_0xffc9('0x16'));var db=require(_0xffc9('0x17'))['db'];function respondWithStatusCode(_0x3dc9c6,_0x25e2a3){_0x25e2a3=_0x25e2a3||0xcc;return function(_0x4deaf5){if(_0x4deaf5){return _0x3dc9c6['sendStatus'](_0x25e2a3);}return _0x3dc9c6[_0xffc9('0x18')](_0x25e2a3)[_0xffc9('0x19')]();};}function respondWithResult(_0x2dc1c7,_0x625a2c){_0x625a2c=_0x625a2c||0xc8;return function(_0xc614b7){if(_0xc614b7){return _0x2dc1c7[_0xffc9('0x18')](_0x625a2c)[_0xffc9('0x1a')](_0xc614b7);}};}function respondWithFilteredResult(_0x40438f,_0x181750){return function(_0x15fdeb){if(_0x15fdeb){var _0x3cd064=typeof _0x181750['offset']===_0xffc9('0x1b')&&typeof _0x181750[_0xffc9('0x1c')]===_0xffc9('0x1b');var _0x2f9c31=_0x15fdeb[_0xffc9('0x1d')];var _0x301a3d=_0x3cd064?0x0:_0x181750[_0xffc9('0x1e')];var _0xa81577=_0x3cd064?_0x15fdeb[_0xffc9('0x1d')]:_0x181750['offset']+_0x181750[_0xffc9('0x1c')];var _0x3c9461;if(_0xa81577>=_0x2f9c31){_0xa81577=_0x2f9c31;_0x3c9461=0xc8;}else{_0x3c9461=0xce;}_0x40438f['status'](_0x3c9461);return _0x40438f[_0xffc9('0x1f')](_0xffc9('0x20'),_0x301a3d+'-'+_0xa81577+'/'+_0x2f9c31)[_0xffc9('0x1a')](_0x15fdeb);}return null;};}function patchUpdates(_0x371a05){return function(_0x5dba2d){try{jsonpatch[_0xffc9('0x21')](_0x5dba2d,_0x371a05,!![]);}catch(_0x21b19f){return BPromise[_0xffc9('0x22')](_0x21b19f);}return _0x5dba2d[_0xffc9('0x23')]();};}function saveUpdates(_0x1999e7,_0x40dd47){return function(_0x2cfde9){if(_0x2cfde9){return _0x2cfde9[_0xffc9('0x24')](_0x1999e7)[_0xffc9('0x25')](function(_0x4f1fae){return _0x4f1fae;});}return null;};}function removeEntity(_0x2687bb,_0x53e36f){return function(_0x28b3ef){if(_0x28b3ef){return _0x28b3ef['destroy']()[_0xffc9('0x25')](function(){_0x2687bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8d90,_0x4488eb){return function(_0x32bb8c){if(!_0x32bb8c){_0x4a8d90[_0xffc9('0x26')](0x194);}return _0x32bb8c;};}function handleError(_0xab17b5,_0x409cdc){_0x409cdc=_0x409cdc||0x1f4;return function(_0xdf6f3f){logger[_0xffc9('0x27')](_0xdf6f3f[_0xffc9('0x28')]);if(_0xdf6f3f['name']){delete _0xdf6f3f[_0xffc9('0x29')];}_0xab17b5['status'](_0x409cdc)[_0xffc9('0x2a')](_0xdf6f3f);};}exports[_0xffc9('0x2b')]=function(_0x29c0d7,_0x44f3c4){var _0x71a7a9={},_0x540a2e={},_0x73f9f9={'count':0x0,'rows':[]};var _0x57ce2c=_[_0xffc9('0x2c')](db['SalesforceField'][_0xffc9('0x2d')],function(_0x3806ca){return{'name':_0x3806ca[_0xffc9('0x2e')],'type':_0x3806ca[_0xffc9('0x2f')]['key']};});_0x540a2e[_0xffc9('0x30')]=_['map'](_0x57ce2c,_0xffc9('0x29'));_0x540a2e[_0xffc9('0x31')]=_['keys'](_0x29c0d7['query']);_0x540a2e['filters']=_['intersection'](_0x540a2e[_0xffc9('0x30')],_0x540a2e[_0xffc9('0x31')]);_0x71a7a9[_0xffc9('0x32')]=_['intersection'](_0x540a2e[_0xffc9('0x30')],qs[_0xffc9('0x33')](_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x33')]));_0x71a7a9[_0xffc9('0x32')]=_0x71a7a9[_0xffc9('0x32')][_0xffc9('0x34')]?_0x71a7a9[_0xffc9('0x32')]:_0x540a2e[_0xffc9('0x30')];if(!_0x29c0d7[_0xffc9('0x31')]['hasOwnProperty']('nolimit')){_0x71a7a9[_0xffc9('0x1c')]=qs[_0xffc9('0x1c')](_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x1c')]);_0x71a7a9[_0xffc9('0x1e')]=qs['offset'](_0x29c0d7[_0xffc9('0x31')]['offset']);}_0x71a7a9[_0xffc9('0x35')]=qs[_0xffc9('0x36')](_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x36')]);_0x71a7a9[_0xffc9('0x37')]=qs[_0xffc9('0x38')](_[_0xffc9('0x39')](_0x29c0d7['query'],_0x540a2e['filters']),_0x57ce2c);if(_0x29c0d7['query'][_0xffc9('0x3a')]){_0x71a7a9[_0xffc9('0x37')]=_[_0xffc9('0x3b')](_0x71a7a9['where'],{'$or':_['map'](_0x57ce2c,function(_0x5cae74){if(_0x5cae74[_0xffc9('0x2f')]!==_0xffc9('0x3c')){var _0x5ac22b={};_0x5ac22b[_0x5cae74[_0xffc9('0x29')]]={'$like':'%'+_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x3a')]+'%'};return _0x5ac22b;}})});}_0x71a7a9=_['merge']({},_0x71a7a9,_0x29c0d7[_0xffc9('0x3d')]);var _0x1678a6={'where':_0x71a7a9[_0xffc9('0x37')]};return db[_0xffc9('0x3e')][_0xffc9('0x1d')](_0x1678a6)[_0xffc9('0x25')](function(_0x81d528){_0x73f9f9[_0xffc9('0x1d')]=_0x81d528;if(_0x29c0d7[_0xffc9('0x31')][_0xffc9('0x3f')]){_0x71a7a9[_0xffc9('0x40')]=[{'all':!![]}];}return db[_0xffc9('0x3e')][_0xffc9('0x41')](_0x71a7a9);})[_0xffc9('0x25')](function(_0x1a3b0f){_0x73f9f9['rows']=_0x1a3b0f;return _0x73f9f9;})[_0xffc9('0x25')](respondWithFilteredResult(_0x44f3c4,_0x71a7a9))[_0xffc9('0x42')](handleError(_0x44f3c4,null));};exports['show']=function(_0x2ee7b5,_0x1bffec){var _0x59b29a={'raw':!![],'where':{'id':_0x2ee7b5['params']['id']}},_0x5807ff={};_0x5807ff[_0xffc9('0x30')]=_[_0xffc9('0x43')](db[_0xffc9('0x3e')][_0xffc9('0x2d')]);_0x5807ff[_0xffc9('0x31')]=_[_0xffc9('0x43')](_0x2ee7b5['query']);_0x5807ff[_0xffc9('0x38')]=_[_0xffc9('0x44')](_0x5807ff[_0xffc9('0x30')],_0x5807ff[_0xffc9('0x31')]);_0x59b29a['attributes']=_['intersection'](_0x5807ff[_0xffc9('0x30')],qs[_0xffc9('0x33')](_0x2ee7b5[_0xffc9('0x31')][_0xffc9('0x33')]));_0x59b29a[_0xffc9('0x32')]=_0x59b29a[_0xffc9('0x32')][_0xffc9('0x34')]?_0x59b29a[_0xffc9('0x32')]:_0x5807ff[_0xffc9('0x30')];if(_0x2ee7b5[_0xffc9('0x31')]['includeAll']){_0x59b29a[_0xffc9('0x40')]=[{'all':!![]}];}_0x59b29a=_[_0xffc9('0x3b')]({},_0x59b29a,_0x2ee7b5[_0xffc9('0x3d')]);return db['SalesforceField']['find'](_0x59b29a)[_0xffc9('0x25')](handleEntityNotFound(_0x1bffec,null))[_0xffc9('0x25')](respondWithResult(_0x1bffec,null))['catch'](handleError(_0x1bffec,null));};exports['create']=function(_0x4dde9a,_0x386b96){return db[_0xffc9('0x3e')][_0xffc9('0x45')](_0x4dde9a[_0xffc9('0x46')],{})[_0xffc9('0x25')](respondWithResult(_0x386b96,0xc9))['catch'](handleError(_0x386b96,null));};exports[_0xffc9('0x24')]=function(_0x36151d,_0x324e1c){if(_0x36151d[_0xffc9('0x46')]['id']){delete _0x36151d[_0xffc9('0x46')]['id'];}return db[_0xffc9('0x3e')][_0xffc9('0x47')]({'where':{'id':_0x36151d[_0xffc9('0x48')]['id']}})[_0xffc9('0x25')](handleEntityNotFound(_0x324e1c,null))['then'](saveUpdates(_0x36151d[_0xffc9('0x46')],null))['then'](respondWithResult(_0x324e1c,null))['catch'](handleError(_0x324e1c,null));};exports[_0xffc9('0x49')]=function(_0x284a20,_0x255192){return db['SalesforceField']['find']({'where':{'id':_0x284a20[_0xffc9('0x48')]['id']}})[_0xffc9('0x25')](handleEntityNotFound(_0x255192,null))['then'](removeEntity(_0x255192,null))[_0xffc9('0x42')](handleError(_0x255192,null));};
\ No newline at end of file
+var _0x0382=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x201cb0,_0x3856f7){var _0x1d72e5=function(_0xee5b49){while(--_0xee5b49){_0x201cb0['push'](_0x201cb0['shift']());}};_0x1d72e5(++_0x3856f7);}(_0x0382,0xde));var _0x2038=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x0382[_0x519756];return _0x37047e;};'use strict';var emlformat=require(_0x2038('0x0'));var rimraf=require(_0x2038('0x1'));var zipdir=require(_0x2038('0x2'));var jsonpatch=require(_0x2038('0x3'));var rp=require(_0x2038('0x4'));var moment=require('moment');var BPromise=require(_0x2038('0x5'));var Mustache=require(_0x2038('0x6'));var util=require(_0x2038('0x7'));var path=require(_0x2038('0x8'));var sox=require(_0x2038('0x9'));var csv=require(_0x2038('0xa'));var ejs=require(_0x2038('0xb'));var fs=require('fs');var fs_extra=require(_0x2038('0xc'));var _=require(_0x2038('0xd'));var squel=require(_0x2038('0xe'));var crypto=require('crypto');var jsforce=require(_0x2038('0xf'));var deskjs=require(_0x2038('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2038('0x11'));var Papa=require(_0x2038('0x12'));var Redis=require(_0x2038('0x13'));var authService=require(_0x2038('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2038('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2038('0x16'));var config=require(_0x2038('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2038('0x18'))['db'];function respondWithStatusCode(_0x55d856,_0xae3cb4){_0xae3cb4=_0xae3cb4||0xcc;return function(_0xc56fb1){if(_0xc56fb1){return _0x55d856[_0x2038('0x19')](_0xae3cb4);}return _0x55d856[_0x2038('0x1a')](_0xae3cb4)[_0x2038('0x1b')]();};}function respondWithResult(_0x3512c6,_0x404427){_0x404427=_0x404427||0xc8;return function(_0x598292){if(_0x598292){return _0x3512c6[_0x2038('0x1a')](_0x404427)['json'](_0x598292);}};}function respondWithFilteredResult(_0x23fd16,_0x4b80b3){return function(_0x55f670){if(_0x55f670){var _0x964a5b=typeof _0x4b80b3[_0x2038('0x1c')]===_0x2038('0x1d')&&typeof _0x4b80b3[_0x2038('0x1e')]===_0x2038('0x1d');var _0x364463=_0x55f670[_0x2038('0x1f')];var _0x25cff0=_0x964a5b?0x0:_0x4b80b3[_0x2038('0x1c')];var _0x1d9d0d=_0x964a5b?_0x55f670['count']:_0x4b80b3[_0x2038('0x1c')]+_0x4b80b3[_0x2038('0x1e')];var _0x5713f6;if(_0x1d9d0d>=_0x364463){_0x1d9d0d=_0x364463;_0x5713f6=0xc8;}else{_0x5713f6=0xce;}_0x23fd16[_0x2038('0x1a')](_0x5713f6);return _0x23fd16[_0x2038('0x20')](_0x2038('0x21'),_0x25cff0+'-'+_0x1d9d0d+'/'+_0x364463)[_0x2038('0x22')](_0x55f670);}return null;};}function patchUpdates(_0x343f48){return function(_0xf7a671){try{jsonpatch[_0x2038('0x23')](_0xf7a671,_0x343f48,!![]);}catch(_0x2101c1){return BPromise[_0x2038('0x24')](_0x2101c1);}return _0xf7a671[_0x2038('0x25')]();};}function saveUpdates(_0x29868d,_0xe615ae){return function(_0xcaa746){if(_0xcaa746){return _0xcaa746[_0x2038('0x26')](_0x29868d)[_0x2038('0x27')](function(_0x416852){return _0x416852;});}return null;};}function removeEntity(_0x2c4b64,_0x5bdc32){return function(_0x2c34a0){if(_0x2c34a0){return _0x2c34a0[_0x2038('0x28')]()[_0x2038('0x27')](function(){_0x2c4b64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ea0c8,_0x32cc33){return function(_0x174ba6){if(!_0x174ba6){_0x5ea0c8[_0x2038('0x19')](0x194);}return _0x174ba6;};}function handleError(_0x4081bd,_0x40f026){_0x40f026=_0x40f026||0x1f4;return function(_0x18249e){logger[_0x2038('0x29')](_0x18249e[_0x2038('0x2a')]);if(_0x18249e[_0x2038('0x2b')]){delete _0x18249e[_0x2038('0x2b')];}_0x4081bd[_0x2038('0x1a')](_0x40f026)[_0x2038('0x2c')](_0x18249e);};}exports[_0x2038('0x2d')]=function(_0x98fd5a,_0x5d0887){var _0x2c007e={},_0x5a21c7={},_0x2fe409={'count':0x0,'rows':[]};var _0x3cd7a7=_[_0x2038('0x2e')](db[_0x2038('0x2f')][_0x2038('0x30')],function(_0x1c4218){return{'name':_0x1c4218['fieldName'],'type':_0x1c4218[_0x2038('0x31')][_0x2038('0x32')]};});_0x5a21c7[_0x2038('0x33')]=_[_0x2038('0x2e')](_0x3cd7a7,_0x2038('0x2b'));_0x5a21c7[_0x2038('0x34')]=_[_0x2038('0x35')](_0x98fd5a[_0x2038('0x34')]);_0x5a21c7['filters']=_[_0x2038('0x36')](_0x5a21c7['model'],_0x5a21c7['query']);_0x2c007e[_0x2038('0x37')]=_['intersection'](_0x5a21c7[_0x2038('0x33')],qs[_0x2038('0x38')](_0x98fd5a['query'][_0x2038('0x38')]));_0x2c007e[_0x2038('0x37')]=_0x2c007e['attributes'][_0x2038('0x39')]?_0x2c007e[_0x2038('0x37')]:_0x5a21c7['model'];if(!_0x98fd5a[_0x2038('0x34')]['hasOwnProperty'](_0x2038('0x3a'))){_0x2c007e[_0x2038('0x1e')]=qs[_0x2038('0x1e')](_0x98fd5a[_0x2038('0x34')][_0x2038('0x1e')]);_0x2c007e[_0x2038('0x1c')]=qs[_0x2038('0x1c')](_0x98fd5a['query'][_0x2038('0x1c')]);}_0x2c007e['order']=qs[_0x2038('0x3b')](_0x98fd5a['query'][_0x2038('0x3b')]);_0x2c007e[_0x2038('0x3c')]=qs['filters'](_[_0x2038('0x3d')](_0x98fd5a[_0x2038('0x34')],_0x5a21c7[_0x2038('0x3e')]),_0x3cd7a7);if(_0x98fd5a[_0x2038('0x34')]['filter']){_0x2c007e['where']=_[_0x2038('0x3f')](_0x2c007e[_0x2038('0x3c')],{'$or':_[_0x2038('0x2e')](_0x3cd7a7,function(_0x4ead08){if(_0x4ead08[_0x2038('0x31')]!==_0x2038('0x40')){var _0x429785={};_0x429785[_0x4ead08[_0x2038('0x2b')]]={'$like':'%'+_0x98fd5a['query'][_0x2038('0x41')]+'%'};return _0x429785;}})});}_0x2c007e=_[_0x2038('0x3f')]({},_0x2c007e,_0x98fd5a[_0x2038('0x42')]);var _0x2c054b={'where':_0x2c007e['where']};return db[_0x2038('0x2f')][_0x2038('0x1f')](_0x2c054b)[_0x2038('0x27')](function(_0x1e6793){_0x2fe409[_0x2038('0x1f')]=_0x1e6793;if(_0x98fd5a[_0x2038('0x34')][_0x2038('0x43')]){_0x2c007e[_0x2038('0x44')]=[{'all':!![]}];}return db[_0x2038('0x2f')][_0x2038('0x45')](_0x2c007e);})[_0x2038('0x27')](function(_0x4610b5){_0x2fe409[_0x2038('0x46')]=_0x4610b5;return _0x2fe409;})['then'](respondWithFilteredResult(_0x5d0887,_0x2c007e))[_0x2038('0x47')](handleError(_0x5d0887,null));};exports[_0x2038('0x48')]=function(_0x2e3373,_0x3e4ec7){var _0x1903b7={'raw':!![],'where':{'id':_0x2e3373[_0x2038('0x49')]['id']}},_0x4a95e3={};_0x4a95e3['model']=_[_0x2038('0x35')](db[_0x2038('0x2f')]['rawAttributes']);_0x4a95e3[_0x2038('0x34')]=_[_0x2038('0x35')](_0x2e3373[_0x2038('0x34')]);_0x4a95e3[_0x2038('0x3e')]=_[_0x2038('0x36')](_0x4a95e3[_0x2038('0x33')],_0x4a95e3['query']);_0x1903b7['attributes']=_[_0x2038('0x36')](_0x4a95e3[_0x2038('0x33')],qs[_0x2038('0x38')](_0x2e3373['query']['fields']));_0x1903b7[_0x2038('0x37')]=_0x1903b7['attributes'][_0x2038('0x39')]?_0x1903b7[_0x2038('0x37')]:_0x4a95e3[_0x2038('0x33')];if(_0x2e3373[_0x2038('0x34')][_0x2038('0x43')]){_0x1903b7[_0x2038('0x44')]=[{'all':!![]}];}_0x1903b7=_[_0x2038('0x3f')]({},_0x1903b7,_0x2e3373['options']);return db[_0x2038('0x2f')][_0x2038('0x4a')](_0x1903b7)[_0x2038('0x27')](handleEntityNotFound(_0x3e4ec7,null))['then'](respondWithResult(_0x3e4ec7,null))['catch'](handleError(_0x3e4ec7,null));};exports[_0x2038('0x4b')]=function(_0x2dc1e5,_0x33316d){return db['SalesforceField'][_0x2038('0x4b')](_0x2dc1e5[_0x2038('0x4c')],{})[_0x2038('0x27')](respondWithResult(_0x33316d,0xc9))[_0x2038('0x47')](handleError(_0x33316d,null));};exports['update']=function(_0x36bff8,_0x201faf){if(_0x36bff8[_0x2038('0x4c')]['id']){delete _0x36bff8[_0x2038('0x4c')]['id'];}return db['SalesforceField'][_0x2038('0x4a')]({'where':{'id':_0x36bff8['params']['id']}})['then'](handleEntityNotFound(_0x201faf,null))[_0x2038('0x27')](saveUpdates(_0x36bff8[_0x2038('0x4c')],null))[_0x2038('0x27')](respondWithResult(_0x201faf,null))[_0x2038('0x47')](handleError(_0x201faf,null));};exports[_0x2038('0x28')]=function(_0x230065,_0x37f393){return db[_0x2038('0x2f')][_0x2038('0x4a')]({'where':{'id':_0x230065[_0x2038('0x49')]['id']}})[_0x2038('0x27')](handleEntityNotFound(_0x37f393,null))[_0x2038('0x27')](removeEntity(_0x37f393,null))['catch'](handleError(_0x37f393,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ab0=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment','bluebird','rimraf','../../config/environment'];(function(_0x5ccb02,_0x3588fb){var _0x52a833=function(_0x1b61d5){while(--_0x1b61d5){_0x5ccb02['push'](_0x5ccb02['shift']());}};_0x52a833(++_0x3588fb);}(_0x6ab0,0x1ac));var _0x06ab=function(_0x3e4879,_0x373530){_0x3e4879=_0x3e4879-0x0;var _0x1c6a07=_0x6ab0[_0x3e4879];return _0x1c6a07;};'use strict';var _=require(_0x06ab('0x0'));var util=require(_0x06ab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x06ab('0x2'));var BPromise=require(_0x06ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x06ab('0x4'));var config=require(_0x06ab('0x5'));var attributes=require(_0x06ab('0x6'));module[_0x06ab('0x7')]=function(_0x418474,_0x4b7bce){return _0x418474[_0x06ab('0x8')](_0x06ab('0x9'),attributes,{'tableName':_0x06ab('0xa'),'paranoid':![],'indexes':[{'name':_0x06ab('0xb'),'fields':[_0x06ab('0xc'),_0x06ab('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2ab=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x14504b,_0x1359fc){var _0x3875a1=function(_0x22bba0){while(--_0x22bba0){_0x14504b['push'](_0x14504b['shift']());}};_0x3875a1(++_0x1359fc);}(_0xf2ab,0x190));var _0xbf2a=function(_0x413ae8,_0xd8caab){_0x413ae8=_0x413ae8-0x0;var _0x38d497=_0xf2ab[_0x413ae8];return _0x38d497;};'use strict';var _=require(_0xbf2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbf2a('0x1'));var moment=require(_0xbf2a('0x2'));var BPromise=require(_0xbf2a('0x3'));var rp=require(_0xbf2a('0x4'));var fs=require('fs');var path=require(_0xbf2a('0x5'));var rimraf=require(_0xbf2a('0x6'));var config=require(_0xbf2a('0x7'));var attributes=require(_0xbf2a('0x8'));module[_0xbf2a('0x9')]=function(_0x321940,_0x483b8e){return _0x321940[_0xbf2a('0xa')](_0xbf2a('0xb'),attributes,{'tableName':_0xbf2a('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xbf2a('0xd'),_0xbf2a('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a16=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4cfd78,_0x52355e){var _0xf4a95a=function(_0x5c2d5b){while(--_0x5c2d5b){_0x4cfd78['push'](_0x4cfd78['shift']());}};_0xf4a95a(++_0x52355e);}(_0x6a16,0x197));var _0x66a1=function(_0x3b56a2,_0xb763f2){_0x3b56a2=_0x3b56a2-0x0;var _0x22418d=_0x6a16[_0x3b56a2];return _0x22418d;};'use strict';var _=require(_0x66a1('0x0'));var util=require(_0x66a1('0x1'));var moment=require(_0x66a1('0x2'));var BPromise=require(_0x66a1('0x3'));var rs=require(_0x66a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66a1('0x5'))['db'];var utils=require(_0x66a1('0x6'));var logger=require(_0x66a1('0x7'))(_0x66a1('0x8'));var config=require(_0x66a1('0x9'));var jayson=require(_0x66a1('0xa'));var client=jayson[_0x66a1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x151da7,_0x3367a5,_0x8bd41c){return new BPromise(function(_0x1fd1ca,_0x3365a0){return client[_0x66a1('0xc')](_0x151da7,_0x8bd41c)['then'](function(_0x547148){logger[_0x66a1('0xd')](_0x66a1('0xe'),_0x3367a5,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3367a5,_0x66a1('0xf'),JSON[_0x66a1('0x10')](_0x547148));if(_0x547148[_0x66a1('0x11')]){if(_0x547148[_0x66a1('0x11')][_0x66a1('0x12')]===0x1f4){logger[_0x66a1('0x11')](_0x66a1('0xe'),_0x3367a5,_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);return _0x3365a0(_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);}logger[_0x66a1('0x11')](_0x66a1('0xe'),_0x3367a5,_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);return _0x1fd1ca(_0x547148[_0x66a1('0x11')][_0x66a1('0x13')]);}else{logger['info'](_0x66a1('0xe'),_0x3367a5,_0x66a1('0xf'));_0x1fd1ca(_0x547148['result'][_0x66a1('0x13')]);}})[_0x66a1('0x14')](function(_0x28ad79){logger[_0x66a1('0x11')](_0x66a1('0xe'),_0x3367a5,_0x28ad79);_0x3365a0(_0x28ad79);});});}
\ No newline at end of file
+var _0x82e9=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x24efde,_0x2b8916){var _0xacf183=function(_0xf0dbe6){while(--_0xf0dbe6){_0x24efde['push'](_0x24efde['shift']());}};_0xacf183(++_0x2b8916);}(_0x82e9,0xec));var _0x982e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x82e9[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x982e('0x0'));var util=require('util');var moment=require(_0x982e('0x1'));var BPromise=require('bluebird');var rs=require(_0x982e('0x2'));var fs=require('fs');var Redis=require(_0x982e('0x3'));var db=require(_0x982e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x982e('0x5'))(_0x982e('0x6'));var config=require(_0x982e('0x7'));var jayson=require(_0x982e('0x8'));var client=jayson[_0x982e('0x9')][_0x982e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5855c5,_0x382b60,_0x3ce3a0){return new BPromise(function(_0xdd1f50,_0x484981){return client[_0x982e('0xb')](_0x5855c5,_0x3ce3a0)[_0x982e('0xc')](function(_0x3e6244){logger[_0x982e('0xd')](_0x982e('0xe'),_0x382b60,'request\x20sent');logger[_0x982e('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x382b60,_0x982e('0x10'),JSON['stringify'](_0x3e6244));if(_0x3e6244[_0x982e('0x11')]){if(_0x3e6244[_0x982e('0x11')][_0x982e('0x12')]===0x1f4){logger[_0x982e('0x11')](_0x982e('0xe'),_0x382b60,_0x3e6244[_0x982e('0x11')]['message']);return _0x484981(_0x3e6244['error'][_0x982e('0x13')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x382b60,_0x3e6244['error'][_0x982e('0x13')]);return _0xdd1f50(_0x3e6244[_0x982e('0x11')][_0x982e('0x13')]);}else{logger[_0x982e('0xd')](_0x982e('0xe'),_0x382b60,_0x982e('0x10'));_0xdd1f50(_0x3e6244[_0x982e('0x14')][_0x982e('0x13')]);}})[_0x982e('0x15')](function(_0x1895f1){logger[_0x982e('0x11')]('SalesforceField,\x20%s,\x20%s',_0x382b60,_0x1895f1);_0x484981(_0x1895f1);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab26=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id'];(function(_0xf82311,_0x29504b){var _0x39d8fa=function(_0x27c1d2){while(--_0x27c1d2){_0xf82311['push'](_0xf82311['shift']());}};_0x39d8fa(++_0x29504b);}(_0xab26,0xd2));var _0x6ab2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xab26[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x6ab2('0x0'));var util=require(_0x6ab2('0x1'));var path=require(_0x6ab2('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ab2('0x3'));var router=express[_0x6ab2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6ab2('0x5'));var config=require('../../config/environment');var controller=require(_0x6ab2('0x6'));router[_0x6ab2('0x7')]('/',auth[_0x6ab2('0x8')](),controller['index']);router[_0x6ab2('0x7')](_0x6ab2('0x9'),auth['isAuthenticated'](),controller[_0x6ab2('0xa')]);router[_0x6ab2('0x7')](_0x6ab2('0xb'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0xc')]);router[_0x6ab2('0x7')](_0x6ab2('0xd'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0xe')]);router[_0x6ab2('0xf')]('/',auth[_0x6ab2('0x8')](),controller['create']);router[_0x6ab2('0xf')](_0x6ab2('0xb'),auth[_0x6ab2('0x8')](),controller['addConfiguration']);router['put'](_0x6ab2('0x9'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0x10')]);router[_0x6ab2('0x11')](_0x6ab2('0x9'),auth[_0x6ab2('0x8')](),controller[_0x6ab2('0x12')]);module[_0x6ab2('0x13')]=router;
\ No newline at end of file
+var _0x4124=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer'];(function(_0x3aeb53,_0xa4dcce){var _0x2dcc6c=function(_0x42a519){while(--_0x42a519){_0x3aeb53['push'](_0x3aeb53['shift']());}};_0x2dcc6c(++_0xa4dcce);}(_0x4124,0x1c1));var _0x4412=function(_0x486589,_0x1c1f1d){_0x486589=_0x486589-0x0;var _0x2456d1=_0x4124[_0x486589];return _0x2456d1;};'use strict';var multer=require(_0x4412('0x0'));var util=require(_0x4412('0x1'));var path=require(_0x4412('0x2'));var timeout=require(_0x4412('0x3'));var express=require(_0x4412('0x4'));var router=express[_0x4412('0x5')]();var fs_extra=require(_0x4412('0x6'));var auth=require(_0x4412('0x7'));var interaction=require(_0x4412('0x8'));var config=require(_0x4412('0x9'));var controller=require('./intServicenowAccount.controller');router[_0x4412('0xa')]('/',auth[_0x4412('0xb')](),controller[_0x4412('0xc')]);router['get'](_0x4412('0xd'),auth['isAuthenticated'](),controller[_0x4412('0xe')]);router['get'](_0x4412('0xf'),auth['isAuthenticated'](),controller[_0x4412('0x10')]);router['get'](_0x4412('0x11'),auth[_0x4412('0xb')](),controller[_0x4412('0x12')]);router[_0x4412('0x13')]('/',auth[_0x4412('0xb')](),controller['create']);router[_0x4412('0x13')](_0x4412('0xf'),auth[_0x4412('0xb')](),controller[_0x4412('0x14')]);router[_0x4412('0x15')](_0x4412('0xd'),auth[_0x4412('0xb')](),controller[_0x4412('0x16')]);router['delete'](_0x4412('0xd'),auth[_0x4412('0xb')](),controller[_0x4412('0x17')]);module[_0x4412('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ca0=['sequelize','exports','STRING'];(function(_0x8c62c5,_0x1e6f7f){var _0xcf3363=function(_0x1e2f5d){while(--_0x1e2f5d){_0x8c62c5['push'](_0x8c62c5['shift']());}};_0xcf3363(++_0x1e6f7f);}(_0x2ca0,0xae));var _0x02ca=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x2ca0[_0x1b3a5c];return _0x2ae8cb;};'use strict';var Sequelize=require(_0x02ca('0x0'));module[_0x02ca('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x02ca('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x02ca('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x02ca('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x02ca('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb60e=['exports','STRING','username'];(function(_0x202b42,_0x5e76e6){var _0x2ab785=function(_0x1f1d05){while(--_0x1f1d05){_0x202b42['push'](_0x202b42['shift']());}};_0x2ab785(++_0x5e76e6);}(_0xb60e,0x6c));var _0xeb60=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xb60e[_0x2d6197];return _0x4d0e75;};'use strict';var Sequelize=require('sequelize');module[_0xeb60('0x0')]={'name':{'type':Sequelize[_0xeb60('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xeb60('0x2')},'password':{'type':Sequelize[_0xeb60('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xeb60('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xeb60('0x1')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ecd=['eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','then','destroy','error','name','send','index','map','ServicenowAccount','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','update','body','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','pick','AccountId','Subjects','Descriptions','channel','ServicenowField','hold_reason','knowledge','close_code','notify','incident_state','severity','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','impact','active','work_notes_list','sys_domain_path','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','company','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','label','all','log','TCL:\x20_object','remove','internalType','push','concat','test','statusCode','stack','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x6ecd,0x162));var _0xd6ec=function(_0x4306b5,_0x4c4be2){_0x4306b5=_0x4306b5-0x0;var _0x5cf4c9=_0x6ecd[_0x4306b5];return _0x5cf4c9;};'use strict';var emlformat=require(_0xd6ec('0x0'));var rimraf=require(_0xd6ec('0x1'));var zipdir=require(_0xd6ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd6ec('0x4'));var util=require(_0xd6ec('0x5'));var path=require(_0xd6ec('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6ec('0x7'));var fs=require('fs');var fs_extra=require(_0xd6ec('0x8'));var _=require(_0xd6ec('0x9'));var squel=require(_0xd6ec('0xa'));var crypto=require(_0xd6ec('0xb'));var jsforce=require(_0xd6ec('0xc'));var deskjs=require(_0xd6ec('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd6ec('0xe'));var Papa=require(_0xd6ec('0xf'));var Redis=require(_0xd6ec('0x10'));var authService=require(_0xd6ec('0x11'));var qs=require(_0xd6ec('0x12'));var as=require(_0xd6ec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd6ec('0x14'));var utils=require(_0xd6ec('0x15'));var config=require(_0xd6ec('0x16'));var licenseUtil=require(_0xd6ec('0x17'));var db=require(_0xd6ec('0x18'))['db'];var integrations=require(_0xd6ec('0x19'));function respondWithStatusCode(_0x277fb1,_0x4f82d6){_0x4f82d6=_0x4f82d6||0xcc;return function(_0x1d89bc){if(_0x1d89bc){return _0x277fb1[_0xd6ec('0x1a')](_0x4f82d6);}return _0x277fb1[_0xd6ec('0x1b')](_0x4f82d6)[_0xd6ec('0x1c')]();};}function respondWithResult(_0x2a638a,_0xa04684){_0xa04684=_0xa04684||0xc8;return function(_0xae2e55){if(_0xae2e55){return _0x2a638a[_0xd6ec('0x1b')](_0xa04684)[_0xd6ec('0x1d')](_0xae2e55);}};}function respondWithFilteredResult(_0x40e75c,_0x2f8d86){return function(_0x43f086){if(_0x43f086){var _0x446c00=typeof _0x2f8d86['offset']===_0xd6ec('0x1e')&&typeof _0x2f8d86['limit']===_0xd6ec('0x1e');var _0x3e5bdf=_0x43f086[_0xd6ec('0x1f')];var _0x5dde1f=_0x446c00?0x0:_0x2f8d86[_0xd6ec('0x20')];var _0x124d71=_0x446c00?_0x43f086[_0xd6ec('0x1f')]:_0x2f8d86[_0xd6ec('0x20')]+_0x2f8d86[_0xd6ec('0x21')];var _0x3f3321;if(_0x124d71>=_0x3e5bdf){_0x124d71=_0x3e5bdf;_0x3f3321=0xc8;}else{_0x3f3321=0xce;}_0x40e75c[_0xd6ec('0x1b')](_0x3f3321);return _0x40e75c['set']('Content-Range',_0x5dde1f+'-'+_0x124d71+'/'+_0x3e5bdf)[_0xd6ec('0x1d')](_0x43f086);}return null;};}function patchUpdates(_0x36b8ea){return function(_0x430cf5){try{jsonpatch[_0xd6ec('0x22')](_0x430cf5,_0x36b8ea,!![]);}catch(_0x4f3456){return BPromise[_0xd6ec('0x23')](_0x4f3456);}return _0x430cf5['save']();};}function saveUpdates(_0x5495f8,_0x53c8b6){return function(_0x2f885c){if(_0x2f885c){return _0x2f885c['update'](_0x5495f8)[_0xd6ec('0x24')](function(_0x32ba88){return _0x32ba88;});}return null;};}function removeEntity(_0xd733c0,_0x5e34d2){return function(_0x326ca0){if(_0x326ca0){return _0x326ca0[_0xd6ec('0x25')]()[_0xd6ec('0x24')](function(){_0xd733c0[_0xd6ec('0x1b')](0xcc)[_0xd6ec('0x1c')]();});}};}function handleEntityNotFound(_0x630598,_0xad42d7){return function(_0xb5aa9c){if(!_0xb5aa9c){_0x630598[_0xd6ec('0x1a')](0x194);}return _0xb5aa9c;};}function handleError(_0x45bd85,_0x2344ca){_0x2344ca=_0x2344ca||0x1f4;return function(_0x27a869){logger[_0xd6ec('0x26')](_0x27a869['stack']);if(_0x27a869[_0xd6ec('0x27')]){delete _0x27a869['name'];}_0x45bd85['status'](_0x2344ca)[_0xd6ec('0x28')](_0x27a869);};}exports[_0xd6ec('0x29')]=function(_0x18a08c,_0x40e768){var _0x486154={},_0x301c1b={},_0x549bb7={'count':0x0,'rows':[]};var _0x45b707=_[_0xd6ec('0x2a')](db[_0xd6ec('0x2b')]['rawAttributes'],function(_0x4b7962){return{'name':_0x4b7962['fieldName'],'type':_0x4b7962[_0xd6ec('0x2c')]['key']};});_0x301c1b['model']=_[_0xd6ec('0x2a')](_0x45b707,_0xd6ec('0x27'));_0x301c1b[_0xd6ec('0x2d')]=_[_0xd6ec('0x2e')](_0x18a08c['query']);_0x301c1b[_0xd6ec('0x2f')]=_[_0xd6ec('0x30')](_0x301c1b[_0xd6ec('0x31')],_0x301c1b['query']);_0x486154['attributes']=_[_0xd6ec('0x30')](_0x301c1b[_0xd6ec('0x31')],qs[_0xd6ec('0x32')](_0x18a08c['query'][_0xd6ec('0x32')]));_0x486154[_0xd6ec('0x33')]=_0x486154[_0xd6ec('0x33')][_0xd6ec('0x34')]?_0x486154[_0xd6ec('0x33')]:_0x301c1b[_0xd6ec('0x31')];if(!_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x35')](_0xd6ec('0x36'))){_0x486154['limit']=qs['limit'](_0x18a08c['query']['limit']);_0x486154[_0xd6ec('0x20')]=qs[_0xd6ec('0x20')](_0x18a08c['query'][_0xd6ec('0x20')]);}_0x486154[_0xd6ec('0x37')]=qs[_0xd6ec('0x38')](_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x38')]);_0x486154['where']=qs[_0xd6ec('0x2f')](_['pick'](_0x18a08c[_0xd6ec('0x2d')],_0x301c1b['filters']),_0x45b707);if(_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x39')]){_0x486154[_0xd6ec('0x3a')]=_[_0xd6ec('0x3b')](_0x486154['where'],{'$or':_[_0xd6ec('0x2a')](_0x45b707,function(_0x48f5d4){if(_0x48f5d4['type']!==_0xd6ec('0x3c')){var _0x315226={};_0x315226[_0x48f5d4[_0xd6ec('0x27')]]={'$like':'%'+_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x39')]+'%'};return _0x315226;}})});}_0x486154=_[_0xd6ec('0x3b')]({},_0x486154,_0x18a08c[_0xd6ec('0x3d')]);var _0x47baf7={'where':_0x486154[_0xd6ec('0x3a')]};return db['ServicenowAccount'][_0xd6ec('0x1f')](_0x47baf7)[_0xd6ec('0x24')](function(_0x38b8ac){_0x549bb7[_0xd6ec('0x1f')]=_0x38b8ac;if(_0x18a08c[_0xd6ec('0x2d')][_0xd6ec('0x3e')]){_0x486154[_0xd6ec('0x3f')]=[{'all':!![]}];}return db[_0xd6ec('0x2b')][_0xd6ec('0x40')](_0x486154);})[_0xd6ec('0x24')](function(_0x4d3c64){_0x549bb7['rows']=_0x4d3c64;return _0x549bb7;})[_0xd6ec('0x24')](respondWithFilteredResult(_0x40e768,_0x486154))[_0xd6ec('0x41')](handleError(_0x40e768,null));};exports[_0xd6ec('0x42')]=function(_0x2bb2db,_0x41855b){var _0x4a22e9={'raw':![],'where':{'id':_0x2bb2db[_0xd6ec('0x43')]['id']}},_0x406564={};_0x406564[_0xd6ec('0x31')]=_['keys'](db[_0xd6ec('0x2b')]['rawAttributes']);_0x406564[_0xd6ec('0x2d')]=_[_0xd6ec('0x2e')](_0x2bb2db['query']);_0x406564[_0xd6ec('0x2f')]=_[_0xd6ec('0x30')](_0x406564[_0xd6ec('0x31')],_0x406564['query']);_0x4a22e9[_0xd6ec('0x33')]=_[_0xd6ec('0x30')](_0x406564[_0xd6ec('0x31')],qs['fields'](_0x2bb2db[_0xd6ec('0x2d')][_0xd6ec('0x32')]));_0x4a22e9['attributes']=_0x4a22e9['attributes'][_0xd6ec('0x34')]?_0x4a22e9[_0xd6ec('0x33')]:_0x406564[_0xd6ec('0x31')];if(_0x2bb2db[_0xd6ec('0x2d')][_0xd6ec('0x3e')]){_0x4a22e9['include']=[{'all':!![]}];}_0x4a22e9=_[_0xd6ec('0x3b')]({},_0x4a22e9,_0x2bb2db[_0xd6ec('0x3d')]);return db[_0xd6ec('0x2b')][_0xd6ec('0x44')](_0x4a22e9)['then'](handleEntityNotFound(_0x41855b,null))[_0xd6ec('0x24')](respondWithResult(_0x41855b,null))[_0xd6ec('0x41')](handleError(_0x41855b,null));};exports[_0xd6ec('0x45')]=function(_0x397cd6,_0x4071de){return db[_0xd6ec('0x2b')][_0xd6ec('0x45')](_0x397cd6['body'],{})[_0xd6ec('0x24')](respondWithResult(_0x4071de,0xc9))[_0xd6ec('0x41')](handleError(_0x4071de,null));};exports[_0xd6ec('0x46')]=function(_0x34498d,_0x2e2d80){if(_0x34498d[_0xd6ec('0x47')]['id']){delete _0x34498d[_0xd6ec('0x47')]['id'];}return db['ServicenowAccount'][_0xd6ec('0x44')]({'where':{'id':_0x34498d['params']['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0x2e2d80,null))[_0xd6ec('0x24')](saveUpdates(_0x34498d[_0xd6ec('0x47')],null))[_0xd6ec('0x24')](respondWithResult(_0x2e2d80,null))[_0xd6ec('0x41')](handleError(_0x2e2d80,null));};exports[_0xd6ec('0x25')]=function(_0x1e5877,_0x272bc3){return db[_0xd6ec('0x2b')][_0xd6ec('0x44')]({'where':{'id':_0x1e5877[_0xd6ec('0x43')]['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0x272bc3,null))['then'](removeEntity(_0x272bc3,null))[_0xd6ec('0x41')](handleError(_0x272bc3,null));};exports[_0xd6ec('0x48')]=function(_0x5488f8,_0xeede5c,_0x1dba51){var _0x21454a={};var _0x3b8fe9={};var _0x5090c9;var _0x2129f8;return db[_0xd6ec('0x2b')][_0xd6ec('0x49')]({'where':{'id':_0x5488f8['params']['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0xeede5c,null))['then'](function(_0xc0c7f0){if(_0xc0c7f0){_0x5090c9=_0xc0c7f0;_0x3b8fe9[_0xd6ec('0x31')]=_[_0xd6ec('0x2e')](db[_0xd6ec('0x4a')][_0xd6ec('0x4b')]);_0x3b8fe9[_0xd6ec('0x2d')]=_[_0xd6ec('0x2e')](_0x5488f8['query']);_0x3b8fe9[_0xd6ec('0x2f')]=_[_0xd6ec('0x30')](_0x3b8fe9[_0xd6ec('0x31')],_0x3b8fe9['query']);_0x21454a[_0xd6ec('0x33')]=_['intersection'](_0x3b8fe9[_0xd6ec('0x31')],qs[_0xd6ec('0x32')](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x32')]));_0x21454a['attributes']=_0x21454a[_0xd6ec('0x33')][_0xd6ec('0x34')]?_0x21454a['attributes']:_0x3b8fe9[_0xd6ec('0x31')];_0x21454a[_0xd6ec('0x37')]=qs['sort'](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x38')]);_0x21454a['where']=qs[_0xd6ec('0x2f')](_[_0xd6ec('0x4c')](_0x5488f8[_0xd6ec('0x2d')],_0x3b8fe9[_0xd6ec('0x2f')]));if(_0x5488f8[_0xd6ec('0x2d')]['filter']){_0x21454a['where']=_[_0xd6ec('0x3b')](_0x21454a[_0xd6ec('0x3a')],{'$or':_['map'](_0x21454a[_0xd6ec('0x33')],function(_0xa630a){var _0x2befdb={};_0x2befdb[_0xa630a]={'$like':'%'+_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x39')]+'%'};return _0x2befdb;})});}_0x21454a=_[_0xd6ec('0x3b')]({},_0x21454a,_0x5488f8[_0xd6ec('0x3d')]);return _0x5090c9[_0xd6ec('0x48')](_0x21454a);}})[_0xd6ec('0x24')](function(_0x20049f){if(_0x20049f){_0x2129f8=_0x20049f[_0xd6ec('0x34')];if(!_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x35')](_0xd6ec('0x36'))){_0x21454a[_0xd6ec('0x21')]=qs[_0xd6ec('0x21')](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x21')]);_0x21454a[_0xd6ec('0x20')]=qs[_0xd6ec('0x20')](_0x5488f8[_0xd6ec('0x2d')][_0xd6ec('0x20')]);}return _0x5090c9[_0xd6ec('0x48')](_0x21454a);}})[_0xd6ec('0x24')](function(_0x108ad3){if(_0x108ad3){return _0x108ad3?{'count':_0x2129f8,'rows':_0x108ad3}:null;}})[_0xd6ec('0x24')](respondWithResult(_0xeede5c,null))[_0xd6ec('0x41')](handleError(_0xeede5c,null));};exports['addConfiguration']=function(_0x553f7a,_0x3da2aa,_0x327f3e){if(_0x553f7a[_0xd6ec('0x47')]['id']){delete _0x553f7a[_0xd6ec('0x47')]['id'];}return db[_0xd6ec('0x2b')]['findOne']({'where':{'id':_0x553f7a[_0xd6ec('0x43')]['id']}})[_0xd6ec('0x24')](handleEntityNotFound(_0x3da2aa,null))[_0xd6ec('0x24')](function(_0x172ba0){if(_0x172ba0){_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x4d')]=_0x172ba0['id'];_0x553f7a['body'][_0xd6ec('0x4e')]=integrations['getSubjects'](_0x553f7a[_0xd6ec('0x47')]['channel'],_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x2c')]);_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x4f')]=integrations['getDescriptions'](_0x553f7a[_0xd6ec('0x47')][_0xd6ec('0x50')],_0x553f7a['body']['type']);return db[_0xd6ec('0x4a')][_0xd6ec('0x45')](_0x553f7a[_0xd6ec('0x47')],{'include':[{'model':db[_0xd6ec('0x51')],'as':_0xd6ec('0x4e')},{'model':db[_0xd6ec('0x51')],'as':_0xd6ec('0x4f')}]});}return null;})['then'](respondWithResult(_0x3da2aa,null))[_0xd6ec('0x41')](handleError(_0x3da2aa,null));};exports['getFields']=function(_0x16672a,_0x1edbe5,_0xd32d3e){var _0x352a19=['made_sla',_0xd6ec('0x52'),_0xd6ec('0x53'),'subcategory',_0xd6ec('0x54'),_0xd6ec('0x55'),_0xd6ec('0x56'),_0xd6ec('0x57'),'category'];var _0x15f7a0=['parent',_0xd6ec('0x58'),_0xd6ec('0x59'),_0xd6ec('0x5a'),_0xd6ec('0x5b'),_0xd6ec('0x5c'),_0xd6ec('0x5d'),_0xd6ec('0x52'),_0xd6ec('0x5e'),_0xd6ec('0x5f'),_0xd6ec('0x60'),_0xd6ec('0x61'),'opened_by',_0xd6ec('0x62'),_0xd6ec('0x63'),_0xd6ec('0x64'),'state',_0xd6ec('0x65'),_0xd6ec('0x53'),_0xd6ec('0x37'),'calendar_stc',_0xd6ec('0x66'),'cmdb_ci','delivery_plan',_0xd6ec('0x67'),_0xd6ec('0x68'),_0xd6ec('0x69'),'business_service','priority',_0xd6ec('0x6a'),'rfc',_0xd6ec('0x6b'),_0xd6ec('0x6c'),'opened_at',_0xd6ec('0x6d'),'group_list',_0xd6ec('0x6e'),_0xd6ec('0x6f'),_0xd6ec('0x70'),_0xd6ec('0x71'),'approval_set',_0xd6ec('0x72'),_0xd6ec('0x73'),_0xd6ec('0x74'),_0xd6ec('0x54'),_0xd6ec('0x75'),'delivery_task',_0xd6ec('0x76'),_0xd6ec('0x77'),_0xd6ec('0x78'),_0xd6ec('0x79'),_0xd6ec('0x7a'),'calendar_duration','notify',_0xd6ec('0x7b'),_0xd6ec('0x7c'),_0xd6ec('0x7d'),'follow_up','parent_incident',_0xd6ec('0x7e'),_0xd6ec('0x7f'),_0xd6ec('0x80'),_0xd6ec('0x56'),'urgency','problem_id',_0xd6ec('0x81'),'reassignment_count','activity_due',_0xd6ec('0x82'),_0xd6ec('0x57'),_0xd6ec('0x83'),_0xd6ec('0x84'),_0xd6ec('0x85'),_0xd6ec('0x86'),_0xd6ec('0x87'),_0xd6ec('0x88'),'reopen_count','sys_tags',_0xd6ec('0x89'),_0xd6ec('0x8a'),_0xd6ec('0x8b'),_0xd6ec('0x8c'),_0xd6ec('0x8d')];var _0x1737c5='';var _0x4b64c8='';var _0x4d636c=[];var _0xd168ee='';var _0x438d55='';var _0x477dac=[];var _0x4785f2='';var _0x13585d='';var _0x5c43d3={};var _0x2908f0='';return db['ServicenowAccount'][_0xd6ec('0x49')]({'where':{'id':_0x16672a[_0xd6ec('0x43')]['id']},'attributes':['id',_0xd6ec('0x8e'),_0xd6ec('0x8f'),_0xd6ec('0x90'),_0xd6ec('0x91'),_0xd6ec('0x92')]})[_0xd6ec('0x24')](handleEntityNotFound(_0x1edbe5,null))[_0xd6ec('0x24')](function(_0x5e3447){if(_0x5e3447){_0x2908f0=_0x5e3447[_0xd6ec('0x91')];var _0x41a7e1=_0x2908f0[_0xd6ec('0x93')](-0x1);if(_0x41a7e1==='/'){_0x2908f0=_0x2908f0['substring'](0x0,_0x2908f0[_0xd6ec('0x94')](_0x41a7e1));}_0x13585d=util[_0xd6ec('0x95')]('%s/api/now/doc/table/schema/',_0x2908f0);_0x4785f2=util['format'](_0xd6ec('0x96'),_0x2908f0);_0x5c43d3={'user':_0x5e3447[_0xd6ec('0x8e')],'pass':_0x5e3447[_0xd6ec('0x8f')]};var _0x172739={'method':_0xd6ec('0x97'),'uri':_0x13585d+_0xd6ec('0x98'),'auth':_0x5c43d3,'json':!![]};return rp(_0x172739);}})['then'](function(_0x5c9846){if(_0x5c9846[_0xd6ec('0x99')]['length']>0x0){_0x1737c5=_0x5c9846[_0xd6ec('0x99')];}console['log'](_0xd6ec('0x9a'),_0x1737c5);_0x477dac=[];_0x4b64c8=Object[_0xd6ec('0x9b')]([],_0x1737c5);_['remove'](_0x4b64c8,function(_0x84869e){return!_0x352a19[_0xd6ec('0x9c')](_0x84869e[_0xd6ec('0x27')]);});_0x4b64c8[_0xd6ec('0x9d')](function(_0x1c698b){var _0x365290=createFieldObject(_0x4785f2,_0x5c43d3,_0x1c698b['internalType'],_0x1c698b[_0xd6ec('0x27')],_0x1c698b[_0xd6ec('0x9e')],![]);_0x477dac['push'](_0x365290);});return Promise[_0xd6ec('0x9f')](_0x477dac);})[_0xd6ec('0x24')](function(_0x159689){_0x4d636c=_0x159689;_0xd168ee=Object[_0xd6ec('0x9b')]([],_0x1737c5);console[_0xd6ec('0xa0')](_0xd6ec('0xa1'),_0x1737c5);_[_0xd6ec('0xa2')](_0xd168ee,function(_0x5e3744){return _0x15f7a0[_0xd6ec('0x9c')](_0x5e3744[_0xd6ec('0x27')]);});console[_0xd6ec('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xd168ee);_0x477dac=[];_0xd168ee[_0xd6ec('0x9d')](function(_0xe738d2){var _0x33636d=createFieldObject(_0x4785f2,_0x5c43d3,_0xe738d2[_0xd6ec('0xa3')],_0xe738d2[_0xd6ec('0x27')],_0xe738d2[_0xd6ec('0x9e')],!![]);_0x477dac[_0xd6ec('0xa4')](_0x33636d);});return Promise['all'](_0x477dac);})['then'](function(_0x379ac5){_0x438d55=_0x379ac5;var _0x497f50=_0x4d636c[_0xd6ec('0xa5')](_0x438d55);return{'count':_0x497f50[_0xd6ec('0x34')],'rows':_0x497f50};})[_0xd6ec('0x24')](respondWithResult(_0x1edbe5,null))['catch'](function(_0x59eb99){console[_0xd6ec('0xa0')]('ServiceNow\x20error:\x20'+_0x59eb99);var _0x5ef94e=_0x16672a['query'][_0xd6ec('0xa6')]?0x1f4:_0x59eb99[_0xd6ec('0xa7')]||0x1f4;logger['error'](_0x59eb99[_0xd6ec('0xa8')]);delete _0x59eb99[_0xd6ec('0x27')];if(_0x5ef94e===0x191){_0x5ef94e=0x190;}_0x1edbe5[_0xd6ec('0x1b')](_0x5ef94e)[_0xd6ec('0x28')](_0x16672a['query'][_0xd6ec('0xa6')]?{'message':_0xd6ec('0xa9'),'statusCode':_0x59eb99[_0xd6ec('0xa7')]}:_0x59eb99);});};function createFieldObject(_0x594bb6,_0x2e6c6a,_0xcf47d5,_0x145836,_0x566dea,_0x6eda8){return new Promise(function(_0x2fcc9a,_0x1e2504){var _0x1ac61b={'id':_0x145836,'name':_0x566dea,'custom':_0x6eda8};if(_0xcf47d5===_0xd6ec('0xaa')){_0x1ac61b[_0xd6ec('0x3d')]=[{'name':'True','value':_0xd6ec('0xab')},{'name':_0xd6ec('0xac'),'value':_0xd6ec('0xad')}];_0x2fcc9a(_0x1ac61b);}else{var _0xf16564={'method':_0xd6ec('0x97'),'uri':_0x594bb6+_0xd6ec('0xae')+_0x145836,'auth':_0x2e6c6a,'json':!![]};return rp(_0xf16564)[_0xd6ec('0x24')](function(_0x253126){var _0x33ad6b=[];if(_0x253126['result']['length']>0x0){_0x253126[_0xd6ec('0x99')][_0xd6ec('0x9d')](function(_0x541184){if(_0x541184[_0xd6ec('0xaf')]===_0xd6ec('0xad')){var _0x4a3424={'name':_0x541184[_0xd6ec('0x9e')],'value':_0x541184[_0xd6ec('0xb0')]};_0x33ad6b[_0xd6ec('0xa4')](_0x4a3424);}});}_0x1ac61b[_0xd6ec('0x3d')]=_0x33ad6b;if(_0x1ac61b[_0xd6ec('0x3d')][_0xd6ec('0x34')]>0x0){_0x2fcc9a(_0x1ac61b);}else{if(_0x6eda8==![]){_0x2fcc9a();}else{_0x2fcc9a(_0x1ac61b);}}});}});}
\ No newline at end of file
+var _0x1de1=['closed_by','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','True','False','false','GET','inactive','label','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','ServicenowAccount','findAll','catch','show','length','find','create','body','params','findOne','ServicenowConfiguration','pick','filter','getConfigurations','addConfiguration','getSubjects','channel','getDescriptions','ServicenowField','Subjects','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','active','business_service','priority','sys_domain_path','time_worked','opened_at','business_duration','group_list','reopened_time','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes'];(function(_0x27cb05,_0x11d84b){var _0x8dd9bd=function(_0x57dbd1){while(--_0x57dbd1){_0x27cb05['push'](_0x27cb05['shift']());}};_0x8dd9bd(++_0x11d84b);}(_0x1de1,0xf2));var _0x11de=function(_0x3d7408,_0x2148d2){_0x3d7408=_0x3d7408-0x0;var _0x112e27=_0x1de1[_0x3d7408];return _0x112e27;};'use strict';var emlformat=require(_0x11de('0x0'));var rimraf=require(_0x11de('0x1'));var zipdir=require(_0x11de('0x2'));var jsonpatch=require(_0x11de('0x3'));var rp=require(_0x11de('0x4'));var moment=require(_0x11de('0x5'));var BPromise=require(_0x11de('0x6'));var Mustache=require(_0x11de('0x7'));var util=require(_0x11de('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x11de('0x9'));var ejs=require(_0x11de('0xa'));var fs=require('fs');var fs_extra=require(_0x11de('0xb'));var _=require(_0x11de('0xc'));var squel=require(_0x11de('0xd'));var crypto=require(_0x11de('0xe'));var jsforce=require(_0x11de('0xf'));var deskjs=require(_0x11de('0x10'));var toCsv=require(_0x11de('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x11de('0x11'));var authService=require(_0x11de('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x11de('0x13'));var hardwareService=require(_0x11de('0x14'));var logger=require(_0x11de('0x15'))(_0x11de('0x16'));var utils=require(_0x11de('0x17'));var config=require(_0x11de('0x18'));var licenseUtil=require(_0x11de('0x19'));var db=require(_0x11de('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59353c,_0x7a371e){_0x7a371e=_0x7a371e||0xcc;return function(_0x80d93b){if(_0x80d93b){return _0x59353c[_0x11de('0x1b')](_0x7a371e);}return _0x59353c['status'](_0x7a371e)['end']();};}function respondWithResult(_0x176294,_0x488adb){_0x488adb=_0x488adb||0xc8;return function(_0x4c9416){if(_0x4c9416){return _0x176294[_0x11de('0x1c')](_0x488adb)['json'](_0x4c9416);}};}function respondWithFilteredResult(_0x5f017a,_0x5181fb){return function(_0x1613fc){if(_0x1613fc){var _0x152f2a=typeof _0x5181fb[_0x11de('0x1d')]===_0x11de('0x1e')&&typeof _0x5181fb[_0x11de('0x1f')]===_0x11de('0x1e');var _0x1cded2=_0x1613fc[_0x11de('0x20')];var _0x19eca0=_0x152f2a?0x0:_0x5181fb[_0x11de('0x1d')];var _0x10c9e6=_0x152f2a?_0x1613fc[_0x11de('0x20')]:_0x5181fb['offset']+_0x5181fb['limit'];var _0xfeb48e;if(_0x10c9e6>=_0x1cded2){_0x10c9e6=_0x1cded2;_0xfeb48e=0xc8;}else{_0xfeb48e=0xce;}_0x5f017a[_0x11de('0x1c')](_0xfeb48e);return _0x5f017a[_0x11de('0x21')](_0x11de('0x22'),_0x19eca0+'-'+_0x10c9e6+'/'+_0x1cded2)[_0x11de('0x23')](_0x1613fc);}return null;};}function patchUpdates(_0x59d494){return function(_0x263b62){try{jsonpatch[_0x11de('0x24')](_0x263b62,_0x59d494,!![]);}catch(_0x3c6318){return BPromise[_0x11de('0x25')](_0x3c6318);}return _0x263b62[_0x11de('0x26')]();};}function saveUpdates(_0x361ddc,_0xcdf871){return function(_0x48e6a3){if(_0x48e6a3){return _0x48e6a3[_0x11de('0x27')](_0x361ddc)[_0x11de('0x28')](function(_0x78a51f){return _0x78a51f;});}return null;};}function removeEntity(_0x2b8ad3,_0x7fd654){return function(_0x1a5c28){if(_0x1a5c28){return _0x1a5c28[_0x11de('0x29')]()[_0x11de('0x28')](function(){_0x2b8ad3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3564dc,_0x21d20d){return function(_0x4e4985){if(!_0x4e4985){_0x3564dc[_0x11de('0x1b')](0x194);}return _0x4e4985;};}function handleError(_0x45b49b,_0x2351fd){_0x2351fd=_0x2351fd||0x1f4;return function(_0x2e85de){logger['error'](_0x2e85de[_0x11de('0x2a')]);if(_0x2e85de[_0x11de('0x2b')]){delete _0x2e85de[_0x11de('0x2b')];}_0x45b49b['status'](_0x2351fd)['send'](_0x2e85de);};}exports[_0x11de('0x2c')]=function(_0x24add9,_0x11a269){var _0x5bc864={},_0x3a6cd1={},_0x1ba8cd={'count':0x0,'rows':[]};var _0xd625d3=_[_0x11de('0x2d')](db['ServicenowAccount'][_0x11de('0x2e')],function(_0x1c06b6){return{'name':_0x1c06b6[_0x11de('0x2f')],'type':_0x1c06b6[_0x11de('0x30')]['key']};});_0x3a6cd1[_0x11de('0x31')]=_['map'](_0xd625d3,_0x11de('0x2b'));_0x3a6cd1[_0x11de('0x32')]=_[_0x11de('0x33')](_0x24add9[_0x11de('0x32')]);_0x3a6cd1['filters']=_[_0x11de('0x34')](_0x3a6cd1[_0x11de('0x31')],_0x3a6cd1[_0x11de('0x32')]);_0x5bc864[_0x11de('0x35')]=_[_0x11de('0x34')](_0x3a6cd1['model'],qs['fields'](_0x24add9[_0x11de('0x32')][_0x11de('0x36')]));_0x5bc864[_0x11de('0x35')]=_0x5bc864[_0x11de('0x35')]['length']?_0x5bc864[_0x11de('0x35')]:_0x3a6cd1[_0x11de('0x31')];if(!_0x24add9[_0x11de('0x32')][_0x11de('0x37')](_0x11de('0x38'))){_0x5bc864[_0x11de('0x1f')]=qs[_0x11de('0x1f')](_0x24add9[_0x11de('0x32')][_0x11de('0x1f')]);_0x5bc864[_0x11de('0x1d')]=qs[_0x11de('0x1d')](_0x24add9[_0x11de('0x32')][_0x11de('0x1d')]);}_0x5bc864[_0x11de('0x39')]=qs[_0x11de('0x3a')](_0x24add9['query'][_0x11de('0x3a')]);_0x5bc864[_0x11de('0x3b')]=qs[_0x11de('0x3c')](_['pick'](_0x24add9['query'],_0x3a6cd1[_0x11de('0x3c')]),_0xd625d3);if(_0x24add9[_0x11de('0x32')]['filter']){_0x5bc864[_0x11de('0x3b')]=_[_0x11de('0x3d')](_0x5bc864[_0x11de('0x3b')],{'$or':_[_0x11de('0x2d')](_0xd625d3,function(_0x1ceb0a){if(_0x1ceb0a[_0x11de('0x30')]!==_0x11de('0x3e')){var _0x451c2f={};_0x451c2f[_0x1ceb0a['name']]={'$like':'%'+_0x24add9['query']['filter']+'%'};return _0x451c2f;}})});}_0x5bc864=_[_0x11de('0x3d')]({},_0x5bc864,_0x24add9[_0x11de('0x3f')]);var _0x43be5d={'where':_0x5bc864['where']};return db[_0x11de('0x40')][_0x11de('0x20')](_0x43be5d)[_0x11de('0x28')](function(_0x414c3c){_0x1ba8cd[_0x11de('0x20')]=_0x414c3c;if(_0x24add9[_0x11de('0x32')]['includeAll']){_0x5bc864['include']=[{'all':!![]}];}return db[_0x11de('0x40')][_0x11de('0x41')](_0x5bc864);})[_0x11de('0x28')](function(_0x473c0b){_0x1ba8cd['rows']=_0x473c0b;return _0x1ba8cd;})[_0x11de('0x28')](respondWithFilteredResult(_0x11a269,_0x5bc864))[_0x11de('0x42')](handleError(_0x11a269,null));};exports[_0x11de('0x43')]=function(_0x396eea,_0x34869f){var _0x4202ca={'raw':![],'where':{'id':_0x396eea['params']['id']}},_0xf7393f={};_0xf7393f[_0x11de('0x31')]=_[_0x11de('0x33')](db[_0x11de('0x40')][_0x11de('0x2e')]);_0xf7393f['query']=_[_0x11de('0x33')](_0x396eea['query']);_0xf7393f[_0x11de('0x3c')]=_['intersection'](_0xf7393f[_0x11de('0x31')],_0xf7393f['query']);_0x4202ca[_0x11de('0x35')]=_[_0x11de('0x34')](_0xf7393f[_0x11de('0x31')],qs[_0x11de('0x36')](_0x396eea[_0x11de('0x32')][_0x11de('0x36')]));_0x4202ca[_0x11de('0x35')]=_0x4202ca[_0x11de('0x35')][_0x11de('0x44')]?_0x4202ca['attributes']:_0xf7393f['model'];if(_0x396eea[_0x11de('0x32')]['includeAll']){_0x4202ca['include']=[{'all':!![]}];}_0x4202ca=_[_0x11de('0x3d')]({},_0x4202ca,_0x396eea[_0x11de('0x3f')]);return db[_0x11de('0x40')][_0x11de('0x45')](_0x4202ca)[_0x11de('0x28')](handleEntityNotFound(_0x34869f,null))[_0x11de('0x28')](respondWithResult(_0x34869f,null))['catch'](handleError(_0x34869f,null));};exports[_0x11de('0x46')]=function(_0x47771c,_0x5af6ae){return db['ServicenowAccount'][_0x11de('0x46')](_0x47771c[_0x11de('0x47')],{})[_0x11de('0x28')](respondWithResult(_0x5af6ae,0xc9))['catch'](handleError(_0x5af6ae,null));};exports['update']=function(_0x11c95b,_0x986aa4){if(_0x11c95b[_0x11de('0x47')]['id']){delete _0x11c95b['body']['id'];}return db[_0x11de('0x40')][_0x11de('0x45')]({'where':{'id':_0x11c95b[_0x11de('0x48')]['id']}})[_0x11de('0x28')](handleEntityNotFound(_0x986aa4,null))[_0x11de('0x28')](saveUpdates(_0x11c95b[_0x11de('0x47')],null))[_0x11de('0x28')](respondWithResult(_0x986aa4,null))[_0x11de('0x42')](handleError(_0x986aa4,null));};exports[_0x11de('0x29')]=function(_0x2e5121,_0x4b3bed){return db[_0x11de('0x40')][_0x11de('0x45')]({'where':{'id':_0x2e5121['params']['id']}})[_0x11de('0x28')](handleEntityNotFound(_0x4b3bed,null))[_0x11de('0x28')](removeEntity(_0x4b3bed,null))[_0x11de('0x42')](handleError(_0x4b3bed,null));};exports['getConfigurations']=function(_0x813f85,_0x5a780e,_0xae6290){var _0x32c9b1={};var _0x5d5a88={};var _0x3492d7;var _0x501d22;return db['ServicenowAccount'][_0x11de('0x49')]({'where':{'id':_0x813f85[_0x11de('0x48')]['id']}})[_0x11de('0x28')](handleEntityNotFound(_0x5a780e,null))[_0x11de('0x28')](function(_0x2a441a){if(_0x2a441a){_0x3492d7=_0x2a441a;_0x5d5a88[_0x11de('0x31')]=_[_0x11de('0x33')](db[_0x11de('0x4a')]['rawAttributes']);_0x5d5a88[_0x11de('0x32')]=_[_0x11de('0x33')](_0x813f85['query']);_0x5d5a88[_0x11de('0x3c')]=_[_0x11de('0x34')](_0x5d5a88['model'],_0x5d5a88[_0x11de('0x32')]);_0x32c9b1[_0x11de('0x35')]=_['intersection'](_0x5d5a88[_0x11de('0x31')],qs[_0x11de('0x36')](_0x813f85[_0x11de('0x32')]['fields']));_0x32c9b1[_0x11de('0x35')]=_0x32c9b1['attributes'][_0x11de('0x44')]?_0x32c9b1['attributes']:_0x5d5a88[_0x11de('0x31')];_0x32c9b1['order']=qs[_0x11de('0x3a')](_0x813f85[_0x11de('0x32')][_0x11de('0x3a')]);_0x32c9b1['where']=qs[_0x11de('0x3c')](_[_0x11de('0x4b')](_0x813f85['query'],_0x5d5a88[_0x11de('0x3c')]));if(_0x813f85['query'][_0x11de('0x4c')]){_0x32c9b1[_0x11de('0x3b')]=_[_0x11de('0x3d')](_0x32c9b1['where'],{'$or':_[_0x11de('0x2d')](_0x32c9b1[_0x11de('0x35')],function(_0x987c35){var _0x4942d2={};_0x4942d2[_0x987c35]={'$like':'%'+_0x813f85[_0x11de('0x32')]['filter']+'%'};return _0x4942d2;})});}_0x32c9b1=_[_0x11de('0x3d')]({},_0x32c9b1,_0x813f85[_0x11de('0x3f')]);return _0x3492d7[_0x11de('0x4d')](_0x32c9b1);}})[_0x11de('0x28')](function(_0x42787c){if(_0x42787c){_0x501d22=_0x42787c[_0x11de('0x44')];if(!_0x813f85[_0x11de('0x32')][_0x11de('0x37')](_0x11de('0x38'))){_0x32c9b1[_0x11de('0x1f')]=qs[_0x11de('0x1f')](_0x813f85[_0x11de('0x32')][_0x11de('0x1f')]);_0x32c9b1['offset']=qs[_0x11de('0x1d')](_0x813f85[_0x11de('0x32')][_0x11de('0x1d')]);}return _0x3492d7[_0x11de('0x4d')](_0x32c9b1);}})[_0x11de('0x28')](function(_0x1d6abe){if(_0x1d6abe){return _0x1d6abe?{'count':_0x501d22,'rows':_0x1d6abe}:null;}})[_0x11de('0x28')](respondWithResult(_0x5a780e,null))[_0x11de('0x42')](handleError(_0x5a780e,null));};exports[_0x11de('0x4e')]=function(_0x195be2,_0xf36211,_0xf42f23){if(_0x195be2['body']['id']){delete _0x195be2[_0x11de('0x47')]['id'];}return db['ServicenowAccount'][_0x11de('0x49')]({'where':{'id':_0x195be2[_0x11de('0x48')]['id']}})[_0x11de('0x28')](handleEntityNotFound(_0xf36211,null))[_0x11de('0x28')](function(_0x39cc05){if(_0x39cc05){_0x195be2[_0x11de('0x47')]['AccountId']=_0x39cc05['id'];_0x195be2[_0x11de('0x47')]['Subjects']=integrations[_0x11de('0x4f')](_0x195be2['body'][_0x11de('0x50')],_0x195be2[_0x11de('0x47')][_0x11de('0x30')]);_0x195be2[_0x11de('0x47')]['Descriptions']=integrations[_0x11de('0x51')](_0x195be2['body']['channel'],_0x195be2[_0x11de('0x47')]['type']);return db[_0x11de('0x4a')][_0x11de('0x46')](_0x195be2['body'],{'include':[{'model':db[_0x11de('0x52')],'as':_0x11de('0x53')},{'model':db[_0x11de('0x52')],'as':'Descriptions'}]});}return null;})[_0x11de('0x28')](respondWithResult(_0xf36211,null))['catch'](handleError(_0xf36211,null));};exports['getFields']=function(_0x1ed33f,_0x297242,_0x412c2f){var _0x2b9bb2=[_0x11de('0x54'),_0x11de('0x55'),_0x11de('0x56'),_0x11de('0x57'),_0x11de('0x58'),_0x11de('0x59'),'incident_state',_0x11de('0x5a'),_0x11de('0x5b')];var _0x1d5623=[_0x11de('0x5c'),'made_sla',_0x11de('0x5d'),_0x11de('0x5e'),_0x11de('0x5f'),'sys_updated_on',_0x11de('0x60'),_0x11de('0x55'),_0x11de('0x61'),_0x11de('0x62'),_0x11de('0x63'),'sys_updated_by',_0x11de('0x64'),_0x11de('0x65'),'sys_created_on',_0x11de('0x66'),_0x11de('0x67'),_0x11de('0x68'),_0x11de('0x56'),'order',_0x11de('0x69'),_0x11de('0x6a'),_0x11de('0x6b'),'delivery_plan','impact',_0x11de('0x6c'),'work_notes_list',_0x11de('0x6d'),_0x11de('0x6e'),_0x11de('0x6f'),'rfc',_0x11de('0x70'),'expected_start',_0x11de('0x71'),_0x11de('0x72'),_0x11de('0x73'),'work_end',_0x11de('0x74'),'resolved_at',_0x11de('0x75'),_0x11de('0x76'),_0x11de('0x57'),_0x11de('0x77'),'short_description',_0x11de('0x58'),_0x11de('0x78'),_0x11de('0x79'),_0x11de('0x7a'),_0x11de('0x7b'),_0x11de('0x7c'),_0x11de('0x7d'),_0x11de('0x7e'),_0x11de('0x7f'),_0x11de('0x59'),_0x11de('0x80'),_0x11de('0x81'),_0x11de('0x82'),'follow_up','parent_incident',_0x11de('0x83'),'contact_type',_0x11de('0x84'),_0x11de('0x85'),_0x11de('0x86'),_0x11de('0x87'),_0x11de('0x88'),_0x11de('0x89'),_0x11de('0x8a'),_0x11de('0x8b'),_0x11de('0x5a'),_0x11de('0x8c'),_0x11de('0x8d'),_0x11de('0x8e'),_0x11de('0x8f'),_0x11de('0x90'),'sys_mod_count',_0x11de('0x91'),_0x11de('0x92'),_0x11de('0x93'),'upon_approval',_0x11de('0x94'),_0x11de('0x95'),_0x11de('0x5b')];var _0x2bc13a='';var _0x50669b='';var _0x346ea2=[];var _0x9cb0e5='';var _0x503d29='';var _0x12f929=[];var _0x448eb7='';var _0x1ec28b='';var _0x5b52f5={};var _0x4283c1='';return db[_0x11de('0x40')]['findOne']({'where':{'id':_0x1ed33f[_0x11de('0x48')]['id']},'attributes':['id','username',_0x11de('0x96'),_0x11de('0x97'),_0x11de('0x98'),'serverUrl']})[_0x11de('0x28')](handleEntityNotFound(_0x297242,null))[_0x11de('0x28')](function(_0x1f848a){if(_0x1f848a){_0x4283c1=_0x1f848a[_0x11de('0x98')];var _0x1c5da6=_0x4283c1[_0x11de('0x99')](-0x1);if(_0x1c5da6==='/'){_0x4283c1=_0x4283c1[_0x11de('0x9a')](0x0,_0x4283c1[_0x11de('0x9b')](_0x1c5da6));}_0x1ec28b=util[_0x11de('0x9c')](_0x11de('0x9d'),_0x4283c1);_0x448eb7=util[_0x11de('0x9c')](_0x11de('0x9e'),_0x4283c1);_0x5b52f5={'user':_0x1f848a[_0x11de('0x9f')],'pass':_0x1f848a[_0x11de('0x96')]};var _0x56882f={'method':'GET','uri':_0x1ec28b+_0x11de('0xa0'),'auth':_0x5b52f5,'json':!![]};return rp(_0x56882f);}})[_0x11de('0x28')](function(_0x4773c4){if(_0x4773c4[_0x11de('0xa1')][_0x11de('0x44')]>0x0){_0x2bc13a=_0x4773c4[_0x11de('0xa1')];}console[_0x11de('0xa2')](_0x11de('0xa3'),_0x2bc13a);_0x12f929=[];_0x50669b=Object[_0x11de('0xa4')]([],_0x2bc13a);_[_0x11de('0xa5')](_0x50669b,function(_0xbc9200){return!_0x2b9bb2['includes'](_0xbc9200[_0x11de('0x2b')]);});_0x50669b[_0x11de('0xa6')](function(_0x47db41){var _0x5762af=createFieldObject(_0x448eb7,_0x5b52f5,_0x47db41[_0x11de('0xa7')],_0x47db41[_0x11de('0x2b')],_0x47db41['label'],![]);_0x12f929[_0x11de('0xa8')](_0x5762af);});return Promise[_0x11de('0xa9')](_0x12f929);})[_0x11de('0x28')](function(_0x2c9863){_0x346ea2=_0x2c9863;_0x9cb0e5=Object[_0x11de('0xa4')]([],_0x2bc13a);console[_0x11de('0xa2')](_0x11de('0xaa'),_0x2bc13a);_[_0x11de('0xa5')](_0x9cb0e5,function(_0x4366ee){return _0x1d5623[_0x11de('0xab')](_0x4366ee[_0x11de('0x2b')]);});console['log'](_0x11de('0xac'),_0x9cb0e5);_0x12f929=[];_0x9cb0e5['forEach'](function(_0x55b9e4){var _0x57f176=createFieldObject(_0x448eb7,_0x5b52f5,_0x55b9e4[_0x11de('0xa7')],_0x55b9e4[_0x11de('0x2b')],_0x55b9e4['label'],!![]);_0x12f929[_0x11de('0xa8')](_0x57f176);});return Promise[_0x11de('0xa9')](_0x12f929);})[_0x11de('0x28')](function(_0x674d56){_0x503d29=_0x674d56;var _0x250965=_0x346ea2['concat'](_0x503d29);return{'count':_0x250965[_0x11de('0x44')],'rows':_0x250965};})[_0x11de('0x28')](respondWithResult(_0x297242,null))['catch'](function(_0x3c63ea){console['log'](_0x11de('0xad')+_0x3c63ea);var _0x4bb7da=_0x1ed33f[_0x11de('0x32')]['test']?0x1f4:_0x3c63ea[_0x11de('0xae')]||0x1f4;logger[_0x11de('0xaf')](_0x3c63ea[_0x11de('0x2a')]);delete _0x3c63ea[_0x11de('0x2b')];if(_0x4bb7da===0x191){_0x4bb7da=0x190;}_0x297242[_0x11de('0x1c')](_0x4bb7da)['send'](_0x1ed33f['query'][_0x11de('0xb0')]?{'message':_0x11de('0xb1'),'statusCode':_0x3c63ea[_0x11de('0xae')]}:_0x3c63ea);});};function createFieldObject(_0x2bed36,_0x21bba2,_0x18dc3d,_0x4b2f1d,_0x2a92f8,_0xed7334){return new Promise(function(_0x50bad3,_0xf16d88){var _0x4af8aa={'id':_0x4b2f1d,'name':_0x2a92f8,'custom':_0xed7334};if(_0x18dc3d===_0x11de('0xb2')){_0x4af8aa[_0x11de('0x3f')]=[{'name':_0x11de('0xb3'),'value':'true'},{'name':_0x11de('0xb4'),'value':_0x11de('0xb5')}];_0x50bad3(_0x4af8aa);}else{var _0x122418={'method':_0x11de('0xb6'),'uri':_0x2bed36+'sys_choice?sysparm_query=name=incident^element='+_0x4b2f1d,'auth':_0x21bba2,'json':!![]};return rp(_0x122418)[_0x11de('0x28')](function(_0x4b7ca7){var _0xecdec=[];if(_0x4b7ca7[_0x11de('0xa1')]['length']>0x0){_0x4b7ca7[_0x11de('0xa1')][_0x11de('0xa6')](function(_0x48d830){if(_0x48d830[_0x11de('0xb7')]===_0x11de('0xb5')){var _0x3c24ce={'name':_0x48d830[_0x11de('0xb8')],'value':_0x48d830[_0x11de('0xb9')]};_0xecdec[_0x11de('0xa8')](_0x3c24ce);}});}_0x4af8aa[_0x11de('0x3f')]=_0xecdec;if(_0x4af8aa['options']['length']>0x0){_0x50bad3(_0x4af8aa);}else{if(_0xed7334==![]){_0x50bad3();}else{_0x50bad3(_0x4af8aa);}}});}});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x361eec,_0x25d17d){_0x361eec=_0x361eec-0x0;var _0x135971=_0x3f8a[_0x361eec];return _0x135971;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0xe7d01a,_0x42f54f){var _0x47226b=function(_0x303abd){while(--_0x303abd){_0xe7d01a['push'](_0xe7d01a['shift']());}};_0x47226b(++_0x42f54f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1382ea,_0x138a34){_0x1382ea=_0x1382ea-0x0;var _0x41d5f6=_0x9c5a[_0x1382ea];return _0x41d5f6;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21f6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','limit','include','map','model','attributes','stringify','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0x21f6,0xd9));var _0x621f=function(_0x5c113a,_0x53a028){_0x5c113a=_0x5c113a-0x0;var _0x52658e=_0x21f6[_0x5c113a];return _0x52658e;};'use strict';var _=require(_0x621f('0x0'));var util=require(_0x621f('0x1'));var moment=require(_0x621f('0x2'));var BPromise=require(_0x621f('0x3'));var rs=require(_0x621f('0x4'));var fs=require('fs');var Redis=require(_0x621f('0x5'));var db=require(_0x621f('0x6'))['db'];var utils=require(_0x621f('0x7'));var logger=require('../../config/logger')(_0x621f('0x8'));var config=require(_0x621f('0x9'));var jayson=require(_0x621f('0xa'));var client=jayson[_0x621f('0xb')][_0x621f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x489455,_0x40b2a3,_0x1fc4b6){return new BPromise(function(_0x3d6c96,_0xbe5de2){return client[_0x621f('0xd')](_0x489455,_0x1fc4b6)[_0x621f('0xe')](function(_0x3afcd0){logger[_0x621f('0xf')](_0x621f('0x10'),_0x40b2a3,_0x621f('0x11'));logger[_0x621f('0x12')](_0x621f('0x13'),_0x40b2a3,_0x621f('0x11'),JSON['stringify'](_0x3afcd0));if(_0x3afcd0[_0x621f('0x14')]){if(_0x3afcd0[_0x621f('0x14')][_0x621f('0x15')]===0x1f4){logger[_0x621f('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x40b2a3,_0x3afcd0['error'][_0x621f('0x16')]);return _0xbe5de2(_0x3afcd0[_0x621f('0x14')][_0x621f('0x16')]);}logger['error'](_0x621f('0x10'),_0x40b2a3,_0x3afcd0[_0x621f('0x14')][_0x621f('0x16')]);return _0x3d6c96(_0x3afcd0[_0x621f('0x14')][_0x621f('0x16')]);}else{logger[_0x621f('0xf')](_0x621f('0x10'),_0x40b2a3,_0x621f('0x11'));_0x3d6c96(_0x3afcd0['result'][_0x621f('0x16')]);}})[_0x621f('0x17')](function(_0x4d07db){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x40b2a3,_0x4d07db);_0xbe5de2(_0x4d07db);});});}exports[_0x621f('0x18')]=function(_0x1ae719){var _0x2de744=this;return new Promise(function(_0x24db37,_0x3551d3){return db[_0x621f('0x19')]['findAll']({'raw':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1c')]||null:null,'attributes':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')]['attributes']||null:null,'limit':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1d')]||null:null,'include':_0x1ae719[_0x621f('0x1a')]?_0x1ae719[_0x621f('0x1a')][_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x1ae719['options'][_0x621f('0x1e')],function(_0x12c43d){return{'model':db[_0x12c43d[_0x621f('0x20')]],'as':_0x12c43d['as'],'attributes':_0x12c43d['attributes'],'include':_0x12c43d[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x12c43d[_0x621f('0x1e')],function(_0x4f1401){return{'model':db[_0x4f1401[_0x621f('0x20')]],'as':_0x4f1401['as'],'attributes':_0x4f1401[_0x621f('0x21')],'include':_0x4f1401[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x4f1401['include'],function(_0x44e108){return{'model':db[_0x44e108[_0x621f('0x20')]],'as':_0x44e108['as'],'attributes':_0x44e108['attributes']};}):[]};}):[]};}):[]:[]})[_0x621f('0xe')](function(_0x1df856){logger['info']('GetServicenowAccount',_0x1ae719);logger[_0x621f('0x12')](_0x621f('0x18'),_0x1ae719,JSON[_0x621f('0x22')](_0x1df856));_0x24db37(_0x1df856);})['catch'](function(_0x471f52){logger[_0x621f('0x14')]('GetServicenowAccount',_0x471f52[_0x621f('0x16')],_0x1ae719);_0x3551d3(_0x2de744[_0x621f('0x14')](0x1f4,_0x471f52['message']));});});};exports[_0x621f('0x23')]=function(_0x4185df){var _0x18cbee=this;return new Promise(function(_0x3daaa4,_0x328ad2){return db[_0x621f('0x19')][_0x621f('0x24')]({'raw':_0x4185df[_0x621f('0x1a')]?_0x4185df[_0x621f('0x1a')][_0x621f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4185df[_0x621f('0x1a')]?_0x4185df['options']['where']||null:null,'attributes':_0x4185df['options']?_0x4185df[_0x621f('0x1a')][_0x621f('0x21')]||null:null,'include':_0x4185df[_0x621f('0x1a')]?_0x4185df['options'][_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x4185df['options'][_0x621f('0x1e')],function(_0x471ea3){return{'model':db[_0x471ea3[_0x621f('0x20')]],'as':_0x471ea3['as'],'attributes':_0x471ea3['attributes'],'include':_0x471ea3[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x471ea3[_0x621f('0x1e')],function(_0x477eb2){return{'model':db[_0x477eb2[_0x621f('0x20')]],'as':_0x477eb2['as'],'attributes':_0x477eb2[_0x621f('0x21')],'include':_0x477eb2[_0x621f('0x1e')]?_[_0x621f('0x1f')](_0x477eb2[_0x621f('0x1e')],function(_0x487f50){return{'model':db[_0x487f50['model']],'as':_0x487f50['as'],'attributes':_0x487f50[_0x621f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbf9709){logger['info'](_0x621f('0x23'),_0x4185df);logger[_0x621f('0x12')](_0x621f('0x23'),_0x4185df,JSON[_0x621f('0x22')](_0xbf9709));_0x3daaa4(_0xbf9709);})[_0x621f('0x17')](function(_0x423b6f){logger['error']('ShowServicenowAccount',_0x423b6f[_0x621f('0x16')],_0x4185df);_0x328ad2(_0x18cbee[_0x621f('0x14')](0x1f4,_0x423b6f['message']));});});};
\ No newline at end of file
+var _0xc454=['attributes','map','model','include','GetServicenowAccount','ServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','where'];(function(_0x338400,_0x1fc9af){var _0x178dd4=function(_0xf22cee){while(--_0xf22cee){_0x338400['push'](_0x338400['shift']());}};_0x178dd4(++_0x1fc9af);}(_0xc454,0x1cf));var _0x4c45=function(_0x33d1f3,_0x420552){_0x33d1f3=_0x33d1f3-0x0;var _0x1710d3=_0xc454[_0x33d1f3];return _0x1710d3;};'use strict';var _=require(_0x4c45('0x0'));var util=require(_0x4c45('0x1'));var moment=require(_0x4c45('0x2'));var BPromise=require(_0x4c45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c45('0x4'));var db=require(_0x4c45('0x5'))['db'];var utils=require(_0x4c45('0x6'));var logger=require(_0x4c45('0x7'))(_0x4c45('0x8'));var config=require(_0x4c45('0x9'));var jayson=require(_0x4c45('0xa'));var client=jayson[_0x4c45('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x882302,_0x54bcaf,_0xb82a69){return new BPromise(function(_0x382ed2,_0x553f27){return client['request'](_0x882302,_0xb82a69)[_0x4c45('0xc')](function(_0x2c32d8){logger[_0x4c45('0xd')](_0x4c45('0xe'),_0x54bcaf,_0x4c45('0xf'));logger[_0x4c45('0x10')](_0x4c45('0x11'),_0x54bcaf,_0x4c45('0xf'),JSON[_0x4c45('0x12')](_0x2c32d8));if(_0x2c32d8[_0x4c45('0x13')]){if(_0x2c32d8[_0x4c45('0x13')][_0x4c45('0x14')]===0x1f4){logger[_0x4c45('0x13')](_0x4c45('0xe'),_0x54bcaf,_0x2c32d8[_0x4c45('0x13')][_0x4c45('0x15')]);return _0x553f27(_0x2c32d8[_0x4c45('0x13')]['message']);}logger[_0x4c45('0x13')](_0x4c45('0xe'),_0x54bcaf,_0x2c32d8[_0x4c45('0x13')][_0x4c45('0x15')]);return _0x382ed2(_0x2c32d8['error']['message']);}else{logger[_0x4c45('0xd')](_0x4c45('0xe'),_0x54bcaf,_0x4c45('0xf'));_0x382ed2(_0x2c32d8[_0x4c45('0x16')][_0x4c45('0x15')]);}})[_0x4c45('0x17')](function(_0x203dca){logger[_0x4c45('0x13')](_0x4c45('0xe'),_0x54bcaf,_0x203dca);_0x553f27(_0x203dca);});});}exports['GetServicenowAccount']=function(_0x46a2b7){var _0x2786b5=this;return new Promise(function(_0x4acc40,_0x31a083){return db['ServicenowAccount'][_0x4c45('0x18')]({'raw':_0x46a2b7[_0x4c45('0x19')]?_0x46a2b7[_0x4c45('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x46a2b7[_0x4c45('0x19')]?_0x46a2b7[_0x4c45('0x19')][_0x4c45('0x1a')]||null:null,'attributes':_0x46a2b7[_0x4c45('0x19')]?_0x46a2b7[_0x4c45('0x19')][_0x4c45('0x1b')]||null:null,'limit':_0x46a2b7[_0x4c45('0x19')]?_0x46a2b7[_0x4c45('0x19')]['limit']||null:null,'include':_0x46a2b7[_0x4c45('0x19')]?_0x46a2b7[_0x4c45('0x19')]['include']?_[_0x4c45('0x1c')](_0x46a2b7[_0x4c45('0x19')]['include'],function(_0x54ffeb){return{'model':db[_0x54ffeb[_0x4c45('0x1d')]],'as':_0x54ffeb['as'],'attributes':_0x54ffeb[_0x4c45('0x1b')],'include':_0x54ffeb[_0x4c45('0x1e')]?_['map'](_0x54ffeb[_0x4c45('0x1e')],function(_0xc717ae){return{'model':db[_0xc717ae[_0x4c45('0x1d')]],'as':_0xc717ae['as'],'attributes':_0xc717ae['attributes'],'include':_0xc717ae[_0x4c45('0x1e')]?_['map'](_0xc717ae[_0x4c45('0x1e')],function(_0x21cf3b){return{'model':db[_0x21cf3b[_0x4c45('0x1d')]],'as':_0x21cf3b['as'],'attributes':_0x21cf3b[_0x4c45('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c45('0xc')](function(_0x597389){logger[_0x4c45('0xd')](_0x4c45('0x1f'),_0x46a2b7);logger[_0x4c45('0x10')](_0x4c45('0x1f'),_0x46a2b7,JSON[_0x4c45('0x12')](_0x597389));_0x4acc40(_0x597389);})['catch'](function(_0x44553c){logger[_0x4c45('0x13')](_0x4c45('0x1f'),_0x44553c[_0x4c45('0x15')],_0x46a2b7);_0x31a083(_0x2786b5[_0x4c45('0x13')](0x1f4,_0x44553c[_0x4c45('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x290133){var _0x1b052c=this;return new Promise(function(_0x38a9fa,_0x53ebe9){return db[_0x4c45('0x20')][_0x4c45('0x21')]({'raw':_0x290133[_0x4c45('0x19')]?_0x290133[_0x4c45('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x290133[_0x4c45('0x19')]?_0x290133['options'][_0x4c45('0x1a')]||null:null,'attributes':_0x290133[_0x4c45('0x19')]?_0x290133[_0x4c45('0x19')][_0x4c45('0x1b')]||null:null,'include':_0x290133['options']?_0x290133[_0x4c45('0x19')]['include']?_[_0x4c45('0x1c')](_0x290133[_0x4c45('0x19')]['include'],function(_0x1a0dbf){return{'model':db[_0x1a0dbf[_0x4c45('0x1d')]],'as':_0x1a0dbf['as'],'attributes':_0x1a0dbf[_0x4c45('0x1b')],'include':_0x1a0dbf[_0x4c45('0x1e')]?_[_0x4c45('0x1c')](_0x1a0dbf[_0x4c45('0x1e')],function(_0x49e603){return{'model':db[_0x49e603[_0x4c45('0x1d')]],'as':_0x49e603['as'],'attributes':_0x49e603[_0x4c45('0x1b')],'include':_0x49e603[_0x4c45('0x1e')]?_[_0x4c45('0x1c')](_0x49e603['include'],function(_0x27b4b8){return{'model':db[_0x27b4b8[_0x4c45('0x1d')]],'as':_0x27b4b8['as'],'attributes':_0x27b4b8[_0x4c45('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c45('0xc')](function(_0x41c2ff){logger[_0x4c45('0xd')](_0x4c45('0x22'),_0x290133);logger[_0x4c45('0x10')](_0x4c45('0x22'),_0x290133,JSON[_0x4c45('0x12')](_0x41c2ff));_0x38a9fa(_0x41c2ff);})[_0x4c45('0x17')](function(_0x5d168c){logger[_0x4c45('0x13')](_0x4c45('0x22'),_0x5d168c[_0x4c45('0x15')],_0x290133);_0x53ebe9(_0x1b052c[_0x4c45('0x13')](0x1f4,_0x5d168c['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf11=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getDescriptions','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x128e6f,_0x1cc8a1){var _0x2ae82a=function(_0xd4dcaa){while(--_0xd4dcaa){_0x128e6f['push'](_0x128e6f['shift']());}};_0x2ae82a(++_0x1cc8a1);}(_0xaf11,0x17a));var _0x1af1=function(_0x10a649,_0x19ad03){_0x10a649=_0x10a649-0x0;var _0x53e030=_0xaf11[_0x10a649];return _0x53e030;};'use strict';var multer=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1af1('0x2'));var router=express['Router']();var fs_extra=require(_0x1af1('0x3'));var auth=require(_0x1af1('0x4'));var interaction=require(_0x1af1('0x5'));var config=require('../../config/environment');var controller=require(_0x1af1('0x6'));router['get']('/',auth[_0x1af1('0x7')](),controller[_0x1af1('0x8')]);router[_0x1af1('0x9')]('/:id',auth[_0x1af1('0x7')](),controller[_0x1af1('0xa')]);router['get']('/:id/fields',auth[_0x1af1('0x7')](),controller[_0x1af1('0xb')]);router[_0x1af1('0x9')](_0x1af1('0xc'),auth[_0x1af1('0x7')](),controller['getSubjects']);router[_0x1af1('0x9')]('/:id/descriptions',auth[_0x1af1('0x7')](),controller[_0x1af1('0xd')]);router[_0x1af1('0xe')]('/',auth[_0x1af1('0x7')](),controller['create']);router['put'](_0x1af1('0xf'),auth['isAuthenticated'](),controller[_0x1af1('0x10')]);router[_0x1af1('0x11')](_0x1af1('0xf'),auth[_0x1af1('0x7')](),controller[_0x1af1('0x12')]);module[_0x1af1('0x13')]=router;
\ No newline at end of file
+var _0x079f=['put','/:id','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','post','create'];(function(_0x4de3ae,_0x4c2d83){var _0x264e7c=function(_0x183150){while(--_0x183150){_0x4de3ae['push'](_0x4de3ae['shift']());}};_0x264e7c(++_0x4c2d83);}(_0x079f,0x8f));var _0xf079=function(_0x34c26b,_0x5e279b){_0x34c26b=_0x34c26b-0x0;var _0x2f9f58=_0x079f[_0x34c26b];return _0x2f9f58;};'use strict';var multer=require(_0xf079('0x0'));var util=require('util');var path=require(_0xf079('0x1'));var timeout=require('connect-timeout');var express=require(_0xf079('0x2'));var router=express[_0xf079('0x3')]();var fs_extra=require(_0xf079('0x4'));var auth=require(_0xf079('0x5'));var interaction=require(_0xf079('0x6'));var config=require(_0xf079('0x7'));var controller=require(_0xf079('0x8'));router[_0xf079('0x9')]('/',auth[_0xf079('0xa')](),controller[_0xf079('0xb')]);router[_0xf079('0x9')]('/:id',auth[_0xf079('0xa')](),controller[_0xf079('0xc')]);router[_0xf079('0x9')]('/:id/fields',auth[_0xf079('0xa')](),controller[_0xf079('0xd')]);router['get'](_0xf079('0xe'),auth[_0xf079('0xa')](),controller[_0xf079('0xf')]);router[_0xf079('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf079('0x10')]('/',auth[_0xf079('0xa')](),controller[_0xf079('0x11')]);router[_0xf079('0x12')](_0xf079('0x13'),auth[_0xf079('0xa')](),controller[_0xf079('0x14')]);router[_0xf079('0x15')](_0xf079('0x13'),auth[_0xf079('0xa')](),controller['destroy']);module[_0xf079('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xddd1=['exports','STRING','sequelize'];(function(_0x1b943f,_0x6f6e83){var _0x8b7549=function(_0x5b52d3){while(--_0x5b52d3){_0x1b943f['push'](_0x1b943f['shift']());}};_0x8b7549(++_0x6f6e83);}(_0xddd1,0x18e));var _0x1ddd=function(_0x2936a5,_0x46f12e){_0x2936a5=_0x2936a5-0x0;var _0x1eec2d=_0xddd1[_0x2936a5];return _0x1eec2d;};'use strict';var Sequelize=require(_0x1ddd('0x0'));module[_0x1ddd('0x1')]={'name':{'type':Sequelize[_0x1ddd('0x2')]},'description':{'type':Sequelize[_0x1ddd('0x2')]}};
\ No newline at end of file
+var _0x177e=['STRING','sequelize','exports'];(function(_0x2db4e3,_0x4d976f){var _0x5f3ecf=function(_0x31d908){while(--_0x31d908){_0x2db4e3['push'](_0x2db4e3['shift']());}};_0x5f3ecf(++_0x4d976f);}(_0x177e,0x1ed));var _0xe177=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x177e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe177('0x0'));module[_0xe177('0x1')]={'name':{'type':Sequelize[_0xe177('0x2')]},'description':{'type':Sequelize[_0xe177('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2d9=['merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ServicenowField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter'];(function(_0x35d361,_0x3573a7){var _0x458a5f=function(_0x46aa4a){while(--_0x46aa4a){_0x35d361['push'](_0x35d361['shift']());}};_0x458a5f(++_0x3573a7);}(_0xc2d9,0x109));var _0x9c2d=function(_0x2026d2,_0x7e394c){_0x2026d2=_0x2026d2-0x0;var _0x22fab2=_0xc2d9[_0x2026d2];return _0x22fab2;};'use strict';var emlformat=require(_0x9c2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c2d('0x1'));var jsonpatch=require(_0x9c2d('0x2'));var rp=require(_0x9c2d('0x3'));var moment=require(_0x9c2d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c2d('0x5'));var util=require(_0x9c2d('0x6'));var path=require(_0x9c2d('0x7'));var sox=require(_0x9c2d('0x8'));var csv=require('to-csv');var ejs=require(_0x9c2d('0x9'));var fs=require('fs');var fs_extra=require(_0x9c2d('0xa'));var _=require(_0x9c2d('0xb'));var squel=require(_0x9c2d('0xc'));var crypto=require(_0x9c2d('0xd'));var jsforce=require(_0x9c2d('0xe'));var deskjs=require(_0x9c2d('0xf'));var toCsv=require(_0x9c2d('0x10'));var querystring=require('querystring');var Papa=require(_0x9c2d('0x11'));var Redis=require(_0x9c2d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9c2d('0x13'));var as=require(_0x9c2d('0x14'));var hardwareService=require(_0x9c2d('0x15'));var logger=require(_0x9c2d('0x16'))(_0x9c2d('0x17'));var utils=require(_0x9c2d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9c2d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45f600,_0x4cc359){_0x4cc359=_0x4cc359||0xcc;return function(_0x4132c){if(_0x4132c){return _0x45f600[_0x9c2d('0x1a')](_0x4cc359);}return _0x45f600[_0x9c2d('0x1b')](_0x4cc359)['end']();};}function respondWithResult(_0x344387,_0xeeca58){_0xeeca58=_0xeeca58||0xc8;return function(_0x2fe50e){if(_0x2fe50e){return _0x344387['status'](_0xeeca58)['json'](_0x2fe50e);}};}function respondWithFilteredResult(_0x3df2c9,_0x59ebf9){return function(_0x2d75d6){if(_0x2d75d6){var _0x4cb438=typeof _0x59ebf9[_0x9c2d('0x1c')]===_0x9c2d('0x1d')&&typeof _0x59ebf9[_0x9c2d('0x1e')]===_0x9c2d('0x1d');var _0x3d59e7=_0x2d75d6[_0x9c2d('0x1f')];var _0x5bb806=_0x4cb438?0x0:_0x59ebf9[_0x9c2d('0x1c')];var _0x21dc4e=_0x4cb438?_0x2d75d6[_0x9c2d('0x1f')]:_0x59ebf9['offset']+_0x59ebf9[_0x9c2d('0x1e')];var _0x5dc550;if(_0x21dc4e>=_0x3d59e7){_0x21dc4e=_0x3d59e7;_0x5dc550=0xc8;}else{_0x5dc550=0xce;}_0x3df2c9['status'](_0x5dc550);return _0x3df2c9['set'](_0x9c2d('0x20'),_0x5bb806+'-'+_0x21dc4e+'/'+_0x3d59e7)[_0x9c2d('0x21')](_0x2d75d6);}return null;};}function patchUpdates(_0x1a5e18){return function(_0xa5d896){try{jsonpatch[_0x9c2d('0x22')](_0xa5d896,_0x1a5e18,!![]);}catch(_0x1c4faa){return BPromise[_0x9c2d('0x23')](_0x1c4faa);}return _0xa5d896[_0x9c2d('0x24')]();};}function saveUpdates(_0x34e66d,_0x203cdf){return function(_0x45ef71){if(_0x45ef71){return _0x45ef71['update'](_0x34e66d)[_0x9c2d('0x25')](function(_0x4a7933){return _0x4a7933;});}return null;};}function removeEntity(_0x1b71c1,_0x4e185f){return function(_0x41ade3){if(_0x41ade3){return _0x41ade3[_0x9c2d('0x26')]()[_0x9c2d('0x25')](function(){_0x1b71c1[_0x9c2d('0x1b')](0xcc)[_0x9c2d('0x27')]();});}};}function handleEntityNotFound(_0x165db4,_0x4439f0){return function(_0x455079){if(!_0x455079){_0x165db4['sendStatus'](0x194);}return _0x455079;};}function handleError(_0x4176b8,_0x67926){_0x67926=_0x67926||0x1f4;return function(_0x549d8d){logger[_0x9c2d('0x28')](_0x549d8d[_0x9c2d('0x29')]);if(_0x549d8d[_0x9c2d('0x2a')]){delete _0x549d8d[_0x9c2d('0x2a')];}_0x4176b8[_0x9c2d('0x1b')](_0x67926)[_0x9c2d('0x2b')](_0x549d8d);};}exports[_0x9c2d('0x2c')]=function(_0xae05fc,_0x3a84cc){var _0x1cbac6={},_0x1df0e1={},_0x62756d={'count':0x0,'rows':[]};var _0xc11306=_[_0x9c2d('0x2d')](db[_0x9c2d('0x2e')][_0x9c2d('0x2f')],function(_0x3a6798){return{'name':_0x3a6798[_0x9c2d('0x30')],'type':_0x3a6798[_0x9c2d('0x31')]['key']};});_0x1df0e1[_0x9c2d('0x32')]=_[_0x9c2d('0x2d')](_0xc11306,_0x9c2d('0x2a'));_0x1df0e1[_0x9c2d('0x33')]=_[_0x9c2d('0x34')](_0xae05fc['query']);_0x1df0e1['filters']=_[_0x9c2d('0x35')](_0x1df0e1[_0x9c2d('0x32')],_0x1df0e1[_0x9c2d('0x33')]);_0x1cbac6['attributes']=_[_0x9c2d('0x35')](_0x1df0e1[_0x9c2d('0x32')],qs[_0x9c2d('0x36')](_0xae05fc['query'][_0x9c2d('0x36')]));_0x1cbac6['attributes']=_0x1cbac6[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x1cbac6[_0x9c2d('0x37')]:_0x1df0e1[_0x9c2d('0x32')];if(!_0xae05fc[_0x9c2d('0x33')]['hasOwnProperty'](_0x9c2d('0x39'))){_0x1cbac6['limit']=qs['limit'](_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x1e')]);_0x1cbac6[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0xae05fc[_0x9c2d('0x33')]['offset']);}_0x1cbac6[_0x9c2d('0x3a')]=qs[_0x9c2d('0x3b')](_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x1cbac6[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_['pick'](_0xae05fc['query'],_0x1df0e1[_0x9c2d('0x3d')]),_0xc11306);if(_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x3e')]){_0x1cbac6[_0x9c2d('0x3c')]=_[_0x9c2d('0x3f')](_0x1cbac6[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0xc11306,function(_0xba696d){if(_0xba696d[_0x9c2d('0x31')]!=='VIRTUAL'){var _0x24bb6b={};_0x24bb6b[_0xba696d[_0x9c2d('0x2a')]]={'$like':'%'+_0xae05fc['query']['filter']+'%'};return _0x24bb6b;}})});}_0x1cbac6=_[_0x9c2d('0x3f')]({},_0x1cbac6,_0xae05fc[_0x9c2d('0x40')]);var _0x171b37={'where':_0x1cbac6[_0x9c2d('0x3c')]};return db[_0x9c2d('0x2e')][_0x9c2d('0x1f')](_0x171b37)[_0x9c2d('0x25')](function(_0xde2de0){_0x62756d['count']=_0xde2de0;if(_0xae05fc[_0x9c2d('0x33')][_0x9c2d('0x41')]){_0x1cbac6[_0x9c2d('0x42')]=[{'all':!![]}];}return db[_0x9c2d('0x2e')][_0x9c2d('0x43')](_0x1cbac6);})[_0x9c2d('0x25')](function(_0x474d1e){_0x62756d[_0x9c2d('0x44')]=_0x474d1e;return _0x62756d;})['then'](respondWithFilteredResult(_0x3a84cc,_0x1cbac6))[_0x9c2d('0x45')](handleError(_0x3a84cc,null));};exports[_0x9c2d('0x46')]=function(_0x10651c,_0x260524){var _0x53b12e={'raw':![],'where':{'id':_0x10651c[_0x9c2d('0x47')]['id']}},_0x6c9bc4={};_0x6c9bc4[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db[_0x9c2d('0x2e')][_0x9c2d('0x2f')]);_0x6c9bc4['query']=_['keys'](_0x10651c[_0x9c2d('0x33')]);_0x6c9bc4[_0x9c2d('0x3d')]=_[_0x9c2d('0x35')](_0x6c9bc4[_0x9c2d('0x32')],_0x6c9bc4[_0x9c2d('0x33')]);_0x53b12e['attributes']=_[_0x9c2d('0x35')](_0x6c9bc4['model'],qs['fields'](_0x10651c['query'][_0x9c2d('0x36')]));_0x53b12e[_0x9c2d('0x37')]=_0x53b12e[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x53b12e[_0x9c2d('0x37')]:_0x6c9bc4[_0x9c2d('0x32')];if(_0x10651c['query'][_0x9c2d('0x41')]){_0x53b12e['include']=[{'all':!![]}];}_0x53b12e=_[_0x9c2d('0x3f')]({},_0x53b12e,_0x10651c[_0x9c2d('0x40')]);return db[_0x9c2d('0x2e')][_0x9c2d('0x48')](_0x53b12e)[_0x9c2d('0x25')](handleEntityNotFound(_0x260524,null))['then'](respondWithResult(_0x260524,null))[_0x9c2d('0x45')](handleError(_0x260524,null));};exports[_0x9c2d('0x49')]=function(_0x2c88bf,_0x42755b){return db[_0x9c2d('0x2e')][_0x9c2d('0x49')](_0x2c88bf[_0x9c2d('0x4a')],{})[_0x9c2d('0x25')](respondWithResult(_0x42755b,0xc9))['catch'](handleError(_0x42755b,null));};exports['update']=function(_0x3e701e,_0xadf45b){if(_0x3e701e['body']['id']){delete _0x3e701e[_0x9c2d('0x4a')]['id'];}return db[_0x9c2d('0x2e')][_0x9c2d('0x48')]({'where':{'id':_0x3e701e['params']['id']}})[_0x9c2d('0x25')](handleEntityNotFound(_0xadf45b,null))['then'](saveUpdates(_0x3e701e[_0x9c2d('0x4a')],null))['then'](respondWithResult(_0xadf45b,null))['catch'](handleError(_0xadf45b,null));};exports[_0x9c2d('0x26')]=function(_0x17ea9f,_0x482887){return db[_0x9c2d('0x2e')][_0x9c2d('0x48')]({'where':{'id':_0x17ea9f[_0x9c2d('0x47')]['id']}})[_0x9c2d('0x25')](handleEntityNotFound(_0x482887,null))[_0x9c2d('0x25')](removeEntity(_0x482887,null))[_0x9c2d('0x45')](handleError(_0x482887,null));};exports['getFields']=function(_0xaf5924,_0x11ea8f,_0x59afbd){var _0x2bd485={};var _0x372bba={};var _0x2e988c;var _0x2893b9;return db[_0x9c2d('0x2e')][_0x9c2d('0x4b')]({'where':{'id':_0xaf5924['params']['id']}})['then'](handleEntityNotFound(_0x11ea8f,null))['then'](function(_0x54c1ea){if(_0x54c1ea){_0x2e988c=_0x54c1ea;_0x372bba[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db[_0x9c2d('0x4c')][_0x9c2d('0x2f')]);_0x372bba[_0x9c2d('0x33')]=_['keys'](_0xaf5924[_0x9c2d('0x33')]);_0x372bba[_0x9c2d('0x3d')]=_['intersection'](_0x372bba[_0x9c2d('0x32')],_0x372bba[_0x9c2d('0x33')]);_0x2bd485[_0x9c2d('0x37')]=_[_0x9c2d('0x35')](_0x372bba['model'],qs[_0x9c2d('0x36')](_0xaf5924[_0x9c2d('0x33')]['fields']));_0x2bd485[_0x9c2d('0x37')]=_0x2bd485[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x2bd485[_0x9c2d('0x37')]:_0x372bba['model'];_0x2bd485[_0x9c2d('0x3a')]=qs[_0x9c2d('0x3b')](_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x2bd485[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_[_0x9c2d('0x4d')](_0xaf5924['query'],_0x372bba[_0x9c2d('0x3d')]));if(_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x3e')]){_0x2bd485[_0x9c2d('0x3c')]=_['merge'](_0x2bd485[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0x2bd485[_0x9c2d('0x37')],function(_0xa6889e){var _0x1f5ec5={};_0x1f5ec5[_0xa6889e]={'$like':'%'+_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x3e')]+'%'};return _0x1f5ec5;})});}_0x2bd485=_[_0x9c2d('0x3f')]({},_0x2bd485,_0xaf5924[_0x9c2d('0x40')]);return _0x2e988c[_0x9c2d('0x4e')](_0x2bd485);}})[_0x9c2d('0x25')](function(_0x319882){if(_0x319882){_0x2893b9=_0x319882[_0x9c2d('0x38')];if(!_0xaf5924['query'][_0x9c2d('0x4f')](_0x9c2d('0x39'))){_0x2bd485[_0x9c2d('0x1e')]=qs['limit'](_0xaf5924['query'][_0x9c2d('0x1e')]);_0x2bd485[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0xaf5924[_0x9c2d('0x33')][_0x9c2d('0x1c')]);}return _0x2e988c['getFields'](_0x2bd485);}})[_0x9c2d('0x25')](function(_0x24a856){if(_0x24a856){return _0x24a856?{'count':_0x2893b9,'rows':_0x24a856}:null;}})[_0x9c2d('0x25')](respondWithResult(_0x11ea8f,null))[_0x9c2d('0x45')](handleError(_0x11ea8f,null));};exports[_0x9c2d('0x50')]=function(_0x532d4f,_0x42d67a,_0x4a51a4){var _0x5b9fa5={};var _0x2bcca2={};var _0x5f17ac;var _0x247952;return db[_0x9c2d('0x2e')][_0x9c2d('0x4b')]({'where':{'id':_0x532d4f['params']['id']}})['then'](handleEntityNotFound(_0x42d67a,null))[_0x9c2d('0x25')](function(_0x371e0b){if(_0x371e0b){_0x5f17ac=_0x371e0b;_0x2bcca2[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db[_0x9c2d('0x4c')][_0x9c2d('0x2f')]);_0x2bcca2[_0x9c2d('0x33')]=_[_0x9c2d('0x34')](_0x532d4f['query']);_0x2bcca2[_0x9c2d('0x3d')]=_[_0x9c2d('0x35')](_0x2bcca2[_0x9c2d('0x32')],_0x2bcca2[_0x9c2d('0x33')]);_0x5b9fa5[_0x9c2d('0x37')]=_['intersection'](_0x2bcca2[_0x9c2d('0x32')],qs[_0x9c2d('0x36')](_0x532d4f[_0x9c2d('0x33')][_0x9c2d('0x36')]));_0x5b9fa5['attributes']=_0x5b9fa5['attributes']['length']?_0x5b9fa5[_0x9c2d('0x37')]:_0x2bcca2[_0x9c2d('0x32')];_0x5b9fa5[_0x9c2d('0x3a')]=qs['sort'](_0x532d4f[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x5b9fa5[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_[_0x9c2d('0x4d')](_0x532d4f['query'],_0x2bcca2[_0x9c2d('0x3d')]));if(_0x532d4f['query']['filter']){_0x5b9fa5[_0x9c2d('0x3c')]=_[_0x9c2d('0x3f')](_0x5b9fa5[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0x5b9fa5[_0x9c2d('0x37')],function(_0x1e3060){var _0x561551={};_0x561551[_0x1e3060]={'$like':'%'+_0x532d4f[_0x9c2d('0x33')][_0x9c2d('0x3e')]+'%'};return _0x561551;})});}_0x5b9fa5=_[_0x9c2d('0x3f')]({},_0x5b9fa5,_0x532d4f['options']);return _0x5f17ac[_0x9c2d('0x50')](_0x5b9fa5);}})[_0x9c2d('0x25')](function(_0x5ce865){if(_0x5ce865){_0x247952=_0x5ce865['length'];if(!_0x532d4f['query'][_0x9c2d('0x4f')](_0x9c2d('0x39'))){_0x5b9fa5[_0x9c2d('0x1e')]=qs[_0x9c2d('0x1e')](_0x532d4f['query']['limit']);_0x5b9fa5[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0x532d4f['query']['offset']);}return _0x5f17ac[_0x9c2d('0x50')](_0x5b9fa5);}})[_0x9c2d('0x25')](function(_0x1b9b6f){if(_0x1b9b6f){return _0x1b9b6f?{'count':_0x247952,'rows':_0x1b9b6f}:null;}})[_0x9c2d('0x25')](respondWithResult(_0x42d67a,null))[_0x9c2d('0x45')](handleError(_0x42d67a,null));};exports['getDescriptions']=function(_0x3dc61d,_0x5ce321,_0x29f76a){var _0x408cea={};var _0xe2a7cf={};var _0x25932d;var _0x5b8c3c;return db[_0x9c2d('0x2e')]['findOne']({'where':{'id':_0x3dc61d[_0x9c2d('0x47')]['id']}})[_0x9c2d('0x25')](handleEntityNotFound(_0x5ce321,null))[_0x9c2d('0x25')](function(_0x3d5942){if(_0x3d5942){_0x25932d=_0x3d5942;_0xe2a7cf[_0x9c2d('0x32')]=_[_0x9c2d('0x34')](db['ServicenowField'][_0x9c2d('0x2f')]);_0xe2a7cf[_0x9c2d('0x33')]=_['keys'](_0x3dc61d[_0x9c2d('0x33')]);_0xe2a7cf[_0x9c2d('0x3d')]=_[_0x9c2d('0x35')](_0xe2a7cf[_0x9c2d('0x32')],_0xe2a7cf[_0x9c2d('0x33')]);_0x408cea[_0x9c2d('0x37')]=_[_0x9c2d('0x35')](_0xe2a7cf[_0x9c2d('0x32')],qs[_0x9c2d('0x36')](_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x36')]));_0x408cea[_0x9c2d('0x37')]=_0x408cea[_0x9c2d('0x37')][_0x9c2d('0x38')]?_0x408cea[_0x9c2d('0x37')]:_0xe2a7cf[_0x9c2d('0x32')];_0x408cea['order']=qs['sort'](_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x3b')]);_0x408cea[_0x9c2d('0x3c')]=qs[_0x9c2d('0x3d')](_[_0x9c2d('0x4d')](_0x3dc61d[_0x9c2d('0x33')],_0xe2a7cf[_0x9c2d('0x3d')]));if(_0x3dc61d[_0x9c2d('0x33')]['filter']){_0x408cea[_0x9c2d('0x3c')]=_[_0x9c2d('0x3f')](_0x408cea[_0x9c2d('0x3c')],{'$or':_[_0x9c2d('0x2d')](_0x408cea[_0x9c2d('0x37')],function(_0x54db4e){var _0x4d409e={};_0x4d409e[_0x54db4e]={'$like':'%'+_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x3e')]+'%'};return _0x4d409e;})});}_0x408cea=_[_0x9c2d('0x3f')]({},_0x408cea,_0x3dc61d[_0x9c2d('0x40')]);return _0x25932d[_0x9c2d('0x51')](_0x408cea);}})['then'](function(_0x3372b4){if(_0x3372b4){_0x5b8c3c=_0x3372b4[_0x9c2d('0x38')];if(!_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x4f')](_0x9c2d('0x39'))){_0x408cea[_0x9c2d('0x1e')]=qs['limit'](_0x3dc61d[_0x9c2d('0x33')][_0x9c2d('0x1e')]);_0x408cea[_0x9c2d('0x1c')]=qs[_0x9c2d('0x1c')](_0x3dc61d['query']['offset']);}return _0x25932d['getDescriptions'](_0x408cea);}})[_0x9c2d('0x25')](function(_0x1bc86c){if(_0x1bc86c){return _0x1bc86c?{'count':_0x5b8c3c,'rows':_0x1bc86c}:null;}})[_0x9c2d('0x25')](respondWithResult(_0x5ce321,null))[_0x9c2d('0x45')](handleError(_0x5ce321,null));};
\ No newline at end of file
+var _0x489e=['keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getFields','findOne','ServicenowField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','query'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0x489e,0x6f));var _0xe489=function(_0x5c92df,_0x1e69d1){_0x5c92df=_0x5c92df-0x0;var _0x56064f=_0x489e[_0x5c92df];return _0x56064f;};'use strict';var emlformat=require(_0xe489('0x0'));var rimraf=require(_0xe489('0x1'));var zipdir=require(_0xe489('0x2'));var jsonpatch=require(_0xe489('0x3'));var rp=require('request-promise');var moment=require(_0xe489('0x4'));var BPromise=require(_0xe489('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe489('0x6'));var csv=require(_0xe489('0x7'));var ejs=require(_0xe489('0x8'));var fs=require('fs');var fs_extra=require(_0xe489('0x9'));var _=require('lodash');var squel=require(_0xe489('0xa'));var crypto=require(_0xe489('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe489('0xc'));var toCsv=require(_0xe489('0x7'));var querystring=require(_0xe489('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe489('0xe'));var qs=require(_0xe489('0xf'));var as=require(_0xe489('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe489('0x11'))(_0xe489('0x12'));var utils=require(_0xe489('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe489('0x14'))['db'];function respondWithStatusCode(_0x5d70d1,_0x4734eb){_0x4734eb=_0x4734eb||0xcc;return function(_0x16f957){if(_0x16f957){return _0x5d70d1[_0xe489('0x15')](_0x4734eb);}return _0x5d70d1['status'](_0x4734eb)[_0xe489('0x16')]();};}function respondWithResult(_0x4e4e06,_0x59200c){_0x59200c=_0x59200c||0xc8;return function(_0x2e0f0c){if(_0x2e0f0c){return _0x4e4e06[_0xe489('0x17')](_0x59200c)[_0xe489('0x18')](_0x2e0f0c);}};}function respondWithFilteredResult(_0x3d4257,_0x152d36){return function(_0xd48df4){if(_0xd48df4){var _0x10f233=typeof _0x152d36['offset']===_0xe489('0x19')&&typeof _0x152d36[_0xe489('0x1a')]==='undefined';var _0x151636=_0xd48df4[_0xe489('0x1b')];var _0x44aefb=_0x10f233?0x0:_0x152d36[_0xe489('0x1c')];var _0x587b3b=_0x10f233?_0xd48df4[_0xe489('0x1b')]:_0x152d36[_0xe489('0x1c')]+_0x152d36[_0xe489('0x1a')];var _0x4aa95b;if(_0x587b3b>=_0x151636){_0x587b3b=_0x151636;_0x4aa95b=0xc8;}else{_0x4aa95b=0xce;}_0x3d4257[_0xe489('0x17')](_0x4aa95b);return _0x3d4257[_0xe489('0x1d')](_0xe489('0x1e'),_0x44aefb+'-'+_0x587b3b+'/'+_0x151636)[_0xe489('0x18')](_0xd48df4);}return null;};}function patchUpdates(_0x1248bd){return function(_0x3b4358){try{jsonpatch[_0xe489('0x1f')](_0x3b4358,_0x1248bd,!![]);}catch(_0x267abb){return BPromise[_0xe489('0x20')](_0x267abb);}return _0x3b4358[_0xe489('0x21')]();};}function saveUpdates(_0x73d958,_0x5483ff){return function(_0x492e07){if(_0x492e07){return _0x492e07[_0xe489('0x22')](_0x73d958)['then'](function(_0x48f1c9){return _0x48f1c9;});}return null;};}function removeEntity(_0x55a9c2,_0x32d50d){return function(_0x33ec8c){if(_0x33ec8c){return _0x33ec8c[_0xe489('0x23')]()[_0xe489('0x24')](function(){_0x55a9c2[_0xe489('0x17')](0xcc)[_0xe489('0x16')]();});}};}function handleEntityNotFound(_0x161245,_0x4b04b3){return function(_0x1e60dd){if(!_0x1e60dd){_0x161245[_0xe489('0x15')](0x194);}return _0x1e60dd;};}function handleError(_0x405fd0,_0x303005){_0x303005=_0x303005||0x1f4;return function(_0x378263){logger['error'](_0x378263[_0xe489('0x25')]);if(_0x378263[_0xe489('0x26')]){delete _0x378263[_0xe489('0x26')];}_0x405fd0[_0xe489('0x17')](_0x303005)['send'](_0x378263);};}exports[_0xe489('0x27')]=function(_0x1b2d4d,_0x1ebecb){var _0x3d74c3={},_0x1d73bc={},_0x5d46a0={'count':0x0,'rows':[]};var _0x19eaad=_[_0xe489('0x28')](db[_0xe489('0x29')][_0xe489('0x2a')],function(_0x2c8271){return{'name':_0x2c8271[_0xe489('0x2b')],'type':_0x2c8271[_0xe489('0x2c')][_0xe489('0x2d')]};});_0x1d73bc['model']=_[_0xe489('0x28')](_0x19eaad,_0xe489('0x26'));_0x1d73bc[_0xe489('0x2e')]=_[_0xe489('0x2f')](_0x1b2d4d[_0xe489('0x2e')]);_0x1d73bc['filters']=_[_0xe489('0x30')](_0x1d73bc[_0xe489('0x31')],_0x1d73bc[_0xe489('0x2e')]);_0x3d74c3[_0xe489('0x32')]=_[_0xe489('0x30')](_0x1d73bc[_0xe489('0x31')],qs['fields'](_0x1b2d4d[_0xe489('0x2e')][_0xe489('0x33')]));_0x3d74c3[_0xe489('0x32')]=_0x3d74c3['attributes'][_0xe489('0x34')]?_0x3d74c3['attributes']:_0x1d73bc[_0xe489('0x31')];if(!_0x1b2d4d[_0xe489('0x2e')]['hasOwnProperty'](_0xe489('0x35'))){_0x3d74c3[_0xe489('0x1a')]=qs[_0xe489('0x1a')](_0x1b2d4d[_0xe489('0x2e')][_0xe489('0x1a')]);_0x3d74c3[_0xe489('0x1c')]=qs[_0xe489('0x1c')](_0x1b2d4d[_0xe489('0x2e')]['offset']);}_0x3d74c3[_0xe489('0x36')]=qs[_0xe489('0x37')](_0x1b2d4d['query'][_0xe489('0x37')]);_0x3d74c3[_0xe489('0x38')]=qs[_0xe489('0x39')](_['pick'](_0x1b2d4d['query'],_0x1d73bc['filters']),_0x19eaad);if(_0x1b2d4d[_0xe489('0x2e')][_0xe489('0x3a')]){_0x3d74c3['where']=_[_0xe489('0x3b')](_0x3d74c3[_0xe489('0x38')],{'$or':_[_0xe489('0x28')](_0x19eaad,function(_0xaff6e9){if(_0xaff6e9[_0xe489('0x2c')]!==_0xe489('0x3c')){var _0x1a4b18={};_0x1a4b18[_0xaff6e9[_0xe489('0x26')]]={'$like':'%'+_0x1b2d4d[_0xe489('0x2e')][_0xe489('0x3a')]+'%'};return _0x1a4b18;}})});}_0x3d74c3=_[_0xe489('0x3b')]({},_0x3d74c3,_0x1b2d4d['options']);var _0x284894={'where':_0x3d74c3['where']};return db[_0xe489('0x29')][_0xe489('0x1b')](_0x284894)['then'](function(_0x23f16b){_0x5d46a0[_0xe489('0x1b')]=_0x23f16b;if(_0x1b2d4d['query'][_0xe489('0x3d')]){_0x3d74c3['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xe489('0x3e')](_0x3d74c3);})[_0xe489('0x24')](function(_0x221342){_0x5d46a0[_0xe489('0x3f')]=_0x221342;return _0x5d46a0;})[_0xe489('0x24')](respondWithFilteredResult(_0x1ebecb,_0x3d74c3))[_0xe489('0x40')](handleError(_0x1ebecb,null));};exports[_0xe489('0x41')]=function(_0x24087f,_0xfecaa1){var _0x54609a={'raw':![],'where':{'id':_0x24087f[_0xe489('0x42')]['id']}},_0x5c7d01={};_0x5c7d01[_0xe489('0x31')]=_[_0xe489('0x2f')](db[_0xe489('0x29')][_0xe489('0x2a')]);_0x5c7d01['query']=_['keys'](_0x24087f['query']);_0x5c7d01[_0xe489('0x39')]=_[_0xe489('0x30')](_0x5c7d01[_0xe489('0x31')],_0x5c7d01[_0xe489('0x2e')]);_0x54609a[_0xe489('0x32')]=_[_0xe489('0x30')](_0x5c7d01[_0xe489('0x31')],qs[_0xe489('0x33')](_0x24087f[_0xe489('0x2e')]['fields']));_0x54609a[_0xe489('0x32')]=_0x54609a[_0xe489('0x32')][_0xe489('0x34')]?_0x54609a[_0xe489('0x32')]:_0x5c7d01[_0xe489('0x31')];if(_0x24087f[_0xe489('0x2e')][_0xe489('0x3d')]){_0x54609a[_0xe489('0x43')]=[{'all':!![]}];}_0x54609a=_[_0xe489('0x3b')]({},_0x54609a,_0x24087f[_0xe489('0x44')]);return db['ServicenowConfiguration'][_0xe489('0x45')](_0x54609a)[_0xe489('0x24')](handleEntityNotFound(_0xfecaa1,null))['then'](respondWithResult(_0xfecaa1,null))['catch'](handleError(_0xfecaa1,null));};exports[_0xe489('0x46')]=function(_0x155825,_0x13acb8){return db[_0xe489('0x29')][_0xe489('0x46')](_0x155825['body'],{})[_0xe489('0x24')](respondWithResult(_0x13acb8,0xc9))[_0xe489('0x40')](handleError(_0x13acb8,null));};exports[_0xe489('0x22')]=function(_0x2ddb3a,_0x11217f){if(_0x2ddb3a[_0xe489('0x47')]['id']){delete _0x2ddb3a[_0xe489('0x47')]['id'];}return db[_0xe489('0x29')]['find']({'where':{'id':_0x2ddb3a[_0xe489('0x42')]['id']}})['then'](handleEntityNotFound(_0x11217f,null))['then'](saveUpdates(_0x2ddb3a[_0xe489('0x47')],null))['then'](respondWithResult(_0x11217f,null))[_0xe489('0x40')](handleError(_0x11217f,null));};exports[_0xe489('0x23')]=function(_0x320ab6,_0x780e76){return db[_0xe489('0x29')]['find']({'where':{'id':_0x320ab6['params']['id']}})[_0xe489('0x24')](handleEntityNotFound(_0x780e76,null))['then'](removeEntity(_0x780e76,null))['catch'](handleError(_0x780e76,null));};exports[_0xe489('0x48')]=function(_0x29ec56,_0x2fc794,_0x507118){var _0x3871bb={};var _0x5267bb={};var _0x28063d;var _0x34e2ca;return db['ServicenowConfiguration'][_0xe489('0x49')]({'where':{'id':_0x29ec56['params']['id']}})[_0xe489('0x24')](handleEntityNotFound(_0x2fc794,null))['then'](function(_0x3b9748){if(_0x3b9748){_0x28063d=_0x3b9748;_0x5267bb['model']=_[_0xe489('0x2f')](db[_0xe489('0x4a')][_0xe489('0x2a')]);_0x5267bb[_0xe489('0x2e')]=_[_0xe489('0x2f')](_0x29ec56[_0xe489('0x2e')]);_0x5267bb['filters']=_['intersection'](_0x5267bb['model'],_0x5267bb[_0xe489('0x2e')]);_0x3871bb[_0xe489('0x32')]=_[_0xe489('0x30')](_0x5267bb['model'],qs['fields'](_0x29ec56[_0xe489('0x2e')]['fields']));_0x3871bb['attributes']=_0x3871bb[_0xe489('0x32')]['length']?_0x3871bb[_0xe489('0x32')]:_0x5267bb[_0xe489('0x31')];_0x3871bb[_0xe489('0x36')]=qs['sort'](_0x29ec56[_0xe489('0x2e')][_0xe489('0x37')]);_0x3871bb[_0xe489('0x38')]=qs['filters'](_[_0xe489('0x4b')](_0x29ec56[_0xe489('0x2e')],_0x5267bb[_0xe489('0x39')]));if(_0x29ec56['query']['filter']){_0x3871bb[_0xe489('0x38')]=_['merge'](_0x3871bb[_0xe489('0x38')],{'$or':_[_0xe489('0x28')](_0x3871bb['attributes'],function(_0x21fc32){var _0x48b626={};_0x48b626[_0x21fc32]={'$like':'%'+_0x29ec56['query'][_0xe489('0x3a')]+'%'};return _0x48b626;})});}_0x3871bb=_[_0xe489('0x3b')]({},_0x3871bb,_0x29ec56[_0xe489('0x44')]);return _0x28063d['getFields'](_0x3871bb);}})[_0xe489('0x24')](function(_0x5b797a){if(_0x5b797a){_0x34e2ca=_0x5b797a[_0xe489('0x34')];if(!_0x29ec56[_0xe489('0x2e')][_0xe489('0x4c')](_0xe489('0x35'))){_0x3871bb['limit']=qs[_0xe489('0x1a')](_0x29ec56[_0xe489('0x2e')][_0xe489('0x1a')]);_0x3871bb[_0xe489('0x1c')]=qs[_0xe489('0x1c')](_0x29ec56[_0xe489('0x2e')][_0xe489('0x1c')]);}return _0x28063d[_0xe489('0x48')](_0x3871bb);}})[_0xe489('0x24')](function(_0x1b028a){if(_0x1b028a){return _0x1b028a?{'count':_0x34e2ca,'rows':_0x1b028a}:null;}})[_0xe489('0x24')](respondWithResult(_0x2fc794,null))[_0xe489('0x40')](handleError(_0x2fc794,null));};exports[_0xe489('0x4d')]=function(_0x443ec9,_0xc7b2,_0x3d0883){var _0x5324b4={};var _0x3f299e={};var _0x105d02;var _0xfebb0a;return db['ServicenowConfiguration'][_0xe489('0x49')]({'where':{'id':_0x443ec9[_0xe489('0x42')]['id']}})[_0xe489('0x24')](handleEntityNotFound(_0xc7b2,null))[_0xe489('0x24')](function(_0x19329e){if(_0x19329e){_0x105d02=_0x19329e;_0x3f299e[_0xe489('0x31')]=_[_0xe489('0x2f')](db[_0xe489('0x4a')][_0xe489('0x2a')]);_0x3f299e[_0xe489('0x2e')]=_['keys'](_0x443ec9[_0xe489('0x2e')]);_0x3f299e[_0xe489('0x39')]=_[_0xe489('0x30')](_0x3f299e['model'],_0x3f299e[_0xe489('0x2e')]);_0x5324b4['attributes']=_[_0xe489('0x30')](_0x3f299e[_0xe489('0x31')],qs['fields'](_0x443ec9[_0xe489('0x2e')][_0xe489('0x33')]));_0x5324b4[_0xe489('0x32')]=_0x5324b4[_0xe489('0x32')][_0xe489('0x34')]?_0x5324b4[_0xe489('0x32')]:_0x3f299e[_0xe489('0x31')];_0x5324b4[_0xe489('0x36')]=qs[_0xe489('0x37')](_0x443ec9[_0xe489('0x2e')][_0xe489('0x37')]);_0x5324b4[_0xe489('0x38')]=qs['filters'](_['pick'](_0x443ec9['query'],_0x3f299e[_0xe489('0x39')]));if(_0x443ec9[_0xe489('0x2e')][_0xe489('0x3a')]){_0x5324b4[_0xe489('0x38')]=_[_0xe489('0x3b')](_0x5324b4[_0xe489('0x38')],{'$or':_['map'](_0x5324b4['attributes'],function(_0x2463dc){var _0x5a3ab5={};_0x5a3ab5[_0x2463dc]={'$like':'%'+_0x443ec9['query'][_0xe489('0x3a')]+'%'};return _0x5a3ab5;})});}_0x5324b4=_[_0xe489('0x3b')]({},_0x5324b4,_0x443ec9['options']);return _0x105d02[_0xe489('0x4d')](_0x5324b4);}})[_0xe489('0x24')](function(_0x87be08){if(_0x87be08){_0xfebb0a=_0x87be08[_0xe489('0x34')];if(!_0x443ec9[_0xe489('0x2e')][_0xe489('0x4c')](_0xe489('0x35'))){_0x5324b4[_0xe489('0x1a')]=qs[_0xe489('0x1a')](_0x443ec9[_0xe489('0x2e')]['limit']);_0x5324b4[_0xe489('0x1c')]=qs['offset'](_0x443ec9['query'][_0xe489('0x1c')]);}return _0x105d02[_0xe489('0x4d')](_0x5324b4);}})[_0xe489('0x24')](function(_0x30628e){if(_0x30628e){return _0x30628e?{'count':_0xfebb0a,'rows':_0x30628e}:null;}})['then'](respondWithResult(_0xc7b2,null))[_0xe489('0x40')](handleError(_0xc7b2,null));};exports[_0xe489('0x4e')]=function(_0x31e8dc,_0x1e8441,_0x3d2fca){var _0x1c1afb={};var _0x3e8dc6={};var _0x31eac4;var _0x5403ee;return db[_0xe489('0x29')]['findOne']({'where':{'id':_0x31e8dc[_0xe489('0x42')]['id']}})[_0xe489('0x24')](handleEntityNotFound(_0x1e8441,null))[_0xe489('0x24')](function(_0x55447a){if(_0x55447a){_0x31eac4=_0x55447a;_0x3e8dc6[_0xe489('0x31')]=_['keys'](db[_0xe489('0x4a')]['rawAttributes']);_0x3e8dc6[_0xe489('0x2e')]=_[_0xe489('0x2f')](_0x31e8dc[_0xe489('0x2e')]);_0x3e8dc6['filters']=_['intersection'](_0x3e8dc6['model'],_0x3e8dc6[_0xe489('0x2e')]);_0x1c1afb['attributes']=_['intersection'](_0x3e8dc6[_0xe489('0x31')],qs[_0xe489('0x33')](_0x31e8dc[_0xe489('0x2e')]['fields']));_0x1c1afb[_0xe489('0x32')]=_0x1c1afb[_0xe489('0x32')][_0xe489('0x34')]?_0x1c1afb[_0xe489('0x32')]:_0x3e8dc6['model'];_0x1c1afb[_0xe489('0x36')]=qs[_0xe489('0x37')](_0x31e8dc['query']['sort']);_0x1c1afb[_0xe489('0x38')]=qs['filters'](_[_0xe489('0x4b')](_0x31e8dc[_0xe489('0x2e')],_0x3e8dc6[_0xe489('0x39')]));if(_0x31e8dc['query'][_0xe489('0x3a')]){_0x1c1afb[_0xe489('0x38')]=_['merge'](_0x1c1afb[_0xe489('0x38')],{'$or':_[_0xe489('0x28')](_0x1c1afb[_0xe489('0x32')],function(_0x1877eb){var _0x1cc33f={};_0x1cc33f[_0x1877eb]={'$like':'%'+_0x31e8dc[_0xe489('0x2e')][_0xe489('0x3a')]+'%'};return _0x1cc33f;})});}_0x1c1afb=_[_0xe489('0x3b')]({},_0x1c1afb,_0x31e8dc[_0xe489('0x44')]);return _0x31eac4[_0xe489('0x4e')](_0x1c1afb);}})[_0xe489('0x24')](function(_0x2e9d6a){if(_0x2e9d6a){_0x5403ee=_0x2e9d6a[_0xe489('0x34')];if(!_0x31e8dc[_0xe489('0x2e')]['hasOwnProperty'](_0xe489('0x35'))){_0x1c1afb[_0xe489('0x1a')]=qs[_0xe489('0x1a')](_0x31e8dc[_0xe489('0x2e')]['limit']);_0x1c1afb['offset']=qs[_0xe489('0x1c')](_0x31e8dc[_0xe489('0x2e')][_0xe489('0x1c')]);}return _0x31eac4[_0xe489('0x4e')](_0x1c1afb);}})[_0xe489('0x24')](function(_0xa6342e){if(_0xa6342e){return _0xa6342e?{'count':_0x5403ee,'rows':_0xa6342e}:null;}})[_0xe489('0x24')](respondWithResult(_0x1e8441,null))[_0xe489('0x40')](handleError(_0x1e8441,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd027=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7d02('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7d02('0x1'));var BPromise=require(_0x7d02('0x2'));var rp=require(_0x7d02('0x3'));var fs=require('fs');var path=require(_0x7d02('0x4'));var rimraf=require(_0x7d02('0x5'));var config=require(_0x7d02('0x6'));var attributes=require(_0x7d02('0x7'));module[_0x7d02('0x8')]=function(_0x50824f,_0x1e75e2){return _0x50824f[_0x7d02('0x9')](_0x7d02('0xa'),attributes,{'tableName':_0x7d02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4dc0=['./intServicenowConfiguration.attributes','define','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x236494,_0x291abb){var _0x4cc60d=function(_0x41de81){while(--_0x41de81){_0x236494['push'](_0x236494['shift']());}};_0x4cc60d(++_0x291abb);}(_0x4dc0,0x13d));var _0x04dc=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x4dc0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04dc('0x0'))(_0x04dc('0x1'));var moment=require(_0x04dc('0x2'));var BPromise=require(_0x04dc('0x3'));var rp=require(_0x04dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04dc('0x5'));var config=require(_0x04dc('0x6'));var attributes=require(_0x04dc('0x7'));module['exports']=function(_0x224df5,_0x40b21a){return _0x224df5[_0x04dc('0x8')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e33=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x9795a7,_0x4817a8){var _0x467e1d=function(_0x4c2f13){while(--_0x4c2f13){_0x9795a7['push'](_0x9795a7['shift']());}};_0x467e1d(++_0x4817a8);}(_0x9e33,0x144));var _0x39e3=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9e33[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x39e3('0x0'));var util=require(_0x39e3('0x1'));var moment=require(_0x39e3('0x2'));var BPromise=require(_0x39e3('0x3'));var rs=require(_0x39e3('0x4'));var fs=require('fs');var Redis=require(_0x39e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x39e3('0x6'))(_0x39e3('0x7'));var config=require(_0x39e3('0x8'));var jayson=require(_0x39e3('0x9'));var client=jayson[_0x39e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2cb4,_0x3da195,_0x4a7806){return new BPromise(function(_0x38ce81,_0x50a66a){return client['request'](_0x4d2cb4,_0x4a7806)[_0x39e3('0xb')](function(_0x1add3b){logger['info'](_0x39e3('0xc'),_0x3da195,_0x39e3('0xd'));logger['debug'](_0x39e3('0xe'),_0x3da195,'request\x20sent',JSON['stringify'](_0x1add3b));if(_0x1add3b['error']){if(_0x1add3b[_0x39e3('0xf')]['code']===0x1f4){logger[_0x39e3('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3da195,_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);return _0x50a66a(_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);}logger[_0x39e3('0xf')](_0x39e3('0xc'),_0x3da195,_0x1add3b[_0x39e3('0xf')]['message']);return _0x38ce81(_0x1add3b[_0x39e3('0xf')][_0x39e3('0x10')]);}else{logger[_0x39e3('0x11')](_0x39e3('0xc'),_0x3da195,_0x39e3('0xd'));_0x38ce81(_0x1add3b[_0x39e3('0x12')][_0x39e3('0x10')]);}})[_0x39e3('0x13')](function(_0x7c86b4){logger[_0x39e3('0xf')](_0x39e3('0xc'),_0x3da195,_0x7c86b4);_0x50a66a(_0x7c86b4);});});}
\ No newline at end of file
+var _0xea1e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xea1e,0x1e2));var _0xeea1=function(_0x459795,_0x30e03c){_0x459795=_0x459795-0x0;var _0x30a048=_0xea1e[_0x459795];return _0x30a048;};'use strict';var _=require(_0xeea1('0x0'));var util=require(_0xeea1('0x1'));var moment=require('moment');var BPromise=require(_0xeea1('0x2'));var rs=require(_0xeea1('0x3'));var fs=require('fs');var Redis=require(_0xeea1('0x4'));var db=require(_0xeea1('0x5'))['db'];var utils=require(_0xeea1('0x6'));var logger=require(_0xeea1('0x7'))(_0xeea1('0x8'));var config=require(_0xeea1('0x9'));var jayson=require(_0xeea1('0xa'));var client=jayson[_0xeea1('0xb')][_0xeea1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36e1f0,_0x3a57b5,_0x6ada92){return new BPromise(function(_0x265ba1,_0x4af368){return client[_0xeea1('0xd')](_0x36e1f0,_0x6ada92)[_0xeea1('0xe')](function(_0x6dd336){logger[_0xeea1('0xf')](_0xeea1('0x10'),_0x3a57b5,_0xeea1('0x11'));logger['debug'](_0xeea1('0x12'),_0x3a57b5,'request\x20sent',JSON['stringify'](_0x6dd336));if(_0x6dd336[_0xeea1('0x13')]){if(_0x6dd336[_0xeea1('0x13')][_0xeea1('0x14')]===0x1f4){logger[_0xeea1('0x13')](_0xeea1('0x10'),_0x3a57b5,_0x6dd336['error'][_0xeea1('0x15')]);return _0x4af368(_0x6dd336[_0xeea1('0x13')]['message']);}logger[_0xeea1('0x13')](_0xeea1('0x10'),_0x3a57b5,_0x6dd336[_0xeea1('0x13')][_0xeea1('0x15')]);return _0x265ba1(_0x6dd336[_0xeea1('0x13')][_0xeea1('0x15')]);}else{logger[_0xeea1('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a57b5,_0xeea1('0x11'));_0x265ba1(_0x6dd336['result'][_0xeea1('0x15')]);}})[_0xeea1('0x16')](function(_0x47b093){logger[_0xeea1('0x13')](_0xeea1('0x10'),_0x3a57b5,_0x47b093);_0x4af368(_0x47b093);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab20=['post','create','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab20,0x1db));var _0x0ab2=function(_0x571012,_0x334737){_0x571012=_0x571012-0x0;var _0x4d2ccd=_0xab20[_0x571012];return _0x4d2ccd;};'use strict';var multer=require(_0x0ab2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ab2('0x1'));var router=express[_0x0ab2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0ab2('0x3'));var interaction=require(_0x0ab2('0x4'));var config=require(_0x0ab2('0x5'));var controller=require(_0x0ab2('0x6'));router[_0x0ab2('0x7')]('/',auth[_0x0ab2('0x8')](),controller['index']);router[_0x0ab2('0x7')](_0x0ab2('0x9'),auth['isAuthenticated'](),controller[_0x0ab2('0xa')]);router[_0x0ab2('0xb')]('/',auth[_0x0ab2('0x8')](),controller[_0x0ab2('0xc')]);router[_0x0ab2('0xd')](_0x0ab2('0x9'),auth[_0x0ab2('0x8')](),controller[_0x0ab2('0xe')]);router[_0x0ab2('0xf')](_0x0ab2('0x9'),auth[_0x0ab2('0x8')](),controller[_0x0ab2('0x10')]);module[_0x0ab2('0x11')]=router;
\ No newline at end of file
+var _0xe541=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x322eea,_0x59aeef){var _0x53f886=function(_0x4395f8){while(--_0x4395f8){_0x322eea['push'](_0x322eea['shift']());}};_0x53f886(++_0x59aeef);}(_0xe541,0x71));var _0x1e54=function(_0x555569,_0x15669b){_0x555569=_0x555569-0x0;var _0x2541ff=_0xe541[_0x555569];return _0x2541ff;};'use strict';var multer=require(_0x1e54('0x0'));var util=require(_0x1e54('0x1'));var path=require(_0x1e54('0x2'));var timeout=require(_0x1e54('0x3'));var express=require(_0x1e54('0x4'));var router=express[_0x1e54('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1e54('0x6'));var config=require(_0x1e54('0x7'));var controller=require(_0x1e54('0x8'));router['get']('/',auth[_0x1e54('0x9')](),controller[_0x1e54('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1e54('0xb')]('/',auth[_0x1e54('0x9')](),controller[_0x1e54('0xc')]);router['put'](_0x1e54('0xd'),auth[_0x1e54('0x9')](),controller[_0x1e54('0xe')]);router[_0x1e54('0xf')](_0x1e54('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x1e54('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb944=['BOOLEAN','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x2d2fc5,_0x37bbf5){var _0x33bb1e=function(_0x120c50){while(--_0x120c50){_0x2d2fc5['push'](_0x2d2fc5['shift']());}};_0x33bb1e(++_0x37bbf5);}(_0xb944,0x1b3));var _0x4b94=function(_0x58c2ac,_0x58c01b){_0x58c2ac=_0x58c2ac-0x0;var _0x10cb51=_0xb944[_0x58c2ac];return _0x10cb51;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4b94('0x0')](_0x4b94('0x1'),_0x4b94('0x2'),'customVariable','keyValue',_0x4b94('0x3')),'defaultValue':_0x4b94('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4b94('0x4')]},'keyType':{'type':Sequelize[_0x4b94('0x0')](_0x4b94('0x1'),_0x4b94('0x2'),_0x4b94('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4b94('0x4')]},'nameField':{'type':Sequelize[_0x4b94('0x4')]},'customField':{'type':Sequelize[_0x4b94('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4651=['ENUM','string','variable','customVariable','picklist','STRING','sequelize'];(function(_0x10b776,_0x23c9fe){var _0x42d785=function(_0x4bfce4){while(--_0x4bfce4){_0x10b776['push'](_0x10b776['shift']());}};_0x42d785(++_0x23c9fe);}(_0x4651,0x8b));var _0x1465=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4651[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1465('0x0'));module['exports']={'type':{'type':Sequelize[_0x1465('0x1')](_0x1465('0x2'),_0x1465('0x3'),_0x1465('0x4'),'keyValue',_0x1465('0x5')),'defaultValue':_0x1465('0x2')},'content':{'type':Sequelize[_0x1465('0x6')]},'key':{'type':Sequelize[_0x1465('0x6')]},'keyType':{'type':Sequelize[_0x1465('0x1')](_0x1465('0x2'),_0x1465('0x3'),_0x1465('0x4'))},'keyContent':{'type':Sequelize[_0x1465('0x6')]},'idField':{'type':Sequelize[_0x1465('0x6')]},'nameField':{'type':Sequelize[_0x1465('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1465('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x199d=['reject','save','then','error','stack','name','send','index','map','ServicenowField','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','rawAttributes','find','create','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x199d,0x74));var _0xd199=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x199d[_0x2b91c5];return _0xbd5531;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd199('0x0'));var zipdir=require(_0xd199('0x1'));var jsonpatch=require(_0xd199('0x2'));var rp=require(_0xd199('0x3'));var moment=require(_0xd199('0x4'));var BPromise=require(_0xd199('0x5'));var Mustache=require(_0xd199('0x6'));var util=require(_0xd199('0x7'));var path=require(_0xd199('0x8'));var sox=require(_0xd199('0x9'));var csv=require(_0xd199('0xa'));var ejs=require(_0xd199('0xb'));var fs=require('fs');var fs_extra=require(_0xd199('0xc'));var _=require(_0xd199('0xd'));var squel=require(_0xd199('0xe'));var crypto=require(_0xd199('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd199('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd199('0x11'));var Papa=require(_0xd199('0x12'));var Redis=require(_0xd199('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd199('0x14'));var as=require(_0xd199('0x15'));var hardwareService=require(_0xd199('0x16'));var logger=require('../../config/logger')(_0xd199('0x17'));var utils=require('../../config/utils');var config=require(_0xd199('0x18'));var licenseUtil=require(_0xd199('0x19'));var db=require(_0xd199('0x1a'))['db'];function respondWithStatusCode(_0x408acb,_0x5cd66e){_0x5cd66e=_0x5cd66e||0xcc;return function(_0x79330d){if(_0x79330d){return _0x408acb[_0xd199('0x1b')](_0x5cd66e);}return _0x408acb[_0xd199('0x1c')](_0x5cd66e)[_0xd199('0x1d')]();};}function respondWithResult(_0x4fa488,_0x2c0234){_0x2c0234=_0x2c0234||0xc8;return function(_0x1c454c){if(_0x1c454c){return _0x4fa488[_0xd199('0x1c')](_0x2c0234)[_0xd199('0x1e')](_0x1c454c);}};}function respondWithFilteredResult(_0x5f1d4f,_0xe77815){return function(_0x1e6195){if(_0x1e6195){var _0xae269b=typeof _0xe77815[_0xd199('0x1f')]===_0xd199('0x20')&&typeof _0xe77815[_0xd199('0x21')]==='undefined';var _0x1ad69d=_0x1e6195[_0xd199('0x22')];var _0x1cf7d9=_0xae269b?0x0:_0xe77815[_0xd199('0x1f')];var _0x354139=_0xae269b?_0x1e6195[_0xd199('0x22')]:_0xe77815[_0xd199('0x1f')]+_0xe77815[_0xd199('0x21')];var _0x49df79;if(_0x354139>=_0x1ad69d){_0x354139=_0x1ad69d;_0x49df79=0xc8;}else{_0x49df79=0xce;}_0x5f1d4f['status'](_0x49df79);return _0x5f1d4f[_0xd199('0x23')](_0xd199('0x24'),_0x1cf7d9+'-'+_0x354139+'/'+_0x1ad69d)['json'](_0x1e6195);}return null;};}function patchUpdates(_0x1fc720){return function(_0x2e2fd3){try{jsonpatch[_0xd199('0x25')](_0x2e2fd3,_0x1fc720,!![]);}catch(_0x10871d){return BPromise[_0xd199('0x26')](_0x10871d);}return _0x2e2fd3[_0xd199('0x27')]();};}function saveUpdates(_0x2fbc92,_0x2e2c52){return function(_0x32c342){if(_0x32c342){return _0x32c342['update'](_0x2fbc92)[_0xd199('0x28')](function(_0x5f1867){return _0x5f1867;});}return null;};}function removeEntity(_0x3a8c3f,_0x58ab81){return function(_0x448ed9){if(_0x448ed9){return _0x448ed9['destroy']()['then'](function(){_0x3a8c3f[_0xd199('0x1c')](0xcc)[_0xd199('0x1d')]();});}};}function handleEntityNotFound(_0x211779,_0x1f681d){return function(_0x3f13aa){if(!_0x3f13aa){_0x211779[_0xd199('0x1b')](0x194);}return _0x3f13aa;};}function handleError(_0x1497e8,_0xf00b14){_0xf00b14=_0xf00b14||0x1f4;return function(_0x35d2f3){logger[_0xd199('0x29')](_0x35d2f3[_0xd199('0x2a')]);if(_0x35d2f3[_0xd199('0x2b')]){delete _0x35d2f3[_0xd199('0x2b')];}_0x1497e8[_0xd199('0x1c')](_0xf00b14)[_0xd199('0x2c')](_0x35d2f3);};}exports[_0xd199('0x2d')]=function(_0x52b6f2,_0x251fda){var _0x54d073={},_0xe330fd={},_0x34b688={'count':0x0,'rows':[]};var _0x56d0ec=_[_0xd199('0x2e')](db[_0xd199('0x2f')]['rawAttributes'],function(_0x526feb){return{'name':_0x526feb['fieldName'],'type':_0x526feb['type'][_0xd199('0x30')]};});_0xe330fd[_0xd199('0x31')]=_[_0xd199('0x2e')](_0x56d0ec,_0xd199('0x2b'));_0xe330fd[_0xd199('0x32')]=_[_0xd199('0x33')](_0x52b6f2[_0xd199('0x32')]);_0xe330fd['filters']=_['intersection'](_0xe330fd[_0xd199('0x31')],_0xe330fd[_0xd199('0x32')]);_0x54d073['attributes']=_[_0xd199('0x34')](_0xe330fd[_0xd199('0x31')],qs['fields'](_0x52b6f2[_0xd199('0x32')][_0xd199('0x35')]));_0x54d073['attributes']=_0x54d073[_0xd199('0x36')][_0xd199('0x37')]?_0x54d073[_0xd199('0x36')]:_0xe330fd[_0xd199('0x31')];if(!_0x52b6f2['query'][_0xd199('0x38')](_0xd199('0x39'))){_0x54d073[_0xd199('0x21')]=qs[_0xd199('0x21')](_0x52b6f2['query']['limit']);_0x54d073[_0xd199('0x1f')]=qs[_0xd199('0x1f')](_0x52b6f2[_0xd199('0x32')][_0xd199('0x1f')]);}_0x54d073['order']=qs[_0xd199('0x3a')](_0x52b6f2[_0xd199('0x32')][_0xd199('0x3a')]);_0x54d073['where']=qs[_0xd199('0x3b')](_[_0xd199('0x3c')](_0x52b6f2[_0xd199('0x32')],_0xe330fd[_0xd199('0x3b')]),_0x56d0ec);if(_0x52b6f2[_0xd199('0x32')]['filter']){_0x54d073[_0xd199('0x3d')]=_[_0xd199('0x3e')](_0x54d073[_0xd199('0x3d')],{'$or':_[_0xd199('0x2e')](_0x56d0ec,function(_0x5e73b3){if(_0x5e73b3['type']!==_0xd199('0x3f')){var _0x7e8eba={};_0x7e8eba[_0x5e73b3[_0xd199('0x2b')]]={'$like':'%'+_0x52b6f2[_0xd199('0x32')][_0xd199('0x40')]+'%'};return _0x7e8eba;}})});}_0x54d073=_[_0xd199('0x3e')]({},_0x54d073,_0x52b6f2[_0xd199('0x41')]);var _0x2b698a={'where':_0x54d073[_0xd199('0x3d')]};return db[_0xd199('0x2f')][_0xd199('0x22')](_0x2b698a)[_0xd199('0x28')](function(_0x50eebb){_0x34b688[_0xd199('0x22')]=_0x50eebb;if(_0x52b6f2[_0xd199('0x32')]['includeAll']){_0x54d073[_0xd199('0x42')]=[{'all':!![]}];}return db[_0xd199('0x2f')][_0xd199('0x43')](_0x54d073);})[_0xd199('0x28')](function(_0x18f373){_0x34b688['rows']=_0x18f373;return _0x34b688;})['then'](respondWithFilteredResult(_0x251fda,_0x54d073))[_0xd199('0x44')](handleError(_0x251fda,null));};exports[_0xd199('0x45')]=function(_0xd8166f,_0x5ea9eb){var _0xf530b3={'raw':!![],'where':{'id':_0xd8166f[_0xd199('0x46')]['id']}},_0x163cd9={};_0x163cd9['model']=_[_0xd199('0x33')](db['ServicenowField'][_0xd199('0x47')]);_0x163cd9[_0xd199('0x32')]=_['keys'](_0xd8166f['query']);_0x163cd9[_0xd199('0x3b')]=_[_0xd199('0x34')](_0x163cd9[_0xd199('0x31')],_0x163cd9[_0xd199('0x32')]);_0xf530b3[_0xd199('0x36')]=_['intersection'](_0x163cd9[_0xd199('0x31')],qs[_0xd199('0x35')](_0xd8166f[_0xd199('0x32')][_0xd199('0x35')]));_0xf530b3['attributes']=_0xf530b3['attributes'][_0xd199('0x37')]?_0xf530b3['attributes']:_0x163cd9[_0xd199('0x31')];if(_0xd8166f[_0xd199('0x32')]['includeAll']){_0xf530b3[_0xd199('0x42')]=[{'all':!![]}];}_0xf530b3=_[_0xd199('0x3e')]({},_0xf530b3,_0xd8166f[_0xd199('0x41')]);return db[_0xd199('0x2f')][_0xd199('0x48')](_0xf530b3)['then'](handleEntityNotFound(_0x5ea9eb,null))[_0xd199('0x28')](respondWithResult(_0x5ea9eb,null))[_0xd199('0x44')](handleError(_0x5ea9eb,null));};exports['create']=function(_0x39259d,_0x4f6d66){return db[_0xd199('0x2f')][_0xd199('0x49')](_0x39259d['body'],{})[_0xd199('0x28')](respondWithResult(_0x4f6d66,0xc9))[_0xd199('0x44')](handleError(_0x4f6d66,null));};exports[_0xd199('0x4a')]=function(_0xa6b17,_0x3c808b){if(_0xa6b17[_0xd199('0x4b')]['id']){delete _0xa6b17[_0xd199('0x4b')]['id'];}return db[_0xd199('0x2f')][_0xd199('0x48')]({'where':{'id':_0xa6b17['params']['id']}})[_0xd199('0x28')](handleEntityNotFound(_0x3c808b,null))[_0xd199('0x28')](saveUpdates(_0xa6b17[_0xd199('0x4b')],null))[_0xd199('0x28')](respondWithResult(_0x3c808b,null))[_0xd199('0x44')](handleError(_0x3c808b,null));};exports[_0xd199('0x4c')]=function(_0x47db24,_0x5728e9){return db[_0xd199('0x2f')]['find']({'where':{'id':_0x47db24[_0xd199('0x46')]['id']}})[_0xd199('0x28')](handleEntityNotFound(_0x5728e9,null))[_0xd199('0x28')](removeEntity(_0x5728e9,null))['catch'](handleError(_0x5728e9,null));};
\ No newline at end of file
+var _0x800f=['send','index','map','rawAttributes','fieldName','type','key','query','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','ServicenowField','findAll','rows','catch','show','params','keys','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','count','offset','limit','json','apply','update','then','sendStatus','error','name'];(function(_0x59529e,_0x549139){var _0x3db3a6=function(_0x3891f5){while(--_0x3891f5){_0x59529e['push'](_0x59529e['shift']());}};_0x3db3a6(++_0x549139);}(_0x800f,0x181));var _0xf800=function(_0x430350,_0x37f1b2){_0x430350=_0x430350-0x0;var _0x364825=_0x800f[_0x430350];return _0x364825;};'use strict';var emlformat=require(_0xf800('0x0'));var rimraf=require(_0xf800('0x1'));var zipdir=require(_0xf800('0x2'));var jsonpatch=require(_0xf800('0x3'));var rp=require(_0xf800('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf800('0x5'));var util=require(_0xf800('0x6'));var path=require('path');var sox=require(_0xf800('0x7'));var csv=require(_0xf800('0x8'));var ejs=require(_0xf800('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf800('0xa'));var squel=require(_0xf800('0xb'));var crypto=require(_0xf800('0xc'));var jsforce=require(_0xf800('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf800('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf800('0xe'));var authService=require(_0xf800('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf800('0x10'));var logger=require(_0xf800('0x11'))(_0xf800('0x12'));var utils=require(_0xf800('0x13'));var config=require(_0xf800('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf800('0x15'))['db'];function respondWithStatusCode(_0x53fcad,_0x47e4e6){_0x47e4e6=_0x47e4e6||0xcc;return function(_0x3ed204){if(_0x3ed204){return _0x53fcad['sendStatus'](_0x47e4e6);}return _0x53fcad[_0xf800('0x16')](_0x47e4e6)[_0xf800('0x17')]();};}function respondWithResult(_0x3210ed,_0x459893){_0x459893=_0x459893||0xc8;return function(_0x1da05b){if(_0x1da05b){return _0x3210ed[_0xf800('0x16')](_0x459893)['json'](_0x1da05b);}};}function respondWithFilteredResult(_0x3d6d7f,_0xb7afb1){return function(_0x23360c){if(_0x23360c){var _0x4fa603=typeof _0xb7afb1['offset']===_0xf800('0x18')&&typeof _0xb7afb1['limit']===_0xf800('0x18');var _0x28ca3c=_0x23360c[_0xf800('0x19')];var _0x4c2cf0=_0x4fa603?0x0:_0xb7afb1['offset'];var _0x3da22c=_0x4fa603?_0x23360c['count']:_0xb7afb1[_0xf800('0x1a')]+_0xb7afb1[_0xf800('0x1b')];var _0x58c0f6;if(_0x3da22c>=_0x28ca3c){_0x3da22c=_0x28ca3c;_0x58c0f6=0xc8;}else{_0x58c0f6=0xce;}_0x3d6d7f[_0xf800('0x16')](_0x58c0f6);return _0x3d6d7f['set']('Content-Range',_0x4c2cf0+'-'+_0x3da22c+'/'+_0x28ca3c)[_0xf800('0x1c')](_0x23360c);}return null;};}function patchUpdates(_0x161997){return function(_0x2acd45){try{jsonpatch[_0xf800('0x1d')](_0x2acd45,_0x161997,!![]);}catch(_0x33a057){return BPromise['reject'](_0x33a057);}return _0x2acd45['save']();};}function saveUpdates(_0x2ab811,_0x7bf726){return function(_0x5aaeb0){if(_0x5aaeb0){return _0x5aaeb0[_0xf800('0x1e')](_0x2ab811)[_0xf800('0x1f')](function(_0x4f8711){return _0x4f8711;});}return null;};}function removeEntity(_0xbfcd46,_0x39d10c){return function(_0x25903b){if(_0x25903b){return _0x25903b['destroy']()['then'](function(){_0xbfcd46[_0xf800('0x16')](0xcc)[_0xf800('0x17')]();});}};}function handleEntityNotFound(_0x18a7a0,_0x2bed4b){return function(_0x342a46){if(!_0x342a46){_0x18a7a0[_0xf800('0x20')](0x194);}return _0x342a46;};}function handleError(_0x27fda4,_0x2eaaab){_0x2eaaab=_0x2eaaab||0x1f4;return function(_0xef5e7f){logger[_0xf800('0x21')](_0xef5e7f['stack']);if(_0xef5e7f[_0xf800('0x22')]){delete _0xef5e7f[_0xf800('0x22')];}_0x27fda4[_0xf800('0x16')](_0x2eaaab)[_0xf800('0x23')](_0xef5e7f);};}exports[_0xf800('0x24')]=function(_0x3e492c,_0x4c30e7){var _0x416e9a={},_0x397db1={},_0x45fdca={'count':0x0,'rows':[]};var _0x34a681=_[_0xf800('0x25')](db['ServicenowField'][_0xf800('0x26')],function(_0x1e7e39){return{'name':_0x1e7e39[_0xf800('0x27')],'type':_0x1e7e39[_0xf800('0x28')][_0xf800('0x29')]};});_0x397db1['model']=_[_0xf800('0x25')](_0x34a681,_0xf800('0x22'));_0x397db1[_0xf800('0x2a')]=_['keys'](_0x3e492c['query']);_0x397db1['filters']=_['intersection'](_0x397db1['model'],_0x397db1[_0xf800('0x2a')]);_0x416e9a[_0xf800('0x2b')]=_[_0xf800('0x2c')](_0x397db1['model'],qs[_0xf800('0x2d')](_0x3e492c[_0xf800('0x2a')]['fields']));_0x416e9a[_0xf800('0x2b')]=_0x416e9a[_0xf800('0x2b')][_0xf800('0x2e')]?_0x416e9a[_0xf800('0x2b')]:_0x397db1[_0xf800('0x2f')];if(!_0x3e492c['query'][_0xf800('0x30')](_0xf800('0x31'))){_0x416e9a[_0xf800('0x1b')]=qs[_0xf800('0x1b')](_0x3e492c['query'][_0xf800('0x1b')]);_0x416e9a[_0xf800('0x1a')]=qs[_0xf800('0x1a')](_0x3e492c['query']['offset']);}_0x416e9a[_0xf800('0x32')]=qs[_0xf800('0x33')](_0x3e492c[_0xf800('0x2a')][_0xf800('0x33')]);_0x416e9a[_0xf800('0x34')]=qs[_0xf800('0x35')](_[_0xf800('0x36')](_0x3e492c[_0xf800('0x2a')],_0x397db1[_0xf800('0x35')]),_0x34a681);if(_0x3e492c[_0xf800('0x2a')][_0xf800('0x37')]){_0x416e9a[_0xf800('0x34')]=_[_0xf800('0x38')](_0x416e9a['where'],{'$or':_[_0xf800('0x25')](_0x34a681,function(_0x1f0933){if(_0x1f0933[_0xf800('0x28')]!==_0xf800('0x39')){var _0x58d02={};_0x58d02[_0x1f0933[_0xf800('0x22')]]={'$like':'%'+_0x3e492c[_0xf800('0x2a')][_0xf800('0x37')]+'%'};return _0x58d02;}})});}_0x416e9a=_['merge']({},_0x416e9a,_0x3e492c['options']);var _0x2d27a9={'where':_0x416e9a[_0xf800('0x34')]};return db['ServicenowField'][_0xf800('0x19')](_0x2d27a9)[_0xf800('0x1f')](function(_0x36f22d){_0x45fdca[_0xf800('0x19')]=_0x36f22d;if(_0x3e492c[_0xf800('0x2a')][_0xf800('0x3a')]){_0x416e9a[_0xf800('0x3b')]=[{'all':!![]}];}return db[_0xf800('0x3c')][_0xf800('0x3d')](_0x416e9a);})['then'](function(_0x4c4968){_0x45fdca[_0xf800('0x3e')]=_0x4c4968;return _0x45fdca;})[_0xf800('0x1f')](respondWithFilteredResult(_0x4c30e7,_0x416e9a))[_0xf800('0x3f')](handleError(_0x4c30e7,null));};exports[_0xf800('0x40')]=function(_0x1d4da0,_0x11674f){var _0x4598fe={'raw':!![],'where':{'id':_0x1d4da0[_0xf800('0x41')]['id']}},_0x534df5={};_0x534df5[_0xf800('0x2f')]=_[_0xf800('0x42')](db[_0xf800('0x3c')][_0xf800('0x26')]);_0x534df5[_0xf800('0x2a')]=_['keys'](_0x1d4da0[_0xf800('0x2a')]);_0x534df5[_0xf800('0x35')]=_[_0xf800('0x2c')](_0x534df5['model'],_0x534df5['query']);_0x4598fe['attributes']=_[_0xf800('0x2c')](_0x534df5[_0xf800('0x2f')],qs[_0xf800('0x2d')](_0x1d4da0[_0xf800('0x2a')][_0xf800('0x2d')]));_0x4598fe[_0xf800('0x2b')]=_0x4598fe[_0xf800('0x2b')][_0xf800('0x2e')]?_0x4598fe[_0xf800('0x2b')]:_0x534df5[_0xf800('0x2f')];if(_0x1d4da0[_0xf800('0x2a')][_0xf800('0x3a')]){_0x4598fe[_0xf800('0x3b')]=[{'all':!![]}];}_0x4598fe=_[_0xf800('0x38')]({},_0x4598fe,_0x1d4da0[_0xf800('0x43')]);return db[_0xf800('0x3c')][_0xf800('0x44')](_0x4598fe)[_0xf800('0x1f')](handleEntityNotFound(_0x11674f,null))['then'](respondWithResult(_0x11674f,null))['catch'](handleError(_0x11674f,null));};exports['create']=function(_0x5d63dc,_0xbbe2c2){return db[_0xf800('0x3c')]['create'](_0x5d63dc[_0xf800('0x45')],{})[_0xf800('0x1f')](respondWithResult(_0xbbe2c2,0xc9))[_0xf800('0x3f')](handleError(_0xbbe2c2,null));};exports[_0xf800('0x1e')]=function(_0xb1022e,_0x427dc2){if(_0xb1022e['body']['id']){delete _0xb1022e[_0xf800('0x45')]['id'];}return db[_0xf800('0x3c')]['find']({'where':{'id':_0xb1022e[_0xf800('0x41')]['id']}})[_0xf800('0x1f')](handleEntityNotFound(_0x427dc2,null))[_0xf800('0x1f')](saveUpdates(_0xb1022e[_0xf800('0x45')],null))[_0xf800('0x1f')](respondWithResult(_0x427dc2,null))[_0xf800('0x3f')](handleError(_0x427dc2,null));};exports['destroy']=function(_0x1bd767,_0x7423f0){return db['ServicenowField'][_0xf800('0x44')]({'where':{'id':_0x1bd767[_0xf800('0x41')]['id']}})[_0xf800('0x1f')](handleEntityNotFound(_0x7423f0,null))[_0xf800('0x1f')](removeEntity(_0x7423f0,null))[_0xf800('0x3f')](handleError(_0x7423f0,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd058=['FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x1126eb,_0x3b8f0f){var _0xd6de31=function(_0x5b4c5c){while(--_0x5b4c5c){_0x1126eb['push'](_0x1126eb['shift']());}};_0xd6de31(++_0x3b8f0f);}(_0xd058,0x16d));var _0x8d05=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xd058[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0x8d05('0x0'));var util=require(_0x8d05('0x1'));var logger=require(_0x8d05('0x2'))('api');var moment=require(_0x8d05('0x3'));var BPromise=require(_0x8d05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d05('0x5'));var rimraf=require(_0x8d05('0x6'));var config=require(_0x8d05('0x7'));var attributes=require(_0x8d05('0x8'));module[_0x8d05('0x9')]=function(_0x3902c6,_0x29723b){return _0x3902c6['define']('ServicenowField',attributes,{'tableName':_0x8d05('0xa'),'paranoid':![],'indexes':[{'name':_0x8d05('0xb'),'fields':[_0x8d05('0xc'),_0x8d05('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xde1c=['servicenow_unique_index','idField','lodash','../../config/logger','moment','bluebird','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x1f6188,_0x432d91){var _0x474d90=function(_0x5d4937){while(--_0x5d4937){_0x1f6188['push'](_0x1f6188['shift']());}};_0x474d90(++_0x432d91);}(_0xde1c,0x1a6));var _0xcde1=function(_0x26e7ec,_0x4d6280){_0x26e7ec=_0x26e7ec-0x0;var _0x43c9e2=_0xde1c[_0x26e7ec];return _0x43c9e2;};'use strict';var _=require(_0xcde1('0x0'));var util=require('util');var logger=require(_0xcde1('0x1'))('api');var moment=require(_0xcde1('0x2'));var BPromise=require(_0xcde1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcde1('0x4'));var rimraf=require(_0xcde1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcde1('0x6'));module[_0xcde1('0x7')]=function(_0x356a67,_0xdd3ad1){return _0x356a67[_0xcde1('0x8')](_0xcde1('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xcde1('0xa'),'fields':[_0xcde1('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
+var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x2cf73c,_0x57992e){var _0x3a1216=function(_0x1e93ef){while(--_0x1e93ef){_0x2cf73c['push'](_0x2cf73c['shift']());}};_0x3a1216(++_0x57992e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xcb91[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4beb63,_0x5cb2c0){var _0x4d31df=function(_0x4e3a8e){while(--_0x4e3a8e){_0x4beb63['push'](_0x4beb63['shift']());}};_0x4d31df(++_0x5cb2c0);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2497da,_0x16d802){var _0x51654f=function(_0x289922){while(--_0x289922){_0x2497da['push'](_0x2497da['shift']());}};_0x51654f(++_0x16d802);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x37d310,_0x2e6228){var _0x15cb7c=function(_0x33c83b){while(--_0x33c83b){_0x37d310['push'](_0x37d310['shift']());}};_0x15cb7c(++_0x2e6228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x43ca29,_0x331cff){var _0x23de9a=function(_0x2e854f){while(--_0x2e854f){_0x43ca29['push'](_0x43ca29['shift']());}};_0x23de9a(++_0x331cff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f93=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','findOne','pick','map','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_type','parent_name','direction','username','password','slice','substring','lastIndexOf','format','%s%s','JSON','stringify','PLAIN','Password\x20Expired','POST','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields'];(function(_0x2f18a1,_0x2dc9b7){var _0x11980b=function(_0x3aaad0){while(--_0x3aaad0){_0x2f18a1['push'](_0x2f18a1['shift']());}};_0x11980b(++_0x2dc9b7);}(_0x6f93,0xb3));var _0x36f9=function(_0x5ce963,_0x2e1709){_0x5ce963=_0x5ce963-0x0;var _0x4c091a=_0x6f93[_0x5ce963];return _0x4c091a;};'use strict';var emlformat=require(_0x36f9('0x0'));var rimraf=require(_0x36f9('0x1'));var zipdir=require(_0x36f9('0x2'));var jsonpatch=require(_0x36f9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x36f9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36f9('0x5'));var sox=require(_0x36f9('0x6'));var csv=require(_0x36f9('0x7'));var ejs=require(_0x36f9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x36f9('0x9'));var crypto=require('crypto');var jsforce=require(_0x36f9('0xa'));var deskjs=require(_0x36f9('0xb'));var toCsv=require(_0x36f9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x36f9('0xc'));var authService=require(_0x36f9('0xd'));var qs=require(_0x36f9('0xe'));var as=require(_0x36f9('0xf'));var hardwareService=require(_0x36f9('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x36f9('0x11'));var licenseUtil=require(_0x36f9('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x36f9('0x13'));function respondWithStatusCode(_0x2315f5,_0x305915){_0x305915=_0x305915||0xcc;return function(_0x354abf){if(_0x354abf){return _0x2315f5[_0x36f9('0x14')](_0x305915);}return _0x2315f5[_0x36f9('0x15')](_0x305915)[_0x36f9('0x16')]();};}function respondWithResult(_0x1d2ac5,_0x31f041){_0x31f041=_0x31f041||0xc8;return function(_0x428569){if(_0x428569){return _0x1d2ac5[_0x36f9('0x15')](_0x31f041)[_0x36f9('0x17')](_0x428569);}};}function respondWithFilteredResult(_0x4801c9,_0x461da3){return function(_0x5d9ebe){if(_0x5d9ebe){var _0x1cb856=typeof _0x461da3[_0x36f9('0x18')]===_0x36f9('0x19')&&typeof _0x461da3[_0x36f9('0x1a')]==='undefined';var _0x2b36b9=_0x5d9ebe[_0x36f9('0x1b')];var _0x294f2b=_0x1cb856?0x0:_0x461da3['offset'];var _0x35fde5=_0x1cb856?_0x5d9ebe['count']:_0x461da3[_0x36f9('0x18')]+_0x461da3['limit'];var _0x1622a4;if(_0x35fde5>=_0x2b36b9){_0x35fde5=_0x2b36b9;_0x1622a4=0xc8;}else{_0x1622a4=0xce;}_0x4801c9[_0x36f9('0x15')](_0x1622a4);return _0x4801c9['set'](_0x36f9('0x1c'),_0x294f2b+'-'+_0x35fde5+'/'+_0x2b36b9)[_0x36f9('0x17')](_0x5d9ebe);}return null;};}function patchUpdates(_0xee74b2){return function(_0x4c3fbf){try{jsonpatch[_0x36f9('0x1d')](_0x4c3fbf,_0xee74b2,!![]);}catch(_0x57bea2){return BPromise[_0x36f9('0x1e')](_0x57bea2);}return _0x4c3fbf[_0x36f9('0x1f')]();};}function saveUpdates(_0x26af48,_0x345d9b){return function(_0xf4e668){if(_0xf4e668){return _0xf4e668[_0x36f9('0x20')](_0x26af48)[_0x36f9('0x21')](function(_0x4a1f40){return _0x4a1f40;});}return null;};}function removeEntity(_0x2d5df2,_0xb67470){return function(_0x4d1406){if(_0x4d1406){return _0x4d1406[_0x36f9('0x22')]()[_0x36f9('0x21')](function(){_0x2d5df2[_0x36f9('0x15')](0xcc)[_0x36f9('0x16')]();});}};}function handleEntityNotFound(_0x2d9ea7,_0x53cd1f){return function(_0x598573){if(!_0x598573){_0x2d9ea7['sendStatus'](0x194);}return _0x598573;};}function handleError(_0x4ec75c,_0x1748a7){_0x1748a7=_0x1748a7||0x1f4;return function(_0x30a5f0){logger['error'](_0x30a5f0[_0x36f9('0x23')]);if(_0x30a5f0['name']){delete _0x30a5f0[_0x36f9('0x24')];}_0x4ec75c['status'](_0x1748a7)[_0x36f9('0x25')](_0x30a5f0);};}exports[_0x36f9('0x26')]=function(_0x8052ec,_0x3977bd){var _0x3c7a80={},_0x2524b6={},_0x5bb989={'count':0x0,'rows':[]};var _0x4e81a9=_['map'](db[_0x36f9('0x27')][_0x36f9('0x28')],function(_0x35cc8f){return{'name':_0x35cc8f[_0x36f9('0x29')],'type':_0x35cc8f[_0x36f9('0x2a')]['key']};});_0x2524b6[_0x36f9('0x2b')]=_['map'](_0x4e81a9,_0x36f9('0x24'));_0x2524b6[_0x36f9('0x2c')]=_['keys'](_0x8052ec[_0x36f9('0x2c')]);_0x2524b6[_0x36f9('0x2d')]=_[_0x36f9('0x2e')](_0x2524b6[_0x36f9('0x2b')],_0x2524b6[_0x36f9('0x2c')]);_0x3c7a80[_0x36f9('0x2f')]=_[_0x36f9('0x2e')](_0x2524b6[_0x36f9('0x2b')],qs[_0x36f9('0x30')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x30')]));_0x3c7a80[_0x36f9('0x2f')]=_0x3c7a80[_0x36f9('0x2f')]['length']?_0x3c7a80[_0x36f9('0x2f')]:_0x2524b6['model'];if(!_0x8052ec[_0x36f9('0x2c')]['hasOwnProperty'](_0x36f9('0x31'))){_0x3c7a80['limit']=qs[_0x36f9('0x1a')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x1a')]);_0x3c7a80[_0x36f9('0x18')]=qs[_0x36f9('0x18')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x18')]);}_0x3c7a80[_0x36f9('0x32')]=qs[_0x36f9('0x33')](_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x33')]);_0x3c7a80[_0x36f9('0x34')]=qs['filters'](_['pick'](_0x8052ec[_0x36f9('0x2c')],_0x2524b6['filters']),_0x4e81a9);if(_0x8052ec[_0x36f9('0x2c')][_0x36f9('0x35')]){_0x3c7a80[_0x36f9('0x34')]=_[_0x36f9('0x36')](_0x3c7a80[_0x36f9('0x34')],{'$or':_['map'](_0x4e81a9,function(_0x227e47){if(_0x227e47['type']!==_0x36f9('0x37')){var _0x100667={};_0x100667[_0x227e47[_0x36f9('0x24')]]={'$like':'%'+_0x8052ec[_0x36f9('0x2c')]['filter']+'%'};return _0x100667;}})});}_0x3c7a80=_[_0x36f9('0x36')]({},_0x3c7a80,_0x8052ec[_0x36f9('0x38')]);var _0x519619={'where':_0x3c7a80[_0x36f9('0x34')]};return db[_0x36f9('0x27')][_0x36f9('0x1b')](_0x519619)['then'](function(_0x12c6b4){_0x5bb989[_0x36f9('0x1b')]=_0x12c6b4;if(_0x8052ec['query'][_0x36f9('0x39')]){_0x3c7a80[_0x36f9('0x3a')]=[{'all':!![]}];}return db[_0x36f9('0x27')][_0x36f9('0x3b')](_0x3c7a80);})['then'](function(_0x31e6cb){_0x5bb989['rows']=_0x31e6cb;return _0x5bb989;})['then'](respondWithFilteredResult(_0x3977bd,_0x3c7a80))[_0x36f9('0x3c')](handleError(_0x3977bd,null));};exports[_0x36f9('0x3d')]=function(_0x293f70,_0x11acda){var _0x2b61e4={'raw':![],'where':{'id':_0x293f70[_0x36f9('0x3e')]['id']}},_0x1d5b01={};_0x1d5b01[_0x36f9('0x2b')]=_['keys'](db['SugarcrmAccount'][_0x36f9('0x28')]);_0x1d5b01[_0x36f9('0x2c')]=_[_0x36f9('0x3f')](_0x293f70['query']);_0x1d5b01[_0x36f9('0x2d')]=_[_0x36f9('0x2e')](_0x1d5b01[_0x36f9('0x2b')],_0x1d5b01[_0x36f9('0x2c')]);_0x2b61e4[_0x36f9('0x2f')]=_['intersection'](_0x1d5b01[_0x36f9('0x2b')],qs[_0x36f9('0x30')](_0x293f70[_0x36f9('0x2c')][_0x36f9('0x30')]));_0x2b61e4[_0x36f9('0x2f')]=_0x2b61e4[_0x36f9('0x2f')][_0x36f9('0x40')]?_0x2b61e4[_0x36f9('0x2f')]:_0x1d5b01[_0x36f9('0x2b')];if(_0x293f70['query'][_0x36f9('0x39')]){_0x2b61e4['include']=[{'all':!![]}];}_0x2b61e4=_[_0x36f9('0x36')]({},_0x2b61e4,_0x293f70[_0x36f9('0x38')]);return db[_0x36f9('0x27')][_0x36f9('0x41')](_0x2b61e4)[_0x36f9('0x21')](handleEntityNotFound(_0x11acda,null))[_0x36f9('0x21')](respondWithResult(_0x11acda,null))[_0x36f9('0x3c')](handleError(_0x11acda,null));};exports[_0x36f9('0x42')]=function(_0x1ff93a,_0x2b86e2){return db[_0x36f9('0x27')][_0x36f9('0x42')](_0x1ff93a[_0x36f9('0x43')],{})[_0x36f9('0x21')](respondWithResult(_0x2b86e2,0xc9))[_0x36f9('0x3c')](handleError(_0x2b86e2,null));};exports[_0x36f9('0x20')]=function(_0x22e900,_0x21a575){if(_0x22e900[_0x36f9('0x43')]['id']){delete _0x22e900[_0x36f9('0x43')]['id'];}return db[_0x36f9('0x27')][_0x36f9('0x41')]({'where':{'id':_0x22e900[_0x36f9('0x3e')]['id']}})[_0x36f9('0x21')](handleEntityNotFound(_0x21a575,null))['then'](saveUpdates(_0x22e900[_0x36f9('0x43')],null))[_0x36f9('0x21')](respondWithResult(_0x21a575,null))[_0x36f9('0x3c')](handleError(_0x21a575,null));};exports['destroy']=function(_0x1c0d7f,_0x26dabe){return db[_0x36f9('0x27')][_0x36f9('0x41')]({'where':{'id':_0x1c0d7f['params']['id']}})['then'](handleEntityNotFound(_0x26dabe,null))[_0x36f9('0x21')](removeEntity(_0x26dabe,null))[_0x36f9('0x3c')](handleError(_0x26dabe,null));};exports['getConfigurations']=function(_0x50ac2e,_0x1187bb,_0x23059c){var _0x197492={};var _0x2d6efe={};var _0xd45a09;var _0x3403a4;return db['SugarcrmAccount'][_0x36f9('0x44')]({'where':{'id':_0x50ac2e[_0x36f9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1187bb,null))[_0x36f9('0x21')](function(_0x4fc64){if(_0x4fc64){_0xd45a09=_0x4fc64;_0x2d6efe[_0x36f9('0x2b')]=_[_0x36f9('0x3f')](db['SugarcrmConfiguration'][_0x36f9('0x28')]);_0x2d6efe[_0x36f9('0x2c')]=_['keys'](_0x50ac2e['query']);_0x2d6efe[_0x36f9('0x2d')]=_[_0x36f9('0x2e')](_0x2d6efe[_0x36f9('0x2b')],_0x2d6efe[_0x36f9('0x2c')]);_0x197492[_0x36f9('0x2f')]=_['intersection'](_0x2d6efe[_0x36f9('0x2b')],qs[_0x36f9('0x30')](_0x50ac2e[_0x36f9('0x2c')]['fields']));_0x197492[_0x36f9('0x2f')]=_0x197492[_0x36f9('0x2f')][_0x36f9('0x40')]?_0x197492[_0x36f9('0x2f')]:_0x2d6efe[_0x36f9('0x2b')];_0x197492[_0x36f9('0x32')]=qs[_0x36f9('0x33')](_0x50ac2e[_0x36f9('0x2c')][_0x36f9('0x33')]);_0x197492['where']=qs[_0x36f9('0x2d')](_[_0x36f9('0x45')](_0x50ac2e[_0x36f9('0x2c')],_0x2d6efe['filters']));if(_0x50ac2e[_0x36f9('0x2c')][_0x36f9('0x35')]){_0x197492[_0x36f9('0x34')]=_[_0x36f9('0x36')](_0x197492[_0x36f9('0x34')],{'$or':_[_0x36f9('0x46')](_0x197492[_0x36f9('0x2f')],function(_0x12d0f5){var _0x580f11={};_0x580f11[_0x12d0f5]={'$like':'%'+_0x50ac2e['query'][_0x36f9('0x35')]+'%'};return _0x580f11;})});}_0x197492=_[_0x36f9('0x36')]({},_0x197492,_0x50ac2e[_0x36f9('0x38')]);return _0xd45a09[_0x36f9('0x47')](_0x197492);}})[_0x36f9('0x21')](function(_0x6ba762){if(_0x6ba762){_0x3403a4=_0x6ba762[_0x36f9('0x40')];if(!_0x50ac2e[_0x36f9('0x2c')][_0x36f9('0x48')](_0x36f9('0x31'))){_0x197492['limit']=qs[_0x36f9('0x1a')](_0x50ac2e[_0x36f9('0x2c')]['limit']);_0x197492[_0x36f9('0x18')]=qs[_0x36f9('0x18')](_0x50ac2e['query'][_0x36f9('0x18')]);}return _0xd45a09[_0x36f9('0x47')](_0x197492);}})['then'](function(_0xecb933){if(_0xecb933){return _0xecb933?{'count':_0x3403a4,'rows':_0xecb933}:null;}})[_0x36f9('0x21')](respondWithResult(_0x1187bb,null))[_0x36f9('0x3c')](handleError(_0x1187bb,null));};exports[_0x36f9('0x49')]=function(_0x263be4,_0x1401cb,_0x11ab34){if(_0x263be4[_0x36f9('0x43')]['id']){delete _0x263be4['body']['id'];}return db[_0x36f9('0x27')][_0x36f9('0x44')]({'where':{'id':_0x263be4[_0x36f9('0x3e')]['id']}})[_0x36f9('0x21')](handleEntityNotFound(_0x1401cb,null))[_0x36f9('0x21')](function(_0x4c6787){if(_0x4c6787){_0x263be4[_0x36f9('0x43')][_0x36f9('0x4a')]=_0x4c6787['id'];_0x263be4[_0x36f9('0x43')][_0x36f9('0x4b')]=integrations[_0x36f9('0x4c')](_0x263be4['body'][_0x36f9('0x4d')],_0x263be4[_0x36f9('0x43')][_0x36f9('0x2a')]);_0x263be4[_0x36f9('0x43')][_0x36f9('0x4e')]=integrations['getDescriptions'](_0x263be4[_0x36f9('0x43')][_0x36f9('0x4d')],_0x263be4['body'][_0x36f9('0x2a')]);return db['SugarcrmConfiguration'][_0x36f9('0x42')](_0x263be4['body'],{'include':[{'model':db[_0x36f9('0x4f')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x36f9('0x4e')}]});}return null;})[_0x36f9('0x21')](respondWithResult(_0x1401cb,null))[_0x36f9('0x3c')](handleError(_0x1401cb,null));};exports[_0x36f9('0x50')]=function(_0xd0a7b2,_0x2c67b7,_0x4d66dd){var _0x353644='';var _0x59d869=['id',_0x36f9('0x24'),_0x36f9('0x51'),_0x36f9('0x52'),_0x36f9('0x53'),_0x36f9('0x54'),'duration_hours',_0x36f9('0x55'),'parent_id',_0x36f9('0x56'),_0x36f9('0x57'),_0x36f9('0x58')];return db['SugarcrmAccount'][_0x36f9('0x44')]({'where':{'id':_0xd0a7b2[_0x36f9('0x3e')]['id']},'attributes':['id',_0x36f9('0x59'),_0x36f9('0x5a'),'remoteUri']})[_0x36f9('0x21')](handleEntityNotFound(_0x2c67b7,null))['then'](function(_0x1154ef){if(_0x1154ef){_0x353644=_0x1154ef['remoteUri'];var _0x43b336=_0x353644[_0x36f9('0x5b')](-0x1);if(_0x43b336==='/'){_0x353644=_0x353644[_0x36f9('0x5c')](0x0,_0x353644[_0x36f9('0x5d')](_0x43b336));}return rp({'method':'POST','uri':util[_0x36f9('0x5e')](_0x36f9('0x5f'),_0x353644,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x36f9('0x60'),'response_type':'JSON','rest_data':JSON[_0x36f9('0x61')]({'user_auth':{'user_name':_0x1154ef[_0x36f9('0x59')],'password':_0x1154ef[_0x36f9('0x5a')],'encryption':_0x36f9('0x62')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x45072f){if(_0x45072f&&_0x45072f[_0x36f9('0x24')]!=='Invalid\x20Login'&&_0x45072f[_0x36f9('0x24')]!==_0x36f9('0x63')){return rp({'method':_0x36f9('0x64'),'uri':util['format'](_0x36f9('0x5f'),_0x353644,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x36f9('0x65'),'input_type':_0x36f9('0x60'),'response_type':_0x36f9('0x60'),'rest_data':JSON['stringify']({'session':_0x45072f['id'],'module_name':_0x36f9('0x66')})}})['then'](function(_0x2a1917){if(_0x2a1917){var _0x367f14=_['values'](_0x2a1917[_0x36f9('0x67')]);_[_0x36f9('0x68')](_0x367f14,function(_0x263003){return _0x59d869[_0x36f9('0x69')](_0x263003[_0x36f9('0x24')]);});return{'count':_0x367f14['length'],'rows':_[_0x36f9('0x46')](_0x367f14,function(_0x4e175f){return{'id':_0x4e175f[_0x36f9('0x24')],'name':_0x4e175f[_0x36f9('0x6a')],'custom':_[_0x36f9('0x6b')](_0x4e175f[_0x36f9('0x24')],'_c')?!![]:![],'options':_0x4e175f[_0x36f9('0x38')]?_[_0x36f9('0x46')](_[_0x36f9('0x6c')](_0x4e175f[_0x36f9('0x38')]),function(_0x24732c){return{'name':_0x24732c[_0x36f9('0x6d')],'value':_0x24732c[_0x36f9('0x24')]};}):[]};})};}})[_0x36f9('0x21')](respondWithResult(_0x2c67b7,null))['catch'](function(_0x1b33f4){var _0x6421ed=_0xd0a7b2[_0x36f9('0x2c')]['test']?0x1f4:_0x1b33f4[_0x36f9('0x6e')]||0x1f4;logger[_0x36f9('0x6f')](_0x36f9('0x70'),_0x36f9('0x50'),_0x6421ed,JSON[_0x36f9('0x61')](_0x1b33f4));delete _0x1b33f4['name'];if(_0x6421ed===0x191){_0x6421ed=0x190;}_0x2c67b7[_0x36f9('0x15')](_0x6421ed)[_0x36f9('0x25')](_0xd0a7b2[_0x36f9('0x2c')]['test']?{'message':_0x36f9('0x71'),'statusCode':_0x1b33f4[_0x36f9('0x6e')]}:_0x1b33f4);});}else{var _0x3c343c=0x1f4;_0x2c67b7[_0x36f9('0x15')](_0x3c343c)[_0x36f9('0x25')]({'message':_0x36f9('0x71'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xc6e3=['getFields','created_by','date_start','duration_hours','duration_minutes','parent_type','username','password','remoteUri','slice','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','show','length','find','catch','create','body','update','params','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','Subjects','SugarcrmField'];(function(_0x3008d2,_0x3638c7){var _0x5a9bbb=function(_0x2e8860){while(--_0x2e8860){_0x3008d2['push'](_0x3008d2['shift']());}};_0x5a9bbb(++_0x3638c7);}(_0xc6e3,0x1e3));var _0x3c6e=function(_0x3439f1,_0x159d46){_0x3439f1=_0x3439f1-0x0;var _0x5cc2d5=_0xc6e3[_0x3439f1];return _0x5cc2d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c6e('0x0'));var zipdir=require(_0x3c6e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c6e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3c6e('0x3'));var util=require(_0x3c6e('0x4'));var path=require(_0x3c6e('0x5'));var sox=require('sox');var csv=require(_0x3c6e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c6e('0x7'));var squel=require(_0x3c6e('0x8'));var crypto=require(_0x3c6e('0x9'));var jsforce=require(_0x3c6e('0xa'));var deskjs=require(_0x3c6e('0xb'));var toCsv=require(_0x3c6e('0x6'));var querystring=require(_0x3c6e('0xc'));var Papa=require(_0x3c6e('0xd'));var Redis=require(_0x3c6e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3c6e('0xf'));var as=require(_0x3c6e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c6e('0x11'))('api');var utils=require(_0x3c6e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3c6e('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3f54b1,_0x28cff4){_0x28cff4=_0x28cff4||0xcc;return function(_0x3322dc){if(_0x3322dc){return _0x3f54b1[_0x3c6e('0x14')](_0x28cff4);}return _0x3f54b1[_0x3c6e('0x15')](_0x28cff4)['end']();};}function respondWithResult(_0x4ae5d8,_0x16b887){_0x16b887=_0x16b887||0xc8;return function(_0x5abcf7){if(_0x5abcf7){return _0x4ae5d8['status'](_0x16b887)[_0x3c6e('0x16')](_0x5abcf7);}};}function respondWithFilteredResult(_0x3ceadd,_0x29dcb8){return function(_0x4714a7){if(_0x4714a7){var _0xd1db38=typeof _0x29dcb8[_0x3c6e('0x17')]==='undefined'&&typeof _0x29dcb8['limit']===_0x3c6e('0x18');var _0x20a333=_0x4714a7[_0x3c6e('0x19')];var _0x4644bd=_0xd1db38?0x0:_0x29dcb8[_0x3c6e('0x17')];var _0x33367c=_0xd1db38?_0x4714a7[_0x3c6e('0x19')]:_0x29dcb8[_0x3c6e('0x17')]+_0x29dcb8[_0x3c6e('0x1a')];var _0x36bec2;if(_0x33367c>=_0x20a333){_0x33367c=_0x20a333;_0x36bec2=0xc8;}else{_0x36bec2=0xce;}_0x3ceadd[_0x3c6e('0x15')](_0x36bec2);return _0x3ceadd[_0x3c6e('0x1b')](_0x3c6e('0x1c'),_0x4644bd+'-'+_0x33367c+'/'+_0x20a333)[_0x3c6e('0x16')](_0x4714a7);}return null;};}function patchUpdates(_0x1bc95d){return function(_0x224661){try{jsonpatch[_0x3c6e('0x1d')](_0x224661,_0x1bc95d,!![]);}catch(_0x5cef70){return BPromise[_0x3c6e('0x1e')](_0x5cef70);}return _0x224661[_0x3c6e('0x1f')]();};}function saveUpdates(_0x152eb4,_0x2930e4){return function(_0x4cfe44){if(_0x4cfe44){return _0x4cfe44['update'](_0x152eb4)[_0x3c6e('0x20')](function(_0x303a29){return _0x303a29;});}return null;};}function removeEntity(_0x47f553,_0x255de0){return function(_0x231ee3){if(_0x231ee3){return _0x231ee3[_0x3c6e('0x21')]()[_0x3c6e('0x20')](function(){_0x47f553['status'](0xcc)[_0x3c6e('0x22')]();});}};}function handleEntityNotFound(_0x4ebbb5,_0x40a404){return function(_0x108ed2){if(!_0x108ed2){_0x4ebbb5[_0x3c6e('0x14')](0x194);}return _0x108ed2;};}function handleError(_0x55f668,_0x289a16){_0x289a16=_0x289a16||0x1f4;return function(_0x4a17cb){logger[_0x3c6e('0x23')](_0x4a17cb[_0x3c6e('0x24')]);if(_0x4a17cb[_0x3c6e('0x25')]){delete _0x4a17cb[_0x3c6e('0x25')];}_0x55f668['status'](_0x289a16)[_0x3c6e('0x26')](_0x4a17cb);};}exports[_0x3c6e('0x27')]=function(_0x471646,_0x57a686){var _0x22f808={},_0x384bc3={},_0x5ccf19={'count':0x0,'rows':[]};var _0xe061dc=_['map'](db[_0x3c6e('0x28')][_0x3c6e('0x29')],function(_0x25e550){return{'name':_0x25e550[_0x3c6e('0x2a')],'type':_0x25e550[_0x3c6e('0x2b')][_0x3c6e('0x2c')]};});_0x384bc3[_0x3c6e('0x2d')]=_['map'](_0xe061dc,_0x3c6e('0x25'));_0x384bc3[_0x3c6e('0x2e')]=_[_0x3c6e('0x2f')](_0x471646[_0x3c6e('0x2e')]);_0x384bc3[_0x3c6e('0x30')]=_[_0x3c6e('0x31')](_0x384bc3['model'],_0x384bc3[_0x3c6e('0x2e')]);_0x22f808['attributes']=_[_0x3c6e('0x31')](_0x384bc3['model'],qs[_0x3c6e('0x32')](_0x471646[_0x3c6e('0x2e')][_0x3c6e('0x32')]));_0x22f808[_0x3c6e('0x33')]=_0x22f808[_0x3c6e('0x33')]['length']?_0x22f808[_0x3c6e('0x33')]:_0x384bc3[_0x3c6e('0x2d')];if(!_0x471646[_0x3c6e('0x2e')]['hasOwnProperty']('nolimit')){_0x22f808[_0x3c6e('0x1a')]=qs[_0x3c6e('0x1a')](_0x471646[_0x3c6e('0x2e')][_0x3c6e('0x1a')]);_0x22f808[_0x3c6e('0x17')]=qs['offset'](_0x471646[_0x3c6e('0x2e')][_0x3c6e('0x17')]);}_0x22f808[_0x3c6e('0x34')]=qs['sort'](_0x471646[_0x3c6e('0x2e')][_0x3c6e('0x35')]);_0x22f808['where']=qs[_0x3c6e('0x30')](_[_0x3c6e('0x36')](_0x471646[_0x3c6e('0x2e')],_0x384bc3[_0x3c6e('0x30')]),_0xe061dc);if(_0x471646['query'][_0x3c6e('0x37')]){_0x22f808[_0x3c6e('0x38')]=_[_0x3c6e('0x39')](_0x22f808['where'],{'$or':_[_0x3c6e('0x3a')](_0xe061dc,function(_0x471925){if(_0x471925[_0x3c6e('0x2b')]!==_0x3c6e('0x3b')){var _0x1fa726={};_0x1fa726[_0x471925['name']]={'$like':'%'+_0x471646[_0x3c6e('0x2e')][_0x3c6e('0x37')]+'%'};return _0x1fa726;}})});}_0x22f808=_[_0x3c6e('0x39')]({},_0x22f808,_0x471646[_0x3c6e('0x3c')]);var _0x574a75={'where':_0x22f808[_0x3c6e('0x38')]};return db[_0x3c6e('0x28')]['count'](_0x574a75)[_0x3c6e('0x20')](function(_0x308750){_0x5ccf19[_0x3c6e('0x19')]=_0x308750;if(_0x471646['query'][_0x3c6e('0x3d')]){_0x22f808[_0x3c6e('0x3e')]=[{'all':!![]}];}return db[_0x3c6e('0x28')][_0x3c6e('0x3f')](_0x22f808);})[_0x3c6e('0x20')](function(_0x4e3e88){_0x5ccf19['rows']=_0x4e3e88;return _0x5ccf19;})[_0x3c6e('0x20')](respondWithFilteredResult(_0x57a686,_0x22f808))['catch'](handleError(_0x57a686,null));};exports[_0x3c6e('0x40')]=function(_0x3b1302,_0x2f644c){var _0x515f09={'raw':![],'where':{'id':_0x3b1302['params']['id']}},_0x310ddd={};_0x310ddd[_0x3c6e('0x2d')]=_['keys'](db[_0x3c6e('0x28')][_0x3c6e('0x29')]);_0x310ddd[_0x3c6e('0x2e')]=_[_0x3c6e('0x2f')](_0x3b1302[_0x3c6e('0x2e')]);_0x310ddd['filters']=_[_0x3c6e('0x31')](_0x310ddd['model'],_0x310ddd[_0x3c6e('0x2e')]);_0x515f09['attributes']=_['intersection'](_0x310ddd[_0x3c6e('0x2d')],qs[_0x3c6e('0x32')](_0x3b1302[_0x3c6e('0x2e')]['fields']));_0x515f09[_0x3c6e('0x33')]=_0x515f09[_0x3c6e('0x33')][_0x3c6e('0x41')]?_0x515f09[_0x3c6e('0x33')]:_0x310ddd['model'];if(_0x3b1302[_0x3c6e('0x2e')][_0x3c6e('0x3d')]){_0x515f09[_0x3c6e('0x3e')]=[{'all':!![]}];}_0x515f09=_[_0x3c6e('0x39')]({},_0x515f09,_0x3b1302[_0x3c6e('0x3c')]);return db[_0x3c6e('0x28')][_0x3c6e('0x42')](_0x515f09)[_0x3c6e('0x20')](handleEntityNotFound(_0x2f644c,null))['then'](respondWithResult(_0x2f644c,null))[_0x3c6e('0x43')](handleError(_0x2f644c,null));};exports[_0x3c6e('0x44')]=function(_0x49d70d,_0x5c2667){return db['SugarcrmAccount'][_0x3c6e('0x44')](_0x49d70d[_0x3c6e('0x45')],{})[_0x3c6e('0x20')](respondWithResult(_0x5c2667,0xc9))[_0x3c6e('0x43')](handleError(_0x5c2667,null));};exports[_0x3c6e('0x46')]=function(_0x5c89ab,_0x4f5ccb){if(_0x5c89ab[_0x3c6e('0x45')]['id']){delete _0x5c89ab['body']['id'];}return db['SugarcrmAccount'][_0x3c6e('0x42')]({'where':{'id':_0x5c89ab['params']['id']}})[_0x3c6e('0x20')](handleEntityNotFound(_0x4f5ccb,null))[_0x3c6e('0x20')](saveUpdates(_0x5c89ab[_0x3c6e('0x45')],null))[_0x3c6e('0x20')](respondWithResult(_0x4f5ccb,null))['catch'](handleError(_0x4f5ccb,null));};exports[_0x3c6e('0x21')]=function(_0x561e73,_0x39e4d6){return db['SugarcrmAccount'][_0x3c6e('0x42')]({'where':{'id':_0x561e73[_0x3c6e('0x47')]['id']}})[_0x3c6e('0x20')](handleEntityNotFound(_0x39e4d6,null))['then'](removeEntity(_0x39e4d6,null))[_0x3c6e('0x43')](handleError(_0x39e4d6,null));};exports[_0x3c6e('0x48')]=function(_0x1e6baf,_0x5233fd,_0x4394f3){var _0x4a7ef2={};var _0x4d7214={};var _0x14e891;var _0x1b62db;return db['SugarcrmAccount'][_0x3c6e('0x49')]({'where':{'id':_0x1e6baf[_0x3c6e('0x47')]['id']}})[_0x3c6e('0x20')](handleEntityNotFound(_0x5233fd,null))[_0x3c6e('0x20')](function(_0x5be707){if(_0x5be707){_0x14e891=_0x5be707;_0x4d7214[_0x3c6e('0x2d')]=_[_0x3c6e('0x2f')](db[_0x3c6e('0x4a')][_0x3c6e('0x29')]);_0x4d7214[_0x3c6e('0x2e')]=_[_0x3c6e('0x2f')](_0x1e6baf['query']);_0x4d7214[_0x3c6e('0x30')]=_[_0x3c6e('0x31')](_0x4d7214['model'],_0x4d7214['query']);_0x4a7ef2[_0x3c6e('0x33')]=_[_0x3c6e('0x31')](_0x4d7214[_0x3c6e('0x2d')],qs[_0x3c6e('0x32')](_0x1e6baf[_0x3c6e('0x2e')][_0x3c6e('0x32')]));_0x4a7ef2['attributes']=_0x4a7ef2[_0x3c6e('0x33')][_0x3c6e('0x41')]?_0x4a7ef2[_0x3c6e('0x33')]:_0x4d7214[_0x3c6e('0x2d')];_0x4a7ef2[_0x3c6e('0x34')]=qs[_0x3c6e('0x35')](_0x1e6baf[_0x3c6e('0x2e')][_0x3c6e('0x35')]);_0x4a7ef2[_0x3c6e('0x38')]=qs['filters'](_['pick'](_0x1e6baf[_0x3c6e('0x2e')],_0x4d7214[_0x3c6e('0x30')]));if(_0x1e6baf[_0x3c6e('0x2e')][_0x3c6e('0x37')]){_0x4a7ef2[_0x3c6e('0x38')]=_[_0x3c6e('0x39')](_0x4a7ef2[_0x3c6e('0x38')],{'$or':_[_0x3c6e('0x3a')](_0x4a7ef2[_0x3c6e('0x33')],function(_0x2a682d){var _0x597a35={};_0x597a35[_0x2a682d]={'$like':'%'+_0x1e6baf[_0x3c6e('0x2e')][_0x3c6e('0x37')]+'%'};return _0x597a35;})});}_0x4a7ef2=_[_0x3c6e('0x39')]({},_0x4a7ef2,_0x1e6baf[_0x3c6e('0x3c')]);return _0x14e891[_0x3c6e('0x48')](_0x4a7ef2);}})[_0x3c6e('0x20')](function(_0x24ed4f){if(_0x24ed4f){_0x1b62db=_0x24ed4f[_0x3c6e('0x41')];if(!_0x1e6baf[_0x3c6e('0x2e')][_0x3c6e('0x4b')]('nolimit')){_0x4a7ef2[_0x3c6e('0x1a')]=qs[_0x3c6e('0x1a')](_0x1e6baf[_0x3c6e('0x2e')]['limit']);_0x4a7ef2[_0x3c6e('0x17')]=qs[_0x3c6e('0x17')](_0x1e6baf['query'][_0x3c6e('0x17')]);}return _0x14e891[_0x3c6e('0x48')](_0x4a7ef2);}})[_0x3c6e('0x20')](function(_0x1aef3a){if(_0x1aef3a){return _0x1aef3a?{'count':_0x1b62db,'rows':_0x1aef3a}:null;}})[_0x3c6e('0x20')](respondWithResult(_0x5233fd,null))[_0x3c6e('0x43')](handleError(_0x5233fd,null));};exports[_0x3c6e('0x4c')]=function(_0x23af00,_0xae1eb8,_0x2833be){if(_0x23af00[_0x3c6e('0x45')]['id']){delete _0x23af00[_0x3c6e('0x45')]['id'];}return db[_0x3c6e('0x28')][_0x3c6e('0x49')]({'where':{'id':_0x23af00['params']['id']}})[_0x3c6e('0x20')](handleEntityNotFound(_0xae1eb8,null))[_0x3c6e('0x20')](function(_0x4aa78b){if(_0x4aa78b){_0x23af00[_0x3c6e('0x45')]['AccountId']=_0x4aa78b['id'];_0x23af00[_0x3c6e('0x45')]['Subjects']=integrations[_0x3c6e('0x4d')](_0x23af00['body'][_0x3c6e('0x4e')],_0x23af00[_0x3c6e('0x45')]['type']);_0x23af00[_0x3c6e('0x45')][_0x3c6e('0x4f')]=integrations['getDescriptions'](_0x23af00[_0x3c6e('0x45')][_0x3c6e('0x4e')],_0x23af00[_0x3c6e('0x45')][_0x3c6e('0x2b')]);return db['SugarcrmConfiguration']['create'](_0x23af00['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x3c6e('0x50')},{'model':db[_0x3c6e('0x51')],'as':_0x3c6e('0x4f')}]});}return null;})['then'](respondWithResult(_0xae1eb8,null))['catch'](handleError(_0xae1eb8,null));};exports[_0x3c6e('0x52')]=function(_0x1bce2e,_0x389fdb,_0x346a28){var _0x6c59f0='';var _0x38761a=['id',_0x3c6e('0x25'),'assigned_user_id',_0x3c6e('0x53'),'description',_0x3c6e('0x54'),_0x3c6e('0x55'),_0x3c6e('0x56'),'parent_id',_0x3c6e('0x57'),'parent_name','direction'];return db[_0x3c6e('0x28')][_0x3c6e('0x49')]({'where':{'id':_0x1bce2e[_0x3c6e('0x47')]['id']},'attributes':['id',_0x3c6e('0x58'),_0x3c6e('0x59'),_0x3c6e('0x5a')]})[_0x3c6e('0x20')](handleEntityNotFound(_0x389fdb,null))[_0x3c6e('0x20')](function(_0x128716){if(_0x128716){_0x6c59f0=_0x128716[_0x3c6e('0x5a')];var _0x115b05=_0x6c59f0[_0x3c6e('0x5b')](-0x1);if(_0x115b05==='/'){_0x6c59f0=_0x6c59f0['substring'](0x0,_0x6c59f0[_0x3c6e('0x5c')](_0x115b05));}return rp({'method':_0x3c6e('0x5d'),'uri':util[_0x3c6e('0x5e')]('%s%s',_0x6c59f0,_0x3c6e('0x5f')),'json':!![],'form':{'method':_0x3c6e('0x60'),'input_type':'JSON','response_type':_0x3c6e('0x61'),'rest_data':JSON[_0x3c6e('0x62')]({'user_auth':{'user_name':_0x128716[_0x3c6e('0x58')],'password':_0x128716[_0x3c6e('0x59')],'encryption':_0x3c6e('0x63')},'application':_0x3c6e('0x64')})}});}})[_0x3c6e('0x20')](function(_0x1ae023){if(_0x1ae023&&_0x1ae023[_0x3c6e('0x25')]!=='Invalid\x20Login'&&_0x1ae023['name']!==_0x3c6e('0x65')){return rp({'method':_0x3c6e('0x5d'),'uri':util[_0x3c6e('0x5e')]('%s%s',_0x6c59f0,_0x3c6e('0x5f')),'json':!![],'form':{'method':_0x3c6e('0x66'),'input_type':_0x3c6e('0x61'),'response_type':_0x3c6e('0x61'),'rest_data':JSON['stringify']({'session':_0x1ae023['id'],'module_name':_0x3c6e('0x67')})}})[_0x3c6e('0x20')](function(_0x423c97){if(_0x423c97){var _0x31094e=_[_0x3c6e('0x68')](_0x423c97[_0x3c6e('0x69')]);_['remove'](_0x31094e,function(_0x39494d){return _0x38761a[_0x3c6e('0x6a')](_0x39494d['name']);});return{'count':_0x31094e[_0x3c6e('0x41')],'rows':_[_0x3c6e('0x3a')](_0x31094e,function(_0x3887db){return{'id':_0x3887db['name'],'name':_0x3887db['label'],'custom':_[_0x3c6e('0x6b')](_0x3887db['name'],'_c')?!![]:![],'options':_0x3887db[_0x3c6e('0x3c')]?_['map'](_['values'](_0x3887db[_0x3c6e('0x3c')]),function(_0xd23007){return{'name':_0xd23007[_0x3c6e('0x6c')],'value':_0xd23007[_0x3c6e('0x25')]};}):[]};})};}})[_0x3c6e('0x20')](respondWithResult(_0x389fdb,null))[_0x3c6e('0x43')](function(_0xdb77b9){var _0x3951cf=_0x1bce2e[_0x3c6e('0x2e')][_0x3c6e('0x6d')]?0x1f4:_0xdb77b9['statusCode']||0x1f4;logger[_0x3c6e('0x23')](_0x3c6e('0x6e'),_0x3c6e('0x52'),_0x3951cf,JSON[_0x3c6e('0x62')](_0xdb77b9));delete _0xdb77b9['name'];if(_0x3951cf===0x191){_0x3951cf=0x190;}_0x389fdb[_0x3c6e('0x15')](_0x3951cf)[_0x3c6e('0x26')](_0x1bce2e[_0x3c6e('0x2e')][_0x3c6e('0x6d')]?{'message':_0x3c6e('0x6f'),'statusCode':_0xdb77b9[_0x3c6e('0x70')]}:_0xdb77b9);});}else{var _0x24ccf9=0x1f4;_0x389fdb[_0x3c6e('0x15')](_0x24ccf9)[_0x3c6e('0x26')]({'message':_0x3c6e('0x6f'),'statusCode':0x190});}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef0a=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x2b181e,_0x28ac89){var _0x597cb5=function(_0x510bd5){while(--_0x510bd5){_0x2b181e['push'](_0x2b181e['shift']());}};_0x597cb5(++_0x28ac89);}(_0xef0a,0x1a8));var _0xaef0=function(_0x2d8a5b,_0x43069a){_0x2d8a5b=_0x2d8a5b-0x0;var _0x49a722=_0xef0a[_0x2d8a5b];return _0x49a722;};'use strict';var _=require('lodash');var util=require(_0xaef0('0x0'));var logger=require(_0xaef0('0x1'))(_0xaef0('0x2'));var moment=require(_0xaef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xaef0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef0('0x5'));var config=require(_0xaef0('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xaef0('0x7'));module[_0xaef0('0x8')]=function(_0x2812b1,_0x51f1f0){return _0x2812b1[_0xaef0('0x9')](_0xaef0('0xa'),attributes,{'tableName':_0xaef0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa354=['request-promise','../../config/environment','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','bluebird'];(function(_0xced93c,_0xa7829f){var _0x477f6c=function(_0x1f72c6){while(--_0x1f72c6){_0xced93c['push'](_0xced93c['shift']());}};_0x477f6c(++_0xa7829f);}(_0xa354,0x1bf));var _0x4a35=function(_0x485b2,_0x4e1b06){_0x485b2=_0x485b2-0x0;var _0x2936f7=_0xa354[_0x485b2];return _0x2936f7;};'use strict';var _=require(_0x4a35('0x0'));var util=require(_0x4a35('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4a35('0x2'));var rp=require(_0x4a35('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a35('0x4'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x4a35('0x5'));module['exports']=function(_0x5ceacc,_0x3cb5ac){return _0x5ceacc[_0x4a35('0x6')](_0x4a35('0x7'),attributes,{'tableName':_0x4a35('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2eea=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowSugarcrmAccount','find','stringify','lodash'];(function(_0x2c3635,_0x1fd9dd){var _0x105bb9=function(_0x167ed5){while(--_0x167ed5){_0x2c3635['push'](_0x2c3635['shift']());}};_0x105bb9(++_0x1fd9dd);}(_0x2eea,0x1cd));var _0xa2ee=function(_0x127233,_0x524849){_0x127233=_0x127233-0x0;var _0x9fc50a=_0x2eea[_0x127233];return _0x9fc50a;};'use strict';var _=require(_0xa2ee('0x0'));var util=require('util');var moment=require(_0xa2ee('0x1'));var BPromise=require(_0xa2ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ee('0x3'));var db=require(_0xa2ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2ee('0x5'))(_0xa2ee('0x6'));var config=require(_0xa2ee('0x7'));var jayson=require(_0xa2ee('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49eb69,_0x23fc27,_0x3895ad){return new BPromise(function(_0x1469c3,_0x13dcc8){return client[_0xa2ee('0x9')](_0x49eb69,_0x3895ad)[_0xa2ee('0xa')](function(_0x7b4d9e){logger[_0xa2ee('0xb')](_0xa2ee('0xc'),_0x23fc27,_0xa2ee('0xd'));logger[_0xa2ee('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x23fc27,_0xa2ee('0xd'),JSON['stringify'](_0x7b4d9e));if(_0x7b4d9e['error']){if(_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x10')]===0x1f4){logger[_0xa2ee('0xf')](_0xa2ee('0xc'),_0x23fc27,_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);return _0x13dcc8(_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);}logger[_0xa2ee('0xf')](_0xa2ee('0xc'),_0x23fc27,_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);return _0x1469c3(_0x7b4d9e[_0xa2ee('0xf')][_0xa2ee('0x11')]);}else{logger[_0xa2ee('0xb')](_0xa2ee('0xc'),_0x23fc27,_0xa2ee('0xd'));_0x1469c3(_0x7b4d9e['result'][_0xa2ee('0x11')]);}})['catch'](function(_0x3b4712){logger[_0xa2ee('0xf')](_0xa2ee('0xc'),_0x23fc27,_0x3b4712);_0x13dcc8(_0x3b4712);});});}exports[_0xa2ee('0x12')]=function(_0x53e731){var _0x3bf642=this;return new Promise(function(_0x43d791,_0x50fd7b){return db[_0xa2ee('0x13')][_0xa2ee('0x14')]({'raw':_0x53e731[_0xa2ee('0x15')]?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x16')]===undefined?!![]:![]:!![],'where':_0x53e731[_0xa2ee('0x15')]?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x17')]||null:null,'attributes':_0x53e731[_0xa2ee('0x15')]?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x18')]||null:null,'limit':_0x53e731['options']?_0x53e731['options'][_0xa2ee('0x19')]||null:null,'include':_0x53e731['options']?_0x53e731[_0xa2ee('0x15')][_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x53e731[_0xa2ee('0x15')]['include'],function(_0x26c9bc){return{'model':db[_0x26c9bc['model']],'as':_0x26c9bc['as'],'attributes':_0x26c9bc[_0xa2ee('0x18')],'include':_0x26c9bc[_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x26c9bc[_0xa2ee('0x1a')],function(_0x4f6eb4){return{'model':db[_0x4f6eb4[_0xa2ee('0x1c')]],'as':_0x4f6eb4['as'],'attributes':_0x4f6eb4[_0xa2ee('0x18')],'include':_0x4f6eb4[_0xa2ee('0x1a')]?_['map'](_0x4f6eb4[_0xa2ee('0x1a')],function(_0x44ebf9){return{'model':db[_0x44ebf9[_0xa2ee('0x1c')]],'as':_0x44ebf9['as'],'attributes':_0x44ebf9[_0xa2ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa2ee('0xa')](function(_0x221ef6){logger['info'](_0xa2ee('0x12'),_0x53e731);logger[_0xa2ee('0xe')](_0xa2ee('0x12'),_0x53e731,JSON['stringify'](_0x221ef6));_0x43d791(_0x221ef6);})[_0xa2ee('0x1d')](function(_0x5a012f){logger[_0xa2ee('0xf')](_0xa2ee('0x12'),_0x5a012f[_0xa2ee('0x11')],_0x53e731);_0x50fd7b(_0x3bf642[_0xa2ee('0xf')](0x1f4,_0x5a012f[_0xa2ee('0x11')]));});});};exports[_0xa2ee('0x1e')]=function(_0x5d2b91){var _0x11ce06=this;return new Promise(function(_0x362b1b,_0x1ab2c3){return db[_0xa2ee('0x13')][_0xa2ee('0x1f')]({'raw':_0x5d2b91[_0xa2ee('0x15')]?_0x5d2b91[_0xa2ee('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5d2b91[_0xa2ee('0x15')]?_0x5d2b91[_0xa2ee('0x15')]['where']||null:null,'attributes':_0x5d2b91[_0xa2ee('0x15')]?_0x5d2b91[_0xa2ee('0x15')][_0xa2ee('0x18')]||null:null,'include':_0x5d2b91['options']?_0x5d2b91[_0xa2ee('0x15')][_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x5d2b91[_0xa2ee('0x15')][_0xa2ee('0x1a')],function(_0x2a3d9d){return{'model':db[_0x2a3d9d['model']],'as':_0x2a3d9d['as'],'attributes':_0x2a3d9d[_0xa2ee('0x18')],'include':_0x2a3d9d[_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x2a3d9d[_0xa2ee('0x1a')],function(_0x14100f){return{'model':db[_0x14100f[_0xa2ee('0x1c')]],'as':_0x14100f['as'],'attributes':_0x14100f[_0xa2ee('0x18')],'include':_0x14100f[_0xa2ee('0x1a')]?_[_0xa2ee('0x1b')](_0x14100f[_0xa2ee('0x1a')],function(_0x3583b2){return{'model':db[_0x3583b2[_0xa2ee('0x1c')]],'as':_0x3583b2['as'],'attributes':_0x3583b2[_0xa2ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa2ee('0xa')](function(_0xe2fbda){logger[_0xa2ee('0xb')](_0xa2ee('0x1e'),_0x5d2b91);logger[_0xa2ee('0xe')](_0xa2ee('0x1e'),_0x5d2b91,JSON[_0xa2ee('0x20')](_0xe2fbda));_0x362b1b(_0xe2fbda);})[_0xa2ee('0x1d')](function(_0x37f536){logger['error']('ShowSugarcrmAccount',_0x37f536[_0xa2ee('0x11')],_0x5d2b91);_0x1ab2c3(_0x11ce06[_0xa2ee('0xf')](0x1f4,_0x37f536[_0xa2ee('0x11')]));});});};
\ No newline at end of file
+var _0x38cc=['code','message','result','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','include','model','map','then','info','ShowSugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5aee6d,_0x103f96){var _0x28ee9e=function(_0x5146bd){while(--_0x5146bd){_0x5aee6d['push'](_0x5aee6d['shift']());}};_0x28ee9e(++_0x103f96);}(_0x38cc,0x120));var _0xc38c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38cc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xc38c('0x0'));var moment=require(_0xc38c('0x1'));var BPromise=require(_0xc38c('0x2'));var rs=require(_0xc38c('0x3'));var fs=require('fs');var Redis=require(_0xc38c('0x4'));var db=require(_0xc38c('0x5'))['db'];var utils=require(_0xc38c('0x6'));var logger=require(_0xc38c('0x7'))('rpc');var config=require(_0xc38c('0x8'));var jayson=require(_0xc38c('0x9'));var client=jayson[_0xc38c('0xa')][_0xc38c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x491722,_0x2ceaeb,_0x20bfa9){return new BPromise(function(_0xce3640,_0x578c78){return client['request'](_0x491722,_0x20bfa9)['then'](function(_0x2677f9){logger['info'](_0xc38c('0xc'),_0x2ceaeb,_0xc38c('0xd'));logger[_0xc38c('0xe')](_0xc38c('0xf'),_0x2ceaeb,_0xc38c('0xd'),JSON[_0xc38c('0x10')](_0x2677f9));if(_0x2677f9[_0xc38c('0x11')]){if(_0x2677f9[_0xc38c('0x11')][_0xc38c('0x12')]===0x1f4){logger[_0xc38c('0x11')](_0xc38c('0xc'),_0x2ceaeb,_0x2677f9['error'][_0xc38c('0x13')]);return _0x578c78(_0x2677f9[_0xc38c('0x11')][_0xc38c('0x13')]);}logger[_0xc38c('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x2ceaeb,_0x2677f9[_0xc38c('0x11')]['message']);return _0xce3640(_0x2677f9[_0xc38c('0x11')][_0xc38c('0x13')]);}else{logger['info'](_0xc38c('0xc'),_0x2ceaeb,'request\x20sent');_0xce3640(_0x2677f9[_0xc38c('0x14')][_0xc38c('0x13')]);}})[_0xc38c('0x15')](function(_0x46a571){logger[_0xc38c('0x11')](_0xc38c('0xc'),_0x2ceaeb,_0x46a571);_0x578c78(_0x46a571);});});}exports[_0xc38c('0x16')]=function(_0x5003d3){var _0x275042=this;return new Promise(function(_0x49b3d9,_0x347dee){return db['SugarcrmAccount']['findAll']({'raw':_0x5003d3[_0xc38c('0x17')]?_0x5003d3[_0xc38c('0x17')][_0xc38c('0x18')]===undefined?!![]:![]:!![],'where':_0x5003d3[_0xc38c('0x17')]?_0x5003d3['options'][_0xc38c('0x19')]||null:null,'attributes':_0x5003d3['options']?_0x5003d3['options'][_0xc38c('0x1a')]||null:null,'limit':_0x5003d3[_0xc38c('0x17')]?_0x5003d3['options'][_0xc38c('0x1b')]||null:null,'include':_0x5003d3[_0xc38c('0x17')]?_0x5003d3[_0xc38c('0x17')]['include']?_['map'](_0x5003d3[_0xc38c('0x17')][_0xc38c('0x1c')],function(_0x518422){return{'model':db[_0x518422[_0xc38c('0x1d')]],'as':_0x518422['as'],'attributes':_0x518422[_0xc38c('0x1a')],'include':_0x518422[_0xc38c('0x1c')]?_['map'](_0x518422['include'],function(_0xd4ab89){return{'model':db[_0xd4ab89[_0xc38c('0x1d')]],'as':_0xd4ab89['as'],'attributes':_0xd4ab89[_0xc38c('0x1a')],'include':_0xd4ab89[_0xc38c('0x1c')]?_[_0xc38c('0x1e')](_0xd4ab89[_0xc38c('0x1c')],function(_0x563bea){return{'model':db[_0x563bea[_0xc38c('0x1d')]],'as':_0x563bea['as'],'attributes':_0x563bea[_0xc38c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc38c('0x1f')](function(_0x388d07){logger[_0xc38c('0x20')](_0xc38c('0x16'),_0x5003d3);logger[_0xc38c('0xe')](_0xc38c('0x16'),_0x5003d3,JSON[_0xc38c('0x10')](_0x388d07));_0x49b3d9(_0x388d07);})[_0xc38c('0x15')](function(_0x2bc773){logger[_0xc38c('0x11')](_0xc38c('0x16'),_0x2bc773['message'],_0x5003d3);_0x347dee(_0x275042[_0xc38c('0x11')](0x1f4,_0x2bc773[_0xc38c('0x13')]));});});};exports[_0xc38c('0x21')]=function(_0x5e954a){var _0x22aa10=this;return new Promise(function(_0x31d942,_0x3ea9c3){return db['SugarcrmAccount']['find']({'raw':_0x5e954a[_0xc38c('0x17')]?_0x5e954a['options'][_0xc38c('0x18')]===undefined?!![]:![]:!![],'where':_0x5e954a['options']?_0x5e954a[_0xc38c('0x17')][_0xc38c('0x19')]||null:null,'attributes':_0x5e954a[_0xc38c('0x17')]?_0x5e954a[_0xc38c('0x17')][_0xc38c('0x1a')]||null:null,'include':_0x5e954a['options']?_0x5e954a[_0xc38c('0x17')][_0xc38c('0x1c')]?_[_0xc38c('0x1e')](_0x5e954a[_0xc38c('0x17')][_0xc38c('0x1c')],function(_0x1d695c){return{'model':db[_0x1d695c['model']],'as':_0x1d695c['as'],'attributes':_0x1d695c['attributes'],'include':_0x1d695c[_0xc38c('0x1c')]?_[_0xc38c('0x1e')](_0x1d695c[_0xc38c('0x1c')],function(_0x3fd4fd){return{'model':db[_0x3fd4fd[_0xc38c('0x1d')]],'as':_0x3fd4fd['as'],'attributes':_0x3fd4fd[_0xc38c('0x1a')],'include':_0x3fd4fd[_0xc38c('0x1c')]?_[_0xc38c('0x1e')](_0x3fd4fd[_0xc38c('0x1c')],function(_0x1dc85d){return{'model':db[_0x1dc85d[_0xc38c('0x1d')]],'as':_0x1dc85d['as'],'attributes':_0x1dc85d[_0xc38c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc38c('0x1f')](function(_0x4bd81e){logger[_0xc38c('0x20')](_0xc38c('0x21'),_0x5e954a);logger['debug']('ShowSugarcrmAccount',_0x5e954a,JSON[_0xc38c('0x10')](_0x4bd81e));_0x31d942(_0x4bd81e);})[_0xc38c('0x15')](function(_0x501ea2){logger['error'](_0xc38c('0x21'),_0x501ea2[_0xc38c('0x13')],_0x5e954a);_0x3ea9c3(_0x22aa10[_0xc38c('0x11')](0x1f4,_0x501ea2[_0xc38c('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46f6=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x1aa33b,_0x385191){var _0x1cf154=function(_0x3302e1){while(--_0x3302e1){_0x1aa33b['push'](_0x1aa33b['shift']());}};_0x1cf154(++_0x385191);}(_0x46f6,0x1f3));var _0x646f=function(_0x2bcdb6,_0x24e786){_0x2bcdb6=_0x2bcdb6-0x0;var _0x21a3af=_0x46f6[_0x2bcdb6];return _0x21a3af;};'use strict';var multer=require(_0x646f('0x0'));var util=require(_0x646f('0x1'));var path=require(_0x646f('0x2'));var timeout=require(_0x646f('0x3'));var express=require(_0x646f('0x4'));var router=express[_0x646f('0x5')]();var fs_extra=require(_0x646f('0x6'));var auth=require(_0x646f('0x7'));var interaction=require(_0x646f('0x8'));var config=require(_0x646f('0x9'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x646f('0xa')]('/',auth[_0x646f('0xb')](),controller[_0x646f('0xc')]);router[_0x646f('0xa')]('/:id',auth[_0x646f('0xb')](),controller[_0x646f('0xd')]);router['get'](_0x646f('0xe'),auth[_0x646f('0xb')](),controller[_0x646f('0xf')]);router[_0x646f('0xa')]('/:id/subjects',auth[_0x646f('0xb')](),controller[_0x646f('0x10')]);router['get'](_0x646f('0x11'),auth['isAuthenticated'](),controller[_0x646f('0x12')]);router[_0x646f('0x13')]('/',auth['isAuthenticated'](),controller[_0x646f('0x14')]);router[_0x646f('0x15')](_0x646f('0x16'),auth[_0x646f('0xb')](),controller['update']);router[_0x646f('0x17')](_0x646f('0x16'),auth[_0x646f('0xb')](),controller[_0x646f('0x18')]);module[_0x646f('0x19')]=router;
\ No newline at end of file
+var _0xc20d=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','delete','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x1383ca,_0x46d59a){var _0x8302b4=function(_0x14ab0e){while(--_0x14ab0e){_0x1383ca['push'](_0x1383ca['shift']());}};_0x8302b4(++_0x46d59a);}(_0xc20d,0xba));var _0xdc20=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0xc20d[_0x35e92e];return _0x1205a8;};'use strict';var multer=require(_0xdc20('0x0'));var util=require(_0xdc20('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdc20('0x2'));var auth=require(_0xdc20('0x3'));var interaction=require(_0xdc20('0x4'));var config=require(_0xdc20('0x5'));var controller=require(_0xdc20('0x6'));router[_0xdc20('0x7')]('/',auth[_0xdc20('0x8')](),controller['index']);router[_0xdc20('0x7')]('/:id',auth[_0xdc20('0x8')](),controller['show']);router[_0xdc20('0x7')](_0xdc20('0x9'),auth[_0xdc20('0x8')](),controller[_0xdc20('0xa')]);router['get'](_0xdc20('0xb'),auth[_0xdc20('0x8')](),controller[_0xdc20('0xc')]);router['get'](_0xdc20('0xd'),auth[_0xdc20('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0xdc20('0x8')](),controller[_0xdc20('0xe')]);router[_0xdc20('0xf')](_0xdc20('0x10'),auth[_0xdc20('0x8')](),controller['update']);router[_0xdc20('0x11')](_0xdc20('0x10'),auth[_0xdc20('0x8')](),controller['destroy']);module[_0xdc20('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda36=['exports','STRING'];(function(_0x4f6d57,_0x2138e6){var _0x106f59=function(_0x6ef0db){while(--_0x6ef0db){_0x4f6d57['push'](_0x4f6d57['shift']());}};_0x106f59(++_0x2138e6);}(_0xda36,0x96));var _0x6da3=function(_0x40c262,_0x505c60){_0x40c262=_0x40c262-0x0;var _0x2007dc=_0xda36[_0x40c262];return _0x2007dc;};'use strict';var Sequelize=require('sequelize');module[_0x6da3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6da3('0x1')]}};
\ No newline at end of file
+var _0xd90f=['sequelize','exports','STRING'];(function(_0x5cdc52,_0x33ce72){var _0x455283=function(_0x54070d){while(--_0x54070d){_0x5cdc52['push'](_0x5cdc52['shift']());}};_0x455283(++_0x33ce72);}(_0xd90f,0xd8));var _0xfd90=function(_0x75de2,_0x346ce0){_0x75de2=_0x75de2-0x0;var _0x28c0f9=_0xd90f[_0x75de2];return _0x28c0f9;};'use strict';var Sequelize=require(_0xfd90('0x0'));module[_0xfd90('0x1')]={'name':{'type':Sequelize[_0xfd90('0x2')]},'description':{'type':Sequelize[_0xfd90('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41b9=['create','body','find','getFields','findOne','SugarcrmField','order','getSubjects','getDescriptions','eml-format','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x9cf0e3,_0x498d08){var _0x5565c5=function(_0xa93503){while(--_0xa93503){_0x9cf0e3['push'](_0x9cf0e3['shift']());}};_0x5565c5(++_0x498d08);}(_0x41b9,0x149));var _0x941b=function(_0x1add02,_0x47e989){_0x1add02=_0x1add02-0x0;var _0x31e89f=_0x41b9[_0x1add02];return _0x31e89f;};'use strict';var emlformat=require(_0x941b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x941b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x941b('0x2'));var path=require(_0x941b('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x941b('0x4'));var fs=require('fs');var fs_extra=require(_0x941b('0x5'));var _=require(_0x941b('0x6'));var squel=require(_0x941b('0x7'));var crypto=require(_0x941b('0x8'));var jsforce=require(_0x941b('0x9'));var deskjs=require(_0x941b('0xa'));var toCsv=require(_0x941b('0xb'));var querystring=require(_0x941b('0xc'));var Papa=require(_0x941b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x941b('0xe'));var hardwareService=require(_0x941b('0xf'));var logger=require(_0x941b('0x10'))(_0x941b('0x11'));var utils=require(_0x941b('0x12'));var config=require(_0x941b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x941b('0x14'))['db'];function respondWithStatusCode(_0x577d2e,_0x44844a){_0x44844a=_0x44844a||0xcc;return function(_0x19f2dc){if(_0x19f2dc){return _0x577d2e[_0x941b('0x15')](_0x44844a);}return _0x577d2e[_0x941b('0x16')](_0x44844a)['end']();};}function respondWithResult(_0x32f37c,_0x37dfa2){_0x37dfa2=_0x37dfa2||0xc8;return function(_0x5ecba0){if(_0x5ecba0){return _0x32f37c[_0x941b('0x16')](_0x37dfa2)[_0x941b('0x17')](_0x5ecba0);}};}function respondWithFilteredResult(_0x2fbe5a,_0x1e1fb6){return function(_0x5ab07e){if(_0x5ab07e){var _0x5a64a5=typeof _0x1e1fb6[_0x941b('0x18')]==='undefined'&&typeof _0x1e1fb6[_0x941b('0x19')]===_0x941b('0x1a');var _0x435b27=_0x5ab07e[_0x941b('0x1b')];var _0x2e741b=_0x5a64a5?0x0:_0x1e1fb6['offset'];var _0x341297=_0x5a64a5?_0x5ab07e['count']:_0x1e1fb6[_0x941b('0x18')]+_0x1e1fb6[_0x941b('0x19')];var _0x47f496;if(_0x341297>=_0x435b27){_0x341297=_0x435b27;_0x47f496=0xc8;}else{_0x47f496=0xce;}_0x2fbe5a[_0x941b('0x16')](_0x47f496);return _0x2fbe5a['set'](_0x941b('0x1c'),_0x2e741b+'-'+_0x341297+'/'+_0x435b27)[_0x941b('0x17')](_0x5ab07e);}return null;};}function patchUpdates(_0x4abd3e){return function(_0x52f288){try{jsonpatch[_0x941b('0x1d')](_0x52f288,_0x4abd3e,!![]);}catch(_0x522696){return BPromise[_0x941b('0x1e')](_0x522696);}return _0x52f288[_0x941b('0x1f')]();};}function saveUpdates(_0x2c5305,_0x5977f9){return function(_0x5ecfe9){if(_0x5ecfe9){return _0x5ecfe9[_0x941b('0x20')](_0x2c5305)[_0x941b('0x21')](function(_0xe7e7e3){return _0xe7e7e3;});}return null;};}function removeEntity(_0x3b93f4,_0x10621d){return function(_0x4ab34e){if(_0x4ab34e){return _0x4ab34e[_0x941b('0x22')]()[_0x941b('0x21')](function(){_0x3b93f4[_0x941b('0x16')](0xcc)[_0x941b('0x23')]();});}};}function handleEntityNotFound(_0x2dcb3e,_0x193e65){return function(_0x596ec8){if(!_0x596ec8){_0x2dcb3e[_0x941b('0x15')](0x194);}return _0x596ec8;};}function handleError(_0x7f8175,_0x422425){_0x422425=_0x422425||0x1f4;return function(_0x44cac1){logger[_0x941b('0x24')](_0x44cac1[_0x941b('0x25')]);if(_0x44cac1['name']){delete _0x44cac1[_0x941b('0x26')];}_0x7f8175[_0x941b('0x16')](_0x422425)[_0x941b('0x27')](_0x44cac1);};}exports[_0x941b('0x28')]=function(_0x5e16b8,_0x277a81){var _0x5a9a1d={},_0x216223={},_0x205917={'count':0x0,'rows':[]};var _0x2ecf15=_[_0x941b('0x29')](db[_0x941b('0x2a')]['rawAttributes'],function(_0x48b013){return{'name':_0x48b013[_0x941b('0x2b')],'type':_0x48b013[_0x941b('0x2c')][_0x941b('0x2d')]};});_0x216223[_0x941b('0x2e')]=_['map'](_0x2ecf15,'name');_0x216223[_0x941b('0x2f')]=_[_0x941b('0x30')](_0x5e16b8['query']);_0x216223[_0x941b('0x31')]=_[_0x941b('0x32')](_0x216223[_0x941b('0x2e')],_0x216223[_0x941b('0x2f')]);_0x5a9a1d[_0x941b('0x33')]=_[_0x941b('0x32')](_0x216223['model'],qs[_0x941b('0x34')](_0x5e16b8[_0x941b('0x2f')]['fields']));_0x5a9a1d[_0x941b('0x33')]=_0x5a9a1d[_0x941b('0x33')][_0x941b('0x35')]?_0x5a9a1d[_0x941b('0x33')]:_0x216223[_0x941b('0x2e')];if(!_0x5e16b8['query'][_0x941b('0x36')](_0x941b('0x37'))){_0x5a9a1d[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x5e16b8['query']['limit']);_0x5a9a1d['offset']=qs[_0x941b('0x18')](_0x5e16b8['query'][_0x941b('0x18')]);}_0x5a9a1d['order']=qs[_0x941b('0x38')](_0x5e16b8[_0x941b('0x2f')][_0x941b('0x38')]);_0x5a9a1d[_0x941b('0x39')]=qs[_0x941b('0x31')](_[_0x941b('0x3a')](_0x5e16b8['query'],_0x216223['filters']),_0x2ecf15);if(_0x5e16b8[_0x941b('0x2f')][_0x941b('0x3b')]){_0x5a9a1d['where']=_['merge'](_0x5a9a1d[_0x941b('0x39')],{'$or':_['map'](_0x2ecf15,function(_0x4f64d9){if(_0x4f64d9[_0x941b('0x2c')]!==_0x941b('0x3c')){var _0x15fa2b={};_0x15fa2b[_0x4f64d9[_0x941b('0x26')]]={'$like':'%'+_0x5e16b8[_0x941b('0x2f')][_0x941b('0x3b')]+'%'};return _0x15fa2b;}})});}_0x5a9a1d=_[_0x941b('0x3d')]({},_0x5a9a1d,_0x5e16b8[_0x941b('0x3e')]);var _0x52e56c={'where':_0x5a9a1d[_0x941b('0x39')]};return db[_0x941b('0x2a')][_0x941b('0x1b')](_0x52e56c)[_0x941b('0x21')](function(_0x4eb1ba){_0x205917[_0x941b('0x1b')]=_0x4eb1ba;if(_0x5e16b8[_0x941b('0x2f')][_0x941b('0x3f')]){_0x5a9a1d[_0x941b('0x40')]=[{'all':!![]}];}return db[_0x941b('0x2a')][_0x941b('0x41')](_0x5a9a1d);})[_0x941b('0x21')](function(_0x7cc12d){_0x205917[_0x941b('0x42')]=_0x7cc12d;return _0x205917;})[_0x941b('0x21')](respondWithFilteredResult(_0x277a81,_0x5a9a1d))[_0x941b('0x43')](handleError(_0x277a81,null));};exports[_0x941b('0x44')]=function(_0x63ca2,_0x3280de){var _0x858776={'raw':![],'where':{'id':_0x63ca2[_0x941b('0x45')]['id']}},_0x3c900f={};_0x3c900f[_0x941b('0x2e')]=_[_0x941b('0x30')](db[_0x941b('0x2a')][_0x941b('0x46')]);_0x3c900f[_0x941b('0x2f')]=_['keys'](_0x63ca2[_0x941b('0x2f')]);_0x3c900f[_0x941b('0x31')]=_[_0x941b('0x32')](_0x3c900f[_0x941b('0x2e')],_0x3c900f['query']);_0x858776[_0x941b('0x33')]=_[_0x941b('0x32')](_0x3c900f[_0x941b('0x2e')],qs[_0x941b('0x34')](_0x63ca2[_0x941b('0x2f')][_0x941b('0x34')]));_0x858776[_0x941b('0x33')]=_0x858776[_0x941b('0x33')][_0x941b('0x35')]?_0x858776[_0x941b('0x33')]:_0x3c900f[_0x941b('0x2e')];if(_0x63ca2[_0x941b('0x2f')][_0x941b('0x3f')]){_0x858776[_0x941b('0x40')]=[{'all':!![]}];}_0x858776=_[_0x941b('0x3d')]({},_0x858776,_0x63ca2[_0x941b('0x3e')]);return db[_0x941b('0x2a')]['find'](_0x858776)[_0x941b('0x21')](handleEntityNotFound(_0x3280de,null))[_0x941b('0x21')](respondWithResult(_0x3280de,null))['catch'](handleError(_0x3280de,null));};exports[_0x941b('0x47')]=function(_0x3c2572,_0x41382a){return db[_0x941b('0x2a')]['create'](_0x3c2572[_0x941b('0x48')],{})[_0x941b('0x21')](respondWithResult(_0x41382a,0xc9))[_0x941b('0x43')](handleError(_0x41382a,null));};exports['update']=function(_0x5c1795,_0x5ad299){if(_0x5c1795[_0x941b('0x48')]['id']){delete _0x5c1795[_0x941b('0x48')]['id'];}return db[_0x941b('0x2a')][_0x941b('0x49')]({'where':{'id':_0x5c1795[_0x941b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ad299,null))[_0x941b('0x21')](saveUpdates(_0x5c1795[_0x941b('0x48')],null))[_0x941b('0x21')](respondWithResult(_0x5ad299,null))[_0x941b('0x43')](handleError(_0x5ad299,null));};exports[_0x941b('0x22')]=function(_0x452d6c,_0x3cd4d0){return db[_0x941b('0x2a')][_0x941b('0x49')]({'where':{'id':_0x452d6c[_0x941b('0x45')]['id']}})[_0x941b('0x21')](handleEntityNotFound(_0x3cd4d0,null))[_0x941b('0x21')](removeEntity(_0x3cd4d0,null))['catch'](handleError(_0x3cd4d0,null));};exports[_0x941b('0x4a')]=function(_0x4872e0,_0xe27168,_0x2fcb1b){var _0x649ff8={};var _0x171476={};var _0x10c4b8;var _0x373951;return db['SugarcrmConfiguration'][_0x941b('0x4b')]({'where':{'id':_0x4872e0['params']['id']}})[_0x941b('0x21')](handleEntityNotFound(_0xe27168,null))[_0x941b('0x21')](function(_0x347a51){if(_0x347a51){_0x10c4b8=_0x347a51;_0x171476[_0x941b('0x2e')]=_[_0x941b('0x30')](db[_0x941b('0x4c')][_0x941b('0x46')]);_0x171476[_0x941b('0x2f')]=_[_0x941b('0x30')](_0x4872e0[_0x941b('0x2f')]);_0x171476['filters']=_[_0x941b('0x32')](_0x171476[_0x941b('0x2e')],_0x171476[_0x941b('0x2f')]);_0x649ff8['attributes']=_[_0x941b('0x32')](_0x171476[_0x941b('0x2e')],qs[_0x941b('0x34')](_0x4872e0['query']['fields']));_0x649ff8[_0x941b('0x33')]=_0x649ff8[_0x941b('0x33')]['length']?_0x649ff8[_0x941b('0x33')]:_0x171476[_0x941b('0x2e')];_0x649ff8[_0x941b('0x4d')]=qs['sort'](_0x4872e0[_0x941b('0x2f')][_0x941b('0x38')]);_0x649ff8[_0x941b('0x39')]=qs[_0x941b('0x31')](_[_0x941b('0x3a')](_0x4872e0['query'],_0x171476[_0x941b('0x31')]));if(_0x4872e0[_0x941b('0x2f')][_0x941b('0x3b')]){_0x649ff8[_0x941b('0x39')]=_[_0x941b('0x3d')](_0x649ff8[_0x941b('0x39')],{'$or':_[_0x941b('0x29')](_0x649ff8[_0x941b('0x33')],function(_0x469291){var _0x354a6e={};_0x354a6e[_0x469291]={'$like':'%'+_0x4872e0[_0x941b('0x2f')][_0x941b('0x3b')]+'%'};return _0x354a6e;})});}_0x649ff8=_[_0x941b('0x3d')]({},_0x649ff8,_0x4872e0[_0x941b('0x3e')]);return _0x10c4b8[_0x941b('0x4a')](_0x649ff8);}})[_0x941b('0x21')](function(_0x2f1c02){if(_0x2f1c02){_0x373951=_0x2f1c02[_0x941b('0x35')];if(!_0x4872e0[_0x941b('0x2f')][_0x941b('0x36')](_0x941b('0x37'))){_0x649ff8[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x4872e0[_0x941b('0x2f')]['limit']);_0x649ff8[_0x941b('0x18')]=qs[_0x941b('0x18')](_0x4872e0[_0x941b('0x2f')][_0x941b('0x18')]);}return _0x10c4b8[_0x941b('0x4a')](_0x649ff8);}})[_0x941b('0x21')](function(_0x5c5ca4){if(_0x5c5ca4){return _0x5c5ca4?{'count':_0x373951,'rows':_0x5c5ca4}:null;}})[_0x941b('0x21')](respondWithResult(_0xe27168,null))[_0x941b('0x43')](handleError(_0xe27168,null));};exports[_0x941b('0x4e')]=function(_0x5bfaa2,_0x57d661,_0x2186b5){var _0x17d255={};var _0x317654={};var _0x2c0451;var _0x54b147;return db[_0x941b('0x2a')][_0x941b('0x4b')]({'where':{'id':_0x5bfaa2[_0x941b('0x45')]['id']}})[_0x941b('0x21')](handleEntityNotFound(_0x57d661,null))['then'](function(_0x775600){if(_0x775600){_0x2c0451=_0x775600;_0x317654[_0x941b('0x2e')]=_[_0x941b('0x30')](db[_0x941b('0x4c')][_0x941b('0x46')]);_0x317654[_0x941b('0x2f')]=_[_0x941b('0x30')](_0x5bfaa2[_0x941b('0x2f')]);_0x317654[_0x941b('0x31')]=_[_0x941b('0x32')](_0x317654[_0x941b('0x2e')],_0x317654['query']);_0x17d255[_0x941b('0x33')]=_['intersection'](_0x317654['model'],qs[_0x941b('0x34')](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x34')]));_0x17d255['attributes']=_0x17d255[_0x941b('0x33')][_0x941b('0x35')]?_0x17d255[_0x941b('0x33')]:_0x317654['model'];_0x17d255[_0x941b('0x4d')]=qs[_0x941b('0x38')](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x38')]);_0x17d255[_0x941b('0x39')]=qs[_0x941b('0x31')](_['pick'](_0x5bfaa2['query'],_0x317654['filters']));if(_0x5bfaa2[_0x941b('0x2f')]['filter']){_0x17d255['where']=_[_0x941b('0x3d')](_0x17d255[_0x941b('0x39')],{'$or':_[_0x941b('0x29')](_0x17d255[_0x941b('0x33')],function(_0x10b2ea){var _0x2ca301={};_0x2ca301[_0x10b2ea]={'$like':'%'+_0x5bfaa2[_0x941b('0x2f')]['filter']+'%'};return _0x2ca301;})});}_0x17d255=_[_0x941b('0x3d')]({},_0x17d255,_0x5bfaa2[_0x941b('0x3e')]);return _0x2c0451[_0x941b('0x4e')](_0x17d255);}})[_0x941b('0x21')](function(_0x237bed){if(_0x237bed){_0x54b147=_0x237bed['length'];if(!_0x5bfaa2[_0x941b('0x2f')]['hasOwnProperty'](_0x941b('0x37'))){_0x17d255[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x19')]);_0x17d255['offset']=qs['offset'](_0x5bfaa2[_0x941b('0x2f')][_0x941b('0x18')]);}return _0x2c0451[_0x941b('0x4e')](_0x17d255);}})['then'](function(_0x322961){if(_0x322961){return _0x322961?{'count':_0x54b147,'rows':_0x322961}:null;}})[_0x941b('0x21')](respondWithResult(_0x57d661,null))[_0x941b('0x43')](handleError(_0x57d661,null));};exports[_0x941b('0x4f')]=function(_0x489c6c,_0x1334a1,_0x5ed98f){var _0x4f5190={};var _0x5e67ba={};var _0x5a807f;var _0x30aa00;return db['SugarcrmConfiguration'][_0x941b('0x4b')]({'where':{'id':_0x489c6c[_0x941b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1334a1,null))['then'](function(_0x16450a){if(_0x16450a){_0x5a807f=_0x16450a;_0x5e67ba[_0x941b('0x2e')]=_[_0x941b('0x30')](db['SugarcrmField'][_0x941b('0x46')]);_0x5e67ba['query']=_[_0x941b('0x30')](_0x489c6c['query']);_0x5e67ba[_0x941b('0x31')]=_['intersection'](_0x5e67ba[_0x941b('0x2e')],_0x5e67ba['query']);_0x4f5190['attributes']=_[_0x941b('0x32')](_0x5e67ba[_0x941b('0x2e')],qs[_0x941b('0x34')](_0x489c6c['query'][_0x941b('0x34')]));_0x4f5190[_0x941b('0x33')]=_0x4f5190['attributes']['length']?_0x4f5190['attributes']:_0x5e67ba[_0x941b('0x2e')];_0x4f5190[_0x941b('0x4d')]=qs[_0x941b('0x38')](_0x489c6c[_0x941b('0x2f')]['sort']);_0x4f5190[_0x941b('0x39')]=qs[_0x941b('0x31')](_[_0x941b('0x3a')](_0x489c6c[_0x941b('0x2f')],_0x5e67ba[_0x941b('0x31')]));if(_0x489c6c[_0x941b('0x2f')][_0x941b('0x3b')]){_0x4f5190[_0x941b('0x39')]=_[_0x941b('0x3d')](_0x4f5190[_0x941b('0x39')],{'$or':_[_0x941b('0x29')](_0x4f5190[_0x941b('0x33')],function(_0x5e5e50){var _0x5e5f9c={};_0x5e5f9c[_0x5e5e50]={'$like':'%'+_0x489c6c['query']['filter']+'%'};return _0x5e5f9c;})});}_0x4f5190=_['merge']({},_0x4f5190,_0x489c6c[_0x941b('0x3e')]);return _0x5a807f[_0x941b('0x4f')](_0x4f5190);}})[_0x941b('0x21')](function(_0x3f2d69){if(_0x3f2d69){_0x30aa00=_0x3f2d69['length'];if(!_0x489c6c[_0x941b('0x2f')][_0x941b('0x36')]('nolimit')){_0x4f5190[_0x941b('0x19')]=qs[_0x941b('0x19')](_0x489c6c[_0x941b('0x2f')][_0x941b('0x19')]);_0x4f5190[_0x941b('0x18')]=qs[_0x941b('0x18')](_0x489c6c[_0x941b('0x2f')][_0x941b('0x18')]);}return _0x5a807f[_0x941b('0x4f')](_0x4f5190);}})[_0x941b('0x21')](function(_0x32efa8){if(_0x32efa8){return _0x32efa8?{'count':_0x30aa00,'rows':_0x32efa8}:null;}})[_0x941b('0x21')](respondWithResult(_0x1334a1,null))['catch'](handleError(_0x1334a1,null));};
\ No newline at end of file
+var _0xb229=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','getFields','findOne','order','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys'];(function(_0x4578fc,_0x577fdc){var _0x2fc1d9=function(_0x2a33cb){while(--_0x2a33cb){_0x4578fc['push'](_0x4578fc['shift']());}};_0x2fc1d9(++_0x577fdc);}(_0xb229,0x6a));var _0x9b22=function(_0x52276d,_0x12d50c){_0x52276d=_0x52276d-0x0;var _0x28943c=_0xb229[_0x52276d];return _0x28943c;};'use strict';var emlformat=require(_0x9b22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b22('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b22('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9b22('0x3'));var path=require(_0x9b22('0x4'));var sox=require(_0x9b22('0x5'));var csv=require('to-csv');var ejs=require(_0x9b22('0x6'));var fs=require('fs');var fs_extra=require(_0x9b22('0x7'));var _=require(_0x9b22('0x8'));var squel=require(_0x9b22('0x9'));var crypto=require(_0x9b22('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b22('0xb'));var querystring=require(_0x9b22('0xc'));var Papa=require('papaparse');var Redis=require(_0x9b22('0xd'));var authService=require(_0x9b22('0xe'));var qs=require(_0x9b22('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b22('0x10'));var logger=require(_0x9b22('0x11'))(_0x9b22('0x12'));var utils=require(_0x9b22('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9b22('0x14'));var db=require(_0x9b22('0x15'))['db'];function respondWithStatusCode(_0xb864b,_0x45f1c6){_0x45f1c6=_0x45f1c6||0xcc;return function(_0x4948f6){if(_0x4948f6){return _0xb864b[_0x9b22('0x16')](_0x45f1c6);}return _0xb864b['status'](_0x45f1c6)[_0x9b22('0x17')]();};}function respondWithResult(_0x2c7ab4,_0x3a4d14){_0x3a4d14=_0x3a4d14||0xc8;return function(_0x15c953){if(_0x15c953){return _0x2c7ab4[_0x9b22('0x18')](_0x3a4d14)[_0x9b22('0x19')](_0x15c953);}};}function respondWithFilteredResult(_0x4e4010,_0x386aa7){return function(_0x48f71a){if(_0x48f71a){var _0x3beca9=typeof _0x386aa7[_0x9b22('0x1a')]===_0x9b22('0x1b')&&typeof _0x386aa7[_0x9b22('0x1c')]===_0x9b22('0x1b');var _0x3d1262=_0x48f71a['count'];var _0x546b0a=_0x3beca9?0x0:_0x386aa7['offset'];var _0x1703b2=_0x3beca9?_0x48f71a[_0x9b22('0x1d')]:_0x386aa7[_0x9b22('0x1a')]+_0x386aa7['limit'];var _0x43d888;if(_0x1703b2>=_0x3d1262){_0x1703b2=_0x3d1262;_0x43d888=0xc8;}else{_0x43d888=0xce;}_0x4e4010[_0x9b22('0x18')](_0x43d888);return _0x4e4010[_0x9b22('0x1e')]('Content-Range',_0x546b0a+'-'+_0x1703b2+'/'+_0x3d1262)[_0x9b22('0x19')](_0x48f71a);}return null;};}function patchUpdates(_0x1fd4df){return function(_0x25744a){try{jsonpatch[_0x9b22('0x1f')](_0x25744a,_0x1fd4df,!![]);}catch(_0x69166a){return BPromise['reject'](_0x69166a);}return _0x25744a[_0x9b22('0x20')]();};}function saveUpdates(_0x2206d6,_0x14859e){return function(_0x8afef2){if(_0x8afef2){return _0x8afef2[_0x9b22('0x21')](_0x2206d6)[_0x9b22('0x22')](function(_0x39f693){return _0x39f693;});}return null;};}function removeEntity(_0x47d2f2,_0x26dedd){return function(_0x31ac03){if(_0x31ac03){return _0x31ac03[_0x9b22('0x23')]()[_0x9b22('0x22')](function(){_0x47d2f2['status'](0xcc)[_0x9b22('0x17')]();});}};}function handleEntityNotFound(_0x3cb989,_0x5cedfe){return function(_0x519ac4){if(!_0x519ac4){_0x3cb989[_0x9b22('0x16')](0x194);}return _0x519ac4;};}function handleError(_0x4ab959,_0x38de91){_0x38de91=_0x38de91||0x1f4;return function(_0x46afce){logger[_0x9b22('0x24')](_0x46afce[_0x9b22('0x25')]);if(_0x46afce[_0x9b22('0x26')]){delete _0x46afce['name'];}_0x4ab959['status'](_0x38de91)['send'](_0x46afce);};}exports[_0x9b22('0x27')]=function(_0x161dcc,_0x261599){var _0x561e8a={},_0xabfa04={},_0xe216b5={'count':0x0,'rows':[]};var _0x38310b=_[_0x9b22('0x28')](db[_0x9b22('0x29')][_0x9b22('0x2a')],function(_0x261b55){return{'name':_0x261b55['fieldName'],'type':_0x261b55[_0x9b22('0x2b')][_0x9b22('0x2c')]};});_0xabfa04[_0x9b22('0x2d')]=_[_0x9b22('0x28')](_0x38310b,'name');_0xabfa04[_0x9b22('0x2e')]=_[_0x9b22('0x2f')](_0x161dcc['query']);_0xabfa04[_0x9b22('0x30')]=_[_0x9b22('0x31')](_0xabfa04[_0x9b22('0x2d')],_0xabfa04[_0x9b22('0x2e')]);_0x561e8a[_0x9b22('0x32')]=_[_0x9b22('0x31')](_0xabfa04[_0x9b22('0x2d')],qs[_0x9b22('0x33')](_0x161dcc[_0x9b22('0x2e')][_0x9b22('0x33')]));_0x561e8a['attributes']=_0x561e8a[_0x9b22('0x32')][_0x9b22('0x34')]?_0x561e8a[_0x9b22('0x32')]:_0xabfa04['model'];if(!_0x161dcc[_0x9b22('0x2e')][_0x9b22('0x35')](_0x9b22('0x36'))){_0x561e8a[_0x9b22('0x1c')]=qs[_0x9b22('0x1c')](_0x161dcc[_0x9b22('0x2e')][_0x9b22('0x1c')]);_0x561e8a[_0x9b22('0x1a')]=qs['offset'](_0x161dcc[_0x9b22('0x2e')]['offset']);}_0x561e8a['order']=qs[_0x9b22('0x37')](_0x161dcc[_0x9b22('0x2e')][_0x9b22('0x37')]);_0x561e8a[_0x9b22('0x38')]=qs[_0x9b22('0x30')](_[_0x9b22('0x39')](_0x161dcc[_0x9b22('0x2e')],_0xabfa04[_0x9b22('0x30')]),_0x38310b);if(_0x161dcc[_0x9b22('0x2e')][_0x9b22('0x3a')]){_0x561e8a[_0x9b22('0x38')]=_[_0x9b22('0x3b')](_0x561e8a[_0x9b22('0x38')],{'$or':_['map'](_0x38310b,function(_0xa9d1d){if(_0xa9d1d[_0x9b22('0x2b')]!==_0x9b22('0x3c')){var _0x11c92e={};_0x11c92e[_0xa9d1d[_0x9b22('0x26')]]={'$like':'%'+_0x161dcc[_0x9b22('0x2e')][_0x9b22('0x3a')]+'%'};return _0x11c92e;}})});}_0x561e8a=_[_0x9b22('0x3b')]({},_0x561e8a,_0x161dcc[_0x9b22('0x3d')]);var _0x2f8631={'where':_0x561e8a[_0x9b22('0x38')]};return db[_0x9b22('0x29')][_0x9b22('0x1d')](_0x2f8631)[_0x9b22('0x22')](function(_0x52fd44){_0xe216b5[_0x9b22('0x1d')]=_0x52fd44;if(_0x161dcc['query'][_0x9b22('0x3e')]){_0x561e8a['include']=[{'all':!![]}];}return db[_0x9b22('0x29')][_0x9b22('0x3f')](_0x561e8a);})[_0x9b22('0x22')](function(_0x134f1a){_0xe216b5[_0x9b22('0x40')]=_0x134f1a;return _0xe216b5;})[_0x9b22('0x22')](respondWithFilteredResult(_0x261599,_0x561e8a))['catch'](handleError(_0x261599,null));};exports['show']=function(_0x4966d8,_0x1250a3){var _0x26fe14={'raw':![],'where':{'id':_0x4966d8[_0x9b22('0x41')]['id']}},_0x1d0be8={};_0x1d0be8[_0x9b22('0x2d')]=_[_0x9b22('0x2f')](db[_0x9b22('0x29')][_0x9b22('0x2a')]);_0x1d0be8[_0x9b22('0x2e')]=_[_0x9b22('0x2f')](_0x4966d8['query']);_0x1d0be8['filters']=_['intersection'](_0x1d0be8['model'],_0x1d0be8[_0x9b22('0x2e')]);_0x26fe14[_0x9b22('0x32')]=_[_0x9b22('0x31')](_0x1d0be8[_0x9b22('0x2d')],qs['fields'](_0x4966d8['query'][_0x9b22('0x33')]));_0x26fe14[_0x9b22('0x32')]=_0x26fe14[_0x9b22('0x32')]['length']?_0x26fe14['attributes']:_0x1d0be8[_0x9b22('0x2d')];if(_0x4966d8['query'][_0x9b22('0x3e')]){_0x26fe14[_0x9b22('0x42')]=[{'all':!![]}];}_0x26fe14=_['merge']({},_0x26fe14,_0x4966d8[_0x9b22('0x3d')]);return db[_0x9b22('0x29')][_0x9b22('0x43')](_0x26fe14)[_0x9b22('0x22')](handleEntityNotFound(_0x1250a3,null))[_0x9b22('0x22')](respondWithResult(_0x1250a3,null))[_0x9b22('0x44')](handleError(_0x1250a3,null));};exports[_0x9b22('0x45')]=function(_0x4415c3,_0x234c24){return db['SugarcrmConfiguration'][_0x9b22('0x45')](_0x4415c3[_0x9b22('0x46')],{})[_0x9b22('0x22')](respondWithResult(_0x234c24,0xc9))[_0x9b22('0x44')](handleError(_0x234c24,null));};exports['update']=function(_0xf39c56,_0x552d72){if(_0xf39c56['body']['id']){delete _0xf39c56['body']['id'];}return db['SugarcrmConfiguration'][_0x9b22('0x43')]({'where':{'id':_0xf39c56[_0x9b22('0x41')]['id']}})['then'](handleEntityNotFound(_0x552d72,null))['then'](saveUpdates(_0xf39c56[_0x9b22('0x46')],null))['then'](respondWithResult(_0x552d72,null))[_0x9b22('0x44')](handleError(_0x552d72,null));};exports['destroy']=function(_0x3b2cc1,_0x233ec1){return db[_0x9b22('0x29')]['find']({'where':{'id':_0x3b2cc1[_0x9b22('0x41')]['id']}})[_0x9b22('0x22')](handleEntityNotFound(_0x233ec1,null))[_0x9b22('0x22')](removeEntity(_0x233ec1,null))['catch'](handleError(_0x233ec1,null));};exports[_0x9b22('0x47')]=function(_0x567feb,_0x5bf236,_0x2c4bce){var _0x47bc5d={};var _0x5644f1={};var _0x2e1058;var _0x3504a4;return db[_0x9b22('0x29')][_0x9b22('0x48')]({'where':{'id':_0x567feb['params']['id']}})['then'](handleEntityNotFound(_0x5bf236,null))[_0x9b22('0x22')](function(_0x1dd5c1){if(_0x1dd5c1){_0x2e1058=_0x1dd5c1;_0x5644f1[_0x9b22('0x2d')]=_[_0x9b22('0x2f')](db['SugarcrmField'][_0x9b22('0x2a')]);_0x5644f1[_0x9b22('0x2e')]=_['keys'](_0x567feb[_0x9b22('0x2e')]);_0x5644f1[_0x9b22('0x30')]=_[_0x9b22('0x31')](_0x5644f1[_0x9b22('0x2d')],_0x5644f1[_0x9b22('0x2e')]);_0x47bc5d[_0x9b22('0x32')]=_['intersection'](_0x5644f1['model'],qs[_0x9b22('0x33')](_0x567feb[_0x9b22('0x2e')][_0x9b22('0x33')]));_0x47bc5d[_0x9b22('0x32')]=_0x47bc5d['attributes'][_0x9b22('0x34')]?_0x47bc5d[_0x9b22('0x32')]:_0x5644f1[_0x9b22('0x2d')];_0x47bc5d[_0x9b22('0x49')]=qs[_0x9b22('0x37')](_0x567feb[_0x9b22('0x2e')][_0x9b22('0x37')]);_0x47bc5d['where']=qs[_0x9b22('0x30')](_[_0x9b22('0x39')](_0x567feb['query'],_0x5644f1['filters']));if(_0x567feb[_0x9b22('0x2e')]['filter']){_0x47bc5d['where']=_[_0x9b22('0x3b')](_0x47bc5d['where'],{'$or':_[_0x9b22('0x28')](_0x47bc5d[_0x9b22('0x32')],function(_0x1b972b){var _0x271836={};_0x271836[_0x1b972b]={'$like':'%'+_0x567feb[_0x9b22('0x2e')]['filter']+'%'};return _0x271836;})});}_0x47bc5d=_['merge']({},_0x47bc5d,_0x567feb['options']);return _0x2e1058[_0x9b22('0x47')](_0x47bc5d);}})[_0x9b22('0x22')](function(_0x3ba9be){if(_0x3ba9be){_0x3504a4=_0x3ba9be[_0x9b22('0x34')];if(!_0x567feb['query'][_0x9b22('0x35')](_0x9b22('0x36'))){_0x47bc5d[_0x9b22('0x1c')]=qs[_0x9b22('0x1c')](_0x567feb[_0x9b22('0x2e')][_0x9b22('0x1c')]);_0x47bc5d[_0x9b22('0x1a')]=qs[_0x9b22('0x1a')](_0x567feb[_0x9b22('0x2e')][_0x9b22('0x1a')]);}return _0x2e1058[_0x9b22('0x47')](_0x47bc5d);}})[_0x9b22('0x22')](function(_0xe68b43){if(_0xe68b43){return _0xe68b43?{'count':_0x3504a4,'rows':_0xe68b43}:null;}})[_0x9b22('0x22')](respondWithResult(_0x5bf236,null))[_0x9b22('0x44')](handleError(_0x5bf236,null));};exports['getSubjects']=function(_0x291035,_0x3aa263,_0x4819ba){var _0x36dff9={};var _0x57a99a={};var _0x15bd1f;var _0x3b9a86;return db['SugarcrmConfiguration'][_0x9b22('0x48')]({'where':{'id':_0x291035[_0x9b22('0x41')]['id']}})[_0x9b22('0x22')](handleEntityNotFound(_0x3aa263,null))[_0x9b22('0x22')](function(_0x2cee6a){if(_0x2cee6a){_0x15bd1f=_0x2cee6a;_0x57a99a['model']=_['keys'](db[_0x9b22('0x4a')][_0x9b22('0x2a')]);_0x57a99a[_0x9b22('0x2e')]=_[_0x9b22('0x2f')](_0x291035['query']);_0x57a99a[_0x9b22('0x30')]=_[_0x9b22('0x31')](_0x57a99a['model'],_0x57a99a['query']);_0x36dff9[_0x9b22('0x32')]=_[_0x9b22('0x31')](_0x57a99a[_0x9b22('0x2d')],qs['fields'](_0x291035['query'][_0x9b22('0x33')]));_0x36dff9[_0x9b22('0x32')]=_0x36dff9['attributes'][_0x9b22('0x34')]?_0x36dff9[_0x9b22('0x32')]:_0x57a99a[_0x9b22('0x2d')];_0x36dff9[_0x9b22('0x49')]=qs[_0x9b22('0x37')](_0x291035[_0x9b22('0x2e')][_0x9b22('0x37')]);_0x36dff9['where']=qs['filters'](_['pick'](_0x291035[_0x9b22('0x2e')],_0x57a99a['filters']));if(_0x291035[_0x9b22('0x2e')][_0x9b22('0x3a')]){_0x36dff9[_0x9b22('0x38')]=_['merge'](_0x36dff9['where'],{'$or':_[_0x9b22('0x28')](_0x36dff9[_0x9b22('0x32')],function(_0x58e5f3){var _0x30f902={};_0x30f902[_0x58e5f3]={'$like':'%'+_0x291035['query'][_0x9b22('0x3a')]+'%'};return _0x30f902;})});}_0x36dff9=_[_0x9b22('0x3b')]({},_0x36dff9,_0x291035[_0x9b22('0x3d')]);return _0x15bd1f[_0x9b22('0x4b')](_0x36dff9);}})[_0x9b22('0x22')](function(_0x365cba){if(_0x365cba){_0x3b9a86=_0x365cba[_0x9b22('0x34')];if(!_0x291035[_0x9b22('0x2e')]['hasOwnProperty'](_0x9b22('0x36'))){_0x36dff9[_0x9b22('0x1c')]=qs[_0x9b22('0x1c')](_0x291035['query'][_0x9b22('0x1c')]);_0x36dff9[_0x9b22('0x1a')]=qs[_0x9b22('0x1a')](_0x291035[_0x9b22('0x2e')][_0x9b22('0x1a')]);}return _0x15bd1f[_0x9b22('0x4b')](_0x36dff9);}})[_0x9b22('0x22')](function(_0xbdd3f0){if(_0xbdd3f0){return _0xbdd3f0?{'count':_0x3b9a86,'rows':_0xbdd3f0}:null;}})['then'](respondWithResult(_0x3aa263,null))[_0x9b22('0x44')](handleError(_0x3aa263,null));};exports[_0x9b22('0x4c')]=function(_0xf3a468,_0x65aa07,_0x429491){var _0x5b4158={};var _0x976c48={};var _0x4f7585;var _0xcd3916;return db[_0x9b22('0x29')][_0x9b22('0x48')]({'where':{'id':_0xf3a468[_0x9b22('0x41')]['id']}})[_0x9b22('0x22')](handleEntityNotFound(_0x65aa07,null))[_0x9b22('0x22')](function(_0x5e82c9){if(_0x5e82c9){_0x4f7585=_0x5e82c9;_0x976c48[_0x9b22('0x2d')]=_[_0x9b22('0x2f')](db[_0x9b22('0x4a')][_0x9b22('0x2a')]);_0x976c48['query']=_['keys'](_0xf3a468['query']);_0x976c48[_0x9b22('0x30')]=_[_0x9b22('0x31')](_0x976c48[_0x9b22('0x2d')],_0x976c48['query']);_0x5b4158[_0x9b22('0x32')]=_[_0x9b22('0x31')](_0x976c48[_0x9b22('0x2d')],qs[_0x9b22('0x33')](_0xf3a468[_0x9b22('0x2e')][_0x9b22('0x33')]));_0x5b4158[_0x9b22('0x32')]=_0x5b4158[_0x9b22('0x32')]['length']?_0x5b4158[_0x9b22('0x32')]:_0x976c48[_0x9b22('0x2d')];_0x5b4158[_0x9b22('0x49')]=qs[_0x9b22('0x37')](_0xf3a468['query'][_0x9b22('0x37')]);_0x5b4158['where']=qs[_0x9b22('0x30')](_[_0x9b22('0x39')](_0xf3a468[_0x9b22('0x2e')],_0x976c48[_0x9b22('0x30')]));if(_0xf3a468[_0x9b22('0x2e')][_0x9b22('0x3a')]){_0x5b4158[_0x9b22('0x38')]=_['merge'](_0x5b4158[_0x9b22('0x38')],{'$or':_[_0x9b22('0x28')](_0x5b4158['attributes'],function(_0x36dfa4){var _0xb40874={};_0xb40874[_0x36dfa4]={'$like':'%'+_0xf3a468[_0x9b22('0x2e')][_0x9b22('0x3a')]+'%'};return _0xb40874;})});}_0x5b4158=_['merge']({},_0x5b4158,_0xf3a468[_0x9b22('0x3d')]);return _0x4f7585[_0x9b22('0x4c')](_0x5b4158);}})[_0x9b22('0x22')](function(_0xa5faa3){if(_0xa5faa3){_0xcd3916=_0xa5faa3[_0x9b22('0x34')];if(!_0xf3a468[_0x9b22('0x2e')][_0x9b22('0x35')](_0x9b22('0x36'))){_0x5b4158['limit']=qs[_0x9b22('0x1c')](_0xf3a468[_0x9b22('0x2e')][_0x9b22('0x1c')]);_0x5b4158['offset']=qs['offset'](_0xf3a468[_0x9b22('0x2e')]['offset']);}return _0x4f7585[_0x9b22('0x4c')](_0x5b4158);}})[_0x9b22('0x22')](function(_0x1d0a78){if(_0x1d0a78){return _0x1d0a78?{'count':_0xcd3916,'rows':_0x1d0a78}:null;}})[_0x9b22('0x22')](respondWithResult(_0x65aa07,null))[_0x9b22('0x44')](handleError(_0x65aa07,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe5b=['path','rimraf','../../config/environment','exports','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','moment','bluebird'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xbe5b,0x128));var _0xbbe5=function(_0x2a9658,_0x5c1815){_0x2a9658=_0x2a9658-0x0;var _0x183403=_0xbe5b[_0x2a9658];return _0x183403;};'use strict';var _=require('lodash');var util=require(_0xbbe5('0x0'));var logger=require(_0xbbe5('0x1'))('api');var moment=require(_0xbbe5('0x2'));var BPromise=require(_0xbbe5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbe5('0x4'));var rimraf=require(_0xbbe5('0x5'));var config=require(_0xbbe5('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xbbe5('0x7')]=function(_0x5c4290,_0x11ceb0){return _0x5c4290['define'](_0xbbe5('0x8'),attributes,{'tableName':_0xbbe5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x839e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x57fd1b,_0xe41485){var _0x5db1a5=function(_0x20fab8){while(--_0x20fab8){_0x57fd1b['push'](_0x57fd1b['shift']());}};_0x5db1a5(++_0xe41485);}(_0x839e,0x117));var _0xe839=function(_0x46dedf,_0xa59cac){_0x46dedf=_0x46dedf-0x0;var _0x3851dc=_0x839e[_0x46dedf];return _0x3851dc;};'use strict';var _=require(_0xe839('0x0'));var util=require('util');var logger=require(_0xe839('0x1'))('api');var moment=require(_0xe839('0x2'));var BPromise=require(_0xe839('0x3'));var rp=require(_0xe839('0x4'));var fs=require('fs');var path=require(_0xe839('0x5'));var rimraf=require(_0xe839('0x6'));var config=require('../../config/environment');var attributes=require(_0xe839('0x7'));module['exports']=function(_0x4a6eb5,_0x18a520){return _0x4a6eb5['define'](_0xe839('0x8'),attributes,{'tableName':_0xe839('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30f1=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xe95a40,_0x4ce3ea){var _0x5684b8=function(_0x5d85c4){while(--_0x5d85c4){_0xe95a40['push'](_0xe95a40['shift']());}};_0x5684b8(++_0x4ce3ea);}(_0x30f1,0x192));var _0x130f=function(_0x23cefc,_0xf5204d){_0x23cefc=_0x23cefc-0x0;var _0x396b88=_0x30f1[_0x23cefc];return _0x396b88;};'use strict';var _=require(_0x130f('0x0'));var util=require(_0x130f('0x1'));var moment=require(_0x130f('0x2'));var BPromise=require(_0x130f('0x3'));var rs=require(_0x130f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x130f('0x5'))['db'];var utils=require(_0x130f('0x6'));var logger=require(_0x130f('0x7'))(_0x130f('0x8'));var config=require('../../config/environment');var jayson=require(_0x130f('0x9'));var client=jayson[_0x130f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e164f,_0x1a7b0b,_0x4c55dc){return new BPromise(function(_0x2b7a99,_0x1a996c){return client['request'](_0x2e164f,_0x4c55dc)[_0x130f('0xb')](function(_0x529342){logger['info'](_0x130f('0xc'),_0x1a7b0b,_0x130f('0xd'));logger['debug'](_0x130f('0xe'),_0x1a7b0b,_0x130f('0xd'),JSON['stringify'](_0x529342));if(_0x529342[_0x130f('0xf')]){if(_0x529342[_0x130f('0xf')][_0x130f('0x10')]===0x1f4){logger[_0x130f('0xf')](_0x130f('0xc'),_0x1a7b0b,_0x529342[_0x130f('0xf')][_0x130f('0x11')]);return _0x1a996c(_0x529342['error'][_0x130f('0x11')]);}logger[_0x130f('0xf')](_0x130f('0xc'),_0x1a7b0b,_0x529342[_0x130f('0xf')][_0x130f('0x11')]);return _0x2b7a99(_0x529342[_0x130f('0xf')][_0x130f('0x11')]);}else{logger[_0x130f('0x12')](_0x130f('0xc'),_0x1a7b0b,'request\x20sent');_0x2b7a99(_0x529342[_0x130f('0x13')]['message']);}})[_0x130f('0x14')](function(_0x3bae03){logger[_0x130f('0xf')](_0x130f('0xc'),_0x1a7b0b,_0x3bae03);_0x1a996c(_0x3bae03);});});}
\ No newline at end of file
+var _0x1cb1=['jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xeb80c9,_0x3fe888){var _0x259c37=function(_0x49478c){while(--_0x49478c){_0xeb80c9['push'](_0xeb80c9['shift']());}};_0x259c37(++_0x3fe888);}(_0x1cb1,0x14f));var _0x11cb=function(_0xdee9d2,_0x442fe4){_0xdee9d2=_0xdee9d2-0x0;var _0x23f3fb=_0x1cb1[_0xdee9d2];return _0x23f3fb;};'use strict';var _=require(_0x11cb('0x0'));var util=require(_0x11cb('0x1'));var moment=require(_0x11cb('0x2'));var BPromise=require(_0x11cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11cb('0x4'));var db=require(_0x11cb('0x5'))['db'];var utils=require(_0x11cb('0x6'));var logger=require(_0x11cb('0x7'))(_0x11cb('0x8'));var config=require(_0x11cb('0x9'));var jayson=require(_0x11cb('0xa'));var client=jayson[_0x11cb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad52d,_0x594c10,_0x3f1745){return new BPromise(function(_0x3cab18,_0x57bb1b){return client['request'](_0x1ad52d,_0x3f1745)[_0x11cb('0xc')](function(_0x3acd51){logger[_0x11cb('0xd')](_0x11cb('0xe'),_0x594c10,_0x11cb('0xf'));logger['debug'](_0x11cb('0x10'),_0x594c10,_0x11cb('0xf'),JSON[_0x11cb('0x11')](_0x3acd51));if(_0x3acd51[_0x11cb('0x12')]){if(_0x3acd51['error'][_0x11cb('0x13')]===0x1f4){logger[_0x11cb('0x12')](_0x11cb('0xe'),_0x594c10,_0x3acd51[_0x11cb('0x12')]['message']);return _0x57bb1b(_0x3acd51['error'][_0x11cb('0x14')]);}logger['error'](_0x11cb('0xe'),_0x594c10,_0x3acd51[_0x11cb('0x12')][_0x11cb('0x14')]);return _0x3cab18(_0x3acd51[_0x11cb('0x12')]['message']);}else{logger[_0x11cb('0xd')](_0x11cb('0xe'),_0x594c10,_0x11cb('0xf'));_0x3cab18(_0x3acd51[_0x11cb('0x15')]['message']);}})[_0x11cb('0x16')](function(_0x43a0ac){logger[_0x11cb('0x12')](_0x11cb('0xe'),_0x594c10,_0x43a0ac);_0x57bb1b(_0x43a0ac);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc62=['put','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0x155529,_0x51b5fb){var _0x28aa21=function(_0x1a2c91){while(--_0x1a2c91){_0x155529['push'](_0x155529['shift']());}};_0x28aa21(++_0x51b5fb);}(_0xcc62,0xa4));var _0x2cc6=function(_0x10b856,_0x419500){_0x10b856=_0x10b856-0x0;var _0x5b3091=_0xcc62[_0x10b856];return _0x5b3091;};'use strict';var multer=require('multer');var util=require(_0x2cc6('0x0'));var path=require('path');var timeout=require(_0x2cc6('0x1'));var express=require(_0x2cc6('0x2'));var router=express['Router']();var fs_extra=require(_0x2cc6('0x3'));var auth=require(_0x2cc6('0x4'));var interaction=require(_0x2cc6('0x5'));var config=require(_0x2cc6('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x2cc6('0x7')]('/',auth[_0x2cc6('0x8')](),controller['index']);router[_0x2cc6('0x7')](_0x2cc6('0x9'),auth[_0x2cc6('0x8')](),controller[_0x2cc6('0xa')]);router[_0x2cc6('0xb')]('/',auth[_0x2cc6('0x8')](),controller['create']);router[_0x2cc6('0xc')]('/:id',auth[_0x2cc6('0x8')](),controller[_0x2cc6('0xd')]);router[_0x2cc6('0xe')]('/:id',auth[_0x2cc6('0x8')](),controller['destroy']);module[_0x2cc6('0xf')]=router;
\ No newline at end of file
+var _0xd892=['get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','index'];(function(_0x2189dc,_0x3cc076){var _0x2eb78e=function(_0x436e14){while(--_0x436e14){_0x2189dc['push'](_0x2189dc['shift']());}};_0x2eb78e(++_0x3cc076);}(_0xd892,0x197));var _0x2d89=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xd892[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x2d89('0x0'));var util=require('util');var path=require(_0x2d89('0x1'));var timeout=require('connect-timeout');var express=require(_0x2d89('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d89('0x3'));var interaction=require(_0x2d89('0x4'));var config=require('../../config/environment');var controller=require(_0x2d89('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x2d89('0x6')]);router[_0x2d89('0x7')]('/:id',auth[_0x2d89('0x8')](),controller[_0x2d89('0x9')]);router[_0x2d89('0xa')]('/',auth[_0x2d89('0x8')](),controller[_0x2d89('0xb')]);router[_0x2d89('0xc')](_0x2d89('0xd'),auth[_0x2d89('0x8')](),controller[_0x2d89('0xe')]);router[_0x2d89('0xf')](_0x2d89('0xd'),auth[_0x2d89('0x8')](),controller[_0x2d89('0x10')]);module[_0x2d89('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d73=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x51eb91,_0x4799d5){var _0x1c4fc4=function(_0x1fd807){while(--_0x1fd807){_0x51eb91['push'](_0x51eb91['shift']());}};_0x1c4fc4(++_0x4799d5);}(_0x2d73,0xf1));var _0x32d7=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x2d73[_0x4b91c4];return _0x25cb80;};'use strict';var Sequelize=require(_0x32d7('0x0'));module['exports']={'type':{'type':Sequelize[_0x32d7('0x1')](_0x32d7('0x2'),_0x32d7('0x3'),_0x32d7('0x4'),'keyValue',_0x32d7('0x5')),'defaultValue':_0x32d7('0x2')},'content':{'type':Sequelize[_0x32d7('0x6')]},'key':{'type':Sequelize[_0x32d7('0x6')]},'keyType':{'type':Sequelize[_0x32d7('0x1')](_0x32d7('0x2'),_0x32d7('0x3'),_0x32d7('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x32d7('0x6')]},'nameField':{'type':Sequelize[_0x32d7('0x6')]},'customField':{'type':Sequelize[_0x32d7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32d7('0x6')]}};
\ No newline at end of file
+var _0x2940=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x21920b,_0x1f1839){var _0x49d4b0=function(_0x3ac258){while(--_0x3ac258){_0x21920b['push'](_0x21920b['shift']());}};_0x49d4b0(++_0x1f1839);}(_0x2940,0x1cd));var _0x0294=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x2940[_0x11dc39];return _0x457277;};'use strict';var Sequelize=require(_0x0294('0x0'));module[_0x0294('0x1')]={'type':{'type':Sequelize[_0x0294('0x2')](_0x0294('0x3'),_0x0294('0x4'),'customVariable',_0x0294('0x5'),_0x0294('0x6')),'defaultValue':_0x0294('0x3')},'content':{'type':Sequelize[_0x0294('0x7')]},'key':{'type':Sequelize[_0x0294('0x7')]},'keyType':{'type':Sequelize[_0x0294('0x2')](_0x0294('0x3'),_0x0294('0x4'),_0x0294('0x8'))},'keyContent':{'type':Sequelize[_0x0294('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0294('0x7')]},'customField':{'type':Sequelize[_0x0294('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0294('0x7')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb00b=['mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','error','name','index','SugarcrmField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','params','rawAttributes','include','create','body','catch','find','destroy','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1c96cf,_0x308719){var _0x1ccff7=function(_0x26f356){while(--_0x26f356){_0x1c96cf['push'](_0x1c96cf['shift']());}};_0x1ccff7(++_0x308719);}(_0xb00b,0x88));var _0xbb00=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb00b[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb00('0x0'));var jsonpatch=require(_0xbb00('0x1'));var rp=require(_0xbb00('0x2'));var moment=require(_0xbb00('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbb00('0x4'));var util=require(_0xbb00('0x5'));var path=require(_0xbb00('0x6'));var sox=require('sox');var csv=require(_0xbb00('0x7'));var ejs=require(_0xbb00('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb00('0x9'));var squel=require('squel');var crypto=require(_0xbb00('0xa'));var jsforce=require(_0xbb00('0xb'));var deskjs=require(_0xbb00('0xc'));var toCsv=require(_0xbb00('0x7'));var querystring=require(_0xbb00('0xd'));var Papa=require('papaparse');var Redis=require(_0xbb00('0xe'));var authService=require(_0xbb00('0xf'));var qs=require(_0xbb00('0x10'));var as=require(_0xbb00('0x11'));var hardwareService=require(_0xbb00('0x12'));var logger=require('../../config/logger')(_0xbb00('0x13'));var utils=require(_0xbb00('0x14'));var config=require(_0xbb00('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb00('0x16'))['db'];function respondWithStatusCode(_0x16ab0a,_0x28f5d5){_0x28f5d5=_0x28f5d5||0xcc;return function(_0x3e7f26){if(_0x3e7f26){return _0x16ab0a[_0xbb00('0x17')](_0x28f5d5);}return _0x16ab0a[_0xbb00('0x18')](_0x28f5d5)[_0xbb00('0x19')]();};}function respondWithResult(_0x1a77f7,_0x5b18da){_0x5b18da=_0x5b18da||0xc8;return function(_0x506e96){if(_0x506e96){return _0x1a77f7[_0xbb00('0x18')](_0x5b18da)[_0xbb00('0x1a')](_0x506e96);}};}function respondWithFilteredResult(_0x3c6eab,_0x342e84){return function(_0x4e65db){if(_0x4e65db){var _0x47e56a=typeof _0x342e84[_0xbb00('0x1b')]==='undefined'&&typeof _0x342e84[_0xbb00('0x1c')]==='undefined';var _0x32b50c=_0x4e65db[_0xbb00('0x1d')];var _0x1beb29=_0x47e56a?0x0:_0x342e84[_0xbb00('0x1b')];var _0x499d8d=_0x47e56a?_0x4e65db[_0xbb00('0x1d')]:_0x342e84[_0xbb00('0x1b')]+_0x342e84['limit'];var _0x5265b4;if(_0x499d8d>=_0x32b50c){_0x499d8d=_0x32b50c;_0x5265b4=0xc8;}else{_0x5265b4=0xce;}_0x3c6eab[_0xbb00('0x18')](_0x5265b4);return _0x3c6eab[_0xbb00('0x1e')](_0xbb00('0x1f'),_0x1beb29+'-'+_0x499d8d+'/'+_0x32b50c)[_0xbb00('0x1a')](_0x4e65db);}return null;};}function patchUpdates(_0x5f48c0){return function(_0x4fab1b){try{jsonpatch['apply'](_0x4fab1b,_0x5f48c0,!![]);}catch(_0x1d1b7e){return BPromise[_0xbb00('0x20')](_0x1d1b7e);}return _0x4fab1b[_0xbb00('0x21')]();};}function saveUpdates(_0x2b4c17,_0x294ecb){return function(_0x372891){if(_0x372891){return _0x372891['update'](_0x2b4c17)['then'](function(_0x4e0a1d){return _0x4e0a1d;});}return null;};}function removeEntity(_0x1238c8,_0x3395ac){return function(_0x311495){if(_0x311495){return _0x311495['destroy']()[_0xbb00('0x22')](function(){_0x1238c8[_0xbb00('0x18')](0xcc)[_0xbb00('0x19')]();});}};}function handleEntityNotFound(_0x4d4128,_0x74ff98){return function(_0x1647ee){if(!_0x1647ee){_0x4d4128[_0xbb00('0x17')](0x194);}return _0x1647ee;};}function handleError(_0x135cb5,_0x1ce897){_0x1ce897=_0x1ce897||0x1f4;return function(_0x1b8ecb){logger[_0xbb00('0x23')](_0x1b8ecb['stack']);if(_0x1b8ecb[_0xbb00('0x24')]){delete _0x1b8ecb[_0xbb00('0x24')];}_0x135cb5[_0xbb00('0x18')](_0x1ce897)['send'](_0x1b8ecb);};}exports[_0xbb00('0x25')]=function(_0x3a8c51,_0x5959cb){var _0x781234={},_0x35dd96={},_0x511fd9={'count':0x0,'rows':[]};var _0x16aa27=_['map'](db[_0xbb00('0x26')]['rawAttributes'],function(_0x27beb8){return{'name':_0x27beb8[_0xbb00('0x27')],'type':_0x27beb8[_0xbb00('0x28')][_0xbb00('0x29')]};});_0x35dd96[_0xbb00('0x2a')]=_['map'](_0x16aa27,_0xbb00('0x24'));_0x35dd96[_0xbb00('0x2b')]=_[_0xbb00('0x2c')](_0x3a8c51[_0xbb00('0x2b')]);_0x35dd96['filters']=_[_0xbb00('0x2d')](_0x35dd96[_0xbb00('0x2a')],_0x35dd96['query']);_0x781234[_0xbb00('0x2e')]=_[_0xbb00('0x2d')](_0x35dd96[_0xbb00('0x2a')],qs[_0xbb00('0x2f')](_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x2f')]));_0x781234[_0xbb00('0x2e')]=_0x781234[_0xbb00('0x2e')][_0xbb00('0x30')]?_0x781234['attributes']:_0x35dd96[_0xbb00('0x2a')];if(!_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x31')]('nolimit')){_0x781234[_0xbb00('0x1c')]=qs[_0xbb00('0x1c')](_0x3a8c51['query']['limit']);_0x781234[_0xbb00('0x1b')]=qs['offset'](_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x1b')]);}_0x781234[_0xbb00('0x32')]=qs['sort'](_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x33')]);_0x781234[_0xbb00('0x34')]=qs[_0xbb00('0x35')](_['pick'](_0x3a8c51[_0xbb00('0x2b')],_0x35dd96['filters']),_0x16aa27);if(_0x3a8c51[_0xbb00('0x2b')]['filter']){_0x781234['where']=_[_0xbb00('0x36')](_0x781234[_0xbb00('0x34')],{'$or':_[_0xbb00('0x37')](_0x16aa27,function(_0x5c1786){if(_0x5c1786[_0xbb00('0x28')]!==_0xbb00('0x38')){var _0x53d2d9={};_0x53d2d9[_0x5c1786[_0xbb00('0x24')]]={'$like':'%'+_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x39')]+'%'};return _0x53d2d9;}})});}_0x781234=_[_0xbb00('0x36')]({},_0x781234,_0x3a8c51[_0xbb00('0x3a')]);var _0x59a81e={'where':_0x781234[_0xbb00('0x34')]};return db[_0xbb00('0x26')][_0xbb00('0x1d')](_0x59a81e)[_0xbb00('0x22')](function(_0x540ebf){_0x511fd9['count']=_0x540ebf;if(_0x3a8c51[_0xbb00('0x2b')][_0xbb00('0x3b')]){_0x781234['include']=[{'all':!![]}];}return db[_0xbb00('0x26')][_0xbb00('0x3c')](_0x781234);})[_0xbb00('0x22')](function(_0x367333){_0x511fd9[_0xbb00('0x3d')]=_0x367333;return _0x511fd9;})[_0xbb00('0x22')](respondWithFilteredResult(_0x5959cb,_0x781234))['catch'](handleError(_0x5959cb,null));};exports['show']=function(_0x6e6cda,_0x27b213){var _0x3ccfd3={'raw':!![],'where':{'id':_0x6e6cda[_0xbb00('0x3e')]['id']}},_0x3f62dd={};_0x3f62dd[_0xbb00('0x2a')]=_[_0xbb00('0x2c')](db[_0xbb00('0x26')][_0xbb00('0x3f')]);_0x3f62dd[_0xbb00('0x2b')]=_[_0xbb00('0x2c')](_0x6e6cda[_0xbb00('0x2b')]);_0x3f62dd[_0xbb00('0x35')]=_['intersection'](_0x3f62dd['model'],_0x3f62dd[_0xbb00('0x2b')]);_0x3ccfd3['attributes']=_[_0xbb00('0x2d')](_0x3f62dd[_0xbb00('0x2a')],qs[_0xbb00('0x2f')](_0x6e6cda[_0xbb00('0x2b')][_0xbb00('0x2f')]));_0x3ccfd3['attributes']=_0x3ccfd3[_0xbb00('0x2e')][_0xbb00('0x30')]?_0x3ccfd3['attributes']:_0x3f62dd[_0xbb00('0x2a')];if(_0x6e6cda[_0xbb00('0x2b')][_0xbb00('0x3b')]){_0x3ccfd3[_0xbb00('0x40')]=[{'all':!![]}];}_0x3ccfd3=_[_0xbb00('0x36')]({},_0x3ccfd3,_0x6e6cda['options']);return db[_0xbb00('0x26')]['find'](_0x3ccfd3)['then'](handleEntityNotFound(_0x27b213,null))[_0xbb00('0x22')](respondWithResult(_0x27b213,null))['catch'](handleError(_0x27b213,null));};exports['create']=function(_0x422d53,_0x229702){return db['SugarcrmField'][_0xbb00('0x41')](_0x422d53[_0xbb00('0x42')],{})['then'](respondWithResult(_0x229702,0xc9))[_0xbb00('0x43')](handleError(_0x229702,null));};exports['update']=function(_0x25fb2b,_0xe31eef){if(_0x25fb2b[_0xbb00('0x42')]['id']){delete _0x25fb2b['body']['id'];}return db[_0xbb00('0x26')][_0xbb00('0x44')]({'where':{'id':_0x25fb2b[_0xbb00('0x3e')]['id']}})[_0xbb00('0x22')](handleEntityNotFound(_0xe31eef,null))[_0xbb00('0x22')](saveUpdates(_0x25fb2b[_0xbb00('0x42')],null))[_0xbb00('0x22')](respondWithResult(_0xe31eef,null))['catch'](handleError(_0xe31eef,null));};exports[_0xbb00('0x45')]=function(_0x56f048,_0x6b6c6f){return db['SugarcrmField'][_0xbb00('0x44')]({'where':{'id':_0x56f048[_0xbb00('0x3e')]['id']}})['then'](handleEntityNotFound(_0x6b6c6f,null))['then'](removeEntity(_0x6b6c6f,null))[_0xbb00('0x43')](handleError(_0x6b6c6f,null));};
\ No newline at end of file
+var _0x6642=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','name','send','index','map','SugarcrmField','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x1f4fbe,_0x42813d){var _0x48aec3=function(_0x47b0a6){while(--_0x47b0a6){_0x1f4fbe['push'](_0x1f4fbe['shift']());}};_0x48aec3(++_0x42813d);}(_0x6642,0x1b7));var _0x2664=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6642[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2664('0x0'));var rimraf=require(_0x2664('0x1'));var zipdir=require(_0x2664('0x2'));var jsonpatch=require(_0x2664('0x3'));var rp=require(_0x2664('0x4'));var moment=require(_0x2664('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2664('0x6'));var util=require(_0x2664('0x7'));var path=require('path');var sox=require(_0x2664('0x8'));var csv=require(_0x2664('0x9'));var ejs=require(_0x2664('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2664('0xb'));var crypto=require(_0x2664('0xc'));var jsforce=require(_0x2664('0xd'));var deskjs=require(_0x2664('0xe'));var toCsv=require(_0x2664('0x9'));var querystring=require(_0x2664('0xf'));var Papa=require(_0x2664('0x10'));var Redis=require(_0x2664('0x11'));var authService=require(_0x2664('0x12'));var qs=require(_0x2664('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2664('0x14'));var logger=require(_0x2664('0x15'))(_0x2664('0x16'));var utils=require(_0x2664('0x17'));var config=require(_0x2664('0x18'));var licenseUtil=require(_0x2664('0x19'));var db=require(_0x2664('0x1a'))['db'];function respondWithStatusCode(_0x164cb1,_0x101fdb){_0x101fdb=_0x101fdb||0xcc;return function(_0x3b3fdf){if(_0x3b3fdf){return _0x164cb1[_0x2664('0x1b')](_0x101fdb);}return _0x164cb1[_0x2664('0x1c')](_0x101fdb)[_0x2664('0x1d')]();};}function respondWithResult(_0x3db19f,_0x2781c2){_0x2781c2=_0x2781c2||0xc8;return function(_0x43a7c1){if(_0x43a7c1){return _0x3db19f['status'](_0x2781c2)[_0x2664('0x1e')](_0x43a7c1);}};}function respondWithFilteredResult(_0x274ef9,_0x38d058){return function(_0x1c3289){if(_0x1c3289){var _0xa4e1ac=typeof _0x38d058['offset']==='undefined'&&typeof _0x38d058[_0x2664('0x1f')]===_0x2664('0x20');var _0x973237=_0x1c3289[_0x2664('0x21')];var _0x112a8a=_0xa4e1ac?0x0:_0x38d058[_0x2664('0x22')];var _0x4a4244=_0xa4e1ac?_0x1c3289[_0x2664('0x21')]:_0x38d058[_0x2664('0x22')]+_0x38d058[_0x2664('0x1f')];var _0x4d3c78;if(_0x4a4244>=_0x973237){_0x4a4244=_0x973237;_0x4d3c78=0xc8;}else{_0x4d3c78=0xce;}_0x274ef9[_0x2664('0x1c')](_0x4d3c78);return _0x274ef9[_0x2664('0x23')](_0x2664('0x24'),_0x112a8a+'-'+_0x4a4244+'/'+_0x973237)[_0x2664('0x1e')](_0x1c3289);}return null;};}function patchUpdates(_0x276a0e){return function(_0x4d3bcb){try{jsonpatch[_0x2664('0x25')](_0x4d3bcb,_0x276a0e,!![]);}catch(_0xc65c98){return BPromise['reject'](_0xc65c98);}return _0x4d3bcb[_0x2664('0x26')]();};}function saveUpdates(_0x2812b1,_0x5c1429){return function(_0x3f0e13){if(_0x3f0e13){return _0x3f0e13[_0x2664('0x27')](_0x2812b1)['then'](function(_0x5beeba){return _0x5beeba;});}return null;};}function removeEntity(_0x2e9f41,_0x36d8fa){return function(_0x451ae7){if(_0x451ae7){return _0x451ae7[_0x2664('0x28')]()[_0x2664('0x29')](function(){_0x2e9f41[_0x2664('0x1c')](0xcc)[_0x2664('0x1d')]();});}};}function handleEntityNotFound(_0x5bc611,_0x2b01a7){return function(_0x27d2f7){if(!_0x27d2f7){_0x5bc611[_0x2664('0x1b')](0x194);}return _0x27d2f7;};}function handleError(_0x121e2a,_0xf1f5e9){_0xf1f5e9=_0xf1f5e9||0x1f4;return function(_0x27286f){logger['error'](_0x27286f['stack']);if(_0x27286f['name']){delete _0x27286f[_0x2664('0x2a')];}_0x121e2a[_0x2664('0x1c')](_0xf1f5e9)[_0x2664('0x2b')](_0x27286f);};}exports[_0x2664('0x2c')]=function(_0x3ba383,_0x1413be){var _0x2a17f5={},_0x230d18={},_0x5e1171={'count':0x0,'rows':[]};var _0x4fd5d0=_[_0x2664('0x2d')](db[_0x2664('0x2e')][_0x2664('0x2f')],function(_0x4efb1){return{'name':_0x4efb1[_0x2664('0x30')],'type':_0x4efb1['type']['key']};});_0x230d18[_0x2664('0x31')]=_[_0x2664('0x2d')](_0x4fd5d0,_0x2664('0x2a'));_0x230d18['query']=_['keys'](_0x3ba383[_0x2664('0x32')]);_0x230d18[_0x2664('0x33')]=_[_0x2664('0x34')](_0x230d18[_0x2664('0x31')],_0x230d18[_0x2664('0x32')]);_0x2a17f5[_0x2664('0x35')]=_['intersection'](_0x230d18[_0x2664('0x31')],qs[_0x2664('0x36')](_0x3ba383[_0x2664('0x32')][_0x2664('0x36')]));_0x2a17f5[_0x2664('0x35')]=_0x2a17f5[_0x2664('0x35')]['length']?_0x2a17f5[_0x2664('0x35')]:_0x230d18['model'];if(!_0x3ba383[_0x2664('0x32')][_0x2664('0x37')](_0x2664('0x38'))){_0x2a17f5[_0x2664('0x1f')]=qs[_0x2664('0x1f')](_0x3ba383[_0x2664('0x32')][_0x2664('0x1f')]);_0x2a17f5[_0x2664('0x22')]=qs['offset'](_0x3ba383['query'][_0x2664('0x22')]);}_0x2a17f5['order']=qs[_0x2664('0x39')](_0x3ba383[_0x2664('0x32')][_0x2664('0x39')]);_0x2a17f5['where']=qs[_0x2664('0x33')](_[_0x2664('0x3a')](_0x3ba383[_0x2664('0x32')],_0x230d18['filters']),_0x4fd5d0);if(_0x3ba383[_0x2664('0x32')][_0x2664('0x3b')]){_0x2a17f5[_0x2664('0x3c')]=_[_0x2664('0x3d')](_0x2a17f5[_0x2664('0x3c')],{'$or':_[_0x2664('0x2d')](_0x4fd5d0,function(_0x32b207){if(_0x32b207[_0x2664('0x3e')]!=='VIRTUAL'){var _0x3d4aaa={};_0x3d4aaa[_0x32b207[_0x2664('0x2a')]]={'$like':'%'+_0x3ba383[_0x2664('0x32')][_0x2664('0x3b')]+'%'};return _0x3d4aaa;}})});}_0x2a17f5=_[_0x2664('0x3d')]({},_0x2a17f5,_0x3ba383[_0x2664('0x3f')]);var _0x24aad4={'where':_0x2a17f5[_0x2664('0x3c')]};return db[_0x2664('0x2e')][_0x2664('0x21')](_0x24aad4)[_0x2664('0x29')](function(_0x497e03){_0x5e1171[_0x2664('0x21')]=_0x497e03;if(_0x3ba383[_0x2664('0x32')][_0x2664('0x40')]){_0x2a17f5[_0x2664('0x41')]=[{'all':!![]}];}return db[_0x2664('0x2e')][_0x2664('0x42')](_0x2a17f5);})[_0x2664('0x29')](function(_0xe68bf5){_0x5e1171[_0x2664('0x43')]=_0xe68bf5;return _0x5e1171;})[_0x2664('0x29')](respondWithFilteredResult(_0x1413be,_0x2a17f5))[_0x2664('0x44')](handleError(_0x1413be,null));};exports[_0x2664('0x45')]=function(_0xcd4013,_0x577845){var _0x26269e={'raw':!![],'where':{'id':_0xcd4013[_0x2664('0x46')]['id']}},_0x18a16c={};_0x18a16c[_0x2664('0x31')]=_[_0x2664('0x47')](db[_0x2664('0x2e')][_0x2664('0x2f')]);_0x18a16c[_0x2664('0x32')]=_[_0x2664('0x47')](_0xcd4013[_0x2664('0x32')]);_0x18a16c[_0x2664('0x33')]=_[_0x2664('0x34')](_0x18a16c[_0x2664('0x31')],_0x18a16c['query']);_0x26269e['attributes']=_['intersection'](_0x18a16c[_0x2664('0x31')],qs[_0x2664('0x36')](_0xcd4013['query'][_0x2664('0x36')]));_0x26269e['attributes']=_0x26269e[_0x2664('0x35')][_0x2664('0x48')]?_0x26269e['attributes']:_0x18a16c[_0x2664('0x31')];if(_0xcd4013[_0x2664('0x32')][_0x2664('0x40')]){_0x26269e[_0x2664('0x41')]=[{'all':!![]}];}_0x26269e=_['merge']({},_0x26269e,_0xcd4013['options']);return db[_0x2664('0x2e')][_0x2664('0x49')](_0x26269e)['then'](handleEntityNotFound(_0x577845,null))[_0x2664('0x29')](respondWithResult(_0x577845,null))[_0x2664('0x44')](handleError(_0x577845,null));};exports[_0x2664('0x4a')]=function(_0x40387c,_0x45b7f4){return db[_0x2664('0x2e')][_0x2664('0x4a')](_0x40387c[_0x2664('0x4b')],{})[_0x2664('0x29')](respondWithResult(_0x45b7f4,0xc9))[_0x2664('0x44')](handleError(_0x45b7f4,null));};exports[_0x2664('0x27')]=function(_0x42f57f,_0x390ba0){if(_0x42f57f[_0x2664('0x4b')]['id']){delete _0x42f57f[_0x2664('0x4b')]['id'];}return db['SugarcrmField'][_0x2664('0x49')]({'where':{'id':_0x42f57f[_0x2664('0x46')]['id']}})[_0x2664('0x29')](handleEntityNotFound(_0x390ba0,null))['then'](saveUpdates(_0x42f57f[_0x2664('0x4b')],null))[_0x2664('0x29')](respondWithResult(_0x390ba0,null))[_0x2664('0x44')](handleError(_0x390ba0,null));};exports[_0x2664('0x28')]=function(_0x56f3b5,_0x40e9c8){return db[_0x2664('0x2e')][_0x2664('0x49')]({'where':{'id':_0x56f3b5[_0x2664('0x46')]['id']}})[_0x2664('0x29')](handleEntityNotFound(_0x40e9c8,null))[_0x2664('0x29')](removeEntity(_0x40e9c8,null))[_0x2664('0x44')](handleError(_0x40e9c8,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a75=['moment','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','util','../../config/logger','api'];(function(_0x45c95c,_0x577eca){var _0x7bce9a=function(_0x1435b8){while(--_0x1435b8){_0x45c95c['push'](_0x45c95c['shift']());}};_0x7bce9a(++_0x577eca);}(_0x8a75,0x19d));var _0x58a7=function(_0xe5532c,_0x186476){_0xe5532c=_0xe5532c-0x0;var _0x4914f2=_0x8a75[_0xe5532c];return _0x4914f2;};'use strict';var _=require('lodash');var util=require(_0x58a7('0x0'));var logger=require(_0x58a7('0x1'))(_0x58a7('0x2'));var moment=require(_0x58a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x58a7('0x4'));var fs=require('fs');var path=require(_0x58a7('0x5'));var rimraf=require(_0x58a7('0x6'));var config=require('../../config/environment');var attributes=require(_0x58a7('0x7'));module[_0x58a7('0x8')]=function(_0x53d711,_0x24b349){return _0x53d711[_0x58a7('0x9')](_0x58a7('0xa'),attributes,{'tableName':_0x58a7('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x58a7('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x59a6=['moment','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger'];(function(_0x110c9d,_0x537d6d){var _0x4a0297=function(_0x55a8c4){while(--_0x55a8c4){_0x110c9d['push'](_0x110c9d['shift']());}};_0x4a0297(++_0x537d6d);}(_0x59a6,0x165));var _0x659a=function(_0x38d294,_0x5759ae){_0x38d294=_0x38d294-0x0;var _0x36a4de=_0x59a6[_0x38d294];return _0x36a4de;};'use strict';var _=require(_0x659a('0x0'));var util=require(_0x659a('0x1'));var logger=require(_0x659a('0x2'))('api');var moment=require(_0x659a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x659a('0x4'));var rimraf=require(_0x659a('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x659a('0x6')]=function(_0x315f2c,_0x5959ce){return _0x315f2c[_0x659a('0x7')](_0x659a('0x8'),attributes,{'tableName':_0x659a('0x9'),'paranoid':![],'indexes':[{'name':_0x659a('0xa'),'fields':[_0x659a('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46b2=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57e483,_0x87f94d){var _0x27b03e=function(_0x240adf){while(--_0x240adf){_0x57e483['push'](_0x57e483['shift']());}};_0x27b03e(++_0x87f94d);}(_0x46b2,0x19a));var _0x246b=function(_0x28ade3,_0x43743a){_0x28ade3=_0x28ade3-0x0;var _0x5f4799=_0x46b2[_0x28ade3];return _0x5f4799;};'use strict';var _=require(_0x246b('0x0'));var util=require('util');var moment=require(_0x246b('0x1'));var BPromise=require(_0x246b('0x2'));var rs=require(_0x246b('0x3'));var fs=require('fs');var Redis=require(_0x246b('0x4'));var db=require(_0x246b('0x5'))['db'];var utils=require(_0x246b('0x6'));var logger=require('../../config/logger')(_0x246b('0x7'));var config=require(_0x246b('0x8'));var jayson=require(_0x246b('0x9'));var client=jayson[_0x246b('0xa')][_0x246b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x178422,_0x38159e,_0x4c04f1){return new BPromise(function(_0x323251,_0x2f4566){return client[_0x246b('0xc')](_0x178422,_0x4c04f1)[_0x246b('0xd')](function(_0x2c8563){logger[_0x246b('0xe')](_0x246b('0xf'),_0x38159e,_0x246b('0x10'));logger[_0x246b('0x11')](_0x246b('0x12'),_0x38159e,_0x246b('0x10'),JSON['stringify'](_0x2c8563));if(_0x2c8563['error']){if(_0x2c8563[_0x246b('0x13')][_0x246b('0x14')]===0x1f4){logger[_0x246b('0x13')](_0x246b('0xf'),_0x38159e,_0x2c8563[_0x246b('0x13')][_0x246b('0x15')]);return _0x2f4566(_0x2c8563[_0x246b('0x13')]['message']);}logger[_0x246b('0x13')](_0x246b('0xf'),_0x38159e,_0x2c8563[_0x246b('0x13')]['message']);return _0x323251(_0x2c8563[_0x246b('0x13')]['message']);}else{logger[_0x246b('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x38159e,'request\x20sent');_0x323251(_0x2c8563[_0x246b('0x16')][_0x246b('0x15')]);}})[_0x246b('0x17')](function(_0x20aaad){logger[_0x246b('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x38159e,_0x20aaad);_0x2f4566(_0x20aaad);});});}
\ No newline at end of file
+var _0xf4aa=['stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x3d6d0d,_0x3aeaae){var _0xb22939=function(_0x5360c0){while(--_0x5360c0){_0x3d6d0d['push'](_0x3d6d0d['shift']());}};_0xb22939(++_0x3aeaae);}(_0xf4aa,0x146));var _0xaf4a=function(_0x33dda7,_0x59117d){_0x33dda7=_0x33dda7-0x0;var _0x56de5=_0xf4aa[_0x33dda7];return _0x56de5;};'use strict';var _=require(_0xaf4a('0x0'));var util=require(_0xaf4a('0x1'));var moment=require(_0xaf4a('0x2'));var BPromise=require(_0xaf4a('0x3'));var rs=require(_0xaf4a('0x4'));var fs=require('fs');var Redis=require(_0xaf4a('0x5'));var db=require(_0xaf4a('0x6'))['db'];var utils=require(_0xaf4a('0x7'));var logger=require(_0xaf4a('0x8'))(_0xaf4a('0x9'));var config=require(_0xaf4a('0xa'));var jayson=require(_0xaf4a('0xb'));var client=jayson['client'][_0xaf4a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a4741,_0x57fc59,_0x429e3d){return new BPromise(function(_0x25b0ac,_0x36d132){return client[_0xaf4a('0xd')](_0x3a4741,_0x429e3d)['then'](function(_0x9b0bfd){logger[_0xaf4a('0xe')](_0xaf4a('0xf'),_0x57fc59,_0xaf4a('0x10'));logger[_0xaf4a('0x11')](_0xaf4a('0x12'),_0x57fc59,_0xaf4a('0x10'),JSON[_0xaf4a('0x13')](_0x9b0bfd));if(_0x9b0bfd[_0xaf4a('0x14')]){if(_0x9b0bfd[_0xaf4a('0x14')]['code']===0x1f4){logger[_0xaf4a('0x14')](_0xaf4a('0xf'),_0x57fc59,_0x9b0bfd[_0xaf4a('0x14')]['message']);return _0x36d132(_0x9b0bfd['error'][_0xaf4a('0x15')]);}logger[_0xaf4a('0x14')](_0xaf4a('0xf'),_0x57fc59,_0x9b0bfd[_0xaf4a('0x14')][_0xaf4a('0x15')]);return _0x25b0ac(_0x9b0bfd[_0xaf4a('0x14')]['message']);}else{logger[_0xaf4a('0xe')](_0xaf4a('0xf'),_0x57fc59,_0xaf4a('0x10'));_0x25b0ac(_0x9b0bfd[_0xaf4a('0x16')][_0xaf4a('0x15')]);}})['catch'](function(_0x11c33f){logger[_0xaf4a('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x57fc59,_0x11c33f);_0x36d132(_0x11c33f);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6b3=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util'];(function(_0x379816,_0xc6ee82){var _0xadec45=function(_0x17c362){while(--_0x17c362){_0x379816['push'](_0x379816['shift']());}};_0xadec45(++_0xc6ee82);}(_0xa6b3,0x72));var _0x3a6b=function(_0x13c083,_0x374047){_0x13c083=_0x13c083-0x0;var _0xa0a69a=_0xa6b3[_0x13c083];return _0xa0a69a;};'use strict';var multer=require('multer');var util=require(_0x3a6b('0x0'));var path=require('path');var timeout=require(_0x3a6b('0x1'));var express=require('express');var router=express[_0x3a6b('0x2')]();var fs_extra=require(_0x3a6b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3a6b('0x4'));var config=require(_0x3a6b('0x5'));var controller=require(_0x3a6b('0x6'));router[_0x3a6b('0x7')]('/',auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x9')]);router['get'](_0x3a6b('0xa'),auth[_0x3a6b('0x8')](),controller[_0x3a6b('0xb')]);router[_0x3a6b('0x7')](_0x3a6b('0xc'),auth['isAuthenticated'](),controller[_0x3a6b('0xd')]);router[_0x3a6b('0x7')](_0x3a6b('0xe'),auth[_0x3a6b('0x8')](),controller['getFields']);router[_0x3a6b('0xf')]('/',auth['isAuthenticated'](),controller[_0x3a6b('0x10')]);router[_0x3a6b('0xf')]('/:id/configurations',auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x11')]);router[_0x3a6b('0x12')](_0x3a6b('0xa'),auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x13')]);router[_0x3a6b('0x14')](_0x3a6b('0xa'),auth[_0x3a6b('0x8')](),controller[_0x3a6b('0x15')]);module[_0x3a6b('0x16')]=router;
\ No newline at end of file
+var _0xd944=['/:id/fields','post','create','delete','destroy','util','path','express','Router','../../components/auth/service','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0xd944,0x145));var _0x4d94=function(_0x1856af,_0x268a14){_0x1856af=_0x1856af-0x0;var _0x369b69=_0xd944[_0x1856af];return _0x369b69;};'use strict';var multer=require('multer');var util=require(_0x4d94('0x0'));var path=require(_0x4d94('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d94('0x2'));var router=express[_0x4d94('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4d94('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x4d94('0x5')](),controller[_0x4d94('0x6')]);router[_0x4d94('0x7')](_0x4d94('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x4d94('0x7')](_0x4d94('0x9'),auth[_0x4d94('0x5')](),controller[_0x4d94('0xa')]);router['get'](_0x4d94('0xb'),auth[_0x4d94('0x5')](),controller['getFields']);router[_0x4d94('0xc')]('/',auth[_0x4d94('0x5')](),controller[_0x4d94('0xd')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x4d94('0x5')](),controller['update']);router[_0x4d94('0xe')]('/:id',auth[_0x4d94('0x5')](),controller[_0x4d94('0xf')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8930=['HelpDesk','sequelize','exports','STRING'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x8930,0x1d1));var _0x0893=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8930[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x0893('0x0'));module[_0x0893('0x1')]={'name':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0893('0x2')],'allowNull':![],'defaultValue':_0x0893('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0893('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7f45=['STRING','HelpDesk','sequelize','exports'];(function(_0x2511a1,_0x471283){var _0x4d8788=function(_0x3699b9){while(--_0x3699b9){_0x2511a1['push'](_0x2511a1['shift']());}};_0x4d8788(++_0x471283);}(_0x7f45,0xce));var _0x57f4=function(_0x35edf0,_0x1262de){_0x35edf0=_0x35edf0-0x0;var _0x35f86c=_0x7f45[_0x35edf0];return _0x35f86c;};'use strict';var Sequelize=require(_0x57f4('0x0'));module[_0x57f4('0x1')]={'name':{'type':Sequelize[_0x57f4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x57f4('0x2')]},'username':{'type':Sequelize[_0x57f4('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x57f4('0x2')],'allowNull':![],'defaultValue':_0x57f4('0x3')},'remoteUri':{'type':Sequelize[_0x57f4('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x57f4('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x57f4('0x2')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f1b=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','fields','find','create','catch','update','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x1c986c,_0x48f730){var _0xc6e84d=function(_0x1c4bb3){while(--_0x1c4bb3){_0x1c986c['push'](_0x1c986c['shift']());}};_0xc6e84d(++_0x48f730);}(_0x5f1b,0x70));var _0xb5f1=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0x5f1b[_0x687ddc];return _0x441991;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5f1('0x0'));var zipdir=require(_0xb5f1('0x1'));var jsonpatch=require(_0xb5f1('0x2'));var rp=require(_0xb5f1('0x3'));var moment=require(_0xb5f1('0x4'));var BPromise=require(_0xb5f1('0x5'));var Mustache=require('mustache');var util=require(_0xb5f1('0x6'));var path=require(_0xb5f1('0x7'));var sox=require(_0xb5f1('0x8'));var csv=require(_0xb5f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5f1('0xa'));var _=require(_0xb5f1('0xb'));var squel=require('squel');var crypto=require(_0xb5f1('0xc'));var jsforce=require(_0xb5f1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5f1('0xe'));var Papa=require(_0xb5f1('0xf'));var Redis=require(_0xb5f1('0x10'));var authService=require(_0xb5f1('0x11'));var qs=require(_0xb5f1('0x12'));var as=require(_0xb5f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5f1('0x14'))('api');var utils=require(_0xb5f1('0x15'));var config=require(_0xb5f1('0x16'));var licenseUtil=require(_0xb5f1('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb5f1('0x18'));function respondWithStatusCode(_0x24e596,_0x2f61a4){_0x2f61a4=_0x2f61a4||0xcc;return function(_0x5717bd){if(_0x5717bd){return _0x24e596[_0xb5f1('0x19')](_0x2f61a4);}return _0x24e596['status'](_0x2f61a4)[_0xb5f1('0x1a')]();};}function respondWithResult(_0x5ef7d8,_0x53e1dd){_0x53e1dd=_0x53e1dd||0xc8;return function(_0xdaf4ca){if(_0xdaf4ca){return _0x5ef7d8[_0xb5f1('0x1b')](_0x53e1dd)[_0xb5f1('0x1c')](_0xdaf4ca);}};}function respondWithFilteredResult(_0x33fbed,_0x8cd130){return function(_0xed36a2){if(_0xed36a2){var _0x12f6cc=typeof _0x8cd130[_0xb5f1('0x1d')]===_0xb5f1('0x1e')&&typeof _0x8cd130[_0xb5f1('0x1f')]===_0xb5f1('0x1e');var _0x4d62c8=_0xed36a2[_0xb5f1('0x20')];var _0x2cfc21=_0x12f6cc?0x0:_0x8cd130[_0xb5f1('0x1d')];var _0x5624b1=_0x12f6cc?_0xed36a2['count']:_0x8cd130[_0xb5f1('0x1d')]+_0x8cd130['limit'];var _0x572fcb;if(_0x5624b1>=_0x4d62c8){_0x5624b1=_0x4d62c8;_0x572fcb=0xc8;}else{_0x572fcb=0xce;}_0x33fbed[_0xb5f1('0x1b')](_0x572fcb);return _0x33fbed[_0xb5f1('0x21')](_0xb5f1('0x22'),_0x2cfc21+'-'+_0x5624b1+'/'+_0x4d62c8)['json'](_0xed36a2);}return null;};}function patchUpdates(_0x124707){return function(_0x173980){try{jsonpatch[_0xb5f1('0x23')](_0x173980,_0x124707,!![]);}catch(_0x551494){return BPromise[_0xb5f1('0x24')](_0x551494);}return _0x173980['save']();};}function saveUpdates(_0x204c67,_0x4e78f4){return function(_0x195d24){if(_0x195d24){return _0x195d24['update'](_0x204c67)[_0xb5f1('0x25')](function(_0x3a3b23){return _0x3a3b23;});}return null;};}function removeEntity(_0x12ecce,_0x2fea1e){return function(_0x46d044){if(_0x46d044){return _0x46d044['destroy']()[_0xb5f1('0x25')](function(){_0x12ecce[_0xb5f1('0x1b')](0xcc)[_0xb5f1('0x1a')]();});}};}function handleEntityNotFound(_0xc7008e,_0x498a33){return function(_0x325a0e){if(!_0x325a0e){_0xc7008e[_0xb5f1('0x19')](0x194);}return _0x325a0e;};}function handleError(_0x5c1f2a,_0x576860){_0x576860=_0x576860||0x1f4;return function(_0x449c51){logger[_0xb5f1('0x26')](_0x449c51[_0xb5f1('0x27')]);if(_0x449c51['name']){delete _0x449c51[_0xb5f1('0x28')];}_0x5c1f2a['status'](_0x576860)['send'](_0x449c51);};}exports[_0xb5f1('0x29')]=function(_0x949a62,_0x1cc0f1){var _0x1235c2={},_0x195a36={},_0x1dccf7={'count':0x0,'rows':[]};var _0x416f90=_[_0xb5f1('0x2a')](db[_0xb5f1('0x2b')][_0xb5f1('0x2c')],function(_0x6ce0d4){return{'name':_0x6ce0d4[_0xb5f1('0x2d')],'type':_0x6ce0d4[_0xb5f1('0x2e')][_0xb5f1('0x2f')]};});_0x195a36[_0xb5f1('0x30')]=_[_0xb5f1('0x2a')](_0x416f90,_0xb5f1('0x28'));_0x195a36[_0xb5f1('0x31')]=_[_0xb5f1('0x32')](_0x949a62[_0xb5f1('0x31')]);_0x195a36['filters']=_['intersection'](_0x195a36[_0xb5f1('0x30')],_0x195a36['query']);_0x1235c2[_0xb5f1('0x33')]=_[_0xb5f1('0x34')](_0x195a36[_0xb5f1('0x30')],qs['fields'](_0x949a62[_0xb5f1('0x31')]['fields']));_0x1235c2[_0xb5f1('0x33')]=_0x1235c2[_0xb5f1('0x33')][_0xb5f1('0x35')]?_0x1235c2[_0xb5f1('0x33')]:_0x195a36[_0xb5f1('0x30')];if(!_0x949a62[_0xb5f1('0x31')][_0xb5f1('0x36')](_0xb5f1('0x37'))){_0x1235c2['limit']=qs[_0xb5f1('0x1f')](_0x949a62[_0xb5f1('0x31')]['limit']);_0x1235c2[_0xb5f1('0x1d')]=qs['offset'](_0x949a62[_0xb5f1('0x31')][_0xb5f1('0x1d')]);}_0x1235c2[_0xb5f1('0x38')]=qs[_0xb5f1('0x39')](_0x949a62[_0xb5f1('0x31')][_0xb5f1('0x39')]);_0x1235c2[_0xb5f1('0x3a')]=qs[_0xb5f1('0x3b')](_['pick'](_0x949a62[_0xb5f1('0x31')],_0x195a36['filters']),_0x416f90);if(_0x949a62['query'][_0xb5f1('0x3c')]){_0x1235c2['where']=_['merge'](_0x1235c2[_0xb5f1('0x3a')],{'$or':_['map'](_0x416f90,function(_0x518e10){if(_0x518e10['type']!=='VIRTUAL'){var _0x58dbf3={};_0x58dbf3[_0x518e10[_0xb5f1('0x28')]]={'$like':'%'+_0x949a62[_0xb5f1('0x31')]['filter']+'%'};return _0x58dbf3;}})});}_0x1235c2=_[_0xb5f1('0x3d')]({},_0x1235c2,_0x949a62[_0xb5f1('0x3e')]);var _0x1c6b8d={'where':_0x1235c2[_0xb5f1('0x3a')]};return db[_0xb5f1('0x2b')][_0xb5f1('0x20')](_0x1c6b8d)['then'](function(_0x2a7838){_0x1dccf7[_0xb5f1('0x20')]=_0x2a7838;if(_0x949a62['query'][_0xb5f1('0x3f')]){_0x1235c2[_0xb5f1('0x40')]=[{'all':!![]}];}return db[_0xb5f1('0x2b')][_0xb5f1('0x41')](_0x1235c2);})[_0xb5f1('0x25')](function(_0x6076d4){_0x1dccf7[_0xb5f1('0x42')]=_0x6076d4;return _0x1dccf7;})[_0xb5f1('0x25')](respondWithFilteredResult(_0x1cc0f1,_0x1235c2))['catch'](handleError(_0x1cc0f1,null));};exports['show']=function(_0x216521,_0x18eab0){var _0x3f148b={'raw':![],'where':{'id':_0x216521['params']['id']}},_0x75e1c={};_0x75e1c[_0xb5f1('0x30')]=_['keys'](db[_0xb5f1('0x2b')]['rawAttributes']);_0x75e1c[_0xb5f1('0x31')]=_[_0xb5f1('0x32')](_0x216521['query']);_0x75e1c[_0xb5f1('0x3b')]=_[_0xb5f1('0x34')](_0x75e1c[_0xb5f1('0x30')],_0x75e1c[_0xb5f1('0x31')]);_0x3f148b[_0xb5f1('0x33')]=_[_0xb5f1('0x34')](_0x75e1c['model'],qs[_0xb5f1('0x43')](_0x216521[_0xb5f1('0x31')][_0xb5f1('0x43')]));_0x3f148b[_0xb5f1('0x33')]=_0x3f148b['attributes']['length']?_0x3f148b[_0xb5f1('0x33')]:_0x75e1c[_0xb5f1('0x30')];if(_0x216521[_0xb5f1('0x31')][_0xb5f1('0x3f')]){_0x3f148b[_0xb5f1('0x40')]=[{'all':!![]}];}_0x3f148b=_[_0xb5f1('0x3d')]({},_0x3f148b,_0x216521['options']);return db[_0xb5f1('0x2b')][_0xb5f1('0x44')](_0x3f148b)[_0xb5f1('0x25')](handleEntityNotFound(_0x18eab0,null))[_0xb5f1('0x25')](respondWithResult(_0x18eab0,null))['catch'](handleError(_0x18eab0,null));};exports[_0xb5f1('0x45')]=function(_0x342194,_0x434ede){return db[_0xb5f1('0x2b')][_0xb5f1('0x45')](_0x342194['body'],{})[_0xb5f1('0x25')](respondWithResult(_0x434ede,0xc9))[_0xb5f1('0x46')](handleError(_0x434ede,null));};exports[_0xb5f1('0x47')]=function(_0x255356,_0x1733c6){if(_0x255356[_0xb5f1('0x48')]['id']){delete _0x255356[_0xb5f1('0x48')]['id'];}return db[_0xb5f1('0x2b')]['find']({'where':{'id':_0x255356[_0xb5f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1733c6,null))['then'](saveUpdates(_0x255356['body'],null))[_0xb5f1('0x25')](respondWithResult(_0x1733c6,null))[_0xb5f1('0x46')](handleError(_0x1733c6,null));};exports[_0xb5f1('0x4a')]=function(_0x40d5d4,_0x3c5db4){return db[_0xb5f1('0x2b')][_0xb5f1('0x44')]({'where':{'id':_0x40d5d4[_0xb5f1('0x49')]['id']}})[_0xb5f1('0x25')](handleEntityNotFound(_0x3c5db4,null))[_0xb5f1('0x25')](removeEntity(_0x3c5db4,null))[_0xb5f1('0x46')](handleError(_0x3c5db4,null));};exports[_0xb5f1('0x4b')]=function(_0x443196,_0x24f96c,_0x52fb01){var _0x72a768={};var _0x1c094e={};var _0x9f43ed;var _0x1e90b9;return db[_0xb5f1('0x2b')][_0xb5f1('0x4c')]({'where':{'id':_0x443196[_0xb5f1('0x49')]['id']}})[_0xb5f1('0x25')](handleEntityNotFound(_0x24f96c,null))[_0xb5f1('0x25')](function(_0x5b3411){if(_0x5b3411){_0x9f43ed=_0x5b3411;_0x1c094e[_0xb5f1('0x30')]=_[_0xb5f1('0x32')](db[_0xb5f1('0x4d')][_0xb5f1('0x2c')]);_0x1c094e[_0xb5f1('0x31')]=_['keys'](_0x443196[_0xb5f1('0x31')]);_0x1c094e[_0xb5f1('0x3b')]=_[_0xb5f1('0x34')](_0x1c094e['model'],_0x1c094e['query']);_0x72a768[_0xb5f1('0x33')]=_[_0xb5f1('0x34')](_0x1c094e['model'],qs[_0xb5f1('0x43')](_0x443196[_0xb5f1('0x31')]['fields']));_0x72a768[_0xb5f1('0x33')]=_0x72a768[_0xb5f1('0x33')][_0xb5f1('0x35')]?_0x72a768[_0xb5f1('0x33')]:_0x1c094e[_0xb5f1('0x30')];_0x72a768[_0xb5f1('0x38')]=qs['sort'](_0x443196['query'][_0xb5f1('0x39')]);_0x72a768['where']=qs[_0xb5f1('0x3b')](_[_0xb5f1('0x4e')](_0x443196['query'],_0x1c094e[_0xb5f1('0x3b')]));if(_0x443196[_0xb5f1('0x31')][_0xb5f1('0x3c')]){_0x72a768[_0xb5f1('0x3a')]=_[_0xb5f1('0x3d')](_0x72a768[_0xb5f1('0x3a')],{'$or':_[_0xb5f1('0x2a')](_0x72a768[_0xb5f1('0x33')],function(_0x233818){var _0x54d6c4={};_0x54d6c4[_0x233818]={'$like':'%'+_0x443196['query'][_0xb5f1('0x3c')]+'%'};return _0x54d6c4;})});}_0x72a768=_['merge']({},_0x72a768,_0x443196[_0xb5f1('0x3e')]);return _0x9f43ed[_0xb5f1('0x4b')](_0x72a768);}})[_0xb5f1('0x25')](function(_0x18ec23){if(_0x18ec23){_0x1e90b9=_0x18ec23[_0xb5f1('0x35')];if(!_0x443196[_0xb5f1('0x31')][_0xb5f1('0x36')]('nolimit')){_0x72a768[_0xb5f1('0x1f')]=qs[_0xb5f1('0x1f')](_0x443196[_0xb5f1('0x31')]['limit']);_0x72a768['offset']=qs['offset'](_0x443196[_0xb5f1('0x31')][_0xb5f1('0x1d')]);}return _0x9f43ed[_0xb5f1('0x4b')](_0x72a768);}})[_0xb5f1('0x25')](function(_0x3a2e69){if(_0x3a2e69){return _0x3a2e69?{'count':_0x1e90b9,'rows':_0x3a2e69}:null;}})[_0xb5f1('0x25')](respondWithResult(_0x24f96c,null))[_0xb5f1('0x46')](handleError(_0x24f96c,null));};exports[_0xb5f1('0x4f')]=function(_0x124ce8,_0x5c24fb,_0x4a65bb){if(_0x124ce8[_0xb5f1('0x48')]['id']){delete _0x124ce8[_0xb5f1('0x48')]['id'];}return db['VtigerAccount'][_0xb5f1('0x4c')]({'where':{'id':_0x124ce8['params']['id']}})[_0xb5f1('0x25')](handleEntityNotFound(_0x5c24fb,null))['then'](function(_0x27eb82){if(_0x27eb82){_0x124ce8[_0xb5f1('0x48')][_0xb5f1('0x50')]=_0x27eb82['id'];_0x124ce8['body'][_0xb5f1('0x51')]=integrations[_0xb5f1('0x52')](_0x124ce8[_0xb5f1('0x48')][_0xb5f1('0x53')],_0x124ce8['body']['type']);_0x124ce8['body'][_0xb5f1('0x54')]=integrations[_0xb5f1('0x55')](_0x124ce8[_0xb5f1('0x48')][_0xb5f1('0x53')],_0x124ce8['body']['type']);return db[_0xb5f1('0x4d')][_0xb5f1('0x45')](_0x124ce8[_0xb5f1('0x48')],{'include':[{'model':db['VtigerField'],'as':_0xb5f1('0x51')},{'model':db[_0xb5f1('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5c24fb,null))[_0xb5f1('0x46')](handleError(_0x5c24fb,null));};var md5=require('md5');exports['getFields']=function(_0x57afbb,_0x16c855,_0x2251c3){var _0x47c15a=null;var _0x1d5393=null;var _0x5c3d77=null;var _0x94f5c7=null;var _0x1e75f='';return db[_0xb5f1('0x2b')]['findOne']({'where':{'id':_0x57afbb[_0xb5f1('0x49')]['id']},'attributes':['id',_0xb5f1('0x28'),_0xb5f1('0x57'),_0xb5f1('0x58'),_0xb5f1('0x59'),_0xb5f1('0x5a'),_0xb5f1('0x5b'),_0xb5f1('0x5c')]})['then'](handleEntityNotFound(_0x16c855,null))['then'](function(_0x42549f){if(_0x42549f){_0x47c15a=_0x42549f[_0xb5f1('0x57')];_0x1d5393=_0x42549f[_0xb5f1('0x5c')];_0x5c3d77=_0x42549f['moduleName'];_0x1e75f=_0x42549f[_0xb5f1('0x5a')];var _0x52e8a4=_0x1e75f[_0xb5f1('0x5d')](-0x1);if(_0x52e8a4==='/'){_0x1e75f=_0x1e75f[_0xb5f1('0x5e')](0x0,_0x1e75f[_0xb5f1('0x5f')](_0x52e8a4));}_0x94f5c7=util[_0xb5f1('0x60')]('%s/webservice.php',_0x1e75f);var _0x346216={'method':_0xb5f1('0x61'),'uri':_0x94f5c7,'qs':{'operation':_0xb5f1('0x62'),'username':_0x42549f[_0xb5f1('0x57')]},'json':!![]};return rp(_0x346216);}})[_0xb5f1('0x25')](function(_0x1a86f2){if(_0x1a86f2[_0xb5f1('0x63')]){var _0x54805e={'method':_0xb5f1('0x64'),'uri':_0x94f5c7,'form':{'operation':_0xb5f1('0x65'),'username':_0x47c15a,'accessKey':md5(_0x1a86f2[_0xb5f1('0x66')][_0xb5f1('0x67')]+_0x1d5393)},'json':!![]};return rp(_0x54805e);}})['then'](function(_0xdd41bb){if(_0xdd41bb['success']){var _0x5a3f35={'method':_0xb5f1('0x61'),'uri':_0x94f5c7,'qs':{'operation':'describe','username':_0x47c15a,'sessionName':_0xdd41bb[_0xb5f1('0x66')][_0xb5f1('0x68')],'elementType':_0x5c3d77},'json':!![]};return rp(_0x5a3f35);}})[_0xb5f1('0x25')](function(_0x2a2b79){if(_0x2a2b79['success']){var _0x1d8312=[_0xb5f1('0x69'),_0xb5f1('0x6a'),_0xb5f1('0x6b')];_[_0xb5f1('0x6c')](_0x2a2b79['result'][_0xb5f1('0x43')],function(_0x301066){return _0x1d8312[_0xb5f1('0x6d')](_0x301066[_0xb5f1('0x2e')]['name']);});_[_0xb5f1('0x6c')](_0x2a2b79[_0xb5f1('0x66')][_0xb5f1('0x43')],function(_0x42ab78){return _0x42ab78[_0xb5f1('0x6e')]===_0xb5f1('0x6f');});return{'count':_0x2a2b79[_0xb5f1('0x66')][_0xb5f1('0x43')]['length'],'rows':_[_0xb5f1('0x2a')](_0x2a2b79['result'][_0xb5f1('0x43')],function(_0x30b9bd){return{'id':_0x30b9bd[_0xb5f1('0x28')],'name':_0x30b9bd[_0xb5f1('0x70')],'custom':_[_0xb5f1('0x71')](_0x30b9bd['name'],'cf_')?!![]:![],'options':_0x30b9bd[_0xb5f1('0x2e')][_0xb5f1('0x28')]==='picklist'&&_0x30b9bd[_0xb5f1('0x2e')]['picklistValues']['length']>0x0?_[_0xb5f1('0x2a')](_0x30b9bd['type'][_0xb5f1('0x72')],function(_0x569767){return{'name':_0x569767['label'],'value':_0x569767[_0xb5f1('0x73')]};}):[]};})};}})[_0xb5f1('0x25')](respondWithResult(_0x16c855,null))[_0xb5f1('0x46')](function(_0x355513){console[_0xb5f1('0x74')](_0xb5f1('0x75')+_0x355513);var _0x40993d=_0x57afbb['query'][_0xb5f1('0x76')]?0x1f4:_0x355513[_0xb5f1('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb5f1('0x78'),_0x40993d,JSON[_0xb5f1('0x79')](_0x355513));delete _0x355513['name'];if(_0x40993d===0x191){_0x40993d=0x190;}_0x16c855[_0xb5f1('0x1b')](_0x40993d)[_0xb5f1('0x7a')](_0x57afbb[_0xb5f1('0x31')][_0xb5f1('0x76')]?{'message':_0xb5f1('0x7b'),'statusCode':_0x355513[_0xb5f1('0x77')]}:_0x355513);});};
\ No newline at end of file
+var _0x4d1c=['create','VtigerField','md5','getFields','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','GET','username','POST','login','result','success','describe','autogenerated','owner','remove','includes','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','error','stack','name','send','index','map','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VtigerAccount','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','body','update','getConfigurations','VtigerConfiguration','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x4d1c,0x91));var _0xc4d1=function(_0x7c96c7,_0x5747bb){_0x7c96c7=_0x7c96c7-0x0;var _0x235b34=_0x4d1c[_0x7c96c7];return _0x235b34;};'use strict';var emlformat=require(_0xc4d1('0x0'));var rimraf=require(_0xc4d1('0x1'));var zipdir=require(_0xc4d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc4d1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc4d1('0x4'));var csv=require(_0xc4d1('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4d1('0x6'));var _=require(_0xc4d1('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc4d1('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc4d1('0x9'));var Papa=require(_0xc4d1('0xa'));var Redis=require(_0xc4d1('0xb'));var authService=require(_0xc4d1('0xc'));var qs=require(_0xc4d1('0xd'));var as=require(_0xc4d1('0xe'));var hardwareService=require(_0xc4d1('0xf'));var logger=require(_0xc4d1('0x10'))('api');var utils=require(_0xc4d1('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc4d1('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc4d1('0x13'));function respondWithStatusCode(_0x398fdd,_0x5d5557){_0x5d5557=_0x5d5557||0xcc;return function(_0x533fa3){if(_0x533fa3){return _0x398fdd[_0xc4d1('0x14')](_0x5d5557);}return _0x398fdd[_0xc4d1('0x15')](_0x5d5557)[_0xc4d1('0x16')]();};}function respondWithResult(_0x12e376,_0x1c81f9){_0x1c81f9=_0x1c81f9||0xc8;return function(_0x1cb95f){if(_0x1cb95f){return _0x12e376['status'](_0x1c81f9)[_0xc4d1('0x17')](_0x1cb95f);}};}function respondWithFilteredResult(_0x250bbe,_0x42339c){return function(_0x5c5c9e){if(_0x5c5c9e){var _0x4794b4=typeof _0x42339c[_0xc4d1('0x18')]==='undefined'&&typeof _0x42339c[_0xc4d1('0x19')]===_0xc4d1('0x1a');var _0x463e25=_0x5c5c9e[_0xc4d1('0x1b')];var _0x11a772=_0x4794b4?0x0:_0x42339c['offset'];var _0x12cbc7=_0x4794b4?_0x5c5c9e['count']:_0x42339c[_0xc4d1('0x18')]+_0x42339c['limit'];var _0x4515c6;if(_0x12cbc7>=_0x463e25){_0x12cbc7=_0x463e25;_0x4515c6=0xc8;}else{_0x4515c6=0xce;}_0x250bbe['status'](_0x4515c6);return _0x250bbe[_0xc4d1('0x1c')]('Content-Range',_0x11a772+'-'+_0x12cbc7+'/'+_0x463e25)[_0xc4d1('0x17')](_0x5c5c9e);}return null;};}function patchUpdates(_0xba1372){return function(_0x19b51a){try{jsonpatch[_0xc4d1('0x1d')](_0x19b51a,_0xba1372,!![]);}catch(_0x372d74){return BPromise[_0xc4d1('0x1e')](_0x372d74);}return _0x19b51a['save']();};}function saveUpdates(_0x39be43,_0x43fbb4){return function(_0x3e10db){if(_0x3e10db){return _0x3e10db['update'](_0x39be43)[_0xc4d1('0x1f')](function(_0x1ca1cc){return _0x1ca1cc;});}return null;};}function removeEntity(_0x31c151,_0x18593f){return function(_0x104832){if(_0x104832){return _0x104832[_0xc4d1('0x20')]()[_0xc4d1('0x1f')](function(){_0x31c151['status'](0xcc)[_0xc4d1('0x16')]();});}};}function handleEntityNotFound(_0x30a6d3,_0x198cc8){return function(_0xe30082){if(!_0xe30082){_0x30a6d3[_0xc4d1('0x14')](0x194);}return _0xe30082;};}function handleError(_0x88a813,_0x331656){_0x331656=_0x331656||0x1f4;return function(_0x1838a4){logger[_0xc4d1('0x21')](_0x1838a4[_0xc4d1('0x22')]);if(_0x1838a4[_0xc4d1('0x23')]){delete _0x1838a4[_0xc4d1('0x23')];}_0x88a813[_0xc4d1('0x15')](_0x331656)[_0xc4d1('0x24')](_0x1838a4);};}exports[_0xc4d1('0x25')]=function(_0x281f44,_0x549ae1){var _0x2047e9={},_0x33df95={},_0x10fd79={'count':0x0,'rows':[]};var _0x435143=_[_0xc4d1('0x26')](db['VtigerAccount']['rawAttributes'],function(_0x5a8b7e){return{'name':_0x5a8b7e['fieldName'],'type':_0x5a8b7e['type'][_0xc4d1('0x27')]};});_0x33df95[_0xc4d1('0x28')]=_[_0xc4d1('0x26')](_0x435143,_0xc4d1('0x23'));_0x33df95[_0xc4d1('0x29')]=_['keys'](_0x281f44['query']);_0x33df95[_0xc4d1('0x2a')]=_['intersection'](_0x33df95['model'],_0x33df95[_0xc4d1('0x29')]);_0x2047e9[_0xc4d1('0x2b')]=_[_0xc4d1('0x2c')](_0x33df95[_0xc4d1('0x28')],qs[_0xc4d1('0x2d')](_0x281f44['query'][_0xc4d1('0x2d')]));_0x2047e9[_0xc4d1('0x2b')]=_0x2047e9['attributes']['length']?_0x2047e9[_0xc4d1('0x2b')]:_0x33df95[_0xc4d1('0x28')];if(!_0x281f44['query'][_0xc4d1('0x2e')]('nolimit')){_0x2047e9[_0xc4d1('0x19')]=qs[_0xc4d1('0x19')](_0x281f44[_0xc4d1('0x29')][_0xc4d1('0x19')]);_0x2047e9[_0xc4d1('0x18')]=qs[_0xc4d1('0x18')](_0x281f44[_0xc4d1('0x29')]['offset']);}_0x2047e9[_0xc4d1('0x2f')]=qs[_0xc4d1('0x30')](_0x281f44['query'][_0xc4d1('0x30')]);_0x2047e9[_0xc4d1('0x31')]=qs['filters'](_[_0xc4d1('0x32')](_0x281f44[_0xc4d1('0x29')],_0x33df95[_0xc4d1('0x2a')]),_0x435143);if(_0x281f44[_0xc4d1('0x29')][_0xc4d1('0x33')]){_0x2047e9[_0xc4d1('0x31')]=_[_0xc4d1('0x34')](_0x2047e9[_0xc4d1('0x31')],{'$or':_[_0xc4d1('0x26')](_0x435143,function(_0x2f4eae){if(_0x2f4eae[_0xc4d1('0x35')]!==_0xc4d1('0x36')){var _0x52e993={};_0x52e993[_0x2f4eae[_0xc4d1('0x23')]]={'$like':'%'+_0x281f44['query'][_0xc4d1('0x33')]+'%'};return _0x52e993;}})});}_0x2047e9=_['merge']({},_0x2047e9,_0x281f44['options']);var _0x2a13d2={'where':_0x2047e9[_0xc4d1('0x31')]};return db[_0xc4d1('0x37')][_0xc4d1('0x1b')](_0x2a13d2)[_0xc4d1('0x1f')](function(_0x476c83){_0x10fd79[_0xc4d1('0x1b')]=_0x476c83;if(_0x281f44[_0xc4d1('0x29')][_0xc4d1('0x38')]){_0x2047e9['include']=[{'all':!![]}];}return db[_0xc4d1('0x37')][_0xc4d1('0x39')](_0x2047e9);})[_0xc4d1('0x1f')](function(_0x5121a8){_0x10fd79[_0xc4d1('0x3a')]=_0x5121a8;return _0x10fd79;})[_0xc4d1('0x1f')](respondWithFilteredResult(_0x549ae1,_0x2047e9))[_0xc4d1('0x3b')](handleError(_0x549ae1,null));};exports[_0xc4d1('0x3c')]=function(_0x26f959,_0x23254b){var _0x443fd9={'raw':![],'where':{'id':_0x26f959[_0xc4d1('0x3d')]['id']}},_0x5463f6={};_0x5463f6[_0xc4d1('0x28')]=_[_0xc4d1('0x3e')](db[_0xc4d1('0x37')][_0xc4d1('0x3f')]);_0x5463f6[_0xc4d1('0x29')]=_['keys'](_0x26f959[_0xc4d1('0x29')]);_0x5463f6[_0xc4d1('0x2a')]=_[_0xc4d1('0x2c')](_0x5463f6[_0xc4d1('0x28')],_0x5463f6[_0xc4d1('0x29')]);_0x443fd9[_0xc4d1('0x2b')]=_['intersection'](_0x5463f6[_0xc4d1('0x28')],qs[_0xc4d1('0x2d')](_0x26f959[_0xc4d1('0x29')][_0xc4d1('0x2d')]));_0x443fd9['attributes']=_0x443fd9[_0xc4d1('0x2b')]['length']?_0x443fd9['attributes']:_0x5463f6[_0xc4d1('0x28')];if(_0x26f959[_0xc4d1('0x29')][_0xc4d1('0x38')]){_0x443fd9[_0xc4d1('0x40')]=[{'all':!![]}];}_0x443fd9=_[_0xc4d1('0x34')]({},_0x443fd9,_0x26f959['options']);return db['VtigerAccount'][_0xc4d1('0x41')](_0x443fd9)[_0xc4d1('0x1f')](handleEntityNotFound(_0x23254b,null))[_0xc4d1('0x1f')](respondWithResult(_0x23254b,null))[_0xc4d1('0x3b')](handleError(_0x23254b,null));};exports['create']=function(_0x2b7bfd,_0x2ba896){return db['VtigerAccount']['create'](_0x2b7bfd[_0xc4d1('0x42')],{})['then'](respondWithResult(_0x2ba896,0xc9))[_0xc4d1('0x3b')](handleError(_0x2ba896,null));};exports[_0xc4d1('0x43')]=function(_0x2f0291,_0x463a39){if(_0x2f0291[_0xc4d1('0x42')]['id']){delete _0x2f0291[_0xc4d1('0x42')]['id'];}return db[_0xc4d1('0x37')]['find']({'where':{'id':_0x2f0291[_0xc4d1('0x3d')]['id']}})[_0xc4d1('0x1f')](handleEntityNotFound(_0x463a39,null))['then'](saveUpdates(_0x2f0291[_0xc4d1('0x42')],null))[_0xc4d1('0x1f')](respondWithResult(_0x463a39,null))[_0xc4d1('0x3b')](handleError(_0x463a39,null));};exports[_0xc4d1('0x20')]=function(_0xd576f0,_0x3a947b){return db['VtigerAccount'][_0xc4d1('0x41')]({'where':{'id':_0xd576f0[_0xc4d1('0x3d')]['id']}})[_0xc4d1('0x1f')](handleEntityNotFound(_0x3a947b,null))[_0xc4d1('0x1f')](removeEntity(_0x3a947b,null))[_0xc4d1('0x3b')](handleError(_0x3a947b,null));};exports[_0xc4d1('0x44')]=function(_0x27e390,_0x15b092,_0x32f4bf){var _0xac1778={};var _0x318946={};var _0x183892;var _0x56d4d6;return db[_0xc4d1('0x37')]['findOne']({'where':{'id':_0x27e390[_0xc4d1('0x3d')]['id']}})[_0xc4d1('0x1f')](handleEntityNotFound(_0x15b092,null))[_0xc4d1('0x1f')](function(_0x4974cb){if(_0x4974cb){_0x183892=_0x4974cb;_0x318946[_0xc4d1('0x28')]=_['keys'](db[_0xc4d1('0x45')][_0xc4d1('0x3f')]);_0x318946['query']=_['keys'](_0x27e390[_0xc4d1('0x29')]);_0x318946['filters']=_[_0xc4d1('0x2c')](_0x318946[_0xc4d1('0x28')],_0x318946[_0xc4d1('0x29')]);_0xac1778[_0xc4d1('0x2b')]=_[_0xc4d1('0x2c')](_0x318946[_0xc4d1('0x28')],qs[_0xc4d1('0x2d')](_0x27e390[_0xc4d1('0x29')][_0xc4d1('0x2d')]));_0xac1778[_0xc4d1('0x2b')]=_0xac1778[_0xc4d1('0x2b')][_0xc4d1('0x46')]?_0xac1778[_0xc4d1('0x2b')]:_0x318946['model'];_0xac1778[_0xc4d1('0x2f')]=qs[_0xc4d1('0x30')](_0x27e390[_0xc4d1('0x29')][_0xc4d1('0x30')]);_0xac1778[_0xc4d1('0x31')]=qs[_0xc4d1('0x2a')](_[_0xc4d1('0x32')](_0x27e390[_0xc4d1('0x29')],_0x318946['filters']));if(_0x27e390['query'][_0xc4d1('0x33')]){_0xac1778[_0xc4d1('0x31')]=_['merge'](_0xac1778[_0xc4d1('0x31')],{'$or':_[_0xc4d1('0x26')](_0xac1778[_0xc4d1('0x2b')],function(_0x548953){var _0x56ce9f={};_0x56ce9f[_0x548953]={'$like':'%'+_0x27e390['query'][_0xc4d1('0x33')]+'%'};return _0x56ce9f;})});}_0xac1778=_['merge']({},_0xac1778,_0x27e390['options']);return _0x183892[_0xc4d1('0x44')](_0xac1778);}})[_0xc4d1('0x1f')](function(_0x13391e){if(_0x13391e){_0x56d4d6=_0x13391e['length'];if(!_0x27e390[_0xc4d1('0x29')][_0xc4d1('0x2e')]('nolimit')){_0xac1778['limit']=qs['limit'](_0x27e390[_0xc4d1('0x29')]['limit']);_0xac1778[_0xc4d1('0x18')]=qs[_0xc4d1('0x18')](_0x27e390[_0xc4d1('0x29')][_0xc4d1('0x18')]);}return _0x183892[_0xc4d1('0x44')](_0xac1778);}})['then'](function(_0x43ee88){if(_0x43ee88){return _0x43ee88?{'count':_0x56d4d6,'rows':_0x43ee88}:null;}})[_0xc4d1('0x1f')](respondWithResult(_0x15b092,null))[_0xc4d1('0x3b')](handleError(_0x15b092,null));};exports[_0xc4d1('0x47')]=function(_0x11ff76,_0x49a0b9,_0x244a3e){if(_0x11ff76[_0xc4d1('0x42')]['id']){delete _0x11ff76[_0xc4d1('0x42')]['id'];}return db['VtigerAccount'][_0xc4d1('0x48')]({'where':{'id':_0x11ff76['params']['id']}})[_0xc4d1('0x1f')](handleEntityNotFound(_0x49a0b9,null))[_0xc4d1('0x1f')](function(_0xe69b59){if(_0xe69b59){_0x11ff76[_0xc4d1('0x42')][_0xc4d1('0x49')]=_0xe69b59['id'];_0x11ff76[_0xc4d1('0x42')][_0xc4d1('0x4a')]=integrations[_0xc4d1('0x4b')](_0x11ff76['body'][_0xc4d1('0x4c')],_0x11ff76[_0xc4d1('0x42')]['type']);_0x11ff76[_0xc4d1('0x42')][_0xc4d1('0x4d')]=integrations[_0xc4d1('0x4e')](_0x11ff76[_0xc4d1('0x42')][_0xc4d1('0x4c')],_0x11ff76[_0xc4d1('0x42')][_0xc4d1('0x35')]);return db['VtigerConfiguration'][_0xc4d1('0x4f')](_0x11ff76[_0xc4d1('0x42')],{'include':[{'model':db[_0xc4d1('0x50')],'as':_0xc4d1('0x4a')},{'model':db[_0xc4d1('0x50')],'as':_0xc4d1('0x4d')}]});}return null;})[_0xc4d1('0x1f')](respondWithResult(_0x49a0b9,null))[_0xc4d1('0x3b')](handleError(_0x49a0b9,null));};var md5=require(_0xc4d1('0x51'));exports[_0xc4d1('0x52')]=function(_0x4c4702,_0x411488,_0xce24e3){var _0x3de5dc=null;var _0x54b5b1=null;var _0x13846d=null;var _0x1d0b04=null;var _0x3ce7cf='';return db[_0xc4d1('0x37')][_0xc4d1('0x48')]({'where':{'id':_0x4c4702['params']['id']},'attributes':['id',_0xc4d1('0x23'),'username',_0xc4d1('0x53'),_0xc4d1('0x54'),_0xc4d1('0x55'),'serverUrl',_0xc4d1('0x56')]})[_0xc4d1('0x1f')](handleEntityNotFound(_0x411488,null))['then'](function(_0x37672a){if(_0x37672a){_0x3de5dc=_0x37672a['username'];_0x54b5b1=_0x37672a[_0xc4d1('0x56')];_0x13846d=_0x37672a[_0xc4d1('0x54')];_0x3ce7cf=_0x37672a[_0xc4d1('0x55')];var _0x5063a3=_0x3ce7cf[_0xc4d1('0x57')](-0x1);if(_0x5063a3==='/'){_0x3ce7cf=_0x3ce7cf[_0xc4d1('0x58')](0x0,_0x3ce7cf[_0xc4d1('0x59')](_0x5063a3));}_0x1d0b04=util[_0xc4d1('0x5a')]('%s/webservice.php',_0x3ce7cf);var _0x2a2cf2={'method':_0xc4d1('0x5b'),'uri':_0x1d0b04,'qs':{'operation':'getchallenge','username':_0x37672a[_0xc4d1('0x5c')]},'json':!![]};return rp(_0x2a2cf2);}})[_0xc4d1('0x1f')](function(_0x359d93){if(_0x359d93['success']){var _0x1bf4f6={'method':_0xc4d1('0x5d'),'uri':_0x1d0b04,'form':{'operation':_0xc4d1('0x5e'),'username':_0x3de5dc,'accessKey':md5(_0x359d93[_0xc4d1('0x5f')]['token']+_0x54b5b1)},'json':!![]};return rp(_0x1bf4f6);}})[_0xc4d1('0x1f')](function(_0x127130){if(_0x127130[_0xc4d1('0x60')]){var _0xfa43b9={'method':_0xc4d1('0x5b'),'uri':_0x1d0b04,'qs':{'operation':_0xc4d1('0x61'),'username':_0x3de5dc,'sessionName':_0x127130['result']['sessionName'],'elementType':_0x13846d},'json':!![]};return rp(_0xfa43b9);}})[_0xc4d1('0x1f')](function(_0x26b7ee){if(_0x26b7ee['success']){var _0x9c1556=[_0xc4d1('0x62'),'reference',_0xc4d1('0x63')];_[_0xc4d1('0x64')](_0x26b7ee[_0xc4d1('0x5f')]['fields'],function(_0x1243d2){return _0x9c1556[_0xc4d1('0x65')](_0x1243d2['type'][_0xc4d1('0x23')]);});_[_0xc4d1('0x64')](_0x26b7ee[_0xc4d1('0x5f')][_0xc4d1('0x2d')],function(_0x405143){return _0x405143['editable']==='false';});return{'count':_0x26b7ee[_0xc4d1('0x5f')]['fields']['length'],'rows':_['map'](_0x26b7ee[_0xc4d1('0x5f')][_0xc4d1('0x2d')],function(_0x2972fd){return{'id':_0x2972fd['name'],'name':_0x2972fd[_0xc4d1('0x66')],'custom':_['startsWith'](_0x2972fd['name'],_0xc4d1('0x67'))?!![]:![],'options':_0x2972fd[_0xc4d1('0x35')][_0xc4d1('0x23')]==='picklist'&&_0x2972fd['type'][_0xc4d1('0x68')][_0xc4d1('0x46')]>0x0?_[_0xc4d1('0x26')](_0x2972fd[_0xc4d1('0x35')][_0xc4d1('0x68')],function(_0x1f10bf){return{'name':_0x1f10bf[_0xc4d1('0x66')],'value':_0x1f10bf[_0xc4d1('0x69')]};}):[]};})};}})[_0xc4d1('0x1f')](respondWithResult(_0x411488,null))[_0xc4d1('0x3b')](function(_0xad32b3){console[_0xc4d1('0x6a')](_0xc4d1('0x6b')+_0xad32b3);var _0x548ac3=_0x4c4702['query'][_0xc4d1('0x6c')]?0x1f4:_0xad32b3[_0xc4d1('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xc4d1('0x52'),_0x548ac3,JSON[_0xc4d1('0x6e')](_0xad32b3));delete _0xad32b3[_0xc4d1('0x23')];if(_0x548ac3===0x191){_0x548ac3=0x190;}_0x411488[_0xc4d1('0x15')](_0x548ac3)[_0xc4d1('0x24')](_0x4c4702[_0xc4d1('0x29')][_0xc4d1('0x6c')]?{'message':_0xc4d1('0x6f'),'statusCode':_0xad32b3[_0xc4d1('0x6d')]}:_0xad32b3);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88a6=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0x88a6,0x172));var _0x688a=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0x88a6[_0x31abee];return _0x3c1761;};'use strict';var _=require(_0x688a('0x0'));var util=require(_0x688a('0x1'));var logger=require('../../config/logger')(_0x688a('0x2'));var moment=require(_0x688a('0x3'));var BPromise=require(_0x688a('0x4'));var rp=require(_0x688a('0x5'));var fs=require('fs');var path=require(_0x688a('0x6'));var rimraf=require('rimraf');var config=require(_0x688a('0x7'));var attributes=require(_0x688a('0x8'));var integrations=require(_0x688a('0x9'));module[_0x688a('0xa')]=function(_0x1301d4,_0x390b09){return _0x1301d4[_0x688a('0xb')]('VtigerAccount',attributes,{'tableName':_0x688a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ee7=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c578b,_0x1db501){var _0x1691a5=function(_0x4baacb){while(--_0x4baacb){_0x5c578b['push'](_0x5c578b['shift']());}};_0x1691a5(++_0x1db501);}(_0x0ee7,0xe7));var _0x70ee=function(_0x26e351,_0x5c6b66){_0x26e351=_0x26e351-0x0;var _0x6b5869=_0x0ee7[_0x26e351];return _0x6b5869;};'use strict';var _=require(_0x70ee('0x0'));var util=require(_0x70ee('0x1'));var logger=require(_0x70ee('0x2'))(_0x70ee('0x3'));var moment=require(_0x70ee('0x4'));var BPromise=require(_0x70ee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70ee('0x6'));var rimraf=require(_0x70ee('0x7'));var config=require(_0x70ee('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x70ee('0x9'));module[_0x70ee('0xa')]=function(_0x2973b2,_0x4fb90c){return _0x2973b2[_0x70ee('0xb')](_0x70ee('0xc'),attributes,{'tableName':_0x70ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4483=['client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVtigerAccount','options','raw','where','attributes','include','model','find','map','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x325d3c,_0xc4f35d){var _0x42b1e2=function(_0x5e1bc3){while(--_0x5e1bc3){_0x325d3c['push'](_0x325d3c['shift']());}};_0x42b1e2(++_0xc4f35d);}(_0x4483,0x1a3));var _0x3448=function(_0x23e5a8,_0x1a32d0){_0x23e5a8=_0x23e5a8-0x0;var _0x39df93=_0x4483[_0x23e5a8];return _0x39df93;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});}exports[_0x3448('0x17')]=function(_0x425514){var _0x4a348c=this;return new Promise(function(_0x1658cd,_0x5b410d){return db['VtigerAccount']['findAll']({'raw':_0x425514[_0x3448('0x18')]?_0x425514[_0x3448('0x18')][_0x3448('0x19')]===undefined?!![]:![]:!![],'where':_0x425514['options']?_0x425514[_0x3448('0x18')][_0x3448('0x1a')]||null:null,'attributes':_0x425514[_0x3448('0x18')]?_0x425514[_0x3448('0x18')][_0x3448('0x1b')]||null:null,'limit':_0x425514[_0x3448('0x18')]?_0x425514['options']['limit']||null:null,'include':_0x425514['options']?_0x425514[_0x3448('0x18')][_0x3448('0x1c')]?_['map'](_0x425514['options'][_0x3448('0x1c')],function(_0x4371d6){return{'model':db[_0x4371d6[_0x3448('0x1d')]],'as':_0x4371d6['as'],'attributes':_0x4371d6[_0x3448('0x1b')],'include':_0x4371d6[_0x3448('0x1c')]?_['map'](_0x4371d6[_0x3448('0x1c')],function(_0x1b5c49){return{'model':db[_0x1b5c49[_0x3448('0x1d')]],'as':_0x1b5c49['as'],'attributes':_0x1b5c49[_0x3448('0x1b')],'include':_0x1b5c49[_0x3448('0x1c')]?_['map'](_0x1b5c49[_0x3448('0x1c')],function(_0x393081){return{'model':db[_0x393081['model']],'as':_0x393081['as'],'attributes':_0x393081[_0x3448('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3448('0xc')](function(_0x310912){logger[_0x3448('0xd')](_0x3448('0x17'),_0x425514);logger[_0x3448('0x10')](_0x3448('0x17'),_0x425514,JSON[_0x3448('0x12')](_0x310912));_0x1658cd(_0x310912);})['catch'](function(_0x3307dc){logger[_0x3448('0x13')](_0x3448('0x17'),_0x3307dc['message'],_0x425514);_0x5b410d(_0x4a348c[_0x3448('0x13')](0x1f4,_0x3307dc['message']));});});};exports['ShowVtigerAccount']=function(_0x493898){var _0x52fb48=this;return new Promise(function(_0xff6513,_0x5e96f0){return db['VtigerAccount'][_0x3448('0x1e')]({'raw':_0x493898[_0x3448('0x18')]?_0x493898[_0x3448('0x18')][_0x3448('0x19')]===undefined?!![]:![]:!![],'where':_0x493898['options']?_0x493898[_0x3448('0x18')][_0x3448('0x1a')]||null:null,'attributes':_0x493898[_0x3448('0x18')]?_0x493898['options'][_0x3448('0x1b')]||null:null,'include':_0x493898[_0x3448('0x18')]?_0x493898['options']['include']?_[_0x3448('0x1f')](_0x493898[_0x3448('0x18')][_0x3448('0x1c')],function(_0x37a0ee){return{'model':db[_0x37a0ee['model']],'as':_0x37a0ee['as'],'attributes':_0x37a0ee[_0x3448('0x1b')],'include':_0x37a0ee[_0x3448('0x1c')]?_[_0x3448('0x1f')](_0x37a0ee[_0x3448('0x1c')],function(_0x5ebab6){return{'model':db[_0x5ebab6[_0x3448('0x1d')]],'as':_0x5ebab6['as'],'attributes':_0x5ebab6[_0x3448('0x1b')],'include':_0x5ebab6['include']?_[_0x3448('0x1f')](_0x5ebab6[_0x3448('0x1c')],function(_0x89d6ae){return{'model':db[_0x89d6ae[_0x3448('0x1d')]],'as':_0x89d6ae['as'],'attributes':_0x89d6ae[_0x3448('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3448('0xc')](function(_0x32592f){logger[_0x3448('0xd')](_0x3448('0x20'),_0x493898);logger['debug']('ShowVtigerAccount',_0x493898,JSON[_0x3448('0x12')](_0x32592f));_0xff6513(_0x32592f);})['catch'](function(_0x22bb31){logger[_0x3448('0x13')](_0x3448('0x20'),_0x22bb31[_0x3448('0x14')],_0x493898);_0x5e96f0(_0x52fb48['error'](0x1f4,_0x22bb31[_0x3448('0x14')]));});});};
\ No newline at end of file
+var _0x4024=['attributes','include','map','model','then','debug','ShowVtigerAccount','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x5e311c,_0x1af1c5){var _0x30f71b=function(_0x151de5){while(--_0x151de5){_0x5e311c['push'](_0x5e311c['shift']());}};_0x30f71b(++_0x1af1c5);}(_0x4024,0x89));var _0x4402=function(_0x2d6857,_0x4e080c){_0x2d6857=_0x2d6857-0x0;var _0x23f094=_0x4024[_0x2d6857];return _0x23f094;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['findAll']({'raw':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x231382[_0x4402('0x16')]?_0x231382['options']['where']||null:null,'attributes':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')][_0x4402('0x17')]||null:null,'limit':_0x231382['options']?_0x231382[_0x4402('0x16')]['limit']||null:null,'include':_0x231382['options']?_0x231382[_0x4402('0x16')][_0x4402('0x18')]?_[_0x4402('0x19')](_0x231382[_0x4402('0x16')][_0x4402('0x18')],function(_0x2e6fee){return{'model':db[_0x2e6fee[_0x4402('0x1a')]],'as':_0x2e6fee['as'],'attributes':_0x2e6fee[_0x4402('0x17')],'include':_0x2e6fee[_0x4402('0x18')]?_['map'](_0x2e6fee[_0x4402('0x18')],function(_0x4e1c04){return{'model':db[_0x4e1c04[_0x4402('0x1a')]],'as':_0x4e1c04['as'],'attributes':_0x4e1c04[_0x4402('0x17')],'include':_0x4e1c04[_0x4402('0x18')]?_[_0x4402('0x19')](_0x4e1c04['include'],function(_0x15c19f){return{'model':db[_0x15c19f['model']],'as':_0x15c19f['as'],'attributes':_0x15c19f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x395e49){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x1c')]('GetVtigerAccount',_0x231382,JSON[_0x4402('0xd')](_0x395e49));_0x494389(_0x395e49);})['catch'](function(_0x71da2f){logger[_0x4402('0xe')](_0x4402('0x14'),_0x71da2f['message'],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x71da2f[_0x4402('0x11')]));});});};exports[_0x4402('0x1d')]=function(_0x3f4bcb){var _0x2526d1=this;return new Promise(function(_0x605702,_0x1189b8){return db[_0x4402('0x15')][_0x4402('0x1e')]({'raw':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb['options'][_0x4402('0x1f')]||null:null,'attributes':_0x3f4bcb['options']?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x17')]||null:null,'include':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')]?_['map'](_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')],function(_0x169340){return{'model':db[_0x169340['model']],'as':_0x169340['as'],'attributes':_0x169340[_0x4402('0x17')],'include':_0x169340[_0x4402('0x18')]?_['map'](_0x169340[_0x4402('0x18')],function(_0x437e83){return{'model':db[_0x437e83[_0x4402('0x1a')]],'as':_0x437e83['as'],'attributes':_0x437e83[_0x4402('0x17')],'include':_0x437e83[_0x4402('0x18')]?_[_0x4402('0x19')](_0x437e83[_0x4402('0x18')],function(_0x6e9fb7){return{'model':db[_0x6e9fb7[_0x4402('0x1a')]],'as':_0x6e9fb7['as'],'attributes':_0x6e9fb7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x28fee8){logger[_0x4402('0xa')]('ShowVtigerAccount',_0x3f4bcb);logger[_0x4402('0x1c')](_0x4402('0x1d'),_0x3f4bcb,JSON['stringify'](_0x28fee8));_0x605702(_0x28fee8);})['catch'](function(_0x2b9d51){logger[_0x4402('0xe')](_0x4402('0x1d'),_0x2b9d51[_0x4402('0x11')],_0x3f4bcb);_0x1189b8(_0x2526d1['error'](0x1f4,_0x2b9d51['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4efe=['create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','getSubjects','/:id/descriptions'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x4efe,0x16c));var _0xe4ef=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x4efe[_0x390733];return _0x33beb9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe4ef('0x0'));var timeout=require(_0xe4ef('0x1'));var express=require('express');var router=express[_0xe4ef('0x2')]();var fs_extra=require(_0xe4ef('0x3'));var auth=require(_0xe4ef('0x4'));var interaction=require(_0xe4ef('0x5'));var config=require(_0xe4ef('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0xe4ef('0x7')]('/',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0x9')]);router[_0xe4ef('0x7')]('/:id',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xa')]);router[_0xe4ef('0x7')]('/:id/fields',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xb')]);router['get']('/:id/subjects',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xc')]);router[_0xe4ef('0x7')](_0xe4ef('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xe4ef('0x8')](),controller[_0xe4ef('0xe')]);router[_0xe4ef('0xf')](_0xe4ef('0x10'),auth['isAuthenticated'](),controller[_0xe4ef('0x11')]);router[_0xe4ef('0x12')](_0xe4ef('0x10'),auth[_0xe4ef('0x8')](),controller[_0xe4ef('0x13')]);module[_0xe4ef('0x14')]=router;
\ No newline at end of file
+var _0xd7a7=['put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xd7a7,0x1e8));var _0x7d7a=function(_0x5b4e8f,_0x2683f2){_0x5b4e8f=_0x5b4e8f-0x0;var _0x157a6=_0xd7a7[_0x5b4e8f];return _0x157a6;};'use strict';var multer=require('multer');var util=require(_0x7d7a('0x0'));var path=require('path');var timeout=require(_0x7d7a('0x1'));var express=require(_0x7d7a('0x2'));var router=express[_0x7d7a('0x3')]();var fs_extra=require(_0x7d7a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7d7a('0x5'));var config=require(_0x7d7a('0x6'));var controller=require(_0x7d7a('0x7'));router[_0x7d7a('0x8')]('/',auth[_0x7d7a('0x9')](),controller[_0x7d7a('0xa')]);router[_0x7d7a('0x8')](_0x7d7a('0xb'),auth[_0x7d7a('0x9')](),controller['show']);router[_0x7d7a('0x8')](_0x7d7a('0xc'),auth[_0x7d7a('0x9')](),controller[_0x7d7a('0xd')]);router[_0x7d7a('0x8')](_0x7d7a('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x7d7a('0x8')](_0x7d7a('0xf'),auth[_0x7d7a('0x9')](),controller[_0x7d7a('0x10')]);router['post']('/',auth[_0x7d7a('0x9')](),controller[_0x7d7a('0x11')]);router[_0x7d7a('0x12')](_0x7d7a('0xb'),auth[_0x7d7a('0x9')](),controller['update']);router[_0x7d7a('0x13')]('/:id',auth[_0x7d7a('0x9')](),controller[_0x7d7a('0x14')]);module[_0x7d7a('0x15')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33bb=['exports','STRING','sequelize'];(function(_0x145980,_0x52cc4e){var _0x2fe396=function(_0x4b0c30){while(--_0x4b0c30){_0x145980['push'](_0x145980['shift']());}};_0x2fe396(++_0x52cc4e);}(_0x33bb,0x122));var _0xb33b=function(_0x5d2bd,_0x50fa53){_0x5d2bd=_0x5d2bd-0x0;var _0x51665d=_0x33bb[_0x5d2bd];return _0x51665d;};'use strict';var Sequelize=require(_0xb33b('0x0'));module[_0xb33b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb33b('0x2')]}};
\ No newline at end of file
+var _0x0611=['STRING','exports'];(function(_0xd3c505,_0x2a939f){var _0x41bd8d=function(_0x2d88ee){while(--_0x2d88ee){_0xd3c505['push'](_0xd3c505['shift']());}};_0x41bd8d(++_0x2a939f);}(_0x0611,0x1c7));var _0x1061=function(_0x50495a,_0x3e9685){_0x50495a=_0x50495a-0x0;var _0x23e5fe=_0x0611[_0x50495a];return _0x23e5fe;};'use strict';var Sequelize=require('sequelize');module[_0x1061('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1061('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f13=['findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','include'];(function(_0x265420,_0x4d4228){var _0x2b7d42=function(_0x4eb2b9){while(--_0x4eb2b9){_0x265420['push'](_0x265420['shift']());}};_0x2b7d42(++_0x4d4228);}(_0x2f13,0x1f0));var _0x32f1=function(_0xaeb053,_0x5e3a79){_0xaeb053=_0xaeb053-0x0;var _0x311af5=_0x2f13[_0xaeb053];return _0x311af5;};'use strict';var emlformat=require(_0x32f1('0x0'));var rimraf=require(_0x32f1('0x1'));var zipdir=require(_0x32f1('0x2'));var jsonpatch=require(_0x32f1('0x3'));var rp=require(_0x32f1('0x4'));var moment=require('moment');var BPromise=require(_0x32f1('0x5'));var Mustache=require(_0x32f1('0x6'));var util=require('util');var path=require(_0x32f1('0x7'));var sox=require(_0x32f1('0x8'));var csv=require(_0x32f1('0x9'));var ejs=require(_0x32f1('0xa'));var fs=require('fs');var fs_extra=require(_0x32f1('0xb'));var _=require('lodash');var squel=require(_0x32f1('0xc'));var crypto=require('crypto');var jsforce=require(_0x32f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x32f1('0x9'));var querystring=require(_0x32f1('0xe'));var Papa=require('papaparse');var Redis=require(_0x32f1('0xf'));var authService=require(_0x32f1('0x10'));var qs=require(_0x32f1('0x11'));var as=require(_0x32f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32f1('0x13'))(_0x32f1('0x14'));var utils=require(_0x32f1('0x15'));var config=require(_0x32f1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2775cc,_0x4767e8){_0x4767e8=_0x4767e8||0xcc;return function(_0xdad373){if(_0xdad373){return _0x2775cc[_0x32f1('0x17')](_0x4767e8);}return _0x2775cc[_0x32f1('0x18')](_0x4767e8)[_0x32f1('0x19')]();};}function respondWithResult(_0x353c83,_0x4b67f1){_0x4b67f1=_0x4b67f1||0xc8;return function(_0x1fcc19){if(_0x1fcc19){return _0x353c83[_0x32f1('0x18')](_0x4b67f1)['json'](_0x1fcc19);}};}function respondWithFilteredResult(_0x3db949,_0x483965){return function(_0xdd77c2){if(_0xdd77c2){var _0x4793a7=typeof _0x483965[_0x32f1('0x1a')]===_0x32f1('0x1b')&&typeof _0x483965[_0x32f1('0x1c')]===_0x32f1('0x1b');var _0x19f684=_0xdd77c2[_0x32f1('0x1d')];var _0x2d8dfd=_0x4793a7?0x0:_0x483965[_0x32f1('0x1a')];var _0x5d5d06=_0x4793a7?_0xdd77c2['count']:_0x483965[_0x32f1('0x1a')]+_0x483965[_0x32f1('0x1c')];var _0x2bba91;if(_0x5d5d06>=_0x19f684){_0x5d5d06=_0x19f684;_0x2bba91=0xc8;}else{_0x2bba91=0xce;}_0x3db949['status'](_0x2bba91);return _0x3db949['set'](_0x32f1('0x1e'),_0x2d8dfd+'-'+_0x5d5d06+'/'+_0x19f684)[_0x32f1('0x1f')](_0xdd77c2);}return null;};}function patchUpdates(_0x4ab5e0){return function(_0x15071e){try{jsonpatch[_0x32f1('0x20')](_0x15071e,_0x4ab5e0,!![]);}catch(_0x8ca06e){return BPromise[_0x32f1('0x21')](_0x8ca06e);}return _0x15071e[_0x32f1('0x22')]();};}function saveUpdates(_0x44f614,_0x512ced){return function(_0x15e759){if(_0x15e759){return _0x15e759[_0x32f1('0x23')](_0x44f614)['then'](function(_0x45a7c2){return _0x45a7c2;});}return null;};}function removeEntity(_0x9a9cbd,_0x1372a2){return function(_0x3928da){if(_0x3928da){return _0x3928da[_0x32f1('0x24')]()[_0x32f1('0x25')](function(){_0x9a9cbd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d082,_0xe76067){return function(_0x9972f2){if(!_0x9972f2){_0x40d082[_0x32f1('0x17')](0x194);}return _0x9972f2;};}function handleError(_0x199b3c,_0x12c891){_0x12c891=_0x12c891||0x1f4;return function(_0x36e801){logger['error'](_0x36e801['stack']);if(_0x36e801[_0x32f1('0x26')]){delete _0x36e801[_0x32f1('0x26')];}_0x199b3c['status'](_0x12c891)[_0x32f1('0x27')](_0x36e801);};}exports[_0x32f1('0x28')]=function(_0x174512,_0x29e2b){var _0x4d0cd0={},_0xd6c1b9={},_0x1f8523={'count':0x0,'rows':[]};var _0x2f0fa0=_[_0x32f1('0x29')](db['VtigerConfiguration']['rawAttributes'],function(_0x4b2209){return{'name':_0x4b2209[_0x32f1('0x2a')],'type':_0x4b2209[_0x32f1('0x2b')][_0x32f1('0x2c')]};});_0xd6c1b9[_0x32f1('0x2d')]=_['map'](_0x2f0fa0,_0x32f1('0x26'));_0xd6c1b9[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x174512[_0x32f1('0x2e')]);_0xd6c1b9[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0xd6c1b9['model'],_0xd6c1b9[_0x32f1('0x2e')]);_0x4d0cd0['attributes']=_[_0x32f1('0x31')](_0xd6c1b9[_0x32f1('0x2d')],qs[_0x32f1('0x32')](_0x174512['query'][_0x32f1('0x32')]));_0x4d0cd0[_0x32f1('0x33')]=_0x4d0cd0[_0x32f1('0x33')]['length']?_0x4d0cd0[_0x32f1('0x33')]:_0xd6c1b9['model'];if(!_0x174512[_0x32f1('0x2e')][_0x32f1('0x34')](_0x32f1('0x35'))){_0x4d0cd0[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x174512[_0x32f1('0x2e')][_0x32f1('0x1c')]);_0x4d0cd0['offset']=qs[_0x32f1('0x1a')](_0x174512[_0x32f1('0x2e')]['offset']);}_0x4d0cd0[_0x32f1('0x36')]=qs[_0x32f1('0x37')](_0x174512['query'][_0x32f1('0x37')]);_0x4d0cd0[_0x32f1('0x38')]=qs[_0x32f1('0x30')](_[_0x32f1('0x39')](_0x174512[_0x32f1('0x2e')],_0xd6c1b9[_0x32f1('0x30')]),_0x2f0fa0);if(_0x174512[_0x32f1('0x2e')][_0x32f1('0x3a')]){_0x4d0cd0[_0x32f1('0x38')]=_[_0x32f1('0x3b')](_0x4d0cd0['where'],{'$or':_[_0x32f1('0x29')](_0x2f0fa0,function(_0x1566a8){if(_0x1566a8[_0x32f1('0x2b')]!==_0x32f1('0x3c')){var _0x563af7={};_0x563af7[_0x1566a8[_0x32f1('0x26')]]={'$like':'%'+_0x174512[_0x32f1('0x2e')][_0x32f1('0x3a')]+'%'};return _0x563af7;}})});}_0x4d0cd0=_[_0x32f1('0x3b')]({},_0x4d0cd0,_0x174512[_0x32f1('0x3d')]);var _0x17172b={'where':_0x4d0cd0[_0x32f1('0x38')]};return db[_0x32f1('0x3e')][_0x32f1('0x1d')](_0x17172b)[_0x32f1('0x25')](function(_0x224602){_0x1f8523['count']=_0x224602;if(_0x174512['query']['includeAll']){_0x4d0cd0[_0x32f1('0x3f')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x32f1('0x40')](_0x4d0cd0);})[_0x32f1('0x25')](function(_0x3d4e0d){_0x1f8523[_0x32f1('0x41')]=_0x3d4e0d;return _0x1f8523;})[_0x32f1('0x25')](respondWithFilteredResult(_0x29e2b,_0x4d0cd0))[_0x32f1('0x42')](handleError(_0x29e2b,null));};exports[_0x32f1('0x43')]=function(_0x27542e,_0x3ab89c){var _0x1795f7={'raw':![],'where':{'id':_0x27542e[_0x32f1('0x44')]['id']}},_0x48a663={};_0x48a663[_0x32f1('0x2d')]=_[_0x32f1('0x2f')](db[_0x32f1('0x3e')][_0x32f1('0x45')]);_0x48a663[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x27542e['query']);_0x48a663[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0x48a663[_0x32f1('0x2d')],_0x48a663[_0x32f1('0x2e')]);_0x1795f7['attributes']=_['intersection'](_0x48a663['model'],qs[_0x32f1('0x32')](_0x27542e[_0x32f1('0x2e')][_0x32f1('0x32')]));_0x1795f7['attributes']=_0x1795f7['attributes'][_0x32f1('0x46')]?_0x1795f7[_0x32f1('0x33')]:_0x48a663['model'];if(_0x27542e[_0x32f1('0x2e')][_0x32f1('0x47')]){_0x1795f7[_0x32f1('0x3f')]=[{'all':!![]}];}_0x1795f7=_[_0x32f1('0x3b')]({},_0x1795f7,_0x27542e[_0x32f1('0x3d')]);return db[_0x32f1('0x3e')]['find'](_0x1795f7)[_0x32f1('0x25')](handleEntityNotFound(_0x3ab89c,null))[_0x32f1('0x25')](respondWithResult(_0x3ab89c,null))['catch'](handleError(_0x3ab89c,null));};exports[_0x32f1('0x48')]=function(_0x5e972e,_0x19729c){return db['VtigerConfiguration']['create'](_0x5e972e[_0x32f1('0x49')],{})[_0x32f1('0x25')](respondWithResult(_0x19729c,0xc9))[_0x32f1('0x42')](handleError(_0x19729c,null));};exports[_0x32f1('0x23')]=function(_0x198caf,_0x247af2){if(_0x198caf['body']['id']){delete _0x198caf[_0x32f1('0x49')]['id'];}return db['VtigerConfiguration'][_0x32f1('0x4a')]({'where':{'id':_0x198caf['params']['id']}})[_0x32f1('0x25')](handleEntityNotFound(_0x247af2,null))[_0x32f1('0x25')](saveUpdates(_0x198caf[_0x32f1('0x49')],null))['then'](respondWithResult(_0x247af2,null))['catch'](handleError(_0x247af2,null));};exports[_0x32f1('0x24')]=function(_0xe6c977,_0x12c2ad){return db['VtigerConfiguration'][_0x32f1('0x4a')]({'where':{'id':_0xe6c977[_0x32f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x12c2ad,null))[_0x32f1('0x25')](removeEntity(_0x12c2ad,null))['catch'](handleError(_0x12c2ad,null));};exports[_0x32f1('0x4b')]=function(_0x3c9423,_0x583f01,_0x4884e2){var _0x24ef38={};var _0x326d22={};var _0x4daade;var _0x47783f;return db[_0x32f1('0x3e')][_0x32f1('0x4c')]({'where':{'id':_0x3c9423[_0x32f1('0x44')]['id']}})[_0x32f1('0x25')](handleEntityNotFound(_0x583f01,null))['then'](function(_0x414cba){if(_0x414cba){_0x4daade=_0x414cba;_0x326d22[_0x32f1('0x2d')]=_[_0x32f1('0x2f')](db[_0x32f1('0x4d')]['rawAttributes']);_0x326d22[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x3c9423[_0x32f1('0x2e')]);_0x326d22[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0x326d22[_0x32f1('0x2d')],_0x326d22[_0x32f1('0x2e')]);_0x24ef38[_0x32f1('0x33')]=_['intersection'](_0x326d22[_0x32f1('0x2d')],qs[_0x32f1('0x32')](_0x3c9423['query'][_0x32f1('0x32')]));_0x24ef38[_0x32f1('0x33')]=_0x24ef38[_0x32f1('0x33')][_0x32f1('0x46')]?_0x24ef38[_0x32f1('0x33')]:_0x326d22[_0x32f1('0x2d')];_0x24ef38[_0x32f1('0x36')]=qs['sort'](_0x3c9423[_0x32f1('0x2e')][_0x32f1('0x37')]);_0x24ef38[_0x32f1('0x38')]=qs[_0x32f1('0x30')](_[_0x32f1('0x39')](_0x3c9423[_0x32f1('0x2e')],_0x326d22[_0x32f1('0x30')]));if(_0x3c9423['query'][_0x32f1('0x3a')]){_0x24ef38[_0x32f1('0x38')]=_['merge'](_0x24ef38[_0x32f1('0x38')],{'$or':_[_0x32f1('0x29')](_0x24ef38[_0x32f1('0x33')],function(_0x3ed30f){var _0x140989={};_0x140989[_0x3ed30f]={'$like':'%'+_0x3c9423[_0x32f1('0x2e')]['filter']+'%'};return _0x140989;})});}_0x24ef38=_[_0x32f1('0x3b')]({},_0x24ef38,_0x3c9423[_0x32f1('0x3d')]);return _0x4daade['getFields'](_0x24ef38);}})['then'](function(_0xfde0bf){if(_0xfde0bf){_0x47783f=_0xfde0bf[_0x32f1('0x46')];if(!_0x3c9423[_0x32f1('0x2e')]['hasOwnProperty'](_0x32f1('0x35'))){_0x24ef38[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x3c9423['query'][_0x32f1('0x1c')]);_0x24ef38[_0x32f1('0x1a')]=qs['offset'](_0x3c9423[_0x32f1('0x2e')]['offset']);}return _0x4daade[_0x32f1('0x4b')](_0x24ef38);}})[_0x32f1('0x25')](function(_0x51a563){if(_0x51a563){return _0x51a563?{'count':_0x47783f,'rows':_0x51a563}:null;}})[_0x32f1('0x25')](respondWithResult(_0x583f01,null))[_0x32f1('0x42')](handleError(_0x583f01,null));};exports[_0x32f1('0x4e')]=function(_0x546b4e,_0x91da2f,_0x1ae1fc){var _0x7407fb={};var _0x34726a={};var _0x428811;var _0x3aa44f;return db['VtigerConfiguration'][_0x32f1('0x4c')]({'where':{'id':_0x546b4e['params']['id']}})['then'](handleEntityNotFound(_0x91da2f,null))[_0x32f1('0x25')](function(_0x386b3c){if(_0x386b3c){_0x428811=_0x386b3c;_0x34726a[_0x32f1('0x2d')]=_['keys'](db['VtigerField'][_0x32f1('0x45')]);_0x34726a['query']=_[_0x32f1('0x2f')](_0x546b4e[_0x32f1('0x2e')]);_0x34726a[_0x32f1('0x30')]=_['intersection'](_0x34726a[_0x32f1('0x2d')],_0x34726a[_0x32f1('0x2e')]);_0x7407fb['attributes']=_[_0x32f1('0x31')](_0x34726a['model'],qs['fields'](_0x546b4e[_0x32f1('0x2e')][_0x32f1('0x32')]));_0x7407fb[_0x32f1('0x33')]=_0x7407fb['attributes'][_0x32f1('0x46')]?_0x7407fb[_0x32f1('0x33')]:_0x34726a[_0x32f1('0x2d')];_0x7407fb['order']=qs['sort'](_0x546b4e['query']['sort']);_0x7407fb[_0x32f1('0x38')]=qs['filters'](_[_0x32f1('0x39')](_0x546b4e[_0x32f1('0x2e')],_0x34726a['filters']));if(_0x546b4e[_0x32f1('0x2e')]['filter']){_0x7407fb['where']=_['merge'](_0x7407fb[_0x32f1('0x38')],{'$or':_[_0x32f1('0x29')](_0x7407fb[_0x32f1('0x33')],function(_0x24e8d2){var _0x462f78={};_0x462f78[_0x24e8d2]={'$like':'%'+_0x546b4e['query'][_0x32f1('0x3a')]+'%'};return _0x462f78;})});}_0x7407fb=_['merge']({},_0x7407fb,_0x546b4e[_0x32f1('0x3d')]);return _0x428811[_0x32f1('0x4e')](_0x7407fb);}})[_0x32f1('0x25')](function(_0x2acd39){if(_0x2acd39){_0x3aa44f=_0x2acd39[_0x32f1('0x46')];if(!_0x546b4e[_0x32f1('0x2e')][_0x32f1('0x34')]('nolimit')){_0x7407fb[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x546b4e['query'][_0x32f1('0x1c')]);_0x7407fb[_0x32f1('0x1a')]=qs[_0x32f1('0x1a')](_0x546b4e[_0x32f1('0x2e')][_0x32f1('0x1a')]);}return _0x428811[_0x32f1('0x4e')](_0x7407fb);}})[_0x32f1('0x25')](function(_0x262679){if(_0x262679){return _0x262679?{'count':_0x3aa44f,'rows':_0x262679}:null;}})[_0x32f1('0x25')](respondWithResult(_0x91da2f,null))['catch'](handleError(_0x91da2f,null));};exports[_0x32f1('0x4f')]=function(_0x370ce6,_0x246eec,_0x21a2bb){var _0x5bdb9d={};var _0x4ba976={};var _0x10f756;var _0x599068;return db[_0x32f1('0x3e')][_0x32f1('0x4c')]({'where':{'id':_0x370ce6[_0x32f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x246eec,null))['then'](function(_0xcae93a){if(_0xcae93a){_0x10f756=_0xcae93a;_0x4ba976[_0x32f1('0x2d')]=_['keys'](db['VtigerField'][_0x32f1('0x45')]);_0x4ba976[_0x32f1('0x2e')]=_[_0x32f1('0x2f')](_0x370ce6[_0x32f1('0x2e')]);_0x4ba976[_0x32f1('0x30')]=_[_0x32f1('0x31')](_0x4ba976[_0x32f1('0x2d')],_0x4ba976[_0x32f1('0x2e')]);_0x5bdb9d[_0x32f1('0x33')]=_[_0x32f1('0x31')](_0x4ba976['model'],qs[_0x32f1('0x32')](_0x370ce6[_0x32f1('0x2e')]['fields']));_0x5bdb9d['attributes']=_0x5bdb9d[_0x32f1('0x33')][_0x32f1('0x46')]?_0x5bdb9d[_0x32f1('0x33')]:_0x4ba976['model'];_0x5bdb9d[_0x32f1('0x36')]=qs['sort'](_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x37')]);_0x5bdb9d['where']=qs[_0x32f1('0x30')](_[_0x32f1('0x39')](_0x370ce6[_0x32f1('0x2e')],_0x4ba976[_0x32f1('0x30')]));if(_0x370ce6['query'][_0x32f1('0x3a')]){_0x5bdb9d[_0x32f1('0x38')]=_[_0x32f1('0x3b')](_0x5bdb9d['where'],{'$or':_[_0x32f1('0x29')](_0x5bdb9d[_0x32f1('0x33')],function(_0x57c2ef){var _0x2fcd18={};_0x2fcd18[_0x57c2ef]={'$like':'%'+_0x370ce6['query']['filter']+'%'};return _0x2fcd18;})});}_0x5bdb9d=_[_0x32f1('0x3b')]({},_0x5bdb9d,_0x370ce6['options']);return _0x10f756[_0x32f1('0x4f')](_0x5bdb9d);}})['then'](function(_0x259bd2){if(_0x259bd2){_0x599068=_0x259bd2[_0x32f1('0x46')];if(!_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x34')](_0x32f1('0x35'))){_0x5bdb9d[_0x32f1('0x1c')]=qs[_0x32f1('0x1c')](_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x1c')]);_0x5bdb9d['offset']=qs[_0x32f1('0x1a')](_0x370ce6[_0x32f1('0x2e')][_0x32f1('0x1a')]);}return _0x10f756[_0x32f1('0x4f')](_0x5bdb9d);}})[_0x32f1('0x25')](function(_0x2fa159){if(_0x2fa159){return _0x2fa159?{'count':_0x599068,'rows':_0x2fa159}:null;}})[_0x32f1('0x25')](respondWithResult(_0x246eec,null))['catch'](handleError(_0x246eec,null));};
\ No newline at end of file
+var _0x5340=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','include','VtigerConfiguration','findAll','rows','catch','params','length','find','create','body','getFields','findOne','order','nolimit','getSubjects','VtigerField','rawAttributes','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x5340,0x1cc));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0534('0x0'));var rimraf=require(_0x0534('0x1'));var zipdir=require(_0x0534('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0534('0x3'));var moment=require(_0x0534('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0534('0x5'));var util=require(_0x0534('0x6'));var path=require(_0x0534('0x7'));var sox=require('sox');var csv=require(_0x0534('0x8'));var ejs=require(_0x0534('0x9'));var fs=require('fs');var fs_extra=require(_0x0534('0xa'));var _=require(_0x0534('0xb'));var squel=require(_0x0534('0xc'));var crypto=require(_0x0534('0xd'));var jsforce=require(_0x0534('0xe'));var deskjs=require(_0x0534('0xf'));var toCsv=require(_0x0534('0x8'));var querystring=require(_0x0534('0x10'));var Papa=require(_0x0534('0x11'));var Redis=require(_0x0534('0x12'));var authService=require(_0x0534('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0534('0x14'));var logger=require(_0x0534('0x15'))(_0x0534('0x16'));var utils=require(_0x0534('0x17'));var config=require(_0x0534('0x18'));var licenseUtil=require(_0x0534('0x19'));var db=require(_0x0534('0x1a'))['db'];function respondWithStatusCode(_0x45558d,_0x4fa902){_0x4fa902=_0x4fa902||0xcc;return function(_0x2e929d){if(_0x2e929d){return _0x45558d[_0x0534('0x1b')](_0x4fa902);}return _0x45558d[_0x0534('0x1c')](_0x4fa902)[_0x0534('0x1d')]();};}function respondWithResult(_0xe3060,_0x188c20){_0x188c20=_0x188c20||0xc8;return function(_0x13219c){if(_0x13219c){return _0xe3060['status'](_0x188c20)[_0x0534('0x1e')](_0x13219c);}};}function respondWithFilteredResult(_0x583acd,_0xdfe344){return function(_0x5729ff){if(_0x5729ff){var _0x2863ef=typeof _0xdfe344[_0x0534('0x1f')]===_0x0534('0x20')&&typeof _0xdfe344[_0x0534('0x21')]==='undefined';var _0x304cc6=_0x5729ff[_0x0534('0x22')];var _0x48252a=_0x2863ef?0x0:_0xdfe344[_0x0534('0x1f')];var _0x59dc9b=_0x2863ef?_0x5729ff[_0x0534('0x22')]:_0xdfe344[_0x0534('0x1f')]+_0xdfe344[_0x0534('0x21')];var _0x47e146;if(_0x59dc9b>=_0x304cc6){_0x59dc9b=_0x304cc6;_0x47e146=0xc8;}else{_0x47e146=0xce;}_0x583acd[_0x0534('0x1c')](_0x47e146);return _0x583acd['set'](_0x0534('0x23'),_0x48252a+'-'+_0x59dc9b+'/'+_0x304cc6)['json'](_0x5729ff);}return null;};}function patchUpdates(_0x234883){return function(_0x52bedd){try{jsonpatch[_0x0534('0x24')](_0x52bedd,_0x234883,!![]);}catch(_0x214038){return BPromise[_0x0534('0x25')](_0x214038);}return _0x52bedd[_0x0534('0x26')]();};}function saveUpdates(_0x1fba58,_0x4ba0e1){return function(_0x3c48c8){if(_0x3c48c8){return _0x3c48c8[_0x0534('0x27')](_0x1fba58)[_0x0534('0x28')](function(_0x5a829c){return _0x5a829c;});}return null;};}function removeEntity(_0x4d875a,_0x499686){return function(_0x4879f6){if(_0x4879f6){return _0x4879f6[_0x0534('0x29')]()['then'](function(){_0x4d875a[_0x0534('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ef2fa,_0x59d749){return function(_0x57cf13){if(!_0x57cf13){_0x4ef2fa['sendStatus'](0x194);}return _0x57cf13;};}function handleError(_0xe0348e,_0x4cb8f0){_0x4cb8f0=_0x4cb8f0||0x1f4;return function(_0x345c3a){logger[_0x0534('0x2a')](_0x345c3a[_0x0534('0x2b')]);if(_0x345c3a[_0x0534('0x2c')]){delete _0x345c3a[_0x0534('0x2c')];}_0xe0348e[_0x0534('0x1c')](_0x4cb8f0)[_0x0534('0x2d')](_0x345c3a);};}exports[_0x0534('0x2e')]=function(_0x599b32,_0x4d2202){var _0x40efc2={},_0x1c7d4a={},_0x3d0c9e={'count':0x0,'rows':[]};var _0x5917d6=_[_0x0534('0x2f')](db['VtigerConfiguration']['rawAttributes'],function(_0x3b5a98){return{'name':_0x3b5a98[_0x0534('0x30')],'type':_0x3b5a98[_0x0534('0x31')][_0x0534('0x32')]};});_0x1c7d4a[_0x0534('0x33')]=_[_0x0534('0x2f')](_0x5917d6,_0x0534('0x2c'));_0x1c7d4a[_0x0534('0x34')]=_[_0x0534('0x35')](_0x599b32[_0x0534('0x34')]);_0x1c7d4a[_0x0534('0x36')]=_[_0x0534('0x37')](_0x1c7d4a['model'],_0x1c7d4a[_0x0534('0x34')]);_0x40efc2['attributes']=_['intersection'](_0x1c7d4a[_0x0534('0x33')],qs[_0x0534('0x38')](_0x599b32[_0x0534('0x34')][_0x0534('0x38')]));_0x40efc2['attributes']=_0x40efc2[_0x0534('0x39')]['length']?_0x40efc2[_0x0534('0x39')]:_0x1c7d4a[_0x0534('0x33')];if(!_0x599b32['query'][_0x0534('0x3a')]('nolimit')){_0x40efc2['limit']=qs['limit'](_0x599b32[_0x0534('0x34')]['limit']);_0x40efc2[_0x0534('0x1f')]=qs['offset'](_0x599b32['query']['offset']);}_0x40efc2['order']=qs[_0x0534('0x3b')](_0x599b32[_0x0534('0x34')][_0x0534('0x3b')]);_0x40efc2[_0x0534('0x3c')]=qs[_0x0534('0x36')](_[_0x0534('0x3d')](_0x599b32['query'],_0x1c7d4a[_0x0534('0x36')]),_0x5917d6);if(_0x599b32[_0x0534('0x34')]['filter']){_0x40efc2[_0x0534('0x3c')]=_['merge'](_0x40efc2[_0x0534('0x3c')],{'$or':_['map'](_0x5917d6,function(_0x318083){if(_0x318083['type']!==_0x0534('0x3e')){var _0x878806={};_0x878806[_0x318083[_0x0534('0x2c')]]={'$like':'%'+_0x599b32[_0x0534('0x34')][_0x0534('0x3f')]+'%'};return _0x878806;}})});}_0x40efc2=_[_0x0534('0x40')]({},_0x40efc2,_0x599b32[_0x0534('0x41')]);var _0xcdb211={'where':_0x40efc2[_0x0534('0x3c')]};return db['VtigerConfiguration'][_0x0534('0x22')](_0xcdb211)[_0x0534('0x28')](function(_0x346b35){_0x3d0c9e[_0x0534('0x22')]=_0x346b35;if(_0x599b32['query']['includeAll']){_0x40efc2[_0x0534('0x42')]=[{'all':!![]}];}return db[_0x0534('0x43')][_0x0534('0x44')](_0x40efc2);})[_0x0534('0x28')](function(_0x2cb03c){_0x3d0c9e[_0x0534('0x45')]=_0x2cb03c;return _0x3d0c9e;})[_0x0534('0x28')](respondWithFilteredResult(_0x4d2202,_0x40efc2))[_0x0534('0x46')](handleError(_0x4d2202,null));};exports['show']=function(_0x5236bf,_0xd7077d){var _0x1dae99={'raw':![],'where':{'id':_0x5236bf[_0x0534('0x47')]['id']}},_0x455cea={};_0x455cea['model']=_[_0x0534('0x35')](db[_0x0534('0x43')]['rawAttributes']);_0x455cea[_0x0534('0x34')]=_[_0x0534('0x35')](_0x5236bf[_0x0534('0x34')]);_0x455cea[_0x0534('0x36')]=_[_0x0534('0x37')](_0x455cea['model'],_0x455cea[_0x0534('0x34')]);_0x1dae99[_0x0534('0x39')]=_[_0x0534('0x37')](_0x455cea[_0x0534('0x33')],qs[_0x0534('0x38')](_0x5236bf[_0x0534('0x34')][_0x0534('0x38')]));_0x1dae99[_0x0534('0x39')]=_0x1dae99[_0x0534('0x39')][_0x0534('0x48')]?_0x1dae99[_0x0534('0x39')]:_0x455cea[_0x0534('0x33')];if(_0x5236bf[_0x0534('0x34')]['includeAll']){_0x1dae99['include']=[{'all':!![]}];}_0x1dae99=_[_0x0534('0x40')]({},_0x1dae99,_0x5236bf[_0x0534('0x41')]);return db['VtigerConfiguration'][_0x0534('0x49')](_0x1dae99)['then'](handleEntityNotFound(_0xd7077d,null))[_0x0534('0x28')](respondWithResult(_0xd7077d,null))[_0x0534('0x46')](handleError(_0xd7077d,null));};exports[_0x0534('0x4a')]=function(_0xb74dd9,_0xc41061){return db[_0x0534('0x43')][_0x0534('0x4a')](_0xb74dd9['body'],{})[_0x0534('0x28')](respondWithResult(_0xc41061,0xc9))[_0x0534('0x46')](handleError(_0xc41061,null));};exports[_0x0534('0x27')]=function(_0x169062,_0x3a30f8){if(_0x169062['body']['id']){delete _0x169062['body']['id'];}return db[_0x0534('0x43')][_0x0534('0x49')]({'where':{'id':_0x169062['params']['id']}})[_0x0534('0x28')](handleEntityNotFound(_0x3a30f8,null))['then'](saveUpdates(_0x169062[_0x0534('0x4b')],null))[_0x0534('0x28')](respondWithResult(_0x3a30f8,null))[_0x0534('0x46')](handleError(_0x3a30f8,null));};exports[_0x0534('0x29')]=function(_0x4b6ca3,_0x5bad34){return db[_0x0534('0x43')][_0x0534('0x49')]({'where':{'id':_0x4b6ca3[_0x0534('0x47')]['id']}})['then'](handleEntityNotFound(_0x5bad34,null))['then'](removeEntity(_0x5bad34,null))[_0x0534('0x46')](handleError(_0x5bad34,null));};exports[_0x0534('0x4c')]=function(_0x2489f6,_0x29177d,_0x3074ae){var _0x529b1b={};var _0x57eea3={};var _0x36fa43;var _0x447bb7;return db[_0x0534('0x43')][_0x0534('0x4d')]({'where':{'id':_0x2489f6[_0x0534('0x47')]['id']}})[_0x0534('0x28')](handleEntityNotFound(_0x29177d,null))[_0x0534('0x28')](function(_0x46346f){if(_0x46346f){_0x36fa43=_0x46346f;_0x57eea3[_0x0534('0x33')]=_[_0x0534('0x35')](db['VtigerField']['rawAttributes']);_0x57eea3[_0x0534('0x34')]=_[_0x0534('0x35')](_0x2489f6[_0x0534('0x34')]);_0x57eea3[_0x0534('0x36')]=_['intersection'](_0x57eea3[_0x0534('0x33')],_0x57eea3[_0x0534('0x34')]);_0x529b1b['attributes']=_[_0x0534('0x37')](_0x57eea3[_0x0534('0x33')],qs[_0x0534('0x38')](_0x2489f6['query'][_0x0534('0x38')]));_0x529b1b[_0x0534('0x39')]=_0x529b1b[_0x0534('0x39')]['length']?_0x529b1b[_0x0534('0x39')]:_0x57eea3[_0x0534('0x33')];_0x529b1b[_0x0534('0x4e')]=qs[_0x0534('0x3b')](_0x2489f6['query'][_0x0534('0x3b')]);_0x529b1b[_0x0534('0x3c')]=qs['filters'](_[_0x0534('0x3d')](_0x2489f6['query'],_0x57eea3[_0x0534('0x36')]));if(_0x2489f6['query'][_0x0534('0x3f')]){_0x529b1b[_0x0534('0x3c')]=_['merge'](_0x529b1b['where'],{'$or':_[_0x0534('0x2f')](_0x529b1b[_0x0534('0x39')],function(_0x18277d){var _0x345af1={};_0x345af1[_0x18277d]={'$like':'%'+_0x2489f6[_0x0534('0x34')][_0x0534('0x3f')]+'%'};return _0x345af1;})});}_0x529b1b=_[_0x0534('0x40')]({},_0x529b1b,_0x2489f6[_0x0534('0x41')]);return _0x36fa43[_0x0534('0x4c')](_0x529b1b);}})['then'](function(_0x2fc720){if(_0x2fc720){_0x447bb7=_0x2fc720[_0x0534('0x48')];if(!_0x2489f6[_0x0534('0x34')][_0x0534('0x3a')](_0x0534('0x4f'))){_0x529b1b['limit']=qs[_0x0534('0x21')](_0x2489f6[_0x0534('0x34')][_0x0534('0x21')]);_0x529b1b['offset']=qs[_0x0534('0x1f')](_0x2489f6[_0x0534('0x34')][_0x0534('0x1f')]);}return _0x36fa43[_0x0534('0x4c')](_0x529b1b);}})[_0x0534('0x28')](function(_0x49beac){if(_0x49beac){return _0x49beac?{'count':_0x447bb7,'rows':_0x49beac}:null;}})[_0x0534('0x28')](respondWithResult(_0x29177d,null))[_0x0534('0x46')](handleError(_0x29177d,null));};exports[_0x0534('0x50')]=function(_0x1bc8b9,_0x7de585,_0x149f0a){var _0xdddf7e={};var _0x164b00={};var _0x57f7e7;var _0x2c0024;return db[_0x0534('0x43')][_0x0534('0x4d')]({'where':{'id':_0x1bc8b9['params']['id']}})[_0x0534('0x28')](handleEntityNotFound(_0x7de585,null))[_0x0534('0x28')](function(_0x24ef26){if(_0x24ef26){_0x57f7e7=_0x24ef26;_0x164b00[_0x0534('0x33')]=_[_0x0534('0x35')](db[_0x0534('0x51')][_0x0534('0x52')]);_0x164b00['query']=_[_0x0534('0x35')](_0x1bc8b9['query']);_0x164b00[_0x0534('0x36')]=_['intersection'](_0x164b00[_0x0534('0x33')],_0x164b00['query']);_0xdddf7e[_0x0534('0x39')]=_[_0x0534('0x37')](_0x164b00[_0x0534('0x33')],qs[_0x0534('0x38')](_0x1bc8b9[_0x0534('0x34')][_0x0534('0x38')]));_0xdddf7e[_0x0534('0x39')]=_0xdddf7e[_0x0534('0x39')][_0x0534('0x48')]?_0xdddf7e[_0x0534('0x39')]:_0x164b00[_0x0534('0x33')];_0xdddf7e[_0x0534('0x4e')]=qs[_0x0534('0x3b')](_0x1bc8b9[_0x0534('0x34')]['sort']);_0xdddf7e[_0x0534('0x3c')]=qs[_0x0534('0x36')](_[_0x0534('0x3d')](_0x1bc8b9['query'],_0x164b00['filters']));if(_0x1bc8b9['query'][_0x0534('0x3f')]){_0xdddf7e['where']=_[_0x0534('0x40')](_0xdddf7e[_0x0534('0x3c')],{'$or':_[_0x0534('0x2f')](_0xdddf7e[_0x0534('0x39')],function(_0x5560a5){var _0x27aa30={};_0x27aa30[_0x5560a5]={'$like':'%'+_0x1bc8b9['query']['filter']+'%'};return _0x27aa30;})});}_0xdddf7e=_[_0x0534('0x40')]({},_0xdddf7e,_0x1bc8b9[_0x0534('0x41')]);return _0x57f7e7[_0x0534('0x50')](_0xdddf7e);}})[_0x0534('0x28')](function(_0x464944){if(_0x464944){_0x2c0024=_0x464944[_0x0534('0x48')];if(!_0x1bc8b9[_0x0534('0x34')]['hasOwnProperty'](_0x0534('0x4f'))){_0xdddf7e[_0x0534('0x21')]=qs[_0x0534('0x21')](_0x1bc8b9['query'][_0x0534('0x21')]);_0xdddf7e[_0x0534('0x1f')]=qs[_0x0534('0x1f')](_0x1bc8b9[_0x0534('0x34')]['offset']);}return _0x57f7e7['getSubjects'](_0xdddf7e);}})[_0x0534('0x28')](function(_0x4c9bc3){if(_0x4c9bc3){return _0x4c9bc3?{'count':_0x2c0024,'rows':_0x4c9bc3}:null;}})['then'](respondWithResult(_0x7de585,null))[_0x0534('0x46')](handleError(_0x7de585,null));};exports[_0x0534('0x53')]=function(_0x23c170,_0x2418ad,_0x3b883f){var _0x3dda55={};var _0x26ab97={};var _0x596e50;var _0x303eea;return db[_0x0534('0x43')][_0x0534('0x4d')]({'where':{'id':_0x23c170[_0x0534('0x47')]['id']}})[_0x0534('0x28')](handleEntityNotFound(_0x2418ad,null))[_0x0534('0x28')](function(_0x56da6c){if(_0x56da6c){_0x596e50=_0x56da6c;_0x26ab97['model']=_[_0x0534('0x35')](db[_0x0534('0x51')][_0x0534('0x52')]);_0x26ab97['query']=_[_0x0534('0x35')](_0x23c170[_0x0534('0x34')]);_0x26ab97[_0x0534('0x36')]=_[_0x0534('0x37')](_0x26ab97[_0x0534('0x33')],_0x26ab97[_0x0534('0x34')]);_0x3dda55[_0x0534('0x39')]=_[_0x0534('0x37')](_0x26ab97[_0x0534('0x33')],qs[_0x0534('0x38')](_0x23c170[_0x0534('0x34')][_0x0534('0x38')]));_0x3dda55['attributes']=_0x3dda55['attributes'][_0x0534('0x48')]?_0x3dda55[_0x0534('0x39')]:_0x26ab97[_0x0534('0x33')];_0x3dda55[_0x0534('0x4e')]=qs[_0x0534('0x3b')](_0x23c170['query']['sort']);_0x3dda55[_0x0534('0x3c')]=qs[_0x0534('0x36')](_[_0x0534('0x3d')](_0x23c170[_0x0534('0x34')],_0x26ab97[_0x0534('0x36')]));if(_0x23c170[_0x0534('0x34')][_0x0534('0x3f')]){_0x3dda55[_0x0534('0x3c')]=_['merge'](_0x3dda55[_0x0534('0x3c')],{'$or':_['map'](_0x3dda55[_0x0534('0x39')],function(_0x2968e6){var _0x280f1c={};_0x280f1c[_0x2968e6]={'$like':'%'+_0x23c170[_0x0534('0x34')][_0x0534('0x3f')]+'%'};return _0x280f1c;})});}_0x3dda55=_[_0x0534('0x40')]({},_0x3dda55,_0x23c170[_0x0534('0x41')]);return _0x596e50[_0x0534('0x53')](_0x3dda55);}})['then'](function(_0x15fcc4){if(_0x15fcc4){_0x303eea=_0x15fcc4[_0x0534('0x48')];if(!_0x23c170[_0x0534('0x34')][_0x0534('0x3a')](_0x0534('0x4f'))){_0x3dda55[_0x0534('0x21')]=qs[_0x0534('0x21')](_0x23c170['query'][_0x0534('0x21')]);_0x3dda55[_0x0534('0x1f')]=qs[_0x0534('0x1f')](_0x23c170[_0x0534('0x34')]['offset']);}return _0x596e50[_0x0534('0x53')](_0x3dda55);}})['then'](function(_0x50fceb){if(_0x50fceb){return _0x50fceb?{'count':_0x303eea,'rows':_0x50fceb}:null;}})[_0x0534('0x28')](respondWithResult(_0x2418ad,null))[_0x0534('0x46')](handleError(_0x2418ad,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa2d5=['bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','../../config/logger','api'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xa2d5,0x1b7));var _0x5a2d=function(_0x211636,_0x21acd2){_0x211636=_0x211636-0x0;var _0x5c3247=_0xa2d5[_0x211636];return _0x5c3247;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a2d('0x0'))(_0x5a2d('0x1'));var moment=require('moment');var BPromise=require(_0x5a2d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5a2d('0x3'));var config=require(_0x5a2d('0x4'));var attributes=require(_0x5a2d('0x5'));module[_0x5a2d('0x6')]=function(_0x3533de,_0x1a7b42){return _0x3533de[_0x5a2d('0x7')](_0x5a2d('0x8'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa65c=['lodash','util','api','moment','bluebird','exports','define','VtigerConfiguration'];(function(_0x5c50c2,_0x1eb791){var _0x582ed6=function(_0x5e64d9){while(--_0x5e64d9){_0x5c50c2['push'](_0x5c50c2['shift']());}};_0x582ed6(++_0x1eb791);}(_0xa65c,0x1e8));var _0xca65=function(_0x1dcba5,_0x5e9ad0){_0x1dcba5=_0x1dcba5-0x0;var _0x24f82a=_0xa65c[_0x1dcba5];return _0x24f82a;};'use strict';var _=require(_0xca65('0x0'));var util=require(_0xca65('0x1'));var logger=require('../../config/logger')(_0xca65('0x2'));var moment=require(_0xca65('0x3'));var BPromise=require(_0xca65('0x4'));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('./intVtigerConfiguration.attributes');module[_0xca65('0x5')]=function(_0x376017,_0x77e86a){return _0x376017[_0xca65('0x6')](_0xca65('0x7'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2db4=['error','code','message','VtigerConfiguration,\x20%s,\x20%s','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x3655b8,_0x15eb94){var _0x359944=function(_0x2dde59){while(--_0x2dde59){_0x3655b8['push'](_0x3655b8['shift']());}};_0x359944(++_0x15eb94);}(_0x2db4,0x1a6));var _0x42db=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2db4[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x42db('0x0'));var util=require(_0x42db('0x1'));var moment=require('moment');var BPromise=require(_0x42db('0x2'));var rs=require(_0x42db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42db('0x4'))['db'];var utils=require(_0x42db('0x5'));var logger=require(_0x42db('0x6'))(_0x42db('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ab1e0,_0x5d00ef,_0xfbc177){return new BPromise(function(_0x3cfd6f,_0x4b54a2){return client[_0x42db('0x9')](_0x2ab1e0,_0xfbc177)[_0x42db('0xa')](function(_0x235e44){logger[_0x42db('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x5d00ef,_0x42db('0xc'));logger[_0x42db('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5d00ef,_0x42db('0xc'),JSON[_0x42db('0xe')](_0x235e44));if(_0x235e44[_0x42db('0xf')]){if(_0x235e44[_0x42db('0xf')][_0x42db('0x10')]===0x1f4){logger[_0x42db('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x5d00ef,_0x235e44[_0x42db('0xf')]['message']);return _0x4b54a2(_0x235e44[_0x42db('0xf')]['message']);}logger[_0x42db('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x5d00ef,_0x235e44[_0x42db('0xf')][_0x42db('0x11')]);return _0x3cfd6f(_0x235e44[_0x42db('0xf')][_0x42db('0x11')]);}else{logger[_0x42db('0xb')](_0x42db('0x12'),_0x5d00ef,'request\x20sent');_0x3cfd6f(_0x235e44['result'][_0x42db('0x11')]);}})['catch'](function(_0x46fa92){logger[_0x42db('0xf')](_0x42db('0x12'),_0x5d00ef,_0x46fa92);_0x4b54a2(_0x46fa92);});});}
\ No newline at end of file
+var _0x31b1=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x31b1,0x1ea));var _0x131b=function(_0x4efe67,_0x1e94f0){_0x4efe67=_0x4efe67-0x0;var _0x3984c6=_0x31b1[_0x4efe67];return _0x3984c6;};'use strict';var _=require(_0x131b('0x0'));var util=require('util');var moment=require(_0x131b('0x1'));var BPromise=require('bluebird');var rs=require(_0x131b('0x2'));var fs=require('fs');var Redis=require(_0x131b('0x3'));var db=require(_0x131b('0x4'))['db'];var utils=require(_0x131b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x131b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x131b('0x7')][_0x131b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e35eb,_0x3a35f0,_0x35debb){return new BPromise(function(_0x418fb0,_0xaf1e17){return client[_0x131b('0x9')](_0x2e35eb,_0x35debb)['then'](function(_0x30d1d3){logger[_0x131b('0xa')](_0x131b('0xb'),_0x3a35f0,'request\x20sent');logger[_0x131b('0xc')](_0x131b('0xd'),_0x3a35f0,_0x131b('0xe'),JSON[_0x131b('0xf')](_0x30d1d3));if(_0x30d1d3[_0x131b('0x10')]){if(_0x30d1d3[_0x131b('0x10')][_0x131b('0x11')]===0x1f4){logger[_0x131b('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x3a35f0,_0x30d1d3[_0x131b('0x10')][_0x131b('0x12')]);return _0xaf1e17(_0x30d1d3['error']['message']);}logger[_0x131b('0x10')](_0x131b('0xb'),_0x3a35f0,_0x30d1d3[_0x131b('0x10')]['message']);return _0x418fb0(_0x30d1d3[_0x131b('0x10')][_0x131b('0x12')]);}else{logger[_0x131b('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x3a35f0,_0x131b('0xe'));_0x418fb0(_0x30d1d3[_0x131b('0x13')][_0x131b('0x12')]);}})[_0x131b('0x14')](function(_0x25b97e){logger[_0x131b('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x3a35f0,_0x25b97e);_0xaf1e17(_0x25b97e);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45c6=['create','/:id','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','isAuthenticated','show'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x45c6,0x1a5));var _0x645c=function(_0x29ada9,_0x4c85b7){_0x29ada9=_0x29ada9-0x0;var _0x14bb2a=_0x45c6[_0x29ada9];return _0x14bb2a;};'use strict';var multer=require('multer');var util=require(_0x645c('0x0'));var path=require(_0x645c('0x1'));var timeout=require(_0x645c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x645c('0x3'));var auth=require(_0x645c('0x4'));var interaction=require(_0x645c('0x5'));var config=require(_0x645c('0x6'));var controller=require(_0x645c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x645c('0x8')]);router['get']('/:id',auth[_0x645c('0x9')](),controller[_0x645c('0xa')]);router['post']('/',auth[_0x645c('0x9')](),controller[_0x645c('0xb')]);router['put'](_0x645c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x645c('0xd')](_0x645c('0xc'),auth[_0x645c('0x9')](),controller[_0x645c('0xe')]);module[_0x645c('0xf')]=router;
\ No newline at end of file
+var _0xe69e=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x4496ff,_0x4c450a){var _0x5dffd7=function(_0x2e3c12){while(--_0x2e3c12){_0x4496ff['push'](_0x4496ff['shift']());}};_0x5dffd7(++_0x4c450a);}(_0xe69e,0x72));var _0xee69=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xe69e[_0x39cf70];return _0x580424;};'use strict';var multer=require(_0xee69('0x0'));var util=require(_0xee69('0x1'));var path=require(_0xee69('0x2'));var timeout=require('connect-timeout');var express=require(_0xee69('0x3'));var router=express['Router']();var fs_extra=require(_0xee69('0x4'));var auth=require(_0xee69('0x5'));var interaction=require(_0xee69('0x6'));var config=require(_0xee69('0x7'));var controller=require(_0xee69('0x8'));router['get']('/',auth[_0xee69('0x9')](),controller[_0xee69('0xa')]);router['get'](_0xee69('0xb'),auth[_0xee69('0x9')](),controller['show']);router[_0xee69('0xc')]('/',auth['isAuthenticated'](),controller[_0xee69('0xd')]);router[_0xee69('0xe')](_0xee69('0xb'),auth['isAuthenticated'](),controller[_0xee69('0xf')]);router[_0xee69('0x10')](_0xee69('0xb'),auth[_0xee69('0x9')](),controller[_0xee69('0x11')]);module[_0xee69('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1630=['sequelize','ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x372ece,_0x44b352){var _0x4b9b4b=function(_0x5e7042){while(--_0x5e7042){_0x372ece['push'](_0x372ece['shift']());}};_0x4b9b4b(++_0x44b352);}(_0x1630,0x1b8));var _0x0163=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1630[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x0163('0x0'));module['exports']={'type':{'type':Sequelize[_0x0163('0x1')](_0x0163('0x2'),'variable',_0x0163('0x3'),_0x0163('0x4'),_0x0163('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0163('0x6')]},'key':{'type':Sequelize[_0x0163('0x6')]},'keyType':{'type':Sequelize[_0x0163('0x1')](_0x0163('0x2'),'variable',_0x0163('0x3'))},'keyContent':{'type':Sequelize[_0x0163('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0163('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0163('0x6')]}};
\ No newline at end of file
+var _0x05a4=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x05a4,0x89));var _0x405a=function(_0x536662,_0x29eab3){_0x536662=_0x536662-0x0;var _0x431dc9=_0x05a4[_0x536662];return _0x431dc9;};'use strict';var Sequelize=require(_0x405a('0x0'));module[_0x405a('0x1')]={'type':{'type':Sequelize[_0x405a('0x2')](_0x405a('0x3'),_0x405a('0x4'),_0x405a('0x5'),'keyValue','picklist'),'defaultValue':_0x405a('0x3')},'content':{'type':Sequelize[_0x405a('0x6')]},'key':{'type':Sequelize[_0x405a('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x405a('0x3'),_0x405a('0x4'),_0x405a('0x5'))},'keyContent':{'type':Sequelize[_0x405a('0x6')]},'idField':{'type':Sequelize[_0x405a('0x6')]},'nameField':{'type':Sequelize[_0x405a('0x6')]},'customField':{'type':Sequelize[_0x405a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x405a('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dcc=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x59ccba,_0x1d9424){var _0x1f43cb=function(_0x5daaf9){while(--_0x5daaf9){_0x59ccba['push'](_0x59ccba['shift']());}};_0x1f43cb(++_0x1d9424);}(_0x6dcc,0x89));var _0xc6dc=function(_0x5cdb4a,_0x39e8ee){_0x5cdb4a=_0x5cdb4a-0x0;var _0x3b0044=_0x6dcc[_0x5cdb4a];return _0x3b0044;};'use strict';var emlformat=require(_0xc6dc('0x0'));var rimraf=require(_0xc6dc('0x1'));var zipdir=require(_0xc6dc('0x2'));var jsonpatch=require(_0xc6dc('0x3'));var rp=require(_0xc6dc('0x4'));var moment=require(_0xc6dc('0x5'));var BPromise=require(_0xc6dc('0x6'));var Mustache=require('mustache');var util=require(_0xc6dc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc6dc('0x8'));var ejs=require(_0xc6dc('0x9'));var fs=require('fs');var fs_extra=require(_0xc6dc('0xa'));var _=require('lodash');var squel=require(_0xc6dc('0xb'));var crypto=require(_0xc6dc('0xc'));var jsforce=require(_0xc6dc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc6dc('0x8'));var querystring=require(_0xc6dc('0xe'));var Papa=require('papaparse');var Redis=require(_0xc6dc('0xf'));var authService=require(_0xc6dc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6dc('0x11'));var logger=require(_0xc6dc('0x12'))(_0xc6dc('0x13'));var utils=require(_0xc6dc('0x14'));var config=require(_0xc6dc('0x15'));var licenseUtil=require(_0xc6dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f11e,_0xb28d93){_0xb28d93=_0xb28d93||0xcc;return function(_0xcc7262){if(_0xcc7262){return _0x28f11e[_0xc6dc('0x17')](_0xb28d93);}return _0x28f11e['status'](_0xb28d93)[_0xc6dc('0x18')]();};}function respondWithResult(_0x159d06,_0x486b63){_0x486b63=_0x486b63||0xc8;return function(_0xe044ac){if(_0xe044ac){return _0x159d06[_0xc6dc('0x19')](_0x486b63)[_0xc6dc('0x1a')](_0xe044ac);}};}function respondWithFilteredResult(_0x19ec14,_0x3b2e76){return function(_0x3a8dec){if(_0x3a8dec){var _0x3fd89a=typeof _0x3b2e76[_0xc6dc('0x1b')]===_0xc6dc('0x1c')&&typeof _0x3b2e76['limit']==='undefined';var _0x3bb96c=_0x3a8dec[_0xc6dc('0x1d')];var _0x58a4fd=_0x3fd89a?0x0:_0x3b2e76['offset'];var _0x23966d=_0x3fd89a?_0x3a8dec['count']:_0x3b2e76['offset']+_0x3b2e76[_0xc6dc('0x1e')];var _0x2c6cc0;if(_0x23966d>=_0x3bb96c){_0x23966d=_0x3bb96c;_0x2c6cc0=0xc8;}else{_0x2c6cc0=0xce;}_0x19ec14[_0xc6dc('0x19')](_0x2c6cc0);return _0x19ec14[_0xc6dc('0x1f')](_0xc6dc('0x20'),_0x58a4fd+'-'+_0x23966d+'/'+_0x3bb96c)['json'](_0x3a8dec);}return null;};}function patchUpdates(_0x5e46b3){return function(_0x14b4d){try{jsonpatch[_0xc6dc('0x21')](_0x14b4d,_0x5e46b3,!![]);}catch(_0x51165d){return BPromise[_0xc6dc('0x22')](_0x51165d);}return _0x14b4d[_0xc6dc('0x23')]();};}function saveUpdates(_0x31fa80,_0x4c44a4){return function(_0x5134ed){if(_0x5134ed){return _0x5134ed[_0xc6dc('0x24')](_0x31fa80)[_0xc6dc('0x25')](function(_0x2fa2bd){return _0x2fa2bd;});}return null;};}function removeEntity(_0x495ef4,_0x55db49){return function(_0x4531bb){if(_0x4531bb){return _0x4531bb[_0xc6dc('0x26')]()[_0xc6dc('0x25')](function(){_0x495ef4['status'](0xcc)[_0xc6dc('0x18')]();});}};}function handleEntityNotFound(_0x479acd,_0x3da3f6){return function(_0x13d233){if(!_0x13d233){_0x479acd[_0xc6dc('0x17')](0x194);}return _0x13d233;};}function handleError(_0x326eb5,_0x567f25){_0x567f25=_0x567f25||0x1f4;return function(_0x2ea4b0){logger[_0xc6dc('0x27')](_0x2ea4b0[_0xc6dc('0x28')]);if(_0x2ea4b0[_0xc6dc('0x29')]){delete _0x2ea4b0[_0xc6dc('0x29')];}_0x326eb5[_0xc6dc('0x19')](_0x567f25)[_0xc6dc('0x2a')](_0x2ea4b0);};}exports[_0xc6dc('0x2b')]=function(_0x362bbc,_0x1ae725){var _0x222325={},_0xc657ef={},_0x4a0b1e={'count':0x0,'rows':[]};var _0x5e264d=_['map'](db[_0xc6dc('0x2c')][_0xc6dc('0x2d')],function(_0x37e234){return{'name':_0x37e234[_0xc6dc('0x2e')],'type':_0x37e234[_0xc6dc('0x2f')][_0xc6dc('0x30')]};});_0xc657ef[_0xc6dc('0x31')]=_['map'](_0x5e264d,_0xc6dc('0x29'));_0xc657ef['query']=_[_0xc6dc('0x32')](_0x362bbc[_0xc6dc('0x33')]);_0xc657ef['filters']=_[_0xc6dc('0x34')](_0xc657ef[_0xc6dc('0x31')],_0xc657ef[_0xc6dc('0x33')]);_0x222325['attributes']=_['intersection'](_0xc657ef['model'],qs[_0xc6dc('0x35')](_0x362bbc['query'][_0xc6dc('0x35')]));_0x222325[_0xc6dc('0x36')]=_0x222325[_0xc6dc('0x36')][_0xc6dc('0x37')]?_0x222325[_0xc6dc('0x36')]:_0xc657ef[_0xc6dc('0x31')];if(!_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x38')](_0xc6dc('0x39'))){_0x222325[_0xc6dc('0x1e')]=qs[_0xc6dc('0x1e')](_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x1e')]);_0x222325[_0xc6dc('0x1b')]=qs['offset'](_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x1b')]);}_0x222325[_0xc6dc('0x3a')]=qs[_0xc6dc('0x3b')](_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x3b')]);_0x222325[_0xc6dc('0x3c')]=qs[_0xc6dc('0x3d')](_[_0xc6dc('0x3e')](_0x362bbc[_0xc6dc('0x33')],_0xc657ef['filters']),_0x5e264d);if(_0x362bbc[_0xc6dc('0x33')]['filter']){_0x222325['where']=_[_0xc6dc('0x3f')](_0x222325[_0xc6dc('0x3c')],{'$or':_[_0xc6dc('0x40')](_0x5e264d,function(_0x59d0b1){if(_0x59d0b1[_0xc6dc('0x2f')]!==_0xc6dc('0x41')){var _0x1fa363={};_0x1fa363[_0x59d0b1[_0xc6dc('0x29')]]={'$like':'%'+_0x362bbc[_0xc6dc('0x33')][_0xc6dc('0x42')]+'%'};return _0x1fa363;}})});}_0x222325=_[_0xc6dc('0x3f')]({},_0x222325,_0x362bbc[_0xc6dc('0x43')]);var _0x5b7bd1={'where':_0x222325[_0xc6dc('0x3c')]};return db[_0xc6dc('0x2c')][_0xc6dc('0x1d')](_0x5b7bd1)['then'](function(_0x9effbc){_0x4a0b1e[_0xc6dc('0x1d')]=_0x9effbc;if(_0x362bbc[_0xc6dc('0x33')]['includeAll']){_0x222325[_0xc6dc('0x44')]=[{'all':!![]}];}return db['VtigerField'][_0xc6dc('0x45')](_0x222325);})[_0xc6dc('0x25')](function(_0x3e983b){_0x4a0b1e[_0xc6dc('0x46')]=_0x3e983b;return _0x4a0b1e;})[_0xc6dc('0x25')](respondWithFilteredResult(_0x1ae725,_0x222325))[_0xc6dc('0x47')](handleError(_0x1ae725,null));};exports[_0xc6dc('0x48')]=function(_0x5d8285,_0x46ed7f){var _0x26275a={'raw':!![],'where':{'id':_0x5d8285['params']['id']}},_0x2edb97={};_0x2edb97[_0xc6dc('0x31')]=_[_0xc6dc('0x32')](db[_0xc6dc('0x2c')]['rawAttributes']);_0x2edb97[_0xc6dc('0x33')]=_['keys'](_0x5d8285[_0xc6dc('0x33')]);_0x2edb97[_0xc6dc('0x3d')]=_[_0xc6dc('0x34')](_0x2edb97[_0xc6dc('0x31')],_0x2edb97[_0xc6dc('0x33')]);_0x26275a[_0xc6dc('0x36')]=_[_0xc6dc('0x34')](_0x2edb97[_0xc6dc('0x31')],qs[_0xc6dc('0x35')](_0x5d8285[_0xc6dc('0x33')][_0xc6dc('0x35')]));_0x26275a[_0xc6dc('0x36')]=_0x26275a[_0xc6dc('0x36')][_0xc6dc('0x37')]?_0x26275a[_0xc6dc('0x36')]:_0x2edb97[_0xc6dc('0x31')];if(_0x5d8285[_0xc6dc('0x33')]['includeAll']){_0x26275a['include']=[{'all':!![]}];}_0x26275a=_[_0xc6dc('0x3f')]({},_0x26275a,_0x5d8285[_0xc6dc('0x43')]);return db[_0xc6dc('0x2c')][_0xc6dc('0x49')](_0x26275a)[_0xc6dc('0x25')](handleEntityNotFound(_0x46ed7f,null))[_0xc6dc('0x25')](respondWithResult(_0x46ed7f,null))[_0xc6dc('0x47')](handleError(_0x46ed7f,null));};exports[_0xc6dc('0x4a')]=function(_0x4be64f,_0x3af2a8){return db['VtigerField'][_0xc6dc('0x4a')](_0x4be64f[_0xc6dc('0x4b')],{})[_0xc6dc('0x25')](respondWithResult(_0x3af2a8,0xc9))[_0xc6dc('0x47')](handleError(_0x3af2a8,null));};exports[_0xc6dc('0x24')]=function(_0x4a2d1c,_0x92a14b){if(_0x4a2d1c[_0xc6dc('0x4b')]['id']){delete _0x4a2d1c[_0xc6dc('0x4b')]['id'];}return db['VtigerField'][_0xc6dc('0x49')]({'where':{'id':_0x4a2d1c[_0xc6dc('0x4c')]['id']}})['then'](handleEntityNotFound(_0x92a14b,null))[_0xc6dc('0x25')](saveUpdates(_0x4a2d1c[_0xc6dc('0x4b')],null))[_0xc6dc('0x25')](respondWithResult(_0x92a14b,null))[_0xc6dc('0x47')](handleError(_0x92a14b,null));};exports['destroy']=function(_0x323107,_0x36f959){return db[_0xc6dc('0x2c')][_0xc6dc('0x49')]({'where':{'id':_0x323107['params']['id']}})[_0xc6dc('0x25')](handleEntityNotFound(_0x36f959,null))['then'](removeEntity(_0x36f959,null))[_0xc6dc('0x47')](handleError(_0x36f959,null));};
\ No newline at end of file
+var _0xf2a5=['status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','VtigerField','includeAll','include','findAll','catch','show','params','find','create','body','rimraf','zip-dir','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xf2a5,0xc8));var _0x5f2a=function(_0x587f4f,_0x567fb6){_0x587f4f=_0x587f4f-0x0;var _0x58a5c4=_0xf2a5[_0x587f4f];return _0x58a5c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f2a('0x0'));var zipdir=require(_0x5f2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f2a('0x2'));var util=require(_0x5f2a('0x3'));var path=require(_0x5f2a('0x4'));var sox=require(_0x5f2a('0x5'));var csv=require('to-csv');var ejs=require(_0x5f2a('0x6'));var fs=require('fs');var fs_extra=require(_0x5f2a('0x7'));var _=require('lodash');var squel=require(_0x5f2a('0x8'));var crypto=require(_0x5f2a('0x9'));var jsforce=require(_0x5f2a('0xa'));var deskjs=require(_0x5f2a('0xb'));var toCsv=require(_0x5f2a('0xc'));var querystring=require(_0x5f2a('0xd'));var Papa=require(_0x5f2a('0xe'));var Redis=require(_0x5f2a('0xf'));var authService=require(_0x5f2a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5f2a('0x11'));var hardwareService=require(_0x5f2a('0x12'));var logger=require(_0x5f2a('0x13'))(_0x5f2a('0x14'));var utils=require('../../config/utils');var config=require(_0x5f2a('0x15'));var licenseUtil=require(_0x5f2a('0x16'));var db=require(_0x5f2a('0x17'))['db'];function respondWithStatusCode(_0x3149bb,_0x26d235){_0x26d235=_0x26d235||0xcc;return function(_0x39e637){if(_0x39e637){return _0x3149bb[_0x5f2a('0x18')](_0x26d235);}return _0x3149bb[_0x5f2a('0x19')](_0x26d235)['end']();};}function respondWithResult(_0x5da0c0,_0x254851){_0x254851=_0x254851||0xc8;return function(_0x1e84da){if(_0x1e84da){return _0x5da0c0['status'](_0x254851)['json'](_0x1e84da);}};}function respondWithFilteredResult(_0xaa543f,_0x4c2196){return function(_0x2aacef){if(_0x2aacef){var _0x301e18=typeof _0x4c2196[_0x5f2a('0x1a')]===_0x5f2a('0x1b')&&typeof _0x4c2196[_0x5f2a('0x1c')]===_0x5f2a('0x1b');var _0x2ef3b8=_0x2aacef[_0x5f2a('0x1d')];var _0x29eef5=_0x301e18?0x0:_0x4c2196[_0x5f2a('0x1a')];var _0x2c7858=_0x301e18?_0x2aacef[_0x5f2a('0x1d')]:_0x4c2196[_0x5f2a('0x1a')]+_0x4c2196['limit'];var _0x4b8086;if(_0x2c7858>=_0x2ef3b8){_0x2c7858=_0x2ef3b8;_0x4b8086=0xc8;}else{_0x4b8086=0xce;}_0xaa543f[_0x5f2a('0x19')](_0x4b8086);return _0xaa543f[_0x5f2a('0x1e')](_0x5f2a('0x1f'),_0x29eef5+'-'+_0x2c7858+'/'+_0x2ef3b8)[_0x5f2a('0x20')](_0x2aacef);}return null;};}function patchUpdates(_0x154bfb){return function(_0x1f58fe){try{jsonpatch['apply'](_0x1f58fe,_0x154bfb,!![]);}catch(_0x558a03){return BPromise[_0x5f2a('0x21')](_0x558a03);}return _0x1f58fe[_0x5f2a('0x22')]();};}function saveUpdates(_0x39ca64,_0xcfcbb8){return function(_0x21ece1){if(_0x21ece1){return _0x21ece1[_0x5f2a('0x23')](_0x39ca64)[_0x5f2a('0x24')](function(_0x231f2a){return _0x231f2a;});}return null;};}function removeEntity(_0xdd4c9c,_0x1ff840){return function(_0x5e5866){if(_0x5e5866){return _0x5e5866[_0x5f2a('0x25')]()[_0x5f2a('0x24')](function(){_0xdd4c9c[_0x5f2a('0x19')](0xcc)[_0x5f2a('0x26')]();});}};}function handleEntityNotFound(_0x31d9f6,_0x4e1590){return function(_0x46a64a){if(!_0x46a64a){_0x31d9f6[_0x5f2a('0x18')](0x194);}return _0x46a64a;};}function handleError(_0x52433e,_0x29aedb){_0x29aedb=_0x29aedb||0x1f4;return function(_0x89cb69){logger[_0x5f2a('0x27')](_0x89cb69[_0x5f2a('0x28')]);if(_0x89cb69[_0x5f2a('0x29')]){delete _0x89cb69[_0x5f2a('0x29')];}_0x52433e[_0x5f2a('0x19')](_0x29aedb)['send'](_0x89cb69);};}exports[_0x5f2a('0x2a')]=function(_0x9a92db,_0x4564f1){var _0x2b7d20={},_0x45ea80={},_0x367f99={'count':0x0,'rows':[]};var _0x3dac8a=_[_0x5f2a('0x2b')](db['VtigerField'][_0x5f2a('0x2c')],function(_0x563288){return{'name':_0x563288[_0x5f2a('0x2d')],'type':_0x563288[_0x5f2a('0x2e')][_0x5f2a('0x2f')]};});_0x45ea80[_0x5f2a('0x30')]=_['map'](_0x3dac8a,'name');_0x45ea80[_0x5f2a('0x31')]=_[_0x5f2a('0x32')](_0x9a92db['query']);_0x45ea80[_0x5f2a('0x33')]=_[_0x5f2a('0x34')](_0x45ea80[_0x5f2a('0x30')],_0x45ea80[_0x5f2a('0x31')]);_0x2b7d20[_0x5f2a('0x35')]=_[_0x5f2a('0x34')](_0x45ea80[_0x5f2a('0x30')],qs[_0x5f2a('0x36')](_0x9a92db['query'][_0x5f2a('0x36')]));_0x2b7d20[_0x5f2a('0x35')]=_0x2b7d20[_0x5f2a('0x35')][_0x5f2a('0x37')]?_0x2b7d20[_0x5f2a('0x35')]:_0x45ea80[_0x5f2a('0x30')];if(!_0x9a92db[_0x5f2a('0x31')][_0x5f2a('0x38')](_0x5f2a('0x39'))){_0x2b7d20[_0x5f2a('0x1c')]=qs['limit'](_0x9a92db[_0x5f2a('0x31')]['limit']);_0x2b7d20[_0x5f2a('0x1a')]=qs[_0x5f2a('0x1a')](_0x9a92db[_0x5f2a('0x31')][_0x5f2a('0x1a')]);}_0x2b7d20['order']=qs[_0x5f2a('0x3a')](_0x9a92db[_0x5f2a('0x31')]['sort']);_0x2b7d20['where']=qs[_0x5f2a('0x33')](_[_0x5f2a('0x3b')](_0x9a92db[_0x5f2a('0x31')],_0x45ea80[_0x5f2a('0x33')]),_0x3dac8a);if(_0x9a92db[_0x5f2a('0x31')][_0x5f2a('0x3c')]){_0x2b7d20['where']=_[_0x5f2a('0x3d')](_0x2b7d20['where'],{'$or':_[_0x5f2a('0x2b')](_0x3dac8a,function(_0x278242){if(_0x278242[_0x5f2a('0x2e')]!==_0x5f2a('0x3e')){var _0x53541c={};_0x53541c[_0x278242['name']]={'$like':'%'+_0x9a92db['query'][_0x5f2a('0x3c')]+'%'};return _0x53541c;}})});}_0x2b7d20=_[_0x5f2a('0x3d')]({},_0x2b7d20,_0x9a92db[_0x5f2a('0x3f')]);var _0x5d33cd={'where':_0x2b7d20[_0x5f2a('0x40')]};return db[_0x5f2a('0x41')][_0x5f2a('0x1d')](_0x5d33cd)[_0x5f2a('0x24')](function(_0x498a36){_0x367f99[_0x5f2a('0x1d')]=_0x498a36;if(_0x9a92db[_0x5f2a('0x31')][_0x5f2a('0x42')]){_0x2b7d20[_0x5f2a('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0x5f2a('0x44')](_0x2b7d20);})[_0x5f2a('0x24')](function(_0x5b74f7){_0x367f99['rows']=_0x5b74f7;return _0x367f99;})[_0x5f2a('0x24')](respondWithFilteredResult(_0x4564f1,_0x2b7d20))[_0x5f2a('0x45')](handleError(_0x4564f1,null));};exports[_0x5f2a('0x46')]=function(_0x5a8c97,_0x258995){var _0x62d388={'raw':!![],'where':{'id':_0x5a8c97[_0x5f2a('0x47')]['id']}},_0x100582={};_0x100582[_0x5f2a('0x30')]=_['keys'](db[_0x5f2a('0x41')][_0x5f2a('0x2c')]);_0x100582[_0x5f2a('0x31')]=_['keys'](_0x5a8c97['query']);_0x100582[_0x5f2a('0x33')]=_[_0x5f2a('0x34')](_0x100582[_0x5f2a('0x30')],_0x100582['query']);_0x62d388[_0x5f2a('0x35')]=_[_0x5f2a('0x34')](_0x100582[_0x5f2a('0x30')],qs['fields'](_0x5a8c97[_0x5f2a('0x31')]['fields']));_0x62d388[_0x5f2a('0x35')]=_0x62d388[_0x5f2a('0x35')][_0x5f2a('0x37')]?_0x62d388['attributes']:_0x100582[_0x5f2a('0x30')];if(_0x5a8c97[_0x5f2a('0x31')][_0x5f2a('0x42')]){_0x62d388[_0x5f2a('0x43')]=[{'all':!![]}];}_0x62d388=_[_0x5f2a('0x3d')]({},_0x62d388,_0x5a8c97[_0x5f2a('0x3f')]);return db[_0x5f2a('0x41')][_0x5f2a('0x48')](_0x62d388)[_0x5f2a('0x24')](handleEntityNotFound(_0x258995,null))['then'](respondWithResult(_0x258995,null))['catch'](handleError(_0x258995,null));};exports[_0x5f2a('0x49')]=function(_0x588152,_0x3d9f5e){return db[_0x5f2a('0x41')]['create'](_0x588152[_0x5f2a('0x4a')],{})[_0x5f2a('0x24')](respondWithResult(_0x3d9f5e,0xc9))[_0x5f2a('0x45')](handleError(_0x3d9f5e,null));};exports[_0x5f2a('0x23')]=function(_0x493de2,_0x37467a){if(_0x493de2[_0x5f2a('0x4a')]['id']){delete _0x493de2[_0x5f2a('0x4a')]['id'];}return db[_0x5f2a('0x41')][_0x5f2a('0x48')]({'where':{'id':_0x493de2[_0x5f2a('0x47')]['id']}})['then'](handleEntityNotFound(_0x37467a,null))[_0x5f2a('0x24')](saveUpdates(_0x493de2['body'],null))[_0x5f2a('0x24')](respondWithResult(_0x37467a,null))[_0x5f2a('0x45')](handleError(_0x37467a,null));};exports['destroy']=function(_0x161e7d,_0x59b332){return db[_0x5f2a('0x41')]['find']({'where':{'id':_0x161e7d[_0x5f2a('0x47')]['id']}})[_0x5f2a('0x24')](handleEntityNotFound(_0x59b332,null))[_0x5f2a('0x24')](removeEntity(_0x59b332,null))[_0x5f2a('0x45')](handleError(_0x59b332,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326d=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0xa697e6,_0x377690){var _0x44e8d8=function(_0x288897){while(--_0x288897){_0xa697e6['push'](_0xa697e6['shift']());}};_0x44e8d8(++_0x377690);}(_0x326d,0x1ae));var _0xd326=function(_0x5cd6f4,_0x2c7f2c){_0x5cd6f4=_0x5cd6f4-0x0;var _0x112a6b=_0x326d[_0x5cd6f4];return _0x112a6b;};'use strict';var _=require(_0xd326('0x0'));var util=require(_0xd326('0x1'));var logger=require(_0xd326('0x2'))(_0xd326('0x3'));var moment=require(_0xd326('0x4'));var BPromise=require(_0xd326('0x5'));var rp=require(_0xd326('0x6'));var fs=require('fs');var path=require(_0xd326('0x7'));var rimraf=require('rimraf');var config=require(_0xd326('0x8'));var attributes=require(_0xd326('0x9'));module[_0xd326('0xa')]=function(_0x2197c9,_0x3f687e){return _0x2197c9[_0xd326('0xb')](_0xd326('0xc'),attributes,{'tableName':_0xd326('0xd'),'paranoid':![],'indexes':[{'name':_0xd326('0xe'),'fields':[_0xd326('0xf'),_0xd326('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ff5=['define','VtigerField','idField','FieldId','util','api','path','rimraf','./intVtigerField.attributes'];(function(_0x1db33e,_0x2929ad){var _0x395227=function(_0x1dadaf){while(--_0x1dadaf){_0x1db33e['push'](_0x1db33e['shift']());}};_0x395227(++_0x2929ad);}(_0x7ff5,0xaf));var _0x57ff=function(_0x4d6db2,_0x2c421e){_0x4d6db2=_0x4d6db2-0x0;var _0x345650=_0x7ff5[_0x4d6db2];return _0x345650;};'use strict';var _=require('lodash');var util=require(_0x57ff('0x0'));var logger=require('../../config/logger')(_0x57ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x57ff('0x2'));var rimraf=require(_0x57ff('0x3'));var config=require('../../config/environment');var attributes=require(_0x57ff('0x4'));module['exports']=function(_0x5c1f46,_0x3750e8){return _0x5c1f46[_0x57ff('0x5')](_0x57ff('0x6'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x57ff('0x7'),_0x57ff('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd28=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x19380b,_0x261bb7){var _0x552d6d=function(_0x2bce05){while(--_0x2bce05){_0x19380b['push'](_0x19380b['shift']());}};_0x552d6d(++_0x261bb7);}(_0xdd28,0x1a0));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd2('0x0'));var util=require(_0x8dd2('0x1'));var moment=require('moment');var BPromise=require(_0x8dd2('0x2'));var rs=require(_0x8dd2('0x3'));var fs=require('fs');var Redis=require(_0x8dd2('0x4'));var db=require(_0x8dd2('0x5'))['db'];var utils=require(_0x8dd2('0x6'));var logger=require('../../config/logger')(_0x8dd2('0x7'));var config=require(_0x8dd2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8dd2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538700,_0x52c586,_0x240e1f){return new BPromise(function(_0x2caa8b,_0x1180b9){return client[_0x8dd2('0xa')](_0x538700,_0x240e1f)['then'](function(_0x2ccfda){logger[_0x8dd2('0xb')]('VtigerField,\x20%s,\x20%s',_0x52c586,_0x8dd2('0xc'));logger['debug'](_0x8dd2('0xd'),_0x52c586,'request\x20sent',JSON[_0x8dd2('0xe')](_0x2ccfda));if(_0x2ccfda['error']){if(_0x2ccfda[_0x8dd2('0xf')][_0x8dd2('0x10')]===0x1f4){logger[_0x8dd2('0xf')](_0x8dd2('0x11'),_0x52c586,_0x2ccfda[_0x8dd2('0xf')][_0x8dd2('0x12')]);return _0x1180b9(_0x2ccfda['error'][_0x8dd2('0x12')]);}logger[_0x8dd2('0xf')]('VtigerField,\x20%s,\x20%s',_0x52c586,_0x2ccfda[_0x8dd2('0xf')]['message']);return _0x2caa8b(_0x2ccfda[_0x8dd2('0xf')][_0x8dd2('0x12')]);}else{logger[_0x8dd2('0xb')](_0x8dd2('0x11'),_0x52c586,_0x8dd2('0xc'));_0x2caa8b(_0x2ccfda['result'][_0x8dd2('0x12')]);}})[_0x8dd2('0x13')](function(_0x4da6c0){logger[_0x8dd2('0xf')](_0x8dd2('0x11'),_0x52c586,_0x4da6c0);_0x1180b9(_0x4da6c0);});});}
\ No newline at end of file
+var _0x087c=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x087c,0x16c));var _0xc087=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x087c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc087('0x0'));var util=require(_0xc087('0x1'));var moment=require(_0xc087('0x2'));var BPromise=require(_0xc087('0x3'));var rs=require(_0xc087('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc087('0x5'))['db'];var utils=require(_0xc087('0x6'));var logger=require('../../config/logger')(_0xc087('0x7'));var config=require(_0xc087('0x8'));var jayson=require(_0xc087('0x9'));var client=jayson[_0xc087('0xa')][_0xc087('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e20b4,_0x61c653,_0xdb1df6){return new BPromise(function(_0xb343c5,_0x204dd7){return client['request'](_0x1e20b4,_0xdb1df6)[_0xc087('0xc')](function(_0x31a6ac){logger['info'](_0xc087('0xd'),_0x61c653,_0xc087('0xe'));logger[_0xc087('0xf')](_0xc087('0x10'),_0x61c653,'request\x20sent',JSON[_0xc087('0x11')](_0x31a6ac));if(_0x31a6ac[_0xc087('0x12')]){if(_0x31a6ac[_0xc087('0x12')][_0xc087('0x13')]===0x1f4){logger[_0xc087('0x12')](_0xc087('0xd'),_0x61c653,_0x31a6ac[_0xc087('0x12')][_0xc087('0x14')]);return _0x204dd7(_0x31a6ac['error'][_0xc087('0x14')]);}logger[_0xc087('0x12')](_0xc087('0xd'),_0x61c653,_0x31a6ac[_0xc087('0x12')][_0xc087('0x14')]);return _0xb343c5(_0x31a6ac[_0xc087('0x12')]['message']);}else{logger[_0xc087('0x15')]('VtigerField,\x20%s,\x20%s',_0x61c653,_0xc087('0xe'));_0xb343c5(_0x31a6ac['result'][_0xc087('0x14')]);}})[_0xc087('0x16')](function(_0x4d9f19){logger['error'](_0xc087('0xd'),_0x61c653,_0x4d9f19);_0x204dd7(_0x4d9f19);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb04=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c69cb,_0x25751f){var _0x559c9b=function(_0x2ff2a4){while(--_0x2ff2a4){_0x2c69cb['push'](_0x2c69cb['shift']());}};_0x559c9b(++_0x25751f);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var path=require(_0x4cb0('0x2'));var timeout=require(_0x4cb0('0x3'));var express=require(_0x4cb0('0x4'));var router=express[_0x4cb0('0x5')]();var fs_extra=require(_0x4cb0('0x6'));var auth=require(_0x4cb0('0x7'));var interaction=require(_0x4cb0('0x8'));var config=require(_0x4cb0('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x4cb0('0xa')]('/',auth[_0x4cb0('0xb')](),controller[_0x4cb0('0xc')]);router[_0x4cb0('0xa')](_0x4cb0('0xd'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0xe')]);router[_0x4cb0('0xa')](_0x4cb0('0xf'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x10')]);router[_0x4cb0('0xa')](_0x4cb0('0x11'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x12')]);router[_0x4cb0('0x13')]('/',auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x14')]);router['post'](_0x4cb0('0xf'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x15')]);router[_0x4cb0('0x16')]('/:id',auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x17')]);router[_0x4cb0('0x18')](_0x4cb0('0xd'),auth[_0x4cb0('0xb')](),controller[_0x4cb0('0x19')]);module[_0x4cb0('0x1a')]=router;
\ No newline at end of file
+var _0x6e0c=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x6e0c,0x19d));var _0xc6e0=function(_0xd413a4,_0x3120fe){_0xd413a4=_0xd413a4-0x0;var _0x9170f4=_0x6e0c[_0xd413a4];return _0x9170f4;};'use strict';var multer=require(_0xc6e0('0x0'));var util=require(_0xc6e0('0x1'));var path=require('path');var timeout=require(_0xc6e0('0x2'));var express=require(_0xc6e0('0x3'));var router=express['Router']();var fs_extra=require(_0xc6e0('0x4'));var auth=require(_0xc6e0('0x5'));var interaction=require(_0xc6e0('0x6'));var config=require(_0xc6e0('0x7'));var controller=require(_0xc6e0('0x8'));router[_0xc6e0('0x9')]('/',auth['isAuthenticated'](),controller[_0xc6e0('0xa')]);router[_0xc6e0('0x9')](_0xc6e0('0xb'),auth[_0xc6e0('0xc')](),controller[_0xc6e0('0xd')]);router['get'](_0xc6e0('0xe'),auth[_0xc6e0('0xc')](),controller[_0xc6e0('0xf')]);router[_0xc6e0('0x9')](_0xc6e0('0x10'),auth[_0xc6e0('0xc')](),controller[_0xc6e0('0x11')]);router[_0xc6e0('0x12')]('/',auth[_0xc6e0('0xc')](),controller[_0xc6e0('0x13')]);router[_0xc6e0('0x12')]('/:id/configurations',auth[_0xc6e0('0xc')](),controller[_0xc6e0('0x14')]);router[_0xc6e0('0x15')](_0xc6e0('0xb'),auth[_0xc6e0('0xc')](),controller[_0xc6e0('0x16')]);router[_0xc6e0('0x17')](_0xc6e0('0xb'),auth[_0xc6e0('0xc')](),controller['destroy']);module[_0xc6e0('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81d4=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','exports'];(function(_0x5c3165,_0x16eb6d){var _0xdb6178=function(_0x2c07b3){while(--_0x2c07b3){_0x5c3165['push'](_0x5c3165['shift']());}};_0xdb6178(++_0x16eb6d);}(_0x81d4,0x197));var _0x481d=function(_0x372938,_0x454f2a){_0x372938=_0x372938-0x0;var _0x39ebc5=_0x81d4[_0x372938];return _0x39ebc5;};'use strict';var Sequelize=require('sequelize');module[_0x481d('0x0')]={'name':{'type':Sequelize[_0x481d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x481d('0x1')],'unique':_0x481d('0x2')},'password':{'type':Sequelize[_0x481d('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x481d('0x3')},'authType':{'type':Sequelize[_0x481d('0x4')](_0x481d('0x5'),'token'),'defaultValue':_0x481d('0x5')},'serverUrl':{'type':Sequelize[_0x481d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x481d('0x4')](_0x481d('0x6'),_0x481d('0x7')),'defaultValue':_0x481d('0x6')}};
\ No newline at end of file
+var _0x4991=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','sequelize'];(function(_0x44105a,_0xd3d69f){var _0x2d3b6d=function(_0x56192e){while(--_0x56192e){_0x44105a['push'](_0x44105a['shift']());}};_0x2d3b6d(++_0xd3d69f);}(_0x4991,0xf7));var _0x1499=function(_0x2d3783,_0x15b35d){_0x2d3783=_0x2d3783-0x0;var _0x3d7778=_0x4991[_0x2d3783];return _0x3d7778;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'password':{'type':Sequelize[_0x1499('0x1')]},'token':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'authType':{'type':Sequelize[_0x1499('0x4')](_0x1499('0x5'),'token'),'defaultValue':_0x1499('0x5')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1499('0x4')](_0x1499('0x6'),_0x1499('0x7')),'defaultValue':_0x1499('0x6')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6cb4=['getFields','username','password','token','authType','slice','substring','lastIndexOf','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','assignee','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','ZendeskAccount','include','findAll','catch','params','keys','find','create','body','getConfigurations','findOne','ZendeskConfiguration','rawAttributes','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField'];(function(_0x4cc7c9,_0xafa40a){var _0x35ea4a=function(_0x96286e){while(--_0x96286e){_0x4cc7c9['push'](_0x4cc7c9['shift']());}};_0x35ea4a(++_0xafa40a);}(_0x6cb4,0xff));var _0x46cb=function(_0x1b61e5,_0x1b1b82){_0x1b61e5=_0x1b61e5-0x0;var _0x525901=_0x6cb4[_0x1b61e5];return _0x525901;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];var integrations=require(_0x46cb('0x18'));function respondWithStatusCode(_0x1058a8,_0xf22158){_0xf22158=_0xf22158||0xcc;return function(_0x553440){if(_0x553440){return _0x1058a8[_0x46cb('0x19')](_0xf22158);}return _0x1058a8[_0x46cb('0x1a')](_0xf22158)[_0x46cb('0x1b')]();};}function respondWithResult(_0x3c0071,_0x1f7150){_0x1f7150=_0x1f7150||0xc8;return function(_0x32201f){if(_0x32201f){return _0x3c0071[_0x46cb('0x1a')](_0x1f7150)[_0x46cb('0x1c')](_0x32201f);}};}function respondWithFilteredResult(_0x37d368,_0x41e398){return function(_0x136215){if(_0x136215){var _0x5cdb4b=typeof _0x41e398[_0x46cb('0x1d')]==='undefined'&&typeof _0x41e398[_0x46cb('0x1e')]==='undefined';var _0x4e3d29=_0x136215['count'];var _0x1b6646=_0x5cdb4b?0x0:_0x41e398[_0x46cb('0x1d')];var _0x4df1f0=_0x5cdb4b?_0x136215[_0x46cb('0x1f')]:_0x41e398[_0x46cb('0x1d')]+_0x41e398[_0x46cb('0x1e')];var _0x264497;if(_0x4df1f0>=_0x4e3d29){_0x4df1f0=_0x4e3d29;_0x264497=0xc8;}else{_0x264497=0xce;}_0x37d368[_0x46cb('0x1a')](_0x264497);return _0x37d368[_0x46cb('0x20')](_0x46cb('0x21'),_0x1b6646+'-'+_0x4df1f0+'/'+_0x4e3d29)[_0x46cb('0x1c')](_0x136215);}return null;};}function patchUpdates(_0x46e541){return function(_0x21e72a){try{jsonpatch[_0x46cb('0x22')](_0x21e72a,_0x46e541,!![]);}catch(_0x188c28){return BPromise[_0x46cb('0x23')](_0x188c28);}return _0x21e72a[_0x46cb('0x24')]();};}function saveUpdates(_0x1fb467,_0x41ecd2){return function(_0xfbf576){if(_0xfbf576){return _0xfbf576[_0x46cb('0x25')](_0x1fb467)[_0x46cb('0x26')](function(_0x309e4b){return _0x309e4b;});}return null;};}function removeEntity(_0xadcad6,_0x40e0e5){return function(_0x5a1338){if(_0x5a1338){return _0x5a1338['destroy']()[_0x46cb('0x26')](function(){_0xadcad6[_0x46cb('0x1a')](0xcc)[_0x46cb('0x1b')]();});}};}function handleEntityNotFound(_0xe078a8,_0x6e6d9){return function(_0x589152){if(!_0x589152){_0xe078a8[_0x46cb('0x19')](0x194);}return _0x589152;};}function handleError(_0x578ffd,_0x495886){_0x495886=_0x495886||0x1f4;return function(_0x544465){logger[_0x46cb('0x27')](_0x544465[_0x46cb('0x28')]);if(_0x544465[_0x46cb('0x29')]){delete _0x544465[_0x46cb('0x29')];}_0x578ffd[_0x46cb('0x1a')](_0x495886)[_0x46cb('0x2a')](_0x544465);};}exports[_0x46cb('0x2b')]=function(_0x8c65b2,_0x2b846a){var _0x12e01e={},_0x4620ef={},_0x4a1517={'count':0x0,'rows':[]};var _0x1ce88f=_[_0x46cb('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x15f5cf){return{'name':_0x15f5cf['fieldName'],'type':_0x15f5cf[_0x46cb('0x2d')][_0x46cb('0x2e')]};});_0x4620ef[_0x46cb('0x2f')]=_[_0x46cb('0x2c')](_0x1ce88f,_0x46cb('0x29'));_0x4620ef[_0x46cb('0x30')]=_['keys'](_0x8c65b2[_0x46cb('0x30')]);_0x4620ef['filters']=_[_0x46cb('0x31')](_0x4620ef[_0x46cb('0x2f')],_0x4620ef['query']);_0x12e01e[_0x46cb('0x32')]=_[_0x46cb('0x31')](_0x4620ef[_0x46cb('0x2f')],qs[_0x46cb('0x33')](_0x8c65b2[_0x46cb('0x30')]['fields']));_0x12e01e[_0x46cb('0x32')]=_0x12e01e['attributes'][_0x46cb('0x34')]?_0x12e01e[_0x46cb('0x32')]:_0x4620ef[_0x46cb('0x2f')];if(!_0x8c65b2['query'][_0x46cb('0x35')](_0x46cb('0x36'))){_0x12e01e['limit']=qs[_0x46cb('0x1e')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x1e')]);_0x12e01e[_0x46cb('0x1d')]=qs[_0x46cb('0x1d')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x1d')]);}_0x12e01e[_0x46cb('0x37')]=qs[_0x46cb('0x38')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x38')]);_0x12e01e['where']=qs['filters'](_['pick'](_0x8c65b2[_0x46cb('0x30')],_0x4620ef[_0x46cb('0x39')]),_0x1ce88f);if(_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x3a')]){_0x12e01e[_0x46cb('0x3b')]=_[_0x46cb('0x3c')](_0x12e01e['where'],{'$or':_[_0x46cb('0x2c')](_0x1ce88f,function(_0x4ae944){if(_0x4ae944['type']!==_0x46cb('0x3d')){var _0x59bdb0={};_0x59bdb0[_0x4ae944['name']]={'$like':'%'+_0x8c65b2[_0x46cb('0x30')]['filter']+'%'};return _0x59bdb0;}})});}_0x12e01e=_['merge']({},_0x12e01e,_0x8c65b2[_0x46cb('0x3e')]);var _0x10017d={'where':_0x12e01e[_0x46cb('0x3b')]};return db[_0x46cb('0x3f')][_0x46cb('0x1f')](_0x10017d)[_0x46cb('0x26')](function(_0x21f9a6){_0x4a1517['count']=_0x21f9a6;if(_0x8c65b2[_0x46cb('0x30')]['includeAll']){_0x12e01e[_0x46cb('0x40')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x46cb('0x41')](_0x12e01e);})[_0x46cb('0x26')](function(_0x2445a2){_0x4a1517['rows']=_0x2445a2;return _0x4a1517;})[_0x46cb('0x26')](respondWithFilteredResult(_0x2b846a,_0x12e01e))[_0x46cb('0x42')](handleError(_0x2b846a,null));};exports['show']=function(_0x18be96,_0x3d0b83){var _0x1f67af={'raw':![],'where':{'id':_0x18be96[_0x46cb('0x43')]['id']}},_0x66e602={};_0x66e602['model']=_['keys'](db[_0x46cb('0x3f')]['rawAttributes']);_0x66e602[_0x46cb('0x30')]=_[_0x46cb('0x44')](_0x18be96['query']);_0x66e602[_0x46cb('0x39')]=_[_0x46cb('0x31')](_0x66e602[_0x46cb('0x2f')],_0x66e602['query']);_0x1f67af['attributes']=_['intersection'](_0x66e602['model'],qs[_0x46cb('0x33')](_0x18be96[_0x46cb('0x30')][_0x46cb('0x33')]));_0x1f67af[_0x46cb('0x32')]=_0x1f67af[_0x46cb('0x32')]['length']?_0x1f67af['attributes']:_0x66e602[_0x46cb('0x2f')];if(_0x18be96[_0x46cb('0x30')]['includeAll']){_0x1f67af[_0x46cb('0x40')]=[{'all':!![]}];}_0x1f67af=_[_0x46cb('0x3c')]({},_0x1f67af,_0x18be96[_0x46cb('0x3e')]);return db[_0x46cb('0x3f')][_0x46cb('0x45')](_0x1f67af)[_0x46cb('0x26')](handleEntityNotFound(_0x3d0b83,null))[_0x46cb('0x26')](respondWithResult(_0x3d0b83,null))['catch'](handleError(_0x3d0b83,null));};exports['create']=function(_0x449593,_0x52ed52){return db[_0x46cb('0x3f')][_0x46cb('0x46')](_0x449593[_0x46cb('0x47')],{})['then'](respondWithResult(_0x52ed52,0xc9))[_0x46cb('0x42')](handleError(_0x52ed52,null));};exports['update']=function(_0x5c02c9,_0x16c500){if(_0x5c02c9[_0x46cb('0x47')]['id']){delete _0x5c02c9[_0x46cb('0x47')]['id'];}return db[_0x46cb('0x3f')][_0x46cb('0x45')]({'where':{'id':_0x5c02c9[_0x46cb('0x43')]['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x16c500,null))['then'](saveUpdates(_0x5c02c9['body'],null))[_0x46cb('0x26')](respondWithResult(_0x16c500,null))[_0x46cb('0x42')](handleError(_0x16c500,null));};exports['destroy']=function(_0x34399d,_0x33ab2e){return db[_0x46cb('0x3f')][_0x46cb('0x45')]({'where':{'id':_0x34399d[_0x46cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x33ab2e,null))[_0x46cb('0x26')](removeEntity(_0x33ab2e,null))[_0x46cb('0x42')](handleError(_0x33ab2e,null));};exports[_0x46cb('0x48')]=function(_0x52d1a7,_0x1f5c71,_0x56ad38){var _0x48b994={};var _0x1e46cc={};var _0x2cfe6f;var _0x2fe0b1;return db[_0x46cb('0x3f')][_0x46cb('0x49')]({'where':{'id':_0x52d1a7['params']['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x1f5c71,null))[_0x46cb('0x26')](function(_0x5701c0){if(_0x5701c0){_0x2cfe6f=_0x5701c0;_0x1e46cc['model']=_[_0x46cb('0x44')](db[_0x46cb('0x4a')][_0x46cb('0x4b')]);_0x1e46cc['query']=_[_0x46cb('0x44')](_0x52d1a7[_0x46cb('0x30')]);_0x1e46cc[_0x46cb('0x39')]=_[_0x46cb('0x31')](_0x1e46cc[_0x46cb('0x2f')],_0x1e46cc[_0x46cb('0x30')]);_0x48b994[_0x46cb('0x32')]=_[_0x46cb('0x31')](_0x1e46cc[_0x46cb('0x2f')],qs['fields'](_0x52d1a7[_0x46cb('0x30')]['fields']));_0x48b994[_0x46cb('0x32')]=_0x48b994[_0x46cb('0x32')][_0x46cb('0x34')]?_0x48b994[_0x46cb('0x32')]:_0x1e46cc['model'];_0x48b994[_0x46cb('0x37')]=qs[_0x46cb('0x38')](_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x38')]);_0x48b994[_0x46cb('0x3b')]=qs[_0x46cb('0x39')](_[_0x46cb('0x4c')](_0x52d1a7[_0x46cb('0x30')],_0x1e46cc['filters']));if(_0x52d1a7['query']['filter']){_0x48b994['where']=_[_0x46cb('0x3c')](_0x48b994[_0x46cb('0x3b')],{'$or':_['map'](_0x48b994[_0x46cb('0x32')],function(_0xfa28a8){var _0x10c3f9={};_0x10c3f9[_0xfa28a8]={'$like':'%'+_0x52d1a7['query']['filter']+'%'};return _0x10c3f9;})});}_0x48b994=_[_0x46cb('0x3c')]({},_0x48b994,_0x52d1a7['options']);return _0x2cfe6f[_0x46cb('0x48')](_0x48b994);}})[_0x46cb('0x26')](function(_0x1eb392){if(_0x1eb392){_0x2fe0b1=_0x1eb392[_0x46cb('0x34')];if(!_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x35')](_0x46cb('0x36'))){_0x48b994[_0x46cb('0x1e')]=qs[_0x46cb('0x1e')](_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x1e')]);_0x48b994[_0x46cb('0x1d')]=qs[_0x46cb('0x1d')](_0x52d1a7['query'][_0x46cb('0x1d')]);}return _0x2cfe6f['getConfigurations'](_0x48b994);}})[_0x46cb('0x26')](function(_0x478ada){if(_0x478ada){return _0x478ada?{'count':_0x2fe0b1,'rows':_0x478ada}:null;}})[_0x46cb('0x26')](respondWithResult(_0x1f5c71,null))[_0x46cb('0x42')](handleError(_0x1f5c71,null));};exports[_0x46cb('0x4d')]=function(_0x3dc4bd,_0x656601,_0x598a41){if(_0x3dc4bd[_0x46cb('0x47')]['id']){delete _0x3dc4bd[_0x46cb('0x47')]['id'];}return db[_0x46cb('0x3f')][_0x46cb('0x49')]({'where':{'id':_0x3dc4bd['params']['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x656601,null))[_0x46cb('0x26')](function(_0x6dc790){if(_0x6dc790){_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x4e')]=_0x6dc790['id'];_0x3dc4bd['body'][_0x46cb('0x4f')]=integrations[_0x46cb('0x50')](_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x51')],_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x2d')]);_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x52')]=integrations['getDescriptions'](_0x3dc4bd['body']['channel'],_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x2d')]);return db[_0x46cb('0x4a')][_0x46cb('0x46')](_0x3dc4bd[_0x46cb('0x47')],{'include':[{'model':db[_0x46cb('0x53')],'as':_0x46cb('0x4f')},{'model':db[_0x46cb('0x53')],'as':_0x46cb('0x52')}]});}return null;})[_0x46cb('0x26')](respondWithResult(_0x656601,null))[_0x46cb('0x42')](handleError(_0x656601,null));};exports[_0x46cb('0x54')]=function(_0x140c96,_0x2ea5d0,_0x5c9f3c){var _0x2e23e4='';return db['ZendeskAccount'][_0x46cb('0x49')]({'where':{'id':_0x140c96['params']['id']},'attributes':['id',_0x46cb('0x55'),_0x46cb('0x56'),_0x46cb('0x57'),_0x46cb('0x58'),'remoteUri']})[_0x46cb('0x26')](handleEntityNotFound(_0x2ea5d0,null))[_0x46cb('0x26')](function(_0x55895a){if(_0x55895a){_0x2e23e4=_0x55895a['remoteUri'];var _0x473758=_0x2e23e4[_0x46cb('0x59')](-0x1);if(_0x473758==='/'){_0x2e23e4=_0x2e23e4[_0x46cb('0x5a')](0x0,_0x2e23e4[_0x46cb('0x5b')](_0x473758));}var _0x1ba6ae={'method':'GET','uri':util['format']('%s/%s',_0x2e23e4,_0x46cb('0x5c')),'json':!![]};switch(_0x55895a[_0x46cb('0x58')]){case _0x46cb('0x56'):_0x1ba6ae[_0x46cb('0x5d')]={'Authorization':util[_0x46cb('0x5e')](_0x46cb('0x5f'),new Buffer(util[_0x46cb('0x5e')](_0x46cb('0x60'),_0x55895a[_0x46cb('0x55')],_0x55895a[_0x46cb('0x56')]))[_0x46cb('0x61')]('base64'))};break;case _0x46cb('0x57'):_0x1ba6ae[_0x46cb('0x5d')]={'Authorization':util[_0x46cb('0x5e')](_0x46cb('0x5f'),new Buffer(util['format'](_0x46cb('0x62'),_0x55895a[_0x46cb('0x55')],_0x55895a[_0x46cb('0x57')]))[_0x46cb('0x61')]('base64'))};break;default:throw new db[(_0x46cb('0x63'))][(_0x46cb('0x64'))](_0x46cb('0x65'));}return rp(_0x1ba6ae);}})[_0x46cb('0x26')](function(_0x5eaad6){if(_0x5eaad6){var _0x5775dc=['subject',_0x46cb('0x66'),'group',_0x46cb('0x67')];_['remove'](_0x5eaad6[_0x46cb('0x5c')],function(_0x36a82b){return _0x5775dc[_0x46cb('0x68')](_0x36a82b[_0x46cb('0x2d')]);});return{'count':_0x5eaad6['ticket_fields'][_0x46cb('0x34')],'rows':_[_0x46cb('0x2c')](_0x5eaad6[_0x46cb('0x5c')],function(_0x468d1f){return{'id':_0x468d1f['id'],'name':_0x468d1f['position']>0x7?_0x468d1f['title']:_0x468d1f[_0x46cb('0x2d')],'custom':_0x468d1f[_0x46cb('0x69')]>0x7?!![]:![],'options':_0x468d1f[_0x46cb('0x6a')]?_0x468d1f[_0x46cb('0x6a')]:_0x468d1f[_0x46cb('0x6b')]?_0x468d1f[_0x46cb('0x6b')]:[]};})};}})['then'](respondWithResult(_0x2ea5d0,null))['catch'](function(_0x3089d7){var _0x53eb=_0x140c96['query'][_0x46cb('0x6c')]?0x1f4:_0x3089d7[_0x46cb('0x6d')]||0x1f4;logger[_0x46cb('0x27')](_0x46cb('0x6e'),_0x46cb('0x54'),_0x53eb,JSON[_0x46cb('0x6f')](_0x3089d7));delete _0x3089d7[_0x46cb('0x29')];if(_0x53eb===0x191){_0x53eb=0x190;}_0x2ea5d0['status'](_0x53eb)[_0x46cb('0x2a')](_0x140c96[_0x46cb('0x30')][_0x46cb('0x6c')]?{'message':_0x46cb('0x70'),'statusCode':_0x3089d7[_0x46cb('0x6d')]}:_0x3089d7);});};
\ No newline at end of file
+var _0x16d2=['where','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','catch','body','params','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','password','authType','remoteUri','slice','substring','GET','%s/%s','ticket_fields','headers','format','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','subject','description','assignee','remove','position','title','system_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x16d2,0x123));var _0x216d=function(_0x11f9fe,_0x5e3648){_0x11f9fe=_0x11f9fe-0x0;var _0x291b9e=_0x16d2[_0x11f9fe];return _0x291b9e;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];var integrations=require(_0x216d('0x1c'));function respondWithStatusCode(_0x4c92d9,_0xb36a43){_0xb36a43=_0xb36a43||0xcc;return function(_0x4c07d0){if(_0x4c07d0){return _0x4c92d9[_0x216d('0x1d')](_0xb36a43);}return _0x4c92d9[_0x216d('0x1e')](_0xb36a43)['end']();};}function respondWithResult(_0x165c19,_0x322e4b){_0x322e4b=_0x322e4b||0xc8;return function(_0x54a816){if(_0x54a816){return _0x165c19[_0x216d('0x1e')](_0x322e4b)['json'](_0x54a816);}};}function respondWithFilteredResult(_0x448c0d,_0xf571a4){return function(_0x4631b0){if(_0x4631b0){var _0x23ff86=typeof _0xf571a4[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0xf571a4[_0x216d('0x21')]===_0x216d('0x20');var _0x19fdac=_0x4631b0['count'];var _0x3b60dd=_0x23ff86?0x0:_0xf571a4['offset'];var _0x4ddc51=_0x23ff86?_0x4631b0[_0x216d('0x22')]:_0xf571a4[_0x216d('0x1f')]+_0xf571a4['limit'];var _0x3f32e0;if(_0x4ddc51>=_0x19fdac){_0x4ddc51=_0x19fdac;_0x3f32e0=0xc8;}else{_0x3f32e0=0xce;}_0x448c0d[_0x216d('0x1e')](_0x3f32e0);return _0x448c0d['set'](_0x216d('0x23'),_0x3b60dd+'-'+_0x4ddc51+'/'+_0x19fdac)[_0x216d('0x24')](_0x4631b0);}return null;};}function patchUpdates(_0x430e81){return function(_0x3e9818){try{jsonpatch['apply'](_0x3e9818,_0x430e81,!![]);}catch(_0x20ee7c){return BPromise[_0x216d('0x25')](_0x20ee7c);}return _0x3e9818[_0x216d('0x26')]();};}function saveUpdates(_0x438981,_0x206782){return function(_0x57cfbd){if(_0x57cfbd){return _0x57cfbd[_0x216d('0x27')](_0x438981)[_0x216d('0x28')](function(_0x188494){return _0x188494;});}return null;};}function removeEntity(_0x2880c6,_0x6fa4b3){return function(_0x54d96f){if(_0x54d96f){return _0x54d96f[_0x216d('0x29')]()[_0x216d('0x28')](function(){_0x2880c6[_0x216d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec8a7,_0x56460f){return function(_0x4c792e){if(!_0x4c792e){_0x4ec8a7['sendStatus'](0x194);}return _0x4c792e;};}function handleError(_0x32f240,_0x470d8a){_0x470d8a=_0x470d8a||0x1f4;return function(_0x189413){logger[_0x216d('0x2a')](_0x189413[_0x216d('0x2b')]);if(_0x189413['name']){delete _0x189413['name'];}_0x32f240[_0x216d('0x1e')](_0x470d8a)['send'](_0x189413);};}exports[_0x216d('0x2c')]=function(_0x42abbe,_0x10f7c6){var _0x20bc16={},_0x307f2b={},_0x12bcab={'count':0x0,'rows':[]};var _0x28fcc2=_[_0x216d('0x2d')](db[_0x216d('0x2e')][_0x216d('0x2f')],function(_0x11be90){return{'name':_0x11be90[_0x216d('0x30')],'type':_0x11be90[_0x216d('0x31')]['key']};});_0x307f2b[_0x216d('0x32')]=_[_0x216d('0x2d')](_0x28fcc2,_0x216d('0x33'));_0x307f2b['query']=_[_0x216d('0x34')](_0x42abbe[_0x216d('0x35')]);_0x307f2b[_0x216d('0x36')]=_[_0x216d('0x37')](_0x307f2b['model'],_0x307f2b[_0x216d('0x35')]);_0x20bc16[_0x216d('0x38')]=_[_0x216d('0x37')](_0x307f2b[_0x216d('0x32')],qs[_0x216d('0x39')](_0x42abbe[_0x216d('0x35')][_0x216d('0x39')]));_0x20bc16[_0x216d('0x38')]=_0x20bc16[_0x216d('0x38')][_0x216d('0x3a')]?_0x20bc16[_0x216d('0x38')]:_0x307f2b['model'];if(!_0x42abbe[_0x216d('0x35')][_0x216d('0x3b')](_0x216d('0x3c'))){_0x20bc16['limit']=qs[_0x216d('0x21')](_0x42abbe[_0x216d('0x35')]['limit']);_0x20bc16[_0x216d('0x1f')]=qs['offset'](_0x42abbe['query'][_0x216d('0x1f')]);}_0x20bc16[_0x216d('0x3d')]=qs[_0x216d('0x3e')](_0x42abbe[_0x216d('0x35')]['sort']);_0x20bc16['where']=qs['filters'](_[_0x216d('0x3f')](_0x42abbe[_0x216d('0x35')],_0x307f2b['filters']),_0x28fcc2);if(_0x42abbe[_0x216d('0x35')][_0x216d('0x40')]){_0x20bc16['where']=_[_0x216d('0x41')](_0x20bc16[_0x216d('0x42')],{'$or':_[_0x216d('0x2d')](_0x28fcc2,function(_0x474fab){if(_0x474fab[_0x216d('0x31')]!==_0x216d('0x43')){var _0x35cb6e={};_0x35cb6e[_0x474fab[_0x216d('0x33')]]={'$like':'%'+_0x42abbe['query']['filter']+'%'};return _0x35cb6e;}})});}_0x20bc16=_[_0x216d('0x41')]({},_0x20bc16,_0x42abbe[_0x216d('0x44')]);var _0x504a34={'where':_0x20bc16[_0x216d('0x42')]};return db[_0x216d('0x2e')][_0x216d('0x22')](_0x504a34)['then'](function(_0x2c3e44){_0x12bcab[_0x216d('0x22')]=_0x2c3e44;if(_0x42abbe[_0x216d('0x35')][_0x216d('0x45')]){_0x20bc16['include']=[{'all':!![]}];}return db[_0x216d('0x2e')][_0x216d('0x46')](_0x20bc16);})['then'](function(_0x37bf4a){_0x12bcab[_0x216d('0x47')]=_0x37bf4a;return _0x12bcab;})['then'](respondWithFilteredResult(_0x10f7c6,_0x20bc16))['catch'](handleError(_0x10f7c6,null));};exports[_0x216d('0x48')]=function(_0x440bc9,_0x3c491e){var _0x498efe={'raw':![],'where':{'id':_0x440bc9['params']['id']}},_0x3e361a={};_0x3e361a['model']=_[_0x216d('0x34')](db[_0x216d('0x2e')][_0x216d('0x2f')]);_0x3e361a['query']=_[_0x216d('0x34')](_0x440bc9['query']);_0x3e361a[_0x216d('0x36')]=_[_0x216d('0x37')](_0x3e361a[_0x216d('0x32')],_0x3e361a['query']);_0x498efe[_0x216d('0x38')]=_[_0x216d('0x37')](_0x3e361a[_0x216d('0x32')],qs[_0x216d('0x39')](_0x440bc9['query']['fields']));_0x498efe['attributes']=_0x498efe[_0x216d('0x38')][_0x216d('0x3a')]?_0x498efe[_0x216d('0x38')]:_0x3e361a[_0x216d('0x32')];if(_0x440bc9[_0x216d('0x35')][_0x216d('0x45')]){_0x498efe[_0x216d('0x49')]=[{'all':!![]}];}_0x498efe=_[_0x216d('0x41')]({},_0x498efe,_0x440bc9['options']);return db[_0x216d('0x2e')][_0x216d('0x4a')](_0x498efe)[_0x216d('0x28')](handleEntityNotFound(_0x3c491e,null))[_0x216d('0x28')](respondWithResult(_0x3c491e,null))['catch'](handleError(_0x3c491e,null));};exports[_0x216d('0x4b')]=function(_0x542e1b,_0x1f2fa5){return db[_0x216d('0x2e')][_0x216d('0x4b')](_0x542e1b['body'],{})['then'](respondWithResult(_0x1f2fa5,0xc9))[_0x216d('0x4c')](handleError(_0x1f2fa5,null));};exports[_0x216d('0x27')]=function(_0x3932a3,_0x1340fe){if(_0x3932a3[_0x216d('0x4d')]['id']){delete _0x3932a3[_0x216d('0x4d')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x3932a3[_0x216d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1340fe,null))[_0x216d('0x28')](saveUpdates(_0x3932a3[_0x216d('0x4d')],null))['then'](respondWithResult(_0x1340fe,null))['catch'](handleError(_0x1340fe,null));};exports['destroy']=function(_0x4bac14,_0x1ae9b7){return db[_0x216d('0x2e')][_0x216d('0x4a')]({'where':{'id':_0x4bac14[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x1ae9b7,null))[_0x216d('0x28')](removeEntity(_0x1ae9b7,null))[_0x216d('0x4c')](handleError(_0x1ae9b7,null));};exports['getConfigurations']=function(_0x3f70c9,_0x34cdb9,_0x119b12){var _0x54dd49={};var _0x1e1caf={};var _0x10fe2e;var _0x2c7c67;return db[_0x216d('0x2e')]['findOne']({'where':{'id':_0x3f70c9[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x34cdb9,null))[_0x216d('0x28')](function(_0x1a4761){if(_0x1a4761){_0x10fe2e=_0x1a4761;_0x1e1caf['model']=_[_0x216d('0x34')](db[_0x216d('0x4f')]['rawAttributes']);_0x1e1caf[_0x216d('0x35')]=_['keys'](_0x3f70c9[_0x216d('0x35')]);_0x1e1caf[_0x216d('0x36')]=_[_0x216d('0x37')](_0x1e1caf[_0x216d('0x32')],_0x1e1caf[_0x216d('0x35')]);_0x54dd49[_0x216d('0x38')]=_[_0x216d('0x37')](_0x1e1caf[_0x216d('0x32')],qs[_0x216d('0x39')](_0x3f70c9['query'][_0x216d('0x39')]));_0x54dd49[_0x216d('0x38')]=_0x54dd49['attributes'][_0x216d('0x3a')]?_0x54dd49[_0x216d('0x38')]:_0x1e1caf['model'];_0x54dd49['order']=qs[_0x216d('0x3e')](_0x3f70c9['query'][_0x216d('0x3e')]);_0x54dd49[_0x216d('0x42')]=qs[_0x216d('0x36')](_['pick'](_0x3f70c9[_0x216d('0x35')],_0x1e1caf['filters']));if(_0x3f70c9['query'][_0x216d('0x40')]){_0x54dd49[_0x216d('0x42')]=_['merge'](_0x54dd49[_0x216d('0x42')],{'$or':_[_0x216d('0x2d')](_0x54dd49[_0x216d('0x38')],function(_0x3f9097){var _0x2ae667={};_0x2ae667[_0x3f9097]={'$like':'%'+_0x3f70c9[_0x216d('0x35')]['filter']+'%'};return _0x2ae667;})});}_0x54dd49=_['merge']({},_0x54dd49,_0x3f70c9[_0x216d('0x44')]);return _0x10fe2e[_0x216d('0x50')](_0x54dd49);}})[_0x216d('0x28')](function(_0x1551b6){if(_0x1551b6){_0x2c7c67=_0x1551b6[_0x216d('0x3a')];if(!_0x3f70c9[_0x216d('0x35')][_0x216d('0x3b')](_0x216d('0x3c'))){_0x54dd49[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x3f70c9[_0x216d('0x35')][_0x216d('0x21')]);_0x54dd49['offset']=qs['offset'](_0x3f70c9[_0x216d('0x35')][_0x216d('0x1f')]);}return _0x10fe2e['getConfigurations'](_0x54dd49);}})[_0x216d('0x28')](function(_0x5eb684){if(_0x5eb684){return _0x5eb684?{'count':_0x2c7c67,'rows':_0x5eb684}:null;}})['then'](respondWithResult(_0x34cdb9,null))[_0x216d('0x4c')](handleError(_0x34cdb9,null));};exports[_0x216d('0x51')]=function(_0x20806e,_0x17ce26,_0x1d404c){if(_0x20806e[_0x216d('0x4d')]['id']){delete _0x20806e[_0x216d('0x4d')]['id'];}return db[_0x216d('0x2e')][_0x216d('0x52')]({'where':{'id':_0x20806e[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x17ce26,null))[_0x216d('0x28')](function(_0x19c7cf){if(_0x19c7cf){_0x20806e[_0x216d('0x4d')][_0x216d('0x53')]=_0x19c7cf['id'];_0x20806e[_0x216d('0x4d')][_0x216d('0x54')]=integrations[_0x216d('0x55')](_0x20806e[_0x216d('0x4d')][_0x216d('0x56')],_0x20806e[_0x216d('0x4d')][_0x216d('0x31')]);_0x20806e['body'][_0x216d('0x57')]=integrations['getDescriptions'](_0x20806e[_0x216d('0x4d')]['channel'],_0x20806e[_0x216d('0x4d')][_0x216d('0x31')]);return db['ZendeskConfiguration'][_0x216d('0x4b')](_0x20806e[_0x216d('0x4d')],{'include':[{'model':db[_0x216d('0x58')],'as':_0x216d('0x54')},{'model':db[_0x216d('0x58')],'as':_0x216d('0x57')}]});}return null;})[_0x216d('0x28')](respondWithResult(_0x17ce26,null))[_0x216d('0x4c')](handleError(_0x17ce26,null));};exports[_0x216d('0x59')]=function(_0x5acc44,_0x120f8a,_0x299cc7){var _0x16cf09='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x5acc44['params']['id']},'attributes':['id','username',_0x216d('0x5a'),'token',_0x216d('0x5b'),_0x216d('0x5c')]})[_0x216d('0x28')](handleEntityNotFound(_0x120f8a,null))[_0x216d('0x28')](function(_0x431014){if(_0x431014){_0x16cf09=_0x431014[_0x216d('0x5c')];var _0x3a2e7c=_0x16cf09[_0x216d('0x5d')](-0x1);if(_0x3a2e7c==='/'){_0x16cf09=_0x16cf09[_0x216d('0x5e')](0x0,_0x16cf09['lastIndexOf'](_0x3a2e7c));}var _0x4e4e1a={'method':_0x216d('0x5f'),'uri':util['format'](_0x216d('0x60'),_0x16cf09,_0x216d('0x61')),'json':!![]};switch(_0x431014[_0x216d('0x5b')]){case _0x216d('0x5a'):_0x4e4e1a[_0x216d('0x62')]={'Authorization':util[_0x216d('0x63')]('Basic\x20%s',new Buffer(util['format'](_0x216d('0x64'),_0x431014['username'],_0x431014[_0x216d('0x5a')]))[_0x216d('0x65')](_0x216d('0x66')))};break;case'token':_0x4e4e1a['headers']={'Authorization':util['format'](_0x216d('0x67'),new Buffer(util[_0x216d('0x63')](_0x216d('0x68'),_0x431014[_0x216d('0x69')],_0x431014['token']))[_0x216d('0x65')](_0x216d('0x66')))};break;default:throw new db[(_0x216d('0x6a'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x4e4e1a);}})[_0x216d('0x28')](function(_0x87511b){if(_0x87511b){var _0x273d11=[_0x216d('0x6b'),_0x216d('0x6c'),'group',_0x216d('0x6d')];_[_0x216d('0x6e')](_0x87511b[_0x216d('0x61')],function(_0x325bd8){return _0x273d11['includes'](_0x325bd8[_0x216d('0x31')]);});return{'count':_0x87511b['ticket_fields'][_0x216d('0x3a')],'rows':_['map'](_0x87511b[_0x216d('0x61')],function(_0x3ae6df){return{'id':_0x3ae6df['id'],'name':_0x3ae6df[_0x216d('0x6f')]>0x7?_0x3ae6df[_0x216d('0x70')]:_0x3ae6df[_0x216d('0x31')],'custom':_0x3ae6df['position']>0x7?!![]:![],'options':_0x3ae6df[_0x216d('0x71')]?_0x3ae6df['system_field_options']:_0x3ae6df['custom_field_options']?_0x3ae6df['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x120f8a,null))[_0x216d('0x4c')](function(_0x38e7d7){var _0xa1594b=_0x5acc44['query']['test']?0x1f4:_0x38e7d7[_0x216d('0x72')]||0x1f4;logger[_0x216d('0x2a')](_0x216d('0x73'),_0x216d('0x59'),_0xa1594b,JSON[_0x216d('0x74')](_0x38e7d7));delete _0x38e7d7['name'];if(_0xa1594b===0x191){_0xa1594b=0x190;}_0x120f8a['status'](_0xa1594b)[_0x216d('0x75')](_0x5acc44['query'][_0x216d('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x38e7d7[_0x216d('0x72')]}:_0x38e7d7);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16a0=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x415264,_0x4e71cc){var _0x305b9e=function(_0x25bde5){while(--_0x25bde5){_0x415264['push'](_0x415264['shift']());}};_0x305b9e(++_0x4e71cc);}(_0x16a0,0x1c5));var _0x016a=function(_0x32f6b6,_0x3a2238){_0x32f6b6=_0x32f6b6-0x0;var _0x5c2229=_0x16a0[_0x32f6b6];return _0x5c2229;};'use strict';var _=require(_0x016a('0x0'));var util=require(_0x016a('0x1'));var logger=require('../../config/logger')(_0x016a('0x2'));var moment=require(_0x016a('0x3'));var BPromise=require(_0x016a('0x4'));var rp=require(_0x016a('0x5'));var fs=require('fs');var path=require(_0x016a('0x6'));var rimraf=require(_0x016a('0x7'));var config=require(_0x016a('0x8'));var attributes=require(_0x016a('0x9'));var integrations=require(_0x016a('0xa'));module[_0x016a('0xb')]=function(_0xb9e274,_0x51c747){return _0xb9e274[_0x016a('0xc')](_0x016a('0xd'),attributes,{'tableName':_0x016a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5470=['bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','../../config/logger','api','moment'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x5470,0xe1));var _0x0547=function(_0x182f58,_0x46dceb){_0x182f58=_0x182f58-0x0;var _0x2cb073=_0x5470[_0x182f58];return _0x2cb073;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0547('0x0'))(_0x0547('0x1'));var moment=require(_0x0547('0x2'));var BPromise=require(_0x0547('0x3'));var rp=require(_0x0547('0x4'));var fs=require('fs');var path=require(_0x0547('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0547('0x6'));var integrations=require(_0x0547('0x7'));module[_0x0547('0x8')]=function(_0x9fa977,_0x1e9ad1){return _0x9fa977[_0x0547('0x9')](_0x0547('0xa'),attributes,{'tableName':_0x0547('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34c5=['options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll'];(function(_0x459025,_0x13e37f){var _0x15815e=function(_0x754c0d){while(--_0x754c0d){_0x459025['push'](_0x459025['shift']());}};_0x15815e(++_0x13e37f);}(_0x34c5,0x11b));var _0x534c=function(_0x51d0ef,_0x16d5cd){_0x51d0ef=_0x51d0ef-0x0;var _0x29815d=_0x34c5[_0x51d0ef];return _0x29815d;};'use strict';var _=require(_0x534c('0x0'));var util=require('util');var moment=require(_0x534c('0x1'));var BPromise=require('bluebird');var rs=require(_0x534c('0x2'));var fs=require('fs');var Redis=require(_0x534c('0x3'));var db=require(_0x534c('0x4'))['db'];var utils=require(_0x534c('0x5'));var logger=require(_0x534c('0x6'))('rpc');var config=require(_0x534c('0x7'));var jayson=require(_0x534c('0x8'));var client=jayson[_0x534c('0x9')][_0x534c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x418323,_0x5545fd,_0x2b91d8){return new BPromise(function(_0x214503,_0x50935d){return client[_0x534c('0xb')](_0x418323,_0x2b91d8)[_0x534c('0xc')](function(_0x2cd87e){logger[_0x534c('0xd')](_0x534c('0xe'),_0x5545fd,_0x534c('0xf'));logger[_0x534c('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x5545fd,_0x534c('0xf'),JSON[_0x534c('0x11')](_0x2cd87e));if(_0x2cd87e[_0x534c('0x12')]){if(_0x2cd87e['error'][_0x534c('0x13')]===0x1f4){logger['error'](_0x534c('0xe'),_0x5545fd,_0x2cd87e[_0x534c('0x12')]['message']);return _0x50935d(_0x2cd87e[_0x534c('0x12')][_0x534c('0x14')]);}logger[_0x534c('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x5545fd,_0x2cd87e['error'][_0x534c('0x14')]);return _0x214503(_0x2cd87e[_0x534c('0x12')][_0x534c('0x14')]);}else{logger[_0x534c('0xd')](_0x534c('0xe'),_0x5545fd,_0x534c('0xf'));_0x214503(_0x2cd87e[_0x534c('0x15')][_0x534c('0x14')]);}})['catch'](function(_0x5ce36b){logger['error'](_0x534c('0xe'),_0x5545fd,_0x5ce36b);_0x50935d(_0x5ce36b);});});}exports['GetZendeskAccount']=function(_0x162761){var _0x5b7eba=this;return new Promise(function(_0x21b132,_0x6fce5c){return db['ZendeskAccount'][_0x534c('0x16')]({'raw':_0x162761['options']?_0x162761[_0x534c('0x17')][_0x534c('0x18')]===undefined?!![]:![]:!![],'where':_0x162761[_0x534c('0x17')]?_0x162761['options'][_0x534c('0x19')]||null:null,'attributes':_0x162761['options']?_0x162761[_0x534c('0x17')][_0x534c('0x1a')]||null:null,'limit':_0x162761['options']?_0x162761[_0x534c('0x17')][_0x534c('0x1b')]||null:null,'include':_0x162761['options']?_0x162761[_0x534c('0x17')]['include']?_['map'](_0x162761[_0x534c('0x17')][_0x534c('0x1c')],function(_0x2f8725){return{'model':db[_0x2f8725['model']],'as':_0x2f8725['as'],'attributes':_0x2f8725[_0x534c('0x1a')],'include':_0x2f8725[_0x534c('0x1c')]?_[_0x534c('0x1d')](_0x2f8725[_0x534c('0x1c')],function(_0x1a2e4e){return{'model':db[_0x1a2e4e['model']],'as':_0x1a2e4e['as'],'attributes':_0x1a2e4e[_0x534c('0x1a')],'include':_0x1a2e4e[_0x534c('0x1c')]?_[_0x534c('0x1d')](_0x1a2e4e[_0x534c('0x1c')],function(_0x1be2f4){return{'model':db[_0x1be2f4[_0x534c('0x1e')]],'as':_0x1be2f4['as'],'attributes':_0x1be2f4[_0x534c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x534c('0xc')](function(_0x2e006a){logger[_0x534c('0xd')]('GetZendeskAccount',_0x162761);logger['debug']('GetZendeskAccount',_0x162761,JSON[_0x534c('0x11')](_0x2e006a));_0x21b132(_0x2e006a);})['catch'](function(_0x4c6330){logger[_0x534c('0x12')](_0x534c('0x1f'),_0x4c6330['message'],_0x162761);_0x6fce5c(_0x5b7eba[_0x534c('0x12')](0x1f4,_0x4c6330[_0x534c('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x430ca8){var _0x5856a7=this;return new Promise(function(_0x430716,_0x55fbfa){return db['ZendeskAccount']['find']({'raw':_0x430ca8[_0x534c('0x17')]?_0x430ca8['options']['raw']===undefined?!![]:![]:!![],'where':_0x430ca8[_0x534c('0x17')]?_0x430ca8[_0x534c('0x17')][_0x534c('0x19')]||null:null,'attributes':_0x430ca8[_0x534c('0x17')]?_0x430ca8[_0x534c('0x17')][_0x534c('0x1a')]||null:null,'include':_0x430ca8[_0x534c('0x17')]?_0x430ca8[_0x534c('0x17')][_0x534c('0x1c')]?_[_0x534c('0x1d')](_0x430ca8[_0x534c('0x17')][_0x534c('0x1c')],function(_0xbb2b0d){return{'model':db[_0xbb2b0d[_0x534c('0x1e')]],'as':_0xbb2b0d['as'],'attributes':_0xbb2b0d[_0x534c('0x1a')],'include':_0xbb2b0d[_0x534c('0x1c')]?_[_0x534c('0x1d')](_0xbb2b0d[_0x534c('0x1c')],function(_0x386e0d){return{'model':db[_0x386e0d[_0x534c('0x1e')]],'as':_0x386e0d['as'],'attributes':_0x386e0d[_0x534c('0x1a')],'include':_0x386e0d['include']?_[_0x534c('0x1d')](_0x386e0d[_0x534c('0x1c')],function(_0x3ec4a9){return{'model':db[_0x3ec4a9[_0x534c('0x1e')]],'as':_0x3ec4a9['as'],'attributes':_0x3ec4a9[_0x534c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x534c('0xc')](function(_0x4f6b10){logger[_0x534c('0xd')](_0x534c('0x20'),_0x430ca8);logger['debug']('ShowZendeskAccount',_0x430ca8,JSON[_0x534c('0x11')](_0x4f6b10));_0x430716(_0x4f6b10);})[_0x534c('0x21')](function(_0xd7b59){logger['error'](_0x534c('0x20'),_0xd7b59[_0x534c('0x14')],_0x430ca8);_0x55fbfa(_0x5856a7[_0x534c('0x12')](0x1f4,_0xd7b59[_0x534c('0x14')]));});});};
\ No newline at end of file
+var _0x147c=['raw','where','include','model','attributes','map','debug','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options'];(function(_0x27bfe2,_0x45680d){var _0x1d392b=function(_0x5d42c5){while(--_0x5d42c5){_0x27bfe2['push'](_0x27bfe2['shift']());}};_0x1d392b(++_0x45680d);}(_0x147c,0x91));var _0xc147=function(_0x28e71a,_0x4405bd){_0x28e71a=_0x28e71a-0x0;var _0x268fed=_0x147c[_0x28e71a];return _0x268fed;};'use strict';var _=require(_0xc147('0x0'));var util=require(_0xc147('0x1'));var moment=require(_0xc147('0x2'));var BPromise=require(_0xc147('0x3'));var rs=require(_0xc147('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc147('0x5'))['db'];var utils=require(_0xc147('0x6'));var logger=require(_0xc147('0x7'))(_0xc147('0x8'));var config=require(_0xc147('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc147('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x340168,_0xb3d2e8,_0x1027ee){return new BPromise(function(_0x118c0d,_0x23a311){return client[_0xc147('0xb')](_0x340168,_0x1027ee)[_0xc147('0xc')](function(_0x2cb110){logger[_0xc147('0xd')](_0xc147('0xe'),_0xb3d2e8,'request\x20sent');logger['debug'](_0xc147('0xf'),_0xb3d2e8,'request\x20sent',JSON[_0xc147('0x10')](_0x2cb110));if(_0x2cb110[_0xc147('0x11')]){if(_0x2cb110[_0xc147('0x11')][_0xc147('0x12')]===0x1f4){logger['error'](_0xc147('0xe'),_0xb3d2e8,_0x2cb110[_0xc147('0x11')][_0xc147('0x13')]);return _0x23a311(_0x2cb110[_0xc147('0x11')][_0xc147('0x13')]);}logger['error'](_0xc147('0xe'),_0xb3d2e8,_0x2cb110[_0xc147('0x11')][_0xc147('0x13')]);return _0x118c0d(_0x2cb110[_0xc147('0x11')]['message']);}else{logger['info'](_0xc147('0xe'),_0xb3d2e8,'request\x20sent');_0x118c0d(_0x2cb110[_0xc147('0x14')][_0xc147('0x13')]);}})[_0xc147('0x15')](function(_0x171b5e){logger['error'](_0xc147('0xe'),_0xb3d2e8,_0x171b5e);_0x23a311(_0x171b5e);});});}exports[_0xc147('0x16')]=function(_0x2845e1){var _0x30487e=this;return new Promise(function(_0x86e7ad,_0x264ac6){return db[_0xc147('0x17')]['findAll']({'raw':_0x2845e1[_0xc147('0x18')]?_0x2845e1[_0xc147('0x18')][_0xc147('0x19')]===undefined?!![]:![]:!![],'where':_0x2845e1[_0xc147('0x18')]?_0x2845e1[_0xc147('0x18')][_0xc147('0x1a')]||null:null,'attributes':_0x2845e1['options']?_0x2845e1[_0xc147('0x18')]['attributes']||null:null,'limit':_0x2845e1[_0xc147('0x18')]?_0x2845e1[_0xc147('0x18')]['limit']||null:null,'include':_0x2845e1[_0xc147('0x18')]?_0x2845e1[_0xc147('0x18')]['include']?_['map'](_0x2845e1['options'][_0xc147('0x1b')],function(_0x5e6987){return{'model':db[_0x5e6987[_0xc147('0x1c')]],'as':_0x5e6987['as'],'attributes':_0x5e6987[_0xc147('0x1d')],'include':_0x5e6987[_0xc147('0x1b')]?_[_0xc147('0x1e')](_0x5e6987['include'],function(_0x29e779){return{'model':db[_0x29e779[_0xc147('0x1c')]],'as':_0x29e779['as'],'attributes':_0x29e779['attributes'],'include':_0x29e779['include']?_[_0xc147('0x1e')](_0x29e779['include'],function(_0x4b1bfc){return{'model':db[_0x4b1bfc[_0xc147('0x1c')]],'as':_0x4b1bfc['as'],'attributes':_0x4b1bfc[_0xc147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc147('0xc')](function(_0x4a70db){logger[_0xc147('0xd')](_0xc147('0x16'),_0x2845e1);logger[_0xc147('0x1f')](_0xc147('0x16'),_0x2845e1,JSON[_0xc147('0x10')](_0x4a70db));_0x86e7ad(_0x4a70db);})[_0xc147('0x15')](function(_0x16bbbe){logger[_0xc147('0x11')]('GetZendeskAccount',_0x16bbbe[_0xc147('0x13')],_0x2845e1);_0x264ac6(_0x30487e[_0xc147('0x11')](0x1f4,_0x16bbbe['message']));});});};exports[_0xc147('0x20')]=function(_0x99d785){var _0x1f111e=this;return new Promise(function(_0x43372f,_0x5e9bee){return db[_0xc147('0x17')][_0xc147('0x21')]({'raw':_0x99d785[_0xc147('0x18')]?_0x99d785[_0xc147('0x18')][_0xc147('0x19')]===undefined?!![]:![]:!![],'where':_0x99d785['options']?_0x99d785['options']['where']||null:null,'attributes':_0x99d785['options']?_0x99d785[_0xc147('0x18')][_0xc147('0x1d')]||null:null,'include':_0x99d785[_0xc147('0x18')]?_0x99d785[_0xc147('0x18')][_0xc147('0x1b')]?_[_0xc147('0x1e')](_0x99d785[_0xc147('0x18')]['include'],function(_0x2e1bad){return{'model':db[_0x2e1bad[_0xc147('0x1c')]],'as':_0x2e1bad['as'],'attributes':_0x2e1bad['attributes'],'include':_0x2e1bad['include']?_[_0xc147('0x1e')](_0x2e1bad[_0xc147('0x1b')],function(_0x3c7d7c){return{'model':db[_0x3c7d7c['model']],'as':_0x3c7d7c['as'],'attributes':_0x3c7d7c[_0xc147('0x1d')],'include':_0x3c7d7c[_0xc147('0x1b')]?_['map'](_0x3c7d7c[_0xc147('0x1b')],function(_0xca26b5){return{'model':db[_0xca26b5[_0xc147('0x1c')]],'as':_0xca26b5['as'],'attributes':_0xca26b5[_0xc147('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56e447){logger[_0xc147('0xd')](_0xc147('0x20'),_0x99d785);logger[_0xc147('0x1f')](_0xc147('0x20'),_0x99d785,JSON[_0xc147('0x10')](_0x56e447));_0x43372f(_0x56e447);})[_0xc147('0x15')](function(_0x374fd1){logger[_0xc147('0x11')](_0xc147('0x20'),_0x374fd1[_0xc147('0x13')],_0x99d785);_0x5e9bee(_0x1f111e[_0xc147('0x11')](0x1f4,_0x374fd1['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x8ae3e7,_0x58d8f8){var _0x395dcc=function(_0x2b084d){while(--_0x2b084d){_0x8ae3e7['push'](_0x8ae3e7['shift']());}};_0x395dcc(++_0x58d8f8);}(_0x5eb8,0xb0));var _0x85eb=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x5eb8[_0x6978c0];return _0x361377;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x5bd98b,_0x22bf1c){var _0x49efe7=function(_0x2223e8){while(--_0x2223e8){_0x5bd98b['push'](_0x5bd98b['shift']());}};_0x49efe7(++_0x22bf1c);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfdbd=['exports','STRING'];(function(_0x461da3,_0x5a4717){var _0x5f3cc8=function(_0x541c97){while(--_0x541c97){_0x461da3['push'](_0x461da3['shift']());}};_0x5f3cc8(++_0x5a4717);}(_0xfdbd,0x168));var _0xdfdb=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0xfdbd[_0x19f8ee];return _0x3b68f2;};'use strict';var Sequelize=require('sequelize');module[_0xdfdb('0x0')]={'name':{'type':Sequelize[_0xdfdb('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8f16=['STRING'];(function(_0x2b7537,_0x2727d3){var _0xf15088=function(_0x284252){while(--_0x284252){_0x2b7537['push'](_0x2b7537['shift']());}};_0xf15088(++_0x2727d3);}(_0x8f16,0xb2));var _0x68f1=function(_0x3e4d46,_0x4a5d1a){_0x3e4d46=_0x3e4d46-0x0;var _0x244d6b=_0x8f16[_0x3e4d46];return _0x244d6b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x68f1('0x0')]},'description':{'type':Sequelize[_0x68f1('0x0')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb2c=['sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','map','ZendeskConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','getFields','findOne','ZendeskField','order','pick','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x239d74,_0x1bdde0){var _0x568bb6=function(_0x4bb7fb){while(--_0x4bb7fb){_0x239d74['push'](_0x239d74['shift']());}};_0x568bb6(++_0x1bdde0);}(_0xcb2c,0x8d));var _0xccb2=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xcb2c[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require(_0xccb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccb2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccb2('0x2'));var moment=require(_0xccb2('0x3'));var BPromise=require(_0xccb2('0x4'));var Mustache=require(_0xccb2('0x5'));var util=require(_0xccb2('0x6'));var path=require('path');var sox=require(_0xccb2('0x7'));var csv=require('to-csv');var ejs=require(_0xccb2('0x8'));var fs=require('fs');var fs_extra=require(_0xccb2('0x9'));var _=require('lodash');var squel=require(_0xccb2('0xa'));var crypto=require(_0xccb2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xccb2('0xc'));var querystring=require('querystring');var Papa=require(_0xccb2('0xd'));var Redis=require(_0xccb2('0xe'));var authService=require(_0xccb2('0xf'));var qs=require(_0xccb2('0x10'));var as=require(_0xccb2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccb2('0x12'))(_0xccb2('0x13'));var utils=require(_0xccb2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xccb2('0x15'));var db=require(_0xccb2('0x16'))['db'];function respondWithStatusCode(_0x353cbe,_0x9c3e94){_0x9c3e94=_0x9c3e94||0xcc;return function(_0x2870e6){if(_0x2870e6){return _0x353cbe[_0xccb2('0x17')](_0x9c3e94);}return _0x353cbe['status'](_0x9c3e94)['end']();};}function respondWithResult(_0x37fc7a,_0x57e6f1){_0x57e6f1=_0x57e6f1||0xc8;return function(_0x5a54eb){if(_0x5a54eb){return _0x37fc7a[_0xccb2('0x18')](_0x57e6f1)[_0xccb2('0x19')](_0x5a54eb);}};}function respondWithFilteredResult(_0x112188,_0x566168){return function(_0x5204da){if(_0x5204da){var _0x5ee7e4=typeof _0x566168['offset']===_0xccb2('0x1a')&&typeof _0x566168['limit']===_0xccb2('0x1a');var _0x392024=_0x5204da[_0xccb2('0x1b')];var _0xd9a4d0=_0x5ee7e4?0x0:_0x566168[_0xccb2('0x1c')];var _0x2f1fc3=_0x5ee7e4?_0x5204da[_0xccb2('0x1b')]:_0x566168[_0xccb2('0x1c')]+_0x566168[_0xccb2('0x1d')];var _0x4af5a5;if(_0x2f1fc3>=_0x392024){_0x2f1fc3=_0x392024;_0x4af5a5=0xc8;}else{_0x4af5a5=0xce;}_0x112188[_0xccb2('0x18')](_0x4af5a5);return _0x112188[_0xccb2('0x1e')]('Content-Range',_0xd9a4d0+'-'+_0x2f1fc3+'/'+_0x392024)[_0xccb2('0x19')](_0x5204da);}return null;};}function patchUpdates(_0x46a466){return function(_0xf17b4b){try{jsonpatch[_0xccb2('0x1f')](_0xf17b4b,_0x46a466,!![]);}catch(_0x10266a){return BPromise[_0xccb2('0x20')](_0x10266a);}return _0xf17b4b[_0xccb2('0x21')]();};}function saveUpdates(_0x259ef5,_0xce16cb){return function(_0x28d90f){if(_0x28d90f){return _0x28d90f[_0xccb2('0x22')](_0x259ef5)[_0xccb2('0x23')](function(_0x2aac9f){return _0x2aac9f;});}return null;};}function removeEntity(_0x2d58eb,_0x225618){return function(_0x4195c2){if(_0x4195c2){return _0x4195c2[_0xccb2('0x24')]()[_0xccb2('0x23')](function(){_0x2d58eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b15a6,_0x331fe9){return function(_0x5b51da){if(!_0x5b51da){_0x3b15a6[_0xccb2('0x17')](0x194);}return _0x5b51da;};}function handleError(_0xdab10d,_0x27f04d){_0x27f04d=_0x27f04d||0x1f4;return function(_0x5d6f33){logger[_0xccb2('0x25')](_0x5d6f33['stack']);if(_0x5d6f33[_0xccb2('0x26')]){delete _0x5d6f33['name'];}_0xdab10d[_0xccb2('0x18')](_0x27f04d)['send'](_0x5d6f33);};}exports['index']=function(_0x386d6c,_0x503287){var _0x3a88e4={},_0x5b77cc={},_0x26bcf2={'count':0x0,'rows':[]};var _0x37519f=_[_0xccb2('0x27')](db[_0xccb2('0x28')]['rawAttributes'],function(_0x358862){return{'name':_0x358862[_0xccb2('0x29')],'type':_0x358862[_0xccb2('0x2a')][_0xccb2('0x2b')]};});_0x5b77cc[_0xccb2('0x2c')]=_['map'](_0x37519f,_0xccb2('0x26'));_0x5b77cc[_0xccb2('0x2d')]=_['keys'](_0x386d6c[_0xccb2('0x2d')]);_0x5b77cc[_0xccb2('0x2e')]=_[_0xccb2('0x2f')](_0x5b77cc[_0xccb2('0x2c')],_0x5b77cc[_0xccb2('0x2d')]);_0x3a88e4[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x5b77cc[_0xccb2('0x2c')],qs['fields'](_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x3a88e4[_0xccb2('0x30')]=_0x3a88e4[_0xccb2('0x30')][_0xccb2('0x32')]?_0x3a88e4[_0xccb2('0x30')]:_0x5b77cc['model'];if(!_0x386d6c['query']['hasOwnProperty'](_0xccb2('0x33'))){_0x3a88e4[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x3a88e4['offset']=qs[_0xccb2('0x1c')](_0x386d6c['query']['offset']);}_0x3a88e4['order']=qs[_0xccb2('0x34')](_0x386d6c['query']['sort']);_0x3a88e4[_0xccb2('0x35')]=qs[_0xccb2('0x2e')](_['pick'](_0x386d6c[_0xccb2('0x2d')],_0x5b77cc['filters']),_0x37519f);if(_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x36')]){_0x3a88e4[_0xccb2('0x35')]=_[_0xccb2('0x37')](_0x3a88e4['where'],{'$or':_[_0xccb2('0x27')](_0x37519f,function(_0x2cb61c){if(_0x2cb61c[_0xccb2('0x2a')]!==_0xccb2('0x38')){var _0xafa8ce={};_0xafa8ce[_0x2cb61c['name']]={'$like':'%'+_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x36')]+'%'};return _0xafa8ce;}})});}_0x3a88e4=_[_0xccb2('0x37')]({},_0x3a88e4,_0x386d6c[_0xccb2('0x39')]);var _0x50d616={'where':_0x3a88e4[_0xccb2('0x35')]};return db[_0xccb2('0x28')][_0xccb2('0x1b')](_0x50d616)[_0xccb2('0x23')](function(_0x4a6978){_0x26bcf2[_0xccb2('0x1b')]=_0x4a6978;if(_0x386d6c[_0xccb2('0x2d')][_0xccb2('0x3a')]){_0x3a88e4[_0xccb2('0x3b')]=[{'all':!![]}];}return db[_0xccb2('0x28')][_0xccb2('0x3c')](_0x3a88e4);})[_0xccb2('0x23')](function(_0x50b9b3){_0x26bcf2[_0xccb2('0x3d')]=_0x50b9b3;return _0x26bcf2;})[_0xccb2('0x23')](respondWithFilteredResult(_0x503287,_0x3a88e4))[_0xccb2('0x3e')](handleError(_0x503287,null));};exports[_0xccb2('0x3f')]=function(_0x19090b,_0x41f5fd){var _0x2aa449={'raw':![],'where':{'id':_0x19090b[_0xccb2('0x40')]['id']}},_0x38b1b7={};_0x38b1b7[_0xccb2('0x2c')]=_[_0xccb2('0x41')](db[_0xccb2('0x28')][_0xccb2('0x42')]);_0x38b1b7[_0xccb2('0x2d')]=_['keys'](_0x19090b[_0xccb2('0x2d')]);_0x38b1b7[_0xccb2('0x2e')]=_['intersection'](_0x38b1b7['model'],_0x38b1b7[_0xccb2('0x2d')]);_0x2aa449[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x38b1b7[_0xccb2('0x2c')],qs[_0xccb2('0x31')](_0x19090b[_0xccb2('0x2d')]['fields']));_0x2aa449[_0xccb2('0x30')]=_0x2aa449['attributes'][_0xccb2('0x32')]?_0x2aa449['attributes']:_0x38b1b7[_0xccb2('0x2c')];if(_0x19090b[_0xccb2('0x2d')]['includeAll']){_0x2aa449['include']=[{'all':!![]}];}_0x2aa449=_[_0xccb2('0x37')]({},_0x2aa449,_0x19090b[_0xccb2('0x39')]);return db[_0xccb2('0x28')][_0xccb2('0x43')](_0x2aa449)['then'](handleEntityNotFound(_0x41f5fd,null))['then'](respondWithResult(_0x41f5fd,null))[_0xccb2('0x3e')](handleError(_0x41f5fd,null));};exports[_0xccb2('0x44')]=function(_0x544003,_0x585afb){return db[_0xccb2('0x28')]['create'](_0x544003['body'],{})['then'](respondWithResult(_0x585afb,0xc9))[_0xccb2('0x3e')](handleError(_0x585afb,null));};exports[_0xccb2('0x22')]=function(_0x1f1247,_0x3972ef){if(_0x1f1247['body']['id']){delete _0x1f1247[_0xccb2('0x45')]['id'];}return db[_0xccb2('0x28')]['find']({'where':{'id':_0x1f1247['params']['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x3972ef,null))[_0xccb2('0x23')](saveUpdates(_0x1f1247['body'],null))[_0xccb2('0x23')](respondWithResult(_0x3972ef,null))[_0xccb2('0x3e')](handleError(_0x3972ef,null));};exports[_0xccb2('0x24')]=function(_0x5a1fb6,_0x2dd12e){return db[_0xccb2('0x28')][_0xccb2('0x43')]({'where':{'id':_0x5a1fb6[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x2dd12e,null))[_0xccb2('0x23')](removeEntity(_0x2dd12e,null))['catch'](handleError(_0x2dd12e,null));};exports[_0xccb2('0x46')]=function(_0x232825,_0x1d3ef8,_0x256b83){var _0x17ab97={};var _0x33bc5d={};var _0x4bd5a7;var _0x4c7570;return db[_0xccb2('0x28')][_0xccb2('0x47')]({'where':{'id':_0x232825[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x1d3ef8,null))[_0xccb2('0x23')](function(_0x32eec5){if(_0x32eec5){_0x4bd5a7=_0x32eec5;_0x33bc5d[_0xccb2('0x2c')]=_['keys'](db[_0xccb2('0x48')][_0xccb2('0x42')]);_0x33bc5d['query']=_[_0xccb2('0x41')](_0x232825[_0xccb2('0x2d')]);_0x33bc5d[_0xccb2('0x2e')]=_[_0xccb2('0x2f')](_0x33bc5d[_0xccb2('0x2c')],_0x33bc5d[_0xccb2('0x2d')]);_0x17ab97[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x33bc5d[_0xccb2('0x2c')],qs[_0xccb2('0x31')](_0x232825[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x17ab97[_0xccb2('0x30')]=_0x17ab97[_0xccb2('0x30')][_0xccb2('0x32')]?_0x17ab97[_0xccb2('0x30')]:_0x33bc5d[_0xccb2('0x2c')];_0x17ab97[_0xccb2('0x49')]=qs[_0xccb2('0x34')](_0x232825[_0xccb2('0x2d')][_0xccb2('0x34')]);_0x17ab97[_0xccb2('0x35')]=qs['filters'](_[_0xccb2('0x4a')](_0x232825['query'],_0x33bc5d[_0xccb2('0x2e')]));if(_0x232825['query']['filter']){_0x17ab97[_0xccb2('0x35')]=_['merge'](_0x17ab97[_0xccb2('0x35')],{'$or':_[_0xccb2('0x27')](_0x17ab97[_0xccb2('0x30')],function(_0x9165fa){var _0x135a0a={};_0x135a0a[_0x9165fa]={'$like':'%'+_0x232825['query'][_0xccb2('0x36')]+'%'};return _0x135a0a;})});}_0x17ab97=_['merge']({},_0x17ab97,_0x232825['options']);return _0x4bd5a7[_0xccb2('0x46')](_0x17ab97);}})[_0xccb2('0x23')](function(_0x260558){if(_0x260558){_0x4c7570=_0x260558[_0xccb2('0x32')];if(!_0x232825[_0xccb2('0x2d')][_0xccb2('0x4b')](_0xccb2('0x33'))){_0x17ab97[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x232825[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x17ab97[_0xccb2('0x1c')]=qs[_0xccb2('0x1c')](_0x232825['query'][_0xccb2('0x1c')]);}return _0x4bd5a7[_0xccb2('0x46')](_0x17ab97);}})[_0xccb2('0x23')](function(_0x418563){if(_0x418563){return _0x418563?{'count':_0x4c7570,'rows':_0x418563}:null;}})[_0xccb2('0x23')](respondWithResult(_0x1d3ef8,null))[_0xccb2('0x3e')](handleError(_0x1d3ef8,null));};exports[_0xccb2('0x4c')]=function(_0x2914bd,_0xfaeb64,_0x1d54f6){var _0x3b4593={};var _0x487558={};var _0x484c25;var _0x1b7515;return db['ZendeskConfiguration'][_0xccb2('0x47')]({'where':{'id':_0x2914bd[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0xfaeb64,null))[_0xccb2('0x23')](function(_0x5cb717){if(_0x5cb717){_0x484c25=_0x5cb717;_0x487558[_0xccb2('0x2c')]=_[_0xccb2('0x41')](db[_0xccb2('0x48')][_0xccb2('0x42')]);_0x487558['query']=_['keys'](_0x2914bd[_0xccb2('0x2d')]);_0x487558[_0xccb2('0x2e')]=_['intersection'](_0x487558[_0xccb2('0x2c')],_0x487558[_0xccb2('0x2d')]);_0x3b4593[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x487558[_0xccb2('0x2c')],qs['fields'](_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x3b4593[_0xccb2('0x30')]=_0x3b4593[_0xccb2('0x30')][_0xccb2('0x32')]?_0x3b4593[_0xccb2('0x30')]:_0x487558[_0xccb2('0x2c')];_0x3b4593[_0xccb2('0x49')]=qs[_0xccb2('0x34')](_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x34')]);_0x3b4593[_0xccb2('0x35')]=qs[_0xccb2('0x2e')](_[_0xccb2('0x4a')](_0x2914bd[_0xccb2('0x2d')],_0x487558[_0xccb2('0x2e')]));if(_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x36')]){_0x3b4593[_0xccb2('0x35')]=_[_0xccb2('0x37')](_0x3b4593[_0xccb2('0x35')],{'$or':_[_0xccb2('0x27')](_0x3b4593[_0xccb2('0x30')],function(_0xcdecd5){var _0x51838f={};_0x51838f[_0xcdecd5]={'$like':'%'+_0x2914bd['query'][_0xccb2('0x36')]+'%'};return _0x51838f;})});}_0x3b4593=_[_0xccb2('0x37')]({},_0x3b4593,_0x2914bd['options']);return _0x484c25[_0xccb2('0x4c')](_0x3b4593);}})[_0xccb2('0x23')](function(_0x4a2582){if(_0x4a2582){_0x1b7515=_0x4a2582[_0xccb2('0x32')];if(!_0x2914bd[_0xccb2('0x2d')][_0xccb2('0x4b')](_0xccb2('0x33'))){_0x3b4593[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x2914bd['query'][_0xccb2('0x1d')]);_0x3b4593[_0xccb2('0x1c')]=qs[_0xccb2('0x1c')](_0x2914bd[_0xccb2('0x2d')]['offset']);}return _0x484c25[_0xccb2('0x4c')](_0x3b4593);}})[_0xccb2('0x23')](function(_0x4a95e1){if(_0x4a95e1){return _0x4a95e1?{'count':_0x1b7515,'rows':_0x4a95e1}:null;}})[_0xccb2('0x23')](respondWithResult(_0xfaeb64,null))['catch'](handleError(_0xfaeb64,null));};exports[_0xccb2('0x4d')]=function(_0x537d8f,_0x54452e,_0x5d3fbc){var _0x482b82={};var _0x555608={};var _0x23a7ef;var _0x5da759;return db[_0xccb2('0x28')]['findOne']({'where':{'id':_0x537d8f['params']['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x54452e,null))[_0xccb2('0x23')](function(_0x528cd3){if(_0x528cd3){_0x23a7ef=_0x528cd3;_0x555608['model']=_[_0xccb2('0x41')](db[_0xccb2('0x48')][_0xccb2('0x42')]);_0x555608[_0xccb2('0x2d')]=_[_0xccb2('0x41')](_0x537d8f[_0xccb2('0x2d')]);_0x555608[_0xccb2('0x2e')]=_['intersection'](_0x555608[_0xccb2('0x2c')],_0x555608['query']);_0x482b82[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x555608['model'],qs[_0xccb2('0x31')](_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x482b82[_0xccb2('0x30')]=_0x482b82[_0xccb2('0x30')]['length']?_0x482b82[_0xccb2('0x30')]:_0x555608[_0xccb2('0x2c')];_0x482b82['order']=qs[_0xccb2('0x34')](_0x537d8f[_0xccb2('0x2d')]['sort']);_0x482b82[_0xccb2('0x35')]=qs['filters'](_[_0xccb2('0x4a')](_0x537d8f[_0xccb2('0x2d')],_0x555608[_0xccb2('0x2e')]));if(_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x36')]){_0x482b82[_0xccb2('0x35')]=_['merge'](_0x482b82[_0xccb2('0x35')],{'$or':_['map'](_0x482b82[_0xccb2('0x30')],function(_0x335efc){var _0x9d30e1={};_0x9d30e1[_0x335efc]={'$like':'%'+_0x537d8f[_0xccb2('0x2d')]['filter']+'%'};return _0x9d30e1;})});}_0x482b82=_[_0xccb2('0x37')]({},_0x482b82,_0x537d8f[_0xccb2('0x39')]);return _0x23a7ef[_0xccb2('0x4d')](_0x482b82);}})[_0xccb2('0x23')](function(_0x16169b){if(_0x16169b){_0x5da759=_0x16169b['length'];if(!_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x4b')](_0xccb2('0x33'))){_0x482b82[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x482b82[_0xccb2('0x1c')]=qs['offset'](_0x537d8f[_0xccb2('0x2d')][_0xccb2('0x1c')]);}return _0x23a7ef[_0xccb2('0x4d')](_0x482b82);}})[_0xccb2('0x23')](function(_0x3dd5fa){if(_0x3dd5fa){return _0x3dd5fa?{'count':_0x5da759,'rows':_0x3dd5fa}:null;}})['then'](respondWithResult(_0x54452e,null))['catch'](handleError(_0x54452e,null));};exports['getTags']=function(_0x36125a,_0x5f12b9,_0x4c6866){var _0x5f111c={};var _0x16b60d={};var _0x598ea3;var _0x39b85c;return db['ZendeskConfiguration'][_0xccb2('0x47')]({'where':{'id':_0x36125a[_0xccb2('0x40')]['id']}})[_0xccb2('0x23')](handleEntityNotFound(_0x5f12b9,null))[_0xccb2('0x23')](function(_0x20f30e){if(_0x20f30e){_0x598ea3=_0x20f30e;_0x16b60d[_0xccb2('0x2c')]=_['keys'](db[_0xccb2('0x4e')]['rawAttributes']);_0x16b60d[_0xccb2('0x2d')]=_[_0xccb2('0x41')](_0x36125a['query']);_0x16b60d[_0xccb2('0x2e')]=_[_0xccb2('0x2f')](_0x16b60d[_0xccb2('0x2c')],_0x16b60d[_0xccb2('0x2d')]);_0x5f111c[_0xccb2('0x30')]=_[_0xccb2('0x2f')](_0x16b60d['model'],qs[_0xccb2('0x31')](_0x36125a[_0xccb2('0x2d')][_0xccb2('0x31')]));_0x5f111c[_0xccb2('0x30')]=_0x5f111c[_0xccb2('0x30')][_0xccb2('0x32')]?_0x5f111c[_0xccb2('0x30')]:_0x16b60d[_0xccb2('0x2c')];_0x5f111c['order']=qs['sort'](_0x36125a[_0xccb2('0x2d')][_0xccb2('0x34')]);_0x5f111c[_0xccb2('0x35')]=qs[_0xccb2('0x2e')](_[_0xccb2('0x4a')](_0x36125a['query'],_0x16b60d[_0xccb2('0x2e')]));if(_0x36125a['query'][_0xccb2('0x36')]){_0x5f111c[_0xccb2('0x35')]=_[_0xccb2('0x37')](_0x5f111c[_0xccb2('0x35')],{'$or':_['map'](_0x5f111c[_0xccb2('0x30')],function(_0x3c8e1f){var _0x2bc0b7={};_0x2bc0b7[_0x3c8e1f]={'$like':'%'+_0x36125a['query'][_0xccb2('0x36')]+'%'};return _0x2bc0b7;})});}_0x5f111c=_[_0xccb2('0x37')]({},_0x5f111c,_0x36125a[_0xccb2('0x39')]);return _0x598ea3[_0xccb2('0x4f')](_0x5f111c);}})[_0xccb2('0x23')](function(_0x2b73a5){if(_0x2b73a5){_0x39b85c=_0x2b73a5['length'];if(!_0x36125a[_0xccb2('0x2d')]['hasOwnProperty'](_0xccb2('0x33'))){_0x5f111c[_0xccb2('0x1d')]=qs[_0xccb2('0x1d')](_0x36125a[_0xccb2('0x2d')][_0xccb2('0x1d')]);_0x5f111c[_0xccb2('0x1c')]=qs[_0xccb2('0x1c')](_0x36125a['query'][_0xccb2('0x1c')]);}return _0x598ea3[_0xccb2('0x4f')](_0x5f111c);}})[_0xccb2('0x23')](function(_0x37bc0f){if(_0x37bc0f){return _0x37bc0f?{'count':_0x39b85c,'rows':_0x37bc0f}:null;}})[_0xccb2('0x23')](respondWithResult(_0x5f12b9,null))['catch'](handleError(_0x5f12b9,null));};exports[_0xccb2('0x50')]=function(_0x2924f8,_0x1509c0,_0x9280d){if(_0x2924f8[_0xccb2('0x45')]['id']){delete _0x2924f8[_0xccb2('0x45')]['id'];}return db[_0xccb2('0x28')]['findOne']({'where':{'id':_0x2924f8[_0xccb2('0x40')]['id']}})['then'](handleEntityNotFound(_0x1509c0,null))[_0xccb2('0x23')](function(_0xd7916e){if(_0xd7916e){return _0xd7916e[_0xccb2('0x50')](_0x2924f8[_0xccb2('0x45')][_0xccb2('0x51')]||[]);}return null;})['then'](respondWithResult(_0x1509c0,null))[_0xccb2('0x3e')](handleError(_0x1509c0,null));};
\ No newline at end of file
+var _0xfd21=['nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','body','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length'];(function(_0x1aae33,_0x110a80){var _0x2e91e9=function(_0x218767){while(--_0x218767){_0x1aae33['push'](_0x1aae33['shift']());}};_0x2e91e9(++_0x110a80);}(_0xfd21,0x1c5));var _0x1fd2=function(_0x59d2e8,_0x27c10f){_0x59d2e8=_0x59d2e8-0x0;var _0x2e3afe=_0xfd21[_0x59d2e8];return _0x2e3afe;};'use strict';var emlformat=require(_0x1fd2('0x0'));var rimraf=require(_0x1fd2('0x1'));var zipdir=require(_0x1fd2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fd2('0x3'));var moment=require(_0x1fd2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1fd2('0x5'));var util=require(_0x1fd2('0x6'));var path=require(_0x1fd2('0x7'));var sox=require(_0x1fd2('0x8'));var csv=require(_0x1fd2('0x9'));var ejs=require(_0x1fd2('0xa'));var fs=require('fs');var fs_extra=require(_0x1fd2('0xb'));var _=require(_0x1fd2('0xc'));var squel=require(_0x1fd2('0xd'));var crypto=require(_0x1fd2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fd2('0xf'));var toCsv=require(_0x1fd2('0x9'));var querystring=require(_0x1fd2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1fd2('0x11'));var qs=require(_0x1fd2('0x12'));var as=require(_0x1fd2('0x13'));var hardwareService=require(_0x1fd2('0x14'));var logger=require(_0x1fd2('0x15'))(_0x1fd2('0x16'));var utils=require(_0x1fd2('0x17'));var config=require(_0x1fd2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fd2('0x19'))['db'];function respondWithStatusCode(_0x175ec3,_0x440857){_0x440857=_0x440857||0xcc;return function(_0x275e17){if(_0x275e17){return _0x175ec3[_0x1fd2('0x1a')](_0x440857);}return _0x175ec3[_0x1fd2('0x1b')](_0x440857)[_0x1fd2('0x1c')]();};}function respondWithResult(_0x321851,_0x1165cf){_0x1165cf=_0x1165cf||0xc8;return function(_0x15ebc3){if(_0x15ebc3){return _0x321851[_0x1fd2('0x1b')](_0x1165cf)[_0x1fd2('0x1d')](_0x15ebc3);}};}function respondWithFilteredResult(_0x3c34a5,_0x5cb64e){return function(_0x1388aa){if(_0x1388aa){var _0x3518e8=typeof _0x5cb64e['offset']===_0x1fd2('0x1e')&&typeof _0x5cb64e[_0x1fd2('0x1f')]===_0x1fd2('0x1e');var _0x8b10d5=_0x1388aa[_0x1fd2('0x20')];var _0x34efc2=_0x3518e8?0x0:_0x5cb64e['offset'];var _0x16b8ea=_0x3518e8?_0x1388aa[_0x1fd2('0x20')]:_0x5cb64e[_0x1fd2('0x21')]+_0x5cb64e['limit'];var _0x4191a7;if(_0x16b8ea>=_0x8b10d5){_0x16b8ea=_0x8b10d5;_0x4191a7=0xc8;}else{_0x4191a7=0xce;}_0x3c34a5[_0x1fd2('0x1b')](_0x4191a7);return _0x3c34a5[_0x1fd2('0x22')](_0x1fd2('0x23'),_0x34efc2+'-'+_0x16b8ea+'/'+_0x8b10d5)[_0x1fd2('0x1d')](_0x1388aa);}return null;};}function patchUpdates(_0x40d887){return function(_0xe94b18){try{jsonpatch['apply'](_0xe94b18,_0x40d887,!![]);}catch(_0x254575){return BPromise[_0x1fd2('0x24')](_0x254575);}return _0xe94b18[_0x1fd2('0x25')]();};}function saveUpdates(_0x10ad79,_0x5eed3b){return function(_0x4ece40){if(_0x4ece40){return _0x4ece40[_0x1fd2('0x26')](_0x10ad79)[_0x1fd2('0x27')](function(_0x1a4cc3){return _0x1a4cc3;});}return null;};}function removeEntity(_0x145b19,_0x54d44d){return function(_0x2d6b5f){if(_0x2d6b5f){return _0x2d6b5f['destroy']()[_0x1fd2('0x27')](function(){_0x145b19[_0x1fd2('0x1b')](0xcc)[_0x1fd2('0x1c')]();});}};}function handleEntityNotFound(_0x13f153,_0x27d2eb){return function(_0x10baa3){if(!_0x10baa3){_0x13f153['sendStatus'](0x194);}return _0x10baa3;};}function handleError(_0x5c0ae8,_0x137dc7){_0x137dc7=_0x137dc7||0x1f4;return function(_0x4fc059){logger[_0x1fd2('0x28')](_0x4fc059[_0x1fd2('0x29')]);if(_0x4fc059[_0x1fd2('0x2a')]){delete _0x4fc059[_0x1fd2('0x2a')];}_0x5c0ae8[_0x1fd2('0x1b')](_0x137dc7)[_0x1fd2('0x2b')](_0x4fc059);};}exports[_0x1fd2('0x2c')]=function(_0x24a36f,_0x1032b7){var _0x249b54={},_0x3a206e={},_0xa9369a={'count':0x0,'rows':[]};var _0x36f440=_[_0x1fd2('0x2d')](db[_0x1fd2('0x2e')][_0x1fd2('0x2f')],function(_0x4df7c4){return{'name':_0x4df7c4[_0x1fd2('0x30')],'type':_0x4df7c4[_0x1fd2('0x31')]['key']};});_0x3a206e[_0x1fd2('0x32')]=_[_0x1fd2('0x2d')](_0x36f440,_0x1fd2('0x2a'));_0x3a206e[_0x1fd2('0x33')]=_[_0x1fd2('0x34')](_0x24a36f['query']);_0x3a206e['filters']=_[_0x1fd2('0x35')](_0x3a206e[_0x1fd2('0x32')],_0x3a206e['query']);_0x249b54[_0x1fd2('0x36')]=_[_0x1fd2('0x35')](_0x3a206e['model'],qs[_0x1fd2('0x37')](_0x24a36f[_0x1fd2('0x33')][_0x1fd2('0x37')]));_0x249b54[_0x1fd2('0x36')]=_0x249b54[_0x1fd2('0x36')][_0x1fd2('0x38')]?_0x249b54['attributes']:_0x3a206e['model'];if(!_0x24a36f[_0x1fd2('0x33')]['hasOwnProperty'](_0x1fd2('0x39'))){_0x249b54['limit']=qs[_0x1fd2('0x1f')](_0x24a36f[_0x1fd2('0x33')]['limit']);_0x249b54['offset']=qs['offset'](_0x24a36f['query'][_0x1fd2('0x21')]);}_0x249b54[_0x1fd2('0x3a')]=qs[_0x1fd2('0x3b')](_0x24a36f[_0x1fd2('0x33')][_0x1fd2('0x3b')]);_0x249b54[_0x1fd2('0x3c')]=qs[_0x1fd2('0x3d')](_[_0x1fd2('0x3e')](_0x24a36f[_0x1fd2('0x33')],_0x3a206e['filters']),_0x36f440);if(_0x24a36f[_0x1fd2('0x33')][_0x1fd2('0x3f')]){_0x249b54[_0x1fd2('0x3c')]=_['merge'](_0x249b54[_0x1fd2('0x3c')],{'$or':_[_0x1fd2('0x2d')](_0x36f440,function(_0x135e55){if(_0x135e55['type']!==_0x1fd2('0x40')){var _0x2d1197={};_0x2d1197[_0x135e55[_0x1fd2('0x2a')]]={'$like':'%'+_0x24a36f[_0x1fd2('0x33')]['filter']+'%'};return _0x2d1197;}})});}_0x249b54=_[_0x1fd2('0x41')]({},_0x249b54,_0x24a36f[_0x1fd2('0x42')]);var _0x528795={'where':_0x249b54['where']};return db['ZendeskConfiguration'][_0x1fd2('0x20')](_0x528795)[_0x1fd2('0x27')](function(_0x2fe2e9){_0xa9369a[_0x1fd2('0x20')]=_0x2fe2e9;if(_0x24a36f[_0x1fd2('0x33')][_0x1fd2('0x43')]){_0x249b54[_0x1fd2('0x44')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x1fd2('0x45')](_0x249b54);})[_0x1fd2('0x27')](function(_0x52a79d){_0xa9369a[_0x1fd2('0x46')]=_0x52a79d;return _0xa9369a;})[_0x1fd2('0x27')](respondWithFilteredResult(_0x1032b7,_0x249b54))[_0x1fd2('0x47')](handleError(_0x1032b7,null));};exports['show']=function(_0x21f3fe,_0x387982){var _0x43f8a4={'raw':![],'where':{'id':_0x21f3fe[_0x1fd2('0x48')]['id']}},_0x2e8fba={};_0x2e8fba['model']=_['keys'](db[_0x1fd2('0x2e')][_0x1fd2('0x2f')]);_0x2e8fba[_0x1fd2('0x33')]=_[_0x1fd2('0x34')](_0x21f3fe['query']);_0x2e8fba[_0x1fd2('0x3d')]=_['intersection'](_0x2e8fba['model'],_0x2e8fba['query']);_0x43f8a4[_0x1fd2('0x36')]=_['intersection'](_0x2e8fba[_0x1fd2('0x32')],qs[_0x1fd2('0x37')](_0x21f3fe[_0x1fd2('0x33')][_0x1fd2('0x37')]));_0x43f8a4[_0x1fd2('0x36')]=_0x43f8a4[_0x1fd2('0x36')][_0x1fd2('0x38')]?_0x43f8a4[_0x1fd2('0x36')]:_0x2e8fba[_0x1fd2('0x32')];if(_0x21f3fe[_0x1fd2('0x33')]['includeAll']){_0x43f8a4['include']=[{'all':!![]}];}_0x43f8a4=_[_0x1fd2('0x41')]({},_0x43f8a4,_0x21f3fe[_0x1fd2('0x42')]);return db['ZendeskConfiguration'][_0x1fd2('0x49')](_0x43f8a4)[_0x1fd2('0x27')](handleEntityNotFound(_0x387982,null))[_0x1fd2('0x27')](respondWithResult(_0x387982,null))['catch'](handleError(_0x387982,null));};exports['create']=function(_0x33760b,_0x2fec27){return db[_0x1fd2('0x2e')]['create'](_0x33760b[_0x1fd2('0x4a')],{})['then'](respondWithResult(_0x2fec27,0xc9))['catch'](handleError(_0x2fec27,null));};exports[_0x1fd2('0x26')]=function(_0xc4f241,_0x166c65){if(_0xc4f241[_0x1fd2('0x4a')]['id']){delete _0xc4f241['body']['id'];}return db[_0x1fd2('0x2e')][_0x1fd2('0x49')]({'where':{'id':_0xc4f241[_0x1fd2('0x48')]['id']}})[_0x1fd2('0x27')](handleEntityNotFound(_0x166c65,null))[_0x1fd2('0x27')](saveUpdates(_0xc4f241['body'],null))[_0x1fd2('0x27')](respondWithResult(_0x166c65,null))[_0x1fd2('0x47')](handleError(_0x166c65,null));};exports['destroy']=function(_0x206308,_0x45589c){return db[_0x1fd2('0x2e')][_0x1fd2('0x49')]({'where':{'id':_0x206308[_0x1fd2('0x48')]['id']}})['then'](handleEntityNotFound(_0x45589c,null))[_0x1fd2('0x27')](removeEntity(_0x45589c,null))[_0x1fd2('0x47')](handleError(_0x45589c,null));};exports[_0x1fd2('0x4b')]=function(_0x52183b,_0x2cd862,_0x4db17a){var _0x296a36={};var _0x343b74={};var _0x2da25c;var _0x32df3d;return db[_0x1fd2('0x2e')][_0x1fd2('0x4c')]({'where':{'id':_0x52183b[_0x1fd2('0x48')]['id']}})[_0x1fd2('0x27')](handleEntityNotFound(_0x2cd862,null))[_0x1fd2('0x27')](function(_0x4570cb){if(_0x4570cb){_0x2da25c=_0x4570cb;_0x343b74[_0x1fd2('0x32')]=_['keys'](db[_0x1fd2('0x4d')][_0x1fd2('0x2f')]);_0x343b74[_0x1fd2('0x33')]=_['keys'](_0x52183b[_0x1fd2('0x33')]);_0x343b74['filters']=_['intersection'](_0x343b74['model'],_0x343b74[_0x1fd2('0x33')]);_0x296a36[_0x1fd2('0x36')]=_[_0x1fd2('0x35')](_0x343b74[_0x1fd2('0x32')],qs[_0x1fd2('0x37')](_0x52183b[_0x1fd2('0x33')][_0x1fd2('0x37')]));_0x296a36[_0x1fd2('0x36')]=_0x296a36['attributes']['length']?_0x296a36[_0x1fd2('0x36')]:_0x343b74['model'];_0x296a36[_0x1fd2('0x3a')]=qs[_0x1fd2('0x3b')](_0x52183b['query'][_0x1fd2('0x3b')]);_0x296a36['where']=qs[_0x1fd2('0x3d')](_[_0x1fd2('0x3e')](_0x52183b[_0x1fd2('0x33')],_0x343b74[_0x1fd2('0x3d')]));if(_0x52183b[_0x1fd2('0x33')][_0x1fd2('0x3f')]){_0x296a36['where']=_[_0x1fd2('0x41')](_0x296a36[_0x1fd2('0x3c')],{'$or':_['map'](_0x296a36['attributes'],function(_0x4b04be){var _0xed28cb={};_0xed28cb[_0x4b04be]={'$like':'%'+_0x52183b[_0x1fd2('0x33')][_0x1fd2('0x3f')]+'%'};return _0xed28cb;})});}_0x296a36=_['merge']({},_0x296a36,_0x52183b[_0x1fd2('0x42')]);return _0x2da25c[_0x1fd2('0x4b')](_0x296a36);}})['then'](function(_0xc49841){if(_0xc49841){_0x32df3d=_0xc49841['length'];if(!_0x52183b['query'][_0x1fd2('0x4e')](_0x1fd2('0x39'))){_0x296a36[_0x1fd2('0x1f')]=qs['limit'](_0x52183b[_0x1fd2('0x33')][_0x1fd2('0x1f')]);_0x296a36['offset']=qs['offset'](_0x52183b[_0x1fd2('0x33')]['offset']);}return _0x2da25c[_0x1fd2('0x4b')](_0x296a36);}})['then'](function(_0x406fc5){if(_0x406fc5){return _0x406fc5?{'count':_0x32df3d,'rows':_0x406fc5}:null;}})[_0x1fd2('0x27')](respondWithResult(_0x2cd862,null))[_0x1fd2('0x47')](handleError(_0x2cd862,null));};exports['getSubjects']=function(_0x8d2dfb,_0x1a8113,_0xee26dc){var _0x57d56d={};var _0x383593={};var _0x68a67e;var _0x1da247;return db[_0x1fd2('0x2e')]['findOne']({'where':{'id':_0x8d2dfb[_0x1fd2('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a8113,null))[_0x1fd2('0x27')](function(_0xee7869){if(_0xee7869){_0x68a67e=_0xee7869;_0x383593[_0x1fd2('0x32')]=_['keys'](db[_0x1fd2('0x4d')]['rawAttributes']);_0x383593[_0x1fd2('0x33')]=_[_0x1fd2('0x34')](_0x8d2dfb[_0x1fd2('0x33')]);_0x383593[_0x1fd2('0x3d')]=_[_0x1fd2('0x35')](_0x383593['model'],_0x383593['query']);_0x57d56d[_0x1fd2('0x36')]=_[_0x1fd2('0x35')](_0x383593['model'],qs[_0x1fd2('0x37')](_0x8d2dfb[_0x1fd2('0x33')]['fields']));_0x57d56d[_0x1fd2('0x36')]=_0x57d56d['attributes'][_0x1fd2('0x38')]?_0x57d56d['attributes']:_0x383593['model'];_0x57d56d['order']=qs['sort'](_0x8d2dfb[_0x1fd2('0x33')][_0x1fd2('0x3b')]);_0x57d56d[_0x1fd2('0x3c')]=qs[_0x1fd2('0x3d')](_[_0x1fd2('0x3e')](_0x8d2dfb[_0x1fd2('0x33')],_0x383593[_0x1fd2('0x3d')]));if(_0x8d2dfb['query']['filter']){_0x57d56d[_0x1fd2('0x3c')]=_[_0x1fd2('0x41')](_0x57d56d['where'],{'$or':_[_0x1fd2('0x2d')](_0x57d56d['attributes'],function(_0xbd6d2c){var _0x12503d={};_0x12503d[_0xbd6d2c]={'$like':'%'+_0x8d2dfb[_0x1fd2('0x33')][_0x1fd2('0x3f')]+'%'};return _0x12503d;})});}_0x57d56d=_['merge']({},_0x57d56d,_0x8d2dfb[_0x1fd2('0x42')]);return _0x68a67e[_0x1fd2('0x4f')](_0x57d56d);}})[_0x1fd2('0x27')](function(_0x5c727b){if(_0x5c727b){_0x1da247=_0x5c727b[_0x1fd2('0x38')];if(!_0x8d2dfb[_0x1fd2('0x33')][_0x1fd2('0x4e')]('nolimit')){_0x57d56d[_0x1fd2('0x1f')]=qs[_0x1fd2('0x1f')](_0x8d2dfb[_0x1fd2('0x33')][_0x1fd2('0x1f')]);_0x57d56d[_0x1fd2('0x21')]=qs['offset'](_0x8d2dfb[_0x1fd2('0x33')]['offset']);}return _0x68a67e['getSubjects'](_0x57d56d);}})[_0x1fd2('0x27')](function(_0x1fe423){if(_0x1fe423){return _0x1fe423?{'count':_0x1da247,'rows':_0x1fe423}:null;}})[_0x1fd2('0x27')](respondWithResult(_0x1a8113,null))[_0x1fd2('0x47')](handleError(_0x1a8113,null));};exports[_0x1fd2('0x50')]=function(_0x6e7e64,_0x228032,_0x336e17){var _0xa31622={};var _0x35667c={};var _0x103960;var _0xb7f937;return db[_0x1fd2('0x2e')][_0x1fd2('0x4c')]({'where':{'id':_0x6e7e64[_0x1fd2('0x48')]['id']}})[_0x1fd2('0x27')](handleEntityNotFound(_0x228032,null))['then'](function(_0x104287){if(_0x104287){_0x103960=_0x104287;_0x35667c['model']=_[_0x1fd2('0x34')](db[_0x1fd2('0x4d')]['rawAttributes']);_0x35667c[_0x1fd2('0x33')]=_[_0x1fd2('0x34')](_0x6e7e64[_0x1fd2('0x33')]);_0x35667c[_0x1fd2('0x3d')]=_[_0x1fd2('0x35')](_0x35667c[_0x1fd2('0x32')],_0x35667c['query']);_0xa31622['attributes']=_[_0x1fd2('0x35')](_0x35667c[_0x1fd2('0x32')],qs[_0x1fd2('0x37')](_0x6e7e64['query'][_0x1fd2('0x37')]));_0xa31622[_0x1fd2('0x36')]=_0xa31622['attributes'][_0x1fd2('0x38')]?_0xa31622[_0x1fd2('0x36')]:_0x35667c[_0x1fd2('0x32')];_0xa31622[_0x1fd2('0x3a')]=qs[_0x1fd2('0x3b')](_0x6e7e64[_0x1fd2('0x33')][_0x1fd2('0x3b')]);_0xa31622[_0x1fd2('0x3c')]=qs['filters'](_[_0x1fd2('0x3e')](_0x6e7e64[_0x1fd2('0x33')],_0x35667c[_0x1fd2('0x3d')]));if(_0x6e7e64[_0x1fd2('0x33')]['filter']){_0xa31622['where']=_['merge'](_0xa31622[_0x1fd2('0x3c')],{'$or':_[_0x1fd2('0x2d')](_0xa31622[_0x1fd2('0x36')],function(_0x29adae){var _0xe83fd4={};_0xe83fd4[_0x29adae]={'$like':'%'+_0x6e7e64['query'][_0x1fd2('0x3f')]+'%'};return _0xe83fd4;})});}_0xa31622=_[_0x1fd2('0x41')]({},_0xa31622,_0x6e7e64['options']);return _0x103960[_0x1fd2('0x50')](_0xa31622);}})[_0x1fd2('0x27')](function(_0x12af2e){if(_0x12af2e){_0xb7f937=_0x12af2e[_0x1fd2('0x38')];if(!_0x6e7e64[_0x1fd2('0x33')][_0x1fd2('0x4e')](_0x1fd2('0x39'))){_0xa31622[_0x1fd2('0x1f')]=qs[_0x1fd2('0x1f')](_0x6e7e64[_0x1fd2('0x33')][_0x1fd2('0x1f')]);_0xa31622[_0x1fd2('0x21')]=qs['offset'](_0x6e7e64[_0x1fd2('0x33')][_0x1fd2('0x21')]);}return _0x103960[_0x1fd2('0x50')](_0xa31622);}})[_0x1fd2('0x27')](function(_0xeb692a){if(_0xeb692a){return _0xeb692a?{'count':_0xb7f937,'rows':_0xeb692a}:null;}})[_0x1fd2('0x27')](respondWithResult(_0x228032,null))[_0x1fd2('0x47')](handleError(_0x228032,null));};exports[_0x1fd2('0x51')]=function(_0x1f2eea,_0x4ea465,_0x3135e5){var _0x499a78={};var _0x276335={};var _0x4190af;var _0x49e0ad;return db[_0x1fd2('0x2e')]['findOne']({'where':{'id':_0x1f2eea['params']['id']}})['then'](handleEntityNotFound(_0x4ea465,null))[_0x1fd2('0x27')](function(_0x40900c){if(_0x40900c){_0x4190af=_0x40900c;_0x276335[_0x1fd2('0x32')]=_[_0x1fd2('0x34')](db[_0x1fd2('0x52')]['rawAttributes']);_0x276335['query']=_['keys'](_0x1f2eea[_0x1fd2('0x33')]);_0x276335[_0x1fd2('0x3d')]=_[_0x1fd2('0x35')](_0x276335[_0x1fd2('0x32')],_0x276335[_0x1fd2('0x33')]);_0x499a78['attributes']=_[_0x1fd2('0x35')](_0x276335[_0x1fd2('0x32')],qs['fields'](_0x1f2eea[_0x1fd2('0x33')][_0x1fd2('0x37')]));_0x499a78[_0x1fd2('0x36')]=_0x499a78[_0x1fd2('0x36')][_0x1fd2('0x38')]?_0x499a78[_0x1fd2('0x36')]:_0x276335[_0x1fd2('0x32')];_0x499a78[_0x1fd2('0x3a')]=qs[_0x1fd2('0x3b')](_0x1f2eea['query'][_0x1fd2('0x3b')]);_0x499a78[_0x1fd2('0x3c')]=qs[_0x1fd2('0x3d')](_['pick'](_0x1f2eea[_0x1fd2('0x33')],_0x276335['filters']));if(_0x1f2eea[_0x1fd2('0x33')][_0x1fd2('0x3f')]){_0x499a78['where']=_[_0x1fd2('0x41')](_0x499a78[_0x1fd2('0x3c')],{'$or':_[_0x1fd2('0x2d')](_0x499a78[_0x1fd2('0x36')],function(_0xd00e6){var _0x28a600={};_0x28a600[_0xd00e6]={'$like':'%'+_0x1f2eea[_0x1fd2('0x33')][_0x1fd2('0x3f')]+'%'};return _0x28a600;})});}_0x499a78=_[_0x1fd2('0x41')]({},_0x499a78,_0x1f2eea[_0x1fd2('0x42')]);return _0x4190af[_0x1fd2('0x51')](_0x499a78);}})[_0x1fd2('0x27')](function(_0x5de3ad){if(_0x5de3ad){_0x49e0ad=_0x5de3ad[_0x1fd2('0x38')];if(!_0x1f2eea[_0x1fd2('0x33')][_0x1fd2('0x4e')](_0x1fd2('0x39'))){_0x499a78[_0x1fd2('0x1f')]=qs['limit'](_0x1f2eea['query'][_0x1fd2('0x1f')]);_0x499a78[_0x1fd2('0x21')]=qs[_0x1fd2('0x21')](_0x1f2eea['query'][_0x1fd2('0x21')]);}return _0x4190af['getTags'](_0x499a78);}})[_0x1fd2('0x27')](function(_0x2edae3){if(_0x2edae3){return _0x2edae3?{'count':_0x49e0ad,'rows':_0x2edae3}:null;}})[_0x1fd2('0x27')](respondWithResult(_0x4ea465,null))[_0x1fd2('0x47')](handleError(_0x4ea465,null));};exports[_0x1fd2('0x53')]=function(_0x572c6a,_0x16cdf9,_0x2dccb6){if(_0x572c6a['body']['id']){delete _0x572c6a[_0x1fd2('0x4a')]['id'];}return db['ZendeskConfiguration'][_0x1fd2('0x4c')]({'where':{'id':_0x572c6a[_0x1fd2('0x48')]['id']}})[_0x1fd2('0x27')](handleEntityNotFound(_0x16cdf9,null))['then'](function(_0x3f4aad){if(_0x3f4aad){return _0x3f4aad[_0x1fd2('0x53')](_0x572c6a[_0x1fd2('0x4a')][_0x1fd2('0x54')]||[]);}return null;})[_0x1fd2('0x27')](respondWithResult(_0x16cdf9,null))[_0x1fd2('0x47')](handleError(_0x16cdf9,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3de3=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x3de3,0x1ce));var _0x33de=function(_0x1a210e,_0x314587){_0x1a210e=_0x1a210e-0x0;var _0x1276e5=_0x3de3[_0x1a210e];return _0x1276e5;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var logger=require(_0x33de('0x1'))(_0x33de('0x2'));var moment=require('moment');var BPromise=require(_0x33de('0x3'));var rp=require(_0x33de('0x4'));var fs=require('fs');var path=require(_0x33de('0x5'));var rimraf=require(_0x33de('0x6'));var config=require('../../config/environment');var attributes=require(_0x33de('0x7'));module[_0x33de('0x8')]=function(_0x558f98,_0x142716){return _0x558f98['define'](_0x33de('0x9'),attributes,{'tableName':_0x33de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1eba=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x509cce,_0x36d2e5){var _0x36d030=function(_0x2472fa){while(--_0x2472fa){_0x509cce['push'](_0x509cce['shift']());}};_0x36d030(++_0x36d2e5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x1eba[_0x56b138];return _0x3df878;};'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('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91e9=['rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59a7e3,_0x109eba){var _0x5a2f16=function(_0x54fb20){while(--_0x54fb20){_0x59a7e3['push'](_0x59a7e3['shift']());}};_0x5a2f16(++_0x109eba);}(_0x91e9,0x123));var _0x991e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x91e9[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x991e('0x0'));var util=require(_0x991e('0x1'));var moment=require(_0x991e('0x2'));var BPromise=require('bluebird');var rs=require(_0x991e('0x3'));var fs=require('fs');var Redis=require(_0x991e('0x4'));var db=require(_0x991e('0x5'))['db'];var utils=require(_0x991e('0x6'));var logger=require(_0x991e('0x7'))(_0x991e('0x8'));var config=require(_0x991e('0x9'));var jayson=require(_0x991e('0xa'));var client=jayson[_0x991e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3df12b,_0x6b7455,_0x5b7e5f){return new BPromise(function(_0x140a8b,_0x1fb824){return client[_0x991e('0xc')](_0x3df12b,_0x5b7e5f)[_0x991e('0xd')](function(_0x338e25){logger[_0x991e('0xe')](_0x991e('0xf'),_0x6b7455,_0x991e('0x10'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x6b7455,'request\x20sent',JSON[_0x991e('0x11')](_0x338e25));if(_0x338e25[_0x991e('0x12')]){if(_0x338e25[_0x991e('0x12')][_0x991e('0x13')]===0x1f4){logger[_0x991e('0x12')](_0x991e('0xf'),_0x6b7455,_0x338e25[_0x991e('0x12')][_0x991e('0x14')]);return _0x1fb824(_0x338e25[_0x991e('0x12')]['message']);}logger['error'](_0x991e('0xf'),_0x6b7455,_0x338e25['error'][_0x991e('0x14')]);return _0x140a8b(_0x338e25[_0x991e('0x12')][_0x991e('0x14')]);}else{logger[_0x991e('0xe')](_0x991e('0xf'),_0x6b7455,_0x991e('0x10'));_0x140a8b(_0x338e25[_0x991e('0x15')][_0x991e('0x14')]);}})[_0x991e('0x16')](function(_0x573d4f){logger['error'](_0x991e('0xf'),_0x6b7455,_0x573d4f);_0x1fb824(_0x573d4f);});});}
\ No newline at end of file
+var _0x8959=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x49ad8f,_0x5d4458){var _0x925768=function(_0x14e463){while(--_0x14e463){_0x49ad8f['push'](_0x49ad8f['shift']());}};_0x925768(++_0x5d4458);}(_0x8959,0x76));var _0x9895=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x8959[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require(_0x9895('0x0'));var util=require(_0x9895('0x1'));var moment=require(_0x9895('0x2'));var BPromise=require(_0x9895('0x3'));var rs=require(_0x9895('0x4'));var fs=require('fs');var Redis=require(_0x9895('0x5'));var db=require(_0x9895('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9895('0x7'));var config=require(_0x9895('0x8'));var jayson=require(_0x9895('0x9'));var client=jayson[_0x9895('0xa')][_0x9895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc2e0c7,_0x4b92ad,_0x1664f4){return new BPromise(function(_0x51585b,_0x115bb5){return client[_0x9895('0xc')](_0xc2e0c7,_0x1664f4)[_0x9895('0xd')](function(_0x24b8db){logger[_0x9895('0xe')](_0x9895('0xf'),_0x4b92ad,_0x9895('0x10'));logger[_0x9895('0x11')](_0x9895('0x12'),_0x4b92ad,_0x9895('0x10'),JSON['stringify'](_0x24b8db));if(_0x24b8db['error']){if(_0x24b8db[_0x9895('0x13')][_0x9895('0x14')]===0x1f4){logger[_0x9895('0x13')](_0x9895('0xf'),_0x4b92ad,_0x24b8db[_0x9895('0x13')]['message']);return _0x115bb5(_0x24b8db[_0x9895('0x13')][_0x9895('0x15')]);}logger[_0x9895('0x13')](_0x9895('0xf'),_0x4b92ad,_0x24b8db[_0x9895('0x13')][_0x9895('0x15')]);return _0x51585b(_0x24b8db[_0x9895('0x13')][_0x9895('0x15')]);}else{logger[_0x9895('0xe')](_0x9895('0xf'),_0x4b92ad,_0x9895('0x10'));_0x51585b(_0x24b8db[_0x9895('0x16')][_0x9895('0x15')]);}})['catch'](function(_0x177a87){logger[_0x9895('0x13')](_0x9895('0xf'),_0x4b92ad,_0x177a87);_0x115bb5(_0x177a87);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57a2=['/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x210eec,_0x5cf9ed){var _0x20d7c3=function(_0x468268){while(--_0x468268){_0x210eec['push'](_0x210eec['shift']());}};_0x20d7c3(++_0x5cf9ed);}(_0x57a2,0x99));var _0x257a=function(_0x20e84b,_0x3d7d65){_0x20e84b=_0x20e84b-0x0;var _0x38874d=_0x57a2[_0x20e84b];return _0x38874d;};'use strict';var multer=require(_0x257a('0x0'));var util=require(_0x257a('0x1'));var path=require('path');var timeout=require(_0x257a('0x2'));var express=require(_0x257a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x257a('0x4'));var interaction=require(_0x257a('0x5'));var config=require(_0x257a('0x6'));var controller=require('./intZendeskField.controller');router[_0x257a('0x7')]('/',auth['isAuthenticated'](),controller[_0x257a('0x8')]);router[_0x257a('0x7')](_0x257a('0x9'),auth[_0x257a('0xa')](),controller[_0x257a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x257a('0xc')]);router[_0x257a('0xd')](_0x257a('0x9'),auth[_0x257a('0xa')](),controller[_0x257a('0xe')]);router[_0x257a('0xf')](_0x257a('0x9'),auth['isAuthenticated'](),controller[_0x257a('0x10')]);module[_0x257a('0x11')]=router;
\ No newline at end of file
+var _0xcff0=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xcff0,0x10c));var _0x0cff=function(_0x105e34,_0xecc076){_0x105e34=_0x105e34-0x0;var _0x902819=_0xcff0[_0x105e34];return _0x902819;};'use strict';var multer=require('multer');var util=require(_0x0cff('0x0'));var path=require('path');var timeout=require(_0x0cff('0x1'));var express=require(_0x0cff('0x2'));var router=express[_0x0cff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0cff('0x4'));var interaction=require(_0x0cff('0x5'));var config=require(_0x0cff('0x6'));var controller=require('./intZendeskField.controller');router[_0x0cff('0x7')]('/',auth[_0x0cff('0x8')](),controller['index']);router['get'](_0x0cff('0x9'),auth[_0x0cff('0x8')](),controller[_0x0cff('0xa')]);router[_0x0cff('0xb')]('/',auth[_0x0cff('0x8')](),controller['create']);router[_0x0cff('0xc')]('/:id',auth[_0x0cff('0x8')](),controller['update']);router[_0x0cff('0xd')]('/:id',auth[_0x0cff('0x8')](),controller[_0x0cff('0xe')]);module[_0x0cff('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a4c=['STRING','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3f711b,_0x117e73){var _0x2f5de9=function(_0x38047f){while(--_0x38047f){_0x3f711b['push'](_0x3f711b['shift']());}};_0x2f5de9(++_0x117e73);}(_0x4a4c,0x71));var _0xc4a4=function(_0x46fff1,_0x5e2c76){_0x46fff1=_0x46fff1-0x0;var _0x98ffc4=_0x4a4c[_0x46fff1];return _0x98ffc4;};'use strict';var Sequelize=require('sequelize');module[_0xc4a4('0x0')]={'type':{'type':Sequelize[_0xc4a4('0x1')](_0xc4a4('0x2'),_0xc4a4('0x3'),_0xc4a4('0x4'),_0xc4a4('0x5'),_0xc4a4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc4a4('0x7')]},'key':{'type':Sequelize[_0xc4a4('0x7')]},'keyType':{'type':Sequelize[_0xc4a4('0x1')]('string',_0xc4a4('0x3'),_0xc4a4('0x4'))},'keyContent':{'type':Sequelize[_0xc4a4('0x7')]},'idField':{'type':Sequelize[_0xc4a4('0x7')]},'nameField':{'type':Sequelize[_0xc4a4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc4a4('0x7')]}};
\ No newline at end of file
+var _0xf50e=['ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x4e0e7f,_0x3e75ed){var _0x269f6b=function(_0x37446f){while(--_0x37446f){_0x4e0e7f['push'](_0x4e0e7f['shift']());}};_0x269f6b(++_0x3e75ed);}(_0xf50e,0x1d2));var _0xef50=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xf50e[_0x220afa];return _0x1b79d1;};'use strict';var Sequelize=require(_0xef50('0x0'));module[_0xef50('0x1')]={'type':{'type':Sequelize[_0xef50('0x2')](_0xef50('0x3'),_0xef50('0x4'),'customVariable',_0xef50('0x5'),'picklist'),'defaultValue':_0xef50('0x3')},'content':{'type':Sequelize[_0xef50('0x6')]},'key':{'type':Sequelize[_0xef50('0x6')]},'keyType':{'type':Sequelize[_0xef50('0x2')](_0xef50('0x3'),'variable',_0xef50('0x7'))},'keyContent':{'type':Sequelize[_0xef50('0x6')]},'idField':{'type':Sequelize[_0xef50('0x6')]},'nameField':{'type':Sequelize[_0xef50('0x6')]},'customField':{'type':Sequelize[_0xef50('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfaba=['intersection','model','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','fields','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','query','filters'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xafab('0x0'));var rimraf=require(_0xafab('0x1'));var zipdir=require(_0xafab('0x2'));var jsonpatch=require(_0xafab('0x3'));var rp=require('request-promise');var moment=require(_0xafab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xafab('0x5'));var path=require('path');var sox=require(_0xafab('0x6'));var csv=require('to-csv');var ejs=require(_0xafab('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafab('0x8'));var squel=require(_0xafab('0x9'));var crypto=require('crypto');var jsforce=require(_0xafab('0xa'));var deskjs=require(_0xafab('0xb'));var toCsv=require('to-csv');var querystring=require(_0xafab('0xc'));var Papa=require(_0xafab('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafab('0xe'));var as=require(_0xafab('0xf'));var hardwareService=require(_0xafab('0x10'));var logger=require('../../config/logger')(_0xafab('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xafab('0x12'));var db=require(_0xafab('0x13'))['db'];function respondWithStatusCode(_0x3eb9e7,_0xe437ef){_0xe437ef=_0xe437ef||0xcc;return function(_0x45aa37){if(_0x45aa37){return _0x3eb9e7[_0xafab('0x14')](_0xe437ef);}return _0x3eb9e7[_0xafab('0x15')](_0xe437ef)['end']();};}function respondWithResult(_0x42c4e7,_0x300448){_0x300448=_0x300448||0xc8;return function(_0x5074a7){if(_0x5074a7){return _0x42c4e7[_0xafab('0x15')](_0x300448)[_0xafab('0x16')](_0x5074a7);}};}function respondWithFilteredResult(_0x599f2f,_0x192f1b){return function(_0x307c5e){if(_0x307c5e){var _0x5bb925=typeof _0x192f1b['offset']===_0xafab('0x17')&&typeof _0x192f1b[_0xafab('0x18')]===_0xafab('0x17');var _0x254751=_0x307c5e['count'];var _0x3b8140=_0x5bb925?0x0:_0x192f1b['offset'];var _0x38cd9a=_0x5bb925?_0x307c5e[_0xafab('0x19')]:_0x192f1b[_0xafab('0x1a')]+_0x192f1b['limit'];var _0x139ec7;if(_0x38cd9a>=_0x254751){_0x38cd9a=_0x254751;_0x139ec7=0xc8;}else{_0x139ec7=0xce;}_0x599f2f[_0xafab('0x15')](_0x139ec7);return _0x599f2f[_0xafab('0x1b')](_0xafab('0x1c'),_0x3b8140+'-'+_0x38cd9a+'/'+_0x254751)[_0xafab('0x16')](_0x307c5e);}return null;};}function patchUpdates(_0x599e54){return function(_0x4a52ac){try{jsonpatch[_0xafab('0x1d')](_0x4a52ac,_0x599e54,!![]);}catch(_0x19cfc1){return BPromise[_0xafab('0x1e')](_0x19cfc1);}return _0x4a52ac[_0xafab('0x1f')]();};}function saveUpdates(_0x4e9adb,_0x2ae5df){return function(_0x3106bf){if(_0x3106bf){return _0x3106bf[_0xafab('0x20')](_0x4e9adb)[_0xafab('0x21')](function(_0x50a3e3){return _0x50a3e3;});}return null;};}function removeEntity(_0x4049e1,_0x353a3d){return function(_0x19cf4e){if(_0x19cf4e){return _0x19cf4e['destroy']()['then'](function(){_0x4049e1[_0xafab('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233fdd,_0x95c7a7){return function(_0x3fa273){if(!_0x3fa273){_0x233fdd[_0xafab('0x14')](0x194);}return _0x3fa273;};}function handleError(_0x5b84ab,_0x4e0edd){_0x4e0edd=_0x4e0edd||0x1f4;return function(_0x3c0dbd){logger[_0xafab('0x22')](_0x3c0dbd['stack']);if(_0x3c0dbd['name']){delete _0x3c0dbd[_0xafab('0x23')];}_0x5b84ab[_0xafab('0x15')](_0x4e0edd)[_0xafab('0x24')](_0x3c0dbd);};}exports[_0xafab('0x25')]=function(_0x531b36,_0x47ec50){var _0x3ab4c8={},_0x4554ec={},_0x30ea5e={'count':0x0,'rows':[]};var _0x1908d4=_[_0xafab('0x26')](db[_0xafab('0x27')][_0xafab('0x28')],function(_0x525762){return{'name':_0x525762[_0xafab('0x29')],'type':_0x525762['type'][_0xafab('0x2a')]};});_0x4554ec['model']=_[_0xafab('0x26')](_0x1908d4,_0xafab('0x23'));_0x4554ec[_0xafab('0x2b')]=_['keys'](_0x531b36[_0xafab('0x2b')]);_0x4554ec[_0xafab('0x2c')]=_[_0xafab('0x2d')](_0x4554ec[_0xafab('0x2e')],_0x4554ec[_0xafab('0x2b')]);_0x3ab4c8[_0xafab('0x2f')]=_[_0xafab('0x2d')](_0x4554ec['model'],qs['fields'](_0x531b36['query']['fields']));_0x3ab4c8[_0xafab('0x2f')]=_0x3ab4c8[_0xafab('0x2f')]['length']?_0x3ab4c8[_0xafab('0x2f')]:_0x4554ec[_0xafab('0x2e')];if(!_0x531b36[_0xafab('0x2b')][_0xafab('0x30')](_0xafab('0x31'))){_0x3ab4c8[_0xafab('0x18')]=qs[_0xafab('0x18')](_0x531b36[_0xafab('0x2b')][_0xafab('0x18')]);_0x3ab4c8['offset']=qs['offset'](_0x531b36[_0xafab('0x2b')][_0xafab('0x1a')]);}_0x3ab4c8[_0xafab('0x32')]=qs[_0xafab('0x33')](_0x531b36['query'][_0xafab('0x33')]);_0x3ab4c8['where']=qs[_0xafab('0x2c')](_[_0xafab('0x34')](_0x531b36[_0xafab('0x2b')],_0x4554ec[_0xafab('0x2c')]),_0x1908d4);if(_0x531b36[_0xafab('0x2b')][_0xafab('0x35')]){_0x3ab4c8['where']=_[_0xafab('0x36')](_0x3ab4c8['where'],{'$or':_[_0xafab('0x26')](_0x1908d4,function(_0x51fd4c){if(_0x51fd4c['type']!==_0xafab('0x37')){var _0xf52de={};_0xf52de[_0x51fd4c['name']]={'$like':'%'+_0x531b36[_0xafab('0x2b')][_0xafab('0x35')]+'%'};return _0xf52de;}})});}_0x3ab4c8=_[_0xafab('0x36')]({},_0x3ab4c8,_0x531b36[_0xafab('0x38')]);var _0x1bece9={'where':_0x3ab4c8['where']};return db['ZendeskField'][_0xafab('0x19')](_0x1bece9)[_0xafab('0x21')](function(_0x119aac){_0x30ea5e[_0xafab('0x19')]=_0x119aac;if(_0x531b36[_0xafab('0x2b')]['includeAll']){_0x3ab4c8[_0xafab('0x39')]=[{'all':!![]}];}return db[_0xafab('0x27')][_0xafab('0x3a')](_0x3ab4c8);})[_0xafab('0x21')](function(_0x30dc8c){_0x30ea5e['rows']=_0x30dc8c;return _0x30ea5e;})[_0xafab('0x21')](respondWithFilteredResult(_0x47ec50,_0x3ab4c8))[_0xafab('0x3b')](handleError(_0x47ec50,null));};exports[_0xafab('0x3c')]=function(_0x595a1b,_0x5b09c6){var _0x3f1631={'raw':!![],'where':{'id':_0x595a1b['params']['id']}},_0x57cebb={};_0x57cebb[_0xafab('0x2e')]=_[_0xafab('0x3d')](db[_0xafab('0x27')][_0xafab('0x28')]);_0x57cebb[_0xafab('0x2b')]=_[_0xafab('0x3d')](_0x595a1b[_0xafab('0x2b')]);_0x57cebb[_0xafab('0x2c')]=_[_0xafab('0x2d')](_0x57cebb[_0xafab('0x2e')],_0x57cebb[_0xafab('0x2b')]);_0x3f1631[_0xafab('0x2f')]=_['intersection'](_0x57cebb[_0xafab('0x2e')],qs[_0xafab('0x3e')](_0x595a1b['query'][_0xafab('0x3e')]));_0x3f1631[_0xafab('0x2f')]=_0x3f1631[_0xafab('0x2f')][_0xafab('0x3f')]?_0x3f1631[_0xafab('0x2f')]:_0x57cebb['model'];if(_0x595a1b[_0xafab('0x2b')]['includeAll']){_0x3f1631[_0xafab('0x39')]=[{'all':!![]}];}_0x3f1631=_[_0xafab('0x36')]({},_0x3f1631,_0x595a1b[_0xafab('0x38')]);return db[_0xafab('0x27')][_0xafab('0x40')](_0x3f1631)[_0xafab('0x21')](handleEntityNotFound(_0x5b09c6,null))[_0xafab('0x21')](respondWithResult(_0x5b09c6,null))[_0xafab('0x3b')](handleError(_0x5b09c6,null));};exports[_0xafab('0x41')]=function(_0x1ee8d9,_0x1d518e){return db['ZendeskField'][_0xafab('0x41')](_0x1ee8d9['body'],{})[_0xafab('0x21')](respondWithResult(_0x1d518e,0xc9))[_0xafab('0x3b')](handleError(_0x1d518e,null));};exports['update']=function(_0x47856a,_0x5ae92e){if(_0x47856a[_0xafab('0x42')]['id']){delete _0x47856a['body']['id'];}return db['ZendeskField'][_0xafab('0x40')]({'where':{'id':_0x47856a[_0xafab('0x43')]['id']}})[_0xafab('0x21')](handleEntityNotFound(_0x5ae92e,null))[_0xafab('0x21')](saveUpdates(_0x47856a[_0xafab('0x42')],null))[_0xafab('0x21')](respondWithResult(_0x5ae92e,null))[_0xafab('0x3b')](handleError(_0x5ae92e,null));};exports[_0xafab('0x44')]=function(_0x5d021a,_0x5ea623){return db[_0xafab('0x27')]['find']({'where':{'id':_0x5d021a[_0xafab('0x43')]['id']}})[_0xafab('0x21')](handleEntityNotFound(_0x5ea623,null))[_0xafab('0x21')](removeEntity(_0x5ea623,null))[_0xafab('0x3b')](handleError(_0x5ea623,null));};
\ No newline at end of file
+var _0x0a35=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','ZendeskField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params'];(function(_0x5d7230,_0x5d7acd){var _0x4c484b=function(_0x5308b8){while(--_0x5308b8){_0x5d7230['push'](_0x5d7230['shift']());}};_0x4c484b(++_0x5d7acd);}(_0x0a35,0xe1));var _0x50a3=function(_0x16ecad,_0x205047){_0x16ecad=_0x16ecad-0x0;var _0x313ff7=_0x0a35[_0x16ecad];return _0x313ff7;};'use strict';var emlformat=require(_0x50a3('0x0'));var rimraf=require(_0x50a3('0x1'));var zipdir=require(_0x50a3('0x2'));var jsonpatch=require(_0x50a3('0x3'));var rp=require(_0x50a3('0x4'));var moment=require(_0x50a3('0x5'));var BPromise=require(_0x50a3('0x6'));var Mustache=require(_0x50a3('0x7'));var util=require(_0x50a3('0x8'));var path=require('path');var sox=require(_0x50a3('0x9'));var csv=require(_0x50a3('0xa'));var ejs=require(_0x50a3('0xb'));var fs=require('fs');var fs_extra=require(_0x50a3('0xc'));var _=require('lodash');var squel=require(_0x50a3('0xd'));var crypto=require(_0x50a3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x50a3('0xf'));var toCsv=require(_0x50a3('0xa'));var querystring=require(_0x50a3('0x10'));var Papa=require(_0x50a3('0x11'));var Redis=require(_0x50a3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x50a3('0x13'));var as=require(_0x50a3('0x14'));var hardwareService=require(_0x50a3('0x15'));var logger=require(_0x50a3('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x50a3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x50a3('0x18'))['db'];function respondWithStatusCode(_0x435b0c,_0x77db31){_0x77db31=_0x77db31||0xcc;return function(_0x199903){if(_0x199903){return _0x435b0c['sendStatus'](_0x77db31);}return _0x435b0c['status'](_0x77db31)[_0x50a3('0x19')]();};}function respondWithResult(_0x1784b1,_0x397e23){_0x397e23=_0x397e23||0xc8;return function(_0x5cc582){if(_0x5cc582){return _0x1784b1[_0x50a3('0x1a')](_0x397e23)['json'](_0x5cc582);}};}function respondWithFilteredResult(_0x16ebce,_0x180cac){return function(_0x5084e7){if(_0x5084e7){var _0x16da7d=typeof _0x180cac['offset']===_0x50a3('0x1b')&&typeof _0x180cac[_0x50a3('0x1c')]===_0x50a3('0x1b');var _0x1034f3=_0x5084e7[_0x50a3('0x1d')];var _0x1456cf=_0x16da7d?0x0:_0x180cac[_0x50a3('0x1e')];var _0x43a2ac=_0x16da7d?_0x5084e7[_0x50a3('0x1d')]:_0x180cac[_0x50a3('0x1e')]+_0x180cac[_0x50a3('0x1c')];var _0x489692;if(_0x43a2ac>=_0x1034f3){_0x43a2ac=_0x1034f3;_0x489692=0xc8;}else{_0x489692=0xce;}_0x16ebce[_0x50a3('0x1a')](_0x489692);return _0x16ebce[_0x50a3('0x1f')](_0x50a3('0x20'),_0x1456cf+'-'+_0x43a2ac+'/'+_0x1034f3)[_0x50a3('0x21')](_0x5084e7);}return null;};}function patchUpdates(_0x55a60f){return function(_0x82d5e7){try{jsonpatch[_0x50a3('0x22')](_0x82d5e7,_0x55a60f,!![]);}catch(_0xe9bec1){return BPromise[_0x50a3('0x23')](_0xe9bec1);}return _0x82d5e7['save']();};}function saveUpdates(_0x2cb250,_0x587007){return function(_0x347e29){if(_0x347e29){return _0x347e29[_0x50a3('0x24')](_0x2cb250)[_0x50a3('0x25')](function(_0x2a893a){return _0x2a893a;});}return null;};}function removeEntity(_0x21e4af,_0x337ef8){return function(_0x50e415){if(_0x50e415){return _0x50e415[_0x50a3('0x26')]()[_0x50a3('0x25')](function(){_0x21e4af[_0x50a3('0x1a')](0xcc)[_0x50a3('0x19')]();});}};}function handleEntityNotFound(_0x28de78,_0x6df348){return function(_0x4ad97e){if(!_0x4ad97e){_0x28de78[_0x50a3('0x27')](0x194);}return _0x4ad97e;};}function handleError(_0x3a566b,_0x14f3c1){_0x14f3c1=_0x14f3c1||0x1f4;return function(_0x51dd05){logger['error'](_0x51dd05[_0x50a3('0x28')]);if(_0x51dd05[_0x50a3('0x29')]){delete _0x51dd05['name'];}_0x3a566b['status'](_0x14f3c1)[_0x50a3('0x2a')](_0x51dd05);};}exports[_0x50a3('0x2b')]=function(_0x5a08b6,_0x485146){var _0x3da487={},_0x27c2b3={},_0x125c86={'count':0x0,'rows':[]};var _0xce5e28=_[_0x50a3('0x2c')](db[_0x50a3('0x2d')]['rawAttributes'],function(_0x38f3d2){return{'name':_0x38f3d2[_0x50a3('0x2e')],'type':_0x38f3d2[_0x50a3('0x2f')]['key']};});_0x27c2b3[_0x50a3('0x30')]=_['map'](_0xce5e28,_0x50a3('0x29'));_0x27c2b3[_0x50a3('0x31')]=_[_0x50a3('0x32')](_0x5a08b6['query']);_0x27c2b3[_0x50a3('0x33')]=_['intersection'](_0x27c2b3['model'],_0x27c2b3[_0x50a3('0x31')]);_0x3da487[_0x50a3('0x34')]=_[_0x50a3('0x35')](_0x27c2b3[_0x50a3('0x30')],qs[_0x50a3('0x36')](_0x5a08b6[_0x50a3('0x31')][_0x50a3('0x36')]));_0x3da487[_0x50a3('0x34')]=_0x3da487[_0x50a3('0x34')][_0x50a3('0x37')]?_0x3da487[_0x50a3('0x34')]:_0x27c2b3[_0x50a3('0x30')];if(!_0x5a08b6[_0x50a3('0x31')][_0x50a3('0x38')](_0x50a3('0x39'))){_0x3da487[_0x50a3('0x1c')]=qs[_0x50a3('0x1c')](_0x5a08b6['query'][_0x50a3('0x1c')]);_0x3da487['offset']=qs[_0x50a3('0x1e')](_0x5a08b6[_0x50a3('0x31')][_0x50a3('0x1e')]);}_0x3da487['order']=qs[_0x50a3('0x3a')](_0x5a08b6[_0x50a3('0x31')][_0x50a3('0x3a')]);_0x3da487[_0x50a3('0x3b')]=qs[_0x50a3('0x33')](_[_0x50a3('0x3c')](_0x5a08b6['query'],_0x27c2b3['filters']),_0xce5e28);if(_0x5a08b6['query'][_0x50a3('0x3d')]){_0x3da487[_0x50a3('0x3b')]=_[_0x50a3('0x3e')](_0x3da487[_0x50a3('0x3b')],{'$or':_['map'](_0xce5e28,function(_0x216da5){if(_0x216da5[_0x50a3('0x2f')]!==_0x50a3('0x3f')){var _0x4eb2ee={};_0x4eb2ee[_0x216da5[_0x50a3('0x29')]]={'$like':'%'+_0x5a08b6[_0x50a3('0x31')][_0x50a3('0x3d')]+'%'};return _0x4eb2ee;}})});}_0x3da487=_[_0x50a3('0x3e')]({},_0x3da487,_0x5a08b6[_0x50a3('0x40')]);var _0x7fffe9={'where':_0x3da487['where']};return db[_0x50a3('0x2d')]['count'](_0x7fffe9)[_0x50a3('0x25')](function(_0x2db72a){_0x125c86[_0x50a3('0x1d')]=_0x2db72a;if(_0x5a08b6[_0x50a3('0x31')][_0x50a3('0x41')]){_0x3da487[_0x50a3('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x50a3('0x43')](_0x3da487);})[_0x50a3('0x25')](function(_0x11db8b){_0x125c86['rows']=_0x11db8b;return _0x125c86;})[_0x50a3('0x25')](respondWithFilteredResult(_0x485146,_0x3da487))[_0x50a3('0x44')](handleError(_0x485146,null));};exports[_0x50a3('0x45')]=function(_0x59d3f9,_0x6b46ab){var _0x171c9f={'raw':!![],'where':{'id':_0x59d3f9['params']['id']}},_0x62c0e1={};_0x62c0e1[_0x50a3('0x30')]=_['keys'](db['ZendeskField'][_0x50a3('0x46')]);_0x62c0e1[_0x50a3('0x31')]=_[_0x50a3('0x32')](_0x59d3f9[_0x50a3('0x31')]);_0x62c0e1['filters']=_[_0x50a3('0x35')](_0x62c0e1[_0x50a3('0x30')],_0x62c0e1[_0x50a3('0x31')]);_0x171c9f[_0x50a3('0x34')]=_[_0x50a3('0x35')](_0x62c0e1[_0x50a3('0x30')],qs[_0x50a3('0x36')](_0x59d3f9[_0x50a3('0x31')][_0x50a3('0x36')]));_0x171c9f[_0x50a3('0x34')]=_0x171c9f['attributes']['length']?_0x171c9f['attributes']:_0x62c0e1[_0x50a3('0x30')];if(_0x59d3f9[_0x50a3('0x31')]['includeAll']){_0x171c9f[_0x50a3('0x42')]=[{'all':!![]}];}_0x171c9f=_[_0x50a3('0x3e')]({},_0x171c9f,_0x59d3f9[_0x50a3('0x40')]);return db[_0x50a3('0x2d')][_0x50a3('0x47')](_0x171c9f)[_0x50a3('0x25')](handleEntityNotFound(_0x6b46ab,null))[_0x50a3('0x25')](respondWithResult(_0x6b46ab,null))[_0x50a3('0x44')](handleError(_0x6b46ab,null));};exports[_0x50a3('0x48')]=function(_0x16e503,_0xd4a803){return db[_0x50a3('0x2d')][_0x50a3('0x48')](_0x16e503[_0x50a3('0x49')],{})[_0x50a3('0x25')](respondWithResult(_0xd4a803,0xc9))[_0x50a3('0x44')](handleError(_0xd4a803,null));};exports[_0x50a3('0x24')]=function(_0x58e5bf,_0x5b644a){if(_0x58e5bf['body']['id']){delete _0x58e5bf[_0x50a3('0x49')]['id'];}return db[_0x50a3('0x2d')][_0x50a3('0x47')]({'where':{'id':_0x58e5bf[_0x50a3('0x4a')]['id']}})[_0x50a3('0x25')](handleEntityNotFound(_0x5b644a,null))['then'](saveUpdates(_0x58e5bf['body'],null))[_0x50a3('0x25')](respondWithResult(_0x5b644a,null))[_0x50a3('0x44')](handleError(_0x5b644a,null));};exports[_0x50a3('0x26')]=function(_0x4d47f6,_0x5bbd45){return db[_0x50a3('0x2d')][_0x50a3('0x47')]({'where':{'id':_0x4d47f6[_0x50a3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bbd45,null))['then'](removeEntity(_0x5bbd45,null))[_0x50a3('0x44')](handleError(_0x5bbd45,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x885f=['exports','define','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes'];(function(_0x31d0ae,_0x2175a9){var _0x4a9217=function(_0x464f76){while(--_0x464f76){_0x31d0ae['push'](_0x31d0ae['shift']());}};_0x4a9217(++_0x2175a9);}(_0x885f,0x14f));var _0xf885=function(_0x4892b5,_0x92937){_0x4892b5=_0x4892b5-0x0;var _0x109cb4=_0x885f[_0x4892b5];return _0x109cb4;};'use strict';var _=require(_0xf885('0x0'));var util=require(_0xf885('0x1'));var logger=require(_0xf885('0x2'))(_0xf885('0x3'));var moment=require(_0xf885('0x4'));var BPromise=require(_0xf885('0x5'));var rp=require(_0xf885('0x6'));var fs=require('fs');var path=require(_0xf885('0x7'));var rimraf=require('rimraf');var config=require(_0xf885('0x8'));var attributes=require(_0xf885('0x9'));module[_0xf885('0xa')]=function(_0x4eaff7,_0x4801ee){return _0x4eaff7[_0xf885('0xb')]('ZendeskField',attributes,{'tableName':_0xf885('0xc'),'paranoid':![],'indexes':[{'name':_0xf885('0xd'),'fields':[_0xf885('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7097=['../../config/logger','api','request-promise','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','lodash','util'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x7097,0x1ed));var _0x7709=function(_0x17de64,_0x1b8539){_0x17de64=_0x17de64-0x0;var _0x295153=_0x7097[_0x17de64];return _0x295153;};'use strict';var _=require(_0x7709('0x0'));var util=require(_0x7709('0x1'));var logger=require(_0x7709('0x2'))(_0x7709('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7709('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7709('0x5'));var attributes=require(_0x7709('0x6'));module['exports']=function(_0x4bc871,_0xf35899){return _0x4bc871[_0x7709('0x7')]('ZendeskField',attributes,{'tableName':_0x7709('0x8'),'paranoid':![],'indexes':[{'name':_0x7709('0x9'),'fields':[_0x7709('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75eb=['stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56fcd9,_0x15dea6){var _0x954ad9=function(_0x2b3d48){while(--_0x2b3d48){_0x56fcd9['push'](_0x56fcd9['shift']());}};_0x954ad9(++_0x15dea6);}(_0x75eb,0x1ba));var _0xb75e=function(_0x1bfc3f,_0x12c107){_0x1bfc3f=_0x1bfc3f-0x0;var _0x3c6b4d=_0x75eb[_0x1bfc3f];return _0x3c6b4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb75e('0x0'));var BPromise=require(_0xb75e('0x1'));var rs=require(_0xb75e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb75e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb75e('0x4'))(_0xb75e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb75e('0x6')][_0xb75e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x180875,_0x47926c,_0x1be572){return new BPromise(function(_0xad80ff,_0x1670fb){return client[_0xb75e('0x8')](_0x180875,_0x1be572)[_0xb75e('0x9')](function(_0x546ecb){logger[_0xb75e('0xa')](_0xb75e('0xb'),_0x47926c,_0xb75e('0xc'));logger[_0xb75e('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x47926c,_0xb75e('0xc'),JSON[_0xb75e('0xe')](_0x546ecb));if(_0x546ecb['error']){if(_0x546ecb[_0xb75e('0xf')]['code']===0x1f4){logger[_0xb75e('0xf')]('ZendeskField,\x20%s,\x20%s',_0x47926c,_0x546ecb[_0xb75e('0xf')][_0xb75e('0x10')]);return _0x1670fb(_0x546ecb['error']['message']);}logger['error'](_0xb75e('0xb'),_0x47926c,_0x546ecb[_0xb75e('0xf')][_0xb75e('0x10')]);return _0xad80ff(_0x546ecb[_0xb75e('0xf')][_0xb75e('0x10')]);}else{logger[_0xb75e('0xa')]('ZendeskField,\x20%s,\x20%s',_0x47926c,_0xb75e('0xc'));_0xad80ff(_0x546ecb[_0xb75e('0x11')]['message']);}})[_0xb75e('0x12')](function(_0x237df6){logger[_0xb75e('0xf')](_0xb75e('0xb'),_0x47926c,_0x237df6);_0x1670fb(_0x237df6);});});}
\ No newline at end of file
+var _0x06f4=['../../config/environment','client','http','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x393fd0,_0x2c12b3){var _0x4171d0=function(_0x2a5048){while(--_0x2a5048){_0x393fd0['push'](_0x393fd0['shift']());}};_0x4171d0(++_0x2c12b3);}(_0x06f4,0x76));var _0x406f=function(_0x101e04,_0x164a5d){_0x101e04=_0x101e04-0x0;var _0x20eaf6=_0x06f4[_0x101e04];return _0x20eaf6;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require(_0x406f('0x2'));var BPromise=require('bluebird');var rs=require(_0x406f('0x3'));var fs=require('fs');var Redis=require(_0x406f('0x4'));var db=require(_0x406f('0x5'))['db'];var utils=require(_0x406f('0x6'));var logger=require('../../config/logger')(_0x406f('0x7'));var config=require(_0x406f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x406f('0x9')][_0x406f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37de6f,_0x1647ae,_0x57ad43){return new BPromise(function(_0x493034,_0x393de1){return client['request'](_0x37de6f,_0x57ad43)['then'](function(_0x1945f0){logger['info']('ZendeskField,\x20%s,\x20%s',_0x1647ae,'request\x20sent');logger[_0x406f('0xb')](_0x406f('0xc'),_0x1647ae,_0x406f('0xd'),JSON[_0x406f('0xe')](_0x1945f0));if(_0x1945f0[_0x406f('0xf')]){if(_0x1945f0[_0x406f('0xf')][_0x406f('0x10')]===0x1f4){logger[_0x406f('0xf')](_0x406f('0x11'),_0x1647ae,_0x1945f0[_0x406f('0xf')]['message']);return _0x393de1(_0x1945f0['error']['message']);}logger[_0x406f('0xf')](_0x406f('0x11'),_0x1647ae,_0x1945f0[_0x406f('0xf')][_0x406f('0x12')]);return _0x493034(_0x1945f0[_0x406f('0xf')]['message']);}else{logger['info'](_0x406f('0x11'),_0x1647ae,_0x406f('0xd'));_0x493034(_0x1945f0[_0x406f('0x13')][_0x406f('0x12')]);}})[_0x406f('0x14')](function(_0x329e55){logger[_0x406f('0xf')]('ZendeskField,\x20%s,\x20%s',_0x1647ae,_0x329e55);_0x393de1(_0x329e55);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc485=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x5aeeae,_0x2c6f39){var _0x2844d2=function(_0x2cd804){while(--_0x2cd804){_0x5aeeae['push'](_0x5aeeae['shift']());}};_0x2844d2(++_0x2c6f39);}(_0xc485,0x105));var _0x5c48=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0xc485[_0x15f724];return _0x49b152;};'use strict';var multer=require(_0x5c48('0x0'));var util=require(_0x5c48('0x1'));var path=require(_0x5c48('0x2'));var timeout=require(_0x5c48('0x3'));var express=require(_0x5c48('0x4'));var router=express[_0x5c48('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c48('0x6'));var interaction=require(_0x5c48('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x5c48('0x8')](),controller['index']);router['get']('/:id',auth[_0x5c48('0x8')](),controller[_0x5c48('0x9')]);router['get'](_0x5c48('0xa'),auth[_0x5c48('0x8')](),controller[_0x5c48('0xb')]);router['get'](_0x5c48('0xc'),auth[_0x5c48('0x8')](),controller[_0x5c48('0xd')]);router[_0x5c48('0xe')]('/',auth[_0x5c48('0x8')](),controller[_0x5c48('0xf')]);router['post']('/:id/configurations',auth[_0x5c48('0x8')](),controller[_0x5c48('0x10')]);router[_0x5c48('0x11')](_0x5c48('0x12'),auth[_0x5c48('0x8')](),controller[_0x5c48('0x13')]);router['delete']('/:id',auth[_0x5c48('0x8')](),controller[_0x5c48('0x14')]);module[_0x5c48('0x15')]=router;
\ No newline at end of file
+var _0xba64=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x99d30d,_0x4c8882){var _0x381bf4=function(_0x24ba37){while(--_0x24ba37){_0x99d30d['push'](_0x99d30d['shift']());}};_0x381bf4(++_0x4c8882);}(_0xba64,0x188));var _0x4ba6=function(_0x5c4e5b,_0x36d835){_0x5c4e5b=_0x5c4e5b-0x0;var _0x16628b=_0xba64[_0x5c4e5b];return _0x16628b;};'use strict';var multer=require(_0x4ba6('0x0'));var util=require(_0x4ba6('0x1'));var path=require(_0x4ba6('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ba6('0x3'));var router=express[_0x4ba6('0x4')]();var fs_extra=require(_0x4ba6('0x5'));var auth=require(_0x4ba6('0x6'));var interaction=require(_0x4ba6('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x4ba6('0x8')]('/',auth[_0x4ba6('0x9')](),controller[_0x4ba6('0xa')]);router[_0x4ba6('0x8')](_0x4ba6('0xb'),auth[_0x4ba6('0x9')](),controller[_0x4ba6('0xc')]);router['get'](_0x4ba6('0xd'),auth[_0x4ba6('0x9')](),controller['getConfigurations']);router[_0x4ba6('0x8')](_0x4ba6('0xe'),auth[_0x4ba6('0x9')](),controller[_0x4ba6('0xf')]);router[_0x4ba6('0x10')]('/',auth[_0x4ba6('0x9')](),controller['create']);router[_0x4ba6('0x10')]('/:id/configurations',auth[_0x4ba6('0x9')](),controller[_0x4ba6('0x11')]);router['put'](_0x4ba6('0xb'),auth[_0x4ba6('0x9')](),controller[_0x4ba6('0x12')]);router[_0x4ba6('0x13')](_0x4ba6('0xb'),auth[_0x4ba6('0x9')](),controller[_0x4ba6('0x14')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2dae=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2dae,0xc3));var _0xe2da=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x2dae[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2da('0x1')]},'description':{'type':Sequelize[_0xe2da('0x1')]},'host':{'type':Sequelize[_0xe2da('0x1')]},'zone':{'type':Sequelize[_0xe2da('0x1')]},'clientId':{'type':Sequelize[_0xe2da('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe2da('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe2da('0x1')]},'refreshToken':{'type':Sequelize[_0xe2da('0x1')]}};
\ No newline at end of file
+var _0x9bde=['STRING','exports'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x9bde,0xe1));var _0xe9bd=function(_0xfdd9ff,_0x3f1a42){_0xfdd9ff=_0xfdd9ff-0x0;var _0x3000ea=_0x9bde[_0xfdd9ff];return _0x3000ea;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf0b6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','send','index','map','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','ZohoAccount','fields','create','body','update','params','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','display_label','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0xc61bbe,_0xc76b18){var _0x1ff9a9=function(_0x1b5562){while(--_0x1b5562){_0xc61bbe['push'](_0xc61bbe['shift']());}};_0x1ff9a9(++_0xc76b18);}(_0xf0b6,0x18a));var _0x6f0b=function(_0x525a4e,_0x3709ad){_0x525a4e=_0x525a4e-0x0;var _0x5cc484=_0xf0b6[_0x525a4e];return _0x5cc484;};'use strict';var emlformat=require(_0x6f0b('0x0'));var rimraf=require(_0x6f0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f0b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f0b('0x3'));var Mustache=require(_0x6f0b('0x4'));var util=require('util');var path=require(_0x6f0b('0x5'));var sox=require(_0x6f0b('0x6'));var csv=require(_0x6f0b('0x7'));var ejs=require(_0x6f0b('0x8'));var fs=require('fs');var fs_extra=require(_0x6f0b('0x9'));var _=require(_0x6f0b('0xa'));var squel=require(_0x6f0b('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f0b('0xc'));var deskjs=require(_0x6f0b('0xd'));var toCsv=require(_0x6f0b('0x7'));var querystring=require('querystring');var Papa=require(_0x6f0b('0xe'));var Redis=require(_0x6f0b('0xf'));var authService=require(_0x6f0b('0x10'));var qs=require(_0x6f0b('0x11'));var as=require(_0x6f0b('0x12'));var hardwareService=require(_0x6f0b('0x13'));var logger=require(_0x6f0b('0x14'))(_0x6f0b('0x15'));var utils=require(_0x6f0b('0x16'));var config=require(_0x6f0b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f0b('0x18'))['db'];var integrations=require(_0x6f0b('0x19'));function respondWithStatusCode(_0x4ab362,_0x3be129){_0x3be129=_0x3be129||0xcc;return function(_0xeb223f){if(_0xeb223f){return _0x4ab362[_0x6f0b('0x1a')](_0x3be129);}return _0x4ab362[_0x6f0b('0x1b')](_0x3be129)[_0x6f0b('0x1c')]();};}function respondWithResult(_0x20b1fd,_0x363d9e){_0x363d9e=_0x363d9e||0xc8;return function(_0xdd456c){if(_0xdd456c){return _0x20b1fd[_0x6f0b('0x1b')](_0x363d9e)[_0x6f0b('0x1d')](_0xdd456c);}};}function respondWithFilteredResult(_0x5159ef,_0x221acf){return function(_0x42d218){if(_0x42d218){var _0x1dab08=typeof _0x221acf['offset']==='undefined'&&typeof _0x221acf[_0x6f0b('0x1e')]===_0x6f0b('0x1f');var _0x199fec=_0x42d218[_0x6f0b('0x20')];var _0x48e562=_0x1dab08?0x0:_0x221acf[_0x6f0b('0x21')];var _0x1fe7d1=_0x1dab08?_0x42d218[_0x6f0b('0x20')]:_0x221acf[_0x6f0b('0x21')]+_0x221acf['limit'];var _0x10f23e;if(_0x1fe7d1>=_0x199fec){_0x1fe7d1=_0x199fec;_0x10f23e=0xc8;}else{_0x10f23e=0xce;}_0x5159ef['status'](_0x10f23e);return _0x5159ef[_0x6f0b('0x22')](_0x6f0b('0x23'),_0x48e562+'-'+_0x1fe7d1+'/'+_0x199fec)[_0x6f0b('0x1d')](_0x42d218);}return null;};}function patchUpdates(_0x7273bd){return function(_0x58a72d){try{jsonpatch[_0x6f0b('0x24')](_0x58a72d,_0x7273bd,!![]);}catch(_0x302c29){return BPromise[_0x6f0b('0x25')](_0x302c29);}return _0x58a72d[_0x6f0b('0x26')]();};}function saveUpdates(_0x1bbd89,_0x13b019){return function(_0x280ad8){if(_0x280ad8){return _0x280ad8['update'](_0x1bbd89)[_0x6f0b('0x27')](function(_0x39d7d1){return _0x39d7d1;});}return null;};}function removeEntity(_0x461509,_0x466370){return function(_0x2b16a8){if(_0x2b16a8){return _0x2b16a8[_0x6f0b('0x28')]()[_0x6f0b('0x27')](function(){_0x461509[_0x6f0b('0x1b')](0xcc)[_0x6f0b('0x1c')]();});}};}function handleEntityNotFound(_0x143031,_0x23ef14){return function(_0x568b57){if(!_0x568b57){_0x143031[_0x6f0b('0x1a')](0x194);}return _0x568b57;};}function handleError(_0x4eacb5,_0x562cea){_0x562cea=_0x562cea||0x1f4;return function(_0xa8758c){logger['error'](_0xa8758c['stack']);if(_0xa8758c['name']){delete _0xa8758c['name'];}_0x4eacb5['status'](_0x562cea)[_0x6f0b('0x29')](_0xa8758c);};}exports[_0x6f0b('0x2a')]=function(_0x1f5f82,_0x1d426f){var _0x12c545={},_0x3cf88b={},_0x742705={'count':0x0,'rows':[]};var _0x6758ae=_[_0x6f0b('0x2b')](db['ZohoAccount'][_0x6f0b('0x2c')],function(_0x1dabf0){return{'name':_0x1dabf0[_0x6f0b('0x2d')],'type':_0x1dabf0[_0x6f0b('0x2e')][_0x6f0b('0x2f')]};});_0x3cf88b['model']=_[_0x6f0b('0x2b')](_0x6758ae,_0x6f0b('0x30'));_0x3cf88b['query']=_[_0x6f0b('0x31')](_0x1f5f82[_0x6f0b('0x32')]);_0x3cf88b[_0x6f0b('0x33')]=_[_0x6f0b('0x34')](_0x3cf88b[_0x6f0b('0x35')],_0x3cf88b['query']);_0x12c545[_0x6f0b('0x36')]=_[_0x6f0b('0x34')](_0x3cf88b['model'],qs['fields'](_0x1f5f82[_0x6f0b('0x32')]['fields']));_0x12c545['attributes']=_0x12c545['attributes'][_0x6f0b('0x37')]?_0x12c545['attributes']:_0x3cf88b[_0x6f0b('0x35')];if(!_0x1f5f82['query'][_0x6f0b('0x38')](_0x6f0b('0x39'))){_0x12c545['limit']=qs[_0x6f0b('0x1e')](_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x1e')]);_0x12c545['offset']=qs['offset'](_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x21')]);}_0x12c545[_0x6f0b('0x3a')]=qs[_0x6f0b('0x3b')](_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x3b')]);_0x12c545['where']=qs[_0x6f0b('0x33')](_[_0x6f0b('0x3c')](_0x1f5f82['query'],_0x3cf88b[_0x6f0b('0x33')]),_0x6758ae);if(_0x1f5f82['query'][_0x6f0b('0x3d')]){_0x12c545[_0x6f0b('0x3e')]=_[_0x6f0b('0x3f')](_0x12c545[_0x6f0b('0x3e')],{'$or':_[_0x6f0b('0x2b')](_0x6758ae,function(_0x1cdf7b){if(_0x1cdf7b[_0x6f0b('0x2e')]!=='VIRTUAL'){var _0x3410b2={};_0x3410b2[_0x1cdf7b[_0x6f0b('0x30')]]={'$like':'%'+_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x3d')]+'%'};return _0x3410b2;}})});}_0x12c545=_[_0x6f0b('0x3f')]({},_0x12c545,_0x1f5f82[_0x6f0b('0x40')]);var _0x1bcb3e={'where':_0x12c545[_0x6f0b('0x3e')]};return db['ZohoAccount']['count'](_0x1bcb3e)['then'](function(_0xc67179){_0x742705['count']=_0xc67179;if(_0x1f5f82[_0x6f0b('0x32')][_0x6f0b('0x41')]){_0x12c545[_0x6f0b('0x42')]=[{'all':!![]}];}return db['ZohoAccount'][_0x6f0b('0x43')](_0x12c545);})[_0x6f0b('0x27')](function(_0x15a8a9){_0x742705[_0x6f0b('0x44')]=_0x15a8a9;return _0x742705;})[_0x6f0b('0x27')](respondWithFilteredResult(_0x1d426f,_0x12c545))[_0x6f0b('0x45')](handleError(_0x1d426f,null));};exports['show']=function(_0xdaf67c,_0x51a136){var _0x281ee1={'raw':![],'where':{'id':_0xdaf67c['params']['id']}},_0x2b6992={};_0x2b6992[_0x6f0b('0x35')]=_[_0x6f0b('0x31')](db[_0x6f0b('0x46')][_0x6f0b('0x2c')]);_0x2b6992['query']=_[_0x6f0b('0x31')](_0xdaf67c[_0x6f0b('0x32')]);_0x2b6992[_0x6f0b('0x33')]=_['intersection'](_0x2b6992[_0x6f0b('0x35')],_0x2b6992[_0x6f0b('0x32')]);_0x281ee1[_0x6f0b('0x36')]=_[_0x6f0b('0x34')](_0x2b6992[_0x6f0b('0x35')],qs['fields'](_0xdaf67c[_0x6f0b('0x32')][_0x6f0b('0x47')]));_0x281ee1[_0x6f0b('0x36')]=_0x281ee1[_0x6f0b('0x36')][_0x6f0b('0x37')]?_0x281ee1[_0x6f0b('0x36')]:_0x2b6992[_0x6f0b('0x35')];if(_0xdaf67c[_0x6f0b('0x32')][_0x6f0b('0x41')]){_0x281ee1[_0x6f0b('0x42')]=[{'all':!![]}];}_0x281ee1=_[_0x6f0b('0x3f')]({},_0x281ee1,_0xdaf67c[_0x6f0b('0x40')]);return db[_0x6f0b('0x46')]['find'](_0x281ee1)[_0x6f0b('0x27')](handleEntityNotFound(_0x51a136,null))[_0x6f0b('0x27')](respondWithResult(_0x51a136,null))[_0x6f0b('0x45')](handleError(_0x51a136,null));};exports[_0x6f0b('0x48')]=function(_0x21edda,_0x3df0e9){return db['ZohoAccount'][_0x6f0b('0x48')](_0x21edda[_0x6f0b('0x49')],{})[_0x6f0b('0x27')](respondWithResult(_0x3df0e9,0xc9))['catch'](handleError(_0x3df0e9,null));};exports[_0x6f0b('0x4a')]=function(_0x5c82fc,_0xf69340){if(_0x5c82fc[_0x6f0b('0x49')]['id']){delete _0x5c82fc[_0x6f0b('0x49')]['id'];}return db[_0x6f0b('0x46')]['find']({'where':{'id':_0x5c82fc[_0x6f0b('0x4b')]['id']}})[_0x6f0b('0x27')](handleEntityNotFound(_0xf69340,null))[_0x6f0b('0x27')](saveUpdates(_0x5c82fc[_0x6f0b('0x49')],null))[_0x6f0b('0x27')](respondWithResult(_0xf69340,null))['catch'](handleError(_0xf69340,null));};exports['destroy']=function(_0x5954c8,_0x234265){return db[_0x6f0b('0x46')][_0x6f0b('0x4c')]({'where':{'id':_0x5954c8[_0x6f0b('0x4b')]['id']}})[_0x6f0b('0x27')](handleEntityNotFound(_0x234265,null))['then'](removeEntity(_0x234265,null))[_0x6f0b('0x45')](handleError(_0x234265,null));};exports[_0x6f0b('0x4d')]=function(_0x4d5c86,_0x4d8129,_0x490445){var _0x52aafc={};var _0x35c117={};var _0x1b34c1;var _0x863e33;return db[_0x6f0b('0x46')][_0x6f0b('0x4e')]({'where':{'id':_0x4d5c86['params']['id']}})[_0x6f0b('0x27')](handleEntityNotFound(_0x4d8129,null))[_0x6f0b('0x27')](function(_0x40a81d){if(_0x40a81d){_0x1b34c1=_0x40a81d;_0x35c117['model']=_[_0x6f0b('0x31')](db[_0x6f0b('0x4f')][_0x6f0b('0x2c')]);_0x35c117[_0x6f0b('0x32')]=_[_0x6f0b('0x31')](_0x4d5c86['query']);_0x35c117[_0x6f0b('0x33')]=_[_0x6f0b('0x34')](_0x35c117[_0x6f0b('0x35')],_0x35c117[_0x6f0b('0x32')]);_0x52aafc[_0x6f0b('0x36')]=_[_0x6f0b('0x34')](_0x35c117[_0x6f0b('0x35')],qs[_0x6f0b('0x47')](_0x4d5c86[_0x6f0b('0x32')]['fields']));_0x52aafc['attributes']=_0x52aafc[_0x6f0b('0x36')]['length']?_0x52aafc[_0x6f0b('0x36')]:_0x35c117[_0x6f0b('0x35')];_0x52aafc['order']=qs['sort'](_0x4d5c86['query'][_0x6f0b('0x3b')]);_0x52aafc[_0x6f0b('0x3e')]=qs[_0x6f0b('0x33')](_[_0x6f0b('0x3c')](_0x4d5c86[_0x6f0b('0x32')],_0x35c117[_0x6f0b('0x33')]));if(_0x4d5c86[_0x6f0b('0x32')][_0x6f0b('0x3d')]){_0x52aafc[_0x6f0b('0x3e')]=_[_0x6f0b('0x3f')](_0x52aafc[_0x6f0b('0x3e')],{'$or':_[_0x6f0b('0x2b')](_0x52aafc[_0x6f0b('0x36')],function(_0xae360d){var _0x3e61a4={};_0x3e61a4[_0xae360d]={'$like':'%'+_0x4d5c86[_0x6f0b('0x32')][_0x6f0b('0x3d')]+'%'};return _0x3e61a4;})});}_0x52aafc=_[_0x6f0b('0x3f')]({},_0x52aafc,_0x4d5c86[_0x6f0b('0x40')]);return _0x1b34c1['getConfigurations'](_0x52aafc);}})['then'](function(_0x429e72){if(_0x429e72){_0x863e33=_0x429e72[_0x6f0b('0x37')];if(!_0x4d5c86['query'][_0x6f0b('0x38')]('nolimit')){_0x52aafc[_0x6f0b('0x1e')]=qs[_0x6f0b('0x1e')](_0x4d5c86['query'][_0x6f0b('0x1e')]);_0x52aafc[_0x6f0b('0x21')]=qs[_0x6f0b('0x21')](_0x4d5c86[_0x6f0b('0x32')]['offset']);}return _0x1b34c1[_0x6f0b('0x4d')](_0x52aafc);}})[_0x6f0b('0x27')](function(_0x4917e2){if(_0x4917e2){return _0x4917e2?{'count':_0x863e33,'rows':_0x4917e2}:null;}})['then'](respondWithResult(_0x4d8129,null))[_0x6f0b('0x45')](handleError(_0x4d8129,null));};exports[_0x6f0b('0x50')]=function(_0x56636b,_0x8917d9,_0x321525){if(_0x56636b[_0x6f0b('0x49')]['id']){delete _0x56636b[_0x6f0b('0x49')]['id'];}return db['ZohoAccount'][_0x6f0b('0x4e')]({'where':{'id':_0x56636b[_0x6f0b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8917d9,null))[_0x6f0b('0x27')](function(_0x1ae2bc){if(_0x1ae2bc){_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x51')]=_0x1ae2bc['id'];_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x52')]=integrations[_0x6f0b('0x53')](_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x54')],_0x56636b['body']['type']);_0x56636b[_0x6f0b('0x49')]['Descriptions']=integrations[_0x6f0b('0x55')](_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x54')],_0x56636b[_0x6f0b('0x49')][_0x6f0b('0x2e')]);return db[_0x6f0b('0x4f')]['create'](_0x56636b[_0x6f0b('0x49')],{'include':[{'model':db['ZohoField'],'as':_0x6f0b('0x52')},{'model':db[_0x6f0b('0x56')],'as':_0x6f0b('0x57')}]});}return null;})[_0x6f0b('0x27')](respondWithResult(_0x8917d9,null))[_0x6f0b('0x45')](handleError(_0x8917d9,null));};function getAccessToken(_0x55e4a6){return new Promise(function(_0x2288ac,_0x2f561c){var _0x13f33e;switch(_0x55e4a6['zone']){case'US':_0x13f33e=_0x6f0b('0x58');break;case'AU':_0x13f33e=_0x6f0b('0x59');break;case'EU':_0x13f33e=_0x6f0b('0x5a');break;case'IN':_0x13f33e=_0x6f0b('0x5b');break;case'CN':_0x13f33e=_0x6f0b('0x5c');break;default:_0x13f33e='https://accounts.zoho.eu';break;}var _0x570a05={'method':'POST','uri':_0x13f33e+_0x6f0b('0x5d'),'qs':{'refresh_token':_0x55e4a6[_0x6f0b('0x5e')],'client_id':_0x55e4a6[_0x6f0b('0x5f')],'client_secret':_0x55e4a6[_0x6f0b('0x60')],'grant_type':_0x6f0b('0x61')},'json':!![]};return rp(_0x570a05)[_0x6f0b('0x27')](function(_0x6e4dbe){if(_0x6e4dbe[_0x6f0b('0x62')]){_0x2288ac(_0x6e4dbe[_0x6f0b('0x62')]);}else{_0x2f561c(_0x6f0b('0x63'));}})[_0x6f0b('0x45')](function(_0x4dd53d){_0x2f561c(_0x4dd53d);});});}exports['getFields']=function(_0x126b98,_0x41f4ea,_0x7648bd){var _0x2b75b3,_0x25533b,_0x223ccb,_0xc903f3,_0x37bf0f;return db[_0x6f0b('0x46')]['findOne']({'where':{'id':_0x126b98[_0x6f0b('0x4b')]['id']},'attributes':['id',_0x6f0b('0x64'),_0x6f0b('0x65'),_0x6f0b('0x5f'),_0x6f0b('0x60'),_0x6f0b('0x66'),'code',_0x6f0b('0x5e')]})[_0x6f0b('0x27')](handleEntityNotFound(_0x41f4ea,null))[_0x6f0b('0x27')](function(_0x3fb51f){_0x37bf0f=_0x3fb51f;_0x2b75b3=_0x37bf0f['host'];_0x25533b=_0x2b75b3===_0x6f0b('0x67')?'eu':_0x6f0b('0x68');_0x223ccb=_0x37bf0f[_0x6f0b('0x66')];var _0x5bf708=_0x223ccb[_0x6f0b('0x69')](-0x1);if(_0x5bf708==='/'||_0x5bf708==='\x5c'||_0x5bf708===':'){_0x223ccb=_0x223ccb[_0x6f0b('0x6a')](0x0,_0x223ccb[_0x6f0b('0x6b')](_0x5bf708));}if(!_0x37bf0f[_0x6f0b('0x5e')]){throw new Error(_0x6f0b('0x6c'));}return getAccessToken(_0x37bf0f);})[_0x6f0b('0x27')](function(_0xa5082){if(_0xa5082){return rp({'method':_0x6f0b('0x6d'),'uri':util[_0x6f0b('0x6e')](_0x6f0b('0x6f'),_0x25533b),'qs':{'module':_0x6f0b('0x70')},'headers':{'Authorization':_0x6f0b('0x71')+_0xa5082},'json':!![]});}})[_0x6f0b('0x27')](function(_0x1572b8){if(_0x1572b8){if(_0x1572b8[_0x6f0b('0x72')]&&_0x1572b8[_0x6f0b('0x72')][_0x6f0b('0x73')]){throw new Error(_0x1572b8[_0x6f0b('0x72')]['error']['message']);}var _0x5119f1=[];var _0x52558e=[];var _0x52c480=[_0x6f0b('0x74'),_0x6f0b('0x75'),_0x6f0b('0x76'),_0x6f0b('0x77'),_0x6f0b('0x78'),_0x6f0b('0x79'),_0x6f0b('0x7a'),'Call_Type'];_0x52558e=_[_0x6f0b('0x7b')](_0x1572b8[_0x6f0b('0x47')],function(_0xecd638){return _0x52c480[_0x6f0b('0x7c')](_0xecd638[_0x6f0b('0x7d')]);});for(var _0x5f2815=0x0;_0x5f2815<_0x52558e[_0x6f0b('0x37')];_0x5f2815++){if(_0x52558e[_0x5f2815][_0x6f0b('0x7e')]===![]){_0x5119f1['push']({'id':_0x52558e[_0x5f2815]['id'],'name':_0x52558e[_0x5f2815][_0x6f0b('0x7f')],'custom':_0x52558e[_0x5f2815]['custom_field'],'options':_0x52558e[_0x5f2815][_0x6f0b('0x80')]==='picklist'&&_0x52558e[_0x5f2815][_0x6f0b('0x81')][_0x6f0b('0x37')]>-0x1?_[_0x6f0b('0x2b')](_0x52558e[_0x5f2815][_0x6f0b('0x81')],function(_0x4431de){return{'name':_0x4431de,'value':_0x4431de};}):[]});}}return{'count':_0x5119f1[_0x6f0b('0x37')],'rows':_0x5119f1};}else{return{'count':0x0,'rows':[]};}})[_0x6f0b('0x27')](respondWithResult(_0x41f4ea,null))['catch'](function(_0x511da1){var _0x19f376=_0x126b98[_0x6f0b('0x32')]['test']?0x1f4:_0x511da1[_0x6f0b('0x82')]||0x1f4;logger[_0x6f0b('0x73')](_0x6f0b('0x83'),_0x6f0b('0x84'),_0x19f376,JSON[_0x6f0b('0x85')](_0x511da1));delete _0x511da1['name'];if(_0x19f376===0x191){_0x19f376=0x190;}_0x41f4ea[_0x6f0b('0x1b')](_0x19f376)[_0x6f0b('0x29')](_0x126b98[_0x6f0b('0x32')][_0x6f0b('0x86')]?{'message':_0x6f0b('0x87'),'statusCode':_0x511da1[_0x6f0b('0x82')]}:_0x511da1);});};
\ No newline at end of file
+var _0x2617=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','ZohoAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','update','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','refreshToken','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x2617,0x184));var _0x7261=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0x2617[_0x46f7f0];return _0x783786;};'use strict';var emlformat=require(_0x7261('0x0'));var rimraf=require(_0x7261('0x1'));var zipdir=require(_0x7261('0x2'));var jsonpatch=require(_0x7261('0x3'));var rp=require(_0x7261('0x4'));var moment=require(_0x7261('0x5'));var BPromise=require(_0x7261('0x6'));var Mustache=require(_0x7261('0x7'));var util=require(_0x7261('0x8'));var path=require(_0x7261('0x9'));var sox=require(_0x7261('0xa'));var csv=require(_0x7261('0xb'));var ejs=require(_0x7261('0xc'));var fs=require('fs');var fs_extra=require(_0x7261('0xd'));var _=require(_0x7261('0xe'));var squel=require(_0x7261('0xf'));var crypto=require(_0x7261('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x7261('0x11'));var toCsv=require(_0x7261('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7261('0x12'));var authService=require(_0x7261('0x13'));var qs=require(_0x7261('0x14'));var as=require(_0x7261('0x15'));var hardwareService=require(_0x7261('0x16'));var logger=require(_0x7261('0x17'))(_0x7261('0x18'));var utils=require('../../config/utils');var config=require(_0x7261('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7261('0x1a'))['db'];var integrations=require(_0x7261('0x1b'));function respondWithStatusCode(_0x3a1c92,_0x1ba15e){_0x1ba15e=_0x1ba15e||0xcc;return function(_0x1f42c2){if(_0x1f42c2){return _0x3a1c92[_0x7261('0x1c')](_0x1ba15e);}return _0x3a1c92[_0x7261('0x1d')](_0x1ba15e)[_0x7261('0x1e')]();};}function respondWithResult(_0x2c0009,_0x440d56){_0x440d56=_0x440d56||0xc8;return function(_0x43199c){if(_0x43199c){return _0x2c0009[_0x7261('0x1d')](_0x440d56)['json'](_0x43199c);}};}function respondWithFilteredResult(_0x3d75b1,_0x467ac2){return function(_0x230f86){if(_0x230f86){var _0x1a836b=typeof _0x467ac2[_0x7261('0x1f')]===_0x7261('0x20')&&typeof _0x467ac2[_0x7261('0x21')]==='undefined';var _0x15662c=_0x230f86['count'];var _0x18fbad=_0x1a836b?0x0:_0x467ac2[_0x7261('0x1f')];var _0x1baa2=_0x1a836b?_0x230f86['count']:_0x467ac2[_0x7261('0x1f')]+_0x467ac2['limit'];var _0x343f94;if(_0x1baa2>=_0x15662c){_0x1baa2=_0x15662c;_0x343f94=0xc8;}else{_0x343f94=0xce;}_0x3d75b1[_0x7261('0x1d')](_0x343f94);return _0x3d75b1[_0x7261('0x22')](_0x7261('0x23'),_0x18fbad+'-'+_0x1baa2+'/'+_0x15662c)[_0x7261('0x24')](_0x230f86);}return null;};}function patchUpdates(_0x15d80f){return function(_0x226202){try{jsonpatch[_0x7261('0x25')](_0x226202,_0x15d80f,!![]);}catch(_0x2d6391){return BPromise[_0x7261('0x26')](_0x2d6391);}return _0x226202[_0x7261('0x27')]();};}function saveUpdates(_0x1ae8fb,_0x37fbf3){return function(_0x1dc855){if(_0x1dc855){return _0x1dc855['update'](_0x1ae8fb)['then'](function(_0x426858){return _0x426858;});}return null;};}function removeEntity(_0x368a9b,_0x1b21b5){return function(_0x5ed6b8){if(_0x5ed6b8){return _0x5ed6b8[_0x7261('0x28')]()[_0x7261('0x29')](function(){_0x368a9b[_0x7261('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d68c3,_0x23c4f4){return function(_0x12e315){if(!_0x12e315){_0x1d68c3[_0x7261('0x1c')](0x194);}return _0x12e315;};}function handleError(_0x693d4,_0x502f80){_0x502f80=_0x502f80||0x1f4;return function(_0x4ded37){logger[_0x7261('0x2a')](_0x4ded37[_0x7261('0x2b')]);if(_0x4ded37[_0x7261('0x2c')]){delete _0x4ded37[_0x7261('0x2c')];}_0x693d4[_0x7261('0x1d')](_0x502f80)[_0x7261('0x2d')](_0x4ded37);};}exports[_0x7261('0x2e')]=function(_0x435903,_0x2d041f){var _0x45782d={},_0x1d961a={},_0x287ca8={'count':0x0,'rows':[]};var _0x18d224=_[_0x7261('0x2f')](db[_0x7261('0x30')]['rawAttributes'],function(_0x61b78f){return{'name':_0x61b78f[_0x7261('0x31')],'type':_0x61b78f['type'][_0x7261('0x32')]};});_0x1d961a[_0x7261('0x33')]=_[_0x7261('0x2f')](_0x18d224,'name');_0x1d961a[_0x7261('0x34')]=_[_0x7261('0x35')](_0x435903['query']);_0x1d961a['filters']=_[_0x7261('0x36')](_0x1d961a[_0x7261('0x33')],_0x1d961a[_0x7261('0x34')]);_0x45782d[_0x7261('0x37')]=_[_0x7261('0x36')](_0x1d961a['model'],qs['fields'](_0x435903[_0x7261('0x34')][_0x7261('0x38')]));_0x45782d[_0x7261('0x37')]=_0x45782d[_0x7261('0x37')][_0x7261('0x39')]?_0x45782d[_0x7261('0x37')]:_0x1d961a['model'];if(!_0x435903[_0x7261('0x34')][_0x7261('0x3a')](_0x7261('0x3b'))){_0x45782d['limit']=qs['limit'](_0x435903[_0x7261('0x34')][_0x7261('0x21')]);_0x45782d[_0x7261('0x1f')]=qs['offset'](_0x435903[_0x7261('0x34')][_0x7261('0x1f')]);}_0x45782d[_0x7261('0x3c')]=qs['sort'](_0x435903[_0x7261('0x34')][_0x7261('0x3d')]);_0x45782d[_0x7261('0x3e')]=qs[_0x7261('0x3f')](_[_0x7261('0x40')](_0x435903['query'],_0x1d961a['filters']),_0x18d224);if(_0x435903['query'][_0x7261('0x41')]){_0x45782d[_0x7261('0x3e')]=_['merge'](_0x45782d[_0x7261('0x3e')],{'$or':_[_0x7261('0x2f')](_0x18d224,function(_0x3e5353){if(_0x3e5353[_0x7261('0x42')]!=='VIRTUAL'){var _0x4ce808={};_0x4ce808[_0x3e5353['name']]={'$like':'%'+_0x435903[_0x7261('0x34')][_0x7261('0x41')]+'%'};return _0x4ce808;}})});}_0x45782d=_[_0x7261('0x43')]({},_0x45782d,_0x435903[_0x7261('0x44')]);var _0x30c047={'where':_0x45782d[_0x7261('0x3e')]};return db['ZohoAccount']['count'](_0x30c047)[_0x7261('0x29')](function(_0x2c5a32){_0x287ca8['count']=_0x2c5a32;if(_0x435903[_0x7261('0x34')][_0x7261('0x45')]){_0x45782d[_0x7261('0x46')]=[{'all':!![]}];}return db[_0x7261('0x30')][_0x7261('0x47')](_0x45782d);})[_0x7261('0x29')](function(_0x211ba0){_0x287ca8['rows']=_0x211ba0;return _0x287ca8;})[_0x7261('0x29')](respondWithFilteredResult(_0x2d041f,_0x45782d))[_0x7261('0x48')](handleError(_0x2d041f,null));};exports[_0x7261('0x49')]=function(_0x149eb5,_0xfd1a5c){var _0x482756={'raw':![],'where':{'id':_0x149eb5[_0x7261('0x4a')]['id']}},_0x315763={};_0x315763[_0x7261('0x33')]=_[_0x7261('0x35')](db[_0x7261('0x30')][_0x7261('0x4b')]);_0x315763[_0x7261('0x34')]=_['keys'](_0x149eb5['query']);_0x315763[_0x7261('0x3f')]=_[_0x7261('0x36')](_0x315763[_0x7261('0x33')],_0x315763['query']);_0x482756['attributes']=_[_0x7261('0x36')](_0x315763[_0x7261('0x33')],qs['fields'](_0x149eb5[_0x7261('0x34')][_0x7261('0x38')]));_0x482756[_0x7261('0x37')]=_0x482756[_0x7261('0x37')]['length']?_0x482756['attributes']:_0x315763[_0x7261('0x33')];if(_0x149eb5['query']['includeAll']){_0x482756[_0x7261('0x46')]=[{'all':!![]}];}_0x482756=_[_0x7261('0x43')]({},_0x482756,_0x149eb5[_0x7261('0x44')]);return db['ZohoAccount'][_0x7261('0x4c')](_0x482756)[_0x7261('0x29')](handleEntityNotFound(_0xfd1a5c,null))[_0x7261('0x29')](respondWithResult(_0xfd1a5c,null))[_0x7261('0x48')](handleError(_0xfd1a5c,null));};exports[_0x7261('0x4d')]=function(_0x4d0358,_0x3c0a16){return db['ZohoAccount'][_0x7261('0x4d')](_0x4d0358['body'],{})[_0x7261('0x29')](respondWithResult(_0x3c0a16,0xc9))['catch'](handleError(_0x3c0a16,null));};exports[_0x7261('0x4e')]=function(_0x2af75d,_0x15834c){if(_0x2af75d[_0x7261('0x4f')]['id']){delete _0x2af75d[_0x7261('0x4f')]['id'];}return db[_0x7261('0x30')][_0x7261('0x4c')]({'where':{'id':_0x2af75d[_0x7261('0x4a')]['id']}})[_0x7261('0x29')](handleEntityNotFound(_0x15834c,null))[_0x7261('0x29')](saveUpdates(_0x2af75d[_0x7261('0x4f')],null))['then'](respondWithResult(_0x15834c,null))[_0x7261('0x48')](handleError(_0x15834c,null));};exports[_0x7261('0x28')]=function(_0x1f4bd2,_0x47d82c){return db[_0x7261('0x30')]['find']({'where':{'id':_0x1f4bd2[_0x7261('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47d82c,null))[_0x7261('0x29')](removeEntity(_0x47d82c,null))[_0x7261('0x48')](handleError(_0x47d82c,null));};exports['getConfigurations']=function(_0x23a1e1,_0x53e563,_0x39403e){var _0x2b7c53={};var _0x2a4311={};var _0x59c703;var _0x37e010;return db['ZohoAccount'][_0x7261('0x50')]({'where':{'id':_0x23a1e1[_0x7261('0x4a')]['id']}})[_0x7261('0x29')](handleEntityNotFound(_0x53e563,null))[_0x7261('0x29')](function(_0x305d09){if(_0x305d09){_0x59c703=_0x305d09;_0x2a4311['model']=_[_0x7261('0x35')](db[_0x7261('0x51')]['rawAttributes']);_0x2a4311[_0x7261('0x34')]=_[_0x7261('0x35')](_0x23a1e1[_0x7261('0x34')]);_0x2a4311[_0x7261('0x3f')]=_[_0x7261('0x36')](_0x2a4311[_0x7261('0x33')],_0x2a4311[_0x7261('0x34')]);_0x2b7c53[_0x7261('0x37')]=_[_0x7261('0x36')](_0x2a4311[_0x7261('0x33')],qs[_0x7261('0x38')](_0x23a1e1[_0x7261('0x34')][_0x7261('0x38')]));_0x2b7c53[_0x7261('0x37')]=_0x2b7c53['attributes']['length']?_0x2b7c53['attributes']:_0x2a4311[_0x7261('0x33')];_0x2b7c53[_0x7261('0x3c')]=qs[_0x7261('0x3d')](_0x23a1e1[_0x7261('0x34')]['sort']);_0x2b7c53[_0x7261('0x3e')]=qs['filters'](_[_0x7261('0x40')](_0x23a1e1[_0x7261('0x34')],_0x2a4311[_0x7261('0x3f')]));if(_0x23a1e1[_0x7261('0x34')][_0x7261('0x41')]){_0x2b7c53[_0x7261('0x3e')]=_[_0x7261('0x43')](_0x2b7c53[_0x7261('0x3e')],{'$or':_[_0x7261('0x2f')](_0x2b7c53[_0x7261('0x37')],function(_0xf2cb10){var _0xb44cf8={};_0xb44cf8[_0xf2cb10]={'$like':'%'+_0x23a1e1[_0x7261('0x34')][_0x7261('0x41')]+'%'};return _0xb44cf8;})});}_0x2b7c53=_[_0x7261('0x43')]({},_0x2b7c53,_0x23a1e1[_0x7261('0x44')]);return _0x59c703[_0x7261('0x52')](_0x2b7c53);}})['then'](function(_0x5474f0){if(_0x5474f0){_0x37e010=_0x5474f0[_0x7261('0x39')];if(!_0x23a1e1[_0x7261('0x34')]['hasOwnProperty'](_0x7261('0x3b'))){_0x2b7c53[_0x7261('0x21')]=qs[_0x7261('0x21')](_0x23a1e1[_0x7261('0x34')][_0x7261('0x21')]);_0x2b7c53[_0x7261('0x1f')]=qs[_0x7261('0x1f')](_0x23a1e1['query'][_0x7261('0x1f')]);}return _0x59c703['getConfigurations'](_0x2b7c53);}})[_0x7261('0x29')](function(_0x113574){if(_0x113574){return _0x113574?{'count':_0x37e010,'rows':_0x113574}:null;}})[_0x7261('0x29')](respondWithResult(_0x53e563,null))[_0x7261('0x48')](handleError(_0x53e563,null));};exports[_0x7261('0x53')]=function(_0x34c365,_0x37a8cd,_0x83bc38){if(_0x34c365[_0x7261('0x4f')]['id']){delete _0x34c365[_0x7261('0x4f')]['id'];}return db[_0x7261('0x30')][_0x7261('0x50')]({'where':{'id':_0x34c365['params']['id']}})[_0x7261('0x29')](handleEntityNotFound(_0x37a8cd,null))[_0x7261('0x29')](function(_0x21dc69){if(_0x21dc69){_0x34c365['body'][_0x7261('0x54')]=_0x21dc69['id'];_0x34c365[_0x7261('0x4f')][_0x7261('0x55')]=integrations['getSubjects'](_0x34c365[_0x7261('0x4f')][_0x7261('0x56')],_0x34c365[_0x7261('0x4f')]['type']);_0x34c365['body']['Descriptions']=integrations[_0x7261('0x57')](_0x34c365['body'][_0x7261('0x56')],_0x34c365[_0x7261('0x4f')][_0x7261('0x42')]);return db[_0x7261('0x51')][_0x7261('0x4d')](_0x34c365['body'],{'include':[{'model':db[_0x7261('0x58')],'as':_0x7261('0x55')},{'model':db[_0x7261('0x58')],'as':_0x7261('0x59')}]});}return null;})['then'](respondWithResult(_0x37a8cd,null))[_0x7261('0x48')](handleError(_0x37a8cd,null));};function getAccessToken(_0x13b9a4){return new Promise(function(_0x13452e,_0x1dd3ec){var _0xe90542;switch(_0x13b9a4[_0x7261('0x5a')]){case'US':_0xe90542='https://accounts.zoho.com';break;case'AU':_0xe90542=_0x7261('0x5b');break;case'EU':_0xe90542=_0x7261('0x5c');break;case'IN':_0xe90542='https://accounts.zoho.in';break;case'CN':_0xe90542=_0x7261('0x5d');break;default:_0xe90542=_0x7261('0x5c');break;}var _0x79ff01={'method':_0x7261('0x5e'),'uri':_0xe90542+'/oauth/v2/token','qs':{'refresh_token':_0x13b9a4['refreshToken'],'client_id':_0x13b9a4['clientId'],'client_secret':_0x13b9a4[_0x7261('0x5f')],'grant_type':_0x7261('0x60')},'json':!![]};return rp(_0x79ff01)[_0x7261('0x29')](function(_0x1452db){if(_0x1452db[_0x7261('0x61')]){_0x13452e(_0x1452db[_0x7261('0x61')]);}else{_0x1dd3ec(_0x7261('0x62'));}})[_0x7261('0x48')](function(_0x36989f){_0x1dd3ec(_0x36989f);});});}exports[_0x7261('0x63')]=function(_0x203cb6,_0x1e9608,_0x3f59a4){var _0x32906b,_0x561009,_0x5332e0,_0x59291b,_0x51c8d6;return db[_0x7261('0x30')][_0x7261('0x50')]({'where':{'id':_0x203cb6[_0x7261('0x4a')]['id']},'attributes':['id',_0x7261('0x64'),_0x7261('0x5a'),_0x7261('0x65'),_0x7261('0x5f'),_0x7261('0x66'),_0x7261('0x67'),_0x7261('0x68')]})[_0x7261('0x29')](handleEntityNotFound(_0x1e9608,null))[_0x7261('0x29')](function(_0x4b9e8f){_0x51c8d6=_0x4b9e8f;_0x32906b=_0x51c8d6[_0x7261('0x64')];_0x561009=_0x32906b==='zoho.eu'?'eu':_0x7261('0x69');_0x5332e0=_0x51c8d6['serverUrl'];var _0x8fb4f8=_0x5332e0[_0x7261('0x6a')](-0x1);if(_0x8fb4f8==='/'||_0x8fb4f8==='\x5c'||_0x8fb4f8===':'){_0x5332e0=_0x5332e0[_0x7261('0x6b')](0x0,_0x5332e0['lastIndexOf'](_0x8fb4f8));}if(!_0x51c8d6[_0x7261('0x68')]){throw new Error(_0x7261('0x6c'));}return getAccessToken(_0x51c8d6);})[_0x7261('0x29')](function(_0x2185c0){if(_0x2185c0){return rp({'method':_0x7261('0x6d'),'uri':util[_0x7261('0x6e')](_0x7261('0x6f'),_0x561009),'qs':{'module':_0x7261('0x70')},'headers':{'Authorization':_0x7261('0x71')+_0x2185c0},'json':!![]});}})[_0x7261('0x29')](function(_0x41a0e0){if(_0x41a0e0){if(_0x41a0e0[_0x7261('0x72')]&&_0x41a0e0[_0x7261('0x72')][_0x7261('0x2a')]){throw new Error(_0x41a0e0[_0x7261('0x72')][_0x7261('0x2a')][_0x7261('0x73')]);}var _0x5f5a1d=[];var _0x3dec67=[];var _0x6265ad=['Owner',_0x7261('0x74'),_0x7261('0x75'),_0x7261('0x76'),'Call_Duration',_0x7261('0x77'),_0x7261('0x78'),_0x7261('0x79')];_0x3dec67=_[_0x7261('0x7a')](_0x41a0e0[_0x7261('0x38')],function(_0x4554fb){return _0x6265ad[_0x7261('0x7b')](_0x4554fb[_0x7261('0x7c')]);});for(var _0x3c2abc=0x0;_0x3c2abc<_0x3dec67[_0x7261('0x39')];_0x3c2abc++){if(_0x3dec67[_0x3c2abc][_0x7261('0x7d')]===![]){_0x5f5a1d[_0x7261('0x7e')]({'id':_0x3dec67[_0x3c2abc]['id'],'name':_0x3dec67[_0x3c2abc][_0x7261('0x7f')],'custom':_0x3dec67[_0x3c2abc]['custom_field'],'options':_0x3dec67[_0x3c2abc][_0x7261('0x80')]===_0x7261('0x81')&&_0x3dec67[_0x3c2abc][_0x7261('0x82')]['length']>-0x1?_[_0x7261('0x2f')](_0x3dec67[_0x3c2abc][_0x7261('0x82')],function(_0x572e7f){return{'name':_0x572e7f,'value':_0x572e7f};}):[]});}}return{'count':_0x5f5a1d[_0x7261('0x39')],'rows':_0x5f5a1d};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x1e9608,null))[_0x7261('0x48')](function(_0x8c43f5){var _0x3676e3=_0x203cb6['query'][_0x7261('0x83')]?0x1f4:_0x8c43f5[_0x7261('0x84')]||0x1f4;logger[_0x7261('0x2a')](_0x7261('0x85'),_0x7261('0x63'),_0x3676e3,JSON[_0x7261('0x86')](_0x8c43f5));delete _0x8c43f5['name'];if(_0x3676e3===0x191){_0x3676e3=0x190;}_0x1e9608['status'](_0x3676e3)['send'](_0x203cb6[_0x7261('0x34')][_0x7261('0x83')]?{'message':'Wrong\x20credentials','statusCode':_0x8c43f5[_0x7261('0x84')]}:_0x8c43f5);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x26a2=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','https://accounts.zoho.eu','authorization_code','lodash'];(function(_0x39b3fe,_0x169336){var _0x5234e4=function(_0x31b337){while(--_0x31b337){_0x39b3fe['push'](_0x39b3fe['shift']());}};_0x5234e4(++_0x169336);}(_0x26a2,0x125));var _0x226a=function(_0x252943,_0x21fb5e){_0x252943=_0x252943-0x0;var _0x36bb91=_0x26a2[_0x252943];return _0x36bb91;};'use strict';var _=require(_0x226a('0x0'));var util=require('util');var logger=require(_0x226a('0x1'))(_0x226a('0x2'));var moment=require('moment');var BPromise=require(_0x226a('0x3'));var rp=require(_0x226a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226a('0x5'));var config=require(_0x226a('0x6'));var attributes=require(_0x226a('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x226a('0x8')]=function(_0x52db37,_0x4f58be){return _0x52db37[_0x226a('0x9')](_0x226a('0xa'),attributes,{'tableName':_0x226a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d7b9f,_0x167fb8,_0x37f58e){if(_0x3d7b9f['changed'](_0x226a('0xc'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0xe'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0xf'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0x10'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0x11'))||_0x3d7b9f[_0x226a('0xd')](_0x226a('0x12'))){var _0x8694fe,_0x4be879;_0x8694fe=_0x3d7b9f['serverUrl'];var _0x467a9d=_0x8694fe[_0x226a('0x13')](-0x1);if(_0x467a9d==='/'||_0x467a9d==='\x5c'||_0x467a9d===':'){_0x8694fe=_0x8694fe[_0x226a('0x14')](0x0,_0x8694fe['lastIndexOf'](_0x467a9d));}switch(_0x3d7b9f[_0x226a('0xc')]){case'US':_0x4be879=_0x226a('0x15');break;case'AU':_0x4be879=_0x226a('0x16');break;case'IN':_0x4be879=_0x226a('0x17');break;case'CN':_0x4be879=_0x226a('0x18');break;default:_0x4be879='https://accounts.zoho.eu';break;}var _0x15a150={'method':_0x226a('0x19'),'uri':_0x4be879+_0x226a('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x3d7b9f[_0x226a('0xf')],'client_secret':_0x3d7b9f[_0x226a('0x10')],'redirect_uri':_0x3d7b9f[_0x226a('0xe')],'code':_0x3d7b9f[_0x226a('0x11')]},'headers':{'Content-Type':_0x226a('0x1b')}};return rp(_0x15a150)[_0x226a('0x1c')](function(_0x14801b){var _0x2538fe=JSON[_0x226a('0x1d')](_0x14801b);if(_0x2538fe[_0x226a('0x1e')]){_0x3d7b9f[_0x226a('0x1f')]=_0x2538fe[_0x226a('0x1e')];logger[_0x226a('0x20')](util[_0x226a('0x21')](_0x226a('0x22'),_0x3d7b9f['name'],_0x3d7b9f['id']));}else{logger['error'](util[_0x226a('0x21')](_0x226a('0x23'),_0x3d7b9f[_0x226a('0x24')],_0x3d7b9f['id']),util[_0x226a('0x25')](_0x2538fe,{'showHidden':![],'depth':null}));}return _0x37f58e(null,_0x167fb8);})[_0x226a('0x26')](function(_0x30e655){logger[_0x226a('0x27')](util['format'](_0x226a('0x23'),_0x3d7b9f['name'],_0x3d7b9f['id']),util[_0x226a('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x37f58e(_0x30e655);});}else{return _0x37f58e(null,_0x167fb8);}},'beforeUpdate':function(_0xa441d1,_0x2e00f0,_0x37dd20){if(_0xa441d1['changed'](_0x226a('0xc'))||_0xa441d1[_0x226a('0xd')](_0x226a('0xe'))||_0xa441d1[_0x226a('0xd')](_0x226a('0xf'))||_0xa441d1[_0x226a('0xd')](_0x226a('0x10'))||_0xa441d1[_0x226a('0xd')](_0x226a('0x11'))||_0xa441d1['changed'](_0x226a('0x12'))){var _0x39f1e9,_0x110a86;_0x39f1e9=_0xa441d1[_0x226a('0xe')];var _0x312614=_0x39f1e9[_0x226a('0x13')](-0x1);if(_0x312614==='/'||_0x312614==='\x5c'||_0x312614===':'){_0x39f1e9=_0x39f1e9[_0x226a('0x14')](0x0,_0x39f1e9['lastIndexOf'](_0x312614));}switch(_0xa441d1[_0x226a('0xc')]){case'US':_0x110a86=_0x226a('0x15');break;case'AU':_0x110a86=_0x226a('0x16');break;case'IN':_0x110a86=_0x226a('0x17');break;case'CN':_0x110a86='https://accounts.zoho.com.cn';break;default:_0x110a86=_0x226a('0x28');break;}var _0x1fcd98={'method':_0x226a('0x19'),'uri':_0x110a86+'/oauth/v2/token','form':{'grant_type':_0x226a('0x29'),'client_id':_0xa441d1[_0x226a('0xf')],'client_secret':_0xa441d1['clientSecret'],'redirect_uri':_0xa441d1[_0x226a('0xe')],'code':_0xa441d1['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1fcd98)[_0x226a('0x1c')](function(_0x511f08){var _0x36329c=JSON[_0x226a('0x1d')](_0x511f08);if(_0x36329c[_0x226a('0x1e')]){_0xa441d1[_0x226a('0x1f')]=_0x36329c[_0x226a('0x1e')];logger[_0x226a('0x20')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xa441d1[_0x226a('0x24')],_0xa441d1['id']));}else{logger[_0x226a('0x27')](util[_0x226a('0x21')](_0x226a('0x23'),_0xa441d1[_0x226a('0x24')],_0xa441d1['id']),util[_0x226a('0x25')](_0x36329c,{'showHidden':![],'depth':null}));}return _0x37dd20(null,_0x2e00f0);})[_0x226a('0x26')](function(_0x1b298c){logger[_0x226a('0x27')](util[_0x226a('0x21')](_0x226a('0x23'),_0xa441d1[_0x226a('0x24')],_0xa441d1['id']),util[_0x226a('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x37dd20(_0x1b298c);});}else{return _0x37dd20(null,_0x2e00f0);}}}});};
\ No newline at end of file
+var _0x0791=['refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','slice','https://accounts.zoho.com','https://accounts.zoho.eu','authorization_code','then','info','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','code','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientSecret','application/x-www-form-urlencoded','parse'];(function(_0x98fd67,_0x81c351){var _0x1ef1e5=function(_0x41e01){while(--_0x41e01){_0x98fd67['push'](_0x98fd67['shift']());}};_0x1ef1e5(++_0x81c351);}(_0x0791,0x117));var _0x1079=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x0791[_0x2bda14];return _0xb5dd49;};'use strict';var _=require('lodash');var util=require(_0x1079('0x0'));var logger=require(_0x1079('0x1'))(_0x1079('0x2'));var moment=require(_0x1079('0x3'));var BPromise=require(_0x1079('0x4'));var rp=require(_0x1079('0x5'));var fs=require('fs');var path=require(_0x1079('0x6'));var rimraf=require(_0x1079('0x7'));var config=require(_0x1079('0x8'));var attributes=require(_0x1079('0x9'));var integrations=require(_0x1079('0xa'));module[_0x1079('0xb')]=function(_0x31de94,_0x5af827){return _0x31de94[_0x1079('0xc')](_0x1079('0xd'),attributes,{'tableName':_0x1079('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x37f742,_0x5cc3c3,_0x94b136){if(_0x37f742[_0x1079('0xf')](_0x1079('0x10'))||_0x37f742[_0x1079('0xf')]('serverUrl')||_0x37f742['changed'](_0x1079('0x11'))||_0x37f742[_0x1079('0xf')]('clientSecret')||_0x37f742[_0x1079('0xf')](_0x1079('0x12'))||_0x37f742['changed'](_0x1079('0x13'))){var _0x31e0fb,_0x54e01e;_0x31e0fb=_0x37f742[_0x1079('0x14')];var _0xed4a1d=_0x31e0fb['slice'](-0x1);if(_0xed4a1d==='/'||_0xed4a1d==='\x5c'||_0xed4a1d===':'){_0x31e0fb=_0x31e0fb[_0x1079('0x15')](0x0,_0x31e0fb[_0x1079('0x16')](_0xed4a1d));}switch(_0x37f742[_0x1079('0x10')]){case'US':_0x54e01e='https://accounts.zoho.com';break;case'AU':_0x54e01e='https://accounts.zoho.com.au';break;case'IN':_0x54e01e=_0x1079('0x17');break;case'CN':_0x54e01e=_0x1079('0x18');break;default:_0x54e01e='https://accounts.zoho.eu';break;}var _0x17ce10={'method':_0x1079('0x19'),'uri':_0x54e01e+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x37f742[_0x1079('0x11')],'client_secret':_0x37f742[_0x1079('0x1a')],'redirect_uri':_0x37f742[_0x1079('0x14')],'code':_0x37f742[_0x1079('0x12')]},'headers':{'Content-Type':_0x1079('0x1b')}};return rp(_0x17ce10)['then'](function(_0x23a88f){var _0x3df147=JSON[_0x1079('0x1c')](_0x23a88f);if(_0x3df147[_0x1079('0x1d')]){_0x37f742[_0x1079('0x1e')]=_0x3df147[_0x1079('0x1d')];logger['info'](util[_0x1079('0x1f')](_0x1079('0x20'),_0x37f742[_0x1079('0x21')],_0x37f742['id']));}else{logger[_0x1079('0x22')](util[_0x1079('0x1f')](_0x1079('0x23'),_0x37f742[_0x1079('0x21')],_0x37f742['id']),util[_0x1079('0x24')](_0x3df147,{'showHidden':![],'depth':null}));}return _0x94b136(null,_0x5cc3c3);})[_0x1079('0x25')](function(_0x4d828e){logger[_0x1079('0x22')](util['format'](_0x1079('0x23'),_0x37f742[_0x1079('0x21')],_0x37f742['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x94b136(_0x4d828e);});}else{return _0x94b136(null,_0x5cc3c3);}},'beforeUpdate':function(_0x40f40d,_0x53c995,_0x45e6ba){if(_0x40f40d[_0x1079('0xf')](_0x1079('0x10'))||_0x40f40d[_0x1079('0xf')](_0x1079('0x14'))||_0x40f40d[_0x1079('0xf')](_0x1079('0x11'))||_0x40f40d[_0x1079('0xf')](_0x1079('0x1a'))||_0x40f40d['changed'](_0x1079('0x12'))||_0x40f40d['changed'](_0x1079('0x13'))){var _0x4f09f2,_0x226b86;_0x4f09f2=_0x40f40d['serverUrl'];var _0x2ad1fd=_0x4f09f2[_0x1079('0x26')](-0x1);if(_0x2ad1fd==='/'||_0x2ad1fd==='\x5c'||_0x2ad1fd===':'){_0x4f09f2=_0x4f09f2[_0x1079('0x15')](0x0,_0x4f09f2['lastIndexOf'](_0x2ad1fd));}switch(_0x40f40d[_0x1079('0x10')]){case'US':_0x226b86=_0x1079('0x27');break;case'AU':_0x226b86='https://accounts.zoho.com.au';break;case'IN':_0x226b86='https://accounts.zoho.in';break;case'CN':_0x226b86='https://accounts.zoho.com.cn';break;default:_0x226b86=_0x1079('0x28');break;}var _0x885561={'method':_0x1079('0x19'),'uri':_0x226b86+'/oauth/v2/token','form':{'grant_type':_0x1079('0x29'),'client_id':_0x40f40d['clientId'],'client_secret':_0x40f40d['clientSecret'],'redirect_uri':_0x40f40d[_0x1079('0x14')],'code':_0x40f40d[_0x1079('0x12')]},'headers':{'Content-Type':_0x1079('0x1b')}};return rp(_0x885561)[_0x1079('0x2a')](function(_0x3926cf){var _0x528d6e=JSON[_0x1079('0x1c')](_0x3926cf);if(_0x528d6e[_0x1079('0x1d')]){_0x40f40d[_0x1079('0x1e')]=_0x528d6e[_0x1079('0x1d')];logger[_0x1079('0x2b')](util['format'](_0x1079('0x20'),_0x40f40d[_0x1079('0x21')],_0x40f40d['id']));}else{logger[_0x1079('0x22')](util[_0x1079('0x1f')](_0x1079('0x23'),_0x40f40d['name'],_0x40f40d['id']),util['inspect'](_0x528d6e,{'showHidden':![],'depth':null}));}return _0x45e6ba(null,_0x53c995);})[_0x1079('0x25')](function(_0xfa3269){logger['error'](util[_0x1079('0x1f')](_0x1079('0x23'),_0x40f40d['name'],_0x40f40d['id']),util[_0x1079('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x45e6ba(_0xfa3269);});}else{return _0x45e6ba(null,_0x53c995);}}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e2=['catch','ZohoAccount','findAll','options','raw','include','map','model','attributes','GetZohoAccount','debug','ShowZohoAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x858755,_0x4a70cf){var _0x2203d0=function(_0x469ac5){while(--_0x469ac5){_0x858755['push'](_0x858755['shift']());}};_0x2203d0(++_0x4a70cf);}(_0xb7e2,0x103));var _0x2b7e=function(_0x549164,_0x7c943){_0x549164=_0x549164-0x0;var _0x50def4=_0xb7e2[_0x549164];return _0x50def4;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});}exports['GetZohoAccount']=function(_0x16d389){var _0x33b038=this;return new Promise(function(_0x726509,_0x56d349){return db[_0x2b7e('0x16')][_0x2b7e('0x17')]({'raw':_0x16d389[_0x2b7e('0x18')]?_0x16d389[_0x2b7e('0x18')][_0x2b7e('0x19')]===undefined?!![]:![]:!![],'where':_0x16d389['options']?_0x16d389[_0x2b7e('0x18')]['where']||null:null,'attributes':_0x16d389['options']?_0x16d389[_0x2b7e('0x18')]['attributes']||null:null,'limit':_0x16d389[_0x2b7e('0x18')]?_0x16d389[_0x2b7e('0x18')]['limit']||null:null,'include':_0x16d389[_0x2b7e('0x18')]?_0x16d389['options'][_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x16d389['options']['include'],function(_0x3548e3){return{'model':db[_0x3548e3[_0x2b7e('0x1c')]],'as':_0x3548e3['as'],'attributes':_0x3548e3[_0x2b7e('0x1d')],'include':_0x3548e3[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x3548e3[_0x2b7e('0x1a')],function(_0x41b68b){return{'model':db[_0x41b68b[_0x2b7e('0x1c')]],'as':_0x41b68b['as'],'attributes':_0x41b68b[_0x2b7e('0x1d')],'include':_0x41b68b[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x41b68b[_0x2b7e('0x1a')],function(_0x19824e){return{'model':db[_0x19824e[_0x2b7e('0x1c')]],'as':_0x19824e['as'],'attributes':_0x19824e['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b7e('0xb')](function(_0x18dd64){logger[_0x2b7e('0xc')](_0x2b7e('0x1e'),_0x16d389);logger[_0x2b7e('0x1f')]('GetZohoAccount',_0x16d389,JSON[_0x2b7e('0x10')](_0x18dd64));_0x726509(_0x18dd64);})[_0x2b7e('0x15')](function(_0x5871ac){logger[_0x2b7e('0x11')]('GetZohoAccount',_0x5871ac[_0x2b7e('0x13')],_0x16d389);_0x56d349(_0x33b038['error'](0x1f4,_0x5871ac[_0x2b7e('0x13')]));});});};exports[_0x2b7e('0x20')]=function(_0x1f6c89){var _0xfbac54=this;return new Promise(function(_0x54adce,_0xa78818){return db[_0x2b7e('0x16')][_0x2b7e('0x21')]({'raw':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89['options'][_0x2b7e('0x22')]||null:null,'attributes':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89[_0x2b7e('0x18')]['attributes']||null:null,'include':_0x1f6c89['options']?_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x1a')],function(_0x1ce9d4){return{'model':db[_0x1ce9d4[_0x2b7e('0x1c')]],'as':_0x1ce9d4['as'],'attributes':_0x1ce9d4['attributes'],'include':_0x1ce9d4[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x1ce9d4[_0x2b7e('0x1a')],function(_0xd97f2a){return{'model':db[_0xd97f2a[_0x2b7e('0x1c')]],'as':_0xd97f2a['as'],'attributes':_0xd97f2a['attributes'],'include':_0xd97f2a[_0x2b7e('0x1a')]?_['map'](_0xd97f2a['include'],function(_0x2b11f2){return{'model':db[_0x2b11f2['model']],'as':_0x2b11f2['as'],'attributes':_0x2b11f2[_0x2b7e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3793c1){logger['info'](_0x2b7e('0x20'),_0x1f6c89);logger[_0x2b7e('0x1f')](_0x2b7e('0x20'),_0x1f6c89,JSON['stringify'](_0x3793c1));_0x54adce(_0x3793c1);})[_0x2b7e('0x15')](function(_0x2b6f0d){logger[_0x2b7e('0x11')]('ShowZohoAccount',_0x2b6f0d['message'],_0x1f6c89);_0xa78818(_0xfbac54['error'](0x1f4,_0x2b6f0d[_0x2b7e('0x13')]));});});};
\ No newline at end of file
+var _0x9af6=['attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','find','where','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','ZohoAccount','findAll','options'];(function(_0x55b86a,_0x9f9772){var _0x46f950=function(_0x3113b0){while(--_0x3113b0){_0x55b86a['push'](_0x55b86a['shift']());}};_0x46f950(++_0x9f9772);}(_0x9af6,0x1d7));var _0x69af=function(_0x1f9889,_0x9bd445){_0x1f9889=_0x1f9889-0x0;var _0x130675=_0x9af6[_0x1f9889];return _0x130675;};'use strict';var _=require(_0x69af('0x0'));var util=require(_0x69af('0x1'));var moment=require(_0x69af('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69af('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x69af('0x4'))(_0x69af('0x5'));var config=require(_0x69af('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x69af('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1073cb,_0x1786dc,_0x408d57){return new BPromise(function(_0x17353a,_0x26ecde){return client[_0x69af('0x8')](_0x1073cb,_0x408d57)[_0x69af('0x9')](function(_0x37ee87){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x1786dc,_0x69af('0xa'));logger[_0x69af('0xb')](_0x69af('0xc'),_0x1786dc,_0x69af('0xa'),JSON[_0x69af('0xd')](_0x37ee87));if(_0x37ee87[_0x69af('0xe')]){if(_0x37ee87[_0x69af('0xe')][_0x69af('0xf')]===0x1f4){logger['error'](_0x69af('0x10'),_0x1786dc,_0x37ee87[_0x69af('0xe')][_0x69af('0x11')]);return _0x26ecde(_0x37ee87[_0x69af('0xe')]['message']);}logger[_0x69af('0xe')](_0x69af('0x10'),_0x1786dc,_0x37ee87[_0x69af('0xe')][_0x69af('0x11')]);return _0x17353a(_0x37ee87[_0x69af('0xe')][_0x69af('0x11')]);}else{logger[_0x69af('0x12')](_0x69af('0x10'),_0x1786dc,'request\x20sent');_0x17353a(_0x37ee87[_0x69af('0x13')][_0x69af('0x11')]);}})[_0x69af('0x14')](function(_0x2ce24c){logger[_0x69af('0xe')](_0x69af('0x10'),_0x1786dc,_0x2ce24c);_0x26ecde(_0x2ce24c);});});}exports['GetZohoAccount']=function(_0xdf79c3){var _0x3cfb51=this;return new Promise(function(_0x2483b8,_0x213bfa){return db[_0x69af('0x15')][_0x69af('0x16')]({'raw':_0xdf79c3[_0x69af('0x17')]?_0xdf79c3[_0x69af('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xdf79c3[_0x69af('0x17')]?_0xdf79c3[_0x69af('0x17')]['where']||null:null,'attributes':_0xdf79c3['options']?_0xdf79c3[_0x69af('0x17')][_0x69af('0x18')]||null:null,'limit':_0xdf79c3[_0x69af('0x17')]?_0xdf79c3[_0x69af('0x17')][_0x69af('0x19')]||null:null,'include':_0xdf79c3['options']?_0xdf79c3[_0x69af('0x17')]['include']?_[_0x69af('0x1a')](_0xdf79c3[_0x69af('0x17')][_0x69af('0x1b')],function(_0x1803cb){return{'model':db[_0x1803cb[_0x69af('0x1c')]],'as':_0x1803cb['as'],'attributes':_0x1803cb[_0x69af('0x18')],'include':_0x1803cb[_0x69af('0x1b')]?_[_0x69af('0x1a')](_0x1803cb[_0x69af('0x1b')],function(_0x4fd6d8){return{'model':db[_0x4fd6d8['model']],'as':_0x4fd6d8['as'],'attributes':_0x4fd6d8[_0x69af('0x18')],'include':_0x4fd6d8[_0x69af('0x1b')]?_[_0x69af('0x1a')](_0x4fd6d8['include'],function(_0x57eaf9){return{'model':db[_0x57eaf9[_0x69af('0x1c')]],'as':_0x57eaf9['as'],'attributes':_0x57eaf9[_0x69af('0x18')]};}):[]};}):[]};}):[]:[]})[_0x69af('0x9')](function(_0x5ae83d){logger[_0x69af('0x12')](_0x69af('0x1d'),_0xdf79c3);logger['debug']('GetZohoAccount',_0xdf79c3,JSON[_0x69af('0xd')](_0x5ae83d));_0x2483b8(_0x5ae83d);})['catch'](function(_0x41c479){logger[_0x69af('0xe')]('GetZohoAccount',_0x41c479[_0x69af('0x11')],_0xdf79c3);_0x213bfa(_0x3cfb51['error'](0x1f4,_0x41c479[_0x69af('0x11')]));});});};exports[_0x69af('0x1e')]=function(_0x11293a){var _0x5e1641=this;return new Promise(function(_0xb1b484,_0x48b3c5){return db[_0x69af('0x15')][_0x69af('0x1f')]({'raw':_0x11293a['options']?_0x11293a['options']['raw']===undefined?!![]:![]:!![],'where':_0x11293a[_0x69af('0x17')]?_0x11293a[_0x69af('0x17')][_0x69af('0x20')]||null:null,'attributes':_0x11293a[_0x69af('0x17')]?_0x11293a[_0x69af('0x17')][_0x69af('0x18')]||null:null,'include':_0x11293a[_0x69af('0x17')]?_0x11293a['options'][_0x69af('0x1b')]?_['map'](_0x11293a['options'][_0x69af('0x1b')],function(_0x3da31e){return{'model':db[_0x3da31e[_0x69af('0x1c')]],'as':_0x3da31e['as'],'attributes':_0x3da31e['attributes'],'include':_0x3da31e[_0x69af('0x1b')]?_[_0x69af('0x1a')](_0x3da31e[_0x69af('0x1b')],function(_0x3a38a4){return{'model':db[_0x3a38a4[_0x69af('0x1c')]],'as':_0x3a38a4['as'],'attributes':_0x3a38a4[_0x69af('0x18')],'include':_0x3a38a4['include']?_[_0x69af('0x1a')](_0x3a38a4['include'],function(_0x535ee7){return{'model':db[_0x535ee7['model']],'as':_0x535ee7['as'],'attributes':_0x535ee7[_0x69af('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47ac46){logger['info']('ShowZohoAccount',_0x11293a);logger[_0x69af('0xb')](_0x69af('0x1e'),_0x11293a,JSON[_0x69af('0xd')](_0x47ac46));_0xb1b484(_0x47ac46);})['catch'](function(_0x14500d){logger[_0x69af('0xe')](_0x69af('0x1e'),_0x14500d[_0x69af('0x11')],_0x11293a);_0x48b3c5(_0x5e1641[_0x69af('0xe')](0x1f4,_0x14500d[_0x69af('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2ec=['/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x54ffa3,_0xb59905){var _0x223eda=function(_0x54a3a2){while(--_0x54a3a2){_0x54ffa3['push'](_0x54ffa3['shift']());}};_0x223eda(++_0xb59905);}(_0xf2ec,0xbb));var _0xcf2e=function(_0x4528dc,_0x3227bf){_0x4528dc=_0x4528dc-0x0;var _0x419381=_0xf2ec[_0x4528dc];return _0x419381;};'use strict';var multer=require(_0xcf2e('0x0'));var util=require(_0xcf2e('0x1'));var path=require(_0xcf2e('0x2'));var timeout=require(_0xcf2e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcf2e('0x4'));var auth=require(_0xcf2e('0x5'));var interaction=require(_0xcf2e('0x6'));var config=require('../../config/environment');var controller=require(_0xcf2e('0x7'));router[_0xcf2e('0x8')]('/',auth[_0xcf2e('0x9')](),controller[_0xcf2e('0xa')]);router[_0xcf2e('0x8')](_0xcf2e('0xb'),auth[_0xcf2e('0x9')](),controller[_0xcf2e('0xc')]);router[_0xcf2e('0x8')](_0xcf2e('0xd'),auth['isAuthenticated'](),controller[_0xcf2e('0xe')]);router['get']('/:id/subjects',auth[_0xcf2e('0x9')](),controller[_0xcf2e('0xf')]);router[_0xcf2e('0x8')](_0xcf2e('0x10'),auth['isAuthenticated'](),controller[_0xcf2e('0x11')]);router[_0xcf2e('0x12')]('/',auth[_0xcf2e('0x9')](),controller['create']);router[_0xcf2e('0x13')](_0xcf2e('0xb'),auth[_0xcf2e('0x9')](),controller[_0xcf2e('0x14')]);router['delete']('/:id',auth[_0xcf2e('0x9')](),controller[_0xcf2e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x35a6=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id','update','delete','multer','util'];(function(_0xc1600f,_0x3d09d3){var _0x22bb2e=function(_0x484b06){while(--_0x484b06){_0xc1600f['push'](_0xc1600f['shift']());}};_0x22bb2e(++_0x3d09d3);}(_0x35a6,0x1e1));var _0x635a=function(_0xa4d072,_0x2f957f){_0xa4d072=_0xa4d072-0x0;var _0x460a79=_0x35a6[_0xa4d072];return _0x460a79;};'use strict';var multer=require(_0x635a('0x0'));var util=require(_0x635a('0x1'));var path=require(_0x635a('0x2'));var timeout=require('connect-timeout');var express=require(_0x635a('0x3'));var router=express[_0x635a('0x4')]();var fs_extra=require(_0x635a('0x5'));var auth=require(_0x635a('0x6'));var interaction=require(_0x635a('0x7'));var config=require(_0x635a('0x8'));var controller=require(_0x635a('0x9'));router[_0x635a('0xa')]('/',auth[_0x635a('0xb')](),controller['index']);router[_0x635a('0xa')]('/:id',auth[_0x635a('0xb')](),controller['show']);router[_0x635a('0xa')](_0x635a('0xc'),auth[_0x635a('0xb')](),controller[_0x635a('0xd')]);router[_0x635a('0xa')](_0x635a('0xe'),auth[_0x635a('0xb')](),controller[_0x635a('0xf')]);router['get'](_0x635a('0x10'),auth[_0x635a('0xb')](),controller[_0x635a('0x11')]);router['post']('/',auth[_0x635a('0xb')](),controller['create']);router['put'](_0x635a('0x12'),auth[_0x635a('0xb')](),controller[_0x635a('0x13')]);router[_0x635a('0x14')](_0x635a('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8169=['nothing','lead','sequelize','STRING','contact'];(function(_0x39ebd9,_0x2ef11a){var _0x8a6176=function(_0x405b7c){while(--_0x405b7c){_0x39ebd9['push'](_0x39ebd9['shift']());}};_0x8a6176(++_0x2ef11a);}(_0x8169,0xd4));var _0x9816=function(_0x4f1a44,_0x1ab56d){_0x4f1a44=_0x4f1a44-0x0;var _0x463feb=_0x8169[_0x4f1a44];return _0x463feb;};'use strict';var Sequelize=require(_0x9816('0x0'));module['exports']={'name':{'type':Sequelize[_0x9816('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x9816('0x2'),_0x9816('0x3')),'defaultValue':_0x9816('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x9816('0x2'),_0x9816('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x9816('0x1')]}};
\ No newline at end of file
+var _0xbfef=['exports','STRING','ENUM','contact','contact_lead','lead','sequelize'];(function(_0x39d781,_0x253b60){var _0x3c9036=function(_0x378dc6){while(--_0x378dc6){_0x39d781['push'](_0x39d781['shift']());}};_0x3c9036(++_0x253b60);}(_0xbfef,0x18e));var _0xfbfe=function(_0x515798,_0x3a1cc4){_0x515798=_0x515798-0x0;var _0x22db6d=_0xbfef[_0x515798];return _0x22db6d;};'use strict';var Sequelize=require(_0xfbfe('0x0'));module[_0xfbfe('0x1')]={'name':{'type':Sequelize[_0xfbfe('0x2')]},'moduleCreate':{'type':Sequelize[_0xfbfe('0x3')]('lead',_0xfbfe('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xfbfe('0x3')](_0xfbfe('0x5'),'contact',_0xfbfe('0x6')),'defaultValue':_0xfbfe('0x5')},'description':{'type':Sequelize[_0xfbfe('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2480=['catch','show','params','rawAttributes','keys','includeAll','include','find','create','body','getFields','findOne','nolimit','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoConfiguration','findAll'];(function(_0x41a7d4,_0x409980){var _0x496a94=function(_0x17a65c){while(--_0x17a65c){_0x41a7d4['push'](_0x41a7d4['shift']());}};_0x496a94(++_0x409980);}(_0x2480,0x160));var _0x0248=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2480[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x0248('0x0'));var rimraf=require(_0x0248('0x1'));var zipdir=require(_0x0248('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0248('0x3'));var moment=require(_0x0248('0x4'));var BPromise=require(_0x0248('0x5'));var Mustache=require(_0x0248('0x6'));var util=require(_0x0248('0x7'));var path=require(_0x0248('0x8'));var sox=require(_0x0248('0x9'));var csv=require(_0x0248('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0248('0xb'));var squel=require(_0x0248('0xc'));var crypto=require(_0x0248('0xd'));var jsforce=require(_0x0248('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0248('0xa'));var querystring=require(_0x0248('0xf'));var Papa=require(_0x0248('0x10'));var Redis=require(_0x0248('0x11'));var authService=require(_0x0248('0x12'));var qs=require(_0x0248('0x13'));var as=require(_0x0248('0x14'));var hardwareService=require(_0x0248('0x15'));var logger=require(_0x0248('0x16'))(_0x0248('0x17'));var utils=require(_0x0248('0x18'));var config=require(_0x0248('0x19'));var licenseUtil=require(_0x0248('0x1a'));var db=require(_0x0248('0x1b'))['db'];function respondWithStatusCode(_0x57ed0b,_0x4c2a47){_0x4c2a47=_0x4c2a47||0xcc;return function(_0x2bf650){if(_0x2bf650){return _0x57ed0b['sendStatus'](_0x4c2a47);}return _0x57ed0b[_0x0248('0x1c')](_0x4c2a47)[_0x0248('0x1d')]();};}function respondWithResult(_0x555621,_0x32be75){_0x32be75=_0x32be75||0xc8;return function(_0x33ea62){if(_0x33ea62){return _0x555621[_0x0248('0x1c')](_0x32be75)['json'](_0x33ea62);}};}function respondWithFilteredResult(_0x4d77f7,_0x235605){return function(_0xa547fc){if(_0xa547fc){var _0x110786=typeof _0x235605['offset']===_0x0248('0x1e')&&typeof _0x235605[_0x0248('0x1f')]===_0x0248('0x1e');var _0x4fbdc0=_0xa547fc[_0x0248('0x20')];var _0x4f298c=_0x110786?0x0:_0x235605[_0x0248('0x21')];var _0x2736e1=_0x110786?_0xa547fc[_0x0248('0x20')]:_0x235605[_0x0248('0x21')]+_0x235605[_0x0248('0x1f')];var _0xd25fcc;if(_0x2736e1>=_0x4fbdc0){_0x2736e1=_0x4fbdc0;_0xd25fcc=0xc8;}else{_0xd25fcc=0xce;}_0x4d77f7[_0x0248('0x1c')](_0xd25fcc);return _0x4d77f7['set'](_0x0248('0x22'),_0x4f298c+'-'+_0x2736e1+'/'+_0x4fbdc0)[_0x0248('0x23')](_0xa547fc);}return null;};}function patchUpdates(_0x5c70f4){return function(_0x5a838a){try{jsonpatch[_0x0248('0x24')](_0x5a838a,_0x5c70f4,!![]);}catch(_0x12f15e){return BPromise[_0x0248('0x25')](_0x12f15e);}return _0x5a838a[_0x0248('0x26')]();};}function saveUpdates(_0x69cc0b,_0x50f756){return function(_0x147a7e){if(_0x147a7e){return _0x147a7e[_0x0248('0x27')](_0x69cc0b)[_0x0248('0x28')](function(_0x6437d7){return _0x6437d7;});}return null;};}function removeEntity(_0x13956c,_0x5ad773){return function(_0xa48e7){if(_0xa48e7){return _0xa48e7[_0x0248('0x29')]()[_0x0248('0x28')](function(){_0x13956c[_0x0248('0x1c')](0xcc)[_0x0248('0x1d')]();});}};}function handleEntityNotFound(_0x11e24c,_0x23c411){return function(_0x19221c){if(!_0x19221c){_0x11e24c['sendStatus'](0x194);}return _0x19221c;};}function handleError(_0x49bda0,_0x351ca4){_0x351ca4=_0x351ca4||0x1f4;return function(_0x4c5d42){logger['error'](_0x4c5d42[_0x0248('0x2a')]);if(_0x4c5d42[_0x0248('0x2b')]){delete _0x4c5d42[_0x0248('0x2b')];}_0x49bda0['status'](_0x351ca4)[_0x0248('0x2c')](_0x4c5d42);};}exports[_0x0248('0x2d')]=function(_0x271e29,_0x2652a9){var _0x62415f={},_0x50fbca={},_0x2784c8={'count':0x0,'rows':[]};var _0x27b1cf=_[_0x0248('0x2e')](db['ZohoConfiguration']['rawAttributes'],function(_0x1f61db){return{'name':_0x1f61db[_0x0248('0x2f')],'type':_0x1f61db[_0x0248('0x30')][_0x0248('0x31')]};});_0x50fbca[_0x0248('0x32')]=_[_0x0248('0x2e')](_0x27b1cf,_0x0248('0x2b'));_0x50fbca[_0x0248('0x33')]=_['keys'](_0x271e29[_0x0248('0x33')]);_0x50fbca[_0x0248('0x34')]=_[_0x0248('0x35')](_0x50fbca[_0x0248('0x32')],_0x50fbca[_0x0248('0x33')]);_0x62415f[_0x0248('0x36')]=_['intersection'](_0x50fbca['model'],qs[_0x0248('0x37')](_0x271e29[_0x0248('0x33')][_0x0248('0x37')]));_0x62415f[_0x0248('0x36')]=_0x62415f[_0x0248('0x36')][_0x0248('0x38')]?_0x62415f['attributes']:_0x50fbca['model'];if(!_0x271e29[_0x0248('0x33')][_0x0248('0x39')]('nolimit')){_0x62415f[_0x0248('0x1f')]=qs[_0x0248('0x1f')](_0x271e29[_0x0248('0x33')][_0x0248('0x1f')]);_0x62415f[_0x0248('0x21')]=qs[_0x0248('0x21')](_0x271e29[_0x0248('0x33')][_0x0248('0x21')]);}_0x62415f[_0x0248('0x3a')]=qs['sort'](_0x271e29[_0x0248('0x33')][_0x0248('0x3b')]);_0x62415f[_0x0248('0x3c')]=qs[_0x0248('0x34')](_[_0x0248('0x3d')](_0x271e29[_0x0248('0x33')],_0x50fbca[_0x0248('0x34')]),_0x27b1cf);if(_0x271e29[_0x0248('0x33')][_0x0248('0x3e')]){_0x62415f['where']=_[_0x0248('0x3f')](_0x62415f[_0x0248('0x3c')],{'$or':_[_0x0248('0x2e')](_0x27b1cf,function(_0x5bd82b){if(_0x5bd82b[_0x0248('0x30')]!==_0x0248('0x40')){var _0x170f75={};_0x170f75[_0x5bd82b[_0x0248('0x2b')]]={'$like':'%'+_0x271e29[_0x0248('0x33')][_0x0248('0x3e')]+'%'};return _0x170f75;}})});}_0x62415f=_[_0x0248('0x3f')]({},_0x62415f,_0x271e29[_0x0248('0x41')]);var _0x2a520c={'where':_0x62415f['where']};return db[_0x0248('0x42')][_0x0248('0x20')](_0x2a520c)[_0x0248('0x28')](function(_0x1b7466){_0x2784c8[_0x0248('0x20')]=_0x1b7466;if(_0x271e29['query']['includeAll']){_0x62415f['include']=[{'all':!![]}];}return db[_0x0248('0x42')][_0x0248('0x43')](_0x62415f);})['then'](function(_0x28cf61){_0x2784c8['rows']=_0x28cf61;return _0x2784c8;})[_0x0248('0x28')](respondWithFilteredResult(_0x2652a9,_0x62415f))[_0x0248('0x44')](handleError(_0x2652a9,null));};exports[_0x0248('0x45')]=function(_0x44d5bc,_0xab9409){var _0x1a7b52={'raw':![],'where':{'id':_0x44d5bc[_0x0248('0x46')]['id']}},_0xe9ef90={};_0xe9ef90[_0x0248('0x32')]=_['keys'](db[_0x0248('0x42')][_0x0248('0x47')]);_0xe9ef90['query']=_[_0x0248('0x48')](_0x44d5bc[_0x0248('0x33')]);_0xe9ef90[_0x0248('0x34')]=_['intersection'](_0xe9ef90[_0x0248('0x32')],_0xe9ef90[_0x0248('0x33')]);_0x1a7b52[_0x0248('0x36')]=_[_0x0248('0x35')](_0xe9ef90[_0x0248('0x32')],qs[_0x0248('0x37')](_0x44d5bc['query'][_0x0248('0x37')]));_0x1a7b52['attributes']=_0x1a7b52[_0x0248('0x36')][_0x0248('0x38')]?_0x1a7b52[_0x0248('0x36')]:_0xe9ef90[_0x0248('0x32')];if(_0x44d5bc['query'][_0x0248('0x49')]){_0x1a7b52[_0x0248('0x4a')]=[{'all':!![]}];}_0x1a7b52=_[_0x0248('0x3f')]({},_0x1a7b52,_0x44d5bc[_0x0248('0x41')]);return db[_0x0248('0x42')][_0x0248('0x4b')](_0x1a7b52)[_0x0248('0x28')](handleEntityNotFound(_0xab9409,null))[_0x0248('0x28')](respondWithResult(_0xab9409,null))[_0x0248('0x44')](handleError(_0xab9409,null));};exports[_0x0248('0x4c')]=function(_0xa8cc74,_0x275f88){return db['ZohoConfiguration']['create'](_0xa8cc74[_0x0248('0x4d')],{})[_0x0248('0x28')](respondWithResult(_0x275f88,0xc9))[_0x0248('0x44')](handleError(_0x275f88,null));};exports[_0x0248('0x27')]=function(_0x10b235,_0x32f805){if(_0x10b235[_0x0248('0x4d')]['id']){delete _0x10b235[_0x0248('0x4d')]['id'];}return db[_0x0248('0x42')][_0x0248('0x4b')]({'where':{'id':_0x10b235[_0x0248('0x46')]['id']}})['then'](handleEntityNotFound(_0x32f805,null))[_0x0248('0x28')](saveUpdates(_0x10b235[_0x0248('0x4d')],null))[_0x0248('0x28')](respondWithResult(_0x32f805,null))[_0x0248('0x44')](handleError(_0x32f805,null));};exports[_0x0248('0x29')]=function(_0x29e403,_0x4a3b65){return db['ZohoConfiguration'][_0x0248('0x4b')]({'where':{'id':_0x29e403[_0x0248('0x46')]['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x4a3b65,null))['then'](removeEntity(_0x4a3b65,null))[_0x0248('0x44')](handleError(_0x4a3b65,null));};exports[_0x0248('0x4e')]=function(_0x3d734b,_0x384eb6,_0x472e5e){var _0x4312ba={};var _0x36a686={};var _0x4fd555;var _0x5aa606;return db['ZohoConfiguration'][_0x0248('0x4f')]({'where':{'id':_0x3d734b[_0x0248('0x46')]['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x384eb6,null))['then'](function(_0x4eb08d){if(_0x4eb08d){_0x4fd555=_0x4eb08d;_0x36a686[_0x0248('0x32')]=_[_0x0248('0x48')](db['ZohoField'][_0x0248('0x47')]);_0x36a686[_0x0248('0x33')]=_[_0x0248('0x48')](_0x3d734b[_0x0248('0x33')]);_0x36a686[_0x0248('0x34')]=_['intersection'](_0x36a686[_0x0248('0x32')],_0x36a686[_0x0248('0x33')]);_0x4312ba['attributes']=_[_0x0248('0x35')](_0x36a686[_0x0248('0x32')],qs['fields'](_0x3d734b[_0x0248('0x33')][_0x0248('0x37')]));_0x4312ba['attributes']=_0x4312ba[_0x0248('0x36')][_0x0248('0x38')]?_0x4312ba[_0x0248('0x36')]:_0x36a686[_0x0248('0x32')];_0x4312ba[_0x0248('0x3a')]=qs[_0x0248('0x3b')](_0x3d734b['query'][_0x0248('0x3b')]);_0x4312ba['where']=qs['filters'](_[_0x0248('0x3d')](_0x3d734b['query'],_0x36a686[_0x0248('0x34')]));if(_0x3d734b['query']['filter']){_0x4312ba[_0x0248('0x3c')]=_[_0x0248('0x3f')](_0x4312ba[_0x0248('0x3c')],{'$or':_['map'](_0x4312ba['attributes'],function(_0x85dcbe){var _0x1718cf={};_0x1718cf[_0x85dcbe]={'$like':'%'+_0x3d734b['query']['filter']+'%'};return _0x1718cf;})});}_0x4312ba=_[_0x0248('0x3f')]({},_0x4312ba,_0x3d734b[_0x0248('0x41')]);return _0x4fd555['getFields'](_0x4312ba);}})[_0x0248('0x28')](function(_0x4a4845){if(_0x4a4845){_0x5aa606=_0x4a4845[_0x0248('0x38')];if(!_0x3d734b[_0x0248('0x33')][_0x0248('0x39')](_0x0248('0x50'))){_0x4312ba['limit']=qs[_0x0248('0x1f')](_0x3d734b[_0x0248('0x33')][_0x0248('0x1f')]);_0x4312ba['offset']=qs[_0x0248('0x21')](_0x3d734b['query']['offset']);}return _0x4fd555[_0x0248('0x4e')](_0x4312ba);}})[_0x0248('0x28')](function(_0x36564c){if(_0x36564c){return _0x36564c?{'count':_0x5aa606,'rows':_0x36564c}:null;}})[_0x0248('0x28')](respondWithResult(_0x384eb6,null))[_0x0248('0x44')](handleError(_0x384eb6,null));};exports['getSubjects']=function(_0x597798,_0x2fb727,_0xbf783){var _0x52a3cc={};var _0x1e350f={};var _0x4987e4;var _0x19d2dc;return db[_0x0248('0x42')][_0x0248('0x4f')]({'where':{'id':_0x597798[_0x0248('0x46')]['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x2fb727,null))[_0x0248('0x28')](function(_0x1b9390){if(_0x1b9390){_0x4987e4=_0x1b9390;_0x1e350f['model']=_[_0x0248('0x48')](db[_0x0248('0x51')][_0x0248('0x47')]);_0x1e350f[_0x0248('0x33')]=_[_0x0248('0x48')](_0x597798[_0x0248('0x33')]);_0x1e350f[_0x0248('0x34')]=_[_0x0248('0x35')](_0x1e350f[_0x0248('0x32')],_0x1e350f[_0x0248('0x33')]);_0x52a3cc['attributes']=_['intersection'](_0x1e350f['model'],qs[_0x0248('0x37')](_0x597798[_0x0248('0x33')][_0x0248('0x37')]));_0x52a3cc[_0x0248('0x36')]=_0x52a3cc[_0x0248('0x36')]['length']?_0x52a3cc[_0x0248('0x36')]:_0x1e350f[_0x0248('0x32')];_0x52a3cc[_0x0248('0x3a')]=qs[_0x0248('0x3b')](_0x597798[_0x0248('0x33')][_0x0248('0x3b')]);_0x52a3cc[_0x0248('0x3c')]=qs[_0x0248('0x34')](_[_0x0248('0x3d')](_0x597798[_0x0248('0x33')],_0x1e350f[_0x0248('0x34')]));if(_0x597798[_0x0248('0x33')][_0x0248('0x3e')]){_0x52a3cc[_0x0248('0x3c')]=_[_0x0248('0x3f')](_0x52a3cc[_0x0248('0x3c')],{'$or':_['map'](_0x52a3cc[_0x0248('0x36')],function(_0x56523b){var _0x20fc88={};_0x20fc88[_0x56523b]={'$like':'%'+_0x597798['query'][_0x0248('0x3e')]+'%'};return _0x20fc88;})});}_0x52a3cc=_[_0x0248('0x3f')]({},_0x52a3cc,_0x597798[_0x0248('0x41')]);return _0x4987e4[_0x0248('0x52')](_0x52a3cc);}})['then'](function(_0x18684d){if(_0x18684d){_0x19d2dc=_0x18684d[_0x0248('0x38')];if(!_0x597798[_0x0248('0x33')][_0x0248('0x39')](_0x0248('0x50'))){_0x52a3cc[_0x0248('0x1f')]=qs[_0x0248('0x1f')](_0x597798[_0x0248('0x33')][_0x0248('0x1f')]);_0x52a3cc[_0x0248('0x21')]=qs['offset'](_0x597798[_0x0248('0x33')][_0x0248('0x21')]);}return _0x4987e4[_0x0248('0x52')](_0x52a3cc);}})[_0x0248('0x28')](function(_0x2502ec){if(_0x2502ec){return _0x2502ec?{'count':_0x19d2dc,'rows':_0x2502ec}:null;}})['then'](respondWithResult(_0x2fb727,null))[_0x0248('0x44')](handleError(_0x2fb727,null));};exports[_0x0248('0x53')]=function(_0x1c993d,_0x43776b,_0x318e48){var _0xa817a7={};var _0x363178={};var _0x346cfd;var _0x1a63e2;return db['ZohoConfiguration'][_0x0248('0x4f')]({'where':{'id':_0x1c993d['params']['id']}})[_0x0248('0x28')](handleEntityNotFound(_0x43776b,null))[_0x0248('0x28')](function(_0xbd9f7c){if(_0xbd9f7c){_0x346cfd=_0xbd9f7c;_0x363178[_0x0248('0x32')]=_['keys'](db['ZohoField'][_0x0248('0x47')]);_0x363178[_0x0248('0x33')]=_[_0x0248('0x48')](_0x1c993d['query']);_0x363178['filters']=_['intersection'](_0x363178[_0x0248('0x32')],_0x363178[_0x0248('0x33')]);_0xa817a7['attributes']=_[_0x0248('0x35')](_0x363178[_0x0248('0x32')],qs[_0x0248('0x37')](_0x1c993d[_0x0248('0x33')][_0x0248('0x37')]));_0xa817a7['attributes']=_0xa817a7[_0x0248('0x36')][_0x0248('0x38')]?_0xa817a7[_0x0248('0x36')]:_0x363178[_0x0248('0x32')];_0xa817a7[_0x0248('0x3a')]=qs['sort'](_0x1c993d['query'][_0x0248('0x3b')]);_0xa817a7['where']=qs[_0x0248('0x34')](_[_0x0248('0x3d')](_0x1c993d[_0x0248('0x33')],_0x363178[_0x0248('0x34')]));if(_0x1c993d[_0x0248('0x33')][_0x0248('0x3e')]){_0xa817a7[_0x0248('0x3c')]=_[_0x0248('0x3f')](_0xa817a7[_0x0248('0x3c')],{'$or':_['map'](_0xa817a7[_0x0248('0x36')],function(_0x43f013){var _0x12c886={};_0x12c886[_0x43f013]={'$like':'%'+_0x1c993d[_0x0248('0x33')][_0x0248('0x3e')]+'%'};return _0x12c886;})});}_0xa817a7=_[_0x0248('0x3f')]({},_0xa817a7,_0x1c993d[_0x0248('0x41')]);return _0x346cfd[_0x0248('0x53')](_0xa817a7);}})[_0x0248('0x28')](function(_0x1b574b){if(_0x1b574b){_0x1a63e2=_0x1b574b['length'];if(!_0x1c993d[_0x0248('0x33')][_0x0248('0x39')]('nolimit')){_0xa817a7[_0x0248('0x1f')]=qs[_0x0248('0x1f')](_0x1c993d['query']['limit']);_0xa817a7['offset']=qs[_0x0248('0x21')](_0x1c993d[_0x0248('0x33')][_0x0248('0x21')]);}return _0x346cfd['getDescriptions'](_0xa817a7);}})[_0x0248('0x28')](function(_0x4cd1b6){if(_0x4cd1b6){return _0x4cd1b6?{'count':_0x1a63e2,'rows':_0x4cd1b6}:null;}})[_0x0248('0x28')](respondWithResult(_0x43776b,null))[_0x0248('0x44')](handleError(_0x43776b,null));};
\ No newline at end of file
+var _0xd233=['query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','ZohoConfiguration','findAll','rows','catch','length','options','create','body','update','find','params','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xd233,0x1b4));var _0x3d23=function(_0x5e281c,_0x575467){_0x5e281c=_0x5e281c-0x0;var _0x1254ac=_0xd233[_0x5e281c];return _0x1254ac;};'use strict';var emlformat=require(_0x3d23('0x0'));var rimraf=require(_0x3d23('0x1'));var zipdir=require(_0x3d23('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d23('0x3'));var Mustache=require(_0x3d23('0x4'));var util=require(_0x3d23('0x5'));var path=require('path');var sox=require(_0x3d23('0x6'));var csv=require(_0x3d23('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d23('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d23('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3d23('0xa'));var toCsv=require(_0x3d23('0x7'));var querystring=require(_0x3d23('0xb'));var Papa=require(_0x3d23('0xc'));var Redis=require(_0x3d23('0xd'));var authService=require(_0x3d23('0xe'));var qs=require(_0x3d23('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d23('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x3d23('0x11'));var config=require(_0x3d23('0x12'));var licenseUtil=require(_0x3d23('0x13'));var db=require(_0x3d23('0x14'))['db'];function respondWithStatusCode(_0x4d2a86,_0x1c40fc){_0x1c40fc=_0x1c40fc||0xcc;return function(_0x54db28){if(_0x54db28){return _0x4d2a86['sendStatus'](_0x1c40fc);}return _0x4d2a86[_0x3d23('0x15')](_0x1c40fc)[_0x3d23('0x16')]();};}function respondWithResult(_0xba45e6,_0x195eb9){_0x195eb9=_0x195eb9||0xc8;return function(_0x5c2c9b){if(_0x5c2c9b){return _0xba45e6[_0x3d23('0x15')](_0x195eb9)[_0x3d23('0x17')](_0x5c2c9b);}};}function respondWithFilteredResult(_0x5d4cad,_0x2cf6dd){return function(_0x2af6b0){if(_0x2af6b0){var _0x47b69b=typeof _0x2cf6dd[_0x3d23('0x18')]===_0x3d23('0x19')&&typeof _0x2cf6dd['limit']==='undefined';var _0x32a4c0=_0x2af6b0[_0x3d23('0x1a')];var _0x205017=_0x47b69b?0x0:_0x2cf6dd[_0x3d23('0x18')];var _0x52eebe=_0x47b69b?_0x2af6b0[_0x3d23('0x1a')]:_0x2cf6dd[_0x3d23('0x18')]+_0x2cf6dd['limit'];var _0x117f0c;if(_0x52eebe>=_0x32a4c0){_0x52eebe=_0x32a4c0;_0x117f0c=0xc8;}else{_0x117f0c=0xce;}_0x5d4cad['status'](_0x117f0c);return _0x5d4cad[_0x3d23('0x1b')](_0x3d23('0x1c'),_0x205017+'-'+_0x52eebe+'/'+_0x32a4c0)[_0x3d23('0x17')](_0x2af6b0);}return null;};}function patchUpdates(_0x3b572f){return function(_0x3ab80f){try{jsonpatch[_0x3d23('0x1d')](_0x3ab80f,_0x3b572f,!![]);}catch(_0x28fa9d){return BPromise[_0x3d23('0x1e')](_0x28fa9d);}return _0x3ab80f[_0x3d23('0x1f')]();};}function saveUpdates(_0x1d3929,_0x16d4da){return function(_0x149f2a){if(_0x149f2a){return _0x149f2a['update'](_0x1d3929)['then'](function(_0xd91515){return _0xd91515;});}return null;};}function removeEntity(_0x29cb8a,_0x5db748){return function(_0x352ec2){if(_0x352ec2){return _0x352ec2[_0x3d23('0x20')]()[_0x3d23('0x21')](function(){_0x29cb8a[_0x3d23('0x15')](0xcc)[_0x3d23('0x16')]();});}};}function handleEntityNotFound(_0x187e3b,_0x394283){return function(_0x5b8025){if(!_0x5b8025){_0x187e3b[_0x3d23('0x22')](0x194);}return _0x5b8025;};}function handleError(_0x510f94,_0x4e4618){_0x4e4618=_0x4e4618||0x1f4;return function(_0x424a55){logger[_0x3d23('0x23')](_0x424a55[_0x3d23('0x24')]);if(_0x424a55[_0x3d23('0x25')]){delete _0x424a55[_0x3d23('0x25')];}_0x510f94[_0x3d23('0x15')](_0x4e4618)[_0x3d23('0x26')](_0x424a55);};}exports[_0x3d23('0x27')]=function(_0x5d092e,_0x34cac9){var _0x33c081={},_0x5ecd43={},_0x5c2322={'count':0x0,'rows':[]};var _0x407c70=_['map'](db['ZohoConfiguration'][_0x3d23('0x28')],function(_0x4c8b7c){return{'name':_0x4c8b7c[_0x3d23('0x29')],'type':_0x4c8b7c[_0x3d23('0x2a')][_0x3d23('0x2b')]};});_0x5ecd43['model']=_['map'](_0x407c70,_0x3d23('0x25'));_0x5ecd43[_0x3d23('0x2c')]=_[_0x3d23('0x2d')](_0x5d092e['query']);_0x5ecd43[_0x3d23('0x2e')]=_[_0x3d23('0x2f')](_0x5ecd43['model'],_0x5ecd43[_0x3d23('0x2c')]);_0x33c081[_0x3d23('0x30')]=_[_0x3d23('0x2f')](_0x5ecd43[_0x3d23('0x31')],qs[_0x3d23('0x32')](_0x5d092e[_0x3d23('0x2c')][_0x3d23('0x32')]));_0x33c081[_0x3d23('0x30')]=_0x33c081[_0x3d23('0x30')]['length']?_0x33c081[_0x3d23('0x30')]:_0x5ecd43['model'];if(!_0x5d092e['query'][_0x3d23('0x33')](_0x3d23('0x34'))){_0x33c081[_0x3d23('0x35')]=qs[_0x3d23('0x35')](_0x5d092e[_0x3d23('0x2c')][_0x3d23('0x35')]);_0x33c081['offset']=qs['offset'](_0x5d092e[_0x3d23('0x2c')]['offset']);}_0x33c081[_0x3d23('0x36')]=qs['sort'](_0x5d092e['query'][_0x3d23('0x37')]);_0x33c081[_0x3d23('0x38')]=qs[_0x3d23('0x2e')](_[_0x3d23('0x39')](_0x5d092e['query'],_0x5ecd43[_0x3d23('0x2e')]),_0x407c70);if(_0x5d092e[_0x3d23('0x2c')][_0x3d23('0x3a')]){_0x33c081['where']=_[_0x3d23('0x3b')](_0x33c081['where'],{'$or':_[_0x3d23('0x3c')](_0x407c70,function(_0x20e393){if(_0x20e393[_0x3d23('0x2a')]!==_0x3d23('0x3d')){var _0x2685a0={};_0x2685a0[_0x20e393[_0x3d23('0x25')]]={'$like':'%'+_0x5d092e[_0x3d23('0x2c')][_0x3d23('0x3a')]+'%'};return _0x2685a0;}})});}_0x33c081=_[_0x3d23('0x3b')]({},_0x33c081,_0x5d092e['options']);var _0x44d36a={'where':_0x33c081[_0x3d23('0x38')]};return db['ZohoConfiguration'][_0x3d23('0x1a')](_0x44d36a)[_0x3d23('0x21')](function(_0x1f145a){_0x5c2322[_0x3d23('0x1a')]=_0x1f145a;if(_0x5d092e['query'][_0x3d23('0x3e')]){_0x33c081[_0x3d23('0x3f')]=[{'all':!![]}];}return db[_0x3d23('0x40')][_0x3d23('0x41')](_0x33c081);})['then'](function(_0x15d462){_0x5c2322[_0x3d23('0x42')]=_0x15d462;return _0x5c2322;})['then'](respondWithFilteredResult(_0x34cac9,_0x33c081))[_0x3d23('0x43')](handleError(_0x34cac9,null));};exports['show']=function(_0x5f4864,_0x4f2fc7){var _0x4dd2da={'raw':![],'where':{'id':_0x5f4864['params']['id']}},_0x359e19={};_0x359e19['model']=_[_0x3d23('0x2d')](db['ZohoConfiguration']['rawAttributes']);_0x359e19[_0x3d23('0x2c')]=_[_0x3d23('0x2d')](_0x5f4864[_0x3d23('0x2c')]);_0x359e19[_0x3d23('0x2e')]=_[_0x3d23('0x2f')](_0x359e19['model'],_0x359e19['query']);_0x4dd2da[_0x3d23('0x30')]=_[_0x3d23('0x2f')](_0x359e19[_0x3d23('0x31')],qs[_0x3d23('0x32')](_0x5f4864[_0x3d23('0x2c')]['fields']));_0x4dd2da['attributes']=_0x4dd2da['attributes'][_0x3d23('0x44')]?_0x4dd2da[_0x3d23('0x30')]:_0x359e19[_0x3d23('0x31')];if(_0x5f4864[_0x3d23('0x2c')][_0x3d23('0x3e')]){_0x4dd2da[_0x3d23('0x3f')]=[{'all':!![]}];}_0x4dd2da=_[_0x3d23('0x3b')]({},_0x4dd2da,_0x5f4864[_0x3d23('0x45')]);return db[_0x3d23('0x40')]['find'](_0x4dd2da)[_0x3d23('0x21')](handleEntityNotFound(_0x4f2fc7,null))[_0x3d23('0x21')](respondWithResult(_0x4f2fc7,null))[_0x3d23('0x43')](handleError(_0x4f2fc7,null));};exports[_0x3d23('0x46')]=function(_0x1e477a,_0x1844c2){return db[_0x3d23('0x40')][_0x3d23('0x46')](_0x1e477a[_0x3d23('0x47')],{})[_0x3d23('0x21')](respondWithResult(_0x1844c2,0xc9))[_0x3d23('0x43')](handleError(_0x1844c2,null));};exports[_0x3d23('0x48')]=function(_0x2e9970,_0x65a8d2){if(_0x2e9970[_0x3d23('0x47')]['id']){delete _0x2e9970[_0x3d23('0x47')]['id'];}return db['ZohoConfiguration'][_0x3d23('0x49')]({'where':{'id':_0x2e9970[_0x3d23('0x4a')]['id']}})['then'](handleEntityNotFound(_0x65a8d2,null))[_0x3d23('0x21')](saveUpdates(_0x2e9970[_0x3d23('0x47')],null))['then'](respondWithResult(_0x65a8d2,null))['catch'](handleError(_0x65a8d2,null));};exports['destroy']=function(_0x27799b,_0x2e52b7){return db[_0x3d23('0x40')][_0x3d23('0x49')]({'where':{'id':_0x27799b[_0x3d23('0x4a')]['id']}})[_0x3d23('0x21')](handleEntityNotFound(_0x2e52b7,null))[_0x3d23('0x21')](removeEntity(_0x2e52b7,null))[_0x3d23('0x43')](handleError(_0x2e52b7,null));};exports[_0x3d23('0x4b')]=function(_0x53f9d4,_0x517c2f,_0x4263ce){var _0x4fe4a1={};var _0x26fdda={};var _0x173580;var _0x2a7cd4;return db['ZohoConfiguration'][_0x3d23('0x4c')]({'where':{'id':_0x53f9d4[_0x3d23('0x4a')]['id']}})['then'](handleEntityNotFound(_0x517c2f,null))['then'](function(_0x5d4f9d){if(_0x5d4f9d){_0x173580=_0x5d4f9d;_0x26fdda['model']=_[_0x3d23('0x2d')](db['ZohoField'][_0x3d23('0x28')]);_0x26fdda[_0x3d23('0x2c')]=_[_0x3d23('0x2d')](_0x53f9d4['query']);_0x26fdda[_0x3d23('0x2e')]=_['intersection'](_0x26fdda[_0x3d23('0x31')],_0x26fdda[_0x3d23('0x2c')]);_0x4fe4a1[_0x3d23('0x30')]=_[_0x3d23('0x2f')](_0x26fdda[_0x3d23('0x31')],qs['fields'](_0x53f9d4[_0x3d23('0x2c')][_0x3d23('0x32')]));_0x4fe4a1['attributes']=_0x4fe4a1[_0x3d23('0x30')]['length']?_0x4fe4a1[_0x3d23('0x30')]:_0x26fdda['model'];_0x4fe4a1[_0x3d23('0x36')]=qs['sort'](_0x53f9d4[_0x3d23('0x2c')][_0x3d23('0x37')]);_0x4fe4a1[_0x3d23('0x38')]=qs['filters'](_[_0x3d23('0x39')](_0x53f9d4[_0x3d23('0x2c')],_0x26fdda[_0x3d23('0x2e')]));if(_0x53f9d4[_0x3d23('0x2c')][_0x3d23('0x3a')]){_0x4fe4a1[_0x3d23('0x38')]=_['merge'](_0x4fe4a1[_0x3d23('0x38')],{'$or':_[_0x3d23('0x3c')](_0x4fe4a1['attributes'],function(_0x589394){var _0x21ef32={};_0x21ef32[_0x589394]={'$like':'%'+_0x53f9d4['query'][_0x3d23('0x3a')]+'%'};return _0x21ef32;})});}_0x4fe4a1=_['merge']({},_0x4fe4a1,_0x53f9d4['options']);return _0x173580[_0x3d23('0x4b')](_0x4fe4a1);}})[_0x3d23('0x21')](function(_0x957197){if(_0x957197){_0x2a7cd4=_0x957197[_0x3d23('0x44')];if(!_0x53f9d4[_0x3d23('0x2c')][_0x3d23('0x33')](_0x3d23('0x34'))){_0x4fe4a1[_0x3d23('0x35')]=qs[_0x3d23('0x35')](_0x53f9d4['query'][_0x3d23('0x35')]);_0x4fe4a1[_0x3d23('0x18')]=qs[_0x3d23('0x18')](_0x53f9d4['query']['offset']);}return _0x173580['getFields'](_0x4fe4a1);}})[_0x3d23('0x21')](function(_0x4a18f5){if(_0x4a18f5){return _0x4a18f5?{'count':_0x2a7cd4,'rows':_0x4a18f5}:null;}})['then'](respondWithResult(_0x517c2f,null))[_0x3d23('0x43')](handleError(_0x517c2f,null));};exports['getSubjects']=function(_0x4450a6,_0x33e9f1,_0x8c66a5){var _0x2151eb={};var _0x2b7fa4={};var _0x39f57c;var _0x420917;return db[_0x3d23('0x40')][_0x3d23('0x4c')]({'where':{'id':_0x4450a6['params']['id']}})[_0x3d23('0x21')](handleEntityNotFound(_0x33e9f1,null))[_0x3d23('0x21')](function(_0x591a12){if(_0x591a12){_0x39f57c=_0x591a12;_0x2b7fa4[_0x3d23('0x31')]=_['keys'](db[_0x3d23('0x4d')][_0x3d23('0x28')]);_0x2b7fa4[_0x3d23('0x2c')]=_[_0x3d23('0x2d')](_0x4450a6['query']);_0x2b7fa4['filters']=_[_0x3d23('0x2f')](_0x2b7fa4[_0x3d23('0x31')],_0x2b7fa4[_0x3d23('0x2c')]);_0x2151eb[_0x3d23('0x30')]=_[_0x3d23('0x2f')](_0x2b7fa4[_0x3d23('0x31')],qs[_0x3d23('0x32')](_0x4450a6[_0x3d23('0x2c')][_0x3d23('0x32')]));_0x2151eb[_0x3d23('0x30')]=_0x2151eb[_0x3d23('0x30')]['length']?_0x2151eb[_0x3d23('0x30')]:_0x2b7fa4['model'];_0x2151eb['order']=qs[_0x3d23('0x37')](_0x4450a6[_0x3d23('0x2c')][_0x3d23('0x37')]);_0x2151eb[_0x3d23('0x38')]=qs[_0x3d23('0x2e')](_[_0x3d23('0x39')](_0x4450a6[_0x3d23('0x2c')],_0x2b7fa4[_0x3d23('0x2e')]));if(_0x4450a6[_0x3d23('0x2c')]['filter']){_0x2151eb['where']=_[_0x3d23('0x3b')](_0x2151eb[_0x3d23('0x38')],{'$or':_[_0x3d23('0x3c')](_0x2151eb[_0x3d23('0x30')],function(_0x1a7c0e){var _0x40eb55={};_0x40eb55[_0x1a7c0e]={'$like':'%'+_0x4450a6[_0x3d23('0x2c')][_0x3d23('0x3a')]+'%'};return _0x40eb55;})});}_0x2151eb=_[_0x3d23('0x3b')]({},_0x2151eb,_0x4450a6['options']);return _0x39f57c['getSubjects'](_0x2151eb);}})[_0x3d23('0x21')](function(_0x485dd2){if(_0x485dd2){_0x420917=_0x485dd2[_0x3d23('0x44')];if(!_0x4450a6[_0x3d23('0x2c')]['hasOwnProperty'](_0x3d23('0x34'))){_0x2151eb[_0x3d23('0x35')]=qs[_0x3d23('0x35')](_0x4450a6['query']['limit']);_0x2151eb[_0x3d23('0x18')]=qs[_0x3d23('0x18')](_0x4450a6[_0x3d23('0x2c')][_0x3d23('0x18')]);}return _0x39f57c[_0x3d23('0x4e')](_0x2151eb);}})[_0x3d23('0x21')](function(_0x2c0dd1){if(_0x2c0dd1){return _0x2c0dd1?{'count':_0x420917,'rows':_0x2c0dd1}:null;}})[_0x3d23('0x21')](respondWithResult(_0x33e9f1,null))[_0x3d23('0x43')](handleError(_0x33e9f1,null));};exports[_0x3d23('0x4f')]=function(_0x1d330f,_0x370b4b,_0x46af50){var _0x90bc3c={};var _0x50bd4f={};var _0x30d4b2;var _0x52010b;return db[_0x3d23('0x40')]['findOne']({'where':{'id':_0x1d330f[_0x3d23('0x4a')]['id']}})[_0x3d23('0x21')](handleEntityNotFound(_0x370b4b,null))[_0x3d23('0x21')](function(_0x4a8c79){if(_0x4a8c79){_0x30d4b2=_0x4a8c79;_0x50bd4f[_0x3d23('0x31')]=_[_0x3d23('0x2d')](db['ZohoField']['rawAttributes']);_0x50bd4f[_0x3d23('0x2c')]=_[_0x3d23('0x2d')](_0x1d330f[_0x3d23('0x2c')]);_0x50bd4f[_0x3d23('0x2e')]=_[_0x3d23('0x2f')](_0x50bd4f[_0x3d23('0x31')],_0x50bd4f[_0x3d23('0x2c')]);_0x90bc3c[_0x3d23('0x30')]=_[_0x3d23('0x2f')](_0x50bd4f[_0x3d23('0x31')],qs['fields'](_0x1d330f['query'][_0x3d23('0x32')]));_0x90bc3c[_0x3d23('0x30')]=_0x90bc3c['attributes'][_0x3d23('0x44')]?_0x90bc3c[_0x3d23('0x30')]:_0x50bd4f['model'];_0x90bc3c['order']=qs[_0x3d23('0x37')](_0x1d330f[_0x3d23('0x2c')][_0x3d23('0x37')]);_0x90bc3c[_0x3d23('0x38')]=qs['filters'](_[_0x3d23('0x39')](_0x1d330f['query'],_0x50bd4f[_0x3d23('0x2e')]));if(_0x1d330f[_0x3d23('0x2c')]['filter']){_0x90bc3c['where']=_[_0x3d23('0x3b')](_0x90bc3c[_0x3d23('0x38')],{'$or':_[_0x3d23('0x3c')](_0x90bc3c['attributes'],function(_0x38e887){var _0x385a6f={};_0x385a6f[_0x38e887]={'$like':'%'+_0x1d330f['query'][_0x3d23('0x3a')]+'%'};return _0x385a6f;})});}_0x90bc3c=_['merge']({},_0x90bc3c,_0x1d330f[_0x3d23('0x45')]);return _0x30d4b2[_0x3d23('0x4f')](_0x90bc3c);}})['then'](function(_0x443e7f){if(_0x443e7f){_0x52010b=_0x443e7f[_0x3d23('0x44')];if(!_0x1d330f['query'][_0x3d23('0x33')](_0x3d23('0x34'))){_0x90bc3c[_0x3d23('0x35')]=qs[_0x3d23('0x35')](_0x1d330f[_0x3d23('0x2c')][_0x3d23('0x35')]);_0x90bc3c[_0x3d23('0x18')]=qs[_0x3d23('0x18')](_0x1d330f[_0x3d23('0x2c')][_0x3d23('0x18')]);}return _0x30d4b2[_0x3d23('0x4f')](_0x90bc3c);}})[_0x3d23('0x21')](function(_0x13eb41){if(_0x13eb41){return _0x13eb41?{'count':_0x52010b,'rows':_0x13eb41}:null;}})['then'](respondWithResult(_0x370b4b,null))[_0x3d23('0x43')](handleError(_0x370b4b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ca1=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x2e50a4,_0x4b2a34){var _0x2ae3ce=function(_0x2a7e1f){while(--_0x2a7e1f){_0x2e50a4['push'](_0x2e50a4['shift']());}};_0x2ae3ce(++_0x4b2a34);}(_0x4ca1,0x111));var _0x14ca=function(_0x2ab5d7,_0x1243d9){_0x2ab5d7=_0x2ab5d7-0x0;var _0x516388=_0x4ca1[_0x2ab5d7];return _0x516388;};'use strict';var _=require(_0x14ca('0x0'));var util=require('util');var logger=require(_0x14ca('0x1'))(_0x14ca('0x2'));var moment=require(_0x14ca('0x3'));var BPromise=require(_0x14ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14ca('0x5'));var rimraf=require(_0x14ca('0x6'));var config=require(_0x14ca('0x7'));var attributes=require(_0x14ca('0x8'));module[_0x14ca('0x9')]=function(_0x264643,_0x3b2856){return _0x264643[_0x14ca('0xa')](_0x14ca('0xb'),attributes,{'tableName':_0x14ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfda3=['../../config/environment','./intZohoConfiguration.attributes','define','lodash','../../config/logger','bluebird','request-promise'];(function(_0x494d25,_0x420a28){var _0x3d6a8e=function(_0x4e93c5){while(--_0x4e93c5){_0x494d25['push'](_0x494d25['shift']());}};_0x3d6a8e(++_0x420a28);}(_0xfda3,0x161));var _0x3fda=function(_0x500b10,_0x19ee0e){_0x500b10=_0x500b10-0x0;var _0x8bfb77=_0xfda3[_0x500b10];return _0x8bfb77;};'use strict';var _=require(_0x3fda('0x0'));var util=require('util');var logger=require(_0x3fda('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3fda('0x2'));var rp=require(_0x3fda('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3fda('0x4'));var attributes=require(_0x3fda('0x5'));module['exports']=function(_0x9488f,_0x5012b7){return _0x9488f[_0x3fda('0x6')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1579=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x136f80,_0x5c5e5a){var _0x592675=function(_0x1ad2c2){while(--_0x1ad2c2){_0x136f80['push'](_0x136f80['shift']());}};_0x592675(++_0x5c5e5a);}(_0x1579,0x1ea));var _0x9157=function(_0x5eb97,_0x1486fb){_0x5eb97=_0x5eb97-0x0;var _0x587cfa=_0x1579[_0x5eb97];return _0x587cfa;};'use strict';var _=require(_0x9157('0x0'));var util=require('util');var moment=require(_0x9157('0x1'));var BPromise=require(_0x9157('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9157('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9157('0x4'));var logger=require(_0x9157('0x5'))(_0x9157('0x6'));var config=require(_0x9157('0x7'));var jayson=require(_0x9157('0x8'));var client=jayson['client'][_0x9157('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a59ac,_0x3ea65a,_0x440e84){return new BPromise(function(_0x3f344c,_0x4ae1c9){return client[_0x9157('0xa')](_0x3a59ac,_0x440e84)[_0x9157('0xb')](function(_0x16cf9e){logger[_0x9157('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ea65a,_0x9157('0xd'));logger['debug'](_0x9157('0xe'),_0x3ea65a,_0x9157('0xd'),JSON[_0x9157('0xf')](_0x16cf9e));if(_0x16cf9e[_0x9157('0x10')]){if(_0x16cf9e['error'][_0x9157('0x11')]===0x1f4){logger[_0x9157('0x10')](_0x9157('0x12'),_0x3ea65a,_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);return _0x4ae1c9(_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);}logger[_0x9157('0x10')](_0x9157('0x12'),_0x3ea65a,_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);return _0x3f344c(_0x16cf9e[_0x9157('0x10')][_0x9157('0x13')]);}else{logger[_0x9157('0xc')](_0x9157('0x12'),_0x3ea65a,_0x9157('0xd'));_0x3f344c(_0x16cf9e['result'][_0x9157('0x13')]);}})[_0x9157('0x14')](function(_0x16292c){logger[_0x9157('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ea65a,_0x16292c);_0x4ae1c9(_0x16292c);});});}
\ No newline at end of file
+var _0x1f09=['message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d1081,_0x5d8d72){var _0x20de10=function(_0x5382e1){while(--_0x5382e1){_0x4d1081['push'](_0x4d1081['shift']());}};_0x20de10(++_0x5d8d72);}(_0x1f09,0xe7));var _0x91f0=function(_0x3a4d80,_0x35c85b){_0x3a4d80=_0x3a4d80-0x0;var _0x2b323a=_0x1f09[_0x3a4d80];return _0x2b323a;};'use strict';var _=require(_0x91f0('0x0'));var util=require(_0x91f0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x91f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91f0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x91f0('0x4'))(_0x91f0('0x5'));var config=require(_0x91f0('0x6'));var jayson=require(_0x91f0('0x7'));var client=jayson['client'][_0x91f0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f59ed,_0x39f888,_0x2f1665){return new BPromise(function(_0x208a0e,_0x4631e3){return client['request'](_0x2f59ed,_0x2f1665)[_0x91f0('0x9')](function(_0xe4f08f){logger['info'](_0x91f0('0xa'),_0x39f888,_0x91f0('0xb'));logger[_0x91f0('0xc')](_0x91f0('0xd'),_0x39f888,_0x91f0('0xb'),JSON[_0x91f0('0xe')](_0xe4f08f));if(_0xe4f08f[_0x91f0('0xf')]){if(_0xe4f08f[_0x91f0('0xf')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x39f888,_0xe4f08f[_0x91f0('0xf')][_0x91f0('0x10')]);return _0x4631e3(_0xe4f08f[_0x91f0('0xf')][_0x91f0('0x10')]);}logger[_0x91f0('0xf')](_0x91f0('0xa'),_0x39f888,_0xe4f08f[_0x91f0('0xf')][_0x91f0('0x10')]);return _0x208a0e(_0xe4f08f[_0x91f0('0xf')][_0x91f0('0x10')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x39f888,'request\x20sent');_0x208a0e(_0xe4f08f[_0x91f0('0x11')][_0x91f0('0x10')]);}})[_0x91f0('0x12')](function(_0x2862ab){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x39f888,_0x2862ab);_0x4631e3(_0x2862ab);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bb3=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1bb3,0x15c));var _0x31bb=function(_0x2fe4d4,_0x183e0c){_0x2fe4d4=_0x2fe4d4-0x0;var _0x1259b6=_0x1bb3[_0x2fe4d4];return _0x1259b6;};'use strict';var multer=require(_0x31bb('0x0'));var util=require(_0x31bb('0x1'));var path=require(_0x31bb('0x2'));var timeout=require(_0x31bb('0x3'));var express=require('express');var router=express[_0x31bb('0x4')]();var fs_extra=require(_0x31bb('0x5'));var auth=require(_0x31bb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31bb('0x7'));router[_0x31bb('0x8')]('/',auth[_0x31bb('0x9')](),controller[_0x31bb('0xa')]);router[_0x31bb('0x8')](_0x31bb('0xb'),auth[_0x31bb('0x9')](),controller[_0x31bb('0xc')]);router[_0x31bb('0xd')]('/',auth['isAuthenticated'](),controller[_0x31bb('0xe')]);router[_0x31bb('0xf')]('/:id',auth[_0x31bb('0x9')](),controller['update']);router[_0x31bb('0x10')](_0x31bb('0xb'),auth['isAuthenticated'](),controller[_0x31bb('0x11')]);module[_0x31bb('0x12')]=router;
\ No newline at end of file
+var _0x0441=['post','create','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show'];(function(_0x2a3a0d,_0x3331f6){var _0x30ff36=function(_0x4fc5c8){while(--_0x4fc5c8){_0x2a3a0d['push'](_0x2a3a0d['shift']());}};_0x30ff36(++_0x3331f6);}(_0x0441,0x74));var _0x1044=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0x0441[_0x1a87b3];return _0x37e84d;};'use strict';var multer=require(_0x1044('0x0'));var util=require(_0x1044('0x1'));var path=require(_0x1044('0x2'));var timeout=require(_0x1044('0x3'));var express=require('express');var router=express[_0x1044('0x4')]();var fs_extra=require(_0x1044('0x5'));var auth=require(_0x1044('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1044('0x7'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x1044('0x8')](),controller['index']);router[_0x1044('0x9')](_0x1044('0xa'),auth[_0x1044('0x8')](),controller[_0x1044('0xb')]);router[_0x1044('0xc')]('/',auth['isAuthenticated'](),controller[_0x1044('0xd')]);router[_0x1044('0xe')]('/:id',auth[_0x1044('0x8')](),controller[_0x1044('0xf')]);router['delete'](_0x1044('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedae=['sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x2eb279,_0x37fc0d){var _0x34eaba=function(_0x515e4a){while(--_0x515e4a){_0x2eb279['push'](_0x2eb279['shift']());}};_0x34eaba(++_0x37fc0d);}(_0xedae,0x1b0));var _0xeeda=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xedae[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0xeeda('0x0'));module['exports']={'type':{'type':Sequelize[_0xeeda('0x1')](_0xeeda('0x2'),_0xeeda('0x3'),_0xeeda('0x4'),_0xeeda('0x5'),_0xeeda('0x6')),'defaultValue':_0xeeda('0x2')},'content':{'type':Sequelize[_0xeeda('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xeeda('0x2'),_0xeeda('0x3'),_0xeeda('0x4'))},'keyContent':{'type':Sequelize[_0xeeda('0x7')]},'idField':{'type':Sequelize[_0xeeda('0x7')]},'nameField':{'type':Sequelize[_0xeeda('0x7')]},'customField':{'type':Sequelize[_0xeeda('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeeda('0x7')]}};
\ No newline at end of file
+var _0x4182=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2ccaad,_0x7ef251){var _0x48a938=function(_0x3be5d7){while(--_0x3be5d7){_0x2ccaad['push'](_0x2ccaad['shift']());}};_0x48a938(++_0x7ef251);}(_0x4182,0x66));var _0x2418=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x4182[_0x189305];return _0xea3406;};'use strict';var Sequelize=require(_0x2418('0x0'));module[_0x2418('0x1')]={'type':{'type':Sequelize[_0x2418('0x2')](_0x2418('0x3'),_0x2418('0x4'),_0x2418('0x5'),_0x2418('0x6'),_0x2418('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2418('0x8')]},'key':{'type':Sequelize[_0x2418('0x8')]},'keyType':{'type':Sequelize[_0x2418('0x2')](_0x2418('0x3'),_0x2418('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2418('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2418('0x8')]},'customField':{'type':Sequelize[_0x2418('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2418('0x8')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc3f=['destroy','error','name','send','index','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','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','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','then'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xdc3f,0xaf));var _0xfdc3=function(_0x39e893,_0x3861a8){_0x39e893=_0x39e893-0x0;var _0xe2fa1e=_0xdc3f[_0x39e893];return _0xe2fa1e;};'use strict';var emlformat=require(_0xfdc3('0x0'));var rimraf=require(_0xfdc3('0x1'));var zipdir=require(_0xfdc3('0x2'));var jsonpatch=require(_0xfdc3('0x3'));var rp=require(_0xfdc3('0x4'));var moment=require('moment');var BPromise=require(_0xfdc3('0x5'));var Mustache=require(_0xfdc3('0x6'));var util=require(_0xfdc3('0x7'));var path=require('path');var sox=require(_0xfdc3('0x8'));var csv=require(_0xfdc3('0x9'));var ejs=require(_0xfdc3('0xa'));var fs=require('fs');var fs_extra=require(_0xfdc3('0xb'));var _=require(_0xfdc3('0xc'));var squel=require('squel');var crypto=require(_0xfdc3('0xd'));var jsforce=require(_0xfdc3('0xe'));var deskjs=require(_0xfdc3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfdc3('0x10'));var Papa=require(_0xfdc3('0x11'));var Redis=require('ioredis');var authService=require(_0xfdc3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfdc3('0x13'));var hardwareService=require(_0xfdc3('0x14'));var logger=require(_0xfdc3('0x15'))(_0xfdc3('0x16'));var utils=require(_0xfdc3('0x17'));var config=require(_0xfdc3('0x18'));var licenseUtil=require(_0xfdc3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa1c6d,_0x3db2ce){_0x3db2ce=_0x3db2ce||0xcc;return function(_0x3dcfa9){if(_0x3dcfa9){return _0xa1c6d[_0xfdc3('0x1a')](_0x3db2ce);}return _0xa1c6d['status'](_0x3db2ce)[_0xfdc3('0x1b')]();};}function respondWithResult(_0x49964a,_0x4816ad){_0x4816ad=_0x4816ad||0xc8;return function(_0x53a288){if(_0x53a288){return _0x49964a[_0xfdc3('0x1c')](_0x4816ad)[_0xfdc3('0x1d')](_0x53a288);}};}function respondWithFilteredResult(_0x37faed,_0x5252c6){return function(_0x401883){if(_0x401883){var _0x427ad2=typeof _0x5252c6[_0xfdc3('0x1e')]===_0xfdc3('0x1f')&&typeof _0x5252c6['limit']===_0xfdc3('0x1f');var _0x1e2e60=_0x401883[_0xfdc3('0x20')];var _0x4a0c7c=_0x427ad2?0x0:_0x5252c6['offset'];var _0x2bf5a2=_0x427ad2?_0x401883[_0xfdc3('0x20')]:_0x5252c6['offset']+_0x5252c6[_0xfdc3('0x21')];var _0x2201db;if(_0x2bf5a2>=_0x1e2e60){_0x2bf5a2=_0x1e2e60;_0x2201db=0xc8;}else{_0x2201db=0xce;}_0x37faed['status'](_0x2201db);return _0x37faed[_0xfdc3('0x22')](_0xfdc3('0x23'),_0x4a0c7c+'-'+_0x2bf5a2+'/'+_0x1e2e60)['json'](_0x401883);}return null;};}function patchUpdates(_0x4a31ba){return function(_0x1eaa44){try{jsonpatch['apply'](_0x1eaa44,_0x4a31ba,!![]);}catch(_0x1d3c89){return BPromise[_0xfdc3('0x24')](_0x1d3c89);}return _0x1eaa44['save']();};}function saveUpdates(_0x1da4ac,_0x90366c){return function(_0x31d9d6){if(_0x31d9d6){return _0x31d9d6['update'](_0x1da4ac)[_0xfdc3('0x25')](function(_0xd3f1d0){return _0xd3f1d0;});}return null;};}function removeEntity(_0x1e19b7,_0x4f5662){return function(_0x46acf7){if(_0x46acf7){return _0x46acf7[_0xfdc3('0x26')]()[_0xfdc3('0x25')](function(){_0x1e19b7[_0xfdc3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f0fa,_0x51a2fc){return function(_0x592514){if(!_0x592514){_0x47f0fa[_0xfdc3('0x1a')](0x194);}return _0x592514;};}function handleError(_0x64abf9,_0x14c862){_0x14c862=_0x14c862||0x1f4;return function(_0xc22521){logger[_0xfdc3('0x27')](_0xc22521['stack']);if(_0xc22521['name']){delete _0xc22521[_0xfdc3('0x28')];}_0x64abf9[_0xfdc3('0x1c')](_0x14c862)[_0xfdc3('0x29')](_0xc22521);};}exports[_0xfdc3('0x2a')]=function(_0xda9926,_0xbd6440){var _0x412414={},_0x481597={},_0x35bd0f={'count':0x0,'rows':[]};var _0x4e4121=_[_0xfdc3('0x2b')](db[_0xfdc3('0x2c')]['rawAttributes'],function(_0x986098){return{'name':_0x986098[_0xfdc3('0x2d')],'type':_0x986098[_0xfdc3('0x2e')]['key']};});_0x481597[_0xfdc3('0x2f')]=_[_0xfdc3('0x2b')](_0x4e4121,_0xfdc3('0x28'));_0x481597[_0xfdc3('0x30')]=_[_0xfdc3('0x31')](_0xda9926[_0xfdc3('0x30')]);_0x481597[_0xfdc3('0x32')]=_[_0xfdc3('0x33')](_0x481597[_0xfdc3('0x2f')],_0x481597[_0xfdc3('0x30')]);_0x412414[_0xfdc3('0x34')]=_[_0xfdc3('0x33')](_0x481597[_0xfdc3('0x2f')],qs[_0xfdc3('0x35')](_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x35')]));_0x412414[_0xfdc3('0x34')]=_0x412414[_0xfdc3('0x34')][_0xfdc3('0x36')]?_0x412414['attributes']:_0x481597[_0xfdc3('0x2f')];if(!_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x37')]('nolimit')){_0x412414['limit']=qs[_0xfdc3('0x21')](_0xda9926[_0xfdc3('0x30')]['limit']);_0x412414[_0xfdc3('0x1e')]=qs[_0xfdc3('0x1e')](_0xda9926['query'][_0xfdc3('0x1e')]);}_0x412414[_0xfdc3('0x38')]=qs[_0xfdc3('0x39')](_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x39')]);_0x412414[_0xfdc3('0x3a')]=qs[_0xfdc3('0x32')](_['pick'](_0xda9926['query'],_0x481597[_0xfdc3('0x32')]),_0x4e4121);if(_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x3b')]){_0x412414['where']=_['merge'](_0x412414[_0xfdc3('0x3a')],{'$or':_[_0xfdc3('0x2b')](_0x4e4121,function(_0x308a94){if(_0x308a94[_0xfdc3('0x2e')]!==_0xfdc3('0x3c')){var _0x448ea7={};_0x448ea7[_0x308a94[_0xfdc3('0x28')]]={'$like':'%'+_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x3b')]+'%'};return _0x448ea7;}})});}_0x412414=_['merge']({},_0x412414,_0xda9926[_0xfdc3('0x3d')]);var _0x2e1a1a={'where':_0x412414[_0xfdc3('0x3a')]};return db[_0xfdc3('0x2c')][_0xfdc3('0x20')](_0x2e1a1a)[_0xfdc3('0x25')](function(_0x47d682){_0x35bd0f['count']=_0x47d682;if(_0xda9926[_0xfdc3('0x30')][_0xfdc3('0x3e')]){_0x412414[_0xfdc3('0x3f')]=[{'all':!![]}];}return db[_0xfdc3('0x2c')]['findAll'](_0x412414);})[_0xfdc3('0x25')](function(_0x514bda){_0x35bd0f[_0xfdc3('0x40')]=_0x514bda;return _0x35bd0f;})['then'](respondWithFilteredResult(_0xbd6440,_0x412414))[_0xfdc3('0x41')](handleError(_0xbd6440,null));};exports[_0xfdc3('0x42')]=function(_0x58d874,_0x2b88c0){var _0x44f738={'raw':!![],'where':{'id':_0x58d874[_0xfdc3('0x43')]['id']}},_0x26985d={};_0x26985d[_0xfdc3('0x2f')]=_[_0xfdc3('0x31')](db[_0xfdc3('0x2c')]['rawAttributes']);_0x26985d[_0xfdc3('0x30')]=_[_0xfdc3('0x31')](_0x58d874[_0xfdc3('0x30')]);_0x26985d[_0xfdc3('0x32')]=_['intersection'](_0x26985d['model'],_0x26985d['query']);_0x44f738[_0xfdc3('0x34')]=_[_0xfdc3('0x33')](_0x26985d[_0xfdc3('0x2f')],qs[_0xfdc3('0x35')](_0x58d874[_0xfdc3('0x30')][_0xfdc3('0x35')]));_0x44f738[_0xfdc3('0x34')]=_0x44f738[_0xfdc3('0x34')][_0xfdc3('0x36')]?_0x44f738[_0xfdc3('0x34')]:_0x26985d[_0xfdc3('0x2f')];if(_0x58d874[_0xfdc3('0x30')][_0xfdc3('0x3e')]){_0x44f738[_0xfdc3('0x3f')]=[{'all':!![]}];}_0x44f738=_['merge']({},_0x44f738,_0x58d874[_0xfdc3('0x3d')]);return db[_0xfdc3('0x2c')][_0xfdc3('0x44')](_0x44f738)[_0xfdc3('0x25')](handleEntityNotFound(_0x2b88c0,null))[_0xfdc3('0x25')](respondWithResult(_0x2b88c0,null))['catch'](handleError(_0x2b88c0,null));};exports['create']=function(_0x458721,_0x5197f0){return db['ZohoField']['create'](_0x458721[_0xfdc3('0x45')],{})[_0xfdc3('0x25')](respondWithResult(_0x5197f0,0xc9))['catch'](handleError(_0x5197f0,null));};exports[_0xfdc3('0x46')]=function(_0x324cdb,_0x53a936){if(_0x324cdb[_0xfdc3('0x45')]['id']){delete _0x324cdb[_0xfdc3('0x45')]['id'];}return db[_0xfdc3('0x2c')][_0xfdc3('0x44')]({'where':{'id':_0x324cdb[_0xfdc3('0x43')]['id']}})[_0xfdc3('0x25')](handleEntityNotFound(_0x53a936,null))[_0xfdc3('0x25')](saveUpdates(_0x324cdb[_0xfdc3('0x45')],null))[_0xfdc3('0x25')](respondWithResult(_0x53a936,null))[_0xfdc3('0x41')](handleError(_0x53a936,null));};exports[_0xfdc3('0x26')]=function(_0x5acc94,_0x3087da){return db[_0xfdc3('0x2c')][_0xfdc3('0x44')]({'where':{'id':_0x5acc94[_0xfdc3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3087da,null))[_0xfdc3('0x25')](removeEntity(_0x3087da,null))[_0xfdc3('0x41')](handleError(_0x3087da,null));};
\ No newline at end of file
+var _0xeb07=['apply','reject','save','update','then','destroy','error','name','status','index','map','rawAttributes','type','keys','query','intersection','model','fields','attributes','length','order','sort','where','filters','pick','merge','filter','options','ZohoField','includeAll','include','rows','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x8ec8e7,_0x4d220b){var _0x51857c=function(_0x2fa5d1){while(--_0x2fa5d1){_0x8ec8e7['push'](_0x8ec8e7['shift']());}};_0x51857c(++_0x4d220b);}(_0xeb07,0x17e));var _0x7eb0=function(_0xcf1d06,_0xf74a4e){_0xcf1d06=_0xcf1d06-0x0;var _0x4900c1=_0xeb07[_0xcf1d06];return _0x4900c1;};'use strict';var emlformat=require(_0x7eb0('0x0'));var rimraf=require(_0x7eb0('0x1'));var zipdir=require(_0x7eb0('0x2'));var jsonpatch=require(_0x7eb0('0x3'));var rp=require('request-promise');var moment=require(_0x7eb0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7eb0('0x5'));var path=require(_0x7eb0('0x6'));var sox=require(_0x7eb0('0x7'));var csv=require(_0x7eb0('0x8'));var ejs=require(_0x7eb0('0x9'));var fs=require('fs');var fs_extra=require(_0x7eb0('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7eb0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7eb0('0xc'));var toCsv=require(_0x7eb0('0x8'));var querystring=require(_0x7eb0('0xd'));var Papa=require(_0x7eb0('0xe'));var Redis=require(_0x7eb0('0xf'));var authService=require(_0x7eb0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7eb0('0x11'));var hardwareService=require(_0x7eb0('0x12'));var logger=require(_0x7eb0('0x13'))(_0x7eb0('0x14'));var utils=require('../../config/utils');var config=require(_0x7eb0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7eb0('0x16'))['db'];function respondWithStatusCode(_0x379531,_0x3249da){_0x3249da=_0x3249da||0xcc;return function(_0x5eb3cd){if(_0x5eb3cd){return _0x379531[_0x7eb0('0x17')](_0x3249da);}return _0x379531['status'](_0x3249da)[_0x7eb0('0x18')]();};}function respondWithResult(_0x36217c,_0x50b8e8){_0x50b8e8=_0x50b8e8||0xc8;return function(_0x568186){if(_0x568186){return _0x36217c['status'](_0x50b8e8)[_0x7eb0('0x19')](_0x568186);}};}function respondWithFilteredResult(_0x4bd271,_0x17a139){return function(_0x289a45){if(_0x289a45){var _0x1a225b=typeof _0x17a139['offset']===_0x7eb0('0x1a')&&typeof _0x17a139[_0x7eb0('0x1b')]===_0x7eb0('0x1a');var _0x48c7cb=_0x289a45['count'];var _0x2bf993=_0x1a225b?0x0:_0x17a139['offset'];var _0x53f62c=_0x1a225b?_0x289a45[_0x7eb0('0x1c')]:_0x17a139[_0x7eb0('0x1d')]+_0x17a139[_0x7eb0('0x1b')];var _0x26e004;if(_0x53f62c>=_0x48c7cb){_0x53f62c=_0x48c7cb;_0x26e004=0xc8;}else{_0x26e004=0xce;}_0x4bd271['status'](_0x26e004);return _0x4bd271[_0x7eb0('0x1e')](_0x7eb0('0x1f'),_0x2bf993+'-'+_0x53f62c+'/'+_0x48c7cb)['json'](_0x289a45);}return null;};}function patchUpdates(_0xbc21c3){return function(_0x2d9143){try{jsonpatch[_0x7eb0('0x20')](_0x2d9143,_0xbc21c3,!![]);}catch(_0x56a527){return BPromise[_0x7eb0('0x21')](_0x56a527);}return _0x2d9143[_0x7eb0('0x22')]();};}function saveUpdates(_0x1e23d9,_0x2649c0){return function(_0x17fb0a){if(_0x17fb0a){return _0x17fb0a[_0x7eb0('0x23')](_0x1e23d9)[_0x7eb0('0x24')](function(_0x5125ec){return _0x5125ec;});}return null;};}function removeEntity(_0x5bd56f,_0x25309f){return function(_0x35aff9){if(_0x35aff9){return _0x35aff9[_0x7eb0('0x25')]()[_0x7eb0('0x24')](function(){_0x5bd56f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b892,_0x2c1d2f){return function(_0x221298){if(!_0x221298){_0x47b892[_0x7eb0('0x17')](0x194);}return _0x221298;};}function handleError(_0x4458bc,_0x17778c){_0x17778c=_0x17778c||0x1f4;return function(_0x25a81f){logger[_0x7eb0('0x26')](_0x25a81f['stack']);if(_0x25a81f[_0x7eb0('0x27')]){delete _0x25a81f['name'];}_0x4458bc[_0x7eb0('0x28')](_0x17778c)['send'](_0x25a81f);};}exports[_0x7eb0('0x29')]=function(_0x5ae431,_0x5d9cd1){var _0x5e8b1f={},_0x2cc4c1={},_0x57db69={'count':0x0,'rows':[]};var _0xe7606b=_[_0x7eb0('0x2a')](db['ZohoField'][_0x7eb0('0x2b')],function(_0x367f0a){return{'name':_0x367f0a['fieldName'],'type':_0x367f0a[_0x7eb0('0x2c')]['key']};});_0x2cc4c1['model']=_['map'](_0xe7606b,_0x7eb0('0x27'));_0x2cc4c1['query']=_[_0x7eb0('0x2d')](_0x5ae431[_0x7eb0('0x2e')]);_0x2cc4c1['filters']=_[_0x7eb0('0x2f')](_0x2cc4c1[_0x7eb0('0x30')],_0x2cc4c1[_0x7eb0('0x2e')]);_0x5e8b1f['attributes']=_[_0x7eb0('0x2f')](_0x2cc4c1[_0x7eb0('0x30')],qs['fields'](_0x5ae431[_0x7eb0('0x2e')][_0x7eb0('0x31')]));_0x5e8b1f[_0x7eb0('0x32')]=_0x5e8b1f[_0x7eb0('0x32')][_0x7eb0('0x33')]?_0x5e8b1f['attributes']:_0x2cc4c1[_0x7eb0('0x30')];if(!_0x5ae431[_0x7eb0('0x2e')]['hasOwnProperty']('nolimit')){_0x5e8b1f['limit']=qs[_0x7eb0('0x1b')](_0x5ae431[_0x7eb0('0x2e')][_0x7eb0('0x1b')]);_0x5e8b1f[_0x7eb0('0x1d')]=qs[_0x7eb0('0x1d')](_0x5ae431[_0x7eb0('0x2e')][_0x7eb0('0x1d')]);}_0x5e8b1f[_0x7eb0('0x34')]=qs[_0x7eb0('0x35')](_0x5ae431['query']['sort']);_0x5e8b1f[_0x7eb0('0x36')]=qs[_0x7eb0('0x37')](_[_0x7eb0('0x38')](_0x5ae431[_0x7eb0('0x2e')],_0x2cc4c1['filters']),_0xe7606b);if(_0x5ae431[_0x7eb0('0x2e')]['filter']){_0x5e8b1f['where']=_[_0x7eb0('0x39')](_0x5e8b1f['where'],{'$or':_[_0x7eb0('0x2a')](_0xe7606b,function(_0x1e5b57){if(_0x1e5b57['type']!=='VIRTUAL'){var _0x27e025={};_0x27e025[_0x1e5b57[_0x7eb0('0x27')]]={'$like':'%'+_0x5ae431[_0x7eb0('0x2e')][_0x7eb0('0x3a')]+'%'};return _0x27e025;}})});}_0x5e8b1f=_[_0x7eb0('0x39')]({},_0x5e8b1f,_0x5ae431[_0x7eb0('0x3b')]);var _0xec0aa={'where':_0x5e8b1f[_0x7eb0('0x36')]};return db[_0x7eb0('0x3c')][_0x7eb0('0x1c')](_0xec0aa)[_0x7eb0('0x24')](function(_0x5a44a8){_0x57db69[_0x7eb0('0x1c')]=_0x5a44a8;if(_0x5ae431[_0x7eb0('0x2e')][_0x7eb0('0x3d')]){_0x5e8b1f[_0x7eb0('0x3e')]=[{'all':!![]}];}return db[_0x7eb0('0x3c')]['findAll'](_0x5e8b1f);})['then'](function(_0x1c7937){_0x57db69[_0x7eb0('0x3f')]=_0x1c7937;return _0x57db69;})[_0x7eb0('0x24')](respondWithFilteredResult(_0x5d9cd1,_0x5e8b1f))['catch'](handleError(_0x5d9cd1,null));};exports['show']=function(_0x31d495,_0x3165d8){var _0x2ef39a={'raw':!![],'where':{'id':_0x31d495['params']['id']}},_0x2875be={};_0x2875be['model']=_[_0x7eb0('0x2d')](db['ZohoField'][_0x7eb0('0x2b')]);_0x2875be[_0x7eb0('0x2e')]=_[_0x7eb0('0x2d')](_0x31d495[_0x7eb0('0x2e')]);_0x2875be[_0x7eb0('0x37')]=_[_0x7eb0('0x2f')](_0x2875be['model'],_0x2875be[_0x7eb0('0x2e')]);_0x2ef39a['attributes']=_['intersection'](_0x2875be[_0x7eb0('0x30')],qs[_0x7eb0('0x31')](_0x31d495['query'][_0x7eb0('0x31')]));_0x2ef39a[_0x7eb0('0x32')]=_0x2ef39a['attributes'][_0x7eb0('0x33')]?_0x2ef39a['attributes']:_0x2875be[_0x7eb0('0x30')];if(_0x31d495[_0x7eb0('0x2e')]['includeAll']){_0x2ef39a['include']=[{'all':!![]}];}_0x2ef39a=_[_0x7eb0('0x39')]({},_0x2ef39a,_0x31d495['options']);return db[_0x7eb0('0x3c')][_0x7eb0('0x40')](_0x2ef39a)[_0x7eb0('0x24')](handleEntityNotFound(_0x3165d8,null))[_0x7eb0('0x24')](respondWithResult(_0x3165d8,null))[_0x7eb0('0x41')](handleError(_0x3165d8,null));};exports['create']=function(_0x15aaf9,_0x28cecb){return db[_0x7eb0('0x3c')][_0x7eb0('0x42')](_0x15aaf9[_0x7eb0('0x43')],{})[_0x7eb0('0x24')](respondWithResult(_0x28cecb,0xc9))[_0x7eb0('0x41')](handleError(_0x28cecb,null));};exports[_0x7eb0('0x23')]=function(_0x6e221c,_0x10fcbe){if(_0x6e221c[_0x7eb0('0x43')]['id']){delete _0x6e221c[_0x7eb0('0x43')]['id'];}return db[_0x7eb0('0x3c')][_0x7eb0('0x40')]({'where':{'id':_0x6e221c[_0x7eb0('0x44')]['id']}})[_0x7eb0('0x24')](handleEntityNotFound(_0x10fcbe,null))[_0x7eb0('0x24')](saveUpdates(_0x6e221c['body'],null))['then'](respondWithResult(_0x10fcbe,null))['catch'](handleError(_0x10fcbe,null));};exports['destroy']=function(_0x427a24,_0x545f52){return db[_0x7eb0('0x3c')]['find']({'where':{'id':_0x427a24[_0x7eb0('0x44')]['id']}})[_0x7eb0('0x24')](handleEntityNotFound(_0x545f52,null))['then'](removeEntity(_0x545f52,null))[_0x7eb0('0x41')](handleError(_0x545f52,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['int_zoho_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField'];(function(_0x2b0ccf,_0x4ae4d4){var _0x5293e4=function(_0x4e852f){while(--_0x4e852f){_0x2b0ccf['push'](_0x2b0ccf['shift']());}};_0x5293e4(++_0x4ae4d4);}(_0x7a54,0x106));var _0x47a5=function(_0x17c76c,_0x1fb74c){_0x17c76c=_0x17c76c-0x0;var _0x582fa6=_0x7a54[_0x17c76c];return _0x582fa6;};'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':'zoho_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xed1c=['lodash','util','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0xed1c,0xe4));var _0xced1=function(_0x46200d,_0x1327b8){_0x46200d=_0x46200d-0x0;var _0x73bcfa=_0xed1c[_0x46200d];return _0x73bcfa;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[{'name':_0xced1('0x9'),'fields':[_0xced1('0xa'),_0xced1('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f35=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x379294,_0x26e624){var _0x4f895d=function(_0x324ca7){while(--_0x324ca7){_0x379294['push'](_0x379294['shift']());}};_0x4f895d(++_0x26e624);}(_0x4f35,0x1b3));var _0x54f3=function(_0x5ba0c9,_0xa2f19a){_0x5ba0c9=_0x5ba0c9-0x0;var _0x9c99ba=_0x4f35[_0x5ba0c9];return _0x9c99ba;};'use strict';var _=require('lodash');var util=require(_0x54f3('0x0'));var moment=require(_0x54f3('0x1'));var BPromise=require(_0x54f3('0x2'));var rs=require(_0x54f3('0x3'));var fs=require('fs');var Redis=require(_0x54f3('0x4'));var db=require(_0x54f3('0x5'))['db'];var utils=require(_0x54f3('0x6'));var logger=require('../../config/logger')(_0x54f3('0x7'));var config=require('../../config/environment');var jayson=require(_0x54f3('0x8'));var client=jayson[_0x54f3('0x9')][_0x54f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ec65,_0x52ecef,_0x28863d){return new BPromise(function(_0x22427c,_0x5f2476){return client[_0x54f3('0xb')](_0x27ec65,_0x28863d)[_0x54f3('0xc')](function(_0x5e6b6e){logger['info'](_0x54f3('0xd'),_0x52ecef,_0x54f3('0xe'));logger[_0x54f3('0xf')](_0x54f3('0x10'),_0x52ecef,_0x54f3('0xe'),JSON[_0x54f3('0x11')](_0x5e6b6e));if(_0x5e6b6e[_0x54f3('0x12')]){if(_0x5e6b6e['error']['code']===0x1f4){logger[_0x54f3('0x12')](_0x54f3('0xd'),_0x52ecef,_0x5e6b6e[_0x54f3('0x12')][_0x54f3('0x13')]);return _0x5f2476(_0x5e6b6e[_0x54f3('0x12')][_0x54f3('0x13')]);}logger['error'](_0x54f3('0xd'),_0x52ecef,_0x5e6b6e[_0x54f3('0x12')][_0x54f3('0x13')]);return _0x22427c(_0x5e6b6e[_0x54f3('0x12')]['message']);}else{logger[_0x54f3('0x14')](_0x54f3('0xd'),_0x52ecef,_0x54f3('0xe'));_0x22427c(_0x5e6b6e['result']['message']);}})[_0x54f3('0x15')](function(_0x5a3ee2){logger[_0x54f3('0x12')](_0x54f3('0xd'),_0x52ecef,_0x5a3ee2);_0x5f2476(_0x5a3ee2);});});}
\ No newline at end of file
+var _0x181a=['debug','stringify','error','message','util','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x2d779c,_0x47bfaf){var _0x4f4d82=function(_0x5a9bfc){while(--_0x5a9bfc){_0x2d779c['push'](_0x2d779c['shift']());}};_0x4f4d82(++_0x47bfaf);}(_0x181a,0xe5));var _0xa181=function(_0x228c29,_0xb326ff){_0x228c29=_0x228c29-0x0;var _0x109df1=_0x181a[_0x228c29];return _0x109df1;};'use strict';var _=require('lodash');var util=require(_0xa181('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa181('0x1'));var db=require(_0xa181('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa181('0x3'));var config=require('../../config/environment');var jayson=require(_0xa181('0x4'));var client=jayson['client'][_0xa181('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x299ad0,_0x5396d2,_0x2f114c){return new BPromise(function(_0x34ae21,_0x407318){return client[_0xa181('0x6')](_0x299ad0,_0x2f114c)[_0xa181('0x7')](function(_0xcf995b){logger[_0xa181('0x8')](_0xa181('0x9'),_0x5396d2,_0xa181('0xa'));logger[_0xa181('0xb')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x5396d2,_0xa181('0xa'),JSON[_0xa181('0xc')](_0xcf995b));if(_0xcf995b[_0xa181('0xd')]){if(_0xcf995b[_0xa181('0xd')]['code']===0x1f4){logger[_0xa181('0xd')](_0xa181('0x9'),_0x5396d2,_0xcf995b['error'][_0xa181('0xe')]);return _0x407318(_0xcf995b['error']['message']);}logger[_0xa181('0xd')]('ZohoField,\x20%s,\x20%s',_0x5396d2,_0xcf995b[_0xa181('0xd')][_0xa181('0xe')]);return _0x34ae21(_0xcf995b[_0xa181('0xd')]['message']);}else{logger['info'](_0xa181('0x9'),_0x5396d2,_0xa181('0xa'));_0x34ae21(_0xcf995b['result'][_0xa181('0xe')]);}})['catch'](function(_0x361540){logger[_0xa181('0xd')](_0xa181('0x9'),_0x5396d2,_0x361540);_0x407318(_0x361540);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x35cff0,_0x2e162c){var _0x4a9414=function(_0x569e67){while(--_0x569e67){_0x35cff0['push'](_0x35cff0['shift']());}};_0x4a9414(++_0x2e162c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f611d,_0x1ee478){var _0x5634f5=function(_0x1a3cc9){while(--_0x1a3cc9){_0x4f611d['push'](_0x4f611d['shift']());}};_0x5634f5(++_0x1ee478);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd61e=['INTEGER','BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x139736,_0x2f6f94){var _0x4f6dd9=function(_0x32879e){while(--_0x32879e){_0x139736['push'](_0x139736['shift']());}};_0x4f6dd9(++_0x2f6f94);}(_0xd61e,0x13d));var _0xed61=function(_0x559076,_0x45d870){_0x559076=_0x559076-0x0;var _0x7c353d=_0xd61e[_0x559076];return _0x7c353d;};'use strict';var Sequelize=require(_0xed61('0x0'));module[_0xed61('0x1')]={'name':{'type':Sequelize[_0xed61('0x2')],'allowNull':![],'unique':_0xed61('0x3')},'version':{'type':Sequelize[_0xed61('0x2')],'allowNull':![],'unique':_0xed61('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xed61('0x4')},'filename':{'type':Sequelize[_0xed61('0x2')]},'path':{'type':Sequelize[_0xed61('0x2')]},'type':{'type':Sequelize[_0xed61('0x2')]},'size':{'type':Sequelize[_0xed61('0x5')]},'active':{'type':Sequelize[_0xed61('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xed61('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xed61('0x2')]},'link':{'type':Sequelize[_0xed61('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x649c=['state','exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN'];(function(_0x4b3661,_0x1be781){var _0x582d0c=function(_0x1a1ee4){while(--_0x1a1ee4){_0x4b3661['push'](_0x4b3661['shift']());}};_0x582d0c(++_0x1be781);}(_0x649c,0x1cf));var _0xc649=function(_0x221de0,_0x2491f8){_0x221de0=_0x221de0-0x0;var _0x3fe2ff=_0x649c[_0x221de0];return _0x3fe2ff;};'use strict';var Sequelize=require('sequelize');module[_0xc649('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc649('0x1')},'version':{'type':Sequelize[_0xc649('0x2')],'allowNull':![],'unique':_0xc649('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xc649('0x3')},'filename':{'type':Sequelize[_0xc649('0x2')]},'path':{'type':Sequelize[_0xc649('0x2')]},'type':{'type':Sequelize[_0xc649('0x2')]},'size':{'type':Sequelize[_0xc649('0x4')]},'active':{'type':Sequelize[_0xc649('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xc649('0x2')]},'logo':{'type':Sequelize[_0xc649('0x2')]},'state':{'type':Sequelize[_0xc649('0x2')],'unique':_0xc649('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xc649('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xc649('0x2')],'defaultValue':'#'}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0x9582,0x95));var _0x2958=function(_0x2ad076,_0x352e9f){_0x2ad076=_0x2ad076-0x0;var _0x2c165a=_0x9582[_0x2ad076];return _0x2c165a;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));};
\ No newline at end of file
+var _0x7880=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit'];(function(_0x3c6a74,_0x5406dc){var _0x343560=function(_0x4de896){while(--_0x4de896){_0x3c6a74['push'](_0x3c6a74['shift']());}};_0x343560(++_0x5406dc);}(_0x7880,0x1f4));var _0x0788=function(_0x5d7b48,_0x1c8eaa){_0x5d7b48=_0x5d7b48-0x0;var _0x31bd82=_0x7880[_0x5d7b48];return _0x31bd82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['Integration'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa40f=['../../config/environment','./integration.attributes','integrations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2313ed,_0x1b8268){var _0x483fc8=function(_0x15f54a){while(--_0x15f54a){_0x2313ed['push'](_0x2313ed['shift']());}};_0x483fc8(++_0x1b8268);}(_0xa40f,0xfd));var _0xfa40=function(_0x257e8,_0x25ac58){_0x257e8=_0x257e8-0x0;var _0x3302e0=_0xa40f[_0x257e8];return _0x3302e0;};'use strict';var _=require('lodash');var util=require(_0xfa40('0x0'));var logger=require(_0xfa40('0x1'))(_0xfa40('0x2'));var moment=require(_0xfa40('0x3'));var BPromise=require(_0xfa40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa40('0x5'));var rimraf=require(_0xfa40('0x6'));var config=require(_0xfa40('0x7'));var attributes=require(_0xfa40('0x8'));module['exports']=function(_0x31165b,_0x1e096c){return _0x31165b['define']('Integration',attributes,{'tableName':_0xfa40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09a0=['bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','../../config/logger','api','moment'];(function(_0x12cfdb,_0x5bd754){var _0x211ad5=function(_0x467d6d){while(--_0x467d6d){_0x12cfdb['push'](_0x12cfdb['shift']());}};_0x211ad5(++_0x5bd754);}(_0x09a0,0x11a));var _0x009a=function(_0x4ad0e6,_0x4bbe4a){_0x4ad0e6=_0x4ad0e6-0x0;var _0x1aaae1=_0x09a0[_0x4ad0e6];return _0x1aaae1;};'use strict';var _=require(_0x009a('0x0'));var util=require('util');var logger=require(_0x009a('0x1'))(_0x009a('0x2'));var moment=require(_0x009a('0x3'));var BPromise=require(_0x009a('0x4'));var rp=require(_0x009a('0x5'));var fs=require('fs');var path=require(_0x009a('0x6'));var rimraf=require(_0x009a('0x7'));var config=require(_0x009a('0x8'));var attributes=require(_0x009a('0x9'));module[_0x009a('0xa')]=function(_0x42ad96,_0x48dc7d){return _0x42ad96['define'](_0x009a('0xb'),attributes,{'tableName':_0x009a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4a77e1,_0x213125){var _0x1bd46d=function(_0x1ab441){while(--_0x1ab441){_0x4a77e1['push'](_0x4a77e1['shift']());}};_0x1bd46d(++_0x213125);}(_0xef0f,0x168));var _0xfef0=function(_0x2d9bec,_0x25bd82){_0x2d9bec=_0x2d9bec-0x0;var _0x55536e=_0xef0f[_0x2d9bec];return _0x55536e;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}
\ No newline at end of file
+var _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1a5049,_0x37cb36){var _0x807c2b=function(_0x8b742f){while(--_0x8b742f){_0x1a5049['push'](_0x1a5049['shift']());}};_0x807c2b(++_0x37cb36);}(_0x955f,0x1eb));var _0xf955=function(_0x52924d,_0x74d09c){_0x52924d=_0x52924d-0x0;var _0x5adeeb=_0x955f[_0x52924d];return _0x5adeeb;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x16fcdc,_0x31f66d){var _0x186aaa=function(_0x5cfca8){while(--_0x5cfca8){_0x16fcdc['push'](_0x16fcdc['shift']());}};_0x186aaa(++_0x31f66d);}(_0x7880,0x1f4));var _0x0788=function(_0x20be28,_0x24b925){_0x20be28=_0x20be28-0x0;var _0x8ab067=_0x7880[_0x20be28];return _0x8ab067;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router;
\ No newline at end of file
+var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x5c5b73,_0x26c7e4){var _0x3975db=function(_0x129032){while(--_0x129032){_0x5c5b73['push'](_0x5c5b73['shift']());}};_0x3975db(++_0x26c7e4);}(_0x187d,0x93));var _0xd187=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x187d[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32bf=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED'];(function(_0x2eebc6,_0x14c2c5){var _0x4cfc1e=function(_0x395586){while(--_0x395586){_0x2eebc6['push'](_0x2eebc6['shift']());}};_0x4cfc1e(++_0x14c2c5);}(_0x32bf,0x83));var _0xf32b=function(_0x528f30,_0x1de48f){_0x528f30=_0x528f30-0x0;var _0x4a0077=_0x32bf[_0x528f30];return _0x4a0077;};'use strict';var Sequelize=require('sequelize');module[_0xf32b('0x0')]={'integration':{'type':Sequelize[_0xf32b('0x1')]},'eventChannel':{'type':Sequelize[_0xf32b('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xf32b('0x1')]},'integrationId':{'type':Sequelize[_0xf32b('0x2')]},'contacts':{'type':Sequelize[_0xf32b('0x1')]},'uniqueid':{'type':Sequelize[_0xf32b('0x1')]},'calleridnum':{'type':Sequelize[_0xf32b('0x1')]},'calleridname':{'type':Sequelize[_0xf32b('0x1')]},'queue':{'type':Sequelize[_0xf32b('0x1')]},'interface':{'type':Sequelize[_0xf32b('0x1')]},'membername':{'type':Sequelize[_0xf32b('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf32b('0x3')]},'agentconnectAt':{'type':Sequelize[_0xf32b('0x3')]},'holdtime':{'type':Sequelize[_0xf32b('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf32b('0x3')]},'talktime':{'type':Sequelize[_0xf32b('0x2')]},'agentacw':{'type':Sequelize[_0xf32b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf32b('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf32b('0x3')]},'agentdump':{'type':Sequelize[_0xf32b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf32b('0x3')]},'lastevent':{'type':Sequelize[_0xf32b('0x1')]},'channel':{'type':Sequelize[_0xf32b('0x1')]},'channelstate':{'type':Sequelize[_0xf32b('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf32b('0x1')]},'connectedlinename':{'type':Sequelize[_0xf32b('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf32b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf32b('0x1')]},'destchannelstate':{'type':Sequelize[_0xf32b('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf32b('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf32b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf32b('0x1')]},'destlanguage':{'type':Sequelize[_0xf32b('0x1')]},'destaccountcode':{'type':Sequelize[_0xf32b('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf32b('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xf32b('0x1')]},'messageId':{'type':Sequelize[_0xf32b('0x1')]},'inReplyTo':{'type':Sequelize[_0xf32b('0x1')]},'subject':{'type':Sequelize[_0xf32b('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf32b('0x1')]},'cc':{'type':Sequelize[_0xf32b('0x1')]},'attachment':{'type':Sequelize[_0xf32b('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xf32b('0x5')]},'status':{'type':Sequelize[_0xf32b('0x6')]('SENT',_0xf32b('0x7'),_0xf32b('0x8'),_0xf32b('0x9'))},'url':{'type':Sequelize[_0xf32b('0x1')]},'app':{'type':Sequelize[_0xf32b('0x1')]},'appdata':{'type':Sequelize[_0xf32b('0x1')]},'projectId':{'type':Sequelize[_0xf32b('0x2')]}};
\ No newline at end of file
+var _0xbfe9=['DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','STRING'];(function(_0x51f693,_0x302420){var _0x1ad300=function(_0x16789e){while(--_0x16789e){_0x51f693['push'](_0x51f693['shift']());}};_0x1ad300(++_0x302420);}(_0xbfe9,0x184));var _0x9bfe=function(_0x3a0180,_0x35c0f6){_0x3a0180=_0x3a0180-0x0;var _0x368811=_0xbfe9[_0x3a0180];return _0x368811;};'use strict';var Sequelize=require(_0x9bfe('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x9bfe('0x1')]},'exitStatus':{'type':Sequelize[_0x9bfe('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x9bfe('0x1')]},'uniqueid':{'type':Sequelize[_0x9bfe('0x1')]},'calleridnum':{'type':Sequelize[_0x9bfe('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9bfe('0x1')]},'interface':{'type':Sequelize[_0x9bfe('0x1')]},'membername':{'type':Sequelize[_0x9bfe('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9bfe('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9bfe('0x2')]},'talktime':{'type':Sequelize[_0x9bfe('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9bfe('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x9bfe('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x9bfe('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9bfe('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x9bfe('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9bfe('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9bfe('0x1')]},'accountcode':{'type':Sequelize[_0x9bfe('0x1')]},'context':{'type':Sequelize[_0x9bfe('0x1')]},'exten':{'type':Sequelize[_0x9bfe('0x1')]},'priority':{'type':Sequelize[_0x9bfe('0x1')]},'destchannel':{'type':Sequelize[_0x9bfe('0x1')]},'destchannelstate':{'type':Sequelize[_0x9bfe('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9bfe('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9bfe('0x1')]},'destcalleridname':{'type':Sequelize[_0x9bfe('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9bfe('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9bfe('0x1')]},'destcontext':{'type':Sequelize[_0x9bfe('0x1')]},'destexten':{'type':Sequelize[_0x9bfe('0x1')]},'destpriority':{'type':Sequelize[_0x9bfe('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x9bfe('0x1')]},'inReplyTo':{'type':Sequelize[_0x9bfe('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x9bfe('0x1')]},'to':{'type':Sequelize[_0x9bfe('0x1')]},'cc':{'type':Sequelize[_0x9bfe('0x1')]},'attachment':{'type':Sequelize[_0x9bfe('0x5')]},'html':{'type':Sequelize[_0x9bfe('0x5')]},'text':{'type':Sequelize[_0x9bfe('0x5')]},'status':{'type':Sequelize[_0x9bfe('0x6')](_0x9bfe('0x7'),_0x9bfe('0x8'),_0x9bfe('0x9'),'FAILED')},'url':{'type':Sequelize[_0x9bfe('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x9bfe('0x1')]},'projectId':{'type':Sequelize[_0x9bfe('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x235a=['../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3db306,_0x39a363){var _0x1ed8c4=function(_0x39a62d){while(--_0x39a62d){_0x3db306['push'](_0x3db306['shift']());}};_0x1ed8c4(++_0x39a363);}(_0x235a,0xc7));var _0xa235=function(_0x28e7ea,_0x5af04c){_0x28e7ea=_0x28e7ea-0x0;var _0x32998b=_0x235a[_0x28e7ea];return _0x32998b;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa235('0x2'));var rp=require('request-promise');var moment=require(_0xa235('0x3'));var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa235('0x6'));var csv=require(_0xa235('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa235('0x8'));var _=require(_0xa235('0x9'));var squel=require('squel');var crypto=require(_0xa235('0xa'));var jsforce=require(_0xa235('0xb'));var deskjs=require(_0xa235('0xc'));var toCsv=require(_0xa235('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0xd'));var qs=require(_0xa235('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa235('0xf'));var logger=require('../../config/logger')(_0xa235('0x10'));var utils=require(_0xa235('0x11'));var config=require(_0xa235('0x12'));var licenseUtil=require(_0xa235('0x13'));var db=require(_0xa235('0x14'))['db'];function respondWithStatusCode(_0x109f20,_0x6a0d69){_0x6a0d69=_0x6a0d69||0xcc;return function(_0x21ddf0){if(_0x21ddf0){return _0x109f20['sendStatus'](_0x6a0d69);}return _0x109f20[_0xa235('0x15')](_0x6a0d69)['end']();};}function respondWithResult(_0x4a0614,_0x137968){_0x137968=_0x137968||0xc8;return function(_0x2b31f1){if(_0x2b31f1){return _0x4a0614[_0xa235('0x15')](_0x137968)[_0xa235('0x16')](_0x2b31f1);}};}function respondWithFilteredResult(_0x23e2df,_0x377527){return function(_0xffb4e0){if(_0xffb4e0){var _0x1ebb0e=typeof _0x377527[_0xa235('0x17')]===_0xa235('0x18')&&typeof _0x377527['limit']===_0xa235('0x18');var _0x56a352=_0xffb4e0[_0xa235('0x19')];var _0x159d30=_0x1ebb0e?0x0:_0x377527[_0xa235('0x17')];var _0x15f7c8=_0x1ebb0e?_0xffb4e0['count']:_0x377527['offset']+_0x377527[_0xa235('0x1a')];var _0x144dd9;if(_0x15f7c8>=_0x56a352){_0x15f7c8=_0x56a352;_0x144dd9=0xc8;}else{_0x144dd9=0xce;}_0x23e2df['status'](_0x144dd9);return _0x23e2df[_0xa235('0x1b')](_0xa235('0x1c'),_0x159d30+'-'+_0x15f7c8+'/'+_0x56a352)[_0xa235('0x16')](_0xffb4e0);}return null;};}function patchUpdates(_0x111d0e){return function(_0x4cc35c){try{jsonpatch[_0xa235('0x1d')](_0x4cc35c,_0x111d0e,!![]);}catch(_0x44f3a3){return BPromise['reject'](_0x44f3a3);}return _0x4cc35c[_0xa235('0x1e')]();};}function saveUpdates(_0x36a7f0,_0x3c8f7e){return function(_0x29d111){if(_0x29d111){return _0x29d111[_0xa235('0x1f')](_0x36a7f0)[_0xa235('0x20')](function(_0x55efb){return _0x55efb;});}return null;};}function removeEntity(_0x14de12,_0x5d8a1b){return function(_0x434903){if(_0x434903){return _0x434903['destroy']()[_0xa235('0x20')](function(){_0x14de12[_0xa235('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aab5f,_0x10dc57){return function(_0x2b0d3c){if(!_0x2b0d3c){_0x5aab5f[_0xa235('0x21')](0x194);}return _0x2b0d3c;};}function handleError(_0xe767af,_0x6586f6){_0x6586f6=_0x6586f6||0x1f4;return function(_0x5767c7){logger[_0xa235('0x22')](_0x5767c7['stack']);if(_0x5767c7[_0xa235('0x23')]){delete _0x5767c7[_0xa235('0x23')];}_0xe767af[_0xa235('0x15')](_0x6586f6)[_0xa235('0x24')](_0x5767c7);};}exports[_0xa235('0x25')]=function(_0x22a794,_0xf9dea6){var _0x47ea60={},_0x5cd355={},_0x123a5c={'count':0x0,'rows':[]};var _0x3e9190=_[_0xa235('0x26')](db[_0xa235('0x27')][_0xa235('0x28')],function(_0x5a765f){return{'name':_0x5a765f[_0xa235('0x29')],'type':_0x5a765f[_0xa235('0x2a')][_0xa235('0x2b')]};});_0x5cd355['model']=_[_0xa235('0x26')](_0x3e9190,_0xa235('0x23'));_0x5cd355[_0xa235('0x2c')]=_[_0xa235('0x2d')](_0x22a794[_0xa235('0x2c')]);_0x5cd355[_0xa235('0x2e')]=_[_0xa235('0x2f')](_0x5cd355[_0xa235('0x30')],_0x5cd355[_0xa235('0x2c')]);_0x47ea60[_0xa235('0x31')]=_[_0xa235('0x2f')](_0x5cd355[_0xa235('0x30')],qs[_0xa235('0x32')](_0x22a794[_0xa235('0x2c')][_0xa235('0x32')]));_0x47ea60[_0xa235('0x31')]=_0x47ea60[_0xa235('0x31')][_0xa235('0x33')]?_0x47ea60[_0xa235('0x31')]:_0x5cd355[_0xa235('0x30')];if(!_0x22a794[_0xa235('0x2c')][_0xa235('0x34')](_0xa235('0x35'))){_0x47ea60[_0xa235('0x1a')]=qs[_0xa235('0x1a')](_0x22a794[_0xa235('0x2c')][_0xa235('0x1a')]);_0x47ea60[_0xa235('0x17')]=qs[_0xa235('0x17')](_0x22a794[_0xa235('0x2c')][_0xa235('0x17')]);}_0x47ea60[_0xa235('0x36')]=qs[_0xa235('0x37')](_0x22a794[_0xa235('0x2c')]['sort']);_0x47ea60[_0xa235('0x38')]=qs[_0xa235('0x2e')](_[_0xa235('0x39')](_0x22a794['query'],_0x5cd355[_0xa235('0x2e')]),_0x3e9190);if(_0x22a794['query'][_0xa235('0x3a')]){_0x47ea60[_0xa235('0x38')]=_[_0xa235('0x3b')](_0x47ea60[_0xa235('0x38')],{'$or':_[_0xa235('0x26')](_0x3e9190,function(_0x15ba38){if(_0x15ba38[_0xa235('0x2a')]!==_0xa235('0x3c')){var _0x3d37c5={};_0x3d37c5[_0x15ba38['name']]={'$like':'%'+_0x22a794[_0xa235('0x2c')][_0xa235('0x3a')]+'%'};return _0x3d37c5;}})});}_0x47ea60=_[_0xa235('0x3b')]({},_0x47ea60,_0x22a794[_0xa235('0x3d')]);var _0x1de18d={'where':_0x47ea60[_0xa235('0x38')]};return db[_0xa235('0x27')][_0xa235('0x19')](_0x1de18d)[_0xa235('0x20')](function(_0x29e9be){_0x123a5c[_0xa235('0x19')]=_0x29e9be;if(_0x22a794[_0xa235('0x2c')]['includeAll']){_0x47ea60[_0xa235('0x3e')]=[{'all':!![]}];}return db[_0xa235('0x27')][_0xa235('0x3f')](_0x47ea60);})[_0xa235('0x20')](function(_0x48bab8){_0x123a5c[_0xa235('0x40')]=_0x48bab8;return _0x123a5c;})[_0xa235('0x20')](respondWithFilteredResult(_0xf9dea6,_0x47ea60))[_0xa235('0x41')](handleError(_0xf9dea6,null));};exports[_0xa235('0x42')]=function(_0x468043,_0x436f21){var _0x4bf221={'raw':![],'where':{'id':_0x468043[_0xa235('0x43')]['id']}},_0x7ddc69={};_0x7ddc69[_0xa235('0x30')]=_[_0xa235('0x2d')](db[_0xa235('0x27')][_0xa235('0x28')]);_0x7ddc69['query']=_[_0xa235('0x2d')](_0x468043[_0xa235('0x2c')]);_0x7ddc69[_0xa235('0x2e')]=_[_0xa235('0x2f')](_0x7ddc69[_0xa235('0x30')],_0x7ddc69[_0xa235('0x2c')]);_0x4bf221['attributes']=_['intersection'](_0x7ddc69[_0xa235('0x30')],qs[_0xa235('0x32')](_0x468043[_0xa235('0x2c')][_0xa235('0x32')]));_0x4bf221['attributes']=_0x4bf221[_0xa235('0x31')][_0xa235('0x33')]?_0x4bf221[_0xa235('0x31')]:_0x7ddc69[_0xa235('0x30')];if(_0x468043[_0xa235('0x2c')][_0xa235('0x44')]){_0x4bf221[_0xa235('0x3e')]=[{'all':!![]}];}_0x4bf221=_['merge']({},_0x4bf221,_0x468043[_0xa235('0x3d')]);return db[_0xa235('0x27')][_0xa235('0x45')](_0x4bf221)[_0xa235('0x20')](handleEntityNotFound(_0x436f21,null))[_0xa235('0x20')](respondWithResult(_0x436f21,null))[_0xa235('0x41')](handleError(_0x436f21,null));};exports[_0xa235('0x46')]=function(_0x2aef7d,_0x2f9868){return db[_0xa235('0x27')]['create'](_0x2aef7d['body'],{})['then'](respondWithResult(_0x2f9868,0xc9))[_0xa235('0x41')](handleError(_0x2f9868,null));};exports[_0xa235('0x1f')]=function(_0x955c32,_0xba295e){if(_0x955c32[_0xa235('0x47')]['id']){delete _0x955c32[_0xa235('0x47')]['id'];}return db[_0xa235('0x27')][_0xa235('0x45')]({'where':{'id':_0x955c32[_0xa235('0x43')]['id']}})['then'](handleEntityNotFound(_0xba295e,null))[_0xa235('0x20')](saveUpdates(_0x955c32[_0xa235('0x47')],null))[_0xa235('0x20')](respondWithResult(_0xba295e,null))[_0xa235('0x41')](handleError(_0xba295e,null));};exports['destroy']=function(_0x2264f8,_0x280589){return db['IntegrationReport']['find']({'where':{'id':_0x2264f8[_0xa235('0x43')]['id']}})['then'](handleEntityNotFound(_0x280589,null))[_0xa235('0x20')](removeEntity(_0x280589,null))[_0xa235('0x41')](handleError(_0x280589,null));};exports[_0xa235('0x48')]=function(_0x526033,_0x3c3549){return db[_0xa235('0x27')][_0xa235('0x48')]()[_0xa235('0x20')](respondWithResult(_0x3c3549,null))['catch'](handleError(_0x3c3549,null));};
\ No newline at end of file
+var _0x26ca=['order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','json','apply','reject','save','update','then','error','name','index','map','IntegrationReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x5aaa73,_0x596de8){var _0x330ec4=function(_0x522643){while(--_0x522643){_0x5aaa73['push'](_0x5aaa73['shift']());}};_0x330ec4(++_0x596de8);}(_0x26ca,0x9c));var _0xa26c=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x26ca[_0x5a95fa];return _0x1a61b8;};'use strict';var emlformat=require(_0xa26c('0x0'));var rimraf=require(_0xa26c('0x1'));var zipdir=require(_0xa26c('0x2'));var jsonpatch=require(_0xa26c('0x3'));var rp=require(_0xa26c('0x4'));var moment=require('moment');var BPromise=require(_0xa26c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa26c('0x6'));var sox=require(_0xa26c('0x7'));var csv=require('to-csv');var ejs=require(_0xa26c('0x8'));var fs=require('fs');var fs_extra=require(_0xa26c('0x9'));var _=require(_0xa26c('0xa'));var squel=require('squel');var crypto=require(_0xa26c('0xb'));var jsforce=require(_0xa26c('0xc'));var deskjs=require(_0xa26c('0xd'));var toCsv=require(_0xa26c('0xe'));var querystring=require(_0xa26c('0xf'));var Papa=require(_0xa26c('0x10'));var Redis=require('ioredis');var authService=require(_0xa26c('0x11'));var qs=require(_0xa26c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa26c('0x13'));var utils=require(_0xa26c('0x14'));var config=require(_0xa26c('0x15'));var licenseUtil=require(_0xa26c('0x16'));var db=require(_0xa26c('0x17'))['db'];function respondWithStatusCode(_0x4a2379,_0x4039ab){_0x4039ab=_0x4039ab||0xcc;return function(_0x98b477){if(_0x98b477){return _0x4a2379[_0xa26c('0x18')](_0x4039ab);}return _0x4a2379[_0xa26c('0x19')](_0x4039ab)[_0xa26c('0x1a')]();};}function respondWithResult(_0x4b3bd4,_0x5d8e2e){_0x5d8e2e=_0x5d8e2e||0xc8;return function(_0x537454){if(_0x537454){return _0x4b3bd4['status'](_0x5d8e2e)['json'](_0x537454);}};}function respondWithFilteredResult(_0x398115,_0x3ea761){return function(_0x45130c){if(_0x45130c){var _0x3f6d35=typeof _0x3ea761['offset']==='undefined'&&typeof _0x3ea761[_0xa26c('0x1b')]==='undefined';var _0x355890=_0x45130c[_0xa26c('0x1c')];var _0x2e8ea6=_0x3f6d35?0x0:_0x3ea761[_0xa26c('0x1d')];var _0x55bbd9=_0x3f6d35?_0x45130c[_0xa26c('0x1c')]:_0x3ea761[_0xa26c('0x1d')]+_0x3ea761['limit'];var _0xb18950;if(_0x55bbd9>=_0x355890){_0x55bbd9=_0x355890;_0xb18950=0xc8;}else{_0xb18950=0xce;}_0x398115[_0xa26c('0x19')](_0xb18950);return _0x398115['set']('Content-Range',_0x2e8ea6+'-'+_0x55bbd9+'/'+_0x355890)[_0xa26c('0x1e')](_0x45130c);}return null;};}function patchUpdates(_0x28fb00){return function(_0x5a6e16){try{jsonpatch[_0xa26c('0x1f')](_0x5a6e16,_0x28fb00,!![]);}catch(_0x48f99b){return BPromise[_0xa26c('0x20')](_0x48f99b);}return _0x5a6e16[_0xa26c('0x21')]();};}function saveUpdates(_0x2719ab,_0x4b5a25){return function(_0x3cc955){if(_0x3cc955){return _0x3cc955[_0xa26c('0x22')](_0x2719ab)[_0xa26c('0x23')](function(_0x20614e){return _0x20614e;});}return null;};}function removeEntity(_0x1d2f1f,_0x3c2840){return function(_0x18a341){if(_0x18a341){return _0x18a341['destroy']()[_0xa26c('0x23')](function(){_0x1d2f1f[_0xa26c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b1ef5,_0x1b65a5){return function(_0x5868a4){if(!_0x5868a4){_0x1b1ef5[_0xa26c('0x18')](0x194);}return _0x5868a4;};}function handleError(_0x16be1f,_0x1a1ec9){_0x1a1ec9=_0x1a1ec9||0x1f4;return function(_0x28b29d){logger[_0xa26c('0x24')](_0x28b29d['stack']);if(_0x28b29d['name']){delete _0x28b29d[_0xa26c('0x25')];}_0x16be1f[_0xa26c('0x19')](_0x1a1ec9)['send'](_0x28b29d);};}exports[_0xa26c('0x26')]=function(_0x4ac109,_0xfe2036){var _0x388730={},_0x57daef={},_0xb1cd45={'count':0x0,'rows':[]};var _0x25cda1=_[_0xa26c('0x27')](db[_0xa26c('0x28')][_0xa26c('0x29')],function(_0x382a56){return{'name':_0x382a56['fieldName'],'type':_0x382a56['type'][_0xa26c('0x2a')]};});_0x57daef[_0xa26c('0x2b')]=_[_0xa26c('0x27')](_0x25cda1,_0xa26c('0x25'));_0x57daef[_0xa26c('0x2c')]=_[_0xa26c('0x2d')](_0x4ac109['query']);_0x57daef[_0xa26c('0x2e')]=_[_0xa26c('0x2f')](_0x57daef[_0xa26c('0x2b')],_0x57daef['query']);_0x388730[_0xa26c('0x30')]=_[_0xa26c('0x2f')](_0x57daef[_0xa26c('0x2b')],qs['fields'](_0x4ac109[_0xa26c('0x2c')][_0xa26c('0x31')]));_0x388730['attributes']=_0x388730[_0xa26c('0x30')][_0xa26c('0x32')]?_0x388730['attributes']:_0x57daef['model'];if(!_0x4ac109[_0xa26c('0x2c')]['hasOwnProperty']('nolimit')){_0x388730[_0xa26c('0x1b')]=qs[_0xa26c('0x1b')](_0x4ac109['query'][_0xa26c('0x1b')]);_0x388730[_0xa26c('0x1d')]=qs['offset'](_0x4ac109[_0xa26c('0x2c')]['offset']);}_0x388730[_0xa26c('0x33')]=qs['sort'](_0x4ac109['query']['sort']);_0x388730[_0xa26c('0x34')]=qs[_0xa26c('0x2e')](_[_0xa26c('0x35')](_0x4ac109['query'],_0x57daef[_0xa26c('0x2e')]),_0x25cda1);if(_0x4ac109[_0xa26c('0x2c')][_0xa26c('0x36')]){_0x388730['where']=_[_0xa26c('0x37')](_0x388730['where'],{'$or':_[_0xa26c('0x27')](_0x25cda1,function(_0x4fd768){if(_0x4fd768[_0xa26c('0x38')]!==_0xa26c('0x39')){var _0x169cf7={};_0x169cf7[_0x4fd768[_0xa26c('0x25')]]={'$like':'%'+_0x4ac109[_0xa26c('0x2c')][_0xa26c('0x36')]+'%'};return _0x169cf7;}})});}_0x388730=_[_0xa26c('0x37')]({},_0x388730,_0x4ac109[_0xa26c('0x3a')]);var _0x164ced={'where':_0x388730[_0xa26c('0x34')]};return db[_0xa26c('0x28')]['count'](_0x164ced)[_0xa26c('0x23')](function(_0x1195fb){_0xb1cd45[_0xa26c('0x1c')]=_0x1195fb;if(_0x4ac109['query'][_0xa26c('0x3b')]){_0x388730['include']=[{'all':!![]}];}return db[_0xa26c('0x28')][_0xa26c('0x3c')](_0x388730);})[_0xa26c('0x23')](function(_0x4a1b9b){_0xb1cd45[_0xa26c('0x3d')]=_0x4a1b9b;return _0xb1cd45;})['then'](respondWithFilteredResult(_0xfe2036,_0x388730))[_0xa26c('0x3e')](handleError(_0xfe2036,null));};exports[_0xa26c('0x3f')]=function(_0xf33aca,_0x451721){var _0x105020={'raw':![],'where':{'id':_0xf33aca[_0xa26c('0x40')]['id']}},_0x731b42={};_0x731b42['model']=_['keys'](db[_0xa26c('0x28')][_0xa26c('0x29')]);_0x731b42[_0xa26c('0x2c')]=_[_0xa26c('0x2d')](_0xf33aca[_0xa26c('0x2c')]);_0x731b42[_0xa26c('0x2e')]=_[_0xa26c('0x2f')](_0x731b42[_0xa26c('0x2b')],_0x731b42[_0xa26c('0x2c')]);_0x105020[_0xa26c('0x30')]=_[_0xa26c('0x2f')](_0x731b42[_0xa26c('0x2b')],qs['fields'](_0xf33aca[_0xa26c('0x2c')][_0xa26c('0x31')]));_0x105020[_0xa26c('0x30')]=_0x105020[_0xa26c('0x30')][_0xa26c('0x32')]?_0x105020[_0xa26c('0x30')]:_0x731b42[_0xa26c('0x2b')];if(_0xf33aca['query'][_0xa26c('0x3b')]){_0x105020['include']=[{'all':!![]}];}_0x105020=_[_0xa26c('0x37')]({},_0x105020,_0xf33aca[_0xa26c('0x3a')]);return db[_0xa26c('0x28')]['find'](_0x105020)[_0xa26c('0x23')](handleEntityNotFound(_0x451721,null))[_0xa26c('0x23')](respondWithResult(_0x451721,null))['catch'](handleError(_0x451721,null));};exports['create']=function(_0x493ff5,_0x164fa6){return db['IntegrationReport'][_0xa26c('0x41')](_0x493ff5[_0xa26c('0x42')],{})[_0xa26c('0x23')](respondWithResult(_0x164fa6,0xc9))['catch'](handleError(_0x164fa6,null));};exports[_0xa26c('0x22')]=function(_0x49adc8,_0x546d3e){if(_0x49adc8[_0xa26c('0x42')]['id']){delete _0x49adc8[_0xa26c('0x42')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x49adc8[_0xa26c('0x40')]['id']}})[_0xa26c('0x23')](handleEntityNotFound(_0x546d3e,null))['then'](saveUpdates(_0x49adc8['body'],null))[_0xa26c('0x23')](respondWithResult(_0x546d3e,null))[_0xa26c('0x3e')](handleError(_0x546d3e,null));};exports[_0xa26c('0x43')]=function(_0x4efd3f,_0x10c017){return db[_0xa26c('0x28')][_0xa26c('0x44')]({'where':{'id':_0x4efd3f[_0xa26c('0x40')]['id']}})['then'](handleEntityNotFound(_0x10c017,null))[_0xa26c('0x23')](removeEntity(_0x10c017,null))[_0xa26c('0x3e')](handleError(_0x10c017,null));};exports['describe']=function(_0x5dd727,_0x50ebae){return db['IntegrationReport']['describe']()[_0xa26c('0x23')](respondWithResult(_0x50ebae,null))['catch'](handleError(_0x50ebae,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ea4=['./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','api','moment','request-promise','path'];(function(_0x6182bc,_0x1d3f99){var _0x4e1952=function(_0x9b78ac){while(--_0x9b78ac){_0x6182bc['push'](_0x6182bc['shift']());}};_0x4e1952(++_0x1d3f99);}(_0x5ea4,0x86));var _0x45ea=function(_0x1d0088,_0xd875e9){_0x1d0088=_0x1d0088-0x0;var _0x14a99f=_0x5ea4[_0x1d0088];return _0x14a99f;};'use strict';var _=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var logger=require('../../config/logger')(_0x45ea('0x2'));var moment=require(_0x45ea('0x3'));var BPromise=require('bluebird');var rp=require(_0x45ea('0x4'));var fs=require('fs');var path=require(_0x45ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x45ea('0x6'));module['exports']=function(_0x140faf,_0x5b3d43){return _0x140faf[_0x45ea('0x7')](_0x45ea('0x8'),attributes,{'tableName':_0x45ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x861c=['../../config/logger','api','moment','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x861c,0x76));var _0xc861=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x861c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc861('0x5'));var rimraf=require(_0xc861('0x6'));var config=require(_0xc861('0x7'));var attributes=require(_0xc861('0x8'));module[_0xc861('0x9')]=function(_0xd5b27c,_0x5e56f6){return _0xd5b27c[_0xc861('0xa')]('IntegrationReport',attributes,{'tableName':_0xc861('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x225074,_0x1abb16){_0x225074=_0x225074-0x0;var _0x3fb50c=_0x3f8a[_0x225074];return _0x3fb50c;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf845cc,_0x7bce78){var _0x24da94=function(_0x21c590){while(--_0x21c590){_0xf845cc['push'](_0xf845cc['shift']());}};_0x24da94(++_0x7bce78);}(_0x5fab,0x177));var _0xb5fa=function(_0x546f24,_0x485e39){_0x546f24=_0x546f24-0x0;var _0x6c3dac=_0x5fab[_0x546f24];return _0x6c3dac;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd943=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','create','post','/:id/sub_intervals/create_many','update','delete','/:id','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd943,0x14a));var _0x3d94=function(_0xd11bfe,_0xc8df63){_0xd11bfe=_0xd11bfe-0x0;var _0x4d7ab8=_0xd943[_0xd11bfe];return _0x4d7ab8;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require(_0x3d94('0x4'));var router=express[_0x3d94('0x5')]();var fs_extra=require(_0x3d94('0x6'));var auth=require(_0x3d94('0x7'));var interaction=require(_0x3d94('0x8'));var config=require(_0x3d94('0x9'));var controller=require(_0x3d94('0xa'));router[_0x3d94('0xb')]('/',auth[_0x3d94('0xc')](),controller[_0x3d94('0xd')]);router[_0x3d94('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x3d94('0xe'),auth[_0x3d94('0xc')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x3d94('0xf')]);router['post']('/:id/sub_intervals',auth[_0x3d94('0xc')](),controller['addInterval']);router[_0x3d94('0x10')](_0x3d94('0x11'),auth[_0x3d94('0xc')](),controller['addIntervals']);router['put']('/:id',auth[_0x3d94('0xc')](),controller[_0x3d94('0x12')]);router[_0x3d94('0x13')](_0x3d94('0x14'),auth['isAuthenticated'](),controller[_0x3d94('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xd4f0=['delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update'];(function(_0x44efc3,_0x522c42){var _0x184aa2=function(_0x2f932c){while(--_0x2f932c){_0x44efc3['push'](_0x44efc3['shift']());}};_0x184aa2(++_0x522c42);}(_0xd4f0,0x122));var _0x0d4f=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xd4f0[_0x4e4519];return _0x340044;};'use strict';var multer=require(_0x0d4f('0x0'));var util=require(_0x0d4f('0x1'));var path=require(_0x0d4f('0x2'));var timeout=require(_0x0d4f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0d4f('0x4'));var interaction=require(_0x0d4f('0x5'));var config=require(_0x0d4f('0x6'));var controller=require(_0x0d4f('0x7'));router[_0x0d4f('0x8')]('/',auth[_0x0d4f('0x9')](),controller[_0x0d4f('0xa')]);router[_0x0d4f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0d4f('0xb')]);router['get']('/:id/sub_intervals',auth[_0x0d4f('0x9')](),controller[_0x0d4f('0xc')]);router[_0x0d4f('0xd')]('/',auth[_0x0d4f('0x9')](),controller[_0x0d4f('0xe')]);router[_0x0d4f('0xd')](_0x0d4f('0xf'),auth[_0x0d4f('0x9')](),controller[_0x0d4f('0x10')]);router[_0x0d4f('0xd')](_0x0d4f('0x11'),auth['isAuthenticated'](),controller[_0x0d4f('0x12')]);router[_0x0d4f('0x13')](_0x0d4f('0x14'),auth['isAuthenticated'](),controller[_0x0d4f('0x15')]);router[_0x0d4f('0x16')](_0x0d4f('0x14'),auth[_0x0d4f('0x9')](),controller[_0x0d4f('0x17')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaab6=['sequelize','STRING'];(function(_0x4e32d1,_0x14b293){var _0x1821cc=function(_0x114ae7){while(--_0x114ae7){_0x4e32d1['push'](_0x4e32d1['shift']());}};_0x1821cc(++_0x14b293);}(_0xaab6,0x12c));var _0x6aab=function(_0x1999ca,_0x2951ea){_0x1999ca=_0x1999ca-0x0;var _0xfcfdf6=_0xaab6[_0x1999ca];return _0xfcfdf6;};'use strict';var Sequelize=require(_0x6aab('0x0'));module['exports']={'name':{'type':Sequelize[_0x6aab('0x1')]},'description':{'type':Sequelize[_0x6aab('0x1')]},'interval':{'type':Sequelize[_0x6aab('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x2f47=['exports','STRING','sequelize'];(function(_0x10e840,_0x5b3935){var _0x405caa=function(_0x46b707){while(--_0x46b707){_0x10e840['push'](_0x10e840['shift']());}};_0x405caa(++_0x5b3935);}(_0x2f47,0x1dc));var _0x72f4=function(_0x2fbcc9,_0x1938dc){_0x2fbcc9=_0x2fbcc9-0x0;var _0x2f0d14=_0x2f47[_0x2fbcc9];return _0x2f0d14;};'use strict';var Sequelize=require(_0x72f4('0x0'));module[_0x72f4('0x1')]={'name':{'type':Sequelize[_0x72f4('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x72f4('0x2')],'allowNull':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9307=['rows','show','params','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','body','addInterval','getIntervals','hasOwnProperty','addIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','options','includeAll','include'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9307,0x69));var _0x7930=function(_0x716390,_0x3e5026){_0x716390=_0x716390-0x0;var _0x2619e0=_0x9307[_0x716390];return _0x2619e0;};'use strict';var emlformat=require(_0x7930('0x0'));var rimraf=require(_0x7930('0x1'));var zipdir=require(_0x7930('0x2'));var jsonpatch=require(_0x7930('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7930('0x4'));var Mustache=require(_0x7930('0x5'));var util=require(_0x7930('0x6'));var path=require('path');var sox=require(_0x7930('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7930('0x8'));var squel=require('squel');var crypto=require(_0x7930('0x9'));var jsforce=require(_0x7930('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7930('0xb'));var Papa=require(_0x7930('0xc'));var Redis=require(_0x7930('0xd'));var authService=require(_0x7930('0xe'));var qs=require(_0x7930('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7930('0x10'));var logger=require('../../config/logger')(_0x7930('0x11'));var utils=require(_0x7930('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7930('0x13'));var db=require('../../mysqldb')['db'];var extensions=require(_0x7930('0x14'));function respondWithStatusCode(_0x443604,_0x931cec){_0x931cec=_0x931cec||0xcc;return function(_0x2283d9){if(_0x2283d9){return _0x443604[_0x7930('0x15')](_0x931cec);}return _0x443604[_0x7930('0x16')](_0x931cec)[_0x7930('0x17')]();};}function respondWithResult(_0x151096,_0x281f9a){_0x281f9a=_0x281f9a||0xc8;return function(_0x55ad98){if(_0x55ad98){return _0x151096[_0x7930('0x16')](_0x281f9a)['json'](_0x55ad98);}};}function respondWithFilteredResult(_0x80d5c8,_0x1262d7){return function(_0x2e6acf){if(_0x2e6acf){var _0x5e6916=typeof _0x1262d7[_0x7930('0x18')]===_0x7930('0x19')&&typeof _0x1262d7[_0x7930('0x1a')]===_0x7930('0x19');var _0x475198=_0x2e6acf[_0x7930('0x1b')];var _0x41bc98=_0x5e6916?0x0:_0x1262d7['offset'];var _0x49c6c5=_0x5e6916?_0x2e6acf['count']:_0x1262d7[_0x7930('0x18')]+_0x1262d7['limit'];var _0x44ebaa;if(_0x49c6c5>=_0x475198){_0x49c6c5=_0x475198;_0x44ebaa=0xc8;}else{_0x44ebaa=0xce;}_0x80d5c8['status'](_0x44ebaa);return _0x80d5c8[_0x7930('0x1c')]('Content-Range',_0x41bc98+'-'+_0x49c6c5+'/'+_0x475198)[_0x7930('0x1d')](_0x2e6acf);}return null;};}function patchUpdates(_0x131e5a){return function(_0x2e69ea){try{jsonpatch[_0x7930('0x1e')](_0x2e69ea,_0x131e5a,!![]);}catch(_0xfc9b4f){return BPromise[_0x7930('0x1f')](_0xfc9b4f);}return _0x2e69ea[_0x7930('0x20')]();};}function saveUpdates(_0x4c4301,_0x11d71f){return function(_0x4b3fa0){if(_0x4b3fa0){return _0x4b3fa0[_0x7930('0x21')](_0x4c4301)[_0x7930('0x22')](function(_0x23dea6){return _0x23dea6;});}return null;};}function removeEntity(_0x46053a,_0x180e36){return function(_0x21a6be){if(_0x21a6be){return _0x21a6be[_0x7930('0x23')]()[_0x7930('0x22')](function(){var _0x58245c=_0x21a6be['get']({'plain':!![]});var _0x467a7d=_0x7930('0x24');return db[_0x7930('0x25')][_0x7930('0x23')]({'where':{'type':_0x467a7d,'resourceId':_0x58245c['id']}})[_0x7930('0x22')](function(){return _0x21a6be;});})[_0x7930('0x22')](function(){_0x46053a[_0x7930('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ea83,_0x123b8b){return function(_0x23a975){if(!_0x23a975){_0x38ea83[_0x7930('0x15')](0x194);}return _0x23a975;};}function handleError(_0x326a60,_0x54adf0){_0x54adf0=_0x54adf0||0x1f4;return function(_0x222863){logger[_0x7930('0x26')](_0x222863[_0x7930('0x27')]);if(_0x222863[_0x7930('0x28')]){delete _0x222863[_0x7930('0x28')];}_0x326a60[_0x7930('0x16')](_0x54adf0)['send'](_0x222863);};}exports[_0x7930('0x29')]=function(_0x1b8817,_0x2065af){var _0x2a440c={},_0x21d8a6={},_0x24b4f6={'count':0x0,'rows':[]};var _0x5cf375=_[_0x7930('0x2a')](db[_0x7930('0x2b')][_0x7930('0x2c')],function(_0x4b44a9){return{'name':_0x4b44a9[_0x7930('0x2d')],'type':_0x4b44a9[_0x7930('0x2e')][_0x7930('0x2f')]};});_0x21d8a6[_0x7930('0x30')]=_['map'](_0x5cf375,_0x7930('0x28'));_0x21d8a6['query']=_[_0x7930('0x31')](_0x1b8817[_0x7930('0x32')]);_0x21d8a6[_0x7930('0x33')]=_[_0x7930('0x34')](_0x21d8a6[_0x7930('0x30')],_0x21d8a6[_0x7930('0x32')]);_0x2a440c['attributes']=_[_0x7930('0x34')](_0x21d8a6[_0x7930('0x30')],qs['fields'](_0x1b8817[_0x7930('0x32')][_0x7930('0x35')]));_0x2a440c[_0x7930('0x36')]=_0x2a440c[_0x7930('0x36')][_0x7930('0x37')]?_0x2a440c[_0x7930('0x36')]:_0x21d8a6[_0x7930('0x30')];if(!_0x1b8817[_0x7930('0x32')]['hasOwnProperty'](_0x7930('0x38'))){_0x2a440c[_0x7930('0x1a')]=qs[_0x7930('0x1a')](_0x1b8817[_0x7930('0x32')][_0x7930('0x1a')]);_0x2a440c[_0x7930('0x18')]=qs[_0x7930('0x18')](_0x1b8817['query'][_0x7930('0x18')]);}_0x2a440c['order']=qs[_0x7930('0x39')](_0x1b8817[_0x7930('0x32')][_0x7930('0x39')]);_0x2a440c['where']=qs[_0x7930('0x33')](_[_0x7930('0x3a')](_0x1b8817[_0x7930('0x32')],_0x21d8a6[_0x7930('0x33')]),_0x5cf375);if(_0x1b8817['query'][_0x7930('0x3b')]){_0x2a440c[_0x7930('0x3c')]=_[_0x7930('0x3d')](_0x2a440c[_0x7930('0x3c')],{'$or':_[_0x7930('0x2a')](_0x5cf375,function(_0xfe66eb){if(_0xfe66eb[_0x7930('0x2e')]!=='VIRTUAL'){var _0x21a515={};_0x21a515[_0xfe66eb[_0x7930('0x28')]]={'$like':'%'+_0x1b8817[_0x7930('0x32')]['filter']+'%'};return _0x21a515;}})});}_0x2a440c=_[_0x7930('0x3d')]({},_0x2a440c,_0x1b8817[_0x7930('0x3e')]);var _0x13726f={'where':_0x2a440c[_0x7930('0x3c')]};return db['Interval'][_0x7930('0x1b')](_0x13726f)[_0x7930('0x22')](function(_0x24ce14){_0x24b4f6[_0x7930('0x1b')]=_0x24ce14;if(_0x1b8817[_0x7930('0x32')][_0x7930('0x3f')]){_0x2a440c[_0x7930('0x40')]=[{'all':!![]}];}return db[_0x7930('0x2b')]['findAll'](_0x2a440c);})[_0x7930('0x22')](function(_0x34a5d9){_0x24b4f6[_0x7930('0x41')]=_0x34a5d9;return _0x24b4f6;})[_0x7930('0x22')](respondWithFilteredResult(_0x2065af,_0x2a440c))['catch'](handleError(_0x2065af,null));};exports[_0x7930('0x42')]=function(_0x45c687,_0x1c0000){var _0x142628={'raw':!![],'where':{'id':_0x45c687[_0x7930('0x43')]['id']}},_0x718c4a={};_0x718c4a[_0x7930('0x30')]=_[_0x7930('0x31')](db[_0x7930('0x2b')][_0x7930('0x2c')]);_0x718c4a[_0x7930('0x32')]=_[_0x7930('0x31')](_0x45c687[_0x7930('0x32')]);_0x718c4a[_0x7930('0x33')]=_[_0x7930('0x34')](_0x718c4a['model'],_0x718c4a[_0x7930('0x32')]);_0x142628[_0x7930('0x36')]=_['intersection'](_0x718c4a[_0x7930('0x30')],qs[_0x7930('0x35')](_0x45c687['query']['fields']));_0x142628[_0x7930('0x36')]=_0x142628[_0x7930('0x36')][_0x7930('0x37')]?_0x142628['attributes']:_0x718c4a[_0x7930('0x30')];if(_0x45c687['query'][_0x7930('0x3f')]){_0x142628[_0x7930('0x40')]=[{'all':!![]}];}_0x142628=_[_0x7930('0x3d')]({},_0x142628,_0x45c687['options']);return db['Interval']['find'](_0x142628)[_0x7930('0x22')](handleEntityNotFound(_0x1c0000,null))[_0x7930('0x22')](respondWithResult(_0x1c0000,null))[_0x7930('0x44')](handleError(_0x1c0000,null));};exports[_0x7930('0x45')]=function(_0x466323,_0x5e838e){return db['Interval']['create'](_0x466323['body'],{})[_0x7930('0x22')](function(_0x83e11f){var _0x1af61c=_0x466323[_0x7930('0x46')][_0x7930('0x47')]({'plain':!![]});if(!_0x1af61c)throw new Error(_0x7930('0x48'));if(_0x1af61c['role']===_0x7930('0x46')){var _0x3904ec=_0x83e11f[_0x7930('0x47')]({'plain':!![]});var _0x5c399b=_0x7930('0x24');return db['UserProfileSection'][_0x7930('0x49')]({'where':{'name':_0x5c399b,'userProfileId':_0x1af61c['userProfileId']},'raw':!![]})[_0x7930('0x22')](function(_0x42327a){if(_0x42327a&&_0x42327a[_0x7930('0x4a')]===0x0){return db[_0x7930('0x25')][_0x7930('0x45')]({'name':_0x3904ec['name'],'resourceId':_0x3904ec['id'],'type':_0x42327a[_0x7930('0x28')],'sectionId':_0x42327a['id']},{})['then'](function(){return _0x83e11f;});}else{return _0x83e11f;}})[_0x7930('0x44')](function(_0x53131d){logger[_0x7930('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53131d);throw _0x53131d;});}return _0x83e11f;})[_0x7930('0x22')](respondWithResult(_0x5e838e,0xc9))[_0x7930('0x44')](handleError(_0x5e838e,null));};exports[_0x7930('0x21')]=function(_0x44e9e7,_0x257051){if(_0x44e9e7[_0x7930('0x4b')]['id']){delete _0x44e9e7[_0x7930('0x4b')]['id'];}return db[_0x7930('0x2b')][_0x7930('0x49')]({'where':{'id':_0x44e9e7[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x257051,null))[_0x7930('0x22')](saveUpdates(_0x44e9e7['body'],null))[_0x7930('0x22')](respondWithResult(_0x257051,null))[_0x7930('0x44')](handleError(_0x257051,null));};exports['destroy']=function(_0x229c9b,_0x252b49){return db[_0x7930('0x2b')]['find']({'where':{'id':_0x229c9b[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x252b49,null))['then'](removeEntity(_0x252b49,null))[_0x7930('0x44')](handleError(_0x252b49,null));};exports[_0x7930('0x4c')]=function(_0x1c47a9,_0x464ec0,_0x1e3fd5){if(_0x1c47a9[_0x7930('0x4b')]['id']){delete _0x1c47a9['body']['id'];}return db[_0x7930('0x2b')][_0x7930('0x49')]({'where':{'id':_0x1c47a9[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x464ec0,null))[_0x7930('0x22')](function(_0x425a10){if(_0x425a10){_0x1c47a9[_0x7930('0x4b')]['IntervalId']=_0x425a10['id'];return db[_0x7930('0x2b')][_0x7930('0x45')](_0x1c47a9[_0x7930('0x4b')]);}})[_0x7930('0x22')](respondWithResult(_0x464ec0,null))['catch'](handleError(_0x464ec0,null));};exports[_0x7930('0x4d')]=function(_0xf23c10,_0x33fac9,_0xa61c5b){var _0x3a8c98={};var _0x324183={};var _0x9dc06d;var _0x336fd1;return db[_0x7930('0x2b')]['findOne']({'where':{'id':_0xf23c10[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x33fac9,null))[_0x7930('0x22')](function(_0x5e5285){if(_0x5e5285){_0x9dc06d=_0x5e5285;_0x324183['model']=_[_0x7930('0x31')](db[_0x7930('0x2b')][_0x7930('0x2c')]);_0x324183['query']=_[_0x7930('0x31')](_0xf23c10['query']);_0x324183[_0x7930('0x33')]=_[_0x7930('0x34')](_0x324183[_0x7930('0x30')],_0x324183[_0x7930('0x32')]);_0x3a8c98['attributes']=_[_0x7930('0x34')](_0x324183[_0x7930('0x30')],qs[_0x7930('0x35')](_0xf23c10[_0x7930('0x32')][_0x7930('0x35')]));_0x3a8c98[_0x7930('0x36')]=_0x3a8c98[_0x7930('0x36')][_0x7930('0x37')]?_0x3a8c98['attributes']:_0x324183['model'];_0x3a8c98['order']=qs[_0x7930('0x39')](_0xf23c10[_0x7930('0x32')]['sort']);_0x3a8c98[_0x7930('0x3c')]=qs['filters'](_[_0x7930('0x3a')](_0xf23c10[_0x7930('0x32')],_0x324183[_0x7930('0x33')]));if(_0xf23c10[_0x7930('0x32')][_0x7930('0x3b')]){_0x3a8c98['where']=_[_0x7930('0x3d')](_0x3a8c98['where'],{'$or':_[_0x7930('0x2a')](_0x3a8c98['attributes'],function(_0x9af7ea){var _0x2da5e0={};_0x2da5e0[_0x9af7ea]={'$like':'%'+_0xf23c10[_0x7930('0x32')][_0x7930('0x3b')]+'%'};return _0x2da5e0;})});}_0x3a8c98=_['merge']({},_0x3a8c98,_0xf23c10['options']);return _0x9dc06d['getIntervals'](_0x3a8c98);}})[_0x7930('0x22')](function(_0x3577b9){if(_0x3577b9){_0x336fd1=_0x3577b9['length'];if(!_0xf23c10[_0x7930('0x32')][_0x7930('0x4e')](_0x7930('0x38'))){_0x3a8c98[_0x7930('0x1a')]=qs[_0x7930('0x1a')](_0xf23c10[_0x7930('0x32')][_0x7930('0x1a')]);_0x3a8c98['offset']=qs['offset'](_0xf23c10[_0x7930('0x32')][_0x7930('0x18')]);}return _0x9dc06d[_0x7930('0x4d')](_0x3a8c98);}})[_0x7930('0x22')](function(_0xa45411){if(_0xa45411){return _0xa45411?{'count':_0x336fd1,'rows':_0xa45411}:null;}})[_0x7930('0x22')](respondWithResult(_0x33fac9,null))[_0x7930('0x44')](handleError(_0x33fac9,null));};exports[_0x7930('0x4f')]=function(_0x11ad58,_0x236573,_0x52d240){return db[_0x7930('0x2b')][_0x7930('0x50')]({'where':{'id':_0x11ad58[_0x7930('0x43')]['id']}})[_0x7930('0x22')](handleEntityNotFound(_0x236573,null))[_0x7930('0x22')](function(_0x4f4057){if(_0x4f4057){return db[_0x7930('0x51')][_0x7930('0x52')](function(_0x10c46f){return db['Interval']['destroy']({'where':{'IntervalId':_0x11ad58[_0x7930('0x43')]['id']},'transaction':_0x10c46f})['then'](function(_0x3496aa){var _0x46bb0b=_['map'](_0x11ad58[_0x7930('0x4b')],function(_0x53898c){delete _0x53898c['id'];_0x53898c[_0x7930('0x53')]=_0x11ad58[_0x7930('0x43')]['id'];return _0x53898c;});return db[_0x7930('0x2b')][_0x7930('0x54')](_0x46bb0b,{'transaction':_0x10c46f});});})[_0x7930('0x22')](function(){return db[_0x7930('0x2b')]['findAll']({'where':{'IntervalId':_0x11ad58['params']['id']}});});}})['then'](respondWithResult(_0x236573,null))[_0x7930('0x44')](handleError(_0x236573,null));};
\ No newline at end of file
+var _0x2eb3=['name','index','Interval','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','catch','show','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','findOne','pick','options','nolimit','sequelize','transaction','IntervalId','bulkCreate','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2eb3,0x143));var _0x32eb=function(_0x1b418b,_0x3d06a9){_0x1b418b=_0x1b418b-0x0;var _0x41e2db=_0x2eb3[_0x1b418b];return _0x41e2db;};'use strict';var emlformat=require(_0x32eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32eb('0x1'));var jsonpatch=require(_0x32eb('0x2'));var rp=require('request-promise');var moment=require(_0x32eb('0x3'));var BPromise=require(_0x32eb('0x4'));var Mustache=require(_0x32eb('0x5'));var util=require(_0x32eb('0x6'));var path=require(_0x32eb('0x7'));var sox=require(_0x32eb('0x8'));var csv=require(_0x32eb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32eb('0xa'));var _=require(_0x32eb('0xb'));var squel=require('squel');var crypto=require(_0x32eb('0xc'));var jsforce=require(_0x32eb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x32eb('0xe'));var Papa=require('papaparse');var Redis=require(_0x32eb('0xf'));var authService=require(_0x32eb('0x10'));var qs=require(_0x32eb('0x11'));var as=require(_0x32eb('0x12'));var hardwareService=require(_0x32eb('0x13'));var logger=require('../../config/logger')(_0x32eb('0x14'));var utils=require(_0x32eb('0x15'));var config=require(_0x32eb('0x16'));var licenseUtil=require(_0x32eb('0x17'));var db=require(_0x32eb('0x18'))['db'];var extensions=require(_0x32eb('0x19'));function respondWithStatusCode(_0x13a2a0,_0x5a69f7){_0x5a69f7=_0x5a69f7||0xcc;return function(_0x568614){if(_0x568614){return _0x13a2a0[_0x32eb('0x1a')](_0x5a69f7);}return _0x13a2a0[_0x32eb('0x1b')](_0x5a69f7)[_0x32eb('0x1c')]();};}function respondWithResult(_0x4d6ddf,_0x310cd2){_0x310cd2=_0x310cd2||0xc8;return function(_0x54c309){if(_0x54c309){return _0x4d6ddf[_0x32eb('0x1b')](_0x310cd2)[_0x32eb('0x1d')](_0x54c309);}};}function respondWithFilteredResult(_0x108b8f,_0x130ef5){return function(_0x408a52){if(_0x408a52){var _0x4a4e38=typeof _0x130ef5[_0x32eb('0x1e')]===_0x32eb('0x1f')&&typeof _0x130ef5['limit']==='undefined';var _0x86dce4=_0x408a52['count'];var _0xcf0659=_0x4a4e38?0x0:_0x130ef5[_0x32eb('0x1e')];var _0x2c2482=_0x4a4e38?_0x408a52[_0x32eb('0x20')]:_0x130ef5[_0x32eb('0x1e')]+_0x130ef5[_0x32eb('0x21')];var _0x35cee8;if(_0x2c2482>=_0x86dce4){_0x2c2482=_0x86dce4;_0x35cee8=0xc8;}else{_0x35cee8=0xce;}_0x108b8f[_0x32eb('0x1b')](_0x35cee8);return _0x108b8f['set'](_0x32eb('0x22'),_0xcf0659+'-'+_0x2c2482+'/'+_0x86dce4)[_0x32eb('0x1d')](_0x408a52);}return null;};}function patchUpdates(_0x475889){return function(_0x51ebac){try{jsonpatch[_0x32eb('0x23')](_0x51ebac,_0x475889,!![]);}catch(_0x2e8cf5){return BPromise[_0x32eb('0x24')](_0x2e8cf5);}return _0x51ebac[_0x32eb('0x25')]();};}function saveUpdates(_0x12cb47,_0x4a6bf2){return function(_0x580935){if(_0x580935){return _0x580935[_0x32eb('0x26')](_0x12cb47)[_0x32eb('0x27')](function(_0x58bd29){return _0x58bd29;});}return null;};}function removeEntity(_0x4a83fb,_0x5aee62){return function(_0x489d56){if(_0x489d56){return _0x489d56[_0x32eb('0x28')]()['then'](function(){var _0x18a51f=_0x489d56[_0x32eb('0x29')]({'plain':!![]});var _0x4a97f3=_0x32eb('0x2a');return db[_0x32eb('0x2b')][_0x32eb('0x28')]({'where':{'type':_0x4a97f3,'resourceId':_0x18a51f['id']}})[_0x32eb('0x27')](function(){return _0x489d56;});})[_0x32eb('0x27')](function(){_0x4a83fb[_0x32eb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x411785,_0x1ea43b){return function(_0x245995){if(!_0x245995){_0x411785['sendStatus'](0x194);}return _0x245995;};}function handleError(_0x206aef,_0x115323){_0x115323=_0x115323||0x1f4;return function(_0xdbe833){logger['error'](_0xdbe833[_0x32eb('0x2c')]);if(_0xdbe833['name']){delete _0xdbe833[_0x32eb('0x2d')];}_0x206aef[_0x32eb('0x1b')](_0x115323)['send'](_0xdbe833);};}exports[_0x32eb('0x2e')]=function(_0x5ed24d,_0x363eb3){var _0x45d2d1={},_0x5dbac4={},_0xfa367d={'count':0x0,'rows':[]};var _0x2412de=_['map'](db[_0x32eb('0x2f')][_0x32eb('0x30')],function(_0x425fa8){return{'name':_0x425fa8['fieldName'],'type':_0x425fa8[_0x32eb('0x31')][_0x32eb('0x32')]};});_0x5dbac4['model']=_[_0x32eb('0x33')](_0x2412de,_0x32eb('0x2d'));_0x5dbac4[_0x32eb('0x34')]=_[_0x32eb('0x35')](_0x5ed24d[_0x32eb('0x34')]);_0x5dbac4[_0x32eb('0x36')]=_[_0x32eb('0x37')](_0x5dbac4[_0x32eb('0x38')],_0x5dbac4['query']);_0x45d2d1[_0x32eb('0x39')]=_['intersection'](_0x5dbac4[_0x32eb('0x38')],qs[_0x32eb('0x3a')](_0x5ed24d['query'][_0x32eb('0x3a')]));_0x45d2d1[_0x32eb('0x39')]=_0x45d2d1[_0x32eb('0x39')][_0x32eb('0x3b')]?_0x45d2d1[_0x32eb('0x39')]:_0x5dbac4[_0x32eb('0x38')];if(!_0x5ed24d['query'][_0x32eb('0x3c')]('nolimit')){_0x45d2d1[_0x32eb('0x21')]=qs[_0x32eb('0x21')](_0x5ed24d['query'][_0x32eb('0x21')]);_0x45d2d1[_0x32eb('0x1e')]=qs[_0x32eb('0x1e')](_0x5ed24d[_0x32eb('0x34')][_0x32eb('0x1e')]);}_0x45d2d1[_0x32eb('0x3d')]=qs['sort'](_0x5ed24d[_0x32eb('0x34')][_0x32eb('0x3e')]);_0x45d2d1[_0x32eb('0x3f')]=qs[_0x32eb('0x36')](_['pick'](_0x5ed24d[_0x32eb('0x34')],_0x5dbac4['filters']),_0x2412de);if(_0x5ed24d['query'][_0x32eb('0x40')]){_0x45d2d1[_0x32eb('0x3f')]=_[_0x32eb('0x41')](_0x45d2d1[_0x32eb('0x3f')],{'$or':_[_0x32eb('0x33')](_0x2412de,function(_0x52a69f){if(_0x52a69f[_0x32eb('0x31')]!=='VIRTUAL'){var _0x19842b={};_0x19842b[_0x52a69f[_0x32eb('0x2d')]]={'$like':'%'+_0x5ed24d[_0x32eb('0x34')][_0x32eb('0x40')]+'%'};return _0x19842b;}})});}_0x45d2d1=_[_0x32eb('0x41')]({},_0x45d2d1,_0x5ed24d['options']);var _0x2153c2={'where':_0x45d2d1[_0x32eb('0x3f')]};return db['Interval'][_0x32eb('0x20')](_0x2153c2)[_0x32eb('0x27')](function(_0x2a7947){_0xfa367d[_0x32eb('0x20')]=_0x2a7947;if(_0x5ed24d[_0x32eb('0x34')][_0x32eb('0x42')]){_0x45d2d1[_0x32eb('0x43')]=[{'all':!![]}];}return db[_0x32eb('0x2f')]['findAll'](_0x45d2d1);})['then'](function(_0xf8249e){_0xfa367d['rows']=_0xf8249e;return _0xfa367d;})[_0x32eb('0x27')](respondWithFilteredResult(_0x363eb3,_0x45d2d1))[_0x32eb('0x44')](handleError(_0x363eb3,null));};exports[_0x32eb('0x45')]=function(_0x57c894,_0x1dc645){var _0x168b6e={'raw':!![],'where':{'id':_0x57c894[_0x32eb('0x46')]['id']}},_0x156946={};_0x156946[_0x32eb('0x38')]=_[_0x32eb('0x35')](db[_0x32eb('0x2f')][_0x32eb('0x30')]);_0x156946[_0x32eb('0x34')]=_[_0x32eb('0x35')](_0x57c894[_0x32eb('0x34')]);_0x156946[_0x32eb('0x36')]=_[_0x32eb('0x37')](_0x156946[_0x32eb('0x38')],_0x156946[_0x32eb('0x34')]);_0x168b6e[_0x32eb('0x39')]=_[_0x32eb('0x37')](_0x156946['model'],qs[_0x32eb('0x3a')](_0x57c894[_0x32eb('0x34')][_0x32eb('0x3a')]));_0x168b6e[_0x32eb('0x39')]=_0x168b6e[_0x32eb('0x39')][_0x32eb('0x3b')]?_0x168b6e[_0x32eb('0x39')]:_0x156946[_0x32eb('0x38')];if(_0x57c894[_0x32eb('0x34')][_0x32eb('0x42')]){_0x168b6e[_0x32eb('0x43')]=[{'all':!![]}];}_0x168b6e=_[_0x32eb('0x41')]({},_0x168b6e,_0x57c894['options']);return db[_0x32eb('0x2f')][_0x32eb('0x47')](_0x168b6e)[_0x32eb('0x27')](handleEntityNotFound(_0x1dc645,null))['then'](respondWithResult(_0x1dc645,null))[_0x32eb('0x44')](handleError(_0x1dc645,null));};exports[_0x32eb('0x48')]=function(_0x43c8d7,_0x5bfd09){return db['Interval']['create'](_0x43c8d7['body'],{})[_0x32eb('0x27')](function(_0x124060){var _0x3cdbe3=_0x43c8d7[_0x32eb('0x49')]['get']({'plain':!![]});if(!_0x3cdbe3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cdbe3[_0x32eb('0x4a')]===_0x32eb('0x49')){var _0x3f4811=_0x124060['get']({'plain':!![]});var _0x2f8ce2=_0x32eb('0x2a');return db[_0x32eb('0x4b')][_0x32eb('0x47')]({'where':{'name':_0x2f8ce2,'userProfileId':_0x3cdbe3[_0x32eb('0x4c')]},'raw':!![]})[_0x32eb('0x27')](function(_0x4d1581){if(_0x4d1581&&_0x4d1581[_0x32eb('0x4d')]===0x0){return db[_0x32eb('0x2b')][_0x32eb('0x48')]({'name':_0x3f4811['name'],'resourceId':_0x3f4811['id'],'type':_0x4d1581['name'],'sectionId':_0x4d1581['id']},{})[_0x32eb('0x27')](function(){return _0x124060;});}else{return _0x124060;}})[_0x32eb('0x44')](function(_0x771b8f){logger[_0x32eb('0x4e')](_0x32eb('0x4f'),_0x771b8f);throw _0x771b8f;});}return _0x124060;})[_0x32eb('0x27')](respondWithResult(_0x5bfd09,0xc9))[_0x32eb('0x44')](handleError(_0x5bfd09,null));};exports['update']=function(_0x4c4673,_0x2ab660){if(_0x4c4673[_0x32eb('0x50')]['id']){delete _0x4c4673['body']['id'];}return db['Interval'][_0x32eb('0x47')]({'where':{'id':_0x4c4673['params']['id']}})[_0x32eb('0x27')](handleEntityNotFound(_0x2ab660,null))['then'](saveUpdates(_0x4c4673[_0x32eb('0x50')],null))['then'](respondWithResult(_0x2ab660,null))[_0x32eb('0x44')](handleError(_0x2ab660,null));};exports[_0x32eb('0x28')]=function(_0x20fd9d,_0x4e5f42){return db[_0x32eb('0x2f')][_0x32eb('0x47')]({'where':{'id':_0x20fd9d[_0x32eb('0x46')]['id']}})[_0x32eb('0x27')](handleEntityNotFound(_0x4e5f42,null))[_0x32eb('0x27')](removeEntity(_0x4e5f42,null))['catch'](handleError(_0x4e5f42,null));};exports[_0x32eb('0x51')]=function(_0x18533,_0x20921a,_0x258ae7){if(_0x18533[_0x32eb('0x50')]['id']){delete _0x18533[_0x32eb('0x50')]['id'];}return db[_0x32eb('0x2f')][_0x32eb('0x47')]({'where':{'id':_0x18533[_0x32eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x20921a,null))[_0x32eb('0x27')](function(_0x3331b8){if(_0x3331b8){_0x18533[_0x32eb('0x50')]['IntervalId']=_0x3331b8['id'];return db[_0x32eb('0x2f')][_0x32eb('0x48')](_0x18533['body']);}})[_0x32eb('0x27')](respondWithResult(_0x20921a,null))[_0x32eb('0x44')](handleError(_0x20921a,null));};exports[_0x32eb('0x52')]=function(_0x56ee58,_0x3bd68d,_0x2ea65e){var _0x2fbd3b={};var _0x3ebe99={};var _0x4a1f03;var _0x3ef5ff;return db[_0x32eb('0x2f')][_0x32eb('0x53')]({'where':{'id':_0x56ee58['params']['id']}})['then'](handleEntityNotFound(_0x3bd68d,null))['then'](function(_0x531128){if(_0x531128){_0x4a1f03=_0x531128;_0x3ebe99[_0x32eb('0x38')]=_['keys'](db[_0x32eb('0x2f')][_0x32eb('0x30')]);_0x3ebe99[_0x32eb('0x34')]=_[_0x32eb('0x35')](_0x56ee58[_0x32eb('0x34')]);_0x3ebe99[_0x32eb('0x36')]=_['intersection'](_0x3ebe99[_0x32eb('0x38')],_0x3ebe99[_0x32eb('0x34')]);_0x2fbd3b[_0x32eb('0x39')]=_[_0x32eb('0x37')](_0x3ebe99[_0x32eb('0x38')],qs['fields'](_0x56ee58[_0x32eb('0x34')][_0x32eb('0x3a')]));_0x2fbd3b[_0x32eb('0x39')]=_0x2fbd3b[_0x32eb('0x39')][_0x32eb('0x3b')]?_0x2fbd3b['attributes']:_0x3ebe99[_0x32eb('0x38')];_0x2fbd3b[_0x32eb('0x3d')]=qs[_0x32eb('0x3e')](_0x56ee58[_0x32eb('0x34')][_0x32eb('0x3e')]);_0x2fbd3b[_0x32eb('0x3f')]=qs[_0x32eb('0x36')](_[_0x32eb('0x54')](_0x56ee58[_0x32eb('0x34')],_0x3ebe99[_0x32eb('0x36')]));if(_0x56ee58[_0x32eb('0x34')]['filter']){_0x2fbd3b[_0x32eb('0x3f')]=_[_0x32eb('0x41')](_0x2fbd3b[_0x32eb('0x3f')],{'$or':_['map'](_0x2fbd3b[_0x32eb('0x39')],function(_0x52de80){var _0x332ef5={};_0x332ef5[_0x52de80]={'$like':'%'+_0x56ee58[_0x32eb('0x34')][_0x32eb('0x40')]+'%'};return _0x332ef5;})});}_0x2fbd3b=_[_0x32eb('0x41')]({},_0x2fbd3b,_0x56ee58[_0x32eb('0x55')]);return _0x4a1f03[_0x32eb('0x52')](_0x2fbd3b);}})['then'](function(_0x13c458){if(_0x13c458){_0x3ef5ff=_0x13c458[_0x32eb('0x3b')];if(!_0x56ee58[_0x32eb('0x34')][_0x32eb('0x3c')](_0x32eb('0x56'))){_0x2fbd3b[_0x32eb('0x21')]=qs[_0x32eb('0x21')](_0x56ee58[_0x32eb('0x34')][_0x32eb('0x21')]);_0x2fbd3b[_0x32eb('0x1e')]=qs[_0x32eb('0x1e')](_0x56ee58[_0x32eb('0x34')][_0x32eb('0x1e')]);}return _0x4a1f03[_0x32eb('0x52')](_0x2fbd3b);}})['then'](function(_0x12226c){if(_0x12226c){return _0x12226c?{'count':_0x3ef5ff,'rows':_0x12226c}:null;}})[_0x32eb('0x27')](respondWithResult(_0x3bd68d,null))['catch'](handleError(_0x3bd68d,null));};exports['addIntervals']=function(_0x2dfecd,_0x1a26b7,_0x23f206){return db[_0x32eb('0x2f')][_0x32eb('0x53')]({'where':{'id':_0x2dfecd[_0x32eb('0x46')]['id']}})[_0x32eb('0x27')](handleEntityNotFound(_0x1a26b7,null))[_0x32eb('0x27')](function(_0x150f46){if(_0x150f46){return db[_0x32eb('0x57')][_0x32eb('0x58')](function(_0x292f1e){return db['Interval'][_0x32eb('0x28')]({'where':{'IntervalId':_0x2dfecd['params']['id']},'transaction':_0x292f1e})['then'](function(_0x7d3b14){var _0xdcb093=_[_0x32eb('0x33')](_0x2dfecd[_0x32eb('0x50')],function(_0x25d01a){delete _0x25d01a['id'];_0x25d01a[_0x32eb('0x59')]=_0x2dfecd[_0x32eb('0x46')]['id'];return _0x25d01a;});return db['Interval'][_0x32eb('0x5a')](_0xdcb093,{'transaction':_0x292f1e});});})['then'](function(){return db[_0x32eb('0x2f')][_0x32eb('0x5b')]({'where':{'IntervalId':_0x2dfecd['params']['id']}});});}})[_0x32eb('0x27')](respondWithResult(_0x1a26b7,null))[_0x32eb('0x44')](handleError(_0x1a26b7,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb582=['interval','string','getIntervals','then','all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','Interval','tools_intervals','rewrite'];(function(_0x4b486f,_0x4ac50d){var _0x48534f=function(_0x3f986f){while(--_0x3f986f){_0x4b486f['push'](_0x4b486f['shift']());}};_0x48534f(++_0x4ac50d);}(_0xb582,0x181));var _0x2b58=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb582[_0x1035c1];return _0x308d67;};'use strict';var attributes=require(_0x2b58('0x0'));var extensions=require(_0x2b58('0x1'));var iftime=require(_0x2b58('0x2'))[_0x2b58('0x3')];module['exports']=function(_0x2ce89d){return _0x2ce89d['define'](_0x2b58('0x4'),attributes,{'tableName':_0x2b58('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x10086d){extensions[_0x2b58('0x6')](_0x2ce89d,_0x10086d);},'afterBulkCreate':function(_0x4d23de,_0x5c8d7f,_0x369ba2){_0x369ba2();extensions[_0x2b58('0x6')](_0x2ce89d,_0x4d23de[0x0]);},'afterUpdate':function(_0x80e3ad){extensions[_0x2b58('0x6')](_0x2ce89d,_0x80e3ad);},'afterDestroy':function(_0x869094){extensions[_0x2b58('0x6')](_0x2ce89d,_0x869094);}},'instanceMethods':{'ifTime':function(_0x2d2010=undefined,_0x309a6a=new Date()){if(typeof this[_0x2b58('0x7')]===_0x2b58('0x8')){return iftime(this[_0x2b58('0x7')],_0x2d2010,_0x309a6a);}else{return this[_0x2b58('0x9')]()[_0x2b58('0xa')](function(_0x1395fc){return Promise[_0x2b58('0xb')](_0x1395fc['map'](function(_0x3498ec){return _0x3498ec[_0x2b58('0xc')](_0x2d2010,_0x309a6a);}));})['then'](function(_0x49dea3){return _0x49dea3[_0x2b58('0xd')](function(_0x4e2ecf,_0x3d1453){return _0x4e2ecf||_0x3d1453;},![]);});}}}});};
\ No newline at end of file
+var _0x3b08=['exports','define','Interval','tools_intervals','rewrite','interval','then','map','ifTime','reduce','../../components/extensions/rewrite','iftime'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x3b08,0x172));var _0x83b0=function(_0x1c0dbd,_0x308369){_0x1c0dbd=_0x1c0dbd-0x0;var _0x574550=_0x3b08[_0x1c0dbd];return _0x574550;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x83b0('0x0'));var iftime=require('../../utils/iftime')[_0x83b0('0x1')];module[_0x83b0('0x2')]=function(_0x1fce0d){return _0x1fce0d[_0x83b0('0x3')](_0x83b0('0x4'),attributes,{'tableName':_0x83b0('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xb31a5a){extensions[_0x83b0('0x6')](_0x1fce0d,_0xb31a5a);},'afterBulkCreate':function(_0x1adf7a,_0x4f18b5,_0x31dd4c){_0x31dd4c();extensions['rewrite'](_0x1fce0d,_0x1adf7a[0x0]);},'afterUpdate':function(_0x2bfb2e){extensions['rewrite'](_0x1fce0d,_0x2bfb2e);},'afterDestroy':function(_0x2a4ed0){extensions['rewrite'](_0x1fce0d,_0x2a4ed0);}},'instanceMethods':{'ifTime':function(_0x28352e=undefined,_0xf0741b=new Date()){if(typeof this[_0x83b0('0x7')]==='string'){return iftime(this[_0x83b0('0x7')],_0x28352e,_0xf0741b);}else{return this['getIntervals']()[_0x83b0('0x8')](function(_0x5a688c){return Promise['all'](_0x5a688c[_0x83b0('0x9')](function(_0x997617){return _0x997617[_0x83b0('0xa')](_0x28352e,_0xf0741b);}));})[_0x83b0('0x8')](function(_0x2f4be1){return _0x2f4be1[_0x83b0('0xb')](function(_0x8c1de6,_0x37f5c2){return _0x8c1de6||_0x37f5c2;},![]);});}}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4dfc=['name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','options','where','attributes','include','map','model','then','info','debug','stringify','message','error','find','raw','ShowInterval','catch','findAll','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)'];(function(_0x4bba85,_0x4c3e39){var _0x17e4d2=function(_0x57ce98){while(--_0x57ce98){_0x4bba85['push'](_0x4bba85['shift']());}};_0x17e4d2(++_0x4c3e39);}(_0x4dfc,0x1d2));var _0xc4df=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x4dfc[_0x282a1f];return _0x296ea7;};'use strict';var _=require('lodash');var util=require(_0xc4df('0x0'));var db=require(_0xc4df('0x1'))['db'];var iftime=require(_0xc4df('0x2'))[_0xc4df('0x3')];var logger=require(_0xc4df('0x4'))('rpc');exports[_0xc4df('0x5')]=function(_0x53e76d){var _0x16630e=this;return new Promise(function(_0x131cc4,_0xdac4b7){return db[_0xc4df('0x6')]['findAll']({'raw':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x53e76d['options']?_0x53e76d[_0xc4df('0x7')][_0xc4df('0x8')]||null:null,'attributes':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')][_0xc4df('0x9')]||null:null,'limit':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')]['limit']||null:null,'include':_0x53e76d[_0xc4df('0x7')]?_0x53e76d[_0xc4df('0x7')][_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x53e76d['options'][_0xc4df('0xa')],function(_0x5a4e22){return{'model':db[_0x5a4e22[_0xc4df('0xc')]],'as':_0x5a4e22['as'],'attributes':_0x5a4e22['attributes'],'include':_0x5a4e22[_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x5a4e22[_0xc4df('0xa')],function(_0x179811){return{'model':db[_0x179811['model']],'as':_0x179811['as'],'attributes':_0x179811['attributes'],'include':_0x179811['include']?_['map'](_0x179811[_0xc4df('0xa')],function(_0x47118b){return{'model':db[_0x47118b[_0xc4df('0xc')]],'as':_0x47118b['as'],'attributes':_0x47118b[_0xc4df('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc4df('0xd')](function(_0x37f46c){logger[_0xc4df('0xe')](_0xc4df('0x5'),_0x53e76d);logger[_0xc4df('0xf')](_0xc4df('0x5'),_0x53e76d,JSON[_0xc4df('0x10')](_0x37f46c));_0x131cc4(_0x37f46c);})['catch'](function(_0x579909){logger['error'](_0xc4df('0x5'),_0x579909[_0xc4df('0x11')],_0x53e76d);_0xdac4b7(_0x16630e[_0xc4df('0x12')](0x1f4,_0x579909[_0xc4df('0x11')]));});});};exports['ShowInterval']=function(_0x41c395){var _0x539047=this;return new Promise(function(_0x52ef57,_0x44ab6f){return db[_0xc4df('0x6')][_0xc4df('0x13')]({'raw':_0x41c395[_0xc4df('0x7')]?_0x41c395['options'][_0xc4df('0x14')]===undefined?!![]:![]:!![],'where':_0x41c395['options']?_0x41c395[_0xc4df('0x7')][_0xc4df('0x8')]||null:null,'attributes':_0x41c395[_0xc4df('0x7')]?_0x41c395[_0xc4df('0x7')][_0xc4df('0x9')]||null:null,'include':_0x41c395['options']?_0x41c395[_0xc4df('0x7')][_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x41c395['options']['include'],function(_0x8f458f){return{'model':db[_0x8f458f[_0xc4df('0xc')]],'as':_0x8f458f['as'],'attributes':_0x8f458f['attributes'],'include':_0x8f458f[_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x8f458f[_0xc4df('0xa')],function(_0x22f95a){return{'model':db[_0x22f95a[_0xc4df('0xc')]],'as':_0x22f95a['as'],'attributes':_0x22f95a[_0xc4df('0x9')],'include':_0x22f95a[_0xc4df('0xa')]?_[_0xc4df('0xb')](_0x22f95a[_0xc4df('0xa')],function(_0x12b449){return{'model':db[_0x12b449[_0xc4df('0xc')]],'as':_0x12b449['as'],'attributes':_0x12b449[_0xc4df('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc4df('0xd')](function(_0x1ec057){logger[_0xc4df('0xe')](_0xc4df('0x15'),_0x41c395);logger[_0xc4df('0xf')](_0xc4df('0x15'),_0x41c395,JSON['stringify'](_0x1ec057));_0x52ef57(_0x1ec057);})[_0xc4df('0x16')](function(_0x26bdce){logger['error'](_0xc4df('0x15'),_0x26bdce[_0xc4df('0x11')],_0x41c395);_0x44ab6f(_0x539047[_0xc4df('0x12')](0x1f4,_0x26bdce[_0xc4df('0x11')]));});});};function checkArrayOfIntervals(_0x214596,_0x431db9){var _0x4315d6=[];return db['Interval'][_0xc4df('0x17')]({'where':{'id':_0x214596}})['then'](function(_0x315013){_0x4315d6=_0x315013;return Promise[_0xc4df('0x18')](_0x4315d6[_0xc4df('0xb')](function(_0x41be03){return _0x41be03[_0xc4df('0x19')](_0x431db9);}));})['then'](function(_0x1b338a){var _0x1c800c=_0x1b338a[_0xc4df('0x1a')](function(_0x19a83d,_0x4034cd){return _0x19a83d||_0x4034cd;},![]);logger['info'](util[_0xc4df('0x1b')](_0xc4df('0x1c'),_0x4315d6['map'](function(_0x24dfdb){return _0x24dfdb[_0xc4df('0x1d')];})[_0xc4df('0x1e')](',\x20'),_0x4315d6['map'](function(_0x4a7283){return _0x4a7283['id'];})[_0xc4df('0x1e')](',\x20')));return _0x1c800c;});}function checkSingleInterval(_0xc077c4,_0x4790f2){return db[_0xc4df('0x6')][_0xc4df('0x1f')](_0xc077c4)['then'](function(_0x19e16b){if(_0x19e16b){logger[_0xc4df('0xe')](util['format'](_0xc4df('0x20'),_0x19e16b[_0xc4df('0x1d')],_0x19e16b['id']));return _0x19e16b[_0xc4df('0x19')](_0x4790f2);}});}exports[_0xc4df('0x21')]=function(_0x525457){var _0x3415e8=_0x525457[_0xc4df('0x22')];var _0x593a8e=Array['isArray'](_0x525457['intervals'])?_0x525457[_0xc4df('0x23')]:typeof _0x525457[_0xc4df('0x23')]===_0xc4df('0x24')?[_0x525457['intervals']]:[];var _0x4e43a2=_0x525457[_0xc4df('0x25')]||undefined;var _0xbd2e84=![];if(_0x593a8e[_0xc4df('0x26')]){logger[_0xc4df('0xe')](util[_0xc4df('0x1b')](_0xc4df('0x27'),_0x593a8e['join'](';\x20')));}if(_0x4e43a2){logger['info'](util['format'](_0xc4df('0x28'),_0x4e43a2));}logger[_0xc4df('0xf')](_0xc4df('0x29'),_0xbd2e84);logger[_0xc4df('0x2a')]('IntervalIftime',_0x525457);return Promise[_0xc4df('0x2b')]()['then'](function(){if(Array[_0xc4df('0x2c')](_0x3415e8)){return checkArrayOfIntervals(_0x3415e8,_0x4e43a2);}else if(_0x3415e8){return checkSingleInterval(_0x3415e8,_0x4e43a2);}})[_0xc4df('0xd')](function(_0xd18739){var _0x108766=_0x593a8e[_0xc4df('0x1a')](function(_0x3e91b8,_0x5dad2e){return _0x3e91b8||iftime(_0x5dad2e,_0x4e43a2);},![]);_0xbd2e84=_0xd18739||_0x108766;return _0xbd2e84;})[_0xc4df('0x16')](function(_0x3ab943){logger[_0xc4df('0x12')](_0xc4df('0x21'),_0x525457,_0x3ab943);throw this[_0xc4df('0x12')](0x1f4,_0x3ab943[_0xc4df('0x11')]);});};
\ No newline at end of file
+var _0x2ced=['IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','debug','Iftime','silly','resolve','lodash','util','iftime','findAll','options','raw','attributes','include','map','model','then','info','GetInterval','catch','error','message','Interval','find','where','ShowInterval','stringify','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)'];(function(_0x55511d,_0x2c8711){var _0x3fb91c=function(_0x4a87f2){while(--_0x4a87f2){_0x55511d['push'](_0x55511d['shift']());}};_0x3fb91c(++_0x2c8711);}(_0x2ced,0x1a6));var _0xd2ce=function(_0x209f48,_0x571c0f){_0x209f48=_0x209f48-0x0;var _0x5095b7=_0x2ced[_0x209f48];return _0x5095b7;};'use strict';var _=require(_0xd2ce('0x0'));var util=require(_0xd2ce('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')[_0xd2ce('0x2')];var logger=require('../../config/logger')('rpc');exports['GetInterval']=function(_0x10d08f){var _0x3dc213=this;return new Promise(function(_0x284337,_0xf43c45){return db['Interval'][_0xd2ce('0x3')]({'raw':_0x10d08f[_0xd2ce('0x4')]?_0x10d08f['options'][_0xd2ce('0x5')]===undefined?!![]:![]:!![],'where':_0x10d08f[_0xd2ce('0x4')]?_0x10d08f[_0xd2ce('0x4')]['where']||null:null,'attributes':_0x10d08f[_0xd2ce('0x4')]?_0x10d08f['options'][_0xd2ce('0x6')]||null:null,'limit':_0x10d08f[_0xd2ce('0x4')]?_0x10d08f[_0xd2ce('0x4')]['limit']||null:null,'include':_0x10d08f['options']?_0x10d08f[_0xd2ce('0x4')][_0xd2ce('0x7')]?_[_0xd2ce('0x8')](_0x10d08f['options'][_0xd2ce('0x7')],function(_0x431cee){return{'model':db[_0x431cee[_0xd2ce('0x9')]],'as':_0x431cee['as'],'attributes':_0x431cee[_0xd2ce('0x6')],'include':_0x431cee[_0xd2ce('0x7')]?_['map'](_0x431cee[_0xd2ce('0x7')],function(_0x4b25f5){return{'model':db[_0x4b25f5[_0xd2ce('0x9')]],'as':_0x4b25f5['as'],'attributes':_0x4b25f5[_0xd2ce('0x6')],'include':_0x4b25f5[_0xd2ce('0x7')]?_[_0xd2ce('0x8')](_0x4b25f5[_0xd2ce('0x7')],function(_0x4b52f4){return{'model':db[_0x4b52f4[_0xd2ce('0x9')]],'as':_0x4b52f4['as'],'attributes':_0x4b52f4[_0xd2ce('0x6')]};}):[]};}):[]};}):[]:[]})[_0xd2ce('0xa')](function(_0x949f26){logger[_0xd2ce('0xb')](_0xd2ce('0xc'),_0x10d08f);logger['debug'](_0xd2ce('0xc'),_0x10d08f,JSON['stringify'](_0x949f26));_0x284337(_0x949f26);})[_0xd2ce('0xd')](function(_0x28715f){logger[_0xd2ce('0xe')](_0xd2ce('0xc'),_0x28715f['message'],_0x10d08f);_0xf43c45(_0x3dc213['error'](0x1f4,_0x28715f[_0xd2ce('0xf')]));});});};exports['ShowInterval']=function(_0x234b21){var _0x19820f=this;return new Promise(function(_0x1700fd,_0x5c822f){return db[_0xd2ce('0x10')][_0xd2ce('0x11')]({'raw':_0x234b21[_0xd2ce('0x4')]?_0x234b21['options'][_0xd2ce('0x5')]===undefined?!![]:![]:!![],'where':_0x234b21[_0xd2ce('0x4')]?_0x234b21['options'][_0xd2ce('0x12')]||null:null,'attributes':_0x234b21[_0xd2ce('0x4')]?_0x234b21[_0xd2ce('0x4')][_0xd2ce('0x6')]||null:null,'include':_0x234b21[_0xd2ce('0x4')]?_0x234b21[_0xd2ce('0x4')][_0xd2ce('0x7')]?_[_0xd2ce('0x8')](_0x234b21[_0xd2ce('0x4')][_0xd2ce('0x7')],function(_0xfad24a){return{'model':db[_0xfad24a[_0xd2ce('0x9')]],'as':_0xfad24a['as'],'attributes':_0xfad24a[_0xd2ce('0x6')],'include':_0xfad24a[_0xd2ce('0x7')]?_['map'](_0xfad24a['include'],function(_0x111b0c){return{'model':db[_0x111b0c[_0xd2ce('0x9')]],'as':_0x111b0c['as'],'attributes':_0x111b0c[_0xd2ce('0x6')],'include':_0x111b0c['include']?_[_0xd2ce('0x8')](_0x111b0c[_0xd2ce('0x7')],function(_0x569187){return{'model':db[_0x569187[_0xd2ce('0x9')]],'as':_0x569187['as'],'attributes':_0x569187[_0xd2ce('0x6')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x118390){logger['info'](_0xd2ce('0x13'),_0x234b21);logger['debug'](_0xd2ce('0x13'),_0x234b21,JSON[_0xd2ce('0x14')](_0x118390));_0x1700fd(_0x118390);})[_0xd2ce('0xd')](function(_0x1d536e){logger[_0xd2ce('0xe')](_0xd2ce('0x13'),_0x1d536e[_0xd2ce('0xf')],_0x234b21);_0x5c822f(_0x19820f[_0xd2ce('0xe')](0x1f4,_0x1d536e[_0xd2ce('0xf')]));});});};function checkArrayOfIntervals(_0x4465cc,_0x57087b){var _0x59ce79=[];return db[_0xd2ce('0x10')][_0xd2ce('0x3')]({'where':{'id':_0x4465cc}})[_0xd2ce('0xa')](function(_0x3674f8){_0x59ce79=_0x3674f8;return Promise[_0xd2ce('0x15')](_0x59ce79[_0xd2ce('0x8')](function(_0x1a5f76){return _0x1a5f76['ifTime'](_0x57087b);}));})[_0xd2ce('0xa')](function(_0x4d988e){var _0x250fbb=_0x4d988e[_0xd2ce('0x16')](function(_0x17a045,_0x2014f7){return _0x17a045||_0x2014f7;},![]);logger[_0xd2ce('0xb')](util[_0xd2ce('0x17')](_0xd2ce('0x18'),_0x59ce79[_0xd2ce('0x8')](function(_0x5cd370){return _0x5cd370[_0xd2ce('0x19')];})['join'](',\x20'),_0x59ce79[_0xd2ce('0x8')](function(_0x5d9133){return _0x5d9133['id'];})[_0xd2ce('0x1a')](',\x20')));return _0x250fbb;});}function checkSingleInterval(_0x78396b,_0x17825f){return db[_0xd2ce('0x10')][_0xd2ce('0x1b')](_0x78396b)[_0xd2ce('0xa')](function(_0x881417){if(_0x881417){logger[_0xd2ce('0xb')](util[_0xd2ce('0x17')](_0xd2ce('0x1c'),_0x881417['name'],_0x881417['id']));return _0x881417['ifTime'](_0x17825f);}});}exports[_0xd2ce('0x1d')]=function(_0x16010c){var _0xcc9564=_0x16010c[_0xd2ce('0x1e')];var _0x5156fd=Array[_0xd2ce('0x1f')](_0x16010c[_0xd2ce('0x20')])?_0x16010c[_0xd2ce('0x20')]:typeof _0x16010c['intervals']===_0xd2ce('0x21')?[_0x16010c[_0xd2ce('0x20')]]:[];var _0x3e7953=_0x16010c[_0xd2ce('0x22')]||undefined;var _0x3a9d43=![];if(_0x5156fd[_0xd2ce('0x23')]){logger[_0xd2ce('0xb')](util[_0xd2ce('0x17')](_0xd2ce('0x24'),_0x5156fd[_0xd2ce('0x1a')](';\x20')));}if(_0x3e7953){logger[_0xd2ce('0xb')](util[_0xd2ce('0x17')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x3e7953));}logger[_0xd2ce('0x25')](_0xd2ce('0x26'),_0x3a9d43);logger[_0xd2ce('0x27')](_0xd2ce('0x1d'),_0x16010c);return Promise[_0xd2ce('0x28')]()[_0xd2ce('0xa')](function(){if(Array['isArray'](_0xcc9564)){return checkArrayOfIntervals(_0xcc9564,_0x3e7953);}else if(_0xcc9564){return checkSingleInterval(_0xcc9564,_0x3e7953);}})[_0xd2ce('0xa')](function(_0x198544){var _0x3ff329=_0x5156fd[_0xd2ce('0x16')](function(_0x4dbb12,_0x1ed774){return _0x4dbb12||iftime(_0x1ed774,_0x3e7953);},![]);_0x3a9d43=_0x198544||_0x3ff329;return _0x3a9d43;})[_0xd2ce('0xd')](function(_0x1dfe46){logger['error']('IntervalIftime',_0x16010c,_0x1dfe46);throw this[_0xd2ce('0xe')](0x1f4,_0x1dfe46[_0xd2ce('0xf')]);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0xfeb826,_0x1b4114){var _0x4f44a5=function(_0x58a0e7){while(--_0x58a0e7){_0xfeb826['push'](_0xfeb826['shift']());}};_0x4f44a5(++_0x1b4114);}(_0xdb28,0x106));var _0x8db2=function(_0x243cbc,_0x5b174a){_0x243cbc=_0x243cbc-0x0;var _0x12cc09=_0xdb28[_0x243cbc];return _0x12cc09;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
+var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x241544,_0x69d250){var _0x220d9f=function(_0xfc0b40){while(--_0xfc0b40){_0x241544['push'](_0x241544['shift']());}};_0x220d9f(++_0x69d250);}(_0x2ef3,0xba));var _0x32ef=function(_0x5056bc,_0x428f3f){_0x5056bc=_0x5056bc-0x0;var _0x493fa8=_0x2ef3[_0x5056bc];return _0x493fa8;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef21=['write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','fields','email','customfield_11502','newToken','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','setEncoding','data','end','status','statusCode','json','error'];(function(_0x41fe33,_0x13deb8){var _0x20118e=function(_0x930a16){while(--_0x930a16){_0x41fe33['push'](_0x41fe33['shift']());}};_0x20118e(++_0x13deb8);}(_0xef21,0xa8));var _0x1ef2=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xef21[_0x525c7b];return _0x27b33e;};'use strict';var BPromise=require(_0x1ef2('0x0'));var https=require(_0x1ef2('0x1'));var logger=require(_0x1ef2('0x2'))(_0x1ef2('0x3'));var USERNAME=_0x1ef2('0x4');var PASSWORD=_0x1ef2('0x5');function openIssue(_0x16d9f4,_0x13e719){var _0x4950a4={'fields':{'project':{'key':_0x16d9f4['key']||_0x1ef2('0x6')},'summary':(_0x16d9f4[_0x1ef2('0x7')]||_0x1ef2('0x8'))+_0x1ef2('0x9')+_0x16d9f4['ip'],'description':_0x16d9f4[_0x1ef2('0xa')]||JSON['stringify'](_0x16d9f4),'issuetype':{'name':_0x16d9f4['issuetype']||'Bug'}}};_0x4950a4[_0x1ef2('0xb')]['customfield_11500']=_0x16d9f4[_0x1ef2('0xc')];_0x4950a4[_0x1ef2('0xb')]['customfield_11501']=_0x16d9f4['oldToken'];_0x4950a4[_0x1ef2('0xb')][_0x1ef2('0xd')]=_0x16d9f4[_0x1ef2('0xe')];_0x4950a4['fields'][_0x1ef2('0xf')]=_0x16d9f4['name'];_0x4950a4[_0x1ef2('0xb')][_0x1ef2('0x10')]=_0x16d9f4[_0x1ef2('0x11')];_0x4950a4[_0x1ef2('0xb')]['customfield_10102']=_0x16d9f4['ip'];var _0x57cd31={'host':_0x1ef2('0x12'),'port':0x1bb,'path':_0x1ef2('0x13'),'method':_0x1ef2('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x1ef2('0x15'),'Authorization':_0x1ef2('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x1ef2('0x17')]('base64')}};var _0x4df692=JSON[_0x1ef2('0x18')](_0x4950a4);var _0x2e1ff1=https['request'](_0x57cd31,function(_0x63b1e){_0x63b1e[_0x1ef2('0x19')]('utf8');var _0x3c34ed='';_0x63b1e['on'](_0x1ef2('0x1a'),function(_0x580ff0){_0x3c34ed+=_0x580ff0;});_0x63b1e['on'](_0x1ef2('0x1b'),function(){if(_0x13e719){return _0x13e719[_0x1ef2('0x1c')](_0x63b1e[_0x1ef2('0x1d')])[_0x1ef2('0x1e')](JSON['parse'](_0x3c34ed));}});});_0x2e1ff1['on'](_0x1ef2('0x1f'),function(_0x3b5345){if(_0x13e719){return _0x13e719[_0x1ef2('0x1c')](0x1f4)[_0x1ef2('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x2e1ff1[_0x1ef2('0x20')](_0x4df692);_0x2e1ff1[_0x1ef2('0x1b')]();}exports[_0x1ef2('0x21')]=openIssue;exports[_0x1ef2('0x22')]=function(_0x1ad97f,_0x2e5575){_0x1ad97f[_0x1ef2('0x23')]['ip']=_0x1ad97f['headers'][_0x1ef2('0x24')]||_0x1ad97f['connection'][_0x1ef2('0x25')]||_0x1ad97f[_0x1ef2('0x26')][_0x1ef2('0x25')]||_0x1ad97f[_0x1ef2('0x27')]['socket'][_0x1ef2('0x25')];return openIssue(_0x1ad97f['body'],_0x2e5575);};
\ No newline at end of file
+var _0x9292=['summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','customfield_11501','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','request','utf8','data','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','headers','connection','remoteAddress','socket','body','3eAmWpBVP0','MOTGUI'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9292,0x6d));var _0x2929=function(_0x15c466,_0x33bff4){_0x15c466=_0x15c466-0x0;var _0x1d115f=_0x9292[_0x15c466];return _0x1d115f;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')('api');var USERNAME='support';var PASSWORD=_0x2929('0x0');function openIssue(_0x5aad7a,_0x46b3c5){var _0x6ba4b2={'fields':{'project':{'key':_0x5aad7a['key']||_0x2929('0x1')},'summary':(_0x5aad7a[_0x2929('0x2')]||_0x2929('0x3'))+_0x2929('0x4')+_0x5aad7a['ip'],'description':_0x5aad7a[_0x2929('0x5')]||JSON[_0x2929('0x6')](_0x5aad7a),'issuetype':{'name':_0x5aad7a[_0x2929('0x7')]||'Bug'}}};_0x6ba4b2[_0x2929('0x8')][_0x2929('0x9')]=_0x5aad7a['email'];_0x6ba4b2['fields'][_0x2929('0xa')]=_0x5aad7a['oldToken'];_0x6ba4b2[_0x2929('0x8')]['customfield_11502']=_0x5aad7a[_0x2929('0xb')];_0x6ba4b2[_0x2929('0x8')][_0x2929('0xc')]=_0x5aad7a[_0x2929('0xd')];_0x6ba4b2[_0x2929('0x8')][_0x2929('0xe')]=_0x5aad7a[_0x2929('0xf')];_0x6ba4b2[_0x2929('0x8')][_0x2929('0x10')]=_0x5aad7a['ip'];var _0x27c03a={'host':_0x2929('0x11'),'port':0x1bb,'path':_0x2929('0x12'),'method':_0x2929('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x2929('0x14'),'Authorization':_0x2929('0x15')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x494d04=JSON['stringify'](_0x6ba4b2);var _0x45b9ca=https[_0x2929('0x16')](_0x27c03a,function(_0x257a9f){_0x257a9f['setEncoding'](_0x2929('0x17'));var _0x13df57='';_0x257a9f['on'](_0x2929('0x18'),function(_0x5900f7){_0x13df57+=_0x5900f7;});_0x257a9f['on']('end',function(){if(_0x46b3c5){return _0x46b3c5['status'](_0x257a9f[_0x2929('0x19')])[_0x2929('0x1a')](JSON['parse'](_0x13df57));}});});_0x45b9ca['on'](_0x2929('0x1b'),function(_0x3aa92b){if(_0x46b3c5){return _0x46b3c5[_0x2929('0x1c')](0x1f4)[_0x2929('0x1a')]({'errors':[{'message':_0x2929('0x1d'),'type':_0x2929('0x1e')}]});}});_0x45b9ca[_0x2929('0x1f')](_0x494d04);_0x45b9ca['end']();}exports['openIssue']=openIssue;exports['send']=function(_0x2fd697,_0x167f0f){_0x2fd697['body']['ip']=_0x2fd697[_0x2929('0x20')]['x-forwarded-for']||_0x2fd697[_0x2929('0x21')][_0x2929('0x22')]||_0x2fd697[_0x2929('0x23')][_0x2929('0x22')]||_0x2fd697[_0x2929('0x21')][_0x2929('0x23')][_0x2929('0x22')];return openIssue(_0x2fd697[_0x2929('0x24')],_0x167f0f);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x39bfb6,_0x3ad6a6){var _0x131b8b=function(_0x4152d7){while(--_0x4152d7){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x131b8b(++_0x3ad6a6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2d8e64,_0x143f18){_0x2d8e64=_0x2d8e64-0x0;var _0x31cc7e=_0xec56[_0x2d8e64];return _0x31cc7e;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router;
\ No newline at end of file
+var _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0x588674,_0x4deeae){var _0x4b82e9=function(_0x31cb48){while(--_0x31cb48){_0x588674['push'](_0x588674['shift']());}};_0x4b82e9(++_0x4deeae);}(_0x750a,0x140));var _0xa750=function(_0x13a1d0,_0x59dc20){_0x13a1d0=_0x13a1d0-0x0;var _0x3cabcc=_0x750a[_0x13a1d0];return _0x3cabcc;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x13c30d,_0x3ee4fd){_0x13c30d=_0x13c30d-0x0;var _0xb3b224=_0x7a54[_0x13c30d];return _0xb3b224;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x1630e3,_0x49dcb7){_0x1630e3=_0x1630e3-0x0;var _0x1c894e=_0x7a54[_0x1630e3];return _0x1c894e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4279=['mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','JscriptyAnswerReport','includeAll','include','findAll','rows','show','params','catch','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x4279,0x8d));var _0x9427=function(_0x5d8f50,_0x5236ed){_0x5d8f50=_0x5d8f50-0x0;var _0x177588=_0x4279[_0x5d8f50];return _0x177588;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9427('0x0'));var zipdir=require(_0x9427('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9427('0x2'));var moment=require(_0x9427('0x3'));var BPromise=require(_0x9427('0x4'));var Mustache=require(_0x9427('0x5'));var util=require('util');var path=require(_0x9427('0x6'));var sox=require('sox');var csv=require(_0x9427('0x7'));var ejs=require(_0x9427('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9427('0x9'));var squel=require(_0x9427('0xa'));var crypto=require(_0x9427('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9427('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9427('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9427('0xe'));var qs=require(_0x9427('0xf'));var as=require(_0x9427('0x10'));var hardwareService=require(_0x9427('0x11'));var logger=require(_0x9427('0x12'))(_0x9427('0x13'));var utils=require(_0x9427('0x14'));var config=require(_0x9427('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9427('0x16'))['db'];function respondWithStatusCode(_0x1ceb46,_0x44bd4e){_0x44bd4e=_0x44bd4e||0xcc;return function(_0x17eb26){if(_0x17eb26){return _0x1ceb46[_0x9427('0x17')](_0x44bd4e);}return _0x1ceb46[_0x9427('0x18')](_0x44bd4e)[_0x9427('0x19')]();};}function respondWithResult(_0x1f6b92,_0x250144){_0x250144=_0x250144||0xc8;return function(_0x3a2956){if(_0x3a2956){return _0x1f6b92[_0x9427('0x18')](_0x250144)[_0x9427('0x1a')](_0x3a2956);}};}function respondWithFilteredResult(_0x418e37,_0x5cbf67){return function(_0x3a6f84){if(_0x3a6f84){var _0x1a41eb=typeof _0x5cbf67[_0x9427('0x1b')]==='undefined'&&typeof _0x5cbf67['limit']===_0x9427('0x1c');var _0x567da4=_0x3a6f84[_0x9427('0x1d')];var _0x20de12=_0x1a41eb?0x0:_0x5cbf67['offset'];var _0x5177e2=_0x1a41eb?_0x3a6f84[_0x9427('0x1d')]:_0x5cbf67[_0x9427('0x1b')]+_0x5cbf67[_0x9427('0x1e')];var _0x11fcd4;if(_0x5177e2>=_0x567da4){_0x5177e2=_0x567da4;_0x11fcd4=0xc8;}else{_0x11fcd4=0xce;}_0x418e37[_0x9427('0x18')](_0x11fcd4);return _0x418e37[_0x9427('0x1f')](_0x9427('0x20'),_0x20de12+'-'+_0x5177e2+'/'+_0x567da4)[_0x9427('0x1a')](_0x3a6f84);}return null;};}function patchUpdates(_0xa9da31){return function(_0x97800f){try{jsonpatch[_0x9427('0x21')](_0x97800f,_0xa9da31,!![]);}catch(_0x374291){return BPromise[_0x9427('0x22')](_0x374291);}return _0x97800f[_0x9427('0x23')]();};}function saveUpdates(_0xac18ea,_0x3e8743){return function(_0x4c6c09){if(_0x4c6c09){return _0x4c6c09['update'](_0xac18ea)[_0x9427('0x24')](function(_0x3cde1e){return _0x3cde1e;});}return null;};}function removeEntity(_0x1db2cf,_0x40d8cb){return function(_0x437dda){if(_0x437dda){return _0x437dda[_0x9427('0x25')]()[_0x9427('0x24')](function(){_0x1db2cf[_0x9427('0x18')](0xcc)[_0x9427('0x19')]();});}};}function handleEntityNotFound(_0x1ecd67,_0xb43f57){return function(_0x32a68a){if(!_0x32a68a){_0x1ecd67['sendStatus'](0x194);}return _0x32a68a;};}function handleError(_0x2a9a0c,_0x5d1829){_0x5d1829=_0x5d1829||0x1f4;return function(_0x2ed9b5){logger[_0x9427('0x26')](_0x2ed9b5['stack']);if(_0x2ed9b5[_0x9427('0x27')]){delete _0x2ed9b5[_0x9427('0x27')];}_0x2a9a0c[_0x9427('0x18')](_0x5d1829)[_0x9427('0x28')](_0x2ed9b5);};}exports[_0x9427('0x29')]=function(_0x58c7a2,_0x8e8955){var _0x2a0263={},_0x5947d0={},_0x51a356={'count':0x0,'rows':[]};var _0x2362f0=_[_0x9427('0x2a')](db['JscriptyAnswerReport'][_0x9427('0x2b')],function(_0x127572){return{'name':_0x127572[_0x9427('0x2c')],'type':_0x127572[_0x9427('0x2d')][_0x9427('0x2e')]};});_0x5947d0['model']=_['map'](_0x2362f0,_0x9427('0x27'));_0x5947d0[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x58c7a2['query']);_0x5947d0[_0x9427('0x31')]=_[_0x9427('0x32')](_0x5947d0[_0x9427('0x33')],_0x5947d0['query']);_0x2a0263['attributes']=_[_0x9427('0x32')](_0x5947d0['model'],qs[_0x9427('0x34')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x34')]));_0x2a0263['attributes']=_0x2a0263[_0x9427('0x35')][_0x9427('0x36')]?_0x2a0263[_0x9427('0x35')]:_0x5947d0[_0x9427('0x33')];if(!_0x58c7a2[_0x9427('0x2f')][_0x9427('0x37')]('nolimit')){_0x2a0263['limit']=qs[_0x9427('0x1e')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x1e')]);_0x2a0263[_0x9427('0x1b')]=qs[_0x9427('0x1b')](_0x58c7a2['query'][_0x9427('0x1b')]);}_0x2a0263[_0x9427('0x38')]=qs[_0x9427('0x39')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x39')]);_0x2a0263[_0x9427('0x3a')]=qs[_0x9427('0x31')](_['pick'](_0x58c7a2[_0x9427('0x2f')],_0x5947d0['filters']),_0x2362f0);if(_0x58c7a2['query'][_0x9427('0x3b')]){_0x2a0263[_0x9427('0x3a')]=_[_0x9427('0x3c')](_0x2a0263[_0x9427('0x3a')],{'$or':_[_0x9427('0x2a')](_0x2362f0,function(_0x34915f){if(_0x34915f['type']!=='VIRTUAL'){var _0x689284={};_0x689284[_0x34915f['name']]={'$like':'%'+_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3b')]+'%'};return _0x689284;}})});}_0x2a0263=_['merge']({},_0x2a0263,_0x58c7a2[_0x9427('0x3d')]);var _0xff3674={'where':_0x2a0263['where']};return db[_0x9427('0x3e')][_0x9427('0x1d')](_0xff3674)['then'](function(_0x18b5c4){_0x51a356['count']=_0x18b5c4;if(_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3f')]){_0x2a0263[_0x9427('0x40')]=[{'all':!![]}];}return db[_0x9427('0x3e')][_0x9427('0x41')](_0x2a0263);})[_0x9427('0x24')](function(_0x14e137){_0x51a356[_0x9427('0x42')]=_0x14e137;return _0x51a356;})[_0x9427('0x24')](respondWithFilteredResult(_0x8e8955,_0x2a0263))['catch'](handleError(_0x8e8955,null));};exports[_0x9427('0x43')]=function(_0x234092,_0x4a5c19){var _0x4988f8={'raw':!![],'where':{'id':_0x234092[_0x9427('0x44')]['id']}},_0x17eb62={};_0x17eb62[_0x9427('0x33')]=_[_0x9427('0x30')](db[_0x9427('0x3e')]['rawAttributes']);_0x17eb62[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x234092[_0x9427('0x2f')]);_0x17eb62[_0x9427('0x31')]=_['intersection'](_0x17eb62['model'],_0x17eb62[_0x9427('0x2f')]);_0x4988f8[_0x9427('0x35')]=_[_0x9427('0x32')](_0x17eb62[_0x9427('0x33')],qs[_0x9427('0x34')](_0x234092['query'][_0x9427('0x34')]));_0x4988f8[_0x9427('0x35')]=_0x4988f8['attributes'][_0x9427('0x36')]?_0x4988f8['attributes']:_0x17eb62['model'];if(_0x234092['query']['includeAll']){_0x4988f8['include']=[{'all':!![]}];}_0x4988f8=_['merge']({},_0x4988f8,_0x234092[_0x9427('0x3d')]);return db['JscriptyAnswerReport']['find'](_0x4988f8)['then'](handleEntityNotFound(_0x4a5c19,null))[_0x9427('0x24')](respondWithResult(_0x4a5c19,null))[_0x9427('0x45')](handleError(_0x4a5c19,null));};exports['create']=function(_0x590673,_0x1d3818){return db[_0x9427('0x3e')]['create'](_0x590673['body'],{})[_0x9427('0x24')](respondWithResult(_0x1d3818,0xc9))[_0x9427('0x45')](handleError(_0x1d3818,null));};exports['update']=function(_0x44a0a2,_0x442755){if(_0x44a0a2[_0x9427('0x46')]['id']){delete _0x44a0a2['body']['id'];}return db[_0x9427('0x3e')]['find']({'where':{'id':_0x44a0a2[_0x9427('0x44')]['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x442755,null))[_0x9427('0x24')](saveUpdates(_0x44a0a2[_0x9427('0x46')],null))['then'](respondWithResult(_0x442755,null))[_0x9427('0x45')](handleError(_0x442755,null));};exports[_0x9427('0x25')]=function(_0xe2cac7,_0x664bdc){return db[_0x9427('0x3e')][_0x9427('0x47')]({'where':{'id':_0xe2cac7['params']['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x664bdc,null))[_0x9427('0x24')](removeEntity(_0x664bdc,null))[_0x9427('0x45')](handleError(_0x664bdc,null));};exports[_0x9427('0x48')]=function(_0x1f3530,_0x453be2){return db[_0x9427('0x3e')][_0x9427('0x48')]()[_0x9427('0x24')](respondWithResult(_0x453be2,null))['catch'](handleError(_0x453be2,null));};
\ No newline at end of file
+var _0x1115=['crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1115,0x1b6));var _0x5111=function(_0x439497,_0x2dea32){_0x439497=_0x439497-0x0;var _0x2d382a=_0x1115[_0x439497];return _0x2d382a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5111('0x0'));var zipdir=require(_0x5111('0x1'));var jsonpatch=require(_0x5111('0x2'));var rp=require(_0x5111('0x3'));var moment=require(_0x5111('0x4'));var BPromise=require(_0x5111('0x5'));var Mustache=require(_0x5111('0x6'));var util=require(_0x5111('0x7'));var path=require(_0x5111('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5111('0x9'));var fs=require('fs');var fs_extra=require(_0x5111('0xa'));var _=require('lodash');var squel=require(_0x5111('0xb'));var crypto=require(_0x5111('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5111('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5111('0xe'));var Papa=require(_0x5111('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5111('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5111('0x11'));var logger=require('../../config/logger')(_0x5111('0x12'));var utils=require(_0x5111('0x13'));var config=require(_0x5111('0x14'));var licenseUtil=require(_0x5111('0x15'));var db=require(_0x5111('0x16'))['db'];function respondWithStatusCode(_0x54f83a,_0x266625){_0x266625=_0x266625||0xcc;return function(_0x14b4e3){if(_0x14b4e3){return _0x54f83a[_0x5111('0x17')](_0x266625);}return _0x54f83a[_0x5111('0x18')](_0x266625)[_0x5111('0x19')]();};}function respondWithResult(_0x62ce44,_0x264703){_0x264703=_0x264703||0xc8;return function(_0x3e60b5){if(_0x3e60b5){return _0x62ce44[_0x5111('0x18')](_0x264703)[_0x5111('0x1a')](_0x3e60b5);}};}function respondWithFilteredResult(_0x77ddfd,_0x45052e){return function(_0x478b68){if(_0x478b68){var _0x1ac606=typeof _0x45052e['offset']==='undefined'&&typeof _0x45052e[_0x5111('0x1b')]===_0x5111('0x1c');var _0x638470=_0x478b68['count'];var _0x367f8d=_0x1ac606?0x0:_0x45052e[_0x5111('0x1d')];var _0x52c614=_0x1ac606?_0x478b68[_0x5111('0x1e')]:_0x45052e[_0x5111('0x1d')]+_0x45052e[_0x5111('0x1b')];var _0x1b3b45;if(_0x52c614>=_0x638470){_0x52c614=_0x638470;_0x1b3b45=0xc8;}else{_0x1b3b45=0xce;}_0x77ddfd['status'](_0x1b3b45);return _0x77ddfd[_0x5111('0x1f')](_0x5111('0x20'),_0x367f8d+'-'+_0x52c614+'/'+_0x638470)[_0x5111('0x1a')](_0x478b68);}return null;};}function patchUpdates(_0x1b3136){return function(_0x22c7cd){try{jsonpatch[_0x5111('0x21')](_0x22c7cd,_0x1b3136,!![]);}catch(_0x3e8de1){return BPromise[_0x5111('0x22')](_0x3e8de1);}return _0x22c7cd[_0x5111('0x23')]();};}function saveUpdates(_0x3a3fae,_0x4b73ce){return function(_0x3f462d){if(_0x3f462d){return _0x3f462d[_0x5111('0x24')](_0x3a3fae)[_0x5111('0x25')](function(_0x5bf534){return _0x5bf534;});}return null;};}function removeEntity(_0x28cc87,_0x20a4f7){return function(_0x2d9446){if(_0x2d9446){return _0x2d9446[_0x5111('0x26')]()[_0x5111('0x25')](function(){_0x28cc87[_0x5111('0x18')](0xcc)[_0x5111('0x19')]();});}};}function handleEntityNotFound(_0x316b39,_0x382bd0){return function(_0x1a5793){if(!_0x1a5793){_0x316b39['sendStatus'](0x194);}return _0x1a5793;};}function handleError(_0x1bdd54,_0x3d6825){_0x3d6825=_0x3d6825||0x1f4;return function(_0x151b67){logger[_0x5111('0x27')](_0x151b67[_0x5111('0x28')]);if(_0x151b67[_0x5111('0x29')]){delete _0x151b67[_0x5111('0x29')];}_0x1bdd54['status'](_0x3d6825)[_0x5111('0x2a')](_0x151b67);};}exports[_0x5111('0x2b')]=function(_0x25a75a,_0x5efec6){var _0xdf9031={},_0x28efc1={},_0x16107a={'count':0x0,'rows':[]};var _0x48379a=_['map'](db[_0x5111('0x2c')]['rawAttributes'],function(_0xbacf9e){return{'name':_0xbacf9e['fieldName'],'type':_0xbacf9e[_0x5111('0x2d')]['key']};});_0x28efc1['model']=_['map'](_0x48379a,_0x5111('0x29'));_0x28efc1[_0x5111('0x2e')]=_[_0x5111('0x2f')](_0x25a75a[_0x5111('0x2e')]);_0x28efc1[_0x5111('0x30')]=_[_0x5111('0x31')](_0x28efc1[_0x5111('0x32')],_0x28efc1['query']);_0xdf9031[_0x5111('0x33')]=_[_0x5111('0x31')](_0x28efc1[_0x5111('0x32')],qs[_0x5111('0x34')](_0x25a75a['query']['fields']));_0xdf9031[_0x5111('0x33')]=_0xdf9031[_0x5111('0x33')][_0x5111('0x35')]?_0xdf9031[_0x5111('0x33')]:_0x28efc1[_0x5111('0x32')];if(!_0x25a75a[_0x5111('0x2e')][_0x5111('0x36')](_0x5111('0x37'))){_0xdf9031['limit']=qs[_0x5111('0x1b')](_0x25a75a[_0x5111('0x2e')][_0x5111('0x1b')]);_0xdf9031['offset']=qs[_0x5111('0x1d')](_0x25a75a[_0x5111('0x2e')][_0x5111('0x1d')]);}_0xdf9031['order']=qs['sort'](_0x25a75a['query'][_0x5111('0x38')]);_0xdf9031[_0x5111('0x39')]=qs[_0x5111('0x30')](_[_0x5111('0x3a')](_0x25a75a[_0x5111('0x2e')],_0x28efc1['filters']),_0x48379a);if(_0x25a75a[_0x5111('0x2e')][_0x5111('0x3b')]){_0xdf9031[_0x5111('0x39')]=_[_0x5111('0x3c')](_0xdf9031['where'],{'$or':_[_0x5111('0x3d')](_0x48379a,function(_0x444d82){if(_0x444d82[_0x5111('0x2d')]!==_0x5111('0x3e')){var _0x2f0224={};_0x2f0224[_0x444d82[_0x5111('0x29')]]={'$like':'%'+_0x25a75a[_0x5111('0x2e')][_0x5111('0x3b')]+'%'};return _0x2f0224;}})});}_0xdf9031=_[_0x5111('0x3c')]({},_0xdf9031,_0x25a75a[_0x5111('0x3f')]);var _0x35c3b5={'where':_0xdf9031[_0x5111('0x39')]};return db[_0x5111('0x2c')]['count'](_0x35c3b5)[_0x5111('0x25')](function(_0xf00f9){_0x16107a['count']=_0xf00f9;if(_0x25a75a[_0x5111('0x2e')][_0x5111('0x40')]){_0xdf9031[_0x5111('0x41')]=[{'all':!![]}];}return db[_0x5111('0x2c')][_0x5111('0x42')](_0xdf9031);})[_0x5111('0x25')](function(_0x1f1534){_0x16107a['rows']=_0x1f1534;return _0x16107a;})[_0x5111('0x25')](respondWithFilteredResult(_0x5efec6,_0xdf9031))[_0x5111('0x43')](handleError(_0x5efec6,null));};exports[_0x5111('0x44')]=function(_0x1c2e17,_0x96893c){var _0x49307f={'raw':!![],'where':{'id':_0x1c2e17[_0x5111('0x45')]['id']}},_0x50a293={};_0x50a293[_0x5111('0x32')]=_['keys'](db[_0x5111('0x2c')][_0x5111('0x46')]);_0x50a293[_0x5111('0x2e')]=_[_0x5111('0x2f')](_0x1c2e17[_0x5111('0x2e')]);_0x50a293[_0x5111('0x30')]=_[_0x5111('0x31')](_0x50a293[_0x5111('0x32')],_0x50a293[_0x5111('0x2e')]);_0x49307f[_0x5111('0x33')]=_['intersection'](_0x50a293['model'],qs[_0x5111('0x34')](_0x1c2e17[_0x5111('0x2e')][_0x5111('0x34')]));_0x49307f[_0x5111('0x33')]=_0x49307f[_0x5111('0x33')][_0x5111('0x35')]?_0x49307f['attributes']:_0x50a293[_0x5111('0x32')];if(_0x1c2e17[_0x5111('0x2e')][_0x5111('0x40')]){_0x49307f[_0x5111('0x41')]=[{'all':!![]}];}_0x49307f=_['merge']({},_0x49307f,_0x1c2e17[_0x5111('0x3f')]);return db[_0x5111('0x2c')][_0x5111('0x47')](_0x49307f)['then'](handleEntityNotFound(_0x96893c,null))[_0x5111('0x25')](respondWithResult(_0x96893c,null))[_0x5111('0x43')](handleError(_0x96893c,null));};exports[_0x5111('0x48')]=function(_0x2d64de,_0x5cd7a5){return db['JscriptyAnswerReport'][_0x5111('0x48')](_0x2d64de['body'],{})['then'](respondWithResult(_0x5cd7a5,0xc9))[_0x5111('0x43')](handleError(_0x5cd7a5,null));};exports[_0x5111('0x24')]=function(_0x4aa934,_0x296f87){if(_0x4aa934[_0x5111('0x49')]['id']){delete _0x4aa934[_0x5111('0x49')]['id'];}return db[_0x5111('0x2c')][_0x5111('0x47')]({'where':{'id':_0x4aa934[_0x5111('0x45')]['id']}})[_0x5111('0x25')](handleEntityNotFound(_0x296f87,null))[_0x5111('0x25')](saveUpdates(_0x4aa934[_0x5111('0x49')],null))[_0x5111('0x25')](respondWithResult(_0x296f87,null))[_0x5111('0x43')](handleError(_0x296f87,null));};exports[_0x5111('0x26')]=function(_0x53d631,_0x79427d){return db[_0x5111('0x2c')][_0x5111('0x47')]({'where':{'id':_0x53d631[_0x5111('0x45')]['id']}})[_0x5111('0x25')](handleEntityNotFound(_0x79427d,null))[_0x5111('0x25')](removeEntity(_0x79427d,null))[_0x5111('0x43')](handleError(_0x79427d,null));};exports['describe']=function(_0x55cba5,_0x13fe1b){return db['JscriptyAnswerReport'][_0x5111('0x4a')]()[_0x5111('0x25')](respondWithResult(_0x13fe1b,null))[_0x5111('0x43')](handleError(_0x13fe1b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x565a=['bluebird','request-promise','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment'];(function(_0x4cedbe,_0x17c16d){var _0x47aee5=function(_0x24150d){while(--_0x24150d){_0x4cedbe['push'](_0x4cedbe['shift']());}};_0x47aee5(++_0x17c16d);}(_0x565a,0xa5));var _0xa565=function(_0x1c9aa9,_0x195286){_0x1c9aa9=_0x1c9aa9-0x0;var _0x3c2713=_0x565a[_0x1c9aa9];return _0x3c2713;};'use strict';var _=require(_0xa565('0x0'));var util=require(_0xa565('0x1'));var logger=require(_0xa565('0x2'))(_0xa565('0x3'));var moment=require(_0xa565('0x4'));var BPromise=require(_0xa565('0x5'));var rp=require(_0xa565('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa565('0x7'));module[_0xa565('0x8')]=function(_0x186925,_0x49d72f){return _0x186925['define'](_0xa565('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf926=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf926,0xd6));var _0x6f92=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xf926[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x6f92('0x0'));var util=require(_0x6f92('0x1'));var logger=require(_0x6f92('0x2'))(_0x6f92('0x3'));var moment=require('moment');var BPromise=require(_0x6f92('0x4'));var rp=require(_0x6f92('0x5'));var fs=require('fs');var path=require(_0x6f92('0x6'));var rimraf=require(_0x6f92('0x7'));var config=require(_0x6f92('0x8'));var attributes=require(_0x6f92('0x9'));module[_0x6f92('0xa')]=function(_0x8bb2e3,_0xd830d4){return _0x8bb2e3[_0x6f92('0xb')](_0x6f92('0xc'),attributes,{'tableName':_0x6f92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5476=['jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5476,0x148));var _0x6547=function(_0x30eb75,_0x49209a){_0x30eb75=_0x30eb75-0x0;var _0x2f134a=_0x5476[_0x30eb75];return _0x2f134a;};'use strict';var _=require(_0x6547('0x0'));var util=require('util');var moment=require(_0x6547('0x1'));var BPromise=require(_0x6547('0x2'));var rs=require(_0x6547('0x3'));var fs=require('fs');var Redis=require(_0x6547('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6547('0x5'));var logger=require(_0x6547('0x6'))('rpc');var config=require(_0x6547('0x7'));var jayson=require(_0x6547('0x8'));var client=jayson[_0x6547('0x9')][_0x6547('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128f0a,_0x139899,_0x5d4c8f){return new BPromise(function(_0x26d346,_0x3e588a){return client['request'](_0x128f0a,_0x5d4c8f)[_0x6547('0xb')](function(_0x4d0265){logger[_0x6547('0xc')](_0x6547('0xd'),_0x139899,_0x6547('0xe'));logger[_0x6547('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x139899,_0x6547('0xe'),JSON[_0x6547('0x10')](_0x4d0265));if(_0x4d0265[_0x6547('0x11')]){if(_0x4d0265['error'][_0x6547('0x12')]===0x1f4){logger['error'](_0x6547('0xd'),_0x139899,_0x4d0265[_0x6547('0x11')]['message']);return _0x3e588a(_0x4d0265['error'][_0x6547('0x13')]);}logger[_0x6547('0x11')](_0x6547('0xd'),_0x139899,_0x4d0265[_0x6547('0x11')][_0x6547('0x13')]);return _0x26d346(_0x4d0265[_0x6547('0x11')][_0x6547('0x13')]);}else{logger[_0x6547('0xc')](_0x6547('0xd'),_0x139899,_0x6547('0xe'));_0x26d346(_0x4d0265[_0x6547('0x14')][_0x6547('0x13')]);}})['catch'](function(_0x32c34a){logger['error'](_0x6547('0xd'),_0x139899,_0x32c34a);_0x3e588a(_0x32c34a);});});}
\ No newline at end of file
+var _0x0f96=['then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x0f96,0x160));var _0x60f9=function(_0x4eed8c,_0x2bc581){_0x4eed8c=_0x4eed8c-0x0;var _0x286c3f=_0x0f96[_0x4eed8c];return _0x286c3f;};'use strict';var _=require(_0x60f9('0x0'));var util=require(_0x60f9('0x1'));var moment=require('moment');var BPromise=require(_0x60f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x60f9('0x3'));var logger=require(_0x60f9('0x4'))('rpc');var config=require(_0x60f9('0x5'));var jayson=require(_0x60f9('0x6'));var client=jayson[_0x60f9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fb57,_0x409aa7,_0x50281d){return new BPromise(function(_0x457a35,_0x418de0){return client[_0x60f9('0x8')](_0x31fb57,_0x50281d)[_0x60f9('0x9')](function(_0x14b62d){logger['info'](_0x60f9('0xa'),_0x409aa7,_0x60f9('0xb'));logger[_0x60f9('0xc')](_0x60f9('0xd'),_0x409aa7,'request\x20sent',JSON['stringify'](_0x14b62d));if(_0x14b62d[_0x60f9('0xe')]){if(_0x14b62d[_0x60f9('0xe')][_0x60f9('0xf')]===0x1f4){logger[_0x60f9('0xe')](_0x60f9('0xa'),_0x409aa7,_0x14b62d[_0x60f9('0xe')][_0x60f9('0x10')]);return _0x418de0(_0x14b62d[_0x60f9('0xe')]['message']);}logger[_0x60f9('0xe')](_0x60f9('0xa'),_0x409aa7,_0x14b62d[_0x60f9('0xe')]['message']);return _0x457a35(_0x14b62d[_0x60f9('0xe')][_0x60f9('0x10')]);}else{logger['info'](_0x60f9('0xa'),_0x409aa7,_0x60f9('0xb'));_0x457a35(_0x14b62d[_0x60f9('0x11')][_0x60f9('0x10')]);}})[_0x60f9('0x12')](function(_0x5b670a){logger[_0x60f9('0xe')](_0x60f9('0xa'),_0x409aa7,_0x5b670a);_0x418de0(_0x5b670a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5cd=['../../config/environment','get','isAuthenticated','/:id','show','/:id/sessions','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x55dbd0,_0x499fe1){var _0x90466f=function(_0x2c9d7f){while(--_0x2c9d7f){_0x55dbd0['push'](_0x55dbd0['shift']());}};_0x90466f(++_0x499fe1);}(_0xb5cd,0xd1));var _0xdb5c=function(_0x379efd,_0x5139f1){_0x379efd=_0x379efd-0x0;var _0x401426=_0xb5cd[_0x379efd];return _0x401426;};'use strict';var multer=require(_0xdb5c('0x0'));var util=require('util');var path=require(_0xdb5c('0x1'));var timeout=require(_0xdb5c('0x2'));var express=require(_0xdb5c('0x3'));var router=express[_0xdb5c('0x4')]();var fs_extra=require(_0xdb5c('0x5'));var auth=require(_0xdb5c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb5c('0x7'));var controller=require('./jscriptyProject.controller');router[_0xdb5c('0x8')]('/',auth[_0xdb5c('0x9')](),controller['index']);router[_0xdb5c('0x8')](_0xdb5c('0xa'),auth[_0xdb5c('0x9')](),controller[_0xdb5c('0xb')]);router[_0xdb5c('0x8')](_0xdb5c('0xc'),auth[_0xdb5c('0x9')](),controller['getSessions']);router['get']('/:id/answers',auth[_0xdb5c('0x9')](),controller[_0xdb5c('0xd')]);router[_0xdb5c('0x8')](_0xdb5c('0xe'),auth['isAuthenticated'](),timeout(_0xdb5c('0xf')),controller[_0xdb5c('0x10')]);router[_0xdb5c('0x11')]('/',auth[_0xdb5c('0x9')](),controller['create']);router['post'](_0xdb5c('0x12'),auth[_0xdb5c('0x9')](),controller[_0xdb5c('0x13')]);router['put'](_0xdb5c('0xa'),auth['isAuthenticated'](),controller[_0xdb5c('0x14')]);router[_0xdb5c('0x15')](_0xdb5c('0xa'),auth['isAuthenticated'](),controller[_0xdb5c('0x16')]);module[_0xdb5c('0x17')]=router;
\ No newline at end of file
+var _0xa643=['getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions'];(function(_0x55067b,_0x2eee6a){var _0x113829=function(_0x5955f4){while(--_0x5955f4){_0x55067b['push'](_0x55067b['shift']());}};_0x113829(++_0x2eee6a);}(_0xa643,0x86));var _0x3a64=function(_0x554448,_0x1eeba0){_0x554448=_0x554448-0x0;var _0x45a1ff=_0xa643[_0x554448];return _0x45a1ff;};'use strict';var multer=require(_0x3a64('0x0'));var util=require(_0x3a64('0x1'));var path=require('path');var timeout=require(_0x3a64('0x2'));var express=require(_0x3a64('0x3'));var router=express[_0x3a64('0x4')]();var fs_extra=require(_0x3a64('0x5'));var auth=require(_0x3a64('0x6'));var interaction=require(_0x3a64('0x7'));var config=require(_0x3a64('0x8'));var controller=require(_0x3a64('0x9'));router[_0x3a64('0xa')]('/',auth[_0x3a64('0xb')](),controller[_0x3a64('0xc')]);router[_0x3a64('0xa')](_0x3a64('0xd'),auth[_0x3a64('0xb')](),controller[_0x3a64('0xe')]);router['get'](_0x3a64('0xf'),auth['isAuthenticated'](),controller[_0x3a64('0x10')]);router[_0x3a64('0xa')](_0x3a64('0x11'),auth[_0x3a64('0xb')](),controller[_0x3a64('0x12')]);router[_0x3a64('0xa')](_0x3a64('0x13'),auth[_0x3a64('0xb')](),timeout(_0x3a64('0x14')),controller[_0x3a64('0x15')]);router[_0x3a64('0x16')]('/',auth[_0x3a64('0xb')](),controller['create']);router[_0x3a64('0x16')]('/:id/clone',auth[_0x3a64('0xb')](),controller['clone']);router['put'](_0x3a64('0xd'),auth[_0x3a64('0xb')](),controller[_0x3a64('0x17')]);router['delete'](_0x3a64('0xd'),auth['isAuthenticated'](),controller[_0x3a64('0x18')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x846d=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','util','exports','STRING','TEXT','setDataValue','formData','stringify','isString'];(function(_0x157ddb,_0x232cdf){var _0x4c8f4e=function(_0x3ddc4a){while(--_0x3ddc4a){_0x157ddb['push'](_0x157ddb['shift']());}};_0x4c8f4e(++_0x232cdf);}(_0x846d,0x1d7));var _0xd846=function(_0x1a5687,_0xc2188f){_0x1a5687=_0x1a5687-0x0;var _0x257d5c=_0x846d[_0x1a5687];return _0x257d5c;};'use strict';var Sequelize=require(_0xd846('0x0'));var _=require('lodash');var util=require(_0xd846('0x1'));module[_0xd846('0x2')]={'name':{'type':Sequelize[_0xd846('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd846('0x4')]('long'),'set':function(_0x3c20ff){if(_['isObjectLike'](_0x3c20ff)){this[_0xd846('0x5')](_0xd846('0x6'),JSON[_0xd846('0x7')](_0x3c20ff));}else if(_[_0xd846('0x8')](_0x3c20ff)){this['setDataValue'](_0xd846('0x6'),_0x3c20ff);}else{this['setDataValue'](_0xd846('0x6'),util[_0xd846('0x9')](_0xd846('0xa'),this[_0xd846('0xb')](_0xd846('0xc'))||'',this[_0xd846('0xb')](_0xd846('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd846('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd846('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe97e=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x2390bf,_0x57ec64){var _0x334bce=function(_0x2e861f){while(--_0x2e861f){_0x2390bf['push'](_0x2390bf['shift']());}};_0x334bce(++_0x57ec64);}(_0xe97e,0x1bf));var _0xee97=function(_0x8d42fb,_0x5b1402){_0x8d42fb=_0x8d42fb-0x0;var _0x264af9=_0xe97e[_0x8d42fb];return _0x264af9;};'use strict';var Sequelize=require(_0xee97('0x0'));var _=require(_0xee97('0x1'));var util=require(_0xee97('0x2'));module[_0xee97('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xee97('0x4')},'description':{'type':Sequelize[_0xee97('0x5')]},'formData':{'type':Sequelize[_0xee97('0x6')](_0xee97('0x7')),'set':function(_0x560b58){if(_[_0xee97('0x8')](_0x560b58)){this[_0xee97('0x9')](_0xee97('0xa'),JSON[_0xee97('0xb')](_0x560b58));}else if(_[_0xee97('0xc')](_0x560b58)){this[_0xee97('0x9')](_0xee97('0xa'),_0x560b58);}else{this[_0xee97('0x9')](_0xee97('0xa'),util[_0xee97('0xd')](_0xee97('0xe'),this[_0xee97('0xf')](_0xee97('0x4'))||'',this[_0xee97('0xf')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xee97('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08ca=['fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Projects','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','toString','indexOf','replace','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','model','query','keys','intersection','attributes'];(function(_0x75903a,_0x4ae82e){var _0x38b122=function(_0x4c7555){while(--_0x4c7555){_0x75903a['push'](_0x75903a['shift']());}};_0x38b122(++_0x4ae82e);}(_0x08ca,0xb2));var _0xa08c=function(_0x3e0e4a,_0x10b5e9){_0x3e0e4a=_0x3e0e4a-0x0;var _0x147f71=_0x08ca[_0x3e0e4a];return _0x147f71;};'use strict';var emlformat=require(_0xa08c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa08c('0x1'));var jsonpatch=require(_0xa08c('0x2'));var rp=require(_0xa08c('0x3'));var moment=require(_0xa08c('0x4'));var BPromise=require(_0xa08c('0x5'));var Mustache=require(_0xa08c('0x6'));var util=require(_0xa08c('0x7'));var path=require(_0xa08c('0x8'));var sox=require(_0xa08c('0x9'));var csv=require(_0xa08c('0xa'));var ejs=require(_0xa08c('0xb'));var fs=require('fs');var fs_extra=require(_0xa08c('0xc'));var _=require('lodash');var squel=require(_0xa08c('0xd'));var crypto=require(_0xa08c('0xe'));var jsforce=require(_0xa08c('0xf'));var deskjs=require(_0xa08c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa08c('0x11'));var Papa=require('papaparse');var Redis=require(_0xa08c('0x12'));var authService=require(_0xa08c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa08c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa08c('0x15'));var utils=require(_0xa08c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa08c('0x17'));var db=require(_0xa08c('0x18'))['db'];function respondWithStatusCode(_0x441998,_0x4ed55f){_0x4ed55f=_0x4ed55f||0xcc;return function(_0x1fda54){if(_0x1fda54){return _0x441998[_0xa08c('0x19')](_0x4ed55f);}return _0x441998['status'](_0x4ed55f)[_0xa08c('0x1a')]();};}function respondWithResult(_0x2e5629,_0x15186a){_0x15186a=_0x15186a||0xc8;return function(_0x306435){if(_0x306435){return _0x2e5629[_0xa08c('0x1b')](_0x15186a)[_0xa08c('0x1c')](_0x306435);}};}function respondWithFilteredResult(_0xff73e7,_0x26e44e){return function(_0x1a2d32){if(_0x1a2d32){var _0x41d1f0=typeof _0x26e44e['offset']===_0xa08c('0x1d')&&typeof _0x26e44e[_0xa08c('0x1e')]===_0xa08c('0x1d');var _0x42c5ea=_0x1a2d32[_0xa08c('0x1f')];var _0x1b2097=_0x41d1f0?0x0:_0x26e44e[_0xa08c('0x20')];var _0x3ea4f3=_0x41d1f0?_0x1a2d32[_0xa08c('0x1f')]:_0x26e44e[_0xa08c('0x20')]+_0x26e44e[_0xa08c('0x1e')];var _0x294a75;if(_0x3ea4f3>=_0x42c5ea){_0x3ea4f3=_0x42c5ea;_0x294a75=0xc8;}else{_0x294a75=0xce;}_0xff73e7['status'](_0x294a75);return _0xff73e7[_0xa08c('0x21')]('Content-Range',_0x1b2097+'-'+_0x3ea4f3+'/'+_0x42c5ea)[_0xa08c('0x1c')](_0x1a2d32);}return null;};}function patchUpdates(_0x43236b){return function(_0x153b1a){try{jsonpatch[_0xa08c('0x22')](_0x153b1a,_0x43236b,!![]);}catch(_0x5dac00){return BPromise[_0xa08c('0x23')](_0x5dac00);}return _0x153b1a[_0xa08c('0x24')]();};}function saveUpdates(_0x500bd4,_0x456d45){return function(_0x22ed38){if(_0x22ed38){return _0x22ed38[_0xa08c('0x25')](_0x500bd4)['then'](function(_0x34fa7b){return _0x34fa7b;});}return null;};}function removeEntity(_0x5473b8,_0x561b0c){return function(_0x3c46fc){if(_0x3c46fc){return _0x3c46fc[_0xa08c('0x26')]()['then'](function(){var _0x381821=_0x3c46fc[_0xa08c('0x27')]({'plain':!![]});var _0x491cb0='Projects';return db[_0xa08c('0x28')][_0xa08c('0x26')]({'where':{'type':_0x491cb0,'resourceId':_0x381821['id']}})[_0xa08c('0x29')](function(){return _0x3c46fc;});})['then'](function(){_0x5473b8[_0xa08c('0x1b')](0xcc)[_0xa08c('0x1a')]();});}};}function handleEntityNotFound(_0x22dc7c,_0x415291){return function(_0x2dbd27){if(!_0x2dbd27){_0x22dc7c[_0xa08c('0x19')](0x194);}return _0x2dbd27;};}function handleError(_0x494823,_0x5bb673){_0x5bb673=_0x5bb673||0x1f4;return function(_0x22260e){logger['error'](_0x22260e[_0xa08c('0x2a')]);if(_0x22260e[_0xa08c('0x2b')]){delete _0x22260e[_0xa08c('0x2b')];}_0x494823[_0xa08c('0x1b')](_0x5bb673)[_0xa08c('0x2c')](_0x22260e);};}exports[_0xa08c('0x2d')]=function(_0x3e8d8d,_0x9eaddd){var _0x35d3bc={},_0x56c0ca={},_0x300430={'count':0x0,'rows':[]};var _0x4ea6fb=_[_0xa08c('0x2e')](db[_0xa08c('0x2f')][_0xa08c('0x30')],function(_0x5780de){return{'name':_0x5780de['fieldName'],'type':_0x5780de[_0xa08c('0x31')][_0xa08c('0x32')]};});_0x56c0ca[_0xa08c('0x33')]=_[_0xa08c('0x2e')](_0x4ea6fb,_0xa08c('0x2b'));_0x56c0ca[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3e8d8d[_0xa08c('0x34')]);_0x56c0ca['filters']=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],_0x56c0ca['query']);_0x35d3bc[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x3e8d8d[_0xa08c('0x34')]['fields']));_0x35d3bc[_0xa08c('0x37')]=_0x35d3bc[_0xa08c('0x37')][_0xa08c('0x39')]?_0x35d3bc[_0xa08c('0x37')]:_0x56c0ca[_0xa08c('0x33')];if(!_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x35d3bc[_0xa08c('0x1e')]=qs['limit'](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x35d3bc[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x35d3bc['order']=qs[_0xa08c('0x3c')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x35d3bc['where']=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x3e8d8d[_0xa08c('0x34')],_0x56c0ca[_0xa08c('0x3d')]),_0x4ea6fb);if(_0x3e8d8d['query'][_0xa08c('0x3f')]){_0x35d3bc['where']=_[_0xa08c('0x40')](_0x35d3bc[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4ea6fb,function(_0x58a43b){if(_0x58a43b[_0xa08c('0x31')]!==_0xa08c('0x42')){var _0x12e787={};_0x12e787[_0x58a43b[_0xa08c('0x2b')]]={'$like':'%'+_0x3e8d8d['query'][_0xa08c('0x3f')]+'%'};return _0x12e787;}})});}_0x35d3bc=_[_0xa08c('0x40')]({},_0x35d3bc,_0x3e8d8d[_0xa08c('0x43')]);var _0x19cf46={'where':_0x35d3bc['where']};return db[_0xa08c('0x2f')][_0xa08c('0x1f')](_0x19cf46)[_0xa08c('0x29')](function(_0x39b313){_0x300430[_0xa08c('0x1f')]=_0x39b313;if(_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x44')]){_0x35d3bc[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyProject'][_0xa08c('0x46')](_0x35d3bc);})['then'](function(_0x250cea){_0x300430[_0xa08c('0x47')]=_0x250cea;return _0x300430;})[_0xa08c('0x29')](respondWithFilteredResult(_0x9eaddd,_0x35d3bc))[_0xa08c('0x48')](handleError(_0x9eaddd,null));};exports['show']=function(_0x3b7e00,_0x37d10b){var _0x4ca408={'raw':![],'where':{'id':_0x3b7e00['params']['id']}},_0x5111d6={};_0x5111d6[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')][_0xa08c('0x30')]);_0x5111d6[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3b7e00[_0xa08c('0x34')]);_0x5111d6['filters']=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],_0x5111d6[_0xa08c('0x34')]);_0x4ca408[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],qs['fields'](_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x38')]));_0x4ca408[_0xa08c('0x37')]=_0x4ca408[_0xa08c('0x37')][_0xa08c('0x39')]?_0x4ca408[_0xa08c('0x37')]:_0x5111d6[_0xa08c('0x33')];if(_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4ca408[_0xa08c('0x45')]=[{'all':!![]}];}_0x4ca408=_[_0xa08c('0x40')]({},_0x4ca408,_0x3b7e00[_0xa08c('0x43')]);return db['JscriptyProject'][_0xa08c('0x49')](_0x4ca408)[_0xa08c('0x29')](handleEntityNotFound(_0x37d10b,null))[_0xa08c('0x29')](respondWithResult(_0x37d10b,null))['catch'](handleError(_0x37d10b,null));};exports[_0xa08c('0x4a')]=function(_0x186fce,_0x1c8234){return db['JscriptyProject'][_0xa08c('0x4a')](_0x186fce[_0xa08c('0x4b')],{})[_0xa08c('0x29')](function(_0x160b22){var _0x225e28=_0x186fce[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x225e28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x225e28[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0x303396=_0x160b22['get']({'plain':!![]});var _0x586885='Projects';return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x586885,'userProfileId':_0x225e28[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x39f70f){if(_0x39f70f&&_0x39f70f[_0xa08c('0x50')]===0x0){return db['UserProfileResource'][_0xa08c('0x4a')]({'name':_0x303396[_0xa08c('0x2b')],'resourceId':_0x303396['id'],'type':_0x39f70f['name'],'sectionId':_0x39f70f['id']},{})['then'](function(){return _0x160b22;});}else{return _0x160b22;}})[_0xa08c('0x48')](function(_0x4544d6){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x4544d6);throw _0x4544d6;});}return _0x160b22;})[_0xa08c('0x29')](respondWithResult(_0x1c8234,0xc9))[_0xa08c('0x48')](handleError(_0x1c8234,null));};exports[_0xa08c('0x53')]=function(_0x437e35,_0x1acc1e){var _0xde5fe8={'where':{'id':_0x437e35[_0xa08c('0x54')]['id']}},_0x59a387={};_0x59a387[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')]['rawAttributes']);_0xde5fe8['attributes']=_[_0xa08c('0x36')](_0x59a387[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x437e35[_0xa08c('0x34')][_0xa08c('0x38')]));_0xde5fe8[_0xa08c('0x37')]=_0xde5fe8[_0xa08c('0x37')][_0xa08c('0x39')]?_0xde5fe8['attributes']:_0x59a387[_0xa08c('0x33')];if(_0x437e35[_0xa08c('0x34')][_0xa08c('0x44')]){_0xde5fe8[_0xa08c('0x45')]=[{'all':!![]}];}_0xde5fe8=_[_0xa08c('0x40')]({},_0xde5fe8,_0x437e35[_0xa08c('0x43')]);return db[_0xa08c('0x2f')][_0xa08c('0x49')](_0xde5fe8)[_0xa08c('0x29')](handleEntityNotFound(_0x1acc1e,null))[_0xa08c('0x29')](function(_0x1271a4){if(_0x1271a4){var _0x492ff1=_0x1271a4[_0xa08c('0x27')]({'plain':!![]});_0x492ff1=qs['omit'](_0x492ff1,['id',_0xa08c('0x55'),_0xa08c('0x56')]);_0x437e35[_0xa08c('0x4b')]=_[_0xa08c('0x57')](_0x437e35['body'],['id',_0xa08c('0x55'),'updatedAt']);return db['JscriptyProject'][_0xa08c('0x4a')](_['merge'](_0x492ff1,_0x437e35[_0xa08c('0x4b')]),{'include':_0x437e35[_0xa08c('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xa08c('0x29')](function(_0x544745){var _0x85a661=_0x437e35[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x85a661)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85a661[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0xed8059=_0x544745[_0xa08c('0x27')]({'plain':!![]});var _0x1029f7=_0xa08c('0x58');return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x1029f7,'userProfileId':_0x85a661[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x184506){if(_0x184506&&_0x184506['autoAssociation']===0x0){return db[_0xa08c('0x28')][_0xa08c('0x4a')]({'name':_0xed8059[_0xa08c('0x2b')],'resourceId':_0xed8059['id'],'type':_0x184506[_0xa08c('0x2b')],'sectionId':_0x184506['id']},{})[_0xa08c('0x29')](function(){return _0x544745;});}else{return _0x544745;}})['catch'](function(_0x49d5ef){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x49d5ef);throw _0x49d5ef;});}return _0x544745;});}})['then'](respondWithResult(_0x1acc1e,0xc9))['catch'](handleError(_0x1acc1e,null));};exports[_0xa08c('0x25')]=function(_0x25248d,_0x2f296a){if(_0x25248d[_0xa08c('0x4b')]['id']){delete _0x25248d[_0xa08c('0x4b')]['id'];}return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x25248d[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2f296a,null))[_0xa08c('0x29')](saveUpdates(_0x25248d[_0xa08c('0x4b')],null))[_0xa08c('0x29')](respondWithResult(_0x2f296a,null))[_0xa08c('0x48')](handleError(_0x2f296a,null));};exports['destroy']=function(_0x565b71,_0x3d9715){return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x565b71[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x3d9715,null))['then'](removeEntity(_0x3d9715,null))[_0xa08c('0x48')](handleError(_0x3d9715,null));};exports[_0xa08c('0x59')]=function(_0x98a2f0,_0x1207bb,_0x102c39){var _0x4c14a0={'raw':!![],'where':{}};var _0x358104={};var _0x42d715={'count':0x0,'rows':[]};return db[_0xa08c('0x2f')][_0xa08c('0x5a')]({'where':{'id':_0x98a2f0[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x1207bb,null))['then'](function(_0x18473f){if(_0x18473f){_0x358104[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5b')][_0xa08c('0x30')]);_0x358104[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x98a2f0[_0xa08c('0x34')]);_0x358104[_0xa08c('0x3d')]=_['intersection'](_0x358104[_0xa08c('0x33')],_0x358104[_0xa08c('0x34')]);_0x4c14a0[_0xa08c('0x37')]=_['intersection'](_0x358104['model'],qs[_0xa08c('0x38')](_0x98a2f0['query'][_0xa08c('0x38')]));_0x4c14a0[_0xa08c('0x37')]=_0x4c14a0['attributes'][_0xa08c('0x39')]?_0x4c14a0[_0xa08c('0x37')]:_0x358104[_0xa08c('0x33')];if(!_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x4c14a0[_0xa08c('0x1e')]=qs[_0xa08c('0x1e')](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x4c14a0[_0xa08c('0x20')]=qs['offset'](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x4c14a0[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x98a2f0[_0xa08c('0x34')]['sort']);_0x4c14a0[_0xa08c('0x41')]=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x98a2f0[_0xa08c('0x34')],_0x358104[_0xa08c('0x3d')]));_0x4c14a0[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x18473f['id'];if(_0x98a2f0['query'][_0xa08c('0x3f')]){_0x4c14a0[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x4c14a0[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4c14a0['attributes'],function(_0x3d14d8){var _0x2e563a={};_0x2e563a[_0x3d14d8]={'$like':'%'+_0x98a2f0['query'][_0xa08c('0x3f')]+'%'};return _0x2e563a;})});}_0x4c14a0=_[_0xa08c('0x40')]({},_0x4c14a0,_0x98a2f0[_0xa08c('0x43')]);return db[_0xa08c('0x5b')][_0xa08c('0x1f')]({'where':_0x4c14a0[_0xa08c('0x41')]})['then'](function(_0x48009a){_0x42d715[_0xa08c('0x1f')]=_0x48009a;if(_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4c14a0[_0xa08c('0x45')]=[{'all':!![]}];}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x4c14a0);})[_0xa08c('0x29')](function(_0x4b6116){_0x42d715[_0xa08c('0x47')]=_0x4b6116;return _0x42d715;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x1207bb,_0x4c14a0))['catch'](handleError(_0x1207bb,null));};exports['getAnswers']=function(_0x2949de,_0x2dd1fa,_0x128ba1){var _0x1e5491={'raw':!![],'where':{}};var _0x107c27={};var _0x23ec21={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2949de[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2dd1fa,null))[_0xa08c('0x29')](function(_0x4fbffa){if(_0x4fbffa){_0x107c27[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5e')][_0xa08c('0x30')]);_0x107c27[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x2949de[_0xa08c('0x34')]);_0x107c27[_0xa08c('0x3d')]=_[_0xa08c('0x36')](_0x107c27[_0xa08c('0x33')],_0x107c27['query']);_0x1e5491[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x107c27['model'],qs[_0xa08c('0x38')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x38')]));_0x1e5491[_0xa08c('0x37')]=_0x1e5491[_0xa08c('0x37')][_0xa08c('0x39')]?_0x1e5491[_0xa08c('0x37')]:_0x107c27[_0xa08c('0x33')];if(!_0x2949de[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x1e5491['limit']=qs['limit'](_0x2949de[_0xa08c('0x34')]['limit']);_0x1e5491[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x1e5491[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x1e5491[_0xa08c('0x41')]=qs['filters'](_[_0xa08c('0x3e')](_0x2949de[_0xa08c('0x34')],_0x107c27[_0xa08c('0x3d')]));_0x1e5491[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x4fbffa['id'];if(_0x2949de[_0xa08c('0x34')][_0xa08c('0x3f')]){_0x1e5491[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x1e5491[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x1e5491[_0xa08c('0x37')],function(_0x442ce7){var _0x13ab6a={};_0x13ab6a[_0x442ce7]={'$like':'%'+_0x2949de['query']['filter']+'%'};return _0x13ab6a;})});}_0x1e5491=_['merge']({},_0x1e5491,_0x2949de[_0xa08c('0x43')]);return db[_0xa08c('0x5e')]['count']({'where':_0x1e5491['where']})['then'](function(_0x3309f0){_0x23ec21[_0xa08c('0x1f')]=_0x3309f0;if(_0x2949de[_0xa08c('0x34')]['includeAll']){_0x1e5491[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa08c('0x46')](_0x1e5491);})[_0xa08c('0x29')](function(_0x4a015f){_0x23ec21['rows']=_0x4a015f;return _0x23ec21;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x2dd1fa,_0x1e5491))[_0xa08c('0x48')](handleError(_0x2dd1fa,null));};function char(_0x252d4c){return'number'===typeof _0x252d4c?String['fromCharCode'][_0xa08c('0x22')](null,arguments):_0x252d4c;}function needsEncapsulation(_0x4a1f5c){return!!_0x4a1f5c&&(_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xd))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xa))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x4a1f5c['toString']()[_0xa08c('0x60')](char(0x22))>=0x0);}function encapsulate(_0x53c520){var _0x3b808d=char(0x22),_0x50a1da='\x5c'+char(0x22),_0x5b9ed5=_0x53c520[_0xa08c('0x5f')]()[_0xa08c('0x61')](new RegExp(_0x3b808d,'g'),_0x50a1da);return _0x3b808d+_0x5b9ed5+_0x3b808d;}exports['getSummary']=function(_0x2ef363,_0x412a10,_0x4b7038){var _0x3c1a39,_0x244f3f;var _0x44ebbb={'where':{'ProjectId':_0x2ef363[_0xa08c('0x54')]['id']}};if(_0x2ef363['query']['startTime']){_0x44ebbb[_0xa08c('0x41')]['starttime']=JSON[_0xa08c('0x62')](_0x2ef363['query'][_0xa08c('0x63')]);}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x44ebbb)[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x1374bc){if(_0x1374bc){_0x3c1a39=_0x1374bc;return db[_0xa08c('0x64')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x3c1a39,'id')},'ProjectId':_0x2ef363['params']['id']},'order':_0xa08c('0x65')});}})[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x10058a){if(_0x10058a){_0x244f3f=_0x10058a;var _0x55a278={};for(var _0x5559b6=0x0,_0x37e501=_0x244f3f[_0xa08c('0x39')];_0x5559b6<_0x37e501;_0x5559b6++){if(!_0x55a278['hasOwnProperty'](_0x244f3f[_0x5559b6][_0xa08c('0x66')])){_0x55a278[_0x244f3f[_0x5559b6][_0xa08c('0x66')]]=needsEncapsulation(_0x244f3f[_0x5559b6][_0xa08c('0x67')])?encapsulate(_0x244f3f[_0x5559b6][_0xa08c('0x67')]):_0x244f3f[_0x5559b6][_0xa08c('0x67')];}}var _0x5a208e=[],_0x479f6a={};for(var _0x23a17a=0x0,_0x5c7843=_0x3c1a39[_0xa08c('0x39')];_0x23a17a<_0x5c7843;_0x23a17a++){_0x479f6a={'ProjectId':_0x2ef363['params']['id'],'SessionId':_0x3c1a39[_0x23a17a]['id'],'StartTime':moment(_0x3c1a39[_0x23a17a][_0xa08c('0x68')])[_0xa08c('0x69')](_0xa08c('0x6a'))};for(var _0x419595=0x0,_0x2602a3=_0x244f3f[_0xa08c('0x39')];_0x419595<_0x2602a3;_0x419595++){if(_0x244f3f[_0x419595][_0xa08c('0x6b')]==_0x3c1a39[_0x23a17a]['id']&&_0x55a278[_0xa08c('0x3a')](_0x244f3f[_0x419595][_0xa08c('0x66')])){_0x479f6a[_0x55a278[_0x244f3f[_0x419595]['questionId']]]=_0x244f3f[_0x419595][_0xa08c('0x6c')];}}for(var _0x3ae665 in _0x55a278){if(!_0x479f6a[_0xa08c('0x3a')](_0x55a278[_0x3ae665])){_0x479f6a[_0x55a278[_0x3ae665]]=null;}}_0x5a208e[_0xa08c('0x6d')](_0x479f6a);}return _0x5a208e;}})['then'](function(_0x10c02b){if(!_['isEmpty'](_0x10c02b)){var _0x3d5c77=toCsv(_0x10c02b);var _0x2ae318=Date[_0xa08c('0x6e')]();fs['writeFileSync'](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318),_0x3d5c77);_0x412a10[_0xa08c('0x70')]('Content-disposition','attachment;\x20filename='+util[_0xa08c('0x69')](_0xa08c('0x71'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));_0x412a10[_0xa08c('0x70')](_0xa08c('0x72'),_0xa08c('0x73'));return _0x412a10[_0xa08c('0x74')](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));}else{return _0x412a10[_0xa08c('0x19')](0xcc);}})['catch'](handleError(_0x412a10,null));};
\ No newline at end of file
+var _0xca73=['download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','where','pick','filter','merge','includeAll','include','JscriptyProject','findAll','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','params','createdAt','updatedAt','omit','body','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','hasOwnProperty','order','sort','ProjectId','options','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','rows','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','SessionId','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv'];(function(_0x788c48,_0x5c0e5e){var _0x299c14=function(_0x6be4c){while(--_0x6be4c){_0x788c48['push'](_0x788c48['shift']());}};_0x299c14(++_0x5c0e5e);}(_0xca73,0x1ee));var _0x3ca7=function(_0x1d3fa3,_0x491bac){_0x1d3fa3=_0x1d3fa3-0x0;var _0x222cda=_0xca73[_0x1d3fa3];return _0x222cda;};'use strict';var emlformat=require(_0x3ca7('0x0'));var rimraf=require(_0x3ca7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ca7('0x2'));var rp=require(_0x3ca7('0x3'));var moment=require(_0x3ca7('0x4'));var BPromise=require(_0x3ca7('0x5'));var Mustache=require(_0x3ca7('0x6'));var util=require(_0x3ca7('0x7'));var path=require(_0x3ca7('0x8'));var sox=require(_0x3ca7('0x9'));var csv=require(_0x3ca7('0xa'));var ejs=require(_0x3ca7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ca7('0xc'));var squel=require(_0x3ca7('0xd'));var crypto=require(_0x3ca7('0xe'));var jsforce=require(_0x3ca7('0xf'));var deskjs=require(_0x3ca7('0x10'));var toCsv=require(_0x3ca7('0xa'));var querystring=require('querystring');var Papa=require(_0x3ca7('0x11'));var Redis=require(_0x3ca7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3ca7('0x13'));var hardwareService=require(_0x3ca7('0x14'));var logger=require(_0x3ca7('0x15'))(_0x3ca7('0x16'));var utils=require(_0x3ca7('0x17'));var config=require(_0x3ca7('0x18'));var licenseUtil=require(_0x3ca7('0x19'));var db=require(_0x3ca7('0x1a'))['db'];function respondWithStatusCode(_0xf1c569,_0x2d490){_0x2d490=_0x2d490||0xcc;return function(_0x3411c2){if(_0x3411c2){return _0xf1c569[_0x3ca7('0x1b')](_0x2d490);}return _0xf1c569[_0x3ca7('0x1c')](_0x2d490)['end']();};}function respondWithResult(_0x21688c,_0x45089e){_0x45089e=_0x45089e||0xc8;return function(_0x4a5594){if(_0x4a5594){return _0x21688c[_0x3ca7('0x1c')](_0x45089e)[_0x3ca7('0x1d')](_0x4a5594);}};}function respondWithFilteredResult(_0x47001c,_0x30d7ac){return function(_0x5c5d2d){if(_0x5c5d2d){var _0x3d3836=typeof _0x30d7ac['offset']===_0x3ca7('0x1e')&&typeof _0x30d7ac[_0x3ca7('0x1f')]===_0x3ca7('0x1e');var _0x56c024=_0x5c5d2d[_0x3ca7('0x20')];var _0x549f79=_0x3d3836?0x0:_0x30d7ac['offset'];var _0x51c0b6=_0x3d3836?_0x5c5d2d['count']:_0x30d7ac[_0x3ca7('0x21')]+_0x30d7ac['limit'];var _0x481781;if(_0x51c0b6>=_0x56c024){_0x51c0b6=_0x56c024;_0x481781=0xc8;}else{_0x481781=0xce;}_0x47001c[_0x3ca7('0x1c')](_0x481781);return _0x47001c[_0x3ca7('0x22')](_0x3ca7('0x23'),_0x549f79+'-'+_0x51c0b6+'/'+_0x56c024)[_0x3ca7('0x1d')](_0x5c5d2d);}return null;};}function patchUpdates(_0x2f28cb){return function(_0x54770b){try{jsonpatch[_0x3ca7('0x24')](_0x54770b,_0x2f28cb,!![]);}catch(_0x1f1fd2){return BPromise[_0x3ca7('0x25')](_0x1f1fd2);}return _0x54770b[_0x3ca7('0x26')]();};}function saveUpdates(_0x55b642,_0x4e7dd5){return function(_0x43731f){if(_0x43731f){return _0x43731f[_0x3ca7('0x27')](_0x55b642)[_0x3ca7('0x28')](function(_0x480711){return _0x480711;});}return null;};}function removeEntity(_0x3f76cc,_0x1fb48d){return function(_0x26e513){if(_0x26e513){return _0x26e513[_0x3ca7('0x29')]()['then'](function(){var _0x4853ea=_0x26e513[_0x3ca7('0x2a')]({'plain':!![]});var _0x37fbf9=_0x3ca7('0x2b');return db[_0x3ca7('0x2c')][_0x3ca7('0x29')]({'where':{'type':_0x37fbf9,'resourceId':_0x4853ea['id']}})[_0x3ca7('0x28')](function(){return _0x26e513;});})[_0x3ca7('0x28')](function(){_0x3f76cc[_0x3ca7('0x1c')](0xcc)[_0x3ca7('0x2d')]();});}};}function handleEntityNotFound(_0x236e7d,_0x1d5f95){return function(_0x7d9d84){if(!_0x7d9d84){_0x236e7d[_0x3ca7('0x1b')](0x194);}return _0x7d9d84;};}function handleError(_0x4c4026,_0x3b5c11){_0x3b5c11=_0x3b5c11||0x1f4;return function(_0x308541){logger[_0x3ca7('0x2e')](_0x308541[_0x3ca7('0x2f')]);if(_0x308541['name']){delete _0x308541[_0x3ca7('0x30')];}_0x4c4026['status'](_0x3b5c11)['send'](_0x308541);};}exports[_0x3ca7('0x31')]=function(_0x5f24ac,_0x3e5bfc){var _0x188c42={},_0x1a579d={},_0x58d43d={'count':0x0,'rows':[]};var _0x5754f9=_[_0x3ca7('0x32')](db['JscriptyProject'][_0x3ca7('0x33')],function(_0x4de316){return{'name':_0x4de316[_0x3ca7('0x34')],'type':_0x4de316[_0x3ca7('0x35')][_0x3ca7('0x36')]};});_0x1a579d['model']=_[_0x3ca7('0x32')](_0x5754f9,_0x3ca7('0x30'));_0x1a579d['query']=_[_0x3ca7('0x37')](_0x5f24ac[_0x3ca7('0x38')]);_0x1a579d[_0x3ca7('0x39')]=_[_0x3ca7('0x3a')](_0x1a579d[_0x3ca7('0x3b')],_0x1a579d['query']);_0x188c42[_0x3ca7('0x3c')]=_['intersection'](_0x1a579d[_0x3ca7('0x3b')],qs['fields'](_0x5f24ac[_0x3ca7('0x38')][_0x3ca7('0x3d')]));_0x188c42[_0x3ca7('0x3c')]=_0x188c42['attributes']['length']?_0x188c42['attributes']:_0x1a579d[_0x3ca7('0x3b')];if(!_0x5f24ac[_0x3ca7('0x38')]['hasOwnProperty'](_0x3ca7('0x3e'))){_0x188c42['limit']=qs[_0x3ca7('0x1f')](_0x5f24ac[_0x3ca7('0x38')][_0x3ca7('0x1f')]);_0x188c42[_0x3ca7('0x21')]=qs[_0x3ca7('0x21')](_0x5f24ac[_0x3ca7('0x38')]['offset']);}_0x188c42['order']=qs['sort'](_0x5f24ac[_0x3ca7('0x38')]['sort']);_0x188c42[_0x3ca7('0x3f')]=qs[_0x3ca7('0x39')](_[_0x3ca7('0x40')](_0x5f24ac[_0x3ca7('0x38')],_0x1a579d['filters']),_0x5754f9);if(_0x5f24ac[_0x3ca7('0x38')][_0x3ca7('0x41')]){_0x188c42[_0x3ca7('0x3f')]=_[_0x3ca7('0x42')](_0x188c42['where'],{'$or':_[_0x3ca7('0x32')](_0x5754f9,function(_0x154983){if(_0x154983[_0x3ca7('0x35')]!=='VIRTUAL'){var _0x5ceb26={};_0x5ceb26[_0x154983['name']]={'$like':'%'+_0x5f24ac[_0x3ca7('0x38')][_0x3ca7('0x41')]+'%'};return _0x5ceb26;}})});}_0x188c42=_['merge']({},_0x188c42,_0x5f24ac['options']);var _0xb11b58={'where':_0x188c42[_0x3ca7('0x3f')]};return db['JscriptyProject'][_0x3ca7('0x20')](_0xb11b58)[_0x3ca7('0x28')](function(_0x1dc877){_0x58d43d[_0x3ca7('0x20')]=_0x1dc877;if(_0x5f24ac[_0x3ca7('0x38')][_0x3ca7('0x43')]){_0x188c42[_0x3ca7('0x44')]=[{'all':!![]}];}return db[_0x3ca7('0x45')][_0x3ca7('0x46')](_0x188c42);})['then'](function(_0x23a264){_0x58d43d['rows']=_0x23a264;return _0x58d43d;})[_0x3ca7('0x28')](respondWithFilteredResult(_0x3e5bfc,_0x188c42))[_0x3ca7('0x47')](handleError(_0x3e5bfc,null));};exports[_0x3ca7('0x48')]=function(_0x179fcb,_0x19ce44){var _0x30f597={'raw':![],'where':{'id':_0x179fcb['params']['id']}},_0x4fa192={};_0x4fa192[_0x3ca7('0x3b')]=_['keys'](db[_0x3ca7('0x45')][_0x3ca7('0x33')]);_0x4fa192['query']=_[_0x3ca7('0x37')](_0x179fcb[_0x3ca7('0x38')]);_0x4fa192[_0x3ca7('0x39')]=_[_0x3ca7('0x3a')](_0x4fa192[_0x3ca7('0x3b')],_0x4fa192[_0x3ca7('0x38')]);_0x30f597['attributes']=_[_0x3ca7('0x3a')](_0x4fa192['model'],qs[_0x3ca7('0x3d')](_0x179fcb[_0x3ca7('0x38')][_0x3ca7('0x3d')]));_0x30f597['attributes']=_0x30f597[_0x3ca7('0x3c')][_0x3ca7('0x49')]?_0x30f597['attributes']:_0x4fa192[_0x3ca7('0x3b')];if(_0x179fcb[_0x3ca7('0x38')][_0x3ca7('0x43')]){_0x30f597[_0x3ca7('0x44')]=[{'all':!![]}];}_0x30f597=_[_0x3ca7('0x42')]({},_0x30f597,_0x179fcb['options']);return db[_0x3ca7('0x45')][_0x3ca7('0x4a')](_0x30f597)[_0x3ca7('0x28')](handleEntityNotFound(_0x19ce44,null))[_0x3ca7('0x28')](respondWithResult(_0x19ce44,null))[_0x3ca7('0x47')](handleError(_0x19ce44,null));};exports['create']=function(_0x4dd860,_0x17eb4d){return db[_0x3ca7('0x45')][_0x3ca7('0x4b')](_0x4dd860['body'],{})['then'](function(_0x1fa8bb){var _0x144a5f=_0x4dd860[_0x3ca7('0x4c')]['get']({'plain':!![]});if(!_0x144a5f)throw new Error(_0x3ca7('0x4d'));if(_0x144a5f['role']===_0x3ca7('0x4c')){var _0x30e98b=_0x1fa8bb['get']({'plain':!![]});var _0x38b673=_0x3ca7('0x2b');return db['UserProfileSection'][_0x3ca7('0x4a')]({'where':{'name':_0x38b673,'userProfileId':_0x144a5f[_0x3ca7('0x4e')]},'raw':!![]})[_0x3ca7('0x28')](function(_0x2a65ec){if(_0x2a65ec&&_0x2a65ec[_0x3ca7('0x4f')]===0x0){return db[_0x3ca7('0x2c')][_0x3ca7('0x4b')]({'name':_0x30e98b[_0x3ca7('0x30')],'resourceId':_0x30e98b['id'],'type':_0x2a65ec[_0x3ca7('0x30')],'sectionId':_0x2a65ec['id']},{})[_0x3ca7('0x28')](function(){return _0x1fa8bb;});}else{return _0x1fa8bb;}})['catch'](function(_0x593229){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x593229);throw _0x593229;});}return _0x1fa8bb;})['then'](respondWithResult(_0x17eb4d,0xc9))[_0x3ca7('0x47')](handleError(_0x17eb4d,null));};exports['clone']=function(_0x1a2b47,_0x185ac0){var _0x476c17={'where':{'id':_0x1a2b47[_0x3ca7('0x50')]['id']}},_0x75329d={};_0x75329d[_0x3ca7('0x3b')]=_[_0x3ca7('0x37')](db[_0x3ca7('0x45')][_0x3ca7('0x33')]);_0x476c17['attributes']=_['intersection'](_0x75329d[_0x3ca7('0x3b')],qs[_0x3ca7('0x3d')](_0x1a2b47[_0x3ca7('0x38')]['fields']));_0x476c17['attributes']=_0x476c17[_0x3ca7('0x3c')][_0x3ca7('0x49')]?_0x476c17[_0x3ca7('0x3c')]:_0x75329d['model'];if(_0x1a2b47[_0x3ca7('0x38')][_0x3ca7('0x43')]){_0x476c17[_0x3ca7('0x44')]=[{'all':!![]}];}_0x476c17=_[_0x3ca7('0x42')]({},_0x476c17,_0x1a2b47['options']);return db[_0x3ca7('0x45')][_0x3ca7('0x4a')](_0x476c17)[_0x3ca7('0x28')](handleEntityNotFound(_0x185ac0,null))['then'](function(_0x2f6af7){if(_0x2f6af7){var _0x37176d=_0x2f6af7['get']({'plain':!![]});_0x37176d=qs['omit'](_0x37176d,['id',_0x3ca7('0x51'),_0x3ca7('0x52')]);_0x1a2b47['body']=_[_0x3ca7('0x53')](_0x1a2b47['body'],['id','createdAt',_0x3ca7('0x52')]);return db[_0x3ca7('0x45')][_0x3ca7('0x4b')](_[_0x3ca7('0x42')](_0x37176d,_0x1a2b47[_0x3ca7('0x54')]),{'include':_0x1a2b47['query'][_0x3ca7('0x43')]?[{'all':!![]}]:undefined})[_0x3ca7('0x28')](function(_0x2f31e5){var _0xbfa0f1=_0x1a2b47['user'][_0x3ca7('0x2a')]({'plain':!![]});if(!_0xbfa0f1)throw new Error(_0x3ca7('0x4d'));if(_0xbfa0f1['role']===_0x3ca7('0x4c')){var _0xd4b1f=_0x2f31e5['get']({'plain':!![]});var _0x2fcdc3=_0x3ca7('0x2b');return db[_0x3ca7('0x55')][_0x3ca7('0x4a')]({'where':{'name':_0x2fcdc3,'userProfileId':_0xbfa0f1[_0x3ca7('0x4e')]},'raw':!![]})['then'](function(_0x3a1a75){if(_0x3a1a75&&_0x3a1a75['autoAssociation']===0x0){return db[_0x3ca7('0x2c')][_0x3ca7('0x4b')]({'name':_0xd4b1f['name'],'resourceId':_0xd4b1f['id'],'type':_0x3a1a75[_0x3ca7('0x30')],'sectionId':_0x3a1a75['id']},{})[_0x3ca7('0x28')](function(){return _0x2f31e5;});}else{return _0x2f31e5;}})['catch'](function(_0x2309cd){logger[_0x3ca7('0x2e')](_0x3ca7('0x56'),_0x2309cd);throw _0x2309cd;});}return _0x2f31e5;});}})[_0x3ca7('0x28')](respondWithResult(_0x185ac0,0xc9))[_0x3ca7('0x47')](handleError(_0x185ac0,null));};exports[_0x3ca7('0x27')]=function(_0x4f6e7c,_0x3d1d2a){if(_0x4f6e7c['body']['id']){delete _0x4f6e7c[_0x3ca7('0x54')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x4f6e7c[_0x3ca7('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d1d2a,null))[_0x3ca7('0x28')](saveUpdates(_0x4f6e7c[_0x3ca7('0x54')],null))[_0x3ca7('0x28')](respondWithResult(_0x3d1d2a,null))[_0x3ca7('0x47')](handleError(_0x3d1d2a,null));};exports[_0x3ca7('0x29')]=function(_0x5d751d,_0x54ac00){return db[_0x3ca7('0x45')][_0x3ca7('0x4a')]({'where':{'id':_0x5d751d['params']['id']}})[_0x3ca7('0x28')](handleEntityNotFound(_0x54ac00,null))['then'](removeEntity(_0x54ac00,null))['catch'](handleError(_0x54ac00,null));};exports[_0x3ca7('0x57')]=function(_0x5252ca,_0x3fe174,_0x16613e){var _0x359184={'raw':!![],'where':{}};var _0x127ddf={};var _0x118cc9={'count':0x0,'rows':[]};return db[_0x3ca7('0x45')]['findOne']({'where':{'id':_0x5252ca[_0x3ca7('0x50')]['id']}})[_0x3ca7('0x28')](handleEntityNotFound(_0x3fe174,null))[_0x3ca7('0x28')](function(_0x174747){if(_0x174747){_0x127ddf[_0x3ca7('0x3b')]=_['keys'](db['JscriptySessionReport'][_0x3ca7('0x33')]);_0x127ddf[_0x3ca7('0x38')]=_['keys'](_0x5252ca[_0x3ca7('0x38')]);_0x127ddf[_0x3ca7('0x39')]=_[_0x3ca7('0x3a')](_0x127ddf[_0x3ca7('0x3b')],_0x127ddf[_0x3ca7('0x38')]);_0x359184[_0x3ca7('0x3c')]=_[_0x3ca7('0x3a')](_0x127ddf[_0x3ca7('0x3b')],qs['fields'](_0x5252ca[_0x3ca7('0x38')][_0x3ca7('0x3d')]));_0x359184[_0x3ca7('0x3c')]=_0x359184[_0x3ca7('0x3c')][_0x3ca7('0x49')]?_0x359184[_0x3ca7('0x3c')]:_0x127ddf[_0x3ca7('0x3b')];if(!_0x5252ca['query'][_0x3ca7('0x58')](_0x3ca7('0x3e'))){_0x359184['limit']=qs[_0x3ca7('0x1f')](_0x5252ca[_0x3ca7('0x38')]['limit']);_0x359184['offset']=qs['offset'](_0x5252ca['query']['offset']);}_0x359184[_0x3ca7('0x59')]=qs[_0x3ca7('0x5a')](_0x5252ca['query'][_0x3ca7('0x5a')]);_0x359184[_0x3ca7('0x3f')]=qs['filters'](_[_0x3ca7('0x40')](_0x5252ca[_0x3ca7('0x38')],_0x127ddf[_0x3ca7('0x39')]));_0x359184[_0x3ca7('0x3f')][_0x3ca7('0x5b')]=_0x174747['id'];if(_0x5252ca[_0x3ca7('0x38')][_0x3ca7('0x41')]){_0x359184[_0x3ca7('0x3f')]=_['merge'](_0x359184[_0x3ca7('0x3f')],{'$or':_[_0x3ca7('0x32')](_0x359184[_0x3ca7('0x3c')],function(_0x3458a5){var _0x5343d8={};_0x5343d8[_0x3458a5]={'$like':'%'+_0x5252ca[_0x3ca7('0x38')][_0x3ca7('0x41')]+'%'};return _0x5343d8;})});}_0x359184=_[_0x3ca7('0x42')]({},_0x359184,_0x5252ca[_0x3ca7('0x5c')]);return db[_0x3ca7('0x5d')]['count']({'where':_0x359184['where']})['then'](function(_0x30f1d4){_0x118cc9[_0x3ca7('0x20')]=_0x30f1d4;if(_0x5252ca[_0x3ca7('0x38')][_0x3ca7('0x43')]){_0x359184[_0x3ca7('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x359184);})[_0x3ca7('0x28')](function(_0x52535a){_0x118cc9['rows']=_0x52535a;return _0x118cc9;});}})[_0x3ca7('0x28')](respondWithFilteredResult(_0x3fe174,_0x359184))['catch'](handleError(_0x3fe174,null));};exports[_0x3ca7('0x5e')]=function(_0x3f4b0c,_0x526406,_0x5ebfe1){var _0x40a2eb={'raw':!![],'where':{}};var _0x1b598a={};var _0x34b7a8={'count':0x0,'rows':[]};return db[_0x3ca7('0x45')][_0x3ca7('0x5f')]({'where':{'id':_0x3f4b0c['params']['id']}})[_0x3ca7('0x28')](handleEntityNotFound(_0x526406,null))[_0x3ca7('0x28')](function(_0x4c6f9f){if(_0x4c6f9f){_0x1b598a['model']=_[_0x3ca7('0x37')](db[_0x3ca7('0x60')][_0x3ca7('0x33')]);_0x1b598a[_0x3ca7('0x38')]=_[_0x3ca7('0x37')](_0x3f4b0c[_0x3ca7('0x38')]);_0x1b598a[_0x3ca7('0x39')]=_[_0x3ca7('0x3a')](_0x1b598a['model'],_0x1b598a['query']);_0x40a2eb[_0x3ca7('0x3c')]=_[_0x3ca7('0x3a')](_0x1b598a[_0x3ca7('0x3b')],qs[_0x3ca7('0x3d')](_0x3f4b0c[_0x3ca7('0x38')]['fields']));_0x40a2eb[_0x3ca7('0x3c')]=_0x40a2eb[_0x3ca7('0x3c')][_0x3ca7('0x49')]?_0x40a2eb[_0x3ca7('0x3c')]:_0x1b598a[_0x3ca7('0x3b')];if(!_0x3f4b0c[_0x3ca7('0x38')]['hasOwnProperty'](_0x3ca7('0x3e'))){_0x40a2eb['limit']=qs['limit'](_0x3f4b0c['query'][_0x3ca7('0x1f')]);_0x40a2eb[_0x3ca7('0x21')]=qs[_0x3ca7('0x21')](_0x3f4b0c['query'][_0x3ca7('0x21')]);}_0x40a2eb[_0x3ca7('0x59')]=qs[_0x3ca7('0x5a')](_0x3f4b0c[_0x3ca7('0x38')]['sort']);_0x40a2eb[_0x3ca7('0x3f')]=qs[_0x3ca7('0x39')](_[_0x3ca7('0x40')](_0x3f4b0c['query'],_0x1b598a[_0x3ca7('0x39')]));_0x40a2eb[_0x3ca7('0x3f')]['ProjectId']=_0x4c6f9f['id'];if(_0x3f4b0c[_0x3ca7('0x38')][_0x3ca7('0x41')]){_0x40a2eb[_0x3ca7('0x3f')]=_[_0x3ca7('0x42')](_0x40a2eb[_0x3ca7('0x3f')],{'$or':_['map'](_0x40a2eb[_0x3ca7('0x3c')],function(_0x5c3f1c){var _0x2717ed={};_0x2717ed[_0x5c3f1c]={'$like':'%'+_0x3f4b0c[_0x3ca7('0x38')]['filter']+'%'};return _0x2717ed;})});}_0x40a2eb=_[_0x3ca7('0x42')]({},_0x40a2eb,_0x3f4b0c[_0x3ca7('0x5c')]);return db['JscriptyAnswerReport'][_0x3ca7('0x20')]({'where':_0x40a2eb[_0x3ca7('0x3f')]})[_0x3ca7('0x28')](function(_0x10b7d4){_0x34b7a8[_0x3ca7('0x20')]=_0x10b7d4;if(_0x3f4b0c[_0x3ca7('0x38')][_0x3ca7('0x43')]){_0x40a2eb[_0x3ca7('0x44')]=[{'all':!![]}];}return db[_0x3ca7('0x60')][_0x3ca7('0x46')](_0x40a2eb);})[_0x3ca7('0x28')](function(_0x3bf045){_0x34b7a8[_0x3ca7('0x61')]=_0x3bf045;return _0x34b7a8;});}})[_0x3ca7('0x28')](respondWithFilteredResult(_0x526406,_0x40a2eb))[_0x3ca7('0x47')](handleError(_0x526406,null));};function char(_0x535ab1){return _0x3ca7('0x62')===typeof _0x535ab1?String['fromCharCode'][_0x3ca7('0x24')](null,arguments):_0x535ab1;}function needsEncapsulation(_0x27a120){return!!_0x27a120&&(_0x27a120[_0x3ca7('0x63')]()[_0x3ca7('0x64')](char(0xd))>=0x0||_0x27a120[_0x3ca7('0x63')]()['indexOf'](char(0xa))>=0x0||_0x27a120[_0x3ca7('0x63')]()[_0x3ca7('0x64')](char(0x2c))>=0x0||_0x27a120[_0x3ca7('0x63')]()[_0x3ca7('0x64')](char(0x22))>=0x0);}function encapsulate(_0x37ee54){var _0x170317=char(0x22),_0x29b4be='\x5c'+char(0x22),_0x2ec303=_0x37ee54[_0x3ca7('0x63')]()[_0x3ca7('0x65')](new RegExp(_0x170317,'g'),_0x29b4be);return _0x170317+_0x2ec303+_0x170317;}exports[_0x3ca7('0x66')]=function(_0x1b50d8,_0x442ff8,_0x135ebb){var _0x2ec328,_0x1fdf33;var _0x57f862={'where':{'ProjectId':_0x1b50d8[_0x3ca7('0x50')]['id']}};if(_0x1b50d8[_0x3ca7('0x38')][_0x3ca7('0x67')]){_0x57f862[_0x3ca7('0x3f')][_0x3ca7('0x68')]=JSON[_0x3ca7('0x69')](_0x1b50d8['query']['startTime']);}return db[_0x3ca7('0x5d')][_0x3ca7('0x46')](_0x57f862)[_0x3ca7('0x28')](handleEntityNotFound(_0x442ff8,null))[_0x3ca7('0x28')](function(_0x40d15d){if(_0x40d15d){_0x2ec328=_0x40d15d;return db['JscriptyQuestionReport'][_0x3ca7('0x46')]({'where':{'SessionId':{'$in':_['map'](_0x2ec328,'id')},'ProjectId':_0x1b50d8[_0x3ca7('0x50')]['id']},'order':_0x3ca7('0x6a')});}})[_0x3ca7('0x28')](handleEntityNotFound(_0x442ff8,null))['then'](function(_0x3d2c34){if(_0x3d2c34){_0x1fdf33=_0x3d2c34;var _0x2dd376={};for(var _0x1e3928=0x0,_0x11aefa=_0x1fdf33[_0x3ca7('0x49')];_0x1e3928<_0x11aefa;_0x1e3928++){if(!_0x2dd376[_0x3ca7('0x58')](_0x1fdf33[_0x1e3928][_0x3ca7('0x6b')])){_0x2dd376[_0x1fdf33[_0x1e3928][_0x3ca7('0x6b')]]=needsEncapsulation(_0x1fdf33[_0x1e3928][_0x3ca7('0x6c')])?encapsulate(_0x1fdf33[_0x1e3928]['question']):_0x1fdf33[_0x1e3928]['question'];}}var _0x16cf6b=[],_0x27c422={};for(var _0x23295f=0x0,_0x1d61c6=_0x2ec328[_0x3ca7('0x49')];_0x23295f<_0x1d61c6;_0x23295f++){_0x27c422={'ProjectId':_0x1b50d8[_0x3ca7('0x50')]['id'],'SessionId':_0x2ec328[_0x23295f]['id'],'StartTime':moment(_0x2ec328[_0x23295f][_0x3ca7('0x68')])[_0x3ca7('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3f7e57=0x0,_0x4bc5bf=_0x1fdf33[_0x3ca7('0x49')];_0x3f7e57<_0x4bc5bf;_0x3f7e57++){if(_0x1fdf33[_0x3f7e57][_0x3ca7('0x6e')]==_0x2ec328[_0x23295f]['id']&&_0x2dd376[_0x3ca7('0x58')](_0x1fdf33[_0x3f7e57]['questionId'])){_0x27c422[_0x2dd376[_0x1fdf33[_0x3f7e57]['questionId']]]=_0x1fdf33[_0x3f7e57]['answer'];}}for(var _0x2eb7a4 in _0x2dd376){if(!_0x27c422[_0x3ca7('0x58')](_0x2dd376[_0x2eb7a4])){_0x27c422[_0x2dd376[_0x2eb7a4]]=null;}}_0x16cf6b[_0x3ca7('0x6f')](_0x27c422);}return _0x16cf6b;}})[_0x3ca7('0x28')](function(_0x443cfa){if(!_[_0x3ca7('0x70')](_0x443cfa)){var _0x1a303b=toCsv(_0x443cfa);var _0x238f43=Date[_0x3ca7('0x71')]();fs[_0x3ca7('0x72')](util[_0x3ca7('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1b50d8[_0x3ca7('0x50')]['id'],_0x238f43),_0x1a303b);_0x442ff8[_0x3ca7('0x73')](_0x3ca7('0x74'),_0x3ca7('0x75')+util['format'](_0x3ca7('0x76'),_0x1b50d8[_0x3ca7('0x50')]['id'],_0x238f43));_0x442ff8[_0x3ca7('0x73')](_0x3ca7('0x77'),_0x3ca7('0x78'));return _0x442ff8[_0x3ca7('0x79')](util[_0x3ca7('0x6d')](_0x3ca7('0x7a'),_0x1b50d8[_0x3ca7('0x50')]['id'],_0x238f43));}else{return _0x442ff8[_0x3ca7('0x1b')](0xcc);}})['catch'](handleError(_0x442ff8,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x55ca,0x126));var _0xa55c=function(_0x421e3a,_0xd69d11){_0x421e3a=_0x421e3a-0x0;var _0x3f9abd=_0x55ca[_0x421e3a];return _0x3f9abd;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('JscriptyProject',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x49fe=['path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','lodash','util','../../config/logger','bluebird'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x49fe,0x100));var _0xe49f=function(_0x31710a,_0x313cae){_0x31710a=_0x31710a-0x0;var _0x527a91=_0x49fe[_0x31710a];return _0x527a91;};'use strict';var _=require(_0xe49f('0x0'));var util=require(_0xe49f('0x1'));var logger=require(_0xe49f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe49f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe49f('0x4'));var rimraf=require(_0xe49f('0x5'));var config=require(_0xe49f('0x6'));var attributes=require(_0xe49f('0x7'));module['exports']=function(_0x20633a,_0x51fe70){return _0x20633a[_0xe49f('0x8')](_0xe49f('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1b07a0,_0x1d150c){var _0x4ed63e=function(_0x4d8936){while(--_0x4d8936){_0x1b07a0['push'](_0x1b07a0['shift']());}};_0x4ed63e(++_0x1d150c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4961da,_0x3a0350){_0x4961da=_0x4961da-0x0;var _0x1ed6fe=_0xb43b[_0x4961da];return _0x1ed6fe;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x36d4f6,_0x52b65b){var _0x3fe177=function(_0x2c1f7a){while(--_0x2c1f7a){_0x36d4f6['push'](_0x36d4f6['shift']());}};_0x3fe177(++_0x52b65b);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa2ae=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update'];(function(_0x6b1406,_0x45724e){var _0x492019=function(_0x4bcf87){while(--_0x4bcf87){_0x6b1406['push'](_0x6b1406['shift']());}};_0x492019(++_0x45724e);}(_0xa2ae,0x74));var _0xea2a=function(_0x4c075b,_0x56c2e7){_0x4c075b=_0x4c075b-0x0;var _0x228448=_0xa2ae[_0x4c075b];return _0x228448;};'use strict';var multer=require(_0xea2a('0x0'));var util=require(_0xea2a('0x1'));var path=require(_0xea2a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea2a('0x3')]();var fs_extra=require(_0xea2a('0x4'));var auth=require(_0xea2a('0x5'));var interaction=require(_0xea2a('0x6'));var config=require(_0xea2a('0x7'));var controller=require(_0xea2a('0x8'));router[_0xea2a('0x9')]('/',auth[_0xea2a('0xa')](),controller[_0xea2a('0xb')]);router[_0xea2a('0x9')]('/describe',auth[_0xea2a('0xa')](),controller[_0xea2a('0xc')]);router[_0xea2a('0x9')](_0xea2a('0xd'),auth[_0xea2a('0xa')](),controller['show']);router[_0xea2a('0xe')]('/',auth[_0xea2a('0xa')](),controller[_0xea2a('0xf')]);router['put'](_0xea2a('0xd'),auth[_0xea2a('0xa')](),controller[_0xea2a('0x10')]);router['delete'](_0xea2a('0xd'),auth[_0xea2a('0xa')](),controller[_0xea2a('0x11')]);module[_0xea2a('0x12')]=router;
\ No newline at end of file
+var _0x1638=['path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1638,0x154));var _0x8163=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x1638[_0x207811];return _0x170d56;};'use strict';var multer=require(_0x8163('0x0'));var util=require(_0x8163('0x1'));var path=require(_0x8163('0x2'));var timeout=require('connect-timeout');var express=require(_0x8163('0x3'));var router=express['Router']();var fs_extra=require(_0x8163('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8163('0x5'));var config=require(_0x8163('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x8163('0x7')]('/',auth[_0x8163('0x8')](),controller['index']);router['get'](_0x8163('0x9'),auth[_0x8163('0x8')](),controller['describe']);router[_0x8163('0x7')](_0x8163('0xa'),auth[_0x8163('0x8')](),controller[_0x8163('0xb')]);router[_0x8163('0xc')]('/',auth[_0x8163('0x8')](),controller[_0x8163('0xd')]);router[_0x8163('0xe')](_0x8163('0xa'),auth['isAuthenticated'](),controller[_0x8163('0xf')]);router[_0x8163('0x10')](_0x8163('0xa'),auth[_0x8163('0x8')](),controller[_0x8163('0x11')]);module[_0x8163('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x136c54,_0x49dce1){_0x136c54=_0x136c54-0x0;var _0x1f9174=_0x7a54[_0x136c54];return _0x1f9174;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x12c9f3,_0x2cabd0){_0x12c9f3=_0x12c9f3-0x0;var _0x42b50f=_0x7a54[_0x12c9f3];return _0x42b50f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x76e4=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','JscriptyQuestionReport','type','key','model','keys','filters','intersection','query','attributes','fields'];(function(_0x45480f,_0x387f04){var _0xb81c36=function(_0x4744ca){while(--_0x4744ca){_0x45480f['push'](_0x45480f['shift']());}};_0xb81c36(++_0x387f04);}(_0x76e4,0x1dd));var _0x476e=function(_0x36bff2,_0x3b4469){_0x36bff2=_0x36bff2-0x0;var _0xc5e74f=_0x76e4[_0x36bff2];return _0xc5e74f;};'use strict';var emlformat=require(_0x476e('0x0'));var rimraf=require(_0x476e('0x1'));var zipdir=require(_0x476e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x476e('0x3'));var moment=require(_0x476e('0x4'));var BPromise=require(_0x476e('0x5'));var Mustache=require(_0x476e('0x6'));var util=require(_0x476e('0x7'));var path=require(_0x476e('0x8'));var sox=require('sox');var csv=require(_0x476e('0x9'));var ejs=require(_0x476e('0xa'));var fs=require('fs');var fs_extra=require(_0x476e('0xb'));var _=require('lodash');var squel=require(_0x476e('0xc'));var crypto=require(_0x476e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x476e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x476e('0xf'));var Papa=require(_0x476e('0x10'));var Redis=require(_0x476e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x476e('0x12'));var as=require(_0x476e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x476e('0x14'))(_0x476e('0x15'));var utils=require(_0x476e('0x16'));var config=require(_0x476e('0x17'));var licenseUtil=require(_0x476e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501bce,_0x321656){_0x321656=_0x321656||0xcc;return function(_0x419aeb){if(_0x419aeb){return _0x501bce['sendStatus'](_0x321656);}return _0x501bce[_0x476e('0x19')](_0x321656)[_0x476e('0x1a')]();};}function respondWithResult(_0xe17fe7,_0x230064){_0x230064=_0x230064||0xc8;return function(_0x45d02b){if(_0x45d02b){return _0xe17fe7[_0x476e('0x19')](_0x230064)[_0x476e('0x1b')](_0x45d02b);}};}function respondWithFilteredResult(_0x5e0958,_0x3b6ed8){return function(_0x2f998d){if(_0x2f998d){var _0x4284a=typeof _0x3b6ed8[_0x476e('0x1c')]===_0x476e('0x1d')&&typeof _0x3b6ed8[_0x476e('0x1e')]===_0x476e('0x1d');var _0x5eaf57=_0x2f998d[_0x476e('0x1f')];var _0x29e9b2=_0x4284a?0x0:_0x3b6ed8[_0x476e('0x1c')];var _0x50ab10=_0x4284a?_0x2f998d[_0x476e('0x1f')]:_0x3b6ed8['offset']+_0x3b6ed8[_0x476e('0x1e')];var _0x449dd7;if(_0x50ab10>=_0x5eaf57){_0x50ab10=_0x5eaf57;_0x449dd7=0xc8;}else{_0x449dd7=0xce;}_0x5e0958[_0x476e('0x19')](_0x449dd7);return _0x5e0958['set'](_0x476e('0x20'),_0x29e9b2+'-'+_0x50ab10+'/'+_0x5eaf57)[_0x476e('0x1b')](_0x2f998d);}return null;};}function patchUpdates(_0x34d281){return function(_0x1240f0){try{jsonpatch[_0x476e('0x21')](_0x1240f0,_0x34d281,!![]);}catch(_0x270c82){return BPromise[_0x476e('0x22')](_0x270c82);}return _0x1240f0[_0x476e('0x23')]();};}function saveUpdates(_0x3ca452,_0x1dc913){return function(_0x3dfc6e){if(_0x3dfc6e){return _0x3dfc6e[_0x476e('0x24')](_0x3ca452)[_0x476e('0x25')](function(_0x37ec2d){return _0x37ec2d;});}return null;};}function removeEntity(_0x50d475,_0x1e5fd0){return function(_0x3472f9){if(_0x3472f9){return _0x3472f9[_0x476e('0x26')]()[_0x476e('0x25')](function(){_0x50d475['status'](0xcc)[_0x476e('0x1a')]();});}};}function handleEntityNotFound(_0x2d7d40,_0x5eb5f0){return function(_0x4628de){if(!_0x4628de){_0x2d7d40[_0x476e('0x27')](0x194);}return _0x4628de;};}function handleError(_0x1fede1,_0x447e5e){_0x447e5e=_0x447e5e||0x1f4;return function(_0x3789ff){logger[_0x476e('0x28')](_0x3789ff[_0x476e('0x29')]);if(_0x3789ff[_0x476e('0x2a')]){delete _0x3789ff[_0x476e('0x2a')];}_0x1fede1['status'](_0x447e5e)['send'](_0x3789ff);};}exports[_0x476e('0x2b')]=function(_0x3e8694,_0x4c05f6){var _0x3bf9ef={},_0x570e34={},_0x5cc7c8={'count':0x0,'rows':[]};var _0xb7ed71=_[_0x476e('0x2c')](db[_0x476e('0x2d')]['rawAttributes'],function(_0x4593a7){return{'name':_0x4593a7['fieldName'],'type':_0x4593a7[_0x476e('0x2e')][_0x476e('0x2f')]};});_0x570e34[_0x476e('0x30')]=_['map'](_0xb7ed71,'name');_0x570e34['query']=_[_0x476e('0x31')](_0x3e8694['query']);_0x570e34[_0x476e('0x32')]=_[_0x476e('0x33')](_0x570e34[_0x476e('0x30')],_0x570e34[_0x476e('0x34')]);_0x3bf9ef[_0x476e('0x35')]=_['intersection'](_0x570e34[_0x476e('0x30')],qs[_0x476e('0x36')](_0x3e8694[_0x476e('0x34')][_0x476e('0x36')]));_0x3bf9ef['attributes']=_0x3bf9ef[_0x476e('0x35')][_0x476e('0x37')]?_0x3bf9ef[_0x476e('0x35')]:_0x570e34[_0x476e('0x30')];if(!_0x3e8694[_0x476e('0x34')][_0x476e('0x38')](_0x476e('0x39'))){_0x3bf9ef[_0x476e('0x1e')]=qs['limit'](_0x3e8694[_0x476e('0x34')]['limit']);_0x3bf9ef[_0x476e('0x1c')]=qs[_0x476e('0x1c')](_0x3e8694[_0x476e('0x34')][_0x476e('0x1c')]);}_0x3bf9ef[_0x476e('0x3a')]=qs[_0x476e('0x3b')](_0x3e8694[_0x476e('0x34')]['sort']);_0x3bf9ef[_0x476e('0x3c')]=qs[_0x476e('0x32')](_['pick'](_0x3e8694['query'],_0x570e34['filters']),_0xb7ed71);if(_0x3e8694[_0x476e('0x34')]['filter']){_0x3bf9ef['where']=_['merge'](_0x3bf9ef[_0x476e('0x3c')],{'$or':_[_0x476e('0x2c')](_0xb7ed71,function(_0x2aa6c7){if(_0x2aa6c7[_0x476e('0x2e')]!=='VIRTUAL'){var _0x17561d={};_0x17561d[_0x2aa6c7[_0x476e('0x2a')]]={'$like':'%'+_0x3e8694['query'][_0x476e('0x3d')]+'%'};return _0x17561d;}})});}_0x3bf9ef=_[_0x476e('0x3e')]({},_0x3bf9ef,_0x3e8694[_0x476e('0x3f')]);var _0xb72d4b={'where':_0x3bf9ef[_0x476e('0x3c')]};return db[_0x476e('0x2d')][_0x476e('0x1f')](_0xb72d4b)['then'](function(_0x2b49af){_0x5cc7c8[_0x476e('0x1f')]=_0x2b49af;if(_0x3e8694[_0x476e('0x34')]['includeAll']){_0x3bf9ef[_0x476e('0x40')]=[{'all':!![]}];}return db[_0x476e('0x2d')][_0x476e('0x41')](_0x3bf9ef);})[_0x476e('0x25')](function(_0x286acf){_0x5cc7c8[_0x476e('0x42')]=_0x286acf;return _0x5cc7c8;})[_0x476e('0x25')](respondWithFilteredResult(_0x4c05f6,_0x3bf9ef))[_0x476e('0x43')](handleError(_0x4c05f6,null));};exports[_0x476e('0x44')]=function(_0x1f91cd,_0x1b1bec){var _0x45e68d={'raw':!![],'where':{'id':_0x1f91cd[_0x476e('0x45')]['id']}},_0x4309f8={};_0x4309f8[_0x476e('0x30')]=_[_0x476e('0x31')](db[_0x476e('0x2d')][_0x476e('0x46')]);_0x4309f8[_0x476e('0x34')]=_[_0x476e('0x31')](_0x1f91cd['query']);_0x4309f8[_0x476e('0x32')]=_[_0x476e('0x33')](_0x4309f8['model'],_0x4309f8[_0x476e('0x34')]);_0x45e68d[_0x476e('0x35')]=_[_0x476e('0x33')](_0x4309f8[_0x476e('0x30')],qs['fields'](_0x1f91cd[_0x476e('0x34')][_0x476e('0x36')]));_0x45e68d[_0x476e('0x35')]=_0x45e68d[_0x476e('0x35')][_0x476e('0x37')]?_0x45e68d['attributes']:_0x4309f8['model'];if(_0x1f91cd[_0x476e('0x34')][_0x476e('0x47')]){_0x45e68d[_0x476e('0x40')]=[{'all':!![]}];}_0x45e68d=_['merge']({},_0x45e68d,_0x1f91cd[_0x476e('0x3f')]);return db[_0x476e('0x2d')][_0x476e('0x48')](_0x45e68d)[_0x476e('0x25')](handleEntityNotFound(_0x1b1bec,null))[_0x476e('0x25')](respondWithResult(_0x1b1bec,null))[_0x476e('0x43')](handleError(_0x1b1bec,null));};exports[_0x476e('0x49')]=function(_0x48566e,_0x31b224){return db[_0x476e('0x2d')][_0x476e('0x49')](_0x48566e[_0x476e('0x4a')],{})['then'](respondWithResult(_0x31b224,0xc9))[_0x476e('0x43')](handleError(_0x31b224,null));};exports[_0x476e('0x24')]=function(_0x39c907,_0x34bd6c){if(_0x39c907[_0x476e('0x4a')]['id']){delete _0x39c907[_0x476e('0x4a')]['id'];}return db[_0x476e('0x2d')][_0x476e('0x48')]({'where':{'id':_0x39c907[_0x476e('0x45')]['id']}})[_0x476e('0x25')](handleEntityNotFound(_0x34bd6c,null))[_0x476e('0x25')](saveUpdates(_0x39c907[_0x476e('0x4a')],null))[_0x476e('0x25')](respondWithResult(_0x34bd6c,null))[_0x476e('0x43')](handleError(_0x34bd6c,null));};exports[_0x476e('0x26')]=function(_0x137443,_0x887d0){return db[_0x476e('0x2d')]['find']({'where':{'id':_0x137443['params']['id']}})[_0x476e('0x25')](handleEntityNotFound(_0x887d0,null))[_0x476e('0x25')](removeEntity(_0x887d0,null))[_0x476e('0x43')](handleError(_0x887d0,null));};exports[_0x476e('0x4b')]=function(_0xc44fe3,_0x191a80){return db[_0x476e('0x2d')]['describe']()[_0x476e('0x25')](respondWithResult(_0x191a80,null))[_0x476e('0x43')](handleError(_0x191a80,null));};
\ No newline at end of file
+var _0xbf91=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','JscriptyQuestionReport','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x175be3,_0x39d56e){var _0x3fdd13=function(_0x2cba32){while(--_0x2cba32){_0x175be3['push'](_0x175be3['shift']());}};_0x3fdd13(++_0x39d56e);}(_0xbf91,0x83));var _0x1bf9=function(_0x2d47ed,_0x260bb5){_0x2d47ed=_0x2d47ed-0x0;var _0x1f53f5=_0xbf91[_0x2d47ed];return _0x1f53f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1bf9('0x0'));var rp=require(_0x1bf9('0x1'));var moment=require(_0x1bf9('0x2'));var BPromise=require(_0x1bf9('0x3'));var Mustache=require(_0x1bf9('0x4'));var util=require(_0x1bf9('0x5'));var path=require(_0x1bf9('0x6'));var sox=require(_0x1bf9('0x7'));var csv=require(_0x1bf9('0x8'));var ejs=require(_0x1bf9('0x9'));var fs=require('fs');var fs_extra=require(_0x1bf9('0xa'));var _=require('lodash');var squel=require(_0x1bf9('0xb'));var crypto=require(_0x1bf9('0xc'));var jsforce=require(_0x1bf9('0xd'));var deskjs=require(_0x1bf9('0xe'));var toCsv=require(_0x1bf9('0x8'));var querystring=require('querystring');var Papa=require(_0x1bf9('0xf'));var Redis=require(_0x1bf9('0x10'));var authService=require(_0x1bf9('0x11'));var qs=require(_0x1bf9('0x12'));var as=require(_0x1bf9('0x13'));var hardwareService=require(_0x1bf9('0x14'));var logger=require(_0x1bf9('0x15'))(_0x1bf9('0x16'));var utils=require('../../config/utils');var config=require(_0x1bf9('0x17'));var licenseUtil=require(_0x1bf9('0x18'));var db=require(_0x1bf9('0x19'))['db'];function respondWithStatusCode(_0x25f43e,_0x41437a){_0x41437a=_0x41437a||0xcc;return function(_0x54d5a8){if(_0x54d5a8){return _0x25f43e[_0x1bf9('0x1a')](_0x41437a);}return _0x25f43e['status'](_0x41437a)[_0x1bf9('0x1b')]();};}function respondWithResult(_0x320b62,_0x2ce7b1){_0x2ce7b1=_0x2ce7b1||0xc8;return function(_0x3a5d04){if(_0x3a5d04){return _0x320b62[_0x1bf9('0x1c')](_0x2ce7b1)[_0x1bf9('0x1d')](_0x3a5d04);}};}function respondWithFilteredResult(_0x9727e8,_0x912012){return function(_0x304c26){if(_0x304c26){var _0x43d68c=typeof _0x912012['offset']==='undefined'&&typeof _0x912012[_0x1bf9('0x1e')]===_0x1bf9('0x1f');var _0x88a081=_0x304c26[_0x1bf9('0x20')];var _0x40cddb=_0x43d68c?0x0:_0x912012['offset'];var _0x141830=_0x43d68c?_0x304c26[_0x1bf9('0x20')]:_0x912012[_0x1bf9('0x21')]+_0x912012[_0x1bf9('0x1e')];var _0x3bded8;if(_0x141830>=_0x88a081){_0x141830=_0x88a081;_0x3bded8=0xc8;}else{_0x3bded8=0xce;}_0x9727e8[_0x1bf9('0x1c')](_0x3bded8);return _0x9727e8[_0x1bf9('0x22')](_0x1bf9('0x23'),_0x40cddb+'-'+_0x141830+'/'+_0x88a081)[_0x1bf9('0x1d')](_0x304c26);}return null;};}function patchUpdates(_0x2c1c0b){return function(_0x228c72){try{jsonpatch['apply'](_0x228c72,_0x2c1c0b,!![]);}catch(_0x1a5661){return BPromise[_0x1bf9('0x24')](_0x1a5661);}return _0x228c72[_0x1bf9('0x25')]();};}function saveUpdates(_0x5e7bcd,_0x871141){return function(_0x483183){if(_0x483183){return _0x483183[_0x1bf9('0x26')](_0x5e7bcd)['then'](function(_0x1b0bc3){return _0x1b0bc3;});}return null;};}function removeEntity(_0x354d10,_0x142855){return function(_0x2832d2){if(_0x2832d2){return _0x2832d2['destroy']()[_0x1bf9('0x27')](function(){_0x354d10['status'](0xcc)[_0x1bf9('0x1b')]();});}};}function handleEntityNotFound(_0x337602,_0xd28dfa){return function(_0x5b93da){if(!_0x5b93da){_0x337602[_0x1bf9('0x1a')](0x194);}return _0x5b93da;};}function handleError(_0x474a19,_0x15f1f1){_0x15f1f1=_0x15f1f1||0x1f4;return function(_0x101b3f){logger['error'](_0x101b3f[_0x1bf9('0x28')]);if(_0x101b3f[_0x1bf9('0x29')]){delete _0x101b3f[_0x1bf9('0x29')];}_0x474a19[_0x1bf9('0x1c')](_0x15f1f1)[_0x1bf9('0x2a')](_0x101b3f);};}exports[_0x1bf9('0x2b')]=function(_0x3cf72d,_0x58de32){var _0x250417={},_0x2540f5={},_0x13a517={'count':0x0,'rows':[]};var _0x1f9ba1=_[_0x1bf9('0x2c')](db['JscriptyQuestionReport'][_0x1bf9('0x2d')],function(_0x19da83){return{'name':_0x19da83[_0x1bf9('0x2e')],'type':_0x19da83[_0x1bf9('0x2f')][_0x1bf9('0x30')]};});_0x2540f5['model']=_[_0x1bf9('0x2c')](_0x1f9ba1,_0x1bf9('0x29'));_0x2540f5[_0x1bf9('0x31')]=_[_0x1bf9('0x32')](_0x3cf72d['query']);_0x2540f5[_0x1bf9('0x33')]=_[_0x1bf9('0x34')](_0x2540f5[_0x1bf9('0x35')],_0x2540f5['query']);_0x250417[_0x1bf9('0x36')]=_[_0x1bf9('0x34')](_0x2540f5[_0x1bf9('0x35')],qs[_0x1bf9('0x37')](_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x37')]));_0x250417['attributes']=_0x250417[_0x1bf9('0x36')][_0x1bf9('0x38')]?_0x250417['attributes']:_0x2540f5[_0x1bf9('0x35')];if(!_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x39')]('nolimit')){_0x250417[_0x1bf9('0x1e')]=qs[_0x1bf9('0x1e')](_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x1e')]);_0x250417['offset']=qs[_0x1bf9('0x21')](_0x3cf72d['query'][_0x1bf9('0x21')]);}_0x250417[_0x1bf9('0x3a')]=qs[_0x1bf9('0x3b')](_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x3b')]);_0x250417[_0x1bf9('0x3c')]=qs[_0x1bf9('0x33')](_[_0x1bf9('0x3d')](_0x3cf72d[_0x1bf9('0x31')],_0x2540f5[_0x1bf9('0x33')]),_0x1f9ba1);if(_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x3e')]){_0x250417['where']=_[_0x1bf9('0x3f')](_0x250417['where'],{'$or':_[_0x1bf9('0x2c')](_0x1f9ba1,function(_0x4f827d){if(_0x4f827d[_0x1bf9('0x2f')]!=='VIRTUAL'){var _0x11b257={};_0x11b257[_0x4f827d[_0x1bf9('0x29')]]={'$like':'%'+_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x3e')]+'%'};return _0x11b257;}})});}_0x250417=_[_0x1bf9('0x3f')]({},_0x250417,_0x3cf72d[_0x1bf9('0x40')]);var _0x20de50={'where':_0x250417[_0x1bf9('0x3c')]};return db[_0x1bf9('0x41')][_0x1bf9('0x20')](_0x20de50)[_0x1bf9('0x27')](function(_0x575b41){_0x13a517['count']=_0x575b41;if(_0x3cf72d[_0x1bf9('0x31')][_0x1bf9('0x42')]){_0x250417[_0x1bf9('0x43')]=[{'all':!![]}];}return db[_0x1bf9('0x41')][_0x1bf9('0x44')](_0x250417);})[_0x1bf9('0x27')](function(_0x25041c){_0x13a517['rows']=_0x25041c;return _0x13a517;})[_0x1bf9('0x27')](respondWithFilteredResult(_0x58de32,_0x250417))[_0x1bf9('0x45')](handleError(_0x58de32,null));};exports[_0x1bf9('0x46')]=function(_0x925cc3,_0x204857){var _0x2729dc={'raw':!![],'where':{'id':_0x925cc3[_0x1bf9('0x47')]['id']}},_0x44f4f3={};_0x44f4f3[_0x1bf9('0x35')]=_[_0x1bf9('0x32')](db[_0x1bf9('0x41')]['rawAttributes']);_0x44f4f3[_0x1bf9('0x31')]=_[_0x1bf9('0x32')](_0x925cc3[_0x1bf9('0x31')]);_0x44f4f3[_0x1bf9('0x33')]=_[_0x1bf9('0x34')](_0x44f4f3[_0x1bf9('0x35')],_0x44f4f3[_0x1bf9('0x31')]);_0x2729dc[_0x1bf9('0x36')]=_['intersection'](_0x44f4f3[_0x1bf9('0x35')],qs[_0x1bf9('0x37')](_0x925cc3[_0x1bf9('0x31')][_0x1bf9('0x37')]));_0x2729dc[_0x1bf9('0x36')]=_0x2729dc[_0x1bf9('0x36')][_0x1bf9('0x38')]?_0x2729dc[_0x1bf9('0x36')]:_0x44f4f3['model'];if(_0x925cc3['query']['includeAll']){_0x2729dc[_0x1bf9('0x43')]=[{'all':!![]}];}_0x2729dc=_[_0x1bf9('0x3f')]({},_0x2729dc,_0x925cc3[_0x1bf9('0x40')]);return db[_0x1bf9('0x41')][_0x1bf9('0x48')](_0x2729dc)[_0x1bf9('0x27')](handleEntityNotFound(_0x204857,null))[_0x1bf9('0x27')](respondWithResult(_0x204857,null))[_0x1bf9('0x45')](handleError(_0x204857,null));};exports[_0x1bf9('0x49')]=function(_0x3e5f69,_0x5106be){return db[_0x1bf9('0x41')]['create'](_0x3e5f69['body'],{})[_0x1bf9('0x27')](respondWithResult(_0x5106be,0xc9))['catch'](handleError(_0x5106be,null));};exports['update']=function(_0x3031a0,_0x4c8887){if(_0x3031a0[_0x1bf9('0x4a')]['id']){delete _0x3031a0[_0x1bf9('0x4a')]['id'];}return db[_0x1bf9('0x41')]['find']({'where':{'id':_0x3031a0[_0x1bf9('0x47')]['id']}})[_0x1bf9('0x27')](handleEntityNotFound(_0x4c8887,null))[_0x1bf9('0x27')](saveUpdates(_0x3031a0['body'],null))[_0x1bf9('0x27')](respondWithResult(_0x4c8887,null))[_0x1bf9('0x45')](handleError(_0x4c8887,null));};exports[_0x1bf9('0x4b')]=function(_0x2db1b5,_0x324178){return db['JscriptyQuestionReport'][_0x1bf9('0x48')]({'where':{'id':_0x2db1b5['params']['id']}})[_0x1bf9('0x27')](handleEntityNotFound(_0x324178,null))[_0x1bf9('0x27')](removeEntity(_0x324178,null))['catch'](handleError(_0x324178,null));};exports[_0x1bf9('0x4c')]=function(_0x2b9514,_0x39d29e){return db[_0x1bf9('0x41')][_0x1bf9('0x4c')]()[_0x1bf9('0x27')](respondWithResult(_0x39d29e,null))['catch'](handleError(_0x39d29e,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe81c=['util','../../config/logger','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe81c,0x1ee));var _0xce81=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0xe81c[_0xff5df6];return _0x2634bb;};'use strict';var _=require(_0xce81('0x0'));var util=require(_0xce81('0x1'));var logger=require(_0xce81('0x2'))('api');var moment=require('moment');var BPromise=require(_0xce81('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce81('0x4'));var rimraf=require(_0xce81('0x5'));var config=require('../../config/environment');var attributes=require(_0xce81('0x6'));module['exports']=function(_0x4bc632,_0x3e41be){return _0x4bc632[_0xce81('0x7')](_0xce81('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa260=['moment','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','../../config/logger','api'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xa260,0x6b));var _0x0a26=function(_0x2f30c9,_0x13a37c){_0x2f30c9=_0x2f30c9-0x0;var _0x3417d7=_0xa260[_0x2f30c9];return _0x3417d7;};'use strict';var _=require(_0x0a26('0x0'));var util=require('util');var logger=require(_0x0a26('0x1'))(_0x0a26('0x2'));var moment=require(_0x0a26('0x3'));var BPromise=require(_0x0a26('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a26('0x5'));var rimraf=require(_0x0a26('0x6'));var config=require('../../config/environment');var attributes=require(_0x0a26('0x7'));module[_0x0a26('0x8')]=function(_0x12dd36,_0x38327f){return _0x12dd36[_0x0a26('0x9')](_0x0a26('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf9dc=['error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x44e5f6,_0x1cdb43){var _0x350e0e=function(_0x329ed1){while(--_0x329ed1){_0x44e5f6['push'](_0x44e5f6['shift']());}};_0x350e0e(++_0x1cdb43);}(_0xf9dc,0x67));var _0xcf9d=function(_0x4dbf11,_0x36a91f){_0x4dbf11=_0x4dbf11-0x0;var _0x571bf9=_0xf9dc[_0x4dbf11];return _0x571bf9;};'use strict';var _=require(_0xcf9d('0x0'));var util=require('util');var moment=require(_0xcf9d('0x1'));var BPromise=require(_0xcf9d('0x2'));var rs=require(_0xcf9d('0x3'));var fs=require('fs');var Redis=require(_0xcf9d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf9d('0x5'));var logger=require(_0xcf9d('0x6'))(_0xcf9d('0x7'));var config=require(_0xcf9d('0x8'));var jayson=require(_0xcf9d('0x9'));var client=jayson[_0xcf9d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112a7a,_0x29d9bd,_0x5c7cc5){return new BPromise(function(_0xa236d8,_0x2d98a9){return client[_0xcf9d('0xb')](_0x112a7a,_0x5c7cc5)[_0xcf9d('0xc')](function(_0xe2d5f8){logger[_0xcf9d('0xd')](_0xcf9d('0xe'),_0x29d9bd,_0xcf9d('0xf'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x29d9bd,_0xcf9d('0xf'),JSON[_0xcf9d('0x10')](_0xe2d5f8));if(_0xe2d5f8[_0xcf9d('0x11')]){if(_0xe2d5f8[_0xcf9d('0x11')][_0xcf9d('0x12')]===0x1f4){logger[_0xcf9d('0x11')](_0xcf9d('0xe'),_0x29d9bd,_0xe2d5f8[_0xcf9d('0x11')]['message']);return _0x2d98a9(_0xe2d5f8[_0xcf9d('0x11')][_0xcf9d('0x13')]);}logger[_0xcf9d('0x11')](_0xcf9d('0xe'),_0x29d9bd,_0xe2d5f8[_0xcf9d('0x11')][_0xcf9d('0x13')]);return _0xa236d8(_0xe2d5f8['error']['message']);}else{logger[_0xcf9d('0xd')](_0xcf9d('0xe'),_0x29d9bd,_0xcf9d('0xf'));_0xa236d8(_0xe2d5f8['result'][_0xcf9d('0x13')]);}})['catch'](function(_0x529ad4){logger[_0xcf9d('0x11')](_0xcf9d('0xe'),_0x29d9bd,_0x529ad4);_0x2d98a9(_0x529ad4);});});}
\ No newline at end of file
+var _0x2b13=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2b13,0x1af));var _0x32b1=function(_0x3af7fe,_0x2717f5){_0x3af7fe=_0x3af7fe-0x0;var _0x106045=_0x2b13[_0x3af7fe];return _0x106045;};'use strict';var _=require(_0x32b1('0x0'));var util=require('util');var moment=require(_0x32b1('0x1'));var BPromise=require(_0x32b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x32b1('0x4'))('rpc');var config=require(_0x32b1('0x5'));var jayson=require(_0x32b1('0x6'));var client=jayson[_0x32b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x444866,_0x4b596c,_0x25e5d2){return new BPromise(function(_0x308635,_0x26cef7){return client[_0x32b1('0x8')](_0x444866,_0x25e5d2)['then'](function(_0x49c378){logger['info'](_0x32b1('0x9'),_0x4b596c,_0x32b1('0xa'));logger['debug'](_0x32b1('0xb'),_0x4b596c,_0x32b1('0xa'),JSON['stringify'](_0x49c378));if(_0x49c378[_0x32b1('0xc')]){if(_0x49c378[_0x32b1('0xc')]['code']===0x1f4){logger['error'](_0x32b1('0x9'),_0x4b596c,_0x49c378[_0x32b1('0xc')][_0x32b1('0xd')]);return _0x26cef7(_0x49c378[_0x32b1('0xc')]['message']);}logger[_0x32b1('0xc')](_0x32b1('0x9'),_0x4b596c,_0x49c378['error'][_0x32b1('0xd')]);return _0x308635(_0x49c378[_0x32b1('0xc')][_0x32b1('0xd')]);}else{logger[_0x32b1('0xe')](_0x32b1('0x9'),_0x4b596c,'request\x20sent');_0x308635(_0x49c378[_0x32b1('0xf')][_0x32b1('0xd')]);}})[_0x32b1('0x10')](function(_0x2133fa){logger[_0x32b1('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4b596c,_0x2133fa);_0x26cef7(_0x2133fa);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd275=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','/:id/questions','getQuestions','post','put'];(function(_0x3f2621,_0x569366){var _0x43018c=function(_0x441a01){while(--_0x441a01){_0x3f2621['push'](_0x3f2621['shift']());}};_0x43018c(++_0x569366);}(_0xd275,0x66));var _0x5d27=function(_0x976a8,_0x3035e8){_0x976a8=_0x976a8-0x0;var _0x17bef2=_0xd275[_0x976a8];return _0x17bef2;};'use strict';var multer=require(_0x5d27('0x0'));var util=require(_0x5d27('0x1'));var path=require('path');var timeout=require(_0x5d27('0x2'));var express=require(_0x5d27('0x3'));var router=express[_0x5d27('0x4')]();var fs_extra=require(_0x5d27('0x5'));var auth=require(_0x5d27('0x6'));var interaction=require(_0x5d27('0x7'));var config=require(_0x5d27('0x8'));var controller=require(_0x5d27('0x9'));router[_0x5d27('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5d27('0xa')]('/describe',auth[_0x5d27('0xb')](),controller[_0x5d27('0xc')]);router[_0x5d27('0xa')](_0x5d27('0xd'),auth[_0x5d27('0xb')](),controller['show']);router[_0x5d27('0xa')](_0x5d27('0xe'),auth[_0x5d27('0xb')](),controller[_0x5d27('0xf')]);router[_0x5d27('0x10')]('/',auth[_0x5d27('0xb')](),controller['create']);router[_0x5d27('0x11')](_0x5d27('0xd'),auth[_0x5d27('0xb')](),controller['update']);router[_0x5d27('0x12')](_0x5d27('0xd'),auth[_0x5d27('0xb')](),controller['destroy']);module[_0x5d27('0x13')]=router;
\ No newline at end of file
+var _0x3a6a=['fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','show','/:id/questions','post','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x337f61,_0x1c9f4b){var _0xc40f72=function(_0x14e650){while(--_0x14e650){_0x337f61['push'](_0x337f61['shift']());}};_0xc40f72(++_0x1c9f4b);}(_0x3a6a,0x12c));var _0xa3a6=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x3a6a[_0x2ff238];return _0x204a56;};'use strict';var multer=require(_0xa3a6('0x0'));var util=require('util');var path=require(_0xa3a6('0x1'));var timeout=require(_0xa3a6('0x2'));var express=require(_0xa3a6('0x3'));var router=express['Router']();var fs_extra=require(_0xa3a6('0x4'));var auth=require(_0xa3a6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3a6('0x6'));var controller=require(_0xa3a6('0x7'));router['get']('/',auth[_0xa3a6('0x8')](),controller['index']);router[_0xa3a6('0x9')]('/describe',auth[_0xa3a6('0x8')](),controller['describe']);router[_0xa3a6('0x9')]('/:id',auth[_0xa3a6('0x8')](),controller[_0xa3a6('0xa')]);router[_0xa3a6('0x9')](_0xa3a6('0xb'),auth[_0xa3a6('0x8')](),controller['getQuestions']);router[_0xa3a6('0xc')]('/',auth[_0xa3a6('0x8')](),controller['create']);router[_0xa3a6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa3a6('0xe')]);router[_0xa3a6('0xf')](_0xa3a6('0x10'),auth[_0xa3a6('0x8')](),controller[_0xa3a6('0x11')]);module[_0xa3a6('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4f6=['starttime','endtime','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue'];(function(_0x5ef1ae,_0x10c6a8){var _0x312033=function(_0x4d72a0){while(--_0x4d72a0){_0x5ef1ae['push'](_0x5ef1ae['shift']());}};_0x312033(++_0x10c6a8);}(_0xc4f6,0x64));var _0x6c4f=function(_0xeed2dc,_0x7597c1){_0xeed2dc=_0xeed2dc-0x0;var _0x114bdc=_0xc4f6[_0xeed2dc];return _0x114bdc;};'use strict';var moment=require(_0x6c4f('0x0'));var Sequelize=require(_0x6c4f('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x6c4f('0x2')],'set':function(_0x46612a){this[_0x6c4f('0x3')](_0x6c4f('0x4'),_0x46612a);this[_0x6c4f('0x3')](_0x6c4f('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x6c4f('0x2')]},'membername':{'type':Sequelize[_0x6c4f('0x6')]},'projectname':{'type':Sequelize[_0x6c4f('0x6')]},'queue':{'type':Sequelize[_0x6c4f('0x6')]},'uniqueid':{'type':Sequelize[_0x6c4f('0x6')]},'calleridname':{'type':Sequelize[_0x6c4f('0x6')]},'calleridnum':{'type':Sequelize[_0x6c4f('0x6')]},'completed':{'type':Sequelize[_0x6c4f('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x16c8=['BOOLEAN','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2beba9,_0x304957){var _0xfb6f7e=function(_0x331689){while(--_0x331689){_0x2beba9['push'](_0x2beba9['shift']());}};_0xfb6f7e(++_0x304957);}(_0x16c8,0x1eb));var _0x816c=function(_0x21e74a,_0x580cd0){_0x21e74a=_0x21e74a-0x0;var _0x2dadab=_0x16c8[_0x21e74a];return _0x2dadab;};'use strict';var moment=require('moment');var Sequelize=require(_0x816c('0x0'));module[_0x816c('0x1')]={'starttime':{'type':Sequelize[_0x816c('0x2')],'set':function(_0x13b6e7){this[_0x816c('0x3')](_0x816c('0x4'),_0x13b6e7);this[_0x816c('0x3')](_0x816c('0x5'),moment()[_0x816c('0x6')](_0x816c('0x7')));}},'endtime':{'type':Sequelize[_0x816c('0x2')]},'membername':{'type':Sequelize[_0x816c('0x8')]},'projectname':{'type':Sequelize[_0x816c('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x816c('0x8')]},'calleridname':{'type':Sequelize[_0x816c('0x8')]},'calleridnum':{'type':Sequelize[_0x816c('0x8')]},'completed':{'type':Sequelize[_0x816c('0x9')],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47a9=['update','then','destroy','error','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','getQuestions','JscriptyQuestionReport','keys','hasOwnProperty','SessionId','options','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x47a9,0x7a));var _0x947a=function(_0x505d16,_0x2533d0){_0x505d16=_0x505d16-0x0;var _0x72f929=_0x47a9[_0x505d16];return _0x72f929;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x947a('0x0'));var zipdir=require(_0x947a('0x1'));var jsonpatch=require(_0x947a('0x2'));var rp=require('request-promise');var moment=require(_0x947a('0x3'));var BPromise=require(_0x947a('0x4'));var Mustache=require(_0x947a('0x5'));var util=require(_0x947a('0x6'));var path=require(_0x947a('0x7'));var sox=require('sox');var csv=require(_0x947a('0x8'));var ejs=require(_0x947a('0x9'));var fs=require('fs');var fs_extra=require(_0x947a('0xa'));var _=require(_0x947a('0xb'));var squel=require(_0x947a('0xc'));var crypto=require(_0x947a('0xd'));var jsforce=require(_0x947a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x947a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x947a('0xf'));var authService=require(_0x947a('0x10'));var qs=require(_0x947a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x947a('0x12'));var logger=require(_0x947a('0x13'))(_0x947a('0x14'));var utils=require('../../config/utils');var config=require(_0x947a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x947a('0x16'))['db'];function respondWithStatusCode(_0x5a4703,_0x801e07){_0x801e07=_0x801e07||0xcc;return function(_0x4fa4e1){if(_0x4fa4e1){return _0x5a4703[_0x947a('0x17')](_0x801e07);}return _0x5a4703[_0x947a('0x18')](_0x801e07)[_0x947a('0x19')]();};}function respondWithResult(_0x1f6f19,_0x2be4cf){_0x2be4cf=_0x2be4cf||0xc8;return function(_0x26e5cf){if(_0x26e5cf){return _0x1f6f19[_0x947a('0x18')](_0x2be4cf)['json'](_0x26e5cf);}};}function respondWithFilteredResult(_0x37865b,_0x47be1d){return function(_0x2d3742){if(_0x2d3742){var _0x5444cd=typeof _0x47be1d['offset']===_0x947a('0x1a')&&typeof _0x47be1d['limit']===_0x947a('0x1a');var _0x414a1c=_0x2d3742[_0x947a('0x1b')];var _0xf3ce6b=_0x5444cd?0x0:_0x47be1d[_0x947a('0x1c')];var _0x5a5080=_0x5444cd?_0x2d3742[_0x947a('0x1b')]:_0x47be1d[_0x947a('0x1c')]+_0x47be1d[_0x947a('0x1d')];var _0x40ebda;if(_0x5a5080>=_0x414a1c){_0x5a5080=_0x414a1c;_0x40ebda=0xc8;}else{_0x40ebda=0xce;}_0x37865b[_0x947a('0x18')](_0x40ebda);return _0x37865b['set'](_0x947a('0x1e'),_0xf3ce6b+'-'+_0x5a5080+'/'+_0x414a1c)['json'](_0x2d3742);}return null;};}function patchUpdates(_0x47aa45){return function(_0xb73239){try{jsonpatch[_0x947a('0x1f')](_0xb73239,_0x47aa45,!![]);}catch(_0x40f051){return BPromise[_0x947a('0x20')](_0x40f051);}return _0xb73239[_0x947a('0x21')]();};}function saveUpdates(_0x4d880d,_0x196c84){return function(_0x4a0c08){if(_0x4a0c08){return _0x4a0c08[_0x947a('0x22')](_0x4d880d)[_0x947a('0x23')](function(_0x4341b3){return _0x4341b3;});}return null;};}function removeEntity(_0x7bf7a5,_0x3348e2){return function(_0xaffbda){if(_0xaffbda){return _0xaffbda[_0x947a('0x24')]()[_0x947a('0x23')](function(){_0x7bf7a5[_0x947a('0x18')](0xcc)[_0x947a('0x19')]();});}};}function handleEntityNotFound(_0x5402b0,_0x3b41f8){return function(_0x5cb993){if(!_0x5cb993){_0x5402b0['sendStatus'](0x194);}return _0x5cb993;};}function handleError(_0x5ea8f8,_0x13051f){_0x13051f=_0x13051f||0x1f4;return function(_0x565867){logger[_0x947a('0x25')](_0x565867['stack']);if(_0x565867[_0x947a('0x26')]){delete _0x565867[_0x947a('0x26')];}_0x5ea8f8[_0x947a('0x18')](_0x13051f)['send'](_0x565867);};}exports[_0x947a('0x27')]=function(_0x36accb,_0x58a168){var _0x42b861={},_0x9eb17f={},_0x7dad95={'count':0x0,'rows':[]};var _0x3e3fdd=_[_0x947a('0x28')](db[_0x947a('0x29')][_0x947a('0x2a')],function(_0x1f5e98){return{'name':_0x1f5e98[_0x947a('0x2b')],'type':_0x1f5e98[_0x947a('0x2c')][_0x947a('0x2d')]};});_0x9eb17f[_0x947a('0x2e')]=_[_0x947a('0x28')](_0x3e3fdd,_0x947a('0x26'));_0x9eb17f[_0x947a('0x2f')]=_['keys'](_0x36accb[_0x947a('0x2f')]);_0x9eb17f['filters']=_[_0x947a('0x30')](_0x9eb17f[_0x947a('0x2e')],_0x9eb17f['query']);_0x42b861[_0x947a('0x31')]=_[_0x947a('0x30')](_0x9eb17f[_0x947a('0x2e')],qs[_0x947a('0x32')](_0x36accb[_0x947a('0x2f')]['fields']));_0x42b861[_0x947a('0x31')]=_0x42b861[_0x947a('0x31')][_0x947a('0x33')]?_0x42b861['attributes']:_0x9eb17f[_0x947a('0x2e')];if(!_0x36accb['query']['hasOwnProperty'](_0x947a('0x34'))){_0x42b861[_0x947a('0x1d')]=qs['limit'](_0x36accb[_0x947a('0x2f')][_0x947a('0x1d')]);_0x42b861[_0x947a('0x1c')]=qs[_0x947a('0x1c')](_0x36accb[_0x947a('0x2f')][_0x947a('0x1c')]);}_0x42b861[_0x947a('0x35')]=qs['sort'](_0x36accb[_0x947a('0x2f')][_0x947a('0x36')]);_0x42b861['where']=qs['filters'](_[_0x947a('0x37')](_0x36accb[_0x947a('0x2f')],_0x9eb17f[_0x947a('0x38')]),_0x3e3fdd);if(_0x36accb[_0x947a('0x2f')][_0x947a('0x39')]){_0x42b861[_0x947a('0x3a')]=_[_0x947a('0x3b')](_0x42b861[_0x947a('0x3a')],{'$or':_[_0x947a('0x28')](_0x3e3fdd,function(_0x4dff58){if(_0x4dff58['type']!==_0x947a('0x3c')){var _0x1ffeef={};_0x1ffeef[_0x4dff58[_0x947a('0x26')]]={'$like':'%'+_0x36accb[_0x947a('0x2f')]['filter']+'%'};return _0x1ffeef;}})});}_0x42b861=_['merge']({},_0x42b861,_0x36accb['options']);var _0x49026b={'where':_0x42b861[_0x947a('0x3a')]};return db[_0x947a('0x29')]['count'](_0x49026b)[_0x947a('0x23')](function(_0x391fcd){_0x7dad95[_0x947a('0x1b')]=_0x391fcd;if(_0x36accb[_0x947a('0x2f')][_0x947a('0x3d')]){_0x42b861[_0x947a('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x947a('0x3f')](_0x42b861);})[_0x947a('0x23')](function(_0x457a55){_0x7dad95[_0x947a('0x40')]=_0x457a55;return _0x7dad95;})[_0x947a('0x23')](respondWithFilteredResult(_0x58a168,_0x42b861))['catch'](handleError(_0x58a168,null));};exports[_0x947a('0x41')]=function(_0x4507be,_0x92f246){var _0x960726={'raw':!![],'where':{'id':_0x4507be['params']['id']}},_0x569073={};_0x569073[_0x947a('0x2e')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x569073[_0x947a('0x2f')]=_['keys'](_0x4507be[_0x947a('0x2f')]);_0x569073[_0x947a('0x38')]=_[_0x947a('0x30')](_0x569073['model'],_0x569073[_0x947a('0x2f')]);_0x960726[_0x947a('0x31')]=_[_0x947a('0x30')](_0x569073[_0x947a('0x2e')],qs[_0x947a('0x32')](_0x4507be[_0x947a('0x2f')][_0x947a('0x32')]));_0x960726[_0x947a('0x31')]=_0x960726[_0x947a('0x31')]['length']?_0x960726[_0x947a('0x31')]:_0x569073[_0x947a('0x2e')];if(_0x4507be[_0x947a('0x2f')][_0x947a('0x3d')]){_0x960726[_0x947a('0x3e')]=[{'all':!![]}];}_0x960726=_[_0x947a('0x3b')]({},_0x960726,_0x4507be['options']);return db[_0x947a('0x29')][_0x947a('0x42')](_0x960726)[_0x947a('0x23')](handleEntityNotFound(_0x92f246,null))[_0x947a('0x23')](respondWithResult(_0x92f246,null))[_0x947a('0x43')](handleError(_0x92f246,null));};exports[_0x947a('0x44')]=function(_0x12dc44,_0x116081){return db[_0x947a('0x29')][_0x947a('0x44')](_0x12dc44[_0x947a('0x45')],{})[_0x947a('0x23')](respondWithResult(_0x116081,0xc9))[_0x947a('0x43')](handleError(_0x116081,null));};exports['update']=function(_0x1b80b0,_0x235dc6){if(_0x1b80b0[_0x947a('0x45')]['id']){delete _0x1b80b0['body']['id'];}return db['JscriptySessionReport'][_0x947a('0x42')]({'where':{'id':_0x1b80b0[_0x947a('0x46')]['id']}})[_0x947a('0x23')](handleEntityNotFound(_0x235dc6,null))[_0x947a('0x23')](saveUpdates(_0x1b80b0[_0x947a('0x45')],null))[_0x947a('0x23')](respondWithResult(_0x235dc6,null))['catch'](handleError(_0x235dc6,null));};exports[_0x947a('0x24')]=function(_0x5a38b3,_0x553680){return db[_0x947a('0x29')][_0x947a('0x42')]({'where':{'id':_0x5a38b3[_0x947a('0x46')]['id']}})[_0x947a('0x23')](handleEntityNotFound(_0x553680,null))[_0x947a('0x23')](removeEntity(_0x553680,null))[_0x947a('0x43')](handleError(_0x553680,null));};exports[_0x947a('0x47')]=function(_0x259e53,_0x3e9cd6){return db[_0x947a('0x29')][_0x947a('0x47')]()['then'](respondWithResult(_0x3e9cd6,null))[_0x947a('0x43')](handleError(_0x3e9cd6,null));};exports[_0x947a('0x48')]=function(_0x298053,_0x3d5d3b,_0xfc7882){var _0x27d6ed={'raw':!![],'where':{}};var _0x1e2b99={};var _0x57cd4c={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x298053[_0x947a('0x46')]['id']}})[_0x947a('0x23')](handleEntityNotFound(_0x3d5d3b,null))[_0x947a('0x23')](function(_0x16b277){if(_0x16b277){_0x1e2b99[_0x947a('0x2e')]=_['keys'](db[_0x947a('0x49')][_0x947a('0x2a')]);_0x1e2b99[_0x947a('0x2f')]=_[_0x947a('0x4a')](_0x298053[_0x947a('0x2f')]);_0x1e2b99[_0x947a('0x38')]=_[_0x947a('0x30')](_0x1e2b99[_0x947a('0x2e')],_0x1e2b99['query']);_0x27d6ed['attributes']=_['intersection'](_0x1e2b99[_0x947a('0x2e')],qs[_0x947a('0x32')](_0x298053[_0x947a('0x2f')][_0x947a('0x32')]));_0x27d6ed['attributes']=_0x27d6ed[_0x947a('0x31')]['length']?_0x27d6ed[_0x947a('0x31')]:_0x1e2b99[_0x947a('0x2e')];if(!_0x298053[_0x947a('0x2f')][_0x947a('0x4b')](_0x947a('0x34'))){_0x27d6ed[_0x947a('0x1d')]=qs[_0x947a('0x1d')](_0x298053[_0x947a('0x2f')][_0x947a('0x1d')]);_0x27d6ed['offset']=qs[_0x947a('0x1c')](_0x298053[_0x947a('0x2f')]['offset']);}_0x27d6ed[_0x947a('0x35')]=qs['sort'](_0x298053[_0x947a('0x2f')][_0x947a('0x36')]);_0x27d6ed[_0x947a('0x3a')]=qs[_0x947a('0x38')](_[_0x947a('0x37')](_0x298053[_0x947a('0x2f')],_0x1e2b99[_0x947a('0x38')]));_0x27d6ed[_0x947a('0x3a')][_0x947a('0x4c')]=_0x16b277['id'];if(_0x298053[_0x947a('0x2f')][_0x947a('0x39')]){_0x27d6ed[_0x947a('0x3a')]=_[_0x947a('0x3b')](_0x27d6ed[_0x947a('0x3a')],{'$or':_[_0x947a('0x28')](_0x27d6ed[_0x947a('0x31')],function(_0x1debbb){var _0x101405={};_0x101405[_0x1debbb]={'$like':'%'+_0x298053[_0x947a('0x2f')][_0x947a('0x39')]+'%'};return _0x101405;})});}_0x27d6ed=_['merge']({},_0x27d6ed,_0x298053[_0x947a('0x4d')]);return db[_0x947a('0x49')][_0x947a('0x1b')]({'where':_0x27d6ed[_0x947a('0x3a')]})[_0x947a('0x23')](function(_0x1da922){_0x57cd4c[_0x947a('0x1b')]=_0x1da922;if(_0x298053[_0x947a('0x2f')][_0x947a('0x3d')]){_0x27d6ed[_0x947a('0x3e')]=[{'all':!![]}];}return db[_0x947a('0x49')][_0x947a('0x3f')](_0x27d6ed);})[_0x947a('0x23')](function(_0x44dc93){_0x57cd4c[_0x947a('0x40')]=_0x44dc93;return _0x57cd4c;});}})[_0x947a('0x23')](respondWithFilteredResult(_0x3d5d3b,_0x27d6ed))['catch'](handleError(_0x3d5d3b,null));};
\ No newline at end of file
+var _0x5212=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','set','reject','save','update','then','status','end','stack','name','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','JscriptySessionReport','create','body','destroy','describe','findOne','JscriptyQuestionReport','pick','SessionId','rimraf','zip-dir','moment','mustache','util','path','to-csv'];(function(_0x5d49b6,_0x498146){var _0x57d421=function(_0x5d0ce5){while(--_0x5d0ce5){_0x5d49b6['push'](_0x5d49b6['shift']());}};_0x57d421(++_0x498146);}(_0x5212,0x189));var _0x2521=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x5212[_0x264b9b];return _0x4c7a0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2521('0x0'));var zipdir=require(_0x2521('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2521('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2521('0x3'));var util=require(_0x2521('0x4'));var path=require(_0x2521('0x5'));var sox=require('sox');var csv=require(_0x2521('0x6'));var ejs=require(_0x2521('0x7'));var fs=require('fs');var fs_extra=require(_0x2521('0x8'));var _=require(_0x2521('0x9'));var squel=require(_0x2521('0xa'));var crypto=require(_0x2521('0xb'));var jsforce=require(_0x2521('0xc'));var deskjs=require(_0x2521('0xd'));var toCsv=require(_0x2521('0x6'));var querystring=require(_0x2521('0xe'));var Papa=require(_0x2521('0xf'));var Redis=require('ioredis');var authService=require(_0x2521('0x10'));var qs=require(_0x2521('0x11'));var as=require(_0x2521('0x12'));var hardwareService=require(_0x2521('0x13'));var logger=require(_0x2521('0x14'))(_0x2521('0x15'));var utils=require('../../config/utils');var config=require(_0x2521('0x16'));var licenseUtil=require(_0x2521('0x17'));var db=require(_0x2521('0x18'))['db'];function respondWithStatusCode(_0x3f742d,_0x391905){_0x391905=_0x391905||0xcc;return function(_0x473dd3){if(_0x473dd3){return _0x3f742d[_0x2521('0x19')](_0x391905);}return _0x3f742d['status'](_0x391905)['end']();};}function respondWithResult(_0x399f7f,_0x1ba735){_0x1ba735=_0x1ba735||0xc8;return function(_0x5ea3af){if(_0x5ea3af){return _0x399f7f['status'](_0x1ba735)[_0x2521('0x1a')](_0x5ea3af);}};}function respondWithFilteredResult(_0x4b5558,_0x58f892){return function(_0x3a1b35){if(_0x3a1b35){var _0xc6c5d=typeof _0x58f892[_0x2521('0x1b')]==='undefined'&&typeof _0x58f892['limit']===_0x2521('0x1c');var _0x1ebb35=_0x3a1b35[_0x2521('0x1d')];var _0x37b042=_0xc6c5d?0x0:_0x58f892[_0x2521('0x1b')];var _0x1714bf=_0xc6c5d?_0x3a1b35['count']:_0x58f892[_0x2521('0x1b')]+_0x58f892['limit'];var _0x984967;if(_0x1714bf>=_0x1ebb35){_0x1714bf=_0x1ebb35;_0x984967=0xc8;}else{_0x984967=0xce;}_0x4b5558['status'](_0x984967);return _0x4b5558[_0x2521('0x1e')]('Content-Range',_0x37b042+'-'+_0x1714bf+'/'+_0x1ebb35)[_0x2521('0x1a')](_0x3a1b35);}return null;};}function patchUpdates(_0x2a8a39){return function(_0x2f125b){try{jsonpatch['apply'](_0x2f125b,_0x2a8a39,!![]);}catch(_0x535db9){return BPromise[_0x2521('0x1f')](_0x535db9);}return _0x2f125b[_0x2521('0x20')]();};}function saveUpdates(_0x5df317,_0x58aaff){return function(_0x2c77e4){if(_0x2c77e4){return _0x2c77e4[_0x2521('0x21')](_0x5df317)[_0x2521('0x22')](function(_0x32bd3e){return _0x32bd3e;});}return null;};}function removeEntity(_0x2a2881,_0x3f7c2a){return function(_0x37da86){if(_0x37da86){return _0x37da86['destroy']()[_0x2521('0x22')](function(){_0x2a2881[_0x2521('0x23')](0xcc)[_0x2521('0x24')]();});}};}function handleEntityNotFound(_0x560317,_0x544e65){return function(_0x49bcdc){if(!_0x49bcdc){_0x560317[_0x2521('0x19')](0x194);}return _0x49bcdc;};}function handleError(_0x1fb7cd,_0x2fbf94){_0x2fbf94=_0x2fbf94||0x1f4;return function(_0x4e3057){logger['error'](_0x4e3057[_0x2521('0x25')]);if(_0x4e3057[_0x2521('0x26')]){delete _0x4e3057[_0x2521('0x26')];}_0x1fb7cd[_0x2521('0x23')](_0x2fbf94)['send'](_0x4e3057);};}exports[_0x2521('0x27')]=function(_0x589761,_0x46da66){var _0x767fe0={},_0x73e0ef={},_0x18def5={'count':0x0,'rows':[]};var _0x3c1f3f=_[_0x2521('0x28')](db['JscriptySessionReport']['rawAttributes'],function(_0x3d1ea6){return{'name':_0x3d1ea6[_0x2521('0x29')],'type':_0x3d1ea6['type'][_0x2521('0x2a')]};});_0x73e0ef[_0x2521('0x2b')]=_[_0x2521('0x28')](_0x3c1f3f,_0x2521('0x26'));_0x73e0ef[_0x2521('0x2c')]=_['keys'](_0x589761[_0x2521('0x2c')]);_0x73e0ef[_0x2521('0x2d')]=_[_0x2521('0x2e')](_0x73e0ef['model'],_0x73e0ef[_0x2521('0x2c')]);_0x767fe0[_0x2521('0x2f')]=_[_0x2521('0x2e')](_0x73e0ef[_0x2521('0x2b')],qs[_0x2521('0x30')](_0x589761[_0x2521('0x2c')]['fields']));_0x767fe0[_0x2521('0x2f')]=_0x767fe0[_0x2521('0x2f')][_0x2521('0x31')]?_0x767fe0[_0x2521('0x2f')]:_0x73e0ef[_0x2521('0x2b')];if(!_0x589761[_0x2521('0x2c')][_0x2521('0x32')](_0x2521('0x33'))){_0x767fe0[_0x2521('0x34')]=qs[_0x2521('0x34')](_0x589761['query'][_0x2521('0x34')]);_0x767fe0[_0x2521('0x1b')]=qs[_0x2521('0x1b')](_0x589761[_0x2521('0x2c')][_0x2521('0x1b')]);}_0x767fe0[_0x2521('0x35')]=qs[_0x2521('0x36')](_0x589761[_0x2521('0x2c')]['sort']);_0x767fe0['where']=qs[_0x2521('0x2d')](_['pick'](_0x589761[_0x2521('0x2c')],_0x73e0ef[_0x2521('0x2d')]),_0x3c1f3f);if(_0x589761['query']['filter']){_0x767fe0[_0x2521('0x37')]=_['merge'](_0x767fe0['where'],{'$or':_[_0x2521('0x28')](_0x3c1f3f,function(_0x57c7e5){if(_0x57c7e5[_0x2521('0x38')]!==_0x2521('0x39')){var _0x28d937={};_0x28d937[_0x57c7e5[_0x2521('0x26')]]={'$like':'%'+_0x589761[_0x2521('0x2c')][_0x2521('0x3a')]+'%'};return _0x28d937;}})});}_0x767fe0=_[_0x2521('0x3b')]({},_0x767fe0,_0x589761[_0x2521('0x3c')]);var _0x5ebaab={'where':_0x767fe0[_0x2521('0x37')]};return db['JscriptySessionReport'][_0x2521('0x1d')](_0x5ebaab)[_0x2521('0x22')](function(_0x3020d5){_0x18def5[_0x2521('0x1d')]=_0x3020d5;if(_0x589761['query'][_0x2521('0x3d')]){_0x767fe0[_0x2521('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2521('0x3f')](_0x767fe0);})[_0x2521('0x22')](function(_0x4e7550){_0x18def5[_0x2521('0x40')]=_0x4e7550;return _0x18def5;})[_0x2521('0x22')](respondWithFilteredResult(_0x46da66,_0x767fe0))['catch'](handleError(_0x46da66,null));};exports[_0x2521('0x41')]=function(_0x20daeb,_0x5daf9d){var _0x1a6338={'raw':!![],'where':{'id':_0x20daeb[_0x2521('0x42')]['id']}},_0x51e604={};_0x51e604[_0x2521('0x2b')]=_[_0x2521('0x43')](db['JscriptySessionReport'][_0x2521('0x44')]);_0x51e604[_0x2521('0x2c')]=_['keys'](_0x20daeb[_0x2521('0x2c')]);_0x51e604[_0x2521('0x2d')]=_[_0x2521('0x2e')](_0x51e604[_0x2521('0x2b')],_0x51e604[_0x2521('0x2c')]);_0x1a6338['attributes']=_[_0x2521('0x2e')](_0x51e604[_0x2521('0x2b')],qs[_0x2521('0x30')](_0x20daeb['query']['fields']));_0x1a6338[_0x2521('0x2f')]=_0x1a6338[_0x2521('0x2f')]['length']?_0x1a6338['attributes']:_0x51e604['model'];if(_0x20daeb[_0x2521('0x2c')][_0x2521('0x3d')]){_0x1a6338[_0x2521('0x3e')]=[{'all':!![]}];}_0x1a6338=_[_0x2521('0x3b')]({},_0x1a6338,_0x20daeb[_0x2521('0x3c')]);return db['JscriptySessionReport'][_0x2521('0x45')](_0x1a6338)[_0x2521('0x22')](handleEntityNotFound(_0x5daf9d,null))[_0x2521('0x22')](respondWithResult(_0x5daf9d,null))[_0x2521('0x46')](handleError(_0x5daf9d,null));};exports['create']=function(_0x5336e0,_0x22f3cf){return db[_0x2521('0x47')][_0x2521('0x48')](_0x5336e0[_0x2521('0x49')],{})['then'](respondWithResult(_0x22f3cf,0xc9))['catch'](handleError(_0x22f3cf,null));};exports[_0x2521('0x21')]=function(_0x21af24,_0x1275bc){if(_0x21af24[_0x2521('0x49')]['id']){delete _0x21af24['body']['id'];}return db[_0x2521('0x47')]['find']({'where':{'id':_0x21af24[_0x2521('0x42')]['id']}})[_0x2521('0x22')](handleEntityNotFound(_0x1275bc,null))[_0x2521('0x22')](saveUpdates(_0x21af24['body'],null))['then'](respondWithResult(_0x1275bc,null))[_0x2521('0x46')](handleError(_0x1275bc,null));};exports[_0x2521('0x4a')]=function(_0x29f2fd,_0x472994){return db[_0x2521('0x47')][_0x2521('0x45')]({'where':{'id':_0x29f2fd['params']['id']}})[_0x2521('0x22')](handleEntityNotFound(_0x472994,null))[_0x2521('0x22')](removeEntity(_0x472994,null))[_0x2521('0x46')](handleError(_0x472994,null));};exports[_0x2521('0x4b')]=function(_0x248616,_0x3aea79){return db['JscriptySessionReport'][_0x2521('0x4b')]()[_0x2521('0x22')](respondWithResult(_0x3aea79,null))['catch'](handleError(_0x3aea79,null));};exports['getQuestions']=function(_0x37ec75,_0x235245,_0x44fb6f){var _0x540ab1={'raw':!![],'where':{}};var _0x4bf473={};var _0x27230c={'count':0x0,'rows':[]};return db[_0x2521('0x47')][_0x2521('0x4c')]({'where':{'id':_0x37ec75[_0x2521('0x42')]['id']}})[_0x2521('0x22')](handleEntityNotFound(_0x235245,null))['then'](function(_0x706baf){if(_0x706baf){_0x4bf473['model']=_[_0x2521('0x43')](db[_0x2521('0x4d')]['rawAttributes']);_0x4bf473[_0x2521('0x2c')]=_['keys'](_0x37ec75[_0x2521('0x2c')]);_0x4bf473[_0x2521('0x2d')]=_[_0x2521('0x2e')](_0x4bf473['model'],_0x4bf473[_0x2521('0x2c')]);_0x540ab1[_0x2521('0x2f')]=_['intersection'](_0x4bf473[_0x2521('0x2b')],qs['fields'](_0x37ec75[_0x2521('0x2c')]['fields']));_0x540ab1[_0x2521('0x2f')]=_0x540ab1[_0x2521('0x2f')]['length']?_0x540ab1['attributes']:_0x4bf473[_0x2521('0x2b')];if(!_0x37ec75[_0x2521('0x2c')][_0x2521('0x32')](_0x2521('0x33'))){_0x540ab1['limit']=qs[_0x2521('0x34')](_0x37ec75[_0x2521('0x2c')][_0x2521('0x34')]);_0x540ab1['offset']=qs[_0x2521('0x1b')](_0x37ec75['query']['offset']);}_0x540ab1[_0x2521('0x35')]=qs[_0x2521('0x36')](_0x37ec75[_0x2521('0x2c')][_0x2521('0x36')]);_0x540ab1['where']=qs[_0x2521('0x2d')](_[_0x2521('0x4e')](_0x37ec75[_0x2521('0x2c')],_0x4bf473['filters']));_0x540ab1['where'][_0x2521('0x4f')]=_0x706baf['id'];if(_0x37ec75['query'][_0x2521('0x3a')]){_0x540ab1[_0x2521('0x37')]=_[_0x2521('0x3b')](_0x540ab1['where'],{'$or':_['map'](_0x540ab1[_0x2521('0x2f')],function(_0x5cda5e){var _0x496973={};_0x496973[_0x5cda5e]={'$like':'%'+_0x37ec75[_0x2521('0x2c')]['filter']+'%'};return _0x496973;})});}_0x540ab1=_[_0x2521('0x3b')]({},_0x540ab1,_0x37ec75[_0x2521('0x3c')]);return db[_0x2521('0x4d')][_0x2521('0x1d')]({'where':_0x540ab1[_0x2521('0x37')]})['then'](function(_0x545256){_0x27230c[_0x2521('0x1d')]=_0x545256;if(_0x37ec75[_0x2521('0x2c')][_0x2521('0x3d')]){_0x540ab1[_0x2521('0x3e')]=[{'all':!![]}];}return db[_0x2521('0x4d')][_0x2521('0x3f')](_0x540ab1);})[_0x2521('0x22')](function(_0x52f94b){_0x27230c['rows']=_0x52f94b;return _0x27230c;});}})['then'](respondWithFilteredResult(_0x235245,_0x540ab1))[_0x2521('0x46')](handleError(_0x235245,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa3f=['rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x430817,_0x3b9c40){var _0x50b655=function(_0x26146f){while(--_0x26146f){_0x430817['push'](_0x430817['shift']());}};_0x50b655(++_0x3b9c40);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x441e30,_0x420dd5){_0x441e30=_0x441e30-0x0;var _0x31e650=_0xaa3f[_0x441e30];return _0x31e650;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c09=['rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5a3a81,_0x5e862f){var _0x59f7fa=function(_0x445a70){while(--_0x445a70){_0x5a3a81['push'](_0x5a3a81['shift']());}};_0x59f7fa(++_0x5e862f);}(_0x7c09,0x102));var _0x97c0=function(_0x56e517,_0x10ee40){_0x56e517=_0x56e517-0x0;var _0x3ed369=_0x7c09[_0x56e517];return _0x3ed369;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb016=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1c72a0,_0x3e6dff){var _0x4d4a77=function(_0x200022){while(--_0x200022){_0x1c72a0['push'](_0x1c72a0['shift']());}};_0x4d4a77(++_0x3e6dff);}(_0xb016,0x159));var _0x6b01=function(_0x4d79b4,_0x22e76e){_0x4d79b4=_0x4d79b4-0x0;var _0xbf93e7=_0xb016[_0x4d79b4];return _0xbf93e7;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}
\ No newline at end of file
+var _0x4e2e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x596dac,_0x42ff18){var _0x28c05a=function(_0x3b6b50){while(--_0x3b6b50){_0x596dac['push'](_0x596dac['shift']());}};_0x28c05a(++_0x42ff18);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x396035,_0x3b5fa2){_0x396035=_0x396035-0x0;var _0x57e71b=_0x4e2e[_0x396035];return _0x57e71b;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3ec3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','path','connect-timeout'];(function(_0x50500a,_0x33030a){var _0x47f177=function(_0x21634a){while(--_0x21634a){_0x50500a['push'](_0x50500a['shift']());}};_0x47f177(++_0x33030a);}(_0x3ec3,0x136));var _0x33ec=function(_0x4a98d1,_0x2bef6d){_0x4a98d1=_0x4a98d1-0x0;var _0x279f64=_0x3ec3[_0x4a98d1];return _0x279f64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x33ec('0x0'));var timeout=require(_0x33ec('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x33ec('0x2'));var interaction=require(_0x33ec('0x3'));var config=require(_0x33ec('0x4'));var controller=require(_0x33ec('0x5'));router[_0x33ec('0x6')]('/',controller[_0x33ec('0x7')]);router['put'](_0x33ec('0x8'),auth['isAuthenticated'](),controller[_0x33ec('0x9')]);router['get'](_0x33ec('0xa'),auth[_0x33ec('0xb')](),controller[_0x33ec('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x0839=['get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x2795e9,_0x157740){var _0x279374=function(_0x4fcc9f){while(--_0x4fcc9f){_0x2795e9['push'](_0x2795e9['shift']());}};_0x279374(++_0x157740);}(_0x0839,0x80));var _0x9083=function(_0x5c46d9,_0x3922a0){_0x5c46d9=_0x5c46d9-0x0;var _0x4e6ff7=_0x0839[_0x5c46d9];return _0x4e6ff7;};'use strict';var multer=require(_0x9083('0x0'));var util=require(_0x9083('0x1'));var path=require('path');var timeout=require(_0x9083('0x2'));var express=require('express');var router=express[_0x9083('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9083('0x4'));var config=require(_0x9083('0x5'));var controller=require(_0x9083('0x6'));router[_0x9083('0x7')]('/',controller['index']);router[_0x9083('0x8')](_0x9083('0x9'),auth[_0x9083('0xa')](),controller[_0x9083('0xb')]);router[_0x9083('0x7')](_0x9083('0xc'),auth['isAuthenticated'](),controller[_0x9083('0xd')]);module[_0x9083('0xe')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4b7=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x5e831d,_0x4b1003){var _0x17eca9=function(_0x2e55e6){while(--_0x2e55e6){_0x5e831d['push'](_0x5e831d['shift']());}};_0x17eca9(++_0x4b1003);}(_0xb4b7,0x1c2));var _0x7b4b=function(_0x5f08b9,_0xb953ed){_0x5f08b9=_0x5f08b9-0x0;var _0x147aae=_0xb4b7[_0x5f08b9];return _0x147aae;};'use strict';var Sequelize=require(_0x7b4b('0x0'));module[_0x7b4b('0x1')]={'license':{'type':Sequelize[_0x7b4b('0x2')]},'data1':{'type':Sequelize[_0x7b4b('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x7b4b('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x12d6=['INTEGER','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x12d6,0x1bb));var _0x612d=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0x12d6[_0x6dd5c];return _0x5a87fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x612d('0x0')]},'data2':{'type':Sequelize[_0x612d('0x0')]},'chatLicenseExceeded':{'type':Sequelize[_0x612d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc3c2=['attachment;\x20filename=','text/plain','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','getLicense','catch','body','find','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition'];(function(_0x3672ad,_0x338096){var _0x10ac1d=function(_0xaf97b1){while(--_0xaf97b1){_0x3672ad['push'](_0x3672ad['shift']());}};_0x10ac1d(++_0x338096);}(_0xc3c2,0x11a));var _0x2c3c=function(_0x480285,_0x2072ad){_0x480285=_0x480285-0x0;var _0x44c235=_0xc3c2[_0x480285];return _0x44c235;};'use strict';var emlformat=require(_0x2c3c('0x0'));var rimraf=require(_0x2c3c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c3c('0x2'));var rp=require(_0x2c3c('0x3'));var moment=require(_0x2c3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c3c('0x5'));var util=require(_0x2c3c('0x6'));var path=require(_0x2c3c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2c3c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c3c('0x9'));var squel=require('squel');var crypto=require(_0x2c3c('0xa'));var jsforce=require(_0x2c3c('0xb'));var deskjs=require(_0x2c3c('0xc'));var toCsv=require(_0x2c3c('0xd'));var querystring=require(_0x2c3c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2c3c('0xf'));var qs=require(_0x2c3c('0x10'));var as=require(_0x2c3c('0x11'));var hardwareService=require(_0x2c3c('0x12'));var logger=require(_0x2c3c('0x13'))(_0x2c3c('0x14'));var utils=require(_0x2c3c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2c3c('0x16'));var db=require(_0x2c3c('0x17'))['db'];function respondWithStatusCode(_0x3ec78c,_0x33119c){_0x33119c=_0x33119c||0xcc;return function(_0x25db8d){if(_0x25db8d){return _0x3ec78c[_0x2c3c('0x18')](_0x33119c);}return _0x3ec78c[_0x2c3c('0x19')](_0x33119c)['end']();};}function respondWithResult(_0x2aec38,_0x2fc14c){_0x2fc14c=_0x2fc14c||0xc8;return function(_0x2d5821){if(_0x2d5821){return _0x2aec38['status'](_0x2fc14c)[_0x2c3c('0x1a')](_0x2d5821);}};}function respondWithFilteredResult(_0x4fe566,_0x36037c){return function(_0x3f9fe5){if(_0x3f9fe5){var _0x5af530=typeof _0x36037c[_0x2c3c('0x1b')]===_0x2c3c('0x1c')&&typeof _0x36037c[_0x2c3c('0x1d')]===_0x2c3c('0x1c');var _0x3519b8=_0x3f9fe5[_0x2c3c('0x1e')];var _0x29be1a=_0x5af530?0x0:_0x36037c['offset'];var _0x271a39=_0x5af530?_0x3f9fe5[_0x2c3c('0x1e')]:_0x36037c[_0x2c3c('0x1b')]+_0x36037c[_0x2c3c('0x1d')];var _0x3e5deb;if(_0x271a39>=_0x3519b8){_0x271a39=_0x3519b8;_0x3e5deb=0xc8;}else{_0x3e5deb=0xce;}_0x4fe566[_0x2c3c('0x19')](_0x3e5deb);return _0x4fe566['set'](_0x2c3c('0x1f'),_0x29be1a+'-'+_0x271a39+'/'+_0x3519b8)[_0x2c3c('0x1a')](_0x3f9fe5);}return null;};}function patchUpdates(_0x453858){return function(_0x902e36){try{jsonpatch[_0x2c3c('0x20')](_0x902e36,_0x453858,!![]);}catch(_0x39fee2){return BPromise[_0x2c3c('0x21')](_0x39fee2);}return _0x902e36[_0x2c3c('0x22')]();};}function saveUpdates(_0x52cc70,_0xae3414){return function(_0x44b210){if(_0x44b210){return _0x44b210[_0x2c3c('0x23')](_0x52cc70)['then'](function(_0x1fd192){return _0x1fd192;});}return null;};}function removeEntity(_0x267324,_0x5263c6){return function(_0x2ce79a){if(_0x2ce79a){return _0x2ce79a[_0x2c3c('0x24')]()[_0x2c3c('0x25')](function(){_0x267324['status'](0xcc)[_0x2c3c('0x26')]();});}};}function handleEntityNotFound(_0x47746f,_0x382c78){return function(_0x113d88){if(!_0x113d88){_0x47746f[_0x2c3c('0x18')](0x194);}return _0x113d88;};}function handleError(_0x5d6a67,_0x1138f2){_0x1138f2=_0x1138f2||0x1f4;return function(_0xfbdeab){logger[_0x2c3c('0x27')](_0xfbdeab[_0x2c3c('0x28')]);if(_0xfbdeab[_0x2c3c('0x29')]){delete _0xfbdeab[_0x2c3c('0x29')];}_0x5d6a67['status'](_0x1138f2)[_0x2c3c('0x2a')](_0xfbdeab);};}var utilLicense=require(_0x2c3c('0x16'));exports[_0x2c3c('0x2b')]=function(_0x2f6770,_0x3fd0e4){var _0x5e56da={'raw':!![],'where':{'id':0x1}},_0xdd5995={};_0xdd5995[_0x2c3c('0x2c')]=_[_0x2c3c('0x2d')](db[_0x2c3c('0x2e')][_0x2c3c('0x2f')]);_0xdd5995['query']=_['keys'](_0x2f6770[_0x2c3c('0x30')]);_0xdd5995[_0x2c3c('0x31')]=_[_0x2c3c('0x32')](_0xdd5995[_0x2c3c('0x2c')],_0xdd5995['query']);_0x5e56da['attributes']=_['intersection'](_0xdd5995['model'],qs[_0x2c3c('0x33')](_0x2f6770[_0x2c3c('0x30')][_0x2c3c('0x33')]));_0x5e56da[_0x2c3c('0x34')]=_0x5e56da[_0x2c3c('0x34')]['length']?_0x5e56da['attributes']:_0xdd5995[_0x2c3c('0x2c')];_0x5e56da=_['merge']({},_0x5e56da,_0x2f6770['options']);return utilLicense[_0x2c3c('0x35')](_0x5e56da)[_0x2c3c('0x25')](respondWithResult(_0x3fd0e4,null))[_0x2c3c('0x36')](handleError(_0x3fd0e4,null));};exports[_0x2c3c('0x23')]=function(_0x522c65,_0x1c4c31){if(_0x522c65['body']['id']){delete _0x522c65[_0x2c3c('0x37')]['id'];}return db['License'][_0x2c3c('0x38')]({'where':{'id':_0x522c65['params']['id']}})['then'](handleEntityNotFound(_0x1c4c31,null))[_0x2c3c('0x25')](function(_0x102f7f){var _0x3d7d27=_0x102f7f[_0x2c3c('0x39')]({'plain':!![]});return utilLicense[_0x2c3c('0x3a')](_0x3d7d27,_0x522c65[_0x2c3c('0x37')][_0x2c3c('0x3b')]);})[_0x2c3c('0x25')](function(_0x27831d){if(!_0x27831d[_0x2c3c('0x3c')]){return saveUpdates(_0x522c65[_0x2c3c('0x37')],null);}return _0x27831d;})[_0x2c3c('0x25')](respondWithResult(_0x1c4c31,null))['catch'](handleError(_0x1c4c31,null));};exports[_0x2c3c('0x3d')]=function(_0x76a482,_0x5f151d){var _0x5245a5=_0x2c3c('0x3e');var _0x3e763c=path[_0x2c3c('0x3f')](_0x2c3c('0x40'),_0x2c3c('0x41'),_0x2c3c('0x42'),_0x5245a5);_0x5f151d['setHeader'](_0x2c3c('0x43'),_0x2c3c('0x44')+_0x5245a5);_0x5f151d['set']('Content-Type',_0x2c3c('0x45'));_0x5f151d['download'](_0x3e763c);};
\ No newline at end of file
+var _0x66ca=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','model','query','keys','filters','intersection','attributes','fields','options','catch','License','find','checkLicense','body','key','demo','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','download','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x1c9969,_0x133c34){var _0xd99c53=function(_0x28facd){while(--_0x28facd){_0x1c9969['push'](_0x1c9969['shift']());}};_0xd99c53(++_0x133c34);}(_0x66ca,0x1b0));var _0xa66c=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x66ca[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0xa66c('0x0'));var rimraf=require(_0xa66c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66c('0x2'));var rp=require(_0xa66c('0x3'));var moment=require('moment');var BPromise=require(_0xa66c('0x4'));var Mustache=require('mustache');var util=require(_0xa66c('0x5'));var path=require(_0xa66c('0x6'));var sox=require(_0xa66c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa66c('0x8'));var _=require(_0xa66c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa66c('0xa'));var toCsv=require(_0xa66c('0xb'));var querystring=require(_0xa66c('0xc'));var Papa=require(_0xa66c('0xd'));var Redis=require('ioredis');var authService=require(_0xa66c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66c('0xf'));var logger=require(_0xa66c('0x10'))('api');var utils=require(_0xa66c('0x11'));var config=require(_0xa66c('0x12'));var licenseUtil=require(_0xa66c('0x13'));var db=require(_0xa66c('0x14'))['db'];function respondWithStatusCode(_0x1d8571,_0x6dc0fd){_0x6dc0fd=_0x6dc0fd||0xcc;return function(_0x1b8a23){if(_0x1b8a23){return _0x1d8571['sendStatus'](_0x6dc0fd);}return _0x1d8571[_0xa66c('0x15')](_0x6dc0fd)[_0xa66c('0x16')]();};}function respondWithResult(_0x2bc3c6,_0x172c63){_0x172c63=_0x172c63||0xc8;return function(_0x2b4d7a){if(_0x2b4d7a){return _0x2bc3c6[_0xa66c('0x15')](_0x172c63)[_0xa66c('0x17')](_0x2b4d7a);}};}function respondWithFilteredResult(_0x231202,_0x5f13f2){return function(_0x46d079){if(_0x46d079){var _0x43e5af=typeof _0x5f13f2['offset']==='undefined'&&typeof _0x5f13f2[_0xa66c('0x18')]===_0xa66c('0x19');var _0x394959=_0x46d079[_0xa66c('0x1a')];var _0x8c0a9c=_0x43e5af?0x0:_0x5f13f2[_0xa66c('0x1b')];var _0x6833cb=_0x43e5af?_0x46d079[_0xa66c('0x1a')]:_0x5f13f2['offset']+_0x5f13f2['limit'];var _0x3138e5;if(_0x6833cb>=_0x394959){_0x6833cb=_0x394959;_0x3138e5=0xc8;}else{_0x3138e5=0xce;}_0x231202[_0xa66c('0x15')](_0x3138e5);return _0x231202['set'](_0xa66c('0x1c'),_0x8c0a9c+'-'+_0x6833cb+'/'+_0x394959)[_0xa66c('0x17')](_0x46d079);}return null;};}function patchUpdates(_0x146df2){return function(_0x2cff95){try{jsonpatch[_0xa66c('0x1d')](_0x2cff95,_0x146df2,!![]);}catch(_0xb78d30){return BPromise[_0xa66c('0x1e')](_0xb78d30);}return _0x2cff95['save']();};}function saveUpdates(_0x21ebbb,_0x106cc2){return function(_0x5a9abe){if(_0x5a9abe){return _0x5a9abe[_0xa66c('0x1f')](_0x21ebbb)[_0xa66c('0x20')](function(_0x43738f){return _0x43738f;});}return null;};}function removeEntity(_0x5a35e2,_0x28c076){return function(_0x220403){if(_0x220403){return _0x220403[_0xa66c('0x21')]()[_0xa66c('0x20')](function(){_0x5a35e2[_0xa66c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x405b5e,_0x4d6146){return function(_0x87101b){if(!_0x87101b){_0x405b5e[_0xa66c('0x22')](0x194);}return _0x87101b;};}function handleError(_0x3662a8,_0x455eb4){_0x455eb4=_0x455eb4||0x1f4;return function(_0x277895){logger[_0xa66c('0x23')](_0x277895['stack']);if(_0x277895['name']){delete _0x277895[_0xa66c('0x24')];}_0x3662a8[_0xa66c('0x15')](_0x455eb4)[_0xa66c('0x25')](_0x277895);};}var utilLicense=require(_0xa66c('0x13'));exports[_0xa66c('0x26')]=function(_0x3626ab,_0x4da3bd){var _0x2db61b={'raw':!![],'where':{'id':0x1}},_0x2fe736={};_0x2fe736[_0xa66c('0x27')]=_['keys'](db['License']['rawAttributes']);_0x2fe736[_0xa66c('0x28')]=_[_0xa66c('0x29')](_0x3626ab['query']);_0x2fe736[_0xa66c('0x2a')]=_[_0xa66c('0x2b')](_0x2fe736[_0xa66c('0x27')],_0x2fe736[_0xa66c('0x28')]);_0x2db61b[_0xa66c('0x2c')]=_[_0xa66c('0x2b')](_0x2fe736[_0xa66c('0x27')],qs[_0xa66c('0x2d')](_0x3626ab[_0xa66c('0x28')][_0xa66c('0x2d')]));_0x2db61b['attributes']=_0x2db61b[_0xa66c('0x2c')]['length']?_0x2db61b[_0xa66c('0x2c')]:_0x2fe736[_0xa66c('0x27')];_0x2db61b=_['merge']({},_0x2db61b,_0x3626ab[_0xa66c('0x2e')]);return utilLicense['getLicense'](_0x2db61b)[_0xa66c('0x20')](respondWithResult(_0x4da3bd,null))[_0xa66c('0x2f')](handleError(_0x4da3bd,null));};exports[_0xa66c('0x1f')]=function(_0x1bbf0c,_0x1b3704){if(_0x1bbf0c['body']['id']){delete _0x1bbf0c['body']['id'];}return db[_0xa66c('0x30')][_0xa66c('0x31')]({'where':{'id':_0x1bbf0c['params']['id']}})['then'](handleEntityNotFound(_0x1b3704,null))['then'](function(_0x525098){var _0x24fd0c=_0x525098['get']({'plain':!![]});return utilLicense[_0xa66c('0x32')](_0x24fd0c,_0x1bbf0c[_0xa66c('0x33')][_0xa66c('0x34')]);})[_0xa66c('0x20')](function(_0xba9972){if(!_0xba9972[_0xa66c('0x35')]){return saveUpdates(_0x1bbf0c[_0xa66c('0x33')],null);}return _0xba9972;})[_0xa66c('0x20')](respondWithResult(_0x1b3704,null))[_0xa66c('0x2f')](handleError(_0x1b3704,null));};exports['downloadLogFile']=function(_0x411798,_0x303725){var _0x54cf2c=_0xa66c('0x36');var _0x54f03c=path[_0xa66c('0x37')](_0xa66c('0x38'),_0xa66c('0x39'),_0xa66c('0x3a'),_0x54cf2c);_0x303725[_0xa66c('0x3b')](_0xa66c('0x3c'),_0xa66c('0x3d')+_0x54cf2c);_0x303725[_0xa66c('0x3e')]('Content-Type','text/plain');_0x303725[_0xa66c('0x3f')](_0x54f03c);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd1c=['api','moment','request-promise','path','./license.attributes','define','License','license','lodash','../../config/logger'];(function(_0x137b58,_0x198e21){var _0x17bcb1=function(_0x304ac9){while(--_0x304ac9){_0x137b58['push'](_0x137b58['shift']());}};_0x17bcb1(++_0x198e21);}(_0xbd1c,0x166));var _0xcbd1=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xbd1c[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xcbd1('0x0'));var util=require('util');var logger=require(_0xcbd1('0x1'))(_0xcbd1('0x2'));var moment=require(_0xcbd1('0x3'));var BPromise=require('bluebird');var rp=require(_0xcbd1('0x4'));var fs=require('fs');var path=require(_0xcbd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbd1('0x6'));module['exports']=function(_0x1163fd,_0x2b2785){return _0x1163fd[_0xcbd1('0x7')](_0xcbd1('0x8'),attributes,{'tableName':_0xcbd1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x462f=['path','rimraf','../../config/environment','./license.attributes','define','license','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0x462f,0x16e));var _0xf462=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x462f[_0x8560d3];return _0x33b1b5;};'use strict';var _=require(_0xf462('0x0'));var util=require(_0xf462('0x1'));var logger=require(_0xf462('0x2'))(_0xf462('0x3'));var moment=require(_0xf462('0x4'));var BPromise=require(_0xf462('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf462('0x6'));var rimraf=require(_0xf462('0x7'));var config=require(_0xf462('0x8'));var attributes=require(_0xf462('0x9'));module['exports']=function(_0x394595,_0x419108){return _0x394595[_0xf462('0xa')]('License',attributes,{'tableName':_0xf462('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xefed=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','message','catch','lodash'];(function(_0x458bd0,_0x5f54ad){var _0x1f5916=function(_0xc412ff){while(--_0xc412ff){_0x458bd0['push'](_0x458bd0['shift']());}};_0x1f5916(++_0x5f54ad);}(_0xefed,0x19d));var _0xdefe=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0xefed[_0x52ea08];return _0x28d546;};'use strict';var _=require(_0xdefe('0x0'));var util=require(_0xdefe('0x1'));var moment=require(_0xdefe('0x2'));var BPromise=require(_0xdefe('0x3'));var rs=require(_0xdefe('0x4'));var fs=require('fs');var Redis=require(_0xdefe('0x5'));var db=require(_0xdefe('0x6'))['db'];var utils=require(_0xdefe('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xdefe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdefe('0x9')][_0xdefe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51ce82,_0x3c370a,_0x9c8316){return new BPromise(function(_0x486657,_0x25a5d8){return client['request'](_0x51ce82,_0x9c8316)[_0xdefe('0xb')](function(_0x5e6887){logger['info'](_0xdefe('0xc'),_0x3c370a,_0xdefe('0xd'));logger[_0xdefe('0xe')](_0xdefe('0xf'),_0x3c370a,_0xdefe('0xd'),JSON[_0xdefe('0x10')](_0x5e6887));if(_0x5e6887[_0xdefe('0x11')]){if(_0x5e6887[_0xdefe('0x11')][_0xdefe('0x12')]===0x1f4){logger['error'](_0xdefe('0xc'),_0x3c370a,_0x5e6887['error']['message']);return _0x25a5d8(_0x5e6887[_0xdefe('0x11')]['message']);}logger[_0xdefe('0x11')](_0xdefe('0xc'),_0x3c370a,_0x5e6887['error']['message']);return _0x486657(_0x5e6887[_0xdefe('0x11')]['message']);}else{logger[_0xdefe('0x13')](_0xdefe('0xc'),_0x3c370a,_0xdefe('0xd'));_0x486657(_0x5e6887[_0xdefe('0x14')][_0xdefe('0x15')]);}})[_0xdefe('0x16')](function(_0x449d91){logger[_0xdefe('0x11')](_0xdefe('0xc'),_0x3c370a,_0x449d91);_0x25a5d8(_0x449d91);});});}
\ No newline at end of file
+var _0xd4f8=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x334a4a,_0x5afb9b){var _0x2bdde9=function(_0x442686){while(--_0x442686){_0x334a4a['push'](_0x334a4a['shift']());}};_0x2bdde9(++_0x5afb9b);}(_0xd4f8,0xba));var _0x8d4f=function(_0x299f5c,_0x5f4687){_0x299f5c=_0x299f5c-0x0;var _0x15a3e9=_0xd4f8[_0x299f5c];return _0x15a3e9;};'use strict';var _=require(_0x8d4f('0x0'));var util=require(_0x8d4f('0x1'));var moment=require('moment');var BPromise=require(_0x8d4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d4f('0x3'))['db'];var utils=require(_0x8d4f('0x4'));var logger=require(_0x8d4f('0x5'))(_0x8d4f('0x6'));var config=require(_0x8d4f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x565c84,_0x3cd399,_0x200dbb){return new BPromise(function(_0x5cfce1,_0x17152f){return client[_0x8d4f('0x9')](_0x565c84,_0x200dbb)[_0x8d4f('0xa')](function(_0x485713){logger[_0x8d4f('0xb')](_0x8d4f('0xc'),_0x3cd399,_0x8d4f('0xd'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x3cd399,'request\x20sent',JSON[_0x8d4f('0xe')](_0x485713));if(_0x485713[_0x8d4f('0xf')]){if(_0x485713[_0x8d4f('0xf')][_0x8d4f('0x10')]===0x1f4){logger[_0x8d4f('0xf')]('License,\x20%s,\x20%s',_0x3cd399,_0x485713['error'][_0x8d4f('0x11')]);return _0x17152f(_0x485713[_0x8d4f('0xf')][_0x8d4f('0x11')]);}logger[_0x8d4f('0xf')](_0x8d4f('0xc'),_0x3cd399,_0x485713['error'][_0x8d4f('0x11')]);return _0x5cfce1(_0x485713[_0x8d4f('0xf')]['message']);}else{logger[_0x8d4f('0xb')](_0x8d4f('0xc'),_0x3cd399,_0x8d4f('0xd'));_0x5cfce1(_0x485713['result'][_0x8d4f('0x11')]);}})[_0x8d4f('0x12')](function(_0x402d0d){logger[_0x8d4f('0xf')]('License,\x20%s,\x20%s',_0x3cd399,_0x402d0d);_0x17152f(_0x402d0d);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb335=['verifySmtp','/:id/users','post','addDisposition','addAnswer','addImap','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0xb335,0xa4));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5b33('0x0'));var util=require(_0x5b33('0x1'));var path=require(_0x5b33('0x2'));var timeout=require(_0x5b33('0x3'));var express=require(_0x5b33('0x4'));var router=express['Router']();var fs_extra=require(_0x5b33('0x5'));var auth=require(_0x5b33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b33('0x7'));var controller=require(_0x5b33('0x8'));router[_0x5b33('0x9')]('/',auth[_0x5b33('0xa')](),controller[_0x5b33('0xb')]);router[_0x5b33('0x9')](_0x5b33('0xc'),auth[_0x5b33('0xa')](),controller[_0x5b33('0xd')]);router['get'](_0x5b33('0xe'),auth[_0x5b33('0xa')](),controller[_0x5b33('0xf')]);router['get'](_0x5b33('0x10'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x11')]);router[_0x5b33('0x9')](_0x5b33('0x12'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x13')]);router['get'](_0x5b33('0x14'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x15')]);router[_0x5b33('0x9')]('/:id/out_servers',auth[_0x5b33('0xa')](),controller[_0x5b33('0x16')]);router[_0x5b33('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5b33('0x17')]);router[_0x5b33('0x9')](_0x5b33('0x18'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x19')]);router['get']('/:id/messages',auth[_0x5b33('0xa')](),controller[_0x5b33('0x1a')]);router[_0x5b33('0x9')](_0x5b33('0x1b'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x1c')]);router[_0x5b33('0x9')](_0x5b33('0x1d'),auth[_0x5b33('0xa')](),controller['getAgents']);router[_0x5b33('0x1e')](_0x5b33('0x10'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x1f')]);router['post'](_0x5b33('0x12'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x20')]);router[_0x5b33('0x1e')]('/',auth[_0x5b33('0xa')](),controller['create']);router[_0x5b33('0x1e')](_0x5b33('0x14'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x21')]);router[_0x5b33('0x1e')](_0x5b33('0x22'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x23')]);router['post'](_0x5b33('0x24'),auth['isAuthenticated'](),controller[_0x5b33('0x25')]);router[_0x5b33('0x1e')]('/:id/applications',auth[_0x5b33('0xa')](),controller[_0x5b33('0x26')]);router[_0x5b33('0x1e')]('/:id/send',auth[_0x5b33('0xa')](),controller['send']);router['post']('/:id/users',auth[_0x5b33('0xa')](),controller['addAgents']);router[_0x5b33('0x27')]('/:id',auth[_0x5b33('0xa')](),controller['update']);router[_0x5b33('0x28')](_0x5b33('0x10'),auth['isAuthenticated'](),controller[_0x5b33('0x29')]);router[_0x5b33('0x28')](_0x5b33('0x12'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2a')]);router[_0x5b33('0x28')](_0x5b33('0x14'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2b')]);router[_0x5b33('0x28')](_0x5b33('0x22'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2c')]);router[_0x5b33('0x28')](_0x5b33('0xe'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2d')]);router['delete'](_0x5b33('0x1d'),auth[_0x5b33('0xa')](),controller[_0x5b33('0x2e')]);module[_0x5b33('0x2f')]=router;
\ No newline at end of file
+var _0x4c42=['create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','put','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition'];(function(_0x2dd9d2,_0x2be399){var _0x27c796=function(_0x57e158){while(--_0x57e158){_0x2dd9d2['push'](_0x2dd9d2['shift']());}};_0x27c796(++_0x2be399);}(_0x4c42,0x14a));var _0x24c4=function(_0x22b662,_0x2f7e51){_0x22b662=_0x22b662-0x0;var _0x12249b=_0x4c42[_0x22b662];return _0x12249b;};'use strict';var multer=require(_0x24c4('0x0'));var util=require(_0x24c4('0x1'));var path=require(_0x24c4('0x2'));var timeout=require(_0x24c4('0x3'));var express=require(_0x24c4('0x4'));var router=express[_0x24c4('0x5')]();var fs_extra=require(_0x24c4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x24c4('0x7'));var config=require(_0x24c4('0x8'));var controller=require(_0x24c4('0x9'));router[_0x24c4('0xa')]('/',auth[_0x24c4('0xb')](),controller[_0x24c4('0xc')]);router[_0x24c4('0xa')]('/describe',auth[_0x24c4('0xb')](),controller[_0x24c4('0xd')]);router['get'](_0x24c4('0xe'),auth[_0x24c4('0xb')](),controller[_0x24c4('0xf')]);router['get'](_0x24c4('0x10'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x11')]);router['get'](_0x24c4('0x12'),auth['isAuthenticated'](),controller[_0x24c4('0x13')]);router[_0x24c4('0xa')](_0x24c4('0x14'),auth['isAuthenticated'](),controller[_0x24c4('0x15')]);router[_0x24c4('0xa')]('/:id/out_servers',auth[_0x24c4('0xb')](),controller[_0x24c4('0x16')]);router[_0x24c4('0xa')](_0x24c4('0x17'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x18')]);router[_0x24c4('0xa')]('/:id/applications',auth[_0x24c4('0xb')](),controller[_0x24c4('0x19')]);router[_0x24c4('0xa')](_0x24c4('0x1a'),auth['isAuthenticated'](),controller[_0x24c4('0x1b')]);router['get'](_0x24c4('0x1c'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x1d')]);router['get'](_0x24c4('0x1e'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x1f')]);router[_0x24c4('0x20')]('/:id/dispositions',auth[_0x24c4('0xb')](),controller[_0x24c4('0x21')]);router['post']('/:id/canned_answers',auth[_0x24c4('0xb')](),controller['addAnswer']);router[_0x24c4('0x20')]('/',auth[_0x24c4('0xb')](),controller[_0x24c4('0x22')]);router[_0x24c4('0x20')](_0x24c4('0x14'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x23')]);router[_0x24c4('0x20')]('/:id/out_servers',auth[_0x24c4('0xb')](),controller[_0x24c4('0x24')]);router[_0x24c4('0x20')]('/:id/interactions',auth[_0x24c4('0xb')](),controller[_0x24c4('0x25')]);router[_0x24c4('0x20')](_0x24c4('0x26'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x27')]);router[_0x24c4('0x20')](_0x24c4('0x28'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x29')]);router[_0x24c4('0x20')](_0x24c4('0x1e'),auth[_0x24c4('0xb')](),controller['addAgents']);router[_0x24c4('0x2a')](_0x24c4('0xe'),auth[_0x24c4('0xb')](),controller['update']);router[_0x24c4('0x2b')](_0x24c4('0x10'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x2c')]);router[_0x24c4('0x2b')](_0x24c4('0x12'),auth['isAuthenticated'](),controller[_0x24c4('0x2d')]);router[_0x24c4('0x2b')]('/:id/in_servers',auth[_0x24c4('0xb')](),controller[_0x24c4('0x2e')]);router['delete'](_0x24c4('0x2f'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x30')]);router[_0x24c4('0x2b')](_0x24c4('0xe'),auth[_0x24c4('0xb')](),controller[_0x24c4('0x31')]);router[_0x24c4('0x2b')](_0x24c4('0x1e'),auth['isAuthenticated'](),controller[_0x24c4('0x32')]);module[_0x24c4('0x33')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75b4=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','custom','setDataValue','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}'];(function(_0x4e7e66,_0x1a1921){var _0x3213c=function(_0x14bebe){while(--_0x14bebe){_0x4e7e66['push'](_0x4e7e66['shift']());}};_0x3213c(++_0x1a1921);}(_0x75b4,0xbe));var _0x475b=function(_0x1f799b,_0x505426){_0x1f799b=_0x1f799b-0x0;var _0xbe4c43=_0x75b4[_0x1f799b];return _0xbe4c43;};'use strict';var Sequelize=require(_0x475b('0x0'));module[_0x475b('0x1')]={'description':{'type':Sequelize[_0x475b('0x2')]},'name':{'type':Sequelize[_0x475b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x475b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x475b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x475b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x475b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x475b('0x4')]},'markAsUnread':{'type':Sequelize[_0x475b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x475b('0x5')},'fontSize':{'type':Sequelize[_0x475b('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x475b('0x4')],'defaultValue':function(){return _0x475b('0x7');}},'notificationSound':{'type':Sequelize[_0x475b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x475b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x475b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x475b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x475b('0x9'),'set':function(_0x2d9c52){if(!_0x2d9c52)this['setDataValue'](_0x475b('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x2d9c52);}},'provider':{'type':Sequelize[_0x475b('0xb')](_0x475b('0xc'),_0x475b('0xd'),'yahoo',_0x475b('0xe')),'defaultValue':null,'get':function(){var _0x13bf26=this['getDataValue']('provider');return _0x13bf26||_0x475b('0xf');},'set':function(_0x3f01c7){if(_0x3f01c7===_0x475b('0xf')){_0x3f01c7=null;}return this[_0x475b('0x10')](_0x475b('0x11'),_0x3f01c7);}}};
\ No newline at end of file
+var _0xdf35=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','hotmail','outlook365','getDataValue','provider'];(function(_0x872d14,_0xf9e81f){var _0x50eff4=function(_0x51dfa8){while(--_0x51dfa8){_0x872d14['push'](_0x872d14['shift']());}};_0x50eff4(++_0xf9e81f);}(_0xdf35,0xa2));var _0x5df3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdf35[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x5df3('0x0'));module[_0x5df3('0x1')]={'description':{'type':Sequelize[_0x5df3('0x2')]},'name':{'type':Sequelize[_0x5df3('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5df3('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5df3('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5df3('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5df3('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5df3('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5df3('0x5')},'fontSize':{'type':Sequelize[_0x5df3('0x6')](0x2)[_0x5df3('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5df3('0x4')],'defaultValue':function(){return _0x5df3('0x8');}},'notificationSound':{'type':Sequelize[_0x5df3('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5df3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5df3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5df3('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5df3('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5df3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5df3('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x5df3('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5df3('0x3')],'defaultValue':![],'comment':_0x5df3('0xa'),'set':function(_0xb5c10b){if(!_0xb5c10b)this[_0x5df3('0xb')](_0x5df3('0xc'),null);this[_0x5df3('0xb')]('mandatoryDisposition',_0xb5c10b);}},'provider':{'type':Sequelize[_0x5df3('0xd')]('gmail',_0x5df3('0xe'),'yahoo',_0x5df3('0xf')),'defaultValue':null,'get':function(){if(!this[_0x5df3('0x10')](_0x5df3('0x11')))return'custom';return this[_0x5df3('0x10')](_0x5df3('0x11'));},'set':function(_0x1535d8){if(_0x1535d8==='custom')_0x1535d8=null;return this[_0x5df3('0xb')](_0x5df3('0x11'),_0x1535d8);}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb694=['modernAuthentication','CloudProviderId','host','service','authentication','Imap','port','Smtp','MailServerOut','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','MailAccount','include','findAll','catch','show','params','mandatoryDispositionPause','rawAttributes','includeAll','find','body','provider','custom','MailServerIn','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','rows','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','Contacts','updatedAt','DESC','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','server/files/attachments','getSmtpOptions','List','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','CloudProvider','VerifySmtp','Sequelize','ValidationError','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','moment','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','sendStatus','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','user','username','pass','password'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xb694,0x144));var _0x4b69=function(_0x362916,_0x46268a){_0x362916=_0x362916-0x0;var _0x8cb45a=_0xb694[_0x362916];return _0x8cb45a;};'use strict';var moment=require(_0x4b69('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x4b69('0x1'));var _=require('lodash');var juice=require('juice');var Redis=require(_0x4b69('0x2'));var qs=require(_0x4b69('0x3'));var logger=require(_0x4b69('0x4'))(_0x4b69('0x5'));var config=require(_0x4b69('0x6'));var db=require(_0x4b69('0x7'))['db'];config[_0x4b69('0x8')]=_[_0x4b69('0x9')](config[_0x4b69('0x8')],{'host':_0x4b69('0xa'),'port':0x18eb});var socket=require(_0x4b69('0xb'))(new Redis(config[_0x4b69('0x8')]));require(_0x4b69('0xc'))[_0x4b69('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4b69('0xe')][_0x4b69('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x2db054,_0x18c07c,_0x1674ea,_0x4e5315){return new BPromise(function(_0x3a8bd6,_0x5b1d3c){var _0x29bc84=_0x4e5315||client;return _0x29bc84[_0x4b69('0x10')](_0x2db054,_0x1674ea)[_0x4b69('0x11')](function(_0x4d1bcc){logger[_0x4b69('0x12')](_0x4b69('0x13'),_0x18c07c,_0x4b69('0x14'));logger['debug'](_0x4b69('0x15'),_0x18c07c,_0x4b69('0x14'),JSON[_0x4b69('0x16')](_0x4d1bcc));if(_0x4d1bcc[_0x4b69('0x17')]){if(_0x4d1bcc[_0x4b69('0x17')][_0x4b69('0x18')]===0x1f4){logger[_0x4b69('0x17')]('MailAccount,\x20%s,\x20%s',_0x18c07c,_0x4d1bcc[_0x4b69('0x17')]['message']);return _0x5b1d3c(_0x4d1bcc[_0x4b69('0x17')]['message']);}logger[_0x4b69('0x17')](_0x4b69('0x13'),_0x18c07c,_0x4d1bcc[_0x4b69('0x17')]['message']);return _0x3a8bd6(_0x4d1bcc[_0x4b69('0x17')][_0x4b69('0x19')]);}else{logger[_0x4b69('0x12')](_0x4b69('0x13'),_0x18c07c,_0x4b69('0x14'));_0x3a8bd6(_0x4d1bcc[_0x4b69('0x1a')]['message']);}})['catch'](function(_0x1014b7){logger[_0x4b69('0x17')](_0x4b69('0x13'),_0x18c07c,_0x1014b7);_0x5b1d3c(_0x1014b7);});});}function respondWithStatusCode(_0xff6649,_0x3c0575){_0x3c0575=_0x3c0575||0xcc;return function(_0x5052c0){if(_0x5052c0){return _0xff6649['sendStatus'](_0x3c0575);}return _0xff6649['status'](_0x3c0575)['end']();};}function respondWithResult(_0x4dc347,_0x450d30){_0x450d30=_0x450d30||0xc8;return function(_0x4cc704){if(_0x4cc704){return _0x4dc347[_0x4b69('0x1b')](_0x450d30)[_0x4b69('0x1c')](_0x4cc704);}};}function respondWithFilteredResult(_0x1290f7,_0x2e6de0){return function(_0x77091a){if(_0x77091a){var _0x52ed2b=typeof _0x2e6de0[_0x4b69('0x1d')]===_0x4b69('0x1e')&&typeof _0x2e6de0[_0x4b69('0x1f')]===_0x4b69('0x1e');var _0x332ec2=_0x77091a[_0x4b69('0x20')];var _0x11fad9=_0x52ed2b?0x0:_0x2e6de0[_0x4b69('0x1d')];var _0x321296=_0x52ed2b?_0x77091a[_0x4b69('0x20')]:_0x2e6de0[_0x4b69('0x1d')]+_0x2e6de0[_0x4b69('0x1f')];var _0x3fcada;if(_0x321296>=_0x332ec2){_0x321296=_0x332ec2;_0x3fcada=0xc8;}else{_0x3fcada=0xce;}_0x1290f7[_0x4b69('0x1b')](_0x3fcada);return _0x1290f7['set'](_0x4b69('0x21'),_0x11fad9+'-'+_0x321296+'/'+_0x332ec2)['json'](_0x77091a);}return null;};}function saveUpdates(_0x4ed40e){return function(_0x5d24ed){if(_0x5d24ed){return _0x5d24ed[_0x4b69('0x22')](_0x4ed40e)[_0x4b69('0x11')](function(_0x3ca2c0){return _0x3ca2c0;});}return null;};}function removeEntity(_0x3a515e){return function(_0x1559f3){if(_0x1559f3){return _0x1559f3[_0x4b69('0x23')]()[_0x4b69('0x11')](function(){var _0x15e2b7=_0x1559f3['get']({'plain':!![]});var _0x165cbf='MailAccounts';return db['UserProfileResource'][_0x4b69('0x23')]({'where':{'type':_0x165cbf,'resourceId':_0x15e2b7['id']}})[_0x4b69('0x11')](function(){return _0x1559f3;});})['then'](function(){_0x3a515e[_0x4b69('0x1b')](0xcc)[_0x4b69('0x24')]();});}};}function handleEntityNotFound(_0x36c049){return function(_0x4b8fd1){if(!_0x4b8fd1){_0x36c049[_0x4b69('0x25')](0x194);}return _0x4b8fd1;};}function handleError(_0x450e17,_0x430485){_0x430485=_0x430485||0x1f4;return function(_0x562a53){logger[_0x4b69('0x17')](_0x562a53[_0x4b69('0x26')]);if(_0x562a53[_0x4b69('0x27')]){delete _0x562a53[_0x4b69('0x27')];}_0x450e17[_0x4b69('0x1b')](_0x430485)[_0x4b69('0x28')](_0x562a53);};}function getImapHost(_0x562728){switch(_0x562728){case _0x4b69('0x29'):return _0x4b69('0x2a');case _0x4b69('0x2b'):return'imap.mail.yahoo.com';case _0x4b69('0x2c'):return _0x4b69('0x2d');case'outlook365':return _0x4b69('0x2e');}throw new Error(_0x4b69('0x2f'),_0x562728);}function getSmtpHost(_0x19f4c6){switch(_0x19f4c6){case'gmail':return _0x4b69('0x30');case'yahoo':return _0x4b69('0x31');case'hotmail':return _0x4b69('0x32');case _0x4b69('0x33'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x19f4c6);}function getAuthenticationOptions(_0xb9686b,_0x5b04ed){var _0x24db83={};var _0x2e7d4d={};if(_0xb9686b){_0x24db83[_0x4b69('0x34')]=_0x2e7d4d[_0x4b69('0x34')]=_0x5b04ed[_0x4b69('0x35')];_0x24db83['password']=_0x2e7d4d[_0x4b69('0x36')]=_0x5b04ed[_0x4b69('0x37')];if(_0x5b04ed[_0x4b69('0x38')]){_0x24db83[_0x4b69('0x38')]=_0x2e7d4d['modernAuthentication']=!![];_0x24db83[_0x4b69('0x39')]=_0x2e7d4d[_0x4b69('0x39')]=_0x5b04ed[_0x4b69('0x39')];_0x24db83['password']=_0x2e7d4d[_0x4b69('0x36')]=null;}else{_0x24db83['CloudProviderId']=_0x2e7d4d[_0x4b69('0x39')]=null;}_0x24db83[_0x4b69('0x3a')]=getImapHost(_0xb9686b);_0x24db83['port']=0x3e1;_0x2e7d4d['host']=getSmtpHost(_0xb9686b);_0x2e7d4d['port']=0x24b;_0x2e7d4d['secure']=![];_0x24db83[_0x4b69('0x3b')]=_0x2e7d4d[_0x4b69('0x3b')]=null;}else{if(_0x5b04ed['authentication']){_0x24db83[_0x4b69('0x34')]=_0x2e7d4d[_0x4b69('0x34')]=_0x5b04ed[_0x4b69('0x35')];_0x24db83['password']=_0x2e7d4d[_0x4b69('0x36')]=_0x5b04ed[_0x4b69('0x37')];}else{_0x24db83[_0x4b69('0x3c')]=_0x2e7d4d[_0x4b69('0x3c')]=![];_0x24db83[_0x4b69('0x34')]=_0x2e7d4d[_0x4b69('0x34')]=null;_0x24db83[_0x4b69('0x37')]=_0x2e7d4d[_0x4b69('0x36')]=null;}_0x24db83[_0x4b69('0x3a')]=_0x5b04ed[_0x4b69('0x3d')][_0x4b69('0x3a')];_0x24db83[_0x4b69('0x3e')]=_0x5b04ed[_0x4b69('0x3d')][_0x4b69('0x3e')];_0x2e7d4d[_0x4b69('0x3a')]=_0x5b04ed[_0x4b69('0x3f')][_0x4b69('0x3a')];_0x2e7d4d[_0x4b69('0x3e')]=_0x5b04ed[_0x4b69('0x3f')][_0x4b69('0x3e')];}return{'Imap':_0x24db83,'Smtp':_0x2e7d4d};}exports['index']=function(_0x4c7806,_0x2cd66f){var _0xe2a681={'include':[{'model':db['MailServerIn'],'as':_0x4b69('0x3d')},{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5cfc2b={},_0x1a70c0={'count':0x0,'rows':[]};var _0x95c418=_['map'](db['MailAccount']['rawAttributes'],function(_0x12e67c){return{'name':_0x12e67c[_0x4b69('0x41')],'type':_0x12e67c[_0x4b69('0x42')][_0x4b69('0x43')]};});_0x5cfc2b['model']=_[_0x4b69('0x44')](_0x95c418,_0x4b69('0x27'));_0x5cfc2b[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x4c7806['query']);_0x5cfc2b['filters']=_[_0x4b69('0x47')](_0x5cfc2b[_0x4b69('0x48')],_0x5cfc2b['query']);_0xe2a681['attributes']=_[_0x4b69('0x47')](_0x5cfc2b[_0x4b69('0x48')],qs[_0x4b69('0x49')](_0x4c7806[_0x4b69('0x45')][_0x4b69('0x49')]));_0xe2a681[_0x4b69('0x4a')]=_0xe2a681['attributes'][_0x4b69('0x4b')]?_0xe2a681['attributes']:_0x5cfc2b['model'];if(!_0x4c7806[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0xe2a681[_0x4b69('0x1f')]=qs['limit'](_0x4c7806[_0x4b69('0x45')]['limit']);_0xe2a681[_0x4b69('0x1d')]=qs[_0x4b69('0x1d')](_0x4c7806[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0xe2a681[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x4c7806[_0x4b69('0x45')][_0x4b69('0x4f')]);_0xe2a681[_0x4b69('0x50')]=qs['filters'](_[_0x4b69('0x51')](_0x4c7806[_0x4b69('0x45')],_0x5cfc2b[_0x4b69('0x52')]),_0x95c418);if(_0x4c7806[_0x4b69('0x45')][_0x4b69('0x53')]){_0xe2a681[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0xe2a681[_0x4b69('0x50')],{'$or':_['map'](_0x95c418,function(_0x27a5cf){if(_0x27a5cf[_0x4b69('0x42')]!=='VIRTUAL'){var _0x2db6d6={};_0x2db6d6[_0x27a5cf[_0x4b69('0x27')]]={'$like':'%'+_0x4c7806[_0x4b69('0x45')]['filter']+'%'};return _0x2db6d6;}})});}_0xe2a681=_[_0x4b69('0x54')]({},_0xe2a681,_0x4c7806[_0x4b69('0x55')]);var _0x324d9a={'where':_0xe2a681[_0x4b69('0x50')]};return db[_0x4b69('0x56')][_0x4b69('0x20')](_0x324d9a)[_0x4b69('0x11')](function(_0x1aca1f){_0x1a70c0['count']=_0x1aca1f;if(_0x4c7806[_0x4b69('0x45')]['includeAll']){_0xe2a681[_0x4b69('0x57')]=[{'all':!![]}];}return db[_0x4b69('0x56')][_0x4b69('0x58')](_0xe2a681);})[_0x4b69('0x11')](function(_0x3b409f){_0x1a70c0['rows']=_0x3b409f;return _0x1a70c0;})['then'](respondWithFilteredResult(_0x2cd66f,_0xe2a681))[_0x4b69('0x59')](handleError(_0x2cd66f,null));};exports[_0x4b69('0x5a')]=function(_0x514324,_0x15cb2c){var _0x726b9e={'raw':![],'where':{'id':_0x514324[_0x4b69('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x4b69('0x3d')},{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f')},{'model':db['Pause'],'as':_0x4b69('0x5c')}]},_0x14cbde={};_0x14cbde[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x56')][_0x4b69('0x5d')]);_0x14cbde[_0x4b69('0x45')]=_['keys'](_0x514324[_0x4b69('0x45')]);_0x14cbde[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x14cbde[_0x4b69('0x48')],_0x14cbde['query']);_0x726b9e['attributes']=_[_0x4b69('0x47')](_0x14cbde['model'],qs['fields'](_0x514324[_0x4b69('0x45')][_0x4b69('0x49')]));_0x726b9e[_0x4b69('0x4a')]=_0x726b9e['attributes'][_0x4b69('0x4b')]?_0x726b9e['attributes']:_0x14cbde[_0x4b69('0x48')];if(_0x514324['query'][_0x4b69('0x5e')]){_0x726b9e['include']=[{'all':!![]}];}_0x726b9e=_[_0x4b69('0x54')]({},_0x726b9e,_0x514324[_0x4b69('0x55')]);return db[_0x4b69('0x56')][_0x4b69('0x5f')](_0x726b9e)[_0x4b69('0x11')](handleEntityNotFound(_0x15cb2c,null))[_0x4b69('0x11')](respondWithResult(_0x15cb2c,null))[_0x4b69('0x59')](handleError(_0x15cb2c,null));};exports[_0x4b69('0x22')]=function(_0x5d75b4,_0x3f275d){if(_0x5d75b4[_0x4b69('0x60')]['id']){delete _0x5d75b4[_0x4b69('0x60')]['id'];}var _0x39aa0b=_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x61')]===_0x4b69('0x62')?null:_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x61')];var _0x4c255e=_0x5d75b4[_0x4b69('0x60')]['Imap']||{};var _0x5ac073=_0x5d75b4['body'][_0x4b69('0x3f')]||{};if(_0x39aa0b){_0x4c255e[_0x4b69('0x3a')]=getImapHost(_0x39aa0b);_0x4c255e[_0x4b69('0x3e')]=0x3e1;_0x5ac073['host']=getSmtpHost(_0x39aa0b);_0x5ac073[_0x4b69('0x3e')]=0x24b;_0x5ac073['secure']=![];}if(_0x5ac073[_0x4b69('0x38')]){_0x5ac073['secure']=![];}else{_0x5ac073[_0x4b69('0x39')]=null;}if(!_0x4c255e[_0x4b69('0x38')])_0x4c255e[_0x4b69('0x39')]=null;_0x5d75b4['body'][_0x4b69('0x3d')]=_0x4c255e;_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x3f')]=_0x5ac073;return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x5d75b4[_0x4b69('0x5b')]['id']},'include':[{'model':db[_0x4b69('0x63')],'as':_0x4b69('0x3d')},{'model':db['MailServerOut'],'as':_0x4b69('0x3f')},{'model':db['Pause'],'as':_0x4b69('0x5c')}]})[_0x4b69('0x11')](handleEntityNotFound(_0x3f275d,null))[_0x4b69('0x11')](function(_0x31d9eb){if(!_0x31d9eb)throw new Error('Mail\x20Account\x20not\x20found');if(_0x31d9eb[_0x4b69('0x3b')])delete _0x5d75b4[_0x4b69('0x60')][_0x4b69('0x3d')];return _0x31d9eb;})[_0x4b69('0x11')](saveUpdates(_0x5d75b4[_0x4b69('0x60')],null))['then'](function(_0x1856a5){if(!_0x5d75b4[_0x4b69('0x60')][_0x4b69('0x3d')])return _0x1856a5;return db[_0x4b69('0x63')]['update'](_0x5d75b4['body'][_0x4b69('0x3d')],{'where':{'MailAccountId':_0x1856a5['id']}})[_0x4b69('0x11')](function(){return _0x1856a5;});})['then'](function(_0x294484){if(!_0x5d75b4['body'][_0x4b69('0x3f')])return _0x294484;return db['MailServerOut'][_0x4b69('0x22')](_0x5d75b4['body'][_0x4b69('0x3f')],{'where':{'MailAccountId':_0x294484['id']}})[_0x4b69('0x11')](function(){return _0x294484;});})['then'](respondWithResult(_0x3f275d,null))['catch'](handleError(_0x3f275d,null));};exports[_0x4b69('0x64')]=function(_0x148d3e,_0x490943){return db['MailAccount'][_0x4b69('0x64')]()['then'](respondWithResult(_0x490943,null))[_0x4b69('0x59')](handleError(_0x490943,null));};exports[_0x4b69('0x65')]=function(_0x46f19a,_0x232e7b){if(_0x46f19a[_0x4b69('0x60')]['id']){delete _0x46f19a['body']['id'];}return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x46f19a['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x232e7b,null))['then'](function(_0x5b5fe3){if(_0x5b5fe3){_0x46f19a[_0x4b69('0x60')][_0x4b69('0x66')]=_0x5b5fe3['id'];return db['Disposition'][_0x4b69('0x67')](_0x46f19a[_0x4b69('0x60')]);}})['then'](respondWithResult(_0x232e7b,null))[_0x4b69('0x59')](handleError(_0x232e7b,null));};exports[_0x4b69('0x68')]=function(_0x120105,_0x57799d){var _0x5ab5d7={'raw':![],'where':{}};var _0x2d2caf={};var _0x299460={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x120105[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x57799d,null))['then'](function(_0x34f87e){if(_0x34f87e){_0x2d2caf['model']=_[_0x4b69('0x46')](db['Disposition'][_0x4b69('0x5d')]);_0x2d2caf[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x120105[_0x4b69('0x45')]);_0x2d2caf[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x2d2caf[_0x4b69('0x48')],_0x2d2caf[_0x4b69('0x45')]);_0x5ab5d7['attributes']=_['intersection'](_0x2d2caf[_0x4b69('0x48')],qs['fields'](_0x120105[_0x4b69('0x45')]['fields']));_0x5ab5d7[_0x4b69('0x4a')]=_0x5ab5d7[_0x4b69('0x4a')][_0x4b69('0x4b')]?_0x5ab5d7[_0x4b69('0x4a')]:_0x2d2caf[_0x4b69('0x48')];if(!_0x120105[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x5ab5d7[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x120105[_0x4b69('0x45')][_0x4b69('0x1f')]);_0x5ab5d7[_0x4b69('0x1d')]=qs[_0x4b69('0x1d')](_0x120105[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0x5ab5d7['order']=qs[_0x4b69('0x4f')](_0x120105[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x5ab5d7[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x120105[_0x4b69('0x45')],_0x2d2caf['filters']));_0x5ab5d7[_0x4b69('0x50')]['MailAccountId']=_0x34f87e['id'];if(_0x120105[_0x4b69('0x45')][_0x4b69('0x53')]){_0x5ab5d7[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0x5ab5d7[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x5ab5d7[_0x4b69('0x4a')],function(_0x5b9f3c){var _0x18ac78={};_0x18ac78[_0x5b9f3c]={'$like':'%'+_0x120105[_0x4b69('0x45')][_0x4b69('0x53')]+'%'};return _0x18ac78;})});}_0x5ab5d7=_[_0x4b69('0x54')]({},_0x5ab5d7,_0x120105[_0x4b69('0x55')]);return db['Disposition']['count']({'where':_0x5ab5d7[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x4c7f54){_0x299460[_0x4b69('0x20')]=_0x4c7f54;if(_0x120105[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x5ab5d7[_0x4b69('0x57')]=[{'all':!![]}];}return db[_0x4b69('0x69')][_0x4b69('0x58')](_0x5ab5d7);})[_0x4b69('0x11')](function(_0x3c6be6){_0x299460[_0x4b69('0x6a')]=_0x3c6be6;return _0x299460;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x57799d,_0x5ab5d7))[_0x4b69('0x59')](handleError(_0x57799d,null));};exports[_0x4b69('0x6b')]=function(_0x1f3b55,_0x483ce7){return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x1f3b55[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x483ce7,null))['then'](function(_0x148d95){if(_0x148d95){return _0x148d95[_0x4b69('0x6b')](_0x1f3b55['query']['ids']);}})[_0x4b69('0x11')](respondWithStatusCode(_0x483ce7,null))[_0x4b69('0x59')](handleError(_0x483ce7,null));};exports[_0x4b69('0x6c')]=function(_0x4368d4,_0x3af8e1){if(_0x4368d4['body']['id']){delete _0x4368d4['body']['id'];}return db['MailAccount'][_0x4b69('0x5f')]({'where':{'id':_0x4368d4[_0x4b69('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3af8e1,null))[_0x4b69('0x11')](function(_0x56ba96){if(_0x56ba96){_0x4368d4['body']['MailAccountId']=_0x56ba96['id'];return db['CannedAnswer'][_0x4b69('0x67')](_0x4368d4['body']);}})[_0x4b69('0x11')](respondWithResult(_0x3af8e1,null))[_0x4b69('0x59')](handleError(_0x3af8e1,null));};exports[_0x4b69('0x6d')]=function(_0x5a6eff,_0x360bab){var _0x1f1acf={'raw':![],'where':{}};var _0x13eebb={};var _0x22d938={'count':0x0,'rows':[]};return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x5a6eff[_0x4b69('0x5b')]['id']}})['then'](handleEntityNotFound(_0x360bab,null))['then'](function(_0x3434c6){if(_0x3434c6){_0x13eebb[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x6f')]['rawAttributes']);_0x13eebb[_0x4b69('0x45')]=_['keys'](_0x5a6eff[_0x4b69('0x45')]);_0x13eebb[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x13eebb['model'],_0x13eebb['query']);_0x1f1acf[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x13eebb[_0x4b69('0x48')],qs['fields'](_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x49')]));_0x1f1acf[_0x4b69('0x4a')]=_0x1f1acf[_0x4b69('0x4a')][_0x4b69('0x4b')]?_0x1f1acf['attributes']:_0x13eebb['model'];if(!_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x1f1acf[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x5a6eff[_0x4b69('0x45')]['limit']);_0x1f1acf['offset']=qs[_0x4b69('0x1d')](_0x5a6eff['query'][_0x4b69('0x1d')]);}_0x1f1acf[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x1f1acf['where']=qs[_0x4b69('0x52')](_['pick'](_0x5a6eff['query'],_0x13eebb[_0x4b69('0x52')]));_0x1f1acf[_0x4b69('0x50')][_0x4b69('0x66')]=_0x3434c6['id'];if(_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x53')]){_0x1f1acf['where']=_[_0x4b69('0x54')](_0x1f1acf[_0x4b69('0x50')],{'$or':_['map'](_0x1f1acf[_0x4b69('0x4a')],function(_0x31d5d1){var _0x4e5dae={};_0x4e5dae[_0x31d5d1]={'$like':'%'+_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x53')]+'%'};return _0x4e5dae;})});}_0x1f1acf=_['merge']({},_0x1f1acf,_0x5a6eff[_0x4b69('0x55')]);return db[_0x4b69('0x6f')]['count']({'where':_0x1f1acf[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x2a9673){_0x22d938[_0x4b69('0x20')]=_0x2a9673;if(_0x5a6eff[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x1f1acf['include']=[{'all':!![]}];}return db[_0x4b69('0x6f')][_0x4b69('0x58')](_0x1f1acf);})[_0x4b69('0x11')](function(_0x37d013){_0x22d938[_0x4b69('0x6a')]=_0x37d013;return _0x22d938;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x360bab,_0x1f1acf))[_0x4b69('0x59')](handleError(_0x360bab,null));};exports[_0x4b69('0x70')]=function(_0x33a92e,_0x4c3e1f){return db[_0x4b69('0x56')]['find']({'where':{'id':_0x33a92e[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x4c3e1f,null))[_0x4b69('0x11')](function(_0x29afa2){if(_0x29afa2){return _0x29afa2[_0x4b69('0x70')](_0x33a92e[_0x4b69('0x45')][_0x4b69('0x71')]);}})[_0x4b69('0x11')](respondWithStatusCode(_0x4c3e1f,null))[_0x4b69('0x59')](handleError(_0x4c3e1f,null));};exports[_0x4b69('0x67')]=function(_0x529fed,_0x3c3842){var _0x4e8403={'name':_0x529fed[_0x4b69('0x60')][_0x4b69('0x27')],'key':_0x529fed['body'][_0x4b69('0x43')],'provider':_0x529fed[_0x4b69('0x60')]['provider']==='custom'?null:_0x529fed[_0x4b69('0x60')][_0x4b69('0x61')],'email':_0x529fed[_0x4b69('0x60')][_0x4b69('0x72')],'ListId':_0x529fed['body'][_0x4b69('0x73')],'active':!_[_0x4b69('0x74')](_0x529fed[_0x4b69('0x60')][_0x4b69('0x75')])?_0x529fed[_0x4b69('0x60')][_0x4b69('0x75')]:!![],'description':_0x529fed[_0x4b69('0x60')][_0x4b69('0x76')]||null};var _0xbc931e=getAuthenticationOptions(_0x4e8403[_0x4b69('0x61')],_0x529fed[_0x4b69('0x60')]);_0x4e8403[_0x4b69('0x3d')]=_0xbc931e['Imap'];_0x4e8403['Smtp']=_0xbc931e[_0x4b69('0x3f')];return db[_0x4b69('0x56')]['create'](_0x4e8403,{'include':[{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f')},{'model':db['MailServerIn'],'as':_0x4b69('0x3d')}]})[_0x4b69('0x11')](function(_0x143c50){var _0x9c509b=_0x529fed[_0x4b69('0x34')]['get']({'plain':!![]});if(!_0x9c509b)throw new Error(_0x4b69('0x77'));if(_0x9c509b[_0x4b69('0x78')]===_0x4b69('0x34')){var _0x3c83bc=_0x143c50[_0x4b69('0x79')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4b69('0x7a'),'userProfileId':_0x9c509b[_0x4b69('0x7b')]},'raw':!![]})[_0x4b69('0x11')](function(_0x5333b4){if(_0x5333b4&&_0x5333b4[_0x4b69('0x7c')]===0x0){return db[_0x4b69('0x7d')]['create']({'name':_0x3c83bc[_0x4b69('0x27')],'resourceId':_0x3c83bc['id'],'type':_0x5333b4[_0x4b69('0x27')],'sectionId':_0x5333b4['id']},{})[_0x4b69('0x11')](function(){return _0x143c50;});}else{return _0x143c50;}})['catch'](function(_0x336d06){logger[_0x4b69('0x17')](_0x4b69('0x7e'),_0x336d06);throw _0x336d06;});}return _0x143c50;})['then'](respondWithResult(_0x3c3842,0xc9))[_0x4b69('0x59')](handleError(_0x3c3842,null));};exports[_0x4b69('0x7f')]=function(_0x58960d,_0x55d882){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x58960d[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x55d882,null))[_0x4b69('0x11')](function(_0x45e24c){if(_0x45e24c){return _0x45e24c[_0x4b69('0x7f')]();}return null;})[_0x4b69('0x11')](respondWithResult(_0x55d882,null))[_0x4b69('0x59')](handleError(_0x55d882,null));};exports[_0x4b69('0x80')]=function(_0x3507c3,_0x589e7f){if(_0x3507c3[_0x4b69('0x60')]['id']){delete _0x3507c3[_0x4b69('0x60')]['id'];}return db[_0x4b69('0x56')]['find']({'where':{'id':_0x3507c3[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x589e7f,null))[_0x4b69('0x11')](function(_0x42c6a4){if(_0x42c6a4){_0x3507c3[_0x4b69('0x60')][_0x4b69('0x66')]=_0x42c6a4['id'];return db['MailServerIn'][_0x4b69('0x67')](_0x3507c3['body']);}})[_0x4b69('0x11')](respondWithResult(_0x589e7f,null))[_0x4b69('0x59')](handleError(_0x589e7f,null));};exports['removeImap']=function(_0xb4dac8,_0x5eaf34){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0xb4dac8[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x5eaf34,null))['then'](function(_0x42c46f){if(_0x42c46f){return _0x42c46f[_0x4b69('0x81')](null);}return null;})['then'](respondWithStatusCode(_0x5eaf34,null))[_0x4b69('0x59')](handleError(_0x5eaf34,null));};exports[_0x4b69('0x82')]=function(_0x1711d7,_0x4e05ab){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x1711d7['params']['id']}})['then'](handleEntityNotFound(_0x4e05ab,null))[_0x4b69('0x11')](function(_0x5c22a9){if(_0x5c22a9){return _0x5c22a9['getSmtp']();}return null;})[_0x4b69('0x11')](respondWithResult(_0x4e05ab,null))[_0x4b69('0x59')](handleError(_0x4e05ab,null));};exports[_0x4b69('0x83')]=function(_0x1d2d41,_0x393ea7){if(_0x1d2d41[_0x4b69('0x60')]['id']){delete _0x1d2d41[_0x4b69('0x60')]['id'];}return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x1d2d41['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x393ea7,null))['then'](function(_0x16b2b5){if(_0x16b2b5){_0x1d2d41[_0x4b69('0x60')][_0x4b69('0x66')]=_0x16b2b5['id'];return db['MailServerOut']['create'](_0x1d2d41[_0x4b69('0x60')]);}})[_0x4b69('0x11')](respondWithResult(_0x393ea7,null))[_0x4b69('0x59')](handleError(_0x393ea7,null));};exports['removeSmtp']=function(_0x4114dc,_0x3f1de6){return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x4114dc[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x3f1de6,null))['then'](function(_0x4ea92a){if(_0x4ea92a){return _0x4ea92a['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3f1de6,null))[_0x4b69('0x59')](handleError(_0x3f1de6,null));};exports['addInteraction']=function(_0x1cd75b,_0x59a933){return db[_0x4b69('0x84')][_0x4b69('0x5f')]({'where':{'id':_0x1cd75b[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x59a933,null))['then'](function(_0x51c5cb){if(_0x51c5cb){return _0x51c5cb[_0x4b69('0x85')](_0x1cd75b[_0x4b69('0x60')][_0x4b69('0x71')],_[_0x4b69('0x86')](_0x1cd75b[_0x4b69('0x60')],[_0x4b69('0x71'),'id'])||{});}})['then'](respondWithResult(_0x59a933,null))[_0x4b69('0x59')](handleError(_0x59a933,null));};exports[_0x4b69('0x87')]=function(_0x4ddbe7,_0x3d2efc){var _0x3c670f={'raw':![],'where':{}};var _0x3dcf56={};var _0x4f45d8={'count':0x0,'rows':[]};return db['MailAccount'][_0x4b69('0x6e')]({'where':{'id':_0x4ddbe7[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x3d2efc,null))[_0x4b69('0x11')](function(_0x305b24){if(_0x305b24){_0x3dcf56[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x84')][_0x4b69('0x5d')]);_0x3dcf56[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x4ddbe7[_0x4b69('0x45')]);_0x3dcf56[_0x4b69('0x52')]=_['intersection'](_0x3dcf56[_0x4b69('0x48')],_0x3dcf56['query']);_0x3c670f[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x3dcf56['model'],qs[_0x4b69('0x49')](_0x4ddbe7['query'][_0x4b69('0x49')]));_0x3c670f['attributes']=_0x3c670f[_0x4b69('0x4a')][_0x4b69('0x4b')]?_0x3c670f['attributes']:_0x3dcf56[_0x4b69('0x48')];if(!_0x4ddbe7['query'][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x3c670f[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x1f')]);_0x3c670f[_0x4b69('0x1d')]=qs['offset'](_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0x3c670f[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x3c670f[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x4ddbe7[_0x4b69('0x45')],_0x3dcf56[_0x4b69('0x52')]));_0x3c670f[_0x4b69('0x50')][_0x4b69('0x66')]=_0x305b24['id'];if(_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x53')]){_0x3c670f[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0x3c670f[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x3c670f[_0x4b69('0x4a')],function(_0x5d9d76){var _0x5e3073={};_0x5e3073[_0x5d9d76]={'$like':'%'+_0x4ddbe7['query'][_0x4b69('0x53')]+'%'};return _0x5e3073;})});}_0x3c670f=_['merge']({},_0x3c670f,_0x4ddbe7[_0x4b69('0x55')]);return db[_0x4b69('0x84')][_0x4b69('0x20')]({'where':_0x3c670f[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x3b795a){_0x4f45d8['count']=_0x3b795a;if(_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x3c670f[_0x4b69('0x57')]=[{'model':db[_0x4b69('0x88')],'as':_0x4b69('0x89'),'required':![]},{'model':db[_0x4b69('0x8a')],'as':_0x4b69('0x8b'),'attributes':['name','fullname',_0x4b69('0x8c')],'required':![]},{'model':db[_0x4b69('0x8d')],'as':'Tags','attributes':['id',_0x4b69('0x27'),_0x4b69('0x8e')],'where':_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x8f')]?{'id':_0x4ddbe7[_0x4b69('0x45')][_0x4b69('0x8f')]}:undefined,'required':_0x4ddbe7[_0x4b69('0x45')]['tag']?!![]:![]}];}return db[_0x4b69('0x84')][_0x4b69('0x58')](_0x3c670f);})[_0x4b69('0x11')](function(_0x5cff65){_0x4f45d8[_0x4b69('0x6a')]=_0x5cff65;return _0x4f45d8;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x3d2efc,_0x3c670f))[_0x4b69('0x59')](handleError(_0x3d2efc,null));};exports[_0x4b69('0x90')]=function addApplications(_0x53ed56,_0x4511cd){var _0xd508b0=_0x53ed56['params']['id'];var _0x3e922c=_0x53ed56[_0x4b69('0x60')];var _0x5b686f=0xc8;var _0x10868b=null;return db['sequelize'][_0x4b69('0x91')]({'isolationLevel':db['sequelize'][_0x4b69('0x92')][_0x4b69('0x93')][_0x4b69('0x94')]},function(_0x34052c){return db['MailAccount'][_0x4b69('0x6e')]({'where':{'id':_0xd508b0},'transaction':_0x34052c})[_0x4b69('0x11')](function(_0xdab191){if(_0xdab191){return db[_0x4b69('0x95')][_0x4b69('0x23')]({'where':{'MailAccountId':_0xd508b0},'transaction':_0x34052c})[_0x4b69('0x11')](function(){var _0x3a7804=_[_0x4b69('0x44')](_0x3e922c,function(_0x50c751){_0x50c751['MailAccountId']=_0xd508b0;return _0x50c751;});return db[_0x4b69('0x95')][_0x4b69('0x96')](_0x3a7804,{'transaction':_0x34052c});});}else{_0x5b686f=0x194;_0x10868b=[];}});})[_0x4b69('0x11')](function(){if(_0x5b686f!==0x194){return db[_0x4b69('0x95')][_0x4b69('0x97')]({'where':{'MailAccountId':_0xd508b0},'order':_0x4b69('0x98')})[_0x4b69('0x11')](function(_0xa8a5cb){_0x10868b=_0xa8a5cb;});}})[_0x4b69('0x59')](function(_0x536400){_0x5b686f=0x1f4;logger[_0x4b69('0x17')](_0x536400[_0x4b69('0x26')]);if(_0x536400[_0x4b69('0x27')]){delete _0x536400[_0x4b69('0x27')];}_0x10868b=_0x536400;})[_0x4b69('0x99')](function(){if(_0x10868b===null){_0x4511cd[_0x4b69('0x25')](_0x5b686f);}else{if(_0x5b686f===0x1f4){_0x4511cd['status'](_0x5b686f)[_0x4b69('0x28')](_0x10868b);}else{_0x4511cd[_0x4b69('0x1b')](_0x5b686f)[_0x4b69('0x1c')](_0x10868b);}}});};exports[_0x4b69('0x9a')]=function(_0x38744e,_0x3f201b){var _0x39c225={};var _0x159ca8={};var _0x34642b;var _0x220aaa;return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x38744e['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x3f201b,null))[_0x4b69('0x11')](function(_0x1e7413){if(_0x1e7413){_0x34642b=_0x1e7413;_0x159ca8[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x95')][_0x4b69('0x5d')]);_0x159ca8[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x38744e[_0x4b69('0x45')]);_0x159ca8[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x159ca8[_0x4b69('0x48')],_0x159ca8[_0x4b69('0x45')]);_0x39c225[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x159ca8['model'],qs[_0x4b69('0x49')](_0x38744e[_0x4b69('0x45')][_0x4b69('0x49')]));_0x39c225[_0x4b69('0x4a')]=_0x39c225[_0x4b69('0x4a')]['length']?_0x39c225[_0x4b69('0x4a')]:_0x159ca8[_0x4b69('0x48')];_0x39c225[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x38744e[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x39c225[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x38744e[_0x4b69('0x45')],_0x159ca8[_0x4b69('0x52')]));if(_0x38744e[_0x4b69('0x45')][_0x4b69('0x53')]){_0x39c225['where']=_['merge'](_0x39c225[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x39c225[_0x4b69('0x4a')],function(_0x551385){var _0xea7aad={};_0xea7aad[_0x551385]={'$like':'%'+_0x38744e['query']['filter']+'%'};return _0xea7aad;})});}_0x39c225=_[_0x4b69('0x54')]({},_0x39c225,_0x38744e[_0x4b69('0x55')]);return _0x34642b[_0x4b69('0x9a')](_0x39c225);}})[_0x4b69('0x11')](function(_0x206900){if(_0x206900){_0x220aaa=_0x206900[_0x4b69('0x4b')];if(!_0x38744e[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x39c225[_0x4b69('0x1f')]=qs[_0x4b69('0x1f')](_0x38744e[_0x4b69('0x45')]['limit']);_0x39c225[_0x4b69('0x1d')]=qs[_0x4b69('0x1d')](_0x38744e[_0x4b69('0x45')][_0x4b69('0x1d')]);}return _0x34642b[_0x4b69('0x9a')](_0x39c225);}})[_0x4b69('0x11')](function(_0x3a377f){if(_0x3a377f){return _0x3a377f?{'count':_0x220aaa,'rows':_0x3a377f}:null;}})[_0x4b69('0x11')](respondWithResult(_0x3f201b,null))[_0x4b69('0x59')](handleError(_0x3f201b,null));};exports[_0x4b69('0x9b')]=function(_0x1cb285,_0x67739f){var _0x5bb787={'raw':!![],'where':{}};var _0x4e8b37={};var _0xdd6757={'count':0x0,'rows':[]};return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x1cb285[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x67739f,null))[_0x4b69('0x11')](function(_0x199a41){if(_0x199a41){_0x4e8b37[_0x4b69('0x48')]=_[_0x4b69('0x46')](db[_0x4b69('0x9c')][_0x4b69('0x5d')]);_0x4e8b37['query']=_[_0x4b69('0x46')](_0x1cb285[_0x4b69('0x45')]);_0x4e8b37[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x4e8b37[_0x4b69('0x48')],_0x4e8b37['query']);_0x5bb787[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x4e8b37[_0x4b69('0x48')],qs[_0x4b69('0x49')](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x49')]));_0x5bb787[_0x4b69('0x4a')]=_0x5bb787['attributes'][_0x4b69('0x4b')]?_0x5bb787[_0x4b69('0x4a')]:_0x4e8b37[_0x4b69('0x48')];if(!_0x1cb285[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x5bb787[_0x4b69('0x1f')]=qs['limit'](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x1f')]);_0x5bb787[_0x4b69('0x1d')]=qs['offset'](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x1d')]);}_0x5bb787[_0x4b69('0x4e')]=qs[_0x4b69('0x4f')](_0x1cb285[_0x4b69('0x45')][_0x4b69('0x4f')]);_0x5bb787[_0x4b69('0x50')]=qs[_0x4b69('0x52')](_[_0x4b69('0x51')](_0x1cb285['query'],_0x4e8b37[_0x4b69('0x52')]));_0x5bb787[_0x4b69('0x50')][_0x4b69('0x66')]=_0x199a41['id'];if(_0x1cb285['query'][_0x4b69('0x53')]){_0x5bb787['where']=_[_0x4b69('0x54')](_0x5bb787[_0x4b69('0x50')],{'$or':_[_0x4b69('0x44')](_0x5bb787[_0x4b69('0x4a')],function(_0x48ef4f){var _0x41565c={};_0x41565c[_0x48ef4f]={'$like':'%'+_0x1cb285['query'][_0x4b69('0x53')]+'%'};return _0x41565c;})});}if(_0x1cb285[_0x4b69('0x45')][_0x4b69('0x9d')]){var _0x4027ba=_0x1cb285[_0x4b69('0x45')]['$gte'][_0x4b69('0x9e')](',');var _0x1822c3={};_0x1822c3[_0x4027ba[0x0]]={'$gte':moment(_0x4027ba[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5bb787[_0x4b69('0x50')]=_[_0x4b69('0x54')](_0x5bb787[_0x4b69('0x50')],_0x1822c3);}_0x5bb787=_['merge']({},_0x5bb787,_0x1cb285['options']);return db[_0x4b69('0x9c')][_0x4b69('0x20')]({'where':_0x5bb787[_0x4b69('0x50')]})[_0x4b69('0x11')](function(_0x23492a){_0xdd6757[_0x4b69('0x20')]=_0x23492a;if(_0x1cb285[_0x4b69('0x45')][_0x4b69('0x5e')]){_0x5bb787['include']=[{'all':!![]}];}return db['MailMessage'][_0x4b69('0x58')](_0x5bb787);})[_0x4b69('0x11')](function(_0x174fd4){if(_0x1cb285[_0x4b69('0x45')][_0x4b69('0x9f')]===_0x4b69('0xa0')){for(var _0xb82e58=0x0;_0xb82e58<_0x174fd4[_0x4b69('0x4b')];_0xb82e58++){_0x174fd4[_0xb82e58][_0x4b69('0x60')]=juice(_0x174fd4[_0xb82e58][_0x4b69('0x60')]);}}_0xdd6757[_0x4b69('0x6a')]=_0x174fd4;return _0xdd6757;});}})[_0x4b69('0x11')](respondWithFilteredResult(_0x67739f,_0x5bb787))['catch'](handleError(_0x67739f,null));};exports[_0x4b69('0x28')]=function(_0x286e14,_0x3516c9){var _0x1f29a4,_0x34d3f9={},_0x24edf0;if(_0x286e14[_0x4b69('0x60')]['to']){_0x24edf0=_0x286e14[_0x4b69('0x60')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x286e14['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4b69('0x88')],'as':_0x4b69('0xa1'),'where':{'email':_0x24edf0},'limit':0x1,'order':[[_0x4b69('0xa2'),_0x4b69('0xa3')]]}]},{'model':db[_0x4b69('0x40')],'as':_0x4b69('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x4b69('0x11')](handleEntityNotFound(_0x3516c9,null))['then'](function(_0x3fad8b){if(!_0x3fad8b)return;_0x1f29a4=_0x3fad8b;if(!_0x3fad8b[_0x4b69('0x3f')])throw new Error(_0x4b69('0xa4'));if(_[_0x4b69('0x74')](_0x286e14[_0x4b69('0x60')][_0x4b69('0xa5')])){_0x286e14[_0x4b69('0x60')]['from']=util[_0x4b69('0xa6')](_0x4b69('0xa7'),_0x3fad8b[_0x4b69('0x27')],_0x3fad8b['email']||_0x3fad8b[_0x4b69('0x3f')][_0x4b69('0x34')]);}if(_0x286e14['body']['attachments']&&_0x286e14['body'][_0x4b69('0xa8')][_0x4b69('0x4b')]){for(var _0x4c7b8d=0x0;_0x4c7b8d<_0x286e14[_0x4b69('0x60')][_0x4b69('0xa8')]['length'];_0x4c7b8d+=0x1){_0x286e14[_0x4b69('0x60')][_0x4b69('0xa8')][_0x4c7b8d]={'filename':_0x286e14['body']['attachments'][_0x4c7b8d][_0x4b69('0x27')],'path':path['join'](config['root'],_0x4b69('0xa9'),_0x286e14[_0x4b69('0x60')]['attachments'][_0x4c7b8d]['basename'])};}}var _0x49f2e1=_0x3fad8b[_0x4b69('0xaa')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x49f2e1,'message':_0x286e14[_0x4b69('0x60')]});})[_0x4b69('0x11')](function(_0x2fe6b1){if(!_0x2fe6b1)return;_0x34d3f9=_0x2fe6b1;if(!_0x1f29a4[_0x4b69('0xab')])throw new Error(_0x4b69('0xac'));if(_0x1f29a4[_0x4b69('0xab')][_0x4b69('0xa1')][_0x4b69('0x4b')])return _0x1f29a4[_0x4b69('0xab')][_0x4b69('0xa1')][0x0];return db['CmContact']['create'](_[_0x4b69('0x9')](_0x286e14['body'],{'firstName':_0x286e14[_0x4b69('0x60')]['to'],'email':_0x286e14[_0x4b69('0x60')]['to'],'phone':_0x286e14[_0x4b69('0x60')]['to'],'ListId':_0x1f29a4[_0x4b69('0x73')]}));})[_0x4b69('0x11')](function(_0xa98782){if(!_0xa98782)return;var _0x4c7390={'UserId':_0x286e14[_0x4b69('0x34')]['id'],'ContactId':_0xa98782['id'],'MailAccountId':_0x1f29a4['id'],'inReplyTo':_0x34d3f9[_0x4b69('0xad')],'to':_0x286e14[_0x4b69('0x60')][_0x4b69('0xa5')],'cc':_0x286e14['body']['cc'],'subject':_0x286e14[_0x4b69('0x60')][_0x4b69('0xae')],'attach':_0x286e14[_0x4b69('0x60')][_0x4b69('0xaf')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x4b69('0xa6')](_0x4b69('0xb0')),'lastMsgDirection':'out','Messages':[_['merge'](_0x286e14['body'],{'messageId':_0x34d3f9[_0x4b69('0xad')],'sentAt':moment()[_0x4b69('0xa6')](_0x4b69('0xb0')),'read':!![],'MailAccountId':_0x1f29a4['id'],'UserId':_0x286e14[_0x4b69('0x34')]['id'],'ContactId':_0xa98782['id']})]};if(_0x286e14['body'][_0x4b69('0xb1')]){_0x4c7390=_['merge'](_0x4c7390,_0x286e14['body'][_0x4b69('0xb1')]);}return db[_0x4b69('0x84')][_0x4b69('0x67')](_0x4c7390,{'include':[{'model':db[_0x4b69('0x9c')],'as':_0x4b69('0xb2')}]});})[_0x4b69('0x11')](respondWithResult(_0x3516c9,null))['catch'](handleError(_0x3516c9,null));};exports[_0x4b69('0xb3')]=function(_0x2320e9,_0x5c4aef){return db[_0x4b69('0x56')]['find']({'where':{'id':_0x2320e9['params']['id']},'include':[{'model':db[_0x4b69('0x40')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4b69('0xb4')],'as':'CloudProvider','raw':!![]}]}]})[_0x4b69('0x11')](handleEntityNotFound(_0x5c4aef,null))[_0x4b69('0x11')](function(_0x55c332){if(!_0x55c332['Smtp'])return;var _0x310b14=_0x55c332[_0x4b69('0xaa')]();return respondWithRpcPromise(_0x4b69('0xb5'),'verifySmtp',{'account':_0x310b14});})['then'](respondWithResult(_0x5c4aef,null))[_0x4b69('0x59')](handleError(_0x5c4aef,null));};exports['destroy']=function(_0x20078b,_0x126010){return db['MailAccount'][_0x4b69('0x5f')]({'where':{'id':_0x20078b[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x126010,null))[_0x4b69('0x11')](function(_0x5d01fd){if(_0x5d01fd&&_0x5d01fd[_0x4b69('0x3b')]){throw new db[(_0x4b69('0xb6'))][(_0x4b69('0xb7'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5d01fd;})[_0x4b69('0x11')](removeEntity(_0x126010,null))[_0x4b69('0x59')](handleError(_0x126010,null));};exports['addAgents']=function(_0x4d8b2c,_0x365d0a){return db['MailAccount'][_0x4b69('0x5f')]({'where':{'id':_0x4d8b2c[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x365d0a,null))[_0x4b69('0x11')](function(_0x1565dc){if(_0x1565dc){return _0x1565dc['addAgents'](_0x4d8b2c['body']['ids'],_['omit'](_0x4d8b2c[_0x4b69('0x60')],[_0x4b69('0x71'),'id'])||{})[_0x4b69('0xb8')](function(_0x40eb89){for(var _0x4468ac=0x0;_0x4468ac<_0x4d8b2c['body'][_0x4b69('0x71')][_0x4b69('0x4b')];_0x4468ac+=0x1){socket['emit'](_0x4b69('0xb9'),{'UserId':Number(_0x4d8b2c[_0x4b69('0x60')][_0x4b69('0x71')][_0x4468ac]),'MailAccountId':Number(_0x4d8b2c['params']['id'])});}return _0x40eb89;});}})['then'](respondWithResult(_0x365d0a,null))['catch'](handleError(_0x365d0a,null));};exports[_0x4b69('0xba')]=function(_0x451ffb,_0x44fced){return db[_0x4b69('0x56')][_0x4b69('0x5f')]({'where':{'id':_0x451ffb['params']['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x44fced,null))['then'](function(_0x431413){if(_0x431413){return _0x431413[_0x4b69('0xba')](_0x451ffb[_0x4b69('0x45')][_0x4b69('0x71')])[_0x4b69('0x11')](function(){if(_['isArray'](_0x451ffb[_0x4b69('0x45')]['ids'])){for(var _0x298d5c=0x0;_0x298d5c<_0x451ffb[_0x4b69('0x45')][_0x4b69('0x71')][_0x4b69('0x4b')];_0x298d5c+=0x1){socket[_0x4b69('0xbb')](_0x4b69('0xbc'),{'UserId':Number(_0x451ffb['query'][_0x4b69('0x71')][_0x298d5c]),'MailAccountId':Number(_0x451ffb[_0x4b69('0x5b')]['id'])});}}else{socket[_0x4b69('0xbb')](_0x4b69('0xbc'),{'UserId':Number(_0x451ffb[_0x4b69('0x45')][_0x4b69('0x71')]),'MailAccountId':Number(_0x451ffb['params']['id'])});}});}})[_0x4b69('0x11')](respondWithStatusCode(_0x44fced,null))['catch'](handleError(_0x44fced,null));};exports[_0x4b69('0xbd')]=function(_0x1aa07b,_0x402849){var _0x1e0f10={};var _0x287f5e={};var _0x37c28e;var _0x2ac17f;return db[_0x4b69('0x56')][_0x4b69('0x6e')]({'where':{'id':_0x1aa07b[_0x4b69('0x5b')]['id']}})[_0x4b69('0x11')](handleEntityNotFound(_0x402849,null))[_0x4b69('0x11')](function(_0x26b611){if(_0x26b611){_0x37c28e=_0x26b611;_0x287f5e['model']=_[_0x4b69('0x46')](db['User'][_0x4b69('0x5d')]);_0x287f5e[_0x4b69('0x45')]=_[_0x4b69('0x46')](_0x1aa07b['query']);_0x287f5e[_0x4b69('0x52')]=_[_0x4b69('0x47')](_0x287f5e['model'],_0x287f5e['query']);_0x1e0f10[_0x4b69('0x4a')]=_[_0x4b69('0x47')](_0x287f5e[_0x4b69('0x48')],qs[_0x4b69('0x49')](_0x1aa07b[_0x4b69('0x45')][_0x4b69('0x49')]));_0x1e0f10[_0x4b69('0x4a')]=_0x1e0f10[_0x4b69('0x4a')]['length']?_0x1e0f10[_0x4b69('0x4a')]:_0x287f5e[_0x4b69('0x48')];_0x1e0f10['order']=qs[_0x4b69('0x4f')](_0x1aa07b['query'][_0x4b69('0x4f')]);_0x1e0f10[_0x4b69('0x50')]=qs['filters'](_['pick'](_0x1aa07b[_0x4b69('0x45')],_0x287f5e['filters']));if(_0x1aa07b[_0x4b69('0x45')]['filter']){_0x1e0f10['where']=_[_0x4b69('0x54')](_0x1e0f10['where'],{'$or':_['map'](_0x1e0f10[_0x4b69('0x4a')],function(_0x12c127){var _0x28cbdb={};_0x28cbdb[_0x12c127]={'$like':'%'+_0x1aa07b[_0x4b69('0x45')][_0x4b69('0x53')]+'%'};return _0x28cbdb;})});}_0x1e0f10=_[_0x4b69('0x54')]({},_0x1e0f10,_0x1aa07b[_0x4b69('0x55')]);return _0x37c28e[_0x4b69('0xbd')](_0x1e0f10);}})[_0x4b69('0x11')](function(_0x76a936){if(_0x76a936){_0x2ac17f=_0x76a936['length'];if(!_0x1aa07b[_0x4b69('0x45')][_0x4b69('0x4c')](_0x4b69('0x4d'))){_0x1e0f10['limit']=qs['limit'](_0x1aa07b[_0x4b69('0x45')]['limit']);_0x1e0f10[_0x4b69('0x1d')]=qs['offset'](_0x1aa07b[_0x4b69('0x45')]['offset']);}return _0x37c28e[_0x4b69('0xbd')](_0x1e0f10);}})[_0x4b69('0x11')](function(_0xdc3fdc){if(_0xdc3fdc){return _0xdc3fdc?{'count':_0x2ac17f,'rows':_0xdc3fdc}:null;}})[_0x4b69('0x11')](respondWithResult(_0x402849,null))[_0x4b69('0x59')](handleError(_0x402849,null));};
\ No newline at end of file
+var _0x9d72=['removeAnswers','ids','key','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','secure','service','authentication','host','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','length','include','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','Disposition','create','getDispositions','findOne','order','pick','removeDispositions','addAnswer','MailAccountId','CannedAnswer','getAnswers','nolimit'];(function(_0x3facd8,_0x177ed1){var _0xc13275=function(_0x561777){while(--_0x561777){_0x3facd8['push'](_0x3facd8['shift']());}};_0xc13275(++_0x177ed1);}(_0x9d72,0x1ca));var _0x29d7=function(_0x4cae04,_0x1a4184){_0x4cae04=_0x4cae04-0x0;var _0x92ecd5=_0x9d72[_0x4cae04];return _0x92ecd5;};'use strict';var moment=require(_0x29d7('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x29d7('0x1'));var _=require(_0x29d7('0x2'));var juice=require('juice');var Redis=require(_0x29d7('0x3'));var qs=require(_0x29d7('0x4'));var logger=require(_0x29d7('0x5'))('api');var config=require(_0x29d7('0x6'));var db=require(_0x29d7('0x7'))['db'];config[_0x29d7('0x8')]=_[_0x29d7('0x9')](config[_0x29d7('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);var jayson=require(_0x29d7('0xa'));var client=jayson[_0x29d7('0xb')][_0x29d7('0xc')]({'port':0x232b});function respondWithRpcPromise(_0x11e59d,_0x490879,_0x269641,_0x4c1d8d){return new BPromise(function(_0x1a6a4a,_0x3bd772){var _0x2a9d93=_0x4c1d8d||client;return _0x2a9d93[_0x29d7('0xd')](_0x11e59d,_0x269641)[_0x29d7('0xe')](function(_0x56d04d){logger[_0x29d7('0xf')](_0x29d7('0x10'),_0x490879,_0x29d7('0x11'));logger[_0x29d7('0x12')](_0x29d7('0x13'),_0x490879,'request\x20sent',JSON[_0x29d7('0x14')](_0x56d04d));if(_0x56d04d[_0x29d7('0x15')]){if(_0x56d04d[_0x29d7('0x15')][_0x29d7('0x16')]===0x1f4){logger[_0x29d7('0x15')](_0x29d7('0x10'),_0x490879,_0x56d04d[_0x29d7('0x15')]['message']);return _0x3bd772(_0x56d04d['error'][_0x29d7('0x17')]);}logger['error'](_0x29d7('0x10'),_0x490879,_0x56d04d[_0x29d7('0x15')][_0x29d7('0x17')]);return _0x1a6a4a(_0x56d04d['error']['message']);}else{logger['info'](_0x29d7('0x10'),_0x490879,'request\x20sent');_0x1a6a4a(_0x56d04d[_0x29d7('0x18')][_0x29d7('0x17')]);}})[_0x29d7('0x19')](function(_0x47fed1){logger['error']('MailAccount,\x20%s,\x20%s',_0x490879,_0x47fed1);_0x3bd772(_0x47fed1);});});}function respondWithStatusCode(_0x6a4dd3,_0x9a3fad){_0x9a3fad=_0x9a3fad||0xcc;return function(_0x227e82){if(_0x227e82){return _0x6a4dd3['sendStatus'](_0x9a3fad);}return _0x6a4dd3[_0x29d7('0x1a')](_0x9a3fad)[_0x29d7('0x1b')]();};}function respondWithResult(_0x18c9df,_0x5b6633){_0x5b6633=_0x5b6633||0xc8;return function(_0x20651e){if(_0x20651e){return _0x18c9df[_0x29d7('0x1a')](_0x5b6633)[_0x29d7('0x1c')](_0x20651e);}};}function respondWithFilteredResult(_0x3e4d85,_0x33f3af){return function(_0x79082d){if(_0x79082d){var _0x4514ba=typeof _0x33f3af[_0x29d7('0x1d')]===_0x29d7('0x1e')&&typeof _0x33f3af[_0x29d7('0x1f')]===_0x29d7('0x1e');var _0x5ef79b=_0x79082d['count'];var _0x5dfaa7=_0x4514ba?0x0:_0x33f3af['offset'];var _0x31aa69=_0x4514ba?_0x79082d['count']:_0x33f3af['offset']+_0x33f3af[_0x29d7('0x1f')];var _0x342ab5;if(_0x31aa69>=_0x5ef79b){_0x31aa69=_0x5ef79b;_0x342ab5=0xc8;}else{_0x342ab5=0xce;}_0x3e4d85[_0x29d7('0x1a')](_0x342ab5);return _0x3e4d85[_0x29d7('0x20')]('Content-Range',_0x5dfaa7+'-'+_0x31aa69+'/'+_0x5ef79b)[_0x29d7('0x1c')](_0x79082d);}return null;};}function saveUpdates(_0x3a1b0b){return function(_0x4abaf9){if(_0x4abaf9){return _0x4abaf9[_0x29d7('0x21')](_0x3a1b0b)[_0x29d7('0xe')](function(_0x5201e0){return _0x5201e0;});}return null;};}function removeEntity(_0x352093){return function(_0x102ffa){if(_0x102ffa){return _0x102ffa[_0x29d7('0x22')]()[_0x29d7('0xe')](function(){var _0x3b2ead=_0x102ffa[_0x29d7('0x23')]({'plain':!![]});var _0x3e5ee9='MailAccounts';return db[_0x29d7('0x24')][_0x29d7('0x22')]({'where':{'type':_0x3e5ee9,'resourceId':_0x3b2ead['id']}})['then'](function(){return _0x102ffa;});})['then'](function(){_0x352093['status'](0xcc)[_0x29d7('0x1b')]();});}};}function handleEntityNotFound(_0x3ac9f5){return function(_0x21ee94){if(!_0x21ee94){_0x3ac9f5[_0x29d7('0x25')](0x194);}return _0x21ee94;};}function handleError(_0x2fbe8c,_0x19c068){_0x19c068=_0x19c068||0x1f4;return function(_0xbfbafc){logger[_0x29d7('0x15')](_0xbfbafc[_0x29d7('0x26')]);if(_0xbfbafc[_0x29d7('0x27')]){delete _0xbfbafc[_0x29d7('0x27')];}_0x2fbe8c[_0x29d7('0x1a')](_0x19c068)[_0x29d7('0x28')](_0xbfbafc);};}function getImapHost(_0x19f2c3){switch(_0x19f2c3){case _0x29d7('0x29'):return _0x29d7('0x2a');case'yahoo':return _0x29d7('0x2b');case _0x29d7('0x2c'):return'imap-mail.outlook.com';case _0x29d7('0x2d'):return _0x29d7('0x2e');}throw new Error(_0x29d7('0x2f'),_0x19f2c3);}function getSmtpHost(_0x23e0d2){switch(_0x23e0d2){case _0x29d7('0x29'):return _0x29d7('0x30');case _0x29d7('0x31'):return _0x29d7('0x32');case _0x29d7('0x2c'):return _0x29d7('0x33');case _0x29d7('0x2d'):return'smtp.office365.com';}throw new Error(_0x29d7('0x2f'),_0x23e0d2);}function getAuthenticationOptions(_0x5e3317,_0x34f60c){var _0x525230={};var _0x266929={};if(_0x5e3317){_0x525230['user']=_0x266929[_0x29d7('0x34')]=_0x34f60c[_0x29d7('0x35')];_0x525230[_0x29d7('0x36')]=_0x266929[_0x29d7('0x37')]=_0x34f60c[_0x29d7('0x36')];if(_0x34f60c[_0x29d7('0x38')]){_0x525230[_0x29d7('0x38')]=_0x266929[_0x29d7('0x38')]=!![];_0x525230[_0x29d7('0x39')]=_0x266929[_0x29d7('0x39')]=_0x34f60c[_0x29d7('0x39')];_0x525230[_0x29d7('0x36')]=_0x266929['pass']=null;}else{_0x525230[_0x29d7('0x39')]=_0x266929[_0x29d7('0x39')]=null;}_0x525230['host']=getImapHost(_0x5e3317);_0x525230[_0x29d7('0x3a')]=0x3e1;_0x266929['host']=getSmtpHost(_0x5e3317);_0x266929['port']=0x24b;_0x266929[_0x29d7('0x3b')]=![];_0x525230[_0x29d7('0x3c')]=_0x266929[_0x29d7('0x3c')]=null;}else{if(_0x34f60c[_0x29d7('0x3d')]){_0x525230['user']=_0x266929[_0x29d7('0x34')]=_0x34f60c[_0x29d7('0x35')];_0x525230[_0x29d7('0x36')]=_0x266929[_0x29d7('0x37')]=_0x34f60c[_0x29d7('0x36')];}else{_0x525230[_0x29d7('0x3d')]=_0x266929[_0x29d7('0x3d')]=![];_0x525230[_0x29d7('0x34')]=_0x266929[_0x29d7('0x34')]=null;_0x525230[_0x29d7('0x36')]=_0x266929[_0x29d7('0x37')]=null;}_0x525230[_0x29d7('0x3e')]=_0x34f60c[_0x29d7('0x3f')][_0x29d7('0x3e')];_0x525230[_0x29d7('0x3a')]=_0x34f60c['Imap'][_0x29d7('0x3a')];_0x266929[_0x29d7('0x3e')]=_0x34f60c['Smtp']['host'];_0x266929['port']=_0x34f60c[_0x29d7('0x40')][_0x29d7('0x3a')];}return{'Imap':_0x525230,'Smtp':_0x266929};}exports['index']=function(_0x1e6b93,_0x421dbd){var _0x17adc4={'include':[{'model':db[_0x29d7('0x41')],'as':_0x29d7('0x3f')},{'model':db[_0x29d7('0x42')],'as':'Smtp'},{'model':db[_0x29d7('0x43')],'as':_0x29d7('0x44')}]},_0xdec26d={},_0x5b5c69={'count':0x0,'rows':[]};var _0x27abe1=_[_0x29d7('0x45')](db[_0x29d7('0x46')][_0x29d7('0x47')],function(_0x48ad6d){return{'name':_0x48ad6d['fieldName'],'type':_0x48ad6d[_0x29d7('0x48')]['key']};});_0xdec26d[_0x29d7('0x49')]=_[_0x29d7('0x45')](_0x27abe1,_0x29d7('0x27'));_0xdec26d[_0x29d7('0x4a')]=_[_0x29d7('0x4b')](_0x1e6b93[_0x29d7('0x4a')]);_0xdec26d[_0x29d7('0x4c')]=_[_0x29d7('0x4d')](_0xdec26d[_0x29d7('0x49')],_0xdec26d['query']);_0x17adc4[_0x29d7('0x4e')]=_['intersection'](_0xdec26d[_0x29d7('0x49')],qs[_0x29d7('0x4f')](_0x1e6b93[_0x29d7('0x4a')][_0x29d7('0x4f')]));_0x17adc4[_0x29d7('0x4e')]=_0x17adc4[_0x29d7('0x4e')]['length']?_0x17adc4[_0x29d7('0x4e')]:_0xdec26d[_0x29d7('0x49')];if(!_0x1e6b93[_0x29d7('0x4a')][_0x29d7('0x50')]('nolimit')){_0x17adc4[_0x29d7('0x1f')]=qs['limit'](_0x1e6b93[_0x29d7('0x4a')][_0x29d7('0x1f')]);_0x17adc4[_0x29d7('0x1d')]=qs[_0x29d7('0x1d')](_0x1e6b93[_0x29d7('0x4a')]['offset']);}_0x17adc4['order']=qs[_0x29d7('0x51')](_0x1e6b93['query'][_0x29d7('0x51')]);_0x17adc4[_0x29d7('0x52')]=qs['filters'](_['pick'](_0x1e6b93[_0x29d7('0x4a')],_0xdec26d[_0x29d7('0x4c')]),_0x27abe1);if(_0x1e6b93[_0x29d7('0x4a')][_0x29d7('0x53')]){_0x17adc4['where']=_[_0x29d7('0x54')](_0x17adc4[_0x29d7('0x52')],{'$or':_['map'](_0x27abe1,function(_0x133a7a){if(_0x133a7a[_0x29d7('0x48')]!==_0x29d7('0x55')){var _0x4c8dcc={};_0x4c8dcc[_0x133a7a[_0x29d7('0x27')]]={'$like':'%'+_0x1e6b93['query']['filter']+'%'};return _0x4c8dcc;}})});}_0x17adc4=_[_0x29d7('0x54')]({},_0x17adc4,_0x1e6b93[_0x29d7('0x56')]);var _0x532bab={'where':_0x17adc4['where']};return db[_0x29d7('0x46')][_0x29d7('0x57')](_0x532bab)[_0x29d7('0xe')](function(_0x337768){_0x5b5c69[_0x29d7('0x57')]=_0x337768;if(_0x1e6b93[_0x29d7('0x4a')][_0x29d7('0x58')]){_0x17adc4['include']=[{'all':!![]}];}return db[_0x29d7('0x46')][_0x29d7('0x59')](_0x17adc4);})[_0x29d7('0xe')](function(_0x2000f6){_0x5b5c69[_0x29d7('0x5a')]=_0x2000f6;return _0x5b5c69;})[_0x29d7('0xe')](respondWithFilteredResult(_0x421dbd,_0x17adc4))[_0x29d7('0x19')](handleError(_0x421dbd,null));};exports['show']=function(_0x4e8479,_0x576626){var _0x91bcee={'raw':![],'where':{'id':_0x4e8479[_0x29d7('0x5b')]['id']},'include':[{'model':db[_0x29d7('0x41')],'as':_0x29d7('0x3f')},{'model':db['MailServerOut'],'as':_0x29d7('0x40')},{'model':db[_0x29d7('0x43')],'as':'mandatoryDispositionPause'}]},_0x34198f={};_0x34198f[_0x29d7('0x49')]=_[_0x29d7('0x4b')](db[_0x29d7('0x46')][_0x29d7('0x47')]);_0x34198f['query']=_[_0x29d7('0x4b')](_0x4e8479[_0x29d7('0x4a')]);_0x34198f[_0x29d7('0x4c')]=_[_0x29d7('0x4d')](_0x34198f['model'],_0x34198f[_0x29d7('0x4a')]);_0x91bcee[_0x29d7('0x4e')]=_[_0x29d7('0x4d')](_0x34198f['model'],qs['fields'](_0x4e8479['query'][_0x29d7('0x4f')]));_0x91bcee[_0x29d7('0x4e')]=_0x91bcee[_0x29d7('0x4e')][_0x29d7('0x5c')]?_0x91bcee['attributes']:_0x34198f[_0x29d7('0x49')];if(_0x4e8479[_0x29d7('0x4a')][_0x29d7('0x58')]){_0x91bcee[_0x29d7('0x5d')]=[{'all':!![]}];}_0x91bcee=_[_0x29d7('0x54')]({},_0x91bcee,_0x4e8479[_0x29d7('0x56')]);return db[_0x29d7('0x46')][_0x29d7('0x5e')](_0x91bcee)[_0x29d7('0xe')](handleEntityNotFound(_0x576626,null))[_0x29d7('0xe')](respondWithResult(_0x576626,null))['catch'](handleError(_0x576626,null));};exports[_0x29d7('0x21')]=function(_0x3f37f5,_0x468c0e){if(_0x3f37f5[_0x29d7('0x5f')]['id']){delete _0x3f37f5[_0x29d7('0x5f')]['id'];}var _0xf2d3ba=_0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x60')]===_0x29d7('0x61')?null:_0x3f37f5['body'][_0x29d7('0x60')];var _0x1de6ab=_0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x3f')]||{};var _0x34a4bb=_0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x40')]||{};if(_0xf2d3ba){_0x1de6ab['host']=getImapHost(_0xf2d3ba);_0x1de6ab[_0x29d7('0x3a')]=0x3e1;_0x34a4bb[_0x29d7('0x3e')]=getSmtpHost(_0xf2d3ba);_0x34a4bb[_0x29d7('0x3a')]=0x24b;_0x34a4bb[_0x29d7('0x3b')]=![];}if(_0x34a4bb['modernAuthentication']){_0x34a4bb[_0x29d7('0x3b')]=![];}else{_0x34a4bb[_0x29d7('0x39')]=null;}if(!_0x1de6ab[_0x29d7('0x38')])_0x1de6ab[_0x29d7('0x39')]=null;_0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x3f')]=_0x1de6ab;_0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x40')]=_0x34a4bb;return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x3f37f5['params']['id']},'include':[{'model':db[_0x29d7('0x41')],'as':'Imap'},{'model':db[_0x29d7('0x42')],'as':_0x29d7('0x40')},{'model':db[_0x29d7('0x43')],'as':_0x29d7('0x44')}]})[_0x29d7('0xe')](handleEntityNotFound(_0x468c0e,null))[_0x29d7('0xe')](function(_0x19a2ed){if(!_0x19a2ed)throw new Error(_0x29d7('0x62'));if(_0x19a2ed[_0x29d7('0x3c')])delete _0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x3f')];return _0x19a2ed;})[_0x29d7('0xe')](saveUpdates(_0x3f37f5[_0x29d7('0x5f')],null))[_0x29d7('0xe')](function(_0xc50ccb){if(!_0x3f37f5[_0x29d7('0x5f')]['Imap'])return _0xc50ccb;return db[_0x29d7('0x41')]['update'](_0x3f37f5['body'][_0x29d7('0x3f')],{'where':{'MailAccountId':_0xc50ccb['id']}})[_0x29d7('0xe')](function(){return _0xc50ccb;});})['then'](function(_0x280f01){if(!_0x3f37f5[_0x29d7('0x5f')][_0x29d7('0x40')])return _0x280f01;return db[_0x29d7('0x42')]['update'](_0x3f37f5[_0x29d7('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x280f01['id']}})[_0x29d7('0xe')](function(){return _0x280f01;});})[_0x29d7('0xe')](respondWithResult(_0x468c0e,null))[_0x29d7('0x19')](handleError(_0x468c0e,null));};exports[_0x29d7('0x63')]=function(_0x80678d,_0x10c6ba){return db[_0x29d7('0x46')][_0x29d7('0x63')]()[_0x29d7('0xe')](respondWithResult(_0x10c6ba,null))['catch'](handleError(_0x10c6ba,null));};exports['addDisposition']=function(_0x5e1fa9,_0x4ce6d0){if(_0x5e1fa9['body']['id']){delete _0x5e1fa9[_0x29d7('0x5f')]['id'];}return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x5e1fa9['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x4ce6d0,null))[_0x29d7('0xe')](function(_0x35a9b0){if(_0x35a9b0){_0x5e1fa9[_0x29d7('0x5f')]['MailAccountId']=_0x35a9b0['id'];return db[_0x29d7('0x64')][_0x29d7('0x65')](_0x5e1fa9[_0x29d7('0x5f')]);}})['then'](respondWithResult(_0x4ce6d0,null))[_0x29d7('0x19')](handleError(_0x4ce6d0,null));};exports[_0x29d7('0x66')]=function(_0x5d25b5,_0x7316ec){var _0x574a8f={'raw':![],'where':{}};var _0x15da85={};var _0x15ecea={'count':0x0,'rows':[]};return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x5d25b5[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x7316ec,null))[_0x29d7('0xe')](function(_0x3bf183){if(_0x3bf183){_0x15da85[_0x29d7('0x49')]=_[_0x29d7('0x4b')](db[_0x29d7('0x64')]['rawAttributes']);_0x15da85[_0x29d7('0x4a')]=_[_0x29d7('0x4b')](_0x5d25b5['query']);_0x15da85[_0x29d7('0x4c')]=_['intersection'](_0x15da85[_0x29d7('0x49')],_0x15da85[_0x29d7('0x4a')]);_0x574a8f[_0x29d7('0x4e')]=_['intersection'](_0x15da85[_0x29d7('0x49')],qs[_0x29d7('0x4f')](_0x5d25b5[_0x29d7('0x4a')]['fields']));_0x574a8f[_0x29d7('0x4e')]=_0x574a8f[_0x29d7('0x4e')]['length']?_0x574a8f[_0x29d7('0x4e')]:_0x15da85[_0x29d7('0x49')];if(!_0x5d25b5['query'][_0x29d7('0x50')]('nolimit')){_0x574a8f[_0x29d7('0x1f')]=qs[_0x29d7('0x1f')](_0x5d25b5['query'][_0x29d7('0x1f')]);_0x574a8f[_0x29d7('0x1d')]=qs[_0x29d7('0x1d')](_0x5d25b5[_0x29d7('0x4a')]['offset']);}_0x574a8f[_0x29d7('0x68')]=qs[_0x29d7('0x51')](_0x5d25b5['query']['sort']);_0x574a8f['where']=qs[_0x29d7('0x4c')](_[_0x29d7('0x69')](_0x5d25b5[_0x29d7('0x4a')],_0x15da85[_0x29d7('0x4c')]));_0x574a8f[_0x29d7('0x52')]['MailAccountId']=_0x3bf183['id'];if(_0x5d25b5[_0x29d7('0x4a')][_0x29d7('0x53')]){_0x574a8f['where']=_[_0x29d7('0x54')](_0x574a8f[_0x29d7('0x52')],{'$or':_[_0x29d7('0x45')](_0x574a8f[_0x29d7('0x4e')],function(_0x5af1b3){var _0x117db9={};_0x117db9[_0x5af1b3]={'$like':'%'+_0x5d25b5[_0x29d7('0x4a')][_0x29d7('0x53')]+'%'};return _0x117db9;})});}_0x574a8f=_[_0x29d7('0x54')]({},_0x574a8f,_0x5d25b5[_0x29d7('0x56')]);return db[_0x29d7('0x64')][_0x29d7('0x57')]({'where':_0x574a8f[_0x29d7('0x52')]})[_0x29d7('0xe')](function(_0x50a85d){_0x15ecea['count']=_0x50a85d;if(_0x5d25b5[_0x29d7('0x4a')][_0x29d7('0x58')]){_0x574a8f[_0x29d7('0x5d')]=[{'all':!![]}];}return db[_0x29d7('0x64')][_0x29d7('0x59')](_0x574a8f);})[_0x29d7('0xe')](function(_0x224c0a){_0x15ecea[_0x29d7('0x5a')]=_0x224c0a;return _0x15ecea;});}})['then'](respondWithFilteredResult(_0x7316ec,_0x574a8f))['catch'](handleError(_0x7316ec,null));};exports[_0x29d7('0x6a')]=function(_0x38247c,_0x3bf59c){return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x38247c[_0x29d7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3bf59c,null))[_0x29d7('0xe')](function(_0x377b69){if(_0x377b69){return _0x377b69[_0x29d7('0x6a')](_0x38247c[_0x29d7('0x4a')]['ids']);}})['then'](respondWithStatusCode(_0x3bf59c,null))[_0x29d7('0x19')](handleError(_0x3bf59c,null));};exports[_0x29d7('0x6b')]=function(_0x522e67,_0x4ce199){if(_0x522e67[_0x29d7('0x5f')]['id']){delete _0x522e67[_0x29d7('0x5f')]['id'];}return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x522e67['params']['id']}})['then'](handleEntityNotFound(_0x4ce199,null))[_0x29d7('0xe')](function(_0x2a221a){if(_0x2a221a){_0x522e67[_0x29d7('0x5f')][_0x29d7('0x6c')]=_0x2a221a['id'];return db[_0x29d7('0x6d')]['create'](_0x522e67[_0x29d7('0x5f')]);}})[_0x29d7('0xe')](respondWithResult(_0x4ce199,null))['catch'](handleError(_0x4ce199,null));};exports[_0x29d7('0x6e')]=function(_0x199abf,_0x142c5d){var _0x54c732={'raw':![],'where':{}};var _0x46192e={};var _0x282ac3={'count':0x0,'rows':[]};return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x199abf['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x142c5d,null))[_0x29d7('0xe')](function(_0x994b94){if(_0x994b94){_0x46192e[_0x29d7('0x49')]=_[_0x29d7('0x4b')](db['CannedAnswer'][_0x29d7('0x47')]);_0x46192e[_0x29d7('0x4a')]=_['keys'](_0x199abf[_0x29d7('0x4a')]);_0x46192e[_0x29d7('0x4c')]=_[_0x29d7('0x4d')](_0x46192e[_0x29d7('0x49')],_0x46192e['query']);_0x54c732[_0x29d7('0x4e')]=_[_0x29d7('0x4d')](_0x46192e[_0x29d7('0x49')],qs[_0x29d7('0x4f')](_0x199abf[_0x29d7('0x4a')][_0x29d7('0x4f')]));_0x54c732[_0x29d7('0x4e')]=_0x54c732[_0x29d7('0x4e')][_0x29d7('0x5c')]?_0x54c732[_0x29d7('0x4e')]:_0x46192e[_0x29d7('0x49')];if(!_0x199abf['query'][_0x29d7('0x50')](_0x29d7('0x6f'))){_0x54c732[_0x29d7('0x1f')]=qs[_0x29d7('0x1f')](_0x199abf[_0x29d7('0x4a')]['limit']);_0x54c732[_0x29d7('0x1d')]=qs[_0x29d7('0x1d')](_0x199abf['query']['offset']);}_0x54c732[_0x29d7('0x68')]=qs[_0x29d7('0x51')](_0x199abf['query']['sort']);_0x54c732[_0x29d7('0x52')]=qs['filters'](_['pick'](_0x199abf['query'],_0x46192e[_0x29d7('0x4c')]));_0x54c732[_0x29d7('0x52')][_0x29d7('0x6c')]=_0x994b94['id'];if(_0x199abf[_0x29d7('0x4a')][_0x29d7('0x53')]){_0x54c732[_0x29d7('0x52')]=_[_0x29d7('0x54')](_0x54c732[_0x29d7('0x52')],{'$or':_[_0x29d7('0x45')](_0x54c732['attributes'],function(_0x43c31c){var _0x2d53a0={};_0x2d53a0[_0x43c31c]={'$like':'%'+_0x199abf['query'][_0x29d7('0x53')]+'%'};return _0x2d53a0;})});}_0x54c732=_['merge']({},_0x54c732,_0x199abf[_0x29d7('0x56')]);return db[_0x29d7('0x6d')][_0x29d7('0x57')]({'where':_0x54c732[_0x29d7('0x52')]})[_0x29d7('0xe')](function(_0x4b4038){_0x282ac3['count']=_0x4b4038;if(_0x199abf[_0x29d7('0x4a')][_0x29d7('0x58')]){_0x54c732[_0x29d7('0x5d')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x54c732);})[_0x29d7('0xe')](function(_0x233bbd){_0x282ac3[_0x29d7('0x5a')]=_0x233bbd;return _0x282ac3;});}})[_0x29d7('0xe')](respondWithFilteredResult(_0x142c5d,_0x54c732))['catch'](handleError(_0x142c5d,null));};exports['removeAnswers']=function(_0x1ec901,_0x3c20c2){return db[_0x29d7('0x46')]['find']({'where':{'id':_0x1ec901['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x3c20c2,null))[_0x29d7('0xe')](function(_0xf415dd){if(_0xf415dd){return _0xf415dd[_0x29d7('0x70')](_0x1ec901['query'][_0x29d7('0x71')]);}})[_0x29d7('0xe')](respondWithStatusCode(_0x3c20c2,null))[_0x29d7('0x19')](handleError(_0x3c20c2,null));};exports['create']=function(_0x17c034,_0x31941e){var _0x143ef4={'name':_0x17c034[_0x29d7('0x5f')][_0x29d7('0x27')],'key':_0x17c034['body'][_0x29d7('0x72')],'provider':_0x17c034[_0x29d7('0x5f')][_0x29d7('0x60')]===_0x29d7('0x61')?null:_0x17c034[_0x29d7('0x5f')]['provider'],'email':_0x17c034[_0x29d7('0x5f')][_0x29d7('0x73')],'ListId':_0x17c034[_0x29d7('0x5f')][_0x29d7('0x74')],'active':!_['isNil'](_0x17c034['body'][_0x29d7('0x75')])?_0x17c034[_0x29d7('0x5f')]['active']:!![],'description':_0x17c034[_0x29d7('0x5f')][_0x29d7('0x76')]||null};var _0x2b947e=getAuthenticationOptions(_0x143ef4[_0x29d7('0x60')],_0x17c034[_0x29d7('0x5f')]);_0x143ef4['Imap']=_0x2b947e[_0x29d7('0x3f')];_0x143ef4[_0x29d7('0x40')]=_0x2b947e['Smtp'];return db[_0x29d7('0x46')][_0x29d7('0x65')](_0x143ef4,{'include':[{'model':db[_0x29d7('0x42')],'as':_0x29d7('0x40')},{'model':db['MailServerIn'],'as':_0x29d7('0x3f')}]})[_0x29d7('0xe')](function(_0x1bfb01){var _0x40d9f5=_0x17c034[_0x29d7('0x34')]['get']({'plain':!![]});if(!_0x40d9f5)throw new Error(_0x29d7('0x77'));if(_0x40d9f5['role']===_0x29d7('0x34')){var _0x4a4e96=_0x1bfb01[_0x29d7('0x23')]({'plain':!![]});return db[_0x29d7('0x78')][_0x29d7('0x5e')]({'where':{'name':_0x29d7('0x79'),'userProfileId':_0x40d9f5[_0x29d7('0x7a')]},'raw':!![]})[_0x29d7('0xe')](function(_0x512451){if(_0x512451&&_0x512451['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4a4e96[_0x29d7('0x27')],'resourceId':_0x4a4e96['id'],'type':_0x512451[_0x29d7('0x27')],'sectionId':_0x512451['id']},{})['then'](function(){return _0x1bfb01;});}else{return _0x1bfb01;}})['catch'](function(_0x311e5c){logger[_0x29d7('0x15')](_0x29d7('0x7b'),_0x311e5c);throw _0x311e5c;});}return _0x1bfb01;})[_0x29d7('0xe')](respondWithResult(_0x31941e,0xc9))[_0x29d7('0x19')](handleError(_0x31941e,null));};exports[_0x29d7('0x7c')]=function(_0x490d05,_0x2ecf08){return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x490d05[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x2ecf08,null))[_0x29d7('0xe')](function(_0x53bcf5){if(_0x53bcf5){return _0x53bcf5['getImap']();}return null;})[_0x29d7('0xe')](respondWithResult(_0x2ecf08,null))[_0x29d7('0x19')](handleError(_0x2ecf08,null));};exports['addImap']=function(_0x2e6aec,_0x316210){if(_0x2e6aec[_0x29d7('0x5f')]['id']){delete _0x2e6aec['body']['id'];}return db['MailAccount'][_0x29d7('0x5e')]({'where':{'id':_0x2e6aec[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x316210,null))[_0x29d7('0xe')](function(_0x3dcd83){if(_0x3dcd83){_0x2e6aec[_0x29d7('0x5f')][_0x29d7('0x6c')]=_0x3dcd83['id'];return db[_0x29d7('0x41')][_0x29d7('0x65')](_0x2e6aec['body']);}})[_0x29d7('0xe')](respondWithResult(_0x316210,null))[_0x29d7('0x19')](handleError(_0x316210,null));};exports[_0x29d7('0x7d')]=function(_0x8c6579,_0x247ea8){return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x8c6579[_0x29d7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x247ea8,null))[_0x29d7('0xe')](function(_0x5ad140){if(_0x5ad140){return _0x5ad140[_0x29d7('0x7e')](null);}return null;})[_0x29d7('0xe')](respondWithStatusCode(_0x247ea8,null))['catch'](handleError(_0x247ea8,null));};exports[_0x29d7('0x7f')]=function(_0x3216ab,_0x5f2f77){return db[_0x29d7('0x46')]['findOne']({'where':{'id':_0x3216ab[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x5f2f77,null))[_0x29d7('0xe')](function(_0x25d02d){if(_0x25d02d){return _0x25d02d['getSmtp']();}return null;})[_0x29d7('0xe')](respondWithResult(_0x5f2f77,null))[_0x29d7('0x19')](handleError(_0x5f2f77,null));};exports[_0x29d7('0x80')]=function(_0x58e524,_0x4489d9){if(_0x58e524[_0x29d7('0x5f')]['id']){delete _0x58e524[_0x29d7('0x5f')]['id'];}return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x58e524['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x4489d9,null))[_0x29d7('0xe')](function(_0x5e2f6b){if(_0x5e2f6b){_0x58e524['body'][_0x29d7('0x6c')]=_0x5e2f6b['id'];return db[_0x29d7('0x42')][_0x29d7('0x65')](_0x58e524[_0x29d7('0x5f')]);}})[_0x29d7('0xe')](respondWithResult(_0x4489d9,null))['catch'](handleError(_0x4489d9,null));};exports['removeSmtp']=function(_0x4102c8,_0x13dbf0){return db[_0x29d7('0x46')]['findOne']({'where':{'id':_0x4102c8[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x13dbf0,null))[_0x29d7('0xe')](function(_0x12227f){if(_0x12227f){return _0x12227f[_0x29d7('0x81')](null);}return null;})['then'](respondWithStatusCode(_0x13dbf0,null))[_0x29d7('0x19')](handleError(_0x13dbf0,null));};exports[_0x29d7('0x82')]=function(_0x1b761d,_0x44ea1d){return db[_0x29d7('0x83')][_0x29d7('0x5e')]({'where':{'id':_0x1b761d['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x44ea1d,null))['then'](function(_0x1a7f34){if(_0x1a7f34){return _0x1a7f34['addInteraction'](_0x1b761d[_0x29d7('0x5f')][_0x29d7('0x71')],_['omit'](_0x1b761d[_0x29d7('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x44ea1d,null))[_0x29d7('0x19')](handleError(_0x44ea1d,null));};exports['getInteractions']=function(_0x1e575f,_0x5733f1){var _0x4f86c7={'raw':![],'where':{}};var _0x3fb440={};var _0x2d3e6e={'count':0x0,'rows':[]};return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x1e575f[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x5733f1,null))[_0x29d7('0xe')](function(_0x36b4ae){if(_0x36b4ae){_0x3fb440[_0x29d7('0x49')]=_['keys'](db[_0x29d7('0x83')][_0x29d7('0x47')]);_0x3fb440[_0x29d7('0x4a')]=_['keys'](_0x1e575f[_0x29d7('0x4a')]);_0x3fb440['filters']=_[_0x29d7('0x4d')](_0x3fb440[_0x29d7('0x49')],_0x3fb440[_0x29d7('0x4a')]);_0x4f86c7['attributes']=_[_0x29d7('0x4d')](_0x3fb440['model'],qs[_0x29d7('0x4f')](_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x4f')]));_0x4f86c7[_0x29d7('0x4e')]=_0x4f86c7['attributes']['length']?_0x4f86c7[_0x29d7('0x4e')]:_0x3fb440[_0x29d7('0x49')];if(!_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x50')](_0x29d7('0x6f'))){_0x4f86c7[_0x29d7('0x1f')]=qs[_0x29d7('0x1f')](_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x1f')]);_0x4f86c7[_0x29d7('0x1d')]=qs[_0x29d7('0x1d')](_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x1d')]);}_0x4f86c7['order']=qs['sort'](_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x51')]);_0x4f86c7[_0x29d7('0x52')]=qs['filters'](_[_0x29d7('0x69')](_0x1e575f['query'],_0x3fb440[_0x29d7('0x4c')]));_0x4f86c7['where'][_0x29d7('0x6c')]=_0x36b4ae['id'];if(_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x53')]){_0x4f86c7[_0x29d7('0x52')]=_['merge'](_0x4f86c7[_0x29d7('0x52')],{'$or':_['map'](_0x4f86c7['attributes'],function(_0x487434){var _0x2e1f06={};_0x2e1f06[_0x487434]={'$like':'%'+_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x53')]+'%'};return _0x2e1f06;})});}_0x4f86c7=_[_0x29d7('0x54')]({},_0x4f86c7,_0x1e575f[_0x29d7('0x56')]);return db[_0x29d7('0x83')]['count']({'where':_0x4f86c7[_0x29d7('0x52')]})[_0x29d7('0xe')](function(_0x3facca){_0x2d3e6e[_0x29d7('0x57')]=_0x3facca;if(_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x58')]){_0x4f86c7[_0x29d7('0x5d')]=[{'model':db[_0x29d7('0x84')],'as':_0x29d7('0x85'),'required':![]},{'model':db['User'],'as':_0x29d7('0x86'),'attributes':['name','fullname',_0x29d7('0x87')],'required':![]},{'model':db[_0x29d7('0x88')],'as':_0x29d7('0x89'),'attributes':['id',_0x29d7('0x27'),_0x29d7('0x8a')],'where':_0x1e575f['query'][_0x29d7('0x8b')]?{'id':_0x1e575f[_0x29d7('0x4a')][_0x29d7('0x8b')]}:undefined,'required':_0x1e575f[_0x29d7('0x4a')]['tag']?!![]:![]}];}return db[_0x29d7('0x83')][_0x29d7('0x59')](_0x4f86c7);})[_0x29d7('0xe')](function(_0x89eb6f){_0x2d3e6e[_0x29d7('0x5a')]=_0x89eb6f;return _0x2d3e6e;});}})[_0x29d7('0xe')](respondWithFilteredResult(_0x5733f1,_0x4f86c7))[_0x29d7('0x19')](handleError(_0x5733f1,null));};exports[_0x29d7('0x8c')]=function addApplications(_0x2d1b29,_0x833519){var _0x21ce02=_0x2d1b29[_0x29d7('0x5b')]['id'];var _0x5b39c0=_0x2d1b29[_0x29d7('0x5f')];var _0x71e74b=0xc8;var _0x4a352f=null;return db[_0x29d7('0x8d')]['transaction']({'isolationLevel':db[_0x29d7('0x8d')][_0x29d7('0x8e')][_0x29d7('0x8f')][_0x29d7('0x90')]},function(_0x35e9b2){return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x21ce02},'transaction':_0x35e9b2})[_0x29d7('0xe')](function(_0x497110){if(_0x497110){return db[_0x29d7('0x91')][_0x29d7('0x22')]({'where':{'MailAccountId':_0x21ce02},'transaction':_0x35e9b2})[_0x29d7('0xe')](function(){var _0x5aff97=_[_0x29d7('0x45')](_0x5b39c0,function(_0x10b560){_0x10b560[_0x29d7('0x6c')]=_0x21ce02;return _0x10b560;});return db[_0x29d7('0x91')][_0x29d7('0x92')](_0x5aff97,{'transaction':_0x35e9b2});});}else{_0x71e74b=0x194;_0x4a352f=[];}});})[_0x29d7('0xe')](function(){if(_0x71e74b!==0x194){return db[_0x29d7('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0x21ce02},'order':_0x29d7('0x93')})['then'](function(_0xabb17c){_0x4a352f=_0xabb17c;});}})[_0x29d7('0x19')](function(_0x59db59){_0x71e74b=0x1f4;logger[_0x29d7('0x15')](_0x59db59[_0x29d7('0x26')]);if(_0x59db59['name']){delete _0x59db59['name'];}_0x4a352f=_0x59db59;})[_0x29d7('0x94')](function(){if(_0x4a352f===null){_0x833519['sendStatus'](_0x71e74b);}else{if(_0x71e74b===0x1f4){_0x833519[_0x29d7('0x1a')](_0x71e74b)['send'](_0x4a352f);}else{_0x833519[_0x29d7('0x1a')](_0x71e74b)[_0x29d7('0x1c')](_0x4a352f);}}});};exports[_0x29d7('0x95')]=function(_0x1e1cf3,_0x515974){var _0x9151e4={};var _0xe69a74={};var _0x288aea;var _0xfd493b;return db[_0x29d7('0x46')]['findOne']({'where':{'id':_0x1e1cf3[_0x29d7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x515974,null))[_0x29d7('0xe')](function(_0x4cad13){if(_0x4cad13){_0x288aea=_0x4cad13;_0xe69a74[_0x29d7('0x49')]=_[_0x29d7('0x4b')](db[_0x29d7('0x91')][_0x29d7('0x47')]);_0xe69a74[_0x29d7('0x4a')]=_['keys'](_0x1e1cf3['query']);_0xe69a74[_0x29d7('0x4c')]=_[_0x29d7('0x4d')](_0xe69a74[_0x29d7('0x49')],_0xe69a74[_0x29d7('0x4a')]);_0x9151e4[_0x29d7('0x4e')]=_['intersection'](_0xe69a74[_0x29d7('0x49')],qs[_0x29d7('0x4f')](_0x1e1cf3[_0x29d7('0x4a')]['fields']));_0x9151e4[_0x29d7('0x4e')]=_0x9151e4['attributes'][_0x29d7('0x5c')]?_0x9151e4['attributes']:_0xe69a74[_0x29d7('0x49')];_0x9151e4['order']=qs[_0x29d7('0x51')](_0x1e1cf3['query'][_0x29d7('0x51')]);_0x9151e4[_0x29d7('0x52')]=qs[_0x29d7('0x4c')](_[_0x29d7('0x69')](_0x1e1cf3[_0x29d7('0x4a')],_0xe69a74[_0x29d7('0x4c')]));if(_0x1e1cf3[_0x29d7('0x4a')]['filter']){_0x9151e4[_0x29d7('0x52')]=_[_0x29d7('0x54')](_0x9151e4[_0x29d7('0x52')],{'$or':_[_0x29d7('0x45')](_0x9151e4[_0x29d7('0x4e')],function(_0x518599){var _0x3f0907={};_0x3f0907[_0x518599]={'$like':'%'+_0x1e1cf3['query'][_0x29d7('0x53')]+'%'};return _0x3f0907;})});}_0x9151e4=_['merge']({},_0x9151e4,_0x1e1cf3[_0x29d7('0x56')]);return _0x288aea[_0x29d7('0x95')](_0x9151e4);}})[_0x29d7('0xe')](function(_0x591177){if(_0x591177){_0xfd493b=_0x591177[_0x29d7('0x5c')];if(!_0x1e1cf3['query'][_0x29d7('0x50')](_0x29d7('0x6f'))){_0x9151e4[_0x29d7('0x1f')]=qs[_0x29d7('0x1f')](_0x1e1cf3['query'][_0x29d7('0x1f')]);_0x9151e4[_0x29d7('0x1d')]=qs['offset'](_0x1e1cf3[_0x29d7('0x4a')][_0x29d7('0x1d')]);}return _0x288aea[_0x29d7('0x95')](_0x9151e4);}})['then'](function(_0x46740b){if(_0x46740b){return _0x46740b?{'count':_0xfd493b,'rows':_0x46740b}:null;}})[_0x29d7('0xe')](respondWithResult(_0x515974,null))[_0x29d7('0x19')](handleError(_0x515974,null));};exports[_0x29d7('0x96')]=function(_0xf896d4,_0xc7d1e3){var _0x5d1e93={'raw':!![],'where':{}};var _0x4dc3b6={};var _0x408f49={'count':0x0,'rows':[]};return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0xf896d4['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0xc7d1e3,null))['then'](function(_0x29debb){if(_0x29debb){_0x4dc3b6['model']=_['keys'](db[_0x29d7('0x97')][_0x29d7('0x47')]);_0x4dc3b6['query']=_['keys'](_0xf896d4['query']);_0x4dc3b6[_0x29d7('0x4c')]=_['intersection'](_0x4dc3b6['model'],_0x4dc3b6['query']);_0x5d1e93[_0x29d7('0x4e')]=_[_0x29d7('0x4d')](_0x4dc3b6[_0x29d7('0x49')],qs[_0x29d7('0x4f')](_0xf896d4['query'][_0x29d7('0x4f')]));_0x5d1e93[_0x29d7('0x4e')]=_0x5d1e93[_0x29d7('0x4e')][_0x29d7('0x5c')]?_0x5d1e93[_0x29d7('0x4e')]:_0x4dc3b6[_0x29d7('0x49')];if(!_0xf896d4['query'][_0x29d7('0x50')](_0x29d7('0x6f'))){_0x5d1e93[_0x29d7('0x1f')]=qs[_0x29d7('0x1f')](_0xf896d4[_0x29d7('0x4a')]['limit']);_0x5d1e93[_0x29d7('0x1d')]=qs[_0x29d7('0x1d')](_0xf896d4[_0x29d7('0x4a')][_0x29d7('0x1d')]);}_0x5d1e93['order']=qs[_0x29d7('0x51')](_0xf896d4[_0x29d7('0x4a')]['sort']);_0x5d1e93['where']=qs[_0x29d7('0x4c')](_[_0x29d7('0x69')](_0xf896d4['query'],_0x4dc3b6['filters']));_0x5d1e93[_0x29d7('0x52')]['MailAccountId']=_0x29debb['id'];if(_0xf896d4['query'][_0x29d7('0x53')]){_0x5d1e93[_0x29d7('0x52')]=_['merge'](_0x5d1e93['where'],{'$or':_[_0x29d7('0x45')](_0x5d1e93['attributes'],function(_0x316ff7){var _0x50a166={};_0x50a166[_0x316ff7]={'$like':'%'+_0xf896d4[_0x29d7('0x4a')][_0x29d7('0x53')]+'%'};return _0x50a166;})});}if(_0xf896d4[_0x29d7('0x4a')][_0x29d7('0x98')]){var _0x2ff345=_0xf896d4['query'][_0x29d7('0x98')][_0x29d7('0x99')](',');var _0x1d4c27={};_0x1d4c27[_0x2ff345[0x0]]={'$gte':moment(_0x2ff345[0x1])[_0x29d7('0x9a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5d1e93['where']=_['merge'](_0x5d1e93[_0x29d7('0x52')],_0x1d4c27);}_0x5d1e93=_[_0x29d7('0x54')]({},_0x5d1e93,_0xf896d4['options']);return db[_0x29d7('0x97')]['count']({'where':_0x5d1e93[_0x29d7('0x52')]})[_0x29d7('0xe')](function(_0x3bd48b){_0x408f49[_0x29d7('0x57')]=_0x3bd48b;if(_0xf896d4[_0x29d7('0x4a')]['includeAll']){_0x5d1e93[_0x29d7('0x5d')]=[{'all':!![]}];}return db[_0x29d7('0x97')][_0x29d7('0x59')](_0x5d1e93);})[_0x29d7('0xe')](function(_0x5e7b0b){if(_0xf896d4[_0x29d7('0x4a')]['inlineCss']==='true'){for(var _0x214bca=0x0;_0x214bca<_0x5e7b0b['length'];_0x214bca++){_0x5e7b0b[_0x214bca][_0x29d7('0x5f')]=juice(_0x5e7b0b[_0x214bca][_0x29d7('0x5f')]);}}_0x408f49['rows']=_0x5e7b0b;return _0x408f49;});}})[_0x29d7('0xe')](respondWithFilteredResult(_0xc7d1e3,_0x5d1e93))['catch'](handleError(_0xc7d1e3,null));};exports[_0x29d7('0x28')]=function(_0x1ca07e,_0x174276){var _0x30e0f5,_0x42c331={},_0x3bca39;if(_0x1ca07e[_0x29d7('0x5f')]['to']){_0x3bca39=_0x1ca07e[_0x29d7('0x5f')]['to'][_0x29d7('0x99')](',')[0x0];}return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x1ca07e[_0x29d7('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x3bca39},'limit':0x1,'order':[[_0x29d7('0x9b'),'DESC']]}]},{'model':db[_0x29d7('0x42')],'as':_0x29d7('0x40'),'raw':!![],'include':[{'model':db[_0x29d7('0x9c')],'as':_0x29d7('0x9c'),'raw':!![]}]}]})[_0x29d7('0xe')](handleEntityNotFound(_0x174276,null))[_0x29d7('0xe')](function(_0x30afb6){if(!_0x30afb6)return;_0x30e0f5=_0x30afb6;if(!_0x30afb6[_0x29d7('0x40')])throw new Error(_0x29d7('0x9d'));if(_[_0x29d7('0x9e')](_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0x9f')])){_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0x9f')]=util[_0x29d7('0x9a')](_0x29d7('0xa0'),_0x30afb6[_0x29d7('0x27')],_0x30afb6[_0x29d7('0x73')]||_0x30afb6[_0x29d7('0x40')][_0x29d7('0x34')]);}if(_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xa1')]&&_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xa1')][_0x29d7('0x5c')]){for(var _0x4c3930=0x0;_0x4c3930<_0x1ca07e[_0x29d7('0x5f')]['attachments'][_0x29d7('0x5c')];_0x4c3930+=0x1){_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xa1')][_0x4c3930]={'filename':_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xa1')][_0x4c3930][_0x29d7('0x27')],'path':path['join'](config[_0x29d7('0xa2')],_0x29d7('0xa3'),_0x1ca07e[_0x29d7('0x5f')]['attachments'][_0x4c3930][_0x29d7('0xa4')])};}}var _0x26112c=_0x30afb6[_0x29d7('0xa5')]();return respondWithRpcPromise(_0x29d7('0xa6'),'sendMail',{'account':_0x26112c,'message':_0x1ca07e[_0x29d7('0x5f')]});})[_0x29d7('0xe')](function(_0x213cd1){if(!_0x213cd1)return;_0x42c331=_0x213cd1;if(!_0x30e0f5[_0x29d7('0xa7')])throw new Error(_0x29d7('0xa8'));if(_0x30e0f5[_0x29d7('0xa7')]['Contacts'][_0x29d7('0x5c')])return _0x30e0f5[_0x29d7('0xa7')]['Contacts'][0x0];return db[_0x29d7('0x84')][_0x29d7('0x65')](_[_0x29d7('0x9')](_0x1ca07e[_0x29d7('0x5f')],{'firstName':_0x1ca07e[_0x29d7('0x5f')]['to'],'email':_0x1ca07e['body']['to'],'phone':_0x1ca07e[_0x29d7('0x5f')]['to'],'ListId':_0x30e0f5['ListId']}));})[_0x29d7('0xe')](function(_0x31b963){if(!_0x31b963)return;var _0x4e2264={'UserId':_0x1ca07e[_0x29d7('0x34')]['id'],'ContactId':_0x31b963['id'],'MailAccountId':_0x30e0f5['id'],'inReplyTo':_0x42c331[_0x29d7('0xa9')],'to':_0x1ca07e['body']['from'],'cc':_0x1ca07e[_0x29d7('0x5f')]['cc'],'subject':_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xaa')],'attach':_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xab')],'firstMsgDirection':_0x29d7('0xac'),'lastMsgAt':moment()[_0x29d7('0x9a')](_0x29d7('0xad')),'lastMsgDirection':_0x29d7('0xac'),'Messages':[_[_0x29d7('0x54')](_0x1ca07e[_0x29d7('0x5f')],{'messageId':_0x42c331[_0x29d7('0xa9')],'sentAt':moment()['format'](_0x29d7('0xad')),'read':!![],'MailAccountId':_0x30e0f5['id'],'UserId':_0x1ca07e[_0x29d7('0x34')]['id'],'ContactId':_0x31b963['id']})]};if(_0x1ca07e[_0x29d7('0x5f')][_0x29d7('0xae')]){_0x4e2264=_[_0x29d7('0x54')](_0x4e2264,_0x1ca07e[_0x29d7('0x5f')]['Interaction']);}return db[_0x29d7('0x83')][_0x29d7('0x65')](_0x4e2264,{'include':[{'model':db[_0x29d7('0x97')],'as':_0x29d7('0xaf')}]});})[_0x29d7('0xe')](respondWithResult(_0x174276,null))[_0x29d7('0x19')](handleError(_0x174276,null));};exports['verifySmtp']=function(_0x5657b4,_0x530b68){return db[_0x29d7('0x46')]['find']({'where':{'id':_0x5657b4[_0x29d7('0x5b')]['id']},'include':[{'model':db[_0x29d7('0x42')],'as':_0x29d7('0x40'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x29d7('0x9c'),'raw':!![]}]}]})[_0x29d7('0xe')](handleEntityNotFound(_0x530b68,null))['then'](function(_0x29de79){if(!_0x29de79[_0x29d7('0x40')])return;var _0x4f2ce2=_0x29de79['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x29d7('0xb0'),{'account':_0x4f2ce2});})[_0x29d7('0xe')](respondWithResult(_0x530b68,null))[_0x29d7('0x19')](handleError(_0x530b68,null));};exports[_0x29d7('0x22')]=function(_0x24477e,_0x4ac079){return db[_0x29d7('0x46')]['find']({'where':{'id':_0x24477e[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x4ac079,null))[_0x29d7('0xe')](function(_0x12e365){if(_0x12e365&&_0x12e365[_0x29d7('0x3c')]){throw new db[(_0x29d7('0xb1'))][(_0x29d7('0xb2'))](_0x29d7('0xb3'));}return _0x12e365;})['then'](removeEntity(_0x4ac079,null))[_0x29d7('0x19')](handleError(_0x4ac079,null));};exports['addAgents']=function(_0x2e9a31,_0x1922ae){return db[_0x29d7('0x46')]['find']({'where':{'id':_0x2e9a31['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x1922ae,null))[_0x29d7('0xe')](function(_0x43f327){if(_0x43f327){return _0x43f327[_0x29d7('0xb4')](_0x2e9a31['body'][_0x29d7('0x71')],_[_0x29d7('0xb5')](_0x2e9a31[_0x29d7('0x5f')],['ids','id'])||{})[_0x29d7('0xb6')](function(_0x3aa515){for(var _0x563b8c=0x0;_0x563b8c<_0x2e9a31[_0x29d7('0x5f')][_0x29d7('0x71')]['length'];_0x563b8c+=0x1){socket[_0x29d7('0xb7')](_0x29d7('0xb8'),{'UserId':Number(_0x2e9a31['body'][_0x29d7('0x71')][_0x563b8c]),'MailAccountId':Number(_0x2e9a31['params']['id'])});}return _0x3aa515;});}})['then'](respondWithResult(_0x1922ae,null))[_0x29d7('0x19')](handleError(_0x1922ae,null));};exports[_0x29d7('0xb9')]=function(_0x42b60e,_0x8e3d69){return db[_0x29d7('0x46')][_0x29d7('0x5e')]({'where':{'id':_0x42b60e['params']['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x8e3d69,null))['then'](function(_0x476331){if(_0x476331){return _0x476331[_0x29d7('0xb9')](_0x42b60e[_0x29d7('0x4a')][_0x29d7('0x71')])[_0x29d7('0xe')](function(){if(_[_0x29d7('0xba')](_0x42b60e[_0x29d7('0x4a')][_0x29d7('0x71')])){for(var _0xa76fe3=0x0;_0xa76fe3<_0x42b60e[_0x29d7('0x4a')][_0x29d7('0x71')][_0x29d7('0x5c')];_0xa76fe3+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x42b60e['query']['ids'][_0xa76fe3]),'MailAccountId':Number(_0x42b60e['params']['id'])});}}else{socket['emit'](_0x29d7('0xbb'),{'UserId':Number(_0x42b60e[_0x29d7('0x4a')][_0x29d7('0x71')]),'MailAccountId':Number(_0x42b60e['params']['id'])});}});}})[_0x29d7('0xe')](respondWithStatusCode(_0x8e3d69,null))[_0x29d7('0x19')](handleError(_0x8e3d69,null));};exports[_0x29d7('0xbc')]=function(_0x3e2764,_0x5a5729){var _0x3a6f8b={};var _0xd2dd5a={};var _0x2003a0;var _0x2be30b;return db[_0x29d7('0x46')][_0x29d7('0x67')]({'where':{'id':_0x3e2764[_0x29d7('0x5b')]['id']}})[_0x29d7('0xe')](handleEntityNotFound(_0x5a5729,null))['then'](function(_0x14ad88){if(_0x14ad88){_0x2003a0=_0x14ad88;_0xd2dd5a[_0x29d7('0x49')]=_['keys'](db[_0x29d7('0xbd')][_0x29d7('0x47')]);_0xd2dd5a[_0x29d7('0x4a')]=_['keys'](_0x3e2764[_0x29d7('0x4a')]);_0xd2dd5a[_0x29d7('0x4c')]=_['intersection'](_0xd2dd5a[_0x29d7('0x49')],_0xd2dd5a['query']);_0x3a6f8b[_0x29d7('0x4e')]=_['intersection'](_0xd2dd5a[_0x29d7('0x49')],qs['fields'](_0x3e2764[_0x29d7('0x4a')]['fields']));_0x3a6f8b[_0x29d7('0x4e')]=_0x3a6f8b['attributes'][_0x29d7('0x5c')]?_0x3a6f8b[_0x29d7('0x4e')]:_0xd2dd5a[_0x29d7('0x49')];_0x3a6f8b[_0x29d7('0x68')]=qs[_0x29d7('0x51')](_0x3e2764['query'][_0x29d7('0x51')]);_0x3a6f8b[_0x29d7('0x52')]=qs[_0x29d7('0x4c')](_[_0x29d7('0x69')](_0x3e2764[_0x29d7('0x4a')],_0xd2dd5a[_0x29d7('0x4c')]));if(_0x3e2764['query']['filter']){_0x3a6f8b['where']=_[_0x29d7('0x54')](_0x3a6f8b[_0x29d7('0x52')],{'$or':_[_0x29d7('0x45')](_0x3a6f8b[_0x29d7('0x4e')],function(_0x2712f2){var _0x1fc9e1={};_0x1fc9e1[_0x2712f2]={'$like':'%'+_0x3e2764[_0x29d7('0x4a')]['filter']+'%'};return _0x1fc9e1;})});}_0x3a6f8b=_[_0x29d7('0x54')]({},_0x3a6f8b,_0x3e2764[_0x29d7('0x56')]);return _0x2003a0[_0x29d7('0xbc')](_0x3a6f8b);}})[_0x29d7('0xe')](function(_0x283663){if(_0x283663){_0x2be30b=_0x283663[_0x29d7('0x5c')];if(!_0x3e2764[_0x29d7('0x4a')]['hasOwnProperty']('nolimit')){_0x3a6f8b[_0x29d7('0x1f')]=qs[_0x29d7('0x1f')](_0x3e2764[_0x29d7('0x4a')][_0x29d7('0x1f')]);_0x3a6f8b['offset']=qs[_0x29d7('0x1d')](_0x3e2764[_0x29d7('0x4a')][_0x29d7('0x1d')]);}return _0x2003a0['getAgents'](_0x3a6f8b);}})[_0x29d7('0xe')](function(_0x170d30){if(_0x170d30){return _0x170d30?{'count':_0x2be30b,'rows':_0x170d30}:null;}})['then'](respondWithResult(_0x5a5729,null))[_0x29d7('0x19')](handleError(_0x5a5729,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x099f=['exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x57b0c6,_0x5ec400){var _0x22c772=function(_0x39e0ad){while(--_0x39e0ad){_0x57b0c6['push'](_0x57b0c6['shift']());}};_0x22c772(++_0x5ec400);}(_0x099f,0x133));var _0xf099=function(_0x57e940,_0x1a3a3f){_0x57e940=_0x57e940-0x0;var _0x2f48dc=_0x099f[_0x57e940];return _0x2f48dc;};'use strict';var EventEmitter=require(_0xf099('0x0'));var MailAccount=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf099('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf099('0x4'),'afterDestroy':_0xf099('0x5')};function emitEvent(_0x8c3488){return function(_0x24270f,_0x3f46c0,_0x35a43a){MailAccountEvents[_0xf099('0x6')](_0x8c3488+':'+_0x24270f['id'],_0x24270f);MailAccountEvents['emit'](_0x8c3488,_0x24270f);_0x35a43a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xf099('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0x39e6=['update','remove','emit','hasOwnProperty','hook','exports','events','MailAccount'];(function(_0x3dba88,_0x723c55){var _0x44c56b=function(_0x11d632){while(--_0x11d632){_0x3dba88['push'](_0x3dba88['shift']());}};_0x44c56b(++_0x723c55);}(_0x39e6,0x9e));var _0x639e=function(_0x3d7b1b,_0x778c6d){_0x3d7b1b=_0x3d7b1b-0x0;var _0x4a73b9=_0x39e6[_0x3d7b1b];return _0x4a73b9;};'use strict';var EventEmitter=require(_0x639e('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x639e('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x639e('0x2'),'afterDestroy':_0x639e('0x3')};function emitEvent(_0x529394){return function(_0x467229,_0x207d6a,_0x199e72){MailAccountEvents[_0x639e('0x4')](_0x529394+':'+_0x467229['id'],_0x467229);MailAccountEvents[_0x639e('0x4')](_0x529394,_0x467229);_0x199e72(null);};}for(var e in events){if(events[_0x639e('0x5')](e)){var event=events[e];MailAccount[_0x639e('0x6')](e,emitEvent(event));}}module[_0x639e('0x7')]=MailAccountEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f8d=['OAuth2','user','data5','auth','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','service','provider','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0xa5ac3a,_0x47e561){var _0x467486=function(_0x5456c5){while(--_0x5456c5){_0xa5ac3a['push'](_0xa5ac3a['shift']());}};_0x467486(++_0x47e561);}(_0x7f8d,0x8a));var _0xd7f8=function(_0xbf0a97,_0x1692ef){_0xbf0a97=_0xbf0a97-0x0;var _0x5c0e21=_0x7f8d[_0xbf0a97];return _0x5c0e21;};'use strict';var attributes=require(_0xd7f8('0x0'));module[_0xd7f8('0x1')]=function(_0x55a0f4){return _0x55a0f4['define'](_0xd7f8('0x2'),attributes,{'tableName':_0xd7f8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xe274e0=this;var _0xfca19e={'id':_0xe274e0['id'],'tls':{'rejectUnauthorized':![]}};if(_0xe274e0['provider']!=='custom'){_0xfca19e[_0xd7f8('0x4')]=_0xe274e0[_0xd7f8('0x5')];}else{_0xfca19e[_0xd7f8('0x6')]=_0xe274e0['Smtp']['host'];_0xfca19e[_0xd7f8('0x7')]=_0xe274e0[_0xd7f8('0x8')]['port'];_0xfca19e['secure']=_0xe274e0['Smtp'][_0xd7f8('0x9')];}if(_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xa')]){if(_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xb')]){if(!_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xc')])throw new Error(_0xd7f8('0xd'));_0xfca19e['auth']={'type':_0xd7f8('0xe'),'user':_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xf')],'accessToken':_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0xc')][_0xd7f8('0x10')]};}else{_0xfca19e[_0xd7f8('0x11')]={'user':_0xe274e0['Smtp'][_0xd7f8('0xf')],'pass':_0xe274e0[_0xd7f8('0x8')][_0xd7f8('0x12')]};}}return _0xfca19e;}}});};
\ No newline at end of file
+var _0x7402=['mail_accounts','provider','custom','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','pass','./mailAccount.attributes','exports','MailAccount'];(function(_0x2e382d,_0x2425d5){var _0x4be5ff=function(_0x427da6){while(--_0x427da6){_0x2e382d['push'](_0x2e382d['shift']());}};_0x4be5ff(++_0x2425d5);}(_0x7402,0x16d));var _0x2740=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0x7402[_0x3a0ebd];return _0x51a660;};'use strict';var attributes=require(_0x2740('0x0'));module[_0x2740('0x1')]=function(_0x1524cd){return _0x1524cd['define'](_0x2740('0x2'),attributes,{'tableName':_0x2740('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3978cd=this;var _0x4183c2={'id':_0x3978cd['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3978cd[_0x2740('0x4')]!==_0x2740('0x5')){_0x4183c2['service']=_0x3978cd[_0x2740('0x4')];}else{_0x4183c2['host']=_0x3978cd[_0x2740('0x6')]['host'];_0x4183c2['port']=_0x3978cd[_0x2740('0x6')][_0x2740('0x7')];_0x4183c2[_0x2740('0x8')]=_0x3978cd[_0x2740('0x6')][_0x2740('0x8')];}if(_0x3978cd['Smtp']['authentication']){if(_0x3978cd[_0x2740('0x6')][_0x2740('0x9')]){if(!_0x3978cd[_0x2740('0x6')][_0x2740('0xa')])throw new Error(_0x2740('0xb'));_0x4183c2[_0x2740('0xc')]={'type':'OAuth2','user':_0x3978cd[_0x2740('0x6')]['user'],'accessToken':_0x3978cd[_0x2740('0x6')][_0x2740('0xa')][_0x2740('0xd')]};}else{_0x4183c2[_0x2740('0xc')]={'user':_0x3978cd[_0x2740('0x6')][_0x2740('0xe')],'pass':_0x3978cd['Smtp'][_0x2740('0xf')]};}}return _0x4183c2;}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c09=['applications','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','Contact\x20not\x20found','spread','update','format','interaction','get','created','MailMessage','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','User','name','UserId','unshift','agent','queueId','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','options','raw','where','attributes','include','map','model','MailAccount','find','smtp','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','list','priority','asc','autoclose'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7c09,0x102));var _0x97c0=function(_0x50c342,_0x26d8f1){_0x50c342=_0x50c342-0x0;var _0x6cf313=_0x7c09[_0x50c342];return _0x6cf313;};'use strict';var _=require('lodash');var moment=require(_0x97c0('0x0'));var BPromise=require(_0x97c0('0x1'));var rs=require('randomstring');var Redis=require(_0x97c0('0x2'));var db=require(_0x97c0('0x3'))['db'];var logger=require(_0x97c0('0x4'))(_0x97c0('0x5'));var config=require(_0x97c0('0x6'));var jayson=require(_0x97c0('0x7'));var client=jayson[_0x97c0('0x8')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0x97c0('0x9')],{'host':_0x97c0('0xa'),'port':0x18eb});var socket=require(_0x97c0('0xb'))(new Redis(config[_0x97c0('0x9')]));require(_0x97c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x205520,_0x4ac5f1,_0x2d5507){return new BPromise(function(_0x28cac4,_0x52bce2){return client['request'](_0x205520,_0x2d5507)[_0x97c0('0xd')](function(_0x340112){logger[_0x97c0('0xe')](_0x97c0('0xf'),_0x4ac5f1,_0x97c0('0x10'));logger[_0x97c0('0x11')](_0x97c0('0x12'),_0x4ac5f1,_0x97c0('0x10'),JSON[_0x97c0('0x13')](_0x340112));if(_0x340112[_0x97c0('0x14')]){if(_0x340112[_0x97c0('0x14')][_0x97c0('0x15')]===0x1f4){logger[_0x97c0('0x14')]('MailAccount,\x20%s,\x20%s',_0x4ac5f1,_0x340112[_0x97c0('0x14')][_0x97c0('0x16')]);return _0x52bce2(_0x340112[_0x97c0('0x14')]['message']);}logger[_0x97c0('0x14')](_0x97c0('0xf'),_0x4ac5f1,_0x340112[_0x97c0('0x14')][_0x97c0('0x16')]);return _0x28cac4(_0x340112[_0x97c0('0x14')][_0x97c0('0x16')]);}else{logger['info'](_0x97c0('0xf'),_0x4ac5f1,_0x97c0('0x10'));_0x28cac4(_0x340112['result'][_0x97c0('0x16')]);}})[_0x97c0('0x17')](function(_0x179d43){logger[_0x97c0('0x14')](_0x97c0('0xf'),_0x4ac5f1,_0x179d43);_0x52bce2(_0x179d43);});});}exports[_0x97c0('0x18')]=function(_0x4fed42){var _0x1eeaf0=this;return new Promise(function(_0x432705,_0x323863){return db['MailAccount']['findAll']({'raw':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x4fed42['options']?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1b')]||null:null,'attributes':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1c')]||null:null,'limit':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')]['limit']||null:null,'include':_0x4fed42[_0x97c0('0x19')]?_0x4fed42[_0x97c0('0x19')][_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x4fed42['options'][_0x97c0('0x1d')],function(_0x14cada){return{'model':db[_0x14cada['model']],'as':_0x14cada['as'],'attributes':_0x14cada[_0x97c0('0x1c')],'include':_0x14cada[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x14cada['include'],function(_0x4f11ba){return{'model':db[_0x4f11ba['model']],'as':_0x4f11ba['as'],'attributes':_0x4f11ba[_0x97c0('0x1c')],'include':_0x4f11ba[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x4f11ba[_0x97c0('0x1d')],function(_0x26939e){return{'model':db[_0x26939e[_0x97c0('0x1f')]],'as':_0x26939e['as'],'attributes':_0x26939e['attributes']};}):[]};}):[]};}):[]:[]})[_0x97c0('0xd')](function(_0x1c183f){logger[_0x97c0('0xe')]('GetMailAccount',_0x4fed42);logger[_0x97c0('0x11')](_0x97c0('0x18'),_0x4fed42,JSON[_0x97c0('0x13')](_0x1c183f));_0x432705(_0x1c183f);})[_0x97c0('0x17')](function(_0x2a7b2b){logger['error']('GetMailAccount',_0x2a7b2b[_0x97c0('0x16')],_0x4fed42);_0x323863(_0x1eeaf0[_0x97c0('0x14')](0x1f4,_0x2a7b2b[_0x97c0('0x16')]));});});};exports['ShowMailAccount']=function(_0xdedd82){var _0x1cebe7=this;return new Promise(function(_0x52bdfe,_0x30147b){return db[_0x97c0('0x20')][_0x97c0('0x21')]({'raw':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1a')]===undefined?!![]:![]:!![],'where':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1b')]||null:null,'attributes':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1c')]||null:null,'include':_0xdedd82[_0x97c0('0x19')]?_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1d')]?_['map'](_0xdedd82[_0x97c0('0x19')][_0x97c0('0x1d')],function(_0x2b7f9a){return{'model':db[_0x2b7f9a[_0x97c0('0x1f')]],'as':_0x2b7f9a['as'],'attributes':_0x2b7f9a[_0x97c0('0x1c')],'include':_0x2b7f9a[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x2b7f9a[_0x97c0('0x1d')],function(_0x582828){return{'model':db[_0x582828[_0x97c0('0x1f')]],'as':_0x582828['as'],'attributes':_0x582828['attributes'],'include':_0x582828[_0x97c0('0x1d')]?_[_0x97c0('0x1e')](_0x582828[_0x97c0('0x1d')],function(_0x3988d3){return{'model':db[_0x3988d3[_0x97c0('0x1f')]],'as':_0x3988d3['as'],'attributes':_0x3988d3[_0x97c0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x97c0('0xd')](function(_0x225ca4){if(_0xdedd82[_0x97c0('0x19')][_0x97c0('0x22')]===!![])_0x225ca4[_0x97c0('0x23')]('smtpOptions',_0x225ca4[_0x97c0('0x24')]());logger[_0x97c0('0xe')]('ShowMailAccount',_0xdedd82);logger[_0x97c0('0x11')](_0x97c0('0x25'),_0xdedd82,JSON[_0x97c0('0x13')](_0x225ca4));_0x52bdfe(_0x225ca4);})[_0x97c0('0x17')](function(_0x59a9d8){logger[_0x97c0('0x14')]('ShowMailAccount',_0x59a9d8[_0x97c0('0x16')],_0xdedd82);_0x30147b(_0x1cebe7[_0x97c0('0x14')](0x1f4,_0x59a9d8['message']));});});};exports[_0x97c0('0x26')]=function(_0x163ebb){var _0xd728dd=this;return new Promise(function(_0xb13649,_0x33b034){var _0x2121e8={'body':_0x163ebb[_0x97c0('0x27')],'channel':_0x97c0('0x28')};var _0x1fd594=_[_0x97c0('0x29')](_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')]),['createdAt',_0x97c0('0x2d'),_0x97c0('0x2e'),_0x97c0('0x2f')]);var _0x142421=![];if(_0x163ebb[_0x97c0('0x27')]['id']){delete _0x163ebb[_0x97c0('0x27')]['id'];}if(_[_0x97c0('0x30')](_0x163ebb['body']['from'])){return _0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x97c0('0x31')));}if(_[_0x97c0('0x30')](_0x163ebb[_0x97c0('0x27')][_0x97c0('0x27')])||_0x163ebb['body']['body']===''){return _0x33b034(_0xd728dd['error'](0x1f4,_0x97c0('0x32')));}if(_['isNil'](_0x163ebb['body'][_0x97c0('0x33')])){return _0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x97c0('0x34')+_0x1fd594));}if(!_[_0x97c0('0x35')](_0x1fd594,_0x163ebb[_0x97c0('0x27')]['mapKey'])){return _0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x97c0('0x36')+_0x1fd594));}var _0x342eeb={};_0x342eeb[_0x163ebb[_0x97c0('0x27')][_0x97c0('0x33')]]=_0x163ebb[_0x97c0('0x27')][_0x97c0('0x37')];return db[_0x97c0('0x20')][_0x97c0('0x21')]({'where':{'id':_0x163ebb[_0x97c0('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x97c0('0x39'),'include':[{'model':db[_0x97c0('0x2b')],'as':_0x97c0('0x3a'),'where':_0x342eeb,'limit':0x1,'order':[[_0x97c0('0x2d'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x97c0('0x3b')},{'model':db[_0x97c0('0x3c')],'as':_0x97c0('0x3d'),'include':[{'model':db['CloudProvider'],'as':_0x97c0('0x3e')}]}]})[_0x97c0('0xd')](function(_0x240f68){if(_0x240f68&&_0x240f68[_0x97c0('0x39')]){var _0x122524=_0x240f68['get']({'plain':!![]});_0x2121e8[_0x97c0('0x38')]=_[_0x97c0('0x3f')](_0x122524,[_0x97c0('0x3b'),'List']);_0x2121e8['account'][_0x97c0('0x40')]=_0x240f68['getSmtpOptions']();_0x2121e8['applications']=_0x122524[_0x97c0('0x3b')];_0x2121e8[_0x97c0('0x41')]=_0x122524[_0x97c0('0x39')];_0x2121e8['applications']=_['orderBy'](_0x2121e8['applications'],[_0x97c0('0x42')],[_0x97c0('0x43')]);if(_0x2121e8[_0x97c0('0x38')]&&_0x2121e8[_0x97c0('0x38')][_0x97c0('0x44')]){_0x2121e8[_0x97c0('0x45')][_0x97c0('0x46')]({'id':0x0,'priority':_0x2121e8['applications'][_0x97c0('0x47')]+0x1,'app':_0x97c0('0x48'),'appdata':_0x97c0('0x44'),'interval':_0x97c0('0x49')});}if(_0x2121e8[_0x97c0('0x38')][_0x97c0('0x3b')]){delete _0x2121e8['account'][_0x97c0('0x3b')];}if(_0x2121e8[_0x97c0('0x38')]['List']){delete _0x2121e8[_0x97c0('0x38')][_0x97c0('0x39')];}if(_0x122524[_0x97c0('0x39')][_0x97c0('0x3a')][_0x97c0('0x47')]){return _0x122524[_0x97c0('0x39')][_0x97c0('0x3a')][0x0];}var _0x4e2cec=_[_0x97c0('0x4a')](_0x163ebb[_0x97c0('0x27')],{'firstName':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x37')],'ListId':_0x122524[_0x97c0('0x2f')]});_0x4e2cec[_0x163ebb[_0x97c0('0x27')][_0x97c0('0x33')]]=_0x163ebb[_0x97c0('0x27')][_0x97c0('0x37')];return db[_0x97c0('0x2b')][_0x97c0('0x4b')](_0x4e2cec);}else{throw new Error(_0x97c0('0x4c'));}})[_0x97c0('0xd')](function(_0x57766f){_0x2121e8[_0x97c0('0x4d')]=_0x57766f;if(_0x57766f){if(!_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x4e')]){_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['messageId']=rs[_0x97c0('0x4f')]()+'\x20'+_0x163ebb[_0x97c0('0x27')]['message'][_0x97c0('0x37')];}var _0x3c9f09={'ContactId':_0x57766f['id'],'MailAccountId':_0x163ebb[_0x97c0('0x38')]['id'],'inReplyTo':_0x163ebb['body'][_0x97c0('0x16')]['messageId'],'to':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x37')],'cc':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['cc'],'subject':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x50')],'attach':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x51')],'lastMsgAt':moment()['format'](_0x97c0('0x52')),'lastMsgDirection':'in'};return db[_0x97c0('0x53')][_0x97c0('0x21')]({'where':{'closed':![],'MailAccountId':_0x163ebb[_0x97c0('0x38')]['id']},'include':[{'model':db['MailMessage'],'as':_0x97c0('0x54'),'attributes':[_0x97c0('0x4e')],'where':{'messageId':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['inReplyTo']}}]})[_0x97c0('0xd')](function(_0x3c4c27){if(_0x3c4c27){return[_0x3c4c27,![]];}return db[_0x97c0('0x53')]['create'](_0x3c9f09)[_0x97c0('0xd')](function(_0x1f8ea9){return[_0x1f8ea9,!![]];});});}else{throw new Error(_0x97c0('0x55'));}})[_0x97c0('0x56')](function(_0x373c34,_0x1838c9){if(_0x373c34){_0x142421=_0x1838c9;if(!_0x1838c9){return _0x373c34[_0x97c0('0x57')]({'inReplyTo':_0x163ebb['body']['message'][_0x97c0('0x4e')],'to':_0x163ebb[_0x97c0('0x27')]['message'][_0x97c0('0x37')],'cc':_0x163ebb['body']['message']['cc'],'subject':_0x163ebb[_0x97c0('0x27')]['message'][_0x97c0('0x50')],'attach':_0x373c34[_0x97c0('0x51')]?_0x373c34['attach']:_0x163ebb['body']['message'][_0x97c0('0x51')],'substatus':null,'substatusAt':moment()['format'](_0x97c0('0x52')),'lastMsgAt':moment()[_0x97c0('0x58')](_0x97c0('0x52')),'lastMsgDirection':'in'});}else{return _0x373c34;}}})[_0x97c0('0xd')](function(_0x400a8d){_0x2121e8[_0x97c0('0x59')]=_0x400a8d[_0x97c0('0x5a')]({'plain':!![]});_0x2121e8[_0x97c0('0x59')][_0x97c0('0x5b')]=_0x142421;return db[_0x97c0('0x5c')][_0x97c0('0x4b')]({'body':_0x163ebb['body'][_0x97c0('0x27')],'MailAccountId':_0x163ebb[_0x97c0('0x38')]['id'],'MailInteractionId':_0x400a8d['id'],'direction':'in','ContactId':_0x2121e8[_0x97c0('0x4d')]['id'],'messageId':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['messageId'],'from':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['from'],'to':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')]['to'],'cc':_0x163ebb[_0x97c0('0x27')]['message']['cc'],'subject':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x50')],'attach':_0x163ebb[_0x97c0('0x27')]['message']['attach'],'Attachments':_0x163ebb['body'][_0x97c0('0x16')][_0x97c0('0x5d')],'originTo':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x5e')],'originCc':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x5f')],'bcc':_0x163ebb['body']['message'][_0x97c0('0x60')],'ChatWebsiteId':_0x163ebb['body']['message']['ChatWebsiteId']||null,'originChannel':_0x163ebb[_0x97c0('0x27')][_0x97c0('0x16')][_0x97c0('0x61')]||_0x97c0('0x62'),'ChatOfflineMessageId':_0x163ebb[_0x97c0('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x97c0('0x63')],'as':_0x97c0('0x64')}]});})[_0x97c0('0xd')](function(_0x3a8ac0){_0x2121e8['message']=_0x3a8ac0;if(!_0x2121e8[_0x97c0('0x59')]['UserId']){return;}return db[_0x97c0('0x65')][_0x97c0('0x21')]({'attributes':['id',_0x97c0('0x66')],'where':{'id':_0x2121e8[_0x97c0('0x59')][_0x97c0('0x67')]}});})[_0x97c0('0xd')](function(_0x2c00c4){if(_0x2c00c4){_0x2121e8[_0x97c0('0x45')][_0x97c0('0x68')]({'id':0x0,'priority':0x0,'app':_0x97c0('0x69'),'appdata':_0x2c00c4['name']+','+(_0x2121e8[_0x97c0('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x2121e8[_0x97c0('0x59')][_0x97c0('0x6a')]){return;}return db['MailQueue'][_0x97c0('0x21')]({'attributes':['id','name'],'where':{'id':_0x2121e8[_0x97c0('0x59')][_0x97c0('0x6a')]}});})['then'](function(_0x2d5b54){if(_0x2d5b54){_0x2121e8['applications']['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2d5b54[_0x97c0('0x66')]+','+(_0x2121e8[_0x97c0('0x38')]['waitForTheAssignedQueue']||0x12c),'interval':_0x97c0('0x49')});}return respondWithRpcPromise(_0x97c0('0x6b'),_0x97c0('0x6c'),_0x2121e8);})[_0x97c0('0xd')](function(_0x41b864){_0xb13649(_0x41b864);})[_0x97c0('0x17')](function(_0x10f3cb){_0x33b034(_0xd728dd[_0x97c0('0x14')](0x1f4,_0x10f3cb['message']));});});};
\ No newline at end of file
+var _0xeff8=['isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','account','omit','List','applications','list','orderBy','priority','asc','autoclose','length','close','*,*,*,*','create','then','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','spread','update','format','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','Attachments','interaction','UserId','User','name','unshift','waitForTheAssignedAgent','MailQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','request','info','request\x20sent','debug','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','ShowMailAccount','find','raw','smtp','smtpOptions','getSmtpOptions','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId'];(function(_0x136a0b,_0x1fe795){var _0x40782c=function(_0x4b2012){while(--_0x4b2012){_0x136a0b['push'](_0x136a0b['shift']());}};_0x40782c(++_0x1fe795);}(_0xeff8,0x186));var _0x8eff=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xeff8[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x8eff('0x0'));var moment=require(_0x8eff('0x1'));var BPromise=require('bluebird');var rs=require(_0x8eff('0x2'));var Redis=require(_0x8eff('0x3'));var db=require(_0x8eff('0x4'))['db'];var logger=require('../../config/logger')(_0x8eff('0x5'));var config=require(_0x8eff('0x6'));var jayson=require(_0x8eff('0x7'));var client=jayson[_0x8eff('0x8')]['http']({'port':0x232c});config[_0x8eff('0x9')]=_[_0x8eff('0xa')](config[_0x8eff('0x9')],{'host':_0x8eff('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8eff('0x9')]));require(_0x8eff('0xc'))[_0x8eff('0xd')](socket);function respondWithRpcPromise(_0x19c94c,_0x5bd403,_0x56f120){return new BPromise(function(_0x359d62,_0x430b45){return client[_0x8eff('0xe')](_0x19c94c,_0x56f120)['then'](function(_0x2a87d2){logger[_0x8eff('0xf')]('MailAccount,\x20%s,\x20%s',_0x5bd403,_0x8eff('0x10'));logger[_0x8eff('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5bd403,'request\x20sent',JSON[_0x8eff('0x12')](_0x2a87d2));if(_0x2a87d2[_0x8eff('0x13')]){if(_0x2a87d2[_0x8eff('0x13')][_0x8eff('0x14')]===0x1f4){logger[_0x8eff('0x13')]('MailAccount,\x20%s,\x20%s',_0x5bd403,_0x2a87d2[_0x8eff('0x13')][_0x8eff('0x15')]);return _0x430b45(_0x2a87d2[_0x8eff('0x13')][_0x8eff('0x15')]);}logger[_0x8eff('0x13')](_0x8eff('0x16'),_0x5bd403,_0x2a87d2[_0x8eff('0x13')][_0x8eff('0x15')]);return _0x359d62(_0x2a87d2[_0x8eff('0x13')][_0x8eff('0x15')]);}else{logger[_0x8eff('0xf')]('MailAccount,\x20%s,\x20%s',_0x5bd403,_0x8eff('0x10'));_0x359d62(_0x2a87d2[_0x8eff('0x17')][_0x8eff('0x15')]);}})[_0x8eff('0x18')](function(_0x2cd7c5){logger[_0x8eff('0x13')](_0x8eff('0x16'),_0x5bd403,_0x2cd7c5);_0x430b45(_0x2cd7c5);});});}exports[_0x8eff('0x19')]=function(_0x1b003c){var _0x198ee9=this;return new Promise(function(_0x453c7a,_0x1b65f9){return db[_0x8eff('0x1a')][_0x8eff('0x1b')]({'raw':_0x1b003c[_0x8eff('0x1c')]?_0x1b003c[_0x8eff('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1b003c[_0x8eff('0x1c')]?_0x1b003c[_0x8eff('0x1c')]['where']||null:null,'attributes':_0x1b003c[_0x8eff('0x1c')]?_0x1b003c['options'][_0x8eff('0x1d')]||null:null,'limit':_0x1b003c[_0x8eff('0x1c')]?_0x1b003c[_0x8eff('0x1c')][_0x8eff('0x1e')]||null:null,'include':_0x1b003c[_0x8eff('0x1c')]?_0x1b003c['options'][_0x8eff('0x1f')]?_[_0x8eff('0x20')](_0x1b003c['options'][_0x8eff('0x1f')],function(_0x5ec3d7){return{'model':db[_0x5ec3d7[_0x8eff('0x21')]],'as':_0x5ec3d7['as'],'attributes':_0x5ec3d7[_0x8eff('0x1d')],'include':_0x5ec3d7[_0x8eff('0x1f')]?_[_0x8eff('0x20')](_0x5ec3d7[_0x8eff('0x1f')],function(_0x2e8067){return{'model':db[_0x2e8067['model']],'as':_0x2e8067['as'],'attributes':_0x2e8067[_0x8eff('0x1d')],'include':_0x2e8067[_0x8eff('0x1f')]?_[_0x8eff('0x20')](_0x2e8067[_0x8eff('0x1f')],function(_0x45803c){return{'model':db[_0x45803c[_0x8eff('0x21')]],'as':_0x45803c['as'],'attributes':_0x45803c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44dcdb){logger[_0x8eff('0xf')](_0x8eff('0x19'),_0x1b003c);logger['debug'](_0x8eff('0x19'),_0x1b003c,JSON[_0x8eff('0x12')](_0x44dcdb));_0x453c7a(_0x44dcdb);})[_0x8eff('0x18')](function(_0x1da0fa){logger[_0x8eff('0x13')](_0x8eff('0x19'),_0x1da0fa[_0x8eff('0x15')],_0x1b003c);_0x1b65f9(_0x198ee9[_0x8eff('0x13')](0x1f4,_0x1da0fa[_0x8eff('0x15')]));});});};exports[_0x8eff('0x22')]=function(_0xf3ee6){var _0x324597=this;return new Promise(function(_0x5e0ecb,_0x2ad4b7){return db[_0x8eff('0x1a')][_0x8eff('0x23')]({'raw':_0xf3ee6[_0x8eff('0x1c')]?_0xf3ee6['options'][_0x8eff('0x24')]===undefined?!![]:![]:!![],'where':_0xf3ee6[_0x8eff('0x1c')]?_0xf3ee6['options']['where']||null:null,'attributes':_0xf3ee6[_0x8eff('0x1c')]?_0xf3ee6[_0x8eff('0x1c')]['attributes']||null:null,'include':_0xf3ee6['options']?_0xf3ee6['options'][_0x8eff('0x1f')]?_['map'](_0xf3ee6[_0x8eff('0x1c')]['include'],function(_0x2bb00f){return{'model':db[_0x2bb00f[_0x8eff('0x21')]],'as':_0x2bb00f['as'],'attributes':_0x2bb00f[_0x8eff('0x1d')],'include':_0x2bb00f[_0x8eff('0x1f')]?_[_0x8eff('0x20')](_0x2bb00f[_0x8eff('0x1f')],function(_0x5ed3f3){return{'model':db[_0x5ed3f3[_0x8eff('0x21')]],'as':_0x5ed3f3['as'],'attributes':_0x5ed3f3['attributes'],'include':_0x5ed3f3[_0x8eff('0x1f')]?_['map'](_0x5ed3f3[_0x8eff('0x1f')],function(_0x4460cf){return{'model':db[_0x4460cf[_0x8eff('0x21')]],'as':_0x4460cf['as'],'attributes':_0x4460cf[_0x8eff('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eb4bb){if(_0xf3ee6[_0x8eff('0x1c')][_0x8eff('0x25')]===!![])_0x2eb4bb['setDataValue'](_0x8eff('0x26'),_0x2eb4bb[_0x8eff('0x27')]());logger[_0x8eff('0xf')](_0x8eff('0x22'),_0xf3ee6);logger[_0x8eff('0x11')](_0x8eff('0x22'),_0xf3ee6,JSON[_0x8eff('0x12')](_0x2eb4bb));_0x5e0ecb(_0x2eb4bb);})[_0x8eff('0x18')](function(_0x661c36){logger['error']('ShowMailAccount',_0x661c36[_0x8eff('0x15')],_0xf3ee6);_0x2ad4b7(_0x324597[_0x8eff('0x13')](0x1f4,_0x661c36[_0x8eff('0x15')]));});});};exports[_0x8eff('0x28')]=function(_0x429c31){var _0x1ba78a=this;return new Promise(function(_0x18b132,_0x5acc86){var _0x14cf6e={'body':_0x429c31[_0x8eff('0x29')],'channel':'mail'};var _0x411a1c=_[_0x8eff('0x2a')](_[_0x8eff('0x2b')](db[_0x8eff('0x2c')][_0x8eff('0x2d')]),[_0x8eff('0x2e'),_0x8eff('0x2f'),_0x8eff('0x30'),_0x8eff('0x31')]);var _0x480c4c=![];if(_0x429c31[_0x8eff('0x29')]['id']){delete _0x429c31[_0x8eff('0x29')]['id'];}if(_[_0x8eff('0x32')](_0x429c31[_0x8eff('0x29')][_0x8eff('0x33')])){return _0x5acc86(_0x1ba78a['error'](0x1f4,_0x8eff('0x34')));}if(_['isNil'](_0x429c31[_0x8eff('0x29')][_0x8eff('0x29')])||_0x429c31[_0x8eff('0x29')][_0x8eff('0x29')]===''){return _0x5acc86(_0x1ba78a['error'](0x1f4,_0x8eff('0x35')));}if(_[_0x8eff('0x32')](_0x429c31[_0x8eff('0x29')]['mapKey'])){return _0x5acc86(_0x1ba78a['error'](0x1f4,_0x8eff('0x36')+_0x411a1c));}if(!_[_0x8eff('0x37')](_0x411a1c,_0x429c31[_0x8eff('0x29')][_0x8eff('0x38')])){return _0x5acc86(_0x1ba78a[_0x8eff('0x13')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x411a1c));}var _0x28cb8e={};_0x28cb8e[_0x429c31['body'][_0x8eff('0x38')]]=_0x429c31[_0x8eff('0x29')]['from'];return db['MailAccount']['find']({'where':{'id':_0x429c31['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8eff('0x2c')],'as':_0x8eff('0x39'),'where':_0x28cb8e,'limit':0x1,'order':[[_0x8eff('0x2f'),_0x8eff('0x3a')]]}]},{'model':db[_0x8eff('0x3b')],'as':_0x8eff('0x3c')},{'model':db[_0x8eff('0x3d')],'as':_0x8eff('0x3e'),'include':[{'model':db[_0x8eff('0x3f')],'as':_0x8eff('0x3f')}]}]})['then'](function(_0x11e53c){if(_0x11e53c&&_0x11e53c['List']){var _0x295464=_0x11e53c[_0x8eff('0x40')]({'plain':!![]});_0x14cf6e[_0x8eff('0x41')]=_[_0x8eff('0x42')](_0x295464,[_0x8eff('0x3c'),_0x8eff('0x43')]);_0x14cf6e[_0x8eff('0x41')][_0x8eff('0x26')]=_0x11e53c[_0x8eff('0x27')]();_0x14cf6e[_0x8eff('0x44')]=_0x295464[_0x8eff('0x3c')];_0x14cf6e[_0x8eff('0x45')]=_0x295464['List'];_0x14cf6e[_0x8eff('0x44')]=_[_0x8eff('0x46')](_0x14cf6e[_0x8eff('0x44')],[_0x8eff('0x47')],[_0x8eff('0x48')]);if(_0x14cf6e[_0x8eff('0x41')]&&_0x14cf6e[_0x8eff('0x41')][_0x8eff('0x49')]){_0x14cf6e[_0x8eff('0x44')]['push']({'id':0x0,'priority':_0x14cf6e['applications'][_0x8eff('0x4a')]+0x1,'app':_0x8eff('0x4b'),'appdata':_0x8eff('0x49'),'interval':_0x8eff('0x4c')});}if(_0x14cf6e[_0x8eff('0x41')][_0x8eff('0x3c')]){delete _0x14cf6e['account'][_0x8eff('0x3c')];}if(_0x14cf6e[_0x8eff('0x41')][_0x8eff('0x43')]){delete _0x14cf6e['account'][_0x8eff('0x43')];}if(_0x295464[_0x8eff('0x43')][_0x8eff('0x39')][_0x8eff('0x4a')]){return _0x295464['List'][_0x8eff('0x39')][0x0];}var _0x161f89=_[_0x8eff('0xa')](_0x429c31[_0x8eff('0x29')],{'firstName':_0x429c31[_0x8eff('0x29')][_0x8eff('0x33')],'ListId':_0x295464[_0x8eff('0x31')]});_0x161f89[_0x429c31['body'][_0x8eff('0x38')]]=_0x429c31[_0x8eff('0x29')][_0x8eff('0x33')];return db[_0x8eff('0x2c')][_0x8eff('0x4d')](_0x161f89);}else{throw new Error('List\x20not\x20found');}})[_0x8eff('0x4e')](function(_0x16b968){_0x14cf6e[_0x8eff('0x4f')]=_0x16b968;if(_0x16b968){if(!_0x429c31['body'][_0x8eff('0x15')]['messageId']){_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x50')]=rs[_0x8eff('0x51')]()+'\x20'+_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x33')];}var _0x552006={'ContactId':_0x16b968['id'],'MailAccountId':_0x429c31['account']['id'],'inReplyTo':_0x429c31[_0x8eff('0x29')]['message'][_0x8eff('0x50')],'to':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x33')],'cc':_0x429c31[_0x8eff('0x29')]['message']['cc'],'subject':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x52')],'attach':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x53')],'lastMsgAt':moment()['format'](_0x8eff('0x54')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x8eff('0x23')]({'where':{'closed':![],'MailAccountId':_0x429c31[_0x8eff('0x41')]['id']},'include':[{'model':db['MailMessage'],'as':_0x8eff('0x55'),'attributes':[_0x8eff('0x50')],'where':{'messageId':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x56')]}}]})[_0x8eff('0x4e')](function(_0xabdd84){if(_0xabdd84){return[_0xabdd84,![]];}return db[_0x8eff('0x57')]['create'](_0x552006)[_0x8eff('0x4e')](function(_0x545dd8){return[_0x545dd8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8eff('0x58')](function(_0x47626e,_0x487cf2){if(_0x47626e){_0x480c4c=_0x487cf2;if(!_0x487cf2){return _0x47626e[_0x8eff('0x59')]({'inReplyTo':_0x429c31[_0x8eff('0x29')]['message'][_0x8eff('0x50')],'to':_0x429c31[_0x8eff('0x29')]['message'][_0x8eff('0x33')],'cc':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')]['cc'],'subject':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x52')],'attach':_0x47626e[_0x8eff('0x53')]?_0x47626e['attach']:_0x429c31['body'][_0x8eff('0x15')][_0x8eff('0x53')],'substatus':null,'substatusAt':moment()[_0x8eff('0x5a')](_0x8eff('0x54')),'lastMsgAt':moment()[_0x8eff('0x5a')](_0x8eff('0x54')),'lastMsgDirection':'in'});}else{return _0x47626e;}}})[_0x8eff('0x4e')](function(_0x4f1c54){_0x14cf6e['interaction']=_0x4f1c54[_0x8eff('0x40')]({'plain':!![]});_0x14cf6e['interaction']['created']=_0x480c4c;return db['MailMessage'][_0x8eff('0x4d')]({'body':_0x429c31[_0x8eff('0x29')][_0x8eff('0x29')],'MailAccountId':_0x429c31[_0x8eff('0x41')]['id'],'MailInteractionId':_0x4f1c54['id'],'direction':'in','ContactId':_0x14cf6e[_0x8eff('0x4f')]['id'],'messageId':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x50')],'from':_0x429c31['body'][_0x8eff('0x15')]['from'],'to':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')]['to'],'cc':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')]['cc'],'subject':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')]['subject'],'attach':_0x429c31[_0x8eff('0x29')]['message'][_0x8eff('0x53')],'Attachments':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x5b')],'originTo':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x5c')],'originCc':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')]['originCc'],'bcc':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x5d')],'ChatWebsiteId':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x5e')]||null,'originChannel':_0x429c31[_0x8eff('0x29')][_0x8eff('0x15')][_0x8eff('0x5f')]||_0x8eff('0x60'),'ChatOfflineMessageId':_0x429c31['body']['message']['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0x8eff('0x61')}]});})[_0x8eff('0x4e')](function(_0x2a15ba){_0x14cf6e[_0x8eff('0x15')]=_0x2a15ba;if(!_0x14cf6e[_0x8eff('0x62')][_0x8eff('0x63')]){return;}return db[_0x8eff('0x64')]['find']({'attributes':['id',_0x8eff('0x65')],'where':{'id':_0x14cf6e[_0x8eff('0x62')][_0x8eff('0x63')]}});})[_0x8eff('0x4e')](function(_0x5b1f67){if(_0x5b1f67){_0x14cf6e[_0x8eff('0x44')][_0x8eff('0x66')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b1f67[_0x8eff('0x65')]+','+(_0x14cf6e[_0x8eff('0x41')][_0x8eff('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x14cf6e['interaction']['queueId']){return;}return db[_0x8eff('0x68')][_0x8eff('0x23')]({'attributes':['id',_0x8eff('0x65')],'where':{'id':_0x14cf6e[_0x8eff('0x62')][_0x8eff('0x69')]}});})[_0x8eff('0x4e')](function(_0x283f26){if(_0x283f26){_0x14cf6e[_0x8eff('0x44')][_0x8eff('0x66')]({'id':0x0,'priority':0x1,'app':_0x8eff('0x6a'),'appdata':_0x283f26[_0x8eff('0x65')]+','+(_0x14cf6e['account'][_0x8eff('0x6b')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8eff('0x6c'),_0x8eff('0x6d'),_0x14cf6e);})['then'](function(_0x9c448b){_0x18b132(_0x9c448b);})['catch'](function(_0x35cb3b){_0x5acc86(_0x1ba78a[_0x8eff('0x13')](0x1f4,_0x35cb3b[_0x8eff('0x15')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x709b=['update','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x2db522,_0x52e4e2){var _0x5c9a1c=function(_0x502e82){while(--_0x502e82){_0x2db522['push'](_0x2db522['shift']());}};_0x5c9a1c(++_0x52e4e2);}(_0x709b,0x97));var _0xb709=function(_0x2b96d6,_0x4e620d){_0x2b96d6=_0x2b96d6-0x0;var _0x3848e5=_0x709b[_0x2b96d6];return _0x3848e5;};'use strict';var MailAccountEvents=require(_0xb709('0x0'));var events=[_0xb709('0x1'),_0xb709('0x2'),_0xb709('0x3')];function createListener(_0x15c796,_0x2c2572){return function(_0x32da58){_0x2c2572['emit'](_0x15c796,_0x32da58);};}function removeListener(_0x10e687,_0x5a90d4){return function(){MailAccountEvents['removeListener'](_0x10e687,_0x5a90d4);};}exports[_0xb709('0x4')]=function(_0x30ac18){for(var _0x54aaaf=0x0,_0x35ca0b=events[_0xb709('0x5')];_0x54aaaf<_0x35ca0b;_0x54aaaf++){var _0x3ab9c2=events[_0x54aaaf];var _0x269330=createListener(_0xb709('0x6')+_0x3ab9c2,_0x30ac18);MailAccountEvents['on'](_0x3ab9c2,_0x269330);}};
\ No newline at end of file
+var _0x6964=['./mailAccount.events','remove','update','removeListener','length','mailAccount:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6964,0x114));var _0x4696=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x6964[_0x2f6f50];return _0x2cf365;};'use strict';var MailAccountEvents=require(_0x4696('0x0'));var events=['save',_0x4696('0x1'),_0x4696('0x2')];function createListener(_0x57bfaf,_0x2984c5){return function(_0x14e658){_0x2984c5['emit'](_0x57bfaf,_0x14e658);};}function removeListener(_0x311403,_0x1c3ff9){return function(){MailAccountEvents[_0x4696('0x3')](_0x311403,_0x1c3ff9);};}exports['register']=function(_0xb88dd){for(var _0x583b46=0x0,_0x5f39e4=events[_0x4696('0x4')];_0x583b46<_0x5f39e4;_0x583b46++){var _0x112b63=events[_0x583b46];var _0x3a1b0c=createListener(_0x4696('0x5')+_0x112b63,_0xb88dd);MailAccountEvents['on'](_0x112b63,_0x3a1b0c);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d72=['path','express','Router','fs-extra','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x0d72,0x1b2));var _0x20d7=function(_0x314768,_0x454d9b){_0x314768=_0x314768-0x0;var _0x440e99=_0x0d72[_0x314768];return _0x440e99;};'use strict';var multer=require('multer');var util=require(_0x20d7('0x0'));var path=require(_0x20d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x20d7('0x2'));var router=express[_0x20d7('0x3')]();var fs_extra=require(_0x20d7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20d7('0x5'));var controller=require(_0x20d7('0x6'));router['get'](_0x20d7('0x7'),auth[_0x20d7('0x8')](),controller[_0x20d7('0x9')]);router[_0x20d7('0xa')](_0x20d7('0x7'),auth[_0x20d7('0x8')](),controller[_0x20d7('0xb')]);router[_0x20d7('0xc')]('/:id',auth[_0x20d7('0x8')](),controller[_0x20d7('0xd')]);module[_0x20d7('0xe')]=router;
\ No newline at end of file
+var _0xe840=['express','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1f0c9b,_0x234e61){var _0x1283e6=function(_0x5e157c){while(--_0x5e157c){_0x1f0c9b['push'](_0x1f0c9b['shift']());}};_0x1283e6(++_0x234e61);}(_0xe840,0x17d));var _0x0e84=function(_0xf3e18e,_0xbdf287){_0xf3e18e=_0xf3e18e-0x0;var _0xc72503=_0xe840[_0xf3e18e];return _0xc72503;};'use strict';var multer=require(_0x0e84('0x0'));var util=require(_0x0e84('0x1'));var path=require(_0x0e84('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e84('0x3'));var router=express['Router']();var fs_extra=require(_0x0e84('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e84('0x5'));var config=require(_0x0e84('0x6'));var controller=require('./mailApplication.controller');router[_0x0e84('0x7')](_0x0e84('0x8'),auth[_0x0e84('0x9')](),controller[_0x0e84('0xa')]);router[_0x0e84('0xb')](_0x0e84('0x8'),auth['isAuthenticated'](),controller[_0x0e84('0xc')]);router[_0x0e84('0xd')](_0x0e84('0x8'),auth[_0x0e84('0x9')](),controller[_0x0e84('0xe')]);module[_0x0e84('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8770=['*,*,*,*','sequelize','exports','STRING'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x8770,0x1b1));var _0x0877=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8770[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x0877('0x0'));module[_0x0877('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0877('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0877('0x2')]},'interval':{'type':Sequelize[_0x0877('0x2')],'defaultValue':_0x0877('0x3')}};
\ No newline at end of file
+var _0x119c=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x100ac7,_0x2283be){var _0x4dd57a=function(_0x24d6e7){while(--_0x24d6e7){_0x100ac7['push'](_0x100ac7['shift']());}};_0x4dd57a(++_0x2283be);}(_0x119c,0x1a6));var _0xc119=function(_0x2986fb,_0x9482a0){_0x2986fb=_0x2986fb-0x0;var _0xb3c156=_0x119c[_0x2986fb];return _0xb3c156;};'use strict';var Sequelize=require(_0xc119('0x0'));module[_0xc119('0x1')]={'priority':{'type':Sequelize[_0xc119('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc119('0x3')],'allowNull':![],'defaultValue':_0xc119('0x4')},'appdata':{'type':Sequelize[_0xc119('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc119('0x6')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x52348e,_0x2c69b0){var _0x8c7069=function(_0x27539d){while(--_0x27539d){_0x52348e['push'](_0x52348e['shift']());}};_0x8c7069(++_0x2c69b0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49d540,_0x494e7c){_0x49d540=_0x49d540-0x0;var _0x234b28=_0xb43b[_0x49d540];return _0x234b28;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));};
\ No newline at end of file
+var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x6cab0d,_0x41f92d){var _0x36f8f5=function(_0x3f5551){while(--_0x3f5551){_0x6cab0d['push'](_0x6cab0d['shift']());}};_0x36f8f5(++_0x41f92d);}(_0xac4a,0x13f));var _0xaac4=function(_0x486f1a,_0x1ff2a5){_0x486f1a=_0x486f1a-0x0;var _0x4005a5=_0xac4a[_0x486f1a];return _0x4005a5;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc74b=['bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xc74b,0x18b));var _0xbc74=function(_0x2386a2,_0x36193d){_0x2386a2=_0x2386a2-0x0;var _0x17c157=_0xc74b[_0x2386a2];return _0x17c157;};'use strict';var _=require(_0xbc74('0x0'));var util=require(_0xbc74('0x1'));var logger=require(_0xbc74('0x2'))(_0xbc74('0x3'));var moment=require(_0xbc74('0x4'));var BPromise=require(_0xbc74('0x5'));var rp=require(_0xbc74('0x6'));var fs=require('fs');var path=require(_0xbc74('0x7'));var rimraf=require(_0xbc74('0x8'));var config=require(_0xbc74('0x9'));var attributes=require(_0xbc74('0xa'));module[_0xbc74('0xb')]=function(_0x30f051,_0x223988){return _0x30f051[_0xbc74('0xc')](_0xbc74('0xd'),attributes,{'tableName':_0xbc74('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc74('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1141=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x4cdcdc,_0x34eac7){var _0x4704ce=function(_0x1de4ed){while(--_0x1de4ed){_0x4cdcdc['push'](_0x4cdcdc['shift']());}};_0x4704ce(++_0x34eac7);}(_0x1141,0x102));var _0x1114=function(_0xf2d1bf,_0x19c53a){_0xf2d1bf=_0xf2d1bf-0x0;var _0x388d2c=_0x1141[_0xf2d1bf];return _0x388d2c;};'use strict';var _=require(_0x1114('0x0'));var util=require(_0x1114('0x1'));var logger=require(_0x1114('0x2'))(_0x1114('0x3'));var moment=require(_0x1114('0x4'));var BPromise=require(_0x1114('0x5'));var rp=require(_0x1114('0x6'));var fs=require('fs');var path=require(_0x1114('0x7'));var rimraf=require(_0x1114('0x8'));var config=require(_0x1114('0x9'));var attributes=require(_0x1114('0xa'));module[_0x1114('0xb')]=function(_0x5e3b96,_0x5a5b7e){return _0x5e3b96[_0x1114('0xc')](_0x1114('0xd'),attributes,{'tableName':_0x1114('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1114('0xf'),'collate':_0x1114('0x10')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5681=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','result','MailApplication','update','body','options','raw','where','attributes','UpdateMailApplication','stringify','lodash','moment','bluebird'];(function(_0x5feebd,_0x5aded6){var _0x3ed1e7=function(_0x501676){while(--_0x501676){_0x5feebd['push'](_0x5feebd['shift']());}};_0x3ed1e7(++_0x5aded6);}(_0x5681,0x190));var _0x1568=function(_0x1bcea3,_0x133219){_0x1bcea3=_0x1bcea3-0x0;var _0x12940c=_0x5681[_0x1bcea3];return _0x12940c;};'use strict';var _=require(_0x1568('0x0'));var util=require('util');var moment=require(_0x1568('0x1'));var BPromise=require(_0x1568('0x2'));var rs=require(_0x1568('0x3'));var fs=require('fs');var Redis=require(_0x1568('0x4'));var db=require(_0x1568('0x5'))['db'];var utils=require(_0x1568('0x6'));var logger=require(_0x1568('0x7'))(_0x1568('0x8'));var config=require(_0x1568('0x9'));var jayson=require(_0x1568('0xa'));var client=jayson[_0x1568('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b8fb1,_0x3a22d2,_0x2206ec){return new BPromise(function(_0x4ab05b,_0x366fdd){return client[_0x1568('0xc')](_0x4b8fb1,_0x2206ec)[_0x1568('0xd')](function(_0x58807c){logger[_0x1568('0xe')]('MailApplication,\x20%s,\x20%s',_0x3a22d2,_0x1568('0xf'));logger[_0x1568('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3a22d2,_0x1568('0xf'),JSON['stringify'](_0x58807c));if(_0x58807c[_0x1568('0x11')]){if(_0x58807c[_0x1568('0x11')][_0x1568('0x12')]===0x1f4){logger[_0x1568('0x11')](_0x1568('0x13'),_0x3a22d2,_0x58807c['error'][_0x1568('0x14')]);return _0x366fdd(_0x58807c['error'][_0x1568('0x14')]);}logger['error'](_0x1568('0x13'),_0x3a22d2,_0x58807c['error']['message']);return _0x4ab05b(_0x58807c[_0x1568('0x11')][_0x1568('0x14')]);}else{logger[_0x1568('0xe')](_0x1568('0x13'),_0x3a22d2,_0x1568('0xf'));_0x4ab05b(_0x58807c[_0x1568('0x15')][_0x1568('0x14')]);}})['catch'](function(_0xc3ce91){logger[_0x1568('0x11')](_0x1568('0x13'),_0x3a22d2,_0xc3ce91);_0x366fdd(_0xc3ce91);});});}exports['UpdateMailApplication']=function(_0xee3fcd){var _0x489c52=this;return new Promise(function(_0x36ad13,_0x364f10){return db[_0x1568('0x16')][_0x1568('0x17')](_0xee3fcd[_0x1568('0x18')],{'raw':_0xee3fcd['options']?_0xee3fcd[_0x1568('0x19')][_0x1568('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xee3fcd[_0x1568('0x19')]?_0xee3fcd[_0x1568('0x19')][_0x1568('0x1b')]||null:null,'attributes':_0xee3fcd[_0x1568('0x19')]?_0xee3fcd[_0x1568('0x19')][_0x1568('0x1c')]||null:null,'limit':_0xee3fcd[_0x1568('0x19')]?_0xee3fcd['options']['limit']||null:null})['then'](function(_0x579a5d){logger[_0x1568('0xe')](_0x1568('0x1d'),_0xee3fcd);logger[_0x1568('0x10')](_0x1568('0x1d'),_0xee3fcd,JSON[_0x1568('0x1e')](_0x579a5d));_0x36ad13(_0x579a5d);})['catch'](function(_0x3c970f){logger[_0x1568('0x11')](_0x1568('0x1d'),_0x3c970f[_0x1568('0x14')],_0xee3fcd);_0x364f10(_0x489c52['error'](0x1f4,_0x3c970f[_0x1568('0x14')]));});});};
\ No newline at end of file
+var _0x80c1=['MailApplication,\x20%s,\x20%s','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','stringify','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','error','code','message','result','catch'];(function(_0x1e6d06,_0x425e4e){var _0x4d1cb7=function(_0x39df00){while(--_0x39df00){_0x1e6d06['push'](_0x1e6d06['shift']());}};_0x4d1cb7(++_0x425e4e);}(_0x80c1,0x1ae));var _0x180c=function(_0x3ce961,_0x5e0281){_0x3ce961=_0x3ce961-0x0;var _0x4331cb=_0x80c1[_0x3ce961];return _0x4331cb;};'use strict';var _=require(_0x180c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x180c('0x1'));var rs=require(_0x180c('0x2'));var fs=require('fs');var Redis=require(_0x180c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x180c('0x4'));var logger=require(_0x180c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x180c('0x6')][_0x180c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4632c7,_0xbbabee,_0x153138){return new BPromise(function(_0x30e0e0,_0x8e6087){return client[_0x180c('0x8')](_0x4632c7,_0x153138)[_0x180c('0x9')](function(_0x916446){logger[_0x180c('0xa')]('MailApplication,\x20%s,\x20%s',_0xbbabee,_0x180c('0xb'));logger[_0x180c('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xbbabee,_0x180c('0xb'),JSON['stringify'](_0x916446));if(_0x916446['error']){if(_0x916446[_0x180c('0xd')][_0x180c('0xe')]===0x1f4){logger[_0x180c('0xd')]('MailApplication,\x20%s,\x20%s',_0xbbabee,_0x916446['error'][_0x180c('0xf')]);return _0x8e6087(_0x916446['error'][_0x180c('0xf')]);}logger[_0x180c('0xd')]('MailApplication,\x20%s,\x20%s',_0xbbabee,_0x916446[_0x180c('0xd')][_0x180c('0xf')]);return _0x30e0e0(_0x916446['error'][_0x180c('0xf')]);}else{logger[_0x180c('0xa')]('MailApplication,\x20%s,\x20%s',_0xbbabee,_0x180c('0xb'));_0x30e0e0(_0x916446[_0x180c('0x10')]['message']);}})[_0x180c('0x11')](function(_0x4defc5){logger[_0x180c('0xd')](_0x180c('0x12'),_0xbbabee,_0x4defc5);_0x8e6087(_0x4defc5);});});}exports[_0x180c('0x13')]=function(_0x1f942d){var _0x4055b0=this;return new Promise(function(_0x325b6c,_0x55fed4){return db[_0x180c('0x14')][_0x180c('0x15')](_0x1f942d[_0x180c('0x16')],{'raw':_0x1f942d[_0x180c('0x17')]?_0x1f942d[_0x180c('0x17')][_0x180c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f942d[_0x180c('0x17')]?_0x1f942d[_0x180c('0x17')][_0x180c('0x19')]||null:null,'attributes':_0x1f942d['options']?_0x1f942d[_0x180c('0x17')][_0x180c('0x1a')]||null:null,'limit':_0x1f942d[_0x180c('0x17')]?_0x1f942d[_0x180c('0x17')]['limit']||null:null})[_0x180c('0x9')](function(_0x394dd5){logger[_0x180c('0xa')](_0x180c('0x13'),_0x1f942d);logger[_0x180c('0xc')](_0x180c('0x13'),_0x1f942d,JSON[_0x180c('0x1b')](_0x394dd5));_0x325b6c(_0x394dd5);})[_0x180c('0x11')](function(_0x1ba4ab){logger[_0x180c('0xd')](_0x180c('0x13'),_0x1ba4ab['message'],_0x1f942d);_0x55fed4(_0x4055b0[_0x180c('0xd')](0x1f4,_0x1ba4ab[_0x180c('0xf')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4e8=['getMessages','/:id/download','download','post','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','mailinteraction:update','update','delete','destroy','exports','express','Router','../../components/auth/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x4a10fe,_0x16124d){var _0x372c12=function(_0x28d306){while(--_0x28d306){_0x4a10fe['push'](_0x4a10fe['shift']());}};_0x372c12(++_0x16124d);}(_0xd4e8,0x116));var _0x8d4e=function(_0x1b4b25,_0x314c18){_0x1b4b25=_0x1b4b25-0x0;var _0x47a055=_0xd4e8[_0x1b4b25];return _0x47a055;};'use strict';var express=require(_0x8d4e('0x0'));var router=express[_0x8d4e('0x1')]();var auth=require(_0x8d4e('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x8d4e('0x3'));router['get']('/',auth[_0x8d4e('0x4')](),controller['index']);router[_0x8d4e('0x5')](_0x8d4e('0x6'),auth[_0x8d4e('0x4')](),controller[_0x8d4e('0x7')]);router[_0x8d4e('0x5')](_0x8d4e('0x8'),auth[_0x8d4e('0x4')](),controller[_0x8d4e('0x9')]);router[_0x8d4e('0x5')]('/:id/messages',auth[_0x8d4e('0x4')](),controller[_0x8d4e('0xa')]);router[_0x8d4e('0x5')](_0x8d4e('0xb'),auth[_0x8d4e('0x4')](),controller[_0x8d4e('0xc')]);router['post']('/',auth[_0x8d4e('0x4')](),controller['create']);router[_0x8d4e('0xd')](_0x8d4e('0xe'),auth[_0x8d4e('0x4')](),controller['addMessage']);router['post'](_0x8d4e('0xf'),auth[_0x8d4e('0x4')](),interaction[_0x8d4e('0x10')](_0x8d4e('0x11'),_0x8d4e('0x12')),controller['addTags']);router['put'](_0x8d4e('0x8'),auth[_0x8d4e('0x4')](),interaction[_0x8d4e('0x10')](_0x8d4e('0x11'),_0x8d4e('0x13')),controller[_0x8d4e('0x14')]);router[_0x8d4e('0x15')]('/:id',auth[_0x8d4e('0x4')](),interaction[_0x8d4e('0x10')](_0x8d4e('0x11'),'mailinteraction:destroy'),controller[_0x8d4e('0x16')]);router[_0x8d4e('0x15')](_0x8d4e('0xf'),auth[_0x8d4e('0x4')](),controller['removeTags']);module[_0x8d4e('0x17')]=router;
\ No newline at end of file
+var _0x0cb9=['./mailInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','mailinteraction:destroy','destroy','removeTags','Router','../../components/auth/service'];(function(_0x24f44d,_0x10c742){var _0x25931e=function(_0x522ce0){while(--_0x522ce0){_0x24f44d['push'](_0x24f44d['shift']());}};_0x25931e(++_0x10c742);}(_0x0cb9,0x136));var _0x90cb=function(_0x30fcb7,_0x37356c){_0x30fcb7=_0x30fcb7-0x0;var _0x79c59c=_0x0cb9[_0x30fcb7];return _0x79c59c;};'use strict';var express=require('express');var router=express[_0x90cb('0x0')]();var auth=require(_0x90cb('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x90cb('0x2'));router[_0x90cb('0x3')]('/',auth[_0x90cb('0x4')](),controller['index']);router[_0x90cb('0x3')](_0x90cb('0x5'),auth[_0x90cb('0x4')](),controller['describe']);router[_0x90cb('0x3')](_0x90cb('0x6'),auth['isAuthenticated'](),controller[_0x90cb('0x7')]);router[_0x90cb('0x3')](_0x90cb('0x8'),auth[_0x90cb('0x4')](),controller['getMessages']);router[_0x90cb('0x3')](_0x90cb('0x9'),auth[_0x90cb('0x4')](),controller[_0x90cb('0xa')]);router[_0x90cb('0xb')]('/',auth[_0x90cb('0x4')](),controller['create']);router['post'](_0x90cb('0x8'),auth[_0x90cb('0x4')](),controller[_0x90cb('0xc')]);router[_0x90cb('0xb')](_0x90cb('0xd'),auth['isAuthenticated'](),interaction[_0x90cb('0xe')](_0x90cb('0xf'),_0x90cb('0x10')),controller[_0x90cb('0x11')]);router[_0x90cb('0x12')]('/:id',auth[_0x90cb('0x4')](),interaction[_0x90cb('0xe')]('mail','mailinteraction:update'),controller[_0x90cb('0x13')]);router[_0x90cb('0x14')]('/:id',auth['isAuthenticated'](),interaction[_0x90cb('0xe')](_0x90cb('0xf'),_0x90cb('0x15')),controller[_0x90cb('0x16')]);router[_0x90cb('0x14')](_0x90cb('0xd'),auth['isAuthenticated'](),controller[_0x90cb('0x17')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf47=['out','ENUM','INTEGER','iconv','BOOLEAN','DATE','STRING','TEXT'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0xaf47,0x11b));var _0x7af4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf47[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x7af4('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7af4('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7af4('0x2')]},'disposition':{'type':Sequelize[_0x7af4('0x3')]},'secondDisposition':{'type':Sequelize[_0x7af4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7af4('0x3')](0x1fe)},'to':{'type':Sequelize[_0x7af4('0x3')]},'cc':{'type':Sequelize[_0x7af4('0x4')]('long')},'subject':{'type':Sequelize[_0x7af4('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7af4('0x2')]},'substatus':{'type':Sequelize[_0x7af4('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7af4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7af4('0x6')]('in',_0x7af4('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7af4('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7af4('0x7')]}};
\ No newline at end of file
+var _0xb99f=['DATE','STRING','long','ENUM','out','INTEGER','iconv','exports','BOOLEAN'];(function(_0x2d9dbc,_0x22f60c){var _0x595d43=function(_0x45435c){while(--_0x45435c){_0x2d9dbc['push'](_0x2d9dbc['shift']());}};_0x595d43(++_0x22f60c);}(_0xb99f,0x102));var _0xfb99=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xb99f[_0x3c51d4];return _0x53c45f;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xfb99('0x0'));module[_0xfb99('0x1')]={'closed':{'type':Sequelize[_0xfb99('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfb99('0x3')]},'disposition':{'type':Sequelize[_0xfb99('0x4')]},'secondDisposition':{'type':Sequelize[_0xfb99('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfb99('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0xfb99('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xfb99('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfb99('0x3')]},'substatus':{'type':Sequelize[_0xfb99('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xfb99('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xfb99('0x6')]('in',_0xfb99('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfb99('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xfb99('0x6')]('in',_0xfb99('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfb99('0x8')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f31=['omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','include','true','rows','addTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','files','root','attachments','push','Attachment','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','type','readFileSync','download','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','html-entities','redis','defaults','localhost','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','stack','name','send','map','MailInteraction','fieldName','key','findAll','mail','query','user','catch','params','model','keys','rawAttributes','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','describe','addMessage','MailMessage','ids'];(function(_0xe5d1,_0x294879){var _0x1a94f6=function(_0x5b0114){while(--_0x5b0114){_0xe5d1['push'](_0xe5d1['shift']());}};_0x1a94f6(++_0x294879);}(_0x2f31,0x9f));var _0x12f3=function(_0x2d75e3,_0x633f3d){_0x2d75e3=_0x2d75e3-0x0;var _0x5d4ef3=_0x2f31[_0x2d75e3];return _0x5d4ef3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x12f3('0x0'));var moment=require(_0x12f3('0x1'));var BPromise=require(_0x12f3('0x2'));var util=require(_0x12f3('0x3'));var path=require(_0x12f3('0x4'));var fs=require('fs');var _=require(_0x12f3('0x5'));var juice=require(_0x12f3('0x6'));var Redis=require(_0x12f3('0x7'));var interaction=require(_0x12f3('0x8'));var qs=require(_0x12f3('0x9'));var logger=require(_0x12f3('0xa'))(_0x12f3('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x12f3('0xc'));config[_0x12f3('0xd')]=_[_0x12f3('0xe')](config[_0x12f3('0xd')],{'host':_0x12f3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x12f3('0x10')](socket);function respondWithStatusCode(_0x4cf60c,_0x48f42f){_0x48f42f=_0x48f42f||0xcc;return function(_0x7100bf){if(_0x7100bf){return _0x4cf60c[_0x12f3('0x11')](_0x48f42f);}return _0x4cf60c[_0x12f3('0x12')](_0x48f42f)[_0x12f3('0x13')]();};}function respondWithResult(_0x2ae621,_0x1a1b8e){_0x1a1b8e=_0x1a1b8e||0xc8;return function(_0x5f3015){if(_0x5f3015){return _0x2ae621[_0x12f3('0x12')](_0x1a1b8e)[_0x12f3('0x14')](_0x5f3015);}};}function respondWithFilteredResult(_0x484bcc,_0x24570d){return function(_0x53d757){if(_0x53d757){var _0x54c01a=typeof _0x24570d[_0x12f3('0x15')]==='undefined'&&typeof _0x24570d[_0x12f3('0x16')]==='undefined';var _0x2e06d6=_0x53d757[_0x12f3('0x17')];var _0x148e4d=_0x54c01a?0x0:_0x24570d['offset'];var _0x187c22=_0x54c01a?_0x53d757['count']:_0x24570d[_0x12f3('0x15')]+_0x24570d[_0x12f3('0x16')];var _0x409079;if(_0x187c22>=_0x2e06d6){_0x187c22=_0x2e06d6;_0x409079=0xc8;}else{_0x409079=0xce;}_0x484bcc['status'](_0x409079);return _0x484bcc[_0x12f3('0x18')](_0x12f3('0x19'),_0x148e4d+'-'+_0x187c22+'/'+_0x2e06d6)[_0x12f3('0x14')](_0x53d757);}return null;};}function saveUpdates(_0x3b3cfd){return function(_0x18e1d8){if(_0x18e1d8){return _0x18e1d8[_0x12f3('0x1a')](_0x3b3cfd)[_0x12f3('0x1b')](function(_0x52cf83){return _0x52cf83;});}return null;};}function removeEntity(_0x428838){return function(_0x12e5a4){if(_0x12e5a4){return _0x12e5a4[_0x12f3('0x1c')]()[_0x12f3('0x1b')](function(){_0x428838[_0x12f3('0x12')](0xcc)[_0x12f3('0x13')]();});}};}function handleEntityNotFound(_0x54139e){return function(_0x5a3c2b){if(!_0x5a3c2b){_0x54139e[_0x12f3('0x11')](0x194);}return _0x5a3c2b;};}function handleError(_0x29a631,_0x319bd3){_0x319bd3=_0x319bd3||0x1f4;return function(_0x5a1820){logger['error'](_0x5a1820[_0x12f3('0x1d')]);if(_0x5a1820[_0x12f3('0x1e')]){delete _0x5a1820[_0x12f3('0x1e')];}_0x29a631[_0x12f3('0x12')](_0x319bd3)[_0x12f3('0x1f')](_0x5a1820);};}exports['index']=function(_0xca9829,_0x31e4b9){var _0x119739={};var _0x30b232=_[_0x12f3('0x20')](db[_0x12f3('0x21')]['rawAttributes'],function(_0x3aebc5){return{'name':_0x3aebc5[_0x12f3('0x22')],'type':_0x3aebc5['type'][_0x12f3('0x23')]};});_0x119739=qs['getOptions'](_0x30b232,_0xca9829);return interaction[_0x12f3('0x24')](_0x12f3('0x25'),_0xca9829[_0x12f3('0x26')],_0xca9829[_0x12f3('0x27')],_0x119739,_0x30b232)[_0x12f3('0x1b')](respondWithFilteredResult(_0x31e4b9,_0x119739))[_0x12f3('0x28')](handleError(_0x31e4b9,null));};exports['show']=function(_0x289189,_0x2fa8f5){var _0x3e0626={'raw':![],'where':{'id':_0x289189[_0x12f3('0x29')]['id']}},_0x3ab5c3={};_0x3ab5c3[_0x12f3('0x2a')]=_[_0x12f3('0x2b')](db[_0x12f3('0x21')][_0x12f3('0x2c')]);_0x3ab5c3[_0x12f3('0x26')]=_[_0x12f3('0x2b')](_0x289189[_0x12f3('0x26')]);_0x3ab5c3['filters']=_['intersection'](_0x3ab5c3[_0x12f3('0x2a')],_0x3ab5c3[_0x12f3('0x26')]);_0x3e0626['attributes']=_[_0x12f3('0x2d')](_0x3ab5c3[_0x12f3('0x2a')],qs[_0x12f3('0x2e')](_0x289189[_0x12f3('0x26')][_0x12f3('0x2e')]));_0x3e0626[_0x12f3('0x2f')]=_0x3e0626[_0x12f3('0x2f')][_0x12f3('0x30')]?_0x3e0626[_0x12f3('0x2f')]:_0x3ab5c3['model'];if(_0x289189['query'][_0x12f3('0x31')]){_0x3e0626['include']=[{'all':!![]}];}_0x3e0626=_[_0x12f3('0x32')]({},_0x3e0626,_0x289189[_0x12f3('0x33')]);return db[_0x12f3('0x21')][_0x12f3('0x34')](_0x3e0626)[_0x12f3('0x1b')](handleEntityNotFound(_0x2fa8f5,null))[_0x12f3('0x1b')](respondWithResult(_0x2fa8f5,null))[_0x12f3('0x28')](handleError(_0x2fa8f5,null));};exports[_0x12f3('0x35')]=function(_0x12cbd6,_0x470a1a){return db[_0x12f3('0x21')][_0x12f3('0x35')](_0x12cbd6[_0x12f3('0x36')],{})['then'](respondWithResult(_0x470a1a,0xc9))[_0x12f3('0x28')](handleError(_0x470a1a,null));};exports[_0x12f3('0x1a')]=function(_0x2e00e9,_0x23fe9a){if(_0x2e00e9[_0x12f3('0x36')]['id']){delete _0x2e00e9[_0x12f3('0x36')]['id'];}return db['MailInteraction'][_0x12f3('0x34')]({'where':{'id':_0x2e00e9['params']['id']}})['then'](handleEntityNotFound(_0x23fe9a,null))[_0x12f3('0x1b')](saveUpdates(_0x2e00e9[_0x12f3('0x36')],null))[_0x12f3('0x1b')](respondWithResult(_0x23fe9a,null))['catch'](handleError(_0x23fe9a,null));};exports[_0x12f3('0x1c')]=function(_0x1f66b5,_0x17bbf0){return db['MailInteraction'][_0x12f3('0x34')]({'where':{'id':_0x1f66b5[_0x12f3('0x29')]['id']}})['then'](handleEntityNotFound(_0x17bbf0,null))[_0x12f3('0x1b')](removeEntity(_0x17bbf0,null))['catch'](handleError(_0x17bbf0,null));};exports[_0x12f3('0x37')]=function(_0x1f608d,_0x2cf8ca){return db['MailInteraction']['describe']()['then'](respondWithResult(_0x2cf8ca,null))[_0x12f3('0x28')](handleError(_0x2cf8ca,null));};exports[_0x12f3('0x38')]=function(_0x576c02,_0x470ff2){return db[_0x12f3('0x39')]['find']({'where':{'id':_0x576c02['params']['id']}})[_0x12f3('0x1b')](handleEntityNotFound(_0x470ff2,null))[_0x12f3('0x1b')](function(_0x361553){if(_0x361553){return _0x361553[_0x12f3('0x38')](_0x576c02[_0x12f3('0x36')][_0x12f3('0x3a')],_[_0x12f3('0x3b')](_0x576c02[_0x12f3('0x36')],[_0x12f3('0x3a'),'id'])||{});}})[_0x12f3('0x1b')](respondWithResult(_0x470ff2,null))[_0x12f3('0x28')](handleError(_0x470ff2,null));};exports[_0x12f3('0x3c')]=function(_0x34aba8,_0x184804){var _0x42f7e0={'raw':![],'where':{}};var _0x54b1ac={};var _0xa86bd8={'count':0x0,'rows':[]};return db[_0x12f3('0x21')][_0x12f3('0x3d')]({'where':{'id':_0x34aba8[_0x12f3('0x29')]['id']}})[_0x12f3('0x1b')](handleEntityNotFound(_0x184804,null))[_0x12f3('0x1b')](function(_0x14a42c){if(_0x14a42c){_0x54b1ac[_0x12f3('0x2a')]=_[_0x12f3('0x2b')](db[_0x12f3('0x39')]['rawAttributes']);_0x54b1ac['query']=_['keys'](_0x34aba8['query']);_0x54b1ac[_0x12f3('0x3e')]=_[_0x12f3('0x2d')](_0x54b1ac[_0x12f3('0x2a')],_0x54b1ac[_0x12f3('0x26')]);_0x42f7e0['attributes']=_[_0x12f3('0x2d')](_0x54b1ac[_0x12f3('0x2a')],qs['fields'](_0x34aba8[_0x12f3('0x26')][_0x12f3('0x2e')]));_0x42f7e0[_0x12f3('0x2f')]=_0x42f7e0[_0x12f3('0x2f')][_0x12f3('0x30')]?_0x42f7e0[_0x12f3('0x2f')]:_0x54b1ac[_0x12f3('0x2a')];if(!_0x34aba8['query'][_0x12f3('0x3f')](_0x12f3('0x40'))){_0x42f7e0[_0x12f3('0x16')]=qs['limit'](_0x34aba8[_0x12f3('0x26')]['limit']);_0x42f7e0[_0x12f3('0x15')]=qs['offset'](_0x34aba8[_0x12f3('0x26')][_0x12f3('0x15')]);}_0x42f7e0[_0x12f3('0x41')]=qs[_0x12f3('0x42')](_0x34aba8['query']['sort']);_0x42f7e0[_0x12f3('0x43')]=qs[_0x12f3('0x3e')](_[_0x12f3('0x44')](_0x34aba8['query'],_0x54b1ac[_0x12f3('0x3e')]));_0x42f7e0[_0x12f3('0x43')][_0x12f3('0x45')]=_0x14a42c['id'];if(_0x34aba8[_0x12f3('0x26')][_0x12f3('0x46')]){_0x42f7e0[_0x12f3('0x43')]=_[_0x12f3('0x32')](_0x42f7e0[_0x12f3('0x43')],{'$or':_['map'](_0x42f7e0[_0x12f3('0x2f')],function(_0x26ffa9){var _0x5440c2={};_0x5440c2[_0x26ffa9]={'$like':'%'+_0x34aba8[_0x12f3('0x26')][_0x12f3('0x46')]+'%'};return _0x5440c2;})});}if(_0x34aba8['query']['$gte']){var _0x5db4ae=_0x34aba8[_0x12f3('0x26')]['$gte'][_0x12f3('0x47')](',');var _0x118c4f={};_0x118c4f[_0x5db4ae[0x0]]={'$gte':moment(_0x5db4ae[0x1])[_0x12f3('0x48')](_0x12f3('0x49'))};_0x42f7e0['where']=_[_0x12f3('0x32')](_0x42f7e0[_0x12f3('0x43')],_0x118c4f);}_0x42f7e0=_['merge']({},_0x42f7e0,_0x34aba8['options']);return db[_0x12f3('0x39')]['count']({'where':_0x42f7e0['where']})[_0x12f3('0x1b')](function(_0x451bfc){_0xa86bd8[_0x12f3('0x17')]=_0x451bfc;if(_0x34aba8[_0x12f3('0x26')]['includeAll']){_0x42f7e0[_0x12f3('0x4a')]=[{'all':!![]}];}return db['MailMessage'][_0x12f3('0x24')](_0x42f7e0);})['then'](function(_0xb06fe3){if(_0x34aba8[_0x12f3('0x26')]['inlineCss']===_0x12f3('0x4b')){for(var _0x585bad=0x0;_0x585bad<_0xb06fe3['length'];_0x585bad++){_0xb06fe3[_0x585bad]['body']=juice(_0xb06fe3[_0x585bad][_0x12f3('0x36')]);}}_0xa86bd8[_0x12f3('0x4c')]=_0xb06fe3;return _0xa86bd8;});}})[_0x12f3('0x1b')](respondWithFilteredResult(_0x184804,_0x42f7e0))['catch'](handleError(_0x184804,null));};exports[_0x12f3('0x4d')]=function(_0x13598b,_0x1b59f9){return db[_0x12f3('0x21')][_0x12f3('0x34')]({'where':{'id':_0x13598b[_0x12f3('0x29')]['id']}})[_0x12f3('0x1b')](handleEntityNotFound(_0x1b59f9,null))[_0x12f3('0x1b')](function(_0x361185){if(_0x361185){return _0x361185['setTags'](_0x13598b[_0x12f3('0x36')][_0x12f3('0x3a')],_[_0x12f3('0x3b')](_0x13598b[_0x12f3('0x36')],['ids','id'])||{})[_0x12f3('0x4e')](function(){return db[_0x12f3('0x4f')]['findAll']({'attributes':['id',_0x12f3('0x1e'),_0x12f3('0x50')],'where':{'id':_0x13598b['body'][_0x12f3('0x3a')]}});})['then'](function(_0x4f3c56){socket[_0x12f3('0x51')](_0x12f3('0x52'),{'id':Number(_0x13598b[_0x12f3('0x29')]['id']),'tags':_0x4f3c56||[]});return{'id':Number(_0x13598b[_0x12f3('0x29')]['id']),'tags':_0x4f3c56||[]};});}})[_0x12f3('0x1b')](respondWithResult(_0x1b59f9,null))['catch'](handleError(_0x1b59f9,null));};exports[_0x12f3('0x53')]=function(_0x43325b,_0x708bc3){return db[_0x12f3('0x21')][_0x12f3('0x34')]({'where':{'id':_0x43325b[_0x12f3('0x29')]['id']}})['then'](handleEntityNotFound(_0x708bc3,null))[_0x12f3('0x1b')](function(_0x368d75){if(_0x368d75){return _0x368d75[_0x12f3('0x53')](_0x43325b[_0x12f3('0x26')][_0x12f3('0x3a')]);}})['then'](respondWithStatusCode(_0x708bc3,null))[_0x12f3('0x28')](handleError(_0x708bc3,null));};exports['download']=function(_0x1d3367,_0x21fec0){var _0x16d423=moment()[_0x12f3('0x54')]()[_0x12f3('0x55')]();var _0x2684d3=path[_0x12f3('0x56')](config['root'],'server',_0x12f3('0x57'),'tmp');var _0xe4c074=path[_0x12f3('0x56')](config[_0x12f3('0x58')],'server','files',_0x12f3('0x59'));var _0x16cf16=path['join'](_0x2684d3,_0x16d423);var _0x57fa38=util['format']('transcript-%d-%s.zip',_0x1d3367[_0x12f3('0x29')]['id'],_0x16d423);var _0x228dc3=path[_0x12f3('0x56')](_0x2684d3,_0x57fa38);var _0x34fab5=[];if(_0x1d3367[_0x12f3('0x26')][_0x12f3('0x59')]){_0x34fab5[_0x12f3('0x5a')]({'model':db[_0x12f3('0x5b')],'as':'Attachments','raw':!![]});}var _0x1dbe5b=[{'model':db[_0x12f3('0x39')],'as':_0x12f3('0x5c'),'attributes':['id',_0x12f3('0x36'),_0x12f3('0x5d'),'to','cc',_0x12f3('0x5e'),_0x12f3('0x5f'),_0x12f3('0x60')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x34fab5}];return db[_0x12f3('0x21')][_0x12f3('0x34')]({'where':{'id':_0x1d3367[_0x12f3('0x29')]['id']},'include':_0x1dbe5b})[_0x12f3('0x1b')](handleEntityNotFound(_0x21fec0,null))[_0x12f3('0x1b')](function(_0x3c6137){if(_0x3c6137&&_0x3c6137[_0x12f3('0x5c')]){var _0x4fdafa=_0x3c6137[_0x12f3('0x61')]({'plain':!![]});fs[_0x12f3('0x62')](_0x16cf16);return BPromise[_0x12f3('0x63')](_0x4fdafa[_0x12f3('0x5c')],function(_0xb38b89,_0x92d04a){var _0x31bebc={'from':_0xb38b89[_0x12f3('0x5d')],'to':_0xb38b89['to']||'missing.recipient@your.company.com','subject':_0xb38b89[_0x12f3('0x5f')],'html':htmlEntities['decode'](_0xb38b89[_0x12f3('0x36')]),'headers':{'Date':moment(_0xb38b89[_0x12f3('0x60')])[_0x12f3('0x48')](_0x12f3('0x64'))},'attachments':[]};if(_0xb38b89['cc']){_0x31bebc['headers']['Cc']=_0xb38b89['cc'];}if(_0xb38b89[_0x12f3('0x5e')]){_0x31bebc[_0x12f3('0x65')]['Bcc']=_0xb38b89[_0x12f3('0x5e')];}return new BPromise(function(_0x4c6eaa,_0x3fcdc2){if(_0xb38b89[_0x12f3('0x66')]){for(var _0x4fab41=0x0;_0x4fab41<_0xb38b89['Attachments'][_0x12f3('0x30')];_0x4fab41++){var _0x40c696=_0xb38b89[_0x12f3('0x66')][_0x4fab41];var _0x1b5dca=path['join'](_0xe4c074,_0x40c696[_0x12f3('0x67')]);if(fs[_0x12f3('0x68')](_0x1b5dca)){_0x31bebc['attachments'][_0x12f3('0x5a')]({'name':_0x40c696[_0x12f3('0x1e')],'contentType':_0x40c696[_0x12f3('0x69')],'data':fs[_0x12f3('0x6a')](_0x1b5dca)});}}}emlformat['build'](_0x31bebc,function(_0x140cb4,_0x3b40eb){if(_0x140cb4)return _0x3fcdc2(_0x140cb4);fs['writeFileSync'](path[_0x12f3('0x56')](_0x16cf16,util[_0x12f3('0x48')]('message%d.eml',_0x92d04a)),_0x3b40eb);return _0x4c6eaa(_0x3b40eb);});});})[_0x12f3('0x1b')](function(){return new BPromise(function(_0x2a2bd3,_0x3951de){zipdir(_0x16cf16,{'saveTo':_0x228dc3},function(_0x5b8164,_0x5b4d42){if(_0x5b8164)return _0x3951de(_0x5b8164);return _0x2a2bd3(_0x5b4d42);});})[_0x12f3('0x1b')](function(){return new BPromise(function(_0x5f5628,_0x1106de){rimraf(_0x16cf16,function(_0x3d0426){if(_0x3d0426)_0x1106de(_0x3d0426);return _0x5f5628();});});})['then'](function(){return _0x21fec0[_0x12f3('0x6b')](_0x228dc3,_0x57fa38,function(_0x1affec){if(!_0x1affec)fs[_0x12f3('0x6c')](_0x228dc3);});});});}else{return _0x21fec0[_0x12f3('0x11')](0xc8);}})['catch'](handleError(_0x21fec0,null));};
\ No newline at end of file
+var _0x3a79=['body','params','describe','addMessage','MailMessage','ids','getMessages','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','rows','addTags','omit','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','attachments','Attachment','Attachments','subject','createdAt','Messages','get','mkdirSync','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','push','readFileSync','build','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','html-entities','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','error','name','index','map','MailInteraction','rawAttributes','fieldName','type','key','findAll','mail','catch','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3a79,0xa4));var _0x93a7=function(_0x3de03f,_0x583f59){_0x3de03f=_0x3de03f-0x0;var _0x1f8861=_0x3a79[_0x3de03f];return _0x1f8861;};'use strict';var emlformat=require(_0x93a7('0x0'));var rimraf=require(_0x93a7('0x1'));var zipdir=require(_0x93a7('0x2'));var moment=require(_0x93a7('0x3'));var BPromise=require(_0x93a7('0x4'));var util=require(_0x93a7('0x5'));var path=require('path');var fs=require('fs');var _=require(_0x93a7('0x6'));var juice=require(_0x93a7('0x7'));var Redis=require(_0x93a7('0x8'));var interaction=require(_0x93a7('0x9'));var qs=require(_0x93a7('0xa'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x93a7('0xb'))['db'];var htmlEntities=require(_0x93a7('0xc'));config['redis']=_[_0x93a7('0xd')](config['redis'],{'host':_0x93a7('0xe'),'port':0x18eb});var socket=require(_0x93a7('0xf'))(new Redis(config['redis']));require(_0x93a7('0x10'))[_0x93a7('0x11')](socket);function respondWithStatusCode(_0x19bf81,_0x4570a3){_0x4570a3=_0x4570a3||0xcc;return function(_0x37b54e){if(_0x37b54e){return _0x19bf81[_0x93a7('0x12')](_0x4570a3);}return _0x19bf81[_0x93a7('0x13')](_0x4570a3)[_0x93a7('0x14')]();};}function respondWithResult(_0x2f7e6a,_0x2ae8bb){_0x2ae8bb=_0x2ae8bb||0xc8;return function(_0x1d7266){if(_0x1d7266){return _0x2f7e6a[_0x93a7('0x13')](_0x2ae8bb)[_0x93a7('0x15')](_0x1d7266);}};}function respondWithFilteredResult(_0x563d14,_0xdd6ea){return function(_0x5ad26f){if(_0x5ad26f){var _0x1776e0=typeof _0xdd6ea[_0x93a7('0x16')]==='undefined'&&typeof _0xdd6ea[_0x93a7('0x17')]===_0x93a7('0x18');var _0x2deefb=_0x5ad26f[_0x93a7('0x19')];var _0x5f2c51=_0x1776e0?0x0:_0xdd6ea[_0x93a7('0x16')];var _0x5ac04a=_0x1776e0?_0x5ad26f[_0x93a7('0x19')]:_0xdd6ea[_0x93a7('0x16')]+_0xdd6ea[_0x93a7('0x17')];var _0x520e72;if(_0x5ac04a>=_0x2deefb){_0x5ac04a=_0x2deefb;_0x520e72=0xc8;}else{_0x520e72=0xce;}_0x563d14['status'](_0x520e72);return _0x563d14[_0x93a7('0x1a')](_0x93a7('0x1b'),_0x5f2c51+'-'+_0x5ac04a+'/'+_0x2deefb)[_0x93a7('0x15')](_0x5ad26f);}return null;};}function saveUpdates(_0x16a5d7){return function(_0x45faa3){if(_0x45faa3){return _0x45faa3['update'](_0x16a5d7)[_0x93a7('0x1c')](function(_0x1b061d){return _0x1b061d;});}return null;};}function removeEntity(_0x1e7cb0){return function(_0x3b5e97){if(_0x3b5e97){return _0x3b5e97[_0x93a7('0x1d')]()[_0x93a7('0x1c')](function(){_0x1e7cb0[_0x93a7('0x13')](0xcc)[_0x93a7('0x14')]();});}};}function handleEntityNotFound(_0x4a9fdc){return function(_0x2951d6){if(!_0x2951d6){_0x4a9fdc['sendStatus'](0x194);}return _0x2951d6;};}function handleError(_0x372492,_0x4a2a5b){_0x4a2a5b=_0x4a2a5b||0x1f4;return function(_0x59d163){logger[_0x93a7('0x1e')](_0x59d163['stack']);if(_0x59d163[_0x93a7('0x1f')]){delete _0x59d163[_0x93a7('0x1f')];}_0x372492[_0x93a7('0x13')](_0x4a2a5b)['send'](_0x59d163);};}exports[_0x93a7('0x20')]=function(_0x414fc1,_0x369c1e){var _0x4d0f25={};var _0x3a1d73=_[_0x93a7('0x21')](db[_0x93a7('0x22')][_0x93a7('0x23')],function(_0xc506e6){return{'name':_0xc506e6[_0x93a7('0x24')],'type':_0xc506e6[_0x93a7('0x25')][_0x93a7('0x26')]};});_0x4d0f25=qs['getOptions'](_0x3a1d73,_0x414fc1);return interaction[_0x93a7('0x27')](_0x93a7('0x28'),_0x414fc1['query'],_0x414fc1['user'],_0x4d0f25,_0x3a1d73)[_0x93a7('0x1c')](respondWithFilteredResult(_0x369c1e,_0x4d0f25))[_0x93a7('0x29')](handleError(_0x369c1e,null));};exports['show']=function(_0x3c00e5,_0x2ed1f5){var _0x161b6e={'raw':![],'where':{'id':_0x3c00e5['params']['id']}},_0xfc0549={};_0xfc0549[_0x93a7('0x2a')]=_[_0x93a7('0x2b')](db[_0x93a7('0x22')][_0x93a7('0x23')]);_0xfc0549[_0x93a7('0x2c')]=_[_0x93a7('0x2b')](_0x3c00e5[_0x93a7('0x2c')]);_0xfc0549[_0x93a7('0x2d')]=_[_0x93a7('0x2e')](_0xfc0549['model'],_0xfc0549[_0x93a7('0x2c')]);_0x161b6e[_0x93a7('0x2f')]=_[_0x93a7('0x2e')](_0xfc0549[_0x93a7('0x2a')],qs[_0x93a7('0x30')](_0x3c00e5['query']['fields']));_0x161b6e[_0x93a7('0x2f')]=_0x161b6e[_0x93a7('0x2f')][_0x93a7('0x31')]?_0x161b6e[_0x93a7('0x2f')]:_0xfc0549[_0x93a7('0x2a')];if(_0x3c00e5[_0x93a7('0x2c')][_0x93a7('0x32')]){_0x161b6e[_0x93a7('0x33')]=[{'all':!![]}];}_0x161b6e=_[_0x93a7('0x34')]({},_0x161b6e,_0x3c00e5[_0x93a7('0x35')]);return db[_0x93a7('0x22')][_0x93a7('0x36')](_0x161b6e)[_0x93a7('0x1c')](handleEntityNotFound(_0x2ed1f5,null))['then'](respondWithResult(_0x2ed1f5,null))[_0x93a7('0x29')](handleError(_0x2ed1f5,null));};exports['create']=function(_0x184f3c,_0xb5aa4d){return db[_0x93a7('0x22')][_0x93a7('0x37')](_0x184f3c[_0x93a7('0x38')],{})[_0x93a7('0x1c')](respondWithResult(_0xb5aa4d,0xc9))[_0x93a7('0x29')](handleError(_0xb5aa4d,null));};exports['update']=function(_0x311438,_0x2692ff){if(_0x311438['body']['id']){delete _0x311438[_0x93a7('0x38')]['id'];}return db[_0x93a7('0x22')][_0x93a7('0x36')]({'where':{'id':_0x311438[_0x93a7('0x39')]['id']}})[_0x93a7('0x1c')](handleEntityNotFound(_0x2692ff,null))['then'](saveUpdates(_0x311438[_0x93a7('0x38')],null))[_0x93a7('0x1c')](respondWithResult(_0x2692ff,null))[_0x93a7('0x29')](handleError(_0x2692ff,null));};exports[_0x93a7('0x1d')]=function(_0x24c86d,_0x2e66ee){return db['MailInteraction'][_0x93a7('0x36')]({'where':{'id':_0x24c86d[_0x93a7('0x39')]['id']}})['then'](handleEntityNotFound(_0x2e66ee,null))[_0x93a7('0x1c')](removeEntity(_0x2e66ee,null))['catch'](handleError(_0x2e66ee,null));};exports[_0x93a7('0x3a')]=function(_0x4052d8,_0x257a04){return db['MailInteraction'][_0x93a7('0x3a')]()[_0x93a7('0x1c')](respondWithResult(_0x257a04,null))[_0x93a7('0x29')](handleError(_0x257a04,null));};exports[_0x93a7('0x3b')]=function(_0x28d97c,_0x5d7f15){return db[_0x93a7('0x3c')][_0x93a7('0x36')]({'where':{'id':_0x28d97c[_0x93a7('0x39')]['id']}})[_0x93a7('0x1c')](handleEntityNotFound(_0x5d7f15,null))[_0x93a7('0x1c')](function(_0x4f4b50){if(_0x4f4b50){return _0x4f4b50['addMessage'](_0x28d97c[_0x93a7('0x38')][_0x93a7('0x3d')],_['omit'](_0x28d97c[_0x93a7('0x38')],['ids','id'])||{});}})[_0x93a7('0x1c')](respondWithResult(_0x5d7f15,null))['catch'](handleError(_0x5d7f15,null));};exports[_0x93a7('0x3e')]=function(_0x1be546,_0x338dc6){var _0x446045={'raw':![],'where':{}};var _0x30c649={};var _0x38491d={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x1be546[_0x93a7('0x39')]['id']}})[_0x93a7('0x1c')](handleEntityNotFound(_0x338dc6,null))[_0x93a7('0x1c')](function(_0x2e7d2f){if(_0x2e7d2f){_0x30c649[_0x93a7('0x2a')]=_[_0x93a7('0x2b')](db[_0x93a7('0x3c')][_0x93a7('0x23')]);_0x30c649[_0x93a7('0x2c')]=_['keys'](_0x1be546[_0x93a7('0x2c')]);_0x30c649['filters']=_[_0x93a7('0x2e')](_0x30c649[_0x93a7('0x2a')],_0x30c649[_0x93a7('0x2c')]);_0x446045[_0x93a7('0x2f')]=_['intersection'](_0x30c649[_0x93a7('0x2a')],qs['fields'](_0x1be546[_0x93a7('0x2c')][_0x93a7('0x30')]));_0x446045[_0x93a7('0x2f')]=_0x446045[_0x93a7('0x2f')][_0x93a7('0x31')]?_0x446045[_0x93a7('0x2f')]:_0x30c649[_0x93a7('0x2a')];if(!_0x1be546['query']['hasOwnProperty'](_0x93a7('0x3f'))){_0x446045[_0x93a7('0x17')]=qs[_0x93a7('0x17')](_0x1be546['query'][_0x93a7('0x17')]);_0x446045[_0x93a7('0x16')]=qs['offset'](_0x1be546[_0x93a7('0x2c')]['offset']);}_0x446045[_0x93a7('0x40')]=qs[_0x93a7('0x41')](_0x1be546[_0x93a7('0x2c')]['sort']);_0x446045[_0x93a7('0x42')]=qs[_0x93a7('0x2d')](_[_0x93a7('0x43')](_0x1be546['query'],_0x30c649[_0x93a7('0x2d')]));_0x446045[_0x93a7('0x42')]['MailInteractionId']=_0x2e7d2f['id'];if(_0x1be546[_0x93a7('0x2c')]['filter']){_0x446045[_0x93a7('0x42')]=_['merge'](_0x446045[_0x93a7('0x42')],{'$or':_[_0x93a7('0x21')](_0x446045[_0x93a7('0x2f')],function(_0x115e3f){var _0x565404={};_0x565404[_0x115e3f]={'$like':'%'+_0x1be546[_0x93a7('0x2c')][_0x93a7('0x44')]+'%'};return _0x565404;})});}if(_0x1be546['query']['$gte']){var _0x1baebd=_0x1be546['query'][_0x93a7('0x45')][_0x93a7('0x46')](',');var _0x145976={};_0x145976[_0x1baebd[0x0]]={'$gte':moment(_0x1baebd[0x1])[_0x93a7('0x47')](_0x93a7('0x48'))};_0x446045['where']=_[_0x93a7('0x34')](_0x446045['where'],_0x145976);}_0x446045=_[_0x93a7('0x34')]({},_0x446045,_0x1be546[_0x93a7('0x35')]);return db[_0x93a7('0x3c')][_0x93a7('0x19')]({'where':_0x446045[_0x93a7('0x42')]})[_0x93a7('0x1c')](function(_0x4e3e44){_0x38491d['count']=_0x4e3e44;if(_0x1be546[_0x93a7('0x2c')][_0x93a7('0x32')]){_0x446045[_0x93a7('0x33')]=[{'all':!![]}];}return db[_0x93a7('0x3c')]['findAll'](_0x446045);})[_0x93a7('0x1c')](function(_0x307cc5){if(_0x1be546[_0x93a7('0x2c')][_0x93a7('0x49')]==='true'){for(var _0x2aafa1=0x0;_0x2aafa1<_0x307cc5[_0x93a7('0x31')];_0x2aafa1++){_0x307cc5[_0x2aafa1][_0x93a7('0x38')]=juice(_0x307cc5[_0x2aafa1][_0x93a7('0x38')]);}}_0x38491d[_0x93a7('0x4a')]=_0x307cc5;return _0x38491d;});}})[_0x93a7('0x1c')](respondWithFilteredResult(_0x338dc6,_0x446045))['catch'](handleError(_0x338dc6,null));};exports[_0x93a7('0x4b')]=function(_0x35e2e3,_0x5a7390){return db['MailInteraction'][_0x93a7('0x36')]({'where':{'id':_0x35e2e3[_0x93a7('0x39')]['id']}})[_0x93a7('0x1c')](handleEntityNotFound(_0x5a7390,null))[_0x93a7('0x1c')](function(_0x16692c){if(_0x16692c){return _0x16692c['setTags'](_0x35e2e3[_0x93a7('0x38')][_0x93a7('0x3d')],_[_0x93a7('0x4c')](_0x35e2e3['body'],[_0x93a7('0x3d'),'id'])||{})[_0x93a7('0x4d')](function(){return db[_0x93a7('0x4e')][_0x93a7('0x27')]({'attributes':['id',_0x93a7('0x1f'),_0x93a7('0x4f')],'where':{'id':_0x35e2e3[_0x93a7('0x38')][_0x93a7('0x3d')]}});})[_0x93a7('0x1c')](function(_0x7ebec8){socket[_0x93a7('0x50')](_0x93a7('0x51'),{'id':Number(_0x35e2e3[_0x93a7('0x39')]['id']),'tags':_0x7ebec8||[]});return{'id':Number(_0x35e2e3['params']['id']),'tags':_0x7ebec8||[]};});}})['then'](respondWithResult(_0x5a7390,null))['catch'](handleError(_0x5a7390,null));};exports['removeTags']=function(_0x2ab876,_0x3da00d){return db[_0x93a7('0x22')][_0x93a7('0x36')]({'where':{'id':_0x2ab876['params']['id']}})[_0x93a7('0x1c')](handleEntityNotFound(_0x3da00d,null))[_0x93a7('0x1c')](function(_0x2e8456){if(_0x2e8456){return _0x2e8456[_0x93a7('0x52')](_0x2ab876[_0x93a7('0x2c')][_0x93a7('0x3d')]);}})[_0x93a7('0x1c')](respondWithStatusCode(_0x3da00d,null))[_0x93a7('0x29')](handleError(_0x3da00d,null));};exports['download']=function(_0x14eb11,_0x4e1108){var _0x41e005=moment()[_0x93a7('0x53')]()[_0x93a7('0x54')]();var _0x429708=path[_0x93a7('0x55')](config[_0x93a7('0x56')],_0x93a7('0x57'),_0x93a7('0x58'),_0x93a7('0x59'));var _0x5825b1=path[_0x93a7('0x55')](config[_0x93a7('0x56')],_0x93a7('0x57'),_0x93a7('0x58'),'attachments');var _0x3607a3=path[_0x93a7('0x55')](_0x429708,_0x41e005);var _0x2a8bd1=util[_0x93a7('0x47')](_0x93a7('0x5a'),_0x14eb11['params']['id'],_0x41e005);var _0x293084=path[_0x93a7('0x55')](_0x429708,_0x2a8bd1);var _0x173120=[];if(_0x14eb11['query'][_0x93a7('0x5b')]){_0x173120['push']({'model':db[_0x93a7('0x5c')],'as':_0x93a7('0x5d'),'raw':!![]});}var _0x5476bb=[{'model':db[_0x93a7('0x3c')],'as':'Messages','attributes':['id','body','from','to','cc','bcc',_0x93a7('0x5e'),_0x93a7('0x5f')],'where':{'secret':![]},'order':qs[_0x93a7('0x41')]('id'),'include':_0x173120}];return db[_0x93a7('0x22')][_0x93a7('0x36')]({'where':{'id':_0x14eb11[_0x93a7('0x39')]['id']},'include':_0x5476bb})[_0x93a7('0x1c')](handleEntityNotFound(_0x4e1108,null))[_0x93a7('0x1c')](function(_0x20e6c0){if(_0x20e6c0&&_0x20e6c0[_0x93a7('0x60')]){var _0x2aa8fb=_0x20e6c0[_0x93a7('0x61')]({'plain':!![]});fs[_0x93a7('0x62')](_0x3607a3);return BPromise['each'](_0x2aa8fb[_0x93a7('0x60')],function(_0x3b5585,_0x4b69ad){var _0x5c320a={'from':_0x3b5585[_0x93a7('0x63')],'to':_0x3b5585['to']||'missing.recipient@your.company.com','subject':_0x3b5585[_0x93a7('0x5e')],'html':htmlEntities[_0x93a7('0x64')](_0x3b5585[_0x93a7('0x38')]),'headers':{'Date':moment(_0x3b5585[_0x93a7('0x5f')])[_0x93a7('0x47')](_0x93a7('0x65'))},'attachments':[]};if(_0x3b5585['cc']){_0x5c320a[_0x93a7('0x66')]['Cc']=_0x3b5585['cc'];}if(_0x3b5585['bcc']){_0x5c320a[_0x93a7('0x66')]['Bcc']=_0x3b5585['bcc'];}return new BPromise(function(_0x37ed32,_0x108fbc){if(_0x3b5585[_0x93a7('0x5d')]){for(var _0x7b05be=0x0;_0x7b05be<_0x3b5585[_0x93a7('0x5d')][_0x93a7('0x31')];_0x7b05be++){var _0x47842f=_0x3b5585[_0x93a7('0x5d')][_0x7b05be];var _0x5ae9f9=path[_0x93a7('0x55')](_0x5825b1,_0x47842f[_0x93a7('0x67')]);if(fs[_0x93a7('0x68')](_0x5ae9f9)){_0x5c320a[_0x93a7('0x5b')][_0x93a7('0x69')]({'name':_0x47842f['name'],'contentType':_0x47842f[_0x93a7('0x25')],'data':fs[_0x93a7('0x6a')](_0x5ae9f9)});}}}emlformat[_0x93a7('0x6b')](_0x5c320a,function(_0x2e313f,_0x287991){if(_0x2e313f)return _0x108fbc(_0x2e313f);fs['writeFileSync'](path[_0x93a7('0x55')](_0x3607a3,util['format']('message%d.eml',_0x4b69ad)),_0x287991);return _0x37ed32(_0x287991);});});})[_0x93a7('0x1c')](function(){return new BPromise(function(_0x254feb,_0xcdd440){zipdir(_0x3607a3,{'saveTo':_0x293084},function(_0x2df242,_0x31869c){if(_0x2df242)return _0xcdd440(_0x2df242);return _0x254feb(_0x31869c);});})[_0x93a7('0x1c')](function(){return new BPromise(function(_0x71f8c4,_0x965240){rimraf(_0x3607a3,function(_0xc7431a){if(_0xc7431a)_0x965240(_0xc7431a);return _0x71f8c4();});});})[_0x93a7('0x1c')](function(){return _0x4e1108[_0x93a7('0x6c')](_0x293084,_0x2a8bd1,function(_0x5b6f1c){if(!_0x5b6f1c)fs[_0x93a7('0x6d')](_0x293084);});});});}else{return _0x4e1108[_0x93a7('0x12')](0xc8);}})[_0x93a7('0x29')](handleError(_0x4e1108,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x287b=['map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x287b,0x67));var _0xb287=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0x287b[_0x332998];return _0x460be7;};'use strict';var EventEmitter=require(_0xb287('0x0'));var MailInteraction=require(_0xb287('0x1'))['db'][_0xb287('0x2')];var MailMessage=require(_0xb287('0x1'))['db'][_0xb287('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb287('0x4')](0x0);var events={'afterCreate':_0xb287('0x5'),'afterUpdate':'update','afterDestroy':_0xb287('0x6')};function emitEvent(_0x58414e){return function(_0x2ae796,_0x308253,_0x100e32){_0x2ae796[_0xb287('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x45cd75){_0x2ae796[_0xb287('0x8')]('Users',_0x45cd75[_0xb287('0x9')](function(_0x5c32d8){return{'id':_0x5c32d8['id']};}));return MailMessage[_0xb287('0xa')]({'where':{'MailInteractionId':_0x2ae796['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x33e4fc){_0x2ae796[_0xb287('0x8')]('unreadMessages',_0x33e4fc[_0xb287('0xb')]);MailInteractionEvents[_0xb287('0xc')](_0x58414e+':'+_0x2ae796['id'],_0x2ae796);MailInteractionEvents[_0xb287('0xc')](_0x58414e,_0x2ae796);_0x100e32(null);})[_0xb287('0xd')](_0x100e32(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xb287('0xe')](e,emitEvent(event));}}module[_0xb287('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0xb5d4=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5d4,0x19c));var _0x4b5d=function(_0x8a495,_0x3e6cd8){_0x8a495=_0x8a495-0x0;var _0x360cba=_0xb5d4[_0x8a495];return _0x360cba;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x4b5d('0x0'))['db'][_0x4b5d('0x1')];var MailMessage=require(_0x4b5d('0x0'))['db'][_0x4b5d('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4b5d('0x3')](0x0);var events={'afterCreate':_0x4b5d('0x4'),'afterUpdate':_0x4b5d('0x5'),'afterDestroy':_0x4b5d('0x6')};function emitEvent(_0x3a0b9e){return function(_0x18e2ce,_0x39f863,_0x4da15d){_0x18e2ce['getUsers']({'attributes':['id'],'raw':!![]})[_0x4b5d('0x7')](function(_0x3f6bc0){_0x18e2ce[_0x4b5d('0x8')](_0x4b5d('0x9'),_0x3f6bc0['map'](function(_0x581265){return{'id':_0x581265['id']};}));return MailMessage[_0x4b5d('0xa')]({'where':{'MailInteractionId':_0x18e2ce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b5d('0x7')](function(_0xef2d2b){_0x18e2ce['setDataValue'](_0x4b5d('0xb'),_0xef2d2b[_0x4b5d('0xc')]);MailInteractionEvents[_0x4b5d('0xd')](_0x3a0b9e+':'+_0x18e2ce['id'],_0x18e2ce);MailInteractionEvents[_0x4b5d('0xd')](_0x3a0b9e,_0x18e2ce);_0x4da15d(null);})['catch'](_0x4da15d(null));};}for(var e in events){if(events[_0x4b5d('0xe')](e)){var event=events[e];MailInteraction[_0x4b5d('0xf')](e,emitEvent(event));}}module[_0x4b5d('0x10')]=MailInteractionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ca2=['path','rimraf','../../config/environment','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','models','get','MailMessage','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xec05f0,_0x561575){var _0x21f61c=function(_0x27c4e9){while(--_0x27c4e9){_0xec05f0['push'](_0xec05f0['shift']());}};_0x21f61c(++_0x561575);}(_0x1ca2,0x182));var _0x21ca=function(_0x1e2b91,_0x4360f0){_0x1e2b91=_0x1e2b91-0x0;var _0x40f517=_0x1ca2[_0x1e2b91];return _0x40f517;};'use strict';var _=require(_0x21ca('0x0'));var util=require(_0x21ca('0x1'));var logger=require(_0x21ca('0x2'))(_0x21ca('0x3'));var moment=require(_0x21ca('0x4'));var BPromise=require(_0x21ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21ca('0x6'));var rimraf=require(_0x21ca('0x7'));var config=require(_0x21ca('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x202b1a,_0x4781d3){return _0x202b1a[_0x21ca('0x9')](_0x21ca('0xa'),attributes,{'tableName':_0x21ca('0xb'),'paranoid':![],'indexes':[{'name':_0x21ca('0xc'),'fields':[_0x21ca('0xd'),'to'],'type':_0x21ca('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4198f6,_0x399c8d,_0x29f2a2){if(_0x4198f6[_0x21ca('0xf')]){_0x4198f6[_0x21ca('0x10')]=moment()[_0x21ca('0x11')](_0x21ca('0x12'));}if(_0x4198f6['closed']){_0x4198f6['closedAt']=moment()['format'](_0x21ca('0x12'));}_0x29f2a2(null,_0x399c8d);},'beforeUpdate':function(_0x2b2e37,_0x15107f,_0x4ca596){if(_0x2b2e37[_0x21ca('0x13')](_0x21ca('0xf'))){_0x2b2e37[_0x21ca('0x10')]=_0x2b2e37['substatus']?moment()[_0x21ca('0x11')](_0x21ca('0x12')):null;}if(_0x2b2e37[_0x21ca('0x13')](_0x21ca('0x14'))){_0x2b2e37[_0x21ca('0x15')]=moment()[_0x21ca('0x11')](_0x21ca('0x12'));_0x2b2e37[_0x21ca('0xf')]=null;_0x2b2e37['substatusAt']=null;}_0x4ca596(null,_0x2b2e37);},'afterUpdate':function(_0x18dec6,_0x5203af,_0x5130e6){var _0xa305b5=_0x202b1a[_0x21ca('0x16')];var _0x1943d6=_0x18dec6[_0x21ca('0x17')]({'plain':!![]});if(_0x1943d6[_0x21ca('0x14')]){return _0xa305b5[_0x21ca('0x18')][_0x21ca('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x1943d6['id']}})['then'](function(){_0x5130e6();})['catch'](function(_0x51f3aa){_0x5130e6(_0x51f3aa);});}else{_0x5130e6();}}},'charset':_0x21ca('0x1a'),'collate':_0x21ca('0x1b')});};
\ No newline at end of file
+var _0x854c=['rimraf','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatus','models','get','MailMessage','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird'];(function(_0x1e9c0c,_0x61b24f){var _0x4bceff=function(_0x40a491){while(--_0x40a491){_0x1e9c0c['push'](_0x1e9c0c['shift']());}};_0x4bceff(++_0x61b24f);}(_0x854c,0x6f));var _0xc854=function(_0x493d73,_0x1f4878){_0x493d73=_0x493d73-0x0;var _0x30076e=_0x854c[_0x493d73];return _0x30076e;};'use strict';var _=require(_0xc854('0x0'));var util=require(_0xc854('0x1'));var logger=require('../../config/logger')(_0xc854('0x2'));var moment=require('moment');var BPromise=require(_0xc854('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc854('0x4'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xc854('0x5')]=function(_0x417d19,_0x3b1a79){return _0x417d19[_0xc854('0x6')](_0xc854('0x7'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xc854('0x8'),'fields':['subject','to'],'type':_0xc854('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40bff2,_0x2d3ff3,_0x3d8f7f){if(_0x40bff2['substatus']){_0x40bff2[_0xc854('0xa')]=moment()['format'](_0xc854('0xb'));}if(_0x40bff2[_0xc854('0xc')]){_0x40bff2[_0xc854('0xd')]=moment()[_0xc854('0xe')](_0xc854('0xb'));}_0x3d8f7f(null,_0x2d3ff3);},'beforeUpdate':function(_0x232ad8,_0x2a1081,_0x281d54){if(_0x232ad8[_0xc854('0xf')](_0xc854('0x10'))){_0x232ad8[_0xc854('0xa')]=_0x232ad8[_0xc854('0x10')]?moment()[_0xc854('0xe')](_0xc854('0xb')):null;}if(_0x232ad8['changed'](_0xc854('0xc'))){_0x232ad8[_0xc854('0xd')]=moment()[_0xc854('0xe')](_0xc854('0xb'));_0x232ad8[_0xc854('0x10')]=null;_0x232ad8[_0xc854('0xa')]=null;}_0x281d54(null,_0x232ad8);},'afterUpdate':function(_0x1edd6a,_0x40f252,_0x444d4c){var _0x8ac9ac=_0x417d19[_0xc854('0x11')];var _0x1d4afa=_0x1edd6a[_0xc854('0x12')]({'plain':!![]});if(_0x1d4afa[_0xc854('0xc')]){return _0x8ac9ac[_0xc854('0x13')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x1d4afa['id']}})['then'](function(){_0x444d4c();})[_0xc854('0x14')](function(_0x158be4){_0x444d4c(_0x158be4);});}else{_0x444d4c();}}},'charset':_0xc854('0x15'),'collate':_0xc854('0x16')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdb9=['AddTagsToMailInteraction','find','addTags','body','ids','omit','AddTags','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','then','catch'];(function(_0x565475,_0x1a04b0){var _0x15757f=function(_0x490487){while(--_0x490487){_0x565475['push'](_0x565475['shift']());}};_0x15757f(++_0x1a04b0);}(_0xbdb9,0xac));var _0x9bdb=function(_0x1f8c67,_0x241b75){_0x1f8c67=_0x1f8c67-0x0;var _0x3af03f=_0xbdb9[_0x1f8c67];return _0x3af03f;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var moment=require(_0x9bdb('0x2'));var BPromise=require(_0x9bdb('0x3'));var rs=require(_0x9bdb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9bdb('0x6'));var client=jayson['client'][_0x9bdb('0x7')]({'port':0x232a});config['redis']=_[_0x9bdb('0x8')](config[_0x9bdb('0x9')],{'host':_0x9bdb('0xa'),'port':0x18eb});var socket=require(_0x9bdb('0xb'))(new Redis(config[_0x9bdb('0x9')]));require(_0x9bdb('0xc'))[_0x9bdb('0xd')](socket);function respondWithRpcPromise(_0x58812d,_0x118bb1,_0x355bad){return new BPromise(function(_0x274dee,_0x35a5b9){return client[_0x9bdb('0xe')](_0x58812d,_0x355bad)['then'](function(_0x5af5d6){logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));logger[_0x9bdb('0x12')](_0x9bdb('0x13'),_0x118bb1,_0x9bdb('0x11'),JSON['stringify'](_0x5af5d6));if(_0x5af5d6[_0x9bdb('0x14')]){if(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x15')]===0x1f4){logger[_0x9bdb('0x14')](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6['error'][_0x9bdb('0x16')]);return _0x35a5b9(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}logger['error'](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);return _0x274dee(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}else{logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));_0x274dee(_0x5af5d6[_0x9bdb('0x17')][_0x9bdb('0x16')]);}})['catch'](function(_0x37837d){logger[_0x9bdb('0x14')]('MailInteraction,\x20%s,\x20%s',_0x118bb1,_0x37837d);_0x35a5b9(_0x37837d);});});}exports[_0x9bdb('0x18')]=function(_0x16a953){var _0x2fb1f3=this;return new Promise(function(_0x582a46,_0xdaab91){return db[_0x9bdb('0x19')][_0x9bdb('0x1a')](_0x16a953['body'],{'raw':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1d')]||null:null,'attributes':_0x16a953['options']?_0x16a953['options'][_0x9bdb('0x1e')]||null:null,'limit':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')]['limit']||null:null})[_0x9bdb('0x1f')](function(_0x2d9cfd){logger[_0x9bdb('0xf')](_0x9bdb('0x18'),_0x16a953);logger['debug'](_0x9bdb('0x18'),_0x16a953,JSON['stringify'](_0x2d9cfd));_0x582a46(_0x2d9cfd);})[_0x9bdb('0x20')](function(_0x3c2ad6){logger[_0x9bdb('0x14')]('UpdateMailInteraction',_0x3c2ad6[_0x9bdb('0x16')],_0x16a953);_0xdaab91(_0x2fb1f3[_0x9bdb('0x14')](0x1f4,_0x3c2ad6[_0x9bdb('0x16')]));});});};exports[_0x9bdb('0x21')]=function(_0x4368c4){return new Promise(function(_0x14fb6a,_0x426390){return db[_0x9bdb('0x19')][_0x9bdb('0x22')]({'where':_0x4368c4[_0x9bdb('0x1b')]?_0x4368c4['options'][_0x9bdb('0x1d')]||null:null})[_0x9bdb('0x1f')](function(_0x15edd5){if(_0x15edd5){return _0x15edd5[_0x9bdb('0x23')](_0x4368c4[_0x9bdb('0x24')][_0x9bdb('0x25')],_[_0x9bdb('0x26')](_0x4368c4['body'],[_0x9bdb('0x25'),'id'])||{});}})['spread'](function(_0x26a174){logger[_0x9bdb('0xf')](_0x9bdb('0x27'),_0x4368c4);logger[_0x9bdb('0x12')](_0x9bdb('0x27'),_0x4368c4,JSON[_0x9bdb('0x28')](_0x26a174));_0x14fb6a(_0x26a174);})[_0x9bdb('0x20')](function(_0x5f4d21){logger[_0x9bdb('0x14')](_0x9bdb('0x27'),_0x5f4d21[_0x9bdb('0x16')],_0x4368c4);_0x426390(_this['error'](0x1f4,_0x5f4d21['message']));});});};
\ No newline at end of file
+var _0xb3d8=['where','limit','then','catch','UpdateMailInteraction','AddTagsToMailInteraction','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailInteraction','update','body','options','raw'];(function(_0x5f3832,_0x5357a2){var _0x4ac284=function(_0x4fb71f){while(--_0x4fb71f){_0x5f3832['push'](_0x5f3832['shift']());}};_0x4ac284(++_0x5357a2);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x38b3d1,_0x26446d){_0x38b3d1=_0x38b3d1-0x0;var _0x5657b8=_0xb3d8[_0x38b3d1];return _0x5657b8;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var moment=require(_0x8b3d('0x1'));var BPromise=require(_0x8b3d('0x2'));var rs=require(_0x8b3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b3d('0x4'));var logger=require(_0x8b3d('0x5'))(_0x8b3d('0x6'));var config=require(_0x8b3d('0x7'));var jayson=require(_0x8b3d('0x8'));var client=jayson[_0x8b3d('0x9')][_0x8b3d('0xa')]({'port':0x232a});config[_0x8b3d('0xb')]=_[_0x8b3d('0xc')](config['redis'],{'host':_0x8b3d('0xd'),'port':0x18eb});var socket=require(_0x8b3d('0xe'))(new Redis(config[_0x8b3d('0xb')]));require(_0x8b3d('0xf'))[_0x8b3d('0x10')](socket);function respondWithRpcPromise(_0x2a7637,_0x2692cf,_0x3f0f45){return new BPromise(function(_0xa1dd29,_0x195ffe){return client['request'](_0x2a7637,_0x3f0f45)['then'](function(_0x1c9b08){logger[_0x8b3d('0x11')](_0x8b3d('0x12'),_0x2692cf,_0x8b3d('0x13'));logger[_0x8b3d('0x14')](_0x8b3d('0x15'),_0x2692cf,_0x8b3d('0x13'),JSON[_0x8b3d('0x16')](_0x1c9b08));if(_0x1c9b08[_0x8b3d('0x17')]){if(_0x1c9b08[_0x8b3d('0x17')][_0x8b3d('0x18')]===0x1f4){logger[_0x8b3d('0x17')](_0x8b3d('0x12'),_0x2692cf,_0x1c9b08[_0x8b3d('0x17')][_0x8b3d('0x19')]);return _0x195ffe(_0x1c9b08[_0x8b3d('0x17')]['message']);}logger[_0x8b3d('0x17')](_0x8b3d('0x12'),_0x2692cf,_0x1c9b08['error'][_0x8b3d('0x19')]);return _0xa1dd29(_0x1c9b08[_0x8b3d('0x17')]['message']);}else{logger[_0x8b3d('0x11')](_0x8b3d('0x12'),_0x2692cf,_0x8b3d('0x13'));_0xa1dd29(_0x1c9b08[_0x8b3d('0x1a')][_0x8b3d('0x19')]);}})['catch'](function(_0x5f1716){logger[_0x8b3d('0x17')]('MailInteraction,\x20%s,\x20%s',_0x2692cf,_0x5f1716);_0x195ffe(_0x5f1716);});});}exports['UpdateMailInteraction']=function(_0x50c5e8){var _0x35be13=this;return new Promise(function(_0x2e9dce,_0x4867e4){return db[_0x8b3d('0x1b')][_0x8b3d('0x1c')](_0x50c5e8[_0x8b3d('0x1d')],{'raw':_0x50c5e8[_0x8b3d('0x1e')]?_0x50c5e8[_0x8b3d('0x1e')][_0x8b3d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50c5e8[_0x8b3d('0x1e')]?_0x50c5e8[_0x8b3d('0x1e')][_0x8b3d('0x20')]||null:null,'attributes':_0x50c5e8[_0x8b3d('0x1e')]?_0x50c5e8[_0x8b3d('0x1e')]['attributes']||null:null,'limit':_0x50c5e8[_0x8b3d('0x1e')]?_0x50c5e8['options'][_0x8b3d('0x21')]||null:null})[_0x8b3d('0x22')](function(_0x113633){logger[_0x8b3d('0x11')]('UpdateMailInteraction',_0x50c5e8);logger[_0x8b3d('0x14')]('UpdateMailInteraction',_0x50c5e8,JSON['stringify'](_0x113633));_0x2e9dce(_0x113633);})[_0x8b3d('0x23')](function(_0x513bb1){logger['error'](_0x8b3d('0x24'),_0x513bb1[_0x8b3d('0x19')],_0x50c5e8);_0x4867e4(_0x35be13['error'](0x1f4,_0x513bb1['message']));});});};exports[_0x8b3d('0x25')]=function(_0x3aef33){return new Promise(function(_0x15f2f4,_0x1cab3a){return db[_0x8b3d('0x1b')]['find']({'where':_0x3aef33[_0x8b3d('0x1e')]?_0x3aef33[_0x8b3d('0x1e')][_0x8b3d('0x20')]||null:null})[_0x8b3d('0x22')](function(_0x38c989){if(_0x38c989){return _0x38c989['addTags'](_0x3aef33[_0x8b3d('0x1d')][_0x8b3d('0x26')],_[_0x8b3d('0x27')](_0x3aef33[_0x8b3d('0x1d')],['ids','id'])||{});}})[_0x8b3d('0x28')](function(_0x27b5d8){logger[_0x8b3d('0x11')]('AddTags',_0x3aef33);logger[_0x8b3d('0x14')](_0x8b3d('0x29'),_0x3aef33,JSON[_0x8b3d('0x16')](_0x27b5d8));_0x15f2f4(_0x27b5d8);})['catch'](function(_0x5b8a48){logger[_0x8b3d('0x17')](_0x8b3d('0x29'),_0x5b8a48[_0x8b3d('0x19')],_0x3aef33);_0x1cab3a(_this[_0x8b3d('0x17')](0x1f4,_0x5b8a48[_0x8b3d('0x19')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaece=['emit','removeListener','length','mailInteraction:','remove','update'];(function(_0x43cb42,_0x5752cb){var _0x8ccbe8=function(_0xc0d60d){while(--_0xc0d60d){_0x43cb42['push'](_0x43cb42['shift']());}};_0x8ccbe8(++_0x5752cb);}(_0xaece,0xf4));var _0xeaec=function(_0x5943c0,_0x4f64b9){_0x5943c0=_0x5943c0-0x0;var _0x3a1051=_0xaece[_0x5943c0];return _0x3a1051;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xeaec('0x0'),_0xeaec('0x1')];function createListener(_0x3c7e3b,_0x4c3560){return function(_0x2a6f7e){_0x4c3560[_0xeaec('0x2')](_0x3c7e3b,_0x2a6f7e);};}function removeListener(_0x318c06,_0x41f7fd){return function(){MailInteractionEvents[_0xeaec('0x3')](_0x318c06,_0x41f7fd);};}exports['register']=function(_0x136158){for(var _0x7ee9d7=0x0,_0x378bad=events[_0xeaec('0x4')];_0x7ee9d7<_0x378bad;_0x7ee9d7++){var _0x122613=events[_0x7ee9d7];var _0x44da8e=createListener(_0xeaec('0x5')+_0x122613,_0x136158);MailInteractionEvents['on'](_0x122613,_0x44da8e);}};
\ No newline at end of file
+var _0x2e2d=['removeListener','length','mailInteraction:','./mailInteraction.events','remove','update'];(function(_0x21ec3e,_0x3508a7){var _0x862714=function(_0x5577b8){while(--_0x5577b8){_0x21ec3e['push'](_0x21ec3e['shift']());}};_0x862714(++_0x3508a7);}(_0x2e2d,0xa5));var _0xd2e2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2e2d[_0x17d9e3];return _0x14192d;};'use strict';var MailInteractionEvents=require(_0xd2e2('0x0'));var events=['save',_0xd2e2('0x1'),_0xd2e2('0x2')];function createListener(_0xd4640f,_0x5bccd9){return function(_0x35e9d8){_0x5bccd9['emit'](_0xd4640f,_0x35e9d8);};}function removeListener(_0x2c94c3,_0x27b311){return function(){MailInteractionEvents[_0xd2e2('0x3')](_0x2c94c3,_0x27b311);};}exports['register']=function(_0xf0cb58){for(var _0x24eaa2=0x0,_0x1a205f=events[_0xd2e2('0x4')];_0x24eaa2<_0x1a205f;_0x24eaa2++){var _0x5ae045=events[_0x24eaa2];var _0x2b1191=createListener(_0xd2e2('0x5')+_0x5ae045,_0xf0cb58);MailInteractionEvents['on'](_0x5ae045,_0x2b1191);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3495=['reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject'];(function(_0x3551b7,_0x1d9c0f){var _0x51bf2b=function(_0x51ec19){while(--_0x51ec19){_0x3551b7['push'](_0x3551b7['shift']());}};_0x51bf2b(++_0x1d9c0f);}(_0x3495,0x1de));var _0x5349=function(_0x5c148b,_0x42d885){_0x5c148b=_0x5c148b-0x0;var _0x567538=_0x3495[_0x5c148b];return _0x567538;};'use strict';var multer=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var path=require(_0x5349('0x2'));var timeout=require(_0x5349('0x3'));var express=require(_0x5349('0x4'));var router=express[_0x5349('0x5')]();var fs_extra=require(_0x5349('0x6'));var auth=require(_0x5349('0x7'));var interaction=require(_0x5349('0x8'));var config=require('../../config/environment');var controller=require(_0x5349('0x9'));router[_0x5349('0xa')]('/',auth['isAuthenticated'](),controller[_0x5349('0xb')]);router['get'](_0x5349('0xc'),auth['isAuthenticated'](),controller[_0x5349('0xd')]);router['get'](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x10')]);router[_0x5349('0xa')](_0x5349('0x11'),auth[_0x5349('0xf')](),controller[_0x5349('0x12')]);router['post']('/',auth[_0x5349('0xf')](),interaction['tracked'](_0x5349('0x13'),_0x5349('0x14')),controller[_0x5349('0x15')]);router[_0x5349('0x16')](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x17')]);router[_0x5349('0x16')](_0x5349('0x18'),auth[_0x5349('0xf')](),controller['accept']);router[_0x5349('0x16')](_0x5349('0x19'),auth['isAuthenticated'](),controller[_0x5349('0x1a')]);router[_0x5349('0x1b')](_0x5349('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5699=['isAuthenticated','index','/describe','describe','show','/:id/download','post','mail','create','put','/:id','accept','reject','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5699,0xaf));var _0x9569=function(_0xc9189f,_0x1060e6){_0xc9189f=_0xc9189f-0x0;var _0x1347ec=_0x5699[_0xc9189f];return _0x1347ec;};'use strict';var multer=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var path=require(_0x9569('0x2'));var timeout=require('connect-timeout');var express=require(_0x9569('0x3'));var router=express[_0x9569('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9569('0x5'));var interaction=require(_0x9569('0x6'));var config=require('../../config/environment');var controller=require(_0x9569('0x7'));router[_0x9569('0x8')]('/',auth[_0x9569('0x9')](),controller[_0x9569('0xa')]);router['get'](_0x9569('0xb'),auth['isAuthenticated'](),controller[_0x9569('0xc')]);router[_0x9569('0x8')]('/:id',auth[_0x9569('0x9')](),controller[_0x9569('0xd')]);router[_0x9569('0x8')](_0x9569('0xe'),auth[_0x9569('0x9')](),controller['download']);router[_0x9569('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x9569('0x10'),'mailmessage:create'),controller[_0x9569('0x11')]);router[_0x9569('0x12')](_0x9569('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x9569('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x9569('0x14')]);router[_0x9569('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x9569('0x15')]);router[_0x9569('0x16')](_0x9569('0x13'),auth[_0x9569('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7eb8=['ENUM','out','STRING','long','DATE','INTEGER','Email','Chat','lodash','exports','TEXT','medium','BOOLEAN'];(function(_0xc65142,_0x338c38){var _0x51722c=function(_0x3e0fdc){while(--_0x3e0fdc){_0xc65142['push'](_0xc65142['shift']());}};_0x51722c(++_0x338c38);}(_0x7eb8,0x10c));var _0x87eb=function(_0x230139,_0x6f62e4){_0x230139=_0x230139-0x0;var _0x4a8d70=_0x7eb8[_0x230139];return _0x4a8d70;};'use strict';var Sequelize=require('sequelize');var _=require(_0x87eb('0x0'));module[_0x87eb('0x1')]={'body':{'type':Sequelize[_0x87eb('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x3'))},'read':{'type':Sequelize[_0x87eb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x87eb('0x5')]('in',_0x87eb('0x6')),'defaultValue':_0x87eb('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x87eb('0x7')](0x1fe)},'from':{'type':Sequelize[_0x87eb('0x7')]},'to':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x8'))},'cc':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x8'))},'bcc':{'type':Sequelize['TEXT'](_0x87eb('0x8'))},'subject':{'type':Sequelize[_0x87eb('0x2')]},'sentAt':{'type':Sequelize[_0x87eb('0x9')]},'attach':{'type':Sequelize[_0x87eb('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x87eb('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x87eb('0x9')]},'originTo':{'type':Sequelize[_0x87eb('0x2')](_0x87eb('0x8'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x87eb('0x5')](_0x87eb('0xb'),_0x87eb('0xc')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
+var _0xb717=['Email','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM'];(function(_0x2a690a,_0x4afc04){var _0x8ba65a=function(_0x84d6ce){while(--_0x84d6ce){_0x2a690a['push'](_0x2a690a['shift']());}};_0x8ba65a(++_0x4afc04);}(_0xb717,0x91));var _0x7b71=function(_0x4d74a8,_0x3cfcf2){_0x4d74a8=_0x4d74a8-0x0;var _0x3cd5b7=_0xb717[_0x4d74a8];return _0x3cd5b7;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7b71('0x0'));module[_0x7b71('0x1')]={'body':{'type':Sequelize[_0x7b71('0x2')](_0x7b71('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x7b71('0x4'))},'read':{'type':Sequelize[_0x7b71('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7b71('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7b71('0x7')](0x1fe)},'from':{'type':Sequelize[_0x7b71('0x7')]},'to':{'type':Sequelize['TEXT'](_0x7b71('0x3'))},'cc':{'type':Sequelize[_0x7b71('0x2')](_0x7b71('0x3'))},'bcc':{'type':Sequelize[_0x7b71('0x2')](_0x7b71('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x7b71('0x8')]},'attach':{'type':Sequelize[_0x7b71('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7b71('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7b71('0x8')]},'originTo':{'type':Sequelize[_0x7b71('0x2')](_0x7b71('0x3'))},'originCc':{'type':Sequelize[_0x7b71('0x2')](_0x7b71('0x3'))},'originChannel':{'type':Sequelize[_0x7b71('0xa')](_0x7b71('0xb'),_0x7b71('0xc')),'defaultValue':_0x7b71('0xb'),'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa06d=['motionChannel','download','unix','toString','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','unlinkSync','eml-format','moment','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','status','undefined','offset','limit','Content-Range','update','end','sendStatus','stack','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','catch','params','keys','body','find','describe','create','direction','out','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','format','UserId','user','agent','get','MailInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','channel','event','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','interface'];(function(_0x43dd52,_0x16d5f5){var _0x398a00=function(_0xa3db1a){while(--_0xa3db1a){_0x43dd52['push'](_0x43dd52['shift']());}};_0x398a00(++_0x16d5f5);}(_0xa06d,0x144));var _0xda06=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa06d[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xda06('0x0'));var moment=require(_0xda06('0x1'));var BPromise=require('bluebird');var util=require(_0xda06('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xda06('0x3'));var Redis=require(_0xda06('0x4'));var htmlToText=require(_0xda06('0x5'));var qs=require(_0xda06('0x6'));var logger=require(_0xda06('0x7'))(_0xda06('0x8'));var interaction_log=require(_0xda06('0x7'))('mail-interactions');var config=require(_0xda06('0x9'));var db=require('../../mysqldb')['db'];config[_0xda06('0xa')]=_[_0xda06('0xb')](config[_0xda06('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda06('0xa')]));var htmlEntities=require(_0xda06('0xc'));require(_0xda06('0xd'))[_0xda06('0xe')](socket);var jayson=require(_0xda06('0xf'));var client=jayson[_0xda06('0x10')][_0xda06('0x11')]({'port':0x232c});var client9003=jayson[_0xda06('0x10')][_0xda06('0x11')]({'port':0x232b});var client9002=jayson[_0xda06('0x10')][_0xda06('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x2500bc,_0x5d7e3a,_0x5276e3,_0x54acdd){return new BPromise(function(_0x37884b,_0x3cf498){var _0x5d78d8=_0x54acdd||client;return _0x5d78d8[_0xda06('0x12')](_0x2500bc,_0x5276e3)[_0xda06('0x13')](function(_0x13c265){logger[_0xda06('0x14')](_0xda06('0x15'),_0x5d7e3a,_0xda06('0x16'));logger['debug'](_0xda06('0x17'),_0x5d7e3a,'request\x20sent',JSON['stringify'](_0x13c265));if(_0x13c265['error']){if(_0x13c265[_0xda06('0x18')]['code']===0x1f4){logger[_0xda06('0x18')](_0xda06('0x15'),_0x5d7e3a,_0x13c265[_0xda06('0x18')][_0xda06('0x19')]);return _0x3cf498(_0x13c265['error'][_0xda06('0x19')]);}logger[_0xda06('0x18')](_0xda06('0x15'),_0x5d7e3a,_0x13c265[_0xda06('0x18')][_0xda06('0x19')]);return _0x37884b(_0x13c265[_0xda06('0x18')][_0xda06('0x19')]);}else{logger[_0xda06('0x14')](_0xda06('0x15'),_0x5d7e3a,'request\x20sent');_0x37884b(_0x13c265[_0xda06('0x1a')][_0xda06('0x19')]);}})['catch'](function(_0x4c3668){logger['error'](_0xda06('0x15'),_0x5d7e3a,_0x4c3668);_0x3cf498(_0x4c3668);});});}function respondWithResult(_0x54d27c,_0x41b99e){_0x41b99e=_0x41b99e||0xc8;return function(_0x53f9db){if(_0x53f9db){return _0x54d27c[_0xda06('0x1b')](_0x41b99e)['json'](_0x53f9db);}};}function respondWithFilteredResult(_0xb761ff,_0x1ff92a){return function(_0x3a2047){if(_0x3a2047){var _0x20240c=typeof _0x1ff92a['offset']===_0xda06('0x1c')&&typeof _0x1ff92a['limit']===_0xda06('0x1c');var _0x41996f=_0x3a2047['count'];var _0x14b9b4=_0x20240c?0x0:_0x1ff92a['offset'];var _0x18596c=_0x20240c?_0x3a2047['count']:_0x1ff92a[_0xda06('0x1d')]+_0x1ff92a[_0xda06('0x1e')];var _0x388c3d;if(_0x18596c>=_0x41996f){_0x18596c=_0x41996f;_0x388c3d=0xc8;}else{_0x388c3d=0xce;}_0xb761ff[_0xda06('0x1b')](_0x388c3d);return _0xb761ff['set'](_0xda06('0x1f'),_0x14b9b4+'-'+_0x18596c+'/'+_0x41996f)['json'](_0x3a2047);}return null;};}function saveUpdates(_0x4c3145){return function(_0x15af04){if(_0x15af04){return _0x15af04[_0xda06('0x20')](_0x4c3145)[_0xda06('0x13')](function(_0x551437){return _0x551437;});}return null;};}function removeEntity(_0x5aed10){return function(_0x406b4f){if(_0x406b4f){return _0x406b4f['destroy']()[_0xda06('0x13')](function(){_0x5aed10[_0xda06('0x1b')](0xcc)[_0xda06('0x21')]();});}};}function handleEntityNotFound(_0x222825){return function(_0x440fbe){if(!_0x440fbe){_0x222825[_0xda06('0x22')](0x194);}return _0x440fbe;};}function handleError(_0x68c3de,_0x276725){_0x276725=_0x276725||0x1f4;return function(_0x4b1b1d){logger[_0xda06('0x18')](_0x4b1b1d[_0xda06('0x23')]);if(_0x4b1b1d['name']){delete _0x4b1b1d['name'];}_0x68c3de['status'](_0x276725)[_0xda06('0x24')](_0x4b1b1d);};}exports[_0xda06('0x25')]=function(_0x35f061,_0x3dc9f5){var _0x1eb431={},_0x336537={},_0x2ef32a={'count':0x0,'rows':[]};var _0x279651=_[_0xda06('0x26')](db[_0xda06('0x27')][_0xda06('0x28')],function(_0x58a8c2){return{'name':_0x58a8c2[_0xda06('0x29')],'type':_0x58a8c2[_0xda06('0x2a')][_0xda06('0x2b')]};});_0x336537[_0xda06('0x2c')]=_[_0xda06('0x26')](_0x279651,_0xda06('0x2d'));_0x336537[_0xda06('0x2e')]=_['keys'](_0x35f061['query']);_0x336537[_0xda06('0x2f')]=_[_0xda06('0x30')](_0x336537[_0xda06('0x2c')],_0x336537[_0xda06('0x2e')]);_0x1eb431[_0xda06('0x31')]=_['intersection'](_0x336537[_0xda06('0x2c')],qs[_0xda06('0x32')](_0x35f061[_0xda06('0x2e')][_0xda06('0x32')]));_0x1eb431[_0xda06('0x31')]=_0x1eb431[_0xda06('0x31')][_0xda06('0x33')]?_0x1eb431['attributes']:_0x336537['model'];if(!_0x35f061['query']['hasOwnProperty'](_0xda06('0x34'))){_0x1eb431[_0xda06('0x1e')]=qs[_0xda06('0x1e')](_0x35f061[_0xda06('0x2e')][_0xda06('0x1e')]);_0x1eb431[_0xda06('0x1d')]=qs['offset'](_0x35f061[_0xda06('0x2e')][_0xda06('0x1d')]);}_0x1eb431[_0xda06('0x35')]=qs['sort'](_0x35f061[_0xda06('0x2e')][_0xda06('0x36')]);_0x1eb431['where']=qs[_0xda06('0x2f')](_[_0xda06('0x37')](_0x35f061[_0xda06('0x2e')],_0x336537[_0xda06('0x2f')]),_0x279651);if(_0x35f061[_0xda06('0x2e')][_0xda06('0x38')]){_0x1eb431[_0xda06('0x39')]=_['merge'](_0x1eb431[_0xda06('0x39')],{'$or':_['map'](_0x279651,function(_0x28dc37){if(_0x28dc37[_0xda06('0x2a')]!=='VIRTUAL'){var _0x52814b={};_0x52814b[_0x28dc37['name']]={'$like':'%'+_0x35f061[_0xda06('0x2e')][_0xda06('0x38')]+'%'};return _0x52814b;}})});}_0x1eb431=_[_0xda06('0x3a')]({},_0x1eb431,_0x35f061[_0xda06('0x3b')]);var _0x244456={'where':_0x1eb431[_0xda06('0x39')]};return db[_0xda06('0x27')][_0xda06('0x3c')](_0x244456)[_0xda06('0x13')](function(_0x26577b){_0x2ef32a['count']=_0x26577b;if(_0x35f061[_0xda06('0x2e')][_0xda06('0x3d')]){_0x1eb431[_0xda06('0x3e')]=[{'all':!![]}];}return db[_0xda06('0x27')][_0xda06('0x3f')](_0x1eb431);})[_0xda06('0x13')](function(_0x58ad86){_0x2ef32a['rows']=_0x58ad86;return _0x2ef32a;})[_0xda06('0x13')](respondWithFilteredResult(_0x3dc9f5,_0x1eb431))[_0xda06('0x40')](handleError(_0x3dc9f5,null));};exports['show']=function(_0xbb8834,_0xb9312c){var _0x242b44={'raw':!![],'where':{'id':_0xbb8834[_0xda06('0x41')]['id']}},_0x54f55f={};_0x54f55f[_0xda06('0x2c')]=_[_0xda06('0x42')](db[_0xda06('0x27')]['rawAttributes']);_0x54f55f['query']=_[_0xda06('0x42')](_0xbb8834['query']);_0x54f55f[_0xda06('0x2f')]=_['intersection'](_0x54f55f[_0xda06('0x2c')],_0x54f55f['query']);_0x242b44[_0xda06('0x31')]=_[_0xda06('0x30')](_0x54f55f[_0xda06('0x2c')],qs['fields'](_0xbb8834[_0xda06('0x2e')][_0xda06('0x32')]));_0x242b44[_0xda06('0x31')]=_0x242b44[_0xda06('0x31')][_0xda06('0x33')]?_0x242b44[_0xda06('0x31')]:_0x54f55f[_0xda06('0x2c')];if(_0xbb8834['query'][_0xda06('0x3d')]){_0x242b44['include']=[{'all':!![]}];}_0x242b44=_[_0xda06('0x3a')]({},_0x242b44,_0xbb8834[_0xda06('0x3b')]);return db[_0xda06('0x27')]['find'](_0x242b44)['then'](handleEntityNotFound(_0xb9312c,null))[_0xda06('0x13')](respondWithResult(_0xb9312c,null))[_0xda06('0x40')](handleError(_0xb9312c,null));};exports[_0xda06('0x20')]=function(_0x5ab9f5,_0x17a03c){if(_0x5ab9f5[_0xda06('0x43')]['id']){delete _0x5ab9f5[_0xda06('0x43')]['id'];}return db['MailMessage'][_0xda06('0x44')]({'where':{'id':_0x5ab9f5[_0xda06('0x41')]['id']}})[_0xda06('0x13')](handleEntityNotFound(_0x17a03c,null))[_0xda06('0x13')](saveUpdates(_0x5ab9f5[_0xda06('0x43')],null))[_0xda06('0x13')](respondWithResult(_0x17a03c,null))[_0xda06('0x40')](handleError(_0x17a03c,null));};exports['destroy']=function(_0x32d2df,_0x55513b){return db[_0xda06('0x27')]['find']({'where':{'id':_0x32d2df[_0xda06('0x41')]['id']}})[_0xda06('0x13')](handleEntityNotFound(_0x55513b,null))[_0xda06('0x13')](removeEntity(_0x55513b,null))['catch'](handleError(_0x55513b,null));};exports['describe']=function(_0xbf80cc,_0x37695a){return db['MailMessage'][_0xda06('0x45')]()['then'](respondWithResult(_0x37695a,null))[_0xda06('0x40')](handleError(_0x37695a,null));};exports[_0xda06('0x46')]=function(_0x83eb8c,_0xe16b2e){return db[_0xda06('0x27')][_0xda06('0x46')](_0x83eb8c[_0xda06('0x43')])[_0xda06('0x13')](function(_0x364b5f){if(_0x364b5f){if(_0x364b5f[_0xda06('0x47')]===_0xda06('0x48')&&!_0x364b5f['secret']){var _0x25c2c4,_0x4200c2,_0x1b3ba3;if(_0x83eb8c[_0xda06('0x43')]['to']){_0x4200c2=_0x83eb8c[_0xda06('0x43')]['to']['split'](',')[0x0];}return db[_0xda06('0x49')][_0xda06('0x4a')]({'where':{'id':_0x364b5f[_0xda06('0x4b')]},'include':[{'model':db[_0xda06('0x4c')],'as':_0xda06('0x4d'),'include':[{'model':db[_0xda06('0x4e')],'as':_0xda06('0x4f'),'where':{'email':_0x4200c2},'limit':0x1,'order':[[_0xda06('0x50'),_0xda06('0x51')]]}]},{'model':db[_0xda06('0x52')],'as':_0xda06('0x53'),'raw':!![],'include':[{'model':db[_0xda06('0x54')],'as':'CloudProvider','raw':!![]}]}]})[_0xda06('0x13')](function(_0x16cc75){_0x25c2c4=_0x16cc75;if(!_0x25c2c4||!_0x25c2c4[_0xda06('0x53')])return;var _0x3f9753=_0x25c2c4[_0xda06('0x55')]();if(_0x83eb8c[_0xda06('0x43')]['attachments']&&_0x83eb8c[_0xda06('0x43')][_0xda06('0x56')][_0xda06('0x33')]){for(var _0x5a2f0c=0x0;_0x5a2f0c<_0x83eb8c[_0xda06('0x43')][_0xda06('0x56')][_0xda06('0x33')];_0x5a2f0c+=0x1){_0x83eb8c[_0xda06('0x43')][_0xda06('0x56')][_0x5a2f0c]={'filename':_0x83eb8c[_0xda06('0x43')]['attachments'][_0x5a2f0c][_0xda06('0x2d')],'path':path[_0xda06('0x57')](config[_0xda06('0x58')],_0xda06('0x59'),_0x83eb8c['body'][_0xda06('0x56')][_0x5a2f0c][_0xda06('0x5a')])};}}_0x1b3ba3={'account':_0x3f9753,'message':_0x83eb8c['body']};return;})[_0xda06('0x13')](function(){if(_0x25c2c4[_0xda06('0x4d')]){if(_0x25c2c4[_0xda06('0x4d')][_0xda06('0x4f')][_0xda06('0x33')]){return _0x25c2c4[_0xda06('0x4d')]['Contacts'][0x0];}else{return db[_0xda06('0x4e')][_0xda06('0x46')](_[_0xda06('0xb')](_0x83eb8c['body'],{'firstName':_0x83eb8c['body']['to'],'email':_0x83eb8c[_0xda06('0x43')]['to'],'phone':_0x83eb8c[_0xda06('0x43')]['to'],'ListId':_0x25c2c4['ListId']}));}}else{throw new Error(_0xda06('0x5b'));}})[_0xda06('0x13')](function(){if(_0x1b3ba3){return respondWithRpcPromise(_0xda06('0x5c'),'sendMail',_0x1b3ba3,client9003)[_0xda06('0x13')](function(_0x4b2bfa){return _0x364b5f[_0xda06('0x20')]({'read':!![],'messageId':_0x4b2bfa['messageId'],'sentAt':moment()['format'](_0xda06('0x5d'))});})[_0xda06('0x40')](function(_0x385b20){logger[_0xda06('0x18')]('%s',JSON[_0xda06('0x5e')](_0x385b20));return _0x364b5f;});}return _0x364b5f;});}return _0x364b5f;}})[_0xda06('0x13')](respondWithResult(_0xe16b2e,0xc9))['catch'](handleError(_0xe16b2e,null));};exports[_0xda06('0x5f')]=function(_0x2e8091,_0x24c344){var _0x16d82b={'agent':{},'channel':_0xda06('0x60')};if(_0x2e8091[_0xda06('0x43')]['id']){delete _0x2e8091[_0xda06('0x43')]['id'];}_0x2e8091['body']['read']=!![];_0x2e8091[_0xda06('0x43')][_0xda06('0x61')]=moment()[_0xda06('0x62')](_0xda06('0x5d'));_0x2e8091['body']['UserId']=_0x2e8091[_0xda06('0x43')][_0xda06('0x63')]||_0x2e8091[_0xda06('0x64')]['id'];_0x16d82b[_0xda06('0x65')]['id']=_0x2e8091[_0xda06('0x43')][_0xda06('0x63')];return db['MailMessage']['find']({'where':{'id':_0x2e8091[_0xda06('0x41')]['id'],'UserId':null}})[_0xda06('0x13')](handleEntityNotFound(_0x24c344,null))[_0xda06('0x13')](saveUpdates(_0x2e8091[_0xda06('0x43')],null))['then'](function(_0x56402a){if(_0x56402a){_0x16d82b['message']=_0x56402a[_0xda06('0x66')]({'plain':!![]});return db[_0xda06('0x67')][_0xda06('0x44')]({'where':{'id':_0x56402a['MailInteractionId']}});}return null;})[_0xda06('0x13')](handleEntityNotFound(_0x24c344,null))[_0xda06('0x13')](function(_0x3a991f){if(_0x3a991f){return _0x3a991f[_0xda06('0x20')]({'UserId':_0x2e8091[_0xda06('0x43')]['UserId'],'read1stAt':_[_0xda06('0x68')](_0x3a991f[_0xda06('0x69')])?moment()[_0xda06('0x62')](_0xda06('0x5d')):undefined});}return null;})[_0xda06('0x13')](function(_0xf7f9be){if(_0xf7f9be){_0x16d82b[_0xda06('0x6a')]=_0xf7f9be['get']({'plain':!![]});interaction_log[_0xda06('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e8091[_0xda06('0x64')]['id'],_0x2e8091[_0xda06('0x64')]['name'],_0x2e8091[_0xda06('0x64')][_0xda06('0x6b')],_0x16d82b[_0xda06('0x6a')]['id'],_0x2e8091[_0xda06('0x43')]?JSON[_0xda06('0x5e')](_0x2e8091[_0xda06('0x43')]):_0xda06('0x6c'));return respondWithRpcPromise(_0xda06('0x6d'),_0xda06('0x6e'),_0x16d82b);}return null;})['then'](function(_0x13746d){var _0x273ebc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13746d[_0xda06('0x19')][_0xda06('0x6f')];return db['sequelize'][_0xda06('0x2e')](_0x273ebc,{'type':db[_0xda06('0x70')]['QueryTypes'][_0xda06('0x71')],'raw':!![]})[_0xda06('0x13')](function(_0x13d483){return _0x13d483;});})[_0xda06('0x13')](function(_0x3dac7a){if(_0x3dac7a){_0x16d82b[_0xda06('0x19')][_0xda06('0x72')]=_0x3dac7a[0x0];if(!_0x2e8091[_0xda06('0x43')]['UserId'])return;return db[_0xda06('0x73')][_0xda06('0x44')]({'where':{'id':_0x2e8091[_0xda06('0x43')][_0xda06('0x63')],'role':_0xda06('0x65')},'attributes':['id',_0xda06('0x2d'),_0xda06('0x74'),_0xda06('0x75'),_0xda06('0x76')],'raw':!![]});}return null;})[_0xda06('0x13')](function(_0x2c9b6a){if(!_0x2c9b6a)return null;_0x16d82b[_0xda06('0x19')][_0xda06('0x65')]=_0x2c9b6a;return _0x16d82b;})[_0xda06('0x13')](function(_0x4695f5){if(_0x4695f5){if(_0x2e8091[_0xda06('0x43')][_0xda06('0x77')]){_0x16d82b['message']['interface']=util[_0xda06('0x62')]('SIP/%s',_0x2e8091[_0xda06('0x64')][_0xda06('0x2d')]);_0x16d82b[_0xda06('0x19')][_0xda06('0x78')]=_0x16d82b[_0xda06('0x78')];_0x16d82b['message']['motionChannel']=_0x16d82b[_0xda06('0x78')];_0x16d82b[_0xda06('0x19')][_0xda06('0x79')]=_0xda06('0x5f');_0x16d82b[_0xda06('0x19')][_0xda06('0x43')]=htmlToText[_0xda06('0x7a')](_0x16d82b['message'][_0xda06('0x43')]);return respondWithRpcPromise(_0xda06('0x7b'),_0xda06('0x7b'),{'event':'acceptmessage','message':_0x16d82b[_0xda06('0x19')]},client9002)[_0xda06('0x13')](function(){return _0x16d82b;});}return _0x16d82b;}return null;})[_0xda06('0x13')](respondWithResult(_0x24c344,null))[_0xda06('0x40')](handleError(_0x24c344,null));};exports[_0xda06('0x7c')]=function(_0xb6afe,_0x4deaf8){var _0x10357d={'agent':{},'channel':_0xda06('0x60')};if(_0xb6afe[_0xda06('0x43')]['id']){delete _0xb6afe[_0xda06('0x43')]['id'];}_0xb6afe[_0xda06('0x43')][_0xda06('0x63')]=_0xb6afe[_0xda06('0x43')]['UserId']||_0xb6afe['user']['id'];_0x10357d[_0xda06('0x65')]['id']=_0xb6afe[_0xda06('0x43')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0xb6afe['params']['id'],'UserId':null}})[_0xda06('0x13')](handleEntityNotFound(_0x4deaf8,null))['then'](function(_0x52aa71){if(_0x52aa71){_0x10357d[_0xda06('0x19')]=_0x52aa71[_0xda06('0x66')]({'plain':!![]});return db[_0xda06('0x67')][_0xda06('0x44')]({'where':{'id':_0x52aa71[_0xda06('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x4deaf8,null))[_0xda06('0x13')](function(_0x2f72c7){if(_0x2f72c7){_0x10357d[_0xda06('0x6a')]=_0x2f72c7[_0xda06('0x66')]({'plain':!![]});interaction_log[_0xda06('0x14')](_0xda06('0x7e'),_0xb6afe[_0xda06('0x64')]['id'],_0xb6afe['user'][_0xda06('0x2d')],_0xb6afe[_0xda06('0x64')][_0xda06('0x6b')],_0x10357d[_0xda06('0x6a')]['id'],_0xb6afe['body']?JSON[_0xda06('0x5e')](_0xb6afe['body']):_0xda06('0x6c'));return respondWithRpcPromise(_0xda06('0x7f'),'rejectMessage',_0x10357d);}return null;})['then'](function(_0x3f7f0c){var _0x1cb98b=_0xda06('0x80')+_0x3f7f0c[_0xda06('0x19')][_0xda06('0x6f')];return db[_0xda06('0x81')][_0xda06('0x2e')](_0x1cb98b,{'type':db[_0xda06('0x70')][_0xda06('0x82')][_0xda06('0x71')],'raw':!![]})[_0xda06('0x13')](function(_0x5c3d60){return _0x5c3d60;});})[_0xda06('0x13')](function(_0x4438c7){if(_0x4438c7){_0x10357d['message'][_0xda06('0x72')]=_0x4438c7[0x0];if(!_0xb6afe[_0xda06('0x43')][_0xda06('0x63')])return;return db['User']['find']({'where':{'id':_0xb6afe[_0xda06('0x43')][_0xda06('0x63')],'role':_0xda06('0x65')},'attributes':['id',_0xda06('0x2d'),_0xda06('0x74'),_0xda06('0x75'),_0xda06('0x76')],'raw':!![]});}return null;})['then'](function(_0xcfbcf3){if(!_0xcfbcf3)return null;_0x10357d[_0xda06('0x19')][_0xda06('0x65')]=_0xcfbcf3;return _0x10357d;})['then'](function(_0x330544){if(_0x330544){_0x330544[_0xda06('0x19')][_0xda06('0x83')]=util[_0xda06('0x62')]('SIP/%s',_0xb6afe[_0xda06('0x64')]['name']);_0x330544[_0xda06('0x19')][_0xda06('0x78')]=_0x10357d[_0xda06('0x78')];_0x330544[_0xda06('0x19')][_0xda06('0x84')]=_0x10357d[_0xda06('0x78')];_0x330544['message'][_0xda06('0x79')]=_0xda06('0x7c');_0x330544[_0xda06('0x19')][_0xda06('0x43')]=htmlToText['fromString'](_0x10357d[_0xda06('0x19')][_0xda06('0x43')]);respondWithRpcPromise(_0xda06('0x7b'),_0xda06('0x7b'),{'event':'rejectmessage','message':_0x330544[_0xda06('0x19')]},client9002);return _0x10357d;}return null;})[_0xda06('0x13')](respondWithResult(_0x4deaf8,null))['catch'](handleError(_0x4deaf8,null));};exports[_0xda06('0x85')]=function(_0x2d30b2,_0x7c9af8){var _0x547a3a=moment()[_0xda06('0x86')]()[_0xda06('0x87')]();var _0x540eb0=path[_0xda06('0x57')](config[_0xda06('0x58')],'server',_0xda06('0x88'),_0xda06('0x89'));var _0x1bd96d=path[_0xda06('0x57')](config['root'],'server',_0xda06('0x88'),'attachments');var _0x1fdb52=util[_0xda06('0x62')](_0xda06('0x8a'),_0x547a3a);return db[_0xda06('0x27')][_0xda06('0x44')]({'where':{'id':_0x2d30b2[_0xda06('0x41')]['id']},'attributes':['id',_0xda06('0x43'),_0xda06('0x8b'),'to','cc',_0xda06('0x8c'),_0xda06('0x8d'),_0xda06('0x8e')],'include':_0x2d30b2[_0xda06('0x2e')]['attachments']?[{'model':db[_0xda06('0x8f')],'as':_0xda06('0x90')}]:undefined})[_0xda06('0x13')](handleEntityNotFound(_0x7c9af8,null))[_0xda06('0x13')](function(_0x25c453){if(_0x25c453){var _0x29af54=_0x25c453;var _0x5183d9={'from':_0x29af54['from'],'to':_0x29af54['to'],'subject':_0x29af54[_0xda06('0x8d')],'html':htmlEntities[_0xda06('0x91')](_0x29af54['body']),'headers':{'Date':moment(_0x29af54[_0xda06('0x8e')])['format'](_0xda06('0x92'))},'attachments':[]};if(_0x25c453['cc']){_0x5183d9[_0xda06('0x93')]['Cc']=_0x25c453['cc'];}if(_0x25c453[_0xda06('0x8c')]){_0x5183d9['headers']['Bcc']=_0x25c453[_0xda06('0x8c')];}return new BPromise(function(_0x857778,_0x50443){if(_0x25c453[_0xda06('0x90')]){for(var _0x4050b3=0x0;_0x4050b3<_0x25c453[_0xda06('0x90')][_0xda06('0x33')];_0x4050b3++){var _0x4d06a3=_0x25c453[_0xda06('0x90')][_0x4050b3];var _0x5465e9=path['join'](_0x1bd96d,_0x4d06a3['basename']);if(fs[_0xda06('0x94')](_0x5465e9)){_0x5183d9['attachments'][_0xda06('0x95')]({'name':_0x4d06a3[_0xda06('0x2d')],'contentType':_0x4d06a3['type'],'data':fs['readFileSync'](_0x5465e9)});}}}emlformat[_0xda06('0x96')](_0x5183d9,function(_0x1ac96d,_0x5ba7f9){if(_0x1ac96d)return _0x50443(_0x1ac96d);fs['writeFileSync'](path['join'](_0x540eb0,_0x1fdb52),_0x5ba7f9);return _0x857778(_0x5ba7f9);});});}})[_0xda06('0x13')](function(_0x6938de){if(_0x6938de){return _0x7c9af8[_0xda06('0x85')](path[_0xda06('0x57')](_0x540eb0,_0x1fdb52),_0x1fdb52,function(_0x16bec5){if(!_0x16bec5)fs[_0xda06('0x97')](path['join'](_0x540eb0,_0x1fdb52));});}})['catch'](handleError(_0x7c9af8,null));};
\ No newline at end of file
+var _0x10ee=['mail-interactions','../../config/environment','defaults','localhost','redis','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','json','undefined','limit','count','offset','set','update','destroy','status','end','stack','name','send','index','map','MailMessage','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','body','params','describe','create','out','secret','split','findOne','MailAccountId','List','Contacts','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','fromString','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','email','EventManager','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','Attachment','Attachments','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0x10ee,0x1d1));var _0xe10e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x10ee[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require('eml-format');var moment=require(_0xe10e('0x0'));var BPromise=require(_0xe10e('0x1'));var util=require('util');var path=require(_0xe10e('0x2'));var fs=require('fs');var _=require(_0xe10e('0x3'));var Redis=require(_0xe10e('0x4'));var htmlToText=require(_0xe10e('0x5'));var qs=require(_0xe10e('0x6'));var logger=require(_0xe10e('0x7'))(_0xe10e('0x8'));var interaction_log=require(_0xe10e('0x7'))(_0xe10e('0x9'));var config=require(_0xe10e('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe10e('0xb')](config['redis'],{'host':_0xe10e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe10e('0xd')]));var htmlEntities=require('html-entities');require(_0xe10e('0xe'))[_0xe10e('0xf')](socket);var jayson=require(_0xe10e('0x10'));var client=jayson[_0xe10e('0x11')][_0xe10e('0x12')]({'port':0x232c});var client9003=jayson[_0xe10e('0x11')]['http']({'port':0x232b});var client9002=jayson['client'][_0xe10e('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x3eb887,_0x5bcce7,_0x4d67c3,_0x2c83f0){return new BPromise(function(_0x1d28bd,_0x279965){var _0x2190a9=_0x2c83f0||client;return _0x2190a9[_0xe10e('0x13')](_0x3eb887,_0x4d67c3)[_0xe10e('0x14')](function(_0x18e775){logger[_0xe10e('0x15')](_0xe10e('0x16'),_0x5bcce7,_0xe10e('0x17'));logger[_0xe10e('0x18')](_0xe10e('0x19'),_0x5bcce7,_0xe10e('0x17'),JSON['stringify'](_0x18e775));if(_0x18e775['error']){if(_0x18e775[_0xe10e('0x1a')][_0xe10e('0x1b')]===0x1f4){logger[_0xe10e('0x1a')](_0xe10e('0x16'),_0x5bcce7,_0x18e775[_0xe10e('0x1a')][_0xe10e('0x1c')]);return _0x279965(_0x18e775['error'][_0xe10e('0x1c')]);}logger['error'](_0xe10e('0x16'),_0x5bcce7,_0x18e775['error'][_0xe10e('0x1c')]);return _0x1d28bd(_0x18e775['error'][_0xe10e('0x1c')]);}else{logger[_0xe10e('0x15')](_0xe10e('0x16'),_0x5bcce7,_0xe10e('0x17'));_0x1d28bd(_0x18e775[_0xe10e('0x1d')][_0xe10e('0x1c')]);}})['catch'](function(_0x2c7879){logger['error'](_0xe10e('0x16'),_0x5bcce7,_0x2c7879);_0x279965(_0x2c7879);});});}function respondWithResult(_0x2f4be9,_0x1147f5){_0x1147f5=_0x1147f5||0xc8;return function(_0x26044f){if(_0x26044f){return _0x2f4be9['status'](_0x1147f5)[_0xe10e('0x1e')](_0x26044f);}};}function respondWithFilteredResult(_0x21ccb3,_0x465b68){return function(_0x1237fc){if(_0x1237fc){var _0x401852=typeof _0x465b68['offset']===_0xe10e('0x1f')&&typeof _0x465b68[_0xe10e('0x20')]===_0xe10e('0x1f');var _0x475477=_0x1237fc[_0xe10e('0x21')];var _0x553aff=_0x401852?0x0:_0x465b68[_0xe10e('0x22')];var _0x145cd8=_0x401852?_0x1237fc[_0xe10e('0x21')]:_0x465b68[_0xe10e('0x22')]+_0x465b68[_0xe10e('0x20')];var _0x2b0ae4;if(_0x145cd8>=_0x475477){_0x145cd8=_0x475477;_0x2b0ae4=0xc8;}else{_0x2b0ae4=0xce;}_0x21ccb3['status'](_0x2b0ae4);return _0x21ccb3[_0xe10e('0x23')]('Content-Range',_0x553aff+'-'+_0x145cd8+'/'+_0x475477)[_0xe10e('0x1e')](_0x1237fc);}return null;};}function saveUpdates(_0x5bfbaa){return function(_0x2a7002){if(_0x2a7002){return _0x2a7002[_0xe10e('0x24')](_0x5bfbaa)[_0xe10e('0x14')](function(_0x39fe49){return _0x39fe49;});}return null;};}function removeEntity(_0x37194b){return function(_0x13cddf){if(_0x13cddf){return _0x13cddf[_0xe10e('0x25')]()[_0xe10e('0x14')](function(){_0x37194b[_0xe10e('0x26')](0xcc)[_0xe10e('0x27')]();});}};}function handleEntityNotFound(_0x5deb27){return function(_0x1cb1ac){if(!_0x1cb1ac){_0x5deb27['sendStatus'](0x194);}return _0x1cb1ac;};}function handleError(_0x285793,_0x409e73){_0x409e73=_0x409e73||0x1f4;return function(_0x207c7e){logger[_0xe10e('0x1a')](_0x207c7e[_0xe10e('0x28')]);if(_0x207c7e['name']){delete _0x207c7e[_0xe10e('0x29')];}_0x285793[_0xe10e('0x26')](_0x409e73)[_0xe10e('0x2a')](_0x207c7e);};}exports[_0xe10e('0x2b')]=function(_0x2b8342,_0x36e605){var _0x80497c={},_0x18398e={},_0x2b4df2={'count':0x0,'rows':[]};var _0x17d991=_[_0xe10e('0x2c')](db[_0xe10e('0x2d')][_0xe10e('0x2e')],function(_0x2aae34){return{'name':_0x2aae34['fieldName'],'type':_0x2aae34[_0xe10e('0x2f')]['key']};});_0x18398e[_0xe10e('0x30')]=_[_0xe10e('0x2c')](_0x17d991,'name');_0x18398e[_0xe10e('0x31')]=_['keys'](_0x2b8342[_0xe10e('0x31')]);_0x18398e['filters']=_[_0xe10e('0x32')](_0x18398e['model'],_0x18398e[_0xe10e('0x31')]);_0x80497c[_0xe10e('0x33')]=_['intersection'](_0x18398e[_0xe10e('0x30')],qs[_0xe10e('0x34')](_0x2b8342[_0xe10e('0x31')][_0xe10e('0x34')]));_0x80497c[_0xe10e('0x33')]=_0x80497c[_0xe10e('0x33')][_0xe10e('0x35')]?_0x80497c[_0xe10e('0x33')]:_0x18398e[_0xe10e('0x30')];if(!_0x2b8342[_0xe10e('0x31')][_0xe10e('0x36')](_0xe10e('0x37'))){_0x80497c['limit']=qs[_0xe10e('0x20')](_0x2b8342['query'][_0xe10e('0x20')]);_0x80497c[_0xe10e('0x22')]=qs['offset'](_0x2b8342[_0xe10e('0x31')][_0xe10e('0x22')]);}_0x80497c[_0xe10e('0x38')]=qs[_0xe10e('0x39')](_0x2b8342[_0xe10e('0x31')][_0xe10e('0x39')]);_0x80497c['where']=qs[_0xe10e('0x3a')](_['pick'](_0x2b8342[_0xe10e('0x31')],_0x18398e[_0xe10e('0x3a')]),_0x17d991);if(_0x2b8342[_0xe10e('0x31')][_0xe10e('0x3b')]){_0x80497c[_0xe10e('0x3c')]=_['merge'](_0x80497c[_0xe10e('0x3c')],{'$or':_[_0xe10e('0x2c')](_0x17d991,function(_0x253919){if(_0x253919['type']!==_0xe10e('0x3d')){var _0xde36c9={};_0xde36c9[_0x253919[_0xe10e('0x29')]]={'$like':'%'+_0x2b8342[_0xe10e('0x31')][_0xe10e('0x3b')]+'%'};return _0xde36c9;}})});}_0x80497c=_[_0xe10e('0x3e')]({},_0x80497c,_0x2b8342[_0xe10e('0x3f')]);var _0x1b92e8={'where':_0x80497c[_0xe10e('0x3c')]};return db[_0xe10e('0x2d')][_0xe10e('0x21')](_0x1b92e8)[_0xe10e('0x14')](function(_0x28d3d0){_0x2b4df2[_0xe10e('0x21')]=_0x28d3d0;if(_0x2b8342[_0xe10e('0x31')][_0xe10e('0x40')]){_0x80497c['include']=[{'all':!![]}];}return db[_0xe10e('0x2d')][_0xe10e('0x41')](_0x80497c);})[_0xe10e('0x14')](function(_0x569d4f){_0x2b4df2[_0xe10e('0x42')]=_0x569d4f;return _0x2b4df2;})['then'](respondWithFilteredResult(_0x36e605,_0x80497c))[_0xe10e('0x43')](handleError(_0x36e605,null));};exports[_0xe10e('0x44')]=function(_0x25079e,_0xbbf048){var _0x45c0b5={'raw':!![],'where':{'id':_0x25079e['params']['id']}},_0x2eb782={};_0x2eb782[_0xe10e('0x30')]=_['keys'](db['MailMessage'][_0xe10e('0x2e')]);_0x2eb782['query']=_[_0xe10e('0x45')](_0x25079e[_0xe10e('0x31')]);_0x2eb782[_0xe10e('0x3a')]=_[_0xe10e('0x32')](_0x2eb782[_0xe10e('0x30')],_0x2eb782[_0xe10e('0x31')]);_0x45c0b5['attributes']=_[_0xe10e('0x32')](_0x2eb782[_0xe10e('0x30')],qs['fields'](_0x25079e[_0xe10e('0x31')][_0xe10e('0x34')]));_0x45c0b5[_0xe10e('0x33')]=_0x45c0b5[_0xe10e('0x33')][_0xe10e('0x35')]?_0x45c0b5[_0xe10e('0x33')]:_0x2eb782[_0xe10e('0x30')];if(_0x25079e[_0xe10e('0x31')][_0xe10e('0x40')]){_0x45c0b5[_0xe10e('0x46')]=[{'all':!![]}];}_0x45c0b5=_[_0xe10e('0x3e')]({},_0x45c0b5,_0x25079e[_0xe10e('0x3f')]);return db[_0xe10e('0x2d')][_0xe10e('0x47')](_0x45c0b5)[_0xe10e('0x14')](handleEntityNotFound(_0xbbf048,null))[_0xe10e('0x14')](respondWithResult(_0xbbf048,null))[_0xe10e('0x43')](handleError(_0xbbf048,null));};exports['update']=function(_0x3eb742,_0x2abb3d){if(_0x3eb742[_0xe10e('0x48')]['id']){delete _0x3eb742[_0xe10e('0x48')]['id'];}return db['MailMessage'][_0xe10e('0x47')]({'where':{'id':_0x3eb742[_0xe10e('0x49')]['id']}})[_0xe10e('0x14')](handleEntityNotFound(_0x2abb3d,null))[_0xe10e('0x14')](saveUpdates(_0x3eb742[_0xe10e('0x48')],null))[_0xe10e('0x14')](respondWithResult(_0x2abb3d,null))['catch'](handleError(_0x2abb3d,null));};exports[_0xe10e('0x25')]=function(_0x10d934,_0x504935){return db['MailMessage'][_0xe10e('0x47')]({'where':{'id':_0x10d934[_0xe10e('0x49')]['id']}})['then'](handleEntityNotFound(_0x504935,null))[_0xe10e('0x14')](removeEntity(_0x504935,null))[_0xe10e('0x43')](handleError(_0x504935,null));};exports[_0xe10e('0x4a')]=function(_0x37df9a,_0x441330){return db[_0xe10e('0x2d')]['describe']()[_0xe10e('0x14')](respondWithResult(_0x441330,null))[_0xe10e('0x43')](handleError(_0x441330,null));};exports[_0xe10e('0x4b')]=function(_0x598384,_0x3bdeac){return db[_0xe10e('0x2d')]['create'](_0x598384[_0xe10e('0x48')])['then'](function(_0x24309c){if(_0x24309c){if(_0x24309c['direction']===_0xe10e('0x4c')&&!_0x24309c[_0xe10e('0x4d')]){var _0x10879b,_0xd47885,_0x259d54;if(_0x598384[_0xe10e('0x48')]['to']){_0xd47885=_0x598384[_0xe10e('0x48')]['to'][_0xe10e('0x4e')](',')[0x0];}return db['MailAccount'][_0xe10e('0x4f')]({'where':{'id':_0x24309c[_0xe10e('0x50')]},'include':[{'model':db['CmList'],'as':_0xe10e('0x51'),'include':[{'model':db['CmContact'],'as':_0xe10e('0x52'),'where':{'email':_0xd47885},'limit':0x1,'order':[['updatedAt',_0xe10e('0x53')]]}]},{'model':db[_0xe10e('0x54')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe10e('0x55'),'raw':!![]}]}]})[_0xe10e('0x14')](function(_0x3c6b0d){_0x10879b=_0x3c6b0d;if(!_0x10879b||!_0x10879b[_0xe10e('0x56')])return;var _0x45b50f=_0x10879b[_0xe10e('0x57')]();if(_0x598384[_0xe10e('0x48')][_0xe10e('0x58')]&&_0x598384['body'][_0xe10e('0x58')]['length']){for(var _0x5c0679=0x0;_0x5c0679<_0x598384['body'][_0xe10e('0x58')][_0xe10e('0x35')];_0x5c0679+=0x1){_0x598384[_0xe10e('0x48')][_0xe10e('0x58')][_0x5c0679]={'filename':_0x598384['body'][_0xe10e('0x58')][_0x5c0679][_0xe10e('0x29')],'path':path[_0xe10e('0x59')](config[_0xe10e('0x5a')],_0xe10e('0x5b'),_0x598384[_0xe10e('0x48')][_0xe10e('0x58')][_0x5c0679][_0xe10e('0x5c')])};}}_0x259d54={'account':_0x45b50f,'message':_0x598384['body']};return;})[_0xe10e('0x14')](function(){if(_0x10879b['List']){if(_0x10879b[_0xe10e('0x51')][_0xe10e('0x52')][_0xe10e('0x35')]){return _0x10879b[_0xe10e('0x51')][_0xe10e('0x52')][0x0];}else{return db[_0xe10e('0x5d')][_0xe10e('0x4b')](_[_0xe10e('0xb')](_0x598384[_0xe10e('0x48')],{'firstName':_0x598384[_0xe10e('0x48')]['to'],'email':_0x598384[_0xe10e('0x48')]['to'],'phone':_0x598384[_0xe10e('0x48')]['to'],'ListId':_0x10879b['ListId']}));}}else{throw new Error(_0xe10e('0x5e'));}})[_0xe10e('0x14')](function(){if(_0x259d54){return respondWithRpcPromise(_0xe10e('0x5f'),'sendMail',_0x259d54,client9003)['then'](function(_0x5b5f7d){return _0x24309c[_0xe10e('0x24')]({'read':!![],'messageId':_0x5b5f7d[_0xe10e('0x60')],'sentAt':moment()[_0xe10e('0x61')](_0xe10e('0x62'))});})['catch'](function(_0x4c6a20){logger['error']('%s',JSON['stringify'](_0x4c6a20));return _0x24309c;});}return _0x24309c;});}return _0x24309c;}})[_0xe10e('0x14')](respondWithResult(_0x3bdeac,0xc9))[_0xe10e('0x43')](handleError(_0x3bdeac,null));};exports[_0xe10e('0x63')]=function(_0xcd32b7,_0x4fb772){var _0x1b6e13={'agent':{},'channel':'mail'};if(_0xcd32b7[_0xe10e('0x48')]['id']){delete _0xcd32b7[_0xe10e('0x48')]['id'];}_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x64')]=!![];_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x65')]=moment()[_0xe10e('0x61')](_0xe10e('0x62'));_0xcd32b7['body'][_0xe10e('0x66')]=_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x66')]||_0xcd32b7[_0xe10e('0x67')]['id'];_0x1b6e13[_0xe10e('0x68')]['id']=_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x66')];return db[_0xe10e('0x2d')][_0xe10e('0x47')]({'where':{'id':_0xcd32b7[_0xe10e('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4fb772,null))['then'](saveUpdates(_0xcd32b7[_0xe10e('0x48')],null))[_0xe10e('0x14')](function(_0x244d52){if(_0x244d52){_0x1b6e13[_0xe10e('0x1c')]=_0x244d52[_0xe10e('0x69')]({'plain':!![]});return db[_0xe10e('0x6a')][_0xe10e('0x47')]({'where':{'id':_0x244d52[_0xe10e('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x4fb772,null))[_0xe10e('0x14')](function(_0x2f24b6){if(_0x2f24b6){return _0x2f24b6['update']({'UserId':_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x66')],'read1stAt':_['isNil'](_0x2f24b6['read1stAt'])?moment()[_0xe10e('0x61')](_0xe10e('0x62')):undefined});}return null;})[_0xe10e('0x14')](function(_0x4860f0){if(_0x4860f0){_0x1b6e13['interaction']=_0x4860f0[_0xe10e('0x69')]({'plain':!![]});interaction_log['info'](_0xe10e('0x6c'),_0xcd32b7[_0xe10e('0x67')]['id'],_0xcd32b7[_0xe10e('0x67')][_0xe10e('0x29')],_0xcd32b7['user'][_0xe10e('0x6d')],_0x1b6e13[_0xe10e('0x6e')]['id'],_0xcd32b7[_0xe10e('0x48')]?JSON[_0xe10e('0x6f')](_0xcd32b7[_0xe10e('0x48')]):_0xe10e('0x70'));return respondWithRpcPromise('AcceptMessage',_0xe10e('0x71'),_0x1b6e13);}return null;})[_0xe10e('0x14')](function(_0x5e0ef3){var _0x1238f8=_0xe10e('0x72')+_0x5e0ef3[_0xe10e('0x1c')]['ContactId'];return db['sequelize'][_0xe10e('0x31')](_0x1238f8,{'type':db[_0xe10e('0x73')][_0xe10e('0x74')][_0xe10e('0x75')],'raw':!![]})[_0xe10e('0x14')](function(_0x44a66d){return _0x44a66d;});})[_0xe10e('0x14')](function(_0x1225f9){if(_0x1225f9){_0x1b6e13[_0xe10e('0x1c')]['contact']=_0x1225f9[0x0];if(!_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x66')])return;return db[_0xe10e('0x76')][_0xe10e('0x47')]({'where':{'id':_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x66')],'role':'agent'},'attributes':['id',_0xe10e('0x29'),_0xe10e('0x77'),'email','internal'],'raw':!![]});}return null;})[_0xe10e('0x14')](function(_0x37f743){if(!_0x37f743)return null;_0x1b6e13[_0xe10e('0x1c')][_0xe10e('0x68')]=_0x37f743;return _0x1b6e13;})['then'](function(_0x1476e1){if(_0x1476e1){if(_0xcd32b7[_0xe10e('0x48')][_0xe10e('0x78')]){_0x1b6e13[_0xe10e('0x1c')][_0xe10e('0x79')]=util['format'](_0xe10e('0x7a'),_0xcd32b7[_0xe10e('0x67')][_0xe10e('0x29')]);_0x1b6e13[_0xe10e('0x1c')][_0xe10e('0x7b')]=_0x1b6e13[_0xe10e('0x7b')];_0x1b6e13[_0xe10e('0x1c')][_0xe10e('0x7c')]=_0x1b6e13[_0xe10e('0x7b')];_0x1b6e13['message'][_0xe10e('0x7d')]=_0xe10e('0x63');_0x1b6e13[_0xe10e('0x1c')][_0xe10e('0x48')]=htmlToText[_0xe10e('0x7e')](_0x1b6e13[_0xe10e('0x1c')]['body']);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xe10e('0x7f'),'message':_0x1b6e13[_0xe10e('0x1c')]},client9002)[_0xe10e('0x14')](function(){return _0x1b6e13;});}return _0x1b6e13;}return null;})[_0xe10e('0x14')](respondWithResult(_0x4fb772,null))[_0xe10e('0x43')](handleError(_0x4fb772,null));};exports[_0xe10e('0x80')]=function(_0x2d6d5e,_0xf8c121){var _0x3b6811={'agent':{},'channel':'mail'};if(_0x2d6d5e[_0xe10e('0x48')]['id']){delete _0x2d6d5e[_0xe10e('0x48')]['id'];}_0x2d6d5e[_0xe10e('0x48')][_0xe10e('0x66')]=_0x2d6d5e['body']['UserId']||_0x2d6d5e[_0xe10e('0x67')]['id'];_0x3b6811[_0xe10e('0x68')]['id']=_0x2d6d5e['body'][_0xe10e('0x66')];return db[_0xe10e('0x2d')][_0xe10e('0x47')]({'where':{'id':_0x2d6d5e[_0xe10e('0x49')]['id'],'UserId':null}})[_0xe10e('0x14')](handleEntityNotFound(_0xf8c121,null))['then'](function(_0x31a039){if(_0x31a039){_0x3b6811['message']=_0x31a039[_0xe10e('0x69')]({'plain':!![]});return db[_0xe10e('0x6a')][_0xe10e('0x47')]({'where':{'id':_0x31a039['MailInteractionId']}});}return null;})[_0xe10e('0x14')](handleEntityNotFound(_0xf8c121,null))[_0xe10e('0x14')](function(_0x153961){if(_0x153961){_0x3b6811[_0xe10e('0x6e')]=_0x153961[_0xe10e('0x69')]({'plain':!![]});interaction_log[_0xe10e('0x15')](_0xe10e('0x81'),_0x2d6d5e['user']['id'],_0x2d6d5e['user'][_0xe10e('0x29')],_0x2d6d5e[_0xe10e('0x67')][_0xe10e('0x6d')],_0x3b6811[_0xe10e('0x6e')]['id'],_0x2d6d5e['body']?JSON['stringify'](_0x2d6d5e[_0xe10e('0x48')]):_0xe10e('0x70'));return respondWithRpcPromise(_0xe10e('0x82'),_0xe10e('0x83'),_0x3b6811);}return null;})[_0xe10e('0x14')](function(_0x2bd160){var _0x363a4c=_0xe10e('0x72')+_0x2bd160[_0xe10e('0x1c')][_0xe10e('0x84')];return db[_0xe10e('0x85')]['query'](_0x363a4c,{'type':db['Sequelize'][_0xe10e('0x74')]['SELECT'],'raw':!![]})[_0xe10e('0x14')](function(_0x2ed17e){return _0x2ed17e;});})[_0xe10e('0x14')](function(_0x38ca0d){if(_0x38ca0d){_0x3b6811[_0xe10e('0x1c')]['contact']=_0x38ca0d[0x0];if(!_0x2d6d5e[_0xe10e('0x48')]['UserId'])return;return db[_0xe10e('0x76')][_0xe10e('0x47')]({'where':{'id':_0x2d6d5e[_0xe10e('0x48')]['UserId'],'role':_0xe10e('0x68')},'attributes':['id',_0xe10e('0x29'),_0xe10e('0x77'),_0xe10e('0x86'),'internal'],'raw':!![]});}return null;})[_0xe10e('0x14')](function(_0x47bf58){if(!_0x47bf58)return null;_0x3b6811[_0xe10e('0x1c')][_0xe10e('0x68')]=_0x47bf58;return _0x3b6811;})[_0xe10e('0x14')](function(_0x494110){if(_0x494110){_0x494110[_0xe10e('0x1c')][_0xe10e('0x79')]=util[_0xe10e('0x61')](_0xe10e('0x7a'),_0x2d6d5e[_0xe10e('0x67')][_0xe10e('0x29')]);_0x494110[_0xe10e('0x1c')][_0xe10e('0x7b')]=_0x3b6811[_0xe10e('0x7b')];_0x494110[_0xe10e('0x1c')][_0xe10e('0x7c')]=_0x3b6811[_0xe10e('0x7b')];_0x494110[_0xe10e('0x1c')][_0xe10e('0x7d')]='reject';_0x494110[_0xe10e('0x1c')][_0xe10e('0x48')]=htmlToText[_0xe10e('0x7e')](_0x3b6811[_0xe10e('0x1c')]['body']);respondWithRpcPromise(_0xe10e('0x87'),'EventManager',{'event':_0xe10e('0x88'),'message':_0x494110[_0xe10e('0x1c')]},client9002);return _0x3b6811;}return null;})[_0xe10e('0x14')](respondWithResult(_0xf8c121,null))[_0xe10e('0x43')](handleError(_0xf8c121,null));};exports[_0xe10e('0x89')]=function(_0x6f1690,_0x5b7eb2){var _0x5d366d=moment()[_0xe10e('0x8a')]()[_0xe10e('0x8b')]();var _0x1cfa93=path[_0xe10e('0x59')](config['root'],_0xe10e('0x8c'),_0xe10e('0x8d'),_0xe10e('0x8e'));var _0x56e35b=path[_0xe10e('0x59')](config['root'],_0xe10e('0x8c'),_0xe10e('0x8d'),_0xe10e('0x58'));var _0x234929=util[_0xe10e('0x61')](_0xe10e('0x8f'),_0x5d366d);return db[_0xe10e('0x2d')][_0xe10e('0x47')]({'where':{'id':_0x6f1690[_0xe10e('0x49')]['id']},'attributes':['id','body','from','to','cc',_0xe10e('0x90'),_0xe10e('0x91'),'createdAt'],'include':_0x6f1690[_0xe10e('0x31')][_0xe10e('0x58')]?[{'model':db[_0xe10e('0x92')],'as':_0xe10e('0x93')}]:undefined})[_0xe10e('0x14')](handleEntityNotFound(_0x5b7eb2,null))[_0xe10e('0x14')](function(_0x1803ac){if(_0x1803ac){var _0x1a8438=_0x1803ac;var _0x5c2a6e={'from':_0x1a8438[_0xe10e('0x94')],'to':_0x1a8438['to'],'subject':_0x1a8438[_0xe10e('0x91')],'html':htmlEntities[_0xe10e('0x95')](_0x1a8438[_0xe10e('0x48')]),'headers':{'Date':moment(_0x1a8438[_0xe10e('0x96')])[_0xe10e('0x61')](_0xe10e('0x97'))},'attachments':[]};if(_0x1803ac['cc']){_0x5c2a6e[_0xe10e('0x98')]['Cc']=_0x1803ac['cc'];}if(_0x1803ac[_0xe10e('0x90')]){_0x5c2a6e[_0xe10e('0x98')][_0xe10e('0x99')]=_0x1803ac['bcc'];}return new BPromise(function(_0xf47a96,_0xbfa220){if(_0x1803ac[_0xe10e('0x93')]){for(var _0x46a8f8=0x0;_0x46a8f8<_0x1803ac[_0xe10e('0x93')]['length'];_0x46a8f8++){var _0x3c2dc3=_0x1803ac[_0xe10e('0x93')][_0x46a8f8];var _0x2e7993=path[_0xe10e('0x59')](_0x56e35b,_0x3c2dc3['basename']);if(fs[_0xe10e('0x9a')](_0x2e7993)){_0x5c2a6e[_0xe10e('0x58')]['push']({'name':_0x3c2dc3['name'],'contentType':_0x3c2dc3['type'],'data':fs[_0xe10e('0x9b')](_0x2e7993)});}}}emlformat[_0xe10e('0x9c')](_0x5c2a6e,function(_0x3fe142,_0x188632){if(_0x3fe142)return _0xbfa220(_0x3fe142);fs[_0xe10e('0x9d')](path[_0xe10e('0x59')](_0x1cfa93,_0x234929),_0x188632);return _0xf47a96(_0x188632);});});}})[_0xe10e('0x14')](function(_0x1e9bfe){if(_0x1e9bfe){return _0x5b7eb2[_0xe10e('0x89')](path[_0xe10e('0x59')](_0x1cfa93,_0x234929),_0x234929,function(_0x13de35){if(!_0x13de35)fs['unlinkSync'](path[_0xe10e('0x59')](_0x1cfa93,_0x234929));});}})[_0xe10e('0x43')](handleError(_0x5b7eb2,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d38=['emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x348750,_0x34af3d){var _0x1a4563=function(_0x129a62){while(--_0x129a62){_0x348750['push'](_0x348750['shift']());}};_0x1a4563(++_0x34af3d);}(_0x4d38,0x13b));var _0x84d3=function(_0x4fab79,_0x4f76dc){_0x4fab79=_0x4fab79-0x0;var _0x31ec8e=_0x4d38[_0x4fab79];return _0x31ec8e;};'use strict';var EventEmitter=require(_0x84d3('0x0'));var MailMessage=require(_0x84d3('0x1'))['db'][_0x84d3('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x84d3('0x3')](0x0);var events={'afterCreate':_0x84d3('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x54036a){return function(_0x1f01cb,_0xc03d0e,_0x34678b){MailMessageEvents[_0x84d3('0x5')](_0x54036a+':'+_0x1f01cb['id'],_0x1f01cb);MailMessageEvents['emit'](_0x54036a,_0x1f01cb);_0x34678b(null);};}for(var e in events){if(events[_0x84d3('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x84d3('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0x90f1=['remove','emit','hasOwnProperty','hook','exports','events','MailMessage','save','update'];(function(_0xaf0996,_0x3ee642){var _0x8fde5a=function(_0x130dc7){while(--_0x130dc7){_0xaf0996['push'](_0xaf0996['shift']());}};_0x8fde5a(++_0x3ee642);}(_0x90f1,0x95));var _0x190f=function(_0x2cc08d,_0xc1bee2){_0x2cc08d=_0x2cc08d-0x0;var _0x2c52e=_0x90f1[_0x2cc08d];return _0x2c52e;};'use strict';var EventEmitter=require(_0x190f('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x190f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x190f('0x2'),'afterUpdate':_0x190f('0x3'),'afterDestroy':_0x190f('0x4')};function emitEvent(_0x30fe52){return function(_0xa5cf32,_0x35d12e,_0x4357a2){MailMessageEvents[_0x190f('0x5')](_0x30fe52+':'+_0xa5cf32['id'],_0xa5cf32);MailMessageEvents[_0x190f('0x5')](_0x30fe52,_0xa5cf32);_0x4357a2(null);};}for(var e in events){if(events[_0x190f('0x6')](e)){var event=events[e];MailMessage[_0x190f('0x7')](e,emitEvent(event));}}module[_0x190f('0x8')]=MailMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8049=['error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','fromString','body','models','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch'];(function(_0x3c9e07,_0x4566a0){var _0x551585=function(_0x494ba5){while(--_0x494ba5){_0x3c9e07['push'](_0x3c9e07['shift']());}};_0x551585(++_0x4566a0);}(_0x8049,0x16e));var _0x9804=function(_0x6f13d7,_0x290fd1){_0x6f13d7=_0x6f13d7-0x0;var _0x35e3e4=_0x8049[_0x6f13d7];return _0x35e3e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9804('0x0'))('api');var moment=require(_0x9804('0x1'));var BPromise=require(_0x9804('0x2'));var rp=require(_0x9804('0x3'));var htmlToText=require(_0x9804('0x4'));var fs=require('fs');var path=require(_0x9804('0x5'));var rimraf=require(_0x9804('0x6'));var config=require(_0x9804('0x7'));var attributes=require(_0x9804('0x8'));module[_0x9804('0x9')]=function(_0x42c9af,_0x5d6cd1){return _0x42c9af[_0x9804('0xa')](_0x9804('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9804('0xc')]},{'name':'fti_mail_messages','fields':[_0x9804('0xd'),_0x9804('0xe')],'type':_0x9804('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x56fbf8,_0x92e9d8,_0x2d5e88){if(_0x56fbf8['body']){_0x56fbf8[_0x9804('0xd')]=htmlToText[_0x9804('0x10')](_0x56fbf8[_0x9804('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2d5e88(null,_0x92e9d8);},'afterCreate':function(_0x247694,_0x7923d7,_0x5e3c89){var _0x10f8b0=_0x42c9af[_0x9804('0x12')];var _0x2e8266=_0x247694['get']({'plain':!![]});if(_0x2e8266[_0x9804('0x13')]['toLowerCase']()==='in'||_0x2e8266['direction'][_0x9804('0x14')]()===_0x9804('0x15')&&!_0x2e8266['secret']&&!_[_0x9804('0x16')](_0x2e8266[_0x9804('0x17')])){_0x10f8b0[_0x9804('0x18')][_0x9804('0x19')]({'where':{'id':_0x2e8266[_0x9804('0x1a')]}})[_0x9804('0x1b')](function(_0x4becfe){if(_0x4becfe){_0x4becfe[_0x9804('0x1c')]({'lastMsgAt':_0x2e8266['createdAt'],'lastMsgDirection':_0x2e8266[_0x9804('0x13')][_0x9804('0x14')]()});}})[_0x9804('0x1d')](function(_0x3c3c12){console[_0x9804('0x1e')](_0x3c3c12);});}_0x5e3c89();}},'charset':_0x9804('0x1f'),'collate':_0x9804('0x20')});};
\ No newline at end of file
+var _0xfc9a=['./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','FULLTEXT','fromString','body','models','get','toLowerCase','direction','secret','isNil','UserId','findOne','MailInteractionId','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x3f582b,_0xebfae6){var _0x2290db=function(_0x289f7f){while(--_0x289f7f){_0x3f582b['push'](_0x3f582b['shift']());}};_0x2290db(++_0xebfae6);}(_0xfc9a,0x107));var _0xafc9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfc9a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xafc9('0x0'));var util=require('util');var logger=require(_0xafc9('0x1'))(_0xafc9('0x2'));var moment=require(_0xafc9('0x3'));var BPromise=require(_0xafc9('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0xafc9('0x5'));var config=require(_0xafc9('0x6'));var attributes=require(_0xafc9('0x7'));module[_0xafc9('0x8')]=function(_0x20b2a0,_0x211fe4){return _0x20b2a0[_0xafc9('0x9')](_0xafc9('0xa'),attributes,{'tableName':_0xafc9('0xb'),'paranoid':![],'indexes':[{'name':_0xafc9('0xc'),'fields':[_0xafc9('0xc')]},{'name':'fti_mail_messages','fields':[_0xafc9('0xd'),'subject'],'type':_0xafc9('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a9d6e,_0x7b5d73,_0x2b21fd){if(_0x5a9d6e['body']){_0x5a9d6e[_0xafc9('0xd')]=htmlToText[_0xafc9('0xf')](_0x5a9d6e[_0xafc9('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2b21fd(null,_0x7b5d73);},'afterCreate':function(_0x5d2ae5,_0x34d400,_0x4568f5){var _0x54781f=_0x20b2a0[_0xafc9('0x11')];var _0x2b6737=_0x5d2ae5[_0xafc9('0x12')]({'plain':!![]});if(_0x2b6737['direction'][_0xafc9('0x13')]()==='in'||_0x2b6737[_0xafc9('0x14')]['toLowerCase']()==='out'&&!_0x2b6737[_0xafc9('0x15')]&&!_[_0xafc9('0x16')](_0x2b6737[_0xafc9('0x17')])){_0x54781f['MailInteraction'][_0xafc9('0x18')]({'where':{'id':_0x2b6737[_0xafc9('0x19')]}})['then'](function(_0xee79ee){if(_0xee79ee){_0xee79ee['update']({'lastMsgAt':_0x2b6737[_0xafc9('0x1a')],'lastMsgDirection':_0x2b6737[_0xafc9('0x14')]['toLowerCase']()});}})[_0xafc9('0x1b')](function(_0x58824b){console[_0xafc9('0x1c')](_0x58824b);});}_0x4568f5();}},'charset':'utf8mb4','collate':_0xafc9('0x1d')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f0e=['MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14d20c,_0x410053){var _0x9f4d94=function(_0x25581a){while(--_0x25581a){_0x14d20c['push'](_0x14d20c['shift']());}};_0x9f4d94(++_0x410053);}(_0x9f0e,0x116));var _0xe9f0=function(_0x51a18d,_0x2e5adf){_0x51a18d=_0x51a18d-0x0;var _0x5e2c28=_0x9f0e[_0x51a18d];return _0x5e2c28;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('MailMessage,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('MailMessage,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});}exports[_0xe9f0('0x1a')]=function(_0x30b8c7){var _0x1698cf=this;return new Promise(function(_0x43f399,_0x5ba788){return db[_0xe9f0('0x1b')][_0xe9f0('0x1c')](_0x30b8c7['body'],{'raw':_0x30b8c7['options']?_0x30b8c7['options'][_0xe9f0('0x1d')]===undefined?!![]:![]:!![]})[_0xe9f0('0xf')](function(_0x1211ae){logger[_0xe9f0('0x10')](_0xe9f0('0x1a'),_0x30b8c7);logger['debug'](_0xe9f0('0x1a'),_0x30b8c7,JSON[_0xe9f0('0x13')](_0x1211ae));_0x43f399(_0x1211ae);})[_0xe9f0('0x19')](function(_0x10801b){logger[_0xe9f0('0x14')](_0xe9f0('0x1a'),_0x10801b[_0xe9f0('0x17')],_0x30b8c7);_0x5ba788(_0x1698cf[_0xe9f0('0x14')](0x1f4,_0x10801b[_0xe9f0('0x17')]));});});};
\ No newline at end of file
+var _0x955f=['../../mysqldb','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x5dcf4c,_0x3cc5db){var _0x504e40=function(_0x230ea8){while(--_0x230ea8){_0x5dcf4c['push'](_0x5dcf4c['shift']());}};_0x504e40(++_0x3cc5db);}(_0x955f,0x1eb));var _0xf955=function(_0x40d41e,_0x4f5d79){_0x40d41e=_0x40d41e-0x0;var _0x5c1ca6=_0x955f[_0x40d41e];return _0x5c1ca6;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});config['redis']=_[_0xf955('0xa')](config[_0xf955('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf955('0xc'))(new Redis(config[_0xf955('0xb')]));require(_0xf955('0xd'))[_0xf955('0xe')](socket);function respondWithRpcPromise(_0x134c1b,_0x421e4a,_0x186719){return new BPromise(function(_0x4d213a,_0xf7e3e){return client['request'](_0x134c1b,_0x186719)[_0xf955('0xf')](function(_0x5d6211){logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,_0xf955('0x11'));logger['debug'](_0xf955('0x12'),_0x421e4a,'request\x20sent',JSON[_0xf955('0x13')](_0x5d6211));if(_0x5d6211[_0xf955('0x14')]){if(_0x5d6211[_0xf955('0x14')][_0xf955('0x15')]===0x1f4){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);return _0xf7e3e(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}logger['error'](_0xf955('0x16'),_0x421e4a,_0x5d6211['error'][_0xf955('0x17')]);return _0x4d213a(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}else{logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,'request\x20sent');_0x4d213a(_0x5d6211[_0xf955('0x18')][_0xf955('0x17')]);}})[_0xf955('0x19')](function(_0x4d7b5b){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x4d7b5b);_0xf7e3e(_0x4d7b5b);});});}exports[_0xf955('0x1a')]=function(_0x3f960e){var _0x3ae4fb=this;return new Promise(function(_0x5f4d9a,_0x17d86a){return db[_0xf955('0x1b')][_0xf955('0x1c')](_0x3f960e['body'],{'raw':_0x3f960e[_0xf955('0x1d')]?_0x3f960e['options'][_0xf955('0x1e')]===undefined?!![]:![]:!![]})[_0xf955('0xf')](function(_0x37143d){logger[_0xf955('0x10')](_0xf955('0x1a'),_0x3f960e);logger['debug'](_0xf955('0x1a'),_0x3f960e,JSON[_0xf955('0x13')](_0x37143d));_0x5f4d9a(_0x37143d);})[_0xf955('0x19')](function(_0x13a1a7){logger[_0xf955('0x14')](_0xf955('0x1a'),_0x13a1a7[_0xf955('0x17')],_0x3f960e);_0x17d86a(_0x3ae4fb['error'](0x1f4,_0x13a1a7[_0xf955('0x17')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2baf=['./mailMessage.events','save','remove','update','emit','register','length'];(function(_0x337e9c,_0x9e75f4){var _0x2a924a=function(_0x4b8292){while(--_0x4b8292){_0x337e9c['push'](_0x337e9c['shift']());}};_0x2a924a(++_0x9e75f4);}(_0x2baf,0xe7));var _0xf2ba=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0x2baf[_0x7538c5];return _0x8b56be;};'use strict';var MailMessageEvents=require(_0xf2ba('0x0'));var events=[_0xf2ba('0x1'),_0xf2ba('0x2'),_0xf2ba('0x3')];function createListener(_0x5ef28a,_0x3c1a93){return function(_0x50fb90){_0x3c1a93[_0xf2ba('0x4')](_0x5ef28a,_0x50fb90);};}function removeListener(_0x50c172,_0x3f335c){return function(){MailMessageEvents['removeListener'](_0x50c172,_0x3f335c);};}exports[_0xf2ba('0x5')]=function(_0x5cc617){for(var _0x218117=0x0,_0x4dc01f=events[_0xf2ba('0x6')];_0x218117<_0x4dc01f;_0x218117++){var _0x47bbe7=events[_0x218117];var _0x22b39f=createListener('mailMessage:'+_0x47bbe7,_0x5cc617);MailMessageEvents['on'](_0x47bbe7,_0x22b39f);}};
\ No newline at end of file
+var _0xc8fd=['remove','emit','register','mailMessage:','save'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_0xc8fd,0x162));var _0xdc8f=function(_0x1f0ade,_0x3a101){_0x1f0ade=_0x1f0ade-0x0;var _0x3d7f9e=_0xc8fd[_0x1f0ade];return _0x3d7f9e;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xdc8f('0x0'),_0xdc8f('0x1'),'update'];function createListener(_0xa48fc1,_0x5020f4){return function(_0x2f5685){_0x5020f4[_0xdc8f('0x2')](_0xa48fc1,_0x2f5685);};}function removeListener(_0x106091,_0x3117eb){return function(){MailMessageEvents['removeListener'](_0x106091,_0x3117eb);};}exports[_0xdc8f('0x3')]=function(_0x14a4e5){for(var _0x5a47bf=0x0,_0x27a474=events['length'];_0x5a47bf<_0x27a474;_0x5a47bf++){var _0x1f810d=events[_0x5a47bf];var _0x24da8e=createListener(_0xdc8f('0x4')+_0x1f810d,_0x14a4e5);MailMessageEvents['on'](_0x1f810d,_0x24da8e);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf749=['describe','/:id','show','/:id/users','post','create','addAgents','put','update','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','./mailQueue.controller','get','isAuthenticated'];(function(_0x576bdb,_0x1683f7){var _0x52209a=function(_0x337f1b){while(--_0x337f1b){_0x576bdb['push'](_0x576bdb['shift']());}};_0x52209a(++_0x1683f7);}(_0xf749,0x98));var _0x9f74=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf749[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x9f74('0x0'));var util=require(_0x9f74('0x1'));var path=require(_0x9f74('0x2'));var timeout=require(_0x9f74('0x3'));var express=require(_0x9f74('0x4'));var router=express[_0x9f74('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f74('0x6'));router[_0x9f74('0x7')]('/',auth[_0x9f74('0x8')](),controller['index']);router[_0x9f74('0x7')]('/describe',auth[_0x9f74('0x8')](),controller[_0x9f74('0x9')]);router[_0x9f74('0x7')](_0x9f74('0xa'),auth[_0x9f74('0x8')](),controller[_0x9f74('0xb')]);router[_0x9f74('0x7')]('/:id/members',auth[_0x9f74('0x8')](),controller['getMembers']);router[_0x9f74('0x7')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x9f74('0x7')](_0x9f74('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9f74('0xd')]('/',auth[_0x9f74('0x8')](),controller[_0x9f74('0xe')]);router[_0x9f74('0xd')]('/:id/teams',auth[_0x9f74('0x8')](),controller['addTeams']);router[_0x9f74('0xd')]('/:id/users',auth[_0x9f74('0x8')](),controller[_0x9f74('0xf')]);router[_0x9f74('0x10')]('/:id',auth[_0x9f74('0x8')](),controller[_0x9f74('0x11')]);router[_0x9f74('0x12')]('/:id',auth[_0x9f74('0x8')](),controller['destroy']);router['delete'](_0x9f74('0x13'),auth[_0x9f74('0x8')](),controller[_0x9f74('0x14')]);router[_0x9f74('0x12')](_0x9f74('0xc'),auth['isAuthenticated'](),controller[_0x9f74('0x15')]);module[_0x9f74('0x16')]=router;
\ No newline at end of file
+var _0x0493=['addAgents','put','/:id','delete','removeTeams','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','get','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams'];(function(_0x32183a,_0x1d4675){var _0x5737a4=function(_0xc5652e){while(--_0xc5652e){_0x32183a['push'](_0x32183a['shift']());}};_0x5737a4(++_0x1d4675);}(_0x0493,0x7b));var _0x3049=function(_0x22cef3,_0x2bf01a){_0x22cef3=_0x22cef3-0x0;var _0x35e2ad=_0x0493[_0x22cef3];return _0x35e2ad;};'use strict';var multer=require(_0x3049('0x0'));var util=require(_0x3049('0x1'));var path=require(_0x3049('0x2'));var timeout=require('connect-timeout');var express=require(_0x3049('0x3'));var router=express['Router']();var fs_extra=require(_0x3049('0x4'));var auth=require(_0x3049('0x5'));var interaction=require(_0x3049('0x6'));var config=require('../../config/environment');var controller=require(_0x3049('0x7'));router['get']('/',auth[_0x3049('0x8')](),controller['index']);router[_0x3049('0x9')](_0x3049('0xa'),auth[_0x3049('0x8')](),controller[_0x3049('0xb')]);router[_0x3049('0x9')]('/:id',auth[_0x3049('0x8')](),controller[_0x3049('0xc')]);router[_0x3049('0x9')](_0x3049('0xd'),auth[_0x3049('0x8')](),controller[_0x3049('0xe')]);router[_0x3049('0x9')](_0x3049('0xf'),auth[_0x3049('0x8')](),controller[_0x3049('0x10')]);router[_0x3049('0x9')](_0x3049('0x11'),auth[_0x3049('0x8')](),controller[_0x3049('0x12')]);router['post']('/',auth[_0x3049('0x8')](),controller[_0x3049('0x13')]);router[_0x3049('0x14')]('/:id/teams',auth[_0x3049('0x8')](),controller[_0x3049('0x15')]);router[_0x3049('0x14')](_0x3049('0x11'),auth['isAuthenticated'](),controller[_0x3049('0x16')]);router[_0x3049('0x17')](_0x3049('0x18'),auth[_0x3049('0x8')](),controller['update']);router['delete'](_0x3049('0x18'),auth[_0x3049('0x8')](),controller['destroy']);router[_0x3049('0x19')]('/:id/teams',auth[_0x3049('0x8')](),controller[_0x3049('0x1a')]);router[_0x3049('0x19')](_0x3049('0x11'),auth[_0x3049('0x8')](),controller[_0x3049('0x1b')]);module[_0x3049('0x1c')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6b2=['roundrobin','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x4481c4,_0x4495d6){var _0x533bd1=function(_0x1fd3fe){while(--_0x1fd3fe){_0x4481c4['push'](_0x4481c4['shift']());}};_0x533bd1(++_0x4495d6);}(_0xa6b2,0x1a5));var _0x2a6b=function(_0x3114ab,_0x53b5ad){_0x3114ab=_0x3114ab-0x0;var _0x914def=_0xa6b2[_0x3114ab];return _0x914def;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2a6b('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2a6b('0x1')]},'timeout':{'type':Sequelize[_0x2a6b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2a6b('0x3')](_0x2a6b('0x4'),_0x2a6b('0x5'),_0x2a6b('0x6'))}};
\ No newline at end of file
+var _0x4ede=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x23cce9,_0x4353b9){var _0x24bd21=function(_0xdd28bc){while(--_0xdd28bc){_0x23cce9['push'](_0x23cce9['shift']());}};_0x24bd21(++_0x4353b9);}(_0x4ede,0x124));var _0xe4ed=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4ede[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xe4ed('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4ed('0x1')],'unique':_0xe4ed('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe4ed('0x1')]},'timeout':{'type':Sequelize[_0xe4ed('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe4ed('0x4'),_0xe4ed('0x5'),_0xe4ed('0x6'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa183=['intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','sort','filters','pick','MailQueueId','filter','map','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','nolimit','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','MailQueues','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','type','key','getOptions','where','MailQueue','include','query','rows','catch','show','params','model','keys'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xa183,0x163));var _0x3a18=function(_0x17ac28,_0x1d75ee){_0x17ac28=_0x17ac28-0x0;var _0xf29082=_0xa183[_0x17ac28];return _0xf29082;};'use strict';var BPromise=require(_0x3a18('0x0'));var util=require(_0x3a18('0x1'));var _=require(_0x3a18('0x2'));var squel=require(_0x3a18('0x3'));var Redis=require(_0x3a18('0x4'));var qs=require(_0x3a18('0x5'));var logger=require(_0x3a18('0x6'))(_0x3a18('0x7'));var config=require(_0x3a18('0x8'));var db=require(_0x3a18('0x9'))['db'];config['redis']=_[_0x3a18('0xa')](config[_0x3a18('0xb')],{'host':_0x3a18('0xc'),'port':0x18eb});var socket=require(_0x3a18('0xd'))(new Redis(config['redis']));require(_0x3a18('0xe'))[_0x3a18('0xf')](socket);function respondWithStatusCode(_0x347a54,_0x2c2a8b){_0x2c2a8b=_0x2c2a8b||0xcc;return function(_0x8183b6){if(_0x8183b6){return _0x347a54['sendStatus'](_0x2c2a8b);}return _0x347a54[_0x3a18('0x10')](_0x2c2a8b)[_0x3a18('0x11')]();};}function respondWithResult(_0x96cf3b,_0x231a97){_0x231a97=_0x231a97||0xc8;return function(_0x2f00b5){if(_0x2f00b5){return _0x96cf3b[_0x3a18('0x10')](_0x231a97)[_0x3a18('0x12')](_0x2f00b5);}};}function respondWithFilteredResult(_0x4d6cad,_0x452fec){return function(_0x5d2b58){if(_0x5d2b58){var _0x7afc08=typeof _0x452fec[_0x3a18('0x13')]===_0x3a18('0x14')&&typeof _0x452fec[_0x3a18('0x15')]===_0x3a18('0x14');var _0x2e8b46=_0x5d2b58[_0x3a18('0x16')];var _0x4987e4=_0x7afc08?0x0:_0x452fec['offset'];var _0x2f1af7=_0x7afc08?_0x5d2b58[_0x3a18('0x16')]:_0x452fec[_0x3a18('0x13')]+_0x452fec[_0x3a18('0x15')];var _0x2264dc;if(_0x2f1af7>=_0x2e8b46){_0x2f1af7=_0x2e8b46;_0x2264dc=0xc8;}else{_0x2264dc=0xce;}_0x4d6cad[_0x3a18('0x10')](_0x2264dc);return _0x4d6cad[_0x3a18('0x17')](_0x3a18('0x18'),_0x4987e4+'-'+_0x2f1af7+'/'+_0x2e8b46)[_0x3a18('0x12')](_0x5d2b58);}return null;};}function saveUpdates(_0x5099d0){return function(_0x4db493){if(_0x4db493){return _0x4db493[_0x3a18('0x19')](_0x5099d0)['then'](function(_0x582cc3){return _0x582cc3;});}return null;};}function removeEntity(_0x223745){return function(_0x478587){if(_0x478587){return _0x478587[_0x3a18('0x1a')]()[_0x3a18('0x1b')](function(){var _0x19d77d=_0x478587[_0x3a18('0x1c')]({'plain':!![]});var _0x283c3e=_0x3a18('0x1d');return db[_0x3a18('0x1e')][_0x3a18('0x1a')]({'where':{'type':_0x283c3e,'resourceId':_0x19d77d['id']}})['then'](function(){return _0x478587;});})['then'](function(){_0x223745[_0x3a18('0x10')](0xcc)[_0x3a18('0x11')]();});}};}function handleEntityNotFound(_0x5a4278){return function(_0x50e2e1){if(!_0x50e2e1){_0x5a4278[_0x3a18('0x1f')](0x194);}return _0x50e2e1;};}function handleError(_0x589ac0,_0x15b2a9){_0x15b2a9=_0x15b2a9||0x1f4;return function(_0x397676){logger[_0x3a18('0x20')](_0x397676['stack']);if(_0x397676[_0x3a18('0x21')]){delete _0x397676[_0x3a18('0x21')];}_0x589ac0[_0x3a18('0x10')](_0x15b2a9)[_0x3a18('0x22')](_0x397676);};}exports[_0x3a18('0x23')]=function(_0x4bf16c,_0x2000eb){var _0x438ce6={};var _0x4f2970={'count':0x0,'rows':[]};var _0x184a9e=_['map'](db['MailQueue'][_0x3a18('0x24')],function(_0x1041a9){return{'name':_0x1041a9['fieldName'],'type':_0x1041a9[_0x3a18('0x25')][_0x3a18('0x26')]};});_0x438ce6=qs[_0x3a18('0x27')](_0x184a9e,_0x4bf16c);var _0x58011e={'where':_0x438ce6[_0x3a18('0x28')]};return db[_0x3a18('0x29')]['count'](_0x58011e)[_0x3a18('0x1b')](function(_0x2701f3){_0x4f2970[_0x3a18('0x16')]=_0x2701f3;_0x438ce6[_0x3a18('0x2a')]=qs['include'](_0x4bf16c[_0x3a18('0x2b')]);return db[_0x3a18('0x29')]['findAll'](_0x438ce6);})['then'](function(_0x3b39ba){_0x4f2970[_0x3a18('0x2c')]=_0x3b39ba;return _0x4f2970;})[_0x3a18('0x1b')](respondWithFilteredResult(_0x2000eb,_0x438ce6))[_0x3a18('0x2d')](handleError(_0x2000eb,null));};exports[_0x3a18('0x2e')]=function(_0x392644,_0x3e8f5f){var _0x4f356d={'raw':!![],'where':{'id':_0x392644[_0x3a18('0x2f')]['id']}},_0x4e509a={};_0x4e509a[_0x3a18('0x30')]=_['keys'](db[_0x3a18('0x29')][_0x3a18('0x24')]);_0x4e509a['query']=_[_0x3a18('0x31')](_0x392644[_0x3a18('0x2b')]);_0x4e509a['filters']=_[_0x3a18('0x32')](_0x4e509a[_0x3a18('0x30')],_0x4e509a[_0x3a18('0x2b')]);_0x4f356d['attributes']=_[_0x3a18('0x32')](_0x4e509a[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x392644[_0x3a18('0x2b')][_0x3a18('0x33')]));_0x4f356d[_0x3a18('0x34')]=_0x4f356d[_0x3a18('0x34')][_0x3a18('0x35')]?_0x4f356d['attributes']:_0x4e509a['model'];if(_0x392644[_0x3a18('0x2b')]['includeAll']){_0x4f356d[_0x3a18('0x2a')]=[{'all':!![]}];}_0x4f356d=_[_0x3a18('0x36')]({},_0x4f356d,_0x392644[_0x3a18('0x37')]);return db['MailQueue'][_0x3a18('0x38')](_0x4f356d)[_0x3a18('0x1b')](handleEntityNotFound(_0x3e8f5f,null))[_0x3a18('0x1b')](respondWithResult(_0x3e8f5f,null))['catch'](handleError(_0x3e8f5f,null));};exports['create']=function(_0x6028af,_0x537ff7){return db[_0x3a18('0x29')][_0x3a18('0x39')](_0x6028af[_0x3a18('0x3a')],{})[_0x3a18('0x1b')](function(_0x4d090c){var _0x284ec5=_0x6028af[_0x3a18('0x3b')][_0x3a18('0x1c')]({'plain':!![]});if(!_0x284ec5)throw new Error(_0x3a18('0x3c'));if(_0x284ec5[_0x3a18('0x3d')]==='user'){var _0x5458a2=_0x4d090c[_0x3a18('0x1c')]({'plain':!![]});var _0x4262c6='MailQueues';return db[_0x3a18('0x3e')][_0x3a18('0x38')]({'where':{'name':_0x4262c6,'userProfileId':_0x284ec5[_0x3a18('0x3f')]},'raw':!![]})[_0x3a18('0x1b')](function(_0x2cedf3){if(_0x2cedf3&&_0x2cedf3[_0x3a18('0x40')]===0x0){return db[_0x3a18('0x1e')]['create']({'name':_0x5458a2['name'],'resourceId':_0x5458a2['id'],'type':_0x2cedf3['name'],'sectionId':_0x2cedf3['id']},{})[_0x3a18('0x1b')](function(){return _0x4d090c;});}else{return _0x4d090c;}})['catch'](function(_0x19929d){logger['error'](_0x3a18('0x41'),_0x19929d);throw _0x19929d;});}return _0x4d090c;})['then'](respondWithResult(_0x537ff7,0xc9))['catch'](handleError(_0x537ff7,null));};exports[_0x3a18('0x19')]=function(_0x3efcbd,_0x4a5572){if(_0x3efcbd['body']['id']){delete _0x3efcbd['body']['id'];}return db[_0x3a18('0x29')][_0x3a18('0x38')]({'where':{'id':_0x3efcbd[_0x3a18('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4a5572,null))[_0x3a18('0x1b')](saveUpdates(_0x3efcbd[_0x3a18('0x3a')],null))[_0x3a18('0x1b')](respondWithResult(_0x4a5572,null))[_0x3a18('0x2d')](handleError(_0x4a5572,null));};exports['destroy']=function(_0x5d7ebf,_0x3e17e9){return db[_0x3a18('0x29')]['find']({'where':{'id':_0x5d7ebf[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x3e17e9,null))[_0x3a18('0x1b')](removeEntity(_0x3e17e9,null))[_0x3a18('0x2d')](handleError(_0x3e17e9,null));};exports[_0x3a18('0x42')]=function(_0x3672ec,_0x1f442b){return db[_0x3a18('0x29')][_0x3a18('0x42')]()[_0x3a18('0x1b')](respondWithResult(_0x1f442b,null))['catch'](handleError(_0x1f442b,null));};exports[_0x3a18('0x43')]=function(_0x3e8852,_0x30e999){var _0x5c07a5={'raw':!![],'where':{}},_0x9286ba={},_0x2d91ac;return db['MailQueue'][_0x3a18('0x44')]({'where':{'id':_0x3e8852[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x30e999,null))['then'](function(_0xe17741){if(_0xe17741){_0x2d91ac=_0xe17741[_0x3a18('0x1c')]({'plain':!![]});_0x9286ba['model']=_[_0x3a18('0x31')](db[_0x3a18('0x45')][_0x3a18('0x24')]);_0x9286ba[_0x3a18('0x2b')]=_[_0x3a18('0x31')](_0x3e8852[_0x3a18('0x2b')]);_0x9286ba['filters']=_['intersection'](_0x9286ba[_0x3a18('0x30')],_0x9286ba['query']);_0x5c07a5[_0x3a18('0x34')]=_[_0x3a18('0x32')](_0x9286ba[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x3e8852[_0x3a18('0x2b')][_0x3a18('0x33')]));_0x5c07a5['attributes']=_0x5c07a5[_0x3a18('0x34')][_0x3a18('0x35')]?_0x5c07a5[_0x3a18('0x34')]:_0x9286ba['model'];if(!_0x3e8852[_0x3a18('0x2b')][_0x3a18('0x46')]('nolimit')){_0x5c07a5[_0x3a18('0x15')]=qs[_0x3a18('0x15')](_0x3e8852['query'][_0x3a18('0x15')]);_0x5c07a5['offset']=qs['offset'](_0x3e8852['query'][_0x3a18('0x13')]);}_0x5c07a5[_0x3a18('0x47')]=qs[_0x3a18('0x48')](_0x3e8852['query'][_0x3a18('0x48')]);_0x5c07a5[_0x3a18('0x28')]=qs[_0x3a18('0x49')](_[_0x3a18('0x4a')](_0x3e8852['query'],_0x9286ba['filters']));_0x5c07a5[_0x3a18('0x28')][_0x3a18('0x4b')]=_0xe17741['id'];if(_0x3e8852[_0x3a18('0x2b')][_0x3a18('0x4c')]){_0x5c07a5[_0x3a18('0x28')]=_[_0x3a18('0x36')](_0x5c07a5[_0x3a18('0x28')],{'$or':_[_0x3a18('0x4d')](_0x5c07a5[_0x3a18('0x34')],function(_0xb2be04){var _0x5e58b0={};_0x5e58b0[_0xb2be04]={'$like':'%'+_0x3e8852['query'][_0x3a18('0x4c')]+'%'};return _0x5e58b0;})});}_0x5c07a5=_['merge']({},_0x5c07a5,_0x3e8852[_0x3a18('0x37')]);return db[_0x3a18('0x45')]['findAll'](_0x5c07a5);}})['then'](function(_0x67d626){if(_0x67d626){return db[_0x3a18('0x4e')][_0x3a18('0x4f')]({'where':{'id':_['map'](_0x67d626,'UserId'),'role':_0x3a18('0x50')},'attributes':['id','name','mailPause',_0x3a18('0x51'),_0x3a18('0x52')]});}})[_0x3a18('0x1b')](function(_0x448554){if(_0x448554){return{'count':_0x448554[_0x3a18('0x16')],'rows':_['map'](_0x448554[_0x3a18('0x2c')],function(_0x15664d){return{'membername':_0x15664d[_0x3a18('0x21')],'UserId':_0x15664d['id'],'queue_name':_0x2d91ac[_0x3a18('0x21')],'MailQueueId':_0x2d91ac['id'],'interface':util[_0x3a18('0x53')](_0x3a18('0x54'),_0x3a18('0x55'),_0x15664d[_0x3a18('0x21')]),'penalty':0x0,'paused':_0x15664d[_0x3a18('0x56')],'createdAt':_0x15664d[_0x3a18('0x52')],'updatedAt':_0x15664d[_0x3a18('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3a18('0x1b')](respondWithFilteredResult(_0x30e999,_0x5c07a5))[_0x3a18('0x2d')](handleError(_0x30e999,null));};exports[_0x3a18('0x57')]=function(_0x2aff0a,_0x108785){var _0x35d5bf={};var _0x460738={};var _0x16cb7c;var _0x2ca970;return db[_0x3a18('0x29')]['findOne']({'where':{'id':_0x2aff0a[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x108785,null))[_0x3a18('0x1b')](function(_0x49f91c){if(_0x49f91c){_0x16cb7c=_0x49f91c;_0x460738[_0x3a18('0x30')]=_[_0x3a18('0x31')](db[_0x3a18('0x58')]['rawAttributes']);_0x460738[_0x3a18('0x2b')]=_[_0x3a18('0x31')](_0x2aff0a[_0x3a18('0x2b')]);_0x460738['filters']=_['intersection'](_0x460738[_0x3a18('0x30')],_0x460738['query']);_0x35d5bf[_0x3a18('0x34')]=_[_0x3a18('0x32')](_0x460738[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x2aff0a[_0x3a18('0x2b')][_0x3a18('0x33')]));_0x35d5bf[_0x3a18('0x34')]=_0x35d5bf[_0x3a18('0x34')]['length']?_0x35d5bf[_0x3a18('0x34')]:_0x460738['model'];_0x35d5bf[_0x3a18('0x47')]=qs[_0x3a18('0x48')](_0x2aff0a[_0x3a18('0x2b')][_0x3a18('0x48')]);_0x35d5bf[_0x3a18('0x28')]=qs[_0x3a18('0x49')](_['pick'](_0x2aff0a[_0x3a18('0x2b')],_0x460738[_0x3a18('0x49')]));if(_0x2aff0a[_0x3a18('0x2b')]['filter']){_0x35d5bf['where']=_['merge'](_0x35d5bf[_0x3a18('0x28')],{'$or':_[_0x3a18('0x4d')](_0x35d5bf[_0x3a18('0x34')],function(_0x2b6e67){var _0x4bf31b={};_0x4bf31b[_0x2b6e67]={'$like':'%'+_0x2aff0a[_0x3a18('0x2b')][_0x3a18('0x4c')]+'%'};return _0x4bf31b;})});}_0x35d5bf=_[_0x3a18('0x36')]({},_0x35d5bf,_0x2aff0a['options']);return _0x16cb7c['getTeams'](_0x35d5bf);}})['then'](function(_0x583c49){if(_0x583c49){_0x2ca970=_0x583c49[_0x3a18('0x35')];if(!_0x2aff0a['query'][_0x3a18('0x46')](_0x3a18('0x59'))){_0x35d5bf[_0x3a18('0x15')]=qs[_0x3a18('0x15')](_0x2aff0a['query']['limit']);_0x35d5bf['offset']=qs[_0x3a18('0x13')](_0x2aff0a['query']['offset']);}return _0x16cb7c[_0x3a18('0x57')](_0x35d5bf);}})['then'](function(_0x19a2d0){if(_0x19a2d0){return _0x19a2d0?{'count':_0x2ca970,'rows':_0x19a2d0}:null;}})[_0x3a18('0x1b')](respondWithResult(_0x108785,null))[_0x3a18('0x2d')](handleError(_0x108785,null));};exports[_0x3a18('0x5a')]=function(_0x56fffc,_0x5703d8){var _0xd96cec=_0x56fffc[_0x3a18('0x3a')][_0x3a18('0x5b')];return db[_0x3a18('0x58')][_0x3a18('0x5c')]({'where':{'id':_0xd96cec},'attributes':['id'],'include':[{'model':db[_0x3a18('0x4e')],'as':'Agents','attributes':['id',_0x3a18('0x21'),_0x3a18('0x5d'),_0x3a18('0x5e'),_0x3a18('0x5f')],'raw':!![]}]})['then'](function(_0x2f5b57){if(_0x2f5b57){var _0x384302=_[_0x3a18('0x60')](_0x2f5b57,function(_0x47e170){var _0x4bd674=_0x47e170[_0x3a18('0x1c')]({'plain':!![]});return _0x4bd674[_0x3a18('0x61')];});return db[_0x3a18('0x29')][_0x3a18('0x38')]({'where':{'id':_0x56fffc[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](function(_0x46a998){return db['sequelize'][_0x3a18('0x62')](function(_0x3922b9){return _0x46a998[_0x3a18('0x5a')](_0xd96cec,{'transaction':_0x3922b9})[_0x3a18('0x1b')](function(){return BPromise[_0x3a18('0x63')](_0x384302,function(_0x47268){return db[_0x3a18('0x45')][_0x3a18('0x64')]({'where':{'UserId':_0x47268['id'],'MailQueueId':_0x56fffc[_0x3a18('0x2f')]['id']},'transaction':_0x3922b9});});})[_0x3a18('0x1b')](function(){_0x384302[_0x3a18('0x65')](function(_0x5b1a38){socket[_0x3a18('0x66')](_0x3a18('0x67'),{'UserId':_0x5b1a38['id'],'MailQueueId':_0x46a998['id']});});});});});}})['then'](respondWithStatusCode(_0x5703d8,null))[_0x3a18('0x2d')](handleError(_0x5703d8,null));};exports[_0x3a18('0x68')]=function(_0x2a061c,_0x3834ef){return db['Team'][_0x3a18('0x5c')]({'where':{'id':_0x2a061c['query'][_0x3a18('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x3a18('0x4e')],'as':_0x3a18('0x61'),'attributes':['id'],'raw':!![]}]})[_0x3a18('0x1b')](handleEntityNotFound(_0x3834ef,null))[_0x3a18('0x1b')](function(_0x1c0dc8){var _0x22b641=_[_0x3a18('0x4d')](_0x1c0dc8,'id');var _0xe47473=[];var _0x30c909=[];var _0x5c2017=squel[_0x3a18('0x69')]();_0x5c2017[_0x3a18('0x6a')]('tq.TeamId')[_0x3a18('0x6b')](_0x3a18('0x6c'),'tq')[_0x3a18('0x6d')](_0x3a18('0x6e'),'ut',_0x3a18('0x6f'))[_0x3a18('0x28')](_0x3a18('0x70'),_0x2a061c['params']['id']);for(var _0x5c4914=0x0;_0x5c4914<_0x1c0dc8[_0x3a18('0x35')];_0x5c4914+=0x1){let _0x1c841a=_0x1c0dc8[_0x5c4914];for(var _0x32a919=0x0;_0x32a919<_0x1c841a[_0x3a18('0x61')]['length'];_0x32a919+=0x1){let _0x3c14f9=_0x1c841a[_0x3a18('0x61')][_0x32a919];var _0x283f22=_0x5c2017[_0x3a18('0x71')]();_0x283f22['where'](_0x3a18('0x72'),_0x3c14f9['id']);_0x30c909[_0x3a18('0x73')](db['sequelize']['query'](_0x283f22[_0x3a18('0x74')](),{'type':db[_0x3a18('0x75')][_0x3a18('0x76')][_0x3a18('0x77')]})[_0x3a18('0x1b')](function(_0x228ea4){if(_0x228ea4[_0x3a18('0x35')]===0x1){return _0x3c14f9['id'];}else{var _0xafd54d=_[_0x3a18('0x78')](_['map'](_0x228ea4,_0x3a18('0x79')),function(_0x424ea1){return _[_0x3a18('0x7a')](_0x22b641,_0x424ea1);});if(_0xafd54d){return _0x3c14f9['id'];}}}));}}return BPromise[_0x3a18('0x7b')](_0x30c909)[_0x3a18('0x1b')](function(_0x1c9d5f){_0xe47473=_(_0xe47473)[_0x3a18('0x7c')](_0x1c9d5f)[_0x3a18('0x7d')]()[_0x3a18('0x7e')]();return db['MailQueue']['find']({'where':{'id':_0x2a061c[_0x3a18('0x2f')]['id']}})['then'](function(_0x3205c2){return db[_0x3a18('0x75')][_0x3a18('0x62')](function(_0xcb25ff){return _0x3205c2[_0x3a18('0x68')](_0x2a061c['query'][_0x3a18('0x5b')],{'transaction':_0xcb25ff})[_0x3a18('0x1b')](function(){if(!_[_0x3a18('0x7f')](_0xe47473)){return _0x3205c2['removeAgents'](_0xe47473,{'transaction':_0xcb25ff});}})['then'](function(){_0xe47473[_0x3a18('0x65')](function(_0x138c72){socket['emit'](_0x3a18('0x80'),{'UserId':_0x138c72,'MailQueueId':_0x3205c2['id']});});});});});});})['then'](respondWithStatusCode(_0x3834ef,null))[_0x3a18('0x2d')](handleError(_0x3834ef,null));};exports[_0x3a18('0x81')]=function(_0x526baa,_0x21c15b){return db[_0x3a18('0x29')][_0x3a18('0x38')]({'where':{'id':_0x526baa[_0x3a18('0x2f')]['id']}})[_0x3a18('0x1b')](handleEntityNotFound(_0x21c15b,null))[_0x3a18('0x1b')](function(_0x2be8e6){if(_0x2be8e6){return _0x2be8e6[_0x3a18('0x81')](_0x526baa[_0x3a18('0x3a')][_0x3a18('0x5b')],_[_0x3a18('0x82')](_0x526baa[_0x3a18('0x3a')],[_0x3a18('0x5b'),'id'])||{})[_0x3a18('0x83')](function(_0x123fba){for(var _0x2b35b6=0x0;_0x2b35b6<_0x526baa[_0x3a18('0x3a')][_0x3a18('0x5b')][_0x3a18('0x35')];_0x2b35b6+=0x1){socket[_0x3a18('0x66')]('userMailQueue:save',{'UserId':Number(_0x526baa[_0x3a18('0x3a')]['ids'][_0x2b35b6]),'MailQueueId':Number(_0x526baa[_0x3a18('0x2f')]['id'])});}return _0x123fba;});}})[_0x3a18('0x1b')](respondWithResult(_0x21c15b,null))[_0x3a18('0x2d')](handleError(_0x21c15b,null));};exports[_0x3a18('0x84')]=function(_0x193615,_0x10344a){return db[_0x3a18('0x29')]['find']({'where':{'id':_0x193615[_0x3a18('0x2f')]['id']}})['then'](handleEntityNotFound(_0x10344a,null))[_0x3a18('0x1b')](function(_0x575e0f){if(_0x575e0f){return _0x575e0f['removeAgents'](_0x193615[_0x3a18('0x2b')][_0x3a18('0x5b')])['then'](function(){if(_[_0x3a18('0x85')](_0x193615[_0x3a18('0x2b')][_0x3a18('0x5b')])){for(var _0x553670=0x0;_0x553670<_0x193615[_0x3a18('0x2b')]['ids'][_0x3a18('0x35')];_0x553670+=0x1){socket[_0x3a18('0x66')]('userMailQueue:remove',{'UserId':Number(_0x193615['query']['ids'][_0x553670]),'MailQueueId':Number(_0x193615[_0x3a18('0x2f')]['id'])});}}else{socket[_0x3a18('0x66')]('userMailQueue:remove',{'UserId':Number(_0x193615[_0x3a18('0x2b')][_0x3a18('0x5b')]),'MailQueueId':Number(_0x193615[_0x3a18('0x2f')]['id'])});}});}})[_0x3a18('0x1b')](respondWithStatusCode(_0x10344a,null))[_0x3a18('0x2d')](handleError(_0x10344a,null));};exports[_0x3a18('0x86')]=function(_0x572e14,_0x3305f5){var _0x5bf999={};var _0x3b0299={};var _0x2ffac8;var _0x4c45f1;return db[_0x3a18('0x29')][_0x3a18('0x44')]({'where':{'id':_0x572e14['params']['id']}})['then'](handleEntityNotFound(_0x3305f5,null))[_0x3a18('0x1b')](function(_0x181b09){if(_0x181b09){_0x2ffac8=_0x181b09;_0x3b0299[_0x3a18('0x30')]=_['keys'](db['User']['rawAttributes']);_0x3b0299['query']=_[_0x3a18('0x31')](_0x572e14[_0x3a18('0x2b')]);_0x3b0299[_0x3a18('0x49')]=_[_0x3a18('0x32')](_0x3b0299[_0x3a18('0x30')],_0x3b0299[_0x3a18('0x2b')]);_0x5bf999[_0x3a18('0x34')]=_[_0x3a18('0x32')](_0x3b0299[_0x3a18('0x30')],qs[_0x3a18('0x33')](_0x572e14[_0x3a18('0x2b')]['fields']));_0x5bf999['attributes']=_0x5bf999[_0x3a18('0x34')]['length']?_0x5bf999[_0x3a18('0x34')]:_0x3b0299[_0x3a18('0x30')];_0x5bf999[_0x3a18('0x47')]=qs[_0x3a18('0x48')](_0x572e14[_0x3a18('0x2b')]['sort']);_0x5bf999[_0x3a18('0x28')]=qs[_0x3a18('0x49')](_['pick'](_0x572e14[_0x3a18('0x2b')],_0x3b0299[_0x3a18('0x49')]));if(_0x572e14[_0x3a18('0x2b')][_0x3a18('0x4c')]){_0x5bf999[_0x3a18('0x28')]=_['merge'](_0x5bf999[_0x3a18('0x28')],{'$or':_[_0x3a18('0x4d')](_0x5bf999[_0x3a18('0x34')],function(_0x7e5ea1){var _0x99d63c={};_0x99d63c[_0x7e5ea1]={'$like':'%'+_0x572e14['query'][_0x3a18('0x4c')]+'%'};return _0x99d63c;})});}_0x5bf999=_[_0x3a18('0x36')]({},_0x5bf999,_0x572e14['options']);return _0x2ffac8[_0x3a18('0x86')](_0x5bf999);}})['then'](function(_0x2fd12f){if(_0x2fd12f){_0x4c45f1=_0x2fd12f[_0x3a18('0x35')];if(!_0x572e14[_0x3a18('0x2b')][_0x3a18('0x46')]('nolimit')){_0x5bf999[_0x3a18('0x15')]=qs[_0x3a18('0x15')](_0x572e14[_0x3a18('0x2b')][_0x3a18('0x15')]);_0x5bf999[_0x3a18('0x13')]=qs['offset'](_0x572e14[_0x3a18('0x2b')][_0x3a18('0x13')]);}return _0x2ffac8[_0x3a18('0x86')](_0x5bf999);}})[_0x3a18('0x1b')](function(_0x397316){if(_0x397316){return _0x397316?{'count':_0x4c45f1,'rows':_0x397316}:null;}})[_0x3a18('0x1b')](respondWithResult(_0x3305f5,null))[_0x3a18('0x2d')](handleError(_0x3305f5,null));};
\ No newline at end of file
+var _0x33d8=['limit','count','set','Content-Range','update','then','get','MailQueues','destroy','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','find','catch','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','sort','pick','filter','merge','options','User','UserId','agent','createdAt','format','%s/%s','mailPause','updatedAt','getTeams','Team','length','addTeams','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','nolimit','util','squel','ioredis','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined'];(function(_0x5b1d0c,_0x20c8e3){var _0x58c2f6=function(_0x292ea3){while(--_0x292ea3){_0x5b1d0c['push'](_0x5b1d0c['shift']());}};_0x58c2f6(++_0x20c8e3);}(_0x33d8,0x15d));var _0x833d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x33d8[_0x8c43de];return _0xa6591b;};'use strict';var BPromise=require('bluebird');var util=require(_0x833d('0x0'));var _=require('lodash');var squel=require(_0x833d('0x1'));var Redis=require(_0x833d('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x833d('0x3'))(_0x833d('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x833d('0x5')]=_[_0x833d('0x6')](config['redis'],{'host':_0x833d('0x7'),'port':0x18eb});var socket=require(_0x833d('0x8'))(new Redis(config['redis']));require(_0x833d('0x9'))[_0x833d('0xa')](socket);function respondWithStatusCode(_0x262f0e,_0x1e5f84){_0x1e5f84=_0x1e5f84||0xcc;return function(_0x517bb5){if(_0x517bb5){return _0x262f0e[_0x833d('0xb')](_0x1e5f84);}return _0x262f0e[_0x833d('0xc')](_0x1e5f84)[_0x833d('0xd')]();};}function respondWithResult(_0x18bba8,_0x4e4a87){_0x4e4a87=_0x4e4a87||0xc8;return function(_0x3809df){if(_0x3809df){return _0x18bba8[_0x833d('0xc')](_0x4e4a87)[_0x833d('0xe')](_0x3809df);}};}function respondWithFilteredResult(_0x1583a8,_0x4cb51e){return function(_0x764f53){if(_0x764f53){var _0x4722ca=typeof _0x4cb51e[_0x833d('0xf')]===_0x833d('0x10')&&typeof _0x4cb51e[_0x833d('0x11')]===_0x833d('0x10');var _0x710ad5=_0x764f53[_0x833d('0x12')];var _0x3b0bec=_0x4722ca?0x0:_0x4cb51e[_0x833d('0xf')];var _0x4a32a4=_0x4722ca?_0x764f53[_0x833d('0x12')]:_0x4cb51e[_0x833d('0xf')]+_0x4cb51e[_0x833d('0x11')];var _0x2d0cca;if(_0x4a32a4>=_0x710ad5){_0x4a32a4=_0x710ad5;_0x2d0cca=0xc8;}else{_0x2d0cca=0xce;}_0x1583a8[_0x833d('0xc')](_0x2d0cca);return _0x1583a8[_0x833d('0x13')](_0x833d('0x14'),_0x3b0bec+'-'+_0x4a32a4+'/'+_0x710ad5)[_0x833d('0xe')](_0x764f53);}return null;};}function saveUpdates(_0x14fff8){return function(_0x5e2d22){if(_0x5e2d22){return _0x5e2d22[_0x833d('0x15')](_0x14fff8)['then'](function(_0x459e56){return _0x459e56;});}return null;};}function removeEntity(_0x18e01a){return function(_0x4dd68c){if(_0x4dd68c){return _0x4dd68c['destroy']()[_0x833d('0x16')](function(){var _0x23ab60=_0x4dd68c[_0x833d('0x17')]({'plain':!![]});var _0x7e93a4=_0x833d('0x18');return db['UserProfileResource'][_0x833d('0x19')]({'where':{'type':_0x7e93a4,'resourceId':_0x23ab60['id']}})['then'](function(){return _0x4dd68c;});})[_0x833d('0x16')](function(){_0x18e01a[_0x833d('0xc')](0xcc)[_0x833d('0xd')]();});}};}function handleEntityNotFound(_0x367237){return function(_0x534060){if(!_0x534060){_0x367237[_0x833d('0xb')](0x194);}return _0x534060;};}function handleError(_0x1ce082,_0x22ff53){_0x22ff53=_0x22ff53||0x1f4;return function(_0x3721e1){logger['error'](_0x3721e1[_0x833d('0x1a')]);if(_0x3721e1['name']){delete _0x3721e1[_0x833d('0x1b')];}_0x1ce082[_0x833d('0xc')](_0x22ff53)[_0x833d('0x1c')](_0x3721e1);};}exports[_0x833d('0x1d')]=function(_0x4e5097,_0x30d635){var _0x1ba223={};var _0xdac830={'count':0x0,'rows':[]};var _0x5a5046=_[_0x833d('0x1e')](db[_0x833d('0x1f')][_0x833d('0x20')],function(_0x492bb1){return{'name':_0x492bb1[_0x833d('0x21')],'type':_0x492bb1['type'][_0x833d('0x22')]};});_0x1ba223=qs[_0x833d('0x23')](_0x5a5046,_0x4e5097);var _0x2e3620={'where':_0x1ba223[_0x833d('0x24')]};return db['MailQueue'][_0x833d('0x12')](_0x2e3620)[_0x833d('0x16')](function(_0x109cf6){_0xdac830['count']=_0x109cf6;_0x1ba223[_0x833d('0x25')]=qs[_0x833d('0x25')](_0x4e5097['query']);return db['MailQueue'][_0x833d('0x26')](_0x1ba223);})[_0x833d('0x16')](function(_0x3b49c5){_0xdac830[_0x833d('0x27')]=_0x3b49c5;return _0xdac830;})[_0x833d('0x16')](respondWithFilteredResult(_0x30d635,_0x1ba223))['catch'](handleError(_0x30d635,null));};exports[_0x833d('0x28')]=function(_0x425b18,_0x1905c3){var _0x3ad2b6={'raw':!![],'where':{'id':_0x425b18[_0x833d('0x29')]['id']}},_0xeca62d={};_0xeca62d[_0x833d('0x2a')]=_[_0x833d('0x2b')](db[_0x833d('0x1f')]['rawAttributes']);_0xeca62d[_0x833d('0x2c')]=_[_0x833d('0x2b')](_0x425b18[_0x833d('0x2c')]);_0xeca62d[_0x833d('0x2d')]=_[_0x833d('0x2e')](_0xeca62d[_0x833d('0x2a')],_0xeca62d[_0x833d('0x2c')]);_0x3ad2b6[_0x833d('0x2f')]=_['intersection'](_0xeca62d[_0x833d('0x2a')],qs['fields'](_0x425b18[_0x833d('0x2c')][_0x833d('0x30')]));_0x3ad2b6[_0x833d('0x2f')]=_0x3ad2b6[_0x833d('0x2f')]['length']?_0x3ad2b6[_0x833d('0x2f')]:_0xeca62d[_0x833d('0x2a')];if(_0x425b18[_0x833d('0x2c')][_0x833d('0x31')]){_0x3ad2b6['include']=[{'all':!![]}];}_0x3ad2b6=_['merge']({},_0x3ad2b6,_0x425b18['options']);return db[_0x833d('0x1f')][_0x833d('0x32')](_0x3ad2b6)[_0x833d('0x16')](handleEntityNotFound(_0x1905c3,null))[_0x833d('0x16')](respondWithResult(_0x1905c3,null))[_0x833d('0x33')](handleError(_0x1905c3,null));};exports[_0x833d('0x34')]=function(_0xa9dc30,_0x1aee2d){return db[_0x833d('0x1f')][_0x833d('0x34')](_0xa9dc30[_0x833d('0x35')],{})['then'](function(_0x57398a){var _0x47a071=_0xa9dc30[_0x833d('0x36')][_0x833d('0x17')]({'plain':!![]});if(!_0x47a071)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a071[_0x833d('0x37')]===_0x833d('0x36')){var _0x399f5a=_0x57398a[_0x833d('0x17')]({'plain':!![]});var _0x2f0852='MailQueues';return db['UserProfileSection']['find']({'where':{'name':_0x2f0852,'userProfileId':_0x47a071[_0x833d('0x38')]},'raw':!![]})['then'](function(_0x5e1153){if(_0x5e1153&&_0x5e1153[_0x833d('0x39')]===0x0){return db[_0x833d('0x3a')][_0x833d('0x34')]({'name':_0x399f5a[_0x833d('0x1b')],'resourceId':_0x399f5a['id'],'type':_0x5e1153['name'],'sectionId':_0x5e1153['id']},{})['then'](function(){return _0x57398a;});}else{return _0x57398a;}})[_0x833d('0x33')](function(_0x5b7f73){logger[_0x833d('0x3b')](_0x833d('0x3c'),_0x5b7f73);throw _0x5b7f73;});}return _0x57398a;})[_0x833d('0x16')](respondWithResult(_0x1aee2d,0xc9))[_0x833d('0x33')](handleError(_0x1aee2d,null));};exports[_0x833d('0x15')]=function(_0xc34c20,_0x295255){if(_0xc34c20[_0x833d('0x35')]['id']){delete _0xc34c20[_0x833d('0x35')]['id'];}return db[_0x833d('0x1f')]['find']({'where':{'id':_0xc34c20[_0x833d('0x29')]['id']}})['then'](handleEntityNotFound(_0x295255,null))[_0x833d('0x16')](saveUpdates(_0xc34c20[_0x833d('0x35')],null))[_0x833d('0x16')](respondWithResult(_0x295255,null))[_0x833d('0x33')](handleError(_0x295255,null));};exports['destroy']=function(_0x98be95,_0x10c0f9){return db[_0x833d('0x1f')][_0x833d('0x32')]({'where':{'id':_0x98be95['params']['id']}})[_0x833d('0x16')](handleEntityNotFound(_0x10c0f9,null))[_0x833d('0x16')](removeEntity(_0x10c0f9,null))['catch'](handleError(_0x10c0f9,null));};exports[_0x833d('0x3d')]=function(_0x26ca0c,_0x35bf38){return db[_0x833d('0x1f')][_0x833d('0x3d')]()['then'](respondWithResult(_0x35bf38,null))[_0x833d('0x33')](handleError(_0x35bf38,null));};exports[_0x833d('0x3e')]=function(_0x22f704,_0x2091b0){var _0x61bba3={'raw':!![],'where':{}},_0x3a4f33={},_0x5b2c4b;return db[_0x833d('0x1f')][_0x833d('0x3f')]({'where':{'id':_0x22f704[_0x833d('0x29')]['id']}})['then'](handleEntityNotFound(_0x2091b0,null))[_0x833d('0x16')](function(_0x4244ac){if(_0x4244ac){_0x5b2c4b=_0x4244ac[_0x833d('0x17')]({'plain':!![]});_0x3a4f33[_0x833d('0x2a')]=_[_0x833d('0x2b')](db[_0x833d('0x40')][_0x833d('0x20')]);_0x3a4f33['query']=_[_0x833d('0x2b')](_0x22f704[_0x833d('0x2c')]);_0x3a4f33['filters']=_['intersection'](_0x3a4f33[_0x833d('0x2a')],_0x3a4f33['query']);_0x61bba3[_0x833d('0x2f')]=_['intersection'](_0x3a4f33[_0x833d('0x2a')],qs[_0x833d('0x30')](_0x22f704[_0x833d('0x2c')][_0x833d('0x30')]));_0x61bba3['attributes']=_0x61bba3[_0x833d('0x2f')]['length']?_0x61bba3[_0x833d('0x2f')]:_0x3a4f33[_0x833d('0x2a')];if(!_0x22f704[_0x833d('0x2c')][_0x833d('0x41')]('nolimit')){_0x61bba3['limit']=qs[_0x833d('0x11')](_0x22f704['query'][_0x833d('0x11')]);_0x61bba3['offset']=qs[_0x833d('0xf')](_0x22f704['query'][_0x833d('0xf')]);}_0x61bba3[_0x833d('0x42')]=qs[_0x833d('0x43')](_0x22f704['query']['sort']);_0x61bba3[_0x833d('0x24')]=qs[_0x833d('0x2d')](_[_0x833d('0x44')](_0x22f704[_0x833d('0x2c')],_0x3a4f33[_0x833d('0x2d')]));_0x61bba3[_0x833d('0x24')]['MailQueueId']=_0x4244ac['id'];if(_0x22f704[_0x833d('0x2c')][_0x833d('0x45')]){_0x61bba3['where']=_[_0x833d('0x46')](_0x61bba3[_0x833d('0x24')],{'$or':_[_0x833d('0x1e')](_0x61bba3[_0x833d('0x2f')],function(_0x1ee892){var _0x98b27b={};_0x98b27b[_0x1ee892]={'$like':'%'+_0x22f704['query']['filter']+'%'};return _0x98b27b;})});}_0x61bba3=_['merge']({},_0x61bba3,_0x22f704[_0x833d('0x47')]);return db[_0x833d('0x40')][_0x833d('0x26')](_0x61bba3);}})['then'](function(_0x55ed9d){if(_0x55ed9d){return db[_0x833d('0x48')]['findAndCountAll']({'where':{'id':_[_0x833d('0x1e')](_0x55ed9d,_0x833d('0x49')),'role':_0x833d('0x4a')},'attributes':['id',_0x833d('0x1b'),'mailPause','updatedAt',_0x833d('0x4b')]});}})[_0x833d('0x16')](function(_0x4b57df){if(_0x4b57df){return{'count':_0x4b57df[_0x833d('0x12')],'rows':_[_0x833d('0x1e')](_0x4b57df[_0x833d('0x27')],function(_0x5987b8){return{'membername':_0x5987b8[_0x833d('0x1b')],'UserId':_0x5987b8['id'],'queue_name':_0x5b2c4b[_0x833d('0x1b')],'MailQueueId':_0x5b2c4b['id'],'interface':util[_0x833d('0x4c')](_0x833d('0x4d'),'SIP',_0x5987b8[_0x833d('0x1b')]),'penalty':0x0,'paused':_0x5987b8[_0x833d('0x4e')],'createdAt':_0x5987b8[_0x833d('0x4b')],'updatedAt':_0x5987b8[_0x833d('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x833d('0x16')](respondWithFilteredResult(_0x2091b0,_0x61bba3))[_0x833d('0x33')](handleError(_0x2091b0,null));};exports[_0x833d('0x50')]=function(_0x2d3ba5,_0x1a5586){var _0x46324f={};var _0x31ad21={};var _0x2715e6;var _0x57efe4;return db[_0x833d('0x1f')][_0x833d('0x3f')]({'where':{'id':_0x2d3ba5[_0x833d('0x29')]['id']}})[_0x833d('0x16')](handleEntityNotFound(_0x1a5586,null))[_0x833d('0x16')](function(_0x5ddf46){if(_0x5ddf46){_0x2715e6=_0x5ddf46;_0x31ad21['model']=_[_0x833d('0x2b')](db[_0x833d('0x51')][_0x833d('0x20')]);_0x31ad21[_0x833d('0x2c')]=_[_0x833d('0x2b')](_0x2d3ba5[_0x833d('0x2c')]);_0x31ad21[_0x833d('0x2d')]=_[_0x833d('0x2e')](_0x31ad21['model'],_0x31ad21['query']);_0x46324f['attributes']=_[_0x833d('0x2e')](_0x31ad21[_0x833d('0x2a')],qs['fields'](_0x2d3ba5[_0x833d('0x2c')][_0x833d('0x30')]));_0x46324f[_0x833d('0x2f')]=_0x46324f['attributes'][_0x833d('0x52')]?_0x46324f[_0x833d('0x2f')]:_0x31ad21[_0x833d('0x2a')];_0x46324f[_0x833d('0x42')]=qs['sort'](_0x2d3ba5[_0x833d('0x2c')][_0x833d('0x43')]);_0x46324f[_0x833d('0x24')]=qs['filters'](_[_0x833d('0x44')](_0x2d3ba5[_0x833d('0x2c')],_0x31ad21[_0x833d('0x2d')]));if(_0x2d3ba5[_0x833d('0x2c')][_0x833d('0x45')]){_0x46324f['where']=_[_0x833d('0x46')](_0x46324f[_0x833d('0x24')],{'$or':_[_0x833d('0x1e')](_0x46324f['attributes'],function(_0x3e6fc1){var _0x14b8ec={};_0x14b8ec[_0x3e6fc1]={'$like':'%'+_0x2d3ba5[_0x833d('0x2c')][_0x833d('0x45')]+'%'};return _0x14b8ec;})});}_0x46324f=_[_0x833d('0x46')]({},_0x46324f,_0x2d3ba5[_0x833d('0x47')]);return _0x2715e6[_0x833d('0x50')](_0x46324f);}})[_0x833d('0x16')](function(_0x17d8eb){if(_0x17d8eb){_0x57efe4=_0x17d8eb[_0x833d('0x52')];if(!_0x2d3ba5[_0x833d('0x2c')][_0x833d('0x41')]('nolimit')){_0x46324f[_0x833d('0x11')]=qs[_0x833d('0x11')](_0x2d3ba5['query'][_0x833d('0x11')]);_0x46324f['offset']=qs[_0x833d('0xf')](_0x2d3ba5[_0x833d('0x2c')][_0x833d('0xf')]);}return _0x2715e6[_0x833d('0x50')](_0x46324f);}})[_0x833d('0x16')](function(_0x2b0bcd){if(_0x2b0bcd){return _0x2b0bcd?{'count':_0x57efe4,'rows':_0x2b0bcd}:null;}})['then'](respondWithResult(_0x1a5586,null))['catch'](handleError(_0x1a5586,null));};exports[_0x833d('0x53')]=function(_0x47d2be,_0x1e516e){var _0x34a457=_0x47d2be[_0x833d('0x35')]['ids'];return db[_0x833d('0x51')][_0x833d('0x26')]({'where':{'id':_0x34a457},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x833d('0x1b'),'online',_0x833d('0x54'),_0x833d('0x55')],'raw':!![]}]})[_0x833d('0x16')](function(_0x44bfe3){if(_0x44bfe3){var _0x48f856=_[_0x833d('0x56')](_0x44bfe3,function(_0x5787c9){var _0x445ff1=_0x5787c9['get']({'plain':!![]});return _0x445ff1[_0x833d('0x57')];});return db[_0x833d('0x1f')][_0x833d('0x32')]({'where':{'id':_0x47d2be[_0x833d('0x29')]['id']}})[_0x833d('0x16')](function(_0x28fe88){return db[_0x833d('0x58')][_0x833d('0x59')](function(_0x4bd461){return _0x28fe88[_0x833d('0x53')](_0x34a457,{'transaction':_0x4bd461})[_0x833d('0x16')](function(){return BPromise[_0x833d('0x5a')](_0x48f856,function(_0x4afe41){return db['UserMailQueue'][_0x833d('0x5b')]({'where':{'UserId':_0x4afe41['id'],'MailQueueId':_0x47d2be[_0x833d('0x29')]['id']},'transaction':_0x4bd461});});})[_0x833d('0x16')](function(){_0x48f856[_0x833d('0x5c')](function(_0x3a1241){socket[_0x833d('0x5d')](_0x833d('0x5e'),{'UserId':_0x3a1241['id'],'MailQueueId':_0x28fe88['id']});});});});});}})['then'](respondWithStatusCode(_0x1e516e,null))['catch'](handleError(_0x1e516e,null));};exports[_0x833d('0x5f')]=function(_0x1ae484,_0xda7bdf){return db['Team'][_0x833d('0x26')]({'where':{'id':_0x1ae484['query'][_0x833d('0x60')]},'attributes':['id'],'include':[{'model':db[_0x833d('0x48')],'as':_0x833d('0x57'),'attributes':['id'],'raw':!![]}]})[_0x833d('0x16')](handleEntityNotFound(_0xda7bdf,null))[_0x833d('0x16')](function(_0x1cdea2){var _0x37e646=_[_0x833d('0x1e')](_0x1cdea2,'id');var _0x31c329=[];var _0x12fb55=[];var _0xa08ed3=squel[_0x833d('0x61')]();_0xa08ed3[_0x833d('0x62')](_0x833d('0x63'))[_0x833d('0x64')]('team_has_mail_queues','tq')['join'](_0x833d('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x833d('0x24')]('MailQueueId\x20=\x20?',_0x1ae484[_0x833d('0x29')]['id']);for(var _0x542aae=0x0;_0x542aae<_0x1cdea2[_0x833d('0x52')];_0x542aae+=0x1){let _0x34512b=_0x1cdea2[_0x542aae];for(var _0xf7fe07=0x0;_0xf7fe07<_0x34512b['Agents'][_0x833d('0x52')];_0xf7fe07+=0x1){let _0x15a737=_0x34512b['Agents'][_0xf7fe07];var _0x6d9778=_0xa08ed3[_0x833d('0x66')]();_0x6d9778['where'](_0x833d('0x67'),_0x15a737['id']);_0x12fb55[_0x833d('0x68')](db[_0x833d('0x58')][_0x833d('0x2c')](_0x6d9778[_0x833d('0x69')](),{'type':db[_0x833d('0x58')]['QueryTypes'][_0x833d('0x6a')]})[_0x833d('0x16')](function(_0x296857){if(_0x296857[_0x833d('0x52')]===0x1){return _0x15a737['id'];}else{var _0x2f661e=_['every'](_[_0x833d('0x1e')](_0x296857,_0x833d('0x6b')),function(_0x3eed77){return _[_0x833d('0x6c')](_0x37e646,_0x3eed77);});if(_0x2f661e){return _0x15a737['id'];}}}));}}return BPromise[_0x833d('0x6d')](_0x12fb55)[_0x833d('0x16')](function(_0xe2e029){_0x31c329=_(_0x31c329)[_0x833d('0x6e')](_0xe2e029)[_0x833d('0x6f')]()[_0x833d('0x70')]();return db[_0x833d('0x1f')]['find']({'where':{'id':_0x1ae484[_0x833d('0x29')]['id']}})['then'](function(_0x29cc6d){return db[_0x833d('0x58')][_0x833d('0x59')](function(_0xe13105){return _0x29cc6d['removeTeams'](_0x1ae484[_0x833d('0x2c')]['ids'],{'transaction':_0xe13105})[_0x833d('0x16')](function(){if(!_[_0x833d('0x71')](_0x31c329)){return _0x29cc6d['removeAgents'](_0x31c329,{'transaction':_0xe13105});}})[_0x833d('0x16')](function(){_0x31c329[_0x833d('0x5c')](function(_0x4d6dd8){socket[_0x833d('0x5d')](_0x833d('0x72'),{'UserId':_0x4d6dd8,'MailQueueId':_0x29cc6d['id']});});});});});});})['then'](respondWithStatusCode(_0xda7bdf,null))[_0x833d('0x33')](handleError(_0xda7bdf,null));};exports[_0x833d('0x73')]=function(_0x29d2d3,_0x2cd621){return db[_0x833d('0x1f')][_0x833d('0x32')]({'where':{'id':_0x29d2d3[_0x833d('0x29')]['id']}})[_0x833d('0x16')](handleEntityNotFound(_0x2cd621,null))[_0x833d('0x16')](function(_0x5ad76a){if(_0x5ad76a){return _0x5ad76a[_0x833d('0x73')](_0x29d2d3['body'][_0x833d('0x60')],_[_0x833d('0x74')](_0x29d2d3['body'],[_0x833d('0x60'),'id'])||{})[_0x833d('0x75')](function(_0x4416fc){for(var _0x37ac83=0x0;_0x37ac83<_0x29d2d3[_0x833d('0x35')][_0x833d('0x60')][_0x833d('0x52')];_0x37ac83+=0x1){socket[_0x833d('0x5d')](_0x833d('0x5e'),{'UserId':Number(_0x29d2d3[_0x833d('0x35')][_0x833d('0x60')][_0x37ac83]),'MailQueueId':Number(_0x29d2d3[_0x833d('0x29')]['id'])});}return _0x4416fc;});}})[_0x833d('0x16')](respondWithResult(_0x2cd621,null))[_0x833d('0x33')](handleError(_0x2cd621,null));};exports['removeAgents']=function(_0x19c7bb,_0x9e3e92){return db['MailQueue'][_0x833d('0x32')]({'where':{'id':_0x19c7bb[_0x833d('0x29')]['id']}})['then'](handleEntityNotFound(_0x9e3e92,null))[_0x833d('0x16')](function(_0x54862f){if(_0x54862f){return _0x54862f[_0x833d('0x76')](_0x19c7bb[_0x833d('0x2c')][_0x833d('0x60')])[_0x833d('0x16')](function(){if(_[_0x833d('0x77')](_0x19c7bb[_0x833d('0x2c')][_0x833d('0x60')])){for(var _0x5bc767=0x0;_0x5bc767<_0x19c7bb[_0x833d('0x2c')][_0x833d('0x60')]['length'];_0x5bc767+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x19c7bb[_0x833d('0x2c')]['ids'][_0x5bc767]),'MailQueueId':Number(_0x19c7bb[_0x833d('0x29')]['id'])});}}else{socket['emit'](_0x833d('0x72'),{'UserId':Number(_0x19c7bb[_0x833d('0x2c')]['ids']),'MailQueueId':Number(_0x19c7bb[_0x833d('0x29')]['id'])});}});}})[_0x833d('0x16')](respondWithStatusCode(_0x9e3e92,null))['catch'](handleError(_0x9e3e92,null));};exports[_0x833d('0x78')]=function(_0x3a47e3,_0xdc9b0){var _0x263e81={};var _0x522857={};var _0x5dc0de;var _0x3070c3;return db[_0x833d('0x1f')][_0x833d('0x3f')]({'where':{'id':_0x3a47e3[_0x833d('0x29')]['id']}})[_0x833d('0x16')](handleEntityNotFound(_0xdc9b0,null))[_0x833d('0x16')](function(_0x5cd45c){if(_0x5cd45c){_0x5dc0de=_0x5cd45c;_0x522857[_0x833d('0x2a')]=_[_0x833d('0x2b')](db[_0x833d('0x48')][_0x833d('0x20')]);_0x522857[_0x833d('0x2c')]=_[_0x833d('0x2b')](_0x3a47e3['query']);_0x522857[_0x833d('0x2d')]=_[_0x833d('0x2e')](_0x522857[_0x833d('0x2a')],_0x522857[_0x833d('0x2c')]);_0x263e81[_0x833d('0x2f')]=_['intersection'](_0x522857[_0x833d('0x2a')],qs[_0x833d('0x30')](_0x3a47e3['query'][_0x833d('0x30')]));_0x263e81[_0x833d('0x2f')]=_0x263e81['attributes'][_0x833d('0x52')]?_0x263e81[_0x833d('0x2f')]:_0x522857[_0x833d('0x2a')];_0x263e81[_0x833d('0x42')]=qs[_0x833d('0x43')](_0x3a47e3[_0x833d('0x2c')][_0x833d('0x43')]);_0x263e81[_0x833d('0x24')]=qs[_0x833d('0x2d')](_[_0x833d('0x44')](_0x3a47e3[_0x833d('0x2c')],_0x522857[_0x833d('0x2d')]));if(_0x3a47e3[_0x833d('0x2c')]['filter']){_0x263e81[_0x833d('0x24')]=_[_0x833d('0x46')](_0x263e81['where'],{'$or':_[_0x833d('0x1e')](_0x263e81['attributes'],function(_0xb2a56b){var _0x259d8b={};_0x259d8b[_0xb2a56b]={'$like':'%'+_0x3a47e3['query'][_0x833d('0x45')]+'%'};return _0x259d8b;})});}_0x263e81=_[_0x833d('0x46')]({},_0x263e81,_0x3a47e3[_0x833d('0x47')]);return _0x5dc0de[_0x833d('0x78')](_0x263e81);}})[_0x833d('0x16')](function(_0xbde868){if(_0xbde868){_0x3070c3=_0xbde868[_0x833d('0x52')];if(!_0x3a47e3['query'][_0x833d('0x41')](_0x833d('0x79'))){_0x263e81['limit']=qs[_0x833d('0x11')](_0x3a47e3['query'][_0x833d('0x11')]);_0x263e81['offset']=qs[_0x833d('0xf')](_0x3a47e3[_0x833d('0x2c')][_0x833d('0xf')]);}return _0x5dc0de['getAgents'](_0x263e81);}})[_0x833d('0x16')](function(_0x3df44e){if(_0x3df44e){return _0x3df44e?{'count':_0x3070c3,'rows':_0x3df44e}:null;}})['then'](respondWithResult(_0xdc9b0,null))[_0x833d('0x33')](handleError(_0xdc9b0,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd26=['hook','exports','events','MailQueue','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x46f677,_0x18ddaf){var _0x2b661e=function(_0x29080f){while(--_0x29080f){_0x46f677['push'](_0x46f677['shift']());}};_0x2b661e(++_0x18ddaf);}(_0xcd26,0x110));var _0x6cd2=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xcd26[_0x1e8f35];return _0x446c13;};'use strict';var EventEmitter=require(_0x6cd2('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x6cd2('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6cd2('0x2')](0x0);var events={'afterCreate':_0x6cd2('0x3'),'afterUpdate':_0x6cd2('0x4'),'afterDestroy':_0x6cd2('0x5')};function emitEvent(_0x6a2e65){return function(_0x1ce288,_0x81e7e9,_0x4b0f98){MailQueueEvents['emit'](_0x6a2e65+':'+_0x1ce288['id'],_0x1ce288);MailQueueEvents['emit'](_0x6a2e65,_0x1ce288);_0x4b0f98(null);};}for(var e in events){if(events[_0x6cd2('0x6')](e)){var event=events[e];MailQueue[_0x6cd2('0x7')](e,emitEvent(event));}}module[_0x6cd2('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0x191e=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x13db76,_0x14660f){var _0x1af59e=function(_0x4bacfb){while(--_0x4bacfb){_0x13db76['push'](_0x13db76['shift']());}};_0x1af59e(++_0x14660f);}(_0x191e,0x96));var _0xe191=function(_0x564aab,_0x230d3b){_0x564aab=_0x564aab-0x0;var _0x386bcf=_0x191e[_0x564aab];return _0x386bcf;};'use strict';var EventEmitter=require(_0xe191('0x0'));var MailQueue=require(_0xe191('0x1'))['db'][_0xe191('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe191('0x3')](0x0);var events={'afterCreate':_0xe191('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x10c641){return function(_0x2ada09,_0x13ed25,_0x544b77){MailQueueEvents[_0xe191('0x5')](_0x10c641+':'+_0x2ada09['id'],_0x2ada09);MailQueueEvents[_0xe191('0x5')](_0x10c641,_0x2ada09);_0x544b77(null);};}for(var e in events){if(events[_0xe191('0x6')](e)){var event=events[e];MailQueue[_0xe191('0x7')](e,emitEvent(event));}}module[_0xe191('0x8')]=MailQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef07=['exports','define','MailQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x2894c3,_0x5ccc2a){var _0x4295ab=function(_0x3d3c28){while(--_0x3d3c28){_0x2894c3['push'](_0x2894c3['shift']());}};_0x4295ab(++_0x5ccc2a);}(_0xef07,0x1b0));var _0x7ef0=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0xef07[_0xf1af27];return _0x46b274;};'use strict';var _=require(_0x7ef0('0x0'));var util=require(_0x7ef0('0x1'));var logger=require('../../config/logger')(_0x7ef0('0x2'));var moment=require(_0x7ef0('0x3'));var BPromise=require(_0x7ef0('0x4'));var rp=require(_0x7ef0('0x5'));var fs=require('fs');var path=require(_0x7ef0('0x6'));var rimraf=require(_0x7ef0('0x7'));var config=require(_0x7ef0('0x8'));var attributes=require(_0x7ef0('0x9'));module[_0x7ef0('0xa')]=function(_0x5460e6,_0x5309e1){return _0x5460e6[_0x7ef0('0xb')](_0x7ef0('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbe8=['exports','mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x29276c,_0x2e6cf8){var _0x2e82f9=function(_0x3c714e){while(--_0x3c714e){_0x29276c['push'](_0x29276c['shift']());}};_0x2e82f9(++_0x2e6cf8);}(_0xfbe8,0x1f1));var _0x8fbe=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xfbe8[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x8fbe('0x0'));var util=require(_0x8fbe('0x1'));var logger=require(_0x8fbe('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8fbe('0x3'));var rp=require(_0x8fbe('0x4'));var fs=require('fs');var path=require(_0x8fbe('0x5'));var rimraf=require(_0x8fbe('0x6'));var config=require(_0x8fbe('0x7'));var attributes=require(_0x8fbe('0x8'));module[_0x8fbe('0x9')]=function(_0x34f171,_0x3cbcc3){return _0x34f171['define']('MailQueue',attributes,{'tableName':_0x8fbe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x823c=['find','where','ShowMailQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./mailQueue.socket','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','findAll','options','raw','include','map','model','attributes','MailQueue'];(function(_0x5391c9,_0x5aac63){var _0x297911=function(_0x5cec1f){while(--_0x5cec1f){_0x5391c9['push'](_0x5391c9['shift']());}};_0x297911(++_0x5aac63);}(_0x823c,0x143));var _0xc823=function(_0x869341,_0x2706ad){_0x869341=_0x869341-0x0;var _0x5ca37c=_0x823c[_0x869341];return _0x5ca37c;};'use strict';var _=require(_0xc823('0x0'));var util=require('util');var moment=require(_0xc823('0x1'));var BPromise=require(_0xc823('0x2'));var rs=require(_0xc823('0x3'));var fs=require('fs');var Redis=require(_0xc823('0x4'));var db=require(_0xc823('0x5'))['db'];var utils=require(_0xc823('0x6'));var logger=require('../../config/logger')(_0xc823('0x7'));var config=require(_0xc823('0x8'));var jayson=require(_0xc823('0x9'));var client=jayson[_0xc823('0xa')][_0xc823('0xb')]({'port':0x232a});config['redis']=_[_0xc823('0xc')](config[_0xc823('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc823('0xd')]));require(_0xc823('0xe'))['register'](socket);function respondWithRpcPromise(_0x43bbd8,_0x2716a0,_0x5c214c){return new BPromise(function(_0x4dbd5b,_0x409ae1){return client[_0xc823('0xf')](_0x43bbd8,_0x5c214c)[_0xc823('0x10')](function(_0x35afbd){logger[_0xc823('0x11')]('MailQueue,\x20%s,\x20%s',_0x2716a0,_0xc823('0x12'));logger[_0xc823('0x13')](_0xc823('0x14'),_0x2716a0,_0xc823('0x12'),JSON[_0xc823('0x15')](_0x35afbd));if(_0x35afbd[_0xc823('0x16')]){if(_0x35afbd['error'][_0xc823('0x17')]===0x1f4){logger[_0xc823('0x16')](_0xc823('0x18'),_0x2716a0,_0x35afbd[_0xc823('0x16')]['message']);return _0x409ae1(_0x35afbd['error']['message']);}logger['error'](_0xc823('0x18'),_0x2716a0,_0x35afbd['error'][_0xc823('0x19')]);return _0x4dbd5b(_0x35afbd[_0xc823('0x16')][_0xc823('0x19')]);}else{logger[_0xc823('0x11')](_0xc823('0x18'),_0x2716a0,_0xc823('0x12'));_0x4dbd5b(_0x35afbd[_0xc823('0x1a')]['message']);}})[_0xc823('0x1b')](function(_0x4a713a){logger[_0xc823('0x16')](_0xc823('0x18'),_0x2716a0,_0x4a713a);_0x409ae1(_0x4a713a);});});}exports[_0xc823('0x1c')]=function(_0x4fa275){var _0xf2fc30=this;return new Promise(function(_0x2cacfd,_0x3a3fcd){return db['MailQueue'][_0xc823('0x1d')]({'raw':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')][_0xc823('0x1f')]===undefined?!![]:![]:!![],'where':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')]['where']||null:null,'attributes':_0x4fa275[_0xc823('0x1e')]?_0x4fa275['options']['attributes']||null:null,'limit':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')]['limit']||null:null,'include':_0x4fa275[_0xc823('0x1e')]?_0x4fa275[_0xc823('0x1e')][_0xc823('0x20')]?_[_0xc823('0x21')](_0x4fa275[_0xc823('0x1e')][_0xc823('0x20')],function(_0x19594e){return{'model':db[_0x19594e[_0xc823('0x22')]],'as':_0x19594e['as'],'attributes':_0x19594e[_0xc823('0x23')],'include':_0x19594e[_0xc823('0x20')]?_['map'](_0x19594e[_0xc823('0x20')],function(_0x533560){return{'model':db[_0x533560['model']],'as':_0x533560['as'],'attributes':_0x533560[_0xc823('0x23')],'include':_0x533560[_0xc823('0x20')]?_[_0xc823('0x21')](_0x533560[_0xc823('0x20')],function(_0x20d2b1){return{'model':db[_0x20d2b1[_0xc823('0x22')]],'as':_0x20d2b1['as'],'attributes':_0x20d2b1[_0xc823('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc823('0x10')](function(_0x12f061){logger[_0xc823('0x11')](_0xc823('0x1c'),_0x4fa275);logger[_0xc823('0x13')](_0xc823('0x1c'),_0x4fa275,JSON[_0xc823('0x15')](_0x12f061));_0x2cacfd(_0x12f061);})[_0xc823('0x1b')](function(_0x52bd31){logger[_0xc823('0x16')](_0xc823('0x1c'),_0x52bd31[_0xc823('0x19')],_0x4fa275);_0x3a3fcd(_0xf2fc30[_0xc823('0x16')](0x1f4,_0x52bd31[_0xc823('0x19')]));});});};exports['ShowMailQueue']=function(_0x4e8312){var _0x5c6921=this;return new Promise(function(_0x35ba13,_0x176ad8){return db[_0xc823('0x24')][_0xc823('0x25')]({'raw':_0x4e8312['options']?_0x4e8312[_0xc823('0x1e')][_0xc823('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e8312[_0xc823('0x1e')]?_0x4e8312[_0xc823('0x1e')][_0xc823('0x26')]||null:null,'attributes':_0x4e8312[_0xc823('0x1e')]?_0x4e8312[_0xc823('0x1e')][_0xc823('0x23')]||null:null,'include':_0x4e8312[_0xc823('0x1e')]?_0x4e8312[_0xc823('0x1e')][_0xc823('0x20')]?_[_0xc823('0x21')](_0x4e8312[_0xc823('0x1e')]['include'],function(_0x13caa5){return{'model':db[_0x13caa5[_0xc823('0x22')]],'as':_0x13caa5['as'],'attributes':_0x13caa5[_0xc823('0x23')],'include':_0x13caa5[_0xc823('0x20')]?_[_0xc823('0x21')](_0x13caa5[_0xc823('0x20')],function(_0x48f688){return{'model':db[_0x48f688[_0xc823('0x22')]],'as':_0x48f688['as'],'attributes':_0x48f688[_0xc823('0x23')],'include':_0x48f688['include']?_[_0xc823('0x21')](_0x48f688['include'],function(_0x114045){return{'model':db[_0x114045[_0xc823('0x22')]],'as':_0x114045['as'],'attributes':_0x114045['attributes']};}):[]};}):[]};}):[]:[]})[_0xc823('0x10')](function(_0x27bb6c){logger[_0xc823('0x11')](_0xc823('0x27'),_0x4e8312);logger[_0xc823('0x13')](_0xc823('0x27'),_0x4e8312,JSON[_0xc823('0x15')](_0x27bb6c));_0x35ba13(_0x27bb6c);})['catch'](function(_0x4e8ac9){logger['error'](_0xc823('0x27'),_0x4e8ac9[_0xc823('0x19')],_0x4e8312);_0x176ad8(_0x5c6921[_0xc823('0x16')](0x1f4,_0x4e8ac9[_0xc823('0x19')]));});});};
\ No newline at end of file
+var _0xf0f4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','options','raw','where','limit','include','map','model','attributes','info','GetMailQueue','catch','find','ShowMailQueue','lodash'];(function(_0x3528de,_0x276a0b){var _0x4f3945=function(_0x169a26){while(--_0x169a26){_0x3528de['push'](_0x3528de['shift']());}};_0x4f3945(++_0x276a0b);}(_0xf0f4,0x1d3));var _0x4f0f=function(_0x1b484a,_0x12a079){_0x1b484a=_0x1b484a-0x0;var _0x3402f4=_0xf0f4[_0x1b484a];return _0x3402f4;};'use strict';var _=require(_0x4f0f('0x0'));var util=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require(_0x4f0f('0x3'));var rs=require(_0x4f0f('0x4'));var fs=require('fs');var Redis=require(_0x4f0f('0x5'));var db=require(_0x4f0f('0x6'))['db'];var utils=require(_0x4f0f('0x7'));var logger=require('../../config/logger')(_0x4f0f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f0f('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4f0f('0xa')](config[_0x4f0f('0xb')],{'host':_0x4f0f('0xc'),'port':0x18eb});var socket=require(_0x4f0f('0xd'))(new Redis(config[_0x4f0f('0xb')]));require(_0x4f0f('0xe'))[_0x4f0f('0xf')](socket);function respondWithRpcPromise(_0x336267,_0xa506f,_0xe03b81){return new BPromise(function(_0x3d5532,_0x584d03){return client[_0x4f0f('0x10')](_0x336267,_0xe03b81)[_0x4f0f('0x11')](function(_0x23af09){logger['info'](_0x4f0f('0x12'),_0xa506f,_0x4f0f('0x13'));logger[_0x4f0f('0x14')](_0x4f0f('0x15'),_0xa506f,_0x4f0f('0x13'),JSON[_0x4f0f('0x16')](_0x23af09));if(_0x23af09['error']){if(_0x23af09[_0x4f0f('0x17')][_0x4f0f('0x18')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0xa506f,_0x23af09[_0x4f0f('0x17')][_0x4f0f('0x19')]);return _0x584d03(_0x23af09[_0x4f0f('0x17')]['message']);}logger[_0x4f0f('0x17')](_0x4f0f('0x12'),_0xa506f,_0x23af09[_0x4f0f('0x17')][_0x4f0f('0x19')]);return _0x3d5532(_0x23af09[_0x4f0f('0x17')][_0x4f0f('0x19')]);}else{logger['info'](_0x4f0f('0x12'),_0xa506f,'request\x20sent');_0x3d5532(_0x23af09['result'][_0x4f0f('0x19')]);}})['catch'](function(_0x336178){logger[_0x4f0f('0x17')](_0x4f0f('0x12'),_0xa506f,_0x336178);_0x584d03(_0x336178);});});}exports['GetMailQueue']=function(_0x585b1e){var _0x2974d8=this;return new Promise(function(_0x22e6cc,_0x5ebe60){return db['MailQueue']['findAll']({'raw':_0x585b1e[_0x4f0f('0x1a')]?_0x585b1e[_0x4f0f('0x1a')][_0x4f0f('0x1b')]===undefined?!![]:![]:!![],'where':_0x585b1e[_0x4f0f('0x1a')]?_0x585b1e[_0x4f0f('0x1a')][_0x4f0f('0x1c')]||null:null,'attributes':_0x585b1e[_0x4f0f('0x1a')]?_0x585b1e[_0x4f0f('0x1a')]['attributes']||null:null,'limit':_0x585b1e[_0x4f0f('0x1a')]?_0x585b1e[_0x4f0f('0x1a')][_0x4f0f('0x1d')]||null:null,'include':_0x585b1e[_0x4f0f('0x1a')]?_0x585b1e[_0x4f0f('0x1a')][_0x4f0f('0x1e')]?_[_0x4f0f('0x1f')](_0x585b1e['options'][_0x4f0f('0x1e')],function(_0x35f4d8){return{'model':db[_0x35f4d8[_0x4f0f('0x20')]],'as':_0x35f4d8['as'],'attributes':_0x35f4d8[_0x4f0f('0x21')],'include':_0x35f4d8[_0x4f0f('0x1e')]?_[_0x4f0f('0x1f')](_0x35f4d8[_0x4f0f('0x1e')],function(_0x46963b){return{'model':db[_0x46963b['model']],'as':_0x46963b['as'],'attributes':_0x46963b['attributes'],'include':_0x46963b[_0x4f0f('0x1e')]?_[_0x4f0f('0x1f')](_0x46963b[_0x4f0f('0x1e')],function(_0x2cb004){return{'model':db[_0x2cb004[_0x4f0f('0x20')]],'as':_0x2cb004['as'],'attributes':_0x2cb004[_0x4f0f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4f0f('0x11')](function(_0x190b3c){logger[_0x4f0f('0x22')](_0x4f0f('0x23'),_0x585b1e);logger[_0x4f0f('0x14')]('GetMailQueue',_0x585b1e,JSON[_0x4f0f('0x16')](_0x190b3c));_0x22e6cc(_0x190b3c);})[_0x4f0f('0x24')](function(_0x5dc2a6){logger[_0x4f0f('0x17')]('GetMailQueue',_0x5dc2a6['message'],_0x585b1e);_0x5ebe60(_0x2974d8[_0x4f0f('0x17')](0x1f4,_0x5dc2a6[_0x4f0f('0x19')]));});});};exports['ShowMailQueue']=function(_0x308669){var _0x200278=this;return new Promise(function(_0x27ffc8,_0x4ffe69){return db['MailQueue'][_0x4f0f('0x25')]({'raw':_0x308669[_0x4f0f('0x1a')]?_0x308669[_0x4f0f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x308669['options']?_0x308669['options'][_0x4f0f('0x1c')]||null:null,'attributes':_0x308669[_0x4f0f('0x1a')]?_0x308669[_0x4f0f('0x1a')]['attributes']||null:null,'include':_0x308669[_0x4f0f('0x1a')]?_0x308669[_0x4f0f('0x1a')]['include']?_['map'](_0x308669['options'][_0x4f0f('0x1e')],function(_0x289405){return{'model':db[_0x289405[_0x4f0f('0x20')]],'as':_0x289405['as'],'attributes':_0x289405[_0x4f0f('0x21')],'include':_0x289405[_0x4f0f('0x1e')]?_[_0x4f0f('0x1f')](_0x289405['include'],function(_0x19a53c){return{'model':db[_0x19a53c[_0x4f0f('0x20')]],'as':_0x19a53c['as'],'attributes':_0x19a53c[_0x4f0f('0x21')],'include':_0x19a53c[_0x4f0f('0x1e')]?_[_0x4f0f('0x1f')](_0x19a53c[_0x4f0f('0x1e')],function(_0x465705){return{'model':db[_0x465705[_0x4f0f('0x20')]],'as':_0x465705['as'],'attributes':_0x465705['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f0f('0x11')](function(_0x519af0){logger[_0x4f0f('0x22')](_0x4f0f('0x26'),_0x308669);logger[_0x4f0f('0x14')](_0x4f0f('0x26'),_0x308669,JSON[_0x4f0f('0x16')](_0x519af0));_0x27ffc8(_0x519af0);})[_0x4f0f('0x24')](function(_0x23508d){logger['error'](_0x4f0f('0x26'),_0x23508d[_0x4f0f('0x19')],_0x308669);_0x4ffe69(_0x200278[_0x4f0f('0x17')](0x1f4,_0x23508d[_0x4f0f('0x19')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ea0=['length','mailQueue:','./mailQueue.events','remove','emit','removeListener','register'];(function(_0x1ad725,_0x2292ab){var _0x41c63b=function(_0x20d5be){while(--_0x20d5be){_0x1ad725['push'](_0x1ad725['shift']());}};_0x41c63b(++_0x2292ab);}(_0x4ea0,0x8e));var _0x04ea=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x4ea0[_0x41382c];return _0x4da35b;};'use strict';var MailQueueEvents=require(_0x04ea('0x0'));var events=['save',_0x04ea('0x1'),'update'];function createListener(_0x59d230,_0x3a3822){return function(_0x4c732a){_0x3a3822[_0x04ea('0x2')](_0x59d230,_0x4c732a);};}function removeListener(_0x3e12f2,_0x2bba27){return function(){MailQueueEvents[_0x04ea('0x3')](_0x3e12f2,_0x2bba27);};}exports[_0x04ea('0x4')]=function(_0x155701){for(var _0x6b99b=0x0,_0x214821=events[_0x04ea('0x5')];_0x6b99b<_0x214821;_0x6b99b++){var _0x4be120=events[_0x6b99b];var _0x465e4f=createListener(_0x04ea('0x6')+_0x4be120,_0x155701);MailQueueEvents['on'](_0x4be120,_0x465e4f);}};
\ No newline at end of file
+var _0xe7d6=['register','./mailQueue.events','remove','update'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xe7d6,0x85));var _0x6e7d=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0xe7d6[_0x1ebe90];return _0x447c82;};'use strict';var MailQueueEvents=require(_0x6e7d('0x0'));var events=['save',_0x6e7d('0x1'),_0x6e7d('0x2')];function createListener(_0xf91a1,_0x5ec949){return function(_0x5eea9b){_0x5ec949['emit'](_0xf91a1,_0x5eea9b);};}function removeListener(_0x2ba59f,_0x23b386){return function(){MailQueueEvents['removeListener'](_0x2ba59f,_0x23b386);};}exports[_0x6e7d('0x3')]=function(_0x17339b){for(var _0x41b1db=0x0,_0x1bec54=events['length'];_0x41b1db<_0x1bec54;_0x41b1db++){var _0x4587ee=events[_0x41b1db];var _0x3bdbc7=createListener('mailQueue:'+_0x4587ee,_0x17339b);MailQueueEvents['on'](_0x4587ee,_0x3bdbc7);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc589=['isAuthenticated','index','/describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc589,0xf2));var _0x9c58=function(_0x232fee,_0x41f4b8){_0x232fee=_0x232fee-0x0;var _0x3e34f5=_0xc589[_0x232fee];return _0x3e34f5;};'use strict';var multer=require(_0x9c58('0x0'));var util=require(_0x9c58('0x1'));var path=require(_0x9c58('0x2'));var timeout=require(_0x9c58('0x3'));var express=require('express');var router=express[_0x9c58('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c58('0x5'));var interaction=require(_0x9c58('0x6'));var config=require(_0x9c58('0x7'));var controller=require(_0x9c58('0x8'));router[_0x9c58('0x9')]('/',auth[_0x9c58('0xa')](),controller[_0x9c58('0xb')]);router[_0x9c58('0x9')](_0x9c58('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x9c58('0xa')](),controller[_0x9c58('0xd')]);router[_0x9c58('0xe')]('/',auth[_0x9c58('0xa')](),controller[_0x9c58('0xf')]);router[_0x9c58('0x10')](_0x9c58('0x11'),auth[_0x9c58('0xa')](),controller['update']);router[_0x9c58('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9c58('0x13')]);module[_0x9c58('0x14')]=router;
\ No newline at end of file
+var _0x15cc=['../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x130e9b,_0x1bbfb9){var _0x36a9a3=function(_0x2a8124){while(--_0x2a8124){_0x130e9b['push'](_0x130e9b['shift']());}};_0x36a9a3(++_0x1bbfb9);}(_0x15cc,0xe9));var _0xc15c=function(_0x1aaeb5,_0x48d8ed){_0x1aaeb5=_0x1aaeb5-0x0;var _0x54451a=_0x15cc[_0x1aaeb5];return _0x54451a;};'use strict';var multer=require(_0xc15c('0x0'));var util=require(_0xc15c('0x1'));var path=require(_0xc15c('0x2'));var timeout=require(_0xc15c('0x3'));var express=require(_0xc15c('0x4'));var router=express[_0xc15c('0x5')]();var fs_extra=require(_0xc15c('0x6'));var auth=require(_0xc15c('0x7'));var interaction=require(_0xc15c('0x8'));var config=require(_0xc15c('0x9'));var controller=require(_0xc15c('0xa'));router[_0xc15c('0xb')]('/',auth[_0xc15c('0xc')](),controller[_0xc15c('0xd')]);router[_0xc15c('0xb')](_0xc15c('0xe'),auth[_0xc15c('0xc')](),controller['describe']);router[_0xc15c('0xb')](_0xc15c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xc15c('0x10')]('/',auth[_0xc15c('0xc')](),controller[_0xc15c('0x11')]);router[_0xc15c('0x12')](_0xc15c('0xf'),auth[_0xc15c('0xc')](),controller[_0xc15c('0x13')]);router[_0xc15c('0x14')](_0xc15c('0xf'),auth[_0xc15c('0xc')](),controller[_0xc15c('0x15')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae1c=['DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae1c,0xff));var _0xcae1=function(_0x9fa734,_0x1b128e){_0x9fa734=_0x9fa734-0x0;var _0x14c91b=_0xae1c[_0x9fa734];return _0x14c91b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcae1('0x0')]},'joinAt':{'type':Sequelize[_0xcae1('0x1')]},'leaveAt':{'type':Sequelize[_0xcae1('0x1')]},'acceptAt':{'type':Sequelize[_0xcae1('0x1')]},'exitAt':{'type':Sequelize[_0xcae1('0x1')]},'reason':{'type':Sequelize[_0xcae1('0x0')]}};
\ No newline at end of file
+var _0xc87b=['DATE','moment','sequelize','exports','STRING'];(function(_0x65c22,_0xdba31e){var _0x2a414b=function(_0x4d8a53){while(--_0x4d8a53){_0x65c22['push'](_0x65c22['shift']());}};_0x2a414b(++_0xdba31e);}(_0xc87b,0x88));var _0xbc87=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xc87b[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0xbc87('0x0'));var Sequelize=require(_0xbc87('0x1'));module[_0xbc87('0x2')]={'uniqueid':{'type':Sequelize[_0xbc87('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbc87('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbc87('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5af=['length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','catch','params','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe5af,0x9c));var _0xfe5a=function(_0x51d964,_0x2f6bdc){_0x51d964=_0x51d964-0x0;var _0x3e5905=_0xe5af[_0x51d964];return _0x3e5905;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe5a('0x0'));var zipdir=require(_0xfe5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe5a('0x2'));var moment=require(_0xfe5a('0x3'));var BPromise=require(_0xfe5a('0x4'));var Mustache=require('mustache');var util=require(_0xfe5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfe5a('0x6'));var ejs=require(_0xfe5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5a('0xf'));var logger=require(_0xfe5a('0x10'))(_0xfe5a('0x11'));var utils=require(_0xfe5a('0x12'));var config=require(_0xfe5a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe5a('0x14'))['db'];function respondWithStatusCode(_0x9d1f4f,_0x20b206){_0x20b206=_0x20b206||0xcc;return function(_0x374ded){if(_0x374ded){return _0x9d1f4f[_0xfe5a('0x15')](_0x20b206);}return _0x9d1f4f['status'](_0x20b206)[_0xfe5a('0x16')]();};}function respondWithResult(_0x17bbbe,_0x42969b){_0x42969b=_0x42969b||0xc8;return function(_0x362115){if(_0x362115){return _0x17bbbe[_0xfe5a('0x17')](_0x42969b)[_0xfe5a('0x18')](_0x362115);}};}function respondWithFilteredResult(_0x375380,_0xeb454){return function(_0x111d4d){if(_0x111d4d){var _0x18c57b=typeof _0xeb454[_0xfe5a('0x19')]===_0xfe5a('0x1a')&&typeof _0xeb454[_0xfe5a('0x1b')]===_0xfe5a('0x1a');var _0x3edcab=_0x111d4d[_0xfe5a('0x1c')];var _0x5bf597=_0x18c57b?0x0:_0xeb454[_0xfe5a('0x19')];var _0x456707=_0x18c57b?_0x111d4d['count']:_0xeb454[_0xfe5a('0x19')]+_0xeb454[_0xfe5a('0x1b')];var _0x39d905;if(_0x456707>=_0x3edcab){_0x456707=_0x3edcab;_0x39d905=0xc8;}else{_0x39d905=0xce;}_0x375380['status'](_0x39d905);return _0x375380['set'](_0xfe5a('0x1d'),_0x5bf597+'-'+_0x456707+'/'+_0x3edcab)[_0xfe5a('0x18')](_0x111d4d);}return null;};}function patchUpdates(_0xded538){return function(_0x3b3022){try{jsonpatch[_0xfe5a('0x1e')](_0x3b3022,_0xded538,!![]);}catch(_0x355869){return BPromise['reject'](_0x355869);}return _0x3b3022[_0xfe5a('0x1f')]();};}function saveUpdates(_0x592521,_0x3dfa57){return function(_0x39d825){if(_0x39d825){return _0x39d825[_0xfe5a('0x20')](_0x592521)['then'](function(_0x4bbef1){return _0x4bbef1;});}return null;};}function removeEntity(_0x247be4,_0x3e55fd){return function(_0x494df3){if(_0x494df3){return _0x494df3[_0xfe5a('0x21')]()[_0xfe5a('0x22')](function(){_0x247be4['status'](0xcc)[_0xfe5a('0x16')]();});}};}function handleEntityNotFound(_0x3a4f3c,_0x31cc60){return function(_0x2b4f1c){if(!_0x2b4f1c){_0x3a4f3c['sendStatus'](0x194);}return _0x2b4f1c;};}function handleError(_0x42136e,_0x2f5d04){_0x2f5d04=_0x2f5d04||0x1f4;return function(_0x24481f){logger[_0xfe5a('0x23')](_0x24481f[_0xfe5a('0x24')]);if(_0x24481f[_0xfe5a('0x25')]){delete _0x24481f[_0xfe5a('0x25')];}_0x42136e[_0xfe5a('0x17')](_0x2f5d04)['send'](_0x24481f);};}exports['index']=function(_0x712b44,_0x485f9d){var _0xc53869={},_0xfcb05b={},_0x11bf97={'count':0x0,'rows':[]};var _0x482a35=_['map'](db['MailQueueReport'][_0xfe5a('0x26')],function(_0x582f2d){return{'name':_0x582f2d['fieldName'],'type':_0x582f2d['type'][_0xfe5a('0x27')]};});_0xfcb05b[_0xfe5a('0x28')]=_[_0xfe5a('0x29')](_0x482a35,_0xfe5a('0x25'));_0xfcb05b[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x712b44[_0xfe5a('0x2a')]);_0xfcb05b[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],_0xfcb05b[_0xfe5a('0x2a')]);_0xc53869['attributes']=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],qs['fields'](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0xc53869[_0xfe5a('0x2f')]=_0xc53869[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0xc53869['attributes']:_0xfcb05b['model'];if(!_0x712b44[_0xfe5a('0x2a')]['hasOwnProperty'](_0xfe5a('0x31'))){_0xc53869[_0xfe5a('0x1b')]=qs[_0xfe5a('0x1b')](_0x712b44[_0xfe5a('0x2a')]['limit']);_0xc53869[_0xfe5a('0x19')]=qs[_0xfe5a('0x19')](_0x712b44[_0xfe5a('0x2a')]['offset']);}_0xc53869[_0xfe5a('0x32')]=qs[_0xfe5a('0x33')](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x33')]);_0xc53869['where']=qs[_0xfe5a('0x2c')](_['pick'](_0x712b44[_0xfe5a('0x2a')],_0xfcb05b[_0xfe5a('0x2c')]),_0x482a35);if(_0x712b44['query'][_0xfe5a('0x34')]){_0xc53869[_0xfe5a('0x35')]=_[_0xfe5a('0x36')](_0xc53869[_0xfe5a('0x35')],{'$or':_['map'](_0x482a35,function(_0x193ce0){if(_0x193ce0[_0xfe5a('0x37')]!==_0xfe5a('0x38')){var _0x560088={};_0x560088[_0x193ce0[_0xfe5a('0x25')]]={'$like':'%'+_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x34')]+'%'};return _0x560088;}})});}_0xc53869=_[_0xfe5a('0x36')]({},_0xc53869,_0x712b44[_0xfe5a('0x39')]);var _0x162c48={'where':_0xc53869[_0xfe5a('0x35')]};return db[_0xfe5a('0x3a')][_0xfe5a('0x1c')](_0x162c48)[_0xfe5a('0x22')](function(_0x20da14){_0x11bf97['count']=_0x20da14;if(_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0xc53869[_0xfe5a('0x3c')]=[{'all':!![]}];}return db[_0xfe5a('0x3a')][_0xfe5a('0x3d')](_0xc53869);})[_0xfe5a('0x22')](function(_0x3475fb){_0x11bf97['rows']=_0x3475fb;return _0x11bf97;})[_0xfe5a('0x22')](respondWithFilteredResult(_0x485f9d,_0xc53869))[_0xfe5a('0x3e')](handleError(_0x485f9d,null));};exports['show']=function(_0x59caa1,_0x252904){var _0x4c17fd={'raw':!![],'where':{'id':_0x59caa1[_0xfe5a('0x3f')]['id']}},_0x54096d={};_0x54096d[_0xfe5a('0x28')]=_['keys'](db[_0xfe5a('0x3a')]['rawAttributes']);_0x54096d[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x59caa1[_0xfe5a('0x2a')]);_0x54096d[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],_0x54096d['query']);_0x4c17fd[_0xfe5a('0x2f')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],qs[_0xfe5a('0x2e')](_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0x4c17fd[_0xfe5a('0x2f')]=_0x4c17fd[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0x4c17fd[_0xfe5a('0x2f')]:_0x54096d[_0xfe5a('0x28')];if(_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0x4c17fd[_0xfe5a('0x3c')]=[{'all':!![]}];}_0x4c17fd=_['merge']({},_0x4c17fd,_0x59caa1[_0xfe5a('0x39')]);return db[_0xfe5a('0x3a')]['find'](_0x4c17fd)['then'](handleEntityNotFound(_0x252904,null))[_0xfe5a('0x22')](respondWithResult(_0x252904,null))[_0xfe5a('0x3e')](handleError(_0x252904,null));};exports[_0xfe5a('0x40')]=function(_0x3ccf98,_0x3cf1b5){return db[_0xfe5a('0x3a')][_0xfe5a('0x40')](_0x3ccf98['body'],{})[_0xfe5a('0x22')](respondWithResult(_0x3cf1b5,0xc9))['catch'](handleError(_0x3cf1b5,null));};exports[_0xfe5a('0x20')]=function(_0x5a807e,_0x433562){if(_0x5a807e[_0xfe5a('0x41')]['id']){delete _0x5a807e[_0xfe5a('0x41')]['id'];}return db[_0xfe5a('0x3a')]['find']({'where':{'id':_0x5a807e[_0xfe5a('0x3f')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x433562,null))['then'](saveUpdates(_0x5a807e[_0xfe5a('0x41')],null))['then'](respondWithResult(_0x433562,null))['catch'](handleError(_0x433562,null));};exports[_0xfe5a('0x21')]=function(_0x4e02c9,_0x374ce5){return db[_0xfe5a('0x3a')][_0xfe5a('0x42')]({'where':{'id':_0x4e02c9[_0xfe5a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x374ce5,null))[_0xfe5a('0x22')](removeEntity(_0x374ce5,null))['catch'](handleError(_0x374ce5,null));};exports[_0xfe5a('0x43')]=function(_0x38409b,_0x149132){return db['MailQueueReport'][_0xfe5a('0x43')]()[_0xfe5a('0x22')](respondWithResult(_0x149132,null))['catch'](handleError(_0x149132,null));};
\ No newline at end of file
+var _0x8aad=['sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0xf3761,_0x112ac6){var _0x5a0725=function(_0xddb7a1){while(--_0xddb7a1){_0xf3761['push'](_0xf3761['shift']());}};_0x5a0725(++_0x112ac6);}(_0x8aad,0x146));var _0xd8aa=function(_0x5e821a,_0x19b887){_0x5e821a=_0x5e821a-0x0;var _0x258529=_0x8aad[_0x5e821a];return _0x258529;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];function respondWithStatusCode(_0x6ec0eb,_0x549fad){_0x549fad=_0x549fad||0xcc;return function(_0x1e7db8){if(_0x1e7db8){return _0x6ec0eb[_0xd8aa('0x17')](_0x549fad);}return _0x6ec0eb[_0xd8aa('0x18')](_0x549fad)['end']();};}function respondWithResult(_0x5a8c79,_0x275eff){_0x275eff=_0x275eff||0xc8;return function(_0x319ffe){if(_0x319ffe){return _0x5a8c79[_0xd8aa('0x18')](_0x275eff)['json'](_0x319ffe);}};}function respondWithFilteredResult(_0x2678ed,_0x180c56){return function(_0x39b5bc){if(_0x39b5bc){var _0x404ed6=typeof _0x180c56['offset']===_0xd8aa('0x19')&&typeof _0x180c56[_0xd8aa('0x1a')]==='undefined';var _0x16d5c6=_0x39b5bc[_0xd8aa('0x1b')];var _0x32e2cd=_0x404ed6?0x0:_0x180c56[_0xd8aa('0x1c')];var _0x2d34ac=_0x404ed6?_0x39b5bc['count']:_0x180c56[_0xd8aa('0x1c')]+_0x180c56[_0xd8aa('0x1a')];var _0xb156e6;if(_0x2d34ac>=_0x16d5c6){_0x2d34ac=_0x16d5c6;_0xb156e6=0xc8;}else{_0xb156e6=0xce;}_0x2678ed[_0xd8aa('0x18')](_0xb156e6);return _0x2678ed['set'](_0xd8aa('0x1d'),_0x32e2cd+'-'+_0x2d34ac+'/'+_0x16d5c6)[_0xd8aa('0x1e')](_0x39b5bc);}return null;};}function patchUpdates(_0x46d69b){return function(_0x3588ee){try{jsonpatch[_0xd8aa('0x1f')](_0x3588ee,_0x46d69b,!![]);}catch(_0x4fe5d8){return BPromise[_0xd8aa('0x20')](_0x4fe5d8);}return _0x3588ee[_0xd8aa('0x21')]();};}function saveUpdates(_0xc4f55c,_0x5910b3){return function(_0xa7cf85){if(_0xa7cf85){return _0xa7cf85[_0xd8aa('0x22')](_0xc4f55c)[_0xd8aa('0x23')](function(_0x290849){return _0x290849;});}return null;};}function removeEntity(_0x3ef3a9,_0x16758a){return function(_0x1f64f8){if(_0x1f64f8){return _0x1f64f8[_0xd8aa('0x24')]()[_0xd8aa('0x23')](function(){_0x3ef3a9[_0xd8aa('0x18')](0xcc)[_0xd8aa('0x25')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x17')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x26')](_0x1f6ab2[_0xd8aa('0x27')]);if(_0x1f6ab2[_0xd8aa('0x28')]){delete _0x1f6ab2[_0xd8aa('0x28')];}_0x59eb3f[_0xd8aa('0x18')](_0xd4d204)[_0xd8aa('0x29')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=_[_0xd8aa('0x2a')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')],function(_0x168a2e){return{'name':_0x168a2e[_0xd8aa('0x2d')],'type':_0x168a2e[_0xd8aa('0x2e')][_0xd8aa('0x2f')]};});_0x49a7c8[_0xd8aa('0x30')]=_['map'](_0x51c6f4,_0xd8aa('0x28'));_0x49a7c8[_0xd8aa('0x31')]=_[_0xd8aa('0x32')](_0x1f2a28[_0xd8aa('0x31')]);_0x49a7c8[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],_0x49a7c8[_0xd8aa('0x31')]);_0x214393['attributes']=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],qs[_0xd8aa('0x35')](_0x1f2a28['query'][_0xd8aa('0x35')]));_0x214393[_0xd8aa('0x36')]=_0x214393[_0xd8aa('0x36')][_0xd8aa('0x37')]?_0x214393[_0xd8aa('0x36')]:_0x49a7c8[_0xd8aa('0x30')];if(!_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x38')](_0xd8aa('0x39'))){_0x214393['limit']=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x1c')]=qs[_0xd8aa('0x1c')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1c')]);}_0x214393[_0xd8aa('0x3a')]=qs[_0xd8aa('0x3b')](_0x1f2a28['query'][_0xd8aa('0x3b')]);_0x214393['where']=qs[_0xd8aa('0x33')](_[_0xd8aa('0x3c')](_0x1f2a28['query'],_0x49a7c8[_0xd8aa('0x33')]),_0x51c6f4);if(_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]){_0x214393[_0xd8aa('0x3e')]=_[_0xd8aa('0x3f')](_0x214393['where'],{'$or':_['map'](_0x51c6f4,function(_0x25145c){if(_0x25145c['type']!==_0xd8aa('0x40')){var _0x7a6df2={};_0x7a6df2[_0x25145c[_0xd8aa('0x28')]]={'$like':'%'+_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]+'%'};return _0x7a6df2;}})});}_0x214393=_[_0xd8aa('0x3f')]({},_0x214393,_0x1f2a28[_0xd8aa('0x41')]);var _0x3b0220={'where':_0x214393[_0xd8aa('0x3e')]};return db[_0xd8aa('0x2b')][_0xd8aa('0x1b')](_0x3b0220)['then'](function(_0x17ebb4){_0x19a59d[_0xd8aa('0x1b')]=_0x17ebb4;if(_0x1f2a28[_0xd8aa('0x31')]['includeAll']){_0x214393[_0xd8aa('0x42')]=[{'all':!![]}];}return db[_0xd8aa('0x2b')][_0xd8aa('0x43')](_0x214393);})[_0xd8aa('0x23')](function(_0x3a0284){_0x19a59d[_0xd8aa('0x44')]=_0x3a0284;return _0x19a59d;})[_0xd8aa('0x23')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x45')](handleError(_0x34b792,null));};exports[_0xd8aa('0x46')]=function(_0x3f5857,_0x20c7a0){var _0x3ec42f={'raw':!![],'where':{'id':_0x3f5857[_0xd8aa('0x47')]['id']}},_0x3b26c9={};_0x3b26c9[_0xd8aa('0x30')]=_[_0xd8aa('0x32')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')]);_0x3b26c9['query']=_[_0xd8aa('0x32')](_0x3f5857[_0xd8aa('0x31')]);_0x3b26c9[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x3b26c9[_0xd8aa('0x30')],_0x3b26c9[_0xd8aa('0x31')]);_0x3ec42f['attributes']=_[_0xd8aa('0x34')](_0x3b26c9['model'],qs[_0xd8aa('0x35')](_0x3f5857['query'][_0xd8aa('0x35')]));_0x3ec42f['attributes']=_0x3ec42f['attributes'][_0xd8aa('0x37')]?_0x3ec42f[_0xd8aa('0x36')]:_0x3b26c9[_0xd8aa('0x30')];if(_0x3f5857[_0xd8aa('0x31')][_0xd8aa('0x48')]){_0x3ec42f[_0xd8aa('0x42')]=[{'all':!![]}];}_0x3ec42f=_['merge']({},_0x3ec42f,_0x3f5857[_0xd8aa('0x41')]);return db[_0xd8aa('0x2b')][_0xd8aa('0x49')](_0x3ec42f)[_0xd8aa('0x23')](handleEntityNotFound(_0x20c7a0,null))[_0xd8aa('0x23')](respondWithResult(_0x20c7a0,null))['catch'](handleError(_0x20c7a0,null));};exports['create']=function(_0x58cf42,_0x1fd1dc){return db[_0xd8aa('0x2b')][_0xd8aa('0x4a')](_0x58cf42[_0xd8aa('0x4b')],{})[_0xd8aa('0x23')](respondWithResult(_0x1fd1dc,0xc9))[_0xd8aa('0x45')](handleError(_0x1fd1dc,null));};exports['update']=function(_0x221e2b,_0x241e23){if(_0x221e2b['body']['id']){delete _0x221e2b[_0xd8aa('0x4b')]['id'];}return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x221e2b['params']['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x241e23,null))[_0xd8aa('0x23')](saveUpdates(_0x221e2b[_0xd8aa('0x4b')],null))[_0xd8aa('0x23')](respondWithResult(_0x241e23,null))[_0xd8aa('0x45')](handleError(_0x241e23,null));};exports[_0xd8aa('0x24')]=function(_0x4f494d,_0x566d52){return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x4f494d[_0xd8aa('0x47')]['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x566d52,null))[_0xd8aa('0x23')](removeEntity(_0x566d52,null))[_0xd8aa('0x45')](handleError(_0x566d52,null));};exports[_0xd8aa('0x4c')]=function(_0x4f9d21,_0x9db7e3){return db[_0xd8aa('0x2b')]['describe']()[_0xd8aa('0x23')](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43d6=['define','report_mail_queue','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes'];(function(_0x543df8,_0x426282){var _0x4becac=function(_0x296512){while(--_0x296512){_0x543df8['push'](_0x543df8['shift']());}};_0x4becac(++_0x426282);}(_0x43d6,0xe9));var _0x643d=function(_0x5bba4d,_0x36c9b2){_0x5bba4d=_0x5bba4d-0x0;var _0x4f51fd=_0x43d6[_0x5bba4d];return _0x4f51fd;};'use strict';var _=require(_0x643d('0x0'));var util=require('util');var logger=require(_0x643d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x643d('0x2'));var rp=require(_0x643d('0x3'));var fs=require('fs');var path=require(_0x643d('0x4'));var rimraf=require(_0x643d('0x5'));var config=require('../../config/environment');var attributes=require(_0x643d('0x6'));module['exports']=function(_0x4a1c3c,_0x364e32){return _0x4a1c3c[_0x643d('0x7')]('MailQueueReport',attributes,{'tableName':_0x643d('0x8'),'paranoid':![],'indexes':[{'name':_0x643d('0x9'),'fields':[_0x643d('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x11c8=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x11c8,0x19a));var _0x811c=function(_0x26c848,_0x2e36ba){_0x26c848=_0x26c848-0x0;var _0x599488=_0x11c8[_0x26c848];return _0x599488;};'use strict';var _=require('lodash');var util=require(_0x811c('0x0'));var logger=require(_0x811c('0x1'))('api');var moment=require(_0x811c('0x2'));var BPromise=require(_0x811c('0x3'));var rp=require(_0x811c('0x4'));var fs=require('fs');var path=require(_0x811c('0x5'));var rimraf=require(_0x811c('0x6'));var config=require(_0x811c('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x811c('0x8')]=function(_0x40cc07,_0x537216){return _0x40cc07[_0x811c('0x9')](_0x811c('0xa'),attributes,{'tableName':_0x811c('0xb'),'paranoid':![],'indexes':[{'name':_0x811c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ee476,_0x1ddf71){var _0x6757=function(_0x547a11){while(--_0x547a11){_0x5ee476['push'](_0x5ee476['shift']());}};_0x6757(++_0x1ddf71);}(_0x326f,0xd1));var _0xf326=function(_0x24afcc,_0x485be3){_0x24afcc=_0x24afcc-0x0;var _0x4d5180=_0x326f[_0x24afcc];return _0x4d5180;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
+var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x546941,_0x3851ad){var _0x5a561c=function(_0x33aa24){while(--_0x33aa24){_0x546941['push'](_0x546941['shift']());}};_0x5a561c(++_0x3851ad);}(_0xdb28,0x106));var _0x8db2=function(_0x48556d,_0x58b369){_0x48556d=_0x48556d-0x0;var _0xbbb69b=_0xdb28[_0x48556d];return _0xbbb69b;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x26e105,_0x821a88){var _0x534f19=function(_0x3cbc79){while(--_0x3cbc79){_0x26e105['push'](_0x26e105['shift']());}};_0x534f19(++_0x821a88);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x36aa97,_0x5774bb){var _0x5441fa=function(_0x4c1155){while(--_0x4c1155){_0x36aa97['push'](_0x36aa97['shift']());}};_0x5441fa(++_0x5774bb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41ff=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x41ff,0x68));var _0xf41f=function(_0x1e1df4,_0x5be6d7){_0x1e1df4=_0x1e1df4-0x0;var _0x29e7f2=_0x41ff[_0x1e1df4];return _0x29e7f2;};'use strict';var Sequelize=require(_0xf41f('0x0'));module[_0xf41f('0x1')]={'description':{'type':Sequelize[_0xf41f('0x2')]},'host':{'type':Sequelize[_0xf41f('0x2')]},'authentication':{'type':Sequelize[_0xf41f('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf41f('0x2')]},'port':{'type':Sequelize[_0xf41f('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf41f('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf41f('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf41f('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf41f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfc80=['INTEGER','INBOX','sequelize','exports','BOOLEAN','STRING'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xfc80,0x17c));var _0x0fc8=function(_0x144f76,_0x2ed919){_0x144f76=_0x144f76-0x0;var _0x45e9b4=_0xfc80[_0x144f76];return _0x45e9b4;};'use strict';var Sequelize=require(_0x0fc8('0x0'));module[_0x0fc8('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0fc8('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0fc8('0x3')]},'password':{'type':Sequelize[_0x0fc8('0x3')]},'port':{'type':Sequelize[_0x0fc8('0x4')]},'tls':{'type':Sequelize[_0x0fc8('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0fc8('0x3')],'defaultValue':_0x0fc8('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x0fc8('0x3')]},'modernAuthentication':{'type':Sequelize[_0x0fc8('0x2')],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbcc=['path','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','api','moment','bluebird'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xdbcc,0x1d4));var _0xcdbc=function(_0x121a97,_0x4fb277){_0x121a97=_0x121a97-0x0;var _0x2d16b4=_0xdbcc[_0x121a97];return _0x2d16b4;};'use strict';var _=require('lodash');var util=require(_0xcdbc('0x0'));var logger=require(_0xcdbc('0x1'))(_0xcdbc('0x2'));var moment=require(_0xcdbc('0x3'));var BPromise=require(_0xcdbc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdbc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdbc('0x6'));module[_0xcdbc('0x7')]=function(_0x13be2d,_0x18ebcc){return _0x13be2d[_0xcdbc('0x8')](_0xcdbc('0x9'),attributes,{'tableName':_0xcdbc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9820=['define','MailServerIn','mail_servers_in','util','../../config/logger','moment','bluebird','path','rimraf','./mailServerIn.attributes','exports'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9820,0x14d));var _0x0982=function(_0x4e8d3e,_0x1ae293){_0x4e8d3e=_0x4e8d3e-0x0;var _0x2dd788=_0x9820[_0x4e8d3e];return _0x2dd788;};'use strict';var _=require('lodash');var util=require(_0x0982('0x0'));var logger=require(_0x0982('0x1'))('api');var moment=require(_0x0982('0x2'));var BPromise=require(_0x0982('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0982('0x4'));var rimraf=require(_0x0982('0x5'));var config=require('../../config/environment');var attributes=require(_0x0982('0x6'));module[_0x0982('0x7')]=function(_0x3f4359,_0x57b3d3){return _0x3f4359[_0x0982('0x8')](_0x0982('0x9'),attributes,{'tableName':_0x0982('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x74b8=['raw','where','map','include','model','attributes','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','findAll','options'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x74b8,0x86));var _0x874b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x74b8[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x874b('0x0'));var BPromise=require(_0x874b('0x1'));var rs=require(_0x874b('0x2'));var fs=require('fs');var Redis=require(_0x874b('0x3'));var db=require(_0x874b('0x4'))['db'];var utils=require(_0x874b('0x5'));var logger=require(_0x874b('0x6'))(_0x874b('0x7'));var config=require(_0x874b('0x8'));var jayson=require(_0x874b('0x9'));var client=jayson[_0x874b('0xa')][_0x874b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x356933,_0x305917,_0x2c3119){return new BPromise(function(_0x254c8b,_0x22341b){return client['request'](_0x356933,_0x2c3119)[_0x874b('0xc')](function(_0x2dc006){logger[_0x874b('0xd')](_0x874b('0xe'),_0x305917,_0x874b('0xf'));logger[_0x874b('0x10')](_0x874b('0x11'),_0x305917,'request\x20sent',JSON[_0x874b('0x12')](_0x2dc006));if(_0x2dc006[_0x874b('0x13')]){if(_0x2dc006[_0x874b('0x13')][_0x874b('0x14')]===0x1f4){logger['error'](_0x874b('0xe'),_0x305917,_0x2dc006[_0x874b('0x13')][_0x874b('0x15')]);return _0x22341b(_0x2dc006[_0x874b('0x13')]['message']);}logger[_0x874b('0x13')](_0x874b('0xe'),_0x305917,_0x2dc006[_0x874b('0x13')][_0x874b('0x15')]);return _0x254c8b(_0x2dc006[_0x874b('0x13')]['message']);}else{logger[_0x874b('0xd')](_0x874b('0xe'),_0x305917,_0x874b('0xf'));_0x254c8b(_0x2dc006['result'][_0x874b('0x15')]);}})[_0x874b('0x16')](function(_0x49c787){logger[_0x874b('0x13')](_0x874b('0xe'),_0x305917,_0x49c787);_0x22341b(_0x49c787);});});}exports[_0x874b('0x17')]=function(_0x27d943){var _0x4c2ffb=this;return new Promise(function(_0x14ad57,_0x4859e5){return db['MailServerIn'][_0x874b('0x18')]({'raw':_0x27d943[_0x874b('0x19')]?_0x27d943[_0x874b('0x19')][_0x874b('0x1a')]===undefined?!![]:![]:!![],'where':_0x27d943[_0x874b('0x19')]?_0x27d943[_0x874b('0x19')][_0x874b('0x1b')]||null:null,'attributes':_0x27d943['options']?_0x27d943[_0x874b('0x19')]['attributes']||null:null,'limit':_0x27d943['options']?_0x27d943[_0x874b('0x19')]['limit']||null:null,'include':_0x27d943[_0x874b('0x19')]?_0x27d943[_0x874b('0x19')]['include']?_[_0x874b('0x1c')](_0x27d943[_0x874b('0x19')][_0x874b('0x1d')],function(_0x28dfb6){return{'model':db[_0x28dfb6[_0x874b('0x1e')]],'as':_0x28dfb6['as'],'attributes':_0x28dfb6[_0x874b('0x1f')],'include':_0x28dfb6[_0x874b('0x1d')]?_[_0x874b('0x1c')](_0x28dfb6[_0x874b('0x1d')],function(_0x5bcb28){return{'model':db[_0x5bcb28[_0x874b('0x1e')]],'as':_0x5bcb28['as'],'attributes':_0x5bcb28['attributes'],'include':_0x5bcb28[_0x874b('0x1d')]?_[_0x874b('0x1c')](_0x5bcb28[_0x874b('0x1d')],function(_0x4f8d74){return{'model':db[_0x4f8d74['model']],'as':_0x4f8d74['as'],'attributes':_0x4f8d74[_0x874b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14c612){logger[_0x874b('0xd')](_0x874b('0x17'),_0x27d943);logger[_0x874b('0x10')](_0x874b('0x17'),_0x27d943,JSON[_0x874b('0x12')](_0x14c612));_0x14ad57(_0x14c612);})[_0x874b('0x16')](function(_0xc87f74){logger[_0x874b('0x13')](_0x874b('0x17'),_0xc87f74[_0x874b('0x15')],_0x27d943);_0x4859e5(_0x4c2ffb[_0x874b('0x13')](0x1f4,_0xc87f74[_0x874b('0x15')]));});});};
\ No newline at end of file
+var _0xd353=['request\x20sent','debug','stringify','error','message','result','catch','options','where','attributes','limit','include','map','GetMailServerIn','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s'];(function(_0x39578c,_0x23635b){var _0x15ee51=function(_0x1fb117){while(--_0x1fb117){_0x39578c['push'](_0x39578c['shift']());}};_0x15ee51(++_0x23635b);}(_0xd353,0x7e));var _0x3d35=function(_0x317492,_0x4b90bc){_0x317492=_0x317492-0x0;var _0x171f06=_0xd353[_0x317492];return _0x171f06;};'use strict';var _=require(_0x3d35('0x0'));var util=require(_0x3d35('0x1'));var moment=require('moment');var BPromise=require(_0x3d35('0x2'));var rs=require(_0x3d35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d35('0x4'));var logger=require('../../config/logger')(_0x3d35('0x5'));var config=require(_0x3d35('0x6'));var jayson=require(_0x3d35('0x7'));var client=jayson[_0x3d35('0x8')][_0x3d35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174b6b,_0x1cf467,_0x5db879){return new BPromise(function(_0x2dd75b,_0x15e0d9){return client[_0x3d35('0xa')](_0x174b6b,_0x5db879)[_0x3d35('0xb')](function(_0x49c42d){logger[_0x3d35('0xc')](_0x3d35('0xd'),_0x1cf467,_0x3d35('0xe'));logger[_0x3d35('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x1cf467,'request\x20sent',JSON[_0x3d35('0x10')](_0x49c42d));if(_0x49c42d['error']){if(_0x49c42d['error']['code']===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x1cf467,_0x49c42d[_0x3d35('0x11')]['message']);return _0x15e0d9(_0x49c42d[_0x3d35('0x11')][_0x3d35('0x12')]);}logger[_0x3d35('0x11')](_0x3d35('0xd'),_0x1cf467,_0x49c42d['error'][_0x3d35('0x12')]);return _0x2dd75b(_0x49c42d[_0x3d35('0x11')]['message']);}else{logger[_0x3d35('0xc')](_0x3d35('0xd'),_0x1cf467,'request\x20sent');_0x2dd75b(_0x49c42d[_0x3d35('0x13')][_0x3d35('0x12')]);}})[_0x3d35('0x14')](function(_0xdf29b0){logger[_0x3d35('0x11')](_0x3d35('0xd'),_0x1cf467,_0xdf29b0);_0x15e0d9(_0xdf29b0);});});}exports['GetMailServerIn']=function(_0x4685ce){var _0x1f06dc=this;return new Promise(function(_0x206cd3,_0x3c452a){return db['MailServerIn']['findAll']({'raw':_0x4685ce[_0x3d35('0x15')]?_0x4685ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x4685ce[_0x3d35('0x15')]?_0x4685ce[_0x3d35('0x15')][_0x3d35('0x16')]||null:null,'attributes':_0x4685ce[_0x3d35('0x15')]?_0x4685ce['options'][_0x3d35('0x17')]||null:null,'limit':_0x4685ce['options']?_0x4685ce[_0x3d35('0x15')][_0x3d35('0x18')]||null:null,'include':_0x4685ce[_0x3d35('0x15')]?_0x4685ce[_0x3d35('0x15')][_0x3d35('0x19')]?_[_0x3d35('0x1a')](_0x4685ce[_0x3d35('0x15')][_0x3d35('0x19')],function(_0xe8fcaa){return{'model':db[_0xe8fcaa['model']],'as':_0xe8fcaa['as'],'attributes':_0xe8fcaa['attributes'],'include':_0xe8fcaa['include']?_[_0x3d35('0x1a')](_0xe8fcaa[_0x3d35('0x19')],function(_0xa9d142){return{'model':db[_0xa9d142['model']],'as':_0xa9d142['as'],'attributes':_0xa9d142[_0x3d35('0x17')],'include':_0xa9d142['include']?_['map'](_0xa9d142['include'],function(_0x5eacc0){return{'model':db[_0x5eacc0['model']],'as':_0x5eacc0['as'],'attributes':_0x5eacc0[_0x3d35('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3d35('0xb')](function(_0x4fb07f){logger['info']('GetMailServerIn',_0x4685ce);logger[_0x3d35('0xf')](_0x3d35('0x1b'),_0x4685ce,JSON[_0x3d35('0x10')](_0x4fb07f));_0x206cd3(_0x4fb07f);})[_0x3d35('0x14')](function(_0x23c62a){logger['error'](_0x3d35('0x1b'),_0x23c62a[_0x3d35('0x12')],_0x4685ce);_0x3c452a(_0x1f06dc[_0x3d35('0x11')](0x1f4,_0x23c62a[_0x3d35('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x485554,_0x202e73){_0x485554=_0x485554-0x0;var _0x25ec74=_0x7a54[_0x485554];return _0x25ec74;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x69d3=['exports','STRING','sequelize'];(function(_0x3111ca,_0x4258a0){var _0x2c8bf5=function(_0x57024f){while(--_0x57024f){_0x3111ca['push'](_0x3111ca['shift']());}};_0x2c8bf5(++_0x4258a0);}(_0x69d3,0xda));var _0x369d=function(_0x316bea,_0x99a1b){_0x316bea=_0x316bea-0x0;var _0x501d3f=_0x69d3[_0x316bea];return _0x501d3f;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'description':{'type':Sequelize[_0x369d('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x369d('0x2')]},'pass':{'type':Sequelize[_0x369d('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x369d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4fc2=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5b59da,_0x7dc61a){var _0x47d574=function(_0x1db32c){while(--_0x1db32c){_0x5b59da['push'](_0x5b59da['shift']());}};_0x47d574(++_0x7dc61a);}(_0x4fc2,0x111));var _0x24fc=function(_0x1f0d91,_0x24b032){_0x1f0d91=_0x1f0d91-0x0;var _0xafee7a=_0x4fc2[_0x1f0d91];return _0xafee7a;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'description':{'type':Sequelize[_0x24fc('0x2')]},'host':{'type':Sequelize[_0x24fc('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x24fc('0x2')]},'port':{'type':Sequelize[_0x24fc('0x3')]},'secure':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaab5=['intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','undefined','limit','count','offset','status','Content-Range','apply','save','update','destroy','error','send','MailServerOut','rawAttributes','fieldName','type','key','model','map','name','query','keys','attributes'];(function(_0xf3f0cc,_0x5a6ff3){var _0x30935a=function(_0x180114){while(--_0x180114){_0xf3f0cc['push'](_0xf3f0cc['shift']());}};_0x30935a(++_0x5a6ff3);}(_0xaab5,0x1d4));var _0x5aab=function(_0xd81555,_0x436e83){_0xd81555=_0xd81555-0x0;var _0x144c9f=_0xaab5[_0xd81555];return _0x144c9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5aab('0x1'));var rp=require(_0x5aab('0x2'));var moment=require(_0x5aab('0x3'));var BPromise=require(_0x5aab('0x4'));var Mustache=require('mustache');var util=require(_0x5aab('0x5'));var path=require(_0x5aab('0x6'));var sox=require(_0x5aab('0x7'));var csv=require(_0x5aab('0x8'));var ejs=require(_0x5aab('0x9'));var fs=require('fs');var fs_extra=require(_0x5aab('0xa'));var _=require('lodash');var squel=require(_0x5aab('0xb'));var crypto=require(_0x5aab('0xc'));var jsforce=require(_0x5aab('0xd'));var deskjs=require(_0x5aab('0xe'));var toCsv=require(_0x5aab('0x8'));var querystring=require('querystring');var Papa=require(_0x5aab('0xf'));var Redis=require(_0x5aab('0x10'));var authService=require(_0x5aab('0x11'));var qs=require(_0x5aab('0x12'));var as=require(_0x5aab('0x13'));var hardwareService=require(_0x5aab('0x14'));var logger=require(_0x5aab('0x15'))('api');var utils=require(_0x5aab('0x16'));var config=require(_0x5aab('0x17'));var licenseUtil=require(_0x5aab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45d174,_0x5458ea){_0x5458ea=_0x5458ea||0xcc;return function(_0x2bc5a0){if(_0x2bc5a0){return _0x45d174[_0x5aab('0x19')](_0x5458ea);}return _0x45d174['status'](_0x5458ea)['end']();};}function respondWithResult(_0x21c24b,_0x21e75){_0x21e75=_0x21e75||0xc8;return function(_0x4589ec){if(_0x4589ec){return _0x21c24b['status'](_0x21e75)[_0x5aab('0x1a')](_0x4589ec);}};}function respondWithFilteredResult(_0x77dc54,_0x3d0e94){return function(_0x1ed308){if(_0x1ed308){var _0x716ac9=typeof _0x3d0e94['offset']===_0x5aab('0x1b')&&typeof _0x3d0e94[_0x5aab('0x1c')]==='undefined';var _0x57cdb2=_0x1ed308[_0x5aab('0x1d')];var _0x5b8b26=_0x716ac9?0x0:_0x3d0e94[_0x5aab('0x1e')];var _0x7cc984=_0x716ac9?_0x1ed308['count']:_0x3d0e94[_0x5aab('0x1e')]+_0x3d0e94['limit'];var _0x41c345;if(_0x7cc984>=_0x57cdb2){_0x7cc984=_0x57cdb2;_0x41c345=0xc8;}else{_0x41c345=0xce;}_0x77dc54[_0x5aab('0x1f')](_0x41c345);return _0x77dc54['set'](_0x5aab('0x20'),_0x5b8b26+'-'+_0x7cc984+'/'+_0x57cdb2)[_0x5aab('0x1a')](_0x1ed308);}return null;};}function patchUpdates(_0x1be5ba){return function(_0x599be0){try{jsonpatch[_0x5aab('0x21')](_0x599be0,_0x1be5ba,!![]);}catch(_0x2a790a){return BPromise['reject'](_0x2a790a);}return _0x599be0[_0x5aab('0x22')]();};}function saveUpdates(_0x541175,_0x1f4872){return function(_0x26747b){if(_0x26747b){return _0x26747b[_0x5aab('0x23')](_0x541175)['then'](function(_0x4e0fb8){return _0x4e0fb8;});}return null;};}function removeEntity(_0x425afb,_0x4eb2b3){return function(_0x1b461e){if(_0x1b461e){return _0x1b461e[_0x5aab('0x24')]()['then'](function(){_0x425afb[_0x5aab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523c78,_0x3a2af0){return function(_0xea8b28){if(!_0xea8b28){_0x523c78['sendStatus'](0x194);}return _0xea8b28;};}function handleError(_0x5e056b,_0x159533){_0x159533=_0x159533||0x1f4;return function(_0x1b9fb2){logger[_0x5aab('0x25')](_0x1b9fb2['stack']);if(_0x1b9fb2['name']){delete _0x1b9fb2['name'];}_0x5e056b['status'](_0x159533)[_0x5aab('0x26')](_0x1b9fb2);};}exports['index']=function(_0x2161db,_0x129ccd){var _0x5bf22a={},_0x56884b={},_0x4345e8={'count':0x0,'rows':[]};var _0x1ec544=_['map'](db[_0x5aab('0x27')][_0x5aab('0x28')],function(_0x581db7){return{'name':_0x581db7[_0x5aab('0x29')],'type':_0x581db7[_0x5aab('0x2a')][_0x5aab('0x2b')]};});_0x56884b[_0x5aab('0x2c')]=_[_0x5aab('0x2d')](_0x1ec544,_0x5aab('0x2e'));_0x56884b[_0x5aab('0x2f')]=_[_0x5aab('0x30')](_0x2161db[_0x5aab('0x2f')]);_0x56884b['filters']=_['intersection'](_0x56884b[_0x5aab('0x2c')],_0x56884b['query']);_0x5bf22a[_0x5aab('0x31')]=_[_0x5aab('0x32')](_0x56884b[_0x5aab('0x2c')],qs['fields'](_0x2161db[_0x5aab('0x2f')][_0x5aab('0x33')]));_0x5bf22a[_0x5aab('0x31')]=_0x5bf22a['attributes']['length']?_0x5bf22a[_0x5aab('0x31')]:_0x56884b[_0x5aab('0x2c')];if(!_0x2161db['query'][_0x5aab('0x34')](_0x5aab('0x35'))){_0x5bf22a[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x2161db['query']['limit']);_0x5bf22a['offset']=qs['offset'](_0x2161db[_0x5aab('0x2f')][_0x5aab('0x1e')]);}_0x5bf22a[_0x5aab('0x36')]=qs['sort'](_0x2161db['query'][_0x5aab('0x37')]);_0x5bf22a[_0x5aab('0x38')]=qs[_0x5aab('0x39')](_['pick'](_0x2161db['query'],_0x56884b[_0x5aab('0x39')]),_0x1ec544);if(_0x2161db[_0x5aab('0x2f')][_0x5aab('0x3a')]){_0x5bf22a[_0x5aab('0x38')]=_[_0x5aab('0x3b')](_0x5bf22a[_0x5aab('0x38')],{'$or':_['map'](_0x1ec544,function(_0x269f9d){if(_0x269f9d['type']!==_0x5aab('0x3c')){var _0x96b80e={};_0x96b80e[_0x269f9d[_0x5aab('0x2e')]]={'$like':'%'+_0x2161db[_0x5aab('0x2f')]['filter']+'%'};return _0x96b80e;}})});}_0x5bf22a=_[_0x5aab('0x3b')]({},_0x5bf22a,_0x2161db[_0x5aab('0x3d')]);var _0x55b6ab={'where':_0x5bf22a[_0x5aab('0x38')]};return db[_0x5aab('0x27')][_0x5aab('0x1d')](_0x55b6ab)['then'](function(_0x26232f){_0x4345e8[_0x5aab('0x1d')]=_0x26232f;if(_0x2161db['query'][_0x5aab('0x3e')]){_0x5bf22a[_0x5aab('0x3f')]=[{'all':!![]}];}return db[_0x5aab('0x27')][_0x5aab('0x40')](_0x5bf22a);})['then'](function(_0x207e8b){_0x4345e8[_0x5aab('0x41')]=_0x207e8b;return _0x4345e8;})[_0x5aab('0x42')](respondWithFilteredResult(_0x129ccd,_0x5bf22a))[_0x5aab('0x43')](handleError(_0x129ccd,null));};exports[_0x5aab('0x44')]=function(_0x195961,_0x23aae1){var _0x17fda2={'raw':!![],'where':{'id':_0x195961[_0x5aab('0x45')]['id']}},_0x3be389={};_0x3be389[_0x5aab('0x2c')]=_['keys'](db[_0x5aab('0x27')][_0x5aab('0x28')]);_0x3be389[_0x5aab('0x2f')]=_[_0x5aab('0x30')](_0x195961[_0x5aab('0x2f')]);_0x3be389[_0x5aab('0x39')]=_[_0x5aab('0x32')](_0x3be389[_0x5aab('0x2c')],_0x3be389[_0x5aab('0x2f')]);_0x17fda2['attributes']=_['intersection'](_0x3be389[_0x5aab('0x2c')],qs[_0x5aab('0x33')](_0x195961[_0x5aab('0x2f')][_0x5aab('0x33')]));_0x17fda2['attributes']=_0x17fda2[_0x5aab('0x31')][_0x5aab('0x46')]?_0x17fda2[_0x5aab('0x31')]:_0x3be389['model'];if(_0x195961['query'][_0x5aab('0x3e')]){_0x17fda2[_0x5aab('0x3f')]=[{'all':!![]}];}_0x17fda2=_['merge']({},_0x17fda2,_0x195961[_0x5aab('0x3d')]);return db[_0x5aab('0x27')][_0x5aab('0x47')](_0x17fda2)['then'](handleEntityNotFound(_0x23aae1,null))[_0x5aab('0x42')](respondWithResult(_0x23aae1,null))['catch'](handleError(_0x23aae1,null));};exports[_0x5aab('0x48')]=function(_0x2034d1,_0xda668b){return db[_0x5aab('0x27')]['create'](_0x2034d1[_0x5aab('0x49')],{})[_0x5aab('0x42')](respondWithResult(_0xda668b,0xc9))[_0x5aab('0x43')](handleError(_0xda668b,null));};exports[_0x5aab('0x23')]=function(_0x2f628a,_0x31c13c){if(_0x2f628a[_0x5aab('0x49')]['id']){delete _0x2f628a[_0x5aab('0x49')]['id'];}return db[_0x5aab('0x27')][_0x5aab('0x47')]({'where':{'id':_0x2f628a[_0x5aab('0x45')]['id']}})['then'](handleEntityNotFound(_0x31c13c,null))['then'](saveUpdates(_0x2f628a[_0x5aab('0x49')],null))[_0x5aab('0x42')](respondWithResult(_0x31c13c,null))[_0x5aab('0x43')](handleError(_0x31c13c,null));};exports['destroy']=function(_0x5104ef,_0x99cc1f){return db['MailServerOut'][_0x5aab('0x47')]({'where':{'id':_0x5104ef['params']['id']}})['then'](handleEntityNotFound(_0x99cc1f,null))[_0x5aab('0x42')](removeEntity(_0x99cc1f,null))['catch'](handleError(_0x99cc1f,null));};
\ No newline at end of file
+var _0xf55c=['query','keys','filters','intersection','attributes','hasOwnProperty','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','length','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','fs-extra','lodash','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','map','MailServerOut','rawAttributes','fieldName','type','key','model'];(function(_0x489996,_0x11476e){var _0x1e22e8=function(_0x446af1){while(--_0x446af1){_0x489996['push'](_0x489996['shift']());}};_0x1e22e8(++_0x11476e);}(_0xf55c,0xeb));var _0xcf55=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf55c[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0xcf55('0x0'));var rimraf=require(_0xcf55('0x1'));var zipdir=require(_0xcf55('0x2'));var jsonpatch=require(_0xcf55('0x3'));var rp=require('request-promise');var moment=require(_0xcf55('0x4'));var BPromise=require(_0xcf55('0x5'));var Mustache=require('mustache');var util=require(_0xcf55('0x6'));var path=require('path');var sox=require(_0xcf55('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf55('0x8'));var _=require(_0xcf55('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcf55('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xcf55('0xb'));var querystring=require('querystring');var Papa=require(_0xcf55('0xc'));var Redis=require('ioredis');var authService=require(_0xcf55('0xd'));var qs=require(_0xcf55('0xe'));var as=require(_0xcf55('0xf'));var hardwareService=require(_0xcf55('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xcf55('0x11'));var config=require(_0xcf55('0x12'));var licenseUtil=require(_0xcf55('0x13'));var db=require(_0xcf55('0x14'))['db'];function respondWithStatusCode(_0x1d201d,_0x4adc92){_0x4adc92=_0x4adc92||0xcc;return function(_0x59a7f0){if(_0x59a7f0){return _0x1d201d[_0xcf55('0x15')](_0x4adc92);}return _0x1d201d['status'](_0x4adc92)[_0xcf55('0x16')]();};}function respondWithResult(_0x191819,_0x272a52){_0x272a52=_0x272a52||0xc8;return function(_0x1f6b85){if(_0x1f6b85){return _0x191819[_0xcf55('0x17')](_0x272a52)[_0xcf55('0x18')](_0x1f6b85);}};}function respondWithFilteredResult(_0x46af97,_0x764b8a){return function(_0x510499){if(_0x510499){var _0x2c533b=typeof _0x764b8a[_0xcf55('0x19')]===_0xcf55('0x1a')&&typeof _0x764b8a['limit']===_0xcf55('0x1a');var _0x354886=_0x510499[_0xcf55('0x1b')];var _0x36261c=_0x2c533b?0x0:_0x764b8a[_0xcf55('0x19')];var _0x20196f=_0x2c533b?_0x510499['count']:_0x764b8a[_0xcf55('0x19')]+_0x764b8a[_0xcf55('0x1c')];var _0x289526;if(_0x20196f>=_0x354886){_0x20196f=_0x354886;_0x289526=0xc8;}else{_0x289526=0xce;}_0x46af97[_0xcf55('0x17')](_0x289526);return _0x46af97[_0xcf55('0x1d')](_0xcf55('0x1e'),_0x36261c+'-'+_0x20196f+'/'+_0x354886)[_0xcf55('0x18')](_0x510499);}return null;};}function patchUpdates(_0x39b872){return function(_0x159b6f){try{jsonpatch[_0xcf55('0x1f')](_0x159b6f,_0x39b872,!![]);}catch(_0x439030){return BPromise[_0xcf55('0x20')](_0x439030);}return _0x159b6f['save']();};}function saveUpdates(_0x5fc6ff,_0x40e2c3){return function(_0x59098d){if(_0x59098d){return _0x59098d[_0xcf55('0x21')](_0x5fc6ff)['then'](function(_0x1fc6ac){return _0x1fc6ac;});}return null;};}function removeEntity(_0x19058c,_0x10a70e){return function(_0x3b449c){if(_0x3b449c){return _0x3b449c[_0xcf55('0x22')]()[_0xcf55('0x23')](function(){_0x19058c['status'](0xcc)[_0xcf55('0x16')]();});}};}function handleEntityNotFound(_0x59c917,_0x4e13bd){return function(_0x2a8f49){if(!_0x2a8f49){_0x59c917[_0xcf55('0x15')](0x194);}return _0x2a8f49;};}function handleError(_0x37fd8d,_0x4efdde){_0x4efdde=_0x4efdde||0x1f4;return function(_0x10c20b){logger['error'](_0x10c20b[_0xcf55('0x24')]);if(_0x10c20b['name']){delete _0x10c20b[_0xcf55('0x25')];}_0x37fd8d[_0xcf55('0x17')](_0x4efdde)['send'](_0x10c20b);};}exports['index']=function(_0x55f8cc,_0x41f919){var _0x3efa0f={},_0x5bb4a0={},_0x4830e2={'count':0x0,'rows':[]};var _0x7853e2=_[_0xcf55('0x26')](db[_0xcf55('0x27')][_0xcf55('0x28')],function(_0xb3481b){return{'name':_0xb3481b[_0xcf55('0x29')],'type':_0xb3481b[_0xcf55('0x2a')][_0xcf55('0x2b')]};});_0x5bb4a0[_0xcf55('0x2c')]=_[_0xcf55('0x26')](_0x7853e2,'name');_0x5bb4a0[_0xcf55('0x2d')]=_[_0xcf55('0x2e')](_0x55f8cc[_0xcf55('0x2d')]);_0x5bb4a0[_0xcf55('0x2f')]=_[_0xcf55('0x30')](_0x5bb4a0[_0xcf55('0x2c')],_0x5bb4a0[_0xcf55('0x2d')]);_0x3efa0f[_0xcf55('0x31')]=_[_0xcf55('0x30')](_0x5bb4a0[_0xcf55('0x2c')],qs['fields'](_0x55f8cc[_0xcf55('0x2d')]['fields']));_0x3efa0f[_0xcf55('0x31')]=_0x3efa0f[_0xcf55('0x31')]['length']?_0x3efa0f[_0xcf55('0x31')]:_0x5bb4a0[_0xcf55('0x2c')];if(!_0x55f8cc[_0xcf55('0x2d')][_0xcf55('0x32')]('nolimit')){_0x3efa0f[_0xcf55('0x1c')]=qs[_0xcf55('0x1c')](_0x55f8cc[_0xcf55('0x2d')][_0xcf55('0x1c')]);_0x3efa0f['offset']=qs[_0xcf55('0x19')](_0x55f8cc[_0xcf55('0x2d')]['offset']);}_0x3efa0f['order']=qs[_0xcf55('0x33')](_0x55f8cc[_0xcf55('0x2d')][_0xcf55('0x33')]);_0x3efa0f['where']=qs[_0xcf55('0x2f')](_[_0xcf55('0x34')](_0x55f8cc[_0xcf55('0x2d')],_0x5bb4a0['filters']),_0x7853e2);if(_0x55f8cc[_0xcf55('0x2d')]['filter']){_0x3efa0f[_0xcf55('0x35')]=_['merge'](_0x3efa0f[_0xcf55('0x35')],{'$or':_[_0xcf55('0x26')](_0x7853e2,function(_0x4d423e){if(_0x4d423e[_0xcf55('0x2a')]!==_0xcf55('0x36')){var _0x2a89fe={};_0x2a89fe[_0x4d423e[_0xcf55('0x25')]]={'$like':'%'+_0x55f8cc[_0xcf55('0x2d')][_0xcf55('0x37')]+'%'};return _0x2a89fe;}})});}_0x3efa0f=_['merge']({},_0x3efa0f,_0x55f8cc[_0xcf55('0x38')]);var _0x1f203c={'where':_0x3efa0f[_0xcf55('0x35')]};return db[_0xcf55('0x27')][_0xcf55('0x1b')](_0x1f203c)[_0xcf55('0x23')](function(_0x5e4cb9){_0x4830e2[_0xcf55('0x1b')]=_0x5e4cb9;if(_0x55f8cc[_0xcf55('0x2d')][_0xcf55('0x39')]){_0x3efa0f[_0xcf55('0x3a')]=[{'all':!![]}];}return db[_0xcf55('0x27')][_0xcf55('0x3b')](_0x3efa0f);})['then'](function(_0x5139e1){_0x4830e2[_0xcf55('0x3c')]=_0x5139e1;return _0x4830e2;})[_0xcf55('0x23')](respondWithFilteredResult(_0x41f919,_0x3efa0f))[_0xcf55('0x3d')](handleError(_0x41f919,null));};exports[_0xcf55('0x3e')]=function(_0x257be4,_0xec8d15){var _0x242b2d={'raw':!![],'where':{'id':_0x257be4[_0xcf55('0x3f')]['id']}},_0x1b3057={};_0x1b3057[_0xcf55('0x2c')]=_[_0xcf55('0x2e')](db[_0xcf55('0x27')]['rawAttributes']);_0x1b3057[_0xcf55('0x2d')]=_[_0xcf55('0x2e')](_0x257be4[_0xcf55('0x2d')]);_0x1b3057[_0xcf55('0x2f')]=_['intersection'](_0x1b3057[_0xcf55('0x2c')],_0x1b3057[_0xcf55('0x2d')]);_0x242b2d[_0xcf55('0x31')]=_[_0xcf55('0x30')](_0x1b3057['model'],qs[_0xcf55('0x40')](_0x257be4['query'][_0xcf55('0x40')]));_0x242b2d[_0xcf55('0x31')]=_0x242b2d[_0xcf55('0x31')][_0xcf55('0x41')]?_0x242b2d['attributes']:_0x1b3057[_0xcf55('0x2c')];if(_0x257be4[_0xcf55('0x2d')][_0xcf55('0x39')]){_0x242b2d[_0xcf55('0x3a')]=[{'all':!![]}];}_0x242b2d=_[_0xcf55('0x42')]({},_0x242b2d,_0x257be4[_0xcf55('0x38')]);return db[_0xcf55('0x27')][_0xcf55('0x43')](_0x242b2d)[_0xcf55('0x23')](handleEntityNotFound(_0xec8d15,null))['then'](respondWithResult(_0xec8d15,null))[_0xcf55('0x3d')](handleError(_0xec8d15,null));};exports[_0xcf55('0x44')]=function(_0x9dea9b,_0x441bf5){return db[_0xcf55('0x27')][_0xcf55('0x44')](_0x9dea9b[_0xcf55('0x45')],{})[_0xcf55('0x23')](respondWithResult(_0x441bf5,0xc9))[_0xcf55('0x3d')](handleError(_0x441bf5,null));};exports[_0xcf55('0x21')]=function(_0x33520c,_0x3b5d92){if(_0x33520c[_0xcf55('0x45')]['id']){delete _0x33520c[_0xcf55('0x45')]['id'];}return db['MailServerOut'][_0xcf55('0x43')]({'where':{'id':_0x33520c['params']['id']}})[_0xcf55('0x23')](handleEntityNotFound(_0x3b5d92,null))['then'](saveUpdates(_0x33520c[_0xcf55('0x45')],null))[_0xcf55('0x23')](respondWithResult(_0x3b5d92,null))[_0xcf55('0x3d')](handleError(_0x3b5d92,null));};exports['destroy']=function(_0x56fac3,_0x23c713){return db['MailServerOut'][_0xcf55('0x43')]({'where':{'id':_0x56fac3[_0xcf55('0x3f')]['id']}})[_0xcf55('0x23')](handleEntityNotFound(_0x23c713,null))[_0xcf55('0x23')](removeEntity(_0x23c713,null))[_0xcf55('0x3d')](handleError(_0x23c713,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e57=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger'];(function(_0x3a6b02,_0x589d4d){var _0x5acb58=function(_0x20bea4){while(--_0x20bea4){_0x3a6b02['push'](_0x3a6b02['shift']());}};_0x5acb58(++_0x589d4d);}(_0x7e57,0xa5));var _0x77e5=function(_0x3bf278,_0x5d4aa9){_0x3bf278=_0x3bf278-0x0;var _0x4789da=_0x7e57[_0x3bf278];return _0x4789da;};'use strict';var _=require(_0x77e5('0x0'));var util=require(_0x77e5('0x1'));var logger=require(_0x77e5('0x2'))(_0x77e5('0x3'));var moment=require(_0x77e5('0x4'));var BPromise=require(_0x77e5('0x5'));var rp=require(_0x77e5('0x6'));var fs=require('fs');var path=require(_0x77e5('0x7'));var rimraf=require(_0x77e5('0x8'));var config=require(_0x77e5('0x9'));var attributes=require(_0x77e5('0xa'));module[_0x77e5('0xb')]=function(_0x488f12,_0x167461){return _0x488f12[_0x77e5('0xc')](_0x77e5('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x704f=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x704f,0x163));var _0xf704=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x704f[_0x277fa3];return _0x2e4520;};'use strict';var _=require(_0xf704('0x0'));var util=require(_0xf704('0x1'));var logger=require(_0xf704('0x2'))('api');var moment=require(_0xf704('0x3'));var BPromise=require(_0xf704('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf704('0x5'));var config=require(_0xf704('0x6'));var attributes=require('./mailServerOut.attributes');module[_0xf704('0x7')]=function(_0x124c73,_0x369a5a){return _0x124c73[_0xf704('0x8')](_0xf704('0x9'),attributes,{'tableName':_0xf704('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x25d0ce,_0x5d2896){var _0x4304b7=function(_0x8419ef){while(--_0x8419ef){_0x25d0ce['push'](_0x25d0ce['shift']());}};_0x4304b7(++_0x5d2896);}(_0x1261,0x144));var _0x1126=function(_0x251fde,_0x384469){_0x251fde=_0x251fde-0x0;var _0x350af6=_0x1261[_0x251fde];return _0x350af6;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3a5c49,_0x2acd40){var _0x2c47c5=function(_0x47df0){while(--_0x47df0){_0x3a5c49['push'](_0x3a5c49['shift']());}};_0x2c47c5(++_0x2acd40);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x262d=['update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x50d80b,_0x2ab639){var _0x527039=function(_0x310a58){while(--_0x310a58){_0x50d80b['push'](_0x50d80b['shift']());}};_0x527039(++_0x2ab639);}(_0x262d,0x10c));var _0xd262=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x262d[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0xd262('0x0'));var util=require(_0xd262('0x1'));var path=require(_0xd262('0x2'));var timeout=require(_0xd262('0x3'));var express=require(_0xd262('0x4'));var router=express[_0xd262('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd262('0x6'));var config=require(_0xd262('0x7'));var controller=require(_0xd262('0x8'));router[_0xd262('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xd262('0xa')](),controller[_0xd262('0xb')]);router[_0xd262('0x9')](_0xd262('0xc'),auth[_0xd262('0xa')](),controller[_0xd262('0xd')]);router[_0xd262('0xe')]('/',auth[_0xd262('0xa')](),controller[_0xd262('0xf')]);router[_0xd262('0x10')](_0xd262('0xc'),auth['isAuthenticated'](),controller[_0xd262('0x11')]);router[_0xd262('0x12')](_0xd262('0xc'),auth[_0xd262('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb2ad=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x7ae444,_0x24a01b){var _0x4bc8a9=function(_0x4ef4ae){while(--_0x4ef4ae){_0x7ae444['push'](_0x7ae444['shift']());}};_0x4bc8a9(++_0x24a01b);}(_0xb2ad,0x168));var _0xdb2a=function(_0x57a14,_0xf026a9){_0x57a14=_0x57a14-0x0;var _0x771938=_0xb2ad[_0x57a14];return _0x771938;};'use strict';var multer=require(_0xdb2a('0x0'));var util=require(_0xdb2a('0x1'));var path=require(_0xdb2a('0x2'));var timeout=require(_0xdb2a('0x3'));var express=require(_0xdb2a('0x4'));var router=express['Router']();var fs_extra=require(_0xdb2a('0x5'));var auth=require(_0xdb2a('0x6'));var interaction=require(_0xdb2a('0x7'));var config=require(_0xdb2a('0x8'));var controller=require(_0xdb2a('0x9'));router[_0xdb2a('0xa')]('/',auth[_0xdb2a('0xb')](),controller[_0xdb2a('0xc')]);router[_0xdb2a('0xa')](_0xdb2a('0xd'),auth['isAuthenticated'](),controller[_0xdb2a('0xe')]);router['get'](_0xdb2a('0xf'),auth[_0xdb2a('0xb')](),controller[_0xdb2a('0x10')]);router[_0xdb2a('0x11')]('/',auth[_0xdb2a('0xb')](),controller[_0xdb2a('0x12')]);router[_0xdb2a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xdb2a('0x14')]);router[_0xdb2a('0x15')]('/:id',auth[_0xdb2a('0xb')](),controller[_0xdb2a('0x16')]);module[_0xdb2a('0x17')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f44=['name','STRING','sequelize','exports'];(function(_0x2d1e1e,_0x57724a){var _0x8d81ae=function(_0xc45770){while(--_0xc45770){_0x2d1e1e['push'](_0x2d1e1e['shift']());}};_0x8d81ae(++_0x57724a);}(_0x6f44,0x1ea));var _0x46f4=function(_0x1140db,_0x3ef85e){_0x1140db=_0x1140db-0x0;var _0x53234a=_0x6f44[_0x1140db];return _0x53234a;};'use strict';var Sequelize=require(_0x46f4('0x0'));module[_0x46f4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x46f4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x46f4('0x3')]}};
\ No newline at end of file
+var _0xfc46=['name','sequelize','STRING'];(function(_0x47eaa6,_0x4d264d){var _0x3e38ba=function(_0x3d66ad){while(--_0x3d66ad){_0x47eaa6['push'](_0x47eaa6['shift']());}};_0x3e38ba(++_0x4d264d);}(_0xfc46,0x9a));var _0x6fc4=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0xfc46[_0x3acee8];return _0x5046cc;};'use strict';var Sequelize=require(_0x6fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fc4('0x1')],'unique':_0x6fc4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6fc4('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb33b=['type','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','destroy','describe','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','MailSubstatus','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x7d6806,_0x5a61a3){var _0x2c9ced=function(_0x3c5e42){while(--_0x3c5e42){_0x7d6806['push'](_0x7d6806['shift']());}};_0x2c9ced(++_0x5a61a3);}(_0xb33b,0x1d0));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb33('0x0'));var zipdir=require(_0xbb33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbb33('0x2'));var Mustache=require(_0xbb33('0x3'));var util=require(_0xbb33('0x4'));var path=require(_0xbb33('0x5'));var sox=require(_0xbb33('0x6'));var csv=require(_0xbb33('0x7'));var ejs=require(_0xbb33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbb33('0x9'));var crypto=require(_0xbb33('0xa'));var jsforce=require(_0xbb33('0xb'));var deskjs=require(_0xbb33('0xc'));var toCsv=require(_0xbb33('0x7'));var querystring=require(_0xbb33('0xd'));var Papa=require(_0xbb33('0xe'));var Redis=require(_0xbb33('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbb33('0x10'));var as=require(_0xbb33('0x11'));var hardwareService=require(_0xbb33('0x12'));var logger=require(_0xbb33('0x13'))(_0xbb33('0x14'));var utils=require(_0xbb33('0x15'));var config=require(_0xbb33('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb33('0x17'))['db'];function respondWithStatusCode(_0x442354,_0x5caa04){_0x5caa04=_0x5caa04||0xcc;return function(_0x17ca00){if(_0x17ca00){return _0x442354[_0xbb33('0x18')](_0x5caa04);}return _0x442354[_0xbb33('0x19')](_0x5caa04)[_0xbb33('0x1a')]();};}function respondWithResult(_0x13b25e,_0x25934d){_0x25934d=_0x25934d||0xc8;return function(_0x1feb78){if(_0x1feb78){return _0x13b25e['status'](_0x25934d)[_0xbb33('0x1b')](_0x1feb78);}};}function respondWithFilteredResult(_0x48e43d,_0x21c18b){return function(_0x17e3b8){if(_0x17e3b8){var _0x523429=typeof _0x21c18b[_0xbb33('0x1c')]===_0xbb33('0x1d')&&typeof _0x21c18b[_0xbb33('0x1e')]===_0xbb33('0x1d');var _0x409f9b=_0x17e3b8[_0xbb33('0x1f')];var _0x556a62=_0x523429?0x0:_0x21c18b[_0xbb33('0x1c')];var _0x299521=_0x523429?_0x17e3b8[_0xbb33('0x1f')]:_0x21c18b[_0xbb33('0x1c')]+_0x21c18b[_0xbb33('0x1e')];var _0x579406;if(_0x299521>=_0x409f9b){_0x299521=_0x409f9b;_0x579406=0xc8;}else{_0x579406=0xce;}_0x48e43d[_0xbb33('0x19')](_0x579406);return _0x48e43d['set'](_0xbb33('0x20'),_0x556a62+'-'+_0x299521+'/'+_0x409f9b)['json'](_0x17e3b8);}return null;};}function patchUpdates(_0xa020ce){return function(_0x2abea9){try{jsonpatch[_0xbb33('0x21')](_0x2abea9,_0xa020ce,!![]);}catch(_0x13faca){return BPromise[_0xbb33('0x22')](_0x13faca);}return _0x2abea9[_0xbb33('0x23')]();};}function saveUpdates(_0x2aa5ee,_0x3f6c8e){return function(_0x193ecc){if(_0x193ecc){return _0x193ecc[_0xbb33('0x24')](_0x2aa5ee)[_0xbb33('0x25')](function(_0x8565d7){return _0x8565d7;});}return null;};}function removeEntity(_0x2df1f5,_0x88356){return function(_0x322469){if(_0x322469){return _0x322469['destroy']()[_0xbb33('0x25')](function(){_0x2df1f5[_0xbb33('0x19')](0xcc)[_0xbb33('0x1a')]();});}};}function handleEntityNotFound(_0x2dff1b,_0x5af038){return function(_0xabcefa){if(!_0xabcefa){_0x2dff1b[_0xbb33('0x18')](0x194);}return _0xabcefa;};}function handleError(_0x2b75fd,_0x43af43){_0x43af43=_0x43af43||0x1f4;return function(_0xc0a5ed){logger[_0xbb33('0x26')](_0xc0a5ed[_0xbb33('0x27')]);if(_0xc0a5ed[_0xbb33('0x28')]){delete _0xc0a5ed['name'];}_0x2b75fd[_0xbb33('0x19')](_0x43af43)['send'](_0xc0a5ed);};}exports[_0xbb33('0x29')]=function(_0x96597a,_0x2c5678){var _0x34a359={},_0x45bad0={},_0x279a09={'count':0x0,'rows':[]};var _0x358983=_['map'](db[_0xbb33('0x2a')][_0xbb33('0x2b')],function(_0x15975a){return{'name':_0x15975a[_0xbb33('0x2c')],'type':_0x15975a['type']['key']};});_0x45bad0[_0xbb33('0x2d')]=_['map'](_0x358983,_0xbb33('0x28'));_0x45bad0[_0xbb33('0x2e')]=_[_0xbb33('0x2f')](_0x96597a['query']);_0x45bad0[_0xbb33('0x30')]=_[_0xbb33('0x31')](_0x45bad0[_0xbb33('0x2d')],_0x45bad0[_0xbb33('0x2e')]);_0x34a359[_0xbb33('0x32')]=_[_0xbb33('0x31')](_0x45bad0[_0xbb33('0x2d')],qs['fields'](_0x96597a[_0xbb33('0x2e')][_0xbb33('0x33')]));_0x34a359[_0xbb33('0x32')]=_0x34a359[_0xbb33('0x32')][_0xbb33('0x34')]?_0x34a359[_0xbb33('0x32')]:_0x45bad0[_0xbb33('0x2d')];if(!_0x96597a[_0xbb33('0x2e')][_0xbb33('0x35')](_0xbb33('0x36'))){_0x34a359['limit']=qs[_0xbb33('0x1e')](_0x96597a[_0xbb33('0x2e')][_0xbb33('0x1e')]);_0x34a359[_0xbb33('0x1c')]=qs['offset'](_0x96597a[_0xbb33('0x2e')][_0xbb33('0x1c')]);}_0x34a359[_0xbb33('0x37')]=qs[_0xbb33('0x38')](_0x96597a['query'][_0xbb33('0x38')]);_0x34a359['where']=qs[_0xbb33('0x30')](_[_0xbb33('0x39')](_0x96597a[_0xbb33('0x2e')],_0x45bad0['filters']),_0x358983);if(_0x96597a[_0xbb33('0x2e')][_0xbb33('0x3a')]){_0x34a359[_0xbb33('0x3b')]=_[_0xbb33('0x3c')](_0x34a359['where'],{'$or':_['map'](_0x358983,function(_0x1a913a){if(_0x1a913a[_0xbb33('0x3d')]!==_0xbb33('0x3e')){var _0xbbfeb6={};_0xbbfeb6[_0x1a913a['name']]={'$like':'%'+_0x96597a[_0xbb33('0x2e')][_0xbb33('0x3a')]+'%'};return _0xbbfeb6;}})});}_0x34a359=_[_0xbb33('0x3c')]({},_0x34a359,_0x96597a['options']);var _0x16011d={'where':_0x34a359[_0xbb33('0x3b')]};return db[_0xbb33('0x2a')][_0xbb33('0x1f')](_0x16011d)['then'](function(_0x46bb7a){_0x279a09[_0xbb33('0x1f')]=_0x46bb7a;if(_0x96597a[_0xbb33('0x2e')][_0xbb33('0x3f')]){_0x34a359[_0xbb33('0x40')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x34a359);})['then'](function(_0x1e945d){_0x279a09[_0xbb33('0x41')]=_0x1e945d;return _0x279a09;})['then'](respondWithFilteredResult(_0x2c5678,_0x34a359))[_0xbb33('0x42')](handleError(_0x2c5678,null));};exports[_0xbb33('0x43')]=function(_0x110564,_0x1a2c61){var _0x3cbfdd={'raw':!![],'where':{'id':_0x110564['params']['id']}},_0xe2a849={};_0xe2a849[_0xbb33('0x2d')]=_[_0xbb33('0x2f')](db[_0xbb33('0x2a')]['rawAttributes']);_0xe2a849['query']=_[_0xbb33('0x2f')](_0x110564['query']);_0xe2a849[_0xbb33('0x30')]=_[_0xbb33('0x31')](_0xe2a849[_0xbb33('0x2d')],_0xe2a849[_0xbb33('0x2e')]);_0x3cbfdd[_0xbb33('0x32')]=_[_0xbb33('0x31')](_0xe2a849['model'],qs[_0xbb33('0x33')](_0x110564[_0xbb33('0x2e')][_0xbb33('0x33')]));_0x3cbfdd['attributes']=_0x3cbfdd[_0xbb33('0x32')][_0xbb33('0x34')]?_0x3cbfdd[_0xbb33('0x32')]:_0xe2a849['model'];if(_0x110564[_0xbb33('0x2e')]['includeAll']){_0x3cbfdd[_0xbb33('0x40')]=[{'all':!![]}];}_0x3cbfdd=_['merge']({},_0x3cbfdd,_0x110564[_0xbb33('0x44')]);return db['MailSubstatus'][_0xbb33('0x45')](_0x3cbfdd)[_0xbb33('0x25')](handleEntityNotFound(_0x1a2c61,null))[_0xbb33('0x25')](respondWithResult(_0x1a2c61,null))['catch'](handleError(_0x1a2c61,null));};exports[_0xbb33('0x46')]=function(_0x3f631c,_0x75fc9f){return db[_0xbb33('0x2a')][_0xbb33('0x46')](_0x3f631c[_0xbb33('0x47')],{})['then'](respondWithResult(_0x75fc9f,0xc9))[_0xbb33('0x42')](handleError(_0x75fc9f,null));};exports[_0xbb33('0x24')]=function(_0x24845e,_0x23c1a7){if(_0x24845e[_0xbb33('0x47')]['id']){delete _0x24845e[_0xbb33('0x47')]['id'];}return db['MailSubstatus'][_0xbb33('0x45')]({'where':{'id':_0x24845e[_0xbb33('0x48')]['id']}})['then'](handleEntityNotFound(_0x23c1a7,null))[_0xbb33('0x25')](saveUpdates(_0x24845e[_0xbb33('0x47')],null))['then'](respondWithResult(_0x23c1a7,null))[_0xbb33('0x42')](handleError(_0x23c1a7,null));};exports[_0xbb33('0x49')]=function(_0x169ab1,_0x572e94){return db[_0xbb33('0x2a')][_0xbb33('0x45')]({'where':{'id':_0x169ab1[_0xbb33('0x48')]['id']}})[_0xbb33('0x25')](handleEntityNotFound(_0x572e94,null))['then'](removeEntity(_0x572e94,null))[_0xbb33('0x42')](handleError(_0x572e94,null));};exports[_0xbb33('0x4a')]=function(_0x359608,_0xc0d80b){return db[_0xbb33('0x2a')][_0xbb33('0x4a')]()[_0xbb33('0x25')](respondWithResult(_0xc0d80b,null))[_0xbb33('0x42')](handleError(_0xc0d80b,null));};
\ No newline at end of file
+var _0x8114=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','index','map','MailSubstatus','rawAttributes','fieldName','key','model','name','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','type','filter','merge','options','include','findAll','catch','show','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x8f6830,_0x7c8a1e){var _0x4ce2e5=function(_0x5b25ec){while(--_0x5b25ec){_0x8f6830['push'](_0x8f6830['shift']());}};_0x4ce2e5(++_0x7c8a1e);}(_0x8114,0xbc));var _0x4811=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x8114[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4811('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4811('0x1'));var rp=require(_0x4811('0x2'));var moment=require(_0x4811('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4811('0x4'));var util=require('util');var path=require(_0x4811('0x5'));var sox=require('sox');var csv=require(_0x4811('0x6'));var ejs=require(_0x4811('0x7'));var fs=require('fs');var fs_extra=require(_0x4811('0x8'));var _=require(_0x4811('0x9'));var squel=require('squel');var crypto=require(_0x4811('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4811('0xb'));var toCsv=require(_0x4811('0x6'));var querystring=require(_0x4811('0xc'));var Papa=require(_0x4811('0xd'));var Redis=require(_0x4811('0xe'));var authService=require(_0x4811('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4811('0x10'));var hardwareService=require(_0x4811('0x11'));var logger=require('../../config/logger')(_0x4811('0x12'));var utils=require(_0x4811('0x13'));var config=require(_0x4811('0x14'));var licenseUtil=require(_0x4811('0x15'));var db=require(_0x4811('0x16'))['db'];function respondWithStatusCode(_0x3d1bd3,_0x4d14f5){_0x4d14f5=_0x4d14f5||0xcc;return function(_0x5e3fd8){if(_0x5e3fd8){return _0x3d1bd3[_0x4811('0x17')](_0x4d14f5);}return _0x3d1bd3[_0x4811('0x18')](_0x4d14f5)['end']();};}function respondWithResult(_0x30cac7,_0x25eef9){_0x25eef9=_0x25eef9||0xc8;return function(_0x54edf2){if(_0x54edf2){return _0x30cac7[_0x4811('0x18')](_0x25eef9)[_0x4811('0x19')](_0x54edf2);}};}function respondWithFilteredResult(_0x431a25,_0x5cb479){return function(_0x4eccd3){if(_0x4eccd3){var _0xe1ab6f=typeof _0x5cb479[_0x4811('0x1a')]===_0x4811('0x1b')&&typeof _0x5cb479[_0x4811('0x1c')]===_0x4811('0x1b');var _0x529fcf=_0x4eccd3['count'];var _0x2a72dd=_0xe1ab6f?0x0:_0x5cb479['offset'];var _0x1f4390=_0xe1ab6f?_0x4eccd3[_0x4811('0x1d')]:_0x5cb479[_0x4811('0x1a')]+_0x5cb479[_0x4811('0x1c')];var _0x3b34e9;if(_0x1f4390>=_0x529fcf){_0x1f4390=_0x529fcf;_0x3b34e9=0xc8;}else{_0x3b34e9=0xce;}_0x431a25[_0x4811('0x18')](_0x3b34e9);return _0x431a25[_0x4811('0x1e')](_0x4811('0x1f'),_0x2a72dd+'-'+_0x1f4390+'/'+_0x529fcf)[_0x4811('0x19')](_0x4eccd3);}return null;};}function patchUpdates(_0x209f20){return function(_0x6b700){try{jsonpatch[_0x4811('0x20')](_0x6b700,_0x209f20,!![]);}catch(_0x59950d){return BPromise[_0x4811('0x21')](_0x59950d);}return _0x6b700['save']();};}function saveUpdates(_0x4b927f,_0x270967){return function(_0x2b2e2b){if(_0x2b2e2b){return _0x2b2e2b[_0x4811('0x22')](_0x4b927f)[_0x4811('0x23')](function(_0x23749b){return _0x23749b;});}return null;};}function removeEntity(_0x215b02,_0x33fe11){return function(_0x4289db){if(_0x4289db){return _0x4289db[_0x4811('0x24')]()['then'](function(){_0x215b02[_0x4811('0x18')](0xcc)[_0x4811('0x25')]();});}};}function handleEntityNotFound(_0x319f59,_0x1d5c8d){return function(_0xc1ec84){if(!_0xc1ec84){_0x319f59[_0x4811('0x17')](0x194);}return _0xc1ec84;};}function handleError(_0x4cb9b3,_0x362cfd){_0x362cfd=_0x362cfd||0x1f4;return function(_0x36a3a6){logger[_0x4811('0x26')](_0x36a3a6['stack']);if(_0x36a3a6['name']){delete _0x36a3a6['name'];}_0x4cb9b3[_0x4811('0x18')](_0x362cfd)['send'](_0x36a3a6);};}exports[_0x4811('0x27')]=function(_0x54b7f6,_0x11a7db){var _0x3023da={},_0x492303={},_0x517ec7={'count':0x0,'rows':[]};var _0x4e4ded=_[_0x4811('0x28')](db[_0x4811('0x29')][_0x4811('0x2a')],function(_0x4b0fb1){return{'name':_0x4b0fb1[_0x4811('0x2b')],'type':_0x4b0fb1['type'][_0x4811('0x2c')]};});_0x492303[_0x4811('0x2d')]=_['map'](_0x4e4ded,_0x4811('0x2e'));_0x492303[_0x4811('0x2f')]=_[_0x4811('0x30')](_0x54b7f6[_0x4811('0x2f')]);_0x492303['filters']=_[_0x4811('0x31')](_0x492303['model'],_0x492303['query']);_0x3023da['attributes']=_[_0x4811('0x31')](_0x492303[_0x4811('0x2d')],qs[_0x4811('0x32')](_0x54b7f6[_0x4811('0x2f')][_0x4811('0x32')]));_0x3023da[_0x4811('0x33')]=_0x3023da[_0x4811('0x33')][_0x4811('0x34')]?_0x3023da[_0x4811('0x33')]:_0x492303[_0x4811('0x2d')];if(!_0x54b7f6[_0x4811('0x2f')]['hasOwnProperty'](_0x4811('0x35'))){_0x3023da['limit']=qs[_0x4811('0x1c')](_0x54b7f6[_0x4811('0x2f')][_0x4811('0x1c')]);_0x3023da['offset']=qs[_0x4811('0x1a')](_0x54b7f6['query'][_0x4811('0x1a')]);}_0x3023da['order']=qs[_0x4811('0x36')](_0x54b7f6[_0x4811('0x2f')][_0x4811('0x36')]);_0x3023da[_0x4811('0x37')]=qs[_0x4811('0x38')](_['pick'](_0x54b7f6[_0x4811('0x2f')],_0x492303[_0x4811('0x38')]),_0x4e4ded);if(_0x54b7f6[_0x4811('0x2f')]['filter']){_0x3023da[_0x4811('0x37')]=_['merge'](_0x3023da[_0x4811('0x37')],{'$or':_['map'](_0x4e4ded,function(_0x48e15b){if(_0x48e15b[_0x4811('0x39')]!=='VIRTUAL'){var _0x91093={};_0x91093[_0x48e15b['name']]={'$like':'%'+_0x54b7f6[_0x4811('0x2f')][_0x4811('0x3a')]+'%'};return _0x91093;}})});}_0x3023da=_[_0x4811('0x3b')]({},_0x3023da,_0x54b7f6[_0x4811('0x3c')]);var _0x4464b={'where':_0x3023da[_0x4811('0x37')]};return db['MailSubstatus'][_0x4811('0x1d')](_0x4464b)[_0x4811('0x23')](function(_0x5d35e7){_0x517ec7[_0x4811('0x1d')]=_0x5d35e7;if(_0x54b7f6[_0x4811('0x2f')]['includeAll']){_0x3023da[_0x4811('0x3d')]=[{'all':!![]}];}return db[_0x4811('0x29')][_0x4811('0x3e')](_0x3023da);})[_0x4811('0x23')](function(_0x719fe7){_0x517ec7['rows']=_0x719fe7;return _0x517ec7;})[_0x4811('0x23')](respondWithFilteredResult(_0x11a7db,_0x3023da))[_0x4811('0x3f')](handleError(_0x11a7db,null));};exports[_0x4811('0x40')]=function(_0x1083eb,_0x30a8e6){var _0x338762={'raw':!![],'where':{'id':_0x1083eb[_0x4811('0x41')]['id']}},_0x270b35={};_0x270b35[_0x4811('0x2d')]=_[_0x4811('0x30')](db[_0x4811('0x29')]['rawAttributes']);_0x270b35[_0x4811('0x2f')]=_[_0x4811('0x30')](_0x1083eb['query']);_0x270b35['filters']=_['intersection'](_0x270b35[_0x4811('0x2d')],_0x270b35[_0x4811('0x2f')]);_0x338762[_0x4811('0x33')]=_['intersection'](_0x270b35[_0x4811('0x2d')],qs[_0x4811('0x32')](_0x1083eb[_0x4811('0x2f')][_0x4811('0x32')]));_0x338762[_0x4811('0x33')]=_0x338762[_0x4811('0x33')][_0x4811('0x34')]?_0x338762[_0x4811('0x33')]:_0x270b35[_0x4811('0x2d')];if(_0x1083eb['query']['includeAll']){_0x338762['include']=[{'all':!![]}];}_0x338762=_['merge']({},_0x338762,_0x1083eb['options']);return db[_0x4811('0x29')][_0x4811('0x42')](_0x338762)['then'](handleEntityNotFound(_0x30a8e6,null))[_0x4811('0x23')](respondWithResult(_0x30a8e6,null))['catch'](handleError(_0x30a8e6,null));};exports[_0x4811('0x43')]=function(_0x3c98f3,_0x2472ed){return db[_0x4811('0x29')][_0x4811('0x43')](_0x3c98f3[_0x4811('0x44')],{})['then'](respondWithResult(_0x2472ed,0xc9))[_0x4811('0x3f')](handleError(_0x2472ed,null));};exports[_0x4811('0x22')]=function(_0x507f7f,_0x505c6d){if(_0x507f7f['body']['id']){delete _0x507f7f[_0x4811('0x44')]['id'];}return db[_0x4811('0x29')]['find']({'where':{'id':_0x507f7f[_0x4811('0x41')]['id']}})['then'](handleEntityNotFound(_0x505c6d,null))[_0x4811('0x23')](saveUpdates(_0x507f7f[_0x4811('0x44')],null))[_0x4811('0x23')](respondWithResult(_0x505c6d,null))['catch'](handleError(_0x505c6d,null));};exports['destroy']=function(_0x2871a9,_0xaefed8){return db[_0x4811('0x29')][_0x4811('0x42')]({'where':{'id':_0x2871a9['params']['id']}})[_0x4811('0x23')](handleEntityNotFound(_0xaefed8,null))['then'](removeEntity(_0xaefed8,null))[_0x4811('0x3f')](handleError(_0xaefed8,null));};exports['describe']=function(_0x135336,_0x473aae){return db[_0x4811('0x29')]['describe']()[_0x4811('0x23')](respondWithResult(_0x473aae,null))['catch'](handleError(_0x473aae,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac8a=['emit','hasOwnProperty','hook','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x1d895d,_0x3e5c93){var _0x2dae23=function(_0x443cd0){while(--_0x443cd0){_0x1d895d['push'](_0x1d895d['shift']());}};_0x2dae23(++_0x3e5c93);}(_0xac8a,0xce));var _0xaac8=function(_0x2f934c,_0x46770d){_0x2f934c=_0x2f934c-0x0;var _0x24a2df=_0xac8a[_0x2f934c];return _0x24a2df;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xaac8('0x0'))['db'][_0xaac8('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xaac8('0x2')](0x0);var events={'afterUpdate':_0xaac8('0x3')};function emitEvent(_0x25b482){return function(_0x21c5d9,_0x30e96d,_0xfe06dc){MailSubstatusEvents[_0xaac8('0x4')](_0x25b482+':'+_0x21c5d9['id'],_0x21c5d9);MailSubstatusEvents['emit'](_0x25b482,_0x21c5d9);_0xfe06dc(null);};}for(var e in events){if(events[_0xaac8('0x5')](e)){var event=events[e];MailSubstatus[_0xaac8('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
+var _0x705f=['../../mysqldb','MailSubstatus','setMaxListeners','hasOwnProperty','hook','exports','events'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x705f,0x99));var _0xf705=function(_0x24f66d,_0x261e88){_0x24f66d=_0x24f66d-0x0;var _0x147cdb=_0x705f[_0x24f66d];return _0x147cdb;};'use strict';var EventEmitter=require(_0xf705('0x0'));var MailSubstatus=require(_0xf705('0x1'))['db'][_0xf705('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf705('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0xb685d2){return function(_0x6293d3,_0x79ed91,_0x1dc946){MailSubstatusEvents['emit'](_0xb685d2+':'+_0x6293d3['id'],_0x6293d3);MailSubstatusEvents['emit'](_0xb685d2,_0x6293d3);_0x1dc946(null);};}for(var e in events){if(events[_0xf705('0x4')](e)){var event=events[e];MailSubstatus[_0xf705('0x5')](e,emitEvent(event));}}module[_0xf705('0x6')]=MailSubstatusEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3b9=['_previousDataValues','./mailSubstatus.attributes','exports','models','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x16c419,_0x371fc8){var _0x3147d2=function(_0x17775c){while(--_0x17775c){_0x16c419['push'](_0x16c419['shift']());}};_0x3147d2(++_0x371fc8);}(_0xe3b9,0x1f0));var _0x9e3b=function(_0xa4729c,_0x360afe){_0xa4729c=_0xa4729c-0x0;var _0x10a08f=_0xe3b9[_0xa4729c];return _0x10a08f;};'use strict';var attributes=require(_0x9e3b('0x0'));module[_0x9e3b('0x1')]=function(_0x32d8de){var _0x3cefd9=_0x32d8de[_0x9e3b('0x2')];return _0x32d8de['define']('MailSubstatus',attributes,{'tableName':_0x9e3b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x31a49e,_0x5cdea2,_0x20b797){return _0x3cefd9[_0x9e3b('0x4')][_0x9e3b('0x5')]({'value':_0x31a49e[_0x9e3b('0x6')]},{'where':{'field':_0x9e3b('0x7'),'value':_0x31a49e[_0x9e3b('0x8')][_0x9e3b('0x6')]}})['then'](function(){_0x20b797();})['catch'](function(_0x204de8){_0x20b797(_0x204de8);});}}});};
\ No newline at end of file
+var _0x3ece=['./mailSubstatus.attributes','exports','define','mail_substatuses','update','name','mailSubstatus','then','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ece,0x10e));var _0xe3ec=function(_0x4a8b83,_0x446783){_0x4a8b83=_0x4a8b83-0x0;var _0x1f0d42=_0x3ece[_0x4a8b83];return _0x1f0d42;};'use strict';var attributes=require(_0xe3ec('0x0'));module[_0xe3ec('0x1')]=function(_0x3919f6){var _0x412dbd=_0x3919f6['models'];return _0x3919f6[_0xe3ec('0x2')]('MailSubstatus',attributes,{'tableName':_0xe3ec('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x507a3b,_0x48c77b,_0x194c4a){return _0x412dbd['Condition'][_0xe3ec('0x4')]({'value':_0x507a3b[_0xe3ec('0x5')]},{'where':{'field':_0xe3ec('0x6'),'value':_0x507a3b['_previousDataValues'][_0xe3ec('0x5')]}})[_0xe3ec('0x7')](function(){_0x194c4a();})[_0xe3ec('0x8')](function(_0x2efa3e){_0x194c4a(_0x2efa3e);});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x93b6=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x517607,_0x12f81f){var _0x1002d7=function(_0x4f9a34){while(--_0x4f9a34){_0x517607['push'](_0x517607['shift']());}};_0x1002d7(++_0x12f81f);}(_0x93b6,0x151));var _0x693b=function(_0xc6e1ce,_0x56402e){_0xc6e1ce=_0xc6e1ce-0x0;var _0x22c4bf=_0x93b6[_0xc6e1ce];return _0x22c4bf;};'use strict';var _=require(_0x693b('0x0'));var util=require(_0x693b('0x1'));var moment=require('moment');var BPromise=require(_0x693b('0x2'));var rs=require(_0x693b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x693b('0x4'))['db'];var utils=require(_0x693b('0x5'));var logger=require(_0x693b('0x6'))(_0x693b('0x7'));var config=require(_0x693b('0x8'));var jayson=require(_0x693b('0x9'));var client=jayson[_0x693b('0xa')][_0x693b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e2cd4,_0x2a8ec8,_0x484f5b){return new BPromise(function(_0x4a3466,_0x54ae5c){return client[_0x693b('0xc')](_0x3e2cd4,_0x484f5b)[_0x693b('0xd')](function(_0x1f41e8){logger[_0x693b('0xe')](_0x693b('0xf'),_0x2a8ec8,_0x693b('0x10'));logger[_0x693b('0x11')](_0x693b('0x12'),_0x2a8ec8,'request\x20sent',JSON[_0x693b('0x13')](_0x1f41e8));if(_0x1f41e8[_0x693b('0x14')]){if(_0x1f41e8[_0x693b('0x14')]['code']===0x1f4){logger[_0x693b('0x14')](_0x693b('0xf'),_0x2a8ec8,_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);return _0x54ae5c(_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);}logger[_0x693b('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x2a8ec8,_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);return _0x4a3466(_0x1f41e8[_0x693b('0x14')][_0x693b('0x15')]);}else{logger[_0x693b('0xe')](_0x693b('0xf'),_0x2a8ec8,_0x693b('0x10'));_0x4a3466(_0x1f41e8[_0x693b('0x16')][_0x693b('0x15')]);}})[_0x693b('0x17')](function(_0x34a178){logger[_0x693b('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x2a8ec8,_0x34a178);_0x54ae5c(_0x34a178);});});}
\ No newline at end of file
+var _0xa1e1=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa1e1,0xed));var _0x1a1e=function(_0x34cea9,_0x2eac4b){_0x34cea9=_0x34cea9-0x0;var _0x30f55f=_0xa1e1[_0x34cea9];return _0x30f55f;};'use strict';var _=require(_0x1a1e('0x0'));var util=require(_0x1a1e('0x1'));var moment=require(_0x1a1e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a1e('0x3'));var db=require(_0x1a1e('0x4'))['db'];var utils=require(_0x1a1e('0x5'));var logger=require('../../config/logger')(_0x1a1e('0x6'));var config=require(_0x1a1e('0x7'));var jayson=require(_0x1a1e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x420171,_0x3b091e,_0x3e8634){return new BPromise(function(_0x459d64,_0x14f992){return client[_0x1a1e('0x9')](_0x420171,_0x3e8634)['then'](function(_0x2c652c){logger[_0x1a1e('0xa')](_0x1a1e('0xb'),_0x3b091e,_0x1a1e('0xc'));logger[_0x1a1e('0xd')](_0x1a1e('0xe'),_0x3b091e,'request\x20sent',JSON[_0x1a1e('0xf')](_0x2c652c));if(_0x2c652c['error']){if(_0x2c652c[_0x1a1e('0x10')][_0x1a1e('0x11')]===0x1f4){logger[_0x1a1e('0x10')](_0x1a1e('0xb'),_0x3b091e,_0x2c652c[_0x1a1e('0x10')][_0x1a1e('0x12')]);return _0x14f992(_0x2c652c[_0x1a1e('0x10')][_0x1a1e('0x12')]);}logger[_0x1a1e('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x3b091e,_0x2c652c[_0x1a1e('0x10')]['message']);return _0x459d64(_0x2c652c[_0x1a1e('0x10')][_0x1a1e('0x12')]);}else{logger['info'](_0x1a1e('0xb'),_0x3b091e,_0x1a1e('0xc'));_0x459d64(_0x2c652c['result'][_0x1a1e('0x12')]);}})[_0x1a1e('0x13')](function(_0x614185){logger[_0x1a1e('0x10')](_0x1a1e('0xb'),_0x3b091e,_0x614185);_0x14f992(_0x614185);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5784=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','delete','/:id','exports','multer'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0x5784,0x13f));var _0x4578=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5784[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x4578('0x0'));var util=require(_0x4578('0x1'));var path=require(_0x4578('0x2'));var timeout=require(_0x4578('0x3'));var express=require(_0x4578('0x4'));var router=express[_0x4578('0x5')]();var fs_extra=require(_0x4578('0x6'));var auth=require(_0x4578('0x7'));var interaction=require(_0x4578('0x8'));var config=require(_0x4578('0x9'));var controller=require('./mailTransferReport.controller');router[_0x4578('0xa')]('/',auth[_0x4578('0xb')](),controller[_0x4578('0xc')]);router['get']('/describe',auth[_0x4578('0xb')](),controller['describe']);router[_0x4578('0xa')]('/:id',auth[_0x4578('0xb')](),controller['show']);router[_0x4578('0xd')]('/',auth[_0x4578('0xb')](),controller[_0x4578('0xe')]);router[_0x4578('0xf')]('/:id',auth[_0x4578('0xb')](),controller[_0x4578('0x10')]);router[_0x4578('0x11')](_0x4578('0x12'),auth[_0x4578('0xb')](),controller['destroy']);module[_0x4578('0x13')]=router;
\ No newline at end of file
+var _0x6d4f=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2db2db,_0x5cabdf){var _0x4c8811=function(_0x2de564){while(--_0x2de564){_0x2db2db['push'](_0x2db2db['shift']());}};_0x4c8811(++_0x5cabdf);}(_0x6d4f,0xe4));var _0xf6d4=function(_0x49e454,_0x22328f){_0x49e454=_0x49e454-0x0;var _0x21d045=_0x6d4f[_0x49e454];return _0x21d045;};'use strict';var multer=require(_0xf6d4('0x0'));var util=require(_0xf6d4('0x1'));var path=require(_0xf6d4('0x2'));var timeout=require('connect-timeout');var express=require(_0xf6d4('0x3'));var router=express['Router']();var fs_extra=require(_0xf6d4('0x4'));var auth=require(_0xf6d4('0x5'));var interaction=require(_0xf6d4('0x6'));var config=require(_0xf6d4('0x7'));var controller=require('./mailTransferReport.controller');router[_0xf6d4('0x8')]('/',auth[_0xf6d4('0x9')](),controller[_0xf6d4('0xa')]);router['get'](_0xf6d4('0xb'),auth[_0xf6d4('0x9')](),controller[_0xf6d4('0xc')]);router[_0xf6d4('0x8')](_0xf6d4('0xd'),auth[_0xf6d4('0x9')](),controller[_0xf6d4('0xe')]);router[_0xf6d4('0xf')]('/',auth['isAuthenticated'](),controller[_0xf6d4('0x10')]);router[_0xf6d4('0x11')](_0xf6d4('0xd'),auth['isAuthenticated'](),controller[_0xf6d4('0x12')]);router[_0xf6d4('0x13')](_0xf6d4('0xd'),auth['isAuthenticated'](),controller[_0xf6d4('0x14')]);module[_0xf6d4('0x15')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x47ea51,_0x120b71){var _0x2d260b=function(_0x4a033d){while(--_0x4a033d){_0x47ea51['push'](_0x47ea51['shift']());}};_0x2d260b(++_0x120b71);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0xf3cd[_0x4c8a8f];return _0x404500;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x588f82,_0x232634){var _0x5478d9=function(_0x2d9d0d){while(--_0x2d9d0d){_0x588f82['push'](_0x588f82['shift']());}};_0x5478d9(++_0x232634);}(_0xaa88,0x137));var _0x8aa8=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0xaa88[_0x48c2ae];return _0x8f7531;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x717b=['rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','MailTransferReport','rows','catch','params','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','map'];(function(_0x1b489f,_0xbe7814){var _0x4cdc4e=function(_0x3d8aca){while(--_0x3d8aca){_0x1b489f['push'](_0x1b489f['shift']());}};_0x4cdc4e(++_0xbe7814);}(_0x717b,0xf7));var _0xb717=function(_0x34bc4c,_0x4b4bb9){_0x34bc4c=_0x34bc4c-0x0;var _0x1ea628=_0x717b[_0x34bc4c];return _0x1ea628;};'use strict';var emlformat=require(_0xb717('0x0'));var rimraf=require(_0xb717('0x1'));var zipdir=require(_0xb717('0x2'));var jsonpatch=require(_0xb717('0x3'));var rp=require(_0xb717('0x4'));var moment=require(_0xb717('0x5'));var BPromise=require(_0xb717('0x6'));var Mustache=require(_0xb717('0x7'));var util=require(_0xb717('0x8'));var path=require(_0xb717('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb717('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb717('0xb'));var squel=require('squel');var crypto=require(_0xb717('0xc'));var jsforce=require(_0xb717('0xd'));var deskjs=require(_0xb717('0xe'));var toCsv=require(_0xb717('0xf'));var querystring=require(_0xb717('0x10'));var Papa=require(_0xb717('0x11'));var Redis=require(_0xb717('0x12'));var authService=require(_0xb717('0x13'));var qs=require(_0xb717('0x14'));var as=require(_0xb717('0x15'));var hardwareService=require(_0xb717('0x16'));var logger=require(_0xb717('0x17'))('api');var utils=require(_0xb717('0x18'));var config=require(_0xb717('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53ae9f,_0x10878f){_0x10878f=_0x10878f||0xcc;return function(_0x3d51a7){if(_0x3d51a7){return _0x53ae9f[_0xb717('0x1a')](_0x10878f);}return _0x53ae9f['status'](_0x10878f)['end']();};}function respondWithResult(_0x157b48,_0x56e654){_0x56e654=_0x56e654||0xc8;return function(_0x5d6008){if(_0x5d6008){return _0x157b48[_0xb717('0x1b')](_0x56e654)[_0xb717('0x1c')](_0x5d6008);}};}function respondWithFilteredResult(_0x229cb2,_0x18c187){return function(_0x43e4b1){if(_0x43e4b1){var _0x4494e8=typeof _0x18c187[_0xb717('0x1d')]===_0xb717('0x1e')&&typeof _0x18c187['limit']===_0xb717('0x1e');var _0x259981=_0x43e4b1['count'];var _0x41f53a=_0x4494e8?0x0:_0x18c187[_0xb717('0x1d')];var _0xe0d66c=_0x4494e8?_0x43e4b1[_0xb717('0x1f')]:_0x18c187[_0xb717('0x1d')]+_0x18c187[_0xb717('0x20')];var _0x3ac84e;if(_0xe0d66c>=_0x259981){_0xe0d66c=_0x259981;_0x3ac84e=0xc8;}else{_0x3ac84e=0xce;}_0x229cb2[_0xb717('0x1b')](_0x3ac84e);return _0x229cb2['set'](_0xb717('0x21'),_0x41f53a+'-'+_0xe0d66c+'/'+_0x259981)[_0xb717('0x1c')](_0x43e4b1);}return null;};}function patchUpdates(_0x3f38a6){return function(_0x180bd7){try{jsonpatch[_0xb717('0x22')](_0x180bd7,_0x3f38a6,!![]);}catch(_0x198522){return BPromise[_0xb717('0x23')](_0x198522);}return _0x180bd7[_0xb717('0x24')]();};}function saveUpdates(_0x2036a5,_0x41c6f4){return function(_0x16d407){if(_0x16d407){return _0x16d407[_0xb717('0x25')](_0x2036a5)['then'](function(_0x5984c9){return _0x5984c9;});}return null;};}function removeEntity(_0x421d70,_0x478ce8){return function(_0x200f68){if(_0x200f68){return _0x200f68[_0xb717('0x26')]()[_0xb717('0x27')](function(){_0x421d70[_0xb717('0x1b')](0xcc)[_0xb717('0x28')]();});}};}function handleEntityNotFound(_0x3e7f1c,_0x279ce6){return function(_0x56aea8){if(!_0x56aea8){_0x3e7f1c[_0xb717('0x1a')](0x194);}return _0x56aea8;};}function handleError(_0x56cece,_0x1ffdb0){_0x1ffdb0=_0x1ffdb0||0x1f4;return function(_0x1fe537){logger[_0xb717('0x29')](_0x1fe537[_0xb717('0x2a')]);if(_0x1fe537[_0xb717('0x2b')]){delete _0x1fe537[_0xb717('0x2b')];}_0x56cece[_0xb717('0x1b')](_0x1ffdb0)['send'](_0x1fe537);};}exports['index']=function(_0x222bde,_0x2be57f){var _0x84e2ec={},_0x526fee={},_0x25c6bb={'count':0x0,'rows':[]};var _0x8173d4=_[_0xb717('0x2c')](db['MailTransferReport'][_0xb717('0x2d')],function(_0x43c066){return{'name':_0x43c066[_0xb717('0x2e')],'type':_0x43c066['type']['key']};});_0x526fee[_0xb717('0x2f')]=_['map'](_0x8173d4,_0xb717('0x2b'));_0x526fee[_0xb717('0x30')]=_[_0xb717('0x31')](_0x222bde[_0xb717('0x30')]);_0x526fee[_0xb717('0x32')]=_['intersection'](_0x526fee[_0xb717('0x2f')],_0x526fee['query']);_0x84e2ec[_0xb717('0x33')]=_[_0xb717('0x34')](_0x526fee[_0xb717('0x2f')],qs['fields'](_0x222bde[_0xb717('0x30')][_0xb717('0x35')]));_0x84e2ec[_0xb717('0x33')]=_0x84e2ec[_0xb717('0x33')][_0xb717('0x36')]?_0x84e2ec[_0xb717('0x33')]:_0x526fee[_0xb717('0x2f')];if(!_0x222bde[_0xb717('0x30')][_0xb717('0x37')]('nolimit')){_0x84e2ec[_0xb717('0x20')]=qs[_0xb717('0x20')](_0x222bde[_0xb717('0x30')][_0xb717('0x20')]);_0x84e2ec[_0xb717('0x1d')]=qs[_0xb717('0x1d')](_0x222bde['query'][_0xb717('0x1d')]);}_0x84e2ec[_0xb717('0x38')]=qs[_0xb717('0x39')](_0x222bde[_0xb717('0x30')][_0xb717('0x39')]);_0x84e2ec[_0xb717('0x3a')]=qs['filters'](_['pick'](_0x222bde[_0xb717('0x30')],_0x526fee['filters']),_0x8173d4);if(_0x222bde[_0xb717('0x30')][_0xb717('0x3b')]){_0x84e2ec[_0xb717('0x3a')]=_['merge'](_0x84e2ec[_0xb717('0x3a')],{'$or':_[_0xb717('0x2c')](_0x8173d4,function(_0x2c1424){if(_0x2c1424[_0xb717('0x3c')]!==_0xb717('0x3d')){var _0x20be51={};_0x20be51[_0x2c1424[_0xb717('0x2b')]]={'$like':'%'+_0x222bde[_0xb717('0x30')][_0xb717('0x3b')]+'%'};return _0x20be51;}})});}_0x84e2ec=_['merge']({},_0x84e2ec,_0x222bde[_0xb717('0x3e')]);var _0x153b75={'where':_0x84e2ec[_0xb717('0x3a')]};return db['MailTransferReport'][_0xb717('0x1f')](_0x153b75)[_0xb717('0x27')](function(_0x53c1f0){_0x25c6bb[_0xb717('0x1f')]=_0x53c1f0;if(_0x222bde[_0xb717('0x30')][_0xb717('0x3f')]){_0x84e2ec[_0xb717('0x40')]=[{'all':!![]}];}return db[_0xb717('0x41')]['findAll'](_0x84e2ec);})[_0xb717('0x27')](function(_0x837f89){_0x25c6bb[_0xb717('0x42')]=_0x837f89;return _0x25c6bb;})[_0xb717('0x27')](respondWithFilteredResult(_0x2be57f,_0x84e2ec))[_0xb717('0x43')](handleError(_0x2be57f,null));};exports['show']=function(_0x801c85,_0x4b75c7){var _0x46ec23={'raw':!![],'where':{'id':_0x801c85[_0xb717('0x44')]['id']}},_0x45a07e={};_0x45a07e[_0xb717('0x2f')]=_[_0xb717('0x31')](db[_0xb717('0x41')]['rawAttributes']);_0x45a07e[_0xb717('0x30')]=_[_0xb717('0x31')](_0x801c85[_0xb717('0x30')]);_0x45a07e[_0xb717('0x32')]=_[_0xb717('0x34')](_0x45a07e[_0xb717('0x2f')],_0x45a07e[_0xb717('0x30')]);_0x46ec23['attributes']=_[_0xb717('0x34')](_0x45a07e[_0xb717('0x2f')],qs[_0xb717('0x35')](_0x801c85['query']['fields']));_0x46ec23['attributes']=_0x46ec23[_0xb717('0x33')]['length']?_0x46ec23[_0xb717('0x33')]:_0x45a07e[_0xb717('0x2f')];if(_0x801c85['query']['includeAll']){_0x46ec23[_0xb717('0x40')]=[{'all':!![]}];}_0x46ec23=_[_0xb717('0x45')]({},_0x46ec23,_0x801c85[_0xb717('0x3e')]);return db[_0xb717('0x41')][_0xb717('0x46')](_0x46ec23)['then'](handleEntityNotFound(_0x4b75c7,null))[_0xb717('0x27')](respondWithResult(_0x4b75c7,null))[_0xb717('0x43')](handleError(_0x4b75c7,null));};exports[_0xb717('0x47')]=function(_0x216f50,_0x46e399){return db[_0xb717('0x41')][_0xb717('0x47')](_0x216f50[_0xb717('0x48')],{})['then'](respondWithResult(_0x46e399,0xc9))[_0xb717('0x43')](handleError(_0x46e399,null));};exports[_0xb717('0x25')]=function(_0x31665c,_0xf42fe5){if(_0x31665c[_0xb717('0x48')]['id']){delete _0x31665c['body']['id'];}return db[_0xb717('0x41')][_0xb717('0x46')]({'where':{'id':_0x31665c[_0xb717('0x44')]['id']}})['then'](handleEntityNotFound(_0xf42fe5,null))[_0xb717('0x27')](saveUpdates(_0x31665c[_0xb717('0x48')],null))['then'](respondWithResult(_0xf42fe5,null))[_0xb717('0x43')](handleError(_0xf42fe5,null));};exports[_0xb717('0x26')]=function(_0x3c07bb,_0x1a4321){return db[_0xb717('0x41')]['find']({'where':{'id':_0x3c07bb['params']['id']}})[_0xb717('0x27')](handleEntityNotFound(_0x1a4321,null))['then'](removeEntity(_0x1a4321,null))[_0xb717('0x43')](handleError(_0x1a4321,null));};exports['describe']=function(_0x42720c,_0x41a785){return db['MailTransferReport']['describe']()[_0xb717('0x27')](respondWithResult(_0x41a785,null))['catch'](handleError(_0x41a785,null));};
\ No newline at end of file
+var _0x8fc9=['update','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x4b63cc,_0x5e5cb2){var _0x595cf3=function(_0x3bbab9){while(--_0x3bbab9){_0x4b63cc['push'](_0x4b63cc['shift']());}};_0x595cf3(++_0x5e5cb2);}(_0x8fc9,0x16b));var _0x98fc=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x8fc9[_0x288f5e];return _0x476cc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98fc('0x0'));var zipdir=require(_0x98fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98fc('0x2'));var BPromise=require(_0x98fc('0x3'));var Mustache=require(_0x98fc('0x4'));var util=require(_0x98fc('0x5'));var path=require(_0x98fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98fc('0x7'));var _=require('lodash');var squel=require(_0x98fc('0x8'));var crypto=require(_0x98fc('0x9'));var jsforce=require(_0x98fc('0xa'));var deskjs=require(_0x98fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x98fc('0xc'));var Papa=require(_0x98fc('0xd'));var Redis=require('ioredis');var authService=require(_0x98fc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x98fc('0xf'));var hardwareService=require(_0x98fc('0x10'));var logger=require('../../config/logger')(_0x98fc('0x11'));var utils=require('../../config/utils');var config=require(_0x98fc('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a765d,_0x11d9cb){_0x11d9cb=_0x11d9cb||0xcc;return function(_0x35d4e4){if(_0x35d4e4){return _0x1a765d[_0x98fc('0x13')](_0x11d9cb);}return _0x1a765d[_0x98fc('0x14')](_0x11d9cb)[_0x98fc('0x15')]();};}function respondWithResult(_0x3f6c14,_0x52de16){_0x52de16=_0x52de16||0xc8;return function(_0x3df63d){if(_0x3df63d){return _0x3f6c14[_0x98fc('0x14')](_0x52de16)[_0x98fc('0x16')](_0x3df63d);}};}function respondWithFilteredResult(_0x2a392a,_0x2d521a){return function(_0xd22c26){if(_0xd22c26){var _0x2c0e09=typeof _0x2d521a['offset']===_0x98fc('0x17')&&typeof _0x2d521a['limit']===_0x98fc('0x17');var _0x114805=_0xd22c26[_0x98fc('0x18')];var _0x26fdf6=_0x2c0e09?0x0:_0x2d521a[_0x98fc('0x19')];var _0x186106=_0x2c0e09?_0xd22c26[_0x98fc('0x18')]:_0x2d521a['offset']+_0x2d521a[_0x98fc('0x1a')];var _0x29a24f;if(_0x186106>=_0x114805){_0x186106=_0x114805;_0x29a24f=0xc8;}else{_0x29a24f=0xce;}_0x2a392a[_0x98fc('0x14')](_0x29a24f);return _0x2a392a[_0x98fc('0x1b')](_0x98fc('0x1c'),_0x26fdf6+'-'+_0x186106+'/'+_0x114805)[_0x98fc('0x16')](_0xd22c26);}return null;};}function patchUpdates(_0x2a744b){return function(_0xded1e1){try{jsonpatch['apply'](_0xded1e1,_0x2a744b,!![]);}catch(_0x413755){return BPromise[_0x98fc('0x1d')](_0x413755);}return _0xded1e1['save']();};}function saveUpdates(_0x59df3a,_0x185a74){return function(_0x1199c9){if(_0x1199c9){return _0x1199c9['update'](_0x59df3a)[_0x98fc('0x1e')](function(_0x208bf9){return _0x208bf9;});}return null;};}function removeEntity(_0x444578,_0x1b7e28){return function(_0x3b4f07){if(_0x3b4f07){return _0x3b4f07[_0x98fc('0x1f')]()['then'](function(){_0x444578[_0x98fc('0x14')](0xcc)[_0x98fc('0x15')]();});}};}function handleEntityNotFound(_0x28893d,_0x542b4b){return function(_0x43a2f3){if(!_0x43a2f3){_0x28893d[_0x98fc('0x13')](0x194);}return _0x43a2f3;};}function handleError(_0x567af5,_0x5deea6){_0x5deea6=_0x5deea6||0x1f4;return function(_0x3e1440){logger[_0x98fc('0x20')](_0x3e1440['stack']);if(_0x3e1440['name']){delete _0x3e1440[_0x98fc('0x21')];}_0x567af5[_0x98fc('0x14')](_0x5deea6)[_0x98fc('0x22')](_0x3e1440);};}exports[_0x98fc('0x23')]=function(_0x111d7a,_0x248045){var _0x7cfc6a={},_0xaacb62={},_0x4cf569={'count':0x0,'rows':[]};var _0xd10a3d=_[_0x98fc('0x24')](db[_0x98fc('0x25')][_0x98fc('0x26')],function(_0x409164){return{'name':_0x409164[_0x98fc('0x27')],'type':_0x409164[_0x98fc('0x28')][_0x98fc('0x29')]};});_0xaacb62[_0x98fc('0x2a')]=_['map'](_0xd10a3d,'name');_0xaacb62[_0x98fc('0x2b')]=_[_0x98fc('0x2c')](_0x111d7a[_0x98fc('0x2b')]);_0xaacb62[_0x98fc('0x2d')]=_[_0x98fc('0x2e')](_0xaacb62[_0x98fc('0x2a')],_0xaacb62[_0x98fc('0x2b')]);_0x7cfc6a[_0x98fc('0x2f')]=_['intersection'](_0xaacb62[_0x98fc('0x2a')],qs['fields'](_0x111d7a['query'][_0x98fc('0x30')]));_0x7cfc6a[_0x98fc('0x2f')]=_0x7cfc6a[_0x98fc('0x2f')][_0x98fc('0x31')]?_0x7cfc6a[_0x98fc('0x2f')]:_0xaacb62[_0x98fc('0x2a')];if(!_0x111d7a[_0x98fc('0x2b')][_0x98fc('0x32')](_0x98fc('0x33'))){_0x7cfc6a[_0x98fc('0x1a')]=qs[_0x98fc('0x1a')](_0x111d7a['query']['limit']);_0x7cfc6a[_0x98fc('0x19')]=qs[_0x98fc('0x19')](_0x111d7a[_0x98fc('0x2b')]['offset']);}_0x7cfc6a[_0x98fc('0x34')]=qs[_0x98fc('0x35')](_0x111d7a[_0x98fc('0x2b')][_0x98fc('0x35')]);_0x7cfc6a[_0x98fc('0x36')]=qs[_0x98fc('0x2d')](_[_0x98fc('0x37')](_0x111d7a['query'],_0xaacb62[_0x98fc('0x2d')]),_0xd10a3d);if(_0x111d7a[_0x98fc('0x2b')]['filter']){_0x7cfc6a[_0x98fc('0x36')]=_[_0x98fc('0x38')](_0x7cfc6a[_0x98fc('0x36')],{'$or':_[_0x98fc('0x24')](_0xd10a3d,function(_0x59293f){if(_0x59293f[_0x98fc('0x28')]!==_0x98fc('0x39')){var _0x14b03c={};_0x14b03c[_0x59293f[_0x98fc('0x21')]]={'$like':'%'+_0x111d7a[_0x98fc('0x2b')][_0x98fc('0x3a')]+'%'};return _0x14b03c;}})});}_0x7cfc6a=_['merge']({},_0x7cfc6a,_0x111d7a[_0x98fc('0x3b')]);var _0x3bd032={'where':_0x7cfc6a['where']};return db[_0x98fc('0x25')]['count'](_0x3bd032)['then'](function(_0x1ce1e6){_0x4cf569['count']=_0x1ce1e6;if(_0x111d7a[_0x98fc('0x2b')][_0x98fc('0x3c')]){_0x7cfc6a[_0x98fc('0x3d')]=[{'all':!![]}];}return db[_0x98fc('0x25')][_0x98fc('0x3e')](_0x7cfc6a);})['then'](function(_0x27e66e){_0x4cf569[_0x98fc('0x3f')]=_0x27e66e;return _0x4cf569;})[_0x98fc('0x1e')](respondWithFilteredResult(_0x248045,_0x7cfc6a))[_0x98fc('0x40')](handleError(_0x248045,null));};exports[_0x98fc('0x41')]=function(_0x3a8800,_0xcc350e){var _0x4f8bcb={'raw':!![],'where':{'id':_0x3a8800[_0x98fc('0x42')]['id']}},_0x41e8a3={};_0x41e8a3[_0x98fc('0x2a')]=_['keys'](db[_0x98fc('0x25')][_0x98fc('0x26')]);_0x41e8a3['query']=_['keys'](_0x3a8800['query']);_0x41e8a3[_0x98fc('0x2d')]=_[_0x98fc('0x2e')](_0x41e8a3['model'],_0x41e8a3[_0x98fc('0x2b')]);_0x4f8bcb[_0x98fc('0x2f')]=_[_0x98fc('0x2e')](_0x41e8a3[_0x98fc('0x2a')],qs['fields'](_0x3a8800['query'][_0x98fc('0x30')]));_0x4f8bcb[_0x98fc('0x2f')]=_0x4f8bcb[_0x98fc('0x2f')]['length']?_0x4f8bcb[_0x98fc('0x2f')]:_0x41e8a3['model'];if(_0x3a8800[_0x98fc('0x2b')][_0x98fc('0x3c')]){_0x4f8bcb['include']=[{'all':!![]}];}_0x4f8bcb=_[_0x98fc('0x38')]({},_0x4f8bcb,_0x3a8800['options']);return db[_0x98fc('0x25')][_0x98fc('0x43')](_0x4f8bcb)['then'](handleEntityNotFound(_0xcc350e,null))[_0x98fc('0x1e')](respondWithResult(_0xcc350e,null))[_0x98fc('0x40')](handleError(_0xcc350e,null));};exports[_0x98fc('0x44')]=function(_0x33edca,_0x5af283){return db[_0x98fc('0x25')]['create'](_0x33edca['body'],{})[_0x98fc('0x1e')](respondWithResult(_0x5af283,0xc9))[_0x98fc('0x40')](handleError(_0x5af283,null));};exports[_0x98fc('0x45')]=function(_0x269a0c,_0x9c0050){if(_0x269a0c['body']['id']){delete _0x269a0c['body']['id'];}return db[_0x98fc('0x25')]['find']({'where':{'id':_0x269a0c[_0x98fc('0x42')]['id']}})['then'](handleEntityNotFound(_0x9c0050,null))['then'](saveUpdates(_0x269a0c[_0x98fc('0x46')],null))[_0x98fc('0x1e')](respondWithResult(_0x9c0050,null))[_0x98fc('0x40')](handleError(_0x9c0050,null));};exports[_0x98fc('0x1f')]=function(_0x281d24,_0x135b0c){return db[_0x98fc('0x25')][_0x98fc('0x43')]({'where':{'id':_0x281d24[_0x98fc('0x42')]['id']}})[_0x98fc('0x1e')](handleEntityNotFound(_0x135b0c,null))['then'](removeEntity(_0x135b0c,null))[_0x98fc('0x40')](handleError(_0x135b0c,null));};exports[_0x98fc('0x47')]=function(_0x57530a,_0x8f5dbe){return db[_0x98fc('0x25')][_0x98fc('0x47')]()['then'](respondWithResult(_0x8f5dbe,null))[_0x98fc('0x40')](handleError(_0x8f5dbe,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5ec=['request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x11a206,_0x296fd6){var _0x5bab3c=function(_0x3fbf7a){while(--_0x3fbf7a){_0x11a206['push'](_0x11a206['shift']());}};_0x5bab3c(++_0x296fd6);}(_0xb5ec,0x97));var _0xcb5e=function(_0x500948,_0x219347){_0x500948=_0x500948-0x0;var _0xb2f173=_0xb5ec[_0x500948];return _0xb2f173;};'use strict';var _=require(_0xcb5e('0x0'));var util=require(_0xcb5e('0x1'));var logger=require(_0xcb5e('0x2'))(_0xcb5e('0x3'));var moment=require('moment');var BPromise=require(_0xcb5e('0x4'));var rp=require(_0xcb5e('0x5'));var fs=require('fs');var path=require(_0xcb5e('0x6'));var rimraf=require('rimraf');var config=require(_0xcb5e('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xcb5e('0x8')]=function(_0xfbd838,_0x38fd3e){return _0xfbd838[_0xcb5e('0x9')](_0xcb5e('0xa'),attributes,{'tableName':_0xcb5e('0xb'),'paranoid':![],'indexes':[{'name':_0xcb5e('0xc'),'fields':[_0xcb5e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc765=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0xc765,0xf5));var _0x5c76=function(_0x577788,_0x42e5c9){_0x577788=_0x577788-0x0;var _0x30296d=_0xc765[_0x577788];return _0x30296d;};'use strict';var _=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var logger=require(_0x5c76('0x2'))(_0x5c76('0x3'));var moment=require(_0x5c76('0x4'));var BPromise=require(_0x5c76('0x5'));var rp=require(_0x5c76('0x6'));var fs=require('fs');var path=require(_0x5c76('0x7'));var rimraf=require('rimraf');var config=require(_0x5c76('0x8'));var attributes=require(_0x5c76('0x9'));module[_0x5c76('0xa')]=function(_0x7ae090,_0x3a2123){return _0x7ae090[_0x5c76('0xb')](_0x5c76('0xc'),attributes,{'tableName':_0x5c76('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5c76('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2b6=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x549d31,_0x599bd7){var _0x48c83f=function(_0x57d9ec){while(--_0x57d9ec){_0x549d31['push'](_0x549d31['shift']());}};_0x48c83f(++_0x599bd7);}(_0xe2b6,0x8d));var _0x6e2b=function(_0x47423c,_0x49871b){_0x47423c=_0x47423c-0x0;var _0xd34166=_0xe2b6[_0x47423c];return _0xd34166;};'use strict';var _=require(_0x6e2b('0x0'));var util=require('util');var moment=require(_0x6e2b('0x1'));var BPromise=require(_0x6e2b('0x2'));var rs=require(_0x6e2b('0x3'));var fs=require('fs');var Redis=require(_0x6e2b('0x4'));var db=require(_0x6e2b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e2b('0x6'))('rpc');var config=require(_0x6e2b('0x7'));var jayson=require(_0x6e2b('0x8'));var client=jayson[_0x6e2b('0x9')][_0x6e2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a2b45,_0x4074a0,_0x51b23e){return new BPromise(function(_0x1f86d0,_0x152e4c){return client['request'](_0x2a2b45,_0x51b23e)[_0x6e2b('0xb')](function(_0x36b4b4){logger[_0x6e2b('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x4074a0,'request\x20sent');logger['debug'](_0x6e2b('0xd'),_0x4074a0,_0x6e2b('0xe'),JSON[_0x6e2b('0xf')](_0x36b4b4));if(_0x36b4b4[_0x6e2b('0x10')]){if(_0x36b4b4['error'][_0x6e2b('0x11')]===0x1f4){logger[_0x6e2b('0x10')](_0x6e2b('0x12'),_0x4074a0,_0x36b4b4[_0x6e2b('0x10')]['message']);return _0x152e4c(_0x36b4b4[_0x6e2b('0x10')][_0x6e2b('0x13')]);}logger[_0x6e2b('0x10')](_0x6e2b('0x12'),_0x4074a0,_0x36b4b4[_0x6e2b('0x10')][_0x6e2b('0x13')]);return _0x1f86d0(_0x36b4b4[_0x6e2b('0x10')][_0x6e2b('0x13')]);}else{logger[_0x6e2b('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x4074a0,_0x6e2b('0xe'));_0x1f86d0(_0x36b4b4[_0x6e2b('0x14')][_0x6e2b('0x13')]);}})[_0x6e2b('0x15')](function(_0x5d3ee8){logger[_0x6e2b('0x10')](_0x6e2b('0x12'),_0x4074a0,_0x5d3ee8);_0x152e4c(_0x5d3ee8);});});}
\ No newline at end of file
+var _0x9868=['stringify','error','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xb5feb8,_0x4cfbc3){var _0x9f1272=function(_0x2bd00a){while(--_0x2bd00a){_0xb5feb8['push'](_0xb5feb8['shift']());}};_0x9f1272(++_0x4cfbc3);}(_0x9868,0x131));var _0x8986=function(_0x2d5f59,_0x510e49){_0x2d5f59=_0x2d5f59-0x0;var _0x59f5ae=_0x9868[_0x2d5f59];return _0x59f5ae;};'use strict';var _=require(_0x8986('0x0'));var util=require(_0x8986('0x1'));var moment=require('moment');var BPromise=require(_0x8986('0x2'));var rs=require(_0x8986('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8986('0x4'))['db'];var utils=require(_0x8986('0x5'));var logger=require(_0x8986('0x6'))(_0x8986('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8986('0x8')][_0x8986('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42ada8,_0xf5171b,_0x47fa8f){return new BPromise(function(_0x2df8e6,_0xa245ce){return client[_0x8986('0xa')](_0x42ada8,_0x47fa8f)['then'](function(_0x377070){logger[_0x8986('0xb')]('MailTransferReport,\x20%s,\x20%s',_0xf5171b,_0x8986('0xc'));logger[_0x8986('0xd')](_0x8986('0xe'),_0xf5171b,_0x8986('0xc'),JSON[_0x8986('0xf')](_0x377070));if(_0x377070[_0x8986('0x10')]){if(_0x377070['error']['code']===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0xf5171b,_0x377070[_0x8986('0x10')][_0x8986('0x11')]);return _0xa245ce(_0x377070[_0x8986('0x10')]['message']);}logger[_0x8986('0x10')]('MailTransferReport,\x20%s,\x20%s',_0xf5171b,_0x377070['error'][_0x8986('0x11')]);return _0x2df8e6(_0x377070[_0x8986('0x10')][_0x8986('0x11')]);}else{logger[_0x8986('0xb')](_0x8986('0x12'),_0xf5171b,_0x8986('0xc'));_0x2df8e6(_0x377070['result']['message']);}})[_0x8986('0x13')](function(_0x177148){logger[_0x8986('0x10')]('MailTransferReport,\x20%s,\x20%s',_0xf5171b,_0x177148);_0xa245ce(_0x177148);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2198=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./memberReport.controller','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2198,0x17c));var _0x8219=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0x2198[_0x3ed4d7];return _0x2be1a4;};'use strict';var multer=require(_0x8219('0x0'));var util=require(_0x8219('0x1'));var path=require(_0x8219('0x2'));var timeout=require(_0x8219('0x3'));var express=require(_0x8219('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8219('0x5'));var interaction=require(_0x8219('0x6'));var config=require('../../config/environment');var controller=require(_0x8219('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8219('0x8')]);router[_0x8219('0x9')]('/describe',auth[_0x8219('0xa')](),controller[_0x8219('0xb')]);router[_0x8219('0x9')](_0x8219('0xc'),auth[_0x8219('0xa')](),controller[_0x8219('0xd')]);router[_0x8219('0xe')]('/',auth['isAuthenticated'](),controller[_0x8219('0xf')]);router[_0x8219('0x10')](_0x8219('0xc'),auth[_0x8219('0xa')](),controller[_0x8219('0x11')]);router['delete']('/:id',auth[_0x8219('0xa')](),controller[_0x8219('0x12')]);module[_0x8219('0x13')]=router;
\ No newline at end of file
+var _0xa1b8=['./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x1c9995,_0x542b6e){var _0x47a31a=function(_0x92e8bd){while(--_0x92e8bd){_0x1c9995['push'](_0x1c9995['shift']());}};_0x47a31a(++_0x542b6e);}(_0xa1b8,0x12c));var _0x8a1b=function(_0x3b3337,_0x5bdba6){_0x3b3337=_0x3b3337-0x0;var _0x2a857a=_0xa1b8[_0x3b3337];return _0x2a857a;};'use strict';var multer=require('multer');var util=require(_0x8a1b('0x0'));var path=require(_0x8a1b('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a1b('0x2'));var router=express[_0x8a1b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a1b('0x4'));var config=require(_0x8a1b('0x5'));var controller=require(_0x8a1b('0x6'));router[_0x8a1b('0x7')]('/',auth[_0x8a1b('0x8')](),controller[_0x8a1b('0x9')]);router[_0x8a1b('0x7')](_0x8a1b('0xa'),auth[_0x8a1b('0x8')](),controller[_0x8a1b('0xb')]);router['get'](_0x8a1b('0xc'),auth[_0x8a1b('0x8')](),controller[_0x8a1b('0xd')]);router['post']('/',auth[_0x8a1b('0x8')](),controller['create']);router[_0x8a1b('0xe')]('/:id',auth[_0x8a1b('0x8')](),controller[_0x8a1b('0xf')]);router['delete'](_0x8a1b('0xc'),auth['isAuthenticated'](),controller[_0x8a1b('0x10')]);module[_0x8a1b('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8be1=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x2826b0,_0x46d50a){var _0x9a3f49=function(_0x24c993){while(--_0x24c993){_0x2826b0['push'](_0x2826b0['shift']());}};_0x9a3f49(++_0x46d50a);}(_0x8be1,0x8b));var _0x18be=function(_0x1a2d60,_0x2c9aef){_0x1a2d60=_0x1a2d60-0x0;var _0x4f2276=_0x8be1[_0x1a2d60];return _0x4f2276;};'use strict';var Sequelize=require(_0x18be('0x0'));var moment=require(_0x18be('0x1'));module[_0x18be('0x2')]={'channel':{'type':Sequelize[_0x18be('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x18be('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x18be('0x4'),'comment':_0x18be('0x5')},'duration':{'type':Sequelize[_0x18be('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x18be('0x7')],'set':function(_0x1b9d29){var _0x115368=moment(_0x1b9d29);var _0xa53352=moment(this[_0x18be('0x8')](_0x18be('0x9')));var _0x221ae4=_0x115368[_0x18be('0xa')](_0xa53352,_0x18be('0xb'));this[_0x18be('0xc')](_0x18be('0xd'),_0x1b9d29);this[_0x18be('0xc')]('duration',_0x221ae4>=0x0?_0x221ae4:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x18be('0xe')},'data2':{'type':Sequelize[_0x18be('0x3')],'comment':_0x18be('0xf')},'data3':{'type':Sequelize[_0x18be('0x3')],'comment':_0x18be('0x10')},'data4':{'type':Sequelize[_0x18be('0x3')],'comment':_0x18be('0x11')},'data5':{'type':Sequelize[_0x18be('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x18be('0x3')]},'internal':{'type':Sequelize[_0x18be('0x6')]},'uniqueid':{'type':Sequelize[_0x18be('0x3')]}};
\ No newline at end of file
+var _0x718c=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x718c,0x13a));var _0xc718=function(_0x238314,_0xa98c8a){_0x238314=_0x238314-0x0;var _0x5243bd=_0x718c[_0x238314];return _0x5243bd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc718('0x0'));module['exports']={'channel':{'type':Sequelize[_0xc718('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc718('0x1')]},'type':{'type':Sequelize[_0xc718('0x1')],'defaultValue':_0xc718('0x2'),'comment':_0xc718('0x3')},'duration':{'type':Sequelize[_0xc718('0x4')]},'enterAt':{'type':Sequelize[_0xc718('0x5')]},'exitAt':{'type':Sequelize[_0xc718('0x5')],'set':function(_0x102e2f){var _0x3d8749=moment(_0x102e2f);var _0x361b2d=moment(this[_0xc718('0x6')](_0xc718('0x7')));var _0x27f609=_0x3d8749[_0xc718('0x8')](_0x361b2d,_0xc718('0x9'));this[_0xc718('0xa')](_0xc718('0xb'),_0x102e2f);this['setDataValue'](_0xc718('0xc'),_0x27f609>=0x0?_0x27f609:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xc718('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xc718('0xe')},'data3':{'type':Sequelize[_0xc718('0x1')],'comment':_0xc718('0xf')},'data4':{'type':Sequelize[_0xc718('0x1')],'comment':_0xc718('0x10')},'data5':{'type':Sequelize[_0xc718('0x1')],'comment':_0xc718('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xc718('0x4')]},'uniqueid':{'type':Sequelize[_0xc718('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x329502,_0x2c7184){var _0x7f91b6=function(_0x532df2){while(--_0x532df2){_0x329502['push'](_0x329502['shift']());}};_0x7f91b6(++_0x2c7184);}(_0x3e74,0x175));var _0x43e7=function(_0x310af5,_0x3d69ef){_0x310af5=_0x310af5-0x0;var _0x5a7956=_0x3e74[_0x310af5];return _0x5a7956;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
+var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x34e8,0x12c));var _0x834e=function(_0x4bddb2,_0x3dc5e5){_0x4bddb2=_0x4bddb2-0x0;var _0xcc2a16=_0x34e8[_0x4bddb2];return _0xcc2a16;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x87d3=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x499b78,_0x4ed368){var _0x5e4e9e=function(_0x19a0c6){while(--_0x19a0c6){_0x499b78['push'](_0x499b78['shift']());}};_0x5e4e9e(++_0x4ed368);}(_0x87d3,0x86));var _0x387d=function(_0x21fe11,_0x52f846){_0x21fe11=_0x21fe11-0x0;var _0x5eb704=_0x87d3[_0x21fe11];return _0x5eb704;};'use strict';var _=require(_0x387d('0x0'));var util=require(_0x387d('0x1'));var logger=require(_0x387d('0x2'))(_0x387d('0x3'));var moment=require(_0x387d('0x4'));var BPromise=require(_0x387d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x387d('0x6'));var rimraf=require('rimraf');var config=require(_0x387d('0x7'));var attributes=require(_0x387d('0x8'));module[_0x387d('0x9')]=function(_0x49d349,_0x3e0d03){return _0x49d349[_0x387d('0xa')](_0x387d('0xb'),attributes,{'tableName':_0x387d('0xc'),'paranoid':![],'indexes':[{'name':_0x387d('0xd'),'fields':[_0x387d('0xe'),_0x387d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9aac=['membername','lodash','../../config/logger','api','bluebird','path','../../config/environment','./memberReport.attributes','define','report_member','membername_interface'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x9aac,0x135));var _0xc9aa=function(_0x22541a,_0x4b745f){_0x22541a=_0x22541a-0x0;var _0x258ffd=_0x9aac[_0x22541a];return _0x258ffd;};'use strict';var _=require(_0xc9aa('0x0'));var util=require('util');var logger=require(_0xc9aa('0x1'))(_0xc9aa('0x2'));var moment=require('moment');var BPromise=require(_0xc9aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9aa('0x4'));var rimraf=require('rimraf');var config=require(_0xc9aa('0x5'));var attributes=require(_0xc9aa('0x6'));module['exports']=function(_0x280687,_0x2f9029){return _0x280687[_0xc9aa('0x7')]('MemberReport',attributes,{'tableName':_0xc9aa('0x8'),'paranoid':![],'indexes':[{'name':_0xc9aa('0x9'),'fields':[_0xc9aa('0xa'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd206=['attributes','limit','map','include','model','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','MemberReport,\x20%s,\x20%s','info','result','catch','GetMemberReport','findAll','options','raw','where'];(function(_0x53b30b,_0x4240cd){var _0xec1d7c=function(_0x8359ae){while(--_0x8359ae){_0x53b30b['push'](_0x53b30b['shift']());}};_0xec1d7c(++_0x4240cd);}(_0xd206,0x107));var _0x6d20=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xd206[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var moment=require('moment');var BPromise=require(_0x6d20('0x2'));var rs=require(_0x6d20('0x3'));var fs=require('fs');var Redis=require(_0x6d20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d20('0x5'));var logger=require(_0x6d20('0x6'))(_0x6d20('0x7'));var config=require(_0x6d20('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d20('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc981,_0x125a39,_0x3080fb){return new BPromise(function(_0x5b4154,_0x2b338c){return client['request'](_0x4dc981,_0x3080fb)[_0x6d20('0xa')](function(_0x4222dc){logger['info']('MemberReport,\x20%s,\x20%s',_0x125a39,'request\x20sent');logger[_0x6d20('0xb')](_0x6d20('0xc'),_0x125a39,'request\x20sent',JSON[_0x6d20('0xd')](_0x4222dc));if(_0x4222dc['error']){if(_0x4222dc[_0x6d20('0xe')]['code']===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x125a39,_0x4222dc['error'][_0x6d20('0xf')]);return _0x2b338c(_0x4222dc[_0x6d20('0xe')][_0x6d20('0xf')]);}logger[_0x6d20('0xe')](_0x6d20('0x10'),_0x125a39,_0x4222dc[_0x6d20('0xe')]['message']);return _0x5b4154(_0x4222dc[_0x6d20('0xe')]['message']);}else{logger[_0x6d20('0x11')](_0x6d20('0x10'),_0x125a39,'request\x20sent');_0x5b4154(_0x4222dc[_0x6d20('0x12')][_0x6d20('0xf')]);}})[_0x6d20('0x13')](function(_0x133cd0){logger['error']('MemberReport,\x20%s,\x20%s',_0x125a39,_0x133cd0);_0x2b338c(_0x133cd0);});});}exports[_0x6d20('0x14')]=function(_0x12fad7){var _0x4f938f=this;return new Promise(function(_0x10b87,_0x5040df){return db['MemberReport'][_0x6d20('0x15')]({'raw':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x17')]===undefined?!![]:![]:!![],'where':_0x12fad7['options']?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x18')]||null:null,'attributes':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x19')]||null:null,'limit':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')][_0x6d20('0x1a')]||null:null,'include':_0x12fad7[_0x6d20('0x16')]?_0x12fad7[_0x6d20('0x16')]['include']?_[_0x6d20('0x1b')](_0x12fad7['options'][_0x6d20('0x1c')],function(_0x4db5ba){return{'model':db[_0x4db5ba[_0x6d20('0x1d')]],'as':_0x4db5ba['as'],'attributes':_0x4db5ba[_0x6d20('0x19')],'include':_0x4db5ba[_0x6d20('0x1c')]?_[_0x6d20('0x1b')](_0x4db5ba[_0x6d20('0x1c')],function(_0x20054c){return{'model':db[_0x20054c[_0x6d20('0x1d')]],'as':_0x20054c['as'],'attributes':_0x20054c[_0x6d20('0x19')],'include':_0x20054c[_0x6d20('0x1c')]?_[_0x6d20('0x1b')](_0x20054c[_0x6d20('0x1c')],function(_0x5a50a9){return{'model':db[_0x5a50a9[_0x6d20('0x1d')]],'as':_0x5a50a9['as'],'attributes':_0x5a50a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d20('0xa')](function(_0x29c2d3){logger[_0x6d20('0x11')](_0x6d20('0x14'),_0x12fad7);logger[_0x6d20('0xb')]('GetMemberReport',_0x12fad7,JSON[_0x6d20('0xd')](_0x29c2d3));_0x10b87(_0x29c2d3);})[_0x6d20('0x13')](function(_0x4f9c49){logger[_0x6d20('0xe')]('GetMemberReport',_0x4f9c49[_0x6d20('0xf')],_0x12fad7);_0x5040df(_0x4f938f[_0x6d20('0xe')](0x1f4,_0x4f9c49[_0x6d20('0xf')]));});});};exports['CreateMemberReport']=function(_0xbb5adc){var _0x1bbf05=this;return new Promise(function(_0x404921,_0x3cbb12){return db[_0x6d20('0x1e')][_0x6d20('0x1f')](_0xbb5adc[_0x6d20('0x20')],{'raw':_0xbb5adc[_0x6d20('0x16')]?_0xbb5adc[_0x6d20('0x16')][_0x6d20('0x17')]===undefined?!![]:![]:!![]})[_0x6d20('0xa')](function(_0x3b1894){logger['info'](_0x6d20('0x21'),_0xbb5adc);logger[_0x6d20('0xb')](_0x6d20('0x21'),_0xbb5adc,JSON[_0x6d20('0xd')](_0x3b1894));_0x404921(_0x3b1894);})['catch'](function(_0x4cb4d5){logger[_0x6d20('0xe')](_0x6d20('0x21'),_0x4cb4d5[_0x6d20('0xf')],_0xbb5adc);_0x3cbb12(_0x1bbf05[_0x6d20('0xe')](0x1f4,_0x4cb4d5['message']));});});};exports[_0x6d20('0x22')]=function(_0x374fba){var _0x191fee=this;return new Promise(function(_0x414cf2,_0x3b0156){return db[_0x6d20('0x1e')][_0x6d20('0x23')](_0x374fba[_0x6d20('0x20')],{'raw':_0x374fba['options']?_0x374fba[_0x6d20('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374fba[_0x6d20('0x16')]?_0x374fba[_0x6d20('0x16')][_0x6d20('0x18')]||null:null,'attributes':_0x374fba[_0x6d20('0x16')]?_0x374fba['options'][_0x6d20('0x19')]||null:null,'limit':_0x374fba['options']?_0x374fba[_0x6d20('0x16')][_0x6d20('0x1a')]||null:null})[_0x6d20('0xa')](function(_0x24ae33){logger[_0x6d20('0x11')](_0x6d20('0x22'),_0x374fba);logger['debug'](_0x6d20('0x22'),_0x374fba,JSON['stringify'](_0x24ae33));_0x414cf2(_0x24ae33);})[_0x6d20('0x13')](function(_0x16dbbc){logger['error'](_0x6d20('0x22'),_0x16dbbc[_0x6d20('0xf')],_0x374fba);_0x3b0156(_0x191fee['error'](0x1f4,_0x16dbbc[_0x6d20('0xf')]));});});};
\ No newline at end of file
+var _0x9e2e=['map','model','info','debug','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetMemberReport','findAll','options','where','attributes','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x928c81,_0x1e8598){_0x928c81=_0x928c81-0x0;var _0x5424a7=_0x9e2e[_0x928c81];return _0x5424a7;};'use strict';var _=require(_0xe9e2('0x0'));var util=require(_0xe9e2('0x1'));var moment=require(_0xe9e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9e2('0x4'));var logger=require(_0xe9e2('0x5'))(_0xe9e2('0x6'));var config=require(_0xe9e2('0x7'));var jayson=require(_0xe9e2('0x8'));var client=jayson[_0xe9e2('0x9')][_0xe9e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ca0aa,_0x118600,_0x4f1ef7){return new BPromise(function(_0x2bec58,_0x1ade12){return client['request'](_0x5ca0aa,_0x4f1ef7)[_0xe9e2('0xb')](function(_0x48882a){logger['info'](_0xe9e2('0xc'),_0x118600,_0xe9e2('0xd'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x118600,_0xe9e2('0xd'),JSON[_0xe9e2('0xe')](_0x48882a));if(_0x48882a[_0xe9e2('0xf')]){if(_0x48882a[_0xe9e2('0xf')]['code']===0x1f4){logger['error'](_0xe9e2('0xc'),_0x118600,_0x48882a[_0xe9e2('0xf')][_0xe9e2('0x10')]);return _0x1ade12(_0x48882a[_0xe9e2('0xf')][_0xe9e2('0x10')]);}logger[_0xe9e2('0xf')](_0xe9e2('0xc'),_0x118600,_0x48882a[_0xe9e2('0xf')][_0xe9e2('0x10')]);return _0x2bec58(_0x48882a[_0xe9e2('0xf')]['message']);}else{logger['info'](_0xe9e2('0xc'),_0x118600,'request\x20sent');_0x2bec58(_0x48882a['result'][_0xe9e2('0x10')]);}})[_0xe9e2('0x11')](function(_0x3550ce){logger[_0xe9e2('0xf')](_0xe9e2('0xc'),_0x118600,_0x3550ce);_0x1ade12(_0x3550ce);});});}exports[_0xe9e2('0x12')]=function(_0x5f3fc8){var _0xdf6f78=this;return new Promise(function(_0x2094fc,_0x3b6637){return db['MemberReport'][_0xe9e2('0x13')]({'raw':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x15')]||null:null,'attributes':_0x5f3fc8['options']?_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x16')]||null:null,'limit':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')]['limit']||null:null,'include':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x17')],function(_0x26ce3d){return{'model':db[_0x26ce3d[_0xe9e2('0x19')]],'as':_0x26ce3d['as'],'attributes':_0x26ce3d[_0xe9e2('0x16')],'include':_0x26ce3d[_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x26ce3d[_0xe9e2('0x17')],function(_0x2a3d69){return{'model':db[_0x2a3d69[_0xe9e2('0x19')]],'as':_0x2a3d69['as'],'attributes':_0x2a3d69[_0xe9e2('0x16')],'include':_0x2a3d69[_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x2a3d69['include'],function(_0x43445d){return{'model':db[_0x43445d[_0xe9e2('0x19')]],'as':_0x43445d['as'],'attributes':_0x43445d[_0xe9e2('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe9e2('0xb')](function(_0x57254c){logger[_0xe9e2('0x1a')](_0xe9e2('0x12'),_0x5f3fc8);logger[_0xe9e2('0x1b')](_0xe9e2('0x12'),_0x5f3fc8,JSON[_0xe9e2('0xe')](_0x57254c));_0x2094fc(_0x57254c);})['catch'](function(_0x4cf43f){logger[_0xe9e2('0xf')](_0xe9e2('0x12'),_0x4cf43f[_0xe9e2('0x10')],_0x5f3fc8);_0x3b6637(_0xdf6f78[_0xe9e2('0xf')](0x1f4,_0x4cf43f[_0xe9e2('0x10')]));});});};exports[_0xe9e2('0x1c')]=function(_0x5da7b3){var _0x29d238=this;return new Promise(function(_0x546961,_0x227b7e){return db[_0xe9e2('0x1d')][_0xe9e2('0x1e')](_0x5da7b3[_0xe9e2('0x1f')],{'raw':_0x5da7b3[_0xe9e2('0x14')]?_0x5da7b3['options']['raw']===undefined?!![]:![]:!![]})[_0xe9e2('0xb')](function(_0xecccbc){logger['info'](_0xe9e2('0x1c'),_0x5da7b3);logger[_0xe9e2('0x1b')](_0xe9e2('0x1c'),_0x5da7b3,JSON['stringify'](_0xecccbc));_0x546961(_0xecccbc);})[_0xe9e2('0x11')](function(_0x414eef){logger[_0xe9e2('0xf')](_0xe9e2('0x1c'),_0x414eef['message'],_0x5da7b3);_0x227b7e(_0x29d238[_0xe9e2('0xf')](0x1f4,_0x414eef[_0xe9e2('0x10')]));});});};exports[_0xe9e2('0x20')]=function(_0x4a84bd){var _0x47e133=this;return new Promise(function(_0x3f66ab,_0x102b06){return db[_0xe9e2('0x1d')][_0xe9e2('0x21')](_0x4a84bd[_0xe9e2('0x1f')],{'raw':_0x4a84bd[_0xe9e2('0x14')]?_0x4a84bd[_0xe9e2('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a84bd['options']?_0x4a84bd[_0xe9e2('0x14')]['where']||null:null,'attributes':_0x4a84bd[_0xe9e2('0x14')]?_0x4a84bd[_0xe9e2('0x14')]['attributes']||null:null,'limit':_0x4a84bd[_0xe9e2('0x14')]?_0x4a84bd[_0xe9e2('0x14')]['limit']||null:null})[_0xe9e2('0xb')](function(_0x302d4d){logger['info']('UpdateMemberReport',_0x4a84bd);logger[_0xe9e2('0x1b')](_0xe9e2('0x20'),_0x4a84bd,JSON[_0xe9e2('0xe')](_0x302d4d));_0x3f66ab(_0x302d4d);})['catch'](function(_0x41a3bb){logger['error'](_0xe9e2('0x20'),_0x41a3bb[_0xe9e2('0x10')],_0x4a84bd);_0x102b06(_0x47e133[_0xe9e2('0xf')](0x1f4,_0x41a3bb[_0xe9e2('0x10')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e52=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util'];(function(_0x290115,_0x16b8da){var _0x1f59b8=function(_0x3f4d32){while(--_0x3f4d32){_0x290115['push'](_0x290115['shift']());}};_0x1f59b8(++_0x16b8da);}(_0x8e52,0x1c6));var _0x28e5=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x8e52[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require(_0x28e5('0x0'));var path=require(_0x28e5('0x1'));var timeout=require(_0x28e5('0x2'));var express=require(_0x28e5('0x3'));var router=express[_0x28e5('0x4')]();var fs_extra=require(_0x28e5('0x5'));var auth=require(_0x28e5('0x6'));var interaction=require(_0x28e5('0x7'));var config=require(_0x28e5('0x8'));var controller=require(_0x28e5('0x9'));router[_0x28e5('0xa')]('/',controller[_0x28e5('0xb')]);module[_0x28e5('0xc')]=router;
\ No newline at end of file
+var _0xd6d2=['./migration.controller','index','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x2786e0,_0xe53616){_0x2786e0=_0x2786e0-0x0;var _0x5b9c4b=_0xd6d2[_0x2786e0];return _0x5b9c4b;};'use strict';var multer=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var path=require('path');var timeout=require(_0x2d6d('0x2'));var express=require(_0x2d6d('0x3'));var router=express['Router']();var fs_extra=require(_0x2d6d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d6d('0x5'));var config=require(_0x2d6d('0x6'));var controller=require(_0x2d6d('0x7'));router['get']('/',controller[_0x2d6d('0x8')]);module[_0x2d6d('0x9')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6cea=['sequelize','exports'];(function(_0xeeb156,_0x5392f4){var _0x4b7c74=function(_0x5705bb){while(--_0x5705bb){_0xeeb156['push'](_0xeeb156['shift']());}};_0x4b7c74(++_0x5392f4);}(_0x6cea,0xd2));var _0xa6ce=function(_0x95e80c,_0x46381c){_0x95e80c=_0x95e80c-0x0;var _0x12c4cf=_0x6cea[_0x95e80c];return _0x12c4cf;};'use strict';var Sequelize=require(_0xa6ce('0x0'));module[_0xa6ce('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}};
\ No newline at end of file
+var _0xeba4=['STRING','version','sequelize','exports'];(function(_0x300860,_0x509371){var _0x2094ad=function(_0x2090a2){while(--_0x2090a2){_0x300860['push'](_0x300860['shift']());}};_0x2094ad(++_0x509371);}(_0xeba4,0x17a));var _0x4eba=function(_0xbe4883,_0x2182c){_0xbe4883=_0xbe4883-0x0;var _0x2d1f79=_0xeba4[_0xbe4883];return _0x2d1f79;};'use strict';var Sequelize=require(_0x4eba('0x0'));module[_0x4eba('0x1')]={'version':{'type':Sequelize[_0x4eba('0x2')],'unique':_0x4eba('0x3')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa069=['lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','sendStatus','error','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra'];(function(_0x3e1c79,_0x101dd6){var _0x1bd364=function(_0x1c0870){while(--_0x1c0870){_0x3e1c79['push'](_0x3e1c79['shift']());}};_0x1bd364(++_0x101dd6);}(_0xa069,0x12d));var _0x9a06=function(_0x1e3a7e,_0x22c00f){_0x1e3a7e=_0x1e3a7e-0x0;var _0x54414d=_0xa069[_0x1e3a7e];return _0x54414d;};'use strict';var emlformat=require(_0x9a06('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a06('0x2'));var moment=require(_0x9a06('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a06('0x4'));var path=require(_0x9a06('0x5'));var sox=require(_0x9a06('0x6'));var csv=require(_0x9a06('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a06('0x8'));var _=require(_0x9a06('0x9'));var squel=require(_0x9a06('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a06('0xb'));var deskjs=require(_0x9a06('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9a06('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a06('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a06('0xf'));var logger=require(_0x9a06('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x9a06('0x11'));var licenseUtil=require(_0x9a06('0x12'));var db=require(_0x9a06('0x13'))['db'];function respondWithStatusCode(_0x46f90f,_0x28be66){_0x28be66=_0x28be66||0xcc;return function(_0x890d49){if(_0x890d49){return _0x46f90f['sendStatus'](_0x28be66);}return _0x46f90f[_0x9a06('0x14')](_0x28be66)[_0x9a06('0x15')]();};}function respondWithResult(_0x2538f0,_0x4a9a9d){_0x4a9a9d=_0x4a9a9d||0xc8;return function(_0x50bd1d){if(_0x50bd1d){return _0x2538f0['status'](_0x4a9a9d)[_0x9a06('0x16')](_0x50bd1d);}};}function respondWithFilteredResult(_0xa723d4,_0xed2f56){return function(_0x20ab4b){if(_0x20ab4b){var _0x27860d=typeof _0xed2f56[_0x9a06('0x17')]===_0x9a06('0x18')&&typeof _0xed2f56[_0x9a06('0x19')]===_0x9a06('0x18');var _0x21b169=_0x20ab4b[_0x9a06('0x1a')];var _0xbecd07=_0x27860d?0x0:_0xed2f56[_0x9a06('0x17')];var _0x414217=_0x27860d?_0x20ab4b[_0x9a06('0x1a')]:_0xed2f56[_0x9a06('0x17')]+_0xed2f56[_0x9a06('0x19')];var _0x1753fc;if(_0x414217>=_0x21b169){_0x414217=_0x21b169;_0x1753fc=0xc8;}else{_0x1753fc=0xce;}_0xa723d4[_0x9a06('0x14')](_0x1753fc);return _0xa723d4[_0x9a06('0x1b')]('Content-Range',_0xbecd07+'-'+_0x414217+'/'+_0x21b169)[_0x9a06('0x16')](_0x20ab4b);}return null;};}function patchUpdates(_0x11d79a){return function(_0x50edd0){try{jsonpatch[_0x9a06('0x1c')](_0x50edd0,_0x11d79a,!![]);}catch(_0x4b08ca){return BPromise['reject'](_0x4b08ca);}return _0x50edd0['save']();};}function saveUpdates(_0xf8401a,_0x2ad7c6){return function(_0x5190b0){if(_0x5190b0){return _0x5190b0[_0x9a06('0x1d')](_0xf8401a)[_0x9a06('0x1e')](function(_0x48cc61){return _0x48cc61;});}return null;};}function removeEntity(_0x107d4e,_0x2a987b){return function(_0x2e4ed9){if(_0x2e4ed9){return _0x2e4ed9[_0x9a06('0x1f')]()['then'](function(){_0x107d4e[_0x9a06('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3651,_0xccef54){return function(_0x16f4a6){if(!_0x16f4a6){_0x1f3651[_0x9a06('0x20')](0x194);}return _0x16f4a6;};}function handleError(_0x45676c,_0x5d2288){_0x5d2288=_0x5d2288||0x1f4;return function(_0x60d9f7){logger[_0x9a06('0x21')](_0x60d9f7['stack']);if(_0x60d9f7[_0x9a06('0x22')]){delete _0x60d9f7[_0x9a06('0x22')];}_0x45676c[_0x9a06('0x14')](_0x5d2288)[_0x9a06('0x23')](_0x60d9f7);};}exports[_0x9a06('0x24')]=function(_0x4cb464,_0x2bcd41){var _0x58104b={},_0xd40e77={},_0x2fe0da={'count':0x0,'rows':[]};var _0x30dd53=_[_0x9a06('0x25')](db[_0x9a06('0x26')][_0x9a06('0x27')],function(_0x33a4fe){return{'name':_0x33a4fe[_0x9a06('0x28')],'type':_0x33a4fe[_0x9a06('0x29')]['key']};});_0xd40e77[_0x9a06('0x2a')]=_[_0x9a06('0x25')](_0x30dd53,_0x9a06('0x22'));_0xd40e77[_0x9a06('0x2b')]=_[_0x9a06('0x2c')](_0x4cb464[_0x9a06('0x2b')]);_0xd40e77[_0x9a06('0x2d')]=_[_0x9a06('0x2e')](_0xd40e77[_0x9a06('0x2a')],_0xd40e77[_0x9a06('0x2b')]);_0x58104b['attributes']=_[_0x9a06('0x2e')](_0xd40e77[_0x9a06('0x2a')],qs[_0x9a06('0x2f')](_0x4cb464['query'][_0x9a06('0x2f')]));_0x58104b[_0x9a06('0x30')]=_0x58104b[_0x9a06('0x30')][_0x9a06('0x31')]?_0x58104b['attributes']:_0xd40e77[_0x9a06('0x2a')];if(!_0x4cb464['query'][_0x9a06('0x32')](_0x9a06('0x33'))){_0x58104b[_0x9a06('0x19')]=qs['limit'](_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x19')]);_0x58104b['offset']=qs[_0x9a06('0x17')](_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x17')]);}_0x58104b['order']=qs[_0x9a06('0x34')](_0x4cb464['query'][_0x9a06('0x34')]);_0x58104b[_0x9a06('0x35')]=qs[_0x9a06('0x2d')](_['pick'](_0x4cb464['query'],_0xd40e77[_0x9a06('0x2d')]),_0x30dd53);if(_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x36')]){_0x58104b[_0x9a06('0x35')]=_['merge'](_0x58104b[_0x9a06('0x35')],{'$or':_['map'](_0x30dd53,function(_0x270525){if(_0x270525[_0x9a06('0x29')]!==_0x9a06('0x37')){var _0x29bb37={};_0x29bb37[_0x270525[_0x9a06('0x22')]]={'$like':'%'+_0x4cb464['query'][_0x9a06('0x36')]+'%'};return _0x29bb37;}})});}_0x58104b=_[_0x9a06('0x38')]({},_0x58104b,_0x4cb464[_0x9a06('0x39')]);var _0x21a353={'where':_0x58104b[_0x9a06('0x35')]};return db['Migration']['count'](_0x21a353)[_0x9a06('0x1e')](function(_0x4e7438){_0x2fe0da[_0x9a06('0x1a')]=_0x4e7438;if(_0x4cb464[_0x9a06('0x2b')][_0x9a06('0x3a')]){_0x58104b['include']=[{'all':!![]}];}return db[_0x9a06('0x26')][_0x9a06('0x3b')](_0x58104b);})['then'](function(_0x214929){_0x2fe0da[_0x9a06('0x3c')]=_0x214929;return _0x2fe0da;})[_0x9a06('0x1e')](respondWithFilteredResult(_0x2bcd41,_0x58104b))[_0x9a06('0x3d')](handleError(_0x2bcd41,null));};
\ No newline at end of file
+var _0xbed4=['moment','bluebird','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','request-promise'];(function(_0x6f116f,_0x48c8bd){var _0x120342=function(_0xa8e20a){while(--_0xa8e20a){_0x6f116f['push'](_0x6f116f['shift']());}};_0x120342(++_0x48c8bd);}(_0xbed4,0x142));var _0x4bed=function(_0x5d7eb4,_0x3d7093){_0x5d7eb4=_0x5d7eb4-0x0;var _0x35a2fd=_0xbed4[_0x5d7eb4];return _0x35a2fd;};'use strict';var emlformat=require(_0x4bed('0x0'));var rimraf=require(_0x4bed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4bed('0x2'));var moment=require(_0x4bed('0x3'));var BPromise=require(_0x4bed('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4bed('0x5'));var ejs=require(_0x4bed('0x6'));var fs=require('fs');var fs_extra=require(_0x4bed('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4bed('0x8'));var deskjs=require(_0x4bed('0x9'));var toCsv=require(_0x4bed('0x5'));var querystring=require(_0x4bed('0xa'));var Papa=require(_0x4bed('0xb'));var Redis=require(_0x4bed('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4bed('0xd'));var as=require(_0x4bed('0xe'));var hardwareService=require(_0x4bed('0xf'));var logger=require('../../config/logger')(_0x4bed('0x10'));var utils=require(_0x4bed('0x11'));var config=require(_0x4bed('0x12'));var licenseUtil=require(_0x4bed('0x13'));var db=require(_0x4bed('0x14'))['db'];function respondWithStatusCode(_0x561fca,_0x4e3a97){_0x4e3a97=_0x4e3a97||0xcc;return function(_0x2c14bf){if(_0x2c14bf){return _0x561fca['sendStatus'](_0x4e3a97);}return _0x561fca[_0x4bed('0x15')](_0x4e3a97)[_0x4bed('0x16')]();};}function respondWithResult(_0x2cad04,_0x58e95c){_0x58e95c=_0x58e95c||0xc8;return function(_0x35f5a5){if(_0x35f5a5){return _0x2cad04[_0x4bed('0x15')](_0x58e95c)['json'](_0x35f5a5);}};}function respondWithFilteredResult(_0x22f191,_0x4b05f3){return function(_0x1de6d8){if(_0x1de6d8){var _0x243f03=typeof _0x4b05f3['offset']===_0x4bed('0x17')&&typeof _0x4b05f3[_0x4bed('0x18')]===_0x4bed('0x17');var _0x241283=_0x1de6d8[_0x4bed('0x19')];var _0x36f537=_0x243f03?0x0:_0x4b05f3[_0x4bed('0x1a')];var _0x51a598=_0x243f03?_0x1de6d8[_0x4bed('0x19')]:_0x4b05f3[_0x4bed('0x1a')]+_0x4b05f3[_0x4bed('0x18')];var _0x9cdd4f;if(_0x51a598>=_0x241283){_0x51a598=_0x241283;_0x9cdd4f=0xc8;}else{_0x9cdd4f=0xce;}_0x22f191[_0x4bed('0x15')](_0x9cdd4f);return _0x22f191[_0x4bed('0x1b')](_0x4bed('0x1c'),_0x36f537+'-'+_0x51a598+'/'+_0x241283)[_0x4bed('0x1d')](_0x1de6d8);}return null;};}function patchUpdates(_0xf35d10){return function(_0x17b1e2){try{jsonpatch[_0x4bed('0x1e')](_0x17b1e2,_0xf35d10,!![]);}catch(_0x37ee67){return BPromise[_0x4bed('0x1f')](_0x37ee67);}return _0x17b1e2[_0x4bed('0x20')]();};}function saveUpdates(_0x45f812,_0x4e33b1){return function(_0x3d6575){if(_0x3d6575){return _0x3d6575['update'](_0x45f812)[_0x4bed('0x21')](function(_0x4b2641){return _0x4b2641;});}return null;};}function removeEntity(_0x400918,_0x4618c9){return function(_0x4f0943){if(_0x4f0943){return _0x4f0943[_0x4bed('0x22')]()[_0x4bed('0x21')](function(){_0x400918['status'](0xcc)[_0x4bed('0x16')]();});}};}function handleEntityNotFound(_0x319bce,_0x244753){return function(_0x19c53a){if(!_0x19c53a){_0x319bce[_0x4bed('0x23')](0x194);}return _0x19c53a;};}function handleError(_0x499f46,_0x37c8a8){_0x37c8a8=_0x37c8a8||0x1f4;return function(_0x581fd6){logger[_0x4bed('0x24')](_0x581fd6[_0x4bed('0x25')]);if(_0x581fd6[_0x4bed('0x26')]){delete _0x581fd6[_0x4bed('0x26')];}_0x499f46[_0x4bed('0x15')](_0x37c8a8)[_0x4bed('0x27')](_0x581fd6);};}exports[_0x4bed('0x28')]=function(_0x29568e,_0x3acb53){var _0x2bef7b={},_0x52e021={},_0x920dd2={'count':0x0,'rows':[]};var _0x26f955=_[_0x4bed('0x29')](db['Migration'][_0x4bed('0x2a')],function(_0x2b1003){return{'name':_0x2b1003[_0x4bed('0x2b')],'type':_0x2b1003[_0x4bed('0x2c')][_0x4bed('0x2d')]};});_0x52e021[_0x4bed('0x2e')]=_[_0x4bed('0x29')](_0x26f955,_0x4bed('0x26'));_0x52e021[_0x4bed('0x2f')]=_['keys'](_0x29568e[_0x4bed('0x2f')]);_0x52e021[_0x4bed('0x30')]=_['intersection'](_0x52e021['model'],_0x52e021[_0x4bed('0x2f')]);_0x2bef7b[_0x4bed('0x31')]=_[_0x4bed('0x32')](_0x52e021['model'],qs[_0x4bed('0x33')](_0x29568e[_0x4bed('0x2f')][_0x4bed('0x33')]));_0x2bef7b[_0x4bed('0x31')]=_0x2bef7b['attributes'][_0x4bed('0x34')]?_0x2bef7b['attributes']:_0x52e021[_0x4bed('0x2e')];if(!_0x29568e[_0x4bed('0x2f')][_0x4bed('0x35')]('nolimit')){_0x2bef7b[_0x4bed('0x18')]=qs['limit'](_0x29568e[_0x4bed('0x2f')][_0x4bed('0x18')]);_0x2bef7b['offset']=qs[_0x4bed('0x1a')](_0x29568e[_0x4bed('0x2f')]['offset']);}_0x2bef7b[_0x4bed('0x36')]=qs[_0x4bed('0x37')](_0x29568e[_0x4bed('0x2f')][_0x4bed('0x37')]);_0x2bef7b['where']=qs[_0x4bed('0x30')](_['pick'](_0x29568e[_0x4bed('0x2f')],_0x52e021['filters']),_0x26f955);if(_0x29568e['query']['filter']){_0x2bef7b[_0x4bed('0x38')]=_['merge'](_0x2bef7b[_0x4bed('0x38')],{'$or':_['map'](_0x26f955,function(_0x51d97a){if(_0x51d97a[_0x4bed('0x2c')]!==_0x4bed('0x39')){var _0x477760={};_0x477760[_0x51d97a[_0x4bed('0x26')]]={'$like':'%'+_0x29568e['query']['filter']+'%'};return _0x477760;}})});}_0x2bef7b=_['merge']({},_0x2bef7b,_0x29568e[_0x4bed('0x3a')]);var _0x10087b={'where':_0x2bef7b['where']};return db[_0x4bed('0x3b')]['count'](_0x10087b)[_0x4bed('0x21')](function(_0x1fb63e){_0x920dd2['count']=_0x1fb63e;if(_0x29568e['query'][_0x4bed('0x3c')]){_0x2bef7b[_0x4bed('0x3d')]=[{'all':!![]}];}return db[_0x4bed('0x3b')][_0x4bed('0x3e')](_0x2bef7b);})[_0x4bed('0x21')](function(_0x2c86e4){_0x920dd2[_0x4bed('0x3f')]=_0x2c86e4;return _0x920dd2;})[_0x4bed('0x21')](respondWithFilteredResult(_0x3acb53,_0x2bef7b))[_0x4bed('0x40')](handleError(_0x3acb53,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ce8=['moment','bluebird','../../config/environment','./migration.attributes','Migration','migrations','lodash','util','../../config/logger','api'];(function(_0x3effcc,_0x389120){var _0x260966=function(_0x5dcbf9){while(--_0x5dcbf9){_0x3effcc['push'](_0x3effcc['shift']());}};_0x260966(++_0x389120);}(_0x6ce8,0x146));var _0x86ce=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x6ce8[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x86ce('0x0'));var util=require(_0x86ce('0x1'));var logger=require(_0x86ce('0x2'))(_0x86ce('0x3'));var moment=require(_0x86ce('0x4'));var BPromise=require(_0x86ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x86ce('0x6'));var attributes=require(_0x86ce('0x7'));module['exports']=function(_0x2de79b,_0x550cef){return _0x2de79b['define'](_0x86ce('0x8'),attributes,{'tableName':_0x86ce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce79=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','Migration','migrations','util'];(function(_0x48607b,_0xfd900b){var _0x4fc3ad=function(_0x59a6a3){while(--_0x59a6a3){_0x48607b['push'](_0x48607b['shift']());}};_0x4fc3ad(++_0xfd900b);}(_0xce79,0x1b7));var _0x9ce7=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0xce79[_0x2f32c4];return _0x95b5dc;};'use strict';var _=require('lodash');var util=require(_0x9ce7('0x0'));var logger=require(_0x9ce7('0x1'))('api');var moment=require(_0x9ce7('0x2'));var BPromise=require(_0x9ce7('0x3'));var rp=require(_0x9ce7('0x4'));var fs=require('fs');var path=require(_0x9ce7('0x5'));var rimraf=require('rimraf');var config=require(_0x9ce7('0x6'));var attributes=require('./migration.attributes');module['exports']=function(_0x18642c,_0x9cd24e){return _0x18642c[_0x9ce7('0x7')](_0x9ce7('0x8'),attributes,{'tableName':_0x9ce7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cbd=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x335fa8,_0x1773b6){var _0x2e6259=function(_0x590539){while(--_0x590539){_0x335fa8['push'](_0x335fa8['shift']());}};_0x2e6259(++_0x1773b6);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x2cbd[_0x35181c];return _0xe14bf9;};'use strict';var _=require(_0xd2cb('0x0'));var util=require(_0xd2cb('0x1'));var moment=require('moment');var BPromise=require(_0xd2cb('0x2'));var rs=require(_0xd2cb('0x3'));var fs=require('fs');var Redis=require(_0xd2cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2cb('0x5'));var logger=require(_0xd2cb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd2cb('0x7'));var client=jayson[_0xd2cb('0x8')][_0xd2cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ae725,_0x4c3593,_0x2c1ead){return new BPromise(function(_0x5ef97c,_0x173a87){return client['request'](_0x1ae725,_0x2c1ead)[_0xd2cb('0xa')](function(_0xd591f7){logger['info'](_0xd2cb('0xb'),_0x4c3593,_0xd2cb('0xc'));logger['debug'](_0xd2cb('0xd'),_0x4c3593,_0xd2cb('0xc'),JSON[_0xd2cb('0xe')](_0xd591f7));if(_0xd591f7[_0xd2cb('0xf')]){if(_0xd591f7[_0xd2cb('0xf')]['code']===0x1f4){logger[_0xd2cb('0xf')](_0xd2cb('0xb'),_0x4c3593,_0xd591f7[_0xd2cb('0xf')][_0xd2cb('0x10')]);return _0x173a87(_0xd591f7[_0xd2cb('0xf')]['message']);}logger[_0xd2cb('0xf')](_0xd2cb('0xb'),_0x4c3593,_0xd591f7[_0xd2cb('0xf')]['message']);return _0x5ef97c(_0xd591f7[_0xd2cb('0xf')][_0xd2cb('0x10')]);}else{logger['info'](_0xd2cb('0xb'),_0x4c3593,'request\x20sent');_0x5ef97c(_0xd591f7['result'][_0xd2cb('0x10')]);}})[_0xd2cb('0x11')](function(_0x1a24ac){logger[_0xd2cb('0xf')]('Migration,\x20%s,\x20%s',_0x4c3593,_0x1a24ac);_0x173a87(_0x1a24ac);});});}
\ No newline at end of file
+var _0xb98f=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb98f,0xce));var _0xfb98=function(_0x6dcf63,_0x2254a8){_0x6dcf63=_0x6dcf63-0x0;var _0x157712=_0xb98f[_0x6dcf63];return _0x157712;};'use strict';var _=require(_0xfb98('0x0'));var util=require(_0xfb98('0x1'));var moment=require(_0xfb98('0x2'));var BPromise=require(_0xfb98('0x3'));var rs=require(_0xfb98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfb98('0x5'))(_0xfb98('0x6'));var config=require(_0xfb98('0x7'));var jayson=require(_0xfb98('0x8'));var client=jayson['client'][_0xfb98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6af9,_0x5683e3,_0x27b394){return new BPromise(function(_0x4d06fc,_0x5b7b33){return client['request'](_0x4a6af9,_0x27b394)['then'](function(_0x4c5e32){logger[_0xfb98('0xa')](_0xfb98('0xb'),_0x5683e3,'request\x20sent');logger['debug'](_0xfb98('0xc'),_0x5683e3,'request\x20sent',JSON[_0xfb98('0xd')](_0x4c5e32));if(_0x4c5e32[_0xfb98('0xe')]){if(_0x4c5e32[_0xfb98('0xe')][_0xfb98('0xf')]===0x1f4){logger[_0xfb98('0xe')](_0xfb98('0xb'),_0x5683e3,_0x4c5e32[_0xfb98('0xe')][_0xfb98('0x10')]);return _0x5b7b33(_0x4c5e32[_0xfb98('0xe')][_0xfb98('0x10')]);}logger[_0xfb98('0xe')](_0xfb98('0xb'),_0x5683e3,_0x4c5e32[_0xfb98('0xe')][_0xfb98('0x10')]);return _0x4d06fc(_0x4c5e32['error'][_0xfb98('0x10')]);}else{logger['info'](_0xfb98('0xb'),_0x5683e3,_0xfb98('0x11'));_0x4d06fc(_0x4c5e32[_0xfb98('0x12')][_0xfb98('0x10')]);}})[_0xfb98('0x13')](function(_0x4c030a){logger[_0xfb98('0xe')](_0xfb98('0xb'),_0x5683e3,_0x4c030a);_0x5b7b33(_0x4c030a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb8d=['delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','create','update'];(function(_0x1520e0,_0xe74d2b){var _0x1d217d=function(_0xbdaf47){while(--_0xbdaf47){_0x1520e0['push'](_0x1520e0['shift']());}};_0x1d217d(++_0xe74d2b);}(_0xbb8d,0x146));var _0xdbb8=function(_0x26f908,_0x26cbc7){_0x26f908=_0x26f908-0x0;var _0xbbc2d3=_0xbb8d[_0x26f908];return _0xbbc2d3;};'use strict';var multer=require(_0xdbb8('0x0'));var util=require('util');var path=require(_0xdbb8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbb8('0x2'));var auth=require(_0xdbb8('0x3'));var interaction=require(_0xdbb8('0x4'));var config=require(_0xdbb8('0x5'));var controller=require(_0xdbb8('0x6'));router['get']('/',auth[_0xdbb8('0x7')](),controller[_0xdbb8('0x8')]);router[_0xdbb8('0x9')](_0xdbb8('0xa'),auth['isAuthenticated'](),controller[_0xdbb8('0xb')]);router['post']('/',auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xc')]);router['put'](_0xdbb8('0xa'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xd')]);router[_0xdbb8('0xe')](_0xdbb8('0xa'),auth[_0xdbb8('0x7')](),controller[_0xdbb8('0xf')]);module[_0xdbb8('0x10')]=router;
\ No newline at end of file
+var _0xe353=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','show','isAuthenticated','create','put','update','delete','exports'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0xe353,0xdc));var _0x3e35=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe353[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x3e35('0x0'));var path=require(_0x3e35('0x1'));var timeout=require(_0x3e35('0x2'));var express=require(_0x3e35('0x3'));var router=express[_0x3e35('0x4')]();var fs_extra=require(_0x3e35('0x5'));var auth=require(_0x3e35('0x6'));var interaction=require(_0x3e35('0x7'));var config=require(_0x3e35('0x8'));var controller=require(_0x3e35('0x9'));router[_0x3e35('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e35('0xb')]);router[_0x3e35('0xa')](_0x3e35('0xc'),auth['isAuthenticated'](),controller[_0x3e35('0xd')]);router['post']('/',auth[_0x3e35('0xe')](),controller[_0x3e35('0xf')]);router[_0x3e35('0x10')](_0x3e35('0xc'),auth[_0x3e35('0xe')](),controller[_0x3e35('0x11')]);router[_0x3e35('0x12')](_0x3e35('0xc'),auth[_0x3e35('0xe')](),controller['destroy']);module[_0x3e35('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ab6=['localnet','externip','stun','STRING','sequelize'];(function(_0x5a4023,_0x23c755){var _0x3c3165=function(_0x31dc78){while(--_0x31dc78){_0x5a4023['push'](_0x5a4023['shift']());}};_0x3c3165(++_0x23c755);}(_0x4ab6,0x1cb));var _0x64ab=function(_0x485c9f,_0x399a20){_0x485c9f=_0x485c9f-0x0;var _0x2ba76e=_0x4ab6[_0x485c9f];return _0x2ba76e;};'use strict';var Sequelize=require(_0x64ab('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x64ab('0x1'),_0x64ab('0x2'),_0x64ab('0x3'),'turn')},'value':{'type':Sequelize[_0x64ab('0x4')]},'username':{'type':Sequelize[_0x64ab('0x4')]},'password':{'type':Sequelize[_0x64ab('0x4')]}};
\ No newline at end of file
+var _0x54ed=['sequelize','ENUM','localnet','stun','STRING'];(function(_0x2f5bdd,_0x2475bf){var _0x24c9f9=function(_0x37f15e){while(--_0x37f15e){_0x2f5bdd['push'](_0x2f5bdd['shift']());}};_0x24c9f9(++_0x2475bf);}(_0x54ed,0x109));var _0xd54e=function(_0x23ac30,_0x2a1d00){_0x23ac30=_0x23ac30-0x0;var _0x208fec=_0x54ed[_0x23ac30];return _0x208fec;};'use strict';var Sequelize=require(_0xd54e('0x0'));module['exports']={'type':{'type':Sequelize[_0xd54e('0x1')](_0xd54e('0x2'),'externip',_0xd54e('0x3'),'turn')},'value':{'type':Sequelize[_0xd54e('0x4')]},'username':{'type':Sequelize[_0xd54e('0x4')]},'password':{'type':Sequelize[_0xd54e('0x4')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x922a=['type','key','model','query','keys','attributes','fields','length','order','sort','where','filters','pick','filter','merge','Network','includeAll','include','findAll','rows','show','params','intersection','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x922a,0x1cd));var _0xa922=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x922a[_0x15bc81];return _0x59440e;};'use strict';var util=require('util');var path=require(_0xa922('0x0'));var ejs=require(_0xa922('0x1'));var fs=require('fs');var _=require(_0xa922('0x2'));var qs=require(_0xa922('0x3'));var logger=require(_0xa922('0x4'))('api');var config=require(_0xa922('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa922('0x6'));var client=jayson[_0xa922('0x7')][_0xa922('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x157c31,_0x28ce60,_0x1969ba,_0x11613a){return new Promise(function(_0x4abf76,_0x703d0d){var _0x793b3d=_0x11613a||client;return _0x793b3d['request'](_0x157c31,_0x1969ba)[_0xa922('0x9')](function(_0x1a3ae5){logger[_0xa922('0xa')](_0xa922('0xb'),_0x28ce60,_0xa922('0xc'));logger[_0xa922('0xd')](_0xa922('0xe'),_0x28ce60,_0xa922('0xc'),JSON['stringify'](_0x1a3ae5));if(_0x1a3ae5[_0xa922('0xf')]){if(_0x1a3ae5['error']['code']===0x1f4){logger[_0xa922('0xf')](_0xa922('0xb'),_0x28ce60,_0x1a3ae5[_0xa922('0xf')][_0xa922('0x10')]);return _0x703d0d(_0x1a3ae5[_0xa922('0xf')][_0xa922('0x10')]);}logger['error']('Network,\x20%s,\x20%s',_0x28ce60,_0x1a3ae5[_0xa922('0xf')]['message']);return _0x4abf76(_0x1a3ae5[_0xa922('0xf')][_0xa922('0x10')]);}else{logger[_0xa922('0xa')](_0xa922('0xb'),_0x28ce60,_0xa922('0xc'));_0x4abf76(_0x1a3ae5[_0xa922('0x11')][_0xa922('0x10')]);}})[_0xa922('0x12')](function(_0x7cfa2d){logger['error'](_0xa922('0xb'),_0x28ce60,_0x7cfa2d);_0x703d0d(_0x7cfa2d);});});}function respondWithResult(_0x427b9d,_0xd02630){_0xd02630=_0xd02630||0xc8;return function(_0x450138){if(_0x450138){return _0x427b9d['status'](_0xd02630)[_0xa922('0x13')](_0x450138);}};}function respondWithFilteredResult(_0x2223a5,_0x1273ae){return function(_0x33d0b3){if(_0x33d0b3){var _0x53ae16=typeof _0x1273ae[_0xa922('0x14')]===_0xa922('0x15')&&typeof _0x1273ae[_0xa922('0x16')]===_0xa922('0x15');var _0x5a2195=_0x33d0b3['count'];var _0x556c06=_0x53ae16?0x0:_0x1273ae[_0xa922('0x14')];var _0x191007=_0x53ae16?_0x33d0b3[_0xa922('0x17')]:_0x1273ae[_0xa922('0x14')]+_0x1273ae[_0xa922('0x16')];var _0xfb6444;if(_0x191007>=_0x5a2195){_0x191007=_0x5a2195;_0xfb6444=0xc8;}else{_0xfb6444=0xce;}_0x2223a5[_0xa922('0x18')](_0xfb6444);return _0x2223a5[_0xa922('0x19')](_0xa922('0x1a'),_0x556c06+'-'+_0x191007+'/'+_0x5a2195)[_0xa922('0x13')](_0x33d0b3);}return null;};}function saveUpdates(_0x2b7039){return function(_0x34e037){if(_0x34e037){return _0x34e037[_0xa922('0x1b')](_0x2b7039)[_0xa922('0x9')](function(_0x5c2cf5){return _0x5c2cf5;});}return null;};}function removeEntity(_0x5ecaf2){return function(_0x1c673d){if(_0x1c673d){return _0x1c673d[_0xa922('0x1c')]()[_0xa922('0x9')](function(){_0x5ecaf2[_0xa922('0x18')](0xcc)[_0xa922('0x1d')]();});}};}function handleEntityNotFound(_0x50ef32){return function(_0x3b7ae8){if(!_0x3b7ae8){_0x50ef32[_0xa922('0x1e')](0x194);}return _0x3b7ae8;};}function handleError(_0x45eaa9,_0x4fb86e){_0x4fb86e=_0x4fb86e||0x1f4;return function(_0x217b7d){logger['error'](_0x217b7d['stack']);if(_0x217b7d[_0xa922('0x1f')]){delete _0x217b7d[_0xa922('0x1f')];}_0x45eaa9[_0xa922('0x18')](_0x4fb86e)[_0xa922('0x20')](_0x217b7d);};}exports[_0xa922('0x21')]=function(_0x4e6483,_0x1dafbd){var _0x3e6555={},_0x2381a9={},_0x32ff41={'count':0x0,'rows':[]};var _0x5e6da7=_[_0xa922('0x22')](db['Network'][_0xa922('0x23')],function(_0x97cdfb){return{'name':_0x97cdfb[_0xa922('0x24')],'type':_0x97cdfb[_0xa922('0x25')][_0xa922('0x26')]};});_0x2381a9[_0xa922('0x27')]=_[_0xa922('0x22')](_0x5e6da7,_0xa922('0x1f'));_0x2381a9[_0xa922('0x28')]=_[_0xa922('0x29')](_0x4e6483[_0xa922('0x28')]);_0x2381a9['filters']=_['intersection'](_0x2381a9['model'],_0x2381a9[_0xa922('0x28')]);_0x3e6555[_0xa922('0x2a')]=_['intersection'](_0x2381a9[_0xa922('0x27')],qs[_0xa922('0x2b')](_0x4e6483['query']['fields']));_0x3e6555[_0xa922('0x2a')]=_0x3e6555['attributes'][_0xa922('0x2c')]?_0x3e6555['attributes']:_0x2381a9[_0xa922('0x27')];if(!_0x4e6483[_0xa922('0x28')]['hasOwnProperty']('nolimit')){_0x3e6555[_0xa922('0x16')]=qs['limit'](_0x4e6483[_0xa922('0x28')][_0xa922('0x16')]);_0x3e6555['offset']=qs[_0xa922('0x14')](_0x4e6483[_0xa922('0x28')][_0xa922('0x14')]);}_0x3e6555[_0xa922('0x2d')]=qs[_0xa922('0x2e')](_0x4e6483['query']['sort']);_0x3e6555[_0xa922('0x2f')]=qs[_0xa922('0x30')](_[_0xa922('0x31')](_0x4e6483[_0xa922('0x28')],_0x2381a9[_0xa922('0x30')]),_0x5e6da7);if(_0x4e6483['query'][_0xa922('0x32')]){_0x3e6555[_0xa922('0x2f')]=_[_0xa922('0x33')](_0x3e6555[_0xa922('0x2f')],{'$or':_[_0xa922('0x22')](_0x5e6da7,function(_0x4e9286){if(_0x4e9286[_0xa922('0x25')]!=='VIRTUAL'){var _0xd43e85={};_0xd43e85[_0x4e9286[_0xa922('0x1f')]]={'$like':'%'+_0x4e6483['query'][_0xa922('0x32')]+'%'};return _0xd43e85;}})});}_0x3e6555=_['merge']({},_0x3e6555,_0x4e6483['options']);var _0x4b4903={'where':_0x3e6555[_0xa922('0x2f')]};return db[_0xa922('0x34')][_0xa922('0x17')](_0x4b4903)[_0xa922('0x9')](function(_0xb38db1){_0x32ff41[_0xa922('0x17')]=_0xb38db1;if(_0x4e6483[_0xa922('0x28')][_0xa922('0x35')]){_0x3e6555[_0xa922('0x36')]=[{'all':!![]}];}return db['Network'][_0xa922('0x37')](_0x3e6555);})[_0xa922('0x9')](function(_0x56964c){_0x32ff41[_0xa922('0x38')]=_0x56964c;return _0x32ff41;})[_0xa922('0x9')](respondWithFilteredResult(_0x1dafbd,_0x3e6555))[_0xa922('0x12')](handleError(_0x1dafbd,null));};exports[_0xa922('0x39')]=function(_0xdeecc4,_0x4d89fb){var _0x1f32a9={'raw':!![],'where':{'id':_0xdeecc4[_0xa922('0x3a')]['id']}},_0x1b61d5={};_0x1b61d5[_0xa922('0x27')]=_['keys'](db[_0xa922('0x34')][_0xa922('0x23')]);_0x1b61d5[_0xa922('0x28')]=_[_0xa922('0x29')](_0xdeecc4[_0xa922('0x28')]);_0x1b61d5[_0xa922('0x30')]=_[_0xa922('0x3b')](_0x1b61d5[_0xa922('0x27')],_0x1b61d5['query']);_0x1f32a9[_0xa922('0x2a')]=_['intersection'](_0x1b61d5[_0xa922('0x27')],qs[_0xa922('0x2b')](_0xdeecc4[_0xa922('0x28')]['fields']));_0x1f32a9['attributes']=_0x1f32a9[_0xa922('0x2a')][_0xa922('0x2c')]?_0x1f32a9[_0xa922('0x2a')]:_0x1b61d5[_0xa922('0x27')];if(_0xdeecc4[_0xa922('0x28')][_0xa922('0x35')]){_0x1f32a9[_0xa922('0x36')]=[{'all':!![]}];}_0x1f32a9=_[_0xa922('0x33')]({},_0x1f32a9,_0xdeecc4[_0xa922('0x3c')]);return db[_0xa922('0x34')][_0xa922('0x3d')](_0x1f32a9)['then'](handleEntityNotFound(_0x4d89fb,null))['then'](respondWithResult(_0x4d89fb,null))[_0xa922('0x12')](handleError(_0x4d89fb,null));};exports['create']=function(_0x1410b3,_0xaf6c85){var _0x55f37a;return db[_0xa922('0x34')][_0xa922('0x3e')](_0x1410b3[_0xa922('0x3f')],{'raw':!![]})['then'](function(_0x2015cd){_0x55f37a=_0x2015cd;return db['Network'][_0xa922('0x37')]({'where':{'type':_0x1410b3[_0xa922('0x3f')]['type']},'raw':!![]});})[_0xa922('0x9')](function(_0x3c5d59){if(_0x55f37a[_0xa922('0x25')][_0xa922('0x40')]()==_0xa922('0x41')){var _0x5389c1=fs[_0xa922('0x42')](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x45')),_0xa922('0x46'));var _0x5c9eaa=ejs[_0xa922('0x47')](_0x5389c1,{'networks':_0x3c5d59||[]});fs[_0xa922('0x48')](_0xa922('0x49'),_0x5c9eaa);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x3e'),{'module':_0xa922('0x4b')});}else if(_0x55f37a[_0xa922('0x25')][_0xa922('0x40')]()==_0xa922('0x4c')){var _0x30514c=fs[_0xa922('0x42')](path['join'](config[_0xa922('0x44')],_0xa922('0x4d')),_0xa922('0x46'));var _0x1ffe66=ejs[_0xa922('0x47')](_0x30514c,{'networks':_0x3c5d59||[]});fs[_0xa922('0x48')](_0xa922('0x4e'),_0x1ffe66);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x3e'),{'module':_0xa922('0x4b')});}else{var _0x305d71=fs[_0xa922('0x42')](path[_0xa922('0x43')](config['root'],_0xa922('0x4f')),_0xa922('0x46'));var _0x4dccc1=ejs[_0xa922('0x47')](_0x305d71,{'networks':_0x3c5d59||[]});fs[_0xa922('0x48')](util[_0xa922('0x50')](_0xa922('0x51'),_0x1410b3[_0xa922('0x3f')]['type']['toLowerCase']()),_0x4dccc1);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x3e'),{'module':_0xa922('0x52')});}})['then'](function(){return _0x55f37a;})[_0xa922('0x9')](respondWithResult(_0xaf6c85,0xc9))[_0xa922('0x12')](handleError(_0xaf6c85,null));};exports['update']=function(_0x498356,_0x195511){var _0x637acf;return db[_0xa922('0x34')]['find']({'where':{'id':_0x498356[_0xa922('0x3a')]['id']}})[_0xa922('0x9')](handleEntityNotFound(_0x195511,null))[_0xa922('0x9')](saveUpdates(_0x498356['body'],null))[_0xa922('0x9')](function(_0x51a2f4){if(_0x51a2f4){_0x637acf=_0x51a2f4;return db[_0xa922('0x34')][_0xa922('0x37')]({'where':{'type':_0x637acf[_0xa922('0x25')]},'raw':!![]});}return null;})[_0xa922('0x9')](function(_0x5050f5){if(_0x637acf[_0xa922('0x25')]['toUpperCase']()==_0xa922('0x41')){var _0x3653dd=fs['readFileSync'](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x45')),_0xa922('0x46'));var _0x59aa3c=ejs[_0xa922('0x47')](_0x3653dd,{'networks':_0x5050f5||[]});fs['writeFileSync'](_0xa922('0x49'),_0x59aa3c);return respondWithRpcPromise(_0xa922('0x4a'),'update',{'module':_0xa922('0x4b')});}else if(_0x637acf[_0xa922('0x25')][_0xa922('0x40')]()=='TURN'){var _0x46532a=fs[_0xa922('0x42')](path[_0xa922('0x43')](config['root'],_0xa922('0x4d')),_0xa922('0x46'));var _0xfe1eef=ejs['render'](_0x46532a,{'networks':_0x5050f5||[]});fs[_0xa922('0x48')](_0xa922('0x4e'),_0xfe1eef);return respondWithRpcPromise('Reload',_0xa922('0x1b'),{'module':'res_stun_monitor.so'});}else{var _0xee168b=fs[_0xa922('0x42')](path[_0xa922('0x43')](config['root'],'server/files/templates/network.ejs'),_0xa922('0x46'));var _0x3a682c=ejs[_0xa922('0x47')](_0xee168b,{'networks':_0x5050f5||[]});fs[_0xa922('0x48')](util[_0xa922('0x50')](_0xa922('0x51'),_0x498356[_0xa922('0x3f')][_0xa922('0x25')]['toLowerCase']()),_0x3a682c);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1b'),{'module':_0xa922('0x52')});}})[_0xa922('0x9')](function(_0xd8d73a){if(_0xd8d73a){return _0x637acf;}return null;})[_0xa922('0x9')](respondWithResult(_0x195511,null))[_0xa922('0x12')](handleError(_0x195511,null));};exports[_0xa922('0x1c')]=function(_0x285a14,_0x38495b){var _0x2c24cd;return db[_0xa922('0x34')][_0xa922('0x3d')]({'where':{'id':_0x285a14[_0xa922('0x3a')]['id']}})['then'](function(_0x4cd4da){_0x2c24cd=_0x4cd4da;return _0x4cd4da;})['then'](handleEntityNotFound(_0x38495b,null))['then'](removeEntity(_0x38495b,null))[_0xa922('0x9')](function(){if(_0x2c24cd){return db['Network'][_0xa922('0x37')]({'where':{'type':_0x2c24cd[_0xa922('0x25')]},'raw':!![]});}})[_0xa922('0x9')](function(_0x3eb6e1){if(_0x2c24cd['type'][_0xa922('0x40')]()==_0xa922('0x41')){var _0x308441=fs[_0xa922('0x42')](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x45')),_0xa922('0x46'));var _0x2f360a=ejs[_0xa922('0x47')](_0x308441,{'networks':_0x3eb6e1||[]});fs[_0xa922('0x48')](_0xa922('0x49'),_0x2f360a);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1c'),{'module':_0xa922('0x4b')});}else if(_0x2c24cd[_0xa922('0x25')][_0xa922('0x40')]()==_0xa922('0x4c')){var _0x143f0c=fs[_0xa922('0x42')](path['join'](config[_0xa922('0x44')],_0xa922('0x4d')),_0xa922('0x46'));var _0x297352=ejs['render'](_0x143f0c,{'networks':_0x3eb6e1||[]});fs[_0xa922('0x48')](_0xa922('0x4e'),_0x297352);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x1a0c99=fs['readFileSync'](path[_0xa922('0x43')](config[_0xa922('0x44')],_0xa922('0x4f')),'utf8');var _0x13333f=ejs['render'](_0x1a0c99,{'networks':_0x3eb6e1||[]});fs['writeFileSync'](util[_0xa922('0x50')](_0xa922('0x51'),_0x2c24cd[_0xa922('0x25')]['toLowerCase']()),_0x13333f);return respondWithRpcPromise(_0xa922('0x4a'),_0xa922('0x1c'),{'module':_0xa922('0x52')});}})[_0xa922('0x12')](handleError(_0x38495b,null));};
\ No newline at end of file
+var _0xb704=['server/files/templates/network.ejs','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','update','body','format','toLowerCase','chan_sip.so','ejs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','limit','count','offset','set','Content-Range','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','key','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','join'];(function(_0x2fb27d,_0x4872fa){var _0x3e98b7=function(_0x14e903){while(--_0x14e903){_0x2fb27d['push'](_0x2fb27d['shift']());}};_0x3e98b7(++_0x4872fa);}(_0xb704,0x1a7));var _0x4b70=function(_0x508d7c,_0x13374f){_0x508d7c=_0x508d7c-0x0;var _0x5f35bf=_0xb704[_0x508d7c];return _0x5f35bf;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x4b70('0x0'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x4b70('0x1'))(_0x4b70('0x2'));var config=require(_0x4b70('0x3'));var db=require(_0x4b70('0x4'))['db'];var jayson=require(_0x4b70('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdc7d9d,_0x44449d,_0xbe057d,_0x1d518d){return new Promise(function(_0x404e98,_0x2f4405){var _0x591f4e=_0x1d518d||client;return _0x591f4e['request'](_0xdc7d9d,_0xbe057d)[_0x4b70('0x6')](function(_0xb84351){logger[_0x4b70('0x7')](_0x4b70('0x8'),_0x44449d,_0x4b70('0x9'));logger[_0x4b70('0xa')](_0x4b70('0xb'),_0x44449d,_0x4b70('0x9'),JSON[_0x4b70('0xc')](_0xb84351));if(_0xb84351[_0x4b70('0xd')]){if(_0xb84351[_0x4b70('0xd')]['code']===0x1f4){logger[_0x4b70('0xd')](_0x4b70('0x8'),_0x44449d,_0xb84351[_0x4b70('0xd')][_0x4b70('0xe')]);return _0x2f4405(_0xb84351['error'][_0x4b70('0xe')]);}logger[_0x4b70('0xd')]('Network,\x20%s,\x20%s',_0x44449d,_0xb84351[_0x4b70('0xd')][_0x4b70('0xe')]);return _0x404e98(_0xb84351['error'][_0x4b70('0xe')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x44449d,_0x4b70('0x9'));_0x404e98(_0xb84351['result'][_0x4b70('0xe')]);}})[_0x4b70('0xf')](function(_0x2127fc){logger[_0x4b70('0xd')](_0x4b70('0x8'),_0x44449d,_0x2127fc);_0x2f4405(_0x2127fc);});});}function respondWithResult(_0x4cbffb,_0x517d46){_0x517d46=_0x517d46||0xc8;return function(_0x3cfedf){if(_0x3cfedf){return _0x4cbffb[_0x4b70('0x10')](_0x517d46)[_0x4b70('0x11')](_0x3cfedf);}};}function respondWithFilteredResult(_0x18bdaf,_0x47f67a){return function(_0xbdab17){if(_0xbdab17){var _0x1c4bea=typeof _0x47f67a['offset']==='undefined'&&typeof _0x47f67a[_0x4b70('0x12')]==='undefined';var _0xf9a184=_0xbdab17['count'];var _0x50ec00=_0x1c4bea?0x0:_0x47f67a['offset'];var _0x3f80ac=_0x1c4bea?_0xbdab17[_0x4b70('0x13')]:_0x47f67a[_0x4b70('0x14')]+_0x47f67a[_0x4b70('0x12')];var _0x3e1019;if(_0x3f80ac>=_0xf9a184){_0x3f80ac=_0xf9a184;_0x3e1019=0xc8;}else{_0x3e1019=0xce;}_0x18bdaf[_0x4b70('0x10')](_0x3e1019);return _0x18bdaf[_0x4b70('0x15')](_0x4b70('0x16'),_0x50ec00+'-'+_0x3f80ac+'/'+_0xf9a184)[_0x4b70('0x11')](_0xbdab17);}return null;};}function saveUpdates(_0x47bbc9){return function(_0x3337ac){if(_0x3337ac){return _0x3337ac['update'](_0x47bbc9)['then'](function(_0x3764cd){return _0x3764cd;});}return null;};}function removeEntity(_0x309873){return function(_0x493342){if(_0x493342){return _0x493342[_0x4b70('0x17')]()[_0x4b70('0x6')](function(){_0x309873[_0x4b70('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6e1a){return function(_0x2a9243){if(!_0x2a9243){_0x4f6e1a[_0x4b70('0x18')](0x194);}return _0x2a9243;};}function handleError(_0x55a692,_0x5eecce){_0x5eecce=_0x5eecce||0x1f4;return function(_0x89989b){logger['error'](_0x89989b[_0x4b70('0x19')]);if(_0x89989b[_0x4b70('0x1a')]){delete _0x89989b[_0x4b70('0x1a')];}_0x55a692['status'](_0x5eecce)[_0x4b70('0x1b')](_0x89989b);};}exports[_0x4b70('0x1c')]=function(_0x25de5a,_0x1129ee){var _0x34d532={},_0x3603b9={},_0x19a433={'count':0x0,'rows':[]};var _0x14750f=_[_0x4b70('0x1d')](db[_0x4b70('0x1e')][_0x4b70('0x1f')],function(_0x595df6){return{'name':_0x595df6[_0x4b70('0x20')],'type':_0x595df6['type'][_0x4b70('0x21')]};});_0x3603b9['model']=_[_0x4b70('0x1d')](_0x14750f,_0x4b70('0x1a'));_0x3603b9[_0x4b70('0x22')]=_['keys'](_0x25de5a['query']);_0x3603b9[_0x4b70('0x23')]=_[_0x4b70('0x24')](_0x3603b9['model'],_0x3603b9[_0x4b70('0x22')]);_0x34d532['attributes']=_[_0x4b70('0x24')](_0x3603b9['model'],qs[_0x4b70('0x25')](_0x25de5a['query'][_0x4b70('0x25')]));_0x34d532[_0x4b70('0x26')]=_0x34d532['attributes'][_0x4b70('0x27')]?_0x34d532[_0x4b70('0x26')]:_0x3603b9[_0x4b70('0x28')];if(!_0x25de5a['query'][_0x4b70('0x29')](_0x4b70('0x2a'))){_0x34d532[_0x4b70('0x12')]=qs['limit'](_0x25de5a[_0x4b70('0x22')][_0x4b70('0x12')]);_0x34d532[_0x4b70('0x14')]=qs[_0x4b70('0x14')](_0x25de5a['query'][_0x4b70('0x14')]);}_0x34d532[_0x4b70('0x2b')]=qs['sort'](_0x25de5a['query'][_0x4b70('0x2c')]);_0x34d532[_0x4b70('0x2d')]=qs[_0x4b70('0x23')](_[_0x4b70('0x2e')](_0x25de5a[_0x4b70('0x22')],_0x3603b9['filters']),_0x14750f);if(_0x25de5a[_0x4b70('0x22')][_0x4b70('0x2f')]){_0x34d532[_0x4b70('0x2d')]=_[_0x4b70('0x30')](_0x34d532[_0x4b70('0x2d')],{'$or':_[_0x4b70('0x1d')](_0x14750f,function(_0x541d40){if(_0x541d40[_0x4b70('0x31')]!==_0x4b70('0x32')){var _0x38074a={};_0x38074a[_0x541d40['name']]={'$like':'%'+_0x25de5a['query'][_0x4b70('0x2f')]+'%'};return _0x38074a;}})});}_0x34d532=_[_0x4b70('0x30')]({},_0x34d532,_0x25de5a[_0x4b70('0x33')]);var _0x4602b7={'where':_0x34d532[_0x4b70('0x2d')]};return db[_0x4b70('0x1e')]['count'](_0x4602b7)[_0x4b70('0x6')](function(_0x345799){_0x19a433['count']=_0x345799;if(_0x25de5a[_0x4b70('0x22')][_0x4b70('0x34')]){_0x34d532[_0x4b70('0x35')]=[{'all':!![]}];}return db[_0x4b70('0x1e')][_0x4b70('0x36')](_0x34d532);})[_0x4b70('0x6')](function(_0x19d3fd){_0x19a433[_0x4b70('0x37')]=_0x19d3fd;return _0x19a433;})['then'](respondWithFilteredResult(_0x1129ee,_0x34d532))[_0x4b70('0xf')](handleError(_0x1129ee,null));};exports[_0x4b70('0x38')]=function(_0x3388c2,_0x13761f){var _0x5b76c6={'raw':!![],'where':{'id':_0x3388c2[_0x4b70('0x39')]['id']}},_0x47f829={};_0x47f829[_0x4b70('0x28')]=_[_0x4b70('0x3a')](db[_0x4b70('0x1e')][_0x4b70('0x1f')]);_0x47f829['query']=_[_0x4b70('0x3a')](_0x3388c2[_0x4b70('0x22')]);_0x47f829[_0x4b70('0x23')]=_[_0x4b70('0x24')](_0x47f829['model'],_0x47f829['query']);_0x5b76c6[_0x4b70('0x26')]=_[_0x4b70('0x24')](_0x47f829[_0x4b70('0x28')],qs[_0x4b70('0x25')](_0x3388c2['query'][_0x4b70('0x25')]));_0x5b76c6[_0x4b70('0x26')]=_0x5b76c6[_0x4b70('0x26')]['length']?_0x5b76c6['attributes']:_0x47f829[_0x4b70('0x28')];if(_0x3388c2[_0x4b70('0x22')][_0x4b70('0x34')]){_0x5b76c6[_0x4b70('0x35')]=[{'all':!![]}];}_0x5b76c6=_[_0x4b70('0x30')]({},_0x5b76c6,_0x3388c2['options']);return db[_0x4b70('0x1e')][_0x4b70('0x3b')](_0x5b76c6)[_0x4b70('0x6')](handleEntityNotFound(_0x13761f,null))[_0x4b70('0x6')](respondWithResult(_0x13761f,null))[_0x4b70('0xf')](handleError(_0x13761f,null));};exports[_0x4b70('0x3c')]=function(_0x2e6c27,_0x5dce6f){var _0x529b24;return db[_0x4b70('0x1e')][_0x4b70('0x3c')](_0x2e6c27['body'],{'raw':!![]})[_0x4b70('0x6')](function(_0x39025d){_0x529b24=_0x39025d;return db['Network'][_0x4b70('0x36')]({'where':{'type':_0x2e6c27['body'][_0x4b70('0x31')]},'raw':!![]});})[_0x4b70('0x6')](function(_0x63cedc){if(_0x529b24[_0x4b70('0x31')]['toUpperCase']()==_0x4b70('0x3d')){var _0x29e73f=fs[_0x4b70('0x3e')](path['join'](config[_0x4b70('0x3f')],_0x4b70('0x40')),_0x4b70('0x41'));var _0x15c68d=ejs[_0x4b70('0x42')](_0x29e73f,{'networks':_0x63cedc||[]});fs['writeFileSync'](_0x4b70('0x43'),_0x15c68d);return respondWithRpcPromise(_0x4b70('0x44'),'create',{'module':'res_stun_monitor.so'});}else if(_0x529b24['type'][_0x4b70('0x45')]()==_0x4b70('0x46')){var _0x23b8ce=fs[_0x4b70('0x3e')](path['join'](config['root'],_0x4b70('0x47')),_0x4b70('0x41'));var _0x456f2c=ejs[_0x4b70('0x42')](_0x23b8ce,{'networks':_0x63cedc||[]});fs['writeFileSync'](_0x4b70('0x48'),_0x456f2c);return respondWithRpcPromise(_0x4b70('0x44'),'create',{'module':_0x4b70('0x49')});}else{var _0x51fc84=fs[_0x4b70('0x3e')](path[_0x4b70('0x4a')](config[_0x4b70('0x3f')],_0x4b70('0x4b')),_0x4b70('0x41'));var _0x4f4211=ejs[_0x4b70('0x42')](_0x51fc84,{'networks':_0x63cedc||[]});fs[_0x4b70('0x4c')](util['format'](_0x4b70('0x4d'),_0x2e6c27['body'][_0x4b70('0x31')]['toLowerCase']()),_0x4f4211);return respondWithRpcPromise(_0x4b70('0x44'),'create',{'module':'chan_sip.so'});}})[_0x4b70('0x6')](function(){return _0x529b24;})[_0x4b70('0x6')](respondWithResult(_0x5dce6f,0xc9))[_0x4b70('0xf')](handleError(_0x5dce6f,null));};exports[_0x4b70('0x4e')]=function(_0x559498,_0x5a8c9f){var _0x4a53ad;return db[_0x4b70('0x1e')][_0x4b70('0x3b')]({'where':{'id':_0x559498[_0x4b70('0x39')]['id']}})[_0x4b70('0x6')](handleEntityNotFound(_0x5a8c9f,null))[_0x4b70('0x6')](saveUpdates(_0x559498[_0x4b70('0x4f')],null))['then'](function(_0x2db524){if(_0x2db524){_0x4a53ad=_0x2db524;return db[_0x4b70('0x1e')][_0x4b70('0x36')]({'where':{'type':_0x4a53ad[_0x4b70('0x31')]},'raw':!![]});}return null;})[_0x4b70('0x6')](function(_0x8fb544){if(_0x4a53ad[_0x4b70('0x31')][_0x4b70('0x45')]()==_0x4b70('0x3d')){var _0x6bdead=fs['readFileSync'](path[_0x4b70('0x4a')](config['root'],_0x4b70('0x40')),_0x4b70('0x41'));var _0x2f5465=ejs['render'](_0x6bdead,{'networks':_0x8fb544||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2f5465);return respondWithRpcPromise(_0x4b70('0x44'),'update',{'module':_0x4b70('0x49')});}else if(_0x4a53ad[_0x4b70('0x31')][_0x4b70('0x45')]()=='TURN'){var _0x1ba1fd=fs[_0x4b70('0x3e')](path['join'](config[_0x4b70('0x3f')],_0x4b70('0x47')),_0x4b70('0x41'));var _0x34e943=ejs[_0x4b70('0x42')](_0x1ba1fd,{'networks':_0x8fb544||[]});fs[_0x4b70('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x34e943);return respondWithRpcPromise('Reload',_0x4b70('0x4e'),{'module':'res_stun_monitor.so'});}else{var _0x4d3d54=fs[_0x4b70('0x3e')](path['join'](config['root'],_0x4b70('0x4b')),_0x4b70('0x41'));var _0x5d2554=ejs['render'](_0x4d3d54,{'networks':_0x8fb544||[]});fs[_0x4b70('0x4c')](util[_0x4b70('0x50')](_0x4b70('0x4d'),_0x559498[_0x4b70('0x4f')]['type']['toLowerCase']()),_0x5d2554);return respondWithRpcPromise('Reload',_0x4b70('0x4e'),{'module':'chan_sip.so'});}})[_0x4b70('0x6')](function(_0x3ee3ca){if(_0x3ee3ca){return _0x4a53ad;}return null;})['then'](respondWithResult(_0x5a8c9f,null))[_0x4b70('0xf')](handleError(_0x5a8c9f,null));};exports[_0x4b70('0x17')]=function(_0x290998,_0x2f1b39){var _0x42bf74;return db[_0x4b70('0x1e')][_0x4b70('0x3b')]({'where':{'id':_0x290998[_0x4b70('0x39')]['id']}})[_0x4b70('0x6')](function(_0x4cbdb7){_0x42bf74=_0x4cbdb7;return _0x4cbdb7;})['then'](handleEntityNotFound(_0x2f1b39,null))['then'](removeEntity(_0x2f1b39,null))['then'](function(){if(_0x42bf74){return db[_0x4b70('0x1e')][_0x4b70('0x36')]({'where':{'type':_0x42bf74[_0x4b70('0x31')]},'raw':!![]});}})[_0x4b70('0x6')](function(_0xe7c629){if(_0x42bf74[_0x4b70('0x31')]['toUpperCase']()==_0x4b70('0x3d')){var _0xd697c9=fs[_0x4b70('0x3e')](path[_0x4b70('0x4a')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1094a5=ejs[_0x4b70('0x42')](_0xd697c9,{'networks':_0xe7c629||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1094a5);return respondWithRpcPromise(_0x4b70('0x44'),_0x4b70('0x17'),{'module':_0x4b70('0x49')});}else if(_0x42bf74['type'][_0x4b70('0x45')]()==_0x4b70('0x46')){var _0x5672c9=fs[_0x4b70('0x3e')](path[_0x4b70('0x4a')](config[_0x4b70('0x3f')],_0x4b70('0x47')),'utf8');var _0x462e19=ejs[_0x4b70('0x42')](_0x5672c9,{'networks':_0xe7c629||[]});fs['writeFileSync'](_0x4b70('0x48'),_0x462e19);return respondWithRpcPromise(_0x4b70('0x44'),_0x4b70('0x17'),{'module':_0x4b70('0x49')});}else{var _0x4108cc=fs['readFileSync'](path['join'](config[_0x4b70('0x3f')],_0x4b70('0x4b')),_0x4b70('0x41'));var _0xfa6367=ejs['render'](_0x4108cc,{'networks':_0xe7c629||[]});fs[_0x4b70('0x4c')](util[_0x4b70('0x50')](_0x4b70('0x4d'),_0x42bf74[_0x4b70('0x31')][_0x4b70('0x51')]()),_0xfa6367);return respondWithRpcPromise(_0x4b70('0x44'),_0x4b70('0x17'),{'module':_0x4b70('0x52')});}})[_0x4b70('0xf')](handleError(_0x2f1b39,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bca=['Network','network','util','moment','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x1d8fae,_0x4ad3ba){var _0x15df1e=function(_0x4d7aa7){while(--_0x4d7aa7){_0x1d8fae['push'](_0x1d8fae['shift']());}};_0x15df1e(++_0x4ad3ba);}(_0x1bca,0xb6));var _0xa1bc=function(_0xf37500,_0x56d524){_0xf37500=_0xf37500-0x0;var _0x362bb3=_0x1bca[_0xf37500];return _0x362bb3;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa1bc('0x1'));var BPromise=require('bluebird');var rp=require(_0xa1bc('0x2'));var fs=require('fs');var path=require(_0xa1bc('0x3'));var rimraf=require(_0xa1bc('0x4'));var config=require('../../config/environment');var attributes=require(_0xa1bc('0x5'));module[_0xa1bc('0x6')]=function(_0x168b44,_0x268ced){return _0x168b44['define'](_0xa1bc('0x7'),attributes,{'tableName':_0xa1bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb53=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1acd8b,_0x8364af){var _0xbb8118=function(_0xcfb089){while(--_0xcfb089){_0x1acd8b['push'](_0x1acd8b['shift']());}};_0xbb8118(++_0x8364af);}(_0xbb53,0x121));var _0x3bb5=function(_0x1d6535,_0xc25ce6){_0x1d6535=_0x1d6535-0x0;var _0x2d21ce=_0xbb53[_0x1d6535];return _0x2d21ce;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x594388,_0x2ed7a0){var _0x5c099c=function(_0x1a6bdf){while(--_0x1a6bdf){_0x594388['push'](_0x594388['shift']());}};_0x5c099c(++_0x2ed7a0);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\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(_0x58f79f,_0x4800dd){_0x58f79f=_0x58f79f-0x0;var _0xf4d031=_0x7a54[_0x58f79f];return _0xf4d031;};'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')]('Network,\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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33f4=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','send','put','delete','/:id/canned_answers','removeAnswers','removeAgents','exports'];(function(_0x2a744b,_0x393bbc){var _0x430a5e=function(_0x4d34e9){while(--_0x4d34e9){_0x2a744b['push'](_0x2a744b['shift']());}};_0x430a5e(++_0x393bbc);}(_0x33f4,0xd8));var _0x433f=function(_0x263a65,_0x1838dc){_0x263a65=_0x263a65-0x0;var _0x5b5292=_0x33f4[_0x263a65];return _0x5b5292;};'use strict';var multer=require(_0x433f('0x0'));var util=require(_0x433f('0x1'));var path=require(_0x433f('0x2'));var timeout=require(_0x433f('0x3'));var express=require(_0x433f('0x4'));var router=express['Router']();var fs_extra=require(_0x433f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x433f('0x6'));var config=require(_0x433f('0x7'));var controller=require(_0x433f('0x8'));router['get']('/',auth[_0x433f('0x9')](),controller[_0x433f('0xa')]);router[_0x433f('0xb')]('/describe',auth[_0x433f('0x9')](),controller[_0x433f('0xc')]);router[_0x433f('0xb')](_0x433f('0xd'),auth['isAuthenticated'](),controller[_0x433f('0xe')]);router[_0x433f('0xb')]('/:id/dispositions',auth[_0x433f('0x9')](),controller[_0x433f('0xf')]);router[_0x433f('0xb')]('/:id/canned_answers',auth[_0x433f('0x9')](),controller[_0x433f('0x10')]);router['get'](_0x433f('0x11'),auth['isAuthenticated'](),controller[_0x433f('0x12')]);router[_0x433f('0xb')]('/:id/interactions',auth[_0x433f('0x9')](),controller[_0x433f('0x13')]);router[_0x433f('0xb')]('/:id/users',auth[_0x433f('0x9')](),controller[_0x433f('0x14')]);router[_0x433f('0x15')]('/',auth[_0x433f('0x9')](),controller[_0x433f('0x16')]);router[_0x433f('0x15')](_0x433f('0x17'),auth['isAuthenticated'](),controller[_0x433f('0x18')]);router[_0x433f('0x15')]('/:id/canned_answers',auth[_0x433f('0x9')](),controller[_0x433f('0x19')]);router[_0x433f('0x15')](_0x433f('0x1a'),controller['notify']);router[_0x433f('0x15')]('/:id/applications',auth[_0x433f('0x9')](),controller[_0x433f('0x1b')]);router[_0x433f('0x15')](_0x433f('0x1c'),auth[_0x433f('0x9')](),controller['addAgents']);router[_0x433f('0x15')]('/:id/send',auth[_0x433f('0x9')](),controller[_0x433f('0x1d')]);router[_0x433f('0x1e')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x433f('0x1f')](_0x433f('0xd'),auth[_0x433f('0x9')](),controller['destroy']);router[_0x433f('0x1f')]('/:id/dispositions',auth[_0x433f('0x9')](),controller['removeDispositions']);router[_0x433f('0x1f')](_0x433f('0x20'),auth[_0x433f('0x9')](),controller[_0x433f('0x21')]);router[_0x433f('0x1f')](_0x433f('0x1c'),auth['isAuthenticated'](),controller[_0x433f('0x22')]);module[_0x433f('0x23')]=router;
\ No newline at end of file
+var _0x04ab=['../../config/environment','./openchannelAccount.controller','index','/describe','isAuthenticated','describe','/:id','show','get','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3651a0,_0x2e148e){var _0x436002=function(_0x41ef88){while(--_0x41ef88){_0x3651a0['push'](_0x3651a0['shift']());}};_0x436002(++_0x2e148e);}(_0x04ab,0xa0));var _0xb04a=function(_0x4092a3,_0x596bff){_0x4092a3=_0x4092a3-0x0;var _0x3587b5=_0x04ab[_0x4092a3];return _0x3587b5;};'use strict';var multer=require(_0xb04a('0x0'));var util=require('util');var path=require(_0xb04a('0x1'));var timeout=require(_0xb04a('0x2'));var express=require(_0xb04a('0x3'));var router=express[_0xb04a('0x4')]();var fs_extra=require(_0xb04a('0x5'));var auth=require(_0xb04a('0x6'));var interaction=require(_0xb04a('0x7'));var config=require(_0xb04a('0x8'));var controller=require(_0xb04a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb04a('0xa')]);router['get'](_0xb04a('0xb'),auth[_0xb04a('0xc')](),controller[_0xb04a('0xd')]);router['get'](_0xb04a('0xe'),auth['isAuthenticated'](),controller[_0xb04a('0xf')]);router[_0xb04a('0x10')](_0xb04a('0x11'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x12')]);router[_0xb04a('0x10')](_0xb04a('0x13'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x14')]);router[_0xb04a('0x10')](_0xb04a('0x15'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x16')]);router[_0xb04a('0x10')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xb04a('0x17')]);router[_0xb04a('0x10')](_0xb04a('0x18'),auth['isAuthenticated'](),controller[_0xb04a('0x19')]);router[_0xb04a('0x1a')]('/',auth[_0xb04a('0xc')](),controller[_0xb04a('0x1b')]);router[_0xb04a('0x1a')](_0xb04a('0x11'),auth[_0xb04a('0xc')](),controller['addDisposition']);router[_0xb04a('0x1a')](_0xb04a('0x13'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x1c')]);router[_0xb04a('0x1a')](_0xb04a('0x1d'),controller[_0xb04a('0x1e')]);router[_0xb04a('0x1a')](_0xb04a('0x15'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x1f')]);router[_0xb04a('0x1a')](_0xb04a('0x18'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x20')]);router[_0xb04a('0x1a')](_0xb04a('0x21'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x22')]);router[_0xb04a('0x23')](_0xb04a('0xe'),auth[_0xb04a('0xc')](),controller[_0xb04a('0x24')]);router[_0xb04a('0x25')](_0xb04a('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xb04a('0x25')]('/:id/dispositions',auth[_0xb04a('0xc')](),controller[_0xb04a('0x26')]);router[_0xb04a('0x25')]('/:id/canned_answers',auth[_0xb04a('0xc')](),controller[_0xb04a('0x27')]);router['delete']('/:id/users',auth[_0xb04a('0xc')](),controller[_0xb04a('0x28')]);module[_0xb04a('0x29')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab8e=['TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate'];(function(_0x5fcf45,_0x1933e4){var _0x5718ef=function(_0x245b92){while(--_0x245b92){_0x5fcf45['push'](_0x5fcf45['shift']());}};_0x5718ef(++_0x1933e4);}(_0xab8e,0x159));var _0xeab8=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xab8e[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeab8('0x0'));module['exports']={'name':{'type':Sequelize[_0xeab8('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xeab8('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xeab8('0x2')]();}},'replyUri':{'type':Sequelize[_0xeab8('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xeab8('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xeab8('0x3')],'defaultValue':function(){return _0xeab8('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xeab8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xeab8('0x1')]},'queueTransfer':{'type':Sequelize[_0xeab8('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeab8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeab8('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeab8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeab8('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xeab8('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xeab8('0x6')],'defaultValue':![],'comment':_0xeab8('0x8'),'set':function(_0x4f1c0c){if(!_0x4f1c0c)this[_0xeab8('0x9')](_0xeab8('0xa'),null);this[_0xeab8('0x9')](_0xeab8('0xb'),_0x4f1c0c);}}};
\ No newline at end of file
+var _0x9064=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x2a153e,_0x5aa5fb){var _0x7fdf2a=function(_0x11fff8){while(--_0x11fff8){_0x2a153e['push'](_0x2a153e['shift']());}};_0x7fdf2a(++_0x5aa5fb);}(_0x9064,0x9e));var _0x4906=function(_0x5cbdac,_0x537a2d){_0x5cbdac=_0x5cbdac-0x0;var _0x5c0857=_0x9064[_0x5cbdac];return _0x5c0857;};'use strict';var Sequelize=require(_0x4906('0x0'));var rs=require(_0x4906('0x1'));module[_0x4906('0x2')]={'name':{'type':Sequelize[_0x4906('0x3')],'unique':_0x4906('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x4906('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4906('0x5')]();}},'replyUri':{'type':Sequelize[_0x4906('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4906('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4906('0x6')],'defaultValue':function(){return _0x4906('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4906('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4906('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4906('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4906('0x3')]},'queueTransfer':{'type':Sequelize[_0x4906('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4906('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4906('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4906('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4906('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x4906('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x4906('0x8')],'defaultValue':![],'comment':_0x4906('0xb'),'set':function(_0x176ae9){if(!_0x176ae9)this[_0x4906('0xc')](_0x4906('0xd'),null);this[_0x4906('0xc')]('mandatoryDisposition',_0x176ae9);}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc51e=['addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','dataValues','Messages','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','params','fields','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','OpenchannelApplication','Applications','account','list','applications','orderBy','asc','Contacts','defaults','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','startRouting','notify'];(function(_0x5217e4,_0x58ce7b){var _0x4e0fcc=function(_0x54a574){while(--_0x54a574){_0x5217e4['push'](_0x5217e4['shift']());}};_0x4e0fcc(++_0x58ce7b);}(_0xc51e,0x1a0));var _0xec51=function(_0x67b075,_0x43557d){_0x67b075=_0x67b075-0x0;var _0x39d030=_0xc51e[_0x67b075];return _0x39d030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec51('0x0'));var zipdir=require(_0xec51('0x1'));var jsonpatch=require(_0xec51('0x2'));var rp=require('request-promise');var moment=require(_0xec51('0x3'));var BPromise=require(_0xec51('0x4'));var Mustache=require('mustache');var util=require(_0xec51('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xec51('0x6'));var ejs=require(_0xec51('0x7'));var fs=require('fs');var fs_extra=require(_0xec51('0x8'));var _=require('lodash');var squel=require(_0xec51('0x9'));var crypto=require('crypto');var jsforce=require(_0xec51('0xa'));var deskjs=require(_0xec51('0xb'));var toCsv=require(_0xec51('0x6'));var querystring=require('querystring');var Papa=require(_0xec51('0xc'));var Redis=require(_0xec51('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xec51('0xe'));var as=require(_0xec51('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec51('0x10'))('api');var utils=require(_0xec51('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xec51('0x12'));var db=require(_0xec51('0x13'))['db'];config[_0xec51('0x14')]=_['defaults'](config[_0xec51('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xec51('0x15'))(new Redis(config[_0xec51('0x14')]));require(_0xec51('0x16'))[_0xec51('0x17')](socket);var jayson=require(_0xec51('0x18'));var client=jayson[_0xec51('0x19')][_0xec51('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xec51('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x450e84,_0x2239d2,_0xda8f73,_0x31c97f){return new BPromise(function(_0x1cc125,_0x43f077){var _0x89edf8=_0x31c97f||client;return _0x89edf8[_0xec51('0x1b')](_0x450e84,_0xda8f73)[_0xec51('0x1c')](function(_0x1a07a9){logger['info'](_0xec51('0x1d'),_0x2239d2,'request\x20sent');logger[_0xec51('0x1e')](_0xec51('0x1f'),_0x2239d2,_0xec51('0x20'),JSON[_0xec51('0x21')](_0x1a07a9));if(_0x1a07a9[_0xec51('0x22')]){if(_0x1a07a9[_0xec51('0x22')]['code']===0x1f4){logger[_0xec51('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2239d2,_0x1a07a9[_0xec51('0x22')][_0xec51('0x23')]);return _0x43f077(_0x1a07a9['error'][_0xec51('0x23')]);}logger[_0xec51('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2239d2,_0x1a07a9[_0xec51('0x22')][_0xec51('0x23')]);return _0x1cc125(_0x1a07a9[_0xec51('0x22')][_0xec51('0x23')]);}else{logger[_0xec51('0x24')](_0xec51('0x1d'),_0x2239d2,_0xec51('0x20'));_0x1cc125(_0x1a07a9['result'][_0xec51('0x23')]);}})[_0xec51('0x25')](function(_0x2e4c7b){logger['error'](_0xec51('0x1d'),_0x2239d2,_0x2e4c7b);_0x43f077(_0x2e4c7b);});});}function respondWithStatusCode(_0x2b0053,_0x2dee87){_0x2dee87=_0x2dee87||0xcc;return function(_0x2c5b08){if(_0x2c5b08){return _0x2b0053['sendStatus'](_0x2dee87);}return _0x2b0053['status'](_0x2dee87)[_0xec51('0x26')]();};}function respondWithResult(_0x38feec,_0x18bf78){_0x18bf78=_0x18bf78||0xc8;return function(_0x196971){if(_0x196971){return _0x38feec[_0xec51('0x27')](_0x18bf78)[_0xec51('0x28')](_0x196971);}};}function respondWithFilteredResult(_0x2fe405,_0x200dda){return function(_0x347e95){if(_0x347e95){var _0x5080a6=typeof _0x200dda[_0xec51('0x29')]===_0xec51('0x2a')&&typeof _0x200dda[_0xec51('0x2b')]===_0xec51('0x2a');var _0x366b85=_0x347e95[_0xec51('0x2c')];var _0x217aee=_0x5080a6?0x0:_0x200dda[_0xec51('0x29')];var _0x1e706a=_0x5080a6?_0x347e95[_0xec51('0x2c')]:_0x200dda['offset']+_0x200dda[_0xec51('0x2b')];var _0xb1f54c;if(_0x1e706a>=_0x366b85){_0x1e706a=_0x366b85;_0xb1f54c=0xc8;}else{_0xb1f54c=0xce;}_0x2fe405[_0xec51('0x27')](_0xb1f54c);return _0x2fe405['set'](_0xec51('0x2d'),_0x217aee+'-'+_0x1e706a+'/'+_0x366b85)[_0xec51('0x28')](_0x347e95);}return null;};}function patchUpdates(_0x144d3d){return function(_0x3b7a1b){try{jsonpatch[_0xec51('0x2e')](_0x3b7a1b,_0x144d3d,!![]);}catch(_0x2f27ae){return BPromise[_0xec51('0x2f')](_0x2f27ae);}return _0x3b7a1b[_0xec51('0x30')]();};}function saveUpdates(_0x35fa16,_0x7309aa){return function(_0x31b262){if(_0x31b262){return _0x31b262[_0xec51('0x31')](_0x35fa16)[_0xec51('0x1c')](function(_0x3c2294){return _0x3c2294;});}return null;};}function removeEntity(_0x5d2786,_0x2870e6){return function(_0x47b8c5){if(_0x47b8c5){return _0x47b8c5[_0xec51('0x32')]()[_0xec51('0x1c')](function(){var _0x19710d=_0x47b8c5[_0xec51('0x33')]({'plain':!![]});var _0x301056=_0xec51('0x34');return db['UserProfileResource'][_0xec51('0x32')]({'where':{'type':_0x301056,'resourceId':_0x19710d['id']}})[_0xec51('0x1c')](function(){return _0x47b8c5;});})[_0xec51('0x1c')](function(){_0x5d2786['status'](0xcc)[_0xec51('0x26')]();});}};}function handleEntityNotFound(_0x52adc9,_0x35826d){return function(_0x4c6181){if(!_0x4c6181){_0x52adc9[_0xec51('0x35')](0x194);}return _0x4c6181;};}function handleError(_0x1fe4d1,_0xc9caa){_0xc9caa=_0xc9caa||0x1f4;return function(_0x1c6021){logger[_0xec51('0x22')](_0x1c6021['stack']);if(_0x1c6021[_0xec51('0x36')]){delete _0x1c6021['name'];}_0x1fe4d1[_0xec51('0x27')](_0xc9caa)[_0xec51('0x37')](_0x1c6021);};}exports[_0xec51('0x38')]=function(_0x33fbcb,_0x4b5179){var _0x1d1686={'include':[{'model':db[_0xec51('0x39')],'as':_0xec51('0x3a')}]},_0x284de3={},_0x322450={'count':0x0,'rows':[]};var _0x33bd36=_[_0xec51('0x3b')](db[_0xec51('0x3c')][_0xec51('0x3d')],function(_0x2c590e){return{'name':_0x2c590e[_0xec51('0x3e')],'type':_0x2c590e[_0xec51('0x3f')]['key']};});_0x284de3[_0xec51('0x40')]=_['map'](_0x33bd36,_0xec51('0x36'));_0x284de3[_0xec51('0x41')]=_[_0xec51('0x42')](_0x33fbcb[_0xec51('0x41')]);_0x284de3[_0xec51('0x43')]=_[_0xec51('0x44')](_0x284de3[_0xec51('0x40')],_0x284de3[_0xec51('0x41')]);_0x1d1686[_0xec51('0x45')]=_[_0xec51('0x44')](_0x284de3[_0xec51('0x40')],qs['fields'](_0x33fbcb[_0xec51('0x41')]['fields']));_0x1d1686[_0xec51('0x45')]=_0x1d1686[_0xec51('0x45')][_0xec51('0x46')]?_0x1d1686['attributes']:_0x284de3[_0xec51('0x40')];if(!_0x33fbcb[_0xec51('0x41')][_0xec51('0x47')](_0xec51('0x48'))){_0x1d1686['limit']=qs[_0xec51('0x2b')](_0x33fbcb[_0xec51('0x41')][_0xec51('0x2b')]);_0x1d1686[_0xec51('0x29')]=qs['offset'](_0x33fbcb['query']['offset']);}_0x1d1686['order']=qs['sort'](_0x33fbcb['query'][_0xec51('0x49')]);_0x1d1686[_0xec51('0x4a')]=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x33fbcb[_0xec51('0x41')],_0x284de3[_0xec51('0x43')]),_0x33bd36);if(_0x33fbcb['query'][_0xec51('0x4c')]){_0x1d1686[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x1d1686[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x33bd36,function(_0x33d30d){if(_0x33d30d[_0xec51('0x3f')]!=='VIRTUAL'){var _0x5859b1={};_0x5859b1[_0x33d30d[_0xec51('0x36')]]={'$like':'%'+_0x33fbcb[_0xec51('0x41')]['filter']+'%'};return _0x5859b1;}})});}_0x1d1686=_[_0xec51('0x4d')]({},_0x1d1686,_0x33fbcb['options']);var _0x5ef21c={'where':_0x1d1686[_0xec51('0x4a')]};return db[_0xec51('0x3c')]['count'](_0x5ef21c)[_0xec51('0x1c')](function(_0x2222b9){_0x322450['count']=_0x2222b9;if(_0x33fbcb[_0xec51('0x41')][_0xec51('0x4e')]){_0x1d1686['include']=[{'all':!![]}];}return db[_0xec51('0x3c')][_0xec51('0x4f')](_0x1d1686);})[_0xec51('0x1c')](function(_0x56034d){_0x322450[_0xec51('0x50')]=_0x56034d;return _0x322450;})[_0xec51('0x1c')](respondWithFilteredResult(_0x4b5179,_0x1d1686))[_0xec51('0x25')](handleError(_0x4b5179,null));};exports['show']=function(_0x5c8c50,_0x511c72){var _0x504b00={'raw':![],'where':{'id':_0x5c8c50[_0xec51('0x51')]['id']},'include':[{'model':db[_0xec51('0x39')],'as':_0xec51('0x3a')}]},_0x3c493e={};_0x3c493e[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0x3c')][_0xec51('0x3d')]);_0x3c493e[_0xec51('0x41')]=_[_0xec51('0x42')](_0x5c8c50[_0xec51('0x41')]);_0x3c493e[_0xec51('0x43')]=_[_0xec51('0x44')](_0x3c493e['model'],_0x3c493e[_0xec51('0x41')]);_0x504b00[_0xec51('0x45')]=_[_0xec51('0x44')](_0x3c493e[_0xec51('0x40')],qs[_0xec51('0x52')](_0x5c8c50[_0xec51('0x41')]['fields']));_0x504b00['attributes']=_0x504b00[_0xec51('0x45')][_0xec51('0x46')]?_0x504b00[_0xec51('0x45')]:_0x3c493e[_0xec51('0x40')];if(_0x5c8c50[_0xec51('0x41')][_0xec51('0x4e')]){_0x504b00[_0xec51('0x53')]=[{'all':!![]}];}_0x504b00=_[_0xec51('0x4d')]({},_0x504b00,_0x5c8c50[_0xec51('0x54')]);return db['OpenchannelAccount']['find'](_0x504b00)[_0xec51('0x1c')](handleEntityNotFound(_0x511c72,null))[_0xec51('0x1c')](respondWithResult(_0x511c72,null))[_0xec51('0x25')](handleError(_0x511c72,null));};exports[_0xec51('0x55')]=function(_0x303e57,_0x5ec913){return db[_0xec51('0x3c')][_0xec51('0x55')](_0x303e57[_0xec51('0x56')],{})[_0xec51('0x1c')](function(_0x134c8a){var _0x498ff1=_0x303e57[_0xec51('0x57')]['get']({'plain':!![]});if(!_0x498ff1)throw new Error(_0xec51('0x58'));if(_0x498ff1[_0xec51('0x59')]===_0xec51('0x57')){var _0x2f132e=_0x134c8a[_0xec51('0x33')]({'plain':!![]});var _0x20991f=_0xec51('0x34');return db[_0xec51('0x5a')][_0xec51('0x5b')]({'where':{'name':_0x20991f,'userProfileId':_0x498ff1[_0xec51('0x5c')]},'raw':!![]})['then'](function(_0x534644){if(_0x534644&&_0x534644[_0xec51('0x5d')]===0x0){return db[_0xec51('0x5e')][_0xec51('0x55')]({'name':_0x2f132e[_0xec51('0x36')],'resourceId':_0x2f132e['id'],'type':_0x534644[_0xec51('0x36')],'sectionId':_0x534644['id']},{})['then'](function(){return _0x134c8a;});}else{return _0x134c8a;}})[_0xec51('0x25')](function(_0x23f4fe){logger[_0xec51('0x22')](_0xec51('0x5f'),_0x23f4fe);throw _0x23f4fe;});}return _0x134c8a;})[_0xec51('0x1c')](respondWithResult(_0x5ec913,0xc9))[_0xec51('0x25')](handleError(_0x5ec913,null));};exports['update']=function(_0x2624cf,_0x4213d1){if(_0x2624cf[_0xec51('0x56')]['id']){delete _0x2624cf['body']['id'];}return db['OpenchannelAccount'][_0xec51('0x5b')]({'where':{'id':_0x2624cf[_0xec51('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0xec51('0x3a')}]})[_0xec51('0x1c')](handleEntityNotFound(_0x4213d1,null))[_0xec51('0x1c')](saveUpdates(_0x2624cf[_0xec51('0x56')],null))[_0xec51('0x1c')](respondWithResult(_0x4213d1,null))[_0xec51('0x25')](handleError(_0x4213d1,null));};exports[_0xec51('0x32')]=function(_0xebcd67,_0xfe5a8e){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0xebcd67[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0xfe5a8e,null))[_0xec51('0x1c')](removeEntity(_0xfe5a8e,null))[_0xec51('0x25')](handleError(_0xfe5a8e,null));};exports[_0xec51('0x60')]=function(_0xc6560c,_0x6f65ef){return db[_0xec51('0x3c')][_0xec51('0x60')]()[_0xec51('0x1c')](respondWithResult(_0x6f65ef,null))[_0xec51('0x25')](handleError(_0x6f65ef,null));};exports['addDisposition']=function(_0x393ab6,_0x3acb46,_0x116c8c){if(_0x393ab6[_0xec51('0x56')]['id']){delete _0x393ab6[_0xec51('0x56')]['id'];}return db[_0xec51('0x3c')]['find']({'where':{'id':_0x393ab6[_0xec51('0x51')]['id']}})['then'](handleEntityNotFound(_0x3acb46,null))[_0xec51('0x1c')](function(_0x342da9){if(_0x342da9){_0x393ab6['body']['OpenchannelAccountId']=_0x342da9['id'];return db[_0xec51('0x61')]['create'](_0x393ab6[_0xec51('0x56')]);}})[_0xec51('0x1c')](respondWithResult(_0x3acb46,null))[_0xec51('0x25')](handleError(_0x3acb46,null));};exports['getDispositions']=function(_0x3aed7b,_0x4445c5,_0x281e26){var _0x2cc4f6={'raw':![],'where':{}};var _0xf5167e={};var _0x2dd8df={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xec51('0x62')]({'where':{'id':_0x3aed7b[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x4445c5,null))[_0xec51('0x1c')](function(_0x2eb506){if(_0x2eb506){_0xf5167e['model']=_['keys'](db[_0xec51('0x61')]['rawAttributes']);_0xf5167e[_0xec51('0x41')]=_[_0xec51('0x42')](_0x3aed7b[_0xec51('0x41')]);_0xf5167e[_0xec51('0x43')]=_['intersection'](_0xf5167e[_0xec51('0x40')],_0xf5167e['query']);_0x2cc4f6['attributes']=_[_0xec51('0x44')](_0xf5167e[_0xec51('0x40')],qs[_0xec51('0x52')](_0x3aed7b[_0xec51('0x41')][_0xec51('0x52')]));_0x2cc4f6['attributes']=_0x2cc4f6[_0xec51('0x45')][_0xec51('0x46')]?_0x2cc4f6[_0xec51('0x45')]:_0xf5167e[_0xec51('0x40')];if(!_0x3aed7b[_0xec51('0x41')]['hasOwnProperty']('nolimit')){_0x2cc4f6[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x3aed7b[_0xec51('0x41')]['limit']);_0x2cc4f6[_0xec51('0x29')]=qs['offset'](_0x3aed7b[_0xec51('0x41')]['offset']);}_0x2cc4f6['order']=qs['sort'](_0x3aed7b[_0xec51('0x41')][_0xec51('0x49')]);_0x2cc4f6['where']=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x3aed7b[_0xec51('0x41')],_0xf5167e[_0xec51('0x43')]));_0x2cc4f6[_0xec51('0x4a')][_0xec51('0x63')]=_0x2eb506['id'];if(_0x3aed7b[_0xec51('0x41')][_0xec51('0x4c')]){_0x2cc4f6[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x2cc4f6[_0xec51('0x4a')],{'$or':_['map'](_0x2cc4f6[_0xec51('0x45')],function(_0x56320b){var _0x2651a7={};_0x2651a7[_0x56320b]={'$like':'%'+_0x3aed7b[_0xec51('0x41')]['filter']+'%'};return _0x2651a7;})});}_0x2cc4f6=_[_0xec51('0x4d')]({},_0x2cc4f6,_0x3aed7b['options']);return db[_0xec51('0x61')][_0xec51('0x2c')]({'where':_0x2cc4f6[_0xec51('0x4a')]})[_0xec51('0x1c')](function(_0x1e6973){_0x2dd8df[_0xec51('0x2c')]=_0x1e6973;if(_0x3aed7b[_0xec51('0x41')][_0xec51('0x4e')]){_0x2cc4f6[_0xec51('0x53')]=[{'all':!![]}];}return db[_0xec51('0x61')][_0xec51('0x4f')](_0x2cc4f6);})['then'](function(_0x3ed3e1){_0x2dd8df[_0xec51('0x50')]=_0x3ed3e1;return _0x2dd8df;});}})[_0xec51('0x1c')](respondWithFilteredResult(_0x4445c5,_0x2cc4f6))['catch'](handleError(_0x4445c5,null));};exports[_0xec51('0x64')]=function(_0x5a1365,_0x51fc1e,_0x2cb8c6){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x5a1365['params']['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x51fc1e,null))[_0xec51('0x1c')](function(_0x2ebcd4){if(_0x2ebcd4){return _0x2ebcd4[_0xec51('0x64')](_0x5a1365[_0xec51('0x41')][_0xec51('0x65')]);}})['then'](respondWithStatusCode(_0x51fc1e,null))[_0xec51('0x25')](handleError(_0x51fc1e,null));};exports[_0xec51('0x66')]=function(_0x8a909d,_0x470f94,_0xac8c0){if(_0x8a909d[_0xec51('0x56')]['id']){delete _0x8a909d['body']['id'];}return db['OpenchannelAccount'][_0xec51('0x5b')]({'where':{'id':_0x8a909d[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x470f94,null))[_0xec51('0x1c')](function(_0x1ba93f){if(_0x1ba93f){_0x8a909d[_0xec51('0x56')][_0xec51('0x63')]=_0x1ba93f['id'];return db['CannedAnswer'][_0xec51('0x55')](_0x8a909d['body']);}})['then'](respondWithResult(_0x470f94,null))[_0xec51('0x25')](handleError(_0x470f94,null));};exports[_0xec51('0x67')]=function(_0x12bba4,_0x3630f5,_0xf30ff7){var _0x9d7eef={'raw':![],'where':{}};var _0x210b5b={};var _0x29d593={'count':0x0,'rows':[]};return db[_0xec51('0x3c')]['findOne']({'where':{'id':_0x12bba4['params']['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x3630f5,null))['then'](function(_0x428813){if(_0x428813){_0x210b5b['model']=_[_0xec51('0x42')](db[_0xec51('0x68')][_0xec51('0x3d')]);_0x210b5b[_0xec51('0x41')]=_[_0xec51('0x42')](_0x12bba4[_0xec51('0x41')]);_0x210b5b[_0xec51('0x43')]=_[_0xec51('0x44')](_0x210b5b[_0xec51('0x40')],_0x210b5b['query']);_0x9d7eef[_0xec51('0x45')]=_[_0xec51('0x44')](_0x210b5b['model'],qs[_0xec51('0x52')](_0x12bba4['query'][_0xec51('0x52')]));_0x9d7eef[_0xec51('0x45')]=_0x9d7eef['attributes'][_0xec51('0x46')]?_0x9d7eef[_0xec51('0x45')]:_0x210b5b['model'];if(!_0x12bba4[_0xec51('0x41')][_0xec51('0x47')]('nolimit')){_0x9d7eef['limit']=qs[_0xec51('0x2b')](_0x12bba4[_0xec51('0x41')][_0xec51('0x2b')]);_0x9d7eef[_0xec51('0x29')]=qs[_0xec51('0x29')](_0x12bba4[_0xec51('0x41')][_0xec51('0x29')]);}_0x9d7eef[_0xec51('0x69')]=qs[_0xec51('0x49')](_0x12bba4[_0xec51('0x41')][_0xec51('0x49')]);_0x9d7eef[_0xec51('0x4a')]=qs['filters'](_[_0xec51('0x4b')](_0x12bba4[_0xec51('0x41')],_0x210b5b[_0xec51('0x43')]));_0x9d7eef[_0xec51('0x4a')][_0xec51('0x63')]=_0x428813['id'];if(_0x12bba4[_0xec51('0x41')][_0xec51('0x4c')]){_0x9d7eef[_0xec51('0x4a')]=_['merge'](_0x9d7eef['where'],{'$or':_[_0xec51('0x3b')](_0x9d7eef[_0xec51('0x45')],function(_0x3c79fd){var _0x419031={};_0x419031[_0x3c79fd]={'$like':'%'+_0x12bba4['query'][_0xec51('0x4c')]+'%'};return _0x419031;})});}_0x9d7eef=_[_0xec51('0x4d')]({},_0x9d7eef,_0x12bba4[_0xec51('0x54')]);return db[_0xec51('0x68')][_0xec51('0x2c')]({'where':_0x9d7eef['where']})[_0xec51('0x1c')](function(_0x4fa2b0){_0x29d593[_0xec51('0x2c')]=_0x4fa2b0;if(_0x12bba4[_0xec51('0x41')][_0xec51('0x4e')]){_0x9d7eef['include']=[{'all':!![]}];}return db[_0xec51('0x68')][_0xec51('0x4f')](_0x9d7eef);})[_0xec51('0x1c')](function(_0x599e25){_0x29d593[_0xec51('0x50')]=_0x599e25;return _0x29d593;});}})[_0xec51('0x1c')](respondWithFilteredResult(_0x3630f5,_0x9d7eef))[_0xec51('0x25')](handleError(_0x3630f5,null));};exports[_0xec51('0x6a')]=function(_0x1fe54b,_0x5932e6,_0x5c6873){return db[_0xec51('0x3c')]['find']({'where':{'id':_0x1fe54b[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x5932e6,null))[_0xec51('0x1c')](function(_0x17e8e0){if(_0x17e8e0){return _0x17e8e0['removeAnswers'](_0x1fe54b[_0xec51('0x41')]['ids']);}})[_0xec51('0x1c')](respondWithStatusCode(_0x5932e6,null))[_0xec51('0x25')](handleError(_0x5932e6,null));};exports['notify']=function(_0x25d406,_0x54e947,_0x74c7d0){var _0x4d7a59={'body':_0x25d406[_0xec51('0x56')],'channel':_0xec51('0x6b')};var _0x46f841=[];var _0x33c2da=[];var _0x43ab9f={};var _0x2ba6f8=![];return db[_0xec51('0x6c')][_0xec51('0x60')]()['then'](function(_0x4870fd){if(!_0x4870fd){throw new db[(_0xec51('0x6d'))][(_0xec51('0x6e'))]('no\x20available\x20attributes');}_0x46f841=_['difference'](_['keys'](_0x4870fd),[_0xec51('0x6f'),_0xec51('0x70')]);_0x33c2da=_[_0xec51('0x71')](_[_0xec51('0x42')](_0x4870fd),['createdAt',_0xec51('0x70'),_0xec51('0x72'),_0xec51('0x73')]);if(_0x25d406[_0xec51('0x56')]['id']){delete _0x25d406[_0xec51('0x56')]['id'];}if(_[_0xec51('0x74')](_0x25d406[_0xec51('0x56')]['from'])){throw new db['Sequelize']['ValidationError'](_0xec51('0x75'));}if(_[_0xec51('0x74')](_0x25d406[_0xec51('0x56')][_0xec51('0x56')])||_0x25d406[_0xec51('0x56')]['body']===''){throw new db[(_0xec51('0x6d'))][(_0xec51('0x6e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x25d406[_0xec51('0x56')][_0xec51('0x76')])){throw new db[(_0xec51('0x6d'))][(_0xec51('0x6e'))](_0xec51('0x77')+_0x33c2da);}if(!_[_0xec51('0x78')](_0x33c2da,_0x25d406[_0xec51('0x56')][_0xec51('0x76')])){throw new db[(_0xec51('0x6d'))]['ValidationError'](_0xec51('0x79')+_0x33c2da);}_0x43ab9f[_0x25d406[_0xec51('0x56')][_0xec51('0x76')]]=_0x25d406['body']['from'];})[_0xec51('0x1c')](function(){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x25d406['params']['id']},'include':[{'model':db['CmList'],'as':_0xec51('0x7a'),'include':[{'model':db[_0xec51('0x6c')],'as':'Contacts','where':_0x43ab9f,'limit':0x1,'order':[[_0xec51('0x70'),'DESC']]}]},{'model':db[_0xec51('0x7b')],'as':_0xec51('0x7c')}]});})['then'](handleEntityNotFound(_0x54e947,null))['then'](function(_0x48d453){if(_0x48d453&&_0x48d453['List']){_0x4d7a59[_0xec51('0x7d')]=_0x48d453;_0x4d7a59['applications']=_0x48d453['Applications'];_0x4d7a59[_0xec51('0x7e')]=_0x48d453[_0xec51('0x7a')];_0x4d7a59[_0xec51('0x7f')]=_[_0xec51('0x80')](_0x4d7a59[_0xec51('0x7f')],['priority'],[_0xec51('0x81')]);if(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x7c')]){delete _0x4d7a59[_0xec51('0x7d')][_0xec51('0x7c')];}if(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x7a')]&&_0x4d7a59[_0xec51('0x7d')][_0xec51('0x7a')][_0xec51('0x82')][_0xec51('0x46')]){return _0x4d7a59[_0xec51('0x7d')][_0xec51('0x7a')][_0xec51('0x82')][0x0];}var _0x5b9e11=_[_0xec51('0x83')](_0x25d406[_0xec51('0x56')],{'firstName':_0x25d406[_0xec51('0x56')][_0xec51('0x84')],'ListId':_0x48d453['ListId']});_0x5b9e11[_0x25d406[_0xec51('0x56')][_0xec51('0x76')]]=_0x25d406[_0xec51('0x56')][_0xec51('0x84')];return db[_0xec51('0x6c')][_0xec51('0x55')](_0x5b9e11,{'fields':_0x46f841,'raw':!![]});}})[_0xec51('0x1c')](handleEntityNotFound(_0x54e947,null))[_0xec51('0x1c')](function(_0x49524d){_0x4d7a59[_0xec51('0x85')]=_0x49524d;if(_0x49524d){var _0x1292da={'ContactId':_0x49524d['id'],'OpenchannelAccountId':_0x25d406['params']['id'],'from':(_0x49524d[_0xec51('0x86')]||'')+'\x20'+(_0x49524d[_0xec51('0x87')]||'')};var _0x36b241={'OpenchannelAccountId':_0x25d406[_0xec51('0x51')]['id'],'closed':![]};if(_0x25d406[_0xec51('0x56')][_0xec51('0x88')]){_0x36b241[_0xec51('0x88')]=_0x25d406[_0xec51('0x56')][_0xec51('0x88')];return db[_0xec51('0x89')]['find']({'where':_0x36b241})[_0xec51('0x1c')](function(_0x325635){if(_0x325635){return[_0x325635,![]];}_0x1292da[_0xec51('0x88')]=_0x25d406[_0xec51('0x56')][_0xec51('0x88')];_0x1292da[_0xec51('0x8a')]=_0x25d406[_0xec51('0x56')][_0xec51('0x8a')];return db['OpenchannelInteraction'][_0xec51('0x55')](_0x1292da)[_0xec51('0x1c')](function(_0xce11f0){return[_0xce11f0,!![]];});});}else{_0x36b241[_0xec51('0x88')]=null;}_0x36b241[_0xec51('0x8b')]=_0x49524d['id'];return db[_0xec51('0x89')][_0xec51('0x5b')]({'where':_0x36b241})[_0xec51('0x1c')](function(_0x24fb8c){if(_0x24fb8c){return[_0x24fb8c,![]];}return db[_0xec51('0x89')]['create'](_0x1292da)['then'](function(_0x2011dd){return[_0x2011dd,!![]];});});}})[_0xec51('0x8c')](function(_0x554646,_0x2aa587){if(_0x554646){_0x2ba6f8=_0x2aa587;if(!_0x2aa587){var _0x273161={'from':(_0x4d7a59[_0xec51('0x85')][_0xec51('0x86')]||'')+'\x20'+(_0x4d7a59[_0xec51('0x85')][_0xec51('0x87')]||'')};if(_0x25d406[_0xec51('0x56')][_0xec51('0x88')]&&_0x25d406['body'][_0xec51('0x8d')]&&_0x25d406[_0xec51('0x56')][_0xec51('0x88')]!=_0x25d406[_0xec51('0x56')][_0xec51('0x8d')]){_0x273161[_0xec51('0x88')]=_0x25d406[_0xec51('0x56')][_0xec51('0x8d')];}return _0x554646['update'](_0x273161);}else{return _0x554646;}}})[_0xec51('0x1c')](function(_0x1d6504){_0x4d7a59[_0xec51('0x8e')]=_0x1d6504[_0xec51('0x33')]({'plain':!![]});_0x4d7a59[_0xec51('0x8e')][_0xec51('0x8f')]=_0x2ba6f8;if(_0x4d7a59[_0xec51('0x8e')][_0xec51('0x8f')]){if(_0x4d7a59['account'][_0xec51('0x90')]){_0x4d7a59['applications'][_0xec51('0x91')]({'id':0x0,'priority':_0x4d7a59[_0xec51('0x7f')][_0xec51('0x46')]+0x1,'app':_0xec51('0x92'),'appdata':_0xec51('0x93'),'interval':_0xec51('0x94')});}}return db[_0xec51('0x95')][_0xec51('0x55')]({'body':_0x25d406[_0xec51('0x56')][_0xec51('0x56')],'OpenchannelAccountId':_0x25d406[_0xec51('0x51')]['id'],'OpenchannelInteractionId':_0x1d6504['id'],'direction':'in','ContactId':_0x4d7a59['contact']['id'],'AttachmentId':_0x25d406[_0xec51('0x56')][_0xec51('0x96')]});})['then'](function(_0x19b69a){_0x4d7a59[_0xec51('0x23')]=_0x19b69a;if(!_0x4d7a59[_0xec51('0x8e')][_0xec51('0x97')])return;return db['User'][_0xec51('0x5b')]({'attributes':['id',_0xec51('0x36')],'where':{'id':_0x4d7a59[_0xec51('0x8e')]['UserId']}});})[_0xec51('0x1c')](function(_0x502f73){if(_0x502f73){_0x4d7a59[_0xec51('0x7f')][_0xec51('0x98')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x502f73['name']+','+(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x99')]||0xa),'interval':'*,*,*,*'});}if(!_0x4d7a59['interaction'][_0xec51('0x9a')])return;return db[_0xec51('0x9b')][_0xec51('0x5b')]({'attributes':['id',_0xec51('0x36')],'where':{'id':_0x4d7a59['interaction']['queueId']}});})['then'](function(_0x53128d){if(_0x53128d){_0x4d7a59[_0xec51('0x7f')][_0xec51('0x98')]({'id':0x0,'priority':0x1,'app':_0xec51('0x9c'),'appdata':_0x53128d[_0xec51('0x36')]+','+(_0x4d7a59[_0xec51('0x7d')][_0xec51('0x9d')]||0x12c),'interval':_0xec51('0x94')});}return respondWithRpcPromise('Start',_0xec51('0x9e'),_0x4d7a59);})['then'](function(_0x3690c1){respondWithRpcPromise('EventManager','EventManager',{'event':_0xec51('0x9f'),'message':_0x3690c1},client9002);return _0x3690c1;})[_0xec51('0x1c')](respondWithResult(_0x54e947,null))['catch'](handleError(_0x54e947,null));};exports[_0xec51('0xa0')]=function(_0x707d96,_0x324fa3){var _0xd21c0b=_0x707d96[_0xec51('0x51')]['id'];var _0x383647=_0x707d96[_0xec51('0x56')];var _0x5386f6=0xc8;var _0x87c8a9=null;return db[_0xec51('0xa1')][_0xec51('0xa2')]({'isolationLevel':db[_0xec51('0xa1')][_0xec51('0xa3')][_0xec51('0xa4')][_0xec51('0xa5')]},function(_0x41c197){return db['OpenchannelAccount']['findOne']({'where':{'id':_0xd21c0b},'transaction':_0x41c197})[_0xec51('0x1c')](function(_0x9cbcaf){if(_0x9cbcaf){return db['OpenchannelApplication'][_0xec51('0x32')]({'where':{'OpenchannelAccountId':_0xd21c0b},'transaction':_0x41c197})[_0xec51('0x1c')](function(){var _0x4b3cf2=_['map'](_0x383647,function(_0x3ab7fb){_0x3ab7fb[_0xec51('0x63')]=_0xd21c0b;return _0x3ab7fb;});return db['OpenchannelApplication']['bulkCreate'](_0x4b3cf2,{'transaction':_0x41c197});});}else{_0x5386f6=0x194;_0x87c8a9=[];}});})['then'](function(){if(_0x5386f6!==0x194){return db['OpenchannelApplication'][_0xec51('0xa6')]({'where':{'OpenchannelAccountId':_0xd21c0b},'order':_0xec51('0xa7')})['then'](function(_0x4ce895){_0x87c8a9=_0x4ce895;});}})[_0xec51('0x25')](function(_0x1c435d){_0x5386f6=0x1f4;logger['error'](_0x1c435d[_0xec51('0xa8')]);if(_0x1c435d['name']){delete _0x1c435d[_0xec51('0x36')];}_0x87c8a9=_0x1c435d;})[_0xec51('0xa9')](function(){if(_0x87c8a9===null){_0x324fa3['sendStatus'](_0x5386f6);}else{if(_0x5386f6===0x1f4){_0x324fa3[_0xec51('0x27')](_0x5386f6)[_0xec51('0x37')](_0x87c8a9);}else{_0x324fa3[_0xec51('0x27')](_0x5386f6)[_0xec51('0x28')](_0x87c8a9);}}});};exports['getApplications']=function(_0x1e5b9d,_0x51726d,_0x217941){var _0x1d9210={};var _0x467d2c={};var _0x4e2958;var _0x66f555;return db[_0xec51('0x3c')][_0xec51('0x62')]({'where':{'id':_0x1e5b9d[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x51726d,null))['then'](function(_0x2ffbcd){if(_0x2ffbcd){_0x4e2958=_0x2ffbcd;_0x467d2c[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0x7b')]['rawAttributes']);_0x467d2c[_0xec51('0x41')]=_[_0xec51('0x42')](_0x1e5b9d[_0xec51('0x41')]);_0x467d2c[_0xec51('0x43')]=_[_0xec51('0x44')](_0x467d2c['model'],_0x467d2c['query']);_0x1d9210['attributes']=_[_0xec51('0x44')](_0x467d2c['model'],qs['fields'](_0x1e5b9d['query'][_0xec51('0x52')]));_0x1d9210[_0xec51('0x45')]=_0x1d9210[_0xec51('0x45')][_0xec51('0x46')]?_0x1d9210['attributes']:_0x467d2c[_0xec51('0x40')];_0x1d9210['order']=qs[_0xec51('0x49')](_0x1e5b9d[_0xec51('0x41')][_0xec51('0x49')]);_0x1d9210['where']=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x1e5b9d[_0xec51('0x41')],_0x467d2c['filters']));if(_0x1e5b9d[_0xec51('0x41')][_0xec51('0x4c')]){_0x1d9210[_0xec51('0x4a')]=_['merge'](_0x1d9210[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x1d9210['attributes'],function(_0x56e753){var _0x3cd40e={};_0x3cd40e[_0x56e753]={'$like':'%'+_0x1e5b9d[_0xec51('0x41')][_0xec51('0x4c')]+'%'};return _0x3cd40e;})});}_0x1d9210=_[_0xec51('0x4d')]({},_0x1d9210,_0x1e5b9d[_0xec51('0x54')]);return _0x4e2958[_0xec51('0xaa')](_0x1d9210);}})[_0xec51('0x1c')](function(_0x4d3ed1){if(_0x4d3ed1){_0x66f555=_0x4d3ed1[_0xec51('0x46')];if(!_0x1e5b9d[_0xec51('0x41')][_0xec51('0x47')](_0xec51('0x48'))){_0x1d9210[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x1e5b9d[_0xec51('0x41')][_0xec51('0x2b')]);_0x1d9210[_0xec51('0x29')]=qs['offset'](_0x1e5b9d[_0xec51('0x41')][_0xec51('0x29')]);}return _0x4e2958[_0xec51('0xaa')](_0x1d9210);}})[_0xec51('0x1c')](function(_0x5df392){if(_0x5df392){return _0x5df392?{'count':_0x66f555,'rows':_0x5df392}:null;}})[_0xec51('0x1c')](respondWithResult(_0x51726d,null))[_0xec51('0x25')](handleError(_0x51726d,null));};exports[_0xec51('0xab')]=function(_0x22493c,_0x3d105f,_0x7ece0){var _0x49af0b={'raw':![],'where':{}};var _0x2f0859={};var _0xa92149={'count':0x0,'rows':[]};return db[_0xec51('0x3c')][_0xec51('0x62')]({'where':{'id':_0x22493c[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x3d105f,null))['then'](function(_0x1f4c93){if(_0x1f4c93){_0x2f0859[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0x89')][_0xec51('0x3d')]);_0x2f0859['query']=_[_0xec51('0x42')](_0x22493c[_0xec51('0x41')]);_0x2f0859[_0xec51('0x43')]=_[_0xec51('0x44')](_0x2f0859[_0xec51('0x40')],_0x2f0859['query']);_0x49af0b[_0xec51('0x45')]=_[_0xec51('0x44')](_0x2f0859[_0xec51('0x40')],qs['fields'](_0x22493c[_0xec51('0x41')][_0xec51('0x52')]));_0x49af0b['attributes']=_0x49af0b['attributes'][_0xec51('0x46')]?_0x49af0b[_0xec51('0x45')]:_0x2f0859['model'];if(!_0x22493c['query'][_0xec51('0x47')](_0xec51('0x48'))){_0x49af0b[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x22493c['query'][_0xec51('0x2b')]);_0x49af0b[_0xec51('0x29')]=qs[_0xec51('0x29')](_0x22493c[_0xec51('0x41')][_0xec51('0x29')]);}_0x49af0b[_0xec51('0x69')]=qs[_0xec51('0x49')](_0x22493c[_0xec51('0x41')][_0xec51('0x49')]);_0x49af0b['where']=qs[_0xec51('0x43')](_[_0xec51('0x4b')](_0x22493c[_0xec51('0x41')],_0x2f0859[_0xec51('0x43')]));_0x49af0b[_0xec51('0x4a')][_0xec51('0x63')]=_0x1f4c93['id'];if(_0x22493c['query'][_0xec51('0x4c')]){_0x49af0b[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x49af0b[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x49af0b[_0xec51('0x45')],function(_0x249357){var _0x48cb12={};_0x48cb12[_0x249357]={'$like':'%'+_0x22493c[_0xec51('0x41')][_0xec51('0x4c')]+'%'};return _0x48cb12;})});}_0x49af0b=_[_0xec51('0x4d')]({},_0x49af0b,_0x22493c[_0xec51('0x54')]);return db[_0xec51('0x89')][_0xec51('0x2c')]({'where':_0x49af0b['where']})['then'](function(_0x57b9ed){_0xa92149[_0xec51('0x2c')]=_0x57b9ed;if(_0x22493c[_0xec51('0x41')][_0xec51('0x4e')]){_0x49af0b['include']=[{'model':db[_0xec51('0x6c')],'as':_0xec51('0xac'),'required':![]},{'model':db[_0xec51('0xad')],'as':'Owner','attributes':['name',_0xec51('0xae'),_0xec51('0xaf')],'required':![]},{'model':db[_0xec51('0xb0')],'as':_0xec51('0xb1'),'attributes':['id',_0xec51('0x36'),_0xec51('0xb2')],'where':_0x22493c[_0xec51('0x41')][_0xec51('0xb3')]?{'id':_0x22493c[_0xec51('0x41')][_0xec51('0xb3')]}:undefined,'required':_0x22493c[_0xec51('0x41')][_0xec51('0xb3')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xec51('0x4f')](_0x49af0b);})[_0xec51('0x1c')](function(_0x46a1fe){_0xa92149[_0xec51('0x50')]=_0x46a1fe;return _0xa92149;});}})[_0xec51('0x1c')](respondWithFilteredResult(_0x3d105f,_0x49af0b))[_0xec51('0x25')](handleError(_0x3d105f,null));};exports[_0xec51('0xb4')]=function(_0x14df11,_0xf55e77,_0x314be9){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x14df11[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0xf55e77,null))[_0xec51('0x1c')](function(_0x18c963){if(_0x18c963){return _0x18c963['addAgents'](_0x14df11[_0xec51('0x56')][_0xec51('0x65')],_[_0xec51('0xb5')](_0x14df11[_0xec51('0x56')],['ids','id'])||{})[_0xec51('0x8c')](function(_0x416142){for(var _0x39bcff=0x0;_0x39bcff<_0x14df11[_0xec51('0x56')]['ids'][_0xec51('0x46')];_0x39bcff+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x14df11[_0xec51('0x56')][_0xec51('0x65')][_0x39bcff]),'OpenchannelAccountId':Number(_0x14df11[_0xec51('0x51')]['id'])});}return _0x416142;});}})['then'](respondWithResult(_0xf55e77,null))[_0xec51('0x25')](handleError(_0xf55e77,null));};exports[_0xec51('0xb6')]=function(_0x386ec3,_0x3bc5c2,_0x3c3b9b){return db['OpenchannelAccount']['find']({'where':{'id':_0x386ec3[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x3bc5c2,null))[_0xec51('0x1c')](function(_0x143f0c){if(_0x143f0c){return _0x143f0c['removeAgents'](_0x386ec3[_0xec51('0x41')][_0xec51('0x65')])[_0xec51('0x1c')](function(){if(_[_0xec51('0xb7')](_0x386ec3[_0xec51('0x41')][_0xec51('0x65')])){for(var _0x4e545f=0x0;_0x4e545f<_0x386ec3['query'][_0xec51('0x65')][_0xec51('0x46')];_0x4e545f+=0x1){socket[_0xec51('0xb8')](_0xec51('0xb9'),{'UserId':Number(_0x386ec3[_0xec51('0x41')]['ids'][_0x4e545f]),'OpenchannelAccountId':Number(_0x386ec3[_0xec51('0x51')]['id'])});}}else{socket[_0xec51('0xb8')](_0xec51('0xb9'),{'UserId':Number(_0x386ec3[_0xec51('0x41')][_0xec51('0x65')]),'OpenchannelAccountId':Number(_0x386ec3[_0xec51('0x51')]['id'])});}});}})[_0xec51('0x1c')](respondWithStatusCode(_0x3bc5c2,null))[_0xec51('0x25')](handleError(_0x3bc5c2,null));};exports[_0xec51('0xba')]=function(_0x28c39e,_0x254e20,_0x5e9780){var _0x2ec87b={};var _0x470c8e={};var _0x48969c;var _0x1b0b66;return db[_0xec51('0x3c')]['findOne']({'where':{'id':_0x28c39e[_0xec51('0x51')]['id']}})[_0xec51('0x1c')](handleEntityNotFound(_0x254e20,null))[_0xec51('0x1c')](function(_0x3782a8){if(_0x3782a8){_0x48969c=_0x3782a8;_0x470c8e[_0xec51('0x40')]=_[_0xec51('0x42')](db[_0xec51('0xad')][_0xec51('0x3d')]);_0x470c8e[_0xec51('0x41')]=_[_0xec51('0x42')](_0x28c39e[_0xec51('0x41')]);_0x470c8e[_0xec51('0x43')]=_['intersection'](_0x470c8e[_0xec51('0x40')],_0x470c8e[_0xec51('0x41')]);_0x2ec87b['attributes']=_[_0xec51('0x44')](_0x470c8e[_0xec51('0x40')],qs['fields'](_0x28c39e[_0xec51('0x41')]['fields']));_0x2ec87b[_0xec51('0x45')]=_0x2ec87b[_0xec51('0x45')][_0xec51('0x46')]?_0x2ec87b[_0xec51('0x45')]:_0x470c8e[_0xec51('0x40')];_0x2ec87b[_0xec51('0x69')]=qs['sort'](_0x28c39e['query'][_0xec51('0x49')]);_0x2ec87b[_0xec51('0x4a')]=qs['filters'](_[_0xec51('0x4b')](_0x28c39e[_0xec51('0x41')],_0x470c8e['filters']));if(_0x28c39e[_0xec51('0x41')][_0xec51('0x4c')]){_0x2ec87b[_0xec51('0x4a')]=_[_0xec51('0x4d')](_0x2ec87b[_0xec51('0x4a')],{'$or':_[_0xec51('0x3b')](_0x2ec87b['attributes'],function(_0x44eeb0){var _0x37ed1f={};_0x37ed1f[_0x44eeb0]={'$like':'%'+_0x28c39e[_0xec51('0x41')][_0xec51('0x4c')]+'%'};return _0x37ed1f;})});}_0x2ec87b=_[_0xec51('0x4d')]({},_0x2ec87b,_0x28c39e[_0xec51('0x54')]);return _0x48969c[_0xec51('0xba')](_0x2ec87b);}})[_0xec51('0x1c')](function(_0x21c0bf){if(_0x21c0bf){_0x1b0b66=_0x21c0bf['length'];if(!_0x28c39e['query'][_0xec51('0x47')]('nolimit')){_0x2ec87b[_0xec51('0x2b')]=qs[_0xec51('0x2b')](_0x28c39e[_0xec51('0x41')][_0xec51('0x2b')]);_0x2ec87b[_0xec51('0x29')]=qs['offset'](_0x28c39e[_0xec51('0x41')][_0xec51('0x29')]);}return _0x48969c[_0xec51('0xba')](_0x2ec87b);}})[_0xec51('0x1c')](function(_0x3b92de){if(_0x3b92de){return _0x3b92de?{'count':_0x1b0b66,'rows':_0x3b92de}:null;}})[_0xec51('0x1c')](respondWithResult(_0x254e20,null))[_0xec51('0x25')](handleError(_0x254e20,null));};exports[_0xec51('0x37')]=function(_0x47ccfc,_0x42194f,_0x365ce4){var _0x1c6c44,_0x55eecf,_0x38fed7;if(_[_0xec51('0x74')](_0x47ccfc[_0xec51('0x56')][_0xec51('0x56')])||_0x47ccfc['body'][_0xec51('0x56')]===''){throw new db[(_0xec51('0x6d'))]['ValidationError'](_0xec51('0xbb'));}if(_[_0xec51('0x74')](_0x47ccfc[_0xec51('0x56')]['to'])){}_0x1c6c44=_0x47ccfc[_0xec51('0x56')]['to'];return db[_0xec51('0x3c')][_0xec51('0x62')]({'where':{'id':_0x47ccfc['params']['id']}})['then'](handleEntityNotFound(_0x42194f,null))[_0xec51('0x1c')](function(_0x1890cd){if(_0x1890cd){return db[_0xec51('0x3c')][_0xec51('0x5b')]({'where':{'id':_0x1890cd['id']},'include':[{'model':db['CmList'],'as':_0xec51('0x7a'),'include':[{'model':db[_0xec51('0x6c')],'as':_0xec51('0x82'),'where':{[_0x1890cd[_0xec51('0x76')]]:_0x1c6c44},'limit':0x1,'order':[[_0xec51('0x70'),_0xec51('0xbc')]]}]}]})[_0xec51('0x1c')](handleEntityNotFound(_0x42194f,null))['then'](function(_0x4a0698){if(_0x4a0698&&_0x4a0698['List']){_0x55eecf=_0x4a0698['get']({'plain':!![]});if(_0x55eecf[_0xec51('0x7a')]&&_0x55eecf[_0xec51('0x7a')][_0xec51('0x82')]['length']){return _0x55eecf['List'][_0xec51('0x82')][0x0];}return db[_0xec51('0x6c')]['create'](_[_0xec51('0x83')](_0x47ccfc[_0xec51('0x56')],{'firstName':_0x1c6c44,[_0x4a0698[_0xec51('0x76')]]:_0x1c6c44,'phone':_0x1c6c44,'ListId':_0x55eecf[_0xec51('0x73')]}));}})[_0xec51('0x1c')](handleEntityNotFound(_0x42194f,null))[_0xec51('0x1c')](function(_0x511f84){if(_0x511f84){_0x38fed7=_0x511f84;return db[_0xec51('0x89')][_0xec51('0x5b')]({'where':{'ContactId':_0x38fed7['id'],'closed':![],'OpenchannelAccountId':_0x55eecf['id']}})['then'](function(_0xdbdf2b){if(_0xdbdf2b){return[_0xdbdf2b,![]];}return db[_0xec51('0x89')][_0xec51('0x55')]({'UserId':_0x47ccfc[_0xec51('0x57')]['id'],'ContactId':_0x38fed7['id'],'OpenchannelAccountId':_0x55eecf['id'],'lastMsgDirection':'out','firstMsgDirection':_0xec51('0xbd'),'Messages':[_['merge'](_0x47ccfc[_0xec51('0x56')],{'read':![],'body':_0x47ccfc['body'][_0xec51('0x56')],'OpenchannelAccountId':_0x55eecf['id'],'UserId':_0x47ccfc[_0xec51('0x57')]['id'],'ContactId':_0x38fed7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xec51('0x1c')](function(_0x1f0587){return[_0x1f0587,!![]];});});}})[_0xec51('0x8c')](function(_0x2c5c72,_0x40d531){if(_0x40d531){return _0x2c5c72;}return db[_0xec51('0x95')]['create'](_[_0xec51('0x4d')](_0x47ccfc[_0xec51('0x56')],{'read':![],'body':_0x47ccfc[_0xec51('0x56')][_0xec51('0x56')],'OpenchannelAccountId':_0x55eecf['id'],'OpenchannelInteractionId':_0x2c5c72['id'],'UserId':_0x47ccfc['user']['id'],'ContactId':_0x38fed7['id']}))[_0xec51('0x1c')](function(_0x34a1bc){_0x2c5c72[_0xec51('0xbe')][_0xec51('0xbf')]=[];_0x2c5c72['dataValues']['Messages'][_0xec51('0x91')](_0x34a1bc[_0xec51('0xbe')]);return _0x2c5c72;});});}})[_0xec51('0x1c')](respondWithResult(_0x42194f,null))[_0xec51('0x25')](handleError(_0x42194f,null));};
\ No newline at end of file
+var _0x6b4e=['OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','contact','lastName','threadId','externalUrl','OpenchannelInteraction','spread','messageId','created','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','dataValues','Messages','rimraf','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','http','client','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','CmContact','Contacts','DESC'];(function(_0x3736e0,_0x2dc569){var _0xfefb58=function(_0x57544d){while(--_0x57544d){_0x3736e0['push'](_0x3736e0['shift']());}};_0xfefb58(++_0x2dc569);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x3805e1,_0x5cdfcf){_0x3805e1=_0x3805e1-0x0;var _0x5131a0=_0x6b4e[_0x3805e1];return _0x5131a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6b4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe6b4('0x1'));var Mustache=require(_0xe6b4('0x2'));var util=require(_0xe6b4('0x3'));var path=require(_0xe6b4('0x4'));var sox=require(_0xe6b4('0x5'));var csv=require(_0xe6b4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6b4('0x7'));var _=require(_0xe6b4('0x8'));var squel=require(_0xe6b4('0x9'));var crypto=require(_0xe6b4('0xa'));var jsforce=require(_0xe6b4('0xb'));var deskjs=require(_0xe6b4('0xc'));var toCsv=require(_0xe6b4('0x6'));var querystring=require(_0xe6b4('0xd'));var Papa=require(_0xe6b4('0xe'));var Redis=require(_0xe6b4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe6b4('0x10'));var as=require(_0xe6b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe6b4('0x12'));var config=require(_0xe6b4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6b4('0x14'))['db'];config[_0xe6b4('0x15')]=_[_0xe6b4('0x16')](config[_0xe6b4('0x15')],{'host':_0xe6b4('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6b4('0x15')]));require(_0xe6b4('0x18'))[_0xe6b4('0x19')](socket);var jayson=require(_0xe6b4('0x1a'));var client=jayson['client'][_0xe6b4('0x1b')]({'port':0x232c});var client9002=jayson[_0xe6b4('0x1c')][_0xe6b4('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x42876a,_0x25ad62,_0x5ec51c,_0x3a64a5){return new BPromise(function(_0x2c9335,_0xa57f7){var _0x531f98=_0x3a64a5||client;return _0x531f98['request'](_0x42876a,_0x5ec51c)['then'](function(_0x3b5ce6){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x25ad62,_0xe6b4('0x1d'));logger['debug'](_0xe6b4('0x1e'),_0x25ad62,_0xe6b4('0x1d'),JSON[_0xe6b4('0x1f')](_0x3b5ce6));if(_0x3b5ce6[_0xe6b4('0x20')]){if(_0x3b5ce6[_0xe6b4('0x20')][_0xe6b4('0x21')]===0x1f4){logger[_0xe6b4('0x20')](_0xe6b4('0x22'),_0x25ad62,_0x3b5ce6['error'][_0xe6b4('0x23')]);return _0xa57f7(_0x3b5ce6['error'][_0xe6b4('0x23')]);}logger[_0xe6b4('0x20')](_0xe6b4('0x22'),_0x25ad62,_0x3b5ce6[_0xe6b4('0x20')][_0xe6b4('0x23')]);return _0x2c9335(_0x3b5ce6['error']['message']);}else{logger['info'](_0xe6b4('0x22'),_0x25ad62,'request\x20sent');_0x2c9335(_0x3b5ce6[_0xe6b4('0x24')][_0xe6b4('0x23')]);}})[_0xe6b4('0x25')](function(_0x28bfef){logger['error'](_0xe6b4('0x22'),_0x25ad62,_0x28bfef);_0xa57f7(_0x28bfef);});});}function respondWithStatusCode(_0x3e7a90,_0x765e11){_0x765e11=_0x765e11||0xcc;return function(_0x513adb){if(_0x513adb){return _0x3e7a90[_0xe6b4('0x26')](_0x765e11);}return _0x3e7a90['status'](_0x765e11)[_0xe6b4('0x27')]();};}function respondWithResult(_0x45168a,_0x5a4e25){_0x5a4e25=_0x5a4e25||0xc8;return function(_0x332bbd){if(_0x332bbd){return _0x45168a[_0xe6b4('0x28')](_0x5a4e25)[_0xe6b4('0x29')](_0x332bbd);}};}function respondWithFilteredResult(_0x54b5db,_0x49bee2){return function(_0x383223){if(_0x383223){var _0x223239=typeof _0x49bee2[_0xe6b4('0x2a')]===_0xe6b4('0x2b')&&typeof _0x49bee2[_0xe6b4('0x2c')]===_0xe6b4('0x2b');var _0x3eb6f1=_0x383223[_0xe6b4('0x2d')];var _0x42f875=_0x223239?0x0:_0x49bee2['offset'];var _0x4f2c58=_0x223239?_0x383223[_0xe6b4('0x2d')]:_0x49bee2[_0xe6b4('0x2a')]+_0x49bee2['limit'];var _0x2e5874;if(_0x4f2c58>=_0x3eb6f1){_0x4f2c58=_0x3eb6f1;_0x2e5874=0xc8;}else{_0x2e5874=0xce;}_0x54b5db[_0xe6b4('0x28')](_0x2e5874);return _0x54b5db[_0xe6b4('0x2e')]('Content-Range',_0x42f875+'-'+_0x4f2c58+'/'+_0x3eb6f1)[_0xe6b4('0x29')](_0x383223);}return null;};}function patchUpdates(_0x3a9c18){return function(_0x74cbf6){try{jsonpatch[_0xe6b4('0x2f')](_0x74cbf6,_0x3a9c18,!![]);}catch(_0x8cb879){return BPromise[_0xe6b4('0x30')](_0x8cb879);}return _0x74cbf6[_0xe6b4('0x31')]();};}function saveUpdates(_0x47c1ba,_0x195cb1){return function(_0xd4dbb4){if(_0xd4dbb4){return _0xd4dbb4[_0xe6b4('0x32')](_0x47c1ba)['then'](function(_0x2fd6aa){return _0x2fd6aa;});}return null;};}function removeEntity(_0x222901,_0x5b7c79){return function(_0x28e3a8){if(_0x28e3a8){return _0x28e3a8[_0xe6b4('0x33')]()[_0xe6b4('0x34')](function(){var _0x46ea16=_0x28e3a8['get']({'plain':!![]});var _0x226441=_0xe6b4('0x35');return db[_0xe6b4('0x36')]['destroy']({'where':{'type':_0x226441,'resourceId':_0x46ea16['id']}})[_0xe6b4('0x34')](function(){return _0x28e3a8;});})['then'](function(){_0x222901[_0xe6b4('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c947c,_0x1ad1e7){return function(_0x13e85c){if(!_0x13e85c){_0x4c947c[_0xe6b4('0x26')](0x194);}return _0x13e85c;};}function handleError(_0x479d18,_0x40a548){_0x40a548=_0x40a548||0x1f4;return function(_0x30c13e){logger[_0xe6b4('0x20')](_0x30c13e[_0xe6b4('0x37')]);if(_0x30c13e[_0xe6b4('0x38')]){delete _0x30c13e[_0xe6b4('0x38')];}_0x479d18[_0xe6b4('0x28')](_0x40a548)[_0xe6b4('0x39')](_0x30c13e);};}exports[_0xe6b4('0x3a')]=function(_0x54a545,_0x37c96f){var _0x52025c={'include':[{'model':db[_0xe6b4('0x3b')],'as':_0xe6b4('0x3c')}]},_0x4ea01c={},_0x43c812={'count':0x0,'rows':[]};var _0xf5052e=_['map'](db[_0xe6b4('0x3d')][_0xe6b4('0x3e')],function(_0x2a6cb3){return{'name':_0x2a6cb3['fieldName'],'type':_0x2a6cb3[_0xe6b4('0x3f')][_0xe6b4('0x40')]};});_0x4ea01c[_0xe6b4('0x41')]=_[_0xe6b4('0x42')](_0xf5052e,_0xe6b4('0x38'));_0x4ea01c['query']=_[_0xe6b4('0x43')](_0x54a545['query']);_0x4ea01c[_0xe6b4('0x44')]=_[_0xe6b4('0x45')](_0x4ea01c[_0xe6b4('0x41')],_0x4ea01c['query']);_0x52025c[_0xe6b4('0x46')]=_['intersection'](_0x4ea01c[_0xe6b4('0x41')],qs[_0xe6b4('0x47')](_0x54a545[_0xe6b4('0x48')][_0xe6b4('0x47')]));_0x52025c[_0xe6b4('0x46')]=_0x52025c[_0xe6b4('0x46')][_0xe6b4('0x49')]?_0x52025c[_0xe6b4('0x46')]:_0x4ea01c['model'];if(!_0x54a545[_0xe6b4('0x48')]['hasOwnProperty'](_0xe6b4('0x4a'))){_0x52025c[_0xe6b4('0x2c')]=qs[_0xe6b4('0x2c')](_0x54a545[_0xe6b4('0x48')][_0xe6b4('0x2c')]);_0x52025c[_0xe6b4('0x2a')]=qs[_0xe6b4('0x2a')](_0x54a545['query']['offset']);}_0x52025c[_0xe6b4('0x4b')]=qs['sort'](_0x54a545[_0xe6b4('0x48')][_0xe6b4('0x4c')]);_0x52025c[_0xe6b4('0x4d')]=qs[_0xe6b4('0x44')](_[_0xe6b4('0x4e')](_0x54a545[_0xe6b4('0x48')],_0x4ea01c[_0xe6b4('0x44')]),_0xf5052e);if(_0x54a545[_0xe6b4('0x48')][_0xe6b4('0x4f')]){_0x52025c[_0xe6b4('0x4d')]=_['merge'](_0x52025c['where'],{'$or':_[_0xe6b4('0x42')](_0xf5052e,function(_0x431cf3){if(_0x431cf3[_0xe6b4('0x3f')]!=='VIRTUAL'){var _0x2beaf8={};_0x2beaf8[_0x431cf3[_0xe6b4('0x38')]]={'$like':'%'+_0x54a545[_0xe6b4('0x48')][_0xe6b4('0x4f')]+'%'};return _0x2beaf8;}})});}_0x52025c=_[_0xe6b4('0x50')]({},_0x52025c,_0x54a545[_0xe6b4('0x51')]);var _0x28c1cc={'where':_0x52025c[_0xe6b4('0x4d')]};return db[_0xe6b4('0x3d')][_0xe6b4('0x2d')](_0x28c1cc)[_0xe6b4('0x34')](function(_0x3e66a6){_0x43c812[_0xe6b4('0x2d')]=_0x3e66a6;if(_0x54a545[_0xe6b4('0x48')][_0xe6b4('0x52')]){_0x52025c[_0xe6b4('0x53')]=[{'all':!![]}];}return db[_0xe6b4('0x3d')][_0xe6b4('0x54')](_0x52025c);})[_0xe6b4('0x34')](function(_0x10dff8){_0x43c812['rows']=_0x10dff8;return _0x43c812;})['then'](respondWithFilteredResult(_0x37c96f,_0x52025c))[_0xe6b4('0x25')](handleError(_0x37c96f,null));};exports['show']=function(_0x2aa211,_0x1c815a){var _0xbca01f={'raw':![],'where':{'id':_0x2aa211[_0xe6b4('0x55')]['id']},'include':[{'model':db[_0xe6b4('0x3b')],'as':_0xe6b4('0x3c')}]},_0x56ceff={};_0x56ceff[_0xe6b4('0x41')]=_[_0xe6b4('0x43')](db[_0xe6b4('0x3d')][_0xe6b4('0x3e')]);_0x56ceff['query']=_[_0xe6b4('0x43')](_0x2aa211[_0xe6b4('0x48')]);_0x56ceff[_0xe6b4('0x44')]=_[_0xe6b4('0x45')](_0x56ceff[_0xe6b4('0x41')],_0x56ceff['query']);_0xbca01f[_0xe6b4('0x46')]=_[_0xe6b4('0x45')](_0x56ceff[_0xe6b4('0x41')],qs[_0xe6b4('0x47')](_0x2aa211[_0xe6b4('0x48')][_0xe6b4('0x47')]));_0xbca01f[_0xe6b4('0x46')]=_0xbca01f[_0xe6b4('0x46')][_0xe6b4('0x49')]?_0xbca01f['attributes']:_0x56ceff['model'];if(_0x2aa211[_0xe6b4('0x48')]['includeAll']){_0xbca01f[_0xe6b4('0x53')]=[{'all':!![]}];}_0xbca01f=_['merge']({},_0xbca01f,_0x2aa211['options']);return db[_0xe6b4('0x3d')][_0xe6b4('0x56')](_0xbca01f)[_0xe6b4('0x34')](handleEntityNotFound(_0x1c815a,null))[_0xe6b4('0x34')](respondWithResult(_0x1c815a,null))[_0xe6b4('0x25')](handleError(_0x1c815a,null));};exports['create']=function(_0x3bd8f0,_0x123933){return db[_0xe6b4('0x3d')][_0xe6b4('0x57')](_0x3bd8f0['body'],{})['then'](function(_0x2dcd61){var _0x5f31f6=_0x3bd8f0['user'][_0xe6b4('0x58')]({'plain':!![]});if(!_0x5f31f6)throw new Error(_0xe6b4('0x59'));if(_0x5f31f6[_0xe6b4('0x5a')]===_0xe6b4('0x5b')){var _0x2ca8b4=_0x2dcd61[_0xe6b4('0x58')]({'plain':!![]});var _0x3ea085=_0xe6b4('0x35');return db[_0xe6b4('0x5c')][_0xe6b4('0x56')]({'where':{'name':_0x3ea085,'userProfileId':_0x5f31f6[_0xe6b4('0x5d')]},'raw':!![]})[_0xe6b4('0x34')](function(_0x1ba86c){if(_0x1ba86c&&_0x1ba86c[_0xe6b4('0x5e')]===0x0){return db[_0xe6b4('0x36')][_0xe6b4('0x57')]({'name':_0x2ca8b4['name'],'resourceId':_0x2ca8b4['id'],'type':_0x1ba86c[_0xe6b4('0x38')],'sectionId':_0x1ba86c['id']},{})[_0xe6b4('0x34')](function(){return _0x2dcd61;});}else{return _0x2dcd61;}})[_0xe6b4('0x25')](function(_0x584202){logger[_0xe6b4('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x584202);throw _0x584202;});}return _0x2dcd61;})[_0xe6b4('0x34')](respondWithResult(_0x123933,0xc9))[_0xe6b4('0x25')](handleError(_0x123933,null));};exports[_0xe6b4('0x32')]=function(_0x401f79,_0x1e48cb){if(_0x401f79[_0xe6b4('0x5f')]['id']){delete _0x401f79[_0xe6b4('0x5f')]['id'];}return db[_0xe6b4('0x3d')]['find']({'where':{'id':_0x401f79['params']['id']},'include':[{'model':db[_0xe6b4('0x3b')],'as':_0xe6b4('0x3c')}]})[_0xe6b4('0x34')](handleEntityNotFound(_0x1e48cb,null))['then'](saveUpdates(_0x401f79[_0xe6b4('0x5f')],null))[_0xe6b4('0x34')](respondWithResult(_0x1e48cb,null))[_0xe6b4('0x25')](handleError(_0x1e48cb,null));};exports['destroy']=function(_0x251524,_0x542389){return db[_0xe6b4('0x3d')][_0xe6b4('0x56')]({'where':{'id':_0x251524['params']['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0x542389,null))['then'](removeEntity(_0x542389,null))[_0xe6b4('0x25')](handleError(_0x542389,null));};exports[_0xe6b4('0x60')]=function(_0x58585f,_0x116848){return db['OpenchannelAccount'][_0xe6b4('0x60')]()[_0xe6b4('0x34')](respondWithResult(_0x116848,null))[_0xe6b4('0x25')](handleError(_0x116848,null));};exports[_0xe6b4('0x61')]=function(_0x4b9565,_0x2a1b77,_0x2d9e45){if(_0x4b9565['body']['id']){delete _0x4b9565[_0xe6b4('0x5f')]['id'];}return db[_0xe6b4('0x3d')][_0xe6b4('0x56')]({'where':{'id':_0x4b9565[_0xe6b4('0x55')]['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0x2a1b77,null))[_0xe6b4('0x34')](function(_0x48349c){if(_0x48349c){_0x4b9565['body'][_0xe6b4('0x62')]=_0x48349c['id'];return db[_0xe6b4('0x63')][_0xe6b4('0x57')](_0x4b9565['body']);}})[_0xe6b4('0x34')](respondWithResult(_0x2a1b77,null))[_0xe6b4('0x25')](handleError(_0x2a1b77,null));};exports['getDispositions']=function(_0x4fb066,_0x4d5707,_0x12882e){var _0x5d84af={'raw':![],'where':{}};var _0x4b008d={};var _0x9f665d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe6b4('0x64')]({'where':{'id':_0x4fb066['params']['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0x4d5707,null))[_0xe6b4('0x34')](function(_0x29cf9b){if(_0x29cf9b){_0x4b008d[_0xe6b4('0x41')]=_[_0xe6b4('0x43')](db[_0xe6b4('0x63')][_0xe6b4('0x3e')]);_0x4b008d[_0xe6b4('0x48')]=_[_0xe6b4('0x43')](_0x4fb066[_0xe6b4('0x48')]);_0x4b008d['filters']=_[_0xe6b4('0x45')](_0x4b008d['model'],_0x4b008d[_0xe6b4('0x48')]);_0x5d84af[_0xe6b4('0x46')]=_[_0xe6b4('0x45')](_0x4b008d['model'],qs[_0xe6b4('0x47')](_0x4fb066[_0xe6b4('0x48')][_0xe6b4('0x47')]));_0x5d84af['attributes']=_0x5d84af[_0xe6b4('0x46')]['length']?_0x5d84af[_0xe6b4('0x46')]:_0x4b008d[_0xe6b4('0x41')];if(!_0x4fb066[_0xe6b4('0x48')][_0xe6b4('0x65')](_0xe6b4('0x4a'))){_0x5d84af[_0xe6b4('0x2c')]=qs[_0xe6b4('0x2c')](_0x4fb066['query'][_0xe6b4('0x2c')]);_0x5d84af[_0xe6b4('0x2a')]=qs[_0xe6b4('0x2a')](_0x4fb066[_0xe6b4('0x48')]['offset']);}_0x5d84af[_0xe6b4('0x4b')]=qs['sort'](_0x4fb066['query'][_0xe6b4('0x4c')]);_0x5d84af[_0xe6b4('0x4d')]=qs[_0xe6b4('0x44')](_['pick'](_0x4fb066[_0xe6b4('0x48')],_0x4b008d[_0xe6b4('0x44')]));_0x5d84af[_0xe6b4('0x4d')][_0xe6b4('0x62')]=_0x29cf9b['id'];if(_0x4fb066['query'][_0xe6b4('0x4f')]){_0x5d84af[_0xe6b4('0x4d')]=_[_0xe6b4('0x50')](_0x5d84af[_0xe6b4('0x4d')],{'$or':_['map'](_0x5d84af[_0xe6b4('0x46')],function(_0x53c0fb){var _0x5e6d9b={};_0x5e6d9b[_0x53c0fb]={'$like':'%'+_0x4fb066[_0xe6b4('0x48')][_0xe6b4('0x4f')]+'%'};return _0x5e6d9b;})});}_0x5d84af=_[_0xe6b4('0x50')]({},_0x5d84af,_0x4fb066[_0xe6b4('0x51')]);return db[_0xe6b4('0x63')][_0xe6b4('0x2d')]({'where':_0x5d84af[_0xe6b4('0x4d')]})[_0xe6b4('0x34')](function(_0x5374b8){_0x9f665d[_0xe6b4('0x2d')]=_0x5374b8;if(_0x4fb066[_0xe6b4('0x48')][_0xe6b4('0x52')]){_0x5d84af['include']=[{'all':!![]}];}return db[_0xe6b4('0x63')][_0xe6b4('0x54')](_0x5d84af);})[_0xe6b4('0x34')](function(_0x57016d){_0x9f665d[_0xe6b4('0x66')]=_0x57016d;return _0x9f665d;});}})[_0xe6b4('0x34')](respondWithFilteredResult(_0x4d5707,_0x5d84af))[_0xe6b4('0x25')](handleError(_0x4d5707,null));};exports[_0xe6b4('0x67')]=function(_0x31744e,_0x3d1656,_0x2829e8){return db[_0xe6b4('0x3d')][_0xe6b4('0x56')]({'where':{'id':_0x31744e[_0xe6b4('0x55')]['id']}})['then'](handleEntityNotFound(_0x3d1656,null))[_0xe6b4('0x34')](function(_0x28326f){if(_0x28326f){return _0x28326f['removeDispositions'](_0x31744e['query'][_0xe6b4('0x68')]);}})[_0xe6b4('0x34')](respondWithStatusCode(_0x3d1656,null))[_0xe6b4('0x25')](handleError(_0x3d1656,null));};exports[_0xe6b4('0x69')]=function(_0x39d664,_0x5e2d80,_0xb2d07e){if(_0x39d664['body']['id']){delete _0x39d664['body']['id'];}return db['OpenchannelAccount'][_0xe6b4('0x56')]({'where':{'id':_0x39d664['params']['id']}})['then'](handleEntityNotFound(_0x5e2d80,null))[_0xe6b4('0x34')](function(_0x143052){if(_0x143052){_0x39d664[_0xe6b4('0x5f')]['OpenchannelAccountId']=_0x143052['id'];return db[_0xe6b4('0x6a')]['create'](_0x39d664['body']);}})[_0xe6b4('0x34')](respondWithResult(_0x5e2d80,null))['catch'](handleError(_0x5e2d80,null));};exports[_0xe6b4('0x6b')]=function(_0x3fb651,_0xa3e7ad,_0x5c81ee){var _0x2c9ade={'raw':![],'where':{}};var _0x5a8185={};var _0x5462c5={'count':0x0,'rows':[]};return db[_0xe6b4('0x3d')][_0xe6b4('0x64')]({'where':{'id':_0x3fb651['params']['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0xa3e7ad,null))['then'](function(_0x4cb946){if(_0x4cb946){_0x5a8185[_0xe6b4('0x41')]=_['keys'](db['CannedAnswer'][_0xe6b4('0x3e')]);_0x5a8185[_0xe6b4('0x48')]=_[_0xe6b4('0x43')](_0x3fb651['query']);_0x5a8185[_0xe6b4('0x44')]=_[_0xe6b4('0x45')](_0x5a8185[_0xe6b4('0x41')],_0x5a8185[_0xe6b4('0x48')]);_0x2c9ade[_0xe6b4('0x46')]=_['intersection'](_0x5a8185[_0xe6b4('0x41')],qs[_0xe6b4('0x47')](_0x3fb651[_0xe6b4('0x48')][_0xe6b4('0x47')]));_0x2c9ade['attributes']=_0x2c9ade[_0xe6b4('0x46')][_0xe6b4('0x49')]?_0x2c9ade[_0xe6b4('0x46')]:_0x5a8185[_0xe6b4('0x41')];if(!_0x3fb651['query'][_0xe6b4('0x65')](_0xe6b4('0x4a'))){_0x2c9ade[_0xe6b4('0x2c')]=qs[_0xe6b4('0x2c')](_0x3fb651[_0xe6b4('0x48')][_0xe6b4('0x2c')]);_0x2c9ade[_0xe6b4('0x2a')]=qs[_0xe6b4('0x2a')](_0x3fb651[_0xe6b4('0x48')][_0xe6b4('0x2a')]);}_0x2c9ade['order']=qs[_0xe6b4('0x4c')](_0x3fb651[_0xe6b4('0x48')][_0xe6b4('0x4c')]);_0x2c9ade[_0xe6b4('0x4d')]=qs[_0xe6b4('0x44')](_[_0xe6b4('0x4e')](_0x3fb651['query'],_0x5a8185['filters']));_0x2c9ade['where'][_0xe6b4('0x62')]=_0x4cb946['id'];if(_0x3fb651[_0xe6b4('0x48')]['filter']){_0x2c9ade['where']=_[_0xe6b4('0x50')](_0x2c9ade[_0xe6b4('0x4d')],{'$or':_['map'](_0x2c9ade[_0xe6b4('0x46')],function(_0xcebae5){var _0x3178c6={};_0x3178c6[_0xcebae5]={'$like':'%'+_0x3fb651['query'][_0xe6b4('0x4f')]+'%'};return _0x3178c6;})});}_0x2c9ade=_[_0xe6b4('0x50')]({},_0x2c9ade,_0x3fb651[_0xe6b4('0x51')]);return db[_0xe6b4('0x6a')][_0xe6b4('0x2d')]({'where':_0x2c9ade[_0xe6b4('0x4d')]})[_0xe6b4('0x34')](function(_0xa319da){_0x5462c5['count']=_0xa319da;if(_0x3fb651[_0xe6b4('0x48')][_0xe6b4('0x52')]){_0x2c9ade[_0xe6b4('0x53')]=[{'all':!![]}];}return db[_0xe6b4('0x6a')][_0xe6b4('0x54')](_0x2c9ade);})[_0xe6b4('0x34')](function(_0x12fde8){_0x5462c5[_0xe6b4('0x66')]=_0x12fde8;return _0x5462c5;});}})[_0xe6b4('0x34')](respondWithFilteredResult(_0xa3e7ad,_0x2c9ade))[_0xe6b4('0x25')](handleError(_0xa3e7ad,null));};exports['removeAnswers']=function(_0x2c4024,_0x4a7b7e,_0x1d13c2){return db['OpenchannelAccount']['find']({'where':{'id':_0x2c4024[_0xe6b4('0x55')]['id']}})['then'](handleEntityNotFound(_0x4a7b7e,null))[_0xe6b4('0x34')](function(_0x50ac0b){if(_0x50ac0b){return _0x50ac0b[_0xe6b4('0x6c')](_0x2c4024['query']['ids']);}})['then'](respondWithStatusCode(_0x4a7b7e,null))['catch'](handleError(_0x4a7b7e,null));};exports['notify']=function(_0x5c1e4d,_0x358356,_0x54dbbb){var _0x241eda={'body':_0x5c1e4d[_0xe6b4('0x5f')],'channel':_0xe6b4('0x6d')};var _0x413a03=[];var _0x210cc0=[];var _0x4ba4f0={};var _0x1666f5=![];return db['CmContact']['describe']()[_0xe6b4('0x34')](function(_0x3a86b4){if(!_0x3a86b4){throw new db[(_0xe6b4('0x6e'))]['ValidationError'](_0xe6b4('0x6f'));}_0x413a03=_[_0xe6b4('0x70')](_[_0xe6b4('0x43')](_0x3a86b4),['createdAt',_0xe6b4('0x71')]);_0x210cc0=_['difference'](_[_0xe6b4('0x43')](_0x3a86b4),[_0xe6b4('0x72'),_0xe6b4('0x71'),_0xe6b4('0x73'),_0xe6b4('0x74')]);if(_0x5c1e4d['body']['id']){delete _0x5c1e4d[_0xe6b4('0x5f')]['id'];}if(_['isNil'](_0x5c1e4d['body']['from'])){throw new db[(_0xe6b4('0x6e'))][(_0xe6b4('0x75'))](_0xe6b4('0x76'));}if(_['isNil'](_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x5f')])||_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x5f')]===''){throw new db[(_0xe6b4('0x6e'))][(_0xe6b4('0x75'))](_0xe6b4('0x77'));}if(_[_0xe6b4('0x78')](_0x5c1e4d[_0xe6b4('0x5f')]['mapKey'])){throw new db[(_0xe6b4('0x6e'))]['ValidationError'](_0xe6b4('0x79')+_0x210cc0);}if(!_[_0xe6b4('0x7a')](_0x210cc0,_0x5c1e4d[_0xe6b4('0x5f')]['mapKey'])){throw new db[(_0xe6b4('0x6e'))][(_0xe6b4('0x75'))](_0xe6b4('0x7b')+_0x210cc0);}_0x4ba4f0[_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x7c')]]=_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x7d')];})[_0xe6b4('0x34')](function(){return db['OpenchannelAccount'][_0xe6b4('0x56')]({'where':{'id':_0x5c1e4d[_0xe6b4('0x55')]['id']},'include':[{'model':db[_0xe6b4('0x7e')],'as':_0xe6b4('0x7f'),'include':[{'model':db[_0xe6b4('0x80')],'as':_0xe6b4('0x81'),'where':_0x4ba4f0,'limit':0x1,'order':[[_0xe6b4('0x71'),_0xe6b4('0x82')]]}]},{'model':db[_0xe6b4('0x83')],'as':_0xe6b4('0x84')}]});})['then'](handleEntityNotFound(_0x358356,null))[_0xe6b4('0x34')](function(_0x1772bb){if(_0x1772bb&&_0x1772bb[_0xe6b4('0x7f')]){_0x241eda['account']=_0x1772bb;_0x241eda[_0xe6b4('0x85')]=_0x1772bb['Applications'];_0x241eda[_0xe6b4('0x86')]=_0x1772bb[_0xe6b4('0x7f')];_0x241eda['applications']=_[_0xe6b4('0x87')](_0x241eda[_0xe6b4('0x85')],[_0xe6b4('0x88')],[_0xe6b4('0x89')]);if(_0x241eda[_0xe6b4('0x8a')][_0xe6b4('0x84')]){delete _0x241eda[_0xe6b4('0x8a')]['Applications'];}if(_0x241eda[_0xe6b4('0x8a')]['List']&&_0x241eda[_0xe6b4('0x8a')][_0xe6b4('0x7f')][_0xe6b4('0x81')][_0xe6b4('0x49')]){return _0x241eda[_0xe6b4('0x8a')][_0xe6b4('0x7f')][_0xe6b4('0x81')][0x0];}var _0x475cb0=_[_0xe6b4('0x16')](_0x5c1e4d[_0xe6b4('0x5f')],{'firstName':_0x5c1e4d['body'][_0xe6b4('0x7d')],'ListId':_0x1772bb[_0xe6b4('0x74')]});_0x475cb0[_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x7c')]]=_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x7d')];return db[_0xe6b4('0x80')][_0xe6b4('0x57')](_0x475cb0,{'fields':_0x413a03,'raw':!![]});}})[_0xe6b4('0x34')](handleEntityNotFound(_0x358356,null))['then'](function(_0x25b191){_0x241eda[_0xe6b4('0x8b')]=_0x25b191;if(_0x25b191){var _0x2d47bd={'ContactId':_0x25b191['id'],'OpenchannelAccountId':_0x5c1e4d[_0xe6b4('0x55')]['id'],'from':(_0x25b191['firstName']||'')+'\x20'+(_0x25b191[_0xe6b4('0x8c')]||'')};var _0x391771={'OpenchannelAccountId':_0x5c1e4d[_0xe6b4('0x55')]['id'],'closed':![]};if(_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x8d')]){_0x391771[_0xe6b4('0x8d')]=_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x8d')];return db['OpenchannelInteraction'][_0xe6b4('0x56')]({'where':_0x391771})['then'](function(_0xf05373){if(_0xf05373){return[_0xf05373,![]];}_0x2d47bd[_0xe6b4('0x8d')]=_0x5c1e4d[_0xe6b4('0x5f')]['threadId'];_0x2d47bd['externalUrl']=_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x8e')];return db[_0xe6b4('0x8f')]['create'](_0x2d47bd)['then'](function(_0x12abbf){return[_0x12abbf,!![]];});});}else{_0x391771[_0xe6b4('0x8d')]=null;}_0x391771['ContactId']=_0x25b191['id'];return db[_0xe6b4('0x8f')][_0xe6b4('0x56')]({'where':_0x391771})[_0xe6b4('0x34')](function(_0x16e73c){if(_0x16e73c){return[_0x16e73c,![]];}return db[_0xe6b4('0x8f')][_0xe6b4('0x57')](_0x2d47bd)[_0xe6b4('0x34')](function(_0x496a36){return[_0x496a36,!![]];});});}})[_0xe6b4('0x90')](function(_0x48aefe,_0x57e126){if(_0x48aefe){_0x1666f5=_0x57e126;if(!_0x57e126){var _0x8645fc={'from':(_0x241eda[_0xe6b4('0x8b')]['firstName']||'')+'\x20'+(_0x241eda[_0xe6b4('0x8b')][_0xe6b4('0x8c')]||'')};if(_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x8d')]&&_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x91')]&&_0x5c1e4d['body'][_0xe6b4('0x8d')]!=_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x91')]){_0x8645fc[_0xe6b4('0x8d')]=_0x5c1e4d[_0xe6b4('0x5f')][_0xe6b4('0x91')];}return _0x48aefe[_0xe6b4('0x32')](_0x8645fc);}else{return _0x48aefe;}}})[_0xe6b4('0x34')](function(_0x1a455d){_0x241eda['interaction']=_0x1a455d[_0xe6b4('0x58')]({'plain':!![]});_0x241eda['interaction'][_0xe6b4('0x92')]=_0x1666f5;if(_0x241eda['interaction']['created']){if(_0x241eda['account']['autoclose']){_0x241eda[_0xe6b4('0x85')][_0xe6b4('0x93')]({'id':0x0,'priority':_0x241eda['applications'][_0xe6b4('0x49')]+0x1,'app':'close','appdata':_0xe6b4('0x94'),'interval':_0xe6b4('0x95')});}}return db['OpenchannelMessage']['create']({'body':_0x5c1e4d['body']['body'],'OpenchannelAccountId':_0x5c1e4d['params']['id'],'OpenchannelInteractionId':_0x1a455d['id'],'direction':'in','ContactId':_0x241eda[_0xe6b4('0x8b')]['id'],'AttachmentId':_0x5c1e4d['body'][_0xe6b4('0x96')]});})[_0xe6b4('0x34')](function(_0x10d8c4){_0x241eda['message']=_0x10d8c4;if(!_0x241eda['interaction'][_0xe6b4('0x97')])return;return db[_0xe6b4('0x98')][_0xe6b4('0x56')]({'attributes':['id','name'],'where':{'id':_0x241eda['interaction'][_0xe6b4('0x97')]}});})[_0xe6b4('0x34')](function(_0x84ba0f){if(_0x84ba0f){_0x241eda[_0xe6b4('0x85')][_0xe6b4('0x99')]({'id':0x0,'priority':0x0,'app':_0xe6b4('0x9a'),'appdata':_0x84ba0f[_0xe6b4('0x38')]+','+(_0x241eda[_0xe6b4('0x8a')][_0xe6b4('0x9b')]||0xa),'interval':'*,*,*,*'});}if(!_0x241eda['interaction'][_0xe6b4('0x9c')])return;return db[_0xe6b4('0x9d')][_0xe6b4('0x56')]({'attributes':['id',_0xe6b4('0x38')],'where':{'id':_0x241eda['interaction'][_0xe6b4('0x9c')]}});})[_0xe6b4('0x34')](function(_0x4e17ef){if(_0x4e17ef){_0x241eda['applications'][_0xe6b4('0x99')]({'id':0x0,'priority':0x1,'app':_0xe6b4('0x9e'),'appdata':_0x4e17ef[_0xe6b4('0x38')]+','+(_0x241eda[_0xe6b4('0x8a')]['waitForTheAssignedQueue']||0x12c),'interval':_0xe6b4('0x95')});}return respondWithRpcPromise('Start',_0xe6b4('0x9f'),_0x241eda);})[_0xe6b4('0x34')](function(_0x57db81){respondWithRpcPromise(_0xe6b4('0xa0'),_0xe6b4('0xa0'),{'event':'notify','message':_0x57db81},client9002);return _0x57db81;})[_0xe6b4('0x34')](respondWithResult(_0x358356,null))[_0xe6b4('0x25')](handleError(_0x358356,null));};exports[_0xe6b4('0xa1')]=function(_0x4543a5,_0x3a33af){var _0x5d3901=_0x4543a5[_0xe6b4('0x55')]['id'];var _0x38cbfc=_0x4543a5[_0xe6b4('0x5f')];var _0xb739cb=0xc8;var _0x4b7cbf=null;return db[_0xe6b4('0xa2')]['transaction']({'isolationLevel':db['sequelize'][_0xe6b4('0xa3')][_0xe6b4('0xa4')][_0xe6b4('0xa5')]},function(_0xdbf3bc){return db[_0xe6b4('0x3d')][_0xe6b4('0x64')]({'where':{'id':_0x5d3901},'transaction':_0xdbf3bc})[_0xe6b4('0x34')](function(_0x2be308){if(_0x2be308){return db[_0xe6b4('0x83')][_0xe6b4('0x33')]({'where':{'OpenchannelAccountId':_0x5d3901},'transaction':_0xdbf3bc})[_0xe6b4('0x34')](function(){var _0x276a29=_[_0xe6b4('0x42')](_0x38cbfc,function(_0x26fbc3){_0x26fbc3[_0xe6b4('0x62')]=_0x5d3901;return _0x26fbc3;});return db['OpenchannelApplication']['bulkCreate'](_0x276a29,{'transaction':_0xdbf3bc});});}else{_0xb739cb=0x194;_0x4b7cbf=[];}});})[_0xe6b4('0x34')](function(){if(_0xb739cb!==0x194){return db['OpenchannelApplication'][_0xe6b4('0xa6')]({'where':{'OpenchannelAccountId':_0x5d3901},'order':_0xe6b4('0x88')})['then'](function(_0x56464b){_0x4b7cbf=_0x56464b;});}})[_0xe6b4('0x25')](function(_0x22ca77){_0xb739cb=0x1f4;logger[_0xe6b4('0x20')](_0x22ca77[_0xe6b4('0x37')]);if(_0x22ca77[_0xe6b4('0x38')]){delete _0x22ca77[_0xe6b4('0x38')];}_0x4b7cbf=_0x22ca77;})['finally'](function(){if(_0x4b7cbf===null){_0x3a33af[_0xe6b4('0x26')](_0xb739cb);}else{if(_0xb739cb===0x1f4){_0x3a33af[_0xe6b4('0x28')](_0xb739cb)['send'](_0x4b7cbf);}else{_0x3a33af[_0xe6b4('0x28')](_0xb739cb)[_0xe6b4('0x29')](_0x4b7cbf);}}});};exports[_0xe6b4('0xa7')]=function(_0x2bd285,_0x5dc7ad,_0x1ee318){var _0x185259={};var _0x277d84={};var _0x11f9cc;var _0x52e28b;return db[_0xe6b4('0x3d')]['findOne']({'where':{'id':_0x2bd285[_0xe6b4('0x55')]['id']}})['then'](handleEntityNotFound(_0x5dc7ad,null))[_0xe6b4('0x34')](function(_0x45a574){if(_0x45a574){_0x11f9cc=_0x45a574;_0x277d84['model']=_['keys'](db[_0xe6b4('0x83')][_0xe6b4('0x3e')]);_0x277d84[_0xe6b4('0x48')]=_[_0xe6b4('0x43')](_0x2bd285['query']);_0x277d84['filters']=_[_0xe6b4('0x45')](_0x277d84[_0xe6b4('0x41')],_0x277d84[_0xe6b4('0x48')]);_0x185259[_0xe6b4('0x46')]=_['intersection'](_0x277d84['model'],qs[_0xe6b4('0x47')](_0x2bd285['query'][_0xe6b4('0x47')]));_0x185259[_0xe6b4('0x46')]=_0x185259[_0xe6b4('0x46')][_0xe6b4('0x49')]?_0x185259[_0xe6b4('0x46')]:_0x277d84['model'];_0x185259[_0xe6b4('0x4b')]=qs[_0xe6b4('0x4c')](_0x2bd285[_0xe6b4('0x48')][_0xe6b4('0x4c')]);_0x185259[_0xe6b4('0x4d')]=qs['filters'](_[_0xe6b4('0x4e')](_0x2bd285['query'],_0x277d84['filters']));if(_0x2bd285[_0xe6b4('0x48')][_0xe6b4('0x4f')]){_0x185259[_0xe6b4('0x4d')]=_[_0xe6b4('0x50')](_0x185259[_0xe6b4('0x4d')],{'$or':_[_0xe6b4('0x42')](_0x185259[_0xe6b4('0x46')],function(_0x1058e6){var _0x11166e={};_0x11166e[_0x1058e6]={'$like':'%'+_0x2bd285[_0xe6b4('0x48')][_0xe6b4('0x4f')]+'%'};return _0x11166e;})});}_0x185259=_[_0xe6b4('0x50')]({},_0x185259,_0x2bd285[_0xe6b4('0x51')]);return _0x11f9cc[_0xe6b4('0xa7')](_0x185259);}})[_0xe6b4('0x34')](function(_0xdda5ed){if(_0xdda5ed){_0x52e28b=_0xdda5ed['length'];if(!_0x2bd285[_0xe6b4('0x48')][_0xe6b4('0x65')]('nolimit')){_0x185259[_0xe6b4('0x2c')]=qs[_0xe6b4('0x2c')](_0x2bd285['query'][_0xe6b4('0x2c')]);_0x185259['offset']=qs[_0xe6b4('0x2a')](_0x2bd285[_0xe6b4('0x48')][_0xe6b4('0x2a')]);}return _0x11f9cc[_0xe6b4('0xa7')](_0x185259);}})['then'](function(_0x22297c){if(_0x22297c){return _0x22297c?{'count':_0x52e28b,'rows':_0x22297c}:null;}})[_0xe6b4('0x34')](respondWithResult(_0x5dc7ad,null))[_0xe6b4('0x25')](handleError(_0x5dc7ad,null));};exports[_0xe6b4('0xa8')]=function(_0x528ee6,_0x264ebc,_0x414f82){var _0xcf36cf={'raw':![],'where':{}};var _0x1a85e2={};var _0x1a63b3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe6b4('0x64')]({'where':{'id':_0x528ee6[_0xe6b4('0x55')]['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0x264ebc,null))[_0xe6b4('0x34')](function(_0x256d39){if(_0x256d39){_0x1a85e2[_0xe6b4('0x41')]=_[_0xe6b4('0x43')](db[_0xe6b4('0x8f')][_0xe6b4('0x3e')]);_0x1a85e2[_0xe6b4('0x48')]=_[_0xe6b4('0x43')](_0x528ee6[_0xe6b4('0x48')]);_0x1a85e2[_0xe6b4('0x44')]=_[_0xe6b4('0x45')](_0x1a85e2[_0xe6b4('0x41')],_0x1a85e2[_0xe6b4('0x48')]);_0xcf36cf[_0xe6b4('0x46')]=_[_0xe6b4('0x45')](_0x1a85e2[_0xe6b4('0x41')],qs[_0xe6b4('0x47')](_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0x47')]));_0xcf36cf['attributes']=_0xcf36cf['attributes'][_0xe6b4('0x49')]?_0xcf36cf[_0xe6b4('0x46')]:_0x1a85e2[_0xe6b4('0x41')];if(!_0x528ee6[_0xe6b4('0x48')]['hasOwnProperty'](_0xe6b4('0x4a'))){_0xcf36cf[_0xe6b4('0x2c')]=qs[_0xe6b4('0x2c')](_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0x2c')]);_0xcf36cf[_0xe6b4('0x2a')]=qs['offset'](_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0x2a')]);}_0xcf36cf[_0xe6b4('0x4b')]=qs['sort'](_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0x4c')]);_0xcf36cf[_0xe6b4('0x4d')]=qs[_0xe6b4('0x44')](_[_0xe6b4('0x4e')](_0x528ee6['query'],_0x1a85e2[_0xe6b4('0x44')]));_0xcf36cf[_0xe6b4('0x4d')][_0xe6b4('0x62')]=_0x256d39['id'];if(_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0x4f')]){_0xcf36cf[_0xe6b4('0x4d')]=_[_0xe6b4('0x50')](_0xcf36cf[_0xe6b4('0x4d')],{'$or':_['map'](_0xcf36cf['attributes'],function(_0x3d5fcf){var _0x523683={};_0x523683[_0x3d5fcf]={'$like':'%'+_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0x4f')]+'%'};return _0x523683;})});}_0xcf36cf=_[_0xe6b4('0x50')]({},_0xcf36cf,_0x528ee6[_0xe6b4('0x51')]);return db[_0xe6b4('0x8f')]['count']({'where':_0xcf36cf[_0xe6b4('0x4d')]})[_0xe6b4('0x34')](function(_0x5eb86f){_0x1a63b3[_0xe6b4('0x2d')]=_0x5eb86f;if(_0x528ee6[_0xe6b4('0x48')]['includeAll']){_0xcf36cf[_0xe6b4('0x53')]=[{'model':db[_0xe6b4('0x80')],'as':'Contact','required':![]},{'model':db[_0xe6b4('0x98')],'as':_0xe6b4('0xa9'),'attributes':[_0xe6b4('0x38'),_0xe6b4('0xaa'),_0xe6b4('0xab')],'required':![]},{'model':db['Tag'],'as':_0xe6b4('0xac'),'attributes':['id',_0xe6b4('0x38'),_0xe6b4('0xad')],'where':_0x528ee6[_0xe6b4('0x48')]['tag']?{'id':_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0xae')]}:undefined,'required':_0x528ee6[_0xe6b4('0x48')][_0xe6b4('0xae')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0xcf36cf);})[_0xe6b4('0x34')](function(_0x539ab9){_0x1a63b3[_0xe6b4('0x66')]=_0x539ab9;return _0x1a63b3;});}})[_0xe6b4('0x34')](respondWithFilteredResult(_0x264ebc,_0xcf36cf))[_0xe6b4('0x25')](handleError(_0x264ebc,null));};exports[_0xe6b4('0xaf')]=function(_0x460847,_0x2da711,_0x35e411){return db['OpenchannelAccount']['find']({'where':{'id':_0x460847[_0xe6b4('0x55')]['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0x2da711,null))['then'](function(_0x1025d8){if(_0x1025d8){return _0x1025d8[_0xe6b4('0xaf')](_0x460847[_0xe6b4('0x5f')]['ids'],_['omit'](_0x460847[_0xe6b4('0x5f')],[_0xe6b4('0x68'),'id'])||{})[_0xe6b4('0x90')](function(_0x69e07){for(var _0x3600c7=0x0;_0x3600c7<_0x460847['body'][_0xe6b4('0x68')]['length'];_0x3600c7+=0x1){socket[_0xe6b4('0xb0')](_0xe6b4('0xb1'),{'UserId':Number(_0x460847[_0xe6b4('0x5f')][_0xe6b4('0x68')][_0x3600c7]),'OpenchannelAccountId':Number(_0x460847[_0xe6b4('0x55')]['id'])});}return _0x69e07;});}})[_0xe6b4('0x34')](respondWithResult(_0x2da711,null))[_0xe6b4('0x25')](handleError(_0x2da711,null));};exports['removeAgents']=function(_0x139c4c,_0x30f6b6,_0xce3a9e){return db['OpenchannelAccount']['find']({'where':{'id':_0x139c4c[_0xe6b4('0x55')]['id']}})['then'](handleEntityNotFound(_0x30f6b6,null))[_0xe6b4('0x34')](function(_0x4be082){if(_0x4be082){return _0x4be082['removeAgents'](_0x139c4c['query']['ids'])[_0xe6b4('0x34')](function(){if(_[_0xe6b4('0xb2')](_0x139c4c['query']['ids'])){for(var _0x4f4e20=0x0;_0x4f4e20<_0x139c4c[_0xe6b4('0x48')][_0xe6b4('0x68')][_0xe6b4('0x49')];_0x4f4e20+=0x1){socket[_0xe6b4('0xb0')](_0xe6b4('0xb3'),{'UserId':Number(_0x139c4c['query'][_0xe6b4('0x68')][_0x4f4e20]),'OpenchannelAccountId':Number(_0x139c4c[_0xe6b4('0x55')]['id'])});}}else{socket[_0xe6b4('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x139c4c['query'][_0xe6b4('0x68')]),'OpenchannelAccountId':Number(_0x139c4c[_0xe6b4('0x55')]['id'])});}});}})[_0xe6b4('0x34')](respondWithStatusCode(_0x30f6b6,null))['catch'](handleError(_0x30f6b6,null));};exports[_0xe6b4('0xb4')]=function(_0x298b19,_0x25afd9,_0x560d6f){var _0x1deafe={};var _0x3c618f={};var _0x914600;var _0x363b75;return db[_0xe6b4('0x3d')][_0xe6b4('0x64')]({'where':{'id':_0x298b19[_0xe6b4('0x55')]['id']}})['then'](handleEntityNotFound(_0x25afd9,null))[_0xe6b4('0x34')](function(_0x31e0ab){if(_0x31e0ab){_0x914600=_0x31e0ab;_0x3c618f[_0xe6b4('0x41')]=_[_0xe6b4('0x43')](db['User'][_0xe6b4('0x3e')]);_0x3c618f[_0xe6b4('0x48')]=_[_0xe6b4('0x43')](_0x298b19[_0xe6b4('0x48')]);_0x3c618f[_0xe6b4('0x44')]=_[_0xe6b4('0x45')](_0x3c618f[_0xe6b4('0x41')],_0x3c618f[_0xe6b4('0x48')]);_0x1deafe[_0xe6b4('0x46')]=_[_0xe6b4('0x45')](_0x3c618f[_0xe6b4('0x41')],qs[_0xe6b4('0x47')](_0x298b19[_0xe6b4('0x48')][_0xe6b4('0x47')]));_0x1deafe[_0xe6b4('0x46')]=_0x1deafe[_0xe6b4('0x46')][_0xe6b4('0x49')]?_0x1deafe[_0xe6b4('0x46')]:_0x3c618f[_0xe6b4('0x41')];_0x1deafe[_0xe6b4('0x4b')]=qs[_0xe6b4('0x4c')](_0x298b19[_0xe6b4('0x48')][_0xe6b4('0x4c')]);_0x1deafe[_0xe6b4('0x4d')]=qs[_0xe6b4('0x44')](_[_0xe6b4('0x4e')](_0x298b19[_0xe6b4('0x48')],_0x3c618f[_0xe6b4('0x44')]));if(_0x298b19['query'][_0xe6b4('0x4f')]){_0x1deafe[_0xe6b4('0x4d')]=_[_0xe6b4('0x50')](_0x1deafe[_0xe6b4('0x4d')],{'$or':_[_0xe6b4('0x42')](_0x1deafe[_0xe6b4('0x46')],function(_0x16c9fe){var _0x3550cf={};_0x3550cf[_0x16c9fe]={'$like':'%'+_0x298b19[_0xe6b4('0x48')][_0xe6b4('0x4f')]+'%'};return _0x3550cf;})});}_0x1deafe=_['merge']({},_0x1deafe,_0x298b19['options']);return _0x914600[_0xe6b4('0xb4')](_0x1deafe);}})[_0xe6b4('0x34')](function(_0x2d5ae2){if(_0x2d5ae2){_0x363b75=_0x2d5ae2[_0xe6b4('0x49')];if(!_0x298b19[_0xe6b4('0x48')][_0xe6b4('0x65')]('nolimit')){_0x1deafe[_0xe6b4('0x2c')]=qs['limit'](_0x298b19[_0xe6b4('0x48')][_0xe6b4('0x2c')]);_0x1deafe[_0xe6b4('0x2a')]=qs['offset'](_0x298b19[_0xe6b4('0x48')][_0xe6b4('0x2a')]);}return _0x914600[_0xe6b4('0xb4')](_0x1deafe);}})[_0xe6b4('0x34')](function(_0x1329c2){if(_0x1329c2){return _0x1329c2?{'count':_0x363b75,'rows':_0x1329c2}:null;}})['then'](respondWithResult(_0x25afd9,null))[_0xe6b4('0x25')](handleError(_0x25afd9,null));};exports[_0xe6b4('0x39')]=function(_0x19ccd4,_0x25acf3,_0x951df9){var _0xd7f66f,_0x307b15,_0x42732d;if(_[_0xe6b4('0x78')](_0x19ccd4[_0xe6b4('0x5f')]['body'])||_0x19ccd4['body'][_0xe6b4('0x5f')]===''){throw new db['Sequelize'][(_0xe6b4('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe6b4('0x78')](_0x19ccd4['body']['to'])){}_0xd7f66f=_0x19ccd4[_0xe6b4('0x5f')]['to'];return db[_0xe6b4('0x3d')][_0xe6b4('0x64')]({'where':{'id':_0x19ccd4[_0xe6b4('0x55')]['id']}})[_0xe6b4('0x34')](handleEntityNotFound(_0x25acf3,null))[_0xe6b4('0x34')](function(_0x2efa31){if(_0x2efa31){return db['OpenchannelAccount'][_0xe6b4('0x56')]({'where':{'id':_0x2efa31['id']},'include':[{'model':db[_0xe6b4('0x7e')],'as':'List','include':[{'model':db[_0xe6b4('0x80')],'as':_0xe6b4('0x81'),'where':{[_0x2efa31[_0xe6b4('0x7c')]]:_0xd7f66f},'limit':0x1,'order':[['updatedAt',_0xe6b4('0x82')]]}]}]})['then'](handleEntityNotFound(_0x25acf3,null))[_0xe6b4('0x34')](function(_0x1fad6f){if(_0x1fad6f&&_0x1fad6f[_0xe6b4('0x7f')]){_0x307b15=_0x1fad6f[_0xe6b4('0x58')]({'plain':!![]});if(_0x307b15[_0xe6b4('0x7f')]&&_0x307b15[_0xe6b4('0x7f')]['Contacts']['length']){return _0x307b15[_0xe6b4('0x7f')][_0xe6b4('0x81')][0x0];}return db['CmContact'][_0xe6b4('0x57')](_[_0xe6b4('0x16')](_0x19ccd4[_0xe6b4('0x5f')],{'firstName':_0xd7f66f,[_0x1fad6f[_0xe6b4('0x7c')]]:_0xd7f66f,'phone':_0xd7f66f,'ListId':_0x307b15['ListId']}));}})[_0xe6b4('0x34')](handleEntityNotFound(_0x25acf3,null))[_0xe6b4('0x34')](function(_0x3ee1be){if(_0x3ee1be){_0x42732d=_0x3ee1be;return db[_0xe6b4('0x8f')]['find']({'where':{'ContactId':_0x42732d['id'],'closed':![],'OpenchannelAccountId':_0x307b15['id']}})[_0xe6b4('0x34')](function(_0x517f57){if(_0x517f57){return[_0x517f57,![]];}return db[_0xe6b4('0x8f')]['create']({'UserId':_0x19ccd4[_0xe6b4('0x5b')]['id'],'ContactId':_0x42732d['id'],'OpenchannelAccountId':_0x307b15['id'],'lastMsgDirection':_0xe6b4('0xb5'),'firstMsgDirection':_0xe6b4('0xb5'),'Messages':[_['merge'](_0x19ccd4[_0xe6b4('0x5f')],{'read':![],'body':_0x19ccd4[_0xe6b4('0x5f')][_0xe6b4('0x5f')],'OpenchannelAccountId':_0x307b15['id'],'UserId':_0x19ccd4['user']['id'],'ContactId':_0x42732d['id']})]},{'include':[{'model':db[_0xe6b4('0xb6')],'as':'Messages'}]})[_0xe6b4('0x34')](function(_0x50aa60){return[_0x50aa60,!![]];});});}})['spread'](function(_0x31824f,_0x173bfc){if(_0x173bfc){return _0x31824f;}return db[_0xe6b4('0xb6')]['create'](_['merge'](_0x19ccd4[_0xe6b4('0x5f')],{'read':![],'body':_0x19ccd4['body'][_0xe6b4('0x5f')],'OpenchannelAccountId':_0x307b15['id'],'OpenchannelInteractionId':_0x31824f['id'],'UserId':_0x19ccd4[_0xe6b4('0x5b')]['id'],'ContactId':_0x42732d['id']}))[_0xe6b4('0x34')](function(_0x4f40a0){_0x31824f[_0xe6b4('0xb7')][_0xe6b4('0xb8')]=[];_0x31824f[_0xe6b4('0xb7')][_0xe6b4('0xb8')][_0xe6b4('0x93')](_0x4f40a0['dataValues']);return _0x31824f;});});}})[_0xe6b4('0x34')](respondWithResult(_0x25acf3,null))[_0xe6b4('0x25')](handleError(_0x25acf3,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x5ddafe,_0x5646dd){var _0x7d2555=function(_0x22387a){while(--_0x22387a){_0x5ddafe['push'](_0x5ddafe['shift']());}};_0x7d2555(++_0x5646dd);}(_0x41bb,0xc5));var _0xb41b=function(_0x3e9b51,_0x146374){_0x3e9b51=_0x3e9b51-0x0;var _0x333349=_0x41bb[_0x3e9b51];return _0x333349;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x22a27b,_0x4f69fe){var _0x219c0d=function(_0x1c8427){while(--_0x1c8427){_0x22a27b['push'](_0x22a27b['shift']());}};_0x219c0d(++_0x4f69fe);}(_0x5b02,0xe9));var _0x25b0=function(_0x4a9baf,_0x49c1bd){_0x4a9baf=_0x4a9baf-0x0;var _0x471423=_0x5b02[_0x4a9baf];return _0x471423;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4f4057,_0x483729){var _0x497b0d=function(_0xdd17e0){while(--_0xdd17e0){_0x4f4057['push'](_0x4f4057['shift']());}};_0x497b0d(++_0x483729);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x574d7a,_0x4b7fed){var _0xa5609f=function(_0x40c2ee){while(--_0x40c2ee){_0x574d7a['push'](_0x574d7a['shift']());}};_0xa5609f(++_0x4b7fed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7462=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7462,0x165));var _0x2746=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x7462[_0x1d30a3];return _0x32bba1;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});config[_0x2746('0x9')]=_[_0x2746('0xa')](config[_0x2746('0x9')],{'host':_0x2746('0xb'),'port':0x18eb});var socket=require(_0x2746('0xc'))(new Redis(config['redis']));require(_0x2746('0xd'))[_0x2746('0xe')](socket);function respondWithRpcPromise(_0x4f9eb7,_0x19bec3,_0x1a6329){return new BPromise(function(_0x2ea416,_0x5aef7e){return client[_0x2746('0xf')](_0x4f9eb7,_0x1a6329)[_0x2746('0x10')](function(_0x1a6d97){logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));logger[_0x2746('0x14')](_0x2746('0x15'),_0x19bec3,_0x2746('0x13'),JSON[_0x2746('0x16')](_0x1a6d97));if(_0x1a6d97[_0x2746('0x17')]){if(_0x1a6d97['error']['code']===0x1f4){logger[_0x2746('0x17')](_0x2746('0x12'),_0x19bec3,_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);return _0x5aef7e(_0x1a6d97['error'][_0x2746('0x18')]);}logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x1a6d97['error'][_0x2746('0x18')]);return _0x2ea416(_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);}else{logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));_0x2ea416(_0x1a6d97[_0x2746('0x19')][_0x2746('0x18')]);}})[_0x2746('0x1a')](function(_0x509879){logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x509879);_0x5aef7e(_0x509879);});});}
\ No newline at end of file
+var _0xb58b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','util','moment','bluebird'];(function(_0x1a8f8d,_0xc6e997){var _0x55781b=function(_0x1b71cc){while(--_0x1b71cc){_0x1a8f8d['push'](_0x1a8f8d['shift']());}};_0x55781b(++_0xc6e997);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3fa404,_0x3955ca){_0x3fa404=_0x3fa404-0x0;var _0x578d90=_0xb58b[_0x3fa404];return _0x578d90;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});config[_0xbb58('0x9')]=_[_0xbb58('0xa')](config[_0xbb58('0x9')],{'host':_0xbb58('0xb'),'port':0x18eb});var socket=require(_0xbb58('0xc'))(new Redis(config[_0xbb58('0x9')]));require(_0xbb58('0xd'))[_0xbb58('0xe')](socket);function respondWithRpcPromise(_0x429e75,_0x261d00,_0x27f77f){return new BPromise(function(_0x4bb8c5,_0x80ab3a){return client['request'](_0x429e75,_0x27f77f)[_0xbb58('0xf')](function(_0x440392){logger[_0xbb58('0x10')](_0xbb58('0x11'),_0x261d00,'request\x20sent');logger[_0xbb58('0x12')](_0xbb58('0x13'),_0x261d00,'request\x20sent',JSON[_0xbb58('0x14')](_0x440392));if(_0x440392[_0xbb58('0x15')]){if(_0x440392[_0xbb58('0x15')][_0xbb58('0x16')]===0x1f4){logger[_0xbb58('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x261d00,_0x440392[_0xbb58('0x15')][_0xbb58('0x17')]);return _0x80ab3a(_0x440392['error']['message']);}logger[_0xbb58('0x15')](_0xbb58('0x11'),_0x261d00,_0x440392[_0xbb58('0x15')]['message']);return _0x4bb8c5(_0x440392['error']['message']);}else{logger['info'](_0xbb58('0x11'),_0x261d00,_0xbb58('0x18'));_0x4bb8c5(_0x440392['result'][_0xbb58('0x17')]);}})['catch'](function(_0x2cf892){logger[_0xbb58('0x15')](_0xbb58('0x11'),_0x261d00,_0x2cf892);_0x80ab3a(_0x2cf892);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1094=['openchannelAccount:','./openchannelAccount.events','save','update','emit','register','length'];(function(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0x1094,0x143));var _0x4109=function(_0x579baf,_0x4aaafa){_0x579baf=_0x579baf-0x0;var _0x4c601a=_0x1094[_0x579baf];return _0x4c601a;};'use strict';var OpenchannelAccountEvents=require(_0x4109('0x0'));var events=[_0x4109('0x1'),'remove',_0x4109('0x2')];function createListener(_0x52b156,_0x42557f){return function(_0x32d6c3){_0x42557f[_0x4109('0x3')](_0x52b156,_0x32d6c3);};}function removeListener(_0x181d79,_0x36e917){return function(){OpenchannelAccountEvents['removeListener'](_0x181d79,_0x36e917);};}exports[_0x4109('0x4')]=function(_0x12fdda){for(var _0x40e398=0x0,_0x36c3e9=events[_0x4109('0x5')];_0x40e398<_0x36c3e9;_0x40e398++){var _0x2c34f=events[_0x40e398];var _0x5512e8=createListener(_0x4109('0x6')+_0x2c34f,_0x12fdda);OpenchannelAccountEvents['on'](_0x2c34f,_0x5512e8);}};
\ No newline at end of file
+var _0x3ef0=['length','openchannelAccount:','./openchannelAccount.events','remove','emit','register'];(function(_0x43af80,_0x1a300e){var _0x26c0ea=function(_0x3fb0b6){while(--_0x3fb0b6){_0x43af80['push'](_0x43af80['shift']());}};_0x26c0ea(++_0x1a300e);}(_0x3ef0,0x19a));var _0x03ef=function(_0x2baa1b,_0x2a2ea3){_0x2baa1b=_0x2baa1b-0x0;var _0x3682bb=_0x3ef0[_0x2baa1b];return _0x3682bb;};'use strict';var OpenchannelAccountEvents=require(_0x03ef('0x0'));var events=['save',_0x03ef('0x1'),'update'];function createListener(_0x3ee9a3,_0x5367d2){return function(_0x2aa000){_0x5367d2[_0x03ef('0x2')](_0x3ee9a3,_0x2aa000);};}function removeListener(_0x321d93,_0x5298e7){return function(){OpenchannelAccountEvents['removeListener'](_0x321d93,_0x5298e7);};}exports[_0x03ef('0x3')]=function(_0xadf812){for(var _0x1ea0f9=0x0,_0x47e561=events[_0x03ef('0x4')];_0x1ea0f9<_0x47e561;_0x1ea0f9++){var _0x3c06ee=events[_0x1ea0f9];var _0x2d54e7=createListener(_0x03ef('0x5')+_0x3c06ee,_0xadf812);OpenchannelAccountEvents['on'](_0x3c06ee,_0x2d54e7);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a8a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','/:id','show','put','delete','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x3cd7d4,_0x3b1d6e){var _0x4d5822=function(_0x3aad97){while(--_0x3aad97){_0x3cd7d4['push'](_0x3cd7d4['shift']());}};_0x4d5822(++_0x3b1d6e);}(_0x9a8a,0x6b));var _0xa9a8=function(_0x2e99d3,_0x4054a3){_0x2e99d3=_0x2e99d3-0x0;var _0x160eff=_0x9a8a[_0x2e99d3];return _0x160eff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa9a8('0x0'));var timeout=require(_0xa9a8('0x1'));var express=require(_0xa9a8('0x2'));var router=express[_0xa9a8('0x3')]();var fs_extra=require(_0xa9a8('0x4'));var auth=require(_0xa9a8('0x5'));var interaction=require(_0xa9a8('0x6'));var config=require(_0xa9a8('0x7'));var controller=require(_0xa9a8('0x8'));router['get']('/',auth[_0xa9a8('0x9')](),controller['index']);router[_0xa9a8('0xa')](_0xa9a8('0xb'),auth[_0xa9a8('0x9')](),controller[_0xa9a8('0xc')]);router['post']('/',auth[_0xa9a8('0x9')](),controller['create']);router[_0xa9a8('0xd')](_0xa9a8('0xb'),auth[_0xa9a8('0x9')](),controller['update']);router[_0xa9a8('0xe')]('/:id',auth[_0xa9a8('0x9')](),controller['destroy']);module[_0xa9a8('0xf')]=router;
\ No newline at end of file
+var _0x79d9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2ac766,_0x514088){var _0x3b31c8=function(_0x2100b3){while(--_0x2100b3){_0x2ac766['push'](_0x2ac766['shift']());}};_0x3b31c8(++_0x514088);}(_0x79d9,0x79));var _0x979d=function(_0x3fa6da,_0x2578ee){_0x3fa6da=_0x3fa6da-0x0;var _0x122039=_0x79d9[_0x3fa6da];return _0x122039;};'use strict';var multer=require(_0x979d('0x0'));var util=require(_0x979d('0x1'));var path=require(_0x979d('0x2'));var timeout=require(_0x979d('0x3'));var express=require(_0x979d('0x4'));var router=express[_0x979d('0x5')]();var fs_extra=require(_0x979d('0x6'));var auth=require(_0x979d('0x7'));var interaction=require(_0x979d('0x8'));var config=require(_0x979d('0x9'));var controller=require(_0x979d('0xa'));router[_0x979d('0xb')]('/',auth[_0x979d('0xc')](),controller[_0x979d('0xd')]);router[_0x979d('0xb')](_0x979d('0xe'),auth[_0x979d('0xc')](),controller[_0x979d('0xf')]);router['post']('/',auth[_0x979d('0xc')](),controller[_0x979d('0x10')]);router['put']('/:id',auth[_0x979d('0xc')](),controller[_0x979d('0x11')]);router[_0x979d('0x12')](_0x979d('0xe'),auth['isAuthenticated'](),controller[_0x979d('0x13')]);module[_0x979d('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd55e=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd55e,0xdf));var _0xed55=function(_0x50c525,_0x3438af){_0x50c525=_0x50c525-0x0;var _0x2ac69a=_0xd55e[_0x50c525];return _0x2ac69a;};'use strict';var Sequelize=require(_0xed55('0x0'));module[_0xed55('0x1')]={'priority':{'type':Sequelize[_0xed55('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xed55('0x3')],'allowNull':![],'defaultValue':_0xed55('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xed55('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x8bd4=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x30973a,_0x16effb){var _0x16ee65=function(_0x317b69){while(--_0x317b69){_0x30973a['push'](_0x30973a['shift']());}};_0x16ee65(++_0x16effb);}(_0x8bd4,0x1d9));var _0x48bd=function(_0x3b46d3,_0x2eabab){_0x3b46d3=_0x3b46d3-0x0;var _0x2b7fec=_0x8bd4[_0x3b46d3];return _0x2b7fec;};'use strict';var Sequelize=require(_0x48bd('0x0'));module[_0x48bd('0x1')]={'priority':{'type':Sequelize[_0x48bd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x48bd('0x3')],'allowNull':![],'defaultValue':_0x48bd('0x4')},'appdata':{'type':Sequelize[_0x48bd('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x48bd('0x3')],'defaultValue':_0x48bd('0x6')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb446=['sort','filters','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','keys','include','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd3cf,_0x476713){var _0x32c550=function(_0x5a0394){while(--_0x5a0394){_0x3dd3cf['push'](_0x3dd3cf['shift']());}};_0x32c550(++_0x476713);}(_0xb446,0x127));var _0x6b44=function(_0x353a30,_0x50c68a){_0x353a30=_0x353a30-0x0;var _0x213161=_0xb446[_0x353a30];return _0x213161;};'use strict';var emlformat=require(_0x6b44('0x0'));var rimraf=require(_0x6b44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b44('0x2'));var rp=require(_0x6b44('0x3'));var moment=require(_0x6b44('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6b44('0x5'));var util=require(_0x6b44('0x6'));var path=require('path');var sox=require(_0x6b44('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b44('0x8'));var _=require(_0x6b44('0x9'));var squel=require(_0x6b44('0xa'));var crypto=require(_0x6b44('0xb'));var jsforce=require(_0x6b44('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b44('0xd'));var querystring=require(_0x6b44('0xe'));var Papa=require(_0x6b44('0xf'));var Redis=require(_0x6b44('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6b44('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b44('0x12'));var logger=require(_0x6b44('0x13'))(_0x6b44('0x14'));var utils=require('../../config/utils');var config=require(_0x6b44('0x15'));var licenseUtil=require(_0x6b44('0x16'));var db=require(_0x6b44('0x17'))['db'];function respondWithStatusCode(_0x57ce25,_0xce0535){_0xce0535=_0xce0535||0xcc;return function(_0x2b1aa8){if(_0x2b1aa8){return _0x57ce25[_0x6b44('0x18')](_0xce0535);}return _0x57ce25[_0x6b44('0x19')](_0xce0535)[_0x6b44('0x1a')]();};}function respondWithResult(_0x15510c,_0x1ad989){_0x1ad989=_0x1ad989||0xc8;return function(_0x4ee35c){if(_0x4ee35c){return _0x15510c[_0x6b44('0x19')](_0x1ad989)[_0x6b44('0x1b')](_0x4ee35c);}};}function respondWithFilteredResult(_0x24f7ef,_0x20a7e7){return function(_0x380dc3){if(_0x380dc3){var _0x34d02a=typeof _0x20a7e7[_0x6b44('0x1c')]===_0x6b44('0x1d')&&typeof _0x20a7e7[_0x6b44('0x1e')]===_0x6b44('0x1d');var _0x4d68ec=_0x380dc3['count'];var _0x37175b=_0x34d02a?0x0:_0x20a7e7[_0x6b44('0x1c')];var _0x41f76f=_0x34d02a?_0x380dc3[_0x6b44('0x1f')]:_0x20a7e7[_0x6b44('0x1c')]+_0x20a7e7[_0x6b44('0x1e')];var _0x344bba;if(_0x41f76f>=_0x4d68ec){_0x41f76f=_0x4d68ec;_0x344bba=0xc8;}else{_0x344bba=0xce;}_0x24f7ef['status'](_0x344bba);return _0x24f7ef['set']('Content-Range',_0x37175b+'-'+_0x41f76f+'/'+_0x4d68ec)[_0x6b44('0x1b')](_0x380dc3);}return null;};}function patchUpdates(_0x5eb68b){return function(_0x174275){try{jsonpatch['apply'](_0x174275,_0x5eb68b,!![]);}catch(_0x433225){return BPromise[_0x6b44('0x20')](_0x433225);}return _0x174275[_0x6b44('0x21')]();};}function saveUpdates(_0x5374b9,_0x4cc518){return function(_0x592899){if(_0x592899){return _0x592899[_0x6b44('0x22')](_0x5374b9)[_0x6b44('0x23')](function(_0x26d7c3){return _0x26d7c3;});}return null;};}function removeEntity(_0x3aaee5,_0x268e48){return function(_0x446c34){if(_0x446c34){return _0x446c34[_0x6b44('0x24')]()[_0x6b44('0x23')](function(){_0x3aaee5[_0x6b44('0x19')](0xcc)[_0x6b44('0x1a')]();});}};}function handleEntityNotFound(_0x37f58f,_0x21535d){return function(_0x7c2037){if(!_0x7c2037){_0x37f58f[_0x6b44('0x18')](0x194);}return _0x7c2037;};}function handleError(_0x1770da,_0xab3919){_0xab3919=_0xab3919||0x1f4;return function(_0x14e256){logger['error'](_0x14e256[_0x6b44('0x25')]);if(_0x14e256[_0x6b44('0x26')]){delete _0x14e256[_0x6b44('0x26')];}_0x1770da[_0x6b44('0x19')](_0xab3919)[_0x6b44('0x27')](_0x14e256);};}exports[_0x6b44('0x28')]=function(_0x4b8f46,_0x1158c4){var _0x1741e1={},_0x3d2de4={},_0x9594bd={'count':0x0,'rows':[]};var _0x16a4bf=_[_0x6b44('0x29')](db[_0x6b44('0x2a')][_0x6b44('0x2b')],function(_0x50252b){return{'name':_0x50252b[_0x6b44('0x2c')],'type':_0x50252b[_0x6b44('0x2d')][_0x6b44('0x2e')]};});_0x3d2de4[_0x6b44('0x2f')]=_[_0x6b44('0x29')](_0x16a4bf,_0x6b44('0x26'));_0x3d2de4[_0x6b44('0x30')]=_['keys'](_0x4b8f46[_0x6b44('0x30')]);_0x3d2de4['filters']=_[_0x6b44('0x31')](_0x3d2de4[_0x6b44('0x2f')],_0x3d2de4[_0x6b44('0x30')]);_0x1741e1[_0x6b44('0x32')]=_['intersection'](_0x3d2de4[_0x6b44('0x2f')],qs[_0x6b44('0x33')](_0x4b8f46[_0x6b44('0x30')]['fields']));_0x1741e1[_0x6b44('0x32')]=_0x1741e1[_0x6b44('0x32')][_0x6b44('0x34')]?_0x1741e1[_0x6b44('0x32')]:_0x3d2de4[_0x6b44('0x2f')];if(!_0x4b8f46['query'][_0x6b44('0x35')](_0x6b44('0x36'))){_0x1741e1[_0x6b44('0x1e')]=qs[_0x6b44('0x1e')](_0x4b8f46['query'][_0x6b44('0x1e')]);_0x1741e1[_0x6b44('0x1c')]=qs[_0x6b44('0x1c')](_0x4b8f46[_0x6b44('0x30')][_0x6b44('0x1c')]);}_0x1741e1['order']=qs[_0x6b44('0x37')](_0x4b8f46[_0x6b44('0x30')][_0x6b44('0x37')]);_0x1741e1['where']=qs[_0x6b44('0x38')](_['pick'](_0x4b8f46[_0x6b44('0x30')],_0x3d2de4[_0x6b44('0x38')]),_0x16a4bf);if(_0x4b8f46['query'][_0x6b44('0x39')]){_0x1741e1[_0x6b44('0x3a')]=_[_0x6b44('0x3b')](_0x1741e1[_0x6b44('0x3a')],{'$or':_[_0x6b44('0x29')](_0x16a4bf,function(_0x907bd7){if(_0x907bd7[_0x6b44('0x2d')]!==_0x6b44('0x3c')){var _0x23f6f9={};_0x23f6f9[_0x907bd7[_0x6b44('0x26')]]={'$like':'%'+_0x4b8f46['query'][_0x6b44('0x39')]+'%'};return _0x23f6f9;}})});}_0x1741e1=_[_0x6b44('0x3b')]({},_0x1741e1,_0x4b8f46['options']);var _0x5541af={'where':_0x1741e1[_0x6b44('0x3a')]};return db[_0x6b44('0x2a')][_0x6b44('0x1f')](_0x5541af)[_0x6b44('0x23')](function(_0x37f1dc){_0x9594bd[_0x6b44('0x1f')]=_0x37f1dc;if(_0x4b8f46['query'][_0x6b44('0x3d')]){_0x1741e1['include']=[{'all':!![]}];}return db[_0x6b44('0x2a')][_0x6b44('0x3e')](_0x1741e1);})[_0x6b44('0x23')](function(_0x5b0232){_0x9594bd[_0x6b44('0x3f')]=_0x5b0232;return _0x9594bd;})[_0x6b44('0x23')](respondWithFilteredResult(_0x1158c4,_0x1741e1))[_0x6b44('0x40')](handleError(_0x1158c4,null));};exports['show']=function(_0x2cb94d,_0x31f109){var _0x1f6588={'raw':!![],'where':{'id':_0x2cb94d[_0x6b44('0x41')]['id']}},_0x253c05={};_0x253c05[_0x6b44('0x2f')]=_['keys'](db[_0x6b44('0x2a')][_0x6b44('0x2b')]);_0x253c05[_0x6b44('0x30')]=_[_0x6b44('0x42')](_0x2cb94d[_0x6b44('0x30')]);_0x253c05[_0x6b44('0x38')]=_['intersection'](_0x253c05['model'],_0x253c05[_0x6b44('0x30')]);_0x1f6588[_0x6b44('0x32')]=_[_0x6b44('0x31')](_0x253c05[_0x6b44('0x2f')],qs[_0x6b44('0x33')](_0x2cb94d[_0x6b44('0x30')][_0x6b44('0x33')]));_0x1f6588[_0x6b44('0x32')]=_0x1f6588['attributes'][_0x6b44('0x34')]?_0x1f6588[_0x6b44('0x32')]:_0x253c05['model'];if(_0x2cb94d[_0x6b44('0x30')][_0x6b44('0x3d')]){_0x1f6588[_0x6b44('0x43')]=[{'all':!![]}];}_0x1f6588=_['merge']({},_0x1f6588,_0x2cb94d['options']);return db[_0x6b44('0x2a')][_0x6b44('0x44')](_0x1f6588)[_0x6b44('0x23')](handleEntityNotFound(_0x31f109,null))[_0x6b44('0x23')](respondWithResult(_0x31f109,null))['catch'](handleError(_0x31f109,null));};exports['create']=function(_0x17fea1,_0x1a0189){return db[_0x6b44('0x2a')]['create'](_0x17fea1[_0x6b44('0x45')],{})['then'](respondWithResult(_0x1a0189,0xc9))['catch'](handleError(_0x1a0189,null));};exports[_0x6b44('0x22')]=function(_0x54df62,_0x2753b0){if(_0x54df62[_0x6b44('0x45')]['id']){delete _0x54df62[_0x6b44('0x45')]['id'];}return db[_0x6b44('0x2a')][_0x6b44('0x44')]({'where':{'id':_0x54df62[_0x6b44('0x41')]['id']}})['then'](handleEntityNotFound(_0x2753b0,null))[_0x6b44('0x23')](saveUpdates(_0x54df62[_0x6b44('0x45')],null))['then'](respondWithResult(_0x2753b0,null))[_0x6b44('0x40')](handleError(_0x2753b0,null));};exports[_0x6b44('0x24')]=function(_0x50f641,_0x25bf65){return db[_0x6b44('0x2a')][_0x6b44('0x44')]({'where':{'id':_0x50f641[_0x6b44('0x41')]['id']}})[_0x6b44('0x23')](handleEntityNotFound(_0x25bf65,null))[_0x6b44('0x23')](removeEntity(_0x25bf65,null))['catch'](handleError(_0x25bf65,null));};
\ No newline at end of file
+var _0x18cd=['merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','filter','where'];(function(_0x17b614,_0x5a689e){var _0x51deac=function(_0x42b237){while(--_0x42b237){_0x17b614['push'](_0x17b614['shift']());}};_0x51deac(++_0x5a689e);}(_0x18cd,0x131));var _0xd18c=function(_0x26f0a9,_0x14ccd6){_0x26f0a9=_0x26f0a9-0x0;var _0x35d79c=_0x18cd[_0x26f0a9];return _0x35d79c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd18c('0x0'));var zipdir=require(_0xd18c('0x1'));var jsonpatch=require(_0xd18c('0x2'));var rp=require(_0xd18c('0x3'));var moment=require(_0xd18c('0x4'));var BPromise=require(_0xd18c('0x5'));var Mustache=require(_0xd18c('0x6'));var util=require(_0xd18c('0x7'));var path=require('path');var sox=require(_0xd18c('0x8'));var csv=require('to-csv');var ejs=require(_0xd18c('0x9'));var fs=require('fs');var fs_extra=require(_0xd18c('0xa'));var _=require(_0xd18c('0xb'));var squel=require(_0xd18c('0xc'));var crypto=require(_0xd18c('0xd'));var jsforce=require(_0xd18c('0xe'));var deskjs=require(_0xd18c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd18c('0x10'));var Papa=require(_0xd18c('0x11'));var Redis=require(_0xd18c('0x12'));var authService=require(_0xd18c('0x13'));var qs=require(_0xd18c('0x14'));var as=require(_0xd18c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd18c('0x16'));var config=require(_0xd18c('0x17'));var licenseUtil=require(_0xd18c('0x18'));var db=require(_0xd18c('0x19'))['db'];function respondWithStatusCode(_0x1c8df8,_0x4a300c){_0x4a300c=_0x4a300c||0xcc;return function(_0x1fbb94){if(_0x1fbb94){return _0x1c8df8[_0xd18c('0x1a')](_0x4a300c);}return _0x1c8df8[_0xd18c('0x1b')](_0x4a300c)['end']();};}function respondWithResult(_0x1a85f3,_0x4c60fd){_0x4c60fd=_0x4c60fd||0xc8;return function(_0x296bf8){if(_0x296bf8){return _0x1a85f3['status'](_0x4c60fd)['json'](_0x296bf8);}};}function respondWithFilteredResult(_0x1d060a,_0x549e7f){return function(_0x5d82c4){if(_0x5d82c4){var _0xc74e0a=typeof _0x549e7f[_0xd18c('0x1c')]==='undefined'&&typeof _0x549e7f[_0xd18c('0x1d')]===_0xd18c('0x1e');var _0x503873=_0x5d82c4['count'];var _0x22dcf0=_0xc74e0a?0x0:_0x549e7f[_0xd18c('0x1c')];var _0x319965=_0xc74e0a?_0x5d82c4[_0xd18c('0x1f')]:_0x549e7f[_0xd18c('0x1c')]+_0x549e7f['limit'];var _0x5673ce;if(_0x319965>=_0x503873){_0x319965=_0x503873;_0x5673ce=0xc8;}else{_0x5673ce=0xce;}_0x1d060a[_0xd18c('0x1b')](_0x5673ce);return _0x1d060a[_0xd18c('0x20')](_0xd18c('0x21'),_0x22dcf0+'-'+_0x319965+'/'+_0x503873)['json'](_0x5d82c4);}return null;};}function patchUpdates(_0x1605cb){return function(_0x428398){try{jsonpatch[_0xd18c('0x22')](_0x428398,_0x1605cb,!![]);}catch(_0x357aee){return BPromise[_0xd18c('0x23')](_0x357aee);}return _0x428398[_0xd18c('0x24')]();};}function saveUpdates(_0x33eb3b,_0x569915){return function(_0x7c1b19){if(_0x7c1b19){return _0x7c1b19[_0xd18c('0x25')](_0x33eb3b)['then'](function(_0x2db26d){return _0x2db26d;});}return null;};}function removeEntity(_0x1855bc,_0x560fcc){return function(_0x4f41ee){if(_0x4f41ee){return _0x4f41ee['destroy']()[_0xd18c('0x26')](function(){_0x1855bc[_0xd18c('0x1b')](0xcc)[_0xd18c('0x27')]();});}};}function handleEntityNotFound(_0x57c3b8,_0x11c959){return function(_0x3ea7f6){if(!_0x3ea7f6){_0x57c3b8[_0xd18c('0x1a')](0x194);}return _0x3ea7f6;};}function handleError(_0x41744a,_0x47e17f){_0x47e17f=_0x47e17f||0x1f4;return function(_0x267fd6){logger[_0xd18c('0x28')](_0x267fd6[_0xd18c('0x29')]);if(_0x267fd6[_0xd18c('0x2a')]){delete _0x267fd6[_0xd18c('0x2a')];}_0x41744a[_0xd18c('0x1b')](_0x47e17f)['send'](_0x267fd6);};}exports[_0xd18c('0x2b')]=function(_0x4f49c3,_0x73954b){var _0x2bec93={},_0x125b2b={},_0x1edfac={'count':0x0,'rows':[]};var _0x15b27c=_[_0xd18c('0x2c')](db[_0xd18c('0x2d')][_0xd18c('0x2e')],function(_0x37ee95){return{'name':_0x37ee95[_0xd18c('0x2f')],'type':_0x37ee95['type'][_0xd18c('0x30')]};});_0x125b2b[_0xd18c('0x31')]=_['map'](_0x15b27c,_0xd18c('0x2a'));_0x125b2b[_0xd18c('0x32')]=_['keys'](_0x4f49c3[_0xd18c('0x32')]);_0x125b2b[_0xd18c('0x33')]=_[_0xd18c('0x34')](_0x125b2b['model'],_0x125b2b[_0xd18c('0x32')]);_0x2bec93['attributes']=_[_0xd18c('0x34')](_0x125b2b[_0xd18c('0x31')],qs[_0xd18c('0x35')](_0x4f49c3[_0xd18c('0x32')]['fields']));_0x2bec93[_0xd18c('0x36')]=_0x2bec93[_0xd18c('0x36')]['length']?_0x2bec93['attributes']:_0x125b2b['model'];if(!_0x4f49c3['query']['hasOwnProperty'](_0xd18c('0x37'))){_0x2bec93[_0xd18c('0x1d')]=qs['limit'](_0x4f49c3[_0xd18c('0x32')][_0xd18c('0x1d')]);_0x2bec93[_0xd18c('0x1c')]=qs[_0xd18c('0x1c')](_0x4f49c3['query'][_0xd18c('0x1c')]);}_0x2bec93[_0xd18c('0x38')]=qs[_0xd18c('0x39')](_0x4f49c3[_0xd18c('0x32')]['sort']);_0x2bec93['where']=qs[_0xd18c('0x33')](_['pick'](_0x4f49c3[_0xd18c('0x32')],_0x125b2b[_0xd18c('0x33')]),_0x15b27c);if(_0x4f49c3[_0xd18c('0x32')][_0xd18c('0x3a')]){_0x2bec93[_0xd18c('0x3b')]=_[_0xd18c('0x3c')](_0x2bec93[_0xd18c('0x3b')],{'$or':_[_0xd18c('0x2c')](_0x15b27c,function(_0x45ce17){if(_0x45ce17['type']!==_0xd18c('0x3d')){var _0xf989db={};_0xf989db[_0x45ce17['name']]={'$like':'%'+_0x4f49c3['query']['filter']+'%'};return _0xf989db;}})});}_0x2bec93=_['merge']({},_0x2bec93,_0x4f49c3[_0xd18c('0x3e')]);var _0x1fa28f={'where':_0x2bec93['where']};return db[_0xd18c('0x2d')][_0xd18c('0x1f')](_0x1fa28f)[_0xd18c('0x26')](function(_0x30e6ad){_0x1edfac['count']=_0x30e6ad;if(_0x4f49c3[_0xd18c('0x32')][_0xd18c('0x3f')]){_0x2bec93['include']=[{'all':!![]}];}return db[_0xd18c('0x2d')]['findAll'](_0x2bec93);})[_0xd18c('0x26')](function(_0x59cfd9){_0x1edfac[_0xd18c('0x40')]=_0x59cfd9;return _0x1edfac;})[_0xd18c('0x26')](respondWithFilteredResult(_0x73954b,_0x2bec93))[_0xd18c('0x41')](handleError(_0x73954b,null));};exports[_0xd18c('0x42')]=function(_0x3156e9,_0x46a54d){var _0x200032={'raw':!![],'where':{'id':_0x3156e9[_0xd18c('0x43')]['id']}},_0x5d8695={};_0x5d8695[_0xd18c('0x31')]=_[_0xd18c('0x44')](db[_0xd18c('0x2d')][_0xd18c('0x2e')]);_0x5d8695[_0xd18c('0x32')]=_[_0xd18c('0x44')](_0x3156e9[_0xd18c('0x32')]);_0x5d8695['filters']=_[_0xd18c('0x34')](_0x5d8695[_0xd18c('0x31')],_0x5d8695[_0xd18c('0x32')]);_0x200032['attributes']=_[_0xd18c('0x34')](_0x5d8695[_0xd18c('0x31')],qs[_0xd18c('0x35')](_0x3156e9[_0xd18c('0x32')]['fields']));_0x200032[_0xd18c('0x36')]=_0x200032[_0xd18c('0x36')]['length']?_0x200032[_0xd18c('0x36')]:_0x5d8695[_0xd18c('0x31')];if(_0x3156e9[_0xd18c('0x32')]['includeAll']){_0x200032[_0xd18c('0x45')]=[{'all':!![]}];}_0x200032=_[_0xd18c('0x3c')]({},_0x200032,_0x3156e9[_0xd18c('0x3e')]);return db[_0xd18c('0x2d')][_0xd18c('0x46')](_0x200032)[_0xd18c('0x26')](handleEntityNotFound(_0x46a54d,null))[_0xd18c('0x26')](respondWithResult(_0x46a54d,null))['catch'](handleError(_0x46a54d,null));};exports[_0xd18c('0x47')]=function(_0x2eae82,_0x4d4f94){return db[_0xd18c('0x2d')][_0xd18c('0x47')](_0x2eae82[_0xd18c('0x48')],{})['then'](respondWithResult(_0x4d4f94,0xc9))[_0xd18c('0x41')](handleError(_0x4d4f94,null));};exports['update']=function(_0x280d8c,_0x386526){if(_0x280d8c['body']['id']){delete _0x280d8c[_0xd18c('0x48')]['id'];}return db[_0xd18c('0x2d')][_0xd18c('0x46')]({'where':{'id':_0x280d8c['params']['id']}})[_0xd18c('0x26')](handleEntityNotFound(_0x386526,null))[_0xd18c('0x26')](saveUpdates(_0x280d8c['body'],null))[_0xd18c('0x26')](respondWithResult(_0x386526,null))[_0xd18c('0x41')](handleError(_0x386526,null));};exports['destroy']=function(_0x279a2b,_0x5103da){return db[_0xd18c('0x2d')]['find']({'where':{'id':_0x279a2b[_0xd18c('0x43')]['id']}})[_0xd18c('0x26')](handleEntityNotFound(_0x5103da,null))[_0xd18c('0x26')](removeEntity(_0x5103da,null))['catch'](handleError(_0x5103da,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8cde=['../../config/environment','exports','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x4b2975,_0x2be462){var _0x3bc9e8=function(_0x4d1a7e){while(--_0x4d1a7e){_0x4b2975['push'](_0x4b2975['shift']());}};_0x3bc9e8(++_0x2be462);}(_0x8cde,0x13f));var _0xe8cd=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x8cde[_0x565c4e];return _0x4a167f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe8cd('0x0'))(_0xe8cd('0x1'));var moment=require(_0xe8cd('0x2'));var BPromise=require('bluebird');var rp=require(_0xe8cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8cd('0x4'));var config=require(_0xe8cd('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0xe8cd('0x6')]=function(_0x4ba0f8,_0x5b54cc){return _0x4ba0f8['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8cd('0x7'),'collate':_0xe8cd('0x8')});};
\ No newline at end of file
+var _0x83fb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x490990,_0x310e51){var _0x2644a7=function(_0x511e52){while(--_0x511e52){_0x490990['push'](_0x490990['shift']());}};_0x2644a7(++_0x310e51);}(_0x83fb,0x131));var _0xb83f=function(_0xdada88,_0x34118d){_0xdada88=_0xdada88-0x0;var _0x46b729=_0x83fb[_0xdada88];return _0x46b729;};'use strict';var _=require(_0xb83f('0x0'));var util=require(_0xb83f('0x1'));var logger=require('../../config/logger')(_0xb83f('0x2'));var moment=require(_0xb83f('0x3'));var BPromise=require(_0xb83f('0x4'));var rp=require(_0xb83f('0x5'));var fs=require('fs');var path=require(_0xb83f('0x6'));var rimraf=require(_0xb83f('0x7'));var config=require(_0xb83f('0x8'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x1f240c,_0x3a3909){return _0x1f240c[_0xb83f('0x9')](_0xb83f('0xa'),attributes,{'tableName':_0xb83f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb83f('0xc'),'collate':_0xb83f('0xd')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9292=['stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then'];(function(_0x7b070d,_0x3c38ed){var _0x39761=function(_0xfe2dd3){while(--_0xfe2dd3){_0x7b070d['push'](_0x7b070d['shift']());}};_0x39761(++_0x3c38ed);}(_0x9292,0xf9));var _0x2929=function(_0x161e04,_0x5a7eb6){_0x161e04=_0x161e04-0x0;var _0x373028=_0x9292[_0x161e04];return _0x373028;};'use strict';var _=require('lodash');var util=require(_0x2929('0x0'));var moment=require(_0x2929('0x1'));var BPromise=require(_0x2929('0x2'));var rs=require(_0x2929('0x3'));var fs=require('fs');var Redis=require(_0x2929('0x4'));var db=require(_0x2929('0x5'))['db'];var utils=require(_0x2929('0x6'));var logger=require('../../config/logger')(_0x2929('0x7'));var config=require(_0x2929('0x8'));var jayson=require(_0x2929('0x9'));var client=jayson[_0x2929('0xa')][_0x2929('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f3d61,_0x379c8d,_0x97bf80){return new BPromise(function(_0x5db10b,_0x1e6ef5){return client[_0x2929('0xc')](_0x4f3d61,_0x97bf80)['then'](function(_0x366294){logger[_0x2929('0xd')](_0x2929('0xe'),_0x379c8d,_0x2929('0xf'));logger[_0x2929('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x379c8d,'request\x20sent',JSON['stringify'](_0x366294));if(_0x366294[_0x2929('0x11')]){if(_0x366294[_0x2929('0x11')]['code']===0x1f4){logger['error'](_0x2929('0xe'),_0x379c8d,_0x366294[_0x2929('0x11')][_0x2929('0x12')]);return _0x1e6ef5(_0x366294[_0x2929('0x11')][_0x2929('0x12')]);}logger['error'](_0x2929('0xe'),_0x379c8d,_0x366294[_0x2929('0x11')]['message']);return _0x5db10b(_0x366294[_0x2929('0x11')][_0x2929('0x12')]);}else{logger[_0x2929('0xd')](_0x2929('0xe'),_0x379c8d,_0x2929('0xf'));_0x5db10b(_0x366294[_0x2929('0x13')][_0x2929('0x12')]);}})['catch'](function(_0x12e97b){logger[_0x2929('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x379c8d,_0x12e97b);_0x1e6ef5(_0x12e97b);});});}exports[_0x2929('0x14')]=function(_0x479d70){var _0x454636=this;return new Promise(function(_0x2b704e,_0xb27e10){return db[_0x2929('0x15')][_0x2929('0x16')](_0x479d70[_0x2929('0x17')],{'raw':_0x479d70[_0x2929('0x18')]?_0x479d70[_0x2929('0x18')][_0x2929('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x479d70[_0x2929('0x18')]?_0x479d70[_0x2929('0x18')][_0x2929('0x1a')]||null:null,'attributes':_0x479d70[_0x2929('0x18')]?_0x479d70[_0x2929('0x18')][_0x2929('0x1b')]||null:null,'limit':_0x479d70[_0x2929('0x18')]?_0x479d70['options'][_0x2929('0x1c')]||null:null})[_0x2929('0x1d')](function(_0x21f0df){logger[_0x2929('0xd')](_0x2929('0x14'),_0x479d70);logger['debug'](_0x2929('0x14'),_0x479d70,JSON[_0x2929('0x1e')](_0x21f0df));_0x2b704e(_0x21f0df);})['catch'](function(_0x58c100){logger['error'](_0x2929('0x14'),_0x58c100['message'],_0x479d70);_0xb27e10(_0x454636[_0x2929('0x11')](0x1f4,_0x58c100[_0x2929('0x12')]));});});};
\ No newline at end of file
+var _0x8d76=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','OpenchannelApplication','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelApplication,\x20%s,\x20%s','debug'];(function(_0x527228,_0x2bf9d1){var _0x18fc82=function(_0x301e4f){while(--_0x301e4f){_0x527228['push'](_0x527228['shift']());}};_0x18fc82(++_0x2bf9d1);}(_0x8d76,0x131));var _0x68d7=function(_0x3e4584,_0x43afce){_0x3e4584=_0x3e4584-0x0;var _0x272f56=_0x8d76[_0x3e4584];return _0x272f56;};'use strict';var _=require(_0x68d7('0x0'));var util=require(_0x68d7('0x1'));var moment=require(_0x68d7('0x2'));var BPromise=require(_0x68d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68d7('0x4'));var db=require(_0x68d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x68d7('0x6'))(_0x68d7('0x7'));var config=require(_0x68d7('0x8'));var jayson=require(_0x68d7('0x9'));var client=jayson['client'][_0x68d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35e64c,_0x25127a,_0x4ae87b){return new BPromise(function(_0x31679e,_0x34643f){return client[_0x68d7('0xb')](_0x35e64c,_0x4ae87b)[_0x68d7('0xc')](function(_0x4479d4){logger['info'](_0x68d7('0xd'),_0x25127a,'request\x20sent');logger[_0x68d7('0xe')](_0x68d7('0xf'),_0x25127a,_0x68d7('0x10'),JSON[_0x68d7('0x11')](_0x4479d4));if(_0x4479d4[_0x68d7('0x12')]){if(_0x4479d4['error'][_0x68d7('0x13')]===0x1f4){logger['error'](_0x68d7('0xd'),_0x25127a,_0x4479d4[_0x68d7('0x12')]['message']);return _0x34643f(_0x4479d4[_0x68d7('0x12')][_0x68d7('0x14')]);}logger[_0x68d7('0x12')](_0x68d7('0xd'),_0x25127a,_0x4479d4[_0x68d7('0x12')][_0x68d7('0x14')]);return _0x31679e(_0x4479d4[_0x68d7('0x12')][_0x68d7('0x14')]);}else{logger[_0x68d7('0x15')]('OpenchannelApplication,\x20%s,\x20%s',_0x25127a,'request\x20sent');_0x31679e(_0x4479d4['result']['message']);}})[_0x68d7('0x16')](function(_0x4f2adc){logger['error'](_0x68d7('0xd'),_0x25127a,_0x4f2adc);_0x34643f(_0x4f2adc);});});}exports['UpdateOpenchannelApplication']=function(_0x2ca55b){var _0x1ef4b8=this;return new Promise(function(_0x2cdc4b,_0x5a6aea){return db[_0x68d7('0x17')][_0x68d7('0x18')](_0x2ca55b[_0x68d7('0x19')],{'raw':_0x2ca55b['options']?_0x2ca55b[_0x68d7('0x1a')][_0x68d7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ca55b['options']?_0x2ca55b[_0x68d7('0x1a')][_0x68d7('0x1c')]||null:null,'attributes':_0x2ca55b[_0x68d7('0x1a')]?_0x2ca55b[_0x68d7('0x1a')][_0x68d7('0x1d')]||null:null,'limit':_0x2ca55b[_0x68d7('0x1a')]?_0x2ca55b[_0x68d7('0x1a')][_0x68d7('0x1e')]||null:null})['then'](function(_0x1fb828){logger['info'](_0x68d7('0x1f'),_0x2ca55b);logger['debug'](_0x68d7('0x1f'),_0x2ca55b,JSON['stringify'](_0x1fb828));_0x2cdc4b(_0x1fb828);})[_0x68d7('0x16')](function(_0x3b2af1){logger['error'](_0x68d7('0x1f'),_0x3b2af1[_0x68d7('0x14')],_0x2ca55b);_0x5a6aea(_0x1ef4b8['error'](0x1f4,_0x3b2af1[_0x68d7('0x14')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd87=['delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','tracked','openchannel','addTags','put','update','openchannelinteraction:destroy'];(function(_0x391007,_0x4db5ef){var _0x41d7c6=function(_0x4190f0){while(--_0x4190f0){_0x391007['push'](_0x391007['shift']());}};_0x41d7c6(++_0x4db5ef);}(_0xbd87,0x11b));var _0x7bd8=function(_0x24355a,_0x401e18){_0x24355a=_0x24355a-0x0;var _0x5df365=_0xbd87[_0x24355a];return _0x5df365;};'use strict';var multer=require(_0x7bd8('0x0'));var util=require(_0x7bd8('0x1'));var path=require(_0x7bd8('0x2'));var timeout=require(_0x7bd8('0x3'));var express=require(_0x7bd8('0x4'));var router=express[_0x7bd8('0x5')]();var fs_extra=require(_0x7bd8('0x6'));var auth=require(_0x7bd8('0x7'));var interaction=require(_0x7bd8('0x8'));var config=require(_0x7bd8('0x9'));var controller=require('./openchannelInteraction.controller');router[_0x7bd8('0xa')]('/',auth[_0x7bd8('0xb')](),controller['index']);router[_0x7bd8('0xa')](_0x7bd8('0xc'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0xd')]);router['get'](_0x7bd8('0xe'),auth[_0x7bd8('0xb')](),controller['show']);router[_0x7bd8('0xa')](_0x7bd8('0xf'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x10')]);router['get'](_0x7bd8('0x11'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x12')]);router[_0x7bd8('0x13')]('/',auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x14')]);router[_0x7bd8('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x7bd8('0x13')]('/:id/tags',auth[_0x7bd8('0xb')](),interaction[_0x7bd8('0x15')](_0x7bd8('0x16'),'openchannelinteraction:addtags'),controller[_0x7bd8('0x17')]);router[_0x7bd8('0x18')](_0x7bd8('0xe'),auth[_0x7bd8('0xb')](),interaction['tracked'](_0x7bd8('0x16'),'openchannelinteraction:update'),controller[_0x7bd8('0x19')]);router['delete'](_0x7bd8('0xe'),auth[_0x7bd8('0xb')](),interaction['tracked'](_0x7bd8('0x16'),_0x7bd8('0x1a')),controller['destroy']);router[_0x7bd8('0x1b')](_0x7bd8('0x1c'),auth[_0x7bd8('0xb')](),controller[_0x7bd8('0x1d')]);module[_0x7bd8('0x1e')]=router;
\ No newline at end of file
+var _0xfce3=['openchannel','openchannelinteraction:addtags','addTags','tracked','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/messages','/:id/download','post','create','addMessage','/:id/tags'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0xfce3,0x199));var _0x3fce=function(_0x157d45,_0x1ee465){_0x157d45=_0x157d45-0x0;var _0x1222b1=_0xfce3[_0x157d45];return _0x1222b1;};'use strict';var multer=require('multer');var util=require(_0x3fce('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3fce('0x1'));var router=express['Router']();var fs_extra=require(_0x3fce('0x2'));var auth=require(_0x3fce('0x3'));var interaction=require(_0x3fce('0x4'));var config=require(_0x3fce('0x5'));var controller=require('./openchannelInteraction.controller');router[_0x3fce('0x6')]('/',auth[_0x3fce('0x7')](),controller['index']);router[_0x3fce('0x6')](_0x3fce('0x8'),auth[_0x3fce('0x7')](),controller['describe']);router[_0x3fce('0x6')](_0x3fce('0x9'),auth[_0x3fce('0x7')](),controller['show']);router[_0x3fce('0x6')](_0x3fce('0xa'),auth[_0x3fce('0x7')](),controller['getMessages']);router[_0x3fce('0x6')](_0x3fce('0xb'),auth[_0x3fce('0x7')](),controller['download']);router[_0x3fce('0xc')]('/',auth[_0x3fce('0x7')](),controller[_0x3fce('0xd')]);router['post'](_0x3fce('0xa'),auth['isAuthenticated'](),controller[_0x3fce('0xe')]);router['post'](_0x3fce('0xf'),auth[_0x3fce('0x7')](),interaction['tracked'](_0x3fce('0x10'),_0x3fce('0x11')),controller[_0x3fce('0x12')]);router['put'](_0x3fce('0x9'),auth[_0x3fce('0x7')](),interaction[_0x3fce('0x13')](_0x3fce('0x10'),_0x3fce('0x14')),controller['update']);router[_0x3fce('0x15')]('/:id',auth[_0x3fce('0x7')](),interaction[_0x3fce('0x13')](_0x3fce('0x10'),_0x3fce('0x16')),controller[_0x3fce('0x17')]);router[_0x3fce('0x15')]('/:id/tags',auth[_0x3fce('0x7')](),controller[_0x3fce('0x18')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x20df=['STRING','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x273e8d,_0x36e9a7){var _0x269e77=function(_0x1439f5){while(--_0x1439f5){_0x273e8d['push'](_0x273e8d['shift']());}};_0x269e77(++_0x36e9a7);}(_0x20df,0x7c));var _0xf20d=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x20df[_0x267c52];return _0x46c47b;};'use strict';var Sequelize=require(_0xf20d('0x0'));module[_0xf20d('0x1')]={'closed':{'type':Sequelize[_0xf20d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf20d('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf20d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf20d('0x4')]},'note':{'type':Sequelize[_0xf20d('0x4')]},'read1stAt':{'type':Sequelize[_0xf20d('0x3')]},'threadId':{'type':Sequelize[_0xf20d('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xf20d('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf20d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xf20d('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf20d('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf20d('0x7')]}};
\ No newline at end of file
+var _0x6e5f=['out','ENUM','INTEGER','sequelize','exports','DATE','STRING'];(function(_0x19bf85,_0x4b3585){var _0x1f3ede=function(_0x27e70d){while(--_0x27e70d){_0x19bf85['push'](_0x19bf85['shift']());}};_0x1f3ede(++_0x4b3585);}(_0x6e5f,0x1bc));var _0xf6e5=function(_0x4e4532,_0x181b6){_0x4e4532=_0x4e4532-0x0;var _0x5359ea=_0x6e5f[_0x4e4532];return _0x5359ea;};'use strict';var Sequelize=require(_0xf6e5('0x0'));module[_0xf6e5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf6e5('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf6e5('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf6e5('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xf6e5('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xf6e5('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf6e5('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xf6e5('0x5')]('in',_0xf6e5('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf6e5('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1598=['OpenchannelMessage','ids','omit','getMessages','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','format','findAll','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','direction','out','System','lastName','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','type','getOptions','query','from','params','keys','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','catch','body','describe','addMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1598,0x1c3));var _0x8159=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1598[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x8159('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8159('0x1'));var util=require(_0x8159('0x2'));var path=require('path');var ejs=require(_0x8159('0x3'));var fs=require('fs');var _=require(_0x8159('0x4'));var Redis=require(_0x8159('0x5'));var interaction=require(_0x8159('0x6'));var qs=require(_0x8159('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x8159('0x8'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8159('0x9')](config[_0x8159('0xa')],{'host':_0x8159('0xb'),'port':0x18eb});var socket=require(_0x8159('0xc'))(new Redis(config[_0x8159('0xa')]));require(_0x8159('0xd'))[_0x8159('0xe')](socket);function respondWithStatusCode(_0x5c0355,_0x4eddfc){_0x4eddfc=_0x4eddfc||0xcc;return function(_0x4a80ee){if(_0x4a80ee){return _0x5c0355['sendStatus'](_0x4eddfc);}return _0x5c0355[_0x8159('0xf')](_0x4eddfc)[_0x8159('0x10')]();};}function respondWithResult(_0x4cccca,_0x56fdb7){_0x56fdb7=_0x56fdb7||0xc8;return function(_0x33783b){if(_0x33783b){return _0x4cccca['status'](_0x56fdb7)['json'](_0x33783b);}};}function respondWithFilteredResult(_0x297fa3,_0x1db5df){return function(_0x3f8b8c){if(_0x3f8b8c){var _0x29dbe8=typeof _0x1db5df[_0x8159('0x11')]===_0x8159('0x12')&&typeof _0x1db5df[_0x8159('0x13')]===_0x8159('0x12');var _0x392583=_0x3f8b8c[_0x8159('0x14')];var _0x34471c=_0x29dbe8?0x0:_0x1db5df['offset'];var _0x311402=_0x29dbe8?_0x3f8b8c[_0x8159('0x14')]:_0x1db5df[_0x8159('0x11')]+_0x1db5df['limit'];var _0x406fa6;if(_0x311402>=_0x392583){_0x311402=_0x392583;_0x406fa6=0xc8;}else{_0x406fa6=0xce;}_0x297fa3[_0x8159('0xf')](_0x406fa6);return _0x297fa3[_0x8159('0x15')](_0x8159('0x16'),_0x34471c+'-'+_0x311402+'/'+_0x392583)[_0x8159('0x17')](_0x3f8b8c);}return null;};}function saveUpdates(_0x52f576){return function(_0x13cb0e){if(_0x13cb0e){return _0x13cb0e[_0x8159('0x18')](_0x52f576)[_0x8159('0x19')](function(_0x4bddb4){return _0x4bddb4;});}return null;};}function removeEntity(_0x578ccc){return function(_0x50b615){if(_0x50b615){return _0x50b615[_0x8159('0x1a')]()[_0x8159('0x19')](function(){_0x578ccc[_0x8159('0xf')](0xcc)[_0x8159('0x10')]();});}};}function handleEntityNotFound(_0x5abbf9){return function(_0x1e50b8){if(!_0x1e50b8){_0x5abbf9[_0x8159('0x1b')](0x194);}return _0x1e50b8;};}function handleError(_0x52f5e7,_0x26ea83){_0x26ea83=_0x26ea83||0x1f4;return function(_0x48cd72){logger[_0x8159('0x1c')](_0x48cd72[_0x8159('0x1d')]);if(_0x48cd72[_0x8159('0x1e')]){delete _0x48cd72[_0x8159('0x1e')];}_0x52f5e7['status'](_0x26ea83)[_0x8159('0x1f')](_0x48cd72);};}exports[_0x8159('0x20')]=function(_0x3f412a,_0x305614){var _0x113023={};var _0xe09666=_[_0x8159('0x21')](db[_0x8159('0x22')][_0x8159('0x23')],function(_0x5acd9f){return{'name':_0x5acd9f['fieldName'],'type':_0x5acd9f[_0x8159('0x24')]['key']};});_0x113023=qs[_0x8159('0x25')](_0xe09666,_0x3f412a);return interaction['findAll']('openchannel',_0x3f412a['query'],_0x3f412a['user'],_0x113023,_0xe09666)[_0x8159('0x19')](respondWithFilteredResult(_0x305614,_0x113023))['catch'](handleError(_0x305614,null));};exports['show']=function(_0x1ac088,_0x142d60){var _0x11efdc={};if(_0x1ac088[_0x8159('0x26')][_0x8159('0x24')]&&_0x1ac088[_0x8159('0x26')][_0x8159('0x24')]===_0x8159('0x27')){_0x11efdc[_0x8159('0x27')]=_0x1ac088[_0x8159('0x28')]['id'];}else{_0x11efdc['id']=_0x1ac088[_0x8159('0x28')]['id'];}var _0x72bf9e={'raw':![],'where':_0x11efdc},_0x429942={};_0x429942['model']=_[_0x8159('0x29')](db[_0x8159('0x22')][_0x8159('0x23')]);_0x429942[_0x8159('0x26')]=_[_0x8159('0x29')](_0x1ac088[_0x8159('0x26')]);_0x429942[_0x8159('0x2a')]=_[_0x8159('0x2b')](_0x429942['model'],_0x429942[_0x8159('0x26')]);_0x72bf9e[_0x8159('0x2c')]=_[_0x8159('0x2b')](_0x429942[_0x8159('0x2d')],qs['fields'](_0x1ac088[_0x8159('0x26')][_0x8159('0x2e')]));_0x72bf9e[_0x8159('0x2c')]=_0x72bf9e[_0x8159('0x2c')][_0x8159('0x2f')]?_0x72bf9e[_0x8159('0x2c')]:_0x429942['model'];if(_0x1ac088[_0x8159('0x26')][_0x8159('0x30')]){_0x72bf9e[_0x8159('0x31')]=[{'all':!![]}];}_0x72bf9e=_[_0x8159('0x32')]({},_0x72bf9e,_0x1ac088[_0x8159('0x33')]);return db[_0x8159('0x22')][_0x8159('0x34')](_0x72bf9e)[_0x8159('0x19')](handleEntityNotFound(_0x142d60,null))[_0x8159('0x19')](respondWithResult(_0x142d60,null))[_0x8159('0x35')](handleError(_0x142d60,null));};exports['create']=function(_0x3fcdac,_0x327333){return db[_0x8159('0x22')]['create'](_0x3fcdac[_0x8159('0x36')],{})[_0x8159('0x19')](respondWithResult(_0x327333,0xc9))[_0x8159('0x35')](handleError(_0x327333,null));};exports['update']=function(_0x4f1ae2,_0x4cbb9a){if(_0x4f1ae2['body']['id']){delete _0x4f1ae2[_0x8159('0x36')]['id'];}return db['OpenchannelInteraction'][_0x8159('0x34')]({'where':{'id':_0x4f1ae2[_0x8159('0x28')]['id']}})['then'](handleEntityNotFound(_0x4cbb9a,null))[_0x8159('0x19')](saveUpdates(_0x4f1ae2['body'],null))[_0x8159('0x19')](respondWithResult(_0x4cbb9a,null))[_0x8159('0x35')](handleError(_0x4cbb9a,null));};exports[_0x8159('0x1a')]=function(_0x13d97d,_0x680a32){return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x13d97d[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x680a32,null))['then'](removeEntity(_0x680a32,null))['catch'](handleError(_0x680a32,null));};exports['describe']=function(_0x2f6053,_0xc5a13f){return db[_0x8159('0x22')][_0x8159('0x37')]()[_0x8159('0x19')](respondWithResult(_0xc5a13f,null))[_0x8159('0x35')](handleError(_0xc5a13f,null));};exports[_0x8159('0x38')]=function(_0x4fd894,_0x268760){return db[_0x8159('0x39')]['find']({'where':{'id':_0x4fd894[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x268760,null))[_0x8159('0x19')](function(_0x54b6f8){if(_0x54b6f8){return _0x54b6f8['addMessage'](_0x4fd894[_0x8159('0x36')][_0x8159('0x3a')],_[_0x8159('0x3b')](_0x4fd894['body'],[_0x8159('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x268760,null))[_0x8159('0x35')](handleError(_0x268760,null));};exports[_0x8159('0x3c')]=function(_0x3d9d9d,_0x3b40b5){var _0x9e67ae={'raw':![],'where':{}};var _0x311d02={};var _0x1bb64e={'count':0x0,'rows':[]};return db[_0x8159('0x22')]['findOne']({'where':{'id':_0x3d9d9d[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x3b40b5,null))['then'](function(_0x5725be){if(_0x5725be){_0x311d02['model']=_['keys'](db[_0x8159('0x39')][_0x8159('0x23')]);_0x311d02[_0x8159('0x26')]=_[_0x8159('0x29')](_0x3d9d9d[_0x8159('0x26')]);_0x311d02[_0x8159('0x2a')]=_[_0x8159('0x2b')](_0x311d02[_0x8159('0x2d')],_0x311d02[_0x8159('0x26')]);_0x9e67ae[_0x8159('0x2c')]=_['intersection'](_0x311d02['model'],qs[_0x8159('0x2e')](_0x3d9d9d[_0x8159('0x26')][_0x8159('0x2e')]));_0x9e67ae['attributes']=_0x9e67ae[_0x8159('0x2c')][_0x8159('0x2f')]?_0x9e67ae[_0x8159('0x2c')]:_0x311d02[_0x8159('0x2d')];if(!_0x3d9d9d['query']['hasOwnProperty'](_0x8159('0x3d'))){_0x9e67ae[_0x8159('0x13')]=qs[_0x8159('0x13')](_0x3d9d9d[_0x8159('0x26')][_0x8159('0x13')]);_0x9e67ae['offset']=qs['offset'](_0x3d9d9d['query'][_0x8159('0x11')]);}_0x9e67ae[_0x8159('0x3e')]=qs[_0x8159('0x3f')](_0x3d9d9d[_0x8159('0x26')][_0x8159('0x3f')]);_0x9e67ae[_0x8159('0x40')]=qs['filters'](_['pick'](_0x3d9d9d[_0x8159('0x26')],_0x311d02['filters']));_0x9e67ae[_0x8159('0x40')][_0x8159('0x41')]=_0x5725be['id'];if(_0x3d9d9d[_0x8159('0x26')][_0x8159('0x42')]){_0x9e67ae['where']=_[_0x8159('0x32')](_0x9e67ae[_0x8159('0x40')],{'$or':_[_0x8159('0x21')](_0x9e67ae['attributes'],function(_0x4b99c8){var _0x19c938={};_0x19c938[_0x4b99c8]={'$like':'%'+_0x3d9d9d['query'][_0x8159('0x42')]+'%'};return _0x19c938;})});}if(_0x3d9d9d['query'][_0x8159('0x43')]){var _0x469e0d=_0x3d9d9d[_0x8159('0x26')][_0x8159('0x43')][_0x8159('0x44')](',');var _0x42ca19={};_0x42ca19[_0x469e0d[0x0]]={'$gte':moment(_0x469e0d[0x1])[_0x8159('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9e67ae[_0x8159('0x40')]=_[_0x8159('0x32')](_0x9e67ae[_0x8159('0x40')],_0x42ca19);}_0x9e67ae=_[_0x8159('0x32')]({},_0x9e67ae,_0x3d9d9d['options']);return db[_0x8159('0x39')]['count']({'where':_0x9e67ae[_0x8159('0x40')]})['then'](function(_0x210bc1){_0x1bb64e[_0x8159('0x14')]=_0x210bc1;if(_0x3d9d9d[_0x8159('0x26')]['includeAll']){_0x9e67ae['include']=[{'all':!![]}];}return db[_0x8159('0x39')][_0x8159('0x46')](_0x9e67ae);})[_0x8159('0x19')](function(_0x22ea76){_0x1bb64e[_0x8159('0x47')]=_0x22ea76;return _0x1bb64e;});}})[_0x8159('0x19')](respondWithFilteredResult(_0x3b40b5,_0x9e67ae))[_0x8159('0x35')](handleError(_0x3b40b5,null));};exports[_0x8159('0x48')]=function(_0x3797b9,_0x33154b){return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x3797b9[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x33154b,null))[_0x8159('0x19')](function(_0x4d6c0a){if(_0x4d6c0a){return _0x4d6c0a[_0x8159('0x49')](_0x3797b9[_0x8159('0x36')]['ids'],_[_0x8159('0x3b')](_0x3797b9[_0x8159('0x36')],[_0x8159('0x3a'),'id'])||{})[_0x8159('0x4a')](function(){return db[_0x8159('0x4b')][_0x8159('0x46')]({'attributes':['id',_0x8159('0x1e'),_0x8159('0x4c')],'where':{'id':_0x3797b9[_0x8159('0x36')][_0x8159('0x3a')]}});})['then'](function(_0x388c23){socket[_0x8159('0x4d')](_0x8159('0x4e'),{'id':Number(_0x3797b9[_0x8159('0x28')]['id']),'tags':_0x388c23||[]});return{'id':Number(_0x3797b9[_0x8159('0x28')]['id']),'tags':_0x388c23||[]};});}})['then'](respondWithResult(_0x33154b,null))[_0x8159('0x35')](handleError(_0x33154b,null));};exports[_0x8159('0x4f')]=function(_0x1fd7fd,_0x41b97d){return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x1fd7fd[_0x8159('0x28')]['id']}})[_0x8159('0x19')](handleEntityNotFound(_0x41b97d,null))[_0x8159('0x19')](function(_0x10cfd7){if(_0x10cfd7){return _0x10cfd7[_0x8159('0x4f')](_0x1fd7fd[_0x8159('0x26')][_0x8159('0x3a')]);}})[_0x8159('0x19')](respondWithStatusCode(_0x41b97d,null))[_0x8159('0x35')](handleError(_0x41b97d,null));};exports[_0x8159('0x50')]=function(_0x73c120,_0x3df6d2){var _0x1c1f06=moment()[_0x8159('0x51')]()[_0x8159('0x52')]();var _0x5bec06=path[_0x8159('0x53')](config[_0x8159('0x54')],_0x8159('0x55'),_0x8159('0x56'),'tmp');var _0x3cd6c3=path['join'](config[_0x8159('0x54')],_0x8159('0x55'),_0x8159('0x56'),_0x8159('0x57'));var _0x1fe18d=path['join'](_0x5bec06,_0x1c1f06);var _0x47641b=util[_0x8159('0x45')](_0x8159('0x58'),_0x73c120[_0x8159('0x28')]['id'],_0x1c1f06);var _0x444236=path[_0x8159('0x53')](_0x5bec06,_0x47641b);var _0xfc8bc8=[];_0xfc8bc8['push']({'model':db[_0x8159('0x59')],'as':_0x8159('0x59'),'attributes':['id',_0x8159('0x5a')],'raw':!![]});_0xfc8bc8[_0x8159('0x5b')]({'model':db[_0x8159('0x5c')],'as':_0x8159('0x5d'),'attributes':['id',_0x8159('0x5e'),'lastName'],'raw':!![]});if(_0x73c120[_0x8159('0x26')]['attachments']){_0xfc8bc8[_0x8159('0x5b')]({'model':db[_0x8159('0x5f')],'as':_0x8159('0x5f'),'raw':!![]});}var _0x19a709=[{'model':db[_0x8159('0x39')],'as':_0x8159('0x60'),'attributes':['id','body',_0x8159('0x61'),'direction',_0x8159('0x62'),_0x8159('0x63')],'include':_0xfc8bc8}];_0x19a709['push']({'model':db[_0x8159('0x64')],'as':_0x8159('0x65'),'attributes':['id',_0x8159('0x1e')]});_0x19a709[_0x8159('0x5b')]({'model':db[_0x8159('0x59')],'as':'Owner','attributes':['id',_0x8159('0x5a')]});return db[_0x8159('0x22')][_0x8159('0x34')]({'where':{'id':_0x73c120[_0x8159('0x28')]['id']},'include':_0x19a709})['then'](handleEntityNotFound(_0x3df6d2,null))[_0x8159('0x19')](function(_0x1a7856){if(_0x1a7856){var _0x56dc09=_0x1a7856[_0x8159('0x66')]({'plain':!![]});fs['mkdirSync'](_0x1fe18d);var _0x10d8b={'channel':_0x8159('0x67'),'account':_0x56dc09[_0x8159('0x65')][_0x8159('0x1e')],'agent':_0x56dc09[_0x8159('0x68')]?_0x56dc09[_0x8159('0x68')][_0x8159('0x5a')]:_0x8159('0x69'),'createdAt':moment(_0x56dc09[_0x8159('0x61')])['format'](_0x8159('0x6a'))[_0x8159('0x52')](),'closedAt':_0x56dc09[_0x8159('0x6b')]?moment(_0x56dc09[_0x8159('0x6c')])[_0x8159('0x45')](_0x8159('0x6a'))[_0x8159('0x52')]():'','disposition':_0x56dc09['disposition'],'visibility':_0x56dc09[_0x8159('0x6d')]?_0x8159('0x6e'):_0x8159('0x6f'),'messages':_(_0x56dc09[_0x8159('0x60')])[_0x8159('0x42')]({'secret':![]})[_0x8159('0x21')](function(_0x558356){if(_0x558356['Attachment']){var _0x1081b8=path[_0x8159('0x53')](_0x3cd6c3,_0x558356[_0x8159('0x5f')][_0x8159('0x70')]);if(fs['existsSync'](_0x1081b8)){fs[_0x8159('0x71')](_0x1081b8)[_0x8159('0x72')](fs[_0x8159('0x73')](path[_0x8159('0x53')](_0x1fe18d,_0x558356[_0x8159('0x5f')][_0x8159('0x70')])));}}return{'date':moment(_0x558356['createdAt'])[_0x8159('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8159('0x52')](),'sender':_0x558356[_0x8159('0x74')]===_0x8159('0x75')?_0x558356[_0x8159('0x59')]?_0x558356['User']['fullname']:_0x8159('0x76'):_0x558356[_0x8159('0x5d')]['firstName']+(_0x558356[_0x8159('0x5d')]['lastName']?'\x20'+_0x558356[_0x8159('0x5d')][_0x8159('0x77')]:''),'body':_0x558356[_0x8159('0x5f')]?_0x558356[_0x8159('0x5f')][_0x8159('0x70')]:_0x558356['body'],'direction':_0x558356[_0x8159('0x74')]===_0x8159('0x75')?'A':'C','secret':_0x558356['secret'],'read':_0x558356[_0x8159('0x63')],'attachment':_0x558356[_0x8159('0x5f')]};})[_0x8159('0x78')]()};return ejs[_0x8159('0x79')](path[_0x8159('0x53')](config['root'],_0x8159('0x55'),_0x8159('0x7a'),'downloadInteraction.ejs'),{'interaction':_0x10d8b})[_0x8159('0x19')](function(_0x36b605){var _0x5701d7=path[_0x8159('0x53')](_0x1fe18d,_0x8159('0x7b')+_0x56dc09['id']+'-'+_0x1c1f06+_0x8159('0x7c'));var _0x5ccff7={'path':_0x5701d7,'channel':'Openchannel','interactionId':_0x56dc09['id']};return pdf[_0x8159('0x7d')](_0x36b605,_0x5ccff7);})['then'](function(){return new Promise(function(_0x35f640,_0x1cd835){zipdir(_0x1fe18d,{'saveTo':_0x444236},function(_0x175760,_0x31dacf){if(_0x175760)return _0x1cd835(_0x175760);return _0x35f640(_0x31dacf);});})[_0x8159('0x19')](function(){return new Promise(function(_0x47ab1c,_0x2fa54c){rimraf(_0x1fe18d,function(_0x3962c0){if(_0x3962c0)_0x2fa54c(_0x3962c0);return _0x47ab1c();});});})[_0x8159('0x19')](function(){return _0x3df6d2[_0x8159('0x50')](_0x444236,_0x47641b,function(_0x2824e1){if(_0x2824e1){logger[_0x8159('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x2824e1);}else{fs[_0x8159('0x7e')](_0x444236);}});});});}else{return _0x3df6d2[_0x8159('0x1b')](0xc8);}})[_0x8159('0x35')](handleError(_0x3df6d2,null));};
\ No newline at end of file
+var _0xb7cd=['basename','existsSync','createReadStream','createWriteStream','out','System','firstName','secret','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','then','error','stack','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','catch','show','from','params','keys','filters','intersection','model','attributes','fields','length','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','attachments','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','name','Owner','get','mkdirSync','Openchannel','Account','N.A.','toString','closed','disposition','threadId','Public','Private'];(function(_0x5b6511,_0x256c92){var _0x529576=function(_0x5d5362){while(--_0x5d5362){_0x5b6511['push'](_0x5b6511['shift']());}};_0x529576(++_0x256c92);}(_0xb7cd,0x1a1));var _0xdb7c=function(_0x4a6031,_0x1696c1){_0x4a6031=_0x4a6031-0x0;var _0x41d2cf=_0xb7cd[_0x4a6031];return _0x41d2cf;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xdb7c('0x0'));var util=require('util');var path=require(_0xdb7c('0x1'));var ejs=require(_0xdb7c('0x2'));var fs=require('fs');var _=require(_0xdb7c('0x3'));var Redis=require(_0xdb7c('0x4'));var interaction=require(_0xdb7c('0x5'));var qs=require(_0xdb7c('0x6'));var pdf=require(_0xdb7c('0x7'));var logger=require('../../config/logger')(_0xdb7c('0x8'));var config=require(_0xdb7c('0x9'));var db=require('../../mysqldb')['db'];config[_0xdb7c('0xa')]=_['defaults'](config[_0xdb7c('0xa')],{'host':_0xdb7c('0xb'),'port':0x18eb});var socket=require(_0xdb7c('0xc'))(new Redis(config[_0xdb7c('0xa')]));require(_0xdb7c('0xd'))['register'](socket);function respondWithStatusCode(_0x222e1c,_0x4cde06){_0x4cde06=_0x4cde06||0xcc;return function(_0x5871ae){if(_0x5871ae){return _0x222e1c[_0xdb7c('0xe')](_0x4cde06);}return _0x222e1c[_0xdb7c('0xf')](_0x4cde06)[_0xdb7c('0x10')]();};}function respondWithResult(_0x5eab37,_0x578671){_0x578671=_0x578671||0xc8;return function(_0x22a60b){if(_0x22a60b){return _0x5eab37['status'](_0x578671)[_0xdb7c('0x11')](_0x22a60b);}};}function respondWithFilteredResult(_0x4351db,_0x5ec87d){return function(_0x258e32){if(_0x258e32){var _0x19df39=typeof _0x5ec87d[_0xdb7c('0x12')]===_0xdb7c('0x13')&&typeof _0x5ec87d[_0xdb7c('0x14')]===_0xdb7c('0x13');var _0x25b155=_0x258e32['count'];var _0x4b750e=_0x19df39?0x0:_0x5ec87d[_0xdb7c('0x12')];var _0x5f0b9f=_0x19df39?_0x258e32['count']:_0x5ec87d[_0xdb7c('0x12')]+_0x5ec87d[_0xdb7c('0x14')];var _0x3a6267;if(_0x5f0b9f>=_0x25b155){_0x5f0b9f=_0x25b155;_0x3a6267=0xc8;}else{_0x3a6267=0xce;}_0x4351db[_0xdb7c('0xf')](_0x3a6267);return _0x4351db[_0xdb7c('0x15')](_0xdb7c('0x16'),_0x4b750e+'-'+_0x5f0b9f+'/'+_0x25b155)['json'](_0x258e32);}return null;};}function saveUpdates(_0x57ba7a){return function(_0x53c10c){if(_0x53c10c){return _0x53c10c[_0xdb7c('0x17')](_0x57ba7a)['then'](function(_0x219978){return _0x219978;});}return null;};}function removeEntity(_0x846ed7){return function(_0x3447db){if(_0x3447db){return _0x3447db[_0xdb7c('0x18')]()[_0xdb7c('0x19')](function(){_0x846ed7[_0xdb7c('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2b68){return function(_0x225e56){if(!_0x225e56){_0x4f2b68[_0xdb7c('0xe')](0x194);}return _0x225e56;};}function handleError(_0x41fb76,_0x3cc739){_0x3cc739=_0x3cc739||0x1f4;return function(_0x3ae1de){logger[_0xdb7c('0x1a')](_0x3ae1de[_0xdb7c('0x1b')]);if(_0x3ae1de['name']){delete _0x3ae1de['name'];}_0x41fb76[_0xdb7c('0xf')](_0x3cc739)[_0xdb7c('0x1c')](_0x3ae1de);};}exports[_0xdb7c('0x1d')]=function(_0x2e457c,_0x2f5023){var _0xce2266={};var _0x336920=_['map'](db[_0xdb7c('0x1e')][_0xdb7c('0x1f')],function(_0x28f90a){return{'name':_0x28f90a[_0xdb7c('0x20')],'type':_0x28f90a[_0xdb7c('0x21')][_0xdb7c('0x22')]};});_0xce2266=qs[_0xdb7c('0x23')](_0x336920,_0x2e457c);return interaction['findAll'](_0xdb7c('0x24'),_0x2e457c[_0xdb7c('0x25')],_0x2e457c[_0xdb7c('0x26')],_0xce2266,_0x336920)[_0xdb7c('0x19')](respondWithFilteredResult(_0x2f5023,_0xce2266))[_0xdb7c('0x27')](handleError(_0x2f5023,null));};exports[_0xdb7c('0x28')]=function(_0x2581b0,_0x48ff24){var _0x259f92={};if(_0x2581b0[_0xdb7c('0x25')][_0xdb7c('0x21')]&&_0x2581b0['query']['type']===_0xdb7c('0x29')){_0x259f92[_0xdb7c('0x29')]=_0x2581b0[_0xdb7c('0x2a')]['id'];}else{_0x259f92['id']=_0x2581b0[_0xdb7c('0x2a')]['id'];}var _0x3c2c09={'raw':![],'where':_0x259f92},_0x54a028={};_0x54a028['model']=_[_0xdb7c('0x2b')](db['OpenchannelInteraction']['rawAttributes']);_0x54a028['query']=_['keys'](_0x2581b0['query']);_0x54a028[_0xdb7c('0x2c')]=_[_0xdb7c('0x2d')](_0x54a028[_0xdb7c('0x2e')],_0x54a028[_0xdb7c('0x25')]);_0x3c2c09[_0xdb7c('0x2f')]=_[_0xdb7c('0x2d')](_0x54a028['model'],qs[_0xdb7c('0x30')](_0x2581b0[_0xdb7c('0x25')][_0xdb7c('0x30')]));_0x3c2c09['attributes']=_0x3c2c09[_0xdb7c('0x2f')][_0xdb7c('0x31')]?_0x3c2c09[_0xdb7c('0x2f')]:_0x54a028['model'];if(_0x2581b0[_0xdb7c('0x25')]['includeAll']){_0x3c2c09[_0xdb7c('0x32')]=[{'all':!![]}];}_0x3c2c09=_['merge']({},_0x3c2c09,_0x2581b0[_0xdb7c('0x33')]);return db['OpenchannelInteraction'][_0xdb7c('0x34')](_0x3c2c09)[_0xdb7c('0x19')](handleEntityNotFound(_0x48ff24,null))[_0xdb7c('0x19')](respondWithResult(_0x48ff24,null))[_0xdb7c('0x27')](handleError(_0x48ff24,null));};exports[_0xdb7c('0x35')]=function(_0x36fc42,_0x31c6e5){return db[_0xdb7c('0x1e')][_0xdb7c('0x35')](_0x36fc42[_0xdb7c('0x36')],{})[_0xdb7c('0x19')](respondWithResult(_0x31c6e5,0xc9))['catch'](handleError(_0x31c6e5,null));};exports[_0xdb7c('0x17')]=function(_0x433006,_0x42a78b){if(_0x433006[_0xdb7c('0x36')]['id']){delete _0x433006[_0xdb7c('0x36')]['id'];}return db[_0xdb7c('0x1e')][_0xdb7c('0x34')]({'where':{'id':_0x433006[_0xdb7c('0x2a')]['id']}})[_0xdb7c('0x19')](handleEntityNotFound(_0x42a78b,null))[_0xdb7c('0x19')](saveUpdates(_0x433006[_0xdb7c('0x36')],null))[_0xdb7c('0x19')](respondWithResult(_0x42a78b,null))['catch'](handleError(_0x42a78b,null));};exports[_0xdb7c('0x18')]=function(_0x584dc4,_0x434ec5){return db[_0xdb7c('0x1e')][_0xdb7c('0x34')]({'where':{'id':_0x584dc4[_0xdb7c('0x2a')]['id']}})[_0xdb7c('0x19')](handleEntityNotFound(_0x434ec5,null))[_0xdb7c('0x19')](removeEntity(_0x434ec5,null))['catch'](handleError(_0x434ec5,null));};exports[_0xdb7c('0x37')]=function(_0x52afe4,_0x372d6b){return db[_0xdb7c('0x1e')][_0xdb7c('0x37')]()[_0xdb7c('0x19')](respondWithResult(_0x372d6b,null))[_0xdb7c('0x27')](handleError(_0x372d6b,null));};exports[_0xdb7c('0x38')]=function(_0x14a45f,_0x1f5f80){return db['OpenchannelMessage'][_0xdb7c('0x34')]({'where':{'id':_0x14a45f['params']['id']}})[_0xdb7c('0x19')](handleEntityNotFound(_0x1f5f80,null))[_0xdb7c('0x19')](function(_0x3affbe){if(_0x3affbe){return _0x3affbe['addMessage'](_0x14a45f['body'][_0xdb7c('0x39')],_[_0xdb7c('0x3a')](_0x14a45f[_0xdb7c('0x36')],[_0xdb7c('0x39'),'id'])||{});}})[_0xdb7c('0x19')](respondWithResult(_0x1f5f80,null))[_0xdb7c('0x27')](handleError(_0x1f5f80,null));};exports[_0xdb7c('0x3b')]=function(_0x18170d,_0x123814){var _0x5e7c66={'raw':![],'where':{}};var _0x405484={};var _0x17168b={'count':0x0,'rows':[]};return db[_0xdb7c('0x1e')][_0xdb7c('0x3c')]({'where':{'id':_0x18170d['params']['id']}})[_0xdb7c('0x19')](handleEntityNotFound(_0x123814,null))[_0xdb7c('0x19')](function(_0x1b5e19){if(_0x1b5e19){_0x405484[_0xdb7c('0x2e')]=_[_0xdb7c('0x2b')](db[_0xdb7c('0x3d')]['rawAttributes']);_0x405484[_0xdb7c('0x25')]=_[_0xdb7c('0x2b')](_0x18170d['query']);_0x405484[_0xdb7c('0x2c')]=_[_0xdb7c('0x2d')](_0x405484[_0xdb7c('0x2e')],_0x405484[_0xdb7c('0x25')]);_0x5e7c66['attributes']=_[_0xdb7c('0x2d')](_0x405484[_0xdb7c('0x2e')],qs['fields'](_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x30')]));_0x5e7c66[_0xdb7c('0x2f')]=_0x5e7c66[_0xdb7c('0x2f')]['length']?_0x5e7c66[_0xdb7c('0x2f')]:_0x405484[_0xdb7c('0x2e')];if(!_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x3e')](_0xdb7c('0x3f'))){_0x5e7c66[_0xdb7c('0x14')]=qs[_0xdb7c('0x14')](_0x18170d[_0xdb7c('0x25')]['limit']);_0x5e7c66[_0xdb7c('0x12')]=qs[_0xdb7c('0x12')](_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x12')]);}_0x5e7c66[_0xdb7c('0x40')]=qs[_0xdb7c('0x41')](_0x18170d[_0xdb7c('0x25')]['sort']);_0x5e7c66[_0xdb7c('0x42')]=qs[_0xdb7c('0x2c')](_[_0xdb7c('0x43')](_0x18170d[_0xdb7c('0x25')],_0x405484[_0xdb7c('0x2c')]));_0x5e7c66[_0xdb7c('0x42')][_0xdb7c('0x44')]=_0x1b5e19['id'];if(_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x45')]){_0x5e7c66['where']=_[_0xdb7c('0x46')](_0x5e7c66['where'],{'$or':_['map'](_0x5e7c66[_0xdb7c('0x2f')],function(_0x4df6a2){var _0x5cd6b2={};_0x5cd6b2[_0x4df6a2]={'$like':'%'+_0x18170d[_0xdb7c('0x25')]['filter']+'%'};return _0x5cd6b2;})});}if(_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x47')]){var _0x1ee682=_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x47')]['split'](',');var _0x18d7d6={};_0x18d7d6[_0x1ee682[0x0]]={'$gte':moment(_0x1ee682[0x1])[_0xdb7c('0x48')](_0xdb7c('0x49'))};_0x5e7c66[_0xdb7c('0x42')]=_['merge'](_0x5e7c66['where'],_0x18d7d6);}_0x5e7c66=_[_0xdb7c('0x46')]({},_0x5e7c66,_0x18170d[_0xdb7c('0x33')]);return db[_0xdb7c('0x3d')]['count']({'where':_0x5e7c66[_0xdb7c('0x42')]})[_0xdb7c('0x19')](function(_0x4753ba){_0x17168b['count']=_0x4753ba;if(_0x18170d[_0xdb7c('0x25')][_0xdb7c('0x4a')]){_0x5e7c66['include']=[{'all':!![]}];}return db[_0xdb7c('0x3d')]['findAll'](_0x5e7c66);})['then'](function(_0x4da831){_0x17168b[_0xdb7c('0x4b')]=_0x4da831;return _0x17168b;});}})['then'](respondWithFilteredResult(_0x123814,_0x5e7c66))[_0xdb7c('0x27')](handleError(_0x123814,null));};exports[_0xdb7c('0x4c')]=function(_0x551f7d,_0x3f5aa3){return db[_0xdb7c('0x1e')][_0xdb7c('0x34')]({'where':{'id':_0x551f7d['params']['id']}})[_0xdb7c('0x19')](handleEntityNotFound(_0x3f5aa3,null))[_0xdb7c('0x19')](function(_0x318189){if(_0x318189){return _0x318189[_0xdb7c('0x4d')](_0x551f7d[_0xdb7c('0x36')][_0xdb7c('0x39')],_[_0xdb7c('0x3a')](_0x551f7d[_0xdb7c('0x36')],[_0xdb7c('0x39'),'id'])||{})[_0xdb7c('0x4e')](function(){return db[_0xdb7c('0x4f')]['findAll']({'attributes':['id','name',_0xdb7c('0x50')],'where':{'id':_0x551f7d[_0xdb7c('0x36')][_0xdb7c('0x39')]}});})[_0xdb7c('0x19')](function(_0xa9125f){socket['emit'](_0xdb7c('0x51'),{'id':Number(_0x551f7d['params']['id']),'tags':_0xa9125f||[]});return{'id':Number(_0x551f7d[_0xdb7c('0x2a')]['id']),'tags':_0xa9125f||[]};});}})[_0xdb7c('0x19')](respondWithResult(_0x3f5aa3,null))[_0xdb7c('0x27')](handleError(_0x3f5aa3,null));};exports[_0xdb7c('0x52')]=function(_0x4cd179,_0x515fc6){return db['OpenchannelInteraction'][_0xdb7c('0x34')]({'where':{'id':_0x4cd179['params']['id']}})[_0xdb7c('0x19')](handleEntityNotFound(_0x515fc6,null))['then'](function(_0x112429){if(_0x112429){return _0x112429[_0xdb7c('0x52')](_0x4cd179[_0xdb7c('0x25')][_0xdb7c('0x39')]);}})[_0xdb7c('0x19')](respondWithStatusCode(_0x515fc6,null))[_0xdb7c('0x27')](handleError(_0x515fc6,null));};exports[_0xdb7c('0x53')]=function(_0x4b2981,_0x27b5a4){var _0x42fc45=moment()[_0xdb7c('0x54')]()['toString']();var _0xc93439=path[_0xdb7c('0x55')](config[_0xdb7c('0x56')],'server',_0xdb7c('0x57'),'tmp');var _0xb94b07=path[_0xdb7c('0x55')](config[_0xdb7c('0x56')],'server',_0xdb7c('0x57'),'attachments');var _0x289d37=path[_0xdb7c('0x55')](_0xc93439,_0x42fc45);var _0x4e1702=util[_0xdb7c('0x48')](_0xdb7c('0x58'),_0x4b2981[_0xdb7c('0x2a')]['id'],_0x42fc45);var _0x247fbc=path['join'](_0xc93439,_0x4e1702);var _0x4c96b7=[];_0x4c96b7[_0xdb7c('0x59')]({'model':db[_0xdb7c('0x5a')],'as':_0xdb7c('0x5a'),'attributes':['id',_0xdb7c('0x5b')],'raw':!![]});_0x4c96b7['push']({'model':db[_0xdb7c('0x5c')],'as':_0xdb7c('0x5d'),'attributes':['id','firstName',_0xdb7c('0x5e')],'raw':!![]});if(_0x4b2981[_0xdb7c('0x25')][_0xdb7c('0x5f')]){_0x4c96b7[_0xdb7c('0x59')]({'model':db[_0xdb7c('0x60')],'as':_0xdb7c('0x60'),'raw':!![]});}var _0x693a0f=[{'model':db[_0xdb7c('0x3d')],'as':_0xdb7c('0x61'),'attributes':['id',_0xdb7c('0x36'),_0xdb7c('0x62'),_0xdb7c('0x63'),'secret',_0xdb7c('0x64')],'include':_0x4c96b7}];_0x693a0f[_0xdb7c('0x59')]({'model':db[_0xdb7c('0x65')],'as':'Account','attributes':['id',_0xdb7c('0x66')]});_0x693a0f[_0xdb7c('0x59')]({'model':db['User'],'as':_0xdb7c('0x67'),'attributes':['id',_0xdb7c('0x5b')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x4b2981[_0xdb7c('0x2a')]['id']},'include':_0x693a0f})['then'](handleEntityNotFound(_0x27b5a4,null))[_0xdb7c('0x19')](function(_0xe41510){if(_0xe41510){var _0x3f3b4f=_0xe41510[_0xdb7c('0x68')]({'plain':!![]});fs[_0xdb7c('0x69')](_0x289d37);var _0x1576c4={'channel':_0xdb7c('0x6a'),'account':_0x3f3b4f[_0xdb7c('0x6b')]['name'],'agent':_0x3f3b4f[_0xdb7c('0x67')]?_0x3f3b4f[_0xdb7c('0x67')][_0xdb7c('0x5b')]:_0xdb7c('0x6c'),'createdAt':moment(_0x3f3b4f['createdAt'])['format'](_0xdb7c('0x49'))[_0xdb7c('0x6d')](),'closedAt':_0x3f3b4f[_0xdb7c('0x6e')]?moment(_0x3f3b4f['closedAt'])[_0xdb7c('0x48')](_0xdb7c('0x49'))[_0xdb7c('0x6d')]():'','disposition':_0x3f3b4f[_0xdb7c('0x6f')],'visibility':_0x3f3b4f[_0xdb7c('0x70')]?_0xdb7c('0x71'):_0xdb7c('0x72'),'messages':_(_0x3f3b4f['Messages'])['filter']({'secret':![]})['map'](function(_0x4de10c){if(_0x4de10c['Attachment']){var _0x1b15b8=path[_0xdb7c('0x55')](_0xb94b07,_0x4de10c[_0xdb7c('0x60')][_0xdb7c('0x73')]);if(fs[_0xdb7c('0x74')](_0x1b15b8)){fs[_0xdb7c('0x75')](_0x1b15b8)['pipe'](fs[_0xdb7c('0x76')](path[_0xdb7c('0x55')](_0x289d37,_0x4de10c[_0xdb7c('0x60')][_0xdb7c('0x73')])));}}return{'date':moment(_0x4de10c[_0xdb7c('0x62')])[_0xdb7c('0x48')](_0xdb7c('0x49'))[_0xdb7c('0x6d')](),'sender':_0x4de10c[_0xdb7c('0x63')]===_0xdb7c('0x77')?_0x4de10c[_0xdb7c('0x5a')]?_0x4de10c[_0xdb7c('0x5a')][_0xdb7c('0x5b')]:_0xdb7c('0x78'):_0x4de10c[_0xdb7c('0x5d')][_0xdb7c('0x79')]+(_0x4de10c['Contact'][_0xdb7c('0x5e')]?'\x20'+_0x4de10c[_0xdb7c('0x5d')][_0xdb7c('0x5e')]:''),'body':_0x4de10c['Attachment']?_0x4de10c[_0xdb7c('0x60')][_0xdb7c('0x73')]:_0x4de10c['body'],'direction':_0x4de10c[_0xdb7c('0x63')]===_0xdb7c('0x77')?'A':'C','secret':_0x4de10c[_0xdb7c('0x7a')],'read':_0x4de10c[_0xdb7c('0x64')],'attachment':_0x4de10c[_0xdb7c('0x60')]};})[_0xdb7c('0x7b')]()};return ejs[_0xdb7c('0x7c')](path[_0xdb7c('0x55')](config[_0xdb7c('0x56')],_0xdb7c('0x7d'),_0xdb7c('0x7e'),_0xdb7c('0x7f')),{'interaction':_0x1576c4})['then'](function(_0x270c0a){var _0x9b5f2f=path['join'](_0x289d37,_0xdb7c('0x80')+_0x3f3b4f['id']+'-'+_0x42fc45+_0xdb7c('0x81'));var _0x505233={'path':_0x9b5f2f,'channel':_0xdb7c('0x6a'),'interactionId':_0x3f3b4f['id']};return pdf[_0xdb7c('0x82')](_0x270c0a,_0x505233);})[_0xdb7c('0x19')](function(){return new Promise(function(_0x220826,_0x59825b){zipdir(_0x289d37,{'saveTo':_0x247fbc},function(_0x5471d6,_0x1a6e74){if(_0x5471d6)return _0x59825b(_0x5471d6);return _0x220826(_0x1a6e74);});})[_0xdb7c('0x19')](function(){return new Promise(function(_0x48df86,_0x1eebd7){rimraf(_0x289d37,function(_0x5e4c0c){if(_0x5e4c0c)_0x1eebd7(_0x5e4c0c);return _0x48df86();});});})[_0xdb7c('0x19')](function(){return _0x27b5a4[_0xdb7c('0x53')](_0x247fbc,_0x4e1702,function(_0x107e37){if(_0x107e37){logger['error'](_0xdb7c('0x83'),_0x107e37);}else{fs[_0xdb7c('0x84')](_0x247fbc);}});});});}else{return _0x27b5a4[_0xdb7c('0xe')](0xc8);}})['catch'](handleError(_0x27b5a4,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39ed=['unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map'];(function(_0x4c2006,_0x398e61){var _0x4a37da=function(_0x4632c8){while(--_0x4632c8){_0x4c2006['push'](_0x4c2006['shift']());}};_0x4a37da(++_0x398e61);}(_0x39ed,0x155));var _0xd39e=function(_0x24cfa6,_0x3933b6){_0x24cfa6=_0x24cfa6-0x0;var _0x3e89c6=_0x39ed[_0x24cfa6];return _0x3e89c6;};'use strict';var EventEmitter=require(_0xd39e('0x0'));var OpenchannelInteraction=require(_0xd39e('0x1'))['db'][_0xd39e('0x2')];var OpenchannelMessage=require(_0xd39e('0x1'))['db'][_0xd39e('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd39e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd39e('0x5')};function emitEvent(_0x23a554){return function(_0x388a51,_0x5151d7,_0x597f52){_0x388a51[_0xd39e('0x6')]({'attributes':['id'],'raw':!![]})[_0xd39e('0x7')](function(_0x2bdf39){_0x388a51[_0xd39e('0x8')](_0xd39e('0x9'),_0x2bdf39[_0xd39e('0xa')](function(_0x25125e){return{'id':_0x25125e['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x388a51['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd39e('0x7')](function(_0x596d5d){_0x388a51['setDataValue'](_0xd39e('0xb'),_0x596d5d['length']);OpenchannelInteractionEvents[_0xd39e('0xc')](_0x23a554+':'+_0x388a51['id'],_0x388a51);OpenchannelInteractionEvents[_0xd39e('0xc')](_0x23a554,_0x388a51);_0x597f52(null);})['catch'](_0x597f52(null));};}for(var e in events){if(events[_0xd39e('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xd39e('0xe')](e,emitEvent(event));}}module[_0xd39e('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x4172=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','then','setDataValue','Users'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x4172,0x13b));var _0x2417=function(_0x513de6,_0x3c8010){_0x513de6=_0x513de6-0x0;var _0x254f45=_0x4172[_0x513de6];return _0x254f45;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x2417('0x0'))['db'][_0x2417('0x1')];var OpenchannelMessage=require(_0x2417('0x0'))['db'][_0x2417('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2417('0x3'),'afterUpdate':_0x2417('0x4'),'afterDestroy':_0x2417('0x5')};function emitEvent(_0x44aebb){return function(_0xade239,_0x1fe478,_0x4e0820){_0xade239['getUsers']({'attributes':['id'],'raw':!![]})[_0x2417('0x6')](function(_0x10da42){_0xade239[_0x2417('0x7')](_0x2417('0x8'),_0x10da42[_0x2417('0x9')](function(_0x1c65ca){return{'id':_0x1c65ca['id']};}));return OpenchannelMessage[_0x2417('0xa')]({'where':{'OpenchannelInteractionId':_0xade239['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2417('0x6')](function(_0x5ba455){_0xade239[_0x2417('0x7')](_0x2417('0xb'),_0x5ba455[_0x2417('0xc')]);OpenchannelInteractionEvents[_0x2417('0xd')](_0x44aebb+':'+_0xade239['id'],_0xade239);OpenchannelInteractionEvents[_0x2417('0xd')](_0x44aebb,_0xade239);_0x4e0820(null);})[_0x2417('0xe')](_0x4e0820(null));};}for(var e in events){if(events[_0x2417('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x2417('0x10')](e,emitEvent(event));}}module[_0x2417('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa348=['./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x9a9370,_0x25cd69){var _0x1418af=function(_0x6bdf7d){while(--_0x6bdf7d){_0x9a9370['push'](_0x9a9370['shift']());}};_0x1418af(++_0x25cd69);}(_0xa348,0x79));var _0x8a34=function(_0x4d4320,_0x19b3c1){_0x4d4320=_0x4d4320-0x0;var _0x4642b2=_0xa348[_0x4d4320];return _0x4642b2;};'use strict';var _=require(_0x8a34('0x0'));var util=require(_0x8a34('0x1'));var logger=require('../../config/logger')(_0x8a34('0x2'));var moment=require('moment');var BPromise=require(_0x8a34('0x3'));var rp=require(_0x8a34('0x4'));var fs=require('fs');var path=require(_0x8a34('0x5'));var rimraf=require('rimraf');var config=require(_0x8a34('0x6'));var attributes=require(_0x8a34('0x7'));module[_0x8a34('0x8')]=function(_0x2822af,_0x5cc579){return _0x2822af[_0x8a34('0x9')](_0x8a34('0xa'),attributes,{'tableName':_0x8a34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a34('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x9f4962,_0x557d59,_0x54a0a4){if(_0x9f4962[_0x8a34('0xd')]('closed')){_0x9f4962['closedAt']=moment()[_0x8a34('0xe')](_0x8a34('0xf'));}_0x54a0a4(null,_0x9f4962);}}});};
\ No newline at end of file
+var _0x49cc=['moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closedAt','lodash'];(function(_0x8d9123,_0xc54b01){var _0x359d08=function(_0x16d535){while(--_0x16d535){_0x8d9123['push'](_0x8d9123['shift']());}};_0x359d08(++_0xc54b01);}(_0x49cc,0xc3));var _0xc49c=function(_0x403760,_0x2d056a){_0x403760=_0x403760-0x0;var _0x2c9db5=_0x49cc[_0x403760];return _0x2c9db5;};'use strict';var _=require(_0xc49c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc49c('0x1'));var BPromise=require(_0xc49c('0x2'));var rp=require(_0xc49c('0x3'));var fs=require('fs');var path=require(_0xc49c('0x4'));var rimraf=require(_0xc49c('0x5'));var config=require('../../config/environment');var attributes=require(_0xc49c('0x6'));module[_0xc49c('0x7')]=function(_0x2170b8,_0x228fcf){return _0x2170b8[_0xc49c('0x8')](_0xc49c('0x9'),attributes,{'tableName':_0xc49c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc49c('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x530952,_0x32c44c,_0x699a70){if(_0x530952[_0xc49c('0xc')]('closed')){_0x530952[_0xc49c('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x699a70(null,_0x530952);}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a4c=['OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','limit','info','AddTagsToOpenchannelInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then'];(function(_0x42aabd,_0x217ade){var _0x2e83fb=function(_0x1508d8){while(--_0x1508d8){_0x42aabd['push'](_0x42aabd['shift']());}};_0x2e83fb(++_0x217ade);}(_0x4a4c,0x1e4));var _0xc4a4=function(_0x251664,_0x59f13d){_0x251664=_0x251664-0x0;var _0x449eb9=_0x4a4c[_0x251664];return _0x449eb9;};'use strict';var _=require(_0xc4a4('0x0'));var util=require(_0xc4a4('0x1'));var moment=require(_0xc4a4('0x2'));var BPromise=require(_0xc4a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4a4('0x4'));var db=require(_0xc4a4('0x5'))['db'];var utils=require(_0xc4a4('0x6'));var logger=require(_0xc4a4('0x7'))(_0xc4a4('0x8'));var config=require(_0xc4a4('0x9'));var jayson=require(_0xc4a4('0xa'));var client=jayson[_0xc4a4('0xb')][_0xc4a4('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc4a4('0xd')],{'host':_0xc4a4('0xe'),'port':0x18eb});var socket=require(_0xc4a4('0xf'))(new Redis(config[_0xc4a4('0xd')]));require(_0xc4a4('0x10'))[_0xc4a4('0x11')](socket);function respondWithRpcPromise(_0xf8c94a,_0x239d2f,_0x3d0c26){return new BPromise(function(_0x31934a,_0x432352){return client[_0xc4a4('0x12')](_0xf8c94a,_0x3d0c26)[_0xc4a4('0x13')](function(_0x47acd7){logger['info'](_0xc4a4('0x14'),_0x239d2f,_0xc4a4('0x15'));logger[_0xc4a4('0x16')](_0xc4a4('0x17'),_0x239d2f,_0xc4a4('0x15'),JSON[_0xc4a4('0x18')](_0x47acd7));if(_0x47acd7[_0xc4a4('0x19')]){if(_0x47acd7[_0xc4a4('0x19')]['code']===0x1f4){logger['error'](_0xc4a4('0x14'),_0x239d2f,_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);return _0x432352(_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);}logger[_0xc4a4('0x19')](_0xc4a4('0x14'),_0x239d2f,_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);return _0x31934a(_0x47acd7[_0xc4a4('0x19')][_0xc4a4('0x1a')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x239d2f,'request\x20sent');_0x31934a(_0x47acd7['result'][_0xc4a4('0x1a')]);}})[_0xc4a4('0x1b')](function(_0x42ffc2){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x239d2f,_0x42ffc2);_0x432352(_0x42ffc2);});});}exports[_0xc4a4('0x1c')]=function(_0x2c20f5){var _0x1607b2=this;return new Promise(function(_0x20edb9,_0x5a4e03){return db[_0xc4a4('0x1d')]['update'](_0x2c20f5['body'],{'raw':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5['options'][_0xc4a4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5['options'][_0xc4a4('0x20')]||null:null,'attributes':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5['options']['attributes']||null:null,'limit':_0x2c20f5[_0xc4a4('0x1e')]?_0x2c20f5[_0xc4a4('0x1e')][_0xc4a4('0x21')]||null:null})[_0xc4a4('0x13')](function(_0x338eaf){logger[_0xc4a4('0x22')](_0xc4a4('0x1c'),_0x2c20f5);logger[_0xc4a4('0x16')](_0xc4a4('0x1c'),_0x2c20f5,JSON[_0xc4a4('0x18')](_0x338eaf));_0x20edb9(_0x338eaf);})['catch'](function(_0x10107d){logger[_0xc4a4('0x19')](_0xc4a4('0x1c'),_0x10107d['message'],_0x2c20f5);_0x5a4e03(_0x1607b2['error'](0x1f4,_0x10107d['message']));});});};exports[_0xc4a4('0x23')]=function(_0x43696d){return new Promise(function(_0x3ba0a0,_0x114f29){return db[_0xc4a4('0x1d')][_0xc4a4('0x24')]({'where':_0x43696d[_0xc4a4('0x1e')]?_0x43696d['options'][_0xc4a4('0x20')]||null:null})[_0xc4a4('0x13')](function(_0x295d20){if(_0x295d20){return _0x295d20[_0xc4a4('0x25')](_0x43696d[_0xc4a4('0x26')][_0xc4a4('0x27')],_['omit'](_0x43696d['body'],[_0xc4a4('0x27'),'id'])||{});}})[_0xc4a4('0x28')](function(_0x52cabd){logger['info'](_0xc4a4('0x29'),_0x43696d);logger[_0xc4a4('0x16')](_0xc4a4('0x29'),_0x43696d,JSON[_0xc4a4('0x18')](_0x52cabd));_0x3ba0a0(_0x52cabd);})[_0xc4a4('0x1b')](function(_0x4026fb){logger[_0xc4a4('0x19')](_0xc4a4('0x29'),_0x4026fb[_0xc4a4('0x1a')],_0x43696d);_0x114f29(_this['error'](0x1f4,_0x4026fb[_0xc4a4('0x1a')]));});});};
\ No newline at end of file
+var _0x9b51=['code','message','info','result','catch','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0x9b51,0x92));var _0x19b5=function(_0x4d2d4c,_0x9d1720){_0x4d2d4c=_0x4d2d4c-0x0;var _0x245610=_0x9b51[_0x4d2d4c];return _0x245610;};'use strict';var _=require(_0x19b5('0x0'));var util=require('util');var moment=require(_0x19b5('0x1'));var BPromise=require(_0x19b5('0x2'));var rs=require(_0x19b5('0x3'));var fs=require('fs');var Redis=require(_0x19b5('0x4'));var db=require(_0x19b5('0x5'))['db'];var utils=require(_0x19b5('0x6'));var logger=require('../../config/logger')(_0x19b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x19b5('0x8'));var client=jayson[_0x19b5('0x9')][_0x19b5('0xa')]({'port':0x232a});config[_0x19b5('0xb')]=_[_0x19b5('0xc')](config[_0x19b5('0xb')],{'host':_0x19b5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19b5('0xb')]));require('./openchannelInteraction.socket')[_0x19b5('0xe')](socket);function respondWithRpcPromise(_0x47bb76,_0x15e9ff,_0xcd2bc9){return new BPromise(function(_0x5e9e41,_0x3e741f){return client[_0x19b5('0xf')](_0x47bb76,_0xcd2bc9)[_0x19b5('0x10')](function(_0x4a9e19){logger['info'](_0x19b5('0x11'),_0x15e9ff,'request\x20sent');logger[_0x19b5('0x12')](_0x19b5('0x13'),_0x15e9ff,_0x19b5('0x14'),JSON['stringify'](_0x4a9e19));if(_0x4a9e19[_0x19b5('0x15')]){if(_0x4a9e19[_0x19b5('0x15')][_0x19b5('0x16')]===0x1f4){logger[_0x19b5('0x15')](_0x19b5('0x11'),_0x15e9ff,_0x4a9e19[_0x19b5('0x15')][_0x19b5('0x17')]);return _0x3e741f(_0x4a9e19[_0x19b5('0x15')][_0x19b5('0x17')]);}logger[_0x19b5('0x15')](_0x19b5('0x11'),_0x15e9ff,_0x4a9e19['error'][_0x19b5('0x17')]);return _0x5e9e41(_0x4a9e19[_0x19b5('0x15')][_0x19b5('0x17')]);}else{logger[_0x19b5('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x15e9ff,_0x19b5('0x14'));_0x5e9e41(_0x4a9e19[_0x19b5('0x19')]['message']);}})[_0x19b5('0x1a')](function(_0x43ee13){logger[_0x19b5('0x15')](_0x19b5('0x11'),_0x15e9ff,_0x43ee13);_0x3e741f(_0x43ee13);});});}exports['UpdateOpenchannelInteraction']=function(_0x156adc){var _0x38809f=this;return new Promise(function(_0x5ca2b6,_0x2edc11){return db[_0x19b5('0x1b')][_0x19b5('0x1c')](_0x156adc[_0x19b5('0x1d')],{'raw':_0x156adc[_0x19b5('0x1e')]?_0x156adc[_0x19b5('0x1e')][_0x19b5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x156adc['options']?_0x156adc[_0x19b5('0x1e')][_0x19b5('0x20')]||null:null,'attributes':_0x156adc[_0x19b5('0x1e')]?_0x156adc[_0x19b5('0x1e')]['attributes']||null:null,'limit':_0x156adc[_0x19b5('0x1e')]?_0x156adc[_0x19b5('0x1e')][_0x19b5('0x21')]||null:null})[_0x19b5('0x10')](function(_0x107c7e){logger['info'](_0x19b5('0x22'),_0x156adc);logger[_0x19b5('0x12')](_0x19b5('0x22'),_0x156adc,JSON[_0x19b5('0x23')](_0x107c7e));_0x5ca2b6(_0x107c7e);})[_0x19b5('0x1a')](function(_0x35ff33){logger[_0x19b5('0x15')]('UpdateOpenchannelInteraction',_0x35ff33[_0x19b5('0x17')],_0x156adc);_0x2edc11(_0x38809f[_0x19b5('0x15')](0x1f4,_0x35ff33[_0x19b5('0x17')]));});});};exports[_0x19b5('0x24')]=function(_0x236948){return new Promise(function(_0x4df96a,_0x188967){return db[_0x19b5('0x1b')][_0x19b5('0x25')]({'where':_0x236948[_0x19b5('0x1e')]?_0x236948[_0x19b5('0x1e')][_0x19b5('0x20')]||null:null})[_0x19b5('0x10')](function(_0x14ad07){if(_0x14ad07){return _0x14ad07[_0x19b5('0x26')](_0x236948[_0x19b5('0x1d')][_0x19b5('0x27')],_['omit'](_0x236948[_0x19b5('0x1d')],[_0x19b5('0x27'),'id'])||{});}})[_0x19b5('0x28')](function(_0x692243){logger[_0x19b5('0x18')](_0x19b5('0x29'),_0x236948);logger[_0x19b5('0x12')](_0x19b5('0x29'),_0x236948,JSON[_0x19b5('0x23')](_0x692243));_0x4df96a(_0x692243);})[_0x19b5('0x1a')](function(_0x52f89b){logger[_0x19b5('0x15')]('AddTags',_0x52f89b[_0x19b5('0x17')],_0x236948);_0x188967(_this['error'](0x1f4,_0x52f89b[_0x19b5('0x17')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa046=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xa046,0x1ec));var _0x6a04=function(_0x52758d,_0x622cbe){_0x52758d=_0x52758d-0x0;var _0x5f2a18=_0xa046[_0x52758d];return _0x5f2a18;};'use strict';var OpenchannelInteractionEvents=require(_0x6a04('0x0'));var events=[_0x6a04('0x1'),_0x6a04('0x2'),_0x6a04('0x3')];function createListener(_0x3af2fc,_0x2fab26){return function(_0x22e6af){_0x2fab26['emit'](_0x3af2fc,_0x22e6af);};}function removeListener(_0x7ce75,_0xb56434){return function(){OpenchannelInteractionEvents[_0x6a04('0x4')](_0x7ce75,_0xb56434);};}exports[_0x6a04('0x5')]=function(_0x14594c){for(var _0x2d948e=0x0,_0x35f302=events[_0x6a04('0x6')];_0x2d948e<_0x35f302;_0x2d948e++){var _0x11fd28=events[_0x2d948e];var _0x376afd=createListener(_0x6a04('0x7')+_0x11fd28,_0x14594c);OpenchannelInteractionEvents['on'](_0x11fd28,_0x376afd);}};
\ No newline at end of file
+var _0x080a=['./openchannelInteraction.events','save','update','emit','removeListener','openchannelInteraction:'];(function(_0x310291,_0x7ceb79){var _0x22bbda=function(_0x555879){while(--_0x555879){_0x310291['push'](_0x310291['shift']());}};_0x22bbda(++_0x7ceb79);}(_0x080a,0x17a));var _0xa080=function(_0x1ecef4,_0x155f2e){_0x1ecef4=_0x1ecef4-0x0;var _0x314e12=_0x080a[_0x1ecef4];return _0x314e12;};'use strict';var OpenchannelInteractionEvents=require(_0xa080('0x0'));var events=[_0xa080('0x1'),'remove',_0xa080('0x2')];function createListener(_0x412781,_0xb5549){return function(_0x347aad){_0xb5549[_0xa080('0x3')](_0x412781,_0x347aad);};}function removeListener(_0x1c866b,_0x1a3da4){return function(){OpenchannelInteractionEvents[_0xa080('0x4')](_0x1c866b,_0x1a3da4);};}exports['register']=function(_0x5262ad){for(var _0xf0d92d=0x0,_0x58ec93=events['length'];_0xf0d92d<_0x58ec93;_0xf0d92d++){var _0x167853=events[_0xf0d92d];var _0x13a2e5=createListener(_0xa080('0x5')+_0x167853,_0x5262ad);OpenchannelInteractionEvents['on'](_0x167853,_0x13a2e5);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2f269f,_0xaddcad){var _0x4f433b=function(_0x54a7fb){while(--_0x54a7fb){_0x2f269f['push'](_0x2f269f['shift']());}};_0x4f433b(++_0xaddcad);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f6f30,_0x31daaf){_0x1f6f30=_0x1f6f30-0x0;var _0x5bbe91=_0xedd9[_0x1f6f30];return _0x5bbe91;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router;
\ No newline at end of file
+var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x867f=['ENUM','out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x187d72,_0xa3a82){var _0x3b3fea=function(_0x45ee56){while(--_0x45ee56){_0x187d72['push'](_0x187d72['shift']());}};_0x3b3fea(++_0xa3a82);}(_0x867f,0xdc));var _0xf867=function(_0x47024a,_0x2cc60a){_0x47024a=_0x47024a-0x0;var _0xc021b8=_0x867f[_0x47024a];return _0xc021b8;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'body':{'type':Sequelize[_0xf867('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf867('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf867('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf867('0x4')]('in','out'),'defaultValue':_0xf867('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xf867('0x6')]},'providerResponse':{'type':Sequelize[_0xf867('0x2')]}};
\ No newline at end of file
+var _0xee4e=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x242220,_0x175616){var _0x146936=function(_0x547c4d){while(--_0x547c4d){_0x242220['push'](_0x242220['shift']());}};_0x146936(++_0x175616);}(_0xee4e,0x122));var _0xeee4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xee4e[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'body':{'type':Sequelize[_0xeee4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xeee4('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeee4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeee4('0x4')]('in',_0xeee4('0x5')),'defaultValue':_0xeee4('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeee4('0x6')]},'providerName':{'type':Sequelize[_0xeee4('0x7')]},'providerResponse':{'type':Sequelize[_0xeee4('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b50=['Sequelize','QueryTypes','SELECT','User','fullname','internal','interface','channel','motionChannel','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','contact','email','SIP/%s','event','EventManager','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','then','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','options','count','include','findAll','rows','show','params','includeAll','find','body','update','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0x3240a1,_0xc43fb5){var _0x11f3d6=function(_0x2aaca2){while(--_0x2aaca2){_0x3240a1['push'](_0x3240a1['shift']());}};_0x11f3d6(++_0xc43fb5);}(_0x1b50,0x94));var _0x01b5=function(_0x370859,_0x350459){_0x370859=_0x370859-0x0;var _0x1d7dae=_0x1b50[_0x370859];return _0x1d7dae;};'use strict';var emlformat=require(_0x01b5('0x0'));var rimraf=require(_0x01b5('0x1'));var zipdir=require(_0x01b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01b5('0x3'));var moment=require(_0x01b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x01b5('0x5'));var util=require(_0x01b5('0x6'));var path=require(_0x01b5('0x7'));var sox=require(_0x01b5('0x8'));var csv=require(_0x01b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x01b5('0xa'));var crypto=require(_0x01b5('0xb'));var jsforce=require(_0x01b5('0xc'));var deskjs=require(_0x01b5('0xd'));var toCsv=require(_0x01b5('0x9'));var querystring=require(_0x01b5('0xe'));var Papa=require(_0x01b5('0xf'));var Redis=require(_0x01b5('0x10'));var authService=require(_0x01b5('0x11'));var qs=require(_0x01b5('0x12'));var as=require(_0x01b5('0x13'));var hardwareService=require(_0x01b5('0x14'));var logger=require('../../config/logger')(_0x01b5('0x15'));var utils=require(_0x01b5('0x16'));var config=require(_0x01b5('0x17'));var licenseUtil=require(_0x01b5('0x18'));var db=require(_0x01b5('0x19'))['db'];config[_0x01b5('0x1a')]=_[_0x01b5('0x1b')](config[_0x01b5('0x1a')],{'host':_0x01b5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01b5('0x1a')]));require(_0x01b5('0x1d'))['register'](socket);var jayson=require(_0x01b5('0x1e'));var client=jayson[_0x01b5('0x1f')][_0x01b5('0x20')]({'port':0x232c});var client9002=jayson[_0x01b5('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56562f,_0x347501,_0x4878a9,_0xcf3422){return new BPromise(function(_0x4518be,_0x1fe13b){var _0x553806=_0xcf3422||client;return _0x553806[_0x01b5('0x21')](_0x56562f,_0x4878a9)['then'](function(_0x4b03ae){logger[_0x01b5('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x01b5('0x23'));logger[_0x01b5('0x24')](_0x01b5('0x25'),_0x347501,'request\x20sent',JSON[_0x01b5('0x26')](_0x4b03ae));if(_0x4b03ae[_0x01b5('0x27')]){if(_0x4b03ae[_0x01b5('0x27')][_0x01b5('0x28')]===0x1f4){logger[_0x01b5('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x4b03ae['error']['message']);return _0x1fe13b(_0x4b03ae[_0x01b5('0x27')]['message']);}logger[_0x01b5('0x27')](_0x01b5('0x29'),_0x347501,_0x4b03ae[_0x01b5('0x27')][_0x01b5('0x2a')]);return _0x4518be(_0x4b03ae['error'][_0x01b5('0x2a')]);}else{logger[_0x01b5('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x01b5('0x23'));_0x4518be(_0x4b03ae['result']['message']);}})[_0x01b5('0x2b')](function(_0x17e9ec){logger[_0x01b5('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x347501,_0x17e9ec);_0x1fe13b(_0x17e9ec);});});}function respondWithStatusCode(_0x3a8045,_0x34c4ee){_0x34c4ee=_0x34c4ee||0xcc;return function(_0x4125de){if(_0x4125de){return _0x3a8045[_0x01b5('0x2c')](_0x34c4ee);}return _0x3a8045[_0x01b5('0x2d')](_0x34c4ee)[_0x01b5('0x2e')]();};}function respondWithResult(_0x8fbcff,_0x287b2f){_0x287b2f=_0x287b2f||0xc8;return function(_0x114005){if(_0x114005){return _0x8fbcff[_0x01b5('0x2d')](_0x287b2f)['json'](_0x114005);}};}function respondWithFilteredResult(_0xbf007,_0x3e8fa0){return function(_0x1e824e){if(_0x1e824e){var _0x9fdda2=typeof _0x3e8fa0[_0x01b5('0x2f')]===_0x01b5('0x30')&&typeof _0x3e8fa0[_0x01b5('0x31')]===_0x01b5('0x30');var _0xb682ff=_0x1e824e['count'];var _0x437e92=_0x9fdda2?0x0:_0x3e8fa0['offset'];var _0x3deb7b=_0x9fdda2?_0x1e824e['count']:_0x3e8fa0[_0x01b5('0x2f')]+_0x3e8fa0[_0x01b5('0x31')];var _0x3745f5;if(_0x3deb7b>=_0xb682ff){_0x3deb7b=_0xb682ff;_0x3745f5=0xc8;}else{_0x3745f5=0xce;}_0xbf007[_0x01b5('0x2d')](_0x3745f5);return _0xbf007[_0x01b5('0x32')]('Content-Range',_0x437e92+'-'+_0x3deb7b+'/'+_0xb682ff)[_0x01b5('0x33')](_0x1e824e);}return null;};}function patchUpdates(_0x28850c){return function(_0x168e36){try{jsonpatch[_0x01b5('0x34')](_0x168e36,_0x28850c,!![]);}catch(_0x23f1db){return BPromise[_0x01b5('0x35')](_0x23f1db);}return _0x168e36['save']();};}function saveUpdates(_0x46d808,_0x58a119){return function(_0x2cdbc4){if(_0x2cdbc4){return _0x2cdbc4['update'](_0x46d808)[_0x01b5('0x36')](function(_0x1a0dab){return _0x1a0dab;});}return null;};}function removeEntity(_0x89e2a5,_0x10f205){return function(_0x58a37e){if(_0x58a37e){return _0x58a37e['destroy']()[_0x01b5('0x36')](function(){_0x89e2a5[_0x01b5('0x2d')](0xcc)[_0x01b5('0x2e')]();});}};}function handleEntityNotFound(_0xeb4532,_0x2128c1){return function(_0x3012ea){if(!_0x3012ea){_0xeb4532[_0x01b5('0x2c')](0x194);}return _0x3012ea;};}function handleError(_0x1ef41e,_0x4cb73a){_0x4cb73a=_0x4cb73a||0x1f4;return function(_0x2fe29f){logger[_0x01b5('0x27')](_0x2fe29f[_0x01b5('0x37')]);if(_0x2fe29f['name']){delete _0x2fe29f[_0x01b5('0x38')];}_0x1ef41e[_0x01b5('0x2d')](_0x4cb73a)[_0x01b5('0x39')](_0x2fe29f);};}exports[_0x01b5('0x3a')]=function(_0x59f2a8,_0x2952c7){var _0x539f2e={},_0x2b1d46={},_0x265dda={'count':0x0,'rows':[]};var _0x26103f=_[_0x01b5('0x3b')](db[_0x01b5('0x3c')][_0x01b5('0x3d')],function(_0x529949){return{'name':_0x529949['fieldName'],'type':_0x529949[_0x01b5('0x3e')]['key']};});_0x2b1d46[_0x01b5('0x3f')]=_[_0x01b5('0x3b')](_0x26103f,_0x01b5('0x38'));_0x2b1d46[_0x01b5('0x40')]=_[_0x01b5('0x41')](_0x59f2a8[_0x01b5('0x40')]);_0x2b1d46[_0x01b5('0x42')]=_[_0x01b5('0x43')](_0x2b1d46[_0x01b5('0x3f')],_0x2b1d46[_0x01b5('0x40')]);_0x539f2e['attributes']=_[_0x01b5('0x43')](_0x2b1d46[_0x01b5('0x3f')],qs[_0x01b5('0x44')](_0x59f2a8[_0x01b5('0x40')]['fields']));_0x539f2e[_0x01b5('0x45')]=_0x539f2e[_0x01b5('0x45')][_0x01b5('0x46')]?_0x539f2e[_0x01b5('0x45')]:_0x2b1d46[_0x01b5('0x3f')];if(!_0x59f2a8['query']['hasOwnProperty'](_0x01b5('0x47'))){_0x539f2e['limit']=qs['limit'](_0x59f2a8[_0x01b5('0x40')]['limit']);_0x539f2e['offset']=qs[_0x01b5('0x2f')](_0x59f2a8[_0x01b5('0x40')][_0x01b5('0x2f')]);}_0x539f2e[_0x01b5('0x48')]=qs['sort'](_0x59f2a8[_0x01b5('0x40')]['sort']);_0x539f2e[_0x01b5('0x49')]=qs[_0x01b5('0x42')](_[_0x01b5('0x4a')](_0x59f2a8[_0x01b5('0x40')],_0x2b1d46[_0x01b5('0x42')]),_0x26103f);if(_0x59f2a8[_0x01b5('0x40')]['filter']){_0x539f2e[_0x01b5('0x49')]=_[_0x01b5('0x4b')](_0x539f2e['where'],{'$or':_[_0x01b5('0x3b')](_0x26103f,function(_0x13b389){if(_0x13b389[_0x01b5('0x3e')]!=='VIRTUAL'){var _0x4d5878={};_0x4d5878[_0x13b389[_0x01b5('0x38')]]={'$like':'%'+_0x59f2a8[_0x01b5('0x40')][_0x01b5('0x4c')]+'%'};return _0x4d5878;}})});}_0x539f2e=_['merge']({},_0x539f2e,_0x59f2a8[_0x01b5('0x4d')]);var _0x1ce947={'where':_0x539f2e[_0x01b5('0x49')]};return db['OpenchannelMessage']['count'](_0x1ce947)['then'](function(_0x19f0fb){_0x265dda[_0x01b5('0x4e')]=_0x19f0fb;if(_0x59f2a8[_0x01b5('0x40')]['includeAll']){_0x539f2e[_0x01b5('0x4f')]=[{'all':!![]}];}return db[_0x01b5('0x3c')][_0x01b5('0x50')](_0x539f2e);})['then'](function(_0x243739){_0x265dda[_0x01b5('0x51')]=_0x243739;return _0x265dda;})['then'](respondWithFilteredResult(_0x2952c7,_0x539f2e))['catch'](handleError(_0x2952c7,null));};exports[_0x01b5('0x52')]=function(_0x379611,_0x4964e9){var _0x333eb9={'raw':!![],'where':{'id':_0x379611[_0x01b5('0x53')]['id']}},_0x598991={};_0x598991['model']=_['keys'](db[_0x01b5('0x3c')][_0x01b5('0x3d')]);_0x598991[_0x01b5('0x40')]=_[_0x01b5('0x41')](_0x379611[_0x01b5('0x40')]);_0x598991[_0x01b5('0x42')]=_[_0x01b5('0x43')](_0x598991[_0x01b5('0x3f')],_0x598991[_0x01b5('0x40')]);_0x333eb9[_0x01b5('0x45')]=_[_0x01b5('0x43')](_0x598991[_0x01b5('0x3f')],qs[_0x01b5('0x44')](_0x379611[_0x01b5('0x40')]['fields']));_0x333eb9[_0x01b5('0x45')]=_0x333eb9[_0x01b5('0x45')]['length']?_0x333eb9[_0x01b5('0x45')]:_0x598991['model'];if(_0x379611[_0x01b5('0x40')][_0x01b5('0x54')]){_0x333eb9[_0x01b5('0x4f')]=[{'all':!![]}];}_0x333eb9=_[_0x01b5('0x4b')]({},_0x333eb9,_0x379611[_0x01b5('0x4d')]);return db[_0x01b5('0x3c')][_0x01b5('0x55')](_0x333eb9)[_0x01b5('0x36')](handleEntityNotFound(_0x4964e9,null))[_0x01b5('0x36')](respondWithResult(_0x4964e9,null))[_0x01b5('0x2b')](handleError(_0x4964e9,null));};exports['create']=function(_0x1c2050,_0x2f8fa8){return db[_0x01b5('0x3c')]['create'](_0x1c2050[_0x01b5('0x56')],{})[_0x01b5('0x36')](respondWithResult(_0x2f8fa8,0xc9))[_0x01b5('0x2b')](handleError(_0x2f8fa8,null));};exports[_0x01b5('0x57')]=function(_0x452d81,_0x4cfdf4){if(_0x452d81[_0x01b5('0x56')]['id']){delete _0x452d81[_0x01b5('0x56')]['id'];}return db[_0x01b5('0x3c')]['find']({'where':{'id':_0x452d81[_0x01b5('0x53')]['id']}})['then'](handleEntityNotFound(_0x4cfdf4,null))[_0x01b5('0x36')](saveUpdates(_0x452d81[_0x01b5('0x56')],null))[_0x01b5('0x36')](respondWithResult(_0x4cfdf4,null))[_0x01b5('0x2b')](handleError(_0x4cfdf4,null));};exports[_0x01b5('0x58')]=function(_0x7e9b9d,_0x48f9b8){return db[_0x01b5('0x3c')][_0x01b5('0x55')]({'where':{'id':_0x7e9b9d[_0x01b5('0x53')]['id']}})[_0x01b5('0x36')](handleEntityNotFound(_0x48f9b8,null))[_0x01b5('0x36')](removeEntity(_0x48f9b8,null))['catch'](handleError(_0x48f9b8,null));};exports['describe']=function(_0x1acad6,_0x5a4096){return db[_0x01b5('0x3c')][_0x01b5('0x59')]()[_0x01b5('0x36')](respondWithResult(_0x5a4096,null))[_0x01b5('0x2b')](handleError(_0x5a4096,null));};var interaction_log=require('../../config/logger')(_0x01b5('0x5a'));exports[_0x01b5('0x5b')]=function(_0x3a944e,_0x5d0475,_0x494fde){var _0x3a414c={'agent':{},'channel':_0x01b5('0x5c')};if(_0x3a944e[_0x01b5('0x56')]['id']){delete _0x3a944e['body']['id'];}_0x3a944e[_0x01b5('0x56')][_0x01b5('0x5d')]=!![];_0x3a944e[_0x01b5('0x56')][_0x01b5('0x5e')]=moment()[_0x01b5('0x5f')](_0x01b5('0x60'));_0x3a944e[_0x01b5('0x56')][_0x01b5('0x61')]=_0x3a944e[_0x01b5('0x56')][_0x01b5('0x61')]||_0x3a944e[_0x01b5('0x62')]['id'];_0x3a414c[_0x01b5('0x63')]['id']=_0x3a944e['body'][_0x01b5('0x61')];return db['OpenchannelMessage'][_0x01b5('0x55')]({'where':{'id':_0x3a944e[_0x01b5('0x53')]['id'],'UserId':null}})[_0x01b5('0x36')](handleEntityNotFound(_0x5d0475,null))['then'](saveUpdates(_0x3a944e[_0x01b5('0x56')],null))['then'](function(_0x24880c){if(_0x24880c){_0x3a414c[_0x01b5('0x2a')]=_0x24880c[_0x01b5('0x64')]({'plain':!![]});return db[_0x01b5('0x65')][_0x01b5('0x55')]({'where':{'id':_0x24880c[_0x01b5('0x66')]}});}return null;})[_0x01b5('0x36')](handleEntityNotFound(_0x5d0475,null))[_0x01b5('0x36')](function(_0x1da475){if(_0x1da475){return _0x1da475[_0x01b5('0x57')]({'UserId':_0x3a944e[_0x01b5('0x56')]['UserId'],'read1stAt':_[_0x01b5('0x67')](_0x1da475[_0x01b5('0x68')])?moment()[_0x01b5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x01b5('0x36')](function(_0x3206d4){if(_0x3206d4){_0x3a414c['interaction']=_0x3206d4[_0x01b5('0x64')]({'plain':!![]});interaction_log[_0x01b5('0x22')](_0x01b5('0x69'),_0x3a944e[_0x01b5('0x62')]['id'],_0x3a944e[_0x01b5('0x62')][_0x01b5('0x38')],_0x3a944e[_0x01b5('0x62')][_0x01b5('0x6a')],_0x3a414c[_0x01b5('0x6b')]['id'],_0x3a944e[_0x01b5('0x56')]?JSON[_0x01b5('0x26')](_0x3a944e[_0x01b5('0x56')]):'null');return respondWithRpcPromise(_0x01b5('0x6c'),_0x01b5('0x6d'),_0x3a414c);}return null;})['then'](function(_0x3b066a){var _0xf576bd=_0x01b5('0x6e')+_0x3b066a[_0x01b5('0x2a')][_0x01b5('0x6f')];return db['sequelize'][_0x01b5('0x40')](_0xf576bd,{'type':db[_0x01b5('0x70')][_0x01b5('0x71')][_0x01b5('0x72')],'raw':!![]})[_0x01b5('0x36')](function(_0x32fd68){return _0x32fd68;});})[_0x01b5('0x36')](function(_0x330f49){if(_0x330f49){_0x3a414c[_0x01b5('0x2a')]['contact']=_0x330f49[0x0];if(!_0x3a944e[_0x01b5('0x56')]['UserId'])return;return db[_0x01b5('0x73')]['find']({'where':{'id':_0x3a944e[_0x01b5('0x56')][_0x01b5('0x61')],'role':_0x01b5('0x63')},'attributes':['id','name',_0x01b5('0x74'),'email',_0x01b5('0x75')],'raw':!![]});}return null;})[_0x01b5('0x36')](function(_0xd06c7c){if(!_0xd06c7c)return null;_0x3a414c[_0x01b5('0x2a')][_0x01b5('0x63')]=_0xd06c7c;return _0x3a414c;})['then'](function(_0x2d492a){if(_0x2d492a){if(_0x3a944e[_0x01b5('0x56')]['manual']){_0x3a414c[_0x01b5('0x2a')][_0x01b5('0x76')]=util[_0x01b5('0x5f')]('SIP/%s',_0x3a944e[_0x01b5('0x62')][_0x01b5('0x38')]);_0x3a414c[_0x01b5('0x2a')][_0x01b5('0x77')]=_0x3a414c[_0x01b5('0x77')];_0x3a414c['message'][_0x01b5('0x78')]=_0x3a414c[_0x01b5('0x77')];_0x3a414c['message']['event']=_0x01b5('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x01b5('0x79'),'message':_0x3a414c[_0x01b5('0x2a')]},client9002)[_0x01b5('0x36')](function(){return _0x3a414c;});}return _0x3a414c;}return null;})[_0x01b5('0x36')](respondWithResult(_0x5d0475,null))[_0x01b5('0x2b')](handleError(_0x5d0475,null));};var interaction_log=require('../../config/logger')(_0x01b5('0x5a'));exports['reject']=function(_0x5cf6b9,_0x2c29c7,_0x10fa1a){var _0x14b414={'agent':{},'channel':_0x01b5('0x5c')};if(_0x5cf6b9['body']['id']){delete _0x5cf6b9['body']['id'];}_0x5cf6b9[_0x01b5('0x56')]['UserId']=_0x5cf6b9[_0x01b5('0x56')][_0x01b5('0x61')]||_0x5cf6b9['user']['id'];_0x14b414[_0x01b5('0x63')]['id']=_0x5cf6b9[_0x01b5('0x56')]['UserId'];return db[_0x01b5('0x3c')][_0x01b5('0x55')]({'where':{'id':_0x5cf6b9[_0x01b5('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c29c7,null))[_0x01b5('0x36')](function(_0x43c194){if(_0x43c194){_0x14b414[_0x01b5('0x2a')]=_0x43c194[_0x01b5('0x64')]({'plain':!![]});return db[_0x01b5('0x65')]['find']({'where':{'id':_0x43c194[_0x01b5('0x66')]}});}return null;})[_0x01b5('0x36')](handleEntityNotFound(_0x2c29c7,null))['then'](function(_0x3bba0f){if(_0x3bba0f){_0x14b414[_0x01b5('0x6b')]=_0x3bba0f[_0x01b5('0x64')]({'plain':!![]});interaction_log[_0x01b5('0x22')](_0x01b5('0x7a'),_0x5cf6b9['user']['id'],_0x5cf6b9[_0x01b5('0x62')]['name'],_0x5cf6b9[_0x01b5('0x62')][_0x01b5('0x6a')],_0x14b414['interaction']['id'],_0x5cf6b9['body']?JSON[_0x01b5('0x26')](_0x5cf6b9['body']):_0x01b5('0x7b'));return respondWithRpcPromise(_0x01b5('0x7c'),'rejectMessage',_0x14b414);}return null;})[_0x01b5('0x36')](function(_0x5c4077){var _0x73a871=_0x01b5('0x6e')+_0x5c4077['message']['ContactId'];return db['sequelize']['query'](_0x73a871,{'type':db['Sequelize'][_0x01b5('0x71')][_0x01b5('0x72')],'raw':!![]})[_0x01b5('0x36')](function(_0x2ff2fa){return _0x2ff2fa;});})['then'](function(_0x324ac5){if(_0x324ac5){_0x14b414[_0x01b5('0x2a')][_0x01b5('0x7d')]=_0x324ac5[0x0];if(!_0x5cf6b9[_0x01b5('0x56')][_0x01b5('0x61')])return;return db[_0x01b5('0x73')][_0x01b5('0x55')]({'where':{'id':_0x5cf6b9[_0x01b5('0x56')][_0x01b5('0x61')],'role':'agent'},'attributes':['id',_0x01b5('0x38'),_0x01b5('0x74'),_0x01b5('0x7e'),_0x01b5('0x75')],'raw':!![]});}return null;})[_0x01b5('0x36')](function(_0x1b9cdb){if(!_0x1b9cdb)return null;_0x14b414[_0x01b5('0x2a')]['agent']=_0x1b9cdb;return _0x14b414;})[_0x01b5('0x36')](function(_0x29ddf1){if(_0x29ddf1){_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x76')]=util[_0x01b5('0x5f')](_0x01b5('0x7f'),_0x5cf6b9['user'][_0x01b5('0x38')]);_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x77')]=_0x14b414[_0x01b5('0x77')];_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x78')]=_0x14b414[_0x01b5('0x77')];_0x29ddf1[_0x01b5('0x2a')][_0x01b5('0x80')]=_0x01b5('0x35');respondWithRpcPromise(_0x01b5('0x81'),_0x01b5('0x81'),{'event':'rejectmessage','message':_0x29ddf1[_0x01b5('0x2a')]},client9002);return _0x14b414;}return null;})['then'](respondWithResult(_0x2c29c7,null))[_0x01b5('0x2b')](handleError(_0x2c29c7,null));};
\ No newline at end of file
+var _0xb782=['query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','OpenchannelMessage','findAll','rows','params','find','create','update','body','destroy','describe','openchannel-interactions','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','sendStatus','stack','index','map','rawAttributes','fieldName','type','model','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb782,0xd1));var _0x2b78=function(_0x5d8612,_0x5ed480){_0x5d8612=_0x5d8612-0x0;var _0x589c19=_0xb782[_0x5d8612];return _0x589c19;};'use strict';var emlformat=require(_0x2b78('0x0'));var rimraf=require(_0x2b78('0x1'));var zipdir=require(_0x2b78('0x2'));var jsonpatch=require(_0x2b78('0x3'));var rp=require(_0x2b78('0x4'));var moment=require(_0x2b78('0x5'));var BPromise=require(_0x2b78('0x6'));var Mustache=require(_0x2b78('0x7'));var util=require(_0x2b78('0x8'));var path=require(_0x2b78('0x9'));var sox=require(_0x2b78('0xa'));var csv=require(_0x2b78('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b78('0xc'));var squel=require(_0x2b78('0xd'));var crypto=require('crypto');var jsforce=require(_0x2b78('0xe'));var deskjs=require(_0x2b78('0xf'));var toCsv=require(_0x2b78('0xb'));var querystring=require(_0x2b78('0x10'));var Papa=require(_0x2b78('0x11'));var Redis=require(_0x2b78('0x12'));var authService=require(_0x2b78('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2b78('0x14'));var hardwareService=require(_0x2b78('0x15'));var logger=require(_0x2b78('0x16'))(_0x2b78('0x17'));var utils=require('../../config/utils');var config=require(_0x2b78('0x18'));var licenseUtil=require(_0x2b78('0x19'));var db=require(_0x2b78('0x1a'))['db'];config[_0x2b78('0x1b')]=_[_0x2b78('0x1c')](config[_0x2b78('0x1b')],{'host':_0x2b78('0x1d'),'port':0x18eb});var socket=require(_0x2b78('0x1e'))(new Redis(config[_0x2b78('0x1b')]));require(_0x2b78('0x1f'))[_0x2b78('0x20')](socket);var jayson=require(_0x2b78('0x21'));var client=jayson[_0x2b78('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x2b78('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eca99,_0x55fa14,_0x85347,_0xb570b2){return new BPromise(function(_0x5aece3,_0x5135ab){var _0x5cf13f=_0xb570b2||client;return _0x5cf13f[_0x2b78('0x23')](_0x1eca99,_0x85347)[_0x2b78('0x24')](function(_0x4343bb){logger[_0x2b78('0x25')](_0x2b78('0x26'),_0x55fa14,_0x2b78('0x27'));logger[_0x2b78('0x28')](_0x2b78('0x29'),_0x55fa14,'request\x20sent',JSON['stringify'](_0x4343bb));if(_0x4343bb[_0x2b78('0x2a')]){if(_0x4343bb['error'][_0x2b78('0x2b')]===0x1f4){logger[_0x2b78('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x55fa14,_0x4343bb[_0x2b78('0x2a')]['message']);return _0x5135ab(_0x4343bb[_0x2b78('0x2a')][_0x2b78('0x2c')]);}logger[_0x2b78('0x2a')](_0x2b78('0x26'),_0x55fa14,_0x4343bb['error']['message']);return _0x5aece3(_0x4343bb[_0x2b78('0x2a')][_0x2b78('0x2c')]);}else{logger[_0x2b78('0x25')](_0x2b78('0x26'),_0x55fa14,_0x2b78('0x27'));_0x5aece3(_0x4343bb['result']['message']);}})[_0x2b78('0x2d')](function(_0x3723e7){logger['error'](_0x2b78('0x26'),_0x55fa14,_0x3723e7);_0x5135ab(_0x3723e7);});});}function respondWithStatusCode(_0x2d7e3e,_0x20d944){_0x20d944=_0x20d944||0xcc;return function(_0x75d310){if(_0x75d310){return _0x2d7e3e['sendStatus'](_0x20d944);}return _0x2d7e3e[_0x2b78('0x2e')](_0x20d944)[_0x2b78('0x2f')]();};}function respondWithResult(_0x474234,_0x228bac){_0x228bac=_0x228bac||0xc8;return function(_0x3c6dd1){if(_0x3c6dd1){return _0x474234[_0x2b78('0x2e')](_0x228bac)[_0x2b78('0x30')](_0x3c6dd1);}};}function respondWithFilteredResult(_0x3a8c62,_0x19fa07){return function(_0x193bb8){if(_0x193bb8){var _0x5ae69e=typeof _0x19fa07['offset']===_0x2b78('0x31')&&typeof _0x19fa07['limit']===_0x2b78('0x31');var _0x1413f8=_0x193bb8[_0x2b78('0x32')];var _0x1c0beb=_0x5ae69e?0x0:_0x19fa07[_0x2b78('0x33')];var _0x5b7eb3=_0x5ae69e?_0x193bb8['count']:_0x19fa07['offset']+_0x19fa07[_0x2b78('0x34')];var _0x58ff9e;if(_0x5b7eb3>=_0x1413f8){_0x5b7eb3=_0x1413f8;_0x58ff9e=0xc8;}else{_0x58ff9e=0xce;}_0x3a8c62[_0x2b78('0x2e')](_0x58ff9e);return _0x3a8c62[_0x2b78('0x35')](_0x2b78('0x36'),_0x1c0beb+'-'+_0x5b7eb3+'/'+_0x1413f8)[_0x2b78('0x30')](_0x193bb8);}return null;};}function patchUpdates(_0x2fbe67){return function(_0x5df0ac){try{jsonpatch[_0x2b78('0x37')](_0x5df0ac,_0x2fbe67,!![]);}catch(_0x2174c7){return BPromise[_0x2b78('0x38')](_0x2174c7);}return _0x5df0ac[_0x2b78('0x39')]();};}function saveUpdates(_0x531649,_0x5aa3b3){return function(_0x123e9a){if(_0x123e9a){return _0x123e9a['update'](_0x531649)[_0x2b78('0x24')](function(_0x52d6de){return _0x52d6de;});}return null;};}function removeEntity(_0x4197be,_0x1add04){return function(_0x3c0b68){if(_0x3c0b68){return _0x3c0b68['destroy']()['then'](function(){_0x4197be[_0x2b78('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270b68,_0x37e406){return function(_0x54c1df){if(!_0x54c1df){_0x270b68[_0x2b78('0x3a')](0x194);}return _0x54c1df;};}function handleError(_0x438be0,_0x4c3baf){_0x4c3baf=_0x4c3baf||0x1f4;return function(_0x7fe42f){logger[_0x2b78('0x2a')](_0x7fe42f[_0x2b78('0x3b')]);if(_0x7fe42f['name']){delete _0x7fe42f['name'];}_0x438be0[_0x2b78('0x2e')](_0x4c3baf)['send'](_0x7fe42f);};}exports[_0x2b78('0x3c')]=function(_0x584375,_0x281c48){var _0x1b39f3={},_0x4619d5={},_0x592709={'count':0x0,'rows':[]};var _0x57e217=_[_0x2b78('0x3d')](db['OpenchannelMessage'][_0x2b78('0x3e')],function(_0x4242aa){return{'name':_0x4242aa[_0x2b78('0x3f')],'type':_0x4242aa[_0x2b78('0x40')]['key']};});_0x4619d5[_0x2b78('0x41')]=_[_0x2b78('0x3d')](_0x57e217,_0x2b78('0x42'));_0x4619d5[_0x2b78('0x43')]=_[_0x2b78('0x44')](_0x584375['query']);_0x4619d5[_0x2b78('0x45')]=_['intersection'](_0x4619d5[_0x2b78('0x41')],_0x4619d5[_0x2b78('0x43')]);_0x1b39f3[_0x2b78('0x46')]=_[_0x2b78('0x47')](_0x4619d5[_0x2b78('0x41')],qs[_0x2b78('0x48')](_0x584375[_0x2b78('0x43')]['fields']));_0x1b39f3[_0x2b78('0x46')]=_0x1b39f3[_0x2b78('0x46')][_0x2b78('0x49')]?_0x1b39f3[_0x2b78('0x46')]:_0x4619d5['model'];if(!_0x584375[_0x2b78('0x43')][_0x2b78('0x4a')]('nolimit')){_0x1b39f3[_0x2b78('0x34')]=qs[_0x2b78('0x34')](_0x584375[_0x2b78('0x43')][_0x2b78('0x34')]);_0x1b39f3[_0x2b78('0x33')]=qs[_0x2b78('0x33')](_0x584375['query'][_0x2b78('0x33')]);}_0x1b39f3[_0x2b78('0x4b')]=qs[_0x2b78('0x4c')](_0x584375[_0x2b78('0x43')][_0x2b78('0x4c')]);_0x1b39f3[_0x2b78('0x4d')]=qs[_0x2b78('0x45')](_[_0x2b78('0x4e')](_0x584375[_0x2b78('0x43')],_0x4619d5['filters']),_0x57e217);if(_0x584375[_0x2b78('0x43')]['filter']){_0x1b39f3[_0x2b78('0x4d')]=_[_0x2b78('0x4f')](_0x1b39f3[_0x2b78('0x4d')],{'$or':_[_0x2b78('0x3d')](_0x57e217,function(_0x491c35){if(_0x491c35[_0x2b78('0x40')]!==_0x2b78('0x50')){var _0x2caeef={};_0x2caeef[_0x491c35['name']]={'$like':'%'+_0x584375[_0x2b78('0x43')]['filter']+'%'};return _0x2caeef;}})});}_0x1b39f3=_[_0x2b78('0x4f')]({},_0x1b39f3,_0x584375[_0x2b78('0x51')]);var _0x45c886={'where':_0x1b39f3[_0x2b78('0x4d')]};return db['OpenchannelMessage']['count'](_0x45c886)[_0x2b78('0x24')](function(_0x11ecba){_0x592709[_0x2b78('0x32')]=_0x11ecba;if(_0x584375[_0x2b78('0x43')][_0x2b78('0x52')]){_0x1b39f3[_0x2b78('0x53')]=[{'all':!![]}];}return db[_0x2b78('0x54')][_0x2b78('0x55')](_0x1b39f3);})[_0x2b78('0x24')](function(_0x48e2bb){_0x592709[_0x2b78('0x56')]=_0x48e2bb;return _0x592709;})[_0x2b78('0x24')](respondWithFilteredResult(_0x281c48,_0x1b39f3))['catch'](handleError(_0x281c48,null));};exports['show']=function(_0x5656c4,_0x83ebfc){var _0x241bea={'raw':!![],'where':{'id':_0x5656c4[_0x2b78('0x57')]['id']}},_0xe4538a={};_0xe4538a['model']=_[_0x2b78('0x44')](db[_0x2b78('0x54')][_0x2b78('0x3e')]);_0xe4538a[_0x2b78('0x43')]=_[_0x2b78('0x44')](_0x5656c4[_0x2b78('0x43')]);_0xe4538a[_0x2b78('0x45')]=_[_0x2b78('0x47')](_0xe4538a['model'],_0xe4538a['query']);_0x241bea[_0x2b78('0x46')]=_[_0x2b78('0x47')](_0xe4538a[_0x2b78('0x41')],qs['fields'](_0x5656c4[_0x2b78('0x43')][_0x2b78('0x48')]));_0x241bea[_0x2b78('0x46')]=_0x241bea[_0x2b78('0x46')][_0x2b78('0x49')]?_0x241bea[_0x2b78('0x46')]:_0xe4538a['model'];if(_0x5656c4[_0x2b78('0x43')][_0x2b78('0x52')]){_0x241bea['include']=[{'all':!![]}];}_0x241bea=_[_0x2b78('0x4f')]({},_0x241bea,_0x5656c4['options']);return db[_0x2b78('0x54')][_0x2b78('0x58')](_0x241bea)[_0x2b78('0x24')](handleEntityNotFound(_0x83ebfc,null))[_0x2b78('0x24')](respondWithResult(_0x83ebfc,null))['catch'](handleError(_0x83ebfc,null));};exports[_0x2b78('0x59')]=function(_0x181b4d,_0x1f2dd3){return db[_0x2b78('0x54')][_0x2b78('0x59')](_0x181b4d['body'],{})['then'](respondWithResult(_0x1f2dd3,0xc9))['catch'](handleError(_0x1f2dd3,null));};exports[_0x2b78('0x5a')]=function(_0x33ee13,_0x22be67){if(_0x33ee13['body']['id']){delete _0x33ee13[_0x2b78('0x5b')]['id'];}return db[_0x2b78('0x54')][_0x2b78('0x58')]({'where':{'id':_0x33ee13[_0x2b78('0x57')]['id']}})[_0x2b78('0x24')](handleEntityNotFound(_0x22be67,null))['then'](saveUpdates(_0x33ee13[_0x2b78('0x5b')],null))['then'](respondWithResult(_0x22be67,null))['catch'](handleError(_0x22be67,null));};exports[_0x2b78('0x5c')]=function(_0x117932,_0x3f388e){return db[_0x2b78('0x54')]['find']({'where':{'id':_0x117932['params']['id']}})[_0x2b78('0x24')](handleEntityNotFound(_0x3f388e,null))[_0x2b78('0x24')](removeEntity(_0x3f388e,null))['catch'](handleError(_0x3f388e,null));};exports['describe']=function(_0x31fbfd,_0x223f23){return db[_0x2b78('0x54')][_0x2b78('0x5d')]()[_0x2b78('0x24')](respondWithResult(_0x223f23,null))[_0x2b78('0x2d')](handleError(_0x223f23,null));};var interaction_log=require(_0x2b78('0x16'))(_0x2b78('0x5e'));exports[_0x2b78('0x5f')]=function(_0x27d896,_0xb2771c,_0x5a0bd3){var _0x4c00e5={'agent':{},'channel':_0x2b78('0x60')};if(_0x27d896['body']['id']){delete _0x27d896[_0x2b78('0x5b')]['id'];}_0x27d896[_0x2b78('0x5b')][_0x2b78('0x61')]=!![];_0x27d896[_0x2b78('0x5b')]['readAt']=moment()['format'](_0x2b78('0x62'));_0x27d896[_0x2b78('0x5b')]['UserId']=_0x27d896[_0x2b78('0x5b')]['UserId']||_0x27d896[_0x2b78('0x63')]['id'];_0x4c00e5[_0x2b78('0x64')]['id']=_0x27d896[_0x2b78('0x5b')][_0x2b78('0x65')];return db[_0x2b78('0x54')][_0x2b78('0x58')]({'where':{'id':_0x27d896[_0x2b78('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xb2771c,null))[_0x2b78('0x24')](saveUpdates(_0x27d896[_0x2b78('0x5b')],null))[_0x2b78('0x24')](function(_0x2381fc){if(_0x2381fc){_0x4c00e5[_0x2b78('0x2c')]=_0x2381fc[_0x2b78('0x66')]({'plain':!![]});return db[_0x2b78('0x67')][_0x2b78('0x58')]({'where':{'id':_0x2381fc[_0x2b78('0x68')]}});}return null;})[_0x2b78('0x24')](handleEntityNotFound(_0xb2771c,null))[_0x2b78('0x24')](function(_0x570c10){if(_0x570c10){return _0x570c10[_0x2b78('0x5a')]({'UserId':_0x27d896['body'][_0x2b78('0x65')],'read1stAt':_[_0x2b78('0x69')](_0x570c10[_0x2b78('0x6a')])?moment()[_0x2b78('0x6b')](_0x2b78('0x62')):undefined});}return null;})['then'](function(_0x38c3de){if(_0x38c3de){_0x4c00e5[_0x2b78('0x6c')]=_0x38c3de[_0x2b78('0x66')]({'plain':!![]});interaction_log[_0x2b78('0x25')](_0x2b78('0x6d'),_0x27d896['user']['id'],_0x27d896[_0x2b78('0x63')][_0x2b78('0x42')],_0x27d896[_0x2b78('0x63')][_0x2b78('0x6e')],_0x4c00e5[_0x2b78('0x6c')]['id'],_0x27d896[_0x2b78('0x5b')]?JSON[_0x2b78('0x6f')](_0x27d896[_0x2b78('0x5b')]):_0x2b78('0x70'));return respondWithRpcPromise(_0x2b78('0x71'),_0x2b78('0x72'),_0x4c00e5);}return null;})[_0x2b78('0x24')](function(_0x441711){var _0x2cf222=_0x2b78('0x73')+_0x441711[_0x2b78('0x2c')][_0x2b78('0x74')];return db[_0x2b78('0x75')][_0x2b78('0x43')](_0x2cf222,{'type':db['Sequelize'][_0x2b78('0x76')][_0x2b78('0x77')],'raw':!![]})[_0x2b78('0x24')](function(_0xbaaf59){return _0xbaaf59;});})[_0x2b78('0x24')](function(_0x18d2d0){if(_0x18d2d0){_0x4c00e5[_0x2b78('0x2c')][_0x2b78('0x78')]=_0x18d2d0[0x0];if(!_0x27d896[_0x2b78('0x5b')][_0x2b78('0x65')])return;return db['User'][_0x2b78('0x58')]({'where':{'id':_0x27d896[_0x2b78('0x5b')][_0x2b78('0x65')],'role':_0x2b78('0x64')},'attributes':['id',_0x2b78('0x42'),_0x2b78('0x79'),_0x2b78('0x7a'),_0x2b78('0x7b')],'raw':!![]});}return null;})['then'](function(_0xa4c653){if(!_0xa4c653)return null;_0x4c00e5[_0x2b78('0x2c')][_0x2b78('0x64')]=_0xa4c653;return _0x4c00e5;})[_0x2b78('0x24')](function(_0x288702){if(_0x288702){if(_0x27d896[_0x2b78('0x5b')][_0x2b78('0x7c')]){_0x4c00e5[_0x2b78('0x2c')][_0x2b78('0x7d')]=util[_0x2b78('0x6b')](_0x2b78('0x7e'),_0x27d896['user']['name']);_0x4c00e5[_0x2b78('0x2c')][_0x2b78('0x7f')]=_0x4c00e5[_0x2b78('0x7f')];_0x4c00e5[_0x2b78('0x2c')][_0x2b78('0x80')]=_0x4c00e5['channel'];_0x4c00e5[_0x2b78('0x2c')][_0x2b78('0x81')]=_0x2b78('0x5f');return respondWithRpcPromise('EventManager',_0x2b78('0x82'),{'event':_0x2b78('0x83'),'message':_0x4c00e5[_0x2b78('0x2c')]},client9002)[_0x2b78('0x24')](function(){return _0x4c00e5;});}return _0x4c00e5;}return null;})['then'](respondWithResult(_0xb2771c,null))[_0x2b78('0x2d')](handleError(_0xb2771c,null));};var interaction_log=require(_0x2b78('0x16'))('openchannel-interactions');exports[_0x2b78('0x38')]=function(_0x35c843,_0x2828c3,_0x3c8319){var _0x4855b6={'agent':{},'channel':'openchannel'};if(_0x35c843[_0x2b78('0x5b')]['id']){delete _0x35c843[_0x2b78('0x5b')]['id'];}_0x35c843[_0x2b78('0x5b')][_0x2b78('0x65')]=_0x35c843[_0x2b78('0x5b')]['UserId']||_0x35c843[_0x2b78('0x63')]['id'];_0x4855b6['agent']['id']=_0x35c843[_0x2b78('0x5b')]['UserId'];return db[_0x2b78('0x54')]['find']({'where':{'id':_0x35c843['params']['id'],'UserId':null}})[_0x2b78('0x24')](handleEntityNotFound(_0x2828c3,null))['then'](function(_0x469f32){if(_0x469f32){_0x4855b6[_0x2b78('0x2c')]=_0x469f32['get']({'plain':!![]});return db[_0x2b78('0x67')][_0x2b78('0x58')]({'where':{'id':_0x469f32['OpenchannelInteractionId']}});}return null;})[_0x2b78('0x24')](handleEntityNotFound(_0x2828c3,null))[_0x2b78('0x24')](function(_0x1f9d65){if(_0x1f9d65){_0x4855b6['interaction']=_0x1f9d65[_0x2b78('0x66')]({'plain':!![]});interaction_log[_0x2b78('0x25')](_0x2b78('0x84'),_0x35c843['user']['id'],_0x35c843[_0x2b78('0x63')][_0x2b78('0x42')],_0x35c843[_0x2b78('0x63')][_0x2b78('0x6e')],_0x4855b6['interaction']['id'],_0x35c843[_0x2b78('0x5b')]?JSON[_0x2b78('0x6f')](_0x35c843['body']):'null');return respondWithRpcPromise(_0x2b78('0x85'),_0x2b78('0x86'),_0x4855b6);}return null;})[_0x2b78('0x24')](function(_0x3258e0){var _0x353ac6=_0x2b78('0x73')+_0x3258e0[_0x2b78('0x2c')][_0x2b78('0x74')];return db[_0x2b78('0x75')][_0x2b78('0x43')](_0x353ac6,{'type':db[_0x2b78('0x87')]['QueryTypes'][_0x2b78('0x77')],'raw':!![]})[_0x2b78('0x24')](function(_0x383c67){return _0x383c67;});})['then'](function(_0x388299){if(_0x388299){_0x4855b6['message'][_0x2b78('0x78')]=_0x388299[0x0];if(!_0x35c843[_0x2b78('0x5b')][_0x2b78('0x65')])return;return db[_0x2b78('0x88')]['find']({'where':{'id':_0x35c843[_0x2b78('0x5b')][_0x2b78('0x65')],'role':_0x2b78('0x64')},'attributes':['id',_0x2b78('0x42'),_0x2b78('0x79'),'email',_0x2b78('0x7b')],'raw':!![]});}return null;})[_0x2b78('0x24')](function(_0x3bf4b8){if(!_0x3bf4b8)return null;_0x4855b6[_0x2b78('0x2c')][_0x2b78('0x64')]=_0x3bf4b8;return _0x4855b6;})[_0x2b78('0x24')](function(_0x353554){if(_0x353554){_0x353554[_0x2b78('0x2c')][_0x2b78('0x7d')]=util[_0x2b78('0x6b')](_0x2b78('0x7e'),_0x35c843[_0x2b78('0x63')][_0x2b78('0x42')]);_0x353554[_0x2b78('0x2c')]['channel']=_0x4855b6[_0x2b78('0x7f')];_0x353554[_0x2b78('0x2c')][_0x2b78('0x80')]=_0x4855b6['channel'];_0x353554[_0x2b78('0x2c')][_0x2b78('0x81')]='reject';respondWithRpcPromise(_0x2b78('0x82'),_0x2b78('0x82'),{'event':_0x2b78('0x89'),'message':_0x353554[_0x2b78('0x2c')]},client9002);return _0x4855b6;}return null;})[_0x2b78('0x24')](respondWithResult(_0x2828c3,null))[_0x2b78('0x2d')](handleError(_0x2828c3,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe823=['update','remove','hook','exports','events','../../mysqldb','OpenchannelMessage','save'];(function(_0x547e09,_0x357128){var _0x250d75=function(_0x1a29a1){while(--_0x1a29a1){_0x547e09['push'](_0x547e09['shift']());}};_0x250d75(++_0x357128);}(_0xe823,0xc4));var _0x3e82=function(_0x1cbe1f,_0x2fa510){_0x1cbe1f=_0x1cbe1f-0x0;var _0x100179=_0xe823[_0x1cbe1f];return _0x100179;};'use strict';var EventEmitter=require(_0x3e82('0x0'));var OpenchannelMessage=require(_0x3e82('0x1'))['db'][_0x3e82('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e82('0x3'),'afterUpdate':_0x3e82('0x4'),'afterDestroy':_0x3e82('0x5')};function emitEvent(_0x2e7173){return function(_0x48259b,_0x5a62c8,_0x4fbb37){OpenchannelMessageEvents['emit'](_0x2e7173+':'+_0x48259b['id'],_0x48259b);OpenchannelMessageEvents['emit'](_0x2e7173,_0x48259b);_0x4fbb37(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x3e82('0x6')](e,emitEvent(event));}}module[_0x3e82('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x12d2=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x49b97c,_0x18f450){var _0x5172ff=function(_0x115dd7){while(--_0x115dd7){_0x49b97c['push'](_0x49b97c['shift']());}};_0x5172ff(++_0x18f450);}(_0x12d2,0x6b));var _0x212d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x12d2[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x212d('0x0'));var OpenchannelMessage=require(_0x212d('0x1'))['db'][_0x212d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x212d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x212d('0x4'),'afterDestroy':_0x212d('0x5')};function emitEvent(_0x3e4896){return function(_0x43162e,_0x743462,_0x49f40f){OpenchannelMessageEvents[_0x212d('0x6')](_0x3e4896+':'+_0x43162e['id'],_0x43162e);OpenchannelMessageEvents[_0x212d('0x6')](_0x3e4896,_0x43162e);_0x49f40f(null);};}for(var e in events){if(events[_0x212d('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x212d('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3f7=['replyUri','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','catch','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment','./openchannelMessage.attributes','define','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','CmContact','describe','then','OpenchannelAccount','Interactions','keys'];(function(_0x15dcf1,_0x326ff9){var _0x118008=function(_0x35b8b0){while(--_0x35b8b0){_0x15dcf1['push'](_0x15dcf1['shift']());}};_0x118008(++_0x326ff9);}(_0xf3f7,0x16a));var _0x7f3f=function(_0x491697,_0x206414){_0x491697=_0x491697-0x0;var _0x2ae2e8=_0xf3f7[_0x491697];return _0x2ae2e8;};'use strict';var _=require(_0x7f3f('0x0'));var util=require(_0x7f3f('0x1'));var logger=require(_0x7f3f('0x2'))('api');var moment=require(_0x7f3f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f3f('0x4'));var rimraf=require('rimraf');var config=require(_0x7f3f('0x5'));var attributes=require(_0x7f3f('0x6'));module['exports']=function(_0x5306d5,_0x2de776){return _0x5306d5[_0x7f3f('0x7')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x7f3f('0x8'),'fields':[_0x7f3f('0x9')],'type':_0x7f3f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31cbba,_0x3d45be,_0x41316f){var _0x1ce39c=_0x5306d5[_0x7f3f('0xb')];var _0x25b20d=_0x31cbba[_0x7f3f('0xc')]({'plain':!![]});if(_0x25b20d['direction'][_0x7f3f('0xd')]()==='in'||_0x25b20d[_0x7f3f('0xe')]['toLowerCase']()===_0x7f3f('0xf')&&!_0x25b20d[_0x7f3f('0x10')]&&!_[_0x7f3f('0x11')](_0x25b20d[_0x7f3f('0x12')])){_0x1ce39c[_0x7f3f('0x13')][_0x7f3f('0x14')]({'where':{'id':_0x25b20d[_0x7f3f('0x15')]}})['then'](function(_0x1c5205){if(_0x1c5205){_0x1c5205[_0x7f3f('0x16')]({'lastMsgAt':_0x25b20d[_0x7f3f('0x17')],'lastMsgDirection':_0x25b20d[_0x7f3f('0xe')][_0x7f3f('0xd')]()});}})['catch'](function(_0x1c4a58){console['error'](_0x1c4a58);});}if(_0x25b20d[_0x7f3f('0xe')]===_0x7f3f('0xf')&&!_0x25b20d['secret']){var _0x4b5d3e;_0x1ce39c[_0x7f3f('0x18')][_0x7f3f('0x19')]()[_0x7f3f('0x1a')](function(_0x366076){return _0x1ce39c[_0x7f3f('0x1b')]['find']({'where':{'id':_0x25b20d['OpenchannelAccountId']},'include':[{'model':_0x1ce39c[_0x7f3f('0x13')],'as':_0x7f3f('0x1c'),'where':{'id':_0x25b20d[_0x7f3f('0x15')]},'limit':0x1,'include':[{'model':_0x1ce39c[_0x7f3f('0x18')],'as':'Contact','attributes':_[_0x7f3f('0x1d')](_0x366076)}]}]});})['then'](function(_0x54f40d){_0x4b5d3e=_0x54f40d[_0x7f3f('0xc')]({'plain':!![]});if(_0x4b5d3e&&_0x4b5d3e[_0x7f3f('0x1e')]){logger[_0x7f3f('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x7f3f('0x20'),util['format'](_0x7f3f('0x21'),_0x25b20d['id'],_0x4b5d3e['replyUri']));if(_0x4b5d3e[_0x7f3f('0x1c')]&&_0x4b5d3e[_0x7f3f('0x1c')][_0x7f3f('0x22')]){_0x25b20d['Interaction']=_[_0x7f3f('0x23')](_0x4b5d3e['Interactions'][0x0],_0x7f3f('0x24'));_0x25b20d['Contact']=_0x4b5d3e[_0x7f3f('0x1c')][0x0][_0x7f3f('0x24')];}var _0x3d45be={'method':_0x7f3f('0x25'),'uri':encodeURI(_0x4b5d3e[_0x7f3f('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d45be[_0x7f3f('0x26')]){case'GET':_0x3d45be['qs']=_0x25b20d;break;case _0x7f3f('0x25'):_0x3d45be['body']=_0x25b20d;break;}return rp(_0x3d45be)['then'](function(_0x2571fe){logger['info'](_0x7f3f('0x27'),'afterCreate',util[_0x7f3f('0x28')](_0x7f3f('0x29'),_0x25b20d['id'],_0x4b5d3e['replyUri']));if(_0x2571fe[_0x7f3f('0x9')][_0x7f3f('0x2a')]&&_0x2571fe[_0x7f3f('0x9')][_0x7f3f('0x2a')]!=_0x25b20d[_0x7f3f('0x2b')][_0x7f3f('0x2a')]){return _0x1ce39c[_0x7f3f('0x13')][_0x7f3f('0x16')]({'threadId':_0x2571fe[_0x7f3f('0x9')]['threadId']},{'where':{'id':_0x25b20d[_0x7f3f('0x2b')]['id']}});}else{return;}})[_0x7f3f('0x1a')](function(){return _0x31cbba['update']({'read':!![]});})[_0x7f3f('0x2c')](function(_0x11a62b){logger[_0x7f3f('0x2d')](_0x7f3f('0x27'),_0x7f3f('0x20'),util['inspect'](_0x11a62b,{'showHidden':![],'depth':null}));_0x41316f();});}else{_0x41316f();}})[_0x7f3f('0x2e')](function(){_0x41316f();});}else{_0x41316f();}}},'charset':_0x7f3f('0x2f'),'collate':_0x7f3f('0x30')});};
\ No newline at end of file
+var _0xcb9a=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','Contact','POST','method','GET','body','format','threadId','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','findOne','OpenchannelInteractionId','then','update','catch','error','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','keys','replyUri','info'];(function(_0x417abe,_0x5daa06){var _0x46232f=function(_0x204659){while(--_0x204659){_0x417abe['push'](_0x417abe['shift']());}};_0x46232f(++_0x5daa06);}(_0xcb9a,0x1d0));var _0xacb9=function(_0x53006a,_0x1cb0be){_0x53006a=_0x53006a-0x0;var _0x1d1209=_0xcb9a[_0x53006a];return _0x1d1209;};'use strict';var _=require(_0xacb9('0x0'));var util=require(_0xacb9('0x1'));var logger=require(_0xacb9('0x2'))(_0xacb9('0x3'));var moment=require(_0xacb9('0x4'));var BPromise=require(_0xacb9('0x5'));var rp=require(_0xacb9('0x6'));var fs=require('fs');var path=require(_0xacb9('0x7'));var rimraf=require(_0xacb9('0x8'));var config=require('../../config/environment');var attributes=require(_0xacb9('0x9'));module[_0xacb9('0xa')]=function(_0x37a17c,_0x1efb88){return _0x37a17c['define']('OpenchannelMessage',attributes,{'tableName':_0xacb9('0xb'),'paranoid':![],'indexes':[{'name':_0xacb9('0xc'),'fields':['body'],'type':_0xacb9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x105394,_0x3152c4,_0x39aa83){var _0x299ee1=_0x37a17c[_0xacb9('0xe')];var _0x1cad43=_0x105394[_0xacb9('0xf')]({'plain':!![]});if(_0x1cad43[_0xacb9('0x10')][_0xacb9('0x11')]()==='in'||_0x1cad43['direction']['toLowerCase']()===_0xacb9('0x12')&&!_0x1cad43[_0xacb9('0x13')]&&!_['isNil'](_0x1cad43['UserId'])){_0x299ee1['OpenchannelInteraction'][_0xacb9('0x14')]({'where':{'id':_0x1cad43[_0xacb9('0x15')]}})[_0xacb9('0x16')](function(_0x58bf35){if(_0x58bf35){_0x58bf35[_0xacb9('0x17')]({'lastMsgAt':_0x1cad43['createdAt'],'lastMsgDirection':_0x1cad43[_0xacb9('0x10')]['toLowerCase']()});}})[_0xacb9('0x18')](function(_0x1cef48){console[_0xacb9('0x19')](_0x1cef48);});}if(_0x1cad43['direction']===_0xacb9('0x12')&&!_0x1cad43['secret']){var _0x5d579a;_0x299ee1['CmContact'][_0xacb9('0x1a')]()['then'](function(_0x4d0612){return _0x299ee1[_0xacb9('0x1b')][_0xacb9('0x1c')]({'where':{'id':_0x1cad43[_0xacb9('0x1d')]},'include':[{'model':_0x299ee1[_0xacb9('0x1e')],'as':_0xacb9('0x1f'),'where':{'id':_0x1cad43[_0xacb9('0x15')]},'limit':0x1,'include':[{'model':_0x299ee1[_0xacb9('0x20')],'as':'Contact','attributes':_[_0xacb9('0x21')](_0x4d0612)}]}]});})[_0xacb9('0x16')](function(_0x10aea4){_0x5d579a=_0x10aea4[_0xacb9('0xf')]({'plain':!![]});if(_0x5d579a&&_0x5d579a[_0xacb9('0x22')]){logger[_0xacb9('0x23')](_0xacb9('0x24'),_0xacb9('0x25'),util['format'](_0xacb9('0x26'),_0x1cad43['id'],_0x5d579a[_0xacb9('0x22')]));if(_0x5d579a['Interactions']&&_0x5d579a['Interactions'][_0xacb9('0x27')]){_0x1cad43[_0xacb9('0x28')]=_['omit'](_0x5d579a['Interactions'][0x0],_0xacb9('0x29'));_0x1cad43[_0xacb9('0x29')]=_0x5d579a[_0xacb9('0x1f')][0x0][_0xacb9('0x29')];}var _0x3152c4={'method':_0xacb9('0x2a'),'uri':encodeURI(_0x5d579a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3152c4[_0xacb9('0x2b')]){case _0xacb9('0x2c'):_0x3152c4['qs']=_0x1cad43;break;case _0xacb9('0x2a'):_0x3152c4[_0xacb9('0x2d')]=_0x1cad43;break;}return rp(_0x3152c4)['then'](function(_0x3cacfa){logger[_0xacb9('0x23')](_0xacb9('0x24'),_0xacb9('0x25'),util[_0xacb9('0x2e')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1cad43['id'],_0x5d579a['replyUri']));if(_0x3cacfa[_0xacb9('0x2d')][_0xacb9('0x2f')]&&_0x3cacfa[_0xacb9('0x2d')]['threadId']!=_0x1cad43[_0xacb9('0x28')][_0xacb9('0x2f')]){return _0x299ee1['OpenchannelInteraction'][_0xacb9('0x17')]({'threadId':_0x3cacfa[_0xacb9('0x2d')][_0xacb9('0x2f')]},{'where':{'id':_0x1cad43[_0xacb9('0x28')]['id']}});}else{return;}})[_0xacb9('0x16')](function(){return _0x105394[_0xacb9('0x17')]({'read':!![]});})['catch'](function(_0x34969e){logger[_0xacb9('0x19')](_0xacb9('0x24'),_0xacb9('0x25'),util[_0xacb9('0x30')](_0x34969e,{'showHidden':![],'depth':null}));_0x39aa83();});}else{_0x39aa83();}})['finally'](function(){_0x39aa83();});}else{_0x39aa83();}}},'charset':'utf8mb4','collate':_0xacb9('0x31')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x3cafb8,_0x32860e){var _0x4b7f85=function(_0x31b11d){while(--_0x31b11d){_0x3cafb8['push'](_0x3cafb8['shift']());}};_0x4b7f85(++_0x32860e);}(_0x2ef3,0xba));var _0x32ef=function(_0x30963e,_0x548d55){_0x30963e=_0x30963e-0x0;var _0x184c64=_0x2ef3[_0x30963e];return _0x184c64;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
+var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x2dcc48,_0x59027c){var _0x292bc8=function(_0x303fbc){while(--_0x303fbc){_0x2dcc48['push'](_0x2dcc48['shift']());}};_0x292bc8(++_0x59027c);}(_0x2ef3,0xba));var _0x32ef=function(_0x482613,_0x2fdb39){_0x482613=_0x482613-0x0;var _0x4093a3=_0x2ef3[_0x482613];return _0x4093a3;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e50=['removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit'];(function(_0x280ba3,_0x50076b){var _0x308074=function(_0x39221f){while(--_0x39221f){_0x280ba3['push'](_0x280ba3['shift']());}};_0x308074(++_0x50076b);}(_0x0e50,0x168));var _0x00e5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0e50[_0x4b055c];return _0x4b62bb;};'use strict';var OpenchannelMessageEvents=require(_0x00e5('0x0'));var events=[_0x00e5('0x1'),_0x00e5('0x2'),'update'];function createListener(_0x1b3523,_0xa345ef){return function(_0x4a0533){_0xa345ef[_0x00e5('0x3')](_0x1b3523,_0x4a0533);};}function removeListener(_0x3d2263,_0x4f38ad){return function(){OpenchannelMessageEvents[_0x00e5('0x4')](_0x3d2263,_0x4f38ad);};}exports['register']=function(_0x3efbe7){for(var _0xeb6242=0x0,_0x255aec=events[_0x00e5('0x5')];_0xeb6242<_0x255aec;_0xeb6242++){var _0x40b93e=events[_0xeb6242];var _0x4c91eb=createListener(_0x00e5('0x6')+_0x40b93e,_0x3efbe7);OpenchannelMessageEvents['on'](_0x40b93e,_0x4c91eb);}};
\ No newline at end of file
+var _0x5f01=['openchannelMessage:','save','remove','update','removeListener','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f01,0xcc));var _0x15f0=function(_0x122442,_0x23a71b){_0x122442=_0x122442-0x0;var _0x18bc3f=_0x5f01[_0x122442];return _0x18bc3f;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x15f0('0x0'),_0x15f0('0x1'),_0x15f0('0x2')];function createListener(_0x47f9c6,_0x7f9bb9){return function(_0x217f0a){_0x7f9bb9['emit'](_0x47f9c6,_0x217f0a);};}function removeListener(_0x3a7689,_0x59941d){return function(){OpenchannelMessageEvents[_0x15f0('0x3')](_0x3a7689,_0x59941d);};}exports[_0x15f0('0x4')]=function(_0x19d434){for(var _0x2ead28=0x0,_0x39c00b=events[_0x15f0('0x5')];_0x2ead28<_0x39c00b;_0x2ead28++){var _0x514122=events[_0x2ead28];var _0xde8869=createListener(_0x15f0('0x6')+_0x514122,_0x19d434);OpenchannelMessageEvents['on'](_0x514122,_0xde8869);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6b6=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers'];(function(_0x146b60,_0x549b45){var _0x57bab3=function(_0x3efd0c){while(--_0x3efd0c){_0x146b60['push'](_0x146b60['shift']());}};_0x57bab3(++_0x549b45);}(_0xb6b6,0x16d));var _0x6b6b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb6b6[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6b6b('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b6b('0x1'));var interaction=require(_0x6b6b('0x2'));var config=require(_0x6b6b('0x3'));var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6b6b('0x4')]);router['get'](_0x6b6b('0x5'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x7')]);router[_0x6b6b('0x8')](_0x6b6b('0x9'),auth['isAuthenticated'](),controller[_0x6b6b('0xa')]);router[_0x6b6b('0x8')](_0x6b6b('0xb'),auth['isAuthenticated'](),controller[_0x6b6b('0xc')]);router['get'](_0x6b6b('0xd'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0xe')]);router[_0x6b6b('0x8')](_0x6b6b('0xf'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x10')]);router[_0x6b6b('0x11')]('/',auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x12')]);router['post'](_0x6b6b('0xd'),auth[_0x6b6b('0x6')](),controller['addTeams']);router[_0x6b6b('0x11')](_0x6b6b('0xf'),auth['isAuthenticated'](),controller[_0x6b6b('0x13')]);router[_0x6b6b('0x14')]('/:id',auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x15')]);router['delete'](_0x6b6b('0x9'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x16')]);router['delete'](_0x6b6b('0xd'),auth['isAuthenticated'](),controller[_0x6b6b('0x17')]);router[_0x6b6b('0x18')](_0x6b6b('0xf'),auth[_0x6b6b('0x6')](),controller[_0x6b6b('0x19')]);module[_0x6b6b('0x1a')]=router;
\ No newline at end of file
+var _0xb793=['show','/:id/teams','getAgents','post','create','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe'];(function(_0x1cccea,_0x27acc2){var _0x571972=function(_0x59328b){while(--_0x59328b){_0x1cccea['push'](_0x1cccea['shift']());}};_0x571972(++_0x27acc2);}(_0xb793,0x16d));var _0x3b79=function(_0x2bf15b,_0x3314f0){_0x2bf15b=_0x2bf15b-0x0;var _0x426629=_0xb793[_0x2bf15b];return _0x426629;};'use strict';var multer=require(_0x3b79('0x0'));var util=require(_0x3b79('0x1'));var path=require('path');var timeout=require(_0x3b79('0x2'));var express=require(_0x3b79('0x3'));var router=express[_0x3b79('0x4')]();var fs_extra=require(_0x3b79('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b79('0x6'));var config=require(_0x3b79('0x7'));var controller=require(_0x3b79('0x8'));router[_0x3b79('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3b79('0x9')](_0x3b79('0xa'),auth[_0x3b79('0xb')](),controller[_0x3b79('0xc')]);router[_0x3b79('0x9')]('/:id',auth[_0x3b79('0xb')](),controller[_0x3b79('0xd')]);router[_0x3b79('0x9')]('/:id/members',auth[_0x3b79('0xb')](),controller['getMembers']);router[_0x3b79('0x9')](_0x3b79('0xe'),auth[_0x3b79('0xb')](),controller['getTeams']);router['get']('/:id/users',auth[_0x3b79('0xb')](),controller[_0x3b79('0xf')]);router[_0x3b79('0x10')]('/',auth[_0x3b79('0xb')](),controller[_0x3b79('0x11')]);router[_0x3b79('0x10')](_0x3b79('0xe'),auth[_0x3b79('0xb')](),controller['addTeams']);router[_0x3b79('0x10')](_0x3b79('0x12'),auth[_0x3b79('0xb')](),controller[_0x3b79('0x13')]);router[_0x3b79('0x14')]('/:id',auth[_0x3b79('0xb')](),controller[_0x3b79('0x15')]);router[_0x3b79('0x16')](_0x3b79('0x17'),auth[_0x3b79('0xb')](),controller[_0x3b79('0x18')]);router['delete'](_0x3b79('0xe'),auth[_0x3b79('0xb')](),controller[_0x3b79('0x19')]);router[_0x3b79('0x16')](_0x3b79('0x12'),auth[_0x3b79('0xb')](),controller['removeAgents']);module[_0x3b79('0x1a')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9dfd=['name','INTEGER','ENUM','roundrobin','sequelize','STRING'];(function(_0x26c093,_0x24eec1){var _0x34393d=function(_0x3a02f7){while(--_0x3a02f7){_0x26c093['push'](_0x26c093['shift']());}};_0x34393d(++_0x24eec1);}(_0x9dfd,0xe2));var _0xd9df=function(_0x17a360,_0x3a36f5){_0x17a360=_0x17a360-0x0;var _0x5c252f=_0x9dfd[_0x17a360];return _0x5c252f;};'use strict';var Sequelize=require(_0xd9df('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9df('0x1')],'unique':_0xd9df('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd9df('0x1')]},'timeout':{'type':Sequelize[_0xd9df('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9df('0x4')]('rrmemory','beepall',_0xd9df('0x5'))}};
\ No newline at end of file
+var _0xea70=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3993f0,_0x40c90e){var _0x4545d9=function(_0x2c6b8a){while(--_0x2c6b8a){_0x3993f0['push'](_0x3993f0['shift']());}};_0x4545d9(++_0x40c90e);}(_0xea70,0x8b));var _0x0ea7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea70[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x0ea7('0x0'));module[_0x0ea7('0x1')]={'name':{'type':Sequelize[_0x0ea7('0x2')],'unique':_0x0ea7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0ea7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0ea7('0x5')]('rrmemory',_0x0ea7('0x6'),_0x0ea7('0x7'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x42ac=['all','union','compact','value','transaction','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','userOpenchannelQueue:save','removeAgents','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','json','undefined','limit','count','offset','set','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','sendStatus','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','sort','filter','User','findAndCountAll','UserId','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','order','pick','Agents','online','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','ids','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId'];(function(_0x1de92c,_0x191fa6){var _0x1c9677=function(_0x54f756){while(--_0x54f756){_0x1de92c['push'](_0x1de92c['shift']());}};_0x1c9677(++_0x191fa6);}(_0x42ac,0x1e9));var _0xc42a=function(_0x4cfee9,_0x28859e){_0x4cfee9=_0x4cfee9-0x0;var _0x11457f=_0x42ac[_0x4cfee9];return _0x11457f;};'use strict';var BPromise=require(_0xc42a('0x0'));var util=require(_0xc42a('0x1'));var _=require('lodash');var squel=require(_0xc42a('0x2'));var Redis=require(_0xc42a('0x3'));var qs=require(_0xc42a('0x4'));var logger=require(_0xc42a('0x5'))('api');var config=require(_0xc42a('0x6'));var db=require(_0xc42a('0x7'))['db'];config[_0xc42a('0x8')]=_['defaults'](config[_0xc42a('0x8')],{'host':_0xc42a('0x9'),'port':0x18eb});var socket=require(_0xc42a('0xa'))(new Redis(config[_0xc42a('0x8')]));require(_0xc42a('0xb'))[_0xc42a('0xc')](socket);function respondWithStatusCode(_0x136c5a,_0x2f52ca){_0x2f52ca=_0x2f52ca||0xcc;return function(_0x4a983f){if(_0x4a983f){return _0x136c5a['sendStatus'](_0x2f52ca);}return _0x136c5a[_0xc42a('0xd')](_0x2f52ca)['end']();};}function respondWithResult(_0x37c3d8,_0x57be79){_0x57be79=_0x57be79||0xc8;return function(_0xe03e57){if(_0xe03e57){return _0x37c3d8[_0xc42a('0xd')](_0x57be79)[_0xc42a('0xe')](_0xe03e57);}};}function respondWithFilteredResult(_0x8392f2,_0x530b51){return function(_0x12e17a){if(_0x12e17a){var _0x2e3f36=typeof _0x530b51['offset']===_0xc42a('0xf')&&typeof _0x530b51[_0xc42a('0x10')]===_0xc42a('0xf');var _0x58578=_0x12e17a[_0xc42a('0x11')];var _0x320a3d=_0x2e3f36?0x0:_0x530b51[_0xc42a('0x12')];var _0x5ef659=_0x2e3f36?_0x12e17a[_0xc42a('0x11')]:_0x530b51['offset']+_0x530b51['limit'];var _0x5b8e17;if(_0x5ef659>=_0x58578){_0x5ef659=_0x58578;_0x5b8e17=0xc8;}else{_0x5b8e17=0xce;}_0x8392f2[_0xc42a('0xd')](_0x5b8e17);return _0x8392f2[_0xc42a('0x13')]('Content-Range',_0x320a3d+'-'+_0x5ef659+'/'+_0x58578)[_0xc42a('0xe')](_0x12e17a);}return null;};}function saveUpdates(_0x2bcbd5){return function(_0x26dab3){if(_0x26dab3){return _0x26dab3[_0xc42a('0x14')](_0x2bcbd5)[_0xc42a('0x15')](function(_0x1e74e7){return _0x1e74e7;});}return null;};}function removeEntity(_0x914758){return function(_0x11586b){if(_0x11586b){return _0x11586b[_0xc42a('0x16')]()[_0xc42a('0x15')](function(){var _0x1fb10c=_0x11586b[_0xc42a('0x17')]({'plain':!![]});var _0x279572=_0xc42a('0x18');return db[_0xc42a('0x19')][_0xc42a('0x16')]({'where':{'type':_0x279572,'resourceId':_0x1fb10c['id']}})['then'](function(){return _0x11586b;});})[_0xc42a('0x15')](function(){_0x914758[_0xc42a('0xd')](0xcc)[_0xc42a('0x1a')]();});}};}function handleEntityNotFound(_0x544771){return function(_0x5cae2c){if(!_0x5cae2c){_0x544771[_0xc42a('0x1b')](0x194);}return _0x5cae2c;};}function handleError(_0x3b5d30,_0xdd5a82){_0xdd5a82=_0xdd5a82||0x1f4;return function(_0x54b790){logger[_0xc42a('0x1c')](_0x54b790[_0xc42a('0x1d')]);if(_0x54b790[_0xc42a('0x1e')]){delete _0x54b790[_0xc42a('0x1e')];}_0x3b5d30[_0xc42a('0xd')](_0xdd5a82)['send'](_0x54b790);};}exports[_0xc42a('0x1f')]=function(_0x4394e5,_0x221a95){var _0x36e551={};var _0x1d9f57={'count':0x0,'rows':[]};var _0x31b308=_[_0xc42a('0x20')](db[_0xc42a('0x21')][_0xc42a('0x22')],function(_0x5ac227){return{'name':_0x5ac227[_0xc42a('0x23')],'type':_0x5ac227[_0xc42a('0x24')][_0xc42a('0x25')]};});_0x36e551=qs[_0xc42a('0x26')](_0x31b308,_0x4394e5);var _0x249374={'where':_0x36e551[_0xc42a('0x27')]};return db[_0xc42a('0x21')][_0xc42a('0x11')](_0x249374)[_0xc42a('0x15')](function(_0x2b6319){_0x1d9f57[_0xc42a('0x11')]=_0x2b6319;_0x36e551[_0xc42a('0x28')]=qs['include'](_0x4394e5[_0xc42a('0x29')]);return db[_0xc42a('0x21')][_0xc42a('0x2a')](_0x36e551);})['then'](function(_0x298ec5){_0x1d9f57[_0xc42a('0x2b')]=_0x298ec5;return _0x1d9f57;})[_0xc42a('0x15')](respondWithFilteredResult(_0x221a95,_0x36e551))[_0xc42a('0x2c')](handleError(_0x221a95,null));};exports['show']=function(_0x27c255,_0x1efd5b){var _0x38ed4d={'raw':!![],'where':{'id':_0x27c255[_0xc42a('0x2d')]['id']}},_0x1c0133={};_0x1c0133[_0xc42a('0x2e')]=_[_0xc42a('0x2f')](db[_0xc42a('0x21')]['rawAttributes']);_0x1c0133[_0xc42a('0x29')]=_['keys'](_0x27c255[_0xc42a('0x29')]);_0x1c0133[_0xc42a('0x30')]=_[_0xc42a('0x31')](_0x1c0133['model'],_0x1c0133[_0xc42a('0x29')]);_0x38ed4d[_0xc42a('0x32')]=_[_0xc42a('0x31')](_0x1c0133[_0xc42a('0x2e')],qs[_0xc42a('0x33')](_0x27c255[_0xc42a('0x29')][_0xc42a('0x33')]));_0x38ed4d[_0xc42a('0x32')]=_0x38ed4d[_0xc42a('0x32')]['length']?_0x38ed4d[_0xc42a('0x32')]:_0x1c0133[_0xc42a('0x2e')];if(_0x27c255[_0xc42a('0x29')][_0xc42a('0x34')]){_0x38ed4d[_0xc42a('0x28')]=[{'all':!![]}];}_0x38ed4d=_[_0xc42a('0x35')]({},_0x38ed4d,_0x27c255[_0xc42a('0x36')]);return db['OpenchannelQueue'][_0xc42a('0x37')](_0x38ed4d)['then'](handleEntityNotFound(_0x1efd5b,null))[_0xc42a('0x15')](respondWithResult(_0x1efd5b,null))['catch'](handleError(_0x1efd5b,null));};exports[_0xc42a('0x38')]=function(_0x17d90f,_0x2c2b64){return db[_0xc42a('0x21')][_0xc42a('0x38')](_0x17d90f[_0xc42a('0x39')],{})[_0xc42a('0x15')](function(_0x4baa23){var _0x3f7b0d=_0x17d90f[_0xc42a('0x3a')][_0xc42a('0x17')]({'plain':!![]});if(!_0x3f7b0d)throw new Error(_0xc42a('0x3b'));if(_0x3f7b0d['role']===_0xc42a('0x3a')){var _0x5664d1=_0x4baa23[_0xc42a('0x17')]({'plain':!![]});var _0x2d8ba7='OpenchannelQueues';return db['UserProfileSection'][_0xc42a('0x37')]({'where':{'name':_0x2d8ba7,'userProfileId':_0x3f7b0d[_0xc42a('0x3c')]},'raw':!![]})['then'](function(_0x4c15e4){if(_0x4c15e4&&_0x4c15e4['autoAssociation']===0x0){return db['UserProfileResource'][_0xc42a('0x38')]({'name':_0x5664d1[_0xc42a('0x1e')],'resourceId':_0x5664d1['id'],'type':_0x4c15e4[_0xc42a('0x1e')],'sectionId':_0x4c15e4['id']},{})[_0xc42a('0x15')](function(){return _0x4baa23;});}else{return _0x4baa23;}})['catch'](function(_0x2a9ebd){logger[_0xc42a('0x1c')](_0xc42a('0x3d'),_0x2a9ebd);throw _0x2a9ebd;});}return _0x4baa23;})['then'](respondWithResult(_0x2c2b64,0xc9))[_0xc42a('0x2c')](handleError(_0x2c2b64,null));};exports['update']=function(_0x19f419,_0x477026){if(_0x19f419[_0xc42a('0x39')]['id']){delete _0x19f419[_0xc42a('0x39')]['id'];}return db[_0xc42a('0x21')][_0xc42a('0x37')]({'where':{'id':_0x19f419['params']['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x477026,null))[_0xc42a('0x15')](saveUpdates(_0x19f419[_0xc42a('0x39')],null))['then'](respondWithResult(_0x477026,null))[_0xc42a('0x2c')](handleError(_0x477026,null));};exports[_0xc42a('0x16')]=function(_0x397b96,_0x3864b2){return db[_0xc42a('0x21')]['find']({'where':{'id':_0x397b96['params']['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x3864b2,null))['then'](removeEntity(_0x3864b2,null))[_0xc42a('0x2c')](handleError(_0x3864b2,null));};exports[_0xc42a('0x3e')]=function(_0x566298,_0x59ff7c){return db[_0xc42a('0x21')][_0xc42a('0x3e')]()[_0xc42a('0x15')](respondWithResult(_0x59ff7c,null))['catch'](handleError(_0x59ff7c,null));};exports[_0xc42a('0x3f')]=function(_0x18b5c4,_0x112bb5){var _0x33cee9={'raw':!![],'where':{}},_0x2eff57={},_0x2059d2;return db[_0xc42a('0x21')][_0xc42a('0x40')]({'where':{'id':_0x18b5c4[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x112bb5,null))[_0xc42a('0x15')](function(_0x110b86){if(_0x110b86){_0x2059d2=_0x110b86['get']({'plain':!![]});_0x2eff57[_0xc42a('0x2e')]=_['keys'](db[_0xc42a('0x41')][_0xc42a('0x22')]);_0x2eff57[_0xc42a('0x29')]=_[_0xc42a('0x2f')](_0x18b5c4[_0xc42a('0x29')]);_0x2eff57['filters']=_[_0xc42a('0x31')](_0x2eff57[_0xc42a('0x2e')],_0x2eff57[_0xc42a('0x29')]);_0x33cee9[_0xc42a('0x32')]=_['intersection'](_0x2eff57[_0xc42a('0x2e')],qs[_0xc42a('0x33')](_0x18b5c4['query'][_0xc42a('0x33')]));_0x33cee9[_0xc42a('0x32')]=_0x33cee9[_0xc42a('0x32')][_0xc42a('0x42')]?_0x33cee9[_0xc42a('0x32')]:_0x2eff57['model'];if(!_0x18b5c4[_0xc42a('0x29')][_0xc42a('0x43')](_0xc42a('0x44'))){_0x33cee9[_0xc42a('0x10')]=qs['limit'](_0x18b5c4['query'][_0xc42a('0x10')]);_0x33cee9[_0xc42a('0x12')]=qs[_0xc42a('0x12')](_0x18b5c4['query'][_0xc42a('0x12')]);}_0x33cee9['order']=qs[_0xc42a('0x45')](_0x18b5c4[_0xc42a('0x29')]['sort']);_0x33cee9[_0xc42a('0x27')]=qs[_0xc42a('0x30')](_['pick'](_0x18b5c4[_0xc42a('0x29')],_0x2eff57[_0xc42a('0x30')]));_0x33cee9[_0xc42a('0x27')]['OpenchannelQueueId']=_0x110b86['id'];if(_0x18b5c4[_0xc42a('0x29')][_0xc42a('0x46')]){_0x33cee9[_0xc42a('0x27')]=_[_0xc42a('0x35')](_0x33cee9[_0xc42a('0x27')],{'$or':_[_0xc42a('0x20')](_0x33cee9[_0xc42a('0x32')],function(_0x4412bd){var _0x4fa93e={};_0x4fa93e[_0x4412bd]={'$like':'%'+_0x18b5c4[_0xc42a('0x29')]['filter']+'%'};return _0x4fa93e;})});}_0x33cee9=_['merge']({},_0x33cee9,_0x18b5c4[_0xc42a('0x36')]);return db[_0xc42a('0x41')][_0xc42a('0x2a')](_0x33cee9);}})[_0xc42a('0x15')](function(_0x2c123c){if(_0x2c123c){return db[_0xc42a('0x47')][_0xc42a('0x48')]({'where':{'id':_[_0xc42a('0x20')](_0x2c123c,_0xc42a('0x49')),'role':'agent'},'attributes':['id',_0xc42a('0x1e'),_0xc42a('0x4a'),'updatedAt',_0xc42a('0x4b')]});}})[_0xc42a('0x15')](function(_0x221d0c){if(_0x221d0c){return{'count':_0x221d0c[_0xc42a('0x11')],'rows':_[_0xc42a('0x20')](_0x221d0c['rows'],function(_0x2fa0e9){return{'membername':_0x2fa0e9['name'],'UserId':_0x2fa0e9['id'],'queue_name':_0x2059d2['name'],'OpenchannelQueueId':_0x2059d2['id'],'interface':util['format'](_0xc42a('0x4c'),_0xc42a('0x4d'),_0x2fa0e9['name']),'penalty':0x0,'paused':_0x2fa0e9[_0xc42a('0x4a')],'createdAt':_0x2fa0e9[_0xc42a('0x4b')],'updatedAt':_0x2fa0e9[_0xc42a('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc42a('0x15')](respondWithFilteredResult(_0x112bb5,_0x33cee9))[_0xc42a('0x2c')](handleError(_0x112bb5,null));};exports[_0xc42a('0x4f')]=function(_0x21870c,_0x204d53){var _0x5578aa={};var _0x139ed3={};var _0x33435b;var _0x1fb93b;return db[_0xc42a('0x21')][_0xc42a('0x40')]({'where':{'id':_0x21870c[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x204d53,null))[_0xc42a('0x15')](function(_0x2cca9d){if(_0x2cca9d){_0x33435b=_0x2cca9d;_0x139ed3[_0xc42a('0x2e')]=_[_0xc42a('0x2f')](db[_0xc42a('0x50')][_0xc42a('0x22')]);_0x139ed3[_0xc42a('0x29')]=_['keys'](_0x21870c['query']);_0x139ed3[_0xc42a('0x30')]=_[_0xc42a('0x31')](_0x139ed3[_0xc42a('0x2e')],_0x139ed3['query']);_0x5578aa['attributes']=_[_0xc42a('0x31')](_0x139ed3['model'],qs[_0xc42a('0x33')](_0x21870c[_0xc42a('0x29')][_0xc42a('0x33')]));_0x5578aa[_0xc42a('0x32')]=_0x5578aa['attributes'][_0xc42a('0x42')]?_0x5578aa[_0xc42a('0x32')]:_0x139ed3[_0xc42a('0x2e')];_0x5578aa[_0xc42a('0x51')]=qs[_0xc42a('0x45')](_0x21870c[_0xc42a('0x29')]['sort']);_0x5578aa[_0xc42a('0x27')]=qs[_0xc42a('0x30')](_[_0xc42a('0x52')](_0x21870c[_0xc42a('0x29')],_0x139ed3[_0xc42a('0x30')]));if(_0x21870c[_0xc42a('0x29')]['filter']){_0x5578aa[_0xc42a('0x27')]=_['merge'](_0x5578aa[_0xc42a('0x27')],{'$or':_[_0xc42a('0x20')](_0x5578aa[_0xc42a('0x32')],function(_0x236843){var _0x1a70ea={};_0x1a70ea[_0x236843]={'$like':'%'+_0x21870c[_0xc42a('0x29')][_0xc42a('0x46')]+'%'};return _0x1a70ea;})});}_0x5578aa=_[_0xc42a('0x35')]({},_0x5578aa,_0x21870c[_0xc42a('0x36')]);return _0x33435b['getTeams'](_0x5578aa);}})[_0xc42a('0x15')](function(_0x42e399){if(_0x42e399){_0x1fb93b=_0x42e399[_0xc42a('0x42')];if(!_0x21870c['query'][_0xc42a('0x43')](_0xc42a('0x44'))){_0x5578aa['limit']=qs[_0xc42a('0x10')](_0x21870c[_0xc42a('0x29')][_0xc42a('0x10')]);_0x5578aa['offset']=qs[_0xc42a('0x12')](_0x21870c[_0xc42a('0x29')][_0xc42a('0x12')]);}return _0x33435b[_0xc42a('0x4f')](_0x5578aa);}})[_0xc42a('0x15')](function(_0xd13a34){if(_0xd13a34){return _0xd13a34?{'count':_0x1fb93b,'rows':_0xd13a34}:null;}})[_0xc42a('0x15')](respondWithResult(_0x204d53,null))['catch'](handleError(_0x204d53,null));};exports['addTeams']=function(_0x56cde6,_0x5a1245){var _0x4a99e0=_0x56cde6[_0xc42a('0x39')]['ids'];return db['Team'][_0xc42a('0x2a')]({'where':{'id':_0x4a99e0},'attributes':['id'],'include':[{'model':db[_0xc42a('0x47')],'as':_0xc42a('0x53'),'attributes':['id',_0xc42a('0x1e'),_0xc42a('0x54'),_0xc42a('0x55'),'interface'],'raw':!![]}]})[_0xc42a('0x15')](function(_0x33ba59){if(_0x33ba59){var _0x20b661=_[_0xc42a('0x56')](_0x33ba59,function(_0x2b9d7a){var _0x49a7cf=_0x2b9d7a[_0xc42a('0x17')]({'plain':!![]});return _0x49a7cf[_0xc42a('0x53')];});return db[_0xc42a('0x21')]['find']({'where':{'id':_0x56cde6[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](function(_0x3233ed){return db[_0xc42a('0x57')]['transaction'](function(_0x335dfa){return _0x3233ed[_0xc42a('0x58')](_0x4a99e0,{'transaction':_0x335dfa})['then'](function(){return BPromise[_0xc42a('0x59')](_0x20b661,function(_0xabf80b){return db['UserOpenchannelQueue'][_0xc42a('0x5a')]({'where':{'UserId':_0xabf80b['id'],'OpenchannelQueueId':_0x56cde6[_0xc42a('0x2d')]['id']},'transaction':_0x335dfa});});})['then'](function(){_0x20b661[_0xc42a('0x5b')](function(_0x361981){socket[_0xc42a('0x5c')]('userOpenchannelQueue:save',{'UserId':_0x361981['id'],'OpenchannelQueueId':_0x3233ed['id']});});});});});}})[_0xc42a('0x15')](respondWithStatusCode(_0x5a1245,null))[_0xc42a('0x2c')](handleError(_0x5a1245,null));};exports['removeTeams']=function(_0x22fe92,_0x3ca67d){return db[_0xc42a('0x50')]['findAll']({'where':{'id':_0x22fe92[_0xc42a('0x29')][_0xc42a('0x5d')]},'attributes':['id'],'include':[{'model':db[_0xc42a('0x47')],'as':_0xc42a('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3ca67d,null))[_0xc42a('0x15')](function(_0xf22386){var _0x5b3f9d=_[_0xc42a('0x20')](_0xf22386,'id');var _0x18cfbe=[];var _0x478805=[];var _0x99038e=squel['select']();_0x99038e['field'](_0xc42a('0x5e'))[_0xc42a('0x5f')](_0xc42a('0x60'),'tq')[_0xc42a('0x61')](_0xc42a('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc42a('0x27')](_0xc42a('0x63'),_0x22fe92[_0xc42a('0x2d')]['id']);for(var _0x2485a3=0x0;_0x2485a3<_0xf22386[_0xc42a('0x42')];_0x2485a3+=0x1){let _0x23621e=_0xf22386[_0x2485a3];for(var _0x386b2f=0x0;_0x386b2f<_0x23621e[_0xc42a('0x53')]['length'];_0x386b2f+=0x1){let _0x865e78=_0x23621e[_0xc42a('0x53')][_0x386b2f];var _0x52749f=_0x99038e[_0xc42a('0x64')]();_0x52749f[_0xc42a('0x27')](_0xc42a('0x65'),_0x865e78['id']);_0x478805['push'](db[_0xc42a('0x57')][_0xc42a('0x29')](_0x52749f[_0xc42a('0x66')](),{'type':db[_0xc42a('0x57')]['QueryTypes'][_0xc42a('0x67')]})[_0xc42a('0x15')](function(_0x36badc){if(_0x36badc['length']===0x1){return _0x865e78['id'];}else{var _0x1ff5a9=_[_0xc42a('0x68')](_[_0xc42a('0x20')](_0x36badc,_0xc42a('0x69')),function(_0x4c5414){return _['includes'](_0x5b3f9d,_0x4c5414);});if(_0x1ff5a9){return _0x865e78['id'];}}}));}}return BPromise[_0xc42a('0x6a')](_0x478805)[_0xc42a('0x15')](function(_0x2d526c){_0x18cfbe=_(_0x18cfbe)[_0xc42a('0x6b')](_0x2d526c)[_0xc42a('0x6c')]()[_0xc42a('0x6d')]();return db['OpenchannelQueue'][_0xc42a('0x37')]({'where':{'id':_0x22fe92['params']['id']}})[_0xc42a('0x15')](function(_0x35206c){return db['sequelize'][_0xc42a('0x6e')](function(_0x3e0775){return _0x35206c[_0xc42a('0x6f')](_0x22fe92[_0xc42a('0x29')][_0xc42a('0x5d')],{'transaction':_0x3e0775})[_0xc42a('0x15')](function(){if(!_[_0xc42a('0x70')](_0x18cfbe)){return _0x35206c['removeAgents'](_0x18cfbe,{'transaction':_0x3e0775});}})[_0xc42a('0x15')](function(){_0x18cfbe[_0xc42a('0x5b')](function(_0x15da2c){socket[_0xc42a('0x5c')](_0xc42a('0x71'),{'UserId':_0x15da2c,'OpenchannelQueueId':_0x35206c['id']});});});});});});})[_0xc42a('0x15')](respondWithStatusCode(_0x3ca67d,null))[_0xc42a('0x2c')](handleError(_0x3ca67d,null));};exports[_0xc42a('0x72')]=function(_0xc9313b,_0x54bc86){return db['OpenchannelQueue']['find']({'where':{'id':_0xc9313b[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x54bc86,null))[_0xc42a('0x15')](function(_0x5391a4){if(_0x5391a4){return _0x5391a4[_0xc42a('0x72')](_0xc9313b['body'][_0xc42a('0x5d')],_['omit'](_0xc9313b[_0xc42a('0x39')],[_0xc42a('0x5d'),'id'])||{})['spread'](function(_0x1a6590){for(var _0x2b8cde=0x0;_0x2b8cde<_0xc9313b[_0xc42a('0x39')]['ids'][_0xc42a('0x42')];_0x2b8cde+=0x1){socket[_0xc42a('0x5c')](_0xc42a('0x73'),{'UserId':Number(_0xc9313b[_0xc42a('0x39')][_0xc42a('0x5d')][_0x2b8cde]),'OpenchannelQueueId':Number(_0xc9313b[_0xc42a('0x2d')]['id'])});}return _0x1a6590;});}})[_0xc42a('0x15')](respondWithResult(_0x54bc86,null))['catch'](handleError(_0x54bc86,null));};exports[_0xc42a('0x74')]=function(_0x2b13fd,_0x44c6ef){return db[_0xc42a('0x21')][_0xc42a('0x37')]({'where':{'id':_0x2b13fd[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x44c6ef,null))[_0xc42a('0x15')](function(_0x426962){if(_0x426962){return _0x426962['removeAgents'](_0x2b13fd[_0xc42a('0x29')][_0xc42a('0x5d')])[_0xc42a('0x15')](function(){if(_[_0xc42a('0x75')](_0x2b13fd[_0xc42a('0x29')][_0xc42a('0x5d')])){for(var _0x4ae068=0x0;_0x4ae068<_0x2b13fd[_0xc42a('0x29')]['ids'][_0xc42a('0x42')];_0x4ae068+=0x1){socket[_0xc42a('0x5c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2b13fd[_0xc42a('0x29')]['ids'][_0x4ae068]),'OpenchannelQueueId':Number(_0x2b13fd[_0xc42a('0x2d')]['id'])});}}else{socket[_0xc42a('0x5c')](_0xc42a('0x71'),{'UserId':Number(_0x2b13fd['query'][_0xc42a('0x5d')]),'OpenchannelQueueId':Number(_0x2b13fd[_0xc42a('0x2d')]['id'])});}});}})[_0xc42a('0x15')](respondWithStatusCode(_0x44c6ef,null))[_0xc42a('0x2c')](handleError(_0x44c6ef,null));};exports['getAgents']=function(_0x3c7991,_0x54fb22){var _0x17af3d={};var _0x4b47de={};var _0x4e9574;var _0x5be72f;return db['OpenchannelQueue'][_0xc42a('0x40')]({'where':{'id':_0x3c7991[_0xc42a('0x2d')]['id']}})[_0xc42a('0x15')](handleEntityNotFound(_0x54fb22,null))[_0xc42a('0x15')](function(_0x2f0024){if(_0x2f0024){_0x4e9574=_0x2f0024;_0x4b47de[_0xc42a('0x2e')]=_[_0xc42a('0x2f')](db[_0xc42a('0x47')]['rawAttributes']);_0x4b47de[_0xc42a('0x29')]=_[_0xc42a('0x2f')](_0x3c7991[_0xc42a('0x29')]);_0x4b47de[_0xc42a('0x30')]=_[_0xc42a('0x31')](_0x4b47de[_0xc42a('0x2e')],_0x4b47de[_0xc42a('0x29')]);_0x17af3d[_0xc42a('0x32')]=_['intersection'](_0x4b47de['model'],qs[_0xc42a('0x33')](_0x3c7991[_0xc42a('0x29')]['fields']));_0x17af3d[_0xc42a('0x32')]=_0x17af3d['attributes'][_0xc42a('0x42')]?_0x17af3d[_0xc42a('0x32')]:_0x4b47de['model'];_0x17af3d[_0xc42a('0x51')]=qs[_0xc42a('0x45')](_0x3c7991[_0xc42a('0x29')]['sort']);_0x17af3d['where']=qs[_0xc42a('0x30')](_['pick'](_0x3c7991[_0xc42a('0x29')],_0x4b47de['filters']));if(_0x3c7991[_0xc42a('0x29')][_0xc42a('0x46')]){_0x17af3d['where']=_['merge'](_0x17af3d[_0xc42a('0x27')],{'$or':_[_0xc42a('0x20')](_0x17af3d[_0xc42a('0x32')],function(_0x4bdd25){var _0x556b3e={};_0x556b3e[_0x4bdd25]={'$like':'%'+_0x3c7991[_0xc42a('0x29')]['filter']+'%'};return _0x556b3e;})});}_0x17af3d=_[_0xc42a('0x35')]({},_0x17af3d,_0x3c7991[_0xc42a('0x36')]);return _0x4e9574[_0xc42a('0x76')](_0x17af3d);}})[_0xc42a('0x15')](function(_0x99369){if(_0x99369){_0x5be72f=_0x99369[_0xc42a('0x42')];if(!_0x3c7991[_0xc42a('0x29')]['hasOwnProperty'](_0xc42a('0x44'))){_0x17af3d[_0xc42a('0x10')]=qs['limit'](_0x3c7991[_0xc42a('0x29')][_0xc42a('0x10')]);_0x17af3d[_0xc42a('0x12')]=qs[_0xc42a('0x12')](_0x3c7991[_0xc42a('0x29')][_0xc42a('0x12')]);}return _0x4e9574[_0xc42a('0x76')](_0x17af3d);}})[_0xc42a('0x15')](function(_0x4c2dc5){if(_0x4c2dc5){return _0x4c2dc5?{'count':_0x5be72f,'rows':_0x4c2dc5}:null;}})[_0xc42a('0x15')](respondWithResult(_0x54fb22,null))[_0xc42a('0x2c')](handleError(_0x54fb22,null));};
\ No newline at end of file
+var _0xa942=['getOptions','where','include','query','OpenchannelQueue','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','options','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','merge','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','online','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','removeTeams','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','lodash','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x5a108a,_0x13d551){var _0x4c0574=function(_0x514228){while(--_0x514228){_0x5a108a['push'](_0x5a108a['shift']());}};_0x4c0574(++_0x13d551);}(_0xa942,0x146));var _0x2a94=function(_0x42a730,_0x2645ef){_0x42a730=_0x42a730-0x0;var _0x40eaa9=_0xa942[_0x42a730];return _0x40eaa9;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x2a94('0x0'));var squel=require(_0x2a94('0x1'));var Redis=require(_0x2a94('0x2'));var qs=require(_0x2a94('0x3'));var logger=require('../../config/logger')(_0x2a94('0x4'));var config=require('../../config/environment');var db=require(_0x2a94('0x5'))['db'];config[_0x2a94('0x6')]=_[_0x2a94('0x7')](config['redis'],{'host':_0x2a94('0x8'),'port':0x18eb});var socket=require(_0x2a94('0x9'))(new Redis(config[_0x2a94('0x6')]));require(_0x2a94('0xa'))[_0x2a94('0xb')](socket);function respondWithStatusCode(_0x56fffe,_0x595f32){_0x595f32=_0x595f32||0xcc;return function(_0x890acc){if(_0x890acc){return _0x56fffe['sendStatus'](_0x595f32);}return _0x56fffe[_0x2a94('0xc')](_0x595f32)[_0x2a94('0xd')]();};}function respondWithResult(_0x476e1d,_0x3d2d9a){_0x3d2d9a=_0x3d2d9a||0xc8;return function(_0x118da2){if(_0x118da2){return _0x476e1d[_0x2a94('0xc')](_0x3d2d9a)[_0x2a94('0xe')](_0x118da2);}};}function respondWithFilteredResult(_0x3dd4bf,_0x32ecf1){return function(_0x5cf686){if(_0x5cf686){var _0x15de0f=typeof _0x32ecf1[_0x2a94('0xf')]===_0x2a94('0x10')&&typeof _0x32ecf1[_0x2a94('0x11')]==='undefined';var _0x905e0d=_0x5cf686[_0x2a94('0x12')];var _0x3c3205=_0x15de0f?0x0:_0x32ecf1['offset'];var _0x3bbdf2=_0x15de0f?_0x5cf686['count']:_0x32ecf1[_0x2a94('0xf')]+_0x32ecf1[_0x2a94('0x11')];var _0xe23f16;if(_0x3bbdf2>=_0x905e0d){_0x3bbdf2=_0x905e0d;_0xe23f16=0xc8;}else{_0xe23f16=0xce;}_0x3dd4bf[_0x2a94('0xc')](_0xe23f16);return _0x3dd4bf[_0x2a94('0x13')](_0x2a94('0x14'),_0x3c3205+'-'+_0x3bbdf2+'/'+_0x905e0d)[_0x2a94('0xe')](_0x5cf686);}return null;};}function saveUpdates(_0x56bf1b){return function(_0x851aa9){if(_0x851aa9){return _0x851aa9[_0x2a94('0x15')](_0x56bf1b)[_0x2a94('0x16')](function(_0x105a66){return _0x105a66;});}return null;};}function removeEntity(_0x2ea05e){return function(_0xc6d3fc){if(_0xc6d3fc){return _0xc6d3fc[_0x2a94('0x17')]()['then'](function(){var _0x3b8af1=_0xc6d3fc[_0x2a94('0x18')]({'plain':!![]});var _0x82497b=_0x2a94('0x19');return db[_0x2a94('0x1a')][_0x2a94('0x17')]({'where':{'type':_0x82497b,'resourceId':_0x3b8af1['id']}})[_0x2a94('0x16')](function(){return _0xc6d3fc;});})[_0x2a94('0x16')](function(){_0x2ea05e[_0x2a94('0xc')](0xcc)[_0x2a94('0xd')]();});}};}function handleEntityNotFound(_0x5a0cc9){return function(_0x88b1a2){if(!_0x88b1a2){_0x5a0cc9['sendStatus'](0x194);}return _0x88b1a2;};}function handleError(_0x215a6,_0x541dc1){_0x541dc1=_0x541dc1||0x1f4;return function(_0x454df9){logger[_0x2a94('0x1b')](_0x454df9[_0x2a94('0x1c')]);if(_0x454df9['name']){delete _0x454df9[_0x2a94('0x1d')];}_0x215a6['status'](_0x541dc1)[_0x2a94('0x1e')](_0x454df9);};}exports[_0x2a94('0x1f')]=function(_0x2d3665,_0xaaf84a){var _0x30fe7f={};var _0x3e0d9b={'count':0x0,'rows':[]};var _0x85f15e=_[_0x2a94('0x20')](db['OpenchannelQueue'][_0x2a94('0x21')],function(_0x49e202){return{'name':_0x49e202[_0x2a94('0x22')],'type':_0x49e202[_0x2a94('0x23')][_0x2a94('0x24')]};});_0x30fe7f=qs[_0x2a94('0x25')](_0x85f15e,_0x2d3665);var _0x16b273={'where':_0x30fe7f[_0x2a94('0x26')]};return db['OpenchannelQueue'][_0x2a94('0x12')](_0x16b273)[_0x2a94('0x16')](function(_0xbce280){_0x3e0d9b[_0x2a94('0x12')]=_0xbce280;_0x30fe7f[_0x2a94('0x27')]=qs[_0x2a94('0x27')](_0x2d3665[_0x2a94('0x28')]);return db[_0x2a94('0x29')][_0x2a94('0x2a')](_0x30fe7f);})[_0x2a94('0x16')](function(_0x16d70b){_0x3e0d9b[_0x2a94('0x2b')]=_0x16d70b;return _0x3e0d9b;})[_0x2a94('0x16')](respondWithFilteredResult(_0xaaf84a,_0x30fe7f))[_0x2a94('0x2c')](handleError(_0xaaf84a,null));};exports['show']=function(_0x26ff8f,_0x2c4b14){var _0xa529e3={'raw':!![],'where':{'id':_0x26ff8f[_0x2a94('0x2d')]['id']}},_0x6f1800={};_0x6f1800[_0x2a94('0x2e')]=_['keys'](db[_0x2a94('0x29')][_0x2a94('0x21')]);_0x6f1800[_0x2a94('0x28')]=_[_0x2a94('0x2f')](_0x26ff8f[_0x2a94('0x28')]);_0x6f1800[_0x2a94('0x30')]=_[_0x2a94('0x31')](_0x6f1800[_0x2a94('0x2e')],_0x6f1800['query']);_0xa529e3[_0x2a94('0x32')]=_[_0x2a94('0x31')](_0x6f1800['model'],qs[_0x2a94('0x33')](_0x26ff8f['query'][_0x2a94('0x33')]));_0xa529e3[_0x2a94('0x32')]=_0xa529e3[_0x2a94('0x32')][_0x2a94('0x34')]?_0xa529e3[_0x2a94('0x32')]:_0x6f1800[_0x2a94('0x2e')];if(_0x26ff8f[_0x2a94('0x28')]['includeAll']){_0xa529e3['include']=[{'all':!![]}];}_0xa529e3=_['merge']({},_0xa529e3,_0x26ff8f[_0x2a94('0x35')]);return db['OpenchannelQueue'][_0x2a94('0x36')](_0xa529e3)[_0x2a94('0x16')](handleEntityNotFound(_0x2c4b14,null))[_0x2a94('0x16')](respondWithResult(_0x2c4b14,null))[_0x2a94('0x2c')](handleError(_0x2c4b14,null));};exports['create']=function(_0x37e2c3,_0x15fda6){return db[_0x2a94('0x29')]['create'](_0x37e2c3['body'],{})['then'](function(_0x1a6b33){var _0x2d315f=_0x37e2c3['user'][_0x2a94('0x18')]({'plain':!![]});if(!_0x2d315f)throw new Error(_0x2a94('0x37'));if(_0x2d315f[_0x2a94('0x38')]==='user'){var _0x3c2362=_0x1a6b33[_0x2a94('0x18')]({'plain':!![]});var _0x3d1840=_0x2a94('0x19');return db[_0x2a94('0x39')][_0x2a94('0x36')]({'where':{'name':_0x3d1840,'userProfileId':_0x2d315f[_0x2a94('0x3a')]},'raw':!![]})[_0x2a94('0x16')](function(_0x1d1cab){if(_0x1d1cab&&_0x1d1cab[_0x2a94('0x3b')]===0x0){return db['UserProfileResource'][_0x2a94('0x3c')]({'name':_0x3c2362[_0x2a94('0x1d')],'resourceId':_0x3c2362['id'],'type':_0x1d1cab[_0x2a94('0x1d')],'sectionId':_0x1d1cab['id']},{})['then'](function(){return _0x1a6b33;});}else{return _0x1a6b33;}})[_0x2a94('0x2c')](function(_0x4b4b13){logger['error'](_0x2a94('0x3d'),_0x4b4b13);throw _0x4b4b13;});}return _0x1a6b33;})['then'](respondWithResult(_0x15fda6,0xc9))[_0x2a94('0x2c')](handleError(_0x15fda6,null));};exports['update']=function(_0x5b41a9,_0x5c47e4){if(_0x5b41a9[_0x2a94('0x3e')]['id']){delete _0x5b41a9['body']['id'];}return db[_0x2a94('0x29')][_0x2a94('0x36')]({'where':{'id':_0x5b41a9['params']['id']}})['then'](handleEntityNotFound(_0x5c47e4,null))['then'](saveUpdates(_0x5b41a9[_0x2a94('0x3e')],null))[_0x2a94('0x16')](respondWithResult(_0x5c47e4,null))[_0x2a94('0x2c')](handleError(_0x5c47e4,null));};exports[_0x2a94('0x17')]=function(_0x32b5b8,_0x30a23c){return db[_0x2a94('0x29')]['find']({'where':{'id':_0x32b5b8[_0x2a94('0x2d')]['id']}})[_0x2a94('0x16')](handleEntityNotFound(_0x30a23c,null))[_0x2a94('0x16')](removeEntity(_0x30a23c,null))['catch'](handleError(_0x30a23c,null));};exports[_0x2a94('0x3f')]=function(_0x394bf9,_0x2e93b6){return db[_0x2a94('0x29')]['describe']()[_0x2a94('0x16')](respondWithResult(_0x2e93b6,null))[_0x2a94('0x2c')](handleError(_0x2e93b6,null));};exports[_0x2a94('0x40')]=function(_0xd0544f,_0x22c026){var _0x308053={'raw':!![],'where':{}},_0x46ad84={},_0x1232c4;return db['OpenchannelQueue'][_0x2a94('0x41')]({'where':{'id':_0xd0544f[_0x2a94('0x2d')]['id']}})[_0x2a94('0x16')](handleEntityNotFound(_0x22c026,null))[_0x2a94('0x16')](function(_0x3980da){if(_0x3980da){_0x1232c4=_0x3980da[_0x2a94('0x18')]({'plain':!![]});_0x46ad84[_0x2a94('0x2e')]=_['keys'](db[_0x2a94('0x42')]['rawAttributes']);_0x46ad84[_0x2a94('0x28')]=_[_0x2a94('0x2f')](_0xd0544f[_0x2a94('0x28')]);_0x46ad84[_0x2a94('0x30')]=_[_0x2a94('0x31')](_0x46ad84[_0x2a94('0x2e')],_0x46ad84[_0x2a94('0x28')]);_0x308053[_0x2a94('0x32')]=_[_0x2a94('0x31')](_0x46ad84[_0x2a94('0x2e')],qs[_0x2a94('0x33')](_0xd0544f[_0x2a94('0x28')][_0x2a94('0x33')]));_0x308053['attributes']=_0x308053[_0x2a94('0x32')]['length']?_0x308053[_0x2a94('0x32')]:_0x46ad84[_0x2a94('0x2e')];if(!_0xd0544f['query'][_0x2a94('0x43')](_0x2a94('0x44'))){_0x308053[_0x2a94('0x11')]=qs['limit'](_0xd0544f['query'][_0x2a94('0x11')]);_0x308053['offset']=qs[_0x2a94('0xf')](_0xd0544f[_0x2a94('0x28')][_0x2a94('0xf')]);}_0x308053[_0x2a94('0x45')]=qs[_0x2a94('0x46')](_0xd0544f[_0x2a94('0x28')]['sort']);_0x308053[_0x2a94('0x26')]=qs[_0x2a94('0x30')](_[_0x2a94('0x47')](_0xd0544f['query'],_0x46ad84[_0x2a94('0x30')]));_0x308053['where'][_0x2a94('0x48')]=_0x3980da['id'];if(_0xd0544f[_0x2a94('0x28')]['filter']){_0x308053[_0x2a94('0x26')]=_[_0x2a94('0x49')](_0x308053[_0x2a94('0x26')],{'$or':_[_0x2a94('0x20')](_0x308053['attributes'],function(_0x5e3783){var _0x489028={};_0x489028[_0x5e3783]={'$like':'%'+_0xd0544f[_0x2a94('0x28')][_0x2a94('0x4a')]+'%'};return _0x489028;})});}_0x308053=_[_0x2a94('0x49')]({},_0x308053,_0xd0544f['options']);return db[_0x2a94('0x42')][_0x2a94('0x2a')](_0x308053);}})[_0x2a94('0x16')](function(_0x25533c){if(_0x25533c){return db[_0x2a94('0x4b')][_0x2a94('0x4c')]({'where':{'id':_[_0x2a94('0x20')](_0x25533c,_0x2a94('0x4d')),'role':_0x2a94('0x4e')},'attributes':['id','name',_0x2a94('0x4f'),_0x2a94('0x50'),_0x2a94('0x51')]});}})[_0x2a94('0x16')](function(_0x5ab7aa){if(_0x5ab7aa){return{'count':_0x5ab7aa[_0x2a94('0x12')],'rows':_[_0x2a94('0x20')](_0x5ab7aa[_0x2a94('0x2b')],function(_0x3457c0){return{'membername':_0x3457c0[_0x2a94('0x1d')],'UserId':_0x3457c0['id'],'queue_name':_0x1232c4['name'],'OpenchannelQueueId':_0x1232c4['id'],'interface':util[_0x2a94('0x52')]('%s/%s',_0x2a94('0x53'),_0x3457c0[_0x2a94('0x1d')]),'penalty':0x0,'paused':_0x3457c0[_0x2a94('0x4f')],'createdAt':_0x3457c0[_0x2a94('0x51')],'updatedAt':_0x3457c0[_0x2a94('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2a94('0x16')](respondWithFilteredResult(_0x22c026,_0x308053))[_0x2a94('0x2c')](handleError(_0x22c026,null));};exports[_0x2a94('0x54')]=function(_0x4005b7,_0x3fe344){var _0x566059={};var _0x4d0a16={};var _0xd1e995;var _0x4317bf;return db['OpenchannelQueue'][_0x2a94('0x41')]({'where':{'id':_0x4005b7[_0x2a94('0x2d')]['id']}})[_0x2a94('0x16')](handleEntityNotFound(_0x3fe344,null))[_0x2a94('0x16')](function(_0x9a2fdc){if(_0x9a2fdc){_0xd1e995=_0x9a2fdc;_0x4d0a16['model']=_[_0x2a94('0x2f')](db['Team']['rawAttributes']);_0x4d0a16[_0x2a94('0x28')]=_['keys'](_0x4005b7[_0x2a94('0x28')]);_0x4d0a16['filters']=_[_0x2a94('0x31')](_0x4d0a16[_0x2a94('0x2e')],_0x4d0a16['query']);_0x566059['attributes']=_['intersection'](_0x4d0a16['model'],qs[_0x2a94('0x33')](_0x4005b7[_0x2a94('0x28')][_0x2a94('0x33')]));_0x566059['attributes']=_0x566059[_0x2a94('0x32')][_0x2a94('0x34')]?_0x566059['attributes']:_0x4d0a16[_0x2a94('0x2e')];_0x566059[_0x2a94('0x45')]=qs['sort'](_0x4005b7['query'][_0x2a94('0x46')]);_0x566059[_0x2a94('0x26')]=qs[_0x2a94('0x30')](_['pick'](_0x4005b7[_0x2a94('0x28')],_0x4d0a16[_0x2a94('0x30')]));if(_0x4005b7[_0x2a94('0x28')]['filter']){_0x566059[_0x2a94('0x26')]=_['merge'](_0x566059[_0x2a94('0x26')],{'$or':_[_0x2a94('0x20')](_0x566059[_0x2a94('0x32')],function(_0x579f51){var _0x3c3022={};_0x3c3022[_0x579f51]={'$like':'%'+_0x4005b7[_0x2a94('0x28')][_0x2a94('0x4a')]+'%'};return _0x3c3022;})});}_0x566059=_[_0x2a94('0x49')]({},_0x566059,_0x4005b7[_0x2a94('0x35')]);return _0xd1e995[_0x2a94('0x54')](_0x566059);}})[_0x2a94('0x16')](function(_0x118ec7){if(_0x118ec7){_0x4317bf=_0x118ec7[_0x2a94('0x34')];if(!_0x4005b7[_0x2a94('0x28')][_0x2a94('0x43')]('nolimit')){_0x566059[_0x2a94('0x11')]=qs[_0x2a94('0x11')](_0x4005b7[_0x2a94('0x28')][_0x2a94('0x11')]);_0x566059[_0x2a94('0xf')]=qs[_0x2a94('0xf')](_0x4005b7['query'][_0x2a94('0xf')]);}return _0xd1e995[_0x2a94('0x54')](_0x566059);}})[_0x2a94('0x16')](function(_0x3c726f){if(_0x3c726f){return _0x3c726f?{'count':_0x4317bf,'rows':_0x3c726f}:null;}})['then'](respondWithResult(_0x3fe344,null))[_0x2a94('0x2c')](handleError(_0x3fe344,null));};exports[_0x2a94('0x55')]=function(_0x495943,_0x3047f2){var _0x1701c9=_0x495943[_0x2a94('0x3e')][_0x2a94('0x56')];return db[_0x2a94('0x57')][_0x2a94('0x2a')]({'where':{'id':_0x1701c9},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x2a94('0x58'),'voicePause',_0x2a94('0x59')],'raw':!![]}]})[_0x2a94('0x16')](function(_0x239ec3){if(_0x239ec3){var _0x3925a1=_[_0x2a94('0x5a')](_0x239ec3,function(_0x28380e){var _0x209e89=_0x28380e[_0x2a94('0x18')]({'plain':!![]});return _0x209e89[_0x2a94('0x5b')];});return db[_0x2a94('0x29')][_0x2a94('0x36')]({'where':{'id':_0x495943['params']['id']}})['then'](function(_0x23b71d){return db['sequelize'][_0x2a94('0x5c')](function(_0x4d5386){return _0x23b71d[_0x2a94('0x55')](_0x1701c9,{'transaction':_0x4d5386})[_0x2a94('0x16')](function(){return BPromise[_0x2a94('0x5d')](_0x3925a1,function(_0x394837){return db[_0x2a94('0x42')][_0x2a94('0x5e')]({'where':{'UserId':_0x394837['id'],'OpenchannelQueueId':_0x495943['params']['id']},'transaction':_0x4d5386});});})[_0x2a94('0x16')](function(){_0x3925a1[_0x2a94('0x5f')](function(_0x5f049d){socket[_0x2a94('0x60')](_0x2a94('0x61'),{'UserId':_0x5f049d['id'],'OpenchannelQueueId':_0x23b71d['id']});});});});});}})[_0x2a94('0x16')](respondWithStatusCode(_0x3047f2,null))['catch'](handleError(_0x3047f2,null));};exports['removeTeams']=function(_0x200391,_0x471d73){return db[_0x2a94('0x57')][_0x2a94('0x2a')]({'where':{'id':_0x200391[_0x2a94('0x28')][_0x2a94('0x56')]},'attributes':['id'],'include':[{'model':db[_0x2a94('0x4b')],'as':_0x2a94('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x2a94('0x16')](handleEntityNotFound(_0x471d73,null))['then'](function(_0x422179){var _0x421c98=_[_0x2a94('0x20')](_0x422179,'id');var _0x18da14=[];var _0x36a0f2=[];var _0x1d459b=squel['select']();_0x1d459b['field'](_0x2a94('0x62'))[_0x2a94('0x63')]('team_has_openchannel_queues','tq')[_0x2a94('0x64')](_0x2a94('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2a94('0x26')]('OpenchannelQueueId\x20=\x20?',_0x200391[_0x2a94('0x2d')]['id']);for(var _0x538199=0x0;_0x538199<_0x422179[_0x2a94('0x34')];_0x538199+=0x1){let _0x7e51de=_0x422179[_0x538199];for(var _0x59ee88=0x0;_0x59ee88<_0x7e51de['Agents'][_0x2a94('0x34')];_0x59ee88+=0x1){let _0x1c875d=_0x7e51de[_0x2a94('0x5b')][_0x59ee88];var _0xe65270=_0x1d459b[_0x2a94('0x66')]();_0xe65270['where'](_0x2a94('0x67'),_0x1c875d['id']);_0x36a0f2[_0x2a94('0x68')](db[_0x2a94('0x69')][_0x2a94('0x28')](_0xe65270[_0x2a94('0x6a')](),{'type':db[_0x2a94('0x69')][_0x2a94('0x6b')][_0x2a94('0x6c')]})[_0x2a94('0x16')](function(_0x533cd0){if(_0x533cd0['length']===0x1){return _0x1c875d['id'];}else{var _0x3227e3=_[_0x2a94('0x6d')](_[_0x2a94('0x20')](_0x533cd0,'TeamId'),function(_0x2da31a){return _[_0x2a94('0x6e')](_0x421c98,_0x2da31a);});if(_0x3227e3){return _0x1c875d['id'];}}}));}}return BPromise[_0x2a94('0x6f')](_0x36a0f2)[_0x2a94('0x16')](function(_0x28d0ef){_0x18da14=_(_0x18da14)[_0x2a94('0x70')](_0x28d0ef)[_0x2a94('0x71')]()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x200391[_0x2a94('0x2d')]['id']}})[_0x2a94('0x16')](function(_0x1ee32e){return db[_0x2a94('0x69')][_0x2a94('0x5c')](function(_0x4ea8d4){return _0x1ee32e[_0x2a94('0x72')](_0x200391[_0x2a94('0x28')][_0x2a94('0x56')],{'transaction':_0x4ea8d4})[_0x2a94('0x16')](function(){if(!_['isEmpty'](_0x18da14)){return _0x1ee32e[_0x2a94('0x73')](_0x18da14,{'transaction':_0x4ea8d4});}})[_0x2a94('0x16')](function(){_0x18da14['forEach'](function(_0x5d6d74){socket['emit'](_0x2a94('0x74'),{'UserId':_0x5d6d74,'OpenchannelQueueId':_0x1ee32e['id']});});});});});});})[_0x2a94('0x16')](respondWithStatusCode(_0x471d73,null))[_0x2a94('0x2c')](handleError(_0x471d73,null));};exports[_0x2a94('0x75')]=function(_0x5f470d,_0x3fc205){return db['OpenchannelQueue'][_0x2a94('0x36')]({'where':{'id':_0x5f470d[_0x2a94('0x2d')]['id']}})[_0x2a94('0x16')](handleEntityNotFound(_0x3fc205,null))[_0x2a94('0x16')](function(_0x4cbc30){if(_0x4cbc30){return _0x4cbc30['addAgents'](_0x5f470d['body'][_0x2a94('0x56')],_[_0x2a94('0x76')](_0x5f470d[_0x2a94('0x3e')],['ids','id'])||{})[_0x2a94('0x77')](function(_0x4e9023){for(var _0x3faaa3=0x0;_0x3faaa3<_0x5f470d[_0x2a94('0x3e')][_0x2a94('0x56')][_0x2a94('0x34')];_0x3faaa3+=0x1){socket[_0x2a94('0x60')](_0x2a94('0x61'),{'UserId':Number(_0x5f470d[_0x2a94('0x3e')][_0x2a94('0x56')][_0x3faaa3]),'OpenchannelQueueId':Number(_0x5f470d[_0x2a94('0x2d')]['id'])});}return _0x4e9023;});}})[_0x2a94('0x16')](respondWithResult(_0x3fc205,null))[_0x2a94('0x2c')](handleError(_0x3fc205,null));};exports['removeAgents']=function(_0xf5461c,_0x1b8cab){return db['OpenchannelQueue'][_0x2a94('0x36')]({'where':{'id':_0xf5461c[_0x2a94('0x2d')]['id']}})[_0x2a94('0x16')](handleEntityNotFound(_0x1b8cab,null))['then'](function(_0x243a08){if(_0x243a08){return _0x243a08[_0x2a94('0x73')](_0xf5461c[_0x2a94('0x28')][_0x2a94('0x56')])[_0x2a94('0x16')](function(){if(_['isArray'](_0xf5461c[_0x2a94('0x28')][_0x2a94('0x56')])){for(var _0x37498e=0x0;_0x37498e<_0xf5461c['query'][_0x2a94('0x56')][_0x2a94('0x34')];_0x37498e+=0x1){socket[_0x2a94('0x60')](_0x2a94('0x74'),{'UserId':Number(_0xf5461c[_0x2a94('0x28')]['ids'][_0x37498e]),'OpenchannelQueueId':Number(_0xf5461c['params']['id'])});}}else{socket[_0x2a94('0x60')](_0x2a94('0x74'),{'UserId':Number(_0xf5461c[_0x2a94('0x28')][_0x2a94('0x56')]),'OpenchannelQueueId':Number(_0xf5461c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1b8cab,null))[_0x2a94('0x2c')](handleError(_0x1b8cab,null));};exports[_0x2a94('0x78')]=function(_0x1e0505,_0x468ac0){var _0x40720e={};var _0x15e068={};var _0x3d6657;var _0x41b6b3;return db['OpenchannelQueue'][_0x2a94('0x41')]({'where':{'id':_0x1e0505['params']['id']}})[_0x2a94('0x16')](handleEntityNotFound(_0x468ac0,null))['then'](function(_0x5dd2dd){if(_0x5dd2dd){_0x3d6657=_0x5dd2dd;_0x15e068['model']=_[_0x2a94('0x2f')](db[_0x2a94('0x4b')][_0x2a94('0x21')]);_0x15e068[_0x2a94('0x28')]=_[_0x2a94('0x2f')](_0x1e0505[_0x2a94('0x28')]);_0x15e068[_0x2a94('0x30')]=_[_0x2a94('0x31')](_0x15e068[_0x2a94('0x2e')],_0x15e068[_0x2a94('0x28')]);_0x40720e[_0x2a94('0x32')]=_['intersection'](_0x15e068[_0x2a94('0x2e')],qs['fields'](_0x1e0505[_0x2a94('0x28')][_0x2a94('0x33')]));_0x40720e[_0x2a94('0x32')]=_0x40720e[_0x2a94('0x32')]['length']?_0x40720e[_0x2a94('0x32')]:_0x15e068[_0x2a94('0x2e')];_0x40720e[_0x2a94('0x45')]=qs[_0x2a94('0x46')](_0x1e0505['query']['sort']);_0x40720e[_0x2a94('0x26')]=qs[_0x2a94('0x30')](_[_0x2a94('0x47')](_0x1e0505[_0x2a94('0x28')],_0x15e068[_0x2a94('0x30')]));if(_0x1e0505[_0x2a94('0x28')][_0x2a94('0x4a')]){_0x40720e[_0x2a94('0x26')]=_[_0x2a94('0x49')](_0x40720e[_0x2a94('0x26')],{'$or':_[_0x2a94('0x20')](_0x40720e[_0x2a94('0x32')],function(_0x162d39){var _0x1b58fb={};_0x1b58fb[_0x162d39]={'$like':'%'+_0x1e0505[_0x2a94('0x28')][_0x2a94('0x4a')]+'%'};return _0x1b58fb;})});}_0x40720e=_['merge']({},_0x40720e,_0x1e0505['options']);return _0x3d6657[_0x2a94('0x78')](_0x40720e);}})['then'](function(_0x3311e){if(_0x3311e){_0x41b6b3=_0x3311e['length'];if(!_0x1e0505[_0x2a94('0x28')]['hasOwnProperty'](_0x2a94('0x44'))){_0x40720e['limit']=qs[_0x2a94('0x11')](_0x1e0505[_0x2a94('0x28')][_0x2a94('0x11')]);_0x40720e[_0x2a94('0xf')]=qs[_0x2a94('0xf')](_0x1e0505[_0x2a94('0x28')][_0x2a94('0xf')]);}return _0x3d6657[_0x2a94('0x78')](_0x40720e);}})[_0x2a94('0x16')](function(_0xe47d4d){if(_0xe47d4d){return _0xe47d4d?{'count':_0x41b6b3,'rows':_0xe47d4d}:null;}})[_0x2a94('0x16')](respondWithResult(_0x468ac0,null))[_0x2a94('0x2c')](handleError(_0x468ac0,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x27de=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x27de,0x148));var _0xe27d=function(_0x181e32,_0x5ce863){_0x181e32=_0x181e32-0x0;var _0x15ad23=_0x27de[_0x181e32];return _0x15ad23;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xe27d('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe27d('0x1'),'afterUpdate':'update','afterDestroy':_0xe27d('0x2')};function emitEvent(_0x554839){return function(_0x235a40,_0xe9639c,_0x56015a){OpenchannelQueueEvents['emit'](_0x554839+':'+_0x235a40['id'],_0x235a40);OpenchannelQueueEvents[_0xe27d('0x3')](_0x554839,_0x235a40);_0x56015a(null);};}for(var e in events){if(events[_0xe27d('0x4')](e)){var event=events[e];OpenchannelQueue[_0xe27d('0x5')](e,emitEvent(event));}}module[_0xe27d('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x7606=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x4242bc,_0x42d673){var _0x47c3ce=function(_0x5da82e){while(--_0x5da82e){_0x4242bc['push'](_0x4242bc['shift']());}};_0x47c3ce(++_0x42d673);}(_0x7606,0xf5));var _0x6760=function(_0x3fc6d7,_0x16dd05){_0x3fc6d7=_0x3fc6d7-0x0;var _0x2b1f09=_0x7606[_0x3fc6d7];return _0x2b1f09;};'use strict';var EventEmitter=require(_0x6760('0x0'));var OpenchannelQueue=require(_0x6760('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6760('0x2')](0x0);var events={'afterCreate':_0x6760('0x3'),'afterUpdate':_0x6760('0x4'),'afterDestroy':_0x6760('0x5')};function emitEvent(_0xa61bd9){return function(_0x309f7e,_0x461f6e,_0x251a89){OpenchannelQueueEvents['emit'](_0xa61bd9+':'+_0x309f7e['id'],_0x309f7e);OpenchannelQueueEvents[_0x6760('0x6')](_0xa61bd9,_0x309f7e);_0x251a89(null);};}for(var e in events){if(events[_0x6760('0x7')](e)){var event=events[e];OpenchannelQueue[_0x6760('0x8')](e,emitEvent(event));}}module[_0x6760('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1728=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','moment'];(function(_0x19318e,_0x46c067){var _0x425540=function(_0xb4e055){while(--_0xb4e055){_0x19318e['push'](_0x19318e['shift']());}};_0x425540(++_0x46c067);}(_0x1728,0x129));var _0x8172=function(_0x148077,_0x1789af){_0x148077=_0x148077-0x0;var _0x21019e=_0x1728[_0x148077];return _0x21019e;};'use strict';var _=require('lodash');var util=require(_0x8172('0x0'));var logger=require(_0x8172('0x1'))('api');var moment=require(_0x8172('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8172('0x3'));var config=require(_0x8172('0x4'));var attributes=require(_0x8172('0x5'));module[_0x8172('0x6')]=function(_0x13d023,_0x2b1dc5){return _0x13d023[_0x8172('0x7')](_0x8172('0x8'),attributes,{'tableName':_0x8172('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d8b=['openchannel_queues','lodash','util','api','moment','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x1f79df,_0x1aa436){var _0x59089b=function(_0x2c76e7){while(--_0x2c76e7){_0x1f79df['push'](_0x1f79df['shift']());}};_0x59089b(++_0x1aa436);}(_0x5d8b,0x9d));var _0xb5d8=function(_0x6e2cab,_0x22c51c){_0x6e2cab=_0x6e2cab-0x0;var _0x5f58cd=_0x5d8b[_0x6e2cab];return _0x5f58cd;};'use strict';var _=require(_0xb5d8('0x0'));var util=require(_0xb5d8('0x1'));var logger=require('../../config/logger')(_0xb5d8('0x2'));var moment=require(_0xb5d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5d8('0x4'));var fs=require('fs');var path=require(_0xb5d8('0x5'));var rimraf=require(_0xb5d8('0x6'));var config=require('../../config/environment');var attributes=require(_0xb5d8('0x7'));module[_0xb5d8('0x8')]=function(_0x5b10e6,_0x47446d){return _0x5b10e6[_0xb5d8('0x9')](_0xb5d8('0xa'),attributes,{'tableName':_0xb5d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7c7=['error','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4927fb,_0x3636d1){var _0x2224d9=function(_0x17ccc5){while(--_0x17ccc5){_0x4927fb['push'](_0x4927fb['shift']());}};_0x2224d9(++_0x3636d1);}(_0xf7c7,0x1f2));var _0x7f7c=function(_0x3311a4,_0x1e312c){_0x3311a4=_0x3311a4-0x0;var _0x5e0c86=_0xf7c7[_0x3311a4];return _0x5e0c86;};'use strict';var _=require(_0x7f7c('0x0'));var util=require(_0x7f7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f7c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f7c('0x4'))(_0x7f7c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f7c('0x6')]({'port':0x232a});config[_0x7f7c('0x7')]=_[_0x7f7c('0x8')](config[_0x7f7c('0x7')],{'host':_0x7f7c('0x9'),'port':0x18eb});var socket=require(_0x7f7c('0xa'))(new Redis(config['redis']));require(_0x7f7c('0xb'))[_0x7f7c('0xc')](socket);function respondWithRpcPromise(_0xc59ab7,_0x19a319,_0xfac39){return new BPromise(function(_0x53c26a,_0x410f6e){return client[_0x7f7c('0xd')](_0xc59ab7,_0xfac39)[_0x7f7c('0xe')](function(_0x374fed){logger[_0x7f7c('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x19a319,'request\x20sent');logger[_0x7f7c('0x10')](_0x7f7c('0x11'),_0x19a319,_0x7f7c('0x12'),JSON[_0x7f7c('0x13')](_0x374fed));if(_0x374fed[_0x7f7c('0x14')]){if(_0x374fed[_0x7f7c('0x14')]['code']===0x1f4){logger[_0x7f7c('0x14')](_0x7f7c('0x15'),_0x19a319,_0x374fed[_0x7f7c('0x14')][_0x7f7c('0x16')]);return _0x410f6e(_0x374fed['error'][_0x7f7c('0x16')]);}logger[_0x7f7c('0x14')](_0x7f7c('0x15'),_0x19a319,_0x374fed[_0x7f7c('0x14')][_0x7f7c('0x16')]);return _0x53c26a(_0x374fed[_0x7f7c('0x14')][_0x7f7c('0x16')]);}else{logger[_0x7f7c('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x19a319,'request\x20sent');_0x53c26a(_0x374fed[_0x7f7c('0x17')][_0x7f7c('0x16')]);}})['catch'](function(_0x199940){logger[_0x7f7c('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x19a319,_0x199940);_0x410f6e(_0x199940);});});}exports[_0x7f7c('0x18')]=function(_0x340cef){var _0x3ea99a=this;return new Promise(function(_0x76f835,_0x1ae032){return db[_0x7f7c('0x19')][_0x7f7c('0x1a')]({'raw':_0x340cef[_0x7f7c('0x1b')]?_0x340cef['options'][_0x7f7c('0x1c')]===undefined?!![]:![]:!![],'where':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x1d')]||null:null,'attributes':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x1e')]||null:null,'limit':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x1f')]||null:null,'include':_0x340cef[_0x7f7c('0x1b')]?_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x20')]?_[_0x7f7c('0x21')](_0x340cef[_0x7f7c('0x1b')][_0x7f7c('0x20')],function(_0x1a9fdd){return{'model':db[_0x1a9fdd[_0x7f7c('0x22')]],'as':_0x1a9fdd['as'],'attributes':_0x1a9fdd[_0x7f7c('0x1e')],'include':_0x1a9fdd['include']?_[_0x7f7c('0x21')](_0x1a9fdd[_0x7f7c('0x20')],function(_0x44ee39){return{'model':db[_0x44ee39[_0x7f7c('0x22')]],'as':_0x44ee39['as'],'attributes':_0x44ee39[_0x7f7c('0x1e')],'include':_0x44ee39['include']?_[_0x7f7c('0x21')](_0x44ee39[_0x7f7c('0x20')],function(_0x3f9483){return{'model':db[_0x3f9483[_0x7f7c('0x22')]],'as':_0x3f9483['as'],'attributes':_0x3f9483[_0x7f7c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x423bc2){logger[_0x7f7c('0xf')](_0x7f7c('0x18'),_0x340cef);logger[_0x7f7c('0x10')](_0x7f7c('0x18'),_0x340cef,JSON[_0x7f7c('0x13')](_0x423bc2));_0x76f835(_0x423bc2);})[_0x7f7c('0x23')](function(_0x149a3a){logger[_0x7f7c('0x14')]('GetOpenchannelQueue',_0x149a3a[_0x7f7c('0x16')],_0x340cef);_0x1ae032(_0x3ea99a[_0x7f7c('0x14')](0x1f4,_0x149a3a[_0x7f7c('0x16')]));});});};exports[_0x7f7c('0x24')]=function(_0x35477e){var _0x25c2c3=this;return new Promise(function(_0x35b29b,_0x565991){return db['OpenchannelQueue']['find']({'raw':_0x35477e[_0x7f7c('0x1b')]?_0x35477e[_0x7f7c('0x1b')][_0x7f7c('0x1c')]===undefined?!![]:![]:!![],'where':_0x35477e[_0x7f7c('0x1b')]?_0x35477e['options']['where']||null:null,'attributes':_0x35477e['options']?_0x35477e[_0x7f7c('0x1b')][_0x7f7c('0x1e')]||null:null,'include':_0x35477e[_0x7f7c('0x1b')]?_0x35477e['options'][_0x7f7c('0x20')]?_[_0x7f7c('0x21')](_0x35477e[_0x7f7c('0x1b')]['include'],function(_0x2262d7){return{'model':db[_0x2262d7[_0x7f7c('0x22')]],'as':_0x2262d7['as'],'attributes':_0x2262d7[_0x7f7c('0x1e')],'include':_0x2262d7[_0x7f7c('0x20')]?_['map'](_0x2262d7[_0x7f7c('0x20')],function(_0x2ca243){return{'model':db[_0x2ca243[_0x7f7c('0x22')]],'as':_0x2ca243['as'],'attributes':_0x2ca243[_0x7f7c('0x1e')],'include':_0x2ca243[_0x7f7c('0x20')]?_[_0x7f7c('0x21')](_0x2ca243[_0x7f7c('0x20')],function(_0x1b8f7e){return{'model':db[_0x1b8f7e['model']],'as':_0x1b8f7e['as'],'attributes':_0x1b8f7e[_0x7f7c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7f7c('0xe')](function(_0x1623c6){logger[_0x7f7c('0xf')](_0x7f7c('0x24'),_0x35477e);logger['debug'](_0x7f7c('0x24'),_0x35477e,JSON[_0x7f7c('0x13')](_0x1623c6));_0x35b29b(_0x1623c6);})['catch'](function(_0x291ade){logger['error'](_0x7f7c('0x24'),_0x291ade[_0x7f7c('0x16')],_0x35477e);_0x565991(_0x25c2c3['error'](0x1f4,_0x291ade[_0x7f7c('0x16')]));});});};
\ No newline at end of file
+var _0xa8b4=['defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','raw','where','attributes','limit','include','map','model','then','GetOpenchannelQueue','catch','ShowOpenchannelQueue','OpenchannelQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xf0ee74,_0xa0720){var _0x4a3e6b=function(_0x20ec61){while(--_0x20ec61){_0xf0ee74['push'](_0xf0ee74['shift']());}};_0x4a3e6b(++_0xa0720);}(_0xa8b4,0x186));var _0x4a8b=function(_0x390eda,_0x3a68c9){_0x390eda=_0x390eda-0x0;var _0x4ae2d9=_0xa8b4[_0x390eda];return _0x4ae2d9;};'use strict';var _=require('lodash');var util=require(_0x4a8b('0x0'));var moment=require(_0x4a8b('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a8b('0x2'));var fs=require('fs');var Redis=require(_0x4a8b('0x3'));var db=require(_0x4a8b('0x4'))['db'];var utils=require(_0x4a8b('0x5'));var logger=require(_0x4a8b('0x6'))(_0x4a8b('0x7'));var config=require(_0x4a8b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4a8b('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4a8b('0xa')](config[_0x4a8b('0xb')],{'host':_0x4a8b('0xc'),'port':0x18eb});var socket=require(_0x4a8b('0xd'))(new Redis(config[_0x4a8b('0xb')]));require(_0x4a8b('0xe'))['register'](socket);function respondWithRpcPromise(_0x331e53,_0x64f922,_0x2b4c2e){return new BPromise(function(_0x4cda51,_0x39e367){return client[_0x4a8b('0xf')](_0x331e53,_0x2b4c2e)['then'](function(_0xf9539b){logger['info'](_0x4a8b('0x10'),_0x64f922,_0x4a8b('0x11'));logger[_0x4a8b('0x12')](_0x4a8b('0x13'),_0x64f922,'request\x20sent',JSON[_0x4a8b('0x14')](_0xf9539b));if(_0xf9539b[_0x4a8b('0x15')]){if(_0xf9539b[_0x4a8b('0x15')][_0x4a8b('0x16')]===0x1f4){logger[_0x4a8b('0x15')](_0x4a8b('0x10'),_0x64f922,_0xf9539b[_0x4a8b('0x15')]['message']);return _0x39e367(_0xf9539b[_0x4a8b('0x15')]['message']);}logger[_0x4a8b('0x15')](_0x4a8b('0x10'),_0x64f922,_0xf9539b['error'][_0x4a8b('0x17')]);return _0x4cda51(_0xf9539b[_0x4a8b('0x15')]['message']);}else{logger[_0x4a8b('0x18')](_0x4a8b('0x10'),_0x64f922,_0x4a8b('0x11'));_0x4cda51(_0xf9539b[_0x4a8b('0x19')][_0x4a8b('0x17')]);}})['catch'](function(_0x3ad1eb){logger[_0x4a8b('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x64f922,_0x3ad1eb);_0x39e367(_0x3ad1eb);});});}exports['GetOpenchannelQueue']=function(_0x19fed4){var _0xd7e3fa=this;return new Promise(function(_0x3bf782,_0x1f2912){return db['OpenchannelQueue'][_0x4a8b('0x1a')]({'raw':_0x19fed4[_0x4a8b('0x1b')]?_0x19fed4['options'][_0x4a8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x19fed4[_0x4a8b('0x1b')]?_0x19fed4[_0x4a8b('0x1b')][_0x4a8b('0x1d')]||null:null,'attributes':_0x19fed4[_0x4a8b('0x1b')]?_0x19fed4[_0x4a8b('0x1b')][_0x4a8b('0x1e')]||null:null,'limit':_0x19fed4[_0x4a8b('0x1b')]?_0x19fed4[_0x4a8b('0x1b')][_0x4a8b('0x1f')]||null:null,'include':_0x19fed4[_0x4a8b('0x1b')]?_0x19fed4[_0x4a8b('0x1b')][_0x4a8b('0x20')]?_[_0x4a8b('0x21')](_0x19fed4[_0x4a8b('0x1b')]['include'],function(_0x15f070){return{'model':db[_0x15f070[_0x4a8b('0x22')]],'as':_0x15f070['as'],'attributes':_0x15f070[_0x4a8b('0x1e')],'include':_0x15f070[_0x4a8b('0x20')]?_[_0x4a8b('0x21')](_0x15f070[_0x4a8b('0x20')],function(_0x5bd6b1){return{'model':db[_0x5bd6b1[_0x4a8b('0x22')]],'as':_0x5bd6b1['as'],'attributes':_0x5bd6b1[_0x4a8b('0x1e')],'include':_0x5bd6b1[_0x4a8b('0x20')]?_[_0x4a8b('0x21')](_0x5bd6b1[_0x4a8b('0x20')],function(_0xbdf92){return{'model':db[_0xbdf92[_0x4a8b('0x22')]],'as':_0xbdf92['as'],'attributes':_0xbdf92[_0x4a8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a8b('0x23')](function(_0x2deed8){logger[_0x4a8b('0x18')](_0x4a8b('0x24'),_0x19fed4);logger[_0x4a8b('0x12')]('GetOpenchannelQueue',_0x19fed4,JSON[_0x4a8b('0x14')](_0x2deed8));_0x3bf782(_0x2deed8);})[_0x4a8b('0x25')](function(_0x131c55){logger[_0x4a8b('0x15')](_0x4a8b('0x24'),_0x131c55['message'],_0x19fed4);_0x1f2912(_0xd7e3fa[_0x4a8b('0x15')](0x1f4,_0x131c55[_0x4a8b('0x17')]));});});};exports[_0x4a8b('0x26')]=function(_0x51ec0b){var _0x509966=this;return new Promise(function(_0x3face5,_0x135b9c){return db[_0x4a8b('0x27')]['find']({'raw':_0x51ec0b['options']?_0x51ec0b[_0x4a8b('0x1b')][_0x4a8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x51ec0b['options']?_0x51ec0b[_0x4a8b('0x1b')]['where']||null:null,'attributes':_0x51ec0b['options']?_0x51ec0b[_0x4a8b('0x1b')]['attributes']||null:null,'include':_0x51ec0b[_0x4a8b('0x1b')]?_0x51ec0b[_0x4a8b('0x1b')][_0x4a8b('0x20')]?_[_0x4a8b('0x21')](_0x51ec0b['options'][_0x4a8b('0x20')],function(_0x2bd9c4){return{'model':db[_0x2bd9c4[_0x4a8b('0x22')]],'as':_0x2bd9c4['as'],'attributes':_0x2bd9c4[_0x4a8b('0x1e')],'include':_0x2bd9c4[_0x4a8b('0x20')]?_['map'](_0x2bd9c4[_0x4a8b('0x20')],function(_0x27f53d){return{'model':db[_0x27f53d[_0x4a8b('0x22')]],'as':_0x27f53d['as'],'attributes':_0x27f53d['attributes'],'include':_0x27f53d[_0x4a8b('0x20')]?_[_0x4a8b('0x21')](_0x27f53d[_0x4a8b('0x20')],function(_0x22c70d){return{'model':db[_0x22c70d[_0x4a8b('0x22')]],'as':_0x22c70d['as'],'attributes':_0x22c70d[_0x4a8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a8b('0x23')](function(_0x5ee639){logger['info'](_0x4a8b('0x26'),_0x51ec0b);logger[_0x4a8b('0x12')](_0x4a8b('0x26'),_0x51ec0b,JSON['stringify'](_0x5ee639));_0x3face5(_0x5ee639);})[_0x4a8b('0x25')](function(_0x3ce6ae){logger[_0x4a8b('0x15')](_0x4a8b('0x26'),_0x3ce6ae[_0x4a8b('0x17')],_0x51ec0b);_0x135b9c(_0x509966[_0x4a8b('0x15')](0x1f4,_0x3ce6ae[_0x4a8b('0x17')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2813=['length','openchannelQueue:','save','remove','update','removeListener'];(function(_0x155d46,_0x449942){var _0xc4def1=function(_0x3a49f7){while(--_0x3a49f7){_0x155d46['push'](_0x155d46['shift']());}};_0xc4def1(++_0x449942);}(_0x2813,0x6e));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x3281('0x0'),_0x3281('0x1'),_0x3281('0x2')];function createListener(_0x5be05a,_0x1df386){return function(_0xa382c6){_0x1df386['emit'](_0x5be05a,_0xa382c6);};}function removeListener(_0x1d5525,_0x1686ae){return function(){OpenchannelQueueEvents[_0x3281('0x3')](_0x1d5525,_0x1686ae);};}exports['register']=function(_0x311b4b){for(var _0x416223=0x0,_0xbe4263=events[_0x3281('0x4')];_0x416223<_0xbe4263;_0x416223++){var _0xf5b36e=events[_0x416223];var _0x5d594b=createListener(_0x3281('0x5')+_0xf5b36e,_0x311b4b);OpenchannelQueueEvents['on'](_0xf5b36e,_0x5d594b);}};
\ No newline at end of file
+var _0xe216=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener'];(function(_0x3a49bd,_0x28b7a1){var _0x34f66a=function(_0x2c9731){while(--_0x2c9731){_0x3a49bd['push'](_0x3a49bd['shift']());}};_0x34f66a(++_0x28b7a1);}(_0xe216,0x6b));var _0x6e21=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xe216[_0x5805d7];return _0x170fe4;};'use strict';var OpenchannelQueueEvents=require(_0x6e21('0x0'));var events=['save',_0x6e21('0x1'),_0x6e21('0x2')];function createListener(_0x213076,_0x538162){return function(_0x3f351d){_0x538162[_0x6e21('0x3')](_0x213076,_0x3f351d);};}function removeListener(_0x1c75c1,_0x4c3709){return function(){OpenchannelQueueEvents[_0x6e21('0x4')](_0x1c75c1,_0x4c3709);};}exports['register']=function(_0x387268){for(var _0x143431=0x0,_0xee9956=events[_0x6e21('0x5')];_0x143431<_0xee9956;_0x143431++){var _0x295bb0=events[_0x143431];var _0x3ed147=createListener(_0x6e21('0x6')+_0x295bb0,_0x387268);OpenchannelQueueEvents['on'](_0x295bb0,_0x3ed147);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49b0=['get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x56ffec,_0x10a357){var _0x5a9004=function(_0x245a82){while(--_0x245a82){_0x56ffec['push'](_0x56ffec['shift']());}};_0x5a9004(++_0x10a357);}(_0x49b0,0x173));var _0x049b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x49b0[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x049b('0x2'));var router=express[_0x049b('0x3')]();var fs_extra=require(_0x049b('0x4'));var auth=require(_0x049b('0x5'));var interaction=require(_0x049b('0x6'));var config=require(_0x049b('0x7'));var controller=require(_0x049b('0x8'));router[_0x049b('0x9')]('/',auth[_0x049b('0xa')](),controller[_0x049b('0xb')]);router['get']('/describe',auth[_0x049b('0xa')](),controller['describe']);router[_0x049b('0x9')](_0x049b('0xc'),auth[_0x049b('0xa')](),controller[_0x049b('0xd')]);router['post']('/',auth[_0x049b('0xa')](),controller['create']);router[_0x049b('0xe')](_0x049b('0xc'),auth['isAuthenticated'](),controller[_0x049b('0xf')]);router[_0x049b('0x10')](_0x049b('0xc'),auth[_0x049b('0xa')](),controller[_0x049b('0x11')]);module[_0x049b('0x12')]=router;
\ No newline at end of file
+var _0xeaf5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','multer','util','path','connect-timeout','express'];(function(_0x1ea32f,_0x4e9794){var _0x1f9c72=function(_0x48595b){while(--_0x48595b){_0x1ea32f['push'](_0x1ea32f['shift']());}};_0x1f9c72(++_0x4e9794);}(_0xeaf5,0x19f));var _0x5eaf=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xeaf5[_0x35d8af];return _0x1d08b0;};'use strict';var multer=require(_0x5eaf('0x0'));var util=require(_0x5eaf('0x1'));var path=require(_0x5eaf('0x2'));var timeout=require(_0x5eaf('0x3'));var express=require(_0x5eaf('0x4'));var router=express[_0x5eaf('0x5')]();var fs_extra=require(_0x5eaf('0x6'));var auth=require(_0x5eaf('0x7'));var interaction=require(_0x5eaf('0x8'));var config=require(_0x5eaf('0x9'));var controller=require(_0x5eaf('0xa'));router['get']('/',auth[_0x5eaf('0xb')](),controller[_0x5eaf('0xc')]);router[_0x5eaf('0xd')](_0x5eaf('0xe'),auth[_0x5eaf('0xb')](),controller[_0x5eaf('0xf')]);router['get'](_0x5eaf('0x10'),auth[_0x5eaf('0xb')](),controller['show']);router[_0x5eaf('0x11')]('/',auth['isAuthenticated'](),controller[_0x5eaf('0x12')]);router[_0x5eaf('0x13')]('/:id',auth[_0x5eaf('0xb')](),controller['update']);router[_0x5eaf('0x14')]('/:id',auth[_0x5eaf('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x155e=['DATE','moment','sequelize','exports','STRING'];(function(_0x198247,_0x491c12){var _0x2b18bc=function(_0x4a43e2){while(--_0x4a43e2){_0x198247['push'](_0x198247['shift']());}};_0x2b18bc(++_0x491c12);}(_0x155e,0x9c));var _0xe155=function(_0x5e624f,_0x393089){_0x5e624f=_0x5e624f-0x0;var _0x3c5d04=_0x155e[_0x5e624f];return _0x3c5d04;};'use strict';var moment=require(_0xe155('0x0'));var Sequelize=require(_0xe155('0x1'));module[_0xe155('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe155('0x3')]},'joinAt':{'type':Sequelize[_0xe155('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe155('0x4')]},'exitAt':{'type':Sequelize[_0xe155('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd70d=['DATE','exports','STRING'];(function(_0x307060,_0x26dc3d){var _0x3a2587=function(_0x283dde){while(--_0x283dde){_0x307060['push'](_0x307060['shift']());}};_0x3a2587(++_0x26dc3d);}(_0xd70d,0x100));var _0xdd70=function(_0x545cbd,_0x594f86){_0x545cbd=_0x545cbd-0x0;var _0x43d507=_0xd70d[_0x545cbd];return _0x43d507;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xdd70('0x0')]={'uniqueid':{'type':Sequelize[_0xdd70('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdd70('0x2')]},'leaveAt':{'type':Sequelize[_0xdd70('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdd70('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3003=['fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','eml-format','rimraf','moment','util','path','to-csv'];(function(_0x3e620d,_0x246b12){var _0x522b2e=function(_0x4f65ee){while(--_0x4f65ee){_0x3e620d['push'](_0x3e620d['shift']());}};_0x522b2e(++_0x246b12);}(_0x3003,0x14e));var _0x3300=function(_0x4bddb0,_0x21fb3e){_0x4bddb0=_0x4bddb0-0x0;var _0x17a7f8=_0x3003[_0x4bddb0];return _0x17a7f8;};'use strict';var emlformat=require(_0x3300('0x0'));var rimraf=require(_0x3300('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3300('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3300('0x3'));var path=require(_0x3300('0x4'));var sox=require('sox');var csv=require(_0x3300('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3300('0x6'));var _=require(_0x3300('0x7'));var squel=require(_0x3300('0x8'));var crypto=require(_0x3300('0x9'));var jsforce=require(_0x3300('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3300('0x5'));var querystring=require('querystring');var Papa=require(_0x3300('0xb'));var Redis=require(_0x3300('0xc'));var authService=require(_0x3300('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3300('0xe'))(_0x3300('0xf'));var utils=require(_0x3300('0x10'));var config=require(_0x3300('0x11'));var licenseUtil=require(_0x3300('0x12'));var db=require(_0x3300('0x13'))['db'];function respondWithStatusCode(_0x22f6d9,_0x3390c8){_0x3390c8=_0x3390c8||0xcc;return function(_0x35077d){if(_0x35077d){return _0x22f6d9[_0x3300('0x14')](_0x3390c8);}return _0x22f6d9[_0x3300('0x15')](_0x3390c8)[_0x3300('0x16')]();};}function respondWithResult(_0x1c30d5,_0x1f4615){_0x1f4615=_0x1f4615||0xc8;return function(_0x4acb8f){if(_0x4acb8f){return _0x1c30d5['status'](_0x1f4615)['json'](_0x4acb8f);}};}function respondWithFilteredResult(_0x1f31fb,_0x69a2cb){return function(_0x4dd08e){if(_0x4dd08e){var _0x8bfee2=typeof _0x69a2cb[_0x3300('0x17')]===_0x3300('0x18')&&typeof _0x69a2cb[_0x3300('0x19')]===_0x3300('0x18');var _0xb3ffcc=_0x4dd08e[_0x3300('0x1a')];var _0x3fd3b5=_0x8bfee2?0x0:_0x69a2cb[_0x3300('0x17')];var _0x46e0c1=_0x8bfee2?_0x4dd08e[_0x3300('0x1a')]:_0x69a2cb[_0x3300('0x17')]+_0x69a2cb['limit'];var _0x397d30;if(_0x46e0c1>=_0xb3ffcc){_0x46e0c1=_0xb3ffcc;_0x397d30=0xc8;}else{_0x397d30=0xce;}_0x1f31fb[_0x3300('0x15')](_0x397d30);return _0x1f31fb['set']('Content-Range',_0x3fd3b5+'-'+_0x46e0c1+'/'+_0xb3ffcc)[_0x3300('0x1b')](_0x4dd08e);}return null;};}function patchUpdates(_0x3b431e){return function(_0xfb8a50){try{jsonpatch['apply'](_0xfb8a50,_0x3b431e,!![]);}catch(_0x2b8b31){return BPromise[_0x3300('0x1c')](_0x2b8b31);}return _0xfb8a50['save']();};}function saveUpdates(_0x32a82a,_0x192a91){return function(_0x222f74){if(_0x222f74){return _0x222f74[_0x3300('0x1d')](_0x32a82a)[_0x3300('0x1e')](function(_0x314593){return _0x314593;});}return null;};}function removeEntity(_0x28eedc,_0x23fac6){return function(_0x4f4809){if(_0x4f4809){return _0x4f4809[_0x3300('0x1f')]()['then'](function(){_0x28eedc[_0x3300('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x123b26,_0x5af978){return function(_0x1c2a14){if(!_0x1c2a14){_0x123b26[_0x3300('0x14')](0x194);}return _0x1c2a14;};}function handleError(_0x27a9c7,_0x4585b2){_0x4585b2=_0x4585b2||0x1f4;return function(_0x235689){logger['error'](_0x235689[_0x3300('0x20')]);if(_0x235689[_0x3300('0x21')]){delete _0x235689[_0x3300('0x21')];}_0x27a9c7[_0x3300('0x15')](_0x4585b2)[_0x3300('0x22')](_0x235689);};}exports[_0x3300('0x23')]=function(_0x4f4795,_0x112a3e){var _0x3b52da={},_0x16eeb5={},_0x204a98={'count':0x0,'rows':[]};var _0x45df1e=_[_0x3300('0x24')](db[_0x3300('0x25')][_0x3300('0x26')],function(_0x2b13b7){return{'name':_0x2b13b7['fieldName'],'type':_0x2b13b7[_0x3300('0x27')][_0x3300('0x28')]};});_0x16eeb5[_0x3300('0x29')]=_[_0x3300('0x24')](_0x45df1e,_0x3300('0x21'));_0x16eeb5[_0x3300('0x2a')]=_['keys'](_0x4f4795[_0x3300('0x2a')]);_0x16eeb5[_0x3300('0x2b')]=_[_0x3300('0x2c')](_0x16eeb5[_0x3300('0x29')],_0x16eeb5[_0x3300('0x2a')]);_0x3b52da[_0x3300('0x2d')]=_['intersection'](_0x16eeb5['model'],qs[_0x3300('0x2e')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x2e')]));_0x3b52da[_0x3300('0x2d')]=_0x3b52da[_0x3300('0x2d')][_0x3300('0x2f')]?_0x3b52da[_0x3300('0x2d')]:_0x16eeb5[_0x3300('0x29')];if(!_0x4f4795[_0x3300('0x2a')][_0x3300('0x30')]('nolimit')){_0x3b52da[_0x3300('0x19')]=qs[_0x3300('0x19')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x19')]);_0x3b52da['offset']=qs[_0x3300('0x17')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x17')]);}_0x3b52da[_0x3300('0x31')]=qs[_0x3300('0x32')](_0x4f4795[_0x3300('0x2a')][_0x3300('0x32')]);_0x3b52da[_0x3300('0x33')]=qs[_0x3300('0x2b')](_[_0x3300('0x34')](_0x4f4795[_0x3300('0x2a')],_0x16eeb5[_0x3300('0x2b')]),_0x45df1e);if(_0x4f4795[_0x3300('0x2a')][_0x3300('0x35')]){_0x3b52da[_0x3300('0x33')]=_[_0x3300('0x36')](_0x3b52da[_0x3300('0x33')],{'$or':_[_0x3300('0x24')](_0x45df1e,function(_0x2354cd){if(_0x2354cd[_0x3300('0x27')]!==_0x3300('0x37')){var _0x392426={};_0x392426[_0x2354cd['name']]={'$like':'%'+_0x4f4795['query'][_0x3300('0x35')]+'%'};return _0x392426;}})});}_0x3b52da=_[_0x3300('0x36')]({},_0x3b52da,_0x4f4795[_0x3300('0x38')]);var _0x250d63={'where':_0x3b52da[_0x3300('0x33')]};return db[_0x3300('0x25')][_0x3300('0x1a')](_0x250d63)['then'](function(_0x3d71c4){_0x204a98[_0x3300('0x1a')]=_0x3d71c4;if(_0x4f4795[_0x3300('0x2a')][_0x3300('0x39')]){_0x3b52da[_0x3300('0x3a')]=[{'all':!![]}];}return db[_0x3300('0x25')][_0x3300('0x3b')](_0x3b52da);})['then'](function(_0x4874f4){_0x204a98[_0x3300('0x3c')]=_0x4874f4;return _0x204a98;})['then'](respondWithFilteredResult(_0x112a3e,_0x3b52da))[_0x3300('0x3d')](handleError(_0x112a3e,null));};exports['show']=function(_0x3d5e61,_0x364aef){var _0x50fe59={'raw':!![],'where':{'id':_0x3d5e61['params']['id']}},_0x250df1={};_0x250df1['model']=_[_0x3300('0x3e')](db['OpenchannelQueueReport'][_0x3300('0x26')]);_0x250df1[_0x3300('0x2a')]=_[_0x3300('0x3e')](_0x3d5e61[_0x3300('0x2a')]);_0x250df1[_0x3300('0x2b')]=_[_0x3300('0x2c')](_0x250df1[_0x3300('0x29')],_0x250df1['query']);_0x50fe59['attributes']=_[_0x3300('0x2c')](_0x250df1[_0x3300('0x29')],qs[_0x3300('0x2e')](_0x3d5e61[_0x3300('0x2a')]['fields']));_0x50fe59['attributes']=_0x50fe59[_0x3300('0x2d')][_0x3300('0x2f')]?_0x50fe59[_0x3300('0x2d')]:_0x250df1['model'];if(_0x3d5e61[_0x3300('0x2a')][_0x3300('0x39')]){_0x50fe59[_0x3300('0x3a')]=[{'all':!![]}];}_0x50fe59=_[_0x3300('0x36')]({},_0x50fe59,_0x3d5e61[_0x3300('0x38')]);return db['OpenchannelQueueReport'][_0x3300('0x3f')](_0x50fe59)[_0x3300('0x1e')](handleEntityNotFound(_0x364aef,null))['then'](respondWithResult(_0x364aef,null))['catch'](handleError(_0x364aef,null));};exports[_0x3300('0x40')]=function(_0x2997b7,_0x44fa5b){return db['OpenchannelQueueReport']['create'](_0x2997b7[_0x3300('0x41')],{})['then'](respondWithResult(_0x44fa5b,0xc9))[_0x3300('0x3d')](handleError(_0x44fa5b,null));};exports[_0x3300('0x1d')]=function(_0x29454d,_0x14b5e9){if(_0x29454d['body']['id']){delete _0x29454d[_0x3300('0x41')]['id'];}return db[_0x3300('0x25')][_0x3300('0x3f')]({'where':{'id':_0x29454d[_0x3300('0x42')]['id']}})[_0x3300('0x1e')](handleEntityNotFound(_0x14b5e9,null))[_0x3300('0x1e')](saveUpdates(_0x29454d[_0x3300('0x41')],null))[_0x3300('0x1e')](respondWithResult(_0x14b5e9,null))[_0x3300('0x3d')](handleError(_0x14b5e9,null));};exports['destroy']=function(_0x551cf5,_0x572caa){return db['OpenchannelQueueReport'][_0x3300('0x3f')]({'where':{'id':_0x551cf5[_0x3300('0x42')]['id']}})[_0x3300('0x1e')](handleEntityNotFound(_0x572caa,null))['then'](removeEntity(_0x572caa,null))[_0x3300('0x3d')](handleError(_0x572caa,null));};exports[_0x3300('0x43')]=function(_0x5d5d90,_0x3246fb){return db[_0x3300('0x25')][_0x3300('0x43')]()['then'](respondWithResult(_0x3246fb,null))[_0x3300('0x3d')](handleError(_0x3246fb,null));};
\ No newline at end of file
+var _0xa13c=['error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','options','then','includeAll','include','catch','params','keys','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','save','destroy','end','sendStatus'];(function(_0x18209b,_0x524148){var _0x4c88b9=function(_0x225678){while(--_0x225678){_0x18209b['push'](_0x18209b['shift']());}};_0x4c88b9(++_0x524148);}(_0xa13c,0x12f));var _0xca13=function(_0xa7b78,_0x3e897e){_0xa7b78=_0xa7b78-0x0;var _0x4a93c4=_0xa13c[_0xa7b78];return _0x4a93c4;};'use strict';var emlformat=require(_0xca13('0x0'));var rimraf=require(_0xca13('0x1'));var zipdir=require(_0xca13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xca13('0x3'));var BPromise=require(_0xca13('0x4'));var Mustache=require(_0xca13('0x5'));var util=require(_0xca13('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca13('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xca13('0x8'));var jsforce=require(_0xca13('0x9'));var deskjs=require(_0xca13('0xa'));var toCsv=require(_0xca13('0xb'));var querystring=require(_0xca13('0xc'));var Papa=require(_0xca13('0xd'));var Redis=require('ioredis');var authService=require(_0xca13('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xca13('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca13('0x10'))(_0xca13('0x11'));var utils=require(_0xca13('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xca13('0x13'));var db=require(_0xca13('0x14'))['db'];function respondWithStatusCode(_0x143b89,_0x3b7cdb){_0x3b7cdb=_0x3b7cdb||0xcc;return function(_0x5c7747){if(_0x5c7747){return _0x143b89['sendStatus'](_0x3b7cdb);}return _0x143b89['status'](_0x3b7cdb)['end']();};}function respondWithResult(_0x42d0c7,_0xad89f5){_0xad89f5=_0xad89f5||0xc8;return function(_0x3573c0){if(_0x3573c0){return _0x42d0c7[_0xca13('0x15')](_0xad89f5)[_0xca13('0x16')](_0x3573c0);}};}function respondWithFilteredResult(_0x37528e,_0x3e9f97){return function(_0x2e4463){if(_0x2e4463){var _0x44d1ff=typeof _0x3e9f97[_0xca13('0x17')]==='undefined'&&typeof _0x3e9f97[_0xca13('0x18')]==='undefined';var _0x2acd82=_0x2e4463[_0xca13('0x19')];var _0x223605=_0x44d1ff?0x0:_0x3e9f97[_0xca13('0x17')];var _0x15df09=_0x44d1ff?_0x2e4463[_0xca13('0x19')]:_0x3e9f97['offset']+_0x3e9f97['limit'];var _0x30496e;if(_0x15df09>=_0x2acd82){_0x15df09=_0x2acd82;_0x30496e=0xc8;}else{_0x30496e=0xce;}_0x37528e[_0xca13('0x15')](_0x30496e);return _0x37528e[_0xca13('0x1a')](_0xca13('0x1b'),_0x223605+'-'+_0x15df09+'/'+_0x2acd82)['json'](_0x2e4463);}return null;};}function patchUpdates(_0x296bb6){return function(_0x58500b){try{jsonpatch['apply'](_0x58500b,_0x296bb6,!![]);}catch(_0x200ed9){return BPromise['reject'](_0x200ed9);}return _0x58500b[_0xca13('0x1c')]();};}function saveUpdates(_0xc61723,_0x4ac27e){return function(_0x4a993e){if(_0x4a993e){return _0x4a993e['update'](_0xc61723)['then'](function(_0x4748a8){return _0x4748a8;});}return null;};}function removeEntity(_0x3b5fe2,_0x42454f){return function(_0x3431f4){if(_0x3431f4){return _0x3431f4[_0xca13('0x1d')]()['then'](function(){_0x3b5fe2[_0xca13('0x15')](0xcc)[_0xca13('0x1e')]();});}};}function handleEntityNotFound(_0x53930d,_0x1cf826){return function(_0x26e9fa){if(!_0x26e9fa){_0x53930d[_0xca13('0x1f')](0x194);}return _0x26e9fa;};}function handleError(_0x6fd487,_0x430477){_0x430477=_0x430477||0x1f4;return function(_0x27a1fd){logger[_0xca13('0x20')](_0x27a1fd[_0xca13('0x21')]);if(_0x27a1fd[_0xca13('0x22')]){delete _0x27a1fd[_0xca13('0x22')];}_0x6fd487[_0xca13('0x15')](_0x430477)['send'](_0x27a1fd);};}exports[_0xca13('0x23')]=function(_0x50183b,_0x2b0d97){var _0x1f3ef3={},_0xd8504f={},_0x3d46f1={'count':0x0,'rows':[]};var _0x5baf84=_[_0xca13('0x24')](db[_0xca13('0x25')][_0xca13('0x26')],function(_0x4d1bb4){return{'name':_0x4d1bb4[_0xca13('0x27')],'type':_0x4d1bb4[_0xca13('0x28')][_0xca13('0x29')]};});_0xd8504f[_0xca13('0x2a')]=_[_0xca13('0x24')](_0x5baf84,_0xca13('0x22'));_0xd8504f[_0xca13('0x2b')]=_['keys'](_0x50183b[_0xca13('0x2b')]);_0xd8504f['filters']=_[_0xca13('0x2c')](_0xd8504f[_0xca13('0x2a')],_0xd8504f['query']);_0x1f3ef3[_0xca13('0x2d')]=_[_0xca13('0x2c')](_0xd8504f['model'],qs[_0xca13('0x2e')](_0x50183b[_0xca13('0x2b')]['fields']));_0x1f3ef3[_0xca13('0x2d')]=_0x1f3ef3[_0xca13('0x2d')][_0xca13('0x2f')]?_0x1f3ef3[_0xca13('0x2d')]:_0xd8504f[_0xca13('0x2a')];if(!_0x50183b[_0xca13('0x2b')]['hasOwnProperty'](_0xca13('0x30'))){_0x1f3ef3[_0xca13('0x18')]=qs[_0xca13('0x18')](_0x50183b[_0xca13('0x2b')]['limit']);_0x1f3ef3['offset']=qs[_0xca13('0x17')](_0x50183b[_0xca13('0x2b')][_0xca13('0x17')]);}_0x1f3ef3['order']=qs[_0xca13('0x31')](_0x50183b[_0xca13('0x2b')][_0xca13('0x31')]);_0x1f3ef3['where']=qs[_0xca13('0x32')](_[_0xca13('0x33')](_0x50183b['query'],_0xd8504f[_0xca13('0x32')]),_0x5baf84);if(_0x50183b['query'][_0xca13('0x34')]){_0x1f3ef3[_0xca13('0x35')]=_[_0xca13('0x36')](_0x1f3ef3[_0xca13('0x35')],{'$or':_[_0xca13('0x24')](_0x5baf84,function(_0x2770aa){if(_0x2770aa[_0xca13('0x28')]!=='VIRTUAL'){var _0x5dae10={};_0x5dae10[_0x2770aa['name']]={'$like':'%'+_0x50183b['query']['filter']+'%'};return _0x5dae10;}})});}_0x1f3ef3=_[_0xca13('0x36')]({},_0x1f3ef3,_0x50183b[_0xca13('0x37')]);var _0x4df5d2={'where':_0x1f3ef3['where']};return db[_0xca13('0x25')]['count'](_0x4df5d2)[_0xca13('0x38')](function(_0x37e94b){_0x3d46f1[_0xca13('0x19')]=_0x37e94b;if(_0x50183b['query'][_0xca13('0x39')]){_0x1f3ef3[_0xca13('0x3a')]=[{'all':!![]}];}return db[_0xca13('0x25')]['findAll'](_0x1f3ef3);})[_0xca13('0x38')](function(_0x495d42){_0x3d46f1['rows']=_0x495d42;return _0x3d46f1;})[_0xca13('0x38')](respondWithFilteredResult(_0x2b0d97,_0x1f3ef3))[_0xca13('0x3b')](handleError(_0x2b0d97,null));};exports['show']=function(_0x26067f,_0x44e1d7){var _0xfb6a21={'raw':!![],'where':{'id':_0x26067f[_0xca13('0x3c')]['id']}},_0x8fc8f={};_0x8fc8f[_0xca13('0x2a')]=_['keys'](db[_0xca13('0x25')]['rawAttributes']);_0x8fc8f['query']=_[_0xca13('0x3d')](_0x26067f['query']);_0x8fc8f[_0xca13('0x32')]=_[_0xca13('0x2c')](_0x8fc8f['model'],_0x8fc8f[_0xca13('0x2b')]);_0xfb6a21[_0xca13('0x2d')]=_[_0xca13('0x2c')](_0x8fc8f[_0xca13('0x2a')],qs[_0xca13('0x2e')](_0x26067f['query'][_0xca13('0x2e')]));_0xfb6a21[_0xca13('0x2d')]=_0xfb6a21[_0xca13('0x2d')][_0xca13('0x2f')]?_0xfb6a21[_0xca13('0x2d')]:_0x8fc8f[_0xca13('0x2a')];if(_0x26067f[_0xca13('0x2b')][_0xca13('0x39')]){_0xfb6a21['include']=[{'all':!![]}];}_0xfb6a21=_[_0xca13('0x36')]({},_0xfb6a21,_0x26067f[_0xca13('0x37')]);return db[_0xca13('0x25')][_0xca13('0x3e')](_0xfb6a21)['then'](handleEntityNotFound(_0x44e1d7,null))[_0xca13('0x38')](respondWithResult(_0x44e1d7,null))['catch'](handleError(_0x44e1d7,null));};exports['create']=function(_0x5ebf7e,_0x8c530){return db[_0xca13('0x25')][_0xca13('0x3f')](_0x5ebf7e[_0xca13('0x40')],{})[_0xca13('0x38')](respondWithResult(_0x8c530,0xc9))[_0xca13('0x3b')](handleError(_0x8c530,null));};exports[_0xca13('0x41')]=function(_0x14964b,_0x2eb739){if(_0x14964b[_0xca13('0x40')]['id']){delete _0x14964b[_0xca13('0x40')]['id'];}return db[_0xca13('0x25')]['find']({'where':{'id':_0x14964b['params']['id']}})[_0xca13('0x38')](handleEntityNotFound(_0x2eb739,null))[_0xca13('0x38')](saveUpdates(_0x14964b[_0xca13('0x40')],null))[_0xca13('0x38')](respondWithResult(_0x2eb739,null))[_0xca13('0x3b')](handleError(_0x2eb739,null));};exports[_0xca13('0x1d')]=function(_0x2e4506,_0x91dc0e){return db[_0xca13('0x25')][_0xca13('0x3e')]({'where':{'id':_0x2e4506[_0xca13('0x3c')]['id']}})[_0xca13('0x38')](handleEntityNotFound(_0x91dc0e,null))[_0xca13('0x38')](removeEntity(_0x91dc0e,null))['catch'](handleError(_0x91dc0e,null));};exports['describe']=function(_0x5b7dcd,_0x5ec9da){return db[_0xca13('0x25')][_0xca13('0x42')]()['then'](respondWithResult(_0x5ec9da,null))[_0xca13('0x3b')](handleError(_0x5ec9da,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x5385dd,_0x26cdb2){var _0x1830a0=function(_0x126135){while(--_0x126135){_0x5385dd['push'](_0x5385dd['shift']());}};_0x1830a0(++_0x26cdb2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x262ffb,_0x3bb545){var _0x59e2af=function(_0x54c7c3){while(--_0x54c7c3){_0x262ffb['push'](_0x262ffb['shift']());}};_0x59e2af(++_0x3bb545);}(_0x7a54,0x106));var _0x47a5=function(_0x29a5a6,_0x440b55){_0x29a5a6=_0x29a5a6-0x0;var _0x7d9296=_0x7a54[_0x29a5a6];return _0x7d9296;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x793b=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x793b,0x189));var _0xb793=function(_0x3adc1e,_0x3d0eb0){_0x3adc1e=_0x3adc1e-0x0;var _0x555c07=_0x793b[_0x3adc1e];return _0x555c07;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});}exports[_0xb793('0x16')]=function(_0x977026){var _0x2914a2=this;return new Promise(function(_0x2c9e87,_0x101162){return db[_0xb793('0x17')][_0xb793('0x18')](_0x977026[_0xb793('0x19')],{'raw':_0x977026[_0xb793('0x1a')]?_0x977026['options'][_0xb793('0x1b')]===undefined?!![]:![]:!![]})[_0xb793('0xc')](function(_0x54bfd4){logger[_0xb793('0xd')](_0xb793('0x16'),_0x977026);logger[_0xb793('0xf')](_0xb793('0x16'),_0x977026,JSON[_0xb793('0x1c')](_0x54bfd4));_0x2c9e87(_0x54bfd4);})['catch'](function(_0x5ecf9c){logger[_0xb793('0x11')](_0xb793('0x16'),_0x5ecf9c[_0xb793('0x12')],_0x977026);_0x101162(_0x2914a2[_0xb793('0x11')](0x1f4,_0x5ecf9c[_0xb793('0x12')]));});});};exports[_0xb793('0x1d')]=function(_0x4d4544){var _0x1e470c=this;return new Promise(function(_0x503d69,_0x10947e){return db[_0xb793('0x17')][_0xb793('0x1e')](_0x4d4544[_0xb793('0x19')],{'raw':_0x4d4544[_0xb793('0x1a')]?_0x4d4544[_0xb793('0x1a')][_0xb793('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d4544['options']?_0x4d4544[_0xb793('0x1a')][_0xb793('0x1f')]||null:null,'attributes':_0x4d4544[_0xb793('0x1a')]?_0x4d4544[_0xb793('0x1a')][_0xb793('0x20')]||null:null,'limit':_0x4d4544[_0xb793('0x1a')]?_0x4d4544['options'][_0xb793('0x21')]||null:null})[_0xb793('0xc')](function(_0x107d78){logger['info'](_0xb793('0x1d'),_0x4d4544);logger[_0xb793('0xf')](_0xb793('0x1d'),_0x4d4544,JSON[_0xb793('0x1c')](_0x107d78));_0x503d69(_0x107d78);})['catch'](function(_0x493a8c){logger[_0xb793('0x11')]('UpdateOpenchannelQueueReport',_0x493a8c['message'],_0x4d4544);_0x10947e(_0x1e470c[_0xb793('0x11')](0x1f4,_0x493a8c[_0xb793('0x12')]));});});};
\ No newline at end of file
+var _0xdac7=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','update','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47c80a,_0x5c780c){var _0x2184fe=function(_0x3058f9){while(--_0x3058f9){_0x47c80a['push'](_0x47c80a['shift']());}};_0x2184fe(++_0x5c780c);}(_0xdac7,0x180));var _0x7dac=function(_0x575627,_0x1259aa){_0x575627=_0x575627-0x0;var _0x4b2a72=_0xdac7[_0x575627];return _0x4b2a72;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});}exports[_0x7dac('0x14')]=function(_0x4c1f4f){var _0x352a77=this;return new Promise(function(_0x4639e2,_0x313615){return db[_0x7dac('0x15')][_0x7dac('0x16')](_0x4c1f4f[_0x7dac('0x17')],{'raw':_0x4c1f4f[_0x7dac('0x18')]?_0x4c1f4f[_0x7dac('0x18')][_0x7dac('0x19')]===undefined?!![]:![]:!![]})[_0x7dac('0x9')](function(_0x18f993){logger[_0x7dac('0xa')](_0x7dac('0x14'),_0x4c1f4f);logger[_0x7dac('0xd')]('CreateOpenchannelQueueReport',_0x4c1f4f,JSON['stringify'](_0x18f993));_0x4639e2(_0x18f993);})[_0x7dac('0x13')](function(_0x4c9fda){logger[_0x7dac('0x10')](_0x7dac('0x14'),_0x4c9fda['message'],_0x4c1f4f);_0x313615(_0x352a77[_0x7dac('0x10')](0x1f4,_0x4c9fda[_0x7dac('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0xbdabba){var _0x41b3cd=this;return new Promise(function(_0x341cc8,_0x179881){return db[_0x7dac('0x15')][_0x7dac('0x1a')](_0xbdabba[_0x7dac('0x17')],{'raw':_0xbdabba['options']?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbdabba[_0x7dac('0x18')]?_0xbdabba['options']['where']||null:null,'attributes':_0xbdabba[_0x7dac('0x18')]?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x1b')]||null:null,'limit':_0xbdabba[_0x7dac('0x18')]?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x1c')]||null:null})[_0x7dac('0x9')](function(_0x31bbf7){logger[_0x7dac('0xa')](_0x7dac('0x1d'),_0xbdabba);logger[_0x7dac('0xd')]('UpdateOpenchannelQueueReport',_0xbdabba,JSON['stringify'](_0x31bbf7));_0x341cc8(_0x31bbf7);})[_0x7dac('0x13')](function(_0xa92c4b){logger[_0x7dac('0x10')]('UpdateOpenchannelQueueReport',_0xa92c4b[_0x7dac('0x11')],_0xbdabba);_0x179881(_0x41b3cd[_0x7dac('0x10')](0x1f4,_0xa92c4b[_0x7dac('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8936=['/describe','describe','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated'];(function(_0x1b0307,_0x4336b1){var _0x5c8d34=function(_0x5b1b61){while(--_0x5b1b61){_0x1b0307['push'](_0x1b0307['shift']());}};_0x5c8d34(++_0x4336b1);}(_0x8936,0xcf));var _0x6893=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x8936[_0x218972];return _0x1bb1a8;};'use strict';var multer=require('multer');var util=require(_0x6893('0x0'));var path=require(_0x6893('0x1'));var timeout=require(_0x6893('0x2'));var express=require(_0x6893('0x3'));var router=express['Router']();var fs_extra=require(_0x6893('0x4'));var auth=require(_0x6893('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6893('0x6'));router[_0x6893('0x7')]('/',auth[_0x6893('0x8')](),controller['index']);router[_0x6893('0x7')](_0x6893('0x9'),auth[_0x6893('0x8')](),controller[_0x6893('0xa')]);router[_0x6893('0x7')](_0x6893('0xb'),auth[_0x6893('0x8')](),controller[_0x6893('0xc')]);router['post']('/',auth[_0x6893('0x8')](),controller[_0x6893('0xd')]);router[_0x6893('0xe')](_0x6893('0xb'),auth[_0x6893('0x8')](),controller[_0x6893('0xf')]);router[_0x6893('0x10')](_0x6893('0xb'),auth[_0x6893('0x8')](),controller['destroy']);module[_0x6893('0x11')]=router;
\ No newline at end of file
+var _0x3ca5=['index','/describe','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2da20f,_0x4273a3){var _0x595d87=function(_0x380110){while(--_0x380110){_0x2da20f['push'](_0x2da20f['shift']());}};_0x595d87(++_0x4273a3);}(_0x3ca5,0x1de));var _0x53ca=function(_0x3e78df,_0x2f0638){_0x3e78df=_0x3e78df-0x0;var _0x2f66ee=_0x3ca5[_0x3e78df];return _0x2f66ee;};'use strict';var multer=require(_0x53ca('0x0'));var util=require('util');var path=require(_0x53ca('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x53ca('0x2')]();var fs_extra=require(_0x53ca('0x3'));var auth=require(_0x53ca('0x4'));var interaction=require(_0x53ca('0x5'));var config=require(_0x53ca('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x53ca('0x7')]('/',auth['isAuthenticated'](),controller[_0x53ca('0x8')]);router['get'](_0x53ca('0x9'),auth[_0x53ca('0xa')](),controller['describe']);router[_0x53ca('0x7')](_0x53ca('0xb'),auth[_0x53ca('0xa')](),controller[_0x53ca('0xc')]);router[_0x53ca('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x53ca('0xe')](_0x53ca('0xb'),auth[_0x53ca('0xa')](),controller[_0x53ca('0xf')]);router[_0x53ca('0x10')](_0x53ca('0xb'),auth[_0x53ca('0xa')](),controller['destroy']);module[_0x53ca('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3238d2,_0x4b9691){var _0x500f04=function(_0x5aec38){while(--_0x5aec38){_0x3238d2['push'](_0x3238d2['shift']());}};_0x500f04(++_0x4b9691);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1832f6,_0x597799){_0x1832f6=_0x1832f6-0x0;var _0x3c4a88=_0xf4eb[_0x1832f6];return _0x3c4a88;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xe05ae6,_0x2b82a7){var _0x4f3030=function(_0x3275eb){while(--_0x3275eb){_0xe05ae6['push'](_0xe05ae6['shift']());}};_0x4f3030(++_0x2b82a7);}(_0x54ef,0x112));var _0xf54e=function(_0x2eff87,_0x5b5f36){_0x2eff87=_0x2eff87-0x0;var _0x3c0514=_0x54ef[_0x2eff87];return _0x3c0514;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee15=['where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0xee15,0x1c0));var _0x5ee1=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xee15[_0x4afac5];return _0x2404b3;};'use strict';var emlformat=require(_0x5ee1('0x0'));var rimraf=require(_0x5ee1('0x1'));var zipdir=require(_0x5ee1('0x2'));var jsonpatch=require(_0x5ee1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ee1('0x4'));var Mustache=require('mustache');var util=require(_0x5ee1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5ee1('0x6'));var ejs=require(_0x5ee1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ee1('0x8'));var squel=require(_0x5ee1('0x9'));var crypto=require(_0x5ee1('0xa'));var jsforce=require(_0x5ee1('0xb'));var deskjs=require(_0x5ee1('0xc'));var toCsv=require(_0x5ee1('0x6'));var querystring=require(_0x5ee1('0xd'));var Papa=require(_0x5ee1('0xe'));var Redis=require(_0x5ee1('0xf'));var authService=require(_0x5ee1('0x10'));var qs=require(_0x5ee1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ee1('0x12'));var logger=require(_0x5ee1('0x13'))(_0x5ee1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5ee1('0x15'))['db'];function respondWithStatusCode(_0x5a99cc,_0x37fc2e){_0x37fc2e=_0x37fc2e||0xcc;return function(_0xfb9d30){if(_0xfb9d30){return _0x5a99cc[_0x5ee1('0x16')](_0x37fc2e);}return _0x5a99cc[_0x5ee1('0x17')](_0x37fc2e)[_0x5ee1('0x18')]();};}function respondWithResult(_0x45c068,_0x5a0f6c){_0x5a0f6c=_0x5a0f6c||0xc8;return function(_0x33685d){if(_0x33685d){return _0x45c068[_0x5ee1('0x17')](_0x5a0f6c)[_0x5ee1('0x19')](_0x33685d);}};}function respondWithFilteredResult(_0x82cd8f,_0x1d32ae){return function(_0x5b629d){if(_0x5b629d){var _0x5be8bf=typeof _0x1d32ae[_0x5ee1('0x1a')]===_0x5ee1('0x1b')&&typeof _0x1d32ae['limit']===_0x5ee1('0x1b');var _0x2e9a1b=_0x5b629d[_0x5ee1('0x1c')];var _0x45e6af=_0x5be8bf?0x0:_0x1d32ae[_0x5ee1('0x1a')];var _0x34b9bf=_0x5be8bf?_0x5b629d['count']:_0x1d32ae['offset']+_0x1d32ae[_0x5ee1('0x1d')];var _0x4c4f14;if(_0x34b9bf>=_0x2e9a1b){_0x34b9bf=_0x2e9a1b;_0x4c4f14=0xc8;}else{_0x4c4f14=0xce;}_0x82cd8f[_0x5ee1('0x17')](_0x4c4f14);return _0x82cd8f[_0x5ee1('0x1e')]('Content-Range',_0x45e6af+'-'+_0x34b9bf+'/'+_0x2e9a1b)[_0x5ee1('0x19')](_0x5b629d);}return null;};}function patchUpdates(_0x15f83e){return function(_0xb2745f){try{jsonpatch[_0x5ee1('0x1f')](_0xb2745f,_0x15f83e,!![]);}catch(_0x1adb0f){return BPromise[_0x5ee1('0x20')](_0x1adb0f);}return _0xb2745f[_0x5ee1('0x21')]();};}function saveUpdates(_0x1ece6d,_0x1c9589){return function(_0x4e29e3){if(_0x4e29e3){return _0x4e29e3[_0x5ee1('0x22')](_0x1ece6d)[_0x5ee1('0x23')](function(_0x52e306){return _0x52e306;});}return null;};}function removeEntity(_0x4d7ee6,_0x73446f){return function(_0x2a7865){if(_0x2a7865){return _0x2a7865[_0x5ee1('0x24')]()[_0x5ee1('0x23')](function(){_0x4d7ee6['status'](0xcc)[_0x5ee1('0x18')]();});}};}function handleEntityNotFound(_0x15c7d4,_0x34d9c8){return function(_0x19a439){if(!_0x19a439){_0x15c7d4['sendStatus'](0x194);}return _0x19a439;};}function handleError(_0x34ebf4,_0x31f484){_0x31f484=_0x31f484||0x1f4;return function(_0x4ec6e9){logger[_0x5ee1('0x25')](_0x4ec6e9['stack']);if(_0x4ec6e9[_0x5ee1('0x26')]){delete _0x4ec6e9[_0x5ee1('0x26')];}_0x34ebf4[_0x5ee1('0x17')](_0x31f484)[_0x5ee1('0x27')](_0x4ec6e9);};}exports[_0x5ee1('0x28')]=function(_0x13b81b,_0x517e4c){var _0x567bed={},_0x55233d={},_0x30b780={'count':0x0,'rows':[]};var _0x4ccd6c=_[_0x5ee1('0x29')](db[_0x5ee1('0x2a')][_0x5ee1('0x2b')],function(_0x40c79b){return{'name':_0x40c79b[_0x5ee1('0x2c')],'type':_0x40c79b[_0x5ee1('0x2d')][_0x5ee1('0x2e')]};});_0x55233d[_0x5ee1('0x2f')]=_[_0x5ee1('0x29')](_0x4ccd6c,'name');_0x55233d[_0x5ee1('0x30')]=_[_0x5ee1('0x31')](_0x13b81b[_0x5ee1('0x30')]);_0x55233d[_0x5ee1('0x32')]=_[_0x5ee1('0x33')](_0x55233d[_0x5ee1('0x2f')],_0x55233d[_0x5ee1('0x30')]);_0x567bed[_0x5ee1('0x34')]=_[_0x5ee1('0x33')](_0x55233d[_0x5ee1('0x2f')],qs[_0x5ee1('0x35')](_0x13b81b[_0x5ee1('0x30')]['fields']));_0x567bed[_0x5ee1('0x34')]=_0x567bed[_0x5ee1('0x34')][_0x5ee1('0x36')]?_0x567bed[_0x5ee1('0x34')]:_0x55233d[_0x5ee1('0x2f')];if(!_0x13b81b[_0x5ee1('0x30')]['hasOwnProperty']('nolimit')){_0x567bed[_0x5ee1('0x1d')]=qs[_0x5ee1('0x1d')](_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x1d')]);_0x567bed['offset']=qs['offset'](_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x1a')]);}_0x567bed['order']=qs[_0x5ee1('0x37')](_0x13b81b['query'][_0x5ee1('0x37')]);_0x567bed[_0x5ee1('0x38')]=qs['filters'](_[_0x5ee1('0x39')](_0x13b81b[_0x5ee1('0x30')],_0x55233d[_0x5ee1('0x32')]),_0x4ccd6c);if(_0x13b81b['query'][_0x5ee1('0x3a')]){_0x567bed[_0x5ee1('0x38')]=_[_0x5ee1('0x3b')](_0x567bed[_0x5ee1('0x38')],{'$or':_[_0x5ee1('0x29')](_0x4ccd6c,function(_0x82813f){if(_0x82813f[_0x5ee1('0x2d')]!==_0x5ee1('0x3c')){var _0x537176={};_0x537176[_0x82813f[_0x5ee1('0x26')]]={'$like':'%'+_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x3a')]+'%'};return _0x537176;}})});}_0x567bed=_[_0x5ee1('0x3b')]({},_0x567bed,_0x13b81b[_0x5ee1('0x3d')]);var _0x92a542={'where':_0x567bed['where']};return db[_0x5ee1('0x2a')][_0x5ee1('0x1c')](_0x92a542)[_0x5ee1('0x23')](function(_0x2679a4){_0x30b780[_0x5ee1('0x1c')]=_0x2679a4;if(_0x13b81b[_0x5ee1('0x30')][_0x5ee1('0x3e')]){_0x567bed['include']=[{'all':!![]}];}return db[_0x5ee1('0x2a')][_0x5ee1('0x3f')](_0x567bed);})[_0x5ee1('0x23')](function(_0x2dd659){_0x30b780[_0x5ee1('0x40')]=_0x2dd659;return _0x30b780;})[_0x5ee1('0x23')](respondWithFilteredResult(_0x517e4c,_0x567bed))[_0x5ee1('0x41')](handleError(_0x517e4c,null));};exports[_0x5ee1('0x42')]=function(_0x4c66b7,_0x117829){var _0xf5d263={'raw':!![],'where':{'id':_0x4c66b7[_0x5ee1('0x43')]['id']}},_0x1080e7={};_0x1080e7[_0x5ee1('0x2f')]=_[_0x5ee1('0x31')](db['OpenchannelTransferReport'][_0x5ee1('0x2b')]);_0x1080e7[_0x5ee1('0x30')]=_[_0x5ee1('0x31')](_0x4c66b7[_0x5ee1('0x30')]);_0x1080e7[_0x5ee1('0x32')]=_[_0x5ee1('0x33')](_0x1080e7[_0x5ee1('0x2f')],_0x1080e7[_0x5ee1('0x30')]);_0xf5d263[_0x5ee1('0x34')]=_['intersection'](_0x1080e7['model'],qs[_0x5ee1('0x35')](_0x4c66b7['query'][_0x5ee1('0x35')]));_0xf5d263['attributes']=_0xf5d263['attributes'][_0x5ee1('0x36')]?_0xf5d263[_0x5ee1('0x34')]:_0x1080e7[_0x5ee1('0x2f')];if(_0x4c66b7[_0x5ee1('0x30')][_0x5ee1('0x3e')]){_0xf5d263['include']=[{'all':!![]}];}_0xf5d263=_[_0x5ee1('0x3b')]({},_0xf5d263,_0x4c66b7[_0x5ee1('0x3d')]);return db[_0x5ee1('0x2a')][_0x5ee1('0x44')](_0xf5d263)[_0x5ee1('0x23')](handleEntityNotFound(_0x117829,null))[_0x5ee1('0x23')](respondWithResult(_0x117829,null))[_0x5ee1('0x41')](handleError(_0x117829,null));};exports['create']=function(_0x136ba8,_0x58a6d4){return db['OpenchannelTransferReport'][_0x5ee1('0x45')](_0x136ba8[_0x5ee1('0x46')],{})['then'](respondWithResult(_0x58a6d4,0xc9))[_0x5ee1('0x41')](handleError(_0x58a6d4,null));};exports['update']=function(_0xda6972,_0x144d0a){if(_0xda6972['body']['id']){delete _0xda6972[_0x5ee1('0x46')]['id'];}return db['OpenchannelTransferReport'][_0x5ee1('0x44')]({'where':{'id':_0xda6972['params']['id']}})[_0x5ee1('0x23')](handleEntityNotFound(_0x144d0a,null))['then'](saveUpdates(_0xda6972[_0x5ee1('0x46')],null))[_0x5ee1('0x23')](respondWithResult(_0x144d0a,null))[_0x5ee1('0x41')](handleError(_0x144d0a,null));};exports[_0x5ee1('0x24')]=function(_0x18648b,_0x2e411b){return db[_0x5ee1('0x2a')]['find']({'where':{'id':_0x18648b[_0x5ee1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e411b,null))[_0x5ee1('0x23')](removeEntity(_0x2e411b,null))[_0x5ee1('0x41')](handleError(_0x2e411b,null));};exports[_0x5ee1('0x47')]=function(_0x31f2b0,_0x25a722){return db['OpenchannelTransferReport'][_0x5ee1('0x47')]()[_0x5ee1('0x23')](respondWithResult(_0x25a722,null))[_0x5ee1('0x41')](handleError(_0x25a722,null));};
\ No newline at end of file
+var _0x02ba=['rows','catch','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x153a8d,_0x5d4b25){var _0x30c3fb=function(_0x115936){while(--_0x115936){_0x153a8d['push'](_0x153a8d['shift']());}};_0x30c3fb(++_0x5d4b25);}(_0x02ba,0x9b));var _0xa02b=function(_0x4a4c91,_0xbb10fc){_0x4a4c91=_0x4a4c91-0x0;var _0xfe2034=_0x02ba[_0x4a4c91];return _0xfe2034;};'use strict';var emlformat=require(_0xa02b('0x0'));var rimraf=require(_0xa02b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa02b('0x2'));var moment=require(_0xa02b('0x3'));var BPromise=require(_0xa02b('0x4'));var Mustache=require(_0xa02b('0x5'));var util=require(_0xa02b('0x6'));var path=require(_0xa02b('0x7'));var sox=require('sox');var csv=require(_0xa02b('0x8'));var ejs=require(_0xa02b('0x9'));var fs=require('fs');var fs_extra=require(_0xa02b('0xa'));var _=require(_0xa02b('0xb'));var squel=require('squel');var crypto=require(_0xa02b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa02b('0x8'));var querystring=require(_0xa02b('0xd'));var Papa=require(_0xa02b('0xe'));var Redis=require(_0xa02b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa02b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa02b('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xa02b('0x12'));var config=require(_0xa02b('0x13'));var licenseUtil=require(_0xa02b('0x14'));var db=require(_0xa02b('0x15'))['db'];function respondWithStatusCode(_0x24ca69,_0x2c61df){_0x2c61df=_0x2c61df||0xcc;return function(_0x3d1693){if(_0x3d1693){return _0x24ca69['sendStatus'](_0x2c61df);}return _0x24ca69['status'](_0x2c61df)[_0xa02b('0x16')]();};}function respondWithResult(_0x5b17bd,_0x2ccb02){_0x2ccb02=_0x2ccb02||0xc8;return function(_0x4947ab){if(_0x4947ab){return _0x5b17bd[_0xa02b('0x17')](_0x2ccb02)['json'](_0x4947ab);}};}function respondWithFilteredResult(_0x56ce77,_0x1fdc65){return function(_0x11d03f){if(_0x11d03f){var _0x2a339e=typeof _0x1fdc65[_0xa02b('0x18')]==='undefined'&&typeof _0x1fdc65[_0xa02b('0x19')]==='undefined';var _0x21d3b6=_0x11d03f[_0xa02b('0x1a')];var _0x4135ab=_0x2a339e?0x0:_0x1fdc65[_0xa02b('0x18')];var _0x16fd4e=_0x2a339e?_0x11d03f[_0xa02b('0x1a')]:_0x1fdc65[_0xa02b('0x18')]+_0x1fdc65[_0xa02b('0x19')];var _0xb58f35;if(_0x16fd4e>=_0x21d3b6){_0x16fd4e=_0x21d3b6;_0xb58f35=0xc8;}else{_0xb58f35=0xce;}_0x56ce77[_0xa02b('0x17')](_0xb58f35);return _0x56ce77[_0xa02b('0x1b')](_0xa02b('0x1c'),_0x4135ab+'-'+_0x16fd4e+'/'+_0x21d3b6)[_0xa02b('0x1d')](_0x11d03f);}return null;};}function patchUpdates(_0x2e0f41){return function(_0x20b41a){try{jsonpatch[_0xa02b('0x1e')](_0x20b41a,_0x2e0f41,!![]);}catch(_0x34db33){return BPromise[_0xa02b('0x1f')](_0x34db33);}return _0x20b41a[_0xa02b('0x20')]();};}function saveUpdates(_0x31cae9,_0x53df95){return function(_0x456e2c){if(_0x456e2c){return _0x456e2c['update'](_0x31cae9)[_0xa02b('0x21')](function(_0x977010){return _0x977010;});}return null;};}function removeEntity(_0x260d16,_0x3761c7){return function(_0x361a4c){if(_0x361a4c){return _0x361a4c['destroy']()['then'](function(){_0x260d16['status'](0xcc)[_0xa02b('0x16')]();});}};}function handleEntityNotFound(_0x4f3a9c,_0x1948f3){return function(_0x42bed1){if(!_0x42bed1){_0x4f3a9c[_0xa02b('0x22')](0x194);}return _0x42bed1;};}function handleError(_0x1ce649,_0x53e5b4){_0x53e5b4=_0x53e5b4||0x1f4;return function(_0x15da21){logger[_0xa02b('0x23')](_0x15da21[_0xa02b('0x24')]);if(_0x15da21[_0xa02b('0x25')]){delete _0x15da21[_0xa02b('0x25')];}_0x1ce649[_0xa02b('0x17')](_0x53e5b4)[_0xa02b('0x26')](_0x15da21);};}exports[_0xa02b('0x27')]=function(_0x2c12e7,_0xe52a75){var _0x30f5bf={},_0x19774c={},_0x3495a2={'count':0x0,'rows':[]};var _0x222cca=_[_0xa02b('0x28')](db[_0xa02b('0x29')]['rawAttributes'],function(_0x4fab12){return{'name':_0x4fab12['fieldName'],'type':_0x4fab12[_0xa02b('0x2a')][_0xa02b('0x2b')]};});_0x19774c[_0xa02b('0x2c')]=_[_0xa02b('0x28')](_0x222cca,_0xa02b('0x25'));_0x19774c[_0xa02b('0x2d')]=_[_0xa02b('0x2e')](_0x2c12e7[_0xa02b('0x2d')]);_0x19774c[_0xa02b('0x2f')]=_['intersection'](_0x19774c[_0xa02b('0x2c')],_0x19774c[_0xa02b('0x2d')]);_0x30f5bf[_0xa02b('0x30')]=_[_0xa02b('0x31')](_0x19774c[_0xa02b('0x2c')],qs[_0xa02b('0x32')](_0x2c12e7[_0xa02b('0x2d')][_0xa02b('0x32')]));_0x30f5bf[_0xa02b('0x30')]=_0x30f5bf[_0xa02b('0x30')][_0xa02b('0x33')]?_0x30f5bf[_0xa02b('0x30')]:_0x19774c[_0xa02b('0x2c')];if(!_0x2c12e7[_0xa02b('0x2d')][_0xa02b('0x34')](_0xa02b('0x35'))){_0x30f5bf[_0xa02b('0x19')]=qs['limit'](_0x2c12e7[_0xa02b('0x2d')][_0xa02b('0x19')]);_0x30f5bf[_0xa02b('0x18')]=qs[_0xa02b('0x18')](_0x2c12e7[_0xa02b('0x2d')][_0xa02b('0x18')]);}_0x30f5bf[_0xa02b('0x36')]=qs[_0xa02b('0x37')](_0x2c12e7[_0xa02b('0x2d')][_0xa02b('0x37')]);_0x30f5bf['where']=qs[_0xa02b('0x2f')](_[_0xa02b('0x38')](_0x2c12e7['query'],_0x19774c['filters']),_0x222cca);if(_0x2c12e7['query'][_0xa02b('0x39')]){_0x30f5bf[_0xa02b('0x3a')]=_[_0xa02b('0x3b')](_0x30f5bf['where'],{'$or':_[_0xa02b('0x28')](_0x222cca,function(_0xa42437){if(_0xa42437[_0xa02b('0x2a')]!==_0xa02b('0x3c')){var _0xc92cb7={};_0xc92cb7[_0xa42437[_0xa02b('0x25')]]={'$like':'%'+_0x2c12e7[_0xa02b('0x2d')][_0xa02b('0x39')]+'%'};return _0xc92cb7;}})});}_0x30f5bf=_[_0xa02b('0x3b')]({},_0x30f5bf,_0x2c12e7['options']);var _0x343de2={'where':_0x30f5bf[_0xa02b('0x3a')]};return db[_0xa02b('0x29')]['count'](_0x343de2)['then'](function(_0x42c4a9){_0x3495a2['count']=_0x42c4a9;if(_0x2c12e7['query'][_0xa02b('0x3d')]){_0x30f5bf[_0xa02b('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa02b('0x3f')](_0x30f5bf);})[_0xa02b('0x21')](function(_0x4773bf){_0x3495a2[_0xa02b('0x40')]=_0x4773bf;return _0x3495a2;})['then'](respondWithFilteredResult(_0xe52a75,_0x30f5bf))[_0xa02b('0x41')](handleError(_0xe52a75,null));};exports['show']=function(_0x107475,_0x4ceff8){var _0x2feea1={'raw':!![],'where':{'id':_0x107475['params']['id']}},_0x20d314={};_0x20d314[_0xa02b('0x2c')]=_[_0xa02b('0x2e')](db['OpenchannelTransferReport'][_0xa02b('0x42')]);_0x20d314[_0xa02b('0x2d')]=_[_0xa02b('0x2e')](_0x107475[_0xa02b('0x2d')]);_0x20d314[_0xa02b('0x2f')]=_[_0xa02b('0x31')](_0x20d314['model'],_0x20d314['query']);_0x2feea1[_0xa02b('0x30')]=_['intersection'](_0x20d314[_0xa02b('0x2c')],qs[_0xa02b('0x32')](_0x107475['query'][_0xa02b('0x32')]));_0x2feea1[_0xa02b('0x30')]=_0x2feea1[_0xa02b('0x30')][_0xa02b('0x33')]?_0x2feea1['attributes']:_0x20d314[_0xa02b('0x2c')];if(_0x107475[_0xa02b('0x2d')][_0xa02b('0x3d')]){_0x2feea1[_0xa02b('0x3e')]=[{'all':!![]}];}_0x2feea1=_[_0xa02b('0x3b')]({},_0x2feea1,_0x107475['options']);return db[_0xa02b('0x29')][_0xa02b('0x43')](_0x2feea1)[_0xa02b('0x21')](handleEntityNotFound(_0x4ceff8,null))[_0xa02b('0x21')](respondWithResult(_0x4ceff8,null))['catch'](handleError(_0x4ceff8,null));};exports[_0xa02b('0x44')]=function(_0x24be3c,_0x3c2bde){return db[_0xa02b('0x29')][_0xa02b('0x44')](_0x24be3c[_0xa02b('0x45')],{})[_0xa02b('0x21')](respondWithResult(_0x3c2bde,0xc9))['catch'](handleError(_0x3c2bde,null));};exports['update']=function(_0x8443c3,_0x4582e6){if(_0x8443c3[_0xa02b('0x45')]['id']){delete _0x8443c3[_0xa02b('0x45')]['id'];}return db[_0xa02b('0x29')][_0xa02b('0x43')]({'where':{'id':_0x8443c3[_0xa02b('0x46')]['id']}})[_0xa02b('0x21')](handleEntityNotFound(_0x4582e6,null))[_0xa02b('0x21')](saveUpdates(_0x8443c3[_0xa02b('0x45')],null))[_0xa02b('0x21')](respondWithResult(_0x4582e6,null))['catch'](handleError(_0x4582e6,null));};exports[_0xa02b('0x47')]=function(_0x4b86d3,_0x1dfeca){return db[_0xa02b('0x29')][_0xa02b('0x43')]({'where':{'id':_0x4b86d3['params']['id']}})[_0xa02b('0x21')](handleEntityNotFound(_0x1dfeca,null))[_0xa02b('0x21')](removeEntity(_0x1dfeca,null))[_0xa02b('0x41')](handleError(_0x1dfeca,null));};exports['describe']=function(_0x1f4006,_0x1052f2){return db[_0xa02b('0x29')][_0xa02b('0x48')]()[_0xa02b('0x21')](respondWithResult(_0x1052f2,null))[_0xa02b('0x41')](handleError(_0x1052f2,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc67f=['exports','define','OpenchannelTransferReport','uniqueid','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc67f,0x158));var _0xfc67=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc67f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc67('0x0'));var util=require(_0xfc67('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfc67('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc67('0x3'));var rimraf=require(_0xfc67('0x4'));var config=require(_0xfc67('0x5'));var attributes=require('./openchannelTransferReport.attributes');module[_0xfc67('0x6')]=function(_0x5b7a4e,_0x1d7102){return _0x5b7a4e[_0xfc67('0x7')](_0xfc67('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xfc67('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x69be=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','uniqueid'];(function(_0xec9322,_0x2d5b87){var _0x39d576=function(_0x542056){while(--_0x542056){_0xec9322['push'](_0xec9322['shift']());}};_0x39d576(++_0x2d5b87);}(_0x69be,0xc3));var _0xe69b=function(_0x331a78,_0x4de812){_0x331a78=_0x331a78-0x0;var _0x1a6a01=_0x69be[_0x331a78];return _0x1a6a01;};'use strict';var _=require(_0xe69b('0x0'));var util=require(_0xe69b('0x1'));var logger=require(_0xe69b('0x2'))('api');var moment=require(_0xe69b('0x3'));var BPromise=require(_0xe69b('0x4'));var rp=require(_0xe69b('0x5'));var fs=require('fs');var path=require(_0xe69b('0x6'));var rimraf=require(_0xe69b('0x7'));var config=require(_0xe69b('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0xe69b('0x9')]=function(_0x3466e5,_0x113ffc){return _0x3466e5[_0xe69b('0xa')](_0xe69b('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe69b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x979e=['info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x979e,0x195));var _0xe979=function(_0x3efb3f,_0x11ccd4){_0x3efb3f=_0x3efb3f-0x0;var _0x3874f5=_0x979e[_0x3efb3f];return _0x3874f5;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var moment=require(_0xe979('0x2'));var BPromise=require(_0xe979('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe979('0x4'));var db=require(_0xe979('0x5'))['db'];var utils=require(_0xe979('0x6'));var logger=require(_0xe979('0x7'))(_0xe979('0x8'));var config=require('../../config/environment');var jayson=require(_0xe979('0x9'));var client=jayson['client'][_0xe979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a9ee,_0x441ffe,_0xc63524){return new BPromise(function(_0xc79c06,_0x3bbc32){return client[_0xe979('0xb')](_0x13a9ee,_0xc63524)[_0xe979('0xc')](function(_0x431a91){logger[_0xe979('0xd')](_0xe979('0xe'),_0x441ffe,'request\x20sent');logger[_0xe979('0xf')](_0xe979('0x10'),_0x441ffe,_0xe979('0x11'),JSON['stringify'](_0x431a91));if(_0x431a91[_0xe979('0x12')]){if(_0x431a91[_0xe979('0x12')][_0xe979('0x13')]===0x1f4){logger[_0xe979('0x12')](_0xe979('0xe'),_0x441ffe,_0x431a91[_0xe979('0x12')][_0xe979('0x14')]);return _0x3bbc32(_0x431a91[_0xe979('0x12')]['message']);}logger[_0xe979('0x12')](_0xe979('0xe'),_0x441ffe,_0x431a91[_0xe979('0x12')]['message']);return _0xc79c06(_0x431a91['error'][_0xe979('0x14')]);}else{logger[_0xe979('0xd')](_0xe979('0xe'),_0x441ffe,_0xe979('0x11'));_0xc79c06(_0x431a91['result'][_0xe979('0x14')]);}})[_0xe979('0x15')](function(_0xcb7fa1){logger[_0xe979('0x12')](_0xe979('0xe'),_0x441ffe,_0xcb7fa1);_0x3bbc32(_0xcb7fa1);});});}
\ No newline at end of file
+var _0x1561=['request\x20sent','debug','error','code','message','result','catch','OpenchannelTransferReport,\x20%s,\x20%s','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x313d57,_0x787e49){var _0x12d6ba=function(_0x3f9f66){while(--_0x3f9f66){_0x313d57['push'](_0x313d57['shift']());}};_0x12d6ba(++_0x787e49);}(_0x1561,0x1bd));var _0x1156=function(_0x5efc78,_0x454f1a){_0x5efc78=_0x5efc78-0x0;var _0x117292=_0x1561[_0x5efc78];return _0x117292;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1156('0x0'));var BPromise=require(_0x1156('0x1'));var rs=require(_0x1156('0x2'));var fs=require('fs');var Redis=require(_0x1156('0x3'));var db=require(_0x1156('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1156('0x5'))(_0x1156('0x6'));var config=require(_0x1156('0x7'));var jayson=require(_0x1156('0x8'));var client=jayson['client'][_0x1156('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7048,_0x372fe0,_0x6c3476){return new BPromise(function(_0x273b53,_0x2a7693){return client[_0x1156('0xa')](_0x4a7048,_0x6c3476)['then'](function(_0x2a5914){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x372fe0,_0x1156('0xb'));logger[_0x1156('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x372fe0,_0x1156('0xb'),JSON['stringify'](_0x2a5914));if(_0x2a5914[_0x1156('0xd')]){if(_0x2a5914['error'][_0x1156('0xe')]===0x1f4){logger[_0x1156('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x372fe0,_0x2a5914['error'][_0x1156('0xf')]);return _0x2a7693(_0x2a5914['error'][_0x1156('0xf')]);}logger[_0x1156('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x372fe0,_0x2a5914['error'][_0x1156('0xf')]);return _0x273b53(_0x2a5914[_0x1156('0xd')][_0x1156('0xf')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x372fe0,_0x1156('0xb'));_0x273b53(_0x2a5914[_0x1156('0x10')][_0x1156('0xf')]);}})[_0x1156('0x11')](function(_0x6889c9){logger[_0x1156('0xd')](_0x1156('0x12'),_0x372fe0,_0x6889c9);_0x2a7693(_0x6889c9);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47fd=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5c17d8,_0x51cc20){var _0x1841de=function(_0x128311){while(--_0x128311){_0x5c17d8['push'](_0x5c17d8['shift']());}};_0x1841de(++_0x51cc20);}(_0x47fd,0x13c));var _0xd47f=function(_0xdbd1cf,_0x8d319d){_0xdbd1cf=_0xdbd1cf-0x0;var _0x3668c4=_0x47fd[_0xdbd1cf];return _0x3668c4;};'use strict';var multer=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var path=require(_0xd47f('0x2'));var timeout=require(_0xd47f('0x3'));var express=require(_0xd47f('0x4'));var router=express[_0xd47f('0x5')]();var fs_extra=require(_0xd47f('0x6'));var auth=require(_0xd47f('0x7'));var interaction=require(_0xd47f('0x8'));var config=require(_0xd47f('0x9'));var controller=require('./pause.controller');router[_0xd47f('0xa')]('/',auth[_0xd47f('0xb')](),controller['index']);router[_0xd47f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd47f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd47f('0xd')]);router[_0xd47f('0xe')](_0xd47f('0xf'),auth[_0xd47f('0xb')](),controller[_0xd47f('0x10')]);router[_0xd47f('0x11')]('/:id',auth[_0xd47f('0xb')](),controller[_0xd47f('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9af9=['create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5418b4,_0x32c24e){var _0x6d93b4=function(_0x170f45){while(--_0x170f45){_0x5418b4['push'](_0x5418b4['shift']());}};_0x6d93b4(++_0x32c24e);}(_0x9af9,0x16c));var _0x99af=function(_0x162926,_0x4a89ce){_0x162926=_0x162926-0x0;var _0x7ed0b7=_0x9af9[_0x162926];return _0x7ed0b7;};'use strict';var multer=require(_0x99af('0x0'));var util=require(_0x99af('0x1'));var path=require(_0x99af('0x2'));var timeout=require(_0x99af('0x3'));var express=require(_0x99af('0x4'));var router=express[_0x99af('0x5')]();var fs_extra=require(_0x99af('0x6'));var auth=require(_0x99af('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x99af('0x8'));var controller=require(_0x99af('0x9'));router[_0x99af('0xa')]('/',auth[_0x99af('0xb')](),controller[_0x99af('0xc')]);router[_0x99af('0xa')](_0x99af('0xd'),auth[_0x99af('0xb')](),controller[_0x99af('0xe')]);router[_0x99af('0xf')]('/',auth[_0x99af('0xb')](),controller[_0x99af('0x10')]);router['put'](_0x99af('0xd'),auth[_0x99af('0xb')](),controller[_0x99af('0x11')]);router[_0x99af('0x12')](_0x99af('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x99af('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x031c=['name','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x031c,0x1e7));var _0xc031=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x031c[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xc031('0x0')]={'name':{'type':Sequelize[_0xc031('0x1')],'unique':_0xc031('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc031('0x1')]}};
\ No newline at end of file
+var _0xb4b2=['sequelize','exports','STRING'];(function(_0x5b5173,_0x26f4d2){var _0xba2593=function(_0x3363f8){while(--_0x3363f8){_0x5b5173['push'](_0x5b5173['shift']());}};_0xba2593(++_0x26f4d2);}(_0xb4b2,0x141));var _0x2b4b=function(_0x35029b,_0x4b57a9){_0x35029b=_0x35029b-0x0;var _0x4b3e0a=_0xb4b2[_0x35029b];return _0x4b3e0a;};'use strict';var Sequelize=require(_0x2b4b('0x0'));module[_0x2b4b('0x1')]={'name':{'type':Sequelize[_0x2b4b('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f5f=['util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Pause','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x466e43,_0x3c9412){var _0x2e8152=function(_0x2a0815){while(--_0x2a0815){_0x466e43['push'](_0x466e43['shift']());}};_0x2e8152(++_0x3c9412);}(_0x6f5f,0x146));var _0xf6f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f5f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf6f5('0x0'));var jsonpatch=require(_0xf6f5('0x1'));var rp=require(_0xf6f5('0x2'));var moment=require(_0xf6f5('0x3'));var BPromise=require(_0xf6f5('0x4'));var Mustache=require(_0xf6f5('0x5'));var util=require(_0xf6f5('0x6'));var path=require(_0xf6f5('0x7'));var sox=require(_0xf6f5('0x8'));var csv=require(_0xf6f5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f5('0xa'));var _=require(_0xf6f5('0xb'));var squel=require('squel');var crypto=require(_0xf6f5('0xc'));var jsforce=require(_0xf6f5('0xd'));var deskjs=require(_0xf6f5('0xe'));var toCsv=require(_0xf6f5('0x9'));var querystring=require('querystring');var Papa=require(_0xf6f5('0xf'));var Redis=require(_0xf6f5('0x10'));var authService=require(_0xf6f5('0x11'));var qs=require(_0xf6f5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6f5('0x13'))(_0xf6f5('0x14'));var utils=require(_0xf6f5('0x15'));var config=require(_0xf6f5('0x16'));var licenseUtil=require(_0xf6f5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e060,_0x19080d){_0x19080d=_0x19080d||0xcc;return function(_0x1cd711){if(_0x1cd711){return _0x54e060['sendStatus'](_0x19080d);}return _0x54e060[_0xf6f5('0x18')](_0x19080d)[_0xf6f5('0x19')]();};}function respondWithResult(_0x31a6a5,_0x570e20){_0x570e20=_0x570e20||0xc8;return function(_0x3e30e9){if(_0x3e30e9){return _0x31a6a5['status'](_0x570e20)[_0xf6f5('0x1a')](_0x3e30e9);}};}function respondWithFilteredResult(_0x5ac901,_0x43f160){return function(_0x544580){if(_0x544580){var _0x21c5bc=typeof _0x43f160['offset']===_0xf6f5('0x1b')&&typeof _0x43f160[_0xf6f5('0x1c')]===_0xf6f5('0x1b');var _0x43fd75=_0x544580[_0xf6f5('0x1d')];var _0x404e59=_0x21c5bc?0x0:_0x43f160[_0xf6f5('0x1e')];var _0x1712e5=_0x21c5bc?_0x544580[_0xf6f5('0x1d')]:_0x43f160[_0xf6f5('0x1e')]+_0x43f160[_0xf6f5('0x1c')];var _0x3dd2ab;if(_0x1712e5>=_0x43fd75){_0x1712e5=_0x43fd75;_0x3dd2ab=0xc8;}else{_0x3dd2ab=0xce;}_0x5ac901['status'](_0x3dd2ab);return _0x5ac901['set']('Content-Range',_0x404e59+'-'+_0x1712e5+'/'+_0x43fd75)[_0xf6f5('0x1a')](_0x544580);}return null;};}function patchUpdates(_0x3013c1){return function(_0x2b2dee){try{jsonpatch[_0xf6f5('0x1f')](_0x2b2dee,_0x3013c1,!![]);}catch(_0xacac33){return BPromise[_0xf6f5('0x20')](_0xacac33);}return _0x2b2dee[_0xf6f5('0x21')]();};}function saveUpdates(_0x417b3b,_0xf47db0){return function(_0x1b7146){if(_0x1b7146){return _0x1b7146['update'](_0x417b3b)[_0xf6f5('0x22')](function(_0x1beaaa){return _0x1beaaa;});}return null;};}function removeEntity(_0xc724b,_0x1419fa){return function(_0x4f1038){if(_0x4f1038){return _0x4f1038['destroy']()['then'](function(){var _0x483772=_0x4f1038[_0xf6f5('0x23')]({'plain':!![]});var _0x3b6963=_0xf6f5('0x24');return db[_0xf6f5('0x25')][_0xf6f5('0x26')]({'where':{'type':_0x3b6963,'resourceId':_0x483772['id']}})['then'](function(){return _0x4f1038;});})[_0xf6f5('0x22')](function(){_0xc724b[_0xf6f5('0x18')](0xcc)[_0xf6f5('0x19')]();});}};}function handleEntityNotFound(_0x551a9d,_0x4653c5){return function(_0xe52cfe){if(!_0xe52cfe){_0x551a9d[_0xf6f5('0x27')](0x194);}return _0xe52cfe;};}function handleError(_0x4ca68f,_0x45a962){_0x45a962=_0x45a962||0x1f4;return function(_0x3e2c9e){logger[_0xf6f5('0x28')](_0x3e2c9e[_0xf6f5('0x29')]);if(_0x3e2c9e[_0xf6f5('0x2a')]){delete _0x3e2c9e[_0xf6f5('0x2a')];}_0x4ca68f[_0xf6f5('0x18')](_0x45a962)[_0xf6f5('0x2b')](_0x3e2c9e);};}exports[_0xf6f5('0x2c')]=function(_0x390fc5,_0x36ecf1){var _0x395168={},_0x406ac={},_0x5cce7b={'count':0x0,'rows':[]};var _0x417790=_[_0xf6f5('0x2d')](db['Pause']['rawAttributes'],function(_0x219214){return{'name':_0x219214[_0xf6f5('0x2e')],'type':_0x219214[_0xf6f5('0x2f')]['key']};});_0x406ac[_0xf6f5('0x30')]=_[_0xf6f5('0x2d')](_0x417790,_0xf6f5('0x2a'));_0x406ac[_0xf6f5('0x31')]=_[_0xf6f5('0x32')](_0x390fc5[_0xf6f5('0x31')]);_0x406ac[_0xf6f5('0x33')]=_[_0xf6f5('0x34')](_0x406ac[_0xf6f5('0x30')],_0x406ac[_0xf6f5('0x31')]);_0x395168[_0xf6f5('0x35')]=_[_0xf6f5('0x34')](_0x406ac[_0xf6f5('0x30')],qs[_0xf6f5('0x36')](_0x390fc5[_0xf6f5('0x31')]['fields']));_0x395168['attributes']=_0x395168['attributes'][_0xf6f5('0x37')]?_0x395168[_0xf6f5('0x35')]:_0x406ac[_0xf6f5('0x30')];if(!_0x390fc5['query'][_0xf6f5('0x38')](_0xf6f5('0x39'))){_0x395168['limit']=qs['limit'](_0x390fc5[_0xf6f5('0x31')]['limit']);_0x395168[_0xf6f5('0x1e')]=qs['offset'](_0x390fc5['query'][_0xf6f5('0x1e')]);}_0x395168[_0xf6f5('0x3a')]=qs[_0xf6f5('0x3b')](_0x390fc5['query']['sort']);_0x395168[_0xf6f5('0x3c')]=qs[_0xf6f5('0x33')](_[_0xf6f5('0x3d')](_0x390fc5[_0xf6f5('0x31')],_0x406ac[_0xf6f5('0x33')]),_0x417790);if(_0x390fc5['query']['filter']){_0x395168[_0xf6f5('0x3c')]=_[_0xf6f5('0x3e')](_0x395168[_0xf6f5('0x3c')],{'$or':_[_0xf6f5('0x2d')](_0x417790,function(_0x5ebe76){if(_0x5ebe76[_0xf6f5('0x2f')]!==_0xf6f5('0x3f')){var _0x211647={};_0x211647[_0x5ebe76[_0xf6f5('0x2a')]]={'$like':'%'+_0x390fc5[_0xf6f5('0x31')][_0xf6f5('0x40')]+'%'};return _0x211647;}})});}_0x395168=_[_0xf6f5('0x3e')]({},_0x395168,_0x390fc5[_0xf6f5('0x41')]);var _0x18e793={'where':_0x395168[_0xf6f5('0x3c')]};return db['Pause'][_0xf6f5('0x1d')](_0x18e793)[_0xf6f5('0x22')](function(_0x4a6a08){_0x5cce7b['count']=_0x4a6a08;if(_0x390fc5[_0xf6f5('0x31')][_0xf6f5('0x42')]){_0x395168[_0xf6f5('0x43')]=[{'all':!![]}];}return db[_0xf6f5('0x44')]['findAll'](_0x395168);})[_0xf6f5('0x22')](function(_0x11d87f){_0x5cce7b[_0xf6f5('0x45')]=_0x11d87f;return _0x5cce7b;})[_0xf6f5('0x22')](respondWithFilteredResult(_0x36ecf1,_0x395168))[_0xf6f5('0x46')](handleError(_0x36ecf1,null));};exports[_0xf6f5('0x47')]=function(_0x282fe2,_0x587b5b){var _0x189e8f={'raw':!![],'where':{'id':_0x282fe2[_0xf6f5('0x48')]['id']}},_0x55522c={};_0x55522c['model']=_[_0xf6f5('0x32')](db[_0xf6f5('0x44')][_0xf6f5('0x49')]);_0x55522c[_0xf6f5('0x31')]=_['keys'](_0x282fe2[_0xf6f5('0x31')]);_0x55522c['filters']=_[_0xf6f5('0x34')](_0x55522c[_0xf6f5('0x30')],_0x55522c[_0xf6f5('0x31')]);_0x189e8f[_0xf6f5('0x35')]=_[_0xf6f5('0x34')](_0x55522c[_0xf6f5('0x30')],qs['fields'](_0x282fe2[_0xf6f5('0x31')][_0xf6f5('0x36')]));_0x189e8f[_0xf6f5('0x35')]=_0x189e8f[_0xf6f5('0x35')][_0xf6f5('0x37')]?_0x189e8f[_0xf6f5('0x35')]:_0x55522c[_0xf6f5('0x30')];if(_0x282fe2[_0xf6f5('0x31')][_0xf6f5('0x42')]){_0x189e8f[_0xf6f5('0x43')]=[{'all':!![]}];}_0x189e8f=_[_0xf6f5('0x3e')]({},_0x189e8f,_0x282fe2[_0xf6f5('0x41')]);return db[_0xf6f5('0x44')][_0xf6f5('0x4a')](_0x189e8f)[_0xf6f5('0x22')](handleEntityNotFound(_0x587b5b,null))[_0xf6f5('0x22')](respondWithResult(_0x587b5b,null))[_0xf6f5('0x46')](handleError(_0x587b5b,null));};exports[_0xf6f5('0x4b')]=function(_0x2b0e30,_0x341a68){return db[_0xf6f5('0x44')][_0xf6f5('0x4b')](_0x2b0e30[_0xf6f5('0x4c')],{})[_0xf6f5('0x22')](function(_0x24cb6f){var _0x62ac17=_0x2b0e30[_0xf6f5('0x4d')][_0xf6f5('0x23')]({'plain':!![]});if(!_0x62ac17)throw new Error(_0xf6f5('0x4e'));if(_0x62ac17[_0xf6f5('0x4f')]===_0xf6f5('0x4d')){var _0x1c895a=_0x24cb6f[_0xf6f5('0x23')]({'plain':!![]});var _0x117116=_0xf6f5('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x117116,'userProfileId':_0x62ac17[_0xf6f5('0x50')]},'raw':!![]})['then'](function(_0x39b7fb){if(_0x39b7fb&&_0x39b7fb[_0xf6f5('0x51')]===0x0){return db[_0xf6f5('0x25')][_0xf6f5('0x4b')]({'name':_0x1c895a[_0xf6f5('0x2a')],'resourceId':_0x1c895a['id'],'type':_0x39b7fb[_0xf6f5('0x2a')],'sectionId':_0x39b7fb['id']},{})[_0xf6f5('0x22')](function(){return _0x24cb6f;});}else{return _0x24cb6f;}})[_0xf6f5('0x46')](function(_0x4c4841){logger[_0xf6f5('0x28')](_0xf6f5('0x52'),_0x4c4841);throw _0x4c4841;});}return _0x24cb6f;})[_0xf6f5('0x22')](respondWithResult(_0x341a68,0xc9))['catch'](handleError(_0x341a68,null));};exports['update']=function(_0x634503,_0x4fe32b){if(_0x634503['body']['id']){delete _0x634503['body']['id'];}return db[_0xf6f5('0x44')][_0xf6f5('0x4a')]({'where':{'id':_0x634503[_0xf6f5('0x48')]['id']}})[_0xf6f5('0x22')](handleEntityNotFound(_0x4fe32b,null))[_0xf6f5('0x22')](saveUpdates(_0x634503[_0xf6f5('0x4c')],null))[_0xf6f5('0x22')](respondWithResult(_0x4fe32b,null))[_0xf6f5('0x46')](handleError(_0x4fe32b,null));};exports['destroy']=function(_0x3c023d,_0x4b5096){return db[_0xf6f5('0x44')]['find']({'where':{'id':_0x3c023d[_0xf6f5('0x48')]['id']}})[_0xf6f5('0x22')](handleEntityNotFound(_0x4b5096,null))[_0xf6f5('0x22')](removeEntity(_0x4b5096,null))['catch'](handleError(_0x4b5096,null));};
\ No newline at end of file
+var _0xa679=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','Pause','include','findAll','catch','show','params','includeAll','find','create','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','get','UserProfileResource','destroy','error','stack','name','send','map','key','model','keys','query','filters'];(function(_0x142db6,_0x5a1395){var _0x256363=function(_0x530ac4){while(--_0x530ac4){_0x142db6['push'](_0x142db6['shift']());}};_0x256363(++_0x5a1395);}(_0xa679,0xb5));var _0x9a67=function(_0x5e96f8,_0x359ea4){_0x5e96f8=_0x5e96f8-0x0;var _0x501eaf=_0xa679[_0x5e96f8];return _0x501eaf;};'use strict';var emlformat=require(_0x9a67('0x0'));var rimraf=require(_0x9a67('0x1'));var zipdir=require(_0x9a67('0x2'));var jsonpatch=require(_0x9a67('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a67('0x4'));var Mustache=require(_0x9a67('0x5'));var util=require(_0x9a67('0x6'));var path=require(_0x9a67('0x7'));var sox=require(_0x9a67('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a67('0x9'));var _=require(_0x9a67('0xa'));var squel=require('squel');var crypto=require(_0x9a67('0xb'));var jsforce=require(_0x9a67('0xc'));var deskjs=require(_0x9a67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9a67('0xe'));var Papa=require(_0x9a67('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a67('0x10'));var hardwareService=require(_0x9a67('0x11'));var logger=require(_0x9a67('0x12'))('api');var utils=require(_0x9a67('0x13'));var config=require(_0x9a67('0x14'));var licenseUtil=require(_0x9a67('0x15'));var db=require(_0x9a67('0x16'))['db'];function respondWithStatusCode(_0x1dddd7,_0x29badf){_0x29badf=_0x29badf||0xcc;return function(_0x11592f){if(_0x11592f){return _0x1dddd7[_0x9a67('0x17')](_0x29badf);}return _0x1dddd7[_0x9a67('0x18')](_0x29badf)[_0x9a67('0x19')]();};}function respondWithResult(_0x22e956,_0xb85ba1){_0xb85ba1=_0xb85ba1||0xc8;return function(_0x1a3166){if(_0x1a3166){return _0x22e956[_0x9a67('0x18')](_0xb85ba1)[_0x9a67('0x1a')](_0x1a3166);}};}function respondWithFilteredResult(_0xb0126c,_0x5df313){return function(_0x7d4395){if(_0x7d4395){var _0x209ef1=typeof _0x5df313['offset']===_0x9a67('0x1b')&&typeof _0x5df313[_0x9a67('0x1c')]===_0x9a67('0x1b');var _0x1d3215=_0x7d4395['count'];var _0x13a7b5=_0x209ef1?0x0:_0x5df313['offset'];var _0x1d5e4f=_0x209ef1?_0x7d4395[_0x9a67('0x1d')]:_0x5df313[_0x9a67('0x1e')]+_0x5df313[_0x9a67('0x1c')];var _0xe4e27d;if(_0x1d5e4f>=_0x1d3215){_0x1d5e4f=_0x1d3215;_0xe4e27d=0xc8;}else{_0xe4e27d=0xce;}_0xb0126c[_0x9a67('0x18')](_0xe4e27d);return _0xb0126c[_0x9a67('0x1f')](_0x9a67('0x20'),_0x13a7b5+'-'+_0x1d5e4f+'/'+_0x1d3215)[_0x9a67('0x1a')](_0x7d4395);}return null;};}function patchUpdates(_0x58367f){return function(_0x303520){try{jsonpatch['apply'](_0x303520,_0x58367f,!![]);}catch(_0x2583c1){return BPromise['reject'](_0x2583c1);}return _0x303520['save']();};}function saveUpdates(_0x2c36b1,_0x1bbb95){return function(_0x5d9c56){if(_0x5d9c56){return _0x5d9c56['update'](_0x2c36b1)['then'](function(_0x35098e){return _0x35098e;});}return null;};}function removeEntity(_0x32b490,_0x180f81){return function(_0x20fc42){if(_0x20fc42){return _0x20fc42['destroy']()[_0x9a67('0x21')](function(){var _0x3b6328=_0x20fc42[_0x9a67('0x22')]({'plain':!![]});var _0x18ee26='Pauses';return db[_0x9a67('0x23')][_0x9a67('0x24')]({'where':{'type':_0x18ee26,'resourceId':_0x3b6328['id']}})[_0x9a67('0x21')](function(){return _0x20fc42;});})[_0x9a67('0x21')](function(){_0x32b490['status'](0xcc)[_0x9a67('0x19')]();});}};}function handleEntityNotFound(_0x3c86d6,_0x2e0ce7){return function(_0x27898c){if(!_0x27898c){_0x3c86d6[_0x9a67('0x17')](0x194);}return _0x27898c;};}function handleError(_0x11cd29,_0x30e099){_0x30e099=_0x30e099||0x1f4;return function(_0x402a26){logger[_0x9a67('0x25')](_0x402a26[_0x9a67('0x26')]);if(_0x402a26[_0x9a67('0x27')]){delete _0x402a26['name'];}_0x11cd29[_0x9a67('0x18')](_0x30e099)[_0x9a67('0x28')](_0x402a26);};}exports['index']=function(_0x4a865c,_0x53da03){var _0x21464e={},_0x2cecbd={},_0x466594={'count':0x0,'rows':[]};var _0x4e0a82=_[_0x9a67('0x29')](db['Pause']['rawAttributes'],function(_0x1e9421){return{'name':_0x1e9421['fieldName'],'type':_0x1e9421['type'][_0x9a67('0x2a')]};});_0x2cecbd[_0x9a67('0x2b')]=_['map'](_0x4e0a82,_0x9a67('0x27'));_0x2cecbd['query']=_[_0x9a67('0x2c')](_0x4a865c[_0x9a67('0x2d')]);_0x2cecbd[_0x9a67('0x2e')]=_['intersection'](_0x2cecbd[_0x9a67('0x2b')],_0x2cecbd['query']);_0x21464e[_0x9a67('0x2f')]=_[_0x9a67('0x30')](_0x2cecbd[_0x9a67('0x2b')],qs[_0x9a67('0x31')](_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x31')]));_0x21464e[_0x9a67('0x2f')]=_0x21464e[_0x9a67('0x2f')][_0x9a67('0x32')]?_0x21464e['attributes']:_0x2cecbd[_0x9a67('0x2b')];if(!_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x33')](_0x9a67('0x34'))){_0x21464e['limit']=qs[_0x9a67('0x1c')](_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x1c')]);_0x21464e['offset']=qs[_0x9a67('0x1e')](_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x1e')]);}_0x21464e['order']=qs[_0x9a67('0x35')](_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x35')]);_0x21464e[_0x9a67('0x36')]=qs[_0x9a67('0x2e')](_[_0x9a67('0x37')](_0x4a865c[_0x9a67('0x2d')],_0x2cecbd['filters']),_0x4e0a82);if(_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x38')]){_0x21464e['where']=_['merge'](_0x21464e[_0x9a67('0x36')],{'$or':_[_0x9a67('0x29')](_0x4e0a82,function(_0x40db76){if(_0x40db76['type']!=='VIRTUAL'){var _0x28a1d5={};_0x28a1d5[_0x40db76['name']]={'$like':'%'+_0x4a865c[_0x9a67('0x2d')][_0x9a67('0x38')]+'%'};return _0x28a1d5;}})});}_0x21464e=_[_0x9a67('0x39')]({},_0x21464e,_0x4a865c[_0x9a67('0x3a')]);var _0x3b3ef4={'where':_0x21464e[_0x9a67('0x36')]};return db[_0x9a67('0x3b')][_0x9a67('0x1d')](_0x3b3ef4)['then'](function(_0x4fcf54){_0x466594[_0x9a67('0x1d')]=_0x4fcf54;if(_0x4a865c[_0x9a67('0x2d')]['includeAll']){_0x21464e[_0x9a67('0x3c')]=[{'all':!![]}];}return db[_0x9a67('0x3b')][_0x9a67('0x3d')](_0x21464e);})[_0x9a67('0x21')](function(_0x3dc4b7){_0x466594['rows']=_0x3dc4b7;return _0x466594;})[_0x9a67('0x21')](respondWithFilteredResult(_0x53da03,_0x21464e))[_0x9a67('0x3e')](handleError(_0x53da03,null));};exports[_0x9a67('0x3f')]=function(_0xf2ff60,_0x40baab){var _0x2a3033={'raw':!![],'where':{'id':_0xf2ff60[_0x9a67('0x40')]['id']}},_0x11be7f={};_0x11be7f[_0x9a67('0x2b')]=_[_0x9a67('0x2c')](db[_0x9a67('0x3b')]['rawAttributes']);_0x11be7f[_0x9a67('0x2d')]=_[_0x9a67('0x2c')](_0xf2ff60['query']);_0x11be7f['filters']=_['intersection'](_0x11be7f['model'],_0x11be7f[_0x9a67('0x2d')]);_0x2a3033[_0x9a67('0x2f')]=_[_0x9a67('0x30')](_0x11be7f[_0x9a67('0x2b')],qs[_0x9a67('0x31')](_0xf2ff60[_0x9a67('0x2d')][_0x9a67('0x31')]));_0x2a3033['attributes']=_0x2a3033[_0x9a67('0x2f')]['length']?_0x2a3033[_0x9a67('0x2f')]:_0x11be7f[_0x9a67('0x2b')];if(_0xf2ff60['query'][_0x9a67('0x41')]){_0x2a3033[_0x9a67('0x3c')]=[{'all':!![]}];}_0x2a3033=_['merge']({},_0x2a3033,_0xf2ff60['options']);return db[_0x9a67('0x3b')][_0x9a67('0x42')](_0x2a3033)[_0x9a67('0x21')](handleEntityNotFound(_0x40baab,null))['then'](respondWithResult(_0x40baab,null))[_0x9a67('0x3e')](handleError(_0x40baab,null));};exports['create']=function(_0x25d3d0,_0x461ada){return db[_0x9a67('0x3b')][_0x9a67('0x43')](_0x25d3d0['body'],{})['then'](function(_0x5863d1){var _0x180d51=_0x25d3d0['user']['get']({'plain':!![]});if(!_0x180d51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x180d51[_0x9a67('0x44')]==='user'){var _0x283bfe=_0x5863d1['get']({'plain':!![]});var _0x3e95eb=_0x9a67('0x45');return db[_0x9a67('0x46')][_0x9a67('0x42')]({'where':{'name':_0x3e95eb,'userProfileId':_0x180d51[_0x9a67('0x47')]},'raw':!![]})[_0x9a67('0x21')](function(_0x2e0814){if(_0x2e0814&&_0x2e0814[_0x9a67('0x48')]===0x0){return db[_0x9a67('0x23')]['create']({'name':_0x283bfe[_0x9a67('0x27')],'resourceId':_0x283bfe['id'],'type':_0x2e0814[_0x9a67('0x27')],'sectionId':_0x2e0814['id']},{})['then'](function(){return _0x5863d1;});}else{return _0x5863d1;}})['catch'](function(_0x2b48fb){logger[_0x9a67('0x25')](_0x9a67('0x49'),_0x2b48fb);throw _0x2b48fb;});}return _0x5863d1;})[_0x9a67('0x21')](respondWithResult(_0x461ada,0xc9))[_0x9a67('0x3e')](handleError(_0x461ada,null));};exports[_0x9a67('0x4a')]=function(_0x24edae,_0x14db9f){if(_0x24edae[_0x9a67('0x4b')]['id']){delete _0x24edae['body']['id'];}return db[_0x9a67('0x3b')][_0x9a67('0x42')]({'where':{'id':_0x24edae[_0x9a67('0x40')]['id']}})[_0x9a67('0x21')](handleEntityNotFound(_0x14db9f,null))['then'](saveUpdates(_0x24edae[_0x9a67('0x4b')],null))[_0x9a67('0x21')](respondWithResult(_0x14db9f,null))[_0x9a67('0x3e')](handleError(_0x14db9f,null));};exports['destroy']=function(_0x53dee4,_0x16f00a){return db[_0x9a67('0x3b')][_0x9a67('0x42')]({'where':{'id':_0x53dee4['params']['id']}})['then'](handleEntityNotFound(_0x16f00a,null))[_0x9a67('0x21')](removeEntity(_0x16f00a,null))[_0x9a67('0x3e')](handleError(_0x16f00a,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x2be5ed,_0x2875f0){var _0x3bb8b9=function(_0xb8d6ba){while(--_0xb8d6ba){_0x2be5ed['push'](_0x2be5ed['shift']());}};_0x3bb8b9(++_0x2875f0);}(_0xe14b,0x93));var _0xbe14=function(_0x3ffb4f,_0x32ca5a){_0x3ffb4f=_0x3ffb4f-0x0;var _0x5674f2=_0xe14b[_0x3ffb4f];return _0x5674f2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3ed680,_0x27adaf){var _0x4c23c2=function(_0x3c2bf0){while(--_0x3c2bf0){_0x3ed680['push'](_0x3ed680['shift']());}};_0x4c23c2(++_0x27adaf);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21f334,_0x79b827){_0x21f334=_0x21f334-0x0;var _0x1dc54e=_0x1cb9[_0x21f334];return _0x1dc54e;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2d7e63,_0x1a4782){var _0x493944=function(_0x722446){while(--_0x722446){_0x2d7e63['push'](_0x2d7e63['shift']());}};_0x493944(++_0x1a4782);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9136,_0x37d814){_0x1f9136=_0x1f9136-0x0;var _0x811203=_0x7a54[_0x1f9136];return _0x811203;};'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')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xa89ea1,_0x2a9346){var _0x5d44e3=function(_0x2648ca){while(--_0x2648ca){_0xa89ea1['push'](_0xa89ea1['shift']());}};_0x5d44e3(++_0x2a9346);}(_0xb10b,0x12a));var _0xbb10=function(_0x389cda,_0x31155c){_0x389cda=_0x389cda-0x0;var _0x5889bc=_0xb10b[_0x389cda];return _0x5889bc;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa37e=['../../config/environment','./plugin.controller','get','/:id','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','format','basename','extname','now','post','upload','/webhook','webhookPost','delete','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x831e78,_0x1afec6){var _0x3e7ca0=function(_0x2c59fe){while(--_0x2c59fe){_0x831e78['push'](_0x831e78['shift']());}};_0x3e7ca0(++_0x1afec6);}(_0xa37e,0x97));var _0xea37=function(_0x42010c,_0x487184){_0x42010c=_0x42010c-0x0;var _0x5f3afd=_0xa37e[_0x42010c];return _0x5f3afd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea37('0x5'));var controller=require(_0xea37('0x6'));router[_0xea37('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xea37('0x7')]('/webhook',controller['webhookGet']);router[_0xea37('0x7')](_0xea37('0x8'),auth[_0xea37('0x9')](),controller[_0xea37('0xa')]);router['get'](_0xea37('0xb'),auth[_0xea37('0x9')](),controller[_0xea37('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5060cd,_0x9a39cd,_0x117ce1){_0x117ce1(null,path[_0xea37('0xd')](config['root'],_0xea37('0xe')));},'filename':function(_0x2a0460,_0x2a2bcd,_0x589a61){_0x2a2bcd[_0xea37('0xf')]=_0x2a2bcd[_0xea37('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589a61(null,util[_0xea37('0x10')]('%s-%s%s',path[_0xea37('0x11')](_0x2a2bcd['originalname'],path[_0xea37('0x12')](_0x2a2bcd[_0xea37('0xf')])),Date[_0xea37('0x13')](),path[_0xea37('0x12')](_0x2a2bcd['originalname'])));}})});router[_0xea37('0x14')]('/',upload['single']('file'),controller[_0xea37('0x15')]);router['post'](_0xea37('0x16'),controller[_0xea37('0x17')]);router['put'](_0xea37('0x8'),auth[_0xea37('0x9')](),controller['update']);router[_0xea37('0x18')](_0xea37('0x8'),auth[_0xea37('0x9')](),controller[_0xea37('0x18')]);module[_0xea37('0x19')]=router;
\ No newline at end of file
+var _0xbd50=['extname','post','single','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/webhook','webhookGet','show','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0xbd50,0x196));var _0x0bd5=function(_0x18201c,_0x24399f){_0x18201c=_0x18201c-0x0;var _0xdcbc4=_0xbd50[_0x18201c];return _0xdcbc4;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),controller[_0x0bd5('0xc')]);router['get']('/:id',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0xa')]('/:id/download',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x210f45,_0x7db86e,_0x4d7d17){_0x4d7d17(null,path[_0x0bd5('0xf')](config[_0x0bd5('0x10')],_0x0bd5('0x11')));},'filename':function(_0x5f49ee,_0x2f7a0c,_0x23982f){_0x2f7a0c[_0x0bd5('0x12')]=_0x2f7a0c[_0x0bd5('0x12')][_0x0bd5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23982f(null,util[_0x0bd5('0x14')](_0x0bd5('0x15'),path[_0x0bd5('0x16')](_0x2f7a0c['originalname'],path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])),Date['now'](),path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])));}})});router[_0x0bd5('0x18')]('/',upload[_0x0bd5('0x19')]('file'),controller[_0x0bd5('0x1a')]);router[_0x0bd5('0x18')](_0x0bd5('0xb'),controller[_0x0bd5('0x1b')]);router[_0x0bd5('0x1c')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1e')]);router[_0x0bd5('0x1f')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1f')]);module[_0x0bd5('0x20')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1942=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always'];(function(_0x1dba49,_0x5815d9){var _0x2ff0c1=function(_0xb2b7ec){while(--_0xb2b7ec){_0x1dba49['push'](_0x1dba49['shift']());}};_0x2ff0c1(++_0x5815d9);}(_0x1942,0x16d));var _0x2194=function(_0x3e265e,_0x5d7cd2){_0x3e265e=_0x3e265e-0x0;var _0x5c7468=_0x1942[_0x3e265e];return _0x5c7468;};'use strict';var Sequelize=require(_0x2194('0x0'));module[_0x2194('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2194('0x2')](_0x2194('0x3'),_0x2194('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2194('0x5')]},'path':{'type':Sequelize[_0x2194('0x6')],'comment':_0x2194('0x7')},'active':{'type':Sequelize[_0x2194('0x8')],'defaultValue':0x0,'comment':_0x2194('0x9')},'sidebar':{'type':Sequelize[_0x2194('0x2')](_0x2194('0xa'),'agentOnly',_0x2194('0xb'),'never'),'defaultValue':_0x2194('0xb'),'comment':_0x2194('0xc')},'icon':{'type':Sequelize[_0x2194('0x6')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x2194('0x6')]},'scriptName':{'type':Sequelize[_0x2194('0x6')]},'scriptPath':{'type':Sequelize[_0x2194('0x6')]}};
\ No newline at end of file
+var _0x9b23=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly'];(function(_0x57b5d0,_0x5eacd4){var _0x1486ca=function(_0x2464cd){while(--_0x2464cd){_0x57b5d0['push'](_0x57b5d0['shift']());}};_0x1486ca(++_0x5eacd4);}(_0x9b23,0x122));var _0x39b2=function(_0x1fc3e9,_0x6fc8a3){_0x1fc3e9=_0x1fc3e9-0x0;var _0x3ceb4c=_0x9b23[_0x1fc3e9];return _0x3ceb4c;};'use strict';var Sequelize=require(_0x39b2('0x0'));module[_0x39b2('0x1')]={'name':{'type':Sequelize[_0x39b2('0x2')]},'type':{'type':Sequelize['ENUM'](_0x39b2('0x3'),_0x39b2('0x4'))},'description':{'type':Sequelize[_0x39b2('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x39b2('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x39b2('0x6')},'sidebar':{'type':Sequelize[_0x39b2('0x7')](_0x39b2('0x8'),_0x39b2('0x9'),_0x39b2('0xa'),_0x39b2('0xb')),'defaultValue':_0x39b2('0xa'),'comment':_0x39b2('0xc')},'icon':{'type':Sequelize[_0x39b2('0x2')]},'adminUrl':{'type':Sequelize[_0x39b2('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x39b2('0x2')]},'scriptPath':{'type':Sequelize[_0x39b2('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dcf=['Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','set','download','sendStatus','statusCode','webhookPost','resolve','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','../../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','./plugin.socket','register','status','json','limit','undefined','offset','count','Content-Range','reject','save','then','Plugins','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','show','params','keys','length','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','root','dirname','node_modules/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','catch','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent'];(function(_0xda7bd1,_0x38e959){var _0x5bc7a3=function(_0x44e49e){while(--_0x44e49e){_0xda7bd1['push'](_0xda7bd1['shift']());}};_0x5bc7a3(++_0x38e959);}(_0x3dcf,0x188));var _0xf3dc=function(_0x13040f,_0x191408){_0x13040f=_0x13040f-0x0;var _0x4dd145=_0x3dcf[_0x13040f];return _0x4dd145;};'use strict';var emlformat=require(_0xf3dc('0x0'));var rimraf=require(_0xf3dc('0x1'));var zipdir=require(_0xf3dc('0x2'));var jsonpatch=require(_0xf3dc('0x3'));var rp=require(_0xf3dc('0x4'));var moment=require(_0xf3dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf3dc('0x6'));var util=require('util');var path=require(_0xf3dc('0x7'));var sox=require(_0xf3dc('0x8'));var csv=require(_0xf3dc('0x9'));var ejs=require(_0xf3dc('0xa'));var fs=require('fs');var fs_extra=require(_0xf3dc('0xb'));var _=require(_0xf3dc('0xc'));var squel=require(_0xf3dc('0xd'));var crypto=require(_0xf3dc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf3dc('0xf'));var toCsv=require(_0xf3dc('0x9'));var querystring=require(_0xf3dc('0x10'));var Papa=require(_0xf3dc('0x11'));var extract=require(_0xf3dc('0x12'));var rimraf=require('rimraf');var archiver=require(_0xf3dc('0x13'));var Redis=require('ioredis');var authService=require(_0xf3dc('0x14'));var qs=require(_0xf3dc('0x15'));var as=require(_0xf3dc('0x16'));var hardwareService=require(_0xf3dc('0x17'));var logger=require(_0xf3dc('0x18'))(_0xf3dc('0x19'));var utils=require(_0xf3dc('0x1a'));var config=require(_0xf3dc('0x1b'));var licenseUtil=require(_0xf3dc('0x1c'));var db=require(_0xf3dc('0x1d'))['db'];config[_0xf3dc('0x1e')]=_['defaults'](config[_0xf3dc('0x1e')],{'host':_0xf3dc('0x1f'),'port':0x18eb});var socket=require(_0xf3dc('0x20'))(new Redis(config[_0xf3dc('0x1e')]));require(_0xf3dc('0x21'))[_0xf3dc('0x22')](socket);function respondWithStatusCode(_0x2637dd,_0x2ba384){_0x2ba384=_0x2ba384||0xcc;return function(_0x4ce20c){if(_0x4ce20c){return _0x2637dd['sendStatus'](_0x2ba384);}return _0x2637dd[_0xf3dc('0x23')](_0x2ba384)['end']();};}function respondWithResult(_0x2a403d,_0x25b85e){_0x25b85e=_0x25b85e||0xc8;return function(_0xe5d32c){if(_0xe5d32c){return _0x2a403d['status'](_0x25b85e)[_0xf3dc('0x24')](_0xe5d32c);}};}function respondWithFilteredResult(_0x48bf8e,_0xed7b6){return function(_0x4fdc03){if(_0x4fdc03){var _0x1cafcd=typeof _0xed7b6['offset']==='undefined'&&typeof _0xed7b6[_0xf3dc('0x25')]===_0xf3dc('0x26');var _0x3778a8=_0x4fdc03['count'];var _0x58cbb6=_0x1cafcd?0x0:_0xed7b6[_0xf3dc('0x27')];var _0x2ebe48=_0x1cafcd?_0x4fdc03[_0xf3dc('0x28')]:_0xed7b6[_0xf3dc('0x27')]+_0xed7b6[_0xf3dc('0x25')];var _0x4d771a;if(_0x2ebe48>=_0x3778a8){_0x2ebe48=_0x3778a8;_0x4d771a=0xc8;}else{_0x4d771a=0xce;}_0x48bf8e[_0xf3dc('0x23')](_0x4d771a);return _0x48bf8e['set'](_0xf3dc('0x29'),_0x58cbb6+'-'+_0x2ebe48+'/'+_0x3778a8)[_0xf3dc('0x24')](_0x4fdc03);}return null;};}function patchUpdates(_0x479baa){return function(_0x78abe0){try{jsonpatch['apply'](_0x78abe0,_0x479baa,!![]);}catch(_0x13b833){return BPromise[_0xf3dc('0x2a')](_0x13b833);}return _0x78abe0[_0xf3dc('0x2b')]();};}function saveUpdates(_0x40efe0,_0x549ea9){return function(_0x2f7ec8){if(_0x2f7ec8){return _0x2f7ec8['update'](_0x40efe0)[_0xf3dc('0x2c')](function(_0x291b1b){return _0x291b1b;});}return null;};}function removeEntity(_0x302657,_0x4ba802){return function(_0x3e5f13){if(_0x3e5f13){return _0x3e5f13['destroy']()['then'](function(){var _0x57c1f0=_0x3e5f13['get']({'plain':!![]});var _0x5a7083=_0xf3dc('0x2d');return db[_0xf3dc('0x2e')][_0xf3dc('0x2f')]({'where':{'type':_0x5a7083,'resourceId':_0x57c1f0['id']}})[_0xf3dc('0x2c')](function(){return _0x3e5f13;});})[_0xf3dc('0x2c')](function(){_0x302657[_0xf3dc('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b9b4,_0x5821fe){return function(_0x294897){if(!_0x294897){_0x41b9b4['sendStatus'](0x194);}return _0x294897;};}function handleError(_0x1d862b,_0x57ab79){_0x57ab79=_0x57ab79||0x1f4;return function(_0x4b7770){logger[_0xf3dc('0x30')](_0x4b7770[_0xf3dc('0x31')]);if(_0x4b7770[_0xf3dc('0x32')]){delete _0x4b7770[_0xf3dc('0x32')];}_0x1d862b['status'](_0x57ab79)[_0xf3dc('0x33')](_0x4b7770);};}exports[_0xf3dc('0x34')]=function(_0x109289,_0x17558d){var _0x4d14f2={},_0x356ee7={},_0x29c3f3={'count':0x0,'rows':[]};var _0x8131c1=_[_0xf3dc('0x35')](db['Plugin'][_0xf3dc('0x36')],function(_0x3b508e){return{'name':_0x3b508e[_0xf3dc('0x37')],'type':_0x3b508e['type']['key']};});_0x356ee7[_0xf3dc('0x38')]=_[_0xf3dc('0x35')](_0x8131c1,_0xf3dc('0x32'));_0x356ee7['query']=_['keys'](_0x109289[_0xf3dc('0x39')]);_0x356ee7[_0xf3dc('0x3a')]=_['intersection'](_0x356ee7[_0xf3dc('0x38')],_0x356ee7[_0xf3dc('0x39')]);_0x4d14f2[_0xf3dc('0x3b')]=_[_0xf3dc('0x3c')](_0x356ee7[_0xf3dc('0x38')],qs[_0xf3dc('0x3d')](_0x109289[_0xf3dc('0x39')]['fields']));_0x4d14f2['attributes']=_0x4d14f2[_0xf3dc('0x3b')]['length']?_0x4d14f2[_0xf3dc('0x3b')]:_0x356ee7[_0xf3dc('0x38')];if(!_0x109289[_0xf3dc('0x39')]['hasOwnProperty'](_0xf3dc('0x3e'))){_0x4d14f2[_0xf3dc('0x25')]=qs['limit'](_0x109289[_0xf3dc('0x39')][_0xf3dc('0x25')]);_0x4d14f2[_0xf3dc('0x27')]=qs[_0xf3dc('0x27')](_0x109289['query'][_0xf3dc('0x27')]);}_0x4d14f2['order']=qs[_0xf3dc('0x3f')](_0x109289[_0xf3dc('0x39')][_0xf3dc('0x3f')]);_0x4d14f2['where']=qs[_0xf3dc('0x3a')](_[_0xf3dc('0x40')](_0x109289[_0xf3dc('0x39')],_0x356ee7[_0xf3dc('0x3a')]),_0x8131c1);if(_0x109289[_0xf3dc('0x39')][_0xf3dc('0x41')]){_0x4d14f2['where']=_[_0xf3dc('0x42')](_0x4d14f2[_0xf3dc('0x43')],{'$or':_[_0xf3dc('0x35')](_0x8131c1,function(_0x2544cf){if(_0x2544cf[_0xf3dc('0x44')]!==_0xf3dc('0x45')){var _0x4cc754={};_0x4cc754[_0x2544cf[_0xf3dc('0x32')]]={'$like':'%'+_0x109289[_0xf3dc('0x39')][_0xf3dc('0x41')]+'%'};return _0x4cc754;}})});}_0x4d14f2=_['merge']({},_0x4d14f2,_0x109289[_0xf3dc('0x46')]);var _0xf8d339={'where':_0x4d14f2['where']};return db[_0xf3dc('0x47')]['count'](_0xf8d339)[_0xf3dc('0x2c')](function(_0xeb2ac8){_0x29c3f3[_0xf3dc('0x28')]=_0xeb2ac8;if(_0x109289[_0xf3dc('0x39')][_0xf3dc('0x48')]){_0x4d14f2[_0xf3dc('0x49')]=[{'all':!![]}];}return db['Plugin'][_0xf3dc('0x4a')](_0x4d14f2);})[_0xf3dc('0x2c')](function(_0x538541){_0x29c3f3[_0xf3dc('0x4b')]=_0x538541;return _0x29c3f3;})['then'](respondWithFilteredResult(_0x17558d,_0x4d14f2))['catch'](handleError(_0x17558d,null));};exports[_0xf3dc('0x4c')]=function(_0x183f8b,_0x25f193){var _0x14c83e={'raw':!![],'where':{'id':_0x183f8b[_0xf3dc('0x4d')]['id']}},_0x2adc79={};_0x2adc79['model']=_[_0xf3dc('0x4e')](db[_0xf3dc('0x47')][_0xf3dc('0x36')]);_0x2adc79[_0xf3dc('0x39')]=_[_0xf3dc('0x4e')](_0x183f8b['query']);_0x2adc79[_0xf3dc('0x3a')]=_[_0xf3dc('0x3c')](_0x2adc79[_0xf3dc('0x38')],_0x2adc79[_0xf3dc('0x39')]);_0x14c83e[_0xf3dc('0x3b')]=_['intersection'](_0x2adc79[_0xf3dc('0x38')],qs[_0xf3dc('0x3d')](_0x183f8b[_0xf3dc('0x39')]['fields']));_0x14c83e[_0xf3dc('0x3b')]=_0x14c83e[_0xf3dc('0x3b')][_0xf3dc('0x4f')]?_0x14c83e[_0xf3dc('0x3b')]:_0x2adc79[_0xf3dc('0x38')];if(_0x183f8b['query'][_0xf3dc('0x48')]){_0x14c83e[_0xf3dc('0x49')]=[{'all':!![]}];}_0x14c83e=_[_0xf3dc('0x42')]({},_0x14c83e,_0x183f8b[_0xf3dc('0x46')]);return db[_0xf3dc('0x47')][_0xf3dc('0x50')](_0x14c83e)[_0xf3dc('0x2c')](handleEntityNotFound(_0x25f193,null))[_0xf3dc('0x2c')](respondWithResult(_0x25f193,null))['catch'](handleError(_0x25f193,null));};exports['download']=function(_0x4061e0,_0x54f017,_0x5bdb03){return db[_0xf3dc('0x47')][_0xf3dc('0x50')]({'where':{'id':_0x4061e0[_0xf3dc('0x4d')]['id']},'attributes':[_0xf3dc('0x32'),_0xf3dc('0x7')],'raw':!![]})[_0xf3dc('0x2c')](handleEntityNotFound(_0x54f017,null))[_0xf3dc('0x2c')](function(_0x20ea1c){if(_0x20ea1c){var _0xe8e576=path[_0xf3dc('0x51')](config['root'],_0xf3dc('0x52'),util[_0xf3dc('0x53')](_0xf3dc('0x54'),path[_0xf3dc('0x55')](_0x20ea1c['path'])));var _0x2a05fb=fs[_0xf3dc('0x56')](_0xe8e576);var _0x485af6=archiver(_0xf3dc('0x57'),{'zlib':{'level':0x9}});_0x485af6['on'](_0xf3dc('0x58'),function(_0x3dcec7){if(_0x3dcec7[_0xf3dc('0x59')]===_0xf3dc('0x5a')){logger[_0xf3dc('0x30')](_0x3dcec7);}else{throw new db[(_0xf3dc('0x5b'))][(_0xf3dc('0x5c'))](_0xf3dc('0x5d'));}});_0x485af6['on'](_0xf3dc('0x30'),function(_0xee28c8){throw new db[(_0xf3dc('0x5b'))][(_0xf3dc('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x485af6['pipe'](_0x2a05fb);_0x485af6[_0xf3dc('0x5e')]('**/*',{'cwd':path[_0xf3dc('0x51')](config[_0xf3dc('0x5f')],_0xf3dc('0x52'),path[_0xf3dc('0x60')](_0x20ea1c[_0xf3dc('0x7')])),'ignore':[path[_0xf3dc('0x51')](path['basename'](_0x20ea1c['path']),_0xf3dc('0x61')),path[_0xf3dc('0x51')](path[_0xf3dc('0x55')](_0x20ea1c[_0xf3dc('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xf3dc('0x62')]();_0x2a05fb['on'](_0xf3dc('0x63'),function(){if(!fs['existsSync'](_0xe8e576)){throw new db[(_0xf3dc('0x5b'))][(_0xf3dc('0x5c'))](_0xf3dc('0x64'));}return _0x54f017['download'](_0xe8e576,util[_0xf3dc('0x53')](_0xf3dc('0x54'),path[_0xf3dc('0x55')](_0x20ea1c['path'])),function(_0x3c029b){if(_0x3c029b){throw new db['Sequelize'][(_0xf3dc('0x5c'))](_0xf3dc('0x65'));}fs[_0xf3dc('0x66')](_0xe8e576);logger[_0xf3dc('0x67')](_0xf3dc('0x68'));logger[_0xf3dc('0x67')](_0xf3dc('0x69'));});});}return null;})[_0xf3dc('0x6a')](handleError(_0x54f017,null));};exports['upload']=function(_0x6255e6,_0x30413c,_0x348a6e){var _0x460ab6=path['basename'](_0x6255e6[_0xf3dc('0x6b')]['filename'],path[_0xf3dc('0x6c')](_0x6255e6[_0xf3dc('0x6b')][_0xf3dc('0x6d')]));var _0x13224f=path[_0xf3dc('0x51')](config[_0xf3dc('0x5f')],_0xf3dc('0x52'),_0x6255e6['file'][_0xf3dc('0x6d')]);var _0x2fdfc7=path['join'](config['root'],_0xf3dc('0x52'),_0x460ab6);logger['info'](_0xf3dc('0x6e'),_0x13224f);logger[_0xf3dc('0x67')](_0xf3dc('0x6f'),_0x2fdfc7);try{fs[_0xf3dc('0x70')](_0x13224f,parseInt(_0xf3dc('0x71'),0x8));extract(_0x13224f,{'dir':_0x2fdfc7},function(_0x456a1d){if(_0x456a1d){logger[_0xf3dc('0x30')](_0x456a1d);handleError(_0x456a1d,!![]);};var _0x274dfc=fs[_0xf3dc('0x72')](_0x2fdfc7);if(_0x274dfc[_0xf3dc('0x4f')]>0x1){removeReferences(_0x13224f,_0x2fdfc7);logger['error'](_0xf3dc('0x73'));return _0x348a6e(new Error(_0xf3dc('0x73')));}var _0x51d8b9=fs[_0xf3dc('0x74')](path[_0xf3dc('0x51')](_0x2fdfc7,_0x274dfc[0x0]));if(_0x51d8b9[_0xf3dc('0x75')]()){removeReferences(_0x13224f,_0x2fdfc7);logger[_0xf3dc('0x30')](_0xf3dc('0x73'));return _0x348a6e(new Error('Invalid\x20plugin\x20structure'));}if(_0x51d8b9[_0xf3dc('0x76')]()){var _0x3b6e9f=fs[_0xf3dc('0x72')](path[_0xf3dc('0x51')](_0x2fdfc7,_0x274dfc[0x0]));if(_0x3b6e9f[_0xf3dc('0x4f')]===0x0){removeReferences(_0x13224f,_0x2fdfc7);logger[_0xf3dc('0x30')](_0xf3dc('0x73'));return _0x348a6e(new Error(_0xf3dc('0x73')));}var _0x54b4af=_0x3b6e9f[_0xf3dc('0x77')](function(_0x1adbdd){return _0x1adbdd===_0xf3dc('0x78');});if(!_0x54b4af){return _0x348a6e(new Error(_0xf3dc('0x79')));}var _0x42b19b=fs[_0xf3dc('0x7a')](path['join'](_0x2fdfc7,_0x274dfc[0x0],_0xf3dc('0x78')));var _0x286cdd=JSON[_0xf3dc('0x7b')](_0x42b19b);if(_0xf3dc('0x26')==typeof _0x286cdd[_0xf3dc('0x32')]){return _0x348a6e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x286cdd[_0xf3dc('0x44')]){return _0x348a6e(new Error(_0xf3dc('0x7c')));}if('undefined'==typeof _0x286cdd[_0xf3dc('0x7d')]){return _0x348a6e(new Error(_0xf3dc('0x7e')));}if(_0xf3dc('0x26')==typeof _0x286cdd['parameters']){return _0x348a6e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x286cdd[_0xf3dc('0x44')]===_0xf3dc('0x7f')){if(_0xf3dc('0x26')==typeof _0x286cdd[_0xf3dc('0x80')]['views']){return _0x348a6e(new Error(_0xf3dc('0x81')));}if('undefined'==typeof _0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x83')]&&_0xf3dc('0x26')==typeof _0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x84')]){return _0x348a6e(new Error(_0xf3dc('0x85')));}}else if(_0x286cdd['type']===_0xf3dc('0x86')){if(_0xf3dc('0x26')==typeof _0x286cdd['parameters'][_0xf3dc('0x87')]){return _0x348a6e(new Error(_0xf3dc('0x88')));}if(_0xf3dc('0x26')==typeof _0x286cdd['parameters']['scriptPath']){return _0x348a6e(new Error(_0xf3dc('0x89')));}}else{return _0x348a6e(new Error(_0xf3dc('0x8a')));}var _0x19aa64=_0x286cdd[_0xf3dc('0x32')];var _0xba7786=_0x286cdd[_0xf3dc('0x8b')];var _0x28d97c=_0x286cdd['type'];var _0x5bfff9=_0x286cdd['sidebar']?_0x286cdd[_0xf3dc('0x8c')]:_0xf3dc('0x8d');var _0x352f8b=_0x286cdd['icon']?_0x286cdd['icon']:'icon-apps';var _0xe063ee='';var _0x58c0d0='';var _0x4f58b4='';var _0xc7363f='';var _0x3891b8=_0x286cdd[_0xf3dc('0x7d')];if(_0x28d97c===_0xf3dc('0x7f')){if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')]['views'][_0xf3dc('0x83')]){var _0x3832f8=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xf3dc('0x8e')](_0x3832f8)){_0xe063ee=path['join'](_0xf3dc('0x8f'),_0x460ab6,_0x274dfc[0x0],_0x3832f8);}else{_0xe063ee=_0x3832f8;}}else{logger['info'](_0xf3dc('0x90'));}if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')]['views']['agent']){var _0x114d62=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xf3dc('0x8e')](_0x114d62)){_0x58c0d0=path[_0xf3dc('0x51')](_0xf3dc('0x8f'),_0x460ab6,_0x274dfc[0x0],_0x114d62);}else{_0x58c0d0=_0x114d62;}}else{logger[_0xf3dc('0x67')](_0xf3dc('0x91'));}}else if(_0x28d97c==='script'){_0x4f58b4=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x87')];_0xc7363f=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x92')];if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')]['views']){if(_0xf3dc('0x26')!=typeof _0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')]['admin']){var _0x3832f8=_0x286cdd['parameters'][_0xf3dc('0x82')][_0xf3dc('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xf3dc('0x8e')](_0x3832f8)){_0xe063ee=path[_0xf3dc('0x51')]('plugins',_0x460ab6,_0x274dfc[0x0],_0x3832f8);}else{_0xe063ee=_0x3832f8;}}if('undefined'!=typeof _0x286cdd[_0xf3dc('0x80')]['views']['agent']){var _0x114d62=_0x286cdd[_0xf3dc('0x80')][_0xf3dc('0x82')][_0xf3dc('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x114d62)){_0x58c0d0=path[_0xf3dc('0x51')](_0xf3dc('0x8f'),_0x460ab6,_0x274dfc[0x0],_0x114d62);}else{_0x58c0d0=_0x114d62;}}}}var _0x434e12={'name':_0x19aa64,'description':_0xba7786,'path':path[_0xf3dc('0x51')](_0x460ab6,_0x274dfc[0x0]),'type':_0x28d97c,'sidebar':_0x5bfff9,'icon':_0x352f8b,'adminUrl':_0xe063ee,'agentUrl':_0x58c0d0,'scriptName':_0x4f58b4,'scriptPath':_0xc7363f,'version':_0x3891b8};removeReferences(_0x13224f,null);return db[_0xf3dc('0x47')][_0xf3dc('0x93')](_0x434e12)['then'](function(_0x10e4ae){var _0x3ac23c={'role':_0x6255e6[_0xf3dc('0x94')][_0xf3dc('0x95')],'userProfileId':_0x6255e6[_0xf3dc('0x94')][_0xf3dc('0x96')]};if(!_0x3ac23c)throw new Error(_0xf3dc('0x97'));if(_0x3ac23c['role']===_0xf3dc('0x98')){var _0x232102=_0x10e4ae['get']({'plain':!![]});return db[_0xf3dc('0x99')][_0xf3dc('0x50')]({'where':{'name':_0xf3dc('0x2d'),'userProfileId':_0x3ac23c[_0xf3dc('0x96')]},'raw':!![]})[_0xf3dc('0x2c')](function(_0x5cc9ab){if(_0x5cc9ab&&_0x5cc9ab[_0xf3dc('0x9a')]===0x0){return db[_0xf3dc('0x2e')][_0xf3dc('0x93')]({'name':_0x232102['name'],'resourceId':_0x232102['id'],'type':_0x5cc9ab[_0xf3dc('0x32')],'sectionId':_0x5cc9ab['id']},{})['then'](function(){return _0x10e4ae;});}else{return _0x10e4ae;}})[_0xf3dc('0x6a')](function(_0x9a143f){logger[_0xf3dc('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9a143f);throw _0x9a143f;});}return _0x10e4ae;})[_0xf3dc('0x2c')](respondWithResult(_0x30413c,null))[_0xf3dc('0x6a')](handleError(_0x30413c,null));}});}catch(_0x4c325f){_0x30413c[_0xf3dc('0x23')](0x1f4)[_0xf3dc('0x33')](_0x4c325f);}};function removeReferences(_0x451d09,_0x1a8963){try{if(_0x451d09){fs[_0xf3dc('0x66')](_0x451d09);logger[_0xf3dc('0x67')](_0xf3dc('0x9b'));}if(_0x1a8963){rimraf(_0x1a8963,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x215e2f){logger[_0xf3dc('0x30')](_0x215e2f);}}exports['update']=function(_0x225bb0,_0x1c1076,_0x5ec930){return db[_0xf3dc('0x47')][_0xf3dc('0x50')]({'where':{'id':_0x225bb0['params']['id']}})['then'](handleEntityNotFound(_0x1c1076,null))[_0xf3dc('0x2c')](saveUpdates(_0x225bb0[_0xf3dc('0x94')],null))[_0xf3dc('0x2c')](respondWithResult(_0x1c1076,null))[_0xf3dc('0x6a')](handleError(_0x1c1076,null));};exports[_0xf3dc('0x9c')]=function(_0x84e61d,_0xda9955,_0x535077){return db[_0xf3dc('0x47')][_0xf3dc('0x50')]({'where':{'id':_0x84e61d[_0xf3dc('0x4d')]['id']}})['then'](function(_0x41ecf5){if(_0x41ecf5){return _0x41ecf5[_0xf3dc('0x2f')]();}})[_0xf3dc('0x2c')](function(_0x2d055d){rimraf(path[_0xf3dc('0x51')](config['root'],_0xf3dc('0x52'),path[_0xf3dc('0x60')](_0x2d055d[_0xf3dc('0x7')])),function(){});return _0x2d055d;})[_0xf3dc('0x2c')](handleEntityNotFound(_0xda9955,null))[_0xf3dc('0x2c')](respondWithStatusCode(_0xda9955,null))['catch'](handleError(_0xda9955,null));};exports[_0xf3dc('0x9d')]=function(_0x5cabda,_0x5d37ab,_0x2bc8e5){return BPromise['resolve']()['then'](function(){if(!_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x7')]){throw new Error(_0xf3dc('0x9e'));}if(!_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x9f')]){throw new Error(_0xf3dc('0xa0'));}var _0x2ff642=_0x5cabda[_0xf3dc('0x39')]['hostname']?_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0xa1')]+':'+_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x9f')]:'http://localhost:'+_0x5cabda[_0xf3dc('0x39')]['port'];var _0x459532=_0x5cabda[_0xf3dc('0x39')]['json']?_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x24')]:!![];var _0x264af0=_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0xa2')]?_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0xa2')]:null;var _0x391c90={'method':_0x5cabda[_0xf3dc('0xa3')],'uri':util[_0xf3dc('0x53')](_0xf3dc('0xa4'),_0x2ff642,_0x5cabda[_0xf3dc('0x39')][_0xf3dc('0x7')]),'json':_0x459532,'resolveWithFullResponse':!![],'encoding':_0x264af0,'qs':_0x5cabda['query']};if(_0x5cabda['headers']){_0x391c90[_0xf3dc('0xa5')]=_0x5cabda[_0xf3dc('0xa5')];if(_0x391c90['headers'][_0xf3dc('0xa6')]){delete _0x391c90[_0xf3dc('0xa5')][_0xf3dc('0xa6')];}}if(_0x391c90[_0xf3dc('0xa5')][_0xf3dc('0xa7')]){delete _0x391c90[_0xf3dc('0xa5')][_0xf3dc('0xa7')];}return rp(_0x391c90);})[_0xf3dc('0x2c')](function(_0x3f67ac){if(_0x3f67ac){_0x5d37ab[_0xf3dc('0xa8')](_0x3f67ac[_0xf3dc('0xa5')]);logger[_0xf3dc('0x67')](_0x3f67ac['body']);if(_['endsWith'](_0x5cabda[_0xf3dc('0x39')]['path'],_0xf3dc('0xa9'))&&_0x3f67ac['statusCode']==0x1f4){return _0x5d37ab[_0xf3dc('0xaa')](_0x3f67ac['statusCode']);}else{return _0x5d37ab[_0xf3dc('0x23')](_0x3f67ac[_0xf3dc('0xab')])[_0xf3dc('0x33')](_0x3f67ac[_0xf3dc('0x94')]);}}else{return _0x5d37ab[_0xf3dc('0xaa')](0xc8);}})[_0xf3dc('0x6a')](handleError(_0x5d37ab,null));};exports[_0xf3dc('0xac')]=function(_0x5813d0,_0x21f857,_0x5a6b97){return BPromise[_0xf3dc('0xad')]()['then'](function(){if(!_0x5813d0[_0xf3dc('0x39')]['path']){throw new Error(_0xf3dc('0x9e'));}if(!_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4d55a2=_0x5813d0[_0xf3dc('0x39')]['hostname']?_0x5813d0[_0xf3dc('0x39')]['hostname']+':'+_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0x9f')]:_0xf3dc('0xae')+_0x5813d0[_0xf3dc('0x39')]['port'];var _0x42f236=_0x5813d0[_0xf3dc('0x39')]['json']?_0x5813d0['query'][_0xf3dc('0x24')]:!![];var _0x54caae=_0x5813d0[_0xf3dc('0x39')]['encoding']?_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0xa2')]:null;var _0x45f3a6={'method':_0x5813d0[_0xf3dc('0xa3')],'uri':util[_0xf3dc('0x53')]('%s%s',_0x4d55a2,_0x5813d0[_0xf3dc('0x39')][_0xf3dc('0x7')]),'json':_0x42f236,'resolveWithFullResponse':!![],'encoding':_0x54caae,'body':_0x5813d0[_0xf3dc('0x94')]};if(_0x5813d0[_0xf3dc('0xa5')]){_0x45f3a6[_0xf3dc('0xa5')]=_0x5813d0[_0xf3dc('0xa5')];if(_0x45f3a6[_0xf3dc('0xa5')]['content-length']){delete _0x45f3a6['headers']['content-length'];}}if(_0x45f3a6[_0xf3dc('0xa5')][_0xf3dc('0xa7')]){delete _0x45f3a6[_0xf3dc('0xa5')]['content-type'];}return rp(_0x45f3a6);})['then'](function(_0x14a4a6){if(_0x14a4a6){_0x21f857[_0xf3dc('0xa8')](_0x14a4a6[_0xf3dc('0xa5')]);logger[_0xf3dc('0x67')](_0x14a4a6['body']);return _0x21f857[_0xf3dc('0x23')](_0x14a4a6[_0xf3dc('0xab')])[_0xf3dc('0x33')](_0x14a4a6[_0xf3dc('0x94')]);}else{return _0x21f857['sendStatus'](0xc8);}})[_0xf3dc('0x6a')](handleError(_0x21f857,null));};
\ No newline at end of file
+var _0x87b5=['pick','filter','merge','VIRTUAL','options','include','show','params','keys','Plugin','includeAll','find','catch','download','path','join','root','server/files/plugins','%s.zip','basename','createWriteStream','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','plugins','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Zip\x20archive\x20removed','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','%s%s','headers','content-length','content-type','endsWith','statusCode','resolve','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','get','Plugins','UserProfileResource','destroy','name','send','index','map','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2db6a4,_0xef8dca){var _0x2a3d55=function(_0x573011){while(--_0x573011){_0x2db6a4['push'](_0x2db6a4['shift']());}};_0x2a3d55(++_0xef8dca);}(_0x87b5,0x1b3));var _0x587b=function(_0x2ff6e6,_0x2f9151){_0x2ff6e6=_0x2ff6e6-0x0;var _0x2eadfe=_0x87b5[_0x2ff6e6];return _0x2eadfe;};'use strict';var emlformat=require(_0x587b('0x0'));var rimraf=require(_0x587b('0x1'));var zipdir=require(_0x587b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x587b('0x3'));var moment=require(_0x587b('0x4'));var BPromise=require(_0x587b('0x5'));var Mustache=require(_0x587b('0x6'));var util=require(_0x587b('0x7'));var path=require('path');var sox=require(_0x587b('0x8'));var csv=require(_0x587b('0x9'));var ejs=require(_0x587b('0xa'));var fs=require('fs');var fs_extra=require(_0x587b('0xb'));var _=require(_0x587b('0xc'));var squel=require(_0x587b('0xd'));var crypto=require(_0x587b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x587b('0xf'));var toCsv=require(_0x587b('0x9'));var querystring=require(_0x587b('0x10'));var Papa=require(_0x587b('0x11'));var extract=require('extract-zip');var rimraf=require(_0x587b('0x1'));var archiver=require(_0x587b('0x12'));var Redis=require(_0x587b('0x13'));var authService=require(_0x587b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x587b('0x15'));var hardwareService=require(_0x587b('0x16'));var logger=require(_0x587b('0x17'))(_0x587b('0x18'));var utils=require('../../config/utils');var config=require(_0x587b('0x19'));var licenseUtil=require(_0x587b('0x1a'));var db=require('../../mysqldb')['db'];config[_0x587b('0x1b')]=_['defaults'](config[_0x587b('0x1b')],{'host':_0x587b('0x1c'),'port':0x18eb});var socket=require(_0x587b('0x1d'))(new Redis(config[_0x587b('0x1b')]));require(_0x587b('0x1e'))[_0x587b('0x1f')](socket);function respondWithStatusCode(_0x53f8fc,_0x3c4f8e){_0x3c4f8e=_0x3c4f8e||0xcc;return function(_0x245a8d){if(_0x245a8d){return _0x53f8fc[_0x587b('0x20')](_0x3c4f8e);}return _0x53f8fc['status'](_0x3c4f8e)['end']();};}function respondWithResult(_0x501787,_0x94681){_0x94681=_0x94681||0xc8;return function(_0xea2b57){if(_0xea2b57){return _0x501787[_0x587b('0x21')](_0x94681)[_0x587b('0x22')](_0xea2b57);}};}function respondWithFilteredResult(_0x38691d,_0x5b06c1){return function(_0x4617e9){if(_0x4617e9){var _0x1ff36a=typeof _0x5b06c1[_0x587b('0x23')]===_0x587b('0x24')&&typeof _0x5b06c1[_0x587b('0x25')]===_0x587b('0x24');var _0x545784=_0x4617e9[_0x587b('0x26')];var _0x4bb078=_0x1ff36a?0x0:_0x5b06c1['offset'];var _0xbc291a=_0x1ff36a?_0x4617e9[_0x587b('0x26')]:_0x5b06c1[_0x587b('0x23')]+_0x5b06c1[_0x587b('0x25')];var _0x3c9161;if(_0xbc291a>=_0x545784){_0xbc291a=_0x545784;_0x3c9161=0xc8;}else{_0x3c9161=0xce;}_0x38691d[_0x587b('0x21')](_0x3c9161);return _0x38691d[_0x587b('0x27')]('Content-Range',_0x4bb078+'-'+_0xbc291a+'/'+_0x545784)[_0x587b('0x22')](_0x4617e9);}return null;};}function patchUpdates(_0x2f6818){return function(_0x321bc9){try{jsonpatch[_0x587b('0x28')](_0x321bc9,_0x2f6818,!![]);}catch(_0x46b29b){return BPromise['reject'](_0x46b29b);}return _0x321bc9[_0x587b('0x29')]();};}function saveUpdates(_0x528060,_0x5b8303){return function(_0x470c43){if(_0x470c43){return _0x470c43[_0x587b('0x2a')](_0x528060)[_0x587b('0x2b')](function(_0x160dbd){return _0x160dbd;});}return null;};}function removeEntity(_0x54885b,_0x19bf4a){return function(_0x356c64){if(_0x356c64){return _0x356c64['destroy']()[_0x587b('0x2b')](function(){var _0x8c40e7=_0x356c64[_0x587b('0x2c')]({'plain':!![]});var _0x669fd9=_0x587b('0x2d');return db[_0x587b('0x2e')][_0x587b('0x2f')]({'where':{'type':_0x669fd9,'resourceId':_0x8c40e7['id']}})[_0x587b('0x2b')](function(){return _0x356c64;});})[_0x587b('0x2b')](function(){_0x54885b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2061c1,_0x4e2e64){return function(_0x1da51e){if(!_0x1da51e){_0x2061c1[_0x587b('0x20')](0x194);}return _0x1da51e;};}function handleError(_0x16154e,_0x174860){_0x174860=_0x174860||0x1f4;return function(_0x582135){logger['error'](_0x582135['stack']);if(_0x582135[_0x587b('0x30')]){delete _0x582135['name'];}_0x16154e[_0x587b('0x21')](_0x174860)[_0x587b('0x31')](_0x582135);};}exports[_0x587b('0x32')]=function(_0x263082,_0x25be51){var _0x227df0={},_0x1ffa85={},_0x316136={'count':0x0,'rows':[]};var _0x2a584c=_[_0x587b('0x33')](db['Plugin']['rawAttributes'],function(_0x325845){return{'name':_0x325845['fieldName'],'type':_0x325845[_0x587b('0x34')][_0x587b('0x35')]};});_0x1ffa85[_0x587b('0x36')]=_[_0x587b('0x33')](_0x2a584c,_0x587b('0x30'));_0x1ffa85['query']=_['keys'](_0x263082['query']);_0x1ffa85[_0x587b('0x37')]=_[_0x587b('0x38')](_0x1ffa85['model'],_0x1ffa85[_0x587b('0x39')]);_0x227df0[_0x587b('0x3a')]=_['intersection'](_0x1ffa85[_0x587b('0x36')],qs['fields'](_0x263082[_0x587b('0x39')][_0x587b('0x3b')]));_0x227df0[_0x587b('0x3a')]=_0x227df0['attributes'][_0x587b('0x3c')]?_0x227df0[_0x587b('0x3a')]:_0x1ffa85[_0x587b('0x36')];if(!_0x263082[_0x587b('0x39')][_0x587b('0x3d')](_0x587b('0x3e'))){_0x227df0[_0x587b('0x25')]=qs[_0x587b('0x25')](_0x263082[_0x587b('0x39')][_0x587b('0x25')]);_0x227df0[_0x587b('0x23')]=qs[_0x587b('0x23')](_0x263082[_0x587b('0x39')][_0x587b('0x23')]);}_0x227df0[_0x587b('0x3f')]=qs[_0x587b('0x40')](_0x263082[_0x587b('0x39')]['sort']);_0x227df0[_0x587b('0x41')]=qs[_0x587b('0x37')](_[_0x587b('0x42')](_0x263082['query'],_0x1ffa85['filters']),_0x2a584c);if(_0x263082[_0x587b('0x39')][_0x587b('0x43')]){_0x227df0[_0x587b('0x41')]=_[_0x587b('0x44')](_0x227df0[_0x587b('0x41')],{'$or':_['map'](_0x2a584c,function(_0x8c90a4){if(_0x8c90a4[_0x587b('0x34')]!==_0x587b('0x45')){var _0x2f70da={};_0x2f70da[_0x8c90a4[_0x587b('0x30')]]={'$like':'%'+_0x263082[_0x587b('0x39')][_0x587b('0x43')]+'%'};return _0x2f70da;}})});}_0x227df0=_[_0x587b('0x44')]({},_0x227df0,_0x263082[_0x587b('0x46')]);var _0x271f70={'where':_0x227df0[_0x587b('0x41')]};return db['Plugin'][_0x587b('0x26')](_0x271f70)[_0x587b('0x2b')](function(_0x32b15){_0x316136[_0x587b('0x26')]=_0x32b15;if(_0x263082[_0x587b('0x39')]['includeAll']){_0x227df0[_0x587b('0x47')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x227df0);})[_0x587b('0x2b')](function(_0x5d3fb2){_0x316136['rows']=_0x5d3fb2;return _0x316136;})[_0x587b('0x2b')](respondWithFilteredResult(_0x25be51,_0x227df0))['catch'](handleError(_0x25be51,null));};exports[_0x587b('0x48')]=function(_0x225729,_0x2734c0){var _0x225740={'raw':!![],'where':{'id':_0x225729[_0x587b('0x49')]['id']}},_0x8e08e={};_0x8e08e[_0x587b('0x36')]=_[_0x587b('0x4a')](db[_0x587b('0x4b')]['rawAttributes']);_0x8e08e['query']=_[_0x587b('0x4a')](_0x225729['query']);_0x8e08e['filters']=_['intersection'](_0x8e08e[_0x587b('0x36')],_0x8e08e[_0x587b('0x39')]);_0x225740[_0x587b('0x3a')]=_[_0x587b('0x38')](_0x8e08e[_0x587b('0x36')],qs[_0x587b('0x3b')](_0x225729[_0x587b('0x39')][_0x587b('0x3b')]));_0x225740[_0x587b('0x3a')]=_0x225740[_0x587b('0x3a')][_0x587b('0x3c')]?_0x225740[_0x587b('0x3a')]:_0x8e08e[_0x587b('0x36')];if(_0x225729[_0x587b('0x39')][_0x587b('0x4c')]){_0x225740[_0x587b('0x47')]=[{'all':!![]}];}_0x225740=_[_0x587b('0x44')]({},_0x225740,_0x225729[_0x587b('0x46')]);return db[_0x587b('0x4b')][_0x587b('0x4d')](_0x225740)['then'](handleEntityNotFound(_0x2734c0,null))[_0x587b('0x2b')](respondWithResult(_0x2734c0,null))[_0x587b('0x4e')](handleError(_0x2734c0,null));};exports[_0x587b('0x4f')]=function(_0x52513e,_0x37b6c6,_0x2be929){return db['Plugin'][_0x587b('0x4d')]({'where':{'id':_0x52513e['params']['id']},'attributes':[_0x587b('0x30'),_0x587b('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x37b6c6,null))[_0x587b('0x2b')](function(_0x1e3dcd){if(_0x1e3dcd){var _0xba3daa=path[_0x587b('0x51')](config[_0x587b('0x52')],_0x587b('0x53'),util['format'](_0x587b('0x54'),path[_0x587b('0x55')](_0x1e3dcd[_0x587b('0x50')])));var _0x394446=fs[_0x587b('0x56')](_0xba3daa);var _0x56f499=archiver('zip',{'zlib':{'level':0x9}});_0x56f499['on']('warning',function(_0x482749){if(_0x482749['code']==='ENOENT'){logger[_0x587b('0x57')](_0x482749);}else{throw new db[(_0x587b('0x58'))][(_0x587b('0x59'))](_0x587b('0x5a'));}});_0x56f499['on'](_0x587b('0x57'),function(_0x5353bf){throw new db[(_0x587b('0x58'))]['Error'](_0x587b('0x5a'));});_0x56f499[_0x587b('0x5b')](_0x394446);_0x56f499['glob'](_0x587b('0x5c'),{'cwd':path['join'](config[_0x587b('0x52')],_0x587b('0x53'),path[_0x587b('0x5d')](_0x1e3dcd['path'])),'ignore':[path['join'](path[_0x587b('0x55')](_0x1e3dcd[_0x587b('0x50')]),_0x587b('0x5e')),path[_0x587b('0x51')](path[_0x587b('0x55')](_0x1e3dcd['path']),_0x587b('0x5f'))],'nodir':!![]})[_0x587b('0x60')]();_0x394446['on'](_0x587b('0x61'),function(){if(!fs[_0x587b('0x62')](_0xba3daa)){throw new db['Sequelize'][(_0x587b('0x59'))]('Plugin\x20not\x20found');}return _0x37b6c6[_0x587b('0x4f')](_0xba3daa,util['format'](_0x587b('0x54'),path[_0x587b('0x55')](_0x1e3dcd[_0x587b('0x50')])),function(_0x2ed5c5){if(_0x2ed5c5){throw new db[(_0x587b('0x58'))][(_0x587b('0x59'))](_0x587b('0x63'));}fs['unlinkSync'](_0xba3daa);logger[_0x587b('0x64')](_0x587b('0x65'));logger[_0x587b('0x64')](_0x587b('0x66'));});});}return null;})[_0x587b('0x4e')](handleError(_0x37b6c6,null));};exports[_0x587b('0x67')]=function(_0x286635,_0x55cefa,_0x31f8db){var _0x5d4d59=path[_0x587b('0x55')](_0x286635[_0x587b('0x68')][_0x587b('0x69')],path[_0x587b('0x6a')](_0x286635['file'][_0x587b('0x69')]));var _0x2fc4f0=path[_0x587b('0x51')](config[_0x587b('0x52')],_0x587b('0x53'),_0x286635[_0x587b('0x68')][_0x587b('0x69')]);var _0x4cdfa4=path[_0x587b('0x51')](config[_0x587b('0x52')],_0x587b('0x53'),_0x5d4d59);logger[_0x587b('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x2fc4f0);logger[_0x587b('0x64')]('Plugin\x20upload\x20destination:\x20%s',_0x4cdfa4);try{fs[_0x587b('0x6b')](_0x2fc4f0,parseInt(_0x587b('0x6c'),0x8));extract(_0x2fc4f0,{'dir':_0x4cdfa4},function(_0x16bb07){if(_0x16bb07){logger[_0x587b('0x57')](_0x16bb07);handleError(_0x16bb07,!![]);};var _0x16c89d=fs[_0x587b('0x6d')](_0x4cdfa4);if(_0x16c89d['length']>0x1){removeReferences(_0x2fc4f0,_0x4cdfa4);logger[_0x587b('0x57')](_0x587b('0x6e'));return _0x31f8db(new Error(_0x587b('0x6e')));}var _0x2a70f8=fs[_0x587b('0x6f')](path['join'](_0x4cdfa4,_0x16c89d[0x0]));if(_0x2a70f8[_0x587b('0x70')]()){removeReferences(_0x2fc4f0,_0x4cdfa4);logger[_0x587b('0x57')](_0x587b('0x6e'));return _0x31f8db(new Error('Invalid\x20plugin\x20structure'));}if(_0x2a70f8[_0x587b('0x71')]()){var _0x536a51=fs[_0x587b('0x6d')](path[_0x587b('0x51')](_0x4cdfa4,_0x16c89d[0x0]));if(_0x536a51[_0x587b('0x3c')]===0x0){removeReferences(_0x2fc4f0,_0x4cdfa4);logger[_0x587b('0x57')](_0x587b('0x6e'));return _0x31f8db(new Error(_0x587b('0x6e')));}var _0x516f81=_0x536a51[_0x587b('0x72')](function(_0x2cebf){return _0x2cebf===_0x587b('0x73');});if(!_0x516f81){return _0x31f8db(new Error(_0x587b('0x74')));}var _0x51edcb=fs[_0x587b('0x75')](path[_0x587b('0x51')](_0x4cdfa4,_0x16c89d[0x0],_0x587b('0x73')));var _0x6dd35b=JSON[_0x587b('0x76')](_0x51edcb);if(_0x587b('0x24')==typeof _0x6dd35b[_0x587b('0x30')]){return _0x31f8db(new Error(_0x587b('0x77')));}if(_0x587b('0x24')==typeof _0x6dd35b[_0x587b('0x34')]){return _0x31f8db(new Error(_0x587b('0x78')));}if(_0x587b('0x24')==typeof _0x6dd35b[_0x587b('0x79')]){return _0x31f8db(new Error(_0x587b('0x7a')));}if(_0x587b('0x24')==typeof _0x6dd35b[_0x587b('0x7b')]){return _0x31f8db(new Error(_0x587b('0x7c')));}if(_0x6dd35b[_0x587b('0x34')]===_0x587b('0x7d')){if('undefined'==typeof _0x6dd35b['parameters']['views']){return _0x31f8db(new Error(_0x587b('0x7e')));}if('undefined'==typeof _0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')][_0x587b('0x80')]&&_0x587b('0x24')==typeof _0x6dd35b[_0x587b('0x7b')]['views']['agent']){return _0x31f8db(new Error(_0x587b('0x81')));}}else if(_0x6dd35b['type']===_0x587b('0x82')){if(_0x587b('0x24')==typeof _0x6dd35b['parameters'][_0x587b('0x83')]){return _0x31f8db(new Error(_0x587b('0x84')));}if(_0x587b('0x24')==typeof _0x6dd35b['parameters'][_0x587b('0x85')]){return _0x31f8db(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x31f8db(new Error(_0x587b('0x86')));}var _0x2ba4e0=_0x6dd35b['name'];var _0x3ae46e=_0x6dd35b[_0x587b('0x87')];var _0x536ed4=_0x6dd35b[_0x587b('0x34')];var _0x2f6c6b=_0x6dd35b[_0x587b('0x88')]?_0x6dd35b[_0x587b('0x88')]:_0x587b('0x89');var _0x574684=_0x6dd35b[_0x587b('0x8a')]?_0x6dd35b[_0x587b('0x8a')]:'icon-apps';var _0x3f3d62='';var _0x907c42='';var _0x211a81='';var _0x724e33='';var _0x5afc2f=_0x6dd35b[_0x587b('0x79')];if(_0x536ed4==='html'){if('undefined'!=typeof _0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')][_0x587b('0x80')]){var _0x41b276=_0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')][_0x587b('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x41b276)){_0x3f3d62=path[_0x587b('0x51')]('plugins',_0x5d4d59,_0x16c89d[0x0],_0x41b276);}else{_0x3f3d62=_0x41b276;}}else{logger[_0x587b('0x64')](_0x587b('0x8b'));}if(_0x587b('0x24')!=typeof _0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')]['agent']){var _0x2f317f=_0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')][_0x587b('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x587b('0x8d')](_0x2f317f)){_0x907c42=path[_0x587b('0x51')]('plugins',_0x5d4d59,_0x16c89d[0x0],_0x2f317f);}else{_0x907c42=_0x2f317f;}}else{logger['info'](_0x587b('0x8e'));}}else if(_0x536ed4===_0x587b('0x82')){_0x211a81=_0x6dd35b[_0x587b('0x7b')][_0x587b('0x83')];_0x724e33=_0x6dd35b['parameters']['scriptPath'];if(_0x587b('0x24')!=typeof _0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')]){if('undefined'!=typeof _0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')][_0x587b('0x80')]){var _0x41b276=_0x6dd35b[_0x587b('0x7b')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x587b('0x8d')](_0x41b276)){_0x3f3d62=path[_0x587b('0x51')]('plugins',_0x5d4d59,_0x16c89d[0x0],_0x41b276);}else{_0x3f3d62=_0x41b276;}}if(_0x587b('0x24')!=typeof _0x6dd35b[_0x587b('0x7b')]['views'][_0x587b('0x8c')]){var _0x2f317f=_0x6dd35b[_0x587b('0x7b')][_0x587b('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x587b('0x8d')](_0x2f317f)){_0x907c42=path[_0x587b('0x51')](_0x587b('0x8f'),_0x5d4d59,_0x16c89d[0x0],_0x2f317f);}else{_0x907c42=_0x2f317f;}}}}var _0x5baa38={'name':_0x2ba4e0,'description':_0x3ae46e,'path':path['join'](_0x5d4d59,_0x16c89d[0x0]),'type':_0x536ed4,'sidebar':_0x2f6c6b,'icon':_0x574684,'adminUrl':_0x3f3d62,'agentUrl':_0x907c42,'scriptName':_0x211a81,'scriptPath':_0x724e33,'version':_0x5afc2f};removeReferences(_0x2fc4f0,null);return db[_0x587b('0x4b')][_0x587b('0x90')](_0x5baa38)[_0x587b('0x2b')](function(_0x5e1e8f){var _0x512eae={'role':_0x286635[_0x587b('0x91')][_0x587b('0x92')],'userProfileId':_0x286635[_0x587b('0x91')]['userProfileId']};if(!_0x512eae)throw new Error(_0x587b('0x93'));if(_0x512eae[_0x587b('0x92')]===_0x587b('0x94')){var _0x1a907b=_0x5e1e8f[_0x587b('0x2c')]({'plain':!![]});return db[_0x587b('0x95')][_0x587b('0x4d')]({'where':{'name':_0x587b('0x2d'),'userProfileId':_0x512eae[_0x587b('0x96')]},'raw':!![]})['then'](function(_0x26c778){if(_0x26c778&&_0x26c778['autoAssociation']===0x0){return db['UserProfileResource'][_0x587b('0x90')]({'name':_0x1a907b['name'],'resourceId':_0x1a907b['id'],'type':_0x26c778['name'],'sectionId':_0x26c778['id']},{})[_0x587b('0x2b')](function(){return _0x5e1e8f;});}else{return _0x5e1e8f;}})[_0x587b('0x4e')](function(_0x302ade){logger[_0x587b('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x302ade);throw _0x302ade;});}return _0x5e1e8f;})[_0x587b('0x2b')](respondWithResult(_0x55cefa,null))[_0x587b('0x4e')](handleError(_0x55cefa,null));}});}catch(_0x219fff){_0x55cefa[_0x587b('0x21')](0x1f4)[_0x587b('0x31')](_0x219fff);}};function removeReferences(_0x1ecaed,_0x1551be){try{if(_0x1ecaed){fs['unlinkSync'](_0x1ecaed);logger[_0x587b('0x64')](_0x587b('0x97'));}if(_0x1551be){rimraf(_0x1551be,function(){});logger[_0x587b('0x64')]('Extracted\x20folder\x20removed');}}catch(_0x86c28a){logger['error'](_0x86c28a);}}exports[_0x587b('0x2a')]=function(_0x16e4fb,_0x5ae7e8,_0x1e3b8f){return db[_0x587b('0x4b')][_0x587b('0x4d')]({'where':{'id':_0x16e4fb[_0x587b('0x49')]['id']}})[_0x587b('0x2b')](handleEntityNotFound(_0x5ae7e8,null))[_0x587b('0x2b')](saveUpdates(_0x16e4fb[_0x587b('0x91')],null))['then'](respondWithResult(_0x5ae7e8,null))[_0x587b('0x4e')](handleError(_0x5ae7e8,null));};exports['delete']=function(_0x4e5cd6,_0x4cb71e,_0x4cf3b1){return db[_0x587b('0x4b')]['find']({'where':{'id':_0x4e5cd6[_0x587b('0x49')]['id']}})['then'](function(_0x41e48c){if(_0x41e48c){return _0x41e48c[_0x587b('0x2f')]();}})[_0x587b('0x2b')](function(_0x2705ee){rimraf(path['join'](config['root'],'server/files/plugins',path[_0x587b('0x5d')](_0x2705ee[_0x587b('0x50')])),function(){});return _0x2705ee;})[_0x587b('0x2b')](handleEntityNotFound(_0x4cb71e,null))['then'](respondWithStatusCode(_0x4cb71e,null))[_0x587b('0x4e')](handleError(_0x4cb71e,null));};exports['webhookGet']=function(_0x2c30b8,_0x249170,_0x443f37){return BPromise['resolve']()['then'](function(){if(!_0x2c30b8[_0x587b('0x39')][_0x587b('0x50')]){throw new Error(_0x587b('0x98'));}if(!_0x2c30b8[_0x587b('0x39')][_0x587b('0x99')]){throw new Error(_0x587b('0x9a'));}var _0x263532=_0x2c30b8[_0x587b('0x39')][_0x587b('0x9b')]?_0x2c30b8[_0x587b('0x39')][_0x587b('0x9b')]+':'+_0x2c30b8['query'][_0x587b('0x99')]:_0x587b('0x9c')+_0x2c30b8[_0x587b('0x39')][_0x587b('0x99')];var _0x2e4112=_0x2c30b8[_0x587b('0x39')][_0x587b('0x22')]?_0x2c30b8[_0x587b('0x39')][_0x587b('0x22')]:!![];var _0x5ccb0d=_0x2c30b8[_0x587b('0x39')][_0x587b('0x9d')]?_0x2c30b8['query']['encoding']:null;var _0x312004={'method':_0x2c30b8[_0x587b('0x9e')],'uri':util[_0x587b('0x9f')](_0x587b('0xa0'),_0x263532,_0x2c30b8['query'][_0x587b('0x50')]),'json':_0x2e4112,'resolveWithFullResponse':!![],'encoding':_0x5ccb0d,'qs':_0x2c30b8[_0x587b('0x39')]};if(_0x2c30b8['headers']){_0x312004['headers']=_0x2c30b8[_0x587b('0xa1')];if(_0x312004[_0x587b('0xa1')][_0x587b('0xa2')]){delete _0x312004[_0x587b('0xa1')][_0x587b('0xa2')];}}if(_0x312004['headers'][_0x587b('0xa3')]){delete _0x312004['headers']['content-type'];}return rp(_0x312004);})[_0x587b('0x2b')](function(_0x28bc15){if(_0x28bc15){_0x249170[_0x587b('0x27')](_0x28bc15[_0x587b('0xa1')]);logger[_0x587b('0x64')](_0x28bc15['body']);if(_[_0x587b('0xa4')](_0x2c30b8[_0x587b('0x39')]['path'],_0x587b('0x4f'))&&_0x28bc15[_0x587b('0xa5')]==0x1f4){return _0x249170[_0x587b('0x20')](_0x28bc15[_0x587b('0xa5')]);}else{return _0x249170['status'](_0x28bc15['statusCode'])[_0x587b('0x31')](_0x28bc15[_0x587b('0x91')]);}}else{return _0x249170['sendStatus'](0xc8);}})[_0x587b('0x4e')](handleError(_0x249170,null));};exports['webhookPost']=function(_0x944fcb,_0x44c3a0,_0x2bfe36){return BPromise[_0x587b('0xa6')]()['then'](function(){if(!_0x944fcb['query'][_0x587b('0x50')]){throw new Error(_0x587b('0x98'));}if(!_0x944fcb[_0x587b('0x39')][_0x587b('0x99')]){throw new Error(_0x587b('0x9a'));}var _0x1087bb=_0x944fcb[_0x587b('0x39')][_0x587b('0x9b')]?_0x944fcb['query'][_0x587b('0x9b')]+':'+_0x944fcb['query'][_0x587b('0x99')]:_0x587b('0x9c')+_0x944fcb[_0x587b('0x39')][_0x587b('0x99')];var _0x222ae4=_0x944fcb[_0x587b('0x39')][_0x587b('0x22')]?_0x944fcb[_0x587b('0x39')][_0x587b('0x22')]:!![];var _0xdb87eb=_0x944fcb[_0x587b('0x39')]['encoding']?_0x944fcb[_0x587b('0x39')][_0x587b('0x9d')]:null;var _0x21626f={'method':_0x944fcb['method'],'uri':util['format'](_0x587b('0xa0'),_0x1087bb,_0x944fcb['query'][_0x587b('0x50')]),'json':_0x222ae4,'resolveWithFullResponse':!![],'encoding':_0xdb87eb,'body':_0x944fcb[_0x587b('0x91')]};if(_0x944fcb['headers']){_0x21626f['headers']=_0x944fcb[_0x587b('0xa1')];if(_0x21626f[_0x587b('0xa1')][_0x587b('0xa2')]){delete _0x21626f[_0x587b('0xa1')][_0x587b('0xa2')];}}if(_0x21626f[_0x587b('0xa1')][_0x587b('0xa3')]){delete _0x21626f[_0x587b('0xa1')][_0x587b('0xa3')];}return rp(_0x21626f);})[_0x587b('0x2b')](function(_0x11ae5d){if(_0x11ae5d){_0x44c3a0[_0x587b('0x27')](_0x11ae5d['headers']);logger[_0x587b('0x64')](_0x11ae5d[_0x587b('0x91')]);return _0x44c3a0[_0x587b('0x21')](_0x11ae5d['statusCode'])['send'](_0x11ae5d['body']);}else{return _0x44c3a0[_0x587b('0x20')](0xc8);}})[_0x587b('0x4e')](handleError(_0x44c3a0,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x176c=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x176c,0x134));var _0xc176=function(_0x46addc,_0x16d826){_0x46addc=_0x46addc-0x0;var _0x36488f=_0x176c[_0x46addc];return _0x36488f;};'use strict';var EventEmitter=require(_0xc176('0x0'));var Plugin=require(_0xc176('0x1'))['db'][_0xc176('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc176('0x3')](0x0);var events={'afterCreate':_0xc176('0x4'),'afterUpdate':_0xc176('0x5'),'afterDestroy':_0xc176('0x6')};function emitEvent(_0x5c6179){return function(_0x452510,_0x24433a,_0x556750){PluginEvents[_0xc176('0x7')](_0x5c6179+':'+_0x452510['id'],_0x452510);PluginEvents[_0xc176('0x7')](_0x5c6179,_0x452510);_0x556750(null);};}for(var e in events){if(events[_0xc176('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xc176('0x9')]=PluginEvents;
\ No newline at end of file
+var _0xbacd=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x3a7f8f,_0x47bbbd){var _0x4fdbd0=function(_0x5ae69c){while(--_0x5ae69c){_0x3a7f8f['push'](_0x3a7f8f['shift']());}};_0x4fdbd0(++_0x47bbbd);}(_0xbacd,0x1c5));var _0xdbac=function(_0xc86cff,_0x5d117a){_0xc86cff=_0xc86cff-0x0;var _0x4148c8=_0xbacd[_0xc86cff];return _0x4148c8;};'use strict';var EventEmitter=require(_0xdbac('0x0'));var Plugin=require(_0xdbac('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xdbac('0x2')](0x0);var events={'afterCreate':_0xdbac('0x3'),'afterUpdate':_0xdbac('0x4'),'afterDestroy':'remove'};function emitEvent(_0x34099f){return function(_0x3f18cd,_0x1fb9ef,_0xc088b4){PluginEvents[_0xdbac('0x5')](_0x34099f+':'+_0x3f18cd['id'],_0x3f18cd);PluginEvents[_0xdbac('0x5')](_0x34099f,_0x3f18cd);_0xc088b4(null);};}for(var e in events){if(events[_0xdbac('0x6')](e)){var event=events[e];Plugin[_0xdbac('0x7')](e,emitEvent(event));}}module[_0xdbac('0x8')]=PluginEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19b8=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x58cc27,_0x4c9ff6){var _0x137da5=function(_0x3c674f){while(--_0x3c674f){_0x58cc27['push'](_0x58cc27['shift']());}};_0x137da5(++_0x4c9ff6);}(_0x19b8,0x10e));var _0x819b=function(_0xbc1ccb,_0x4e040c){_0xbc1ccb=_0xbc1ccb-0x0;var _0x57c83a=_0x19b8[_0xbc1ccb];return _0x57c83a;};'use strict';var _=require(_0x819b('0x0'));var util=require('util');var logger=require(_0x819b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x819b('0x2'));var rp=require(_0x819b('0x3'));var fs=require('fs');var path=require(_0x819b('0x4'));var rimraf=require('rimraf');var config=require(_0x819b('0x5'));var attributes=require(_0x819b('0x6'));module[_0x819b('0x7')]=function(_0x598edd,_0x4b11d8){return _0x598edd[_0x819b('0x8')](_0x819b('0x9'),attributes,{'tableName':_0x819b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc66b=['Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','define'];(function(_0x5979ce,_0x9de1b4){var _0x7299d4=function(_0x30f233){while(--_0x30f233){_0x5979ce['push'](_0x5979ce['shift']());}};_0x7299d4(++_0x9de1b4);}(_0xc66b,0x175));var _0xbc66=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xc66b[_0x4d674b];return _0x535a1f;};'use strict';var _=require(_0xbc66('0x0'));var util=require(_0xbc66('0x1'));var logger=require(_0xbc66('0x2'))(_0xbc66('0x3'));var moment=require(_0xbc66('0x4'));var BPromise=require(_0xbc66('0x5'));var rp=require(_0xbc66('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc66('0x7'));var config=require(_0xbc66('0x8'));var attributes=require(_0xbc66('0x9'));module['exports']=function(_0x2cc713,_0x544e88){return _0x2cc713[_0xbc66('0xa')](_0xbc66('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70c6=['jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreatePlugin','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a6dbd,_0x466b0d){var _0x1079b9=function(_0x276b72){while(--_0x276b72){_0x5a6dbd['push'](_0x5a6dbd['shift']());}};_0x1079b9(++_0x466b0d);}(_0x70c6,0x128));var _0x670c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x70c6[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x670c('0x0'));var util=require(_0x670c('0x1'));var moment=require(_0x670c('0x2'));var BPromise=require(_0x670c('0x3'));var rs=require(_0x670c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x670c('0x5'))['db'];var utils=require(_0x670c('0x6'));var logger=require(_0x670c('0x7'))(_0x670c('0x8'));var config=require(_0x670c('0x9'));var jayson=require(_0x670c('0xa'));var client=jayson[_0x670c('0xb')][_0x670c('0xc')]({'port':0x232a});config['redis']=_[_0x670c('0xd')](config[_0x670c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x670c('0xf'))(new Redis(config[_0x670c('0xe')]));require('./plugin.socket')[_0x670c('0x10')](socket);function respondWithRpcPromise(_0x4937ef,_0xb61c35,_0x535795){return new BPromise(function(_0x1454f3,_0x1196f5){return client[_0x670c('0x11')](_0x4937ef,_0x535795)['then'](function(_0x14430a){logger['info'](_0x670c('0x12'),_0xb61c35,_0x670c('0x13'));logger[_0x670c('0x14')](_0x670c('0x15'),_0xb61c35,'request\x20sent',JSON['stringify'](_0x14430a));if(_0x14430a[_0x670c('0x16')]){if(_0x14430a[_0x670c('0x16')][_0x670c('0x17')]===0x1f4){logger[_0x670c('0x16')](_0x670c('0x12'),_0xb61c35,_0x14430a[_0x670c('0x16')][_0x670c('0x18')]);return _0x1196f5(_0x14430a[_0x670c('0x16')][_0x670c('0x18')]);}logger[_0x670c('0x16')](_0x670c('0x12'),_0xb61c35,_0x14430a[_0x670c('0x16')][_0x670c('0x18')]);return _0x1454f3(_0x14430a[_0x670c('0x16')]['message']);}else{logger[_0x670c('0x19')]('Plugin,\x20%s,\x20%s',_0xb61c35,_0x670c('0x13'));_0x1454f3(_0x14430a[_0x670c('0x1a')]['message']);}})[_0x670c('0x1b')](function(_0x5daace){logger[_0x670c('0x16')]('Plugin,\x20%s,\x20%s',_0xb61c35,_0x5daace);_0x1196f5(_0x5daace);});});}exports[_0x670c('0x1c')]=function(_0x518952){var _0x3bc60d=this;return new Promise(function(_0x1900c9,_0x1e9540){return db['Plugin'][_0x670c('0x1d')](_0x518952[_0x670c('0x1e')],{'raw':_0x518952[_0x670c('0x1f')]?_0x518952['options'][_0x670c('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4cc52c){logger['info']('CreatePlugin',_0x518952);logger[_0x670c('0x14')](_0x670c('0x1c'),_0x518952,JSON[_0x670c('0x21')](_0x4cc52c));_0x1900c9(_0x4cc52c);})[_0x670c('0x1b')](function(_0x116c70){logger['error']('CreatePlugin',_0x116c70[_0x670c('0x18')],_0x518952);_0x1e9540(_0x3bc60d[_0x670c('0x16')](0x1f4,_0x116c70[_0x670c('0x18')]));});});};
\ No newline at end of file
+var _0x2964=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x1a7d7f,_0x1d7c7a){var _0x3df746=function(_0x129df9){while(--_0x129df9){_0x1a7d7f['push'](_0x1a7d7f['shift']());}};_0x3df746(++_0x1d7c7a);}(_0x2964,0x108));var _0x4296=function(_0x397eb2,_0x3a92f1){_0x397eb2=_0x397eb2-0x0;var _0x183633=_0x2964[_0x397eb2];return _0x183633;};'use strict';var _=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var moment=require(_0x4296('0x2'));var BPromise=require(_0x4296('0x3'));var rs=require(_0x4296('0x4'));var fs=require('fs');var Redis=require(_0x4296('0x5'));var db=require(_0x4296('0x6'))['db'];var utils=require(_0x4296('0x7'));var logger=require(_0x4296('0x8'))('rpc');var config=require(_0x4296('0x9'));var jayson=require(_0x4296('0xa'));var client=jayson[_0x4296('0xb')][_0x4296('0xc')]({'port':0x232a});config[_0x4296('0xd')]=_[_0x4296('0xe')](config['redis'],{'host':_0x4296('0xf'),'port':0x18eb});var socket=require(_0x4296('0x10'))(new Redis(config[_0x4296('0xd')]));require(_0x4296('0x11'))[_0x4296('0x12')](socket);function respondWithRpcPromise(_0x3814d4,_0x3e826e,_0x41e8c7){return new BPromise(function(_0x1e3635,_0xaea543){return client[_0x4296('0x13')](_0x3814d4,_0x41e8c7)[_0x4296('0x14')](function(_0x5012c2){logger[_0x4296('0x15')](_0x4296('0x16'),_0x3e826e,_0x4296('0x17'));logger[_0x4296('0x18')](_0x4296('0x19'),_0x3e826e,_0x4296('0x17'),JSON[_0x4296('0x1a')](_0x5012c2));if(_0x5012c2['error']){if(_0x5012c2[_0x4296('0x1b')][_0x4296('0x1c')]===0x1f4){logger[_0x4296('0x1b')]('Plugin,\x20%s,\x20%s',_0x3e826e,_0x5012c2[_0x4296('0x1b')][_0x4296('0x1d')]);return _0xaea543(_0x5012c2[_0x4296('0x1b')]['message']);}logger[_0x4296('0x1b')](_0x4296('0x16'),_0x3e826e,_0x5012c2[_0x4296('0x1b')]['message']);return _0x1e3635(_0x5012c2[_0x4296('0x1b')][_0x4296('0x1d')]);}else{logger[_0x4296('0x15')](_0x4296('0x16'),_0x3e826e,_0x4296('0x17'));_0x1e3635(_0x5012c2['result'][_0x4296('0x1d')]);}})[_0x4296('0x1e')](function(_0x2d544c){logger['error'](_0x4296('0x16'),_0x3e826e,_0x2d544c);_0xaea543(_0x2d544c);});});}exports[_0x4296('0x1f')]=function(_0x448f46){var _0x3d3b2e=this;return new Promise(function(_0x1826c4,_0x336894){return db['Plugin'][_0x4296('0x20')](_0x448f46[_0x4296('0x21')],{'raw':_0x448f46['options']?_0x448f46[_0x4296('0x22')][_0x4296('0x23')]===undefined?!![]:![]:!![]})[_0x4296('0x14')](function(_0x3c899f){logger['info']('CreatePlugin',_0x448f46);logger[_0x4296('0x18')](_0x4296('0x1f'),_0x448f46,JSON['stringify'](_0x3c899f));_0x1826c4(_0x3c899f);})[_0x4296('0x1e')](function(_0x4c5aca){logger[_0x4296('0x1b')](_0x4296('0x1f'),_0x4c5aca[_0x4296('0x1d')],_0x448f46);_0x336894(_0x3d3b2e[_0x4296('0x1b')](0x1f4,_0x4c5aca['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf07e=['update','emit','./plugin.events','remove'];(function(_0x32dd7a,_0x45ec30){var _0x5b1062=function(_0x174631){while(--_0x174631){_0x32dd7a['push'](_0x32dd7a['shift']());}};_0x5b1062(++_0x45ec30);}(_0xf07e,0x122));var _0xef07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf07e[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0xef07('0x0'));var events=['save',_0xef07('0x1'),_0xef07('0x2')];function createListener(_0x543f59,_0x730884){return function(_0x291553){_0x730884[_0xef07('0x3')](_0x543f59,_0x291553);};}function removeListener(_0x3c588a,_0x5021b5){return function(){PluginEvents['removeListener'](_0x3c588a,_0x5021b5);};}exports['register']=function(_0x13a9fa){for(var _0x10dc2c=0x0,_0x12aca8=events['length'];_0x10dc2c<_0x12aca8;_0x10dc2c++){var _0x100914=events[_0x10dc2c];var _0x412071=createListener('plugin:'+_0x100914,_0x13a9fa);PluginEvents['on'](_0x100914,_0x412071);}};
\ No newline at end of file
+var _0xd318=['length','plugin:','./plugin.events','remove','emit','removeListener'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0xd318,0x122));var _0x8d31=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd318[_0x19e35c];return _0x3e1fe8;};'use strict';var PluginEvents=require(_0x8d31('0x0'));var events=['save',_0x8d31('0x1'),'update'];function createListener(_0x28dddf,_0x42690e){return function(_0x5cd515){_0x42690e[_0x8d31('0x2')](_0x28dddf,_0x5cd515);};}function removeListener(_0x48c449,_0x1fbe2d){return function(){PluginEvents[_0x8d31('0x3')](_0x48c449,_0x1fbe2d);};}exports['register']=function(_0x3f2bba){for(var _0x4cfbe9=0x0,_0x52ad6a=events[_0x8d31('0x4')];_0x4cfbe9<_0x52ad6a;_0x4cfbe9++){var _0x3c5ba4=events[_0x4cfbe9];var _0x1ed6f0=createListener(_0x8d31('0x5')+_0x3c5ba4,_0x3f2bba);PluginEvents['on'](_0x3c5ba4,_0x1ed6f0);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x3453f8,_0x582ea6){var _0x48d4ca=function(_0x102089){while(--_0x102089){_0x3453f8['push'](_0x3453f8['shift']());}};_0x48d4ca(++_0x582ea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x121786,_0x31bd03){var _0x76a129=function(_0x22493e){while(--_0x22493e){_0x121786['push'](_0x121786['shift']());}};_0x76a129(++_0x31bd03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x524a=['sendStatus','json','error','stack','name','send','list','express','motion2','length','then','show','describe','params','catch','body','join','../../files/plugins','script','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird'];(function(_0x17a6f0,_0x405843){var _0xf83a03=function(_0x5e796b){while(--_0x5e796b){_0x17a6f0['push'](_0x17a6f0['shift']());}};_0xf83a03(++_0x405843);}(_0x524a,0xf5));var _0xa524=function(_0x37ef6a,_0x22f3d9){_0x37ef6a=_0x37ef6a-0x0;var _0x2b7867=_0x524a[_0x37ef6a];return _0x2b7867;};'use strict';var _=require(_0xa524('0x0'));var pm2=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var path=require('path');var exec=require(_0xa524('0x4'))[_0xa524('0x5')];var BPromise=require(_0xa524('0x6'));function handleEntityNotFound(_0x56ab08,_0x50ec75){return function(_0x34a665){if(!_0x34a665){_0x56ab08[_0xa524('0x7')](0x194);;}return _0x34a665;};}function respondWithResult(_0x16227b,_0x5f472f){_0x5f472f=_0x5f472f||0xc8;return function(_0x460738){if(_0x460738){return _0x16227b['status'](_0x5f472f)[_0xa524('0x8')](_0x460738);}return null;};}function handleError(_0x11aa98,_0x56849e){_0x56849e=_0x56849e||0x1f4;return function(_0x1316b0){logger[_0xa524('0x9')](_0x1316b0[_0xa524('0xa')]);if(_0x1316b0[_0xa524('0xb')]){delete _0x1316b0[_0xa524('0xb')];}_0x11aa98['status'](_0x56849e)[_0xa524('0xc')](_0x1316b0);};}function execChildProcess(){return new BPromise(function(_0x2ebea2,_0x59660a){exec('npm\x20install',function(_0x2fc0f9,_0xdbba15,_0x116fb9){logger['info'](_0xdbba15);logger['info'](_0x116fb9);if(_0x2fc0f9){logger[_0xa524('0x9')](_0x2fc0f9);return _0x59660a(_0x2fc0f9);}return _0x2ebea2(_0xdbba15);});});}exports['index']=function(_0x3f4ffc,_0x494cff){return pm2[_0xa524('0xd')]()['then'](function(_0x75bfe8){if(_0x75bfe8){var _0x281137=_['reject'](_0x75bfe8,function(_0x2d8bdb){return _0x2d8bdb[_0xa524('0xb')]===_0xa524('0xe')||_0x2d8bdb[_0xa524('0xb')]===_0xa524('0xf');});return{'rows':_0x281137,'count':_0x281137[_0xa524('0x10')]};}return null;})[_0xa524('0x11')](respondWithResult(_0x494cff,null))['catch'](handleError(_0x494cff,null));};exports[_0xa524('0x12')]=function(_0x3d8494,_0x1fd8f5){return pm2[_0xa524('0x13')](_0x3d8494[_0xa524('0x14')]['id'])[_0xa524('0x11')](respondWithResult(_0x1fd8f5,null))[_0xa524('0x11')](handleEntityNotFound(_0x1fd8f5,null))[_0xa524('0x15')](handleError(_0x1fd8f5,null));};exports['create']=function(_0x304dea,_0x20f8e1){if(_0x304dea[_0xa524('0x16')][_0xa524('0xb')]&&_0x304dea['body']['script']){var _0x40f4bd=path[_0xa524('0x17')](__dirname,_0xa524('0x18'),_0x304dea[_0xa524('0x16')][_0xa524('0x19')]);var _0x3866e2=process['cwd']();process[_0xa524('0x1a')](path[_0xa524('0x1b')](_0x40f4bd));return execChildProcess()[_0xa524('0x11')](function(_0x40fb4b){process[_0xa524('0x1a')](_0x3866e2);return pm2[_0xa524('0x1c')]({'name':_0x304dea[_0xa524('0x16')]['name'],'script':_0x40f4bd});})[_0xa524('0x11')](function(_0x221bf){pm2['dump']();return _0x221bf[0x0];})['then'](respondWithResult(_0x20f8e1,0xc9))[_0xa524('0x15')](handleError(_0x20f8e1,null));}else{return _0x20f8e1[_0xa524('0x1d')](0x1f4)[_0xa524('0xc')]({'message':_0xa524('0x1e')});}};exports[_0xa524('0x1f')]=function(_0x546060,_0x4f484a){if(_0x546060[_0xa524('0x16')]['id']){delete _0x546060[_0xa524('0x16')]['id'];}var _0x1582fa={'online':_0xa524('0x20'),'stopped':'stop'};if(_0x1582fa[_0xa524('0x21')](_0x546060[_0xa524('0x16')]['status'])){return pm2[_0x1582fa[_0x546060[_0xa524('0x16')][_0xa524('0x1d')]]](_0x546060['params']['id'])[_0xa524('0x11')](respondWithResult(_0x4f484a,0xc8))['catch'](handleError(_0x4f484a,null));}else{return _0x4f484a[_0xa524('0x1d')](0x1f4)[_0xa524('0xc')]({'message':_0xa524('0x22')});}};exports[_0xa524('0x23')]=function(_0x136e83,_0x1c706b){if(_0x136e83[_0xa524('0x16')]['id']){delete _0x136e83[_0xa524('0x16')]['id'];}if(_0x136e83[_0xa524('0x14')]['id']){return pm2['delete'](_0x136e83['params']['id'])[_0xa524('0x11')](function(_0x52dd9f){pm2['dump']();return _0x52dd9f[0x0];})[_0xa524('0x11')](respondWithResult(_0x1c706b,null))[_0xa524('0x15')](handleError(_0x1c706b,null));}else{return _0x1c706b[_0xa524('0x1d')](0x1f4)[_0xa524('0xc')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0xa8a8=['dirname','start','dump','update','restart','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','length','catch','show','describe','params','create','script','join','../../files/plugins','body','cwd','chdir'];(function(_0x64a51,_0x1c61b7){var _0x1eba45=function(_0x230cf8){while(--_0x230cf8){_0x64a51['push'](_0x64a51['shift']());}};_0x1eba45(++_0x1c61b7);}(_0xa8a8,0xec));var _0x8a8a=function(_0x57c506,_0xdc0aa2){_0x57c506=_0x57c506-0x0;var _0x1f1783=_0xa8a8[_0x57c506];return _0x1f1783;};'use strict';var _=require(_0x8a8a('0x0'));var pm2=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var path=require('path');var exec=require(_0x8a8a('0x4'))[_0x8a8a('0x5')];var BPromise=require(_0x8a8a('0x6'));function handleEntityNotFound(_0x3ed1de,_0x45515d){return function(_0x1cecd4){if(!_0x1cecd4){_0x3ed1de[_0x8a8a('0x7')](0x194);;}return _0x1cecd4;};}function respondWithResult(_0x12db82,_0x2e8193){_0x2e8193=_0x2e8193||0xc8;return function(_0x315fe9){if(_0x315fe9){return _0x12db82[_0x8a8a('0x8')](_0x2e8193)[_0x8a8a('0x9')](_0x315fe9);}return null;};}function handleError(_0x4225b9,_0xecaa6f){_0xecaa6f=_0xecaa6f||0x1f4;return function(_0x3287f5){logger['error'](_0x3287f5['stack']);if(_0x3287f5[_0x8a8a('0xa')]){delete _0x3287f5['name'];}_0x4225b9[_0x8a8a('0x8')](_0xecaa6f)[_0x8a8a('0xb')](_0x3287f5);};}function execChildProcess(){return new BPromise(function(_0x532621,_0x118380){exec(_0x8a8a('0xc'),function(_0xb13fca,_0x5e448d,_0x679da2){logger[_0x8a8a('0xd')](_0x5e448d);logger[_0x8a8a('0xd')](_0x679da2);if(_0xb13fca){logger[_0x8a8a('0xe')](_0xb13fca);return _0x118380(_0xb13fca);}return _0x532621(_0x5e448d);});});}exports['index']=function(_0x23febf,_0x4e5d74){return pm2[_0x8a8a('0xf')]()[_0x8a8a('0x10')](function(_0x787eec){if(_0x787eec){var _0x2f6e33=_[_0x8a8a('0x11')](_0x787eec,function(_0x78b0f0){return _0x78b0f0[_0x8a8a('0xa')]==='express'||_0x78b0f0[_0x8a8a('0xa')]==='motion2';});return{'rows':_0x2f6e33,'count':_0x2f6e33[_0x8a8a('0x12')]};}return null;})[_0x8a8a('0x10')](respondWithResult(_0x4e5d74,null))[_0x8a8a('0x13')](handleError(_0x4e5d74,null));};exports[_0x8a8a('0x14')]=function(_0x42e8b6,_0x5dd616){return pm2[_0x8a8a('0x15')](_0x42e8b6[_0x8a8a('0x16')]['id'])[_0x8a8a('0x10')](respondWithResult(_0x5dd616,null))[_0x8a8a('0x10')](handleEntityNotFound(_0x5dd616,null))[_0x8a8a('0x13')](handleError(_0x5dd616,null));};exports[_0x8a8a('0x17')]=function(_0x4d7a45,_0x5dc5ae){if(_0x4d7a45['body']['name']&&_0x4d7a45['body'][_0x8a8a('0x18')]){var _0x45095b=path[_0x8a8a('0x19')](__dirname,_0x8a8a('0x1a'),_0x4d7a45[_0x8a8a('0x1b')][_0x8a8a('0x18')]);var _0x242bac=process[_0x8a8a('0x1c')]();process[_0x8a8a('0x1d')](path[_0x8a8a('0x1e')](_0x45095b));return execChildProcess()[_0x8a8a('0x10')](function(_0x3aa2bb){process[_0x8a8a('0x1d')](_0x242bac);return pm2[_0x8a8a('0x1f')]({'name':_0x4d7a45[_0x8a8a('0x1b')]['name'],'script':_0x45095b});})[_0x8a8a('0x10')](function(_0x16c55b){pm2[_0x8a8a('0x20')]();return _0x16c55b[0x0];})[_0x8a8a('0x10')](respondWithResult(_0x5dc5ae,0xc9))[_0x8a8a('0x13')](handleError(_0x5dc5ae,null));}else{return _0x5dc5ae[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8a8a('0x21')]=function(_0x38c1e0,_0x2e217a){if(_0x38c1e0['body']['id']){delete _0x38c1e0['body']['id'];}var _0x2dafcd={'online':_0x8a8a('0x22'),'stopped':'stop'};if(_0x2dafcd['hasOwnProperty'](_0x38c1e0['body'][_0x8a8a('0x8')])){return pm2[_0x2dafcd[_0x38c1e0['body'][_0x8a8a('0x8')]]](_0x38c1e0[_0x8a8a('0x16')]['id'])['then'](respondWithResult(_0x2e217a,0xc8))[_0x8a8a('0x13')](handleError(_0x2e217a,null));}else{return _0x2e217a[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':_0x8a8a('0x23')});}};exports[_0x8a8a('0x24')]=function(_0x3d6594,_0x3e73b1){if(_0x3d6594[_0x8a8a('0x1b')]['id']){delete _0x3d6594['body']['id'];}if(_0x3d6594['params']['id']){return pm2['delete'](_0x3d6594[_0x8a8a('0x16')]['id'])[_0x8a8a('0x10')](function(_0x5f301e){pm2[_0x8a8a('0x20')]();return _0x5f301e[0x0];})[_0x8a8a('0x10')](respondWithResult(_0x3e73b1,null))['catch'](handleError(_0x3e73b1,null));}else{return _0x3e73b1[_0x8a8a('0x8')](0x1f4)[_0x8a8a('0xb')]({'message':_0x8a8a('0x25')});}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5891=['./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5891,0xd7));var _0x1589=function(_0x41053c,_0x3bd937){_0x41053c=_0x41053c-0x0;var _0x42c0eb=_0x5891[_0x41053c];return _0x42c0eb;};'use strict';var express=require(_0x1589('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1589('0x1'));router[_0x1589('0x2')](_0x1589('0x3'),auth[_0x1589('0x4')](),controller[_0x1589('0x5')]);router[_0x1589('0x2')](_0x1589('0x6'),auth[_0x1589('0x4')](),controller['getQueues']);module[_0x1589('0x7')]=router;
\ No newline at end of file
+var _0x6992=['Router','../../components/auth/service','get','/agents','isAuthenticated','/queues','getQueues','exports','express'];(function(_0x3642fd,_0x4314d5){var _0xcac32d=function(_0x3dd09e){while(--_0x3dd09e){_0x3642fd['push'](_0x3642fd['shift']());}};_0xcac32d(++_0x4314d5);}(_0x6992,0x1ee));var _0x2699=function(_0x463b62,_0x162fe4){_0x463b62=_0x463b62-0x0;var _0x5ac602=_0x6992[_0x463b62];return _0x5ac602;};'use strict';var express=require(_0x2699('0x0'));var router=express[_0x2699('0x1')]();var auth=require(_0x2699('0x2'));var controller=require('./realtime.controller');router[_0x2699('0x3')](_0x2699('0x4'),auth[_0x2699('0x5')](),controller['getAgents']);router[_0x2699('0x3')](_0x2699('0x6'),auth[_0x2699('0x5')](),controller[_0x2699('0x7')]);module[_0x2699('0x8')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc474=['literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','agent','online','extraQueryConditions','assign','UserProfile','getResources','find','filterAgentAttributes','getAgentStatus','voice','voiceStatus','talking','pause','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','format','startCase','key','name','dialMethod','join','outbound','QueueCampaigns','Queues','filter','findAndCountAll','lodash','util','../../components/realtime/queues','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','*pause','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','order','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','fieldName','type','role','getOptions','raw','push','sequelize'];(function(_0x13b286,_0x5e6b50){var _0x48ab45=function(_0x4820f7){while(--_0x4820f7){_0x13b286['push'](_0x13b286['shift']());}};_0x48ab45(++_0x5e6b50);}(_0xc474,0x11e));var _0x4c47=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xc474[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x4c47('0x0'));var util=require(_0x4c47('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x4c47('0x2'));var qs=require('../../components/parsers/qs');var utils=require(_0x4c47('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x4c47('0x4'))[_0x4c47('0x5')];var APIHandleError=require(_0x4c47('0x4'))[_0x4c47('0x6')];function respondWithFilteredResult(_0xbc55ca,_0x39cc16){return function(_0x30c085){if(_0x30c085){var _0x5375f3=typeof _0x39cc16[_0x4c47('0x7')]==='undefined'&&typeof _0x39cc16[_0x4c47('0x8')]===_0x4c47('0x9');var _0x5e0cd5=_0x30c085[_0x4c47('0xa')];var _0x14d558=_0x5375f3?0x0:_0x39cc16[_0x4c47('0x7')];var _0x5b1e67=_0x5375f3?_0x30c085[_0x4c47('0xa')]:_0x39cc16[_0x4c47('0x7')]+_0x39cc16['limit'];var _0x220b98;if(_0x5b1e67>=_0x5e0cd5){_0x5b1e67=_0x5e0cd5;_0x220b98=0xc8;}else{_0x220b98=0xce;}_0xbc55ca[_0x4c47('0xb')](_0x220b98);return _0xbc55ca[_0x4c47('0xc')](_0x4c47('0xd'),_0x14d558+'-'+_0x5b1e67+'/'+_0x5e0cd5)[_0x4c47('0xe')](_0x30c085);}return null;};}exports[_0x4c47('0xf')]=function(_0x43f98a,_0x50fba0){var _0x55270c={'count':0x0,'rows':[]};var _0x140781={};var _0x4bc091;var _0xb7a9ed=utils[_0x4c47('0x10')]();var _0x52506b;var _0x2d7aa4;var _0x400520=_0x43f98a[_0x4c47('0x11')][_0x4c47('0x12')];var _0x31ebee=_0x43f98a[_0x4c47('0x11')][_0x4c47('0x13')];var _0x519da6=_0x43f98a[_0x4c47('0x11')]['pauseTypeFilter'];var _0x282cfd=_0x31ebee==='pause'||_0x31ebee===_0x4c47('0x14')?!![]:![];var _0x371967=[];var _0x169c00;var _0x100c3e;Promise[_0x4c47('0x15')]()['then'](function(){if(_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')]){if(!utils[_0x4c47('0x17')](_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')])){throw new APIBadRequestError(util['format'](_0x4c47('0x18'),_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')]));}_0x4bc091=_0x43f98a[_0x4c47('0x11')][_0x4c47('0x16')][_0x4c47('0x19')]();}if(!_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')]||!_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')][_0x4c47('0x1b')](_0x4c47('0x1c'))){_0x43f98a['query'][_0x4c47('0x1a')]=rta[_0x4c47('0x1d')](_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')]);return;}var _0x49f818=rta['getUpdatedSortOptions'](_0x43f98a[_0x4c47('0x11')][_0x4c47('0x1a')]);_0x43f98a[_0x4c47('0x11')]['sort']=_0x49f818[_0x4c47('0x1e')]['join'](',');_0x169c00=_0x49f818[_0x4c47('0x1f')];})[_0x4c47('0x20')](function(){if(!_0x400520){return[];}return rta['getAgentIdsByQueues'](_0x400520,_0x4bc091);})[_0x4c47('0x20')](function(_0x5e73ab){_0x371967=_0x5e73ab;return rta[_0x4c47('0x21')]();})[_0x4c47('0x20')](function(_0x50e060){_0x2d7aa4=_0x50e060[_0x4c47('0x22')];if((!_0x31ebee||_0x282cfd)&&!_0x169c00){return _0x371967;}if(_0x169c00&&!_0x31ebee){return rta[_0x4c47('0x23')](_0x2d7aa4,_0x371967,_0x169c00);}else{return rta['getAgentIdsByStatus'](_0x2d7aa4,_0x371967,_0x31ebee);}})[_0x4c47('0x20')](function(_0x13e917){_0x371967=_0x13e917;var _0x142339=![];if(_0x371967[_0x4c47('0x24')]===0x0){if(_0x400520||_0x31ebee){_0x142339=!![];}if(_0x282cfd){_0x142339=![];}}if(_0x142339){return _0x55270c;}var _0x1704e6=_[_0x4c47('0x25')](db[_0x4c47('0x26')]['rawAttributes'],function(_0x3cd67b){return{'name':_0x3cd67b[_0x4c47('0x27')],'type':_0x3cd67b[_0x4c47('0x28')]['key']};});_0x43f98a[_0x4c47('0x11')][_0x4c47('0x29')]='agent';_0x140781=qs[_0x4c47('0x2a')](_0x1704e6,_0x43f98a);_0x140781[_0x4c47('0x2b')]=!![];var _0x549702=[];if(_0x371967[_0x4c47('0x24')]>0x0){_0x549702[_0x4c47('0x2c')]({'id':{'$in':_0x371967}});if(_0x169c00&&!_0x31ebee){_0x100c3e=[db[_0x4c47('0x2d')][_0x4c47('0x2e')](_0x4c47('0x2f')+_0x371967+')')];_0x140781[_0x4c47('0x1f')]=_0x100c3e;}}if(_0x282cfd){_0xb7a9ed[_0x4c47('0x30')](function(_0x490073){var _0x501833=!![];if(_0x31ebee===_0x4c47('0x14')&&_0x4bc091!==_0x490073){_0x501833=![];}_0x549702['push']({[_0x490073+_0x4c47('0x31')]:_0x501833});});if(_0x519da6){_0x549702[_0x4c47('0x2c')]({'pauseType':_0x519da6});}}else if(_0x31ebee){_0xb7a9ed[_0x4c47('0x30')](function(_0x2a49be){_0x549702[_0x4c47('0x2c')]({[_0x2a49be+'Pause']:![]});});}_0x140781[_0x4c47('0x32')]=_[_0x4c47('0x33')](_0x140781['where'],{'$and':_0x549702});if(_0x43f98a[_0x4c47('0x34')][_0x4c47('0x29')]===_0x4c47('0x34')){var _0x4b9c1d={'params':{'id':_0x43f98a[_0x4c47('0x34')][_0x4c47('0x35')]},'query':{'section':'Agents','role':_0x4c47('0x36'),'raw':!![],'ids':_0x371967,'customSorting':_0x100c3e}};if(_0x43f98a[_0x4c47('0x11')]['online']){_0x4b9c1d[_0x4c47('0x11')][_0x4c47('0x37')]=!![];}if(_0x282cfd){_0x4b9c1d[_0x4c47('0x11')][_0x4c47('0x38')]=_0x549702;}_0x4b9c1d[_0x4c47('0x11')]=Object[_0x4c47('0x39')](_0x4b9c1d[_0x4c47('0x11')],_0x43f98a[_0x4c47('0x11')]);return db[_0x4c47('0x3a')][_0x4c47('0x3b')](_0x4b9c1d);}return db[_0x4c47('0x26')]['findAndCountAll'](_0x140781);})['then'](function(_0x1197fa){_0x55270c['count']=_0x1197fa[_0x4c47('0xa')];_0x52506b=_0x1197fa[_0x4c47('0x22')];return _0x52506b[_0x4c47('0x25')](function(_0x481cb9){var _0x49a5e5=_[_0x4c47('0x3c')](_0x2d7aa4,['id',_0x481cb9['id']]);if(_0x49a5e5){var _0x2e4a99=rta[_0x4c47('0x3d')](_0x49a5e5);_[_0x4c47('0x33')](_0x481cb9,_0x2e4a99);}_0x481cb9['globalStatus']=rta[_0x4c47('0x3e')](_0x481cb9);if(_0x481cb9['globalStatus'][_0x4c47('0x1b')]('pause')){_0xb7a9ed['forEach'](function(_0x4ea728){if(_0x481cb9[_0x4ea728+_0x4c47('0x31')]){if(_0x4ea728===_0x4c47('0x3f')){if(_0x481cb9[_0x4c47('0x40')]!==_0x4c47('0x41')){_0x481cb9['voiceStatus']=_0x4c47('0x42');}}else{_0x481cb9[_0x4ea728+_0x4c47('0x43')]=_0x4c47('0x42');}}});}return _0x481cb9;});})[_0x4c47('0x20')](function(_0x434f86){if(!_0x169c00||_0x100c3e){return _0x434f86;}return rta['sortAgentsByStatus'](_0x434f86,_0x169c00);})['then'](function(_0x5c6f48){var _0x2954aa=rta[_0x4c47('0x44')]();_0x55270c['rows']=_0x5c6f48['map'](function(_0x3ece7b){return _[_0x4c47('0x45')](_0x3ece7b,_0x2954aa);});return _0x55270c;})[_0x4c47('0x20')](respondWithFilteredResult(_0x50fba0,_0x140781))[_0x4c47('0x46')](APIHandleError(_0x50fba0));};exports[_0x4c47('0x47')]=function(_0x3f2970,_0x19943d){var _0x158190={'count':0x0,'rows':[]};var _0x155209={};var _0x5aff98;var _0x13cfe8;var _0x4ea6e5;Promise[_0x4c47('0x15')]()[_0x4c47('0x20')](function(){if(_0x3f2970['query'][_0x4c47('0x16')]){if(!utils[_0x4c47('0x17')](_0x3f2970[_0x4c47('0x11')][_0x4c47('0x16')])){throw new APIBadRequestError(util[_0x4c47('0x48')](_0x4c47('0x18'),_0x3f2970[_0x4c47('0x11')][_0x4c47('0x16')]));}_0x5aff98=_0x3f2970[_0x4c47('0x11')][_0x4c47('0x16')][_0x4c47('0x19')]();}var _0x2c3d90=_[_0x4c47('0x49')](_0x5aff98)+'Queue';var _0x73074a=_[_0x4c47('0x25')](db[_0x2c3d90]['rawAttributes'],function(_0x119f4){return{'name':_0x119f4[_0x4c47('0x27')],'type':_0x119f4['type'][_0x4c47('0x4a')]};});if(!_0x3f2970[_0x4c47('0x11')][_0x4c47('0x1e')]){var _0x21b6d2=['id',_0x4c47('0x4b')];if(_0x5aff98==='voice'){_0x21b6d2[_0x4c47('0x2c')]('type');if(_0x3f2970[_0x4c47('0x11')][_0x4c47('0x28')]==='outbound'){_0x21b6d2[_0x4c47('0x2c')](['dialActive',_0x4c47('0x4c')]);}}_0x3f2970[_0x4c47('0x11')][_0x4c47('0x1e')]=_0x21b6d2[_0x4c47('0x4d')](',');}_0x155209=qs[_0x4c47('0x2a')](_0x73074a,_0x3f2970);if(_0x3f2970[_0x4c47('0x34')][_0x4c47('0x29')]==='user'){var _0x158498={'params':{'id':_0x3f2970['user'][_0x4c47('0x35')]},'query':{'section':_0x5aff98===_0x4c47('0x3f')&&_0x3f2970[_0x4c47('0x11')][_0x4c47('0x28')]===_0x4c47('0x4e')?_0x4c47('0x4f'):_['startCase'](_0x5aff98)+_0x4c47('0x50'),'type':_0x3f2970[_0x4c47('0x11')]['type'],'nolimit':!![],'sort':_0x4c47('0x4b'),'filter':_0x3f2970[_0x4c47('0x11')][_0x4c47('0x51')]}};_0x158498[_0x4c47('0x11')]=Object['assign'](_0x158498['query'],_0x3f2970['query']);delete _0x158498['query']['id'];return db[_0x4c47('0x3a')][_0x4c47('0x3b')](_0x158498);}return db[_0x2c3d90][_0x4c47('0x52')](_0x155209);})[_0x4c47('0x20')](function(_0x481812){_0x158190[_0x4c47('0xa')]=_0x481812[_0x4c47('0xa')];_0x13cfe8=_0x481812[_0x4c47('0x22')];return rtq['getRealtimeQueues'](_0x3f2970,_0x5aff98);})['then'](function(_0x26a94f){_0x4ea6e5=_0x26a94f[_0x4c47('0x22')];return rtq['initializeQueues'](_0x13cfe8,_0x4ea6e5,_0x5aff98,_0x3f2970[_0x4c47('0x11')]['type']);})[_0x4c47('0x20')](function(_0x515afb){_0x158190[_0x4c47('0x22')]=_0x515afb;return _0x158190;})[_0x4c47('0x20')](respondWithFilteredResult(_0x19943d,_0x155209))[_0x4c47('0x46')](APIHandleError(_0x19943d));};
\ No newline at end of file
+var _0xa162=['../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','limit','undefined','count','status','set','Content-Range','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','raw','push','sequelize','FIELD(id,','forEach','Pause','merge','where','user','Agents','agent','online','extraQueryConditions','getResources','findAndCountAll','map','find','filterAgentAttributes','getAgentStatus','pause','voiceStatus','talking','pick','catch','getQueues','name','outbound','dialActive','dialMethod','join','getOptions','userProfileId','voice','QueueCampaigns','startCase','Queues','filter','assign','UserProfile','getRealtimeQueues','lodash','util','../../components/realtime/queues'];(function(_0x11939a,_0xfde31c){var _0x27ec68=function(_0x5a7d8e){while(--_0x5a7d8e){_0x11939a['push'](_0x11939a['shift']());}};_0x27ec68(++_0xfde31c);}(_0xa162,0x151));var _0x2a16=function(_0x5420cd,_0x270cc2){_0x5420cd=_0x5420cd-0x0;var _0x30dd37=_0xa162[_0x5420cd];return _0x30dd37;};'use strict';var _=require(_0x2a16('0x0'));var util=require(_0x2a16('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x2a16('0x2'));var qs=require(_0x2a16('0x3'));var utils=require(_0x2a16('0x4'));var db=require(_0x2a16('0x5'))['db'];var APIBadRequestError=require(_0x2a16('0x6'))[_0x2a16('0x7')];var APIHandleError=require(_0x2a16('0x6'))['handleError'];function respondWithFilteredResult(_0x269ece,_0x10a241){return function(_0x17b326){if(_0x17b326){var _0x5e2c69=typeof _0x10a241[_0x2a16('0x8')]==='undefined'&&typeof _0x10a241[_0x2a16('0x9')]===_0x2a16('0xa');var _0x21b8bf=_0x17b326['count'];var _0x52fe52=_0x5e2c69?0x0:_0x10a241[_0x2a16('0x8')];var _0x42ee60=_0x5e2c69?_0x17b326[_0x2a16('0xb')]:_0x10a241[_0x2a16('0x8')]+_0x10a241[_0x2a16('0x9')];var _0x563fbc;if(_0x42ee60>=_0x21b8bf){_0x42ee60=_0x21b8bf;_0x563fbc=0xc8;}else{_0x563fbc=0xce;}_0x269ece[_0x2a16('0xc')](_0x563fbc);return _0x269ece[_0x2a16('0xd')](_0x2a16('0xe'),_0x52fe52+'-'+_0x42ee60+'/'+_0x21b8bf)['json'](_0x17b326);}return null;};}exports[_0x2a16('0xf')]=function(_0x38075d,_0x12b083){var _0x36dd93={'count':0x0,'rows':[]};var _0x49210c={};var _0x21f127;var _0x1cd758=utils[_0x2a16('0x10')]();var _0x4b0b68;var _0x974847;var _0x33fb74=_0x38075d[_0x2a16('0x11')]['globalQueueFilter'];var _0x58b2d1=_0x38075d[_0x2a16('0x11')][_0x2a16('0x12')];var _0x4d85ec=_0x38075d['query'][_0x2a16('0x13')];var _0x5c2011=_0x58b2d1==='pause'||_0x58b2d1===_0x2a16('0x14')?!![]:![];var _0x5b7971=[];var _0x2e5316;var _0x3e8a49;Promise[_0x2a16('0x15')]()[_0x2a16('0x16')](function(){if(_0x38075d[_0x2a16('0x11')]['channel']){if(!utils[_0x2a16('0x17')](_0x38075d[_0x2a16('0x11')][_0x2a16('0x18')])){throw new APIBadRequestError(util[_0x2a16('0x19')](_0x2a16('0x1a'),_0x38075d[_0x2a16('0x11')]['channel']));}_0x21f127=_0x38075d[_0x2a16('0x11')]['channel'][_0x2a16('0x1b')]();}if(!_0x38075d[_0x2a16('0x11')][_0x2a16('0x1c')]||!_0x38075d[_0x2a16('0x11')][_0x2a16('0x1c')]['includes'](_0x2a16('0x1d'))){_0x38075d[_0x2a16('0x11')][_0x2a16('0x1c')]=rta['validateSortParameter'](_0x38075d[_0x2a16('0x11')][_0x2a16('0x1c')]);return;}var _0x2bcee6=rta[_0x2a16('0x1e')](_0x38075d['query'][_0x2a16('0x1c')]);_0x38075d[_0x2a16('0x11')][_0x2a16('0x1c')]=_0x2bcee6[_0x2a16('0x1f')]['join'](',');_0x2e5316=_0x2bcee6[_0x2a16('0x20')];})[_0x2a16('0x16')](function(){if(!_0x33fb74){return[];}return rta[_0x2a16('0x21')](_0x33fb74,_0x21f127);})[_0x2a16('0x16')](function(_0xe3ee6d){_0x5b7971=_0xe3ee6d;return rta[_0x2a16('0x22')]();})[_0x2a16('0x16')](function(_0x160ce0){_0x974847=_0x160ce0[_0x2a16('0x23')];if((!_0x58b2d1||_0x5c2011)&&!_0x2e5316){return _0x5b7971;}if(_0x2e5316&&!_0x58b2d1){return rta[_0x2a16('0x24')](_0x974847,_0x5b7971,_0x2e5316);}else{return rta[_0x2a16('0x25')](_0x974847,_0x5b7971,_0x58b2d1);}})['then'](function(_0x18eb10){_0x5b7971=_0x18eb10;var _0x5bf42e=![];if(_0x5b7971[_0x2a16('0x26')]===0x0){if(_0x33fb74||_0x58b2d1){_0x5bf42e=!![];}if(_0x5c2011){_0x5bf42e=![];}}if(_0x5bf42e){return _0x36dd93;}var _0x5b2617=_['map'](db[_0x2a16('0x27')][_0x2a16('0x28')],function(_0x562a47){return{'name':_0x562a47[_0x2a16('0x29')],'type':_0x562a47[_0x2a16('0x2a')][_0x2a16('0x2b')]};});_0x38075d['query'][_0x2a16('0x2c')]='agent';_0x49210c=qs['getOptions'](_0x5b2617,_0x38075d);_0x49210c[_0x2a16('0x2d')]=!![];var _0x10c9d5=[];if(_0x5b7971[_0x2a16('0x26')]>0x0){_0x10c9d5[_0x2a16('0x2e')]({'id':{'$in':_0x5b7971}});if(_0x2e5316&&!_0x58b2d1){_0x3e8a49=[db[_0x2a16('0x2f')]['literal'](_0x2a16('0x30')+_0x5b7971+')')];_0x49210c[_0x2a16('0x20')]=_0x3e8a49;}}if(_0x5c2011){_0x1cd758[_0x2a16('0x31')](function(_0x20cbf0){var _0x1b3911=!![];if(_0x58b2d1===_0x2a16('0x14')&&_0x21f127!==_0x20cbf0){_0x1b3911=![];}_0x10c9d5[_0x2a16('0x2e')]({[_0x20cbf0+_0x2a16('0x32')]:_0x1b3911});});if(_0x4d85ec){_0x10c9d5['push']({'pauseType':_0x4d85ec});}}else if(_0x58b2d1){_0x1cd758['forEach'](function(_0x43f42d){_0x10c9d5['push']({[_0x43f42d+_0x2a16('0x32')]:![]});});}_0x49210c['where']=_[_0x2a16('0x33')](_0x49210c[_0x2a16('0x34')],{'$and':_0x10c9d5});if(_0x38075d[_0x2a16('0x35')][_0x2a16('0x2c')]===_0x2a16('0x35')){var _0x25c5ca={'params':{'id':_0x38075d[_0x2a16('0x35')]['userProfileId']},'query':{'section':_0x2a16('0x36'),'role':_0x2a16('0x37'),'raw':!![],'ids':_0x5b7971,'customSorting':_0x3e8a49}};if(_0x38075d[_0x2a16('0x11')]['online']){_0x25c5ca['query'][_0x2a16('0x38')]=!![];}if(_0x5c2011){_0x25c5ca[_0x2a16('0x11')][_0x2a16('0x39')]=_0x10c9d5;}_0x25c5ca['query']=Object['assign'](_0x25c5ca[_0x2a16('0x11')],_0x38075d[_0x2a16('0x11')]);return db['UserProfile'][_0x2a16('0x3a')](_0x25c5ca);}return db[_0x2a16('0x27')][_0x2a16('0x3b')](_0x49210c);})['then'](function(_0x53160a){_0x36dd93[_0x2a16('0xb')]=_0x53160a[_0x2a16('0xb')];_0x4b0b68=_0x53160a[_0x2a16('0x23')];return _0x4b0b68[_0x2a16('0x3c')](function(_0xef7c35){var _0x9dffaf=_[_0x2a16('0x3d')](_0x974847,['id',_0xef7c35['id']]);if(_0x9dffaf){var _0x9c33cc=rta[_0x2a16('0x3e')](_0x9dffaf);_['merge'](_0xef7c35,_0x9c33cc);}_0xef7c35[_0x2a16('0x1d')]=rta[_0x2a16('0x3f')](_0xef7c35);if(_0xef7c35[_0x2a16('0x1d')]['includes'](_0x2a16('0x40'))){_0x1cd758[_0x2a16('0x31')](function(_0x29b787){if(_0xef7c35[_0x29b787+_0x2a16('0x32')]){if(_0x29b787==='voice'){if(_0xef7c35[_0x2a16('0x41')]!==_0x2a16('0x42')){_0xef7c35[_0x2a16('0x41')]=_0x2a16('0x40');}}else{_0xef7c35[_0x29b787+'Status']=_0x2a16('0x40');}}});}return _0xef7c35;});})[_0x2a16('0x16')](function(_0x2cbce1){if(!_0x2e5316||_0x3e8a49){return _0x2cbce1;}return rta['sortAgentsByStatus'](_0x2cbce1,_0x2e5316);})['then'](function(_0x405d6e){var _0x305b98=rta['getRealtimeAgentsQueryFields']();_0x36dd93['rows']=_0x405d6e[_0x2a16('0x3c')](function(_0x263d43){return _[_0x2a16('0x43')](_0x263d43,_0x305b98);});return _0x36dd93;})[_0x2a16('0x16')](respondWithFilteredResult(_0x12b083,_0x49210c))[_0x2a16('0x44')](APIHandleError(_0x12b083));};exports[_0x2a16('0x45')]=function(_0x45539a,_0x506747){var _0x127070={'count':0x0,'rows':[]};var _0x23bba2={};var _0x2e2ff3;var _0x3bcac8;var _0x81869e;Promise[_0x2a16('0x15')]()['then'](function(){if(_0x45539a[_0x2a16('0x11')]['channel']){if(!utils['isValidChannel'](_0x45539a[_0x2a16('0x11')][_0x2a16('0x18')])){throw new APIBadRequestError(util[_0x2a16('0x19')](_0x2a16('0x1a'),_0x45539a[_0x2a16('0x11')][_0x2a16('0x18')]));}_0x2e2ff3=_0x45539a['query']['channel'][_0x2a16('0x1b')]();}var _0x461789=_['startCase'](_0x2e2ff3)+'Queue';var _0x54cbcb=_[_0x2a16('0x3c')](db[_0x461789][_0x2a16('0x28')],function(_0x46ae96){return{'name':_0x46ae96['fieldName'],'type':_0x46ae96[_0x2a16('0x2a')]['key']};});if(!_0x45539a[_0x2a16('0x11')][_0x2a16('0x1f')]){var _0x914eef=['id',_0x2a16('0x46')];if(_0x2e2ff3==='voice'){_0x914eef[_0x2a16('0x2e')]('type');if(_0x45539a['query'][_0x2a16('0x2a')]===_0x2a16('0x47')){_0x914eef['push']([_0x2a16('0x48'),_0x2a16('0x49')]);}}_0x45539a[_0x2a16('0x11')]['fields']=_0x914eef[_0x2a16('0x4a')](',');}_0x23bba2=qs[_0x2a16('0x4b')](_0x54cbcb,_0x45539a);if(_0x45539a[_0x2a16('0x35')][_0x2a16('0x2c')]===_0x2a16('0x35')){var _0x30022a={'params':{'id':_0x45539a['user'][_0x2a16('0x4c')]},'query':{'section':_0x2e2ff3===_0x2a16('0x4d')&&_0x45539a[_0x2a16('0x11')][_0x2a16('0x2a')]==='outbound'?_0x2a16('0x4e'):_[_0x2a16('0x4f')](_0x2e2ff3)+_0x2a16('0x50'),'type':_0x45539a[_0x2a16('0x11')][_0x2a16('0x2a')],'nolimit':!![],'sort':_0x2a16('0x46'),'filter':_0x45539a[_0x2a16('0x11')][_0x2a16('0x51')]}};_0x30022a[_0x2a16('0x11')]=Object[_0x2a16('0x52')](_0x30022a[_0x2a16('0x11')],_0x45539a[_0x2a16('0x11')]);delete _0x30022a['query']['id'];return db[_0x2a16('0x53')][_0x2a16('0x3a')](_0x30022a);}return db[_0x461789][_0x2a16('0x3b')](_0x23bba2);})[_0x2a16('0x16')](function(_0x4d4d13){_0x127070[_0x2a16('0xb')]=_0x4d4d13[_0x2a16('0xb')];_0x3bcac8=_0x4d4d13[_0x2a16('0x23')];return rtq[_0x2a16('0x54')](_0x45539a,_0x2e2ff3);})[_0x2a16('0x16')](function(_0x57c799){_0x81869e=_0x57c799['rows'];return rtq['initializeQueues'](_0x3bcac8,_0x81869e,_0x2e2ff3,_0x45539a['query']['type']);})[_0x2a16('0x16')](function(_0x45ca04){_0x127070[_0x2a16('0x23')]=_0x45ca04;return _0x127070;})[_0x2a16('0x16')](respondWithFilteredResult(_0x506747,_0x23bba2))['catch'](APIHandleError(_0x506747));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2ecea0,_0x36a83d){var _0x17ab22=function(_0x768e97){while(--_0x768e97){_0x2ecea0['push'](_0x2ecea0['shift']());}};_0x17ab22(++_0x36a83d);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x37ab23,_0x68b29){var _0xf8201f=function(_0x526d12){while(--_0x526d12){_0x37ab23['push'](_0x37ab23['shift']());}};_0xf8201f(++_0x68b29);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xcb91[_0x2a5099];return _0x2802f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac6a=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x2d59b7,_0x560fee){var _0x29da6b=function(_0x284bf3){while(--_0x284bf3){_0x2d59b7['push'](_0x2d59b7['shift']());}};_0x29da6b(++_0x560fee);}(_0xac6a,0xc2));var _0xaac6=function(_0xf120cd,_0xa89096){_0xf120cd=_0xf120cd-0x0;var _0xa3660b=_0xac6a[_0xf120cd];return _0xa3660b;};'use strict';var Sequelize=require(_0xaac6('0x0'));module[_0xaac6('0x1')]={'state':{'type':Sequelize[_0xaac6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xaac6('0x3')]},'scheduledat':{'type':Sequelize[_0xaac6('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaac6('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xaac6('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xaac6('0x3')]},'campaigntype':{'type':Sequelize[_0xaac6('0x3')]},'membername':{'type':Sequelize[_0xaac6('0x3')]}};
\ No newline at end of file
+var _0xbac8=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xbac8,0x140));var _0x8bac=function(_0x4f1aea,_0x1d38c0){_0x4f1aea=_0x4f1aea-0x0;var _0x3efceb=_0xbac8[_0x4f1aea];return _0x3efceb;};'use strict';var Sequelize=require(_0x8bac('0x0'));module[_0x8bac('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x8bac('0x2')]},'uniqueid':{'type':Sequelize[_0x8bac('0x3')]},'starttime':{'type':Sequelize[_0x8bac('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8bac('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8bac('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3629=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x3689fd,_0x47e501){var _0x507da5=function(_0x47966b){while(--_0x47966b){_0x3689fd['push'](_0x3689fd['shift']());}};_0x507da5(++_0x47e501);}(_0x3629,0x1be));var _0x9362=function(_0x3d6fa8,_0x44ba79){_0x3d6fa8=_0x3d6fa8-0x0;var _0x3e158a=_0x3629[_0x3d6fa8];return _0x3e158a;};'use strict';var _=require(_0x9362('0x0'));var util=require(_0x9362('0x1'));var logger=require(_0x9362('0x2'))('api');var moment=require(_0x9362('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9362('0x4'));var rimraf=require(_0x9362('0x5'));var config=require(_0x9362('0x6'));var attributes=require(_0x9362('0x7'));module[_0x9362('0x8')]=function(_0x981001,_0x295d26){return _0x981001[_0x9362('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf05d=['ReportAgentPreview','report_agent_preview','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x303074,_0x1c1b0d){var _0x3a0f26=function(_0x3043ff){while(--_0x3043ff){_0x303074['push'](_0x303074['shift']());}};_0x3a0f26(++_0x1c1b0d);}(_0xf05d,0x1b2));var _0xdf05=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf05d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf05('0x0'))(_0xdf05('0x1'));var moment=require(_0xdf05('0x2'));var BPromise=require(_0xdf05('0x3'));var rp=require(_0xdf05('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf05('0x5'));var config=require(_0xdf05('0x6'));var attributes=require(_0xdf05('0x7'));module[_0xdf05('0x8')]=function(_0x101924,_0x4de43f){return _0x101924[_0xdf05('0x9')](_0xdf05('0xa'),attributes,{'tableName':_0xdf05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c9e=['catch','CreateReportAgentPreview','create','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result'];(function(_0x42853b,_0x503b0f){var _0x37592f=function(_0x76b01d){while(--_0x76b01d){_0x42853b['push'](_0x42853b['shift']());}};_0x37592f(++_0x503b0f);}(_0x9c9e,0x19c));var _0xe9c9=function(_0x4bb49c,_0x5b71f0){_0x4bb49c=_0x4bb49c-0x0;var _0x39ea85=_0x9c9e[_0x4bb49c];return _0x39ea85;};'use strict';var _=require(_0xe9c9('0x0'));var util=require(_0xe9c9('0x1'));var moment=require(_0xe9c9('0x2'));var BPromise=require(_0xe9c9('0x3'));var rs=require(_0xe9c9('0x4'));var fs=require('fs');var Redis=require(_0xe9c9('0x5'));var db=require(_0xe9c9('0x6'))['db'];var utils=require(_0xe9c9('0x7'));var logger=require(_0xe9c9('0x8'))(_0xe9c9('0x9'));var config=require('../../config/environment');var jayson=require(_0xe9c9('0xa'));var client=jayson['client'][_0xe9c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x276ae5,_0x5dd1d5,_0x24f30f){return new BPromise(function(_0x3b918b,_0x375eb7){return client[_0xe9c9('0xc')](_0x276ae5,_0x24f30f)['then'](function(_0x1df4f2){logger[_0xe9c9('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5dd1d5,_0xe9c9('0xe'));logger[_0xe9c9('0xf')](_0xe9c9('0x10'),_0x5dd1d5,_0xe9c9('0xe'),JSON[_0xe9c9('0x11')](_0x1df4f2));if(_0x1df4f2[_0xe9c9('0x12')]){if(_0x1df4f2['error'][_0xe9c9('0x13')]===0x1f4){logger[_0xe9c9('0x12')](_0xe9c9('0x14'),_0x5dd1d5,_0x1df4f2[_0xe9c9('0x12')]['message']);return _0x375eb7(_0x1df4f2[_0xe9c9('0x12')]['message']);}logger[_0xe9c9('0x12')](_0xe9c9('0x14'),_0x5dd1d5,_0x1df4f2[_0xe9c9('0x12')][_0xe9c9('0x15')]);return _0x3b918b(_0x1df4f2[_0xe9c9('0x12')][_0xe9c9('0x15')]);}else{logger[_0xe9c9('0xd')](_0xe9c9('0x14'),_0x5dd1d5,_0xe9c9('0xe'));_0x3b918b(_0x1df4f2[_0xe9c9('0x16')][_0xe9c9('0x15')]);}})[_0xe9c9('0x17')](function(_0x1339f2){logger[_0xe9c9('0x12')](_0xe9c9('0x14'),_0x5dd1d5,_0x1339f2);_0x375eb7(_0x1339f2);});});}exports[_0xe9c9('0x18')]=function(_0x97be4){var _0x2a451f=this;return new Promise(function(_0x1585bc,_0x395b62){return db['ReportAgentPreview'][_0xe9c9('0x19')](_0x97be4[_0xe9c9('0x1a')],{'raw':_0x97be4[_0xe9c9('0x1b')]?_0x97be4['options']['raw']===undefined?!![]:![]:!![]})[_0xe9c9('0x1c')](function(_0x504b62){logger[_0xe9c9('0xd')](_0xe9c9('0x18'),_0x97be4);logger['debug']('CreateReportAgentPreview',_0x97be4,JSON['stringify'](_0x504b62));_0x1585bc(_0x504b62);})[_0xe9c9('0x17')](function(_0x30fb33){logger[_0xe9c9('0x12')]('CreateReportAgentPreview',_0x30fb33[_0xe9c9('0x15')],_0x97be4);_0x395b62(_0x2a451f[_0xe9c9('0x12')](0x1f4,_0x30fb33[_0xe9c9('0x15')]));});});};
\ No newline at end of file
+var _0x29b7=['catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0x29b7,0x1e8));var _0x729b=function(_0x44cdc9,_0x55731e){_0x44cdc9=_0x44cdc9-0x0;var _0x4c25d0=_0x29b7[_0x44cdc9];return _0x4c25d0;};'use strict';var _=require(_0x729b('0x0'));var util=require(_0x729b('0x1'));var moment=require('moment');var BPromise=require(_0x729b('0x2'));var rs=require(_0x729b('0x3'));var fs=require('fs');var Redis=require(_0x729b('0x4'));var db=require(_0x729b('0x5'))['db'];var utils=require(_0x729b('0x6'));var logger=require(_0x729b('0x7'))(_0x729b('0x8'));var config=require(_0x729b('0x9'));var jayson=require(_0x729b('0xa'));var client=jayson['client'][_0x729b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ac3a6,_0x18c5c4,_0xa8debf){return new BPromise(function(_0x52e5db,_0x3948d8){return client[_0x729b('0xc')](_0x1ac3a6,_0xa8debf)[_0x729b('0xd')](function(_0x31d7d6){logger['info'](_0x729b('0xe'),_0x18c5c4,_0x729b('0xf'));logger[_0x729b('0x10')](_0x729b('0x11'),_0x18c5c4,'request\x20sent',JSON[_0x729b('0x12')](_0x31d7d6));if(_0x31d7d6[_0x729b('0x13')]){if(_0x31d7d6[_0x729b('0x13')]['code']===0x1f4){logger['error'](_0x729b('0xe'),_0x18c5c4,_0x31d7d6[_0x729b('0x13')][_0x729b('0x14')]);return _0x3948d8(_0x31d7d6[_0x729b('0x13')][_0x729b('0x14')]);}logger['error'](_0x729b('0xe'),_0x18c5c4,_0x31d7d6[_0x729b('0x13')][_0x729b('0x14')]);return _0x52e5db(_0x31d7d6[_0x729b('0x13')]['message']);}else{logger['info'](_0x729b('0xe'),_0x18c5c4,_0x729b('0xf'));_0x52e5db(_0x31d7d6[_0x729b('0x15')][_0x729b('0x14')]);}})[_0x729b('0x16')](function(_0x435c0d){logger['error'](_0x729b('0xe'),_0x18c5c4,_0x435c0d);_0x3948d8(_0x435c0d);});});}exports[_0x729b('0x17')]=function(_0x3725a1){var _0x337c68=this;return new Promise(function(_0x107d84,_0x1342cb){return db[_0x729b('0x18')][_0x729b('0x19')](_0x3725a1[_0x729b('0x1a')],{'raw':_0x3725a1[_0x729b('0x1b')]?_0x3725a1[_0x729b('0x1b')][_0x729b('0x1c')]===undefined?!![]:![]:!![]})[_0x729b('0xd')](function(_0x47ddcd){logger[_0x729b('0x1d')](_0x729b('0x17'),_0x3725a1);logger['debug'](_0x729b('0x17'),_0x3725a1,JSON[_0x729b('0x12')](_0x47ddcd));_0x107d84(_0x47ddcd);})[_0x729b('0x16')](function(_0x121a54){logger['error'](_0x729b('0x17'),_0x121a54['message'],_0x3725a1);_0x1342cb(_0x337c68['error'](0x1f4,_0x121a54['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x399e=['/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms'];(function(_0x55dd68,_0x2dc9d8){var _0x213ac7=function(_0x32699d){while(--_0x32699d){_0x55dd68['push'](_0x55dd68['shift']());}};_0x213ac7(++_0x2dc9d8);}(_0x399e,0x106));var _0xe399=function(_0x885eff,_0x555809){_0x885eff=_0x885eff-0x0;var _0x17819f=_0x399e[_0x885eff];return _0x17819f;};'use strict';var multer=require(_0xe399('0x0'));var util=require(_0xe399('0x1'));var path=require(_0xe399('0x2'));var express=require(_0xe399('0x3'));var router=express[_0xe399('0x4')]();var auth=require(_0xe399('0x5'));var controller=require(_0xe399('0x6'));router[_0xe399('0x7')](_0xe399('0x8'),auth[_0xe399('0x9')](),controller[_0xe399('0xa')]);router['get'](_0xe399('0xb'),auth[_0xe399('0x9')](),controller[_0xe399('0xc')]);router[_0xe399('0x7')](_0xe399('0xd'),auth[_0xe399('0x9')](),controller[_0xe399('0xe')]);router['get'](_0xe399('0xf'),auth[_0xe399('0x9')](),controller['voiceQueues']);router[_0xe399('0x7')]('/chat/queues',auth[_0xe399('0x9')](),controller[_0xe399('0x10')]);router[_0xe399('0x7')](_0xe399('0x11'),auth[_0xe399('0x9')](),controller[_0xe399('0x12')]);router[_0xe399('0x7')](_0xe399('0x13'),auth[_0xe399('0x9')](),controller[_0xe399('0x14')]);router[_0xe399('0x7')](_0xe399('0x15'),auth[_0xe399('0x9')](),controller[_0xe399('0x16')]);router[_0xe399('0x7')]('/sms/queues',auth['isAuthenticated'](),controller[_0xe399('0x17')]);router[_0xe399('0x7')]('/whatsapp/queues',auth[_0xe399('0x9')](),controller[_0xe399('0x18')]);router[_0xe399('0x7')]('/fax/queues',auth[_0xe399('0x9')](),controller[_0xe399('0x19')]);router[_0xe399('0x7')](_0xe399('0x1a'),auth[_0xe399('0x9')](),controller[_0xe399('0x1b')]);router[_0xe399('0x7')](_0xe399('0x1c'),auth[_0xe399('0x9')](),controller[_0xe399('0x1d')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xe399('0x9')](),controller[_0xe399('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0xe399('0x9')](),controller[_0xe399('0x1f')]);router[_0xe399('0x7')](_0xe399('0x20'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xe399('0x7')](_0xe399('0x21'),auth[_0xe399('0x9')](),controller[_0xe399('0x22')]);router[_0xe399('0x23')]('/voice/queues/:id',auth[_0xe399('0x9')](),controller[_0xe399('0x24')]);router['get'](_0xe399('0x25'),auth[_0xe399('0x9')](),controller[_0xe399('0x26')]);router['get'](_0xe399('0x27'),auth[_0xe399('0x9')](),controller[_0xe399('0x28')]);router[_0xe399('0x7')]('/agents',auth[_0xe399('0x9')](),controller['agents']);router[_0xe399('0x23')](_0xe399('0x29'),auth[_0xe399('0x9')](),controller[_0xe399('0x2a')]);router[_0xe399('0x7')](_0xe399('0x2b'),auth[_0xe399('0x9')](),controller[_0xe399('0x2c')]);router[_0xe399('0x7')](_0xe399('0x2d'),auth['isAuthenticated'](),controller[_0xe399('0x2e')]);router[_0xe399('0x7')](_0xe399('0x2f'),auth[_0xe399('0x9')](),controller[_0xe399('0x30')]);router['get'](_0xe399('0x31'),auth[_0xe399('0x9')](),controller[_0xe399('0x32')]);router[_0xe399('0x7')](_0xe399('0x33'),auth['isAuthenticated'](),controller[_0xe399('0x34')]);router[_0xe399('0x7')](_0xe399('0x35'),auth[_0xe399('0x9')](),controller[_0xe399('0x36')]);router[_0xe399('0x7')]('/openchannel/queues/waitinginteractions',auth[_0xe399('0x9')](),controller[_0xe399('0x37')]);router[_0xe399('0x7')](_0xe399('0x38'),auth['isAuthenticated'](),controller[_0xe399('0x39')]);router[_0xe399('0x7')](_0xe399('0x3a'),auth['isAuthenticated'](),controller[_0xe399('0x3b')]);router[_0xe399('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0xe399('0x9')](),controller[_0xe399('0x3c')]);router[_0xe399('0x7')]('/fax/queues/waitinginteractions',auth[_0xe399('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0xe399('0x3d')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe399('0x3e')](_0xe399('0x3f')));router[_0xe399('0x7')](_0xe399('0x40'),auth[_0xe399('0x9')](),controller[_0xe399('0x41')]);router[_0xe399('0x3d')](_0xe399('0x42'),auth[_0xe399('0x9')](),controller[_0xe399('0x3e')](_0xe399('0x43')));router['get'](_0xe399('0x44'),auth['isAuthenticated'](),controller[_0xe399('0x45')]);router[_0xe399('0x3d')](_0xe399('0x46'),auth[_0xe399('0x9')](),controller[_0xe399('0x3e')]('fax'));router['get'](_0xe399('0x47'),auth[_0xe399('0x9')](),controller[_0xe399('0x48')]);router['post'](_0xe399('0x49'),auth[_0xe399('0x9')](),controller[_0xe399('0x3e')]('openchannel'));router[_0xe399('0x7')](_0xe399('0x4a'),auth[_0xe399('0x9')](),controller[_0xe399('0x4b')]);router[_0xe399('0x3d')](_0xe399('0x4c'),auth['isAuthenticated'](),controller[_0xe399('0x3e')](_0xe399('0x4d')));router[_0xe399('0x3d')](_0xe399('0x4e'),auth['isAuthenticated'](),controller[_0xe399('0x3e')](_0xe399('0x4f')));router[_0xe399('0x7')](_0xe399('0x50'),auth[_0xe399('0x9')](),controller[_0xe399('0x51')]);router[_0xe399('0x7')]('/whatsapp/queues/:id',auth[_0xe399('0x9')](),controller[_0xe399('0x52')]);router['post'](_0xe399('0x53'),auth['isAuthenticated'](),controller[_0xe399('0x54')]);module['exports']=router;
\ No newline at end of file
+var _0xfb42=['isAuthenticated','get','voiceChannelMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','./rpc.controller','/voice/channels'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xfb42,0x9a));var _0x2fb4=function(_0x27e84,_0x1cc1d3){_0x27e84=_0x27e84-0x0;var _0x4584d8=_0xfb42[_0x27e84];return _0x4584d8;};'use strict';var multer=require(_0x2fb4('0x0'));var util=require('util');var path=require(_0x2fb4('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x2fb4('0x2'));router['get'](_0x2fb4('0x3'),auth[_0x2fb4('0x4')](),controller['voiceChannels']);router[_0x2fb4('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x2fb4('0x6')]);router[_0x2fb4('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x2fb4('0x4')](),controller['voiceChannelStopMixMonitor']);router[_0x2fb4('0x5')](_0x2fb4('0x7'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x8')]);router[_0x2fb4('0x5')](_0x2fb4('0x9'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0xa')]);router[_0x2fb4('0x5')](_0x2fb4('0xb'),auth[_0x2fb4('0x4')](),controller['mailQueues']);router[_0x2fb4('0x5')](_0x2fb4('0xc'),auth['isAuthenticated'](),controller[_0x2fb4('0xd')]);router[_0x2fb4('0x5')](_0x2fb4('0xe'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0xf')]);router[_0x2fb4('0x5')](_0x2fb4('0x10'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x11')]);router[_0x2fb4('0x5')]('/whatsapp/queues',auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x12')]);router[_0x2fb4('0x5')](_0x2fb4('0x13'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x14')]);router[_0x2fb4('0x5')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x2fb4('0x15')]);router[_0x2fb4('0x5')](_0x2fb4('0x16'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x17')]);router[_0x2fb4('0x5')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x2fb4('0x5')](_0x2fb4('0x18'),auth['isAuthenticated'](),controller[_0x2fb4('0x19')]);router[_0x2fb4('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x1a')]);router[_0x2fb4('0x5')](_0x2fb4('0x1b'),auth['isAuthenticated'](),controller[_0x2fb4('0x1c')]);router[_0x2fb4('0x1d')](_0x2fb4('0x1b'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x1e')]);router['get']('/outbound',auth[_0x2fb4('0x4')](),controller['outbound']);router[_0x2fb4('0x5')](_0x2fb4('0x1f'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x20')]);router['get'](_0x2fb4('0x21'),auth['isAuthenticated'](),controller[_0x2fb4('0x22')]);router[_0x2fb4('0x1d')]('/agents/:id/capacity',auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x23')]);router[_0x2fb4('0x5')](_0x2fb4('0x24'),auth[_0x2fb4('0x4')](),controller['telephones']);router['get'](_0x2fb4('0x25'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x26')]);router['get'](_0x2fb4('0x27'),auth['isAuthenticated'](),controller['campaigns']);router[_0x2fb4('0x5')](_0x2fb4('0x28'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x29')]);router[_0x2fb4('0x5')](_0x2fb4('0x2a'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x2fb4('0x5')](_0x2fb4('0x2b'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x2c')]);router['get'](_0x2fb4('0x2d'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x2e')]);router['get'](_0x2fb4('0x2f'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x30')]);router[_0x2fb4('0x5')](_0x2fb4('0x31'),auth['isAuthenticated'](),controller[_0x2fb4('0x32')]);router[_0x2fb4('0x5')](_0x2fb4('0x33'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x34')]);router[_0x2fb4('0x5')](_0x2fb4('0x35'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x36')]);router[_0x2fb4('0x37')](_0x2fb4('0x38'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x39')](_0x2fb4('0x3a')));router[_0x2fb4('0x5')](_0x2fb4('0x3b'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x3c')]);router[_0x2fb4('0x37')](_0x2fb4('0x3d'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x39')](_0x2fb4('0x3e')));router[_0x2fb4('0x5')]('/chat/queues/:id',auth[_0x2fb4('0x4')](),controller['showChatQueues']);router[_0x2fb4('0x37')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x2fb4('0x39')]('fax'));router[_0x2fb4('0x5')](_0x2fb4('0x3f'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x40')]);router[_0x2fb4('0x37')](_0x2fb4('0x41'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x39')](_0x2fb4('0x42')));router[_0x2fb4('0x5')](_0x2fb4('0x43'),auth['isAuthenticated'](),controller[_0x2fb4('0x44')]);router[_0x2fb4('0x37')](_0x2fb4('0x45'),auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x2fb4('0x37')](_0x2fb4('0x46'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x39')](_0x2fb4('0x47')));router[_0x2fb4('0x5')](_0x2fb4('0x48'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x49')]);router[_0x2fb4('0x5')](_0x2fb4('0x4a'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x4b')]);router[_0x2fb4('0x37')](_0x2fb4('0x4c'),auth[_0x2fb4('0x4')](),controller[_0x2fb4('0x4d')]);module[_0x2fb4('0x4e')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x38034b,_0x564ca5){var _0x435bc6=function(_0x13e201){while(--_0x13e201){_0x38034b['push'](_0x38034b['shift']());}};_0x435bc6(++_0x564ca5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));};
\ No newline at end of file
+var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x854919,_0x27cfe6){var _0x552da4=function(_0x95d087){while(--_0x95d087){_0x854919['push'](_0x854919['shift']());}};_0x552da4(++_0x27cfe6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb0e2=['index','get','/:id','show','/:id/run','run','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated'];(function(_0x2db4c1,_0x3d87fd){var _0x3fe1c3=function(_0x85a2d2){while(--_0x85a2d2){_0x2db4c1['push'](_0x2db4c1['shift']());}};_0x3fe1c3(++_0x3d87fd);}(_0xb0e2,0x1ef));var _0x2b0e=function(_0x5aea61,_0x5d8f55){_0x5aea61=_0x5aea61-0x0;var _0x1324f9=_0xb0e2[_0x5aea61];return _0x1324f9;};'use strict';var multer=require(_0x2b0e('0x0'));var util=require(_0x2b0e('0x1'));var path=require(_0x2b0e('0x2'));var timeout=require(_0x2b0e('0x3'));var express=require(_0x2b0e('0x4'));var router=express['Router']();var fs_extra=require(_0x2b0e('0x5'));var auth=require(_0x2b0e('0x6'));var interaction=require(_0x2b0e('0x7'));var config=require(_0x2b0e('0x8'));var controller=require(_0x2b0e('0x9'));router['get']('/',auth[_0x2b0e('0xa')](),controller[_0x2b0e('0xb')]);router[_0x2b0e('0xc')](_0x2b0e('0xd'),auth[_0x2b0e('0xa')](),controller[_0x2b0e('0xe')]);router[_0x2b0e('0xc')](_0x2b0e('0xf'),auth['isAuthenticated'](),controller[_0x2b0e('0x10')]);router['post']('/',auth[_0x2b0e('0xa')](),controller['create']);router[_0x2b0e('0x11')](_0x2b0e('0xd'),auth[_0x2b0e('0xa')](),controller[_0x2b0e('0x12')]);router[_0x2b0e('0x13')](_0x2b0e('0xd'),auth[_0x2b0e('0xa')](),controller[_0x2b0e('0x14')]);module[_0x2b0e('0x15')]=router;
\ No newline at end of file
+var _0x3a0d=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/run','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5e0823,_0x146024){var _0x592fbb=function(_0x5ec112){while(--_0x5ec112){_0x5e0823['push'](_0x5e0823['shift']());}};_0x592fbb(++_0x146024);}(_0x3a0d,0x1af));var _0xd3a0=function(_0x865a99,_0x8dddba){_0x865a99=_0x865a99-0x0;var _0x259286=_0x3a0d[_0x865a99];return _0x259286;};'use strict';var multer=require(_0xd3a0('0x0'));var util=require(_0xd3a0('0x1'));var path=require(_0xd3a0('0x2'));var timeout=require(_0xd3a0('0x3'));var express=require(_0xd3a0('0x4'));var router=express['Router']();var fs_extra=require(_0xd3a0('0x5'));var auth=require(_0xd3a0('0x6'));var interaction=require(_0xd3a0('0x7'));var config=require(_0xd3a0('0x8'));var controller=require('./schedule.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd3a0('0x9')](_0xd3a0('0xa'),auth[_0xd3a0('0xb')](),controller[_0xd3a0('0xc')]);router[_0xd3a0('0x9')](_0xd3a0('0xd'),auth['isAuthenticated'](),controller['run']);router[_0xd3a0('0xe')]('/',auth['isAuthenticated'](),controller[_0xd3a0('0xf')]);router['put'](_0xd3a0('0xa'),auth['isAuthenticated'](),controller[_0xd3a0('0x10')]);router[_0xd3a0('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd3a0('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf447=['DATE','INTEGER','years','months','days','hours','ENUM','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*'];(function(_0x7036d5,_0x3db2dd){var _0x2922d6=function(_0x372778){while(--_0x372778){_0x7036d5['push'](_0x7036d5['shift']());}};_0x2922d6(++_0x3db2dd);}(_0xf447,0xe9));var _0x7f44=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xf447[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x7f44('0x0'));module[_0x7f44('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7f44('0x2')]},'active':{'type':Sequelize[_0x7f44('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7f44('0x2')],'allowNull':![],'defaultValue':_0x7f44('0x4')},'startAt':{'type':Sequelize[_0x7f44('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7f44('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7f44('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x7f44('0x7'),'quarters',_0x7f44('0x8'),'weeks',_0x7f44('0x9'),_0x7f44('0xa'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x7f44('0xb')](_0x7f44('0xc'),_0x7f44('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x7f44('0xc')},'type':{'type':Sequelize[_0x7f44('0xb')](_0x7f44('0xe'),_0x7f44('0xf')),'allowNull':![],'defaultValue':_0x7f44('0xe')},'sendMail':{'type':Sequelize[_0x7f44('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7f44('0x10')]},'bcc':{'type':Sequelize[_0x7f44('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x7f44('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x729b=['default','TEXT','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','days','hours','minutes','ENUM','csv','xlsx','custom'];(function(_0x50a504,_0x3a7310){var _0x4537a1=function(_0x23f4f2){while(--_0x23f4f2){_0x50a504['push'](_0x50a504['shift']());}};_0x4537a1(++_0x3a7310);}(_0x729b,0x158));var _0xb729=function(_0x6c912f,_0x129605){_0x6c912f=_0x6c912f-0x0;var _0x46f9c0=_0x729b[_0x6c912f];return _0x46f9c0;};'use strict';var Sequelize=require(_0xb729('0x0'));module[_0xb729('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb729('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb729('0x3')],'allowNull':![],'defaultValue':_0xb729('0x4')},'startAt':{'type':Sequelize[_0xb729('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb729('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb729('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xb729('0x7'),_0xb729('0x8'),_0xb729('0x9'),'weeks',_0xb729('0xa'),_0xb729('0xb'),_0xb729('0xc')),'allowNull':![],'defaultValue':_0xb729('0xa')},'output':{'type':Sequelize[_0xb729('0xd')](_0xb729('0xe'),'pdf',_0xb729('0xf')),'allowNull':![],'defaultValue':_0xb729('0xe')},'type':{'type':Sequelize['ENUM'](_0xb729('0x10'),_0xb729('0x11')),'allowNull':![],'defaultValue':_0xb729('0x10')},'sendMail':{'type':Sequelize[_0xb729('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xb729('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xb729('0x2')],'defaultValue':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce68=['path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','offset','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xce68,0x15c));var _0x8ce6=function(_0x5b4c34,_0x59e7cd){_0x5b4c34=_0x5b4c34-0x0;var _0x11dc43=_0xce68[_0x5b4c34];return _0x11dc43;};'use strict';var emlformat=require(_0x8ce6('0x0'));var rimraf=require(_0x8ce6('0x1'));var zipdir=require(_0x8ce6('0x2'));var jsonpatch=require(_0x8ce6('0x3'));var rp=require(_0x8ce6('0x4'));var moment=require(_0x8ce6('0x5'));var BPromise=require(_0x8ce6('0x6'));var Mustache=require('mustache');var util=require(_0x8ce6('0x7'));var path=require(_0x8ce6('0x8'));var sox=require(_0x8ce6('0x9'));var csv=require(_0x8ce6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ce6('0xb'));var squel=require(_0x8ce6('0xc'));var crypto=require(_0x8ce6('0xd'));var jsforce=require(_0x8ce6('0xe'));var deskjs=require(_0x8ce6('0xf'));var toCsv=require(_0x8ce6('0xa'));var querystring=require(_0x8ce6('0x10'));var Papa=require(_0x8ce6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ce6('0x12'));var as=require(_0x8ce6('0x13'));var hardwareService=require(_0x8ce6('0x14'));var logger=require(_0x8ce6('0x15'))(_0x8ce6('0x16'));var utils=require(_0x8ce6('0x17'));var config=require(_0x8ce6('0x18'));var licenseUtil=require(_0x8ce6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x311bd5,_0x161d5b){_0x161d5b=_0x161d5b||0xcc;return function(_0x2cd128){if(_0x2cd128){return _0x311bd5['sendStatus'](_0x161d5b);}return _0x311bd5['status'](_0x161d5b)['end']();};}function respondWithResult(_0x5bd6a2,_0x5fd1e0){_0x5fd1e0=_0x5fd1e0||0xc8;return function(_0x1976e4){if(_0x1976e4){return _0x5bd6a2['status'](_0x5fd1e0)['json'](_0x1976e4);}};}function respondWithFilteredResult(_0x4d4a67,_0x290aa5){return function(_0x5a433e){if(_0x5a433e){var _0x5e6ea1=typeof _0x290aa5[_0x8ce6('0x1a')]==='undefined'&&typeof _0x290aa5[_0x8ce6('0x1b')]==='undefined';var _0x27fb6e=_0x5a433e[_0x8ce6('0x1c')];var _0x4e1e00=_0x5e6ea1?0x0:_0x290aa5[_0x8ce6('0x1a')];var _0x38da28=_0x5e6ea1?_0x5a433e['count']:_0x290aa5['offset']+_0x290aa5[_0x8ce6('0x1b')];var _0xbf0370;if(_0x38da28>=_0x27fb6e){_0x38da28=_0x27fb6e;_0xbf0370=0xc8;}else{_0xbf0370=0xce;}_0x4d4a67[_0x8ce6('0x1d')](_0xbf0370);return _0x4d4a67[_0x8ce6('0x1e')](_0x8ce6('0x1f'),_0x4e1e00+'-'+_0x38da28+'/'+_0x27fb6e)[_0x8ce6('0x20')](_0x5a433e);}return null;};}function patchUpdates(_0x3df8aa){return function(_0x587cab){try{jsonpatch[_0x8ce6('0x21')](_0x587cab,_0x3df8aa,!![]);}catch(_0x10e4f0){return BPromise[_0x8ce6('0x22')](_0x10e4f0);}return _0x587cab[_0x8ce6('0x23')]();};}function saveUpdates(_0x33713a,_0x2627c0){return function(_0x5b150b){if(_0x5b150b){return _0x5b150b['update'](_0x33713a)[_0x8ce6('0x24')](function(_0xad5c9b){return _0xad5c9b;});}return null;};}function removeEntity(_0x266bb0,_0xcdf7fb){return function(_0x4fb80f){if(_0x4fb80f){return _0x4fb80f[_0x8ce6('0x25')]()['then'](function(){var _0x37ab56=_0x4fb80f['get']({'plain':!![]});var _0x543ca9=_0x8ce6('0x26');return db[_0x8ce6('0x27')][_0x8ce6('0x25')]({'where':{'type':_0x543ca9,'resourceId':_0x37ab56['id']}})['then'](function(){return _0x4fb80f;});})[_0x8ce6('0x24')](function(){_0x266bb0[_0x8ce6('0x1d')](0xcc)[_0x8ce6('0x28')]();});}};}function handleEntityNotFound(_0x590200,_0x33a623){return function(_0x496590){if(!_0x496590){_0x590200[_0x8ce6('0x29')](0x194);}return _0x496590;};}function handleError(_0x264182,_0xab345){_0xab345=_0xab345||0x1f4;return function(_0x450d05){logger[_0x8ce6('0x2a')](_0x450d05[_0x8ce6('0x2b')]);if(_0x450d05['name']){delete _0x450d05[_0x8ce6('0x2c')];}_0x264182['status'](_0xab345)[_0x8ce6('0x2d')](_0x450d05);};}exports['index']=function(_0x225c59,_0x56ad64){var _0x1ad49f={},_0x53307d={},_0x57f969={'count':0x0,'rows':[]};var _0x274985=_[_0x8ce6('0x2e')](db['Schedule']['rawAttributes'],function(_0x27347c){return{'name':_0x27347c[_0x8ce6('0x2f')],'type':_0x27347c[_0x8ce6('0x30')][_0x8ce6('0x31')]};});_0x53307d[_0x8ce6('0x32')]=_[_0x8ce6('0x2e')](_0x274985,_0x8ce6('0x2c'));_0x53307d[_0x8ce6('0x33')]=_[_0x8ce6('0x34')](_0x225c59[_0x8ce6('0x33')]);_0x53307d[_0x8ce6('0x35')]=_[_0x8ce6('0x36')](_0x53307d[_0x8ce6('0x32')],_0x53307d['query']);_0x1ad49f[_0x8ce6('0x37')]=_['intersection'](_0x53307d[_0x8ce6('0x32')],qs[_0x8ce6('0x38')](_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x38')]));_0x1ad49f[_0x8ce6('0x37')]=_0x1ad49f[_0x8ce6('0x37')][_0x8ce6('0x39')]?_0x1ad49f[_0x8ce6('0x37')]:_0x53307d[_0x8ce6('0x32')];if(!_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x3a')](_0x8ce6('0x3b'))){_0x1ad49f[_0x8ce6('0x1b')]=qs[_0x8ce6('0x1b')](_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x1b')]);_0x1ad49f[_0x8ce6('0x1a')]=qs[_0x8ce6('0x1a')](_0x225c59['query'][_0x8ce6('0x1a')]);}_0x1ad49f[_0x8ce6('0x3c')]=qs[_0x8ce6('0x3d')](_0x225c59['query'][_0x8ce6('0x3d')]);_0x1ad49f[_0x8ce6('0x3e')]=qs[_0x8ce6('0x35')](_[_0x8ce6('0x3f')](_0x225c59['query'],_0x53307d[_0x8ce6('0x35')]),_0x274985);if(_0x225c59['query'][_0x8ce6('0x40')]){_0x1ad49f['where']=_[_0x8ce6('0x41')](_0x1ad49f['where'],{'$or':_[_0x8ce6('0x2e')](_0x274985,function(_0x31ffb9){if(_0x31ffb9[_0x8ce6('0x30')]!==_0x8ce6('0x42')){var _0x3553b3={};_0x3553b3[_0x31ffb9[_0x8ce6('0x2c')]]={'$like':'%'+_0x225c59['query']['filter']+'%'};return _0x3553b3;}})});}_0x1ad49f=_[_0x8ce6('0x41')]({},_0x1ad49f,_0x225c59[_0x8ce6('0x43')]);var _0x211e1c={'where':_0x1ad49f[_0x8ce6('0x3e')]};return db[_0x8ce6('0x44')][_0x8ce6('0x1c')](_0x211e1c)['then'](function(_0xba7ae7){_0x57f969[_0x8ce6('0x1c')]=_0xba7ae7;if(_0x225c59[_0x8ce6('0x33')][_0x8ce6('0x45')]){_0x1ad49f[_0x8ce6('0x46')]=[{'all':!![]}];}return db[_0x8ce6('0x44')][_0x8ce6('0x47')](_0x1ad49f);})[_0x8ce6('0x24')](function(_0x462bec){_0x57f969[_0x8ce6('0x48')]=_0x462bec;return _0x57f969;})['then'](respondWithFilteredResult(_0x56ad64,_0x1ad49f))[_0x8ce6('0x49')](handleError(_0x56ad64,null));};exports[_0x8ce6('0x4a')]=function(_0x1a7828,_0x2cdd20){var _0x5f0ed2={'raw':![],'where':{'id':_0x1a7828[_0x8ce6('0x4b')]['id']}},_0x2056c6={};_0x2056c6[_0x8ce6('0x32')]=_['keys'](db[_0x8ce6('0x44')][_0x8ce6('0x4c')]);_0x2056c6[_0x8ce6('0x33')]=_[_0x8ce6('0x34')](_0x1a7828['query']);_0x2056c6['filters']=_[_0x8ce6('0x36')](_0x2056c6[_0x8ce6('0x32')],_0x2056c6[_0x8ce6('0x33')]);_0x5f0ed2[_0x8ce6('0x37')]=_['intersection'](_0x2056c6[_0x8ce6('0x32')],qs[_0x8ce6('0x38')](_0x1a7828[_0x8ce6('0x33')][_0x8ce6('0x38')]));_0x5f0ed2[_0x8ce6('0x37')]=_0x5f0ed2[_0x8ce6('0x37')][_0x8ce6('0x39')]?_0x5f0ed2[_0x8ce6('0x37')]:_0x2056c6[_0x8ce6('0x32')];if(_0x1a7828[_0x8ce6('0x33')][_0x8ce6('0x45')]){_0x5f0ed2[_0x8ce6('0x46')]=[{'all':!![]}];}_0x5f0ed2=_[_0x8ce6('0x41')]({},_0x5f0ed2,_0x1a7828[_0x8ce6('0x43')]);return db['Schedule'][_0x8ce6('0x4d')](_0x5f0ed2)[_0x8ce6('0x24')](handleEntityNotFound(_0x2cdd20,null))[_0x8ce6('0x24')](respondWithResult(_0x2cdd20,null))['catch'](handleError(_0x2cdd20,null));};exports[_0x8ce6('0x4e')]=function(_0x562133,_0x5ebb56){return db[_0x8ce6('0x44')][_0x8ce6('0x4e')](_0x562133['body'],{})[_0x8ce6('0x24')](function(_0x5aa7b4){var _0x378b78=_0x562133[_0x8ce6('0x4f')][_0x8ce6('0x50')]({'plain':!![]});if(!_0x378b78)throw new Error(_0x8ce6('0x51'));if(_0x378b78[_0x8ce6('0x52')]===_0x8ce6('0x4f')){var _0x181169=_0x5aa7b4[_0x8ce6('0x50')]({'plain':!![]});var _0x29eae5=_0x8ce6('0x26');return db[_0x8ce6('0x53')][_0x8ce6('0x4d')]({'where':{'name':_0x29eae5,'userProfileId':_0x378b78[_0x8ce6('0x54')]},'raw':!![]})[_0x8ce6('0x24')](function(_0x5746f9){if(_0x5746f9&&_0x5746f9[_0x8ce6('0x55')]===0x0){return db['UserProfileResource'][_0x8ce6('0x4e')]({'name':_0x181169[_0x8ce6('0x2c')],'resourceId':_0x181169['id'],'type':_0x5746f9[_0x8ce6('0x2c')],'sectionId':_0x5746f9['id']},{})[_0x8ce6('0x24')](function(){return _0x5aa7b4;});}else{return _0x5aa7b4;}})['catch'](function(_0x14e3df){logger[_0x8ce6('0x2a')](_0x8ce6('0x56'),_0x14e3df);throw _0x14e3df;});}return _0x5aa7b4;})[_0x8ce6('0x24')](respondWithResult(_0x5ebb56,0xc9))[_0x8ce6('0x49')](handleError(_0x5ebb56,null));};exports['update']=function(_0x1bb77b,_0x45f6ba){if(_0x1bb77b[_0x8ce6('0x57')]['id']){delete _0x1bb77b[_0x8ce6('0x57')]['id'];}return db[_0x8ce6('0x44')][_0x8ce6('0x4d')]({'where':{'id':_0x1bb77b[_0x8ce6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45f6ba,null))[_0x8ce6('0x24')](saveUpdates(_0x1bb77b[_0x8ce6('0x57')],null))[_0x8ce6('0x24')](respondWithResult(_0x45f6ba,null))[_0x8ce6('0x49')](handleError(_0x45f6ba,null));};exports[_0x8ce6('0x25')]=function(_0x56c399,_0x47e645){return db[_0x8ce6('0x44')]['find']({'where':{'id':_0x56c399[_0x8ce6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47e645,null))[_0x8ce6('0x24')](removeEntity(_0x47e645,null))[_0x8ce6('0x49')](handleError(_0x47e645,null));};exports[_0x8ce6('0x58')]=function(_0x32af96,_0x35a0f2,_0x52d5c2){var _0x1eeb51=require('../../config/schedule');return db[_0x8ce6('0x44')][_0x8ce6('0x4d')]({'where':{'id':_0x32af96['params']['id']},'raw':!![]})[_0x8ce6('0x24')](handleEntityNotFound(_0x35a0f2,null))[_0x8ce6('0x24')](function(){_0x1eeb51[_0x8ce6('0x58')](_0x32af96[_0x8ce6('0x4b')]['id']);})[_0x8ce6('0x24')](respondWithStatusCode(_0x35a0f2,null))['catch'](handleError(_0x35a0f2,null));};
\ No newline at end of file
+var _0x8bf2=['lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','../../config/schedule','run','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra'];(function(_0x3031e2,_0x1e7279){var _0x18e111=function(_0x2f8c01){while(--_0x2f8c01){_0x3031e2['push'](_0x3031e2['shift']());}};_0x18e111(++_0x1e7279);}(_0x8bf2,0x133));var _0x28bf=function(_0x11fa2f,_0x56b145){_0x11fa2f=_0x11fa2f-0x0;var _0x4033aa=_0x8bf2[_0x11fa2f];return _0x4033aa;};'use strict';var emlformat=require(_0x28bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28bf('0x1'));var jsonpatch=require(_0x28bf('0x2'));var rp=require('request-promise');var moment=require(_0x28bf('0x3'));var BPromise=require(_0x28bf('0x4'));var Mustache=require('mustache');var util=require(_0x28bf('0x5'));var path=require('path');var sox=require(_0x28bf('0x6'));var csv=require('to-csv');var ejs=require(_0x28bf('0x7'));var fs=require('fs');var fs_extra=require(_0x28bf('0x8'));var _=require(_0x28bf('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x28bf('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x28bf('0xb'));var querystring=require('querystring');var Papa=require(_0x28bf('0xc'));var Redis=require(_0x28bf('0xd'));var authService=require(_0x28bf('0xe'));var qs=require(_0x28bf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x28bf('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x28bf('0x11'));var licenseUtil=require(_0x28bf('0x12'));var db=require(_0x28bf('0x13'))['db'];function respondWithStatusCode(_0x4107d2,_0x41bdee){_0x41bdee=_0x41bdee||0xcc;return function(_0x5eaa82){if(_0x5eaa82){return _0x4107d2[_0x28bf('0x14')](_0x41bdee);}return _0x4107d2['status'](_0x41bdee)['end']();};}function respondWithResult(_0x5a62e5,_0x2cc5f6){_0x2cc5f6=_0x2cc5f6||0xc8;return function(_0x3c4eb3){if(_0x3c4eb3){return _0x5a62e5[_0x28bf('0x15')](_0x2cc5f6)[_0x28bf('0x16')](_0x3c4eb3);}};}function respondWithFilteredResult(_0x5da703,_0x4864a8){return function(_0x31ab20){if(_0x31ab20){var _0x516b34=typeof _0x4864a8[_0x28bf('0x17')]===_0x28bf('0x18')&&typeof _0x4864a8[_0x28bf('0x19')]===_0x28bf('0x18');var _0x32c591=_0x31ab20[_0x28bf('0x1a')];var _0x5f2860=_0x516b34?0x0:_0x4864a8['offset'];var _0x52302f=_0x516b34?_0x31ab20[_0x28bf('0x1a')]:_0x4864a8[_0x28bf('0x17')]+_0x4864a8['limit'];var _0xa05679;if(_0x52302f>=_0x32c591){_0x52302f=_0x32c591;_0xa05679=0xc8;}else{_0xa05679=0xce;}_0x5da703[_0x28bf('0x15')](_0xa05679);return _0x5da703[_0x28bf('0x1b')](_0x28bf('0x1c'),_0x5f2860+'-'+_0x52302f+'/'+_0x32c591)['json'](_0x31ab20);}return null;};}function patchUpdates(_0x937bf9){return function(_0x5bb74f){try{jsonpatch[_0x28bf('0x1d')](_0x5bb74f,_0x937bf9,!![]);}catch(_0x5f1e5c){return BPromise[_0x28bf('0x1e')](_0x5f1e5c);}return _0x5bb74f['save']();};}function saveUpdates(_0x115ae9,_0x49a783){return function(_0xcc8128){if(_0xcc8128){return _0xcc8128[_0x28bf('0x1f')](_0x115ae9)[_0x28bf('0x20')](function(_0x3b7dd3){return _0x3b7dd3;});}return null;};}function removeEntity(_0xf164d1,_0x58c3d5){return function(_0x366485){if(_0x366485){return _0x366485[_0x28bf('0x21')]()[_0x28bf('0x20')](function(){var _0x1495c9=_0x366485[_0x28bf('0x22')]({'plain':!![]});var _0x56edae=_0x28bf('0x23');return db[_0x28bf('0x24')]['destroy']({'where':{'type':_0x56edae,'resourceId':_0x1495c9['id']}})[_0x28bf('0x20')](function(){return _0x366485;});})[_0x28bf('0x20')](function(){_0xf164d1[_0x28bf('0x15')](0xcc)[_0x28bf('0x25')]();});}};}function handleEntityNotFound(_0x5558b6,_0x323d1c){return function(_0x189e1b){if(!_0x189e1b){_0x5558b6[_0x28bf('0x14')](0x194);}return _0x189e1b;};}function handleError(_0x9db6b6,_0x2ac397){_0x2ac397=_0x2ac397||0x1f4;return function(_0x221c49){logger[_0x28bf('0x26')](_0x221c49[_0x28bf('0x27')]);if(_0x221c49[_0x28bf('0x28')]){delete _0x221c49['name'];}_0x9db6b6[_0x28bf('0x15')](_0x2ac397)['send'](_0x221c49);};}exports['index']=function(_0x2bf040,_0x5eb3c4){var _0x13c18c={},_0x29d331={},_0x25cd7c={'count':0x0,'rows':[]};var _0x3602aa=_[_0x28bf('0x29')](db['Schedule']['rawAttributes'],function(_0x2733bb){return{'name':_0x2733bb[_0x28bf('0x2a')],'type':_0x2733bb[_0x28bf('0x2b')]['key']};});_0x29d331[_0x28bf('0x2c')]=_['map'](_0x3602aa,_0x28bf('0x28'));_0x29d331[_0x28bf('0x2d')]=_[_0x28bf('0x2e')](_0x2bf040['query']);_0x29d331['filters']=_[_0x28bf('0x2f')](_0x29d331[_0x28bf('0x2c')],_0x29d331[_0x28bf('0x2d')]);_0x13c18c[_0x28bf('0x30')]=_[_0x28bf('0x2f')](_0x29d331[_0x28bf('0x2c')],qs['fields'](_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x31')]));_0x13c18c[_0x28bf('0x30')]=_0x13c18c[_0x28bf('0x30')][_0x28bf('0x32')]?_0x13c18c[_0x28bf('0x30')]:_0x29d331[_0x28bf('0x2c')];if(!_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x33')]('nolimit')){_0x13c18c[_0x28bf('0x19')]=qs['limit'](_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x19')]);_0x13c18c[_0x28bf('0x17')]=qs[_0x28bf('0x17')](_0x2bf040['query'][_0x28bf('0x17')]);}_0x13c18c['order']=qs['sort'](_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x34')]);_0x13c18c[_0x28bf('0x35')]=qs[_0x28bf('0x36')](_[_0x28bf('0x37')](_0x2bf040[_0x28bf('0x2d')],_0x29d331[_0x28bf('0x36')]),_0x3602aa);if(_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x38')]){_0x13c18c[_0x28bf('0x35')]=_[_0x28bf('0x39')](_0x13c18c[_0x28bf('0x35')],{'$or':_[_0x28bf('0x29')](_0x3602aa,function(_0x2cfaa5){if(_0x2cfaa5[_0x28bf('0x2b')]!==_0x28bf('0x3a')){var _0x13e463={};_0x13e463[_0x2cfaa5[_0x28bf('0x28')]]={'$like':'%'+_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x38')]+'%'};return _0x13e463;}})});}_0x13c18c=_[_0x28bf('0x39')]({},_0x13c18c,_0x2bf040[_0x28bf('0x3b')]);var _0x2d7a1e={'where':_0x13c18c[_0x28bf('0x35')]};return db[_0x28bf('0x3c')][_0x28bf('0x1a')](_0x2d7a1e)['then'](function(_0x4e83bb){_0x25cd7c[_0x28bf('0x1a')]=_0x4e83bb;if(_0x2bf040[_0x28bf('0x2d')][_0x28bf('0x3d')]){_0x13c18c[_0x28bf('0x3e')]=[{'all':!![]}];}return db[_0x28bf('0x3c')][_0x28bf('0x3f')](_0x13c18c);})[_0x28bf('0x20')](function(_0x50d52b){_0x25cd7c[_0x28bf('0x40')]=_0x50d52b;return _0x25cd7c;})[_0x28bf('0x20')](respondWithFilteredResult(_0x5eb3c4,_0x13c18c))[_0x28bf('0x41')](handleError(_0x5eb3c4,null));};exports[_0x28bf('0x42')]=function(_0x819448,_0x277cd2){var _0x482cee={'raw':![],'where':{'id':_0x819448[_0x28bf('0x43')]['id']}},_0x1a744f={};_0x1a744f[_0x28bf('0x2c')]=_[_0x28bf('0x2e')](db[_0x28bf('0x3c')][_0x28bf('0x44')]);_0x1a744f[_0x28bf('0x2d')]=_['keys'](_0x819448[_0x28bf('0x2d')]);_0x1a744f[_0x28bf('0x36')]=_[_0x28bf('0x2f')](_0x1a744f[_0x28bf('0x2c')],_0x1a744f[_0x28bf('0x2d')]);_0x482cee['attributes']=_[_0x28bf('0x2f')](_0x1a744f['model'],qs[_0x28bf('0x31')](_0x819448[_0x28bf('0x2d')][_0x28bf('0x31')]));_0x482cee[_0x28bf('0x30')]=_0x482cee[_0x28bf('0x30')][_0x28bf('0x32')]?_0x482cee[_0x28bf('0x30')]:_0x1a744f['model'];if(_0x819448[_0x28bf('0x2d')][_0x28bf('0x3d')]){_0x482cee[_0x28bf('0x3e')]=[{'all':!![]}];}_0x482cee=_[_0x28bf('0x39')]({},_0x482cee,_0x819448[_0x28bf('0x3b')]);return db[_0x28bf('0x3c')]['find'](_0x482cee)['then'](handleEntityNotFound(_0x277cd2,null))[_0x28bf('0x20')](respondWithResult(_0x277cd2,null))['catch'](handleError(_0x277cd2,null));};exports[_0x28bf('0x45')]=function(_0x305462,_0x18fc3b){return db[_0x28bf('0x3c')][_0x28bf('0x45')](_0x305462[_0x28bf('0x46')],{})['then'](function(_0x4cc0af){var _0x347757=_0x305462[_0x28bf('0x47')][_0x28bf('0x22')]({'plain':!![]});if(!_0x347757)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347757['role']===_0x28bf('0x47')){var _0x2a74f3=_0x4cc0af[_0x28bf('0x22')]({'plain':!![]});var _0x17730e='Scheduler';return db[_0x28bf('0x48')]['find']({'where':{'name':_0x17730e,'userProfileId':_0x347757[_0x28bf('0x49')]},'raw':!![]})[_0x28bf('0x20')](function(_0x28b0cf){if(_0x28b0cf&&_0x28b0cf[_0x28bf('0x4a')]===0x0){return db[_0x28bf('0x24')][_0x28bf('0x45')]({'name':_0x2a74f3[_0x28bf('0x28')],'resourceId':_0x2a74f3['id'],'type':_0x28b0cf['name'],'sectionId':_0x28b0cf['id']},{})[_0x28bf('0x20')](function(){return _0x4cc0af;});}else{return _0x4cc0af;}})[_0x28bf('0x41')](function(_0x3d53d1){logger[_0x28bf('0x26')](_0x28bf('0x4b'),_0x3d53d1);throw _0x3d53d1;});}return _0x4cc0af;})[_0x28bf('0x20')](respondWithResult(_0x18fc3b,0xc9))[_0x28bf('0x41')](handleError(_0x18fc3b,null));};exports[_0x28bf('0x1f')]=function(_0x30226e,_0x3b7404){if(_0x30226e['body']['id']){delete _0x30226e['body']['id'];}return db['Schedule'][_0x28bf('0x4c')]({'where':{'id':_0x30226e['params']['id']}})[_0x28bf('0x20')](handleEntityNotFound(_0x3b7404,null))[_0x28bf('0x20')](saveUpdates(_0x30226e['body'],null))['then'](respondWithResult(_0x3b7404,null))['catch'](handleError(_0x3b7404,null));};exports[_0x28bf('0x21')]=function(_0x4d9db8,_0x563f8f){return db['Schedule'][_0x28bf('0x4c')]({'where':{'id':_0x4d9db8['params']['id']}})[_0x28bf('0x20')](handleEntityNotFound(_0x563f8f,null))[_0x28bf('0x20')](removeEntity(_0x563f8f,null))[_0x28bf('0x41')](handleError(_0x563f8f,null));};exports['run']=function(_0x21c5d8,_0x285a94,_0x53e985){var _0x1c75f0=require(_0x28bf('0x4d'));return db[_0x28bf('0x3c')][_0x28bf('0x4c')]({'where':{'id':_0x21c5d8[_0x28bf('0x43')]['id']},'raw':!![]})[_0x28bf('0x20')](handleEntityNotFound(_0x285a94,null))[_0x28bf('0x20')](function(){_0x1c75f0[_0x28bf('0x4e')](_0x21c5d8[_0x28bf('0x43')]['id']);})[_0x28bf('0x20')](respondWithStatusCode(_0x285a94,null))['catch'](handleError(_0x285a94,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf88d=['util','../../config/logger','moment','request-promise','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x499f08,_0x3d398d){var _0x301401=function(_0x541ae1){while(--_0x541ae1){_0x499f08['push'](_0x499f08['shift']());}};_0x301401(++_0x3d398d);}(_0xf88d,0x10e));var _0xdf88=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf88d[_0xe73080];return _0x12cbc4;};'use strict';var _=require('lodash');var util=require(_0xdf88('0x0'));var logger=require(_0xdf88('0x1'))('api');var moment=require(_0xdf88('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf88('0x4'));var attributes=require(_0xdf88('0x5'));module[_0xdf88('0x6')]=function(_0xee1667,_0xe9d865){return _0xee1667[_0xdf88('0x7')](_0xdf88('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76d2=['moment','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','../../config/logger','api'];(function(_0x22950f,_0x463772){var _0x37741b=function(_0xec0b78){while(--_0xec0b78){_0x22950f['push'](_0x22950f['shift']());}};_0x37741b(++_0x463772);}(_0x76d2,0x194));var _0x276d=function(_0x5d52be,_0x3d91e1){_0x5d52be=_0x5d52be-0x0;var _0x3bef84=_0x76d2[_0x5d52be];return _0x3bef84;};'use strict';var _=require(_0x276d('0x0'));var util=require('util');var logger=require(_0x276d('0x1'))(_0x276d('0x2'));var moment=require(_0x276d('0x3'));var BPromise=require('bluebird');var rp=require(_0x276d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x276d('0x5'));var config=require(_0x276d('0x6'));var attributes=require(_0x276d('0x7'));module[_0x276d('0x8')]=function(_0x12b728,_0x53979d){return _0x12b728['define'](_0x276d('0x9'),attributes,{'tableName':_0x276d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe3e=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http'];(function(_0x506b3a,_0x4897a6){var _0x15ffeb=function(_0x3097a7){while(--_0x3097a7){_0x506b3a['push'](_0x506b3a['shift']());}};_0x15ffeb(++_0x4897a6);}(_0xbe3e,0x147));var _0xebe3=function(_0x5b21a8,_0x35701f){_0x5b21a8=_0x5b21a8-0x0;var _0x5f6aaa=_0xbe3e[_0x5b21a8];return _0x5f6aaa;};'use strict';var _=require(_0xebe3('0x0'));var util=require(_0xebe3('0x1'));var moment=require('moment');var BPromise=require(_0xebe3('0x2'));var rs=require(_0xebe3('0x3'));var fs=require('fs');var Redis=require(_0xebe3('0x4'));var db=require(_0xebe3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xebe3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebe3('0x7')][_0xebe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326a08,_0x6a0992,_0x2518a2){return new BPromise(function(_0x2f7108,_0x297b0f){return client[_0xebe3('0x9')](_0x326a08,_0x2518a2)[_0xebe3('0xa')](function(_0x2518c6){logger[_0xebe3('0xb')](_0xebe3('0xc'),_0x6a0992,_0xebe3('0xd'));logger[_0xebe3('0xe')](_0xebe3('0xf'),_0x6a0992,_0xebe3('0xd'),JSON['stringify'](_0x2518c6));if(_0x2518c6['error']){if(_0x2518c6['error'][_0xebe3('0x10')]===0x1f4){logger[_0xebe3('0x11')](_0xebe3('0xc'),_0x6a0992,_0x2518c6['error']['message']);return _0x297b0f(_0x2518c6[_0xebe3('0x11')]['message']);}logger['error'](_0xebe3('0xc'),_0x6a0992,_0x2518c6[_0xebe3('0x11')]['message']);return _0x2f7108(_0x2518c6['error'][_0xebe3('0x12')]);}else{logger['info'](_0xebe3('0xc'),_0x6a0992,_0xebe3('0xd'));_0x2f7108(_0x2518c6[_0xebe3('0x13')]['message']);}})[_0xebe3('0x14')](function(_0x3ecca6){logger[_0xebe3('0x11')]('Schedule,\x20%s,\x20%s',_0x6a0992,_0x3ecca6);_0x297b0f(_0x3ecca6);});});}
\ No newline at end of file
+var _0x31f5=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2e1573,_0x310ebe){var _0x570266=function(_0x212322){while(--_0x212322){_0x2e1573['push'](_0x2e1573['shift']());}};_0x570266(++_0x310ebe);}(_0x31f5,0x87));var _0x531f=function(_0x2f0851,_0x514094){_0x2f0851=_0x2f0851-0x0;var _0x392239=_0x31f5[_0x2f0851];return _0x392239;};'use strict';var _=require(_0x531f('0x0'));var util=require(_0x531f('0x1'));var moment=require('moment');var BPromise=require(_0x531f('0x2'));var rs=require(_0x531f('0x3'));var fs=require('fs');var Redis=require(_0x531f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x531f('0x5'));var logger=require(_0x531f('0x6'))('rpc');var config=require(_0x531f('0x7'));var jayson=require(_0x531f('0x8'));var client=jayson[_0x531f('0x9')][_0x531f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b56c9,_0x86ba8c,_0x587198){return new BPromise(function(_0x24768d,_0x357dea){return client['request'](_0x3b56c9,_0x587198)[_0x531f('0xb')](function(_0x3f3a13){logger[_0x531f('0xc')](_0x531f('0xd'),_0x86ba8c,_0x531f('0xe'));logger[_0x531f('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x86ba8c,_0x531f('0xe'),JSON[_0x531f('0x10')](_0x3f3a13));if(_0x3f3a13[_0x531f('0x11')]){if(_0x3f3a13[_0x531f('0x11')][_0x531f('0x12')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x86ba8c,_0x3f3a13[_0x531f('0x11')]['message']);return _0x357dea(_0x3f3a13[_0x531f('0x11')][_0x531f('0x13')]);}logger[_0x531f('0x11')](_0x531f('0xd'),_0x86ba8c,_0x3f3a13['error']['message']);return _0x24768d(_0x3f3a13[_0x531f('0x11')][_0x531f('0x13')]);}else{logger[_0x531f('0xc')](_0x531f('0xd'),_0x86ba8c,_0x531f('0xe'));_0x24768d(_0x3f3a13[_0x531f('0x14')][_0x531f('0x13')]);}})[_0x531f('0x15')](function(_0x173a0e){logger[_0x531f('0x11')](_0x531f('0xd'),_0x86ba8c,_0x173a0e);_0x357dea(_0x173a0e);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x847f=['create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post'];(function(_0x5b38a8,_0x9e9558){var _0xb74f1d=function(_0x56ffaa){while(--_0x56ffaa){_0x5b38a8['push'](_0x5b38a8['shift']());}};_0xb74f1d(++_0x9e9558);}(_0x847f,0x125));var _0xf847=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0x847f[_0x2803ab];return _0x3d6e8e;};'use strict';var multer=require(_0xf847('0x0'));var util=require(_0xf847('0x1'));var path=require(_0xf847('0x2'));var timeout=require(_0xf847('0x3'));var express=require('express');var router=express[_0xf847('0x4')]();var fs_extra=require(_0xf847('0x5'));var auth=require(_0xf847('0x6'));var interaction=require(_0xf847('0x7'));var config=require(_0xf847('0x8'));var controller=require(_0xf847('0x9'));router[_0xf847('0xa')]('/',auth[_0xf847('0xb')](),controller[_0xf847('0xc')]);router['get'](_0xf847('0xd'),auth[_0xf847('0xb')](),controller[_0xf847('0xe')]);router['get'](_0xf847('0xf'),auth[_0xf847('0xb')](),controller['show']);router['get'](_0xf847('0x10'),auth[_0xf847('0xb')](),controller[_0xf847('0x11')]);router[_0xf847('0x12')]('/',auth[_0xf847('0xb')](),controller[_0xf847('0x13')]);router[_0xf847('0x14')]('/:id',auth[_0xf847('0xb')](),controller[_0xf847('0x15')]);router[_0xf847('0x16')](_0xf847('0xf'),auth['isAuthenticated'](),controller[_0xf847('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xe423=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get','/describe','/:id','isAuthenticated','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x241f45,_0x537289){var _0x3937ca=function(_0x5428c3){while(--_0x5428c3){_0x241f45['push'](_0x241f45['shift']());}};_0x3937ca(++_0x537289);}(_0xe423,0x1c9));var _0x3e42=function(_0x477aab,_0x4d08fd){_0x477aab=_0x477aab-0x0;var _0x2cd294=_0xe423[_0x477aab];return _0x2cd294;};'use strict';var multer=require(_0x3e42('0x0'));var util=require(_0x3e42('0x1'));var path=require('path');var timeout=require(_0x3e42('0x2'));var express=require(_0x3e42('0x3'));var router=express[_0x3e42('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3e42('0x5'));var interaction=require(_0x3e42('0x6'));var config=require(_0x3e42('0x7'));var controller=require(_0x3e42('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e42('0x9')]);router[_0x3e42('0xa')](_0x3e42('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3e42('0xa')](_0x3e42('0xc'),auth[_0x3e42('0xd')](),controller[_0x3e42('0xe')]);router[_0x3e42('0xa')](_0x3e42('0xf'),auth['isAuthenticated'](),controller[_0x3e42('0x10')]);router[_0x3e42('0x11')]('/',auth[_0x3e42('0xd')](),controller['create']);router[_0x3e42('0x12')](_0x3e42('0xc'),auth[_0x3e42('0xd')](),controller[_0x3e42('0x13')]);router[_0x3e42('0x14')](_0x3e42('0xc'),auth[_0x3e42('0xd')](),controller[_0x3e42('0x15')]);module[_0x3e42('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b29=['value','extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','../../config/environment','exports','getDataValue'];(function(_0x285c78,_0xc1816){var _0x5b48c3=function(_0x14bbdd){while(--_0x14bbdd){_0x285c78['push'](_0x285c78['shift']());}};_0x5b48c3(++_0xc1816);}(_0x2b29,0x163));var _0x92b2=function(_0x116cce,_0x59666a){_0x116cce=_0x116cce-0x0;var _0x2a7ceb=_0x2b29[_0x116cce];return _0x2a7ceb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var config=require(_0x92b2('0x2'));module[_0x92b2('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x92b2('0x4')](_0x92b2('0x5'))?path[_0x92b2('0x6')](this[_0x92b2('0x4')](_0x92b2('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x92b2('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x92b2('0x7')],'set':function(_0x536e21){var _0x29f183=_0x536e21[_0x92b2('0x8')](/\\/g,'/');this['setDataValue'](_0x92b2('0x5'),_0x29f183);}},'rating':{'type':Sequelize[_0x92b2('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x92b2('0x9')],'set':function(_0x465011){this['setDataValue'](_0x92b2('0xa'),moment()[_0x92b2('0xb')](_0x465011,'ms'));this[_0x92b2('0xc')](_0x92b2('0xd'),moment());this[_0x92b2('0xc')](_0x92b2('0xe'),_0x465011);}},'startedAt':{'type':Sequelize[_0x92b2('0xf')],'get':function(){return moment(this['getDataValue'](_0x92b2('0xa')))[_0x92b2('0x10')](_0x92b2('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x92b2('0xf')],'get':function(){return moment(this[_0x92b2('0x4')](_0x92b2('0xd')))[_0x92b2('0x10')](_0x92b2('0x11'))[_0x92b2('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x92b2('0x4')]('createdAt'))[_0x92b2('0x10')](_0x92b2('0x11'))[_0x92b2('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x92b2('0x13')))['format'](_0x92b2('0x11'))['toString']();}}};
\ No newline at end of file
+var _0x27f3=['closedAt','duration','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','moment','../../config/environment','exports','getDataValue','extname','value','STRING','setDataValue','INTEGER','subtract'];(function(_0x3e7657,_0x433d5d){var _0x5e3363=function(_0x58bd69){while(--_0x58bd69){_0x3e7657['push'](_0x3e7657['shift']());}};_0x5e3363(++_0x433d5d);}(_0x27f3,0x1e9));var _0x327f=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x27f3[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x327f('0x0'));var moment=require(_0x327f('0x1'));var path=require('path');var config=require(_0x327f('0x2'));module[_0x327f('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x327f('0x4')]('value')?path[_0x327f('0x5')](this[_0x327f('0x4')](_0x327f('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x327f('0x7')]},'channel':{'type':Sequelize[_0x327f('0x7')]},'value':{'type':Sequelize[_0x327f('0x7')],'set':function(_0x181949){var _0x19b8cc=_0x181949['replace'](/\\/g,'/');this[_0x327f('0x8')](_0x327f('0x6'),_0x19b8cc);}},'rating':{'type':Sequelize[_0x327f('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x327f('0x9')],'set':function(_0x89473b){this[_0x327f('0x8')]('startedAt',moment()[_0x327f('0xa')](_0x89473b,'ms'));this[_0x327f('0x8')](_0x327f('0xb'),moment());this[_0x327f('0x8')](_0x327f('0xc'),_0x89473b);}},'startedAt':{'type':Sequelize[_0x327f('0xd')],'get':function(){return moment(this[_0x327f('0x4')](_0x327f('0xe')))['format'](_0x327f('0xf'))[_0x327f('0x10')]();}},'closedAt':{'type':Sequelize[_0x327f('0xd')],'get':function(){return moment(this[_0x327f('0x4')](_0x327f('0xb')))[_0x327f('0x11')](_0x327f('0xf'))[_0x327f('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x327f('0x12')))[_0x327f('0x11')](_0x327f('0xf'))[_0x327f('0x10')]();}},'updatedAt':{'type':Sequelize[_0x327f('0xd')],'get':function(){return moment(this[_0x327f('0x4')](_0x327f('0x13')))[_0x327f('0x11')](_0x327f('0xf'))[_0x327f('0x10')]();}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));};
\ No newline at end of file
+var _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x86bebf,_0x5b2ebf){var _0x60337c=function(_0x3becac){while(--_0x3becac){_0x86bebf['push'](_0x86bebf['shift']());}};_0x60337c(++_0x5b2ebf);}(_0x032e,0x124));var _0xe032=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x032e[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05d8=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5c48aa,_0x1dd271){var _0xb24efa=function(_0x4812d2){while(--_0x4812d2){_0x5c48aa['push'](_0x5c48aa['shift']());}};_0xb24efa(++_0x1dd271);}(_0x05d8,0x145));var _0x805d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x05d8[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x805d('0x0'));var util=require(_0x805d('0x1'));var logger=require(_0x805d('0x2'))(_0x805d('0x3'));var moment=require(_0x805d('0x4'));var BPromise=require(_0x805d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x805d('0x6'));var rimraf=require(_0x805d('0x7'));var config=require(_0x805d('0x8'));var attributes=require('./screenRecording.attributes');module[_0x805d('0x9')]=function(_0x3495cc,_0x14cb75){return _0x3495cc[_0x805d('0xa')](_0x805d('0xb'),attributes,{'tableName':_0x805d('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x805d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0246=['path','rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x0246,0x131));var _0x6024=function(_0x451e9f,_0xde9064){_0x451e9f=_0x451e9f-0x0;var _0x51cce0=_0x0246[_0x451e9f];return _0x51cce0;};'use strict';var _=require(_0x6024('0x0'));var util=require(_0x6024('0x1'));var logger=require(_0x6024('0x2'))(_0x6024('0x3'));var moment=require(_0x6024('0x4'));var BPromise=require(_0x6024('0x5'));var rp=require(_0x6024('0x6'));var fs=require('fs');var path=require(_0x6024('0x7'));var rimraf=require(_0x6024('0x8'));var config=require(_0x6024('0x9'));var attributes=require(_0x6024('0xa'));module['exports']=function(_0x524a24,_0xf052c){return _0x524a24['define'](_0x6024('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x6024('0xc'),'fields':[_0x6024('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a3c=['rpc','../../config/environment','client','request','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x494164,_0x6b6852){var _0x4fad9f=function(_0xd47e30){while(--_0xd47e30){_0x494164['push'](_0x494164['shift']());}};_0x4fad9f(++_0x6b6852);}(_0x3a3c,0x174));var _0xc3a3=function(_0x36481f,_0x22de05){_0x36481f=_0x36481f-0x0;var _0x20c275=_0x3a3c[_0x36481f];return _0x20c275;};'use strict';var _=require(_0xc3a3('0x0'));var util=require(_0xc3a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc3a3('0x2'));var fs=require('fs');var Redis=require(_0xc3a3('0x3'));var db=require(_0xc3a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3a3('0x5'))(_0xc3a3('0x6'));var config=require(_0xc3a3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3a3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d0c3f,_0x11fa5b,_0x4bb3d4){return new BPromise(function(_0x327c54,_0x5f0643){return client[_0xc3a3('0x9')](_0x2d0c3f,_0x4bb3d4)['then'](function(_0x416600){logger[_0xc3a3('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x11fa5b,_0xc3a3('0xb'));logger[_0xc3a3('0xc')](_0xc3a3('0xd'),_0x11fa5b,_0xc3a3('0xb'),JSON[_0xc3a3('0xe')](_0x416600));if(_0x416600[_0xc3a3('0xf')]){if(_0x416600['error'][_0xc3a3('0x10')]===0x1f4){logger[_0xc3a3('0xf')](_0xc3a3('0x11'),_0x11fa5b,_0x416600[_0xc3a3('0xf')][_0xc3a3('0x12')]);return _0x5f0643(_0x416600[_0xc3a3('0xf')][_0xc3a3('0x12')]);}logger[_0xc3a3('0xf')](_0xc3a3('0x11'),_0x11fa5b,_0x416600[_0xc3a3('0xf')][_0xc3a3('0x12')]);return _0x327c54(_0x416600['error'][_0xc3a3('0x12')]);}else{logger['info'](_0xc3a3('0x11'),_0x11fa5b,'request\x20sent');_0x327c54(_0x416600[_0xc3a3('0x13')][_0xc3a3('0x12')]);}})[_0xc3a3('0x14')](function(_0x4b9d8e){logger[_0xc3a3('0xf')](_0xc3a3('0x11'),_0x11fa5b,_0x4b9d8e);_0x5f0643(_0x4b9d8e);});});}
\ No newline at end of file
+var _0x9194=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','util'];(function(_0x167664,_0x1d8785){var _0x5a1d7e=function(_0x49767a){while(--_0x49767a){_0x167664['push'](_0x167664['shift']());}};_0x5a1d7e(++_0x1d8785);}(_0x9194,0x197));var _0x4919=function(_0x4ed38e,_0xe64729){_0x4ed38e=_0x4ed38e-0x0;var _0x474627=_0x9194[_0x4ed38e];return _0x474627;};'use strict';var _=require('lodash');var util=require(_0x4919('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4919('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x4919('0x2'));var logger=require('../../config/logger')(_0x4919('0x3'));var config=require(_0x4919('0x4'));var jayson=require(_0x4919('0x5'));var client=jayson[_0x4919('0x6')][_0x4919('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43a458,_0x2d7a8a,_0x3f42c2){return new BPromise(function(_0x1339bd,_0x5e3775){return client['request'](_0x43a458,_0x3f42c2)['then'](function(_0x299270){logger[_0x4919('0x8')]('ScreenRecording,\x20%s,\x20%s',_0x2d7a8a,_0x4919('0x9'));logger[_0x4919('0xa')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2d7a8a,_0x4919('0x9'),JSON[_0x4919('0xb')](_0x299270));if(_0x299270[_0x4919('0xc')]){if(_0x299270[_0x4919('0xc')]['code']===0x1f4){logger[_0x4919('0xc')](_0x4919('0xd'),_0x2d7a8a,_0x299270['error'][_0x4919('0xe')]);return _0x5e3775(_0x299270[_0x4919('0xc')][_0x4919('0xe')]);}logger[_0x4919('0xc')](_0x4919('0xd'),_0x2d7a8a,_0x299270[_0x4919('0xc')][_0x4919('0xe')]);return _0x1339bd(_0x299270['error'][_0x4919('0xe')]);}else{logger[_0x4919('0x8')](_0x4919('0xd'),_0x2d7a8a,'request\x20sent');_0x1339bd(_0x299270[_0x4919('0xf')][_0x4919('0xe')]);}})[_0x4919('0x10')](function(_0x5b58c0){logger[_0x4919('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x2d7a8a,_0x5b58c0);_0x5e3775(_0x5b58c0);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd038=['index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','%s%s','logo','originalname','post','file','addLogo','root','format','extname','single','addLogoLogin','server/files/images/logos/','preferred','/:id/preferred','addPreferred','favicon','put','isAuthenticated','exports','path','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get'];(function(_0x1c655c,_0x43486e){var _0x3a3299=function(_0x486fbb){while(--_0x486fbb){_0x1c655c['push'](_0x1c655c['shift']());}};_0x3a3299(++_0x43486e);}(_0xd038,0x17f));var _0x8d03=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0xd038[_0x954b3a];return _0x3a313e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d03('0x0'));var timeout=require('connect-timeout');var express=require(_0x8d03('0x1'));var router=express[_0x8d03('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8d03('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8d03('0x4'));var controller=require(_0x8d03('0x5'));router[_0x8d03('0x6')]('/',auth['isAuthenticated'](),controller[_0x8d03('0x7')]);router[_0x8d03('0x6')](_0x8d03('0x8'),controller[_0x8d03('0x9')]);router['get'](_0x8d03('0xa'),controller[_0x8d03('0xb')]);router[_0x8d03('0x6')](_0x8d03('0xc'),controller['getLogo']);router[_0x8d03('0x6')](_0x8d03('0xd'),controller['getLogoLogin']);router[_0x8d03('0x6')](_0x8d03('0xe'),controller['gdpr']);router[_0x8d03('0x6')]('/:id/preferred',controller[_0x8d03('0xf')]);router['get'](_0x8d03('0x10'),controller[_0x8d03('0x11')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x4753e3,_0x3c48e6,_0x2abcca){_0x2abcca(null,path[_0x8d03('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2f082d,_0x194c4b,_0x4902e2){_0x4902e2(null,util['format'](_0x8d03('0x14'),_0x8d03('0x15'),path['extname'](_0x194c4b[_0x8d03('0x16')])));}})});router[_0x8d03('0x17')](_0x8d03('0xc'),upload['single'](_0x8d03('0x18')),controller[_0x8d03('0x19')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x30fc94,_0x27ee66,_0x141c74){_0x141c74(null,path[_0x8d03('0x13')](config[_0x8d03('0x1a')],'server/files/images/logos/'));},'filename':function(_0x5bb7e9,_0xe172ed,_0xe24c65){_0xe24c65(null,util[_0x8d03('0x1b')]('%s%s','logologin',path[_0x8d03('0x1c')](_0xe172ed[_0x8d03('0x16')])));}})});router[_0x8d03('0x17')](_0x8d03('0xd'),upload[_0x8d03('0x1d')](_0x8d03('0x18')),controller[_0x8d03('0x1e')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x1f4f13,_0x288212,_0x5653bf){_0x5653bf(null,path[_0x8d03('0x13')](config[_0x8d03('0x1a')],_0x8d03('0x1f')));},'filename':function(_0x547781,_0x494515,_0x11483a){_0x11483a(null,util[_0x8d03('0x1b')](_0x8d03('0x14'),_0x8d03('0x20'),path[_0x8d03('0x1c')](_0x494515['originalname'])));}})});router['post'](_0x8d03('0x21'),upload[_0x8d03('0x1d')](_0x8d03('0x18')),controller[_0x8d03('0x22')]);var upload=multer({'storage':multer[_0x8d03('0x12')]({'destination':function(_0x30cdd1,_0x553ab5,_0x15d715){_0x15d715(null,path[_0x8d03('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5aa8bd,_0x58abbb,_0x40403d){_0x40403d(null,util[_0x8d03('0x1b')](_0x8d03('0x14'),_0x8d03('0x23'),path['extname'](_0x58abbb[_0x8d03('0x16')])));}})});router[_0x8d03('0x17')](_0x8d03('0x10'),upload[_0x8d03('0x1d')](_0x8d03('0x18')),controller['addFavicon']);router[_0x8d03('0x24')](_0x8d03('0xa'),auth[_0x8d03('0x25')](),controller['update']);module[_0x8d03('0x26')]=router;
\ No newline at end of file
+var _0xee19=['/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','originalname','post','single','file','addLogo','%s%s','logologin','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0xee19,0xdb));var _0x9ee1=function(_0x54d94e,_0x2c611c){_0x54d94e=_0x54d94e-0x0;var _0x1dd136=_0xee19[_0x54d94e];return _0x1dd136;};'use strict';var multer=require(_0x9ee1('0x0'));var util=require(_0x9ee1('0x1'));var path=require(_0x9ee1('0x2'));var timeout=require(_0x9ee1('0x3'));var express=require(_0x9ee1('0x4'));var router=express[_0x9ee1('0x5')]();var fs_extra=require(_0x9ee1('0x6'));var auth=require(_0x9ee1('0x7'));var interaction=require(_0x9ee1('0x8'));var config=require(_0x9ee1('0x9'));var controller=require(_0x9ee1('0xa'));router[_0x9ee1('0xb')]('/',auth[_0x9ee1('0xc')](),controller[_0x9ee1('0xd')]);router[_0x9ee1('0xb')](_0x9ee1('0xe'),controller[_0x9ee1('0xf')]);router['get'](_0x9ee1('0x10'),controller['show']);router[_0x9ee1('0xb')](_0x9ee1('0x11'),controller[_0x9ee1('0x12')]);router['get'](_0x9ee1('0x13'),controller[_0x9ee1('0x14')]);router[_0x9ee1('0xb')](_0x9ee1('0x15'),controller['gdpr']);router[_0x9ee1('0xb')]('/:id/preferred',controller[_0x9ee1('0x16')]);router[_0x9ee1('0xb')]('/:id/favicon',controller[_0x9ee1('0x17')]);var upload=multer({'storage':multer[_0x9ee1('0x18')]({'destination':function(_0x480f74,_0x4684b2,_0x456f0b){_0x456f0b(null,path[_0x9ee1('0x19')](config[_0x9ee1('0x1a')],_0x9ee1('0x1b')));},'filename':function(_0x552f82,_0x496a24,_0x3b9a6a){_0x3b9a6a(null,util[_0x9ee1('0x1c')]('%s%s',_0x9ee1('0x1d'),path[_0x9ee1('0x1e')](_0x496a24[_0x9ee1('0x1f')])));}})});router[_0x9ee1('0x20')](_0x9ee1('0x11'),upload[_0x9ee1('0x21')](_0x9ee1('0x22')),controller[_0x9ee1('0x23')]);var upload=multer({'storage':multer[_0x9ee1('0x18')]({'destination':function(_0x58b719,_0x306bb5,_0x41c3ab){_0x41c3ab(null,path['join'](config[_0x9ee1('0x1a')],_0x9ee1('0x1b')));},'filename':function(_0x114522,_0x41dbe7,_0x5c2f40){_0x5c2f40(null,util[_0x9ee1('0x1c')](_0x9ee1('0x24'),_0x9ee1('0x25'),path[_0x9ee1('0x1e')](_0x41dbe7[_0x9ee1('0x1f')])));}})});router[_0x9ee1('0x20')](_0x9ee1('0x13'),upload[_0x9ee1('0x21')](_0x9ee1('0x22')),controller[_0x9ee1('0x26')]);var upload=multer({'storage':multer[_0x9ee1('0x18')]({'destination':function(_0x5bf5cc,_0x3bcf9b,_0x4a0421){_0x4a0421(null,path['join'](config[_0x9ee1('0x1a')],'server/files/images/logos/'));},'filename':function(_0x26bdaa,_0x4e7e27,_0x542cfd){_0x542cfd(null,util[_0x9ee1('0x1c')](_0x9ee1('0x24'),_0x9ee1('0x27'),path[_0x9ee1('0x1e')](_0x4e7e27[_0x9ee1('0x1f')])));}})});router[_0x9ee1('0x20')](_0x9ee1('0x28'),upload[_0x9ee1('0x21')](_0x9ee1('0x22')),controller[_0x9ee1('0x29')]);var upload=multer({'storage':multer[_0x9ee1('0x18')]({'destination':function(_0x2475b4,_0x30c3c9,_0x20254c){_0x20254c(null,path[_0x9ee1('0x19')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1b1a86,_0x540949,_0x5c04b4){_0x5c04b4(null,util['format'](_0x9ee1('0x24'),_0x9ee1('0x2a'),path['extname'](_0x540949['originalname'])));}})});router[_0x9ee1('0x20')](_0x9ee1('0x2b'),upload[_0x9ee1('0x21')](_0x9ee1('0x22')),controller[_0x9ee1('0x2c')]);router[_0x9ee1('0x2d')]('/:id',auth['isAuthenticated'](),controller[_0x9ee1('0x2e')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x10b4=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x10b4,0xba));var _0x410b=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x10b4[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x410b('0x0'));module[_0x410b('0x1')]={'min_internal':{'type':Sequelize[_0x410b('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x410b('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x410b('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x410b('0x3')],'defaultValue':_0x410b('0x4')},'logo':{'type':Sequelize[_0x410b('0x3')]},'defaultLogo':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x410b('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x410b('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x410b('0x3')]},'turnusername':{'type':Sequelize[_0x410b('0x3')]},'turnpassword':{'type':Sequelize[_0x410b('0x3')]},'pageTitle':{'type':Sequelize[_0x410b('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x410b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x410b('0x6')},'enableEmailPreview':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x410b('0x3')],'defaultValue':_0x410b('0x7')},'chatTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x410b('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x410b('0x3')]},'defaultFavicon':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x410b('0x2')]},'transcribeRegion':{'type':Sequelize[_0x410b('0x3')]},'sentiment':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x410b('0x2')]},'sentimentRegion':{'type':Sequelize[_0x410b('0x3')]},'language':{'type':Sequelize[_0x410b('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x410b('0x2')](0x2)[_0x410b('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x410b('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x410b('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x410b('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x305f5c,_0x4324b1){var _0x3d62c=function(_0x24b361){while(--_0x24b361){_0x305f5c['push'](_0x305f5c['shift']());}};_0x3d62c(++_0x4324b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ce3=['destroy','then','stack','name','status','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','include','catch','show','params','includeAll','options','body','find','addLogo','file','filename','logo','loginLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','favicon','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','gdpr','addPreferred','default_preferred.png','addFavicon','default_favicon.ico','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x21f995,_0x4460e6){var _0x40db0f=function(_0x37b9c1){while(--_0x37b9c1){_0x21f995['push'](_0x21f995['shift']());}};_0x40db0f(++_0x4460e6);}(_0x8ce3,0xc3));var _0x38ce=function(_0x4a6339,_0x30cd3a){_0x4a6339=_0x4a6339-0x0;var _0x5e9a19=_0x8ce3[_0x4a6339];return _0x5e9a19;};'use strict';var emlformat=require(_0x38ce('0x0'));var rimraf=require(_0x38ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ce('0x2'));var rp=require(_0x38ce('0x3'));var moment=require(_0x38ce('0x4'));var BPromise=require(_0x38ce('0x5'));var Mustache=require(_0x38ce('0x6'));var util=require(_0x38ce('0x7'));var path=require(_0x38ce('0x8'));var sox=require(_0x38ce('0x9'));var csv=require('to-csv');var ejs=require(_0x38ce('0xa'));var fs=require('fs');var fs_extra=require(_0x38ce('0xb'));var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xf'));var querystring=require('querystring');var Papa=require(_0x38ce('0x10'));var Redis=require('ioredis');var authService=require(_0x38ce('0x11'));var qs=require(_0x38ce('0x12'));var as=require(_0x38ce('0x13'));var hardwareService=require(_0x38ce('0x14'));var logger=require(_0x38ce('0x15'))(_0x38ce('0x16'));var utils=require(_0x38ce('0x17'));var config=require(_0x38ce('0x18'));var licenseUtil=require(_0x38ce('0x19'));var db=require(_0x38ce('0x1a'))['db'];var jayson=require(_0x38ce('0x1b'));var client=jayson[_0x38ce('0x1c')][_0x38ce('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x263d6f,_0x2e661b,_0x2cf066,_0x56a09f){return new BPromise(function(_0x48ba7c,_0x3c4d7f){var _0x2aabd8=_0x56a09f||client;return _0x2aabd8[_0x38ce('0x1e')](_0x263d6f,_0x2cf066)['then'](function(_0x2f3b99){logger['info'](_0x38ce('0x1f'),_0x2e661b,_0x38ce('0x20'));logger['debug'](_0x38ce('0x21'),_0x2e661b,_0x38ce('0x20'),JSON[_0x38ce('0x22')](_0x2f3b99));if(_0x2f3b99['error']){if(_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x24')]===0x1f4){logger[_0x38ce('0x23')](_0x38ce('0x1f'),_0x2e661b,_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x25')]);return _0x3c4d7f(_0x2f3b99[_0x38ce('0x23')]['message']);}logger[_0x38ce('0x23')](_0x38ce('0x1f'),_0x2e661b,_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x25')]);return _0x48ba7c(_0x2f3b99[_0x38ce('0x23')][_0x38ce('0x25')]);}else{logger[_0x38ce('0x26')](_0x38ce('0x1f'),_0x2e661b,_0x38ce('0x20'));_0x48ba7c(_0x2f3b99[_0x38ce('0x27')][_0x38ce('0x25')]);}})['catch'](function(_0x1cc10b){logger[_0x38ce('0x23')](_0x38ce('0x1f'),_0x2e661b,_0x1cc10b);_0x3c4d7f(_0x1cc10b);});});}function respondWithStatusCode(_0xcf5d9e,_0x4a56b0){_0x4a56b0=_0x4a56b0||0xcc;return function(_0x2c85e6){if(_0x2c85e6){return _0xcf5d9e[_0x38ce('0x28')](_0x4a56b0);}return _0xcf5d9e['status'](_0x4a56b0)[_0x38ce('0x29')]();};}function respondWithResult(_0x38cf83,_0x43b479){_0x43b479=_0x43b479||0xc8;return function(_0x5b330c){if(_0x5b330c){return _0x38cf83['status'](_0x43b479)[_0x38ce('0x2a')](_0x5b330c);}};}function respondWithFilteredResult(_0x28ab4c,_0x142d72){return function(_0x21d4e7){if(_0x21d4e7){var _0x264cf0=typeof _0x142d72[_0x38ce('0x2b')]===_0x38ce('0x2c')&&typeof _0x142d72[_0x38ce('0x2d')]===_0x38ce('0x2c');var _0x4649be=_0x21d4e7[_0x38ce('0x2e')];var _0x381703=_0x264cf0?0x0:_0x142d72['offset'];var _0x1212dd=_0x264cf0?_0x21d4e7[_0x38ce('0x2e')]:_0x142d72['offset']+_0x142d72[_0x38ce('0x2d')];var _0x3cbead;if(_0x1212dd>=_0x4649be){_0x1212dd=_0x4649be;_0x3cbead=0xc8;}else{_0x3cbead=0xce;}_0x28ab4c['status'](_0x3cbead);return _0x28ab4c[_0x38ce('0x2f')](_0x38ce('0x30'),_0x381703+'-'+_0x1212dd+'/'+_0x4649be)['json'](_0x21d4e7);}return null;};}function patchUpdates(_0x28d775){return function(_0x53f2c9){try{jsonpatch[_0x38ce('0x31')](_0x53f2c9,_0x28d775,!![]);}catch(_0x336f8c){return BPromise[_0x38ce('0x32')](_0x336f8c);}return _0x53f2c9[_0x38ce('0x33')]();};}function saveUpdates(_0x444b93,_0x23019f){return function(_0x34262a){if(_0x34262a){return _0x34262a[_0x38ce('0x34')](_0x444b93)['then'](function(_0x4e5bf6){return _0x4e5bf6;});}return null;};}function removeEntity(_0x469b65,_0xc4dd0f){return function(_0x3cba20){if(_0x3cba20){return _0x3cba20[_0x38ce('0x35')]()[_0x38ce('0x36')](function(){_0x469b65['status'](0xcc)[_0x38ce('0x29')]();});}};}function handleEntityNotFound(_0x12c68b,_0x37f696){return function(_0xb19f75){if(!_0xb19f75){_0x12c68b[_0x38ce('0x28')](0x194);}return _0xb19f75;};}function handleError(_0x231268,_0x3d7f64){_0x3d7f64=_0x3d7f64||0x1f4;return function(_0x54050a){logger[_0x38ce('0x23')](_0x54050a[_0x38ce('0x37')]);if(_0x54050a['name']){delete _0x54050a[_0x38ce('0x38')];}_0x231268[_0x38ce('0x39')](_0x3d7f64)[_0x38ce('0x3a')](_0x54050a);};}exports[_0x38ce('0x3b')]=function(_0x1eb47e,_0x3d6838){var _0x2f9173={},_0xa3ccce={},_0x4b779b={'count':0x0,'rows':[]};var _0x3d2c8c=_[_0x38ce('0x3c')](db[_0x38ce('0x3d')][_0x38ce('0x3e')],function(_0x49ff68){return{'name':_0x49ff68[_0x38ce('0x3f')],'type':_0x49ff68['type'][_0x38ce('0x40')]};});_0xa3ccce[_0x38ce('0x41')]=_[_0x38ce('0x3c')](_0x3d2c8c,_0x38ce('0x38'));_0xa3ccce[_0x38ce('0x42')]=_[_0x38ce('0x43')](_0x1eb47e['query']);_0xa3ccce[_0x38ce('0x44')]=_['intersection'](_0xa3ccce[_0x38ce('0x41')],_0xa3ccce[_0x38ce('0x42')]);_0x2f9173[_0x38ce('0x45')]=_[_0x38ce('0x46')](_0xa3ccce[_0x38ce('0x41')],qs[_0x38ce('0x47')](_0x1eb47e['query'][_0x38ce('0x47')]));_0x2f9173[_0x38ce('0x45')]=_0x2f9173[_0x38ce('0x45')][_0x38ce('0x48')]?_0x2f9173[_0x38ce('0x45')]:_0xa3ccce[_0x38ce('0x41')];if(!_0x1eb47e['query']['hasOwnProperty'](_0x38ce('0x49'))){_0x2f9173[_0x38ce('0x2d')]=qs[_0x38ce('0x2d')](_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x2d')]);_0x2f9173[_0x38ce('0x2b')]=qs[_0x38ce('0x2b')](_0x1eb47e['query'][_0x38ce('0x2b')]);}_0x2f9173[_0x38ce('0x4a')]=qs['sort'](_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x4b')]);_0x2f9173[_0x38ce('0x4c')]=qs['filters'](_[_0x38ce('0x4d')](_0x1eb47e[_0x38ce('0x42')],_0xa3ccce[_0x38ce('0x44')]),_0x3d2c8c);if(_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x4e')]){_0x2f9173[_0x38ce('0x4c')]=_['merge'](_0x2f9173[_0x38ce('0x4c')],{'$or':_[_0x38ce('0x3c')](_0x3d2c8c,function(_0x33d2e1){if(_0x33d2e1[_0x38ce('0x4f')]!==_0x38ce('0x50')){var _0x6cf4d9={};_0x6cf4d9[_0x33d2e1['name']]={'$like':'%'+_0x1eb47e[_0x38ce('0x42')][_0x38ce('0x4e')]+'%'};return _0x6cf4d9;}})});}_0x2f9173=_['merge']({},_0x2f9173,_0x1eb47e['options']);var _0x5833a2={'where':_0x2f9173[_0x38ce('0x4c')]};return db[_0x38ce('0x3d')]['count'](_0x5833a2)['then'](function(_0x2e8d94){_0x4b779b['count']=_0x2e8d94;if(_0x1eb47e[_0x38ce('0x42')]['includeAll']){_0x2f9173[_0x38ce('0x51')]=[{'all':!![]}];}return db[_0x38ce('0x3d')]['findAll'](_0x2f9173);})[_0x38ce('0x36')](function(_0x17a8cf){_0x4b779b['rows']=_0x17a8cf;return _0x4b779b;})[_0x38ce('0x36')](respondWithFilteredResult(_0x3d6838,_0x2f9173))[_0x38ce('0x52')](handleError(_0x3d6838,null));};exports[_0x38ce('0x53')]=function(_0x5ce80e,_0x98e046){var _0x25a299={'raw':![],'where':{'id':_0x5ce80e[_0x38ce('0x54')]['id']}},_0x58cc6f={};_0x58cc6f[_0x38ce('0x41')]=_['keys'](db[_0x38ce('0x3d')][_0x38ce('0x3e')]);_0x58cc6f[_0x38ce('0x42')]=_[_0x38ce('0x43')](_0x5ce80e[_0x38ce('0x42')]);_0x58cc6f[_0x38ce('0x44')]=_[_0x38ce('0x46')](_0x58cc6f['model'],_0x58cc6f[_0x38ce('0x42')]);_0x25a299[_0x38ce('0x45')]=_[_0x38ce('0x46')](_0x58cc6f[_0x38ce('0x41')],qs[_0x38ce('0x47')](_0x5ce80e[_0x38ce('0x42')]['fields']));_0x25a299['attributes']=_0x25a299[_0x38ce('0x45')][_0x38ce('0x48')]?_0x25a299[_0x38ce('0x45')]:_0x58cc6f[_0x38ce('0x41')];if(_0x5ce80e[_0x38ce('0x42')][_0x38ce('0x55')]){_0x25a299['include']=[{'all':!![]}];}_0x25a299=_['merge']({},_0x25a299,_0x5ce80e[_0x38ce('0x56')]);return db['Setting']['find'](_0x25a299)[_0x38ce('0x36')](handleEntityNotFound(_0x98e046,null))[_0x38ce('0x36')](respondWithResult(_0x98e046,null))[_0x38ce('0x52')](handleError(_0x98e046,null));};exports[_0x38ce('0x34')]=function(_0xd031c0,_0x56b466){if(_0xd031c0[_0x38ce('0x57')]['id']){delete _0xd031c0[_0x38ce('0x57')]['id'];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0xd031c0[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x56b466,null))[_0x38ce('0x36')](saveUpdates(_0xd031c0[_0x38ce('0x57')],null))[_0x38ce('0x36')](respondWithResult(_0x56b466,null))[_0x38ce('0x52')](handleError(_0x56b466,null));};exports[_0x38ce('0x59')]=function(_0x56d63e,_0x5d1df1,_0x40564c){if(_0x56d63e[_0x38ce('0x5a')]&&_0x56d63e[_0x38ce('0x5a')][_0x38ce('0x5b')]){_0x56d63e['body'][_0x38ce('0x5c')]=_0x56d63e[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x56d63e[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x5d1df1,null))['then'](saveUpdates(_0x56d63e[_0x38ce('0x57')],null))[_0x38ce('0x36')](respondWithResult(_0x5d1df1,null))['catch'](handleError(_0x5d1df1,null));};exports['addLogoLogin']=function(_0x201294,_0x3ce5c0,_0x158532){if(_0x201294['file']&&_0x201294['file'][_0x38ce('0x5b')]){_0x201294['body'][_0x38ce('0x5d')]=_0x201294[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')]['find']({'where':{'id':_0x201294[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x3ce5c0,null))[_0x38ce('0x36')](saveUpdates(_0x201294['body'],null))[_0x38ce('0x36')](respondWithResult(_0x3ce5c0,null))[_0x38ce('0x52')](handleError(_0x3ce5c0,null));};var utilLicense=require(_0x38ce('0x19'));exports['getLogo']=function(_0x389b23,_0x50dcfb,_0xaabec0){var _0x51adaa=_0x38ce('0x5e');var _0x167ec1={'custom':![]};return utilLicense[_0x38ce('0x5f')]()[_0x38ce('0x36')](function(_0x587e62){if(_0x587e62){_0x167ec1=_0x587e62;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x389b23[_0x38ce('0x54')]['id']},'attributes':[_0x38ce('0x5c'),_0x38ce('0x5d'),_0x38ce('0x60'),'favicon',_0x38ce('0x61'),'defaultLoginLogo',_0x38ce('0x62'),_0x38ce('0x63')],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x50dcfb,null))[_0x38ce('0x36')](function(_0x32290f){if(_0x32290f){var _0x3a6945=_0x32290f[_0x38ce('0x5c')]&&fs[_0x38ce('0x64')](path['join'](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x32290f[_0x38ce('0x5c')])))?path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x32290f[_0x38ce('0x5c')])):path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x38ce('0x68')));var _0x77855d=_0x38ce('0x69')+_[_0x38ce('0x6a')](_0x38ce('0x5c'));if(_0x32290f[_0x77855d]||!_0x167ec1[_0x38ce('0x6b')]){_0x3a6945=path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x51adaa,_[_0x38ce('0x66')](_0x38ce('0x68')));}if(!fs['existsSync'](_0x3a6945)){throw new db[(_0x38ce('0x6c'))][(_0x38ce('0x6d'))](_[_0x38ce('0x6a')]('logo')+'\x20not\x20found');}return _0x50dcfb[_0x38ce('0x6e')](_0x3a6945);}})[_0x38ce('0x52')](handleError(_0x50dcfb,null));};var utilLicense=require('../../config/license/util');exports[_0x38ce('0x6f')]=function(_0x37ec69,_0x59a6be,_0x4ffa7b){var _0x1f7d08=_0x38ce('0x5e');var _0x59741c={'custom':![]};return utilLicense[_0x38ce('0x5f')]()[_0x38ce('0x36')](function(_0x158ba7){if(_0x158ba7){_0x59741c=_0x158ba7;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x37ec69[_0x38ce('0x54')]['id']},'attributes':[_0x38ce('0x5c'),_0x38ce('0x5d'),'preferred',_0x38ce('0x70'),_0x38ce('0x61'),_0x38ce('0x71'),_0x38ce('0x62'),_0x38ce('0x63')],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x59a6be,null))[_0x38ce('0x36')](function(_0x595d81){if(_0x595d81){var _0x5a74d1=_0x595d81['loginLogo']&&fs[_0x38ce('0x64')](path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x1f7d08,_[_0x38ce('0x66')](_0x595d81[_0x38ce('0x5d')])))?path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x1f7d08,_['toLower'](_0x595d81[_0x38ce('0x5d')])):path['join'](config['root'],_0x1f7d08,_['toLower'](_0x38ce('0x72')));var _0x1025c0=_0x38ce('0x69')+_['upperFirst'](_0x38ce('0x5d'));if(_0x595d81[_0x1025c0]||!_0x59741c[_0x38ce('0x6b')]){_0x5a74d1=path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x1f7d08,_[_0x38ce('0x66')]('default_loginLogo.svg'));}if(!fs[_0x38ce('0x64')](_0x5a74d1)){throw new db['Sequelize'][(_0x38ce('0x6d'))](_[_0x38ce('0x6a')]('loginLogo')+_0x38ce('0x73'));}return _0x59a6be[_0x38ce('0x6e')](_0x5a74d1);}})[_0x38ce('0x52')](handleError(_0x59a6be,null));};exports[_0x38ce('0x74')]=function(_0x5b22cb,_0x5e0006){return db['Setting']['find']({'where':{'id':_0x5b22cb['params']['id']},'attributes':['securePassword']})[_0x38ce('0x36')](respondWithResult(_0x5e0006,null))[_0x38ce('0x52')](handleError(_0x5e0006,null));};exports[_0x38ce('0x75')]=function(_0x3e493b,_0x524a4b,_0x5be2e5){if(_0x3e493b[_0x38ce('0x5a')]&&_0x3e493b['file'][_0x38ce('0x5b')]){_0x3e493b[_0x38ce('0x57')][_0x38ce('0x60')]=_0x3e493b[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x3e493b[_0x38ce('0x54')]['id']}})[_0x38ce('0x36')](handleEntityNotFound(_0x524a4b,null))['then'](saveUpdates(_0x3e493b[_0x38ce('0x57')],null))[_0x38ce('0x36')](respondWithResult(_0x524a4b,null))[_0x38ce('0x52')](handleError(_0x524a4b,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x4fa65f,_0x2b9106,_0x147e81){var _0xb4b8ef=_0x38ce('0x5e');var _0x347037={'custom':![]};return utilLicense[_0x38ce('0x5f')]()[_0x38ce('0x36')](function(_0x345ba4){if(_0x345ba4){_0x347037=_0x345ba4;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x4fa65f[_0x38ce('0x54')]['id']},'attributes':[_0x38ce('0x5c'),_0x38ce('0x5d'),_0x38ce('0x60'),_0x38ce('0x70'),_0x38ce('0x61'),_0x38ce('0x71'),_0x38ce('0x62'),_0x38ce('0x63')],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x2b9106,null))['then'](function(_0x160f75){if(_0x160f75){var _0xe96ede=_0x160f75[_0x38ce('0x60')]&&fs['existsSync'](path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0xb4b8ef,_[_0x38ce('0x66')](_0x160f75[_0x38ce('0x60')])))?path['join'](config[_0x38ce('0x65')],_0xb4b8ef,_[_0x38ce('0x66')](_0x160f75[_0x38ce('0x60')])):path[_0x38ce('0x67')](config['root'],_0xb4b8ef,_[_0x38ce('0x66')](_0x38ce('0x76')));var _0x2952f6=_0x38ce('0x69')+_[_0x38ce('0x6a')](_0x38ce('0x60'));if(_0x160f75[_0x2952f6]||!_0x347037[_0x38ce('0x6b')]||!_0x347037[_0x38ce('0x60')]){_0xe96ede=path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0xb4b8ef,_[_0x38ce('0x66')](_0x38ce('0x76')));}if(!fs['existsSync'](_0xe96ede)){throw new db[(_0x38ce('0x6c'))][(_0x38ce('0x6d'))](_[_0x38ce('0x6a')](_0x38ce('0x60'))+_0x38ce('0x73'));}return _0x2b9106['download'](_0xe96ede);}})['catch'](handleError(_0x2b9106,null));};exports[_0x38ce('0x77')]=function(_0x5f0091,_0xed7dcc,_0x217454){if(_0x5f0091['file']&&_0x5f0091[_0x38ce('0x5a')][_0x38ce('0x5b')]){_0x5f0091['body'][_0x38ce('0x70')]=_0x5f0091[_0x38ce('0x5a')][_0x38ce('0x5b')];}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x5f0091[_0x38ce('0x54')]['id']}})['then'](handleEntityNotFound(_0xed7dcc,null))[_0x38ce('0x36')](saveUpdates(_0x5f0091[_0x38ce('0x57')],null))['then'](respondWithResult(_0xed7dcc,null))['catch'](handleError(_0xed7dcc,null));};var utilLicense=require(_0x38ce('0x19'));exports['getFavicon']=function(_0x26b55e,_0x38d230,_0x384d74){var _0x35e4d2=_0x38ce('0x5e');var _0x20e6a4={'custom':![]};return utilLicense[_0x38ce('0x5f')]()['then'](function(_0x43dee2){if(_0x43dee2){_0x20e6a4=_0x43dee2;}return db[_0x38ce('0x3d')][_0x38ce('0x58')]({'where':{'id':_0x26b55e['params']['id']},'attributes':[_0x38ce('0x5c'),'loginLogo',_0x38ce('0x60'),_0x38ce('0x70'),'defaultLogo','defaultLoginLogo',_0x38ce('0x62'),'defaultFavicon'],'raw':!![]});})[_0x38ce('0x36')](handleEntityNotFound(_0x38d230,null))[_0x38ce('0x36')](function(_0x44ec34){if(_0x44ec34){var _0x2e0c77=_0x44ec34[_0x38ce('0x70')]&&fs['existsSync'](path[_0x38ce('0x67')](config[_0x38ce('0x65')],_0x35e4d2,_[_0x38ce('0x66')](_0x44ec34['favicon'])))?path['join'](config[_0x38ce('0x65')],_0x35e4d2,_[_0x38ce('0x66')](_0x44ec34[_0x38ce('0x70')])):path[_0x38ce('0x67')](config['root'],_0x35e4d2,_[_0x38ce('0x66')](_0x38ce('0x78')));var _0x2954d0=_0x38ce('0x69')+_['upperFirst'](_0x38ce('0x70'));if(_0x44ec34[_0x2954d0]||!_0x20e6a4[_0x38ce('0x6b')]){_0x2e0c77=path['join'](config[_0x38ce('0x65')],_0x35e4d2,_['toLower'](_0x38ce('0x78')));}if(!fs['existsSync'](_0x2e0c77)){throw new db[(_0x38ce('0x6c'))][(_0x38ce('0x6d'))](_['upperFirst'](_0x38ce('0x70'))+'\x20not\x20found');}return _0x38d230[_0x38ce('0x6e')](_0x2e0c77);}})[_0x38ce('0x52')](handleError(_0x38d230,null));};exports['getDate']=function(_0xb5b839,_0x422c8e){var _0x519a35={'offset':moment()['utcOffset']()};_0x519a35[_0x38ce('0x79')]=moment()['utcOffset'](_0x519a35['offset'])[_0x38ce('0x7a')](_0x38ce('0x7b'));return _0x422c8e[_0x38ce('0x39')](0xc8)['send'](_0x519a35);};
\ No newline at end of file
+var _0x30e9=['jayson/promise','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','addLogo','file','logo','filename','body','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','gdpr','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','now','utcOffset','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3a8702,_0x115db6){var _0x56220c=function(_0x47cad1){while(--_0x47cad1){_0x3a8702['push'](_0x3a8702['shift']());}};_0x56220c(++_0x115db6);}(_0x30e9,0x158));var _0x930e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x30e9[_0xbb091];return _0x467a04;};'use strict';var emlformat=require(_0x930e('0x0'));var rimraf=require(_0x930e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x930e('0x2'));var moment=require(_0x930e('0x3'));var BPromise=require(_0x930e('0x4'));var Mustache=require(_0x930e('0x5'));var util=require(_0x930e('0x6'));var path=require(_0x930e('0x7'));var sox=require(_0x930e('0x8'));var csv=require(_0x930e('0x9'));var ejs=require(_0x930e('0xa'));var fs=require('fs');var fs_extra=require(_0x930e('0xb'));var _=require(_0x930e('0xc'));var squel=require(_0x930e('0xd'));var crypto=require(_0x930e('0xe'));var jsforce=require(_0x930e('0xf'));var deskjs=require(_0x930e('0x10'));var toCsv=require(_0x930e('0x9'));var querystring=require(_0x930e('0x11'));var Papa=require(_0x930e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x930e('0x13'));var as=require(_0x930e('0x14'));var hardwareService=require(_0x930e('0x15'));var logger=require(_0x930e('0x16'))(_0x930e('0x17'));var utils=require(_0x930e('0x18'));var config=require(_0x930e('0x19'));var licenseUtil=require(_0x930e('0x1a'));var db=require(_0x930e('0x1b'))['db'];var jayson=require(_0x930e('0x1c'));var client=jayson[_0x930e('0x1d')][_0x930e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x50f97b,_0x5e912d,_0x24c206,_0x5d6c84){return new BPromise(function(_0x44cb60,_0x5a5a99){var _0x1fe373=_0x5d6c84||client;return _0x1fe373[_0x930e('0x1f')](_0x50f97b,_0x24c206)['then'](function(_0x48b80d){logger[_0x930e('0x20')]('Setting,\x20%s,\x20%s',_0x5e912d,_0x930e('0x21'));logger[_0x930e('0x22')](_0x930e('0x23'),_0x5e912d,'request\x20sent',JSON[_0x930e('0x24')](_0x48b80d));if(_0x48b80d[_0x930e('0x25')]){if(_0x48b80d[_0x930e('0x25')][_0x930e('0x26')]===0x1f4){logger[_0x930e('0x25')](_0x930e('0x27'),_0x5e912d,_0x48b80d[_0x930e('0x25')][_0x930e('0x28')]);return _0x5a5a99(_0x48b80d[_0x930e('0x25')]['message']);}logger[_0x930e('0x25')](_0x930e('0x27'),_0x5e912d,_0x48b80d[_0x930e('0x25')][_0x930e('0x28')]);return _0x44cb60(_0x48b80d[_0x930e('0x25')]['message']);}else{logger[_0x930e('0x20')](_0x930e('0x27'),_0x5e912d,'request\x20sent');_0x44cb60(_0x48b80d['result'][_0x930e('0x28')]);}})[_0x930e('0x29')](function(_0x17f363){logger['error'](_0x930e('0x27'),_0x5e912d,_0x17f363);_0x5a5a99(_0x17f363);});});}function respondWithStatusCode(_0x3c28e2,_0x2d0390){_0x2d0390=_0x2d0390||0xcc;return function(_0x5ca6d2){if(_0x5ca6d2){return _0x3c28e2[_0x930e('0x2a')](_0x2d0390);}return _0x3c28e2[_0x930e('0x2b')](_0x2d0390)[_0x930e('0x2c')]();};}function respondWithResult(_0xbc1f5,_0x2b26df){_0x2b26df=_0x2b26df||0xc8;return function(_0x5c804c){if(_0x5c804c){return _0xbc1f5[_0x930e('0x2b')](_0x2b26df)[_0x930e('0x2d')](_0x5c804c);}};}function respondWithFilteredResult(_0x223d91,_0x55090f){return function(_0x75ed2a){if(_0x75ed2a){var _0x2add83=typeof _0x55090f[_0x930e('0x2e')]===_0x930e('0x2f')&&typeof _0x55090f[_0x930e('0x30')]===_0x930e('0x2f');var _0x4deec5=_0x75ed2a['count'];var _0x3ddea5=_0x2add83?0x0:_0x55090f[_0x930e('0x2e')];var _0x17fae8=_0x2add83?_0x75ed2a['count']:_0x55090f[_0x930e('0x2e')]+_0x55090f[_0x930e('0x30')];var _0x2b7ae2;if(_0x17fae8>=_0x4deec5){_0x17fae8=_0x4deec5;_0x2b7ae2=0xc8;}else{_0x2b7ae2=0xce;}_0x223d91[_0x930e('0x2b')](_0x2b7ae2);return _0x223d91[_0x930e('0x31')](_0x930e('0x32'),_0x3ddea5+'-'+_0x17fae8+'/'+_0x4deec5)['json'](_0x75ed2a);}return null;};}function patchUpdates(_0x382a52){return function(_0x595492){try{jsonpatch[_0x930e('0x33')](_0x595492,_0x382a52,!![]);}catch(_0x602226){return BPromise[_0x930e('0x34')](_0x602226);}return _0x595492['save']();};}function saveUpdates(_0x56f02b,_0x86f2f1){return function(_0x522145){if(_0x522145){return _0x522145['update'](_0x56f02b)[_0x930e('0x35')](function(_0x404455){return _0x404455;});}return null;};}function removeEntity(_0xf827ca,_0x5cee8f){return function(_0x39a2d7){if(_0x39a2d7){return _0x39a2d7['destroy']()[_0x930e('0x35')](function(){_0xf827ca[_0x930e('0x2b')](0xcc)[_0x930e('0x2c')]();});}};}function handleEntityNotFound(_0x377fcb,_0x3d0d7c){return function(_0x43036d){if(!_0x43036d){_0x377fcb[_0x930e('0x2a')](0x194);}return _0x43036d;};}function handleError(_0x260aa9,_0x402c7a){_0x402c7a=_0x402c7a||0x1f4;return function(_0x1d77ab){logger[_0x930e('0x25')](_0x1d77ab[_0x930e('0x36')]);if(_0x1d77ab[_0x930e('0x37')]){delete _0x1d77ab[_0x930e('0x37')];}_0x260aa9[_0x930e('0x2b')](_0x402c7a)[_0x930e('0x38')](_0x1d77ab);};}exports[_0x930e('0x39')]=function(_0x181f78,_0x19924e){var _0x436e88={},_0x419b91={},_0x237bd5={'count':0x0,'rows':[]};var _0x207a85=_[_0x930e('0x3a')](db[_0x930e('0x3b')][_0x930e('0x3c')],function(_0x118a72){return{'name':_0x118a72[_0x930e('0x3d')],'type':_0x118a72[_0x930e('0x3e')][_0x930e('0x3f')]};});_0x419b91[_0x930e('0x40')]=_[_0x930e('0x3a')](_0x207a85,_0x930e('0x37'));_0x419b91[_0x930e('0x41')]=_[_0x930e('0x42')](_0x181f78['query']);_0x419b91[_0x930e('0x43')]=_[_0x930e('0x44')](_0x419b91[_0x930e('0x40')],_0x419b91[_0x930e('0x41')]);_0x436e88['attributes']=_[_0x930e('0x44')](_0x419b91[_0x930e('0x40')],qs[_0x930e('0x45')](_0x181f78[_0x930e('0x41')]['fields']));_0x436e88[_0x930e('0x46')]=_0x436e88[_0x930e('0x46')]['length']?_0x436e88[_0x930e('0x46')]:_0x419b91['model'];if(!_0x181f78['query'][_0x930e('0x47')](_0x930e('0x48'))){_0x436e88[_0x930e('0x30')]=qs[_0x930e('0x30')](_0x181f78[_0x930e('0x41')][_0x930e('0x30')]);_0x436e88['offset']=qs[_0x930e('0x2e')](_0x181f78['query'][_0x930e('0x2e')]);}_0x436e88['order']=qs[_0x930e('0x49')](_0x181f78[_0x930e('0x41')][_0x930e('0x49')]);_0x436e88[_0x930e('0x4a')]=qs['filters'](_['pick'](_0x181f78[_0x930e('0x41')],_0x419b91[_0x930e('0x43')]),_0x207a85);if(_0x181f78['query'][_0x930e('0x4b')]){_0x436e88[_0x930e('0x4a')]=_[_0x930e('0x4c')](_0x436e88[_0x930e('0x4a')],{'$or':_[_0x930e('0x3a')](_0x207a85,function(_0x3fbd94){if(_0x3fbd94[_0x930e('0x3e')]!==_0x930e('0x4d')){var _0x282f90={};_0x282f90[_0x3fbd94[_0x930e('0x37')]]={'$like':'%'+_0x181f78[_0x930e('0x41')][_0x930e('0x4b')]+'%'};return _0x282f90;}})});}_0x436e88=_[_0x930e('0x4c')]({},_0x436e88,_0x181f78[_0x930e('0x4e')]);var _0x50ff1a={'where':_0x436e88['where']};return db[_0x930e('0x3b')]['count'](_0x50ff1a)[_0x930e('0x35')](function(_0x22efbf){_0x237bd5[_0x930e('0x4f')]=_0x22efbf;if(_0x181f78[_0x930e('0x41')][_0x930e('0x50')]){_0x436e88[_0x930e('0x51')]=[{'all':!![]}];}return db['Setting'][_0x930e('0x52')](_0x436e88);})[_0x930e('0x35')](function(_0x567dc0){_0x237bd5[_0x930e('0x53')]=_0x567dc0;return _0x237bd5;})[_0x930e('0x35')](respondWithFilteredResult(_0x19924e,_0x436e88))[_0x930e('0x29')](handleError(_0x19924e,null));};exports[_0x930e('0x54')]=function(_0x18af8e,_0x119fc2){var _0x5e9adf={'raw':![],'where':{'id':_0x18af8e[_0x930e('0x55')]['id']}},_0x33869d={};_0x33869d[_0x930e('0x40')]=_[_0x930e('0x42')](db[_0x930e('0x3b')][_0x930e('0x3c')]);_0x33869d[_0x930e('0x41')]=_['keys'](_0x18af8e[_0x930e('0x41')]);_0x33869d['filters']=_[_0x930e('0x44')](_0x33869d['model'],_0x33869d['query']);_0x5e9adf[_0x930e('0x46')]=_[_0x930e('0x44')](_0x33869d[_0x930e('0x40')],qs[_0x930e('0x45')](_0x18af8e[_0x930e('0x41')][_0x930e('0x45')]));_0x5e9adf[_0x930e('0x46')]=_0x5e9adf[_0x930e('0x46')][_0x930e('0x56')]?_0x5e9adf[_0x930e('0x46')]:_0x33869d[_0x930e('0x40')];if(_0x18af8e[_0x930e('0x41')][_0x930e('0x50')]){_0x5e9adf[_0x930e('0x51')]=[{'all':!![]}];}_0x5e9adf=_['merge']({},_0x5e9adf,_0x18af8e[_0x930e('0x4e')]);return db[_0x930e('0x3b')][_0x930e('0x57')](_0x5e9adf)[_0x930e('0x35')](handleEntityNotFound(_0x119fc2,null))[_0x930e('0x35')](respondWithResult(_0x119fc2,null))[_0x930e('0x29')](handleError(_0x119fc2,null));};exports['update']=function(_0x392a73,_0x1dfad1){if(_0x392a73['body']['id']){delete _0x392a73['body']['id'];}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x392a73[_0x930e('0x55')]['id']}})[_0x930e('0x35')](handleEntityNotFound(_0x1dfad1,null))[_0x930e('0x35')](saveUpdates(_0x392a73['body'],null))[_0x930e('0x35')](respondWithResult(_0x1dfad1,null))['catch'](handleError(_0x1dfad1,null));};exports[_0x930e('0x58')]=function(_0x479231,_0x2a2442,_0x3342dc){if(_0x479231[_0x930e('0x59')]&&_0x479231[_0x930e('0x59')]['filename']){_0x479231['body'][_0x930e('0x5a')]=_0x479231[_0x930e('0x59')][_0x930e('0x5b')];}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x479231['params']['id']}})['then'](handleEntityNotFound(_0x2a2442,null))[_0x930e('0x35')](saveUpdates(_0x479231[_0x930e('0x5c')],null))[_0x930e('0x35')](respondWithResult(_0x2a2442,null))[_0x930e('0x29')](handleError(_0x2a2442,null));};exports['addLogoLogin']=function(_0x9b6bf2,_0x592908,_0x386552){if(_0x9b6bf2[_0x930e('0x59')]&&_0x9b6bf2[_0x930e('0x59')][_0x930e('0x5b')]){_0x9b6bf2['body'][_0x930e('0x5d')]=_0x9b6bf2['file']['filename'];}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x9b6bf2[_0x930e('0x55')]['id']}})['then'](handleEntityNotFound(_0x592908,null))[_0x930e('0x35')](saveUpdates(_0x9b6bf2['body'],null))[_0x930e('0x35')](respondWithResult(_0x592908,null))[_0x930e('0x29')](handleError(_0x592908,null));};var utilLicense=require(_0x930e('0x1a'));exports[_0x930e('0x5e')]=function(_0x3f3c91,_0x3704a8,_0x5f50ed){var _0x3692c1='server/files/images/logos';var _0x25f0e1={'custom':![]};return utilLicense[_0x930e('0x5f')]()[_0x930e('0x35')](function(_0x442c1e){if(_0x442c1e){_0x25f0e1=_0x442c1e;}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x3f3c91[_0x930e('0x55')]['id']},'attributes':[_0x930e('0x5a'),_0x930e('0x5d'),_0x930e('0x60'),_0x930e('0x61'),_0x930e('0x62'),_0x930e('0x63'),_0x930e('0x64'),_0x930e('0x65')],'raw':!![]});})[_0x930e('0x35')](handleEntityNotFound(_0x3704a8,null))['then'](function(_0x27ff7e){if(_0x27ff7e){var _0x207963=_0x27ff7e['logo']&&fs[_0x930e('0x66')](path['join'](config[_0x930e('0x67')],_0x3692c1,_[_0x930e('0x68')](_0x27ff7e[_0x930e('0x5a')])))?path[_0x930e('0x69')](config[_0x930e('0x67')],_0x3692c1,_['toLower'](_0x27ff7e[_0x930e('0x5a')])):path[_0x930e('0x69')](config['root'],_0x3692c1,_['toLower']('default_logo.svg'));var _0x415933=_0x930e('0x6a')+_[_0x930e('0x6b')](_0x930e('0x5a'));if(_0x27ff7e[_0x415933]||!_0x25f0e1[_0x930e('0x6c')]){_0x207963=path[_0x930e('0x69')](config['root'],_0x3692c1,_[_0x930e('0x68')]('default_logo.svg'));}if(!fs[_0x930e('0x66')](_0x207963)){throw new db[(_0x930e('0x6d'))][(_0x930e('0x6e'))](_[_0x930e('0x6b')]('logo')+_0x930e('0x6f'));}return _0x3704a8[_0x930e('0x70')](_0x207963);}})[_0x930e('0x29')](handleError(_0x3704a8,null));};var utilLicense=require('../../config/license/util');exports[_0x930e('0x71')]=function(_0x2a20bc,_0x24a970,_0xd87866){var _0x2765e4=_0x930e('0x72');var _0x3726e2={'custom':![]};return utilLicense['getLicense']()[_0x930e('0x35')](function(_0x441d88){if(_0x441d88){_0x3726e2=_0x441d88;}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x2a20bc[_0x930e('0x55')]['id']},'attributes':[_0x930e('0x5a'),_0x930e('0x5d'),_0x930e('0x60'),_0x930e('0x61'),'defaultLogo',_0x930e('0x63'),'defaultPreferred',_0x930e('0x65')],'raw':!![]});})[_0x930e('0x35')](handleEntityNotFound(_0x24a970,null))[_0x930e('0x35')](function(_0x23af4c){if(_0x23af4c){var _0x4f5bc4=_0x23af4c[_0x930e('0x5d')]&&fs[_0x930e('0x66')](path[_0x930e('0x69')](config['root'],_0x2765e4,_[_0x930e('0x68')](_0x23af4c[_0x930e('0x5d')])))?path[_0x930e('0x69')](config['root'],_0x2765e4,_[_0x930e('0x68')](_0x23af4c[_0x930e('0x5d')])):path[_0x930e('0x69')](config[_0x930e('0x67')],_0x2765e4,_['toLower'](_0x930e('0x73')));var _0x4e3aaf=_0x930e('0x6a')+_[_0x930e('0x6b')](_0x930e('0x5d'));if(_0x23af4c[_0x4e3aaf]||!_0x3726e2['custom']){_0x4f5bc4=path[_0x930e('0x69')](config[_0x930e('0x67')],_0x2765e4,_[_0x930e('0x68')](_0x930e('0x73')));}if(!fs[_0x930e('0x66')](_0x4f5bc4)){throw new db['Sequelize'][(_0x930e('0x6e'))](_[_0x930e('0x6b')](_0x930e('0x5d'))+'\x20not\x20found');}return _0x24a970['download'](_0x4f5bc4);}})['catch'](handleError(_0x24a970,null));};exports[_0x930e('0x74')]=function(_0x5bf8d9,_0x13dc6d){return db[_0x930e('0x3b')]['find']({'where':{'id':_0x5bf8d9[_0x930e('0x55')]['id']},'attributes':['securePassword']})[_0x930e('0x35')](respondWithResult(_0x13dc6d,null))['catch'](handleError(_0x13dc6d,null));};exports['addPreferred']=function(_0x4a7c2f,_0x48ba27,_0x325248){if(_0x4a7c2f[_0x930e('0x59')]&&_0x4a7c2f['file'][_0x930e('0x5b')]){_0x4a7c2f[_0x930e('0x5c')][_0x930e('0x60')]=_0x4a7c2f[_0x930e('0x59')]['filename'];}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x4a7c2f[_0x930e('0x55')]['id']}})[_0x930e('0x35')](handleEntityNotFound(_0x48ba27,null))['then'](saveUpdates(_0x4a7c2f[_0x930e('0x5c')],null))[_0x930e('0x35')](respondWithResult(_0x48ba27,null))[_0x930e('0x29')](handleError(_0x48ba27,null));};var utilLicense=require(_0x930e('0x1a'));exports[_0x930e('0x75')]=function(_0x211969,_0x21136c,_0x220349){var _0x142dd2='server/files/images/logos';var _0x3d317f={'custom':![]};return utilLicense['getLicense']()[_0x930e('0x35')](function(_0x3c154a){if(_0x3c154a){_0x3d317f=_0x3c154a;}return db[_0x930e('0x3b')]['find']({'where':{'id':_0x211969[_0x930e('0x55')]['id']},'attributes':[_0x930e('0x5a'),_0x930e('0x5d'),'preferred',_0x930e('0x61'),_0x930e('0x62'),_0x930e('0x63'),_0x930e('0x64'),'defaultFavicon'],'raw':!![]});})[_0x930e('0x35')](handleEntityNotFound(_0x21136c,null))[_0x930e('0x35')](function(_0x140f35){if(_0x140f35){var _0x3cebde=_0x140f35[_0x930e('0x60')]&&fs['existsSync'](path['join'](config[_0x930e('0x67')],_0x142dd2,_[_0x930e('0x68')](_0x140f35[_0x930e('0x60')])))?path[_0x930e('0x69')](config['root'],_0x142dd2,_[_0x930e('0x68')](_0x140f35[_0x930e('0x60')])):path['join'](config['root'],_0x142dd2,_[_0x930e('0x68')](_0x930e('0x76')));var _0x37abbe='default'+_[_0x930e('0x6b')]('preferred');if(_0x140f35[_0x37abbe]||!_0x3d317f['custom']||!_0x3d317f[_0x930e('0x60')]){_0x3cebde=path['join'](config[_0x930e('0x67')],_0x142dd2,_[_0x930e('0x68')](_0x930e('0x76')));}if(!fs['existsSync'](_0x3cebde)){throw new db[(_0x930e('0x6d'))][(_0x930e('0x6e'))](_[_0x930e('0x6b')](_0x930e('0x60'))+_0x930e('0x6f'));}return _0x21136c['download'](_0x3cebde);}})['catch'](handleError(_0x21136c,null));};exports[_0x930e('0x77')]=function(_0x1ed69a,_0x3ae666,_0x5ea64f){if(_0x1ed69a[_0x930e('0x59')]&&_0x1ed69a[_0x930e('0x59')][_0x930e('0x5b')]){_0x1ed69a[_0x930e('0x5c')]['favicon']=_0x1ed69a[_0x930e('0x59')][_0x930e('0x5b')];}return db['Setting'][_0x930e('0x57')]({'where':{'id':_0x1ed69a[_0x930e('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ae666,null))[_0x930e('0x35')](saveUpdates(_0x1ed69a[_0x930e('0x5c')],null))['then'](respondWithResult(_0x3ae666,null))[_0x930e('0x29')](handleError(_0x3ae666,null));};var utilLicense=require(_0x930e('0x1a'));exports[_0x930e('0x78')]=function(_0x55a0fe,_0x37c407,_0xd61691){var _0x4f82f7=_0x930e('0x72');var _0x85e5a2={'custom':![]};return utilLicense[_0x930e('0x5f')]()[_0x930e('0x35')](function(_0x4e4396){if(_0x4e4396){_0x85e5a2=_0x4e4396;}return db[_0x930e('0x3b')][_0x930e('0x57')]({'where':{'id':_0x55a0fe[_0x930e('0x55')]['id']},'attributes':[_0x930e('0x5a'),_0x930e('0x5d'),'preferred','favicon',_0x930e('0x62'),_0x930e('0x63'),_0x930e('0x64'),_0x930e('0x65')],'raw':!![]});})['then'](handleEntityNotFound(_0x37c407,null))[_0x930e('0x35')](function(_0x50a580){if(_0x50a580){var _0x3e7716=_0x50a580[_0x930e('0x61')]&&fs[_0x930e('0x66')](path['join'](config[_0x930e('0x67')],_0x4f82f7,_['toLower'](_0x50a580[_0x930e('0x61')])))?path[_0x930e('0x69')](config[_0x930e('0x67')],_0x4f82f7,_['toLower'](_0x50a580[_0x930e('0x61')])):path[_0x930e('0x69')](config[_0x930e('0x67')],_0x4f82f7,_[_0x930e('0x68')](_0x930e('0x79')));var _0x4d469d='default'+_[_0x930e('0x6b')](_0x930e('0x61'));if(_0x50a580[_0x4d469d]||!_0x85e5a2[_0x930e('0x6c')]){_0x3e7716=path['join'](config['root'],_0x4f82f7,_[_0x930e('0x68')](_0x930e('0x79')));}if(!fs['existsSync'](_0x3e7716)){throw new db[(_0x930e('0x6d'))]['ValidationError'](_[_0x930e('0x6b')](_0x930e('0x61'))+_0x930e('0x6f'));}return _0x37c407[_0x930e('0x70')](_0x3e7716);}})['catch'](handleError(_0x37c407,null));};exports['getDate']=function(_0x26b6e3,_0xf5f641){var _0x5f56c0={'offset':moment()['utcOffset']()};_0x5f56c0[_0x930e('0x7a')]=moment()[_0x930e('0x7b')](_0x5f56c0[_0x930e('0x2e')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0xf5f641[_0x930e('0x2b')](0xc8)['send'](_0x5f56c0);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x3cc9c9,_0x3748dc){var _0x2c6246=function(_0x229445){while(--_0x229445){_0x3cc9c9['push'](_0x3cc9c9['shift']());}};_0x2c6246(++_0x3748dc);}(_0xedd9,0xfc));var _0x9edd=function(_0x596986,_0x2797d0){_0x596986=_0x596986-0x0;var _0x51fc86=_0xedd9[_0x596986];return _0x51fc86;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x15af84,_0x7a5b4d){var _0x5ac0a4=function(_0x97cb67){while(--_0x97cb67){_0x15af84['push'](_0x15af84['shift']());}};_0x5ac0a4(++_0x7a5b4d);}(_0x008c,0x188));var _0xc008=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x008c[_0x1168a1];return _0xcc5ad8;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe65=['request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSetting','Setting','options','raw','map','include','model','attributes','then','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16019c,_0x38a631){var _0x2ee09e=function(_0x234527){while(--_0x234527){_0x16019c['push'](_0x16019c['shift']());}};_0x2ee09e(++_0x38a631);}(_0xfe65,0xab));var _0x5fe6=function(_0x554eea,_0x337f0a){_0x554eea=_0x554eea-0x0;var _0x4e5045=_0xfe65[_0x554eea];return _0x4e5045;};'use strict';var _=require('lodash');var util=require(_0x5fe6('0x0'));var moment=require(_0x5fe6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fe6('0x2'));var db=require(_0x5fe6('0x3'))['db'];var utils=require(_0x5fe6('0x4'));var logger=require(_0x5fe6('0x5'))(_0x5fe6('0x6'));var config=require(_0x5fe6('0x7'));var jayson=require(_0x5fe6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8d58,_0xed4d16,_0x2662fe){return new BPromise(function(_0x3e173f,_0x140486){return client[_0x5fe6('0x9')](_0x5d8d58,_0x2662fe)['then'](function(_0x5e3bd9){logger['info'](_0x5fe6('0xa'),_0xed4d16,_0x5fe6('0xb'));logger[_0x5fe6('0xc')](_0x5fe6('0xd'),_0xed4d16,'request\x20sent',JSON[_0x5fe6('0xe')](_0x5e3bd9));if(_0x5e3bd9[_0x5fe6('0xf')]){if(_0x5e3bd9[_0x5fe6('0xf')][_0x5fe6('0x10')]===0x1f4){logger[_0x5fe6('0xf')](_0x5fe6('0xa'),_0xed4d16,_0x5e3bd9[_0x5fe6('0xf')][_0x5fe6('0x11')]);return _0x140486(_0x5e3bd9['error'][_0x5fe6('0x11')]);}logger[_0x5fe6('0xf')]('Setting,\x20%s,\x20%s',_0xed4d16,_0x5e3bd9['error'][_0x5fe6('0x11')]);return _0x3e173f(_0x5e3bd9[_0x5fe6('0xf')][_0x5fe6('0x11')]);}else{logger[_0x5fe6('0x12')](_0x5fe6('0xa'),_0xed4d16,_0x5fe6('0xb'));_0x3e173f(_0x5e3bd9[_0x5fe6('0x13')][_0x5fe6('0x11')]);}})[_0x5fe6('0x14')](function(_0x373429){logger['error'](_0x5fe6('0xa'),_0xed4d16,_0x373429);_0x140486(_0x373429);});});}exports[_0x5fe6('0x15')]=function(_0x10b7d0){var _0x225836=this;return new Promise(function(_0x5b6de9,_0x293445){return db[_0x5fe6('0x16')]['find']({'raw':_0x10b7d0['options']?_0x10b7d0[_0x5fe6('0x17')][_0x5fe6('0x18')]===undefined?!![]:![]:!![],'where':_0x10b7d0[_0x5fe6('0x17')]?_0x10b7d0[_0x5fe6('0x17')]['where']||null:null,'attributes':_0x10b7d0[_0x5fe6('0x17')]?_0x10b7d0[_0x5fe6('0x17')]['attributes']||null:null,'include':_0x10b7d0[_0x5fe6('0x17')]?_0x10b7d0[_0x5fe6('0x17')]['include']?_[_0x5fe6('0x19')](_0x10b7d0['options'][_0x5fe6('0x1a')],function(_0x14f3a9){return{'model':db[_0x14f3a9[_0x5fe6('0x1b')]],'as':_0x14f3a9['as'],'attributes':_0x14f3a9[_0x5fe6('0x1c')],'include':_0x14f3a9[_0x5fe6('0x1a')]?_[_0x5fe6('0x19')](_0x14f3a9['include'],function(_0x23198c){return{'model':db[_0x23198c[_0x5fe6('0x1b')]],'as':_0x23198c['as'],'attributes':_0x23198c[_0x5fe6('0x1c')],'include':_0x23198c[_0x5fe6('0x1a')]?_[_0x5fe6('0x19')](_0x23198c['include'],function(_0x31657f){return{'model':db[_0x31657f['model']],'as':_0x31657f['as'],'attributes':_0x31657f[_0x5fe6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5fe6('0x1d')](function(_0x265538){logger[_0x5fe6('0x12')](_0x5fe6('0x15'),_0x10b7d0);logger[_0x5fe6('0xc')](_0x5fe6('0x15'),_0x10b7d0,JSON['stringify'](_0x265538));_0x5b6de9(_0x265538);})[_0x5fe6('0x14')](function(_0x2dc06c){logger[_0x5fe6('0xf')]('ShowSetting',_0x2dc06c[_0x5fe6('0x11')],_0x10b7d0);_0x293445(_0x225836[_0x5fe6('0xf')](0x1f4,_0x2dc06c['message']));});});};
\ No newline at end of file
+var _0x1803=['model','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','ShowSetting','find','options','raw','where','attributes','include','map'];(function(_0x28ced5,_0xd9af49){var _0x15f1f3=function(_0x41ad43){while(--_0x41ad43){_0x28ced5['push'](_0x28ced5['shift']());}};_0x15f1f3(++_0xd9af49);}(_0x1803,0x14c));var _0x3180=function(_0x19d0a6,_0x30450f){_0x19d0a6=_0x19d0a6-0x0;var _0x30dd40=_0x1803[_0x19d0a6];return _0x30dd40;};'use strict';var _=require('lodash');var util=require(_0x3180('0x0'));var moment=require('moment');var BPromise=require(_0x3180('0x1'));var rs=require(_0x3180('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3180('0x3'))['db'];var utils=require(_0x3180('0x4'));var logger=require('../../config/logger')(_0x3180('0x5'));var config=require('../../config/environment');var jayson=require(_0x3180('0x6'));var client=jayson[_0x3180('0x7')][_0x3180('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10346b,_0x59c786,_0x38f910){return new BPromise(function(_0x116626,_0x5915fb){return client[_0x3180('0x9')](_0x10346b,_0x38f910)[_0x3180('0xa')](function(_0x81dccd){logger[_0x3180('0xb')](_0x3180('0xc'),_0x59c786,'request\x20sent');logger[_0x3180('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x59c786,_0x3180('0xe'),JSON[_0x3180('0xf')](_0x81dccd));if(_0x81dccd['error']){if(_0x81dccd[_0x3180('0x10')][_0x3180('0x11')]===0x1f4){logger[_0x3180('0x10')]('Setting,\x20%s,\x20%s',_0x59c786,_0x81dccd[_0x3180('0x10')][_0x3180('0x12')]);return _0x5915fb(_0x81dccd['error']['message']);}logger[_0x3180('0x10')](_0x3180('0xc'),_0x59c786,_0x81dccd['error'][_0x3180('0x12')]);return _0x116626(_0x81dccd[_0x3180('0x10')][_0x3180('0x12')]);}else{logger[_0x3180('0xb')](_0x3180('0xc'),_0x59c786,_0x3180('0xe'));_0x116626(_0x81dccd[_0x3180('0x13')][_0x3180('0x12')]);}})['catch'](function(_0x3365f9){logger[_0x3180('0x10')]('Setting,\x20%s,\x20%s',_0x59c786,_0x3365f9);_0x5915fb(_0x3365f9);});});}exports[_0x3180('0x14')]=function(_0x102c40){var _0x3612de=this;return new Promise(function(_0x5c5d87,_0x1f2f7a){return db['Setting'][_0x3180('0x15')]({'raw':_0x102c40[_0x3180('0x16')]?_0x102c40[_0x3180('0x16')][_0x3180('0x17')]===undefined?!![]:![]:!![],'where':_0x102c40[_0x3180('0x16')]?_0x102c40[_0x3180('0x16')][_0x3180('0x18')]||null:null,'attributes':_0x102c40['options']?_0x102c40[_0x3180('0x16')][_0x3180('0x19')]||null:null,'include':_0x102c40[_0x3180('0x16')]?_0x102c40[_0x3180('0x16')][_0x3180('0x1a')]?_[_0x3180('0x1b')](_0x102c40[_0x3180('0x16')][_0x3180('0x1a')],function(_0x2f4cef){return{'model':db[_0x2f4cef[_0x3180('0x1c')]],'as':_0x2f4cef['as'],'attributes':_0x2f4cef[_0x3180('0x19')],'include':_0x2f4cef[_0x3180('0x1a')]?_[_0x3180('0x1b')](_0x2f4cef[_0x3180('0x1a')],function(_0x180878){return{'model':db[_0x180878[_0x3180('0x1c')]],'as':_0x180878['as'],'attributes':_0x180878['attributes'],'include':_0x180878[_0x3180('0x1a')]?_[_0x3180('0x1b')](_0x180878[_0x3180('0x1a')],function(_0x45373d){return{'model':db[_0x45373d['model']],'as':_0x45373d['as'],'attributes':_0x45373d[_0x3180('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3180('0xa')](function(_0x110c56){logger[_0x3180('0xb')](_0x3180('0x14'),_0x102c40);logger[_0x3180('0xd')](_0x3180('0x14'),_0x102c40,JSON[_0x3180('0xf')](_0x110c56));_0x5c5d87(_0x110c56);})[_0x3180('0x1d')](function(_0x2f121e){logger[_0x3180('0x10')]('ShowSetting',_0x2f121e[_0x3180('0x12')],_0x102c40);_0x1f2f7a(_0x3612de[_0x3180('0x10')](0x1f4,_0x2f121e['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x48b3b0,_0x1bda9b){var _0x25e101=function(_0x1466ff){while(--_0x1466ff){_0x48b3b0['push'](_0x48b3b0['shift']());}};_0x25e101(++_0x1bda9b);}(_0x7a54,0x106));var _0x47a5=function(_0x765b78,_0x119afb){_0x765b78=_0x765b78-0x0;var _0x44cc63=_0x7a54[_0x765b78];return _0x44cc63;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router;
\ No newline at end of file
+var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x8c28b3,_0x105506){var _0x46168b=function(_0x547432){while(--_0x547432){_0x8c28b3['push'](_0x8c28b3['shift']());}};_0x46168b(++_0x105506);}(_0x7a54,0x106));var _0x47a5=function(_0x447210,_0x2add9f){_0x447210=_0x447210-0x0;var _0x358498=_0x7a54[_0x447210];return _0x358498;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05b3=['infobip','intelepeer','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','connectel','clicksend','plivo','clickatell','bandwidth','csc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b3,0xf1));var _0x305b=function(_0x441db3,_0x10f359){_0x441db3=_0x441db3-0x0;var _0x16c05d=_0x05b3[_0x441db3];return _0x16c05d;};'use strict';var Sequelize=require(_0x305b('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x305b('0x1')],'unique':_0x305b('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x305b('0x1')],'defaultValue':function(){return rs[_0x305b('0x3')]();}},'phone':{'type':Sequelize[_0x305b('0x1')]},'type':{'type':Sequelize[_0x305b('0x4')]('twilio','skebby',_0x305b('0x5'),_0x305b('0x6'),_0x305b('0x7'),_0x305b('0x8'),_0x305b('0x9'),_0x305b('0xa'),_0x305b('0xb'),_0x305b('0xc'))},'accountSid':{'type':Sequelize[_0x305b('0x1')]},'authId':{'type':Sequelize[_0x305b('0x1')]},'authToken':{'type':Sequelize[_0x305b('0x1')]},'smsMethod':{'type':Sequelize[_0x305b('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x305b('0x1')]},'apiKey':{'type':Sequelize[_0x305b('0x1')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x305b('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x305b('0xd')],'defaultValue':function(){return _0x305b('0xe');}},'notificationSound':{'type':Sequelize[_0x305b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x305b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x305b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x305b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x305b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x305b('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x305b('0xf')],'defaultValue':![],'comment':_0x305b('0x11'),'set':function(_0xc9ce12){if(!_0xc9ce12)this[_0x305b('0x12')](_0x305b('0x13'),null);this[_0x305b('0x12')](_0x305b('0x14'),_0xc9ce12);}}};
\ No newline at end of file
+var _0xf860=['csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','twilio','connectel','clicksend','plivo','clickatell','bandwidth'];(function(_0x50a0d1,_0xf325b3){var _0x4943c3=function(_0x489e58){while(--_0x489e58){_0x50a0d1['push'](_0x50a0d1['shift']());}};_0x4943c3(++_0xf325b3);}(_0xf860,0x184));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0f86('0x0'));var rs=require(_0x0f86('0x1'));module[_0x0f86('0x2')]={'name':{'type':Sequelize[_0x0f86('0x3')],'unique':_0x0f86('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x0f86('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0f86('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x0f86('0x5'),'skebby',_0x0f86('0x6'),_0x0f86('0x7'),_0x0f86('0x8'),_0x0f86('0x9'),_0x0f86('0xa'),_0x0f86('0xb'),_0x0f86('0xc'),_0x0f86('0xd'))},'accountSid':{'type':Sequelize[_0x0f86('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x0f86('0x3')]},'smsMethod':{'type':Sequelize[_0x0f86('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0f86('0x3')]},'password':{'type':Sequelize[_0x0f86('0x3')]},'apiKey':{'type':Sequelize[_0x0f86('0x3')]},'applicationId':{'type':Sequelize[_0x0f86('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x0f86('0x3')]},'deliveryReport':{'type':Sequelize[_0x0f86('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x0f86('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0f86('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0f86('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0f86('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0f86('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0f86('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0f86('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0f86('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0f86('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f86('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1c6a27){if(!_0x1c6a27)this['setDataValue'](_0x0f86('0x12'),null);this[_0x0f86('0x13')](_0x0f86('0x14'),_0x1c6a27);}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57af=['describe','SmsAccountId','Disposition','getDispositions','findOne','nolimit','includeAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','account','orderBy','priority','asc','Applications','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','Body','MessageSid','skebby','from','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','omit','Contacts','contact','SmsInteraction','spread','created','autoclose','applications','push','close','*,*,*,*','interaction','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','groupName','DELIVERED','clickatell','bandwidth','redif','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','type','model','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x283196,_0x36bfc4){var _0x56980e=function(_0x441c24){while(--_0x441c24){_0x283196['push'](_0x283196['shift']());}};_0x56980e(++_0x36bfc4);}(_0x57af,0x81));var _0xf57a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x57af[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0xf57a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf57a('0x1'));var moment=require(_0xf57a('0x2'));var BPromise=require(_0xf57a('0x3'));var Mustache=require(_0xf57a('0x4'));var util=require(_0xf57a('0x5'));var path=require(_0xf57a('0x6'));var sox=require(_0xf57a('0x7'));var csv=require(_0xf57a('0x8'));var ejs=require(_0xf57a('0x9'));var fs=require('fs');var fs_extra=require(_0xf57a('0xa'));var _=require(_0xf57a('0xb'));var squel=require(_0xf57a('0xc'));var crypto=require(_0xf57a('0xd'));var jsforce=require(_0xf57a('0xe'));var deskjs=require(_0xf57a('0xf'));var toCsv=require(_0xf57a('0x8'));var querystring=require('querystring');var Papa=require(_0xf57a('0x10'));var Redis=require(_0xf57a('0x11'));var authService=require(_0xf57a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf57a('0x13'));var logger=require('../../config/logger')(_0xf57a('0x14'));var utils=require(_0xf57a('0x15'));var config=require(_0xf57a('0x16'));var licenseUtil=require(_0xf57a('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf57a('0x18')](config[_0xf57a('0x19')],{'host':_0xf57a('0x1a'),'port':0x18eb});var socket=require(_0xf57a('0x1b'))(new Redis(config[_0xf57a('0x19')]));require(_0xf57a('0x1c'))[_0xf57a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf57a('0x1e')][_0xf57a('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x14905e,_0x766cfe,_0x4b6832,_0xbc8bba){return new BPromise(function(_0x31be47,_0x413278){var _0x501bd6=_0xbc8bba||client;return _0x501bd6[_0xf57a('0x20')](_0x14905e,_0x4b6832)[_0xf57a('0x21')](function(_0x470f6e){logger[_0xf57a('0x22')](_0xf57a('0x23'),_0x766cfe,'request\x20sent');logger[_0xf57a('0x24')](_0xf57a('0x25'),_0x766cfe,_0xf57a('0x26'),JSON[_0xf57a('0x27')](_0x470f6e));if(_0x470f6e[_0xf57a('0x28')]){if(_0x470f6e[_0xf57a('0x28')][_0xf57a('0x29')]===0x1f4){logger[_0xf57a('0x28')](_0xf57a('0x23'),_0x766cfe,_0x470f6e[_0xf57a('0x28')][_0xf57a('0x2a')]);return _0x413278(_0x470f6e[_0xf57a('0x28')]['message']);}logger['error'](_0xf57a('0x23'),_0x766cfe,_0x470f6e[_0xf57a('0x28')][_0xf57a('0x2a')]);return _0x31be47(_0x470f6e[_0xf57a('0x28')][_0xf57a('0x2a')]);}else{logger[_0xf57a('0x22')]('SmsAccount,\x20%s,\x20%s',_0x766cfe,_0xf57a('0x26'));_0x31be47(_0x470f6e['result'][_0xf57a('0x2a')]);}})[_0xf57a('0x2b')](function(_0x303f4e){logger[_0xf57a('0x28')](_0xf57a('0x23'),_0x766cfe,_0x303f4e);_0x413278(_0x303f4e);});});}function respondWithStatusCode(_0x3f5b5c,_0x34d34f){_0x34d34f=_0x34d34f||0xcc;return function(_0x1618e3){if(_0x1618e3){return _0x3f5b5c[_0xf57a('0x2c')](_0x34d34f);}return _0x3f5b5c[_0xf57a('0x2d')](_0x34d34f)[_0xf57a('0x2e')]();};}function respondWithResult(_0x20b172,_0x2619cc){_0x2619cc=_0x2619cc||0xc8;return function(_0x1aac89){if(_0x1aac89){return _0x20b172[_0xf57a('0x2d')](_0x2619cc)[_0xf57a('0x2f')](_0x1aac89);}};}function respondWithFilteredResult(_0x1f3246,_0x2b350c){return function(_0x4b3b34){if(_0x4b3b34){var _0x34a433=typeof _0x2b350c['offset']===_0xf57a('0x30')&&typeof _0x2b350c[_0xf57a('0x31')]===_0xf57a('0x30');var _0x28b1fc=_0x4b3b34[_0xf57a('0x32')];var _0x1ce3e4=_0x34a433?0x0:_0x2b350c[_0xf57a('0x33')];var _0x48d34c=_0x34a433?_0x4b3b34[_0xf57a('0x32')]:_0x2b350c['offset']+_0x2b350c[_0xf57a('0x31')];var _0x50a8f9;if(_0x48d34c>=_0x28b1fc){_0x48d34c=_0x28b1fc;_0x50a8f9=0xc8;}else{_0x50a8f9=0xce;}_0x1f3246[_0xf57a('0x2d')](_0x50a8f9);return _0x1f3246[_0xf57a('0x34')]('Content-Range',_0x1ce3e4+'-'+_0x48d34c+'/'+_0x28b1fc)['json'](_0x4b3b34);}return null;};}function patchUpdates(_0x35ece3){return function(_0xb410ad){try{jsonpatch[_0xf57a('0x35')](_0xb410ad,_0x35ece3,!![]);}catch(_0x22352d){return BPromise['reject'](_0x22352d);}return _0xb410ad[_0xf57a('0x36')]();};}function saveUpdates(_0xd8a281,_0x24acd2){return function(_0x476a4e){if(_0x476a4e){return _0x476a4e['update'](_0xd8a281)[_0xf57a('0x21')](function(_0x341d7b){return _0x341d7b;});}return null;};}function removeEntity(_0x43fa14,_0x31e289){return function(_0x2dd168){if(_0x2dd168){return _0x2dd168[_0xf57a('0x37')]()['then'](function(){var _0x5e3296=_0x2dd168[_0xf57a('0x38')]({'plain':!![]});var _0x1f3175=_0xf57a('0x39');return db[_0xf57a('0x3a')][_0xf57a('0x37')]({'where':{'type':_0x1f3175,'resourceId':_0x5e3296['id']}})[_0xf57a('0x21')](function(){return _0x2dd168;});})[_0xf57a('0x21')](function(){_0x43fa14['status'](0xcc)[_0xf57a('0x2e')]();});}};}function handleEntityNotFound(_0x274ad0,_0x1a4245){return function(_0x47e04b){if(!_0x47e04b){_0x274ad0[_0xf57a('0x2c')](0x194);}return _0x47e04b;};}function handleError(_0x134eb0,_0xbbdd2e){_0xbbdd2e=_0xbbdd2e||0x1f4;return function(_0x2eac11){logger[_0xf57a('0x28')](_0x2eac11['stack']);if(_0x2eac11[_0xf57a('0x3b')]){delete _0x2eac11[_0xf57a('0x3b')];}_0x134eb0[_0xf57a('0x2d')](_0xbbdd2e)[_0xf57a('0x3c')](_0x2eac11);};}exports[_0xf57a('0x3d')]=function(_0x52bf3b,_0x3afeac){var _0x803bec={'include':[{'model':db[_0xf57a('0x3e')],'as':_0xf57a('0x3f')}]},_0x38b1b4={},_0x2739eb={'count':0x0,'rows':[]};var _0x4a6589=_[_0xf57a('0x40')](db[_0xf57a('0x41')]['rawAttributes'],function(_0x48fdf2){return{'name':_0x48fdf2['fieldName'],'type':_0x48fdf2[_0xf57a('0x42')]['key']};});_0x38b1b4[_0xf57a('0x43')]=_[_0xf57a('0x40')](_0x4a6589,_0xf57a('0x3b'));_0x38b1b4[_0xf57a('0x44')]=_[_0xf57a('0x45')](_0x52bf3b['query']);_0x38b1b4['filters']=_[_0xf57a('0x46')](_0x38b1b4[_0xf57a('0x43')],_0x38b1b4[_0xf57a('0x44')]);_0x803bec[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x38b1b4[_0xf57a('0x43')],qs['fields'](_0x52bf3b[_0xf57a('0x44')]['fields']));_0x803bec['attributes']=_0x803bec[_0xf57a('0x47')]['length']?_0x803bec[_0xf57a('0x47')]:_0x38b1b4[_0xf57a('0x43')];if(!_0x52bf3b[_0xf57a('0x44')][_0xf57a('0x48')]('nolimit')){_0x803bec[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x52bf3b[_0xf57a('0x44')]['limit']);_0x803bec['offset']=qs['offset'](_0x52bf3b[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x803bec[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x52bf3b[_0xf57a('0x44')][_0xf57a('0x4a')]);_0x803bec[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x52bf3b[_0xf57a('0x44')],_0x38b1b4['filters']),_0x4a6589);if(_0x52bf3b[_0xf57a('0x44')]['filter']){_0x803bec[_0xf57a('0x4b')]=_['merge'](_0x803bec[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x4a6589,function(_0x48bfb5){if(_0x48bfb5[_0xf57a('0x42')]!=='VIRTUAL'){var _0x54d06a={};_0x54d06a[_0x48bfb5[_0xf57a('0x3b')]]={'$like':'%'+_0x52bf3b['query'][_0xf57a('0x4e')]+'%'};return _0x54d06a;}})});}_0x803bec=_[_0xf57a('0x4f')]({},_0x803bec,_0x52bf3b[_0xf57a('0x50')]);var _0x25b9ac={'where':_0x803bec[_0xf57a('0x4b')]};return db[_0xf57a('0x41')][_0xf57a('0x32')](_0x25b9ac)[_0xf57a('0x21')](function(_0x3269bc){_0x2739eb[_0xf57a('0x32')]=_0x3269bc;if(_0x52bf3b['query']['includeAll']){_0x803bec[_0xf57a('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0xf57a('0x52')](_0x803bec);})[_0xf57a('0x21')](function(_0x39f9b4){_0x2739eb[_0xf57a('0x53')]=_0x39f9b4;return _0x2739eb;})['then'](respondWithFilteredResult(_0x3afeac,_0x803bec))['catch'](handleError(_0x3afeac,null));};exports['show']=function(_0x2c24e0,_0x569e99){var _0x467ac6={'raw':![],'where':{'id':_0x2c24e0[_0xf57a('0x54')]['id']},'include':[{'model':db[_0xf57a('0x3e')],'as':_0xf57a('0x3f')}]},_0xc2ad0c={};_0xc2ad0c[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0x41')][_0xf57a('0x55')]);_0xc2ad0c[_0xf57a('0x44')]=_['keys'](_0x2c24e0[_0xf57a('0x44')]);_0xc2ad0c[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0xc2ad0c[_0xf57a('0x43')],_0xc2ad0c[_0xf57a('0x44')]);_0x467ac6[_0xf57a('0x47')]=_['intersection'](_0xc2ad0c[_0xf57a('0x43')],qs['fields'](_0x2c24e0[_0xf57a('0x44')][_0xf57a('0x56')]));_0x467ac6['attributes']=_0x467ac6[_0xf57a('0x47')][_0xf57a('0x57')]?_0x467ac6[_0xf57a('0x47')]:_0xc2ad0c[_0xf57a('0x43')];if(_0x2c24e0[_0xf57a('0x44')]['includeAll']){_0x467ac6[_0xf57a('0x51')]=[{'all':!![]}];}_0x467ac6=_[_0xf57a('0x4f')]({},_0x467ac6,_0x2c24e0[_0xf57a('0x50')]);return db[_0xf57a('0x41')][_0xf57a('0x58')](_0x467ac6)[_0xf57a('0x21')](handleEntityNotFound(_0x569e99,null))[_0xf57a('0x21')](respondWithResult(_0x569e99,null))[_0xf57a('0x2b')](handleError(_0x569e99,null));};exports['create']=function(_0x121c59,_0x55602f){return db[_0xf57a('0x41')][_0xf57a('0x59')](_0x121c59[_0xf57a('0x5a')],{})[_0xf57a('0x21')](function(_0x386a2c){var _0x269cc0=_0x121c59[_0xf57a('0x5b')][_0xf57a('0x38')]({'plain':!![]});if(!_0x269cc0)throw new Error(_0xf57a('0x5c'));if(_0x269cc0[_0xf57a('0x5d')]===_0xf57a('0x5b')){var _0x31cfe5=_0x386a2c[_0xf57a('0x38')]({'plain':!![]});var _0x369bc6=_0xf57a('0x39');return db[_0xf57a('0x5e')][_0xf57a('0x58')]({'where':{'name':_0x369bc6,'userProfileId':_0x269cc0[_0xf57a('0x5f')]},'raw':!![]})[_0xf57a('0x21')](function(_0x139490){if(_0x139490&&_0x139490[_0xf57a('0x60')]===0x0){return db[_0xf57a('0x3a')]['create']({'name':_0x31cfe5[_0xf57a('0x3b')],'resourceId':_0x31cfe5['id'],'type':_0x139490[_0xf57a('0x3b')],'sectionId':_0x139490['id']},{})[_0xf57a('0x21')](function(){return _0x386a2c;});}else{return _0x386a2c;}})['catch'](function(_0x1f4b7a){logger[_0xf57a('0x28')](_0xf57a('0x61'),_0x1f4b7a);throw _0x1f4b7a;});}return _0x386a2c;})[_0xf57a('0x21')](respondWithResult(_0x55602f,0xc9))[_0xf57a('0x2b')](handleError(_0x55602f,null));};exports[_0xf57a('0x62')]=function(_0x402a63,_0x192c99){if(_0x402a63[_0xf57a('0x5a')]['id']){delete _0x402a63[_0xf57a('0x5a')]['id'];}return db[_0xf57a('0x41')]['find']({'where':{'id':_0x402a63[_0xf57a('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xf57a('0x3f')}]})[_0xf57a('0x21')](handleEntityNotFound(_0x192c99,null))['then'](saveUpdates(_0x402a63[_0xf57a('0x5a')],null))['then'](respondWithResult(_0x192c99,null))[_0xf57a('0x2b')](handleError(_0x192c99,null));};exports[_0xf57a('0x37')]=function(_0x22d388,_0x444bf2){return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x22d388[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x444bf2,null))[_0xf57a('0x21')](removeEntity(_0x444bf2,null))['catch'](handleError(_0x444bf2,null));};exports[_0xf57a('0x63')]=function(_0x3e2c7d,_0x45a3b2){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x45a3b2,null))[_0xf57a('0x2b')](handleError(_0x45a3b2,null));};exports['addDisposition']=function(_0x3eb83f,_0x2e0aa2,_0x230758){if(_0x3eb83f[_0xf57a('0x5a')]['id']){delete _0x3eb83f[_0xf57a('0x5a')]['id'];}return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x3eb83f[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2e0aa2,null))[_0xf57a('0x21')](function(_0x840ea){if(_0x840ea){_0x3eb83f['body'][_0xf57a('0x64')]=_0x840ea['id'];return db[_0xf57a('0x65')][_0xf57a('0x59')](_0x3eb83f[_0xf57a('0x5a')]);}})[_0xf57a('0x21')](respondWithResult(_0x2e0aa2,null))[_0xf57a('0x2b')](handleError(_0x2e0aa2,null));};exports[_0xf57a('0x66')]=function(_0x165040,_0x2be1ad,_0x3bb8d9){var _0x3ebc04={'raw':![],'where':{}};var _0x2fb0d1={};var _0x27d8f6={'count':0x0,'rows':[]};return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x165040['params']['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2be1ad,null))[_0xf57a('0x21')](function(_0x57de7c){if(_0x57de7c){_0x2fb0d1[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0x65')][_0xf57a('0x55')]);_0x2fb0d1['query']=_[_0xf57a('0x45')](_0x165040['query']);_0x2fb0d1[_0xf57a('0x4c')]=_['intersection'](_0x2fb0d1['model'],_0x2fb0d1[_0xf57a('0x44')]);_0x3ebc04[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x2fb0d1[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x165040['query'][_0xf57a('0x56')]));_0x3ebc04['attributes']=_0x3ebc04['attributes'][_0xf57a('0x57')]?_0x3ebc04['attributes']:_0x2fb0d1['model'];if(!_0x165040[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x3ebc04[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x165040['query'][_0xf57a('0x31')]);_0x3ebc04[_0xf57a('0x33')]=qs[_0xf57a('0x33')](_0x165040[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x3ebc04[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x165040[_0xf57a('0x44')][_0xf57a('0x4a')]);_0x3ebc04['where']=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x165040[_0xf57a('0x44')],_0x2fb0d1[_0xf57a('0x4c')]));_0x3ebc04['where'][_0xf57a('0x64')]=_0x57de7c['id'];if(_0x165040[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x3ebc04['where']=_[_0xf57a('0x4f')](_0x3ebc04[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x3ebc04[_0xf57a('0x47')],function(_0x32123f){var _0x5610c8={};_0x5610c8[_0x32123f]={'$like':'%'+_0x165040['query']['filter']+'%'};return _0x5610c8;})});}_0x3ebc04=_[_0xf57a('0x4f')]({},_0x3ebc04,_0x165040[_0xf57a('0x50')]);return db['Disposition'][_0xf57a('0x32')]({'where':_0x3ebc04[_0xf57a('0x4b')]})[_0xf57a('0x21')](function(_0x4e5f69){_0x27d8f6[_0xf57a('0x32')]=_0x4e5f69;if(_0x165040[_0xf57a('0x44')][_0xf57a('0x69')]){_0x3ebc04[_0xf57a('0x51')]=[{'all':!![]}];}return db[_0xf57a('0x65')][_0xf57a('0x52')](_0x3ebc04);})['then'](function(_0x5a754f){_0x27d8f6[_0xf57a('0x53')]=_0x5a754f;return _0x27d8f6;});}})[_0xf57a('0x21')](respondWithFilteredResult(_0x2be1ad,_0x3ebc04))[_0xf57a('0x2b')](handleError(_0x2be1ad,null));};exports[_0xf57a('0x6a')]=function(_0x4df9c7,_0x359725,_0x29052e){return db['SmsAccount'][_0xf57a('0x58')]({'where':{'id':_0x4df9c7[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x359725,null))[_0xf57a('0x21')](function(_0x54d449){if(_0x54d449){return _0x54d449['removeDispositions'](_0x4df9c7[_0xf57a('0x44')][_0xf57a('0x6b')]);}})['then'](respondWithStatusCode(_0x359725,null))[_0xf57a('0x2b')](handleError(_0x359725,null));};exports['addAnswer']=function(_0x80b262,_0x3fe708,_0x2029be){if(_0x80b262[_0xf57a('0x5a')]['id']){delete _0x80b262[_0xf57a('0x5a')]['id'];}return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x80b262[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x3fe708,null))[_0xf57a('0x21')](function(_0x50591a){if(_0x50591a){_0x80b262['body'][_0xf57a('0x64')]=_0x50591a['id'];return db['CannedAnswer'][_0xf57a('0x59')](_0x80b262[_0xf57a('0x5a')]);}})['then'](respondWithResult(_0x3fe708,null))['catch'](handleError(_0x3fe708,null));};exports[_0xf57a('0x6c')]=function(_0x20f25e,_0x2eba8d,_0x413af0){var _0x5943c1={'raw':![],'where':{}};var _0x21880b={};var _0x1f55b3={'count':0x0,'rows':[]};return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x20f25e[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2eba8d,null))[_0xf57a('0x21')](function(_0x87fec3){if(_0x87fec3){_0x21880b[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0x6d')][_0xf57a('0x55')]);_0x21880b[_0xf57a('0x44')]=_[_0xf57a('0x45')](_0x20f25e[_0xf57a('0x44')]);_0x21880b[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x21880b[_0xf57a('0x43')],_0x21880b[_0xf57a('0x44')]);_0x5943c1[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x21880b[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x20f25e[_0xf57a('0x44')][_0xf57a('0x56')]));_0x5943c1[_0xf57a('0x47')]=_0x5943c1[_0xf57a('0x47')]['length']?_0x5943c1[_0xf57a('0x47')]:_0x21880b['model'];if(!_0x20f25e[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x5943c1['limit']=qs[_0xf57a('0x31')](_0x20f25e[_0xf57a('0x44')][_0xf57a('0x31')]);_0x5943c1[_0xf57a('0x33')]=qs[_0xf57a('0x33')](_0x20f25e[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x5943c1['order']=qs[_0xf57a('0x4a')](_0x20f25e[_0xf57a('0x44')]['sort']);_0x5943c1[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x20f25e[_0xf57a('0x44')],_0x21880b[_0xf57a('0x4c')]));_0x5943c1['where'][_0xf57a('0x64')]=_0x87fec3['id'];if(_0x20f25e[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x5943c1[_0xf57a('0x4b')]=_[_0xf57a('0x4f')](_0x5943c1[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x5943c1[_0xf57a('0x47')],function(_0x18a729){var _0x5662fd={};_0x5662fd[_0x18a729]={'$like':'%'+_0x20f25e[_0xf57a('0x44')][_0xf57a('0x4e')]+'%'};return _0x5662fd;})});}_0x5943c1=_[_0xf57a('0x4f')]({},_0x5943c1,_0x20f25e['options']);return db['CannedAnswer'][_0xf57a('0x32')]({'where':_0x5943c1[_0xf57a('0x4b')]})[_0xf57a('0x21')](function(_0x216733){_0x1f55b3[_0xf57a('0x32')]=_0x216733;if(_0x20f25e[_0xf57a('0x44')][_0xf57a('0x69')]){_0x5943c1[_0xf57a('0x51')]=[{'all':!![]}];}return db[_0xf57a('0x6d')][_0xf57a('0x52')](_0x5943c1);})[_0xf57a('0x21')](function(_0x447fdb){_0x1f55b3[_0xf57a('0x53')]=_0x447fdb;return _0x1f55b3;});}})[_0xf57a('0x21')](respondWithFilteredResult(_0x2eba8d,_0x5943c1))[_0xf57a('0x2b')](handleError(_0x2eba8d,null));};exports[_0xf57a('0x6e')]=function(_0x1cf752,_0x95249b,_0x44f885){return db[_0xf57a('0x41')]['find']({'where':{'id':_0x1cf752['params']['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x95249b,null))[_0xf57a('0x21')](function(_0x39fb47){if(_0x39fb47){return _0x39fb47[_0xf57a('0x6e')](_0x1cf752[_0xf57a('0x44')]['ids']);}})[_0xf57a('0x21')](respondWithStatusCode(_0x95249b,null))['catch'](handleError(_0x95249b,null));};exports['notify']=function(_0x25d924,_0x47e40d,_0x26060d){var _0x2590d4={'channel':'sms'};var _0x2e2d2d=[];var _0x63783=[];var _0x271a54={};return db['SmsAccount'][_0xf57a('0x58')]({'where':{'id':_0x25d924[_0xf57a('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xf57a('0x21')](handleEntityNotFound(_0x47e40d,null))[_0xf57a('0x21')](function(_0x134de8){_0x2590d4[_0xf57a('0x6f')]=_0x134de8;_0x2590d4['applications']=_[_0xf57a('0x70')](_0x134de8['Applications'],[_0xf57a('0x71')],[_0xf57a('0x72')]);if(_0x2590d4['account'][_0xf57a('0x73')]){delete _0x2590d4[_0xf57a('0x6f')][_0xf57a('0x73')];}return db[_0xf57a('0x74')][_0xf57a('0x63')]();})[_0xf57a('0x21')](function(_0x583206){if(!_0x583206){throw new db[(_0xf57a('0x75'))]['ValidationError'](_0xf57a('0x76'));}_0x2e2d2d=_[_0xf57a('0x77')](_['keys'](_0x583206),[_0xf57a('0x78'),'updatedAt']);_0x63783=_[_0xf57a('0x77')](_[_0xf57a('0x45')](_0x583206),[_0xf57a('0x78'),_0xf57a('0x79'),_0xf57a('0x7a'),_0xf57a('0x7b')]);_0x2590d4[_0xf57a('0x5a')]={'mapKey':'mobile'};if(_0x2590d4[_0xf57a('0x6f')][_0xf57a('0x42')]){switch(_0x2590d4[_0xf57a('0x6f')][_0xf57a('0x42')]){case _0xf57a('0x7c'):_0x2590d4[_0xf57a('0x5a')]['from']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x7d')];_0x2590d4['body'][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x7e')];_0x2590d4[_0xf57a('0x5a')]['messageId']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x7f')];break;case _0xf57a('0x80'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]='+'+_0x25d924[_0xf57a('0x5a')]['sender'];_0x2590d4[_0xf57a('0x5a')]['body']=_0x25d924[_0xf57a('0x5a')]['text'];break;case _0xf57a('0x82'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x2a')];break;case _0xf57a('0x83'):_0x2590d4['body'][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x5a')];_0x2590d4[_0xf57a('0x5a')]['messageId']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x84')];break;case _0xf57a('0x85'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924['body'][_0xf57a('0x7d')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924['body'][_0xf57a('0x86')];_0x2590d4['body'][_0xf57a('0x87')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x88')];break;case'infobip':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]='+'+_0x25d924[_0xf57a('0x5a')][_0xf57a('0x89')][0x0][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x89')][0x0][_0xf57a('0x8a')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x87')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x89')][0x0]['messageId'];break;case _0xf57a('0x8b'):_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x8c')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x8d')][_0xf57a('0x2a')];break;case'clickatell':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x8e')];_0x2590d4['body']['body']=_0x25d924['body'][_0xf57a('0x8a')];_0x2590d4['body'][_0xf57a('0x87')]=_0x25d924['body'][_0xf57a('0x8f')];break;case'bandwidth':_0x2590d4['body']['messageId']=_0x25d924[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')]['id'];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')]=_0x25d924[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')][_0xf57a('0x81')];_0x2590d4[_0xf57a('0x5a')]['body']=_0x25d924[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')][_0xf57a('0x8a')];break;case _0xf57a('0x90'):_0x2590d4[_0xf57a('0x5a')]['from']=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x81')];_0x2590d4['body'][_0xf57a('0x5a')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x2a')];_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x87')]=_0x25d924[_0xf57a('0x5a')][_0xf57a('0x91')];break;}}if(_0x2590d4['body']['id']){delete _0x2590d4[_0xf57a('0x5a')]['id'];}if(_[_0xf57a('0x92')](_0x2590d4['body'][_0xf57a('0x81')])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0x94'));}if(_[_0xf57a('0x92')](_0x2590d4[_0xf57a('0x5a')]['body'])||_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x5a')]===''){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf57a('0x92')](_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x95')])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0x96')+_0x63783);}if(!_[_0xf57a('0x97')](_0x63783,_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x95')])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0x98')+_0x63783);}_0x271a54[_0x2590d4['body'][_0xf57a('0x95')]]=_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')];return db[_0xf57a('0x99')]['find']({'where':{'id':_0x2590d4[_0xf57a('0x6f')][_0xf57a('0x7b')]},'include':[{'model':db[_0xf57a('0x74')],'as':'Contacts','where':_0x271a54,'limit':0x1,'order':[[_0xf57a('0x79'),_0xf57a('0x9a')]]}]});})[_0xf57a('0x21')](handleEntityNotFound(_0x47e40d,null))['then'](function(_0x3f1e4f){if(_0x3f1e4f){_0x2590d4['list']=_[_0xf57a('0x9b')](_0x3f1e4f,['Contacts']);if(_0x3f1e4f[_0xf57a('0x9c')]['length']){return _0x3f1e4f[_0xf57a('0x9c')][0x0];}var _0x2d9d0f=_[_0xf57a('0x18')](_0x2590d4[_0xf57a('0x5a')],{'firstName':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')],'ListId':_0x3f1e4f['id']});_0x2d9d0f[_0x2590d4['body']['mapKey']]=_0x2590d4['body'][_0xf57a('0x81')];return db['CmContact'][_0xf57a('0x59')](_0x2d9d0f,{'fields':_0x2e2d2d,'raw':!![]});}})[_0xf57a('0x21')](handleEntityNotFound(_0x47e40d,null))[_0xf57a('0x21')](function(_0x339654){if(_0x339654){_0x2590d4[_0xf57a('0x9d')]=_0x339654;var _0x2656bb={'ContactId':_0x339654['id'],'phone':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')],'SmsAccountId':_0x25d924['params']['id']};var _0x1e7f77={'ContactId':_0x339654['id'],'SmsAccountId':_0x25d924[_0xf57a('0x54')]['id'],'closed':![]};return db[_0xf57a('0x9e')]['find']({'where':_0x1e7f77})[_0xf57a('0x21')](function(_0x47239a){if(_0x47239a){return[_0x47239a,![]];}return db[_0xf57a('0x9e')][_0xf57a('0x59')](_0x2656bb)[_0xf57a('0x21')](function(_0x506e6e){return[_0x506e6e,!![]];});});}})[_0xf57a('0x9f')](function(_0x5c5ea4,_0x482b40){_0x2590d4['interaction']=_0x5c5ea4[_0xf57a('0x38')]({'plain':!![]});_0x2590d4['interaction'][_0xf57a('0xa0')]=![];if(_0x482b40){if(_0x2590d4['account'][_0xf57a('0xa1')]){_0x2590d4[_0xf57a('0xa2')][_0xf57a('0xa3')]({'id':0x0,'priority':_0x2590d4['applications'][_0xf57a('0x57')]+0x1,'app':_0xf57a('0xa4'),'appdata':'unmanaged','interval':_0xf57a('0xa5')});}_0x2590d4[_0xf57a('0xa6')]['created']=!![];}return db[_0xf57a('0xa7')]['create']({'phone':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x81')],'messageId':_0x2590d4[_0xf57a('0x5a')][_0xf57a('0x87')],'body':_0x2590d4['body'][_0xf57a('0x5a')],'SmsAccountId':_0x25d924[_0xf57a('0x54')]['id'],'SmsInteractionId':_0x5c5ea4['id'],'direction':'in','ContactId':_0x5c5ea4[_0xf57a('0xa8')],'AttachmentId':_0x2590d4[_0xf57a('0x5a')]['AttachmentId']});})['then'](function(_0x5c6799){_0x2590d4[_0xf57a('0x2a')]=_0x5c6799;if(!_0x2590d4[_0xf57a('0xa6')][_0xf57a('0xa9')])return;return db[_0xf57a('0xaa')]['find']({'attributes':['id',_0xf57a('0x3b')],'where':{'id':_0x2590d4['interaction'][_0xf57a('0xa9')]}});})[_0xf57a('0x21')](function(_0x53996c){if(_0x53996c){_0x2590d4[_0xf57a('0xa2')][_0xf57a('0xab')]({'id':0x0,'priority':0x0,'app':_0xf57a('0xac'),'appdata':_0x53996c[_0xf57a('0x3b')]+','+(_0x2590d4[_0xf57a('0x6f')][_0xf57a('0xad')]||0xa),'interval':'*,*,*,*'});}if(!_0x2590d4[_0xf57a('0xa6')]['queueId'])return;return db['SmsQueue'][_0xf57a('0x58')]({'attributes':['id','name'],'where':{'id':_0x2590d4[_0xf57a('0xa6')][_0xf57a('0xae')]}});})[_0xf57a('0x21')](function(_0x1187d9){if(_0x1187d9){_0x2590d4[_0xf57a('0xa2')][_0xf57a('0xab')]({'id':0x0,'priority':0x1,'app':_0xf57a('0xaf'),'appdata':_0x1187d9['name']+','+(_0x2590d4['account'][_0xf57a('0xb0')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf57a('0xb1'),'startRouting',_0x2590d4);})[_0xf57a('0x21')](function(_0x21baa2){if(_0x21baa2){var _0x2cbafa=0xc8;var _0x469fc5='receiveMessage';logger[_0xf57a('0x22')](_0xf57a('0x25'),_0x469fc5,_0x2cbafa,'entity\x20found');logger[_0xf57a('0x24')](_0xf57a('0xb2'),_0x469fc5,_0x2cbafa,_0xf57a('0xb3'),JSON[_0xf57a('0x27')](_0x21baa2));if(_0x2590d4['account'][_0xf57a('0x42')]===_0xf57a('0x7c')){return _0x47e40d[_0xf57a('0x2d')](_0x2cbafa)[_0xf57a('0x34')](_0xf57a('0xb4'),'text/xml')[_0xf57a('0x3c')](_0xf57a('0xb5'));}else{return _0x47e40d[_0xf57a('0x2d')](_0x2cbafa)['json'](_0x21baa2);}}})[_0xf57a('0x2b')](handleError(_0x47e40d,null));};exports[_0xf57a('0xb6')]=function(_0x498e40,_0x4fb2bf){var _0x542bf3=_0x498e40['params']['id'];var _0x2fe0fd=_0x498e40['body'];var _0x35e7a6=0xc8;var _0x47fb94=null;return db[_0xf57a('0xb7')][_0xf57a('0xb8')]({'isolationLevel':db[_0xf57a('0xb7')]['Transaction']['ISOLATION_LEVELS'][_0xf57a('0xb9')]},function(_0x939df9){return db['SmsAccount']['findOne']({'where':{'id':_0x542bf3},'transaction':_0x939df9})[_0xf57a('0x21')](function(_0x21fdb8){if(_0x21fdb8){return db[_0xf57a('0xba')][_0xf57a('0x37')]({'where':{'SmsAccountId':_0x542bf3},'transaction':_0x939df9})['then'](function(){var _0x44fb0c=_[_0xf57a('0x40')](_0x2fe0fd,function(_0x324b0b){_0x324b0b['SmsAccountId']=_0x542bf3;return _0x324b0b;});return db['SmsApplication'][_0xf57a('0xbb')](_0x44fb0c,{'transaction':_0x939df9});});}else{_0x35e7a6=0x194;_0x47fb94=[];}});})[_0xf57a('0x21')](function(){if(_0x35e7a6!==0x194){return db[_0xf57a('0xba')][_0xf57a('0xbc')]({'where':{'SmsAccountId':_0x542bf3},'order':_0xf57a('0x71')})[_0xf57a('0x21')](function(_0x18527e){_0x47fb94=_0x18527e;});}})[_0xf57a('0x2b')](function(_0x1e8e24){_0x35e7a6=0x1f4;logger[_0xf57a('0x28')](_0x1e8e24[_0xf57a('0xbd')]);if(_0x1e8e24['name']){delete _0x1e8e24[_0xf57a('0x3b')];}_0x47fb94=_0x1e8e24;})[_0xf57a('0xbe')](function(){if(_0x47fb94===null){_0x4fb2bf[_0xf57a('0x2c')](_0x35e7a6);}else{if(_0x35e7a6===0x1f4){_0x4fb2bf[_0xf57a('0x2d')](_0x35e7a6)[_0xf57a('0x3c')](_0x47fb94);}else{_0x4fb2bf[_0xf57a('0x2d')](_0x35e7a6)[_0xf57a('0x2f')](_0x47fb94);}}});};exports['getApplications']=function(_0x31f462,_0x5ecf1d,_0x50e734){var _0x31002f={};var _0x140fc5={};var _0x2e71cb;var _0x102cad;return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x31f462['params']['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x5ecf1d,null))[_0xf57a('0x21')](function(_0x5139e2){if(_0x5139e2){_0x2e71cb=_0x5139e2;_0x140fc5[_0xf57a('0x43')]=_[_0xf57a('0x45')](db[_0xf57a('0xba')]['rawAttributes']);_0x140fc5[_0xf57a('0x44')]=_['keys'](_0x31f462[_0xf57a('0x44')]);_0x140fc5[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x140fc5[_0xf57a('0x43')],_0x140fc5['query']);_0x31002f[_0xf57a('0x47')]=_['intersection'](_0x140fc5['model'],qs[_0xf57a('0x56')](_0x31f462[_0xf57a('0x44')][_0xf57a('0x56')]));_0x31002f[_0xf57a('0x47')]=_0x31002f[_0xf57a('0x47')]['length']?_0x31002f['attributes']:_0x140fc5[_0xf57a('0x43')];_0x31002f[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x31f462[_0xf57a('0x44')]['sort']);_0x31002f[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_[_0xf57a('0x4d')](_0x31f462[_0xf57a('0x44')],_0x140fc5[_0xf57a('0x4c')]));if(_0x31f462['query'][_0xf57a('0x4e')]){_0x31002f[_0xf57a('0x4b')]=_[_0xf57a('0x4f')](_0x31002f[_0xf57a('0x4b')],{'$or':_[_0xf57a('0x40')](_0x31002f[_0xf57a('0x47')],function(_0x5cf14a){var _0x16c1c7={};_0x16c1c7[_0x5cf14a]={'$like':'%'+_0x31f462['query'][_0xf57a('0x4e')]+'%'};return _0x16c1c7;})});}_0x31002f=_['merge']({},_0x31002f,_0x31f462['options']);return _0x2e71cb[_0xf57a('0xbf')](_0x31002f);}})['then'](function(_0x5de24f){if(_0x5de24f){_0x102cad=_0x5de24f[_0xf57a('0x57')];if(!_0x31f462[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x31002f[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x31f462[_0xf57a('0x44')][_0xf57a('0x31')]);_0x31002f['offset']=qs[_0xf57a('0x33')](_0x31f462[_0xf57a('0x44')][_0xf57a('0x33')]);}return _0x2e71cb[_0xf57a('0xbf')](_0x31002f);}})['then'](function(_0x4efad0){if(_0x4efad0){return _0x4efad0?{'count':_0x102cad,'rows':_0x4efad0}:null;}})[_0xf57a('0x21')](respondWithResult(_0x5ecf1d,null))[_0xf57a('0x2b')](handleError(_0x5ecf1d,null));};exports[_0xf57a('0xc0')]=function(_0x5d39b7,_0x21277a,_0x58d84d){var _0x27d963={'raw':![],'where':{}};var _0x59236e={};var _0x404749={'count':0x0,'rows':[]};return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x5d39b7[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x21277a,null))[_0xf57a('0x21')](function(_0x26cf1d){if(_0x26cf1d){_0x59236e['model']=_[_0xf57a('0x45')](db['SmsInteraction'][_0xf57a('0x55')]);_0x59236e[_0xf57a('0x44')]=_[_0xf57a('0x45')](_0x5d39b7[_0xf57a('0x44')]);_0x59236e[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x59236e[_0xf57a('0x43')],_0x59236e[_0xf57a('0x44')]);_0x27d963['attributes']=_[_0xf57a('0x46')](_0x59236e[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x5d39b7[_0xf57a('0x44')]['fields']));_0x27d963[_0xf57a('0x47')]=_0x27d963[_0xf57a('0x47')][_0xf57a('0x57')]?_0x27d963[_0xf57a('0x47')]:_0x59236e[_0xf57a('0x43')];if(!_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x27d963['limit']=qs[_0xf57a('0x31')](_0x5d39b7['query'][_0xf57a('0x31')]);_0x27d963['offset']=qs[_0xf57a('0x33')](_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x33')]);}_0x27d963[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x5d39b7[_0xf57a('0x44')]['sort']);_0x27d963[_0xf57a('0x4b')]=qs[_0xf57a('0x4c')](_['pick'](_0x5d39b7[_0xf57a('0x44')],_0x59236e[_0xf57a('0x4c')]));_0x27d963[_0xf57a('0x4b')]['SmsAccountId']=_0x26cf1d['id'];if(_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x27d963[_0xf57a('0x4b')]=_[_0xf57a('0x4f')](_0x27d963['where'],{'$or':_[_0xf57a('0x40')](_0x27d963[_0xf57a('0x47')],function(_0x1ba3a1){var _0x3cda84={};_0x3cda84[_0x1ba3a1]={'$like':'%'+_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x4e')]+'%'};return _0x3cda84;})});}_0x27d963=_['merge']({},_0x27d963,_0x5d39b7[_0xf57a('0x50')]);return db[_0xf57a('0x9e')][_0xf57a('0x32')]({'where':_0x27d963[_0xf57a('0x4b')]})[_0xf57a('0x21')](function(_0x3d3361){_0x404749[_0xf57a('0x32')]=_0x3d3361;if(_0x5d39b7[_0xf57a('0x44')][_0xf57a('0x69')]){_0x27d963[_0xf57a('0x51')]=[{'model':db[_0xf57a('0x74')],'as':'Contact','required':![]},{'model':db[_0xf57a('0xaa')],'as':_0xf57a('0xc1'),'attributes':[_0xf57a('0x3b'),_0xf57a('0xc2'),_0xf57a('0xc3')],'required':![]},{'model':db['Tag'],'as':_0xf57a('0xc4'),'attributes':['id','name',_0xf57a('0xc5')],'where':_0x5d39b7[_0xf57a('0x44')]['tag']?{'id':_0x5d39b7[_0xf57a('0x44')][_0xf57a('0xc6')]}:undefined,'required':_0x5d39b7[_0xf57a('0x44')][_0xf57a('0xc6')]?!![]:![]}];}return db[_0xf57a('0x9e')][_0xf57a('0x52')](_0x27d963);})[_0xf57a('0x21')](function(_0x44b408){_0x404749['rows']=_0x44b408;return _0x404749;});}})[_0xf57a('0x21')](respondWithFilteredResult(_0x21277a,_0x27d963))[_0xf57a('0x2b')](handleError(_0x21277a,null));};exports[_0xf57a('0x3c')]=function(_0x23f620,_0x8b100d,_0x1ed45d){var _0x5dc12f,_0x53bc1d,_0x41b777;if(_['isNil'](_0x23f620[_0xf57a('0x5a')][_0xf57a('0x5a')])||_0x23f620[_0xf57a('0x5a')][_0xf57a('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0xf57a('0xc7'));}if(_[_0xf57a('0x92')](_0x23f620[_0xf57a('0x5a')]['to'])){throw new db[(_0xf57a('0x75'))][(_0xf57a('0x93'))](_0xf57a('0xc8'));}_0x5dc12f=_0x23f620[_0xf57a('0x5a')]['to'];return db[_0xf57a('0x41')]['find']({'where':{'id':_0x23f620[_0xf57a('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xf57a('0xc9'),'include':[{'model':db[_0xf57a('0x74')],'as':_0xf57a('0x9c'),'where':{'mobile':_0x5dc12f},'limit':0x1,'order':[[_0xf57a('0x79'),_0xf57a('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x8b100d,null))[_0xf57a('0x21')](function(_0x12ced9){if(_0x12ced9&&_0x12ced9[_0xf57a('0xc9')]){_0x53bc1d=_0x12ced9[_0xf57a('0x38')]({'plain':!![]});if(_0x53bc1d[_0xf57a('0xc9')]&&_0x53bc1d['List'][_0xf57a('0x9c')][_0xf57a('0x57')]){return _0x53bc1d[_0xf57a('0xc9')][_0xf57a('0x9c')][0x0];}return db[_0xf57a('0x74')]['create'](_['defaults'](_0x23f620[_0xf57a('0x5a')],{'firstName':_0x5dc12f,'mobile':_0x5dc12f,'phone':_0x5dc12f,'ListId':_0x53bc1d[_0xf57a('0x7b')]}));}})[_0xf57a('0x21')](handleEntityNotFound(_0x8b100d,null))[_0xf57a('0x21')](function(_0x2b368d){if(_0x2b368d){_0x41b777=_0x2b368d;return db[_0xf57a('0x9e')][_0xf57a('0x58')]({'where':{'ContactId':_0x41b777['id'],'closed':![],'SmsAccountId':_0x53bc1d['id']}})['then'](function(_0x17a8a9){if(_0x17a8a9){return[_0x17a8a9,![]];}return db[_0xf57a('0x9e')][_0xf57a('0x59')]({'UserId':_0x23f620[_0xf57a('0x5b')]['id'],'ContactId':_0x41b777['id'],'SmsAccountId':_0x53bc1d['id'],'phone':_0x5dc12f,'firstMsgDirection':'out','Messages':[_[_0xf57a('0x4f')](_0x23f620['body'],{'read':![],'body':_0x23f620[_0xf57a('0x5a')][_0xf57a('0x5a')],'phone':_0x5dc12f,'SmsAccountId':_0x53bc1d['id'],'UserId':_0x23f620['user']['id'],'ContactId':_0x41b777['id']})]},{'include':[{'model':db[_0xf57a('0xa7')],'as':'Messages'}]})['then'](function(_0x2dfaca){return[_0x2dfaca,!![]];});});}})['spread'](function(_0x4e332c,_0x1c3edf){if(_0x1c3edf){return _0x4e332c;}return db[_0xf57a('0xa7')][_0xf57a('0x59')](_[_0xf57a('0x4f')](_0x23f620['body'],{'read':![],'body':_0x23f620[_0xf57a('0x5a')]['body'],'phone':_0x5dc12f,'SmsAccountId':_0x53bc1d['id'],'SmsInteractionId':_0x4e332c['id'],'UserId':_0x23f620['user']['id'],'ContactId':_0x41b777['id']}))[_0xf57a('0x21')](function(_0x24d823){_0x4e332c['dataValues'][_0xf57a('0xca')]=[];_0x4e332c[_0xf57a('0xcb')]['Messages'][_0xf57a('0xa3')](_0x24d823[_0xf57a('0xcb')]);return _0x4e332c;});})[_0xf57a('0x21')](respondWithResult(_0x8b100d,null))[_0xf57a('0x2b')](handleError(_0x8b100d,null));};exports[_0xf57a('0x2d')]=function(_0xfb9d58,_0x39293e,_0xc8ff7a){if(_0xfb9d58[_0xf57a('0x5a')]['id']){delete _0xfb9d58[_0xf57a('0x5a')]['id'];}var _0x5210c5,_0x38cd8f,_0x16b41a;return db[_0xf57a('0x41')]['find']({'where':{'id':_0xfb9d58[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x39293e,null))['then'](function(_0x5f22d6){if(_0x5f22d6){_0x16b41a=_0x5f22d6;logger['debug'](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0xcc'),_0x5f22d6['type'],util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5f22d6[_0xf57a('0x42')]){case _0xf57a('0x80'):if(_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0xce')]&&_0xfb9d58['body'][_0xf57a('0x2d')]){_0x38cd8f=_0xfb9d58['body'][_0xf57a('0x2d')];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0xfb9d58['body'][_0xf57a('0xce')]}});}break;case _0xf57a('0x82'):if(_0xfb9d58['body'][_0xf57a('0xcf')]&&_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0xd0')]){_0x38cd8f=_0xfb9d58['body'][_0xf57a('0xd0')];return db[_0xf57a('0xa7')]['find']({'where':{'messageId':_0xfb9d58['body'][_0xf57a('0xcf')]}});}break;case _0xf57a('0x83'):if(_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x84')]&&_0xfb9d58[_0xf57a('0x5a')]['status_code']){_0x38cd8f=_0xfb9d58[_0xf57a('0x5a')]['status_code'];return db[_0xf57a('0xa7')]['find']({'where':{'messageId':_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x84')]}});}break;case'infobip':var _0x3fca61=_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x89')][0x0];if(_0x3fca61[_0xf57a('0x87')]&&_0x3fca61[_0xf57a('0x2d')][_0xf57a('0xd1')]===_0xf57a('0xd2')){_0x38cd8f=_0x3fca61[_0xf57a('0x2d')][_0xf57a('0xd1')];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0x3fca61[_0xf57a('0x87')]}});}break;case _0xf57a('0xd3'):if(_0xfb9d58[_0xf57a('0x5a')]['messageId']&&_0xfb9d58[_0xf57a('0x5a')]['status']){_0x38cd8f=_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x2d')];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x87')]}});}break;case _0xf57a('0xd4'):if(_0xfb9d58[_0xf57a('0x5a')][0x0][_0xf57a('0x2a')]['id']){_0x38cd8f=_0xfb9d58['body'][0x0]['type'];return db[_0xf57a('0xa7')][_0xf57a('0x58')]({'where':{'messageId':_0xfb9d58['body'][0x0][_0xf57a('0x2a')]['id']}});}break;case _0xf57a('0x90'):if(_0xfb9d58['body'][_0xf57a('0xd5')]&&_0xfb9d58['body']['status']){_0x38cd8f=_0xfb9d58['body'][_0xf57a('0x2d')];return db['SmsMessage']['find']({'where':{'messageId':_0xfb9d58['body'][_0xf57a('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x39293e,null))[_0xf57a('0x21')](function(_0x1420f5){if(_0x1420f5){_0x5210c5=_0x1420f5;switch(_0x16b41a[_0xf57a('0x42')]){case'skebby':if(_0x38cd8f===_0xf57a('0xd2')){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),'status',_0xf57a('0x80'),util[_0xf57a('0xcd')](_0xfb9d58['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x38cd8f==='1'){return _0x5210c5['update']({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0x80'),util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf57a('0x83'):if(!_0xfb9d58[_0xf57a('0x5a')]['error_code']&&_0x38cd8f>=0xc8&&_0x38cd8f<=0xce){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),'clicksend',util[_0xf57a('0xcd')](_0xfb9d58['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x30dbaf=_0xfb9d58[_0xf57a('0x5a')][_0xf57a('0x89')][0x0];if(_0x30dbaf['status']['groupName']===_0xf57a('0xd2')){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger['error'](_0xf57a('0x25'),_0xf57a('0x2d'),'infobip',util['inspect'](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf57a('0xd3'):if(_0x38cd8f==_0xf57a('0xd6')||_0x38cd8f=='RECEIVED_BY_RECIPIENT'){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0xd3'),util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x38cd8f==_0xf57a('0xd7')){return _0x5210c5['update']({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0xd4'),util[_0xf57a('0xcd')](_0xfb9d58[_0xf57a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xf57a('0x90'):if(_0x38cd8f===_0xf57a('0xd8')||_0x38cd8f===_0xf57a('0xd9')){return _0x5210c5[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),_0xf57a('0x2d'),_0xf57a('0x90'),util[_0xf57a('0xcd')](_0xfb9d58['body'],{'showHidden':![],'depth':null}));}break;}return _0x5210c5;}})[_0xf57a('0x21')](respondWithResult(_0x39293e,null))[_0xf57a('0x2b')](handleError(_0x39293e,null));};exports[_0xf57a('0xda')]=function(_0x506a95,_0xf55020,_0x261f55){var _0x4cd4f4,_0x18b2cd,_0x239bf8;return db[_0xf57a('0x41')]['find']({'where':{'id':_0x506a95[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0xf55020,null))[_0xf57a('0x21')](function(_0x15b6cb){if(_0x15b6cb){_0x239bf8=_0x15b6cb;logger[_0xf57a('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf57a('0x2d'),_0xf57a('0xcc'),_0x15b6cb[_0xf57a('0x42')],util['inspect'](_0x506a95[_0xf57a('0x44')],{'showHidden':![],'depth':null}));switch(_0x15b6cb[_0xf57a('0x42')]){case'csc':if(_0x506a95[_0xf57a('0x44')][_0xf57a('0xdb')]&&_0x506a95[_0xf57a('0x44')][_0xf57a('0xdc')]){_0x18b2cd=_0x506a95[_0xf57a('0x44')][_0xf57a('0xdc')];return db[_0xf57a('0xa7')]['find']({'where':{'messageId':_0x506a95[_0xf57a('0x44')][_0xf57a('0xdb')]}});}break;}}})[_0xf57a('0x21')](handleEntityNotFound(_0xf55020,null))['then'](function(_0x26e691){if(_0x26e691){_0x4cd4f4=_0x26e691;switch(_0x239bf8[_0xf57a('0x42')]){case _0xf57a('0x8b'):if(_0x18b2cd==='2'||_0x18b2cd==='6'){return _0x4cd4f4[_0xf57a('0x62')]({'read':!![]});}else{logger[_0xf57a('0x28')](_0xf57a('0x25'),'status',_0xf57a('0x8b'),util[_0xf57a('0xcd')](_0x506a95['query'],{'showHidden':![],'depth':null}));};break;}return _0x4cd4f4;}})[_0xf57a('0x21')](respondWithResult(_0xf55020,null))[_0xf57a('0x2b')](handleError(_0xf55020,null));};exports['addAgents']=function(_0x585b31,_0x462452,_0x38d418){return db[_0xf57a('0x41')][_0xf57a('0x58')]({'where':{'id':_0x585b31[_0xf57a('0x54')]['id']}})['then'](handleEntityNotFound(_0x462452,null))[_0xf57a('0x21')](function(_0x5043dd){if(_0x5043dd){return _0x5043dd[_0xf57a('0xdd')](_0x585b31[_0xf57a('0x5a')][_0xf57a('0x6b')],_['omit'](_0x585b31['body'],['ids','id'])||{})[_0xf57a('0x9f')](function(_0x319971){for(var _0x17c296=0x0;_0x17c296<_0x585b31[_0xf57a('0x5a')][_0xf57a('0x6b')][_0xf57a('0x57')];_0x17c296+=0x1){socket[_0xf57a('0xde')](_0xf57a('0xdf'),{'UserId':Number(_0x585b31[_0xf57a('0x5a')]['ids'][_0x17c296]),'SmsAccountId':Number(_0x585b31['params']['id'])});}return _0x319971;});}})[_0xf57a('0x21')](respondWithResult(_0x462452,null))[_0xf57a('0x2b')](handleError(_0x462452,null));};exports[_0xf57a('0xe0')]=function(_0x2c8780,_0x35d78f,_0x38e106){return db['SmsAccount'][_0xf57a('0x58')]({'where':{'id':_0x2c8780[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x35d78f,null))[_0xf57a('0x21')](function(_0x33244e){if(_0x33244e){return _0x33244e[_0xf57a('0xe0')](_0x2c8780[_0xf57a('0x44')]['ids'])[_0xf57a('0x21')](function(){if(_[_0xf57a('0xe1')](_0x2c8780['query']['ids'])){for(var _0x4f73d5=0x0;_0x4f73d5<_0x2c8780['query'][_0xf57a('0x6b')][_0xf57a('0x57')];_0x4f73d5+=0x1){socket['emit'](_0xf57a('0xe2'),{'UserId':Number(_0x2c8780[_0xf57a('0x44')][_0xf57a('0x6b')][_0x4f73d5]),'SmsAccountId':Number(_0x2c8780['params']['id'])});}}else{socket[_0xf57a('0xde')](_0xf57a('0xe2'),{'UserId':Number(_0x2c8780[_0xf57a('0x44')][_0xf57a('0x6b')]),'SmsAccountId':Number(_0x2c8780[_0xf57a('0x54')]['id'])});}});}})[_0xf57a('0x21')](respondWithStatusCode(_0x35d78f,null))[_0xf57a('0x2b')](handleError(_0x35d78f,null));};exports['getAgents']=function(_0x238575,_0x2b80c0,_0x38baed){var _0x14e52b={};var _0x35b224={};var _0xd22131;var _0x3b51cd;return db[_0xf57a('0x41')][_0xf57a('0x67')]({'where':{'id':_0x238575[_0xf57a('0x54')]['id']}})[_0xf57a('0x21')](handleEntityNotFound(_0x2b80c0,null))[_0xf57a('0x21')](function(_0x43d97b){if(_0x43d97b){_0xd22131=_0x43d97b;_0x35b224[_0xf57a('0x43')]=_[_0xf57a('0x45')](db['User'][_0xf57a('0x55')]);_0x35b224[_0xf57a('0x44')]=_['keys'](_0x238575[_0xf57a('0x44')]);_0x35b224[_0xf57a('0x4c')]=_[_0xf57a('0x46')](_0x35b224[_0xf57a('0x43')],_0x35b224[_0xf57a('0x44')]);_0x14e52b[_0xf57a('0x47')]=_[_0xf57a('0x46')](_0x35b224[_0xf57a('0x43')],qs[_0xf57a('0x56')](_0x238575[_0xf57a('0x44')][_0xf57a('0x56')]));_0x14e52b[_0xf57a('0x47')]=_0x14e52b['attributes'][_0xf57a('0x57')]?_0x14e52b[_0xf57a('0x47')]:_0x35b224[_0xf57a('0x43')];_0x14e52b[_0xf57a('0x49')]=qs[_0xf57a('0x4a')](_0x238575[_0xf57a('0x44')]['sort']);_0x14e52b[_0xf57a('0x4b')]=qs['filters'](_[_0xf57a('0x4d')](_0x238575[_0xf57a('0x44')],_0x35b224['filters']));if(_0x238575[_0xf57a('0x44')][_0xf57a('0x4e')]){_0x14e52b['where']=_['merge'](_0x14e52b['where'],{'$or':_[_0xf57a('0x40')](_0x14e52b['attributes'],function(_0x401113){var _0x43f5c1={};_0x43f5c1[_0x401113]={'$like':'%'+_0x238575['query'][_0xf57a('0x4e')]+'%'};return _0x43f5c1;})});}_0x14e52b=_[_0xf57a('0x4f')]({},_0x14e52b,_0x238575[_0xf57a('0x50')]);return _0xd22131[_0xf57a('0xe3')](_0x14e52b);}})[_0xf57a('0x21')](function(_0x80f2da){if(_0x80f2da){_0x3b51cd=_0x80f2da['length'];if(!_0x238575[_0xf57a('0x44')][_0xf57a('0x48')](_0xf57a('0x68'))){_0x14e52b[_0xf57a('0x31')]=qs[_0xf57a('0x31')](_0x238575[_0xf57a('0x44')][_0xf57a('0x31')]);_0x14e52b[_0xf57a('0x33')]=qs[_0xf57a('0x33')](_0x238575[_0xf57a('0x44')]['offset']);}return _0xd22131[_0xf57a('0xe3')](_0x14e52b);}})[_0xf57a('0x21')](function(_0x4dbc6b){if(_0x4dbc6b){return _0x4dbc6b?{'count':_0x3b51cd,'rows':_0x4dbc6b}:null;}})[_0xf57a('0x21')](respondWithResult(_0x2b80c0,null))[_0xf57a('0x2b')](handleError(_0x2b80c0,null));};
\ No newline at end of file
+var _0x63bf=['created','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','transaction','sequelize','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','Contact','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','intelepeer','redif','update','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','destroy','get','SmsAccounts','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','SmsAccountId','removeDispositions','getAnswers','findOne','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','message_id','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','close','unmanaged','*,*,*,*'];(function(_0x38b72e,_0x2d4e01){var _0x284562=function(_0x2fcbed){while(--_0x2fcbed){_0x38b72e['push'](_0x38b72e['shift']());}};_0x284562(++_0x2d4e01);}(_0x63bf,0x120));var _0xf63b=function(_0x1dea25,_0x199085){_0x1dea25=_0x1dea25-0x0;var _0x48c046=_0x63bf[_0x1dea25];return _0x48c046;};'use strict';var emlformat=require(_0xf63b('0x0'));var rimraf=require(_0xf63b('0x1'));var zipdir=require(_0xf63b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf63b('0x3'));var moment=require(_0xf63b('0x4'));var BPromise=require(_0xf63b('0x5'));var Mustache=require(_0xf63b('0x6'));var util=require('util');var path=require(_0xf63b('0x7'));var sox=require(_0xf63b('0x8'));var csv=require(_0xf63b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf63b('0xa'));var _=require('lodash');var squel=require(_0xf63b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf63b('0xc'));var Papa=require('papaparse');var Redis=require(_0xf63b('0xd'));var authService=require(_0xf63b('0xe'));var qs=require(_0xf63b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf63b('0x10'));var logger=require(_0xf63b('0x11'))(_0xf63b('0x12'));var utils=require('../../config/utils');var config=require(_0xf63b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf63b('0x14'))['db'];config[_0xf63b('0x15')]=_[_0xf63b('0x16')](config[_0xf63b('0x15')],{'host':_0xf63b('0x17'),'port':0x18eb});var socket=require(_0xf63b('0x18'))(new Redis(config[_0xf63b('0x15')]));require('./smsAccount.socket')[_0xf63b('0x19')](socket);var jayson=require(_0xf63b('0x1a'));var client=jayson[_0xf63b('0x1b')][_0xf63b('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2739db,_0x4bba7f,_0x2eee99,_0x3acb4e){return new BPromise(function(_0x38a11f,_0x5eb5dc){var _0x172218=_0x3acb4e||client;return _0x172218[_0xf63b('0x1d')](_0x2739db,_0x2eee99)[_0xf63b('0x1e')](function(_0x125fb8){logger[_0xf63b('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x4bba7f,_0xf63b('0x20'));logger['debug'](_0xf63b('0x21'),_0x4bba7f,'request\x20sent',JSON[_0xf63b('0x22')](_0x125fb8));if(_0x125fb8[_0xf63b('0x23')]){if(_0x125fb8[_0xf63b('0x23')][_0xf63b('0x24')]===0x1f4){logger[_0xf63b('0x23')](_0xf63b('0x25'),_0x4bba7f,_0x125fb8[_0xf63b('0x23')][_0xf63b('0x26')]);return _0x5eb5dc(_0x125fb8[_0xf63b('0x23')][_0xf63b('0x26')]);}logger[_0xf63b('0x23')](_0xf63b('0x25'),_0x4bba7f,_0x125fb8[_0xf63b('0x23')]['message']);return _0x38a11f(_0x125fb8[_0xf63b('0x23')][_0xf63b('0x26')]);}else{logger[_0xf63b('0x1f')](_0xf63b('0x25'),_0x4bba7f,_0xf63b('0x20'));_0x38a11f(_0x125fb8[_0xf63b('0x27')][_0xf63b('0x26')]);}})[_0xf63b('0x28')](function(_0x52b1f1){logger[_0xf63b('0x23')](_0xf63b('0x25'),_0x4bba7f,_0x52b1f1);_0x5eb5dc(_0x52b1f1);});});}function respondWithStatusCode(_0x16a963,_0x1de88d){_0x1de88d=_0x1de88d||0xcc;return function(_0x302796){if(_0x302796){return _0x16a963[_0xf63b('0x29')](_0x1de88d);}return _0x16a963[_0xf63b('0x2a')](_0x1de88d)[_0xf63b('0x2b')]();};}function respondWithResult(_0x3b7a5c,_0x243dff){_0x243dff=_0x243dff||0xc8;return function(_0x4c5360){if(_0x4c5360){return _0x3b7a5c['status'](_0x243dff)['json'](_0x4c5360);}};}function respondWithFilteredResult(_0x2d9e66,_0x28bb5d){return function(_0x3176d3){if(_0x3176d3){var _0x745f1b=typeof _0x28bb5d['offset']===_0xf63b('0x2c')&&typeof _0x28bb5d[_0xf63b('0x2d')]==='undefined';var _0x16f3db=_0x3176d3['count'];var _0x518d30=_0x745f1b?0x0:_0x28bb5d['offset'];var _0x346219=_0x745f1b?_0x3176d3[_0xf63b('0x2e')]:_0x28bb5d[_0xf63b('0x2f')]+_0x28bb5d[_0xf63b('0x2d')];var _0x363ff9;if(_0x346219>=_0x16f3db){_0x346219=_0x16f3db;_0x363ff9=0xc8;}else{_0x363ff9=0xce;}_0x2d9e66[_0xf63b('0x2a')](_0x363ff9);return _0x2d9e66[_0xf63b('0x30')](_0xf63b('0x31'),_0x518d30+'-'+_0x346219+'/'+_0x16f3db)[_0xf63b('0x32')](_0x3176d3);}return null;};}function patchUpdates(_0x295783){return function(_0x35fb51){try{jsonpatch[_0xf63b('0x33')](_0x35fb51,_0x295783,!![]);}catch(_0x4e702b){return BPromise['reject'](_0x4e702b);}return _0x35fb51['save']();};}function saveUpdates(_0x5360e2,_0x91bafb){return function(_0x4a2ee5){if(_0x4a2ee5){return _0x4a2ee5['update'](_0x5360e2)[_0xf63b('0x1e')](function(_0x5f1a17){return _0x5f1a17;});}return null;};}function removeEntity(_0x444793,_0x5299bc){return function(_0x261047){if(_0x261047){return _0x261047[_0xf63b('0x34')]()[_0xf63b('0x1e')](function(){var _0x5bd41c=_0x261047[_0xf63b('0x35')]({'plain':!![]});var _0x597a68=_0xf63b('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x597a68,'resourceId':_0x5bd41c['id']}})[_0xf63b('0x1e')](function(){return _0x261047;});})[_0xf63b('0x1e')](function(){_0x444793[_0xf63b('0x2a')](0xcc)[_0xf63b('0x2b')]();});}};}function handleEntityNotFound(_0x3ec18d,_0x2b5747){return function(_0x1e5ee6){if(!_0x1e5ee6){_0x3ec18d['sendStatus'](0x194);}return _0x1e5ee6;};}function handleError(_0x4aef20,_0x19dfe4){_0x19dfe4=_0x19dfe4||0x1f4;return function(_0x3757ea){logger['error'](_0x3757ea['stack']);if(_0x3757ea[_0xf63b('0x37')]){delete _0x3757ea['name'];}_0x4aef20['status'](_0x19dfe4)[_0xf63b('0x38')](_0x3757ea);};}exports[_0xf63b('0x39')]=function(_0x233113,_0x1ea809){var _0x596960={'include':[{'model':db[_0xf63b('0x3a')],'as':_0xf63b('0x3b')}]},_0x562743={},_0x24eb83={'count':0x0,'rows':[]};var _0x199e6f=_[_0xf63b('0x3c')](db[_0xf63b('0x3d')][_0xf63b('0x3e')],function(_0x30127c){return{'name':_0x30127c['fieldName'],'type':_0x30127c[_0xf63b('0x3f')]['key']};});_0x562743[_0xf63b('0x40')]=_[_0xf63b('0x3c')](_0x199e6f,'name');_0x562743[_0xf63b('0x41')]=_[_0xf63b('0x42')](_0x233113[_0xf63b('0x41')]);_0x562743[_0xf63b('0x43')]=_[_0xf63b('0x44')](_0x562743[_0xf63b('0x40')],_0x562743[_0xf63b('0x41')]);_0x596960[_0xf63b('0x45')]=_[_0xf63b('0x44')](_0x562743[_0xf63b('0x40')],qs[_0xf63b('0x46')](_0x233113[_0xf63b('0x41')][_0xf63b('0x46')]));_0x596960[_0xf63b('0x45')]=_0x596960[_0xf63b('0x45')][_0xf63b('0x47')]?_0x596960['attributes']:_0x562743[_0xf63b('0x40')];if(!_0x233113[_0xf63b('0x41')][_0xf63b('0x48')](_0xf63b('0x49'))){_0x596960[_0xf63b('0x2d')]=qs['limit'](_0x233113[_0xf63b('0x41')][_0xf63b('0x2d')]);_0x596960[_0xf63b('0x2f')]=qs['offset'](_0x233113[_0xf63b('0x41')][_0xf63b('0x2f')]);}_0x596960[_0xf63b('0x4a')]=qs[_0xf63b('0x4b')](_0x233113['query'][_0xf63b('0x4b')]);_0x596960['where']=qs[_0xf63b('0x43')](_[_0xf63b('0x4c')](_0x233113['query'],_0x562743[_0xf63b('0x43')]),_0x199e6f);if(_0x233113['query'][_0xf63b('0x4d')]){_0x596960['where']=_[_0xf63b('0x4e')](_0x596960[_0xf63b('0x4f')],{'$or':_[_0xf63b('0x3c')](_0x199e6f,function(_0x499bb8){if(_0x499bb8[_0xf63b('0x3f')]!=='VIRTUAL'){var _0x344489={};_0x344489[_0x499bb8[_0xf63b('0x37')]]={'$like':'%'+_0x233113[_0xf63b('0x41')]['filter']+'%'};return _0x344489;}})});}_0x596960=_['merge']({},_0x596960,_0x233113[_0xf63b('0x50')]);var _0x1b096c={'where':_0x596960['where']};return db[_0xf63b('0x3d')][_0xf63b('0x2e')](_0x1b096c)[_0xf63b('0x1e')](function(_0x5b1582){_0x24eb83[_0xf63b('0x2e')]=_0x5b1582;if(_0x233113[_0xf63b('0x41')][_0xf63b('0x51')]){_0x596960[_0xf63b('0x52')]=[{'all':!![]}];}return db[_0xf63b('0x3d')][_0xf63b('0x53')](_0x596960);})[_0xf63b('0x1e')](function(_0x2b7ec3){_0x24eb83[_0xf63b('0x54')]=_0x2b7ec3;return _0x24eb83;})[_0xf63b('0x1e')](respondWithFilteredResult(_0x1ea809,_0x596960))[_0xf63b('0x28')](handleError(_0x1ea809,null));};exports[_0xf63b('0x55')]=function(_0x22d8f5,_0x36cb24){var _0x37090c={'raw':![],'where':{'id':_0x22d8f5['params']['id']},'include':[{'model':db[_0xf63b('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3de136={};_0x3de136[_0xf63b('0x40')]=_[_0xf63b('0x42')](db['SmsAccount'][_0xf63b('0x3e')]);_0x3de136[_0xf63b('0x41')]=_[_0xf63b('0x42')](_0x22d8f5[_0xf63b('0x41')]);_0x3de136[_0xf63b('0x43')]=_[_0xf63b('0x44')](_0x3de136[_0xf63b('0x40')],_0x3de136[_0xf63b('0x41')]);_0x37090c[_0xf63b('0x45')]=_['intersection'](_0x3de136[_0xf63b('0x40')],qs[_0xf63b('0x46')](_0x22d8f5[_0xf63b('0x41')][_0xf63b('0x46')]));_0x37090c[_0xf63b('0x45')]=_0x37090c[_0xf63b('0x45')][_0xf63b('0x47')]?_0x37090c[_0xf63b('0x45')]:_0x3de136[_0xf63b('0x40')];if(_0x22d8f5[_0xf63b('0x41')][_0xf63b('0x51')]){_0x37090c[_0xf63b('0x52')]=[{'all':!![]}];}_0x37090c=_[_0xf63b('0x4e')]({},_0x37090c,_0x22d8f5['options']);return db[_0xf63b('0x3d')][_0xf63b('0x56')](_0x37090c)['then'](handleEntityNotFound(_0x36cb24,null))['then'](respondWithResult(_0x36cb24,null))['catch'](handleError(_0x36cb24,null));};exports[_0xf63b('0x57')]=function(_0x1840de,_0x37bdce){return db[_0xf63b('0x3d')][_0xf63b('0x57')](_0x1840de[_0xf63b('0x58')],{})[_0xf63b('0x1e')](function(_0x242dde){var _0x3dea03=_0x1840de[_0xf63b('0x59')][_0xf63b('0x35')]({'plain':!![]});if(!_0x3dea03)throw new Error(_0xf63b('0x5a'));if(_0x3dea03['role']===_0xf63b('0x59')){var _0x2a8d81=_0x242dde[_0xf63b('0x35')]({'plain':!![]});var _0x4d8cdb=_0xf63b('0x36');return db[_0xf63b('0x5b')]['find']({'where':{'name':_0x4d8cdb,'userProfileId':_0x3dea03['userProfileId']},'raw':!![]})[_0xf63b('0x1e')](function(_0x5a831){if(_0x5a831&&_0x5a831[_0xf63b('0x5c')]===0x0){return db[_0xf63b('0x5d')][_0xf63b('0x57')]({'name':_0x2a8d81['name'],'resourceId':_0x2a8d81['id'],'type':_0x5a831[_0xf63b('0x37')],'sectionId':_0x5a831['id']},{})[_0xf63b('0x1e')](function(){return _0x242dde;});}else{return _0x242dde;}})[_0xf63b('0x28')](function(_0x321577){logger[_0xf63b('0x23')](_0xf63b('0x5e'),_0x321577);throw _0x321577;});}return _0x242dde;})[_0xf63b('0x1e')](respondWithResult(_0x37bdce,0xc9))[_0xf63b('0x28')](handleError(_0x37bdce,null));};exports['update']=function(_0xb921e9,_0x3b4c09){if(_0xb921e9[_0xf63b('0x58')]['id']){delete _0xb921e9[_0xf63b('0x58')]['id'];}return db[_0xf63b('0x3d')][_0xf63b('0x56')]({'where':{'id':_0xb921e9[_0xf63b('0x5f')]['id']},'include':[{'model':db[_0xf63b('0x3a')],'as':_0xf63b('0x3b')}]})[_0xf63b('0x1e')](handleEntityNotFound(_0x3b4c09,null))[_0xf63b('0x1e')](saveUpdates(_0xb921e9[_0xf63b('0x58')],null))[_0xf63b('0x1e')](respondWithResult(_0x3b4c09,null))[_0xf63b('0x28')](handleError(_0x3b4c09,null));};exports[_0xf63b('0x34')]=function(_0x473a2a,_0x36a18f){return db[_0xf63b('0x3d')]['find']({'where':{'id':_0x473a2a['params']['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x36a18f,null))[_0xf63b('0x1e')](removeEntity(_0x36a18f,null))[_0xf63b('0x28')](handleError(_0x36a18f,null));};exports[_0xf63b('0x60')]=function(_0x346b6b,_0x572a01){return db[_0xf63b('0x3d')]['describe']()['then'](respondWithResult(_0x572a01,null))[_0xf63b('0x28')](handleError(_0x572a01,null));};exports[_0xf63b('0x61')]=function(_0x36b29d,_0x58dda9,_0x1d6ca6){if(_0x36b29d[_0xf63b('0x58')]['id']){delete _0x36b29d[_0xf63b('0x58')]['id'];}return db['SmsAccount'][_0xf63b('0x56')]({'where':{'id':_0x36b29d[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x58dda9,null))[_0xf63b('0x1e')](function(_0x13cca1){if(_0x13cca1){_0x36b29d[_0xf63b('0x58')]['SmsAccountId']=_0x13cca1['id'];return db[_0xf63b('0x62')][_0xf63b('0x57')](_0x36b29d[_0xf63b('0x58')]);}})[_0xf63b('0x1e')](respondWithResult(_0x58dda9,null))[_0xf63b('0x28')](handleError(_0x58dda9,null));};exports['getDispositions']=function(_0x25f04f,_0x1fa390,_0x4878d7){var _0x4cb4e3={'raw':![],'where':{}};var _0x235c6b={};var _0x140846={'count':0x0,'rows':[]};return db[_0xf63b('0x3d')]['findOne']({'where':{'id':_0x25f04f[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x1fa390,null))[_0xf63b('0x1e')](function(_0x544bea){if(_0x544bea){_0x235c6b['model']=_[_0xf63b('0x42')](db[_0xf63b('0x62')]['rawAttributes']);_0x235c6b[_0xf63b('0x41')]=_[_0xf63b('0x42')](_0x25f04f[_0xf63b('0x41')]);_0x235c6b['filters']=_[_0xf63b('0x44')](_0x235c6b['model'],_0x235c6b['query']);_0x4cb4e3[_0xf63b('0x45')]=_[_0xf63b('0x44')](_0x235c6b[_0xf63b('0x40')],qs[_0xf63b('0x46')](_0x25f04f[_0xf63b('0x41')][_0xf63b('0x46')]));_0x4cb4e3[_0xf63b('0x45')]=_0x4cb4e3['attributes'][_0xf63b('0x47')]?_0x4cb4e3['attributes']:_0x235c6b[_0xf63b('0x40')];if(!_0x25f04f[_0xf63b('0x41')][_0xf63b('0x48')]('nolimit')){_0x4cb4e3['limit']=qs[_0xf63b('0x2d')](_0x25f04f[_0xf63b('0x41')][_0xf63b('0x2d')]);_0x4cb4e3[_0xf63b('0x2f')]=qs['offset'](_0x25f04f[_0xf63b('0x41')][_0xf63b('0x2f')]);}_0x4cb4e3['order']=qs[_0xf63b('0x4b')](_0x25f04f['query'][_0xf63b('0x4b')]);_0x4cb4e3['where']=qs[_0xf63b('0x43')](_[_0xf63b('0x4c')](_0x25f04f[_0xf63b('0x41')],_0x235c6b[_0xf63b('0x43')]));_0x4cb4e3['where'][_0xf63b('0x63')]=_0x544bea['id'];if(_0x25f04f['query'][_0xf63b('0x4d')]){_0x4cb4e3[_0xf63b('0x4f')]=_[_0xf63b('0x4e')](_0x4cb4e3['where'],{'$or':_[_0xf63b('0x3c')](_0x4cb4e3[_0xf63b('0x45')],function(_0x526104){var _0x5d4bae={};_0x5d4bae[_0x526104]={'$like':'%'+_0x25f04f['query'][_0xf63b('0x4d')]+'%'};return _0x5d4bae;})});}_0x4cb4e3=_[_0xf63b('0x4e')]({},_0x4cb4e3,_0x25f04f[_0xf63b('0x50')]);return db[_0xf63b('0x62')]['count']({'where':_0x4cb4e3[_0xf63b('0x4f')]})[_0xf63b('0x1e')](function(_0xb055){_0x140846[_0xf63b('0x2e')]=_0xb055;if(_0x25f04f['query'][_0xf63b('0x51')]){_0x4cb4e3[_0xf63b('0x52')]=[{'all':!![]}];}return db[_0xf63b('0x62')][_0xf63b('0x53')](_0x4cb4e3);})[_0xf63b('0x1e')](function(_0xcdc3b3){_0x140846[_0xf63b('0x54')]=_0xcdc3b3;return _0x140846;});}})[_0xf63b('0x1e')](respondWithFilteredResult(_0x1fa390,_0x4cb4e3))[_0xf63b('0x28')](handleError(_0x1fa390,null));};exports['removeDispositions']=function(_0x4aa32c,_0x4d2720,_0x1c1cf1){return db[_0xf63b('0x3d')]['find']({'where':{'id':_0x4aa32c[_0xf63b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4d2720,null))[_0xf63b('0x1e')](function(_0x597b8e){if(_0x597b8e){return _0x597b8e[_0xf63b('0x64')](_0x4aa32c['query']['ids']);}})[_0xf63b('0x1e')](respondWithStatusCode(_0x4d2720,null))[_0xf63b('0x28')](handleError(_0x4d2720,null));};exports['addAnswer']=function(_0x31ef67,_0x533ed7,_0x5cd94a){if(_0x31ef67[_0xf63b('0x58')]['id']){delete _0x31ef67[_0xf63b('0x58')]['id'];}return db[_0xf63b('0x3d')]['find']({'where':{'id':_0x31ef67['params']['id']}})['then'](handleEntityNotFound(_0x533ed7,null))['then'](function(_0x3e34d9){if(_0x3e34d9){_0x31ef67['body']['SmsAccountId']=_0x3e34d9['id'];return db['CannedAnswer']['create'](_0x31ef67[_0xf63b('0x58')]);}})[_0xf63b('0x1e')](respondWithResult(_0x533ed7,null))[_0xf63b('0x28')](handleError(_0x533ed7,null));};exports[_0xf63b('0x65')]=function(_0x15e398,_0x7b6a21,_0x1042aa){var _0x989260={'raw':![],'where':{}};var _0x7b0aba={};var _0x176d99={'count':0x0,'rows':[]};return db[_0xf63b('0x3d')][_0xf63b('0x66')]({'where':{'id':_0x15e398[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x7b6a21,null))['then'](function(_0x29318e){if(_0x29318e){_0x7b0aba[_0xf63b('0x40')]=_[_0xf63b('0x42')](db[_0xf63b('0x67')]['rawAttributes']);_0x7b0aba['query']=_[_0xf63b('0x42')](_0x15e398[_0xf63b('0x41')]);_0x7b0aba['filters']=_[_0xf63b('0x44')](_0x7b0aba[_0xf63b('0x40')],_0x7b0aba[_0xf63b('0x41')]);_0x989260[_0xf63b('0x45')]=_[_0xf63b('0x44')](_0x7b0aba[_0xf63b('0x40')],qs[_0xf63b('0x46')](_0x15e398[_0xf63b('0x41')][_0xf63b('0x46')]));_0x989260[_0xf63b('0x45')]=_0x989260[_0xf63b('0x45')]['length']?_0x989260[_0xf63b('0x45')]:_0x7b0aba[_0xf63b('0x40')];if(!_0x15e398['query'][_0xf63b('0x48')](_0xf63b('0x49'))){_0x989260['limit']=qs[_0xf63b('0x2d')](_0x15e398[_0xf63b('0x41')]['limit']);_0x989260[_0xf63b('0x2f')]=qs[_0xf63b('0x2f')](_0x15e398['query'][_0xf63b('0x2f')]);}_0x989260[_0xf63b('0x4a')]=qs[_0xf63b('0x4b')](_0x15e398['query'][_0xf63b('0x4b')]);_0x989260[_0xf63b('0x4f')]=qs['filters'](_[_0xf63b('0x4c')](_0x15e398[_0xf63b('0x41')],_0x7b0aba[_0xf63b('0x43')]));_0x989260['where'][_0xf63b('0x63')]=_0x29318e['id'];if(_0x15e398[_0xf63b('0x41')]['filter']){_0x989260[_0xf63b('0x4f')]=_[_0xf63b('0x4e')](_0x989260['where'],{'$or':_[_0xf63b('0x3c')](_0x989260[_0xf63b('0x45')],function(_0x3e127a){var _0x422992={};_0x422992[_0x3e127a]={'$like':'%'+_0x15e398['query'][_0xf63b('0x4d')]+'%'};return _0x422992;})});}_0x989260=_[_0xf63b('0x4e')]({},_0x989260,_0x15e398['options']);return db[_0xf63b('0x67')][_0xf63b('0x2e')]({'where':_0x989260['where']})[_0xf63b('0x1e')](function(_0x40dfda){_0x176d99['count']=_0x40dfda;if(_0x15e398[_0xf63b('0x41')][_0xf63b('0x51')]){_0x989260['include']=[{'all':!![]}];}return db[_0xf63b('0x67')]['findAll'](_0x989260);})[_0xf63b('0x1e')](function(_0x3cdd4c){_0x176d99[_0xf63b('0x54')]=_0x3cdd4c;return _0x176d99;});}})['then'](respondWithFilteredResult(_0x7b6a21,_0x989260))[_0xf63b('0x28')](handleError(_0x7b6a21,null));};exports[_0xf63b('0x68')]=function(_0x235b1e,_0x335236,_0x213942){return db['SmsAccount'][_0xf63b('0x56')]({'where':{'id':_0x235b1e['params']['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x335236,null))['then'](function(_0x15f956){if(_0x15f956){return _0x15f956[_0xf63b('0x68')](_0x235b1e['query']['ids']);}})['then'](respondWithStatusCode(_0x335236,null))[_0xf63b('0x28')](handleError(_0x335236,null));};exports[_0xf63b('0x69')]=function(_0x22e8e1,_0x3af153,_0x4aebda){var _0x297b2c={'channel':_0xf63b('0x6a')};var _0x4e3362=[];var _0x445a9d=[];var _0x7f1b56={};return db[_0xf63b('0x3d')][_0xf63b('0x56')]({'where':{'id':_0x22e8e1[_0xf63b('0x5f')]['id']},'include':[{'model':db[_0xf63b('0x6b')],'as':_0xf63b('0x6c')}]})[_0xf63b('0x1e')](handleEntityNotFound(_0x3af153,null))[_0xf63b('0x1e')](function(_0x56c147){_0x297b2c['account']=_0x56c147;_0x297b2c[_0xf63b('0x6d')]=_[_0xf63b('0x6e')](_0x56c147[_0xf63b('0x6c')],[_0xf63b('0x6f')],['asc']);if(_0x297b2c[_0xf63b('0x70')][_0xf63b('0x6c')]){delete _0x297b2c['account'][_0xf63b('0x6c')];}return db[_0xf63b('0x71')]['describe']();})[_0xf63b('0x1e')](function(_0x173f98){if(!_0x173f98){throw new db[(_0xf63b('0x72'))][(_0xf63b('0x73'))]('no\x20available\x20attributes');}_0x4e3362=_[_0xf63b('0x74')](_[_0xf63b('0x42')](_0x173f98),[_0xf63b('0x75'),_0xf63b('0x76')]);_0x445a9d=_[_0xf63b('0x74')](_[_0xf63b('0x42')](_0x173f98),[_0xf63b('0x75'),_0xf63b('0x76'),_0xf63b('0x77'),_0xf63b('0x78')]);_0x297b2c[_0xf63b('0x58')]={'mapKey':_0xf63b('0x79')};if(_0x297b2c[_0xf63b('0x70')]['type']){switch(_0x297b2c[_0xf63b('0x70')][_0xf63b('0x3f')]){case _0xf63b('0x7a'):_0x297b2c['body'][_0xf63b('0x7b')]=_0x22e8e1['body'][_0xf63b('0x7c')];_0x297b2c['body']['body']=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x7d')];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7e')]=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x7f')];break;case _0xf63b('0x80'):_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')]='+'+_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x81')];_0x297b2c['body'][_0xf63b('0x58')]=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x82')];break;case _0xf63b('0x83'):_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')]=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x7b')];_0x297b2c[_0xf63b('0x58')]['body']=_0x22e8e1['body']['message'];break;case'clicksend':_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')]=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x7b')];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x58')]=_0x22e8e1[_0xf63b('0x58')]['body'];_0x297b2c[_0xf63b('0x58')]['messageId']=_0x22e8e1['body'][_0xf63b('0x84')];break;case'plivo':_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')]=_0x22e8e1[_0xf63b('0x58')]['From'];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x58')]=_0x22e8e1[_0xf63b('0x58')]['Text'];_0x297b2c[_0xf63b('0x58')]['messageId']=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x85')];break;case _0xf63b('0x86'):_0x297b2c['body'][_0xf63b('0x7b')]='+'+_0x22e8e1['body']['results'][0x0][_0xf63b('0x7b')];_0x297b2c['body'][_0xf63b('0x58')]=_0x22e8e1[_0xf63b('0x58')]['results'][0x0][_0xf63b('0x82')];_0x297b2c[_0xf63b('0x58')]['messageId']=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x87')][0x0][_0xf63b('0x7e')];break;case _0xf63b('0x88'):_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')]=_0x22e8e1['body'][_0xf63b('0x89')];_0x297b2c['body'][_0xf63b('0x58')]=_0x22e8e1[_0xf63b('0x58')]['segmentedMessage'][_0xf63b('0x26')];break;case _0xf63b('0x8a'):_0x297b2c[_0xf63b('0x58')]['from']=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x8b')];_0x297b2c['body'][_0xf63b('0x58')]=_0x22e8e1[_0xf63b('0x58')]['text'];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7e')]=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x8c')];break;case _0xf63b('0x8d'):_0x297b2c['body'][_0xf63b('0x7e')]=_0x22e8e1[_0xf63b('0x58')][0x0][_0xf63b('0x26')]['id'];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')]=_0x22e8e1[_0xf63b('0x58')][0x0][_0xf63b('0x26')][_0xf63b('0x7b')];_0x297b2c['body']['body']=_0x22e8e1[_0xf63b('0x58')][0x0][_0xf63b('0x26')][_0xf63b('0x82')];break;case'intelepeer':_0x297b2c['body']['from']=_0x22e8e1[_0xf63b('0x58')]['from'];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x58')]=_0x22e8e1['body'][_0xf63b('0x26')];_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7e')]=_0x22e8e1[_0xf63b('0x58')][_0xf63b('0x8e')];break;}}if(_0x297b2c[_0xf63b('0x58')]['id']){delete _0x297b2c[_0xf63b('0x58')]['id'];}if(_[_0xf63b('0x8f')](_0x297b2c['body'][_0xf63b('0x7b')])){throw new db[(_0xf63b('0x72'))]['ValidationError'](_0xf63b('0x90'));}if(_[_0xf63b('0x8f')](_0x297b2c[_0xf63b('0x58')]['body'])||_0x297b2c[_0xf63b('0x58')][_0xf63b('0x58')]===''){throw new db[(_0xf63b('0x72'))][(_0xf63b('0x73'))](_0xf63b('0x91'));}if(_[_0xf63b('0x8f')](_0x297b2c[_0xf63b('0x58')][_0xf63b('0x92')])){throw new db['Sequelize'][(_0xf63b('0x73'))](_0xf63b('0x93')+_0x445a9d);}if(!_[_0xf63b('0x94')](_0x445a9d,_0x297b2c[_0xf63b('0x58')][_0xf63b('0x92')])){throw new db[(_0xf63b('0x72'))][(_0xf63b('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x445a9d);}_0x7f1b56[_0x297b2c[_0xf63b('0x58')][_0xf63b('0x92')]]=_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')];return db[_0xf63b('0x95')][_0xf63b('0x56')]({'where':{'id':_0x297b2c[_0xf63b('0x70')][_0xf63b('0x78')]},'include':[{'model':db[_0xf63b('0x71')],'as':_0xf63b('0x96'),'where':_0x7f1b56,'limit':0x1,'order':[[_0xf63b('0x76'),_0xf63b('0x97')]]}]});})[_0xf63b('0x1e')](handleEntityNotFound(_0x3af153,null))[_0xf63b('0x1e')](function(_0x26bf2e){if(_0x26bf2e){_0x297b2c[_0xf63b('0x98')]=_[_0xf63b('0x99')](_0x26bf2e,['Contacts']);if(_0x26bf2e[_0xf63b('0x96')][_0xf63b('0x47')]){return _0x26bf2e[_0xf63b('0x96')][0x0];}var _0xe82204=_['defaults'](_0x297b2c[_0xf63b('0x58')],{'firstName':_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')],'ListId':_0x26bf2e['id']});_0xe82204[_0x297b2c['body'][_0xf63b('0x92')]]=_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')];return db['CmContact'][_0xf63b('0x57')](_0xe82204,{'fields':_0x4e3362,'raw':!![]});}})['then'](handleEntityNotFound(_0x3af153,null))['then'](function(_0x19183a){if(_0x19183a){_0x297b2c['contact']=_0x19183a;var _0x4a2478={'ContactId':_0x19183a['id'],'phone':_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7b')],'SmsAccountId':_0x22e8e1[_0xf63b('0x5f')]['id']};var _0x2d8983={'ContactId':_0x19183a['id'],'SmsAccountId':_0x22e8e1[_0xf63b('0x5f')]['id'],'closed':![]};return db['SmsInteraction'][_0xf63b('0x56')]({'where':_0x2d8983})['then'](function(_0x466e22){if(_0x466e22){return[_0x466e22,![]];}return db[_0xf63b('0x9a')][_0xf63b('0x57')](_0x4a2478)[_0xf63b('0x1e')](function(_0x5b64e8){return[_0x5b64e8,!![]];});});}})[_0xf63b('0x9b')](function(_0x7e0bd4,_0x11e468){_0x297b2c[_0xf63b('0x9c')]=_0x7e0bd4['get']({'plain':!![]});_0x297b2c[_0xf63b('0x9c')]['created']=![];if(_0x11e468){if(_0x297b2c[_0xf63b('0x70')]['autoclose']){_0x297b2c[_0xf63b('0x6d')]['push']({'id':0x0,'priority':_0x297b2c[_0xf63b('0x6d')][_0xf63b('0x47')]+0x1,'app':_0xf63b('0x9d'),'appdata':_0xf63b('0x9e'),'interval':_0xf63b('0x9f')});}_0x297b2c[_0xf63b('0x9c')][_0xf63b('0xa0')]=!![];}return db['SmsMessage']['create']({'phone':_0x297b2c['body'][_0xf63b('0x7b')],'messageId':_0x297b2c[_0xf63b('0x58')][_0xf63b('0x7e')],'body':_0x297b2c[_0xf63b('0x58')][_0xf63b('0x58')],'SmsAccountId':_0x22e8e1[_0xf63b('0x5f')]['id'],'SmsInteractionId':_0x7e0bd4['id'],'direction':'in','ContactId':_0x7e0bd4[_0xf63b('0xa1')],'AttachmentId':_0x297b2c['body'][_0xf63b('0xa2')]});})[_0xf63b('0x1e')](function(_0x2ba8d2){_0x297b2c[_0xf63b('0x26')]=_0x2ba8d2;if(!_0x297b2c[_0xf63b('0x9c')][_0xf63b('0xa3')])return;return db[_0xf63b('0xa4')]['find']({'attributes':['id',_0xf63b('0x37')],'where':{'id':_0x297b2c[_0xf63b('0x9c')][_0xf63b('0xa3')]}});})[_0xf63b('0x1e')](function(_0xf53924){if(_0xf53924){_0x297b2c[_0xf63b('0x6d')][_0xf63b('0xa5')]({'id':0x0,'priority':0x0,'app':_0xf63b('0xa6'),'appdata':_0xf53924[_0xf63b('0x37')]+','+(_0x297b2c[_0xf63b('0x70')][_0xf63b('0xa7')]||0xa),'interval':_0xf63b('0x9f')});}if(!_0x297b2c[_0xf63b('0x9c')][_0xf63b('0xa8')])return;return db[_0xf63b('0xa9')][_0xf63b('0x56')]({'attributes':['id',_0xf63b('0x37')],'where':{'id':_0x297b2c[_0xf63b('0x9c')]['queueId']}});})[_0xf63b('0x1e')](function(_0x3866ab){if(_0x3866ab){_0x297b2c['applications'][_0xf63b('0xa5')]({'id':0x0,'priority':0x1,'app':_0xf63b('0xaa'),'appdata':_0x3866ab[_0xf63b('0x37')]+','+(_0x297b2c['account'][_0xf63b('0xab')]||0x12c),'interval':_0xf63b('0x9f')});}return respondWithRpcPromise(_0xf63b('0xac'),_0xf63b('0xad'),_0x297b2c);})[_0xf63b('0x1e')](function(_0x593537){if(_0x593537){var _0x3e02cf=0xc8;var _0x3f97e9=_0xf63b('0xae');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3f97e9,_0x3e02cf,_0xf63b('0xaf'));logger[_0xf63b('0xb0')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3f97e9,_0x3e02cf,'entity\x20found',JSON[_0xf63b('0x22')](_0x593537));if(_0x297b2c[_0xf63b('0x70')][_0xf63b('0x3f')]==='twilio'){return _0x3af153['status'](_0x3e02cf)[_0xf63b('0x30')](_0xf63b('0xb1'),_0xf63b('0xb2'))[_0xf63b('0x38')](_0xf63b('0xb3'));}else{return _0x3af153[_0xf63b('0x2a')](_0x3e02cf)[_0xf63b('0x32')](_0x593537);}}})['catch'](handleError(_0x3af153,null));};exports[_0xf63b('0xb4')]=function(_0x2adc46,_0x758ed4){var _0x45f1fe=_0x2adc46[_0xf63b('0x5f')]['id'];var _0x5e875b=_0x2adc46['body'];var _0x4be195=0xc8;var _0x394eb5=null;return db['sequelize'][_0xf63b('0xb5')]({'isolationLevel':db[_0xf63b('0xb6')]['Transaction']['ISOLATION_LEVELS'][_0xf63b('0xb7')]},function(_0xb78b15){return db[_0xf63b('0x3d')]['findOne']({'where':{'id':_0x45f1fe},'transaction':_0xb78b15})[_0xf63b('0x1e')](function(_0x1ea2ad){if(_0x1ea2ad){return db['SmsApplication'][_0xf63b('0x34')]({'where':{'SmsAccountId':_0x45f1fe},'transaction':_0xb78b15})[_0xf63b('0x1e')](function(){var _0x6feae5=_[_0xf63b('0x3c')](_0x5e875b,function(_0x460b37){_0x460b37['SmsAccountId']=_0x45f1fe;return _0x460b37;});return db[_0xf63b('0x6b')][_0xf63b('0xb8')](_0x6feae5,{'transaction':_0xb78b15});});}else{_0x4be195=0x194;_0x394eb5=[];}});})[_0xf63b('0x1e')](function(){if(_0x4be195!==0x194){return db[_0xf63b('0x6b')][_0xf63b('0xb9')]({'where':{'SmsAccountId':_0x45f1fe},'order':_0xf63b('0x6f')})['then'](function(_0x617446){_0x394eb5=_0x617446;});}})[_0xf63b('0x28')](function(_0x99c67c){_0x4be195=0x1f4;logger[_0xf63b('0x23')](_0x99c67c[_0xf63b('0xba')]);if(_0x99c67c['name']){delete _0x99c67c[_0xf63b('0x37')];}_0x394eb5=_0x99c67c;})[_0xf63b('0xbb')](function(){if(_0x394eb5===null){_0x758ed4['sendStatus'](_0x4be195);}else{if(_0x4be195===0x1f4){_0x758ed4[_0xf63b('0x2a')](_0x4be195)[_0xf63b('0x38')](_0x394eb5);}else{_0x758ed4['status'](_0x4be195)[_0xf63b('0x32')](_0x394eb5);}}});};exports[_0xf63b('0xbc')]=function(_0x570139,_0x1cb337,_0x1007cf){var _0x196c63={};var _0x51fa81={};var _0x1204f5;var _0x4a654a;return db[_0xf63b('0x3d')][_0xf63b('0x66')]({'where':{'id':_0x570139[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x1cb337,null))[_0xf63b('0x1e')](function(_0x4dde45){if(_0x4dde45){_0x1204f5=_0x4dde45;_0x51fa81[_0xf63b('0x40')]=_['keys'](db['SmsApplication'][_0xf63b('0x3e')]);_0x51fa81[_0xf63b('0x41')]=_[_0xf63b('0x42')](_0x570139[_0xf63b('0x41')]);_0x51fa81[_0xf63b('0x43')]=_[_0xf63b('0x44')](_0x51fa81['model'],_0x51fa81[_0xf63b('0x41')]);_0x196c63[_0xf63b('0x45')]=_[_0xf63b('0x44')](_0x51fa81[_0xf63b('0x40')],qs[_0xf63b('0x46')](_0x570139[_0xf63b('0x41')]['fields']));_0x196c63['attributes']=_0x196c63['attributes'][_0xf63b('0x47')]?_0x196c63['attributes']:_0x51fa81[_0xf63b('0x40')];_0x196c63['order']=qs[_0xf63b('0x4b')](_0x570139[_0xf63b('0x41')][_0xf63b('0x4b')]);_0x196c63[_0xf63b('0x4f')]=qs[_0xf63b('0x43')](_[_0xf63b('0x4c')](_0x570139[_0xf63b('0x41')],_0x51fa81[_0xf63b('0x43')]));if(_0x570139[_0xf63b('0x41')][_0xf63b('0x4d')]){_0x196c63[_0xf63b('0x4f')]=_[_0xf63b('0x4e')](_0x196c63[_0xf63b('0x4f')],{'$or':_[_0xf63b('0x3c')](_0x196c63[_0xf63b('0x45')],function(_0x4ce9d9){var _0x47988e={};_0x47988e[_0x4ce9d9]={'$like':'%'+_0x570139[_0xf63b('0x41')][_0xf63b('0x4d')]+'%'};return _0x47988e;})});}_0x196c63=_[_0xf63b('0x4e')]({},_0x196c63,_0x570139[_0xf63b('0x50')]);return _0x1204f5[_0xf63b('0xbc')](_0x196c63);}})[_0xf63b('0x1e')](function(_0x459947){if(_0x459947){_0x4a654a=_0x459947[_0xf63b('0x47')];if(!_0x570139[_0xf63b('0x41')][_0xf63b('0x48')](_0xf63b('0x49'))){_0x196c63['limit']=qs[_0xf63b('0x2d')](_0x570139[_0xf63b('0x41')][_0xf63b('0x2d')]);_0x196c63[_0xf63b('0x2f')]=qs[_0xf63b('0x2f')](_0x570139[_0xf63b('0x41')][_0xf63b('0x2f')]);}return _0x1204f5[_0xf63b('0xbc')](_0x196c63);}})['then'](function(_0x3a8b76){if(_0x3a8b76){return _0x3a8b76?{'count':_0x4a654a,'rows':_0x3a8b76}:null;}})[_0xf63b('0x1e')](respondWithResult(_0x1cb337,null))['catch'](handleError(_0x1cb337,null));};exports['getInteractions']=function(_0x6243e1,_0xefabf6,_0xffb4f0){var _0x3f8b3d={'raw':![],'where':{}};var _0x5947da={};var _0x1fb440={'count':0x0,'rows':[]};return db[_0xf63b('0x3d')]['findOne']({'where':{'id':_0x6243e1[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0xefabf6,null))['then'](function(_0x3ce6f8){if(_0x3ce6f8){_0x5947da[_0xf63b('0x40')]=_[_0xf63b('0x42')](db[_0xf63b('0x9a')]['rawAttributes']);_0x5947da[_0xf63b('0x41')]=_[_0xf63b('0x42')](_0x6243e1[_0xf63b('0x41')]);_0x5947da['filters']=_[_0xf63b('0x44')](_0x5947da[_0xf63b('0x40')],_0x5947da[_0xf63b('0x41')]);_0x3f8b3d[_0xf63b('0x45')]=_[_0xf63b('0x44')](_0x5947da[_0xf63b('0x40')],qs[_0xf63b('0x46')](_0x6243e1[_0xf63b('0x41')][_0xf63b('0x46')]));_0x3f8b3d[_0xf63b('0x45')]=_0x3f8b3d[_0xf63b('0x45')][_0xf63b('0x47')]?_0x3f8b3d['attributes']:_0x5947da[_0xf63b('0x40')];if(!_0x6243e1[_0xf63b('0x41')][_0xf63b('0x48')](_0xf63b('0x49'))){_0x3f8b3d[_0xf63b('0x2d')]=qs[_0xf63b('0x2d')](_0x6243e1['query'][_0xf63b('0x2d')]);_0x3f8b3d[_0xf63b('0x2f')]=qs['offset'](_0x6243e1[_0xf63b('0x41')][_0xf63b('0x2f')]);}_0x3f8b3d[_0xf63b('0x4a')]=qs[_0xf63b('0x4b')](_0x6243e1[_0xf63b('0x41')]['sort']);_0x3f8b3d[_0xf63b('0x4f')]=qs[_0xf63b('0x43')](_[_0xf63b('0x4c')](_0x6243e1[_0xf63b('0x41')],_0x5947da[_0xf63b('0x43')]));_0x3f8b3d[_0xf63b('0x4f')]['SmsAccountId']=_0x3ce6f8['id'];if(_0x6243e1[_0xf63b('0x41')][_0xf63b('0x4d')]){_0x3f8b3d[_0xf63b('0x4f')]=_[_0xf63b('0x4e')](_0x3f8b3d[_0xf63b('0x4f')],{'$or':_[_0xf63b('0x3c')](_0x3f8b3d[_0xf63b('0x45')],function(_0x53daae){var _0x2027d3={};_0x2027d3[_0x53daae]={'$like':'%'+_0x6243e1['query'][_0xf63b('0x4d')]+'%'};return _0x2027d3;})});}_0x3f8b3d=_[_0xf63b('0x4e')]({},_0x3f8b3d,_0x6243e1[_0xf63b('0x50')]);return db['SmsInteraction']['count']({'where':_0x3f8b3d[_0xf63b('0x4f')]})[_0xf63b('0x1e')](function(_0xd8041a){_0x1fb440[_0xf63b('0x2e')]=_0xd8041a;if(_0x6243e1[_0xf63b('0x41')]['includeAll']){_0x3f8b3d['include']=[{'model':db[_0xf63b('0x71')],'as':_0xf63b('0xbd'),'required':![]},{'model':db[_0xf63b('0xa4')],'as':'Owner','attributes':[_0xf63b('0x37'),'fullname',_0xf63b('0xbe')],'required':![]},{'model':db[_0xf63b('0xbf')],'as':_0xf63b('0xc0'),'attributes':['id',_0xf63b('0x37'),'color'],'where':_0x6243e1[_0xf63b('0x41')]['tag']?{'id':_0x6243e1['query'][_0xf63b('0xc1')]}:undefined,'required':_0x6243e1['query'][_0xf63b('0xc1')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x3f8b3d);})['then'](function(_0x94e81f){_0x1fb440[_0xf63b('0x54')]=_0x94e81f;return _0x1fb440;});}})['then'](respondWithFilteredResult(_0xefabf6,_0x3f8b3d))[_0xf63b('0x28')](handleError(_0xefabf6,null));};exports[_0xf63b('0x38')]=function(_0x59afde,_0x4e6dec,_0x52c018){var _0x46d27a,_0x521b1d,_0x3c4f33;if(_[_0xf63b('0x8f')](_0x59afde[_0xf63b('0x58')][_0xf63b('0x58')])||_0x59afde[_0xf63b('0x58')][_0xf63b('0x58')]===''){throw new db['Sequelize'][(_0xf63b('0x73'))](_0xf63b('0x91'));}if(_['isNil'](_0x59afde[_0xf63b('0x58')]['to'])){throw new db[(_0xf63b('0x72'))][(_0xf63b('0x73'))](_0xf63b('0xc2'));}_0x46d27a=_0x59afde[_0xf63b('0x58')]['to'];return db[_0xf63b('0x3d')][_0xf63b('0x56')]({'where':{'id':_0x59afde['params']['id']},'include':[{'model':db[_0xf63b('0x95')],'as':_0xf63b('0xc3'),'include':[{'model':db[_0xf63b('0x71')],'as':_0xf63b('0x96'),'where':{'mobile':_0x46d27a},'limit':0x1,'order':[[_0xf63b('0x76'),_0xf63b('0x97')]]}]}]})[_0xf63b('0x1e')](handleEntityNotFound(_0x4e6dec,null))[_0xf63b('0x1e')](function(_0x1a2153){if(_0x1a2153&&_0x1a2153['List']){_0x521b1d=_0x1a2153[_0xf63b('0x35')]({'plain':!![]});if(_0x521b1d['List']&&_0x521b1d['List'][_0xf63b('0x96')]['length']){return _0x521b1d[_0xf63b('0xc3')]['Contacts'][0x0];}return db['CmContact'][_0xf63b('0x57')](_[_0xf63b('0x16')](_0x59afde[_0xf63b('0x58')],{'firstName':_0x46d27a,'mobile':_0x46d27a,'phone':_0x46d27a,'ListId':_0x521b1d[_0xf63b('0x78')]}));}})[_0xf63b('0x1e')](handleEntityNotFound(_0x4e6dec,null))[_0xf63b('0x1e')](function(_0x17f04b){if(_0x17f04b){_0x3c4f33=_0x17f04b;return db[_0xf63b('0x9a')][_0xf63b('0x56')]({'where':{'ContactId':_0x3c4f33['id'],'closed':![],'SmsAccountId':_0x521b1d['id']}})[_0xf63b('0x1e')](function(_0x1afbb2){if(_0x1afbb2){return[_0x1afbb2,![]];}return db[_0xf63b('0x9a')][_0xf63b('0x57')]({'UserId':_0x59afde[_0xf63b('0x59')]['id'],'ContactId':_0x3c4f33['id'],'SmsAccountId':_0x521b1d['id'],'phone':_0x46d27a,'firstMsgDirection':'out','Messages':[_[_0xf63b('0x4e')](_0x59afde[_0xf63b('0x58')],{'read':![],'body':_0x59afde['body'][_0xf63b('0x58')],'phone':_0x46d27a,'SmsAccountId':_0x521b1d['id'],'UserId':_0x59afde[_0xf63b('0x59')]['id'],'ContactId':_0x3c4f33['id']})]},{'include':[{'model':db[_0xf63b('0xc4')],'as':_0xf63b('0xc5')}]})[_0xf63b('0x1e')](function(_0x44ec13){return[_0x44ec13,!![]];});});}})['spread'](function(_0x3efd11,_0x212d49){if(_0x212d49){return _0x3efd11;}return db['SmsMessage']['create'](_[_0xf63b('0x4e')](_0x59afde[_0xf63b('0x58')],{'read':![],'body':_0x59afde[_0xf63b('0x58')][_0xf63b('0x58')],'phone':_0x46d27a,'SmsAccountId':_0x521b1d['id'],'SmsInteractionId':_0x3efd11['id'],'UserId':_0x59afde[_0xf63b('0x59')]['id'],'ContactId':_0x3c4f33['id']}))[_0xf63b('0x1e')](function(_0x420386){_0x3efd11[_0xf63b('0xc6')][_0xf63b('0xc5')]=[];_0x3efd11[_0xf63b('0xc6')][_0xf63b('0xc5')]['push'](_0x420386[_0xf63b('0xc6')]);return _0x3efd11;});})[_0xf63b('0x1e')](respondWithResult(_0x4e6dec,null))['catch'](handleError(_0x4e6dec,null));};exports['status']=function(_0x9c9976,_0x5e14c8,_0x83402a){if(_0x9c9976[_0xf63b('0x58')]['id']){delete _0x9c9976[_0xf63b('0x58')]['id'];}var _0x2fb46a,_0xc64c90,_0xdeec1d;return db[_0xf63b('0x3d')][_0xf63b('0x56')]({'where':{'id':_0x9c9976[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x5e14c8,null))[_0xf63b('0x1e')](function(_0x254d8c){if(_0x254d8c){_0xdeec1d=_0x254d8c;logger[_0xf63b('0xb0')](_0xf63b('0x21'),_0xf63b('0x2a'),_0xf63b('0xc7'),_0x254d8c[_0xf63b('0x3f')],util['inspect'](_0x9c9976[_0xf63b('0x58')],{'showHidden':![],'depth':null}));switch(_0x254d8c[_0xf63b('0x3f')]){case _0xf63b('0x80'):if(_0x9c9976[_0xf63b('0x58')]['skebby_dispatch_id']&&_0x9c9976['body'][_0xf63b('0x2a')]){_0xc64c90=_0x9c9976['body'][_0xf63b('0x2a')];return db[_0xf63b('0xc4')][_0xf63b('0x56')]({'where':{'messageId':_0x9c9976[_0xf63b('0x58')]['skebby_dispatch_id']}});}break;case _0xf63b('0x83'):if(_0x9c9976['body'][_0xf63b('0xc8')]&&_0x9c9976[_0xf63b('0x58')][_0xf63b('0xc9')]){_0xc64c90=_0x9c9976[_0xf63b('0x58')][_0xf63b('0xc9')];return db[_0xf63b('0xc4')][_0xf63b('0x56')]({'where':{'messageId':_0x9c9976[_0xf63b('0x58')][_0xf63b('0xc8')]}});}break;case _0xf63b('0xca'):if(_0x9c9976[_0xf63b('0x58')]['message_id']&&_0x9c9976['body']['status_code']){_0xc64c90=_0x9c9976['body'][_0xf63b('0xcb')];return db[_0xf63b('0xc4')][_0xf63b('0x56')]({'where':{'messageId':_0x9c9976[_0xf63b('0x58')][_0xf63b('0x84')]}});}break;case _0xf63b('0x86'):var _0x29803c=_0x9c9976[_0xf63b('0x58')]['results'][0x0];if(_0x29803c['messageId']&&_0x29803c[_0xf63b('0x2a')][_0xf63b('0xcc')]===_0xf63b('0xcd')){_0xc64c90=_0x29803c[_0xf63b('0x2a')][_0xf63b('0xcc')];return db[_0xf63b('0xc4')]['find']({'where':{'messageId':_0x29803c[_0xf63b('0x7e')]}});}break;case _0xf63b('0x8a'):if(_0x9c9976[_0xf63b('0x58')][_0xf63b('0x7e')]&&_0x9c9976[_0xf63b('0x58')]['status']){_0xc64c90=_0x9c9976['body'][_0xf63b('0x2a')];return db[_0xf63b('0xc4')][_0xf63b('0x56')]({'where':{'messageId':_0x9c9976[_0xf63b('0x58')][_0xf63b('0x7e')]}});}break;case _0xf63b('0x8d'):if(_0x9c9976['body'][0x0][_0xf63b('0x26')]['id']){_0xc64c90=_0x9c9976[_0xf63b('0x58')][0x0][_0xf63b('0x3f')];return db[_0xf63b('0xc4')][_0xf63b('0x56')]({'where':{'messageId':_0x9c9976[_0xf63b('0x58')][0x0][_0xf63b('0x26')]['id']}});}break;case _0xf63b('0xce'):if(_0x9c9976['body'][_0xf63b('0xcf')]&&_0x9c9976[_0xf63b('0x58')][_0xf63b('0x2a')]){_0xc64c90=_0x9c9976[_0xf63b('0x58')][_0xf63b('0x2a')];return db[_0xf63b('0xc4')][_0xf63b('0x56')]({'where':{'messageId':_0x9c9976[_0xf63b('0x58')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x5e14c8,null))[_0xf63b('0x1e')](function(_0x3a0343){if(_0x3a0343){_0x2fb46a=_0x3a0343;switch(_0xdeec1d['type']){case'skebby':if(_0xc64c90===_0xf63b('0xcd')){return _0x2fb46a[_0xf63b('0xd0')]({'read':!![]});}else{logger[_0xf63b('0x23')](_0xf63b('0x21'),_0xf63b('0x2a'),_0xf63b('0x80'),util[_0xf63b('0xd1')](_0x9c9976[_0xf63b('0x58')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0xc64c90==='1'){return _0x2fb46a['update']({'read':!![]});}else{logger[_0xf63b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf63b('0x80'),util['inspect'](_0x9c9976['body'],{'showHidden':![],'depth':null}));}break;case _0xf63b('0xca'):if(!_0x9c9976[_0xf63b('0x58')]['error_code']&&_0xc64c90>=0xc8&&_0xc64c90<=0xce){return _0x2fb46a['update']({'read':!![]});}else{logger[_0xf63b('0x23')](_0xf63b('0x21'),_0xf63b('0x2a'),'clicksend',util[_0xf63b('0xd1')](_0x9c9976[_0xf63b('0x58')],{'showHidden':![],'depth':null}));}break;case _0xf63b('0x86'):var _0x5ebe70=_0x9c9976[_0xf63b('0x58')]['results'][0x0];if(_0x5ebe70['status'][_0xf63b('0xcc')]===_0xf63b('0xcd')){return _0x2fb46a['update']({'read':!![]});}else{logger[_0xf63b('0x23')](_0xf63b('0x21'),_0xf63b('0x2a'),_0xf63b('0x86'),util[_0xf63b('0xd1')](_0x9c9976[_0xf63b('0x58')],{'showHidden':![],'depth':null}));}break;case _0xf63b('0x8a'):if(_0xc64c90==_0xf63b('0xd2')||_0xc64c90==_0xf63b('0xd3')){return _0x2fb46a[_0xf63b('0xd0')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf63b('0x2a'),_0xf63b('0x8a'),util[_0xf63b('0xd1')](_0x9c9976['body'],{'showHidden':![],'depth':null}));}break;case _0xf63b('0x8d'):if(_0xc64c90==_0xf63b('0xd4')){return _0x2fb46a[_0xf63b('0xd0')]({'read':!![]});}else{logger[_0xf63b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf63b('0x2a'),_0xf63b('0x8d'),util['inspect'](_0x9c9976['body'],{'showHidden':![],'depth':null}));}break;case _0xf63b('0xce'):if(_0xc64c90===_0xf63b('0xd5')||_0xc64c90==='ACCEPTD'){return _0x2fb46a[_0xf63b('0xd0')]({'read':!![]});}else{logger[_0xf63b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf63b('0x2a'),_0xf63b('0xce'),util[_0xf63b('0xd1')](_0x9c9976['body'],{'showHidden':![],'depth':null}));}break;}return _0x2fb46a;}})['then'](respondWithResult(_0x5e14c8,null))['catch'](handleError(_0x5e14c8,null));};exports[_0xf63b('0xd6')]=function(_0x4ac7a8,_0x4aa1ba,_0x324aff){var _0x3c1535,_0x147b03,_0x486453;return db[_0xf63b('0x3d')]['find']({'where':{'id':_0x4ac7a8[_0xf63b('0x5f')]['id']}})[_0xf63b('0x1e')](handleEntityNotFound(_0x4aa1ba,null))[_0xf63b('0x1e')](function(_0x119b19){if(_0x119b19){_0x486453=_0x119b19;logger[_0xf63b('0xb0')](_0xf63b('0x21'),'status',_0xf63b('0xc7'),_0x119b19[_0xf63b('0x3f')],util[_0xf63b('0xd1')](_0x4ac7a8[_0xf63b('0x41')],{'showHidden':![],'depth':null}));switch(_0x119b19[_0xf63b('0x3f')]){case _0xf63b('0x88'):if(_0x4ac7a8[_0xf63b('0x41')][_0xf63b('0xd7')]&&_0x4ac7a8[_0xf63b('0x41')][_0xf63b('0xd8')]){_0x147b03=_0x4ac7a8[_0xf63b('0x41')]['state'];return db[_0xf63b('0xc4')]['find']({'where':{'messageId':_0x4ac7a8[_0xf63b('0x41')][_0xf63b('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x4aa1ba,null))[_0xf63b('0x1e')](function(_0x30d9a2){if(_0x30d9a2){_0x3c1535=_0x30d9a2;switch(_0x486453[_0xf63b('0x3f')]){case'csc':if(_0x147b03==='2'||_0x147b03==='6'){return _0x3c1535[_0xf63b('0xd0')]({'read':!![]});}else{logger['error'](_0xf63b('0x21'),_0xf63b('0x2a'),_0xf63b('0x88'),util[_0xf63b('0xd1')](_0x4ac7a8[_0xf63b('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x3c1535;}})[_0xf63b('0x1e')](respondWithResult(_0x4aa1ba,null))['catch'](handleError(_0x4aa1ba,null));};exports[_0xf63b('0xd9')]=function(_0x435866,_0x5c18c4,_0x460f13){return db[_0xf63b('0x3d')][_0xf63b('0x56')]({'where':{'id':_0x435866[_0xf63b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5c18c4,null))['then'](function(_0x580fab){if(_0x580fab){return _0x580fab[_0xf63b('0xd9')](_0x435866[_0xf63b('0x58')][_0xf63b('0xda')],_[_0xf63b('0x99')](_0x435866[_0xf63b('0x58')],[_0xf63b('0xda'),'id'])||{})[_0xf63b('0x9b')](function(_0x2b0305){for(var _0x5872a3=0x0;_0x5872a3<_0x435866[_0xf63b('0x58')]['ids'][_0xf63b('0x47')];_0x5872a3+=0x1){socket[_0xf63b('0xdb')](_0xf63b('0xdc'),{'UserId':Number(_0x435866['body']['ids'][_0x5872a3]),'SmsAccountId':Number(_0x435866[_0xf63b('0x5f')]['id'])});}return _0x2b0305;});}})[_0xf63b('0x1e')](respondWithResult(_0x5c18c4,null))[_0xf63b('0x28')](handleError(_0x5c18c4,null));};exports[_0xf63b('0xdd')]=function(_0x52a759,_0x47905d,_0x555a1f){return db['SmsAccount'][_0xf63b('0x56')]({'where':{'id':_0x52a759[_0xf63b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x47905d,null))['then'](function(_0x59e1ea){if(_0x59e1ea){return _0x59e1ea[_0xf63b('0xdd')](_0x52a759['query'][_0xf63b('0xda')])[_0xf63b('0x1e')](function(){if(_['isArray'](_0x52a759['query'][_0xf63b('0xda')])){for(var _0x19b04f=0x0;_0x19b04f<_0x52a759[_0xf63b('0x41')][_0xf63b('0xda')][_0xf63b('0x47')];_0x19b04f+=0x1){socket[_0xf63b('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x52a759[_0xf63b('0x41')][_0xf63b('0xda')][_0x19b04f]),'SmsAccountId':Number(_0x52a759[_0xf63b('0x5f')]['id'])});}}else{socket[_0xf63b('0xdb')](_0xf63b('0xde'),{'UserId':Number(_0x52a759[_0xf63b('0x41')]['ids']),'SmsAccountId':Number(_0x52a759[_0xf63b('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x47905d,null))[_0xf63b('0x28')](handleError(_0x47905d,null));};exports['getAgents']=function(_0x322485,_0x572dd9,_0x4ae2a9){var _0x518084={};var _0x4ec29d={};var _0x2488a5;var _0x28aa0a;return db[_0xf63b('0x3d')][_0xf63b('0x66')]({'where':{'id':_0x322485[_0xf63b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x572dd9,null))[_0xf63b('0x1e')](function(_0x131d94){if(_0x131d94){_0x2488a5=_0x131d94;_0x4ec29d[_0xf63b('0x40')]=_['keys'](db[_0xf63b('0xa4')][_0xf63b('0x3e')]);_0x4ec29d[_0xf63b('0x41')]=_[_0xf63b('0x42')](_0x322485[_0xf63b('0x41')]);_0x4ec29d[_0xf63b('0x43')]=_[_0xf63b('0x44')](_0x4ec29d[_0xf63b('0x40')],_0x4ec29d[_0xf63b('0x41')]);_0x518084[_0xf63b('0x45')]=_[_0xf63b('0x44')](_0x4ec29d[_0xf63b('0x40')],qs['fields'](_0x322485[_0xf63b('0x41')][_0xf63b('0x46')]));_0x518084['attributes']=_0x518084[_0xf63b('0x45')][_0xf63b('0x47')]?_0x518084[_0xf63b('0x45')]:_0x4ec29d[_0xf63b('0x40')];_0x518084['order']=qs[_0xf63b('0x4b')](_0x322485[_0xf63b('0x41')][_0xf63b('0x4b')]);_0x518084[_0xf63b('0x4f')]=qs[_0xf63b('0x43')](_[_0xf63b('0x4c')](_0x322485['query'],_0x4ec29d[_0xf63b('0x43')]));if(_0x322485[_0xf63b('0x41')][_0xf63b('0x4d')]){_0x518084[_0xf63b('0x4f')]=_['merge'](_0x518084['where'],{'$or':_[_0xf63b('0x3c')](_0x518084[_0xf63b('0x45')],function(_0x3d6fb8){var _0x224ace={};_0x224ace[_0x3d6fb8]={'$like':'%'+_0x322485['query'][_0xf63b('0x4d')]+'%'};return _0x224ace;})});}_0x518084=_['merge']({},_0x518084,_0x322485[_0xf63b('0x50')]);return _0x2488a5['getAgents'](_0x518084);}})[_0xf63b('0x1e')](function(_0x3febd1){if(_0x3febd1){_0x28aa0a=_0x3febd1[_0xf63b('0x47')];if(!_0x322485['query'][_0xf63b('0x48')](_0xf63b('0x49'))){_0x518084[_0xf63b('0x2d')]=qs['limit'](_0x322485[_0xf63b('0x41')][_0xf63b('0x2d')]);_0x518084[_0xf63b('0x2f')]=qs['offset'](_0x322485[_0xf63b('0x41')][_0xf63b('0x2f')]);}return _0x2488a5[_0xf63b('0xdf')](_0x518084);}})[_0xf63b('0x1e')](function(_0x48ca98){if(_0x48ca98){return _0x48ca98?{'count':_0x28aa0a,'rows':_0x48ca98}:null;}})['then'](respondWithResult(_0x572dd9,null))['catch'](handleError(_0x572dd9,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf57=['events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty','exports'];(function(_0x1e211f,_0x385af7){var _0x52304e=function(_0x4a0259){while(--_0x4a0259){_0x1e211f['push'](_0x1e211f['shift']());}};_0x52304e(++_0x385af7);}(_0xaf57,0x168));var _0x7af5=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xaf57[_0xbd08b4];return _0x314f1e;};'use strict';var EventEmitter=require(_0x7af5('0x0'));var SmsAccount=require(_0x7af5('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7af5('0x2')](0x0);var events={'afterCreate':_0x7af5('0x3'),'afterUpdate':_0x7af5('0x4'),'afterDestroy':_0x7af5('0x5')};function emitEvent(_0x4f8cb6){return function(_0x13582c,_0x30316e,_0x3abfda){SmsAccountEvents['emit'](_0x4f8cb6+':'+_0x13582c['id'],_0x13582c);SmsAccountEvents['emit'](_0x4f8cb6,_0x13582c);_0x3abfda(null);};}for(var e in events){if(events[_0x7af5('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7af5('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0x101f=['update','emit','hasOwnProperty','events','../../mysqldb','save'];(function(_0x48afae,_0x4a9d80){var _0x307ddf=function(_0x554dae){while(--_0x554dae){_0x48afae['push'](_0x48afae['shift']());}};_0x307ddf(++_0x4a9d80);}(_0x101f,0x81));var _0xf101=function(_0x305be7,_0x527c99){_0x305be7=_0x305be7-0x0;var _0x122e11=_0x101f[_0x305be7];return _0x122e11;};'use strict';var EventEmitter=require(_0xf101('0x0'));var SmsAccount=require(_0xf101('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf101('0x2'),'afterUpdate':_0xf101('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55fe3b){return function(_0x56fe20,_0x350989,_0x55f5c0){SmsAccountEvents[_0xf101('0x4')](_0x55fe3b+':'+_0x56fe20['id'],_0x56fe20);SmsAccountEvents[_0xf101('0x4')](_0x55fe3b,_0x56fe20);_0x55f5c0(null);};}for(var e in events){if(events[_0xf101('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2a2=['./smsAccount.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xc2a2,0x84));var _0x2c2a=function(_0x34feac,_0x1a0af7){_0x34feac=_0x34feac-0x0;var _0x396baa=_0xc2a2[_0x34feac];return _0x396baa;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var logger=require(_0x2c2a('0x2'))(_0x2c2a('0x3'));var moment=require('moment');var BPromise=require(_0x2c2a('0x4'));var rp=require(_0x2c2a('0x5'));var fs=require('fs');var path=require(_0x2c2a('0x6'));var rimraf=require('rimraf');var config=require(_0x2c2a('0x7'));var attributes=require(_0x2c2a('0x8'));module[_0x2c2a('0x9')]=function(_0x17db27,_0x51c919){return _0x17db27['define']('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9364=['define','SmsAccount','sms_accounts','lodash','api','moment','bluebird','request-promise','rimraf','./smsAccount.attributes','exports'];(function(_0x1b6779,_0x7834e3){var _0x15b379=function(_0x45e4fa){while(--_0x45e4fa){_0x1b6779['push'](_0x1b6779['shift']());}};_0x15b379(++_0x7834e3);}(_0x9364,0x87));var _0x4936=function(_0x149489,_0x290db0){_0x149489=_0x149489-0x0;var _0x17f254=_0x9364[_0x149489];return _0x17f254;};'use strict';var _=require(_0x4936('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4936('0x1'));var moment=require(_0x4936('0x2'));var BPromise=require(_0x4936('0x3'));var rp=require(_0x4936('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4936('0x5'));var config=require('../../config/environment');var attributes=require(_0x4936('0x6'));module[_0x4936('0x7')]=function(_0x51ec98,_0x44afe8){return _0x51ec98[_0x4936('0x8')](_0x4936('0x9'),attributes,{'tableName':_0x4936('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6070=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x6070,0xb9));var _0x0607=function(_0x48a2ec,_0x5e8d2c){_0x48a2ec=_0x48a2ec-0x0;var _0x128697=_0x6070[_0x48a2ec];return _0x128697;};'use strict';var _=require(_0x0607('0x0'));var util=require(_0x0607('0x1'));var moment=require(_0x0607('0x2'));var BPromise=require(_0x0607('0x3'));var rs=require(_0x0607('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0607('0x5'))['db'];var utils=require(_0x0607('0x6'));var logger=require(_0x0607('0x7'))(_0x0607('0x8'));var config=require('../../config/environment');var jayson=require(_0x0607('0x9'));var client=jayson[_0x0607('0xa')][_0x0607('0xb')]({'port':0x232a});config[_0x0607('0xc')]=_[_0x0607('0xd')](config[_0x0607('0xc')],{'host':_0x0607('0xe'),'port':0x18eb});var socket=require(_0x0607('0xf'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x0607('0x10')](socket);function respondWithRpcPromise(_0x10a1f7,_0x1cc662,_0x3dd594){return new BPromise(function(_0x28bd41,_0x10b831){return client[_0x0607('0x11')](_0x10a1f7,_0x3dd594)[_0x0607('0x12')](function(_0x2cbf44){logger[_0x0607('0x13')](_0x0607('0x14'),_0x1cc662,_0x0607('0x15'));logger[_0x0607('0x16')](_0x0607('0x17'),_0x1cc662,_0x0607('0x15'),JSON['stringify'](_0x2cbf44));if(_0x2cbf44[_0x0607('0x18')]){if(_0x2cbf44[_0x0607('0x18')][_0x0607('0x19')]===0x1f4){logger[_0x0607('0x18')](_0x0607('0x14'),_0x1cc662,_0x2cbf44['error'][_0x0607('0x1a')]);return _0x10b831(_0x2cbf44[_0x0607('0x18')][_0x0607('0x1a')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1cc662,_0x2cbf44[_0x0607('0x18')][_0x0607('0x1a')]);return _0x28bd41(_0x2cbf44[_0x0607('0x18')][_0x0607('0x1a')]);}else{logger[_0x0607('0x13')]('SmsAccount,\x20%s,\x20%s',_0x1cc662,_0x0607('0x15'));_0x28bd41(_0x2cbf44['result'][_0x0607('0x1a')]);}})[_0x0607('0x1b')](function(_0x410da6){logger['error']('SmsAccount,\x20%s,\x20%s',_0x1cc662,_0x410da6);_0x10b831(_0x410da6);});});}exports[_0x0607('0x1c')]=function(_0x26b596){var _0x42b6fd=this;return new Promise(function(_0x2d6953,_0x28dc58){return db[_0x0607('0x1d')]['find']({'raw':_0x26b596[_0x0607('0x1e')]?_0x26b596['options'][_0x0607('0x1f')]===undefined?!![]:![]:!![],'where':_0x26b596[_0x0607('0x1e')]?_0x26b596[_0x0607('0x1e')][_0x0607('0x20')]||null:null,'attributes':_0x26b596[_0x0607('0x1e')]?_0x26b596[_0x0607('0x1e')][_0x0607('0x21')]||null:null,'include':_0x26b596[_0x0607('0x1e')]?_0x26b596[_0x0607('0x1e')][_0x0607('0x22')]?_[_0x0607('0x23')](_0x26b596[_0x0607('0x1e')][_0x0607('0x22')],function(_0x356c25){return{'model':db[_0x356c25[_0x0607('0x24')]],'as':_0x356c25['as'],'attributes':_0x356c25[_0x0607('0x21')],'include':_0x356c25[_0x0607('0x22')]?_[_0x0607('0x23')](_0x356c25[_0x0607('0x22')],function(_0x39bcce){return{'model':db[_0x39bcce[_0x0607('0x24')]],'as':_0x39bcce['as'],'attributes':_0x39bcce[_0x0607('0x21')],'include':_0x39bcce[_0x0607('0x22')]?_['map'](_0x39bcce[_0x0607('0x22')],function(_0x3529a4){return{'model':db[_0x3529a4['model']],'as':_0x3529a4['as'],'attributes':_0x3529a4[_0x0607('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1027da){logger[_0x0607('0x13')](_0x0607('0x1c'),_0x26b596);logger['debug'](_0x0607('0x1c'),_0x26b596,JSON[_0x0607('0x25')](_0x1027da));_0x2d6953(_0x1027da);})[_0x0607('0x1b')](function(_0x127b3c){logger[_0x0607('0x18')](_0x0607('0x1c'),_0x127b3c[_0x0607('0x1a')],_0x26b596);_0x28dc58(_0x42b6fd[_0x0607('0x18')](0x1f4,_0x127b3c[_0x0607('0x1a')]));});});};
\ No newline at end of file
+var _0x9d13=['catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9d13,0xba));var _0x39d1=function(_0x1de71c,_0xdcbb11){_0x1de71c=_0x1de71c-0x0;var _0xd8e991=_0x9d13[_0x1de71c];return _0xd8e991;};'use strict';var _=require(_0x39d1('0x0'));var util=require('util');var moment=require(_0x39d1('0x1'));var BPromise=require(_0x39d1('0x2'));var rs=require(_0x39d1('0x3'));var fs=require('fs');var Redis=require(_0x39d1('0x4'));var db=require(_0x39d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x39d1('0x6'))('rpc');var config=require(_0x39d1('0x7'));var jayson=require(_0x39d1('0x8'));var client=jayson[_0x39d1('0x9')]['http']({'port':0x232a});config[_0x39d1('0xa')]=_[_0x39d1('0xb')](config[_0x39d1('0xa')],{'host':_0x39d1('0xc'),'port':0x18eb});var socket=require(_0x39d1('0xd'))(new Redis(config[_0x39d1('0xa')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x170633,_0x156b44,_0x1535fa){return new BPromise(function(_0x22b574,_0x2ff6ad){return client[_0x39d1('0xe')](_0x170633,_0x1535fa)[_0x39d1('0xf')](function(_0x20ed29){logger['info'](_0x39d1('0x10'),_0x156b44,_0x39d1('0x11'));logger[_0x39d1('0x12')](_0x39d1('0x13'),_0x156b44,'request\x20sent',JSON['stringify'](_0x20ed29));if(_0x20ed29[_0x39d1('0x14')]){if(_0x20ed29['error']['code']===0x1f4){logger[_0x39d1('0x14')](_0x39d1('0x10'),_0x156b44,_0x20ed29[_0x39d1('0x14')]['message']);return _0x2ff6ad(_0x20ed29['error'][_0x39d1('0x15')]);}logger['error'](_0x39d1('0x10'),_0x156b44,_0x20ed29[_0x39d1('0x14')][_0x39d1('0x15')]);return _0x22b574(_0x20ed29[_0x39d1('0x14')][_0x39d1('0x15')]);}else{logger[_0x39d1('0x16')]('SmsAccount,\x20%s,\x20%s',_0x156b44,_0x39d1('0x11'));_0x22b574(_0x20ed29[_0x39d1('0x17')]['message']);}})[_0x39d1('0x18')](function(_0x35c833){logger['error']('SmsAccount,\x20%s,\x20%s',_0x156b44,_0x35c833);_0x2ff6ad(_0x35c833);});});}exports[_0x39d1('0x19')]=function(_0x472b47){var _0x3901f0=this;return new Promise(function(_0x511894,_0x5e5f5c){return db[_0x39d1('0x1a')][_0x39d1('0x1b')]({'raw':_0x472b47[_0x39d1('0x1c')]?_0x472b47[_0x39d1('0x1c')][_0x39d1('0x1d')]===undefined?!![]:![]:!![],'where':_0x472b47[_0x39d1('0x1c')]?_0x472b47[_0x39d1('0x1c')]['where']||null:null,'attributes':_0x472b47[_0x39d1('0x1c')]?_0x472b47[_0x39d1('0x1c')][_0x39d1('0x1e')]||null:null,'include':_0x472b47[_0x39d1('0x1c')]?_0x472b47[_0x39d1('0x1c')][_0x39d1('0x1f')]?_[_0x39d1('0x20')](_0x472b47[_0x39d1('0x1c')][_0x39d1('0x1f')],function(_0x25ad88){return{'model':db[_0x25ad88[_0x39d1('0x21')]],'as':_0x25ad88['as'],'attributes':_0x25ad88[_0x39d1('0x1e')],'include':_0x25ad88[_0x39d1('0x1f')]?_[_0x39d1('0x20')](_0x25ad88[_0x39d1('0x1f')],function(_0x4b91af){return{'model':db[_0x4b91af[_0x39d1('0x21')]],'as':_0x4b91af['as'],'attributes':_0x4b91af[_0x39d1('0x1e')],'include':_0x4b91af['include']?_[_0x39d1('0x20')](_0x4b91af['include'],function(_0x4ed2e1){return{'model':db[_0x4ed2e1[_0x39d1('0x21')]],'as':_0x4ed2e1['as'],'attributes':_0x4ed2e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x39d1('0xf')](function(_0x14c2ed){logger['info'](_0x39d1('0x19'),_0x472b47);logger['debug'](_0x39d1('0x19'),_0x472b47,JSON[_0x39d1('0x22')](_0x14c2ed));_0x511894(_0x14c2ed);})['catch'](function(_0x50ce43){logger['error']('ShowSmsAccount',_0x50ce43['message'],_0x472b47);_0x5e5f5c(_0x3901f0[_0x39d1('0x14')](0x1f4,_0x50ce43[_0x39d1('0x15')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x50a651,_0x276aaf){var _0x429c51=function(_0x41e3e9){while(--_0x41e3e9){_0x50a651['push'](_0x50a651['shift']());}};_0x429c51(++_0x276aaf);}(_0xedd9,0xfc));var _0x9edd=function(_0xf67a65,_0x4f9b5f){_0xf67a65=_0xf67a65-0x0;var _0x160786=_0xedd9[_0xf67a65];return _0x160786;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0xb1df1b,_0x3cc823){var _0x56863c=function(_0x18520b){while(--_0x18520b){_0xb1df1b['push'](_0xb1df1b['shift']());}};_0x56863c(++_0x3cc823);}(_0x3e74,0x175));var _0x43e7=function(_0x20fd41,_0x16ea4e){_0x20fd41=_0x20fd41-0x0;var _0x182e9b=_0x3e74[_0x20fd41];return _0x182e9b;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47f7=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0xe8f13d,_0x5eea30){var _0x337ae8=function(_0xeb2260){while(--_0xeb2260){_0xe8f13d['push'](_0xe8f13d['shift']());}};_0x337ae8(++_0x5eea30);}(_0x47f7,0x199));var _0x747f=function(_0x151840,_0x35200b){_0x151840=_0x151840-0x0;var _0x17b368=_0x47f7[_0x151840];return _0x17b368;};'use strict';var Sequelize=require(_0x747f('0x0'));module[_0x747f('0x1')]={'priority':{'type':Sequelize[_0x747f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x747f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x747f('0x4')]},'interval':{'type':Sequelize[_0x747f('0x4')],'defaultValue':_0x747f('0x5')}};
\ No newline at end of file
+var _0x49e7=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x23ca2f,_0x271c2b){var _0x4f4b51=function(_0x1cb6c0){while(--_0x1cb6c0){_0x23ca2f['push'](_0x23ca2f['shift']());}};_0x4f4b51(++_0x271c2b);}(_0x49e7,0xc5));var _0x749e=function(_0x2abde0,_0x34c56e){_0x2abde0=_0x2abde0-0x0;var _0x33d1e6=_0x49e7[_0x2abde0];return _0x33d1e6;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x749e('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x749e('0x1')],'allowNull':![],'defaultValue':_0x749e('0x2')},'appdata':{'type':Sequelize[_0x749e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x749e('0x1')],'defaultValue':_0x749e('0x4')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05f6=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x05f6,0x7c));var _0x605f=function(_0x22d3a8,_0x5a93e6){_0x22d3a8=_0x22d3a8-0x0;var _0x1fc8df=_0x05f6[_0x22d3a8];return _0x1fc8df;};'use strict';var emlformat=require(_0x605f('0x0'));var rimraf=require(_0x605f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x605f('0x2'));var Mustache=require(_0x605f('0x3'));var util=require(_0x605f('0x4'));var path=require(_0x605f('0x5'));var sox=require(_0x605f('0x6'));var csv=require(_0x605f('0x7'));var ejs=require(_0x605f('0x8'));var fs=require('fs');var fs_extra=require(_0x605f('0x9'));var _=require('lodash');var squel=require(_0x605f('0xa'));var crypto=require(_0x605f('0xb'));var jsforce=require(_0x605f('0xc'));var deskjs=require(_0x605f('0xd'));var toCsv=require(_0x605f('0x7'));var querystring=require(_0x605f('0xe'));var Papa=require(_0x605f('0xf'));var Redis=require(_0x605f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x605f('0x11'));var as=require(_0x605f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x605f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x605f('0x14'));var licenseUtil=require(_0x605f('0x15'));var db=require(_0x605f('0x16'))['db'];function respondWithStatusCode(_0x3af7a4,_0x953c25){_0x953c25=_0x953c25||0xcc;return function(_0x4399d7){if(_0x4399d7){return _0x3af7a4['sendStatus'](_0x953c25);}return _0x3af7a4[_0x605f('0x17')](_0x953c25)[_0x605f('0x18')]();};}function respondWithResult(_0x29743b,_0x52ce52){_0x52ce52=_0x52ce52||0xc8;return function(_0x57b150){if(_0x57b150){return _0x29743b['status'](_0x52ce52)[_0x605f('0x19')](_0x57b150);}};}function respondWithFilteredResult(_0x546db7,_0x24495b){return function(_0x3523f){if(_0x3523f){var _0xa42cca=typeof _0x24495b[_0x605f('0x1a')]==='undefined'&&typeof _0x24495b[_0x605f('0x1b')]===_0x605f('0x1c');var _0x2bf52d=_0x3523f['count'];var _0x1fe8b5=_0xa42cca?0x0:_0x24495b[_0x605f('0x1a')];var _0x543a8f=_0xa42cca?_0x3523f[_0x605f('0x1d')]:_0x24495b['offset']+_0x24495b[_0x605f('0x1b')];var _0x2dea4f;if(_0x543a8f>=_0x2bf52d){_0x543a8f=_0x2bf52d;_0x2dea4f=0xc8;}else{_0x2dea4f=0xce;}_0x546db7['status'](_0x2dea4f);return _0x546db7['set']('Content-Range',_0x1fe8b5+'-'+_0x543a8f+'/'+_0x2bf52d)[_0x605f('0x19')](_0x3523f);}return null;};}function patchUpdates(_0x4537cf){return function(_0x136429){try{jsonpatch[_0x605f('0x1e')](_0x136429,_0x4537cf,!![]);}catch(_0x13010c){return BPromise[_0x605f('0x1f')](_0x13010c);}return _0x136429[_0x605f('0x20')]();};}function saveUpdates(_0xc689c2,_0x1724f1){return function(_0x84573c){if(_0x84573c){return _0x84573c[_0x605f('0x21')](_0xc689c2)[_0x605f('0x22')](function(_0x394fd8){return _0x394fd8;});}return null;};}function removeEntity(_0x2b0704,_0x3a337b){return function(_0x1df415){if(_0x1df415){return _0x1df415[_0x605f('0x23')]()['then'](function(){_0x2b0704[_0x605f('0x17')](0xcc)[_0x605f('0x18')]();});}};}function handleEntityNotFound(_0x180d84,_0x8aae4f){return function(_0x150cd4){if(!_0x150cd4){_0x180d84[_0x605f('0x24')](0x194);}return _0x150cd4;};}function handleError(_0x4cf4b3,_0x2c5ba6){_0x2c5ba6=_0x2c5ba6||0x1f4;return function(_0x19eefe){logger[_0x605f('0x25')](_0x19eefe[_0x605f('0x26')]);if(_0x19eefe['name']){delete _0x19eefe[_0x605f('0x27')];}_0x4cf4b3[_0x605f('0x17')](_0x2c5ba6)[_0x605f('0x28')](_0x19eefe);};}exports['index']=function(_0x56d86d,_0x2de92f){var _0x372f71={},_0x54bd5e={},_0x2dfa41={'count':0x0,'rows':[]};var _0xb8fdd3=_[_0x605f('0x29')](db[_0x605f('0x2a')][_0x605f('0x2b')],function(_0x37eccd){return{'name':_0x37eccd[_0x605f('0x2c')],'type':_0x37eccd[_0x605f('0x2d')][_0x605f('0x2e')]};});_0x54bd5e[_0x605f('0x2f')]=_[_0x605f('0x29')](_0xb8fdd3,_0x605f('0x27'));_0x54bd5e[_0x605f('0x30')]=_[_0x605f('0x31')](_0x56d86d['query']);_0x54bd5e[_0x605f('0x32')]=_[_0x605f('0x33')](_0x54bd5e['model'],_0x54bd5e[_0x605f('0x30')]);_0x372f71[_0x605f('0x34')]=_[_0x605f('0x33')](_0x54bd5e['model'],qs[_0x605f('0x35')](_0x56d86d[_0x605f('0x30')]['fields']));_0x372f71[_0x605f('0x34')]=_0x372f71[_0x605f('0x34')][_0x605f('0x36')]?_0x372f71[_0x605f('0x34')]:_0x54bd5e[_0x605f('0x2f')];if(!_0x56d86d[_0x605f('0x30')]['hasOwnProperty'](_0x605f('0x37'))){_0x372f71['limit']=qs[_0x605f('0x1b')](_0x56d86d[_0x605f('0x30')][_0x605f('0x1b')]);_0x372f71[_0x605f('0x1a')]=qs[_0x605f('0x1a')](_0x56d86d['query'][_0x605f('0x1a')]);}_0x372f71[_0x605f('0x38')]=qs[_0x605f('0x39')](_0x56d86d[_0x605f('0x30')][_0x605f('0x39')]);_0x372f71[_0x605f('0x3a')]=qs['filters'](_[_0x605f('0x3b')](_0x56d86d[_0x605f('0x30')],_0x54bd5e[_0x605f('0x32')]),_0xb8fdd3);if(_0x56d86d[_0x605f('0x30')]['filter']){_0x372f71['where']=_[_0x605f('0x3c')](_0x372f71[_0x605f('0x3a')],{'$or':_[_0x605f('0x29')](_0xb8fdd3,function(_0x4308e5){if(_0x4308e5[_0x605f('0x2d')]!==_0x605f('0x3d')){var _0x434cc5={};_0x434cc5[_0x4308e5[_0x605f('0x27')]]={'$like':'%'+_0x56d86d[_0x605f('0x30')]['filter']+'%'};return _0x434cc5;}})});}_0x372f71=_[_0x605f('0x3c')]({},_0x372f71,_0x56d86d[_0x605f('0x3e')]);var _0x4c8936={'where':_0x372f71[_0x605f('0x3a')]};return db[_0x605f('0x2a')][_0x605f('0x1d')](_0x4c8936)[_0x605f('0x22')](function(_0xcdc5b1){_0x2dfa41['count']=_0xcdc5b1;if(_0x56d86d[_0x605f('0x30')][_0x605f('0x3f')]){_0x372f71[_0x605f('0x40')]=[{'all':!![]}];}return db[_0x605f('0x2a')][_0x605f('0x41')](_0x372f71);})['then'](function(_0x886976){_0x2dfa41[_0x605f('0x42')]=_0x886976;return _0x2dfa41;})['then'](respondWithFilteredResult(_0x2de92f,_0x372f71))[_0x605f('0x43')](handleError(_0x2de92f,null));};exports['show']=function(_0x3043a5,_0x4b0117){var _0x2251a4={'raw':!![],'where':{'id':_0x3043a5[_0x605f('0x44')]['id']}},_0x3ccb45={};_0x3ccb45[_0x605f('0x2f')]=_[_0x605f('0x31')](db[_0x605f('0x2a')][_0x605f('0x2b')]);_0x3ccb45[_0x605f('0x30')]=_[_0x605f('0x31')](_0x3043a5[_0x605f('0x30')]);_0x3ccb45[_0x605f('0x32')]=_['intersection'](_0x3ccb45[_0x605f('0x2f')],_0x3ccb45[_0x605f('0x30')]);_0x2251a4[_0x605f('0x34')]=_[_0x605f('0x33')](_0x3ccb45[_0x605f('0x2f')],qs['fields'](_0x3043a5[_0x605f('0x30')]['fields']));_0x2251a4[_0x605f('0x34')]=_0x2251a4[_0x605f('0x34')][_0x605f('0x36')]?_0x2251a4[_0x605f('0x34')]:_0x3ccb45['model'];if(_0x3043a5[_0x605f('0x30')][_0x605f('0x3f')]){_0x2251a4[_0x605f('0x40')]=[{'all':!![]}];}_0x2251a4=_['merge']({},_0x2251a4,_0x3043a5[_0x605f('0x3e')]);return db[_0x605f('0x2a')][_0x605f('0x45')](_0x2251a4)['then'](handleEntityNotFound(_0x4b0117,null))[_0x605f('0x22')](respondWithResult(_0x4b0117,null))['catch'](handleError(_0x4b0117,null));};exports[_0x605f('0x46')]=function(_0x4b951d,_0x2f82b2){return db[_0x605f('0x2a')]['create'](_0x4b951d[_0x605f('0x47')],{})['then'](respondWithResult(_0x2f82b2,0xc9))['catch'](handleError(_0x2f82b2,null));};exports[_0x605f('0x21')]=function(_0xa45917,_0x4c523a){if(_0xa45917[_0x605f('0x47')]['id']){delete _0xa45917['body']['id'];}return db['SmsApplication'][_0x605f('0x45')]({'where':{'id':_0xa45917[_0x605f('0x44')]['id']}})[_0x605f('0x22')](handleEntityNotFound(_0x4c523a,null))[_0x605f('0x22')](saveUpdates(_0xa45917[_0x605f('0x47')],null))['then'](respondWithResult(_0x4c523a,null))[_0x605f('0x43')](handleError(_0x4c523a,null));};exports[_0x605f('0x23')]=function(_0x4be478,_0x423d08){return db[_0x605f('0x2a')][_0x605f('0x45')]({'where':{'id':_0x4be478[_0x605f('0x44')]['id']}})['then'](handleEntityNotFound(_0x423d08,null))[_0x605f('0x22')](removeEntity(_0x423d08,null))[_0x605f('0x43')](handleError(_0x423d08,null));};
\ No newline at end of file
+var _0x1f6f=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','find','catch','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query'];(function(_0x282bd8,_0x258c78){var _0x1a3ec2=function(_0x1bb227){while(--_0x1bb227){_0x282bd8['push'](_0x282bd8['shift']());}};_0x1a3ec2(++_0x258c78);}(_0x1f6f,0x1cf));var _0xf1f6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1f6f[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xf1f6('0x0'));var rimraf=require(_0xf1f6('0x1'));var zipdir=require(_0xf1f6('0x2'));var jsonpatch=require(_0xf1f6('0x3'));var rp=require(_0xf1f6('0x4'));var moment=require(_0xf1f6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf1f6('0x6'));var path=require(_0xf1f6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1f6('0x8'));var squel=require(_0xf1f6('0x9'));var crypto=require(_0xf1f6('0xa'));var jsforce=require(_0xf1f6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf1f6('0xc'));var querystring=require(_0xf1f6('0xd'));var Papa=require(_0xf1f6('0xe'));var Redis=require(_0xf1f6('0xf'));var authService=require(_0xf1f6('0x10'));var qs=require(_0xf1f6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1f6('0x12'));var logger=require(_0xf1f6('0x13'))('api');var utils=require(_0xf1f6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf1f6('0x15'));var db=require(_0xf1f6('0x16'))['db'];function respondWithStatusCode(_0x502754,_0x457383){_0x457383=_0x457383||0xcc;return function(_0x46f7ee){if(_0x46f7ee){return _0x502754['sendStatus'](_0x457383);}return _0x502754['status'](_0x457383)[_0xf1f6('0x17')]();};}function respondWithResult(_0x1715ac,_0x2f0751){_0x2f0751=_0x2f0751||0xc8;return function(_0x2d7f73){if(_0x2d7f73){return _0x1715ac[_0xf1f6('0x18')](_0x2f0751)[_0xf1f6('0x19')](_0x2d7f73);}};}function respondWithFilteredResult(_0x7b3fd8,_0x49d172){return function(_0xd18778){if(_0xd18778){var _0x517f8e=typeof _0x49d172[_0xf1f6('0x1a')]===_0xf1f6('0x1b')&&typeof _0x49d172[_0xf1f6('0x1c')]===_0xf1f6('0x1b');var _0x1dff16=_0xd18778[_0xf1f6('0x1d')];var _0x45a584=_0x517f8e?0x0:_0x49d172[_0xf1f6('0x1a')];var _0x30d4c9=_0x517f8e?_0xd18778[_0xf1f6('0x1d')]:_0x49d172[_0xf1f6('0x1a')]+_0x49d172['limit'];var _0x5173ee;if(_0x30d4c9>=_0x1dff16){_0x30d4c9=_0x1dff16;_0x5173ee=0xc8;}else{_0x5173ee=0xce;}_0x7b3fd8['status'](_0x5173ee);return _0x7b3fd8[_0xf1f6('0x1e')](_0xf1f6('0x1f'),_0x45a584+'-'+_0x30d4c9+'/'+_0x1dff16)[_0xf1f6('0x19')](_0xd18778);}return null;};}function patchUpdates(_0x290188){return function(_0x4e617d){try{jsonpatch['apply'](_0x4e617d,_0x290188,!![]);}catch(_0x253fd2){return BPromise[_0xf1f6('0x20')](_0x253fd2);}return _0x4e617d['save']();};}function saveUpdates(_0x1edf3e,_0x16edb4){return function(_0x4c9357){if(_0x4c9357){return _0x4c9357['update'](_0x1edf3e)['then'](function(_0x591551){return _0x591551;});}return null;};}function removeEntity(_0x3ff5ce,_0x2e4f73){return function(_0x1a7d1d){if(_0x1a7d1d){return _0x1a7d1d[_0xf1f6('0x21')]()[_0xf1f6('0x22')](function(){_0x3ff5ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0fc6,_0x18d905){return function(_0x432dd0){if(!_0x432dd0){_0x2c0fc6[_0xf1f6('0x23')](0x194);}return _0x432dd0;};}function handleError(_0x54edb6,_0x4b3439){_0x4b3439=_0x4b3439||0x1f4;return function(_0x54b083){logger[_0xf1f6('0x24')](_0x54b083[_0xf1f6('0x25')]);if(_0x54b083[_0xf1f6('0x26')]){delete _0x54b083[_0xf1f6('0x26')];}_0x54edb6['status'](_0x4b3439)[_0xf1f6('0x27')](_0x54b083);};}exports['index']=function(_0x43cbd9,_0xd6c2a4){var _0x11ebc4={},_0x4b2a6c={},_0x307d96={'count':0x0,'rows':[]};var _0x677443=_[_0xf1f6('0x28')](db[_0xf1f6('0x29')][_0xf1f6('0x2a')],function(_0x2aa75b){return{'name':_0x2aa75b[_0xf1f6('0x2b')],'type':_0x2aa75b[_0xf1f6('0x2c')][_0xf1f6('0x2d')]};});_0x4b2a6c[_0xf1f6('0x2e')]=_[_0xf1f6('0x28')](_0x677443,_0xf1f6('0x26'));_0x4b2a6c[_0xf1f6('0x2f')]=_['keys'](_0x43cbd9[_0xf1f6('0x2f')]);_0x4b2a6c['filters']=_[_0xf1f6('0x30')](_0x4b2a6c[_0xf1f6('0x2e')],_0x4b2a6c[_0xf1f6('0x2f')]);_0x11ebc4[_0xf1f6('0x31')]=_['intersection'](_0x4b2a6c['model'],qs[_0xf1f6('0x32')](_0x43cbd9[_0xf1f6('0x2f')][_0xf1f6('0x32')]));_0x11ebc4[_0xf1f6('0x31')]=_0x11ebc4[_0xf1f6('0x31')][_0xf1f6('0x33')]?_0x11ebc4[_0xf1f6('0x31')]:_0x4b2a6c[_0xf1f6('0x2e')];if(!_0x43cbd9[_0xf1f6('0x2f')][_0xf1f6('0x34')](_0xf1f6('0x35'))){_0x11ebc4[_0xf1f6('0x1c')]=qs['limit'](_0x43cbd9[_0xf1f6('0x2f')][_0xf1f6('0x1c')]);_0x11ebc4[_0xf1f6('0x1a')]=qs['offset'](_0x43cbd9[_0xf1f6('0x2f')][_0xf1f6('0x1a')]);}_0x11ebc4[_0xf1f6('0x36')]=qs[_0xf1f6('0x37')](_0x43cbd9[_0xf1f6('0x2f')][_0xf1f6('0x37')]);_0x11ebc4[_0xf1f6('0x38')]=qs[_0xf1f6('0x39')](_['pick'](_0x43cbd9[_0xf1f6('0x2f')],_0x4b2a6c[_0xf1f6('0x39')]),_0x677443);if(_0x43cbd9['query'][_0xf1f6('0x3a')]){_0x11ebc4[_0xf1f6('0x38')]=_['merge'](_0x11ebc4[_0xf1f6('0x38')],{'$or':_[_0xf1f6('0x28')](_0x677443,function(_0x31cf97){if(_0x31cf97['type']!==_0xf1f6('0x3b')){var _0x5da6be={};_0x5da6be[_0x31cf97[_0xf1f6('0x26')]]={'$like':'%'+_0x43cbd9[_0xf1f6('0x2f')]['filter']+'%'};return _0x5da6be;}})});}_0x11ebc4=_[_0xf1f6('0x3c')]({},_0x11ebc4,_0x43cbd9['options']);var _0x124866={'where':_0x11ebc4[_0xf1f6('0x38')]};return db[_0xf1f6('0x29')][_0xf1f6('0x1d')](_0x124866)[_0xf1f6('0x22')](function(_0x1b4572){_0x307d96[_0xf1f6('0x1d')]=_0x1b4572;if(_0x43cbd9[_0xf1f6('0x2f')][_0xf1f6('0x3d')]){_0x11ebc4[_0xf1f6('0x3e')]=[{'all':!![]}];}return db[_0xf1f6('0x29')][_0xf1f6('0x3f')](_0x11ebc4);})[_0xf1f6('0x22')](function(_0x264e1b){_0x307d96[_0xf1f6('0x40')]=_0x264e1b;return _0x307d96;})[_0xf1f6('0x22')](respondWithFilteredResult(_0xd6c2a4,_0x11ebc4))['catch'](handleError(_0xd6c2a4,null));};exports[_0xf1f6('0x41')]=function(_0x4aeda8,_0x5d7375){var _0x21707f={'raw':!![],'where':{'id':_0x4aeda8[_0xf1f6('0x42')]['id']}},_0x3480d1={};_0x3480d1[_0xf1f6('0x2e')]=_[_0xf1f6('0x43')](db['SmsApplication'][_0xf1f6('0x2a')]);_0x3480d1['query']=_[_0xf1f6('0x43')](_0x4aeda8['query']);_0x3480d1[_0xf1f6('0x39')]=_[_0xf1f6('0x30')](_0x3480d1['model'],_0x3480d1[_0xf1f6('0x2f')]);_0x21707f[_0xf1f6('0x31')]=_['intersection'](_0x3480d1[_0xf1f6('0x2e')],qs[_0xf1f6('0x32')](_0x4aeda8[_0xf1f6('0x2f')]['fields']));_0x21707f[_0xf1f6('0x31')]=_0x21707f['attributes']['length']?_0x21707f[_0xf1f6('0x31')]:_0x3480d1[_0xf1f6('0x2e')];if(_0x4aeda8[_0xf1f6('0x2f')][_0xf1f6('0x3d')]){_0x21707f[_0xf1f6('0x3e')]=[{'all':!![]}];}_0x21707f=_[_0xf1f6('0x3c')]({},_0x21707f,_0x4aeda8['options']);return db[_0xf1f6('0x29')][_0xf1f6('0x44')](_0x21707f)['then'](handleEntityNotFound(_0x5d7375,null))[_0xf1f6('0x22')](respondWithResult(_0x5d7375,null))[_0xf1f6('0x45')](handleError(_0x5d7375,null));};exports[_0xf1f6('0x46')]=function(_0x5249b4,_0x358dec){return db[_0xf1f6('0x29')]['create'](_0x5249b4['body'],{})[_0xf1f6('0x22')](respondWithResult(_0x358dec,0xc9))[_0xf1f6('0x45')](handleError(_0x358dec,null));};exports[_0xf1f6('0x47')]=function(_0x42acba,_0x35ea53){if(_0x42acba['body']['id']){delete _0x42acba[_0xf1f6('0x48')]['id'];}return db[_0xf1f6('0x29')]['find']({'where':{'id':_0x42acba['params']['id']}})[_0xf1f6('0x22')](handleEntityNotFound(_0x35ea53,null))[_0xf1f6('0x22')](saveUpdates(_0x42acba[_0xf1f6('0x48')],null))[_0xf1f6('0x22')](respondWithResult(_0x35ea53,null))[_0xf1f6('0x45')](handleError(_0x35ea53,null));};exports['destroy']=function(_0x14e91b,_0x948552){return db['SmsApplication'][_0xf1f6('0x44')]({'where':{'id':_0x14e91b[_0xf1f6('0x42')]['id']}})[_0xf1f6('0x22')](handleEntityNotFound(_0x948552,null))['then'](removeEntity(_0x948552,null))[_0xf1f6('0x45')](handleError(_0x948552,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f12=['SmsApplication','sms_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x2adaab,_0x4d19ec){var _0x279699=function(_0x13444a){while(--_0x13444a){_0x2adaab['push'](_0x2adaab['shift']());}};_0x279699(++_0x4d19ec);}(_0x8f12,0x196));var _0x28f1=function(_0x53377b,_0x166f23){_0x53377b=_0x53377b-0x0;var _0x39cba9=_0x8f12[_0x53377b];return _0x39cba9;};'use strict';var _=require('lodash');var util=require(_0x28f1('0x0'));var logger=require('../../config/logger')(_0x28f1('0x1'));var moment=require(_0x28f1('0x2'));var BPromise=require(_0x28f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28f1('0x4'));var rimraf=require(_0x28f1('0x5'));var config=require(_0x28f1('0x6'));var attributes=require(_0x28f1('0x7'));module[_0x28f1('0x8')]=function(_0xeda3f8,_0x3f1532){return _0xeda3f8[_0x28f1('0x9')](_0x28f1('0xa'),attributes,{'tableName':_0x28f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x28f1('0xc')});};
\ No newline at end of file
+var _0x98d4=['exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x25f3e9,_0x328779){var _0x410ef5=function(_0x25c1a2){while(--_0x25c1a2){_0x25f3e9['push'](_0x25f3e9['shift']());}};_0x410ef5(++_0x328779);}(_0x98d4,0xf6));var _0x498d=function(_0x544bcc,_0x3a0e62){_0x544bcc=_0x544bcc-0x0;var _0x289223=_0x98d4[_0x544bcc];return _0x289223;};'use strict';var _=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var logger=require('../../config/logger')(_0x498d('0x2'));var moment=require(_0x498d('0x3'));var BPromise=require(_0x498d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x498d('0x5'));var rimraf=require(_0x498d('0x6'));var config=require(_0x498d('0x7'));var attributes=require(_0x498d('0x8'));module[_0x498d('0x9')]=function(_0x16979b,_0x540b60){return _0x16979b[_0x498d('0xa')](_0x498d('0xb'),attributes,{'tableName':_0x498d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x498d('0xd'),'collate':_0x498d('0xe')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsApplication,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x505d,0x93));var _0xd505=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x505d[_0x240261];return _0x45c332;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('SmsApplication,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('SmsApplication,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}
\ No newline at end of file
+var _0x9a2a=['request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x198f45,_0x29f7ca){var _0xd50cba=function(_0x2f3eeb){while(--_0x2f3eeb){_0x198f45['push'](_0x198f45['shift']());}};_0xd50cba(++_0x29f7ca);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x4f4107,_0x342cd4){_0x4f4107=_0x4f4107-0x0;var _0x2f02bc=_0x9a2a[_0x4f4107];return _0x2f02bc;};'use strict';var _=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var moment=require(_0xa9a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a2('0x3'))['db'];var utils=require(_0xa9a2('0x4'));var logger=require(_0xa9a2('0x5'))(_0xa9a2('0x6'));var config=require(_0xa9a2('0x7'));var jayson=require(_0xa9a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x388689,_0xb51739,_0xedae90){return new BPromise(function(_0x287343,_0xcd2750){return client[_0xa9a2('0x9')](_0x388689,_0xedae90)[_0xa9a2('0xa')](function(_0x26f1ce){logger[_0xa9a2('0xb')]('SmsApplication,\x20%s,\x20%s',_0xb51739,_0xa9a2('0xc'));logger[_0xa9a2('0xd')](_0xa9a2('0xe'),_0xb51739,_0xa9a2('0xc'),JSON[_0xa9a2('0xf')](_0x26f1ce));if(_0x26f1ce[_0xa9a2('0x10')]){if(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x11')]===0x1f4){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce['error'][_0xa9a2('0x13')]);return _0xcd2750(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);return _0x287343(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}else{logger[_0xa9a2('0xb')](_0xa9a2('0x12'),_0xb51739,_0xa9a2('0xc'));_0x287343(_0x26f1ce[_0xa9a2('0x14')]['message']);}})[_0xa9a2('0x15')](function(_0xbb6546){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0xbb6546);_0xcd2750(_0xbb6546);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21eb0f,_0x367c19){var _0xacf857=function(_0x39c559){while(--_0x39c559){_0x21eb0f['push'](_0x21eb0f['shift']());}};_0xacf857(++_0x367c19);}(_0xe605,0x92));var _0x5e60=function(_0x11db82,_0x441c0e){_0x11db82=_0x11db82-0x0;var _0x2ff2d9=_0xe605[_0x11db82];return _0x2ff2d9;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router;
\ No newline at end of file
+var _0x6324=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x275d6c,_0x10c31d){var _0x26510d=function(_0x7de4a9){while(--_0x7de4a9){_0x275d6c['push'](_0x275d6c['shift']());}};_0x26510d(++_0x10c31d);}(_0x6324,0x142));var _0x4632=function(_0x14a83c,_0x394b54){_0x14a83c=_0x14a83c-0x0;var _0x345d56=_0x6324[_0x14a83c];return _0x345d56;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./smsInteraction.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0x7')](_0x4632('0xd'),auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xf')]('/',auth[_0x4632('0x8')](),controller['create']);router[_0x4632('0xf')]('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0x10')]);router[_0x4632('0xf')](_0x4632('0x11'),auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x14')),controller[_0x4632('0x15')]);router[_0x4632('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x17')),controller[_0x4632('0x18')]);router['delete'](_0x4632('0x19'),auth[_0x4632('0x8')](),interaction[_0x4632('0x12')]('sms',_0x4632('0x1a')),controller[_0x4632('0x1b')]);router['delete']('/:id/tags',auth[_0x4632('0x8')](),controller[_0x4632('0x1c')]);module[_0x4632('0x1d')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a85=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x20be9a,_0x2cca1c){var _0x32d407=function(_0x3059c2){while(--_0x3059c2){_0x20be9a['push'](_0x20be9a['shift']());}};_0x32d407(++_0x2cca1c);}(_0x1a85,0x178));var _0x51a8=function(_0x25dfdf,_0x542333){_0x25dfdf=_0x25dfdf-0x0;var _0x5220da=_0x1a85[_0x25dfdf];return _0x5220da;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x51a8('0x0')]={'closed':{'type':Sequelize[_0x51a8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51a8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x51a8('0x3')]},'note':{'type':Sequelize[_0x51a8('0x3')]},'phone':{'type':Sequelize[_0x51a8('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x51a8('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51a8('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x51a8('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x51a8('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x794b=['ENUM','out','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x241ada,_0x38127a){var _0x3662b7=function(_0x35e5a0){while(--_0x35e5a0){_0x241ada['push'](_0x241ada['shift']());}};_0x3662b7(++_0x38127a);}(_0x794b,0x1c2));var _0xb794=function(_0x4f5a1e,_0x5da98c){_0x4f5a1e=_0x4f5a1e-0x0;var _0x12fcd2=_0x794b[_0x4f5a1e];return _0x12fcd2;};'use strict';var Sequelize=require(_0xb794('0x0'));var moment=require(_0xb794('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb794('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb794('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb794('0x4')]},'note':{'type':Sequelize[_0xb794('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb794('0x5')]('in',_0xb794('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb794('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb794('0x5')]('in',_0xb794('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb794('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c7b=['$gte','split','format','rows','addTags','spread','color','removeTags','download','unix','toString','join','server','files','tmp','transcript-%d-%s.zip','push','User','lastName','Messages','direction','secret','Owner','get','mkdirSync','Account','fullname','N.A.','createdAt','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','out','System','Contact','firstName','value','renderFile','root','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','update','destroy','then','error','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','findAll','user','catch','show','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x0c7b,0x189));var _0xb0c7=function(_0x55173e,_0x3be3a1){_0x55173e=_0x55173e-0x0;var _0x2ec83e=_0x0c7b[_0x55173e];return _0x2ec83e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb0c7('0x0'));var moment=require(_0xb0c7('0x1'));var BPromise=require(_0xb0c7('0x2'));var util=require(_0xb0c7('0x3'));var path=require('path');var ejs=require(_0xb0c7('0x4'));var fs=require('fs');var _=require(_0xb0c7('0x5'));var Redis=require('ioredis');var interaction=require(_0xb0c7('0x6'));var qs=require(_0xb0c7('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0xb0c7('0x8'))(_0xb0c7('0x9'));var config=require(_0xb0c7('0xa'));var db=require(_0xb0c7('0xb'))['db'];config[_0xb0c7('0xc')]=_[_0xb0c7('0xd')](config[_0xb0c7('0xc')],{'host':_0xb0c7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0c7('0xc')]));require(_0xb0c7('0xf'))[_0xb0c7('0x10')](socket);function respondWithStatusCode(_0x44ba22,_0x59cf4e){_0x59cf4e=_0x59cf4e||0xcc;return function(_0x14ace1){if(_0x14ace1){return _0x44ba22[_0xb0c7('0x11')](_0x59cf4e);}return _0x44ba22[_0xb0c7('0x12')](_0x59cf4e)[_0xb0c7('0x13')]();};}function respondWithResult(_0x1b9c7a,_0x2060a8){_0x2060a8=_0x2060a8||0xc8;return function(_0x5ddea7){if(_0x5ddea7){return _0x1b9c7a[_0xb0c7('0x12')](_0x2060a8)[_0xb0c7('0x14')](_0x5ddea7);}};}function respondWithFilteredResult(_0x50476e,_0x475767){return function(_0x28f868){if(_0x28f868){var _0x142461=typeof _0x475767['offset']===_0xb0c7('0x15')&&typeof _0x475767[_0xb0c7('0x16')]===_0xb0c7('0x15');var _0x83deb7=_0x28f868[_0xb0c7('0x17')];var _0x58e0a1=_0x142461?0x0:_0x475767[_0xb0c7('0x18')];var _0x5bc7b1=_0x142461?_0x28f868[_0xb0c7('0x17')]:_0x475767[_0xb0c7('0x18')]+_0x475767[_0xb0c7('0x16')];var _0x350297;if(_0x5bc7b1>=_0x83deb7){_0x5bc7b1=_0x83deb7;_0x350297=0xc8;}else{_0x350297=0xce;}_0x50476e[_0xb0c7('0x12')](_0x350297);return _0x50476e['set']('Content-Range',_0x58e0a1+'-'+_0x5bc7b1+'/'+_0x83deb7)[_0xb0c7('0x14')](_0x28f868);}return null;};}function saveUpdates(_0x562d28){return function(_0x105714){if(_0x105714){return _0x105714[_0xb0c7('0x19')](_0x562d28)['then'](function(_0x1390a6){return _0x1390a6;});}return null;};}function removeEntity(_0x40ab8f){return function(_0xa8e3f4){if(_0xa8e3f4){return _0xa8e3f4[_0xb0c7('0x1a')]()[_0xb0c7('0x1b')](function(){_0x40ab8f[_0xb0c7('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c19db){return function(_0x488722){if(!_0x488722){_0x2c19db['sendStatus'](0x194);}return _0x488722;};}function handleError(_0x4f3b28,_0x11cae7){_0x11cae7=_0x11cae7||0x1f4;return function(_0x428d05){logger[_0xb0c7('0x1c')](_0x428d05['stack']);if(_0x428d05[_0xb0c7('0x1d')]){delete _0x428d05[_0xb0c7('0x1d')];}_0x4f3b28['status'](_0x11cae7)[_0xb0c7('0x1e')](_0x428d05);};}exports[_0xb0c7('0x1f')]=function(_0x2984a9,_0x44efbd){var _0x3bc3a9={};var _0x366328=_[_0xb0c7('0x20')](db[_0xb0c7('0x21')][_0xb0c7('0x22')],function(_0x45d2a0){return{'name':_0x45d2a0[_0xb0c7('0x23')],'type':_0x45d2a0[_0xb0c7('0x24')][_0xb0c7('0x25')]};});_0x3bc3a9=qs['getOptions'](_0x366328,_0x2984a9);return interaction[_0xb0c7('0x26')]('sms',_0x2984a9['query'],_0x2984a9[_0xb0c7('0x27')],_0x3bc3a9,_0x366328)[_0xb0c7('0x1b')](respondWithFilteredResult(_0x44efbd,_0x3bc3a9))[_0xb0c7('0x28')](handleError(_0x44efbd,null));};exports[_0xb0c7('0x29')]=function(_0x30e2a2,_0x475790){var _0x1deef0={'raw':![],'where':{'id':_0x30e2a2['params']['id']}},_0x5a90e5={};_0x5a90e5[_0xb0c7('0x2a')]=_[_0xb0c7('0x2b')](db[_0xb0c7('0x21')]['rawAttributes']);_0x5a90e5[_0xb0c7('0x2c')]=_[_0xb0c7('0x2b')](_0x30e2a2[_0xb0c7('0x2c')]);_0x5a90e5[_0xb0c7('0x2d')]=_[_0xb0c7('0x2e')](_0x5a90e5['model'],_0x5a90e5['query']);_0x1deef0[_0xb0c7('0x2f')]=_[_0xb0c7('0x2e')](_0x5a90e5[_0xb0c7('0x2a')],qs[_0xb0c7('0x30')](_0x30e2a2[_0xb0c7('0x2c')][_0xb0c7('0x30')]));_0x1deef0['attributes']=_0x1deef0[_0xb0c7('0x2f')][_0xb0c7('0x31')]?_0x1deef0[_0xb0c7('0x2f')]:_0x5a90e5[_0xb0c7('0x2a')];if(_0x30e2a2[_0xb0c7('0x2c')][_0xb0c7('0x32')]){_0x1deef0[_0xb0c7('0x33')]=[{'all':!![]}];}_0x1deef0=_[_0xb0c7('0x34')]({},_0x1deef0,_0x30e2a2[_0xb0c7('0x35')]);return db[_0xb0c7('0x21')][_0xb0c7('0x36')](_0x1deef0)[_0xb0c7('0x1b')](handleEntityNotFound(_0x475790,null))[_0xb0c7('0x1b')](respondWithResult(_0x475790,null))[_0xb0c7('0x28')](handleError(_0x475790,null));};exports[_0xb0c7('0x37')]=function(_0x536d66,_0x5bd7d5){return db[_0xb0c7('0x21')]['create'](_0x536d66['body'],{})[_0xb0c7('0x1b')](respondWithResult(_0x5bd7d5,0xc9))[_0xb0c7('0x28')](handleError(_0x5bd7d5,null));};exports[_0xb0c7('0x19')]=function(_0x1bc694,_0x46c781){if(_0x1bc694[_0xb0c7('0x38')]['id']){delete _0x1bc694['body']['id'];}return db['SmsInteraction'][_0xb0c7('0x36')]({'where':{'id':_0x1bc694[_0xb0c7('0x39')]['id']}})[_0xb0c7('0x1b')](handleEntityNotFound(_0x46c781,null))[_0xb0c7('0x1b')](saveUpdates(_0x1bc694[_0xb0c7('0x38')],null))[_0xb0c7('0x1b')](respondWithResult(_0x46c781,null))[_0xb0c7('0x28')](handleError(_0x46c781,null));};exports['destroy']=function(_0x18493a,_0x30bf0c){return db[_0xb0c7('0x21')]['find']({'where':{'id':_0x18493a['params']['id']}})[_0xb0c7('0x1b')](handleEntityNotFound(_0x30bf0c,null))[_0xb0c7('0x1b')](removeEntity(_0x30bf0c,null))[_0xb0c7('0x28')](handleError(_0x30bf0c,null));};exports[_0xb0c7('0x3a')]=function(_0x41f822,_0x8e6e91){return db[_0xb0c7('0x21')][_0xb0c7('0x3a')]()[_0xb0c7('0x1b')](respondWithResult(_0x8e6e91,null))[_0xb0c7('0x28')](handleError(_0x8e6e91,null));};exports[_0xb0c7('0x3b')]=function(_0x1639a2,_0x2aeca0){return db[_0xb0c7('0x3c')][_0xb0c7('0x36')]({'where':{'id':_0x1639a2[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x2aeca0,null))['then'](function(_0x367bb8){if(_0x367bb8){return _0x367bb8[_0xb0c7('0x3b')](_0x1639a2['body'][_0xb0c7('0x3d')],_[_0xb0c7('0x3e')](_0x1639a2[_0xb0c7('0x38')],[_0xb0c7('0x3d'),'id'])||{});}})[_0xb0c7('0x1b')](respondWithResult(_0x2aeca0,null))['catch'](handleError(_0x2aeca0,null));};exports[_0xb0c7('0x3f')]=function(_0xa5897,_0x57c4d7){var _0x48c20b={'raw':![],'where':{}};var _0x305995={};var _0x385c80={'count':0x0,'rows':[]};return db[_0xb0c7('0x21')]['findOne']({'where':{'id':_0xa5897[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x57c4d7,null))[_0xb0c7('0x1b')](function(_0x10bd0b){if(_0x10bd0b){_0x305995[_0xb0c7('0x2a')]=_[_0xb0c7('0x2b')](db['SmsMessage'][_0xb0c7('0x22')]);_0x305995[_0xb0c7('0x2c')]=_[_0xb0c7('0x2b')](_0xa5897[_0xb0c7('0x2c')]);_0x305995['filters']=_[_0xb0c7('0x2e')](_0x305995[_0xb0c7('0x2a')],_0x305995[_0xb0c7('0x2c')]);_0x48c20b['attributes']=_[_0xb0c7('0x2e')](_0x305995[_0xb0c7('0x2a')],qs[_0xb0c7('0x30')](_0xa5897[_0xb0c7('0x2c')][_0xb0c7('0x30')]));_0x48c20b[_0xb0c7('0x2f')]=_0x48c20b[_0xb0c7('0x2f')][_0xb0c7('0x31')]?_0x48c20b['attributes']:_0x305995['model'];if(!_0xa5897['query'][_0xb0c7('0x40')](_0xb0c7('0x41'))){_0x48c20b['limit']=qs[_0xb0c7('0x16')](_0xa5897[_0xb0c7('0x2c')]['limit']);_0x48c20b['offset']=qs[_0xb0c7('0x18')](_0xa5897[_0xb0c7('0x2c')]['offset']);}_0x48c20b[_0xb0c7('0x42')]=qs['sort'](_0xa5897['query'][_0xb0c7('0x43')]);_0x48c20b[_0xb0c7('0x44')]=qs[_0xb0c7('0x2d')](_['pick'](_0xa5897[_0xb0c7('0x2c')],_0x305995[_0xb0c7('0x2d')]));_0x48c20b[_0xb0c7('0x44')][_0xb0c7('0x45')]=_0x10bd0b['id'];if(_0xa5897[_0xb0c7('0x2c')][_0xb0c7('0x46')]){_0x48c20b['where']=_[_0xb0c7('0x34')](_0x48c20b[_0xb0c7('0x44')],{'$or':_[_0xb0c7('0x20')](_0x48c20b['attributes'],function(_0x3d23a5){var _0x3f88f0={};_0x3f88f0[_0x3d23a5]={'$like':'%'+_0xa5897['query'][_0xb0c7('0x46')]+'%'};return _0x3f88f0;})});}if(_0xa5897[_0xb0c7('0x2c')][_0xb0c7('0x47')]){var _0x440463=_0xa5897[_0xb0c7('0x2c')]['$gte'][_0xb0c7('0x48')](',');var _0x3378ac={};_0x3378ac[_0x440463[0x0]]={'$gte':moment(_0x440463[0x1])[_0xb0c7('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x48c20b[_0xb0c7('0x44')]=_['merge'](_0x48c20b[_0xb0c7('0x44')],_0x3378ac);}_0x48c20b=_[_0xb0c7('0x34')]({},_0x48c20b,_0xa5897[_0xb0c7('0x35')]);return db[_0xb0c7('0x3c')][_0xb0c7('0x17')]({'where':_0x48c20b[_0xb0c7('0x44')]})[_0xb0c7('0x1b')](function(_0x3e3da0){_0x385c80[_0xb0c7('0x17')]=_0x3e3da0;if(_0xa5897[_0xb0c7('0x2c')]['includeAll']){_0x48c20b[_0xb0c7('0x33')]=[{'all':!![]}];}return db[_0xb0c7('0x3c')]['findAll'](_0x48c20b);})['then'](function(_0xffab9a){_0x385c80[_0xb0c7('0x4a')]=_0xffab9a;return _0x385c80;});}})[_0xb0c7('0x1b')](respondWithFilteredResult(_0x57c4d7,_0x48c20b))[_0xb0c7('0x28')](handleError(_0x57c4d7,null));};exports[_0xb0c7('0x4b')]=function(_0x139e9f,_0x36843d){return db[_0xb0c7('0x21')][_0xb0c7('0x36')]({'where':{'id':_0x139e9f[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x36843d,null))['then'](function(_0x5d0913){if(_0x5d0913){return _0x5d0913['setTags'](_0x139e9f[_0xb0c7('0x38')][_0xb0c7('0x3d')],_[_0xb0c7('0x3e')](_0x139e9f[_0xb0c7('0x38')],[_0xb0c7('0x3d'),'id'])||{})[_0xb0c7('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb0c7('0x1d'),_0xb0c7('0x4d')],'where':{'id':_0x139e9f[_0xb0c7('0x38')]['ids']}});})[_0xb0c7('0x1b')](function(_0xaa6135){socket['emit']('smsInteractionTags:save',{'id':Number(_0x139e9f['params']['id']),'tags':_0xaa6135||[]});return{'id':Number(_0x139e9f[_0xb0c7('0x39')]['id']),'tags':_0xaa6135||[]};});}})[_0xb0c7('0x1b')](respondWithResult(_0x36843d,null))[_0xb0c7('0x28')](handleError(_0x36843d,null));};exports[_0xb0c7('0x4e')]=function(_0x4b6b4c,_0x1bade3){return db[_0xb0c7('0x21')][_0xb0c7('0x36')]({'where':{'id':_0x4b6b4c[_0xb0c7('0x39')]['id']}})['then'](handleEntityNotFound(_0x1bade3,null))[_0xb0c7('0x1b')](function(_0x286ebc){if(_0x286ebc){return _0x286ebc[_0xb0c7('0x4e')](_0x4b6b4c['query'][_0xb0c7('0x3d')]);}})[_0xb0c7('0x1b')](respondWithStatusCode(_0x1bade3,null))['catch'](handleError(_0x1bade3,null));};exports[_0xb0c7('0x4f')]=function(_0x578cae,_0x344ff6){var _0x30f094=moment()[_0xb0c7('0x50')]()[_0xb0c7('0x51')]();var _0x5f5bb9=path[_0xb0c7('0x52')](config['root'],_0xb0c7('0x53'),_0xb0c7('0x54'),_0xb0c7('0x55'));var _0x2688fe=path[_0xb0c7('0x52')](_0x5f5bb9,_0x30f094);var _0x511bb5=util[_0xb0c7('0x49')](_0xb0c7('0x56'),_0x578cae['params']['id'],_0x30f094);var _0x302be2=path[_0xb0c7('0x52')](_0x5f5bb9,_0x511bb5);var _0x37962f=[];_0x37962f[_0xb0c7('0x57')]({'model':db['User'],'as':_0xb0c7('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x37962f[_0xb0c7('0x57')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xb0c7('0x59')],'raw':!![]});var _0x36300b=[{'model':db['SmsMessage'],'as':_0xb0c7('0x5a'),'attributes':['id',_0xb0c7('0x38'),'createdAt',_0xb0c7('0x5b'),_0xb0c7('0x5c'),'read'],'include':_0x37962f}];_0x36300b['push']({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xb0c7('0x1d')]});_0x36300b['push']({'model':db[_0xb0c7('0x58')],'as':_0xb0c7('0x5d'),'attributes':['id','fullname']});return db[_0xb0c7('0x21')][_0xb0c7('0x36')]({'where':{'id':_0x578cae['params']['id']},'include':_0x36300b})['then'](handleEntityNotFound(_0x344ff6,null))[_0xb0c7('0x1b')](function(_0x1ef51b){if(_0x1ef51b){var _0x546480=_0x1ef51b[_0xb0c7('0x5e')]({'plain':!![]});fs[_0xb0c7('0x5f')](_0x2688fe);var _0x24409a={'channel':'Sms','account':_0x546480[_0xb0c7('0x60')][_0xb0c7('0x1d')],'agent':_0x546480[_0xb0c7('0x5d')]?_0x546480[_0xb0c7('0x5d')][_0xb0c7('0x61')]:_0xb0c7('0x62'),'createdAt':moment(_0x546480[_0xb0c7('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x546480[_0xb0c7('0x64')]?moment(_0x546480[_0xb0c7('0x65')])[_0xb0c7('0x49')](_0xb0c7('0x66'))[_0xb0c7('0x51')]():'','disposition':_0x546480[_0xb0c7('0x67')],'messages':_(_0x546480['Messages'])[_0xb0c7('0x46')]({'secret':![]})[_0xb0c7('0x20')](function(_0x291d6a){return{'date':moment(_0x291d6a[_0xb0c7('0x63')])[_0xb0c7('0x49')](_0xb0c7('0x66'))['toString'](),'sender':_0x291d6a[_0xb0c7('0x5b')]===_0xb0c7('0x68')?_0x291d6a[_0xb0c7('0x58')]?_0x291d6a['User'][_0xb0c7('0x61')]:_0xb0c7('0x69'):_0x291d6a[_0xb0c7('0x6a')][_0xb0c7('0x6b')]+(_0x291d6a[_0xb0c7('0x6a')]['lastName']?'\x20'+_0x291d6a[_0xb0c7('0x6a')][_0xb0c7('0x59')]:''),'body':_0x291d6a[_0xb0c7('0x38')],'direction':_0x291d6a[_0xb0c7('0x5b')]===_0xb0c7('0x68')?'A':'C','secret':_0x291d6a[_0xb0c7('0x5c')],'read':_0x291d6a['read']};})[_0xb0c7('0x6c')]()};return ejs[_0xb0c7('0x6d')](path[_0xb0c7('0x52')](config[_0xb0c7('0x6e')],_0xb0c7('0x53'),'views','downloadInteraction.ejs'),{'interaction':_0x24409a})[_0xb0c7('0x1b')](function(_0x284796){var _0x4d9e7b=path[_0xb0c7('0x52')](_0x2688fe,'transcript-'+_0x546480['id']+'-'+_0x30f094+'.pdf');var _0x3891ce={'path':_0x4d9e7b,'channel':_0xb0c7('0x6f'),'interactionId':_0x546480['id']};return pdf[_0xb0c7('0x70')](_0x284796,_0x3891ce);})[_0xb0c7('0x1b')](function(){return new BPromise(function(_0x226f51,_0x34915b){zipdir(_0x2688fe,{'saveTo':_0x302be2},function(_0x255ecc,_0x576bac){if(_0x255ecc)return _0x34915b(_0x255ecc);return _0x226f51(_0x576bac);});})[_0xb0c7('0x1b')](function(){return new BPromise(function(_0x2f1c5d,_0x14ee92){rimraf(_0x2688fe,function(_0x20fb47){if(_0x20fb47)_0x14ee92(_0x20fb47);return _0x2f1c5d();});});})['then'](function(){return _0x344ff6[_0xb0c7('0x4f')](_0x302be2,_0x511bb5,function(_0x4a325b){if(_0x4a325b){console[_0xb0c7('0x71')](_0xb0c7('0x72'),_0x4a325b);}else{fs[_0xb0c7('0x73')](_0x302be2);}});});});}else{return _0x344ff6[_0xb0c7('0x11')](0xc8);}})['catch'](handleError(_0x344ff6,null));};
\ No newline at end of file
+var _0x83ec=['direction','secret','Account','Owner','get','mkdirSync','Sms','N.A.','format','closed','closedAt','disposition','Messages','out','System','server','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','moment','path','ejs','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','SmsInteraction','create','body','find','destroy','describe','addMessage','ids','omit','getMessages','findOne','order','sort','where','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','include','SmsMessage','findAll','addTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','createdAt'];(function(_0x47794f,_0x12c9b3){var _0x2ca51d=function(_0x43deb3){while(--_0x43deb3){_0x47794f['push'](_0x47794f['shift']());}};_0x2ca51d(++_0x12c9b3);}(_0x83ec,0x8a));var _0xc83e=function(_0x2d9b24,_0xca30cd){_0x2d9b24=_0x2d9b24-0x0;var _0x1745e0=_0x83ec[_0x2d9b24];return _0x1745e0;};'use strict';var rimraf=require(_0xc83e('0x0'));var zipdir=require('zip-dir');var moment=require(_0xc83e('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xc83e('0x2'));var ejs=require(_0xc83e('0x3'));var fs=require('fs');var _=require(_0xc83e('0x4'));var Redis=require(_0xc83e('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xc83e('0x6'))(_0xc83e('0x7'));var config=require(_0xc83e('0x8'));var db=require(_0xc83e('0x9'))['db'];config['redis']=_[_0xc83e('0xa')](config[_0xc83e('0xb')],{'host':_0xc83e('0xc'),'port':0x18eb});var socket=require(_0xc83e('0xd'))(new Redis(config['redis']));require(_0xc83e('0xe'))[_0xc83e('0xf')](socket);function respondWithStatusCode(_0x3e8f68,_0x5bcace){_0x5bcace=_0x5bcace||0xcc;return function(_0x331208){if(_0x331208){return _0x3e8f68[_0xc83e('0x10')](_0x5bcace);}return _0x3e8f68[_0xc83e('0x11')](_0x5bcace)[_0xc83e('0x12')]();};}function respondWithResult(_0x35f59b,_0x33f1a3){_0x33f1a3=_0x33f1a3||0xc8;return function(_0x321efd){if(_0x321efd){return _0x35f59b[_0xc83e('0x11')](_0x33f1a3)[_0xc83e('0x13')](_0x321efd);}};}function respondWithFilteredResult(_0x14aea5,_0x1b93be){return function(_0x47707c){if(_0x47707c){var _0x281e93=typeof _0x1b93be[_0xc83e('0x14')]==='undefined'&&typeof _0x1b93be['limit']===_0xc83e('0x15');var _0x728f3b=_0x47707c['count'];var _0x4a47e5=_0x281e93?0x0:_0x1b93be[_0xc83e('0x14')];var _0x389dd5=_0x281e93?_0x47707c['count']:_0x1b93be['offset']+_0x1b93be[_0xc83e('0x16')];var _0x12716b;if(_0x389dd5>=_0x728f3b){_0x389dd5=_0x728f3b;_0x12716b=0xc8;}else{_0x12716b=0xce;}_0x14aea5[_0xc83e('0x11')](_0x12716b);return _0x14aea5['set'](_0xc83e('0x17'),_0x4a47e5+'-'+_0x389dd5+'/'+_0x728f3b)[_0xc83e('0x13')](_0x47707c);}return null;};}function saveUpdates(_0x2a77a7){return function(_0x25d7fd){if(_0x25d7fd){return _0x25d7fd[_0xc83e('0x18')](_0x2a77a7)[_0xc83e('0x19')](function(_0x153b29){return _0x153b29;});}return null;};}function removeEntity(_0xa2ab15){return function(_0x2b87e6){if(_0x2b87e6){return _0x2b87e6['destroy']()['then'](function(){_0xa2ab15[_0xc83e('0x11')](0xcc)[_0xc83e('0x12')]();});}};}function handleEntityNotFound(_0x2d2ef3){return function(_0x36d453){if(!_0x36d453){_0x2d2ef3[_0xc83e('0x10')](0x194);}return _0x36d453;};}function handleError(_0x9913f,_0x4ab549){_0x4ab549=_0x4ab549||0x1f4;return function(_0x28113e){logger[_0xc83e('0x1a')](_0x28113e[_0xc83e('0x1b')]);if(_0x28113e[_0xc83e('0x1c')]){delete _0x28113e[_0xc83e('0x1c')];}_0x9913f['status'](_0x4ab549)['send'](_0x28113e);};}exports[_0xc83e('0x1d')]=function(_0x547cb9,_0x2315c3){var _0x4cc8b7={};var _0x4055c1=_[_0xc83e('0x1e')](db['SmsInteraction'][_0xc83e('0x1f')],function(_0x52739c){return{'name':_0x52739c[_0xc83e('0x20')],'type':_0x52739c['type'][_0xc83e('0x21')]};});_0x4cc8b7=qs['getOptions'](_0x4055c1,_0x547cb9);return interaction['findAll']('sms',_0x547cb9[_0xc83e('0x22')],_0x547cb9[_0xc83e('0x23')],_0x4cc8b7,_0x4055c1)[_0xc83e('0x19')](respondWithFilteredResult(_0x2315c3,_0x4cc8b7))[_0xc83e('0x24')](handleError(_0x2315c3,null));};exports[_0xc83e('0x25')]=function(_0xaea5d4,_0x3051de){var _0x5c9116={'raw':![],'where':{'id':_0xaea5d4[_0xc83e('0x26')]['id']}},_0x1921b5={};_0x1921b5[_0xc83e('0x27')]=_[_0xc83e('0x28')](db['SmsInteraction']['rawAttributes']);_0x1921b5[_0xc83e('0x22')]=_[_0xc83e('0x28')](_0xaea5d4[_0xc83e('0x22')]);_0x1921b5[_0xc83e('0x29')]=_[_0xc83e('0x2a')](_0x1921b5[_0xc83e('0x27')],_0x1921b5['query']);_0x5c9116[_0xc83e('0x2b')]=_[_0xc83e('0x2a')](_0x1921b5[_0xc83e('0x27')],qs[_0xc83e('0x2c')](_0xaea5d4[_0xc83e('0x22')]['fields']));_0x5c9116[_0xc83e('0x2b')]=_0x5c9116[_0xc83e('0x2b')][_0xc83e('0x2d')]?_0x5c9116['attributes']:_0x1921b5[_0xc83e('0x27')];if(_0xaea5d4[_0xc83e('0x22')][_0xc83e('0x2e')]){_0x5c9116['include']=[{'all':!![]}];}_0x5c9116=_[_0xc83e('0x2f')]({},_0x5c9116,_0xaea5d4[_0xc83e('0x30')]);return db[_0xc83e('0x31')]['find'](_0x5c9116)[_0xc83e('0x19')](handleEntityNotFound(_0x3051de,null))[_0xc83e('0x19')](respondWithResult(_0x3051de,null))[_0xc83e('0x24')](handleError(_0x3051de,null));};exports[_0xc83e('0x32')]=function(_0x500cae,_0x134ec1){return db['SmsInteraction'][_0xc83e('0x32')](_0x500cae[_0xc83e('0x33')],{})[_0xc83e('0x19')](respondWithResult(_0x134ec1,0xc9))['catch'](handleError(_0x134ec1,null));};exports[_0xc83e('0x18')]=function(_0x234d19,_0x3fe415){if(_0x234d19[_0xc83e('0x33')]['id']){delete _0x234d19[_0xc83e('0x33')]['id'];}return db[_0xc83e('0x31')][_0xc83e('0x34')]({'where':{'id':_0x234d19[_0xc83e('0x26')]['id']}})[_0xc83e('0x19')](handleEntityNotFound(_0x3fe415,null))[_0xc83e('0x19')](saveUpdates(_0x234d19['body'],null))[_0xc83e('0x19')](respondWithResult(_0x3fe415,null))[_0xc83e('0x24')](handleError(_0x3fe415,null));};exports[_0xc83e('0x35')]=function(_0x104496,_0x39740f){return db['SmsInteraction'][_0xc83e('0x34')]({'where':{'id':_0x104496[_0xc83e('0x26')]['id']}})[_0xc83e('0x19')](handleEntityNotFound(_0x39740f,null))[_0xc83e('0x19')](removeEntity(_0x39740f,null))[_0xc83e('0x24')](handleError(_0x39740f,null));};exports[_0xc83e('0x36')]=function(_0xff1bdf,_0x35c144){return db['SmsInteraction'][_0xc83e('0x36')]()[_0xc83e('0x19')](respondWithResult(_0x35c144,null))['catch'](handleError(_0x35c144,null));};exports[_0xc83e('0x37')]=function(_0x51e640,_0x1ef1f5){return db['SmsMessage'][_0xc83e('0x34')]({'where':{'id':_0x51e640[_0xc83e('0x26')]['id']}})['then'](handleEntityNotFound(_0x1ef1f5,null))['then'](function(_0x51ba6c){if(_0x51ba6c){return _0x51ba6c['addMessage'](_0x51e640[_0xc83e('0x33')][_0xc83e('0x38')],_[_0xc83e('0x39')](_0x51e640[_0xc83e('0x33')],['ids','id'])||{});}})[_0xc83e('0x19')](respondWithResult(_0x1ef1f5,null))[_0xc83e('0x24')](handleError(_0x1ef1f5,null));};exports[_0xc83e('0x3a')]=function(_0xeda740,_0x3aa555){var _0x4440dd={'raw':![],'where':{}};var _0x1cc771={};var _0x2c6451={'count':0x0,'rows':[]};return db[_0xc83e('0x31')][_0xc83e('0x3b')]({'where':{'id':_0xeda740['params']['id']}})[_0xc83e('0x19')](handleEntityNotFound(_0x3aa555,null))[_0xc83e('0x19')](function(_0x2535ae){if(_0x2535ae){_0x1cc771[_0xc83e('0x27')]=_['keys'](db['SmsMessage'][_0xc83e('0x1f')]);_0x1cc771[_0xc83e('0x22')]=_[_0xc83e('0x28')](_0xeda740[_0xc83e('0x22')]);_0x1cc771['filters']=_[_0xc83e('0x2a')](_0x1cc771[_0xc83e('0x27')],_0x1cc771[_0xc83e('0x22')]);_0x4440dd['attributes']=_['intersection'](_0x1cc771[_0xc83e('0x27')],qs[_0xc83e('0x2c')](_0xeda740['query'][_0xc83e('0x2c')]));_0x4440dd[_0xc83e('0x2b')]=_0x4440dd['attributes'][_0xc83e('0x2d')]?_0x4440dd['attributes']:_0x1cc771['model'];if(!_0xeda740[_0xc83e('0x22')]['hasOwnProperty']('nolimit')){_0x4440dd['limit']=qs['limit'](_0xeda740[_0xc83e('0x22')][_0xc83e('0x16')]);_0x4440dd[_0xc83e('0x14')]=qs['offset'](_0xeda740[_0xc83e('0x22')]['offset']);}_0x4440dd[_0xc83e('0x3c')]=qs[_0xc83e('0x3d')](_0xeda740[_0xc83e('0x22')]['sort']);_0x4440dd[_0xc83e('0x3e')]=qs['filters'](_['pick'](_0xeda740[_0xc83e('0x22')],_0x1cc771[_0xc83e('0x29')]));_0x4440dd['where'][_0xc83e('0x3f')]=_0x2535ae['id'];if(_0xeda740[_0xc83e('0x22')][_0xc83e('0x40')]){_0x4440dd['where']=_[_0xc83e('0x2f')](_0x4440dd[_0xc83e('0x3e')],{'$or':_['map'](_0x4440dd[_0xc83e('0x2b')],function(_0x32498c){var _0x447370={};_0x447370[_0x32498c]={'$like':'%'+_0xeda740[_0xc83e('0x22')][_0xc83e('0x40')]+'%'};return _0x447370;})});}if(_0xeda740[_0xc83e('0x22')][_0xc83e('0x41')]){var _0x298c67=_0xeda740[_0xc83e('0x22')][_0xc83e('0x41')][_0xc83e('0x42')](',');var _0x582814={};_0x582814[_0x298c67[0x0]]={'$gte':moment(_0x298c67[0x1])['format'](_0xc83e('0x43'))};_0x4440dd[_0xc83e('0x3e')]=_['merge'](_0x4440dd[_0xc83e('0x3e')],_0x582814);}_0x4440dd=_[_0xc83e('0x2f')]({},_0x4440dd,_0xeda740[_0xc83e('0x30')]);return db['SmsMessage']['count']({'where':_0x4440dd[_0xc83e('0x3e')]})[_0xc83e('0x19')](function(_0x4a8d80){_0x2c6451[_0xc83e('0x44')]=_0x4a8d80;if(_0xeda740[_0xc83e('0x22')][_0xc83e('0x2e')]){_0x4440dd[_0xc83e('0x45')]=[{'all':!![]}];}return db[_0xc83e('0x46')][_0xc83e('0x47')](_0x4440dd);})['then'](function(_0x3b39bf){_0x2c6451['rows']=_0x3b39bf;return _0x2c6451;});}})[_0xc83e('0x19')](respondWithFilteredResult(_0x3aa555,_0x4440dd))[_0xc83e('0x24')](handleError(_0x3aa555,null));};exports[_0xc83e('0x48')]=function(_0x3920a2,_0x300288){return db['SmsInteraction'][_0xc83e('0x34')]({'where':{'id':_0x3920a2[_0xc83e('0x26')]['id']}})[_0xc83e('0x19')](handleEntityNotFound(_0x300288,null))[_0xc83e('0x19')](function(_0x2a7eda){if(_0x2a7eda){return _0x2a7eda['setTags'](_0x3920a2[_0xc83e('0x33')][_0xc83e('0x38')],_[_0xc83e('0x39')](_0x3920a2[_0xc83e('0x33')],[_0xc83e('0x38'),'id'])||{})[_0xc83e('0x49')](function(){return db[_0xc83e('0x4a')][_0xc83e('0x47')]({'attributes':['id','name',_0xc83e('0x4b')],'where':{'id':_0x3920a2[_0xc83e('0x33')][_0xc83e('0x38')]}});})[_0xc83e('0x19')](function(_0x2845c1){socket[_0xc83e('0x4c')](_0xc83e('0x4d'),{'id':Number(_0x3920a2['params']['id']),'tags':_0x2845c1||[]});return{'id':Number(_0x3920a2[_0xc83e('0x26')]['id']),'tags':_0x2845c1||[]};});}})[_0xc83e('0x19')](respondWithResult(_0x300288,null))[_0xc83e('0x24')](handleError(_0x300288,null));};exports['removeTags']=function(_0x4ecc9c,_0x3c0442){return db[_0xc83e('0x31')][_0xc83e('0x34')]({'where':{'id':_0x4ecc9c[_0xc83e('0x26')]['id']}})[_0xc83e('0x19')](handleEntityNotFound(_0x3c0442,null))['then'](function(_0x15d1b5){if(_0x15d1b5){return _0x15d1b5[_0xc83e('0x4e')](_0x4ecc9c[_0xc83e('0x22')][_0xc83e('0x38')]);}})[_0xc83e('0x19')](respondWithStatusCode(_0x3c0442,null))[_0xc83e('0x24')](handleError(_0x3c0442,null));};exports[_0xc83e('0x4f')]=function(_0x56c04b,_0x1895bb){var _0x552242=moment()[_0xc83e('0x50')]()[_0xc83e('0x51')]();var _0xa45126=path[_0xc83e('0x52')](config[_0xc83e('0x53')],'server','files',_0xc83e('0x54'));var _0x2bae70=path[_0xc83e('0x52')](_0xa45126,_0x552242);var _0x47c375=util['format'](_0xc83e('0x55'),_0x56c04b[_0xc83e('0x26')]['id'],_0x552242);var _0xa2b5fa=path[_0xc83e('0x52')](_0xa45126,_0x47c375);var _0xb37f26=[];_0xb37f26[_0xc83e('0x56')]({'model':db['User'],'as':_0xc83e('0x57'),'attributes':['id',_0xc83e('0x58')],'raw':!![]});_0xb37f26['push']({'model':db[_0xc83e('0x59')],'as':_0xc83e('0x5a'),'attributes':['id',_0xc83e('0x5b'),_0xc83e('0x5c')],'raw':!![]});var _0x3af5d6=[{'model':db[_0xc83e('0x46')],'as':'Messages','attributes':['id',_0xc83e('0x33'),_0xc83e('0x5d'),_0xc83e('0x5e'),_0xc83e('0x5f'),'read'],'include':_0xb37f26}];_0x3af5d6['push']({'model':db['SmsAccount'],'as':_0xc83e('0x60'),'attributes':['id',_0xc83e('0x1c')]});_0x3af5d6[_0xc83e('0x56')]({'model':db[_0xc83e('0x57')],'as':_0xc83e('0x61'),'attributes':['id',_0xc83e('0x58')]});return db['SmsInteraction'][_0xc83e('0x34')]({'where':{'id':_0x56c04b[_0xc83e('0x26')]['id']},'include':_0x3af5d6})[_0xc83e('0x19')](handleEntityNotFound(_0x1895bb,null))[_0xc83e('0x19')](function(_0x5d20b3){if(_0x5d20b3){var _0x4b6ee4=_0x5d20b3[_0xc83e('0x62')]({'plain':!![]});fs[_0xc83e('0x63')](_0x2bae70);var _0x4b9adc={'channel':_0xc83e('0x64'),'account':_0x4b6ee4[_0xc83e('0x60')][_0xc83e('0x1c')],'agent':_0x4b6ee4['Owner']?_0x4b6ee4[_0xc83e('0x61')][_0xc83e('0x58')]:_0xc83e('0x65'),'createdAt':moment(_0x4b6ee4[_0xc83e('0x5d')])[_0xc83e('0x66')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc83e('0x51')](),'closedAt':_0x4b6ee4[_0xc83e('0x67')]?moment(_0x4b6ee4[_0xc83e('0x68')])[_0xc83e('0x66')](_0xc83e('0x43'))['toString']():'','disposition':_0x4b6ee4[_0xc83e('0x69')],'messages':_(_0x4b6ee4[_0xc83e('0x6a')])['filter']({'secret':![]})[_0xc83e('0x1e')](function(_0x3dd7d7){return{'date':moment(_0x3dd7d7[_0xc83e('0x5d')])[_0xc83e('0x66')](_0xc83e('0x43'))[_0xc83e('0x51')](),'sender':_0x3dd7d7['direction']===_0xc83e('0x6b')?_0x3dd7d7[_0xc83e('0x57')]?_0x3dd7d7[_0xc83e('0x57')][_0xc83e('0x58')]:_0xc83e('0x6c'):_0x3dd7d7[_0xc83e('0x5a')][_0xc83e('0x5b')]+(_0x3dd7d7['Contact'][_0xc83e('0x5c')]?'\x20'+_0x3dd7d7['Contact'][_0xc83e('0x5c')]:''),'body':_0x3dd7d7[_0xc83e('0x33')],'direction':_0x3dd7d7[_0xc83e('0x5e')]===_0xc83e('0x6b')?'A':'C','secret':_0x3dd7d7[_0xc83e('0x5f')],'read':_0x3dd7d7['read']};})['value']()};return ejs['renderFile'](path['join'](config[_0xc83e('0x53')],_0xc83e('0x6d'),_0xc83e('0x6e'),'downloadInteraction.ejs'),{'interaction':_0x4b9adc})['then'](function(_0x4d877e){var _0x555976=path[_0xc83e('0x52')](_0x2bae70,_0xc83e('0x6f')+_0x4b6ee4['id']+'-'+_0x552242+_0xc83e('0x70'));var _0x1a6c26={'path':_0x555976,'channel':_0xc83e('0x64'),'interactionId':_0x4b6ee4['id']};return pdf[_0xc83e('0x71')](_0x4d877e,_0x1a6c26);})[_0xc83e('0x19')](function(){return new BPromise(function(_0x240d2c,_0x30982c){zipdir(_0x2bae70,{'saveTo':_0xa2b5fa},function(_0x48fcfb,_0x5b79d8){if(_0x48fcfb)return _0x30982c(_0x48fcfb);return _0x240d2c(_0x5b79d8);});})[_0xc83e('0x19')](function(){return new BPromise(function(_0x711875,_0x4994c5){rimraf(_0x2bae70,function(_0x22f339){if(_0x22f339)_0x4994c5(_0x22f339);return _0x711875();});});})[_0xc83e('0x19')](function(){return _0x1895bb['download'](_0xa2b5fa,_0x47c375,function(_0x88902e){if(_0x88902e){console['log'](_0xc83e('0x72'),_0x88902e);}else{fs[_0xc83e('0x73')](_0xa2b5fa);}});});});}else{return _0x1895bb[_0xc83e('0x10')](0xc8);}})[_0xc83e('0x24')](handleError(_0x1895bb,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x475094,_0x3e9c29){var _0x150dcc=function(_0x46768a){while(--_0x46768a){_0x475094['push'](_0x475094['shift']());}};_0x150dcc(++_0x3e9c29);}(_0x236c,0x155));var _0xc236=function(_0x429737,_0x31316d){_0x429737=_0x429737-0x0;var _0x22e8a4=_0x236c[_0x429737];return _0x22e8a4;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x32f4=['remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x5b875d,_0x1d664d){var _0x9b5eb5=function(_0x39decb){while(--_0x39decb){_0x5b875d['push'](_0x5b875d['shift']());}};_0x9b5eb5(++_0x1d664d);}(_0x32f4,0x154));var _0x432f=function(_0x286a37,_0xdfb27b){_0x286a37=_0x286a37-0x0;var _0x1aeeca=_0x32f4[_0x286a37];return _0x1aeeca;};'use strict';var EventEmitter=require(_0x432f('0x0'));var SmsInteraction=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var SmsMessage=require(_0x432f('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x432f('0x3')](0x0);var events={'afterCreate':_0x432f('0x4'),'afterUpdate':'update','afterDestroy':_0x432f('0x5')};function emitEvent(_0x1eabac){return function(_0x344a29,_0x355b02,_0x2f5f03){_0x344a29['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f66fd){_0x344a29[_0x432f('0x6')]('Users',_0x2f66fd[_0x432f('0x7')](function(_0x5aaf1a){return{'id':_0x5aaf1a['id']};}));return SmsMessage[_0x432f('0x8')]({'where':{'SmsInteractionId':_0x344a29['id'],'direction':'in','read':![]},'raw':!![]});})[_0x432f('0x9')](function(_0x3a0d4b){_0x344a29[_0x432f('0x6')](_0x432f('0xa'),_0x3a0d4b['length']);SmsInteractionEvents[_0x432f('0xb')](_0x1eabac+':'+_0x344a29['id'],_0x344a29);SmsInteractionEvents['emit'](_0x1eabac,_0x344a29);_0x2f5f03(null);})[_0x432f('0xc')](_0x2f5f03(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x432f('0xd')](e,emitEvent(event));}}module[_0x432f('0xe')]=SmsInteractionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ad1=['request-promise','rimraf','./smsInteraction.attributes','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x50fcfb,_0x2f1558){var _0x271dc4=function(_0x241862){while(--_0x241862){_0x50fcfb['push'](_0x50fcfb['shift']());}};_0x271dc4(++_0x2f1558);}(_0x2ad1,0x141));var _0x12ad=function(_0xc5ed9,_0x435e78){_0xc5ed9=_0xc5ed9-0x0;var _0x4c7db7=_0x2ad1[_0xc5ed9];return _0x4c7db7;};'use strict';var _=require('lodash');var util=require(_0x12ad('0x0'));var logger=require(_0x12ad('0x1'))(_0x12ad('0x2'));var moment=require(_0x12ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x12ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12ad('0x5'));var config=require('../../config/environment');var attributes=require(_0x12ad('0x6'));module['exports']=function(_0x31d42f,_0x30d2a4){return _0x31d42f[_0x12ad('0x7')](_0x12ad('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b4044,_0x1c3f1f,_0x3cb25d){if(_0x3b4044[_0x12ad('0x9')]('closed')){_0x3b4044[_0x12ad('0xa')]=moment()[_0x12ad('0xb')](_0x12ad('0xc'));}_0x3cb25d(null,_0x3b4044);}}});};
\ No newline at end of file
+var _0x6526=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed'];(function(_0x4b33ee,_0x179324){var _0x3142c6=function(_0x53d090){while(--_0x53d090){_0x4b33ee['push'](_0x4b33ee['shift']());}};_0x3142c6(++_0x179324);}(_0x6526,0x192));var _0x6652=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x6526[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0x6652('0x0'));var util=require(_0x6652('0x1'));var logger=require(_0x6652('0x2'))(_0x6652('0x3'));var moment=require('moment');var BPromise=require(_0x6652('0x4'));var rp=require(_0x6652('0x5'));var fs=require('fs');var path=require(_0x6652('0x6'));var rimraf=require(_0x6652('0x7'));var config=require('../../config/environment');var attributes=require(_0x6652('0x8'));module[_0x6652('0x9')]=function(_0x324914,_0x59d824){return _0x324914[_0x6652('0xa')](_0x6652('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47d20d,_0x54bfd2,_0x14990d){if(_0x47d20d[_0x6652('0xc')](_0x6652('0xd'))){_0x47d20d['closedAt']=moment()[_0x6652('0xe')](_0x6652('0xf'));}_0x14990d(null,_0x47d20d);}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ea1=['randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','limit','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird'];(function(_0x1bd3a2,_0x6b37a7){var _0x1bb4b7=function(_0x2376f9){while(--_0x2376f9){_0x1bd3a2['push'](_0x1bd3a2['shift']());}};_0x1bb4b7(++_0x6b37a7);}(_0x9ea1,0x15b));var _0x19ea=function(_0x195cb2,_0x250e8d){_0x195cb2=_0x195cb2-0x0;var _0x1b45ea=_0x9ea1[_0x195cb2];return _0x1b45ea;};'use strict';var _=require(_0x19ea('0x0'));var util=require(_0x19ea('0x1'));var moment=require(_0x19ea('0x2'));var BPromise=require(_0x19ea('0x3'));var rs=require(_0x19ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ea('0x5'))['db'];var utils=require(_0x19ea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x19ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x19ea('0x8')][_0x19ea('0x9')]({'port':0x232a});config[_0x19ea('0xa')]=_['defaults'](config[_0x19ea('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x19ea('0xb'))(new Redis(config[_0x19ea('0xa')]));require(_0x19ea('0xc'))[_0x19ea('0xd')](socket);function respondWithRpcPromise(_0xaa9448,_0x50e328,_0x13f3ff){return new BPromise(function(_0x535b23,_0x5d6e5f){return client[_0x19ea('0xe')](_0xaa9448,_0x13f3ff)[_0x19ea('0xf')](function(_0x5c68ae){logger[_0x19ea('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x50e328,_0x19ea('0x11'));logger[_0x19ea('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x50e328,_0x19ea('0x11'),JSON[_0x19ea('0x13')](_0x5c68ae));if(_0x5c68ae[_0x19ea('0x14')]){if(_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x15')]===0x1f4){logger['error'](_0x19ea('0x16'),_0x50e328,_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);return _0x5d6e5f(_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);}logger[_0x19ea('0x14')](_0x19ea('0x16'),_0x50e328,_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);return _0x535b23(_0x5c68ae[_0x19ea('0x14')][_0x19ea('0x17')]);}else{logger['info'](_0x19ea('0x16'),_0x50e328,'request\x20sent');_0x535b23(_0x5c68ae[_0x19ea('0x18')][_0x19ea('0x17')]);}})[_0x19ea('0x19')](function(_0x22fa38){logger[_0x19ea('0x14')](_0x19ea('0x16'),_0x50e328,_0x22fa38);_0x5d6e5f(_0x22fa38);});});}exports[_0x19ea('0x1a')]=function(_0x28cae4){var _0x2ab510=this;return new Promise(function(_0x996016,_0x9cf439){return db[_0x19ea('0x1b')][_0x19ea('0x1c')](_0x28cae4[_0x19ea('0x1d')],{'raw':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4[_0x19ea('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4['options'][_0x19ea('0x1f')]||null:null,'attributes':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4['options']['attributes']||null:null,'limit':_0x28cae4[_0x19ea('0x1e')]?_0x28cae4[_0x19ea('0x1e')][_0x19ea('0x20')]||null:null})['then'](function(_0x5bf42b){logger[_0x19ea('0x10')](_0x19ea('0x1a'),_0x28cae4);logger[_0x19ea('0x12')](_0x19ea('0x1a'),_0x28cae4,JSON[_0x19ea('0x13')](_0x5bf42b));_0x996016(_0x5bf42b);})[_0x19ea('0x19')](function(_0x479f86){logger[_0x19ea('0x14')](_0x19ea('0x1a'),_0x479f86[_0x19ea('0x17')],_0x28cae4);_0x9cf439(_0x2ab510['error'](0x1f4,_0x479f86[_0x19ea('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x4dc7d1){return new Promise(function(_0x4154b6,_0x47360a){return db[_0x19ea('0x1b')][_0x19ea('0x21')]({'where':_0x4dc7d1[_0x19ea('0x1e')]?_0x4dc7d1[_0x19ea('0x1e')]['where']||null:null})[_0x19ea('0xf')](function(_0x159e06){if(_0x159e06){return _0x159e06[_0x19ea('0x22')](_0x4dc7d1['body']['ids'],_[_0x19ea('0x23')](_0x4dc7d1[_0x19ea('0x1d')],[_0x19ea('0x24'),'id'])||{});}})[_0x19ea('0x25')](function(_0x3b881a){logger[_0x19ea('0x10')](_0x19ea('0x26'),_0x4dc7d1);logger[_0x19ea('0x12')](_0x19ea('0x26'),_0x4dc7d1,JSON[_0x19ea('0x13')](_0x3b881a));_0x4154b6(_0x3b881a);})[_0x19ea('0x19')](function(_0x431585){logger[_0x19ea('0x14')](_0x19ea('0x26'),_0x431585[_0x19ea('0x17')],_0x4dc7d1);_0x47360a(_this[_0x19ea('0x14')](0x1f4,_0x431585['message']));});});};
\ No newline at end of file
+var _0xe487=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','body','raw','options','attributes','limit','then','info','AddTagsToSmsInteraction','find','where','ids','omit','AddTags','lodash','util','moment'];(function(_0x291ca9,_0x32c76e){var _0x38fe66=function(_0x2823ff){while(--_0x2823ff){_0x291ca9['push'](_0x291ca9['shift']());}};_0x38fe66(++_0x32c76e);}(_0xe487,0x1b5));var _0x7e48=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe487[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e48('0x0'));var util=require(_0x7e48('0x1'));var moment=require(_0x7e48('0x2'));var BPromise=require(_0x7e48('0x3'));var rs=require(_0x7e48('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e48('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e48('0x6'))(_0x7e48('0x7'));var config=require(_0x7e48('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e48('0x9')][_0x7e48('0xa')]({'port':0x232a});config['redis']=_[_0x7e48('0xb')](config['redis'],{'host':_0x7e48('0xc'),'port':0x18eb});var socket=require(_0x7e48('0xd'))(new Redis(config[_0x7e48('0xe')]));require(_0x7e48('0xf'))[_0x7e48('0x10')](socket);function respondWithRpcPromise(_0x370af0,_0xeb6c16,_0x5bc236){return new BPromise(function(_0x2beade,_0x13b49c){return client['request'](_0x370af0,_0x5bc236)['then'](function(_0x20b14c){logger['info'](_0x7e48('0x11'),_0xeb6c16,_0x7e48('0x12'));logger[_0x7e48('0x13')](_0x7e48('0x14'),_0xeb6c16,'request\x20sent',JSON[_0x7e48('0x15')](_0x20b14c));if(_0x20b14c[_0x7e48('0x16')]){if(_0x20b14c[_0x7e48('0x16')]['code']===0x1f4){logger[_0x7e48('0x16')](_0x7e48('0x11'),_0xeb6c16,_0x20b14c[_0x7e48('0x16')][_0x7e48('0x17')]);return _0x13b49c(_0x20b14c[_0x7e48('0x16')][_0x7e48('0x17')]);}logger[_0x7e48('0x16')]('SmsInteraction,\x20%s,\x20%s',_0xeb6c16,_0x20b14c['error']['message']);return _0x2beade(_0x20b14c[_0x7e48('0x16')][_0x7e48('0x17')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0xeb6c16,_0x7e48('0x12'));_0x2beade(_0x20b14c[_0x7e48('0x18')][_0x7e48('0x17')]);}})[_0x7e48('0x19')](function(_0x3222d2){logger['error'](_0x7e48('0x11'),_0xeb6c16,_0x3222d2);_0x13b49c(_0x3222d2);});});}exports[_0x7e48('0x1a')]=function(_0x3de222){var _0x3b9a7f=this;return new Promise(function(_0x448662,_0x3e5d95){return db['SmsInteraction']['update'](_0x3de222[_0x7e48('0x1b')],{'raw':_0x3de222['options']?_0x3de222['options'][_0x7e48('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3de222[_0x7e48('0x1d')]?_0x3de222[_0x7e48('0x1d')]['where']||null:null,'attributes':_0x3de222[_0x7e48('0x1d')]?_0x3de222[_0x7e48('0x1d')][_0x7e48('0x1e')]||null:null,'limit':_0x3de222[_0x7e48('0x1d')]?_0x3de222['options'][_0x7e48('0x1f')]||null:null})[_0x7e48('0x20')](function(_0x3da493){logger[_0x7e48('0x21')]('UpdateSmsInteraction',_0x3de222);logger['debug'](_0x7e48('0x1a'),_0x3de222,JSON[_0x7e48('0x15')](_0x3da493));_0x448662(_0x3da493);})[_0x7e48('0x19')](function(_0x1ede04){logger[_0x7e48('0x16')](_0x7e48('0x1a'),_0x1ede04[_0x7e48('0x17')],_0x3de222);_0x3e5d95(_0x3b9a7f[_0x7e48('0x16')](0x1f4,_0x1ede04[_0x7e48('0x17')]));});});};exports[_0x7e48('0x22')]=function(_0x59ec8b){return new Promise(function(_0x59e6ed,_0x24dc2d){return db['SmsInteraction'][_0x7e48('0x23')]({'where':_0x59ec8b[_0x7e48('0x1d')]?_0x59ec8b[_0x7e48('0x1d')][_0x7e48('0x24')]||null:null})[_0x7e48('0x20')](function(_0x4be611){if(_0x4be611){return _0x4be611['addTags'](_0x59ec8b['body'][_0x7e48('0x25')],_[_0x7e48('0x26')](_0x59ec8b['body'],['ids','id'])||{});}})['spread'](function(_0x1adea7){logger['info']('AddTags',_0x59ec8b);logger[_0x7e48('0x13')](_0x7e48('0x27'),_0x59ec8b,JSON[_0x7e48('0x15')](_0x1adea7));_0x59e6ed(_0x1adea7);})[_0x7e48('0x19')](function(_0x2a3f62){logger[_0x7e48('0x16')](_0x7e48('0x27'),_0x2a3f62[_0x7e48('0x17')],_0x59ec8b);_0x24dc2d(_this[_0x7e48('0x16')](0x1f4,_0x2a3f62[_0x7e48('0x17')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8481=['register','length','smsInteraction:','save','remove'];(function(_0x261832,_0x5a24e6){var _0x186143=function(_0x54e5d8){while(--_0x54e5d8){_0x261832['push'](_0x261832['shift']());}};_0x186143(++_0x5a24e6);}(_0x8481,0x157));var _0x1848=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x8481[_0x2389bc];return _0x170548;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x1848('0x0'),_0x1848('0x1'),'update'];function createListener(_0x1a4afa,_0x2041ba){return function(_0x583af7){_0x2041ba['emit'](_0x1a4afa,_0x583af7);};}function removeListener(_0x1503a7,_0x4042fb){return function(){SmsInteractionEvents['removeListener'](_0x1503a7,_0x4042fb);};}exports[_0x1848('0x2')]=function(_0x4c8f1c){for(var _0x51fe4a=0x0,_0x3df820=events[_0x1848('0x3')];_0x51fe4a<_0x3df820;_0x51fe4a++){var _0x1bdbc2=events[_0x51fe4a];var _0x424209=createListener(_0x1848('0x4')+_0x1bdbc2,_0x4c8f1c);SmsInteractionEvents['on'](_0x1bdbc2,_0x424209);}};
\ No newline at end of file
+var _0x0f95=['save','update','emit','removeListener','length','./smsInteraction.events'];(function(_0xb41998,_0x9b24eb){var _0x4a8abe=function(_0x1591c9){while(--_0x1591c9){_0xb41998['push'](_0xb41998['shift']());}};_0x4a8abe(++_0x9b24eb);}(_0x0f95,0xa1));var _0x50f9=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x0f95[_0x35da42];return _0x370035;};'use strict';var SmsInteractionEvents=require(_0x50f9('0x0'));var events=[_0x50f9('0x1'),'remove',_0x50f9('0x2')];function createListener(_0x37162a,_0x2cec50){return function(_0x338e2d){_0x2cec50[_0x50f9('0x3')](_0x37162a,_0x338e2d);};}function removeListener(_0x1deb63,_0xc2ae8){return function(){SmsInteractionEvents[_0x50f9('0x4')](_0x1deb63,_0xc2ae8);};}exports['register']=function(_0x3298f1){for(var _0x1ffcdf=0x0,_0x5b0d68=events[_0x50f9('0x5')];_0x1ffcdf<_0x5b0d68;_0x1ffcdf++){var _0x2f674a=events[_0x1ffcdf];var _0x4dcca=createListener('smsInteraction:'+_0x2f674a,_0x3298f1);SmsInteractionEvents['on'](_0x2f674a,_0x4dcca);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c13=['./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','tracked','sms','create','post','/:id/status','status','put','update','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x490bab,_0x2113d0){var _0x35c724=function(_0x26a753){while(--_0x26a753){_0x490bab['push'](_0x490bab['shift']());}};_0x35c724(++_0x2113d0);}(_0x7c13,0xfd));var _0x37c1=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0x7c13[_0x4057f9];return _0x5552b7;};'use strict';var multer=require(_0x37c1('0x0'));var util=require(_0x37c1('0x1'));var path=require('path');var timeout=require(_0x37c1('0x2'));var express=require(_0x37c1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37c1('0x4'));var interaction=require(_0x37c1('0x5'));var config=require(_0x37c1('0x6'));var controller=require(_0x37c1('0x7'));router[_0x37c1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x37c1('0x9'),auth[_0x37c1('0xa')](),controller[_0x37c1('0xb')]);router['get'](_0x37c1('0xc'),auth[_0x37c1('0xa')](),controller['show']);router['post']('/',auth[_0x37c1('0xa')](),interaction[_0x37c1('0xd')](_0x37c1('0xe'),'smsmessage:create'),controller[_0x37c1('0xf')]);router[_0x37c1('0x10')](_0x37c1('0x11'),controller[_0x37c1('0x12')]);router[_0x37c1('0x13')]('/:id',auth[_0x37c1('0xa')](),controller[_0x37c1('0x14')]);router[_0x37c1('0x13')]('/:id/accept',auth[_0x37c1('0xa')](),controller[_0x37c1('0x15')]);router['put'](_0x37c1('0x16'),auth[_0x37c1('0xa')](),controller[_0x37c1('0x17')]);router[_0x37c1('0x18')](_0x37c1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x37c1('0x19')]=router;
\ No newline at end of file
+var _0x370f=['put','/:id/accept','accept','reject','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','show','post','isAuthenticated','tracked','sms','create','/:id/status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x370f,0x132));var _0xf370=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0x370f[_0x542d80];return _0x1f4492;};'use strict';var multer=require(_0xf370('0x0'));var util=require(_0xf370('0x1'));var path=require(_0xf370('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf370('0x3')]();var fs_extra=require(_0xf370('0x4'));var auth=require(_0xf370('0x5'));var interaction=require(_0xf370('0x6'));var config=require(_0xf370('0x7'));var controller=require('./smsMessage.controller');router[_0xf370('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf370('0x8')](_0xf370('0x9'),auth['isAuthenticated'](),controller[_0xf370('0xa')]);router[_0xf370('0x8')](_0xf370('0xb'),auth['isAuthenticated'](),controller[_0xf370('0xc')]);router[_0xf370('0xd')]('/',auth[_0xf370('0xe')](),interaction[_0xf370('0xf')](_0xf370('0x10'),'smsmessage:create'),controller[_0xf370('0x11')]);router[_0xf370('0xd')](_0xf370('0x12'),controller['status']);router[_0xf370('0x13')](_0xf370('0xb'),auth[_0xf370('0xe')](),controller['update']);router[_0xf370('0x13')](_0xf370('0x14'),auth[_0xf370('0xe')](),controller[_0xf370('0x15')]);router[_0xf370('0x13')]('/:id/reject',auth[_0xf370('0xe')](),controller[_0xf370('0x16')]);router[_0xf370('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf370('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0411=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x476504,_0x24727e){var _0xa3f7a2=function(_0x4090b1){while(--_0x4090b1){_0x476504['push'](_0x476504['shift']());}};_0xa3f7a2(++_0x24727e);}(_0x0411,0x15d));var _0x1041=function(_0x2b7e9c,_0x236531){_0x2b7e9c=_0x2b7e9c-0x0;var _0x39ac82=_0x0411[_0x2b7e9c];return _0x39ac82;};'use strict';var Sequelize=require(_0x1041('0x0'));module[_0x1041('0x1')]={'body':{'type':Sequelize[_0x1041('0x2')](_0x1041('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1041('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1041('0x5')]('in',_0x1041('0x6')),'defaultValue':_0x1041('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1041('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1041('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1041('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0b31=['TEXT','BOOLEAN','out','STRING','DATE','sequelize','exports'];(function(_0x43b186,_0xddd715){var _0x2766c7=function(_0x4bca8e){while(--_0x4bca8e){_0x43b186['push'](_0x43b186['shift']());}};_0x2766c7(++_0xddd715);}(_0x0b31,0x1a2));var _0x10b3=function(_0x1a873d,_0x1e1ec4){_0x1a873d=_0x1a873d-0x0;var _0x2d70f1=_0x0b31[_0x1a873d];return _0x2d70f1;};'use strict';var Sequelize=require(_0x10b3('0x0'));module[_0x10b3('0x1')]={'body':{'type':Sequelize[_0x10b3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x10b3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x10b3('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x10b3('0x5')](0xbe)},'phone':{'type':Sequelize[_0x10b3('0x5')]},'readAt':{'type':Sequelize[_0x10b3('0x6')]},'secret':{'type':Sequelize[_0x10b3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x10b3('0x5')]},'providerResponse':{'type':Sequelize[_0x10b3('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e69=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','fullname','internal','rejectmessage','SmsAccount','inspect','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','client','http','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','json','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','count','findAll','show','params','include','find','create','body','describe','sms-interactions','accept','sms','readAt','format'];(function(_0x490d09,_0x4d9eed){var _0x5a9666=function(_0x12672a){while(--_0x12672a){_0x490d09['push'](_0x490d09['shift']());}};_0x5a9666(++_0x4d9eed);}(_0x9e69,0x150));var _0x99e6=function(_0x56b3e7,_0x175766){_0x56b3e7=_0x56b3e7-0x0;var _0x4ccd6d=_0x9e69[_0x56b3e7];return _0x4ccd6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99e6('0x0'));var zipdir=require(_0x99e6('0x1'));var jsonpatch=require(_0x99e6('0x2'));var rp=require(_0x99e6('0x3'));var moment=require('moment');var BPromise=require(_0x99e6('0x4'));var Mustache=require(_0x99e6('0x5'));var util=require('util');var path=require(_0x99e6('0x6'));var sox=require(_0x99e6('0x7'));var csv=require(_0x99e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99e6('0x9'));var _=require(_0x99e6('0xa'));var squel=require(_0x99e6('0xb'));var crypto=require('crypto');var jsforce=require(_0x99e6('0xc'));var deskjs=require(_0x99e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x99e6('0xe'));var Papa=require(_0x99e6('0xf'));var Redis=require('ioredis');var authService=require(_0x99e6('0x10'));var qs=require(_0x99e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99e6('0x12'))(_0x99e6('0x13'));var utils=require(_0x99e6('0x14'));var config=require(_0x99e6('0x15'));var licenseUtil=require(_0x99e6('0x16'));var db=require(_0x99e6('0x17'))['db'];config['redis']=_[_0x99e6('0x18')](config[_0x99e6('0x19')],{'host':_0x99e6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99e6('0x19')]));require(_0x99e6('0x1b'))[_0x99e6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x99e6('0x1d')][_0x99e6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1d910a,_0x5d5cd5,_0x18fa86,_0x38fcdd){return new BPromise(function(_0xebfd62,_0x2ac3bd){var _0x3a302d=_0x38fcdd||client;return _0x3a302d['request'](_0x1d910a,_0x18fa86)[_0x99e6('0x1f')](function(_0x4e84f4){logger[_0x99e6('0x20')](_0x99e6('0x21'),_0x5d5cd5,'request\x20sent');logger[_0x99e6('0x22')](_0x99e6('0x23'),_0x5d5cd5,_0x99e6('0x24'),JSON[_0x99e6('0x25')](_0x4e84f4));if(_0x4e84f4[_0x99e6('0x26')]){if(_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x27')]===0x1f4){logger[_0x99e6('0x26')](_0x99e6('0x21'),_0x5d5cd5,_0x4e84f4[_0x99e6('0x26')]['message']);return _0x2ac3bd(_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x28')]);}logger[_0x99e6('0x26')](_0x99e6('0x21'),_0x5d5cd5,_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x28')]);return _0xebfd62(_0x4e84f4[_0x99e6('0x26')][_0x99e6('0x28')]);}else{logger[_0x99e6('0x20')](_0x99e6('0x21'),_0x5d5cd5,_0x99e6('0x24'));_0xebfd62(_0x4e84f4[_0x99e6('0x29')][_0x99e6('0x28')]);}})[_0x99e6('0x2a')](function(_0x210b02){logger[_0x99e6('0x26')](_0x99e6('0x21'),_0x5d5cd5,_0x210b02);_0x2ac3bd(_0x210b02);});});}function respondWithStatusCode(_0x57815a,_0x43038d){_0x43038d=_0x43038d||0xcc;return function(_0x5390b3){if(_0x5390b3){return _0x57815a[_0x99e6('0x2b')](_0x43038d);}return _0x57815a[_0x99e6('0x2c')](_0x43038d)[_0x99e6('0x2d')]();};}function respondWithResult(_0x52c7da,_0x3a1325){_0x3a1325=_0x3a1325||0xc8;return function(_0x5724bf){if(_0x5724bf){return _0x52c7da[_0x99e6('0x2c')](_0x3a1325)['json'](_0x5724bf);}};}function respondWithFilteredResult(_0x39ca5d,_0x46343f){return function(_0x4b58c7){if(_0x4b58c7){var _0x4d6b19=typeof _0x46343f[_0x99e6('0x2e')]===_0x99e6('0x2f')&&typeof _0x46343f[_0x99e6('0x30')]===_0x99e6('0x2f');var _0x3f821a=_0x4b58c7['count'];var _0x1220d7=_0x4d6b19?0x0:_0x46343f[_0x99e6('0x2e')];var _0x30f8ec=_0x4d6b19?_0x4b58c7['count']:_0x46343f['offset']+_0x46343f[_0x99e6('0x30')];var _0x51885f;if(_0x30f8ec>=_0x3f821a){_0x30f8ec=_0x3f821a;_0x51885f=0xc8;}else{_0x51885f=0xce;}_0x39ca5d['status'](_0x51885f);return _0x39ca5d[_0x99e6('0x31')]('Content-Range',_0x1220d7+'-'+_0x30f8ec+'/'+_0x3f821a)[_0x99e6('0x32')](_0x4b58c7);}return null;};}function patchUpdates(_0x34f671){return function(_0xf11b8){try{jsonpatch['apply'](_0xf11b8,_0x34f671,!![]);}catch(_0x46cd0a){return BPromise[_0x99e6('0x33')](_0x46cd0a);}return _0xf11b8[_0x99e6('0x34')]();};}function saveUpdates(_0x3f78a8,_0x5b1a1e){return function(_0x172940){if(_0x172940){return _0x172940[_0x99e6('0x35')](_0x3f78a8)[_0x99e6('0x1f')](function(_0x2a035a){return _0x2a035a;});}return null;};}function removeEntity(_0x754964,_0x40e298){return function(_0x4e16be){if(_0x4e16be){return _0x4e16be[_0x99e6('0x36')]()['then'](function(){_0x754964['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x290bfe,_0x2d8a0e){return function(_0x4cf592){if(!_0x4cf592){_0x290bfe[_0x99e6('0x2b')](0x194);}return _0x4cf592;};}function handleError(_0x66bcd3,_0x224449){_0x224449=_0x224449||0x1f4;return function(_0xcdc5a2){logger[_0x99e6('0x26')](_0xcdc5a2[_0x99e6('0x37')]);if(_0xcdc5a2['name']){delete _0xcdc5a2[_0x99e6('0x38')];}_0x66bcd3[_0x99e6('0x2c')](_0x224449)[_0x99e6('0x39')](_0xcdc5a2);};}exports[_0x99e6('0x3a')]=function(_0x579e74,_0x3cc682){var _0xd42d29={},_0x24b05c={},_0x1ea6dd={'count':0x0,'rows':[]};var _0x2c3587=_[_0x99e6('0x3b')](db[_0x99e6('0x3c')]['rawAttributes'],function(_0x4b888c){return{'name':_0x4b888c['fieldName'],'type':_0x4b888c[_0x99e6('0x3d')][_0x99e6('0x3e')]};});_0x24b05c['model']=_[_0x99e6('0x3b')](_0x2c3587,_0x99e6('0x38'));_0x24b05c[_0x99e6('0x3f')]=_[_0x99e6('0x40')](_0x579e74[_0x99e6('0x3f')]);_0x24b05c[_0x99e6('0x41')]=_[_0x99e6('0x42')](_0x24b05c[_0x99e6('0x43')],_0x24b05c[_0x99e6('0x3f')]);_0xd42d29[_0x99e6('0x44')]=_[_0x99e6('0x42')](_0x24b05c['model'],qs[_0x99e6('0x45')](_0x579e74[_0x99e6('0x3f')][_0x99e6('0x45')]));_0xd42d29[_0x99e6('0x44')]=_0xd42d29[_0x99e6('0x44')][_0x99e6('0x46')]?_0xd42d29[_0x99e6('0x44')]:_0x24b05c[_0x99e6('0x43')];if(!_0x579e74[_0x99e6('0x3f')]['hasOwnProperty']('nolimit')){_0xd42d29['limit']=qs['limit'](_0x579e74['query'][_0x99e6('0x30')]);_0xd42d29[_0x99e6('0x2e')]=qs['offset'](_0x579e74[_0x99e6('0x3f')][_0x99e6('0x2e')]);}_0xd42d29[_0x99e6('0x47')]=qs[_0x99e6('0x48')](_0x579e74[_0x99e6('0x3f')][_0x99e6('0x48')]);_0xd42d29['where']=qs[_0x99e6('0x41')](_[_0x99e6('0x49')](_0x579e74[_0x99e6('0x3f')],_0x24b05c[_0x99e6('0x41')]),_0x2c3587);if(_0x579e74[_0x99e6('0x3f')][_0x99e6('0x4a')]){_0xd42d29[_0x99e6('0x4b')]=_[_0x99e6('0x4c')](_0xd42d29[_0x99e6('0x4b')],{'$or':_[_0x99e6('0x3b')](_0x2c3587,function(_0xb97a84){if(_0xb97a84[_0x99e6('0x3d')]!==_0x99e6('0x4d')){var _0x260a4d={};_0x260a4d[_0xb97a84['name']]={'$like':'%'+_0x579e74['query']['filter']+'%'};return _0x260a4d;}})});}_0xd42d29=_['merge']({},_0xd42d29,_0x579e74[_0x99e6('0x4e')]);var _0x2e5932={'where':_0xd42d29[_0x99e6('0x4b')]};return db[_0x99e6('0x3c')][_0x99e6('0x4f')](_0x2e5932)['then'](function(_0x558d09){_0x1ea6dd[_0x99e6('0x4f')]=_0x558d09;if(_0x579e74[_0x99e6('0x3f')]['includeAll']){_0xd42d29['include']=[{'all':!![]}];}return db[_0x99e6('0x3c')][_0x99e6('0x50')](_0xd42d29);})['then'](function(_0x2bf0c2){_0x1ea6dd['rows']=_0x2bf0c2;return _0x1ea6dd;})[_0x99e6('0x1f')](respondWithFilteredResult(_0x3cc682,_0xd42d29))[_0x99e6('0x2a')](handleError(_0x3cc682,null));};exports[_0x99e6('0x51')]=function(_0x4d2c91,_0x1835d9){var _0x6b597c={'raw':!![],'where':{'id':_0x4d2c91[_0x99e6('0x52')]['id']}},_0x503cc0={};_0x503cc0[_0x99e6('0x43')]=_[_0x99e6('0x40')](db['SmsMessage']['rawAttributes']);_0x503cc0[_0x99e6('0x3f')]=_[_0x99e6('0x40')](_0x4d2c91['query']);_0x503cc0[_0x99e6('0x41')]=_[_0x99e6('0x42')](_0x503cc0[_0x99e6('0x43')],_0x503cc0[_0x99e6('0x3f')]);_0x6b597c[_0x99e6('0x44')]=_[_0x99e6('0x42')](_0x503cc0[_0x99e6('0x43')],qs['fields'](_0x4d2c91[_0x99e6('0x3f')][_0x99e6('0x45')]));_0x6b597c['attributes']=_0x6b597c[_0x99e6('0x44')][_0x99e6('0x46')]?_0x6b597c['attributes']:_0x503cc0[_0x99e6('0x43')];if(_0x4d2c91[_0x99e6('0x3f')]['includeAll']){_0x6b597c[_0x99e6('0x53')]=[{'all':!![]}];}_0x6b597c=_['merge']({},_0x6b597c,_0x4d2c91[_0x99e6('0x4e')]);return db[_0x99e6('0x3c')][_0x99e6('0x54')](_0x6b597c)[_0x99e6('0x1f')](handleEntityNotFound(_0x1835d9,null))[_0x99e6('0x1f')](respondWithResult(_0x1835d9,null))[_0x99e6('0x2a')](handleError(_0x1835d9,null));};exports[_0x99e6('0x55')]=function(_0x3745f0,_0x2a4ede){return db[_0x99e6('0x3c')][_0x99e6('0x55')](_0x3745f0[_0x99e6('0x56')],{})[_0x99e6('0x1f')](respondWithResult(_0x2a4ede,0xc9))['catch'](handleError(_0x2a4ede,null));};exports[_0x99e6('0x35')]=function(_0x3e13a9,_0x303ca3){if(_0x3e13a9[_0x99e6('0x56')]['id']){delete _0x3e13a9[_0x99e6('0x56')]['id'];}return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0x3e13a9[_0x99e6('0x52')]['id']}})[_0x99e6('0x1f')](handleEntityNotFound(_0x303ca3,null))[_0x99e6('0x1f')](saveUpdates(_0x3e13a9[_0x99e6('0x56')],null))[_0x99e6('0x1f')](respondWithResult(_0x303ca3,null))[_0x99e6('0x2a')](handleError(_0x303ca3,null));};exports[_0x99e6('0x36')]=function(_0x40f68a,_0x292c23){return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0x40f68a[_0x99e6('0x52')]['id']}})[_0x99e6('0x1f')](handleEntityNotFound(_0x292c23,null))['then'](removeEntity(_0x292c23,null))[_0x99e6('0x2a')](handleError(_0x292c23,null));};exports[_0x99e6('0x57')]=function(_0x2aa609,_0x31d730){return db['SmsMessage'][_0x99e6('0x57')]()[_0x99e6('0x1f')](respondWithResult(_0x31d730,null))[_0x99e6('0x2a')](handleError(_0x31d730,null));};var interaction_log=require('../../config/logger')(_0x99e6('0x58'));exports[_0x99e6('0x59')]=function(_0xaca434,_0x503938,_0x44a34e){var _0x51aa3e={'agent':{},'channel':_0x99e6('0x5a')};if(_0xaca434[_0x99e6('0x56')]['id']){delete _0xaca434[_0x99e6('0x56')]['id'];}_0xaca434['body']['read']=!![];_0xaca434[_0x99e6('0x56')][_0x99e6('0x5b')]=moment()[_0x99e6('0x5c')](_0x99e6('0x5d'));_0xaca434['body'][_0x99e6('0x5e')]=_0xaca434[_0x99e6('0x56')][_0x99e6('0x5e')]||_0xaca434[_0x99e6('0x5f')]['id'];_0x51aa3e['agent']['id']=_0xaca434[_0x99e6('0x56')][_0x99e6('0x5e')];return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0xaca434[_0x99e6('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x503938,null))[_0x99e6('0x1f')](saveUpdates(_0xaca434[_0x99e6('0x56')],null))[_0x99e6('0x1f')](function(_0x51d37d){if(_0x51d37d){_0x51aa3e[_0x99e6('0x28')]=_0x51d37d[_0x99e6('0x60')]({'plain':!![]});return db[_0x99e6('0x61')]['find']({'where':{'id':_0x51d37d['SmsInteractionId']}});}return null;})[_0x99e6('0x1f')](handleEntityNotFound(_0x503938,null))['then'](function(_0x2390d0){if(_0x2390d0){return _0x2390d0[_0x99e6('0x35')]({'UserId':_0xaca434['body']['UserId'],'read1stAt':_[_0x99e6('0x62')](_0x2390d0[_0x99e6('0x63')])?moment()[_0x99e6('0x5c')](_0x99e6('0x5d')):undefined});}return null;})[_0x99e6('0x1f')](function(_0xfb14ca){if(_0xfb14ca){_0x51aa3e[_0x99e6('0x64')]=_0xfb14ca['get']({'plain':!![]});interaction_log[_0x99e6('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xaca434['user']['id'],_0xaca434[_0x99e6('0x5f')]['name'],_0xaca434[_0x99e6('0x5f')][_0x99e6('0x65')],_0x51aa3e[_0x99e6('0x64')]['id'],_0xaca434[_0x99e6('0x56')]?JSON[_0x99e6('0x25')](_0xaca434['body']):_0x99e6('0x66'));return respondWithRpcPromise(_0x99e6('0x67'),'acceptMessage',_0x51aa3e);}return null;})[_0x99e6('0x1f')](function(_0x277b79){var _0x48ec89=_0x99e6('0x68')+_0x277b79[_0x99e6('0x28')][_0x99e6('0x69')];return db[_0x99e6('0x6a')][_0x99e6('0x3f')](_0x48ec89,{'type':db[_0x99e6('0x6b')][_0x99e6('0x6c')][_0x99e6('0x6d')],'raw':!![]})[_0x99e6('0x1f')](function(_0x33f862){return _0x33f862;});})[_0x99e6('0x1f')](function(_0xde0ee9){if(_0xde0ee9){_0x51aa3e[_0x99e6('0x28')]['contact']=_0xde0ee9[0x0];if(!_0xaca434['body'][_0x99e6('0x5e')])return;return db[_0x99e6('0x6e')][_0x99e6('0x54')]({'where':{'id':_0xaca434[_0x99e6('0x56')]['UserId'],'role':_0x99e6('0x6f')},'attributes':['id',_0x99e6('0x38'),'fullname',_0x99e6('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2d32de){if(!_0x2d32de)return null;_0x51aa3e[_0x99e6('0x28')]['agent']=_0x2d32de;return _0x51aa3e;})[_0x99e6('0x1f')](function(_0x264ea6){if(_0x264ea6){if(_0xaca434[_0x99e6('0x56')][_0x99e6('0x71')]){_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x72')]=util[_0x99e6('0x5c')](_0x99e6('0x73'),_0xaca434[_0x99e6('0x5f')][_0x99e6('0x38')]);_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x74')]=_0x51aa3e['channel'];_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x75')]=_0x51aa3e[_0x99e6('0x74')];_0x51aa3e[_0x99e6('0x28')][_0x99e6('0x76')]='accept';return respondWithRpcPromise(_0x99e6('0x77'),_0x99e6('0x77'),{'event':_0x99e6('0x78'),'message':_0x51aa3e[_0x99e6('0x28')]},client9002)[_0x99e6('0x1f')](function(){return _0x51aa3e;});}return _0x51aa3e;}return null;})[_0x99e6('0x1f')](respondWithResult(_0x503938,null))['catch'](handleError(_0x503938,null));};var interaction_log=require(_0x99e6('0x12'))(_0x99e6('0x58'));exports[_0x99e6('0x33')]=function(_0x3b9126,_0x20172d,_0x4637f0){var _0x244d98={'agent':{},'channel':_0x99e6('0x5a')};if(_0x3b9126['body']['id']){delete _0x3b9126[_0x99e6('0x56')]['id'];}_0x3b9126['body'][_0x99e6('0x5e')]=_0x3b9126['body'][_0x99e6('0x5e')]||_0x3b9126[_0x99e6('0x5f')]['id'];_0x244d98[_0x99e6('0x6f')]['id']=_0x3b9126[_0x99e6('0x56')]['UserId'];return db['SmsMessage'][_0x99e6('0x54')]({'where':{'id':_0x3b9126[_0x99e6('0x52')]['id'],'UserId':null}})[_0x99e6('0x1f')](handleEntityNotFound(_0x20172d,null))[_0x99e6('0x1f')](function(_0x1cdf12){if(_0x1cdf12){_0x244d98[_0x99e6('0x28')]=_0x1cdf12[_0x99e6('0x60')]({'plain':!![]});return db[_0x99e6('0x61')][_0x99e6('0x54')]({'where':{'id':_0x1cdf12[_0x99e6('0x79')]}});}return null;})[_0x99e6('0x1f')](handleEntityNotFound(_0x20172d,null))[_0x99e6('0x1f')](function(_0xd4e10d){if(_0xd4e10d){_0x244d98['interaction']=_0xd4e10d['get']({'plain':!![]});interaction_log['info'](_0x99e6('0x7a'),_0x3b9126[_0x99e6('0x5f')]['id'],_0x3b9126[_0x99e6('0x5f')]['name'],_0x3b9126[_0x99e6('0x5f')][_0x99e6('0x65')],_0x244d98[_0x99e6('0x64')]['id'],_0x3b9126[_0x99e6('0x56')]?JSON[_0x99e6('0x25')](_0x3b9126[_0x99e6('0x56')]):'null');return respondWithRpcPromise(_0x99e6('0x7b'),'rejectMessage',_0x244d98);}return null;})[_0x99e6('0x1f')](function(_0x3b1141){var _0x806044='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b1141[_0x99e6('0x28')][_0x99e6('0x69')];return db[_0x99e6('0x6a')][_0x99e6('0x3f')](_0x806044,{'type':db[_0x99e6('0x6b')]['QueryTypes'][_0x99e6('0x6d')],'raw':!![]})[_0x99e6('0x1f')](function(_0x1c8020){return _0x1c8020;});})[_0x99e6('0x1f')](function(_0x4c5afa){if(_0x4c5afa){_0x244d98[_0x99e6('0x28')][_0x99e6('0x7c')]=_0x4c5afa[0x0];if(!_0x3b9126[_0x99e6('0x56')][_0x99e6('0x5e')])return;return db[_0x99e6('0x6e')][_0x99e6('0x54')]({'where':{'id':_0x3b9126['body'][_0x99e6('0x5e')],'role':_0x99e6('0x6f')},'attributes':['id',_0x99e6('0x38'),_0x99e6('0x7d'),'email',_0x99e6('0x7e')],'raw':!![]});}return null;})[_0x99e6('0x1f')](function(_0xe19ac6){if(!_0xe19ac6)return null;_0x244d98[_0x99e6('0x28')]['agent']=_0xe19ac6;return _0x244d98;})[_0x99e6('0x1f')](function(_0x3a0e4d){if(_0x3a0e4d){_0x3a0e4d['message'][_0x99e6('0x72')]=util['format'](_0x99e6('0x73'),_0x3b9126['user'][_0x99e6('0x38')]);_0x3a0e4d[_0x99e6('0x28')][_0x99e6('0x74')]=_0x244d98[_0x99e6('0x74')];_0x3a0e4d[_0x99e6('0x28')][_0x99e6('0x75')]=_0x244d98['channel'];_0x3a0e4d['message'][_0x99e6('0x76')]=_0x99e6('0x33');respondWithRpcPromise(_0x99e6('0x77'),_0x99e6('0x77'),{'event':_0x99e6('0x7f'),'message':_0x3a0e4d[_0x99e6('0x28')]},client9002);return _0x244d98;}return null;})[_0x99e6('0x1f')](respondWithResult(_0x20172d,null))[_0x99e6('0x2a')](handleError(_0x20172d,null));};exports[_0x99e6('0x2c')]=function(_0x5570f3,_0x595a20,_0xa2e4f4){if(_0x5570f3[_0x99e6('0x56')]['id']){delete _0x5570f3[_0x99e6('0x56')]['id'];}var _0x4243d4;return db[_0x99e6('0x3c')][_0x99e6('0x54')]({'where':{'id':_0x5570f3[_0x99e6('0x52')]['id']}})[_0x99e6('0x1f')](handleEntityNotFound(_0x595a20,null))[_0x99e6('0x1f')](function(_0x13a146){if(_0x13a146){_0x4243d4=_0x13a146;return db[_0x99e6('0x80')]['find']({'where':{'id':_0x13a146['SmsAccountId']}});}})[_0x99e6('0x1f')](handleEntityNotFound(_0x595a20,null))['then'](function(_0x73c37d){if(_0x73c37d){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x99e6('0x2c'),'received\x20delivery\x20report\x20from',_0x73c37d[_0x99e6('0x3d')],util[_0x99e6('0x81')](_0x5570f3[_0x99e6('0x56')],{'showHidden':![],'depth':null}));switch(_0x73c37d[_0x99e6('0x3d')]){case _0x99e6('0x82'):if(_0x5570f3[_0x99e6('0x56')][_0x99e6('0x83')]&&_0x5570f3['body'][_0x99e6('0x83')]===_0x4243d4[_0x99e6('0x84')]){return _0x4243d4[_0x99e6('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99e6('0x2c'),'twilio',util[_0x99e6('0x81')](_0x5570f3['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5570f3[_0x99e6('0x56')][_0x99e6('0x85')]&&_0x5570f3[_0x99e6('0x56')][_0x99e6('0x85')]===_0x4243d4[_0x99e6('0x84')]&&_[_0x99e6('0x86')]([_0x99e6('0x87'),_0x99e6('0x88')],_0x5570f3[_0x99e6('0x56')][_0x99e6('0x89')])>=0x0){return _0x4243d4[_0x99e6('0x35')]({'read':!![]});}else{logger[_0x99e6('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x99e6('0x8a'),util[_0x99e6('0x81')](_0x5570f3[_0x99e6('0x56')],{'showHidden':![],'depth':null}));}break;case _0x99e6('0x8b'):var _0x412496=_0x5570f3['body'][_0x99e6('0x8c')][0x0];if(_0x412496[_0x99e6('0x2c')][_0x99e6('0x8d')]===_0x99e6('0x8e')){return _0x4243d4['update']({'read':!![]});}else{logger[_0x99e6('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x99e6('0x2c'),_0x99e6('0x8b'),util[_0x99e6('0x81')](_0x5570f3[_0x99e6('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4243d4;}})[_0x99e6('0x1f')](respondWithResult(_0x595a20,null))[_0x99e6('0x2a')](handleError(_0x595a20,null));};
\ No newline at end of file
+var _0x8863=['infobip','results','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','email','internal','agent','manual','interface','SIP/%s','channel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','User','event','rejectmessage','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x5e60ed,_0x4ce241){var _0x41c642=function(_0x186947){while(--_0x186947){_0x5e60ed['push'](_0x5e60ed['shift']());}};_0x41c642(++_0x4ce241);}(_0x8863,0x1b6));var _0x3886=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0x8863[_0x24853d];return _0x4c5cff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3886('0x0'));var zipdir=require(_0x3886('0x1'));var jsonpatch=require(_0x3886('0x2'));var rp=require(_0x3886('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3886('0x4'));var sox=require(_0x3886('0x5'));var csv=require('to-csv');var ejs=require(_0x3886('0x6'));var fs=require('fs');var fs_extra=require(_0x3886('0x7'));var _=require('lodash');var squel=require(_0x3886('0x8'));var crypto=require(_0x3886('0x9'));var jsforce=require(_0x3886('0xa'));var deskjs=require(_0x3886('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3886('0xc'));var Papa=require(_0x3886('0xd'));var Redis=require(_0x3886('0xe'));var authService=require(_0x3886('0xf'));var qs=require(_0x3886('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3886('0x11'));var logger=require(_0x3886('0x12'))(_0x3886('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3886('0x14'));var db=require(_0x3886('0x15'))['db'];config[_0x3886('0x16')]=_[_0x3886('0x17')](config[_0x3886('0x16')],{'host':_0x3886('0x18'),'port':0x18eb});var socket=require(_0x3886('0x19'))(new Redis(config[_0x3886('0x16')]));require(_0x3886('0x1a'))[_0x3886('0x1b')](socket);var jayson=require(_0x3886('0x1c'));var client=jayson[_0x3886('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x3886('0x1d')][_0x3886('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x509201,_0x27545c,_0x4d9b7e,_0x22d936){return new BPromise(function(_0xdbb8c,_0x40d4c1){var _0x18021b=_0x22d936||client;return _0x18021b['request'](_0x509201,_0x4d9b7e)['then'](function(_0x42f22d){logger[_0x3886('0x1f')](_0x3886('0x20'),_0x27545c,_0x3886('0x21'));logger[_0x3886('0x22')](_0x3886('0x23'),_0x27545c,_0x3886('0x21'),JSON[_0x3886('0x24')](_0x42f22d));if(_0x42f22d[_0x3886('0x25')]){if(_0x42f22d[_0x3886('0x25')][_0x3886('0x26')]===0x1f4){logger['error'](_0x3886('0x20'),_0x27545c,_0x42f22d[_0x3886('0x25')][_0x3886('0x27')]);return _0x40d4c1(_0x42f22d['error'][_0x3886('0x27')]);}logger[_0x3886('0x25')](_0x3886('0x20'),_0x27545c,_0x42f22d[_0x3886('0x25')][_0x3886('0x27')]);return _0xdbb8c(_0x42f22d[_0x3886('0x25')][_0x3886('0x27')]);}else{logger['info'](_0x3886('0x20'),_0x27545c,_0x3886('0x21'));_0xdbb8c(_0x42f22d['result'][_0x3886('0x27')]);}})['catch'](function(_0xe75870){logger['error']('SmsMessage,\x20%s,\x20%s',_0x27545c,_0xe75870);_0x40d4c1(_0xe75870);});});}function respondWithStatusCode(_0x44af0b,_0x169cd9){_0x169cd9=_0x169cd9||0xcc;return function(_0x372356){if(_0x372356){return _0x44af0b[_0x3886('0x28')](_0x169cd9);}return _0x44af0b[_0x3886('0x29')](_0x169cd9)[_0x3886('0x2a')]();};}function respondWithResult(_0x472a38,_0x1b8a62){_0x1b8a62=_0x1b8a62||0xc8;return function(_0x1c390b){if(_0x1c390b){return _0x472a38[_0x3886('0x29')](_0x1b8a62)[_0x3886('0x2b')](_0x1c390b);}};}function respondWithFilteredResult(_0x353d84,_0x31cd91){return function(_0x1f93bf){if(_0x1f93bf){var _0x2eecab=typeof _0x31cd91[_0x3886('0x2c')]===_0x3886('0x2d')&&typeof _0x31cd91[_0x3886('0x2e')]===_0x3886('0x2d');var _0x5c6331=_0x1f93bf[_0x3886('0x2f')];var _0x2feca4=_0x2eecab?0x0:_0x31cd91[_0x3886('0x2c')];var _0x348909=_0x2eecab?_0x1f93bf[_0x3886('0x2f')]:_0x31cd91[_0x3886('0x2c')]+_0x31cd91['limit'];var _0x18eb6d;if(_0x348909>=_0x5c6331){_0x348909=_0x5c6331;_0x18eb6d=0xc8;}else{_0x18eb6d=0xce;}_0x353d84[_0x3886('0x29')](_0x18eb6d);return _0x353d84['set'](_0x3886('0x30'),_0x2feca4+'-'+_0x348909+'/'+_0x5c6331)[_0x3886('0x2b')](_0x1f93bf);}return null;};}function patchUpdates(_0x3c5e68){return function(_0x5eb817){try{jsonpatch[_0x3886('0x31')](_0x5eb817,_0x3c5e68,!![]);}catch(_0x2921d9){return BPromise[_0x3886('0x32')](_0x2921d9);}return _0x5eb817[_0x3886('0x33')]();};}function saveUpdates(_0x138c57,_0x5058e4){return function(_0xc0caaf){if(_0xc0caaf){return _0xc0caaf[_0x3886('0x34')](_0x138c57)[_0x3886('0x35')](function(_0x510e66){return _0x510e66;});}return null;};}function removeEntity(_0x175cee,_0x4676af){return function(_0x5a3e19){if(_0x5a3e19){return _0x5a3e19[_0x3886('0x36')]()[_0x3886('0x35')](function(){_0x175cee[_0x3886('0x29')](0xcc)[_0x3886('0x2a')]();});}};}function handleEntityNotFound(_0x1b2e90,_0x4db85b){return function(_0x565182){if(!_0x565182){_0x1b2e90['sendStatus'](0x194);}return _0x565182;};}function handleError(_0x48e3ae,_0x24d56b){_0x24d56b=_0x24d56b||0x1f4;return function(_0xe2fe98){logger[_0x3886('0x25')](_0xe2fe98[_0x3886('0x37')]);if(_0xe2fe98[_0x3886('0x38')]){delete _0xe2fe98[_0x3886('0x38')];}_0x48e3ae['status'](_0x24d56b)[_0x3886('0x39')](_0xe2fe98);};}exports[_0x3886('0x3a')]=function(_0x25035c,_0x943fa9){var _0x11981f={},_0x363a31={},_0x55cee8={'count':0x0,'rows':[]};var _0x2d2c40=_[_0x3886('0x3b')](db[_0x3886('0x3c')][_0x3886('0x3d')],function(_0x43a3d5){return{'name':_0x43a3d5[_0x3886('0x3e')],'type':_0x43a3d5[_0x3886('0x3f')][_0x3886('0x40')]};});_0x363a31['model']=_[_0x3886('0x3b')](_0x2d2c40,'name');_0x363a31[_0x3886('0x41')]=_[_0x3886('0x42')](_0x25035c[_0x3886('0x41')]);_0x363a31[_0x3886('0x43')]=_[_0x3886('0x44')](_0x363a31[_0x3886('0x45')],_0x363a31['query']);_0x11981f[_0x3886('0x46')]=_[_0x3886('0x44')](_0x363a31[_0x3886('0x45')],qs[_0x3886('0x47')](_0x25035c[_0x3886('0x41')][_0x3886('0x47')]));_0x11981f['attributes']=_0x11981f[_0x3886('0x46')][_0x3886('0x48')]?_0x11981f[_0x3886('0x46')]:_0x363a31[_0x3886('0x45')];if(!_0x25035c[_0x3886('0x41')]['hasOwnProperty'](_0x3886('0x49'))){_0x11981f[_0x3886('0x2e')]=qs[_0x3886('0x2e')](_0x25035c[_0x3886('0x41')][_0x3886('0x2e')]);_0x11981f[_0x3886('0x2c')]=qs['offset'](_0x25035c[_0x3886('0x41')][_0x3886('0x2c')]);}_0x11981f[_0x3886('0x4a')]=qs[_0x3886('0x4b')](_0x25035c[_0x3886('0x41')]['sort']);_0x11981f[_0x3886('0x4c')]=qs['filters'](_[_0x3886('0x4d')](_0x25035c[_0x3886('0x41')],_0x363a31[_0x3886('0x43')]),_0x2d2c40);if(_0x25035c[_0x3886('0x41')][_0x3886('0x4e')]){_0x11981f['where']=_[_0x3886('0x4f')](_0x11981f[_0x3886('0x4c')],{'$or':_[_0x3886('0x3b')](_0x2d2c40,function(_0x312502){if(_0x312502[_0x3886('0x3f')]!==_0x3886('0x50')){var _0x513e58={};_0x513e58[_0x312502[_0x3886('0x38')]]={'$like':'%'+_0x25035c['query']['filter']+'%'};return _0x513e58;}})});}_0x11981f=_[_0x3886('0x4f')]({},_0x11981f,_0x25035c[_0x3886('0x51')]);var _0x225e90={'where':_0x11981f[_0x3886('0x4c')]};return db[_0x3886('0x3c')][_0x3886('0x2f')](_0x225e90)[_0x3886('0x35')](function(_0x537cf8){_0x55cee8[_0x3886('0x2f')]=_0x537cf8;if(_0x25035c['query'][_0x3886('0x52')]){_0x11981f[_0x3886('0x53')]=[{'all':!![]}];}return db[_0x3886('0x3c')][_0x3886('0x54')](_0x11981f);})[_0x3886('0x35')](function(_0x3f697a){_0x55cee8[_0x3886('0x55')]=_0x3f697a;return _0x55cee8;})['then'](respondWithFilteredResult(_0x943fa9,_0x11981f))[_0x3886('0x56')](handleError(_0x943fa9,null));};exports['show']=function(_0x105268,_0x2baeae){var _0x196827={'raw':!![],'where':{'id':_0x105268['params']['id']}},_0x3a3189={};_0x3a3189[_0x3886('0x45')]=_[_0x3886('0x42')](db[_0x3886('0x3c')][_0x3886('0x3d')]);_0x3a3189[_0x3886('0x41')]=_[_0x3886('0x42')](_0x105268[_0x3886('0x41')]);_0x3a3189[_0x3886('0x43')]=_[_0x3886('0x44')](_0x3a3189[_0x3886('0x45')],_0x3a3189[_0x3886('0x41')]);_0x196827[_0x3886('0x46')]=_[_0x3886('0x44')](_0x3a3189['model'],qs[_0x3886('0x47')](_0x105268[_0x3886('0x41')]['fields']));_0x196827['attributes']=_0x196827[_0x3886('0x46')][_0x3886('0x48')]?_0x196827[_0x3886('0x46')]:_0x3a3189[_0x3886('0x45')];if(_0x105268['query'][_0x3886('0x52')]){_0x196827['include']=[{'all':!![]}];}_0x196827=_[_0x3886('0x4f')]({},_0x196827,_0x105268[_0x3886('0x51')]);return db[_0x3886('0x3c')][_0x3886('0x57')](_0x196827)[_0x3886('0x35')](handleEntityNotFound(_0x2baeae,null))[_0x3886('0x35')](respondWithResult(_0x2baeae,null))['catch'](handleError(_0x2baeae,null));};exports[_0x3886('0x58')]=function(_0x1ec1d1,_0x360ea0){return db[_0x3886('0x3c')]['create'](_0x1ec1d1['body'],{})[_0x3886('0x35')](respondWithResult(_0x360ea0,0xc9))[_0x3886('0x56')](handleError(_0x360ea0,null));};exports[_0x3886('0x34')]=function(_0x110f37,_0x1e567c){if(_0x110f37[_0x3886('0x59')]['id']){delete _0x110f37[_0x3886('0x59')]['id'];}return db[_0x3886('0x3c')][_0x3886('0x57')]({'where':{'id':_0x110f37['params']['id']}})[_0x3886('0x35')](handleEntityNotFound(_0x1e567c,null))[_0x3886('0x35')](saveUpdates(_0x110f37['body'],null))[_0x3886('0x35')](respondWithResult(_0x1e567c,null))[_0x3886('0x56')](handleError(_0x1e567c,null));};exports[_0x3886('0x36')]=function(_0x1c4bc3,_0x3c656f){return db[_0x3886('0x3c')][_0x3886('0x57')]({'where':{'id':_0x1c4bc3[_0x3886('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c656f,null))[_0x3886('0x35')](removeEntity(_0x3c656f,null))[_0x3886('0x56')](handleError(_0x3c656f,null));};exports['describe']=function(_0xcd8c31,_0x1d8693){return db['SmsMessage'][_0x3886('0x5b')]()[_0x3886('0x35')](respondWithResult(_0x1d8693,null))[_0x3886('0x56')](handleError(_0x1d8693,null));};var interaction_log=require(_0x3886('0x12'))(_0x3886('0x5c'));exports[_0x3886('0x5d')]=function(_0x1200a7,_0x124c91,_0x4c7f59){var _0x5d48b8={'agent':{},'channel':_0x3886('0x5e')};if(_0x1200a7['body']['id']){delete _0x1200a7[_0x3886('0x59')]['id'];}_0x1200a7[_0x3886('0x59')][_0x3886('0x5f')]=!![];_0x1200a7[_0x3886('0x59')][_0x3886('0x60')]=moment()[_0x3886('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x1200a7['body'][_0x3886('0x62')]=_0x1200a7['body'][_0x3886('0x62')]||_0x1200a7[_0x3886('0x63')]['id'];_0x5d48b8['agent']['id']=_0x1200a7['body'][_0x3886('0x62')];return db[_0x3886('0x3c')][_0x3886('0x57')]({'where':{'id':_0x1200a7[_0x3886('0x5a')]['id'],'UserId':null}})[_0x3886('0x35')](handleEntityNotFound(_0x124c91,null))[_0x3886('0x35')](saveUpdates(_0x1200a7['body'],null))[_0x3886('0x35')](function(_0x6863b6){if(_0x6863b6){_0x5d48b8['message']=_0x6863b6['get']({'plain':!![]});return db[_0x3886('0x64')][_0x3886('0x57')]({'where':{'id':_0x6863b6[_0x3886('0x65')]}});}return null;})[_0x3886('0x35')](handleEntityNotFound(_0x124c91,null))['then'](function(_0x4e6b34){if(_0x4e6b34){return _0x4e6b34['update']({'UserId':_0x1200a7['body']['UserId'],'read1stAt':_[_0x3886('0x66')](_0x4e6b34[_0x3886('0x67')])?moment()[_0x3886('0x61')](_0x3886('0x68')):undefined});}return null;})[_0x3886('0x35')](function(_0x49e32){if(_0x49e32){_0x5d48b8[_0x3886('0x69')]=_0x49e32[_0x3886('0x6a')]({'plain':!![]});interaction_log[_0x3886('0x1f')](_0x3886('0x6b'),_0x1200a7[_0x3886('0x63')]['id'],_0x1200a7['user']['name'],_0x1200a7['user'][_0x3886('0x6c')],_0x5d48b8[_0x3886('0x69')]['id'],_0x1200a7[_0x3886('0x59')]?JSON[_0x3886('0x24')](_0x1200a7[_0x3886('0x59')]):_0x3886('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5d48b8);}return null;})[_0x3886('0x35')](function(_0x32d959){var _0x10f596=_0x3886('0x6e')+_0x32d959[_0x3886('0x27')][_0x3886('0x6f')];return db[_0x3886('0x70')][_0x3886('0x41')](_0x10f596,{'type':db[_0x3886('0x71')]['QueryTypes'][_0x3886('0x72')],'raw':!![]})[_0x3886('0x35')](function(_0x1ca985){return _0x1ca985;});})[_0x3886('0x35')](function(_0x4f5dad){if(_0x4f5dad){_0x5d48b8[_0x3886('0x27')]['contact']=_0x4f5dad[0x0];if(!_0x1200a7['body']['UserId'])return;return db['User'][_0x3886('0x57')]({'where':{'id':_0x1200a7[_0x3886('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x3886('0x38'),_0x3886('0x73'),_0x3886('0x74'),_0x3886('0x75')],'raw':!![]});}return null;})[_0x3886('0x35')](function(_0xc787fc){if(!_0xc787fc)return null;_0x5d48b8[_0x3886('0x27')][_0x3886('0x76')]=_0xc787fc;return _0x5d48b8;})['then'](function(_0x28748f){if(_0x28748f){if(_0x1200a7[_0x3886('0x59')][_0x3886('0x77')]){_0x5d48b8['message'][_0x3886('0x78')]=util[_0x3886('0x61')](_0x3886('0x79'),_0x1200a7[_0x3886('0x63')][_0x3886('0x38')]);_0x5d48b8[_0x3886('0x27')][_0x3886('0x7a')]=_0x5d48b8[_0x3886('0x7a')];_0x5d48b8[_0x3886('0x27')]['motionChannel']=_0x5d48b8[_0x3886('0x7a')];_0x5d48b8['message']['event']=_0x3886('0x5d');return respondWithRpcPromise(_0x3886('0x7b'),_0x3886('0x7b'),{'event':_0x3886('0x7c'),'message':_0x5d48b8[_0x3886('0x27')]},client9002)['then'](function(){return _0x5d48b8;});}return _0x5d48b8;}return null;})[_0x3886('0x35')](respondWithResult(_0x124c91,null))[_0x3886('0x56')](handleError(_0x124c91,null));};var interaction_log=require(_0x3886('0x12'))('sms-interactions');exports[_0x3886('0x32')]=function(_0x5abbfe,_0x4e3710,_0x19a7c5){var _0xc54e57={'agent':{},'channel':_0x3886('0x5e')};if(_0x5abbfe['body']['id']){delete _0x5abbfe[_0x3886('0x59')]['id'];}_0x5abbfe['body']['UserId']=_0x5abbfe['body'][_0x3886('0x62')]||_0x5abbfe['user']['id'];_0xc54e57[_0x3886('0x76')]['id']=_0x5abbfe[_0x3886('0x59')][_0x3886('0x62')];return db[_0x3886('0x3c')][_0x3886('0x57')]({'where':{'id':_0x5abbfe[_0x3886('0x5a')]['id'],'UserId':null}})[_0x3886('0x35')](handleEntityNotFound(_0x4e3710,null))['then'](function(_0x25654f){if(_0x25654f){_0xc54e57[_0x3886('0x27')]=_0x25654f[_0x3886('0x6a')]({'plain':!![]});return db[_0x3886('0x64')][_0x3886('0x57')]({'where':{'id':_0x25654f['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4e3710,null))[_0x3886('0x35')](function(_0x4bbb98){if(_0x4bbb98){_0xc54e57[_0x3886('0x69')]=_0x4bbb98[_0x3886('0x6a')]({'plain':!![]});interaction_log[_0x3886('0x1f')](_0x3886('0x7d'),_0x5abbfe[_0x3886('0x63')]['id'],_0x5abbfe[_0x3886('0x63')]['name'],_0x5abbfe[_0x3886('0x63')][_0x3886('0x6c')],_0xc54e57[_0x3886('0x69')]['id'],_0x5abbfe['body']?JSON[_0x3886('0x24')](_0x5abbfe['body']):_0x3886('0x6d'));return respondWithRpcPromise(_0x3886('0x7e'),'rejectMessage',_0xc54e57);}return null;})[_0x3886('0x35')](function(_0x3aaf50){var _0x74245e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3aaf50[_0x3886('0x27')][_0x3886('0x6f')];return db['sequelize']['query'](_0x74245e,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x3886('0x35')](function(_0x32be65){return _0x32be65;});})[_0x3886('0x35')](function(_0x35c142){if(_0x35c142){_0xc54e57[_0x3886('0x27')][_0x3886('0x7f')]=_0x35c142[0x0];if(!_0x5abbfe['body'][_0x3886('0x62')])return;return db[_0x3886('0x80')][_0x3886('0x57')]({'where':{'id':_0x5abbfe[_0x3886('0x59')][_0x3886('0x62')],'role':'agent'},'attributes':['id','name',_0x3886('0x73'),_0x3886('0x74'),_0x3886('0x75')],'raw':!![]});}return null;})[_0x3886('0x35')](function(_0x4497e6){if(!_0x4497e6)return null;_0xc54e57[_0x3886('0x27')][_0x3886('0x76')]=_0x4497e6;return _0xc54e57;})[_0x3886('0x35')](function(_0x250e9e){if(_0x250e9e){_0x250e9e[_0x3886('0x27')][_0x3886('0x78')]=util[_0x3886('0x61')](_0x3886('0x79'),_0x5abbfe['user'][_0x3886('0x38')]);_0x250e9e[_0x3886('0x27')][_0x3886('0x7a')]=_0xc54e57['channel'];_0x250e9e['message']['motionChannel']=_0xc54e57[_0x3886('0x7a')];_0x250e9e['message'][_0x3886('0x81')]=_0x3886('0x32');respondWithRpcPromise(_0x3886('0x7b'),_0x3886('0x7b'),{'event':_0x3886('0x82'),'message':_0x250e9e[_0x3886('0x27')]},client9002);return _0xc54e57;}return null;})[_0x3886('0x35')](respondWithResult(_0x4e3710,null))[_0x3886('0x56')](handleError(_0x4e3710,null));};exports[_0x3886('0x29')]=function(_0x59440f,_0x1c08b7,_0x1b950f){if(_0x59440f[_0x3886('0x59')]['id']){delete _0x59440f['body']['id'];}var _0xefd769;return db['SmsMessage'][_0x3886('0x57')]({'where':{'id':_0x59440f[_0x3886('0x5a')]['id']}})[_0x3886('0x35')](handleEntityNotFound(_0x1c08b7,null))['then'](function(_0x972e16){if(_0x972e16){_0xefd769=_0x972e16;return db['SmsAccount'][_0x3886('0x57')]({'where':{'id':_0x972e16['SmsAccountId']}});}})[_0x3886('0x35')](handleEntityNotFound(_0x1c08b7,null))['then'](function(_0x16e51b){if(_0x16e51b){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3886('0x29'),_0x3886('0x83'),_0x16e51b[_0x3886('0x3f')],util[_0x3886('0x84')](_0x59440f[_0x3886('0x59')],{'showHidden':![],'depth':null}));switch(_0x16e51b['type']){case _0x3886('0x85'):if(_0x59440f[_0x3886('0x59')][_0x3886('0x86')]&&_0x59440f[_0x3886('0x59')]['MessageSid']===_0xefd769[_0x3886('0x87')]){return _0xefd769[_0x3886('0x34')]({'read':!![]});}else{logger[_0x3886('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3886('0x29'),'twilio',util['inspect'](_0x59440f[_0x3886('0x59')],{'showHidden':![],'depth':null}));}break;case _0x3886('0x88'):if(_0x59440f[_0x3886('0x59')][_0x3886('0x89')]&&_0x59440f[_0x3886('0x59')][_0x3886('0x89')]===_0xefd769[_0x3886('0x87')]&&_[_0x3886('0x8a')]([_0x3886('0x8b'),_0x3886('0x8c')],_0x59440f['body']['Status'])>=0x0){return _0xefd769['update']({'read':!![]});}else{logger[_0x3886('0x25')](_0x3886('0x8d'),_0x3886('0x29'),'plivio',util[_0x3886('0x84')](_0x59440f[_0x3886('0x59')],{'showHidden':![],'depth':null}));}break;case _0x3886('0x8e'):var _0x846be=_0x59440f['body'][_0x3886('0x8f')][0x0];if(_0x846be[_0x3886('0x29')]['groupName']===_0x3886('0x90')){return _0xefd769[_0x3886('0x34')]({'read':!![]});}else{logger[_0x3886('0x25')](_0x3886('0x8d'),'status','infobip',util[_0x3886('0x84')](_0x59440f[_0x3886('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xefd769;}})[_0x3886('0x35')](respondWithResult(_0x1c08b7,null))[_0x3886('0x56')](handleError(_0x1c08b7,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc361=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x57549b,_0x30e0c4){var _0x26e1fd=function(_0x5e9c5a){while(--_0x5e9c5a){_0x57549b['push'](_0x57549b['shift']());}};_0x26e1fd(++_0x30e0c4);}(_0xc361,0x1a2));var _0x1c36=function(_0x547b53,_0x5ea6cb){_0x547b53=_0x547b53-0x0;var _0x166225=_0xc361[_0x547b53];return _0x166225;};'use strict';var EventEmitter=require(_0x1c36('0x0'));var SmsMessage=require(_0x1c36('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1c36('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c36('0x3'),'afterDestroy':_0x1c36('0x4')};function emitEvent(_0x3d5397){return function(_0x3ecc3b,_0x3219ae,_0x21e5e7){SmsMessageEvents[_0x1c36('0x5')](_0x3d5397+':'+_0x3ecc3b['id'],_0x3ecc3b);SmsMessageEvents[_0x1c36('0x5')](_0x3d5397,_0x3ecc3b);_0x21e5e7(null);};}for(var e in events){if(events[_0x1c36('0x6')](e)){var event=events[e];SmsMessage[_0x1c36('0x7')](e,emitEvent(event));}}module[_0x1c36('0x8')]=SmsMessageEvents;
\ No newline at end of file
+var _0xc3cc=['exports','events','../../mysqldb','SmsMessage','save','update','emit','hook'];(function(_0x16ec6e,_0x53e3ac){var _0x1a76e1=function(_0x187264){while(--_0x187264){_0x16ec6e['push'](_0x16ec6e['shift']());}};_0x1a76e1(++_0x53e3ac);}(_0xc3cc,0x189));var _0xcc3c=function(_0x11e9e6,_0x40b63c){_0x11e9e6=_0x11e9e6-0x0;var _0x5ebe60=_0xc3cc[_0x11e9e6];return _0x5ebe60;};'use strict';var EventEmitter=require(_0xcc3c('0x0'));var SmsMessage=require(_0xcc3c('0x1'))['db'][_0xcc3c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc3c('0x3'),'afterUpdate':_0xcc3c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bf0ea){return function(_0x2c107e,_0x4dfadc,_0x5b6df3){SmsMessageEvents[_0xcc3c('0x5')](_0x4bf0ea+':'+_0x2c107e['id'],_0x2c107e);SmsMessageEvents[_0xcc3c('0x5')](_0x4bf0ea,_0x2c107e);_0x5b6df3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xcc3c('0x6')](e,emitEvent(event));}}module[_0xcc3c('0x7')]=SmsMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85bb=['keys','length','createHash','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','format','%s:%s','Basic\x20%s','toString','base64','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp'];(function(_0x2e17a7,_0x5b5efa){var _0x443505=function(_0x1bc24d){while(--_0x1bc24d){_0x2e17a7['push'](_0x2e17a7['shift']());}};_0x443505(++_0x5b5efa);}(_0x85bb,0x97));var _0xb85b=function(_0x4f34bb,_0x1cae26){_0x4f34bb=_0x4f34bb-0x0;var _0x43e3ab=_0x85bb[_0x4f34bb];return _0x43e3ab;};'use strict';var _=require('lodash');var util=require(_0xb85b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb85b('0x1'));var BPromise=require(_0xb85b('0x2'));var rp=require(_0xb85b('0x3'));var fs=require('fs');var path=require(_0xb85b('0x4'));var rimraf=require(_0xb85b('0x5'));var config=require(_0xb85b('0x6'));var attributes=require(_0xb85b('0x7'));module[_0xb85b('0x8')]=function(_0xc8efbd,_0x51256c){return _0xc8efbd[_0xb85b('0x9')](_0xb85b('0xa'),attributes,{'tableName':_0xb85b('0xb'),'paranoid':![],'indexes':[{'name':_0xb85b('0xc'),'fields':[_0xb85b('0xc')]},{'name':_0xb85b('0xd'),'fields':[_0xb85b('0xe')],'type':_0xb85b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20a18b,_0x41b350,_0x209fd0){var _0x20fffe=_0xc8efbd[_0xb85b('0x10')];var _0x178b23=_0x20a18b[_0xb85b('0x11')]({'plain':!![]});if(_0x178b23['direction'][_0xb85b('0x12')]()==='in'||_0x178b23[_0xb85b('0x13')]['toLowerCase']()===_0xb85b('0x14')&&!_0x178b23[_0xb85b('0x15')]&&!_['isNil'](_0x178b23[_0xb85b('0x16')])&&!_[_0xb85b('0x17')](_0x178b23[_0xb85b('0x18')])){_0x20fffe[_0xb85b('0x19')][_0xb85b('0x1a')]({'where':{'id':_0x178b23['SmsInteractionId']}})[_0xb85b('0x1b')](function(_0x2f6ab6){if(_0x2f6ab6){_0x2f6ab6[_0xb85b('0x1c')]({'lastMsgAt':_0x178b23[_0xb85b('0x1d')],'lastMsgDirection':_0x178b23[_0xb85b('0x13')][_0xb85b('0x12')]()});}})['catch'](function(_0x5741ef){console[_0xb85b('0x1e')](_0x5741ef);});}if(_0x178b23[_0xb85b('0x13')]===_0xb85b('0x14')&&!_0x178b23[_0xb85b('0x15')]){var _0x3c2d0e;_0x20fffe[_0xb85b('0x1f')]['find']({'where':{'id':_0x178b23[_0xb85b('0x20')]},'raw':!![]})['then'](function(_0x47195a){_0x3c2d0e=_0x47195a;if(_0x3c2d0e&&_0x3c2d0e[_0xb85b('0x21')]){switch(_0x3c2d0e[_0xb85b('0x21')]){case _0xb85b('0x22'):var _0x2af4cf=require(_0xb85b('0x22'));if(_0x3c2d0e[_0xb85b('0x23')]&&_0x3c2d0e['authToken']&&_0x3c2d0e['phone']){var _0x588dca=new _0x2af4cf(_0x3c2d0e[_0xb85b('0x23')],_0x3c2d0e[_0xb85b('0x24')]);_0x588dca[_0xb85b('0x25')][_0xb85b('0x26')]({'body':_0x178b23[_0xb85b('0xe')],'to':_0x178b23[_0xb85b('0x27')],'from':_0x3c2d0e['phone'],'statusCallback':_0x3c2d0e[_0xb85b('0x28')]+_0xb85b('0x29')+_0x178b23['id']+_0xb85b('0x2a')+_0x3c2d0e['token']})[_0xb85b('0x1b')](function(_0x5a81f2){if(_0x5a81f2[_0xb85b('0x2b')]){return _0x20a18b[_0xb85b('0x1c')]({'messageId':_0x5a81f2[_0xb85b('0x2b')]});}})[_0xb85b('0x2c')](function(_0x4cb0cc){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x22'),util[_0xb85b('0x2f')](_0x4cb0cc,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x22'),_0xb85b('0x30'));}break;case _0xb85b('0x31'):var _0x47ad28='https://api.skebby.it/API/v1.0/REST/';if(_0x3c2d0e[_0xb85b('0x32')]&&_0x3c2d0e['password']){var _0x2f9c96={'recipient':[_0x178b23[_0xb85b('0x27')]],'message':_0x178b23[_0xb85b('0xe')],'message_type':_0x3c2d0e[_0xb85b('0x33')]};if(_0x3c2d0e[_0xb85b('0x33')]&&_0x3c2d0e[_0xb85b('0x33')]!=='SI'){_0x2f9c96[_0xb85b('0x34')]=_0x3c2d0e[_0xb85b('0x27')];}var _0x120863={'url':_0x47ad28+_0xb85b('0x35')+_0x3c2d0e[_0xb85b('0x32')]+_0xb85b('0x36')+_0x3c2d0e[_0xb85b('0x37')],'method':_0xb85b('0x38')};rp(_0x120863)['then'](function(_0x1124da){var _0x12dcc3=_0x1124da['split'](';');var _0x51cec4={'user_key':_0x12dcc3[0x0],'session_key':_0x12dcc3[0x1]};_0x120863={'url':_0x47ad28+_0xb85b('0x39'),'method':_0xb85b('0x3a'),'headers':{'user_key':_0x51cec4['user_key'],'Session_key':_0x51cec4[_0xb85b('0x3b')]},'json':!![],'body':_0x2f9c96};return rp(_0x120863);})[_0xb85b('0x1b')](function(_0x304b6e){if(_0x304b6e[_0xb85b('0x3c')]>=0x1){var _0x5b08ec={'messageId':_0x304b6e[_0xb85b('0x3d')]};if(_0x3c2d0e[_0xb85b('0x33')]!=='GP'||!_0x3c2d0e[_0xb85b('0x3e')]){_0x5b08ec[_0xb85b('0x3f')]=!![];}return _0x20a18b[_0xb85b('0x1c')](_0x5b08ec);}else{return logger['error'](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x31'),util[_0xb85b('0x2f')](_0x304b6e,{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x3368c3){return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),'afterCreate','skebby',util[_0xb85b('0x2f')](_0x3368c3,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x3c2d0e[_0xb85b('0x24')]){var _0x20d14a={'recipient':_0x178b23['phone'],'message':_0x178b23[_0xb85b('0xe')],'sender':_0x3c2d0e['senderString']||_0x3c2d0e[_0xb85b('0x27')],'authorization':_0x3c2d0e[_0xb85b('0x24')]};var _0x41b350={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x20d14a,'json':!![]};rp(_0x41b350)[_0xb85b('0x1b')](function(_0x306a2f){var _0x3dde45={'messageId':_0x306a2f['requestid']};if(!_0x3c2d0e['deliveryReport']){_0x3dde45[_0xb85b('0x3f')]=!![];}return _0x20a18b[_0xb85b('0x1c')](_0x3dde45);})['catch'](function(_0x20c5ed){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x40'),util[_0xb85b('0x2f')](_0x20c5ed,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x3c2d0e[_0xb85b('0x32')]&&_0x3c2d0e[_0xb85b('0x37')]){var _0x20d14a={'messages':[{'source':'xCALLY\x20Motion','to':_0x178b23[_0xb85b('0x27')],'body':_0x178b23[_0xb85b('0xe')],'from':_0x3c2d0e[_0xb85b('0x41')]||_0x3c2d0e['phone']}]};var _0x22e0c5=util[_0xb85b('0x42')](_0xb85b('0x43'),_0x3c2d0e[_0xb85b('0x32')],_0x3c2d0e[_0xb85b('0x37')]);var _0x41b350={'method':_0xb85b('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x20d14a,'headers':{'Authorization':util[_0xb85b('0x42')](_0xb85b('0x44'),new Buffer(_0x22e0c5)[_0xb85b('0x45')](_0xb85b('0x46')))},'json':!![]};rp(_0x41b350)[_0xb85b('0x1b')](function(_0x1fca84){if(_0x1fca84['http_code']>=0xc8&&_0x1fca84['http_code']<=0xce){if(_0x1fca84[_0xb85b('0x47')]&&_0x1fca84[_0xb85b('0x47')][_0xb85b('0x48')]>0x0){var _0x47aa78=_[_0xb85b('0x49')](_0x1fca84['data'][_0xb85b('0x25')]);var _0x320638={'messageId':_0x47aa78['message_id']};if(!_0x3c2d0e['deliveryReport']){_0x320638[_0xb85b('0x3f')]=!![];}return _0x20a18b['update'](_0x320638);}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x4a'),util[_0xb85b('0x2f')](_0x1fca84,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb85b('0x2d'),_0xb85b('0x2e'),'clickSend',util[_0xb85b('0x2f')](_0x1fca84,{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x390316){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x4a'),util['inspect'](_0x390316,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),'afterCreate','clickSend',_0xb85b('0x4b'));}break;case _0xb85b('0x4c'):if(_0x3c2d0e[_0xb85b('0x4d')]&&_0x3c2d0e[_0xb85b('0x24')]){var _0x20d14a={'dst':_0x178b23[_0xb85b('0x27')],'text':_0x178b23[_0xb85b('0xe')],'src':_0x3c2d0e[_0xb85b('0x41')]||_0x3c2d0e[_0xb85b('0x27')],'url':_0x3c2d0e[_0xb85b('0x28')]+_0xb85b('0x29')+_0x178b23['id']+_0xb85b('0x2a')+_0x3c2d0e[_0xb85b('0x4e')]};var _0x22e0c5=util['format']('%s:%s',_0x3c2d0e[_0xb85b('0x4d')],_0x3c2d0e['authToken']);var _0x41b350={'method':_0xb85b('0x3a'),'uri':util[_0xb85b('0x42')](_0xb85b('0x4f'),_0x3c2d0e[_0xb85b('0x4d')]),'body':_0x20d14a,'headers':{'Authorization':util[_0xb85b('0x42')](_0xb85b('0x44'),new Buffer(_0x22e0c5)['toString'](_0xb85b('0x46')))},'json':!![]};rp(_0x41b350)[_0xb85b('0x1b')](function(_0x45e420){var _0x2c166e={'messageId':_0x45e420[_0xb85b('0x50')][0x0]};return _0x20a18b[_0xb85b('0x1c')](_0x2c166e);})[_0xb85b('0x2c')](function(_0x61e50){logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x4c'),util[_0xb85b('0x2f')](_0x61e50,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xb85b('0x51'):if(_0x3c2d0e['username']&&_0x3c2d0e[_0xb85b('0x37')]){if(_0x3c2d0e[_0xb85b('0x52')]){var _0x2d3784={'method':'POST','uri':_0x3c2d0e[_0xb85b('0x52')]+_0xb85b('0x53'),'body':{'username':_0x3c2d0e[_0xb85b('0x32')],'password':_0x3c2d0e[_0xb85b('0x37')]},'json':!![]};return rp(_0x2d3784)[_0xb85b('0x1b')](function(_0x3ef26b){var _0x468ef8={'method':'POST','uri':_0x3c2d0e['baseUrl']+_0xb85b('0x54'),'body':{'messages':[{'from':_0x3c2d0e[_0xb85b('0x27')],'destinations':[{'to':_0x178b23['phone']}],'text':_0x178b23[_0xb85b('0xe')],'notifyUrl':_0x3c2d0e[_0xb85b('0x28')]+_0xb85b('0x29')+_0x178b23['id']+'/status?token='+_0x3c2d0e['token'],'notifyContentType':_0xb85b('0x55'),'callbackData':_0x3c2d0e[_0xb85b('0x27')]+';'+_0x178b23[_0xb85b('0xe')]}]},'headers':{'Authorization':_0xb85b('0x56')+_0x3ef26b[_0xb85b('0x4e')]},'json':!![]};return rp(_0x468ef8)[_0xb85b('0x1b')](function(_0x1b6632){if(_0x1b6632[_0xb85b('0x25')]){var _0xaddb8d={'messageId':_0x1b6632[_0xb85b('0x25')][0x0]['messageId']};if(!_0x3c2d0e[_0xb85b('0x3e')]){_0xaddb8d[_0xb85b('0x3f')]=!![];}return _0x20a18b[_0xb85b('0x1c')](_0xaddb8d);}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x51'),util[_0xb85b('0x2f')](_0x1b6632,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x56b48d){return logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x51'),util['inspect'](_0x56b48d,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x51'),_0xb85b('0x57'));}}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),'afterCreate','infobip',_0xb85b('0x4b'));}break;case'csc':var _0x53d0c3=require(_0xb85b('0x58'));if(_0x3c2d0e[_0xb85b('0x59')]){var _0x22de2b={};_0x22de2b[_0xb85b('0x5a')]=_0x3c2d0e['username'];_0x22de2b['phone']=_0x178b23['phone'];_0x22de2b['sender']=_0x3c2d0e[_0xb85b('0x27')];_0x22de2b[_0xb85b('0x5b')]=_0x178b23[_0xb85b('0xe')];_0x22de2b[_0xb85b('0x5c')]=+new Date();var _0x4af3bf='';var _0x45d2b8='';var _0x2f4eaa=Object[_0xb85b('0x5d')](_0x22de2b);_0x2f4eaa['sort']();for(var _0x52adbf=0x0;_0x52adbf<_0x2f4eaa[_0xb85b('0x5e')];_0x52adbf++){if(_0x4af3bf!=''){_0x4af3bf+='&';}_0x4af3bf+=_0x2f4eaa[_0x52adbf]+'='+encodeURIComponent(_0x22de2b[_0x2f4eaa[_0x52adbf]]);_0x45d2b8+=_0x22de2b[_0x2f4eaa[_0x52adbf]];}_0x45d2b8+=_0x3c2d0e[_0xb85b('0x59')];_0x45d2b8=_0x53d0c3[_0xb85b('0x5f')]('md5')[_0xb85b('0x1c')](_0x45d2b8)['digest'](_0xb85b('0x60'));if(_0x4af3bf!==''){_0x4af3bf+='&';}_0x4af3bf+=_0xb85b('0x61')+_0x45d2b8;var _0x120863={'method':_0xb85b('0x38'),'uri':_0x3c2d0e['baseUrl']+_0xb85b('0x62')+_0x4af3bf,'json':!![]};return rp(_0x120863)[_0xb85b('0x1b')](function(_0x250ba8){var _0x452ebd=Object[_0xb85b('0x5d')](_0x250ba8);if(_0x250ba8[_0x452ebd[0x0]]['error']&&parseInt(_0x250ba8[_0x452ebd[0x0]][_0xb85b('0x1e')])===0x0){var _0x31d9be={'messageId':_0x250ba8[_0x452ebd[0x0]][_0xb85b('0x63')]};if(!_0x3c2d0e['deliveryReport']){_0x31d9be['read']=!![];}return _0x20a18b[_0xb85b('0x1c')](_0x31d9be);}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x64'),util['inspect'](_0x250ba8[_0xb85b('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x40dd8b){return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x64'),util[_0xb85b('0x2f')](_0x40dd8b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb85b('0x64'),_0xb85b('0x65'));}break;case _0xb85b('0x66'):if(_0x3c2d0e[_0xb85b('0x59')]){var _0x5baeba={'method':_0xb85b('0x3a'),'uri':_0xb85b('0x67'),'headers':{'Authorization':_0x3c2d0e['apiKey']},'body':{'content':_0x178b23[_0xb85b('0xe')],'to':[_0x178b23[_0xb85b('0x27')]],'from':_0x3c2d0e[_0xb85b('0x27')],'binary':![],'clientMessageId':_0xb85b('0x68'),'charset':_0xb85b('0x69')},'json':!![]};rp(_0x5baeba)[_0xb85b('0x1b')](function(_0x559cdd){if(!_0x559cdd[_0xb85b('0x1e')]){var _0xacfdf1={'messageId':_0x559cdd[_0xb85b('0x25')][0x0]['apiMessageId']};if(!_0x3c2d0e['deliveryReport']){_0xacfdf1['read']=!![];}return _0x20a18b['update'](_0xacfdf1);}else{return logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0xb85b('0x2f')](_0x559cdd['error'],{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x3e13b3){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x66'),util[_0xb85b('0x2f')](_0x3e13b3,{'showHidden':![],'depth':null}));});}else{logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x66'),_0xb85b('0x65'));}break;case _0xb85b('0x6a'):if(_0x3c2d0e[_0xb85b('0x32')]&&_0x3c2d0e['password']){var _0x22e0c5=util[_0xb85b('0x42')](_0xb85b('0x43'),_0x3c2d0e[_0xb85b('0x32')],_0x3c2d0e[_0xb85b('0x37')]);var _0x41b350={'method':_0xb85b('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3c2d0e[_0xb85b('0x6b')]+_0xb85b('0x6c'),'body':{'to':[_0x178b23[_0xb85b('0x27')]],'text':_0x178b23[_0xb85b('0xe')],'from':_0x3c2d0e[_0xb85b('0x27')],'applicationId':_0x3c2d0e[_0xb85b('0x6d')]},'headers':{'Authorization':util[_0xb85b('0x42')](_0xb85b('0x44'),new Buffer(_0x22e0c5)[_0xb85b('0x45')](_0xb85b('0x46')))},'json':!![]};rp(_0x41b350)['then'](function(_0x2ec314){if(_0x2ec314['id']){var _0x369448={'messageId':_0x2ec314['id']};return _0x20a18b[_0xb85b('0x1c')](_0x369448);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x6a'),util[_0xb85b('0x2f')](_0x2ec314,{'showHidden':![],'depth':null}));}})['catch'](function(_0x39fbbe){logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x6a'),util[_0xb85b('0x2f')](_0x39fbbe,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x6a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb85b('0x6e'):if(_0x3c2d0e[_0xb85b('0x59')]){var _0x5dead0={};var _0x120863={'method':_0xb85b('0x3a'),'uri':_0xb85b('0x6f'),'headers':{'Authorization':_0xb85b('0x70')+_0x3c2d0e[_0xb85b('0x59')],'Content-Type':_0xb85b('0x55')},'body':{'from':_0x3c2d0e['phone'],'to':_0x178b23['phone'],'text':_0x178b23[_0xb85b('0xe')]},'json':!![]};return rp(_0x120863)[_0xb85b('0x1b')](function(_0x31d403){if(_0x31d403[_0xb85b('0x71')]==0xca){_0x5dead0[_0xb85b('0x72')]=_0x31d403;var _0x4e128f={'method':_0xb85b('0x3a'),'uri':_0xb85b('0x73'),'headers':{'Authorization':_0xb85b('0x70')+_0x3c2d0e['apiKey'],'Content-Type':_0xb85b('0x55')},'body':{'refid':_0x5dead0[_0xb85b('0x72')][_0xb85b('0x74')]},'json':!![]};return rp(_0x4e128f)['then'](function(_0x493b01){_0x5dead0[_0xb85b('0x75')]=_0x493b01;var _0x4e9ab2={'messageId':_0x5dead0[_0xb85b('0x72')][_0xb85b('0x74')],'read':!![]};return _0x20a18b[_0xb85b('0x1c')](_0x4e9ab2);});}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),_0xb85b('0x6e'),util[_0xb85b('0x2f')](_0x31d403,{'showHidden':![],'depth':null}));}})[_0xb85b('0x2c')](function(_0x464367){return logger[_0xb85b('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb85b('0x2e'),_0xb85b('0x6e'),util[_0xb85b('0x2f')](_0x464367,{'showHidden':![],'depth':null}));});}else{return logger[_0xb85b('0x1e')](_0xb85b('0x2d'),_0xb85b('0x2e'),'intelepeer',_0xb85b('0x76'));}break;}}})[_0xb85b('0x77')](function(){_0x209fd0();});}else{_0x209fd0();}}},'charset':_0xb85b('0x78'),'collate':_0xb85b('0x79')});};
\ No newline at end of file
+var _0xc64d=['UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','toString','base64','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','catch','error','find','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','senderString','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','http_code','data','message_id','read','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','token','infobip','csc','crypto','apiKey','login','timestamp','keys','length','createHash','digest','hex','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid'];(function(_0x1c1327,_0x29f7f1){var _0x25ab1b=function(_0x2e793a){while(--_0x2e793a){_0x1c1327['push'](_0x1c1327['shift']());}};_0x25ab1b(++_0x29f7f1);}(_0xc64d,0xfd));var _0xdc64=function(_0x1a8964,_0x936e68){_0x1a8964=_0x1a8964-0x0;var _0x4e155b=_0xc64d[_0x1a8964];return _0x4e155b;};'use strict';var _=require(_0xdc64('0x0'));var util=require('util');var logger=require(_0xdc64('0x1'))(_0xdc64('0x2'));var moment=require(_0xdc64('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc64('0x4'));var rimraf=require(_0xdc64('0x5'));var config=require(_0xdc64('0x6'));var attributes=require('./smsMessage.attributes');module[_0xdc64('0x7')]=function(_0x573308,_0x24a011){return _0x573308[_0xdc64('0x8')](_0xdc64('0x9'),attributes,{'tableName':_0xdc64('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xdc64('0xb')]},{'name':_0xdc64('0xc'),'fields':[_0xdc64('0xd')],'type':_0xdc64('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52ba0b,_0x13ad3a,_0x3508b8){var _0x4c1a68=_0x573308['models'];var _0x5ad633=_0x52ba0b['get']({'plain':!![]});if(_0x5ad633[_0xdc64('0xf')][_0xdc64('0x10')]()==='in'||_0x5ad633[_0xdc64('0xf')][_0xdc64('0x10')]()===_0xdc64('0x11')&&!_0x5ad633[_0xdc64('0x12')]&&!_[_0xdc64('0x13')](_0x5ad633['UserId'])&&!_['isNil'](_0x5ad633[_0xdc64('0x14')])){_0x4c1a68[_0xdc64('0x15')][_0xdc64('0x16')]({'where':{'id':_0x5ad633[_0xdc64('0x14')]}})[_0xdc64('0x17')](function(_0x1a84cb){if(_0x1a84cb){_0x1a84cb[_0xdc64('0x18')]({'lastMsgAt':_0x5ad633['createdAt'],'lastMsgDirection':_0x5ad633[_0xdc64('0xf')]['toLowerCase']()});}})[_0xdc64('0x19')](function(_0x6b75f8){console[_0xdc64('0x1a')](_0x6b75f8);});}if(_0x5ad633[_0xdc64('0xf')]===_0xdc64('0x11')&&!_0x5ad633[_0xdc64('0x12')]){var _0x5d2ff9;_0x4c1a68['SmsAccount'][_0xdc64('0x1b')]({'where':{'id':_0x5ad633['SmsAccountId']},'raw':!![]})['then'](function(_0x550404){_0x5d2ff9=_0x550404;if(_0x5d2ff9&&_0x5d2ff9[_0xdc64('0x1c')]){switch(_0x5d2ff9[_0xdc64('0x1c')]){case _0xdc64('0x1d'):var _0x27b068=require('twilio');if(_0x5d2ff9[_0xdc64('0x1e')]&&_0x5d2ff9[_0xdc64('0x1f')]&&_0x5d2ff9[_0xdc64('0x20')]){var _0x2c6ab2=new _0x27b068(_0x5d2ff9[_0xdc64('0x1e')],_0x5d2ff9[_0xdc64('0x1f')]);_0x2c6ab2[_0xdc64('0x21')]['create']({'body':_0x5ad633[_0xdc64('0xd')],'to':_0x5ad633[_0xdc64('0x20')],'from':_0x5d2ff9[_0xdc64('0x20')],'statusCallback':_0x5d2ff9[_0xdc64('0x22')]+_0xdc64('0x23')+_0x5ad633['id']+'/status?token='+_0x5d2ff9['token']})[_0xdc64('0x17')](function(_0x23883a){if(_0x23883a[_0xdc64('0x24')]){return _0x52ba0b[_0xdc64('0x18')]({'messageId':_0x23883a[_0xdc64('0x24')]});}})[_0xdc64('0x19')](function(_0x59c780){logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x1d'),util[_0xdc64('0x27')](_0x59c780,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x1d'),_0xdc64('0x28'));}break;case _0xdc64('0x29'):var _0xb3ae93=_0xdc64('0x2a');if(_0x5d2ff9[_0xdc64('0x2b')]&&_0x5d2ff9[_0xdc64('0x2c')]){var _0xe369cf={'recipient':[_0x5ad633[_0xdc64('0x20')]],'message':_0x5ad633[_0xdc64('0xd')],'message_type':_0x5d2ff9[_0xdc64('0x2d')]};if(_0x5d2ff9[_0xdc64('0x2d')]&&_0x5d2ff9[_0xdc64('0x2d')]!=='SI'){_0xe369cf['sender']=_0x5d2ff9[_0xdc64('0x20')];}var _0x17ef01={'url':_0xb3ae93+_0xdc64('0x2e')+_0x5d2ff9['username']+_0xdc64('0x2f')+_0x5d2ff9['password'],'method':_0xdc64('0x30')};rp(_0x17ef01)[_0xdc64('0x17')](function(_0x325fdc){var _0x3fb297=_0x325fdc['split'](';');var _0x48b3d0={'user_key':_0x3fb297[0x0],'session_key':_0x3fb297[0x1]};_0x17ef01={'url':_0xb3ae93+_0xdc64('0x31'),'method':_0xdc64('0x32'),'headers':{'user_key':_0x48b3d0[_0xdc64('0x33')],'Session_key':_0x48b3d0[_0xdc64('0x34')]},'json':!![],'body':_0xe369cf};return rp(_0x17ef01);})[_0xdc64('0x17')](function(_0x32b594){if(_0x32b594[_0xdc64('0x35')]>=0x1){var _0x2f1ab7={'messageId':_0x32b594[_0xdc64('0x36')]};if(_0x5d2ff9['smsMethod']!=='GP'||!_0x5d2ff9[_0xdc64('0x37')]){_0x2f1ab7['read']=!![];}return _0x52ba0b[_0xdc64('0x18')](_0x2f1ab7);}else{return logger[_0xdc64('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc64('0x26'),'skebby',util['inspect'](_0x32b594,{'showHidden':![],'depth':null}));}})[_0xdc64('0x19')](function(_0x37005b){return logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),'skebby',util['inspect'](_0x37005b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x29'),_0xdc64('0x38'));}break;case'connectel':if(_0x5d2ff9['authToken']){var _0x1f8ffa={'recipient':_0x5ad633[_0xdc64('0x20')],'message':_0x5ad633[_0xdc64('0xd')],'sender':_0x5d2ff9[_0xdc64('0x39')]||_0x5d2ff9[_0xdc64('0x20')],'authorization':_0x5d2ff9[_0xdc64('0x1f')]};var _0x13ad3a={'method':_0xdc64('0x32'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1f8ffa,'json':!![]};rp(_0x13ad3a)[_0xdc64('0x17')](function(_0x1658d8){var _0x2efe6e={'messageId':_0x1658d8[_0xdc64('0x3a')]};if(!_0x5d2ff9[_0xdc64('0x37')]){_0x2efe6e['read']=!![];}return _0x52ba0b[_0xdc64('0x18')](_0x2efe6e);})[_0xdc64('0x19')](function(_0x1e4a34){logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x3b'),util['inspect'](_0x1e4a34,{'showHidden':![],'depth':null}));});}else{logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x3b'),_0xdc64('0x3c'));}break;case _0xdc64('0x3d'):if(_0x5d2ff9[_0xdc64('0x2b')]&&_0x5d2ff9[_0xdc64('0x2c')]){var _0x1f8ffa={'messages':[{'source':_0xdc64('0x3e'),'to':_0x5ad633[_0xdc64('0x20')],'body':_0x5ad633[_0xdc64('0xd')],'from':_0x5d2ff9[_0xdc64('0x39')]||_0x5d2ff9[_0xdc64('0x20')]}]};var _0x3d18e5=util[_0xdc64('0x3f')](_0xdc64('0x40'),_0x5d2ff9[_0xdc64('0x2b')],_0x5d2ff9[_0xdc64('0x2c')]);var _0x13ad3a={'method':_0xdc64('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1f8ffa,'headers':{'Authorization':util[_0xdc64('0x3f')](_0xdc64('0x41'),new Buffer(_0x3d18e5)['toString']('base64'))},'json':!![]};rp(_0x13ad3a)[_0xdc64('0x17')](function(_0x5e8079){if(_0x5e8079[_0xdc64('0x42')]>=0xc8&&_0x5e8079[_0xdc64('0x42')]<=0xce){if(_0x5e8079[_0xdc64('0x43')]&&_0x5e8079['data']['queued_count']>0x0){var _0xca1fd9=_['head'](_0x5e8079[_0xdc64('0x43')]['messages']);var _0x16780b={'messageId':_0xca1fd9[_0xdc64('0x44')]};if(!_0x5d2ff9['deliveryReport']){_0x16780b[_0xdc64('0x45')]=!![];}return _0x52ba0b['update'](_0x16780b);}else{logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x46'),util[_0xdc64('0x27')](_0x5e8079,{'showHidden':![],'depth':null}));}}else{logger[_0xdc64('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc64('0x26'),_0xdc64('0x46'),util[_0xdc64('0x27')](_0x5e8079,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4359b0){logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x46'),util[_0xdc64('0x27')](_0x4359b0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x46'),_0xdc64('0x38'));}break;case _0xdc64('0x47'):if(_0x5d2ff9[_0xdc64('0x48')]&&_0x5d2ff9[_0xdc64('0x1f')]){var _0x1f8ffa={'dst':_0x5ad633[_0xdc64('0x20')],'text':_0x5ad633[_0xdc64('0xd')],'src':_0x5d2ff9[_0xdc64('0x39')]||_0x5d2ff9[_0xdc64('0x20')],'url':_0x5d2ff9['remote']+_0xdc64('0x23')+_0x5ad633['id']+_0xdc64('0x49')+_0x5d2ff9['token']};var _0x3d18e5=util[_0xdc64('0x3f')](_0xdc64('0x40'),_0x5d2ff9[_0xdc64('0x48')],_0x5d2ff9[_0xdc64('0x1f')]);var _0x13ad3a={'method':_0xdc64('0x32'),'uri':util[_0xdc64('0x3f')](_0xdc64('0x4a'),_0x5d2ff9[_0xdc64('0x48')]),'body':_0x1f8ffa,'headers':{'Authorization':util['format'](_0xdc64('0x41'),new Buffer(_0x3d18e5)['toString']('base64'))},'json':!![]};rp(_0x13ad3a)[_0xdc64('0x17')](function(_0x3f46f6){var _0xbdcaeb={'messageId':_0x3f46f6['message_uuid'][0x0]};return _0x52ba0b[_0xdc64('0x18')](_0xbdcaeb);})[_0xdc64('0x19')](function(_0x1fe633){logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x47'),util[_0xdc64('0x27')](_0x1fe633,{'showHidden':![],'depth':null}));});}else{logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x47'),_0xdc64('0x4b'));}break;case'infobip':if(_0x5d2ff9[_0xdc64('0x2b')]&&_0x5d2ff9[_0xdc64('0x2c')]){if(_0x5d2ff9[_0xdc64('0x4c')]){var _0x58e561={'method':_0xdc64('0x32'),'uri':_0x5d2ff9[_0xdc64('0x4c')]+_0xdc64('0x4d'),'body':{'username':_0x5d2ff9[_0xdc64('0x2b')],'password':_0x5d2ff9[_0xdc64('0x2c')]},'json':!![]};return rp(_0x58e561)[_0xdc64('0x17')](function(_0x105896){var _0x3c2fd5={'method':_0xdc64('0x32'),'uri':_0x5d2ff9[_0xdc64('0x4c')]+_0xdc64('0x4e'),'body':{'messages':[{'from':_0x5d2ff9[_0xdc64('0x20')],'destinations':[{'to':_0x5ad633[_0xdc64('0x20')]}],'text':_0x5ad633[_0xdc64('0xd')],'notifyUrl':_0x5d2ff9[_0xdc64('0x22')]+'/api/sms/messages/'+_0x5ad633['id']+_0xdc64('0x49')+_0x5d2ff9['token'],'notifyContentType':_0xdc64('0x4f'),'callbackData':_0x5d2ff9[_0xdc64('0x20')]+';'+_0x5ad633[_0xdc64('0xd')]}]},'headers':{'Authorization':_0xdc64('0x50')+_0x105896[_0xdc64('0x51')]},'json':!![]};return rp(_0x3c2fd5)[_0xdc64('0x17')](function(_0x2ce9ee){if(_0x2ce9ee[_0xdc64('0x21')]){var _0x4d8f61={'messageId':_0x2ce9ee[_0xdc64('0x21')][0x0][_0xdc64('0xb')]};if(!_0x5d2ff9[_0xdc64('0x37')]){_0x4d8f61[_0xdc64('0x45')]=!![];}return _0x52ba0b[_0xdc64('0x18')](_0x4d8f61);}else{return logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x52'),util[_0xdc64('0x27')](_0x2ce9ee,{'showHidden':![],'depth':null}));}});})[_0xdc64('0x19')](function(_0x4ae517){return logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x52'),util[_0xdc64('0x27')](_0x4ae517,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc64('0x26'),_0xdc64('0x52'),_0xdc64('0x38'));}break;case _0xdc64('0x53'):var _0x3a46d6=require(_0xdc64('0x54'));if(_0x5d2ff9[_0xdc64('0x55')]){var _0x15417e={};_0x15417e[_0xdc64('0x56')]=_0x5d2ff9[_0xdc64('0x2b')];_0x15417e[_0xdc64('0x20')]=_0x5ad633['phone'];_0x15417e['sender']=_0x5d2ff9['phone'];_0x15417e['text']=_0x5ad633[_0xdc64('0xd')];_0x15417e[_0xdc64('0x57')]=+new Date();var _0x16dfdf='';var _0x42a92f='';var _0x15b26a=Object[_0xdc64('0x58')](_0x15417e);_0x15b26a['sort']();for(var _0x52f710=0x0;_0x52f710<_0x15b26a[_0xdc64('0x59')];_0x52f710++){if(_0x16dfdf!=''){_0x16dfdf+='&';}_0x16dfdf+=_0x15b26a[_0x52f710]+'='+encodeURIComponent(_0x15417e[_0x15b26a[_0x52f710]]);_0x42a92f+=_0x15417e[_0x15b26a[_0x52f710]];}_0x42a92f+=_0x5d2ff9[_0xdc64('0x55')];_0x42a92f=_0x3a46d6[_0xdc64('0x5a')]('md5')[_0xdc64('0x18')](_0x42a92f)[_0xdc64('0x5b')](_0xdc64('0x5c'));if(_0x16dfdf!==''){_0x16dfdf+='&';}_0x16dfdf+='signature='+_0x42a92f;var _0x17ef01={'method':'GET','uri':_0x5d2ff9[_0xdc64('0x4c')]+_0xdc64('0x5d')+_0x16dfdf,'json':!![]};return rp(_0x17ef01)['then'](function(_0x36141b){var _0x286547=Object[_0xdc64('0x58')](_0x36141b);if(_0x36141b[_0x286547[0x0]][_0xdc64('0x1a')]&&parseInt(_0x36141b[_0x286547[0x0]]['error'])===0x0){var _0x426ed7={'messageId':_0x36141b[_0x286547[0x0]][_0xdc64('0x5e')]};if(!_0x5d2ff9[_0xdc64('0x37')]){_0x426ed7[_0xdc64('0x45')]=!![];}return _0x52ba0b[_0xdc64('0x18')](_0x426ed7);}else{return logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate','csc',util[_0xdc64('0x27')](_0x36141b[_0xdc64('0x1a')],{'showHidden':![],'depth':null}));}})[_0xdc64('0x19')](function(_0xecfe74){return logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x53'),util[_0xdc64('0x27')](_0xecfe74,{'showHidden':![],'depth':null}));});}else{logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x53'),'Missing\x20parameters:\x20apiKey');}break;case _0xdc64('0x5f'):if(_0x5d2ff9[_0xdc64('0x55')]){var _0x52c272={'method':_0xdc64('0x32'),'uri':_0xdc64('0x60'),'headers':{'Authorization':_0x5d2ff9['apiKey']},'body':{'content':_0x5ad633[_0xdc64('0xd')],'to':[_0x5ad633[_0xdc64('0x20')]],'from':_0x5d2ff9['phone'],'binary':![],'clientMessageId':_0xdc64('0x61'),'charset':_0xdc64('0x62')},'json':!![]};rp(_0x52c272)[_0xdc64('0x17')](function(_0x238184){if(!_0x238184[_0xdc64('0x1a')]){var _0x22a1bf={'messageId':_0x238184[_0xdc64('0x21')][0x0][_0xdc64('0x63')]};if(!_0x5d2ff9[_0xdc64('0x37')]){_0x22a1bf[_0xdc64('0x45')]=!![];}return _0x52ba0b[_0xdc64('0x18')](_0x22a1bf);}else{return logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x5f'),util[_0xdc64('0x27')](_0x238184[_0xdc64('0x1a')],{'showHidden':![],'depth':null}));}})[_0xdc64('0x19')](function(_0x1e3fb0){return logger[_0xdc64('0x1a')](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x5f'),util[_0xdc64('0x27')](_0x1e3fb0,{'showHidden':![],'depth':null}));});}else{logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x5f'),_0xdc64('0x64'));}break;case _0xdc64('0x65'):if(_0x5d2ff9['username']&&_0x5d2ff9[_0xdc64('0x2c')]){var _0x3d18e5=util[_0xdc64('0x3f')](_0xdc64('0x40'),_0x5d2ff9[_0xdc64('0x2b')],_0x5d2ff9[_0xdc64('0x2c')]);var _0x13ad3a={'method':_0xdc64('0x32'),'uri':_0xdc64('0x66')+_0x5d2ff9['accountId']+'/messages','body':{'to':[_0x5ad633[_0xdc64('0x20')]],'text':_0x5ad633['body'],'from':_0x5d2ff9[_0xdc64('0x20')],'applicationId':_0x5d2ff9[_0xdc64('0x67')]},'headers':{'Authorization':util[_0xdc64('0x3f')](_0xdc64('0x41'),new Buffer(_0x3d18e5)[_0xdc64('0x68')](_0xdc64('0x69')))},'json':!![]};rp(_0x13ad3a)['then'](function(_0x4e1416){if(_0x4e1416['id']){var _0x3d4972={'messageId':_0x4e1416['id']};return _0x52ba0b[_0xdc64('0x18')](_0x3d4972);}else{logger[_0xdc64('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdc64('0x65'),util['inspect'](_0x4e1416,{'showHidden':![],'depth':null}));}})[_0xdc64('0x19')](function(_0x44f21f){logger['error'](_0xdc64('0x25'),'afterCreate',_0xdc64('0x65'),util['inspect'](_0x44f21f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc64('0x25'),'afterCreate',_0xdc64('0x65'),_0xdc64('0x38'));}break;case _0xdc64('0x6a'):if(_0x5d2ff9['apiKey']){var _0x4e4449={};var _0x17ef01={'method':_0xdc64('0x32'),'uri':_0xdc64('0x6b'),'headers':{'Authorization':'Bearer\x20'+_0x5d2ff9[_0xdc64('0x55')],'Content-Type':_0xdc64('0x4f')},'body':{'from':_0x5d2ff9[_0xdc64('0x20')],'to':_0x5ad633[_0xdc64('0x20')],'text':_0x5ad633[_0xdc64('0xd')]},'json':!![]};return rp(_0x17ef01)[_0xdc64('0x17')](function(_0xe60425){if(_0xe60425[_0xdc64('0x6c')]==0xca){_0x4e4449[_0xdc64('0x6d')]=_0xe60425;var _0x3551af={'method':_0xdc64('0x32'),'uri':_0xdc64('0x6e'),'headers':{'Authorization':_0xdc64('0x6f')+_0x5d2ff9[_0xdc64('0x55')],'Content-Type':_0xdc64('0x4f')},'body':{'refid':_0x4e4449[_0xdc64('0x6d')][_0xdc64('0x70')]},'json':!![]};return rp(_0x3551af)['then'](function(_0x3c4c73){_0x4e4449[_0xdc64('0x71')]=_0x3c4c73;var _0x4a48a4={'messageId':_0x4e4449[_0xdc64('0x6d')][_0xdc64('0x70')],'read':!![]};return _0x52ba0b[_0xdc64('0x18')](_0x4a48a4);});}else{return logger['error'](_0xdc64('0x25'),_0xdc64('0x26'),_0xdc64('0x6a'),util['inspect'](_0xe60425,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ab2a7){return logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x6a'),util[_0xdc64('0x27')](_0x4ab2a7,{'showHidden':![],'depth':null}));});}else{return logger[_0xdc64('0x1a')](_0xdc64('0x25'),'afterCreate',_0xdc64('0x6a'),_0xdc64('0x72'));}break;}}})['finally'](function(){_0x3508b8();});}else{_0x3508b8();}}},'charset':_0xdc64('0x73'),'collate':_0xdc64('0x74')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb574=['request\x20sent','error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb574,0x9a));var _0x4b57=function(_0x3f16f3,_0x3e067a){_0x3f16f3=_0x3f16f3-0x0;var _0x292838=_0xb574[_0x3f16f3];return _0x292838;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require(_0x4b57('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require(_0x4b57('0x4'));var db=require(_0x4b57('0x5'))['db'];var utils=require(_0x4b57('0x6'));var logger=require(_0x4b57('0x7'))(_0x4b57('0x8'));var config=require(_0x4b57('0x9'));var jayson=require(_0x4b57('0xa'));var client=jayson[_0x4b57('0xb')][_0x4b57('0xc')]({'port':0x232a});config[_0x4b57('0xd')]=_[_0x4b57('0xe')](config[_0x4b57('0xd')],{'host':_0x4b57('0xf'),'port':0x18eb});var socket=require(_0x4b57('0x10'))(new Redis(config[_0x4b57('0xd')]));require('./smsMessage.socket')[_0x4b57('0x11')](socket);function respondWithRpcPromise(_0x2090e0,_0xabe7ef,_0x2a0aba){return new BPromise(function(_0x199eac,_0x59f836){return client['request'](_0x2090e0,_0x2a0aba)[_0x4b57('0x12')](function(_0x5598b3){logger[_0x4b57('0x13')](_0x4b57('0x14'),_0xabe7ef,_0x4b57('0x15'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xabe7ef,'request\x20sent',JSON['stringify'](_0x5598b3));if(_0x5598b3[_0x4b57('0x16')]){if(_0x5598b3['error'][_0x4b57('0x17')]===0x1f4){logger[_0x4b57('0x16')](_0x4b57('0x14'),_0xabe7ef,_0x5598b3['error'][_0x4b57('0x18')]);return _0x59f836(_0x5598b3[_0x4b57('0x16')][_0x4b57('0x18')]);}logger['error'](_0x4b57('0x14'),_0xabe7ef,_0x5598b3[_0x4b57('0x16')]['message']);return _0x199eac(_0x5598b3[_0x4b57('0x16')][_0x4b57('0x18')]);}else{logger[_0x4b57('0x13')]('SmsMessage,\x20%s,\x20%s',_0xabe7ef,_0x4b57('0x15'));_0x199eac(_0x5598b3[_0x4b57('0x19')]['message']);}})[_0x4b57('0x1a')](function(_0x161deb){logger['error'](_0x4b57('0x14'),_0xabe7ef,_0x161deb);_0x59f836(_0x161deb);});});}exports['CreateSmsMessage']=function(_0x33050a){var _0x3c19c6=this;return new Promise(function(_0x1a4330,_0x4950e0){return db[_0x4b57('0x1b')][_0x4b57('0x1c')](_0x33050a[_0x4b57('0x1d')],{'raw':_0x33050a[_0x4b57('0x1e')]?_0x33050a['options'][_0x4b57('0x1f')]===undefined?!![]:![]:!![]})[_0x4b57('0x12')](function(_0x4a3b1b){logger['info'](_0x4b57('0x20'),_0x33050a);logger[_0x4b57('0x21')](_0x4b57('0x20'),_0x33050a,JSON[_0x4b57('0x22')](_0x4a3b1b));_0x1a4330(_0x4a3b1b);})[_0x4b57('0x1a')](function(_0x3c9cf0){logger[_0x4b57('0x16')]('CreateSmsMessage',_0x3c9cf0[_0x4b57('0x18')],_0x33050a);_0x4950e0(_0x3c19c6[_0x4b57('0x16')](0x1f4,_0x3c9cf0[_0x4b57('0x18')]));});});};
\ No newline at end of file
+var _0x2bc2=['error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5c4aef,_0x474f3b){var _0x1f38ab=function(_0x46f5e0){while(--_0x46f5e0){_0x5c4aef['push'](_0x5c4aef['shift']());}};_0x1f38ab(++_0x474f3b);}(_0x2bc2,0x1c4));var _0x22bc=function(_0xbee312,_0x131d25){_0xbee312=_0xbee312-0x0;var _0x4a47dc=_0x2bc2[_0xbee312];return _0x4a47dc;};'use strict';var _=require(_0x22bc('0x0'));var util=require(_0x22bc('0x1'));var moment=require(_0x22bc('0x2'));var BPromise=require(_0x22bc('0x3'));var rs=require(_0x22bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22bc('0x5'));var logger=require(_0x22bc('0x6'))(_0x22bc('0x7'));var config=require(_0x22bc('0x8'));var jayson=require(_0x22bc('0x9'));var client=jayson[_0x22bc('0xa')][_0x22bc('0xb')]({'port':0x232a});config[_0x22bc('0xc')]=_[_0x22bc('0xd')](config[_0x22bc('0xc')],{'host':_0x22bc('0xe'),'port':0x18eb});var socket=require(_0x22bc('0xf'))(new Redis(config[_0x22bc('0xc')]));require(_0x22bc('0x10'))['register'](socket);function respondWithRpcPromise(_0x847b26,_0x466b33,_0x3fccd8){return new BPromise(function(_0x3caafe,_0x16c84f){return client[_0x22bc('0x11')](_0x847b26,_0x3fccd8)[_0x22bc('0x12')](function(_0x58bc05){logger[_0x22bc('0x13')](_0x22bc('0x14'),_0x466b33,_0x22bc('0x15'));logger[_0x22bc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x466b33,_0x22bc('0x15'),JSON[_0x22bc('0x17')](_0x58bc05));if(_0x58bc05['error']){if(_0x58bc05[_0x22bc('0x18')][_0x22bc('0x19')]===0x1f4){logger[_0x22bc('0x18')](_0x22bc('0x14'),_0x466b33,_0x58bc05[_0x22bc('0x18')][_0x22bc('0x1a')]);return _0x16c84f(_0x58bc05[_0x22bc('0x18')][_0x22bc('0x1a')]);}logger[_0x22bc('0x18')](_0x22bc('0x14'),_0x466b33,_0x58bc05[_0x22bc('0x18')]['message']);return _0x3caafe(_0x58bc05[_0x22bc('0x18')][_0x22bc('0x1a')]);}else{logger['info'](_0x22bc('0x14'),_0x466b33,_0x22bc('0x15'));_0x3caafe(_0x58bc05['result'][_0x22bc('0x1a')]);}})[_0x22bc('0x1b')](function(_0x5ae818){logger[_0x22bc('0x18')]('SmsMessage,\x20%s,\x20%s',_0x466b33,_0x5ae818);_0x16c84f(_0x5ae818);});});}exports[_0x22bc('0x1c')]=function(_0x17277c){var _0x9a955=this;return new Promise(function(_0x942a3c,_0xd4d17){return db[_0x22bc('0x1d')][_0x22bc('0x1e')](_0x17277c[_0x22bc('0x1f')],{'raw':_0x17277c[_0x22bc('0x20')]?_0x17277c[_0x22bc('0x20')][_0x22bc('0x21')]===undefined?!![]:![]:!![]})[_0x22bc('0x12')](function(_0x105f12){logger['info']('CreateSmsMessage',_0x17277c);logger[_0x22bc('0x16')]('CreateSmsMessage',_0x17277c,JSON[_0x22bc('0x17')](_0x105f12));_0x942a3c(_0x105f12);})[_0x22bc('0x1b')](function(_0x525c5c){logger[_0x22bc('0x18')]('CreateSmsMessage',_0x525c5c['message'],_0x17277c);_0xd4d17(_0x9a955[_0x22bc('0x18')](0x1f4,_0x525c5c['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68e0=['length','smsMessage:','./smsMessage.events','save','remove','update','emit','register'];(function(_0x3c1c35,_0x12e8b6){var _0x43a965=function(_0x543bcc){while(--_0x543bcc){_0x3c1c35['push'](_0x3c1c35['shift']());}};_0x43a965(++_0x12e8b6);}(_0x68e0,0x122));var _0x068e=function(_0x465145,_0x47c352){_0x465145=_0x465145-0x0;var _0x55e404=_0x68e0[_0x465145];return _0x55e404;};'use strict';var SmsMessageEvents=require(_0x068e('0x0'));var events=[_0x068e('0x1'),_0x068e('0x2'),_0x068e('0x3')];function createListener(_0xbf1c45,_0x1d08a0){return function(_0x176cc1){_0x1d08a0[_0x068e('0x4')](_0xbf1c45,_0x176cc1);};}function removeListener(_0x249b75,_0x56058f){return function(){SmsMessageEvents['removeListener'](_0x249b75,_0x56058f);};}exports[_0x068e('0x5')]=function(_0x2c2cb8){for(var _0x36c854=0x0,_0x160a07=events[_0x068e('0x6')];_0x36c854<_0x160a07;_0x36c854++){var _0x9d40b9=events[_0x36c854];var _0x5d1269=createListener(_0x068e('0x7')+_0x9d40b9,_0x2c2cb8);SmsMessageEvents['on'](_0x9d40b9,_0x5d1269);}};
\ No newline at end of file
+var _0x462e=['length','./smsMessage.events','save','remove','update','emit','register'];(function(_0x5c454a,_0x70fc39){var _0x27116a=function(_0x50ded5){while(--_0x50ded5){_0x5c454a['push'](_0x5c454a['shift']());}};_0x27116a(++_0x70fc39);}(_0x462e,0xf6));var _0xe462=function(_0x3bdb48,_0x4c3146){_0x3bdb48=_0x3bdb48-0x0;var _0x240920=_0x462e[_0x3bdb48];return _0x240920;};'use strict';var SmsMessageEvents=require(_0xe462('0x0'));var events=[_0xe462('0x1'),_0xe462('0x2'),_0xe462('0x3')];function createListener(_0x223a87,_0x1a3156){return function(_0x15c6b7){_0x1a3156[_0xe462('0x4')](_0x223a87,_0x15c6b7);};}function removeListener(_0x4a6e15,_0x2980e3){return function(){SmsMessageEvents['removeListener'](_0x4a6e15,_0x2980e3);};}exports[_0xe462('0x5')]=function(_0x3b7d90){for(var _0x314bea=0x0,_0x6d2e00=events[_0xe462('0x6')];_0x314bea<_0x6d2e00;_0x314bea++){var _0x48ac5d=events[_0x314bea];var _0x155801=createListener('smsMessage:'+_0x48ac5d,_0x3b7d90);SmsMessageEvents['on'](_0x48ac5d,_0x155801);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x481c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','getTeams','/:id/users','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xdaa67e,_0x3f2c22){var _0x1bd67c=function(_0x5d762d){while(--_0x5d762d){_0xdaa67e['push'](_0xdaa67e['shift']());}};_0x1bd67c(++_0x3f2c22);}(_0x481c,0xae));var _0xc481=function(_0x4017aa,_0x16d04f){_0x4017aa=_0x4017aa-0x0;var _0x53c895=_0x481c[_0x4017aa];return _0x53c895;};'use strict';var multer=require(_0xc481('0x0'));var util=require(_0xc481('0x1'));var path=require(_0xc481('0x2'));var timeout=require(_0xc481('0x3'));var express=require(_0xc481('0x4'));var router=express[_0xc481('0x5')]();var fs_extra=require(_0xc481('0x6'));var auth=require(_0xc481('0x7'));var interaction=require(_0xc481('0x8'));var config=require(_0xc481('0x9'));var controller=require(_0xc481('0xa'));router[_0xc481('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc481('0xb')]('/describe',auth[_0xc481('0xc')](),controller[_0xc481('0xd')]);router['get'](_0xc481('0xe'),auth[_0xc481('0xc')](),controller[_0xc481('0xf')]);router[_0xc481('0xb')]('/:id/members',auth[_0xc481('0xc')](),controller[_0xc481('0x10')]);router[_0xc481('0xb')]('/:id/teams',auth[_0xc481('0xc')](),controller[_0xc481('0x11')]);router['get'](_0xc481('0x12'),auth[_0xc481('0xc')](),controller['getAgents']);router['post']('/',auth[_0xc481('0xc')](),controller[_0xc481('0x13')]);router['post'](_0xc481('0x14'),auth['isAuthenticated'](),controller[_0xc481('0x15')]);router['post'](_0xc481('0x12'),auth['isAuthenticated'](),controller[_0xc481('0x16')]);router[_0xc481('0x17')](_0xc481('0xe'),auth[_0xc481('0xc')](),controller[_0xc481('0x18')]);router[_0xc481('0x19')](_0xc481('0xe'),auth[_0xc481('0xc')](),controller[_0xc481('0x1a')]);router[_0xc481('0x19')](_0xc481('0x14'),auth[_0xc481('0xc')](),controller[_0xc481('0x1b')]);router['delete']('/:id/users',auth[_0xc481('0xc')](),controller[_0xc481('0x1c')]);module[_0xc481('0x1d')]=router;
\ No newline at end of file
+var _0xce19=['post','/:id/teams','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','getMembers','getTeams','/:id/users','getAgents','create'];(function(_0x8b26d8,_0x58a8de){var _0x200568=function(_0x28c66c){while(--_0x28c66c){_0x8b26d8['push'](_0x8b26d8['shift']());}};_0x200568(++_0x58a8de);}(_0xce19,0x73));var _0x9ce1=function(_0xe4a3e,_0x4f43b9){_0xe4a3e=_0xe4a3e-0x0;var _0x16e287=_0xce19[_0xe4a3e];return _0x16e287;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9ce1('0x0'));var express=require('express');var router=express[_0x9ce1('0x1')]();var fs_extra=require(_0x9ce1('0x2'));var auth=require(_0x9ce1('0x3'));var interaction=require(_0x9ce1('0x4'));var config=require('../../config/environment');var controller=require(_0x9ce1('0x5'));router[_0x9ce1('0x6')]('/',auth[_0x9ce1('0x7')](),controller[_0x9ce1('0x8')]);router[_0x9ce1('0x6')](_0x9ce1('0x9'),auth[_0x9ce1('0x7')](),controller['describe']);router['get']('/:id',auth[_0x9ce1('0x7')](),controller['show']);router[_0x9ce1('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x9ce1('0xa')]);router[_0x9ce1('0x6')]('/:id/teams',auth[_0x9ce1('0x7')](),controller[_0x9ce1('0xb')]);router[_0x9ce1('0x6')](_0x9ce1('0xc'),auth[_0x9ce1('0x7')](),controller[_0x9ce1('0xd')]);router['post']('/',auth[_0x9ce1('0x7')](),controller[_0x9ce1('0xe')]);router[_0x9ce1('0xf')](_0x9ce1('0x10'),auth[_0x9ce1('0x7')](),controller[_0x9ce1('0x11')]);router[_0x9ce1('0xf')](_0x9ce1('0xc'),auth[_0x9ce1('0x7')](),controller[_0x9ce1('0x12')]);router[_0x9ce1('0x13')](_0x9ce1('0x14'),auth[_0x9ce1('0x7')](),controller[_0x9ce1('0x15')]);router['delete'](_0x9ce1('0x14'),auth[_0x9ce1('0x7')](),controller[_0x9ce1('0x16')]);router[_0x9ce1('0x17')](_0x9ce1('0x10'),auth['isAuthenticated'](),controller[_0x9ce1('0x18')]);router['delete']('/:id/users',auth[_0x9ce1('0x7')](),controller[_0x9ce1('0x19')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab40=['exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xab40,0x167));var _0x0ab4=function(_0x3f8557,_0x1b8bd9){_0x3f8557=_0x3f8557-0x0;var _0x5a8534=_0xab40[_0x3f8557];return _0x5a8534;};'use strict';var Sequelize=require(_0x0ab4('0x0'));module[_0x0ab4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0ab4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0ab4('0x3')]},'timeout':{'type':Sequelize[_0x0ab4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0ab4('0x5'),_0x0ab4('0x6'),_0x0ab4('0x7'))}};
\ No newline at end of file
+var _0x5993=['STRING','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x326cc9,_0x3c6b5d){var _0x238be7=function(_0x3361c5){while(--_0x3361c5){_0x326cc9['push'](_0x326cc9['shift']());}};_0x238be7(++_0x3c6b5d);}(_0x5993,0x166));var _0x3599=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x5993[_0x319cb9];return _0x1735fc;};'use strict';var Sequelize=require(_0x3599('0x0'));module[_0x3599('0x1')]={'name':{'type':Sequelize[_0x3599('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3599('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3599('0x3')](_0x3599('0x4'),'beepall',_0x3599('0x5'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x197047,_0x4d3f9d){var _0x58fd0a=function(_0x470d2a){while(--_0x470d2a){_0x197047['push'](_0x197047['shift']());}};_0x58fd0a(++_0x4d3f9d);}(_0x7a54,0x106));var _0x47a5=function(_0x20ad93,_0x5587ae){_0x20ad93=_0x20ad93-0x0;var _0x52bf60=_0x7a54[_0x20ad93];return _0x52bf60;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));};
\ No newline at end of file
+var _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x4754c5,_0x300f3c){var _0x6f3ede=function(_0x513ef1){while(--_0x513ef1){_0x4754c5['push'](_0x4754c5['shift']());}};_0x6f3ede(++_0x300f3c);}(_0xdb28,0x106));var _0x8db2=function(_0x101984,_0x583e12){_0x101984=_0x101984-0x0;var _0x1a2a36=_0xdb28[_0x101984];return _0x1a2a36;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c8c=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x112e44,_0x209d45){var _0x2b849d=function(_0x5050db){while(--_0x5050db){_0x112e44['push'](_0x112e44['shift']());}};_0x2b849d(++_0x209d45);}(_0x7c8c,0x16d));var _0xc7c8=function(_0xe6746a,_0x4a0320){_0xe6746a=_0xe6746a-0x0;var _0x5b7b13=_0x7c8c[_0xe6746a];return _0x5b7b13;};'use strict';var EventEmitter=require(_0xc7c8('0x0'));var SmsQueue=require(_0xc7c8('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc7c8('0x2')](0x0);var events={'afterCreate':_0xc7c8('0x3'),'afterUpdate':_0xc7c8('0x4'),'afterDestroy':_0xc7c8('0x5')};function emitEvent(_0x2455cf){return function(_0x5ab593,_0x109c9a,_0x4360bc){SmsQueueEvents['emit'](_0x2455cf+':'+_0x5ab593['id'],_0x5ab593);SmsQueueEvents[_0xc7c8('0x6')](_0x2455cf,_0x5ab593);_0x4360bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xc7c8('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0xf939=['hasOwnProperty','exports','events','SmsQueue','setMaxListeners','update','remove','emit'];(function(_0x219769,_0x2c81f7){var _0x4f551e=function(_0x2dff64){while(--_0x2dff64){_0x219769['push'](_0x219769['shift']());}};_0x4f551e(++_0x2c81f7);}(_0xf939,0xd2));var _0x9f93=function(_0x33e5bb,_0x3f9c04){_0x33e5bb=_0x33e5bb-0x0;var _0x35a504=_0xf939[_0x33e5bb];return _0x35a504;};'use strict';var EventEmitter=require(_0x9f93('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x9f93('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9f93('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f93('0x3'),'afterDestroy':_0x9f93('0x4')};function emitEvent(_0xef93ca){return function(_0x405bdb,_0x3e056f,_0x35060f){SmsQueueEvents[_0x9f93('0x5')](_0xef93ca+':'+_0x405bdb['id'],_0x405bdb);SmsQueueEvents[_0x9f93('0x5')](_0xef93ca,_0x405bdb);_0x35060f(null);};}for(var e in events){if(events[_0x9f93('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x9f93('0x7')]=SmsQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2277=['sms_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x618bc2,_0x57686f){var _0x2fbb1e=function(_0x13c21b){while(--_0x13c21b){_0x618bc2['push'](_0x618bc2['shift']());}};_0x2fbb1e(++_0x57686f);}(_0x2277,0xde));var _0x7227=function(_0x433d56,_0x123393){_0x433d56=_0x433d56-0x0;var _0x3368f3=_0x2277[_0x433d56];return _0x3368f3;};'use strict';var _=require(_0x7227('0x0'));var util=require(_0x7227('0x1'));var logger=require('../../config/logger')(_0x7227('0x2'));var moment=require(_0x7227('0x3'));var BPromise=require(_0x7227('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7227('0x5'));var rimraf=require(_0x7227('0x6'));var config=require(_0x7227('0x7'));var attributes=require(_0x7227('0x8'));module[_0x7227('0x9')]=function(_0x5f412e,_0x4023b2){return _0x5f412e[_0x7227('0xa')](_0x7227('0xb'),attributes,{'tableName':_0x7227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabc3=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','../../config/logger','moment','bluebird'];(function(_0x5a7fde,_0x45d465){var _0x4c98dd=function(_0x6e4c8d){while(--_0x6e4c8d){_0x5a7fde['push'](_0x5a7fde['shift']());}};_0x4c98dd(++_0x45d465);}(_0xabc3,0x1ab));var _0x3abc=function(_0x5eceed,_0x48f422){_0x5eceed=_0x5eceed-0x0;var _0x2100c1=_0xabc3[_0x5eceed];return _0x2100c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3abc('0x0'))('api');var moment=require(_0x3abc('0x1'));var BPromise=require(_0x3abc('0x2'));var rp=require(_0x3abc('0x3'));var fs=require('fs');var path=require(_0x3abc('0x4'));var rimraf=require(_0x3abc('0x5'));var config=require(_0x3abc('0x6'));var attributes=require(_0x3abc('0x7'));module['exports']=function(_0x764d80,_0x287e80){return _0x764d80['define'](_0x3abc('0x8'),attributes,{'tableName':_0x3abc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8869=['register','request','then','info','SmsQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','map','model','include','debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x3ae633,_0x5bd768){var _0x2250c3=function(_0x450c70){while(--_0x450c70){_0x3ae633['push'](_0x3ae633['shift']());}};_0x2250c3(++_0x5bd768);}(_0x8869,0x6f));var _0x9886=function(_0x1d5f74,_0xbd8360){_0x1d5f74=_0x1d5f74-0x0;var _0x303c6a=_0x8869[_0x1d5f74];return _0x303c6a;};'use strict';var _=require(_0x9886('0x0'));var util=require(_0x9886('0x1'));var moment=require(_0x9886('0x2'));var BPromise=require(_0x9886('0x3'));var rs=require(_0x9886('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9886('0x5'))['db'];var utils=require(_0x9886('0x6'));var logger=require(_0x9886('0x7'))(_0x9886('0x8'));var config=require(_0x9886('0x9'));var jayson=require(_0x9886('0xa'));var client=jayson[_0x9886('0xb')][_0x9886('0xc')]({'port':0x232a});config[_0x9886('0xd')]=_[_0x9886('0xe')](config[_0x9886('0xd')],{'host':_0x9886('0xf'),'port':0x18eb});var socket=require(_0x9886('0x10'))(new Redis(config['redis']));require(_0x9886('0x11'))[_0x9886('0x12')](socket);function respondWithRpcPromise(_0x752bd3,_0x181534,_0x469bdb){return new BPromise(function(_0xa6834e,_0x127e05){return client[_0x9886('0x13')](_0x752bd3,_0x469bdb)[_0x9886('0x14')](function(_0x180a01){logger[_0x9886('0x15')](_0x9886('0x16'),_0x181534,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x181534,'request\x20sent',JSON[_0x9886('0x17')](_0x180a01));if(_0x180a01[_0x9886('0x18')]){if(_0x180a01[_0x9886('0x18')][_0x9886('0x19')]===0x1f4){logger[_0x9886('0x18')](_0x9886('0x16'),_0x181534,_0x180a01['error'][_0x9886('0x1a')]);return _0x127e05(_0x180a01[_0x9886('0x18')]['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x181534,_0x180a01['error'][_0x9886('0x1a')]);return _0xa6834e(_0x180a01[_0x9886('0x18')][_0x9886('0x1a')]);}else{logger[_0x9886('0x15')]('SmsQueue,\x20%s,\x20%s',_0x181534,_0x9886('0x1b'));_0xa6834e(_0x180a01[_0x9886('0x1c')][_0x9886('0x1a')]);}})[_0x9886('0x1d')](function(_0x2239da){logger[_0x9886('0x18')](_0x9886('0x16'),_0x181534,_0x2239da);_0x127e05(_0x2239da);});});}exports[_0x9886('0x1e')]=function(_0x51f7cf){var _0x4db9bf=this;return new Promise(function(_0x24c5d3,_0x209cfc){return db[_0x9886('0x1f')][_0x9886('0x20')]({'raw':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf[_0x9886('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf[_0x9886('0x21')][_0x9886('0x22')]||null:null,'attributes':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf['options'][_0x9886('0x23')]||null:null,'limit':_0x51f7cf[_0x9886('0x21')]?_0x51f7cf[_0x9886('0x21')][_0x9886('0x24')]||null:null,'include':_0x51f7cf['options']?_0x51f7cf['options']['include']?_[_0x9886('0x25')](_0x51f7cf[_0x9886('0x21')]['include'],function(_0xa54811){return{'model':db[_0xa54811[_0x9886('0x26')]],'as':_0xa54811['as'],'attributes':_0xa54811[_0x9886('0x23')],'include':_0xa54811[_0x9886('0x27')]?_[_0x9886('0x25')](_0xa54811[_0x9886('0x27')],function(_0x3e7cfe){return{'model':db[_0x3e7cfe[_0x9886('0x26')]],'as':_0x3e7cfe['as'],'attributes':_0x3e7cfe[_0x9886('0x23')],'include':_0x3e7cfe['include']?_[_0x9886('0x25')](_0x3e7cfe[_0x9886('0x27')],function(_0x3a8151){return{'model':db[_0x3a8151['model']],'as':_0x3a8151['as'],'attributes':_0x3a8151['attributes']};}):[]};}):[]};}):[]:[]})[_0x9886('0x14')](function(_0x46fa94){logger['info']('GetSmsQueue',_0x51f7cf);logger[_0x9886('0x28')](_0x9886('0x1e'),_0x51f7cf,JSON[_0x9886('0x17')](_0x46fa94));_0x24c5d3(_0x46fa94);})['catch'](function(_0x181c8e){logger[_0x9886('0x18')](_0x9886('0x1e'),_0x181c8e[_0x9886('0x1a')],_0x51f7cf);_0x209cfc(_0x4db9bf['error'](0x1f4,_0x181c8e['message']));});});};exports[_0x9886('0x29')]=function(_0x435cd7){var _0x269229=this;return new Promise(function(_0x1a7b4d,_0x4f0b08){return db['SmsQueue'][_0x9886('0x2a')]({'raw':_0x435cd7[_0x9886('0x21')]?_0x435cd7[_0x9886('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x435cd7[_0x9886('0x21')]?_0x435cd7['options']['where']||null:null,'attributes':_0x435cd7[_0x9886('0x21')]?_0x435cd7[_0x9886('0x21')][_0x9886('0x23')]||null:null,'include':_0x435cd7['options']?_0x435cd7[_0x9886('0x21')][_0x9886('0x27')]?_['map'](_0x435cd7[_0x9886('0x21')][_0x9886('0x27')],function(_0x3185e9){return{'model':db[_0x3185e9[_0x9886('0x26')]],'as':_0x3185e9['as'],'attributes':_0x3185e9['attributes'],'include':_0x3185e9[_0x9886('0x27')]?_['map'](_0x3185e9[_0x9886('0x27')],function(_0x204796){return{'model':db[_0x204796[_0x9886('0x26')]],'as':_0x204796['as'],'attributes':_0x204796[_0x9886('0x23')],'include':_0x204796[_0x9886('0x27')]?_['map'](_0x204796[_0x9886('0x27')],function(_0x26b742){return{'model':db[_0x26b742['model']],'as':_0x26b742['as'],'attributes':_0x26b742[_0x9886('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9886('0x14')](function(_0x535a33){logger['info'](_0x9886('0x29'),_0x435cd7);logger[_0x9886('0x28')](_0x9886('0x29'),_0x435cd7,JSON[_0x9886('0x17')](_0x535a33));_0x1a7b4d(_0x535a33);})[_0x9886('0x1d')](function(_0x42d6a1){logger[_0x9886('0x18')](_0x9886('0x29'),_0x42d6a1[_0x9886('0x1a')],_0x435cd7);_0x4f0b08(_0x269229[_0x9886('0x18')](0x1f4,_0x42d6a1[_0x9886('0x1a')]));});});};
\ No newline at end of file
+var _0xacbc=['client','http','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','map','include','model','debug','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x5ef22a,_0x2a75c0){var _0x309843=function(_0x4b0b50){while(--_0x4b0b50){_0x5ef22a['push'](_0x5ef22a['shift']());}};_0x309843(++_0x2a75c0);}(_0xacbc,0x1e6));var _0xcacb=function(_0x335504,_0x1f728a){_0x335504=_0x335504-0x0;var _0x15da6a=_0xacbc[_0x335504];return _0x15da6a;};'use strict';var _=require(_0xcacb('0x0'));var util=require(_0xcacb('0x1'));var moment=require(_0xcacb('0x2'));var BPromise=require('bluebird');var rs=require(_0xcacb('0x3'));var fs=require('fs');var Redis=require(_0xcacb('0x4'));var db=require(_0xcacb('0x5'))['db'];var utils=require(_0xcacb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcacb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcacb('0x8')][_0xcacb('0x9')]({'port':0x232a});config['redis']=_[_0xcacb('0xa')](config['redis'],{'host':_0xcacb('0xb'),'port':0x18eb});var socket=require(_0xcacb('0xc'))(new Redis(config[_0xcacb('0xd')]));require(_0xcacb('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c2d01,_0x1b7888,_0x1d95c3){return new BPromise(function(_0x12946b,_0xa2a5a6){return client[_0xcacb('0xf')](_0x2c2d01,_0x1d95c3)[_0xcacb('0x10')](function(_0x5ce745){logger['info'](_0xcacb('0x11'),_0x1b7888,_0xcacb('0x12'));logger['debug'](_0xcacb('0x13'),_0x1b7888,_0xcacb('0x12'),JSON[_0xcacb('0x14')](_0x5ce745));if(_0x5ce745[_0xcacb('0x15')]){if(_0x5ce745[_0xcacb('0x15')][_0xcacb('0x16')]===0x1f4){logger[_0xcacb('0x15')](_0xcacb('0x11'),_0x1b7888,_0x5ce745[_0xcacb('0x15')][_0xcacb('0x17')]);return _0xa2a5a6(_0x5ce745[_0xcacb('0x15')][_0xcacb('0x17')]);}logger['error'](_0xcacb('0x11'),_0x1b7888,_0x5ce745['error'][_0xcacb('0x17')]);return _0x12946b(_0x5ce745[_0xcacb('0x15')][_0xcacb('0x17')]);}else{logger[_0xcacb('0x18')](_0xcacb('0x11'),_0x1b7888,'request\x20sent');_0x12946b(_0x5ce745['result']['message']);}})[_0xcacb('0x19')](function(_0x1ebb1a){logger[_0xcacb('0x15')]('SmsQueue,\x20%s,\x20%s',_0x1b7888,_0x1ebb1a);_0xa2a5a6(_0x1ebb1a);});});}exports[_0xcacb('0x1a')]=function(_0x4bcfa7){var _0x223408=this;return new Promise(function(_0x4307e7,_0x368acc){return db[_0xcacb('0x1b')][_0xcacb('0x1c')]({'raw':_0x4bcfa7[_0xcacb('0x1d')]?_0x4bcfa7[_0xcacb('0x1d')][_0xcacb('0x1e')]===undefined?!![]:![]:!![],'where':_0x4bcfa7[_0xcacb('0x1d')]?_0x4bcfa7[_0xcacb('0x1d')][_0xcacb('0x1f')]||null:null,'attributes':_0x4bcfa7['options']?_0x4bcfa7['options'][_0xcacb('0x20')]||null:null,'limit':_0x4bcfa7[_0xcacb('0x1d')]?_0x4bcfa7[_0xcacb('0x1d')]['limit']||null:null,'include':_0x4bcfa7[_0xcacb('0x1d')]?_0x4bcfa7[_0xcacb('0x1d')]['include']?_[_0xcacb('0x21')](_0x4bcfa7['options'][_0xcacb('0x22')],function(_0x41f4a5){return{'model':db[_0x41f4a5[_0xcacb('0x23')]],'as':_0x41f4a5['as'],'attributes':_0x41f4a5[_0xcacb('0x20')],'include':_0x41f4a5[_0xcacb('0x22')]?_[_0xcacb('0x21')](_0x41f4a5[_0xcacb('0x22')],function(_0x5735c4){return{'model':db[_0x5735c4[_0xcacb('0x23')]],'as':_0x5735c4['as'],'attributes':_0x5735c4['attributes'],'include':_0x5735c4[_0xcacb('0x22')]?_[_0xcacb('0x21')](_0x5735c4[_0xcacb('0x22')],function(_0x44d5e1){return{'model':db[_0x44d5e1[_0xcacb('0x23')]],'as':_0x44d5e1['as'],'attributes':_0x44d5e1[_0xcacb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58107b){logger[_0xcacb('0x18')]('GetSmsQueue',_0x4bcfa7);logger[_0xcacb('0x24')](_0xcacb('0x1a'),_0x4bcfa7,JSON[_0xcacb('0x14')](_0x58107b));_0x4307e7(_0x58107b);})[_0xcacb('0x19')](function(_0x427774){logger['error']('GetSmsQueue',_0x427774[_0xcacb('0x17')],_0x4bcfa7);_0x368acc(_0x223408[_0xcacb('0x15')](0x1f4,_0x427774[_0xcacb('0x17')]));});});};exports[_0xcacb('0x25')]=function(_0xa59af4){var _0x2714a9=this;return new Promise(function(_0x2ea3d5,_0x52673d){return db['SmsQueue']['find']({'raw':_0xa59af4[_0xcacb('0x1d')]?_0xa59af4[_0xcacb('0x1d')][_0xcacb('0x1e')]===undefined?!![]:![]:!![],'where':_0xa59af4['options']?_0xa59af4[_0xcacb('0x1d')][_0xcacb('0x1f')]||null:null,'attributes':_0xa59af4['options']?_0xa59af4[_0xcacb('0x1d')][_0xcacb('0x20')]||null:null,'include':_0xa59af4['options']?_0xa59af4['options'][_0xcacb('0x22')]?_[_0xcacb('0x21')](_0xa59af4[_0xcacb('0x1d')][_0xcacb('0x22')],function(_0x35a8e1){return{'model':db[_0x35a8e1[_0xcacb('0x23')]],'as':_0x35a8e1['as'],'attributes':_0x35a8e1['attributes'],'include':_0x35a8e1[_0xcacb('0x22')]?_[_0xcacb('0x21')](_0x35a8e1[_0xcacb('0x22')],function(_0x1b8a9a){return{'model':db[_0x1b8a9a['model']],'as':_0x1b8a9a['as'],'attributes':_0x1b8a9a['attributes'],'include':_0x1b8a9a['include']?_[_0xcacb('0x21')](_0x1b8a9a[_0xcacb('0x22')],function(_0x244e3f){return{'model':db[_0x244e3f[_0xcacb('0x23')]],'as':_0x244e3f['as'],'attributes':_0x244e3f[_0xcacb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcacb('0x10')](function(_0x1f1c4e){logger[_0xcacb('0x18')](_0xcacb('0x25'),_0xa59af4);logger[_0xcacb('0x24')](_0xcacb('0x25'),_0xa59af4,JSON['stringify'](_0x1f1c4e));_0x2ea3d5(_0x1f1c4e);})[_0xcacb('0x19')](function(_0x36126e){logger[_0xcacb('0x15')](_0xcacb('0x25'),_0x36126e[_0xcacb('0x17')],_0xa59af4);_0x52673d(_0x2714a9[_0xcacb('0x15')](0x1f4,_0x36126e[_0xcacb('0x17')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x291d=['remove','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x33a581,_0x76ad5f){var _0x2ecd7f=function(_0x2a9f8f){while(--_0x2a9f8f){_0x33a581['push'](_0x33a581['shift']());}};_0x2ecd7f(++_0x76ad5f);}(_0x291d,0x139));var _0xd291=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x291d[_0x2dea24];return _0x309d58;};'use strict';var SmsQueueEvents=require(_0xd291('0x0'));var events=[_0xd291('0x1'),_0xd291('0x2'),'update'];function createListener(_0x1eb772,_0x364cac){return function(_0x468c18){_0x364cac['emit'](_0x1eb772,_0x468c18);};}function removeListener(_0x35e065,_0x125c45){return function(){SmsQueueEvents[_0xd291('0x3')](_0x35e065,_0x125c45);};}exports[_0xd291('0x4')]=function(_0x5df33f){for(var _0x5abfb8=0x0,_0xc383aa=events[_0xd291('0x5')];_0x5abfb8<_0xc383aa;_0x5abfb8++){var _0x47baee=events[_0x5abfb8];var _0x32fdc9=createListener(_0xd291('0x6')+_0x47baee,_0x5df33f);SmsQueueEvents['on'](_0x47baee,_0x32fdc9);}};
\ No newline at end of file
+var _0xfca5=['register','length','smsQueue:','./smsQueue.events','remove','emit','removeListener'];(function(_0x3d8f8d,_0x599bee){var _0x3074b5=function(_0x1a273e){while(--_0x1a273e){_0x3d8f8d['push'](_0x3d8f8d['shift']());}};_0x3074b5(++_0x599bee);}(_0xfca5,0x145));var _0x5fca=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0xfca5[_0x329437];return _0x3789d9;};'use strict';var SmsQueueEvents=require(_0x5fca('0x0'));var events=['save',_0x5fca('0x1'),'update'];function createListener(_0x417305,_0xeaa139){return function(_0x184c1e){_0xeaa139[_0x5fca('0x2')](_0x417305,_0x184c1e);};}function removeListener(_0x4bc84d,_0xccf5ad){return function(){SmsQueueEvents[_0x5fca('0x3')](_0x4bc84d,_0xccf5ad);};}exports[_0x5fca('0x4')]=function(_0x4e9e19){for(var _0x346762=0x0,_0x44991e=events[_0x5fca('0x5')];_0x346762<_0x44991e;_0x346762++){var _0x36ca80=events[_0x346762];var _0x2289df=createListener(_0x5fca('0x6')+_0x36ca80,_0x4e9e19);SmsQueueEvents['on'](_0x36ca80,_0x2289df);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb1c=['index','get','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xeb1c,0x185));var _0xceb1=function(_0x462586,_0x1b28ee){_0x462586=_0x462586-0x0;var _0x99fc57=_0xeb1c[_0x462586];return _0x99fc57;};'use strict';var multer=require(_0xceb1('0x0'));var util=require(_0xceb1('0x1'));var path=require(_0xceb1('0x2'));var timeout=require('connect-timeout');var express=require(_0xceb1('0x3'));var router=express['Router']();var fs_extra=require(_0xceb1('0x4'));var auth=require(_0xceb1('0x5'));var interaction=require(_0xceb1('0x6'));var config=require(_0xceb1('0x7'));var controller=require(_0xceb1('0x8'));router['get']('/',auth[_0xceb1('0x9')](),controller[_0xceb1('0xa')]);router[_0xceb1('0xb')](_0xceb1('0xc'),auth[_0xceb1('0x9')](),controller[_0xceb1('0xd')]);router[_0xceb1('0xb')]('/:id',auth[_0xceb1('0x9')](),controller[_0xceb1('0xe')]);router[_0xceb1('0xf')]('/',auth[_0xceb1('0x9')](),controller['create']);router[_0xceb1('0x10')](_0xceb1('0x11'),auth[_0xceb1('0x9')](),controller[_0xceb1('0x12')]);router[_0xceb1('0x13')](_0xceb1('0x11'),auth[_0xceb1('0x9')](),controller[_0xceb1('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xaef4=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','create','destroy','exports','multer'];(function(_0x19937f,_0x52741){var _0xd1680d=function(_0x42315d){while(--_0x42315d){_0x19937f['push'](_0x19937f['shift']());}};_0xd1680d(++_0x52741);}(_0xaef4,0x197));var _0x4aef=function(_0x250191,_0x305ace){_0x250191=_0x250191-0x0;var _0x31fb4c=_0xaef4[_0x250191];return _0x31fb4c;};'use strict';var multer=require(_0x4aef('0x0'));var util=require(_0x4aef('0x1'));var path=require(_0x4aef('0x2'));var timeout=require(_0x4aef('0x3'));var express=require(_0x4aef('0x4'));var router=express[_0x4aef('0x5')]();var fs_extra=require(_0x4aef('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4aef('0x7'));var controller=require(_0x4aef('0x8'));router[_0x4aef('0x9')]('/',auth[_0x4aef('0xa')](),controller[_0x4aef('0xb')]);router[_0x4aef('0x9')]('/describe',auth[_0x4aef('0xa')](),controller[_0x4aef('0xc')]);router[_0x4aef('0x9')](_0x4aef('0xd'),auth[_0x4aef('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4aef('0xe')]);router['put'](_0x4aef('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4aef('0xf')]);module[_0x4aef('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb096=['STRING','DATE','moment','sequelize','exports'];(function(_0x8c2e66,_0xf79589){var _0x31492f=function(_0xfe56f){while(--_0xfe56f){_0x8c2e66['push'](_0x8c2e66['shift']());}};_0x31492f(++_0xf79589);}(_0xb096,0x156));var _0x6b09=function(_0x5a8915,_0x137df8){_0x5a8915=_0x5a8915-0x0;var _0x2e1151=_0xb096[_0x5a8915];return _0x2e1151;};'use strict';var moment=require(_0x6b09('0x0'));var Sequelize=require(_0x6b09('0x1'));module[_0x6b09('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6b09('0x3')]},'joinAt':{'type':Sequelize[_0x6b09('0x4')]},'leaveAt':{'type':Sequelize[_0x6b09('0x4')]},'acceptAt':{'type':Sequelize[_0x6b09('0x4')]},'exitAt':{'type':Sequelize[_0x6b09('0x4')]},'reason':{'type':Sequelize[_0x6b09('0x3')]}};
\ No newline at end of file
+var _0x26b3=['exports','STRING','DATE','moment','sequelize'];(function(_0x3be3c5,_0x12c3f5){var _0x50951c=function(_0x15cebf){while(--_0x15cebf){_0x3be3c5['push'](_0x3be3c5['shift']());}};_0x50951c(++_0x12c3f5);}(_0x26b3,0x1e3));var _0x326b=function(_0x2d3926,_0x35b1d7){_0x2d3926=_0x2d3926-0x0;var _0x282707=_0x26b3[_0x2d3926];return _0x282707;};'use strict';var moment=require(_0x326b('0x0'));var Sequelize=require(_0x326b('0x1'));module[_0x326b('0x2')]={'uniqueid':{'type':Sequelize[_0x326b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x326b('0x3')]},'joinAt':{'type':Sequelize[_0x326b('0x4')]},'leaveAt':{'type':Sequelize[_0x326b('0x4')]},'acceptAt':{'type':Sequelize[_0x326b('0x4')]},'exitAt':{'type':Sequelize[_0x326b('0x4')]},'reason':{'type':Sequelize[_0x326b('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x213b=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','params','include','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch'];(function(_0x96d000,_0x1830c3){var _0xc96352=function(_0x525197){while(--_0x525197){_0x96d000['push'](_0x96d000['shift']());}};_0xc96352(++_0x1830c3);}(_0x213b,0xcc));var _0xb213=function(_0x479ff1,_0xa3fcd2){_0x479ff1=_0x479ff1-0x0;var _0x502089=_0x213b[_0x479ff1];return _0x502089;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb213('0x0'));var zipdir=require(_0xb213('0x1'));var jsonpatch=require(_0xb213('0x2'));var rp=require(_0xb213('0x3'));var moment=require(_0xb213('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb213('0x5'));var util=require(_0xb213('0x6'));var path=require(_0xb213('0x7'));var sox=require('sox');var csv=require(_0xb213('0x8'));var ejs=require(_0xb213('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb213('0xa'));var squel=require(_0xb213('0xb'));var crypto=require(_0xb213('0xc'));var jsforce=require(_0xb213('0xd'));var deskjs=require(_0xb213('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb213('0xf'));var Papa=require('papaparse');var Redis=require(_0xb213('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb213('0x11'));var hardwareService=require(_0xb213('0x12'));var logger=require('../../config/logger')(_0xb213('0x13'));var utils=require(_0xb213('0x14'));var config=require(_0xb213('0x15'));var licenseUtil=require(_0xb213('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102513,_0x483bf3){_0x483bf3=_0x483bf3||0xcc;return function(_0x2f0198){if(_0x2f0198){return _0x102513[_0xb213('0x17')](_0x483bf3);}return _0x102513[_0xb213('0x18')](_0x483bf3)[_0xb213('0x19')]();};}function respondWithResult(_0x3f76d8,_0x3db055){_0x3db055=_0x3db055||0xc8;return function(_0x577cfe){if(_0x577cfe){return _0x3f76d8['status'](_0x3db055)[_0xb213('0x1a')](_0x577cfe);}};}function respondWithFilteredResult(_0x4dcc86,_0x52510b){return function(_0x7ad317){if(_0x7ad317){var _0x162180=typeof _0x52510b['offset']===_0xb213('0x1b')&&typeof _0x52510b[_0xb213('0x1c')]==='undefined';var _0x145a07=_0x7ad317[_0xb213('0x1d')];var _0x4a1000=_0x162180?0x0:_0x52510b['offset'];var _0x321570=_0x162180?_0x7ad317[_0xb213('0x1d')]:_0x52510b['offset']+_0x52510b[_0xb213('0x1c')];var _0x1cd532;if(_0x321570>=_0x145a07){_0x321570=_0x145a07;_0x1cd532=0xc8;}else{_0x1cd532=0xce;}_0x4dcc86[_0xb213('0x18')](_0x1cd532);return _0x4dcc86['set'](_0xb213('0x1e'),_0x4a1000+'-'+_0x321570+'/'+_0x145a07)[_0xb213('0x1a')](_0x7ad317);}return null;};}function patchUpdates(_0x4e3f5d){return function(_0x5ba1b6){try{jsonpatch[_0xb213('0x1f')](_0x5ba1b6,_0x4e3f5d,!![]);}catch(_0x10c1b5){return BPromise[_0xb213('0x20')](_0x10c1b5);}return _0x5ba1b6[_0xb213('0x21')]();};}function saveUpdates(_0x433418,_0x49c9e9){return function(_0x4ef4ce){if(_0x4ef4ce){return _0x4ef4ce[_0xb213('0x22')](_0x433418)[_0xb213('0x23')](function(_0x2739b1){return _0x2739b1;});}return null;};}function removeEntity(_0x1779cc,_0x12ac2a){return function(_0x5dd73f){if(_0x5dd73f){return _0x5dd73f[_0xb213('0x24')]()[_0xb213('0x23')](function(){_0x1779cc['status'](0xcc)[_0xb213('0x19')]();});}};}function handleEntityNotFound(_0x38b46d,_0x2d2092){return function(_0x182d2c){if(!_0x182d2c){_0x38b46d[_0xb213('0x17')](0x194);}return _0x182d2c;};}function handleError(_0x40579e,_0x11f9ba){_0x11f9ba=_0x11f9ba||0x1f4;return function(_0x28eb88){logger[_0xb213('0x25')](_0x28eb88[_0xb213('0x26')]);if(_0x28eb88[_0xb213('0x27')]){delete _0x28eb88[_0xb213('0x27')];}_0x40579e[_0xb213('0x18')](_0x11f9ba)[_0xb213('0x28')](_0x28eb88);};}exports[_0xb213('0x29')]=function(_0x1c36aa,_0x156e37){var _0x5028b0={},_0x30257d={},_0x4517a2={'count':0x0,'rows':[]};var _0x554186=_[_0xb213('0x2a')](db[_0xb213('0x2b')]['rawAttributes'],function(_0x286d05){return{'name':_0x286d05[_0xb213('0x2c')],'type':_0x286d05[_0xb213('0x2d')][_0xb213('0x2e')]};});_0x30257d[_0xb213('0x2f')]=_[_0xb213('0x2a')](_0x554186,'name');_0x30257d['query']=_[_0xb213('0x30')](_0x1c36aa[_0xb213('0x31')]);_0x30257d[_0xb213('0x32')]=_[_0xb213('0x33')](_0x30257d[_0xb213('0x2f')],_0x30257d[_0xb213('0x31')]);_0x5028b0[_0xb213('0x34')]=_[_0xb213('0x33')](_0x30257d[_0xb213('0x2f')],qs['fields'](_0x1c36aa[_0xb213('0x31')][_0xb213('0x35')]));_0x5028b0['attributes']=_0x5028b0[_0xb213('0x34')][_0xb213('0x36')]?_0x5028b0['attributes']:_0x30257d[_0xb213('0x2f')];if(!_0x1c36aa[_0xb213('0x31')][_0xb213('0x37')](_0xb213('0x38'))){_0x5028b0['limit']=qs[_0xb213('0x1c')](_0x1c36aa['query'][_0xb213('0x1c')]);_0x5028b0['offset']=qs['offset'](_0x1c36aa[_0xb213('0x31')][_0xb213('0x39')]);}_0x5028b0[_0xb213('0x3a')]=qs[_0xb213('0x3b')](_0x1c36aa['query'][_0xb213('0x3b')]);_0x5028b0[_0xb213('0x3c')]=qs[_0xb213('0x32')](_[_0xb213('0x3d')](_0x1c36aa['query'],_0x30257d[_0xb213('0x32')]),_0x554186);if(_0x1c36aa[_0xb213('0x31')][_0xb213('0x3e')]){_0x5028b0[_0xb213('0x3c')]=_['merge'](_0x5028b0[_0xb213('0x3c')],{'$or':_[_0xb213('0x2a')](_0x554186,function(_0x299708){if(_0x299708[_0xb213('0x2d')]!==_0xb213('0x3f')){var _0x388fce={};_0x388fce[_0x299708['name']]={'$like':'%'+_0x1c36aa[_0xb213('0x31')]['filter']+'%'};return _0x388fce;}})});}_0x5028b0=_[_0xb213('0x40')]({},_0x5028b0,_0x1c36aa[_0xb213('0x41')]);var _0x31cc34={'where':_0x5028b0['where']};return db[_0xb213('0x2b')][_0xb213('0x1d')](_0x31cc34)[_0xb213('0x23')](function(_0x133af4){_0x4517a2['count']=_0x133af4;if(_0x1c36aa[_0xb213('0x31')][_0xb213('0x42')]){_0x5028b0['include']=[{'all':!![]}];}return db[_0xb213('0x2b')]['findAll'](_0x5028b0);})['then'](function(_0x274eb6){_0x4517a2['rows']=_0x274eb6;return _0x4517a2;})[_0xb213('0x23')](respondWithFilteredResult(_0x156e37,_0x5028b0))['catch'](handleError(_0x156e37,null));};exports['show']=function(_0x151b57,_0x4e54bc){var _0x1ae9f1={'raw':!![],'where':{'id':_0x151b57[_0xb213('0x43')]['id']}},_0x27778c={};_0x27778c[_0xb213('0x2f')]=_[_0xb213('0x30')](db[_0xb213('0x2b')]['rawAttributes']);_0x27778c[_0xb213('0x31')]=_[_0xb213('0x30')](_0x151b57[_0xb213('0x31')]);_0x27778c[_0xb213('0x32')]=_[_0xb213('0x33')](_0x27778c['model'],_0x27778c[_0xb213('0x31')]);_0x1ae9f1[_0xb213('0x34')]=_[_0xb213('0x33')](_0x27778c[_0xb213('0x2f')],qs['fields'](_0x151b57[_0xb213('0x31')]['fields']));_0x1ae9f1[_0xb213('0x34')]=_0x1ae9f1['attributes']['length']?_0x1ae9f1['attributes']:_0x27778c['model'];if(_0x151b57['query'][_0xb213('0x42')]){_0x1ae9f1[_0xb213('0x44')]=[{'all':!![]}];}_0x1ae9f1=_[_0xb213('0x40')]({},_0x1ae9f1,_0x151b57[_0xb213('0x41')]);return db[_0xb213('0x2b')][_0xb213('0x45')](_0x1ae9f1)['then'](handleEntityNotFound(_0x4e54bc,null))['then'](respondWithResult(_0x4e54bc,null))['catch'](handleError(_0x4e54bc,null));};exports[_0xb213('0x46')]=function(_0x130bb8,_0x12cc21){return db[_0xb213('0x2b')][_0xb213('0x46')](_0x130bb8[_0xb213('0x47')],{})[_0xb213('0x23')](respondWithResult(_0x12cc21,0xc9))[_0xb213('0x48')](handleError(_0x12cc21,null));};exports['update']=function(_0x254e7a,_0x505949){if(_0x254e7a[_0xb213('0x47')]['id']){delete _0x254e7a['body']['id'];}return db['SmsQueueReport'][_0xb213('0x45')]({'where':{'id':_0x254e7a[_0xb213('0x43')]['id']}})[_0xb213('0x23')](handleEntityNotFound(_0x505949,null))['then'](saveUpdates(_0x254e7a[_0xb213('0x47')],null))[_0xb213('0x23')](respondWithResult(_0x505949,null))[_0xb213('0x48')](handleError(_0x505949,null));};exports['destroy']=function(_0xb7b3b4,_0x2729f1){return db[_0xb213('0x2b')][_0xb213('0x45')]({'where':{'id':_0xb7b3b4[_0xb213('0x43')]['id']}})[_0xb213('0x23')](handleEntityNotFound(_0x2729f1,null))[_0xb213('0x23')](removeEntity(_0x2729f1,null))['catch'](handleError(_0x2729f1,null));};exports[_0xb213('0x49')]=function(_0x4bc6b5,_0xddd68a){return db[_0xb213('0x2b')]['describe']()[_0xb213('0x23')](respondWithResult(_0xddd68a,null))[_0xb213('0x48')](handleError(_0xddd68a,null));};
\ No newline at end of file
+var _0x0c72=['type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','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','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsQueueReport','rawAttributes'];(function(_0x4e7ce9,_0x290d4d){var _0x1ae331=function(_0x5148bb){while(--_0x5148bb){_0x4e7ce9['push'](_0x4e7ce9['shift']());}};_0x1ae331(++_0x290d4d);}(_0x0c72,0x142));var _0x20c7=function(_0x23f5a2,_0x4d9288){_0x23f5a2=_0x23f5a2-0x0;var _0x44144c=_0x0c72[_0x23f5a2];return _0x44144c;};'use strict';var emlformat=require(_0x20c7('0x0'));var rimraf=require(_0x20c7('0x1'));var zipdir=require(_0x20c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20c7('0x3'));var moment=require(_0x20c7('0x4'));var BPromise=require(_0x20c7('0x5'));var Mustache=require(_0x20c7('0x6'));var util=require(_0x20c7('0x7'));var path=require('path');var sox=require(_0x20c7('0x8'));var csv=require(_0x20c7('0x9'));var ejs=require(_0x20c7('0xa'));var fs=require('fs');var fs_extra=require(_0x20c7('0xb'));var _=require(_0x20c7('0xc'));var squel=require('squel');var crypto=require(_0x20c7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x20c7('0xe'));var Papa=require(_0x20c7('0xf'));var Redis=require(_0x20c7('0x10'));var authService=require(_0x20c7('0x11'));var qs=require(_0x20c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20c7('0x13'));var logger=require(_0x20c7('0x14'))(_0x20c7('0x15'));var utils=require(_0x20c7('0x16'));var config=require(_0x20c7('0x17'));var licenseUtil=require(_0x20c7('0x18'));var db=require(_0x20c7('0x19'))['db'];function respondWithStatusCode(_0x562ef6,_0x1c3c7f){_0x1c3c7f=_0x1c3c7f||0xcc;return function(_0x1f3aed){if(_0x1f3aed){return _0x562ef6[_0x20c7('0x1a')](_0x1c3c7f);}return _0x562ef6[_0x20c7('0x1b')](_0x1c3c7f)[_0x20c7('0x1c')]();};}function respondWithResult(_0x225976,_0x387104){_0x387104=_0x387104||0xc8;return function(_0x13aca2){if(_0x13aca2){return _0x225976[_0x20c7('0x1b')](_0x387104)[_0x20c7('0x1d')](_0x13aca2);}};}function respondWithFilteredResult(_0x3f3a99,_0x2b4aa5){return function(_0x2f0d06){if(_0x2f0d06){var _0x2f6e24=typeof _0x2b4aa5[_0x20c7('0x1e')]===_0x20c7('0x1f')&&typeof _0x2b4aa5[_0x20c7('0x20')]===_0x20c7('0x1f');var _0x430b10=_0x2f0d06[_0x20c7('0x21')];var _0x1f2d8c=_0x2f6e24?0x0:_0x2b4aa5['offset'];var _0xa09904=_0x2f6e24?_0x2f0d06[_0x20c7('0x21')]:_0x2b4aa5[_0x20c7('0x1e')]+_0x2b4aa5[_0x20c7('0x20')];var _0x4524a1;if(_0xa09904>=_0x430b10){_0xa09904=_0x430b10;_0x4524a1=0xc8;}else{_0x4524a1=0xce;}_0x3f3a99['status'](_0x4524a1);return _0x3f3a99[_0x20c7('0x22')]('Content-Range',_0x1f2d8c+'-'+_0xa09904+'/'+_0x430b10)[_0x20c7('0x1d')](_0x2f0d06);}return null;};}function patchUpdates(_0x6b203){return function(_0x29283e){try{jsonpatch[_0x20c7('0x23')](_0x29283e,_0x6b203,!![]);}catch(_0x1cf026){return BPromise[_0x20c7('0x24')](_0x1cf026);}return _0x29283e[_0x20c7('0x25')]();};}function saveUpdates(_0x3337f4,_0x786b51){return function(_0x57e280){if(_0x57e280){return _0x57e280[_0x20c7('0x26')](_0x3337f4)[_0x20c7('0x27')](function(_0x4892b7){return _0x4892b7;});}return null;};}function removeEntity(_0x396a68,_0x74bca4){return function(_0xf9e68e){if(_0xf9e68e){return _0xf9e68e[_0x20c7('0x28')]()['then'](function(){_0x396a68[_0x20c7('0x1b')](0xcc)[_0x20c7('0x1c')]();});}};}function handleEntityNotFound(_0x396d39,_0x5d2a43){return function(_0xa05347){if(!_0xa05347){_0x396d39[_0x20c7('0x1a')](0x194);}return _0xa05347;};}function handleError(_0x5149b5,_0x4f835e){_0x4f835e=_0x4f835e||0x1f4;return function(_0x4ba112){logger['error'](_0x4ba112[_0x20c7('0x29')]);if(_0x4ba112['name']){delete _0x4ba112[_0x20c7('0x2a')];}_0x5149b5['status'](_0x4f835e)[_0x20c7('0x2b')](_0x4ba112);};}exports[_0x20c7('0x2c')]=function(_0x368cbe,_0x13d748){var _0x5803a5={},_0x412178={},_0x2e23d3={'count':0x0,'rows':[]};var _0x15c4ed=_[_0x20c7('0x2d')](db[_0x20c7('0x2e')][_0x20c7('0x2f')],function(_0x9c60c){return{'name':_0x9c60c['fieldName'],'type':_0x9c60c[_0x20c7('0x30')][_0x20c7('0x31')]};});_0x412178['model']=_[_0x20c7('0x2d')](_0x15c4ed,_0x20c7('0x2a'));_0x412178[_0x20c7('0x32')]=_[_0x20c7('0x33')](_0x368cbe[_0x20c7('0x32')]);_0x412178['filters']=_[_0x20c7('0x34')](_0x412178[_0x20c7('0x35')],_0x412178[_0x20c7('0x32')]);_0x5803a5['attributes']=_['intersection'](_0x412178[_0x20c7('0x35')],qs['fields'](_0x368cbe[_0x20c7('0x32')][_0x20c7('0x36')]));_0x5803a5[_0x20c7('0x37')]=_0x5803a5[_0x20c7('0x37')][_0x20c7('0x38')]?_0x5803a5['attributes']:_0x412178[_0x20c7('0x35')];if(!_0x368cbe[_0x20c7('0x32')][_0x20c7('0x39')]('nolimit')){_0x5803a5[_0x20c7('0x20')]=qs[_0x20c7('0x20')](_0x368cbe['query'][_0x20c7('0x20')]);_0x5803a5[_0x20c7('0x1e')]=qs[_0x20c7('0x1e')](_0x368cbe[_0x20c7('0x32')]['offset']);}_0x5803a5['order']=qs[_0x20c7('0x3a')](_0x368cbe[_0x20c7('0x32')][_0x20c7('0x3a')]);_0x5803a5[_0x20c7('0x3b')]=qs[_0x20c7('0x3c')](_[_0x20c7('0x3d')](_0x368cbe[_0x20c7('0x32')],_0x412178[_0x20c7('0x3c')]),_0x15c4ed);if(_0x368cbe[_0x20c7('0x32')]['filter']){_0x5803a5[_0x20c7('0x3b')]=_[_0x20c7('0x3e')](_0x5803a5[_0x20c7('0x3b')],{'$or':_[_0x20c7('0x2d')](_0x15c4ed,function(_0x370c27){if(_0x370c27[_0x20c7('0x30')]!==_0x20c7('0x3f')){var _0x54b68e={};_0x54b68e[_0x370c27[_0x20c7('0x2a')]]={'$like':'%'+_0x368cbe[_0x20c7('0x32')]['filter']+'%'};return _0x54b68e;}})});}_0x5803a5=_[_0x20c7('0x3e')]({},_0x5803a5,_0x368cbe[_0x20c7('0x40')]);var _0x10a645={'where':_0x5803a5[_0x20c7('0x3b')]};return db['SmsQueueReport'][_0x20c7('0x21')](_0x10a645)[_0x20c7('0x27')](function(_0x2a67fe){_0x2e23d3['count']=_0x2a67fe;if(_0x368cbe[_0x20c7('0x32')][_0x20c7('0x41')]){_0x5803a5[_0x20c7('0x42')]=[{'all':!![]}];}return db[_0x20c7('0x2e')]['findAll'](_0x5803a5);})[_0x20c7('0x27')](function(_0x2537de){_0x2e23d3[_0x20c7('0x43')]=_0x2537de;return _0x2e23d3;})['then'](respondWithFilteredResult(_0x13d748,_0x5803a5))[_0x20c7('0x44')](handleError(_0x13d748,null));};exports[_0x20c7('0x45')]=function(_0x21cc96,_0x39d122){var _0x3df14e={'raw':!![],'where':{'id':_0x21cc96['params']['id']}},_0x4e5a7b={};_0x4e5a7b[_0x20c7('0x35')]=_[_0x20c7('0x33')](db['SmsQueueReport'][_0x20c7('0x2f')]);_0x4e5a7b[_0x20c7('0x32')]=_[_0x20c7('0x33')](_0x21cc96['query']);_0x4e5a7b[_0x20c7('0x3c')]=_['intersection'](_0x4e5a7b[_0x20c7('0x35')],_0x4e5a7b['query']);_0x3df14e[_0x20c7('0x37')]=_['intersection'](_0x4e5a7b[_0x20c7('0x35')],qs['fields'](_0x21cc96[_0x20c7('0x32')][_0x20c7('0x36')]));_0x3df14e[_0x20c7('0x37')]=_0x3df14e[_0x20c7('0x37')][_0x20c7('0x38')]?_0x3df14e['attributes']:_0x4e5a7b[_0x20c7('0x35')];if(_0x21cc96['query']['includeAll']){_0x3df14e[_0x20c7('0x42')]=[{'all':!![]}];}_0x3df14e=_[_0x20c7('0x3e')]({},_0x3df14e,_0x21cc96[_0x20c7('0x40')]);return db['SmsQueueReport'][_0x20c7('0x46')](_0x3df14e)[_0x20c7('0x27')](handleEntityNotFound(_0x39d122,null))[_0x20c7('0x27')](respondWithResult(_0x39d122,null))['catch'](handleError(_0x39d122,null));};exports['create']=function(_0x2a5864,_0x2b41e6){return db['SmsQueueReport'][_0x20c7('0x47')](_0x2a5864[_0x20c7('0x48')],{})[_0x20c7('0x27')](respondWithResult(_0x2b41e6,0xc9))[_0x20c7('0x44')](handleError(_0x2b41e6,null));};exports[_0x20c7('0x26')]=function(_0x5455be,_0x4f6b21){if(_0x5455be['body']['id']){delete _0x5455be[_0x20c7('0x48')]['id'];}return db['SmsQueueReport'][_0x20c7('0x46')]({'where':{'id':_0x5455be[_0x20c7('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f6b21,null))[_0x20c7('0x27')](saveUpdates(_0x5455be[_0x20c7('0x48')],null))['then'](respondWithResult(_0x4f6b21,null))[_0x20c7('0x44')](handleError(_0x4f6b21,null));};exports[_0x20c7('0x28')]=function(_0x3585ba,_0x3e16db){return db['SmsQueueReport'][_0x20c7('0x46')]({'where':{'id':_0x3585ba[_0x20c7('0x49')]['id']}})[_0x20c7('0x27')](handleEntityNotFound(_0x3e16db,null))[_0x20c7('0x27')](removeEntity(_0x3e16db,null))['catch'](handleError(_0x3e16db,null));};exports['describe']=function(_0x46eed3,_0x1a53b5){return db[_0x20c7('0x2e')]['describe']()[_0x20c7('0x27')](respondWithResult(_0x1a53b5,null))['catch'](handleError(_0x1a53b5,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x30e4c0,_0x58fed1){var _0x30b6d0=function(_0x2fe16e){while(--_0x2fe16e){_0x30e4c0['push'](_0x30e4c0['shift']());}};_0x30b6d0(++_0x58fed1);}(_0xe706,0xa3));var _0x6e70=function(_0x1f6193,_0x2de9ff){_0x1f6193=_0x1f6193-0x0;var _0x160297=_0xe706[_0x1f6193];return _0x160297;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e61=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2e61,0x16b));var _0x12e6=function(_0x38c2a5,_0x2fbbca){_0x38c2a5=_0x38c2a5-0x0;var _0x5a2154=_0x2e61[_0x38c2a5];return _0x5a2154;};'use strict';var _=require(_0x12e6('0x0'));var util=require(_0x12e6('0x1'));var moment=require(_0x12e6('0x2'));var BPromise=require(_0x12e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12e6('0x4'));var db=require(_0x12e6('0x5'))['db'];var utils=require(_0x12e6('0x6'));var logger=require('../../config/logger')(_0x12e6('0x7'));var config=require(_0x12e6('0x8'));var jayson=require(_0x12e6('0x9'));var client=jayson[_0x12e6('0xa')][_0x12e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6b4,_0x1dbe6f,_0x2bd972){return new BPromise(function(_0x2ff279,_0x1751b5){return client[_0x12e6('0xc')](_0x5bc6b4,_0x2bd972)[_0x12e6('0xd')](function(_0x14ccae){logger[_0x12e6('0xe')](_0x12e6('0xf'),_0x1dbe6f,_0x12e6('0x10'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1dbe6f,_0x12e6('0x10'),JSON[_0x12e6('0x11')](_0x14ccae));if(_0x14ccae[_0x12e6('0x12')]){if(_0x14ccae[_0x12e6('0x12')]['code']===0x1f4){logger['error'](_0x12e6('0xf'),_0x1dbe6f,_0x14ccae['error']['message']);return _0x1751b5(_0x14ccae[_0x12e6('0x12')][_0x12e6('0x13')]);}logger[_0x12e6('0x12')](_0x12e6('0xf'),_0x1dbe6f,_0x14ccae[_0x12e6('0x12')][_0x12e6('0x13')]);return _0x2ff279(_0x14ccae[_0x12e6('0x12')][_0x12e6('0x13')]);}else{logger[_0x12e6('0xe')](_0x12e6('0xf'),_0x1dbe6f,_0x12e6('0x10'));_0x2ff279(_0x14ccae[_0x12e6('0x14')][_0x12e6('0x13')]);}})['catch'](function(_0x51e724){logger[_0x12e6('0x12')](_0x12e6('0xf'),_0x1dbe6f,_0x51e724);_0x1751b5(_0x51e724);});});}exports[_0x12e6('0x15')]=function(_0x83adf6){var _0x2ba061=this;return new Promise(function(_0x17d640,_0x29545d){return db[_0x12e6('0x16')][_0x12e6('0x17')](_0x83adf6[_0x12e6('0x18')],{'raw':_0x83adf6[_0x12e6('0x19')]?_0x83adf6[_0x12e6('0x19')][_0x12e6('0x1a')]===undefined?!![]:![]:!![]})[_0x12e6('0xd')](function(_0x5c4954){logger[_0x12e6('0xe')]('CreateSmsQueueReport',_0x83adf6);logger['debug']('CreateSmsQueueReport',_0x83adf6,JSON[_0x12e6('0x11')](_0x5c4954));_0x17d640(_0x5c4954);})[_0x12e6('0x1b')](function(_0x4f04d2){logger[_0x12e6('0x12')](_0x12e6('0x15'),_0x4f04d2['message'],_0x83adf6);_0x29545d(_0x2ba061[_0x12e6('0x12')](0x1f4,_0x4f04d2['message']));});});};exports[_0x12e6('0x1c')]=function(_0x45147d){var _0xa1bc9b=this;return new Promise(function(_0x185200,_0x17ef3c){return db[_0x12e6('0x16')][_0x12e6('0x1d')](_0x45147d[_0x12e6('0x18')],{'raw':_0x45147d[_0x12e6('0x19')]?_0x45147d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45147d[_0x12e6('0x19')]?_0x45147d[_0x12e6('0x19')][_0x12e6('0x1e')]||null:null,'attributes':_0x45147d[_0x12e6('0x19')]?_0x45147d['options'][_0x12e6('0x1f')]||null:null,'limit':_0x45147d[_0x12e6('0x19')]?_0x45147d['options'][_0x12e6('0x20')]||null:null})[_0x12e6('0xd')](function(_0x2bb641){logger['info'](_0x12e6('0x1c'),_0x45147d);logger[_0x12e6('0x21')](_0x12e6('0x1c'),_0x45147d,JSON[_0x12e6('0x11')](_0x2bb641));_0x185200(_0x2bb641);})[_0x12e6('0x1b')](function(_0x21fe58){logger[_0x12e6('0x12')](_0x12e6('0x1c'),_0x21fe58[_0x12e6('0x13')],_0x45147d);_0x17ef3c(_0xa1bc9b['error'](0x1f4,_0x21fe58[_0x12e6('0x13')]));});});};
\ No newline at end of file
+var _0x6946=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','util','moment'];(function(_0x42d4fb,_0x312913){var _0x3228ce=function(_0x4afaae){while(--_0x4afaae){_0x42d4fb['push'](_0x42d4fb['shift']());}};_0x3228ce(++_0x312913);}(_0x6946,0x15b));var _0x6694=function(_0x308a6d,_0xc4abaa){_0x308a6d=_0x308a6d-0x0;var _0x1f7792=_0x6946[_0x308a6d];return _0x1f7792;};'use strict';var _=require(_0x6694('0x0'));var util=require(_0x6694('0x1'));var moment=require(_0x6694('0x2'));var BPromise=require(_0x6694('0x3'));var rs=require(_0x6694('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6694('0x5'))['db'];var utils=require(_0x6694('0x6'));var logger=require('../../config/logger')(_0x6694('0x7'));var config=require(_0x6694('0x8'));var jayson=require(_0x6694('0x9'));var client=jayson[_0x6694('0xa')][_0x6694('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41a6e2,_0x50d5dc,_0x43aa7b){return new BPromise(function(_0x337acd,_0x1217fb){return client[_0x6694('0xc')](_0x41a6e2,_0x43aa7b)[_0x6694('0xd')](function(_0x1057e2){logger[_0x6694('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x50d5dc,_0x6694('0xf'));logger[_0x6694('0x10')](_0x6694('0x11'),_0x50d5dc,_0x6694('0xf'),JSON[_0x6694('0x12')](_0x1057e2));if(_0x1057e2[_0x6694('0x13')]){if(_0x1057e2['error'][_0x6694('0x14')]===0x1f4){logger[_0x6694('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x50d5dc,_0x1057e2['error'][_0x6694('0x15')]);return _0x1217fb(_0x1057e2[_0x6694('0x13')][_0x6694('0x15')]);}logger[_0x6694('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x50d5dc,_0x1057e2['error'][_0x6694('0x15')]);return _0x337acd(_0x1057e2[_0x6694('0x13')][_0x6694('0x15')]);}else{logger[_0x6694('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x50d5dc,_0x6694('0xf'));_0x337acd(_0x1057e2[_0x6694('0x16')][_0x6694('0x15')]);}})[_0x6694('0x17')](function(_0x43c1bd){logger[_0x6694('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x50d5dc,_0x43c1bd);_0x1217fb(_0x43c1bd);});});}exports[_0x6694('0x18')]=function(_0x1eba34){var _0x248320=this;return new Promise(function(_0x5d7166,_0x13c681){return db[_0x6694('0x19')][_0x6694('0x1a')](_0x1eba34['body'],{'raw':_0x1eba34[_0x6694('0x1b')]?_0x1eba34['options'][_0x6694('0x1c')]===undefined?!![]:![]:!![]})[_0x6694('0xd')](function(_0x4e800c){logger['info'](_0x6694('0x18'),_0x1eba34);logger[_0x6694('0x10')](_0x6694('0x18'),_0x1eba34,JSON['stringify'](_0x4e800c));_0x5d7166(_0x4e800c);})[_0x6694('0x17')](function(_0x3ec8a9){logger['error'](_0x6694('0x18'),_0x3ec8a9[_0x6694('0x15')],_0x1eba34);_0x13c681(_0x248320[_0x6694('0x13')](0x1f4,_0x3ec8a9[_0x6694('0x15')]));});});};exports[_0x6694('0x1d')]=function(_0xe788d4){var _0x5218f1=this;return new Promise(function(_0x4f2825,_0x50a9bd){return db[_0x6694('0x19')][_0x6694('0x1e')](_0xe788d4[_0x6694('0x1f')],{'raw':_0xe788d4[_0x6694('0x1b')]?_0xe788d4[_0x6694('0x1b')][_0x6694('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe788d4[_0x6694('0x1b')]?_0xe788d4[_0x6694('0x1b')][_0x6694('0x20')]||null:null,'attributes':_0xe788d4[_0x6694('0x1b')]?_0xe788d4[_0x6694('0x1b')][_0x6694('0x21')]||null:null,'limit':_0xe788d4[_0x6694('0x1b')]?_0xe788d4[_0x6694('0x1b')][_0x6694('0x22')]||null:null})[_0x6694('0xd')](function(_0xe4e9fd){logger['info'](_0x6694('0x1d'),_0xe788d4);logger[_0x6694('0x10')](_0x6694('0x1d'),_0xe788d4,JSON[_0x6694('0x12')](_0xe4e9fd));_0x4f2825(_0xe4e9fd);})[_0x6694('0x17')](function(_0x455d4f){logger['error'](_0x6694('0x1d'),_0x455d4f['message'],_0xe788d4);_0x50a9bd(_0x5218f1[_0x6694('0x13')](0x1f4,_0x455d4f['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd87=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x3729dc,_0x2573c7){var _0x4a2ebd=function(_0x835d93){while(--_0x835d93){_0x3729dc['push'](_0x3729dc['shift']());}};_0x4a2ebd(++_0x2573c7);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0x12')]('/',auth[_0x7fd8('0xb')](),controller['create']);router['put']('/:id',auth[_0x7fd8('0xb')](),controller['update']);router[_0x7fd8('0x13')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),controller['destroy']);module[_0x7fd8('0x14')]=router;
\ No newline at end of file
+var _0x60c2=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x5e3d52,_0x589040){var _0xc7298b=function(_0xca8cd3){while(--_0xca8cd3){_0x5e3d52['push'](_0x5e3d52['shift']());}};_0xc7298b(++_0x589040);}(_0x60c2,0x8f));var _0x260c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60c2[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x260c('0x0'));var path=require(_0x260c('0x1'));var timeout=require(_0x260c('0x2'));var express=require(_0x260c('0x3'));var router=express[_0x260c('0x4')]();var fs_extra=require(_0x260c('0x5'));var auth=require(_0x260c('0x6'));var interaction=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var controller=require(_0x260c('0x9'));router[_0x260c('0xa')]('/',auth[_0x260c('0xb')](),controller['index']);router[_0x260c('0xa')](_0x260c('0xc'),auth[_0x260c('0xb')](),controller[_0x260c('0xd')]);router['get'](_0x260c('0xe'),auth[_0x260c('0xb')](),controller[_0x260c('0xf')]);router[_0x260c('0x10')]('/',auth[_0x260c('0xb')](),controller[_0x260c('0x11')]);router[_0x260c('0x12')]('/:id',auth[_0x260c('0xb')](),controller[_0x260c('0x13')]);router[_0x260c('0x14')]('/:id',auth[_0x260c('0xb')](),controller[_0x260c('0x15')]);module[_0x260c('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x48b8ad,_0xe28403){var _0x4d1bae=function(_0x5d13b2){while(--_0x5d13b2){_0x48b8ad['push'](_0x48b8ad['shift']());}};_0x4d1bae(++_0xe28403);}(_0x54ef,0x112));var _0xf54e=function(_0x1406ef,_0x31d04a){_0x1406ef=_0x1406ef-0x0;var _0x420b67=_0x54ef[_0x1406ef];return _0x420b67;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x5cae4a,_0x40084e){var _0x3e261d=function(_0x533bd1){while(--_0x533bd1){_0x5cae4a['push'](_0x5cae4a['shift']());}};_0x3e261d(++_0x40084e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4b84[_0x55f8b4];return _0x2475f9;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf0de=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xf0de,0x13f));var _0xef0d=function(_0x1cd281,_0x3c7cb6){_0x1cd281=_0x1cd281-0x0;var _0x339c6e=_0xf0de[_0x1cd281];return _0x339c6e;};'use strict';var emlformat=require(_0xef0d('0x0'));var rimraf=require(_0xef0d('0x1'));var zipdir=require(_0xef0d('0x2'));var jsonpatch=require(_0xef0d('0x3'));var rp=require(_0xef0d('0x4'));var moment=require('moment');var BPromise=require(_0xef0d('0x5'));var Mustache=require('mustache');var util=require(_0xef0d('0x6'));var path=require(_0xef0d('0x7'));var sox=require('sox');var csv=require(_0xef0d('0x8'));var ejs=require(_0xef0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef0d('0xa'));var squel=require(_0xef0d('0xb'));var crypto=require(_0xef0d('0xc'));var jsforce=require(_0xef0d('0xd'));var deskjs=require(_0xef0d('0xe'));var toCsv=require(_0xef0d('0x8'));var querystring=require(_0xef0d('0xf'));var Papa=require('papaparse');var Redis=require(_0xef0d('0x10'));var authService=require(_0xef0d('0x11'));var qs=require(_0xef0d('0x12'));var as=require(_0xef0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef0d('0x14'))(_0xef0d('0x15'));var utils=require('../../config/utils');var config=require(_0xef0d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xef0d('0x17'))['db'];function respondWithStatusCode(_0x57bf09,_0x4f29a1){_0x4f29a1=_0x4f29a1||0xcc;return function(_0x54f929){if(_0x54f929){return _0x57bf09[_0xef0d('0x18')](_0x4f29a1);}return _0x57bf09[_0xef0d('0x19')](_0x4f29a1)[_0xef0d('0x1a')]();};}function respondWithResult(_0xe25ea,_0x1e85b6){_0x1e85b6=_0x1e85b6||0xc8;return function(_0x1d53e2){if(_0x1d53e2){return _0xe25ea['status'](_0x1e85b6)[_0xef0d('0x1b')](_0x1d53e2);}};}function respondWithFilteredResult(_0x4af3ba,_0x3e065d){return function(_0xbee4d7){if(_0xbee4d7){var _0x3f2a4f=typeof _0x3e065d[_0xef0d('0x1c')]===_0xef0d('0x1d')&&typeof _0x3e065d[_0xef0d('0x1e')]==='undefined';var _0x55937d=_0xbee4d7[_0xef0d('0x1f')];var _0x1e3031=_0x3f2a4f?0x0:_0x3e065d['offset'];var _0x42d934=_0x3f2a4f?_0xbee4d7['count']:_0x3e065d[_0xef0d('0x1c')]+_0x3e065d['limit'];var _0x4f5f07;if(_0x42d934>=_0x55937d){_0x42d934=_0x55937d;_0x4f5f07=0xc8;}else{_0x4f5f07=0xce;}_0x4af3ba['status'](_0x4f5f07);return _0x4af3ba[_0xef0d('0x20')]('Content-Range',_0x1e3031+'-'+_0x42d934+'/'+_0x55937d)[_0xef0d('0x1b')](_0xbee4d7);}return null;};}function patchUpdates(_0x353c5c){return function(_0x2fa3ee){try{jsonpatch[_0xef0d('0x21')](_0x2fa3ee,_0x353c5c,!![]);}catch(_0x229dd8){return BPromise[_0xef0d('0x22')](_0x229dd8);}return _0x2fa3ee[_0xef0d('0x23')]();};}function saveUpdates(_0x15a8ab,_0x39aeb2){return function(_0x406432){if(_0x406432){return _0x406432['update'](_0x15a8ab)[_0xef0d('0x24')](function(_0x5107fa){return _0x5107fa;});}return null;};}function removeEntity(_0x2ba8ee,_0xb6433e){return function(_0x4cf4a4){if(_0x4cf4a4){return _0x4cf4a4[_0xef0d('0x25')]()[_0xef0d('0x24')](function(){_0x2ba8ee['status'](0xcc)[_0xef0d('0x1a')]();});}};}function handleEntityNotFound(_0x2fe83b,_0x17b81a){return function(_0x455f74){if(!_0x455f74){_0x2fe83b[_0xef0d('0x18')](0x194);}return _0x455f74;};}function handleError(_0x2841d1,_0xab6b53){_0xab6b53=_0xab6b53||0x1f4;return function(_0x4e2925){logger[_0xef0d('0x26')](_0x4e2925[_0xef0d('0x27')]);if(_0x4e2925[_0xef0d('0x28')]){delete _0x4e2925[_0xef0d('0x28')];}_0x2841d1[_0xef0d('0x19')](_0xab6b53)['send'](_0x4e2925);};}exports['index']=function(_0x3fd9b0,_0x4e1cb2){var _0x159eb3={},_0x26e259={},_0x8c399f={'count':0x0,'rows':[]};var _0x1900d2=_[_0xef0d('0x29')](db[_0xef0d('0x2a')][_0xef0d('0x2b')],function(_0x24bfc4){return{'name':_0x24bfc4[_0xef0d('0x2c')],'type':_0x24bfc4[_0xef0d('0x2d')][_0xef0d('0x2e')]};});_0x26e259[_0xef0d('0x2f')]=_[_0xef0d('0x29')](_0x1900d2,'name');_0x26e259[_0xef0d('0x30')]=_[_0xef0d('0x31')](_0x3fd9b0[_0xef0d('0x30')]);_0x26e259[_0xef0d('0x32')]=_['intersection'](_0x26e259[_0xef0d('0x2f')],_0x26e259['query']);_0x159eb3[_0xef0d('0x33')]=_[_0xef0d('0x34')](_0x26e259[_0xef0d('0x2f')],qs[_0xef0d('0x35')](_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x35')]));_0x159eb3[_0xef0d('0x33')]=_0x159eb3[_0xef0d('0x33')][_0xef0d('0x36')]?_0x159eb3[_0xef0d('0x33')]:_0x26e259[_0xef0d('0x2f')];if(!_0x3fd9b0[_0xef0d('0x30')]['hasOwnProperty'](_0xef0d('0x37'))){_0x159eb3['limit']=qs[_0xef0d('0x1e')](_0x3fd9b0['query'][_0xef0d('0x1e')]);_0x159eb3[_0xef0d('0x1c')]=qs[_0xef0d('0x1c')](_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x1c')]);}_0x159eb3[_0xef0d('0x38')]=qs[_0xef0d('0x39')](_0x3fd9b0[_0xef0d('0x30')]['sort']);_0x159eb3[_0xef0d('0x3a')]=qs['filters'](_[_0xef0d('0x3b')](_0x3fd9b0[_0xef0d('0x30')],_0x26e259[_0xef0d('0x32')]),_0x1900d2);if(_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x3c')]){_0x159eb3[_0xef0d('0x3a')]=_[_0xef0d('0x3d')](_0x159eb3[_0xef0d('0x3a')],{'$or':_[_0xef0d('0x29')](_0x1900d2,function(_0x5af91b){if(_0x5af91b[_0xef0d('0x2d')]!==_0xef0d('0x3e')){var _0x36cd30={};_0x36cd30[_0x5af91b['name']]={'$like':'%'+_0x3fd9b0['query'][_0xef0d('0x3c')]+'%'};return _0x36cd30;}})});}_0x159eb3=_['merge']({},_0x159eb3,_0x3fd9b0[_0xef0d('0x3f')]);var _0x174e8a={'where':_0x159eb3[_0xef0d('0x3a')]};return db[_0xef0d('0x2a')][_0xef0d('0x1f')](_0x174e8a)[_0xef0d('0x24')](function(_0x574498){_0x8c399f['count']=_0x574498;if(_0x3fd9b0[_0xef0d('0x30')][_0xef0d('0x40')]){_0x159eb3[_0xef0d('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xef0d('0x42')](_0x159eb3);})[_0xef0d('0x24')](function(_0xd3a209){_0x8c399f[_0xef0d('0x43')]=_0xd3a209;return _0x8c399f;})[_0xef0d('0x24')](respondWithFilteredResult(_0x4e1cb2,_0x159eb3))['catch'](handleError(_0x4e1cb2,null));};exports[_0xef0d('0x44')]=function(_0x23d48f,_0x30eac7){var _0x595f6a={'raw':!![],'where':{'id':_0x23d48f[_0xef0d('0x45')]['id']}},_0x3e2889={};_0x3e2889['model']=_[_0xef0d('0x31')](db['SmsTransferReport'][_0xef0d('0x2b')]);_0x3e2889[_0xef0d('0x30')]=_[_0xef0d('0x31')](_0x23d48f[_0xef0d('0x30')]);_0x3e2889[_0xef0d('0x32')]=_[_0xef0d('0x34')](_0x3e2889['model'],_0x3e2889[_0xef0d('0x30')]);_0x595f6a[_0xef0d('0x33')]=_[_0xef0d('0x34')](_0x3e2889[_0xef0d('0x2f')],qs[_0xef0d('0x35')](_0x23d48f[_0xef0d('0x30')][_0xef0d('0x35')]));_0x595f6a[_0xef0d('0x33')]=_0x595f6a[_0xef0d('0x33')][_0xef0d('0x36')]?_0x595f6a['attributes']:_0x3e2889[_0xef0d('0x2f')];if(_0x23d48f[_0xef0d('0x30')][_0xef0d('0x40')]){_0x595f6a[_0xef0d('0x41')]=[{'all':!![]}];}_0x595f6a=_['merge']({},_0x595f6a,_0x23d48f[_0xef0d('0x3f')]);return db[_0xef0d('0x2a')][_0xef0d('0x46')](_0x595f6a)['then'](handleEntityNotFound(_0x30eac7,null))[_0xef0d('0x24')](respondWithResult(_0x30eac7,null))[_0xef0d('0x47')](handleError(_0x30eac7,null));};exports[_0xef0d('0x48')]=function(_0x1a0b95,_0x3670a3){return db[_0xef0d('0x2a')][_0xef0d('0x48')](_0x1a0b95['body'],{})['then'](respondWithResult(_0x3670a3,0xc9))[_0xef0d('0x47')](handleError(_0x3670a3,null));};exports['update']=function(_0x4f3e0e,_0x45eda0){if(_0x4f3e0e['body']['id']){delete _0x4f3e0e[_0xef0d('0x49')]['id'];}return db[_0xef0d('0x2a')][_0xef0d('0x46')]({'where':{'id':_0x4f3e0e[_0xef0d('0x45')]['id']}})[_0xef0d('0x24')](handleEntityNotFound(_0x45eda0,null))[_0xef0d('0x24')](saveUpdates(_0x4f3e0e['body'],null))[_0xef0d('0x24')](respondWithResult(_0x45eda0,null))['catch'](handleError(_0x45eda0,null));};exports[_0xef0d('0x25')]=function(_0x4dc29b,_0x56d902){return db[_0xef0d('0x2a')][_0xef0d('0x46')]({'where':{'id':_0x4dc29b[_0xef0d('0x45')]['id']}})[_0xef0d('0x24')](handleEntityNotFound(_0x56d902,null))[_0xef0d('0x24')](removeEntity(_0x56d902,null))[_0xef0d('0x47')](handleError(_0x56d902,null));};exports['describe']=function(_0x5a25cc,_0x42058f){return db['SmsTransferReport'][_0xef0d('0x4a')]()['then'](respondWithResult(_0x42058f,null))['catch'](handleError(_0x42058f,null));};
\ No newline at end of file
+var _0xfc9d=['json','apply','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','length','nolimit','sort','filter','where','VIRTUAL','merge','includeAll','findAll','rows','show','include','options','find','create','body','params','catch','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x3a92b0,_0x149513){var _0x1dcf0f=function(_0x26acda){while(--_0x26acda){_0x3a92b0['push'](_0x3a92b0['shift']());}};_0x1dcf0f(++_0x149513);}(_0xfc9d,0x191));var _0xdfc9=function(_0x595609,_0x4d56f3){_0x595609=_0x595609-0x0;var _0x3822ba=_0xfc9d[_0x595609];return _0x3822ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfc9('0x0'));var zipdir=require(_0xdfc9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfc9('0x2'));var moment=require('moment');var BPromise=require(_0xdfc9('0x3'));var Mustache=require('mustache');var util=require(_0xdfc9('0x4'));var path=require(_0xdfc9('0x5'));var sox=require(_0xdfc9('0x6'));var csv=require(_0xdfc9('0x7'));var ejs=require(_0xdfc9('0x8'));var fs=require('fs');var fs_extra=require(_0xdfc9('0x9'));var _=require(_0xdfc9('0xa'));var squel=require('squel');var crypto=require(_0xdfc9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdfc9('0xc'));var toCsv=require(_0xdfc9('0x7'));var querystring=require(_0xdfc9('0xd'));var Papa=require('papaparse');var Redis=require(_0xdfc9('0xe'));var authService=require(_0xdfc9('0xf'));var qs=require(_0xdfc9('0x10'));var as=require(_0xdfc9('0x11'));var hardwareService=require(_0xdfc9('0x12'));var logger=require(_0xdfc9('0x13'))(_0xdfc9('0x14'));var utils=require(_0xdfc9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdfc9('0x16'));var db=require(_0xdfc9('0x17'))['db'];function respondWithStatusCode(_0x144117,_0x337fcd){_0x337fcd=_0x337fcd||0xcc;return function(_0x30db4d){if(_0x30db4d){return _0x144117[_0xdfc9('0x18')](_0x337fcd);}return _0x144117[_0xdfc9('0x19')](_0x337fcd)[_0xdfc9('0x1a')]();};}function respondWithResult(_0x5011ec,_0x347cf6){_0x347cf6=_0x347cf6||0xc8;return function(_0x11abf9){if(_0x11abf9){return _0x5011ec[_0xdfc9('0x19')](_0x347cf6)['json'](_0x11abf9);}};}function respondWithFilteredResult(_0x1bcc87,_0x246aad){return function(_0x47a664){if(_0x47a664){var _0x40ca02=typeof _0x246aad[_0xdfc9('0x1b')]===_0xdfc9('0x1c')&&typeof _0x246aad[_0xdfc9('0x1d')]==='undefined';var _0x1fdffd=_0x47a664[_0xdfc9('0x1e')];var _0x54c9bc=_0x40ca02?0x0:_0x246aad[_0xdfc9('0x1b')];var _0x526a00=_0x40ca02?_0x47a664['count']:_0x246aad[_0xdfc9('0x1b')]+_0x246aad['limit'];var _0x3714c6;if(_0x526a00>=_0x1fdffd){_0x526a00=_0x1fdffd;_0x3714c6=0xc8;}else{_0x3714c6=0xce;}_0x1bcc87['status'](_0x3714c6);return _0x1bcc87['set']('Content-Range',_0x54c9bc+'-'+_0x526a00+'/'+_0x1fdffd)[_0xdfc9('0x1f')](_0x47a664);}return null;};}function patchUpdates(_0x89363c){return function(_0x3c32aa){try{jsonpatch[_0xdfc9('0x20')](_0x3c32aa,_0x89363c,!![]);}catch(_0xe36799){return BPromise['reject'](_0xe36799);}return _0x3c32aa['save']();};}function saveUpdates(_0x37a4d0,_0xce1373){return function(_0x3950df){if(_0x3950df){return _0x3950df[_0xdfc9('0x21')](_0x37a4d0)[_0xdfc9('0x22')](function(_0xbdefea){return _0xbdefea;});}return null;};}function removeEntity(_0x250b5e,_0x31c6b8){return function(_0x1682f4){if(_0x1682f4){return _0x1682f4[_0xdfc9('0x23')]()[_0xdfc9('0x22')](function(){_0x250b5e[_0xdfc9('0x19')](0xcc)[_0xdfc9('0x1a')]();});}};}function handleEntityNotFound(_0x90773c,_0x3ac47b){return function(_0x48fab8){if(!_0x48fab8){_0x90773c[_0xdfc9('0x18')](0x194);}return _0x48fab8;};}function handleError(_0x91050c,_0x6e4656){_0x6e4656=_0x6e4656||0x1f4;return function(_0x1426a2){logger[_0xdfc9('0x24')](_0x1426a2[_0xdfc9('0x25')]);if(_0x1426a2[_0xdfc9('0x26')]){delete _0x1426a2[_0xdfc9('0x26')];}_0x91050c[_0xdfc9('0x19')](_0x6e4656)[_0xdfc9('0x27')](_0x1426a2);};}exports[_0xdfc9('0x28')]=function(_0x21eb3b,_0x322cdb){var _0x54e7fb={},_0x38b86f={},_0xadcbff={'count':0x0,'rows':[]};var _0x5a1ffc=_[_0xdfc9('0x29')](db[_0xdfc9('0x2a')][_0xdfc9('0x2b')],function(_0xa5d6ca){return{'name':_0xa5d6ca[_0xdfc9('0x2c')],'type':_0xa5d6ca[_0xdfc9('0x2d')][_0xdfc9('0x2e')]};});_0x38b86f[_0xdfc9('0x2f')]=_[_0xdfc9('0x29')](_0x5a1ffc,_0xdfc9('0x26'));_0x38b86f['query']=_[_0xdfc9('0x30')](_0x21eb3b['query']);_0x38b86f[_0xdfc9('0x31')]=_[_0xdfc9('0x32')](_0x38b86f[_0xdfc9('0x2f')],_0x38b86f['query']);_0x54e7fb[_0xdfc9('0x33')]=_[_0xdfc9('0x32')](_0x38b86f['model'],qs['fields'](_0x21eb3b[_0xdfc9('0x34')]['fields']));_0x54e7fb[_0xdfc9('0x33')]=_0x54e7fb['attributes'][_0xdfc9('0x35')]?_0x54e7fb[_0xdfc9('0x33')]:_0x38b86f['model'];if(!_0x21eb3b[_0xdfc9('0x34')]['hasOwnProperty'](_0xdfc9('0x36'))){_0x54e7fb[_0xdfc9('0x1d')]=qs['limit'](_0x21eb3b['query'][_0xdfc9('0x1d')]);_0x54e7fb[_0xdfc9('0x1b')]=qs[_0xdfc9('0x1b')](_0x21eb3b['query']['offset']);}_0x54e7fb['order']=qs[_0xdfc9('0x37')](_0x21eb3b[_0xdfc9('0x34')][_0xdfc9('0x37')]);_0x54e7fb['where']=qs[_0xdfc9('0x31')](_['pick'](_0x21eb3b['query'],_0x38b86f[_0xdfc9('0x31')]),_0x5a1ffc);if(_0x21eb3b[_0xdfc9('0x34')][_0xdfc9('0x38')]){_0x54e7fb[_0xdfc9('0x39')]=_['merge'](_0x54e7fb[_0xdfc9('0x39')],{'$or':_[_0xdfc9('0x29')](_0x5a1ffc,function(_0x44f8b9){if(_0x44f8b9[_0xdfc9('0x2d')]!==_0xdfc9('0x3a')){var _0x17719a={};_0x17719a[_0x44f8b9['name']]={'$like':'%'+_0x21eb3b['query'][_0xdfc9('0x38')]+'%'};return _0x17719a;}})});}_0x54e7fb=_[_0xdfc9('0x3b')]({},_0x54e7fb,_0x21eb3b['options']);var _0x283d6c={'where':_0x54e7fb[_0xdfc9('0x39')]};return db['SmsTransferReport'][_0xdfc9('0x1e')](_0x283d6c)[_0xdfc9('0x22')](function(_0x185eb8){_0xadcbff[_0xdfc9('0x1e')]=_0x185eb8;if(_0x21eb3b['query'][_0xdfc9('0x3c')]){_0x54e7fb['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xdfc9('0x3d')](_0x54e7fb);})[_0xdfc9('0x22')](function(_0x5e0e0e){_0xadcbff[_0xdfc9('0x3e')]=_0x5e0e0e;return _0xadcbff;})[_0xdfc9('0x22')](respondWithFilteredResult(_0x322cdb,_0x54e7fb))['catch'](handleError(_0x322cdb,null));};exports[_0xdfc9('0x3f')]=function(_0x46a936,_0x58688e){var _0x1a0017={'raw':!![],'where':{'id':_0x46a936['params']['id']}},_0x1b45a3={};_0x1b45a3[_0xdfc9('0x2f')]=_['keys'](db[_0xdfc9('0x2a')][_0xdfc9('0x2b')]);_0x1b45a3['query']=_[_0xdfc9('0x30')](_0x46a936[_0xdfc9('0x34')]);_0x1b45a3['filters']=_[_0xdfc9('0x32')](_0x1b45a3[_0xdfc9('0x2f')],_0x1b45a3['query']);_0x1a0017['attributes']=_[_0xdfc9('0x32')](_0x1b45a3[_0xdfc9('0x2f')],qs['fields'](_0x46a936[_0xdfc9('0x34')]['fields']));_0x1a0017['attributes']=_0x1a0017[_0xdfc9('0x33')][_0xdfc9('0x35')]?_0x1a0017[_0xdfc9('0x33')]:_0x1b45a3[_0xdfc9('0x2f')];if(_0x46a936[_0xdfc9('0x34')][_0xdfc9('0x3c')]){_0x1a0017[_0xdfc9('0x40')]=[{'all':!![]}];}_0x1a0017=_[_0xdfc9('0x3b')]({},_0x1a0017,_0x46a936[_0xdfc9('0x41')]);return db[_0xdfc9('0x2a')][_0xdfc9('0x42')](_0x1a0017)['then'](handleEntityNotFound(_0x58688e,null))[_0xdfc9('0x22')](respondWithResult(_0x58688e,null))['catch'](handleError(_0x58688e,null));};exports[_0xdfc9('0x43')]=function(_0x567025,_0x4286dd){return db['SmsTransferReport'][_0xdfc9('0x43')](_0x567025[_0xdfc9('0x44')],{})[_0xdfc9('0x22')](respondWithResult(_0x4286dd,0xc9))['catch'](handleError(_0x4286dd,null));};exports[_0xdfc9('0x21')]=function(_0x2c0f07,_0xce6b0d){if(_0x2c0f07[_0xdfc9('0x44')]['id']){delete _0x2c0f07['body']['id'];}return db[_0xdfc9('0x2a')][_0xdfc9('0x42')]({'where':{'id':_0x2c0f07[_0xdfc9('0x45')]['id']}})[_0xdfc9('0x22')](handleEntityNotFound(_0xce6b0d,null))[_0xdfc9('0x22')](saveUpdates(_0x2c0f07['body'],null))[_0xdfc9('0x22')](respondWithResult(_0xce6b0d,null))[_0xdfc9('0x46')](handleError(_0xce6b0d,null));};exports[_0xdfc9('0x23')]=function(_0x2fc29f,_0x20602c){return db[_0xdfc9('0x2a')][_0xdfc9('0x42')]({'where':{'id':_0x2fc29f[_0xdfc9('0x45')]['id']}})[_0xdfc9('0x22')](handleEntityNotFound(_0x20602c,null))['then'](removeEntity(_0x20602c,null))[_0xdfc9('0x46')](handleError(_0x20602c,null));};exports[_0xdfc9('0x47')]=function(_0x156a19,_0x1ed360){return db[_0xdfc9('0x2a')][_0xdfc9('0x47')]()[_0xdfc9('0x22')](respondWithResult(_0x1ed360,null))[_0xdfc9('0x46')](handleError(_0x1ed360,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbfb=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x3f5c0e,_0x22f6cb){var _0x5189ae=function(_0x5d507a){while(--_0x5d507a){_0x3f5c0e['push'](_0x3f5c0e['shift']());}};_0x5189ae(++_0x22f6cb);}(_0xdbfb,0x16b));var _0xbdbf=function(_0x457a1b,_0x13b741){_0x457a1b=_0x457a1b-0x0;var _0x2e4f6d=_0xdbfb[_0x457a1b];return _0x2e4f6d;};'use strict';var _=require(_0xbdbf('0x0'));var util=require(_0xbdbf('0x1'));var logger=require('../../config/logger')(_0xbdbf('0x2'));var moment=require(_0xbdbf('0x3'));var BPromise=require('bluebird');var rp=require(_0xbdbf('0x4'));var fs=require('fs');var path=require(_0xbdbf('0x5'));var rimraf=require(_0xbdbf('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0xbdbf('0x7')]=function(_0x1dd17f,_0x37e176){return _0x1dd17f[_0xbdbf('0x8')](_0xbdbf('0x9'),attributes,{'tableName':_0xbdbf('0xa'),'paranoid':![],'indexes':[{'name':_0xbdbf('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x03cf=['uniqueid','util','../../config/logger','bluebird','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x03cf,0x64));var _0xf03c=function(_0x51d79b,_0x282715){_0x51d79b=_0x51d79b-0x0;var _0x4e3418=_0x03cf[_0x51d79b];return _0x4e3418;};'use strict';var _=require('lodash');var util=require(_0xf03c('0x0'));var logger=require(_0xf03c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf03c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf03c('0x3'));var rimraf=require('rimraf');var config=require(_0xf03c('0x4'));var attributes=require(_0xf03c('0x5'));module[_0xf03c('0x6')]=function(_0x4c2af5,_0x11841d){return _0x4c2af5[_0xf03c('0x7')](_0xf03c('0x8'),attributes,{'tableName':_0xf03c('0x9'),'paranoid':![],'indexes':[{'name':_0xf03c('0xa'),'fields':[_0xf03c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x078c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x1b66bb,_0x3a6255){var _0x29f4dc=function(_0x48eaae){while(--_0x48eaae){_0x1b66bb['push'](_0x1b66bb['shift']());}};_0x29f4dc(++_0x3a6255);}(_0x078c,0x19f));var _0xc078=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x078c[_0x2389bc];return _0x170548;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var moment=require(_0xc078('0x1'));var BPromise=require(_0xc078('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc078('0x3'));var db=require(_0xc078('0x4'))['db'];var utils=require(_0xc078('0x5'));var logger=require(_0xc078('0x6'))('rpc');var config=require(_0xc078('0x7'));var jayson=require(_0xc078('0x8'));var client=jayson[_0xc078('0x9')][_0xc078('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40e428,_0x1705b0,_0x22661e){return new BPromise(function(_0x4030b1,_0x4d56df){return client['request'](_0x40e428,_0x22661e)['then'](function(_0x28dc54){logger[_0xc078('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x1705b0,_0xc078('0xc'));logger[_0xc078('0xd')](_0xc078('0xe'),_0x1705b0,_0xc078('0xc'),JSON[_0xc078('0xf')](_0x28dc54));if(_0x28dc54['error']){if(_0x28dc54['error'][_0xc078('0x10')]===0x1f4){logger[_0xc078('0x11')](_0xc078('0x12'),_0x1705b0,_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);return _0x4d56df(_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);}logger[_0xc078('0x11')](_0xc078('0x12'),_0x1705b0,_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);return _0x4030b1(_0x28dc54[_0xc078('0x11')][_0xc078('0x13')]);}else{logger[_0xc078('0xb')](_0xc078('0x12'),_0x1705b0,'request\x20sent');_0x4030b1(_0x28dc54[_0xc078('0x14')][_0xc078('0x13')]);}})[_0xc078('0x15')](function(_0x595b14){logger[_0xc078('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1705b0,_0x595b14);_0x4d56df(_0x595b14);});});}
\ No newline at end of file
+var _0x0b78=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x35dc54,_0x2bd0e1){var _0x252c3a=function(_0x429c52){while(--_0x429c52){_0x35dc54['push'](_0x35dc54['shift']());}};_0x252c3a(++_0x2bd0e1);}(_0x0b78,0x1ad));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x584401,_0x5e19ef,_0x122ebe){return new BPromise(function(_0x3c248d,_0x445c23){return client['request'](_0x584401,_0x122ebe)[_0x80b7('0x9')](function(_0x25a015){logger[_0x80b7('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x5e19ef,_0x80b7('0xb'));logger['debug'](_0x80b7('0xc'),_0x5e19ef,_0x80b7('0xb'),JSON[_0x80b7('0xd')](_0x25a015));if(_0x25a015[_0x80b7('0xe')]){if(_0x25a015[_0x80b7('0xe')][_0x80b7('0xf')]===0x1f4){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015[_0x80b7('0xe')][_0x80b7('0x11')]);return _0x445c23(_0x25a015[_0x80b7('0xe')]['message']);}logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015['error'][_0x80b7('0x11')]);return _0x3c248d(_0x25a015[_0x80b7('0xe')]['message']);}else{logger[_0x80b7('0xa')](_0x80b7('0x10'),_0x5e19ef,_0x80b7('0xb'));_0x3c248d(_0x25a015[_0x80b7('0x12')][_0x80b7('0x11')]);}})[_0x80b7('0x13')](function(_0x1e3d1c){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x1e3d1c);_0x445c23(_0x1e3d1c);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf6c4=['/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','now','extname','post','single','file','create','update','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index'];(function(_0x35f75a,_0x33b47c){var _0x3c9ac0=function(_0x2c83ce){while(--_0x2c83ce){_0x35f75a['push'](_0x35f75a['shift']());}};_0x3c9ac0(++_0x33b47c);}(_0xf6c4,0x195));var _0x4f6c=function(_0x397619,_0x22ca4c){_0x397619=_0x397619-0x0;var _0x40f95a=_0xf6c4[_0x397619];return _0x40f95a;};'use strict';var multer=require(_0x4f6c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f6c('0x1'));var router=express[_0x4f6c('0x2')]();var fs_extra=require(_0x4f6c('0x3'));var auth=require(_0x4f6c('0x4'));var interaction=require(_0x4f6c('0x5'));var config=require(_0x4f6c('0x6'));var controller=require(_0x4f6c('0x7'));router[_0x4f6c('0x8')]('/',auth[_0x4f6c('0x9')](),controller[_0x4f6c('0xa')]);router['get'](_0x4f6c('0xb'),auth[_0x4f6c('0x9')](),controller[_0x4f6c('0xc')]);router[_0x4f6c('0x8')](_0x4f6c('0xd'),auth[_0x4f6c('0x9')](),controller[_0x4f6c('0xe')]);var upload=multer({'storage':multer[_0x4f6c('0xf')]({'destination':function(_0x732d15,_0xdd8fc9,_0x2f9190){_0x2f9190(null,path[_0x4f6c('0x10')](config[_0x4f6c('0x11')],_0x4f6c('0x12')));},'filename':function(_0x57c40a,_0x584ce0,_0x3c15d6){_0x584ce0['originalname']=_0x584ce0[_0x4f6c('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c15d6(null,util[_0x4f6c('0x14')](_0x4f6c('0x15'),path[_0x4f6c('0x16')](_0x584ce0[_0x4f6c('0x13')],path['extname'](_0x584ce0[_0x4f6c('0x13')])),Date[_0x4f6c('0x17')](),path[_0x4f6c('0x18')](_0x584ce0['originalname'])));}})});router[_0x4f6c('0x19')]('/',upload[_0x4f6c('0x1a')](_0x4f6c('0x1b')),controller[_0x4f6c('0x1c')]);router['put'](_0x4f6c('0xb'),auth[_0x4f6c('0x9')](),controller[_0x4f6c('0x1d')]);router['delete']('/:id',auth[_0x4f6c('0x9')](),controller[_0x4f6c('0x1e')]);module[_0x4f6c('0x1f')]=router;
\ No newline at end of file
+var _0x89c9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/download','join','root','replace','format','%s-%s%s','basename','originalname','extname','post','single','file','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x587c72,_0x178503){var _0x330bc8=function(_0x3a18a0){while(--_0x3a18a0){_0x587c72['push'](_0x587c72['shift']());}};_0x330bc8(++_0x178503);}(_0x89c9,0xb0));var _0x989c=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0x89c9[_0x5b8685];return _0xa3ef57;};'use strict';var multer=require(_0x989c('0x0'));var util=require(_0x989c('0x1'));var path=require(_0x989c('0x2'));var timeout=require(_0x989c('0x3'));var express=require(_0x989c('0x4'));var router=express[_0x989c('0x5')]();var fs_extra=require(_0x989c('0x6'));var auth=require(_0x989c('0x7'));var interaction=require(_0x989c('0x8'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0x989c('0x9')](),controller[_0x989c('0xa')]);router[_0x989c('0xb')](_0x989c('0xc'),auth[_0x989c('0x9')](),controller[_0x989c('0xd')]);router['get'](_0x989c('0xe'),auth[_0x989c('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x23f5e0,_0x7e9d16,_0x427842){_0x427842(null,path[_0x989c('0xf')](config[_0x989c('0x10')],'server/files/sounds/original/'));},'filename':function(_0x48a506,_0xe4370d,_0x4837ff){_0xe4370d['originalname']=_0xe4370d['originalname'][_0x989c('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4837ff(null,util[_0x989c('0x12')](_0x989c('0x13'),path[_0x989c('0x14')](_0xe4370d[_0x989c('0x15')],path[_0x989c('0x16')](_0xe4370d[_0x989c('0x15')])),Date['now'](),path['extname'](_0xe4370d[_0x989c('0x15')])));}})});router[_0x989c('0x17')]('/',upload[_0x989c('0x18')](_0x989c('0x19')),controller[_0x989c('0x1a')]);router[_0x989c('0x1b')](_0x989c('0xc'),auth[_0x989c('0x9')](),controller[_0x989c('0x1c')]);router[_0x989c('0x1d')](_0x989c('0xc'),auth['isAuthenticated'](),controller['delete']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed2e=['name','BIGINT','INTEGER','FLOAT','sequelize','exports','STRING'];(function(_0x1e1106,_0x511117){var _0x213026=function(_0x331b42){while(--_0x331b42){_0x1e1106['push'](_0x1e1106['shift']());}};_0x213026(++_0x511117);}(_0xed2e,0x12a));var _0xeed2=function(_0x1bb6fd,_0x5f2b72){_0x1bb6fd=_0x1bb6fd-0x0;var _0x243b60=_0xed2e[_0x1bb6fd];return _0x243b60;};'use strict';var Sequelize=require(_0xeed2('0x0'));module[_0xeed2('0x1')]={'name':{'type':Sequelize[_0xeed2('0x2')],'unique':_0xeed2('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xeed2('0x2')]},'display_name':{'type':Sequelize[_0xeed2('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xeed2('0x2')]},'original_format':{'type':Sequelize[_0xeed2('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xeed2('0x4')]},'original_channelCount':{'type':Sequelize[_0xeed2('0x5')]},'original_bitRate':{'type':Sequelize[_0xeed2('0x4')]},'original_sampleRate':{'type':Sequelize[_0xeed2('0x5')]},'converted_format':{'type':Sequelize[_0xeed2('0x2')]},'converted_duration':{'type':Sequelize[_0xeed2('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xeed2('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xeed2('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x2706=['STRING','FLOAT','BIGINT','INTEGER','sequelize','name'];(function(_0x2dc6eb,_0x439724){var _0x2faaf1=function(_0x1fa112){while(--_0x1fa112){_0x2dc6eb['push'](_0x2dc6eb['shift']());}};_0x2faaf1(++_0x439724);}(_0x2706,0x1b4));var _0x6270=function(_0x36f4cb,_0x48f252){_0x36f4cb=_0x36f4cb-0x0;var _0xdc2f28=_0x2706[_0x36f4cb];return _0xdc2f28;};'use strict';var Sequelize=require(_0x6270('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6270('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6270('0x2')]},'display_name':{'type':Sequelize[_0x6270('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6270('0x2')]},'original_format':{'type':Sequelize[_0x6270('0x2')]},'original_duration':{'type':Sequelize[_0x6270('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6270('0x4')]},'original_channelCount':{'type':Sequelize[_0x6270('0x5')]},'original_bitRate':{'type':Sequelize[_0x6270('0x4')]},'original_sampleRate':{'type':Sequelize[_0x6270('0x5')]},'converted_format':{'type':Sequelize[_0x6270('0x2')]},'converted_duration':{'type':Sequelize[_0x6270('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x6270('0x4')]},'converted_channelCount':{'type':Sequelize[_0x6270('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6270('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6270('0x5')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe91=['unlinkSync','eml-format','rimraf','request-promise','moment','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','params','find','download','save_name','existsSync','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','%s.%s','format','create','basename','file','originalname','extname','substring','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','converted_bitRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format'];(function(_0x427e51,_0x3d2c88){var _0x341e36=function(_0x33eabc){while(--_0x33eabc){_0x427e51['push'](_0x427e51['shift']());}};_0x341e36(++_0x3d2c88);}(_0xfe91,0xf9));var _0x1fe9=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0xfe91[_0x39ffd1];return _0x31267e;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require(_0x1fe9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1fe9('0x2'));var moment=require(_0x1fe9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1fe9('0x4'));var csv=require('to-csv');var ejs=require(_0x1fe9('0x5'));var fs=require('fs');var fs_extra=require(_0x1fe9('0x6'));var _=require(_0x1fe9('0x7'));var squel=require(_0x1fe9('0x8'));var crypto=require(_0x1fe9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xa'));var toCsv=require(_0x1fe9('0xb'));var querystring=require(_0x1fe9('0xc'));var Papa=require(_0x1fe9('0xd'));var Redis=require(_0x1fe9('0xe'));var authService=require(_0x1fe9('0xf'));var qs=require(_0x1fe9('0x10'));var as=require(_0x1fe9('0x11'));var hardwareService=require(_0x1fe9('0x12'));var logger=require('../../config/logger')(_0x1fe9('0x13'));var utils=require(_0x1fe9('0x14'));var config=require(_0x1fe9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fe9('0x16'))['db'];function respondWithStatusCode(_0x1c94a4,_0x5bc9f3){_0x5bc9f3=_0x5bc9f3||0xcc;return function(_0x1765e0){if(_0x1765e0){return _0x1c94a4['sendStatus'](_0x5bc9f3);}return _0x1c94a4[_0x1fe9('0x17')](_0x5bc9f3)[_0x1fe9('0x18')]();};}function respondWithResult(_0x1b3e23,_0x35b0a9){_0x35b0a9=_0x35b0a9||0xc8;return function(_0x15f61c){if(_0x15f61c){return _0x1b3e23[_0x1fe9('0x17')](_0x35b0a9)['json'](_0x15f61c);}};}function respondWithFilteredResult(_0x9ddafb,_0x2d3a16){return function(_0x1889e4){if(_0x1889e4){var _0x4cbb4b=typeof _0x2d3a16[_0x1fe9('0x19')]===_0x1fe9('0x1a')&&typeof _0x2d3a16['limit']===_0x1fe9('0x1a');var _0x1abc1c=_0x1889e4[_0x1fe9('0x1b')];var _0xfc9af8=_0x4cbb4b?0x0:_0x2d3a16[_0x1fe9('0x19')];var _0x3fdd6b=_0x4cbb4b?_0x1889e4[_0x1fe9('0x1b')]:_0x2d3a16[_0x1fe9('0x19')]+_0x2d3a16[_0x1fe9('0x1c')];var _0x3b0d0;if(_0x3fdd6b>=_0x1abc1c){_0x3fdd6b=_0x1abc1c;_0x3b0d0=0xc8;}else{_0x3b0d0=0xce;}_0x9ddafb['status'](_0x3b0d0);return _0x9ddafb[_0x1fe9('0x1d')](_0x1fe9('0x1e'),_0xfc9af8+'-'+_0x3fdd6b+'/'+_0x1abc1c)['json'](_0x1889e4);}return null;};}function patchUpdates(_0x2029f0){return function(_0x1fd5e5){try{jsonpatch[_0x1fe9('0x1f')](_0x1fd5e5,_0x2029f0,!![]);}catch(_0x219154){return BPromise[_0x1fe9('0x20')](_0x219154);}return _0x1fd5e5[_0x1fe9('0x21')]();};}function saveUpdates(_0x3f3009,_0x7db33){return function(_0x28c9a3){if(_0x28c9a3){return _0x28c9a3[_0x1fe9('0x22')](_0x3f3009)[_0x1fe9('0x23')](function(_0x3ff4ed){return _0x3ff4ed;});}return null;};}function removeEntity(_0x5ea846,_0x1994f3){return function(_0x5a16f2){if(_0x5a16f2){return _0x5a16f2[_0x1fe9('0x24')]()[_0x1fe9('0x23')](function(){var _0x1a6d47=_0x5a16f2[_0x1fe9('0x25')]({'plain':!![]});var _0x8dd9dc=_0x1fe9('0x26');return db[_0x1fe9('0x27')][_0x1fe9('0x24')]({'where':{'type':_0x8dd9dc,'resourceId':_0x1a6d47['id']}})['then'](function(){return _0x5a16f2;});})['then'](function(){_0x5ea846[_0x1fe9('0x17')](0xcc)[_0x1fe9('0x18')]();});}};}function handleEntityNotFound(_0x417bcf,_0x9a0155){return function(_0x5d16c9){if(!_0x5d16c9){_0x417bcf[_0x1fe9('0x28')](0x194);}return _0x5d16c9;};}function handleError(_0x437135,_0x58965a){_0x58965a=_0x58965a||0x1f4;return function(_0x335f4d){logger[_0x1fe9('0x29')](_0x335f4d['stack']);if(_0x335f4d[_0x1fe9('0x2a')]){delete _0x335f4d[_0x1fe9('0x2a')];}_0x437135[_0x1fe9('0x17')](_0x58965a)[_0x1fe9('0x2b')](_0x335f4d);};}exports[_0x1fe9('0x2c')]=function(_0x1cf4da,_0x3cc593){var _0x530b47={},_0x56fea7={},_0x29ee73={'count':0x0,'rows':[]};var _0x24d624=_[_0x1fe9('0x2d')](db[_0x1fe9('0x2e')][_0x1fe9('0x2f')],function(_0x20efa5){return{'name':_0x20efa5[_0x1fe9('0x30')],'type':_0x20efa5['type'][_0x1fe9('0x31')]};});_0x56fea7[_0x1fe9('0x32')]=_['map'](_0x24d624,_0x1fe9('0x2a'));_0x56fea7['query']=_[_0x1fe9('0x33')](_0x1cf4da['query']);_0x56fea7[_0x1fe9('0x34')]=_['intersection'](_0x56fea7[_0x1fe9('0x32')],_0x56fea7[_0x1fe9('0x35')]);_0x530b47[_0x1fe9('0x36')]=_[_0x1fe9('0x37')](_0x56fea7['model'],qs[_0x1fe9('0x38')](_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x38')]));_0x530b47[_0x1fe9('0x36')]=_0x530b47[_0x1fe9('0x36')][_0x1fe9('0x39')]?_0x530b47[_0x1fe9('0x36')]:_0x56fea7[_0x1fe9('0x32')];if(!_0x1cf4da['query'][_0x1fe9('0x3a')](_0x1fe9('0x3b'))){_0x530b47['limit']=qs['limit'](_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x1c')]);_0x530b47[_0x1fe9('0x19')]=qs[_0x1fe9('0x19')](_0x1cf4da['query'][_0x1fe9('0x19')]);}_0x530b47[_0x1fe9('0x3c')]=qs['sort'](_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x3d')]);_0x530b47[_0x1fe9('0x3e')]=qs[_0x1fe9('0x34')](_[_0x1fe9('0x3f')](_0x1cf4da[_0x1fe9('0x35')],_0x56fea7[_0x1fe9('0x34')]),_0x24d624);if(_0x1cf4da['query'][_0x1fe9('0x40')]){_0x530b47[_0x1fe9('0x3e')]=_[_0x1fe9('0x41')](_0x530b47[_0x1fe9('0x3e')],{'$or':_[_0x1fe9('0x2d')](_0x24d624,function(_0x5820c1){if(_0x5820c1[_0x1fe9('0x42')]!=='VIRTUAL'){var _0x500226={};_0x500226[_0x5820c1[_0x1fe9('0x2a')]]={'$like':'%'+_0x1cf4da[_0x1fe9('0x35')]['filter']+'%'};return _0x500226;}})});}_0x530b47=_[_0x1fe9('0x41')]({},_0x530b47,_0x1cf4da[_0x1fe9('0x43')]);var _0x50ec21={'where':_0x530b47[_0x1fe9('0x3e')]};return db[_0x1fe9('0x2e')][_0x1fe9('0x1b')](_0x50ec21)['then'](function(_0x4fa477){_0x29ee73[_0x1fe9('0x1b')]=_0x4fa477;if(_0x1cf4da[_0x1fe9('0x35')][_0x1fe9('0x44')]){_0x530b47[_0x1fe9('0x45')]=[{'all':!![]}];}return db[_0x1fe9('0x2e')]['findAll'](_0x530b47);})['then'](function(_0x4ff192){_0x29ee73[_0x1fe9('0x46')]=_0x4ff192;return _0x29ee73;})[_0x1fe9('0x23')](respondWithFilteredResult(_0x3cc593,_0x530b47))[_0x1fe9('0x47')](handleError(_0x3cc593,null));};exports['show']=function(_0x50b4ab,_0x5d3062){var _0x17a6c4={'raw':!![],'where':{'id':_0x50b4ab[_0x1fe9('0x48')]['id']}},_0x2acc7f={};_0x2acc7f[_0x1fe9('0x32')]=_[_0x1fe9('0x33')](db[_0x1fe9('0x2e')]['rawAttributes']);_0x2acc7f[_0x1fe9('0x35')]=_['keys'](_0x50b4ab['query']);_0x2acc7f[_0x1fe9('0x34')]=_['intersection'](_0x2acc7f[_0x1fe9('0x32')],_0x2acc7f[_0x1fe9('0x35')]);_0x17a6c4['attributes']=_[_0x1fe9('0x37')](_0x2acc7f['model'],qs['fields'](_0x50b4ab[_0x1fe9('0x35')][_0x1fe9('0x38')]));_0x17a6c4[_0x1fe9('0x36')]=_0x17a6c4[_0x1fe9('0x36')][_0x1fe9('0x39')]?_0x17a6c4['attributes']:_0x2acc7f['model'];if(_0x50b4ab[_0x1fe9('0x35')][_0x1fe9('0x44')]){_0x17a6c4[_0x1fe9('0x45')]=[{'all':!![]}];}_0x17a6c4=_[_0x1fe9('0x41')]({},_0x17a6c4,_0x50b4ab[_0x1fe9('0x43')]);return db['Sound'][_0x1fe9('0x49')](_0x17a6c4)['then'](handleEntityNotFound(_0x5d3062,null))[_0x1fe9('0x23')](respondWithResult(_0x5d3062,null))[_0x1fe9('0x47')](handleError(_0x5d3062,null));};exports[_0x1fe9('0x4a')]=function(_0x4f37b2,_0x11daa5,_0x3e7f9c){return db[_0x1fe9('0x2e')][_0x1fe9('0x49')]({'where':{'id':_0x4f37b2['params']['id']},'attributes':['name',_0x1fe9('0x4b'),'converted_format'],'raw':!![]})[_0x1fe9('0x23')](handleEntityNotFound(_0x11daa5,null))[_0x1fe9('0x23')](function(_0x1a16f2){if(_0x1a16f2){if(!fs[_0x1fe9('0x4c')](path['join'](config[_0x1fe9('0x4d')],_0x1fe9('0x4e'),_0x1a16f2['save_name']+'.'+_0x1a16f2[_0x1fe9('0x4f')]))){throw new db[(_0x1fe9('0x50'))][(_0x1fe9('0x51'))]('Sound\x20not\x20found');}return _0x11daa5[_0x1fe9('0x4a')](path[_0x1fe9('0x52')](config[_0x1fe9('0x4d')],_0x1fe9('0x4e'),util['format'](_0x1fe9('0x53'),_0x1a16f2[_0x1fe9('0x4b')],_0x1a16f2['converted_format'])),util[_0x1fe9('0x54')](_0x1fe9('0x53'),_0x1a16f2['name'],_0x1a16f2[_0x1fe9('0x4f')]));}return null;})[_0x1fe9('0x47')](handleError(_0x11daa5,null));};exports[_0x1fe9('0x55')]=function(_0x2bba8b,_0x389e16,_0x2c4e00){var _0x32df68={'name':path[_0x1fe9('0x56')](_0x2bba8b[_0x1fe9('0x57')][_0x1fe9('0x58')],path[_0x1fe9('0x59')](_0x2bba8b['file'][_0x1fe9('0x58')])),'save_name':path[_0x1fe9('0x56')](_0x2bba8b[_0x1fe9('0x57')]['filename'],path[_0x1fe9('0x59')](_0x2bba8b[_0x1fe9('0x57')]['filename'])),'original_format':path['extname'](_0x2bba8b['file'][_0x1fe9('0x58')])[_0x1fe9('0x5a')](0x1),'converted_format':'wav'};var _0x321466=path[_0x1fe9('0x52')](config['root'],_0x1fe9('0x5b'),_0x2bba8b[_0x1fe9('0x57')]['filename']);var _0x17a87a=path[_0x1fe9('0x52')](config['root'],'server/files/sounds/converted',util[_0x1fe9('0x54')](_0x1fe9('0x53'),path['basename'](_0x2bba8b['file'][_0x1fe9('0x5c')],path[_0x1fe9('0x59')](_0x2bba8b['file']['filename'])),_0x32df68['converted_format']));logger[_0x1fe9('0x5d')](_0x1fe9('0x5e'),_0x321466);logger[_0x1fe9('0x5d')](_0x1fe9('0x5f'),_0x17a87a);try{fs[_0x1fe9('0x60')](_0x321466,parseInt(_0x1fe9('0x61'),0x8));var _0x4061eb=sox['transcode'](_0x321466,_0x17a87a,{'sampleRate':0x1f40,'format':_0x1fe9('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4061eb['on'](_0x1fe9('0x29'),function(_0x4a480d){fs['unlinkSync'](_0x321466);_0x389e16['status'](0x1f4)['send'](_0x4a480d);});_0x4061eb['on'](_0x1fe9('0x63'),function(_0x2fd6c9){_0x32df68[_0x1fe9('0x64')]=isNaN(_0x2fd6c9[_0x1fe9('0x65')])?null:_0x2fd6c9[_0x1fe9('0x65')]*0x3e8;_0x32df68[_0x1fe9('0x66')]=isNaN(_0x2fd6c9['sampleCount'])?null:_0x2fd6c9[_0x1fe9('0x67')];_0x32df68['original_channelCount']=isNaN(_0x2fd6c9['channelCount'])?null:_0x2fd6c9[_0x1fe9('0x68')];_0x32df68[_0x1fe9('0x69')]=isNaN(_0x2fd6c9[_0x1fe9('0x6a')])?null:_0x2fd6c9[_0x1fe9('0x6a')];_0x32df68[_0x1fe9('0x6b')]=isNaN(_0x2fd6c9['sampleRate'])?null:_0x2fd6c9[_0x1fe9('0x6c')];});_0x4061eb['on']('dest',function(_0x30f5ba){_0x32df68[_0x1fe9('0x6d')]=isNaN(_0x30f5ba[_0x1fe9('0x65')])?null:_0x30f5ba[_0x1fe9('0x65')]*0x3e8;_0x32df68['converted_sampleCount']=isNaN(_0x30f5ba[_0x1fe9('0x67')])?null:_0x30f5ba[_0x1fe9('0x67')];_0x32df68[_0x1fe9('0x6e')]=isNaN(_0x30f5ba[_0x1fe9('0x68')])?null:_0x30f5ba['channelCount'];_0x32df68[_0x1fe9('0x6f')]=isNaN(_0x30f5ba['bitRate'])?null:_0x30f5ba[_0x1fe9('0x6a')];_0x32df68['converted_sampleRate']=isNaN(_0x30f5ba[_0x1fe9('0x6c')])?null:_0x30f5ba[_0x1fe9('0x6c')];});_0x4061eb['on'](_0x1fe9('0x18'),function(){fs['chmodSync'](_0x17a87a,parseInt(_0x1fe9('0x61'),0x8));return db[_0x1fe9('0x2e')][_0x1fe9('0x55')](_0x32df68)[_0x1fe9('0x23')](function(_0x49599c){var _0x31a8be={'role':_0x2bba8b[_0x1fe9('0x70')][_0x1fe9('0x71')],'userProfileId':_0x2bba8b[_0x1fe9('0x70')]['userProfileId']};if(!_0x31a8be)throw new Error(_0x1fe9('0x72'));if(_0x31a8be[_0x1fe9('0x71')]===_0x1fe9('0x73')){var _0x370e69=_0x49599c[_0x1fe9('0x25')]({'plain':!![]});return db[_0x1fe9('0x74')][_0x1fe9('0x49')]({'where':{'name':_0x1fe9('0x26'),'userProfileId':_0x31a8be[_0x1fe9('0x75')]},'raw':!![]})[_0x1fe9('0x23')](function(_0x480633){if(_0x480633&&_0x480633[_0x1fe9('0x76')]===0x0){return db[_0x1fe9('0x27')][_0x1fe9('0x55')]({'name':_0x370e69['name'],'resourceId':_0x370e69['id'],'type':_0x480633[_0x1fe9('0x2a')],'sectionId':_0x480633['id']},{})[_0x1fe9('0x23')](function(){return _0x49599c;});}else{return _0x49599c;}})['catch'](function(_0x341fd6){logger[_0x1fe9('0x29')](_0x1fe9('0x77'),_0x341fd6);throw _0x341fd6;});}return _0x49599c;})[_0x1fe9('0x23')](respondWithResult(_0x389e16,null))['catch'](handleError(_0x389e16,null));});_0x4061eb['start']();}catch(_0x1efad5){_0x389e16['status'](0x1f4)[_0x1fe9('0x2b')](_0x1efad5);}};exports[_0x1fe9('0x22')]=function(_0x1ec9d6,_0xb5d6d0,_0xb3f35c){return db[_0x1fe9('0x2e')][_0x1fe9('0x49')]({'where':{'id':_0x1ec9d6[_0x1fe9('0x48')]['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0xb5d6d0,null))[_0x1fe9('0x23')](saveUpdates(_['pick'](_0x1ec9d6[_0x1fe9('0x70')],['name',_0x1fe9('0x78')]),null))['then'](respondWithResult(_0xb5d6d0,null))['catch'](handleError(_0xb5d6d0,null));};exports[_0x1fe9('0x79')]=function(_0x1753b8,_0x1acfb6,_0x43bb59){return db[_0x1fe9('0x2e')][_0x1fe9('0x49')]({'where':{'id':_0x1753b8[_0x1fe9('0x48')]['id']}})[_0x1fe9('0x23')](function(_0x58745b){if(_0x58745b){return _0x58745b[_0x1fe9('0x24')]();}})[_0x1fe9('0x23')](function(_0xf7cc77){var _0x12da8f=path[_0x1fe9('0x52')](config[_0x1fe9('0x4d')],_0x1fe9('0x5b'),util[_0x1fe9('0x54')]('%s.%s',_0xf7cc77['save_name'],_0xf7cc77[_0x1fe9('0x7a')]));var _0x6a3591=path['join'](config[_0x1fe9('0x4d')],'server/files/sounds/converted',util[_0x1fe9('0x54')](_0x1fe9('0x53'),_0xf7cc77['save_name'],_0xf7cc77[_0x1fe9('0x4f')]));fs[_0x1fe9('0x7b')](_0x12da8f);fs['unlinkSync'](_0x6a3591);return _0xf7cc77;})[_0x1fe9('0x23')](function(_0x4e55fa){if(_0x4e55fa){return _0x1acfb6['status'](0xcc)[_0x1fe9('0x18')]();}})[_0x1fe9('0x23')](handleEntityNotFound(_0x1acfb6,null))[_0x1fe9('0x47')](handleError(_0x1acfb6,null));};
\ No newline at end of file
+var _0x23db=['join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','file','extname','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','error','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','Sounds','stack','name','send','map','Sound','rawAttributes','fieldName','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','findAll','rows','show','params','fields','includeAll','include','find','catch','download','save_name','converted_format'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x23db,0x11e));var _0xb23d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x23db[_0x50007c];return _0x5c1ec7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb23d('0x0'));var rp=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb23d('0x3'));var path=require(_0xb23d('0x4'));var sox=require('sox');var csv=require(_0xb23d('0x5'));var ejs=require(_0xb23d('0x6'));var fs=require('fs');var fs_extra=require(_0xb23d('0x7'));var _=require(_0xb23d('0x8'));var squel=require(_0xb23d('0x9'));var crypto=require(_0xb23d('0xa'));var jsforce=require(_0xb23d('0xb'));var deskjs=require(_0xb23d('0xc'));var toCsv=require(_0xb23d('0x5'));var querystring=require(_0xb23d('0xd'));var Papa=require(_0xb23d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb23d('0xf'));var as=require(_0xb23d('0x10'));var hardwareService=require(_0xb23d('0x11'));var logger=require(_0xb23d('0x12'))(_0xb23d('0x13'));var utils=require(_0xb23d('0x14'));var config=require(_0xb23d('0x15'));var licenseUtil=require(_0xb23d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41c779,_0x456997){_0x456997=_0x456997||0xcc;return function(_0x272a78){if(_0x272a78){return _0x41c779[_0xb23d('0x17')](_0x456997);}return _0x41c779[_0xb23d('0x18')](_0x456997)[_0xb23d('0x19')]();};}function respondWithResult(_0xcab6fe,_0xd3c865){_0xd3c865=_0xd3c865||0xc8;return function(_0x412ad0){if(_0x412ad0){return _0xcab6fe['status'](_0xd3c865)['json'](_0x412ad0);}};}function respondWithFilteredResult(_0x474f2b,_0x131f45){return function(_0x1f9a7e){if(_0x1f9a7e){var _0x455b16=typeof _0x131f45[_0xb23d('0x1a')]===_0xb23d('0x1b')&&typeof _0x131f45[_0xb23d('0x1c')]===_0xb23d('0x1b');var _0x12c386=_0x1f9a7e[_0xb23d('0x1d')];var _0x254c64=_0x455b16?0x0:_0x131f45[_0xb23d('0x1a')];var _0x176556=_0x455b16?_0x1f9a7e['count']:_0x131f45[_0xb23d('0x1a')]+_0x131f45[_0xb23d('0x1c')];var _0x501ba5;if(_0x176556>=_0x12c386){_0x176556=_0x12c386;_0x501ba5=0xc8;}else{_0x501ba5=0xce;}_0x474f2b[_0xb23d('0x18')](_0x501ba5);return _0x474f2b['set']('Content-Range',_0x254c64+'-'+_0x176556+'/'+_0x12c386)[_0xb23d('0x1e')](_0x1f9a7e);}return null;};}function patchUpdates(_0x39e61a){return function(_0x387321){try{jsonpatch[_0xb23d('0x1f')](_0x387321,_0x39e61a,!![]);}catch(_0x5f18f0){return BPromise[_0xb23d('0x20')](_0x5f18f0);}return _0x387321[_0xb23d('0x21')]();};}function saveUpdates(_0x30709b,_0x50f089){return function(_0x2fa183){if(_0x2fa183){return _0x2fa183[_0xb23d('0x22')](_0x30709b)[_0xb23d('0x23')](function(_0x13a2b2){return _0x13a2b2;});}return null;};}function removeEntity(_0x481ab8,_0x183259){return function(_0x5554c4){if(_0x5554c4){return _0x5554c4[_0xb23d('0x24')]()[_0xb23d('0x23')](function(){var _0x15ec2d=_0x5554c4['get']({'plain':!![]});var _0x291cf7=_0xb23d('0x25');return db['UserProfileResource'][_0xb23d('0x24')]({'where':{'type':_0x291cf7,'resourceId':_0x15ec2d['id']}})[_0xb23d('0x23')](function(){return _0x5554c4;});})[_0xb23d('0x23')](function(){_0x481ab8['status'](0xcc)[_0xb23d('0x19')]();});}};}function handleEntityNotFound(_0x34007c,_0x2b2342){return function(_0x7c0071){if(!_0x7c0071){_0x34007c['sendStatus'](0x194);}return _0x7c0071;};}function handleError(_0x3174a7,_0x3923ed){_0x3923ed=_0x3923ed||0x1f4;return function(_0x1ba16a){logger['error'](_0x1ba16a[_0xb23d('0x26')]);if(_0x1ba16a[_0xb23d('0x27')]){delete _0x1ba16a[_0xb23d('0x27')];}_0x3174a7[_0xb23d('0x18')](_0x3923ed)[_0xb23d('0x28')](_0x1ba16a);};}exports['index']=function(_0x28056a,_0x446a46){var _0x58ef79={},_0x549663={},_0x221be9={'count':0x0,'rows':[]};var _0x19d915=_[_0xb23d('0x29')](db[_0xb23d('0x2a')][_0xb23d('0x2b')],function(_0x36f8e4){return{'name':_0x36f8e4[_0xb23d('0x2c')],'type':_0x36f8e4['type']['key']};});_0x549663['model']=_[_0xb23d('0x29')](_0x19d915,_0xb23d('0x27'));_0x549663['query']=_[_0xb23d('0x2d')](_0x28056a[_0xb23d('0x2e')]);_0x549663['filters']=_[_0xb23d('0x2f')](_0x549663[_0xb23d('0x30')],_0x549663['query']);_0x58ef79[_0xb23d('0x31')]=_[_0xb23d('0x2f')](_0x549663[_0xb23d('0x30')],qs['fields'](_0x28056a['query']['fields']));_0x58ef79[_0xb23d('0x31')]=_0x58ef79['attributes'][_0xb23d('0x32')]?_0x58ef79[_0xb23d('0x31')]:_0x549663[_0xb23d('0x30')];if(!_0x28056a['query'][_0xb23d('0x33')](_0xb23d('0x34'))){_0x58ef79[_0xb23d('0x1c')]=qs[_0xb23d('0x1c')](_0x28056a[_0xb23d('0x2e')]['limit']);_0x58ef79[_0xb23d('0x1a')]=qs['offset'](_0x28056a[_0xb23d('0x2e')][_0xb23d('0x1a')]);}_0x58ef79['order']=qs[_0xb23d('0x35')](_0x28056a[_0xb23d('0x2e')]['sort']);_0x58ef79[_0xb23d('0x36')]=qs['filters'](_[_0xb23d('0x37')](_0x28056a['query'],_0x549663[_0xb23d('0x38')]),_0x19d915);if(_0x28056a[_0xb23d('0x2e')][_0xb23d('0x39')]){_0x58ef79[_0xb23d('0x36')]=_[_0xb23d('0x3a')](_0x58ef79[_0xb23d('0x36')],{'$or':_[_0xb23d('0x29')](_0x19d915,function(_0x1c6a09){if(_0x1c6a09['type']!=='VIRTUAL'){var _0x50f115={};_0x50f115[_0x1c6a09[_0xb23d('0x27')]]={'$like':'%'+_0x28056a['query'][_0xb23d('0x39')]+'%'};return _0x50f115;}})});}_0x58ef79=_[_0xb23d('0x3a')]({},_0x58ef79,_0x28056a['options']);var _0x41270d={'where':_0x58ef79[_0xb23d('0x36')]};return db[_0xb23d('0x2a')][_0xb23d('0x1d')](_0x41270d)[_0xb23d('0x23')](function(_0x10fce0){_0x221be9[_0xb23d('0x1d')]=_0x10fce0;if(_0x28056a[_0xb23d('0x2e')]['includeAll']){_0x58ef79['include']=[{'all':!![]}];}return db[_0xb23d('0x2a')][_0xb23d('0x3b')](_0x58ef79);})[_0xb23d('0x23')](function(_0x5a841f){_0x221be9[_0xb23d('0x3c')]=_0x5a841f;return _0x221be9;})[_0xb23d('0x23')](respondWithFilteredResult(_0x446a46,_0x58ef79))['catch'](handleError(_0x446a46,null));};exports[_0xb23d('0x3d')]=function(_0x4c02ca,_0x41e2dd){var _0x1c5c26={'raw':!![],'where':{'id':_0x4c02ca[_0xb23d('0x3e')]['id']}},_0x4bffc4={};_0x4bffc4[_0xb23d('0x30')]=_[_0xb23d('0x2d')](db[_0xb23d('0x2a')]['rawAttributes']);_0x4bffc4['query']=_['keys'](_0x4c02ca[_0xb23d('0x2e')]);_0x4bffc4[_0xb23d('0x38')]=_[_0xb23d('0x2f')](_0x4bffc4['model'],_0x4bffc4[_0xb23d('0x2e')]);_0x1c5c26[_0xb23d('0x31')]=_[_0xb23d('0x2f')](_0x4bffc4[_0xb23d('0x30')],qs[_0xb23d('0x3f')](_0x4c02ca[_0xb23d('0x2e')]['fields']));_0x1c5c26[_0xb23d('0x31')]=_0x1c5c26[_0xb23d('0x31')][_0xb23d('0x32')]?_0x1c5c26['attributes']:_0x4bffc4[_0xb23d('0x30')];if(_0x4c02ca['query'][_0xb23d('0x40')]){_0x1c5c26[_0xb23d('0x41')]=[{'all':!![]}];}_0x1c5c26=_['merge']({},_0x1c5c26,_0x4c02ca['options']);return db['Sound'][_0xb23d('0x42')](_0x1c5c26)[_0xb23d('0x23')](handleEntityNotFound(_0x41e2dd,null))[_0xb23d('0x23')](respondWithResult(_0x41e2dd,null))[_0xb23d('0x43')](handleError(_0x41e2dd,null));};exports[_0xb23d('0x44')]=function(_0x2b2242,_0x118db1,_0xd39506){return db[_0xb23d('0x2a')]['find']({'where':{'id':_0x2b2242[_0xb23d('0x3e')]['id']},'attributes':[_0xb23d('0x27'),_0xb23d('0x45'),_0xb23d('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x118db1,null))[_0xb23d('0x23')](function(_0x40be89){if(_0x40be89){if(!fs['existsSync'](path[_0xb23d('0x47')](config[_0xb23d('0x48')],_0xb23d('0x49'),_0x40be89['save_name']+'.'+_0x40be89[_0xb23d('0x46')]))){throw new db[(_0xb23d('0x4a'))][(_0xb23d('0x4b'))]('Sound\x20not\x20found');}return _0x118db1['download'](path[_0xb23d('0x47')](config[_0xb23d('0x48')],'server/files/sounds/converted',util[_0xb23d('0x4c')]('%s.%s',_0x40be89['save_name'],_0x40be89[_0xb23d('0x46')])),util['format'](_0xb23d('0x4d'),_0x40be89['name'],_0x40be89[_0xb23d('0x46')]));}return null;})[_0xb23d('0x43')](handleError(_0x118db1,null));};exports[_0xb23d('0x4e')]=function(_0x1b53c7,_0x4632f1,_0x167364){var _0x1838cd={'name':path[_0xb23d('0x4f')](_0x1b53c7[_0xb23d('0x50')]['originalname'],path[_0xb23d('0x51')](_0x1b53c7[_0xb23d('0x50')][_0xb23d('0x52')])),'save_name':path[_0xb23d('0x4f')](_0x1b53c7[_0xb23d('0x50')][_0xb23d('0x53')],path[_0xb23d('0x51')](_0x1b53c7['file'][_0xb23d('0x53')])),'original_format':path['extname'](_0x1b53c7[_0xb23d('0x50')][_0xb23d('0x52')])[_0xb23d('0x54')](0x1),'converted_format':'wav'};var _0x53ae6f=path['join'](config['root'],_0xb23d('0x55'),_0x1b53c7[_0xb23d('0x50')][_0xb23d('0x53')]);var _0x3d97fd=path[_0xb23d('0x47')](config[_0xb23d('0x48')],'server/files/sounds/converted',util['format'](_0xb23d('0x4d'),path['basename'](_0x1b53c7[_0xb23d('0x50')][_0xb23d('0x53')],path[_0xb23d('0x51')](_0x1b53c7[_0xb23d('0x50')][_0xb23d('0x53')])),_0x1838cd[_0xb23d('0x46')]));logger[_0xb23d('0x56')](_0xb23d('0x57'),_0x53ae6f);logger[_0xb23d('0x56')](_0xb23d('0x58'),_0x3d97fd);try{fs[_0xb23d('0x59')](_0x53ae6f,parseInt('0777',0x8));var _0x1f8c64=sox[_0xb23d('0x5a')](_0x53ae6f,_0x3d97fd,{'sampleRate':0x1f40,'format':_0xb23d('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1f8c64['on'](_0xb23d('0x5c'),function(_0x4cd3ed){fs[_0xb23d('0x5d')](_0x53ae6f);_0x4632f1[_0xb23d('0x18')](0x1f4)[_0xb23d('0x28')](_0x4cd3ed);});_0x1f8c64['on'](_0xb23d('0x5e'),function(_0x5db3a7){_0x1838cd[_0xb23d('0x5f')]=isNaN(_0x5db3a7[_0xb23d('0x60')])?null:_0x5db3a7[_0xb23d('0x60')]*0x3e8;_0x1838cd['original_sampleCount']=isNaN(_0x5db3a7[_0xb23d('0x61')])?null:_0x5db3a7[_0xb23d('0x61')];_0x1838cd[_0xb23d('0x62')]=isNaN(_0x5db3a7[_0xb23d('0x63')])?null:_0x5db3a7[_0xb23d('0x63')];_0x1838cd[_0xb23d('0x64')]=isNaN(_0x5db3a7[_0xb23d('0x65')])?null:_0x5db3a7[_0xb23d('0x65')];_0x1838cd['original_sampleRate']=isNaN(_0x5db3a7[_0xb23d('0x66')])?null:_0x5db3a7['sampleRate'];});_0x1f8c64['on'](_0xb23d('0x67'),function(_0x95d290){_0x1838cd['converted_duration']=isNaN(_0x95d290[_0xb23d('0x60')])?null:_0x95d290['duration']*0x3e8;_0x1838cd[_0xb23d('0x68')]=isNaN(_0x95d290[_0xb23d('0x61')])?null:_0x95d290[_0xb23d('0x61')];_0x1838cd[_0xb23d('0x69')]=isNaN(_0x95d290[_0xb23d('0x63')])?null:_0x95d290['channelCount'];_0x1838cd[_0xb23d('0x6a')]=isNaN(_0x95d290[_0xb23d('0x65')])?null:_0x95d290[_0xb23d('0x65')];_0x1838cd[_0xb23d('0x6b')]=isNaN(_0x95d290[_0xb23d('0x66')])?null:_0x95d290['sampleRate'];});_0x1f8c64['on'](_0xb23d('0x19'),function(){fs[_0xb23d('0x59')](_0x3d97fd,parseInt(_0xb23d('0x6c'),0x8));return db['Sound'][_0xb23d('0x4e')](_0x1838cd)[_0xb23d('0x23')](function(_0x2e56ba){var _0x1350e9={'role':_0x1b53c7[_0xb23d('0x6d')][_0xb23d('0x6e')],'userProfileId':_0x1b53c7[_0xb23d('0x6d')][_0xb23d('0x6f')]};if(!_0x1350e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1350e9['role']==='user'){var _0xcdb2db=_0x2e56ba[_0xb23d('0x70')]({'plain':!![]});return db['UserProfileSection'][_0xb23d('0x42')]({'where':{'name':_0xb23d('0x25'),'userProfileId':_0x1350e9[_0xb23d('0x6f')]},'raw':!![]})['then'](function(_0x125801){if(_0x125801&&_0x125801[_0xb23d('0x71')]===0x0){return db[_0xb23d('0x72')][_0xb23d('0x4e')]({'name':_0xcdb2db[_0xb23d('0x27')],'resourceId':_0xcdb2db['id'],'type':_0x125801[_0xb23d('0x27')],'sectionId':_0x125801['id']},{})[_0xb23d('0x23')](function(){return _0x2e56ba;});}else{return _0x2e56ba;}})[_0xb23d('0x43')](function(_0x5c8f78){logger[_0xb23d('0x5c')](_0xb23d('0x73'),_0x5c8f78);throw _0x5c8f78;});}return _0x2e56ba;})[_0xb23d('0x23')](respondWithResult(_0x4632f1,null))[_0xb23d('0x43')](handleError(_0x4632f1,null));});_0x1f8c64[_0xb23d('0x74')]();}catch(_0x45801e){_0x4632f1[_0xb23d('0x18')](0x1f4)['send'](_0x45801e);}};exports[_0xb23d('0x22')]=function(_0x55d93c,_0x1ae3d4,_0x4e1ad5){return db[_0xb23d('0x2a')]['find']({'where':{'id':_0x55d93c[_0xb23d('0x3e')]['id']}})[_0xb23d('0x23')](handleEntityNotFound(_0x1ae3d4,null))[_0xb23d('0x23')](saveUpdates(_[_0xb23d('0x37')](_0x55d93c[_0xb23d('0x6d')],[_0xb23d('0x27'),_0xb23d('0x75')]),null))[_0xb23d('0x23')](respondWithResult(_0x1ae3d4,null))[_0xb23d('0x43')](handleError(_0x1ae3d4,null));};exports['delete']=function(_0x52973f,_0x39080f,_0x5fcbd){return db[_0xb23d('0x2a')][_0xb23d('0x42')]({'where':{'id':_0x52973f[_0xb23d('0x3e')]['id']}})[_0xb23d('0x23')](function(_0x5e58b5){if(_0x5e58b5){return _0x5e58b5[_0xb23d('0x24')]();}})[_0xb23d('0x23')](function(_0x515e48){var _0x3b3673=path[_0xb23d('0x47')](config[_0xb23d('0x48')],'server/files/sounds/original',util[_0xb23d('0x4c')](_0xb23d('0x4d'),_0x515e48['save_name'],_0x515e48[_0xb23d('0x76')]));var _0x5450a9=path['join'](config[_0xb23d('0x48')],_0xb23d('0x49'),util['format']('%s.%s',_0x515e48['save_name'],_0x515e48[_0xb23d('0x46')]));fs[_0xb23d('0x5d')](_0x3b3673);fs[_0xb23d('0x5d')](_0x5450a9);return _0x515e48;})[_0xb23d('0x23')](function(_0x1e9940){if(_0x1e9940){return _0x39080f[_0xb23d('0x18')](0xcc)[_0xb23d('0x19')]();}})[_0xb23d('0x23')](handleEntityNotFound(_0x39080f,null))[_0xb23d('0x43')](handleError(_0x39080f,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5587=['../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4b2331,_0x3dcd93){var _0x3005df=function(_0x47f6a7){while(--_0x47f6a7){_0x4b2331['push'](_0x4b2331['shift']());}};_0x3005df(++_0x3dcd93);}(_0x5587,0x132));var _0x7558=function(_0x174a72,_0x2d395e){_0x174a72=_0x174a72-0x0;var _0x2135a9=_0x5587[_0x174a72];return _0x2135a9;};'use strict';var _=require(_0x7558('0x0'));var util=require('util');var logger=require(_0x7558('0x1'))('api');var moment=require(_0x7558('0x2'));var BPromise=require(_0x7558('0x3'));var rp=require(_0x7558('0x4'));var fs=require('fs');var path=require(_0x7558('0x5'));var rimraf=require('rimraf');var config=require(_0x7558('0x6'));var attributes=require(_0x7558('0x7'));module[_0x7558('0x8')]=function(_0x8540c1,_0x37e37a){return _0x8540c1[_0x7558('0x9')](_0x7558('0xa'),attributes,{'tableName':_0x7558('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1281=['exports','define','tools_sounds','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1281,0x1d9));var _0x1128=function(_0xc0551f,_0x395dbf){_0xc0551f=_0xc0551f-0x0;var _0x47e8fa=_0x1281[_0xc0551f];return _0x47e8fa;};'use strict';var _=require(_0x1128('0x0'));var util=require(_0x1128('0x1'));var logger=require('../../config/logger')(_0x1128('0x2'));var moment=require(_0x1128('0x3'));var BPromise=require(_0x1128('0x4'));var rp=require(_0x1128('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1128('0x6'));var attributes=require('./sound.attributes');module[_0x1128('0x7')]=function(_0x4d0218,_0x266a4a){return _0x4d0218[_0x1128('0x8')]('Sound',attributes,{'tableName':_0x1128('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd9c7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','util','moment'];(function(_0x57ceb7,_0x244640){var _0x3ccc91=function(_0x20071a){while(--_0x20071a){_0x57ceb7['push'](_0x57ceb7['shift']());}};_0x3ccc91(++_0x244640);}(_0xd9c7,0x13e));var _0x7d9c=function(_0x11f226,_0x963733){_0x11f226=_0x11f226-0x0;var _0x408874=_0xd9c7[_0x11f226];return _0x408874;};'use strict';var _=require('lodash');var util=require(_0x7d9c('0x0'));var moment=require(_0x7d9c('0x1'));var BPromise=require(_0x7d9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d9c('0x3'));var db=require(_0x7d9c('0x4'))['db'];var utils=require(_0x7d9c('0x5'));var logger=require(_0x7d9c('0x6'))(_0x7d9c('0x7'));var config=require(_0x7d9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d9c('0x9')][_0x7d9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cada,_0x353a11,_0x49ddc8){return new BPromise(function(_0x42876b,_0x8620c2){return client['request'](_0x56cada,_0x49ddc8)[_0x7d9c('0xb')](function(_0x3e3961){logger['info'](_0x7d9c('0xc'),_0x353a11,_0x7d9c('0xd'));logger[_0x7d9c('0xe')](_0x7d9c('0xf'),_0x353a11,'request\x20sent',JSON[_0x7d9c('0x10')](_0x3e3961));if(_0x3e3961[_0x7d9c('0x11')]){if(_0x3e3961[_0x7d9c('0x11')][_0x7d9c('0x12')]===0x1f4){logger[_0x7d9c('0x11')](_0x7d9c('0xc'),_0x353a11,_0x3e3961[_0x7d9c('0x11')][_0x7d9c('0x13')]);return _0x8620c2(_0x3e3961['error'][_0x7d9c('0x13')]);}logger[_0x7d9c('0x11')](_0x7d9c('0xc'),_0x353a11,_0x3e3961['error']['message']);return _0x42876b(_0x3e3961[_0x7d9c('0x11')][_0x7d9c('0x13')]);}else{logger[_0x7d9c('0x14')](_0x7d9c('0xc'),_0x353a11,_0x7d9c('0xd'));_0x42876b(_0x3e3961[_0x7d9c('0x15')][_0x7d9c('0x13')]);}})[_0x7d9c('0x16')](function(_0x3ae30){logger[_0x7d9c('0x11')](_0x7d9c('0xc'),_0x353a11,_0x3ae30);_0x8620c2(_0x3ae30);});});}exports[_0x7d9c('0x17')]=function(_0x485740){var _0xf626fc=this;return new Promise(function(_0x346fd3,_0x14940e){return db['Sound'][_0x7d9c('0x18')]({'raw':_0x485740['options']?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1a')]===undefined?!![]:![]:!![],'where':_0x485740[_0x7d9c('0x19')]?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1b')]||null:null,'attributes':_0x485740[_0x7d9c('0x19')]?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1c')]||null:null,'include':_0x485740[_0x7d9c('0x19')]?_0x485740[_0x7d9c('0x19')][_0x7d9c('0x1d')]?_[_0x7d9c('0x1e')](_0x485740['options'][_0x7d9c('0x1d')],function(_0x5a5e14){return{'model':db[_0x5a5e14['model']],'as':_0x5a5e14['as'],'attributes':_0x5a5e14[_0x7d9c('0x1c')],'include':_0x5a5e14[_0x7d9c('0x1d')]?_[_0x7d9c('0x1e')](_0x5a5e14[_0x7d9c('0x1d')],function(_0x2f3e72){return{'model':db[_0x2f3e72[_0x7d9c('0x1f')]],'as':_0x2f3e72['as'],'attributes':_0x2f3e72[_0x7d9c('0x1c')],'include':_0x2f3e72[_0x7d9c('0x1d')]?_['map'](_0x2f3e72['include'],function(_0x23be7f){return{'model':db[_0x23be7f[_0x7d9c('0x1f')]],'as':_0x23be7f['as'],'attributes':_0x23be7f[_0x7d9c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7d9c('0xb')](function(_0x518890){logger[_0x7d9c('0x14')](_0x7d9c('0x17'),_0x485740);logger['debug'](_0x7d9c('0x17'),_0x485740,JSON['stringify'](_0x518890));_0x346fd3(_0x518890);})['catch'](function(_0x3b79f5){logger[_0x7d9c('0x11')](_0x7d9c('0x17'),_0x3b79f5[_0x7d9c('0x13')],_0x485740);_0x14940e(_0xf626fc[_0x7d9c('0x11')](0x1f4,_0x3b79f5[_0x7d9c('0x13')]));});});};
\ No newline at end of file
+var _0x93e2=['attributes','model','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','ShowSound','options','where','include','map'];(function(_0xca13d5,_0x4e9b40){var _0x240706=function(_0x31632e){while(--_0x31632e){_0xca13d5['push'](_0xca13d5['shift']());}};_0x240706(++_0x4e9b40);}(_0x93e2,0xd5));var _0x293e=function(_0x11cb0d,_0x312f6f){_0x11cb0d=_0x11cb0d-0x0;var _0x1b8375=_0x93e2[_0x11cb0d];return _0x1b8375;};'use strict';var _=require(_0x293e('0x0'));var util=require(_0x293e('0x1'));var moment=require(_0x293e('0x2'));var BPromise=require(_0x293e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x293e('0x4'));var db=require(_0x293e('0x5'))['db'];var utils=require(_0x293e('0x6'));var logger=require(_0x293e('0x7'))(_0x293e('0x8'));var config=require(_0x293e('0x9'));var jayson=require(_0x293e('0xa'));var client=jayson[_0x293e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e400b,_0x50e587,_0x419072){return new BPromise(function(_0x847eb4,_0x3be931){return client[_0x293e('0xc')](_0x4e400b,_0x419072)['then'](function(_0x46b841){logger['info'](_0x293e('0xd'),_0x50e587,_0x293e('0xe'));logger[_0x293e('0xf')](_0x293e('0x10'),_0x50e587,_0x293e('0xe'),JSON['stringify'](_0x46b841));if(_0x46b841[_0x293e('0x11')]){if(_0x46b841[_0x293e('0x11')]['code']===0x1f4){logger[_0x293e('0x11')](_0x293e('0xd'),_0x50e587,_0x46b841[_0x293e('0x11')][_0x293e('0x12')]);return _0x3be931(_0x46b841[_0x293e('0x11')][_0x293e('0x12')]);}logger['error'](_0x293e('0xd'),_0x50e587,_0x46b841['error'][_0x293e('0x12')]);return _0x847eb4(_0x46b841[_0x293e('0x11')][_0x293e('0x12')]);}else{logger[_0x293e('0x13')](_0x293e('0xd'),_0x50e587,_0x293e('0xe'));_0x847eb4(_0x46b841[_0x293e('0x14')][_0x293e('0x12')]);}})[_0x293e('0x15')](function(_0x54d578){logger[_0x293e('0x11')](_0x293e('0xd'),_0x50e587,_0x54d578);_0x3be931(_0x54d578);});});}exports[_0x293e('0x16')]=function(_0xe2ef5d){var _0x400f6f=this;return new Promise(function(_0x1c2f3d,_0x21310f){return db['Sound']['find']({'raw':_0xe2ef5d[_0x293e('0x17')]?_0xe2ef5d[_0x293e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe2ef5d['options']?_0xe2ef5d[_0x293e('0x17')][_0x293e('0x18')]||null:null,'attributes':_0xe2ef5d['options']?_0xe2ef5d['options']['attributes']||null:null,'include':_0xe2ef5d[_0x293e('0x17')]?_0xe2ef5d[_0x293e('0x17')][_0x293e('0x19')]?_[_0x293e('0x1a')](_0xe2ef5d[_0x293e('0x17')]['include'],function(_0x7ca008){return{'model':db[_0x7ca008['model']],'as':_0x7ca008['as'],'attributes':_0x7ca008[_0x293e('0x1b')],'include':_0x7ca008[_0x293e('0x19')]?_[_0x293e('0x1a')](_0x7ca008[_0x293e('0x19')],function(_0x5c0d60){return{'model':db[_0x5c0d60[_0x293e('0x1c')]],'as':_0x5c0d60['as'],'attributes':_0x5c0d60[_0x293e('0x1b')],'include':_0x5c0d60[_0x293e('0x19')]?_['map'](_0x5c0d60[_0x293e('0x19')],function(_0x5c1f05){return{'model':db[_0x5c1f05['model']],'as':_0x5c1f05['as'],'attributes':_0x5c1f05[_0x293e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x104ddd){logger['info'](_0x293e('0x16'),_0xe2ef5d);logger[_0x293e('0xf')](_0x293e('0x16'),_0xe2ef5d,JSON[_0x293e('0x1d')](_0x104ddd));_0x1c2f3d(_0x104ddd);})[_0x293e('0x15')](function(_0x32d281){logger[_0x293e('0x11')](_0x293e('0x16'),_0x32d281[_0x293e('0x12')],_0xe2ef5d);_0x21310f(_0x400f6f['error'](0x1f4,_0x32d281[_0x293e('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x54445f,_0x37ee99){var _0xfcb525=function(_0x3dfbd1){while(--_0x3dfbd1){_0x54445f['push'](_0x54445f['shift']());}};_0xfcb525(++_0x37ee99);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x42efe2,_0x331938){var _0x1acfb5=function(_0x59feba){while(--_0x59feba){_0x42efe2['push'](_0x42efe2['shift']());}};_0x1acfb5(++_0x331938);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x5eb8[_0x2ab3d9];return _0x210a54;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8958=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x8958,0x1a0));var _0x8895=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x8958[_0x90f34f];return _0x4b18cf;};'use strict';var Sequelize=require(_0x8895('0x0'));module[_0x8895('0x1')]={'uniqueid':{'type':Sequelize[_0x8895('0x2')]},'body':{'type':Sequelize[_0x8895('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x8895('0x4')]('in',_0x8895('0x5')),'defaultValue':_0x8895('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x8895('0x2')]},'providerResponse':{'type':Sequelize[_0x8895('0x3')]}};
\ No newline at end of file
+var _0x8e33=['exports','ENUM','out','STRING','TEXT','sequelize'];(function(_0x320e9c,_0xc84115){var _0x3d6ea4=function(_0x512fe3){while(--_0x512fe3){_0x320e9c['push'](_0x320e9c['shift']());}};_0x3d6ea4(++_0xc84115);}(_0x8e33,0x1a3));var _0x38e3=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8e33[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x38e3('0x0'));module[_0x38e3('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x38e3('0x2')]('in',_0x38e3('0x3')),'defaultValue':_0x38e3('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x38e3('0x4')]},'providerResponse':{'type':Sequelize[_0x38e3('0x5')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc771=['type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName'];(function(_0x2e6915,_0x6867d5){var _0x104401=function(_0x259790){while(--_0x259790){_0x2e6915['push'](_0x2e6915['shift']());}};_0x104401(++_0x6867d5);}(_0xc771,0x1d9));var _0x1c77=function(_0x4abf64,_0x5339dc){_0x4abf64=_0x4abf64-0x0;var _0x1a9114=_0xc771[_0x4abf64];return _0x1a9114;};'use strict';var emlformat=require(_0x1c77('0x0'));var rimraf=require(_0x1c77('0x1'));var zipdir=require(_0x1c77('0x2'));var jsonpatch=require(_0x1c77('0x3'));var rp=require('request-promise');var moment=require(_0x1c77('0x4'));var BPromise=require(_0x1c77('0x5'));var Mustache=require(_0x1c77('0x6'));var util=require(_0x1c77('0x7'));var path=require(_0x1c77('0x8'));var sox=require('sox');var csv=require(_0x1c77('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c77('0xa'));var _=require('lodash');var squel=require(_0x1c77('0xb'));var crypto=require(_0x1c77('0xc'));var jsforce=require(_0x1c77('0xd'));var deskjs=require(_0x1c77('0xe'));var toCsv=require(_0x1c77('0x9'));var querystring=require(_0x1c77('0xf'));var Papa=require(_0x1c77('0x10'));var Redis=require(_0x1c77('0x11'));var authService=require(_0x1c77('0x12'));var qs=require(_0x1c77('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c77('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1c77('0x15'));var config=require(_0x1c77('0x16'));var licenseUtil=require(_0x1c77('0x17'));var db=require(_0x1c77('0x18'))['db'];function respondWithStatusCode(_0x6430cc,_0x2cbffe){_0x2cbffe=_0x2cbffe||0xcc;return function(_0x2a067b){if(_0x2a067b){return _0x6430cc[_0x1c77('0x19')](_0x2cbffe);}return _0x6430cc[_0x1c77('0x1a')](_0x2cbffe)[_0x1c77('0x1b')]();};}function respondWithResult(_0x24fe42,_0x1a29ee){_0x1a29ee=_0x1a29ee||0xc8;return function(_0x1855ec){if(_0x1855ec){return _0x24fe42['status'](_0x1a29ee)['json'](_0x1855ec);}};}function respondWithFilteredResult(_0x4bde72,_0x1493b5){return function(_0x38b8b3){if(_0x38b8b3){var _0x20ae91=typeof _0x1493b5[_0x1c77('0x1c')]===_0x1c77('0x1d')&&typeof _0x1493b5['limit']===_0x1c77('0x1d');var _0x3f06ff=_0x38b8b3[_0x1c77('0x1e')];var _0x109226=_0x20ae91?0x0:_0x1493b5[_0x1c77('0x1c')];var _0x5b66ae=_0x20ae91?_0x38b8b3[_0x1c77('0x1e')]:_0x1493b5[_0x1c77('0x1c')]+_0x1493b5['limit'];var _0x39d1bd;if(_0x5b66ae>=_0x3f06ff){_0x5b66ae=_0x3f06ff;_0x39d1bd=0xc8;}else{_0x39d1bd=0xce;}_0x4bde72[_0x1c77('0x1a')](_0x39d1bd);return _0x4bde72['set'](_0x1c77('0x1f'),_0x109226+'-'+_0x5b66ae+'/'+_0x3f06ff)[_0x1c77('0x20')](_0x38b8b3);}return null;};}function patchUpdates(_0x18d0a8){return function(_0xc0ae6){try{jsonpatch['apply'](_0xc0ae6,_0x18d0a8,!![]);}catch(_0x1be9d3){return BPromise[_0x1c77('0x21')](_0x1be9d3);}return _0xc0ae6['save']();};}function saveUpdates(_0x4407c9,_0x46a2cc){return function(_0x4bcfe1){if(_0x4bcfe1){return _0x4bcfe1['update'](_0x4407c9)[_0x1c77('0x22')](function(_0x2e28dd){return _0x2e28dd;});}return null;};}function removeEntity(_0x37a721,_0x3a70ad){return function(_0x491e9a){if(_0x491e9a){return _0x491e9a[_0x1c77('0x23')]()[_0x1c77('0x22')](function(){_0x37a721['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5286bf,_0x497914){return function(_0x20d21e){if(!_0x20d21e){_0x5286bf[_0x1c77('0x19')](0x194);}return _0x20d21e;};}function handleError(_0x15d62b,_0xe607b6){_0xe607b6=_0xe607b6||0x1f4;return function(_0x1d5b14){logger[_0x1c77('0x24')](_0x1d5b14[_0x1c77('0x25')]);if(_0x1d5b14[_0x1c77('0x26')]){delete _0x1d5b14[_0x1c77('0x26')];}_0x15d62b['status'](_0xe607b6)[_0x1c77('0x27')](_0x1d5b14);};}exports[_0x1c77('0x28')]=function(_0x32ebe8,_0x4db479){var _0x1fad3d={},_0x3c311c={},_0x4194fa={'count':0x0,'rows':[]};var _0x5bd0cb=_[_0x1c77('0x29')](db[_0x1c77('0x2a')][_0x1c77('0x2b')],function(_0x4904c9){return{'name':_0x4904c9[_0x1c77('0x2c')],'type':_0x4904c9[_0x1c77('0x2d')][_0x1c77('0x2e')]};});_0x3c311c[_0x1c77('0x2f')]=_[_0x1c77('0x29')](_0x5bd0cb,_0x1c77('0x26'));_0x3c311c['query']=_[_0x1c77('0x30')](_0x32ebe8[_0x1c77('0x31')]);_0x3c311c[_0x1c77('0x32')]=_[_0x1c77('0x33')](_0x3c311c[_0x1c77('0x2f')],_0x3c311c['query']);_0x1fad3d[_0x1c77('0x34')]=_[_0x1c77('0x33')](_0x3c311c[_0x1c77('0x2f')],qs[_0x1c77('0x35')](_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x35')]));_0x1fad3d[_0x1c77('0x34')]=_0x1fad3d[_0x1c77('0x34')][_0x1c77('0x36')]?_0x1fad3d[_0x1c77('0x34')]:_0x3c311c[_0x1c77('0x2f')];if(!_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x37')]('nolimit')){_0x1fad3d[_0x1c77('0x38')]=qs[_0x1c77('0x38')](_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x38')]);_0x1fad3d[_0x1c77('0x1c')]=qs[_0x1c77('0x1c')](_0x32ebe8['query'][_0x1c77('0x1c')]);}_0x1fad3d[_0x1c77('0x39')]=qs[_0x1c77('0x3a')](_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x3a')]);_0x1fad3d[_0x1c77('0x3b')]=qs[_0x1c77('0x32')](_[_0x1c77('0x3c')](_0x32ebe8[_0x1c77('0x31')],_0x3c311c[_0x1c77('0x32')]),_0x5bd0cb);if(_0x32ebe8[_0x1c77('0x31')][_0x1c77('0x3d')]){_0x1fad3d[_0x1c77('0x3b')]=_[_0x1c77('0x3e')](_0x1fad3d[_0x1c77('0x3b')],{'$or':_[_0x1c77('0x29')](_0x5bd0cb,function(_0x424f3c){if(_0x424f3c[_0x1c77('0x2d')]!=='VIRTUAL'){var _0x1e96f4={};_0x1e96f4[_0x424f3c[_0x1c77('0x26')]]={'$like':'%'+_0x32ebe8[_0x1c77('0x31')]['filter']+'%'};return _0x1e96f4;}})});}_0x1fad3d=_[_0x1c77('0x3e')]({},_0x1fad3d,_0x32ebe8['options']);var _0x328b29={'where':_0x1fad3d['where']};return db[_0x1c77('0x2a')]['count'](_0x328b29)[_0x1c77('0x22')](function(_0x3f43ac){_0x4194fa[_0x1c77('0x1e')]=_0x3f43ac;if(_0x32ebe8[_0x1c77('0x31')]['includeAll']){_0x1fad3d[_0x1c77('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0x1c77('0x40')](_0x1fad3d);})[_0x1c77('0x22')](function(_0x12df90){_0x4194fa[_0x1c77('0x41')]=_0x12df90;return _0x4194fa;})[_0x1c77('0x22')](respondWithFilteredResult(_0x4db479,_0x1fad3d))[_0x1c77('0x42')](handleError(_0x4db479,null));};exports[_0x1c77('0x43')]=function(_0x4ab4ac,_0x3669f4){var _0x32c1f4={'raw':!![],'where':{'id':_0x4ab4ac['params']['id']}},_0x1bf60f={};_0x1bf60f[_0x1c77('0x2f')]=_[_0x1c77('0x30')](db[_0x1c77('0x2a')]['rawAttributes']);_0x1bf60f['query']=_[_0x1c77('0x30')](_0x4ab4ac[_0x1c77('0x31')]);_0x1bf60f[_0x1c77('0x32')]=_[_0x1c77('0x33')](_0x1bf60f[_0x1c77('0x2f')],_0x1bf60f['query']);_0x32c1f4['attributes']=_[_0x1c77('0x33')](_0x1bf60f[_0x1c77('0x2f')],qs[_0x1c77('0x35')](_0x4ab4ac[_0x1c77('0x31')][_0x1c77('0x35')]));_0x32c1f4[_0x1c77('0x34')]=_0x32c1f4[_0x1c77('0x34')][_0x1c77('0x36')]?_0x32c1f4[_0x1c77('0x34')]:_0x1bf60f[_0x1c77('0x2f')];if(_0x4ab4ac[_0x1c77('0x31')]['includeAll']){_0x32c1f4[_0x1c77('0x3f')]=[{'all':!![]}];}_0x32c1f4=_[_0x1c77('0x3e')]({},_0x32c1f4,_0x4ab4ac[_0x1c77('0x44')]);return db[_0x1c77('0x2a')][_0x1c77('0x45')](_0x32c1f4)[_0x1c77('0x22')](handleEntityNotFound(_0x3669f4,null))[_0x1c77('0x22')](respondWithResult(_0x3669f4,null))[_0x1c77('0x42')](handleError(_0x3669f4,null));};exports[_0x1c77('0x46')]=function(_0x2c5981,_0xad81e4){return db['SquareMessage'][_0x1c77('0x46')](_0x2c5981[_0x1c77('0x47')],{})[_0x1c77('0x22')](respondWithResult(_0xad81e4,0xc9))[_0x1c77('0x42')](handleError(_0xad81e4,null));};exports[_0x1c77('0x48')]=function(_0x4a54bd,_0x3f2707){if(_0x4a54bd[_0x1c77('0x47')]['id']){delete _0x4a54bd[_0x1c77('0x47')]['id'];}return db[_0x1c77('0x2a')][_0x1c77('0x45')]({'where':{'id':_0x4a54bd[_0x1c77('0x49')]['id']}})[_0x1c77('0x22')](handleEntityNotFound(_0x3f2707,null))[_0x1c77('0x22')](saveUpdates(_0x4a54bd[_0x1c77('0x47')],null))[_0x1c77('0x22')](respondWithResult(_0x3f2707,null))[_0x1c77('0x42')](handleError(_0x3f2707,null));};exports[_0x1c77('0x23')]=function(_0x4d7c5a,_0x5700e5){return db['SquareMessage'][_0x1c77('0x45')]({'where':{'id':_0x4d7c5a[_0x1c77('0x49')]['id']}})[_0x1c77('0x22')](handleEntityNotFound(_0x5700e5,null))[_0x1c77('0x22')](removeEntity(_0x5700e5,null))[_0x1c77('0x42')](handleError(_0x5700e5,null));};
\ No newline at end of file
+var _0x68b1=['order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','merge','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x11fdf0,_0x13c52f){var _0x1076b4=function(_0x529951){while(--_0x529951){_0x11fdf0['push'](_0x11fdf0['shift']());}};_0x1076b4(++_0x13c52f);}(_0x68b1,0x13a));var _0x168b=function(_0x148dda,_0x9200a1){_0x148dda=_0x148dda-0x0;var _0x4b0bc9=_0x68b1[_0x148dda];return _0x4b0bc9;};'use strict';var emlformat=require(_0x168b('0x0'));var rimraf=require(_0x168b('0x1'));var zipdir=require(_0x168b('0x2'));var jsonpatch=require(_0x168b('0x3'));var rp=require(_0x168b('0x4'));var moment=require(_0x168b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x168b('0x6'));var path=require(_0x168b('0x7'));var sox=require(_0x168b('0x8'));var csv=require(_0x168b('0x9'));var ejs=require(_0x168b('0xa'));var fs=require('fs');var fs_extra=require(_0x168b('0xb'));var _=require('lodash');var squel=require(_0x168b('0xc'));var crypto=require(_0x168b('0xd'));var jsforce=require(_0x168b('0xe'));var deskjs=require(_0x168b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x168b('0x10'));var Redis=require(_0x168b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x168b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x168b('0x13'));var config=require(_0x168b('0x14'));var licenseUtil=require(_0x168b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ec55e,_0x4d63f9){_0x4d63f9=_0x4d63f9||0xcc;return function(_0x1c44f4){if(_0x1c44f4){return _0x5ec55e[_0x168b('0x16')](_0x4d63f9);}return _0x5ec55e[_0x168b('0x17')](_0x4d63f9)[_0x168b('0x18')]();};}function respondWithResult(_0x4f7466,_0x18c31f){_0x18c31f=_0x18c31f||0xc8;return function(_0x8a5d06){if(_0x8a5d06){return _0x4f7466[_0x168b('0x17')](_0x18c31f)['json'](_0x8a5d06);}};}function respondWithFilteredResult(_0x1f7e22,_0x5b5104){return function(_0xed202d){if(_0xed202d){var _0x2705ef=typeof _0x5b5104['offset']===_0x168b('0x19')&&typeof _0x5b5104[_0x168b('0x1a')]===_0x168b('0x19');var _0x14db40=_0xed202d['count'];var _0x320d2e=_0x2705ef?0x0:_0x5b5104[_0x168b('0x1b')];var _0x46cfa5=_0x2705ef?_0xed202d[_0x168b('0x1c')]:_0x5b5104[_0x168b('0x1b')]+_0x5b5104[_0x168b('0x1a')];var _0xef7913;if(_0x46cfa5>=_0x14db40){_0x46cfa5=_0x14db40;_0xef7913=0xc8;}else{_0xef7913=0xce;}_0x1f7e22[_0x168b('0x17')](_0xef7913);return _0x1f7e22[_0x168b('0x1d')](_0x168b('0x1e'),_0x320d2e+'-'+_0x46cfa5+'/'+_0x14db40)[_0x168b('0x1f')](_0xed202d);}return null;};}function patchUpdates(_0x5a5fce){return function(_0x2ded51){try{jsonpatch[_0x168b('0x20')](_0x2ded51,_0x5a5fce,!![]);}catch(_0x56988f){return BPromise[_0x168b('0x21')](_0x56988f);}return _0x2ded51[_0x168b('0x22')]();};}function saveUpdates(_0x1f511b,_0x3d4281){return function(_0x225850){if(_0x225850){return _0x225850[_0x168b('0x23')](_0x1f511b)[_0x168b('0x24')](function(_0x85fc47){return _0x85fc47;});}return null;};}function removeEntity(_0x5e6ec0,_0x3aebd5){return function(_0x19870e){if(_0x19870e){return _0x19870e[_0x168b('0x25')]()['then'](function(){_0x5e6ec0[_0x168b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x570806,_0x16ec6f){return function(_0x28071d){if(!_0x28071d){_0x570806[_0x168b('0x16')](0x194);}return _0x28071d;};}function handleError(_0x14fb89,_0x1c6f52){_0x1c6f52=_0x1c6f52||0x1f4;return function(_0xa3383a){logger[_0x168b('0x26')](_0xa3383a[_0x168b('0x27')]);if(_0xa3383a['name']){delete _0xa3383a[_0x168b('0x28')];}_0x14fb89['status'](_0x1c6f52)['send'](_0xa3383a);};}exports[_0x168b('0x29')]=function(_0x29b97b,_0x5c39ab){var _0x1b8b83={},_0x2fcb16={},_0x51992b={'count':0x0,'rows':[]};var _0x30d2e8=_[_0x168b('0x2a')](db[_0x168b('0x2b')][_0x168b('0x2c')],function(_0x1c5da5){return{'name':_0x1c5da5[_0x168b('0x2d')],'type':_0x1c5da5[_0x168b('0x2e')][_0x168b('0x2f')]};});_0x2fcb16[_0x168b('0x30')]=_[_0x168b('0x2a')](_0x30d2e8,_0x168b('0x28'));_0x2fcb16[_0x168b('0x31')]=_[_0x168b('0x32')](_0x29b97b[_0x168b('0x31')]);_0x2fcb16['filters']=_['intersection'](_0x2fcb16[_0x168b('0x30')],_0x2fcb16['query']);_0x1b8b83['attributes']=_[_0x168b('0x33')](_0x2fcb16[_0x168b('0x30')],qs['fields'](_0x29b97b[_0x168b('0x31')][_0x168b('0x34')]));_0x1b8b83[_0x168b('0x35')]=_0x1b8b83[_0x168b('0x35')]['length']?_0x1b8b83[_0x168b('0x35')]:_0x2fcb16[_0x168b('0x30')];if(!_0x29b97b[_0x168b('0x31')][_0x168b('0x36')](_0x168b('0x37'))){_0x1b8b83[_0x168b('0x1a')]=qs[_0x168b('0x1a')](_0x29b97b[_0x168b('0x31')][_0x168b('0x1a')]);_0x1b8b83['offset']=qs[_0x168b('0x1b')](_0x29b97b['query'][_0x168b('0x1b')]);}_0x1b8b83[_0x168b('0x38')]=qs[_0x168b('0x39')](_0x29b97b[_0x168b('0x31')][_0x168b('0x39')]);_0x1b8b83[_0x168b('0x3a')]=qs[_0x168b('0x3b')](_['pick'](_0x29b97b[_0x168b('0x31')],_0x2fcb16[_0x168b('0x3b')]),_0x30d2e8);if(_0x29b97b['query'][_0x168b('0x3c')]){_0x1b8b83[_0x168b('0x3a')]=_['merge'](_0x1b8b83[_0x168b('0x3a')],{'$or':_[_0x168b('0x2a')](_0x30d2e8,function(_0x4e02ae){if(_0x4e02ae[_0x168b('0x2e')]!==_0x168b('0x3d')){var _0x3ea350={};_0x3ea350[_0x4e02ae[_0x168b('0x28')]]={'$like':'%'+_0x29b97b[_0x168b('0x31')]['filter']+'%'};return _0x3ea350;}})});}_0x1b8b83=_['merge']({},_0x1b8b83,_0x29b97b[_0x168b('0x3e')]);var _0x425d3d={'where':_0x1b8b83[_0x168b('0x3a')]};return db[_0x168b('0x2b')][_0x168b('0x1c')](_0x425d3d)[_0x168b('0x24')](function(_0x357f97){_0x51992b[_0x168b('0x1c')]=_0x357f97;if(_0x29b97b[_0x168b('0x31')][_0x168b('0x3f')]){_0x1b8b83[_0x168b('0x40')]=[{'all':!![]}];}return db['SquareMessage'][_0x168b('0x41')](_0x1b8b83);})['then'](function(_0x1695ea){_0x51992b[_0x168b('0x42')]=_0x1695ea;return _0x51992b;})[_0x168b('0x24')](respondWithFilteredResult(_0x5c39ab,_0x1b8b83))[_0x168b('0x43')](handleError(_0x5c39ab,null));};exports['show']=function(_0x4e1c35,_0x13ac5b){var _0x1ad2da={'raw':!![],'where':{'id':_0x4e1c35['params']['id']}},_0x54b9b6={};_0x54b9b6[_0x168b('0x30')]=_[_0x168b('0x32')](db['SquareMessage'][_0x168b('0x2c')]);_0x54b9b6[_0x168b('0x31')]=_[_0x168b('0x32')](_0x4e1c35[_0x168b('0x31')]);_0x54b9b6['filters']=_['intersection'](_0x54b9b6[_0x168b('0x30')],_0x54b9b6[_0x168b('0x31')]);_0x1ad2da[_0x168b('0x35')]=_[_0x168b('0x33')](_0x54b9b6[_0x168b('0x30')],qs[_0x168b('0x34')](_0x4e1c35[_0x168b('0x31')][_0x168b('0x34')]));_0x1ad2da[_0x168b('0x35')]=_0x1ad2da[_0x168b('0x35')][_0x168b('0x44')]?_0x1ad2da[_0x168b('0x35')]:_0x54b9b6[_0x168b('0x30')];if(_0x4e1c35[_0x168b('0x31')][_0x168b('0x3f')]){_0x1ad2da[_0x168b('0x40')]=[{'all':!![]}];}_0x1ad2da=_[_0x168b('0x45')]({},_0x1ad2da,_0x4e1c35[_0x168b('0x3e')]);return db['SquareMessage'][_0x168b('0x46')](_0x1ad2da)['then'](handleEntityNotFound(_0x13ac5b,null))[_0x168b('0x24')](respondWithResult(_0x13ac5b,null))['catch'](handleError(_0x13ac5b,null));};exports[_0x168b('0x47')]=function(_0x221f45,_0x332f8f){return db[_0x168b('0x2b')]['create'](_0x221f45['body'],{})[_0x168b('0x24')](respondWithResult(_0x332f8f,0xc9))[_0x168b('0x43')](handleError(_0x332f8f,null));};exports[_0x168b('0x23')]=function(_0x32b03a,_0x4c888f){if(_0x32b03a[_0x168b('0x48')]['id']){delete _0x32b03a[_0x168b('0x48')]['id'];}return db[_0x168b('0x2b')][_0x168b('0x46')]({'where':{'id':_0x32b03a['params']['id']}})[_0x168b('0x24')](handleEntityNotFound(_0x4c888f,null))['then'](saveUpdates(_0x32b03a[_0x168b('0x48')],null))[_0x168b('0x24')](respondWithResult(_0x4c888f,null))['catch'](handleError(_0x4c888f,null));};exports[_0x168b('0x25')]=function(_0x4adb03,_0x40c832){return db[_0x168b('0x2b')][_0x168b('0x46')]({'where':{'id':_0x4adb03[_0x168b('0x49')]['id']}})[_0x168b('0x24')](handleEntityNotFound(_0x40c832,null))[_0x168b('0x24')](removeEntity(_0x40c832,null))[_0x168b('0x43')](handleError(_0x40c832,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe6d5=['request-promise','exports','SquareMessage','square_messages','lodash','util','../../config/logger','api'];(function(_0x5cacbe,_0x2f7a79){var _0x30200b=function(_0x55279f){while(--_0x55279f){_0x5cacbe['push'](_0x5cacbe['shift']());}};_0x30200b(++_0x2f7a79);}(_0xe6d5,0x1d4));var _0x5e6d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe6d5[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x5e6d('0x0'));var util=require(_0x5e6d('0x1'));var logger=require(_0x5e6d('0x2'))(_0x5e6d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x5e6d('0x5')]=function(_0x44eb75,_0x3fec74){return _0x44eb75['define'](_0x5e6d('0x6'),attributes,{'tableName':_0x5e6d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb13f=['./squareMessage.attributes','exports','SquareMessage','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb13f,0x122));var _0xfb13=function(_0x587bcf,_0x34b598){_0x587bcf=_0x587bcf-0x0;var _0x30c213=_0xb13f[_0x587bcf];return _0x30c213;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb13('0x0'))('api');var moment=require(_0xfb13('0x1'));var BPromise=require(_0xfb13('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfb13('0x3'));var attributes=require(_0xfb13('0x4'));module[_0xfb13('0x5')]=function(_0x36cb64,_0x252a8a){return _0x36cb64['define'](_0xfb13('0x6'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3503=['debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3503,0x158));var _0x3350=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x3503[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3350('0x0'));var util=require(_0x3350('0x1'));var moment=require(_0x3350('0x2'));var BPromise=require(_0x3350('0x3'));var rs=require(_0x3350('0x4'));var fs=require('fs');var Redis=require(_0x3350('0x5'));var db=require(_0x3350('0x6'))['db'];var utils=require(_0x3350('0x7'));var logger=require(_0x3350('0x8'))('rpc');var config=require(_0x3350('0x9'));var jayson=require(_0x3350('0xa'));var client=jayson['client'][_0x3350('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eb733,_0x2e6dfc,_0x1a0bc2){return new BPromise(function(_0x2b7c24,_0x437de5){return client[_0x3350('0xc')](_0x3eb733,_0x1a0bc2)['then'](function(_0x14272d){logger[_0x3350('0xd')](_0x3350('0xe'),_0x2e6dfc,_0x3350('0xf'));logger[_0x3350('0x10')](_0x3350('0x11'),_0x2e6dfc,_0x3350('0xf'),JSON[_0x3350('0x12')](_0x14272d));if(_0x14272d[_0x3350('0x13')]){if(_0x14272d[_0x3350('0x13')]['code']===0x1f4){logger[_0x3350('0x13')](_0x3350('0xe'),_0x2e6dfc,_0x14272d[_0x3350('0x13')][_0x3350('0x14')]);return _0x437de5(_0x14272d['error'][_0x3350('0x14')]);}logger['error'](_0x3350('0xe'),_0x2e6dfc,_0x14272d[_0x3350('0x13')][_0x3350('0x14')]);return _0x2b7c24(_0x14272d[_0x3350('0x13')][_0x3350('0x14')]);}else{logger[_0x3350('0xd')]('SquareMessage,\x20%s,\x20%s',_0x2e6dfc,_0x3350('0xf'));_0x2b7c24(_0x14272d[_0x3350('0x15')]['message']);}})[_0x3350('0x16')](function(_0x49399e){logger[_0x3350('0x13')](_0x3350('0xe'),_0x2e6dfc,_0x49399e);_0x437de5(_0x49399e);});});}exports[_0x3350('0x17')]=function(_0x5c6909){var _0x320706=this;return new Promise(function(_0x2bdd68,_0x391be9){return db[_0x3350('0x18')][_0x3350('0x19')](_0x5c6909[_0x3350('0x1a')],{'raw':_0x5c6909['options']?_0x5c6909[_0x3350('0x1b')][_0x3350('0x1c')]===undefined?!![]:![]:!![]})[_0x3350('0x1d')](function(_0x5c6506){logger[_0x3350('0xd')]('CreateSquareMessage',_0x5c6909);logger[_0x3350('0x10')](_0x3350('0x17'),_0x5c6909,JSON['stringify'](_0x5c6506));_0x2bdd68(_0x5c6506);})['catch'](function(_0x461b8f){logger[_0x3350('0x13')](_0x3350('0x17'),_0x461b8f[_0x3350('0x14')],_0x5c6909);_0x391be9(_0x320706[_0x3350('0x13')](0x1f4,_0x461b8f[_0x3350('0x14')]));});});};
\ No newline at end of file
+var _0xf516=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','SquareMessage,\x20%s,\x20%s','message','result','create','options','raw','CreateSquareMessage','stringify','catch','lodash','util'];(function(_0x5dff5b,_0x600c5d){var _0x34dd83=function(_0x9830f8){while(--_0x9830f8){_0x5dff5b['push'](_0x5dff5b['shift']());}};_0x34dd83(++_0x600c5d);}(_0xf516,0x1d2));var _0x6f51=function(_0x575fa9,_0x4ac46e){_0x575fa9=_0x575fa9-0x0;var _0x168292=_0xf516[_0x575fa9];return _0x168292;};'use strict';var _=require(_0x6f51('0x0'));var util=require(_0x6f51('0x1'));var moment=require(_0x6f51('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f51('0x3'));var fs=require('fs');var Redis=require(_0x6f51('0x4'));var db=require(_0x6f51('0x5'))['db'];var utils=require(_0x6f51('0x6'));var logger=require(_0x6f51('0x7'))(_0x6f51('0x8'));var config=require(_0x6f51('0x9'));var jayson=require(_0x6f51('0xa'));var client=jayson['client'][_0x6f51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x554ef5,_0x1c46dc,_0x208d71){return new BPromise(function(_0x1d32cd,_0xd53781){return client['request'](_0x554ef5,_0x208d71)[_0x6f51('0xc')](function(_0x15bf5a){logger['info']('SquareMessage,\x20%s,\x20%s',_0x1c46dc,_0x6f51('0xd'));logger[_0x6f51('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x1c46dc,_0x6f51('0xd'),JSON['stringify'](_0x15bf5a));if(_0x15bf5a[_0x6f51('0xf')]){if(_0x15bf5a['error'][_0x6f51('0x10')]===0x1f4){logger[_0x6f51('0xf')](_0x6f51('0x11'),_0x1c46dc,_0x15bf5a[_0x6f51('0xf')]['message']);return _0xd53781(_0x15bf5a['error'][_0x6f51('0x12')]);}logger[_0x6f51('0xf')](_0x6f51('0x11'),_0x1c46dc,_0x15bf5a[_0x6f51('0xf')][_0x6f51('0x12')]);return _0x1d32cd(_0x15bf5a['error'][_0x6f51('0x12')]);}else{logger['info'](_0x6f51('0x11'),_0x1c46dc,_0x6f51('0xd'));_0x1d32cd(_0x15bf5a[_0x6f51('0x13')]['message']);}})['catch'](function(_0x5de49a){logger[_0x6f51('0xf')]('SquareMessage,\x20%s,\x20%s',_0x1c46dc,_0x5de49a);_0xd53781(_0x5de49a);});});}exports['CreateSquareMessage']=function(_0x455cef){var _0x266986=this;return new Promise(function(_0x5b5d8d,_0x18b6d1){return db['SquareMessage'][_0x6f51('0x14')](_0x455cef['body'],{'raw':_0x455cef[_0x6f51('0x15')]?_0x455cef[_0x6f51('0x15')][_0x6f51('0x16')]===undefined?!![]:![]:!![]})[_0x6f51('0xc')](function(_0x2797a7){logger['info'](_0x6f51('0x17'),_0x455cef);logger['debug'](_0x6f51('0x17'),_0x455cef,JSON[_0x6f51('0x18')](_0x2797a7));_0x5b5d8d(_0x2797a7);})[_0x6f51('0x19')](function(_0x39bdb1){logger[_0x6f51('0xf')](_0x6f51('0x17'),_0x39bdb1[_0x6f51('0x12')],_0x455cef);_0x18b6d1(_0x266986[_0x6f51('0xf')](0x1f4,_0x39bdb1[_0x6f51('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd875=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/test','15s','post','create','put','update','delete','/:id','destroy'];(function(_0x4b48af,_0x4ad5b9){var _0x64ac44=function(_0x268837){while(--_0x268837){_0x4b48af['push'](_0x4b48af['shift']());}};_0x64ac44(++_0x4ad5b9);}(_0xd875,0xf2));var _0x5d87=function(_0x54d164,_0x3be5ba){_0x54d164=_0x54d164-0x0;var _0xf58243=_0xd875[_0x54d164];return _0xf58243;};'use strict';var multer=require(_0x5d87('0x0'));var util=require(_0x5d87('0x1'));var path=require('path');var timeout=require(_0x5d87('0x2'));var express=require(_0x5d87('0x3'));var router=express[_0x5d87('0x4')]();var fs_extra=require(_0x5d87('0x5'));var auth=require(_0x5d87('0x6'));var interaction=require(_0x5d87('0x7'));var config=require(_0x5d87('0x8'));var controller=require('./squareOdbc.controller');router[_0x5d87('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d87('0xa')]);router[_0x5d87('0x9')]('/:id',auth[_0x5d87('0xb')](),controller[_0x5d87('0xc')]);router['get'](_0x5d87('0xd'),auth[_0x5d87('0xb')](),timeout(_0x5d87('0xe')),controller['test']);router[_0x5d87('0xf')]('/',auth['isAuthenticated'](),controller[_0x5d87('0x10')]);router[_0x5d87('0x11')]('/:id',auth[_0x5d87('0xb')](),controller[_0x5d87('0x12')]);router[_0x5d87('0x13')](_0x5d87('0x14'),auth[_0x5d87('0xb')](),controller[_0x5d87('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x5a98=['fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','index','/:id','show','/:id/test','isAuthenticated','15s','test','create','put','update','destroy','exports','util','path','express','Router'];(function(_0x4df8c1,_0x49e177){var _0x45e462=function(_0x45c966){while(--_0x45c966){_0x4df8c1['push'](_0x4df8c1['shift']());}};_0x45e462(++_0x49e177);}(_0x5a98,0x1ca));var _0x85a9=function(_0x1c8f03,_0x175b10){_0x1c8f03=_0x1c8f03-0x0;var _0x1432e0=_0x5a98[_0x1c8f03];return _0x1432e0;};'use strict';var multer=require('multer');var util=require(_0x85a9('0x0'));var path=require(_0x85a9('0x1'));var timeout=require('connect-timeout');var express=require(_0x85a9('0x2'));var router=express[_0x85a9('0x3')]();var fs_extra=require(_0x85a9('0x4'));var auth=require(_0x85a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x85a9('0x6'));var controller=require(_0x85a9('0x7'));router[_0x85a9('0x8')]('/',auth['isAuthenticated'](),controller[_0x85a9('0x9')]);router[_0x85a9('0x8')](_0x85a9('0xa'),auth['isAuthenticated'](),controller[_0x85a9('0xb')]);router[_0x85a9('0x8')](_0x85a9('0xc'),auth[_0x85a9('0xd')](),timeout(_0x85a9('0xe')),controller[_0x85a9('0xf')]);router['post']('/',auth[_0x85a9('0xd')](),controller[_0x85a9('0x10')]);router[_0x85a9('0x11')]('/:id',auth[_0x85a9('0xd')](),controller[_0x85a9('0x12')]);router['delete'](_0x85a9('0xa'),auth['isAuthenticated'](),controller[_0x85a9('0x13')]);module[_0x85a9('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x636b=['name','STRING','sequelize','exports'];(function(_0x40b2a1,_0x26b1bb){var _0x534a3e=function(_0x5660c0){while(--_0x5660c0){_0x40b2a1['push'](_0x40b2a1['shift']());}};_0x534a3e(++_0x26b1bb);}(_0x636b,0x146));var _0xb636=function(_0xb36288,_0x102f2e){_0xb36288=_0xb36288-0x0;var _0x28f1b6=_0x636b[_0xb36288];return _0x28f1b6;};'use strict';var Sequelize=require(_0xb636('0x0'));module[_0xb636('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb636('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb636('0x3')]},'description':{'type':Sequelize[_0xb636('0x3')]}};
\ No newline at end of file
+var _0xb3a8=['name','sequelize','STRING'];(function(_0x4257cf,_0x3cd364){var _0x5394a3=function(_0x3ae4da){while(--_0x3ae4da){_0x4257cf['push'](_0x4257cf['shift']());}};_0x5394a3(++_0x3cd364);}(_0xb3a8,0xa0));var _0x8b3a=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xb3a8[_0x251d9c];return _0x16ae64;};'use strict';var Sequelize=require(_0x8b3a('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b3a('0x1')],'unique':_0x8b3a('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8b3a('0x1')]},'description':{'type':Sequelize[_0x8b3a('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb3b=['params','rawAttributes','fields','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','catch'];(function(_0x20aca8,_0x52cc){var _0x4bb2e4=function(_0x5c49fc){while(--_0x5c49fc){_0x20aca8['push'](_0x20aca8['shift']());}};_0x4bb2e4(++_0x52cc);}(_0xdb3b,0xfe));var _0xbdb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdb3b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbdb3('0x0'));var rimraf=require(_0xbdb3('0x1'));var zipdir=require(_0xbdb3('0x2'));var jsonpatch=require(_0xbdb3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbdb3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbdb3('0x5'));var csv=require('to-csv');var ejs=require(_0xbdb3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbdb3('0x7'));var crypto=require(_0xbdb3('0x8'));var jsforce=require(_0xbdb3('0x9'));var deskjs=require(_0xbdb3('0xa'));var toCsv=require(_0xbdb3('0xb'));var querystring=require(_0xbdb3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbdb3('0xd'));var qs=require(_0xbdb3('0xe'));var as=require(_0xbdb3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdb3('0x10'))(_0xbdb3('0x11'));var utils=require(_0xbdb3('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbdb3('0x13'));var db=require(_0xbdb3('0x14'))['db'];function respondWithStatusCode(_0x37d5fa,_0x5938ec){_0x5938ec=_0x5938ec||0xcc;return function(_0x5cd716){if(_0x5cd716){return _0x37d5fa[_0xbdb3('0x15')](_0x5938ec);}return _0x37d5fa[_0xbdb3('0x16')](_0x5938ec)[_0xbdb3('0x17')]();};}function respondWithResult(_0x53912c,_0x2b46ac){_0x2b46ac=_0x2b46ac||0xc8;return function(_0x39bac9){if(_0x39bac9){return _0x53912c['status'](_0x2b46ac)[_0xbdb3('0x18')](_0x39bac9);}};}function respondWithFilteredResult(_0xb39ccb,_0x5b1ec5){return function(_0x5d7b56){if(_0x5d7b56){var _0x49335a=typeof _0x5b1ec5[_0xbdb3('0x19')]==='undefined'&&typeof _0x5b1ec5[_0xbdb3('0x1a')]===_0xbdb3('0x1b');var _0x11061c=_0x5d7b56[_0xbdb3('0x1c')];var _0x5231a7=_0x49335a?0x0:_0x5b1ec5['offset'];var _0x15868a=_0x49335a?_0x5d7b56[_0xbdb3('0x1c')]:_0x5b1ec5[_0xbdb3('0x19')]+_0x5b1ec5[_0xbdb3('0x1a')];var _0xcd7e44;if(_0x15868a>=_0x11061c){_0x15868a=_0x11061c;_0xcd7e44=0xc8;}else{_0xcd7e44=0xce;}_0xb39ccb[_0xbdb3('0x16')](_0xcd7e44);return _0xb39ccb[_0xbdb3('0x1d')](_0xbdb3('0x1e'),_0x5231a7+'-'+_0x15868a+'/'+_0x11061c)[_0xbdb3('0x18')](_0x5d7b56);}return null;};}function patchUpdates(_0x43bf54){return function(_0x329091){try{jsonpatch[_0xbdb3('0x1f')](_0x329091,_0x43bf54,!![]);}catch(_0x203695){return BPromise[_0xbdb3('0x20')](_0x203695);}return _0x329091[_0xbdb3('0x21')]();};}function saveUpdates(_0x3e7cbe,_0x5c4c8e){return function(_0x134d45){if(_0x134d45){return _0x134d45['update'](_0x3e7cbe)[_0xbdb3('0x22')](function(_0x452408){return _0x452408;});}return null;};}function removeEntity(_0x560b1c,_0x13343a){return function(_0x3b64b9){if(_0x3b64b9){return _0x3b64b9[_0xbdb3('0x23')]()[_0xbdb3('0x22')](function(){var _0x154127=_0x3b64b9[_0xbdb3('0x24')]({'plain':!![]});var _0x4aacf5=_0xbdb3('0x25');return db[_0xbdb3('0x26')][_0xbdb3('0x23')]({'where':{'type':_0x4aacf5,'resourceId':_0x154127['id']}})[_0xbdb3('0x22')](function(){return _0x3b64b9;});})['then'](function(){_0x560b1c[_0xbdb3('0x16')](0xcc)[_0xbdb3('0x17')]();});}};}function handleEntityNotFound(_0x2a332b,_0x7300e4){return function(_0x2053b1){if(!_0x2053b1){_0x2a332b['sendStatus'](0x194);}return _0x2053b1;};}function handleError(_0x51d517,_0xf888da){_0xf888da=_0xf888da||0x1f4;return function(_0x1aef81){logger['error'](_0x1aef81[_0xbdb3('0x27')]);if(_0x1aef81[_0xbdb3('0x28')]){delete _0x1aef81[_0xbdb3('0x28')];}_0x51d517['status'](_0xf888da)[_0xbdb3('0x29')](_0x1aef81);};}exports[_0xbdb3('0x2a')]=function(_0x58d481,_0x46f0b4){var _0x13730c={},_0x565838={},_0x2b4722={'count':0x0,'rows':[]};var _0x366e09=_[_0xbdb3('0x2b')](db['SquareOdbc']['rawAttributes'],function(_0x5e173b){return{'name':_0x5e173b[_0xbdb3('0x2c')],'type':_0x5e173b[_0xbdb3('0x2d')]['key']};});_0x565838[_0xbdb3('0x2e')]=_[_0xbdb3('0x2b')](_0x366e09,'name');_0x565838[_0xbdb3('0x2f')]=_[_0xbdb3('0x30')](_0x58d481['query']);_0x565838[_0xbdb3('0x31')]=_['intersection'](_0x565838[_0xbdb3('0x2e')],_0x565838[_0xbdb3('0x2f')]);_0x13730c['attributes']=_[_0xbdb3('0x32')](_0x565838['model'],qs['fields'](_0x58d481[_0xbdb3('0x2f')]['fields']));_0x13730c['attributes']=_0x13730c[_0xbdb3('0x33')]['length']?_0x13730c[_0xbdb3('0x33')]:_0x565838[_0xbdb3('0x2e')];if(!_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x34')](_0xbdb3('0x35'))){_0x13730c[_0xbdb3('0x1a')]=qs['limit'](_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x1a')]);_0x13730c[_0xbdb3('0x19')]=qs[_0xbdb3('0x19')](_0x58d481['query']['offset']);}_0x13730c['order']=qs[_0xbdb3('0x36')](_0x58d481['query'][_0xbdb3('0x36')]);_0x13730c[_0xbdb3('0x37')]=qs[_0xbdb3('0x31')](_[_0xbdb3('0x38')](_0x58d481[_0xbdb3('0x2f')],_0x565838['filters']),_0x366e09);if(_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x39')]){_0x13730c[_0xbdb3('0x37')]=_[_0xbdb3('0x3a')](_0x13730c[_0xbdb3('0x37')],{'$or':_[_0xbdb3('0x2b')](_0x366e09,function(_0x437e16){if(_0x437e16[_0xbdb3('0x2d')]!==_0xbdb3('0x3b')){var _0x5c5b15={};_0x5c5b15[_0x437e16[_0xbdb3('0x28')]]={'$like':'%'+_0x58d481[_0xbdb3('0x2f')][_0xbdb3('0x39')]+'%'};return _0x5c5b15;}})});}_0x13730c=_[_0xbdb3('0x3a')]({},_0x13730c,_0x58d481[_0xbdb3('0x3c')]);var _0x3ac7f2={'where':_0x13730c[_0xbdb3('0x37')]};return db[_0xbdb3('0x3d')][_0xbdb3('0x1c')](_0x3ac7f2)[_0xbdb3('0x22')](function(_0x2c8e89){_0x2b4722['count']=_0x2c8e89;if(_0x58d481['query'][_0xbdb3('0x3e')]){_0x13730c[_0xbdb3('0x3f')]=[{'all':!![]}];}return db[_0xbdb3('0x3d')][_0xbdb3('0x40')](_0x13730c);})[_0xbdb3('0x22')](function(_0x456fd2){_0x2b4722['rows']=_0x456fd2;return _0x2b4722;})[_0xbdb3('0x22')](respondWithFilteredResult(_0x46f0b4,_0x13730c))[_0xbdb3('0x41')](handleError(_0x46f0b4,null));};exports['show']=function(_0x1e32f3,_0x3eef92){var _0x231b33={'raw':!![],'where':{'id':_0x1e32f3[_0xbdb3('0x42')]['id']}},_0x2dc74={};_0x2dc74[_0xbdb3('0x2e')]=_['keys'](db[_0xbdb3('0x3d')][_0xbdb3('0x43')]);_0x2dc74['query']=_[_0xbdb3('0x30')](_0x1e32f3[_0xbdb3('0x2f')]);_0x2dc74['filters']=_[_0xbdb3('0x32')](_0x2dc74['model'],_0x2dc74['query']);_0x231b33[_0xbdb3('0x33')]=_['intersection'](_0x2dc74[_0xbdb3('0x2e')],qs[_0xbdb3('0x44')](_0x1e32f3['query'][_0xbdb3('0x44')]));_0x231b33[_0xbdb3('0x33')]=_0x231b33[_0xbdb3('0x33')][_0xbdb3('0x45')]?_0x231b33[_0xbdb3('0x33')]:_0x2dc74[_0xbdb3('0x2e')];if(_0x1e32f3[_0xbdb3('0x2f')][_0xbdb3('0x3e')]){_0x231b33['include']=[{'all':!![]}];}_0x231b33=_[_0xbdb3('0x3a')]({},_0x231b33,_0x1e32f3['options']);return db[_0xbdb3('0x3d')][_0xbdb3('0x46')](_0x231b33)[_0xbdb3('0x22')](handleEntityNotFound(_0x3eef92,null))['then'](respondWithResult(_0x3eef92,null))[_0xbdb3('0x41')](handleError(_0x3eef92,null));};exports[_0xbdb3('0x47')]=function(_0x34361f,_0x5b4318){return db[_0xbdb3('0x3d')][_0xbdb3('0x47')](_0x34361f['body'],{})[_0xbdb3('0x22')](function(_0x533512){var _0xef2c33=_0x34361f[_0xbdb3('0x48')]['get']({'plain':!![]});if(!_0xef2c33)throw new Error(_0xbdb3('0x49'));if(_0xef2c33[_0xbdb3('0x4a')]==='user'){var _0x51b0f8=_0x533512[_0xbdb3('0x24')]({'plain':!![]});var _0x5dc5be=_0xbdb3('0x25');return db['UserProfileSection'][_0xbdb3('0x46')]({'where':{'name':_0x5dc5be,'userProfileId':_0xef2c33[_0xbdb3('0x4b')]},'raw':!![]})[_0xbdb3('0x22')](function(_0xe08670){if(_0xe08670&&_0xe08670['autoAssociation']===0x0){return db[_0xbdb3('0x26')]['create']({'name':_0x51b0f8[_0xbdb3('0x28')],'resourceId':_0x51b0f8['id'],'type':_0xe08670[_0xbdb3('0x28')],'sectionId':_0xe08670['id']},{})['then'](function(){return _0x533512;});}else{return _0x533512;}})['catch'](function(_0x261bc9){logger['error'](_0xbdb3('0x4c'),_0x261bc9);throw _0x261bc9;});}return _0x533512;})[_0xbdb3('0x22')](respondWithResult(_0x5b4318,0xc9))['catch'](handleError(_0x5b4318,null));};exports[_0xbdb3('0x4d')]=function(_0x18da28,_0xbcf80){if(_0x18da28['body']['id']){delete _0x18da28[_0xbdb3('0x4e')]['id'];}return db[_0xbdb3('0x3d')][_0xbdb3('0x46')]({'where':{'id':_0x18da28['params']['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0xbcf80,null))[_0xbdb3('0x22')](saveUpdates(_0x18da28['body'],null))[_0xbdb3('0x22')](respondWithResult(_0xbcf80,null))[_0xbdb3('0x41')](handleError(_0xbcf80,null));};exports[_0xbdb3('0x23')]=function(_0x3f1482,_0x4391fd){return db[_0xbdb3('0x3d')]['find']({'where':{'id':_0x3f1482[_0xbdb3('0x42')]['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0x4391fd,null))[_0xbdb3('0x22')](removeEntity(_0x4391fd,null))['catch'](handleError(_0x4391fd,null));};exports[_0xbdb3('0x4f')]=function(_0x1b4f81,_0x1dc784,_0x44fe93){var _0x17d8a8;return db[_0xbdb3('0x3d')][_0xbdb3('0x46')]({'where':{'id':_0x1b4f81[_0xbdb3('0x42')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x1dc784,null))[_0xbdb3('0x22')](function(_0x2cba80){if(_0x2cba80){var _0x5bdd48=require('odbc')();_0x5bdd48['openSync'](_0x2cba80['dsn']);_0x5bdd48['closeSync']();return _0x2cba80;}})[_0xbdb3('0x22')](respondWithResult(_0x1dc784,null))[_0xbdb3('0x41')](handleError(_0x1dc784,null));};
\ No newline at end of file
+var _0xae03=['UserProfileResource','error','stack','name','send','map','SquareOdbc','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','ODBC'];(function(_0x462fcc,_0x3f52c7){var _0x285880=function(_0x4fb171){while(--_0x4fb171){_0x462fcc['push'](_0x462fcc['shift']());}};_0x285880(++_0x3f52c7);}(_0xae03,0x8e));var _0x3ae0=function(_0x1a14a3,_0x3ad444){_0x1a14a3=_0x1a14a3-0x0;var _0x12ce77=_0xae03[_0x1a14a3];return _0x12ce77;};'use strict';var emlformat=require(_0x3ae0('0x0'));var rimraf=require(_0x3ae0('0x1'));var zipdir=require(_0x3ae0('0x2'));var jsonpatch=require(_0x3ae0('0x3'));var rp=require('request-promise');var moment=require(_0x3ae0('0x4'));var BPromise=require(_0x3ae0('0x5'));var Mustache=require(_0x3ae0('0x6'));var util=require('util');var path=require(_0x3ae0('0x7'));var sox=require(_0x3ae0('0x8'));var csv=require(_0x3ae0('0x9'));var ejs=require(_0x3ae0('0xa'));var fs=require('fs');var fs_extra=require(_0x3ae0('0xb'));var _=require('lodash');var squel=require(_0x3ae0('0xc'));var crypto=require(_0x3ae0('0xd'));var jsforce=require(_0x3ae0('0xe'));var deskjs=require(_0x3ae0('0xf'));var toCsv=require(_0x3ae0('0x9'));var querystring=require(_0x3ae0('0x10'));var Papa=require(_0x3ae0('0x11'));var Redis=require(_0x3ae0('0x12'));var authService=require(_0x3ae0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3ae0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ae0('0x15'))('api');var utils=require(_0x3ae0('0x16'));var config=require(_0x3ae0('0x17'));var licenseUtil=require(_0x3ae0('0x18'));var db=require(_0x3ae0('0x19'))['db'];function respondWithStatusCode(_0x3834be,_0x413fc5){_0x413fc5=_0x413fc5||0xcc;return function(_0x41dd02){if(_0x41dd02){return _0x3834be[_0x3ae0('0x1a')](_0x413fc5);}return _0x3834be[_0x3ae0('0x1b')](_0x413fc5)[_0x3ae0('0x1c')]();};}function respondWithResult(_0x5da670,_0x43ec63){_0x43ec63=_0x43ec63||0xc8;return function(_0x1c1910){if(_0x1c1910){return _0x5da670[_0x3ae0('0x1b')](_0x43ec63)[_0x3ae0('0x1d')](_0x1c1910);}};}function respondWithFilteredResult(_0x4f1fcb,_0x21fdc5){return function(_0x2d031a){if(_0x2d031a){var _0x685877=typeof _0x21fdc5[_0x3ae0('0x1e')]===_0x3ae0('0x1f')&&typeof _0x21fdc5[_0x3ae0('0x20')]==='undefined';var _0x4094fa=_0x2d031a['count'];var _0x28104b=_0x685877?0x0:_0x21fdc5[_0x3ae0('0x1e')];var _0xb7efba=_0x685877?_0x2d031a[_0x3ae0('0x21')]:_0x21fdc5[_0x3ae0('0x1e')]+_0x21fdc5['limit'];var _0x4fdb89;if(_0xb7efba>=_0x4094fa){_0xb7efba=_0x4094fa;_0x4fdb89=0xc8;}else{_0x4fdb89=0xce;}_0x4f1fcb[_0x3ae0('0x1b')](_0x4fdb89);return _0x4f1fcb[_0x3ae0('0x22')](_0x3ae0('0x23'),_0x28104b+'-'+_0xb7efba+'/'+_0x4094fa)[_0x3ae0('0x1d')](_0x2d031a);}return null;};}function patchUpdates(_0x491626){return function(_0x53edf9){try{jsonpatch[_0x3ae0('0x24')](_0x53edf9,_0x491626,!![]);}catch(_0x2a9850){return BPromise['reject'](_0x2a9850);}return _0x53edf9[_0x3ae0('0x25')]();};}function saveUpdates(_0xa18afb,_0x35ae12){return function(_0x15d894){if(_0x15d894){return _0x15d894[_0x3ae0('0x26')](_0xa18afb)[_0x3ae0('0x27')](function(_0x4162b4){return _0x4162b4;});}return null;};}function removeEntity(_0x51aa6a,_0x59ef33){return function(_0x74047c){if(_0x74047c){return _0x74047c[_0x3ae0('0x28')]()['then'](function(){var _0x12f9b1=_0x74047c['get']({'plain':!![]});var _0x476b97=_0x3ae0('0x29');return db[_0x3ae0('0x2a')][_0x3ae0('0x28')]({'where':{'type':_0x476b97,'resourceId':_0x12f9b1['id']}})[_0x3ae0('0x27')](function(){return _0x74047c;});})[_0x3ae0('0x27')](function(){_0x51aa6a['status'](0xcc)[_0x3ae0('0x1c')]();});}};}function handleEntityNotFound(_0x153efe,_0x1ea706){return function(_0x45c3c4){if(!_0x45c3c4){_0x153efe[_0x3ae0('0x1a')](0x194);}return _0x45c3c4;};}function handleError(_0x2c0e91,_0x20871e){_0x20871e=_0x20871e||0x1f4;return function(_0x318266){logger[_0x3ae0('0x2b')](_0x318266[_0x3ae0('0x2c')]);if(_0x318266[_0x3ae0('0x2d')]){delete _0x318266[_0x3ae0('0x2d')];}_0x2c0e91[_0x3ae0('0x1b')](_0x20871e)[_0x3ae0('0x2e')](_0x318266);};}exports['index']=function(_0x291ab9,_0x1945ff){var _0x57d039={},_0x16a557={},_0x73e796={'count':0x0,'rows':[]};var _0x93cb40=_[_0x3ae0('0x2f')](db[_0x3ae0('0x30')]['rawAttributes'],function(_0x5312dd){return{'name':_0x5312dd[_0x3ae0('0x31')],'type':_0x5312dd[_0x3ae0('0x32')][_0x3ae0('0x33')]};});_0x16a557['model']=_[_0x3ae0('0x2f')](_0x93cb40,_0x3ae0('0x2d'));_0x16a557[_0x3ae0('0x34')]=_[_0x3ae0('0x35')](_0x291ab9[_0x3ae0('0x34')]);_0x16a557['filters']=_['intersection'](_0x16a557[_0x3ae0('0x36')],_0x16a557[_0x3ae0('0x34')]);_0x57d039[_0x3ae0('0x37')]=_[_0x3ae0('0x38')](_0x16a557[_0x3ae0('0x36')],qs['fields'](_0x291ab9['query'][_0x3ae0('0x39')]));_0x57d039[_0x3ae0('0x37')]=_0x57d039[_0x3ae0('0x37')]['length']?_0x57d039[_0x3ae0('0x37')]:_0x16a557[_0x3ae0('0x36')];if(!_0x291ab9[_0x3ae0('0x34')][_0x3ae0('0x3a')](_0x3ae0('0x3b'))){_0x57d039[_0x3ae0('0x20')]=qs['limit'](_0x291ab9[_0x3ae0('0x34')][_0x3ae0('0x20')]);_0x57d039[_0x3ae0('0x1e')]=qs[_0x3ae0('0x1e')](_0x291ab9[_0x3ae0('0x34')][_0x3ae0('0x1e')]);}_0x57d039[_0x3ae0('0x3c')]=qs[_0x3ae0('0x3d')](_0x291ab9[_0x3ae0('0x34')]['sort']);_0x57d039[_0x3ae0('0x3e')]=qs[_0x3ae0('0x3f')](_[_0x3ae0('0x40')](_0x291ab9[_0x3ae0('0x34')],_0x16a557[_0x3ae0('0x3f')]),_0x93cb40);if(_0x291ab9['query'][_0x3ae0('0x41')]){_0x57d039[_0x3ae0('0x3e')]=_[_0x3ae0('0x42')](_0x57d039[_0x3ae0('0x3e')],{'$or':_['map'](_0x93cb40,function(_0x5b0360){if(_0x5b0360[_0x3ae0('0x32')]!==_0x3ae0('0x43')){var _0x3bc8c4={};_0x3bc8c4[_0x5b0360[_0x3ae0('0x2d')]]={'$like':'%'+_0x291ab9[_0x3ae0('0x34')][_0x3ae0('0x41')]+'%'};return _0x3bc8c4;}})});}_0x57d039=_['merge']({},_0x57d039,_0x291ab9[_0x3ae0('0x44')]);var _0x501f81={'where':_0x57d039[_0x3ae0('0x3e')]};return db[_0x3ae0('0x30')]['count'](_0x501f81)[_0x3ae0('0x27')](function(_0x4167d8){_0x73e796[_0x3ae0('0x21')]=_0x4167d8;if(_0x291ab9[_0x3ae0('0x34')][_0x3ae0('0x45')]){_0x57d039['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x3ae0('0x46')](_0x57d039);})['then'](function(_0x2f108e){_0x73e796[_0x3ae0('0x47')]=_0x2f108e;return _0x73e796;})['then'](respondWithFilteredResult(_0x1945ff,_0x57d039))[_0x3ae0('0x48')](handleError(_0x1945ff,null));};exports[_0x3ae0('0x49')]=function(_0x1cb33f,_0x235599){var _0x177ad4={'raw':!![],'where':{'id':_0x1cb33f[_0x3ae0('0x4a')]['id']}},_0xe5e79={};_0xe5e79['model']=_[_0x3ae0('0x35')](db[_0x3ae0('0x30')][_0x3ae0('0x4b')]);_0xe5e79[_0x3ae0('0x34')]=_[_0x3ae0('0x35')](_0x1cb33f[_0x3ae0('0x34')]);_0xe5e79[_0x3ae0('0x3f')]=_[_0x3ae0('0x38')](_0xe5e79[_0x3ae0('0x36')],_0xe5e79[_0x3ae0('0x34')]);_0x177ad4[_0x3ae0('0x37')]=_['intersection'](_0xe5e79['model'],qs[_0x3ae0('0x39')](_0x1cb33f['query'][_0x3ae0('0x39')]));_0x177ad4[_0x3ae0('0x37')]=_0x177ad4[_0x3ae0('0x37')][_0x3ae0('0x4c')]?_0x177ad4[_0x3ae0('0x37')]:_0xe5e79[_0x3ae0('0x36')];if(_0x1cb33f['query'][_0x3ae0('0x45')]){_0x177ad4[_0x3ae0('0x4d')]=[{'all':!![]}];}_0x177ad4=_[_0x3ae0('0x42')]({},_0x177ad4,_0x1cb33f[_0x3ae0('0x44')]);return db[_0x3ae0('0x30')][_0x3ae0('0x4e')](_0x177ad4)['then'](handleEntityNotFound(_0x235599,null))['then'](respondWithResult(_0x235599,null))[_0x3ae0('0x48')](handleError(_0x235599,null));};exports[_0x3ae0('0x4f')]=function(_0x144d07,_0x482f44){return db[_0x3ae0('0x30')][_0x3ae0('0x4f')](_0x144d07[_0x3ae0('0x50')],{})[_0x3ae0('0x27')](function(_0x104908){var _0x5bde48=_0x144d07[_0x3ae0('0x51')][_0x3ae0('0x52')]({'plain':!![]});if(!_0x5bde48)throw new Error(_0x3ae0('0x53'));if(_0x5bde48[_0x3ae0('0x54')]===_0x3ae0('0x51')){var _0x14c6ca=_0x104908[_0x3ae0('0x52')]({'plain':!![]});var _0xbe5b1c=_0x3ae0('0x29');return db[_0x3ae0('0x55')]['find']({'where':{'name':_0xbe5b1c,'userProfileId':_0x5bde48[_0x3ae0('0x56')]},'raw':!![]})['then'](function(_0x3688c7){if(_0x3688c7&&_0x3688c7[_0x3ae0('0x57')]===0x0){return db[_0x3ae0('0x2a')][_0x3ae0('0x4f')]({'name':_0x14c6ca[_0x3ae0('0x2d')],'resourceId':_0x14c6ca['id'],'type':_0x3688c7[_0x3ae0('0x2d')],'sectionId':_0x3688c7['id']},{})[_0x3ae0('0x27')](function(){return _0x104908;});}else{return _0x104908;}})[_0x3ae0('0x48')](function(_0x15161e){logger['error'](_0x3ae0('0x58'),_0x15161e);throw _0x15161e;});}return _0x104908;})['then'](respondWithResult(_0x482f44,0xc9))[_0x3ae0('0x48')](handleError(_0x482f44,null));};exports[_0x3ae0('0x26')]=function(_0x34096f,_0x6a3771){if(_0x34096f[_0x3ae0('0x50')]['id']){delete _0x34096f[_0x3ae0('0x50')]['id'];}return db[_0x3ae0('0x30')][_0x3ae0('0x4e')]({'where':{'id':_0x34096f[_0x3ae0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6a3771,null))[_0x3ae0('0x27')](saveUpdates(_0x34096f[_0x3ae0('0x50')],null))[_0x3ae0('0x27')](respondWithResult(_0x6a3771,null))[_0x3ae0('0x48')](handleError(_0x6a3771,null));};exports[_0x3ae0('0x28')]=function(_0x5e474d,_0x4f2e99){return db['SquareOdbc'][_0x3ae0('0x4e')]({'where':{'id':_0x5e474d['params']['id']}})[_0x3ae0('0x27')](handleEntityNotFound(_0x4f2e99,null))['then'](removeEntity(_0x4f2e99,null))[_0x3ae0('0x48')](handleError(_0x4f2e99,null));};exports['test']=function(_0x4eec4a,_0xc23fbf,_0x490488){var _0x459897;return db[_0x3ae0('0x30')][_0x3ae0('0x4e')]({'where':{'id':_0x4eec4a[_0x3ae0('0x4a')]['id']},'attributes':['id','dsn']})[_0x3ae0('0x27')](handleEntityNotFound(_0xc23fbf,null))['then'](function(_0x2c97bc){if(_0x2c97bc){var _0x328075=require('odbc')();_0x328075[_0x3ae0('0x59')](_0x2c97bc[_0x3ae0('0x5a')]);_0x328075[_0x3ae0('0x5b')]();return _0x2c97bc;}})[_0x3ae0('0x27')](respondWithResult(_0xc23fbf,null))['catch'](handleError(_0xc23fbf,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x10d79b,_0x40e651){var _0x348f39=function(_0x45b959){while(--_0x45b959){_0x10d79b['push'](_0x10d79b['shift']());}};_0x348f39(++_0x40e651);}(_0xfcf0,0x138));var _0x0fcf=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xfcf0[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec70=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','util','api','moment','request-promise','rimraf'];(function(_0x26973e,_0x4d1d08){var _0x26893c=function(_0x55b60d){while(--_0x55b60d){_0x26973e['push'](_0x26973e['shift']());}};_0x26893c(++_0x4d1d08);}(_0xec70,0x17c));var _0x0ec7=function(_0x16d8db,_0x6a1999){_0x16d8db=_0x16d8db-0x0;var _0x51ca48=_0xec70[_0x16d8db];return _0x51ca48;};'use strict';var _=require('lodash');var util=require(_0x0ec7('0x0'));var logger=require('../../config/logger')(_0x0ec7('0x1'));var moment=require(_0x0ec7('0x2'));var BPromise=require('bluebird');var rp=require(_0x0ec7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ec7('0x4'));var config=require(_0x0ec7('0x5'));var attributes=require(_0x0ec7('0x6'));module[_0x0ec7('0x7')]=function(_0x5ebb5e,_0x48010c){return _0x5ebb5e[_0x0ec7('0x8')](_0x0ec7('0x9'),attributes,{'tableName':_0x0ec7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x067c=['error','code','message','SquareOdbc,\x20%s,\x20%s','catch','ShowSquareOdbc','options','where','attributes','map','include','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5f2dea,_0x3775e0){var _0x5cb3db=function(_0x335be4){while(--_0x335be4){_0x5f2dea['push'](_0x5f2dea['shift']());}};_0x5cb3db(++_0x3775e0);}(_0x067c,0xa7));var _0xc067=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0x067c[_0x3dee92];return _0x44d36e;};'use strict';var _=require('lodash');var util=require(_0xc067('0x0'));var moment=require(_0xc067('0x1'));var BPromise=require(_0xc067('0x2'));var rs=require(_0xc067('0x3'));var fs=require('fs');var Redis=require(_0xc067('0x4'));var db=require(_0xc067('0x5'))['db'];var utils=require(_0xc067('0x6'));var logger=require('../../config/logger')(_0xc067('0x7'));var config=require(_0xc067('0x8'));var jayson=require(_0xc067('0x9'));var client=jayson[_0xc067('0xa')][_0xc067('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48a856,_0xb7865c,_0x307903){return new BPromise(function(_0x25f636,_0x29e299){return client[_0xc067('0xc')](_0x48a856,_0x307903)[_0xc067('0xd')](function(_0x29f3d6){logger[_0xc067('0xe')]('SquareOdbc,\x20%s,\x20%s',_0xb7865c,'request\x20sent');logger[_0xc067('0xf')](_0xc067('0x10'),_0xb7865c,_0xc067('0x11'),JSON[_0xc067('0x12')](_0x29f3d6));if(_0x29f3d6[_0xc067('0x13')]){if(_0x29f3d6[_0xc067('0x13')][_0xc067('0x14')]===0x1f4){logger[_0xc067('0x13')]('SquareOdbc,\x20%s,\x20%s',_0xb7865c,_0x29f3d6[_0xc067('0x13')][_0xc067('0x15')]);return _0x29e299(_0x29f3d6[_0xc067('0x13')][_0xc067('0x15')]);}logger[_0xc067('0x13')](_0xc067('0x16'),_0xb7865c,_0x29f3d6['error'][_0xc067('0x15')]);return _0x25f636(_0x29f3d6[_0xc067('0x13')][_0xc067('0x15')]);}else{logger[_0xc067('0xe')]('SquareOdbc,\x20%s,\x20%s',_0xb7865c,_0xc067('0x11'));_0x25f636(_0x29f3d6['result'][_0xc067('0x15')]);}})[_0xc067('0x17')](function(_0x54aa96){logger[_0xc067('0x13')](_0xc067('0x16'),_0xb7865c,_0x54aa96);_0x29e299(_0x54aa96);});});}exports[_0xc067('0x18')]=function(_0x13d46d){var _0x2285fa=this;return new Promise(function(_0x25c7c3,_0x5edf9f){return db['SquareOdbc']['find']({'raw':_0x13d46d['options']?_0x13d46d['options']['raw']===undefined?!![]:![]:!![],'where':_0x13d46d[_0xc067('0x19')]?_0x13d46d[_0xc067('0x19')][_0xc067('0x1a')]||null:null,'attributes':_0x13d46d['options']?_0x13d46d['options'][_0xc067('0x1b')]||null:null,'include':_0x13d46d['options']?_0x13d46d[_0xc067('0x19')]['include']?_[_0xc067('0x1c')](_0x13d46d['options'][_0xc067('0x1d')],function(_0x5964bb){return{'model':db[_0x5964bb[_0xc067('0x1e')]],'as':_0x5964bb['as'],'attributes':_0x5964bb[_0xc067('0x1b')],'include':_0x5964bb['include']?_[_0xc067('0x1c')](_0x5964bb['include'],function(_0x194d75){return{'model':db[_0x194d75['model']],'as':_0x194d75['as'],'attributes':_0x194d75[_0xc067('0x1b')],'include':_0x194d75['include']?_[_0xc067('0x1c')](_0x194d75[_0xc067('0x1d')],function(_0x55876f){return{'model':db[_0x55876f['model']],'as':_0x55876f['as'],'attributes':_0x55876f[_0xc067('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc067('0xd')](function(_0x116885){logger[_0xc067('0xe')](_0xc067('0x18'),_0x13d46d);logger[_0xc067('0xf')](_0xc067('0x18'),_0x13d46d,JSON[_0xc067('0x12')](_0x116885));_0x25c7c3(_0x116885);})['catch'](function(_0xb18e12){logger[_0xc067('0x13')]('ShowSquareOdbc',_0xb18e12[_0xc067('0x15')],_0x13d46d);_0x5edf9f(_0x2285fa[_0xc067('0x13')](0x1f4,_0xb18e12[_0xc067('0x15')]));});});};
\ No newline at end of file
+var _0xa5c5=['include','model','map','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes'];(function(_0x425eba,_0x30c56f){var _0x5a8ad=function(_0x5e5b0b){while(--_0x5e5b0b){_0x425eba['push'](_0x425eba['shift']());}};_0x5a8ad(++_0x30c56f);}(_0xa5c5,0xd0));var _0x5a5c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa5c5[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5a5c('0x0'));var util=require(_0x5a5c('0x1'));var moment=require(_0x5a5c('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a5c('0x3'));var fs=require('fs');var Redis=require(_0x5a5c('0x4'));var db=require(_0x5a5c('0x5'))['db'];var utils=require(_0x5a5c('0x6'));var logger=require(_0x5a5c('0x7'))(_0x5a5c('0x8'));var config=require(_0x5a5c('0x9'));var jayson=require(_0x5a5c('0xa'));var client=jayson[_0x5a5c('0xb')][_0x5a5c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f4d78,_0x550427,_0x47d87c){return new BPromise(function(_0x1540ad,_0x28f31c){return client[_0x5a5c('0xd')](_0x3f4d78,_0x47d87c)['then'](function(_0xb87b59){logger[_0x5a5c('0xe')](_0x5a5c('0xf'),_0x550427,_0x5a5c('0x10'));logger['debug'](_0x5a5c('0x11'),_0x550427,_0x5a5c('0x10'),JSON[_0x5a5c('0x12')](_0xb87b59));if(_0xb87b59['error']){if(_0xb87b59[_0x5a5c('0x13')][_0x5a5c('0x14')]===0x1f4){logger[_0x5a5c('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x550427,_0xb87b59[_0x5a5c('0x13')][_0x5a5c('0x15')]);return _0x28f31c(_0xb87b59[_0x5a5c('0x13')][_0x5a5c('0x15')]);}logger['error'](_0x5a5c('0xf'),_0x550427,_0xb87b59[_0x5a5c('0x13')][_0x5a5c('0x15')]);return _0x1540ad(_0xb87b59['error']['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x550427,_0x5a5c('0x10'));_0x1540ad(_0xb87b59[_0x5a5c('0x16')][_0x5a5c('0x15')]);}})[_0x5a5c('0x17')](function(_0x97e862){logger[_0x5a5c('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x550427,_0x97e862);_0x28f31c(_0x97e862);});});}exports[_0x5a5c('0x18')]=function(_0xf17680){var _0x6c2c1c=this;return new Promise(function(_0x3a2963,_0x3ef51f){return db['SquareOdbc'][_0x5a5c('0x19')]({'raw':_0xf17680['options']?_0xf17680[_0x5a5c('0x1a')][_0x5a5c('0x1b')]===undefined?!![]:![]:!![],'where':_0xf17680['options']?_0xf17680[_0x5a5c('0x1a')][_0x5a5c('0x1c')]||null:null,'attributes':_0xf17680[_0x5a5c('0x1a')]?_0xf17680[_0x5a5c('0x1a')][_0x5a5c('0x1d')]||null:null,'include':_0xf17680[_0x5a5c('0x1a')]?_0xf17680[_0x5a5c('0x1a')]['include']?_['map'](_0xf17680[_0x5a5c('0x1a')][_0x5a5c('0x1e')],function(_0x27dacd){return{'model':db[_0x27dacd[_0x5a5c('0x1f')]],'as':_0x27dacd['as'],'attributes':_0x27dacd[_0x5a5c('0x1d')],'include':_0x27dacd['include']?_[_0x5a5c('0x20')](_0x27dacd[_0x5a5c('0x1e')],function(_0x2e9a29){return{'model':db[_0x2e9a29[_0x5a5c('0x1f')]],'as':_0x2e9a29['as'],'attributes':_0x2e9a29[_0x5a5c('0x1d')],'include':_0x2e9a29[_0x5a5c('0x1e')]?_[_0x5a5c('0x20')](_0x2e9a29[_0x5a5c('0x1e')],function(_0x119251){return{'model':db[_0x119251['model']],'as':_0x119251['as'],'attributes':_0x119251[_0x5a5c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5a5c('0x21')](function(_0x3d259e){logger['info'](_0x5a5c('0x18'),_0xf17680);logger['debug'](_0x5a5c('0x18'),_0xf17680,JSON[_0x5a5c('0x12')](_0x3d259e));_0x3a2963(_0x3d259e);})['catch'](function(_0x55b30e){logger[_0x5a5c('0x13')](_0x5a5c('0x18'),_0x55b30e[_0x5a5c('0x15')],_0xf17680);_0x3ef51f(_0x6c2c1c[_0x5a5c('0x13')](0x1f4,_0x55b30e[_0x5a5c('0x15')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0da2=['Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x30c60a,_0x3b4bf0){var _0x5a90d2=function(_0x4ed353){while(--_0x4ed353){_0x30c60a['push'](_0x30c60a['shift']());}};_0x5a90d2(++_0x3b4bf0);}(_0x0da2,0x1cf));var _0x20da=function(_0x43f283,_0x5a69d2){_0x43f283=_0x43f283-0x0;var _0x20fd0b=_0x0da2[_0x43f283];return _0x20fd0b;};'use strict';var multer=require(_0x20da('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20da('0x1')]();var fs_extra=require(_0x20da('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x20da('0x3'));var config=require(_0x20da('0x4'));var controller=require(_0x20da('0x5'));router['get']('/',auth[_0x20da('0x6')](),controller[_0x20da('0x7')]);router['get'](_0x20da('0x8'),auth['isAuthenticated'](),controller[_0x20da('0x9')]);router['post']('/',auth[_0x20da('0x6')](),controller[_0x20da('0xa')]);router[_0x20da('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x20da('0xc')]);router[_0x20da('0xd')](_0x20da('0x8'),auth[_0x20da('0x6')](),controller[_0x20da('0xe')]);module[_0x20da('0xf')]=router;
\ No newline at end of file
+var _0x4f0b=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2239ba,_0xa323f1){var _0x36673e=function(_0x34d6da){while(--_0x34d6da){_0x2239ba['push'](_0x2239ba['shift']());}};_0x36673e(++_0xa323f1);}(_0x4f0b,0x13d));var _0xb4f0=function(_0x5b891f,_0x2c83c8){_0x5b891f=_0x5b891f-0x0;var _0x3f7553=_0x4f0b[_0x5b891f];return _0x3f7553;};'use strict';var multer=require('multer');var util=require(_0xb4f0('0x0'));var path=require('path');var timeout=require(_0xb4f0('0x1'));var express=require(_0xb4f0('0x2'));var router=express[_0xb4f0('0x3')]();var fs_extra=require(_0xb4f0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb4f0('0x5'));var config=require(_0xb4f0('0x6'));var controller=require('./squareProject.controller');router[_0xb4f0('0x7')]('/',auth[_0xb4f0('0x8')](),controller[_0xb4f0('0x9')]);router[_0xb4f0('0x7')]('/:id',auth[_0xb4f0('0x8')](),controller[_0xb4f0('0xa')]);router[_0xb4f0('0xb')]('/',auth['isAuthenticated'](),controller[_0xb4f0('0xc')]);router['put'](_0xb4f0('0xd'),auth[_0xb4f0('0x8')](),controller[_0xb4f0('0xe')]);router['delete'](_0xb4f0('0xd'),auth[_0xb4f0('0x8')](),controller[_0xb4f0('0xf')]);module[_0xb4f0('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2563=['name','TEXT','long','getDataValue','preproduction','utf8','BLOB','production','DATE','sequelize','exports','STRING'];(function(_0x3cadd1,_0x4d68a5){var _0x2fee81=function(_0x4fdd22){while(--_0x4fdd22){_0x3cadd1['push'](_0x3cadd1['shift']());}};_0x2fee81(++_0x4d68a5);}(_0x2563,0x75));var _0x3256=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2563[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3256('0x0'));module[_0x3256('0x1')]={'name':{'type':Sequelize[_0x3256('0x2')],'unique':_0x3256('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3256('0x2')]},'notes':{'type':Sequelize[_0x3256('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x3256('0x5')),'get':function(){if(this[_0x3256('0x6')]('preproduction')){return this[_0x3256('0x6')](_0x3256('0x7'))['toString'](_0x3256('0x8'));}}},'production':{'type':Sequelize[_0x3256('0x9')](_0x3256('0x5')),'get':function(){if(this[_0x3256('0x6')](_0x3256('0xa'))){return this['getDataValue']('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x3256('0xb')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xe5bb=['getDataValue','preproduction','utf8','long','production','toString','DATE','sequelize','exports','name','STRING','TEXT','BLOB'];(function(_0x2df45c,_0x1acbb3){var _0x40b97c=function(_0x1a1b76){while(--_0x1a1b76){_0x2df45c['push'](_0x2df45c['shift']());}};_0x40b97c(++_0x1acbb3);}(_0xe5bb,0x166));var _0xbe5b=function(_0x446bb6,_0x45cbb6){_0x446bb6=_0x446bb6-0x0;var _0x154b79=_0xe5bb[_0x446bb6];return _0x154b79;};'use strict';var Sequelize=require(_0xbe5b('0x0'));module[_0xbe5b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe5b('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xbe5b('0x3')]},'notes':{'type':Sequelize[_0xbe5b('0x4')]},'preproduction':{'type':Sequelize[_0xbe5b('0x5')]('long'),'get':function(){if(this[_0xbe5b('0x6')](_0xbe5b('0x7'))){return this[_0xbe5b('0x6')](_0xbe5b('0x7'))['toString'](_0xbe5b('0x8'));}}},'production':{'type':Sequelize[_0xbe5b('0x5')](_0xbe5b('0x9')),'get':function(){if(this[_0xbe5b('0x6')](_0xbe5b('0xa'))){return this[_0xbe5b('0x6')]('production')[_0xbe5b('0xb')](_0xbe5b('0x8'));}}},'savedAt':{'type':Sequelize[_0xbe5b('0xc')]},'publishedAt':{'type':Sequelize[_0xbe5b('0xc')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8414=['UserProfileResource','agi','stringify','end','sendStatus','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','publish','pick','production','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./squareProject.socket','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','SquareProjects'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8414,0x109));var _0x4841=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0x8414[_0x2e2eab];return _0x2357bc;};'use strict';var _=require(_0x4841('0x0'));var Redis=require(_0x4841('0x1'));var qs=require(_0x4841('0x2'));var logger=require('../../config/logger')(_0x4841('0x3'));var config=require(_0x4841('0x4'));var db=require(_0x4841('0x5'))['db'];config['redis']=_[_0x4841('0x6')](config[_0x4841('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x4841('0x8'))(new Redis(config[_0x4841('0x7')]));require(_0x4841('0x9'))['register'](socket);function respondWithResult(_0x1128cb,_0x296c90){_0x296c90=_0x296c90||0xc8;return function(_0xf76593){if(_0xf76593){return _0x1128cb[_0x4841('0xa')](_0x296c90)[_0x4841('0xb')](_0xf76593);}};}function respondWithFilteredResult(_0x19ee14,_0x2188a9){return function(_0x444a7b){if(_0x444a7b){var _0x3ea877=typeof _0x2188a9['offset']===_0x4841('0xc')&&typeof _0x2188a9[_0x4841('0xd')]==='undefined';var _0x269adb=_0x444a7b[_0x4841('0xe')];var _0x40b31f=_0x3ea877?0x0:_0x2188a9[_0x4841('0xf')];var _0x31ff36=_0x3ea877?_0x444a7b[_0x4841('0xe')]:_0x2188a9[_0x4841('0xf')]+_0x2188a9[_0x4841('0xd')];var _0x3372c7;if(_0x31ff36>=_0x269adb){_0x31ff36=_0x269adb;_0x3372c7=0xc8;}else{_0x3372c7=0xce;}_0x19ee14[_0x4841('0xa')](_0x3372c7);return _0x19ee14[_0x4841('0x10')](_0x4841('0x11'),_0x40b31f+'-'+_0x31ff36+'/'+_0x269adb)['json'](_0x444a7b);}return null;};}function saveUpdates(_0x5206f5){return function(_0x578f9f){if(_0x578f9f){return _0x578f9f[_0x4841('0x12')](_0x5206f5)[_0x4841('0x13')](function(_0x3b753a){return _0x3b753a;});}return null;};}function removeEntity(_0x3a6cd3){return function(_0x44fe60){if(_0x44fe60){return _0x44fe60[_0x4841('0x14')]()[_0x4841('0x13')](function(){var _0x150a93=_0x44fe60[_0x4841('0x15')]({'plain':!![]});var _0x50210c=_0x4841('0x16');return db[_0x4841('0x17')][_0x4841('0x14')]({'where':{'type':_0x50210c,'resourceId':_0x150a93['id']}})[_0x4841('0x13')](function(){return _0x44fe60;});})['then'](function(){var _0x58517e=new Redis(config['redis']);_0x58517e['publish'](_0x4841('0x18'),JSON[_0x4841('0x19')]({'id':_0x44fe60['id'],'deleted':!![]}));})['then'](function(){_0x3a6cd3['status'](0xcc)[_0x4841('0x1a')]();});}};}function handleEntityNotFound(_0x36a06b){return function(_0x53e52e){if(!_0x53e52e){_0x36a06b[_0x4841('0x1b')](0x194);}return _0x53e52e;};}function handleError(_0x13c150,_0x558cc3){_0x558cc3=_0x558cc3||0x1f4;return function(_0x554eac){logger['error'](_0x554eac[_0x4841('0x1c')]);if(_0x554eac[_0x4841('0x1d')]){delete _0x554eac['name'];}_0x13c150['status'](_0x558cc3)[_0x4841('0x1e')](_0x554eac);};}exports[_0x4841('0x1f')]=function(_0x30265c,_0x3371bd){var _0x4659d9={},_0x34959e={},_0x124579={'count':0x0,'rows':[]};var _0x551e4f=_[_0x4841('0x20')](db[_0x4841('0x21')][_0x4841('0x22')],function(_0x389806){return{'name':_0x389806[_0x4841('0x23')],'type':_0x389806[_0x4841('0x24')][_0x4841('0x25')]};});_0x34959e[_0x4841('0x26')]=_[_0x4841('0x20')](_0x551e4f,_0x4841('0x1d'));_0x34959e['query']=_['keys'](_0x30265c[_0x4841('0x27')]);_0x34959e[_0x4841('0x28')]=_['intersection'](_0x34959e[_0x4841('0x26')],_0x34959e[_0x4841('0x27')]);_0x4659d9[_0x4841('0x29')]=_[_0x4841('0x2a')](_0x34959e[_0x4841('0x26')],qs[_0x4841('0x2b')](_0x30265c[_0x4841('0x27')][_0x4841('0x2b')]));_0x4659d9[_0x4841('0x29')]=_0x4659d9[_0x4841('0x29')][_0x4841('0x2c')]?_0x4659d9['attributes']:_0x34959e[_0x4841('0x26')];if(!_0x30265c[_0x4841('0x27')][_0x4841('0x2d')](_0x4841('0x2e'))){_0x4659d9['limit']=qs['limit'](_0x30265c[_0x4841('0x27')]['limit']);_0x4659d9[_0x4841('0xf')]=qs['offset'](_0x30265c[_0x4841('0x27')][_0x4841('0xf')]);}_0x4659d9[_0x4841('0x2f')]=qs[_0x4841('0x30')](_0x30265c[_0x4841('0x27')]['sort']);_0x4659d9[_0x4841('0x31')]=qs['filters'](_['pick'](_0x30265c['query'],_0x34959e[_0x4841('0x28')]),_0x551e4f);if(_0x30265c['query']['filter']){_0x4659d9[_0x4841('0x31')]=_[_0x4841('0x32')](_0x4659d9[_0x4841('0x31')],{'$or':_[_0x4841('0x20')](_0x551e4f,function(_0x5a1799){if(_0x5a1799[_0x4841('0x24')]!==_0x4841('0x33')){var _0x2eef2a={};_0x2eef2a[_0x5a1799[_0x4841('0x1d')]]={'$like':'%'+_0x30265c[_0x4841('0x27')][_0x4841('0x34')]+'%'};return _0x2eef2a;}})});}_0x4659d9=_[_0x4841('0x32')]({},_0x4659d9,_0x30265c['options']);var _0x50caca={'where':_0x4659d9[_0x4841('0x31')]};return db[_0x4841('0x21')][_0x4841('0xe')](_0x50caca)['then'](function(_0x540e88){_0x124579[_0x4841('0xe')]=_0x540e88;if(_0x30265c[_0x4841('0x27')][_0x4841('0x35')]){_0x4659d9['include']=[{'all':!![]}];}return db['SquareProject'][_0x4841('0x36')](_0x4659d9);})[_0x4841('0x13')](function(_0x5b8445){_0x124579[_0x4841('0x37')]=_0x5b8445;return _0x124579;})[_0x4841('0x13')](respondWithFilteredResult(_0x3371bd,_0x4659d9))['catch'](handleError(_0x3371bd,null));};exports[_0x4841('0x38')]=function(_0xebf7d2,_0x479eb2){var _0x220812={'raw':![],'where':{'id':_0xebf7d2[_0x4841('0x39')]['id']}},_0x187813={};_0x187813[_0x4841('0x26')]=_[_0x4841('0x3a')](db['SquareProject'][_0x4841('0x22')]);_0x187813['query']=_['keys'](_0xebf7d2['query']);_0x187813[_0x4841('0x28')]=_[_0x4841('0x2a')](_0x187813[_0x4841('0x26')],_0x187813['query']);_0x220812['attributes']=_[_0x4841('0x2a')](_0x187813['model'],qs[_0x4841('0x2b')](_0xebf7d2[_0x4841('0x27')]['fields']));_0x220812[_0x4841('0x29')]=_0x220812['attributes'][_0x4841('0x2c')]?_0x220812[_0x4841('0x29')]:_0x187813[_0x4841('0x26')];if(_0xebf7d2[_0x4841('0x27')][_0x4841('0x35')]){_0x220812['include']=[{'all':!![]}];}_0x220812=_['merge']({},_0x220812,_0xebf7d2[_0x4841('0x3b')]);return db['SquareProject'][_0x4841('0x3c')](_0x220812)[_0x4841('0x13')](handleEntityNotFound(_0x479eb2,null))[_0x4841('0x13')](respondWithResult(_0x479eb2,null))[_0x4841('0x3d')](handleError(_0x479eb2,null));};exports['create']=function(_0x397536,_0x2e3ee3){return db[_0x4841('0x21')][_0x4841('0x3e')](_0x397536[_0x4841('0x3f')],{})[_0x4841('0x13')](function(_0xf46851){var _0x170334=_0x397536[_0x4841('0x40')][_0x4841('0x15')]({'plain':!![]});if(!_0x170334)throw new Error(_0x4841('0x41'));if(_0x170334[_0x4841('0x42')]==='user'){var _0x24ba03=_0xf46851['get']({'plain':!![]});var _0x5c609b=_0x4841('0x16');return db['UserProfileSection'][_0x4841('0x3c')]({'where':{'name':_0x5c609b,'userProfileId':_0x170334[_0x4841('0x43')]},'raw':!![]})[_0x4841('0x13')](function(_0x88379a){if(_0x88379a&&_0x88379a[_0x4841('0x44')]===0x0){return db[_0x4841('0x17')][_0x4841('0x3e')]({'name':_0x24ba03[_0x4841('0x1d')],'resourceId':_0x24ba03['id'],'type':_0x88379a['name'],'sectionId':_0x88379a['id']},{})[_0x4841('0x13')](function(){return _0xf46851;});}else{return _0xf46851;}})[_0x4841('0x3d')](function(_0x789f1e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x789f1e);throw _0x789f1e;});}return _0xf46851;})[_0x4841('0x13')](respondWithResult(_0x2e3ee3,0xc9))['catch'](handleError(_0x2e3ee3,null));};exports[_0x4841('0x12')]=function(_0x5a132b,_0x37624b){if(_0x5a132b[_0x4841('0x3f')]['id']){delete _0x5a132b[_0x4841('0x3f')]['id'];}return db[_0x4841('0x21')][_0x4841('0x3c')]({'where':{'id':_0x5a132b[_0x4841('0x39')]['id']}})['then'](handleEntityNotFound(_0x37624b,null))['then'](saveUpdates(_0x5a132b[_0x4841('0x3f')],null))[_0x4841('0x13')](function(_0x4fbe7e){if(!_0x4fbe7e)return;var _0x20befb=_0x4fbe7e['get']({'plain':!![]});return _0x20befb;})[_0x4841('0x13')](function(_0xe21fca){var _0x5b041c=new Redis(config[_0x4841('0x7')]);_0x5b041c[_0x4841('0x45')](_0x4841('0x18'),JSON[_0x4841('0x19')](_[_0x4841('0x46')](_0xe21fca,['id',_0x4841('0x1d'),_0x4841('0x47')])));return _0xe21fca;})[_0x4841('0x13')](respondWithResult(_0x37624b,null))[_0x4841('0x3d')](handleError(_0x37624b,null));};exports[_0x4841('0x14')]=function(_0x1511ea,_0x37bf0f){return db[_0x4841('0x21')][_0x4841('0x3c')]({'where':{'id':_0x1511ea[_0x4841('0x39')]['id']}})[_0x4841('0x13')](handleEntityNotFound(_0x37bf0f,null))[_0x4841('0x13')](removeEntity(_0x37bf0f,null))['catch'](handleError(_0x37bf0f,null));};
\ No newline at end of file
+var _0x2f74=['includeAll','include','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','userProfileId','autoAssociation','production','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','json','update','destroy','then','get','UserProfileResource','publish','agi','stringify','sendStatus','error','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2f74,0xd6));var _0x42f7=function(_0x4e27cc,_0x8eca75){_0x4e27cc=_0x4e27cc-0x0;var _0x5e2fac=_0x2f74[_0x4e27cc];return _0x5e2fac;};'use strict';var _=require('lodash');var Redis=require(_0x42f7('0x0'));var qs=require(_0x42f7('0x1'));var logger=require('../../config/logger')(_0x42f7('0x2'));var config=require(_0x42f7('0x3'));var db=require(_0x42f7('0x4'))['db'];config['redis']=_[_0x42f7('0x5')](config[_0x42f7('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x42f7('0x7'))(new Redis(config[_0x42f7('0x6')]));require(_0x42f7('0x8'))[_0x42f7('0x9')](socket);function respondWithResult(_0x2bc4e5,_0x11c2fc){_0x11c2fc=_0x11c2fc||0xc8;return function(_0x4903de){if(_0x4903de){return _0x2bc4e5[_0x42f7('0xa')](_0x11c2fc)['json'](_0x4903de);}};}function respondWithFilteredResult(_0x34a51a,_0x510393){return function(_0x2fa4da){if(_0x2fa4da){var _0x48f2a7=typeof _0x510393[_0x42f7('0xb')]===_0x42f7('0xc')&&typeof _0x510393[_0x42f7('0xd')]===_0x42f7('0xc');var _0x5c4a5e=_0x2fa4da['count'];var _0x483833=_0x48f2a7?0x0:_0x510393[_0x42f7('0xb')];var _0x1ada0f=_0x48f2a7?_0x2fa4da[_0x42f7('0xe')]:_0x510393[_0x42f7('0xb')]+_0x510393[_0x42f7('0xd')];var _0x11588a;if(_0x1ada0f>=_0x5c4a5e){_0x1ada0f=_0x5c4a5e;_0x11588a=0xc8;}else{_0x11588a=0xce;}_0x34a51a[_0x42f7('0xa')](_0x11588a);return _0x34a51a['set']('Content-Range',_0x483833+'-'+_0x1ada0f+'/'+_0x5c4a5e)[_0x42f7('0xf')](_0x2fa4da);}return null;};}function saveUpdates(_0x54c36){return function(_0x170ead){if(_0x170ead){return _0x170ead[_0x42f7('0x10')](_0x54c36)['then'](function(_0x522ab7){return _0x522ab7;});}return null;};}function removeEntity(_0x295cc7){return function(_0x59847f){if(_0x59847f){return _0x59847f[_0x42f7('0x11')]()[_0x42f7('0x12')](function(){var _0x211ad0=_0x59847f[_0x42f7('0x13')]({'plain':!![]});var _0x1be7ca='SquareProjects';return db[_0x42f7('0x14')][_0x42f7('0x11')]({'where':{'type':_0x1be7ca,'resourceId':_0x211ad0['id']}})[_0x42f7('0x12')](function(){return _0x59847f;});})[_0x42f7('0x12')](function(){var _0x445e1e=new Redis(config['redis']);_0x445e1e[_0x42f7('0x15')](_0x42f7('0x16'),JSON[_0x42f7('0x17')]({'id':_0x59847f['id'],'deleted':!![]}));})[_0x42f7('0x12')](function(){_0x295cc7[_0x42f7('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0bf0){return function(_0x1a8165){if(!_0x1a8165){_0x2b0bf0[_0x42f7('0x18')](0x194);}return _0x1a8165;};}function handleError(_0xb5c594,_0x591e2f){_0x591e2f=_0x591e2f||0x1f4;return function(_0x59ef76){logger[_0x42f7('0x19')](_0x59ef76['stack']);if(_0x59ef76[_0x42f7('0x1a')]){delete _0x59ef76[_0x42f7('0x1a')];}_0xb5c594['status'](_0x591e2f)['send'](_0x59ef76);};}exports[_0x42f7('0x1b')]=function(_0x4498ba,_0x544ff6){var _0x373786={},_0x205629={},_0x4b54b7={'count':0x0,'rows':[]};var _0x291ae2=_[_0x42f7('0x1c')](db[_0x42f7('0x1d')][_0x42f7('0x1e')],function(_0x5269ec){return{'name':_0x5269ec[_0x42f7('0x1f')],'type':_0x5269ec[_0x42f7('0x20')][_0x42f7('0x21')]};});_0x205629[_0x42f7('0x22')]=_[_0x42f7('0x1c')](_0x291ae2,'name');_0x205629['query']=_[_0x42f7('0x23')](_0x4498ba[_0x42f7('0x24')]);_0x205629[_0x42f7('0x25')]=_['intersection'](_0x205629[_0x42f7('0x22')],_0x205629[_0x42f7('0x24')]);_0x373786['attributes']=_['intersection'](_0x205629['model'],qs[_0x42f7('0x26')](_0x4498ba[_0x42f7('0x24')][_0x42f7('0x26')]));_0x373786[_0x42f7('0x27')]=_0x373786['attributes'][_0x42f7('0x28')]?_0x373786[_0x42f7('0x27')]:_0x205629[_0x42f7('0x22')];if(!_0x4498ba['query'][_0x42f7('0x29')](_0x42f7('0x2a'))){_0x373786[_0x42f7('0xd')]=qs[_0x42f7('0xd')](_0x4498ba[_0x42f7('0x24')][_0x42f7('0xd')]);_0x373786[_0x42f7('0xb')]=qs['offset'](_0x4498ba[_0x42f7('0x24')][_0x42f7('0xb')]);}_0x373786['order']=qs[_0x42f7('0x2b')](_0x4498ba[_0x42f7('0x24')][_0x42f7('0x2b')]);_0x373786['where']=qs['filters'](_[_0x42f7('0x2c')](_0x4498ba[_0x42f7('0x24')],_0x205629[_0x42f7('0x25')]),_0x291ae2);if(_0x4498ba[_0x42f7('0x24')][_0x42f7('0x2d')]){_0x373786['where']=_[_0x42f7('0x2e')](_0x373786[_0x42f7('0x2f')],{'$or':_[_0x42f7('0x1c')](_0x291ae2,function(_0x2fc1a6){if(_0x2fc1a6['type']!==_0x42f7('0x30')){var _0x4f8bf2={};_0x4f8bf2[_0x2fc1a6[_0x42f7('0x1a')]]={'$like':'%'+_0x4498ba[_0x42f7('0x24')][_0x42f7('0x2d')]+'%'};return _0x4f8bf2;}})});}_0x373786=_[_0x42f7('0x2e')]({},_0x373786,_0x4498ba[_0x42f7('0x31')]);var _0x2930ec={'where':_0x373786[_0x42f7('0x2f')]};return db[_0x42f7('0x1d')]['count'](_0x2930ec)[_0x42f7('0x12')](function(_0x2ff62d){_0x4b54b7[_0x42f7('0xe')]=_0x2ff62d;if(_0x4498ba['query'][_0x42f7('0x32')]){_0x373786[_0x42f7('0x33')]=[{'all':!![]}];}return db[_0x42f7('0x1d')]['findAll'](_0x373786);})['then'](function(_0x5351b5){_0x4b54b7['rows']=_0x5351b5;return _0x4b54b7;})[_0x42f7('0x12')](respondWithFilteredResult(_0x544ff6,_0x373786))[_0x42f7('0x34')](handleError(_0x544ff6,null));};exports[_0x42f7('0x35')]=function(_0x3d281d,_0x33de3f){var _0x2adaa6={'raw':![],'where':{'id':_0x3d281d[_0x42f7('0x36')]['id']}},_0x508f9e={};_0x508f9e[_0x42f7('0x22')]=_[_0x42f7('0x23')](db[_0x42f7('0x1d')][_0x42f7('0x1e')]);_0x508f9e[_0x42f7('0x24')]=_[_0x42f7('0x23')](_0x3d281d[_0x42f7('0x24')]);_0x508f9e[_0x42f7('0x25')]=_[_0x42f7('0x37')](_0x508f9e[_0x42f7('0x22')],_0x508f9e[_0x42f7('0x24')]);_0x2adaa6[_0x42f7('0x27')]=_[_0x42f7('0x37')](_0x508f9e[_0x42f7('0x22')],qs[_0x42f7('0x26')](_0x3d281d[_0x42f7('0x24')]['fields']));_0x2adaa6[_0x42f7('0x27')]=_0x2adaa6['attributes']['length']?_0x2adaa6['attributes']:_0x508f9e['model'];if(_0x3d281d[_0x42f7('0x24')][_0x42f7('0x32')]){_0x2adaa6[_0x42f7('0x33')]=[{'all':!![]}];}_0x2adaa6=_['merge']({},_0x2adaa6,_0x3d281d[_0x42f7('0x31')]);return db[_0x42f7('0x1d')][_0x42f7('0x38')](_0x2adaa6)['then'](handleEntityNotFound(_0x33de3f,null))['then'](respondWithResult(_0x33de3f,null))['catch'](handleError(_0x33de3f,null));};exports[_0x42f7('0x39')]=function(_0xaf14de,_0x5eef3a){return db[_0x42f7('0x1d')][_0x42f7('0x39')](_0xaf14de[_0x42f7('0x3a')],{})[_0x42f7('0x12')](function(_0x1fd045){var _0x19931f=_0xaf14de[_0x42f7('0x3b')]['get']({'plain':!![]});if(!_0x19931f)throw new Error(_0x42f7('0x3c'));if(_0x19931f[_0x42f7('0x3d')]===_0x42f7('0x3b')){var _0x48ac21=_0x1fd045[_0x42f7('0x13')]({'plain':!![]});var _0x20c05c=_0x42f7('0x3e');return db['UserProfileSection'][_0x42f7('0x38')]({'where':{'name':_0x20c05c,'userProfileId':_0x19931f[_0x42f7('0x3f')]},'raw':!![]})[_0x42f7('0x12')](function(_0x1812ec){if(_0x1812ec&&_0x1812ec[_0x42f7('0x40')]===0x0){return db['UserProfileResource'][_0x42f7('0x39')]({'name':_0x48ac21[_0x42f7('0x1a')],'resourceId':_0x48ac21['id'],'type':_0x1812ec[_0x42f7('0x1a')],'sectionId':_0x1812ec['id']},{})[_0x42f7('0x12')](function(){return _0x1fd045;});}else{return _0x1fd045;}})['catch'](function(_0x364632){logger[_0x42f7('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x364632);throw _0x364632;});}return _0x1fd045;})[_0x42f7('0x12')](respondWithResult(_0x5eef3a,0xc9))['catch'](handleError(_0x5eef3a,null));};exports['update']=function(_0x4718ad,_0x11eedb){if(_0x4718ad['body']['id']){delete _0x4718ad[_0x42f7('0x3a')]['id'];}return db[_0x42f7('0x1d')][_0x42f7('0x38')]({'where':{'id':_0x4718ad[_0x42f7('0x36')]['id']}})[_0x42f7('0x12')](handleEntityNotFound(_0x11eedb,null))[_0x42f7('0x12')](saveUpdates(_0x4718ad['body'],null))['then'](function(_0x836a3d){if(!_0x836a3d)return;var _0x48b907=_0x836a3d[_0x42f7('0x13')]({'plain':!![]});return _0x48b907;})[_0x42f7('0x12')](function(_0x231d65){var _0xa59b16=new Redis(config[_0x42f7('0x6')]);_0xa59b16[_0x42f7('0x15')](_0x42f7('0x16'),JSON[_0x42f7('0x17')](_[_0x42f7('0x2c')](_0x231d65,['id',_0x42f7('0x1a'),_0x42f7('0x41')])));return _0x231d65;})[_0x42f7('0x12')](respondWithResult(_0x11eedb,null))['catch'](handleError(_0x11eedb,null));};exports[_0x42f7('0x11')]=function(_0x1ad4e4,_0x4db412){return db[_0x42f7('0x1d')][_0x42f7('0x38')]({'where':{'id':_0x1ad4e4['params']['id']}})[_0x42f7('0x12')](handleEntityNotFound(_0x4db412,null))['then'](removeEntity(_0x4db412,null))[_0x42f7('0x34')](handleError(_0x4db412,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ab4=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ab4,0x6d));var _0x48ab=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x8ab4[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require(_0x48ab('0x0'));var SquareProject=require(_0x48ab('0x1'))['db'][_0x48ab('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x48ab('0x3')](0x0);var events={'afterCreate':_0x48ab('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x39fbff){return function(_0x5e36bc,_0x459d43,_0x55f228){SquareProjectEvents[_0x48ab('0x5')](_0x39fbff+':'+_0x5e36bc['id'],_0x5e36bc);SquareProjectEvents[_0x48ab('0x5')](_0x39fbff,_0x5e36bc);_0x55f228(null);};}for(var e in events){if(events[_0x48ab('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x48ab('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0x1071=['emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1071,0xc2));var _0x1107=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1071[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x1107('0x0'))['db'][_0x1107('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1107('0x2')](0x0);var events={'afterCreate':_0x1107('0x3'),'afterUpdate':_0x1107('0x4'),'afterDestroy':_0x1107('0x5')};function emitEvent(_0x3e5092){return function(_0x3e72a9,_0x3dfcb2,_0x38b89e){SquareProjectEvents[_0x1107('0x6')](_0x3e5092+':'+_0x3e72a9['id'],_0x3e72a9);SquareProjectEvents[_0x1107('0x6')](_0x3e5092,_0x3e72a9);_0x38b89e(null);};}for(var e in events){if(events[_0x1107('0x7')](e)){var event=events[e];SquareProject[_0x1107('0x8')](e,emitEvent(event));}}module[_0x1107('0x9')]=SquareProjectEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f5d=['api','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util'];(function(_0x4cdba5,_0x5373a7){var _0x3be43d=function(_0x5e007c){while(--_0x5e007c){_0x4cdba5['push'](_0x4cdba5['shift']());}};_0x3be43d(++_0x5373a7);}(_0x6f5d,0x142));var _0xd6f5=function(_0x1c5d70,_0x3f0c19){_0x1c5d70=_0x1c5d70-0x0;var _0x530b53=_0x6f5d[_0x1c5d70];return _0x530b53;};'use strict';var _=require(_0xd6f5('0x0'));var util=require(_0xd6f5('0x1'));var logger=require('../../config/logger')(_0xd6f5('0x2'));var moment=require(_0xd6f5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f5('0x4'));var fs=require('fs');var path=require(_0xd6f5('0x5'));var rimraf=require(_0xd6f5('0x6'));var config=require(_0xd6f5('0x7'));var attributes=require(_0xd6f5('0x8'));module[_0xd6f5('0x9')]=function(_0x2385c2,_0x5117ab){return _0x2385c2['define']('SquareProject',attributes,{'tableName':_0xd6f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39d3fb,_0x5baf8d,_0x1d9a41){if(_0x39d3fb['changed'](_0xd6f5('0xb'))){_0x39d3fb[_0xd6f5('0xc')]=moment()[_0xd6f5('0xd')](_0xd6f5('0xe'));}if(_0x39d3fb[_0xd6f5('0xf')](_0xd6f5('0x10'))){_0x39d3fb[_0xd6f5('0x11')]=moment()[_0xd6f5('0xd')](_0xd6f5('0xe'));}_0x1d9a41(null,_0x39d3fb);}}});};
\ No newline at end of file
+var _0x1fa0=['publishedAt','lodash','util','../../config/logger','path','rimraf','./squareProject.attributes','exports','SquareProject','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x1fa0,0x143));var _0x01fa=function(_0x203899,_0x2f5b46){_0x203899=_0x203899-0x0;var _0x403e60=_0x1fa0[_0x203899];return _0x403e60;};'use strict';var _=require(_0x01fa('0x0'));var util=require(_0x01fa('0x1'));var logger=require(_0x01fa('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01fa('0x3'));var rimraf=require(_0x01fa('0x4'));var config=require('../../config/environment');var attributes=require(_0x01fa('0x5'));module[_0x01fa('0x6')]=function(_0x1050bc,_0x231b32){return _0x1050bc['define'](_0x01fa('0x7'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cfcec,_0xd04ee9,_0x78daa6){if(_0x3cfcec[_0x01fa('0x8')]('preproduction')){_0x3cfcec[_0x01fa('0x9')]=moment()[_0x01fa('0xa')](_0x01fa('0xb'));}if(_0x3cfcec[_0x01fa('0x8')](_0x01fa('0xc'))){_0x3cfcec[_0x01fa('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x78daa6(null,_0x3cfcec);}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a23=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','error','ShowSquareProject','find','info','catch','message','ioredis','../../mysqldb'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x3a23,0xa6));var _0x33a2=function(_0xe14dce,_0x226436){_0xe14dce=_0xe14dce-0x0;var _0x396c9e=_0x3a23[_0xe14dce];return _0x396c9e;};'use strict';var _=require('lodash');var Redis=require(_0x33a2('0x0'));var db=require(_0x33a2('0x1'))['db'];var logger=require(_0x33a2('0x2'))(_0x33a2('0x3'));var config=require(_0x33a2('0x4'));config[_0x33a2('0x5')]=_[_0x33a2('0x6')](config[_0x33a2('0x5')],{'host':_0x33a2('0x7'),'port':0x18eb});var socket=require(_0x33a2('0x8'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports[_0x33a2('0x9')]=function(_0xb4ded8){var _0x5ba79d=this;return new Promise(function(_0x55f1aa,_0x16d8d6){return db[_0x33a2('0xa')]['findAll']({'raw':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xc')]===undefined?!![]:![]:!![],'where':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xd')]||null:null,'attributes':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xe')]||null:null,'limit':_0xb4ded8[_0x33a2('0xb')]?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0xf')]||null:null,'include':_0xb4ded8['options']?_0xb4ded8[_0x33a2('0xb')][_0x33a2('0x10')]?_[_0x33a2('0x11')](_0xb4ded8[_0x33a2('0xb')][_0x33a2('0x10')],function(_0x4d54cc){return{'model':db[_0x4d54cc[_0x33a2('0x12')]],'as':_0x4d54cc['as'],'attributes':_0x4d54cc['attributes'],'include':_0x4d54cc[_0x33a2('0x10')]?_[_0x33a2('0x11')](_0x4d54cc[_0x33a2('0x10')],function(_0x452dfc){return{'model':db[_0x452dfc[_0x33a2('0x12')]],'as':_0x452dfc['as'],'attributes':_0x452dfc[_0x33a2('0xe')],'include':_0x452dfc['include']?_[_0x33a2('0x11')](_0x452dfc[_0x33a2('0x10')],function(_0x56891b){return{'model':db[_0x56891b[_0x33a2('0x12')]],'as':_0x56891b['as'],'attributes':_0x56891b[_0x33a2('0xe')]};}):[]};}):[]};}):[]:[]})[_0x33a2('0x13')](function(_0x3a8710){logger['info'](_0x33a2('0x9'),_0xb4ded8);logger[_0x33a2('0x14')]('GetSquareProjects',_0xb4ded8,JSON[_0x33a2('0x15')](_0x3a8710));_0x55f1aa(_0x3a8710);})['catch'](function(_0x281dc1){logger[_0x33a2('0x16')](_0x33a2('0x9'),_0x281dc1['message'],_0xb4ded8);_0x16d8d6(_0x5ba79d['error'](0x1f4,_0x281dc1['message']));});});};exports[_0x33a2('0x17')]=function(_0x1be97f){var _0x2f1be1=this;return new Promise(function(_0x6e4546,_0x1f04a6){return db[_0x33a2('0xa')][_0x33a2('0x18')]({'raw':_0x1be97f[_0x33a2('0xb')]?_0x1be97f[_0x33a2('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x1be97f[_0x33a2('0xb')]?_0x1be97f[_0x33a2('0xb')][_0x33a2('0xd')]||null:null,'attributes':_0x1be97f['options']?_0x1be97f[_0x33a2('0xb')][_0x33a2('0xe')]||null:null,'include':_0x1be97f[_0x33a2('0xb')]?_0x1be97f['options'][_0x33a2('0x10')]?_[_0x33a2('0x11')](_0x1be97f['options'][_0x33a2('0x10')],function(_0x2cae74){return{'model':db[_0x2cae74[_0x33a2('0x12')]],'as':_0x2cae74['as'],'attributes':_0x2cae74['attributes'],'include':_0x2cae74[_0x33a2('0x10')]?_[_0x33a2('0x11')](_0x2cae74[_0x33a2('0x10')],function(_0x43eac7){return{'model':db[_0x43eac7[_0x33a2('0x12')]],'as':_0x43eac7['as'],'attributes':_0x43eac7[_0x33a2('0xe')],'include':_0x43eac7[_0x33a2('0x10')]?_['map'](_0x43eac7[_0x33a2('0x10')],function(_0x5cb150){return{'model':db[_0x5cb150[_0x33a2('0x12')]],'as':_0x5cb150['as'],'attributes':_0x5cb150[_0x33a2('0xe')]};}):[]};}):[]};}):[]:[]})[_0x33a2('0x13')](function(_0x276162){logger[_0x33a2('0x19')]('ShowSquareProject',_0x1be97f);logger[_0x33a2('0x14')](_0x33a2('0x17'),_0x1be97f,JSON[_0x33a2('0x15')](_0x276162));_0x6e4546(_0x276162);})[_0x33a2('0x1a')](function(_0x3c83cb){logger['error'](_0x33a2('0x17'),_0x3c83cb['message'],_0x1be97f);_0x1f04a6(_0x2f1be1[_0x33a2('0x16')](0x1f4,_0x3c83cb[_0x33a2('0x1b')]));});});};
\ No newline at end of file
+var _0x5699=['raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowSquareProject','find','lodash','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x5699,0xa6));var _0x9569=function(_0x5964c1,_0x38a9bc){_0x5964c1=_0x5964c1-0x0;var _0x59f013=_0x5699[_0x5964c1];return _0x59f013;};'use strict';var _=require(_0x9569('0x0'));var Redis=require(_0x9569('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x9569('0x2'))('rpc');var config=require(_0x9569('0x3'));config[_0x9569('0x4')]=_[_0x9569('0x5')](config[_0x9569('0x4')],{'host':_0x9569('0x6'),'port':0x18eb});var socket=require(_0x9569('0x7'))(new Redis(config[_0x9569('0x4')]));require(_0x9569('0x8'))[_0x9569('0x9')](socket);exports[_0x9569('0xa')]=function(_0x14bb5d){var _0x43fff2=this;return new Promise(function(_0x37a098,_0x3f271e){return db[_0x9569('0xb')][_0x9569('0xc')]({'raw':_0x14bb5d[_0x9569('0xd')]?_0x14bb5d[_0x9569('0xd')][_0x9569('0xe')]===undefined?!![]:![]:!![],'where':_0x14bb5d['options']?_0x14bb5d[_0x9569('0xd')][_0x9569('0xf')]||null:null,'attributes':_0x14bb5d[_0x9569('0xd')]?_0x14bb5d[_0x9569('0xd')][_0x9569('0x10')]||null:null,'limit':_0x14bb5d[_0x9569('0xd')]?_0x14bb5d[_0x9569('0xd')][_0x9569('0x11')]||null:null,'include':_0x14bb5d['options']?_0x14bb5d[_0x9569('0xd')][_0x9569('0x12')]?_[_0x9569('0x13')](_0x14bb5d['options'][_0x9569('0x12')],function(_0x12b383){return{'model':db[_0x12b383[_0x9569('0x14')]],'as':_0x12b383['as'],'attributes':_0x12b383[_0x9569('0x10')],'include':_0x12b383[_0x9569('0x12')]?_[_0x9569('0x13')](_0x12b383[_0x9569('0x12')],function(_0x5c9fcf){return{'model':db[_0x5c9fcf[_0x9569('0x14')]],'as':_0x5c9fcf['as'],'attributes':_0x5c9fcf[_0x9569('0x10')],'include':_0x5c9fcf[_0x9569('0x12')]?_[_0x9569('0x13')](_0x5c9fcf['include'],function(_0x1e5c05){return{'model':db[_0x1e5c05[_0x9569('0x14')]],'as':_0x1e5c05['as'],'attributes':_0x1e5c05[_0x9569('0x10')]};}):[]};}):[]};}):[]:[]})[_0x9569('0x15')](function(_0x2949e1){logger[_0x9569('0x16')](_0x9569('0xa'),_0x14bb5d);logger[_0x9569('0x17')](_0x9569('0xa'),_0x14bb5d,JSON[_0x9569('0x18')](_0x2949e1));_0x37a098(_0x2949e1);})[_0x9569('0x19')](function(_0x551395){logger[_0x9569('0x1a')](_0x9569('0xa'),_0x551395[_0x9569('0x1b')],_0x14bb5d);_0x3f271e(_0x43fff2[_0x9569('0x1a')](0x1f4,_0x551395[_0x9569('0x1b')]));});});};exports[_0x9569('0x1c')]=function(_0x25f5dc){var _0x1ae9ec=this;return new Promise(function(_0x3b8102,_0x46c124){return db['SquareProject'][_0x9569('0x1d')]({'raw':_0x25f5dc[_0x9569('0xd')]?_0x25f5dc[_0x9569('0xd')][_0x9569('0xe')]===undefined?!![]:![]:!![],'where':_0x25f5dc[_0x9569('0xd')]?_0x25f5dc[_0x9569('0xd')][_0x9569('0xf')]||null:null,'attributes':_0x25f5dc[_0x9569('0xd')]?_0x25f5dc['options'][_0x9569('0x10')]||null:null,'include':_0x25f5dc['options']?_0x25f5dc[_0x9569('0xd')][_0x9569('0x12')]?_['map'](_0x25f5dc['options'][_0x9569('0x12')],function(_0x51e367){return{'model':db[_0x51e367[_0x9569('0x14')]],'as':_0x51e367['as'],'attributes':_0x51e367[_0x9569('0x10')],'include':_0x51e367[_0x9569('0x12')]?_[_0x9569('0x13')](_0x51e367[_0x9569('0x12')],function(_0x2641cf){return{'model':db[_0x2641cf[_0x9569('0x14')]],'as':_0x2641cf['as'],'attributes':_0x2641cf['attributes'],'include':_0x2641cf['include']?_[_0x9569('0x13')](_0x2641cf[_0x9569('0x12')],function(_0x525042){return{'model':db[_0x525042[_0x9569('0x14')]],'as':_0x525042['as'],'attributes':_0x525042['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ca2ac){logger['info'](_0x9569('0x1c'),_0x25f5dc);logger['debug']('ShowSquareProject',_0x25f5dc,JSON[_0x9569('0x18')](_0x3ca2ac));_0x3b8102(_0x3ca2ac);})['catch'](function(_0x3da584){logger[_0x9569('0x1a')](_0x9569('0x1c'),_0x3da584[_0x9569('0x1b')],_0x25f5dc);_0x46c124(_0x1ae9ec['error'](0x1f4,_0x3da584[_0x9569('0x1b')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ca6=['removeListener','length','squareProject:','save','remove','update','emit'];(function(_0x460d3c,_0x3786ee){var _0x205e7e=function(_0x1009eb){while(--_0x1009eb){_0x460d3c['push'](_0x460d3c['shift']());}};_0x205e7e(++_0x3786ee);}(_0x9ca6,0x1ca));var _0x69ca=function(_0x3c2662,_0x2117ba){_0x3c2662=_0x3c2662-0x0;var _0x497079=_0x9ca6[_0x3c2662];return _0x497079;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x69ca('0x0'),_0x69ca('0x1'),_0x69ca('0x2')];function createListener(_0xcbc095,_0x33637b){return function(_0x3c65ed){_0x33637b[_0x69ca('0x3')](_0xcbc095,_0x3c65ed);};}function removeListener(_0x21d872,_0x495f41){return function(){SquareProjectEvents[_0x69ca('0x4')](_0x21d872,_0x495f41);};}exports['register']=function(_0x15f4c7){for(var _0x4d195a=0x0,_0x159ebd=events[_0x69ca('0x5')];_0x4d195a<_0x159ebd;_0x4d195a++){var _0x3305b4=events[_0x4d195a];var _0x5eab2f=createListener(_0x69ca('0x6')+_0x3305b4,_0x15f4c7);SquareProjectEvents['on'](_0x3305b4,_0x5eab2f);}};
\ No newline at end of file
+var _0xc9b0=['save','remove','update','emit','removeListener','length'];(function(_0x533bad,_0xd92ec5){var _0x11df23=function(_0x51f206){while(--_0x51f206){_0x533bad['push'](_0x533bad['shift']());}};_0x11df23(++_0xd92ec5);}(_0xc9b0,0xba));var _0x0c9b=function(_0x34e7ae,_0x23ed4a){_0x34e7ae=_0x34e7ae-0x0;var _0xc6a079=_0xc9b0[_0x34e7ae];return _0xc6a079;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x0c9b('0x0'),_0x0c9b('0x1'),_0x0c9b('0x2')];function createListener(_0x2395a4,_0x4f7cdc){return function(_0x102366){_0x4f7cdc[_0x0c9b('0x3')](_0x2395a4,_0x102366);};}function removeListener(_0x2b8bd3,_0x53687f){return function(){SquareProjectEvents[_0x0c9b('0x4')](_0x2b8bd3,_0x53687f);};}exports['register']=function(_0x44c461){for(var _0x5f2e85=0x0,_0x5aa27c=events[_0x0c9b('0x5')];_0x5f2e85<_0x5aa27c;_0x5f2e85++){var _0x507d56=events[_0x5f2e85];var _0x192c23=createListener('squareProject:'+_0x507d56,_0x44c461);SquareProjectEvents['on'](_0x507d56,_0x192c23);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x45f011,_0x1a4f4c){var _0x32ffa8=function(_0x4edee5){while(--_0x4edee5){_0x45f011['push'](_0x45f011['shift']());}};_0x32ffa8(++_0x1a4f4c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21a60b,_0x1108bf){_0x21a60b=_0x21a60b-0x0;var _0x369d41=_0x1cb9[_0x21a60b];return _0x369d41;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router;
\ No newline at end of file
+var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x7c2ddb,_0xb9dd96){var _0x567afc=function(_0x51cb12){while(--_0x51cb12){_0x7c2ddb['push'](_0x7c2ddb['shift']());}};_0x567afc(++_0xb9dd96);}(_0x1261,0x144));var _0x1126=function(_0x21c09f,_0x6ce866){_0x21c09f=_0x21c09f-0x0;var _0x164d58=_0x1261[_0x21c09f];return _0x164d58;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x98a8,0x12c));var _0x898a=function(_0x57fe9f,_0x2375e8){_0x57fe9f=_0x57fe9f-0x0;var _0x3f38b9=_0x98a8[_0x57fe9f];return _0x3f38b9;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}};
\ No newline at end of file
+var _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x2f31d0,_0x4fce9a){var _0x1d0256=function(_0x3f1ed5){while(--_0x3f1ed5){_0x2f31d0['push'](_0x2f31d0['shift']());}};_0x1d0256(++_0x4fce9a);}(_0x5075,0x73));var _0x5507=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x5075[_0x1daaa9];return _0x1dd221;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x40cd=['info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','download','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found'];(function(_0x52bd81,_0x5f33d8){var _0x4731a4=function(_0x479723){while(--_0x479723){_0x52bd81['push'](_0x52bd81['shift']());}};_0x4731a4(++_0x5f33d8);}(_0x40cd,0x189));var _0xd40c=function(_0x322719,_0x1e53d5){_0x322719=_0x322719-0x0;var _0x3695b9=_0x40cd[_0x322719];return _0x3695b9;};'use strict';var emlformat=require(_0xd40c('0x0'));var rimraf=require(_0xd40c('0x1'));var zipdir=require(_0xd40c('0x2'));var jsonpatch=require(_0xd40c('0x3'));var rp=require(_0xd40c('0x4'));var moment=require(_0xd40c('0x5'));var BPromise=require(_0xd40c('0x6'));var Mustache=require(_0xd40c('0x7'));var util=require(_0xd40c('0x8'));var path=require(_0xd40c('0x9'));var sox=require(_0xd40c('0xa'));var csv=require(_0xd40c('0xb'));var ejs=require(_0xd40c('0xc'));var fs=require('fs');var fs_extra=require(_0xd40c('0xd'));var _=require(_0xd40c('0xe'));var squel=require(_0xd40c('0xf'));var crypto=require(_0xd40c('0x10'));var jsforce=require(_0xd40c('0x11'));var deskjs=require(_0xd40c('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd40c('0x13'));var Redis=require(_0xd40c('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd40c('0x15'));var hardwareService=require(_0xd40c('0x16'));var logger=require('../../config/logger')(_0xd40c('0x17'));var utils=require(_0xd40c('0x18'));var config=require(_0xd40c('0x19'));var licenseUtil=require(_0xd40c('0x1a'));var db=require(_0xd40c('0x1b'))['db'];function respondWithStatusCode(_0xae0eff,_0x3b2a95){_0x3b2a95=_0x3b2a95||0xcc;return function(_0xdccb3e){if(_0xdccb3e){return _0xae0eff[_0xd40c('0x1c')](_0x3b2a95);}return _0xae0eff[_0xd40c('0x1d')](_0x3b2a95)[_0xd40c('0x1e')]();};}function respondWithResult(_0x4f53d3,_0x48de2e){_0x48de2e=_0x48de2e||0xc8;return function(_0x1ed10f){if(_0x1ed10f){return _0x4f53d3[_0xd40c('0x1d')](_0x48de2e)[_0xd40c('0x1f')](_0x1ed10f);}};}function respondWithFilteredResult(_0x144909,_0x1ef546){return function(_0x116c05){if(_0x116c05){var _0x103b8c=typeof _0x1ef546[_0xd40c('0x20')]===_0xd40c('0x21')&&typeof _0x1ef546[_0xd40c('0x22')]===_0xd40c('0x21');var _0x51f085=_0x116c05[_0xd40c('0x23')];var _0x240a57=_0x103b8c?0x0:_0x1ef546[_0xd40c('0x20')];var _0x2fb729=_0x103b8c?_0x116c05['count']:_0x1ef546[_0xd40c('0x20')]+_0x1ef546['limit'];var _0xa8647a;if(_0x2fb729>=_0x51f085){_0x2fb729=_0x51f085;_0xa8647a=0xc8;}else{_0xa8647a=0xce;}_0x144909['status'](_0xa8647a);return _0x144909[_0xd40c('0x24')](_0xd40c('0x25'),_0x240a57+'-'+_0x2fb729+'/'+_0x51f085)[_0xd40c('0x1f')](_0x116c05);}return null;};}function patchUpdates(_0x28d9cd){return function(_0x24a1a4){try{jsonpatch['apply'](_0x24a1a4,_0x28d9cd,!![]);}catch(_0x3695da){return BPromise['reject'](_0x3695da);}return _0x24a1a4[_0xd40c('0x26')]();};}function saveUpdates(_0x551160,_0x3796c5){return function(_0x3b1f92){if(_0x3b1f92){return _0x3b1f92[_0xd40c('0x27')](_0x551160)[_0xd40c('0x28')](function(_0x11d495){return _0x11d495;});}return null;};}function removeEntity(_0x131a3d,_0x2a21d3){return function(_0x2a64d8){if(_0x2a64d8){return _0x2a64d8['destroy']()[_0xd40c('0x28')](function(){_0x131a3d[_0xd40c('0x1d')](0xcc)[_0xd40c('0x1e')]();});}};}function handleEntityNotFound(_0xbd105c,_0x7a68ed){return function(_0xff99fc){if(!_0xff99fc){_0xbd105c[_0xd40c('0x1c')](0x194);}return _0xff99fc;};}function handleError(_0x33cc4d,_0x27a56d){_0x27a56d=_0x27a56d||0x1f4;return function(_0x58e3e6){logger['error'](_0x58e3e6[_0xd40c('0x29')]);if(_0x58e3e6[_0xd40c('0x2a')]){delete _0x58e3e6[_0xd40c('0x2a')];}_0x33cc4d['status'](_0x27a56d)[_0xd40c('0x2b')](_0x58e3e6);};}exports[_0xd40c('0x2c')]=function(_0xb99a8d,_0x538313){var _0x1c3c80={},_0x4829e4={},_0x9cf44b={'count':0x0,'rows':[]};var _0x369302=_[_0xd40c('0x2d')](db[_0xd40c('0x2e')][_0xd40c('0x2f')],function(_0x4b04da){return{'name':_0x4b04da[_0xd40c('0x30')],'type':_0x4b04da[_0xd40c('0x31')]['key']};});_0x4829e4['model']=_[_0xd40c('0x2d')](_0x369302,_0xd40c('0x2a'));_0x4829e4[_0xd40c('0x32')]=_[_0xd40c('0x33')](_0xb99a8d[_0xd40c('0x32')]);_0x4829e4['filters']=_[_0xd40c('0x34')](_0x4829e4[_0xd40c('0x35')],_0x4829e4[_0xd40c('0x32')]);_0x1c3c80['attributes']=_[_0xd40c('0x34')](_0x4829e4[_0xd40c('0x35')],qs[_0xd40c('0x36')](_0xb99a8d[_0xd40c('0x32')]['fields']));_0x1c3c80[_0xd40c('0x37')]=_0x1c3c80[_0xd40c('0x37')][_0xd40c('0x38')]?_0x1c3c80[_0xd40c('0x37')]:_0x4829e4['model'];if(!_0xb99a8d[_0xd40c('0x32')]['hasOwnProperty'](_0xd40c('0x39'))){_0x1c3c80['limit']=qs['limit'](_0xb99a8d[_0xd40c('0x32')][_0xd40c('0x22')]);_0x1c3c80[_0xd40c('0x20')]=qs[_0xd40c('0x20')](_0xb99a8d[_0xd40c('0x32')][_0xd40c('0x20')]);}_0x1c3c80[_0xd40c('0x3a')]=qs['sort'](_0xb99a8d['query'][_0xd40c('0x3b')]);_0x1c3c80[_0xd40c('0x3c')]=qs[_0xd40c('0x3d')](_['pick'](_0xb99a8d[_0xd40c('0x32')],_0x4829e4[_0xd40c('0x3d')]),_0x369302);if(_0xb99a8d['query'][_0xd40c('0x3e')]){_0x1c3c80['where']=_[_0xd40c('0x3f')](_0x1c3c80[_0xd40c('0x3c')],{'$or':_[_0xd40c('0x2d')](_0x369302,function(_0x3a26e3){if(_0x3a26e3['type']!==_0xd40c('0x40')){var _0x3738b2={};_0x3738b2[_0x3a26e3['name']]={'$like':'%'+_0xb99a8d[_0xd40c('0x32')][_0xd40c('0x3e')]+'%'};return _0x3738b2;}})});}_0x1c3c80=_[_0xd40c('0x3f')]({},_0x1c3c80,_0xb99a8d[_0xd40c('0x41')]);var _0x37e87c={'where':_0x1c3c80[_0xd40c('0x3c')]};return db[_0xd40c('0x2e')][_0xd40c('0x23')](_0x37e87c)[_0xd40c('0x28')](function(_0x504968){_0x9cf44b[_0xd40c('0x23')]=_0x504968;if(_0xb99a8d['query'][_0xd40c('0x42')]){_0x1c3c80[_0xd40c('0x43')]=[{'all':!![]}];}return db['SquareRecording'][_0xd40c('0x44')](_0x1c3c80);})[_0xd40c('0x28')](function(_0x1f7e65){_0x9cf44b['rows']=_0x1f7e65;return _0x9cf44b;})[_0xd40c('0x28')](respondWithFilteredResult(_0x538313,_0x1c3c80))['catch'](handleError(_0x538313,null));};exports['show']=function(_0x340405,_0x336685){var _0x413c00={'raw':!![],'where':{'id':_0x340405[_0xd40c('0x45')]['id']}},_0x1e5f98={};_0x1e5f98[_0xd40c('0x35')]=_['keys'](db['SquareRecording'][_0xd40c('0x2f')]);_0x1e5f98[_0xd40c('0x32')]=_[_0xd40c('0x33')](_0x340405[_0xd40c('0x32')]);_0x1e5f98[_0xd40c('0x3d')]=_[_0xd40c('0x34')](_0x1e5f98[_0xd40c('0x35')],_0x1e5f98[_0xd40c('0x32')]);_0x413c00[_0xd40c('0x37')]=_['intersection'](_0x1e5f98[_0xd40c('0x35')],qs['fields'](_0x340405[_0xd40c('0x32')][_0xd40c('0x36')]));_0x413c00[_0xd40c('0x37')]=_0x413c00[_0xd40c('0x37')][_0xd40c('0x38')]?_0x413c00['attributes']:_0x1e5f98['model'];if(_0x340405[_0xd40c('0x32')]['includeAll']){_0x413c00[_0xd40c('0x43')]=[{'all':!![]}];}_0x413c00=_[_0xd40c('0x3f')]({},_0x413c00,_0x340405[_0xd40c('0x41')]);return db['SquareRecording'][_0xd40c('0x46')](_0x413c00)[_0xd40c('0x28')](handleEntityNotFound(_0x336685,null))[_0xd40c('0x28')](respondWithResult(_0x336685,null))[_0xd40c('0x47')](handleError(_0x336685,null));};exports[_0xd40c('0x48')]=function(_0x331b5c,_0x19a89){return db['SquareRecording'][_0xd40c('0x48')](_0x331b5c[_0xd40c('0x49')],{})[_0xd40c('0x28')](respondWithResult(_0x19a89,0xc9))[_0xd40c('0x47')](handleError(_0x19a89,null));};exports[_0xd40c('0x27')]=function(_0x44ffea,_0x2e0abb){if(_0x44ffea[_0xd40c('0x49')]['id']){delete _0x44ffea['body']['id'];}return db[_0xd40c('0x2e')]['find']({'where':{'id':_0x44ffea['params']['id']}})[_0xd40c('0x28')](handleEntityNotFound(_0x2e0abb,null))['then'](saveUpdates(_0x44ffea[_0xd40c('0x49')],null))[_0xd40c('0x28')](respondWithResult(_0x2e0abb,null))['catch'](handleError(_0x2e0abb,null));};exports[_0xd40c('0x4a')]=function(_0x53dad5,_0xe815bb,_0x363735){var _0x1f1a8e=require('../../components/encryptor');var _0x83df8b=![];var _0x3474b6={};if(_0x53dad5['query']['type']&&_0x53dad5[_0xd40c('0x32')][_0xd40c('0x31')]===_0xd40c('0x4b')){_0x3474b6[_0xd40c('0x4b')]=_0x53dad5[_0xd40c('0x45')]['id'];}else{_0x3474b6['id']=_0x53dad5[_0xd40c('0x45')]['id'];}return db['SquareRecording'][_0xd40c('0x46')]({'where':_0x3474b6,'attributes':['id',_0xd40c('0x4c'),_0xd40c('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xe815bb,null))[_0xd40c('0x28')](function(_0x12f7f9){if(_0x12f7f9){var _0x2ac6dd=_0x12f7f9[_0xd40c('0x4c')];var _0x3d6ba6=util['format'](_0xd40c('0x4e'),_0x2ac6dd);if(fs[_0xd40c('0x4f')](_0x3d6ba6)){_0x83df8b=!![];return _0x1f1a8e[_0xd40c('0x50')](_0x3d6ba6,_0x2ac6dd,config[_0xd40c('0x51')][_0xd40c('0x52')])[_0xd40c('0x28')](function(){return _0x12f7f9;});}return _0x12f7f9;}})[_0xd40c('0x28')](function(_0x1ff36c){if(_0x1ff36c){var _0xe95e80=_0x1ff36c['savePath'];if(!fs[_0xd40c('0x4f')](_0xe95e80)){throw new db[(_0xd40c('0x53'))][(_0xd40c('0x54'))](_0xd40c('0x55'));}if(_0x1ff36c['filename']){return _0xe815bb['download'](_0xe95e80,_0x1ff36c[_0xd40c('0x4d')]+path['extname'](_0xe95e80),function(){if(_0x83df8b){fs[_0xd40c('0x56')](_0xe95e80);}});}else{return _0xe815bb['download'](_0xe95e80,function(_0x3f55f3){if(_0x83df8b){fs[_0xd40c('0x56')](_0xe95e80);}});}}})['catch'](function(_0x32e52c){if(_0x32e52c[_0xd40c('0x57')]==='SquareRecording\x20not\x20found'){_0xe815bb['status'](0x194)['send'](_0xd40c('0x58'));}else{return handleError(_0xe815bb,null);}});};exports[_0xd40c('0x59')]=function(_0x3dc9ea,_0x381dcc){return db['SquareRecording'][_0xd40c('0x46')]({'where':{'id':_0x3dc9ea[_0xd40c('0x45')]['id']}})[_0xd40c('0x28')](function(_0x93467b){if(_[_0xd40c('0x5a')](_0x93467b)){throw new ReferenceError(_0xd40c('0x5b'));}return _0x93467b;})[_0xd40c('0x28')](function(_0x50eef4){var _0x188dc3=_0x50eef4[_0xd40c('0x4c')];logger[_0xd40c('0x5c')]('cancellazione\x20fisica\x20documento\x20%s',_0x188dc3);if(!_[_0xd40c('0x5a')](_0x50eef4[_0xd40c('0x4c')])&&fs[_0xd40c('0x4f')](_0x188dc3)){logger[_0xd40c('0x5c')](_0xd40c('0x5d')+_0x188dc3+_0xd40c('0x5e'));fs['unlinkSync'](_0x188dc3);}_0x188dc3=_0x188dc3+_0xd40c('0x5f');if(!_[_0xd40c('0x5a')](_0x50eef4[_0xd40c('0x4c')])&&fs[_0xd40c('0x4f')](_0x188dc3)){logger[_0xd40c('0x5c')](_0xd40c('0x5d')+_0x188dc3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd40c('0x60')](_0x188dc3);}return _0x50eef4;})[_0xd40c('0x28')](function(_0x2324f3){if(!_0x2324f3)throw new InternalError();return _0x2324f3[_0xd40c('0x59')]();})[_0xd40c('0x28')](function(){_0x381dcc[_0xd40c('0x1d')](0xcc)[_0xd40c('0x1e')]();})[_0xd40c('0x47')](handleError(_0x381dcc,null));};
\ No newline at end of file
+var _0x3f28=['find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','order','sort','filter','merge','where','type','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f28,0xd3));var _0x83f2=function(_0x1e2071,_0x2da7fc){_0x1e2071=_0x1e2071-0x0;var _0x5355cf=_0x3f28[_0x1e2071];return _0x5355cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x83f2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83f2('0x1'));var moment=require(_0x83f2('0x2'));var BPromise=require(_0x83f2('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x83f2('0x4'));var sox=require(_0x83f2('0x5'));var csv=require('to-csv');var ejs=require(_0x83f2('0x6'));var fs=require('fs');var fs_extra=require(_0x83f2('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x83f2('0x8'));var jsforce=require(_0x83f2('0x9'));var deskjs=require(_0x83f2('0xa'));var toCsv=require(_0x83f2('0xb'));var querystring=require('querystring');var Papa=require(_0x83f2('0xc'));var Redis=require(_0x83f2('0xd'));var authService=require(_0x83f2('0xe'));var qs=require(_0x83f2('0xf'));var as=require(_0x83f2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x83f2('0x11'));var utils=require(_0x83f2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x83f2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b617f,_0x253f21){_0x253f21=_0x253f21||0xcc;return function(_0xbaaf07){if(_0xbaaf07){return _0x5b617f['sendStatus'](_0x253f21);}return _0x5b617f[_0x83f2('0x14')](_0x253f21)[_0x83f2('0x15')]();};}function respondWithResult(_0x1a5c19,_0x2003a4){_0x2003a4=_0x2003a4||0xc8;return function(_0x5b085c){if(_0x5b085c){return _0x1a5c19[_0x83f2('0x14')](_0x2003a4)[_0x83f2('0x16')](_0x5b085c);}};}function respondWithFilteredResult(_0x53bc89,_0x1496c9){return function(_0x50656d){if(_0x50656d){var _0x5aa201=typeof _0x1496c9[_0x83f2('0x17')]===_0x83f2('0x18')&&typeof _0x1496c9[_0x83f2('0x19')]===_0x83f2('0x18');var _0x189157=_0x50656d[_0x83f2('0x1a')];var _0x4351c9=_0x5aa201?0x0:_0x1496c9[_0x83f2('0x17')];var _0x5049ae=_0x5aa201?_0x50656d['count']:_0x1496c9[_0x83f2('0x17')]+_0x1496c9[_0x83f2('0x19')];var _0x306cbf;if(_0x5049ae>=_0x189157){_0x5049ae=_0x189157;_0x306cbf=0xc8;}else{_0x306cbf=0xce;}_0x53bc89['status'](_0x306cbf);return _0x53bc89[_0x83f2('0x1b')](_0x83f2('0x1c'),_0x4351c9+'-'+_0x5049ae+'/'+_0x189157)[_0x83f2('0x16')](_0x50656d);}return null;};}function patchUpdates(_0x3df68b){return function(_0x19a86a){try{jsonpatch[_0x83f2('0x1d')](_0x19a86a,_0x3df68b,!![]);}catch(_0xd323ff){return BPromise['reject'](_0xd323ff);}return _0x19a86a[_0x83f2('0x1e')]();};}function saveUpdates(_0x27b744,_0x19b110){return function(_0x194b94){if(_0x194b94){return _0x194b94['update'](_0x27b744)[_0x83f2('0x1f')](function(_0x19ded7){return _0x19ded7;});}return null;};}function removeEntity(_0x3cb8ba,_0x5b6940){return function(_0x4ab495){if(_0x4ab495){return _0x4ab495[_0x83f2('0x20')]()[_0x83f2('0x1f')](function(){_0x3cb8ba[_0x83f2('0x14')](0xcc)[_0x83f2('0x15')]();});}};}function handleEntityNotFound(_0x2fe3c6,_0x4db7c6){return function(_0x4a32fd){if(!_0x4a32fd){_0x2fe3c6[_0x83f2('0x21')](0x194);}return _0x4a32fd;};}function handleError(_0x54b39b,_0xc2acf8){_0xc2acf8=_0xc2acf8||0x1f4;return function(_0x10e39c){logger[_0x83f2('0x22')](_0x10e39c[_0x83f2('0x23')]);if(_0x10e39c[_0x83f2('0x24')]){delete _0x10e39c[_0x83f2('0x24')];}_0x54b39b[_0x83f2('0x14')](_0xc2acf8)['send'](_0x10e39c);};}exports[_0x83f2('0x25')]=function(_0x2c7a6c,_0x5d91a5){var _0x3f85a1={},_0x29704d={},_0x59b841={'count':0x0,'rows':[]};var _0x504f63=_[_0x83f2('0x26')](db['SquareRecording'][_0x83f2('0x27')],function(_0xa86fc){return{'name':_0xa86fc[_0x83f2('0x28')],'type':_0xa86fc['type']['key']};});_0x29704d[_0x83f2('0x29')]=_[_0x83f2('0x26')](_0x504f63,'name');_0x29704d[_0x83f2('0x2a')]=_[_0x83f2('0x2b')](_0x2c7a6c[_0x83f2('0x2a')]);_0x29704d[_0x83f2('0x2c')]=_[_0x83f2('0x2d')](_0x29704d['model'],_0x29704d[_0x83f2('0x2a')]);_0x3f85a1[_0x83f2('0x2e')]=_[_0x83f2('0x2d')](_0x29704d[_0x83f2('0x29')],qs['fields'](_0x2c7a6c[_0x83f2('0x2a')]['fields']));_0x3f85a1['attributes']=_0x3f85a1[_0x83f2('0x2e')][_0x83f2('0x2f')]?_0x3f85a1[_0x83f2('0x2e')]:_0x29704d['model'];if(!_0x2c7a6c[_0x83f2('0x2a')]['hasOwnProperty']('nolimit')){_0x3f85a1[_0x83f2('0x19')]=qs['limit'](_0x2c7a6c[_0x83f2('0x2a')]['limit']);_0x3f85a1[_0x83f2('0x17')]=qs[_0x83f2('0x17')](_0x2c7a6c[_0x83f2('0x2a')][_0x83f2('0x17')]);}_0x3f85a1[_0x83f2('0x30')]=qs[_0x83f2('0x31')](_0x2c7a6c[_0x83f2('0x2a')]['sort']);_0x3f85a1['where']=qs[_0x83f2('0x2c')](_['pick'](_0x2c7a6c['query'],_0x29704d[_0x83f2('0x2c')]),_0x504f63);if(_0x2c7a6c['query'][_0x83f2('0x32')]){_0x3f85a1['where']=_[_0x83f2('0x33')](_0x3f85a1[_0x83f2('0x34')],{'$or':_[_0x83f2('0x26')](_0x504f63,function(_0x5ec16d){if(_0x5ec16d[_0x83f2('0x35')]!==_0x83f2('0x36')){var _0x53d7c8={};_0x53d7c8[_0x5ec16d['name']]={'$like':'%'+_0x2c7a6c[_0x83f2('0x2a')][_0x83f2('0x32')]+'%'};return _0x53d7c8;}})});}_0x3f85a1=_[_0x83f2('0x33')]({},_0x3f85a1,_0x2c7a6c[_0x83f2('0x37')]);var _0x496bc0={'where':_0x3f85a1[_0x83f2('0x34')]};return db[_0x83f2('0x38')][_0x83f2('0x1a')](_0x496bc0)['then'](function(_0x4d6bed){_0x59b841['count']=_0x4d6bed;if(_0x2c7a6c[_0x83f2('0x2a')][_0x83f2('0x39')]){_0x3f85a1[_0x83f2('0x3a')]=[{'all':!![]}];}return db[_0x83f2('0x38')][_0x83f2('0x3b')](_0x3f85a1);})[_0x83f2('0x1f')](function(_0x5e6dd3){_0x59b841[_0x83f2('0x3c')]=_0x5e6dd3;return _0x59b841;})[_0x83f2('0x1f')](respondWithFilteredResult(_0x5d91a5,_0x3f85a1))[_0x83f2('0x3d')](handleError(_0x5d91a5,null));};exports[_0x83f2('0x3e')]=function(_0x60ebd6,_0x338f04){var _0x5ee87b={'raw':!![],'where':{'id':_0x60ebd6[_0x83f2('0x3f')]['id']}},_0x21e4fb={};_0x21e4fb[_0x83f2('0x29')]=_['keys'](db['SquareRecording'][_0x83f2('0x27')]);_0x21e4fb[_0x83f2('0x2a')]=_[_0x83f2('0x2b')](_0x60ebd6[_0x83f2('0x2a')]);_0x21e4fb[_0x83f2('0x2c')]=_[_0x83f2('0x2d')](_0x21e4fb['model'],_0x21e4fb[_0x83f2('0x2a')]);_0x5ee87b['attributes']=_[_0x83f2('0x2d')](_0x21e4fb[_0x83f2('0x29')],qs[_0x83f2('0x40')](_0x60ebd6[_0x83f2('0x2a')][_0x83f2('0x40')]));_0x5ee87b[_0x83f2('0x2e')]=_0x5ee87b[_0x83f2('0x2e')]['length']?_0x5ee87b['attributes']:_0x21e4fb[_0x83f2('0x29')];if(_0x60ebd6[_0x83f2('0x2a')][_0x83f2('0x39')]){_0x5ee87b[_0x83f2('0x3a')]=[{'all':!![]}];}_0x5ee87b=_[_0x83f2('0x33')]({},_0x5ee87b,_0x60ebd6[_0x83f2('0x37')]);return db[_0x83f2('0x38')][_0x83f2('0x41')](_0x5ee87b)[_0x83f2('0x1f')](handleEntityNotFound(_0x338f04,null))[_0x83f2('0x1f')](respondWithResult(_0x338f04,null))[_0x83f2('0x3d')](handleError(_0x338f04,null));};exports[_0x83f2('0x42')]=function(_0xa02de2,_0x7563b1){return db[_0x83f2('0x38')]['create'](_0xa02de2[_0x83f2('0x43')],{})['then'](respondWithResult(_0x7563b1,0xc9))[_0x83f2('0x3d')](handleError(_0x7563b1,null));};exports['update']=function(_0xfd4f73,_0x40ef23){if(_0xfd4f73[_0x83f2('0x43')]['id']){delete _0xfd4f73['body']['id'];}return db[_0x83f2('0x38')]['find']({'where':{'id':_0xfd4f73[_0x83f2('0x3f')]['id']}})[_0x83f2('0x1f')](handleEntityNotFound(_0x40ef23,null))['then'](saveUpdates(_0xfd4f73['body'],null))[_0x83f2('0x1f')](respondWithResult(_0x40ef23,null))['catch'](handleError(_0x40ef23,null));};exports[_0x83f2('0x44')]=function(_0x8c2ff7,_0x5bee38,_0x29dd0b){var _0x280707=require(_0x83f2('0x45'));var _0x55b0ff=![];var _0x1522fd={};if(_0x8c2ff7[_0x83f2('0x2a')][_0x83f2('0x35')]&&_0x8c2ff7['query']['type']===_0x83f2('0x46')){_0x1522fd[_0x83f2('0x46')]=_0x8c2ff7[_0x83f2('0x3f')]['id'];}else{_0x1522fd['id']=_0x8c2ff7[_0x83f2('0x3f')]['id'];}return db[_0x83f2('0x38')]['find']({'where':_0x1522fd,'attributes':['id',_0x83f2('0x47'),_0x83f2('0x48')],'raw':!![]})[_0x83f2('0x1f')](handleEntityNotFound(_0x5bee38,null))[_0x83f2('0x1f')](function(_0x17ae67){if(_0x17ae67){var _0x5298c2=_0x17ae67['savePath'];var _0x341dce=util[_0x83f2('0x49')](_0x83f2('0x4a'),_0x5298c2);if(fs[_0x83f2('0x4b')](_0x341dce)){_0x55b0ff=!![];return _0x280707[_0x83f2('0x4c')](_0x341dce,_0x5298c2,config['secrets'][_0x83f2('0x4d')])[_0x83f2('0x1f')](function(){return _0x17ae67;});}return _0x17ae67;}})[_0x83f2('0x1f')](function(_0x251e2a){if(_0x251e2a){var _0x49b18d=_0x251e2a[_0x83f2('0x47')];if(!fs[_0x83f2('0x4b')](_0x49b18d)){throw new db[(_0x83f2('0x4e'))][(_0x83f2('0x4f'))]('SquareRecording\x20not\x20found');}if(_0x251e2a[_0x83f2('0x48')]){return _0x5bee38[_0x83f2('0x44')](_0x49b18d,_0x251e2a[_0x83f2('0x48')]+path[_0x83f2('0x50')](_0x49b18d),function(){if(_0x55b0ff){fs['unlink'](_0x49b18d);}});}else{return _0x5bee38[_0x83f2('0x44')](_0x49b18d,function(_0x3a0f20){if(_0x55b0ff){fs[_0x83f2('0x51')](_0x49b18d);}});}}})[_0x83f2('0x3d')](function(_0x55d20e){if(_0x55d20e[_0x83f2('0x52')]===_0x83f2('0x53')){_0x5bee38[_0x83f2('0x14')](0x194)[_0x83f2('0x54')](_0x83f2('0x55'));}else{return handleError(_0x5bee38,null);}});};exports[_0x83f2('0x20')]=function(_0x366655,_0x323241){return db['SquareRecording'][_0x83f2('0x41')]({'where':{'id':_0x366655[_0x83f2('0x3f')]['id']}})[_0x83f2('0x1f')](function(_0x141086){if(_[_0x83f2('0x56')](_0x141086)){throw new ReferenceError(_0x83f2('0x57'));}return _0x141086;})[_0x83f2('0x1f')](function(_0x5cc0a8){var _0x57adf1=_0x5cc0a8[_0x83f2('0x47')];logger[_0x83f2('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x57adf1);if(!_['isNil'](_0x5cc0a8['savePath'])&&fs[_0x83f2('0x4b')](_0x57adf1)){logger['info'](_0x83f2('0x59')+_0x57adf1+_0x83f2('0x5a'));fs[_0x83f2('0x5b')](_0x57adf1);}_0x57adf1=_0x57adf1+'.cypher';if(!_['isNil'](_0x5cc0a8['savePath'])&&fs[_0x83f2('0x4b')](_0x57adf1)){logger[_0x83f2('0x58')](_0x83f2('0x59')+_0x57adf1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x83f2('0x5b')](_0x57adf1);}return _0x5cc0a8;})[_0x83f2('0x1f')](function(_0x172dd9){if(!_0x172dd9)throw new InternalError();return _0x172dd9[_0x83f2('0x20')]();})['then'](function(){_0x323241[_0x83f2('0x14')](0xcc)[_0x83f2('0x15')]();})[_0x83f2('0x3d')](handleError(_0x323241,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd916=['../../config/logger','api','moment','request-promise','path','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0xd916,0x18a));var _0x6d91=function(_0x35bb4b,_0x3a004a){_0x35bb4b=_0x35bb4b-0x0;var _0x1ccc40=_0xd916[_0x35bb4b];return _0x1ccc40;};'use strict';var _=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var logger=require(_0x6d91('0x2'))(_0x6d91('0x3'));var moment=require(_0x6d91('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d91('0x5'));var fs=require('fs');var path=require(_0x6d91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d91('0x7'));module[_0x6d91('0x8')]=function(_0x59c589,_0x1f5cfc){return _0x59c589[_0x6d91('0x9')](_0x6d91('0xa'),attributes,{'tableName':_0x6d91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fd4=['./squareRecording.attributes','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x58d982,_0x9467cc){var _0x11b787=function(_0x2cc2d9){while(--_0x2cc2d9){_0x58d982['push'](_0x58d982['shift']());}};_0x11b787(++_0x9467cc);}(_0x8fd4,0x178));var _0x48fd=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x8fd4[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var util=require(_0x48fd('0x0'));var logger=require(_0x48fd('0x1'))(_0x48fd('0x2'));var moment=require(_0x48fd('0x3'));var BPromise=require(_0x48fd('0x4'));var rp=require(_0x48fd('0x5'));var fs=require('fs');var path=require(_0x48fd('0x6'));var rimraf=require('rimraf');var config=require(_0x48fd('0x7'));var attributes=require(_0x48fd('0x8'));module['exports']=function(_0x2b7864,_0x1d3c43){return _0x2b7864[_0x48fd('0x9')](_0x48fd('0xa'),attributes,{'tableName':_0x48fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9da4=['code','message','result','catch','CreateSquareRecording','SquareRecording','body','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x161872,_0xea11d4){var _0x259cdd=function(_0x39378f){while(--_0x39378f){_0x161872['push'](_0x161872['shift']());}};_0x259cdd(++_0xea11d4);}(_0x9da4,0x70));var _0x49da=function(_0x110ea1,_0x46f592){_0x110ea1=_0x110ea1-0x0;var _0x4debae=_0x9da4[_0x110ea1];return _0x4debae;};'use strict';var _=require(_0x49da('0x0'));var util=require(_0x49da('0x1'));var moment=require(_0x49da('0x2'));var BPromise=require('bluebird');var rs=require(_0x49da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x49da('0x5'))('rpc');var config=require(_0x49da('0x6'));var jayson=require(_0x49da('0x7'));var client=jayson[_0x49da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbf544d,_0x1b37f8,_0x4bc914){return new BPromise(function(_0x44117c,_0xfdc363){return client[_0x49da('0x9')](_0xbf544d,_0x4bc914)[_0x49da('0xa')](function(_0x36d286){logger[_0x49da('0xb')](_0x49da('0xc'),_0x1b37f8,_0x49da('0xd'));logger[_0x49da('0xe')](_0x49da('0xf'),_0x1b37f8,_0x49da('0xd'),JSON[_0x49da('0x10')](_0x36d286));if(_0x36d286[_0x49da('0x11')]){if(_0x36d286[_0x49da('0x11')][_0x49da('0x12')]===0x1f4){logger['error'](_0x49da('0xc'),_0x1b37f8,_0x36d286[_0x49da('0x11')][_0x49da('0x13')]);return _0xfdc363(_0x36d286['error'][_0x49da('0x13')]);}logger[_0x49da('0x11')](_0x49da('0xc'),_0x1b37f8,_0x36d286[_0x49da('0x11')]['message']);return _0x44117c(_0x36d286[_0x49da('0x11')]['message']);}else{logger[_0x49da('0xb')]('SquareRecording,\x20%s,\x20%s',_0x1b37f8,'request\x20sent');_0x44117c(_0x36d286[_0x49da('0x14')][_0x49da('0x13')]);}})[_0x49da('0x15')](function(_0x208ff5){logger['error'](_0x49da('0xc'),_0x1b37f8,_0x208ff5);_0xfdc363(_0x208ff5);});});}exports[_0x49da('0x16')]=function(_0x3af81b){var _0x3b9055=this;return new Promise(function(_0x3d9ecd,_0x129741){return db[_0x49da('0x17')]['create'](_0x3af81b[_0x49da('0x18')],{'raw':_0x3af81b['options']?_0x3af81b['options'][_0x49da('0x19')]===undefined?!![]:![]:!![]})[_0x49da('0xa')](function(_0x545544){logger['info'](_0x49da('0x16'),_0x3af81b);logger[_0x49da('0xe')]('CreateSquareRecording',_0x3af81b,JSON[_0x49da('0x10')](_0x545544));_0x3d9ecd(_0x545544);})[_0x49da('0x15')](function(_0x47416b){logger[_0x49da('0x11')](_0x49da('0x16'),_0x47416b[_0x49da('0x13')],_0x3af81b);_0x129741(_0x3b9055[_0x49da('0x11')](0x1f4,_0x47416b[_0x49da('0x13')]));});});};
\ No newline at end of file
+var _0x6af5=['request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x6ce3cc,_0x115ced){var _0x54e4a2=function(_0x9f8276){while(--_0x9f8276){_0x6ce3cc['push'](_0x6ce3cc['shift']());}};_0x54e4a2(++_0x115ced);}(_0x6af5,0x154));var _0x56af=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x6af5[_0x5834bc];return _0x3e183a;};'use strict';var _=require('lodash');var util=require(_0x56af('0x0'));var moment=require(_0x56af('0x1'));var BPromise=require(_0x56af('0x2'));var rs=require(_0x56af('0x3'));var fs=require('fs');var Redis=require(_0x56af('0x4'));var db=require(_0x56af('0x5'))['db'];var utils=require(_0x56af('0x6'));var logger=require(_0x56af('0x7'))('rpc');var config=require(_0x56af('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56af('0x9')][_0x56af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4978ca,_0x1bbc47,_0x5cfebb){return new BPromise(function(_0x507d66,_0x1d297d){return client[_0x56af('0xb')](_0x4978ca,_0x5cfebb)[_0x56af('0xc')](function(_0x5a7032){logger[_0x56af('0xd')](_0x56af('0xe'),_0x1bbc47,_0x56af('0xf'));logger[_0x56af('0x10')](_0x56af('0x11'),_0x1bbc47,'request\x20sent',JSON[_0x56af('0x12')](_0x5a7032));if(_0x5a7032[_0x56af('0x13')]){if(_0x5a7032[_0x56af('0x13')][_0x56af('0x14')]===0x1f4){logger['error'](_0x56af('0xe'),_0x1bbc47,_0x5a7032[_0x56af('0x13')][_0x56af('0x15')]);return _0x1d297d(_0x5a7032[_0x56af('0x13')][_0x56af('0x15')]);}logger['error'](_0x56af('0xe'),_0x1bbc47,_0x5a7032[_0x56af('0x13')][_0x56af('0x15')]);return _0x507d66(_0x5a7032[_0x56af('0x13')][_0x56af('0x15')]);}else{logger[_0x56af('0xd')](_0x56af('0xe'),_0x1bbc47,'request\x20sent');_0x507d66(_0x5a7032[_0x56af('0x16')]['message']);}})[_0x56af('0x17')](function(_0x5bc979){logger[_0x56af('0x13')](_0x56af('0xe'),_0x1bbc47,_0x5bc979);_0x1d297d(_0x5bc979);});});}exports[_0x56af('0x18')]=function(_0x401cee){var _0x4c33f6=this;return new Promise(function(_0x49a047,_0x3367d2){return db['SquareRecording'][_0x56af('0x19')](_0x401cee[_0x56af('0x1a')],{'raw':_0x401cee['options']?_0x401cee['options']['raw']===undefined?!![]:![]:!![]})[_0x56af('0xc')](function(_0x5b2c2a){logger['info']('CreateSquareRecording',_0x401cee);logger['debug']('CreateSquareRecording',_0x401cee,JSON['stringify'](_0x5b2c2a));_0x49a047(_0x5b2c2a);})[_0x56af('0x17')](function(_0x3f81d6){logger['error'](_0x56af('0x18'),_0x3f81d6[_0x56af('0x15')],_0x401cee);_0x3367d2(_0x4c33f6['error'](0x1f4,_0x3f81d6[_0x56af('0x15')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x56c24a,_0x1787b8){var _0x1e3bdf=function(_0x25762d){while(--_0x25762d){_0x56c24a['push'](_0x56c24a['shift']());}};_0x1e3bdf(++_0x1787b8);}(_0xe706,0xa3));var _0x6e70=function(_0x9d58e0,_0x5ee515){_0x9d58e0=_0x9d58e0-0x0;var _0x5eab07=_0xe706[_0x9d58e0];return _0x5eab07;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
+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(_0x140b08,_0x499ded){var _0x37d020=function(_0x58a6ed){while(--_0x58a6ed){_0x140b08['push'](_0x140b08['shift']());}};_0x37d020(++_0x499ded);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.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
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8a0=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0xf8a0,0xe4));var _0x0f8a=function(_0x26c7d3,_0x31be42){_0x26c7d3=_0x26c7d3-0x0;var _0x430566=_0xf8a0[_0x26c7d3];return _0x430566;};'use strict';var Sequelize=require(_0x0f8a('0x0'));module['exports']={'network':{'type':Sequelize[_0x0f8a('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0f8a('0x1')]},'channel':{'type':Sequelize[_0x0f8a('0x1')]},'language':{'type':Sequelize[_0x0f8a('0x1')]},'type':{'type':Sequelize[_0x0f8a('0x1')]},'uniqueid':{'type':Sequelize[_0x0f8a('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0f8a('0x1')]},'callingpres':{'type':Sequelize[_0x0f8a('0x1')]},'callingani2':{'type':Sequelize[_0x0f8a('0x1')]},'callington':{'type':Sequelize[_0x0f8a('0x1')]},'callingtns':{'type':Sequelize[_0x0f8a('0x1')]},'dnid':{'type':Sequelize[_0x0f8a('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0f8a('0x1')]},'extension':{'type':Sequelize[_0x0f8a('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0f8a('0x1')]},'accountcode':{'type':Sequelize[_0x0f8a('0x1')]},'threadid':{'type':Sequelize[_0x0f8a('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0f8a('0x2')]},'leaveAt':{'type':Sequelize[_0x0f8a('0x2')]},'bot':{'type':Sequelize[_0x0f8a('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9662=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x5ac3c1,_0x21d8e2){var _0xfcb2b6=function(_0x3fcf98){while(--_0x3fcf98){_0x5ac3c1['push'](_0x5ac3c1['shift']());}};_0xfcb2b6(++_0x21d8e2);}(_0x9662,0x68));var _0x2966=function(_0x9691dd,_0x1a4b6e){_0x9691dd=_0x9691dd-0x0;var _0x331cb6=_0x9662[_0x9691dd];return _0x331cb6;};'use strict';var Sequelize=require(_0x2966('0x0'));module[_0x2966('0x1')]={'network':{'type':Sequelize[_0x2966('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x2966('0x2')]},'channel':{'type':Sequelize[_0x2966('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2966('0x2')]},'uniqueid':{'type':Sequelize[_0x2966('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x2966('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x2966('0x2')]},'callingani2':{'type':Sequelize[_0x2966('0x2')]},'callington':{'type':Sequelize[_0x2966('0x2')]},'callingtns':{'type':Sequelize[_0x2966('0x2')]},'dnid':{'type':Sequelize[_0x2966('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2966('0x2')]},'extension':{'type':Sequelize[_0x2966('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x2966('0x2')]},'accountcode':{'type':Sequelize[_0x2966('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x2966('0x2')]},'joinAt':{'type':Sequelize[_0x2966('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x2966('0x4')],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f1d=['end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','SquareReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus'];(function(_0x4493ef,_0x3b999b){var _0x2de519=function(_0x4615f9){while(--_0x4615f9){_0x4493ef['push'](_0x4493ef['shift']());}};_0x2de519(++_0x3b999b);}(_0x8f1d,0xc3));var _0xd8f1=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x8f1d[_0x102b0c];return _0x9b15ca;};'use strict';var emlformat=require(_0xd8f1('0x0'));var rimraf=require(_0xd8f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f1('0x2'));var rp=require(_0xd8f1('0x3'));var moment=require(_0xd8f1('0x4'));var BPromise=require(_0xd8f1('0x5'));var Mustache=require(_0xd8f1('0x6'));var util=require('util');var path=require(_0xd8f1('0x7'));var sox=require(_0xd8f1('0x8'));var csv=require(_0xd8f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8f1('0xa'));var squel=require(_0xd8f1('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd8f1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8f1('0xd'));var authService=require(_0xd8f1('0xe'));var qs=require(_0xd8f1('0xf'));var as=require(_0xd8f1('0x10'));var hardwareService=require(_0xd8f1('0x11'));var logger=require(_0xd8f1('0x12'))(_0xd8f1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xccbb19,_0x3d5dfd){_0x3d5dfd=_0x3d5dfd||0xcc;return function(_0x2effc8){if(_0x2effc8){return _0xccbb19[_0xd8f1('0x14')](_0x3d5dfd);}return _0xccbb19['status'](_0x3d5dfd)[_0xd8f1('0x15')]();};}function respondWithResult(_0xd45361,_0x3f7289){_0x3f7289=_0x3f7289||0xc8;return function(_0x199ec8){if(_0x199ec8){return _0xd45361[_0xd8f1('0x16')](_0x3f7289)['json'](_0x199ec8);}};}function respondWithFilteredResult(_0x15f09f,_0x27d7ff){return function(_0x40e393){if(_0x40e393){var _0x3fb518=typeof _0x27d7ff['offset']===_0xd8f1('0x17')&&typeof _0x27d7ff[_0xd8f1('0x18')]===_0xd8f1('0x17');var _0x3c31cd=_0x40e393['count'];var _0x556971=_0x3fb518?0x0:_0x27d7ff['offset'];var _0x2669c7=_0x3fb518?_0x40e393[_0xd8f1('0x19')]:_0x27d7ff[_0xd8f1('0x1a')]+_0x27d7ff[_0xd8f1('0x18')];var _0x142961;if(_0x2669c7>=_0x3c31cd){_0x2669c7=_0x3c31cd;_0x142961=0xc8;}else{_0x142961=0xce;}_0x15f09f[_0xd8f1('0x16')](_0x142961);return _0x15f09f[_0xd8f1('0x1b')]('Content-Range',_0x556971+'-'+_0x2669c7+'/'+_0x3c31cd)[_0xd8f1('0x1c')](_0x40e393);}return null;};}function patchUpdates(_0xfe2cb0){return function(_0x11fba2){try{jsonpatch[_0xd8f1('0x1d')](_0x11fba2,_0xfe2cb0,!![]);}catch(_0x12a87){return BPromise[_0xd8f1('0x1e')](_0x12a87);}return _0x11fba2[_0xd8f1('0x1f')]();};}function saveUpdates(_0x2acb4a,_0x2f9b07){return function(_0x199d4e){if(_0x199d4e){return _0x199d4e[_0xd8f1('0x20')](_0x2acb4a)[_0xd8f1('0x21')](function(_0x2013f1){return _0x2013f1;});}return null;};}function removeEntity(_0x35cfb6,_0x38db26){return function(_0x1f0451){if(_0x1f0451){return _0x1f0451[_0xd8f1('0x22')]()[_0xd8f1('0x21')](function(){_0x35cfb6[_0xd8f1('0x16')](0xcc)[_0xd8f1('0x15')]();});}};}function handleEntityNotFound(_0x279c6a,_0x3f1511){return function(_0x1c0390){if(!_0x1c0390){_0x279c6a[_0xd8f1('0x14')](0x194);}return _0x1c0390;};}function handleError(_0x36da8c,_0x1bd022){_0x1bd022=_0x1bd022||0x1f4;return function(_0xf3efe0){logger[_0xd8f1('0x23')](_0xf3efe0['stack']);if(_0xf3efe0[_0xd8f1('0x24')]){delete _0xf3efe0[_0xd8f1('0x24')];}_0x36da8c['status'](_0x1bd022)[_0xd8f1('0x25')](_0xf3efe0);};}exports[_0xd8f1('0x26')]=function(_0x1640a4,_0x5985b3){var _0x5b3f3c={},_0x1327de={},_0x38f6e1={'count':0x0,'rows':[]};var _0x5cffb8=_[_0xd8f1('0x27')](db['SquareReport'][_0xd8f1('0x28')],function(_0x1fae2c){return{'name':_0x1fae2c[_0xd8f1('0x29')],'type':_0x1fae2c['type']['key']};});_0x1327de[_0xd8f1('0x2a')]=_[_0xd8f1('0x27')](_0x5cffb8,'name');_0x1327de[_0xd8f1('0x2b')]=_[_0xd8f1('0x2c')](_0x1640a4[_0xd8f1('0x2b')]);_0x1327de[_0xd8f1('0x2d')]=_[_0xd8f1('0x2e')](_0x1327de[_0xd8f1('0x2a')],_0x1327de[_0xd8f1('0x2b')]);_0x5b3f3c[_0xd8f1('0x2f')]=_['intersection'](_0x1327de[_0xd8f1('0x2a')],qs[_0xd8f1('0x30')](_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x30')]));_0x5b3f3c[_0xd8f1('0x2f')]=_0x5b3f3c[_0xd8f1('0x2f')][_0xd8f1('0x31')]?_0x5b3f3c[_0xd8f1('0x2f')]:_0x1327de[_0xd8f1('0x2a')];if(!_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x32')](_0xd8f1('0x33'))){_0x5b3f3c[_0xd8f1('0x18')]=qs[_0xd8f1('0x18')](_0x1640a4[_0xd8f1('0x2b')]['limit']);_0x5b3f3c['offset']=qs[_0xd8f1('0x1a')](_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x1a')]);}_0x5b3f3c['order']=qs['sort'](_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x34')]);_0x5b3f3c[_0xd8f1('0x35')]=qs['filters'](_[_0xd8f1('0x36')](_0x1640a4[_0xd8f1('0x2b')],_0x1327de['filters']),_0x5cffb8);if(_0x1640a4['query'][_0xd8f1('0x37')]){_0x5b3f3c[_0xd8f1('0x35')]=_[_0xd8f1('0x38')](_0x5b3f3c[_0xd8f1('0x35')],{'$or':_['map'](_0x5cffb8,function(_0x705881){if(_0x705881[_0xd8f1('0x39')]!==_0xd8f1('0x3a')){var _0x1b5336={};_0x1b5336[_0x705881['name']]={'$like':'%'+_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x37')]+'%'};return _0x1b5336;}})});}_0x5b3f3c=_[_0xd8f1('0x38')]({},_0x5b3f3c,_0x1640a4['options']);var _0x985e4b={'where':_0x5b3f3c[_0xd8f1('0x35')]};return db[_0xd8f1('0x3b')][_0xd8f1('0x19')](_0x985e4b)[_0xd8f1('0x21')](function(_0x105d16){_0x38f6e1[_0xd8f1('0x19')]=_0x105d16;if(_0x1640a4[_0xd8f1('0x2b')][_0xd8f1('0x3c')]){_0x5b3f3c[_0xd8f1('0x3d')]=[{'all':!![]}];}return db[_0xd8f1('0x3b')][_0xd8f1('0x3e')](_0x5b3f3c);})[_0xd8f1('0x21')](function(_0x32396d){_0x38f6e1[_0xd8f1('0x3f')]=_0x32396d;return _0x38f6e1;})['then'](respondWithFilteredResult(_0x5985b3,_0x5b3f3c))[_0xd8f1('0x40')](handleError(_0x5985b3,null));};exports[_0xd8f1('0x41')]=function(_0x3adc9f,_0x1ecfbb){var _0x5c42d1={'raw':!![],'where':{'id':_0x3adc9f[_0xd8f1('0x42')]['id']}},_0x5886d={};_0x5886d[_0xd8f1('0x2a')]=_[_0xd8f1('0x2c')](db[_0xd8f1('0x3b')]['rawAttributes']);_0x5886d[_0xd8f1('0x2b')]=_['keys'](_0x3adc9f[_0xd8f1('0x2b')]);_0x5886d[_0xd8f1('0x2d')]=_[_0xd8f1('0x2e')](_0x5886d[_0xd8f1('0x2a')],_0x5886d[_0xd8f1('0x2b')]);_0x5c42d1[_0xd8f1('0x2f')]=_[_0xd8f1('0x2e')](_0x5886d['model'],qs['fields'](_0x3adc9f[_0xd8f1('0x2b')][_0xd8f1('0x30')]));_0x5c42d1['attributes']=_0x5c42d1['attributes'][_0xd8f1('0x31')]?_0x5c42d1[_0xd8f1('0x2f')]:_0x5886d[_0xd8f1('0x2a')];if(_0x3adc9f['query'][_0xd8f1('0x3c')]){_0x5c42d1[_0xd8f1('0x3d')]=[{'all':!![]}];}_0x5c42d1=_[_0xd8f1('0x38')]({},_0x5c42d1,_0x3adc9f[_0xd8f1('0x43')]);return db['SquareReport'][_0xd8f1('0x44')](_0x5c42d1)[_0xd8f1('0x21')](handleEntityNotFound(_0x1ecfbb,null))[_0xd8f1('0x21')](respondWithResult(_0x1ecfbb,null))[_0xd8f1('0x40')](handleError(_0x1ecfbb,null));};exports[_0xd8f1('0x45')]=function(_0x44fd27,_0x1f4981){return db[_0xd8f1('0x3b')][_0xd8f1('0x45')](_0x44fd27[_0xd8f1('0x46')],{})[_0xd8f1('0x21')](respondWithResult(_0x1f4981,0xc9))['catch'](handleError(_0x1f4981,null));};exports['update']=function(_0x5ae09f,_0x334191){if(_0x5ae09f['body']['id']){delete _0x5ae09f[_0xd8f1('0x46')]['id'];}return db[_0xd8f1('0x3b')]['find']({'where':{'id':_0x5ae09f['params']['id']}})[_0xd8f1('0x21')](handleEntityNotFound(_0x334191,null))[_0xd8f1('0x21')](saveUpdates(_0x5ae09f['body'],null))[_0xd8f1('0x21')](respondWithResult(_0x334191,null))[_0xd8f1('0x40')](handleError(_0x334191,null));};exports[_0xd8f1('0x22')]=function(_0x19a780,_0x1720b0){return db[_0xd8f1('0x3b')][_0xd8f1('0x44')]({'where':{'id':_0x19a780[_0xd8f1('0x42')]['id']}})[_0xd8f1('0x21')](handleEntityNotFound(_0x1720b0,null))[_0xd8f1('0x21')](removeEntity(_0x1720b0,null))[_0xd8f1('0x40')](handleError(_0x1720b0,null));};exports['describe']=function(_0x354b20,_0x5e16e7){return db[_0xd8f1('0x3b')][_0xd8f1('0x47')]()[_0xd8f1('0x21')](respondWithResult(_0x5e16e7,null))[_0xd8f1('0x40')](handleError(_0x5e16e7,null));};
\ No newline at end of file
+var _0x705a=['catch','show','intersection','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','save','update','then','error','stack','send','index','map','SquareReport','rawAttributes','fieldName','key','model','name','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','rows'];(function(_0x26cc2e,_0x1eae84){var _0x19c77c=function(_0x2bb24d){while(--_0x2bb24d){_0x26cc2e['push'](_0x26cc2e['shift']());}};_0x19c77c(++_0x1eae84);}(_0x705a,0x162));var _0xa705=function(_0x1f0342,_0x1c93eb){_0x1f0342=_0x1f0342-0x0;var _0x40115d=_0x705a[_0x1f0342];return _0x40115d;};'use strict';var emlformat=require(_0xa705('0x0'));var rimraf=require(_0xa705('0x1'));var zipdir=require(_0xa705('0x2'));var jsonpatch=require(_0xa705('0x3'));var rp=require(_0xa705('0x4'));var moment=require(_0xa705('0x5'));var BPromise=require(_0xa705('0x6'));var Mustache=require(_0xa705('0x7'));var util=require(_0xa705('0x8'));var path=require(_0xa705('0x9'));var sox=require('sox');var csv=require(_0xa705('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa705('0xb'));var jsforce=require(_0xa705('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa705('0xa'));var querystring=require(_0xa705('0xd'));var Papa=require('papaparse');var Redis=require(_0xa705('0xe'));var authService=require(_0xa705('0xf'));var qs=require(_0xa705('0x10'));var as=require(_0xa705('0x11'));var hardwareService=require(_0xa705('0x12'));var logger=require('../../config/logger')(_0xa705('0x13'));var utils=require(_0xa705('0x14'));var config=require(_0xa705('0x15'));var licenseUtil=require(_0xa705('0x16'));var db=require(_0xa705('0x17'))['db'];function respondWithStatusCode(_0x4d0660,_0x246b59){_0x246b59=_0x246b59||0xcc;return function(_0x40013d){if(_0x40013d){return _0x4d0660[_0xa705('0x18')](_0x246b59);}return _0x4d0660[_0xa705('0x19')](_0x246b59)[_0xa705('0x1a')]();};}function respondWithResult(_0x5ee961,_0x41a7b0){_0x41a7b0=_0x41a7b0||0xc8;return function(_0x27b26b){if(_0x27b26b){return _0x5ee961[_0xa705('0x19')](_0x41a7b0)['json'](_0x27b26b);}};}function respondWithFilteredResult(_0x10eb92,_0x2b7674){return function(_0x151746){if(_0x151746){var _0x4e0350=typeof _0x2b7674['offset']===_0xa705('0x1b')&&typeof _0x2b7674[_0xa705('0x1c')]===_0xa705('0x1b');var _0x1ac6a7=_0x151746[_0xa705('0x1d')];var _0x4621a0=_0x4e0350?0x0:_0x2b7674['offset'];var _0x3a1056=_0x4e0350?_0x151746[_0xa705('0x1d')]:_0x2b7674[_0xa705('0x1e')]+_0x2b7674['limit'];var _0xa0169d;if(_0x3a1056>=_0x1ac6a7){_0x3a1056=_0x1ac6a7;_0xa0169d=0xc8;}else{_0xa0169d=0xce;}_0x10eb92['status'](_0xa0169d);return _0x10eb92['set']('Content-Range',_0x4621a0+'-'+_0x3a1056+'/'+_0x1ac6a7)[_0xa705('0x1f')](_0x151746);}return null;};}function patchUpdates(_0x1895d8){return function(_0x335129){try{jsonpatch[_0xa705('0x20')](_0x335129,_0x1895d8,!![]);}catch(_0x2115d3){return BPromise['reject'](_0x2115d3);}return _0x335129[_0xa705('0x21')]();};}function saveUpdates(_0x99451b,_0x5b5f1a){return function(_0x3390ff){if(_0x3390ff){return _0x3390ff[_0xa705('0x22')](_0x99451b)[_0xa705('0x23')](function(_0xd39cbe){return _0xd39cbe;});}return null;};}function removeEntity(_0x46ed3d,_0x479993){return function(_0x4f5320){if(_0x4f5320){return _0x4f5320['destroy']()[_0xa705('0x23')](function(){_0x46ed3d['status'](0xcc)[_0xa705('0x1a')]();});}};}function handleEntityNotFound(_0x23730a,_0x5491bb){return function(_0x4675e0){if(!_0x4675e0){_0x23730a[_0xa705('0x18')](0x194);}return _0x4675e0;};}function handleError(_0xd2b369,_0x424f0a){_0x424f0a=_0x424f0a||0x1f4;return function(_0x49a7c2){logger[_0xa705('0x24')](_0x49a7c2[_0xa705('0x25')]);if(_0x49a7c2['name']){delete _0x49a7c2['name'];}_0xd2b369[_0xa705('0x19')](_0x424f0a)[_0xa705('0x26')](_0x49a7c2);};}exports[_0xa705('0x27')]=function(_0x141bcc,_0xa5da58){var _0x3a5a88={},_0x12a69f={},_0x361c0a={'count':0x0,'rows':[]};var _0x52f829=_[_0xa705('0x28')](db[_0xa705('0x29')][_0xa705('0x2a')],function(_0x1b1891){return{'name':_0x1b1891[_0xa705('0x2b')],'type':_0x1b1891['type'][_0xa705('0x2c')]};});_0x12a69f[_0xa705('0x2d')]=_[_0xa705('0x28')](_0x52f829,_0xa705('0x2e'));_0x12a69f['query']=_[_0xa705('0x2f')](_0x141bcc[_0xa705('0x30')]);_0x12a69f[_0xa705('0x31')]=_['intersection'](_0x12a69f[_0xa705('0x2d')],_0x12a69f[_0xa705('0x30')]);_0x3a5a88[_0xa705('0x32')]=_['intersection'](_0x12a69f[_0xa705('0x2d')],qs[_0xa705('0x33')](_0x141bcc[_0xa705('0x30')]['fields']));_0x3a5a88['attributes']=_0x3a5a88[_0xa705('0x32')]['length']?_0x3a5a88[_0xa705('0x32')]:_0x12a69f[_0xa705('0x2d')];if(!_0x141bcc[_0xa705('0x30')][_0xa705('0x34')](_0xa705('0x35'))){_0x3a5a88[_0xa705('0x1c')]=qs[_0xa705('0x1c')](_0x141bcc[_0xa705('0x30')][_0xa705('0x1c')]);_0x3a5a88['offset']=qs[_0xa705('0x1e')](_0x141bcc[_0xa705('0x30')][_0xa705('0x1e')]);}_0x3a5a88['order']=qs[_0xa705('0x36')](_0x141bcc[_0xa705('0x30')][_0xa705('0x36')]);_0x3a5a88[_0xa705('0x37')]=qs[_0xa705('0x31')](_['pick'](_0x141bcc[_0xa705('0x30')],_0x12a69f[_0xa705('0x31')]),_0x52f829);if(_0x141bcc[_0xa705('0x30')][_0xa705('0x38')]){_0x3a5a88[_0xa705('0x37')]=_[_0xa705('0x39')](_0x3a5a88[_0xa705('0x37')],{'$or':_[_0xa705('0x28')](_0x52f829,function(_0x7cefc3){if(_0x7cefc3['type']!=='VIRTUAL'){var _0x2154e7={};_0x2154e7[_0x7cefc3[_0xa705('0x2e')]]={'$like':'%'+_0x141bcc[_0xa705('0x30')][_0xa705('0x38')]+'%'};return _0x2154e7;}})});}_0x3a5a88=_[_0xa705('0x39')]({},_0x3a5a88,_0x141bcc[_0xa705('0x3a')]);var _0x703869={'where':_0x3a5a88[_0xa705('0x37')]};return db[_0xa705('0x29')][_0xa705('0x1d')](_0x703869)['then'](function(_0x487b2e){_0x361c0a[_0xa705('0x1d')]=_0x487b2e;if(_0x141bcc[_0xa705('0x30')]['includeAll']){_0x3a5a88['include']=[{'all':!![]}];}return db[_0xa705('0x29')]['findAll'](_0x3a5a88);})[_0xa705('0x23')](function(_0x465718){_0x361c0a[_0xa705('0x3b')]=_0x465718;return _0x361c0a;})['then'](respondWithFilteredResult(_0xa5da58,_0x3a5a88))[_0xa705('0x3c')](handleError(_0xa5da58,null));};exports[_0xa705('0x3d')]=function(_0x2f3275,_0xc75ce0){var _0x4a638d={'raw':!![],'where':{'id':_0x2f3275['params']['id']}},_0x27824c={};_0x27824c['model']=_[_0xa705('0x2f')](db[_0xa705('0x29')][_0xa705('0x2a')]);_0x27824c[_0xa705('0x30')]=_[_0xa705('0x2f')](_0x2f3275['query']);_0x27824c[_0xa705('0x31')]=_['intersection'](_0x27824c[_0xa705('0x2d')],_0x27824c[_0xa705('0x30')]);_0x4a638d['attributes']=_[_0xa705('0x3e')](_0x27824c[_0xa705('0x2d')],qs[_0xa705('0x33')](_0x2f3275[_0xa705('0x30')][_0xa705('0x33')]));_0x4a638d[_0xa705('0x32')]=_0x4a638d[_0xa705('0x32')]['length']?_0x4a638d[_0xa705('0x32')]:_0x27824c[_0xa705('0x2d')];if(_0x2f3275[_0xa705('0x30')][_0xa705('0x3f')]){_0x4a638d['include']=[{'all':!![]}];}_0x4a638d=_['merge']({},_0x4a638d,_0x2f3275[_0xa705('0x3a')]);return db[_0xa705('0x29')][_0xa705('0x40')](_0x4a638d)[_0xa705('0x23')](handleEntityNotFound(_0xc75ce0,null))[_0xa705('0x23')](respondWithResult(_0xc75ce0,null))[_0xa705('0x3c')](handleError(_0xc75ce0,null));};exports['create']=function(_0x3f0849,_0xd0c7b8){return db[_0xa705('0x29')][_0xa705('0x41')](_0x3f0849[_0xa705('0x42')],{})['then'](respondWithResult(_0xd0c7b8,0xc9))[_0xa705('0x3c')](handleError(_0xd0c7b8,null));};exports['update']=function(_0x3ffd13,_0x36e48e){if(_0x3ffd13[_0xa705('0x42')]['id']){delete _0x3ffd13['body']['id'];}return db['SquareReport'][_0xa705('0x40')]({'where':{'id':_0x3ffd13[_0xa705('0x43')]['id']}})[_0xa705('0x23')](handleEntityNotFound(_0x36e48e,null))[_0xa705('0x23')](saveUpdates(_0x3ffd13[_0xa705('0x42')],null))[_0xa705('0x23')](respondWithResult(_0x36e48e,null))['catch'](handleError(_0x36e48e,null));};exports['destroy']=function(_0x2e6031,_0x5a7dfe){return db[_0xa705('0x29')]['find']({'where':{'id':_0x2e6031[_0xa705('0x43')]['id']}})[_0xa705('0x23')](handleEntityNotFound(_0x5a7dfe,null))[_0xa705('0x23')](removeEntity(_0x5a7dfe,null))['catch'](handleError(_0x5a7dfe,null));};exports[_0xa705('0x44')]=function(_0x5164b3,_0x17524a){return db[_0xa705('0x29')][_0xa705('0x44')]()[_0xa705('0x23')](respondWithResult(_0x17524a,null))[_0xa705('0x3c')](handleError(_0x17524a,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21a9=['SquareReport','report_square','uid_pname','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x21a9,0xa9));var _0x921a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x21a9[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x921a('0x0'));var util=require(_0x921a('0x1'));var logger=require(_0x921a('0x2'))(_0x921a('0x3'));var moment=require(_0x921a('0x4'));var BPromise=require(_0x921a('0x5'));var rp=require(_0x921a('0x6'));var fs=require('fs');var path=require(_0x921a('0x7'));var rimraf=require('rimraf');var config=require(_0x921a('0x8'));var attributes=require(_0x921a('0x9'));module[_0x921a('0xa')]=function(_0x18b4e4,_0x2f16d2){return _0x18b4e4['define'](_0x921a('0xb'),attributes,{'tableName':_0x921a('0xc'),'paranoid':![],'indexes':[{'name':_0x921a('0xd'),'fields':['uniqueid','project_name']},{'name':_0x921a('0xe'),'fields':[_0x921a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcff6=['path','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uid_pname','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2fae0e,_0x45dfbf){var _0x14c255=function(_0x582382){while(--_0x582382){_0x2fae0e['push'](_0x2fae0e['shift']());}};_0x14c255(++_0x45dfbf);}(_0xcff6,0x1bc));var _0x6cff=function(_0x318a06,_0x32c5ac){_0x318a06=_0x318a06-0x0;var _0x552d7b=_0xcff6[_0x318a06];return _0x552d7b;};'use strict';var _=require(_0x6cff('0x0'));var util=require('util');var logger=require(_0x6cff('0x1'))(_0x6cff('0x2'));var moment=require(_0x6cff('0x3'));var BPromise=require(_0x6cff('0x4'));var rp=require(_0x6cff('0x5'));var fs=require('fs');var path=require(_0x6cff('0x6'));var rimraf=require(_0x6cff('0x7'));var config=require(_0x6cff('0x8'));var attributes=require(_0x6cff('0x9'));module['exports']=function(_0x473c35,_0x33c0bd){return _0x473c35[_0x6cff('0xa')]('SquareReport',attributes,{'tableName':_0x6cff('0xb'),'paranoid':![],'indexes':[{'name':_0x6cff('0xc'),'fields':['uniqueid',_0x6cff('0xd')]},{'name':_0x6cff('0xe'),'fields':[_0x6cff('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x218b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateSquareReport','create','body','options','catch','UpdateSquareReport','SquareReport','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1ec7bb,_0x287217){var _0x13abfe=function(_0x541a67){while(--_0x541a67){_0x1ec7bb['push'](_0x1ec7bb['shift']());}};_0x13abfe(++_0x287217);}(_0x218b,0x124));var _0xb218=function(_0x1f9328,_0x3c43d7){_0x1f9328=_0x1f9328-0x0;var _0x25bd6f=_0x218b[_0x1f9328];return _0x25bd6f;};'use strict';var _=require(_0xb218('0x0'));var util=require('util');var moment=require(_0xb218('0x1'));var BPromise=require(_0xb218('0x2'));var rs=require(_0xb218('0x3'));var fs=require('fs');var Redis=require(_0xb218('0x4'));var db=require(_0xb218('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb218('0x6'))(_0xb218('0x7'));var config=require(_0xb218('0x8'));var jayson=require(_0xb218('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb8a5,_0x3f30e1,_0xe92ebe){return new BPromise(function(_0x214503,_0x3bd9c6){return client[_0xb218('0xa')](_0x2bb8a5,_0xe92ebe)[_0xb218('0xb')](function(_0x3e967a){logger['info'](_0xb218('0xc'),_0x3f30e1,'request\x20sent');logger[_0xb218('0xd')](_0xb218('0xe'),_0x3f30e1,_0xb218('0xf'),JSON[_0xb218('0x10')](_0x3e967a));if(_0x3e967a[_0xb218('0x11')]){if(_0x3e967a[_0xb218('0x11')][_0xb218('0x12')]===0x1f4){logger[_0xb218('0x11')](_0xb218('0xc'),_0x3f30e1,_0x3e967a[_0xb218('0x11')][_0xb218('0x13')]);return _0x3bd9c6(_0x3e967a[_0xb218('0x11')]['message']);}logger[_0xb218('0x11')](_0xb218('0xc'),_0x3f30e1,_0x3e967a['error'][_0xb218('0x13')]);return _0x214503(_0x3e967a[_0xb218('0x11')][_0xb218('0x13')]);}else{logger[_0xb218('0x14')](_0xb218('0xc'),_0x3f30e1,_0xb218('0xf'));_0x214503(_0x3e967a[_0xb218('0x15')]['message']);}})['catch'](function(_0x1cd356){logger[_0xb218('0x11')](_0xb218('0xc'),_0x3f30e1,_0x1cd356);_0x3bd9c6(_0x1cd356);});});}exports[_0xb218('0x16')]=function(_0x188661){var _0x155063=this;return new Promise(function(_0x262bad,_0x182a85){return db['SquareReport'][_0xb218('0x17')](_0x188661[_0xb218('0x18')],{'raw':_0x188661[_0xb218('0x19')]?_0x188661['options']['raw']===undefined?!![]:![]:!![]})[_0xb218('0xb')](function(_0x820cd4){logger[_0xb218('0x14')](_0xb218('0x16'),_0x188661);logger[_0xb218('0xd')](_0xb218('0x16'),_0x188661,JSON[_0xb218('0x10')](_0x820cd4));_0x262bad(_0x820cd4);})[_0xb218('0x1a')](function(_0x1b09c7){logger[_0xb218('0x11')](_0xb218('0x16'),_0x1b09c7['message'],_0x188661);_0x182a85(_0x155063[_0xb218('0x11')](0x1f4,_0x1b09c7[_0xb218('0x13')]));});});};exports[_0xb218('0x1b')]=function(_0x24ab44){var _0x4a9a3d=this;return new Promise(function(_0x60dace,_0x59e5f0){return db[_0xb218('0x1c')]['update'](_0x24ab44[_0xb218('0x18')],{'raw':_0x24ab44[_0xb218('0x19')]?_0x24ab44[_0xb218('0x19')][_0xb218('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24ab44[_0xb218('0x19')]?_0x24ab44[_0xb218('0x19')][_0xb218('0x1e')]||null:null,'attributes':_0x24ab44['options']?_0x24ab44[_0xb218('0x19')][_0xb218('0x1f')]||null:null,'limit':_0x24ab44[_0xb218('0x19')]?_0x24ab44[_0xb218('0x19')][_0xb218('0x20')]||null:null})['then'](function(_0x594653){logger[_0xb218('0x14')](_0xb218('0x1b'),_0x24ab44);logger[_0xb218('0xd')](_0xb218('0x1b'),_0x24ab44,JSON[_0xb218('0x10')](_0x594653));_0x60dace(_0x594653);})[_0xb218('0x1a')](function(_0x38ac1d){logger[_0xb218('0x11')](_0xb218('0x1b'),_0x38ac1d[_0xb218('0x13')],_0x24ab44);_0x59e5f0(_0x4a9a3d[_0xb218('0x11')](0x1f4,_0x38ac1d[_0xb218('0x13')]));});});};
\ No newline at end of file
+var _0xa9a6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','create','options','raw','then','CreateSquareReport','catch','UpdateSquareReport','update','body','attributes','util'];(function(_0x147439,_0x3bcfce){var _0x551204=function(_0x3acfa2){while(--_0x3acfa2){_0x147439['push'](_0x147439['shift']());}};_0x551204(++_0x3bcfce);}(_0xa9a6,0x116));var _0x6a9a=function(_0x5c573a,_0x354881){_0x5c573a=_0x5c573a-0x0;var _0x2b6a21=_0xa9a6[_0x5c573a];return _0x2b6a21;};'use strict';var _=require('lodash');var util=require(_0x6a9a('0x0'));var moment=require(_0x6a9a('0x1'));var BPromise=require(_0x6a9a('0x2'));var rs=require(_0x6a9a('0x3'));var fs=require('fs');var Redis=require(_0x6a9a('0x4'));var db=require(_0x6a9a('0x5'))['db'];var utils=require(_0x6a9a('0x6'));var logger=require('../../config/logger')(_0x6a9a('0x7'));var config=require(_0x6a9a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a9a('0x9')][_0x6a9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x83f3ee,_0xeee82a,_0x465d7a){return new BPromise(function(_0x163be5,_0x41be08){return client[_0x6a9a('0xb')](_0x83f3ee,_0x465d7a)['then'](function(_0x2651b5){logger[_0x6a9a('0xc')](_0x6a9a('0xd'),_0xeee82a,'request\x20sent');logger[_0x6a9a('0xe')](_0x6a9a('0xf'),_0xeee82a,_0x6a9a('0x10'),JSON[_0x6a9a('0x11')](_0x2651b5));if(_0x2651b5[_0x6a9a('0x12')]){if(_0x2651b5[_0x6a9a('0x12')]['code']===0x1f4){logger[_0x6a9a('0x12')](_0x6a9a('0xd'),_0xeee82a,_0x2651b5[_0x6a9a('0x12')][_0x6a9a('0x13')]);return _0x41be08(_0x2651b5[_0x6a9a('0x12')][_0x6a9a('0x13')]);}logger[_0x6a9a('0x12')](_0x6a9a('0xd'),_0xeee82a,_0x2651b5[_0x6a9a('0x12')]['message']);return _0x163be5(_0x2651b5[_0x6a9a('0x12')][_0x6a9a('0x13')]);}else{logger[_0x6a9a('0xc')](_0x6a9a('0xd'),_0xeee82a,'request\x20sent');_0x163be5(_0x2651b5[_0x6a9a('0x14')]['message']);}})['catch'](function(_0x5858f8){logger[_0x6a9a('0x12')](_0x6a9a('0xd'),_0xeee82a,_0x5858f8);_0x41be08(_0x5858f8);});});}exports['CreateSquareReport']=function(_0x2c7606){var _0x156550=this;return new Promise(function(_0x4ae6dc,_0x3794a3){return db['SquareReport'][_0x6a9a('0x15')](_0x2c7606['body'],{'raw':_0x2c7606[_0x6a9a('0x16')]?_0x2c7606[_0x6a9a('0x16')][_0x6a9a('0x17')]===undefined?!![]:![]:!![]})[_0x6a9a('0x18')](function(_0x1fd10d){logger[_0x6a9a('0xc')]('CreateSquareReport',_0x2c7606);logger['debug'](_0x6a9a('0x19'),_0x2c7606,JSON['stringify'](_0x1fd10d));_0x4ae6dc(_0x1fd10d);})[_0x6a9a('0x1a')](function(_0x4b83eb){logger['error'](_0x6a9a('0x19'),_0x4b83eb[_0x6a9a('0x13')],_0x2c7606);_0x3794a3(_0x156550[_0x6a9a('0x12')](0x1f4,_0x4b83eb['message']));});});};exports[_0x6a9a('0x1b')]=function(_0x3cf41c){var _0x3395dd=this;return new Promise(function(_0x466a82,_0x301564){return db['SquareReport'][_0x6a9a('0x1c')](_0x3cf41c[_0x6a9a('0x1d')],{'raw':_0x3cf41c[_0x6a9a('0x16')]?_0x3cf41c['options'][_0x6a9a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cf41c['options']?_0x3cf41c[_0x6a9a('0x16')]['where']||null:null,'attributes':_0x3cf41c['options']?_0x3cf41c['options'][_0x6a9a('0x1e')]||null:null,'limit':_0x3cf41c[_0x6a9a('0x16')]?_0x3cf41c[_0x6a9a('0x16')]['limit']||null:null})['then'](function(_0x1ffc1f){logger[_0x6a9a('0xc')](_0x6a9a('0x1b'),_0x3cf41c);logger[_0x6a9a('0xe')](_0x6a9a('0x1b'),_0x3cf41c,JSON[_0x6a9a('0x11')](_0x1ffc1f));_0x466a82(_0x1ffc1f);})[_0x6a9a('0x1a')](function(_0x330124){logger['error'](_0x6a9a('0x1b'),_0x330124['message'],_0x3cf41c);_0x301564(_0x3395dd[_0x6a9a('0x12')](0x1f4,_0x330124[_0x6a9a('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a52=['./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','show','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0x6a52,0xc0));var _0x26a5=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x6a52[_0xb8cfbe];return _0x227d51;};'use strict';var multer=require('multer');var util=require(_0x26a5('0x0'));var path=require('path');var timeout=require(_0x26a5('0x1'));var express=require(_0x26a5('0x2'));var router=express[_0x26a5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26a5('0x4'));router['get']('/',auth[_0x26a5('0x5')](),controller[_0x26a5('0x6')]);router[_0x26a5('0x7')](_0x26a5('0x8'),auth[_0x26a5('0x5')](),controller[_0x26a5('0x9')]);router[_0x26a5('0x7')](_0x26a5('0xa'),auth[_0x26a5('0x5')](),controller[_0x26a5('0xb')]);router['post']('/',auth[_0x26a5('0x5')](),controller['create']);router['put'](_0x26a5('0xa'),auth[_0x26a5('0x5')](),controller['update']);router['delete'](_0x26a5('0xa'),auth[_0x26a5('0x5')](),controller[_0x26a5('0xc')]);module[_0x26a5('0xd')]=router;
\ No newline at end of file
+var _0x50f3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','destroy'];(function(_0x5bcd93,_0xc78093){var _0x35e93b=function(_0x41f152){while(--_0x41f152){_0x5bcd93['push'](_0x5bcd93['shift']());}};_0x35e93b(++_0xc78093);}(_0x50f3,0x18f));var _0x350f=function(_0x233ce4,_0x399d47){_0x233ce4=_0x233ce4-0x0;var _0x32bc00=_0x50f3[_0x233ce4];return _0x32bc00;};'use strict';var multer=require(_0x350f('0x0'));var util=require(_0x350f('0x1'));var path=require(_0x350f('0x2'));var timeout=require(_0x350f('0x3'));var express=require(_0x350f('0x4'));var router=express[_0x350f('0x5')]();var fs_extra=require(_0x350f('0x6'));var auth=require(_0x350f('0x7'));var interaction=require(_0x350f('0x8'));var config=require('../../config/environment');var controller=require(_0x350f('0x9'));router[_0x350f('0xa')]('/',auth['isAuthenticated'](),controller[_0x350f('0xb')]);router[_0x350f('0xa')](_0x350f('0xc'),auth[_0x350f('0xd')](),controller[_0x350f('0xe')]);router[_0x350f('0xa')]('/:id',auth[_0x350f('0xd')](),controller[_0x350f('0xf')]);router[_0x350f('0x10')]('/',auth[_0x350f('0xd')](),controller[_0x350f('0x11')]);router[_0x350f('0x12')]('/:id',auth[_0x350f('0xd')](),controller['update']);router['delete'](_0x350f('0x13'),auth[_0x350f('0xd')](),controller[_0x350f('0x14')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d7a=['exports','STRING','TEXT','sequelize'];(function(_0x4e5015,_0x440b70){var _0x2e9ab4=function(_0x2fdc4c){while(--_0x2fdc4c){_0x4e5015['push'](_0x4e5015['shift']());}};_0x2e9ab4(++_0x440b70);}(_0x2d7a,0x153));var _0xa2d7=function(_0x3c77f9,_0x2abb07){_0x3c77f9=_0x3c77f9-0x0;var _0x41790a=_0x2d7a[_0x3c77f9];return _0x41790a;};'use strict';var Sequelize=require(_0xa2d7('0x0'));module[_0xa2d7('0x1')]={'uniqueid':{'type':Sequelize[_0xa2d7('0x2')]},'node':{'type':Sequelize[_0xa2d7('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa2d7('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc8f3=['TEXT','sequelize','exports','STRING'];(function(_0x131c01,_0x58f223){var _0x29648c=function(_0x4e812d){while(--_0x4e812d){_0x131c01['push'](_0x131c01['shift']());}};_0x29648c(++_0x58f223);}(_0xc8f3,0x151));var _0x3c8f=function(_0x3d2944,_0x410c3e){_0x3d2944=_0x3d2944-0x0;var _0x370d7b=_0xc8f3[_0x3d2944];return _0x370d7b;};'use strict';var Sequelize=require(_0x3c8f('0x0'));module[_0x3c8f('0x1')]={'uniqueid':{'type':Sequelize[_0x3c8f('0x2')]},'node':{'type':Sequelize[_0x3c8f('0x2')]},'application':{'type':Sequelize[_0x3c8f('0x2')]},'data':{'type':Sequelize[_0x3c8f('0x3')]},'project_name':{'type':Sequelize[_0x3c8f('0x2')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x721a=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','include','findAll','catch','show','intersection','includeAll','find','create','body','params','describe','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3a70b0,_0x22a325){var _0x1f8bc0=function(_0x4dcd68){while(--_0x4dcd68){_0x3a70b0['push'](_0x3a70b0['shift']());}};_0x1f8bc0(++_0x22a325);}(_0x721a,0x1b8));var _0xa721=function(_0x12395b,_0x2a11e9){_0x12395b=_0x12395b-0x0;var _0x55546=_0x721a[_0x12395b];return _0x55546;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa721('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa721('0x1'));var moment=require('moment');var BPromise=require(_0xa721('0x2'));var Mustache=require(_0xa721('0x3'));var util=require(_0xa721('0x4'));var path=require(_0xa721('0x5'));var sox=require(_0xa721('0x6'));var csv=require(_0xa721('0x7'));var ejs=require(_0xa721('0x8'));var fs=require('fs');var fs_extra=require(_0xa721('0x9'));var _=require(_0xa721('0xa'));var squel=require(_0xa721('0xb'));var crypto=require(_0xa721('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa721('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa721('0xe'));var Papa=require(_0xa721('0xf'));var Redis=require(_0xa721('0x10'));var authService=require(_0xa721('0x11'));var qs=require(_0xa721('0x12'));var as=require(_0xa721('0x13'));var hardwareService=require(_0xa721('0x14'));var logger=require(_0xa721('0x15'))('api');var utils=require(_0xa721('0x16'));var config=require(_0xa721('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa721('0x18'))['db'];function respondWithStatusCode(_0x53bf75,_0x37776a){_0x37776a=_0x37776a||0xcc;return function(_0x1df3ec){if(_0x1df3ec){return _0x53bf75[_0xa721('0x19')](_0x37776a);}return _0x53bf75['status'](_0x37776a)['end']();};}function respondWithResult(_0x1bb08e,_0x3a2057){_0x3a2057=_0x3a2057||0xc8;return function(_0x1013a4){if(_0x1013a4){return _0x1bb08e['status'](_0x3a2057)[_0xa721('0x1a')](_0x1013a4);}};}function respondWithFilteredResult(_0x470f12,_0x18de6e){return function(_0x3182d8){if(_0x3182d8){var _0x1a5063=typeof _0x18de6e[_0xa721('0x1b')]===_0xa721('0x1c')&&typeof _0x18de6e[_0xa721('0x1d')]===_0xa721('0x1c');var _0x3b053f=_0x3182d8['count'];var _0x4a77f4=_0x1a5063?0x0:_0x18de6e['offset'];var _0x5e8665=_0x1a5063?_0x3182d8[_0xa721('0x1e')]:_0x18de6e['offset']+_0x18de6e['limit'];var _0x37be02;if(_0x5e8665>=_0x3b053f){_0x5e8665=_0x3b053f;_0x37be02=0xc8;}else{_0x37be02=0xce;}_0x470f12[_0xa721('0x1f')](_0x37be02);return _0x470f12['set'](_0xa721('0x20'),_0x4a77f4+'-'+_0x5e8665+'/'+_0x3b053f)[_0xa721('0x1a')](_0x3182d8);}return null;};}function patchUpdates(_0x388c3f){return function(_0x512242){try{jsonpatch[_0xa721('0x21')](_0x512242,_0x388c3f,!![]);}catch(_0x524c47){return BPromise[_0xa721('0x22')](_0x524c47);}return _0x512242[_0xa721('0x23')]();};}function saveUpdates(_0x28c575,_0x4d3220){return function(_0x5d1031){if(_0x5d1031){return _0x5d1031[_0xa721('0x24')](_0x28c575)[_0xa721('0x25')](function(_0x5b5dc8){return _0x5b5dc8;});}return null;};}function removeEntity(_0x2d8699,_0xa6ec96){return function(_0x278f15){if(_0x278f15){return _0x278f15[_0xa721('0x26')]()[_0xa721('0x25')](function(){_0x2d8699[_0xa721('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf3e7,_0x3eaee6){return function(_0x273f84){if(!_0x273f84){_0x1bf3e7[_0xa721('0x19')](0x194);}return _0x273f84;};}function handleError(_0x179b24,_0x30f122){_0x30f122=_0x30f122||0x1f4;return function(_0x81c0a5){logger[_0xa721('0x27')](_0x81c0a5[_0xa721('0x28')]);if(_0x81c0a5[_0xa721('0x29')]){delete _0x81c0a5[_0xa721('0x29')];}_0x179b24[_0xa721('0x1f')](_0x30f122)[_0xa721('0x2a')](_0x81c0a5);};}exports[_0xa721('0x2b')]=function(_0x33db9a,_0x26f545){var _0x1a729a={},_0x377842={},_0x4ea476={'count':0x0,'rows':[]};var _0x3c15f3=_[_0xa721('0x2c')](db['SquareDetailsReport'][_0xa721('0x2d')],function(_0x12f0a9){return{'name':_0x12f0a9['fieldName'],'type':_0x12f0a9[_0xa721('0x2e')][_0xa721('0x2f')]};});_0x377842['model']=_[_0xa721('0x2c')](_0x3c15f3,_0xa721('0x29'));_0x377842[_0xa721('0x30')]=_[_0xa721('0x31')](_0x33db9a['query']);_0x377842[_0xa721('0x32')]=_['intersection'](_0x377842[_0xa721('0x33')],_0x377842[_0xa721('0x30')]);_0x1a729a[_0xa721('0x34')]=_['intersection'](_0x377842[_0xa721('0x33')],qs['fields'](_0x33db9a['query'][_0xa721('0x35')]));_0x1a729a[_0xa721('0x34')]=_0x1a729a[_0xa721('0x34')][_0xa721('0x36')]?_0x1a729a[_0xa721('0x34')]:_0x377842['model'];if(!_0x33db9a['query'][_0xa721('0x37')](_0xa721('0x38'))){_0x1a729a[_0xa721('0x1d')]=qs[_0xa721('0x1d')](_0x33db9a['query'][_0xa721('0x1d')]);_0x1a729a[_0xa721('0x1b')]=qs[_0xa721('0x1b')](_0x33db9a['query'][_0xa721('0x1b')]);}_0x1a729a[_0xa721('0x39')]=qs[_0xa721('0x3a')](_0x33db9a[_0xa721('0x30')]['sort']);_0x1a729a[_0xa721('0x3b')]=qs[_0xa721('0x32')](_[_0xa721('0x3c')](_0x33db9a[_0xa721('0x30')],_0x377842[_0xa721('0x32')]),_0x3c15f3);if(_0x33db9a['query'][_0xa721('0x3d')]){_0x1a729a[_0xa721('0x3b')]=_[_0xa721('0x3e')](_0x1a729a[_0xa721('0x3b')],{'$or':_[_0xa721('0x2c')](_0x3c15f3,function(_0x4aa88a){if(_0x4aa88a['type']!==_0xa721('0x3f')){var _0x6f184e={};_0x6f184e[_0x4aa88a[_0xa721('0x29')]]={'$like':'%'+_0x33db9a[_0xa721('0x30')][_0xa721('0x3d')]+'%'};return _0x6f184e;}})});}_0x1a729a=_[_0xa721('0x3e')]({},_0x1a729a,_0x33db9a[_0xa721('0x40')]);var _0x476955={'where':_0x1a729a[_0xa721('0x3b')]};return db[_0xa721('0x41')][_0xa721('0x1e')](_0x476955)[_0xa721('0x25')](function(_0x571d23){_0x4ea476[_0xa721('0x1e')]=_0x571d23;if(_0x33db9a[_0xa721('0x30')]['includeAll']){_0x1a729a[_0xa721('0x42')]=[{'all':!![]}];}return db[_0xa721('0x41')][_0xa721('0x43')](_0x1a729a);})[_0xa721('0x25')](function(_0x168e1d){_0x4ea476['rows']=_0x168e1d;return _0x4ea476;})[_0xa721('0x25')](respondWithFilteredResult(_0x26f545,_0x1a729a))[_0xa721('0x44')](handleError(_0x26f545,null));};exports[_0xa721('0x45')]=function(_0x215ca7,_0x4a56a4){var _0x877c29={'raw':!![],'where':{'id':_0x215ca7['params']['id']}},_0x352ad8={};_0x352ad8[_0xa721('0x33')]=_[_0xa721('0x31')](db['SquareDetailsReport']['rawAttributes']);_0x352ad8[_0xa721('0x30')]=_['keys'](_0x215ca7[_0xa721('0x30')]);_0x352ad8[_0xa721('0x32')]=_[_0xa721('0x46')](_0x352ad8[_0xa721('0x33')],_0x352ad8[_0xa721('0x30')]);_0x877c29[_0xa721('0x34')]=_['intersection'](_0x352ad8['model'],qs[_0xa721('0x35')](_0x215ca7[_0xa721('0x30')][_0xa721('0x35')]));_0x877c29[_0xa721('0x34')]=_0x877c29[_0xa721('0x34')][_0xa721('0x36')]?_0x877c29['attributes']:_0x352ad8['model'];if(_0x215ca7[_0xa721('0x30')][_0xa721('0x47')]){_0x877c29[_0xa721('0x42')]=[{'all':!![]}];}_0x877c29=_[_0xa721('0x3e')]({},_0x877c29,_0x215ca7['options']);return db[_0xa721('0x41')][_0xa721('0x48')](_0x877c29)[_0xa721('0x25')](handleEntityNotFound(_0x4a56a4,null))[_0xa721('0x25')](respondWithResult(_0x4a56a4,null))['catch'](handleError(_0x4a56a4,null));};exports[_0xa721('0x49')]=function(_0x1e54ea,_0x384963){return db['SquareDetailsReport'][_0xa721('0x49')](_0x1e54ea[_0xa721('0x4a')],{})[_0xa721('0x25')](respondWithResult(_0x384963,0xc9))[_0xa721('0x44')](handleError(_0x384963,null));};exports[_0xa721('0x24')]=function(_0xc73fe9,_0x3c5ea8){if(_0xc73fe9[_0xa721('0x4a')]['id']){delete _0xc73fe9[_0xa721('0x4a')]['id'];}return db[_0xa721('0x41')][_0xa721('0x48')]({'where':{'id':_0xc73fe9['params']['id']}})[_0xa721('0x25')](handleEntityNotFound(_0x3c5ea8,null))[_0xa721('0x25')](saveUpdates(_0xc73fe9[_0xa721('0x4a')],null))[_0xa721('0x25')](respondWithResult(_0x3c5ea8,null))['catch'](handleError(_0x3c5ea8,null));};exports[_0xa721('0x26')]=function(_0x383ca9,_0xe0890a){return db[_0xa721('0x41')][_0xa721('0x48')]({'where':{'id':_0x383ca9[_0xa721('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe0890a,null))[_0xa721('0x25')](removeEntity(_0xe0890a,null))[_0xa721('0x44')](handleError(_0xe0890a,null));};exports['describe']=function(_0x534482,_0x48fc0e){return db[_0xa721('0x41')][_0xa721('0x4c')]()[_0xa721('0x25')](respondWithResult(_0x48fc0e,null))[_0xa721('0x44')](handleError(_0x48fc0e,null));};
\ No newline at end of file
+var _0xa2c4=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','end','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','findAll','catch','include','find','create','body','update','params','destroy','describe','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse'];(function(_0x568f91,_0x200cd7){var _0xae8ba1=function(_0xcb7c62){while(--_0xcb7c62){_0x568f91['push'](_0x568f91['shift']());}};_0xae8ba1(++_0x200cd7);}(_0xa2c4,0x7c));var _0x4a2c=function(_0x302a6c,_0x5e9cef){_0x302a6c=_0x302a6c-0x0;var _0x3a6c9a=_0xa2c4[_0x302a6c];return _0x3a6c9a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4a2c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a2c('0x1'));var moment=require(_0x4a2c('0x2'));var BPromise=require(_0x4a2c('0x3'));var Mustache=require('mustache');var util=require(_0x4a2c('0x4'));var path=require(_0x4a2c('0x5'));var sox=require(_0x4a2c('0x6'));var csv=require(_0x4a2c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a2c('0x8'));var _=require(_0x4a2c('0x9'));var squel=require(_0x4a2c('0xa'));var crypto=require(_0x4a2c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4a2c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a2c('0xd'));var Redis=require('ioredis');var authService=require(_0x4a2c('0xe'));var qs=require(_0x4a2c('0xf'));var as=require(_0x4a2c('0x10'));var hardwareService=require(_0x4a2c('0x11'));var logger=require(_0x4a2c('0x12'))(_0x4a2c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a3242,_0x3404ed){_0x3404ed=_0x3404ed||0xcc;return function(_0x16759b){if(_0x16759b){return _0x2a3242[_0x4a2c('0x14')](_0x3404ed);}return _0x2a3242[_0x4a2c('0x15')](_0x3404ed)['end']();};}function respondWithResult(_0x5ce373,_0x498fc4){_0x498fc4=_0x498fc4||0xc8;return function(_0x2329e2){if(_0x2329e2){return _0x5ce373['status'](_0x498fc4)['json'](_0x2329e2);}};}function respondWithFilteredResult(_0x34f73c,_0xf4955c){return function(_0x2da6ad){if(_0x2da6ad){var _0x3293a3=typeof _0xf4955c[_0x4a2c('0x16')]===_0x4a2c('0x17')&&typeof _0xf4955c[_0x4a2c('0x18')]===_0x4a2c('0x17');var _0x59e73d=_0x2da6ad[_0x4a2c('0x19')];var _0xb283e9=_0x3293a3?0x0:_0xf4955c[_0x4a2c('0x16')];var _0x720517=_0x3293a3?_0x2da6ad['count']:_0xf4955c['offset']+_0xf4955c[_0x4a2c('0x18')];var _0x874fff;if(_0x720517>=_0x59e73d){_0x720517=_0x59e73d;_0x874fff=0xc8;}else{_0x874fff=0xce;}_0x34f73c[_0x4a2c('0x15')](_0x874fff);return _0x34f73c[_0x4a2c('0x1a')](_0x4a2c('0x1b'),_0xb283e9+'-'+_0x720517+'/'+_0x59e73d)[_0x4a2c('0x1c')](_0x2da6ad);}return null;};}function patchUpdates(_0x533aa1){return function(_0x264500){try{jsonpatch['apply'](_0x264500,_0x533aa1,!![]);}catch(_0x590ca3){return BPromise[_0x4a2c('0x1d')](_0x590ca3);}return _0x264500[_0x4a2c('0x1e')]();};}function saveUpdates(_0x5e528e,_0x4f4aa4){return function(_0x16ea69){if(_0x16ea69){return _0x16ea69['update'](_0x5e528e)[_0x4a2c('0x1f')](function(_0x42f64a){return _0x42f64a;});}return null;};}function removeEntity(_0x292193,_0x7e06ab){return function(_0x3c25f3){if(_0x3c25f3){return _0x3c25f3['destroy']()[_0x4a2c('0x1f')](function(){_0x292193['status'](0xcc)[_0x4a2c('0x20')]();});}};}function handleEntityNotFound(_0x49612e,_0x3c97b0){return function(_0x22beff){if(!_0x22beff){_0x49612e[_0x4a2c('0x14')](0x194);}return _0x22beff;};}function handleError(_0x2def72,_0xe3ca09){_0xe3ca09=_0xe3ca09||0x1f4;return function(_0x26de39){logger[_0x4a2c('0x21')](_0x26de39[_0x4a2c('0x22')]);if(_0x26de39[_0x4a2c('0x23')]){delete _0x26de39[_0x4a2c('0x23')];}_0x2def72[_0x4a2c('0x15')](_0xe3ca09)['send'](_0x26de39);};}exports[_0x4a2c('0x24')]=function(_0x31edcb,_0x13523a){var _0x1ba2ef={},_0x39fb8c={},_0x9849c={'count':0x0,'rows':[]};var _0x15c296=_[_0x4a2c('0x25')](db[_0x4a2c('0x26')][_0x4a2c('0x27')],function(_0x561fb3){return{'name':_0x561fb3[_0x4a2c('0x28')],'type':_0x561fb3['type'][_0x4a2c('0x29')]};});_0x39fb8c['model']=_[_0x4a2c('0x25')](_0x15c296,_0x4a2c('0x23'));_0x39fb8c[_0x4a2c('0x2a')]=_[_0x4a2c('0x2b')](_0x31edcb[_0x4a2c('0x2a')]);_0x39fb8c[_0x4a2c('0x2c')]=_['intersection'](_0x39fb8c['model'],_0x39fb8c['query']);_0x1ba2ef[_0x4a2c('0x2d')]=_[_0x4a2c('0x2e')](_0x39fb8c['model'],qs[_0x4a2c('0x2f')](_0x31edcb[_0x4a2c('0x2a')][_0x4a2c('0x2f')]));_0x1ba2ef[_0x4a2c('0x2d')]=_0x1ba2ef[_0x4a2c('0x2d')]['length']?_0x1ba2ef[_0x4a2c('0x2d')]:_0x39fb8c[_0x4a2c('0x30')];if(!_0x31edcb[_0x4a2c('0x2a')][_0x4a2c('0x31')](_0x4a2c('0x32'))){_0x1ba2ef['limit']=qs['limit'](_0x31edcb[_0x4a2c('0x2a')][_0x4a2c('0x18')]);_0x1ba2ef['offset']=qs[_0x4a2c('0x16')](_0x31edcb[_0x4a2c('0x2a')][_0x4a2c('0x16')]);}_0x1ba2ef['order']=qs[_0x4a2c('0x33')](_0x31edcb[_0x4a2c('0x2a')][_0x4a2c('0x33')]);_0x1ba2ef[_0x4a2c('0x34')]=qs[_0x4a2c('0x2c')](_[_0x4a2c('0x35')](_0x31edcb[_0x4a2c('0x2a')],_0x39fb8c['filters']),_0x15c296);if(_0x31edcb['query'][_0x4a2c('0x36')]){_0x1ba2ef[_0x4a2c('0x34')]=_[_0x4a2c('0x37')](_0x1ba2ef[_0x4a2c('0x34')],{'$or':_[_0x4a2c('0x25')](_0x15c296,function(_0xeb6f97){if(_0xeb6f97[_0x4a2c('0x38')]!=='VIRTUAL'){var _0x2d0cd9={};_0x2d0cd9[_0xeb6f97[_0x4a2c('0x23')]]={'$like':'%'+_0x31edcb[_0x4a2c('0x2a')]['filter']+'%'};return _0x2d0cd9;}})});}_0x1ba2ef=_['merge']({},_0x1ba2ef,_0x31edcb[_0x4a2c('0x39')]);var _0x4d8cff={'where':_0x1ba2ef[_0x4a2c('0x34')]};return db['SquareDetailsReport'][_0x4a2c('0x19')](_0x4d8cff)[_0x4a2c('0x1f')](function(_0xfc602b){_0x9849c[_0x4a2c('0x19')]=_0xfc602b;if(_0x31edcb[_0x4a2c('0x2a')][_0x4a2c('0x3a')]){_0x1ba2ef['include']=[{'all':!![]}];}return db[_0x4a2c('0x26')][_0x4a2c('0x3b')](_0x1ba2ef);})['then'](function(_0x4b42f4){_0x9849c['rows']=_0x4b42f4;return _0x9849c;})[_0x4a2c('0x1f')](respondWithFilteredResult(_0x13523a,_0x1ba2ef))[_0x4a2c('0x3c')](handleError(_0x13523a,null));};exports['show']=function(_0x14905a,_0x3dca05){var _0x1da43b={'raw':!![],'where':{'id':_0x14905a['params']['id']}},_0x5b1dac={};_0x5b1dac[_0x4a2c('0x30')]=_[_0x4a2c('0x2b')](db['SquareDetailsReport'][_0x4a2c('0x27')]);_0x5b1dac['query']=_[_0x4a2c('0x2b')](_0x14905a['query']);_0x5b1dac[_0x4a2c('0x2c')]=_[_0x4a2c('0x2e')](_0x5b1dac[_0x4a2c('0x30')],_0x5b1dac[_0x4a2c('0x2a')]);_0x1da43b[_0x4a2c('0x2d')]=_[_0x4a2c('0x2e')](_0x5b1dac[_0x4a2c('0x30')],qs[_0x4a2c('0x2f')](_0x14905a['query'][_0x4a2c('0x2f')]));_0x1da43b[_0x4a2c('0x2d')]=_0x1da43b[_0x4a2c('0x2d')]['length']?_0x1da43b[_0x4a2c('0x2d')]:_0x5b1dac[_0x4a2c('0x30')];if(_0x14905a[_0x4a2c('0x2a')][_0x4a2c('0x3a')]){_0x1da43b[_0x4a2c('0x3d')]=[{'all':!![]}];}_0x1da43b=_['merge']({},_0x1da43b,_0x14905a[_0x4a2c('0x39')]);return db[_0x4a2c('0x26')][_0x4a2c('0x3e')](_0x1da43b)[_0x4a2c('0x1f')](handleEntityNotFound(_0x3dca05,null))[_0x4a2c('0x1f')](respondWithResult(_0x3dca05,null))[_0x4a2c('0x3c')](handleError(_0x3dca05,null));};exports[_0x4a2c('0x3f')]=function(_0x17b59f,_0x4e1bc8){return db[_0x4a2c('0x26')][_0x4a2c('0x3f')](_0x17b59f[_0x4a2c('0x40')],{})['then'](respondWithResult(_0x4e1bc8,0xc9))['catch'](handleError(_0x4e1bc8,null));};exports[_0x4a2c('0x41')]=function(_0x495cf8,_0x197c29){if(_0x495cf8[_0x4a2c('0x40')]['id']){delete _0x495cf8[_0x4a2c('0x40')]['id'];}return db[_0x4a2c('0x26')]['find']({'where':{'id':_0x495cf8[_0x4a2c('0x42')]['id']}})[_0x4a2c('0x1f')](handleEntityNotFound(_0x197c29,null))[_0x4a2c('0x1f')](saveUpdates(_0x495cf8['body'],null))['then'](respondWithResult(_0x197c29,null))['catch'](handleError(_0x197c29,null));};exports[_0x4a2c('0x43')]=function(_0x10fe56,_0x388e81){return db[_0x4a2c('0x26')][_0x4a2c('0x3e')]({'where':{'id':_0x10fe56[_0x4a2c('0x42')]['id']}})[_0x4a2c('0x1f')](handleEntityNotFound(_0x388e81,null))['then'](removeEntity(_0x388e81,null))[_0x4a2c('0x3c')](handleError(_0x388e81,null));};exports[_0x4a2c('0x44')]=function(_0x29717c,_0x147251){return db['SquareDetailsReport']['describe']()[_0x4a2c('0x1f')](respondWithResult(_0x147251,null))['catch'](handleError(_0x147251,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66d8=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b3178,_0x77d69e){var _0x3c79cc=function(_0x342cd1){while(--_0x342cd1){_0x1b3178['push'](_0x1b3178['shift']());}};_0x3c79cc(++_0x77d69e);}(_0x66d8,0x163));var _0x866d=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x66d8[_0x31a938];return _0x1bf341;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x866d('0x0'))(_0x866d('0x1'));var moment=require(_0x866d('0x2'));var BPromise=require(_0x866d('0x3'));var rp=require(_0x866d('0x4'));var fs=require('fs');var path=require(_0x866d('0x5'));var rimraf=require(_0x866d('0x6'));var config=require(_0x866d('0x7'));var attributes=require(_0x866d('0x8'));module[_0x866d('0x9')]=function(_0x3796b9,_0x1f2d81){return _0x3796b9['define'](_0x866d('0xa'),attributes,{'tableName':_0x866d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe20a=['../../config/logger','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xe20a,0x13f));var _0xae20=function(_0x1c67a7,_0x2b35bd){_0x1c67a7=_0x1c67a7-0x0;var _0x3dc84a=_0xe20a[_0x1c67a7];return _0x3dc84a;};'use strict';var _=require(_0xae20('0x0'));var util=require('util');var logger=require(_0xae20('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae20('0x2'));var rimraf=require(_0xae20('0x3'));var config=require(_0xae20('0x4'));var attributes=require(_0xae20('0x5'));module[_0xae20('0x6')]=function(_0x457bbd,_0x44e9c4){return _0x457bbd[_0xae20('0x7')](_0xae20('0x8'),attributes,{'tableName':_0xae20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa5e=['CreateSquareDetailsReport','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','SquareDetailsReport','create','options','raw'];(function(_0x3aa29f,_0x2dcdc9){var _0x10dc77=function(_0x31d659){while(--_0x31d659){_0x3aa29f['push'](_0x3aa29f['shift']());}};_0x10dc77(++_0x2dcdc9);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x2351b5,_0xb94eb4){_0x2351b5=_0x2351b5-0x0;var _0x222a4f=_0xaa5e[_0x2351b5];return _0x222a4f;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d405e,_0x2f9041,_0x2c9696){return new BPromise(function(_0x50cb62,_0x2e35c3){return client[_0xeaa5('0xb')](_0x4d405e,_0x2c9696)['then'](function(_0x2e9ca6){logger['info'](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));logger['debug'](_0xeaa5('0xe'),_0x2f9041,_0xeaa5('0xd'),JSON[_0xeaa5('0xf')](_0x2e9ca6));if(_0x2e9ca6[_0xeaa5('0x10')]){if(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x11')]===0x1f4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x2e35c3(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x12')]);}logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x50cb62(_0x2e9ca6[_0xeaa5('0x10')]['message']);}else{logger[_0xeaa5('0x13')](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));_0x50cb62(_0x2e9ca6['result'][_0xeaa5('0x12')]);}})['catch'](function(_0x44e4b4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x44e4b4);_0x2e35c3(_0x44e4b4);});});}exports['CreateSquareDetailsReport']=function(_0x1877a6){var _0x50256a=this;return new Promise(function(_0x222da7,_0x85fb44){return db[_0xeaa5('0x14')][_0xeaa5('0x15')](_0x1877a6['body'],{'raw':_0x1877a6[_0xeaa5('0x16')]?_0x1877a6[_0xeaa5('0x16')][_0xeaa5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x11ace2){logger[_0xeaa5('0x13')](_0xeaa5('0x18'),_0x1877a6);logger[_0xeaa5('0x19')](_0xeaa5('0x18'),_0x1877a6,JSON['stringify'](_0x11ace2));_0x222da7(_0x11ace2);})[_0xeaa5('0x1a')](function(_0x5f2d83){logger[_0xeaa5('0x10')](_0xeaa5('0x18'),_0x5f2d83[_0xeaa5('0x12')],_0x1877a6);_0x85fb44(_0x50256a[_0xeaa5('0x10')](0x1f4,_0x5f2d83[_0xeaa5('0x12')]));});});};
\ No newline at end of file
+var _0x6017=['http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x6017,0xae));var _0x7601=function(_0x4f94ee,_0xc7e10){_0x4f94ee=_0x4f94ee-0x0;var _0x5725ae=_0x6017[_0x4f94ee];return _0x5725ae;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var moment=require(_0x7601('0x2'));var BPromise=require('bluebird');var rs=require(_0x7601('0x3'));var fs=require('fs');var Redis=require(_0x7601('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7601('0x5'));var logger=require('../../config/logger')(_0x7601('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7601('0x7')][_0x7601('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcb5ed9,_0x34a36d,_0x2bc643){return new BPromise(function(_0xe6e524,_0x4ff3e4){return client[_0x7601('0x9')](_0xcb5ed9,_0x2bc643)[_0x7601('0xa')](function(_0xd3a338){logger['info'](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));logger[_0x7601('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x34a36d,_0x7601('0xc'),JSON[_0x7601('0xe')](_0xd3a338));if(_0xd3a338[_0x7601('0xf')]){if(_0xd3a338[_0x7601('0xf')][_0x7601('0x10')]===0x1f4){logger[_0x7601('0xf')](_0x7601('0xb'),_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0x4ff3e4(_0xd3a338[_0x7601('0xf')]['message']);}logger[_0x7601('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0xe6e524(_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);}else{logger[_0x7601('0x12')](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));_0xe6e524(_0xd3a338[_0x7601('0x13')][_0x7601('0x11')]);}})['catch'](function(_0xa0e556){logger[_0x7601('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x34a36d,_0xa0e556);_0x4ff3e4(_0xa0e556);});});}exports[_0x7601('0x14')]=function(_0x5c3fb7){var _0x5f530e=this;return new Promise(function(_0x22520e,_0x403e38){return db[_0x7601('0x15')][_0x7601('0x16')](_0x5c3fb7[_0x7601('0x17')],{'raw':_0x5c3fb7[_0x7601('0x18')]?_0x5c3fb7[_0x7601('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7601('0xa')](function(_0x1d58c0){logger['info'](_0x7601('0x14'),_0x5c3fb7);logger[_0x7601('0xd')](_0x7601('0x14'),_0x5c3fb7,JSON[_0x7601('0xe')](_0x1d58c0));_0x22520e(_0x1d58c0);})[_0x7601('0x19')](function(_0x12f3f6){logger['error'](_0x7601('0x14'),_0x12f3f6[_0x7601('0x11')],_0x5c3fb7);_0x403e38(_0x5f530e[_0x7601('0xf')](0x1f4,_0x12f3f6[_0x7601('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c16=['../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess','exports','Router'];(function(_0x1529e4,_0xd432f5){var _0x541f99=function(_0x57ffb2){while(--_0x57ffb2){_0x1529e4['push'](_0x1529e4['shift']());}};_0x541f99(++_0xd432f5);}(_0x2c16,0x1a7));var _0x62c1=function(_0x476909,_0xb0f092){_0x476909=_0x476909-0x0;var _0x12e03a=_0x2c16[_0x476909];return _0x12e03a;};'use strict';var express=require('express');var router=express[_0x62c1('0x0')]();var auth=require(_0x62c1('0x1'));var controller=require(_0x62c1('0x2'));router[_0x62c1('0x3')]('/',auth[_0x62c1('0x4')](),controller[_0x62c1('0x5')]);router['get']('/process/:pid/kill',auth[_0x62c1('0x4')](),controller[_0x62c1('0x6')]);module[_0x62c1('0x7')]=router;
\ No newline at end of file
+var _0x8989=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8989,0x17a));var _0x9898=function(_0x3b8e63,_0x296c25){_0x3b8e63=_0x3b8e63-0x0;var _0x2bc00c=_0x8989[_0x3b8e63];return _0x2bc00c;};'use strict';var express=require('express');var router=express[_0x9898('0x0')]();var auth=require(_0x9898('0x1'));var controller=require(_0x9898('0x2'));router[_0x9898('0x3')]('/',auth[_0x9898('0x4')](),controller[_0x9898('0x5')]);router['get'](_0x9898('0x6'),auth[_0x9898('0x4')](),controller[_0x9898('0x7')]);module[_0x9898('0x8')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44ea=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','lodash','error','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf'];(function(_0x34fcba,_0x2a0bee){var _0x5c4f41=function(_0x44b38b){while(--_0x44b38b){_0x34fcba['push'](_0x34fcba['shift']());}};_0x5c4f41(++_0x2a0bee);}(_0x44ea,0xb2));var _0xa44e=function(_0x5c3883,_0x300d94){_0x5c3883=_0x5c3883-0x0;var _0x37a1c9=_0x44ea[_0x5c3883];return _0x37a1c9;};'use strict';var info=require(_0xa44e('0x0'));var exec=require('child_process')[_0xa44e('0x1')];var logger=require(_0xa44e('0x2'))('api');var util=require('util');var BPromise=require('bluebird');var _=require(_0xa44e('0x3'));function handleError(_0x42c8d4,_0x62c439,_0x329b76){_0x62c439=_0x62c439||0x1f4;return function(_0x199c85){logger[_0xa44e('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x329b76,_0x62c439,util[_0xa44e('0x5')](_0x199c85,{'showHidden':![],'depth':null}));delete _0x199c85[_0xa44e('0x6')];_0x42c8d4[_0xa44e('0x7')](_0x62c439)[_0xa44e('0x8')](_0x199c85);};}exports[_0xa44e('0x9')]=function(_0xa3aada,_0x34c726){return info[_0xa44e('0xa')]()[_0xa44e('0xb')](function(_0x52e0dc){return _0x34c726[_0xa44e('0x7')](0xc8)[_0xa44e('0xc')](_0x52e0dc);})[_0xa44e('0xd')](function(_0x250a1a){return _0x34c726['status'](0x1f4)[_0xa44e('0xc')](_0x250a1a);});};exports[_0xa44e('0xe')]=function(_0xe901cb,_0x3b7191){var _0x9eaaed=[_0xa44e('0xf')];return new BPromise(function(_0x41c083,_0x3852e7){return exec(util[_0xa44e('0x10')](_0xa44e('0x11'),_0xe901cb[_0xa44e('0x12')][_0xa44e('0x13')]),function(_0x3a814c,_0x40c971,_0x2b9b29){if(_0x3a814c){return _0x3852e7(_0x3a814c);}return _0x41c083(_0x40c971);});})[_0xa44e('0xb')](function(_0x44531e){var _0x3d9f0b=![];var _0x1cae0c=_0x44531e['split'](/\n/);for(var _0x560955=0x0,_0x20f5c9=_0x9eaaed[_0xa44e('0x14')];_0x560955<_0x20f5c9,_0x3d9f0b===![];_0x560955+=0x1){if(_0x44531e[_0xa44e('0x15')](_0x9eaaed[_0x560955])>=0x0){_0x3d9f0b=!![];}}if(!_0x3d9f0b){throw new Error(util['format'](_0xa44e('0x16'),_0xe901cb['params'][_0xa44e('0x13')]));}process[_0xa44e('0x17')](_0xe901cb[_0xa44e('0x12')]['pid'],'SIGINT');return _0x3b7191['status'](0xc8)[_0xa44e('0xc')]({'message':util[_0xa44e('0x10')](_0xa44e('0x18'),_0xe901cb[_0xa44e('0x12')][_0xa44e('0x13')])});})[_0xa44e('0xd')](handleError(_0x3b7191,null,_0xa44e('0xe')));};
\ No newline at end of file
+var _0x1cd0=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api','util','lodash','error','inspect','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm'];(function(_0x3d8b77,_0x138570){var _0x212a0c=function(_0x47e203){while(--_0x47e203){_0x3d8b77['push'](_0x3d8b77['shift']());}};_0x212a0c(++_0x138570);}(_0x1cd0,0xfe));var _0x01cd=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1cd0[_0x3e5086];return _0xfeb102;};'use strict';var info=require('systeminformation');var exec=require(_0x01cd('0x0'))['exec'];var logger=require(_0x01cd('0x1'))(_0x01cd('0x2'));var util=require(_0x01cd('0x3'));var BPromise=require('bluebird');var _=require(_0x01cd('0x4'));function handleError(_0x138d2c,_0x37a4ac,_0x100f35){_0x37a4ac=_0x37a4ac||0x1f4;return function(_0x1b2978){logger[_0x01cd('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x100f35,_0x37a4ac,util[_0x01cd('0x6')](_0x1b2978,{'showHidden':![],'depth':null}));delete _0x1b2978['name'];_0x138d2c[_0x01cd('0x7')](_0x37a4ac)[_0x01cd('0x8')](_0x1b2978);};}exports[_0x01cd('0x9')]=function(_0x2c0321,_0x492de9){return info[_0x01cd('0xa')]()[_0x01cd('0xb')](function(_0xfc6371){return _0x492de9[_0x01cd('0x7')](0xc8)['json'](_0xfc6371);})[_0x01cd('0xc')](function(_0x553469){return _0x492de9[_0x01cd('0x7')](0x1f4)[_0x01cd('0xd')](_0x553469);});};exports[_0x01cd('0xe')]=function(_0x8ed600,_0x1637d5){var _0x4b1a78=[_0x01cd('0xf')];return new BPromise(function(_0x5a130b,_0x590840){return exec(util['format'](_0x01cd('0x10'),_0x8ed600[_0x01cd('0x11')][_0x01cd('0x12')]),function(_0x9891f1,_0xb78e02,_0x36fd0f){if(_0x9891f1){return _0x590840(_0x9891f1);}return _0x5a130b(_0xb78e02);});})[_0x01cd('0xb')](function(_0x270d57){var _0x22da1c=![];var _0x10a92d=_0x270d57[_0x01cd('0x13')](/\n/);for(var _0x3a23f0=0x0,_0x5a6d1e=_0x4b1a78[_0x01cd('0x14')];_0x3a23f0<_0x5a6d1e,_0x22da1c===![];_0x3a23f0+=0x1){if(_0x270d57[_0x01cd('0x15')](_0x4b1a78[_0x3a23f0])>=0x0){_0x22da1c=!![];}}if(!_0x22da1c){throw new Error(util[_0x01cd('0x16')](_0x01cd('0x17'),_0x8ed600[_0x01cd('0x11')][_0x01cd('0x12')]));}process[_0x01cd('0x18')](_0x8ed600['params']['pid'],_0x01cd('0x19'));return _0x1637d5[_0x01cd('0x7')](0xc8)[_0x01cd('0xd')]({'message':util[_0x01cd('0x16')](_0x01cd('0x1a'),_0x8ed600['params']['pid'])});})[_0x01cd('0xc')](handleError(_0x1637d5,null,'killProcess'));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a1f=['delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x18cebc,_0x51bb41){var _0x5d9079=function(_0x3c6d2e){while(--_0x3c6d2e){_0x18cebc['push'](_0x18cebc['shift']());}};_0x5d9079(++_0x51bb41);}(_0x0a1f,0x88));var _0xf0a1=function(_0x39377a,_0x471865){_0x39377a=_0x39377a-0x0;var _0x6172fa=_0x0a1f[_0x39377a];return _0x6172fa;};'use strict';var multer=require('multer');var util=require(_0xf0a1('0x0'));var path=require(_0xf0a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0a1('0x2'));var router=express[_0xf0a1('0x3')]();var fs_extra=require(_0xf0a1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0a1('0x5'));var controller=require(_0xf0a1('0x6'));router[_0xf0a1('0x7')]('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x9')]);router[_0xf0a1('0x7')](_0xf0a1('0xa'),auth['isAuthenticated'](),controller[_0xf0a1('0xb')]);router[_0xf0a1('0xc')]('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0xd')]);router[_0xf0a1('0xe')](_0xf0a1('0xa'),auth['isAuthenticated'](),controller[_0xf0a1('0xf')]);router[_0xf0a1('0x10')](_0xf0a1('0xa'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x11')]);module[_0xf0a1('0x12')]=router;
\ No newline at end of file
+var _0xf2c3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x34c4cb,_0x3ed11c){var _0x2485c4=function(_0x526115){while(--_0x526115){_0x34c4cb['push'](_0x34c4cb['shift']());}};_0x2485c4(++_0x3ed11c);}(_0xf2c3,0x75));var _0x3f2c=function(_0x424d82,_0x149747){_0x424d82=_0x424d82-0x0;var _0x184f0a=_0xf2c3[_0x424d82];return _0x184f0a;};'use strict';var multer=require('multer');var util=require(_0x3f2c('0x0'));var path=require(_0x3f2c('0x1'));var timeout=require('connect-timeout');var express=require(_0x3f2c('0x2'));var router=express['Router']();var fs_extra=require(_0x3f2c('0x3'));var auth=require(_0x3f2c('0x4'));var interaction=require(_0x3f2c('0x5'));var config=require(_0x3f2c('0x6'));var controller=require(_0x3f2c('0x7'));router[_0x3f2c('0x8')]('/',auth[_0x3f2c('0x9')](),controller[_0x3f2c('0xa')]);router[_0x3f2c('0x8')](_0x3f2c('0xb'),auth[_0x3f2c('0x9')](),controller[_0x3f2c('0xc')]);router[_0x3f2c('0xd')]('/',auth[_0x3f2c('0x9')](),controller[_0x3f2c('0xe')]);router[_0x3f2c('0xf')](_0x3f2c('0xb'),auth[_0x3f2c('0x9')](),controller[_0x3f2c('0x10')]);router[_0x3f2c('0x11')](_0x3f2c('0xb'),auth['isAuthenticated'](),controller[_0x3f2c('0x12')]);module[_0x3f2c('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x867f=['sequelize','exports','STRING','#0091EA'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x867f,0xdc));var _0xf867=function(_0x383552,_0x5db2de){_0x383552=_0x383552-0x0;var _0x338ff7=_0x867f[_0x383552];return _0x338ff7;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'name':{'type':Sequelize[_0xf867('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf867('0x2')],'defaultValue':_0xf867('0x3')},'description':{'type':Sequelize[_0xf867('0x2')]}};
\ No newline at end of file
+var _0x325b=['exports','STRING','#0091EA','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x325b,0x8b));var _0xb325=function(_0x3de18c,_0x4c0f6a){_0x3de18c=_0x3de18c-0x0;var _0x21f85c=_0x325b[_0x3de18c];return _0x21f85c;};'use strict';var Sequelize=require(_0xb325('0x0'));module[_0xb325('0x1')]={'name':{'type':Sequelize[_0xb325('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb325('0x2')],'defaultValue':_0xb325('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6b1=['apply','reject','save','update','then','UserProfileResource','destroy','end','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xb6b1[_0x3ceb54];return _0x26d8a6;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){var _0xc9554d=_0x4efab0['get']({'plain':!![]});var _0x6a317c='Tags';return db[_0x1b6b('0x24')][_0x1b6b('0x25')]({'where':{'type':_0x6a317c,'resourceId':_0xc9554d['id']}})[_0x1b6b('0x23')](function(){return _0x4efab0;});})[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)[_0x1b6b('0x26')]();});}};}function handleEntityNotFound(_0x5d0a0a,_0xe8b7b5){return function(_0x1bb7f3){if(!_0x1bb7f3){_0x5d0a0a[_0x1b6b('0x16')](0x194);}return _0x1bb7f3;};}function handleError(_0x3b33d4,_0x4bd5b8){_0x4bd5b8=_0x4bd5b8||0x1f4;return function(_0x23dac4){logger['error'](_0x23dac4['stack']);if(_0x23dac4[_0x1b6b('0x27')]){delete _0x23dac4['name'];}_0x3b33d4[_0x1b6b('0x17')](_0x4bd5b8)[_0x1b6b('0x28')](_0x23dac4);};}exports['index']=function(_0x4c42a9,_0x36878c){var _0x1f8925={},_0x53d5ec={},_0x56c2cd={'count':0x0,'rows':[]};var _0xf9672d=_[_0x1b6b('0x29')](db[_0x1b6b('0x2a')][_0x1b6b('0x2b')],function(_0x56f31b){return{'name':_0x56f31b[_0x1b6b('0x2c')],'type':_0x56f31b[_0x1b6b('0x2d')][_0x1b6b('0x2e')]};});_0x53d5ec[_0x1b6b('0x2f')]=_[_0x1b6b('0x29')](_0xf9672d,_0x1b6b('0x27'));_0x53d5ec[_0x1b6b('0x30')]=_[_0x1b6b('0x31')](_0x4c42a9[_0x1b6b('0x30')]);_0x53d5ec['filters']=_[_0x1b6b('0x32')](_0x53d5ec[_0x1b6b('0x2f')],_0x53d5ec[_0x1b6b('0x30')]);_0x1f8925[_0x1b6b('0x33')]=_['intersection'](_0x53d5ec[_0x1b6b('0x2f')],qs['fields'](_0x4c42a9[_0x1b6b('0x30')]['fields']));_0x1f8925['attributes']=_0x1f8925[_0x1b6b('0x33')][_0x1b6b('0x34')]?_0x1f8925[_0x1b6b('0x33')]:_0x53d5ec['model'];if(!_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x35')](_0x1b6b('0x36'))){_0x1f8925[_0x1b6b('0x1b')]=qs[_0x1b6b('0x1b')](_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x1b')]);_0x1f8925[_0x1b6b('0x19')]=qs[_0x1b6b('0x19')](_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x19')]);}_0x1f8925[_0x1b6b('0x37')]=qs[_0x1b6b('0x38')](_0x4c42a9[_0x1b6b('0x30')]['sort']);_0x1f8925[_0x1b6b('0x39')]=qs[_0x1b6b('0x3a')](_['pick'](_0x4c42a9[_0x1b6b('0x30')],_0x53d5ec['filters']),_0xf9672d);if(_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x3b')]){_0x1f8925[_0x1b6b('0x39')]=_['merge'](_0x1f8925[_0x1b6b('0x39')],{'$or':_[_0x1b6b('0x29')](_0xf9672d,function(_0x401069){if(_0x401069['type']!==_0x1b6b('0x3c')){var _0x478287={};_0x478287[_0x401069[_0x1b6b('0x27')]]={'$like':'%'+_0x4c42a9['query']['filter']+'%'};return _0x478287;}})});}_0x1f8925=_['merge']({},_0x1f8925,_0x4c42a9[_0x1b6b('0x3d')]);var _0xd8b86={'where':_0x1f8925[_0x1b6b('0x39')]};return db[_0x1b6b('0x2a')][_0x1b6b('0x1c')](_0xd8b86)[_0x1b6b('0x23')](function(_0xe8bea5){_0x56c2cd['count']=_0xe8bea5;if(_0x4c42a9[_0x1b6b('0x30')][_0x1b6b('0x3e')]){_0x1f8925[_0x1b6b('0x3f')]=[{'all':!![]}];}return db[_0x1b6b('0x2a')][_0x1b6b('0x40')](_0x1f8925);})[_0x1b6b('0x23')](function(_0x5cb83a){_0x56c2cd[_0x1b6b('0x41')]=_0x5cb83a;return _0x56c2cd;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x36878c,_0x1f8925))[_0x1b6b('0x42')](handleError(_0x36878c,null));};exports[_0x1b6b('0x43')]=function(_0x27f41f,_0x24c3e5){var _0x1c86ce={'raw':!![],'where':{'id':_0x27f41f[_0x1b6b('0x44')]['id']}},_0x393a56={};_0x393a56[_0x1b6b('0x2f')]=_[_0x1b6b('0x31')](db[_0x1b6b('0x2a')]['rawAttributes']);_0x393a56[_0x1b6b('0x30')]=_[_0x1b6b('0x31')](_0x27f41f[_0x1b6b('0x30')]);_0x393a56[_0x1b6b('0x3a')]=_[_0x1b6b('0x32')](_0x393a56[_0x1b6b('0x2f')],_0x393a56['query']);_0x1c86ce['attributes']=_[_0x1b6b('0x32')](_0x393a56['model'],qs[_0x1b6b('0x45')](_0x27f41f['query'][_0x1b6b('0x45')]));_0x1c86ce[_0x1b6b('0x33')]=_0x1c86ce[_0x1b6b('0x33')][_0x1b6b('0x34')]?_0x1c86ce['attributes']:_0x393a56[_0x1b6b('0x2f')];if(_0x27f41f['query']['includeAll']){_0x1c86ce[_0x1b6b('0x3f')]=[{'all':!![]}];}_0x1c86ce=_[_0x1b6b('0x46')]({},_0x1c86ce,_0x27f41f[_0x1b6b('0x3d')]);return db[_0x1b6b('0x2a')]['find'](_0x1c86ce)[_0x1b6b('0x23')](handleEntityNotFound(_0x24c3e5,null))['then'](respondWithResult(_0x24c3e5,null))[_0x1b6b('0x42')](handleError(_0x24c3e5,null));};exports[_0x1b6b('0x47')]=function(_0x281f19,_0x4b0b47){return db[_0x1b6b('0x2a')]['create'](_0x281f19[_0x1b6b('0x48')],{})['then'](function(_0x30bf9b){var _0x21245d=_0x281f19[_0x1b6b('0x49')][_0x1b6b('0x4a')]({'plain':!![]});if(!_0x21245d)throw new Error(_0x1b6b('0x4b'));if(_0x21245d[_0x1b6b('0x4c')]==='user'){var _0x4c1e02=_0x30bf9b[_0x1b6b('0x4a')]({'plain':!![]});var _0x2967b7='Tags';return db[_0x1b6b('0x4d')][_0x1b6b('0x4e')]({'where':{'name':_0x2967b7,'userProfileId':_0x21245d[_0x1b6b('0x4f')]},'raw':!![]})[_0x1b6b('0x23')](function(_0x2085ab){if(_0x2085ab&&_0x2085ab['autoAssociation']===0x0){return db[_0x1b6b('0x24')]['create']({'name':_0x4c1e02[_0x1b6b('0x27')],'resourceId':_0x4c1e02['id'],'type':_0x2085ab[_0x1b6b('0x27')],'sectionId':_0x2085ab['id']},{})[_0x1b6b('0x23')](function(){return _0x30bf9b;});}else{return _0x30bf9b;}})[_0x1b6b('0x42')](function(_0x3667ce){logger[_0x1b6b('0x50')](_0x1b6b('0x51'),_0x3667ce);throw _0x3667ce;});}return _0x30bf9b;})[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,0xc9))[_0x1b6b('0x42')](handleError(_0x4b0b47,null));};exports['update']=function(_0x4f6dbf,_0x58c7e7){if(_0x4f6dbf[_0x1b6b('0x48')]['id']){delete _0x4f6dbf['body']['id'];}return db['Tag'][_0x1b6b('0x4e')]({'where':{'id':_0x4f6dbf[_0x1b6b('0x44')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x58c7e7,null))[_0x1b6b('0x23')](saveUpdates(_0x4f6dbf['body'],null))[_0x1b6b('0x23')](respondWithResult(_0x58c7e7,null))[_0x1b6b('0x42')](handleError(_0x58c7e7,null));};exports[_0x1b6b('0x25')]=function(_0x4e3226,_0x4df1e4){return db[_0x1b6b('0x2a')][_0x1b6b('0x4e')]({'where':{'id':_0x4e3226[_0x1b6b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4df1e4,null))['then'](removeEntity(_0x4df1e4,null))['catch'](handleError(_0x4df1e4,null));};
\ No newline at end of file
+var _0x5ff3=['params','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','Tag','include','findAll','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x5ff3,0x17d));var _0x35ff=function(_0x4edd85,_0x4ba8e2){_0x4edd85=_0x4edd85-0x0;var _0x4e0b22=_0x5ff3[_0x4edd85];return _0x4e0b22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35ff('0x1'));var rp=require('request-promise');var moment=require(_0x35ff('0x2'));var BPromise=require(_0x35ff('0x3'));var Mustache=require(_0x35ff('0x4'));var util=require(_0x35ff('0x5'));var path=require('path');var sox=require(_0x35ff('0x6'));var csv=require(_0x35ff('0x7'));var ejs=require(_0x35ff('0x8'));var fs=require('fs');var fs_extra=require(_0x35ff('0x9'));var _=require(_0x35ff('0xa'));var squel=require('squel');var crypto=require(_0x35ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35ff('0xc'));var toCsv=require(_0x35ff('0x7'));var querystring=require(_0x35ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x35ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x35ff('0xf'));var as=require(_0x35ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35ff('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35ff('0x12'))['db'];function respondWithStatusCode(_0x3c5f4b,_0x5bda40){_0x5bda40=_0x5bda40||0xcc;return function(_0x842930){if(_0x842930){return _0x3c5f4b['sendStatus'](_0x5bda40);}return _0x3c5f4b[_0x35ff('0x13')](_0x5bda40)[_0x35ff('0x14')]();};}function respondWithResult(_0x3db454,_0x4d1d41){_0x4d1d41=_0x4d1d41||0xc8;return function(_0xff8ac){if(_0xff8ac){return _0x3db454[_0x35ff('0x13')](_0x4d1d41)[_0x35ff('0x15')](_0xff8ac);}};}function respondWithFilteredResult(_0x3e24dd,_0x438199){return function(_0x3dff65){if(_0x3dff65){var _0x2d4a88=typeof _0x438199[_0x35ff('0x16')]===_0x35ff('0x17')&&typeof _0x438199[_0x35ff('0x18')]===_0x35ff('0x17');var _0x3430e2=_0x3dff65[_0x35ff('0x19')];var _0x16c803=_0x2d4a88?0x0:_0x438199[_0x35ff('0x16')];var _0x5f470e=_0x2d4a88?_0x3dff65[_0x35ff('0x19')]:_0x438199[_0x35ff('0x16')]+_0x438199[_0x35ff('0x18')];var _0x1c0d8c;if(_0x5f470e>=_0x3430e2){_0x5f470e=_0x3430e2;_0x1c0d8c=0xc8;}else{_0x1c0d8c=0xce;}_0x3e24dd['status'](_0x1c0d8c);return _0x3e24dd['set'](_0x35ff('0x1a'),_0x16c803+'-'+_0x5f470e+'/'+_0x3430e2)[_0x35ff('0x15')](_0x3dff65);}return null;};}function patchUpdates(_0x4c8dd4){return function(_0x238f65){try{jsonpatch[_0x35ff('0x1b')](_0x238f65,_0x4c8dd4,!![]);}catch(_0x3a87bc){return BPromise[_0x35ff('0x1c')](_0x3a87bc);}return _0x238f65['save']();};}function saveUpdates(_0x3d60b4,_0x55274b){return function(_0x7cc20a){if(_0x7cc20a){return _0x7cc20a[_0x35ff('0x1d')](_0x3d60b4)[_0x35ff('0x1e')](function(_0x16a5a0){return _0x16a5a0;});}return null;};}function removeEntity(_0x396cc2,_0x2b3782){return function(_0x347cec){if(_0x347cec){return _0x347cec['destroy']()[_0x35ff('0x1e')](function(){var _0x2ffcb=_0x347cec['get']({'plain':!![]});var _0x426e4e='Tags';return db['UserProfileResource'][_0x35ff('0x1f')]({'where':{'type':_0x426e4e,'resourceId':_0x2ffcb['id']}})[_0x35ff('0x1e')](function(){return _0x347cec;});})[_0x35ff('0x1e')](function(){_0x396cc2[_0x35ff('0x13')](0xcc)[_0x35ff('0x14')]();});}};}function handleEntityNotFound(_0x546ec0,_0x2bdba4){return function(_0x412873){if(!_0x412873){_0x546ec0[_0x35ff('0x20')](0x194);}return _0x412873;};}function handleError(_0x5e191b,_0x3357a){_0x3357a=_0x3357a||0x1f4;return function(_0x1f51c5){logger[_0x35ff('0x21')](_0x1f51c5[_0x35ff('0x22')]);if(_0x1f51c5[_0x35ff('0x23')]){delete _0x1f51c5[_0x35ff('0x23')];}_0x5e191b[_0x35ff('0x13')](_0x3357a)[_0x35ff('0x24')](_0x1f51c5);};}exports[_0x35ff('0x25')]=function(_0x47d8fa,_0x3f9440){var _0x57339d={},_0x1cb370={},_0x257501={'count':0x0,'rows':[]};var _0x2bc118=_[_0x35ff('0x26')](db['Tag'][_0x35ff('0x27')],function(_0x5de349){return{'name':_0x5de349[_0x35ff('0x28')],'type':_0x5de349[_0x35ff('0x29')]['key']};});_0x1cb370['model']=_[_0x35ff('0x26')](_0x2bc118,_0x35ff('0x23'));_0x1cb370['query']=_[_0x35ff('0x2a')](_0x47d8fa[_0x35ff('0x2b')]);_0x1cb370['filters']=_[_0x35ff('0x2c')](_0x1cb370[_0x35ff('0x2d')],_0x1cb370[_0x35ff('0x2b')]);_0x57339d[_0x35ff('0x2e')]=_[_0x35ff('0x2c')](_0x1cb370[_0x35ff('0x2d')],qs[_0x35ff('0x2f')](_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x2f')]));_0x57339d[_0x35ff('0x2e')]=_0x57339d[_0x35ff('0x2e')][_0x35ff('0x30')]?_0x57339d[_0x35ff('0x2e')]:_0x1cb370['model'];if(!_0x47d8fa[_0x35ff('0x2b')]['hasOwnProperty'](_0x35ff('0x31'))){_0x57339d[_0x35ff('0x18')]=qs[_0x35ff('0x18')](_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x18')]);_0x57339d['offset']=qs[_0x35ff('0x16')](_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x16')]);}_0x57339d[_0x35ff('0x32')]=qs[_0x35ff('0x33')](_0x47d8fa['query'][_0x35ff('0x33')]);_0x57339d[_0x35ff('0x34')]=qs[_0x35ff('0x35')](_['pick'](_0x47d8fa['query'],_0x1cb370[_0x35ff('0x35')]),_0x2bc118);if(_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x36')]){_0x57339d[_0x35ff('0x34')]=_[_0x35ff('0x37')](_0x57339d[_0x35ff('0x34')],{'$or':_[_0x35ff('0x26')](_0x2bc118,function(_0x368f7c){if(_0x368f7c['type']!=='VIRTUAL'){var _0x550c09={};_0x550c09[_0x368f7c[_0x35ff('0x23')]]={'$like':'%'+_0x47d8fa[_0x35ff('0x2b')][_0x35ff('0x36')]+'%'};return _0x550c09;}})});}_0x57339d=_[_0x35ff('0x37')]({},_0x57339d,_0x47d8fa[_0x35ff('0x38')]);var _0x59c398={'where':_0x57339d[_0x35ff('0x34')]};return db[_0x35ff('0x39')][_0x35ff('0x19')](_0x59c398)[_0x35ff('0x1e')](function(_0x117ee6){_0x257501[_0x35ff('0x19')]=_0x117ee6;if(_0x47d8fa['query']['includeAll']){_0x57339d[_0x35ff('0x3a')]=[{'all':!![]}];}return db[_0x35ff('0x39')][_0x35ff('0x3b')](_0x57339d);})[_0x35ff('0x1e')](function(_0x4b1e3e){_0x257501['rows']=_0x4b1e3e;return _0x257501;})[_0x35ff('0x1e')](respondWithFilteredResult(_0x3f9440,_0x57339d))[_0x35ff('0x3c')](handleError(_0x3f9440,null));};exports[_0x35ff('0x3d')]=function(_0x1cd2c8,_0xb1f6ca){var _0x2ff794={'raw':!![],'where':{'id':_0x1cd2c8['params']['id']}},_0x346758={};_0x346758['model']=_[_0x35ff('0x2a')](db[_0x35ff('0x39')][_0x35ff('0x27')]);_0x346758['query']=_[_0x35ff('0x2a')](_0x1cd2c8[_0x35ff('0x2b')]);_0x346758['filters']=_['intersection'](_0x346758[_0x35ff('0x2d')],_0x346758['query']);_0x2ff794[_0x35ff('0x2e')]=_[_0x35ff('0x2c')](_0x346758['model'],qs[_0x35ff('0x2f')](_0x1cd2c8['query']['fields']));_0x2ff794[_0x35ff('0x2e')]=_0x2ff794[_0x35ff('0x2e')][_0x35ff('0x30')]?_0x2ff794[_0x35ff('0x2e')]:_0x346758[_0x35ff('0x2d')];if(_0x1cd2c8[_0x35ff('0x2b')][_0x35ff('0x3e')]){_0x2ff794[_0x35ff('0x3a')]=[{'all':!![]}];}_0x2ff794=_[_0x35ff('0x37')]({},_0x2ff794,_0x1cd2c8[_0x35ff('0x38')]);return db[_0x35ff('0x39')][_0x35ff('0x3f')](_0x2ff794)['then'](handleEntityNotFound(_0xb1f6ca,null))[_0x35ff('0x1e')](respondWithResult(_0xb1f6ca,null))[_0x35ff('0x3c')](handleError(_0xb1f6ca,null));};exports[_0x35ff('0x40')]=function(_0x2d26e2,_0x506def){return db['Tag'][_0x35ff('0x40')](_0x2d26e2['body'],{})[_0x35ff('0x1e')](function(_0x2caefe){var _0x14aa90=_0x2d26e2[_0x35ff('0x41')][_0x35ff('0x42')]({'plain':!![]});if(!_0x14aa90)throw new Error(_0x35ff('0x43'));if(_0x14aa90[_0x35ff('0x44')]===_0x35ff('0x41')){var _0x3be5fc=_0x2caefe['get']({'plain':!![]});var _0x48e22b=_0x35ff('0x45');return db['UserProfileSection'][_0x35ff('0x3f')]({'where':{'name':_0x48e22b,'userProfileId':_0x14aa90[_0x35ff('0x46')]},'raw':!![]})[_0x35ff('0x1e')](function(_0x255bdc){if(_0x255bdc&&_0x255bdc[_0x35ff('0x47')]===0x0){return db[_0x35ff('0x48')][_0x35ff('0x40')]({'name':_0x3be5fc[_0x35ff('0x23')],'resourceId':_0x3be5fc['id'],'type':_0x255bdc[_0x35ff('0x23')],'sectionId':_0x255bdc['id']},{})['then'](function(){return _0x2caefe;});}else{return _0x2caefe;}})[_0x35ff('0x3c')](function(_0x39b65f){logger[_0x35ff('0x21')](_0x35ff('0x49'),_0x39b65f);throw _0x39b65f;});}return _0x2caefe;})['then'](respondWithResult(_0x506def,0xc9))['catch'](handleError(_0x506def,null));};exports['update']=function(_0x211bb2,_0x5b410d){if(_0x211bb2[_0x35ff('0x4a')]['id']){delete _0x211bb2['body']['id'];}return db[_0x35ff('0x39')]['find']({'where':{'id':_0x211bb2[_0x35ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b410d,null))[_0x35ff('0x1e')](saveUpdates(_0x211bb2[_0x35ff('0x4a')],null))[_0x35ff('0x1e')](respondWithResult(_0x5b410d,null))[_0x35ff('0x3c')](handleError(_0x5b410d,null));};exports['destroy']=function(_0x497b38,_0x2be86b){return db['Tag'][_0x35ff('0x3f')]({'where':{'id':_0x497b38[_0x35ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2be86b,null))[_0x35ff('0x1e')](removeEntity(_0x2be86b,null))['catch'](handleError(_0x2be86b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5051=['exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x4179c9,_0x5330a2){var _0x1f3a00=function(_0x538d58){while(--_0x538d58){_0x4179c9['push'](_0x4179c9['shift']());}};_0x1f3a00(++_0x5330a2);}(_0x5051,0x1b7));var _0x1505=function(_0x22d5de,_0x49fe19){_0x22d5de=_0x22d5de-0x0;var _0x3cf129=_0x5051[_0x22d5de];return _0x3cf129;};'use strict';var _=require(_0x1505('0x0'));var util=require(_0x1505('0x1'));var logger=require(_0x1505('0x2'))(_0x1505('0x3'));var moment=require(_0x1505('0x4'));var BPromise=require(_0x1505('0x5'));var rp=require(_0x1505('0x6'));var fs=require('fs');var path=require(_0x1505('0x7'));var rimraf=require(_0x1505('0x8'));var config=require(_0x1505('0x9'));var attributes=require(_0x1505('0xa'));module[_0x1505('0xb')]=function(_0x2d475d,_0x44aa85){return _0x2d475d[_0x1505('0xc')](_0x1505('0xd'),attributes,{'tableName':_0x1505('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7387=['exports','define','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x57d3d9,_0x2d605b){var _0x46730c=function(_0x1e7019){while(--_0x1e7019){_0x57d3d9['push'](_0x57d3d9['shift']());}};_0x46730c(++_0x2d605b);}(_0x7387,0x7b));var _0x7738=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7387[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x7738('0x0'));var util=require(_0x7738('0x1'));var logger=require(_0x7738('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7738('0x3'));var rp=require(_0x7738('0x4'));var fs=require('fs');var path=require(_0x7738('0x5'));var rimraf=require(_0x7738('0x6'));var config=require(_0x7738('0x7'));var attributes=require(_0x7738('0x8'));module[_0x7738('0x9')]=function(_0x426e29,_0x54fc0e){return _0x426e29[_0x7738('0xa')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x5089,0x1bb));var _0x9508=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0x5089[_0x2242a1];return _0x2c298b;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('Tag,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});}
\ No newline at end of file
+var _0x4fef=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x575878,_0x376a4b){var _0x537370=function(_0x5b98da){while(--_0x5b98da){_0x575878['push'](_0x575878['shift']());}};_0x537370(++_0x376a4b);}(_0x4fef,0x10f));var _0xf4fe=function(_0x23b22e,_0x1cc1de){_0x23b22e=_0x23b22e-0x0;var _0x5ee429=_0x4fef[_0x23b22e];return _0x5ee429;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var moment=require('moment');var BPromise=require(_0xf4fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4fe('0x3'));var db=require(_0xf4fe('0x4'))['db'];var utils=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var jayson=require(_0xf4fe('0x9'));var client=jayson[_0xf4fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363096,_0x3e844d,_0x4805b0){return new BPromise(function(_0x23b761,_0x1e858f){return client[_0xf4fe('0xb')](_0x363096,_0x4805b0)[_0xf4fe('0xc')](function(_0xdec534){logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,_0xf4fe('0xf'));logger['debug'](_0xf4fe('0x10'),_0x3e844d,'request\x20sent',JSON[_0xf4fe('0x11')](_0xdec534));if(_0xdec534[_0xf4fe('0x12')]){if(_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x13')]===0x1f4){logger[_0xf4fe('0x12')]('Tag,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x1e858f(_0xdec534[_0xf4fe('0x12')]['message']);}logger[_0xf4fe('0x12')]('Tag,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x23b761(_0xdec534[_0xf4fe('0x12')]['message']);}else{logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,'request\x20sent');_0x23b761(_0xdec534[_0xf4fe('0x15')][_0xf4fe('0x14')]);}})[_0xf4fe('0x16')](function(_0x565dc6){logger['error'](_0xf4fe('0xe'),_0x3e844d,_0x565dc6);_0x1e858f(_0x565dc6);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x73d0c4,_0xc1727e){var _0x3c8bd6=function(_0x14f4f3){while(--_0x14f4f3){_0x73d0c4['push'](_0x73d0c4['shift']());}};_0x3c8bd6(++_0xc1727e);}(_0xb10b,0x12a));var _0xbb10=function(_0x109946,_0x3494b7){_0x109946=_0x109946-0x0;var _0x4ed20b=_0xb10b[_0x109946];return _0x4ed20b;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x1e846c,_0x20e555){var _0x109c36=function(_0x4ad809){while(--_0x4ad809){_0x1e846c['push'](_0x1e846c['shift']());}};_0x109c36(++_0x20e555);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x556e=['transaction','through','penalty','QueueId','TeamVoiceQueue','Queue','Queue:save','findAll','online','voicePause','upsert','isNil','interface','format','SIP/%s','all','spread','removeAgents','Mail','emit','Queue:remove','UserVoiceQueueRt','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','error','stack','name','send','index','Team','rawAttributes','fieldName','type','key','map','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','include','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','sequelize','Sequelize','UserId','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','channel','toLowerCase','capitalize','Queues','findOne','ValidationError','Unknown\x20channel','add','ids','removeQueues','isValidChannel','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x556e,0x158));var _0xe556=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x556e[_0x218994];return _0x3f350b;};'use strict';var emlformat=require(_0xe556('0x0'));var rimraf=require(_0xe556('0x1'));var zipdir=require(_0xe556('0x2'));var jsonpatch=require(_0xe556('0x3'));var rp=require(_0xe556('0x4'));var moment=require(_0xe556('0x5'));var BPromise=require(_0xe556('0x6'));var Mustache=require(_0xe556('0x7'));var util=require(_0xe556('0x8'));var path=require(_0xe556('0x9'));var sox=require(_0xe556('0xa'));var csv=require(_0xe556('0xb'));var ejs=require(_0xe556('0xc'));var fs=require('fs');var fs_extra=require(_0xe556('0xd'));var _=require('lodash');var squel=require(_0xe556('0xe'));var crypto=require(_0xe556('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe556('0x10'));var toCsv=require(_0xe556('0xb'));var querystring=require(_0xe556('0x11'));var Papa=require(_0xe556('0x12'));var Redis=require(_0xe556('0x13'));var authService=require(_0xe556('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe556('0x15'));var logger=require(_0xe556('0x16'))(_0xe556('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe556('0x18'));var db=require(_0xe556('0x19'))['db'];config[_0xe556('0x1a')]=_[_0xe556('0x1b')](config[_0xe556('0x1a')],{'host':_0xe556('0x1c'),'port':0x18eb});var socket=require(_0xe556('0x1d'))(new Redis(config[_0xe556('0x1a')]));require(_0xe556('0x1e'))['register'](socket);function respondWithStatusCode(_0x4b16cc,_0x2669a8){_0x2669a8=_0x2669a8||0xcc;return function(_0x300907){if(_0x300907){return _0x4b16cc[_0xe556('0x1f')](_0x2669a8);}return _0x4b16cc[_0xe556('0x20')](_0x2669a8)['end']();};}function respondWithResult(_0x540c4c,_0x34439a){_0x34439a=_0x34439a||0xc8;return function(_0x1812c6){if(_0x1812c6){return _0x540c4c[_0xe556('0x20')](_0x34439a)[_0xe556('0x21')](_0x1812c6);}};}function respondWithFilteredResult(_0x2a53bc,_0x1882db){return function(_0x10105b){if(_0x10105b){var _0x2e75bd=typeof _0x1882db[_0xe556('0x22')]===_0xe556('0x23')&&typeof _0x1882db[_0xe556('0x24')]===_0xe556('0x23');var _0x1bf6f=_0x10105b[_0xe556('0x25')];var _0x55a815=_0x2e75bd?0x0:_0x1882db[_0xe556('0x22')];var _0x2b1bd5=_0x2e75bd?_0x10105b[_0xe556('0x25')]:_0x1882db[_0xe556('0x22')]+_0x1882db[_0xe556('0x24')];var _0xf43706;if(_0x2b1bd5>=_0x1bf6f){_0x2b1bd5=_0x1bf6f;_0xf43706=0xc8;}else{_0xf43706=0xce;}_0x2a53bc['status'](_0xf43706);return _0x2a53bc[_0xe556('0x26')]('Content-Range',_0x55a815+'-'+_0x2b1bd5+'/'+_0x1bf6f)[_0xe556('0x21')](_0x10105b);}return null;};}function patchUpdates(_0xe36cb8){return function(_0x549e7b){try{jsonpatch[_0xe556('0x27')](_0x549e7b,_0xe36cb8,!![]);}catch(_0x7a1509){return BPromise[_0xe556('0x28')](_0x7a1509);}return _0x549e7b['save']();};}function saveUpdates(_0x5bfe2a,_0xe95cd8){return function(_0x365af1){if(_0x365af1){return _0x365af1[_0xe556('0x29')](_0x5bfe2a)['then'](function(_0x3bc255){return _0x3bc255;});}return null;};}function handleEntityNotFound(_0x7aa200,_0x185aff){return function(_0x38ca94){if(!_0x38ca94){_0x7aa200['sendStatus'](0x194);}return _0x38ca94;};}function handleError(_0x50a19e,_0x5abe25){_0x5abe25=_0x5abe25||0x1f4;return function(_0x48e452){logger[_0xe556('0x2a')](_0x48e452[_0xe556('0x2b')]);if(_0x48e452[_0xe556('0x2c')]){delete _0x48e452[_0xe556('0x2c')];}_0x50a19e[_0xe556('0x20')](_0x5abe25)[_0xe556('0x2d')](_0x48e452);};}exports[_0xe556('0x2e')]=function(_0x295fc2,_0x21bf13){var _0x514677={},_0x4ed4a={},_0x501f8a={'count':0x0,'rows':[]};var _0x365242=_['map'](db[_0xe556('0x2f')][_0xe556('0x30')],function(_0xa76ab5){return{'name':_0xa76ab5[_0xe556('0x31')],'type':_0xa76ab5[_0xe556('0x32')][_0xe556('0x33')]};});_0x4ed4a['model']=_[_0xe556('0x34')](_0x365242,_0xe556('0x2c'));_0x4ed4a['query']=_[_0xe556('0x35')](_0x295fc2[_0xe556('0x36')]);_0x4ed4a['filters']=_[_0xe556('0x37')](_0x4ed4a['model'],_0x4ed4a[_0xe556('0x36')]);_0x514677[_0xe556('0x38')]=_[_0xe556('0x37')](_0x4ed4a[_0xe556('0x39')],qs[_0xe556('0x3a')](_0x295fc2[_0xe556('0x36')][_0xe556('0x3a')]));_0x514677[_0xe556('0x38')]=_0x514677['attributes'][_0xe556('0x3b')]?_0x514677[_0xe556('0x38')]:_0x4ed4a[_0xe556('0x39')];if(!_0x295fc2[_0xe556('0x36')][_0xe556('0x3c')](_0xe556('0x3d'))){_0x514677[_0xe556('0x24')]=qs[_0xe556('0x24')](_0x295fc2[_0xe556('0x36')]['limit']);_0x514677[_0xe556('0x22')]=qs[_0xe556('0x22')](_0x295fc2[_0xe556('0x36')][_0xe556('0x22')]);}_0x514677[_0xe556('0x3e')]=qs[_0xe556('0x3f')](_0x295fc2[_0xe556('0x36')][_0xe556('0x3f')]);_0x514677['where']=qs[_0xe556('0x40')](_[_0xe556('0x41')](_0x295fc2['query'],_0x4ed4a[_0xe556('0x40')]),_0x365242);if(_0x295fc2[_0xe556('0x36')][_0xe556('0x42')]){_0x514677[_0xe556('0x43')]=_[_0xe556('0x44')](_0x514677[_0xe556('0x43')],{'$or':_['map'](_0x365242,function(_0x1d9231){if(_0x1d9231[_0xe556('0x32')]!==_0xe556('0x45')){var _0x5a075d={};_0x5a075d[_0x1d9231[_0xe556('0x2c')]]={'$like':'%'+_0x295fc2[_0xe556('0x36')][_0xe556('0x42')]+'%'};return _0x5a075d;}})});}_0x514677=_[_0xe556('0x44')]({},_0x514677,_0x295fc2[_0xe556('0x46')]);var _0x3f40f1={'where':_0x514677[_0xe556('0x43')]};return db[_0xe556('0x2f')][_0xe556('0x25')](_0x3f40f1)[_0xe556('0x47')](function(_0x3d92d8){_0x501f8a[_0xe556('0x25')]=_0x3d92d8;if(_0x295fc2[_0xe556('0x36')]['includeAll']){_0x514677[_0xe556('0x48')]=[{'all':!![]}];}return db['Team']['findAll'](_0x514677);})[_0xe556('0x47')](function(_0x342630){_0x501f8a['rows']=_0x342630;return _0x501f8a;})[_0xe556('0x47')](respondWithFilteredResult(_0x21bf13,_0x514677))['catch'](handleError(_0x21bf13,null));};exports[_0xe556('0x49')]=function(_0x5433d5,_0x3eecf4){var _0x2c244d={'raw':![],'where':{'id':_0x5433d5['params']['id']}},_0x592442={};_0x592442[_0xe556('0x39')]=_[_0xe556('0x35')](db[_0xe556('0x2f')][_0xe556('0x30')]);_0x592442['query']=_[_0xe556('0x35')](_0x5433d5[_0xe556('0x36')]);_0x592442[_0xe556('0x40')]=_[_0xe556('0x37')](_0x592442[_0xe556('0x39')],_0x592442[_0xe556('0x36')]);_0x2c244d[_0xe556('0x38')]=_[_0xe556('0x37')](_0x592442[_0xe556('0x39')],qs[_0xe556('0x3a')](_0x5433d5['query']['fields']));_0x2c244d['attributes']=_0x2c244d[_0xe556('0x38')][_0xe556('0x3b')]?_0x2c244d['attributes']:_0x592442[_0xe556('0x39')];if(_0x5433d5['query']['includeAll']){_0x2c244d[_0xe556('0x48')]=[{'all':!![]}];}_0x2c244d=_[_0xe556('0x44')]({},_0x2c244d,_0x5433d5[_0xe556('0x46')]);return db['Team']['find'](_0x2c244d)['then'](handleEntityNotFound(_0x3eecf4,null))[_0xe556('0x47')](respondWithResult(_0x3eecf4,null))[_0xe556('0x4a')](handleError(_0x3eecf4,null));};exports[_0xe556('0x4b')]=function(_0x36333e,_0x26566e){return db[_0xe556('0x2f')][_0xe556('0x4b')](_0x36333e[_0xe556('0x4c')],{})[_0xe556('0x47')](function(_0xe7b328){var _0x3397a7=_0x36333e[_0xe556('0x4d')]['get']({'plain':!![]});if(!_0x3397a7)throw new Error(_0xe556('0x4e'));if(_0x3397a7[_0xe556('0x4f')]==='user'){var _0xbf5205=_0xe7b328[_0xe556('0x50')]({'plain':!![]});var _0x3949db='Teams';return db[_0xe556('0x51')][_0xe556('0x52')]({'where':{'name':_0x3949db,'userProfileId':_0x3397a7[_0xe556('0x53')]},'raw':!![]})[_0xe556('0x47')](function(_0x281f3d){if(_0x281f3d&&_0x281f3d[_0xe556('0x54')]===0x0){return db[_0xe556('0x55')][_0xe556('0x4b')]({'name':_0xbf5205[_0xe556('0x2c')],'resourceId':_0xbf5205['id'],'type':_0x281f3d[_0xe556('0x2c')],'sectionId':_0x281f3d['id']},{})['then'](function(){return _0xe7b328;});}else{return _0xe7b328;}})['catch'](function(_0x32c4f5){logger[_0xe556('0x2a')](_0xe556('0x56'),_0x32c4f5);throw _0x32c4f5;});}return _0xe7b328;})[_0xe556('0x47')](respondWithResult(_0x26566e,0xc9))[_0xe556('0x4a')](handleError(_0x26566e,null));};exports['update']=function(_0x5d5c2b,_0x6e4221){if(_0x5d5c2b[_0xe556('0x4c')]['id']){delete _0x5d5c2b['body']['id'];}return db[_0xe556('0x2f')]['find']({'where':{'id':_0x5d5c2b['params']['id']}})['then'](handleEntityNotFound(_0x6e4221,null))[_0xe556('0x47')](saveUpdates(_0x5d5c2b['body'],null))[_0xe556('0x47')](respondWithResult(_0x6e4221,null))[_0xe556('0x4a')](handleError(_0x6e4221,null));};exports['destroy']=function(_0x1aba9b,_0x4ab138){var _0xe7b99e=_0x1aba9b[_0xe556('0x57')]['id'];var _0x50542b=[];return db[_0xe556('0x58')]['transaction'](function(_0xb084b7){var _0x3e35d9='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x3e35d9,{'type':db[_0xe556('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xb084b7})[_0xe556('0x47')](function(_0x17c34d){_0x50542b=_[_0xe556('0x34')](_0x17c34d,function(_0x345c61){return Number(_0x345c61[_0xe556('0x5a')]);});})[_0xe556('0x47')](function(){var _0x51b2a5='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x51b2a5,{'type':db[_0xe556('0x59')][_0xe556('0x5b')][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})[_0xe556('0x47')](function(_0x407a60){var _0x2ef58e=_[_0xe556('0x34')](_0x407a60,function(_0x1bc2de){return Number(_0x1bc2de[_0xe556('0x5d')]);});return db[_0xe556('0x5e')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'VoiceQueueId':{'$in':_0x2ef58e}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x51202f=_0xe556('0x60')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x51202f,{'type':db[_0xe556('0x59')]['QueryTypes'][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x4c22d2){var _0x43fb96=_[_0xe556('0x34')](_0x4c22d2,function(_0x26d629){return Number(_0x26d629[_0xe556('0x61')]);});return db[_0xe556('0x62')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'MailQueueId':{'$in':_0x43fb96}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x3225f0=_0xe556('0x63')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x3225f0,{'type':db[_0xe556('0x59')]['QueryTypes'][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x16488c){var _0x4462ab=_[_0xe556('0x34')](_0x16488c,function(_0x520db1){return Number(_0x520db1[_0xe556('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x50542b},'SmsQueueId':{'$in':_0x4462ab}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x19a2f4=_0xe556('0x65')+_0xe7b99e;return db['sequelize'][_0xe556('0x36')](_0x19a2f4,{'type':db[_0xe556('0x59')][_0xe556('0x5b')]['SELECT'],'raw':!![],'transaction':_0xb084b7});})[_0xe556('0x47')](function(_0x14d557){var _0x1163c7=_[_0xe556('0x34')](_0x14d557,function(_0x459b10){return Number(_0x459b10['ChatQueueId']);});return db[_0xe556('0x66')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'ChatQueueId':{'$in':_0x1163c7}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0xf5199b=_0xe556('0x67')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0xf5199b,{'type':db['Sequelize']['QueryTypes'][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x4c4dbd){var _0x4c5cf4=_[_0xe556('0x34')](_0x4c4dbd,function(_0x968a0e){return Number(_0x968a0e[_0xe556('0x68')]);});return db[_0xe556('0x69')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'FaxQueueId':{'$in':_0x4c5cf4}},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){var _0x44afd2=_0xe556('0x6a')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x44afd2,{'type':db[_0xe556('0x59')][_0xe556('0x5b')][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x27c1d2){var _0x7a0399=_[_0xe556('0x34')](_0x27c1d2,function(_0x1a9fc2){return Number(_0x1a9fc2[_0xe556('0x6b')]);});return db[_0xe556('0x6c')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'OpenchannelQueueId':{'$in':_0x7a0399}},'transaction':_0xb084b7});})['then'](function(){var _0x5c54f3=_0xe556('0x6d')+_0xe7b99e;return db[_0xe556('0x58')][_0xe556('0x36')](_0x5c54f3,{'type':db['Sequelize'][_0xe556('0x5b')][_0xe556('0x5c')],'raw':!![],'transaction':_0xb084b7});})['then'](function(_0x3075c0){var _0x4ceac5=_[_0xe556('0x34')](_0x3075c0,function(_0x5e0453){return Number(_0x5e0453[_0xe556('0x6e')]);});return db[_0xe556('0x6f')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'WhatsappQueueId':{'$in':_0x4ceac5}},'transaction':_0xb084b7});})['then'](function(){return db[_0xe556('0x70')][_0xe556('0x52')]({'where':{'TeamId':_0xe7b99e}});})[_0xe556('0x47')](function(_0x55c5f9){if(_0x55c5f9===null){return;}return db[_0xe556('0x71')][_0xe556('0x5f')]({'where':{'UserId':{'$in':_0x50542b},'VoicePrefixId':_0x55c5f9[_0xe556('0x72')]},'transaction':_0xb084b7});})[_0xe556('0x47')](function(){return db[_0xe556('0x2f')][_0xe556('0x5f')]({'where':{'id':_0xe7b99e},'cascade':!![],'transaction':_0xb084b7});})[_0xe556('0x47')](function(_0x427b65){if(_0x427b65===0x0){_0x4ab138[_0xe556('0x1f')](0x194);}else{return db['UserProfileResource'][_0xe556('0x5f')]({'where':{'type':_0xe556('0x73'),'resourceId':_0xe7b99e},'cascade':!![],'transaction':_0xb084b7})[_0xe556('0x47')](function(){_0x4ab138[_0xe556('0x20')](0xcc)['end']();});}})['catch'](function(_0x4b38d8){_0x4ab138[_0xe556('0x20')](0x1f4)[_0xe556('0x2d')](_0x4b38d8);});});};exports['getQueues']=function(_0x30a074,_0x31689b,_0x3d6281){return db['Team']['findOne']({'where':{'id':_0x30a074['params']['id']}})[_0xe556('0x47')](handleEntityNotFound(_0x31689b,null))[_0xe556('0x47')](function(_0x3826e5){if(!_0x30a074[_0xe556('0x36')][_0xe556('0x74')]||!utils['isValidChannel'](_0x30a074[_0xe556('0x36')][_0xe556('0x74')])){throw new db[(_0xe556('0x59'))]['ValidationError']('Unknown\x20channel');}var _0x4276db={};var _0x46137d={};_0x46137d[_0xe556('0x39')]=_[_0xe556('0x35')](db[_['capitalize'](_0x30a074[_0xe556('0x36')][_0xe556('0x74')][_0xe556('0x75')]())+'Queue'][_0xe556('0x30')]);_0x46137d[_0xe556('0x36')]=_[_0xe556('0x35')](_0x30a074[_0xe556('0x36')]);_0x46137d[_0xe556('0x40')]=_[_0xe556('0x37')](_0x46137d[_0xe556('0x39')],_0x46137d['query']);_0x4276db[_0xe556('0x38')]=_[_0xe556('0x37')](_0x46137d[_0xe556('0x39')],qs['fields'](_0x30a074[_0xe556('0x36')][_0xe556('0x3a')]));_0x4276db[_0xe556('0x38')]=_0x4276db[_0xe556('0x38')][_0xe556('0x3b')]?_0x4276db[_0xe556('0x38')]:_0x46137d[_0xe556('0x39')];_0x4276db[_0xe556('0x24')]=qs[_0xe556('0x24')](_0x30a074[_0xe556('0x36')]['limit']);_0x4276db[_0xe556('0x22')]=qs[_0xe556('0x22')](_0x30a074['query'][_0xe556('0x22')]);_0x4276db[_0xe556('0x3e')]=qs[_0xe556('0x3f')](_0x30a074[_0xe556('0x36')]['sort']);_0x4276db['where']=qs[_0xe556('0x40')](_[_0xe556('0x41')](_0x30a074[_0xe556('0x36')],_0x46137d[_0xe556('0x40')]));_0x4276db=_[_0xe556('0x44')]({},_0x4276db,_0x30a074[_0xe556('0x46')]);return _0x3826e5[_0xe556('0x50')+_[_0xe556('0x76')](_0x30a074[_0xe556('0x36')][_0xe556('0x74')][_0xe556('0x75')]())+_0xe556('0x77')](_0x4276db);})[_0xe556('0x47')](respondWithResult(_0x31689b,null))['catch'](handleError(_0x31689b,null));};exports['addQueues']=function(_0x516959,_0x4da569,_0x3eb9bf){return db['Team'][_0xe556('0x78')]({'where':{'id':_0x516959[_0xe556('0x57')]['id']}})[_0xe556('0x47')](function(_0x2a5068){if(_0x2a5068){if(!_0x516959[_0xe556('0x4c')]['channel']||!utils['isValidChannel'](_0x516959[_0xe556('0x4c')][_0xe556('0x74')])){throw new db['Sequelize'][(_0xe556('0x79'))](_0xe556('0x7a'));}return _0x2a5068[_0xe556('0x7b')+_[_0xe556('0x76')](_0x516959[_0xe556('0x4c')][_0xe556('0x74')][_0xe556('0x75')]())+_0xe556('0x77')](_0x516959[_0xe556('0x4c')][_0xe556('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x4da569,null))['then'](respondWithStatusCode(_0x4da569,null))[_0xe556('0x4a')](handleError(_0x4da569,null));};exports[_0xe556('0x7d')]=function(_0x3be4e1,_0x588500,_0xe0878){return db[_0xe556('0x2f')]['findOne']({'where':{'id':_0x3be4e1[_0xe556('0x57')]['id']}})['then'](function(_0x1c747e){if(_0x1c747e){if(!_0x3be4e1['query']['channel']||!utils[_0xe556('0x7e')](_0x3be4e1['query'][_0xe556('0x74')])){throw new db[(_0xe556('0x59'))][(_0xe556('0x79'))]('Unknown\x20channel');}return _0x1c747e[_0xe556('0x7f')+_[_0xe556('0x76')](_0x3be4e1[_0xe556('0x36')][_0xe556('0x74')][_0xe556('0x75')]())+_0xe556('0x77')](_0x3be4e1[_0xe556('0x36')][_0xe556('0x7c')]);}return null;})[_0xe556('0x47')](handleEntityNotFound(_0x588500,null))[_0xe556('0x47')](respondWithStatusCode(_0x588500,null))[_0xe556('0x4a')](handleError(_0x588500,null));};exports[_0xe556('0x80')]=function(_0x3c0cdb,_0x273480){var _0x5e1b2b=_[_0xe556('0x81')](_0x3c0cdb[_0xe556('0x4c')][_0xe556('0x7c')])?_0x3c0cdb['body']['ids']:[_0x3c0cdb[_0xe556('0x4c')][_0xe556('0x7c')]];var _0x2523e2=_0x3c0cdb[_0xe556('0x57')]['id'];return db['Team']['find']({'where':{'id':_0x2523e2}})['then'](handleEntityNotFound(_0x273480,null))[_0xe556('0x47')](function(_0x5baa7e){if(_0x5baa7e){var _0x42e3c7=[_0xe556('0x82'),_0xe556('0x83'),'Mail',_0xe556('0x84'),_0xe556('0x85'),_0xe556('0x86'),_0xe556('0x87')];return db[_0xe556('0x58')][_0xe556('0x88')](function(_0x4c18e5){var _0x298ddd=_[_0xe556('0x34')](_0x42e3c7,function(_0x1d27f0){var _0x36ffdd={'attributes':['id',_0xe556('0x2c')]};if(_0x1d27f0===_0xe556('0x82')){_0x36ffdd[_0xe556('0x89')]={'attributes':[_0xe556('0x8a')]};}return _0x5baa7e['get'+_0x1d27f0+_0xe556('0x77')](_0x36ffdd)['then'](function(_0x2c4527){var _0x72cfe6=_['map'](_0x2c4527,function(_0x529b01){var _0x23bdb0=_[_0xe556('0x34')](_0x5e1b2b,function(_0x557031){var _0x2d724c={'where':{'UserId':_0x557031,[_0x1d27f0+_0xe556('0x8b')]:_0x529b01['id']},'transaction':_0x4c18e5};if(_0x1d27f0===_0xe556('0x82')){_0x2d724c[_0xe556('0x1b')]={'penalty':_0x529b01[_0xe556('0x8c')][_0xe556('0x8a')]};}return db['User'+_0x1d27f0+_0xe556('0x8d')]['findOrCreate'](_0x2d724c)[_0xe556('0x47')](function(){socket['emit'](_0xe556('0x4d')+_0x1d27f0+_0xe556('0x8e'),{'UserId':_0x557031,[_0x1d27f0+_0xe556('0x8b')]:_0x529b01['id']});if(_0x1d27f0!==_0xe556('0x82')){return;}return db['User'][_0xe556('0x8f')]({'where':{'id':_0x5e1b2b,'online':0x1},'attributes':['id','name',_0xe556('0x90'),_0xe556('0x91'),'interface'],'raw':!![]})['then'](function(_0x573ac4){var _0x441112=_[_0xe556('0x34')](_0x573ac4,function(_0x29558d){return db['UserVoiceQueueRt'][_0xe556('0x92')]({'membername':_0x29558d['name'],'UserId':_0x29558d['id'],'queue_name':_0x529b01[_0xe556('0x2c')],'VoiceQueueId':_0x529b01['id'],'interface':_[_0xe556('0x93')](_0x29558d[_0xe556('0x94')])?util[_0xe556('0x95')](_0xe556('0x96'),_0x29558d[_0xe556('0x2c')]):_0x29558d['interface'],'paused':_0x29558d[_0xe556('0x91')]||![],'penalty':_0x529b01[_0xe556('0x8c')][_0xe556('0x8a')]},{'transaction':_0x4c18e5});});return Promise[_0xe556('0x97')](_0x441112);});});});return Promise[_0xe556('0x97')](_0x23bdb0);});return Promise[_0xe556('0x97')](_0x72cfe6);})[_0xe556('0x47')](function(){return db[_0xe556('0x70')]['findOne']({'where':{'teamId':_0x2523e2}})[_0xe556('0x47')](function(_0x2a2729){if(_0x2a2729){var _0x1edc3f=_[_0xe556('0x34')](_0x5e1b2b,function(_0x3ae632){db['UserVoicePrefix'][_0xe556('0x92')]({'UserId':_0x3ae632,'VoicePrefixId':_0x2a2729[_0xe556('0x72')]});});return Promise['all'](_0x1edc3f);}});});});return Promise[_0xe556('0x97')](_0x298ddd)[_0xe556('0x47')](function(){return _0x5baa7e['addAgents'](_0x5e1b2b,{'transaction':_0x4c18e5})[_0xe556('0x98')](function(_0x1dc76d){return _0x1dc76d;});});});}})[_0xe556('0x47')](respondWithResult(_0x273480,null))[_0xe556('0x4a')](handleError(_0x273480,null));};exports[_0xe556('0x99')]=function(_0x169cc8,_0x1731fa){var _0x20acad=_[_0xe556('0x81')](_0x169cc8[_0xe556('0x36')]['ids'])?_0x169cc8[_0xe556('0x36')]['ids']:[_0x169cc8[_0xe556('0x36')]['ids']];var _0x36c595=_0x169cc8['params']['id'];return db[_0xe556('0x2f')]['find']({'where':{'id':_0x36c595}})['then'](handleEntityNotFound(_0x1731fa,null))[_0xe556('0x47')](function(_0x2de076){if(_0x2de076){var _0x3d67ad=[_0xe556('0x82'),_0xe556('0x83'),_0xe556('0x9a'),_0xe556('0x84'),_0xe556('0x85'),_0xe556('0x86'),'Whatsapp'];return db[_0xe556('0x58')][_0xe556('0x88')](function(_0x1ac02e){var _0x3de6e0=_[_0xe556('0x34')](_0x3d67ad,function(_0x17a8d1){var _0x522a5c={'attributes':['id',_0xe556('0x2c')]};return _0x2de076[_0xe556('0x50')+_0x17a8d1+_0xe556('0x77')](_0x522a5c)[_0xe556('0x47')](function(_0x175221){var _0x3a30d8=_[_0xe556('0x34')](_0x175221,function(_0x525a10){return _0x525a10[_0xe556('0x99')](_0x20acad,{'transaction':_0x1ac02e})['then'](function(){var _0x361539=_[_0xe556('0x34')](_0x20acad,function(_0x5289ea){socket[_0xe556('0x9b')]('user'+_0x17a8d1+_0xe556('0x9c'),{'UserId':Number(_0x5289ea),[_0x17a8d1+_0xe556('0x8b')]:_0x525a10['id']});if(_0x17a8d1!==_0xe556('0x82')){return;}return db[_0xe556('0x9d')][_0xe556('0x5f')]({'where':{'VoiceQueueId':_0x525a10['id'],'UserId':_0x5289ea},'transaction':_0x1ac02e});});return Promise[_0xe556('0x97')](_0x361539);});});return Promise[_0xe556('0x97')](_0x3a30d8);});});return Promise[_0xe556('0x97')](_0x3de6e0)['then'](function(){return _0x2de076[_0xe556('0x99')](_0x20acad,{'transaction':_0x1ac02e});})[_0xe556('0x47')](function(){return db[_0xe556('0x70')][_0xe556('0x78')]({'where':{'teamId':_0x36c595}})[_0xe556('0x47')](function(_0x127829){if(_0x127829){var _0x594453=_[_0xe556('0x34')](_0x20acad,function(_0x161988){db[_0xe556('0x71')][_0xe556('0x5f')]({'where':{'UserId':_0x161988,'VoicePrefixId':_0x127829[_0xe556('0x72')]}});});return Promise[_0xe556('0x97')](_0x594453);}});});});}})[_0xe556('0x47')](respondWithStatusCode(_0x1731fa,null))[_0xe556('0x4a')](handleError(_0x1731fa,null));};exports[_0xe556('0x9e')]=function(_0xc3e56c,_0x2923cb,_0x317d36){var _0x29ec5e={};var _0xa2fa3c={};var _0xc2d72b;var _0x4e7587;return db[_0xe556('0x2f')][_0xe556('0x78')]({'where':{'id':_0xc3e56c[_0xe556('0x57')]['id']}})[_0xe556('0x47')](handleEntityNotFound(_0x2923cb,null))['then'](function(_0x84c34f){if(_0x84c34f){_0xc2d72b=_0x84c34f;_0xa2fa3c[_0xe556('0x39')]=_[_0xe556('0x35')](db[_0xe556('0x9f')][_0xe556('0x30')]);_0xa2fa3c[_0xe556('0x36')]=_[_0xe556('0x35')](_0xc3e56c[_0xe556('0x36')]);_0xa2fa3c['filters']=_[_0xe556('0x37')](_0xa2fa3c[_0xe556('0x39')],_0xa2fa3c[_0xe556('0x36')]);_0x29ec5e[_0xe556('0x38')]=_[_0xe556('0x37')](_0xa2fa3c[_0xe556('0x39')],qs['fields'](_0xc3e56c[_0xe556('0x36')]['fields']));_0x29ec5e[_0xe556('0x38')]=_0x29ec5e[_0xe556('0x38')]['length']?_0x29ec5e[_0xe556('0x38')]:_0xa2fa3c['model'];_0x29ec5e[_0xe556('0x3e')]=qs[_0xe556('0x3f')](_0xc3e56c[_0xe556('0x36')][_0xe556('0x3f')]);_0x29ec5e[_0xe556('0x43')]=qs[_0xe556('0x40')](_[_0xe556('0x41')](_0xc3e56c[_0xe556('0x36')],_0xa2fa3c[_0xe556('0x40')]));if(_0xc3e56c[_0xe556('0x36')][_0xe556('0x42')]){_0x29ec5e[_0xe556('0x43')]=_[_0xe556('0x44')](_0x29ec5e[_0xe556('0x43')],{'$or':_[_0xe556('0x34')](_0x29ec5e[_0xe556('0x38')],function(_0x507e70){var _0x4481c1={};_0x4481c1[_0x507e70]={'$like':'%'+_0xc3e56c[_0xe556('0x36')]['filter']+'%'};return _0x4481c1;})});}_0x29ec5e=_[_0xe556('0x44')]({},_0x29ec5e,_0xc3e56c['options']);return _0xc2d72b['getAgents'](_0x29ec5e);}})['then'](function(_0x281568){if(_0x281568){_0x4e7587=_0x281568[_0xe556('0x3b')];if(!_0xc3e56c['query'][_0xe556('0x3c')](_0xe556('0x3d'))){_0x29ec5e[_0xe556('0x24')]=qs[_0xe556('0x24')](_0xc3e56c[_0xe556('0x36')][_0xe556('0x24')]);_0x29ec5e[_0xe556('0x22')]=qs[_0xe556('0x22')](_0xc3e56c[_0xe556('0x36')][_0xe556('0x22')]);}return _0xc2d72b['getAgents'](_0x29ec5e);}})[_0xe556('0x47')](function(_0x3ab684){if(_0x3ab684){return _0x3ab684?{'count':_0x4e7587,'rows':_0x3ab684}:null;}})['then'](respondWithResult(_0x2923cb,null))[_0xe556('0x4a')](handleError(_0x2923cb,null));};
\ No newline at end of file
+var _0x43a0=['through','penalty','QueueId','defaults','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','isNil','interface','format','all','UserVoicePrefix','upsert','VoicePrefixId','removeAgents','Queue:remove','getAgents','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','error','name','send','map','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','Team','then','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','Queue','toLowerCase','Unknown\x20channel','add','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0x43a0,0xae));var _0x043a=function(_0x205a19,_0x3a40c0){_0x205a19=_0x205a19-0x0;var _0x5e85e9=_0x43a0[_0x205a19];return _0x5e85e9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x043a('0x0'));var BPromise=require(_0x043a('0x1'));var Mustache=require(_0x043a('0x2'));var util=require(_0x043a('0x3'));var path=require(_0x043a('0x4'));var sox=require(_0x043a('0x5'));var csv=require(_0x043a('0x6'));var ejs=require(_0x043a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x043a('0x8'));var squel=require(_0x043a('0x9'));var crypto=require('crypto');var jsforce=require(_0x043a('0xa'));var deskjs=require(_0x043a('0xb'));var toCsv=require(_0x043a('0x6'));var querystring=require('querystring');var Papa=require(_0x043a('0xc'));var Redis=require(_0x043a('0xd'));var authService=require(_0x043a('0xe'));var qs=require(_0x043a('0xf'));var as=require(_0x043a('0x10'));var hardwareService=require(_0x043a('0x11'));var logger=require('../../config/logger')(_0x043a('0x12'));var utils=require(_0x043a('0x13'));var config=require(_0x043a('0x14'));var licenseUtil=require(_0x043a('0x15'));var db=require(_0x043a('0x16'))['db'];config[_0x043a('0x17')]=_['defaults'](config[_0x043a('0x17')],{'host':_0x043a('0x18'),'port':0x18eb});var socket=require(_0x043a('0x19'))(new Redis(config[_0x043a('0x17')]));require(_0x043a('0x1a'))[_0x043a('0x1b')](socket);function respondWithStatusCode(_0x4aed89,_0x21b714){_0x21b714=_0x21b714||0xcc;return function(_0x496460){if(_0x496460){return _0x4aed89[_0x043a('0x1c')](_0x21b714);}return _0x4aed89[_0x043a('0x1d')](_0x21b714)[_0x043a('0x1e')]();};}function respondWithResult(_0x4e0370,_0x326d6d){_0x326d6d=_0x326d6d||0xc8;return function(_0x5239dd){if(_0x5239dd){return _0x4e0370[_0x043a('0x1d')](_0x326d6d)[_0x043a('0x1f')](_0x5239dd);}};}function respondWithFilteredResult(_0x553685,_0x20abc1){return function(_0x4f909d){if(_0x4f909d){var _0x33320f=typeof _0x20abc1[_0x043a('0x20')]==='undefined'&&typeof _0x20abc1[_0x043a('0x21')]===_0x043a('0x22');var _0x4b231b=_0x4f909d[_0x043a('0x23')];var _0x519c5f=_0x33320f?0x0:_0x20abc1[_0x043a('0x20')];var _0x4b1dc1=_0x33320f?_0x4f909d['count']:_0x20abc1[_0x043a('0x20')]+_0x20abc1['limit'];var _0xbd8b05;if(_0x4b1dc1>=_0x4b231b){_0x4b1dc1=_0x4b231b;_0xbd8b05=0xc8;}else{_0xbd8b05=0xce;}_0x553685[_0x043a('0x1d')](_0xbd8b05);return _0x553685[_0x043a('0x24')]('Content-Range',_0x519c5f+'-'+_0x4b1dc1+'/'+_0x4b231b)['json'](_0x4f909d);}return null;};}function patchUpdates(_0x39484b){return function(_0x359e6e){try{jsonpatch[_0x043a('0x25')](_0x359e6e,_0x39484b,!![]);}catch(_0x92a8f5){return BPromise['reject'](_0x92a8f5);}return _0x359e6e[_0x043a('0x26')]();};}function saveUpdates(_0x537288,_0x4dfae3){return function(_0x25693c){if(_0x25693c){return _0x25693c[_0x043a('0x27')](_0x537288)['then'](function(_0xf7a929){return _0xf7a929;});}return null;};}function handleEntityNotFound(_0x1bb26f,_0x3cb1a6){return function(_0x12a825){if(!_0x12a825){_0x1bb26f[_0x043a('0x1c')](0x194);}return _0x12a825;};}function handleError(_0x1101d3,_0xaeec94){_0xaeec94=_0xaeec94||0x1f4;return function(_0x1806e9){logger[_0x043a('0x28')](_0x1806e9['stack']);if(_0x1806e9[_0x043a('0x29')]){delete _0x1806e9[_0x043a('0x29')];}_0x1101d3['status'](_0xaeec94)[_0x043a('0x2a')](_0x1806e9);};}exports['index']=function(_0x54d177,_0xad334e){var _0x3ef0d8={},_0x576f87={},_0x5175c0={'count':0x0,'rows':[]};var _0x59f40c=_[_0x043a('0x2b')](db['Team'][_0x043a('0x2c')],function(_0x4eed1f){return{'name':_0x4eed1f['fieldName'],'type':_0x4eed1f[_0x043a('0x2d')]['key']};});_0x576f87['model']=_[_0x043a('0x2b')](_0x59f40c,_0x043a('0x29'));_0x576f87[_0x043a('0x2e')]=_['keys'](_0x54d177['query']);_0x576f87[_0x043a('0x2f')]=_[_0x043a('0x30')](_0x576f87[_0x043a('0x31')],_0x576f87[_0x043a('0x2e')]);_0x3ef0d8[_0x043a('0x32')]=_[_0x043a('0x30')](_0x576f87[_0x043a('0x31')],qs[_0x043a('0x33')](_0x54d177[_0x043a('0x2e')]['fields']));_0x3ef0d8[_0x043a('0x32')]=_0x3ef0d8[_0x043a('0x32')][_0x043a('0x34')]?_0x3ef0d8[_0x043a('0x32')]:_0x576f87['model'];if(!_0x54d177[_0x043a('0x2e')][_0x043a('0x35')](_0x043a('0x36'))){_0x3ef0d8[_0x043a('0x21')]=qs[_0x043a('0x21')](_0x54d177['query'][_0x043a('0x21')]);_0x3ef0d8['offset']=qs[_0x043a('0x20')](_0x54d177['query'][_0x043a('0x20')]);}_0x3ef0d8[_0x043a('0x37')]=qs['sort'](_0x54d177[_0x043a('0x2e')][_0x043a('0x38')]);_0x3ef0d8[_0x043a('0x39')]=qs[_0x043a('0x2f')](_['pick'](_0x54d177[_0x043a('0x2e')],_0x576f87['filters']),_0x59f40c);if(_0x54d177[_0x043a('0x2e')][_0x043a('0x3a')]){_0x3ef0d8['where']=_[_0x043a('0x3b')](_0x3ef0d8[_0x043a('0x39')],{'$or':_['map'](_0x59f40c,function(_0x219d4c){if(_0x219d4c['type']!==_0x043a('0x3c')){var _0x165e88={};_0x165e88[_0x219d4c[_0x043a('0x29')]]={'$like':'%'+_0x54d177[_0x043a('0x2e')][_0x043a('0x3a')]+'%'};return _0x165e88;}})});}_0x3ef0d8=_[_0x043a('0x3b')]({},_0x3ef0d8,_0x54d177['options']);var _0x1c7166={'where':_0x3ef0d8['where']};return db[_0x043a('0x3d')]['count'](_0x1c7166)[_0x043a('0x3e')](function(_0x585bca){_0x5175c0['count']=_0x585bca;if(_0x54d177['query'][_0x043a('0x3f')]){_0x3ef0d8[_0x043a('0x40')]=[{'all':!![]}];}return db['Team'][_0x043a('0x41')](_0x3ef0d8);})[_0x043a('0x3e')](function(_0xa04213){_0x5175c0['rows']=_0xa04213;return _0x5175c0;})[_0x043a('0x3e')](respondWithFilteredResult(_0xad334e,_0x3ef0d8))[_0x043a('0x42')](handleError(_0xad334e,null));};exports[_0x043a('0x43')]=function(_0x43eaf2,_0x812d23){var _0x4f413d={'raw':![],'where':{'id':_0x43eaf2[_0x043a('0x44')]['id']}},_0x42a5b2={};_0x42a5b2[_0x043a('0x31')]=_[_0x043a('0x45')](db[_0x043a('0x3d')][_0x043a('0x2c')]);_0x42a5b2['query']=_[_0x043a('0x45')](_0x43eaf2[_0x043a('0x2e')]);_0x42a5b2[_0x043a('0x2f')]=_[_0x043a('0x30')](_0x42a5b2['model'],_0x42a5b2[_0x043a('0x2e')]);_0x4f413d[_0x043a('0x32')]=_[_0x043a('0x30')](_0x42a5b2[_0x043a('0x31')],qs['fields'](_0x43eaf2[_0x043a('0x2e')][_0x043a('0x33')]));_0x4f413d[_0x043a('0x32')]=_0x4f413d[_0x043a('0x32')]['length']?_0x4f413d[_0x043a('0x32')]:_0x42a5b2['model'];if(_0x43eaf2[_0x043a('0x2e')]['includeAll']){_0x4f413d[_0x043a('0x40')]=[{'all':!![]}];}_0x4f413d=_[_0x043a('0x3b')]({},_0x4f413d,_0x43eaf2[_0x043a('0x46')]);return db[_0x043a('0x3d')][_0x043a('0x47')](_0x4f413d)['then'](handleEntityNotFound(_0x812d23,null))['then'](respondWithResult(_0x812d23,null))[_0x043a('0x42')](handleError(_0x812d23,null));};exports[_0x043a('0x48')]=function(_0x29c9fd,_0x1aa084){return db[_0x043a('0x3d')][_0x043a('0x48')](_0x29c9fd[_0x043a('0x49')],{})[_0x043a('0x3e')](function(_0x357401){var _0x5274ff=_0x29c9fd[_0x043a('0x4a')]['get']({'plain':!![]});if(!_0x5274ff)throw new Error(_0x043a('0x4b'));if(_0x5274ff[_0x043a('0x4c')]===_0x043a('0x4a')){var _0x2db337=_0x357401[_0x043a('0x4d')]({'plain':!![]});var _0x4d9011=_0x043a('0x4e');return db['UserProfileSection'][_0x043a('0x47')]({'where':{'name':_0x4d9011,'userProfileId':_0x5274ff[_0x043a('0x4f')]},'raw':!![]})[_0x043a('0x3e')](function(_0x23e7d2){if(_0x23e7d2&&_0x23e7d2['autoAssociation']===0x0){return db[_0x043a('0x50')][_0x043a('0x48')]({'name':_0x2db337['name'],'resourceId':_0x2db337['id'],'type':_0x23e7d2[_0x043a('0x29')],'sectionId':_0x23e7d2['id']},{})['then'](function(){return _0x357401;});}else{return _0x357401;}})[_0x043a('0x42')](function(_0x110dfd){logger[_0x043a('0x28')](_0x043a('0x51'),_0x110dfd);throw _0x110dfd;});}return _0x357401;})[_0x043a('0x3e')](respondWithResult(_0x1aa084,0xc9))[_0x043a('0x42')](handleError(_0x1aa084,null));};exports[_0x043a('0x27')]=function(_0x2797d9,_0x282003){if(_0x2797d9[_0x043a('0x49')]['id']){delete _0x2797d9[_0x043a('0x49')]['id'];}return db[_0x043a('0x3d')]['find']({'where':{'id':_0x2797d9[_0x043a('0x44')]['id']}})[_0x043a('0x3e')](handleEntityNotFound(_0x282003,null))[_0x043a('0x3e')](saveUpdates(_0x2797d9['body'],null))[_0x043a('0x3e')](respondWithResult(_0x282003,null))[_0x043a('0x42')](handleError(_0x282003,null));};exports[_0x043a('0x52')]=function(_0x37747d,_0x3ab33e){var _0x17abcc=_0x37747d[_0x043a('0x44')]['id'];var _0x3558e9=[];return db[_0x043a('0x53')][_0x043a('0x54')](function(_0x469231){var _0x2b0459=_0x043a('0x55')+_0x17abcc;return db[_0x043a('0x53')][_0x043a('0x2e')](_0x2b0459,{'type':db[_0x043a('0x56')][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231})['then'](function(_0x24d40f){_0x3558e9=_['map'](_0x24d40f,function(_0x592f4f){return Number(_0x592f4f[_0x043a('0x59')]);});})[_0x043a('0x3e')](function(){var _0x2ebf11=_0x043a('0x5a')+_0x17abcc;return db[_0x043a('0x53')][_0x043a('0x2e')](_0x2ebf11,{'type':db['Sequelize'][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231});})[_0x043a('0x3e')](function(_0x221ea7){var _0x3689ba=_[_0x043a('0x2b')](_0x221ea7,function(_0xac9e4f){return Number(_0xac9e4f[_0x043a('0x5b')]);});return db['UserVoiceQueue'][_0x043a('0x52')]({'where':{'UserId':{'$in':_0x3558e9},'VoiceQueueId':{'$in':_0x3689ba}},'transaction':_0x469231});})['then'](function(){var _0x4aa3ed='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x17abcc;return db[_0x043a('0x53')]['query'](_0x4aa3ed,{'type':db[_0x043a('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x469231});})[_0x043a('0x3e')](function(_0x306269){var _0x1e78a3=_[_0x043a('0x2b')](_0x306269,function(_0x5aa920){return Number(_0x5aa920[_0x043a('0x5c')]);});return db[_0x043a('0x5d')][_0x043a('0x52')]({'where':{'UserId':{'$in':_0x3558e9},'MailQueueId':{'$in':_0x1e78a3}},'transaction':_0x469231});})[_0x043a('0x3e')](function(){var _0x422289=_0x043a('0x5e')+_0x17abcc;return db['sequelize'][_0x043a('0x2e')](_0x422289,{'type':db[_0x043a('0x56')][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231});})[_0x043a('0x3e')](function(_0x1953d8){var _0x512877=_['map'](_0x1953d8,function(_0x16e5bc){return Number(_0x16e5bc[_0x043a('0x5f')]);});return db['UserSmsQueue'][_0x043a('0x52')]({'where':{'UserId':{'$in':_0x3558e9},'SmsQueueId':{'$in':_0x512877}},'transaction':_0x469231});})[_0x043a('0x3e')](function(){var _0x599bcd='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x17abcc;return db['sequelize'][_0x043a('0x2e')](_0x599bcd,{'type':db[_0x043a('0x56')][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231});})[_0x043a('0x3e')](function(_0x20e8eb){var _0x2ffeca=_['map'](_0x20e8eb,function(_0x2df01d){return Number(_0x2df01d[_0x043a('0x60')]);});return db[_0x043a('0x61')][_0x043a('0x52')]({'where':{'UserId':{'$in':_0x3558e9},'ChatQueueId':{'$in':_0x2ffeca}},'transaction':_0x469231});})[_0x043a('0x3e')](function(){var _0x19f418=_0x043a('0x62')+_0x17abcc;return db['sequelize'][_0x043a('0x2e')](_0x19f418,{'type':db[_0x043a('0x56')][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231});})['then'](function(_0x51a247){var _0x2c07a0=_[_0x043a('0x2b')](_0x51a247,function(_0x1ccbed){return Number(_0x1ccbed[_0x043a('0x63')]);});return db[_0x043a('0x64')][_0x043a('0x52')]({'where':{'UserId':{'$in':_0x3558e9},'FaxQueueId':{'$in':_0x2c07a0}},'transaction':_0x469231});})[_0x043a('0x3e')](function(){var _0x409a7b=_0x043a('0x65')+_0x17abcc;return db[_0x043a('0x53')][_0x043a('0x2e')](_0x409a7b,{'type':db[_0x043a('0x56')][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231});})[_0x043a('0x3e')](function(_0xc04e0f){var _0xc89367=_[_0x043a('0x2b')](_0xc04e0f,function(_0x3f947c){return Number(_0x3f947c['OpenchannelQueueId']);});return db[_0x043a('0x66')]['destroy']({'where':{'UserId':{'$in':_0x3558e9},'OpenchannelQueueId':{'$in':_0xc89367}},'transaction':_0x469231});})[_0x043a('0x3e')](function(){var _0x1443e5=_0x043a('0x67')+_0x17abcc;return db[_0x043a('0x53')][_0x043a('0x2e')](_0x1443e5,{'type':db['Sequelize'][_0x043a('0x57')][_0x043a('0x58')],'raw':!![],'transaction':_0x469231});})[_0x043a('0x3e')](function(_0x254b7b){var _0x42dd66=_['map'](_0x254b7b,function(_0x468921){return Number(_0x468921[_0x043a('0x68')]);});return db[_0x043a('0x69')]['destroy']({'where':{'UserId':{'$in':_0x3558e9},'WhatsappQueueId':{'$in':_0x42dd66}},'transaction':_0x469231});})[_0x043a('0x3e')](function(){return db[_0x043a('0x6a')][_0x043a('0x47')]({'where':{'TeamId':_0x17abcc}});})[_0x043a('0x3e')](function(_0x4d46b1){if(_0x4d46b1===null){return;}return db['UserVoicePrefix'][_0x043a('0x52')]({'where':{'UserId':{'$in':_0x3558e9},'VoicePrefixId':_0x4d46b1['VoicePrefixId']},'transaction':_0x469231});})[_0x043a('0x3e')](function(){return db[_0x043a('0x3d')]['destroy']({'where':{'id':_0x17abcc},'cascade':!![],'transaction':_0x469231});})['then'](function(_0x3b02b1){if(_0x3b02b1===0x0){_0x3ab33e['sendStatus'](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0x043a('0x4e'),'resourceId':_0x17abcc},'cascade':!![],'transaction':_0x469231})[_0x043a('0x3e')](function(){_0x3ab33e['status'](0xcc)[_0x043a('0x1e')]();});}})['catch'](function(_0x19ba84){_0x3ab33e[_0x043a('0x1d')](0x1f4)[_0x043a('0x2a')](_0x19ba84);});});};exports[_0x043a('0x6b')]=function(_0xfaba84,_0x40691a,_0x46274d){return db[_0x043a('0x3d')][_0x043a('0x6c')]({'where':{'id':_0xfaba84[_0x043a('0x44')]['id']}})[_0x043a('0x3e')](handleEntityNotFound(_0x40691a,null))[_0x043a('0x3e')](function(_0x3927c8){if(!_0xfaba84[_0x043a('0x2e')][_0x043a('0x6d')]||!utils[_0x043a('0x6e')](_0xfaba84[_0x043a('0x2e')][_0x043a('0x6d')])){throw new db[(_0x043a('0x56'))][(_0x043a('0x6f'))]('Unknown\x20channel');}var _0x4383ed={};var _0x349680={};_0x349680[_0x043a('0x31')]=_[_0x043a('0x45')](db[_[_0x043a('0x70')](_0xfaba84[_0x043a('0x2e')][_0x043a('0x6d')]['toLowerCase']())+_0x043a('0x71')]['rawAttributes']);_0x349680[_0x043a('0x2e')]=_[_0x043a('0x45')](_0xfaba84[_0x043a('0x2e')]);_0x349680[_0x043a('0x2f')]=_[_0x043a('0x30')](_0x349680[_0x043a('0x31')],_0x349680[_0x043a('0x2e')]);_0x4383ed[_0x043a('0x32')]=_['intersection'](_0x349680[_0x043a('0x31')],qs['fields'](_0xfaba84[_0x043a('0x2e')][_0x043a('0x33')]));_0x4383ed[_0x043a('0x32')]=_0x4383ed[_0x043a('0x32')][_0x043a('0x34')]?_0x4383ed[_0x043a('0x32')]:_0x349680[_0x043a('0x31')];_0x4383ed[_0x043a('0x21')]=qs[_0x043a('0x21')](_0xfaba84[_0x043a('0x2e')]['limit']);_0x4383ed[_0x043a('0x20')]=qs[_0x043a('0x20')](_0xfaba84['query'][_0x043a('0x20')]);_0x4383ed[_0x043a('0x37')]=qs[_0x043a('0x38')](_0xfaba84[_0x043a('0x2e')][_0x043a('0x38')]);_0x4383ed[_0x043a('0x39')]=qs[_0x043a('0x2f')](_['pick'](_0xfaba84['query'],_0x349680[_0x043a('0x2f')]));_0x4383ed=_[_0x043a('0x3b')]({},_0x4383ed,_0xfaba84['options']);return _0x3927c8[_0x043a('0x4d')+_[_0x043a('0x70')](_0xfaba84['query'][_0x043a('0x6d')][_0x043a('0x72')]())+'Queues'](_0x4383ed);})['then'](respondWithResult(_0x40691a,null))['catch'](handleError(_0x40691a,null));};exports['addQueues']=function(_0x26ab0b,_0x309ced,_0x475b75){return db[_0x043a('0x3d')][_0x043a('0x6c')]({'where':{'id':_0x26ab0b[_0x043a('0x44')]['id']}})[_0x043a('0x3e')](function(_0x263635){if(_0x263635){if(!_0x26ab0b[_0x043a('0x49')][_0x043a('0x6d')]||!utils[_0x043a('0x6e')](_0x26ab0b[_0x043a('0x49')][_0x043a('0x6d')])){throw new db[(_0x043a('0x56'))][(_0x043a('0x6f'))](_0x043a('0x73'));}return _0x263635[_0x043a('0x74')+_[_0x043a('0x70')](_0x26ab0b[_0x043a('0x49')][_0x043a('0x6d')][_0x043a('0x72')]())+_0x043a('0x75')](_0x26ab0b['body'][_0x043a('0x76')]);}return null;})[_0x043a('0x3e')](handleEntityNotFound(_0x309ced,null))[_0x043a('0x3e')](respondWithStatusCode(_0x309ced,null))['catch'](handleError(_0x309ced,null));};exports[_0x043a('0x77')]=function(_0x30e4e6,_0x146c1a,_0x196d45){return db[_0x043a('0x3d')][_0x043a('0x6c')]({'where':{'id':_0x30e4e6['params']['id']}})[_0x043a('0x3e')](function(_0x4b9dca){if(_0x4b9dca){if(!_0x30e4e6[_0x043a('0x2e')]['channel']||!utils[_0x043a('0x6e')](_0x30e4e6[_0x043a('0x2e')][_0x043a('0x6d')])){throw new db[(_0x043a('0x56'))]['ValidationError'](_0x043a('0x73'));}return _0x4b9dca[_0x043a('0x78')+_[_0x043a('0x70')](_0x30e4e6[_0x043a('0x2e')]['channel'][_0x043a('0x72')]())+_0x043a('0x75')](_0x30e4e6[_0x043a('0x2e')][_0x043a('0x76')]);}return null;})['then'](handleEntityNotFound(_0x146c1a,null))['then'](respondWithStatusCode(_0x146c1a,null))[_0x043a('0x42')](handleError(_0x146c1a,null));};exports[_0x043a('0x79')]=function(_0x2d602a,_0x41c07b){var _0x43e8f4=_[_0x043a('0x7a')](_0x2d602a[_0x043a('0x49')][_0x043a('0x76')])?_0x2d602a[_0x043a('0x49')][_0x043a('0x76')]:[_0x2d602a['body'][_0x043a('0x76')]];var _0x37998b=_0x2d602a[_0x043a('0x44')]['id'];return db[_0x043a('0x3d')]['find']({'where':{'id':_0x37998b}})[_0x043a('0x3e')](handleEntityNotFound(_0x41c07b,null))[_0x043a('0x3e')](function(_0x47c887){if(_0x47c887){var _0x2d5550=[_0x043a('0x7b'),_0x043a('0x7c'),_0x043a('0x7d'),_0x043a('0x7e'),_0x043a('0x7f'),_0x043a('0x80'),_0x043a('0x81')];return db[_0x043a('0x53')][_0x043a('0x54')](function(_0x366ab5){var _0x589707=_['map'](_0x2d5550,function(_0x1d7071){var _0x19f6a9={'attributes':['id',_0x043a('0x29')]};if(_0x1d7071===_0x043a('0x7b')){_0x19f6a9[_0x043a('0x82')]={'attributes':[_0x043a('0x83')]};}return _0x47c887[_0x043a('0x4d')+_0x1d7071+_0x043a('0x75')](_0x19f6a9)['then'](function(_0x5b127d){var _0x4cabcd=_[_0x043a('0x2b')](_0x5b127d,function(_0x4e12a5){var _0x64f728=_[_0x043a('0x2b')](_0x43e8f4,function(_0x1c15d6){var _0x551c01={'where':{'UserId':_0x1c15d6,[_0x1d7071+_0x043a('0x84')]:_0x4e12a5['id']},'transaction':_0x366ab5};if(_0x1d7071===_0x043a('0x7b')){_0x551c01[_0x043a('0x85')]={'penalty':_0x4e12a5[_0x043a('0x86')]['penalty']};}return db[_0x043a('0x87')+_0x1d7071+_0x043a('0x71')][_0x043a('0x88')](_0x551c01)[_0x043a('0x3e')](function(){socket[_0x043a('0x89')](_0x043a('0x4a')+_0x1d7071+_0x043a('0x8a'),{'UserId':_0x1c15d6,[_0x1d7071+_0x043a('0x84')]:_0x4e12a5['id']});if(_0x1d7071!==_0x043a('0x7b')){return;}return db[_0x043a('0x87')]['findAll']({'where':{'id':_0x43e8f4,'online':0x1},'attributes':['id',_0x043a('0x29'),_0x043a('0x8b'),_0x043a('0x8c'),'interface'],'raw':!![]})['then'](function(_0xb0f88b){var _0x451f24=_[_0x043a('0x2b')](_0xb0f88b,function(_0x3f154b){return db[_0x043a('0x8d')]['upsert']({'membername':_0x3f154b[_0x043a('0x29')],'UserId':_0x3f154b['id'],'queue_name':_0x4e12a5['name'],'VoiceQueueId':_0x4e12a5['id'],'interface':_[_0x043a('0x8e')](_0x3f154b[_0x043a('0x8f')])?util[_0x043a('0x90')]('SIP/%s',_0x3f154b['name']):_0x3f154b[_0x043a('0x8f')],'paused':_0x3f154b['voicePause']||![],'penalty':_0x4e12a5[_0x043a('0x86')]['penalty']},{'transaction':_0x366ab5});});return Promise[_0x043a('0x91')](_0x451f24);});});});return Promise[_0x043a('0x91')](_0x64f728);});return Promise['all'](_0x4cabcd);})[_0x043a('0x3e')](function(){return db[_0x043a('0x6a')][_0x043a('0x6c')]({'where':{'teamId':_0x37998b}})[_0x043a('0x3e')](function(_0xe2b972){if(_0xe2b972){var _0x3ec578=_['map'](_0x43e8f4,function(_0x90d5a7){db[_0x043a('0x92')][_0x043a('0x93')]({'UserId':_0x90d5a7,'VoicePrefixId':_0xe2b972[_0x043a('0x94')]});});return Promise['all'](_0x3ec578);}});});});return Promise[_0x043a('0x91')](_0x589707)[_0x043a('0x3e')](function(){return _0x47c887[_0x043a('0x79')](_0x43e8f4,{'transaction':_0x366ab5})['spread'](function(_0x2d4d24){return _0x2d4d24;});});});}})[_0x043a('0x3e')](respondWithResult(_0x41c07b,null))[_0x043a('0x42')](handleError(_0x41c07b,null));};exports[_0x043a('0x95')]=function(_0x1478e1,_0x1a8745){var _0x5ae8cd=_[_0x043a('0x7a')](_0x1478e1['query'][_0x043a('0x76')])?_0x1478e1['query'][_0x043a('0x76')]:[_0x1478e1[_0x043a('0x2e')][_0x043a('0x76')]];var _0x19bed1=_0x1478e1[_0x043a('0x44')]['id'];return db[_0x043a('0x3d')][_0x043a('0x47')]({'where':{'id':_0x19bed1}})[_0x043a('0x3e')](handleEntityNotFound(_0x1a8745,null))[_0x043a('0x3e')](function(_0x1184f7){if(_0x1184f7){var _0xa2f530=[_0x043a('0x7b'),_0x043a('0x7c'),'Mail',_0x043a('0x7e'),_0x043a('0x7f'),_0x043a('0x80'),_0x043a('0x81')];return db[_0x043a('0x53')][_0x043a('0x54')](function(_0x1fb3e4){var _0x22071b=_[_0x043a('0x2b')](_0xa2f530,function(_0x389c78){var _0x445a08={'attributes':['id',_0x043a('0x29')]};return _0x1184f7[_0x043a('0x4d')+_0x389c78+'Queues'](_0x445a08)[_0x043a('0x3e')](function(_0x280f9b){var _0xb8e65c=_[_0x043a('0x2b')](_0x280f9b,function(_0x135beb){return _0x135beb['removeAgents'](_0x5ae8cd,{'transaction':_0x1fb3e4})[_0x043a('0x3e')](function(){var _0x4c377c=_[_0x043a('0x2b')](_0x5ae8cd,function(_0x5d5bc8){socket[_0x043a('0x89')]('user'+_0x389c78+_0x043a('0x96'),{'UserId':Number(_0x5d5bc8),[_0x389c78+'QueueId']:_0x135beb['id']});if(_0x389c78!==_0x043a('0x7b')){return;}return db[_0x043a('0x8d')][_0x043a('0x52')]({'where':{'VoiceQueueId':_0x135beb['id'],'UserId':_0x5d5bc8},'transaction':_0x1fb3e4});});return Promise[_0x043a('0x91')](_0x4c377c);});});return Promise['all'](_0xb8e65c);});});return Promise[_0x043a('0x91')](_0x22071b)['then'](function(){return _0x1184f7[_0x043a('0x95')](_0x5ae8cd,{'transaction':_0x1fb3e4});})[_0x043a('0x3e')](function(){return db['TeamVoicePrefix'][_0x043a('0x6c')]({'where':{'teamId':_0x19bed1}})[_0x043a('0x3e')](function(_0x1b34c1){if(_0x1b34c1){var _0x230c8a=_[_0x043a('0x2b')](_0x5ae8cd,function(_0x3a5fe8){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x3a5fe8,'VoicePrefixId':_0x1b34c1[_0x043a('0x94')]}});});return Promise[_0x043a('0x91')](_0x230c8a);}});});});}})[_0x043a('0x3e')](respondWithStatusCode(_0x1a8745,null))[_0x043a('0x42')](handleError(_0x1a8745,null));};exports[_0x043a('0x97')]=function(_0xa12e96,_0x20bd40,_0x4fb40b){var _0x371e6d={};var _0x1aaa45={};var _0x5daa4b;var _0x5a6651;return db['Team'][_0x043a('0x6c')]({'where':{'id':_0xa12e96[_0x043a('0x44')]['id']}})[_0x043a('0x3e')](handleEntityNotFound(_0x20bd40,null))[_0x043a('0x3e')](function(_0x2be052){if(_0x2be052){_0x5daa4b=_0x2be052;_0x1aaa45['model']=_[_0x043a('0x45')](db['User']['rawAttributes']);_0x1aaa45[_0x043a('0x2e')]=_[_0x043a('0x45')](_0xa12e96['query']);_0x1aaa45['filters']=_[_0x043a('0x30')](_0x1aaa45[_0x043a('0x31')],_0x1aaa45[_0x043a('0x2e')]);_0x371e6d['attributes']=_[_0x043a('0x30')](_0x1aaa45[_0x043a('0x31')],qs[_0x043a('0x33')](_0xa12e96[_0x043a('0x2e')][_0x043a('0x33')]));_0x371e6d[_0x043a('0x32')]=_0x371e6d[_0x043a('0x32')][_0x043a('0x34')]?_0x371e6d[_0x043a('0x32')]:_0x1aaa45[_0x043a('0x31')];_0x371e6d[_0x043a('0x37')]=qs[_0x043a('0x38')](_0xa12e96[_0x043a('0x2e')][_0x043a('0x38')]);_0x371e6d[_0x043a('0x39')]=qs['filters'](_['pick'](_0xa12e96[_0x043a('0x2e')],_0x1aaa45[_0x043a('0x2f')]));if(_0xa12e96['query'][_0x043a('0x3a')]){_0x371e6d[_0x043a('0x39')]=_['merge'](_0x371e6d['where'],{'$or':_[_0x043a('0x2b')](_0x371e6d[_0x043a('0x32')],function(_0x296c1b){var _0x373a2d={};_0x373a2d[_0x296c1b]={'$like':'%'+_0xa12e96[_0x043a('0x2e')][_0x043a('0x3a')]+'%'};return _0x373a2d;})});}_0x371e6d=_[_0x043a('0x3b')]({},_0x371e6d,_0xa12e96['options']);return _0x5daa4b[_0x043a('0x97')](_0x371e6d);}})[_0x043a('0x3e')](function(_0x295dd9){if(_0x295dd9){_0x5a6651=_0x295dd9[_0x043a('0x34')];if(!_0xa12e96[_0x043a('0x2e')][_0x043a('0x35')](_0x043a('0x36'))){_0x371e6d['limit']=qs[_0x043a('0x21')](_0xa12e96[_0x043a('0x2e')][_0x043a('0x21')]);_0x371e6d['offset']=qs['offset'](_0xa12e96[_0x043a('0x2e')][_0x043a('0x20')]);}return _0x5daa4b[_0x043a('0x97')](_0x371e6d);}})[_0x043a('0x3e')](function(_0x5a326a){if(_0x5a326a){return _0x5a326a?{'count':_0x5a6651,'rows':_0x5a326a}:null;}})[_0x043a('0x3e')](respondWithResult(_0x20bd40,null))[_0x043a('0x42')](handleError(_0x20bd40,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3581=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3581,0x113));var _0x1358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3581[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1358('0x0'));var Team=require(_0x1358('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x1358('0x2')](0x0);var events={'afterCreate':_0x1358('0x3'),'afterUpdate':_0x1358('0x4'),'afterDestroy':_0x1358('0x5')};function emitEvent(_0x4f18c3){return function(_0x1654e1,_0x120595,_0xeeef6e){TeamEvents[_0x1358('0x6')](_0x4f18c3+':'+_0x1654e1['id'],_0x1654e1);TeamEvents[_0x1358('0x6')](_0x4f18c3,_0x1654e1);_0xeeef6e(null);};}for(var e in events){if(events[_0x1358('0x7')](e)){var event=events[e];Team[_0x1358('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0x4efc=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x4efc,0x1ab));var _0xc4ef=function(_0x1b761b,_0x1a230a){_0x1b761b=_0x1b761b-0x0;var _0x1fdec5=_0x4efc[_0x1b761b];return _0x1fdec5;};'use strict';var EventEmitter=require(_0xc4ef('0x0'));var Team=require(_0xc4ef('0x1'))['db'][_0xc4ef('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xc4ef('0x3')](0x0);var events={'afterCreate':_0xc4ef('0x4'),'afterUpdate':_0xc4ef('0x5'),'afterDestroy':_0xc4ef('0x6')};function emitEvent(_0x308900){return function(_0x115e7c,_0x58fca9,_0x169064){TeamEvents[_0xc4ef('0x7')](_0x308900+':'+_0x115e7c['id'],_0x115e7c);TeamEvents[_0xc4ef('0x7')](_0x308900,_0x115e7c);_0x169064(null);};}for(var e in events){if(events[_0xc4ef('0x8')](e)){var event=events[e];Team[_0xc4ef('0x9')](e,emitEvent(event));}}module[_0xc4ef('0xa')]=TeamEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb669=['Mail','Openchannel','Sms','Voice','Whatsapp','then','all','./team.attributes','get','Queues','map','catch','define','Team','Chat','Fax'];(function(_0x1cdabe,_0x286194){var _0x3dcc9c=function(_0x5aa9c7){while(--_0x5aa9c7){_0x1cdabe['push'](_0x1cdabe['shift']());}};_0x3dcc9c(++_0x286194);}(_0xb669,0x1c7));var _0x9b66=function(_0x107ae2,_0xaf1dd){_0x107ae2=_0x107ae2-0x0;var _0x402224=_0xb669[_0x107ae2];return _0x402224;};'use strict';var _=require('lodash');var attributes=require(_0x9b66('0x0'));function getQueuesByChannel(_0x21a11f,_0x2bdb6c){var _0x1eaa13=_0x9b66('0x1')+_0x2bdb6c+_0x9b66('0x2');return _0x21a11f[_0x1eaa13]()['then'](function(_0x26ea67){return _[_0x9b66('0x3')](_0x26ea67,function(_0x57a429){_0x57a429['setDataValue']('channel',_0x2bdb6c);return _0x57a429;});})[_0x9b66('0x4')](function(_0x530135){throw _0x530135;});}module['exports']=function(_0x115889){return _0x115889[_0x9b66('0x5')](_0x9b66('0x6'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x21cf94=this;var _0x1ffd84=[_0x9b66('0x7'),_0x9b66('0x8'),_0x9b66('0x9'),_0x9b66('0xa'),_0x9b66('0xb'),_0x9b66('0xc'),_0x9b66('0xd')];return Promise['resolve']()[_0x9b66('0xe')](function(){var _0x49a14f=_[_0x9b66('0x3')](_0x1ffd84,function(_0x5d998b){return getQueuesByChannel(_0x21cf94,_0x5d998b);});return Promise[_0x9b66('0xf')](_0x49a14f);})[_0x9b66('0x4')](function(_0x5df284){throw _0x5df284;});}}});};
\ No newline at end of file
+var _0x67df=['teams','Chat','Fax','Mail','Openchannel','Sms','Voice','resolve','then','lodash','./team.attributes','get','map','catch','exports','define','Team'];(function(_0x48da72,_0x3f50e9){var _0x2fae68=function(_0x13916d){while(--_0x13916d){_0x48da72['push'](_0x48da72['shift']());}};_0x2fae68(++_0x3f50e9);}(_0x67df,0x1d4));var _0xf67d=function(_0x3033df,_0x2801c3){_0x3033df=_0x3033df-0x0;var _0x4a106b=_0x67df[_0x3033df];return _0x4a106b;};'use strict';var _=require(_0xf67d('0x0'));var attributes=require(_0xf67d('0x1'));function getQueuesByChannel(_0x2be820,_0x4ce286){var _0x2b2db4=_0xf67d('0x2')+_0x4ce286+'Queues';return _0x2be820[_0x2b2db4]()['then'](function(_0x3b52ae){return _[_0xf67d('0x3')](_0x3b52ae,function(_0x1f00c0){_0x1f00c0['setDataValue']('channel',_0x4ce286);return _0x1f00c0;});})[_0xf67d('0x4')](function(_0x5d0428){throw _0x5d0428;});}module[_0xf67d('0x5')]=function(_0x45107a){return _0x45107a[_0xf67d('0x6')](_0xf67d('0x7'),attributes,{'tableName':_0xf67d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x7b7449=this;var _0x3959e6=[_0xf67d('0x9'),_0xf67d('0xa'),_0xf67d('0xb'),_0xf67d('0xc'),_0xf67d('0xd'),_0xf67d('0xe'),'Whatsapp'];return Promise[_0xf67d('0xf')]()[_0xf67d('0x10')](function(){var _0x1f4673=_[_0xf67d('0x3')](_0x3959e6,function(_0x25e5df){return getQueuesByChannel(_0x7b7449,_0x25e5df);});return Promise['all'](_0x1f4673);})[_0xf67d('0x4')](function(_0xaa0ffc){throw _0xaa0ffc;});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5726=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x439793,_0x26cb2c){var _0x50db30=function(_0x4c522f){while(--_0x4c522f){_0x439793['push'](_0x439793['shift']());}};_0x50db30(++_0x26cb2c);}(_0x5726,0xd1));var _0x6572=function(_0x58305a,_0x6536a3){_0x58305a=_0x58305a-0x0;var _0x18a9ea=_0x5726[_0x58305a];return _0x18a9ea;};'use strict';var _=require(_0x6572('0x0'));var util=require(_0x6572('0x1'));var moment=require(_0x6572('0x2'));var BPromise=require(_0x6572('0x3'));var rs=require(_0x6572('0x4'));var fs=require('fs');var Redis=require(_0x6572('0x5'));var db=require(_0x6572('0x6'))['db'];var utils=require(_0x6572('0x7'));var logger=require(_0x6572('0x8'))(_0x6572('0x9'));var config=require(_0x6572('0xa'));var jayson=require(_0x6572('0xb'));var client=jayson[_0x6572('0xc')][_0x6572('0xd')]({'port':0x232a});config[_0x6572('0xe')]=_['defaults'](config['redis'],{'host':_0x6572('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6572('0xe')]));require('./team.socket')[_0x6572('0x10')](socket);function respondWithRpcPromise(_0x277c73,_0x1a48da,_0x44166f){return new BPromise(function(_0x3621a4,_0x171868){return client[_0x6572('0x11')](_0x277c73,_0x44166f)['then'](function(_0x1566c4){logger['info'](_0x6572('0x12'),_0x1a48da,'request\x20sent');logger[_0x6572('0x13')](_0x6572('0x14'),_0x1a48da,'request\x20sent',JSON[_0x6572('0x15')](_0x1566c4));if(_0x1566c4[_0x6572('0x16')]){if(_0x1566c4[_0x6572('0x16')][_0x6572('0x17')]===0x1f4){logger[_0x6572('0x16')](_0x6572('0x12'),_0x1a48da,_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);return _0x171868(_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);}logger[_0x6572('0x16')](_0x6572('0x12'),_0x1a48da,_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);return _0x3621a4(_0x1566c4[_0x6572('0x16')][_0x6572('0x18')]);}else{logger['info'](_0x6572('0x12'),_0x1a48da,'request\x20sent');_0x3621a4(_0x1566c4[_0x6572('0x19')][_0x6572('0x18')]);}})[_0x6572('0x1a')](function(_0x49746e){logger[_0x6572('0x16')](_0x6572('0x12'),_0x1a48da,_0x49746e);_0x171868(_0x49746e);});});}
\ No newline at end of file
+var _0xb1f6=['register','then','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','../../config/logger','jayson/promise','client','redis','defaults','localhost','./team.socket'];(function(_0x188d54,_0x55893f){var _0x121b8c=function(_0x212c9e){while(--_0x212c9e){_0x188d54['push'](_0x188d54['shift']());}};_0x121b8c(++_0x55893f);}(_0xb1f6,0x14d));var _0x6b1f=function(_0x33093a,_0x244ac9){_0x33093a=_0x33093a-0x0;var _0x103197=_0xb1f6[_0x33093a];return _0x103197;};'use strict';var _=require('lodash');var util=require(_0x6b1f('0x0'));var moment=require(_0x6b1f('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(_0x6b1f('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b1f('0x3'));var client=jayson[_0x6b1f('0x4')]['http']({'port':0x232a});config[_0x6b1f('0x5')]=_[_0x6b1f('0x6')](config['redis'],{'host':_0x6b1f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b1f('0x5')]));require(_0x6b1f('0x8'))[_0x6b1f('0x9')](socket);function respondWithRpcPromise(_0x14100d,_0x5a734f,_0x11010c){return new BPromise(function(_0xd051b1,_0x2367e5){return client['request'](_0x14100d,_0x11010c)[_0x6b1f('0xa')](function(_0x4e9df4){logger[_0x6b1f('0xb')](_0x6b1f('0xc'),_0x5a734f,_0x6b1f('0xd'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x5a734f,_0x6b1f('0xd'),JSON[_0x6b1f('0xe')](_0x4e9df4));if(_0x4e9df4['error']){if(_0x4e9df4[_0x6b1f('0xf')][_0x6b1f('0x10')]===0x1f4){logger[_0x6b1f('0xf')](_0x6b1f('0xc'),_0x5a734f,_0x4e9df4[_0x6b1f('0xf')][_0x6b1f('0x11')]);return _0x2367e5(_0x4e9df4[_0x6b1f('0xf')][_0x6b1f('0x11')]);}logger[_0x6b1f('0xf')]('Team,\x20%s,\x20%s',_0x5a734f,_0x4e9df4[_0x6b1f('0xf')][_0x6b1f('0x11')]);return _0xd051b1(_0x4e9df4['error']['message']);}else{logger['info'](_0x6b1f('0xc'),_0x5a734f,_0x6b1f('0xd'));_0xd051b1(_0x4e9df4[_0x6b1f('0x12')][_0x6b1f('0x11')]);}})['catch'](function(_0x58e5c3){logger['error'](_0x6b1f('0xc'),_0x5a734f,_0x58e5c3);_0x2367e5(_0x58e5c3);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43ae=['removeListener','register','length','./team.events','save','update','emit'];(function(_0x19d57e,_0xb5854f){var _0x1b4466=function(_0x19a25c){while(--_0x19a25c){_0x19d57e['push'](_0x19d57e['shift']());}};_0x1b4466(++_0xb5854f);}(_0x43ae,0x199));var _0xe43a=function(_0x43ff5d,_0x2d3055){_0x43ff5d=_0x43ff5d-0x0;var _0x51778b=_0x43ae[_0x43ff5d];return _0x51778b;};'use strict';var TeamEvents=require(_0xe43a('0x0'));var events=[_0xe43a('0x1'),'remove',_0xe43a('0x2')];function createListener(_0x34612a,_0x5b702a){return function(_0x1dbba9){_0x5b702a[_0xe43a('0x3')](_0x34612a,_0x1dbba9);};}function removeListener(_0x281d7c,_0x4c20a8){return function(){TeamEvents[_0xe43a('0x4')](_0x281d7c,_0x4c20a8);};}exports[_0xe43a('0x5')]=function(_0x30dc38){for(var _0x2d2dca=0x0,_0x1913ad=events[_0xe43a('0x6')];_0x2d2dca<_0x1913ad;_0x2d2dca++){var _0x19acaf=events[_0x2d2dca];var _0x5ab977=createListener('team:'+_0x19acaf,_0x30dc38);TeamEvents['on'](_0x19acaf,_0x5ab977);}};
\ No newline at end of file
+var _0x2d58=['remove','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x1e26a9,_0x29566f){var _0x5594b1=function(_0x2faa13){while(--_0x2faa13){_0x1e26a9['push'](_0x1e26a9['shift']());}};_0x5594b1(++_0x29566f);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var TeamEvents=require(_0x82d5('0x0'));var events=[_0x82d5('0x1'),_0x82d5('0x2'),'update'];function createListener(_0x430244,_0x4de6f0){return function(_0x43d9b7){_0x4de6f0[_0x82d5('0x3')](_0x430244,_0x43d9b7);};}function removeListener(_0x19fd57,_0x763bbb){return function(){TeamEvents[_0x82d5('0x4')](_0x19fd57,_0x763bbb);};}exports[_0x82d5('0x5')]=function(_0xbdd54){for(var _0x4c95fe=0x0,_0xd636fe=events[_0x82d5('0x6')];_0x4c95fe<_0xd636fe;_0x4c95fe++){var _0x24c9cb=events[_0x4c95fe];var _0x3dea8b=createListener(_0x82d5('0x7')+_0x24c9cb,_0xbdd54);TeamEvents['on'](_0x24c9cb,_0x3dea8b);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e5=['sequelize','exports','INTEGER'];(function(_0x22f2a0,_0x3a8c8d){var _0x1188ad=function(_0x59ac96){while(--_0x59ac96){_0x22f2a0['push'](_0x22f2a0['shift']());}};_0x1188ad(++_0x3a8c8d);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x28ed6c,_0x126ef0){_0x28ed6c=_0x28ed6c-0x0;var _0x5351ae=_0xa9e5[_0x28ed6c];return _0x5351ae;};'use strict';var Sequelize=require(_0x5a9e('0x0'));module[_0x5a9e('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x5a9e('0x2')]}};
\ No newline at end of file
+var _0x4c58=['INTEGER','sequelize'];(function(_0x4a2293,_0x20251a){var _0x301fee=function(_0x37787d){while(--_0x37787d){_0x4a2293['push'](_0x4a2293['shift']());}};_0x301fee(++_0x20251a);}(_0x4c58,0xed));var _0x84c5=function(_0x585ec2,_0x458ca1){_0x585ec2=_0x585ec2-0x0;var _0x1c2704=_0x4c58[_0x585ec2];return _0x1c2704;};'use strict';var Sequelize=require(_0x84c5('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x84c5('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x84c5('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x608a=['path','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5b24ce,_0x472918){var _0x5b5721=function(_0x1ebfde){while(--_0x1ebfde){_0x5b24ce['push'](_0x5b24ce['shift']());}};_0x5b5721(++_0x472918);}(_0x608a,0xff));var _0xa608=function(_0x67b060,_0x5b2995){_0x67b060=_0x67b060-0x0;var _0x947671=_0x608a[_0x67b060];return _0x947671;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var logger=require(_0xa608('0x1'))('api');var moment=require(_0xa608('0x2'));var BPromise=require(_0xa608('0x3'));var rp=require(_0xa608('0x4'));var fs=require('fs');var path=require(_0xa608('0x5'));var rimraf=require('rimraf');var config=require(_0xa608('0x6'));var attributes=require(_0xa608('0x7'));module['exports']=function(_0x4e24d6,_0x3b0f4e){return _0x4e24d6['define'](_0xa608('0x8'),attributes,{'tableName':_0xa608('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f2f=['request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','../../config/logger','api','bluebird'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x4f2f[_0x38ced4];return _0x547c07;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4f2('0x0'))(_0xf4f2('0x1'));var moment=require('moment');var BPromise=require(_0xf4f2('0x2'));var rp=require(_0xf4f2('0x3'));var fs=require('fs');var path=require(_0xf4f2('0x4'));var rimraf=require(_0xf4f2('0x5'));var config=require(_0xf4f2('0x6'));var attributes=require(_0xf4f2('0x7'));module[_0xf4f2('0x8')]=function(_0x2d7c29,_0x1e0ceb){return _0x2d7c29[_0xf4f2('0x9')](_0xf4f2('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf93b08,_0x2559d7){var _0x12f72e=function(_0x30534b){while(--_0x30534b){_0xf93b08['push'](_0xf93b08['shift']());}};_0x12f72e(++_0x2559d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3a1009,_0x3e3806){var _0xc6abe4=function(_0x5edbd4){while(--_0x5edbd4){_0x3a1009['push'](_0x3a1009['shift']());}};_0xc6abe4(++_0x3e3806);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xcb91[_0x1c5950];return _0x2b720a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4a3=['INTEGER','sequelize','exports'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0xc4a3,0x7f));var _0x3c4a=function(_0xe74c2,_0x398738){_0xe74c2=_0xe74c2-0x0;var _0x115f1f=_0xc4a3[_0xe74c2];return _0x115f1f;};'use strict';var Sequelize=require(_0x3c4a('0x0'));module[_0x3c4a('0x1')]={'penalty':{'type':Sequelize[_0x3c4a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xeccc=['exports','sequelize'];(function(_0x1fddaf,_0x5532af){var _0x38fd62=function(_0x11b8f6){while(--_0x11b8f6){_0x1fddaf['push'](_0x1fddaf['shift']());}};_0x38fd62(++_0x5532af);}(_0xeccc,0x1a1));var _0xcecc=function(_0x430d00,_0x46485c){_0x430d00=_0x430d00-0x0;var _0x37774b=_0xeccc[_0x430d00];return _0x37774b;};'use strict';var Sequelize=require(_0xcecc('0x0'));module[_0xcecc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa566=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','team_has_voice_queues','lodash'];(function(_0x24dfd2,_0x504fac){var _0x3abda1=function(_0x55bc85){while(--_0x55bc85){_0x24dfd2['push'](_0x24dfd2['shift']());}};_0x3abda1(++_0x504fac);}(_0xa566,0x1c1));var _0x6a56=function(_0x20e451,_0x389d0a){_0x20e451=_0x20e451-0x0;var _0x2bd75d=_0xa566[_0x20e451];return _0x2bd75d;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var logger=require(_0x6a56('0x2'))('api');var moment=require(_0x6a56('0x3'));var BPromise=require(_0x6a56('0x4'));var rp=require(_0x6a56('0x5'));var fs=require('fs');var path=require(_0x6a56('0x6'));var rimraf=require('rimraf');var config=require(_0x6a56('0x7'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x4c58b0,_0x47ecb8){return _0x4c58b0[_0x6a56('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0x6a56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1666=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x3c1d3d,_0x2bce74){var _0x5ed5a2=function(_0x411948){while(--_0x411948){_0x3c1d3d['push'](_0x3c1d3d['shift']());}};_0x5ed5a2(++_0x2bce74);}(_0x1666,0x75));var _0x6166=function(_0x8214be,_0x98db61){_0x8214be=_0x8214be-0x0;var _0x54da97=_0x1666[_0x8214be];return _0x54da97;};'use strict';var _=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var logger=require('../../config/logger')(_0x6166('0x2'));var moment=require(_0x6166('0x3'));var BPromise=require(_0x6166('0x4'));var rp=require(_0x6166('0x5'));var fs=require('fs');var path=require(_0x6166('0x6'));var rimraf=require(_0x6166('0x7'));var config=require(_0x6166('0x8'));var attributes=require(_0x6166('0x9'));module['exports']=function(_0x2ee359,_0x1d4f2a){return _0x2ee359[_0x6166('0xa')](_0x6166('0xb'),attributes,{'tableName':_0x6166('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa0e7=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/logger','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa0e7,0xaa));var _0x7a0e=function(_0x329595,_0x71ddda){_0x329595=_0x329595-0x0;var _0x53e5f0=_0xa0e7[_0x329595];return _0x53e5f0;};'use strict';var _=require(_0x7a0e('0x0'));var util=require(_0x7a0e('0x1'));var moment=require('moment');var BPromise=require(_0x7a0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a0e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a0e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a0e('0x5')][_0x7a0e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3ec1d7,_0x12ff84,_0xe574fc){return new BPromise(function(_0x519761,_0x486b59){return client[_0x7a0e('0x7')](_0x3ec1d7,_0xe574fc)['then'](function(_0x382e72){logger[_0x7a0e('0x8')](_0x7a0e('0x9'),_0x12ff84,_0x7a0e('0xa'));logger[_0x7a0e('0xb')](_0x7a0e('0xc'),_0x12ff84,_0x7a0e('0xa'),JSON[_0x7a0e('0xd')](_0x382e72));if(_0x382e72[_0x7a0e('0xe')]){if(_0x382e72[_0x7a0e('0xe')][_0x7a0e('0xf')]===0x1f4){logger[_0x7a0e('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x12ff84,_0x382e72[_0x7a0e('0xe')]['message']);return _0x486b59(_0x382e72[_0x7a0e('0xe')][_0x7a0e('0x10')]);}logger[_0x7a0e('0xe')](_0x7a0e('0x9'),_0x12ff84,_0x382e72[_0x7a0e('0xe')][_0x7a0e('0x10')]);return _0x519761(_0x382e72[_0x7a0e('0xe')][_0x7a0e('0x10')]);}else{logger[_0x7a0e('0x8')](_0x7a0e('0x9'),_0x12ff84,'request\x20sent');_0x519761(_0x382e72[_0x7a0e('0x11')][_0x7a0e('0x10')]);}})['catch'](function(_0x489c0c){logger[_0x7a0e('0xe')](_0x7a0e('0x9'),_0x12ff84,_0x489c0c);_0x486b59(_0x489c0c);});});}
\ No newline at end of file
+var _0x5f59=['TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x5f59,0x1ae));var _0x95f5=function(_0x1be7cd,_0x2ad83d){_0x1be7cd=_0x1be7cd-0x0;var _0x223ce0=_0x5f59[_0x1be7cd];return _0x223ce0;};'use strict';var _=require(_0x95f5('0x0'));var util=require('util');var moment=require(_0x95f5('0x1'));var BPromise=require('bluebird');var rs=require(_0x95f5('0x2'));var fs=require('fs');var Redis=require(_0x95f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x95f5('0x4'))(_0x95f5('0x5'));var config=require(_0x95f5('0x6'));var jayson=require(_0x95f5('0x7'));var client=jayson[_0x95f5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee961,_0x10b2af,_0x428fe2){return new BPromise(function(_0x32846c,_0x28c3a8){return client[_0x95f5('0x9')](_0x3ee961,_0x428fe2)[_0x95f5('0xa')](function(_0x209caa){logger['info'](_0x95f5('0xb'),_0x10b2af,'request\x20sent');logger[_0x95f5('0xc')](_0x95f5('0xd'),_0x10b2af,_0x95f5('0xe'),JSON[_0x95f5('0xf')](_0x209caa));if(_0x209caa[_0x95f5('0x10')]){if(_0x209caa[_0x95f5('0x10')][_0x95f5('0x11')]===0x1f4){logger['error'](_0x95f5('0xb'),_0x10b2af,_0x209caa[_0x95f5('0x10')][_0x95f5('0x12')]);return _0x28c3a8(_0x209caa[_0x95f5('0x10')][_0x95f5('0x12')]);}logger[_0x95f5('0x10')](_0x95f5('0xb'),_0x10b2af,_0x209caa[_0x95f5('0x10')][_0x95f5('0x12')]);return _0x32846c(_0x209caa[_0x95f5('0x10')][_0x95f5('0x12')]);}else{logger[_0x95f5('0x13')](_0x95f5('0xb'),_0x10b2af,_0x95f5('0xe'));_0x32846c(_0x209caa['result'][_0x95f5('0x12')]);}})[_0x95f5('0x14')](function(_0x4b7a8f){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x10b2af,_0x4b7a8f);_0x28c3a8(_0x4b7a8f);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9962=['express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9962,0xb8));var _0x2996=function(_0x29ef77,_0x4c00a4){_0x29ef77=_0x29ef77-0x0;var _0x410958=_0x9962[_0x29ef77];return _0x410958;};'use strict';var multer=require(_0x2996('0x0'));var util=require('util');var path=require(_0x2996('0x1'));var timeout=require(_0x2996('0x2'));var express=require(_0x2996('0x3'));var router=express['Router']();var fs_extra=require(_0x2996('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2996('0x5'));var config=require(_0x2996('0x6'));var controller=require('./template.controller');router[_0x2996('0x7')]('/',auth[_0x2996('0x8')](),controller['index']);router[_0x2996('0x7')](_0x2996('0x9'),auth[_0x2996('0x8')](),controller[_0x2996('0xa')]);router[_0x2996('0xb')]('/',auth['isAuthenticated'](),controller[_0x2996('0xc')]);router['put'](_0x2996('0x9'),auth[_0x2996('0x8')](),controller[_0x2996('0xd')]);router[_0x2996('0xe')]('/:id',auth[_0x2996('0x8')](),controller[_0x2996('0xf')]);module[_0x2996('0x10')]=router;
\ No newline at end of file
+var _0xde46=['get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0xf40e89,_0x182412){var _0x5b742c=function(_0x448059){while(--_0x448059){_0xf40e89['push'](_0xf40e89['shift']());}};_0x5b742c(++_0x182412);}(_0xde46,0x14e));var _0x6de4=function(_0x4023eb,_0x2c8179){_0x4023eb=_0x4023eb-0x0;var _0x278183=_0xde46[_0x4023eb];return _0x278183;};'use strict';var multer=require(_0x6de4('0x0'));var util=require(_0x6de4('0x1'));var path=require(_0x6de4('0x2'));var timeout=require(_0x6de4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6de4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6de4('0x5'));var config=require(_0x6de4('0x6'));var controller=require(_0x6de4('0x7'));router[_0x6de4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6de4('0x8')]('/:id',auth[_0x6de4('0x9')](),controller[_0x6de4('0xa')]);router['post']('/',auth[_0x6de4('0x9')](),controller[_0x6de4('0xb')]);router[_0x6de4('0xc')](_0x6de4('0xd'),auth[_0x6de4('0x9')](),controller[_0x6de4('0xe')]);router[_0x6de4('0xf')](_0x6de4('0xd'),auth[_0x6de4('0x9')](),controller[_0x6de4('0x10')]);module[_0x6de4('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd52=['sequelize','TEXT'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0xdd52,0x1e4));var _0x2dd5=function(_0xf08866,_0x5d404c){_0xf08866=_0xf08866-0x0;var _0x1d171c=_0xdd52[_0xf08866];return _0x1d171c;};'use strict';var Sequelize=require(_0x2dd5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x2dd5('0x1')]}};
\ No newline at end of file
+var _0x6476=['sequelize','exports','STRING'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x6476,0xc0));var _0x6647=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x6476[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x6647('0x0'));module[_0x6647('0x1')]={'name':{'type':Sequelize[_0x6647('0x2')]},'description':{'type':Sequelize[_0x6647('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab4a=['UserProfileResource','destroy','end','sendStatus','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','set','reject','save','then','Templates'];(function(_0x52aeba,_0xa253fb){var _0x30a265=function(_0x3a9147){while(--_0x3a9147){_0x52aeba['push'](_0x52aeba['shift']());}};_0x30a265(++_0xa253fb);}(_0xab4a,0x182));var _0xaab4=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xab4a[_0xc82d1a];return _0x32fad2;};'use strict';var emlformat=require(_0xaab4('0x0'));var rimraf=require(_0xaab4('0x1'));var zipdir=require(_0xaab4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaab4('0x3'));var moment=require(_0xaab4('0x4'));var BPromise=require(_0xaab4('0x5'));var Mustache=require(_0xaab4('0x6'));var util=require('util');var path=require(_0xaab4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaab4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaab4('0x9'));var squel=require('squel');var crypto=require(_0xaab4('0xa'));var jsforce=require(_0xaab4('0xb'));var deskjs=require(_0xaab4('0xc'));var toCsv=require(_0xaab4('0xd'));var querystring=require('querystring');var Papa=require(_0xaab4('0xe'));var Redis=require(_0xaab4('0xf'));var authService=require(_0xaab4('0x10'));var qs=require(_0xaab4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaab4('0x12'));var logger=require(_0xaab4('0x13'))(_0xaab4('0x14'));var utils=require(_0xaab4('0x15'));var config=require(_0xaab4('0x16'));var licenseUtil=require(_0xaab4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x60e8be,_0x133e83){_0x133e83=_0x133e83||0xcc;return function(_0x44bdc0){if(_0x44bdc0){return _0x60e8be['sendStatus'](_0x133e83);}return _0x60e8be[_0xaab4('0x18')](_0x133e83)['end']();};}function respondWithResult(_0x189f5e,_0x58e9b4){_0x58e9b4=_0x58e9b4||0xc8;return function(_0x122ef1){if(_0x122ef1){return _0x189f5e[_0xaab4('0x18')](_0x58e9b4)[_0xaab4('0x19')](_0x122ef1);}};}function respondWithFilteredResult(_0x5447d9,_0x68cd44){return function(_0x72d77e){if(_0x72d77e){var _0x26d990=typeof _0x68cd44['offset']===_0xaab4('0x1a')&&typeof _0x68cd44[_0xaab4('0x1b')]===_0xaab4('0x1a');var _0x58d191=_0x72d77e[_0xaab4('0x1c')];var _0x5d257c=_0x26d990?0x0:_0x68cd44['offset'];var _0x220af2=_0x26d990?_0x72d77e[_0xaab4('0x1c')]:_0x68cd44['offset']+_0x68cd44[_0xaab4('0x1b')];var _0x5cb4e8;if(_0x220af2>=_0x58d191){_0x220af2=_0x58d191;_0x5cb4e8=0xc8;}else{_0x5cb4e8=0xce;}_0x5447d9['status'](_0x5cb4e8);return _0x5447d9[_0xaab4('0x1d')]('Content-Range',_0x5d257c+'-'+_0x220af2+'/'+_0x58d191)['json'](_0x72d77e);}return null;};}function patchUpdates(_0x23fafd){return function(_0x3d4e1d){try{jsonpatch['apply'](_0x3d4e1d,_0x23fafd,!![]);}catch(_0x934163){return BPromise[_0xaab4('0x1e')](_0x934163);}return _0x3d4e1d[_0xaab4('0x1f')]();};}function saveUpdates(_0x2050df,_0x44862c){return function(_0x2063b3){if(_0x2063b3){return _0x2063b3['update'](_0x2050df)['then'](function(_0x37c7fc){return _0x37c7fc;});}return null;};}function removeEntity(_0x3c4f70,_0x43412a){return function(_0x77e051){if(_0x77e051){return _0x77e051['destroy']()[_0xaab4('0x20')](function(){var _0xe24433=_0x77e051['get']({'plain':!![]});var _0x1371c4=_0xaab4('0x21');return db[_0xaab4('0x22')][_0xaab4('0x23')]({'where':{'type':_0x1371c4,'resourceId':_0xe24433['id']}})[_0xaab4('0x20')](function(){return _0x77e051;});})[_0xaab4('0x20')](function(){_0x3c4f70['status'](0xcc)[_0xaab4('0x24')]();});}};}function handleEntityNotFound(_0x13df93,_0x967d28){return function(_0xc7409e){if(!_0xc7409e){_0x13df93[_0xaab4('0x25')](0x194);}return _0xc7409e;};}function handleError(_0x55ba36,_0x3679c1){_0x3679c1=_0x3679c1||0x1f4;return function(_0x14ebd7){logger[_0xaab4('0x26')](_0x14ebd7[_0xaab4('0x27')]);if(_0x14ebd7[_0xaab4('0x28')]){delete _0x14ebd7['name'];}_0x55ba36[_0xaab4('0x18')](_0x3679c1)['send'](_0x14ebd7);};}exports[_0xaab4('0x29')]=function(_0x7845d0,_0x196bf9){var _0x3491c6={},_0x3c130f={},_0x115e77={'count':0x0,'rows':[]};var _0xac120a=_[_0xaab4('0x2a')](db[_0xaab4('0x2b')][_0xaab4('0x2c')],function(_0x16c60c){return{'name':_0x16c60c[_0xaab4('0x2d')],'type':_0x16c60c[_0xaab4('0x2e')][_0xaab4('0x2f')]};});_0x3c130f['model']=_['map'](_0xac120a,_0xaab4('0x28'));_0x3c130f[_0xaab4('0x30')]=_[_0xaab4('0x31')](_0x7845d0[_0xaab4('0x30')]);_0x3c130f[_0xaab4('0x32')]=_[_0xaab4('0x33')](_0x3c130f[_0xaab4('0x34')],_0x3c130f[_0xaab4('0x30')]);_0x3491c6[_0xaab4('0x35')]=_[_0xaab4('0x33')](_0x3c130f[_0xaab4('0x34')],qs[_0xaab4('0x36')](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x36')]));_0x3491c6['attributes']=_0x3491c6[_0xaab4('0x35')][_0xaab4('0x37')]?_0x3491c6['attributes']:_0x3c130f[_0xaab4('0x34')];if(!_0x7845d0[_0xaab4('0x30')][_0xaab4('0x38')]('nolimit')){_0x3491c6[_0xaab4('0x1b')]=qs[_0xaab4('0x1b')](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x1b')]);_0x3491c6[_0xaab4('0x39')]=qs[_0xaab4('0x39')](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x39')]);}_0x3491c6[_0xaab4('0x3a')]=qs['sort'](_0x7845d0[_0xaab4('0x30')][_0xaab4('0x3b')]);_0x3491c6[_0xaab4('0x3c')]=qs[_0xaab4('0x32')](_[_0xaab4('0x3d')](_0x7845d0[_0xaab4('0x30')],_0x3c130f[_0xaab4('0x32')]),_0xac120a);if(_0x7845d0[_0xaab4('0x30')][_0xaab4('0x3e')]){_0x3491c6[_0xaab4('0x3c')]=_[_0xaab4('0x3f')](_0x3491c6['where'],{'$or':_[_0xaab4('0x2a')](_0xac120a,function(_0x57231a){if(_0x57231a[_0xaab4('0x2e')]!==_0xaab4('0x40')){var _0x4c13a3={};_0x4c13a3[_0x57231a[_0xaab4('0x28')]]={'$like':'%'+_0x7845d0[_0xaab4('0x30')][_0xaab4('0x3e')]+'%'};return _0x4c13a3;}})});}_0x3491c6=_[_0xaab4('0x3f')]({},_0x3491c6,_0x7845d0[_0xaab4('0x41')]);var _0x2879fc={'where':_0x3491c6[_0xaab4('0x3c')]};return db[_0xaab4('0x2b')][_0xaab4('0x1c')](_0x2879fc)[_0xaab4('0x20')](function(_0x42e098){_0x115e77[_0xaab4('0x1c')]=_0x42e098;if(_0x7845d0['query'][_0xaab4('0x42')]){_0x3491c6['include']=[{'all':!![]}];}return db[_0xaab4('0x2b')][_0xaab4('0x43')](_0x3491c6);})[_0xaab4('0x20')](function(_0x576aea){_0x115e77[_0xaab4('0x44')]=_0x576aea;return _0x115e77;})['then'](respondWithFilteredResult(_0x196bf9,_0x3491c6))['catch'](handleError(_0x196bf9,null));};exports['show']=function(_0x4ab2e4,_0x468bbc){var _0x1b2ac6={'raw':!![],'where':{'id':_0x4ab2e4[_0xaab4('0x45')]['id']}},_0x1d2bf8={};_0x1d2bf8[_0xaab4('0x34')]=_[_0xaab4('0x31')](db[_0xaab4('0x2b')][_0xaab4('0x2c')]);_0x1d2bf8['query']=_[_0xaab4('0x31')](_0x4ab2e4[_0xaab4('0x30')]);_0x1d2bf8[_0xaab4('0x32')]=_[_0xaab4('0x33')](_0x1d2bf8[_0xaab4('0x34')],_0x1d2bf8[_0xaab4('0x30')]);_0x1b2ac6[_0xaab4('0x35')]=_[_0xaab4('0x33')](_0x1d2bf8[_0xaab4('0x34')],qs[_0xaab4('0x36')](_0x4ab2e4[_0xaab4('0x30')][_0xaab4('0x36')]));_0x1b2ac6[_0xaab4('0x35')]=_0x1b2ac6[_0xaab4('0x35')][_0xaab4('0x37')]?_0x1b2ac6['attributes']:_0x1d2bf8[_0xaab4('0x34')];if(_0x4ab2e4['query'][_0xaab4('0x42')]){_0x1b2ac6[_0xaab4('0x46')]=[{'all':!![]}];}_0x1b2ac6=_[_0xaab4('0x3f')]({},_0x1b2ac6,_0x4ab2e4['options']);return db['Template'][_0xaab4('0x47')](_0x1b2ac6)[_0xaab4('0x20')](handleEntityNotFound(_0x468bbc,null))[_0xaab4('0x20')](respondWithResult(_0x468bbc,null))[_0xaab4('0x48')](handleError(_0x468bbc,null));};exports[_0xaab4('0x49')]=function(_0x489032,_0x3e20ee){return db['Template']['create'](_0x489032['body'],{})[_0xaab4('0x20')](function(_0x38f54d){var _0x1cfb71=_0x489032[_0xaab4('0x4a')]['get']({'plain':!![]});if(!_0x1cfb71)throw new Error(_0xaab4('0x4b'));if(_0x1cfb71[_0xaab4('0x4c')]===_0xaab4('0x4a')){var _0x5ebf8e=_0x38f54d[_0xaab4('0x4d')]({'plain':!![]});var _0x340025='Templates';return db[_0xaab4('0x4e')][_0xaab4('0x47')]({'where':{'name':_0x340025,'userProfileId':_0x1cfb71[_0xaab4('0x4f')]},'raw':!![]})['then'](function(_0x251225){if(_0x251225&&_0x251225[_0xaab4('0x50')]===0x0){return db[_0xaab4('0x22')][_0xaab4('0x49')]({'name':_0x5ebf8e[_0xaab4('0x28')],'resourceId':_0x5ebf8e['id'],'type':_0x251225[_0xaab4('0x28')],'sectionId':_0x251225['id']},{})[_0xaab4('0x20')](function(){return _0x38f54d;});}else{return _0x38f54d;}})['catch'](function(_0x451820){logger[_0xaab4('0x26')](_0xaab4('0x51'),_0x451820);throw _0x451820;});}return _0x38f54d;})[_0xaab4('0x20')](respondWithResult(_0x3e20ee,0xc9))[_0xaab4('0x48')](handleError(_0x3e20ee,null));};exports[_0xaab4('0x52')]=function(_0x593ed6,_0x3e8b78){if(_0x593ed6[_0xaab4('0x53')]['id']){delete _0x593ed6[_0xaab4('0x53')]['id'];}return db[_0xaab4('0x2b')][_0xaab4('0x47')]({'where':{'id':_0x593ed6[_0xaab4('0x45')]['id']}})[_0xaab4('0x20')](handleEntityNotFound(_0x3e8b78,null))[_0xaab4('0x20')](saveUpdates(_0x593ed6['body'],null))[_0xaab4('0x20')](respondWithResult(_0x3e8b78,null))[_0xaab4('0x48')](handleError(_0x3e8b78,null));};exports[_0xaab4('0x23')]=function(_0x2b4e49,_0x273730){return db[_0xaab4('0x2b')][_0xaab4('0x47')]({'where':{'id':_0x2b4e49[_0xaab4('0x45')]['id']}})[_0xaab4('0x20')](handleEntityNotFound(_0x273730,null))['then'](removeEntity(_0x273730,null))[_0xaab4('0x48')](handleError(_0x273730,null));};
\ No newline at end of file
+var _0x0c88=['params','length','options','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Templates','UserProfileResource','error','stack','name','send','map','Template','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c88,0x102));var _0x80c8=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x0c88[_0x1fc18b];return _0x16a351;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80c8('0x0'));var zipdir=require(_0x80c8('0x1'));var jsonpatch=require(_0x80c8('0x2'));var rp=require(_0x80c8('0x3'));var moment=require(_0x80c8('0x4'));var BPromise=require(_0x80c8('0x5'));var Mustache=require(_0x80c8('0x6'));var util=require('util');var path=require(_0x80c8('0x7'));var sox=require(_0x80c8('0x8'));var csv=require(_0x80c8('0x9'));var ejs=require(_0x80c8('0xa'));var fs=require('fs');var fs_extra=require(_0x80c8('0xb'));var _=require(_0x80c8('0xc'));var squel=require(_0x80c8('0xd'));var crypto=require('crypto');var jsforce=require(_0x80c8('0xe'));var deskjs=require(_0x80c8('0xf'));var toCsv=require(_0x80c8('0x9'));var querystring=require(_0x80c8('0x10'));var Papa=require(_0x80c8('0x11'));var Redis=require('ioredis');var authService=require(_0x80c8('0x12'));var qs=require(_0x80c8('0x13'));var as=require(_0x80c8('0x14'));var hardwareService=require(_0x80c8('0x15'));var logger=require('../../config/logger')(_0x80c8('0x16'));var utils=require('../../config/utils');var config=require(_0x80c8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x510351,_0x5f48ce){_0x5f48ce=_0x5f48ce||0xcc;return function(_0xa6e48f){if(_0xa6e48f){return _0x510351[_0x80c8('0x18')](_0x5f48ce);}return _0x510351[_0x80c8('0x19')](_0x5f48ce)[_0x80c8('0x1a')]();};}function respondWithResult(_0x5742fb,_0xfb8d0f){_0xfb8d0f=_0xfb8d0f||0xc8;return function(_0x4d3f3c){if(_0x4d3f3c){return _0x5742fb[_0x80c8('0x19')](_0xfb8d0f)[_0x80c8('0x1b')](_0x4d3f3c);}};}function respondWithFilteredResult(_0x11c649,_0x53c80d){return function(_0x1285bc){if(_0x1285bc){var _0x53bed2=typeof _0x53c80d[_0x80c8('0x1c')]===_0x80c8('0x1d')&&typeof _0x53c80d[_0x80c8('0x1e')]===_0x80c8('0x1d');var _0x533541=_0x1285bc[_0x80c8('0x1f')];var _0x38592a=_0x53bed2?0x0:_0x53c80d['offset'];var _0x4a526a=_0x53bed2?_0x1285bc[_0x80c8('0x1f')]:_0x53c80d[_0x80c8('0x1c')]+_0x53c80d[_0x80c8('0x1e')];var _0x2097d4;if(_0x4a526a>=_0x533541){_0x4a526a=_0x533541;_0x2097d4=0xc8;}else{_0x2097d4=0xce;}_0x11c649['status'](_0x2097d4);return _0x11c649[_0x80c8('0x20')](_0x80c8('0x21'),_0x38592a+'-'+_0x4a526a+'/'+_0x533541)[_0x80c8('0x1b')](_0x1285bc);}return null;};}function patchUpdates(_0xea9150){return function(_0x34fe02){try{jsonpatch[_0x80c8('0x22')](_0x34fe02,_0xea9150,!![]);}catch(_0x4e6a60){return BPromise[_0x80c8('0x23')](_0x4e6a60);}return _0x34fe02[_0x80c8('0x24')]();};}function saveUpdates(_0x5a8ea2,_0x43d44d){return function(_0x55a6be){if(_0x55a6be){return _0x55a6be[_0x80c8('0x25')](_0x5a8ea2)[_0x80c8('0x26')](function(_0x2d0456){return _0x2d0456;});}return null;};}function removeEntity(_0x3e1773,_0x2911f7){return function(_0x1f2e83){if(_0x1f2e83){return _0x1f2e83[_0x80c8('0x27')]()[_0x80c8('0x26')](function(){var _0x3c6d2e=_0x1f2e83['get']({'plain':!![]});var _0x37543f=_0x80c8('0x28');return db[_0x80c8('0x29')][_0x80c8('0x27')]({'where':{'type':_0x37543f,'resourceId':_0x3c6d2e['id']}})[_0x80c8('0x26')](function(){return _0x1f2e83;});})[_0x80c8('0x26')](function(){_0x3e1773[_0x80c8('0x19')](0xcc)[_0x80c8('0x1a')]();});}};}function handleEntityNotFound(_0x1c1152,_0x50e5da){return function(_0x3ce728){if(!_0x3ce728){_0x1c1152[_0x80c8('0x18')](0x194);}return _0x3ce728;};}function handleError(_0x5e7214,_0x35dbde){_0x35dbde=_0x35dbde||0x1f4;return function(_0x58e22c){logger[_0x80c8('0x2a')](_0x58e22c[_0x80c8('0x2b')]);if(_0x58e22c[_0x80c8('0x2c')]){delete _0x58e22c[_0x80c8('0x2c')];}_0x5e7214['status'](_0x35dbde)[_0x80c8('0x2d')](_0x58e22c);};}exports['index']=function(_0x3ebd36,_0x4136a4){var _0x48a791={},_0x3e45b2={},_0x3c2e55={'count':0x0,'rows':[]};var _0x8285f0=_[_0x80c8('0x2e')](db[_0x80c8('0x2f')][_0x80c8('0x30')],function(_0x2c82d2){return{'name':_0x2c82d2[_0x80c8('0x31')],'type':_0x2c82d2['type'][_0x80c8('0x32')]};});_0x3e45b2[_0x80c8('0x33')]=_[_0x80c8('0x2e')](_0x8285f0,_0x80c8('0x2c'));_0x3e45b2['query']=_[_0x80c8('0x34')](_0x3ebd36[_0x80c8('0x35')]);_0x3e45b2['filters']=_['intersection'](_0x3e45b2[_0x80c8('0x33')],_0x3e45b2['query']);_0x48a791['attributes']=_[_0x80c8('0x36')](_0x3e45b2['model'],qs[_0x80c8('0x37')](_0x3ebd36[_0x80c8('0x35')]['fields']));_0x48a791[_0x80c8('0x38')]=_0x48a791[_0x80c8('0x38')]['length']?_0x48a791['attributes']:_0x3e45b2[_0x80c8('0x33')];if(!_0x3ebd36['query']['hasOwnProperty'](_0x80c8('0x39'))){_0x48a791[_0x80c8('0x1e')]=qs[_0x80c8('0x1e')](_0x3ebd36[_0x80c8('0x35')][_0x80c8('0x1e')]);_0x48a791['offset']=qs[_0x80c8('0x1c')](_0x3ebd36[_0x80c8('0x35')]['offset']);}_0x48a791['order']=qs[_0x80c8('0x3a')](_0x3ebd36[_0x80c8('0x35')]['sort']);_0x48a791[_0x80c8('0x3b')]=qs[_0x80c8('0x3c')](_[_0x80c8('0x3d')](_0x3ebd36[_0x80c8('0x35')],_0x3e45b2[_0x80c8('0x3c')]),_0x8285f0);if(_0x3ebd36[_0x80c8('0x35')][_0x80c8('0x3e')]){_0x48a791[_0x80c8('0x3b')]=_[_0x80c8('0x3f')](_0x48a791['where'],{'$or':_[_0x80c8('0x2e')](_0x8285f0,function(_0x310042){if(_0x310042[_0x80c8('0x40')]!==_0x80c8('0x41')){var _0x3cb564={};_0x3cb564[_0x310042['name']]={'$like':'%'+_0x3ebd36[_0x80c8('0x35')][_0x80c8('0x3e')]+'%'};return _0x3cb564;}})});}_0x48a791=_[_0x80c8('0x3f')]({},_0x48a791,_0x3ebd36['options']);var _0x3ad6c0={'where':_0x48a791[_0x80c8('0x3b')]};return db[_0x80c8('0x2f')][_0x80c8('0x1f')](_0x3ad6c0)[_0x80c8('0x26')](function(_0x7dca94){_0x3c2e55[_0x80c8('0x1f')]=_0x7dca94;if(_0x3ebd36[_0x80c8('0x35')][_0x80c8('0x42')]){_0x48a791[_0x80c8('0x43')]=[{'all':!![]}];}return db[_0x80c8('0x2f')]['findAll'](_0x48a791);})['then'](function(_0x3b79c6){_0x3c2e55[_0x80c8('0x44')]=_0x3b79c6;return _0x3c2e55;})[_0x80c8('0x26')](respondWithFilteredResult(_0x4136a4,_0x48a791))['catch'](handleError(_0x4136a4,null));};exports[_0x80c8('0x45')]=function(_0x4eb1ac,_0x3230d6){var _0x54dda0={'raw':!![],'where':{'id':_0x4eb1ac[_0x80c8('0x46')]['id']}},_0x36c8cc={};_0x36c8cc[_0x80c8('0x33')]=_[_0x80c8('0x34')](db[_0x80c8('0x2f')][_0x80c8('0x30')]);_0x36c8cc[_0x80c8('0x35')]=_['keys'](_0x4eb1ac['query']);_0x36c8cc[_0x80c8('0x3c')]=_[_0x80c8('0x36')](_0x36c8cc[_0x80c8('0x33')],_0x36c8cc[_0x80c8('0x35')]);_0x54dda0[_0x80c8('0x38')]=_[_0x80c8('0x36')](_0x36c8cc[_0x80c8('0x33')],qs[_0x80c8('0x37')](_0x4eb1ac[_0x80c8('0x35')][_0x80c8('0x37')]));_0x54dda0['attributes']=_0x54dda0[_0x80c8('0x38')][_0x80c8('0x47')]?_0x54dda0['attributes']:_0x36c8cc[_0x80c8('0x33')];if(_0x4eb1ac[_0x80c8('0x35')][_0x80c8('0x42')]){_0x54dda0[_0x80c8('0x43')]=[{'all':!![]}];}_0x54dda0=_[_0x80c8('0x3f')]({},_0x54dda0,_0x4eb1ac[_0x80c8('0x48')]);return db[_0x80c8('0x2f')][_0x80c8('0x49')](_0x54dda0)[_0x80c8('0x26')](handleEntityNotFound(_0x3230d6,null))[_0x80c8('0x26')](respondWithResult(_0x3230d6,null))[_0x80c8('0x4a')](handleError(_0x3230d6,null));};exports[_0x80c8('0x4b')]=function(_0x50a901,_0xc5503){return db[_0x80c8('0x2f')][_0x80c8('0x4b')](_0x50a901[_0x80c8('0x4c')],{})['then'](function(_0x50847c){var _0x4101ae=_0x50a901['user'][_0x80c8('0x4d')]({'plain':!![]});if(!_0x4101ae)throw new Error(_0x80c8('0x4e'));if(_0x4101ae[_0x80c8('0x4f')]===_0x80c8('0x50')){var _0x5d0074=_0x50847c[_0x80c8('0x4d')]({'plain':!![]});var _0x49c510=_0x80c8('0x28');return db['UserProfileSection'][_0x80c8('0x49')]({'where':{'name':_0x49c510,'userProfileId':_0x4101ae[_0x80c8('0x51')]},'raw':!![]})[_0x80c8('0x26')](function(_0x18feb9){if(_0x18feb9&&_0x18feb9['autoAssociation']===0x0){return db[_0x80c8('0x29')][_0x80c8('0x4b')]({'name':_0x5d0074[_0x80c8('0x2c')],'resourceId':_0x5d0074['id'],'type':_0x18feb9[_0x80c8('0x2c')],'sectionId':_0x18feb9['id']},{})[_0x80c8('0x26')](function(){return _0x50847c;});}else{return _0x50847c;}})[_0x80c8('0x4a')](function(_0x51fdfc){logger[_0x80c8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51fdfc);throw _0x51fdfc;});}return _0x50847c;})[_0x80c8('0x26')](respondWithResult(_0xc5503,0xc9))[_0x80c8('0x4a')](handleError(_0xc5503,null));};exports[_0x80c8('0x25')]=function(_0x30ca9d,_0x3f242d){if(_0x30ca9d[_0x80c8('0x4c')]['id']){delete _0x30ca9d[_0x80c8('0x4c')]['id'];}return db[_0x80c8('0x2f')][_0x80c8('0x49')]({'where':{'id':_0x30ca9d['params']['id']}})['then'](handleEntityNotFound(_0x3f242d,null))[_0x80c8('0x26')](saveUpdates(_0x30ca9d['body'],null))['then'](respondWithResult(_0x3f242d,null))[_0x80c8('0x4a')](handleError(_0x3f242d,null));};exports['destroy']=function(_0x1d0333,_0x3e034b){return db[_0x80c8('0x2f')][_0x80c8('0x49')]({'where':{'id':_0x1d0333[_0x80c8('0x46')]['id']}})[_0x80c8('0x26')](handleEntityNotFound(_0x3e034b,null))[_0x80c8('0x26')](removeEntity(_0x3e034b,null))[_0x80c8('0x4a')](handleError(_0x3e034b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47d3=['path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x47d3,0x1b4));var _0x347d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47d3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x347d('0x0'));var util=require('util');var logger=require(_0x347d('0x1'))(_0x347d('0x2'));var moment=require(_0x347d('0x3'));var BPromise=require(_0x347d('0x4'));var rp=require(_0x347d('0x5'));var fs=require('fs');var path=require(_0x347d('0x6'));var rimraf=require(_0x347d('0x7'));var config=require('../../config/environment');var attributes=require(_0x347d('0x8'));module[_0x347d('0x9')]=function(_0x2f0d40,_0x509899){return _0x2f0d40[_0x347d('0xa')](_0x347d('0xb'),attributes,{'tableName':_0x347d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b29=['path','rimraf','./template.attributes','exports','define','tools_templates','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53f9cc,_0x3b8079){var _0x507016=function(_0x26a72d){while(--_0x26a72d){_0x53f9cc['push'](_0x53f9cc['shift']());}};_0x507016(++_0x3b8079);}(_0x7b29,0x7f));var _0x97b2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x7b29[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x97b2('0x0'))(_0x97b2('0x1'));var moment=require(_0x97b2('0x2'));var BPromise=require(_0x97b2('0x3'));var rp=require(_0x97b2('0x4'));var fs=require('fs');var path=require(_0x97b2('0x5'));var rimraf=require(_0x97b2('0x6'));var config=require('../../config/environment');var attributes=require(_0x97b2('0x7'));module[_0x97b2('0x8')]=function(_0x4b5a15,_0x3f96d5){return _0x4b5a15[_0x97b2('0x9')]('Template',attributes,{'tableName':_0x97b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21f8=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','attributes','limit','map','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0x21f8,0x71));var _0x821f=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0x21f8[_0x44c974];return _0x5214c6;};'use strict';var _=require(_0x821f('0x0'));var util=require(_0x821f('0x1'));var moment=require(_0x821f('0x2'));var BPromise=require(_0x821f('0x3'));var rs=require(_0x821f('0x4'));var fs=require('fs');var Redis=require(_0x821f('0x5'));var db=require(_0x821f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x821f('0x7'));var jayson=require(_0x821f('0x8'));var client=jayson[_0x821f('0x9')][_0x821f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cd13a,_0x3a42fe,_0x1b9945){return new BPromise(function(_0xfcb0a,_0x4e260d){return client['request'](_0x3cd13a,_0x1b9945)[_0x821f('0xb')](function(_0x15b547){logger[_0x821f('0xc')]('Template,\x20%s,\x20%s',_0x3a42fe,_0x821f('0xd'));logger[_0x821f('0xe')](_0x821f('0xf'),_0x3a42fe,_0x821f('0xd'),JSON[_0x821f('0x10')](_0x15b547));if(_0x15b547[_0x821f('0x11')]){if(_0x15b547[_0x821f('0x11')][_0x821f('0x12')]===0x1f4){logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x15b547['error']['message']);return _0x4e260d(_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);}logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);return _0xfcb0a(_0x15b547[_0x821f('0x11')][_0x821f('0x14')]);}else{logger[_0x821f('0xc')](_0x821f('0x13'),_0x3a42fe,'request\x20sent');_0xfcb0a(_0x15b547[_0x821f('0x15')]['message']);}})[_0x821f('0x16')](function(_0x497c37){logger[_0x821f('0x11')](_0x821f('0x13'),_0x3a42fe,_0x497c37);_0x4e260d(_0x497c37);});});}exports[_0x821f('0x17')]=function(_0x27c41c){var _0x5e8c54=this;return new Promise(function(_0x1c015a,_0x34d89c){return db['Template'][_0x821f('0x18')]({'raw':_0x27c41c['options']?_0x27c41c[_0x821f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27c41c[_0x821f('0x19')]?_0x27c41c[_0x821f('0x19')]['where']||null:null,'attributes':_0x27c41c['options']?_0x27c41c[_0x821f('0x19')][_0x821f('0x1a')]||null:null,'limit':_0x27c41c[_0x821f('0x19')]?_0x27c41c['options'][_0x821f('0x1b')]||null:null,'include':_0x27c41c[_0x821f('0x19')]?_0x27c41c[_0x821f('0x19')]['include']?_[_0x821f('0x1c')](_0x27c41c[_0x821f('0x19')]['include'],function(_0x4ef246){return{'model':db[_0x4ef246['model']],'as':_0x4ef246['as'],'attributes':_0x4ef246['attributes'],'include':_0x4ef246[_0x821f('0x1d')]?_['map'](_0x4ef246['include'],function(_0x21c1d9){return{'model':db[_0x21c1d9['model']],'as':_0x21c1d9['as'],'attributes':_0x21c1d9['attributes'],'include':_0x21c1d9[_0x821f('0x1d')]?_[_0x821f('0x1c')](_0x21c1d9[_0x821f('0x1d')],function(_0x368a74){return{'model':db[_0x368a74['model']],'as':_0x368a74['as'],'attributes':_0x368a74[_0x821f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x821f('0xb')](function(_0x183535){logger[_0x821f('0xc')]('GetTemplate',_0x27c41c);logger[_0x821f('0xe')](_0x821f('0x17'),_0x27c41c,JSON[_0x821f('0x10')](_0x183535));_0x1c015a(_0x183535);})[_0x821f('0x16')](function(_0x53d87e){logger[_0x821f('0x11')]('GetTemplate',_0x53d87e['message'],_0x27c41c);_0x34d89c(_0x5e8c54[_0x821f('0x11')](0x1f4,_0x53d87e[_0x821f('0x14')]));});});};
\ No newline at end of file
+var _0xc933=['catch','findAll','options','where','attributes','limit','include','map','model','GetTemplate','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xc933,0xf9));var _0x3c93=function(_0x189371,_0x5b36fe){_0x189371=_0x189371-0x0;var _0x2bf98d=_0xc933[_0x189371];return _0x2bf98d;};'use strict';var _=require(_0x3c93('0x0'));var util=require(_0x3c93('0x1'));var moment=require(_0x3c93('0x2'));var BPromise=require(_0x3c93('0x3'));var rs=require(_0x3c93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c93('0x5'))['db'];var utils=require(_0x3c93('0x6'));var logger=require(_0x3c93('0x7'))(_0x3c93('0x8'));var config=require(_0x3c93('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c93('0xa')][_0x3c93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c22c,_0x411bb7,_0x489139){return new BPromise(function(_0x1b505a,_0x2ead14){return client[_0x3c93('0xc')](_0x52c22c,_0x489139)[_0x3c93('0xd')](function(_0x46f9e8){logger[_0x3c93('0xe')]('Template,\x20%s,\x20%s',_0x411bb7,'request\x20sent');logger['debug'](_0x3c93('0xf'),_0x411bb7,_0x3c93('0x10'),JSON[_0x3c93('0x11')](_0x46f9e8));if(_0x46f9e8[_0x3c93('0x12')]){if(_0x46f9e8[_0x3c93('0x12')][_0x3c93('0x13')]===0x1f4){logger[_0x3c93('0x12')](_0x3c93('0x14'),_0x411bb7,_0x46f9e8[_0x3c93('0x12')][_0x3c93('0x15')]);return _0x2ead14(_0x46f9e8[_0x3c93('0x12')][_0x3c93('0x15')]);}logger[_0x3c93('0x12')](_0x3c93('0x14'),_0x411bb7,_0x46f9e8[_0x3c93('0x12')][_0x3c93('0x15')]);return _0x1b505a(_0x46f9e8[_0x3c93('0x12')]['message']);}else{logger['info'](_0x3c93('0x14'),_0x411bb7,_0x3c93('0x10'));_0x1b505a(_0x46f9e8[_0x3c93('0x16')][_0x3c93('0x15')]);}})[_0x3c93('0x17')](function(_0x8b3fdc){logger[_0x3c93('0x12')]('Template,\x20%s,\x20%s',_0x411bb7,_0x8b3fdc);_0x2ead14(_0x8b3fdc);});});}exports['GetTemplate']=function(_0xe14ac8){var _0x42516b=this;return new Promise(function(_0x540010,_0x54a8d8){return db['Template'][_0x3c93('0x18')]({'raw':_0xe14ac8['options']?_0xe14ac8['options']['raw']===undefined?!![]:![]:!![],'where':_0xe14ac8[_0x3c93('0x19')]?_0xe14ac8[_0x3c93('0x19')][_0x3c93('0x1a')]||null:null,'attributes':_0xe14ac8[_0x3c93('0x19')]?_0xe14ac8[_0x3c93('0x19')][_0x3c93('0x1b')]||null:null,'limit':_0xe14ac8[_0x3c93('0x19')]?_0xe14ac8[_0x3c93('0x19')][_0x3c93('0x1c')]||null:null,'include':_0xe14ac8[_0x3c93('0x19')]?_0xe14ac8['options'][_0x3c93('0x1d')]?_[_0x3c93('0x1e')](_0xe14ac8[_0x3c93('0x19')][_0x3c93('0x1d')],function(_0x3b3fbb){return{'model':db[_0x3b3fbb[_0x3c93('0x1f')]],'as':_0x3b3fbb['as'],'attributes':_0x3b3fbb['attributes'],'include':_0x3b3fbb[_0x3c93('0x1d')]?_[_0x3c93('0x1e')](_0x3b3fbb[_0x3c93('0x1d')],function(_0x3689e3){return{'model':db[_0x3689e3[_0x3c93('0x1f')]],'as':_0x3689e3['as'],'attributes':_0x3689e3[_0x3c93('0x1b')],'include':_0x3689e3[_0x3c93('0x1d')]?_[_0x3c93('0x1e')](_0x3689e3[_0x3c93('0x1d')],function(_0x568e40){return{'model':db[_0x568e40[_0x3c93('0x1f')]],'as':_0x568e40['as'],'attributes':_0x568e40[_0x3c93('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3c93('0xd')](function(_0x51de7b){logger[_0x3c93('0xe')](_0x3c93('0x20'),_0xe14ac8);logger[_0x3c93('0x21')](_0x3c93('0x20'),_0xe14ac8,JSON['stringify'](_0x51de7b));_0x540010(_0x51de7b);})['catch'](function(_0x5e082f){logger[_0x3c93('0x12')](_0x3c93('0x20'),_0x5e082f[_0x3c93('0x15')],_0xe14ac8);_0x54a8d8(_0x42516b[_0x3c93('0x12')](0x1f4,_0x5e082f['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6245=['fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x5bb8e0,_0x3f4030){var _0x254f79=function(_0x198e95){while(--_0x198e95){_0x5bb8e0['push'](_0x5bb8e0['shift']());}};_0x254f79(++_0x3f4030);}(_0x6245,0xe5));var _0x5624=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x6245[_0x52085a];return _0x5afc1a;};'use strict';var multer=require(_0x5624('0x0'));var util=require(_0x5624('0x1'));var path=require(_0x5624('0x2'));var timeout=require(_0x5624('0x3'));var express=require('express');var router=express[_0x5624('0x4')]();var fs_extra=require(_0x5624('0x5'));var auth=require(_0x5624('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5624('0x7'));var controller=require(_0x5624('0x8'));router['get']('/',auth[_0x5624('0x9')](),controller[_0x5624('0xa')]);router[_0x5624('0xb')](_0x5624('0xc'),auth[_0x5624('0x9')](),controller[_0x5624('0xd')]);router[_0x5624('0xb')](_0x5624('0xe'),auth[_0x5624('0x9')](),controller['getAllConditions']);router[_0x5624('0xb')](_0x5624('0xf'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x5624('0xb')](_0x5624('0x10'),auth['isAuthenticated'](),controller[_0x5624('0x11')]);router[_0x5624('0x12')]('/',auth[_0x5624('0x9')](),controller['create']);router['post'](_0x5624('0xe'),auth[_0x5624('0x9')](),controller[_0x5624('0x13')]);router['post'](_0x5624('0xf'),auth[_0x5624('0x9')](),controller['addAnyCondition']);router['post'](_0x5624('0x10'),auth[_0x5624('0x9')](),controller[_0x5624('0x14')]);router[_0x5624('0x15')](_0x5624('0xc'),auth['isAuthenticated'](),controller[_0x5624('0x16')]);router[_0x5624('0x17')](_0x5624('0xc'),auth[_0x5624('0x9')](),controller[_0x5624('0x18')]);module[_0x5624('0x19')]=router;
\ No newline at end of file
+var _0x4c41=['/:id/all_conditions','getAllConditions','get','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','/:id','update','delete','destroy','exports','util','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated'];(function(_0x3dd92b,_0x4d1139){var _0x5e1d23=function(_0x5d866f){while(--_0x5d866f){_0x3dd92b['push'](_0x3dd92b['shift']());}};_0x5e1d23(++_0x4d1139);}(_0x4c41,0xf7));var _0x14c4=function(_0x55f4eb,_0xb48df1){_0x55f4eb=_0x55f4eb-0x0;var _0xab9ff8=_0x4c41[_0x55f4eb];return _0xab9ff8;};'use strict';var multer=require('multer');var util=require(_0x14c4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14c4('0x1'));var auth=require(_0x14c4('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x14c4('0x3'));var controller=require(_0x14c4('0x4'));router['get']('/',auth[_0x14c4('0x5')](),controller['index']);router['get']('/:id',auth[_0x14c4('0x5')](),controller['show']);router['get'](_0x14c4('0x6'),auth['isAuthenticated'](),controller[_0x14c4('0x7')]);router[_0x14c4('0x8')](_0x14c4('0x9'),auth[_0x14c4('0x5')](),controller[_0x14c4('0xa')]);router['get'](_0x14c4('0xb'),auth['isAuthenticated'](),controller[_0x14c4('0xc')]);router[_0x14c4('0xd')]('/',auth[_0x14c4('0x5')](),controller[_0x14c4('0xe')]);router[_0x14c4('0xd')](_0x14c4('0x6'),auth[_0x14c4('0x5')](),controller[_0x14c4('0xf')]);router[_0x14c4('0xd')](_0x14c4('0x9'),auth[_0x14c4('0x5')](),controller[_0x14c4('0x10')]);router[_0x14c4('0xd')]('/:id/actions',auth[_0x14c4('0x5')](),controller[_0x14c4('0x11')]);router['put'](_0x14c4('0x12'),auth[_0x14c4('0x5')](),controller[_0x14c4('0x13')]);router[_0x14c4('0x14')](_0x14c4('0x12'),auth['isAuthenticated'](),controller[_0x14c4('0x15')]);module[_0x14c4('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe107=['sequelize','exports','STRING','BOOLEAN'];(function(_0x929c7e,_0x38c4cc){var _0x5de099=function(_0xc4e8d8){while(--_0xc4e8d8){_0x929c7e['push'](_0x929c7e['shift']());}};_0x5de099(++_0x38c4cc);}(_0xe107,0x1d0));var _0x7e10=function(_0x489bd2,_0x5b9f55){_0x489bd2=_0x489bd2-0x0;var _0x280eec=_0xe107[_0x489bd2];return _0x280eec;};'use strict';var Sequelize=require(_0x7e10('0x0'));module[_0x7e10('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7e10('0x2')]},'description':{'type':Sequelize[_0x7e10('0x2')]},'status':{'type':Sequelize[_0x7e10('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe182=['STRING','BOOLEAN','exports'];(function(_0x342d44,_0x1e4423){var _0x6173d6=function(_0x16cc0c){while(--_0x16cc0c){_0x342d44['push'](_0x342d44['shift']());}};_0x6173d6(++_0x1e4423);}(_0xe182,0xf8));var _0x2e18=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xe182[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require('sequelize');module[_0x2e18('0x0')]={'name':{'type':Sequelize[_0x2e18('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2e18('0x2')],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e8e=['getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','Triggers','UserProfileResource','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Trigger','then','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions'];(function(_0x5a117a,_0x247779){var _0x173ef6=function(_0x5e652a){while(--_0x5e652a){_0x5a117a['push'](_0x5a117a['shift']());}};_0x173ef6(++_0x247779);}(_0x2e8e,0x1e4));var _0xe2e8=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x2e8e[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0xe2e8('0x0'));var rimraf=require(_0xe2e8('0x1'));var zipdir=require(_0xe2e8('0x2'));var jsonpatch=require(_0xe2e8('0x3'));var rp=require(_0xe2e8('0x4'));var moment=require(_0xe2e8('0x5'));var BPromise=require(_0xe2e8('0x6'));var Mustache=require(_0xe2e8('0x7'));var util=require(_0xe2e8('0x8'));var path=require('path');var sox=require(_0xe2e8('0x9'));var csv=require('to-csv');var ejs=require(_0xe2e8('0xa'));var fs=require('fs');var fs_extra=require(_0xe2e8('0xb'));var _=require('lodash');var squel=require(_0xe2e8('0xc'));var crypto=require(_0xe2e8('0xd'));var jsforce=require(_0xe2e8('0xe'));var deskjs=require(_0xe2e8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe2e8('0x10'));var Papa=require(_0xe2e8('0x11'));var Redis=require(_0xe2e8('0x12'));var authService=require(_0xe2e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe2e8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2e8('0x15'))(_0xe2e8('0x16'));var utils=require(_0xe2e8('0x17'));var config=require(_0xe2e8('0x18'));var licenseUtil=require(_0xe2e8('0x19'));var db=require(_0xe2e8('0x1a'))['db'];function respondWithStatusCode(_0xb6febe,_0x5f35d7){_0x5f35d7=_0x5f35d7||0xcc;return function(_0x17efdc){if(_0x17efdc){return _0xb6febe[_0xe2e8('0x1b')](_0x5f35d7);}return _0xb6febe[_0xe2e8('0x1c')](_0x5f35d7)['end']();};}function respondWithResult(_0x2a9e4a,_0x519447){_0x519447=_0x519447||0xc8;return function(_0x452a65){if(_0x452a65){return _0x2a9e4a[_0xe2e8('0x1c')](_0x519447)[_0xe2e8('0x1d')](_0x452a65);}};}function respondWithFilteredResult(_0x22ff04,_0x14974e){return function(_0x435fa4){if(_0x435fa4){var _0x2c8b6b=typeof _0x14974e[_0xe2e8('0x1e')]===_0xe2e8('0x1f')&&typeof _0x14974e[_0xe2e8('0x20')]==='undefined';var _0xccd92=_0x435fa4['count'];var _0x470678=_0x2c8b6b?0x0:_0x14974e[_0xe2e8('0x1e')];var _0x1e3dbc=_0x2c8b6b?_0x435fa4[_0xe2e8('0x21')]:_0x14974e[_0xe2e8('0x1e')]+_0x14974e[_0xe2e8('0x20')];var _0x117ec5;if(_0x1e3dbc>=_0xccd92){_0x1e3dbc=_0xccd92;_0x117ec5=0xc8;}else{_0x117ec5=0xce;}_0x22ff04['status'](_0x117ec5);return _0x22ff04[_0xe2e8('0x22')](_0xe2e8('0x23'),_0x470678+'-'+_0x1e3dbc+'/'+_0xccd92)[_0xe2e8('0x1d')](_0x435fa4);}return null;};}function patchUpdates(_0x6fc966){return function(_0x327748){try{jsonpatch[_0xe2e8('0x24')](_0x327748,_0x6fc966,!![]);}catch(_0x4c456f){return BPromise['reject'](_0x4c456f);}return _0x327748[_0xe2e8('0x25')]();};}function saveUpdates(_0x17e686,_0x25c342){return function(_0x4681a4){if(_0x4681a4){return _0x4681a4['update'](_0x17e686)['then'](function(_0x56bf27){return _0x56bf27;});}return null;};}function removeEntity(_0x659443,_0x5ca3c9){return function(_0x244563){if(_0x244563){return _0x244563[_0xe2e8('0x26')]()['then'](function(){var _0x2e7cb1=_0x244563[_0xe2e8('0x27')]({'plain':!![]});var _0x3f1d76=_0xe2e8('0x28');return db[_0xe2e8('0x29')][_0xe2e8('0x26')]({'where':{'type':_0x3f1d76,'resourceId':_0x2e7cb1['id']}})['then'](function(){return _0x244563;});})['then'](function(){_0x659443[_0xe2e8('0x1c')](0xcc)[_0xe2e8('0x2a')]();});}};}function handleEntityNotFound(_0x555562,_0x5deafa){return function(_0x1358cb){if(!_0x1358cb){_0x555562[_0xe2e8('0x1b')](0x194);}return _0x1358cb;};}function handleError(_0x5d158f,_0x516315){_0x516315=_0x516315||0x1f4;return function(_0x2aa660){logger[_0xe2e8('0x2b')](_0x2aa660[_0xe2e8('0x2c')]);if(_0x2aa660[_0xe2e8('0x2d')]){delete _0x2aa660['name'];}_0x5d158f[_0xe2e8('0x1c')](_0x516315)['send'](_0x2aa660);};}exports[_0xe2e8('0x2e')]=function(_0x3a78a7,_0x2d9bc3){var _0x3310d1={},_0x127201={},_0xcbcf36={'count':0x0,'rows':[]};var _0x46cca7=_[_0xe2e8('0x2f')](db['Trigger'][_0xe2e8('0x30')],function(_0x16768e){return{'name':_0x16768e['fieldName'],'type':_0x16768e[_0xe2e8('0x31')][_0xe2e8('0x32')]};});_0x127201[_0xe2e8('0x33')]=_[_0xe2e8('0x2f')](_0x46cca7,_0xe2e8('0x2d'));_0x127201[_0xe2e8('0x34')]=_[_0xe2e8('0x35')](_0x3a78a7[_0xe2e8('0x34')]);_0x127201[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x127201[_0xe2e8('0x33')],_0x127201[_0xe2e8('0x34')]);_0x3310d1[_0xe2e8('0x38')]=_[_0xe2e8('0x37')](_0x127201['model'],qs[_0xe2e8('0x39')](_0x3a78a7['query']['fields']));_0x3310d1[_0xe2e8('0x38')]=_0x3310d1['attributes']['length']?_0x3310d1[_0xe2e8('0x38')]:_0x127201[_0xe2e8('0x33')];if(!_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x3a')](_0xe2e8('0x3b'))){_0x3310d1[_0xe2e8('0x20')]=qs['limit'](_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x20')]);_0x3310d1['offset']=qs[_0xe2e8('0x1e')](_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x1e')]);}_0x3310d1[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x3d')]);_0x3310d1[_0xe2e8('0x3e')]=qs[_0xe2e8('0x36')](_[_0xe2e8('0x3f')](_0x3a78a7[_0xe2e8('0x34')],_0x127201[_0xe2e8('0x36')]),_0x46cca7);if(_0x3a78a7['query'][_0xe2e8('0x40')]){_0x3310d1[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x3310d1['where'],{'$or':_['map'](_0x46cca7,function(_0xe888fe){if(_0xe888fe[_0xe2e8('0x31')]!=='VIRTUAL'){var _0x4b5e8f={};_0x4b5e8f[_0xe888fe[_0xe2e8('0x2d')]]={'$like':'%'+_0x3a78a7['query'][_0xe2e8('0x40')]+'%'};return _0x4b5e8f;}})});}_0x3310d1=_[_0xe2e8('0x41')]({},_0x3310d1,_0x3a78a7[_0xe2e8('0x42')]);var _0x42ef1d={'where':_0x3310d1['where']};return db[_0xe2e8('0x43')][_0xe2e8('0x21')](_0x42ef1d)[_0xe2e8('0x44')](function(_0x5ac667){_0xcbcf36[_0xe2e8('0x21')]=_0x5ac667;if(_0x3a78a7[_0xe2e8('0x34')][_0xe2e8('0x45')]){_0x3310d1[_0xe2e8('0x46')]=[{'all':!![]}];}return db[_0xe2e8('0x43')][_0xe2e8('0x47')](_0x3310d1);})[_0xe2e8('0x44')](function(_0x258557){_0xcbcf36['rows']=_0x258557;return _0xcbcf36;})[_0xe2e8('0x44')](respondWithFilteredResult(_0x2d9bc3,_0x3310d1))[_0xe2e8('0x48')](handleError(_0x2d9bc3,null));};exports[_0xe2e8('0x49')]=function(_0x41ecb2,_0x2ab575){var _0x367b02={'raw':![],'where':{'id':_0x41ecb2[_0xe2e8('0x4a')]['id']}},_0x2582fb={};_0x2582fb[_0xe2e8('0x33')]=_[_0xe2e8('0x35')](db[_0xe2e8('0x43')]['rawAttributes']);_0x2582fb[_0xe2e8('0x34')]=_[_0xe2e8('0x35')](_0x41ecb2[_0xe2e8('0x34')]);_0x2582fb[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x2582fb['model'],_0x2582fb[_0xe2e8('0x34')]);_0x367b02[_0xe2e8('0x38')]=_['intersection'](_0x2582fb[_0xe2e8('0x33')],qs[_0xe2e8('0x39')](_0x41ecb2[_0xe2e8('0x34')][_0xe2e8('0x39')]));_0x367b02['attributes']=_0x367b02['attributes'][_0xe2e8('0x4b')]?_0x367b02[_0xe2e8('0x38')]:_0x2582fb[_0xe2e8('0x33')];if(_0x41ecb2[_0xe2e8('0x34')]['includeAll']){_0x367b02[_0xe2e8('0x46')]=[{'all':!![]}];}_0x367b02=_[_0xe2e8('0x41')]({},_0x367b02,_0x41ecb2[_0xe2e8('0x42')]);return db[_0xe2e8('0x43')][_0xe2e8('0x4c')](_0x367b02)[_0xe2e8('0x44')](handleEntityNotFound(_0x2ab575,null))['then'](respondWithResult(_0x2ab575,null))[_0xe2e8('0x48')](handleError(_0x2ab575,null));};exports[_0xe2e8('0x4d')]=function(_0x4ec776,_0x724f5f){return db[_0xe2e8('0x43')][_0xe2e8('0x4d')](_0x4ec776[_0xe2e8('0x4e')],{})[_0xe2e8('0x44')](function(_0x2f344e){var _0x30f1e6=_0x4ec776[_0xe2e8('0x4f')][_0xe2e8('0x27')]({'plain':!![]});if(!_0x30f1e6)throw new Error(_0xe2e8('0x50'));if(_0x30f1e6['role']===_0xe2e8('0x4f')){var _0x33abca=_0x2f344e[_0xe2e8('0x27')]({'plain':!![]});var _0xad67e2=_0xe2e8('0x28');return db[_0xe2e8('0x51')][_0xe2e8('0x4c')]({'where':{'name':_0xad67e2,'userProfileId':_0x30f1e6['userProfileId']},'raw':!![]})[_0xe2e8('0x44')](function(_0x3fe344){if(_0x3fe344&&_0x3fe344[_0xe2e8('0x52')]===0x0){return db[_0xe2e8('0x29')][_0xe2e8('0x4d')]({'name':_0x33abca[_0xe2e8('0x2d')],'resourceId':_0x33abca['id'],'type':_0x3fe344[_0xe2e8('0x2d')],'sectionId':_0x3fe344['id']},{})['then'](function(){return _0x2f344e;});}else{return _0x2f344e;}})['catch'](function(_0x380e5b){logger['error'](_0xe2e8('0x53'),_0x380e5b);throw _0x380e5b;});}return _0x2f344e;})[_0xe2e8('0x44')](respondWithResult(_0x724f5f,0xc9))[_0xe2e8('0x48')](handleError(_0x724f5f,null));};exports[_0xe2e8('0x54')]=function(_0x229288,_0x4798d4){if(_0x229288[_0xe2e8('0x4e')]['id']){delete _0x229288['body']['id'];}return db[_0xe2e8('0x43')]['find']({'where':{'id':_0x229288['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x4798d4,null))[_0xe2e8('0x44')](saveUpdates(_0x229288[_0xe2e8('0x4e')],null))[_0xe2e8('0x44')](respondWithResult(_0x4798d4,null))[_0xe2e8('0x48')](handleError(_0x4798d4,null));};exports['destroy']=function(_0x2cc47a,_0x3c6531){return db[_0xe2e8('0x43')][_0xe2e8('0x4c')]({'where':{'id':_0x2cc47a[_0xe2e8('0x4a')]['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x3c6531,null))['then'](removeEntity(_0x3c6531,null))[_0xe2e8('0x48')](handleError(_0x3c6531,null));};exports[_0xe2e8('0x55')]=function(_0x4acff8,_0x11f02e,_0xc034c9){if(_0x4acff8[_0xe2e8('0x4e')]['id']){delete _0x4acff8[_0xe2e8('0x4e')]['id'];}return db[_0xe2e8('0x43')][_0xe2e8('0x4c')]({'where':{'id':_0x4acff8['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x11f02e,null))[_0xe2e8('0x44')](function(_0x1ca3c6){if(_0x1ca3c6){_0x4acff8[_0xe2e8('0x4e')][_0xe2e8('0x56')]=_0x1ca3c6['id'];return db[_0xe2e8('0x57')][_0xe2e8('0x4d')](_0x4acff8['body']);}})[_0xe2e8('0x44')](respondWithResult(_0x11f02e,null))[_0xe2e8('0x48')](handleError(_0x11f02e,null));};exports[_0xe2e8('0x58')]=function(_0x3ee8b4,_0x5bd4e9,_0x4b500c){if(_0x3ee8b4['body']['id']){delete _0x3ee8b4[_0xe2e8('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x3ee8b4['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x5bd4e9,null))['then'](function(_0x2f0097){if(_0x2f0097){_0x3ee8b4[_0xe2e8('0x4e')][_0xe2e8('0x59')]=_0x2f0097['id'];return db[_0xe2e8('0x57')][_0xe2e8('0x4d')](_0x3ee8b4[_0xe2e8('0x4e')]);}})['then'](respondWithResult(_0x5bd4e9,null))[_0xe2e8('0x48')](handleError(_0x5bd4e9,null));};exports['getAllConditions']=function(_0x2dd13e,_0x3ec02a,_0x101625){var _0x5329f1={};var _0x30e2d0={};var _0x1b80cb;var _0xe22a76;return db[_0xe2e8('0x43')][_0xe2e8('0x5a')]({'where':{'id':_0x2dd13e['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x3ec02a,null))[_0xe2e8('0x44')](function(_0x423433){if(_0x423433){_0x1b80cb=_0x423433;_0x30e2d0[_0xe2e8('0x33')]=_[_0xe2e8('0x35')](db[_0xe2e8('0x57')][_0xe2e8('0x30')]);_0x30e2d0['query']=_[_0xe2e8('0x35')](_0x2dd13e[_0xe2e8('0x34')]);_0x30e2d0['filters']=_[_0xe2e8('0x37')](_0x30e2d0[_0xe2e8('0x33')],_0x30e2d0[_0xe2e8('0x34')]);_0x5329f1[_0xe2e8('0x38')]=_[_0xe2e8('0x37')](_0x30e2d0[_0xe2e8('0x33')],qs['fields'](_0x2dd13e[_0xe2e8('0x34')]['fields']));_0x5329f1[_0xe2e8('0x38')]=_0x5329f1[_0xe2e8('0x38')][_0xe2e8('0x4b')]?_0x5329f1['attributes']:_0x30e2d0[_0xe2e8('0x33')];_0x5329f1[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x2dd13e['query']['sort']);_0x5329f1['where']=qs[_0xe2e8('0x36')](_[_0xe2e8('0x3f')](_0x2dd13e[_0xe2e8('0x34')],_0x30e2d0[_0xe2e8('0x36')]));if(_0x2dd13e['query']['filter']){_0x5329f1[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x5329f1[_0xe2e8('0x3e')],{'$or':_[_0xe2e8('0x2f')](_0x5329f1[_0xe2e8('0x38')],function(_0x54f6a4){var _0x2c3f14={};_0x2c3f14[_0x54f6a4]={'$like':'%'+_0x2dd13e[_0xe2e8('0x34')][_0xe2e8('0x40')]+'%'};return _0x2c3f14;})});}_0x5329f1=_[_0xe2e8('0x41')]({},_0x5329f1,_0x2dd13e['options']);return _0x1b80cb[_0xe2e8('0x5b')](_0x5329f1);}})[_0xe2e8('0x44')](function(_0x2dd4ae){if(_0x2dd4ae){_0xe22a76=_0x2dd4ae[_0xe2e8('0x4b')];if(!_0x2dd13e[_0xe2e8('0x34')][_0xe2e8('0x3a')]('nolimit')){_0x5329f1[_0xe2e8('0x20')]=qs[_0xe2e8('0x20')](_0x2dd13e['query'][_0xe2e8('0x20')]);_0x5329f1[_0xe2e8('0x1e')]=qs[_0xe2e8('0x1e')](_0x2dd13e[_0xe2e8('0x34')]['offset']);}return _0x1b80cb['getAllConditions'](_0x5329f1);}})[_0xe2e8('0x44')](function(_0x4a90eb){if(_0x4a90eb){return _0x4a90eb?{'count':_0xe22a76,'rows':_0x4a90eb}:null;}})[_0xe2e8('0x44')](respondWithResult(_0x3ec02a,null))[_0xe2e8('0x48')](handleError(_0x3ec02a,null));};exports[_0xe2e8('0x5c')]=function(_0x484b19,_0x5a474c,_0x437bab){var _0x58ad50={};var _0x19f75a={};var _0x5e109e;var _0x210fb3;return db[_0xe2e8('0x43')][_0xe2e8('0x5a')]({'where':{'id':_0x484b19[_0xe2e8('0x4a')]['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x5a474c,null))[_0xe2e8('0x44')](function(_0x5d147d){if(_0x5d147d){_0x5e109e=_0x5d147d;_0x19f75a[_0xe2e8('0x33')]=_['keys'](db['Condition'][_0xe2e8('0x30')]);_0x19f75a['query']=_['keys'](_0x484b19['query']);_0x19f75a[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x19f75a[_0xe2e8('0x33')],_0x19f75a[_0xe2e8('0x34')]);_0x58ad50['attributes']=_[_0xe2e8('0x37')](_0x19f75a['model'],qs[_0xe2e8('0x39')](_0x484b19[_0xe2e8('0x34')][_0xe2e8('0x39')]));_0x58ad50[_0xe2e8('0x38')]=_0x58ad50[_0xe2e8('0x38')][_0xe2e8('0x4b')]?_0x58ad50[_0xe2e8('0x38')]:_0x19f75a['model'];_0x58ad50[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x484b19['query']['sort']);_0x58ad50[_0xe2e8('0x3e')]=qs['filters'](_[_0xe2e8('0x3f')](_0x484b19[_0xe2e8('0x34')],_0x19f75a['filters']));if(_0x484b19[_0xe2e8('0x34')]['filter']){_0x58ad50[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x58ad50['where'],{'$or':_['map'](_0x58ad50[_0xe2e8('0x38')],function(_0x584224){var _0x13dd25={};_0x13dd25[_0x584224]={'$like':'%'+_0x484b19[_0xe2e8('0x34')][_0xe2e8('0x40')]+'%'};return _0x13dd25;})});}_0x58ad50=_['merge']({},_0x58ad50,_0x484b19['options']);return _0x5e109e['getAnyConditions'](_0x58ad50);}})['then'](function(_0x3300a0){if(_0x3300a0){_0x210fb3=_0x3300a0[_0xe2e8('0x4b')];if(!_0x484b19['query'][_0xe2e8('0x3a')](_0xe2e8('0x3b'))){_0x58ad50[_0xe2e8('0x20')]=qs['limit'](_0x484b19['query'][_0xe2e8('0x20')]);_0x58ad50[_0xe2e8('0x1e')]=qs[_0xe2e8('0x1e')](_0x484b19[_0xe2e8('0x34')][_0xe2e8('0x1e')]);}return _0x5e109e[_0xe2e8('0x5c')](_0x58ad50);}})[_0xe2e8('0x44')](function(_0x2f07fb){if(_0x2f07fb){return _0x2f07fb?{'count':_0x210fb3,'rows':_0x2f07fb}:null;}})['then'](respondWithResult(_0x5a474c,null))[_0xe2e8('0x48')](handleError(_0x5a474c,null));};exports['addAction']=function(_0x1ca21b,_0x13e89c,_0x5558e0){if(_0x1ca21b[_0xe2e8('0x4e')]['id']){delete _0x1ca21b[_0xe2e8('0x4e')]['id'];}return db[_0xe2e8('0x43')][_0xe2e8('0x4c')]({'where':{'id':_0x1ca21b['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x13e89c,null))[_0xe2e8('0x44')](function(_0x13dcc1){if(_0x13dcc1){_0x1ca21b[_0xe2e8('0x4e')][_0xe2e8('0x5d')]=_0x13dcc1['id'];return db[_0xe2e8('0x5e')][_0xe2e8('0x4d')](_0x1ca21b[_0xe2e8('0x4e')]);}})['then'](respondWithResult(_0x13e89c,null))[_0xe2e8('0x48')](handleError(_0x13e89c,null));};exports[_0xe2e8('0x5f')]=function(_0x492d3f,_0x2b680a,_0x308ae3){var _0x22cb7b={};var _0x3299f4={};var _0x32b54b;var _0x2d5b31;return db[_0xe2e8('0x43')][_0xe2e8('0x5a')]({'where':{'id':_0x492d3f['params']['id']}})[_0xe2e8('0x44')](handleEntityNotFound(_0x2b680a,null))[_0xe2e8('0x44')](function(_0x387366){if(_0x387366){_0x32b54b=_0x387366;_0x3299f4[_0xe2e8('0x33')]=_[_0xe2e8('0x35')](db[_0xe2e8('0x5e')][_0xe2e8('0x30')]);_0x3299f4[_0xe2e8('0x34')]=_[_0xe2e8('0x35')](_0x492d3f[_0xe2e8('0x34')]);_0x3299f4[_0xe2e8('0x36')]=_[_0xe2e8('0x37')](_0x3299f4['model'],_0x3299f4[_0xe2e8('0x34')]);_0x22cb7b[_0xe2e8('0x38')]=_[_0xe2e8('0x37')](_0x3299f4[_0xe2e8('0x33')],qs['fields'](_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x39')]));_0x22cb7b[_0xe2e8('0x38')]=_0x22cb7b[_0xe2e8('0x38')]['length']?_0x22cb7b['attributes']:_0x3299f4[_0xe2e8('0x33')];_0x22cb7b[_0xe2e8('0x3c')]=qs[_0xe2e8('0x3d')](_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x3d')]);_0x22cb7b['where']=qs[_0xe2e8('0x36')](_[_0xe2e8('0x3f')](_0x492d3f[_0xe2e8('0x34')],_0x3299f4['filters']));if(_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x40')]){_0x22cb7b[_0xe2e8('0x3e')]=_[_0xe2e8('0x41')](_0x22cb7b[_0xe2e8('0x3e')],{'$or':_[_0xe2e8('0x2f')](_0x22cb7b[_0xe2e8('0x38')],function(_0xae2b3b){var _0x1bad41={};_0x1bad41[_0xae2b3b]={'$like':'%'+_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x40')]+'%'};return _0x1bad41;})});}_0x22cb7b=_[_0xe2e8('0x41')]({},_0x22cb7b,_0x492d3f[_0xe2e8('0x42')]);return _0x32b54b[_0xe2e8('0x5f')](_0x22cb7b);}})[_0xe2e8('0x44')](function(_0x17b805){if(_0x17b805){_0x2d5b31=_0x17b805[_0xe2e8('0x4b')];if(!_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x3a')]('nolimit')){_0x22cb7b[_0xe2e8('0x20')]=qs[_0xe2e8('0x20')](_0x492d3f[_0xe2e8('0x34')]['limit']);_0x22cb7b['offset']=qs[_0xe2e8('0x1e')](_0x492d3f[_0xe2e8('0x34')][_0xe2e8('0x1e')]);}return _0x32b54b[_0xe2e8('0x5f')](_0x22cb7b);}})[_0xe2e8('0x44')](function(_0x324e6f){if(_0x324e6f){return _0x324e6f?{'count':_0x2d5b31,'rows':_0x324e6f}:null;}})[_0xe2e8('0x44')](respondWithResult(_0x2b680a,null))['catch'](handleError(_0x2b680a,null));};
\ No newline at end of file
+var _0xb35e=['TriggerAnyId','findOne','getAllConditions','getAnyConditions','nolimit','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','addAllCondition','TriggerAllId','Condition','addAnyCondition'];(function(_0x367be6,_0x116c3f){var _0x4330e2=function(_0x3cc46e){while(--_0x3cc46e){_0x367be6['push'](_0x367be6['shift']());}};_0x4330e2(++_0x116c3f);}(_0xb35e,0xcf));var _0xeb35=function(_0x511478,_0x3b0294){_0x511478=_0x511478-0x0;var _0x3aa4f7=_0xb35e[_0x511478];return _0x3aa4f7;};'use strict';var emlformat=require(_0xeb35('0x0'));var rimraf=require(_0xeb35('0x1'));var zipdir=require(_0xeb35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeb35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeb35('0x4'));var util=require(_0xeb35('0x5'));var path=require(_0xeb35('0x6'));var sox=require(_0xeb35('0x7'));var csv=require('to-csv');var ejs=require(_0xeb35('0x8'));var fs=require('fs');var fs_extra=require(_0xeb35('0x9'));var _=require(_0xeb35('0xa'));var squel=require(_0xeb35('0xb'));var crypto=require(_0xeb35('0xc'));var jsforce=require(_0xeb35('0xd'));var deskjs=require(_0xeb35('0xe'));var toCsv=require(_0xeb35('0xf'));var querystring=require(_0xeb35('0x10'));var Papa=require(_0xeb35('0x11'));var Redis=require('ioredis');var authService=require(_0xeb35('0x12'));var qs=require(_0xeb35('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb35('0x14'));var logger=require(_0xeb35('0x15'))(_0xeb35('0x16'));var utils=require(_0xeb35('0x17'));var config=require(_0xeb35('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb35('0x19'))['db'];function respondWithStatusCode(_0x4e7017,_0x511751){_0x511751=_0x511751||0xcc;return function(_0x25ee5e){if(_0x25ee5e){return _0x4e7017[_0xeb35('0x1a')](_0x511751);}return _0x4e7017[_0xeb35('0x1b')](_0x511751)[_0xeb35('0x1c')]();};}function respondWithResult(_0x5da2f7,_0x1166aa){_0x1166aa=_0x1166aa||0xc8;return function(_0x3f8ad8){if(_0x3f8ad8){return _0x5da2f7[_0xeb35('0x1b')](_0x1166aa)[_0xeb35('0x1d')](_0x3f8ad8);}};}function respondWithFilteredResult(_0x42e051,_0xe0f300){return function(_0x4cddf2){if(_0x4cddf2){var _0x1cad1b=typeof _0xe0f300[_0xeb35('0x1e')]===_0xeb35('0x1f')&&typeof _0xe0f300[_0xeb35('0x20')]===_0xeb35('0x1f');var _0x238bdd=_0x4cddf2[_0xeb35('0x21')];var _0x8ad8bb=_0x1cad1b?0x0:_0xe0f300[_0xeb35('0x1e')];var _0x57067a=_0x1cad1b?_0x4cddf2[_0xeb35('0x21')]:_0xe0f300[_0xeb35('0x1e')]+_0xe0f300['limit'];var _0x59ef1a;if(_0x57067a>=_0x238bdd){_0x57067a=_0x238bdd;_0x59ef1a=0xc8;}else{_0x59ef1a=0xce;}_0x42e051[_0xeb35('0x1b')](_0x59ef1a);return _0x42e051[_0xeb35('0x22')](_0xeb35('0x23'),_0x8ad8bb+'-'+_0x57067a+'/'+_0x238bdd)[_0xeb35('0x1d')](_0x4cddf2);}return null;};}function patchUpdates(_0x55a7a3){return function(_0x2b9dfe){try{jsonpatch[_0xeb35('0x24')](_0x2b9dfe,_0x55a7a3,!![]);}catch(_0x59102a){return BPromise[_0xeb35('0x25')](_0x59102a);}return _0x2b9dfe['save']();};}function saveUpdates(_0x30d9d5,_0x397cb1){return function(_0x35aa63){if(_0x35aa63){return _0x35aa63[_0xeb35('0x26')](_0x30d9d5)[_0xeb35('0x27')](function(_0x86774f){return _0x86774f;});}return null;};}function removeEntity(_0x3cdd49,_0x5e9b87){return function(_0x231cb6){if(_0x231cb6){return _0x231cb6[_0xeb35('0x28')]()[_0xeb35('0x27')](function(){var _0x512298=_0x231cb6[_0xeb35('0x29')]({'plain':!![]});var _0x362b85=_0xeb35('0x2a');return db[_0xeb35('0x2b')][_0xeb35('0x28')]({'where':{'type':_0x362b85,'resourceId':_0x512298['id']}})[_0xeb35('0x27')](function(){return _0x231cb6;});})[_0xeb35('0x27')](function(){_0x3cdd49[_0xeb35('0x1b')](0xcc)[_0xeb35('0x1c')]();});}};}function handleEntityNotFound(_0x1f595f,_0x542aad){return function(_0x29ec92){if(!_0x29ec92){_0x1f595f[_0xeb35('0x1a')](0x194);}return _0x29ec92;};}function handleError(_0x46759c,_0x2318a9){_0x2318a9=_0x2318a9||0x1f4;return function(_0x1df682){logger[_0xeb35('0x2c')](_0x1df682[_0xeb35('0x2d')]);if(_0x1df682[_0xeb35('0x2e')]){delete _0x1df682[_0xeb35('0x2e')];}_0x46759c[_0xeb35('0x1b')](_0x2318a9)[_0xeb35('0x2f')](_0x1df682);};}exports[_0xeb35('0x30')]=function(_0x365e96,_0x5a7bb3){var _0x72c273={},_0x2da3df={},_0x39795e={'count':0x0,'rows':[]};var _0x2eda49=_['map'](db[_0xeb35('0x31')][_0xeb35('0x32')],function(_0x3e947c){return{'name':_0x3e947c[_0xeb35('0x33')],'type':_0x3e947c[_0xeb35('0x34')][_0xeb35('0x35')]};});_0x2da3df[_0xeb35('0x36')]=_[_0xeb35('0x37')](_0x2eda49,_0xeb35('0x2e'));_0x2da3df[_0xeb35('0x38')]=_[_0xeb35('0x39')](_0x365e96[_0xeb35('0x38')]);_0x2da3df['filters']=_[_0xeb35('0x3a')](_0x2da3df[_0xeb35('0x36')],_0x2da3df[_0xeb35('0x38')]);_0x72c273[_0xeb35('0x3b')]=_[_0xeb35('0x3a')](_0x2da3df['model'],qs[_0xeb35('0x3c')](_0x365e96[_0xeb35('0x38')][_0xeb35('0x3c')]));_0x72c273[_0xeb35('0x3b')]=_0x72c273['attributes']['length']?_0x72c273['attributes']:_0x2da3df['model'];if(!_0x365e96[_0xeb35('0x38')][_0xeb35('0x3d')]('nolimit')){_0x72c273[_0xeb35('0x20')]=qs[_0xeb35('0x20')](_0x365e96[_0xeb35('0x38')][_0xeb35('0x20')]);_0x72c273[_0xeb35('0x1e')]=qs[_0xeb35('0x1e')](_0x365e96[_0xeb35('0x38')]['offset']);}_0x72c273[_0xeb35('0x3e')]=qs[_0xeb35('0x3f')](_0x365e96[_0xeb35('0x38')][_0xeb35('0x3f')]);_0x72c273[_0xeb35('0x40')]=qs[_0xeb35('0x41')](_[_0xeb35('0x42')](_0x365e96['query'],_0x2da3df[_0xeb35('0x41')]),_0x2eda49);if(_0x365e96[_0xeb35('0x38')][_0xeb35('0x43')]){_0x72c273[_0xeb35('0x40')]=_[_0xeb35('0x44')](_0x72c273[_0xeb35('0x40')],{'$or':_[_0xeb35('0x37')](_0x2eda49,function(_0x5a0b87){if(_0x5a0b87[_0xeb35('0x34')]!=='VIRTUAL'){var _0x407f47={};_0x407f47[_0x5a0b87[_0xeb35('0x2e')]]={'$like':'%'+_0x365e96[_0xeb35('0x38')][_0xeb35('0x43')]+'%'};return _0x407f47;}})});}_0x72c273=_[_0xeb35('0x44')]({},_0x72c273,_0x365e96[_0xeb35('0x45')]);var _0x576d3a={'where':_0x72c273[_0xeb35('0x40')]};return db[_0xeb35('0x31')][_0xeb35('0x21')](_0x576d3a)[_0xeb35('0x27')](function(_0x15f9d0){_0x39795e[_0xeb35('0x21')]=_0x15f9d0;if(_0x365e96[_0xeb35('0x38')][_0xeb35('0x46')]){_0x72c273[_0xeb35('0x47')]=[{'all':!![]}];}return db[_0xeb35('0x31')][_0xeb35('0x48')](_0x72c273);})[_0xeb35('0x27')](function(_0x516831){_0x39795e[_0xeb35('0x49')]=_0x516831;return _0x39795e;})[_0xeb35('0x27')](respondWithFilteredResult(_0x5a7bb3,_0x72c273))[_0xeb35('0x4a')](handleError(_0x5a7bb3,null));};exports[_0xeb35('0x4b')]=function(_0x15ab9b,_0x3690cd){var _0x17944f={'raw':![],'where':{'id':_0x15ab9b[_0xeb35('0x4c')]['id']}},_0x1246ff={};_0x1246ff['model']=_[_0xeb35('0x39')](db['Trigger'][_0xeb35('0x32')]);_0x1246ff[_0xeb35('0x38')]=_[_0xeb35('0x39')](_0x15ab9b[_0xeb35('0x38')]);_0x1246ff['filters']=_[_0xeb35('0x3a')](_0x1246ff[_0xeb35('0x36')],_0x1246ff[_0xeb35('0x38')]);_0x17944f[_0xeb35('0x3b')]=_['intersection'](_0x1246ff[_0xeb35('0x36')],qs[_0xeb35('0x3c')](_0x15ab9b[_0xeb35('0x38')]['fields']));_0x17944f[_0xeb35('0x3b')]=_0x17944f['attributes'][_0xeb35('0x4d')]?_0x17944f[_0xeb35('0x3b')]:_0x1246ff[_0xeb35('0x36')];if(_0x15ab9b[_0xeb35('0x38')][_0xeb35('0x46')]){_0x17944f[_0xeb35('0x47')]=[{'all':!![]}];}_0x17944f=_['merge']({},_0x17944f,_0x15ab9b[_0xeb35('0x45')]);return db[_0xeb35('0x31')][_0xeb35('0x4e')](_0x17944f)[_0xeb35('0x27')](handleEntityNotFound(_0x3690cd,null))[_0xeb35('0x27')](respondWithResult(_0x3690cd,null))['catch'](handleError(_0x3690cd,null));};exports[_0xeb35('0x4f')]=function(_0x2962a3,_0x55faa2){return db['Trigger']['create'](_0x2962a3['body'],{})['then'](function(_0x460fe6){var _0x3c3988=_0x2962a3[_0xeb35('0x50')][_0xeb35('0x29')]({'plain':!![]});if(!_0x3c3988)throw new Error(_0xeb35('0x51'));if(_0x3c3988[_0xeb35('0x52')]===_0xeb35('0x50')){var _0x272c14=_0x460fe6['get']({'plain':!![]});var _0x149ecf=_0xeb35('0x2a');return db[_0xeb35('0x53')][_0xeb35('0x4e')]({'where':{'name':_0x149ecf,'userProfileId':_0x3c3988['userProfileId']},'raw':!![]})[_0xeb35('0x27')](function(_0x441eb2){if(_0x441eb2&&_0x441eb2[_0xeb35('0x54')]===0x0){return db[_0xeb35('0x2b')][_0xeb35('0x4f')]({'name':_0x272c14[_0xeb35('0x2e')],'resourceId':_0x272c14['id'],'type':_0x441eb2['name'],'sectionId':_0x441eb2['id']},{})[_0xeb35('0x27')](function(){return _0x460fe6;});}else{return _0x460fe6;}})[_0xeb35('0x4a')](function(_0x207e36){logger[_0xeb35('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x207e36);throw _0x207e36;});}return _0x460fe6;})['then'](respondWithResult(_0x55faa2,0xc9))[_0xeb35('0x4a')](handleError(_0x55faa2,null));};exports[_0xeb35('0x26')]=function(_0x2aa523,_0x198171){if(_0x2aa523['body']['id']){delete _0x2aa523[_0xeb35('0x55')]['id'];}return db[_0xeb35('0x31')][_0xeb35('0x4e')]({'where':{'id':_0x2aa523[_0xeb35('0x4c')]['id']}})[_0xeb35('0x27')](handleEntityNotFound(_0x198171,null))[_0xeb35('0x27')](saveUpdates(_0x2aa523[_0xeb35('0x55')],null))[_0xeb35('0x27')](respondWithResult(_0x198171,null))[_0xeb35('0x4a')](handleError(_0x198171,null));};exports['destroy']=function(_0x293275,_0x32d706){return db[_0xeb35('0x31')][_0xeb35('0x4e')]({'where':{'id':_0x293275[_0xeb35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32d706,null))[_0xeb35('0x27')](removeEntity(_0x32d706,null))[_0xeb35('0x4a')](handleError(_0x32d706,null));};exports[_0xeb35('0x56')]=function(_0xcbd61e,_0x33b30d,_0x4402e3){if(_0xcbd61e['body']['id']){delete _0xcbd61e[_0xeb35('0x55')]['id'];}return db[_0xeb35('0x31')][_0xeb35('0x4e')]({'where':{'id':_0xcbd61e[_0xeb35('0x4c')]['id']}})[_0xeb35('0x27')](handleEntityNotFound(_0x33b30d,null))[_0xeb35('0x27')](function(_0x373d63){if(_0x373d63){_0xcbd61e[_0xeb35('0x55')][_0xeb35('0x57')]=_0x373d63['id'];return db[_0xeb35('0x58')][_0xeb35('0x4f')](_0xcbd61e[_0xeb35('0x55')]);}})['then'](respondWithResult(_0x33b30d,null))[_0xeb35('0x4a')](handleError(_0x33b30d,null));};exports[_0xeb35('0x59')]=function(_0x5acbd5,_0x4ed621,_0x4e80e5){if(_0x5acbd5[_0xeb35('0x55')]['id']){delete _0x5acbd5[_0xeb35('0x55')]['id'];}return db[_0xeb35('0x31')]['find']({'where':{'id':_0x5acbd5[_0xeb35('0x4c')]['id']}})[_0xeb35('0x27')](handleEntityNotFound(_0x4ed621,null))[_0xeb35('0x27')](function(_0x105b8e){if(_0x105b8e){_0x5acbd5[_0xeb35('0x55')][_0xeb35('0x5a')]=_0x105b8e['id'];return db[_0xeb35('0x58')][_0xeb35('0x4f')](_0x5acbd5[_0xeb35('0x55')]);}})[_0xeb35('0x27')](respondWithResult(_0x4ed621,null))[_0xeb35('0x4a')](handleError(_0x4ed621,null));};exports['getAllConditions']=function(_0x592133,_0x4cba7d,_0x479430){var _0x241324={};var _0x30004a={};var _0x3d84e6;var _0x5374ed;return db[_0xeb35('0x31')][_0xeb35('0x5b')]({'where':{'id':_0x592133['params']['id']}})[_0xeb35('0x27')](handleEntityNotFound(_0x4cba7d,null))[_0xeb35('0x27')](function(_0x3ba5e2){if(_0x3ba5e2){_0x3d84e6=_0x3ba5e2;_0x30004a[_0xeb35('0x36')]=_[_0xeb35('0x39')](db[_0xeb35('0x58')][_0xeb35('0x32')]);_0x30004a['query']=_['keys'](_0x592133[_0xeb35('0x38')]);_0x30004a['filters']=_[_0xeb35('0x3a')](_0x30004a[_0xeb35('0x36')],_0x30004a[_0xeb35('0x38')]);_0x241324['attributes']=_[_0xeb35('0x3a')](_0x30004a[_0xeb35('0x36')],qs[_0xeb35('0x3c')](_0x592133[_0xeb35('0x38')]['fields']));_0x241324[_0xeb35('0x3b')]=_0x241324[_0xeb35('0x3b')][_0xeb35('0x4d')]?_0x241324[_0xeb35('0x3b')]:_0x30004a[_0xeb35('0x36')];_0x241324[_0xeb35('0x3e')]=qs[_0xeb35('0x3f')](_0x592133['query']['sort']);_0x241324[_0xeb35('0x40')]=qs['filters'](_[_0xeb35('0x42')](_0x592133[_0xeb35('0x38')],_0x30004a[_0xeb35('0x41')]));if(_0x592133[_0xeb35('0x38')][_0xeb35('0x43')]){_0x241324[_0xeb35('0x40')]=_['merge'](_0x241324[_0xeb35('0x40')],{'$or':_[_0xeb35('0x37')](_0x241324[_0xeb35('0x3b')],function(_0xdfe520){var _0x5e2662={};_0x5e2662[_0xdfe520]={'$like':'%'+_0x592133['query'][_0xeb35('0x43')]+'%'};return _0x5e2662;})});}_0x241324=_[_0xeb35('0x44')]({},_0x241324,_0x592133[_0xeb35('0x45')]);return _0x3d84e6['getAllConditions'](_0x241324);}})[_0xeb35('0x27')](function(_0x59e1e6){if(_0x59e1e6){_0x5374ed=_0x59e1e6['length'];if(!_0x592133['query']['hasOwnProperty']('nolimit')){_0x241324[_0xeb35('0x20')]=qs[_0xeb35('0x20')](_0x592133[_0xeb35('0x38')][_0xeb35('0x20')]);_0x241324['offset']=qs[_0xeb35('0x1e')](_0x592133[_0xeb35('0x38')][_0xeb35('0x1e')]);}return _0x3d84e6[_0xeb35('0x5c')](_0x241324);}})[_0xeb35('0x27')](function(_0x10db79){if(_0x10db79){return _0x10db79?{'count':_0x5374ed,'rows':_0x10db79}:null;}})[_0xeb35('0x27')](respondWithResult(_0x4cba7d,null))[_0xeb35('0x4a')](handleError(_0x4cba7d,null));};exports[_0xeb35('0x5d')]=function(_0x7acb2e,_0x51e9eb,_0x49ffb4){var _0x2570da={};var _0x6b131b={};var _0x67933a;var _0x5c9fd7;return db[_0xeb35('0x31')][_0xeb35('0x5b')]({'where':{'id':_0x7acb2e[_0xeb35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51e9eb,null))[_0xeb35('0x27')](function(_0xa064cb){if(_0xa064cb){_0x67933a=_0xa064cb;_0x6b131b[_0xeb35('0x36')]=_[_0xeb35('0x39')](db[_0xeb35('0x58')][_0xeb35('0x32')]);_0x6b131b[_0xeb35('0x38')]=_['keys'](_0x7acb2e[_0xeb35('0x38')]);_0x6b131b[_0xeb35('0x41')]=_[_0xeb35('0x3a')](_0x6b131b['model'],_0x6b131b['query']);_0x2570da[_0xeb35('0x3b')]=_[_0xeb35('0x3a')](_0x6b131b[_0xeb35('0x36')],qs[_0xeb35('0x3c')](_0x7acb2e[_0xeb35('0x38')][_0xeb35('0x3c')]));_0x2570da[_0xeb35('0x3b')]=_0x2570da[_0xeb35('0x3b')][_0xeb35('0x4d')]?_0x2570da[_0xeb35('0x3b')]:_0x6b131b[_0xeb35('0x36')];_0x2570da[_0xeb35('0x3e')]=qs[_0xeb35('0x3f')](_0x7acb2e[_0xeb35('0x38')][_0xeb35('0x3f')]);_0x2570da[_0xeb35('0x40')]=qs[_0xeb35('0x41')](_[_0xeb35('0x42')](_0x7acb2e[_0xeb35('0x38')],_0x6b131b['filters']));if(_0x7acb2e[_0xeb35('0x38')][_0xeb35('0x43')]){_0x2570da[_0xeb35('0x40')]=_['merge'](_0x2570da[_0xeb35('0x40')],{'$or':_[_0xeb35('0x37')](_0x2570da[_0xeb35('0x3b')],function(_0x9df058){var _0x10636b={};_0x10636b[_0x9df058]={'$like':'%'+_0x7acb2e[_0xeb35('0x38')]['filter']+'%'};return _0x10636b;})});}_0x2570da=_['merge']({},_0x2570da,_0x7acb2e['options']);return _0x67933a[_0xeb35('0x5d')](_0x2570da);}})[_0xeb35('0x27')](function(_0x599723){if(_0x599723){_0x5c9fd7=_0x599723[_0xeb35('0x4d')];if(!_0x7acb2e[_0xeb35('0x38')][_0xeb35('0x3d')](_0xeb35('0x5e'))){_0x2570da['limit']=qs[_0xeb35('0x20')](_0x7acb2e[_0xeb35('0x38')][_0xeb35('0x20')]);_0x2570da[_0xeb35('0x1e')]=qs[_0xeb35('0x1e')](_0x7acb2e['query'][_0xeb35('0x1e')]);}return _0x67933a[_0xeb35('0x5d')](_0x2570da);}})[_0xeb35('0x27')](function(_0x4ab7cd){if(_0x4ab7cd){return _0x4ab7cd?{'count':_0x5c9fd7,'rows':_0x4ab7cd}:null;}})[_0xeb35('0x27')](respondWithResult(_0x51e9eb,null))['catch'](handleError(_0x51e9eb,null));};exports[_0xeb35('0x5f')]=function(_0x524926,_0x57ff9b,_0x36db53){if(_0x524926['body']['id']){delete _0x524926[_0xeb35('0x55')]['id'];}return db[_0xeb35('0x31')][_0xeb35('0x4e')]({'where':{'id':_0x524926['params']['id']}})['then'](handleEntityNotFound(_0x57ff9b,null))['then'](function(_0x57cc13){if(_0x57cc13){_0x524926['body'][_0xeb35('0x60')]=_0x57cc13['id'];return db[_0xeb35('0x61')]['create'](_0x524926[_0xeb35('0x55')]);}})[_0xeb35('0x27')](respondWithResult(_0x57ff9b,null))[_0xeb35('0x4a')](handleError(_0x57ff9b,null));};exports['getActions']=function(_0xccf8cf,_0x8afe7a,_0x3ae30e){var _0x4abe19={};var _0xa6fe61={};var _0xe1208a;var _0x467cde;return db[_0xeb35('0x31')]['findOne']({'where':{'id':_0xccf8cf['params']['id']}})[_0xeb35('0x27')](handleEntityNotFound(_0x8afe7a,null))[_0xeb35('0x27')](function(_0x346205){if(_0x346205){_0xe1208a=_0x346205;_0xa6fe61['model']=_[_0xeb35('0x39')](db[_0xeb35('0x61')][_0xeb35('0x32')]);_0xa6fe61[_0xeb35('0x38')]=_[_0xeb35('0x39')](_0xccf8cf[_0xeb35('0x38')]);_0xa6fe61[_0xeb35('0x41')]=_[_0xeb35('0x3a')](_0xa6fe61[_0xeb35('0x36')],_0xa6fe61[_0xeb35('0x38')]);_0x4abe19[_0xeb35('0x3b')]=_[_0xeb35('0x3a')](_0xa6fe61['model'],qs[_0xeb35('0x3c')](_0xccf8cf[_0xeb35('0x38')][_0xeb35('0x3c')]));_0x4abe19[_0xeb35('0x3b')]=_0x4abe19['attributes'][_0xeb35('0x4d')]?_0x4abe19[_0xeb35('0x3b')]:_0xa6fe61[_0xeb35('0x36')];_0x4abe19[_0xeb35('0x3e')]=qs[_0xeb35('0x3f')](_0xccf8cf[_0xeb35('0x38')][_0xeb35('0x3f')]);_0x4abe19['where']=qs['filters'](_[_0xeb35('0x42')](_0xccf8cf[_0xeb35('0x38')],_0xa6fe61[_0xeb35('0x41')]));if(_0xccf8cf[_0xeb35('0x38')][_0xeb35('0x43')]){_0x4abe19[_0xeb35('0x40')]=_[_0xeb35('0x44')](_0x4abe19['where'],{'$or':_[_0xeb35('0x37')](_0x4abe19[_0xeb35('0x3b')],function(_0x42cd4e){var _0x26b4e3={};_0x26b4e3[_0x42cd4e]={'$like':'%'+_0xccf8cf['query'][_0xeb35('0x43')]+'%'};return _0x26b4e3;})});}_0x4abe19=_['merge']({},_0x4abe19,_0xccf8cf[_0xeb35('0x45')]);return _0xe1208a[_0xeb35('0x62')](_0x4abe19);}})[_0xeb35('0x27')](function(_0x1099dc){if(_0x1099dc){_0x467cde=_0x1099dc[_0xeb35('0x4d')];if(!_0xccf8cf[_0xeb35('0x38')][_0xeb35('0x3d')]('nolimit')){_0x4abe19[_0xeb35('0x20')]=qs['limit'](_0xccf8cf[_0xeb35('0x38')][_0xeb35('0x20')]);_0x4abe19[_0xeb35('0x1e')]=qs[_0xeb35('0x1e')](_0xccf8cf[_0xeb35('0x38')]['offset']);}return _0xe1208a[_0xeb35('0x62')](_0x4abe19);}})['then'](function(_0xaf94c2){if(_0xaf94c2){return _0xaf94c2?{'count':_0x467cde,'rows':_0xaf94c2}:null;}})[_0xeb35('0x27')](respondWithResult(_0x8afe7a,null))['catch'](handleError(_0x8afe7a,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb18=['../../config/environment','./trigger.attributes','exports','define','tools_triggers','../../config/logger','moment','request-promise','path','rimraf'];(function(_0xb4f9be,_0x17e944){var _0x1c550c=function(_0x1707b8){while(--_0x1707b8){_0xb4f9be['push'](_0xb4f9be['shift']());}};_0x1c550c(++_0x17e944);}(_0xcb18,0x159));var _0x8cb1=function(_0x1c2cd9,_0x308877){_0x1c2cd9=_0x1c2cd9-0x0;var _0x32aab9=_0xcb18[_0x1c2cd9];return _0x32aab9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8cb1('0x0'))('api');var moment=require(_0x8cb1('0x1'));var BPromise=require('bluebird');var rp=require(_0x8cb1('0x2'));var fs=require('fs');var path=require(_0x8cb1('0x3'));var rimraf=require(_0x8cb1('0x4'));var config=require(_0x8cb1('0x5'));var attributes=require(_0x8cb1('0x6'));module[_0x8cb1('0x7')]=function(_0x503927,_0x355d91){return _0x503927[_0x8cb1('0x8')]('Trigger',attributes,{'tableName':_0x8cb1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x303a=['bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','../../config/logger','api','moment'];(function(_0x5ae9f3,_0x4ae3d6){var _0xd94e11=function(_0x82562f){while(--_0x82562f){_0x5ae9f3['push'](_0x5ae9f3['shift']());}};_0xd94e11(++_0x4ae3d6);}(_0x303a,0x1a0));var _0xa303=function(_0x32bf8b,_0x2ac32b){_0x32bf8b=_0x32bf8b-0x0;var _0x1e5ef5=_0x303a[_0x32bf8b];return _0x1e5ef5;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1099=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map','include','model','ShowTrigger'];(function(_0x127f59,_0xd73cb0){var _0x332601=function(_0x3f0ec2){while(--_0x3f0ec2){_0x127f59['push'](_0x127f59['shift']());}};_0x332601(++_0xd73cb0);}(_0x1099,0x168));var _0x9109=function(_0x28591e,_0x40983b){_0x28591e=_0x28591e-0x0;var _0x3017e3=_0x1099[_0x28591e];return _0x3017e3;};'use strict';var _=require(_0x9109('0x0'));var util=require(_0x9109('0x1'));var moment=require('moment');var BPromise=require(_0x9109('0x2'));var rs=require(_0x9109('0x3'));var fs=require('fs');var Redis=require(_0x9109('0x4'));var db=require(_0x9109('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9109('0x6'))(_0x9109('0x7'));var config=require(_0x9109('0x8'));var jayson=require(_0x9109('0x9'));var client=jayson['client'][_0x9109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ba0bf,_0x4bb98e,_0x28ab02){return new BPromise(function(_0x3599f9,_0x338e31){return client[_0x9109('0xb')](_0x5ba0bf,_0x28ab02)[_0x9109('0xc')](function(_0x2add91){logger[_0x9109('0xd')]('Trigger,\x20%s,\x20%s',_0x4bb98e,_0x9109('0xe'));logger[_0x9109('0xf')](_0x9109('0x10'),_0x4bb98e,_0x9109('0xe'),JSON[_0x9109('0x11')](_0x2add91));if(_0x2add91['error']){if(_0x2add91[_0x9109('0x12')][_0x9109('0x13')]===0x1f4){logger[_0x9109('0x12')]('Trigger,\x20%s,\x20%s',_0x4bb98e,_0x2add91[_0x9109('0x12')][_0x9109('0x14')]);return _0x338e31(_0x2add91[_0x9109('0x12')][_0x9109('0x14')]);}logger[_0x9109('0x12')](_0x9109('0x15'),_0x4bb98e,_0x2add91[_0x9109('0x12')]['message']);return _0x3599f9(_0x2add91[_0x9109('0x12')][_0x9109('0x14')]);}else{logger[_0x9109('0xd')](_0x9109('0x15'),_0x4bb98e,'request\x20sent');_0x3599f9(_0x2add91[_0x9109('0x16')][_0x9109('0x14')]);}})[_0x9109('0x17')](function(_0x4c7c16){logger[_0x9109('0x12')](_0x9109('0x15'),_0x4bb98e,_0x4c7c16);_0x338e31(_0x4c7c16);});});}exports[_0x9109('0x18')]=function(_0x502d2a){var _0x54875f=this;return new Promise(function(_0x5dd25b,_0x1ebccf){return db[_0x9109('0x19')][_0x9109('0x1a')]({'raw':_0x502d2a['options']?_0x502d2a[_0x9109('0x1b')][_0x9109('0x1c')]===undefined?!![]:![]:!![],'where':_0x502d2a[_0x9109('0x1b')]?_0x502d2a[_0x9109('0x1b')][_0x9109('0x1d')]||null:null,'attributes':_0x502d2a[_0x9109('0x1b')]?_0x502d2a['options'][_0x9109('0x1e')]||null:null,'limit':_0x502d2a[_0x9109('0x1b')]?_0x502d2a[_0x9109('0x1b')][_0x9109('0x1f')]||null:null,'include':_0x502d2a[_0x9109('0x1b')]?_0x502d2a[_0x9109('0x1b')]['include']?_[_0x9109('0x20')](_0x502d2a[_0x9109('0x1b')][_0x9109('0x21')],function(_0xc810be){return{'model':db[_0xc810be[_0x9109('0x22')]],'as':_0xc810be['as'],'attributes':_0xc810be[_0x9109('0x1e')],'include':_0xc810be[_0x9109('0x21')]?_[_0x9109('0x20')](_0xc810be[_0x9109('0x21')],function(_0x2f0767){return{'model':db[_0x2f0767[_0x9109('0x22')]],'as':_0x2f0767['as'],'attributes':_0x2f0767[_0x9109('0x1e')],'include':_0x2f0767[_0x9109('0x21')]?_[_0x9109('0x20')](_0x2f0767['include'],function(_0x4ba84e){return{'model':db[_0x4ba84e[_0x9109('0x22')]],'as':_0x4ba84e['as'],'attributes':_0x4ba84e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9109('0xc')](function(_0x489fb9){logger[_0x9109('0xd')](_0x9109('0x18'),_0x502d2a);logger['debug'](_0x9109('0x18'),_0x502d2a,JSON['stringify'](_0x489fb9));_0x5dd25b(_0x489fb9);})[_0x9109('0x17')](function(_0x459701){logger[_0x9109('0x12')](_0x9109('0x18'),_0x459701[_0x9109('0x14')],_0x502d2a);_0x1ebccf(_0x54875f['error'](0x1f4,_0x459701[_0x9109('0x14')]));});});};exports[_0x9109('0x23')]=function(_0x24329f){var _0x298e9b=this;return new Promise(function(_0x4a76ea,_0x1c85cd){return db['Trigger']['find']({'raw':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x1c')]===undefined?!![]:![]:!![],'where':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x1d')]||null:null,'attributes':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x1e')]||null:null,'include':_0x24329f[_0x9109('0x1b')]?_0x24329f[_0x9109('0x1b')][_0x9109('0x21')]?_['map'](_0x24329f[_0x9109('0x1b')][_0x9109('0x21')],function(_0x16a583){return{'model':db[_0x16a583[_0x9109('0x22')]],'as':_0x16a583['as'],'attributes':_0x16a583[_0x9109('0x1e')],'include':_0x16a583['include']?_[_0x9109('0x20')](_0x16a583[_0x9109('0x21')],function(_0x4e6f0c){return{'model':db[_0x4e6f0c[_0x9109('0x22')]],'as':_0x4e6f0c['as'],'attributes':_0x4e6f0c[_0x9109('0x1e')],'include':_0x4e6f0c['include']?_['map'](_0x4e6f0c[_0x9109('0x21')],function(_0x38d231){return{'model':db[_0x38d231[_0x9109('0x22')]],'as':_0x38d231['as'],'attributes':_0x38d231[_0x9109('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4664dd){logger['info'](_0x9109('0x23'),_0x24329f);logger[_0x9109('0xf')](_0x9109('0x23'),_0x24329f,JSON[_0x9109('0x11')](_0x4664dd));_0x4a76ea(_0x4664dd);})[_0x9109('0x17')](function(_0x46f026){logger[_0x9109('0x12')](_0x9109('0x23'),_0x46f026['message'],_0x24329f);_0x1c85cd(_0x298e9b[_0x9109('0x12')](0x1f4,_0x46f026['message']));});});};
\ No newline at end of file
+var _0x4c58=['rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','code','message','error','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','find','ShowTrigger','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21b80e,_0x48f23a){var _0x115301=function(_0x53a0d4){while(--_0x53a0d4){_0x21b80e['push'](_0x21b80e['shift']());}};_0x115301(++_0x48f23a);}(_0x4c58,0x18f));var _0x84c5=function(_0x3497b1,_0x4c7aaf){_0x3497b1=_0x3497b1-0x0;var _0x3e8af5=_0x4c58[_0x3497b1];return _0x3e8af5;};'use strict';var _=require(_0x84c5('0x0'));var util=require(_0x84c5('0x1'));var moment=require(_0x84c5('0x2'));var BPromise=require(_0x84c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84c5('0x4'));var db=require(_0x84c5('0x5'))['db'];var utils=require(_0x84c5('0x6'));var logger=require(_0x84c5('0x7'))(_0x84c5('0x8'));var config=require(_0x84c5('0x9'));var jayson=require(_0x84c5('0xa'));var client=jayson[_0x84c5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eba35,_0x2bfbc7,_0x1dee32){return new BPromise(function(_0x187b1d,_0x358c72){return client[_0x84c5('0xc')](_0x4eba35,_0x1dee32)[_0x84c5('0xd')](function(_0x56868e){logger[_0x84c5('0xe')](_0x84c5('0xf'),_0x2bfbc7,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x2bfbc7,_0x84c5('0x10'),JSON['stringify'](_0x56868e));if(_0x56868e['error']){if(_0x56868e['error'][_0x84c5('0x11')]===0x1f4){logger['error'](_0x84c5('0xf'),_0x2bfbc7,_0x56868e['error'][_0x84c5('0x12')]);return _0x358c72(_0x56868e[_0x84c5('0x13')]['message']);}logger[_0x84c5('0x13')]('Trigger,\x20%s,\x20%s',_0x2bfbc7,_0x56868e[_0x84c5('0x13')][_0x84c5('0x12')]);return _0x187b1d(_0x56868e[_0x84c5('0x13')][_0x84c5('0x12')]);}else{logger[_0x84c5('0xe')]('Trigger,\x20%s,\x20%s',_0x2bfbc7,_0x84c5('0x10'));_0x187b1d(_0x56868e[_0x84c5('0x14')][_0x84c5('0x12')]);}})['catch'](function(_0x5e2b95){logger[_0x84c5('0x13')](_0x84c5('0xf'),_0x2bfbc7,_0x5e2b95);_0x358c72(_0x5e2b95);});});}exports[_0x84c5('0x15')]=function(_0x21480a){var _0x2d3147=this;return new Promise(function(_0x41c5e9,_0x4e913a){return db[_0x84c5('0x16')][_0x84c5('0x17')]({'raw':_0x21480a[_0x84c5('0x18')]?_0x21480a[_0x84c5('0x18')][_0x84c5('0x19')]===undefined?!![]:![]:!![],'where':_0x21480a['options']?_0x21480a[_0x84c5('0x18')][_0x84c5('0x1a')]||null:null,'attributes':_0x21480a[_0x84c5('0x18')]?_0x21480a[_0x84c5('0x18')][_0x84c5('0x1b')]||null:null,'limit':_0x21480a[_0x84c5('0x18')]?_0x21480a[_0x84c5('0x18')][_0x84c5('0x1c')]||null:null,'include':_0x21480a['options']?_0x21480a['options'][_0x84c5('0x1d')]?_[_0x84c5('0x1e')](_0x21480a[_0x84c5('0x18')][_0x84c5('0x1d')],function(_0x31c2e2){return{'model':db[_0x31c2e2['model']],'as':_0x31c2e2['as'],'attributes':_0x31c2e2['attributes'],'include':_0x31c2e2['include']?_[_0x84c5('0x1e')](_0x31c2e2[_0x84c5('0x1d')],function(_0x37f1f6){return{'model':db[_0x37f1f6['model']],'as':_0x37f1f6['as'],'attributes':_0x37f1f6['attributes'],'include':_0x37f1f6['include']?_[_0x84c5('0x1e')](_0x37f1f6[_0x84c5('0x1d')],function(_0x556d37){return{'model':db[_0x556d37[_0x84c5('0x1f')]],'as':_0x556d37['as'],'attributes':_0x556d37[_0x84c5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84c5('0xd')](function(_0x7161ba){logger[_0x84c5('0xe')](_0x84c5('0x15'),_0x21480a);logger[_0x84c5('0x20')](_0x84c5('0x15'),_0x21480a,JSON[_0x84c5('0x21')](_0x7161ba));_0x41c5e9(_0x7161ba);})[_0x84c5('0x22')](function(_0x4a206e){logger[_0x84c5('0x13')](_0x84c5('0x15'),_0x4a206e[_0x84c5('0x12')],_0x21480a);_0x4e913a(_0x2d3147[_0x84c5('0x13')](0x1f4,_0x4a206e[_0x84c5('0x12')]));});});};exports['ShowTrigger']=function(_0xf32dc2){var _0x2a7633=this;return new Promise(function(_0x2ca85e,_0x16e877){return db[_0x84c5('0x16')][_0x84c5('0x23')]({'raw':_0xf32dc2['options']?_0xf32dc2[_0x84c5('0x18')][_0x84c5('0x19')]===undefined?!![]:![]:!![],'where':_0xf32dc2['options']?_0xf32dc2[_0x84c5('0x18')]['where']||null:null,'attributes':_0xf32dc2[_0x84c5('0x18')]?_0xf32dc2[_0x84c5('0x18')][_0x84c5('0x1b')]||null:null,'include':_0xf32dc2[_0x84c5('0x18')]?_0xf32dc2[_0x84c5('0x18')][_0x84c5('0x1d')]?_['map'](_0xf32dc2[_0x84c5('0x18')][_0x84c5('0x1d')],function(_0x9f7512){return{'model':db[_0x9f7512[_0x84c5('0x1f')]],'as':_0x9f7512['as'],'attributes':_0x9f7512[_0x84c5('0x1b')],'include':_0x9f7512['include']?_[_0x84c5('0x1e')](_0x9f7512[_0x84c5('0x1d')],function(_0x48a952){return{'model':db[_0x48a952[_0x84c5('0x1f')]],'as':_0x48a952['as'],'attributes':_0x48a952[_0x84c5('0x1b')],'include':_0x48a952[_0x84c5('0x1d')]?_[_0x84c5('0x1e')](_0x48a952[_0x84c5('0x1d')],function(_0x187fe7){return{'model':db[_0x187fe7[_0x84c5('0x1f')]],'as':_0x187fe7['as'],'attributes':_0x187fe7[_0x84c5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ad9bf){logger[_0x84c5('0xe')](_0x84c5('0x24'),_0xf32dc2);logger[_0x84c5('0x20')]('ShowTrigger',_0xf32dc2,JSON[_0x84c5('0x21')](_0x2ad9bf));_0x2ca85e(_0x2ad9bf);})[_0x84c5('0x22')](function(_0x6de5de){logger['error'](_0x84c5('0x24'),_0x6de5de[_0x84c5('0x12')],_0xf32dc2);_0x16e877(_0x2a7633['error'](0x1f4,_0x6de5de[_0x84c5('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2c8=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c8,0x117));var _0x8f2c=function(_0x30b893,_0x39de2c){_0x30b893=_0x30b893-0x0;var _0x4b8747=_0xf2c8[_0x30b893];return _0x4b8747;};'use strict';var multer=require('multer');var util=require(_0x8f2c('0x0'));var path=require(_0x8f2c('0x1'));var timeout=require(_0x8f2c('0x2'));var express=require(_0x8f2c('0x3'));var router=express['Router']();var fs_extra=require(_0x8f2c('0x4'));var auth=require(_0x8f2c('0x5'));var interaction=require(_0x8f2c('0x6'));var config=require(_0x8f2c('0x7'));var controller=require(_0x8f2c('0x8'));router[_0x8f2c('0x9')]('/',auth[_0x8f2c('0xa')](),controller[_0x8f2c('0xb')]);router[_0x8f2c('0x9')](_0x8f2c('0xc'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0xd')]);router[_0x8f2c('0xe')](_0x8f2c('0xf'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x10')]);router['post']('/',auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x11')]);router[_0x8f2c('0x12')](_0x8f2c('0xc'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x13')]);router[_0x8f2c('0x14')](_0x8f2c('0xc'),auth[_0x8f2c('0xa')](),controller[_0x8f2c('0x15')]);module[_0x8f2c('0x16')]=router;
\ No newline at end of file
+var _0x867e=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','show','post','put','update','/:id','destroy','exports','multer','util'];(function(_0x3676fc,_0x369252){var _0x305fa1=function(_0x21b996){while(--_0x21b996){_0x3676fc['push'](_0x3676fc['shift']());}};_0x305fa1(++_0x369252);}(_0x867e,0x86));var _0xe867=function(_0x400669,_0x5b14a5){_0x400669=_0x400669-0x0;var _0x1eab31=_0x867e[_0x400669];return _0x1eab31;};'use strict';var multer=require(_0xe867('0x0'));var util=require(_0xe867('0x1'));var path=require(_0xe867('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe867('0x3')]();var fs_extra=require(_0xe867('0x4'));var auth=require(_0xe867('0x5'));var interaction=require(_0xe867('0x6'));var config=require('../../config/environment');var controller=require(_0xe867('0x7'));router[_0xe867('0x8')]('/',auth[_0xe867('0x9')](),controller['index']);router[_0xe867('0x8')]('/:id',auth[_0xe867('0x9')](),controller[_0xe867('0xa')]);router['post']('/:id/clone',auth[_0xe867('0x9')](),controller['clone']);router[_0xe867('0xb')]('/',auth[_0xe867('0x9')](),controller['create']);router[_0xe867('0xc')]('/:id',auth[_0xe867('0x9')](),controller[_0xe867('0xd')]);router['delete'](_0xe867('0xe'),auth[_0xe867('0x9')](),controller[_0xe867('0xf')]);module[_0xe867('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe986=['allow','ulaw;alaw;gsm','split','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x523a60,_0x98c8de){var _0x5b6cd8=function(_0x2f6709){while(--_0x2f6709){_0x523a60['push'](_0x523a60['shift']());}};_0x5b6cd8(++_0x98c8de);}(_0xe986,0x184));var _0x6e98=function(_0x274360,_0x16159d){_0x274360=_0x274360-0x0;var _0x403653=_0xe986[_0x274360];return _0x403653;};'use strict';var Sequelize=require(_0x6e98('0x0'));module[_0x6e98('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x3'),'user',_0x6e98('0x4')),'allowNull':![],'defaultValue':_0x6e98('0x3')},'context':{'type':Sequelize[_0x6e98('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x6e98('0x2')]('ALLOWED_NOT_SCREENED',_0x6e98('0x6'),_0x6e98('0x7'),_0x6e98('0x8'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x6e98('0x9'),'PROHIB')},'deny':{'type':Sequelize[_0x6e98('0x5')]},'permit':{'type':Sequelize[_0x6e98('0x5')]},'secret':{'type':Sequelize[_0x6e98('0x5')]},'md5secret':{'type':Sequelize[_0x6e98('0x5')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x6e98('0xa'),'set':function(_0x14965a){this[_0x6e98('0xb')]('transport',_0x14965a?_0x14965a[_0x6e98('0xc')](','):null);},'get':function(){return this[_0x6e98('0xd')](_0x6e98('0xe'))?this[_0x6e98('0xd')]('transport')['split'](','):null;},'comment':_0x6e98('0xf')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x6e98('0x10'),_0x6e98('0x11'),_0x6e98('0x12')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no',_0x6e98('0x14'),_0x6e98('0x15'),_0x6e98('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e98('0x5')]},'directmediadeny':{'type':Sequelize[_0x6e98('0x5')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x6e98('0x17'),'set':function(_0x1e2d4b){this[_0x6e98('0xb')](_0x6e98('0x18'),_0x1e2d4b?_0x1e2d4b[_0x6e98('0xc')](','):null);},'get':function(){return this[_0x6e98('0xd')](_0x6e98('0x18'))?this[_0x6e98('0xd')]('nat')['split'](','):null;},'comment':_0x6e98('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x6e98('0x5')]},'pickupgroup':{'type':Sequelize[_0x6e98('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x6e98('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x6e98('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x45272e){this[_0x6e98('0xb')](_0x6e98('0x1a'),_0x45272e?_0x45272e[_0x6e98('0xc')](';'):_0x6e98('0x1b'));},'get':function(){return this['getDataValue'](_0x6e98('0x1a'))?this['getDataValue'](_0x6e98('0x1a'))[_0x6e98('0x1c')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'insecure':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':_0x6e98('0x1d'),'set':function(_0xf8a879){this['setDataValue'](_0x6e98('0x1e'),_0xf8a879?_0xf8a879['join'](','):null);},'get':function(){return this['getDataValue'](_0x6e98('0x1e'))?this[_0x6e98('0xd')](_0x6e98('0x1e'))['split'](','):null;},'comment':_0x6e98('0x1f')},'trustrpid':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e98('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e98('0x2')]('yes','no',_0x6e98('0x20'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x6e98('0x5')]},'callerid':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':_0x6e98('0x21')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x6e98('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x6e98('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x6e98('0x2')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e98('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'mailbox':{'type':Sequelize[_0x6e98('0x5')]},'session_timers':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x23'),_0x6e98('0x24'),_0x6e98('0x25'))},'session_expires':{'type':Sequelize[_0x6e98('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x6e98('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x26'),_0x6e98('0x27')),'defaultValue':_0x6e98('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x6e98('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x6e98('0x5')]},'fromuser':{'type':Sequelize[_0x6e98('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x6e98('0x5')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6e98('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6e98('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e98('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x6e98('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6e98('0x22')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x6e98('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x6e98('0x5')]},'use_q850_reason':{'type':Sequelize[_0x6e98('0x5')]},'maxforwards':{'type':Sequelize[_0x6e98('0x22')](0xb)},'encryption':{'type':Sequelize[_0x6e98('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'force_avp':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'icesupport':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no',_0x6e98('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x6e98('0x22')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x6e98('0x5')]},'dtlscipher':{'type':Sequelize[_0x6e98('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x6e98('0x5')]},'dtlssetup':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x29'),_0x6e98('0x2a'),_0x6e98('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e98('0x5')]},'usereqphone':{'type':Sequelize[_0x6e98('0x2')](_0x6e98('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e98('0x5')]},'recordofffeature':{'type':Sequelize[_0x6e98('0x5')]},'call_limit':{'type':Sequelize[_0x6e98('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x6e98('0x13'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x6e98('0x5')]},'mohinterpret':{'type':Sequelize[_0x6e98('0x5')]},'mohsuggest':{'type':Sequelize[_0x6e98('0x5')]},'parkinglot':{'type':Sequelize[_0x6e98('0x5')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x6e98('0x13'),'no',_0x6e98('0x14'),'update',_0x6e98('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6e98('0x5')]},'otherFields':{'type':Sequelize[_0x6e98('0x5')]},'active':{'type':Sequelize[_0x6e98('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6e98('0x5')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xcfe7=['active','passive','dynamic','sequelize','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate'];(function(_0x3cd996,_0x14c8db){var _0x55b154=function(_0x4a4ea2){while(--_0x4a4ea2){_0x3cd996['push'](_0x3cd996['shift']());}};_0x55b154(++_0x14c8db);}(_0xcfe7,0xcf));var _0x7cfe=function(_0x2c54d3,_0x45886e){_0x2c54d3=_0x2c54d3-0x0;var _0x357f30=_0xcfe7[_0x2c54d3];return _0x357f30;};'use strict';var Sequelize=require(_0x7cfe('0x0'));module[_0x7cfe('0x1')]={'name':{'type':Sequelize[_0x7cfe('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x4'),_0x7cfe('0x5'),_0x7cfe('0x6')),'allowNull':![],'defaultValue':_0x7cfe('0x4')},'context':{'type':Sequelize[_0x7cfe('0x2')],'allowNull':![],'defaultValue':_0x7cfe('0x7')},'callingpres':{'type':Sequelize[_0x7cfe('0x3')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x7cfe('0x8'),_0x7cfe('0x9'),_0x7cfe('0xa'),_0x7cfe('0xb'),_0x7cfe('0xc'))},'deny':{'type':Sequelize[_0x7cfe('0x2')]},'permit':{'type':Sequelize[_0x7cfe('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x7cfe('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7cfe('0x2')],'defaultValue':_0x7cfe('0xd'),'set':function(_0x5c2951){this[_0x7cfe('0xe')]('transport',_0x5c2951?_0x5c2951[_0x7cfe('0xf')](','):null);},'get':function(){return this[_0x7cfe('0x10')](_0x7cfe('0x11'))?this['getDataValue'](_0x7cfe('0x11'))[_0x7cfe('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x13'),_0x7cfe('0x14'),_0x7cfe('0x15'),_0x7cfe('0x16'),_0x7cfe('0x17')),'defaultValue':_0x7cfe('0x13')},'directmedia':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no',_0x7cfe('0x19'),_0x7cfe('0x1a'),_0x7cfe('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7cfe('0x2')]},'directmediadeny':{'type':Sequelize[_0x7cfe('0x2')]},'nat':{'type':Sequelize[_0x7cfe('0x2')],'defaultValue':_0x7cfe('0x1c'),'set':function(_0x56c514){this[_0x7cfe('0xe')](_0x7cfe('0x1d'),_0x56c514?_0x56c514[_0x7cfe('0xf')](','):null);},'get':function(){return this[_0x7cfe('0x10')]('nat')?this[_0x7cfe('0x10')]('nat')[_0x7cfe('0x12')](','):null;},'comment':_0x7cfe('0x1e')},'callgroup':{'type':Sequelize[_0x7cfe('0x2')]},'namedcallgroup':{'type':Sequelize[_0x7cfe('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x7cfe('0x2')]},'language':{'type':Sequelize[_0x7cfe('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7cfe('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x7cfe('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x22ae93){this['setDataValue'](_0x7cfe('0x1f'),_0x22ae93?_0x22ae93[_0x7cfe('0xf')](';'):_0x7cfe('0x20'));},'get':function(){return this[_0x7cfe('0x10')](_0x7cfe('0x1f'))?this[_0x7cfe('0x10')](_0x7cfe('0x1f'))[_0x7cfe('0x12')](';'):null;},'comment':_0x7cfe('0x21')},'autoframing':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x7cfe('0x22'),'set':function(_0x397a87){this[_0x7cfe('0xe')](_0x7cfe('0x23'),_0x397a87?_0x397a87[_0x7cfe('0xf')](','):null);},'get':function(){return this[_0x7cfe('0x10')](_0x7cfe('0x23'))?this[_0x7cfe('0x10')](_0x7cfe('0x23'))[_0x7cfe('0x12')](','):null;},'comment':_0x7cfe('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0x7cfe('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x7cfe('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no',_0x7cfe('0x25'))},'promiscredir':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'accountcode':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'setvar':{'type':Sequelize[_0x7cfe('0x2')]},'callerid':{'type':Sequelize[_0x7cfe('0x2')],'defaultValue':_0x7cfe('0x27')},'amaflags':{'type':Sequelize[_0x7cfe('0x2')]},'callcounter':{'type':Sequelize[_0x7cfe('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x7cfe('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x7cfe('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x7cfe('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no',_0x7cfe('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'mailbox':{'type':Sequelize[_0x7cfe('0x2')]},'session_timers':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x29'),_0x7cfe('0x2a'),_0x7cfe('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x2c'),_0x7cfe('0x2d')),'defaultValue':_0x7cfe('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x7cfe('0x2')]},'regexten':{'type':Sequelize[_0x7cfe('0x2')]},'fromdomain':{'type':Sequelize[_0x7cfe('0x2')]},'fromuser':{'type':Sequelize[_0x7cfe('0x2')]},'port':{'type':Sequelize[_0x7cfe('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x7cfe('0x18')},'keepalive':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x7cfe('0x2')]},'defaultuser':{'type':Sequelize[_0x7cfe('0x2')]},'rtptimeout':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x7cfe('0x3')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7cfe('0x2')]},'callbackextension':{'type':Sequelize[_0x7cfe('0x2')]},'timert1':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x7cfe('0x2')]},'contactdeny':{'type':Sequelize[_0x7cfe('0x2')]},'contactacl':{'type':Sequelize[_0x7cfe('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x7cfe('0x2')]},'use_q850_reason':{'type':Sequelize[_0x7cfe('0x2')]},'maxforwards':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'encryption':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x7cfe('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x7cfe('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no',_0x7cfe('0x2e'),_0x7cfe('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x7cfe('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7cfe('0x2')]},'dtlscipher':{'type':Sequelize[_0x7cfe('0x2')]},'dtlscafile':{'type':Sequelize[_0x7cfe('0x2')]},'dtlscapath':{'type':Sequelize[_0x7cfe('0x2')]},'dtlssetup':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x30'),_0x7cfe('0x31'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7cfe('0x2')]},'usereqphone':{'type':Sequelize[_0x7cfe('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7cfe('0x2')]},'recordofffeature':{'type':Sequelize[_0x7cfe('0x2')]},'call_limit':{'type':Sequelize[_0x7cfe('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7cfe('0x3')](_0x7cfe('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x7cfe('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x7cfe('0x2')]},'mohsuggest':{'type':Sequelize[_0x7cfe('0x2')]},'parkinglot':{'type':Sequelize[_0x7cfe('0x2')]},'description':{'type':Sequelize[_0x7cfe('0x2')]},'host':{'type':Sequelize[_0x7cfe('0x2')],'defaultValue':_0x7cfe('0x32')},'canreinvite':{'type':Sequelize[_0x7cfe('0x3')]('yes','no',_0x7cfe('0x19'),_0x7cfe('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7cfe('0x2')]},'otherFields':{'type':Sequelize[_0x7cfe('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7cfe('0x2')],'defaultValue':'no'}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));};
\ No newline at end of file
+var _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x448f62,_0x90c848){var _0x397908=function(_0x1d2a32){while(--_0x1d2a32){_0x448f62['push'](_0x448f62['shift']());}};_0x397908(++_0x90c848);}(_0x6aa7,0x178));var _0x76aa=function(_0x1ad20e,_0x335b78){_0x1ad20e=_0x1ad20e-0x0;var _0x2c6954=_0x6aa7[_0x1ad20e];return _0x2c6954;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ffb=['path','rimraf','../../config/environment','./trunk.attributes','exports','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x7c6894,_0x411905){var _0x5431d3=function(_0x9d9b12){while(--_0x9d9b12){_0x7c6894['push'](_0x7c6894['shift']());}};_0x5431d3(++_0x411905);}(_0x8ffb,0x18c));var _0xb8ff=function(_0x908598,_0x4dc0c4){_0x908598=_0x908598-0x0;var _0x202e00=_0x8ffb[_0x908598];return _0x202e00;};'use strict';var _=require(_0xb8ff('0x0'));var util=require(_0xb8ff('0x1'));var logger=require(_0xb8ff('0x2'))(_0xb8ff('0x3'));var moment=require(_0xb8ff('0x4'));var BPromise=require(_0xb8ff('0x5'));var rp=require(_0xb8ff('0x6'));var fs=require('fs');var path=require(_0xb8ff('0x7'));var rimraf=require(_0xb8ff('0x8'));var config=require(_0xb8ff('0x9'));var attributes=require(_0xb8ff('0xa'));module[_0xb8ff('0xb')]=function(_0x1b9500,_0x4ac956){return _0x1b9500['define']('Trunk',attributes,{'tableName':_0xb8ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9d2=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x357f0a,_0x37aa60){var _0x10d41b=function(_0x3ef2e1){while(--_0x3ef2e1){_0x357f0a['push'](_0x357f0a['shift']());}};_0x10d41b(++_0x37aa60);}(_0xa9d2,0x172));var _0x2a9d=function(_0x1c689f,_0x5a8283){_0x1c689f=_0x1c689f-0x0;var _0x1567db=_0xa9d2[_0x1c689f];return _0x1567db;};'use strict';var _=require(_0x2a9d('0x0'));var util=require(_0x2a9d('0x1'));var logger=require('../../config/logger')(_0x2a9d('0x2'));var moment=require(_0x2a9d('0x3'));var BPromise=require(_0x2a9d('0x4'));var rp=require(_0x2a9d('0x5'));var fs=require('fs');var path=require(_0x2a9d('0x6'));var rimraf=require('rimraf');var config=require(_0x2a9d('0x7'));var attributes=require(_0x2a9d('0x8'));module[_0x2a9d('0x9')]=function(_0x23551b,_0x5b6c25){return _0x23551b[_0x2a9d('0xa')](_0x2a9d('0xb'),attributes,{'tableName':_0x2a9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbde1=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','catch','ShowTrunk','find'];(function(_0x990749,_0x325cbd){var _0x43de5a=function(_0x48b8c0){while(--_0x48b8c0){_0x990749['push'](_0x990749['shift']());}};_0x43de5a(++_0x325cbd);}(_0xbde1,0x6f));var _0x1bde=function(_0x3a8c32,_0x4b025b){_0x3a8c32=_0x3a8c32-0x0;var _0x2119f0=_0xbde1[_0x3a8c32];return _0x2119f0;};'use strict';var _=require('lodash');var util=require(_0x1bde('0x0'));var moment=require(_0x1bde('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bde('0x2'));var db=require(_0x1bde('0x3'))['db'];var utils=require(_0x1bde('0x4'));var logger=require(_0x1bde('0x5'))(_0x1bde('0x6'));var config=require(_0x1bde('0x7'));var jayson=require(_0x1bde('0x8'));var client=jayson[_0x1bde('0x9')][_0x1bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47eb1b,_0x4b1cef,_0x50f779){return new BPromise(function(_0x3ef4ff,_0x8ca13d){return client[_0x1bde('0xb')](_0x47eb1b,_0x50f779)[_0x1bde('0xc')](function(_0x23d38b){logger['info'](_0x1bde('0xd'),_0x4b1cef,_0x1bde('0xe'));logger['debug'](_0x1bde('0xf'),_0x4b1cef,'request\x20sent',JSON[_0x1bde('0x10')](_0x23d38b));if(_0x23d38b[_0x1bde('0x11')]){if(_0x23d38b[_0x1bde('0x11')][_0x1bde('0x12')]===0x1f4){logger[_0x1bde('0x11')](_0x1bde('0xd'),_0x4b1cef,_0x23d38b[_0x1bde('0x11')][_0x1bde('0x13')]);return _0x8ca13d(_0x23d38b[_0x1bde('0x11')][_0x1bde('0x13')]);}logger[_0x1bde('0x11')](_0x1bde('0xd'),_0x4b1cef,_0x23d38b[_0x1bde('0x11')]['message']);return _0x3ef4ff(_0x23d38b[_0x1bde('0x11')]['message']);}else{logger['info'](_0x1bde('0xd'),_0x4b1cef,_0x1bde('0xe'));_0x3ef4ff(_0x23d38b[_0x1bde('0x14')]['message']);}})['catch'](function(_0x169f82){logger[_0x1bde('0x11')](_0x1bde('0xd'),_0x4b1cef,_0x169f82);_0x8ca13d(_0x169f82);});});}exports[_0x1bde('0x15')]=function(_0x34ce31){var _0x324073=this;return new Promise(function(_0x1fadaf,_0x328031){return db[_0x1bde('0x16')][_0x1bde('0x17')]({'raw':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x19')]===undefined?!![]:![]:!![],'where':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1a')]||null:null,'attributes':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1b')]||null:null,'limit':_0x34ce31[_0x1bde('0x18')]?_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1c')]||null:null,'include':_0x34ce31['options']?_0x34ce31['options'][_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x34ce31[_0x1bde('0x18')][_0x1bde('0x1d')],function(_0x4198aa){return{'model':db[_0x4198aa['model']],'as':_0x4198aa['as'],'attributes':_0x4198aa[_0x1bde('0x1b')],'include':_0x4198aa[_0x1bde('0x1d')]?_['map'](_0x4198aa[_0x1bde('0x1d')],function(_0x160ffc){return{'model':db[_0x160ffc['model']],'as':_0x160ffc['as'],'attributes':_0x160ffc[_0x1bde('0x1b')],'include':_0x160ffc[_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x160ffc[_0x1bde('0x1d')],function(_0x525d5e){return{'model':db[_0x525d5e[_0x1bde('0x1f')]],'as':_0x525d5e['as'],'attributes':_0x525d5e[_0x1bde('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1bde('0xc')](function(_0x5744d9){logger[_0x1bde('0x20')](_0x1bde('0x15'),_0x34ce31);logger[_0x1bde('0x21')](_0x1bde('0x15'),_0x34ce31,JSON['stringify'](_0x5744d9));_0x1fadaf(_0x5744d9);})[_0x1bde('0x22')](function(_0x3bb6e1){logger[_0x1bde('0x11')](_0x1bde('0x15'),_0x3bb6e1[_0x1bde('0x13')],_0x34ce31);_0x328031(_0x324073[_0x1bde('0x11')](0x1f4,_0x3bb6e1[_0x1bde('0x13')]));});});};exports[_0x1bde('0x23')]=function(_0x477612){var _0x904cfe=this;return new Promise(function(_0x54962f,_0x34c6f7){return db[_0x1bde('0x16')][_0x1bde('0x24')]({'raw':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')][_0x1bde('0x1a')]||null:null,'attributes':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')][_0x1bde('0x1b')]||null:null,'include':_0x477612[_0x1bde('0x18')]?_0x477612[_0x1bde('0x18')][_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x477612[_0x1bde('0x18')]['include'],function(_0x352a85){return{'model':db[_0x352a85[_0x1bde('0x1f')]],'as':_0x352a85['as'],'attributes':_0x352a85['attributes'],'include':_0x352a85['include']?_['map'](_0x352a85[_0x1bde('0x1d')],function(_0x486f53){return{'model':db[_0x486f53['model']],'as':_0x486f53['as'],'attributes':_0x486f53[_0x1bde('0x1b')],'include':_0x486f53[_0x1bde('0x1d')]?_[_0x1bde('0x1e')](_0x486f53['include'],function(_0x4f4a0b){return{'model':db[_0x4f4a0b[_0x1bde('0x1f')]],'as':_0x4f4a0b['as'],'attributes':_0x4f4a0b[_0x1bde('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1bde('0xc')](function(_0x237006){logger[_0x1bde('0x20')]('ShowTrunk',_0x477612);logger['debug'](_0x1bde('0x23'),_0x477612,JSON[_0x1bde('0x10')](_0x237006));_0x54962f(_0x237006);})['catch'](function(_0x1e94ad){logger[_0x1bde('0x11')](_0x1bde('0x23'),_0x1e94ad[_0x1bde('0x13')],_0x477612);_0x34c6f7(_0x904cfe[_0x1bde('0x11')](0x1f4,_0x1e94ad['message']));});});};
\ No newline at end of file
+var _0xcdd4=['attributes','ShowTrunk','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','info','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','where','limit','include','map','model'];(function(_0x4752c6,_0x2b4c2d){var _0x5cd324=function(_0x5c1d7c){while(--_0x5c1d7c){_0x4752c6['push'](_0x4752c6['shift']());}};_0x5cd324(++_0x2b4c2d);}(_0xcdd4,0xee));var _0x4cdd=function(_0x5d2b14,_0x1f47b8){_0x5d2b14=_0x5d2b14-0x0;var _0x2a7c36=_0xcdd4[_0x5d2b14];return _0x2a7c36;};'use strict';var _=require('lodash');var util=require(_0x4cdd('0x0'));var moment=require(_0x4cdd('0x1'));var BPromise=require(_0x4cdd('0x2'));var rs=require(_0x4cdd('0x3'));var fs=require('fs');var Redis=require(_0x4cdd('0x4'));var db=require(_0x4cdd('0x5'))['db'];var utils=require(_0x4cdd('0x6'));var logger=require(_0x4cdd('0x7'))(_0x4cdd('0x8'));var config=require(_0x4cdd('0x9'));var jayson=require(_0x4cdd('0xa'));var client=jayson[_0x4cdd('0xb')][_0x4cdd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c4a81,_0x11dcbf,_0x1cb735){return new BPromise(function(_0xbf400,_0x43540b){return client[_0x4cdd('0xd')](_0x2c4a81,_0x1cb735)[_0x4cdd('0xe')](function(_0x39d338){logger['info']('Trunk,\x20%s,\x20%s',_0x11dcbf,'request\x20sent');logger[_0x4cdd('0xf')](_0x4cdd('0x10'),_0x11dcbf,'request\x20sent',JSON[_0x4cdd('0x11')](_0x39d338));if(_0x39d338[_0x4cdd('0x12')]){if(_0x39d338['error'][_0x4cdd('0x13')]===0x1f4){logger[_0x4cdd('0x12')]('Trunk,\x20%s,\x20%s',_0x11dcbf,_0x39d338[_0x4cdd('0x12')]['message']);return _0x43540b(_0x39d338[_0x4cdd('0x12')][_0x4cdd('0x14')]);}logger[_0x4cdd('0x12')](_0x4cdd('0x15'),_0x11dcbf,_0x39d338[_0x4cdd('0x12')][_0x4cdd('0x14')]);return _0xbf400(_0x39d338[_0x4cdd('0x12')]['message']);}else{logger[_0x4cdd('0x16')]('Trunk,\x20%s,\x20%s',_0x11dcbf,_0x4cdd('0x17'));_0xbf400(_0x39d338[_0x4cdd('0x18')][_0x4cdd('0x14')]);}})[_0x4cdd('0x19')](function(_0x39fd69){logger['error'](_0x4cdd('0x15'),_0x11dcbf,_0x39fd69);_0x43540b(_0x39fd69);});});}exports[_0x4cdd('0x1a')]=function(_0x2faccc){var _0x4fdbf7=this;return new Promise(function(_0x5c93af,_0x1866ed){return db[_0x4cdd('0x1b')][_0x4cdd('0x1c')]({'raw':_0x2faccc['options']?_0x2faccc[_0x4cdd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2faccc[_0x4cdd('0x1d')]?_0x2faccc['options'][_0x4cdd('0x1e')]||null:null,'attributes':_0x2faccc['options']?_0x2faccc[_0x4cdd('0x1d')]['attributes']||null:null,'limit':_0x2faccc['options']?_0x2faccc[_0x4cdd('0x1d')][_0x4cdd('0x1f')]||null:null,'include':_0x2faccc[_0x4cdd('0x1d')]?_0x2faccc['options'][_0x4cdd('0x20')]?_[_0x4cdd('0x21')](_0x2faccc[_0x4cdd('0x1d')]['include'],function(_0xca498f){return{'model':db[_0xca498f[_0x4cdd('0x22')]],'as':_0xca498f['as'],'attributes':_0xca498f[_0x4cdd('0x23')],'include':_0xca498f['include']?_[_0x4cdd('0x21')](_0xca498f[_0x4cdd('0x20')],function(_0x7e6400){return{'model':db[_0x7e6400['model']],'as':_0x7e6400['as'],'attributes':_0x7e6400[_0x4cdd('0x23')],'include':_0x7e6400['include']?_['map'](_0x7e6400[_0x4cdd('0x20')],function(_0x2f1ce2){return{'model':db[_0x2f1ce2[_0x4cdd('0x22')]],'as':_0x2f1ce2['as'],'attributes':_0x2f1ce2[_0x4cdd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4cdd('0xe')](function(_0x48a628){logger[_0x4cdd('0x16')](_0x4cdd('0x1a'),_0x2faccc);logger[_0x4cdd('0xf')]('GetTrunk',_0x2faccc,JSON[_0x4cdd('0x11')](_0x48a628));_0x5c93af(_0x48a628);})[_0x4cdd('0x19')](function(_0x43e14f){logger[_0x4cdd('0x12')](_0x4cdd('0x1a'),_0x43e14f['message'],_0x2faccc);_0x1866ed(_0x4fdbf7[_0x4cdd('0x12')](0x1f4,_0x43e14f[_0x4cdd('0x14')]));});});};exports[_0x4cdd('0x24')]=function(_0x51944e){var _0x15c66b=this;return new Promise(function(_0x3dce06,_0x36ab2b){return db[_0x4cdd('0x1b')][_0x4cdd('0x25')]({'raw':_0x51944e[_0x4cdd('0x1d')]?_0x51944e['options'][_0x4cdd('0x26')]===undefined?!![]:![]:!![],'where':_0x51944e[_0x4cdd('0x1d')]?_0x51944e[_0x4cdd('0x1d')][_0x4cdd('0x1e')]||null:null,'attributes':_0x51944e[_0x4cdd('0x1d')]?_0x51944e[_0x4cdd('0x1d')][_0x4cdd('0x23')]||null:null,'include':_0x51944e[_0x4cdd('0x1d')]?_0x51944e['options'][_0x4cdd('0x20')]?_[_0x4cdd('0x21')](_0x51944e['options']['include'],function(_0x568dcd){return{'model':db[_0x568dcd[_0x4cdd('0x22')]],'as':_0x568dcd['as'],'attributes':_0x568dcd[_0x4cdd('0x23')],'include':_0x568dcd[_0x4cdd('0x20')]?_['map'](_0x568dcd[_0x4cdd('0x20')],function(_0x1b8a24){return{'model':db[_0x1b8a24['model']],'as':_0x1b8a24['as'],'attributes':_0x1b8a24[_0x4cdd('0x23')],'include':_0x1b8a24[_0x4cdd('0x20')]?_['map'](_0x1b8a24['include'],function(_0x46af04){return{'model':db[_0x46af04['model']],'as':_0x46af04['as'],'attributes':_0x46af04[_0x4cdd('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f1454){logger[_0x4cdd('0x16')](_0x4cdd('0x24'),_0x51944e);logger[_0x4cdd('0xf')]('ShowTrunk',_0x51944e,JSON[_0x4cdd('0x11')](_0x1f1454));_0x3dce06(_0x1f1454);})['catch'](function(_0x520377){logger[_0x4cdd('0x12')](_0x4cdd('0x24'),_0x520377[_0x4cdd('0x14')],_0x51944e);_0x36ab2b(_0x15c66b[_0x4cdd('0x12')](0x1f4,_0x520377['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4dc=['express','Router','put','update'];(function(_0xe9fc75,_0x301b64){var _0x482b79=function(_0x842fc6){while(--_0x842fc6){_0xe9fc75['push'](_0xe9fc75['shift']());}};_0x482b79(++_0x301b64);}(_0xd4dc,0x194));var _0xcd4d=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xd4dc[_0x39e84d];return _0x1991bc;};'use strict';var express=require(_0xcd4d('0x0'));var router=express[_0xcd4d('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0xcd4d('0x2')]('/:id',auth['isAuthenticated'](),controller[_0xcd4d('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0xe60b=['Router','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express'];(function(_0x1c5cd2,_0x277ceb){var _0x895e35=function(_0x4b4307){while(--_0x4b4307){_0x1c5cd2['push'](_0x1c5cd2['shift']());}};_0x895e35(++_0x277ceb);}(_0xe60b,0xc7));var _0xbe60=function(_0x15aacd,_0x3c7f45){_0x15aacd=_0x15aacd-0x0;var _0x435448=_0xe60b[_0x15aacd];return _0x435448;};'use strict';var express=require(_0xbe60('0x0'));var router=express[_0xbe60('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbe60('0x2'));router[_0xbe60('0x3')](_0xbe60('0x4'),auth[_0xbe60('0x5')](),controller[_0xbe60('0x6')]);module[_0xbe60('0x7')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ff4=['exports','ENUM','DATE','INTEGER','UserId','error','warning','debug'];(function(_0x513297,_0x251087){var _0x1bca1f=function(_0x560ab0){while(--_0x560ab0){_0x513297['push'](_0x513297['shift']());}};_0x1bca1f(++_0x251087);}(_0x2ff4,0x65));var _0x42ff=function(_0x4ce260,_0x2a5e2d){_0x4ce260=_0x4ce260-0x0;var _0x110812=_0x2ff4[_0x4ce260];return _0x110812;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x42ff('0x0'),_0x42ff('0x1'),'info',_0x42ff('0x2')];module[_0x42ff('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x42ff('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x42ff('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x42ff('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x42ff('0x6')],'unique':_0x42ff('0x7')}};
\ No newline at end of file
+var _0xa170=['error','warning','debug','exports','ENUM','BOOLEAN','DATE','UserId','sequelize'];(function(_0x21d75c,_0x3b59d4){var _0x4919dd=function(_0x1de230){while(--_0x1de230){_0x21d75c['push'](_0x21d75c['shift']());}};_0x4919dd(++_0x3b59d4);}(_0xa170,0x15e));var _0x0a17=function(_0x5049ba,_0x51a9e7){_0x5049ba=_0x5049ba-0x0;var _0x2f5bcf=_0xa170[_0x5049ba];return _0x2f5bcf;};'use strict';var Sequelize=require(_0x0a17('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a17('0x1'),_0x0a17('0x2'),'info',_0x0a17('0x3')];module[_0x0a17('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x0a17('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a17('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a17('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a17('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x0a17('0x8')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce9b=['body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','json','update','then','sendStatus','error','stack','name','status','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xce9b,0xc6));var _0xbce9=function(_0x54f96d,_0x237631){_0x54f96d=_0x54f96d-0x0;var _0x587bfb=_0xce9b[_0x54f96d];return _0x587bfb;};'use strict';var _=require(_0xbce9('0x0'));var Redis=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var config=require(_0xbce9('0x4'));var db=require(_0xbce9('0x5'))['db'];var socket=require(_0xbce9('0x6'))(new Redis(config[_0xbce9('0x7')]));require('./user-setting.socket')[_0xbce9('0x8')](socket);config[_0xbce9('0x7')]=_[_0xbce9('0x9')](config[_0xbce9('0x7')],{'host':_0xbce9('0xa'),'port':0x18eb});function respondWithResult(_0x2c336a,_0x10a645){_0x10a645=_0x10a645||0xc8;return function(_0x562634){if(_0x562634){return _0x2c336a['status'](_0x10a645)[_0xbce9('0xb')](_0x562634);}};}function saveUpdates(_0x1d9a99){return function(_0x5a5542){if(_0x5a5542){return _0x5a5542[_0xbce9('0xc')](_0x1d9a99)[_0xbce9('0xd')](function(_0x572128){return _0x572128;});}return null;};}function handleEntityNotFound(_0x5b766a){return function(_0x2073ea){if(!_0x2073ea){_0x5b766a[_0xbce9('0xe')](0x194);}return _0x2073ea;};}function handleError(_0x1b980c,_0x4dc9a9){_0x4dc9a9=_0x4dc9a9||0x1f4;return function(_0x48a272){logger[_0xbce9('0xf')](_0x48a272[_0xbce9('0x10')]);if(_0x48a272[_0xbce9('0x11')]){delete _0x48a272[_0xbce9('0x11')];}_0x1b980c[_0xbce9('0x12')](_0x4dc9a9)[_0xbce9('0x13')](_0x48a272);};}exports[_0xbce9('0xc')]=function(_0x540886,_0xa6903c){if(_0x540886[_0xbce9('0x14')]['role']!==_0xbce9('0x15'))throw new Error(_0xbce9('0x16'));if(isNaN(Number(_0x540886[_0xbce9('0x17')]['id'])))throw new Error(_0xbce9('0x18'));return db[_0xbce9('0x19')]['find']({'where':{'id':_0x540886[_0xbce9('0x17')]['id']}})[_0xbce9('0xd')](handleEntityNotFound(_0xa6903c,null))[_0xbce9('0xd')](saveUpdates(_0x540886[_0xbce9('0x1a')],null))[_0xbce9('0xd')](respondWithResult(_0xa6903c,null))[_0xbce9('0x1b')](handleError(_0xa6903c,null));};
\ No newline at end of file
+var _0x2750=['find','then','body','lodash','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','json','sendStatus','stack','name','update','user','role','admin','params','Invalid\x20user\x20setting\x20id'];(function(_0xc6583e,_0x3e854a){var _0x11f67e=function(_0x7b32db){while(--_0x7b32db){_0xc6583e['push'](_0xc6583e['shift']());}};_0x11f67e(++_0x3e854a);}(_0x2750,0x13b));var _0x0275=function(_0x3dadc8,_0x288aa8){_0x3dadc8=_0x3dadc8-0x0;var _0x196366=_0x2750[_0x3dadc8];return _0x196366;};'use strict';var _=require(_0x0275('0x0'));var Redis=require('ioredis');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var config=require(_0x0275('0x3'));var db=require(_0x0275('0x4'))['db'];var socket=require(_0x0275('0x5'))(new Redis(config[_0x0275('0x6')]));require(_0x0275('0x7'))[_0x0275('0x8')](socket);config[_0x0275('0x6')]=_[_0x0275('0x9')](config['redis'],{'host':_0x0275('0xa'),'port':0x18eb});function respondWithResult(_0x2421fd,_0x2fa0eb){_0x2fa0eb=_0x2fa0eb||0xc8;return function(_0x2e4b5c){if(_0x2e4b5c){return _0x2421fd['status'](_0x2fa0eb)[_0x0275('0xb')](_0x2e4b5c);}};}function saveUpdates(_0x30632d){return function(_0x42ae73){if(_0x42ae73){return _0x42ae73['update'](_0x30632d)['then'](function(_0x224e0f){return _0x224e0f;});}return null;};}function handleEntityNotFound(_0x565377){return function(_0x26fa6b){if(!_0x26fa6b){_0x565377[_0x0275('0xc')](0x194);}return _0x26fa6b;};}function handleError(_0x14f68c,_0x41e828){_0x41e828=_0x41e828||0x1f4;return function(_0x14bc3e){logger['error'](_0x14bc3e[_0x0275('0xd')]);if(_0x14bc3e[_0x0275('0xe')]){delete _0x14bc3e[_0x0275('0xe')];}_0x14f68c['status'](_0x41e828)['send'](_0x14bc3e);};}exports[_0x0275('0xf')]=function(_0x395398,_0x37f809){if(_0x395398[_0x0275('0x10')][_0x0275('0x11')]!==_0x0275('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x395398[_0x0275('0x13')]['id'])))throw new Error(_0x0275('0x14'));return db['UserSetting'][_0x0275('0x15')]({'where':{'id':_0x395398[_0x0275('0x13')]['id']}})['then'](handleEntityNotFound(_0x37f809,null))[_0x0275('0x16')](saveUpdates(_0x395398[_0x0275('0x17')],null))['then'](respondWithResult(_0x37f809,null))['catch'](handleError(_0x37f809,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29d2=['hasOwnProperty','hook','events','UserSetting','setMaxListeners','update','remove','emit'];(function(_0x6e0ac3,_0xb0ad99){var _0x381be3=function(_0x1358a3){while(--_0x1358a3){_0x6e0ac3['push'](_0x6e0ac3['shift']());}};_0x381be3(++_0xb0ad99);}(_0x29d2,0xb2));var _0x229d=function(_0x2de2f8,_0x371b7d){_0x2de2f8=_0x2de2f8-0x0;var _0x535508=_0x29d2[_0x2de2f8];return _0x535508;};'use strict';var EventEmitter=require(_0x229d('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x229d('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x229d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x229d('0x3'),'afterDestroy':_0x229d('0x4')};function emitEvent(_0x2561e4){return function(_0x27a55a,_0x517b5f,_0x3f7549){UserSettingEvents[_0x229d('0x5')](_0x2561e4+':'+_0x27a55a['id'],_0x27a55a);UserSettingEvents[_0x229d('0x5')](_0x2561e4,_0x27a55a);_0x3f7549(null);};}for(var e in events){if(events[_0x229d('0x6')](e)){var event=events[e];UserSetting[_0x229d('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents;
\ No newline at end of file
+var _0xc5f4=['hasOwnProperty','hook','exports','../../mysqldb','UserSetting','save','update','emit'];(function(_0x1bbe6c,_0x56d18a){var _0x76ab07=function(_0x220f14){while(--_0x220f14){_0x1bbe6c['push'](_0x1bbe6c['shift']());}};_0x76ab07(++_0x56d18a);}(_0xc5f4,0x6b));var _0x4c5f=function(_0x1002e5,_0xa6c45b){_0x1002e5=_0x1002e5-0x0;var _0x1d65b1=_0xc5f4[_0x1002e5];return _0x1d65b1;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x4c5f('0x0'))['db'][_0x4c5f('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c5f('0x2'),'afterUpdate':_0x4c5f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x494215){return function(_0x205e9b,_0x4bd904,_0x3ec3c8){UserSettingEvents[_0x4c5f('0x4')](_0x494215+':'+_0x205e9b['id'],_0x205e9b);UserSettingEvents[_0x4c5f('0x4')](_0x494215,_0x205e9b);_0x3ec3c8(null);};}for(var e in events){if(events[_0x4c5f('0x5')](e)){var event=events[e];UserSetting[_0x4c5f('0x6')](e,emitEvent(event));}}module[_0x4c5f('0x7')]=UserSettingEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ea9=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x10b95d,_0x1fd349){var _0x174cde=function(_0xebfe08){while(--_0xebfe08){_0x10b95d['push'](_0x10b95d['shift']());}};_0x174cde(++_0x1fd349);}(_0x6ea9,0x89));var _0x96ea=function(_0x59cb38,_0x55c699){_0x59cb38=_0x59cb38-0x0;var _0x2d2e07=_0x6ea9[_0x59cb38];return _0x2d2e07;};'use strict';var attributes=require(_0x96ea('0x0'));module[_0x96ea('0x1')]=function(_0x27c316){return _0x27c316[_0x96ea('0x2')](_0x96ea('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fb6c1){if(!_0x1fb6c1[_0x96ea('0x4')])_0x1fb6c1[_0x96ea('0x5')]=null;else if(_0x1fb6c1['clientSideLoggingEnabledSince']===null)_0x1fb6c1[_0x96ea('0x5')]=new Date();}}});};
\ No newline at end of file
+var _0x2f3a=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x189915,_0x21d4e3){var _0xa063c7=function(_0x202b87){while(--_0x202b87){_0x189915['push'](_0x189915['shift']());}};_0xa063c7(++_0x21d4e3);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x14d028,_0x91bae8){_0x14d028=_0x14d028-0x0;var _0x330394=_0x2f3a[_0x14d028];return _0x330394;};'use strict';var attributes=require(_0xa2f3('0x0'));module['exports']=function(_0x4ce90c){return _0x4ce90c[_0xa2f3('0x1')](_0xa2f3('0x2'),attributes,{'tableName':_0xa2f3('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b064c){if(!_0x2b064c[_0xa2f3('0x4')])_0x2b064c[_0xa2f3('0x5')]=null;else if(_0x2b064c['clientSideLoggingEnabledSince']===null)_0x2b064c[_0xa2f3('0x5')]=new Date();}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b2a=['./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:'];(function(_0x231bf2,_0x41bc52){var _0x3b99cf=function(_0x421814){while(--_0x421814){_0x231bf2['push'](_0x231bf2['shift']());}};_0x3b99cf(++_0x41bc52);}(_0x8b2a,0x1ce));var _0xa8b2=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x8b2a[_0x59c301];return _0x3866b9;};'use strict';var UserSettingEvents=require(_0xa8b2('0x0'));var events=[_0xa8b2('0x1'),_0xa8b2('0x2'),_0xa8b2('0x3')];function createListener(_0x428bc0,_0x2593d2){return function(_0x382a1f){_0x2593d2[_0xa8b2('0x4')](_0x428bc0,_0x382a1f);if(_0x428bc0===_0xa8b2('0x5')){_0x2593d2['emit'](_0xa8b2('0x6')+_0x382a1f[_0xa8b2('0x7')],_0x382a1f);}};}exports[_0xa8b2('0x8')]=function(_0x48ca0e){for(var _0x47b780=0x0,_0x69f91c=events[_0xa8b2('0x9')];_0x47b780<_0x69f91c;_0x47b780++){var _0x2aa57e=events[_0x47b780];var _0x5e7c95=createListener(_0xa8b2('0xa')+_0x2aa57e,_0x48ca0e);UserSettingEvents['on'](_0x2aa57e,_0x5e7c95);}};
\ No newline at end of file
+var _0xa10b=['UserId','./user-setting.events','save','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xa10b,0xb0));var _0xba10=function(_0x311c58,_0x32f8e7){_0x311c58=_0x311c58-0x0;var _0x3cec74=_0xa10b[_0x311c58];return _0x3cec74;};'use strict';var UserSettingEvents=require(_0xba10('0x0'));var events=[_0xba10('0x1'),'remove',_0xba10('0x2')];function createListener(_0x15caf9,_0x591781){return function(_0x59ecda){_0x591781[_0xba10('0x3')](_0x15caf9,_0x59ecda);if(_0x15caf9===_0xba10('0x4')){_0x591781[_0xba10('0x3')](_0xba10('0x5')+_0x59ecda[_0xba10('0x6')],_0x59ecda);}};}exports['register']=function(_0x4e759a){for(var _0x16b02b=0x0,_0x10b903=events['length'];_0x16b02b<_0x10b903;_0x16b02b++){var _0x4c2681=events[_0x16b02b];var _0x3e15f3=createListener('user-setting:'+_0x4c2681,_0x4e759a);UserSettingEvents['on'](_0x4c2681,_0x3e15f3);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5b9=['removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/scheduled_calls','getScheduledCalls','post','create','/create_many','addQueues','diskStorage','join','format','%s-%s','now','originalname','file','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','put','update','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts'];(function(_0x2bd264,_0x53a5d4){var _0x3cd2e3=function(_0x125cd0){while(--_0x125cd0){_0x2bd264['push'](_0x2bd264['shift']());}};_0x3cd2e3(++_0x53a5d4);}(_0xb5b9,0x153));var _0x9b5b=function(_0x460a50,_0x14d5d0){_0x460a50=_0x460a50-0x0;var _0x5df934=_0xb5b9[_0x460a50];return _0x5df934;};'use strict';var multer=require(_0x9b5b('0x0'));var util=require(_0x9b5b('0x1'));var path=require(_0x9b5b('0x2'));var timeout=require(_0x9b5b('0x3'));var express=require(_0x9b5b('0x4'));var router=express[_0x9b5b('0x5')]();var fs_extra=require(_0x9b5b('0x6'));var auth=require(_0x9b5b('0x7'));var interaction=require(_0x9b5b('0x8'));var config=require(_0x9b5b('0x9'));var controller=require(_0x9b5b('0xa'));router['get']('/',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0xc')]);router[_0x9b5b('0xd')](_0x9b5b('0xe'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0xf')]);router[_0x9b5b('0xd')](_0x9b5b('0x10'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x11')]);router[_0x9b5b('0xd')](_0x9b5b('0x12'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x13')]);router[_0x9b5b('0xd')](_0x9b5b('0x14'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x15')]);router['get'](_0x9b5b('0x16'),controller[_0x9b5b('0x17')]);router[_0x9b5b('0xd')](_0x9b5b('0x18'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x9b5b('0xd')](_0x9b5b('0x19'),auth[_0x9b5b('0xb')](),controller['getContacts']);router['get'](_0x9b5b('0x1a'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x1b')]);router[_0x9b5b('0xd')](_0x9b5b('0x1c'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x1d')]);router['get'](_0x9b5b('0x1e'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x1f')]);router[_0x9b5b('0xd')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x9b5b('0x20')]);router[_0x9b5b('0xd')](_0x9b5b('0x21'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x22')]);router[_0x9b5b('0xd')](_0x9b5b('0x23'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x24')]);router[_0x9b5b('0xd')]('/:id/openchannel/interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x25')]);router[_0x9b5b('0xd')](_0x9b5b('0x26'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x27')]);router[_0x9b5b('0xd')](_0x9b5b('0x28'),auth[_0x9b5b('0xb')](),controller['getSmsInteractions']);router[_0x9b5b('0xd')](_0x9b5b('0x29'),auth['isAuthenticated'](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x2a')]);router[_0x9b5b('0xd')](_0x9b5b('0x2b'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x9b5b('0x2c'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x2d')]);router[_0x9b5b('0xd')]('/:id/agents',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x2e')]);router[_0x9b5b('0xd')](_0x9b5b('0x2f'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x30')]);router[_0x9b5b('0xd')]('/:id/fax_accounts',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x31')]);router[_0x9b5b('0xd')](_0x9b5b('0x32'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x33')]);router[_0x9b5b('0xd')](_0x9b5b('0x34'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x35')]);router['get'](_0x9b5b('0x36'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x37')]);router['get'](_0x9b5b('0x38'),auth[_0x9b5b('0xb')](),controller['getChatWebsites']);router[_0x9b5b('0xd')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x9b5b('0xd')](_0x9b5b('0x39'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x3a')]);router['get']('/:id/api_key',auth[_0x9b5b('0xb')](),controller['getApiKey']);router[_0x9b5b('0x3b')]('/:id/contacts',auth[_0x9b5b('0xb')](),controller['addContacts']);router[_0x9b5b('0x3b')]('/',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x3c')]);router['post'](_0x9b5b('0x3d'),auth[_0x9b5b('0xb')](),controller['bulkCreate']);router[_0x9b5b('0x3b')](_0x9b5b('0x1a'),auth['isAuthenticated'](),controller[_0x9b5b('0x3e')]);var upload=multer({'storage':multer[_0x9b5b('0x3f')]({'destination':function(_0x2f44d0,_0x59eb3d,_0x2b7380){_0x2b7380(null,path[_0x9b5b('0x40')](config['root'],'server/files/images/'));},'filename':function(_0x16ae02,_0x25837c,_0x4a589a){_0x4a589a(null,util[_0x9b5b('0x41')](_0x9b5b('0x42'),Date[_0x9b5b('0x43')](),_0x25837c[_0x9b5b('0x44')]));}})});router[_0x9b5b('0x3b')](_0x9b5b('0x16'),upload['single'](_0x9b5b('0x45')),controller['addAvatar']);router[_0x9b5b('0x3b')](_0x9b5b('0x46'),auth['isAuthenticated'](),controller[_0x9b5b('0x47')]);router[_0x9b5b('0x3b')](_0x9b5b('0x48'),auth[_0x9b5b('0xb')](),controller['logout']);router[_0x9b5b('0x3b')](_0x9b5b('0x49'),auth['isAuthenticated'](),controller[_0x9b5b('0x4a')]);router['post'](_0x9b5b('0x4b'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x4c')]);router[_0x9b5b('0x3b')](_0x9b5b('0x2b'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x4d')]);router[_0x9b5b('0x3b')]('/:id/chat_interactions',auth[_0x9b5b('0xb')](),controller['addChatInteractions']);router[_0x9b5b('0x3b')]('/:id/mail_interactions',auth[_0x9b5b('0xb')](),controller['addMailInteractions']);router[_0x9b5b('0x3b')](_0x9b5b('0x4e'),auth['isAuthenticated'](),controller[_0x9b5b('0x4f')]);router[_0x9b5b('0x3b')](_0x9b5b('0x50'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x51')]);router[_0x9b5b('0x3b')](_0x9b5b('0x52'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x53')]);router[_0x9b5b('0x3b')]('/:id/whatsapp_interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x54')]);router[_0x9b5b('0x3b')](_0x9b5b('0x55'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x56')]);router[_0x9b5b('0x3b')](_0x9b5b('0x32'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x9b5b('0x3b')](_0x9b5b('0x34'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x57')]);router['post']('/:id/sms_accounts',auth[_0x9b5b('0xb')](),controller['addSmsAccounts']);router['post'](_0x9b5b('0x38'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x58')]);router[_0x9b5b('0x3b')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x9b5b('0x59')]);router[_0x9b5b('0x3b')]('/:id/api_key',auth[_0x9b5b('0xb')](),controller['createApiKey']);router[_0x9b5b('0x5a')](_0x9b5b('0x14'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x5b')]);router[_0x9b5b('0x5a')](_0x9b5b('0x5c'),auth[_0x9b5b('0xb')](),controller['changePassword']);router[_0x9b5b('0x5d')](_0x9b5b('0x1a'),auth['isAuthenticated'](),controller[_0x9b5b('0x5e')]);router['delete'](_0x9b5b('0x2b'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x5f')]);router['delete'](_0x9b5b('0x14'),auth[_0x9b5b('0xb')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x9b5b('0x60')]);router[_0x9b5b('0x5d')]('/:id/mail_interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x61')]);router[_0x9b5b('0x5d')](_0x9b5b('0x4e'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x62')]);router[_0x9b5b('0x5d')](_0x9b5b('0x50'),auth['isAuthenticated'](),controller[_0x9b5b('0x63')]);router[_0x9b5b('0x5d')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x9b5b('0x64')]);router[_0x9b5b('0x5d')]('/:id/whatsapp_interactions',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x65')]);router[_0x9b5b('0x5d')](_0x9b5b('0x55'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x66')]);router['delete'](_0x9b5b('0x32'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x67')]);router['delete'](_0x9b5b('0x34'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x68')]);router['delete'](_0x9b5b('0x36'),auth[_0x9b5b('0xb')](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x69')]);router['delete'](_0x9b5b('0x6a'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x6b')]);router[_0x9b5b('0x5d')]('/:id/api_key',auth[_0x9b5b('0xb')](),controller['removeApiKey']);router[_0x9b5b('0x3b')](_0x9b5b('0x6c'),auth[_0x9b5b('0xb')](),controller[_0x9b5b('0x6d')]);module[_0x9b5b('0x6e')]=router;
\ No newline at end of file
+var _0x123d=['post','create','/create_many','bulkCreate','/:id/queues','addQueues','join','server/files/images/','format','%s-%s','now','single','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','/:id/api_key','createApiKey','update','put','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getApiKey','addContacts'];(function(_0xe8012f,_0x1d63ad){var _0x5a7a3c=function(_0x58c124){while(--_0x58c124){_0xe8012f['push'](_0xe8012f['shift']());}};_0x5a7a3c(++_0x1d63ad);}(_0x123d,0x187));var _0xd123=function(_0xe76e1a,_0x49d145){_0xe76e1a=_0xe76e1a-0x0;var _0x517a3a=_0x123d[_0xe76e1a];return _0x517a3a;};'use strict';var multer=require(_0xd123('0x0'));var util=require('util');var path=require(_0xd123('0x1'));var timeout=require('connect-timeout');var express=require(_0xd123('0x2'));var router=express[_0xd123('0x3')]();var fs_extra=require(_0xd123('0x4'));var auth=require(_0xd123('0x5'));var interaction=require(_0xd123('0x6'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0xd123('0x7')](),controller[_0xd123('0x8')]);router[_0xd123('0x9')](_0xd123('0xa'),auth[_0xd123('0x7')](),controller[_0xd123('0xb')]);router[_0xd123('0x9')](_0xd123('0xc'),auth[_0xd123('0x7')](),controller['whoami']);router[_0xd123('0x9')](_0xd123('0xd'),auth['isAuthenticated'](),controller[_0xd123('0xe')]);router[_0xd123('0x9')](_0xd123('0xf'),auth[_0xd123('0x7')](),controller[_0xd123('0x10')]);router[_0xd123('0x9')](_0xd123('0x11'),controller[_0xd123('0x12')]);router[_0xd123('0x9')]('/:id/open_tabs',auth[_0xd123('0x7')](),controller[_0xd123('0x13')]);router[_0xd123('0x9')](_0xd123('0x14'),auth[_0xd123('0x7')](),controller[_0xd123('0x15')]);router[_0xd123('0x9')]('/:id/queues',auth[_0xd123('0x7')](),controller[_0xd123('0x16')]);router['get']('/:id/queues_rt',auth[_0xd123('0x7')](),controller[_0xd123('0x17')]);router['get']('/:id/groups',auth[_0xd123('0x7')](),controller[_0xd123('0x18')]);router[_0xd123('0x9')](_0xd123('0x19'),auth[_0xd123('0x7')](),controller[_0xd123('0x1a')]);router[_0xd123('0x9')](_0xd123('0x1b'),auth[_0xd123('0x7')](),controller[_0xd123('0x1c')]);router[_0xd123('0x9')](_0xd123('0x1d'),auth['isAuthenticated'](),controller[_0xd123('0x1e')]);router[_0xd123('0x9')](_0xd123('0x1f'),auth[_0xd123('0x7')](),controller[_0xd123('0x20')]);router[_0xd123('0x9')](_0xd123('0x21'),auth[_0xd123('0x7')](),controller['getMailInteractions']);router['get'](_0xd123('0x22'),auth['isAuthenticated'](),controller[_0xd123('0x23')]);router['get']('/:id/fax/interactions',auth[_0xd123('0x7')](),controller[_0xd123('0x24')]);router[_0xd123('0x9')](_0xd123('0x25'),auth[_0xd123('0x7')](),controller[_0xd123('0x26')]);router[_0xd123('0x9')](_0xd123('0x27'),auth['isAuthenticated'](),controller[_0xd123('0x28')]);router['get'](_0xd123('0x29'),auth['isAuthenticated'](),controller['getLists']);router[_0xd123('0x9')](_0xd123('0x2a'),auth[_0xd123('0x7')](),controller[_0xd123('0x2b')]);router[_0xd123('0x9')](_0xd123('0x2c'),auth[_0xd123('0x7')](),controller['getVoicePrefixes']);router[_0xd123('0x9')](_0xd123('0x2d'),auth['isAuthenticated'](),controller['getFaxAccounts']);router['get'](_0xd123('0x2e'),auth[_0xd123('0x7')](),controller[_0xd123('0x2f')]);router['get'](_0xd123('0x30'),auth['isAuthenticated'](),controller[_0xd123('0x31')]);router['get']('/:id/sms_accounts',auth[_0xd123('0x7')](),controller['getSmsAccounts']);router['get'](_0xd123('0x32'),auth[_0xd123('0x7')](),controller[_0xd123('0x33')]);router[_0xd123('0x9')](_0xd123('0x34'),auth[_0xd123('0x7')](),controller[_0xd123('0x35')]);router['get'](_0xd123('0x36'),auth[_0xd123('0x7')](),controller['getScheduledCalls']);router[_0xd123('0x9')]('/:id/api_key',auth[_0xd123('0x7')](),controller[_0xd123('0x37')]);router['post'](_0xd123('0x14'),auth[_0xd123('0x7')](),controller[_0xd123('0x38')]);router[_0xd123('0x39')]('/',auth['isAuthenticated'](),controller[_0xd123('0x3a')]);router[_0xd123('0x39')](_0xd123('0x3b'),auth['isAuthenticated'](),controller[_0xd123('0x3c')]);router['post'](_0xd123('0x3d'),auth[_0xd123('0x7')](),controller[_0xd123('0x3e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36c1f0,_0x5197a8,_0xd6eb6a){_0xd6eb6a(null,path[_0xd123('0x3f')](config['root'],_0xd123('0x40')));},'filename':function(_0x43c18d,_0x393006,_0x16ccb6){_0x16ccb6(null,util[_0xd123('0x41')](_0xd123('0x42'),Date[_0xd123('0x43')](),_0x393006['originalname']));}})});router[_0xd123('0x39')](_0xd123('0x11'),upload[_0xd123('0x44')]('file'),controller[_0xd123('0x45')]);router[_0xd123('0x39')](_0xd123('0x46'),auth[_0xd123('0x7')](),controller[_0xd123('0x47')]);router[_0xd123('0x39')]('/:id/logout',auth[_0xd123('0x7')](),controller[_0xd123('0x48')]);router['post'](_0xd123('0x49'),auth[_0xd123('0x7')](),controller[_0xd123('0x4a')]);router[_0xd123('0x39')](_0xd123('0x4b'),auth[_0xd123('0x7')](),controller['unpause']);router['post'](_0xd123('0x27'),auth[_0xd123('0x7')](),controller['addTeams']);router[_0xd123('0x39')](_0xd123('0x4c'),auth['isAuthenticated'](),controller[_0xd123('0x4d')]);router[_0xd123('0x39')](_0xd123('0x4e'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xd123('0x39')](_0xd123('0x4f'),auth[_0xd123('0x7')](),controller['addFaxInteractions']);router[_0xd123('0x39')](_0xd123('0x50'),auth[_0xd123('0x7')](),controller[_0xd123('0x51')]);router[_0xd123('0x39')](_0xd123('0x52'),auth[_0xd123('0x7')](),controller[_0xd123('0x53')]);router[_0xd123('0x39')](_0xd123('0x54'),auth[_0xd123('0x7')](),controller['addWhatsappInteractions']);router[_0xd123('0x39')](_0xd123('0x2d'),auth[_0xd123('0x7')](),controller[_0xd123('0x55')]);router[_0xd123('0x39')](_0xd123('0x2e'),auth[_0xd123('0x7')](),controller[_0xd123('0x56')]);router['post'](_0xd123('0x30'),auth[_0xd123('0x7')](),controller['addOpenchannelAccounts']);router[_0xd123('0x39')](_0xd123('0x57'),auth[_0xd123('0x7')](),controller[_0xd123('0x58')]);router['post']('/:id/chat_websites',auth[_0xd123('0x7')](),controller['addChatWebsites']);router[_0xd123('0x39')](_0xd123('0x34'),auth['isAuthenticated'](),controller[_0xd123('0x59')]);router['post'](_0xd123('0x5a'),auth[_0xd123('0x7')](),controller[_0xd123('0x5b')]);router['put'](_0xd123('0xf'),auth['isAuthenticated'](),controller[_0xd123('0x5c')]);router[_0xd123('0x5d')](_0xd123('0x5e'),auth['isAuthenticated'](),controller[_0xd123('0x5f')]);router[_0xd123('0x60')]('/:id/queues',auth[_0xd123('0x7')](),controller['removeQueues']);router['delete'](_0xd123('0x27'),auth[_0xd123('0x7')](),controller[_0xd123('0x61')]);router[_0xd123('0x60')](_0xd123('0xf'),auth[_0xd123('0x7')](),controller[_0xd123('0x62')]);router['delete'](_0xd123('0x4c'),auth['isAuthenticated'](),controller[_0xd123('0x63')]);router[_0xd123('0x60')](_0xd123('0x4e'),auth[_0xd123('0x7')](),controller[_0xd123('0x64')]);router['delete'](_0xd123('0x4f'),auth[_0xd123('0x7')](),controller[_0xd123('0x65')]);router[_0xd123('0x60')](_0xd123('0x50'),auth['isAuthenticated'](),controller[_0xd123('0x66')]);router[_0xd123('0x60')](_0xd123('0x52'),auth[_0xd123('0x7')](),controller['removeOpenchannelInteractions']);router[_0xd123('0x60')](_0xd123('0x54'),auth[_0xd123('0x7')](),controller[_0xd123('0x67')]);router[_0xd123('0x60')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xd123('0x68')]);router[_0xd123('0x60')](_0xd123('0x2e'),auth[_0xd123('0x7')](),controller[_0xd123('0x69')]);router[_0xd123('0x60')](_0xd123('0x30'),auth[_0xd123('0x7')](),controller['removeOpenchannelAccounts']);router[_0xd123('0x60')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xd123('0x6a')]);router[_0xd123('0x60')](_0xd123('0x32'),auth['isAuthenticated'](),controller[_0xd123('0x6b')]);router[_0xd123('0x60')](_0xd123('0x34'),auth[_0xd123('0x7')](),controller['removeWhatsappAccounts']);router['delete']('/:id/api_key',auth[_0xd123('0x7')](),controller[_0xd123('0x6c')]);router['post'](_0xd123('0x6d'),auth[_0xd123('0x7')](),controller[_0xd123('0x6e')]);module[_0xd123('0x6f')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a3f=['/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','UNSIGNED','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','getDataValue','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','callerid','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','isArray','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','icesupport'];(function(_0x1fdd82,_0x1d85dc){var _0x448740=function(_0xf3f7c0){while(--_0xf3f7c0){_0x1fdd82['push'](_0x1fdd82['shift']());}};_0x448740(++_0x1d85dc);}(_0x1a3f,0x1d3));var _0xf1a3=function(_0x4926c5,_0x113462){_0x4926c5=_0x4926c5-0x0;var _0x2422b5=_0x1a3f[_0x4926c5];return _0x2422b5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf1a3('0x0'));var util=require(_0xf1a3('0x1'));var _=require('lodash');module[_0xf1a3('0x2')]={'name':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'unique':_0xf1a3('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4e5ef){this[_0xf1a3('0x5')]('name',_0x4e5ef);this[_0xf1a3('0x5')](_0xf1a3('0x6'),_0x4e5ef);},'comment':_0xf1a3('0x7')},'fullname':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'set':function(_0x314344){this[_0xf1a3('0x5')]('fullname',_0x314344);this['setDataValue']('callerid',util[_0xf1a3('0x8')]('\x22%s\x22\x20<%s>',_0x314344,this[_0xf1a3('0x9')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'unique':_0xf1a3('0xa'),'validate':{'isEmail':!![]},'set':function(_0xa6815e){if(_0xa6815e){this[_0xf1a3('0x5')](_0xf1a3('0xa'),_0xa6815e[_0xf1a3('0xb')]());}}},'role':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0xd'),'user',_0xf1a3('0xe'),_0xf1a3('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':_0xf1a3('0x10')},'internal':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0xb416c1){this[_0xf1a3('0x5')]('internal',_0xb416c1);this[_0xf1a3('0x5')](_0xf1a3('0x12'),_0xb416c1);this[_0xf1a3('0x5')](_0xf1a3('0x13'),util['format']('\x22%s\x22\x20<%s>',this[_0xf1a3('0x9')](_0xf1a3('0x14')),_0xb416c1));}},'salt':{'type':Sequelize[_0xf1a3('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf1a3('0x3')]},'address':{'type':Sequelize[_0xf1a3('0x3')]},'zipcode':{'type':Sequelize[_0xf1a3('0x3')]},'userpic':{'type':Sequelize[_0xf1a3('0x3')]},'city':{'type':Sequelize[_0xf1a3('0x3')]},'country':{'type':Sequelize[_0xf1a3('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':_0xf1a3('0x16')},'lastPauseAt':{'type':Sequelize[_0xf1a3('0x17')]},'chatCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf1a3('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf1a3('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x18'),'user',_0xf1a3('0x19')),'allowNull':!![],'defaultValue':_0xf1a3('0x18')},'context':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0xf1a3('0x1a'),_0xf1a3('0x1b'),_0xf1a3('0x1c'),_0xf1a3('0x1d'),_0xf1a3('0x1e'),_0xf1a3('0x1f'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':_0xf1a3('0x20'),'set':function(_0x542306){this[_0xf1a3('0x5')](_0xf1a3('0x21'),_0x542306?_0x542306[_0xf1a3('0x22')](','):null);},'get':function(){return this[_0xf1a3('0x9')](_0xf1a3('0x21'))?this['getDataValue'](_0xf1a3('0x21'))[_0xf1a3('0x23')](','):null;},'comment':_0xf1a3('0x24')},'dtmfmode':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x25'),_0xf1a3('0x26'),_0xf1a3('0x27'),_0xf1a3('0x28'),_0xf1a3('0x29')),'allowNull':!![],'defaultValue':_0xf1a3('0x25')},'directmedia':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no',_0xf1a3('0x2b'),_0xf1a3('0x2c'),_0xf1a3('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf1a3('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':_0xf1a3('0x2e'),'set':function(_0x169d35){this[_0xf1a3('0x5')](_0xf1a3('0x2f'),_0x169d35?_0x169d35[_0xf1a3('0x22')](','):null);},'get':function(){return this['getDataValue'](_0xf1a3('0x2f'))?this[_0xf1a3('0x9')](_0xf1a3('0x2f'))[_0xf1a3('0x23')](','):null;},'comment':_0xf1a3('0x30')},'callgroup':{'type':Sequelize[_0xf1a3('0x3')]},'namedcallgroup':{'type':Sequelize[_0xf1a3('0x3')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xf1a3('0x3')]},'language':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf1a3('0x3')]},'disallow':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'defaultValue':_0xf1a3('0x31')},'allow':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':![],'defaultValue':_0xf1a3('0x32'),'set':function(_0x1fe59f){this['setDataValue'](_0xf1a3('0x33'),_0x1fe59f?_0x1fe59f['join'](';'):_0xf1a3('0x32'));},'get':function(){return this['getDataValue'](_0xf1a3('0x33'))?this[_0xf1a3('0x9')](_0xf1a3('0x33'))[_0xf1a3('0x23')](';'):null;},'comment':_0xf1a3('0x34')},'autoframing':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'set':function(_0x5c073d){this[_0xf1a3('0x5')]('insecure',_0x5c073d?_0x5c073d[_0xf1a3('0x22')](','):null);},'get':function(){return this[_0xf1a3('0x9')]('insecure')?this['getDataValue'](_0xf1a3('0x35'))['split'](','):null;},'comment':_0xf1a3('0x36')},'trustrpid':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf1a3('0xc')]('yes','no',_0xf1a3('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![],'defaultValue':_0xf1a3('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf1a3('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no',_0xf1a3('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x3a'),_0xf1a3('0x3b'),_0xf1a3('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf1a3('0xc')]('uac',_0xf1a3('0x3d')),'allowNull':!![],'defaultValue':_0xf1a3('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf1a3('0x2a')},'keepalive':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no','fingerprint',_0xf1a3('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x3f'),_0xf1a3('0x40'),_0xf1a3('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf1a3('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf1a3('0xc')]('yes','no',_0xf1a3('0x2b'),_0xf1a3('0x2c'),_0xf1a3('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf1a3('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xf1a3('0x17')]},'passwordResetAt':{'type':Sequelize[_0xf1a3('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf1a3('0x43')]},'showWebBar':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0,'set':function(_0x38bfcf){this['setDataValue'](_0xf1a3('0x44'),_0x38bfcf);var _0x49e9a8=this['get']({'plain':!![]});switch(_0x38bfcf){case 0x0:case 0x1:var _0x2a335d=_0x49e9a8[_0xf1a3('0x21')]?_[_0xf1a3('0x45')](_0x49e9a8[_0xf1a3('0x21')])?_0x49e9a8[_0xf1a3('0x21')][_0xf1a3('0x22')]():_0x49e9a8[_0xf1a3('0x21')]:_0xf1a3('0x20');if(_0x2a335d===_0xf1a3('0x46')){_0x2a335d=_0xf1a3('0x20');}this[_0xf1a3('0x5')]('transport',_0x2a335d);this['setDataValue']('encryption','no');this[_0xf1a3('0x5')](_0xf1a3('0x47'),null);this[_0xf1a3('0x5')](_0xf1a3('0x48'),null);this[_0xf1a3('0x5')]('icesupport',null);this['setDataValue'](_0xf1a3('0x49'),null);this[_0xf1a3('0x5')](_0xf1a3('0x4a'),null);this[_0xf1a3('0x5')](_0xf1a3('0x4b'),null);this[_0xf1a3('0x5')](_0xf1a3('0x4c'),null);this[_0xf1a3('0x5')]('dtlsprivatekey',null);this['setDataValue'](_0xf1a3('0x4d'),'no');break;case 0x2:this[_0xf1a3('0x5')](_0xf1a3('0x21'),'wss');this['setDataValue']('encryption',_0xf1a3('0x2a'));this['setDataValue'](_0xf1a3('0x47'),_0xf1a3('0x2a'));this[_0xf1a3('0x5')](_0xf1a3('0x48'),_0xf1a3('0x2a'));this[_0xf1a3('0x5')](_0xf1a3('0x4e'),_0xf1a3('0x2a'));this['setDataValue']('dtlsenable','yes');this['setDataValue'](_0xf1a3('0x4a'),'no');this[_0xf1a3('0x5')]('dtlssetup',_0xf1a3('0x41'));this[_0xf1a3('0x5')](_0xf1a3('0x4c'),_0x49e9a8[_0xf1a3('0x4c')]||_0xf1a3('0x4f'));this['setDataValue'](_0xf1a3('0x50'),_0x49e9a8[_0xf1a3('0x50')]||_0xf1a3('0x51'));this['setDataValue']('rtcp_mux',_0xf1a3('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xf1a3('0x43')],'set':function(_0x21dd6d){this[_0xf1a3('0x5')](_0xf1a3('0x52'),_0x21dd6d?_0x21dd6d[_0xf1a3('0x22')](','):[]);},'get':function(){return this[_0xf1a3('0x9')](_0xf1a3('0x52'))?_['map'](this[_0xf1a3('0x9')]('permissions')[_0xf1a3('0x23')](','),function(_0x190e43){return parseInt(_0x190e43,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf1a3('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xf1a3('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf1a3('0xc')](_0xf1a3('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf1a3('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf1a3('0x53')],'get':function(){return this[_0xf1a3('0x9')](_0xf1a3('0x54'))?this[_0xf1a3('0x9')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf1a3('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf1a3('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![],'set':function(_0x374780){if(typeof _0x374780==='string'){var _0x4028c7=_0x374780==='1'?!![]:_0x374780==='0'?![]:_0x374780===_0xf1a3('0x55')?!![]:_0x374780===_0xf1a3('0x56')?![]:![];this[_0xf1a3('0x5')](_0xf1a3('0x57'),_0x4028c7);}else{this['setDataValue']('screenrecording',_0x374780);}}},'blocked':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![],'set':function(_0x11a983){this[_0xf1a3('0x5')](_0xf1a3('0x58'),_0x11a983);if(_0x11a983===!![]){this[_0xf1a3('0x5')](_0xf1a3('0x59'),moment());this[_0xf1a3('0x5')]('loginAttempts',0x0);}else{this[_0xf1a3('0x5')](_0xf1a3('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xf1a3('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xf1a3('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xf1a3('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xf1a3('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa489=['dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','nonat','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','update,nonat','TEXT','get','udp','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','encryption','dtlsenable','dtlssetup','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','sequelize','moment','util','exports','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER'];(function(_0x40c402,_0x42ee7d){var _0x4e7680=function(_0x52b150){while(--_0x52b150){_0x40c402['push'](_0x40c402['shift']());}};_0x4e7680(++_0x42ee7d);}(_0xa489,0x102));var _0x9a48=function(_0x2f3f98,_0x25773f){_0x2f3f98=_0x2f3f98-0x0;var _0x345824=_0xa489[_0x2f3f98];return _0x345824;};'use strict';var Sequelize=require(_0x9a48('0x0'));var moment=require(_0x9a48('0x1'));var util=require(_0x9a48('0x2'));var _=require('lodash');module[_0x9a48('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x15fac8){this[_0x9a48('0x4')](_0x9a48('0x5'),_0x15fac8);this[_0x9a48('0x4')](_0x9a48('0x6'),_0x15fac8);},'comment':_0x9a48('0x7')},'fullname':{'type':Sequelize[_0x9a48('0x8')],'allowNull':![],'set':function(_0xad7fb2){this[_0x9a48('0x4')](_0x9a48('0x9'),_0xad7fb2);this[_0x9a48('0x4')]('callerid',util[_0x9a48('0xa')](_0x9a48('0xb'),_0xad7fb2,this[_0x9a48('0xc')](_0x9a48('0xd'))));}},'alias':{'type':Sequelize[_0x9a48('0x8')]},'email':{'type':Sequelize[_0x9a48('0x8')],'allowNull':![],'unique':_0x9a48('0xe'),'validate':{'isEmail':!![]},'set':function(_0xbb1ccc){if(_0xbb1ccc){this[_0x9a48('0x4')](_0x9a48('0xe'),_0xbb1ccc[_0x9a48('0xf')]());}}},'role':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x11'),_0x9a48('0x12'),_0x9a48('0x13'),_0x9a48('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x9a48('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9a48('0xd'),'set':function(_0xf2ea04){this['setDataValue']('internal',_0xf2ea04);this[_0x9a48('0x4')](_0x9a48('0x15'),_0xf2ea04);this[_0x9a48('0x4')](_0x9a48('0x16'),util[_0x9a48('0xa')](_0x9a48('0xb'),this[_0x9a48('0xc')](_0x9a48('0x9')),_0xf2ea04));}},'salt':{'type':Sequelize[_0x9a48('0x8')]},'phone':{'type':Sequelize[_0x9a48('0x8')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x9a48('0x8')]},'userpic':{'type':Sequelize[_0x9a48('0x8')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9a48('0x8')]},'online':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':_0x9a48('0x18')},'lastPauseAt':{'type':Sequelize[_0x9a48('0x19')]},'chatCapacity':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9a48('0x1a')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9a48('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'host':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![],'defaultValue':_0x9a48('0x1b')},'ipaddr':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'port':{'type':Sequelize[_0x9a48('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x1c'),_0x9a48('0x12'),_0x9a48('0x1d')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![],'defaultValue':_0x9a48('0x1e')},'callingpres':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x1f'),_0x9a48('0x20'),_0x9a48('0x21'),_0x9a48('0x22'),_0x9a48('0x23'),'PROHIB_PASSED_SCREEN',_0x9a48('0x24'),_0x9a48('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![],'defaultValue':'udp','set':function(_0x5d4b74){this[_0x9a48('0x4')](_0x9a48('0x26'),_0x5d4b74?_0x5d4b74[_0x9a48('0x27')](','):null);},'get':function(){return this[_0x9a48('0xc')](_0x9a48('0x26'))?this[_0x9a48('0xc')]('transport')[_0x9a48('0x28')](','):null;},'comment':_0x9a48('0x29')},'dtmfmode':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x2a'),_0x9a48('0x2b'),_0x9a48('0x2c'),'inband',_0x9a48('0x2d')),'allowNull':!![],'defaultValue':_0x9a48('0x2a')},'directmedia':{'type':Sequelize[_0x9a48('0x10')]('yes','no',_0x9a48('0x2e'),_0x9a48('0x2f'),_0x9a48('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x54f77e){this[_0x9a48('0x4')](_0x9a48('0x32'),_0x54f77e?_0x54f77e[_0x9a48('0x27')](','):null);},'get':function(){return this[_0x9a48('0xc')]('nat')?this['getDataValue'](_0x9a48('0x32'))['split'](','):null;},'comment':_0x9a48('0x33')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9a48('0x8')]},'pickupgroup':{'type':Sequelize[_0x9a48('0x8')]},'namedpickupgroup':{'type':Sequelize[_0x9a48('0x8')]},'language':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9a48('0x8')]},'disallow':{'type':Sequelize[_0x9a48('0x8')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x9a48('0x8')],'allowNull':![],'defaultValue':_0x9a48('0x34'),'set':function(_0x4969d4){this[_0x9a48('0x4')]('allow',_0x4969d4?_0x4969d4[_0x9a48('0x27')](';'):_0x9a48('0x34'));},'get':function(){return this[_0x9a48('0xc')](_0x9a48('0x35'))?this[_0x9a48('0xc')](_0x9a48('0x35'))[_0x9a48('0x28')](';'):null;},'comment':_0x9a48('0x36')},'autoframing':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![],'set':function(_0x4ad579){this['setDataValue'](_0x9a48('0x37'),_0x4ad579?_0x4ad579[_0x9a48('0x27')](','):null);},'get':function(){return this[_0x9a48('0xc')](_0x9a48('0x37'))?this[_0x9a48('0xc')](_0x9a48('0x37'))[_0x9a48('0x28')](','):null;},'comment':_0x9a48('0x38')},'trustrpid':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9a48('0x31'),'no',_0x9a48('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x9a48('0x31'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![],'defaultValue':_0x9a48('0x3a')},'amaflags':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x9a48('0x31')},'busylevel':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9a48('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no',_0x9a48('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9a48('0x31'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x3c'),_0x9a48('0x3d'),_0x9a48('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x3f'),'uas'),'allowNull':!![],'defaultValue':_0x9a48('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':_0x9a48('0x31')},'keepalive':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x9a48('0x31'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9a48('0x10')]('yes','no',_0x9a48('0x41'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x42'),_0x9a48('0x43'),_0x9a48('0x44')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x9a48('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9a48('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9a48('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no',_0x9a48('0x2e'),_0x9a48('0x2f'),_0x9a48('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9a48('0x8')]},'resetPasswordExpires':{'type':Sequelize[_0x9a48('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9a48('0x46')]},'showWebBar':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0,'set':function(_0x1d2699){this[_0x9a48('0x4')]('showWebBar',_0x1d2699);var _0x7a7e99=this[_0x9a48('0x47')]({'plain':!![]});switch(_0x1d2699){case 0x0:case 0x1:var _0x52fd11=_0x7a7e99[_0x9a48('0x26')]?_['isArray'](_0x7a7e99[_0x9a48('0x26')])?_0x7a7e99['transport']['join']():_0x7a7e99[_0x9a48('0x26')]:'udp';if(_0x52fd11==='wss'){_0x52fd11=_0x9a48('0x48');}this[_0x9a48('0x4')]('transport',_0x52fd11);this[_0x9a48('0x4')]('encryption','no');this['setDataValue'](_0x9a48('0x49'),null);this[_0x9a48('0x4')](_0x9a48('0x4a'),null);this[_0x9a48('0x4')](_0x9a48('0x4b'),null);this[_0x9a48('0x4')]('dtlsenable',null);this[_0x9a48('0x4')](_0x9a48('0x4c'),null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x9a48('0x4d'),null);this[_0x9a48('0x4')](_0x9a48('0x4e'),null);this[_0x9a48('0x4')](_0x9a48('0x4f'),'no');break;case 0x2:this[_0x9a48('0x4')](_0x9a48('0x26'),_0x9a48('0x50'));this[_0x9a48('0x4')](_0x9a48('0x51'),_0x9a48('0x31'));this['setDataValue'](_0x9a48('0x49'),'yes');this[_0x9a48('0x4')](_0x9a48('0x4a'),_0x9a48('0x31'));this[_0x9a48('0x4')]('icesupport',_0x9a48('0x31'));this['setDataValue'](_0x9a48('0x52'),_0x9a48('0x31'));this[_0x9a48('0x4')](_0x9a48('0x4c'),'no');this[_0x9a48('0x4')](_0x9a48('0x53'),'actpass');this['setDataValue']('dtlscertfile',_0x7a7e99[_0x9a48('0x4d')]||'/etc/pki/tls/certs/motion.crt');this[_0x9a48('0x4')](_0x9a48('0x4e'),_0x7a7e99[_0x9a48('0x4e')]||_0x9a48('0x54'));this[_0x9a48('0x4')](_0x9a48('0x4f'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x9a48('0x46')],'set':function(_0x35eb18){this[_0x9a48('0x4')](_0x9a48('0x55'),_0x35eb18?_0x35eb18[_0x9a48('0x27')](','):[]);},'get':function(){return this[_0x9a48('0xc')](_0x9a48('0x55'))?_[_0x9a48('0x56')](this[_0x9a48('0xc')](_0x9a48('0x55'))[_0x9a48('0x28')](','),function(_0x4c7293){return parseInt(_0x4c7293,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9a48('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9a48('0x8')]},'phoneBarUnconditional':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9a48('0x10')](_0x9a48('0x31'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9a48('0x8')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9a48('0xc')](_0x9a48('0x57'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9a48('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5937bb){if(typeof _0x5937bb===_0x9a48('0x58')){var _0x5ef6d0=_0x5937bb==='1'?!![]:_0x5937bb==='0'?![]:_0x5937bb===_0x9a48('0x59')?!![]:_0x5937bb===_0x9a48('0x5a')?![]:![];this[_0x9a48('0x4')](_0x9a48('0x5b'),_0x5ef6d0);}else{this[_0x9a48('0x4')](_0x9a48('0x5b'),_0x5937bb);}}},'blocked':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![],'set':function(_0x611c01){this[_0x9a48('0x4')](_0x9a48('0x5c'),_0x611c01);if(_0x611c01===!![]){this[_0x9a48('0x4')]('blockedAt',moment());this[_0x9a48('0x4')](_0x9a48('0x5d'),0x0);}else{this[_0x9a48('0x4')](_0x9a48('0x5e'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9a48('0x1a')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9a48('0x1a')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x9a48('0x17')],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0e2=['validatePasswordPattern','max','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','permissions','101','102','103','110','104','105','106','107','108','109','100','111','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','Queue:save','voice','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','server/files/images/','download','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','format','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tags','color','tag','model','keys','Queue','filters','intersection','fields','order','sort','pick','filter','options','nolimit','limit','getVoiceQueuesRt','getGroups','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','isMiddleware','pause','getChannels','PAUSE','type','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','chatPause','faxPause','openchannelPause','pauseType','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','sequelize','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','QueueId','removeTeams','resolve','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','getLists','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','firstName','lastName','CmContact','dialActive','getApiKey','json','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','idle','unknown','ringing','teams','VoiceQueue','inbound','getAgents','flatten','toString','col','asc','desc','substring','uniqBy','offline','voiceStatus','unavailable','busy','slice','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','path','squel','../../components/auth/service','../../components/contacts','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','defaults','localhost','sendStatus','status','end','offset','undefined','count','set','Content-Range','then','role','emit','get','admin','Users','user','Agents','agent','Telephones','telephone','ignore','value','includes','find','destroy','error','stack','User','rawAttributes','map','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','name','getOptions','where','query','includeAll','true','UserSetting','userSetting','attributes','findAll','rows','length','push','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','params','include','merge','chat','update','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword'];(function(_0x193148,_0x5195d3){var _0x16d092=function(_0x5aa562){while(--_0x5aa562){_0x193148['push'](_0x193148['shift']());}};_0x16d092(++_0x5195d3);}(_0xc0e2,0x12b));var _0x2c0e=function(_0x59fe42,_0x1afb12){_0x59fe42=_0x59fe42-0x0;var _0x151def=_0xc0e2[_0x59fe42];return _0x151def;};'use strict';var moment=require(_0x2c0e('0x0'));var util=require('util');var path=require(_0x2c0e('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2c0e('0x2'));var Redis=require('ioredis');var authService=require(_0x2c0e('0x3'));var contacts=require(_0x2c0e('0x4'));var qs=require('../../components/parsers/qs');var rta=require(_0x2c0e('0x5'));var logger=require(_0x2c0e('0x6'))(_0x2c0e('0x7'));var utils=require(_0x2c0e('0x8'));var config=require(_0x2c0e('0x9'));var licenseUtil=require(_0x2c0e('0xa'));var APIBadRequestError=require(_0x2c0e('0xb'))[_0x2c0e('0xc')];var APINotFoundError=require(_0x2c0e('0xb'))[_0x2c0e('0xd')];var APIHandleError=require(_0x2c0e('0xb'))['handleError'];var db=require(_0x2c0e('0xe'))['db'];var socket=require(_0x2c0e('0xf'))(new Redis(config[_0x2c0e('0x10')]));require('./user.socket')['register'](socket);config[_0x2c0e('0x10')]=_[_0x2c0e('0x11')](config[_0x2c0e('0x10')],{'host':_0x2c0e('0x12'),'port':0x18eb});var values;function respondWithStatusCode(_0x554180,_0x48fd34){_0x48fd34=_0x48fd34||0xcc;return function(_0x5c22fc){if(_0x5c22fc){return _0x554180[_0x2c0e('0x13')](_0x48fd34);}return _0x554180[_0x2c0e('0x14')](_0x48fd34)[_0x2c0e('0x15')]();};}function respondWithResult(_0x2988b4,_0x42163e){_0x42163e=_0x42163e||0xc8;return function(_0x7efe18){if(_0x7efe18){return _0x2988b4[_0x2c0e('0x14')](_0x42163e)['json'](_0x7efe18);}};}function respondWithFilteredResult(_0x3b1f7c,_0x5c2490){return function(_0x237962){if(_0x237962){var _0x2f815c=typeof _0x5c2490[_0x2c0e('0x16')]===_0x2c0e('0x17')&&typeof _0x5c2490['limit']===_0x2c0e('0x17');var _0x227272=_0x237962[_0x2c0e('0x18')];var _0x4a9023=_0x2f815c?0x0:_0x5c2490['offset'];var _0x5c2ba4=_0x2f815c?_0x237962[_0x2c0e('0x18')]:_0x5c2490[_0x2c0e('0x16')]+_0x5c2490['limit'];var _0x26851d;if(_0x5c2ba4>=_0x227272){_0x5c2ba4=_0x227272;_0x26851d=0xc8;}else{_0x26851d=0xce;}_0x3b1f7c[_0x2c0e('0x14')](_0x26851d);return _0x3b1f7c[_0x2c0e('0x19')](_0x2c0e('0x1a'),_0x4a9023+'-'+_0x5c2ba4+'/'+_0x227272)['json'](_0x237962);}return null;};}function saveUpdates(_0x2c403c){return function(_0x5ee695){if(_0x5ee695){return _0x5ee695['update'](_0x2c403c)[_0x2c0e('0x1b')](function(_0x55a336){if(_0x55a336[_0x2c0e('0x1c')]==='agent'){socket[_0x2c0e('0x1d')]('userNotification:recalc:'+_0x55a336['id'],_0x55a336);}return _0x55a336;});}return null;};}function removeEntity(_0x31c0b6){return function(_0x1906cd){if(_0x1906cd){return _0x1906cd['destroy']()[_0x2c0e('0x1b')](function(){var _0x25a526=_0x1906cd[_0x2c0e('0x1e')]({'plain':!![]});if(_0x25a526[_0x2c0e('0x1c')]===_0x2c0e('0x1f'))return;var _0x331f64=[{'name':_0x2c0e('0x20'),'value':_0x2c0e('0x21'),'ignore':!![]},{'name':_0x2c0e('0x22'),'value':_0x2c0e('0x23'),'ignore':![]},{'name':_0x2c0e('0x24'),'value':_0x2c0e('0x25'),'ignore':![]}];var _0x34891d=_(_0x331f64)['filter'](_0x2c0e('0x26'))['map'](_0x2c0e('0x27'))[_0x2c0e('0x27')]();if(_[_0x2c0e('0x28')](_0x34891d,_0x25a526[_0x2c0e('0x1c')])){return;}var _0x5b5ed2=_[_0x2c0e('0x29')](_0x331f64,['value',_0x25a526[_0x2c0e('0x1c')]])['name'];return db['UserProfileResource'][_0x2c0e('0x2a')]({'where':{'type':_0x5b5ed2,'resourceId':_0x25a526['id']}})[_0x2c0e('0x1b')](function(){return _0x1906cd;});})[_0x2c0e('0x1b')](function(){_0x31c0b6[_0x2c0e('0x14')](0xcc)[_0x2c0e('0x15')]();});}};}function handleEntityNotFound(_0x1d547e){return function(_0x45b469){if(!_0x45b469){_0x1d547e['sendStatus'](0x194);}return _0x45b469;};}function handleError(_0x271d7c,_0x3381e8){_0x3381e8=_0x3381e8||0x1f4;return function(_0x5eb5e2){logger[_0x2c0e('0x2b')](_0x5eb5e2[_0x2c0e('0x2c')]);if(_0x5eb5e2['name']){delete _0x5eb5e2['name'];}_0x271d7c['status'](_0x3381e8)['send'](_0x5eb5e2);};}function getUserAttributes(){return _(db[_0x2c0e('0x2d')][_0x2c0e('0x2e')])[_0x2c0e('0x2f')](function(_0x2ec1dd){return{'name':_0x2ec1dd['fieldName'],'type':_0x2ec1dd['type']['key']};})['filter'](function(_0x5d9e69){return![_0x2c0e('0x30'),_0x2c0e('0x31'),_0x2c0e('0x32'),_0x2c0e('0x33'),_0x2c0e('0x34'),_0x2c0e('0x35')][_0x2c0e('0x28')](_0x5d9e69[_0x2c0e('0x36')]);})[_0x2c0e('0x27')]();}exports['index']=function(_0x50b509,_0x2fcc00){var _0xe88821={},_0x148c9b={'count':0x0,'rows':[]};var _0x489909=getUserAttributes();_0xe88821=qs[_0x2c0e('0x37')](_0x489909,_0x50b509);var _0x4a63e7={'where':_0xe88821[_0x2c0e('0x38')]};return db[_0x2c0e('0x2d')][_0x2c0e('0x18')](_0x4a63e7)[_0x2c0e('0x1b')](function(_0x29d315){_0x148c9b[_0x2c0e('0x18')]=_0x29d315;if(_0x50b509[_0x2c0e('0x39')][_0x2c0e('0x3a')]){_0xe88821['include']=[{'all':!![]}];}if(_0x50b509[_0x2c0e('0x39')]['userSetting']===_0x2c0e('0x3b')){_0xe88821['include']=[{'model':db[_0x2c0e('0x3c')],'as':_0x2c0e('0x3d')}];}if(!_[_0x2c0e('0x28')](_0xe88821[_0x2c0e('0x3e')],'id')){_0xe88821['attributes']['push']('id');}return db[_0x2c0e('0x2d')][_0x2c0e('0x3f')](_0xe88821);})[_0x2c0e('0x1b')](function(_0x43b2eb){_0x148c9b[_0x2c0e('0x40')]=_0x43b2eb;if(_0x50b509[_0x2c0e('0x39')]['openTabs']===_0x2c0e('0x3b')){var _0xb9ca0a=[];for(var _0x40c0b3=0x0;_0x40c0b3<_0x148c9b[_0x2c0e('0x40')][_0x2c0e('0x41')];_0x40c0b3++){_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs('chat',_0x148c9b[_0x2c0e('0x40')][_0x40c0b3][_0x2c0e('0x43')]));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x44'),_0x148c9b[_0x2c0e('0x40')][_0x40c0b3][_0x2c0e('0x43')]));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x45'),_0x148c9b[_0x2c0e('0x40')][_0x40c0b3]['dataValues']));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x46'),_0x148c9b['rows'][_0x40c0b3]['dataValues']));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x47'),_0x148c9b['rows'][_0x40c0b3][_0x2c0e('0x43')]));_0xb9ca0a[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x48'),_0x148c9b[_0x2c0e('0x40')][_0x40c0b3][_0x2c0e('0x43')]));}return Promise[_0x2c0e('0x49')](_0xb9ca0a)['then'](function(){return _0x148c9b;});}else{return _0x148c9b;}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x2fcc00,_0xe88821))[_0x2c0e('0x4a')](handleError(_0x2fcc00,null));};exports[_0x2c0e('0x4b')]=function(_0x4d934d,_0x15564a){var _0xa5cdd6=getUserAttributes();_0x4d934d[_0x2c0e('0x39')]['id']=_0x4d934d[_0x2c0e('0x4c')]['id'];var _0x5e1a52=qs[_0x2c0e('0x37')](_0xa5cdd6,_0x4d934d);if(_0x4d934d[_0x2c0e('0x39')][_0x2c0e('0x3a')]){_0x5e1a52[_0x2c0e('0x4d')]=[{'all':!![]}];}if(_0x4d934d[_0x2c0e('0x39')][_0x2c0e('0x3d')]==='true'){_0x5e1a52[_0x2c0e('0x4d')]=[{'model':db[_0x2c0e('0x3c')],'as':'userSetting'}];}_0x5e1a52=_[_0x2c0e('0x4e')]({},_0x5e1a52,_0x4d934d['options']);if(!_[_0x2c0e('0x28')](_0x5e1a52[_0x2c0e('0x3e')],'id')){_0x5e1a52['attributes'][_0x2c0e('0x42')]('id');}return db[_0x2c0e('0x2d')][_0x2c0e('0x29')](_0x5e1a52)['then'](handleEntityNotFound(_0x15564a,null))[_0x2c0e('0x1b')](function(_0x1101a6){var _0x526853=[];values=_0x1101a6;if(_0x4d934d['query']['openTabs']===_0x2c0e('0x3b')){_0x526853['push'](get_open_tabs(_0x2c0e('0x4f'),_0x1101a6['dataValues']));_0x526853[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x44'),_0x1101a6['dataValues']));_0x526853[_0x2c0e('0x42')](get_open_tabs('openchannel',_0x1101a6[_0x2c0e('0x43')]));_0x526853[_0x2c0e('0x42')](get_open_tabs('whatsapp',_0x1101a6[_0x2c0e('0x43')]));_0x526853[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x45'),_0x1101a6[_0x2c0e('0x43')]));_0x526853[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x46'),_0x1101a6['dataValues']));return Promise[_0x2c0e('0x49')](_0x526853);}else{return values;}})[_0x2c0e('0x1b')](function(){return values;})[_0x2c0e('0x1b')](respondWithResult(_0x15564a,null))['catch'](handleError(_0x15564a,null));};exports[_0x2c0e('0x50')]=function(_0x3ce1fb,_0x634586){if(_0x3ce1fb[_0x2c0e('0x51')]['id']){delete _0x3ce1fb[_0x2c0e('0x51')]['id'];}delete _0x3ce1fb[_0x2c0e('0x51')][_0x2c0e('0x1c')];return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x3ce1fb['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x634586,null))[_0x2c0e('0x1b')](saveUpdates(_0x3ce1fb[_0x2c0e('0x51')],null))[_0x2c0e('0x1b')](respondWithResult(_0x634586,null))[_0x2c0e('0x4a')](handleError(_0x634586,null));};exports['describe']=function(_0xbadd64,_0x17ccb9){return db[_0x2c0e('0x2d')][_0x2c0e('0x52')]()['then'](respondWithResult(_0x17ccb9,null))[_0x2c0e('0x4a')](handleError(_0x17ccb9,null));};exports[_0x2c0e('0x53')]=function(_0x594a96,_0x5b111f){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x594a96[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5b111f,null))[_0x2c0e('0x1b')](function(_0x76c6a3){if(_0x76c6a3){return _0x76c6a3[_0x2c0e('0x53')](_0x594a96[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x594a96[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x5b111f,null))['catch'](handleError(_0x5b111f,null));};function validateUser(_0x42c4cb){return new Promise(function(_0xecc59f,_0x38cf26){if(_0x42c4cb[_0x2c0e('0x56')])return _0xecc59f(_0x42c4cb);return db[_0x2c0e('0x57')][_0x2c0e('0x58')](0x1)['then'](function(_0x18fe9b){if(_0x18fe9b[_0x2c0e('0x59')])authService[_0x2c0e('0x5a')](_0x42c4cb[_0x2c0e('0x30')]);db['User'][_0x2c0e('0x5b')](_0x2c0e('0x56'))[_0x2c0e('0x1b')](function(_0x588abc){if(_[_0x2c0e('0x5c')](_0x588abc)){_0x42c4cb[_0x2c0e('0x56')]=_0x18fe9b[_0x2c0e('0x5d')]||0x1;return;}if(_['isNil'](_0x18fe9b[_0x2c0e('0x5d')])||_0x18fe9b[_0x2c0e('0x5d')]===_0x588abc){_0x42c4cb['internal']=_0x588abc+0x1;return;}if(_0x18fe9b[_0x2c0e('0x5d')]>_0x588abc){_0x42c4cb[_0x2c0e('0x56')]=_0x18fe9b['min_internal'];return;}return db['sequelize'][_0x2c0e('0x39')](_0x2c0e('0x5e'),{'type':db['sequelize'][_0x2c0e('0x5f')][_0x2c0e('0x60')]})[_0x2c0e('0x1b')](function(_0x373a2c){if(_0x373a2c&&_0x373a2c['length']){for(var _0x408509=0x0,_0x52ffcf=_0x373a2c[_0x2c0e('0x41')];_0x408509<_0x52ffcf&&_[_0x2c0e('0x5c')](_0x42c4cb[_0x2c0e('0x56')]);_0x408509++){if(_0x18fe9b[_0x2c0e('0x5d')]<=_0x373a2c[_0x408509][_0x2c0e('0x61')]){_0x42c4cb['internal']=_0x373a2c[_0x408509][_0x2c0e('0x61')];}else if(_0x18fe9b[_0x2c0e('0x5d')]>_0x373a2c[_0x408509][_0x2c0e('0x61')]&&_0x18fe9b[_0x2c0e('0x5d')]<=_0x373a2c[_0x408509]['to']){_0x42c4cb['internal']=_0x18fe9b['min_internal'];}}}if(_[_0x2c0e('0x5c')](_0x42c4cb['internal'])){_0x42c4cb['internal']=_0x588abc+0x1;}return _0xecc59f(_0x42c4cb);});});})[_0x2c0e('0x4a')](function(_0x4f5eee){_0x38cf26(_0x4f5eee);});});}function updateUser(_0x5164c5){return new Promise(function(_0x3ebc74,_0x5cc843){try{if(_0x5164c5[_0x2c0e('0x62')]){_0x5164c5[_0x2c0e('0x63')]=_0x5164c5[_0x2c0e('0x56')];_0x5164c5[_0x2c0e('0x64')]={'mailbox':_0x5164c5[_0x2c0e('0x56')],'password':_0x5164c5['password'],'fullname':_0x5164c5['fullname'],'email':_0x5164c5['email']};}if(_0x5164c5[_0x2c0e('0x1c')]===_0x2c0e('0x23')){if(!_0x5164c5[_0x2c0e('0x65')])_0x5164c5[_0x2c0e('0x65')]=[_0x2c0e('0x66'),_0x2c0e('0x67'),_0x2c0e('0x68'),'113',_0x2c0e('0x69'),_0x2c0e('0x6a'),_0x2c0e('0x6b'),_0x2c0e('0x6c'),_0x2c0e('0x6d'),_0x2c0e('0x6e'),_0x2c0e('0x6f'),_0x2c0e('0x70'),_0x2c0e('0x71'),_0x2c0e('0x72'),_0x2c0e('0x73')];}_0x3ebc74(_0x5164c5);}catch(_0x158259){_0x5cc843(_0x158259);}});}exports['create']=function(_0x38a0a4,_0xa87a8a){if(_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x1c')]===_0x2c0e('0x23'))throw new Error(_0x2c0e('0x74'));if(_0x38a0a4[_0x2c0e('0x51')]['role']==='user'&&_0x38a0a4[_0x2c0e('0x21')]['role']!==_0x2c0e('0x1f')){throw new Error(_0x2c0e('0x75'));}if(_0x38a0a4[_0x2c0e('0x51')][_0x2c0e('0x1c')]===_0x2c0e('0x1f')&&_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x1c')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x2c0e('0x76')]([_0x38a0a4[_0x2c0e('0x51')]])['then'](function(){return validateUser(_0x38a0a4[_0x2c0e('0x51')]);})[_0x2c0e('0x1b')](function(_0x5e3e82){return updateUser(_0x5e3e82)[_0x2c0e('0x1b')](function(_0x48a2f6){if(_0x48a2f6[_0x2c0e('0x1c')]===_0x2c0e('0x1f')){_0x48a2f6['settingsEnabled']=_0x38a0a4['user'][_0x2c0e('0x77')];delete _0x48a2f6[_0x2c0e('0x78')];}return _0x48a2f6;});})[_0x2c0e('0x1b')](function(_0x496dbb){return db[_0x2c0e('0x2d')][_0x2c0e('0x79')](_0x496dbb,{'include':[{'model':db[_0x2c0e('0x64')],'as':_0x2c0e('0x64')}]});})['then'](function(_0x9d143a){if(_0x38a0a4[_0x2c0e('0x51')][_0x2c0e('0x1c')]===_0x2c0e('0x21'))return _0x9d143a;if(_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x1c')]!=='user')return _0x9d143a;return db[_0x2c0e('0x7a')][_0x2c0e('0x29')]({'where':{'name':_0x9d143a['role']===_0x2c0e('0x23')?_0x2c0e('0x22'):'Telephones','userProfileId':_0x38a0a4[_0x2c0e('0x21')][_0x2c0e('0x78')]},'raw':!![]})[_0x2c0e('0x1b')](function(_0x5c70fd){if(!_0x5c70fd||_0x5c70fd[_0x2c0e('0x7b')]!=0x0)return _0x9d143a;return db[_0x2c0e('0x7c')][_0x2c0e('0x79')]({'name':_0x9d143a['name'],'resourceId':_0x9d143a['id'],'type':_0x5c70fd['name'],'sectionId':_0x5c70fd['id']},{})[_0x2c0e('0x1b')](function(){return _0x9d143a;});})[_0x2c0e('0x4a')](function(_0x7af392){logger[_0x2c0e('0x2b')](_0x2c0e('0x7d'),_0x7af392);throw _0x7af392;});})[_0x2c0e('0x1b')](respondWithResult(_0xa87a8a,0xc9))[_0x2c0e('0x4a')](handleError(_0xa87a8a,null));};exports[_0x2c0e('0x7e')]=function(_0x168391,_0x44ba17){var _0x384442=_0x168391[_0x2c0e('0x51')];var _0x414578=[];if(_0x168391['user']['role']===_0x2c0e('0x23'))throw new Error(_0x2c0e('0x74'));if(_['some'](_0x384442,[_0x2c0e('0x1c'),_0x2c0e('0x21')])&&_0x168391['user'][_0x2c0e('0x1c')]!==_0x2c0e('0x1f')){throw new Error(_0x2c0e('0x75'));}if(_[_0x2c0e('0x7f')](_0x384442,[_0x2c0e('0x1c'),'admin'])&&_0x168391['user']['role']!=='admin'){throw new Error(_0x2c0e('0x80'));}return licenseUtil[_0x2c0e('0x76')](_0x384442)['then'](function(){return validateUser(_0x384442[0x0]);})[_0x2c0e('0x1b')](function(){for(var _0x558f07=0x1;_0x558f07<_0x384442[_0x2c0e('0x41')];_0x558f07++){var _0x50813a=_0x384442[_0x558f07-0x1]['internal'];if(!_0x384442[_0x558f07][_0x2c0e('0x56')])_0x384442[_0x558f07][_0x2c0e('0x56')]=_0x50813a+0x1;_0x414578[_0x2c0e('0x42')](validateUser(_0x384442[_0x558f07]));}return Promise['all'](_0x414578);})[_0x2c0e('0x1b')](function(){_0x414578=[];for(var _0x3805e9=0x0;_0x3805e9<_0x384442[_0x2c0e('0x41')];_0x3805e9++){_0x414578[_0x2c0e('0x42')](updateUser(_0x384442[_0x3805e9]));}return Promise['all'](_0x414578);})['then'](function(){_0x414578=_0x384442[_0x2c0e('0x2f')](function(_0x4fcf22){return db[_0x2c0e('0x2d')][_0x2c0e('0x79')](_0x4fcf22,{'include':[{'model':db['VoiceMail'],'as':_0x2c0e('0x64')}]})[_0x2c0e('0x1b')](function(_0x5b4b06){_0x4fcf22['id']=_0x5b4b06['id'];return _0x4fcf22;});});return Promise[_0x2c0e('0x49')](_0x414578);})[_0x2c0e('0x1b')](function(_0x45e16f){if(_0x168391[_0x2c0e('0x51')][_0x2c0e('0x1c')]===_0x2c0e('0x21'))return _0x45e16f;if(_0x168391['user'][_0x2c0e('0x1c')]!==_0x2c0e('0x21'))return _0x45e16f;var _0x2d9b60=_[_0x2c0e('0x7f')](_0x45e16f,function(_0x4051e8){return _0x4051e8['role']===_0x2c0e('0x23')||_0x4051e8['role']==='telephone';});if(!_0x2d9b60)return _0x45e16f;return db['UserProfileSection'][_0x2c0e('0x3f')]({'where':{'name':{'$or':[_0x2c0e('0x22'),'Telephones']},'userProfileId':_0x168391[_0x2c0e('0x21')][_0x2c0e('0x78')]},'raw':!![]})[_0x2c0e('0x1b')](function(_0x46ade9){if(_[_0x2c0e('0x81')](_0x46ade9)||!_[_0x2c0e('0x7f')](_0x46ade9,['autoAssociation',0x0]))return _0x45e16f;_0x414578=[];var _0x5d3267=_(_0x46ade9)['map'](function(_0x4ffd10){if(_0x4ffd10[_0x2c0e('0x7b')]===0x1)return;return _0x4ffd10[_0x2c0e('0x36')]===_0x2c0e('0x22')?_0x2c0e('0x23'):'telephone';})[_0x2c0e('0x82')]()['value']();for(var _0x39fe08=0x0;_0x39fe08<_0x45e16f[_0x2c0e('0x41')];_0x39fe08++){if(!_[_0x2c0e('0x28')](_0x5d3267,_0x45e16f[_0x39fe08][_0x2c0e('0x1c')]))return;var _0x40ac06=_0x45e16f[_0x39fe08][_0x2c0e('0x1c')]===_0x2c0e('0x23')?_0x2c0e('0x22'):_0x2c0e('0x24');_0x414578['push'](db[_0x2c0e('0x7c')][_0x2c0e('0x79')]({'name':_0x45e16f[_0x39fe08][_0x2c0e('0x36')],'resourceId':_0x45e16f[_0x39fe08]['id'],'type':_0x40ac06,'sectionId':_[_0x2c0e('0x29')](_0x46ade9,[_0x2c0e('0x36'),_0x40ac06])['id']},{}));}return Promise[_0x2c0e('0x49')](_0x414578);});})[_0x2c0e('0x1b')](respondWithResult(_0x44ba17,0xc9))[_0x2c0e('0x4a')](handleError(_0x44ba17,null));};exports[_0x2c0e('0x83')]=function(_0xef12e2,_0x471503){if(_0xef12e2['body']['id']){delete _0xef12e2['body']['id'];}return db['User']['find']({'where':{'id':_0xef12e2['params']['id']}})['then'](function(_0x3e5cce){if(!_0x3e5cce)return null;if(_0x3e5cce['id']===_0xef12e2[_0x2c0e('0x21')]['id']){if(!_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x84')]||!_0xef12e2['body'][_0x2c0e('0x85')]){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x88'));}if(!_0x3e5cce['authenticate'](_0xef12e2['body']['oldPassword'])){throw new db['Sequelize'][(_0x2c0e('0x87'))](_0x2c0e('0x89'));}if(_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x84')]===_0xef12e2['body'][_0x2c0e('0x85')]){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x8a'));}}else if(_0xef12e2[_0x2c0e('0x21')][_0x2c0e('0x1c')]==='admin'){if(!_0xef12e2['body'][_0x2c0e('0x85')]){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xef12e2[_0x2c0e('0x21')][_0x2c0e('0x1c')]===_0x2c0e('0x21')){if(!_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')]){throw new db['Sequelize']['ValidationError'](_0x2c0e('0x8b'));}if(_0x3e5cce[_0x2c0e('0x1c')]!==_0x2c0e('0x23')){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x74'));}}else{throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x74'));}return _0x3e5cce;})[_0x2c0e('0x1b')](handleEntityNotFound(_0x471503,null))[_0x2c0e('0x1b')](function(_0x1eeb21){return db[_0x2c0e('0x57')][_0x2c0e('0x8c')]({'attributes':['id',_0x2c0e('0x59'),_0x2c0e('0x8d'),_0x2c0e('0x8e')]})[_0x2c0e('0x1b')](function(_0x189f97){if(_0x189f97[_0x2c0e('0x59')])authService[_0x2c0e('0x5a')](_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')]);if(!_0x189f97[_0x2c0e('0x8d')]||!_0x1eeb21[_0x2c0e('0x32')])return _0x1eeb21;authService[_0x2c0e('0x8f')](_0xef12e2['body']['newPassword'],_0x1eeb21[_0x2c0e('0x32')],_0x189f97['passwordHistoryLimit']);return _0x1eeb21;})[_0x2c0e('0x1b')](saveUpdates({'password':_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')],'passwordResetAt':_0xef12e2[_0x2c0e('0x21')]['id']==_0xef12e2[_0x2c0e('0x4c')]['id']?moment():null,'previousPasswords':authService[_0x2c0e('0x90')](_0xef12e2[_0x2c0e('0x51')][_0x2c0e('0x85')],_0x1eeb21['previousPasswords'])},null));})['then'](respondWithResult(_0x471503,null))[_0x2c0e('0x4a')](handleError(_0x471503,null));};exports[_0x2c0e('0x91')]=function(_0x270997,_0xe4b28d){var _0x57f53d=_0x270997['body']['channel'];return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x270997[_0x2c0e('0x4c')]['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c'),_0x2c0e('0x92'),_0x2c0e('0x93'),_0x2c0e('0x94'),_0x2c0e('0x95')]})[_0x2c0e('0x1b')](handleEntityNotFound(_0xe4b28d,null))[_0x2c0e('0x1b')](function(_0x5a7437){if(_0x5a7437){if(!utils[_0x2c0e('0x96')](_0x57f53d)){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x97'));}return _0x5a7437['add'+_[_0x2c0e('0x98')](_0x57f53d[_0x2c0e('0x99')]())+_0x2c0e('0x9a')](_0x270997[_0x2c0e('0x51')]['ids'],{'penalty':_0x270997[_0x2c0e('0x51')][_0x2c0e('0x9b')]||0x0})[_0x2c0e('0x9c')](function(_0x2c24b1){for(var _0x397981=0x0;_0x397981<_0x270997[_0x2c0e('0x51')][_0x2c0e('0x54')]['length'];_0x397981+=0x1){var _0x2f1362={'UserId':Number(_0x270997[_0x2c0e('0x4c')]['id'])};_0x2f1362[_[_0x2c0e('0x98')](_0x57f53d['toLowerCase']())+'QueueId']=Number(_0x270997['body'][_0x2c0e('0x54')][_0x397981]);socket[_0x2c0e('0x1d')](_0x2c0e('0x21')+_['capitalize'](_0x57f53d[_0x2c0e('0x99')]())+_0x2c0e('0x9d'),_0x2f1362);}return _0x2c24b1;})[_0x2c0e('0x1b')](function(){if(_0x57f53d===_0x2c0e('0x9e')){return db['VoiceQueue'][_0x2c0e('0x3f')]({'where':{'id':_0x270997[_0x2c0e('0x51')]['ids']||[]},'raw':!![],'attributes':['id',_0x2c0e('0x36')]});}})[_0x2c0e('0x1b')](function(_0x4929fb){var _0x41125a=_0x5a7437[_0x2c0e('0x1e')]({'plain':!![]});var _0x7a3fe0=[];if(_0x57f53d===_0x2c0e('0x9e')&&_0x41125a['role']===_0x2c0e('0x23')&&_0x41125a[_0x2c0e('0x92')]){for(let _0x40357c=0x0;_0x40357c<_0x4929fb[_0x2c0e('0x41')];_0x40357c+=0x1){_0x7a3fe0[_0x2c0e('0x42')]({'membername':_0x41125a['name'],'UserId':_0x41125a['id'],'queue_name':_0x4929fb[_0x40357c][_0x2c0e('0x36')],'VoiceQueueId':_0x4929fb[_0x40357c]['id'],'interface':_['isNil'](_0x41125a[_0x2c0e('0x95')])?util['format']('SIP/%s',_0x41125a[_0x2c0e('0x36')]):_0x41125a[_0x2c0e('0x95')],'paused':_0x41125a[_0x2c0e('0x94')]||![],'penalty':_0x270997[_0x2c0e('0x51')][_0x2c0e('0x9b')]||0x0});}return Promise[_0x2c0e('0x49')](_0x7a3fe0[_0x2c0e('0x2f')](function(_0x1af9b2){return db[_0x2c0e('0x9f')][_0x2c0e('0xa0')](_0x1af9b2);}));}return _0x5a7437;});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0xe4b28d,null))[_0x2c0e('0x4a')](handleError(_0xe4b28d,null));};exports[_0x2c0e('0xa1')]=function(_0x52328f,_0x27f0c2){var _0x20b875,_0x48af66;return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x52328f['params']['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c')]})[_0x2c0e('0x1b')](handleEntityNotFound(_0x27f0c2,null))[_0x2c0e('0x1b')](function(_0x4b3640){if(_0x4b3640){_0x20b875=_0x4b3640;if(!_0x52328f[_0x2c0e('0x39')][_0x2c0e('0xa2')]||!utils[_0x2c0e('0x96')](_0x52328f[_0x2c0e('0x39')][_0x2c0e('0xa2')])){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x97'));}return _0x4b3640[_0x2c0e('0xa3')+_[_0x2c0e('0x98')](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+_0x2c0e('0x9a')](_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')]);}})['then'](function(_0x229cef){if(_['isArray'](_0x52328f[_0x2c0e('0x39')]['ids'])){for(var _0x4ee945=0x0;_0x4ee945<_0x52328f[_0x2c0e('0x39')]['ids'][_0x2c0e('0x41')];_0x4ee945+=0x1){_0x48af66={'UserId':Number(_0x52328f[_0x2c0e('0x4c')]['id'])};_0x48af66[_[_0x2c0e('0x98')](_0x52328f[_0x2c0e('0x39')][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+'QueueId']=Number(_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x4ee945]);socket['emit']('user'+_[_0x2c0e('0x98')](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+_0x2c0e('0xa4'),_0x48af66);}}else{_0x48af66={'UserId':Number(_0x52328f['params']['id'])};_0x48af66[_[_0x2c0e('0x98')](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+'QueueId']=Number(_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')]);socket[_0x2c0e('0x1d')]('user'+_['capitalize'](_0x52328f['query'][_0x2c0e('0xa2')][_0x2c0e('0x99')]())+'Queue:remove',_0x48af66);}return _0x229cef;})[_0x2c0e('0x1b')](function(){if(_0x52328f['query'][_0x2c0e('0xa2')]==='voice'){return db[_0x2c0e('0x9f')]['destroy']({'where':{'UserId':_0x52328f[_0x2c0e('0x4c')]['id'],'VoiceQueueId':_0x52328f[_0x2c0e('0x39')][_0x2c0e('0x54')]},'individualHooks':!![]})[_0x2c0e('0x1b')](function(){return _0x20b875;});}return _0x20b875;})[_0x2c0e('0x1b')](respondWithStatusCode(_0x27f0c2,null))['catch'](handleError(_0x27f0c2,null));};exports[_0x2c0e('0xa5')]=function(_0x5a2c14,_0xa35110){_0x5a2c14[_0x2c0e('0x51')][_0x2c0e('0xa6')]=_0x5a2c14[_0x2c0e('0xa7')]['filename'];return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x5a2c14['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0xa35110,null))[_0x2c0e('0x1b')](saveUpdates(_0x5a2c14[_0x2c0e('0x51')],null))[_0x2c0e('0x1b')](respondWithResult(_0xa35110,null))[_0x2c0e('0x4a')](handleError(_0xa35110,null));};exports[_0x2c0e('0xa8')]=function(_0x824eb9,_0x1bf4ca){var _0x302544=path[_0x2c0e('0xa9')](config[_0x2c0e('0xaa')],_0x2c0e('0xab'));return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x824eb9[_0x2c0e('0x4c')]['id']},'attributes':['id',_0x2c0e('0xa6')],'raw':!![]})['then'](handleEntityNotFound(_0x1bf4ca,null))['then'](function(_0x45982b){if(_0x45982b){if(_['isNil'](_0x45982b[_0x2c0e('0xa6')])){return _0x1bf4ca['download'](_0x302544);}else{if(!fs['existsSync'](path['join'](config[_0x2c0e('0xaa')],_0x2c0e('0xac'),_0x45982b['userpic']))){return _0x1bf4ca[_0x2c0e('0xad')](_0x302544);}return _0x1bf4ca[_0x2c0e('0xad')](path['join'](config[_0x2c0e('0xaa')],_0x2c0e('0xac'),_0x45982b['userpic']));}}})['catch'](handleError(_0x1bf4ca,null));};exports[_0x2c0e('0xae')]=function(_0x8e7eb6,_0x3520fa){return db['User']['find']({'where':{'id':_0x8e7eb6[_0x2c0e('0x4c')]['id']},'attributes':['id']})[_0x2c0e('0x1b')](handleEntityNotFound(_0x3520fa,null))[_0x2c0e('0x1b')](function(_0x49740f){var _0x998251=[];values=_0x49740f[_0x2c0e('0x43')];_0x998251[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x4f'),_0x49740f[_0x2c0e('0x43')]));_0x998251[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x44'),_0x49740f[_0x2c0e('0x43')]));_0x998251[_0x2c0e('0x42')](get_open_tabs(_0x2c0e('0x47'),_0x49740f[_0x2c0e('0x43')]));_0x998251[_0x2c0e('0x42')](get_open_tabs('whatsapp',_0x49740f[_0x2c0e('0x43')]));_0x998251['push'](get_open_tabs(_0x2c0e('0x45'),_0x49740f[_0x2c0e('0x43')]));_0x998251['push'](get_open_tabs('mail',_0x49740f[_0x2c0e('0x43')]));return Promise[_0x2c0e('0x49')](_0x998251);})[_0x2c0e('0x1b')](function(_0x455d24){if(_0x455d24){var _0x155508=_[_0x2c0e('0x2f')](values['ChatOpenTabs'],function(_0x5eac24){return{'channel':_0x2c0e('0xaf'),'id':_0x5eac24['id'],'createdAt':_0x5eac24[_0x2c0e('0xb0')]};});var _0x37d8b3=_[_0x2c0e('0x2f')](values[_0x2c0e('0xb1')],function(_0x54aac1){return{'channel':_0x2c0e('0xb2'),'id':_0x54aac1['id'],'createdAt':_0x54aac1[_0x2c0e('0xb0')]};});var _0x408ec7=_[_0x2c0e('0x2f')](values[_0x2c0e('0xb3')],function(_0x554014){return{'channel':_0x2c0e('0xb4'),'id':_0x554014['id'],'createdAt':_0x554014[_0x2c0e('0xb0')]};});var _0x5cdf11=_[_0x2c0e('0x2f')](values['MailOpenTabs'],function(_0x121b06){return{'channel':_0x2c0e('0xb5'),'id':_0x121b06['id'],'createdAt':_0x121b06[_0x2c0e('0xb0')]};});var _0x4d63a0=_['map'](values[_0x2c0e('0xb6')],function(_0x352c26){return{'channel':_0x2c0e('0xb7'),'id':_0x352c26['id'],'createdAt':_0x352c26[_0x2c0e('0xb0')]};});var _0x241e34=_[_0x2c0e('0x2f')](values['WhatsappOpenTabs'],function(_0x37d5ad){return{'channel':_0x2c0e('0xb8'),'id':_0x37d5ad['id'],'createdAt':_0x37d5ad[_0x2c0e('0xb0')]};});var _0x3a597b=_[_0x2c0e('0xb9')](_0x155508,_0x37d8b3,_0x408ec7,_0x5cdf11,_0x4d63a0,_0x241e34);var _0x3e5674={'count':_0x3a597b['length'],'rows':_0x3a597b};return _0x3e5674;}else return null;})['then'](respondWithResult(_0x3520fa,null))[_0x2c0e('0x4a')](handleError(_0x3520fa,null));};exports[_0x2c0e('0xba')]=function(_0x727762,_0x5a32c1){var _0xed8651={};return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x727762['params']['id']}})[_0x2c0e('0x1b')](function(_0x5abc0d){if(!_0x5abc0d){throw new APINotFoundError(util[_0x2c0e('0xbb')](_0x2c0e('0xbc'),_0x727762['params']['id']));}return contacts[_0x2c0e('0x52')]();})[_0x2c0e('0x1b')](function(_0x5b3e2f){_0x727762[_0x2c0e('0x39')][_0x2c0e('0x2d')]=_0x727762['params']['id'];_0xed8651=qs[_0x2c0e('0x37')](_0x5b3e2f,_0x727762);if(_0x727762[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0x3a'))){_0xed8651[_0x2c0e('0x4d')]=[{'model':db[_0x2c0e('0xbe')],'as':_0x2c0e('0xbf'),'required':![]},{'model':db['Tag'],'as':_0x2c0e('0xc0'),'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0xc1')],'where':_0x727762[_0x2c0e('0x39')][_0x2c0e('0xc2')]?{'id':_0x727762['query'][_0x2c0e('0xc2')]}:undefined,'required':_0x727762[_0x2c0e('0x39')]['tag']?!![]:![]}];}return contacts[_0x2c0e('0x3f')](_0x727762[_0x2c0e('0x39')],_0x727762[_0x2c0e('0x21')],_0xed8651,_0x5b3e2f);})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x5a32c1,_0xed8651))[_0x2c0e('0x4a')](APIHandleError(_0x5a32c1));};exports['getQueues']=function(_0x5223c6,_0x37ffed){var _0x1a950e;var _0x3936aa={};var _0x59ecc3;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x5223c6['params']['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c')]})[_0x2c0e('0x1b')](handleEntityNotFound(_0x37ffed,null))[_0x2c0e('0x1b')](function(_0x5b9fd0){if(!utils[_0x2c0e('0x96')](_0x5223c6[_0x2c0e('0x39')]['channel'])){throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))](_0x2c0e('0x97'));}_0x1a950e=_0x5b9fd0;var _0x51e695={};_0x51e695[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_['capitalize'](_0x5223c6['query'][_0x2c0e('0xa2')])+_0x2c0e('0xc5')][_0x2c0e('0x2e')]);_0x51e695[_0x2c0e('0x39')]=_['keys'](_0x5223c6[_0x2c0e('0x39')]);_0x51e695[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x51e695[_0x2c0e('0xc3')],_0x51e695[_0x2c0e('0x39')]);_0x3936aa[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x51e695[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x3936aa[_0x2c0e('0x3e')]=_0x3936aa[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x3936aa[_0x2c0e('0x3e')]:_0x51e695[_0x2c0e('0xc3')];_0x3936aa[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x3936aa[_0x2c0e('0x38')]=qs['filters'](_[_0x2c0e('0xcb')](_0x5223c6['query'],_0x51e695[_0x2c0e('0xc6')]));if(_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x3936aa[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x3936aa[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x3936aa[_0x2c0e('0x3e')],function(_0x23aedc){var _0x12e7c4={};_0x12e7c4[_0x23aedc]={'$like':'%'+_0x5223c6['query'][_0x2c0e('0xcc')]+'%'};return _0x12e7c4;})});}_0x3936aa=_['merge']({},_0x3936aa,_0x5223c6[_0x2c0e('0xcd')]);switch(_0x1a950e[_0x2c0e('0x1c')]){case'admin':return db[_[_0x2c0e('0x98')](_0x5223c6[_0x2c0e('0x39')]['channel'])+_0x2c0e('0xc5')][_0x2c0e('0x3f')](_0x3936aa);case'user':case _0x2c0e('0x23'):return _0x1a950e['get'+_['capitalize'](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xa2')])+_0x2c0e('0x9a')](_0x3936aa);default:throw new db[(_0x2c0e('0x86'))][(_0x2c0e('0x87'))]('Unknown\x20role');}})[_0x2c0e('0x1b')](function(_0x5c0b90){_0x59ecc3=_0x5c0b90[_0x2c0e('0x41')];if(!_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x3936aa[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x5223c6['query'][_0x2c0e('0xcf')]);_0x3936aa[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x5223c6[_0x2c0e('0x39')]['offset']);}switch(_0x1a950e[_0x2c0e('0x1c')]){case _0x2c0e('0x1f'):return db[_[_0x2c0e('0x98')](_0x5223c6['query']['channel'])+_0x2c0e('0xc5')]['findAll'](_0x3936aa);case _0x2c0e('0x21'):case _0x2c0e('0x23'):return _0x1a950e[_0x2c0e('0x1e')+_['capitalize'](_0x5223c6[_0x2c0e('0x39')][_0x2c0e('0xa2')])+'Queues'](_0x3936aa);}})[_0x2c0e('0x1b')](function(_0x43cff5){return{'count':_0x59ecc3,'rows':_0x43cff5};})[_0x2c0e('0x1b')](respondWithResult(_0x37ffed,null))[_0x2c0e('0x4a')](handleError(_0x37ffed,null));};exports[_0x2c0e('0xd0')]=function(_0xe8d0f0,_0x519c26){var _0x56b8fb={};var _0x410716={};var _0x5f5b55;var _0x581018;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0xe8d0f0['params']['id']}})['then'](handleEntityNotFound(_0x519c26,null))[_0x2c0e('0x1b')](function(_0x1b8aea){if(_0x1b8aea){_0x5f5b55=_0x1b8aea;_0x410716[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0x9f')]['rawAttributes']);_0x410716[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0xe8d0f0[_0x2c0e('0x39')]);_0x410716['filters']=_[_0x2c0e('0xc7')](_0x410716[_0x2c0e('0xc3')],_0x410716[_0x2c0e('0x39')]);_0x56b8fb['attributes']=_[_0x2c0e('0xc7')](_0x410716[_0x2c0e('0xc3')],qs['fields'](_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x56b8fb['attributes']=_0x56b8fb[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x56b8fb['attributes']:_0x410716[_0x2c0e('0xc3')];_0x56b8fb[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0xe8d0f0[_0x2c0e('0x39')]['sort']);_0x56b8fb[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0xe8d0f0[_0x2c0e('0x39')],_0x410716[_0x2c0e('0xc6')]));if(_0xe8d0f0['query']['filter']){_0x56b8fb[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x56b8fb[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x56b8fb[_0x2c0e('0x3e')],function(_0x2c8f78){var _0x574a1e={};_0x574a1e[_0x2c8f78]={'$like':'%'+_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x574a1e;})});}_0x56b8fb=_[_0x2c0e('0x4e')]({},_0x56b8fb,_0xe8d0f0[_0x2c0e('0xcd')]);return _0x5f5b55[_0x2c0e('0xd0')](_0x56b8fb);}})[_0x2c0e('0x1b')](function(_0x563bea){if(_0x563bea){_0x581018=_0x563bea[_0x2c0e('0x41')];if(!_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x56b8fb[_0x2c0e('0xcf')]=qs['limit'](_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x56b8fb['offset']=qs[_0x2c0e('0x16')](_0xe8d0f0[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x5f5b55[_0x2c0e('0xd0')](_0x56b8fb);}})['then'](function(_0x51f82f){if(_0x51f82f){return _0x51f82f?{'count':_0x581018,'rows':_0x51f82f}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x519c26,null))[_0x2c0e('0x4a')](handleError(_0x519c26,null));};exports[_0x2c0e('0xd1')]=function(_0x3b7752,_0x439ed8){var _0x553afd={};var _0x1a93aa={};var _0x2191fd;var _0x390e47;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x3b7752[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x439ed8,null))[_0x2c0e('0x1b')](function(_0x3ebdff){if(_0x3ebdff){_0x2191fd=_0x3ebdff;_0x1a93aa[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['ChatGroup'][_0x2c0e('0x2e')]);_0x1a93aa['query']=_[_0x2c0e('0xc4')](_0x3b7752[_0x2c0e('0x39')]);_0x1a93aa['filters']=_[_0x2c0e('0xc7')](_0x1a93aa[_0x2c0e('0xc3')],_0x1a93aa[_0x2c0e('0x39')]);_0x553afd['attributes']=_[_0x2c0e('0xc7')](_0x1a93aa[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x3b7752[_0x2c0e('0x39')]['fields']));_0x553afd['attributes']=_0x553afd[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x553afd[_0x2c0e('0x3e')]:_0x1a93aa[_0x2c0e('0xc3')];_0x553afd[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x3b7752['query']['sort']);_0x553afd[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_['pick'](_0x3b7752[_0x2c0e('0x39')],_0x1a93aa[_0x2c0e('0xc6')]));if(_0x3b7752['query'][_0x2c0e('0xcc')]){_0x553afd[_0x2c0e('0x38')]=_['merge'](_0x553afd['where'],{'$or':_[_0x2c0e('0x2f')](_0x553afd[_0x2c0e('0x3e')],function(_0x455143){var _0x39a833={};_0x39a833[_0x455143]={'$like':'%'+_0x3b7752[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x39a833;})});}_0x553afd=_[_0x2c0e('0x4e')]({},_0x553afd,_0x3b7752[_0x2c0e('0xcd')]);return _0x2191fd[_0x2c0e('0xd1')](_0x553afd);}})['then'](function(_0x3ce2c2){if(_0x3ce2c2){_0x390e47=_0x3ce2c2[_0x2c0e('0x41')];if(!_0x3b7752[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x553afd['limit']=qs[_0x2c0e('0xcf')](_0x3b7752['query'][_0x2c0e('0xcf')]);_0x553afd['offset']=qs[_0x2c0e('0x16')](_0x3b7752[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x2191fd[_0x2c0e('0xd1')](_0x553afd);}})['then'](function(_0x3fef8f){if(_0x3fef8f){return _0x3fef8f?{'count':_0x390e47,'rows':_0x3fef8f}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x439ed8,null))[_0x2c0e('0x4a')](handleError(_0x439ed8,null));};exports['getRecordings']=function(_0x74512c,_0x3b2efb){var _0xbd2ab8={'raw':!![],'where':{}};var _0x5b5547={};var _0x252900={'count':0x0,'rows':[]};return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x74512c[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x3b2efb,null))['then'](function(_0x3ff4a3){if(_0x3ff4a3){_0x5b5547[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['VoiceRecording'][_0x2c0e('0x2e')]);_0x5b5547['query']=_[_0x2c0e('0xc4')](_0x74512c[_0x2c0e('0x39')]);_0x5b5547[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x5b5547[_0x2c0e('0xc3')],_0x5b5547['query']);_0xbd2ab8[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5b5547[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0xbd2ab8[_0x2c0e('0x3e')]=_0xbd2ab8[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0xbd2ab8['attributes']:_0x5b5547[_0x2c0e('0xc3')];if(!_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0xbd2ab8[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0xbd2ab8[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0xbd2ab8['order']=qs[_0x2c0e('0xca')](_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0xbd2ab8[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x74512c[_0x2c0e('0x39')],_0x5b5547[_0x2c0e('0xc6')]));_0xbd2ab8[_0x2c0e('0x38')][_0x2c0e('0xd2')]=_0x3ff4a3['id'];if(_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0xbd2ab8['where']=_[_0x2c0e('0x4e')](_0xbd2ab8[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0xbd2ab8['attributes'],function(_0x65fbcc){var _0x2ed9db={};_0x2ed9db[_0x65fbcc]={'$like':'%'+_0x74512c[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x2ed9db;})});}_0xbd2ab8=_[_0x2c0e('0x4e')]({},_0xbd2ab8,_0x74512c['options']);return db['VoiceRecording'][_0x2c0e('0x18')]({'where':_0xbd2ab8[_0x2c0e('0x38')]})['then'](function(_0x2a3a08){_0x252900[_0x2c0e('0x18')]=_0x2a3a08;if(_0x74512c['query'][_0x2c0e('0x3a')]){_0xbd2ab8[_0x2c0e('0x4d')]=[{'all':!![]}];}return db['VoiceRecording'][_0x2c0e('0x3f')](_0xbd2ab8);})['then'](function(_0x5cb9f0){_0x252900['rows']=_0x5cb9f0;return _0x252900;});}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x3b2efb,_0xbd2ab8))[_0x2c0e('0x4a')](handleError(_0x3b2efb,null));};exports[_0x2c0e('0xd3')]=function(_0x1df857,_0x1288b6){var _0xbdf08d={'raw':!![],'where':{}};var _0x5e4916={};var _0x3f702c={'count':0x0,'rows':[]};return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x1df857[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x1288b6,null))[_0x2c0e('0x1b')](function(_0x5cfbbd){if(_0x5cfbbd){_0x5e4916[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0xd4')]['rawAttributes']);_0x5e4916[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x1df857[_0x2c0e('0x39')]);_0x5e4916['filters']=_['intersection'](_0x5e4916[_0x2c0e('0xc3')],_0x5e4916[_0x2c0e('0x39')]);_0xbdf08d['attributes']=_['intersection'](_0x5e4916['model'],qs[_0x2c0e('0xc8')](_0x1df857['query']['fields']));_0xbdf08d[_0x2c0e('0x3e')]=_0xbdf08d[_0x2c0e('0x3e')]['length']?_0xbdf08d['attributes']:_0x5e4916[_0x2c0e('0xc3')];if(!_0x1df857[_0x2c0e('0x39')]['hasOwnProperty']('nolimit')){_0xbdf08d[_0x2c0e('0xcf')]=qs['limit'](_0x1df857[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0xbdf08d['offset']=qs[_0x2c0e('0x16')](_0x1df857[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0xbdf08d[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x1df857[_0x2c0e('0x39')]['sort']);_0xbdf08d[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_['pick'](_0x1df857[_0x2c0e('0x39')],_0x5e4916[_0x2c0e('0xc6')]));_0xbdf08d[_0x2c0e('0x38')][_0x2c0e('0xd2')]=_0x5cfbbd['id'];if(_0x1df857[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0xbdf08d[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0xbdf08d[_0x2c0e('0x38')],{'$or':_['map'](_0xbdf08d[_0x2c0e('0x3e')],function(_0x360cf3){var _0x3e992e={};_0x3e992e[_0x360cf3]={'$like':'%'+_0x1df857['query'][_0x2c0e('0xcc')]+'%'};return _0x3e992e;})});}_0xbdf08d=_[_0x2c0e('0x4e')]({},_0xbdf08d,_0x1df857['options']);return db[_0x2c0e('0xd4')][_0x2c0e('0x18')]({'where':_0xbdf08d['where']})['then'](function(_0x278c01){_0x3f702c[_0x2c0e('0x18')]=_0x278c01;if(_0x1df857[_0x2c0e('0x39')]['includeAll']){_0xbdf08d[_0x2c0e('0x4d')]=[{'all':!![]}];}return db[_0x2c0e('0xd4')][_0x2c0e('0x3f')](_0xbdf08d);})['then'](function(_0x15d85c){_0x3f702c['rows']=_0x15d85c;return _0x3f702c;});}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x1288b6,_0xbdf08d))[_0x2c0e('0x4a')](handleError(_0x1288b6,null));};exports[_0x2c0e('0xd5')]=function(_0xd6005e,_0x216ca6){var _0x2aad69={};var _0x480499={};var _0x2cec7d;var _0x2625a2;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0xd6005e[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x216ca6,null))[_0x2c0e('0x1b')](function(_0x27a594){if(_0x27a594){_0x2cec7d=_0x27a594;_0x480499['model']=_[_0x2c0e('0xc4')](db['ChatInteraction']['rawAttributes']);_0x480499['query']=_['keys'](_0xd6005e[_0x2c0e('0x39')]);_0x480499[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x480499[_0x2c0e('0xc3')],_0x480499[_0x2c0e('0x39')]);_0x2aad69[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x480499[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x2aad69['attributes']=_0x2aad69[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x2aad69['attributes']:_0x480499['model'];_0x2aad69[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x2aad69['where']=qs[_0x2c0e('0xc6')](_['pick'](_0xd6005e[_0x2c0e('0x39')],_0x480499['filters']));if(_0xd6005e[_0x2c0e('0x39')]['filter']){_0x2aad69['where']=_[_0x2c0e('0x4e')](_0x2aad69[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x2aad69[_0x2c0e('0x3e')],function(_0x5669b8){var _0x2a6fbb={};_0x2a6fbb[_0x5669b8]={'$like':'%'+_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x2a6fbb;})});}_0x2aad69=_[_0x2c0e('0x4e')]({},_0x2aad69,_0xd6005e['options']);return _0x2cec7d[_0x2c0e('0xd5')](_0x2aad69);}})[_0x2c0e('0x1b')](function(_0x51c7b0){if(_0x51c7b0){_0x2625a2=_0x51c7b0[_0x2c0e('0x41')];if(!_0xd6005e[_0x2c0e('0x39')]['hasOwnProperty'](_0x2c0e('0xce'))){_0x2aad69[_0x2c0e('0xcf')]=qs['limit'](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x2aad69['offset']=qs[_0x2c0e('0x16')](_0xd6005e[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x2cec7d[_0x2c0e('0xd5')](_0x2aad69);}})[_0x2c0e('0x1b')](function(_0xdf306f){if(_0xdf306f){return _0xdf306f?{'count':_0x2625a2,'rows':_0xdf306f}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x216ca6,null))['catch'](handleError(_0x216ca6,null));};exports[_0x2c0e('0xd6')]=function(_0x2d77b2,_0x482cb8){var _0x172557={};var _0x5b75bb={};var _0x2de70f;var _0x19b9bb;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x2d77b2[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x482cb8,null))[_0x2c0e('0x1b')](function(_0x5d7871){if(_0x5d7871){_0x2de70f=_0x5d7871;_0x5b75bb['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x5b75bb[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x2d77b2[_0x2c0e('0x39')]);_0x5b75bb['filters']=_[_0x2c0e('0xc7')](_0x5b75bb[_0x2c0e('0xc3')],_0x5b75bb[_0x2c0e('0x39')]);_0x172557[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5b75bb[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x172557['attributes']=_0x172557['attributes'][_0x2c0e('0x41')]?_0x172557[_0x2c0e('0x3e')]:_0x5b75bb['model'];_0x172557[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x2d77b2[_0x2c0e('0x39')]['sort']);_0x172557['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x2d77b2[_0x2c0e('0x39')],_0x5b75bb[_0x2c0e('0xc6')]));if(_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x172557[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x172557[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x172557[_0x2c0e('0x3e')],function(_0x5af14c){var _0x3bcde={};_0x3bcde[_0x5af14c]={'$like':'%'+_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x3bcde;})});}_0x172557=_['merge']({},_0x172557,_0x2d77b2[_0x2c0e('0xcd')]);return _0x2de70f[_0x2c0e('0xd6')](_0x172557);}})[_0x2c0e('0x1b')](function(_0x20dd54){if(_0x20dd54){_0x19b9bb=_0x20dd54[_0x2c0e('0x41')];if(!_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x172557[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x172557['offset']=qs['offset'](_0x2d77b2[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x2de70f[_0x2c0e('0xd6')](_0x172557);}})[_0x2c0e('0x1b')](function(_0x33c924){if(_0x33c924){return _0x33c924?{'count':_0x19b9bb,'rows':_0x33c924}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x482cb8,null))[_0x2c0e('0x4a')](handleError(_0x482cb8,null));};exports['getMailInteractions']=function(_0x590a7b,_0x1938d7){var _0x4fb5ef={'raw':!![],'where':{}};var _0x53cd0c={};var _0x2739a7={'count':0x0,'rows':[]};return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x590a7b[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x1938d7,null))[_0x2c0e('0x1b')](function(_0x24709a){if(_0x24709a){_0x53cd0c['model']=_['keys'](db[_0x2c0e('0xd7')][_0x2c0e('0x2e')]);_0x53cd0c[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x590a7b['query']);_0x53cd0c['filters']=_[_0x2c0e('0xc7')](_0x53cd0c[_0x2c0e('0xc3')],_0x53cd0c[_0x2c0e('0x39')]);_0x4fb5ef[_0x2c0e('0x3e')]=_['intersection'](_0x53cd0c[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x4fb5ef[_0x2c0e('0x3e')]=_0x4fb5ef[_0x2c0e('0x3e')]['length']?_0x4fb5ef[_0x2c0e('0x3e')]:_0x53cd0c[_0x2c0e('0xc3')];if(!_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x4fb5ef[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x4fb5ef[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0x4fb5ef[_0x2c0e('0xc9')]=qs['sort'](_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x4fb5ef[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x590a7b[_0x2c0e('0x39')],_0x53cd0c['filters']));_0x4fb5ef[_0x2c0e('0x38')]['UserId']=_0x24709a['id'];if(_0x590a7b[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x4fb5ef['where']=_[_0x2c0e('0x4e')](_0x4fb5ef[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x4fb5ef[_0x2c0e('0x3e')],function(_0x5a90ad){var _0x50ed09={};_0x50ed09[_0x5a90ad]={'$like':'%'+_0x590a7b[_0x2c0e('0x39')]['filter']+'%'};return _0x50ed09;})});}_0x4fb5ef=_[_0x2c0e('0x4e')]({},_0x4fb5ef,_0x590a7b[_0x2c0e('0xcd')]);return db['MailInteraction']['count']({'where':_0x4fb5ef['where']})[_0x2c0e('0x1b')](function(_0x2992ca){_0x2739a7[_0x2c0e('0x18')]=_0x2992ca;if(_0x590a7b['query']['includeAll']){_0x4fb5ef[_0x2c0e('0x4d')]=[{'all':!![]}];}return db[_0x2c0e('0xd7')][_0x2c0e('0x3f')](_0x4fb5ef);})[_0x2c0e('0x1b')](function(_0x10c32f){_0x2739a7[_0x2c0e('0x40')]=_0x10c32f;return _0x2739a7;});}})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x1938d7,_0x4fb5ef))[_0x2c0e('0x4a')](handleError(_0x1938d7,null));};exports[_0x2c0e('0xd8')]=function(_0x26d121,_0x512225){var _0x37bf34={};var _0x21e477={};var _0xb91f9e;var _0x5ea2c7;return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x26d121[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x512225,null))[_0x2c0e('0x1b')](function(_0x4ab4b6){if(_0x4ab4b6){_0xb91f9e=_0x4ab4b6;_0x21e477[_0x2c0e('0xc3')]=_['keys'](db['SmsInteraction'][_0x2c0e('0x2e')]);_0x21e477['query']=_['keys'](_0x26d121['query']);_0x21e477[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x21e477[_0x2c0e('0xc3')],_0x21e477[_0x2c0e('0x39')]);_0x37bf34[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x21e477[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x26d121['query'][_0x2c0e('0xc8')]));_0x37bf34[_0x2c0e('0x3e')]=_0x37bf34[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x37bf34[_0x2c0e('0x3e')]:_0x21e477[_0x2c0e('0xc3')];_0x37bf34[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x37bf34['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x26d121[_0x2c0e('0x39')],_0x21e477[_0x2c0e('0xc6')]));if(_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x37bf34['where']=_[_0x2c0e('0x4e')](_0x37bf34[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x37bf34[_0x2c0e('0x3e')],function(_0x3a1a51){var _0x129813={};_0x129813[_0x3a1a51]={'$like':'%'+_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x129813;})});}_0x37bf34=_[_0x2c0e('0x4e')]({},_0x37bf34,_0x26d121[_0x2c0e('0xcd')]);return _0xb91f9e[_0x2c0e('0xd8')](_0x37bf34);}})[_0x2c0e('0x1b')](function(_0x4a7291){if(_0x4a7291){_0x5ea2c7=_0x4a7291[_0x2c0e('0x41')];if(!_0x26d121['query'][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x37bf34[_0x2c0e('0xcf')]=qs['limit'](_0x26d121[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x37bf34[_0x2c0e('0x16')]=qs['offset'](_0x26d121['query'][_0x2c0e('0x16')]);}return _0xb91f9e[_0x2c0e('0xd8')](_0x37bf34);}})['then'](function(_0x1df349){if(_0x1df349){return _0x1df349?{'count':_0x5ea2c7,'rows':_0x1df349}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x512225,null))[_0x2c0e('0x4a')](handleError(_0x512225,null));};exports[_0x2c0e('0xd9')]=function(_0x3ace83,_0x249313){var _0x5943a2={};var _0x5e4e5f={};var _0x31414c;var _0x12a47b;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x3ace83[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x249313,null))[_0x2c0e('0x1b')](function(_0x330b3c){if(_0x330b3c){_0x31414c=_0x330b3c;_0x5e4e5f[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0xda')][_0x2c0e('0x2e')]);_0x5e4e5f[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x3ace83[_0x2c0e('0x39')]);_0x5e4e5f[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x5e4e5f[_0x2c0e('0xc3')],_0x5e4e5f[_0x2c0e('0x39')]);_0x5943a2[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5e4e5f[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x3ace83[_0x2c0e('0x39')]['fields']));_0x5943a2[_0x2c0e('0x3e')]=_0x5943a2['attributes'][_0x2c0e('0x41')]?_0x5943a2[_0x2c0e('0x3e')]:_0x5e4e5f[_0x2c0e('0xc3')];_0x5943a2[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x3ace83[_0x2c0e('0x39')]['sort']);_0x5943a2[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x3ace83[_0x2c0e('0x39')],_0x5e4e5f[_0x2c0e('0xc6')]));if(_0x3ace83[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x5943a2['where']=_[_0x2c0e('0x4e')](_0x5943a2[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x5943a2[_0x2c0e('0x3e')],function(_0x302153){var _0x4ba8d0={};_0x4ba8d0[_0x302153]={'$like':'%'+_0x3ace83[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x4ba8d0;})});}_0x5943a2=_[_0x2c0e('0x4e')]({},_0x5943a2,_0x3ace83['options']);return _0x31414c[_0x2c0e('0xd9')](_0x5943a2);}})[_0x2c0e('0x1b')](function(_0x2ed1d2){if(_0x2ed1d2){_0x12a47b=_0x2ed1d2[_0x2c0e('0x41')];if(!_0x3ace83['query'][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x5943a2[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x3ace83['query']['limit']);_0x5943a2[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x3ace83[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x31414c[_0x2c0e('0xd9')](_0x5943a2);}})[_0x2c0e('0x1b')](function(_0x576330){if(_0x576330){return _0x576330?{'count':_0x12a47b,'rows':_0x576330}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x249313,null))[_0x2c0e('0x4a')](handleError(_0x249313,null));};exports[_0x2c0e('0xdb')]=function(_0x54d0b2,_0x180286){var _0x20045c={};var _0x35d087={};var _0x4192d5;var _0x3349dd;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x54d0b2[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x180286,null))[_0x2c0e('0x1b')](function(_0x2f84ba){if(_0x2f84ba){_0x4192d5=_0x2f84ba;_0x35d087[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['WhatsappInteraction'][_0x2c0e('0x2e')]);_0x35d087[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x54d0b2['query']);_0x35d087[_0x2c0e('0xc6')]=_['intersection'](_0x35d087[_0x2c0e('0xc3')],_0x35d087['query']);_0x20045c[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x35d087['model'],qs[_0x2c0e('0xc8')](_0x54d0b2[_0x2c0e('0x39')]['fields']));_0x20045c['attributes']=_0x20045c[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x20045c[_0x2c0e('0x3e')]:_0x35d087[_0x2c0e('0xc3')];_0x20045c[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x20045c['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x54d0b2[_0x2c0e('0x39')],_0x35d087['filters']));if(_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x20045c[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x20045c[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x20045c[_0x2c0e('0x3e')],function(_0x19cd72){var _0x140f6e={};_0x140f6e[_0x19cd72]={'$like':'%'+_0x54d0b2['query'][_0x2c0e('0xcc')]+'%'};return _0x140f6e;})});}_0x20045c=_[_0x2c0e('0x4e')]({},_0x20045c,_0x54d0b2[_0x2c0e('0xcd')]);return _0x4192d5[_0x2c0e('0xdb')](_0x20045c);}})[_0x2c0e('0x1b')](function(_0x23539b){if(_0x23539b){_0x3349dd=_0x23539b[_0x2c0e('0x41')];if(!_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xbd')]('nolimit')){_0x20045c[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x54d0b2[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x20045c['offset']=qs['offset'](_0x54d0b2['query']['offset']);}return _0x4192d5[_0x2c0e('0xdb')](_0x20045c);}})[_0x2c0e('0x1b')](function(_0x40bc32){if(_0x40bc32){return _0x40bc32?{'count':_0x3349dd,'rows':_0x40bc32}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x180286,null))[_0x2c0e('0x4a')](handleError(_0x180286,null));};exports[_0x2c0e('0xdc')]=function(_0x40f745,_0xea2938,_0x3a1d1a){var _0x5cd3b8;var _0x61ead5;var _0x1e01c2;var _0x596b05=!_['isNil'](_0x40f745[_0x2c0e('0x4c')]['id'])?_0x40f745[_0x2c0e('0x4c')]['id']:!_[_0x2c0e('0x5c')](_0x40f745[_0x2c0e('0x21')]['id'])?_0x40f745[_0x2c0e('0x21')]['id']:null;return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x596b05,'role':{'$or':[_0x2c0e('0x1f'),_0x2c0e('0x21'),_0x2c0e('0x23')]}},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0xdd'),'mobile',_0x2c0e('0x1c'),_0x2c0e('0x56'),_0x2c0e('0x93')]})[_0x2c0e('0x1b')](function(_0x794a67){if(_0x794a67){if(_0x794a67[_0x2c0e('0x1c')]===_0x2c0e('0x23')){_0x5cd3b8=_0x794a67;if(_0x40f745[_0x2c0e('0x51')][_0x2c0e('0x95')]){_0x1e01c2=util[_0x2c0e('0xbb')]('LOCAL/%s@from-sip/n',_0x5cd3b8[_0x40f745[_0x2c0e('0x51')][_0x2c0e('0x95')]]);}else if(_0x40f745[_0x2c0e('0x51')][_0x2c0e('0xde')]){_0x1e01c2=util['format'](_0x2c0e('0xdf'),_0x40f745[_0x2c0e('0x51')][_0x2c0e('0xde')]);}else{_0x1e01c2=util[_0x2c0e('0xbb')]('SIP/%s',_0x5cd3b8[_0x2c0e('0x36')]);}socket['to'](util['format'](_0x2c0e('0xe0'),_0x5cd3b8['name']))[_0x2c0e('0x1d')](_0x2c0e('0xe1'),{'user':{'id':_0x5cd3b8['id'],'name':_0x5cd3b8['name']},'ip':_0x40f745[_0x2c0e('0xe2')][_0x2c0e('0xe3')]||_0x40f745[_0x2c0e('0xe4')][_0x2c0e('0xe5')]||_0x40f745[_0x2c0e('0xe6')]['remoteAddress']||_0x40f745['connection']['socket'][_0x2c0e('0xe5')]});return db[_0x2c0e('0x9f')][_0x2c0e('0x2a')]({'where':{'membername':_0x5cd3b8[_0x2c0e('0x36')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x2c0e('0x87'))](_0x2c0e('0xe7'));}})[_0x2c0e('0x1b')](function(){if(_0x5cd3b8){return _0x5cd3b8[_0x2c0e('0xe8')]({'raw':!![]});}})[_0x2c0e('0x1b')](function(_0x251674){if(_0x5cd3b8){if(_0x251674){_0x61ead5=_0x251674;if(_0x61ead5[_0x2c0e('0x41')]){var _0xef791f=_0x61ead5[_0x2c0e('0x2f')](function(_0x33e976){var _0x5be9c8={'membername':_0x5cd3b8['name'],'UserId':_0x5cd3b8['id'],'queue_name':_0x33e976['name'],'VoiceQueueId':_0x33e976['id'],'interface':_0x1e01c2,'paused':_0x5cd3b8[_0x2c0e('0x93')]||![],'penalty':_0x33e976[_0x2c0e('0xe9')]||0x0};return db[_0x2c0e('0x9f')][_0x2c0e('0xa0')](_0x5be9c8);});return Promise[_0x2c0e('0x49')](_0xef791f);}}}})['then'](function(){if(_0x5cd3b8){return db[_0x2c0e('0xea')][_0x2c0e('0x3f')]({'where':{'membername':_0x5cd3b8[_0x2c0e('0x36')],'exitAt':null}});}})[_0x2c0e('0x1b')](function(_0x41a864){if(_0x5cd3b8){var _0x545f55=[];_0x41a864[_0x2c0e('0xeb')](function(_0x2ce9c2){_0x545f55[_0x2c0e('0x42')](_0x2ce9c2[_0x2c0e('0x50')]({'exitAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec'))}));});return Promise[_0x2c0e('0x49')](_0x545f55);}})['then'](function(){if(_0x5cd3b8){var _0x53a63c=[];var _0x3584d0=[];var _0x4fb950=utils['getChannels']();var _0x321ac5={'membername':_0x5cd3b8[_0x2c0e('0x36')],'interface':_0x1e01c2,'enterAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec')),'role':_0x5cd3b8[_0x2c0e('0x1c')],'internal':_0x5cd3b8[_0x2c0e('0x56')]};_0x4fb950[_0x2c0e('0xeb')](function(_0x540954){_0x53a63c['push'](_[_0x2c0e('0x4e')]({'channel':_0x540954,'type':_0x2c0e('0xed'),'data1':_0x40f745[_0x2c0e('0x51')][_0x2c0e('0xee')],'data2':_0x1e01c2},_0x321ac5));if(_0x5cd3b8[_0x2c0e('0x93')]){_0x3584d0['push'](_[_0x2c0e('0x4e')]({'channel':_0x540954,'type':'PAUSE','data1':_0x2c0e('0xef')},_0x321ac5));}});return db['MemberReport'][_0x2c0e('0x7e')](_0x53a63c[_0x2c0e('0xb9')](_0x3584d0),{'individualHooks':!![]});}})['then'](function(){if(_0x5cd3b8){return _0x5cd3b8[_0x2c0e('0x50')]({'online':!![],'lastLoginAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec')),'voicePause':_0x5cd3b8[_0x2c0e('0x93')]||![],'mailPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'chatPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'faxPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'smsPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'openchannelPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'whatsappPause':_0x5cd3b8[_0x2c0e('0x93')]||![],'pauseType':_0x5cd3b8['loginInPause']?_0x2c0e('0xef'):null,'interface':_0x1e01c2,'lastPauseAt':moment()[_0x2c0e('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x2c0e('0x1b')](function(_0x10bdf6){if(_0x40f745[_0x2c0e('0xf0')]){return _0x3a1d1a();}else{return Promise['resolve'](_0x10bdf6)[_0x2c0e('0x1b')](respondWithResult(_0xea2938,null));}})[_0x2c0e('0x4a')](handleError(_0xea2938,null));};exports['logout']=function(_0x3a4049,_0x29c778){var _0x1a8953;return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x3a4049[_0x2c0e('0x4c')]['id'],'role':_0x2c0e('0x23')},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c')]})['then'](handleEntityNotFound(_0x29c778,null))[_0x2c0e('0x1b')](function(_0x18eb19){if(_0x18eb19){_0x1a8953=_0x18eb19;return db[_0x2c0e('0x9f')]['destroy']({'where':{'membername':_0x1a8953[_0x2c0e('0x36')]},'individualHooks':!![]});}})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0xea')][_0x2c0e('0x3f')]({'where':{'membername':_0x1a8953[_0x2c0e('0x36')],'exitAt':null}});})[_0x2c0e('0x1b')](function(_0x5b5659){var _0x213e00=[];_0x5b5659[_0x2c0e('0xeb')](function(_0x1c1312){_0x213e00[_0x2c0e('0x42')](_0x1c1312['update']({'exitAt':moment()[_0x2c0e('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x2c0e('0x49')](_0x213e00);})[_0x2c0e('0x1b')](function(){return _0x1a8953[_0x2c0e('0x50')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2c0e('0x1b')](respondWithResult(_0x29c778,null))[_0x2c0e('0x4a')](handleError(_0x29c778,null));};exports[_0x2c0e('0xf1')]=function(_0x2907b5,_0x4d1efa){var _0x467de2;return db[_0x2c0e('0x9f')]['update']({'paused':0x1},{'where':{'UserId':_0x2907b5[_0x2c0e('0x4c')]['id']},'individualHooks':!![]})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x2907b5[_0x2c0e('0x4c')]['id'],'role':'agent'},'attributes':['id','name',_0x2c0e('0x1c'),_0x2c0e('0x56'),'interface',_0x2c0e('0x92')]});})['then'](handleEntityNotFound(_0x4d1efa,null))[_0x2c0e('0x1b')](function(_0x2a7a8f){if(_0x2a7a8f){_0x467de2=_0x2a7a8f;return db[_0x2c0e('0xea')]['findAll']({'where':{'membername':_0x467de2['name'],'type':'PAUSE','exitAt':null}});}})[_0x2c0e('0x1b')](function(_0x54569b){if(_0x54569b['length']){var _0x53ffb1=moment()[_0x2c0e('0xbb')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4d3b90=0x0,_0x4eea84=_0x54569b[_0x2c0e('0x41')];_0x4d3b90<_0x4eea84;_0x4d3b90++){_0x54569b[_0x4d3b90]['updateAttributes']({'exitAt':_0x53ffb1});}}})[_0x2c0e('0x1b')](function(){var _0x15be18=[];var _0x49c09b=utils[_0x2c0e('0xf2')]();_0x49c09b[_0x2c0e('0xeb')](function(_0x5dd2be){_0x15be18['push']({'channel':_0x5dd2be,'membername':_0x467de2[_0x2c0e('0x36')],'interface':_[_0x2c0e('0x5c')](_0x467de2[_0x2c0e('0x95')])?util['format']('SIP/%s',_0x467de2[_0x2c0e('0x36')]):_0x467de2['interface'],'type':_0x2c0e('0xf3'),'enterAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec')),'data1':_0x2907b5[_0x2c0e('0x51')]['type']||'DEFAULT\x20PAUSE','role':_0x467de2[_0x2c0e('0x1c')],'internal':_0x467de2[_0x2c0e('0x56')]});});return db[_0x2c0e('0xea')][_0x2c0e('0x7e')](_0x15be18,{'individualHooks':!![]});})['then'](function(){return _0x467de2[_0x2c0e('0x50')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2907b5[_0x2c0e('0x51')][_0x2c0e('0xf4')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x2c0e('0xbb')](_0x2c0e('0xec'))});})[_0x2c0e('0x1b')](respondWithResult(_0x4d1efa,null))[_0x2c0e('0x4a')](handleError(_0x4d1efa,null));};exports[_0x2c0e('0xf5')]=function(_0x4e2ad1,_0x59f3f9){if(_0x4e2ad1[_0x2c0e('0x51')]['channel']&&!utils[_0x2c0e('0x96')](_0x4e2ad1[_0x2c0e('0x51')]['channel'])){throw new APIBadRequestError(util[_0x2c0e('0xbb')](_0x2c0e('0xf6'),_0x4e2ad1[_0x2c0e('0x51')]['channel']));}return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x4e2ad1[_0x2c0e('0x4c')]['id']},'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x1c'),_0x2c0e('0x56'),_0x2c0e('0x95'),_0x2c0e('0x92'),'voicePause','mailPause',_0x2c0e('0xf7'),_0x2c0e('0xf8'),_0x2c0e('0xf9'),'smsPause','whatsappPause',_0x2c0e('0xfa'),_0x2c0e('0xfb')]})[_0x2c0e('0x1b')](function(_0x372eff){if(!_0x372eff){throw new APINotFoundError(util[_0x2c0e('0xbb')](_0x2c0e('0xbc'),_0x4e2ad1['params']['id']));}return _0x372eff[_0x2c0e('0xf5')](_0x4e2ad1[_0x2c0e('0x51')]['channel']);})[_0x2c0e('0x1b')](respondWithResult(_0x59f3f9,null))[_0x2c0e('0x4a')](APIHandleError(_0x59f3f9));};exports[_0x2c0e('0xfc')]=function(_0x5d455c,_0x54162a){var _0x345f06={};var _0x2ff509={};var _0x2133fb;var _0x1d38a9;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x5d455c[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54162a,null))[_0x2c0e('0x1b')](function(_0x5bd5e0){if(_0x5bd5e0){_0x2133fb=_0x5bd5e0;_0x2ff509[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0xfd')][_0x2c0e('0x2e')]);_0x2ff509[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x5d455c[_0x2c0e('0x39')]);_0x2ff509[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x2ff509['model'],_0x2ff509[_0x2c0e('0x39')]);_0x345f06[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x2ff509[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x345f06['attributes']=_0x345f06[_0x2c0e('0x3e')]['length']?_0x345f06[_0x2c0e('0x3e')]:_0x2ff509[_0x2c0e('0xc3')];_0x345f06[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x345f06[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x5d455c[_0x2c0e('0x39')],_0x2ff509[_0x2c0e('0xc6')]));if(_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x345f06[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x345f06['where'],{'$or':_[_0x2c0e('0x2f')](_0x345f06[_0x2c0e('0x3e')],function(_0x26f63d){var _0x382083={};_0x382083[_0x26f63d]={'$like':'%'+_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x382083;})});}_0x345f06=_[_0x2c0e('0x4e')]({},_0x345f06,_0x5d455c[_0x2c0e('0xcd')]);return _0x2133fb['getTeams'](_0x345f06);}})[_0x2c0e('0x1b')](function(_0x327864){if(_0x327864){_0x1d38a9=_0x327864[_0x2c0e('0x41')];if(!_0x5d455c[_0x2c0e('0x39')]['hasOwnProperty'](_0x2c0e('0xce'))){_0x345f06[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x5d455c[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x345f06[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x5d455c['query'][_0x2c0e('0x16')]);}return _0x2133fb[_0x2c0e('0xfc')](_0x345f06);}})['then'](function(_0x24c949){if(_0x24c949){return _0x24c949?{'count':_0x1d38a9,'rows':_0x24c949}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x54162a,null))[_0x2c0e('0x4a')](handleError(_0x54162a,null));};exports[_0x2c0e('0xfe')]=function(_0x43d2a4,_0x48d1ce){var _0x3ede0d=_0x43d2a4['params']['id'];var _0x1f8bfe=_0x43d2a4[_0x2c0e('0x51')]?_0x43d2a4[_0x2c0e('0x51')]['ids']:null;var _0x4c2082=[];return Promise['resolve']()[_0x2c0e('0x1b')](function(){if(!_0x1f8bfe)throw new APIBadRequestError(_0x2c0e('0xff'));})[_0x2c0e('0x1b')](function(){return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x3ede0d}});})[_0x2c0e('0x1b')](function(_0x426080){if(!_0x426080)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x43d2a4[_0x2c0e('0x4c')]['id']));return db[_0x2c0e('0x100')]['transaction'](function(_0x759f25){return _0x426080['addTeams'](_0x1f8bfe,{'transaction':_0x759f25})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0xfd')][_0x2c0e('0x3f')]({'where':{'id':{'$in':_0x1f8bfe}}});})[_0x2c0e('0x1b')](function(_0x43cd8b){var _0x520e9e=_[_0x2c0e('0x2f')](_0x43cd8b,function(_0x267fd2){return _0x267fd2[_0x2c0e('0x101')]();});return Promise[_0x2c0e('0x49')](_0x520e9e);})['then'](function(_0x59ce88){_0x4c2082=_[_0x2c0e('0x102')](_0x59ce88);var _0x4dfc8c=_[_0x2c0e('0x2f')](_0x4c2082,function(_0x16102d){return _0x16102d['addAgent'](_0x426080['id'],{'transaction':_0x759f25});});return Promise[_0x2c0e('0x49')](_0x4dfc8c);})[_0x2c0e('0x1b')](function(){if(!_0x426080['online'])return;var _0x445ee1=_['filter'](_0x4c2082,function(_0x2aa459){return _0x2aa459[_0x2c0e('0x103')](_0x2c0e('0xa2'))===_0x2c0e('0x104');});var _0x96a3b0=_[_0x2c0e('0x2f')](_0x445ee1,function(_0x5526b4){return db['UserVoiceQueueRt'][_0x2c0e('0xa0')]({'membername':_0x426080[_0x2c0e('0x36')],'UserId':_0x426080['id'],'queue_name':_0x5526b4[_0x2c0e('0x36')],'VoiceQueueId':_0x5526b4['id'],'interface':_[_0x2c0e('0x5c')](_0x426080['interface'])?util[_0x2c0e('0xbb')](_0x2c0e('0xdf'),_0x426080[_0x2c0e('0x36')]):_0x426080[_0x2c0e('0x95')],'paused':_0x426080[_0x2c0e('0x94')]||![],'penalty':_0x426080['penalty']},{'transaction':_0x759f25});});return Promise[_0x2c0e('0x49')](_0x96a3b0);})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x105')][_0x2c0e('0x3f')]({'where':{'teamId':{'$in':_0x1f8bfe}}});})['then'](function(_0x367975){var _0xe2233d=_[_0x2c0e('0x2f')](_0x367975,function(_0x23eceb){return db[_0x2c0e('0x106')][_0x2c0e('0x79')]({'UserId':_0x426080['id'],'VoicePrefixId':_0x23eceb[_0x2c0e('0x107')]},{'transaction':_0x759f25});});return Promise['all'](_0xe2233d);});});})[_0x2c0e('0x1b')](function(){for(var _0xd90961=0x0;_0xd90961<_0x4c2082[_0x2c0e('0x41')];_0xd90961++){var _0x23bb51=_0x4c2082[_0xd90961][_0x2c0e('0x103')]('channel');var _0x4305d6=_0x23bb51+_0x2c0e('0x108');socket[_0x2c0e('0x1d')]('user'+_0x23bb51+_0x2c0e('0x9d'),{'UserId':_0x3ede0d,['queueField']:_0x4c2082[_0xd90961]['id']});}})['then'](respondWithStatusCode(_0x48d1ce,null))['catch'](APIHandleError(_0x48d1ce));};exports[_0x2c0e('0x109')]=function(_0x4da0a7,_0x8658df){var _0x2f8ca3=_0x4da0a7[_0x2c0e('0x4c')]['id'];var _0x23ccb1=null;if(_0x4da0a7['query'][_0x2c0e('0x54')]){_0x23ccb1=_['isArray'](_0x4da0a7[_0x2c0e('0x39')][_0x2c0e('0x54')])?_0x4da0a7['query']['ids']:[_0x4da0a7[_0x2c0e('0x39')]['ids']];}var _0x205558=[];return Promise[_0x2c0e('0x10a')]()[_0x2c0e('0x1b')](function(){if(!_0x23ccb1)throw new APIBadRequestError(_0x2c0e('0x10b'));})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x2f8ca3}});})[_0x2c0e('0x1b')](function(_0x3f288a){if(!_0x3f288a)throw new APINotFoundError(util['format'](_0x2c0e('0xbc'),_0x4da0a7['params']['id']));return db[_0x2c0e('0x100')][_0x2c0e('0x10c')](function(_0x185246){return _0x3f288a['removeTeams'](_0x23ccb1,{'transaction':_0x185246})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0xfd')][_0x2c0e('0x3f')]({'where':{'id':{'$in':_0x23ccb1}}});})[_0x2c0e('0x1b')](function(_0x56e937){var _0x1ba57a=_['map'](_0x56e937,function(_0x32e774){return _0x32e774[_0x2c0e('0x101')]();});return Promise[_0x2c0e('0x49')](_0x1ba57a);})[_0x2c0e('0x1b')](function(_0x89e705){_0x205558=_[_0x2c0e('0x102')](_0x89e705);var _0xb093be=_[_0x2c0e('0x2f')](_0x205558,function(_0x27d1f7){return _0x27d1f7[_0x2c0e('0x10d')](_0x3f288a['id'],{'transaction':_0x185246});});return Promise[_0x2c0e('0x49')](_0xb093be);})['then'](function(){if(!_0x3f288a[_0x2c0e('0x92')])return;var _0x546b12=_[_0x2c0e('0xcc')](_0x205558,function(_0x54b447){return _0x54b447[_0x2c0e('0x103')](_0x2c0e('0xa2'))===_0x2c0e('0x104');});var _0x438f95=_[_0x2c0e('0x2f')](_0x546b12,function(_0x533f94){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x533f94['id'],'UserId':_0x3f288a['id']},'transaction':_0x185246});});return Promise[_0x2c0e('0x49')](_0x438f95);})[_0x2c0e('0x1b')](function(){return db[_0x2c0e('0x105')]['findAll']({'where':{'teamId':{'$in':_0x23ccb1}}});})['then'](function(_0x220b1c){var _0x58528c=_[_0x2c0e('0x2f')](_0x220b1c,function(_0x56ddb7){return db[_0x2c0e('0x106')]['destroy']({'where':{'UserId':_0x3f288a['id'],'VoicePrefixId':_0x56ddb7['VoicePrefixId']}},{'transaction':_0x185246});});return Promise[_0x2c0e('0x49')](_0x58528c);});});})[_0x2c0e('0x1b')](function(){for(var _0x54489e=0x0;_0x54489e<_0x205558['length'];_0x54489e++){var _0x2149c3=_0x205558[_0x54489e][_0x2c0e('0x103')](_0x2c0e('0xa2'));var _0x5ebefe=_0x2149c3+_0x2c0e('0x108');socket[_0x2c0e('0x1d')](_0x2c0e('0x21')+_0x2149c3+'Queue:remove',{'UserId':_0x2f8ca3,['queueField']:_0x205558[_0x54489e]['id']});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x8658df,null))[_0x2c0e('0x4a')](APIHandleError(_0x8658df));};exports[_0x2c0e('0x10e')]=function(_0x3991df,_0xb697d7){var _0x66d1ee={};var _0xf90fba={};var _0x5a857f;var _0x33378c;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x3991df['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0xb697d7,null))['then'](function(_0x1384d7){if(_0x1384d7){_0x5a857f=_0x1384d7;_0xf90fba[_0x2c0e('0xc3')]=_['keys'](db[_0x2c0e('0xbe')][_0x2c0e('0x2e')]);_0xf90fba[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x3991df['query']);_0xf90fba[_0x2c0e('0xc6')]=_['intersection'](_0xf90fba[_0x2c0e('0xc3')],_0xf90fba['query']);_0x66d1ee['attributes']=_[_0x2c0e('0xc7')](_0xf90fba['model'],qs['fields'](_0x3991df[_0x2c0e('0x39')]['fields']));_0x66d1ee[_0x2c0e('0x3e')]=_0x66d1ee['attributes'][_0x2c0e('0x41')]?_0x66d1ee[_0x2c0e('0x3e')]:_0xf90fba[_0x2c0e('0xc3')];_0x66d1ee[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x3991df['query'][_0x2c0e('0xca')]);_0x66d1ee[_0x2c0e('0x38')]=qs['filters'](_['pick'](_0x3991df[_0x2c0e('0x39')],_0xf90fba[_0x2c0e('0xc6')]));if(_0x3991df['query']['filter']){_0x66d1ee[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x66d1ee[_0x2c0e('0x38')],{'$or':_['map'](_0x66d1ee[_0x2c0e('0x3e')],function(_0xc26fb1){var _0x24cb49={};_0x24cb49[_0xc26fb1]={'$like':'%'+_0x3991df[_0x2c0e('0x39')]['filter']+'%'};return _0x24cb49;})});}_0x66d1ee=_[_0x2c0e('0x4e')]({},_0x66d1ee,_0x3991df['options']);return _0x5a857f['getLists'](_0x66d1ee);}})[_0x2c0e('0x1b')](function(_0x5c89f3){if(_0x5c89f3){_0x33378c=_0x5c89f3['length'];if(!_0x3991df[_0x2c0e('0x39')]['hasOwnProperty']('nolimit')){_0x66d1ee[_0x2c0e('0xcf')]=qs['limit'](_0x3991df[_0x2c0e('0x39')]['limit']);_0x66d1ee[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x3991df[_0x2c0e('0x39')]['offset']);}return _0x5a857f[_0x2c0e('0x10e')](_0x66d1ee);}})[_0x2c0e('0x1b')](function(_0x51ca8e){if(_0x51ca8e){return _0x51ca8e?{'count':_0x33378c,'rows':_0x51ca8e}:null;}})['then'](respondWithResult(_0xb697d7,null))['catch'](handleError(_0xb697d7,null));};exports['getAgents']=function(_0x36ca94,_0x5ea195){var _0x5f5148={};var _0x5e52ad={};var _0x31f3bd;return db['User'][_0x2c0e('0x8c')]({'where':{'id':_0x36ca94['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5ea195,null))['then'](function(_0x196013){if(_0x196013){_0x31f3bd=_0x196013;_0x5e52ad['model']=_[_0x2c0e('0xc4')](db[_0x2c0e('0x2d')][_0x2c0e('0x2e')]);_0x5e52ad[_0x2c0e('0x39')]=_['keys'](_0x36ca94['query']);_0x5e52ad['filters']=_['intersection'](_0x5e52ad[_0x2c0e('0xc3')],_0x5e52ad['query']);_0x5f5148[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x5e52ad['model'],qs[_0x2c0e('0xc8')](_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x5f5148[_0x2c0e('0x3e')]=_0x5f5148['attributes'][_0x2c0e('0x41')]?_0x5f5148['attributes']:_0x5e52ad[_0x2c0e('0xc3')];_0x5f5148[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x36ca94[_0x2c0e('0x39')]['sort']);_0x5f5148[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x36ca94['query'],_0x5e52ad[_0x2c0e('0xc6')]));if(_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x5f5148[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x5f5148[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x5f5148[_0x2c0e('0x3e')],function(_0x41112f){var _0x40631e={};_0x40631e[_0x41112f]={'$like':'%'+_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x40631e;})});}_0x5f5148[_0x2c0e('0xc3')]=db['User'];_0x5f5148['as']=_0x2c0e('0x22');_0x5f5148=_[_0x2c0e('0x4e')]({},_0x5f5148,_0x36ca94[_0x2c0e('0xcd')]);return _0x31f3bd[_0x2c0e('0xe8')]({'include':[_0x5f5148]});}})[_0x2c0e('0x1b')](function(_0x463df){if(_0x463df){var _0x4ba87f={},_0x3faaca=[];for(var _0x50b568=0x0;_0x50b568<_0x463df[_0x2c0e('0x41')];_0x50b568+=0x1){for(var _0x2e4951=0x0,_0x2d021b;_0x2e4951<_0x463df[_0x50b568][_0x2c0e('0x22')][_0x2c0e('0x41')];_0x2e4951+=0x1){_0x2d021b=_0x463df[_0x50b568][_0x2c0e('0x22')][_0x2e4951][_0x2c0e('0x1e')]({'plain':!![]});_0x4ba87f[_0x2d021b['id']]=_0x2d021b;}}_0x4ba87f=_[_0x2c0e('0x10f')](_0x4ba87f);for(var _0x3030ff=qs[_0x2c0e('0x16')](_0x36ca94[_0x2c0e('0x39')][_0x2c0e('0x16')]);_0x3030ff<_0x4ba87f['length']&&_0x3faaca[_0x2c0e('0x41')]<qs[_0x2c0e('0xcf')](_0x36ca94['query']['limit']);_0x3030ff+=0x1){if(_0x4ba87f[_0x3030ff]){_0x3faaca[_0x2c0e('0x42')](_0x4ba87f[_0x3030ff]);}}return{'count':_0x4ba87f['length'],'rows':_0x3faaca};}})['then'](respondWithResult(_0x5ea195,null))['catch'](handleError(_0x5ea195,null));};exports['destroy']=function(_0x5bddd5,_0x5edfa9){if(_0x5bddd5[_0x2c0e('0x21')]['id']==_0x5bddd5[_0x2c0e('0x4c')]['id']){return _0x5edfa9['status'](0x1f4)[_0x2c0e('0x110')]({'message':_0x2c0e('0x111')});}return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x5bddd5[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5edfa9,null))[_0x2c0e('0x1b')](removeEntity(_0x5edfa9,null))['catch'](handleError(_0x5edfa9,null));};exports['addChatInteractions']=function(_0x1a71a2,_0x367078){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x1a71a2['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x367078,null))[_0x2c0e('0x1b')](function(_0x454eb9){if(_0x454eb9){return _0x454eb9[_0x2c0e('0x112')](_0x1a71a2['body']['ids'],_[_0x2c0e('0x55')](_0x1a71a2[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{})[_0x2c0e('0x9c')](function(){for(var _0x4479a2=0x0;_0x4479a2<_0x1a71a2[_0x2c0e('0x51')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x4479a2+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x113'),{'ChatInteractionId':Number(_0x1a71a2[_0x2c0e('0x51')][_0x2c0e('0x54')][_0x4479a2]),'UserId':Number(_0x1a71a2[_0x2c0e('0x4c')]['id'])});}return _0x1a71a2[_0x2c0e('0x51')][_0x2c0e('0x54')];});}})['then'](respondWithResult(_0x367078,null))['catch'](handleError(_0x367078,null));};exports[_0x2c0e('0x114')]=function(_0x46dd98,_0x328931){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x46dd98['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x328931,null))[_0x2c0e('0x1b')](function(_0x12e755){if(_0x12e755){return _0x12e755[_0x2c0e('0x114')](_0x46dd98[_0x2c0e('0x39')][_0x2c0e('0x54')])[_0x2c0e('0x1b')](function(){if(_[_0x2c0e('0x115')](_0x46dd98[_0x2c0e('0x39')][_0x2c0e('0x54')])){for(var _0x559f45=0x0;_0x559f45<_0x46dd98[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x559f45+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x116'),{'ChatInteractionId':Number(_0x46dd98['query'][_0x2c0e('0x54')][_0x559f45]),'UserId':Number(_0x46dd98[_0x2c0e('0x4c')]['id'])});}}else{socket[_0x2c0e('0x1d')](_0x2c0e('0x116'),{'ChatInteractionId':Number(_0x46dd98[_0x2c0e('0x39')][_0x2c0e('0x54')]),'UserId':Number(_0x46dd98['params']['id'])});}});}})['then'](respondWithStatusCode(_0x328931,null))[_0x2c0e('0x4a')](handleError(_0x328931,null));};exports[_0x2c0e('0x117')]=function(_0x2f6e9a,_0x57e6d5){return db['User']['find']({'where':{'id':_0x2f6e9a[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x57e6d5,null))[_0x2c0e('0x1b')](function(_0x46cc40){if(_0x46cc40){return _0x46cc40[_0x2c0e('0x117')](_0x2f6e9a[_0x2c0e('0x51')][_0x2c0e('0x54')],_['omit'](_0x2f6e9a[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{})[_0x2c0e('0x9c')](function(){for(var _0x360af8=0x0;_0x360af8<_0x2f6e9a['body'][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x360af8+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x118'),{'MailInteractionId':Number(_0x2f6e9a[_0x2c0e('0x51')]['ids'][_0x360af8]),'UserId':Number(_0x2f6e9a['params']['id'])});}return _0x2f6e9a['body'][_0x2c0e('0x54')];});}})[_0x2c0e('0x1b')](respondWithResult(_0x57e6d5,null))[_0x2c0e('0x4a')](handleError(_0x57e6d5,null));};exports['removeMailInteractions']=function(_0x4a27e0,_0x2b235c){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x4a27e0[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x2b235c,null))[_0x2c0e('0x1b')](function(_0x2954f3){if(_0x2954f3){return _0x2954f3['removeMailInteractions'](_0x4a27e0[_0x2c0e('0x39')][_0x2c0e('0x54')])[_0x2c0e('0x1b')](function(){if(_[_0x2c0e('0x115')](_0x4a27e0[_0x2c0e('0x39')]['ids'])){for(var _0x4aac5e=0x0;_0x4aac5e<_0x4a27e0[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x4aac5e+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x119'),{'MailInteractionId':Number(_0x4a27e0[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x4aac5e]),'UserId':Number(_0x4a27e0[_0x2c0e('0x4c')]['id'])});}}else{socket[_0x2c0e('0x1d')](_0x2c0e('0x119'),{'MailInteractionId':Number(_0x4a27e0['query']['ids']),'UserId':Number(_0x4a27e0[_0x2c0e('0x4c')]['id'])});}});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x2b235c,null))[_0x2c0e('0x4a')](handleError(_0x2b235c,null));};exports[_0x2c0e('0x11a')]=function(_0x2feff2,_0x1fbec8){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x2feff2[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x1fbec8,null))[_0x2c0e('0x1b')](function(_0x48e7b3){if(_0x48e7b3){return _0x48e7b3[_0x2c0e('0x11a')](_0x2feff2['body'][_0x2c0e('0x54')],_['omit'](_0x2feff2[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{})[_0x2c0e('0x9c')](function(){for(var _0x3fdd75=0x0;_0x3fdd75<_0x2feff2['body'][_0x2c0e('0x54')]['length'];_0x3fdd75+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x11b'),{'FaxInteractionId':Number(_0x2feff2[_0x2c0e('0x51')]['ids'][_0x3fdd75]),'UserId':Number(_0x2feff2[_0x2c0e('0x4c')]['id'])});}return _0x2feff2['body'][_0x2c0e('0x54')];});}})[_0x2c0e('0x1b')](respondWithResult(_0x1fbec8,null))[_0x2c0e('0x4a')](handleError(_0x1fbec8,null));};exports['removeFaxInteractions']=function(_0x17553b,_0x5482a9){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x17553b[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5482a9,null))[_0x2c0e('0x1b')](function(_0x484042){if(_0x484042){return _0x484042[_0x2c0e('0x11c')](_0x17553b[_0x2c0e('0x39')][_0x2c0e('0x54')])[_0x2c0e('0x1b')](function(){if(_[_0x2c0e('0x115')](_0x17553b['query'][_0x2c0e('0x54')])){for(var _0x3b9f04=0x0;_0x3b9f04<_0x17553b[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x3b9f04+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x11d'),{'FaxInteractionId':Number(_0x17553b[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x3b9f04]),'UserId':Number(_0x17553b['params']['id'])});}}else{socket[_0x2c0e('0x1d')](_0x2c0e('0x11d'),{'FaxInteractionId':Number(_0x17553b[_0x2c0e('0x39')][_0x2c0e('0x54')]),'UserId':Number(_0x17553b[_0x2c0e('0x4c')]['id'])});}});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x5482a9,null))[_0x2c0e('0x4a')](handleError(_0x5482a9,null));};exports[_0x2c0e('0x11e')]=function(_0xd2848c,_0xa6c992){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0xd2848c[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0xa6c992,null))['then'](function(_0x122d02){if(_0x122d02){return _0x122d02[_0x2c0e('0x11e')](_0xd2848c['body']['ids'],_[_0x2c0e('0x55')](_0xd2848c[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{})[_0x2c0e('0x9c')](function(){for(var _0x48da81=0x0;_0x48da81<_0xd2848c['body'][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x48da81+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x11f'),{'SmsInteractionId':Number(_0xd2848c['body']['ids'][_0x48da81]),'UserId':Number(_0xd2848c['params']['id'])});}return _0xd2848c[_0x2c0e('0x51')][_0x2c0e('0x54')];});}})[_0x2c0e('0x1b')](respondWithResult(_0xa6c992,null))[_0x2c0e('0x4a')](handleError(_0xa6c992,null));};exports[_0x2c0e('0x120')]=function(_0x147a56,_0x256fd4){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x147a56[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x256fd4,null))[_0x2c0e('0x1b')](function(_0x5afd88){if(_0x5afd88){return _0x5afd88['removeSmsInteractions'](_0x147a56['query'][_0x2c0e('0x54')])[_0x2c0e('0x1b')](function(){if(_['isArray'](_0x147a56['query'][_0x2c0e('0x54')])){for(var _0xaff2ff=0x0;_0xaff2ff<_0x147a56[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0xaff2ff+=0x1){socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x147a56[_0x2c0e('0x39')][_0x2c0e('0x54')][_0xaff2ff]),'UserId':Number(_0x147a56[_0x2c0e('0x4c')]['id'])});}}else{socket[_0x2c0e('0x1d')](_0x2c0e('0x121'),{'SmsInteractionId':Number(_0x147a56[_0x2c0e('0x39')][_0x2c0e('0x54')]),'UserId':Number(_0x147a56[_0x2c0e('0x4c')]['id'])});}});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x256fd4,null))['catch'](handleError(_0x256fd4,null));};exports[_0x2c0e('0x122')]=function(_0x22c7d0,_0x20325c){return db[_0x2c0e('0x2d')]['find']({'where':{'id':_0x22c7d0[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x20325c,null))[_0x2c0e('0x1b')](function(_0x2268cc){if(_0x2268cc){return _0x2268cc[_0x2c0e('0x122')](_0x22c7d0['body'][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x22c7d0[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{})['spread'](function(){for(var _0x1b97cd=0x0;_0x1b97cd<_0x22c7d0[_0x2c0e('0x51')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x1b97cd+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x123'),{'OpenchannelInteractionId':Number(_0x22c7d0[_0x2c0e('0x51')][_0x2c0e('0x54')][_0x1b97cd]),'UserId':Number(_0x22c7d0['params']['id'])});}return _0x22c7d0[_0x2c0e('0x51')][_0x2c0e('0x54')];});}})['then'](respondWithResult(_0x20325c,null))['catch'](handleError(_0x20325c,null));};exports[_0x2c0e('0x124')]=function(_0x2ffd75,_0x313488){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x2ffd75['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x313488,null))[_0x2c0e('0x1b')](function(_0x3fa65b){if(_0x3fa65b){return _0x3fa65b[_0x2c0e('0x124')](_0x2ffd75[_0x2c0e('0x39')][_0x2c0e('0x54')])[_0x2c0e('0x1b')](function(){if(_[_0x2c0e('0x115')](_0x2ffd75[_0x2c0e('0x39')]['ids'])){for(var _0x10e1ab=0x0;_0x10e1ab<_0x2ffd75['query'][_0x2c0e('0x54')]['length'];_0x10e1ab+=0x1){socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2ffd75[_0x2c0e('0x39')][_0x2c0e('0x54')][_0x10e1ab]),'UserId':Number(_0x2ffd75['params']['id'])});}}else{socket[_0x2c0e('0x1d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2ffd75['query'][_0x2c0e('0x54')]),'UserId':Number(_0x2ffd75[_0x2c0e('0x4c')]['id'])});}});}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x313488,null))['catch'](handleError(_0x313488,null));};exports['addWhatsappInteractions']=function(_0x7f96db,_0x273cd0){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x7f96db[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x273cd0,null))[_0x2c0e('0x1b')](function(_0x31cf9b){if(_0x31cf9b){return _0x31cf9b[_0x2c0e('0x125')](_0x7f96db[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x7f96db['body'],[_0x2c0e('0x54'),'id'])||{})[_0x2c0e('0x9c')](function(){for(var _0x38561c=0x0;_0x38561c<_0x7f96db[_0x2c0e('0x51')][_0x2c0e('0x54')][_0x2c0e('0x41')];_0x38561c+=0x1){socket[_0x2c0e('0x1d')](_0x2c0e('0x126'),{'WhatsappInteractionId':Number(_0x7f96db[_0x2c0e('0x51')]['ids'][_0x38561c]),'UserId':Number(_0x7f96db['params']['id'])});}return _0x7f96db[_0x2c0e('0x51')][_0x2c0e('0x54')];});}})[_0x2c0e('0x1b')](respondWithResult(_0x273cd0,null))[_0x2c0e('0x4a')](handleError(_0x273cd0,null));};exports[_0x2c0e('0x127')]=function(_0x48b79d,_0x523f10){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x48b79d[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x523f10,null))['then'](function(_0x5518d7){if(_0x5518d7){return _0x5518d7[_0x2c0e('0x127')](_0x48b79d[_0x2c0e('0x39')][_0x2c0e('0x54')]);}})['then'](respondWithStatusCode(_0x523f10,null))[_0x2c0e('0x4a')](handleError(_0x523f10,null));};exports['getVoicePrefixes']=function(_0x186ed2,_0x2f368f){var _0x3f6985={};var _0x48caab={};var _0x221516;var _0x1d56ed;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x186ed2['params']['id']}})['then'](handleEntityNotFound(_0x2f368f,null))[_0x2c0e('0x1b')](function(_0x2fbeba){if(_0x2fbeba){_0x221516=_0x2fbeba;_0x48caab[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0x128')][_0x2c0e('0x2e')]);_0x48caab[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x186ed2[_0x2c0e('0x39')]);_0x48caab[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x48caab[_0x2c0e('0xc3')],_0x48caab[_0x2c0e('0x39')]);_0x3f6985['attributes']=_[_0x2c0e('0xc7')](_0x48caab[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x186ed2[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x3f6985[_0x2c0e('0x3e')]=_0x3f6985['attributes']['length']?_0x3f6985['attributes']:_0x48caab[_0x2c0e('0xc3')];_0x3f6985[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x186ed2[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x3f6985[_0x2c0e('0x38')]=qs['filters'](_['pick'](_0x186ed2[_0x2c0e('0x39')],_0x48caab[_0x2c0e('0xc6')]));if(_0x186ed2['query'][_0x2c0e('0xcc')]){_0x3f6985['where']=_[_0x2c0e('0x4e')](_0x3f6985[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x3f6985['attributes'],function(_0x437544){var _0x20ec52={};_0x20ec52[_0x437544]={'$like':'%'+_0x186ed2[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x20ec52;})});}_0x3f6985=_[_0x2c0e('0x4e')]({},_0x3f6985,_0x186ed2[_0x2c0e('0xcd')]);return _0x221516[_0x2c0e('0x129')](_0x3f6985);}})['then'](function(_0xdbddc3){if(_0xdbddc3){_0x1d56ed=_0xdbddc3[_0x2c0e('0x41')];if(!_0x186ed2['query']['hasOwnProperty']('nolimit')){_0x3f6985['limit']=qs[_0x2c0e('0xcf')](_0x186ed2[_0x2c0e('0x39')]['limit']);_0x3f6985[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x186ed2[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x221516[_0x2c0e('0x129')](_0x3f6985);}})['then'](function(_0x56cebf){if(_0x56cebf){return _0x56cebf?{'count':_0x1d56ed,'rows':_0x56cebf}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x2f368f,null))[_0x2c0e('0x4a')](handleError(_0x2f368f,null));};exports[_0x2c0e('0x12a')]=function(_0x4ae577,_0x3fccc5){var _0x45e8c4={};var _0x245989={};var _0x477dbf;var _0xc1e953;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x4ae577['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x3fccc5,null))['then'](function(_0x22981e){if(_0x22981e){_0x477dbf=_0x22981e;_0x245989['model']=_[_0x2c0e('0xc4')](db[_0x2c0e('0x12b')]['rawAttributes']);_0x245989[_0x2c0e('0x39')]=_['keys'](_0x4ae577['query']);_0x245989[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x245989[_0x2c0e('0xc3')],_0x245989['query']);_0x45e8c4[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x245989[_0x2c0e('0xc3')],qs['fields'](_0x4ae577['query'][_0x2c0e('0xc8')]));_0x45e8c4[_0x2c0e('0x3e')]=_0x45e8c4[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x45e8c4[_0x2c0e('0x3e')]:_0x245989[_0x2c0e('0xc3')];_0x45e8c4[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x4ae577[_0x2c0e('0x39')]['sort']);_0x45e8c4[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x4ae577[_0x2c0e('0x39')],_0x245989['filters']));if(_0x4ae577['query']['filter']){_0x45e8c4[_0x2c0e('0x38')]=_['merge'](_0x45e8c4['where'],{'$or':_[_0x2c0e('0x2f')](_0x45e8c4[_0x2c0e('0x3e')],function(_0x3bf9f1){var _0x26d956={};_0x26d956[_0x3bf9f1]={'$like':'%'+_0x4ae577[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x26d956;})});}_0x45e8c4=_[_0x2c0e('0x4e')]({},_0x45e8c4,_0x4ae577[_0x2c0e('0xcd')]);return _0x477dbf[_0x2c0e('0x12a')](_0x45e8c4);}})[_0x2c0e('0x1b')](function(_0x21cbae){if(_0x21cbae){_0xc1e953=_0x21cbae[_0x2c0e('0x41')];if(!_0x4ae577['query'][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x45e8c4['limit']=qs['limit'](_0x4ae577[_0x2c0e('0x39')]['limit']);_0x45e8c4[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x4ae577[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x477dbf['getFaxAccounts'](_0x45e8c4);}})['then'](function(_0x485f91){if(_0x485f91){return _0x485f91?{'count':_0xc1e953,'rows':_0x485f91}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x3fccc5,null))[_0x2c0e('0x4a')](handleError(_0x3fccc5,null));};exports[_0x2c0e('0x12c')]=function(_0x34367f,_0x3d92cd){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x34367f['params']['id']}})['then'](handleEntityNotFound(_0x3d92cd,null))[_0x2c0e('0x1b')](function(_0x12a51b){if(_0x12a51b){return _0x12a51b['addFaxAccounts'](_0x34367f[_0x2c0e('0x51')]['ids'],_[_0x2c0e('0x55')](_0x34367f['body'],['ids','id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x3d92cd,null))[_0x2c0e('0x4a')](handleError(_0x3d92cd,null));};exports['removeFaxAccounts']=function(_0x2c40a6,_0x3fe4ea){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x2c40a6['params']['id']}})['then'](handleEntityNotFound(_0x3fe4ea,null))[_0x2c0e('0x1b')](function(_0x2874e5){if(_0x2874e5){return _0x2874e5['removeFaxAccounts'](_0x2c40a6['query']['ids']);}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x3fe4ea,null))[_0x2c0e('0x4a')](handleError(_0x3fe4ea,null));};exports[_0x2c0e('0x12d')]=function(_0x568e3c,_0x6eada5){var _0x46eb0f={};var _0x19660a={};var _0x3db7a2;var _0x2ef0f2;return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x568e3c[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x6eada5,null))['then'](function(_0x3c5d73){if(_0x3c5d73){_0x3db7a2=_0x3c5d73;_0x19660a[_0x2c0e('0xc3')]=_['keys'](db[_0x2c0e('0x12e')][_0x2c0e('0x2e')]);_0x19660a[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x568e3c['query']);_0x19660a[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x19660a[_0x2c0e('0xc3')],_0x19660a[_0x2c0e('0x39')]);_0x46eb0f['attributes']=_['intersection'](_0x19660a['model'],qs[_0x2c0e('0xc8')](_0x568e3c[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x46eb0f['attributes']=_0x46eb0f['attributes']['length']?_0x46eb0f[_0x2c0e('0x3e')]:_0x19660a['model'];_0x46eb0f[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x568e3c['query']['sort']);_0x46eb0f['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x568e3c[_0x2c0e('0x39')],_0x19660a['filters']));if(_0x568e3c[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x46eb0f[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x46eb0f[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x46eb0f['attributes'],function(_0x5ce80f){var _0x5e5884={};_0x5e5884[_0x5ce80f]={'$like':'%'+_0x568e3c[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x5e5884;})});}_0x46eb0f=_[_0x2c0e('0x4e')]({},_0x46eb0f,_0x568e3c[_0x2c0e('0xcd')]);return _0x3db7a2[_0x2c0e('0x12d')](_0x46eb0f);}})[_0x2c0e('0x1b')](function(_0x4b91b9){if(_0x4b91b9){_0x2ef0f2=_0x4b91b9[_0x2c0e('0x41')];if(!_0x568e3c[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x46eb0f[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x568e3c['query'][_0x2c0e('0xcf')]);_0x46eb0f[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x568e3c['query'][_0x2c0e('0x16')]);}return _0x3db7a2[_0x2c0e('0x12d')](_0x46eb0f);}})[_0x2c0e('0x1b')](function(_0x54a073){if(_0x54a073){return _0x54a073?{'count':_0x2ef0f2,'rows':_0x54a073}:null;}})['then'](respondWithResult(_0x6eada5,null))[_0x2c0e('0x4a')](handleError(_0x6eada5,null));};exports['addMailAccounts']=function(_0x3afd50,_0x213205){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x3afd50[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x213205,null))[_0x2c0e('0x1b')](function(_0x5c2fe0){if(_0x5c2fe0){return _0x5c2fe0[_0x2c0e('0x12f')](_0x3afd50[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x3afd50[_0x2c0e('0x51')],['ids','id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x213205,null))[_0x2c0e('0x4a')](handleError(_0x213205,null));};exports[_0x2c0e('0x130')]=function(_0x23e2b3,_0x5ce468){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x23e2b3[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x5ce468,null))['then'](function(_0x2c16ce){if(_0x2c16ce){return _0x2c16ce[_0x2c0e('0x130')](_0x23e2b3['query']['ids']);}})['then'](respondWithStatusCode(_0x5ce468,null))['catch'](handleError(_0x5ce468,null));};exports[_0x2c0e('0x131')]=function(_0x38f6f8,_0x4dc36c){var _0xe51b8e={};var _0x44bbc9={};var _0x2f6e8c;var _0x4ff5ca;return db[_0x2c0e('0x2d')][_0x2c0e('0x8c')]({'where':{'id':_0x38f6f8['params']['id']}})['then'](handleEntityNotFound(_0x4dc36c,null))['then'](function(_0x59176d){if(_0x59176d){_0x2f6e8c=_0x59176d;_0x44bbc9[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db['OpenchannelAccount']['rawAttributes']);_0x44bbc9['query']=_[_0x2c0e('0xc4')](_0x38f6f8[_0x2c0e('0x39')]);_0x44bbc9['filters']=_['intersection'](_0x44bbc9[_0x2c0e('0xc3')],_0x44bbc9[_0x2c0e('0x39')]);_0xe51b8e[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x44bbc9['model'],qs[_0x2c0e('0xc8')](_0x38f6f8[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0xe51b8e['attributes']=_0xe51b8e['attributes'][_0x2c0e('0x41')]?_0xe51b8e['attributes']:_0x44bbc9[_0x2c0e('0xc3')];_0xe51b8e[_0x2c0e('0xc9')]=qs['sort'](_0x38f6f8[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0xe51b8e[_0x2c0e('0x38')]=qs['filters'](_['pick'](_0x38f6f8['query'],_0x44bbc9[_0x2c0e('0xc6')]));if(_0x38f6f8[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0xe51b8e[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0xe51b8e[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0xe51b8e[_0x2c0e('0x3e')],function(_0x17eaaa){var _0x102631={};_0x102631[_0x17eaaa]={'$like':'%'+_0x38f6f8[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x102631;})});}_0xe51b8e=_[_0x2c0e('0x4e')]({},_0xe51b8e,_0x38f6f8[_0x2c0e('0xcd')]);return _0x2f6e8c[_0x2c0e('0x131')](_0xe51b8e);}})[_0x2c0e('0x1b')](function(_0x160f71){if(_0x160f71){_0x4ff5ca=_0x160f71[_0x2c0e('0x41')];if(!_0x38f6f8[_0x2c0e('0x39')]['hasOwnProperty'](_0x2c0e('0xce'))){_0xe51b8e['limit']=qs['limit'](_0x38f6f8['query'][_0x2c0e('0xcf')]);_0xe51b8e['offset']=qs[_0x2c0e('0x16')](_0x38f6f8[_0x2c0e('0x39')]['offset']);}return _0x2f6e8c[_0x2c0e('0x131')](_0xe51b8e);}})[_0x2c0e('0x1b')](function(_0x496a6b){if(_0x496a6b){return _0x496a6b?{'count':_0x4ff5ca,'rows':_0x496a6b}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x4dc36c,null))['catch'](handleError(_0x4dc36c,null));};exports[_0x2c0e('0x132')]=function(_0x6fe249,_0x3d2ae9){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x6fe249['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x3d2ae9,null))[_0x2c0e('0x1b')](function(_0x31ca17){if(_0x31ca17){return _0x31ca17[_0x2c0e('0x132')](_0x6fe249[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x6fe249[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x3d2ae9,null))[_0x2c0e('0x4a')](handleError(_0x3d2ae9,null));};exports['removeOpenchannelAccounts']=function(_0x35fd07,_0x83293a){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x35fd07[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x83293a,null))[_0x2c0e('0x1b')](function(_0x2d43d6){if(_0x2d43d6){return _0x2d43d6[_0x2c0e('0x133')](_0x35fd07[_0x2c0e('0x39')][_0x2c0e('0x54')]);}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x83293a,null))['catch'](handleError(_0x83293a,null));};exports[_0x2c0e('0x134')]=function(_0x11ec17,_0x2e67e7){var _0x5b4b77={};var _0x185349={};var _0x5eff5f;var _0x588ad4;return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x11ec17[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x2e67e7,null))['then'](function(_0x379fc3){if(_0x379fc3){_0x5eff5f=_0x379fc3;_0x185349[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0x135')][_0x2c0e('0x2e')]);_0x185349[_0x2c0e('0x39')]=_[_0x2c0e('0xc4')](_0x11ec17['query']);_0x185349[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x185349['model'],_0x185349[_0x2c0e('0x39')]);_0x5b4b77[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x185349[_0x2c0e('0xc3')],qs['fields'](_0x11ec17[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x5b4b77[_0x2c0e('0x3e')]=_0x5b4b77[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x5b4b77[_0x2c0e('0x3e')]:_0x185349[_0x2c0e('0xc3')];_0x5b4b77[_0x2c0e('0xc9')]=qs['sort'](_0x11ec17[_0x2c0e('0x39')]['sort']);_0x5b4b77[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_['pick'](_0x11ec17['query'],_0x185349['filters']));if(_0x11ec17[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x5b4b77['where']=_[_0x2c0e('0x4e')](_0x5b4b77[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x5b4b77[_0x2c0e('0x3e')],function(_0x2fb8c4){var _0x48650c={};_0x48650c[_0x2fb8c4]={'$like':'%'+_0x11ec17[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x48650c;})});}_0x5b4b77=_[_0x2c0e('0x4e')]({},_0x5b4b77,_0x11ec17[_0x2c0e('0xcd')]);return _0x5eff5f['getSmsAccounts'](_0x5b4b77);}})['then'](function(_0x139436){if(_0x139436){_0x588ad4=_0x139436[_0x2c0e('0x41')];if(!_0x11ec17[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x5b4b77[_0x2c0e('0xcf')]=qs[_0x2c0e('0xcf')](_0x11ec17[_0x2c0e('0x39')]['limit']);_0x5b4b77['offset']=qs[_0x2c0e('0x16')](_0x11ec17[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x5eff5f[_0x2c0e('0x134')](_0x5b4b77);}})[_0x2c0e('0x1b')](function(_0x324fb1){if(_0x324fb1){return _0x324fb1?{'count':_0x588ad4,'rows':_0x324fb1}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x2e67e7,null))['catch'](handleError(_0x2e67e7,null));};exports[_0x2c0e('0x136')]=function(_0x1dc96e,_0x446dfc){return db['User'][_0x2c0e('0x29')]({'where':{'id':_0x1dc96e[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x446dfc,null))['then'](function(_0x26c207){if(_0x26c207){return _0x26c207[_0x2c0e('0x136')](_0x1dc96e[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x1dc96e[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x446dfc,null))[_0x2c0e('0x4a')](handleError(_0x446dfc,null));};exports[_0x2c0e('0x137')]=function(_0x249d9a,_0x62993c){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x249d9a[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x62993c,null))['then'](function(_0x30172e){if(_0x30172e){return _0x30172e[_0x2c0e('0x137')](_0x249d9a[_0x2c0e('0x39')][_0x2c0e('0x54')]);}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x62993c,null))[_0x2c0e('0x4a')](handleError(_0x62993c,null));};exports[_0x2c0e('0x138')]=function(_0x50be57,_0x331aa9){var _0x56e92f={};var _0x40b777={};var _0x218682;var _0x299a0a;return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0x50be57[_0x2c0e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x331aa9,null))[_0x2c0e('0x1b')](function(_0x218d42){if(_0x218d42){_0x218682=_0x218d42;_0x40b777[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0x139')][_0x2c0e('0x2e')]);_0x40b777['query']=_['keys'](_0x50be57[_0x2c0e('0x39')]);_0x40b777[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x40b777['model'],_0x40b777[_0x2c0e('0x39')]);_0x56e92f[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x40b777['model'],qs[_0x2c0e('0xc8')](_0x50be57['query'][_0x2c0e('0xc8')]));_0x56e92f[_0x2c0e('0x3e')]=_0x56e92f['attributes']['length']?_0x56e92f['attributes']:_0x40b777[_0x2c0e('0xc3')];_0x56e92f['order']=qs[_0x2c0e('0xca')](_0x50be57[_0x2c0e('0x39')]['sort']);_0x56e92f[_0x2c0e('0x38')]=qs[_0x2c0e('0xc6')](_['pick'](_0x50be57['query'],_0x40b777[_0x2c0e('0xc6')]));if(_0x50be57[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x56e92f[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x56e92f['where'],{'$or':_[_0x2c0e('0x2f')](_0x56e92f[_0x2c0e('0x3e')],function(_0x15d195){var _0x2134d2={};_0x2134d2[_0x15d195]={'$like':'%'+_0x50be57[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x2134d2;})});}_0x56e92f=_['merge']({},_0x56e92f,_0x50be57[_0x2c0e('0xcd')]);return _0x218682[_0x2c0e('0x138')](_0x56e92f);}})[_0x2c0e('0x1b')](function(_0x1bd6b9){if(_0x1bd6b9){_0x299a0a=_0x1bd6b9[_0x2c0e('0x41')];if(!_0x50be57[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x56e92f[_0x2c0e('0xcf')]=qs['limit'](_0x50be57[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x56e92f['offset']=qs[_0x2c0e('0x16')](_0x50be57[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0x218682[_0x2c0e('0x138')](_0x56e92f);}})[_0x2c0e('0x1b')](function(_0x375e61){if(_0x375e61){return _0x375e61?{'count':_0x299a0a,'rows':_0x375e61}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x331aa9,null))[_0x2c0e('0x4a')](handleError(_0x331aa9,null));};exports[_0x2c0e('0x13a')]=function(_0x5bf730,_0x2c3dff){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x5bf730[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x2c3dff,null))['then'](function(_0x5ce6d9){if(_0x5ce6d9){return _0x5ce6d9[_0x2c0e('0x13a')](_0x5bf730[_0x2c0e('0x51')]['ids'],_['omit'](_0x5bf730[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{});}})['then'](respondWithResult(_0x2c3dff,null))['catch'](handleError(_0x2c3dff,null));};exports[_0x2c0e('0x13b')]=function(_0x2554ca,_0x28f3d3){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x2554ca[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x28f3d3,null))['then'](function(_0x36ec17){if(_0x36ec17){return _0x36ec17['removeChatWebsites'](_0x2554ca[_0x2c0e('0x39')]['ids']);}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x28f3d3,null))[_0x2c0e('0x4a')](handleError(_0x28f3d3,null));};exports['getWhatsappAccounts']=function(_0xaf68a,_0x4f9ca2){var _0x25dcbd={};var _0x56d7f2={};var _0xa52baf;var _0x1fafb8;return db[_0x2c0e('0x2d')]['findOne']({'where':{'id':_0xaf68a[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x4f9ca2,null))[_0x2c0e('0x1b')](function(_0x5c9e5b){if(_0x5c9e5b){_0xa52baf=_0x5c9e5b;_0x56d7f2[_0x2c0e('0xc3')]=_[_0x2c0e('0xc4')](db[_0x2c0e('0x13c')][_0x2c0e('0x2e')]);_0x56d7f2[_0x2c0e('0x39')]=_['keys'](_0xaf68a[_0x2c0e('0x39')]);_0x56d7f2[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x56d7f2['model'],_0x56d7f2['query']);_0x25dcbd['attributes']=_[_0x2c0e('0xc7')](_0x56d7f2[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0xaf68a[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x25dcbd[_0x2c0e('0x3e')]=_0x25dcbd[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x25dcbd[_0x2c0e('0x3e')]:_0x56d7f2[_0x2c0e('0xc3')];_0x25dcbd['order']=qs[_0x2c0e('0xca')](_0xaf68a[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x25dcbd['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0xaf68a[_0x2c0e('0x39')],_0x56d7f2[_0x2c0e('0xc6')]));if(_0xaf68a['query'][_0x2c0e('0xcc')]){_0x25dcbd[_0x2c0e('0x38')]=_[_0x2c0e('0x4e')](_0x25dcbd[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x25dcbd['attributes'],function(_0x44ad3b){var _0x490d75={};_0x490d75[_0x44ad3b]={'$like':'%'+_0xaf68a[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0x490d75;})});}_0x25dcbd=_[_0x2c0e('0x4e')]({},_0x25dcbd,_0xaf68a[_0x2c0e('0xcd')]);return _0xa52baf['getWhatsappAccounts'](_0x25dcbd);}})[_0x2c0e('0x1b')](function(_0x5b0b58){if(_0x5b0b58){_0x1fafb8=_0x5b0b58[_0x2c0e('0x41')];if(!_0xaf68a['query'][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x25dcbd['limit']=qs[_0x2c0e('0xcf')](_0xaf68a[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x25dcbd[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0xaf68a[_0x2c0e('0x39')][_0x2c0e('0x16')]);}return _0xa52baf[_0x2c0e('0x13d')](_0x25dcbd);}})[_0x2c0e('0x1b')](function(_0x6b0940){if(_0x6b0940){return _0x6b0940?{'count':_0x1fafb8,'rows':_0x6b0940}:null;}})[_0x2c0e('0x1b')](respondWithResult(_0x4f9ca2,null))[_0x2c0e('0x4a')](handleError(_0x4f9ca2,null));};exports[_0x2c0e('0x13e')]=function(_0x56f01c,_0x1a6f9a){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x56f01c['params']['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x1a6f9a,null))['then'](function(_0x9d896c){if(_0x9d896c){return _0x9d896c[_0x2c0e('0x13e')](_0x56f01c[_0x2c0e('0x51')][_0x2c0e('0x54')],_[_0x2c0e('0x55')](_0x56f01c[_0x2c0e('0x51')],[_0x2c0e('0x54'),'id'])||{});}})[_0x2c0e('0x1b')](respondWithResult(_0x1a6f9a,null))['catch'](handleError(_0x1a6f9a,null));};exports[_0x2c0e('0x13f')]=function(_0x16fdf6,_0x33868f){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x16fdf6[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](handleEntityNotFound(_0x33868f,null))[_0x2c0e('0x1b')](function(_0x591666){if(_0x591666){return _0x591666['removeWhatsappAccounts'](_0x16fdf6[_0x2c0e('0x39')][_0x2c0e('0x54')]);}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x33868f,null))[_0x2c0e('0x4a')](handleError(_0x33868f,null));};exports['getScheduledCalls']=function(_0x186b41,_0x37873f){var _0x5022c1={},_0x15d58d={},_0x174056={'count':0x0,'rows':[]};var _0xfa0a4f=db[_0x2c0e('0x140')][_0x2c0e('0x2e')];_0x15d58d[_0x2c0e('0xc3')]=_['keys'](_0xfa0a4f);_0x15d58d[_0x2c0e('0x39')]=_['keys'](_0x186b41[_0x2c0e('0x39')]);_0x15d58d[_0x2c0e('0xc6')]=_[_0x2c0e('0xc7')](_0x15d58d[_0x2c0e('0xc3')],_0x15d58d['query']);_0x15d58d['filters']=_[_0x2c0e('0xb9')](_0x15d58d['filters'],[_0x2c0e('0x141'),_0x2c0e('0x142'),_0x2c0e('0x143'),_0x2c0e('0x144'),_0x2c0e('0x145'),_0x2c0e('0x146'),_0x2c0e('0x147'),_0x2c0e('0x148'),'$not','$between',_0x2c0e('0x149'),_0x2c0e('0x14a'),_0x2c0e('0x14b'),_0x2c0e('0x14c'),_0x2c0e('0x14d'),'$iLike',_0x2c0e('0x14e'),'$like',_0x2c0e('0x14f'),_0x2c0e('0x150'),_0x2c0e('0x151'),'$any']);_0x5022c1[_0x2c0e('0x3e')]=_[_0x2c0e('0xc7')](_0x15d58d[_0x2c0e('0xc3')],qs[_0x2c0e('0xc8')](_0x186b41[_0x2c0e('0x39')][_0x2c0e('0xc8')]));_0x5022c1[_0x2c0e('0x3e')]=_0x5022c1[_0x2c0e('0x3e')][_0x2c0e('0x41')]?_0x5022c1[_0x2c0e('0x3e')]:_0x15d58d[_0x2c0e('0xc3')];if(!_0x186b41[_0x2c0e('0x39')][_0x2c0e('0xbd')]('nolimit')){_0x5022c1[_0x2c0e('0xcf')]=qs['limit'](_0x186b41[_0x2c0e('0x39')][_0x2c0e('0xcf')]);_0x5022c1['offset']=qs[_0x2c0e('0x16')](_0x186b41['query'][_0x2c0e('0x16')]);}_0x5022c1[_0x2c0e('0xc9')]=qs[_0x2c0e('0xca')](_0x186b41[_0x2c0e('0x39')][_0x2c0e('0xca')]);_0x5022c1['where']=qs[_0x2c0e('0xc6')](_[_0x2c0e('0xcb')](_0x186b41[_0x2c0e('0x39')],_0x15d58d['filters']));if(_0x186b41[_0x2c0e('0x39')][_0x2c0e('0xcc')]){_0x5022c1['where']=_[_0x2c0e('0x4e')](_0x5022c1[_0x2c0e('0x38')],{'$or':_[_0x2c0e('0x2f')](_0x5022c1[_0x2c0e('0x3e')],function(_0x31fc89){var _0xff15e2={};_0xff15e2[_0x31fc89]={'$like':'%'+_0x186b41[_0x2c0e('0x39')][_0x2c0e('0xcc')]+'%'};return _0xff15e2;})});}_0x5022c1['where']={'$and':[_0x5022c1[_0x2c0e('0x38')],{'$or':[{'UserId':_0x186b41[_0x2c0e('0x4c')]['id']},{'OwnerId':_0x186b41[_0x2c0e('0x4c')]['id']}]}]};_0x5022c1=_[_0x2c0e('0x4e')]({},_0x5022c1,_0x186b41['options']);var _0x4c91b9={'where':_0x5022c1[_0x2c0e('0x38')]};return db[_0x2c0e('0x140')][_0x2c0e('0x18')](_0x4c91b9)[_0x2c0e('0x1b')](function(_0x3ae2a5){_0x174056[_0x2c0e('0x18')]=_0x3ae2a5;if(_0x186b41[_0x2c0e('0x39')][_0x2c0e('0x3a')]){_0x5022c1[_0x2c0e('0x4d')]=[{'attributes':['id',_0x2c0e('0x152'),_0x2c0e('0x153'),'phone'],'model':db[_0x2c0e('0x154')],'as':'Contact'},{'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x155')],'model':db['VoiceQueue'],'as':_0x2c0e('0xc5')}];}return db[_0x2c0e('0x140')][_0x2c0e('0x3f')](_0x5022c1);})['then'](function(_0x59a723){_0x174056['rows']=_0x59a723;return _0x174056;})['then'](respondWithFilteredResult(_0x37873f,_0x5022c1))[_0x2c0e('0x4a')](handleError(_0x37873f,null));};exports[_0x2c0e('0x156')]=function(_0xfff13d,_0x4ecdbe){if(!_[_0x2c0e('0x5c')](_0xfff13d['user']['id'])&&(_0xfff13d['user'][_0x2c0e('0x1c')]==_0x2c0e('0x1f')||_0xfff13d[_0x2c0e('0x21')][_0x2c0e('0x1c')]=='user')){return db['User']['findOne']({'where':{'id':_0xfff13d[_0x2c0e('0x4c')]['id']},'raw':!![]})[_0x2c0e('0x1b')](function(_0x526495){return authService['retrieveApiKey'](_0x526495);})[_0x2c0e('0x1b')](function(_0x489415){if(_0x489415){return _0x4ecdbe[_0x2c0e('0x14')](0xc8)[_0x2c0e('0x157')]({'api_key':_0x489415[_0x2c0e('0x158')]});}else{return _0x4ecdbe['status'](0xcc)[_0x2c0e('0x157')]({'message':_0x2c0e('0x159')});}})[_0x2c0e('0x4a')](handleError(_0x4ecdbe,0x193));}else{return _0x4ecdbe[_0x2c0e('0x14')](0x191)[_0x2c0e('0x157')]({'message':_0x2c0e('0x15a')});}};exports[_0x2c0e('0x15b')]=function(_0x43d08d,_0x1e1426){if(!_['isNil'](_0x43d08d[_0x2c0e('0x21')]['id'])&&(_0x43d08d[_0x2c0e('0x21')]['role']==_0x2c0e('0x1f')||_0x43d08d[_0x2c0e('0x21')][_0x2c0e('0x1c')]==_0x2c0e('0x21'))){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0x43d08d[_0x2c0e('0x4c')]['id']}})[_0x2c0e('0x1b')](function(_0x14ffa9){return authService[_0x2c0e('0x15c')](_0x14ffa9);})[_0x2c0e('0x1b')](function(_0x391b1d){return db['User'][_0x2c0e('0x50')]({'apiKeyIat':_0x391b1d[_0x2c0e('0x15d')],'apiKeyNonce':_0x391b1d[_0x2c0e('0x15e')]},{'where':{'id':_0x43d08d['params']['id']}})[_0x2c0e('0x1b')](function(){return _0x1e1426['status'](0xc8)[_0x2c0e('0x157')]({'api_key':_0x391b1d[_0x2c0e('0x158')]});});})[_0x2c0e('0x4a')](handleError(_0x1e1426,0x193));}else{return _0x1e1426[_0x2c0e('0x14')](0x191)[_0x2c0e('0x157')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x2c0e('0x15f')]=function(_0xee6e85,_0x310878){if(!_[_0x2c0e('0x5c')](_0xee6e85[_0x2c0e('0x21')]['id'])&&(_0xee6e85[_0x2c0e('0x21')][_0x2c0e('0x1c')]=='admin'||_0xee6e85[_0x2c0e('0x21')][_0x2c0e('0x1c')]==_0x2c0e('0x21'))){return db[_0x2c0e('0x2d')][_0x2c0e('0x29')]({'where':{'id':_0xee6e85['params']['id']}})['then'](handleEntityNotFound(_0x310878,null))[_0x2c0e('0x1b')](function(_0x48aa62){if(_0x48aa62&&_0x48aa62[_0x2c0e('0x160')]&&_0x48aa62[_0x2c0e('0x161')])return _0x48aa62;else throw{'message':_0x2c0e('0x162')};})['then'](function(){return db['User'][_0x2c0e('0x50')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xee6e85[_0x2c0e('0x4c')]['id']}});})[_0x2c0e('0x1b')](respondWithStatusCode(_0x310878,0xc8))[_0x2c0e('0x4a')](handleError(_0x310878,0x193));}else{return _0x310878[_0x2c0e('0x14')](0x191)[_0x2c0e('0x157')]({'message':_0x2c0e('0x15a')});}};exports['whoami']=function(_0x31defa,_0x3619fd){var _0x39371b=_0x31defa[_0x2c0e('0x21')][_0x2c0e('0x1e')]({'plain':!![]});if(!_0x39371b){return _0x3619fd[_0x2c0e('0x14')](0x191)['send'](_0x2c0e('0x163'));}else{Promise[_0x2c0e('0x10a')]()[_0x2c0e('0x1b')](function(){if(_0x31defa[_0x2c0e('0x39')][_0x2c0e('0x3d')]!=='true')return;return _0x31defa[_0x2c0e('0x21')][_0x2c0e('0x164')]();})['then'](function(_0x395d99){if(!_0x395d99)return;return _0x395d99[_0x2c0e('0x1e')]({'plain':!![]});})[_0x2c0e('0x1b')](function(_0x397c18){_0x39371b[_0x2c0e('0x3d')]=_0x397c18;return _0x3619fd[_0x2c0e('0x14')](0xc8)['json'](_0x39371b);});}};exports[_0x2c0e('0x165')]=function(_0x38299a,_0x4ff2c4){var _0x22f574={'offset':0x0};var _0x4629f5={'count':0x0,'rows':[]};var _0x2e6371=[_0x2c0e('0x166'),_0x2c0e('0x167'),_0x2c0e('0x168')];var _0x4921f0=[];var _0x1f0203=[];var _0x2b7ad1=[];var _0x3bf269=_0x38299a[_0x2c0e('0x39')][_0x2c0e('0x169')];var _0x143b31=_0x38299a[_0x2c0e('0x39')]['queues'];var _0x10676b=_0x38299a[_0x2c0e('0x39')]['filter'];return Promise['resolve']()['then'](function(){if(!_0x3bf269){return[];}return db[_0x2c0e('0xfd')]['findAll']({'attributes':['id',_0x2c0e('0x36')],'where':{'id':_0x3bf269}});})['then'](function(_0x4bb1bf){_0x2b7ad1=_0x4bb1bf;if(!_0x143b31){return[];}return db[_0x2c0e('0x16a')]['findAll']({'attributes':['id',_0x2c0e('0x36')],'type':_0x2c0e('0x16b'),'where':{'id':_0x143b31}});})['then'](function(_0x9b05f9){_0x1f0203=_0x9b05f9;var _0x7b5197=_0x2b7ad1[_0x2c0e('0xb9')](_0x1f0203)[_0x2c0e('0x2f')](function(_0x276cf6){return _0x276cf6[_0x2c0e('0x16c')]({'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x56'),'online'],'raw':!![]});});return Promise[_0x2c0e('0x49')](_0x7b5197);})[_0x2c0e('0x1b')](function(_0x1b0a52){var _0x147247=_[_0x2c0e('0x16d')](_0x1b0a52);if(_0x10676b){if(_0x143b31||_0x3bf269){return _0x147247[_0x2c0e('0xcc')](function(_0x59e195){return _0x59e195[_0x2c0e('0x36')]['toLowerCase']()['includes'](_0x10676b[_0x2c0e('0x99')]())||_0x59e195['internal'][_0x2c0e('0x16e')]()[_0x2c0e('0x28')](_0x10676b);});}else{return db[_0x2c0e('0x2d')]['findAll']({'attributes':['id',_0x2c0e('0x36'),_0x2c0e('0x56'),_0x2c0e('0x92')],'where':{'role':_0x2c0e('0x23'),'$or':[db[_0x2c0e('0x100')][_0x2c0e('0x38')](db['sequelize']['fn']('lower',db[_0x2c0e('0x100')][_0x2c0e('0x16f')](_0x2c0e('0x36'))),{'$like':'%'+_0x10676b[_0x2c0e('0x99')]()+'%'}),{'internal':{'$like':'%'+_0x10676b+'%'}}]},'raw':!![]});}}else{return _0x147247;}})[_0x2c0e('0x1b')](function(_0x10e6cd){var _0x2eb1eb=_0x2c0e('0x36');var _0x2008cd=_0x2c0e('0x170');if(_0x38299a[_0x2c0e('0x39')][_0x2c0e('0xca')]){_0x2008cd=_0x38299a['query'][_0x2c0e('0xca')][0x0]==='-'?_0x2c0e('0x171'):_0x2c0e('0x170');_0x2eb1eb=_0x2008cd==='asc'?_0x38299a['query'][_0x2c0e('0xca')]:_0x38299a[_0x2c0e('0x39')][_0x2c0e('0xca')][_0x2c0e('0x172')](0x1);}return _(_0x10e6cd)[_0x2c0e('0x173')]('id')['orderBy']([function(_0x2eb980){return _0x2eb1eb===_0x2c0e('0x36')?_0x2eb980[_0x2eb1eb]['toLowerCase']():_0x2eb980[_0x2eb1eb];}],[_0x2008cd])[_0x2c0e('0x2f')](function(_0x5f3122){return _[_0x2c0e('0xcb')](_0x5f3122,['id',_0x2c0e('0x36'),_0x2c0e('0x56'),_0x2c0e('0x92')]);})[_0x2c0e('0x27')]();})[_0x2c0e('0x1b')](function(_0x3ccb5c){_0x4921f0=_0x3ccb5c;return rta['getRealtimeAgents']();})['then'](function(_0x59ab9c){return _0x4921f0[_0x2c0e('0x2f')](function(_0x2ddb7){var _0x10ee61=_[_0x2c0e('0x29')](_0x59ab9c['rows'],['id',_0x2ddb7['id']]);if(!_0x10ee61||!_0x2ddb7[_0x2c0e('0x92')]){_0x2ddb7[_0x2c0e('0x14')]=_0x2c0e('0x174');}else if(_0x10ee61['voicePause']){_0x2ddb7[_0x2c0e('0x14')]='pause';}else if(_0x10ee61[_0x2c0e('0x175')]===_0x2c0e('0x176')||!_0x10ee61['voiceStatus']){_0x2ddb7[_0x2c0e('0x14')]='unavailable';}else{_0x2ddb7[_0x2c0e('0x14')]=_0x2e6371[_0x2c0e('0x28')](_0x10ee61['voiceStatus'])?_0x2c0e('0x92'):_0x2c0e('0x177');}return _0x2ddb7;});})[_0x2c0e('0x1b')](function(_0x132385){if(!_0x38299a[_0x2c0e('0x39')][_0x2c0e('0xbd')](_0x2c0e('0xce'))){_0x22f574[_0x2c0e('0xcf')]=qs['limit'](_0x38299a[_0x2c0e('0x39')][_0x2c0e('0xcf')]||0xa);_0x22f574[_0x2c0e('0x16')]=qs[_0x2c0e('0x16')](_0x38299a[_0x2c0e('0x39')][_0x2c0e('0x16')]);}_0x4629f5[_0x2c0e('0x18')]=_0x132385[_0x2c0e('0x41')];_0x4629f5[_0x2c0e('0x40')]=_0x22f574['limit']?_0x132385[_0x2c0e('0x178')](_0x22f574['offset'],_0x22f574[_0x2c0e('0x16')]+_0x22f574[_0x2c0e('0xcf')]):_0x132385;return _0x4629f5;})[_0x2c0e('0x1b')](respondWithFilteredResult(_0x4ff2c4,_0x22f574))['catch'](handleError(_0x4ff2c4,null));};function get_open_tabs(_0x46373d,_0x1febb2){var _0x271b63=_0x46373d['charAt'](0x0)[_0x2c0e('0x179')]()+_0x46373d[_0x2c0e('0x178')](0x1);var _0x440053={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x5a00da,_0x44abc4){var _0x2b9814=squel[_0x2c0e('0x17a')]()[_0x2c0e('0x17b')](_0x2c0e('0x17c')+_0x271b63+_0x2c0e('0x17d'),'id')[_0x2c0e('0x17b')](_0x2c0e('0x17e'))[_0x2c0e('0x61')](_0x2c0e('0x17f')+_0x46373d+_0x2c0e('0x180'),'ui')[_0x2c0e('0x38')](_0x2c0e('0x181'),_0x1febb2['id']);return db[_0x2c0e('0x100')][_0x2c0e('0x39')](_0x2b9814[_0x2c0e('0x16e')](),_0x440053)[_0x2c0e('0x1b')](function(_0x412876){_0x1febb2[_0x271b63+_0x2c0e('0x182')]=_0x412876;_0x5a00da(_0x412876);})[_0x2c0e('0x4a')](function(_0x436487){_0x44abc4(_0x436487);});});}exports[_0x2c0e('0x183')]=function(_0x482e84,_0x1835b2){var _0x47f251=_0x482e84[_0x2c0e('0x4c')]['id'];var _0x2fbba8=_0x482e84['body'][_0x2c0e('0x184')];return db[_0x2c0e('0x2d')][_0x2c0e('0x50')]({'messengerSoundNotification':_0x2fbba8},{'where':{'id':_0x47f251}})[_0x2c0e('0x1b')](respondWithStatusCode(_0x1835b2,null))[_0x2c0e('0x4a')](handleError(_0x1835b2,null));};
\ No newline at end of file
+var _0xe525=['inbound','flatten','col','asc','desc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','field','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','OpenTabs','enabled','moment','util','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','register','defaults','end','status','undefined','limit','count','offset','set','json','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','user','Agents','Telephones','telephone','filter','ignore','map','includes','UserProfileResource','then','sendStatus','error','stack','name','send','User','type','resetPasswordToken','md5secret','value','index','getOptions','includeAll','query','UserSetting','userSetting','attributes','push','findAll','openTabs','true','rows','length','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','include','merge','options','find','chat','body','params','describe','ids','internal','findById','securePassword','validatePasswordPattern','password','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','103','110','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','userProfileId','autoAssociation','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','isEmpty','compact','changePassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','Queue:save','voice','VoiceQueue','format','voicePause','UserVoiceQueueRt','upsert','removeQueues','Queue:remove','addAvatar','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','FaxOpenTabs','FAX','createdAt','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','Tags','color','tag','getQueues','findOne','model','Queue','rawAttributes','keys','intersection','fields','order','sort','filters','pick','where','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','bulkCreate','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','getAssociatedQueues','getDataValue','penalty','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','isArray','removeAgent','Voice','getLists','getAgents','values','addChatInteractions','omit','spread','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$eq','$not','$between','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','idle','unknown','teams','queues'];(function(_0x253ba5,_0x4b7885){var _0x40f928=function(_0x104095){while(--_0x104095){_0x253ba5['push'](_0x253ba5['shift']());}};_0x40f928(++_0x4b7885);}(_0xe525,0x199));var _0x5e52=function(_0x2ee973,_0x284293){_0x2ee973=_0x2ee973-0x0;var _0x2b5468=_0xe525[_0x2ee973];return _0x2b5468;};'use strict';var moment=require(_0x5e52('0x0'));var util=require(_0x5e52('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x5e52('0x2'));var squel=require(_0x5e52('0x3'));var Redis=require(_0x5e52('0x4'));var authService=require('../../components/auth/service');var contacts=require(_0x5e52('0x5'));var qs=require(_0x5e52('0x6'));var rta=require(_0x5e52('0x7'));var logger=require(_0x5e52('0x8'))('api');var utils=require(_0x5e52('0x9'));var config=require(_0x5e52('0xa'));var licenseUtil=require(_0x5e52('0xb'));var APIBadRequestError=require(_0x5e52('0xc'))[_0x5e52('0xd')];var APINotFoundError=require(_0x5e52('0xc'))[_0x5e52('0xe')];var APIHandleError=require(_0x5e52('0xc'))['handleError'];var db=require(_0x5e52('0xf'))['db'];var socket=require(_0x5e52('0x10'))(new Redis(config[_0x5e52('0x11')]));require('./user.socket')[_0x5e52('0x12')](socket);config[_0x5e52('0x11')]=_[_0x5e52('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var values;function respondWithStatusCode(_0x31ca45,_0x551d7f){_0x551d7f=_0x551d7f||0xcc;return function(_0x88b5fc){if(_0x88b5fc){return _0x31ca45['sendStatus'](_0x551d7f);}return _0x31ca45['status'](_0x551d7f)[_0x5e52('0x14')]();};}function respondWithResult(_0x1c46f5,_0xf38602){_0xf38602=_0xf38602||0xc8;return function(_0x2fd1e2){if(_0x2fd1e2){return _0x1c46f5[_0x5e52('0x15')](_0xf38602)['json'](_0x2fd1e2);}};}function respondWithFilteredResult(_0x40e445,_0x5babc9){return function(_0x51cf96){if(_0x51cf96){var _0x5f0421=typeof _0x5babc9['offset']===_0x5e52('0x16')&&typeof _0x5babc9[_0x5e52('0x17')]===_0x5e52('0x16');var _0xedd01f=_0x51cf96[_0x5e52('0x18')];var _0x1d863b=_0x5f0421?0x0:_0x5babc9[_0x5e52('0x19')];var _0x321da1=_0x5f0421?_0x51cf96[_0x5e52('0x18')]:_0x5babc9[_0x5e52('0x19')]+_0x5babc9[_0x5e52('0x17')];var _0x2e3825;if(_0x321da1>=_0xedd01f){_0x321da1=_0xedd01f;_0x2e3825=0xc8;}else{_0x2e3825=0xce;}_0x40e445['status'](_0x2e3825);return _0x40e445[_0x5e52('0x1a')]('Content-Range',_0x1d863b+'-'+_0x321da1+'/'+_0xedd01f)[_0x5e52('0x1b')](_0x51cf96);}return null;};}function saveUpdates(_0x34d159){return function(_0x48dbae){if(_0x48dbae){return _0x48dbae[_0x5e52('0x1c')](_0x34d159)['then'](function(_0x5d889f){if(_0x5d889f[_0x5e52('0x1d')]===_0x5e52('0x1e')){socket[_0x5e52('0x1f')](_0x5e52('0x20')+_0x5d889f['id'],_0x5d889f);}return _0x5d889f;});}return null;};}function removeEntity(_0x3505b6){return function(_0x5cc0ea){if(_0x5cc0ea){return _0x5cc0ea[_0x5e52('0x21')]()['then'](function(){var _0x5983bf=_0x5cc0ea[_0x5e52('0x22')]({'plain':!![]});if(_0x5983bf[_0x5e52('0x1d')]===_0x5e52('0x23'))return;var _0xc8de62=[{'name':'Users','value':_0x5e52('0x24'),'ignore':!![]},{'name':_0x5e52('0x25'),'value':_0x5e52('0x1e'),'ignore':![]},{'name':_0x5e52('0x26'),'value':_0x5e52('0x27'),'ignore':![]}];var _0x17dac3=_(_0xc8de62)[_0x5e52('0x28')](_0x5e52('0x29'))[_0x5e52('0x2a')]('value')['value']();if(_[_0x5e52('0x2b')](_0x17dac3,_0x5983bf[_0x5e52('0x1d')])){return;}var _0x4394f2=_['find'](_0xc8de62,['value',_0x5983bf[_0x5e52('0x1d')]])['name'];return db[_0x5e52('0x2c')][_0x5e52('0x21')]({'where':{'type':_0x4394f2,'resourceId':_0x5983bf['id']}})['then'](function(){return _0x5cc0ea;});})[_0x5e52('0x2d')](function(){_0x3505b6[_0x5e52('0x15')](0xcc)[_0x5e52('0x14')]();});}};}function handleEntityNotFound(_0x1b0b1d){return function(_0x2a8dc6){if(!_0x2a8dc6){_0x1b0b1d[_0x5e52('0x2e')](0x194);}return _0x2a8dc6;};}function handleError(_0x25a045,_0x594be6){_0x594be6=_0x594be6||0x1f4;return function(_0xfabb64){logger[_0x5e52('0x2f')](_0xfabb64[_0x5e52('0x30')]);if(_0xfabb64['name']){delete _0xfabb64[_0x5e52('0x31')];}_0x25a045[_0x5e52('0x15')](_0x594be6)[_0x5e52('0x32')](_0xfabb64);};}function getUserAttributes(){return _(db[_0x5e52('0x33')]['rawAttributes'])[_0x5e52('0x2a')](function(_0x5edc9f){return{'name':_0x5edc9f['fieldName'],'type':_0x5edc9f[_0x5e52('0x34')]['key']};})[_0x5e52('0x28')](function(_0x445090){return!['password','salt','previousPasswords',_0x5e52('0x35'),'resetPasswordExpires',_0x5e52('0x36')][_0x5e52('0x2b')](_0x445090[_0x5e52('0x31')]);})[_0x5e52('0x37')]();}exports[_0x5e52('0x38')]=function(_0x1fa5f7,_0x19920e){var _0x1fe833={},_0x5f2e11={'count':0x0,'rows':[]};var _0x2c7ebd=getUserAttributes();_0x1fe833=qs[_0x5e52('0x39')](_0x2c7ebd,_0x1fa5f7);var _0x36004a={'where':_0x1fe833['where']};return db['User'][_0x5e52('0x18')](_0x36004a)['then'](function(_0x28dcd5){_0x5f2e11[_0x5e52('0x18')]=_0x28dcd5;if(_0x1fa5f7['query'][_0x5e52('0x3a')]){_0x1fe833['include']=[{'all':!![]}];}if(_0x1fa5f7[_0x5e52('0x3b')]['userSetting']==='true'){_0x1fe833['include']=[{'model':db[_0x5e52('0x3c')],'as':_0x5e52('0x3d')}];}if(!_[_0x5e52('0x2b')](_0x1fe833['attributes'],'id')){_0x1fe833[_0x5e52('0x3e')][_0x5e52('0x3f')]('id');}return db[_0x5e52('0x33')][_0x5e52('0x40')](_0x1fe833);})['then'](function(_0x57e9f6){_0x5f2e11['rows']=_0x57e9f6;if(_0x1fa5f7[_0x5e52('0x3b')][_0x5e52('0x41')]===_0x5e52('0x42')){var _0x44e108=[];for(var _0x35e6b4=0x0;_0x35e6b4<_0x5f2e11[_0x5e52('0x43')][_0x5e52('0x44')];_0x35e6b4++){_0x44e108[_0x5e52('0x3f')](get_open_tabs('chat',_0x5f2e11[_0x5e52('0x43')][_0x35e6b4][_0x5e52('0x45')]));_0x44e108['push'](get_open_tabs(_0x5e52('0x46'),_0x5f2e11[_0x5e52('0x43')][_0x35e6b4][_0x5e52('0x45')]));_0x44e108[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x47'),_0x5f2e11[_0x5e52('0x43')][_0x35e6b4][_0x5e52('0x45')]));_0x44e108['push'](get_open_tabs(_0x5e52('0x48'),_0x5f2e11[_0x5e52('0x43')][_0x35e6b4][_0x5e52('0x45')]));_0x44e108[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x49'),_0x5f2e11[_0x5e52('0x43')][_0x35e6b4]['dataValues']));_0x44e108[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x4a'),_0x5f2e11[_0x5e52('0x43')][_0x35e6b4][_0x5e52('0x45')]));}return Promise[_0x5e52('0x4b')](_0x44e108)[_0x5e52('0x2d')](function(){return _0x5f2e11;});}else{return _0x5f2e11;}})[_0x5e52('0x2d')](respondWithFilteredResult(_0x19920e,_0x1fe833))[_0x5e52('0x4c')](handleError(_0x19920e,null));};exports[_0x5e52('0x4d')]=function(_0x2250b2,_0x56ad59){var _0x46fe05=getUserAttributes();_0x2250b2[_0x5e52('0x3b')]['id']=_0x2250b2['params']['id'];var _0xbc8020=qs['getOptions'](_0x46fe05,_0x2250b2);if(_0x2250b2['query'][_0x5e52('0x3a')]){_0xbc8020[_0x5e52('0x4e')]=[{'all':!![]}];}if(_0x2250b2[_0x5e52('0x3b')][_0x5e52('0x3d')]==='true'){_0xbc8020[_0x5e52('0x4e')]=[{'model':db[_0x5e52('0x3c')],'as':_0x5e52('0x3d')}];}_0xbc8020=_[_0x5e52('0x4f')]({},_0xbc8020,_0x2250b2[_0x5e52('0x50')]);if(!_[_0x5e52('0x2b')](_0xbc8020['attributes'],'id')){_0xbc8020[_0x5e52('0x3e')][_0x5e52('0x3f')]('id');}return db['User'][_0x5e52('0x51')](_0xbc8020)[_0x5e52('0x2d')](handleEntityNotFound(_0x56ad59,null))[_0x5e52('0x2d')](function(_0x5b6464){var _0x40e06c=[];values=_0x5b6464;if(_0x2250b2[_0x5e52('0x3b')][_0x5e52('0x41')]===_0x5e52('0x42')){_0x40e06c['push'](get_open_tabs(_0x5e52('0x52'),_0x5b6464[_0x5e52('0x45')]));_0x40e06c['push'](get_open_tabs(_0x5e52('0x46'),_0x5b6464[_0x5e52('0x45')]));_0x40e06c['push'](get_open_tabs(_0x5e52('0x49'),_0x5b6464['dataValues']));_0x40e06c[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x4a'),_0x5b6464[_0x5e52('0x45')]));_0x40e06c[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x47'),_0x5b6464['dataValues']));_0x40e06c[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x48'),_0x5b6464[_0x5e52('0x45')]));return Promise[_0x5e52('0x4b')](_0x40e06c);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x56ad59,null))['catch'](handleError(_0x56ad59,null));};exports[_0x5e52('0x1c')]=function(_0x5c2b3f,_0x56082f){if(_0x5c2b3f[_0x5e52('0x53')]['id']){delete _0x5c2b3f['body']['id'];}delete _0x5c2b3f[_0x5e52('0x53')][_0x5e52('0x1d')];return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x5c2b3f[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x56082f,null))['then'](saveUpdates(_0x5c2b3f[_0x5e52('0x53')],null))['then'](respondWithResult(_0x56082f,null))['catch'](handleError(_0x56082f,null));};exports[_0x5e52('0x55')]=function(_0x2ad92b,_0x233929){return db['User'][_0x5e52('0x55')]()['then'](respondWithResult(_0x233929,null))['catch'](handleError(_0x233929,null));};exports['addContacts']=function(_0x3c74c9,_0x266205){return db[_0x5e52('0x33')]['find']({'where':{'id':_0x3c74c9['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x266205,null))[_0x5e52('0x2d')](function(_0x364758){if(_0x364758){return _0x364758['addContacts'](_0x3c74c9[_0x5e52('0x53')][_0x5e52('0x56')],_['omit'](_0x3c74c9[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{});}})[_0x5e52('0x2d')](respondWithResult(_0x266205,null))[_0x5e52('0x4c')](handleError(_0x266205,null));};function validateUser(_0x36db96){return new Promise(function(_0x5699f5,_0x295e26){if(_0x36db96[_0x5e52('0x57')])return _0x5699f5(_0x36db96);return db['Setting'][_0x5e52('0x58')](0x1)[_0x5e52('0x2d')](function(_0x4f42eb){if(_0x4f42eb[_0x5e52('0x59')])authService[_0x5e52('0x5a')](_0x36db96[_0x5e52('0x5b')]);db[_0x5e52('0x33')][_0x5e52('0x5c')](_0x5e52('0x57'))[_0x5e52('0x2d')](function(_0x384cca){if(_[_0x5e52('0x5d')](_0x384cca)){_0x36db96[_0x5e52('0x57')]=_0x4f42eb['min_internal']||0x1;return;}if(_['isNil'](_0x4f42eb['min_internal'])||_0x4f42eb[_0x5e52('0x5e')]===_0x384cca){_0x36db96[_0x5e52('0x57')]=_0x384cca+0x1;return;}if(_0x4f42eb[_0x5e52('0x5e')]>_0x384cca){_0x36db96[_0x5e52('0x57')]=_0x4f42eb[_0x5e52('0x5e')];return;}return db[_0x5e52('0x5f')][_0x5e52('0x3b')](_0x5e52('0x60'),{'type':db[_0x5e52('0x5f')]['QueryTypes'][_0x5e52('0x61')]})[_0x5e52('0x2d')](function(_0x5bfbb7){if(_0x5bfbb7&&_0x5bfbb7[_0x5e52('0x44')]){for(var _0x2af990=0x0,_0x248fa7=_0x5bfbb7[_0x5e52('0x44')];_0x2af990<_0x248fa7&&_[_0x5e52('0x5d')](_0x36db96[_0x5e52('0x57')]);_0x2af990++){if(_0x4f42eb[_0x5e52('0x5e')]<=_0x5bfbb7[_0x2af990][_0x5e52('0x62')]){_0x36db96[_0x5e52('0x57')]=_0x5bfbb7[_0x2af990][_0x5e52('0x62')];}else if(_0x4f42eb[_0x5e52('0x5e')]>_0x5bfbb7[_0x2af990][_0x5e52('0x62')]&&_0x4f42eb[_0x5e52('0x5e')]<=_0x5bfbb7[_0x2af990]['to']){_0x36db96[_0x5e52('0x57')]=_0x4f42eb[_0x5e52('0x5e')];}}}if(_['isNil'](_0x36db96[_0x5e52('0x57')])){_0x36db96[_0x5e52('0x57')]=_0x384cca+0x1;}return _0x5699f5(_0x36db96);});});})[_0x5e52('0x4c')](function(_0x5d6693){_0x295e26(_0x5d6693);});});}function updateUser(_0x5460ad){return new Promise(function(_0x181343,_0x101bec){try{if(_0x5460ad[_0x5e52('0x63')]){_0x5460ad[_0x5e52('0x64')]=_0x5460ad[_0x5e52('0x57')];_0x5460ad[_0x5e52('0x65')]={'mailbox':_0x5460ad['internal'],'password':_0x5460ad['password'],'fullname':_0x5460ad[_0x5e52('0x66')],'email':_0x5460ad['email']};}if(_0x5460ad[_0x5e52('0x1d')]==='agent'){if(!_0x5460ad[_0x5e52('0x67')])_0x5460ad['permissions']=[_0x5e52('0x68'),_0x5e52('0x69'),_0x5e52('0x6a'),'113',_0x5e52('0x6b'),'104','105','106','107',_0x5e52('0x6c'),_0x5e52('0x6d'),_0x5e52('0x6e'),_0x5e52('0x6f'),_0x5e52('0x70'),_0x5e52('0x71')];}_0x181343(_0x5460ad);}catch(_0x367a0b){_0x101bec(_0x367a0b);}});}exports[_0x5e52('0x72')]=function(_0x2bab95,_0x241357){if(_0x2bab95[_0x5e52('0x24')]['role']===_0x5e52('0x1e'))throw new Error(_0x5e52('0x73'));if(_0x2bab95['body'][_0x5e52('0x1d')]===_0x5e52('0x24')&&_0x2bab95[_0x5e52('0x24')]['role']!==_0x5e52('0x23')){throw new Error(_0x5e52('0x74'));}if(_0x2bab95[_0x5e52('0x53')]['role']===_0x5e52('0x23')&&_0x2bab95['user'][_0x5e52('0x1d')]!==_0x5e52('0x23')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x5e52('0x75')]([_0x2bab95['body']])['then'](function(){return validateUser(_0x2bab95[_0x5e52('0x53')]);})['then'](function(_0x10e6a5){return updateUser(_0x10e6a5)[_0x5e52('0x2d')](function(_0x426997){if(_0x426997['role']===_0x5e52('0x23')){_0x426997['settingsEnabled']=_0x2bab95[_0x5e52('0x24')]['settingsEnabled'];delete _0x426997[_0x5e52('0x76')];}return _0x426997;});})['then'](function(_0x4e38ce){return db[_0x5e52('0x33')]['create'](_0x4e38ce,{'include':[{'model':db[_0x5e52('0x65')],'as':_0x5e52('0x65')}]});})[_0x5e52('0x2d')](function(_0x561729){if(_0x2bab95[_0x5e52('0x53')][_0x5e52('0x1d')]===_0x5e52('0x24'))return _0x561729;if(_0x2bab95[_0x5e52('0x24')][_0x5e52('0x1d')]!==_0x5e52('0x24'))return _0x561729;return db['UserProfileSection'][_0x5e52('0x51')]({'where':{'name':_0x561729[_0x5e52('0x1d')]===_0x5e52('0x1e')?'Agents':_0x5e52('0x26'),'userProfileId':_0x2bab95['user'][_0x5e52('0x76')]},'raw':!![]})['then'](function(_0x4ca703){if(!_0x4ca703||_0x4ca703[_0x5e52('0x77')]!=0x0)return _0x561729;return db[_0x5e52('0x2c')][_0x5e52('0x72')]({'name':_0x561729[_0x5e52('0x31')],'resourceId':_0x561729['id'],'type':_0x4ca703[_0x5e52('0x31')],'sectionId':_0x4ca703['id']},{})['then'](function(){return _0x561729;});})[_0x5e52('0x4c')](function(_0x252a7b){logger[_0x5e52('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x252a7b);throw _0x252a7b;});})[_0x5e52('0x2d')](respondWithResult(_0x241357,0xc9))[_0x5e52('0x4c')](handleError(_0x241357,null));};exports['bulkCreate']=function(_0x11339d,_0x2a496d){var _0x611fb7=_0x11339d[_0x5e52('0x53')];var _0x34e41d=[];if(_0x11339d['user']['role']===_0x5e52('0x1e'))throw new Error(_0x5e52('0x73'));if(_[_0x5e52('0x78')](_0x611fb7,['role',_0x5e52('0x24')])&&_0x11339d['user']['role']!==_0x5e52('0x23')){throw new Error(_0x5e52('0x74'));}if(_[_0x5e52('0x78')](_0x611fb7,[_0x5e52('0x1d'),_0x5e52('0x23')])&&_0x11339d[_0x5e52('0x24')]['role']!==_0x5e52('0x23')){throw new Error(_0x5e52('0x79'));}return licenseUtil[_0x5e52('0x75')](_0x611fb7)[_0x5e52('0x2d')](function(){return validateUser(_0x611fb7[0x0]);})[_0x5e52('0x2d')](function(){for(var _0x254d1c=0x1;_0x254d1c<_0x611fb7[_0x5e52('0x44')];_0x254d1c++){var _0x5f3acf=_0x611fb7[_0x254d1c-0x1][_0x5e52('0x57')];if(!_0x611fb7[_0x254d1c][_0x5e52('0x57')])_0x611fb7[_0x254d1c][_0x5e52('0x57')]=_0x5f3acf+0x1;_0x34e41d[_0x5e52('0x3f')](validateUser(_0x611fb7[_0x254d1c]));}return Promise[_0x5e52('0x4b')](_0x34e41d);})['then'](function(){_0x34e41d=[];for(var _0x40cb39=0x0;_0x40cb39<_0x611fb7['length'];_0x40cb39++){_0x34e41d[_0x5e52('0x3f')](updateUser(_0x611fb7[_0x40cb39]));}return Promise[_0x5e52('0x4b')](_0x34e41d);})['then'](function(){_0x34e41d=_0x611fb7[_0x5e52('0x2a')](function(_0x301446){return db[_0x5e52('0x33')]['create'](_0x301446,{'include':[{'model':db['VoiceMail'],'as':_0x5e52('0x65')}]})[_0x5e52('0x2d')](function(_0x2ddd77){_0x301446['id']=_0x2ddd77['id'];return _0x301446;});});return Promise[_0x5e52('0x4b')](_0x34e41d);})[_0x5e52('0x2d')](function(_0x7e9b53){if(_0x11339d[_0x5e52('0x53')][_0x5e52('0x1d')]==='user')return _0x7e9b53;if(_0x11339d[_0x5e52('0x24')][_0x5e52('0x1d')]!==_0x5e52('0x24'))return _0x7e9b53;var _0x459f72=_[_0x5e52('0x78')](_0x7e9b53,function(_0x1bb791){return _0x1bb791['role']===_0x5e52('0x1e')||_0x1bb791[_0x5e52('0x1d')]===_0x5e52('0x27');});if(!_0x459f72)return _0x7e9b53;return db[_0x5e52('0x7a')][_0x5e52('0x40')]({'where':{'name':{'$or':[_0x5e52('0x25'),'Telephones']},'userProfileId':_0x11339d[_0x5e52('0x24')]['userProfileId']},'raw':!![]})[_0x5e52('0x2d')](function(_0x583688){if(_[_0x5e52('0x7b')](_0x583688)||!_[_0x5e52('0x78')](_0x583688,['autoAssociation',0x0]))return _0x7e9b53;_0x34e41d=[];var _0x1892bd=_(_0x583688)[_0x5e52('0x2a')](function(_0x119564){if(_0x119564[_0x5e52('0x77')]===0x1)return;return _0x119564[_0x5e52('0x31')]===_0x5e52('0x25')?_0x5e52('0x1e'):_0x5e52('0x27');})[_0x5e52('0x7c')]()[_0x5e52('0x37')]();for(var _0x564fd2=0x0;_0x564fd2<_0x7e9b53[_0x5e52('0x44')];_0x564fd2++){if(!_[_0x5e52('0x2b')](_0x1892bd,_0x7e9b53[_0x564fd2][_0x5e52('0x1d')]))return;var _0xeae043=_0x7e9b53[_0x564fd2]['role']===_0x5e52('0x1e')?_0x5e52('0x25'):'Telephones';_0x34e41d[_0x5e52('0x3f')](db[_0x5e52('0x2c')][_0x5e52('0x72')]({'name':_0x7e9b53[_0x564fd2][_0x5e52('0x31')],'resourceId':_0x7e9b53[_0x564fd2]['id'],'type':_0xeae043,'sectionId':_[_0x5e52('0x51')](_0x583688,[_0x5e52('0x31'),_0xeae043])['id']},{}));}return Promise[_0x5e52('0x4b')](_0x34e41d);});})[_0x5e52('0x2d')](respondWithResult(_0x2a496d,0xc9))[_0x5e52('0x4c')](handleError(_0x2a496d,null));};exports[_0x5e52('0x7d')]=function(_0x41e13c,_0x3a5309){if(_0x41e13c[_0x5e52('0x53')]['id']){delete _0x41e13c[_0x5e52('0x53')]['id'];}return db['User']['find']({'where':{'id':_0x41e13c['params']['id']}})[_0x5e52('0x2d')](function(_0xd74966){if(!_0xd74966)return null;if(_0xd74966['id']===_0x41e13c[_0x5e52('0x24')]['id']){if(!_0x41e13c[_0x5e52('0x53')]['oldPassword']||!_0x41e13c[_0x5e52('0x53')][_0x5e52('0x7e')]){throw new db[(_0x5e52('0x7f'))]['ValidationError'](_0x5e52('0x80'));}if(!_0xd74966[_0x5e52('0x81')](_0x41e13c['body'][_0x5e52('0x82')])){throw new db[(_0x5e52('0x7f'))]['ValidationError']('Wrong\x20credentials');}if(_0x41e13c[_0x5e52('0x53')][_0x5e52('0x82')]===_0x41e13c[_0x5e52('0x53')][_0x5e52('0x7e')]){throw new db[(_0x5e52('0x7f'))][(_0x5e52('0x83'))](_0x5e52('0x84'));}}else if(_0x41e13c[_0x5e52('0x24')][_0x5e52('0x1d')]==='admin'){if(!_0x41e13c['body'][_0x5e52('0x7e')]){throw new db[(_0x5e52('0x7f'))]['ValidationError'](_0x5e52('0x85'));}}else if(_0x41e13c[_0x5e52('0x24')][_0x5e52('0x1d')]===_0x5e52('0x24')){if(!_0x41e13c[_0x5e52('0x53')][_0x5e52('0x7e')]){throw new db[(_0x5e52('0x7f'))][(_0x5e52('0x83'))](_0x5e52('0x85'));}if(_0xd74966['role']!==_0x5e52('0x1e')){throw new db['Sequelize'][(_0x5e52('0x83'))](_0x5e52('0x73'));}}else{throw new db[(_0x5e52('0x7f'))]['ValidationError'](_0x5e52('0x73'));}return _0xd74966;})[_0x5e52('0x2d')](handleEntityNotFound(_0x3a5309,null))['then'](function(_0x100b10){return db[_0x5e52('0x86')]['findOne']({'attributes':['id','securePassword',_0x5e52('0x87'),_0x5e52('0x88')]})['then'](function(_0x473b04){if(_0x473b04[_0x5e52('0x59')])authService[_0x5e52('0x5a')](_0x41e13c[_0x5e52('0x53')]['newPassword']);if(!_0x473b04[_0x5e52('0x87')]||!_0x100b10[_0x5e52('0x89')])return _0x100b10;authService[_0x5e52('0x8a')](_0x41e13c[_0x5e52('0x53')][_0x5e52('0x7e')],_0x100b10[_0x5e52('0x89')],_0x473b04[_0x5e52('0x88')]);return _0x100b10;})[_0x5e52('0x2d')](saveUpdates({'password':_0x41e13c[_0x5e52('0x53')]['newPassword'],'passwordResetAt':_0x41e13c[_0x5e52('0x24')]['id']==_0x41e13c['params']['id']?moment():null,'previousPasswords':authService[_0x5e52('0x8b')](_0x41e13c[_0x5e52('0x53')][_0x5e52('0x7e')],_0x100b10['previousPasswords'])},null));})[_0x5e52('0x2d')](respondWithResult(_0x3a5309,null))[_0x5e52('0x4c')](handleError(_0x3a5309,null));};exports[_0x5e52('0x8c')]=function(_0x20768a,_0x4a70b1){var _0x147fca=_0x20768a[_0x5e52('0x53')][_0x5e52('0x8d')];return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x20768a[_0x5e52('0x54')]['id']},'attributes':['id',_0x5e52('0x31'),_0x5e52('0x1d'),_0x5e52('0x8e'),_0x5e52('0x8f'),'voicePause',_0x5e52('0x90')]})[_0x5e52('0x2d')](handleEntityNotFound(_0x4a70b1,null))[_0x5e52('0x2d')](function(_0x355bdc){if(_0x355bdc){if(!utils[_0x5e52('0x91')](_0x147fca)){throw new db[(_0x5e52('0x7f'))][(_0x5e52('0x83'))](_0x5e52('0x92'));}return _0x355bdc[_0x5e52('0x93')+_[_0x5e52('0x94')](_0x147fca[_0x5e52('0x95')]())+_0x5e52('0x96')](_0x20768a['body']['ids'],{'penalty':_0x20768a['body']['penalty']||0x0})['spread'](function(_0x4d01a4){for(var _0x1db6c5=0x0;_0x1db6c5<_0x20768a[_0x5e52('0x53')][_0x5e52('0x56')][_0x5e52('0x44')];_0x1db6c5+=0x1){var _0x172d56={'UserId':Number(_0x20768a[_0x5e52('0x54')]['id'])};_0x172d56[_[_0x5e52('0x94')](_0x147fca[_0x5e52('0x95')]())+_0x5e52('0x97')]=Number(_0x20768a[_0x5e52('0x53')][_0x5e52('0x56')][_0x1db6c5]);socket[_0x5e52('0x1f')](_0x5e52('0x24')+_[_0x5e52('0x94')](_0x147fca[_0x5e52('0x95')]())+_0x5e52('0x98'),_0x172d56);}return _0x4d01a4;})['then'](function(){if(_0x147fca===_0x5e52('0x99')){return db[_0x5e52('0x9a')][_0x5e52('0x40')]({'where':{'id':_0x20768a['body'][_0x5e52('0x56')]||[]},'raw':!![],'attributes':['id',_0x5e52('0x31')]});}})['then'](function(_0x344cb2){var _0x32176c=_0x355bdc[_0x5e52('0x22')]({'plain':!![]});var _0x3b13ab=[];if(_0x147fca===_0x5e52('0x99')&&_0x32176c[_0x5e52('0x1d')]===_0x5e52('0x1e')&&_0x32176c[_0x5e52('0x8e')]){for(let _0x16f5d7=0x0;_0x16f5d7<_0x344cb2[_0x5e52('0x44')];_0x16f5d7+=0x1){_0x3b13ab[_0x5e52('0x3f')]({'membername':_0x32176c[_0x5e52('0x31')],'UserId':_0x32176c['id'],'queue_name':_0x344cb2[_0x16f5d7][_0x5e52('0x31')],'VoiceQueueId':_0x344cb2[_0x16f5d7]['id'],'interface':_[_0x5e52('0x5d')](_0x32176c[_0x5e52('0x90')])?util[_0x5e52('0x9b')]('SIP/%s',_0x32176c[_0x5e52('0x31')]):_0x32176c[_0x5e52('0x90')],'paused':_0x32176c[_0x5e52('0x9c')]||![],'penalty':_0x20768a[_0x5e52('0x53')]['penalty']||0x0});}return Promise[_0x5e52('0x4b')](_0x3b13ab[_0x5e52('0x2a')](function(_0x315084){return db[_0x5e52('0x9d')][_0x5e52('0x9e')](_0x315084);}));}return _0x355bdc;});}})['then'](respondWithStatusCode(_0x4a70b1,null))[_0x5e52('0x4c')](handleError(_0x4a70b1,null));};exports[_0x5e52('0x9f')]=function(_0x2de6f9,_0x4d746b){var _0x24a2d5,_0x580b2b;return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x2de6f9[_0x5e52('0x54')]['id']},'attributes':['id','name',_0x5e52('0x1d')]})[_0x5e52('0x2d')](handleEntityNotFound(_0x4d746b,null))[_0x5e52('0x2d')](function(_0x5b84cf){if(_0x5b84cf){_0x24a2d5=_0x5b84cf;if(!_0x2de6f9['query']['channel']||!utils['isValidChannel'](_0x2de6f9[_0x5e52('0x3b')]['channel'])){throw new db['Sequelize'][(_0x5e52('0x83'))]('Unknown\x20channel');}return _0x5b84cf['remove'+_['capitalize'](_0x2de6f9['query'][_0x5e52('0x8d')][_0x5e52('0x95')]())+'Queues'](_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x56')]);}})[_0x5e52('0x2d')](function(_0x6fa9a1){if(_['isArray'](_0x2de6f9['query'][_0x5e52('0x56')])){for(var _0x452f8d=0x0;_0x452f8d<_0x2de6f9[_0x5e52('0x3b')]['ids'][_0x5e52('0x44')];_0x452f8d+=0x1){_0x580b2b={'UserId':Number(_0x2de6f9['params']['id'])};_0x580b2b[_[_0x5e52('0x94')](_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x8d')][_0x5e52('0x95')]())+_0x5e52('0x97')]=Number(_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x56')][_0x452f8d]);socket[_0x5e52('0x1f')](_0x5e52('0x24')+_[_0x5e52('0x94')](_0x2de6f9[_0x5e52('0x3b')]['channel'][_0x5e52('0x95')]())+_0x5e52('0xa0'),_0x580b2b);}}else{_0x580b2b={'UserId':Number(_0x2de6f9['params']['id'])};_0x580b2b[_[_0x5e52('0x94')](_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x8d')][_0x5e52('0x95')]())+_0x5e52('0x97')]=Number(_0x2de6f9[_0x5e52('0x3b')]['ids']);socket['emit'](_0x5e52('0x24')+_[_0x5e52('0x94')](_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x8d')][_0x5e52('0x95')]())+_0x5e52('0xa0'),_0x580b2b);}return _0x6fa9a1;})['then'](function(){if(_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x8d')]===_0x5e52('0x99')){return db[_0x5e52('0x9d')][_0x5e52('0x21')]({'where':{'UserId':_0x2de6f9[_0x5e52('0x54')]['id'],'VoiceQueueId':_0x2de6f9[_0x5e52('0x3b')][_0x5e52('0x56')]},'individualHooks':!![]})[_0x5e52('0x2d')](function(){return _0x24a2d5;});}return _0x24a2d5;})[_0x5e52('0x2d')](respondWithStatusCode(_0x4d746b,null))[_0x5e52('0x4c')](handleError(_0x4d746b,null));};exports[_0x5e52('0xa1')]=function(_0x3cf391,_0x194590){_0x3cf391['body']['userpic']=_0x3cf391['file'][_0x5e52('0xa2')];return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x3cf391[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x194590,null))['then'](saveUpdates(_0x3cf391['body'],null))['then'](respondWithResult(_0x194590,null))['catch'](handleError(_0x194590,null));};exports[_0x5e52('0xa3')]=function(_0x1ba786,_0x2655f3){var _0x37c037=path[_0x5e52('0xa4')](config[_0x5e52('0xa5')],_0x5e52('0xa6'));return db['User'][_0x5e52('0x51')]({'where':{'id':_0x1ba786[_0x5e52('0x54')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x2655f3,null))[_0x5e52('0x2d')](function(_0x20e121){if(_0x20e121){if(_[_0x5e52('0x5d')](_0x20e121[_0x5e52('0xa7')])){return _0x2655f3[_0x5e52('0xa8')](_0x37c037);}else{if(!fs[_0x5e52('0xa9')](path['join'](config[_0x5e52('0xa5')],_0x5e52('0xaa'),_0x20e121[_0x5e52('0xa7')]))){return _0x2655f3[_0x5e52('0xa8')](_0x37c037);}return _0x2655f3[_0x5e52('0xa8')](path[_0x5e52('0xa4')](config[_0x5e52('0xa5')],'server/files/images/',_0x20e121[_0x5e52('0xa7')]));}}})['catch'](handleError(_0x2655f3,null));};exports[_0x5e52('0xab')]=function(_0x2235f4,_0x1690d3){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x2235f4[_0x5e52('0x54')]['id']},'attributes':['id']})[_0x5e52('0x2d')](handleEntityNotFound(_0x1690d3,null))['then'](function(_0xd03a00){var _0x2bf7d1=[];values=_0xd03a00[_0x5e52('0x45')];_0x2bf7d1[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x52'),_0xd03a00[_0x5e52('0x45')]));_0x2bf7d1['push'](get_open_tabs(_0x5e52('0x46'),_0xd03a00['dataValues']));_0x2bf7d1[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x49'),_0xd03a00[_0x5e52('0x45')]));_0x2bf7d1['push'](get_open_tabs(_0x5e52('0x4a'),_0xd03a00[_0x5e52('0x45')]));_0x2bf7d1[_0x5e52('0x3f')](get_open_tabs(_0x5e52('0x47'),_0xd03a00['dataValues']));_0x2bf7d1['push'](get_open_tabs(_0x5e52('0x48'),_0xd03a00['dataValues']));return Promise['all'](_0x2bf7d1);})[_0x5e52('0x2d')](function(_0x4e0aec){if(_0x4e0aec){var _0x221ef2=_['map'](values[_0x5e52('0xac')],function(_0x1bef77){return{'channel':'CHAT','id':_0x1bef77['id'],'createdAt':_0x1bef77['createdAt']};});var _0x1524d2=_[_0x5e52('0x2a')](values[_0x5e52('0xad')],function(_0xdf0815){return{'channel':_0x5e52('0xae'),'id':_0xdf0815['id'],'createdAt':_0xdf0815[_0x5e52('0xaf')]};});var _0x5b6061=_['map'](values['OpenchannelOpenTabs'],function(_0x165ef8){return{'channel':_0x5e52('0xb0'),'id':_0x165ef8['id'],'createdAt':_0x165ef8[_0x5e52('0xaf')]};});var _0x1e4276=_[_0x5e52('0x2a')](values['MailOpenTabs'],function(_0x3bb608){return{'channel':_0x5e52('0xb1'),'id':_0x3bb608['id'],'createdAt':_0x3bb608[_0x5e52('0xaf')]};});var _0x560858=_['map'](values[_0x5e52('0xb2')],function(_0x38d753){return{'channel':_0x5e52('0xb3'),'id':_0x38d753['id'],'createdAt':_0x38d753[_0x5e52('0xaf')]};});var _0x198bcb=_[_0x5e52('0x2a')](values[_0x5e52('0xb4')],function(_0x37a873){return{'channel':_0x5e52('0xb5'),'id':_0x37a873['id'],'createdAt':_0x37a873[_0x5e52('0xaf')]};});var _0x3c5238=_['concat'](_0x221ef2,_0x1524d2,_0x5b6061,_0x1e4276,_0x560858,_0x198bcb);var _0x26450e={'count':_0x3c5238['length'],'rows':_0x3c5238};return _0x26450e;}else return null;})[_0x5e52('0x2d')](respondWithResult(_0x1690d3,null))[_0x5e52('0x4c')](handleError(_0x1690d3,null));};exports[_0x5e52('0xb6')]=function(_0x11d1f7,_0x208d96){var _0x40e7e8={};return db[_0x5e52('0x33')]['findOne']({'where':{'id':_0x11d1f7[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](function(_0x11d3ab){if(!_0x11d3ab){throw new APINotFoundError(util[_0x5e52('0x9b')](_0x5e52('0xb7'),_0x11d1f7[_0x5e52('0x54')]['id']));}return contacts[_0x5e52('0x55')]();})[_0x5e52('0x2d')](function(_0x14bd7c){_0x11d1f7['query'][_0x5e52('0x33')]=_0x11d1f7[_0x5e52('0x54')]['id'];_0x40e7e8=qs[_0x5e52('0x39')](_0x14bd7c,_0x11d1f7);if(_0x11d1f7[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0x3a'))){_0x40e7e8[_0x5e52('0x4e')]=[{'model':db[_0x5e52('0xb9')],'as':_0x5e52('0xba'),'required':![]},{'model':db[_0x5e52('0xbb')],'as':_0x5e52('0xbc'),'attributes':['id',_0x5e52('0x31'),_0x5e52('0xbd')],'where':_0x11d1f7[_0x5e52('0x3b')]['tag']?{'id':_0x11d1f7[_0x5e52('0x3b')][_0x5e52('0xbe')]}:undefined,'required':_0x11d1f7[_0x5e52('0x3b')][_0x5e52('0xbe')]?!![]:![]}];}return contacts[_0x5e52('0x40')](_0x11d1f7[_0x5e52('0x3b')],_0x11d1f7[_0x5e52('0x24')],_0x40e7e8,_0x14bd7c);})[_0x5e52('0x2d')](respondWithFilteredResult(_0x208d96,_0x40e7e8))[_0x5e52('0x4c')](APIHandleError(_0x208d96));};exports[_0x5e52('0xbf')]=function(_0x117674,_0x3ce7b6){var _0x5ebf9e;var _0x4dc73c={};var _0x1c4f1c;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x117674['params']['id']},'attributes':['id',_0x5e52('0x31'),'role']})[_0x5e52('0x2d')](handleEntityNotFound(_0x3ce7b6,null))[_0x5e52('0x2d')](function(_0x4efb14){if(!utils[_0x5e52('0x91')](_0x117674[_0x5e52('0x3b')][_0x5e52('0x8d')])){throw new db[(_0x5e52('0x7f'))]['ValidationError'](_0x5e52('0x92'));}_0x5ebf9e=_0x4efb14;var _0x759bc7={};_0x759bc7[_0x5e52('0xc1')]=_['keys'](db[_[_0x5e52('0x94')](_0x117674[_0x5e52('0x3b')][_0x5e52('0x8d')])+_0x5e52('0xc2')][_0x5e52('0xc3')]);_0x759bc7[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x117674[_0x5e52('0x3b')]);_0x759bc7['filters']=_[_0x5e52('0xc5')](_0x759bc7[_0x5e52('0xc1')],_0x759bc7[_0x5e52('0x3b')]);_0x4dc73c[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x759bc7['model'],qs[_0x5e52('0xc6')](_0x117674[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x4dc73c[_0x5e52('0x3e')]=_0x4dc73c['attributes'][_0x5e52('0x44')]?_0x4dc73c[_0x5e52('0x3e')]:_0x759bc7[_0x5e52('0xc1')];_0x4dc73c[_0x5e52('0xc7')]=qs['sort'](_0x117674[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x4dc73c['where']=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x117674[_0x5e52('0x3b')],_0x759bc7['filters']));if(_0x117674[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x4dc73c['where']=_[_0x5e52('0x4f')](_0x4dc73c[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x4dc73c['attributes'],function(_0x214144){var _0x58ad9e={};_0x58ad9e[_0x214144]={'$like':'%'+_0x117674['query'][_0x5e52('0x28')]+'%'};return _0x58ad9e;})});}_0x4dc73c=_[_0x5e52('0x4f')]({},_0x4dc73c,_0x117674[_0x5e52('0x50')]);switch(_0x5ebf9e['role']){case _0x5e52('0x23'):return db[_[_0x5e52('0x94')](_0x117674[_0x5e52('0x3b')][_0x5e52('0x8d')])+_0x5e52('0xc2')][_0x5e52('0x40')](_0x4dc73c);case _0x5e52('0x24'):case _0x5e52('0x1e'):return _0x5ebf9e[_0x5e52('0x22')+_[_0x5e52('0x94')](_0x117674['query'][_0x5e52('0x8d')])+_0x5e52('0x96')](_0x4dc73c);default:throw new db[(_0x5e52('0x7f'))]['ValidationError'](_0x5e52('0xcc'));}})['then'](function(_0x549e72){_0x1c4f1c=_0x549e72[_0x5e52('0x44')];if(!_0x117674[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x4dc73c[_0x5e52('0x17')]=qs['limit'](_0x117674[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x4dc73c[_0x5e52('0x19')]=qs['offset'](_0x117674[_0x5e52('0x3b')][_0x5e52('0x19')]);}switch(_0x5ebf9e['role']){case _0x5e52('0x23'):return db[_[_0x5e52('0x94')](_0x117674['query'][_0x5e52('0x8d')])+_0x5e52('0xc2')][_0x5e52('0x40')](_0x4dc73c);case _0x5e52('0x24'):case'agent':return _0x5ebf9e[_0x5e52('0x22')+_[_0x5e52('0x94')](_0x117674['query']['channel'])+_0x5e52('0x96')](_0x4dc73c);}})[_0x5e52('0x2d')](function(_0x36b8c1){return{'count':_0x1c4f1c,'rows':_0x36b8c1};})[_0x5e52('0x2d')](respondWithResult(_0x3ce7b6,null))[_0x5e52('0x4c')](handleError(_0x3ce7b6,null));};exports[_0x5e52('0xce')]=function(_0x5f3884,_0x369e8e){var _0x3e4e16={};var _0x4907ea={};var _0x38ab7e;var _0x385ca0;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x5f3884[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x369e8e,null))[_0x5e52('0x2d')](function(_0xc936a1){if(_0xc936a1){_0x38ab7e=_0xc936a1;_0x4907ea[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db['UserVoiceQueueRt'][_0x5e52('0xc3')]);_0x4907ea[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x5f3884['query']);_0x4907ea[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x4907ea['model'],_0x4907ea[_0x5e52('0x3b')]);_0x3e4e16['attributes']=_[_0x5e52('0xc5')](_0x4907ea['model'],qs[_0x5e52('0xc6')](_0x5f3884[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x3e4e16[_0x5e52('0x3e')]=_0x3e4e16[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x3e4e16[_0x5e52('0x3e')]:_0x4907ea['model'];_0x3e4e16[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x5f3884['query'][_0x5e52('0xc8')]);_0x3e4e16[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x5f3884[_0x5e52('0x3b')],_0x4907ea['filters']));if(_0x5f3884[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x3e4e16['where']=_[_0x5e52('0x4f')](_0x3e4e16[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x3e4e16[_0x5e52('0x3e')],function(_0x5e5ae5){var _0x15ecb3={};_0x15ecb3[_0x5e5ae5]={'$like':'%'+_0x5f3884['query'][_0x5e52('0x28')]+'%'};return _0x15ecb3;})});}_0x3e4e16=_['merge']({},_0x3e4e16,_0x5f3884['options']);return _0x38ab7e[_0x5e52('0xce')](_0x3e4e16);}})[_0x5e52('0x2d')](function(_0x45ea88){if(_0x45ea88){_0x385ca0=_0x45ea88[_0x5e52('0x44')];if(!_0x5f3884[_0x5e52('0x3b')]['hasOwnProperty'](_0x5e52('0xcd'))){_0x3e4e16[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x5f3884['query'][_0x5e52('0x17')]);_0x3e4e16['offset']=qs[_0x5e52('0x19')](_0x5f3884[_0x5e52('0x3b')]['offset']);}return _0x38ab7e[_0x5e52('0xce')](_0x3e4e16);}})[_0x5e52('0x2d')](function(_0x4d5cd9){if(_0x4d5cd9){return _0x4d5cd9?{'count':_0x385ca0,'rows':_0x4d5cd9}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x369e8e,null))[_0x5e52('0x4c')](handleError(_0x369e8e,null));};exports[_0x5e52('0xcf')]=function(_0x26b5e2,_0x5eb549){var _0x12c48d={};var _0x464c26={};var _0x5698d9;var _0x294dc4;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x26b5e2[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x5eb549,null))[_0x5e52('0x2d')](function(_0x27123b){if(_0x27123b){_0x5698d9=_0x27123b;_0x464c26[_0x5e52('0xc1')]=_['keys'](db[_0x5e52('0xd0')][_0x5e52('0xc3')]);_0x464c26[_0x5e52('0x3b')]=_['keys'](_0x26b5e2[_0x5e52('0x3b')]);_0x464c26[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x464c26[_0x5e52('0xc1')],_0x464c26[_0x5e52('0x3b')]);_0x12c48d[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x464c26['model'],qs[_0x5e52('0xc6')](_0x26b5e2['query']['fields']));_0x12c48d[_0x5e52('0x3e')]=_0x12c48d[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x12c48d['attributes']:_0x464c26[_0x5e52('0xc1')];_0x12c48d['order']=qs['sort'](_0x26b5e2[_0x5e52('0x3b')]['sort']);_0x12c48d[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x26b5e2[_0x5e52('0x3b')],_0x464c26[_0x5e52('0xc9')]));if(_0x26b5e2['query'][_0x5e52('0x28')]){_0x12c48d[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x12c48d[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x12c48d[_0x5e52('0x3e')],function(_0x48d821){var _0x5d35ec={};_0x5d35ec[_0x48d821]={'$like':'%'+_0x26b5e2[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x5d35ec;})});}_0x12c48d=_[_0x5e52('0x4f')]({},_0x12c48d,_0x26b5e2['options']);return _0x5698d9[_0x5e52('0xcf')](_0x12c48d);}})[_0x5e52('0x2d')](function(_0x3d9c22){if(_0x3d9c22){_0x294dc4=_0x3d9c22[_0x5e52('0x44')];if(!_0x26b5e2[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x12c48d['limit']=qs['limit'](_0x26b5e2[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x12c48d[_0x5e52('0x19')]=qs['offset'](_0x26b5e2[_0x5e52('0x3b')]['offset']);}return _0x5698d9['getGroups'](_0x12c48d);}})[_0x5e52('0x2d')](function(_0x11567e){if(_0x11567e){return _0x11567e?{'count':_0x294dc4,'rows':_0x11567e}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x5eb549,null))[_0x5e52('0x4c')](handleError(_0x5eb549,null));};exports[_0x5e52('0xd1')]=function(_0x3d9b47,_0x12dabe){var _0x48aaaa={'raw':!![],'where':{}};var _0x1f8c51={};var _0x11e8fc={'count':0x0,'rows':[]};return db[_0x5e52('0x33')]['findOne']({'where':{'id':_0x3d9b47[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x12dabe,null))[_0x5e52('0x2d')](function(_0xb9940){if(_0xb9940){_0x1f8c51[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xd2')]['rawAttributes']);_0x1f8c51[_0x5e52('0x3b')]=_['keys'](_0x3d9b47[_0x5e52('0x3b')]);_0x1f8c51['filters']=_[_0x5e52('0xc5')](_0x1f8c51[_0x5e52('0xc1')],_0x1f8c51[_0x5e52('0x3b')]);_0x48aaaa[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x1f8c51[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x3d9b47[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x48aaaa[_0x5e52('0x3e')]=_0x48aaaa[_0x5e52('0x3e')]['length']?_0x48aaaa[_0x5e52('0x3e')]:_0x1f8c51[_0x5e52('0xc1')];if(!_0x3d9b47['query'][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x48aaaa[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x3d9b47['query'][_0x5e52('0x17')]);_0x48aaaa[_0x5e52('0x19')]=qs['offset'](_0x3d9b47[_0x5e52('0x3b')][_0x5e52('0x19')]);}_0x48aaaa[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x3d9b47[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x48aaaa['where']=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x3d9b47[_0x5e52('0x3b')],_0x1f8c51[_0x5e52('0xc9')]));_0x48aaaa[_0x5e52('0xcb')]['UserId']=_0xb9940['id'];if(_0x3d9b47[_0x5e52('0x3b')]['filter']){_0x48aaaa['where']=_[_0x5e52('0x4f')](_0x48aaaa[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x48aaaa[_0x5e52('0x3e')],function(_0x25d5be){var _0x59cd62={};_0x59cd62[_0x25d5be]={'$like':'%'+_0x3d9b47['query']['filter']+'%'};return _0x59cd62;})});}_0x48aaaa=_['merge']({},_0x48aaaa,_0x3d9b47[_0x5e52('0x50')]);return db[_0x5e52('0xd2')][_0x5e52('0x18')]({'where':_0x48aaaa[_0x5e52('0xcb')]})[_0x5e52('0x2d')](function(_0x30f38f){_0x11e8fc['count']=_0x30f38f;if(_0x3d9b47['query'][_0x5e52('0x3a')]){_0x48aaaa[_0x5e52('0x4e')]=[{'all':!![]}];}return db[_0x5e52('0xd2')][_0x5e52('0x40')](_0x48aaaa);})[_0x5e52('0x2d')](function(_0x26ac6d){_0x11e8fc[_0x5e52('0x43')]=_0x26ac6d;return _0x11e8fc;});}})[_0x5e52('0x2d')](respondWithFilteredResult(_0x12dabe,_0x48aaaa))['catch'](handleError(_0x12dabe,null));};exports[_0x5e52('0xd3')]=function(_0x57642e,_0x1adc48){var _0x3d5572={'raw':!![],'where':{}};var _0x579ac2={};var _0xf3a668={'count':0x0,'rows':[]};return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x57642e[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x1adc48,null))[_0x5e52('0x2d')](function(_0x1d3db1){if(_0x1d3db1){_0x579ac2[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db['ScreenRecording'][_0x5e52('0xc3')]);_0x579ac2[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x57642e[_0x5e52('0x3b')]);_0x579ac2[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x579ac2[_0x5e52('0xc1')],_0x579ac2[_0x5e52('0x3b')]);_0x3d5572[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x579ac2[_0x5e52('0xc1')],qs['fields'](_0x57642e[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x3d5572[_0x5e52('0x3e')]=_0x3d5572['attributes'][_0x5e52('0x44')]?_0x3d5572['attributes']:_0x579ac2[_0x5e52('0xc1')];if(!_0x57642e[_0x5e52('0x3b')]['hasOwnProperty'](_0x5e52('0xcd'))){_0x3d5572['limit']=qs[_0x5e52('0x17')](_0x57642e['query'][_0x5e52('0x17')]);_0x3d5572['offset']=qs[_0x5e52('0x19')](_0x57642e[_0x5e52('0x3b')][_0x5e52('0x19')]);}_0x3d5572['order']=qs['sort'](_0x57642e['query'][_0x5e52('0xc8')]);_0x3d5572['where']=qs['filters'](_['pick'](_0x57642e[_0x5e52('0x3b')],_0x579ac2[_0x5e52('0xc9')]));_0x3d5572[_0x5e52('0xcb')]['UserId']=_0x1d3db1['id'];if(_0x57642e['query'][_0x5e52('0x28')]){_0x3d5572[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x3d5572[_0x5e52('0xcb')],{'$or':_['map'](_0x3d5572[_0x5e52('0x3e')],function(_0x2aca2d){var _0x5055ce={};_0x5055ce[_0x2aca2d]={'$like':'%'+_0x57642e[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x5055ce;})});}_0x3d5572=_['merge']({},_0x3d5572,_0x57642e[_0x5e52('0x50')]);return db['ScreenRecording']['count']({'where':_0x3d5572[_0x5e52('0xcb')]})['then'](function(_0x4729b3){_0xf3a668[_0x5e52('0x18')]=_0x4729b3;if(_0x57642e[_0x5e52('0x3b')][_0x5e52('0x3a')]){_0x3d5572[_0x5e52('0x4e')]=[{'all':!![]}];}return db[_0x5e52('0xd4')][_0x5e52('0x40')](_0x3d5572);})[_0x5e52('0x2d')](function(_0x36e0f7){_0xf3a668[_0x5e52('0x43')]=_0x36e0f7;return _0xf3a668;});}})[_0x5e52('0x2d')](respondWithFilteredResult(_0x1adc48,_0x3d5572))[_0x5e52('0x4c')](handleError(_0x1adc48,null));};exports['getChatInteractions']=function(_0x52c8e3,_0x384756){var _0x2ce4c7={};var _0x2f6bb3={};var _0xf7b1bc;var _0x392eec;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x52c8e3[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x384756,null))[_0x5e52('0x2d')](function(_0x30799d){if(_0x30799d){_0xf7b1bc=_0x30799d;_0x2f6bb3[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xd5')][_0x5e52('0xc3')]);_0x2f6bb3['query']=_[_0x5e52('0xc4')](_0x52c8e3[_0x5e52('0x3b')]);_0x2f6bb3[_0x5e52('0xc9')]=_['intersection'](_0x2f6bb3[_0x5e52('0xc1')],_0x2f6bb3[_0x5e52('0x3b')]);_0x2ce4c7['attributes']=_[_0x5e52('0xc5')](_0x2f6bb3[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x52c8e3[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x2ce4c7['attributes']=_0x2ce4c7[_0x5e52('0x3e')]['length']?_0x2ce4c7[_0x5e52('0x3e')]:_0x2f6bb3[_0x5e52('0xc1')];_0x2ce4c7[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x52c8e3['query']['sort']);_0x2ce4c7[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x52c8e3[_0x5e52('0x3b')],_0x2f6bb3['filters']));if(_0x52c8e3[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x2ce4c7[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x2ce4c7[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x2ce4c7[_0x5e52('0x3e')],function(_0x444771){var _0x57115a={};_0x57115a[_0x444771]={'$like':'%'+_0x52c8e3['query']['filter']+'%'};return _0x57115a;})});}_0x2ce4c7=_['merge']({},_0x2ce4c7,_0x52c8e3['options']);return _0xf7b1bc[_0x5e52('0xd6')](_0x2ce4c7);}})[_0x5e52('0x2d')](function(_0x45fef7){if(_0x45fef7){_0x392eec=_0x45fef7[_0x5e52('0x44')];if(!_0x52c8e3[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x2ce4c7[_0x5e52('0x17')]=qs['limit'](_0x52c8e3[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x2ce4c7[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x52c8e3[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0xf7b1bc[_0x5e52('0xd6')](_0x2ce4c7);}})[_0x5e52('0x2d')](function(_0x241b52){if(_0x241b52){return _0x241b52?{'count':_0x392eec,'rows':_0x241b52}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x384756,null))[_0x5e52('0x4c')](handleError(_0x384756,null));};exports[_0x5e52('0xd7')]=function(_0x52fc58,_0x22b8a1){var _0x4bccc2={};var _0x48154f={};var _0x39ab49;var _0x473bff;return db[_0x5e52('0x33')]['findOne']({'where':{'id':_0x52fc58['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x22b8a1,null))[_0x5e52('0x2d')](function(_0x2477cc){if(_0x2477cc){_0x39ab49=_0x2477cc;_0x48154f[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xd8')][_0x5e52('0xc3')]);_0x48154f[_0x5e52('0x3b')]=_['keys'](_0x52fc58[_0x5e52('0x3b')]);_0x48154f[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x48154f['model'],_0x48154f[_0x5e52('0x3b')]);_0x4bccc2[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x48154f['model'],qs[_0x5e52('0xc6')](_0x52fc58[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x4bccc2[_0x5e52('0x3e')]=_0x4bccc2['attributes'][_0x5e52('0x44')]?_0x4bccc2['attributes']:_0x48154f[_0x5e52('0xc1')];_0x4bccc2['order']=qs[_0x5e52('0xc8')](_0x52fc58[_0x5e52('0x3b')]['sort']);_0x4bccc2[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x52fc58[_0x5e52('0x3b')],_0x48154f['filters']));if(_0x52fc58[_0x5e52('0x3b')]['filter']){_0x4bccc2['where']=_[_0x5e52('0x4f')](_0x4bccc2[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x4bccc2[_0x5e52('0x3e')],function(_0x9c79d6){var _0x4a913e={};_0x4a913e[_0x9c79d6]={'$like':'%'+_0x52fc58[_0x5e52('0x3b')]['filter']+'%'};return _0x4a913e;})});}_0x4bccc2=_[_0x5e52('0x4f')]({},_0x4bccc2,_0x52fc58[_0x5e52('0x50')]);return _0x39ab49[_0x5e52('0xd7')](_0x4bccc2);}})['then'](function(_0x4a2b54){if(_0x4a2b54){_0x473bff=_0x4a2b54[_0x5e52('0x44')];if(!_0x52fc58['query'][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x4bccc2[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x52fc58['query'][_0x5e52('0x17')]);_0x4bccc2[_0x5e52('0x19')]=qs['offset'](_0x52fc58[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x39ab49['getOpenchannelInteractions'](_0x4bccc2);}})[_0x5e52('0x2d')](function(_0x2b5fa4){if(_0x2b5fa4){return _0x2b5fa4?{'count':_0x473bff,'rows':_0x2b5fa4}:null;}})['then'](respondWithResult(_0x22b8a1,null))[_0x5e52('0x4c')](handleError(_0x22b8a1,null));};exports['getMailInteractions']=function(_0x165695,_0x39ca09){var _0x5b22db={'raw':!![],'where':{}};var _0x327d5d={};var _0x5a5781={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x165695[_0x5e52('0x54')]['id']}})['then'](handleEntityNotFound(_0x39ca09,null))['then'](function(_0x34ea5d){if(_0x34ea5d){_0x327d5d[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xd9')][_0x5e52('0xc3')]);_0x327d5d[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x165695[_0x5e52('0x3b')]);_0x327d5d[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x327d5d[_0x5e52('0xc1')],_0x327d5d[_0x5e52('0x3b')]);_0x5b22db['attributes']=_[_0x5e52('0xc5')](_0x327d5d[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x165695['query'][_0x5e52('0xc6')]));_0x5b22db[_0x5e52('0x3e')]=_0x5b22db[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x5b22db[_0x5e52('0x3e')]:_0x327d5d[_0x5e52('0xc1')];if(!_0x165695[_0x5e52('0x3b')]['hasOwnProperty'](_0x5e52('0xcd'))){_0x5b22db[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x165695[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x5b22db[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x165695[_0x5e52('0x3b')][_0x5e52('0x19')]);}_0x5b22db[_0x5e52('0xc7')]=qs['sort'](_0x165695[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x5b22db[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x165695[_0x5e52('0x3b')],_0x327d5d[_0x5e52('0xc9')]));_0x5b22db[_0x5e52('0xcb')][_0x5e52('0xda')]=_0x34ea5d['id'];if(_0x165695[_0x5e52('0x3b')]['filter']){_0x5b22db[_0x5e52('0xcb')]=_['merge'](_0x5b22db[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x5b22db[_0x5e52('0x3e')],function(_0x8fc315){var _0x544505={};_0x544505[_0x8fc315]={'$like':'%'+_0x165695[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x544505;})});}_0x5b22db=_[_0x5e52('0x4f')]({},_0x5b22db,_0x165695[_0x5e52('0x50')]);return db[_0x5e52('0xd9')]['count']({'where':_0x5b22db['where']})[_0x5e52('0x2d')](function(_0xee19fc){_0x5a5781[_0x5e52('0x18')]=_0xee19fc;if(_0x165695['query'][_0x5e52('0x3a')]){_0x5b22db[_0x5e52('0x4e')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x5b22db);})[_0x5e52('0x2d')](function(_0x89190d){_0x5a5781[_0x5e52('0x43')]=_0x89190d;return _0x5a5781;});}})[_0x5e52('0x2d')](respondWithFilteredResult(_0x39ca09,_0x5b22db))[_0x5e52('0x4c')](handleError(_0x39ca09,null));};exports[_0x5e52('0xdb')]=function(_0x12fb80,_0x292acd){var _0x449e0b={};var _0xdf0bd9={};var _0x196775;var _0x23bd23;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x12fb80[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x292acd,null))[_0x5e52('0x2d')](function(_0xa6a952){if(_0xa6a952){_0x196775=_0xa6a952;_0xdf0bd9[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xdc')]['rawAttributes']);_0xdf0bd9[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x12fb80[_0x5e52('0x3b')]);_0xdf0bd9[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0xdf0bd9[_0x5e52('0xc1')],_0xdf0bd9[_0x5e52('0x3b')]);_0x449e0b[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0xdf0bd9['model'],qs[_0x5e52('0xc6')](_0x12fb80[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x449e0b[_0x5e52('0x3e')]=_0x449e0b['attributes'][_0x5e52('0x44')]?_0x449e0b['attributes']:_0xdf0bd9[_0x5e52('0xc1')];_0x449e0b[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x12fb80[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x449e0b['where']=qs[_0x5e52('0xc9')](_['pick'](_0x12fb80[_0x5e52('0x3b')],_0xdf0bd9['filters']));if(_0x12fb80[_0x5e52('0x3b')]['filter']){_0x449e0b[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x449e0b[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x449e0b['attributes'],function(_0x33bfe6){var _0x218bba={};_0x218bba[_0x33bfe6]={'$like':'%'+_0x12fb80['query'][_0x5e52('0x28')]+'%'};return _0x218bba;})});}_0x449e0b=_['merge']({},_0x449e0b,_0x12fb80[_0x5e52('0x50')]);return _0x196775['getSmsInteractions'](_0x449e0b);}})[_0x5e52('0x2d')](function(_0x2ec48a){if(_0x2ec48a){_0x23bd23=_0x2ec48a['length'];if(!_0x12fb80['query'][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x449e0b[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x12fb80[_0x5e52('0x3b')]['limit']);_0x449e0b[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x12fb80[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x196775[_0x5e52('0xdb')](_0x449e0b);}})['then'](function(_0x36bfc7){if(_0x36bfc7){return _0x36bfc7?{'count':_0x23bd23,'rows':_0x36bfc7}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x292acd,null))[_0x5e52('0x4c')](handleError(_0x292acd,null));};exports[_0x5e52('0xdd')]=function(_0x362ff1,_0x42c3c2){var _0x1ac5be={};var _0x3a711d={};var _0x260153;var _0x18027d;return db['User']['findOne']({'where':{'id':_0x362ff1[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x42c3c2,null))[_0x5e52('0x2d')](function(_0x319215){if(_0x319215){_0x260153=_0x319215;_0x3a711d[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xde')]['rawAttributes']);_0x3a711d['query']=_[_0x5e52('0xc4')](_0x362ff1[_0x5e52('0x3b')]);_0x3a711d[_0x5e52('0xc9')]=_['intersection'](_0x3a711d['model'],_0x3a711d[_0x5e52('0x3b')]);_0x1ac5be[_0x5e52('0x3e')]=_['intersection'](_0x3a711d[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x362ff1[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x1ac5be['attributes']=_0x1ac5be['attributes'][_0x5e52('0x44')]?_0x1ac5be['attributes']:_0x3a711d['model'];_0x1ac5be[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x362ff1[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x1ac5be['where']=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x362ff1[_0x5e52('0x3b')],_0x3a711d[_0x5e52('0xc9')]));if(_0x362ff1[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x1ac5be['where']=_[_0x5e52('0x4f')](_0x1ac5be[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x1ac5be[_0x5e52('0x3e')],function(_0x110af8){var _0x27368d={};_0x27368d[_0x110af8]={'$like':'%'+_0x362ff1[_0x5e52('0x3b')]['filter']+'%'};return _0x27368d;})});}_0x1ac5be=_['merge']({},_0x1ac5be,_0x362ff1[_0x5e52('0x50')]);return _0x260153[_0x5e52('0xdd')](_0x1ac5be);}})['then'](function(_0x3c4cf3){if(_0x3c4cf3){_0x18027d=_0x3c4cf3[_0x5e52('0x44')];if(!_0x362ff1['query'][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x1ac5be[_0x5e52('0x17')]=qs['limit'](_0x362ff1[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x1ac5be[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x362ff1[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x260153[_0x5e52('0xdd')](_0x1ac5be);}})[_0x5e52('0x2d')](function(_0x10c5a2){if(_0x10c5a2){return _0x10c5a2?{'count':_0x18027d,'rows':_0x10c5a2}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x42c3c2,null))[_0x5e52('0x4c')](handleError(_0x42c3c2,null));};exports[_0x5e52('0xdf')]=function(_0x43049e,_0x56c2ec){var _0x16bfca={};var _0xb5b9dd={};var _0x4f3e68;var _0x12a6b9;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x43049e[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x56c2ec,null))[_0x5e52('0x2d')](function(_0xe28698){if(_0xe28698){_0x4f3e68=_0xe28698;_0xb5b9dd[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db['WhatsappInteraction'][_0x5e52('0xc3')]);_0xb5b9dd[_0x5e52('0x3b')]=_['keys'](_0x43049e[_0x5e52('0x3b')]);_0xb5b9dd[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0xb5b9dd[_0x5e52('0xc1')],_0xb5b9dd[_0x5e52('0x3b')]);_0x16bfca[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0xb5b9dd[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x43049e['query']['fields']));_0x16bfca[_0x5e52('0x3e')]=_0x16bfca[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x16bfca[_0x5e52('0x3e')]:_0xb5b9dd[_0x5e52('0xc1')];_0x16bfca[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x43049e[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x16bfca[_0x5e52('0xcb')]=qs['filters'](_['pick'](_0x43049e['query'],_0xb5b9dd['filters']));if(_0x43049e[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x16bfca[_0x5e52('0xcb')]=_['merge'](_0x16bfca[_0x5e52('0xcb')],{'$or':_['map'](_0x16bfca[_0x5e52('0x3e')],function(_0x5bcafe){var _0x5a1eb1={};_0x5a1eb1[_0x5bcafe]={'$like':'%'+_0x43049e[_0x5e52('0x3b')]['filter']+'%'};return _0x5a1eb1;})});}_0x16bfca=_[_0x5e52('0x4f')]({},_0x16bfca,_0x43049e[_0x5e52('0x50')]);return _0x4f3e68[_0x5e52('0xdf')](_0x16bfca);}})[_0x5e52('0x2d')](function(_0x1cd3d7){if(_0x1cd3d7){_0x12a6b9=_0x1cd3d7[_0x5e52('0x44')];if(!_0x43049e[_0x5e52('0x3b')]['hasOwnProperty'](_0x5e52('0xcd'))){_0x16bfca[_0x5e52('0x17')]=qs['limit'](_0x43049e[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x16bfca[_0x5e52('0x19')]=qs['offset'](_0x43049e['query'][_0x5e52('0x19')]);}return _0x4f3e68[_0x5e52('0xdf')](_0x16bfca);}})[_0x5e52('0x2d')](function(_0x47c3d2){if(_0x47c3d2){return _0x47c3d2?{'count':_0x12a6b9,'rows':_0x47c3d2}:null;}})['then'](respondWithResult(_0x56c2ec,null))[_0x5e52('0x4c')](handleError(_0x56c2ec,null));};exports[_0x5e52('0xe0')]=function(_0x36cfd6,_0x5308c1,_0x225419){var _0x376b3c;var _0x15370d;var _0xb08409;var _0x4ae7ed=!_[_0x5e52('0x5d')](_0x36cfd6['params']['id'])?_0x36cfd6['params']['id']:!_[_0x5e52('0x5d')](_0x36cfd6[_0x5e52('0x24')]['id'])?_0x36cfd6[_0x5e52('0x24')]['id']:null;return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x4ae7ed,'role':{'$or':[_0x5e52('0x23'),_0x5e52('0x24'),_0x5e52('0x1e')]}},'attributes':['id',_0x5e52('0x31'),'phone',_0x5e52('0xe1'),_0x5e52('0x1d'),_0x5e52('0x57'),_0x5e52('0x8f')]})['then'](function(_0x273d71){if(_0x273d71){if(_0x273d71['role']==='agent'){_0x376b3c=_0x273d71;if(_0x36cfd6['body'][_0x5e52('0x90')]){_0xb08409=util[_0x5e52('0x9b')](_0x5e52('0xe2'),_0x376b3c[_0x36cfd6[_0x5e52('0x53')][_0x5e52('0x90')]]);}else if(_0x36cfd6[_0x5e52('0x53')]['intrf']){_0xb08409=util[_0x5e52('0x9b')]('SIP/%s',_0x36cfd6[_0x5e52('0x53')][_0x5e52('0xe3')]);}else{_0xb08409=util['format'](_0x5e52('0xe4'),_0x376b3c[_0x5e52('0x31')]);}socket['to'](util[_0x5e52('0x9b')](_0x5e52('0xe5'),_0x376b3c['name']))[_0x5e52('0x1f')](_0x5e52('0xe6'),{'user':{'id':_0x376b3c['id'],'name':_0x376b3c['name']},'ip':_0x36cfd6[_0x5e52('0xe7')][_0x5e52('0xe8')]||_0x36cfd6[_0x5e52('0xe9')][_0x5e52('0xea')]||_0x36cfd6[_0x5e52('0xeb')][_0x5e52('0xea')]||_0x36cfd6[_0x5e52('0xe9')][_0x5e52('0xeb')][_0x5e52('0xea')]});return db[_0x5e52('0x9d')][_0x5e52('0x21')]({'where':{'membername':_0x376b3c[_0x5e52('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x5e52('0x7f'))][(_0x5e52('0x83'))](_0x5e52('0xec'));}})[_0x5e52('0x2d')](function(){if(_0x376b3c){return _0x376b3c[_0x5e52('0xed')]({'raw':!![]});}})[_0x5e52('0x2d')](function(_0x4a4b3a){if(_0x376b3c){if(_0x4a4b3a){_0x15370d=_0x4a4b3a;if(_0x15370d[_0x5e52('0x44')]){var _0x7af096=_0x15370d['map'](function(_0x1c5719){var _0x2cfea0={'membername':_0x376b3c[_0x5e52('0x31')],'UserId':_0x376b3c['id'],'queue_name':_0x1c5719['name'],'VoiceQueueId':_0x1c5719['id'],'interface':_0xb08409,'paused':_0x376b3c['loginInPause']||![],'penalty':_0x1c5719[_0x5e52('0xee')]||0x0};return db[_0x5e52('0x9d')][_0x5e52('0x9e')](_0x2cfea0);});return Promise[_0x5e52('0x4b')](_0x7af096);}}}})[_0x5e52('0x2d')](function(){if(_0x376b3c){return db[_0x5e52('0xef')]['findAll']({'where':{'membername':_0x376b3c[_0x5e52('0x31')],'exitAt':null}});}})[_0x5e52('0x2d')](function(_0x23d6e2){if(_0x376b3c){var _0x46f07b=[];_0x23d6e2[_0x5e52('0xf0')](function(_0x56630b){_0x46f07b[_0x5e52('0x3f')](_0x56630b[_0x5e52('0x1c')]({'exitAt':moment()[_0x5e52('0x9b')](_0x5e52('0xf1'))}));});return Promise[_0x5e52('0x4b')](_0x46f07b);}})[_0x5e52('0x2d')](function(){if(_0x376b3c){var _0x1da737=[];var _0x1ec7fe=[];var _0x1449e0=utils[_0x5e52('0xf2')]();var _0xa2bb90={'membername':_0x376b3c[_0x5e52('0x31')],'interface':_0xb08409,'enterAt':moment()['format'](_0x5e52('0xf1')),'role':_0x376b3c[_0x5e52('0x1d')],'internal':_0x376b3c[_0x5e52('0x57')]};_0x1449e0['forEach'](function(_0x3bfd5f){_0x1da737[_0x5e52('0x3f')](_[_0x5e52('0x4f')]({'channel':_0x3bfd5f,'type':'LOGIN','data1':_0x36cfd6['body'][_0x5e52('0xf3')],'data2':_0xb08409},_0xa2bb90));if(_0x376b3c[_0x5e52('0x8f')]){_0x1ec7fe[_0x5e52('0x3f')](_[_0x5e52('0x4f')]({'channel':_0x3bfd5f,'type':_0x5e52('0xf4'),'data1':_0x5e52('0xf5')},_0xa2bb90));}});return db['MemberReport']['bulkCreate'](_0x1da737[_0x5e52('0xf6')](_0x1ec7fe),{'individualHooks':!![]});}})['then'](function(){if(_0x376b3c){return _0x376b3c[_0x5e52('0x1c')]({'online':!![],'lastLoginAt':moment()[_0x5e52('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x376b3c[_0x5e52('0x8f')]||![],'mailPause':_0x376b3c[_0x5e52('0x8f')]||![],'chatPause':_0x376b3c[_0x5e52('0x8f')]||![],'faxPause':_0x376b3c[_0x5e52('0x8f')]||![],'smsPause':_0x376b3c[_0x5e52('0x8f')]||![],'openchannelPause':_0x376b3c['loginInPause']||![],'whatsappPause':_0x376b3c[_0x5e52('0x8f')]||![],'pauseType':_0x376b3c[_0x5e52('0x8f')]?_0x5e52('0xf5'):null,'interface':_0xb08409,'lastPauseAt':moment()[_0x5e52('0x9b')](_0x5e52('0xf1'))});}})[_0x5e52('0x2d')](function(_0x4e4752){if(_0x36cfd6[_0x5e52('0xf7')]){return _0x225419();}else{return Promise[_0x5e52('0xf8')](_0x4e4752)['then'](respondWithResult(_0x5308c1,null));}})['catch'](handleError(_0x5308c1,null));};exports['logout']=function(_0x1a2464,_0x307eb3){var _0x365945;return db['User']['find']({'where':{'id':_0x1a2464['params']['id'],'role':_0x5e52('0x1e')},'attributes':['id',_0x5e52('0x31'),_0x5e52('0x1d')]})['then'](handleEntityNotFound(_0x307eb3,null))[_0x5e52('0x2d')](function(_0x94bf58){if(_0x94bf58){_0x365945=_0x94bf58;return db[_0x5e52('0x9d')][_0x5e52('0x21')]({'where':{'membername':_0x365945[_0x5e52('0x31')]},'individualHooks':!![]});}})[_0x5e52('0x2d')](function(){return db[_0x5e52('0xef')][_0x5e52('0x40')]({'where':{'membername':_0x365945[_0x5e52('0x31')],'exitAt':null}});})[_0x5e52('0x2d')](function(_0xca05fd){var _0xcc4ac9=[];_0xca05fd[_0x5e52('0xf0')](function(_0x4bb837){_0xcc4ac9['push'](_0x4bb837[_0x5e52('0x1c')]({'exitAt':moment()[_0x5e52('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0xcc4ac9);})['then'](function(){return _0x365945[_0x5e52('0x1c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5e52('0x2d')](respondWithResult(_0x307eb3,null))['catch'](handleError(_0x307eb3,null));};exports[_0x5e52('0xf9')]=function(_0x537542,_0xd1a2a){var _0x5e9f1f;return db[_0x5e52('0x9d')]['update']({'paused':0x1},{'where':{'UserId':_0x537542[_0x5e52('0x54')]['id']},'individualHooks':!![]})[_0x5e52('0x2d')](function(){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x537542[_0x5e52('0x54')]['id'],'role':'agent'},'attributes':['id',_0x5e52('0x31'),'role','internal',_0x5e52('0x90'),_0x5e52('0x8e')]});})[_0x5e52('0x2d')](handleEntityNotFound(_0xd1a2a,null))[_0x5e52('0x2d')](function(_0x485a54){if(_0x485a54){_0x5e9f1f=_0x485a54;return db[_0x5e52('0xef')][_0x5e52('0x40')]({'where':{'membername':_0x5e9f1f[_0x5e52('0x31')],'type':'PAUSE','exitAt':null}});}})[_0x5e52('0x2d')](function(_0x38e913){if(_0x38e913[_0x5e52('0x44')]){var _0x2544df=moment()[_0x5e52('0x9b')](_0x5e52('0xf1'));for(var _0x1f195f=0x0,_0x4a44d0=_0x38e913['length'];_0x1f195f<_0x4a44d0;_0x1f195f++){_0x38e913[_0x1f195f][_0x5e52('0xfa')]({'exitAt':_0x2544df});}}})[_0x5e52('0x2d')](function(){var _0x1b02c1=[];var _0x347781=utils[_0x5e52('0xf2')]();_0x347781[_0x5e52('0xf0')](function(_0x2f55c4){_0x1b02c1[_0x5e52('0x3f')]({'channel':_0x2f55c4,'membername':_0x5e9f1f[_0x5e52('0x31')],'interface':_[_0x5e52('0x5d')](_0x5e9f1f[_0x5e52('0x90')])?util[_0x5e52('0x9b')](_0x5e52('0xe4'),_0x5e9f1f[_0x5e52('0x31')]):_0x5e9f1f[_0x5e52('0x90')],'type':_0x5e52('0xf4'),'enterAt':moment()['format'](_0x5e52('0xf1')),'data1':_0x537542[_0x5e52('0x53')][_0x5e52('0x34')]||_0x5e52('0xfb'),'role':_0x5e9f1f[_0x5e52('0x1d')],'internal':_0x5e9f1f['internal']});});return db['MemberReport'][_0x5e52('0xfc')](_0x1b02c1,{'individualHooks':!![]});})[_0x5e52('0x2d')](function(){return _0x5e9f1f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x537542[_0x5e52('0x53')][_0x5e52('0x34')]||_0x5e52('0xfb'),'lastPauseAt':moment()[_0x5e52('0x9b')](_0x5e52('0xf1'))});})[_0x5e52('0x2d')](respondWithResult(_0xd1a2a,null))[_0x5e52('0x4c')](handleError(_0xd1a2a,null));};exports[_0x5e52('0xfd')]=function(_0x8cbfc7,_0x5f0be){if(_0x8cbfc7[_0x5e52('0x53')][_0x5e52('0x8d')]&&!utils[_0x5e52('0x91')](_0x8cbfc7[_0x5e52('0x53')]['channel'])){throw new APIBadRequestError(util[_0x5e52('0x9b')](_0x5e52('0xfe'),_0x8cbfc7[_0x5e52('0x53')][_0x5e52('0x8d')]));}return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x8cbfc7[_0x5e52('0x54')]['id']},'attributes':['id',_0x5e52('0x31'),_0x5e52('0x1d'),_0x5e52('0x57'),_0x5e52('0x90'),_0x5e52('0x8e'),'voicePause',_0x5e52('0xff'),'chatPause','faxPause',_0x5e52('0x100'),_0x5e52('0x101'),_0x5e52('0x102'),'pauseType',_0x5e52('0x103')]})[_0x5e52('0x2d')](function(_0x5905ee){if(!_0x5905ee){throw new APINotFoundError(util['format'](_0x5e52('0xb7'),_0x8cbfc7[_0x5e52('0x54')]['id']));}return _0x5905ee['unpause'](_0x8cbfc7[_0x5e52('0x53')]['channel']);})[_0x5e52('0x2d')](respondWithResult(_0x5f0be,null))[_0x5e52('0x4c')](APIHandleError(_0x5f0be));};exports[_0x5e52('0x104')]=function(_0x3efc21,_0x5dbaa6){var _0x3f2a64={};var _0x2c8048={};var _0x30284f;var _0x1d28cf;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x3efc21[_0x5e52('0x54')]['id']}})['then'](handleEntityNotFound(_0x5dbaa6,null))['then'](function(_0x101d7f){if(_0x101d7f){_0x30284f=_0x101d7f;_0x2c8048[_0x5e52('0xc1')]=_['keys'](db['Team']['rawAttributes']);_0x2c8048[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x3efc21[_0x5e52('0x3b')]);_0x2c8048[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x2c8048[_0x5e52('0xc1')],_0x2c8048[_0x5e52('0x3b')]);_0x3f2a64[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x2c8048[_0x5e52('0xc1')],qs['fields'](_0x3efc21[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x3f2a64['attributes']=_0x3f2a64[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x3f2a64[_0x5e52('0x3e')]:_0x2c8048[_0x5e52('0xc1')];_0x3f2a64[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x3efc21['query'][_0x5e52('0xc8')]);_0x3f2a64['where']=qs[_0x5e52('0xc9')](_['pick'](_0x3efc21['query'],_0x2c8048[_0x5e52('0xc9')]));if(_0x3efc21['query']['filter']){_0x3f2a64['where']=_[_0x5e52('0x4f')](_0x3f2a64[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x3f2a64[_0x5e52('0x3e')],function(_0x26385a){var _0x2ea65e={};_0x2ea65e[_0x26385a]={'$like':'%'+_0x3efc21[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x2ea65e;})});}_0x3f2a64=_[_0x5e52('0x4f')]({},_0x3f2a64,_0x3efc21[_0x5e52('0x50')]);return _0x30284f[_0x5e52('0x104')](_0x3f2a64);}})[_0x5e52('0x2d')](function(_0x2135fa){if(_0x2135fa){_0x1d28cf=_0x2135fa[_0x5e52('0x44')];if(!_0x3efc21['query']['hasOwnProperty'](_0x5e52('0xcd'))){_0x3f2a64[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x3efc21[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x3f2a64['offset']=qs[_0x5e52('0x19')](_0x3efc21[_0x5e52('0x3b')]['offset']);}return _0x30284f[_0x5e52('0x104')](_0x3f2a64);}})[_0x5e52('0x2d')](function(_0x4be067){if(_0x4be067){return _0x4be067?{'count':_0x1d28cf,'rows':_0x4be067}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x5dbaa6,null))[_0x5e52('0x4c')](handleError(_0x5dbaa6,null));};exports[_0x5e52('0x105')]=function(_0x4bdd3f,_0x3de5ae){var _0xd9ff55=_0x4bdd3f[_0x5e52('0x54')]['id'];var _0x118611=_0x4bdd3f[_0x5e52('0x53')]?_0x4bdd3f[_0x5e52('0x53')][_0x5e52('0x56')]:null;var _0x2d96f9=[];return Promise[_0x5e52('0xf8')]()[_0x5e52('0x2d')](function(){if(!_0x118611)throw new APIBadRequestError(_0x5e52('0x106'));})[_0x5e52('0x2d')](function(){return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0xd9ff55}});})[_0x5e52('0x2d')](function(_0x506ebf){if(!_0x506ebf)throw new APINotFoundError(util[_0x5e52('0x9b')](_0x5e52('0xb7'),_0x4bdd3f[_0x5e52('0x54')]['id']));return db[_0x5e52('0x5f')][_0x5e52('0x107')](function(_0x5c89be){return _0x506ebf['addTeams'](_0x118611,{'transaction':_0x5c89be})[_0x5e52('0x2d')](function(){return db[_0x5e52('0x108')][_0x5e52('0x40')]({'where':{'id':{'$in':_0x118611}}});})['then'](function(_0x267b3d){var _0x1358d5=_['map'](_0x267b3d,function(_0x36cc61){return _0x36cc61[_0x5e52('0x109')]();});return Promise['all'](_0x1358d5);})[_0x5e52('0x2d')](function(_0x2f7e20){_0x2d96f9=_['flattenDeep'](_0x2f7e20);var _0x3871ea=_[_0x5e52('0x2a')](_0x2d96f9,function(_0x2c12ac){return _0x2c12ac['addAgent'](_0x506ebf['id'],{'transaction':_0x5c89be});});return Promise[_0x5e52('0x4b')](_0x3871ea);})[_0x5e52('0x2d')](function(){if(!_0x506ebf[_0x5e52('0x8e')])return;var _0x1475d6=_['filter'](_0x2d96f9,function(_0x5629bf){return _0x5629bf[_0x5e52('0x10a')](_0x5e52('0x8d'))==='Voice';});var _0x1ac107=_[_0x5e52('0x2a')](_0x1475d6,function(_0x4a3f52){return db[_0x5e52('0x9d')][_0x5e52('0x9e')]({'membername':_0x506ebf[_0x5e52('0x31')],'UserId':_0x506ebf['id'],'queue_name':_0x4a3f52[_0x5e52('0x31')],'VoiceQueueId':_0x4a3f52['id'],'interface':_[_0x5e52('0x5d')](_0x506ebf[_0x5e52('0x90')])?util[_0x5e52('0x9b')]('SIP/%s',_0x506ebf[_0x5e52('0x31')]):_0x506ebf[_0x5e52('0x90')],'paused':_0x506ebf[_0x5e52('0x9c')]||![],'penalty':_0x506ebf[_0x5e52('0x10b')]},{'transaction':_0x5c89be});});return Promise[_0x5e52('0x4b')](_0x1ac107);})[_0x5e52('0x2d')](function(){return db[_0x5e52('0x10c')][_0x5e52('0x40')]({'where':{'teamId':{'$in':_0x118611}}});})[_0x5e52('0x2d')](function(_0x18449d){var _0x1dca01=_[_0x5e52('0x2a')](_0x18449d,function(_0x137415){return db[_0x5e52('0x10d')][_0x5e52('0x72')]({'UserId':_0x506ebf['id'],'VoicePrefixId':_0x137415[_0x5e52('0x10e')]},{'transaction':_0x5c89be});});return Promise[_0x5e52('0x4b')](_0x1dca01);});});})[_0x5e52('0x2d')](function(){for(var _0x28f1f9=0x0;_0x28f1f9<_0x2d96f9[_0x5e52('0x44')];_0x28f1f9++){var _0x492d60=_0x2d96f9[_0x28f1f9][_0x5e52('0x10a')](_0x5e52('0x8d'));var _0x3b735b=_0x492d60+_0x5e52('0x97');socket[_0x5e52('0x1f')](_0x5e52('0x24')+_0x492d60+_0x5e52('0x98'),{'UserId':_0xd9ff55,['queueField']:_0x2d96f9[_0x28f1f9]['id']});}})[_0x5e52('0x2d')](respondWithStatusCode(_0x3de5ae,null))[_0x5e52('0x4c')](APIHandleError(_0x3de5ae));};exports[_0x5e52('0x10f')]=function(_0x42ecb0,_0x54f234){var _0x558462=_0x42ecb0[_0x5e52('0x54')]['id'];var _0x48e9d9=null;if(_0x42ecb0['query'][_0x5e52('0x56')]){_0x48e9d9=_[_0x5e52('0x110')](_0x42ecb0[_0x5e52('0x3b')][_0x5e52('0x56')])?_0x42ecb0[_0x5e52('0x3b')][_0x5e52('0x56')]:[_0x42ecb0[_0x5e52('0x3b')][_0x5e52('0x56')]];}var _0x27fe9c=[];return Promise[_0x5e52('0xf8')]()['then'](function(){if(!_0x48e9d9)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x558462}});})[_0x5e52('0x2d')](function(_0x1be389){if(!_0x1be389)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x42ecb0[_0x5e52('0x54')]['id']));return db[_0x5e52('0x5f')][_0x5e52('0x107')](function(_0xada7e8){return _0x1be389[_0x5e52('0x10f')](_0x48e9d9,{'transaction':_0xada7e8})[_0x5e52('0x2d')](function(){return db[_0x5e52('0x108')][_0x5e52('0x40')]({'where':{'id':{'$in':_0x48e9d9}}});})[_0x5e52('0x2d')](function(_0x2c2d75){var _0x4aa4ca=_[_0x5e52('0x2a')](_0x2c2d75,function(_0x360d42){return _0x360d42[_0x5e52('0x109')]();});return Promise[_0x5e52('0x4b')](_0x4aa4ca);})[_0x5e52('0x2d')](function(_0x2147ab){_0x27fe9c=_['flattenDeep'](_0x2147ab);var _0x3c7246=_[_0x5e52('0x2a')](_0x27fe9c,function(_0x4cf259){return _0x4cf259[_0x5e52('0x111')](_0x1be389['id'],{'transaction':_0xada7e8});});return Promise[_0x5e52('0x4b')](_0x3c7246);})['then'](function(){if(!_0x1be389[_0x5e52('0x8e')])return;var _0x1511cd=_[_0x5e52('0x28')](_0x27fe9c,function(_0x49faf9){return _0x49faf9['getDataValue'](_0x5e52('0x8d'))===_0x5e52('0x112');});var _0xb31ca1=_[_0x5e52('0x2a')](_0x1511cd,function(_0xd7832){return db[_0x5e52('0x9d')][_0x5e52('0x21')]({'where':{'VoiceQueueId':_0xd7832['id'],'UserId':_0x1be389['id']},'transaction':_0xada7e8});});return Promise['all'](_0xb31ca1);})[_0x5e52('0x2d')](function(){return db['TeamVoicePrefix'][_0x5e52('0x40')]({'where':{'teamId':{'$in':_0x48e9d9}}});})['then'](function(_0x4e9e5f){var _0x833a84=_[_0x5e52('0x2a')](_0x4e9e5f,function(_0x1c5757){return db[_0x5e52('0x10d')][_0x5e52('0x21')]({'where':{'UserId':_0x1be389['id'],'VoicePrefixId':_0x1c5757['VoicePrefixId']}},{'transaction':_0xada7e8});});return Promise['all'](_0x833a84);});});})['then'](function(){for(var _0x2aefb6=0x0;_0x2aefb6<_0x27fe9c[_0x5e52('0x44')];_0x2aefb6++){var _0x8d2611=_0x27fe9c[_0x2aefb6][_0x5e52('0x10a')](_0x5e52('0x8d'));var _0x30fd17=_0x8d2611+_0x5e52('0x97');socket['emit'](_0x5e52('0x24')+_0x8d2611+'Queue:remove',{'UserId':_0x558462,['queueField']:_0x27fe9c[_0x2aefb6]['id']});}})[_0x5e52('0x2d')](respondWithStatusCode(_0x54f234,null))[_0x5e52('0x4c')](APIHandleError(_0x54f234));};exports[_0x5e52('0x113')]=function(_0x4dbe17,_0x485512){var _0x1a2797={};var _0x45cfba={};var _0x8ea4f2;var _0x28fd42;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x4dbe17['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x485512,null))[_0x5e52('0x2d')](function(_0x306991){if(_0x306991){_0x8ea4f2=_0x306991;_0x45cfba[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0xb9')][_0x5e52('0xc3')]);_0x45cfba[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x4dbe17['query']);_0x45cfba[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x45cfba[_0x5e52('0xc1')],_0x45cfba['query']);_0x1a2797[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x45cfba[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x4dbe17[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x1a2797[_0x5e52('0x3e')]=_0x1a2797[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x1a2797['attributes']:_0x45cfba['model'];_0x1a2797['order']=qs[_0x5e52('0xc8')](_0x4dbe17[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x1a2797[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_['pick'](_0x4dbe17['query'],_0x45cfba[_0x5e52('0xc9')]));if(_0x4dbe17['query'][_0x5e52('0x28')]){_0x1a2797[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x1a2797['where'],{'$or':_[_0x5e52('0x2a')](_0x1a2797[_0x5e52('0x3e')],function(_0x2f51c5){var _0x5badd0={};_0x5badd0[_0x2f51c5]={'$like':'%'+_0x4dbe17[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x5badd0;})});}_0x1a2797=_[_0x5e52('0x4f')]({},_0x1a2797,_0x4dbe17['options']);return _0x8ea4f2[_0x5e52('0x113')](_0x1a2797);}})[_0x5e52('0x2d')](function(_0x462813){if(_0x462813){_0x28fd42=_0x462813[_0x5e52('0x44')];if(!_0x4dbe17[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x1a2797[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x4dbe17[_0x5e52('0x3b')]['limit']);_0x1a2797[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x4dbe17[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x8ea4f2[_0x5e52('0x113')](_0x1a2797);}})[_0x5e52('0x2d')](function(_0x373e59){if(_0x373e59){return _0x373e59?{'count':_0x28fd42,'rows':_0x373e59}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x485512,null))['catch'](handleError(_0x485512,null));};exports[_0x5e52('0x114')]=function(_0x3def36,_0x41c000){var _0x4a16f9={};var _0xc0df80={};var _0x620b77;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x3def36['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x41c000,null))[_0x5e52('0x2d')](function(_0x1b7f75){if(_0x1b7f75){_0x620b77=_0x1b7f75;_0xc0df80[_0x5e52('0xc1')]=_['keys'](db[_0x5e52('0x33')][_0x5e52('0xc3')]);_0xc0df80[_0x5e52('0x3b')]=_['keys'](_0x3def36[_0x5e52('0x3b')]);_0xc0df80[_0x5e52('0xc9')]=_['intersection'](_0xc0df80[_0x5e52('0xc1')],_0xc0df80['query']);_0x4a16f9[_0x5e52('0x3e')]=_['intersection'](_0xc0df80[_0x5e52('0xc1')],qs['fields'](_0x3def36[_0x5e52('0x3b')]['fields']));_0x4a16f9[_0x5e52('0x3e')]=_0x4a16f9[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x4a16f9[_0x5e52('0x3e')]:_0xc0df80[_0x5e52('0xc1')];_0x4a16f9['order']=qs[_0x5e52('0xc8')](_0x3def36[_0x5e52('0x3b')]['sort']);_0x4a16f9['where']=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x3def36[_0x5e52('0x3b')],_0xc0df80[_0x5e52('0xc9')]));if(_0x3def36[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x4a16f9[_0x5e52('0xcb')]=_['merge'](_0x4a16f9[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x4a16f9[_0x5e52('0x3e')],function(_0xab7d15){var _0x2460fd={};_0x2460fd[_0xab7d15]={'$like':'%'+_0x3def36[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x2460fd;})});}_0x4a16f9[_0x5e52('0xc1')]=db['User'];_0x4a16f9['as']=_0x5e52('0x25');_0x4a16f9=_[_0x5e52('0x4f')]({},_0x4a16f9,_0x3def36[_0x5e52('0x50')]);return _0x620b77['getVoiceQueues']({'include':[_0x4a16f9]});}})['then'](function(_0x6a38dd){if(_0x6a38dd){var _0x4bff8c={},_0x268cce=[];for(var _0x56d512=0x0;_0x56d512<_0x6a38dd[_0x5e52('0x44')];_0x56d512+=0x1){for(var _0x4ede10=0x0,_0x2353fc;_0x4ede10<_0x6a38dd[_0x56d512][_0x5e52('0x25')][_0x5e52('0x44')];_0x4ede10+=0x1){_0x2353fc=_0x6a38dd[_0x56d512][_0x5e52('0x25')][_0x4ede10]['get']({'plain':!![]});_0x4bff8c[_0x2353fc['id']]=_0x2353fc;}}_0x4bff8c=_[_0x5e52('0x115')](_0x4bff8c);for(var _0x27cc13=qs[_0x5e52('0x19')](_0x3def36[_0x5e52('0x3b')][_0x5e52('0x19')]);_0x27cc13<_0x4bff8c[_0x5e52('0x44')]&&_0x268cce[_0x5e52('0x44')]<qs[_0x5e52('0x17')](_0x3def36[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x27cc13+=0x1){if(_0x4bff8c[_0x27cc13]){_0x268cce[_0x5e52('0x3f')](_0x4bff8c[_0x27cc13]);}}return{'count':_0x4bff8c[_0x5e52('0x44')],'rows':_0x268cce};}})[_0x5e52('0x2d')](respondWithResult(_0x41c000,null))['catch'](handleError(_0x41c000,null));};exports[_0x5e52('0x21')]=function(_0x2e4653,_0x175907){if(_0x2e4653[_0x5e52('0x24')]['id']==_0x2e4653[_0x5e52('0x54')]['id']){return _0x175907[_0x5e52('0x15')](0x1f4)[_0x5e52('0x32')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x2e4653[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x175907,null))[_0x5e52('0x2d')](removeEntity(_0x175907,null))[_0x5e52('0x4c')](handleError(_0x175907,null));};exports[_0x5e52('0x116')]=function(_0x5da1db,_0x516013){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x5da1db['params']['id']}})['then'](handleEntityNotFound(_0x516013,null))['then'](function(_0x4e10d2){if(_0x4e10d2){return _0x4e10d2[_0x5e52('0x116')](_0x5da1db[_0x5e52('0x53')]['ids'],_[_0x5e52('0x117')](_0x5da1db[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{})[_0x5e52('0x118')](function(){for(var _0x5cad12=0x0;_0x5cad12<_0x5da1db[_0x5e52('0x53')][_0x5e52('0x56')]['length'];_0x5cad12+=0x1){socket[_0x5e52('0x1f')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x5da1db[_0x5e52('0x53')]['ids'][_0x5cad12]),'UserId':Number(_0x5da1db['params']['id'])});}return _0x5da1db['body'][_0x5e52('0x56')];});}})['then'](respondWithResult(_0x516013,null))[_0x5e52('0x4c')](handleError(_0x516013,null));};exports[_0x5e52('0x119')]=function(_0x27c756,_0x35a3d4){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x27c756[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x35a3d4,null))[_0x5e52('0x2d')](function(_0x32828e){if(_0x32828e){return _0x32828e[_0x5e52('0x119')](_0x27c756[_0x5e52('0x3b')][_0x5e52('0x56')])['then'](function(){if(_[_0x5e52('0x110')](_0x27c756[_0x5e52('0x3b')][_0x5e52('0x56')])){for(var _0x11f237=0x0;_0x11f237<_0x27c756['query'][_0x5e52('0x56')][_0x5e52('0x44')];_0x11f237+=0x1){socket[_0x5e52('0x1f')](_0x5e52('0x11a'),{'ChatInteractionId':Number(_0x27c756[_0x5e52('0x3b')][_0x5e52('0x56')][_0x11f237]),'UserId':Number(_0x27c756[_0x5e52('0x54')]['id'])});}}else{socket[_0x5e52('0x1f')](_0x5e52('0x11a'),{'ChatInteractionId':Number(_0x27c756['query'][_0x5e52('0x56')]),'UserId':Number(_0x27c756[_0x5e52('0x54')]['id'])});}});}})[_0x5e52('0x2d')](respondWithStatusCode(_0x35a3d4,null))['catch'](handleError(_0x35a3d4,null));};exports[_0x5e52('0x11b')]=function(_0x30ed43,_0x277c55){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x30ed43[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x277c55,null))[_0x5e52('0x2d')](function(_0x4bb695){if(_0x4bb695){return _0x4bb695[_0x5e52('0x11b')](_0x30ed43['body'][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x30ed43['body'],[_0x5e52('0x56'),'id'])||{})[_0x5e52('0x118')](function(){for(var _0x66d109=0x0;_0x66d109<_0x30ed43[_0x5e52('0x53')]['ids']['length'];_0x66d109+=0x1){socket[_0x5e52('0x1f')]('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x30ed43[_0x5e52('0x53')][_0x5e52('0x56')][_0x66d109]),'UserId':Number(_0x30ed43[_0x5e52('0x54')]['id'])});}return _0x30ed43['body'][_0x5e52('0x56')];});}})[_0x5e52('0x2d')](respondWithResult(_0x277c55,null))[_0x5e52('0x4c')](handleError(_0x277c55,null));};exports['removeMailInteractions']=function(_0x4976e1,_0x21d847){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x4976e1[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x21d847,null))[_0x5e52('0x2d')](function(_0x55409f){if(_0x55409f){return _0x55409f[_0x5e52('0x11c')](_0x4976e1['query'][_0x5e52('0x56')])['then'](function(){if(_['isArray'](_0x4976e1[_0x5e52('0x3b')][_0x5e52('0x56')])){for(var _0x4c6a9e=0x0;_0x4c6a9e<_0x4976e1[_0x5e52('0x3b')][_0x5e52('0x56')]['length'];_0x4c6a9e+=0x1){socket[_0x5e52('0x1f')](_0x5e52('0x11d'),{'MailInteractionId':Number(_0x4976e1[_0x5e52('0x3b')][_0x5e52('0x56')][_0x4c6a9e]),'UserId':Number(_0x4976e1[_0x5e52('0x54')]['id'])});}}else{socket[_0x5e52('0x1f')](_0x5e52('0x11d'),{'MailInteractionId':Number(_0x4976e1[_0x5e52('0x3b')][_0x5e52('0x56')]),'UserId':Number(_0x4976e1['params']['id'])});}});}})[_0x5e52('0x2d')](respondWithStatusCode(_0x21d847,null))[_0x5e52('0x4c')](handleError(_0x21d847,null));};exports[_0x5e52('0x11e')]=function(_0x7348b0,_0x2f4dba){return db[_0x5e52('0x33')]['find']({'where':{'id':_0x7348b0[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x2f4dba,null))[_0x5e52('0x2d')](function(_0x9a7676){if(_0x9a7676){return _0x9a7676[_0x5e52('0x11e')](_0x7348b0[_0x5e52('0x53')][_0x5e52('0x56')],_['omit'](_0x7348b0['body'],[_0x5e52('0x56'),'id'])||{})[_0x5e52('0x118')](function(){for(var _0x330370=0x0;_0x330370<_0x7348b0[_0x5e52('0x53')][_0x5e52('0x56')]['length'];_0x330370+=0x1){socket[_0x5e52('0x1f')](_0x5e52('0x11f'),{'FaxInteractionId':Number(_0x7348b0[_0x5e52('0x53')][_0x5e52('0x56')][_0x330370]),'UserId':Number(_0x7348b0[_0x5e52('0x54')]['id'])});}return _0x7348b0[_0x5e52('0x53')][_0x5e52('0x56')];});}})[_0x5e52('0x2d')](respondWithResult(_0x2f4dba,null))['catch'](handleError(_0x2f4dba,null));};exports[_0x5e52('0x120')]=function(_0x238922,_0xe85f4f){return db[_0x5e52('0x33')]['find']({'where':{'id':_0x238922[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0xe85f4f,null))[_0x5e52('0x2d')](function(_0x22c1ba){if(_0x22c1ba){return _0x22c1ba[_0x5e52('0x120')](_0x238922['query'][_0x5e52('0x56')])[_0x5e52('0x2d')](function(){if(_[_0x5e52('0x110')](_0x238922['query'][_0x5e52('0x56')])){for(var _0x3a58e1=0x0;_0x3a58e1<_0x238922[_0x5e52('0x3b')]['ids'][_0x5e52('0x44')];_0x3a58e1+=0x1){socket[_0x5e52('0x1f')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x238922[_0x5e52('0x3b')]['ids'][_0x3a58e1]),'UserId':Number(_0x238922['params']['id'])});}}else{socket[_0x5e52('0x1f')](_0x5e52('0x121'),{'FaxInteractionId':Number(_0x238922['query'][_0x5e52('0x56')]),'UserId':Number(_0x238922['params']['id'])});}});}})[_0x5e52('0x2d')](respondWithStatusCode(_0xe85f4f,null))['catch'](handleError(_0xe85f4f,null));};exports[_0x5e52('0x122')]=function(_0x4767fd,_0x4b30d5){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x4767fd[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x4b30d5,null))['then'](function(_0x1981b5){if(_0x1981b5){return _0x1981b5['addSmsInteractions'](_0x4767fd[_0x5e52('0x53')][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x4767fd[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{})[_0x5e52('0x118')](function(){for(var _0x2c4b1c=0x0;_0x2c4b1c<_0x4767fd[_0x5e52('0x53')][_0x5e52('0x56')][_0x5e52('0x44')];_0x2c4b1c+=0x1){socket[_0x5e52('0x1f')](_0x5e52('0x123'),{'SmsInteractionId':Number(_0x4767fd[_0x5e52('0x53')]['ids'][_0x2c4b1c]),'UserId':Number(_0x4767fd[_0x5e52('0x54')]['id'])});}return _0x4767fd['body'][_0x5e52('0x56')];});}})['then'](respondWithResult(_0x4b30d5,null))['catch'](handleError(_0x4b30d5,null));};exports['removeSmsInteractions']=function(_0x2da249,_0x296f37){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x2da249[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x296f37,null))['then'](function(_0x41426b){if(_0x41426b){return _0x41426b[_0x5e52('0x124')](_0x2da249[_0x5e52('0x3b')][_0x5e52('0x56')])[_0x5e52('0x2d')](function(){if(_[_0x5e52('0x110')](_0x2da249[_0x5e52('0x3b')][_0x5e52('0x56')])){for(var _0x39209f=0x0;_0x39209f<_0x2da249['query']['ids'][_0x5e52('0x44')];_0x39209f+=0x1){socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2da249[_0x5e52('0x3b')]['ids'][_0x39209f]),'UserId':Number(_0x2da249[_0x5e52('0x54')]['id'])});}}else{socket[_0x5e52('0x1f')](_0x5e52('0x125'),{'SmsInteractionId':Number(_0x2da249[_0x5e52('0x3b')][_0x5e52('0x56')]),'UserId':Number(_0x2da249[_0x5e52('0x54')]['id'])});}});}})[_0x5e52('0x2d')](respondWithStatusCode(_0x296f37,null))[_0x5e52('0x4c')](handleError(_0x296f37,null));};exports[_0x5e52('0x126')]=function(_0x2b7fa9,_0x28949a){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x2b7fa9[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x28949a,null))[_0x5e52('0x2d')](function(_0x2763ac){if(_0x2763ac){return _0x2763ac['addOpenchannelInteractions'](_0x2b7fa9[_0x5e52('0x53')][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x2b7fa9[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{})[_0x5e52('0x118')](function(){for(var _0x154700=0x0;_0x154700<_0x2b7fa9['body'][_0x5e52('0x56')][_0x5e52('0x44')];_0x154700+=0x1){socket[_0x5e52('0x1f')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x2b7fa9[_0x5e52('0x53')][_0x5e52('0x56')][_0x154700]),'UserId':Number(_0x2b7fa9[_0x5e52('0x54')]['id'])});}return _0x2b7fa9[_0x5e52('0x53')][_0x5e52('0x56')];});}})['then'](respondWithResult(_0x28949a,null))['catch'](handleError(_0x28949a,null));};exports[_0x5e52('0x127')]=function(_0x29a3dd,_0x4c20a8){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x29a3dd[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x4c20a8,null))[_0x5e52('0x2d')](function(_0xdb1922){if(_0xdb1922){return _0xdb1922[_0x5e52('0x127')](_0x29a3dd[_0x5e52('0x3b')]['ids'])[_0x5e52('0x2d')](function(){if(_['isArray'](_0x29a3dd[_0x5e52('0x3b')][_0x5e52('0x56')])){for(var _0x27eace=0x0;_0x27eace<_0x29a3dd[_0x5e52('0x3b')][_0x5e52('0x56')][_0x5e52('0x44')];_0x27eace+=0x1){socket[_0x5e52('0x1f')](_0x5e52('0x128'),{'OpenchannelInteractionId':Number(_0x29a3dd['query'][_0x5e52('0x56')][_0x27eace]),'UserId':Number(_0x29a3dd[_0x5e52('0x54')]['id'])});}}else{socket[_0x5e52('0x1f')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x29a3dd[_0x5e52('0x3b')][_0x5e52('0x56')]),'UserId':Number(_0x29a3dd[_0x5e52('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c20a8,null))[_0x5e52('0x4c')](handleError(_0x4c20a8,null));};exports['addWhatsappInteractions']=function(_0x325d31,_0xe8d80c){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x325d31[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0xe8d80c,null))[_0x5e52('0x2d')](function(_0x4b9297){if(_0x4b9297){return _0x4b9297[_0x5e52('0x129')](_0x325d31['body']['ids'],_[_0x5e52('0x117')](_0x325d31[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{})[_0x5e52('0x118')](function(){for(var _0x2da10e=0x0;_0x2da10e<_0x325d31[_0x5e52('0x53')][_0x5e52('0x56')]['length'];_0x2da10e+=0x1){socket[_0x5e52('0x1f')](_0x5e52('0x12a'),{'WhatsappInteractionId':Number(_0x325d31[_0x5e52('0x53')][_0x5e52('0x56')][_0x2da10e]),'UserId':Number(_0x325d31[_0x5e52('0x54')]['id'])});}return _0x325d31[_0x5e52('0x53')][_0x5e52('0x56')];});}})[_0x5e52('0x2d')](respondWithResult(_0xe8d80c,null))[_0x5e52('0x4c')](handleError(_0xe8d80c,null));};exports[_0x5e52('0x12b')]=function(_0x29dc5e,_0x48c7ea){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x29dc5e[_0x5e52('0x54')]['id']}})['then'](handleEntityNotFound(_0x48c7ea,null))[_0x5e52('0x2d')](function(_0x124d2b){if(_0x124d2b){return _0x124d2b[_0x5e52('0x12b')](_0x29dc5e[_0x5e52('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x48c7ea,null))[_0x5e52('0x4c')](handleError(_0x48c7ea,null));};exports[_0x5e52('0x12c')]=function(_0x312f55,_0x2b3e9c){var _0x24008f={};var _0x28f5bc={};var _0x565bc1;var _0x2167f4;return db[_0x5e52('0x33')]['findOne']({'where':{'id':_0x312f55[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x2b3e9c,null))[_0x5e52('0x2d')](function(_0x2bf26c){if(_0x2bf26c){_0x565bc1=_0x2bf26c;_0x28f5bc[_0x5e52('0xc1')]=_['keys'](db[_0x5e52('0x12d')]['rawAttributes']);_0x28f5bc['query']=_[_0x5e52('0xc4')](_0x312f55[_0x5e52('0x3b')]);_0x28f5bc[_0x5e52('0xc9')]=_['intersection'](_0x28f5bc[_0x5e52('0xc1')],_0x28f5bc[_0x5e52('0x3b')]);_0x24008f[_0x5e52('0x3e')]=_['intersection'](_0x28f5bc[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x312f55[_0x5e52('0x3b')]['fields']));_0x24008f[_0x5e52('0x3e')]=_0x24008f[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x24008f[_0x5e52('0x3e')]:_0x28f5bc[_0x5e52('0xc1')];_0x24008f[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x312f55['query'][_0x5e52('0xc8')]);_0x24008f[_0x5e52('0xcb')]=qs['filters'](_[_0x5e52('0xca')](_0x312f55['query'],_0x28f5bc[_0x5e52('0xc9')]));if(_0x312f55['query']['filter']){_0x24008f[_0x5e52('0xcb')]=_['merge'](_0x24008f[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x24008f['attributes'],function(_0x4593f0){var _0x1a5692={};_0x1a5692[_0x4593f0]={'$like':'%'+_0x312f55[_0x5e52('0x3b')]['filter']+'%'};return _0x1a5692;})});}_0x24008f=_[_0x5e52('0x4f')]({},_0x24008f,_0x312f55[_0x5e52('0x50')]);return _0x565bc1[_0x5e52('0x12c')](_0x24008f);}})[_0x5e52('0x2d')](function(_0x269e09){if(_0x269e09){_0x2167f4=_0x269e09[_0x5e52('0x44')];if(!_0x312f55[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x24008f[_0x5e52('0x17')]=qs['limit'](_0x312f55['query']['limit']);_0x24008f[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x312f55[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x565bc1[_0x5e52('0x12c')](_0x24008f);}})['then'](function(_0x195188){if(_0x195188){return _0x195188?{'count':_0x2167f4,'rows':_0x195188}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x2b3e9c,null))[_0x5e52('0x4c')](handleError(_0x2b3e9c,null));};exports[_0x5e52('0x12e')]=function(_0x3ab3c3,_0x9d9a57){var _0x210b84={};var _0x210f8f={};var _0x60f218;var _0x6fe552;return db['User'][_0x5e52('0xc0')]({'where':{'id':_0x3ab3c3[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x9d9a57,null))[_0x5e52('0x2d')](function(_0x11a347){if(_0x11a347){_0x60f218=_0x11a347;_0x210f8f[_0x5e52('0xc1')]=_['keys'](db['FaxAccount'][_0x5e52('0xc3')]);_0x210f8f[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x3ab3c3[_0x5e52('0x3b')]);_0x210f8f[_0x5e52('0xc9')]=_['intersection'](_0x210f8f['model'],_0x210f8f[_0x5e52('0x3b')]);_0x210b84[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x210f8f[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x3ab3c3[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x210b84[_0x5e52('0x3e')]=_0x210b84['attributes']['length']?_0x210b84['attributes']:_0x210f8f[_0x5e52('0xc1')];_0x210b84['order']=qs[_0x5e52('0xc8')](_0x3ab3c3['query']['sort']);_0x210b84[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_['pick'](_0x3ab3c3[_0x5e52('0x3b')],_0x210f8f[_0x5e52('0xc9')]));if(_0x3ab3c3['query']['filter']){_0x210b84[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x210b84[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x210b84[_0x5e52('0x3e')],function(_0x2ef397){var _0x5f2f6a={};_0x5f2f6a[_0x2ef397]={'$like':'%'+_0x3ab3c3[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x5f2f6a;})});}_0x210b84=_['merge']({},_0x210b84,_0x3ab3c3[_0x5e52('0x50')]);return _0x60f218[_0x5e52('0x12e')](_0x210b84);}})['then'](function(_0x40ce14){if(_0x40ce14){_0x6fe552=_0x40ce14[_0x5e52('0x44')];if(!_0x3ab3c3[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x210b84['limit']=qs[_0x5e52('0x17')](_0x3ab3c3[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x210b84[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x3ab3c3[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x60f218[_0x5e52('0x12e')](_0x210b84);}})[_0x5e52('0x2d')](function(_0x4c1de9){if(_0x4c1de9){return _0x4c1de9?{'count':_0x6fe552,'rows':_0x4c1de9}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x9d9a57,null))['catch'](handleError(_0x9d9a57,null));};exports[_0x5e52('0x12f')]=function(_0x5aac4c,_0x1dbc67){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x5aac4c['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x1dbc67,null))[_0x5e52('0x2d')](function(_0x49120b){if(_0x49120b){return _0x49120b[_0x5e52('0x12f')](_0x5aac4c[_0x5e52('0x53')][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x5aac4c[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{});}})[_0x5e52('0x2d')](respondWithResult(_0x1dbc67,null))[_0x5e52('0x4c')](handleError(_0x1dbc67,null));};exports[_0x5e52('0x130')]=function(_0x4d5180,_0x49316f){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x4d5180['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x49316f,null))[_0x5e52('0x2d')](function(_0x264898){if(_0x264898){return _0x264898['removeFaxAccounts'](_0x4d5180[_0x5e52('0x3b')][_0x5e52('0x56')]);}})[_0x5e52('0x2d')](respondWithStatusCode(_0x49316f,null))['catch'](handleError(_0x49316f,null));};exports[_0x5e52('0x131')]=function(_0x3d3d85,_0x272836){var _0x59e4f6={};var _0x24b731={};var _0x349f49;var _0x2c9043;return db[_0x5e52('0x33')]['findOne']({'where':{'id':_0x3d3d85[_0x5e52('0x54')]['id']}})['then'](handleEntityNotFound(_0x272836,null))[_0x5e52('0x2d')](function(_0x6302d7){if(_0x6302d7){_0x349f49=_0x6302d7;_0x24b731['model']=_[_0x5e52('0xc4')](db[_0x5e52('0x132')][_0x5e52('0xc3')]);_0x24b731['query']=_[_0x5e52('0xc4')](_0x3d3d85[_0x5e52('0x3b')]);_0x24b731['filters']=_[_0x5e52('0xc5')](_0x24b731[_0x5e52('0xc1')],_0x24b731[_0x5e52('0x3b')]);_0x59e4f6['attributes']=_[_0x5e52('0xc5')](_0x24b731['model'],qs[_0x5e52('0xc6')](_0x3d3d85[_0x5e52('0x3b')]['fields']));_0x59e4f6[_0x5e52('0x3e')]=_0x59e4f6[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x59e4f6['attributes']:_0x24b731[_0x5e52('0xc1')];_0x59e4f6[_0x5e52('0xc7')]=qs['sort'](_0x3d3d85[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x59e4f6[_0x5e52('0xcb')]=qs['filters'](_[_0x5e52('0xca')](_0x3d3d85[_0x5e52('0x3b')],_0x24b731[_0x5e52('0xc9')]));if(_0x3d3d85[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x59e4f6[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x59e4f6[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x59e4f6[_0x5e52('0x3e')],function(_0x4bb528){var _0x444fbd={};_0x444fbd[_0x4bb528]={'$like':'%'+_0x3d3d85[_0x5e52('0x3b')]['filter']+'%'};return _0x444fbd;})});}_0x59e4f6=_[_0x5e52('0x4f')]({},_0x59e4f6,_0x3d3d85[_0x5e52('0x50')]);return _0x349f49[_0x5e52('0x131')](_0x59e4f6);}})['then'](function(_0x32404a){if(_0x32404a){_0x2c9043=_0x32404a['length'];if(!_0x3d3d85['query'][_0x5e52('0xb8')]('nolimit')){_0x59e4f6[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x3d3d85[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x59e4f6[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x3d3d85['query'][_0x5e52('0x19')]);}return _0x349f49[_0x5e52('0x131')](_0x59e4f6);}})['then'](function(_0x4dc0fb){if(_0x4dc0fb){return _0x4dc0fb?{'count':_0x2c9043,'rows':_0x4dc0fb}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x272836,null))[_0x5e52('0x4c')](handleError(_0x272836,null));};exports[_0x5e52('0x133')]=function(_0x4ac692,_0x3b619c){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x4ac692[_0x5e52('0x54')]['id']}})['then'](handleEntityNotFound(_0x3b619c,null))['then'](function(_0xde328e){if(_0xde328e){return _0xde328e[_0x5e52('0x133')](_0x4ac692[_0x5e52('0x53')]['ids'],_[_0x5e52('0x117')](_0x4ac692['body'],[_0x5e52('0x56'),'id'])||{});}})[_0x5e52('0x2d')](respondWithResult(_0x3b619c,null))[_0x5e52('0x4c')](handleError(_0x3b619c,null));};exports[_0x5e52('0x134')]=function(_0x36ec41,_0x3233a9){return db[_0x5e52('0x33')]['find']({'where':{'id':_0x36ec41[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x3233a9,null))[_0x5e52('0x2d')](function(_0x5b407c){if(_0x5b407c){return _0x5b407c['removeMailAccounts'](_0x36ec41['query'][_0x5e52('0x56')]);}})[_0x5e52('0x2d')](respondWithStatusCode(_0x3233a9,null))[_0x5e52('0x4c')](handleError(_0x3233a9,null));};exports[_0x5e52('0x135')]=function(_0x58d836,_0x19c464){var _0x11182a={};var _0x3f55a8={};var _0x2d231a;var _0x322d0a;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x58d836['params']['id']}})['then'](handleEntityNotFound(_0x19c464,null))[_0x5e52('0x2d')](function(_0x32d90d){if(_0x32d90d){_0x2d231a=_0x32d90d;_0x3f55a8[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0x136')][_0x5e52('0xc3')]);_0x3f55a8[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x58d836['query']);_0x3f55a8[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x3f55a8[_0x5e52('0xc1')],_0x3f55a8[_0x5e52('0x3b')]);_0x11182a['attributes']=_[_0x5e52('0xc5')](_0x3f55a8[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x58d836[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x11182a[_0x5e52('0x3e')]=_0x11182a[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x11182a['attributes']:_0x3f55a8[_0x5e52('0xc1')];_0x11182a[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x58d836[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x11182a[_0x5e52('0xcb')]=qs['filters'](_[_0x5e52('0xca')](_0x58d836['query'],_0x3f55a8['filters']));if(_0x58d836[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x11182a['where']=_['merge'](_0x11182a[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x11182a[_0x5e52('0x3e')],function(_0x311f26){var _0x316c8d={};_0x316c8d[_0x311f26]={'$like':'%'+_0x58d836[_0x5e52('0x3b')]['filter']+'%'};return _0x316c8d;})});}_0x11182a=_[_0x5e52('0x4f')]({},_0x11182a,_0x58d836[_0x5e52('0x50')]);return _0x2d231a[_0x5e52('0x135')](_0x11182a);}})[_0x5e52('0x2d')](function(_0x3091d3){if(_0x3091d3){_0x322d0a=_0x3091d3[_0x5e52('0x44')];if(!_0x58d836['query'][_0x5e52('0xb8')]('nolimit')){_0x11182a['limit']=qs[_0x5e52('0x17')](_0x58d836['query'][_0x5e52('0x17')]);_0x11182a[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x58d836[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x2d231a[_0x5e52('0x135')](_0x11182a);}})[_0x5e52('0x2d')](function(_0x5049e8){if(_0x5049e8){return _0x5049e8?{'count':_0x322d0a,'rows':_0x5049e8}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x19c464,null))[_0x5e52('0x4c')](handleError(_0x19c464,null));};exports[_0x5e52('0x137')]=function(_0x47d227,_0x4193c0){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x47d227[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x4193c0,null))[_0x5e52('0x2d')](function(_0x1bb072){if(_0x1bb072){return _0x1bb072[_0x5e52('0x137')](_0x47d227['body'][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x47d227[_0x5e52('0x53')],['ids','id'])||{});}})[_0x5e52('0x2d')](respondWithResult(_0x4193c0,null))[_0x5e52('0x4c')](handleError(_0x4193c0,null));};exports[_0x5e52('0x138')]=function(_0x481396,_0x3b9643){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x481396[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x3b9643,null))[_0x5e52('0x2d')](function(_0x4d7f38){if(_0x4d7f38){return _0x4d7f38[_0x5e52('0x138')](_0x481396[_0x5e52('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x3b9643,null))['catch'](handleError(_0x3b9643,null));};exports[_0x5e52('0x139')]=function(_0x4b0f29,_0x5123c7){var _0x553551={};var _0xa3e4e3={};var _0xa35efc;var _0x548dd0;return db['User'][_0x5e52('0xc0')]({'where':{'id':_0x4b0f29[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x5123c7,null))[_0x5e52('0x2d')](function(_0x2fad27){if(_0x2fad27){_0xa35efc=_0x2fad27;_0xa3e4e3['model']=_[_0x5e52('0xc4')](db[_0x5e52('0x13a')][_0x5e52('0xc3')]);_0xa3e4e3[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x4b0f29[_0x5e52('0x3b')]);_0xa3e4e3['filters']=_[_0x5e52('0xc5')](_0xa3e4e3[_0x5e52('0xc1')],_0xa3e4e3[_0x5e52('0x3b')]);_0x553551[_0x5e52('0x3e')]=_['intersection'](_0xa3e4e3[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x4b0f29[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x553551[_0x5e52('0x3e')]=_0x553551[_0x5e52('0x3e')]['length']?_0x553551[_0x5e52('0x3e')]:_0xa3e4e3[_0x5e52('0xc1')];_0x553551[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x4b0f29[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x553551['where']=qs['filters'](_[_0x5e52('0xca')](_0x4b0f29[_0x5e52('0x3b')],_0xa3e4e3[_0x5e52('0xc9')]));if(_0x4b0f29[_0x5e52('0x3b')][_0x5e52('0x28')]){_0x553551[_0x5e52('0xcb')]=_[_0x5e52('0x4f')](_0x553551[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x553551['attributes'],function(_0x2f2fd8){var _0x36f5d5={};_0x36f5d5[_0x2f2fd8]={'$like':'%'+_0x4b0f29[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x36f5d5;})});}_0x553551=_[_0x5e52('0x4f')]({},_0x553551,_0x4b0f29[_0x5e52('0x50')]);return _0xa35efc[_0x5e52('0x139')](_0x553551);}})['then'](function(_0x35e601){if(_0x35e601){_0x548dd0=_0x35e601['length'];if(!_0x4b0f29[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x553551[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x4b0f29[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x553551[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x4b0f29[_0x5e52('0x3b')]['offset']);}return _0xa35efc['getSmsAccounts'](_0x553551);}})['then'](function(_0x552d10){if(_0x552d10){return _0x552d10?{'count':_0x548dd0,'rows':_0x552d10}:null;}})[_0x5e52('0x2d')](respondWithResult(_0x5123c7,null))[_0x5e52('0x4c')](handleError(_0x5123c7,null));};exports[_0x5e52('0x13b')]=function(_0x26a528,_0x6ac410){return db[_0x5e52('0x33')]['find']({'where':{'id':_0x26a528[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x6ac410,null))[_0x5e52('0x2d')](function(_0x20467a){if(_0x20467a){return _0x20467a[_0x5e52('0x13b')](_0x26a528['body'][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x26a528[_0x5e52('0x53')],['ids','id'])||{});}})[_0x5e52('0x2d')](respondWithResult(_0x6ac410,null))[_0x5e52('0x4c')](handleError(_0x6ac410,null));};exports[_0x5e52('0x13c')]=function(_0x107bab,_0x502200){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x107bab[_0x5e52('0x54')]['id']}})['then'](handleEntityNotFound(_0x502200,null))['then'](function(_0x17a28d){if(_0x17a28d){return _0x17a28d[_0x5e52('0x13c')](_0x107bab[_0x5e52('0x3b')][_0x5e52('0x56')]);}})[_0x5e52('0x2d')](respondWithStatusCode(_0x502200,null))[_0x5e52('0x4c')](handleError(_0x502200,null));};exports[_0x5e52('0x13d')]=function(_0x4816b6,_0x477eb8){var _0x364c5e={};var _0x5830be={};var _0x2f4317;var _0x536792;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x4816b6[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x477eb8,null))[_0x5e52('0x2d')](function(_0x88cc3d){if(_0x88cc3d){_0x2f4317=_0x88cc3d;_0x5830be[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0x13e')]['rawAttributes']);_0x5830be[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x4816b6[_0x5e52('0x3b')]);_0x5830be['filters']=_[_0x5e52('0xc5')](_0x5830be[_0x5e52('0xc1')],_0x5830be[_0x5e52('0x3b')]);_0x364c5e[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x5830be[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x4816b6[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x364c5e[_0x5e52('0x3e')]=_0x364c5e[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x364c5e['attributes']:_0x5830be[_0x5e52('0xc1')];_0x364c5e[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x4816b6['query'][_0x5e52('0xc8')]);_0x364c5e[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x4816b6[_0x5e52('0x3b')],_0x5830be[_0x5e52('0xc9')]));if(_0x4816b6['query'][_0x5e52('0x28')]){_0x364c5e[_0x5e52('0xcb')]=_['merge'](_0x364c5e[_0x5e52('0xcb')],{'$or':_['map'](_0x364c5e[_0x5e52('0x3e')],function(_0x5eccdc){var _0x471334={};_0x471334[_0x5eccdc]={'$like':'%'+_0x4816b6[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x471334;})});}_0x364c5e=_['merge']({},_0x364c5e,_0x4816b6[_0x5e52('0x50')]);return _0x2f4317[_0x5e52('0x13d')](_0x364c5e);}})['then'](function(_0x2930c1){if(_0x2930c1){_0x536792=_0x2930c1[_0x5e52('0x44')];if(!_0x4816b6[_0x5e52('0x3b')]['hasOwnProperty'](_0x5e52('0xcd'))){_0x364c5e[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x4816b6['query'][_0x5e52('0x17')]);_0x364c5e[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x4816b6[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x2f4317[_0x5e52('0x13d')](_0x364c5e);}})[_0x5e52('0x2d')](function(_0x44e393){if(_0x44e393){return _0x44e393?{'count':_0x536792,'rows':_0x44e393}:null;}})['then'](respondWithResult(_0x477eb8,null))[_0x5e52('0x4c')](handleError(_0x477eb8,null));};exports[_0x5e52('0x13f')]=function(_0x22500f,_0x3b2c47){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x22500f['params']['id']}})['then'](handleEntityNotFound(_0x3b2c47,null))[_0x5e52('0x2d')](function(_0x3d9bda){if(_0x3d9bda){return _0x3d9bda['addChatWebsites'](_0x22500f[_0x5e52('0x53')][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x22500f[_0x5e52('0x53')],[_0x5e52('0x56'),'id'])||{});}})['then'](respondWithResult(_0x3b2c47,null))[_0x5e52('0x4c')](handleError(_0x3b2c47,null));};exports[_0x5e52('0x140')]=function(_0x32b96a,_0x3673fe){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x32b96a[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x3673fe,null))[_0x5e52('0x2d')](function(_0x272896){if(_0x272896){return _0x272896[_0x5e52('0x140')](_0x32b96a[_0x5e52('0x3b')]['ids']);}})[_0x5e52('0x2d')](respondWithStatusCode(_0x3673fe,null))['catch'](handleError(_0x3673fe,null));};exports['getWhatsappAccounts']=function(_0x384f39,_0x128b4a){var _0x3a5506={};var _0x4cb535={};var _0x1e5e34;var _0x3d9e9a;return db[_0x5e52('0x33')][_0x5e52('0xc0')]({'where':{'id':_0x384f39[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x128b4a,null))[_0x5e52('0x2d')](function(_0x10a948){if(_0x10a948){_0x1e5e34=_0x10a948;_0x4cb535[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](db[_0x5e52('0x141')][_0x5e52('0xc3')]);_0x4cb535[_0x5e52('0x3b')]=_['keys'](_0x384f39[_0x5e52('0x3b')]);_0x4cb535[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0x4cb535[_0x5e52('0xc1')],_0x4cb535[_0x5e52('0x3b')]);_0x3a5506[_0x5e52('0x3e')]=_[_0x5e52('0xc5')](_0x4cb535[_0x5e52('0xc1')],qs[_0x5e52('0xc6')](_0x384f39[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x3a5506[_0x5e52('0x3e')]=_0x3a5506[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x3a5506[_0x5e52('0x3e')]:_0x4cb535[_0x5e52('0xc1')];_0x3a5506[_0x5e52('0xc7')]=qs[_0x5e52('0xc8')](_0x384f39[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x3a5506[_0x5e52('0xcb')]=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x384f39['query'],_0x4cb535[_0x5e52('0xc9')]));if(_0x384f39[_0x5e52('0x3b')]['filter']){_0x3a5506[_0x5e52('0xcb')]=_['merge'](_0x3a5506[_0x5e52('0xcb')],{'$or':_[_0x5e52('0x2a')](_0x3a5506[_0x5e52('0x3e')],function(_0x12e15b){var _0x51a960={};_0x51a960[_0x12e15b]={'$like':'%'+_0x384f39[_0x5e52('0x3b')][_0x5e52('0x28')]+'%'};return _0x51a960;})});}_0x3a5506=_['merge']({},_0x3a5506,_0x384f39['options']);return _0x1e5e34[_0x5e52('0x142')](_0x3a5506);}})[_0x5e52('0x2d')](function(_0x22ce83){if(_0x22ce83){_0x3d9e9a=_0x22ce83[_0x5e52('0x44')];if(!_0x384f39['query'][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x3a5506['limit']=qs[_0x5e52('0x17')](_0x384f39[_0x5e52('0x3b')][_0x5e52('0x17')]);_0x3a5506['offset']=qs['offset'](_0x384f39[_0x5e52('0x3b')][_0x5e52('0x19')]);}return _0x1e5e34[_0x5e52('0x142')](_0x3a5506);}})[_0x5e52('0x2d')](function(_0x94281e){if(_0x94281e){return _0x94281e?{'count':_0x3d9e9a,'rows':_0x94281e}:null;}})['then'](respondWithResult(_0x128b4a,null))[_0x5e52('0x4c')](handleError(_0x128b4a,null));};exports[_0x5e52('0x143')]=function(_0x28ed2d,_0x172416){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x28ed2d[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x172416,null))[_0x5e52('0x2d')](function(_0x9b821a){if(_0x9b821a){return _0x9b821a[_0x5e52('0x143')](_0x28ed2d[_0x5e52('0x53')][_0x5e52('0x56')],_[_0x5e52('0x117')](_0x28ed2d['body'],[_0x5e52('0x56'),'id'])||{});}})[_0x5e52('0x2d')](respondWithResult(_0x172416,null))[_0x5e52('0x4c')](handleError(_0x172416,null));};exports[_0x5e52('0x144')]=function(_0x1eaf26,_0x2376e4){return db['User'][_0x5e52('0x51')]({'where':{'id':_0x1eaf26[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x2376e4,null))[_0x5e52('0x2d')](function(_0x286774){if(_0x286774){return _0x286774[_0x5e52('0x144')](_0x1eaf26[_0x5e52('0x3b')][_0x5e52('0x56')]);}})[_0x5e52('0x2d')](respondWithStatusCode(_0x2376e4,null))[_0x5e52('0x4c')](handleError(_0x2376e4,null));};exports[_0x5e52('0x145')]=function(_0x329a2e,_0x3ef981){var _0x17e569={},_0xba4bf6={},_0x223433={'count':0x0,'rows':[]};var _0x57d023=db[_0x5e52('0x146')][_0x5e52('0xc3')];_0xba4bf6[_0x5e52('0xc1')]=_[_0x5e52('0xc4')](_0x57d023);_0xba4bf6[_0x5e52('0x3b')]=_[_0x5e52('0xc4')](_0x329a2e[_0x5e52('0x3b')]);_0xba4bf6[_0x5e52('0xc9')]=_[_0x5e52('0xc5')](_0xba4bf6[_0x5e52('0xc1')],_0xba4bf6[_0x5e52('0x3b')]);_0xba4bf6['filters']=_[_0x5e52('0xf6')](_0xba4bf6[_0x5e52('0xc9')],[_0x5e52('0x147'),'$or',_0x5e52('0x148'),_0x5e52('0x149'),_0x5e52('0x14a'),'$lte','$ne',_0x5e52('0x14b'),_0x5e52('0x14c'),_0x5e52('0x14d'),'$notBetween','$in','$notIn',_0x5e52('0x14e'),'$notLike',_0x5e52('0x14f'),_0x5e52('0x150'),'$like',_0x5e52('0x151'),_0x5e52('0x152'),_0x5e52('0x153'),_0x5e52('0x154')]);_0x17e569['attributes']=_['intersection'](_0xba4bf6['model'],qs['fields'](_0x329a2e[_0x5e52('0x3b')][_0x5e52('0xc6')]));_0x17e569['attributes']=_0x17e569[_0x5e52('0x3e')][_0x5e52('0x44')]?_0x17e569[_0x5e52('0x3e')]:_0xba4bf6[_0x5e52('0xc1')];if(!_0x329a2e[_0x5e52('0x3b')][_0x5e52('0xb8')](_0x5e52('0xcd'))){_0x17e569[_0x5e52('0x17')]=qs[_0x5e52('0x17')](_0x329a2e['query'][_0x5e52('0x17')]);_0x17e569['offset']=qs['offset'](_0x329a2e[_0x5e52('0x3b')]['offset']);}_0x17e569[_0x5e52('0xc7')]=qs['sort'](_0x329a2e[_0x5e52('0x3b')][_0x5e52('0xc8')]);_0x17e569['where']=qs[_0x5e52('0xc9')](_[_0x5e52('0xca')](_0x329a2e[_0x5e52('0x3b')],_0xba4bf6['filters']));if(_0x329a2e[_0x5e52('0x3b')]['filter']){_0x17e569[_0x5e52('0xcb')]=_['merge'](_0x17e569[_0x5e52('0xcb')],{'$or':_['map'](_0x17e569[_0x5e52('0x3e')],function(_0x37c1d7){var _0x1097ab={};_0x1097ab[_0x37c1d7]={'$like':'%'+_0x329a2e[_0x5e52('0x3b')]['filter']+'%'};return _0x1097ab;})});}_0x17e569[_0x5e52('0xcb')]={'$and':[_0x17e569[_0x5e52('0xcb')],{'$or':[{'UserId':_0x329a2e[_0x5e52('0x54')]['id']},{'OwnerId':_0x329a2e[_0x5e52('0x54')]['id']}]}]};_0x17e569=_['merge']({},_0x17e569,_0x329a2e[_0x5e52('0x50')]);var _0xeb6d86={'where':_0x17e569['where']};return db[_0x5e52('0x146')][_0x5e52('0x18')](_0xeb6d86)[_0x5e52('0x2d')](function(_0x45d469){_0x223433[_0x5e52('0x18')]=_0x45d469;if(_0x329a2e[_0x5e52('0x3b')][_0x5e52('0x3a')]){_0x17e569[_0x5e52('0x4e')]=[{'attributes':['id',_0x5e52('0x155'),_0x5e52('0x156'),'phone'],'model':db['CmContact'],'as':_0x5e52('0x157')},{'attributes':['id',_0x5e52('0x31'),_0x5e52('0x158')],'model':db[_0x5e52('0x9a')],'as':_0x5e52('0xc2')}];}return db[_0x5e52('0x146')][_0x5e52('0x40')](_0x17e569);})[_0x5e52('0x2d')](function(_0x616aa9){_0x223433['rows']=_0x616aa9;return _0x223433;})[_0x5e52('0x2d')](respondWithFilteredResult(_0x3ef981,_0x17e569))['catch'](handleError(_0x3ef981,null));};exports[_0x5e52('0x159')]=function(_0x29cf90,_0x566fde){if(!_[_0x5e52('0x5d')](_0x29cf90[_0x5e52('0x24')]['id'])&&(_0x29cf90[_0x5e52('0x24')]['role']=='admin'||_0x29cf90[_0x5e52('0x24')][_0x5e52('0x1d')]==_0x5e52('0x24'))){return db['User'][_0x5e52('0xc0')]({'where':{'id':_0x29cf90[_0x5e52('0x54')]['id']},'raw':!![]})[_0x5e52('0x2d')](function(_0x12e1af){return authService['retrieveApiKey'](_0x12e1af);})[_0x5e52('0x2d')](function(_0x5ad5db){if(_0x5ad5db){return _0x566fde['status'](0xc8)[_0x5e52('0x1b')]({'api_key':_0x5ad5db[_0x5e52('0x15a')]});}else{return _0x566fde[_0x5e52('0x15')](0xcc)[_0x5e52('0x1b')]({'message':_0x5e52('0x15b')});}})['catch'](handleError(_0x566fde,0x193));}else{return _0x566fde['status'](0x191)[_0x5e52('0x1b')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['createApiKey']=function(_0x6862df,_0x130e5c){if(!_[_0x5e52('0x5d')](_0x6862df[_0x5e52('0x24')]['id'])&&(_0x6862df[_0x5e52('0x24')]['role']==_0x5e52('0x23')||_0x6862df[_0x5e52('0x24')]['role']==_0x5e52('0x24'))){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x6862df[_0x5e52('0x54')]['id']}})[_0x5e52('0x2d')](function(_0x1411c8){return authService[_0x5e52('0x15c')](_0x1411c8);})[_0x5e52('0x2d')](function(_0x211e3f){return db[_0x5e52('0x33')][_0x5e52('0x1c')]({'apiKeyIat':_0x211e3f['iat'],'apiKeyNonce':_0x211e3f[_0x5e52('0x15d')]},{'where':{'id':_0x6862df['params']['id']}})[_0x5e52('0x2d')](function(){return _0x130e5c[_0x5e52('0x15')](0xc8)[_0x5e52('0x1b')]({'api_key':_0x211e3f[_0x5e52('0x15a')]});});})[_0x5e52('0x4c')](handleError(_0x130e5c,0x193));}else{return _0x130e5c[_0x5e52('0x15')](0x191)[_0x5e52('0x1b')]({'message':_0x5e52('0x15e')});}};exports[_0x5e52('0x15f')]=function(_0x2b4962,_0x3f367c){if(!_[_0x5e52('0x5d')](_0x2b4962[_0x5e52('0x24')]['id'])&&(_0x2b4962[_0x5e52('0x24')][_0x5e52('0x1d')]==_0x5e52('0x23')||_0x2b4962[_0x5e52('0x24')]['role']=='user')){return db[_0x5e52('0x33')][_0x5e52('0x51')]({'where':{'id':_0x2b4962['params']['id']}})[_0x5e52('0x2d')](handleEntityNotFound(_0x3f367c,null))[_0x5e52('0x2d')](function(_0x116950){if(_0x116950&&_0x116950[_0x5e52('0x160')]&&_0x116950[_0x5e52('0x161')])return _0x116950;else throw{'message':_0x5e52('0x162')};})[_0x5e52('0x2d')](function(){return db[_0x5e52('0x33')][_0x5e52('0x1c')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x2b4962['params']['id']}});})[_0x5e52('0x2d')](respondWithStatusCode(_0x3f367c,0xc8))[_0x5e52('0x4c')](handleError(_0x3f367c,0x193));}else{return _0x3f367c[_0x5e52('0x15')](0x191)[_0x5e52('0x1b')]({'message':_0x5e52('0x15e')});}};exports['whoami']=function(_0x343c76,_0x169e60){var _0x4720a6=_0x343c76['user']['get']({'plain':!![]});if(!_0x4720a6){return _0x169e60['status'](0x191)[_0x5e52('0x32')](_0x5e52('0x163'));}else{Promise[_0x5e52('0xf8')]()['then'](function(){if(_0x343c76['query'][_0x5e52('0x3d')]!==_0x5e52('0x42'))return;return _0x343c76[_0x5e52('0x24')]['getUserSetting']();})[_0x5e52('0x2d')](function(_0x25bd71){if(!_0x25bd71)return;return _0x25bd71[_0x5e52('0x22')]({'plain':!![]});})[_0x5e52('0x2d')](function(_0x19e5f7){_0x4720a6[_0x5e52('0x3d')]=_0x19e5f7;return _0x169e60[_0x5e52('0x15')](0xc8)[_0x5e52('0x1b')](_0x4720a6);});}};exports[_0x5e52('0x164')]=function(_0x5bf359,_0x5b0b38){var _0x29b66c={'offset':0x0};var _0xdf23df={'count':0x0,'rows':[]};var _0x2260ef=[_0x5e52('0x165'),_0x5e52('0x166'),'ringing'];var _0x4e28f1=[];var _0x359ac0=[];var _0x3829e5=[];var _0x58db95=_0x5bf359[_0x5e52('0x3b')][_0x5e52('0x167')];var _0x2fc4f4=_0x5bf359[_0x5e52('0x3b')][_0x5e52('0x168')];var _0x1dbbfc=_0x5bf359[_0x5e52('0x3b')][_0x5e52('0x28')];return Promise['resolve']()[_0x5e52('0x2d')](function(){if(!_0x58db95){return[];}return db[_0x5e52('0x108')][_0x5e52('0x40')]({'attributes':['id',_0x5e52('0x31')],'where':{'id':_0x58db95}});})[_0x5e52('0x2d')](function(_0xbeafe7){_0x3829e5=_0xbeafe7;if(!_0x2fc4f4){return[];}return db[_0x5e52('0x9a')][_0x5e52('0x40')]({'attributes':['id','name'],'type':_0x5e52('0x169'),'where':{'id':_0x2fc4f4}});})[_0x5e52('0x2d')](function(_0x28f30c){_0x359ac0=_0x28f30c;var _0x4d780c=_0x3829e5['concat'](_0x359ac0)[_0x5e52('0x2a')](function(_0x2ed1ea){return _0x2ed1ea[_0x5e52('0x114')]({'attributes':['id','name',_0x5e52('0x57'),_0x5e52('0x8e')],'raw':!![]});});return Promise['all'](_0x4d780c);})['then'](function(_0x11ca0d){var _0x3980cd=_[_0x5e52('0x16a')](_0x11ca0d);if(_0x1dbbfc){if(_0x2fc4f4||_0x58db95){return _0x3980cd['filter'](function(_0x494691){return _0x494691['name']['toLowerCase']()[_0x5e52('0x2b')](_0x1dbbfc['toLowerCase']())||_0x494691[_0x5e52('0x57')]['toString']()['includes'](_0x1dbbfc);});}else{return db[_0x5e52('0x33')][_0x5e52('0x40')]({'attributes':['id',_0x5e52('0x31'),_0x5e52('0x57'),_0x5e52('0x8e')],'where':{'role':_0x5e52('0x1e'),'$or':[db['sequelize']['where'](db[_0x5e52('0x5f')]['fn']('lower',db[_0x5e52('0x5f')][_0x5e52('0x16b')](_0x5e52('0x31'))),{'$like':'%'+_0x1dbbfc['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x1dbbfc+'%'}}]},'raw':!![]});}}else{return _0x3980cd;}})[_0x5e52('0x2d')](function(_0x42564f){var _0x26d20f=_0x5e52('0x31');var _0x5bf885=_0x5e52('0x16c');if(_0x5bf359[_0x5e52('0x3b')][_0x5e52('0xc8')]){_0x5bf885=_0x5bf359[_0x5e52('0x3b')][_0x5e52('0xc8')][0x0]==='-'?_0x5e52('0x16d'):_0x5e52('0x16c');_0x26d20f=_0x5bf885==='asc'?_0x5bf359[_0x5e52('0x3b')][_0x5e52('0xc8')]:_0x5bf359[_0x5e52('0x3b')]['sort'][_0x5e52('0x16e')](0x1);}return _(_0x42564f)[_0x5e52('0x16f')]('id')[_0x5e52('0x170')]([function(_0x91f7f1){return _0x26d20f===_0x5e52('0x31')?_0x91f7f1[_0x26d20f][_0x5e52('0x95')]():_0x91f7f1[_0x26d20f];}],[_0x5bf885])[_0x5e52('0x2a')](function(_0xf0cd25){return _[_0x5e52('0xca')](_0xf0cd25,['id',_0x5e52('0x31'),_0x5e52('0x57'),_0x5e52('0x8e')]);})[_0x5e52('0x37')]();})['then'](function(_0x2d6f1d){_0x4e28f1=_0x2d6f1d;return rta[_0x5e52('0x171')]();})['then'](function(_0x5e3f4b){return _0x4e28f1[_0x5e52('0x2a')](function(_0xc5a99b){var _0x1c395e=_[_0x5e52('0x51')](_0x5e3f4b[_0x5e52('0x43')],['id',_0xc5a99b['id']]);if(!_0x1c395e||!_0xc5a99b[_0x5e52('0x8e')]){_0xc5a99b['status']=_0x5e52('0x172');}else if(_0x1c395e[_0x5e52('0x9c')]){_0xc5a99b['status']=_0x5e52('0xf9');}else if(_0x1c395e[_0x5e52('0x173')]==='unavailable'||!_0x1c395e[_0x5e52('0x173')]){_0xc5a99b[_0x5e52('0x15')]=_0x5e52('0x174');}else{_0xc5a99b[_0x5e52('0x15')]=_0x2260ef[_0x5e52('0x2b')](_0x1c395e[_0x5e52('0x173')])?'online':_0x5e52('0x175');}return _0xc5a99b;});})[_0x5e52('0x2d')](function(_0x5b035e){if(!_0x5bf359[_0x5e52('0x3b')]['hasOwnProperty']('nolimit')){_0x29b66c[_0x5e52('0x17')]=qs['limit'](_0x5bf359['query'][_0x5e52('0x17')]||0xa);_0x29b66c[_0x5e52('0x19')]=qs[_0x5e52('0x19')](_0x5bf359['query']['offset']);}_0xdf23df[_0x5e52('0x18')]=_0x5b035e['length'];_0xdf23df[_0x5e52('0x43')]=_0x29b66c['limit']?_0x5b035e[_0x5e52('0x176')](_0x29b66c['offset'],_0x29b66c['offset']+_0x29b66c[_0x5e52('0x17')]):_0x5b035e;return _0xdf23df;})[_0x5e52('0x2d')](respondWithFilteredResult(_0x5b0b38,_0x29b66c))[_0x5e52('0x4c')](handleError(_0x5b0b38,null));};function get_open_tabs(_0x363c9d,_0x4e340b){var _0xb7db19=_0x363c9d[_0x5e52('0x177')](0x0)[_0x5e52('0x178')]()+_0x363c9d['slice'](0x1);var _0x5ca243={'type':db[_0x5e52('0x7f')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x5d208c,_0x41a5f2){var _0x5c5e05=squel['select']()[_0x5e52('0x179')]('ui.'+_0xb7db19+_0x5e52('0x17a'),'id')[_0x5e52('0x179')](_0x5e52('0x17b'))[_0x5e52('0x62')](_0x5e52('0x17c')+_0x363c9d+'_interactions','ui')[_0x5e52('0xcb')](_0x5e52('0x17d'),_0x4e340b['id']);return db[_0x5e52('0x5f')][_0x5e52('0x3b')](_0x5c5e05[_0x5e52('0x17e')](),_0x5ca243)[_0x5e52('0x2d')](function(_0x38367f){_0x4e340b[_0xb7db19+_0x5e52('0x17f')]=_0x38367f;_0x5d208c(_0x38367f);})['catch'](function(_0x3ddefc){_0x41a5f2(_0x3ddefc);});});}exports['messengerSoundNotification']=function(_0x3b1caf,_0x24c8ca){var _0x394623=_0x3b1caf[_0x5e52('0x54')]['id'];var _0x1649de=_0x3b1caf[_0x5e52('0x53')][_0x5e52('0x180')];return db['User'][_0x5e52('0x1c')]({'messengerSoundNotification':_0x1649de},{'where':{'id':_0x394623}})[_0x5e52('0x2d')](respondWithStatusCode(_0x24c8ca,null))[_0x5e52('0x4c')](handleError(_0x24c8ca,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe19=['hook','events','../../mysqldb','User','save','update','remove','emit','hasOwnProperty'];(function(_0x2bbdc4,_0x2cb88e){var _0x482d0c=function(_0x4da8ce){while(--_0x4da8ce){_0x2bbdc4['push'](_0x2bbdc4['shift']());}};_0x482d0c(++_0x2cb88e);}(_0xbe19,0x196));var _0x9be1=function(_0x1ac77b,_0x220a01){_0x1ac77b=_0x1ac77b-0x0;var _0x3b9b2a=_0xbe19[_0x1ac77b];return _0x3b9b2a;};'use strict';var EventEmitter=require(_0x9be1('0x0'));var User=require(_0x9be1('0x1'))['db'][_0x9be1('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9be1('0x3'),'afterUpdate':_0x9be1('0x4'),'afterDestroy':_0x9be1('0x5')};function emitEvent(_0x113694){return function(_0x2e22ec,_0x18f2c7,_0x50d13e){UserEvents[_0x9be1('0x6')](_0x113694+':'+_0x2e22ec['id'],_0x2e22ec);UserEvents['emit'](_0x113694,_0x2e22ec);_0x50d13e(null);};}for(var e in events){if(events[_0x9be1('0x7')](e)){var event=events[e];User[_0x9be1('0x8')](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
+var _0x5bae=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','User','setMaxListeners','update'];(function(_0x6e6f2a,_0x13b0a9){var _0x4e49bf=function(_0x57c3a5){while(--_0x57c3a5){_0x6e6f2a['push'](_0x6e6f2a['shift']());}};_0x4e49bf(++_0x13b0a9);}(_0x5bae,0x1ef));var _0xe5ba=function(_0x487f61,_0x5c61ee){_0x487f61=_0x487f61-0x0;var _0x1b4239=_0x5bae[_0x487f61];return _0x1b4239;};'use strict';var EventEmitter=require(_0xe5ba('0x0'));var User=require(_0xe5ba('0x1'))['db'][_0xe5ba('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xe5ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe5ba('0x4'),'afterDestroy':_0xe5ba('0x5')};function emitEvent(_0x4bcc81){return function(_0x35c268,_0x717c35,_0x38f333){UserEvents[_0xe5ba('0x6')](_0x4bcc81+':'+_0x35c268['id'],_0x35c268);UserEvents[_0xe5ba('0x6')](_0x4bcc81,_0x35c268);_0x38f333(null);};}for(var e in events){if(events[_0xe5ba('0x7')](e)){var event=events[e];User[_0xe5ba('0x8')](e,emitEvent(event));}}module[_0xe5ba('0x9')]=UserEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x891b=['name','options','StopMixMonitor','wav','WAV','context','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','VoiceChanSpy','findAll','then','internal','concat','models','define','User','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','find','privacyEnabled','catch','changed','updateMd5Password','updatePassword','userSetting','createUserSetting','error','VoiceExtension','bulkCreate','destroy','password','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','from','pbkdf2Sync','sha1','pbkdf2','base64','indexOf','Invalid\x20password','makeSalt','md5secret',':asterisk:','client','http','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','manual','voice','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','result','message','UserVoiceQueueRt','PAUSE','channel','update','YYYY-MM-DD\x20HH:mm:ss','all','voicePause','mailPause','chatPause','faxPause','smsPause','whatsappPause','openchannelPause','Pause','getRealtimeData','../../config/utils','getChannels','forEach','setDataValue','util','md5','lodash','jayson/promise','./user.attributes','google','length','system','format','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0xb891('0x0'));var md5=require(_0xb891('0x1'));var moment=require('moment');var _=require(_0xb891('0x2'));var jayson=require(_0xb891('0x3'));var attributes=require(_0xb891('0x4'));var authTypes=[_0xb891('0x5')];var validatePresenceOf=function(_0x587bf1){return _0x587bf1&&_0x587bf1[_0xb891('0x6')];};var getChanSpyApplications=function(_0x44ca2e,_0x542400,_0x3635be){var _0x4eda97={'context':_0x44ca2e['context']||'from-sip','type':_0xb891('0x7'),'isApp':![],'UserId':_0x44ca2e['id']};var _0x367478=[];for(var _0x3f838f=0x0,_0x1ca185=0x1;_0x3f838f<_0x3635be[_0xb891('0x6')];_0x3f838f++,_0x1ca185=0x1){var _0x414a33={'exten':util[_0xb891('0x8')]('%s%s',_0x3635be[_0x3f838f][_0xb891('0x9')],_0x542400),'ChanSpyId':_0x3635be[_0x3f838f]['id']};_0x367478[_0xb891('0xa')](_[_0xb891('0xb')]({'app':_0xb891('0xc'),'appdata':util[_0xb891('0x8')](_0xb891('0xd'),_0xb891('0xe')),'priority':_0x1ca185++},_0x4eda97,_0x414a33));if(_0x3635be[_0x3f838f][_0xb891('0xf')]){_0x367478[_0xb891('0xa')](_[_0xb891('0xb')]({'app':_0xb891('0x10'),'appdata':util['format'](_0xb891('0x11'),_0x3635be[_0x3f838f][_0xb891('0x12')]),'priority':_0x1ca185++},_0x4eda97,_0x414a33));}if(_0x3635be[_0x3f838f][_0xb891('0x13')]){_0x367478['push'](_[_0xb891('0xb')]({'app':_0xb891('0x14'),'appdata':_0x3635be[_0x3f838f]['password'],'priority':_0x1ca185++},_0x4eda97,_0x414a33));}_0x367478[_0xb891('0xa')](_['merge']({'app':_0xb891('0x15'),'appdata':util[_0xb891('0x8')](_0xb891('0x16'),_0x44ca2e[_0xb891('0x17')],_0x3635be[_0x3f838f][_0xb891('0x18')]?_0x3635be[_0x3f838f][_0xb891('0x18')]['join'](''):''),'priority':_0x1ca185++},_0x4eda97,_0x414a33));if(_0x3635be[_0x3f838f]['record']){_0x367478[_0xb891('0xa')](_[_0xb891('0xb')]({'app':_0xb891('0x19'),'priority':_0x1ca185++},_0x4eda97,_0x414a33));}}return _0x367478;};var getUserApplications=function(_0x35f2bb,_0x4031eb){var _0x37d51c=[_0xb891('0x1a'),_0xb891('0x1b'),'gsm'];var _0x4d56fb={'context':_0x35f2bb[_0xb891('0x1c')]||'from-sip','exten':_0x4031eb,'type':_0xb891('0x7'),'isApp':![],'UserId':_0x35f2bb['id']};var _0x1f1c66=[{'app':'Set','appdata':_0xb891('0x1d')}];if(_0x35f2bb['extensionMonitor']&&_[_0xb891('0x1e')](_0x37d51c,_0x35f2bb[_0xb891('0x1f')])){_0x1f1c66[_0xb891('0xa')]({'app':_0xb891('0xc'),'appdata':_0xb891('0x20')});_0x1f1c66[_0xb891('0xa')]({'app':_0xb891('0xc'),'appdata':util[_0xb891('0x8')](_0xb891('0x21'),_0x35f2bb[_0xb891('0x1f')])});_0x1f1c66[_0xb891('0xa')]({'app':_0xb891('0x22'),'appdata':util['format'](_0xb891('0x23'),_0x35f2bb[_0xb891('0x17')])});}else{_0x1f1c66[_0xb891('0xa')]({'app':'Dial','appdata':util[_0xb891('0x8')]('SIP/%s,,tTxX',_0x35f2bb[_0xb891('0x17')])});}_0x1f1c66[_0xb891('0xa')]({'app':_0xb891('0x24')});for(var _0xadbcad=0x0;_0xadbcad<_0x1f1c66[_0xb891('0x6')];_0xadbcad++){_0x1f1c66[_0xadbcad]['priority']=_0xadbcad+0x1;_0x1f1c66[_0xadbcad]=_['defaults'](_0x1f1c66[_0xadbcad],_0x4d56fb);}return _0x1f1c66;};var getChanSpyPromise=function(_0x3f71b0,_0x54f690){return new BPromise(function(_0x49e864,_0x1291e3){return _0x3f71b0[_0xb891('0x25')][_0xb891('0x26')]()[_0xb891('0x27')](function(_0x35a363){if(_0x35a363){var _0x586529=getChanSpyApplications(_0x54f690,_0x54f690[_0xb891('0x28')],_0x35a363);if(_0x54f690['internal']!=_0x54f690[_0xb891('0x17')]){_0x586529=_0x586529[_0xb891('0x29')](getChanSpyApplications(_0x54f690,_0x54f690[_0xb891('0x17')],_0x35a363));}return _0x49e864(_0x586529);}return _0x49e864([]);})['catch'](function(_0x23c913){_0x1291e3(_0x23c913);});});};module['exports']=function(_0x489a73){var _0x1d5e51=_0x489a73[_0xb891('0x2a')];return _0x489a73[_0xb891('0x2b')](_0xb891('0x2c'),attributes,{'tableName':'users','charset':_0xb891('0x2d'),'collate':_0xb891('0x2e'),'hooks':{'beforeCreate':function(_0x257f6e,_0x573835,_0x432eb6){var _0x576212=typeof _0x257f6e[_0xb891('0x2f')]===_0xb891('0x30')?BPromise[_0xb891('0x31')](null):_0x1d5e51[_0xb891('0x32')][_0xb891('0x33')]({'where':{'id':_0x257f6e[_0xb891('0x2f')]}});_0x576212[_0xb891('0x27')](function(_0x2389c9){if(_0x2389c9){_0x257f6e[_0xb891('0x34')]=_0x2389c9[_0xb891('0x34')];}})[_0xb891('0x27')](function(){_0x257f6e['updateMd5Password']();_0x257f6e['updatePassword'](_0x432eb6);})[_0xb891('0x35')](function(_0x479f6b){_0x432eb6(_0x479f6b);});},'beforeUpdate':function(_0x35ec43,_0x1fba29,_0x30d22e){Promise[_0xb891('0x31')]()[_0xb891('0x27')](function(){if(_0x35ec43[_0xb891('0x36')](_0xb891('0x2f'))===![])return;return _0x1d5e51[_0xb891('0x32')][_0xb891('0x33')]({'where':{'id':_0x35ec43[_0xb891('0x2f')]}})['then'](function(_0x431a6b){if(_0x431a6b)_0x35ec43['privacyEnabled']=_0x431a6b[_0xb891('0x34')];return;});})['then'](function(){if(_0x35ec43[_0xb891('0x36')]('password')){_0x35ec43[_0xb891('0x37')]();return _0x35ec43[_0xb891('0x38')](_0x30d22e);}_0x30d22e();})[_0xb891('0x35')](function(_0x104e98){_0x30d22e(_0x104e98);});},'afterCreate':function(_0x32526e,_0xd18ae3,_0x3d09ea){var _0x2e2316=getUserApplications(_0x32526e,_0x32526e[_0xb891('0x28')]);if(_0x32526e[_0xb891('0x28')]!=_0x32526e[_0xb891('0x17')]){_0x2e2316=_0x2e2316[_0xb891('0x29')](getUserApplications(_0x32526e,_0x32526e[_0xb891('0x17')]));}return Promise[_0xb891('0x31')]()[_0xb891('0x27')](function(){if(!_0x32526e[_0xb891('0x39')]){return _0x32526e[_0xb891('0x3a')]({'clientSideLoggingLevel':_0xb891('0x3b'),'clientSideLoggingEnabled':![]});}})[_0xb891('0x27')](function(){return _0x1d5e51[_0xb891('0x3c')]['bulkCreate'](_0x2e2316);})[_0xb891('0x27')](function(){if(_0x32526e[_0xb891('0xe')]){return getChanSpyPromise(_0x1d5e51,_0x32526e);}})[_0xb891('0x27')](function(_0x58019a){if(_0x58019a&&_0x58019a['length']){return _0x1d5e51['VoiceExtension']['bulkCreate'](_0x58019a);}})['then'](function(){_0x3d09ea();})[_0xb891('0x35')](function(_0x3e1890){_0x3d09ea(_0x3e1890);});},'afterUpdate':function(_0x509e69,_0x31644d,_0x44e864){return BPromise[_0xb891('0x31')]()[_0xb891('0x27')](function(){if(_0x509e69[_0xb891('0x36')](_0xb891('0xe'))||_0x509e69[_0xb891('0x36')](_0xb891('0x1c'))){return _0x1d5e51[_0xb891('0x3c')]['destroy']({'where':{'UserId':_0x509e69['id'],'type':_0xb891('0x7'),'ChanSpyId':{'$ne':null}}})[_0xb891('0x27')](function(){if(_0x509e69['chanspy']){return getChanSpyPromise(_0x1d5e51,_0x509e69)[_0xb891('0x27')](function(_0x166bc0){if(_0x166bc0&&_0x166bc0[_0xb891('0x6')]){return _0x1d5e51[_0xb891('0x3c')][_0xb891('0x3d')](_0x166bc0);}});}});}})[_0xb891('0x27')](function(){if(_0x509e69[_0xb891('0x36')](_0xb891('0x1f'))||_0x509e69[_0xb891('0x36')](_0xb891('0x1c'))){return _0x1d5e51[_0xb891('0x3c')]['destroy']({'where':{'UserId':_0x509e69['id'],'type':_0xb891('0x7'),'ChanSpyId':null}})[_0xb891('0x27')](function(){var _0x5e09b5=getUserApplications(_0x509e69,_0x509e69[_0xb891('0x28')]);if(_0x509e69[_0xb891('0x28')]!=_0x509e69['name']){_0x5e09b5=_0x5e09b5[_0xb891('0x29')](getUserApplications(_0x509e69,_0x509e69[_0xb891('0x17')]));}return _0x1d5e51['VoiceExtension']['bulkCreate'](_0x5e09b5);});}})[_0xb891('0x27')](function(){_0x44e864();})[_0xb891('0x35')](function(_0x376a7d){_0x44e864(_0x376a7d);});},'afterDestroy':function(_0x89d87b){return _0x1d5e51[_0xb891('0x3c')][_0xb891('0x3e')]({'where':{'UserId':_0x89d87b['id'],'type':_0xb891('0x7')}});}},'instanceMethods':{'authenticate':function(_0x472cca,_0x527bc1){if(!_0x527bc1){return this[_0xb891('0x3f')]===this[_0xb891('0x40')](_0x472cca);}var _0x5e4444=this;this[_0xb891('0x40')](_0x472cca,function(_0x1a6797,_0x538057){if(_0x1a6797){_0x527bc1(_0x1a6797);}if(_0x5e4444['password']===_0x538057){_0x527bc1(null,!![]);}else{_0x527bc1(null,![]);}});},'makeSalt':function(_0x1d02bf,_0x15a99e){var _0x4e50f9=0x10;if(typeof arguments[0x0]===_0xb891('0x41')){_0x15a99e=arguments[0x0];_0x1d02bf=_0x4e50f9;}else if(typeof arguments[0x1]===_0xb891('0x41')){_0x15a99e=arguments[0x1];}else{throw new Error(_0xb891('0x42'));}if(!_0x1d02bf){_0x1d02bf=_0x4e50f9;}return crypto[_0xb891('0x43')](_0x1d02bf,function(_0x1eee36,_0x131510){if(_0x1eee36){_0x15a99e(_0x1eee36);}return _0x15a99e(null,_0x131510[_0xb891('0x44')]('base64'));});},'encryptPassword':function(_0x8577af,_0x3b3263){if(!_0x8577af||!this[_0xb891('0x45')]){return _0x3b3263?_0x3b3263(null):null;}var _0x2d6a02=0x2710;var _0x40e09c=0x40;var _0x48312f=Buffer[_0xb891('0x46')](this[_0xb891('0x45')],'base64');if(!_0x3b3263){return crypto[_0xb891('0x47')](_0x8577af,_0x48312f,_0x2d6a02,_0x40e09c,_0xb891('0x48'))[_0xb891('0x44')]('base64');}return crypto[_0xb891('0x49')](_0x8577af,_0x48312f,_0x2d6a02,_0x40e09c,_0xb891('0x48'),function(_0x7eb7d,_0x1f2630){if(_0x7eb7d){_0x3b3263(_0x7eb7d);}return _0x3b3263(null,_0x1f2630[_0xb891('0x44')](_0xb891('0x4a')));});},'updatePassword':function(_0x320e5b){if(!this['password']){return _0x320e5b(null);}if(!validatePresenceOf(this[_0xb891('0x3f')])&&authTypes[_0xb891('0x4b')](this['provider'])===-0x1){_0x320e5b(new Error(_0xb891('0x4c')));}var _0x453add=this;this[_0xb891('0x4d')](function(_0x1b9ea6,_0x1434f8){if(_0x1b9ea6){return _0x320e5b(_0x1b9ea6);}_0x453add['salt']=_0x1434f8;_0x453add[_0xb891('0x40')](_0x453add[_0xb891('0x3f')],function(_0x429d4e,_0x372605){if(_0x429d4e){_0x320e5b(_0x429d4e);}_0x453add[_0xb891('0x3f')]=_0x372605;_0x320e5b(null);});});},'updateMd5Password':function(){this[_0xb891('0x4e')]=md5(this[_0xb891('0x17')]+_0xb891('0x4f')+this[_0xb891('0x3f')]);return this[_0xb891('0x4e')];},'getRealtimeData':function(){var _0x27093b={'id':this['id']};var _0x212f4e=jayson[_0xb891('0x50')]['http']({'port':0x232a});var _0x1bb1d4=jayson[_0xb891('0x50')][_0xb891('0x51')]({'port':0x232c});var _0x2a5c84={};var _0x19f2fb={};return _0x212f4e[_0xb891('0x52')](_0xb891('0x53'),_0x27093b)[_0xb891('0x27')](function(_0x24c95a){if(_0x24c95a[_0xb891('0x3b')]){throw new Error(_0xb891('0x54'));}_0x2a5c84=_0x24c95a['result'];return _0x1bb1d4['request']('Agents',_0x27093b);})[_0xb891('0x27')](function(_0x18473d){if(_0x18473d[_0xb891('0x3b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)');}_0x19f2fb=_0x18473d['result'];var _0x35e44d=_[_0xb891('0xb')]({},_0x2a5c84,_0x19f2fb);return _0x35e44d;})[_0xb891('0x35')](function(_0x500c91){throw _0x500c91;});},'unpause':function(_0x58c066,_0x5b5410=_0xb891('0x55')){var _0x46dee0=this;var _0xa8ef50={};return Promise[_0xb891('0x31')]()[_0xb891('0x27')](function(){if(!_0x58c066||_0x58c066===_0xb891('0x56')&&_0x5b5410===_0xb891('0x55')){var _0x14154a=jayson[_0xb891('0x50')][_0xb891('0x51')]({'port':0x232a});return _0x14154a[_0xb891('0x52')](_0xb891('0x57'),{'id':_0x46dee0['id'],'name':_0x46dee0[_0xb891('0x17')],'pause':![]})[_0xb891('0x27')](function(_0x503efc){if(_0x503efc[_0xb891('0x3b')]){throw new Error(util[_0xb891('0x8')](_0xb891('0x58'),_0x46dee0['id'],_0x46dee0[_0xb891('0x17')]));}return _0x503efc[_0xb891('0x59')][_0xb891('0x5a')];});}})[_0xb891('0x27')](function(){if(!_0x58c066||_0x58c066===_0xb891('0x56')){return _0x1d5e51[_0xb891('0x5b')]['update']({'paused':0x0},{'where':{'UserId':_0x46dee0['id']},'individualHooks':!![]});}})['then'](function(){var _0x3243e1=!_0x58c066?_0xb891('0x26'):'findOne';var _0x1869fb={'membername':_0x46dee0[_0xb891('0x17')],'type':_0xb891('0x5c'),'exitAt':null};if(_0x58c066){_0x1869fb[_0xb891('0x5d')]=_0x58c066;}return _0x1d5e51['MemberReport'][_0x3243e1]({'where':_0x1869fb});})['then'](function(_0x5ee401){if(_0x5ee401){var _0x40f438=Array['isArray'](_0x5ee401)?_0x5ee401:[_0x5ee401];var _0x39899a=_0x40f438['map'](function(_0x13949d){return _0x13949d[_0xb891('0x5e')]({'exitAt':moment()[_0xb891('0x8')](_0xb891('0x5f')),'data2':_0x5b5410});});return Promise[_0xb891('0x60')](_0x39899a);}})['then'](function(){if(!_0x58c066){_0xa8ef50[_0xb891('0x61')]=![];_0xa8ef50[_0xb891('0x62')]=![];_0xa8ef50[_0xb891('0x63')]=![];_0xa8ef50[_0xb891('0x64')]=![];_0xa8ef50[_0xb891('0x65')]=![];_0xa8ef50[_0xb891('0x66')]=![];_0xa8ef50[_0xb891('0x67')]=![];}else{_0xa8ef50[_0x58c066+_0xb891('0x68')]=![];}return _0x46dee0[_0xb891('0x69')]();})[_0xb891('0x27')](function(_0x4040c0){var _0x38d4dc=require(_0xb891('0x6a'));var _0x253757=_0x38d4dc[_0xb891('0x6b')]();_0x253757[_0xb891('0x6c')](function(_0xc28185){var _0x4b1048=_0xc28185+'Status';_0x46dee0[_0xb891('0x6d')]([_0x4b1048],_0x4040c0[_0x4b1048]);});return _0x46dee0[_0xb891('0x5e')](_0xa8ef50);})[_0xb891('0x35')](function(_0x2aa3e3){throw _0x2aa3e3;});}}});};
\ No newline at end of file
+var _0x165d=['getChannels','forEach','Status','bluebird','crypto','util','md5','moment','lodash','jayson/promise','google','system','length','format','%s%s','push','merge','Set','CDR(type)=%s','record','MixMonitor','recordingFormat','auth','SIP/%s,%s','options','join','wav','WAV','gsm','context','from-sip','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','name','Hangup','defaults','VoiceChanSpy','findAll','then','internal','concat','exports','models','define','User','users','utf8','undefined','UserProfile','find','userProfileId','privacyEnabled','updateMd5Password','updatePassword','catch','resolve','changed','password','userSetting','createUserSetting','error','VoiceExtension','bulkCreate','chanspy','destroy','encryptPassword','function','randomBytes','base64','salt','from','toString','pbkdf2','sha1','indexOf','Invalid\x20password','md5secret','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)','manual','client','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','message','UserVoiceQueueRt','update','findOne','PAUSE','channel','MemberReport','isArray','map','YYYY-MM-DD\x20HH:mm:ss','all','voicePause','chatPause','faxPause','smsPause','whatsappPause','openchannelPause','Pause','../../config/utils'];(function(_0x58b2cf,_0xae18b8){var _0x356520=function(_0x250773){while(--_0x250773){_0x58b2cf['push'](_0x58b2cf['shift']());}};_0x356520(++_0xae18b8);}(_0x165d,0x14a));var _0xd165=function(_0x13f098,_0x4092a4){_0x13f098=_0x13f098-0x0;var _0x4a6c37=_0x165d[_0x13f098];return _0x4a6c37;};'use strict';var BPromise=require(_0xd165('0x0'));var crypto=require(_0xd165('0x1'));var util=require(_0xd165('0x2'));var md5=require(_0xd165('0x3'));var moment=require(_0xd165('0x4'));var _=require(_0xd165('0x5'));var jayson=require(_0xd165('0x6'));var attributes=require('./user.attributes');var authTypes=[_0xd165('0x7')];var validatePresenceOf=function(_0x27993b){return _0x27993b&&_0x27993b['length'];};var getChanSpyApplications=function(_0x58acb6,_0x5435f9,_0x42d256){var _0x2305bc={'context':_0x58acb6['context']||'from-sip','type':_0xd165('0x8'),'isApp':![],'UserId':_0x58acb6['id']};var _0x41a937=[];for(var _0xea098f=0x0,_0x2be177=0x1;_0xea098f<_0x42d256[_0xd165('0x9')];_0xea098f++,_0x2be177=0x1){var _0x239d6d={'exten':util[_0xd165('0xa')](_0xd165('0xb'),_0x42d256[_0xea098f]['prefix'],_0x5435f9),'ChanSpyId':_0x42d256[_0xea098f]['id']};_0x41a937[_0xd165('0xc')](_[_0xd165('0xd')]({'app':_0xd165('0xe'),'appdata':util['format'](_0xd165('0xf'),'chanspy'),'priority':_0x2be177++},_0x2305bc,_0x239d6d));if(_0x42d256[_0xea098f][_0xd165('0x10')]){_0x41a937[_0xd165('0xc')](_[_0xd165('0xd')]({'app':_0xd165('0x11'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x42d256[_0xea098f][_0xd165('0x12')]),'priority':_0x2be177++},_0x2305bc,_0x239d6d));}if(_0x42d256[_0xea098f][_0xd165('0x13')]){_0x41a937[_0xd165('0xc')](_['merge']({'app':'Authenticate','appdata':_0x42d256[_0xea098f]['password'],'priority':_0x2be177++},_0x2305bc,_0x239d6d));}_0x41a937[_0xd165('0xc')](_[_0xd165('0xd')]({'app':'ChanSpy','appdata':util[_0xd165('0xa')](_0xd165('0x14'),_0x58acb6['name'],_0x42d256[_0xea098f]['options']?_0x42d256[_0xea098f][_0xd165('0x15')][_0xd165('0x16')](''):''),'priority':_0x2be177++},_0x2305bc,_0x239d6d));if(_0x42d256[_0xea098f]['record']){_0x41a937['push'](_['merge']({'app':'StopMixMonitor','priority':_0x2be177++},_0x2305bc,_0x239d6d));}}return _0x41a937;};var getUserApplications=function(_0x2352b0,_0x1521be){var _0xf50f25=[_0xd165('0x17'),_0xd165('0x18'),_0xd165('0x19')];var _0xadac10={'context':_0x2352b0[_0xd165('0x1a')]||_0xd165('0x1b'),'exten':_0x1521be,'type':'system','isApp':![],'UserId':_0x2352b0['id']};var _0x2e6c70=[{'app':'Set','appdata':_0xd165('0x1c')}];if(_0x2352b0[_0xd165('0x1d')]&&_['includes'](_0xf50f25,_0x2352b0[_0xd165('0x1d')])){_0x2e6c70[_0xd165('0xc')]({'app':'Set','appdata':_0xd165('0x1e')});_0x2e6c70[_0xd165('0xc')]({'app':_0xd165('0xe'),'appdata':util['format'](_0xd165('0x1f'),_0x2352b0[_0xd165('0x1d')])});_0x2e6c70[_0xd165('0xc')]({'app':_0xd165('0x20'),'appdata':util[_0xd165('0xa')](_0xd165('0x21'),_0x2352b0['name'])});}else{_0x2e6c70[_0xd165('0xc')]({'app':_0xd165('0x20'),'appdata':util[_0xd165('0xa')](_0xd165('0x22'),_0x2352b0[_0xd165('0x23')])});}_0x2e6c70[_0xd165('0xc')]({'app':_0xd165('0x24')});for(var _0x4c9b4e=0x0;_0x4c9b4e<_0x2e6c70[_0xd165('0x9')];_0x4c9b4e++){_0x2e6c70[_0x4c9b4e]['priority']=_0x4c9b4e+0x1;_0x2e6c70[_0x4c9b4e]=_[_0xd165('0x25')](_0x2e6c70[_0x4c9b4e],_0xadac10);}return _0x2e6c70;};var getChanSpyPromise=function(_0x419b49,_0xeefe8){return new BPromise(function(_0x4c503a,_0x2e71e3){return _0x419b49[_0xd165('0x26')][_0xd165('0x27')]()[_0xd165('0x28')](function(_0x59a5d6){if(_0x59a5d6){var _0x28cf6e=getChanSpyApplications(_0xeefe8,_0xeefe8[_0xd165('0x29')],_0x59a5d6);if(_0xeefe8[_0xd165('0x29')]!=_0xeefe8[_0xd165('0x23')]){_0x28cf6e=_0x28cf6e[_0xd165('0x2a')](getChanSpyApplications(_0xeefe8,_0xeefe8[_0xd165('0x23')],_0x59a5d6));}return _0x4c503a(_0x28cf6e);}return _0x4c503a([]);})['catch'](function(_0x16852a){_0x2e71e3(_0x16852a);});});};module[_0xd165('0x2b')]=function(_0x4becdf){var _0x191a82=_0x4becdf[_0xd165('0x2c')];return _0x4becdf[_0xd165('0x2d')](_0xd165('0x2e'),attributes,{'tableName':_0xd165('0x2f'),'charset':_0xd165('0x30'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x51f38d,_0x130c9a,_0x5c68e2){var _0x36b821=typeof _0x51f38d['userProfileId']===_0xd165('0x31')?BPromise['resolve'](null):_0x191a82[_0xd165('0x32')][_0xd165('0x33')]({'where':{'id':_0x51f38d[_0xd165('0x34')]}});_0x36b821[_0xd165('0x28')](function(_0x3175f4){if(_0x3175f4){_0x51f38d[_0xd165('0x35')]=_0x3175f4[_0xd165('0x35')];}})[_0xd165('0x28')](function(){_0x51f38d[_0xd165('0x36')]();_0x51f38d[_0xd165('0x37')](_0x5c68e2);})[_0xd165('0x38')](function(_0x440869){_0x5c68e2(_0x440869);});},'beforeUpdate':function(_0x2604cc,_0x329ffa,_0x49b03a){Promise[_0xd165('0x39')]()[_0xd165('0x28')](function(){if(_0x2604cc[_0xd165('0x3a')](_0xd165('0x34'))===![])return;return _0x191a82[_0xd165('0x32')]['find']({'where':{'id':_0x2604cc['userProfileId']}})['then'](function(_0x30b2e1){if(_0x30b2e1)_0x2604cc[_0xd165('0x35')]=_0x30b2e1[_0xd165('0x35')];return;});})[_0xd165('0x28')](function(){if(_0x2604cc[_0xd165('0x3a')](_0xd165('0x3b'))){_0x2604cc[_0xd165('0x36')]();return _0x2604cc[_0xd165('0x37')](_0x49b03a);}_0x49b03a();})[_0xd165('0x38')](function(_0x1a2e19){_0x49b03a(_0x1a2e19);});},'afterCreate':function(_0x3ecede,_0x5b73cf,_0x30961f){var _0x3025ee=getUserApplications(_0x3ecede,_0x3ecede[_0xd165('0x29')]);if(_0x3ecede[_0xd165('0x29')]!=_0x3ecede[_0xd165('0x23')]){_0x3025ee=_0x3025ee['concat'](getUserApplications(_0x3ecede,_0x3ecede[_0xd165('0x23')]));}return Promise[_0xd165('0x39')]()['then'](function(){if(!_0x3ecede[_0xd165('0x3c')]){return _0x3ecede[_0xd165('0x3d')]({'clientSideLoggingLevel':_0xd165('0x3e'),'clientSideLoggingEnabled':![]});}})[_0xd165('0x28')](function(){return _0x191a82[_0xd165('0x3f')][_0xd165('0x40')](_0x3025ee);})['then'](function(){if(_0x3ecede['chanspy']){return getChanSpyPromise(_0x191a82,_0x3ecede);}})[_0xd165('0x28')](function(_0x1d1d49){if(_0x1d1d49&&_0x1d1d49[_0xd165('0x9')]){return _0x191a82[_0xd165('0x3f')][_0xd165('0x40')](_0x1d1d49);}})[_0xd165('0x28')](function(){_0x30961f();})[_0xd165('0x38')](function(_0xb446f8){_0x30961f(_0xb446f8);});},'afterUpdate':function(_0x56111c,_0x23b4b1,_0x4c0e49){return BPromise[_0xd165('0x39')]()[_0xd165('0x28')](function(){if(_0x56111c[_0xd165('0x3a')](_0xd165('0x41'))||_0x56111c[_0xd165('0x3a')](_0xd165('0x1a'))){return _0x191a82['VoiceExtension'][_0xd165('0x42')]({'where':{'UserId':_0x56111c['id'],'type':_0xd165('0x8'),'ChanSpyId':{'$ne':null}}})[_0xd165('0x28')](function(){if(_0x56111c['chanspy']){return getChanSpyPromise(_0x191a82,_0x56111c)[_0xd165('0x28')](function(_0x4cd043){if(_0x4cd043&&_0x4cd043[_0xd165('0x9')]){return _0x191a82[_0xd165('0x3f')][_0xd165('0x40')](_0x4cd043);}});}});}})[_0xd165('0x28')](function(){if(_0x56111c[_0xd165('0x3a')](_0xd165('0x1d'))||_0x56111c[_0xd165('0x3a')]('context')){return _0x191a82['VoiceExtension']['destroy']({'where':{'UserId':_0x56111c['id'],'type':'system','ChanSpyId':null}})['then'](function(){var _0x3e0dda=getUserApplications(_0x56111c,_0x56111c[_0xd165('0x29')]);if(_0x56111c[_0xd165('0x29')]!=_0x56111c[_0xd165('0x23')]){_0x3e0dda=_0x3e0dda[_0xd165('0x2a')](getUserApplications(_0x56111c,_0x56111c[_0xd165('0x23')]));}return _0x191a82['VoiceExtension']['bulkCreate'](_0x3e0dda);});}})[_0xd165('0x28')](function(){_0x4c0e49();})[_0xd165('0x38')](function(_0x3ac7cb){_0x4c0e49(_0x3ac7cb);});},'afterDestroy':function(_0x24f4f9){return _0x191a82[_0xd165('0x3f')]['destroy']({'where':{'UserId':_0x24f4f9['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0xd0e787,_0x44f678){if(!_0x44f678){return this['password']===this[_0xd165('0x43')](_0xd0e787);}var _0x252805=this;this[_0xd165('0x43')](_0xd0e787,function(_0x111e41,_0x36576e){if(_0x111e41){_0x44f678(_0x111e41);}if(_0x252805[_0xd165('0x3b')]===_0x36576e){_0x44f678(null,!![]);}else{_0x44f678(null,![]);}});},'makeSalt':function(_0x1b6f61,_0x23736a){var _0x8b488=0x10;if(typeof arguments[0x0]===_0xd165('0x44')){_0x23736a=arguments[0x0];_0x1b6f61=_0x8b488;}else if(typeof arguments[0x1]===_0xd165('0x44')){_0x23736a=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x1b6f61){_0x1b6f61=_0x8b488;}return crypto[_0xd165('0x45')](_0x1b6f61,function(_0x7a596e,_0x51fb80){if(_0x7a596e){_0x23736a(_0x7a596e);}return _0x23736a(null,_0x51fb80['toString'](_0xd165('0x46')));});},'encryptPassword':function(_0x3d4976,_0x4480ac){if(!_0x3d4976||!this[_0xd165('0x47')]){return _0x4480ac?_0x4480ac(null):null;}var _0x4ec1b2=0x2710;var _0x3229e3=0x40;var _0x3bf663=Buffer[_0xd165('0x48')](this[_0xd165('0x47')],'base64');if(!_0x4480ac){return crypto['pbkdf2Sync'](_0x3d4976,_0x3bf663,_0x4ec1b2,_0x3229e3,'sha1')[_0xd165('0x49')]('base64');}return crypto[_0xd165('0x4a')](_0x3d4976,_0x3bf663,_0x4ec1b2,_0x3229e3,_0xd165('0x4b'),function(_0x5bddef,_0x5e0789){if(_0x5bddef){_0x4480ac(_0x5bddef);}return _0x4480ac(null,_0x5e0789['toString']('base64'));});},'updatePassword':function(_0x2e54a7){if(!this[_0xd165('0x3b')]){return _0x2e54a7(null);}if(!validatePresenceOf(this[_0xd165('0x3b')])&&authTypes[_0xd165('0x4c')](this['provider'])===-0x1){_0x2e54a7(new Error(_0xd165('0x4d')));}var _0x7521b1=this;this['makeSalt'](function(_0x3a1714,_0x22aef0){if(_0x3a1714){return _0x2e54a7(_0x3a1714);}_0x7521b1['salt']=_0x22aef0;_0x7521b1[_0xd165('0x43')](_0x7521b1[_0xd165('0x3b')],function(_0x3b0576,_0xdccf99){if(_0x3b0576){_0x2e54a7(_0x3b0576);}_0x7521b1[_0xd165('0x3b')]=_0xdccf99;_0x2e54a7(null);});});},'updateMd5Password':function(){this[_0xd165('0x4e')]=md5(this[_0xd165('0x23')]+':asterisk:'+this['password']);return this['md5secret'];},'getRealtimeData':function(){var _0x206aaa={'id':this['id']};var _0x20f194=jayson['client']['http']({'port':0x232a});var _0x5b3c65=jayson['client']['http']({'port':0x232c});var _0x1984b0={};var _0xb55697={};return _0x20f194['request']('Agents',_0x206aaa)[_0xd165('0x28')](function(_0x5ae334){if(_0x5ae334['error']){throw new Error(_0xd165('0x4f'));}_0x1984b0=_0x5ae334[_0xd165('0x50')];return _0x5b3c65[_0xd165('0x51')]('Agents',_0x206aaa);})[_0xd165('0x28')](function(_0x54aecb){if(_0x54aecb['error']){throw new Error(_0xd165('0x52'));}_0xb55697=_0x54aecb[_0xd165('0x50')];var _0xd9193e=_[_0xd165('0xd')]({},_0x1984b0,_0xb55697);return _0xd9193e;})[_0xd165('0x38')](function(_0x48629c){throw _0x48629c;});},'unpause':function(_0x3b54c7,_0x56ba21='manual'){var _0x158a1c=this;var _0x2b316d={};return Promise['resolve']()[_0xd165('0x28')](function(){if(!_0x3b54c7||_0x3b54c7==='voice'&&_0x56ba21===_0xd165('0x53')){var _0x154d7a=jayson[_0xd165('0x54')]['http']({'port':0x232a});return _0x154d7a[_0xd165('0x51')](_0xd165('0x55'),{'id':_0x158a1c['id'],'name':_0x158a1c[_0xd165('0x23')],'pause':![]})[_0xd165('0x28')](function(_0x1e01d8){if(_0x1e01d8[_0xd165('0x3e')]){throw new Error(util[_0xd165('0xa')](_0xd165('0x56'),_0x158a1c['id'],_0x158a1c[_0xd165('0x23')]));}return _0x1e01d8['result'][_0xd165('0x57')];});}})[_0xd165('0x28')](function(){if(!_0x3b54c7||_0x3b54c7==='voice'){return _0x191a82[_0xd165('0x58')][_0xd165('0x59')]({'paused':0x0},{'where':{'UserId':_0x158a1c['id']},'individualHooks':!![]});}})[_0xd165('0x28')](function(){var _0x5a6110=!_0x3b54c7?'findAll':_0xd165('0x5a');var _0x497e4c={'membername':_0x158a1c[_0xd165('0x23')],'type':_0xd165('0x5b'),'exitAt':null};if(_0x3b54c7){_0x497e4c[_0xd165('0x5c')]=_0x3b54c7;}return _0x191a82[_0xd165('0x5d')][_0x5a6110]({'where':_0x497e4c});})[_0xd165('0x28')](function(_0x2358f1){if(_0x2358f1){var _0x360099=Array[_0xd165('0x5e')](_0x2358f1)?_0x2358f1:[_0x2358f1];var _0x2684fc=_0x360099[_0xd165('0x5f')](function(_0x3aa63d){return _0x3aa63d[_0xd165('0x59')]({'exitAt':moment()['format'](_0xd165('0x60')),'data2':_0x56ba21});});return Promise[_0xd165('0x61')](_0x2684fc);}})[_0xd165('0x28')](function(){if(!_0x3b54c7){_0x2b316d[_0xd165('0x62')]=![];_0x2b316d['mailPause']=![];_0x2b316d[_0xd165('0x63')]=![];_0x2b316d[_0xd165('0x64')]=![];_0x2b316d[_0xd165('0x65')]=![];_0x2b316d[_0xd165('0x66')]=![];_0x2b316d[_0xd165('0x67')]=![];}else{_0x2b316d[_0x3b54c7+_0xd165('0x68')]=![];}return _0x158a1c['getRealtimeData']();})[_0xd165('0x28')](function(_0x27cab1){var _0x360f27=require(_0xd165('0x69'));var _0x513770=_0x360f27[_0xd165('0x6a')]();_0x513770[_0xd165('0x6b')](function(_0x40de03){var _0x391c4e=_0x40de03+_0xd165('0x6c');_0x158a1c['setDataValue']([_0x391c4e],_0x27cab1[_0x391c4e]);});return _0x158a1c[_0xd165('0x59')](_0x2b316d);})[_0xd165('0x38')](function(_0x126ef3){throw _0x126ef3;});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5989=['findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','system','LogoutUser','findOne','all','mobile','phone','loginInPause','../../config/license/util','getLicense','agents','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','socket.io-emitter','GetUser','User','raw','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowUser','find','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport'];(function(_0x30f8cb,_0x13648b){var _0x2f6f50=function(_0x1e794f){while(--_0x1e794f){_0x30f8cb['push'](_0x30f8cb['shift']());}};_0x2f6f50(++_0x13648b);}(_0x5989,0x7b));var _0x9598=function(_0x2a7e10,_0x190fd2){_0x2a7e10=_0x2a7e10-0x0;var _0x213fdf=_0x5989[_0x2a7e10];return _0x213fdf;};'use strict';var _=require(_0x9598('0x0'));var util=require(_0x9598('0x1'));var moment=require('moment');var BPromise=require(_0x9598('0x2'));var Redis=require(_0x9598('0x3'));var db=require(_0x9598('0x4'))['db'];var utils=require(_0x9598('0x5'));var logger=require(_0x9598('0x6'))(_0x9598('0x7'));var config=require('../../config/environment');config[_0x9598('0x8')]=_[_0x9598('0x9')](config[_0x9598('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9598('0xa'))(new Redis(config['redis']));require('./user.socket')['register'](socket);exports[_0x9598('0xb')]=function(_0x137ae8){var _0x191502=this;return new Promise(function(_0x44fdaa,_0x35a74b){return db[_0x9598('0xc')]['findAll']({'raw':_0x137ae8['options']?_0x137ae8['options'][_0x9598('0xd')]===undefined?!![]:![]:!![],'where':_0x137ae8['options']?_0x137ae8[_0x9598('0xe')][_0x9598('0xf')]||null:null,'attributes':_0x137ae8[_0x9598('0xe')]?_0x137ae8['options'][_0x9598('0x10')]||null:null,'limit':_0x137ae8[_0x9598('0xe')]?_0x137ae8[_0x9598('0xe')][_0x9598('0x11')]||null:null,'include':_0x137ae8['options']?_0x137ae8['options'][_0x9598('0x12')]?_[_0x9598('0x13')](_0x137ae8[_0x9598('0xe')][_0x9598('0x12')],function(_0x5ee7b0){return{'model':db[_0x5ee7b0[_0x9598('0x14')]],'as':_0x5ee7b0['as'],'attributes':_0x5ee7b0[_0x9598('0x10')],'include':_0x5ee7b0[_0x9598('0x12')]?_[_0x9598('0x13')](_0x5ee7b0['include'],function(_0xa99ae2){return{'model':db[_0xa99ae2[_0x9598('0x14')]],'as':_0xa99ae2['as'],'attributes':_0xa99ae2[_0x9598('0x10')],'include':_0xa99ae2[_0x9598('0x12')]?_[_0x9598('0x13')](_0xa99ae2['include'],function(_0x5125c1){return{'model':db[_0x5125c1['model']],'as':_0x5125c1['as'],'attributes':_0x5125c1[_0x9598('0x10')]};}):[]};}):[]};}):[]:[]})[_0x9598('0x15')](function(_0x368630){logger[_0x9598('0x16')](_0x9598('0xb'),_0x137ae8);logger[_0x9598('0x17')]('GetUser',_0x137ae8,JSON[_0x9598('0x18')](_0x368630));_0x44fdaa(_0x368630);})[_0x9598('0x19')](function(_0x19f8c7){logger[_0x9598('0x1a')](_0x9598('0xb'),_0x19f8c7[_0x9598('0x1b')],_0x137ae8);_0x35a74b(_0x191502['error'](0x1f4,_0x19f8c7[_0x9598('0x1b')]));});});};exports[_0x9598('0x1c')]=function(_0x34c22e){var _0x41de8b=this;return new Promise(function(_0x1e21b2,_0x43c141){return db[_0x9598('0xc')][_0x9598('0x1d')]({'raw':_0x34c22e['options']?_0x34c22e[_0x9598('0xe')][_0x9598('0xd')]===undefined?!![]:![]:!![],'where':_0x34c22e[_0x9598('0xe')]?_0x34c22e[_0x9598('0xe')][_0x9598('0xf')]||null:null,'attributes':_0x34c22e['options']?_0x34c22e[_0x9598('0xe')][_0x9598('0x10')]||null:null,'include':_0x34c22e[_0x9598('0xe')]?_0x34c22e['options'][_0x9598('0x12')]?_[_0x9598('0x13')](_0x34c22e[_0x9598('0xe')][_0x9598('0x12')],function(_0x167173){return{'model':db[_0x167173[_0x9598('0x14')]],'as':_0x167173['as'],'attributes':_0x167173[_0x9598('0x10')],'include':_0x167173[_0x9598('0x12')]?_[_0x9598('0x13')](_0x167173[_0x9598('0x12')],function(_0x168689){return{'model':db[_0x168689[_0x9598('0x14')]],'as':_0x168689['as'],'attributes':_0x168689['attributes'],'include':_0x168689[_0x9598('0x12')]?_['map'](_0x168689['include'],function(_0x3d2a43){return{'model':db[_0x3d2a43[_0x9598('0x14')]],'as':_0x3d2a43['as'],'attributes':_0x3d2a43[_0x9598('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cd645){logger[_0x9598('0x16')](_0x9598('0x1c'),_0x34c22e);logger[_0x9598('0x17')](_0x9598('0x1c'),_0x34c22e,JSON[_0x9598('0x18')](_0x2cd645));_0x1e21b2(_0x2cd645);})['catch'](function(_0x179816){logger['error'](_0x9598('0x1c'),_0x179816[_0x9598('0x1b')],_0x34c22e);_0x43c141(_0x41de8b[_0x9598('0x1a')](0x1f4,_0x179816[_0x9598('0x1b')]));});});};exports[_0x9598('0x1e')]=function(_0x2a264f){var _0x6265b;return db[_0x9598('0xc')][_0x9598('0x1d')]({'where':_0x2a264f['options'][_0x9598('0xf')]||{},'attributes':['id',_0x9598('0x1f'),_0x9598('0x20'),_0x9598('0x21'),_0x9598('0x22')]})['then'](function(_0x3e5fdb){if(!_0x3e5fdb){throw new Error(util[_0x9598('0x23')](_0x9598('0x24'),_0x2a264f[_0x9598('0x25')]['id']));}_0x6265b=_0x3e5fdb;return db[_0x9598('0x26')][_0x9598('0x27')]({'paused':0x1},{'where':{'UserId':_0x6265b['id']},'individualHooks':!![]});})[_0x9598('0x15')](function(){return db[_0x9598('0x28')][_0x9598('0x29')]({'where':{'membername':_0x6265b[_0x9598('0x1f')],'type':_0x9598('0x2a'),'exitAt':null}});})[_0x9598('0x15')](function(_0xdc1bb0){if(_0xdc1bb0&&_0xdc1bb0[_0x9598('0x2b')]){var _0x596f24=moment()['format'](_0x9598('0x2c'));for(var _0x36fd3f=0x0,_0x3c9360=_0xdc1bb0[_0x9598('0x2b')];_0x36fd3f<_0x3c9360;_0x36fd3f++){_0xdc1bb0[_0x36fd3f][_0x9598('0x2d')]({'exitAt':_0x596f24});}}})['then'](function(){var _0x3b939a=[];var _0x2b3a52=utils[_0x9598('0x2e')]();_0x2b3a52[_0x9598('0x2f')](function(_0x2feb84){_0x3b939a[_0x9598('0x30')]({'channel':_0x2feb84,'membername':_0x6265b[_0x9598('0x1f')],'interface':_[_0x9598('0x31')](_0x6265b[_0x9598('0x22')])?util[_0x9598('0x23')](_0x9598('0x32'),_0x6265b['name']):_0x6265b[_0x9598('0x22')],'type':_0x9598('0x2a'),'enterAt':moment()[_0x9598('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2a264f[_0x9598('0x33')][_0x9598('0x34')]||_0x9598('0x35'),'role':_0x6265b['role'],'internal':_0x6265b[_0x9598('0x21')],'uniqueid':_0x2a264f['body'][_0x9598('0x36')]||null});});return db[_0x9598('0x28')][_0x9598('0x37')](_0x3b939a,{'individualHooks':!![]});})['then'](function(){return _0x6265b[_0x9598('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2a264f[_0x9598('0x33')][_0x9598('0x34')]||_0x9598('0x35'),'lastPauseAt':moment()['format'](_0x9598('0x2c'))});})[_0x9598('0x19')](function(_0x2fbed1){throw _0x2fbed1;});};exports[_0x9598('0x38')]=function(_0x4aee33){return Promise[_0x9598('0x39')]()['then'](function(){if(_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')]&&!utils['isValidChannel'](_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')])){throw new Error(util[_0x9598('0x23')](_0x9598('0x3b'),_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')]));}return db[_0x9598('0xc')]['findOne']({'where':_0x4aee33[_0x9598('0xe')][_0x9598('0xf')]||{},'attributes':['id',_0x9598('0x1f'),_0x9598('0x20'),'internal',_0x9598('0x22'),_0x9598('0x3c'),_0x9598('0x3d'),_0x9598('0x3e'),'chatPause','faxPause',_0x9598('0x3f'),'smsPause',_0x9598('0x40'),_0x9598('0x41'),_0x9598('0x42')]});})[_0x9598('0x15')](function(_0x6e76ad){if(!_0x6e76ad){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x4aee33[_0x9598('0x25')]['id']));}return _0x6e76ad['unpause'](_0x4aee33[_0x9598('0x33')][_0x9598('0x3a')],_0x9598('0x43'));})[_0x9598('0x19')](function(_0x4c1f81){throw _0x4c1f81;});};exports[_0x9598('0x44')]=function(_0x4420a6){var _0x3fa235=this;return new Promise(function(_0x49a9ec,_0x49d3c7){var _0x37d10a;return db[_0x9598('0xc')][_0x9598('0x45')]({'where':_0x4420a6[_0x9598('0xe')][_0x9598('0xf')]||{},'attributes':['id','name']})[_0x9598('0x15')](function(_0xd9b551){if(_0xd9b551){_0x37d10a=_0xd9b551;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x37d10a['name']},'individualHooks':!![]});}})[_0x9598('0x15')](function(){if(_0x37d10a){return db[_0x9598('0x28')][_0x9598('0x29')]({'where':{'membername':_0x37d10a[_0x9598('0x1f')],'exitAt':null}});}})['then'](function(_0x5432a8){if(_0x37d10a){if(_0x5432a8&&_0x5432a8['length']){var _0x5bb087=[];_0x5432a8['forEach'](function(_0x450c5a){_0x5bb087[_0x9598('0x30')](_0x450c5a[_0x9598('0x27')]({'exitAt':moment()[_0x9598('0x23')](_0x9598('0x2c'))}));});return BPromise[_0x9598('0x46')](_0x5bb087);}}})[_0x9598('0x15')](function(){if(_0x37d10a){return _0x37d10a[_0x9598('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9598('0x15')](function(_0x5b53e9){_0x49a9ec(_0x5b53e9);})[_0x9598('0x19')](function(_0x302b55){_0x49d3c7(_0x3fa235[_0x9598('0x1a')](0x1f4,_0x302b55['message']));});});};exports['LoginUser']=function(_0x311dc9){var _0xfd4f5a=this;return new Promise(function(_0x44a6ea,_0x4780af){var _0x1de1ac;var _0x29d92f;var _0x280149;var _0xf05d20;return db['User'][_0x9598('0x45')]({'where':_0x311dc9[_0x9598('0xe')][_0x9598('0xf')]||{},'attributes':['id','name',_0x9598('0x20'),_0x9598('0x47'),_0x9598('0x48'),_0x9598('0x21'),_0x9598('0x49'),_0x9598('0x22')]})[_0x9598('0x15')](function(_0xba5193){if(_0xba5193){_0x1de1ac=_0xba5193;_0xf05d20=_0x311dc9[_0x9598('0x33')][_0x9598('0x22')]?_0x311dc9[_0x9598('0x33')][_0x9598('0x22')]:util[_0x9598('0x23')]('SIP/%s',_0x1de1ac[_0x9598('0x1f')]);return db[_0x9598('0xc')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1de1ac['id']}}});}})['then'](function(_0x2623d8){if(_0x2623d8){_0x280149=_0x2623d8;return require(_0x9598('0x4a'))[_0x9598('0x4b')]();}})[_0x9598('0x15')](function(_0xd80508){if(_0xd80508&&_0xd80508[_0x9598('0x4c')]&&_0x280149>=_0xd80508[_0x9598('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x9598('0x15')](function(){if(_0x1de1ac){return db[_0x9598('0x26')]['destroy']({'where':{'membername':_0x1de1ac[_0x9598('0x1f')]},'individualHooks':!![]});}})[_0x9598('0x15')](function(){if(_0x1de1ac){return _0x1de1ac[_0x9598('0x4d')]({'raw':!![]});}})[_0x9598('0x15')](function(_0x35723e){if(_0x1de1ac){if(_0x35723e){var _0xcc292d=[];_0x29d92f=_0x35723e;if(_0x29d92f[_0x9598('0x2b')]){for(var _0x14602a=0x0;_0x14602a<_0x29d92f[_0x9598('0x2b')];_0x14602a++){_0xcc292d['push'](db[_0x9598('0x26')]['upsert']({'membername':_0x1de1ac[_0x9598('0x1f')],'UserId':_0x1de1ac['id'],'queue_name':_0x29d92f[_0x14602a]['name'],'VoiceQueueId':_0x29d92f[_0x14602a]['id'],'interface':_0xf05d20,'paused':_0x1de1ac['loginInPause']||![],'penalty':_0x29d92f[_0x14602a][_0x9598('0x4e')]||0x0}));}return BPromise[_0x9598('0x46')](_0xcc292d);}}}})[_0x9598('0x15')](function(){if(_0x1de1ac){return db[_0x9598('0x28')][_0x9598('0x29')]({'where':{'membername':_0x1de1ac[_0x9598('0x1f')],'exitAt':null}});}})[_0x9598('0x15')](function(_0x3d4900){if(_0x1de1ac){if(_0x3d4900&&_0x3d4900[_0x9598('0x2b')]){var _0x5964c8=[];_0x3d4900['forEach'](function(_0x4fea32){_0x5964c8[_0x9598('0x30')](_0x4fea32[_0x9598('0x27')]({'exitAt':moment()['format'](_0x9598('0x2c'))}));});return BPromise['all'](_0x5964c8);}}})[_0x9598('0x15')](function(){if(_0x1de1ac){var _0x30ee6f=[];var _0x362022=[];var _0x47d19f=utils['getChannels']();var _0x490b83={'membername':_0x1de1ac['name'],'interface':_0xf05d20,'enterAt':moment()[_0x9598('0x23')](_0x9598('0x2c')),'role':_0x1de1ac['role'],'internal':_0x1de1ac[_0x9598('0x21')]};_0x47d19f[_0x9598('0x2f')](function(_0x2bd86d){_0x30ee6f[_0x9598('0x30')](_[_0x9598('0x4f')]({'channel':_0x2bd86d,'type':_0x9598('0x50'),'data1':_0x9598('0x51'),'data2':_0xf05d20},_0x490b83));if(_0x1de1ac['loginInPause']){_0x362022[_0x9598('0x30')](_['merge']({'channel':_0x2bd86d,'type':_0x9598('0x2a'),'data1':'LOGININPAUSE'},_0x490b83));}});return db[_0x9598('0x28')][_0x9598('0x37')](_0x30ee6f['concat'](_0x362022),{'individualHooks':!![]});}})[_0x9598('0x15')](function(){if(_0x1de1ac){return _0x1de1ac[_0x9598('0x27')]({'online':!![],'lastLoginAt':moment()[_0x9598('0x23')](_0x9598('0x2c')),'voicePause':_0x1de1ac[_0x9598('0x49')]||![],'mailPause':_0x1de1ac[_0x9598('0x49')]||![],'chatPause':_0x1de1ac['loginInPause']||![],'faxPause':_0x1de1ac[_0x9598('0x49')]||![],'smsPause':_0x1de1ac[_0x9598('0x49')]||![],'openchannelPause':_0x1de1ac[_0x9598('0x49')]||![],'pauseType':_0x1de1ac[_0x9598('0x49')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x9598('0x23')](_0x9598('0x2c')),'interface':_0xf05d20});}})[_0x9598('0x15')](function(_0x2398c8){_0x44a6ea(_0x2398c8);})[_0x9598('0x19')](function(_0xb46b2f){_0x4780af(_0xfd4f5a[_0x9598('0x1a')](0x1f4,_0xb46b2f[_0x9598('0x1b')]));});});};
\ No newline at end of file
+var _0x5f96=['model','include','then','info','debug','error','message','find','ShowUser','catch','PauseUser','name','role','internal','format','params','UserVoiceQueueRt','update','PAUSE','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','interface','SIP/%s','body','type','uniqueid','MemberReport','bulkCreate','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','channel','findOne','voicePause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','system','LogoutUser','destroy','length','all','LoginUser','loginInPause','count','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','limit','map'];(function(_0x4af8ba,_0x4cca29){var _0x2da810=function(_0x10e302){while(--_0x10e302){_0x4af8ba['push'](_0x4af8ba['shift']());}};_0x2da810(++_0x4cca29);}(_0x5f96,0x94));var _0x65f9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f96[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x65f9('0x0'));var moment=require(_0x65f9('0x1'));var BPromise=require(_0x65f9('0x2'));var Redis=require(_0x65f9('0x3'));var db=require(_0x65f9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65f9('0x5'))('rpc');var config=require(_0x65f9('0x6'));config[_0x65f9('0x7')]=_[_0x65f9('0x8')](config[_0x65f9('0x7')],{'host':_0x65f9('0x9'),'port':0x18eb});var socket=require(_0x65f9('0xa'))(new Redis(config['redis']));require(_0x65f9('0xb'))[_0x65f9('0xc')](socket);exports[_0x65f9('0xd')]=function(_0x37d634){var _0x1df9ba=this;return new Promise(function(_0x4b3115,_0x3f6652){return db[_0x65f9('0xe')][_0x65f9('0xf')]({'raw':_0x37d634[_0x65f9('0x10')]?_0x37d634[_0x65f9('0x10')][_0x65f9('0x11')]===undefined?!![]:![]:!![],'where':_0x37d634[_0x65f9('0x10')]?_0x37d634[_0x65f9('0x10')][_0x65f9('0x12')]||null:null,'attributes':_0x37d634[_0x65f9('0x10')]?_0x37d634[_0x65f9('0x10')][_0x65f9('0x13')]||null:null,'limit':_0x37d634[_0x65f9('0x10')]?_0x37d634[_0x65f9('0x10')][_0x65f9('0x14')]||null:null,'include':_0x37d634['options']?_0x37d634[_0x65f9('0x10')]['include']?_[_0x65f9('0x15')](_0x37d634[_0x65f9('0x10')]['include'],function(_0x5092d5){return{'model':db[_0x5092d5[_0x65f9('0x16')]],'as':_0x5092d5['as'],'attributes':_0x5092d5[_0x65f9('0x13')],'include':_0x5092d5[_0x65f9('0x17')]?_[_0x65f9('0x15')](_0x5092d5[_0x65f9('0x17')],function(_0x33a485){return{'model':db[_0x33a485[_0x65f9('0x16')]],'as':_0x33a485['as'],'attributes':_0x33a485[_0x65f9('0x13')],'include':_0x33a485[_0x65f9('0x17')]?_[_0x65f9('0x15')](_0x33a485[_0x65f9('0x17')],function(_0x4cc33f){return{'model':db[_0x4cc33f[_0x65f9('0x16')]],'as':_0x4cc33f['as'],'attributes':_0x4cc33f[_0x65f9('0x13')]};}):[]};}):[]};}):[]:[]})[_0x65f9('0x18')](function(_0x45f9a1){logger[_0x65f9('0x19')](_0x65f9('0xd'),_0x37d634);logger[_0x65f9('0x1a')](_0x65f9('0xd'),_0x37d634,JSON['stringify'](_0x45f9a1));_0x4b3115(_0x45f9a1);})['catch'](function(_0x350d2f){logger[_0x65f9('0x1b')]('GetUser',_0x350d2f[_0x65f9('0x1c')],_0x37d634);_0x3f6652(_0x1df9ba[_0x65f9('0x1b')](0x1f4,_0x350d2f[_0x65f9('0x1c')]));});});};exports['ShowUser']=function(_0x9dae85){var _0x477536=this;return new Promise(function(_0x2e31c9,_0x30d7cd){return db['User'][_0x65f9('0x1d')]({'raw':_0x9dae85[_0x65f9('0x10')]?_0x9dae85['options'][_0x65f9('0x11')]===undefined?!![]:![]:!![],'where':_0x9dae85['options']?_0x9dae85['options']['where']||null:null,'attributes':_0x9dae85['options']?_0x9dae85[_0x65f9('0x10')][_0x65f9('0x13')]||null:null,'include':_0x9dae85[_0x65f9('0x10')]?_0x9dae85[_0x65f9('0x10')][_0x65f9('0x17')]?_[_0x65f9('0x15')](_0x9dae85['options'][_0x65f9('0x17')],function(_0x7ab44a){return{'model':db[_0x7ab44a[_0x65f9('0x16')]],'as':_0x7ab44a['as'],'attributes':_0x7ab44a[_0x65f9('0x13')],'include':_0x7ab44a[_0x65f9('0x17')]?_['map'](_0x7ab44a[_0x65f9('0x17')],function(_0x4d34c3){return{'model':db[_0x4d34c3[_0x65f9('0x16')]],'as':_0x4d34c3['as'],'attributes':_0x4d34c3[_0x65f9('0x13')],'include':_0x4d34c3[_0x65f9('0x17')]?_[_0x65f9('0x15')](_0x4d34c3[_0x65f9('0x17')],function(_0x139a91){return{'model':db[_0x139a91[_0x65f9('0x16')]],'as':_0x139a91['as'],'attributes':_0x139a91[_0x65f9('0x13')]};}):[]};}):[]};}):[]:[]})[_0x65f9('0x18')](function(_0x414d2d){logger[_0x65f9('0x19')](_0x65f9('0x1e'),_0x9dae85);logger[_0x65f9('0x1a')](_0x65f9('0x1e'),_0x9dae85,JSON['stringify'](_0x414d2d));_0x2e31c9(_0x414d2d);})[_0x65f9('0x1f')](function(_0x17ee2b){logger[_0x65f9('0x1b')](_0x65f9('0x1e'),_0x17ee2b['message'],_0x9dae85);_0x30d7cd(_0x477536['error'](0x1f4,_0x17ee2b[_0x65f9('0x1c')]));});});};exports[_0x65f9('0x20')]=function(_0x21b275){var _0x38532f;return db['User'][_0x65f9('0x1d')]({'where':_0x21b275[_0x65f9('0x10')][_0x65f9('0x12')]||{},'attributes':['id',_0x65f9('0x21'),_0x65f9('0x22'),_0x65f9('0x23'),'interface']})[_0x65f9('0x18')](function(_0x308665){if(!_0x308665){throw new Error(util[_0x65f9('0x24')]('User\x20with\x20id\x20%s\x20not\x20found',_0x21b275[_0x65f9('0x25')]['id']));}_0x38532f=_0x308665;return db[_0x65f9('0x26')][_0x65f9('0x27')]({'paused':0x1},{'where':{'UserId':_0x38532f['id']},'individualHooks':!![]});})[_0x65f9('0x18')](function(){return db['MemberReport'][_0x65f9('0xf')]({'where':{'membername':_0x38532f[_0x65f9('0x21')],'type':_0x65f9('0x28'),'exitAt':null}});})['then'](function(_0x11c4bf){if(_0x11c4bf&&_0x11c4bf['length']){var _0x564ad7=moment()['format'](_0x65f9('0x29'));for(var _0x10989=0x0,_0x256460=_0x11c4bf['length'];_0x10989<_0x256460;_0x10989++){_0x11c4bf[_0x10989][_0x65f9('0x2a')]({'exitAt':_0x564ad7});}}})[_0x65f9('0x18')](function(){var _0x436e29=[];var _0x40eada=utils['getChannels']();_0x40eada[_0x65f9('0x2b')](function(_0x37d480){_0x436e29[_0x65f9('0x2c')]({'channel':_0x37d480,'membername':_0x38532f[_0x65f9('0x21')],'interface':_[_0x65f9('0x2d')](_0x38532f[_0x65f9('0x2e')])?util[_0x65f9('0x24')](_0x65f9('0x2f'),_0x38532f['name']):_0x38532f[_0x65f9('0x2e')],'type':'PAUSE','enterAt':moment()[_0x65f9('0x24')](_0x65f9('0x29')),'data1':_0x21b275[_0x65f9('0x30')][_0x65f9('0x31')]||'DEFAULT\x20PAUSE','role':_0x38532f[_0x65f9('0x22')],'internal':_0x38532f[_0x65f9('0x23')],'uniqueid':_0x21b275[_0x65f9('0x30')][_0x65f9('0x32')]||null});});return db[_0x65f9('0x33')][_0x65f9('0x34')](_0x436e29,{'individualHooks':!![]});})[_0x65f9('0x18')](function(){return _0x38532f[_0x65f9('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x21b275[_0x65f9('0x30')][_0x65f9('0x31')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x65f9('0x24')](_0x65f9('0x29'))});})['catch'](function(_0x315444){throw _0x315444;});};exports['UnpauseUser']=function(_0x397f40){return Promise['resolve']()[_0x65f9('0x18')](function(){if(_0x397f40[_0x65f9('0x30')]['channel']&&!utils[_0x65f9('0x35')](_0x397f40[_0x65f9('0x30')]['channel'])){throw new Error(util[_0x65f9('0x24')](_0x65f9('0x36'),_0x397f40['body'][_0x65f9('0x37')]));}return db[_0x65f9('0xe')][_0x65f9('0x38')]({'where':_0x397f40[_0x65f9('0x10')][_0x65f9('0x12')]||{},'attributes':['id',_0x65f9('0x21'),_0x65f9('0x22'),_0x65f9('0x23'),_0x65f9('0x2e'),'online',_0x65f9('0x39'),'mailPause',_0x65f9('0x3a'),_0x65f9('0x3b'),_0x65f9('0x3c'),_0x65f9('0x3d'),_0x65f9('0x3e'),_0x65f9('0x3f'),_0x65f9('0x40')]});})[_0x65f9('0x18')](function(_0x185b3d){if(!_0x185b3d){throw new Error(util['format'](_0x65f9('0x41'),_0x397f40['params']['id']));}return _0x185b3d['unpause'](_0x397f40[_0x65f9('0x30')][_0x65f9('0x37')],_0x65f9('0x42'));})[_0x65f9('0x1f')](function(_0x4d14d3){throw _0x4d14d3;});};exports[_0x65f9('0x43')]=function(_0x37b8cd){var _0x1d7d2f=this;return new Promise(function(_0x44542f,_0x1dc2c1){var _0x5b43ea;return db[_0x65f9('0xe')]['findOne']({'where':_0x37b8cd[_0x65f9('0x10')][_0x65f9('0x12')]||{},'attributes':['id',_0x65f9('0x21')]})[_0x65f9('0x18')](function(_0x3e1ca1){if(_0x3e1ca1){_0x5b43ea=_0x3e1ca1;return db[_0x65f9('0x26')][_0x65f9('0x44')]({'where':{'membername':_0x5b43ea[_0x65f9('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x5b43ea){return db[_0x65f9('0x33')][_0x65f9('0xf')]({'where':{'membername':_0x5b43ea[_0x65f9('0x21')],'exitAt':null}});}})[_0x65f9('0x18')](function(_0x35fa1d){if(_0x5b43ea){if(_0x35fa1d&&_0x35fa1d[_0x65f9('0x45')]){var _0x4b7381=[];_0x35fa1d[_0x65f9('0x2b')](function(_0xb0534b){_0x4b7381[_0x65f9('0x2c')](_0xb0534b[_0x65f9('0x27')]({'exitAt':moment()[_0x65f9('0x24')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x65f9('0x46')](_0x4b7381);}}})[_0x65f9('0x18')](function(){if(_0x5b43ea){return _0x5b43ea[_0x65f9('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x65f9('0x18')](function(_0x4d701a){_0x44542f(_0x4d701a);})['catch'](function(_0x42f678){_0x1dc2c1(_0x1d7d2f[_0x65f9('0x1b')](0x1f4,_0x42f678['message']));});});};exports[_0x65f9('0x47')]=function(_0x586879){var _0x311f14=this;return new Promise(function(_0x5986c7,_0x6130){var _0x34b05f;var _0x50cbab;var _0x387079;var _0x4d9257;return db['User']['findOne']({'where':_0x586879[_0x65f9('0x10')][_0x65f9('0x12')]||{},'attributes':['id',_0x65f9('0x21'),'role','mobile','phone',_0x65f9('0x23'),_0x65f9('0x48'),_0x65f9('0x2e')]})['then'](function(_0x335d9f){if(_0x335d9f){_0x34b05f=_0x335d9f;_0x4d9257=_0x586879[_0x65f9('0x30')]['interface']?_0x586879[_0x65f9('0x30')]['interface']:util[_0x65f9('0x24')](_0x65f9('0x2f'),_0x34b05f[_0x65f9('0x21')]);return db[_0x65f9('0xe')][_0x65f9('0x49')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x34b05f['id']}}});}})[_0x65f9('0x18')](function(_0xf7a8f7){if(_0xf7a8f7){_0x387079=_0xf7a8f7;return require(_0x65f9('0x4a'))[_0x65f9('0x4b')]();}})[_0x65f9('0x18')](function(_0xe73b61){if(_0xe73b61&&_0xe73b61[_0x65f9('0x4c')]&&_0x387079>=_0xe73b61[_0x65f9('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x65f9('0x18')](function(){if(_0x34b05f){return db[_0x65f9('0x26')][_0x65f9('0x44')]({'where':{'membername':_0x34b05f[_0x65f9('0x21')]},'individualHooks':!![]});}})[_0x65f9('0x18')](function(){if(_0x34b05f){return _0x34b05f[_0x65f9('0x4d')]({'raw':!![]});}})[_0x65f9('0x18')](function(_0x21571d){if(_0x34b05f){if(_0x21571d){var _0x423dbe=[];_0x50cbab=_0x21571d;if(_0x50cbab[_0x65f9('0x45')]){for(var _0x40a44a=0x0;_0x40a44a<_0x50cbab[_0x65f9('0x45')];_0x40a44a++){_0x423dbe[_0x65f9('0x2c')](db[_0x65f9('0x26')][_0x65f9('0x4e')]({'membername':_0x34b05f[_0x65f9('0x21')],'UserId':_0x34b05f['id'],'queue_name':_0x50cbab[_0x40a44a][_0x65f9('0x21')],'VoiceQueueId':_0x50cbab[_0x40a44a]['id'],'interface':_0x4d9257,'paused':_0x34b05f['loginInPause']||![],'penalty':_0x50cbab[_0x40a44a][_0x65f9('0x4f')]||0x0}));}return BPromise['all'](_0x423dbe);}}}})[_0x65f9('0x18')](function(){if(_0x34b05f){return db[_0x65f9('0x33')]['findAll']({'where':{'membername':_0x34b05f['name'],'exitAt':null}});}})[_0x65f9('0x18')](function(_0x1f76eb){if(_0x34b05f){if(_0x1f76eb&&_0x1f76eb['length']){var _0x407a72=[];_0x1f76eb['forEach'](function(_0x5322fc){_0x407a72[_0x65f9('0x2c')](_0x5322fc[_0x65f9('0x27')]({'exitAt':moment()['format'](_0x65f9('0x29'))}));});return BPromise[_0x65f9('0x46')](_0x407a72);}}})[_0x65f9('0x18')](function(){if(_0x34b05f){var _0x2dc00e=[];var _0x3bc0e7=[];var _0x10756e=utils[_0x65f9('0x50')]();var _0x3a62ec={'membername':_0x34b05f[_0x65f9('0x21')],'interface':_0x4d9257,'enterAt':moment()[_0x65f9('0x24')](_0x65f9('0x29')),'role':_0x34b05f[_0x65f9('0x22')],'internal':_0x34b05f[_0x65f9('0x23')]};_0x10756e[_0x65f9('0x2b')](function(_0x5c4042){_0x2dc00e[_0x65f9('0x2c')](_[_0x65f9('0x51')]({'channel':_0x5c4042,'type':_0x65f9('0x52'),'data1':_0x65f9('0x53'),'data2':_0x4d9257},_0x3a62ec));if(_0x34b05f[_0x65f9('0x48')]){_0x3bc0e7[_0x65f9('0x2c')](_[_0x65f9('0x51')]({'channel':_0x5c4042,'type':_0x65f9('0x28'),'data1':_0x65f9('0x54')},_0x3a62ec));}});return db['MemberReport'][_0x65f9('0x34')](_0x2dc00e['concat'](_0x3bc0e7),{'individualHooks':!![]});}})[_0x65f9('0x18')](function(){if(_0x34b05f){return _0x34b05f[_0x65f9('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0x65f9('0x29')),'voicePause':_0x34b05f[_0x65f9('0x48')]||![],'mailPause':_0x34b05f[_0x65f9('0x48')]||![],'chatPause':_0x34b05f['loginInPause']||![],'faxPause':_0x34b05f[_0x65f9('0x48')]||![],'smsPause':_0x34b05f[_0x65f9('0x48')]||![],'openchannelPause':_0x34b05f[_0x65f9('0x48')]||![],'pauseType':_0x34b05f[_0x65f9('0x48')]?_0x65f9('0x54'):null,'lastPauseAt':moment()[_0x65f9('0x24')](_0x65f9('0x29')),'interface':_0x4d9257});}})[_0x65f9('0x18')](function(_0x4366b0){_0x5986c7(_0x4366b0);})[_0x65f9('0x1f')](function(_0x174097){_0x6130(_0x311f14[_0x65f9('0x1b')](0x1f4,_0x174097[_0x65f9('0x1c')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x61ac=['length','./user.events','remove','update','emit','register'];(function(_0x2f8fe8,_0x45e040){var _0x572e2e=function(_0x3631ae){while(--_0x3631ae){_0x2f8fe8['push'](_0x2f8fe8['shift']());}};_0x572e2e(++_0x45e040);}(_0x61ac,0x13f));var _0xc61a=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x61ac[_0x1bc762];return _0x40f70c;};'use strict';var UserEvents=require(_0xc61a('0x0'));var events=['save',_0xc61a('0x1'),_0xc61a('0x2')];function createListener(_0xa9d05e,_0x4f10e5){return function(_0x58f722){_0x4f10e5[_0xc61a('0x3')](_0xa9d05e,_0x58f722);};}function removeListener(_0x38799f,_0x3ff5fa){return function(){UserEvents['removeListener'](_0x38799f,_0x3ff5fa);};}exports[_0xc61a('0x4')]=function(_0x48e48e){for(var _0x58ae7e=0x0,_0x4ba0b4=events[_0xc61a('0x5')];_0x58ae7e<_0x4ba0b4;_0x58ae7e++){var _0x3e3c66=events[_0x58ae7e];var _0x46fb0d=createListener('user:'+_0x3e3c66,_0x48e48e);UserEvents['on'](_0x3e3c66,_0x46fb0d);}};
\ No newline at end of file
+var _0xe035=['emit','register','length','user:','./user.events','save','remove','update'];(function(_0xc55b80,_0x470f8b){var _0x1c5397=function(_0x20ab8e){while(--_0x20ab8e){_0xc55b80['push'](_0xc55b80['shift']());}};_0x1c5397(++_0x470f8b);}(_0xe035,0x1ac));var _0x5e03=function(_0xa78894,_0x35b156){_0xa78894=_0xa78894-0x0;var _0x3503c3=_0xe035[_0xa78894];return _0x3503c3;};'use strict';var UserEvents=require(_0x5e03('0x0'));var events=[_0x5e03('0x1'),_0x5e03('0x2'),_0x5e03('0x3')];function createListener(_0x52bdbf,_0x366dc5){return function(_0x374685){_0x366dc5[_0x5e03('0x4')](_0x52bdbf,_0x374685);};}function removeListener(_0x17bf42,_0x5529c1){return function(){UserEvents['removeListener'](_0x17bf42,_0x5529c1);};}exports[_0x5e03('0x5')]=function(_0x201d3b){for(var _0x100e78=0x0,_0x5ec6aa=events[_0x5e03('0x6')];_0x100e78<_0x5ec6aa;_0x100e78++){var _0x574b6b=events[_0x100e78];var _0x39d595=createListener(_0x5e03('0x7')+_0x574b6b,_0x201d3b);UserEvents['on'](_0x574b6b,_0x39d595);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x353a35,_0x19579e){var _0x2cec7d=function(_0x4c950e){while(--_0x4c950e){_0x353a35['push'](_0x353a35['shift']());}};_0x2cec7d(++_0x19579e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x43c1be,_0x40d38f){var _0x2b9ba3=function(_0x25bbfa){while(--_0x25bbfa){_0x43c1be['push'](_0x43c1be['shift']());}};_0x2b9ba3(++_0x40d38f);}(_0xedd9,0xfc));var _0x9edd=function(_0x130a7a,_0x3bee32){_0x130a7a=_0x130a7a-0x0;var _0x575162=_0xedd9[_0x130a7a];return _0x575162;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0162=['INTEGER','sequelize','exports'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x0162,0x184));var _0x2016=function(_0x4c01a1,_0x1b1c2d){_0x4c01a1=_0x4c01a1-0x0;var _0x40ca1b=_0x0162[_0x4c01a1];return _0x40ca1b;};'use strict';var Sequelize=require(_0x2016('0x0'));module[_0x2016('0x1')]={'penalty':{'type':Sequelize[_0x2016('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x907a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x3e4f60,_0x17820f){var _0x1df1a3=function(_0x513121){while(--_0x513121){_0x3e4f60['push'](_0x3e4f60['shift']());}};_0x1df1a3(++_0x17820f);}(_0x907a,0xb6));var _0xa907=function(_0x40eab3,_0x189042){_0x40eab3=_0x40eab3-0x0;var _0x2e61a1=_0x907a[_0x40eab3];return _0x2e61a1;};'use strict';var _=require('lodash');var util=require(_0xa907('0x0'));var logger=require(_0xa907('0x1'))(_0xa907('0x2'));var moment=require('moment');var BPromise=require(_0xa907('0x3'));var rp=require(_0xa907('0x4'));var fs=require('fs');var path=require(_0xa907('0x5'));var rimraf=require(_0xa907('0x6'));var config=require(_0xa907('0x7'));var attributes=require(_0xa907('0x8'));module[_0xa907('0x9')]=function(_0x49ff13,_0x5a0778){return _0x49ff13[_0xa907('0xa')](_0xa907('0xb'),attributes,{'tableName':_0xa907('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7573=['../../config/logger','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x2b288c,_0x492e8a){var _0x22b762=function(_0x5836b8){while(--_0x5836b8){_0x2b288c['push'](_0x2b288c['shift']());}};_0x22b762(++_0x492e8a);}(_0x7573,0xd0));var _0x3757=function(_0x42380c,_0x44199d){_0x42380c=_0x42380c-0x0;var _0x4c633e=_0x7573[_0x42380c];return _0x4c633e;};'use strict';var _=require(_0x3757('0x0'));var util=require(_0x3757('0x1'));var logger=require(_0x3757('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3757('0x3'));var rimraf=require('rimraf');var config=require(_0x3757('0x4'));var attributes=require(_0x3757('0x5'));module[_0x3757('0x6')]=function(_0x30e6da,_0x3c97f1){return _0x30e6da[_0x3757('0x7')](_0x3757('0x8'),attributes,{'tableName':_0x3757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24ca=['../../config/environment','jayson/promise','client','then','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x24ca,0x157));var _0xa24c=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x24ca[_0x305c31];return _0x17f39f;};'use strict';var _=require(_0xa24c('0x0'));var util=require(_0xa24c('0x1'));var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var rs=require(_0xa24c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x5'))['db'];var utils=require(_0xa24c('0x6'));var logger=require(_0xa24c('0x7'))(_0xa24c('0x8'));var config=require(_0xa24c('0x9'));var jayson=require(_0xa24c('0xa'));var client=jayson[_0xa24c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x505148,_0x8f9c1a,_0x507de1){return new BPromise(function(_0x552811,_0x47524f){return client['request'](_0x505148,_0x507de1)[_0xa24c('0xc')](function(_0x161186){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x8f9c1a,'request\x20sent');logger['debug'](_0xa24c('0xd'),_0x8f9c1a,_0xa24c('0xe'),JSON[_0xa24c('0xf')](_0x161186));if(_0x161186['error']){if(_0x161186[_0xa24c('0x10')][_0xa24c('0x11')]===0x1f4){logger['error'](_0xa24c('0x12'),_0x8f9c1a,_0x161186['error'][_0xa24c('0x13')]);return _0x47524f(_0x161186['error'][_0xa24c('0x13')]);}logger[_0xa24c('0x10')](_0xa24c('0x12'),_0x8f9c1a,_0x161186[_0xa24c('0x10')][_0xa24c('0x13')]);return _0x552811(_0x161186['error']['message']);}else{logger['info'](_0xa24c('0x12'),_0x8f9c1a,_0xa24c('0xe'));_0x552811(_0x161186[_0xa24c('0x14')][_0xa24c('0x13')]);}})[_0xa24c('0x15')](function(_0x38965e){logger[_0xa24c('0x10')](_0xa24c('0x12'),_0x8f9c1a,_0x38965e);_0x47524f(_0x38965e);});});}
\ No newline at end of file
+var _0xee5b=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x5b83b3,_0xb20f45){var _0x310348=function(_0xe649f5){while(--_0xe649f5){_0x5b83b3['push'](_0x5b83b3['shift']());}};_0x310348(++_0xb20f45);}(_0xee5b,0x164));var _0xbee5=function(_0x1816eb,_0x2f229a){_0x1816eb=_0x1816eb-0x0;var _0x3a56d5=_0xee5b[_0x1816eb];return _0x3a56d5;};'use strict';var _=require('lodash');var util=require(_0xbee5('0x0'));var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require(_0xbee5('0x3'));var fs=require('fs');var Redis=require(_0xbee5('0x4'));var db=require(_0xbee5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbee5('0x6'))(_0xbee5('0x7'));var config=require(_0xbee5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbee5('0x9')][_0xbee5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1492f5,_0x22101b,_0x4cbb25){return new BPromise(function(_0xacf97,_0x13c139){return client[_0xbee5('0xb')](_0x1492f5,_0x4cbb25)[_0xbee5('0xc')](function(_0x56ff06){logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x22101b,_0xbee5('0xf'));logger[_0xbee5('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x22101b,_0xbee5('0xf'),JSON['stringify'](_0x56ff06));if(_0x56ff06['error']){if(_0x56ff06[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger['error'](_0xbee5('0xe'),_0x22101b,_0x56ff06[_0xbee5('0x11')][_0xbee5('0x13')]);return _0x13c139(_0x56ff06['error']['message']);}logger[_0xbee5('0x11')](_0xbee5('0xe'),_0x22101b,_0x56ff06[_0xbee5('0x11')][_0xbee5('0x13')]);return _0xacf97(_0x56ff06[_0xbee5('0x11')][_0xbee5('0x13')]);}else{logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x22101b,_0xbee5('0xf'));_0xacf97(_0x56ff06[_0xbee5('0x14')][_0xbee5('0x13')]);}})[_0xbee5('0x15')](function(_0x5b8940){logger[_0xbee5('0x11')](_0xbee5('0xe'),_0x22101b,_0x5b8940);_0x13c139(_0x5b8940);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2c40c9,_0xad237e){var _0xa090d3=function(_0x447a8e){while(--_0x447a8e){_0x2c40c9['push'](_0x2c40c9['shift']());}};_0xa090d3(++_0xad237e);}(_0x70e0,0x17b));var _0x070e=function(_0x260ce2,_0x21d2da){_0x260ce2=_0x260ce2-0x0;var _0x217a56=_0x70e0[_0x260ce2];return _0x217a56;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x82eb9c,_0xa186f2){var _0x1c39fa=function(_0x2db294){while(--_0x2db294){_0x82eb9c['push'](_0x82eb9c['shift']());}};_0x1c39fa(++_0xa186f2);}(_0x70e0,0x17b));var _0x070e=function(_0x38a8dd,_0x4a5b40){_0x38a8dd=_0x38a8dd-0x0;var _0x369d7b=_0x70e0[_0x38a8dd];return _0x369d7b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa66=['exports','INTEGER'];(function(_0x4285b7,_0x11f7fb){var _0x8cb0=function(_0x497eb4){while(--_0x497eb4){_0x4285b7['push'](_0x4285b7['shift']());}};_0x8cb0(++_0x11f7fb);}(_0xfa66,0x1b0));var _0x6fa6=function(_0x1e284f,_0x22724b){_0x1e284f=_0x1e284f-0x0;var _0x427fda=_0xfa66[_0x1e284f];return _0x427fda;};'use strict';var Sequelize=require('sequelize');module[_0x6fa6('0x0')]={'penalty':{'type':Sequelize[_0x6fa6('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xba72=['exports','INTEGER','sequelize'];(function(_0x473316,_0x537499){var _0x45bda6=function(_0x32c114){while(--_0x32c114){_0x473316['push'](_0x473316['shift']());}};_0x45bda6(++_0x537499);}(_0xba72,0xb0));var _0x2ba7=function(_0x57c2f6,_0x1ee1bf){_0x57c2f6=_0x57c2f6-0x0;var _0x1cbd95=_0xba72[_0x57c2f6];return _0x1cbd95;};'use strict';var Sequelize=require(_0x2ba7('0x0'));module[_0x2ba7('0x1')]={'penalty':{'type':Sequelize[_0x2ba7('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2ba7('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc929=['./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x262e1a,_0x24a491){var _0x306a9c=function(_0x3e163b){while(--_0x3e163b){_0x262e1a['push'](_0x262e1a['shift']());}};_0x306a9c(++_0x24a491);}(_0xc929,0x10c));var _0x9c92=function(_0x274d66,_0x37ca85){_0x274d66=_0x274d66-0x0;var _0x2b3bbb=_0xc929[_0x274d66];return _0x2b3bbb;};'use strict';var _=require(_0x9c92('0x0'));var util=require('util');var logger=require(_0x9c92('0x1'))('api');var moment=require(_0x9c92('0x2'));var BPromise=require(_0x9c92('0x3'));var rp=require(_0x9c92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c92('0x5'));var config=require(_0x9c92('0x6'));var attributes=require(_0x9c92('0x7'));module[_0x9c92('0x8')]=function(_0x20d191,_0xf8ca58){return _0x20d191[_0x9c92('0x9')]('UserFaxQueue',attributes,{'tableName':_0x9c92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6ba=['request-promise','path','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','../../config/logger','moment','bluebird'];(function(_0x4a3209,_0x185d25){var _0x1c2991=function(_0x790f36){while(--_0x790f36){_0x4a3209['push'](_0x4a3209['shift']());}};_0x1c2991(++_0x185d25);}(_0xc6ba,0x7e));var _0xac6b=function(_0x484db2,_0x55fed4){_0x484db2=_0x484db2-0x0;var _0x9d55e2=_0xc6ba[_0x484db2];return _0x9d55e2;};'use strict';var _=require(_0xac6b('0x0'));var util=require('util');var logger=require(_0xac6b('0x1'))('api');var moment=require(_0xac6b('0x2'));var BPromise=require(_0xac6b('0x3'));var rp=require(_0xac6b('0x4'));var fs=require('fs');var path=require(_0xac6b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xac6b('0x6'));module[_0xac6b('0x7')]=function(_0x261d5b,_0x3c9825){return _0x261d5b[_0xac6b('0x8')](_0xac6b('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x59b8=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result'];(function(_0x42c19c,_0x4dc298){var _0x3dee49=function(_0x105760){while(--_0x105760){_0x42c19c['push'](_0x42c19c['shift']());}};_0x3dee49(++_0x4dc298);}(_0x59b8,0x1a4));var _0x859b=function(_0x1cd0ca,_0x109364){_0x1cd0ca=_0x1cd0ca-0x0;var _0x4a2e20=_0x59b8[_0x1cd0ca];return _0x4a2e20;};'use strict';var _=require(_0x859b('0x0'));var util=require(_0x859b('0x1'));var moment=require(_0x859b('0x2'));var BPromise=require('bluebird');var rs=require(_0x859b('0x3'));var fs=require('fs');var Redis=require(_0x859b('0x4'));var db=require(_0x859b('0x5'))['db'];var utils=require(_0x859b('0x6'));var logger=require(_0x859b('0x7'))(_0x859b('0x8'));var config=require(_0x859b('0x9'));var jayson=require(_0x859b('0xa'));var client=jayson['client'][_0x859b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc581c5,_0xd80f2e,_0x53b0e8){return new BPromise(function(_0x3e0c23,_0x12afdf){return client[_0x859b('0xc')](_0xc581c5,_0x53b0e8)[_0x859b('0xd')](function(_0x308ba0){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0xd80f2e,_0x859b('0xe'));logger[_0x859b('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xd80f2e,_0x859b('0xe'),JSON[_0x859b('0x10')](_0x308ba0));if(_0x308ba0[_0x859b('0x11')]){if(_0x308ba0[_0x859b('0x11')]['code']===0x1f4){logger[_0x859b('0x11')](_0x859b('0x12'),_0xd80f2e,_0x308ba0[_0x859b('0x11')][_0x859b('0x13')]);return _0x12afdf(_0x308ba0['error'][_0x859b('0x13')]);}logger[_0x859b('0x11')](_0x859b('0x12'),_0xd80f2e,_0x308ba0[_0x859b('0x11')][_0x859b('0x13')]);return _0x3e0c23(_0x308ba0[_0x859b('0x11')][_0x859b('0x13')]);}else{logger['info'](_0x859b('0x12'),_0xd80f2e,_0x859b('0xe'));_0x3e0c23(_0x308ba0[_0x859b('0x14')][_0x859b('0x13')]);}})['catch'](function(_0xef8e32){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xd80f2e,_0xef8e32);_0x12afdf(_0xef8e32);});});}
\ No newline at end of file
+var _0x064f=['client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x568e97,_0x3e148f){var _0x4b99fc=function(_0x241228){while(--_0x241228){_0x568e97['push'](_0x568e97['shift']());}};_0x4b99fc(++_0x3e148f);}(_0x064f,0x188));var _0xf064=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x064f[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0xf064('0x0'));var moment=require('moment');var BPromise=require(_0xf064('0x1'));var rs=require(_0xf064('0x2'));var fs=require('fs');var Redis=require(_0xf064('0x3'));var db=require(_0xf064('0x4'))['db'];var utils=require(_0xf064('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf064('0x6'));var client=jayson[_0xf064('0x7')][_0xf064('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f9,_0x37c579,_0x49192c){return new BPromise(function(_0x596312,_0x4d61b9){return client['request'](_0x24f2f9,_0x49192c)[_0xf064('0x9')](function(_0x4a8a96){logger[_0xf064('0xa')](_0xf064('0xb'),_0x37c579,'request\x20sent');logger[_0xf064('0xc')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x37c579,_0xf064('0xd'),JSON[_0xf064('0xe')](_0x4a8a96));if(_0x4a8a96[_0xf064('0xf')]){if(_0x4a8a96[_0xf064('0xf')][_0xf064('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x37c579,_0x4a8a96[_0xf064('0xf')]['message']);return _0x4d61b9(_0x4a8a96[_0xf064('0xf')][_0xf064('0x11')]);}logger[_0xf064('0xf')](_0xf064('0xb'),_0x37c579,_0x4a8a96[_0xf064('0xf')][_0xf064('0x11')]);return _0x596312(_0x4a8a96[_0xf064('0xf')]['message']);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x37c579,'request\x20sent');_0x596312(_0x4a8a96['result'][_0xf064('0x11')]);}})[_0xf064('0x12')](function(_0x212a6c){logger['error'](_0xf064('0xb'),_0x37c579,_0x212a6c);_0x4d61b9(_0x212a6c);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1df9f9,_0x5e70b4){var _0x2fe038=function(_0xe1763a){while(--_0xe1763a){_0x1df9f9['push'](_0x1df9f9['shift']());}};_0x2fe038(++_0x5e70b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4d05f8,_0x3efc70){var _0x220513=function(_0x3058aa){while(--_0x3058aa){_0x4d05f8['push'](_0x4d05f8['shift']());}};_0x220513(++_0x3efc70);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45c5=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x45c5,0x11c));var _0x545c=function(_0x8a8005,_0x2462e5){_0x8a8005=_0x8a8005-0x0;var _0x5e52f9=_0x45c5[_0x8a8005];return _0x5e52f9;};'use strict';var Sequelize=require(_0x545c('0x0'));module[_0x545c('0x1')]={'penalty':{'type':Sequelize[_0x545c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0c10=['exports','INTEGER','sequelize'];(function(_0x44ca87,_0x4f570a){var _0x43728c=function(_0x3dfc3d){while(--_0x3dfc3d){_0x44ca87['push'](_0x44ca87['shift']());}};_0x43728c(++_0x4f570a);}(_0x0c10,0x13a));var _0x00c1=function(_0x36fc7b,_0x1a4c4b){_0x36fc7b=_0x36fc7b-0x0;var _0x20b70f=_0x0c10[_0x36fc7b];return _0x20b70f;};'use strict';var Sequelize=require(_0x00c1('0x0'));module[_0x00c1('0x1')]={'penalty':{'type':Sequelize[_0x00c1('0x2')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c4d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','lodash'];(function(_0x15f236,_0x59a12b){var _0x3645c0=function(_0x574879){while(--_0x574879){_0x15f236['push'](_0x15f236['shift']());}};_0x3645c0(++_0x59a12b);}(_0x0c4d,0x18b));var _0xd0c4=function(_0x4fe95c,_0x53ed9e){_0x4fe95c=_0x4fe95c-0x0;var _0x125778=_0x0c4d[_0x4fe95c];return _0x125778;};'use strict';var _=require(_0xd0c4('0x0'));var util=require(_0xd0c4('0x1'));var logger=require(_0xd0c4('0x2'))('api');var moment=require(_0xd0c4('0x3'));var BPromise=require(_0xd0c4('0x4'));var rp=require(_0xd0c4('0x5'));var fs=require('fs');var path=require(_0xd0c4('0x6'));var rimraf=require(_0xd0c4('0x7'));var config=require('../../config/environment');var attributes=require(_0xd0c4('0x8'));module['exports']=function(_0x41b23a,_0x492cb9){return _0x41b23a['define']('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76c0=['rimraf','./userMailQueue.attributes','user_has_mail_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x20ed42,_0x54e97b){var _0x4bd98c=function(_0x3ff598){while(--_0x3ff598){_0x20ed42['push'](_0x20ed42['shift']());}};_0x4bd98c(++_0x54e97b);}(_0x76c0,0x1e0));var _0x076c=function(_0x322eb7,_0x42c39e){_0x322eb7=_0x322eb7-0x0;var _0x272472=_0x76c0[_0x322eb7];return _0x272472;};'use strict';var _=require(_0x076c('0x0'));var util=require(_0x076c('0x1'));var logger=require(_0x076c('0x2'))(_0x076c('0x3'));var moment=require(_0x076c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x076c('0x5'));var rimraf=require(_0x076c('0x6'));var config=require('../../config/environment');var attributes=require(_0x076c('0x7'));module['exports']=function(_0x57765,_0x32a095){return _0x57765['define']('UserMailQueue',attributes,{'tableName':_0x076c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x49319a,_0x1059cf){var _0x42c021=function(_0x33e735){while(--_0x33e735){_0x49319a['push'](_0x49319a['shift']());}};_0x42c021(++_0x1059cf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
+var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2bd0d3,_0x5e6f2f){var _0x49da50=function(_0xe3535e){while(--_0xe3535e){_0x2bd0d3['push'](_0x2bd0d3['shift']());}};_0x49da50(++_0x5e6f2f);}(_0x3e74,0x175));var _0x43e7=function(_0x43b476,_0x1f79c8){_0x43b476=_0x43b476-0x0;var _0x4069bb=_0x3e74[_0x43b476];return _0x4069bb;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0842=['../../components/auth/service','../../components/interaction/service','post','sendUserNotification','multer','util','path','connect-timeout','Router'];(function(_0x52a9af,_0x55fde4){var _0x46b772=function(_0x2347b7){while(--_0x2347b7){_0x52a9af['push'](_0x52a9af['shift']());}};_0x46b772(++_0x55fde4);}(_0x0842,0x1a2));var _0x2084=function(_0x1262ab,_0xab8c7a){_0x1262ab=_0x1262ab-0x0;var _0x206d24=_0x0842[_0x1262ab];return _0x206d24;};'use strict';var multer=require(_0x2084('0x0'));var util=require(_0x2084('0x1'));var path=require(_0x2084('0x2'));var timeout=require(_0x2084('0x3'));var express=require('express');var router=express[_0x2084('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2084('0x5'));var interaction=require(_0x2084('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x2084('0x7')]('/',auth['isAuthenticated'](),controller[_0x2084('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x4c4d=['Router','fs-extra','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','path','connect-timeout','express'];(function(_0x467739,_0x35e9dd){var _0x17e4df=function(_0x27dc4a){while(--_0x27dc4a){_0x467739['push'](_0x467739['shift']());}};_0x17e4df(++_0x35e9dd);}(_0x4c4d,0x140));var _0xd4c4=function(_0x30b93e,_0x469575){_0x30b93e=_0x30b93e-0x0;var _0x37ad85=_0x4c4d[_0x30b93e];return _0x37ad85;};'use strict';var multer=require(_0xd4c4('0x0'));var util=require('util');var path=require(_0xd4c4('0x1'));var timeout=require(_0xd4c4('0x2'));var express=require(_0xd4c4('0x3'));var router=express[_0xd4c4('0x4')]();var fs_extra=require(_0xd4c4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xd4c4('0x7'));router[_0xd4c4('0x8')]('/',auth[_0xd4c4('0x9')](),controller[_0xd4c4('0xa')]);module[_0xd4c4('0xb')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe778=['exports','TEXT','STRING'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xe778,0xfc));var _0x8e77=function(_0x30c3e7,_0x5c1995){_0x30c3e7=_0x30c3e7-0x0;var _0x45cc9e=_0xe778[_0x30c3e7];return _0x45cc9e;};'use strict';var Sequelize=require('sequelize');module[_0x8e77('0x0')]={'body':{'type':Sequelize[_0x8e77('0x1')]},'senderName':{'type':Sequelize[_0x8e77('0x2')]},'recipientsId':{'type':Sequelize[_0x8e77('0x1')]},'recipientsDescription':{'type':Sequelize[_0x8e77('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
+var _0x18b2=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x41ec44,_0x8b28c6){var _0x3da0ea=function(_0x10a335){while(--_0x10a335){_0x41ec44['push'](_0x41ec44['shift']());}};_0x3da0ea(++_0x8b28c6);}(_0x18b2,0x85));var _0x218b=function(_0x4536f9,_0x4109e6){_0x4536f9=_0x4536f9-0x0;var _0x381e9d=_0x18b2[_0x4536f9];return _0x381e9d;};'use strict';var Sequelize=require(_0x218b('0x0'));module['exports']={'body':{'type':Sequelize[_0x218b('0x1')]},'senderName':{'type':Sequelize[_0x218b('0x2')]},'recipientsId':{'type':Sequelize[_0x218b('0x1')]},'recipientsDescription':{'type':Sequelize[_0x218b('0x2')]},'beep':{'type':Sequelize[_0x218b('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8763=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','some','includes','toLowerCase','senderName','user','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','model','User','ids','replace','queue','all','getAgents','map'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x8763,0x68));var _0x3876=function(_0x2c5aa0,_0x5cb545){_0x2c5aa0=_0x2c5aa0-0x0;var _0x2b63d5=_0x8763[_0x2c5aa0];return _0x2b63d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3876('0x0'));var zipdir=require(_0x3876('0x1'));var jsonpatch=require(_0x3876('0x2'));var rp=require(_0x3876('0x3'));var moment=require(_0x3876('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3876('0x5'));var util=require(_0x3876('0x6'));var path=require(_0x3876('0x7'));var sox=require(_0x3876('0x8'));var csv=require(_0x3876('0x9'));var ejs=require(_0x3876('0xa'));var fs=require('fs');var fs_extra=require(_0x3876('0xb'));var _=require(_0x3876('0xc'));var squel=require(_0x3876('0xd'));var crypto=require(_0x3876('0xe'));var jsforce=require(_0x3876('0xf'));var deskjs=require(_0x3876('0x10'));var toCsv=require(_0x3876('0x9'));var querystring=require(_0x3876('0x11'));var Papa=require('papaparse');var Redis=require(_0x3876('0x12'));var authService=require(_0x3876('0x13'));var qs=require(_0x3876('0x14'));var as=require(_0x3876('0x15'));var hardwareService=require(_0x3876('0x16'));var logger=require(_0x3876('0x17'))(_0x3876('0x18'));var utils=require(_0x3876('0x19'));var config=require(_0x3876('0x1a'));var licenseUtil=require(_0x3876('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3876('0x1c')](config['redis'],{'host':_0x3876('0x1d'),'port':0x18eb});var socket=require(_0x3876('0x1e'))(new Redis(config[_0x3876('0x1f')]));require(_0x3876('0x20'))[_0x3876('0x21')](socket);function respondWithStatusCode(_0x53ce93,_0x5c0110){_0x5c0110=_0x5c0110||0xcc;return function(_0x29c1b7){if(_0x29c1b7){return _0x53ce93[_0x3876('0x22')](_0x5c0110);}return _0x53ce93[_0x3876('0x23')](_0x5c0110)[_0x3876('0x24')]();};}function respondWithResult(_0xc08f1f,_0x5c875){_0x5c875=_0x5c875||0xc8;return function(_0x2c6037){if(_0x2c6037){return _0xc08f1f[_0x3876('0x23')](_0x5c875)[_0x3876('0x25')](_0x2c6037);}};}function respondWithFilteredResult(_0x529def,_0x5f4e93){return function(_0x58cde8){if(_0x58cde8){var _0x2d580e=typeof _0x5f4e93['offset']===_0x3876('0x26')&&typeof _0x5f4e93[_0x3876('0x27')]===_0x3876('0x26');var _0x43c611=_0x58cde8[_0x3876('0x28')];var _0x2d8b3a=_0x2d580e?0x0:_0x5f4e93[_0x3876('0x29')];var _0x5197cb=_0x2d580e?_0x58cde8['count']:_0x5f4e93[_0x3876('0x29')]+_0x5f4e93['limit'];var _0x599ea4;if(_0x5197cb>=_0x43c611){_0x5197cb=_0x43c611;_0x599ea4=0xc8;}else{_0x599ea4=0xce;}_0x529def[_0x3876('0x23')](_0x599ea4);return _0x529def[_0x3876('0x2a')](_0x3876('0x2b'),_0x2d8b3a+'-'+_0x5197cb+'/'+_0x43c611)[_0x3876('0x25')](_0x58cde8);}return null;};}function patchUpdates(_0x3e71ce){return function(_0x38d3eb){try{jsonpatch[_0x3876('0x2c')](_0x38d3eb,_0x3e71ce,!![]);}catch(_0x489eba){return BPromise[_0x3876('0x2d')](_0x489eba);}return _0x38d3eb[_0x3876('0x2e')]();};}function saveUpdates(_0x2da467,_0x3c5c99){return function(_0x39907a){if(_0x39907a){return _0x39907a[_0x3876('0x2f')](_0x2da467)[_0x3876('0x30')](function(_0x3b26d7){return _0x3b26d7;});}return null;};}function removeEntity(_0x9c4083,_0x1f9a43){return function(_0x55c64c){if(_0x55c64c){return _0x55c64c['destroy']()[_0x3876('0x30')](function(){_0x9c4083[_0x3876('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e89f0,_0x2ac17b){return function(_0x3bf35d){if(!_0x3bf35d){_0x3e89f0[_0x3876('0x22')](0x194);}return _0x3bf35d;};}function handleError(_0x5e847a,_0x1d5ec6){_0x1d5ec6=_0x1d5ec6||0x1f4;return function(_0x3bfd0e){logger[_0x3876('0x31')](_0x3bfd0e[_0x3876('0x32')]);if(_0x3bfd0e['name']){delete _0x3bfd0e[_0x3876('0x33')];}_0x5e847a[_0x3876('0x23')](_0x1d5ec6)['send'](_0x3bfd0e);};}exports[_0x3876('0x34')]=function(_0x119a97,_0x4b1ffe,_0x35202b){if(!_0x119a97[_0x3876('0x35')][_0x3876('0x36')](_0x3876('0x37'))&&!_0x119a97[_0x3876('0x35')][_0x3876('0x36')](_0x3876('0x38'))){throw new db[(_0x3876('0x39'))][(_0x3876('0x3a'))](_0x3876('0x3b'));}else{if(_0x119a97[_0x3876('0x35')][_0x3876('0x36')](_0x3876('0x38'))&&!_0x119a97['body'][_0x3876('0x36')](_0x3876('0x3c'))){throw new db[(_0x3876('0x39'))]['ValidationError'](_0x3876('0x3d'));}if(!_0x119a97['body'][_0x3876('0x36')](_0x3876('0x3e'))){throw new db['Sequelize'][(_0x3876('0x3a'))](_0x3876('0x3f'));}else{try{var _0x1bce5d=JSON[_0x3876('0x40')](_0x119a97[_0x3876('0x35')]['recipients']);}catch(_0x4ae438){logger[_0x3876('0x31')](_0x4ae438);throw new db[(_0x3876('0x39'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x11c753=[_0x3876('0x41'),_0x3876('0x42'),_0x3876('0x43'),_0x3876('0x44'),_0x3876('0x45'),'voicequeue','whatsappqueue',_0x3876('0x46'),'user'];if(_[_0x3876('0x47')](_0x1bce5d,function(_0x56a753){return!_[_0x3876('0x48')](_0x11c753,_0x56a753['model'][_0x3876('0x49')]());})){throw new db['Sequelize']['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x3ea47f={};_0x3ea47f[_0x3876('0x4a')]=_0x119a97[_0x3876('0x35')][_0x3876('0x36')]('senderName')?_0x119a97[_0x3876('0x35')]['senderName']:_0x119a97[_0x3876('0x4b')][_0x3876('0x4c')];_0x3ea47f[_0x3876('0x4d')]=_[_0x3876('0x4e')](_0x119a97[_0x3876('0x35')]['recipientsDescription'])?null:_0x119a97[_0x3876('0x35')][_0x3876('0x4d')];_0x3ea47f[_0x3876('0x4f')]=_0x119a97['body'][_0x3876('0x4f')]||![];_0x3ea47f['SenderId']=_0x119a97['user']['id'];return getContent(_0x119a97['body'])[_0x3876('0x30')](function(_0x572144){_0x3ea47f[_0x3876('0x35')]=_0x572144;return getRecipients(_0x1bce5d);})[_0x3876('0x30')](function(_0x1cbee7){_0x3ea47f[_0x3876('0x50')]=_[_0x3876('0x51')](_0x1cbee7)['join'](',');return db[_0x3876('0x52')][_0x3876('0x53')](function(_0x1bcbfe){return db[_0x3876('0x54')][_0x3876('0x55')](_0x3ea47f,{'raw':!![],'transaction':_0x1bcbfe})[_0x3876('0x30')](function(_0x361f1b){var _0x363c51={'sender':_0x3ea47f['senderName'],'description':_0x3ea47f[_0x3876('0x4d')],'content':_0x3ea47f[_0x3876('0x35')],'beep':_0x3ea47f[_0x3876('0x4f')]};_0x1cbee7[_0x3876('0x56')](function(_0x2a6204){_0x363c51['recipient']=_0x2a6204;socket[_0x3876('0x57')](_0x3876('0x58'),_0x363c51);});return _0x361f1b;});});})[_0x3876('0x30')](respondWithResult(_0x4b1ffe,0xc9))[_0x3876('0x59')](handleError(_0x4b1ffe,null));};function getContent(_0x6369de){return new BPromise(function(_0xe6faef,_0x3f7ed9){if(_0x6369de['text']){_0xe6faef(_0x6369de[_0x3876('0x37')]);return;}return db[_0x3876('0x5a')][_0x3876('0x5b')]({'attributes':['html'],'where':{'id':_0x6369de[_0x3876('0x38')]},'raw':!![]})[_0x3876('0x30')](function(_0x1ee6cd){if(!_0x1ee6cd)throw new db['Sequelize'][(_0x3876('0x3a'))](_0x3876('0x5c'));var _0x11794f=Mustache[_0x3876('0x5d')](_0x1ee6cd[_0x3876('0x5e')],_0x6369de[_0x3876('0x3c')]);_0xe6faef(_0x11794f);})[_0x3876('0x59')](function(_0xabc6f7){_0x3f7ed9(_0xabc6f7);});});}function getRecipients(_0x5a20a8){return new BPromise(function(_0x3987c7,_0xc1803a){var _0x3b5e36=[];var _0x228fc9=[];_0x5a20a8[_0x3876('0x56')](function(_0x2e6ca5){var _0x4fc7c3=_[_0x3876('0x5f')](_0x2e6ca5[_0x3876('0x60')]['toLowerCase']());if(_0x4fc7c3===_0x3876('0x61')){_0x3b5e36=_['union'](_0x3b5e36,_0x2e6ca5[_0x3876('0x62')]);}else{if(_['includes'](_0x4fc7c3,'queue'))_0x4fc7c3=_0x4fc7c3[_0x3876('0x63')](_0x3876('0x64'),'Queue');_0x2e6ca5[_0x3876('0x62')]['forEach'](function(_0x3f57bb){_0x228fc9['push'](getAgents(_0x4fc7c3,_0x3f57bb));});}});return BPromise[_0x3876('0x65')](_0x228fc9)[_0x3876('0x30')](function(_0x2097f4){_0x3b5e36=_['union'](_0x3b5e36,_['flatten'](_0x2097f4));_0x3987c7(_0x3b5e36);})[_0x3876('0x59')](function(_0x401e5b){_0xc1803a(_0x401e5b);});});}function getAgents(_0x35e63d,_0x4a272b){return new BPromise(function(_0x14c97c,_0x100694){return db[_0x35e63d][_0x3876('0x5b')]({'where':{'id':_0x4a272b}})[_0x3876('0x30')](function(_0xc2a94){return _0xc2a94[_0x3876('0x66')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e2323){var _0x4453bf=_[_0x3876('0x67')](_0x2e2323,'id');_0x14c97c(_0x4453bf);});})[_0x3876('0x59')](function(_0x3b19a1){_0x100694(_0x3b19a1);});});}
\ No newline at end of file
+var _0x5a93=['Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','faxqueue','team','user','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','User','queue','replace','ids','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./userNotification.socket','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view'];(function(_0x196cae,_0x24a699){var _0x4c2886=function(_0x48a07e){while(--_0x48a07e){_0x196cae['push'](_0x196cae['shift']());}};_0x4c2886(++_0x24a699);}(_0x5a93,0x88));var _0x35a9=function(_0x527499,_0xcab30c){_0x527499=_0x527499-0x0;var _0x2c15ce=_0x5a93[_0x527499];return _0x2c15ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35a9('0x0'));var zipdir=require(_0x35a9('0x1'));var jsonpatch=require(_0x35a9('0x2'));var rp=require(_0x35a9('0x3'));var moment=require(_0x35a9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x35a9('0x5'));var path=require(_0x35a9('0x6'));var sox=require(_0x35a9('0x7'));var csv=require(_0x35a9('0x8'));var ejs=require(_0x35a9('0x9'));var fs=require('fs');var fs_extra=require(_0x35a9('0xa'));var _=require(_0x35a9('0xb'));var squel=require(_0x35a9('0xc'));var crypto=require(_0x35a9('0xd'));var jsforce=require(_0x35a9('0xe'));var deskjs=require(_0x35a9('0xf'));var toCsv=require(_0x35a9('0x8'));var querystring=require(_0x35a9('0x10'));var Papa=require(_0x35a9('0x11'));var Redis=require('ioredis');var authService=require(_0x35a9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35a9('0x13'));var logger=require(_0x35a9('0x14'))(_0x35a9('0x15'));var utils=require(_0x35a9('0x16'));var config=require(_0x35a9('0x17'));var licenseUtil=require(_0x35a9('0x18'));var db=require(_0x35a9('0x19'))['db'];config['redis']=_[_0x35a9('0x1a')](config[_0x35a9('0x1b')],{'host':_0x35a9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35a9('0x1b')]));require(_0x35a9('0x1d'))['register'](socket);function respondWithStatusCode(_0xbc3fb5,_0x178234){_0x178234=_0x178234||0xcc;return function(_0x968258){if(_0x968258){return _0xbc3fb5[_0x35a9('0x1e')](_0x178234);}return _0xbc3fb5[_0x35a9('0x1f')](_0x178234)[_0x35a9('0x20')]();};}function respondWithResult(_0x447144,_0x2572d0){_0x2572d0=_0x2572d0||0xc8;return function(_0x59fe55){if(_0x59fe55){return _0x447144[_0x35a9('0x1f')](_0x2572d0)['json'](_0x59fe55);}};}function respondWithFilteredResult(_0x5e8b47,_0x596f9d){return function(_0x3af462){if(_0x3af462){var _0x248006=typeof _0x596f9d[_0x35a9('0x21')]==='undefined'&&typeof _0x596f9d[_0x35a9('0x22')]===_0x35a9('0x23');var _0x104dbe=_0x3af462[_0x35a9('0x24')];var _0x124d11=_0x248006?0x0:_0x596f9d[_0x35a9('0x21')];var _0x413eab=_0x248006?_0x3af462[_0x35a9('0x24')]:_0x596f9d[_0x35a9('0x21')]+_0x596f9d[_0x35a9('0x22')];var _0x3a9eca;if(_0x413eab>=_0x104dbe){_0x413eab=_0x104dbe;_0x3a9eca=0xc8;}else{_0x3a9eca=0xce;}_0x5e8b47[_0x35a9('0x1f')](_0x3a9eca);return _0x5e8b47['set']('Content-Range',_0x124d11+'-'+_0x413eab+'/'+_0x104dbe)[_0x35a9('0x25')](_0x3af462);}return null;};}function patchUpdates(_0x2062b0){return function(_0x505e0e){try{jsonpatch[_0x35a9('0x26')](_0x505e0e,_0x2062b0,!![]);}catch(_0x3cb246){return BPromise[_0x35a9('0x27')](_0x3cb246);}return _0x505e0e[_0x35a9('0x28')]();};}function saveUpdates(_0x3bffb1,_0x2af9a3){return function(_0x5ecb16){if(_0x5ecb16){return _0x5ecb16['update'](_0x3bffb1)[_0x35a9('0x29')](function(_0x277707){return _0x277707;});}return null;};}function removeEntity(_0x214c0b,_0x161372){return function(_0x1da113){if(_0x1da113){return _0x1da113[_0x35a9('0x2a')]()[_0x35a9('0x29')](function(){_0x214c0b[_0x35a9('0x1f')](0xcc)[_0x35a9('0x20')]();});}};}function handleEntityNotFound(_0x90b33,_0x34b44d){return function(_0x3840bf){if(!_0x3840bf){_0x90b33['sendStatus'](0x194);}return _0x3840bf;};}function handleError(_0x3f81,_0x430aa1){_0x430aa1=_0x430aa1||0x1f4;return function(_0x4e5e4a){logger['error'](_0x4e5e4a[_0x35a9('0x2b')]);if(_0x4e5e4a[_0x35a9('0x2c')]){delete _0x4e5e4a[_0x35a9('0x2c')];}_0x3f81[_0x35a9('0x1f')](_0x430aa1)[_0x35a9('0x2d')](_0x4e5e4a);};}exports[_0x35a9('0x2e')]=function(_0x278aa7,_0x275ba0,_0x5370b1){if(!_0x278aa7[_0x35a9('0x2f')][_0x35a9('0x30')](_0x35a9('0x31'))&&!_0x278aa7[_0x35a9('0x2f')]['hasOwnProperty'](_0x35a9('0x32'))){throw new db['Sequelize'][(_0x35a9('0x33'))](_0x35a9('0x34'));}else{if(_0x278aa7[_0x35a9('0x2f')][_0x35a9('0x30')](_0x35a9('0x32'))&&!_0x278aa7[_0x35a9('0x2f')][_0x35a9('0x30')](_0x35a9('0x35'))){throw new db[(_0x35a9('0x36'))][(_0x35a9('0x33'))](_0x35a9('0x37'));}if(!_0x278aa7['body'][_0x35a9('0x30')](_0x35a9('0x38'))){throw new db['Sequelize'][(_0x35a9('0x33'))](_0x35a9('0x39'));}else{try{var _0x1358f2=JSON[_0x35a9('0x3a')](_0x278aa7['body'][_0x35a9('0x38')]);}catch(_0x4effac){logger['error'](_0x4effac);throw new db[(_0x35a9('0x36'))][(_0x35a9('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x41c9f9=['chatqueue',_0x35a9('0x3b'),'mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue',_0x35a9('0x3c'),_0x35a9('0x3d')];if(_['some'](_0x1358f2,function(_0x51ea06){return!_[_0x35a9('0x3e')](_0x41c9f9,_0x51ea06[_0x35a9('0x3f')][_0x35a9('0x40')]());})){throw new db[(_0x35a9('0x36'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1ef630={};_0x1ef630['senderName']=_0x278aa7[_0x35a9('0x2f')][_0x35a9('0x30')](_0x35a9('0x41'))?_0x278aa7[_0x35a9('0x2f')]['senderName']:_0x278aa7[_0x35a9('0x3d')][_0x35a9('0x42')];_0x1ef630['recipientsDescription']=_[_0x35a9('0x43')](_0x278aa7['body'][_0x35a9('0x44')])?null:_0x278aa7['body'][_0x35a9('0x44')];_0x1ef630[_0x35a9('0x45')]=_0x278aa7[_0x35a9('0x2f')][_0x35a9('0x45')]||![];_0x1ef630[_0x35a9('0x46')]=_0x278aa7[_0x35a9('0x3d')]['id'];return getContent(_0x278aa7[_0x35a9('0x2f')])[_0x35a9('0x29')](function(_0x2ce6d4){_0x1ef630[_0x35a9('0x2f')]=_0x2ce6d4;return getRecipients(_0x1358f2);})[_0x35a9('0x29')](function(_0x425ae7){_0x1ef630[_0x35a9('0x47')]=_[_0x35a9('0x48')](_0x425ae7)[_0x35a9('0x49')](',');return db[_0x35a9('0x4a')]['transaction'](function(_0x4997e8){return db[_0x35a9('0x4b')]['create'](_0x1ef630,{'raw':!![],'transaction':_0x4997e8})['then'](function(_0x160218){var _0x36cf15={'sender':_0x1ef630[_0x35a9('0x41')],'description':_0x1ef630[_0x35a9('0x44')],'content':_0x1ef630[_0x35a9('0x2f')],'beep':_0x1ef630[_0x35a9('0x45')]};_0x425ae7['forEach'](function(_0x29779c){_0x36cf15[_0x35a9('0x4c')]=_0x29779c;socket[_0x35a9('0x4d')](_0x35a9('0x4e'),_0x36cf15);});return _0x160218;});});})['then'](respondWithResult(_0x275ba0,0xc9))[_0x35a9('0x4f')](handleError(_0x275ba0,null));};function getContent(_0x2df124){return new BPromise(function(_0x4bc24d,_0x182f47){if(_0x2df124['text']){_0x4bc24d(_0x2df124[_0x35a9('0x31')]);return;}return db['Template'][_0x35a9('0x50')]({'attributes':[_0x35a9('0x51')],'where':{'id':_0x2df124[_0x35a9('0x32')]},'raw':!![]})[_0x35a9('0x29')](function(_0x28b946){if(!_0x28b946)throw new db['Sequelize'][(_0x35a9('0x33'))](_0x35a9('0x52'));var _0x3ab3b2=Mustache[_0x35a9('0x53')](_0x28b946[_0x35a9('0x51')],_0x2df124[_0x35a9('0x35')]);_0x4bc24d(_0x3ab3b2);})['catch'](function(_0x1022c5){_0x182f47(_0x1022c5);});});}function getRecipients(_0x30de8b){return new BPromise(function(_0x554997,_0x493482){var _0x3efe34=[];var _0x166b67=[];_0x30de8b[_0x35a9('0x54')](function(_0x340a72){var _0xa73d3c=_[_0x35a9('0x55')](_0x340a72['model'][_0x35a9('0x40')]());if(_0xa73d3c===_0x35a9('0x56')){_0x3efe34=_['union'](_0x3efe34,_0x340a72['ids']);}else{if(_[_0x35a9('0x3e')](_0xa73d3c,_0x35a9('0x57')))_0xa73d3c=_0xa73d3c[_0x35a9('0x58')](_0x35a9('0x57'),'Queue');_0x340a72[_0x35a9('0x59')][_0x35a9('0x54')](function(_0x290784){_0x166b67[_0x35a9('0x5a')](getAgents(_0xa73d3c,_0x290784));});}});return BPromise[_0x35a9('0x5b')](_0x166b67)[_0x35a9('0x29')](function(_0x4ffca2){_0x3efe34=_['union'](_0x3efe34,_[_0x35a9('0x5c')](_0x4ffca2));_0x554997(_0x3efe34);})['catch'](function(_0x347dc8){_0x493482(_0x347dc8);});});}function getAgents(_0x458dde,_0x1c43e9){return new BPromise(function(_0x54f96a,_0x4579f0){return db[_0x458dde]['findOne']({'where':{'id':_0x1c43e9}})[_0x35a9('0x29')](function(_0x54c065){return _0x54c065[_0x35a9('0x5d')]({'attributes':['id'],'raw':!![]})[_0x35a9('0x29')](function(_0x2f0900){var _0x2ba1d4=_[_0x35a9('0x5e')](_0x2f0900,'id');_0x54f96a(_0x2ba1d4);});})[_0x35a9('0x4f')](function(_0x27318d){_0x4579f0(_0x27318d);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd302=['UserNotification','save','update','emit','exports','events','../../mysqldb'];(function(_0x18ad8b,_0x50f2db){var _0x168ccd=function(_0x1db454){while(--_0x1db454){_0x18ad8b['push'](_0x18ad8b['shift']());}};_0x168ccd(++_0x50f2db);}(_0xd302,0x186));var _0x2d30=function(_0x529892,_0x4f40b0){_0x529892=_0x529892-0x0;var _0x13e1cc=_0xd302[_0x529892];return _0x13e1cc;};'use strict';var EventEmitter=require(_0x2d30('0x0'));var UserNotification=require(_0x2d30('0x1'))['db'][_0x2d30('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d30('0x3'),'afterUpdate':_0x2d30('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8f3344){return function(_0x3bdb6b,_0x2f0e48,_0x2f65a8){UserNotificationEvents['emit'](_0x8f3344+':'+_0x3bdb6b['id'],_0x3bdb6b);UserNotificationEvents[_0x2d30('0x5')](_0x8f3344,_0x3bdb6b);_0x2f65a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x2d30('0x6')]=UserNotificationEvents;
\ No newline at end of file
+var _0x16db=['hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x1d130e,_0x314633){var _0x156c2f=function(_0x5751d2){while(--_0x5751d2){_0x1d130e['push'](_0x1d130e['shift']());}};_0x156c2f(++_0x314633);}(_0x16db,0x1a0));var _0xb16d=function(_0xa39b2b,_0x8c128c){_0xa39b2b=_0xa39b2b-0x0;var _0x54d7f3=_0x16db[_0xa39b2b];return _0x54d7f3;};'use strict';var EventEmitter=require(_0xb16d('0x0'));var UserNotification=require(_0xb16d('0x1'))['db'][_0xb16d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb16d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3199c1){return function(_0x96add0,_0x289aa0,_0x8c4561){UserNotificationEvents['emit'](_0x3199c1+':'+_0x96add0['id'],_0x96add0);UserNotificationEvents['emit'](_0x3199c1,_0x96add0);_0x8c4561(null);};}for(var e in events){if(events[_0xb16d('0x4')](e)){var event=events[e];UserNotification[_0xb16d('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfced=['utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','define','UserNotification','userNotifications'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xfced,0x1a0));var _0xdfce=function(_0x1a9fe7,_0x4b0032){_0x1a9fe7=_0x1a9fe7-0x0;var _0x588bac=_0xfced[_0x1a9fe7];return _0x588bac;};'use strict';var _=require('lodash');var util=require(_0xdfce('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdfce('0x1'));var BPromise=require(_0xdfce('0x2'));var rp=require(_0xdfce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module['exports']=function(_0x36829b,_0x5b47f0){return _0x36829b[_0xdfce('0x4')](_0xdfce('0x5'),attributes,{'tableName':_0xdfce('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdfce('0x7'),'collate':_0xdfce('0x8')});};
\ No newline at end of file
+var _0x3e33=['utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','exports','define','UserNotification','userNotifications','utf8mb4'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x3e33,0x137));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x33e3('0x0'));var util=require('util');var logger=require(_0x33e3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x33e3('0x2'));var rp=require(_0x33e3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x33e3('0x4')]=function(_0x3d4093,_0x85c38e){return _0x3d4093[_0x33e3('0x5')](_0x33e3('0x6'),attributes,{'tableName':_0x33e3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33e3('0x8'),'collate':_0x33e3('0x9')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fd1=['message','result','catch','util','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4e60e4,_0x596df4){var _0x248bd2=function(_0x5e4853){while(--_0x5e4853){_0x4e60e4['push'](_0x4e60e4['shift']());}};_0x248bd2(++_0x596df4);}(_0x4fd1,0x16b));var _0x14fd=function(_0x5ccd6e,_0x2e3bfc){_0x5ccd6e=_0x5ccd6e-0x0;var _0x30f3de=_0x4fd1[_0x5ccd6e];return _0x30f3de;};'use strict';var _=require('lodash');var util=require(_0x14fd('0x0'));var moment=require('moment');var BPromise=require(_0x14fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x14fd('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x14fd('0x3'));var jayson=require(_0x14fd('0x4'));var client=jayson[_0x14fd('0x5')][_0x14fd('0x6')]({'port':0x232a});config[_0x14fd('0x7')]=_[_0x14fd('0x8')](config[_0x14fd('0x7')],{'host':_0x14fd('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14fd('0x7')]));require(_0x14fd('0xa'))[_0x14fd('0xb')](socket);function respondWithRpcPromise(_0x30eb97,_0x3d55a8,_0x1c39b7){return new BPromise(function(_0xc4b3e2,_0x57c6cf){return client[_0x14fd('0xc')](_0x30eb97,_0x1c39b7)[_0x14fd('0xd')](function(_0x449533){logger[_0x14fd('0xe')](_0x14fd('0xf'),_0x3d55a8,_0x14fd('0x10'));logger[_0x14fd('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3d55a8,_0x14fd('0x10'),JSON[_0x14fd('0x12')](_0x449533));if(_0x449533[_0x14fd('0x13')]){if(_0x449533[_0x14fd('0x13')][_0x14fd('0x14')]===0x1f4){logger[_0x14fd('0x13')](_0x14fd('0xf'),_0x3d55a8,_0x449533['error'][_0x14fd('0x15')]);return _0x57c6cf(_0x449533[_0x14fd('0x13')][_0x14fd('0x15')]);}logger[_0x14fd('0x13')](_0x14fd('0xf'),_0x3d55a8,_0x449533['error'][_0x14fd('0x15')]);return _0xc4b3e2(_0x449533[_0x14fd('0x13')]['message']);}else{logger[_0x14fd('0xe')](_0x14fd('0xf'),_0x3d55a8,_0x14fd('0x10'));_0xc4b3e2(_0x449533[_0x14fd('0x16')]['message']);}})[_0x14fd('0x17')](function(_0x4824ae){logger[_0x14fd('0x13')]('UserNotification,\x20%s,\x20%s',_0x3d55a8,_0x4824ae);_0x57c6cf(_0x4824ae);});});}
\ No newline at end of file
+var _0x3a41=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result'];(function(_0x552a54,_0x2caf0c){var _0x5723bb=function(_0x5d7a3f){while(--_0x5d7a3f){_0x552a54['push'](_0x552a54['shift']());}};_0x5723bb(++_0x2caf0c);}(_0x3a41,0x71));var _0x13a4=function(_0x19f183,_0x540981){_0x19f183=_0x19f183-0x0;var _0x317275=_0x3a41[_0x19f183];return _0x317275;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13a4('0x0'));var BPromise=require('bluebird');var rs=require(_0x13a4('0x1'));var fs=require('fs');var Redis=require(_0x13a4('0x2'));var db=require(_0x13a4('0x3'))['db'];var utils=require(_0x13a4('0x4'));var logger=require(_0x13a4('0x5'))(_0x13a4('0x6'));var config=require('../../config/environment');var jayson=require(_0x13a4('0x7'));var client=jayson[_0x13a4('0x8')]['http']({'port':0x232a});config[_0x13a4('0x9')]=_[_0x13a4('0xa')](config['redis'],{'host':_0x13a4('0xb'),'port':0x18eb});var socket=require(_0x13a4('0xc'))(new Redis(config['redis']));require(_0x13a4('0xd'))[_0x13a4('0xe')](socket);function respondWithRpcPromise(_0x7e8ca0,_0x4d7141,_0x2e9315){return new BPromise(function(_0x3a2934,_0x57d48b){return client[_0x13a4('0xf')](_0x7e8ca0,_0x2e9315)[_0x13a4('0x10')](function(_0x3cf2d9){logger[_0x13a4('0x11')]('UserNotification,\x20%s,\x20%s',_0x4d7141,_0x13a4('0x12'));logger[_0x13a4('0x13')](_0x13a4('0x14'),_0x4d7141,'request\x20sent',JSON[_0x13a4('0x15')](_0x3cf2d9));if(_0x3cf2d9[_0x13a4('0x16')]){if(_0x3cf2d9[_0x13a4('0x16')][_0x13a4('0x17')]===0x1f4){logger[_0x13a4('0x16')]('UserNotification,\x20%s,\x20%s',_0x4d7141,_0x3cf2d9[_0x13a4('0x16')][_0x13a4('0x18')]);return _0x57d48b(_0x3cf2d9[_0x13a4('0x16')]['message']);}logger[_0x13a4('0x16')](_0x13a4('0x19'),_0x4d7141,_0x3cf2d9['error'][_0x13a4('0x18')]);return _0x3a2934(_0x3cf2d9[_0x13a4('0x16')][_0x13a4('0x18')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x4d7141,_0x13a4('0x12'));_0x3a2934(_0x3cf2d9[_0x13a4('0x1a')][_0x13a4('0x18')]);}})[_0x13a4('0x1b')](function(_0x533115){logger['error'](_0x13a4('0x19'),_0x4d7141,_0x533115);_0x57d48b(_0x533115);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x656d=['length','userNotification:','save','remove','emit','removeListener','register'];(function(_0x217b40,_0x1ad84d){var _0x4bf4c6=function(_0x290ad5){while(--_0x290ad5){_0x217b40['push'](_0x217b40['shift']());}};_0x4bf4c6(++_0x1ad84d);}(_0x656d,0xe2));var _0xd656=function(_0x33e26a,_0x4a4f89){_0x33e26a=_0x33e26a-0x0;var _0x349767=_0x656d[_0x33e26a];return _0x349767;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xd656('0x0'),_0xd656('0x1'),'update'];function createListener(_0x45de1b,_0x2c3e4a){return function(_0x478a18){_0x2c3e4a[_0xd656('0x2')](_0x45de1b,_0x478a18);};}function removeListener(_0x2fb41d,_0x1e1132){return function(){UserNotificationEvents[_0xd656('0x3')](_0x2fb41d,_0x1e1132);};}exports[_0xd656('0x4')]=function(_0x4caa65){for(var _0x2ff003=0x0,_0x428c8f=events[_0xd656('0x5')];_0x2ff003<_0x428c8f;_0x2ff003++){var _0x445969=events[_0x2ff003];var _0x54f252=createListener(_0xd656('0x6')+_0x445969,_0x4caa65);UserNotificationEvents['on'](_0x445969,_0x54f252);}};
\ No newline at end of file
+var _0x69ad=['register','./userNotification.events','remove','update','emit'];(function(_0x1c0e91,_0xd8625e){var _0x34322c=function(_0x5d9d51){while(--_0x5d9d51){_0x1c0e91['push'](_0x1c0e91['shift']());}};_0x34322c(++_0xd8625e);}(_0x69ad,0x14b));var _0xd69a=function(_0x5731c3,_0x568c82){_0x5731c3=_0x5731c3-0x0;var _0x314f20=_0x69ad[_0x5731c3];return _0x314f20;};'use strict';var UserNotificationEvents=require(_0xd69a('0x0'));var events=['save',_0xd69a('0x1'),_0xd69a('0x2')];function createListener(_0x1dc5d5,_0x17440b){return function(_0x289e93){_0x17440b[_0xd69a('0x3')](_0x1dc5d5,_0x289e93);};}function removeListener(_0x5bafb8,_0x3f888c){return function(){UserNotificationEvents['removeListener'](_0x5bafb8,_0x3f888c);};}exports[_0xd69a('0x4')]=function(_0x101df9){for(var _0x5dec0e=0x0,_0x732b7=events['length'];_0x5dec0e<_0x732b7;_0x5dec0e++){var _0xd2e91=events[_0x5dec0e];var _0xc4fb86=createListener('userNotification:'+_0xd2e91,_0x101df9);UserNotificationEvents['on'](_0xd2e91,_0xc4fb86);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x29d25b,_0x590ff3){var _0x35f241=function(_0x1ca694){while(--_0x1ca694){_0x29d25b['push'](_0x29d25b['shift']());}};_0x35f241(++_0x590ff3);}(_0x70e0,0x17b));var _0x070e=function(_0x350e0c,_0x40fc08){_0x350e0c=_0x350e0c-0x0;var _0x434abb=_0x70e0[_0x350e0c];return _0x434abb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1fb165,_0x30dd48){var _0x5bd6f7=function(_0x13467b){while(--_0x13467b){_0x1fb165['push'](_0x1fb165['shift']());}};_0x5bd6f7(++_0x30dd48);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xcb91[_0x172ed7];return _0xfa8f61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3fe=['sequelize','exports'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xe3fe,0xbe));var _0xee3f=function(_0x45f72f,_0x3b8581){_0x45f72f=_0x45f72f-0x0;var _0x3d03ed=_0xe3fe[_0x45f72f];return _0x3d03ed;};'use strict';var Sequelize=require(_0xee3f('0x0'));module[_0xee3f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3f2b=['sequelize','INTEGER'];(function(_0x18be25,_0x4ad715){var _0x3af609=function(_0x574d9d){while(--_0x574d9d){_0x18be25['push'](_0x18be25['shift']());}};_0x3af609(++_0x4ad715);}(_0x3f2b,0x72));var _0xb3f2=function(_0x366fb6,_0xeb80a6){_0x366fb6=_0x366fb6-0x0;var _0x5120c3=_0x3f2b[_0x366fb6];return _0x5120c3;};'use strict';var Sequelize=require(_0xb3f2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb3f2('0x1')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a9f=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x2a9f,0x15e));var _0xf2a9=function(_0x35e4b3,_0x25aa07){_0x35e4b3=_0x35e4b3-0x0;var _0x355fce=_0x2a9f[_0x35e4b3];return _0x355fce;};'use strict';var _=require(_0xf2a9('0x0'));var util=require('util');var logger=require(_0xf2a9('0x1'))(_0xf2a9('0x2'));var moment=require(_0xf2a9('0x3'));var BPromise=require(_0xf2a9('0x4'));var rp=require(_0xf2a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2a9('0x6'));var config=require(_0xf2a9('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xf2a9('0x8')]=function(_0x41bca7,_0x2d54c2){return _0x41bca7[_0xf2a9('0x9')](_0xf2a9('0xa'),attributes,{'tableName':_0xf2a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c72=['exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x44c517,_0x408c80){var _0x3aa061=function(_0x56b6ab){while(--_0x56b6ab){_0x44c517['push'](_0x44c517['shift']());}};_0x3aa061(++_0x408c80);}(_0x8c72,0x153));var _0x28c7=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8c72[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x28c7('0x0'));var util=require(_0x28c7('0x1'));var logger=require(_0x28c7('0x2'))(_0x28c7('0x3'));var moment=require('moment');var BPromise=require(_0x28c7('0x4'));var rp=require(_0x28c7('0x5'));var fs=require('fs');var path=require(_0x28c7('0x6'));var rimraf=require(_0x28c7('0x7'));var config=require(_0x28c7('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x28c7('0x9')]=function(_0x4a02f8,_0x1215a0){return _0x4a02f8['define'](_0x28c7('0xa'),attributes,{'tableName':_0x28c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x733a=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x2520aa,_0x5ebd42){var _0x5d0e9c=function(_0x5547f6){while(--_0x5547f6){_0x2520aa['push'](_0x2520aa['shift']());}};_0x5d0e9c(++_0x5ebd42);}(_0x733a,0x10e));var _0xa733=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x733a[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa733('0x0'));var BPromise=require(_0xa733('0x1'));var rs=require(_0xa733('0x2'));var fs=require('fs');var Redis=require(_0xa733('0x3'));var db=require(_0xa733('0x4'))['db'];var utils=require(_0xa733('0x5'));var logger=require(_0xa733('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa733('0x7'));var client=jayson['client'][_0xa733('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x183f2,_0x43d048,_0x230637){return new BPromise(function(_0x5a4b36,_0x296a18){return client[_0xa733('0x9')](_0x183f2,_0x230637)[_0xa733('0xa')](function(_0x564835){logger[_0xa733('0xb')](_0xa733('0xc'),_0x43d048,_0xa733('0xd'));logger[_0xa733('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x43d048,_0xa733('0xd'),JSON[_0xa733('0xf')](_0x564835));if(_0x564835[_0xa733('0x10')]){if(_0x564835[_0xa733('0x10')][_0xa733('0x11')]===0x1f4){logger['error'](_0xa733('0xc'),_0x43d048,_0x564835['error'][_0xa733('0x12')]);return _0x296a18(_0x564835['error'][_0xa733('0x12')]);}logger[_0xa733('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x43d048,_0x564835[_0xa733('0x10')][_0xa733('0x12')]);return _0x5a4b36(_0x564835['error']['message']);}else{logger[_0xa733('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x43d048,'request\x20sent');_0x5a4b36(_0x564835[_0xa733('0x13')][_0xa733('0x12')]);}})['catch'](function(_0x952ef0){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x43d048,_0x952ef0);_0x296a18(_0x952ef0);});});}
\ No newline at end of file
+var _0x27e9=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','result'];(function(_0x46c994,_0x5c9716){var _0x5a5296=function(_0x5be7b1){while(--_0x5be7b1){_0x46c994['push'](_0x46c994['shift']());}};_0x5a5296(++_0x5c9716);}(_0x27e9,0x19f));var _0x927e=function(_0x19acdb,_0x545136){_0x19acdb=_0x19acdb-0x0;var _0x1b4b4d=_0x27e9[_0x19acdb];return _0x1b4b4d;};'use strict';var _=require('lodash');var util=require(_0x927e('0x0'));var moment=require(_0x927e('0x1'));var BPromise=require(_0x927e('0x2'));var rs=require(_0x927e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x927e('0x4'))['db'];var utils=require(_0x927e('0x5'));var logger=require(_0x927e('0x6'))(_0x927e('0x7'));var config=require(_0x927e('0x8'));var jayson=require(_0x927e('0x9'));var client=jayson['client'][_0x927e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x624a76,_0x527452,_0x34ea6a){return new BPromise(function(_0x4cc3b0,_0x13b25c){return client[_0x927e('0xb')](_0x624a76,_0x34ea6a)[_0x927e('0xc')](function(_0x12d819){logger[_0x927e('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x527452,_0x927e('0xe'));logger['debug'](_0x927e('0xf'),_0x527452,'request\x20sent',JSON[_0x927e('0x10')](_0x12d819));if(_0x12d819[_0x927e('0x11')]){if(_0x12d819['error'][_0x927e('0x12')]===0x1f4){logger[_0x927e('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x527452,_0x12d819[_0x927e('0x11')][_0x927e('0x13')]);return _0x13b25c(_0x12d819[_0x927e('0x11')][_0x927e('0x13')]);}logger[_0x927e('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x527452,_0x12d819['error'][_0x927e('0x13')]);return _0x4cc3b0(_0x12d819[_0x927e('0x11')][_0x927e('0x13')]);}else{logger['info'](_0x927e('0x14'),_0x527452,_0x927e('0xe'));_0x4cc3b0(_0x12d819[_0x927e('0x15')][_0x927e('0x13')]);}})[_0x927e('0x16')](function(_0x59bd97){logger[_0x927e('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x527452,_0x59bd97);_0x13b25c(_0x59bd97);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6140=['delete','/:id','destroy','removeSections','removeResources','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','describe','/:id/sections','/:id/resources','create','post','/:id/clone','clone','addResources','update'];(function(_0x31c5c1,_0x472aa9){var _0x24f84d=function(_0x3f264b){while(--_0x3f264b){_0x31c5c1['push'](_0x31c5c1['shift']());}};_0x24f84d(++_0x472aa9);}(_0x6140,0x19b));var _0x0614=function(_0x23fbf0,_0x505f60){_0x23fbf0=_0x23fbf0-0x0;var _0x443648=_0x6140[_0x23fbf0];return _0x443648;};'use strict';var multer=require(_0x0614('0x0'));var util=require('util');var path=require(_0x0614('0x1'));var timeout=require(_0x0614('0x2'));var express=require(_0x0614('0x3'));var router=express[_0x0614('0x4')]();var fs_extra=require(_0x0614('0x5'));var auth=require(_0x0614('0x6'));var interaction=require(_0x0614('0x7'));var config=require(_0x0614('0x8'));var controller=require(_0x0614('0x9'));router[_0x0614('0xa')]('/',auth[_0x0614('0xb')](),controller['index']);router[_0x0614('0xa')]('/describe',auth[_0x0614('0xb')](),controller[_0x0614('0xc')]);router[_0x0614('0xa')]('/:id',auth[_0x0614('0xb')](),controller['show']);router[_0x0614('0xa')](_0x0614('0xd'),auth[_0x0614('0xb')](),controller['getSections']);router[_0x0614('0xa')](_0x0614('0xe'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth['isAuthenticated'](),controller[_0x0614('0xf')]);router[_0x0614('0x10')](_0x0614('0x11'),auth[_0x0614('0xb')](),controller[_0x0614('0x12')]);router['post']('/:id/sections',auth[_0x0614('0xb')](),controller['addSections']);router[_0x0614('0x10')](_0x0614('0xe'),auth[_0x0614('0xb')](),controller[_0x0614('0x13')]);router['put']('/:id',auth[_0x0614('0xb')](),controller[_0x0614('0x14')]);router[_0x0614('0x15')](_0x0614('0x16'),auth['isAuthenticated'](),controller[_0x0614('0x17')]);router['delete']('/:id/sections',auth[_0x0614('0xb')](),controller[_0x0614('0x18')]);router['delete']('/:id/resources',auth['isAuthenticated'](),controller[_0x0614('0x19')]);module[_0x0614('0x1a')]=router;
\ No newline at end of file
+var _0x84e1=['./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getSections','/:id/resources','post','/:id/clone','clone','/:id/sections','addSections','addResources','delete','removeSections','removeResources','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c249a,_0x4a6096){var _0x3edb89=function(_0x46f832){while(--_0x46f832){_0x2c249a['push'](_0x2c249a['shift']());}};_0x3edb89(++_0x4a6096);}(_0x84e1,0x9f));var _0x184e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x84e1[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var path=require('path');var timeout=require(_0x184e('0x2'));var express=require(_0x184e('0x3'));var router=express[_0x184e('0x4')]();var fs_extra=require(_0x184e('0x5'));var auth=require(_0x184e('0x6'));var interaction=require(_0x184e('0x7'));var config=require(_0x184e('0x8'));var controller=require(_0x184e('0x9'));router[_0x184e('0xa')]('/',auth[_0x184e('0xb')](),controller[_0x184e('0xc')]);router[_0x184e('0xa')](_0x184e('0xd'),auth[_0x184e('0xb')](),controller[_0x184e('0xe')]);router[_0x184e('0xa')](_0x184e('0xf'),auth[_0x184e('0xb')](),controller[_0x184e('0x10')]);router[_0x184e('0xa')]('/:id/sections',auth[_0x184e('0xb')](),controller[_0x184e('0x11')]);router[_0x184e('0xa')](_0x184e('0x12'),auth[_0x184e('0xb')](),controller['getResources']);router['post']('/',auth[_0x184e('0xb')](),controller['create']);router[_0x184e('0x13')](_0x184e('0x14'),auth[_0x184e('0xb')](),controller[_0x184e('0x15')]);router['post'](_0x184e('0x16'),auth[_0x184e('0xb')](),controller[_0x184e('0x17')]);router[_0x184e('0x13')](_0x184e('0x12'),auth[_0x184e('0xb')](),controller[_0x184e('0x18')]);router['put'](_0x184e('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x184e('0x19')](_0x184e('0xf'),auth[_0x184e('0xb')](),controller['destroy']);router[_0x184e('0x19')]('/:id/sections',auth['isAuthenticated'](),controller[_0x184e('0x1a')]);router[_0x184e('0x19')](_0x184e('0x12'),auth['isAuthenticated'](),controller[_0x184e('0x1b')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe63c=['join','getDataValue','BOOLEAN','sequelize','STRING','setDataValue'];(function(_0x3b2e83,_0x43962d){var _0x186107=function(_0x123203){while(--_0x123203){_0x3b2e83['push'](_0x3b2e83['shift']());}};_0x186107(++_0x43962d);}(_0xe63c,0x16b));var _0xce63=function(_0x22878e,_0x2a5290){_0x22878e=_0x22878e-0x0;var _0x51e0d8=_0xe63c[_0x22878e];return _0x51e0d8;};'use strict';var Sequelize=require(_0xce63('0x0'));module['exports']={'name':{'type':Sequelize[_0xce63('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xce63('0x1')],'set':function(_0x3ac5af){this[_0xce63('0x2')]('crudPermissions',_0x3ac5af?_0x3ac5af[_0xce63('0x3')](''):[]);},'get':function(){return this[_0xce63('0x4')]('crudPermissions')?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xce63('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xce63('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x52d5=['sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x235983,_0x3e6e7c){var _0x21f20d=function(_0x532bd0){while(--_0x532bd0){_0x235983['push'](_0x235983['shift']());}};_0x21f20d(++_0x3e6e7c);}(_0x52d5,0x1ea));var _0x552d=function(_0x4f3f6e,_0xf0ad18){_0x4f3f6e=_0x4f3f6e-0x0;var _0x21d24a=_0x52d5[_0x4f3f6e];return _0x21d24a;};'use strict';var Sequelize=require(_0x552d('0x0'));module[_0x552d('0x1')]={'name':{'type':Sequelize[_0x552d('0x2')],'allowNull':![],'unique':_0x552d('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xd8fd8c){this[_0x552d('0x4')](_0x552d('0x5'),_0xd8fd8c?_0xd8fd8c[_0x552d('0x6')](''):[]);},'get':function(){return this[_0x552d('0x7')](_0x552d('0x5'))?this['getDataValue'](_0x552d('0x5'))[_0x552d('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x552d('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x552d('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x552d('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x552d('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x552d('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x552d('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x552d('0x9')],'defaultValue':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21f1=['apply','reject','save','then','destroy','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','UserProfile','includeAll','include','findAll','rows','catch','show','params','options','find','body','clone','rawAttributes','get','omit','createdAt','updatedAt','crudPermissions','transaction','create','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','update','describe','addSections','sequelize','Resources','push','removeSections','ids','getSections','includes','isEmpty','enabled','subsections','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x54e9f7,_0x2499d1){var _0x3ee71a=function(_0x36fa50){while(--_0x36fa50){_0x54e9f7['push'](_0x54e9f7['shift']());}};_0x3ee71a(++_0x2499d1);}(_0x21f1,0xc3));var _0x121f=function(_0x1ff0b5,_0x1c30df){_0x1ff0b5=_0x1ff0b5-0x0;var _0x43d117=_0x21f1[_0x1ff0b5];return _0x43d117;};'use strict';var emlformat=require(_0x121f('0x0'));var rimraf=require(_0x121f('0x1'));var zipdir=require(_0x121f('0x2'));var jsonpatch=require(_0x121f('0x3'));var rp=require(_0x121f('0x4'));var moment=require(_0x121f('0x5'));var BPromise=require(_0x121f('0x6'));var Mustache=require('mustache');var util=require(_0x121f('0x7'));var path=require(_0x121f('0x8'));var sox=require(_0x121f('0x9'));var csv=require(_0x121f('0xa'));var ejs=require(_0x121f('0xb'));var fs=require('fs');var fs_extra=require(_0x121f('0xc'));var _=require(_0x121f('0xd'));var squel=require(_0x121f('0xe'));var crypto=require(_0x121f('0xf'));var jsforce=require(_0x121f('0x10'));var deskjs=require(_0x121f('0x11'));var toCsv=require('to-csv');var querystring=require(_0x121f('0x12'));var Papa=require('papaparse');var Redis=require(_0x121f('0x13'));var authService=require(_0x121f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x121f('0x15'));var hardwareService=require(_0x121f('0x16'));var logger=require(_0x121f('0x17'))(_0x121f('0x18'));var utils=require('../../config/utils');var config=require(_0x121f('0x19'));var licenseUtil=require(_0x121f('0x1a'));var db=require(_0x121f('0x1b'))['db'];config[_0x121f('0x1c')]=_[_0x121f('0x1d')](config[_0x121f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x121f('0x1c')]));require(_0x121f('0x1e'))['register'](socket);function respondWithStatusCode(_0x278093,_0x380b4f){_0x380b4f=_0x380b4f||0xcc;return function(_0x124b69){if(_0x124b69){return _0x278093[_0x121f('0x1f')](_0x380b4f);}return _0x278093[_0x121f('0x20')](_0x380b4f)[_0x121f('0x21')]();};}function respondWithResult(_0x438a7b,_0x234fb0){_0x234fb0=_0x234fb0||0xc8;return function(_0x4cec2b){if(_0x4cec2b){return _0x438a7b[_0x121f('0x20')](_0x234fb0)[_0x121f('0x22')](_0x4cec2b);}};}function respondWithFilteredResult(_0x2572e9,_0x59e017){return function(_0x5f4d4d){if(_0x5f4d4d){var _0x12ec95=typeof _0x59e017[_0x121f('0x23')]===_0x121f('0x24')&&typeof _0x59e017[_0x121f('0x25')]===_0x121f('0x24');var _0x51e315=_0x5f4d4d[_0x121f('0x26')];var _0xb3f8cf=_0x12ec95?0x0:_0x59e017[_0x121f('0x23')];var _0x23a8d2=_0x12ec95?_0x5f4d4d['count']:_0x59e017[_0x121f('0x23')]+_0x59e017[_0x121f('0x25')];var _0xcd73a;if(_0x23a8d2>=_0x51e315){_0x23a8d2=_0x51e315;_0xcd73a=0xc8;}else{_0xcd73a=0xce;}_0x2572e9[_0x121f('0x20')](_0xcd73a);return _0x2572e9[_0x121f('0x27')](_0x121f('0x28'),_0xb3f8cf+'-'+_0x23a8d2+'/'+_0x51e315)[_0x121f('0x22')](_0x5f4d4d);}return null;};}function patchUpdates(_0x19bab0){return function(_0xaba9c8){try{jsonpatch[_0x121f('0x29')](_0xaba9c8,_0x19bab0,!![]);}catch(_0x198880){return BPromise[_0x121f('0x2a')](_0x198880);}return _0xaba9c8[_0x121f('0x2b')]();};}function saveUpdates(_0x121841,_0x555d7d){return function(_0x5d544e){if(_0x5d544e){return _0x5d544e['update'](_0x121841)[_0x121f('0x2c')](function(_0xe54ead){return _0xe54ead;});}return null;};}function removeEntity(_0x3e9045,_0x51b78e){return function(_0x49a81d){if(_0x49a81d){return _0x49a81d[_0x121f('0x2d')]()[_0x121f('0x2c')](function(){_0x3e9045[_0x121f('0x20')](0xcc)[_0x121f('0x21')]();});}};}function handleEntityNotFound(_0x557c23,_0x2a6dfb){return function(_0x2d9007){if(!_0x2d9007){_0x557c23[_0x121f('0x1f')](0x194);}return _0x2d9007;};}function handleError(_0x54c18d,_0x560c4d){_0x560c4d=_0x560c4d||0x1f4;return function(_0x3e065d){logger[_0x121f('0x2e')](_0x3e065d[_0x121f('0x2f')]);if(_0x3e065d['name']){delete _0x3e065d[_0x121f('0x30')];}_0x54c18d[_0x121f('0x20')](_0x560c4d)[_0x121f('0x31')](_0x3e065d);};}exports['index']=function(_0x34c09a,_0x4ace4a){var _0x340c6d={},_0x120361={},_0x12ac37={'count':0x0,'rows':[]};var _0x55293f=_['map'](db['UserProfile']['rawAttributes'],function(_0x5c6dfc){return{'name':_0x5c6dfc[_0x121f('0x32')],'type':_0x5c6dfc[_0x121f('0x33')][_0x121f('0x34')]};});_0x120361[_0x121f('0x35')]=_[_0x121f('0x36')](_0x55293f,_0x121f('0x30'));_0x120361[_0x121f('0x37')]=_[_0x121f('0x38')](_0x34c09a[_0x121f('0x37')]);_0x120361[_0x121f('0x39')]=_[_0x121f('0x3a')](_0x120361['model'],_0x120361[_0x121f('0x37')]);_0x340c6d[_0x121f('0x3b')]=_[_0x121f('0x3a')](_0x120361[_0x121f('0x35')],qs[_0x121f('0x3c')](_0x34c09a[_0x121f('0x37')][_0x121f('0x3c')]));_0x340c6d[_0x121f('0x3b')]=_0x340c6d[_0x121f('0x3b')][_0x121f('0x3d')]?_0x340c6d['attributes']:_0x120361[_0x121f('0x35')];if(!_0x34c09a[_0x121f('0x37')]['hasOwnProperty'](_0x121f('0x3e'))){_0x340c6d[_0x121f('0x25')]=qs['limit'](_0x34c09a[_0x121f('0x37')]['limit']);_0x340c6d[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x34c09a['query'][_0x121f('0x23')]);}_0x340c6d[_0x121f('0x3f')]=qs['sort'](_0x34c09a[_0x121f('0x37')][_0x121f('0x40')]);_0x340c6d[_0x121f('0x41')]=qs[_0x121f('0x39')](_[_0x121f('0x42')](_0x34c09a[_0x121f('0x37')],_0x120361['filters']),_0x55293f);if(_0x34c09a[_0x121f('0x37')][_0x121f('0x43')]){_0x340c6d[_0x121f('0x41')]=_[_0x121f('0x44')](_0x340c6d[_0x121f('0x41')],{'$or':_[_0x121f('0x36')](_0x55293f,function(_0x2d27b3){if(_0x2d27b3[_0x121f('0x33')]!==_0x121f('0x45')){var _0x258097={};_0x258097[_0x2d27b3[_0x121f('0x30')]]={'$like':'%'+_0x34c09a['query'][_0x121f('0x43')]+'%'};return _0x258097;}})});}_0x340c6d=_['merge']({},_0x340c6d,_0x34c09a['options']);var _0x49c3fd={'where':_0x340c6d[_0x121f('0x41')]};return db[_0x121f('0x46')][_0x121f('0x26')](_0x49c3fd)[_0x121f('0x2c')](function(_0x3b56eb){_0x12ac37[_0x121f('0x26')]=_0x3b56eb;if(_0x34c09a['query'][_0x121f('0x47')]){_0x340c6d[_0x121f('0x48')]=[{'all':!![]}];}return db[_0x121f('0x46')][_0x121f('0x49')](_0x340c6d);})[_0x121f('0x2c')](function(_0x1488dc){_0x12ac37[_0x121f('0x4a')]=_0x1488dc;return _0x12ac37;})['then'](respondWithFilteredResult(_0x4ace4a,_0x340c6d))[_0x121f('0x4b')](handleError(_0x4ace4a,null));};exports[_0x121f('0x4c')]=function(_0x1a19e4,_0x541887){var _0x472f2c={'raw':![],'where':{'id':_0x1a19e4[_0x121f('0x4d')]['id']}},_0x480661={};_0x480661[_0x121f('0x35')]=_[_0x121f('0x38')](db[_0x121f('0x46')]['rawAttributes']);_0x480661[_0x121f('0x37')]=_[_0x121f('0x38')](_0x1a19e4[_0x121f('0x37')]);_0x480661[_0x121f('0x39')]=_[_0x121f('0x3a')](_0x480661[_0x121f('0x35')],_0x480661[_0x121f('0x37')]);_0x472f2c['attributes']=_['intersection'](_0x480661[_0x121f('0x35')],qs[_0x121f('0x3c')](_0x1a19e4['query'][_0x121f('0x3c')]));_0x472f2c[_0x121f('0x3b')]=_0x472f2c['attributes'][_0x121f('0x3d')]?_0x472f2c[_0x121f('0x3b')]:_0x480661[_0x121f('0x35')];if(_0x1a19e4[_0x121f('0x37')][_0x121f('0x47')]){_0x472f2c[_0x121f('0x48')]=[{'all':!![]}];}_0x472f2c=_['merge']({},_0x472f2c,_0x1a19e4[_0x121f('0x4e')]);return db[_0x121f('0x46')][_0x121f('0x4f')](_0x472f2c)[_0x121f('0x2c')](handleEntityNotFound(_0x541887,null))[_0x121f('0x2c')](respondWithResult(_0x541887,null))[_0x121f('0x4b')](handleError(_0x541887,null));};exports['create']=function(_0x1cf554,_0x564de4){return db[_0x121f('0x46')]['create'](_0x1cf554[_0x121f('0x50')],{})[_0x121f('0x2c')](respondWithResult(_0x564de4,0xc9))[_0x121f('0x4b')](handleError(_0x564de4,null));};exports[_0x121f('0x51')]=function(_0x4d3460,_0x5729d3){var _0x27ffc1={'where':{'id':_0x4d3460[_0x121f('0x4d')]['id']}},_0x3e1af5={};_0x3e1af5[_0x121f('0x35')]=_[_0x121f('0x38')](db['UserProfile'][_0x121f('0x52')]);_0x27ffc1['attributes']=_[_0x121f('0x3a')](_0x3e1af5[_0x121f('0x35')],qs[_0x121f('0x3c')](_0x4d3460[_0x121f('0x37')][_0x121f('0x3c')]));_0x27ffc1['attributes']=_0x27ffc1['attributes'][_0x121f('0x3d')]?_0x27ffc1['attributes']:_0x3e1af5[_0x121f('0x35')];if(_0x4d3460[_0x121f('0x37')]['includeAll']){_0x27ffc1[_0x121f('0x48')]=[{'all':!![]}];}_0x27ffc1=_['merge']({},_0x27ffc1,_0x4d3460[_0x121f('0x4e')]);return db[_0x121f('0x46')][_0x121f('0x4f')](_0x27ffc1)[_0x121f('0x2c')](handleEntityNotFound(_0x5729d3,null))[_0x121f('0x2c')](function(_0x19b77c){if(_0x19b77c){var _0x51de5e=_0x19b77c[_0x121f('0x53')]({'plain':!![]});_0x51de5e=qs[_0x121f('0x54')](_0x51de5e,['id',_0x121f('0x55'),_0x121f('0x56'),_0x121f('0x57')]);_0x4d3460['body']=_[_0x121f('0x54')](_0x4d3460[_0x121f('0x50')],['id',_0x121f('0x55'),_0x121f('0x56')]);return db['sequelize'][_0x121f('0x58')](function(_0x141cb1){return db[_0x121f('0x46')][_0x121f('0x59')](_['merge'](_0x51de5e,_0x4d3460['body']),{'include':_0x4d3460['query'][_0x121f('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x141cb1})[_0x121f('0x2c')](function(_0x24c69e){var _0x3fa871=_0x24c69e[_0x121f('0x53')]({'plain':!![]});return db[_0x121f('0x5a')][_0x121f('0x49')]({'where':{'userProfileId':_0x4d3460[_0x121f('0x4d')]['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x51b9bd){if(_0x51b9bd){return BPromise[_0x121f('0x5b')](_0x51b9bd,function(_0x585084){return new BPromise(function(_0x2ea6fd,_0x28d5ec){if(_0x585084['autoAssociation']===null||_0x585084[_0x121f('0x5c')]===0x1)_0x2ea6fd(null);return db[_0x121f('0x5d')][_0x121f('0x49')]({'where':{'sectionId':_0x585084['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x26f9e6){var _0x45acee=_['map'](_0x26f9e6,function(_0x5c804e){return qs[_0x121f('0x54')](_0x5c804e,['id',_0x121f('0x55'),_0x121f('0x56'),_0x121f('0x5e')]);});_0x2ea6fd(_0x45acee);})[_0x121f('0x4b')](function(_0x25b834){_0x28d5ec(_0x25b834);});})[_0x121f('0x2c')](function(_0x459b32){var _0x38cc3b=qs[_0x121f('0x54')](_0x585084,['id','createdAt',_0x121f('0x56')]);_0x38cc3b[_0x121f('0x5f')]=_0x3fa871['id'];if(_0x459b32)_0x38cc3b['Resources']=_0x459b32;return _0x38cc3b;})['then'](function(_0x4d71f2){return db['UserProfileSection'][_0x121f('0x59')](_0x4d71f2,{'include':[{'model':db[_0x121f('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x141cb1});});})[_0x121f('0x2c')](function(){return _0x3fa871;});}});});});}})['then'](respondWithResult(_0x5729d3,0xc9))[_0x121f('0x4b')](handleError(_0x5729d3,null));};exports[_0x121f('0x60')]=function(_0x254815,_0x5925f3){if(_0x254815[_0x121f('0x50')]['id']){delete _0x254815['body']['id'];}return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x254815[_0x121f('0x4d')]['id']}})[_0x121f('0x2c')](handleEntityNotFound(_0x5925f3,null))[_0x121f('0x2c')](saveUpdates(_0x254815[_0x121f('0x50')],null))[_0x121f('0x2c')](respondWithResult(_0x5925f3,null))[_0x121f('0x4b')](handleError(_0x5925f3,null));};exports['destroy']=function(_0x5514d2,_0x3245c7){return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x5514d2[_0x121f('0x4d')]['id']}})[_0x121f('0x2c')](handleEntityNotFound(_0x3245c7,null))[_0x121f('0x2c')](removeEntity(_0x3245c7,null))[_0x121f('0x4b')](handleError(_0x3245c7,null));};exports[_0x121f('0x61')]=function(_0x3603ab,_0x42965a){return db['UserProfile'][_0x121f('0x61')]()['then'](respondWithResult(_0x42965a,null))['catch'](handleError(_0x42965a,null));};exports[_0x121f('0x62')]=function(_0x19135f,_0x4feb8e){var _0x3224b4=_0x19135f[_0x121f('0x50')];return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x19135f[_0x121f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4feb8e,null))['then'](function(_0x45e8d0){if(_0x45e8d0){return db[_0x121f('0x63')][_0x121f('0x58')](function(_0x5b2cd3){return db['UserProfileSection'][_0x121f('0x2d')]({'where':{'userProfileId':_0x19135f[_0x121f('0x4d')]['id'],'sectionId':_[_0x121f('0x36')](_0x3224b4,function(_0x2aa56b){return _0x2aa56b[_0x121f('0x5e')];})},'transaction':_0x5b2cd3})[_0x121f('0x2c')](function(){var _0xb0e3f5=_[_0x121f('0x36')](_0x3224b4,function(_0x16d5ac){_0x16d5ac[_0x121f('0x5f')]=_0x19135f[_0x121f('0x4d')]['id'];return _0x16d5ac;});var _0x298a8f=[];return BPromise[_0x121f('0x5b')](_0xb0e3f5,function(_0x5b63e7){return db['UserProfileSection'][_0x121f('0x59')](_0x5b63e7,{'include':[{'model':db[_0x121f('0x5d')],'as':_0x121f('0x64')}],'raw':!![],'transaction':_0x5b2cd3})[_0x121f('0x2c')](function(_0x56a3c1){_0x298a8f[_0x121f('0x65')](_0x56a3c1[_0x121f('0x53')]({'plain':!![]}));});})['then'](function(){return _0x298a8f;});});});}})['then'](function(_0x3b2f39){return _0x3b2f39;})[_0x121f('0x2c')](respondWithResult(_0x4feb8e,null))[_0x121f('0x4b')](handleError(_0x4feb8e,null));};exports[_0x121f('0x66')]=function(_0x4f0c05,_0x3b3c47){var _0x39b13a;return db['UserProfile'][_0x121f('0x4f')]({'where':{'id':_0x4f0c05[_0x121f('0x4d')]['id']},'attributes':['id',_0x121f('0x30')]})['then'](handleEntityNotFound(_0x3b3c47,null))['then'](function(_0xb7340c){if(_0xb7340c){_0x39b13a=_0xb7340c;return db[_0x121f('0x5a')][_0x121f('0x2d')]({'where':{'userProfileId':_0x4f0c05[_0x121f('0x4d')]['id'],'sectionId':_0x4f0c05[_0x121f('0x37')][_0x121f('0x67')]}});}})[_0x121f('0x2c')](function(){return _0x39b13a;})['then'](respondWithStatusCode(_0x3b3c47,null))[_0x121f('0x4b')](handleError(_0x3b3c47,null));};exports[_0x121f('0x68')]=function(_0x73c672,_0x67122f){var _0x443b20=[];var _0x1a24ba=[];return db[_0x121f('0x5a')][_0x121f('0x49')]({'where':{'userProfileId':_0x73c672[_0x121f('0x4d')]['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x4d63b0){_0x443b20=_['filter'](_0x4d63b0,function(_0x121913){return _0x121913['enabled']===0x1||_[_0x121f('0x69')]([0x3eb,0x709],_0x121913[_0x121f('0x5e')]);});if(!_[_0x121f('0x6a')](_0x443b20)){return _[_0x121f('0x36')](_0x443b20,function(_0x37f8fc){return _0x37f8fc[_0x121f('0x5e')];});}else{return;}})[_0x121f('0x2c')](function(_0x120aad){if(_0x120aad)_0x1a24ba=_0x120aad;if(_['includes'](_0x1a24ba,0x64)){var _0x781084=_[_0x121f('0x4f')](_0x443b20,{'sectionId':0x64});return hasDefaultDashboard(_0x781084)[_0x121f('0x2c')](function(_0x324ac5){return _[_0x121f('0x36')](_0x443b20,function(_0x1f8382){if(_0x1f8382[_0x121f('0x5e')]===0x64){_0x1f8382['subsections']=_0x324ac5;}return _0x1f8382;});});}else{return;}})[_0x121f('0x2c')](function(_0x350252){if(_0x350252)_0x443b20=_0x350252;if(_[_0x121f('0x69')](_0x1a24ba,0x3eb)){var _0x1ddbf5=_['find'](_0x443b20,{'sectionId':0x3eb});return getCustomDashboards(_0x1ddbf5)[_0x121f('0x2c')](function(_0x31db14){return _['map'](_0x443b20,function(_0x168969){if(_0x1ddbf5[_0x121f('0x6b')]){if(_0x168969[_0x121f('0x5e')]===0x3eb){_0x168969[_0x121f('0x6c')]=_0x31db14;}}else{if(_0x168969[_0x121f('0x5e')]===0x64){if(!_0x168969[_0x121f('0x6c')]){_0x168969['subsections']=[];}_0x168969[_0x121f('0x6c')]=_0x168969[_0x121f('0x6c')]['concat'](_0x31db14);}}return _0x168969;});});}else{return;}})[_0x121f('0x2c')](function(_0x19b0b9){if(_0x19b0b9)_0x443b20=_0x19b0b9;if(_[_0x121f('0x69')](_0x1a24ba,0x709)){var _0x34f4eb=_['find'](_0x443b20,{'sectionId':0x709});return getPlugins(_0x34f4eb)['then'](function(_0x351238){if(_0x34f4eb['enabled']){return _[_0x121f('0x36')](_0x443b20,function(_0x4414ea){if(_0x4414ea[_0x121f('0x5e')]===0x709){_0x4414ea[_0x121f('0x6c')]=_0x351238;}return _0x4414ea;});}else{var _0x4cc857={'sectionId':0x76c,'enabled':0x1,'subsections':_0x351238};var _0x15fb2f=_[_0x121f('0x36')](_0x443b20);_0x15fb2f[_0x121f('0x65')](_0x4cc857);return _0x15fb2f;}});}else{return;}})[_0x121f('0x2c')](function(_0x1938b3){if(_0x1938b3)_0x443b20=_0x1938b3;return _[_0x121f('0x43')](_0x443b20,[_0x121f('0x6b'),0x1]);})['then'](respondWithResult(_0x67122f,null))[_0x121f('0x4b')](handleError(_0x67122f,null));};function hasDefaultDashboard(_0x350606){var _0x57cce2=[0x65];return new BPromise(function(_0x4400cb,_0xf2aee0){try{if(_0x350606[_0x121f('0x5c')]){_0x4400cb(_0x57cce2);}else{return db[_0x121f('0x5d')][_0x121f('0x6d')]({'where':{'sectionId':_0x350606['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x308211){_0x308211?_0x4400cb(_0x57cce2):_0x4400cb();});}}catch(_0x5f4b2d){_0xf2aee0(_0x5f4b2d);}});}function getCustomDashboards(_0x33554c){var _0x2ee6d4=[];return new BPromise(function(_0x2ef957,_0x1e851c){try{if(_0x33554c[_0x121f('0x5c')]){return db['Dashboard'][_0x121f('0x49')]({'raw':!![]})[_0x121f('0x2c')](function(_0x1ebb0d){_0x1ebb0d[_0x121f('0x6e')](function(_0x34eaf8){_0x2ee6d4[_0x121f('0x65')](_0x34eaf8['id']+0x1869f);});_0x2ef957(_0x2ee6d4);});}else{return db['UserProfileResource'][_0x121f('0x49')]({'where':{'sectionId':_0x33554c['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x437837){_0x437837[_0x121f('0x6e')](function(_0x497296){_0x2ee6d4['push'](_0x497296[_0x121f('0x6f')]+0x1869f);});_0x2ef957(_0x2ee6d4);});}}catch(_0x3348b8){_0x1e851c(_0x3348b8);}});}function getPlugins(_0x359faf){var _0x292833=[];return new BPromise(function(_0x582e7a,_0x2150a3){try{if(_0x359faf[_0x121f('0x5c')]){return db['Plugin']['findAll']({'raw':!![]})[_0x121f('0x2c')](function(_0xfd73dd){_0xfd73dd['forEach'](function(_0x299c53){_0x292833[_0x121f('0x65')](_0x299c53['id']+0x15b38);});_0x582e7a(_0x292833);});}else{return db[_0x121f('0x5d')][_0x121f('0x49')]({'where':{'sectionId':_0x359faf['id']},'raw':!![]})[_0x121f('0x2c')](function(_0x1c6c14){_0x1c6c14[_0x121f('0x6e')](function(_0x13991b){_0x292833['push'](_0x13991b['resourceId']+0x15b38);});_0x582e7a(_0x292833);});}}catch(_0x405077){_0x2150a3(_0x405077);}});}exports[_0x121f('0x70')]=function(_0x14da2b,_0x38e4cf){return db['UserProfile']['find']({'where':{'id':_0x14da2b[_0x121f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38e4cf,null))['then'](function(_0x55e991){if(_0x55e991){return db['sequelize'][_0x121f('0x58')](function(_0x185b9c){return db[_0x121f('0x5a')]['findAll']({'where':{'userProfileId':_0x14da2b['params']['id']},'attributes':['id'],'raw':!![]})[_0x121f('0x2c')](function(_0x27e0b5){if(_0x27e0b5){return db['UserProfileSection'][_0x121f('0x2d')]({'where':{'userProfileId':_0x14da2b[_0x121f('0x4d')]['id'],'id':_['map'](_0x27e0b5,function(_0x5d4cfd){return _0x5d4cfd['id'];})},'transaction':_0x185b9c});}})['then'](function(_0x53c58d){var _0x58c265=_['map'](_0x14da2b[_0x121f('0x50')],function(_0x1bb7ad){_0x1bb7ad[_0x121f('0x5f')]=_0x14da2b[_0x121f('0x4d')]['id'];return _0x1bb7ad;});return db['UserProfileSection'][_0x121f('0x71')](_0x58c265,{'raw':!![],'transaction':_0x185b9c});})[_0x121f('0x2c')](function(_0x26fc25){var _0x5690f4=_['filter'](_[_0x121f('0x36')](_0x26fc25,function(_0x3380e0){return _0x3380e0['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5690f4){return db[_0x121f('0x5a')]['findAll']({'where':{'userProfileId':_0x14da2b[_0x121f('0x4d')]['id'],'sectionId':_[_0x121f('0x36')](_0x5690f4,function(_0x179281){return _0x179281[_0x121f('0x5e')];})},'attributes':['id',_0x121f('0x5e')],'raw':!![]})[_0x121f('0x2c')](function(_0x380388){var _0x48a6cc=_[_0x121f('0x36')](_0x14da2b[_0x121f('0x50')],function(_0x2789d3){_0x2789d3['userProfileId']=_0x14da2b['params']['id'];return _0x2789d3;});return db[_0x121f('0x5d')][_0x121f('0x71')](_0x48a6cc,{'raw':!![],'transaction':_0x185b9c});});}})[_0x121f('0x4b')](handleError(_0x38e4cf,null));});}})[_0x121f('0x2c')](function(_0x5919e3){var _0x4561f2=_[_0x121f('0x36')](_0x5919e3,function(_0x7e681d){return _0x7e681d[_0x121f('0x53')]({'plain':!![]});});})['then'](respondWithResult(_0x38e4cf,null))[_0x121f('0x4b')](handleError(_0x38e4cf,null));};exports[_0x121f('0x72')]=function(_0x400840,_0x215d38,_0xdb1651){return db[_0x121f('0x46')][_0x121f('0x4f')]({'where':{'id':_0x400840[_0x121f('0x4d')]['id']}})[_0x121f('0x2c')](handleEntityNotFound(_0x215d38,null))[_0x121f('0x2c')](function(_0x4ce968){if(_0x4ce968){return _0x4ce968[_0x121f('0x72')](_0x400840['query'][_0x121f('0x67')]);}})[_0x121f('0x2c')](respondWithStatusCode(_0x215d38,null))['catch'](handleError(_0x215d38,null));};exports[_0x121f('0x73')]=function(_0x3e1b13,_0x160c00){var _0x5ce42e={};if(!_0x3e1b13[_0x121f('0x37')]['section'])throw new Error(_0x121f('0x74'));if(!_0x3e1b13['query']['hasOwnProperty'](_0x121f('0x3e'))){_0x5ce42e[_0x121f('0x25')]=qs[_0x121f('0x25')](_0x3e1b13[_0x121f('0x37')]['limit']);_0x5ce42e[_0x121f('0x23')]=qs[_0x121f('0x23')](_0x3e1b13[_0x121f('0x37')][_0x121f('0x23')]);}return db['UserProfile'][_0x121f('0x4f')]({'where':{'id':_0x3e1b13[_0x121f('0x4d')]['id']}})['then'](function(_0x3e580b){if(!_0x3e580b)throw new Error(_0x121f('0x75')+_0x3e1b13[_0x121f('0x4d')]['id']);return db[_0x121f('0x46')][_0x121f('0x73')](_0x3e1b13);})[_0x121f('0x2c')](respondWithFilteredResult(_0x160c00,_0x5ce42e))['catch'](handleError(_0x160c00,null));};
\ No newline at end of file
+var _0x3365=['../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','count','limit','set','apply','reject','save','then','destroy','error','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','nolimit','where','pick','merge','type','filter','includeAll','include','catch','show','UserProfile','keys','find','create','body','clone','params','get','updatedAt','crudPermissions','omit','sequelize','transaction','findAll','each','autoAssociation','UserProfileResource','sectionId','Resources','UserProfileSection','describe','addSections','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','ids','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5a2517,_0x5d6ef6){var _0x23bfca=function(_0x450a72){while(--_0x450a72){_0x5a2517['push'](_0x5a2517['shift']());}};_0x23bfca(++_0x5d6ef6);}(_0x3365,0x130));var _0x5336=function(_0x460d42,_0x4c4571){_0x460d42=_0x460d42-0x0;var _0x26dc48=_0x3365[_0x460d42];return _0x26dc48;};'use strict';var emlformat=require(_0x5336('0x0'));var rimraf=require(_0x5336('0x1'));var zipdir=require(_0x5336('0x2'));var jsonpatch=require(_0x5336('0x3'));var rp=require(_0x5336('0x4'));var moment=require('moment');var BPromise=require(_0x5336('0x5'));var Mustache=require('mustache');var util=require(_0x5336('0x6'));var path=require(_0x5336('0x7'));var sox=require('sox');var csv=require(_0x5336('0x8'));var ejs=require(_0x5336('0x9'));var fs=require('fs');var fs_extra=require(_0x5336('0xa'));var _=require(_0x5336('0xb'));var squel=require(_0x5336('0xc'));var crypto=require(_0x5336('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5336('0xe'));var toCsv=require(_0x5336('0x8'));var querystring=require(_0x5336('0xf'));var Papa=require('papaparse');var Redis=require(_0x5336('0x10'));var authService=require(_0x5336('0x11'));var qs=require(_0x5336('0x12'));var as=require(_0x5336('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5336('0x14'))('api');var utils=require(_0x5336('0x15'));var config=require(_0x5336('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5336('0x17')]=_[_0x5336('0x18')](config[_0x5336('0x17')],{'host':_0x5336('0x19'),'port':0x18eb});var socket=require(_0x5336('0x1a'))(new Redis(config[_0x5336('0x17')]));require(_0x5336('0x1b'))[_0x5336('0x1c')](socket);function respondWithStatusCode(_0x4875a1,_0x564cc5){_0x564cc5=_0x564cc5||0xcc;return function(_0x16bfaf){if(_0x16bfaf){return _0x4875a1[_0x5336('0x1d')](_0x564cc5);}return _0x4875a1[_0x5336('0x1e')](_0x564cc5)[_0x5336('0x1f')]();};}function respondWithResult(_0x2d549a,_0x3b2af4){_0x3b2af4=_0x3b2af4||0xc8;return function(_0x242836){if(_0x242836){return _0x2d549a[_0x5336('0x1e')](_0x3b2af4)[_0x5336('0x20')](_0x242836);}};}function respondWithFilteredResult(_0x412d7d,_0x54edc3){return function(_0x5b38f6){if(_0x5b38f6){var _0x3b3bd2=typeof _0x54edc3[_0x5336('0x21')]==='undefined'&&typeof _0x54edc3['limit']==='undefined';var _0x106d24=_0x5b38f6[_0x5336('0x22')];var _0x4f792d=_0x3b3bd2?0x0:_0x54edc3[_0x5336('0x21')];var _0x1738f6=_0x3b3bd2?_0x5b38f6['count']:_0x54edc3['offset']+_0x54edc3[_0x5336('0x23')];var _0x48398a;if(_0x1738f6>=_0x106d24){_0x1738f6=_0x106d24;_0x48398a=0xc8;}else{_0x48398a=0xce;}_0x412d7d[_0x5336('0x1e')](_0x48398a);return _0x412d7d[_0x5336('0x24')]('Content-Range',_0x4f792d+'-'+_0x1738f6+'/'+_0x106d24)['json'](_0x5b38f6);}return null;};}function patchUpdates(_0x3e973f){return function(_0x2dfa3e){try{jsonpatch[_0x5336('0x25')](_0x2dfa3e,_0x3e973f,!![]);}catch(_0x3a1a58){return BPromise[_0x5336('0x26')](_0x3a1a58);}return _0x2dfa3e[_0x5336('0x27')]();};}function saveUpdates(_0x5c4d05,_0x443fec){return function(_0x2ab47b){if(_0x2ab47b){return _0x2ab47b['update'](_0x5c4d05)[_0x5336('0x28')](function(_0x17b2cc){return _0x17b2cc;});}return null;};}function removeEntity(_0x183940,_0x26ecea){return function(_0x541734){if(_0x541734){return _0x541734[_0x5336('0x29')]()[_0x5336('0x28')](function(){_0x183940[_0x5336('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e3743,_0x3982c8){return function(_0x5419c0){if(!_0x5419c0){_0x5e3743[_0x5336('0x1d')](0x194);}return _0x5419c0;};}function handleError(_0x256de7,_0x51d985){_0x51d985=_0x51d985||0x1f4;return function(_0x41282a){logger[_0x5336('0x2a')](_0x41282a['stack']);if(_0x41282a['name']){delete _0x41282a[_0x5336('0x2b')];}_0x256de7[_0x5336('0x1e')](_0x51d985)[_0x5336('0x2c')](_0x41282a);};}exports[_0x5336('0x2d')]=function(_0x2b7a2a,_0x5b8207){var _0x1f57ad={},_0x5f59a4={},_0x26f893={'count':0x0,'rows':[]};var _0x420361=_['map'](db['UserProfile'][_0x5336('0x2e')],function(_0x2439bc){return{'name':_0x2439bc[_0x5336('0x2f')],'type':_0x2439bc['type']['key']};});_0x5f59a4[_0x5336('0x30')]=_[_0x5336('0x31')](_0x420361,_0x5336('0x2b'));_0x5f59a4[_0x5336('0x32')]=_['keys'](_0x2b7a2a[_0x5336('0x32')]);_0x5f59a4[_0x5336('0x33')]=_[_0x5336('0x34')](_0x5f59a4[_0x5336('0x30')],_0x5f59a4[_0x5336('0x32')]);_0x1f57ad['attributes']=_['intersection'](_0x5f59a4[_0x5336('0x30')],qs[_0x5336('0x35')](_0x2b7a2a[_0x5336('0x32')][_0x5336('0x35')]));_0x1f57ad['attributes']=_0x1f57ad[_0x5336('0x36')][_0x5336('0x37')]?_0x1f57ad[_0x5336('0x36')]:_0x5f59a4['model'];if(!_0x2b7a2a[_0x5336('0x32')]['hasOwnProperty'](_0x5336('0x38'))){_0x1f57ad[_0x5336('0x23')]=qs[_0x5336('0x23')](_0x2b7a2a[_0x5336('0x32')][_0x5336('0x23')]);_0x1f57ad[_0x5336('0x21')]=qs['offset'](_0x2b7a2a[_0x5336('0x32')][_0x5336('0x21')]);}_0x1f57ad['order']=qs['sort'](_0x2b7a2a['query']['sort']);_0x1f57ad[_0x5336('0x39')]=qs[_0x5336('0x33')](_[_0x5336('0x3a')](_0x2b7a2a[_0x5336('0x32')],_0x5f59a4[_0x5336('0x33')]),_0x420361);if(_0x2b7a2a['query']['filter']){_0x1f57ad[_0x5336('0x39')]=_[_0x5336('0x3b')](_0x1f57ad[_0x5336('0x39')],{'$or':_[_0x5336('0x31')](_0x420361,function(_0x5da79f){if(_0x5da79f[_0x5336('0x3c')]!=='VIRTUAL'){var _0x59c831={};_0x59c831[_0x5da79f[_0x5336('0x2b')]]={'$like':'%'+_0x2b7a2a[_0x5336('0x32')][_0x5336('0x3d')]+'%'};return _0x59c831;}})});}_0x1f57ad=_['merge']({},_0x1f57ad,_0x2b7a2a['options']);var _0x1d98ff={'where':_0x1f57ad['where']};return db['UserProfile'][_0x5336('0x22')](_0x1d98ff)[_0x5336('0x28')](function(_0x2c9ff7){_0x26f893[_0x5336('0x22')]=_0x2c9ff7;if(_0x2b7a2a[_0x5336('0x32')][_0x5336('0x3e')]){_0x1f57ad[_0x5336('0x3f')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x1f57ad);})['then'](function(_0x4821a6){_0x26f893['rows']=_0x4821a6;return _0x26f893;})['then'](respondWithFilteredResult(_0x5b8207,_0x1f57ad))[_0x5336('0x40')](handleError(_0x5b8207,null));};exports[_0x5336('0x41')]=function(_0x1615b9,_0x4f5810){var _0x1c42e9={'raw':![],'where':{'id':_0x1615b9['params']['id']}},_0x40b8ce={};_0x40b8ce[_0x5336('0x30')]=_['keys'](db[_0x5336('0x42')][_0x5336('0x2e')]);_0x40b8ce[_0x5336('0x32')]=_[_0x5336('0x43')](_0x1615b9[_0x5336('0x32')]);_0x40b8ce[_0x5336('0x33')]=_[_0x5336('0x34')](_0x40b8ce[_0x5336('0x30')],_0x40b8ce[_0x5336('0x32')]);_0x1c42e9[_0x5336('0x36')]=_[_0x5336('0x34')](_0x40b8ce[_0x5336('0x30')],qs['fields'](_0x1615b9['query'][_0x5336('0x35')]));_0x1c42e9[_0x5336('0x36')]=_0x1c42e9[_0x5336('0x36')][_0x5336('0x37')]?_0x1c42e9[_0x5336('0x36')]:_0x40b8ce[_0x5336('0x30')];if(_0x1615b9[_0x5336('0x32')][_0x5336('0x3e')]){_0x1c42e9[_0x5336('0x3f')]=[{'all':!![]}];}_0x1c42e9=_[_0x5336('0x3b')]({},_0x1c42e9,_0x1615b9['options']);return db[_0x5336('0x42')][_0x5336('0x44')](_0x1c42e9)['then'](handleEntityNotFound(_0x4f5810,null))['then'](respondWithResult(_0x4f5810,null))['catch'](handleError(_0x4f5810,null));};exports[_0x5336('0x45')]=function(_0x100e6c,_0x27bd59){return db[_0x5336('0x42')][_0x5336('0x45')](_0x100e6c[_0x5336('0x46')],{})[_0x5336('0x28')](respondWithResult(_0x27bd59,0xc9))[_0x5336('0x40')](handleError(_0x27bd59,null));};exports[_0x5336('0x47')]=function(_0x559a09,_0x325809){var _0x36c3ea={'where':{'id':_0x559a09[_0x5336('0x48')]['id']}},_0x1acb78={};_0x1acb78[_0x5336('0x30')]=_[_0x5336('0x43')](db[_0x5336('0x42')][_0x5336('0x2e')]);_0x36c3ea[_0x5336('0x36')]=_[_0x5336('0x34')](_0x1acb78[_0x5336('0x30')],qs['fields'](_0x559a09[_0x5336('0x32')][_0x5336('0x35')]));_0x36c3ea[_0x5336('0x36')]=_0x36c3ea[_0x5336('0x36')]['length']?_0x36c3ea['attributes']:_0x1acb78[_0x5336('0x30')];if(_0x559a09[_0x5336('0x32')][_0x5336('0x3e')]){_0x36c3ea[_0x5336('0x3f')]=[{'all':!![]}];}_0x36c3ea=_[_0x5336('0x3b')]({},_0x36c3ea,_0x559a09['options']);return db[_0x5336('0x42')][_0x5336('0x44')](_0x36c3ea)[_0x5336('0x28')](handleEntityNotFound(_0x325809,null))[_0x5336('0x28')](function(_0x49c381){if(_0x49c381){var _0x15c184=_0x49c381[_0x5336('0x49')]({'plain':!![]});_0x15c184=qs['omit'](_0x15c184,['id','createdAt',_0x5336('0x4a'),_0x5336('0x4b')]);_0x559a09[_0x5336('0x46')]=_[_0x5336('0x4c')](_0x559a09['body'],['id','createdAt',_0x5336('0x4a')]);return db[_0x5336('0x4d')][_0x5336('0x4e')](function(_0x4f2c6a){return db[_0x5336('0x42')][_0x5336('0x45')](_['merge'](_0x15c184,_0x559a09['body']),{'include':_0x559a09['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4f2c6a})['then'](function(_0x7b3b6a){var _0x21a7d7=_0x7b3b6a[_0x5336('0x49')]({'plain':!![]});return db['UserProfileSection'][_0x5336('0x4f')]({'where':{'userProfileId':_0x559a09['params']['id']},'raw':!![]})[_0x5336('0x28')](function(_0x38f813){if(_0x38f813){return BPromise[_0x5336('0x50')](_0x38f813,function(_0x1e4805){return new BPromise(function(_0x3e9e83,_0x3a7e9a){if(_0x1e4805[_0x5336('0x51')]===null||_0x1e4805[_0x5336('0x51')]===0x1)_0x3e9e83(null);return db[_0x5336('0x52')][_0x5336('0x4f')]({'where':{'sectionId':_0x1e4805['id']},'raw':!![]})[_0x5336('0x28')](function(_0x308d05){var _0x311f78=_[_0x5336('0x31')](_0x308d05,function(_0x118c83){return qs[_0x5336('0x4c')](_0x118c83,['id','createdAt','updatedAt',_0x5336('0x53')]);});_0x3e9e83(_0x311f78);})[_0x5336('0x40')](function(_0x232c77){_0x3a7e9a(_0x232c77);});})[_0x5336('0x28')](function(_0x4fcc3d){var _0x3e5cd0=qs['omit'](_0x1e4805,['id','createdAt',_0x5336('0x4a')]);_0x3e5cd0['userProfileId']=_0x21a7d7['id'];if(_0x4fcc3d)_0x3e5cd0[_0x5336('0x54')]=_0x4fcc3d;return _0x3e5cd0;})[_0x5336('0x28')](function(_0x201c49){return db[_0x5336('0x55')][_0x5336('0x45')](_0x201c49,{'include':[{'model':db[_0x5336('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x4f2c6a});});})[_0x5336('0x28')](function(){return _0x21a7d7;});}});});});}})['then'](respondWithResult(_0x325809,0xc9))[_0x5336('0x40')](handleError(_0x325809,null));};exports['update']=function(_0x1b65d4,_0x168b3c){if(_0x1b65d4[_0x5336('0x46')]['id']){delete _0x1b65d4[_0x5336('0x46')]['id'];}return db['UserProfile'][_0x5336('0x44')]({'where':{'id':_0x1b65d4['params']['id']}})[_0x5336('0x28')](handleEntityNotFound(_0x168b3c,null))['then'](saveUpdates(_0x1b65d4[_0x5336('0x46')],null))[_0x5336('0x28')](respondWithResult(_0x168b3c,null))['catch'](handleError(_0x168b3c,null));};exports[_0x5336('0x29')]=function(_0x56bc2e,_0x23ff8e){return db[_0x5336('0x42')][_0x5336('0x44')]({'where':{'id':_0x56bc2e[_0x5336('0x48')]['id']}})[_0x5336('0x28')](handleEntityNotFound(_0x23ff8e,null))[_0x5336('0x28')](removeEntity(_0x23ff8e,null))['catch'](handleError(_0x23ff8e,null));};exports[_0x5336('0x56')]=function(_0x3adb9d,_0x3f03c4){return db['UserProfile'][_0x5336('0x56')]()[_0x5336('0x28')](respondWithResult(_0x3f03c4,null))[_0x5336('0x40')](handleError(_0x3f03c4,null));};exports[_0x5336('0x57')]=function(_0xb9a15e,_0x28c60d){var _0x5b1325=_0xb9a15e[_0x5336('0x46')];return db[_0x5336('0x42')][_0x5336('0x44')]({'where':{'id':_0xb9a15e[_0x5336('0x48')]['id']}})['then'](handleEntityNotFound(_0x28c60d,null))[_0x5336('0x28')](function(_0x24a0a5){if(_0x24a0a5){return db[_0x5336('0x4d')]['transaction'](function(_0x58541f){return db[_0x5336('0x55')][_0x5336('0x29')]({'where':{'userProfileId':_0xb9a15e['params']['id'],'sectionId':_[_0x5336('0x31')](_0x5b1325,function(_0x24aa0b){return _0x24aa0b['sectionId'];})},'transaction':_0x58541f})['then'](function(){var _0x256b8e=_['map'](_0x5b1325,function(_0x3739c0){_0x3739c0['userProfileId']=_0xb9a15e[_0x5336('0x48')]['id'];return _0x3739c0;});var _0xa46eff=[];return BPromise[_0x5336('0x50')](_0x256b8e,function(_0x296379){return db[_0x5336('0x55')][_0x5336('0x45')](_0x296379,{'include':[{'model':db[_0x5336('0x52')],'as':_0x5336('0x54')}],'raw':!![],'transaction':_0x58541f})[_0x5336('0x28')](function(_0x731f3c){_0xa46eff[_0x5336('0x58')](_0x731f3c['get']({'plain':!![]}));});})['then'](function(){return _0xa46eff;});});});}})[_0x5336('0x28')](function(_0x261017){return _0x261017;})[_0x5336('0x28')](respondWithResult(_0x28c60d,null))[_0x5336('0x40')](handleError(_0x28c60d,null));};exports[_0x5336('0x59')]=function(_0x4ea255,_0x2941ab){var _0x1f8d62;return db['UserProfile'][_0x5336('0x44')]({'where':{'id':_0x4ea255['params']['id']},'attributes':['id',_0x5336('0x2b')]})[_0x5336('0x28')](handleEntityNotFound(_0x2941ab,null))[_0x5336('0x28')](function(_0x5165e8){if(_0x5165e8){_0x1f8d62=_0x5165e8;return db[_0x5336('0x55')][_0x5336('0x29')]({'where':{'userProfileId':_0x4ea255[_0x5336('0x48')]['id'],'sectionId':_0x4ea255[_0x5336('0x32')]['ids']}});}})['then'](function(){return _0x1f8d62;})[_0x5336('0x28')](respondWithStatusCode(_0x2941ab,null))[_0x5336('0x40')](handleError(_0x2941ab,null));};exports[_0x5336('0x5a')]=function(_0xf5b098,_0x56b82f){var _0x7c2ecc=[];var _0x33bb30=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xf5b098[_0x5336('0x48')]['id']},'raw':!![]})[_0x5336('0x28')](function(_0x3c4c18){_0x7c2ecc=_[_0x5336('0x3d')](_0x3c4c18,function(_0x4a3fe7){return _0x4a3fe7[_0x5336('0x5b')]===0x1||_[_0x5336('0x5c')]([0x3eb,0x709],_0x4a3fe7[_0x5336('0x53')]);});if(!_[_0x5336('0x5d')](_0x7c2ecc)){return _[_0x5336('0x31')](_0x7c2ecc,function(_0x5fe40c){return _0x5fe40c[_0x5336('0x53')];});}else{return;}})[_0x5336('0x28')](function(_0x329b86){if(_0x329b86)_0x33bb30=_0x329b86;if(_[_0x5336('0x5c')](_0x33bb30,0x64)){var _0x2dc2b1=_['find'](_0x7c2ecc,{'sectionId':0x64});return hasDefaultDashboard(_0x2dc2b1)['then'](function(_0x2271c7){return _['map'](_0x7c2ecc,function(_0x1c59b8){if(_0x1c59b8['sectionId']===0x64){_0x1c59b8[_0x5336('0x5e')]=_0x2271c7;}return _0x1c59b8;});});}else{return;}})['then'](function(_0x36d79e){if(_0x36d79e)_0x7c2ecc=_0x36d79e;if(_[_0x5336('0x5c')](_0x33bb30,0x3eb)){var _0x372139=_[_0x5336('0x44')](_0x7c2ecc,{'sectionId':0x3eb});return getCustomDashboards(_0x372139)['then'](function(_0x39094c){return _[_0x5336('0x31')](_0x7c2ecc,function(_0x288701){if(_0x372139[_0x5336('0x5b')]){if(_0x288701['sectionId']===0x3eb){_0x288701[_0x5336('0x5e')]=_0x39094c;}}else{if(_0x288701[_0x5336('0x53')]===0x64){if(!_0x288701[_0x5336('0x5e')]){_0x288701['subsections']=[];}_0x288701['subsections']=_0x288701[_0x5336('0x5e')]['concat'](_0x39094c);}}return _0x288701;});});}else{return;}})['then'](function(_0x124fd7){if(_0x124fd7)_0x7c2ecc=_0x124fd7;if(_[_0x5336('0x5c')](_0x33bb30,0x709)){var _0x4ad962=_[_0x5336('0x44')](_0x7c2ecc,{'sectionId':0x709});return getPlugins(_0x4ad962)[_0x5336('0x28')](function(_0x4d5949){if(_0x4ad962[_0x5336('0x5b')]){return _[_0x5336('0x31')](_0x7c2ecc,function(_0x53da3d){if(_0x53da3d[_0x5336('0x53')]===0x709){_0x53da3d[_0x5336('0x5e')]=_0x4d5949;}return _0x53da3d;});}else{var _0x2656a2={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4d5949};var _0x45f6d5=_['map'](_0x7c2ecc);_0x45f6d5[_0x5336('0x58')](_0x2656a2);return _0x45f6d5;}});}else{return;}})['then'](function(_0x372666){if(_0x372666)_0x7c2ecc=_0x372666;return _[_0x5336('0x3d')](_0x7c2ecc,[_0x5336('0x5b'),0x1]);})[_0x5336('0x28')](respondWithResult(_0x56b82f,null))[_0x5336('0x40')](handleError(_0x56b82f,null));};function hasDefaultDashboard(_0x3c8165){var _0x4d9e98=[0x65];return new BPromise(function(_0xab4865,_0x703d3f){try{if(_0x3c8165[_0x5336('0x51')]){_0xab4865(_0x4d9e98);}else{return db[_0x5336('0x52')][_0x5336('0x5f')]({'where':{'sectionId':_0x3c8165['id']},'raw':!![]})[_0x5336('0x28')](function(_0x7921f6){_0x7921f6?_0xab4865(_0x4d9e98):_0xab4865();});}}catch(_0x2c2fff){_0x703d3f(_0x2c2fff);}});}function getCustomDashboards(_0x566827){var _0x22b6be=[];return new BPromise(function(_0x5ec5c1,_0x4cb71e){try{if(_0x566827[_0x5336('0x51')]){return db[_0x5336('0x60')][_0x5336('0x4f')]({'raw':!![]})['then'](function(_0x329592){_0x329592['forEach'](function(_0x38f3c1){_0x22b6be[_0x5336('0x58')](_0x38f3c1['id']+0x1869f);});_0x5ec5c1(_0x22b6be);});}else{return db[_0x5336('0x52')]['findAll']({'where':{'sectionId':_0x566827['id']},'raw':!![]})[_0x5336('0x28')](function(_0x246fcc){_0x246fcc[_0x5336('0x61')](function(_0x42c0a6){_0x22b6be[_0x5336('0x58')](_0x42c0a6[_0x5336('0x62')]+0x1869f);});_0x5ec5c1(_0x22b6be);});}}catch(_0x390066){_0x4cb71e(_0x390066);}});}function getPlugins(_0x47d804){var _0x59b1de=[];return new BPromise(function(_0x39d705,_0x78b0d0){try{if(_0x47d804[_0x5336('0x51')]){return db[_0x5336('0x63')]['findAll']({'raw':!![]})[_0x5336('0x28')](function(_0x237f56){_0x237f56[_0x5336('0x61')](function(_0x1bea6d){_0x59b1de[_0x5336('0x58')](_0x1bea6d['id']+0x15b38);});_0x39d705(_0x59b1de);});}else{return db[_0x5336('0x52')][_0x5336('0x4f')]({'where':{'sectionId':_0x47d804['id']},'raw':!![]})[_0x5336('0x28')](function(_0x1d5930){_0x1d5930[_0x5336('0x61')](function(_0x2fc2e1){_0x59b1de[_0x5336('0x58')](_0x2fc2e1['resourceId']+0x15b38);});_0x39d705(_0x59b1de);});}}catch(_0x321088){_0x78b0d0(_0x321088);}});}exports[_0x5336('0x64')]=function(_0x543b08,_0x59fa9b){return db[_0x5336('0x42')][_0x5336('0x44')]({'where':{'id':_0x543b08[_0x5336('0x48')]['id']}})[_0x5336('0x28')](handleEntityNotFound(_0x59fa9b,null))['then'](function(_0x429d45){if(_0x429d45){return db[_0x5336('0x4d')][_0x5336('0x4e')](function(_0x1ca87e){return db['UserProfileSection'][_0x5336('0x4f')]({'where':{'userProfileId':_0x543b08[_0x5336('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x43ac3c){if(_0x43ac3c){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x543b08[_0x5336('0x48')]['id'],'id':_[_0x5336('0x31')](_0x43ac3c,function(_0x2749ed){return _0x2749ed['id'];})},'transaction':_0x1ca87e});}})[_0x5336('0x28')](function(_0x31778a){var _0xfa564d=_[_0x5336('0x31')](_0x543b08[_0x5336('0x46')],function(_0x5dfc84){_0x5dfc84[_0x5336('0x65')]=_0x543b08[_0x5336('0x48')]['id'];return _0x5dfc84;});return db['UserProfileSection'][_0x5336('0x66')](_0xfa564d,{'raw':!![],'transaction':_0x1ca87e});})[_0x5336('0x28')](function(_0x9c7e7d){var _0x29e763=_[_0x5336('0x3d')](_[_0x5336('0x31')](_0x9c7e7d,function(_0x6f676f){return _0x6f676f[_0x5336('0x49')]({'plain':!![]});}),{'includeAll':![]});if(_0x29e763){return db['UserProfileSection'][_0x5336('0x4f')]({'where':{'userProfileId':_0x543b08['params']['id'],'sectionId':_[_0x5336('0x31')](_0x29e763,function(_0x2500ed){return _0x2500ed['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x5336('0x28')](function(_0x2e7483){var _0x5eb8eb=_[_0x5336('0x31')](_0x543b08[_0x5336('0x46')],function(_0x2f68dc){_0x2f68dc['userProfileId']=_0x543b08[_0x5336('0x48')]['id'];return _0x2f68dc;});return db[_0x5336('0x52')][_0x5336('0x66')](_0x5eb8eb,{'raw':!![],'transaction':_0x1ca87e});});}})['catch'](handleError(_0x59fa9b,null));});}})[_0x5336('0x28')](function(_0x321fcd){var _0x5aa53b=_[_0x5336('0x31')](_0x321fcd,function(_0x5c327b){return _0x5c327b[_0x5336('0x49')]({'plain':!![]});});})[_0x5336('0x28')](respondWithResult(_0x59fa9b,null))[_0x5336('0x40')](handleError(_0x59fa9b,null));};exports[_0x5336('0x67')]=function(_0x4d37ed,_0x2dd30a,_0x4c1e81){return db[_0x5336('0x42')][_0x5336('0x44')]({'where':{'id':_0x4d37ed['params']['id']}})[_0x5336('0x28')](handleEntityNotFound(_0x2dd30a,null))['then'](function(_0x503514){if(_0x503514){return _0x503514[_0x5336('0x67')](_0x4d37ed['query'][_0x5336('0x68')]);}})[_0x5336('0x28')](respondWithStatusCode(_0x2dd30a,null))['catch'](handleError(_0x2dd30a,null));};exports['getResources']=function(_0x11eb9f,_0x37ab2d){var _0x566d59={};if(!_0x11eb9f[_0x5336('0x32')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x11eb9f[_0x5336('0x32')][_0x5336('0x69')](_0x5336('0x38'))){_0x566d59['limit']=qs['limit'](_0x11eb9f[_0x5336('0x32')][_0x5336('0x23')]);_0x566d59[_0x5336('0x21')]=qs[_0x5336('0x21')](_0x11eb9f[_0x5336('0x32')][_0x5336('0x21')]);}return db[_0x5336('0x42')][_0x5336('0x44')]({'where':{'id':_0x11eb9f['params']['id']}})[_0x5336('0x28')](function(_0x464cc6){if(!_0x464cc6)throw new Error(_0x5336('0x6a')+_0x11eb9f[_0x5336('0x48')]['id']);return db[_0x5336('0x42')][_0x5336('0x6b')](_0x11eb9f);})['then'](respondWithFilteredResult(_0x37ab2d,_0x566d59))[_0x5336('0x40')](handleError(_0x37ab2d,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4753=['update','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','save'];(function(_0x18b493,_0x1c38c7){var _0x7d9003=function(_0x3760f1){while(--_0x3760f1){_0x18b493['push'](_0x18b493['shift']());}};_0x7d9003(++_0x1c38c7);}(_0x4753,0x1f4));var _0x3475=function(_0x58b575,_0x3d1be9){_0x58b575=_0x58b575-0x0;var _0x38eda5=_0x4753[_0x58b575];return _0x38eda5;};'use strict';var EventEmitter=require(_0x3475('0x0'));var UserProfile=require(_0x3475('0x1'))['db'][_0x3475('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3475('0x3'),'afterUpdate':_0x3475('0x4'),'afterDestroy':'remove'};function emitEvent(_0x212d98){return function(_0x4c6fd2,_0x5a801b,_0x5de37e){UserProfileEvents['emit'](_0x212d98+':'+_0x4c6fd2['id'],_0x4c6fd2);UserProfileEvents[_0x3475('0x5')](_0x212d98,_0x4c6fd2);_0x5de37e(null);};}for(var e in events){if(events[_0x3475('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x3475('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0xee3c=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xee3c,0x14a));var _0xcee3=function(_0x5a6250,_0x54ab68){_0x5a6250=_0x5a6250-0x0;var _0xc5d05f=_0xee3c[_0x5a6250];return _0xc5d05f;};'use strict';var EventEmitter=require(_0xcee3('0x0'));var UserProfile=require(_0xcee3('0x1'))['db'][_0xcee3('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xcee3('0x3')](0x0);var events={'afterCreate':_0xcee3('0x4'),'afterUpdate':_0xcee3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a7681){return function(_0x435892,_0x4cd398,_0x39d2a8){UserProfileEvents[_0xcee3('0x6')](_0x4a7681+':'+_0x435892['id'],_0x435892);UserProfileEvents[_0xcee3('0x6')](_0x4a7681,_0x435892);_0x39d2a8(null);};}for(var e in events){if(events[_0xcee3('0x7')](e)){var event=events[e];UserProfile[_0xcee3('0x8')](e,emitEvent(event));}}module[_0xcee3('0x9')]=UserProfileEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6071=['custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','include','Tags','tag','ThroughTags','color','true','chat','fax','dataValues','./userProfile.attributes','squel','filter','field','value','findAll','associatedResources','model','then','map','resolve','UserProfileResource','AnalyticExtractedReport','toLowerCase','squareprojects','childModel','odbc','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsAccount','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Dashboard','intervals','pauses','sounds','Sound','tags','Tag','templates','Template','Trigger','trunks','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','catch','define','user_profiles','../../components/parsers/qs','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','all','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','reportType','default','DefaultReports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x6071,0xcc));var _0x1607=function(_0x4f0fad,_0x30e150){_0x4f0fad=_0x4f0fad-0x0;var _0x56dda7=_0x6071[_0x4f0fad];return _0x56dda7;};'use strict';var _=require('lodash');var attributes=require(_0x1607('0x0'));var squel=require(_0x1607('0x1'));module['exports']=function(_0x56fa7f){var _0x444a28=_0x56fa7f['models'];function _0x2858e7(_0x51c1d9,_0x49d57f){return new Promise(function(_0x3d78eb,_0x59d03d){if(!_0x49d57f)return _0x3d78eb(null);var _0x5a2441=_0x49d57f[_0x1607('0x2')]?{[_0x49d57f[_0x1607('0x2')][_0x1607('0x3')]]:_0x49d57f[_0x1607('0x2')][_0x1607('0x4')]}:undefined;return _0x444a28[_0x51c1d9][_0x1607('0x5')]({'where':_0x5a2441,'raw':!![]})['then'](function(_0x32aa84){_0x49d57f[_0x1607('0x6')]=_['map'](_0x32aa84,'id');_0x3d78eb(_0x49d57f);})['catch'](function(_0x2efcfc){_0x59d03d(_0x2efcfc);});});}function _0x2e98bf(_0x4abd23,_0x8db80b){return new Promise(function(_0x34a63b,_0x5279ab){var _0x59453c=_0x4abd23[_0x1607('0x2')]?{[_0x4abd23['filter']['field']]:_0x4abd23[_0x1607('0x2')][_0x1607('0x4')]}:undefined;return _0x444a28[_0x4abd23[_0x1607('0x7')]]['findAll']({'where':_0x59453c,'raw':!![]})[_0x1607('0x8')](function(_0x2f9fd6){_0x8db80b[_0x1607('0x6')]=_[_0x1607('0x9')](_0x2f9fd6,function(_0x24b003){return _0x24b003['name'];});_0x34a63b(_0x8db80b);})['catch'](function(_0x4f6ff6){_0x5279ab(_0x4f6ff6);});});}function _0x4f360e(_0x487726,_0x47deff,_0x33d700){if(!_0x47deff)return Promise[_0x1607('0xa')](null);return new Promise(function(_0x301c12,_0x8656e){return _0x444a28[_0x1607('0xb')][_0x1607('0x5')]({'where':{'sectionId':_0x47deff['id']},'raw':!![]})[_0x1607('0x8')](function(_0x1b48a1){if(_0x487726[_0x1607('0x3')]&&_0x487726['field']!=='id'){_0x47deff[_0x1607('0x6')]=_[_0x1607('0x9')](_0x1b48a1,function(_0x58a2a4){return _0x58a2a4[_0x487726[_0x1607('0x3')]];});}else{if(_0x33d700===_0x1607('0xc')){_0x47deff[_0x1607('0x6')]=_['map'](_0x1b48a1,function(_0x4b0e70){return{'id':_0x4b0e70['resourceId'],'type':_0x4b0e70['type']};});}else{_0x47deff[_0x1607('0x6')]=_[_0x1607('0x9')](_0x1b48a1,function(_0x26f8eb){return _0x26f8eb['resourceId'];});}}_0x301c12(_0x47deff);})['catch'](function(_0x388920){_0x8656e(_0x388920);});});}function _0x254b2f(_0x354c67,_0x8de1fd){var _0x1a0376={'parentSections':[]};switch(_0x354c67[_0x1607('0xd')]()){case _0x1607('0xe'):_0x1a0376[_0x1607('0xf')]='SquareProject';break;case _0x1607('0x10'):_0x1a0376['childModel']='SquareOdbc';break;case'squarerecordings':_0x1a0376[_0x1607('0xf')]=_0x1607('0x11');_0x1a0376[_0x1607('0x12')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x1607('0x13')}];break;case _0x1607('0x14'):_0x1a0376['childModel']=_0x1607('0x15');break;case _0x1607('0x16'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x17');_0x1a0376['parentSections']=[{'name':_0x1607('0x18'),'field':'id','foreignKey':'ListId'}];break;case _0x1607('0x19'):_0x1a0376['childModel']=_0x1607('0x1a');break;case _0x1607('0x1b'):_0x1a0376['childModel']=_0x1607('0x1c');break;case _0x1607('0x1d'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x1e');break;case _0x1607('0x1f'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x20');break;case _0x1607('0x21'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x22');break;case'faxqueues':_0x1a0376[_0x1607('0xf')]=_0x1607('0x23');break;case _0x1607('0x24'):_0x1a0376['childModel']=_0x1607('0x25');break;case'inboundroutes':case _0x1607('0x26'):case _0x1607('0x27'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x28');break;case'contexts':_0x1a0376[_0x1607('0xf')]=_0x1607('0x29');break;case _0x1607('0x2a'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x2b');break;case _0x1607('0x2c'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x2d');_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x2e'),'field':_0x1607('0x2f'),'foreignKey':_0x1607('0x30'),'model':_0x1607('0x31'),'filter':{'field':_0x1607('0x32'),'value':[_0x1607('0x33')]}},{'name':_0x1607('0x34'),'field':'name','foreignKey':_0x1607('0x30'),'model':'User','filter':{'field':_0x1607('0x32'),'value':[_0x1607('0x35')]}},{'name':_0x1607('0x36'),'field':'name','foreignKey':_0x1607('0x37'),'model':_0x1607('0x38'),'filter':{'field':_0x1607('0x39'),'value':[_0x1607('0x3a')]}},{'name':_0x1607('0x3b'),'field':'name','foreignKey':_0x1607('0x37'),'model':_0x1607('0x38'),'filter':{'field':_0x1607('0x39'),'value':['outbound']}}];break;case'musiconholds':_0x1a0376[_0x1607('0xf')]=_0x1607('0x3c');break;case _0x1607('0x3d'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x3e');break;case'voiceprefixes':_0x1a0376[_0x1607('0xf')]=_0x1607('0x3f');break;case _0x1607('0x40'):_0x1a0376['childModel']=_0x1607('0x41');break;case _0x1607('0x42'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x43');break;case _0x1607('0x44'):_0x1a0376[_0x1607('0xf')]='MailAccount';break;case _0x1607('0x45'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x46');break;case _0x1607('0x47'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x48');break;case _0x1607('0x49'):_0x1a0376['childModel']=_0x1607('0x4a');break;case'smsqueues':_0x1a0376[_0x1607('0xf')]='SmsQueue';break;case'smsaccounts':_0x1a0376[_0x1607('0xf')]=_0x1607('0x4b');break;case'whatsappqueues':_0x1a0376[_0x1607('0xf')]=_0x1607('0x4c');break;case _0x1607('0x4d'):_0x1a0376['childModel']='WhatsappAccount';break;case'teams':_0x1a0376[_0x1607('0xf')]=_0x1607('0x4e');break;case _0x1607('0x4f'):case _0x1607('0x50'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x38');if(_0x8de1fd){_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x36')},{'name':_0x1607('0x3b')}];}break;case _0x1607('0x51'):case _0x1607('0x52'):case _0x1607('0x53'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x31');if(_0x8de1fd){_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x54'),'filter':{'field':'role','value':[_0x1607('0x55'),'user']},'ignore':!![]},{'name':_0x1607('0x2e')},{'name':_0x1607('0x34')}];}break;case _0x1607('0x56'):_0x1a0376['childModel']=_0x1607('0x57');break;case _0x1607('0x58'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x59');break;case _0x1607('0x5a'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x5b');break;case _0x1607('0x5c'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x5d');break;case _0x1607('0x5e'):_0x1a0376['childModel']=_0x1607('0x5f');break;case _0x1607('0x60'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x61');break;case _0x1607('0x62'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x31');break;case _0x1607('0x63'):_0x1a0376[_0x1607('0xf')]='CannedAnswer';break;case _0x1607('0x64'):_0x1a0376['childModel']='Disposition';break;case'customdashboards':_0x1a0376[_0x1607('0xf')]=_0x1607('0x65');break;case _0x1607('0x66'):_0x1a0376['childModel']='Interval';break;case _0x1607('0x67'):_0x1a0376['childModel']='Pause';break;case'scheduler':_0x1a0376[_0x1607('0xf')]='Schedule';break;case _0x1607('0x68'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x69');break;case _0x1607('0x6a'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x6b');break;case _0x1607('0x6c'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x6d');break;case'triggers':_0x1a0376[_0x1607('0xf')]=_0x1607('0x6e');break;case _0x1607('0x6f'):_0x1a0376[_0x1607('0xf')]='Trunk';break;case'variables':_0x1a0376[_0x1607('0xf')]=_0x1607('0x70');break;case _0x1607('0x71'):_0x1a0376[_0x1607('0xf')]=_0x1607('0x72');break;case _0x1607('0x73'):_0x1a0376[_0x1607('0xf')]=_0x1607('0xc');_0x1a0376[_0x1607('0x12')]=[{'name':_0x1607('0x74'),'field':'id','foreignKey':_0x1607('0x75')}];break;case'metrics':_0x1a0376[_0x1607('0xf')]=_0x1607('0x76');break;}return _0x1a0376;}function _0x49672b(_0x3282b9,_0x138be6){var _0x37501a=_0x3282b9['charAt'](0x0)[_0x1607('0x77')]()+_0x3282b9[_0x1607('0x78')](0x1);var _0x2d0bcc={'type':_0x444a28['Sequelize']['QueryTypes'][_0x1607('0x79')],'raw':!![]};return new Promise(function(_0x5567bf,_0x56acf8){var _0x48da74=squel[_0x1607('0x7a')]()['field'](_0x1607('0x7b')+_0x37501a+_0x1607('0x7c'),'id')[_0x1607('0x3')](_0x1607('0x7d'))['from'](_0x1607('0x7e')+_0x3282b9+_0x1607('0x7f'),'ui')[_0x1607('0x80')](_0x1607('0x81'),_0x138be6['id']);return _0x444a28[_0x1607('0x82')][_0x1607('0x83')](_0x48da74[_0x1607('0x84')](),_0x2d0bcc)[_0x1607('0x8')](function(_0x5f1247){_0x138be6[_0x37501a+_0x1607('0x85')]=_0x5f1247;_0x5567bf(_0x5f1247);})[_0x1607('0x86')](function(_0x39a04f){_0x56acf8(_0x39a04f);});});}return _0x56fa7f[_0x1607('0x87')]('UserProfile',attributes,{'tableName':_0x1607('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xd85232){var _0x4b5ef2=require(_0x1607('0x89'));var _0xecbd72={'raw':_0xd85232[_0x1607('0x83')][_0x1607('0x8a')],'where':{}};var _0x5c8a27={};var _0x21f629={'count':0x0,'rows':[]};var _0x59975b=_0xd85232[_0x1607('0x83')]['section'];var _0x2448c9=_0xd85232[_0x1607('0x83')][_0x1607('0x8b')]||![];var _0x4dccaf=_0x254b2f(_0x59975b,_0x2448c9);if(!_0x4dccaf[_0x1607('0xf')])throw new Error(_0x1607('0x8c')+_0x59975b+'\x27');var _0x31453b=[{'name':_0x59975b}];if(!_[_0x1607('0x8d')](_0x4dccaf[_0x1607('0x12')]))_0x31453b=_0x4dccaf[_0x1607('0x12')];var _0x5a6c77=[];for(var _0x48134e=0x0;_0x48134e<_0x31453b['length'];_0x48134e++){_0x5a6c77['push'](_0x444a28[_0x1607('0x8e')][_0x1607('0x8f')]({'where':{'userProfileId':_0xd85232[_0x1607('0x90')]['id'],'name':_0x31453b[_0x48134e]['name']},'raw':!![]}));}return Promise['all'](_0x5a6c77)[_0x1607('0x8')](function(_0x550274){var _0x5b2fd5=_[_0x1607('0x2')](_0x550274,function(_0x5af897){return _0x5af897?_0x5af897:undefined;});var _0x3bc861=_[_0x1607('0x2')](_0x31453b,[_0x1607('0x91'),!![]]);var _0x3aa6f8=_[_0x1607('0x8d')](_0x5b2fd5)&&_[_0x1607('0x8d')](_0x3bc861)?null:_[_0x1607('0x92')](_0x3bc861,_0x5b2fd5);if(!_0x3aa6f8)return null;var _0x214124=[];for(var _0x17ac9e=0x0;_0x17ac9e<_0x3aa6f8[_0x1607('0x93')];_0x17ac9e++){var _0xfbc36f=_[_0x1607('0x8f')](_0x31453b,function(_0x3bcf4a){return _0x3aa6f8[_0x17ac9e]?_0x3bcf4a['name']===_0x3aa6f8[_0x17ac9e][_0x1607('0x2f')]:null;});if(_0xfbc36f){if(_0x3aa6f8[_0x17ac9e][_0x1607('0x91')]){_0x214124[_0x1607('0x94')](_0x2858e7(_0x4dccaf[_0x1607('0xf')],_0x3aa6f8[_0x17ac9e]));}else{if(!_0x3aa6f8[_0x17ac9e][_0x1607('0x95')]){_0x214124[_0x1607('0x94')](_0x4f360e(_0xfbc36f,_0x3aa6f8[_0x17ac9e],_0x4dccaf['childModel']));}else{if(_0xfbc36f[_0x1607('0x7')]){_0x214124['push'](_0x2e98bf(_0xfbc36f,_0x3aa6f8[_0x17ac9e]));}}}}}return Promise[_0x1607('0x96')](_0x214124);})[_0x1607('0x8')](function(_0x1600fa){var _0x1a4071=_0x1600fa;var _0x4d0f13=null;if(_0x1a4071){_0x4d0f13=_0x1a4071[_0x1607('0x93')]===0x1?_0x1a4071[0x0]:null;}if(!_0x4d0f13&&!_0x1a4071)return _0x21f629;var _0x56ef9b=_0x444a28[_0x4dccaf[_0x1607('0xf')]]['rawAttributes'];_0x5c8a27['model']=_[_0x1607('0x97')](_0x56ef9b);_0x5c8a27[_0x1607('0x83')]=_[_0x1607('0x97')](_0xd85232[_0x1607('0x83')]);_0x5c8a27[_0x1607('0x98')]=_[_0x1607('0x99')](_0x5c8a27[_0x1607('0x7')],_0x5c8a27[_0x1607('0x83')]);_0xecbd72[_0x1607('0x9a')]=_[_0x1607('0x99')](_0x5c8a27[_0x1607('0x7')],_0x4b5ef2[_0x1607('0x9b')](_0xd85232[_0x1607('0x83')][_0x1607('0x9b')]));_0xecbd72[_0x1607('0x9a')]=_0xecbd72[_0x1607('0x9a')]['length']?_0xecbd72[_0x1607('0x9a')]:_0x5c8a27[_0x1607('0x7')];if(!_0xd85232[_0x1607('0x83')][_0x1607('0x9c')](_0x1607('0x9d'))){_0xecbd72[_0x1607('0x9e')]=_0x4b5ef2[_0x1607('0x9e')](_0xd85232[_0x1607('0x83')][_0x1607('0x9e')]);_0xecbd72[_0x1607('0x9f')]=_0x4b5ef2[_0x1607('0x9f')](_0xd85232['query'][_0x1607('0x9f')]);}_0xecbd72['order']=_0x4b5ef2[_0x1607('0xa0')](_0xd85232[_0x1607('0x83')][_0x1607('0xa0')]);_0xecbd72[_0x1607('0x80')]=_0x4b5ef2[_0x1607('0x98')](_[_0x1607('0xa1')](_0xd85232[_0x1607('0x83')],_0x5c8a27[_0x1607('0x98')]));if(_0xd85232[_0x1607('0x83')][_0x1607('0x2')]){_0xecbd72[_0x1607('0x80')]=_[_0x1607('0xa2')](_0xecbd72[_0x1607('0x80')],{'$or':_['map'](_0x56ef9b,function(_0x11999a){if(_0x11999a['type'][_0x1607('0xa3')]!==_0x1607('0xa4')){var _0x389a0d={};_0x389a0d[_0x11999a['field']]={'$like':'%'+_0xd85232[_0x1607('0x83')][_0x1607('0x2')]+'%'};return _0x389a0d;}})});}var _0x52d0cf=[];var _0x5b2736=null;var _0x3bcd14={};if(_0x4d0f13){_0x5b2736=_[_0x1607('0x8f')](_0x31453b,['name',_0x4d0f13['name']]);if(_0x5b2736[_0x1607('0x3')]){_0x3bcd14={};if(_0x4dccaf['childModel']===_0x1607('0xc')){_0x3bcd14[_0x5b2736[_0x1607('0xa5')]]=_[_0x1607('0x9')](_0x4d0f13[_0x1607('0x6')],'id');}else{_0x3bcd14[_0x5b2736['foreignKey']]=_0x4d0f13[_0x1607('0x6')];}_0x52d0cf[_0x1607('0x94')](_0x3bcd14);}else{_0xecbd72[_0x1607('0x80')]['id']=_0x4d0f13[_0x1607('0x6')];}}else{for(var _0x712418=0x0;_0x712418<_0x1a4071[_0x1607('0x93')];_0x712418++){_0x5b2736=_[_0x1607('0x8f')](_0x31453b,[_0x1607('0x2f'),_0x1a4071[_0x712418][_0x1607('0x2f')]]);if(_0x5b2736['field']){_0x3bcd14={};_0x3bcd14[_0x5b2736[_0x1607('0xa5')]]=_0x1a4071[_0x712418]['associatedResources'];_0x52d0cf[_0x1607('0x94')](_0x3bcd14);}else{if(!_0xecbd72[_0x1607('0x80')]['id'])_0xecbd72[_0x1607('0x80')]['id']=[];_0x1a4071[_0x712418][_0x1607('0x6')][_0x1607('0xa6')](function(_0x5862a2){_0xecbd72[_0x1607('0x80')]['id'][_0x1607('0x94')](_0x5862a2);});}}}if(!_[_0x1607('0x8d')](_0x52d0cf)){_0xecbd72[_0x1607('0x80')]=_['merge'](_0xecbd72[_0x1607('0x80')],{'$and':{'$or':_0x52d0cf}});}_0xecbd72=_[_0x1607('0xa2')]({},_0xecbd72,_0xd85232['options']);if(_0x4d0f13&&!_0x4d0f13[_0x1607('0x95')]&&_0x4dccaf['childModel']===_0x1607('0xc')){if(_0xd85232['query']['includeAll']){_0xecbd72['include']=[{'all':!![]}];}return _0x444a28[_0x4dccaf[_0x1607('0xf')]][_0x1607('0x5')](_0xecbd72)[_0x1607('0x8')](function(_0x3e584f){var _0x126028=[];_0x3e584f[_0x1607('0xa6')](function(_0x562128){var _0x335c58;switch(_0x562128[_0x1607('0xa7')]){case _0x1607('0xa8'):_0x335c58=_[_0x1607('0x8f')](_0x4d0f13[_0x1607('0x6')],function(_0x3c495b){return _0x3c495b['id']===_0x562128[_0x1607('0x75')]&&_0x3c495b['type']===_0x1607('0xa9');});break;case _0x1607('0xaa'):_0x335c58=_[_0x1607('0x8f')](_0x4d0f13[_0x1607('0x6')],function(_0x9a8e96){return _0x9a8e96['id']===_0x562128[_0x1607('0x75')]&&_0x9a8e96[_0x1607('0x39')]===_0x1607('0xab');});break;}if(_0x335c58)_0x126028[_0x1607('0x94')](_0x562128);});_0x21f629[_0x1607('0xac')]=_0x126028['length'];_0x21f629[_0x1607('0xad')]=_0x126028;return _0x21f629;});}else{if(!_[_0x1607('0x8d')](_0xd85232[_0x1607('0x83')]['ids'])){_0xecbd72[_0x1607('0x80')]['id']=_0xecbd72['where']['id']?_[_0x1607('0x99')](_0xecbd72[_0x1607('0x80')]['id'],_0xd85232[_0x1607('0x83')]['ids']):_0xd85232['query'][_0x1607('0xae')];if(_0xd85232['query'][_0x1607('0xaf')]){_0xecbd72[_0x1607('0xb0')]=_0xd85232['query'][_0x1607('0xaf')];}}if(_0xd85232[_0x1607('0x83')][_0x1607('0xb1')]){_0xecbd72[_0x1607('0x80')]=_[_0x1607('0xa2')](_0xecbd72[_0x1607('0x80')],{'$and':_0xd85232[_0x1607('0x83')]['extraQueryConditions']});}return _0x444a28[_0x4dccaf['childModel']]['count']({'where':_0xecbd72['where']})['then'](function(_0x262375){_0x21f629[_0x1607('0xac')]=_0x262375;if(_0xd85232['query']['includeAll']){if(_0x4dccaf[_0x1607('0xf')]==='CmContact'){_0xecbd72[_0x1607('0xb2')]=[{'model':_0x444a28[_0x1607('0x6b')],'as':_0x1607('0xb3'),'attributes':['id',_0x1607('0x2f'),'color'],'required':_0xd85232['query'][_0x1607('0xb4')]?!![]:![]},{'model':_0x444a28[_0x1607('0x6b')],'as':_0x1607('0xb5'),'attributes':['id','name',_0x1607('0xb6')],'through':_0xd85232[_0x1607('0x83')][_0x1607('0xb4')]?{'attributes':[],'where':{'TagId':_0xd85232[_0x1607('0x83')]['tag']||undefined}}:{},'required':_0xd85232['query'][_0x1607('0xb4')]?!![]:![]}];}else{_0xecbd72[_0x1607('0xb2')]=[{'all':!![]}];}}return _0x444a28[_0x4dccaf[_0x1607('0xf')]][_0x1607('0x5')](_0xecbd72);})[_0x1607('0x8')](function(_0x281f91){_0x21f629[_0x1607('0xad')]=_0x281f91;if(_0x59975b===_0x1607('0x2e')&&_0xd85232[_0x1607('0x83')]['openTabs']===_0x1607('0xb7')){var _0x9c32ac=[];for(var _0x160b57=0x0;_0x160b57<_0x21f629['rows'][_0x1607('0x93')];_0x160b57++){_0x9c32ac[_0x1607('0x94')](_0x49672b(_0x1607('0xb8'),_0x21f629['rows'][_0x160b57]['dataValues']));_0x9c32ac[_0x1607('0x94')](_0x49672b('sms',_0x21f629[_0x1607('0xad')][_0x160b57]['dataValues']));_0x9c32ac[_0x1607('0x94')](_0x49672b(_0x1607('0xb9'),_0x21f629[_0x1607('0xad')][_0x160b57][_0x1607('0xba')]));_0x9c32ac[_0x1607('0x94')](_0x49672b('mail',_0x21f629[_0x1607('0xad')][_0x160b57]['dataValues']));_0x9c32ac['push'](_0x49672b('openchannel',_0x21f629[_0x1607('0xad')][_0x160b57][_0x1607('0xba')]));_0x9c32ac['push'](_0x49672b('whatsapp',_0x21f629[_0x1607('0xad')][_0x160b57]['dataValues']));}return Promise[_0x1607('0x96')](_0x9c32ac)[_0x1607('0x8')](function(){return _0x21f629;});}return _0x21f629;});}});}}});};
\ No newline at end of file
+var _0x78e1=['odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailSubstatus','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','Sound','tags','Tag','templates','triggers','Trigger','trunks','variables','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','raw','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','autoAssociation','rawAttributes','keys','attributes','intersection','fields','nolimit','limit','offset','order','sort','where','filters','VIRTUAL','foreignKey','merge','includeAll','include','forEach','reportType','DefaultReports','custom','reportId','CustomReports','ids','customSorting','extraQueryConditions','count','color','tag','ThroughTags','rows','openTabs','dataValues','sms','fax','mail','lodash','./userProfile.attributes','squel','exports','models','filter','field','findAll','then','associatedResources','map','value','model','name','catch','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x78e1,0x9d));var _0x178e=function(_0x3215b5,_0x2f4c73){_0x3215b5=_0x3215b5-0x0;var _0x6d71d0=_0x78e1[_0x3215b5];return _0x6d71d0;};'use strict';var _=require(_0x178e('0x0'));var attributes=require(_0x178e('0x1'));var squel=require(_0x178e('0x2'));module[_0x178e('0x3')]=function(_0x73e087){var _0x41af3d=_0x73e087[_0x178e('0x4')];function _0x426810(_0xab5a38,_0x339cce){return new Promise(function(_0x56c89b,_0x4a3409){if(!_0x339cce)return _0x56c89b(null);var _0x5bb29c=_0x339cce[_0x178e('0x5')]?{[_0x339cce[_0x178e('0x5')][_0x178e('0x6')]]:_0x339cce['filter']['value']}:undefined;return _0x41af3d[_0xab5a38][_0x178e('0x7')]({'where':_0x5bb29c,'raw':!![]})[_0x178e('0x8')](function(_0x4e4f1a){_0x339cce[_0x178e('0x9')]=_[_0x178e('0xa')](_0x4e4f1a,'id');_0x56c89b(_0x339cce);})['catch'](function(_0x5f5911){_0x4a3409(_0x5f5911);});});}function _0x3ac442(_0x199cf1,_0x298467){return new Promise(function(_0x43504b,_0x3e4b8d){var _0x41ef69=_0x199cf1[_0x178e('0x5')]?{[_0x199cf1[_0x178e('0x5')][_0x178e('0x6')]]:_0x199cf1[_0x178e('0x5')][_0x178e('0xb')]}:undefined;return _0x41af3d[_0x199cf1[_0x178e('0xc')]][_0x178e('0x7')]({'where':_0x41ef69,'raw':!![]})[_0x178e('0x8')](function(_0x5cc312){_0x298467[_0x178e('0x9')]=_[_0x178e('0xa')](_0x5cc312,function(_0x398ac8){return _0x398ac8[_0x178e('0xd')];});_0x43504b(_0x298467);})[_0x178e('0xe')](function(_0x5041b8){_0x3e4b8d(_0x5041b8);});});}function _0x296a1d(_0x8ca7b4,_0x2166ee,_0x1897c6){if(!_0x2166ee)return Promise['resolve'](null);return new Promise(function(_0x3a0d0f,_0x2be7b2){return _0x41af3d[_0x178e('0xf')][_0x178e('0x7')]({'where':{'sectionId':_0x2166ee['id']},'raw':!![]})[_0x178e('0x8')](function(_0xaf6a2f){if(_0x8ca7b4[_0x178e('0x6')]&&_0x8ca7b4[_0x178e('0x6')]!=='id'){_0x2166ee[_0x178e('0x9')]=_['map'](_0xaf6a2f,function(_0x1dc79c){return _0x1dc79c[_0x8ca7b4[_0x178e('0x6')]];});}else{if(_0x1897c6===_0x178e('0x10')){_0x2166ee[_0x178e('0x9')]=_[_0x178e('0xa')](_0xaf6a2f,function(_0x1c736d){return{'id':_0x1c736d[_0x178e('0x11')],'type':_0x1c736d[_0x178e('0x12')]};});}else{_0x2166ee[_0x178e('0x9')]=_[_0x178e('0xa')](_0xaf6a2f,function(_0x56ebcd){return _0x56ebcd[_0x178e('0x11')];});}}_0x3a0d0f(_0x2166ee);})[_0x178e('0xe')](function(_0x4af0a2){_0x2be7b2(_0x4af0a2);});});}function _0x40b7c5(_0x5d6c16,_0x257ff7){var _0x343e04={'parentSections':[]};switch(_0x5d6c16[_0x178e('0x13')]()){case _0x178e('0x14'):_0x343e04[_0x178e('0x15')]=_0x178e('0x16');break;case _0x178e('0x17'):_0x343e04['childModel']=_0x178e('0x18');break;case _0x178e('0x19'):_0x343e04[_0x178e('0x15')]=_0x178e('0x1a');_0x343e04['parentSections']=[{'name':_0x178e('0x1b'),'field':_0x178e('0xd'),'foreignKey':_0x178e('0x1c')}];break;case _0x178e('0x1d'):_0x343e04[_0x178e('0x15')]='JscriptyProject';break;case _0x178e('0x1e'):_0x343e04['childModel']=_0x178e('0x1f');_0x343e04[_0x178e('0x20')]=[{'name':_0x178e('0x21'),'field':'id','foreignKey':_0x178e('0x22')}];break;case _0x178e('0x23'):_0x343e04['childModel']=_0x178e('0x24');break;case'companies':_0x343e04[_0x178e('0x15')]='CmCompany';break;case _0x178e('0x25'):_0x343e04[_0x178e('0x15')]=_0x178e('0x26');break;case _0x178e('0x27'):_0x343e04[_0x178e('0x15')]=_0x178e('0x28');break;case'chatwebsites':_0x343e04[_0x178e('0x15')]='ChatWebsite';break;case'faxqueues':_0x343e04[_0x178e('0x15')]=_0x178e('0x29');break;case _0x178e('0x2a'):_0x343e04[_0x178e('0x15')]='FaxAccount';break;case _0x178e('0x2b'):case _0x178e('0x2c'):case _0x178e('0x2d'):_0x343e04[_0x178e('0x15')]=_0x178e('0x2e');break;case _0x178e('0x2f'):_0x343e04[_0x178e('0x15')]=_0x178e('0x30');break;case _0x178e('0x31'):_0x343e04[_0x178e('0x15')]=_0x178e('0x32');break;case _0x178e('0x33'):_0x343e04[_0x178e('0x15')]=_0x178e('0x34');_0x343e04[_0x178e('0x20')]=[{'name':_0x178e('0x35'),'field':_0x178e('0xd'),'foreignKey':'membername','model':_0x178e('0x36'),'filter':{'field':_0x178e('0x37'),'value':[_0x178e('0x38')]}},{'name':_0x178e('0x39'),'field':_0x178e('0xd'),'foreignKey':_0x178e('0x3a'),'model':_0x178e('0x36'),'filter':{'field':'role','value':['telephone']}},{'name':_0x178e('0x3b'),'field':_0x178e('0xd'),'foreignKey':_0x178e('0x3c'),'model':_0x178e('0x3d'),'filter':{'field':_0x178e('0x12'),'value':[_0x178e('0x3e')]}},{'name':'QueueCampaigns','field':_0x178e('0xd'),'foreignKey':_0x178e('0x3c'),'model':_0x178e('0x3d'),'filter':{'field':'type','value':[_0x178e('0x3f')]}}];break;case _0x178e('0x40'):_0x343e04[_0x178e('0x15')]='VoiceMusicOnHold';break;case _0x178e('0x41'):_0x343e04[_0x178e('0x15')]=_0x178e('0x42');break;case _0x178e('0x43'):_0x343e04[_0x178e('0x15')]=_0x178e('0x44');break;case _0x178e('0x45'):_0x343e04[_0x178e('0x15')]=_0x178e('0x46');break;case'mailqueues':_0x343e04[_0x178e('0x15')]='MailQueue';break;case'mailaccounts':_0x343e04[_0x178e('0x15')]='MailAccount';break;case'mailsubstatuses':_0x343e04[_0x178e('0x15')]=_0x178e('0x47');break;case'openchannelqueues':_0x343e04[_0x178e('0x15')]=_0x178e('0x48');break;case _0x178e('0x49'):_0x343e04['childModel']='OpenchannelAccount';break;case'smsqueues':_0x343e04[_0x178e('0x15')]=_0x178e('0x4a');break;case _0x178e('0x4b'):_0x343e04['childModel']='SmsAccount';break;case _0x178e('0x4c'):_0x343e04['childModel']=_0x178e('0x4d');break;case _0x178e('0x4e'):_0x343e04[_0x178e('0x15')]='WhatsappAccount';break;case _0x178e('0x4f'):_0x343e04[_0x178e('0x15')]=_0x178e('0x50');break;case _0x178e('0x51'):case _0x178e('0x52'):_0x343e04['childModel']='VoiceQueue';if(_0x257ff7){_0x343e04[_0x178e('0x20')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x178e('0x53'):case _0x178e('0x54'):case _0x178e('0x55'):_0x343e04[_0x178e('0x15')]=_0x178e('0x36');if(_0x257ff7){_0x343e04[_0x178e('0x20')]=[{'name':_0x178e('0x56'),'filter':{'field':_0x178e('0x37'),'value':[_0x178e('0x57'),_0x178e('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':_0x178e('0x39')}];}break;case _0x178e('0x59'):_0x343e04['childModel']='ZendeskAccount';break;case _0x178e('0x5a'):_0x343e04[_0x178e('0x15')]=_0x178e('0x5b');break;case _0x178e('0x5c'):_0x343e04[_0x178e('0x15')]=_0x178e('0x5d');break;case'sugarcrmaccounts':_0x343e04[_0x178e('0x15')]='SugarcrmAccount';break;case _0x178e('0x5e'):_0x343e04['childModel']='DeskAccount';break;case'zohoaccounts':_0x343e04[_0x178e('0x15')]=_0x178e('0x5f');break;case _0x178e('0x60'):_0x343e04[_0x178e('0x15')]=_0x178e('0x36');break;case'cannedanswers':_0x343e04['childModel']=_0x178e('0x61');break;case _0x178e('0x62'):_0x343e04[_0x178e('0x15')]=_0x178e('0x63');break;case _0x178e('0x64'):_0x343e04[_0x178e('0x15')]='Dashboard';break;case _0x178e('0x65'):_0x343e04[_0x178e('0x15')]=_0x178e('0x66');break;case _0x178e('0x67'):_0x343e04[_0x178e('0x15')]='Pause';break;case _0x178e('0x68'):_0x343e04[_0x178e('0x15')]=_0x178e('0x69');break;case'sounds':_0x343e04[_0x178e('0x15')]=_0x178e('0x6a');break;case _0x178e('0x6b'):_0x343e04[_0x178e('0x15')]=_0x178e('0x6c');break;case _0x178e('0x6d'):_0x343e04[_0x178e('0x15')]='Template';break;case _0x178e('0x6e'):_0x343e04['childModel']=_0x178e('0x6f');break;case _0x178e('0x70'):_0x343e04[_0x178e('0x15')]='Trunk';break;case _0x178e('0x71'):_0x343e04['childModel']='Variable';break;case'plugins':_0x343e04[_0x178e('0x15')]=_0x178e('0x72');break;case _0x178e('0x73'):_0x343e04['childModel']=_0x178e('0x10');_0x343e04['parentSections']=[{'name':_0x178e('0x74'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x343e04[_0x178e('0x15')]=_0x178e('0x75');break;}return _0x343e04;}function _0x38a22a(_0x3abd7d,_0x1137af){var _0xe6569a=_0x3abd7d[_0x178e('0x76')](0x0)[_0x178e('0x77')]()+_0x3abd7d[_0x178e('0x78')](0x1);var _0x15afe0={'type':_0x41af3d[_0x178e('0x79')]['QueryTypes'][_0x178e('0x7a')],'raw':!![]};return new Promise(function(_0x49751e,_0x5c3b81){var _0x46f437=squel['select']()[_0x178e('0x6')]('ui.'+_0xe6569a+'InteractionId','id')['field']('ui.createdAt')[_0x178e('0x7b')](_0x178e('0x7c')+_0x3abd7d+'_interactions','ui')['where'](_0x178e('0x7d'),_0x1137af['id']);return _0x41af3d[_0x178e('0x7e')][_0x178e('0x7f')](_0x46f437[_0x178e('0x80')](),_0x15afe0)[_0x178e('0x8')](function(_0x41db0b){_0x1137af[_0xe6569a+_0x178e('0x81')]=_0x41db0b;_0x49751e(_0x41db0b);})[_0x178e('0xe')](function(_0x41eb41){_0x5c3b81(_0x41eb41);});});}return _0x73e087[_0x178e('0x82')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x455e9e){var _0x909614=require('../../components/parsers/qs');var _0x17a66c={'raw':_0x455e9e[_0x178e('0x7f')][_0x178e('0x83')],'where':{}};var _0x5f3513={};var _0x22dbd6={'count':0x0,'rows':[]};var _0x11e788=_0x455e9e[_0x178e('0x7f')][_0x178e('0x84')];var _0x5df692=_0x455e9e[_0x178e('0x7f')]['mergeResources']||![];var _0xa0d510=_0x40b7c5(_0x11e788,_0x5df692);if(!_0xa0d510[_0x178e('0x15')])throw new Error(_0x178e('0x85')+_0x11e788+'\x27');var _0x134a25=[{'name':_0x11e788}];if(!_[_0x178e('0x86')](_0xa0d510['parentSections']))_0x134a25=_0xa0d510[_0x178e('0x20')];var _0x50861d=[];for(var _0x4ea234=0x0;_0x4ea234<_0x134a25['length'];_0x4ea234++){_0x50861d[_0x178e('0x87')](_0x41af3d[_0x178e('0x88')][_0x178e('0x89')]({'where':{'userProfileId':_0x455e9e[_0x178e('0x8a')]['id'],'name':_0x134a25[_0x4ea234]['name']},'raw':!![]}));}return Promise[_0x178e('0x8b')](_0x50861d)[_0x178e('0x8')](function(_0x3210dd){var _0x1d4a12=_[_0x178e('0x5')](_0x3210dd,function(_0x42e51a){return _0x42e51a?_0x42e51a:undefined;});var _0x5a7e51=_['filter'](_0x134a25,[_0x178e('0x8c'),!![]]);var _0x387a91=_[_0x178e('0x86')](_0x1d4a12)&&_[_0x178e('0x86')](_0x5a7e51)?null:_[_0x178e('0x8d')](_0x5a7e51,_0x1d4a12);if(!_0x387a91)return null;var _0x2aec68=[];for(var _0x2fc4e2=0x0;_0x2fc4e2<_0x387a91[_0x178e('0x8e')];_0x2fc4e2++){var _0x53b6a7=_[_0x178e('0x89')](_0x134a25,function(_0x39a1bf){return _0x387a91[_0x2fc4e2]?_0x39a1bf[_0x178e('0xd')]===_0x387a91[_0x2fc4e2][_0x178e('0xd')]:null;});if(_0x53b6a7){if(_0x387a91[_0x2fc4e2][_0x178e('0x8c')]){_0x2aec68[_0x178e('0x87')](_0x426810(_0xa0d510['childModel'],_0x387a91[_0x2fc4e2]));}else{if(!_0x387a91[_0x2fc4e2][_0x178e('0x8f')]){_0x2aec68['push'](_0x296a1d(_0x53b6a7,_0x387a91[_0x2fc4e2],_0xa0d510[_0x178e('0x15')]));}else{if(_0x53b6a7[_0x178e('0xc')]){_0x2aec68['push'](_0x3ac442(_0x53b6a7,_0x387a91[_0x2fc4e2]));}}}}}return Promise[_0x178e('0x8b')](_0x2aec68);})[_0x178e('0x8')](function(_0x224af1){var _0x457888=_0x224af1;var _0x302cb3=null;if(_0x457888){_0x302cb3=_0x457888['length']===0x1?_0x457888[0x0]:null;}if(!_0x302cb3&&!_0x457888)return _0x22dbd6;var _0x559376=_0x41af3d[_0xa0d510[_0x178e('0x15')]][_0x178e('0x90')];_0x5f3513[_0x178e('0xc')]=_[_0x178e('0x91')](_0x559376);_0x5f3513['query']=_[_0x178e('0x91')](_0x455e9e[_0x178e('0x7f')]);_0x5f3513['filters']=_['intersection'](_0x5f3513[_0x178e('0xc')],_0x5f3513[_0x178e('0x7f')]);_0x17a66c[_0x178e('0x92')]=_[_0x178e('0x93')](_0x5f3513['model'],_0x909614['fields'](_0x455e9e['query'][_0x178e('0x94')]));_0x17a66c[_0x178e('0x92')]=_0x17a66c[_0x178e('0x92')][_0x178e('0x8e')]?_0x17a66c[_0x178e('0x92')]:_0x5f3513[_0x178e('0xc')];if(!_0x455e9e[_0x178e('0x7f')]['hasOwnProperty'](_0x178e('0x95'))){_0x17a66c[_0x178e('0x96')]=_0x909614['limit'](_0x455e9e[_0x178e('0x7f')][_0x178e('0x96')]);_0x17a66c[_0x178e('0x97')]=_0x909614[_0x178e('0x97')](_0x455e9e[_0x178e('0x7f')][_0x178e('0x97')]);}_0x17a66c[_0x178e('0x98')]=_0x909614[_0x178e('0x99')](_0x455e9e[_0x178e('0x7f')][_0x178e('0x99')]);_0x17a66c[_0x178e('0x9a')]=_0x909614[_0x178e('0x9b')](_['pick'](_0x455e9e['query'],_0x5f3513['filters']));if(_0x455e9e[_0x178e('0x7f')][_0x178e('0x5')]){_0x17a66c[_0x178e('0x9a')]=_['merge'](_0x17a66c[_0x178e('0x9a')],{'$or':_['map'](_0x559376,function(_0x536236){if(_0x536236[_0x178e('0x12')]['key']!==_0x178e('0x9c')){var _0x2280d8={};_0x2280d8[_0x536236[_0x178e('0x6')]]={'$like':'%'+_0x455e9e[_0x178e('0x7f')][_0x178e('0x5')]+'%'};return _0x2280d8;}})});}var _0x3583cf=[];var _0xee7362=null;var _0x501453={};if(_0x302cb3){_0xee7362=_[_0x178e('0x89')](_0x134a25,['name',_0x302cb3[_0x178e('0xd')]]);if(_0xee7362['field']){_0x501453={};if(_0xa0d510['childModel']===_0x178e('0x10')){_0x501453[_0xee7362[_0x178e('0x9d')]]=_[_0x178e('0xa')](_0x302cb3[_0x178e('0x9')],'id');}else{_0x501453[_0xee7362[_0x178e('0x9d')]]=_0x302cb3[_0x178e('0x9')];}_0x3583cf['push'](_0x501453);}else{_0x17a66c[_0x178e('0x9a')]['id']=_0x302cb3[_0x178e('0x9')];}}else{for(var _0x372724=0x0;_0x372724<_0x457888[_0x178e('0x8e')];_0x372724++){_0xee7362=_[_0x178e('0x89')](_0x134a25,[_0x178e('0xd'),_0x457888[_0x372724][_0x178e('0xd')]]);if(_0xee7362[_0x178e('0x6')]){_0x501453={};_0x501453[_0xee7362[_0x178e('0x9d')]]=_0x457888[_0x372724][_0x178e('0x9')];_0x3583cf[_0x178e('0x87')](_0x501453);}else{if(!_0x17a66c[_0x178e('0x9a')]['id'])_0x17a66c[_0x178e('0x9a')]['id']=[];_0x457888[_0x372724]['associatedResources']['forEach'](function(_0x5426ea){_0x17a66c['where']['id'][_0x178e('0x87')](_0x5426ea);});}}}if(!_[_0x178e('0x86')](_0x3583cf)){_0x17a66c[_0x178e('0x9a')]=_[_0x178e('0x9e')](_0x17a66c['where'],{'$and':{'$or':_0x3583cf}});}_0x17a66c=_[_0x178e('0x9e')]({},_0x17a66c,_0x455e9e['options']);if(_0x302cb3&&!_0x302cb3[_0x178e('0x8f')]&&_0xa0d510[_0x178e('0x15')]===_0x178e('0x10')){if(_0x455e9e[_0x178e('0x7f')][_0x178e('0x9f')]){_0x17a66c[_0x178e('0xa0')]=[{'all':!![]}];}return _0x41af3d[_0xa0d510[_0x178e('0x15')]][_0x178e('0x7')](_0x17a66c)[_0x178e('0x8')](function(_0x100fe0){var _0x328934=[];_0x100fe0[_0x178e('0xa1')](function(_0x19a19d){var _0x238890;switch(_0x19a19d[_0x178e('0xa2')]){case'default':_0x238890=_[_0x178e('0x89')](_0x302cb3[_0x178e('0x9')],function(_0x4a6801){return _0x4a6801['id']===_0x19a19d['reportId']&&_0x4a6801['type']===_0x178e('0xa3');});break;case _0x178e('0xa4'):_0x238890=_[_0x178e('0x89')](_0x302cb3[_0x178e('0x9')],function(_0xc72a8b){return _0xc72a8b['id']===_0x19a19d[_0x178e('0xa5')]&&_0xc72a8b['type']===_0x178e('0xa6');});break;}if(_0x238890)_0x328934[_0x178e('0x87')](_0x19a19d);});_0x22dbd6['count']=_0x328934[_0x178e('0x8e')];_0x22dbd6['rows']=_0x328934;return _0x22dbd6;});}else{if(!_[_0x178e('0x86')](_0x455e9e[_0x178e('0x7f')]['ids'])){_0x17a66c[_0x178e('0x9a')]['id']=_0x17a66c[_0x178e('0x9a')]['id']?_[_0x178e('0x93')](_0x17a66c[_0x178e('0x9a')]['id'],_0x455e9e[_0x178e('0x7f')][_0x178e('0xa7')]):_0x455e9e[_0x178e('0x7f')]['ids'];if(_0x455e9e[_0x178e('0x7f')][_0x178e('0xa8')]){_0x17a66c[_0x178e('0x98')]=_0x455e9e[_0x178e('0x7f')]['customSorting'];}}if(_0x455e9e[_0x178e('0x7f')][_0x178e('0xa9')]){_0x17a66c[_0x178e('0x9a')]=_[_0x178e('0x9e')](_0x17a66c[_0x178e('0x9a')],{'$and':_0x455e9e[_0x178e('0x7f')][_0x178e('0xa9')]});}return _0x41af3d[_0xa0d510[_0x178e('0x15')]][_0x178e('0xaa')]({'where':_0x17a66c[_0x178e('0x9a')]})['then'](function(_0x21d668){_0x22dbd6[_0x178e('0xaa')]=_0x21d668;if(_0x455e9e['query']['includeAll']){if(_0xa0d510['childModel']===_0x178e('0x1f')){_0x17a66c[_0x178e('0xa0')]=[{'model':_0x41af3d[_0x178e('0x6c')],'as':'Tags','attributes':['id',_0x178e('0xd'),_0x178e('0xab')],'required':_0x455e9e[_0x178e('0x7f')][_0x178e('0xac')]?!![]:![]},{'model':_0x41af3d[_0x178e('0x6c')],'as':_0x178e('0xad'),'attributes':['id','name',_0x178e('0xab')],'through':_0x455e9e[_0x178e('0x7f')][_0x178e('0xac')]?{'attributes':[],'where':{'TagId':_0x455e9e[_0x178e('0x7f')][_0x178e('0xac')]||undefined}}:{},'required':_0x455e9e[_0x178e('0x7f')][_0x178e('0xac')]?!![]:![]}];}else{_0x17a66c['include']=[{'all':!![]}];}}return _0x41af3d[_0xa0d510[_0x178e('0x15')]][_0x178e('0x7')](_0x17a66c);})[_0x178e('0x8')](function(_0x26c43c){_0x22dbd6[_0x178e('0xae')]=_0x26c43c;if(_0x11e788==='Agents'&&_0x455e9e[_0x178e('0x7f')][_0x178e('0xaf')]==='true'){var _0x10e8dd=[];for(var _0x3122b5=0x0;_0x3122b5<_0x22dbd6[_0x178e('0xae')][_0x178e('0x8e')];_0x3122b5++){_0x10e8dd[_0x178e('0x87')](_0x38a22a('chat',_0x22dbd6['rows'][_0x3122b5][_0x178e('0xb0')]));_0x10e8dd[_0x178e('0x87')](_0x38a22a(_0x178e('0xb1'),_0x22dbd6[_0x178e('0xae')][_0x3122b5][_0x178e('0xb0')]));_0x10e8dd[_0x178e('0x87')](_0x38a22a(_0x178e('0xb2'),_0x22dbd6['rows'][_0x3122b5][_0x178e('0xb0')]));_0x10e8dd[_0x178e('0x87')](_0x38a22a(_0x178e('0xb3'),_0x22dbd6[_0x178e('0xae')][_0x3122b5][_0x178e('0xb0')]));_0x10e8dd[_0x178e('0x87')](_0x38a22a('openchannel',_0x22dbd6[_0x178e('0xae')][_0x3122b5][_0x178e('0xb0')]));_0x10e8dd[_0x178e('0x87')](_0x38a22a('whatsapp',_0x22dbd6['rows'][_0x3122b5][_0x178e('0xb0')]));}return Promise[_0x178e('0x8b')](_0x10e8dd)[_0x178e('0x8')](function(){return _0x22dbd6;});}return _0x22dbd6;});}});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x11e5=['../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfile,\x20%s,\x20%s','info','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xa0fb8e,_0x293ed6){var _0xa43fc4=function(_0xbb194d){while(--_0xbb194d){_0xa0fb8e['push'](_0xa0fb8e['shift']());}};_0xa43fc4(++_0x293ed6);}(_0x11e5,0x8b));var _0x511e=function(_0xd88860,_0xe09771){_0xd88860=_0xd88860-0x0;var _0x4aac30=_0x11e5[_0xd88860];return _0x4aac30;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var moment=require(_0x511e('0x1'));var BPromise=require(_0x511e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511e('0x3'));var db=require(_0x511e('0x4'))['db'];var utils=require(_0x511e('0x5'));var logger=require('../../config/logger')(_0x511e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x511e('0x7')][_0x511e('0x8')]({'port':0x232a});config[_0x511e('0x9')]=_['defaults'](config['redis'],{'host':_0x511e('0xa'),'port':0x18eb});var socket=require(_0x511e('0xb'))(new Redis(config[_0x511e('0x9')]));require(_0x511e('0xc'))[_0x511e('0xd')](socket);function respondWithRpcPromise(_0x30269e,_0x1596b3,_0x50564b){return new BPromise(function(_0x2f547a,_0x1c6def){return client[_0x511e('0xe')](_0x30269e,_0x50564b)['then'](function(_0x7e50db){logger['info']('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x511e('0xf'));logger[_0x511e('0x10')](_0x511e('0x11'),_0x1596b3,_0x511e('0xf'),JSON[_0x511e('0x12')](_0x7e50db));if(_0x7e50db[_0x511e('0x13')]){if(_0x7e50db['error'][_0x511e('0x14')]===0x1f4){logger[_0x511e('0x13')]('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x7e50db[_0x511e('0x13')][_0x511e('0x15')]);return _0x1c6def(_0x7e50db['error'][_0x511e('0x15')]);}logger[_0x511e('0x13')](_0x511e('0x16'),_0x1596b3,_0x7e50db[_0x511e('0x13')]['message']);return _0x2f547a(_0x7e50db[_0x511e('0x13')][_0x511e('0x15')]);}else{logger[_0x511e('0x17')]('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x511e('0xf'));_0x2f547a(_0x7e50db['result'][_0x511e('0x15')]);}})['catch'](function(_0x5821ee){logger[_0x511e('0x13')]('UserProfile,\x20%s,\x20%s',_0x1596b3,_0x5821ee);_0x1c6def(_0x5821ee);});});}
\ No newline at end of file
+var _0x45c2=['./userProfile.socket','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x45c2,0x68));var _0x245c=function(_0x8cb31b,_0x509016){_0x8cb31b=_0x8cb31b-0x0;var _0x2ce32e=_0x45c2[_0x8cb31b];return _0x2ce32e;};'use strict';var _=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var moment=require(_0x245c('0x2'));var BPromise=require(_0x245c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x245c('0x4'));var db=require(_0x245c('0x5'))['db'];var utils=require(_0x245c('0x6'));var logger=require('../../config/logger')(_0x245c('0x7'));var config=require(_0x245c('0x8'));var jayson=require(_0x245c('0x9'));var client=jayson[_0x245c('0xa')][_0x245c('0xb')]({'port':0x232a});config[_0x245c('0xc')]=_[_0x245c('0xd')](config[_0x245c('0xc')],{'host':_0x245c('0xe'),'port':0x18eb});var socket=require(_0x245c('0xf'))(new Redis(config[_0x245c('0xc')]));require(_0x245c('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e3543,_0x244013,_0x6de688){return new BPromise(function(_0x506e9b,_0x5b1e37){return client[_0x245c('0x11')](_0x3e3543,_0x6de688)[_0x245c('0x12')](function(_0x5d925c){logger[_0x245c('0x13')]('UserProfile,\x20%s,\x20%s',_0x244013,_0x245c('0x14'));logger[_0x245c('0x15')](_0x245c('0x16'),_0x244013,_0x245c('0x14'),JSON[_0x245c('0x17')](_0x5d925c));if(_0x5d925c['error']){if(_0x5d925c[_0x245c('0x18')][_0x245c('0x19')]===0x1f4){logger[_0x245c('0x18')](_0x245c('0x1a'),_0x244013,_0x5d925c['error'][_0x245c('0x1b')]);return _0x5b1e37(_0x5d925c['error'][_0x245c('0x1b')]);}logger[_0x245c('0x18')](_0x245c('0x1a'),_0x244013,_0x5d925c[_0x245c('0x18')]['message']);return _0x506e9b(_0x5d925c[_0x245c('0x18')][_0x245c('0x1b')]);}else{logger[_0x245c('0x13')](_0x245c('0x1a'),_0x244013,_0x245c('0x14'));_0x506e9b(_0x5d925c[_0x245c('0x1c')]['message']);}})[_0x245c('0x1d')](function(_0x3b0003){logger['error'](_0x245c('0x1a'),_0x244013,_0x3b0003);_0x5b1e37(_0x3b0003);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f80=['./userProfile.events','save','remove','update','emit','removeListener','register','length','userProfile:'];(function(_0x296db4,_0x3244dc){var _0x44e41c=function(_0x3c2119){while(--_0x3c2119){_0x296db4['push'](_0x296db4['shift']());}};_0x44e41c(++_0x3244dc);}(_0x1f80,0x1e6));var _0x01f8=function(_0x3ea7c6,_0x58e36a){_0x3ea7c6=_0x3ea7c6-0x0;var _0x4345a4=_0x1f80[_0x3ea7c6];return _0x4345a4;};'use strict';var UserProfileEvents=require(_0x01f8('0x0'));var events=[_0x01f8('0x1'),_0x01f8('0x2'),_0x01f8('0x3')];function createListener(_0xe5e81e,_0x531611){return function(_0x3df936){_0x531611[_0x01f8('0x4')](_0xe5e81e,_0x3df936);};}function removeListener(_0x17d096,_0x445406){return function(){UserProfileEvents[_0x01f8('0x5')](_0x17d096,_0x445406);};}exports[_0x01f8('0x6')]=function(_0x1f6284){for(var _0x588668=0x0,_0xd7cbe5=events[_0x01f8('0x7')];_0x588668<_0xd7cbe5;_0x588668++){var _0x56d32f=events[_0x588668];var _0xc3a9b4=createListener(_0x01f8('0x8')+_0x56d32f,_0x1f6284);UserProfileEvents['on'](_0x56d32f,_0xc3a9b4);}};
\ No newline at end of file
+var _0x1c88=['./userProfile.events','save','update','removeListener','register','length','userProfile:'];(function(_0x49a34e,_0x49e9ef){var _0x31372a=function(_0xaea88e){while(--_0xaea88e){_0x49a34e['push'](_0x49a34e['shift']());}};_0x31372a(++_0x49e9ef);}(_0x1c88,0xaf));var _0x81c8=function(_0x539709,_0x2c9edd){_0x539709=_0x539709-0x0;var _0x73cc7e=_0x1c88[_0x539709];return _0x73cc7e;};'use strict';var UserProfileEvents=require(_0x81c8('0x0'));var events=[_0x81c8('0x1'),'remove',_0x81c8('0x2')];function createListener(_0x34de72,_0x1b6690){return function(_0xa27d99){_0x1b6690['emit'](_0x34de72,_0xa27d99);};}function removeListener(_0x28b762,_0x1c3134){return function(){UserProfileEvents[_0x81c8('0x3')](_0x28b762,_0x1c3134);};}exports[_0x81c8('0x4')]=function(_0xe7524a){for(var _0x396f07=0x0,_0x57471a=events[_0x81c8('0x5')];_0x396f07<_0x57471a;_0x396f07++){var _0x4a0e1b=events[_0x396f07];var _0x49863b=createListener(_0x81c8('0x6')+_0x4a0e1b,_0xe7524a);UserProfileEvents['on'](_0x4a0e1b,_0x49863b);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x931e=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','destroy','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x931e,0x87));var _0xe931=function(_0x439db1,_0x2b7db7){_0x439db1=_0x439db1-0x0;var _0x495017=_0x931e[_0x439db1];return _0x495017;};'use strict';var multer=require(_0xe931('0x0'));var util=require('util');var path=require(_0xe931('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe931('0x2'));var auth=require(_0xe931('0x3'));var interaction=require(_0xe931('0x4'));var config=require(_0xe931('0x5'));var controller=require(_0xe931('0x6'));router[_0xe931('0x7')]('/',auth[_0xe931('0x8')](),controller['index']);router['get'](_0xe931('0x9'),auth[_0xe931('0x8')](),controller[_0xe931('0xa')]);router[_0xe931('0x7')](_0xe931('0xb'),auth[_0xe931('0x8')](),controller['show']);router[_0xe931('0xc')]('/',auth[_0xe931('0x8')](),controller[_0xe931('0xd')]);router[_0xe931('0xe')](_0xe931('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe931('0xb'),auth[_0xe931('0x8')](),controller[_0xe931('0xf')]);module[_0xe931('0x10')]=router;
\ No newline at end of file
+var _0x7ef0=['isAuthenticated','/describe','describe','/:id','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./userProfileResource.controller','get'];(function(_0x26018c,_0x3c0903){var _0x1efc45=function(_0x3d952f){while(--_0x3d952f){_0x26018c['push'](_0x26018c['shift']());}};_0x1efc45(++_0x3c0903);}(_0x7ef0,0x1a0));var _0x07ef=function(_0x4dd7d7,_0x3eab2e){_0x4dd7d7=_0x4dd7d7-0x0;var _0x1abd98=_0x7ef0[_0x4dd7d7];return _0x1abd98;};'use strict';var multer=require(_0x07ef('0x0'));var util=require(_0x07ef('0x1'));var path=require(_0x07ef('0x2'));var timeout=require('connect-timeout');var express=require(_0x07ef('0x3'));var router=express[_0x07ef('0x4')]();var fs_extra=require(_0x07ef('0x5'));var auth=require(_0x07ef('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x07ef('0x7'));router[_0x07ef('0x8')]('/',auth[_0x07ef('0x9')](),controller['index']);router[_0x07ef('0x8')](_0x07ef('0xa'),auth['isAuthenticated'](),controller[_0x07ef('0xb')]);router['get'](_0x07ef('0xc'),auth[_0x07ef('0x9')](),controller['show']);router[_0x07ef('0xd')]('/',auth[_0x07ef('0x9')](),controller['create']);router['put'](_0x07ef('0xc'),auth['isAuthenticated'](),controller[_0x07ef('0xe')]);router['delete'](_0x07ef('0xc'),auth[_0x07ef('0x9')](),controller[_0x07ef('0xf')]);module[_0x07ef('0x10')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa119=['INTEGER','exports','STRING'];(function(_0x1b9438,_0x3be13d){var _0x182cc1=function(_0x439c7a){while(--_0x439c7a){_0x1b9438['push'](_0x1b9438['shift']());}};_0x182cc1(++_0x3be13d);}(_0xa119,0x1c9));var _0x9a11=function(_0x479b9a,_0x2fe1e3){_0x479b9a=_0x479b9a-0x0;var _0x4b5c9c=_0xa119[_0x479b9a];return _0x4b5c9c;};'use strict';var Sequelize=require('sequelize');module[_0x9a11('0x0')]={'name':{'type':Sequelize[_0x9a11('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9a11('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xddef=['INTEGER','STRING','exports'];(function(_0x2239e9,_0x49e601){var _0x23506c=function(_0x2f8018){while(--_0x2f8018){_0x2239e9['push'](_0x2239e9['shift']());}};_0x23506c(++_0x49e601);}(_0xddef,0x1c1));var _0xfdde=function(_0x38960a,_0x555254){_0x38960a=_0x38960a-0x0;var _0x2495e1=_0xddef[_0x38960a];return _0x2495e1;};'use strict';var Sequelize=require('sequelize');module[_0xfdde('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfdde('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfdde('0x2')],'allowNull':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','UserProfileResource','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1c4951,_0x2038ee){var _0x345e1b=function(_0x69ee47){while(--_0x69ee47){_0x1c4951['push'](_0x1c4951['shift']());}};_0x345e1b(++_0x2038ee);}(_0x4c60,0xc1));var _0x04c6=function(_0xbc7f8f,_0x2fc4a6){_0xbc7f8f=_0xbc7f8f-0x0;var _0x30b3b8=_0x4c60[_0xbc7f8f];return _0x30b3b8;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['UserProfileResource'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['UserProfileResource'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['UserProfileResource'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['UserProfileResource'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));};
\ No newline at end of file
+var _0x4991=['hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','UserProfileResource','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x4fb819,_0x8cf2a1){var _0x196793=function(_0x6b1ade){while(--_0x6b1ade){_0x4fb819['push'](_0x4fb819['shift']());}};_0x196793(++_0x8cf2a1);}(_0x4991,0xf7));var _0x1499=function(_0x3563c5,_0x28b0ee){_0x3563c5=_0x3563c5-0x0;var _0x3f557c=_0x4991[_0x3563c5];return _0x3f557c;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['UserProfileResource'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));};exports[_0x1499('0x4a')]=function(_0x9f0520,_0x278178){return db['UserProfileResource'][_0x1499('0x4a')]()[_0x1499('0x24')](respondWithResult(_0x278178,null))['catch'](handleError(_0x278178,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5220=['./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28bbe1,_0x48f04c){var _0x3f41c0=function(_0x1c9c6f){while(--_0x1c9c6f){_0x28bbe1['push'](_0x28bbe1['shift']());}};_0x3f41c0(++_0x48f04c);}(_0x5220,0x164));var _0x0522=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x5220[_0x4fbb86];return _0xb141fe;};'use strict';var _=require('lodash');var util=require(_0x0522('0x0'));var logger=require(_0x0522('0x1'))(_0x0522('0x2'));var moment=require(_0x0522('0x3'));var BPromise=require(_0x0522('0x4'));var rp=require(_0x0522('0x5'));var fs=require('fs');var path=require(_0x0522('0x6'));var rimraf=require(_0x0522('0x7'));var config=require('../../config/environment');var attributes=require(_0x0522('0x8'));module['exports']=function(_0x5971a1,_0x5eb4eb){return _0x5971a1['define'](_0x0522('0x9'),attributes,{'tableName':_0x0522('0xa'),'paranoid':![],'indexes':[{'name':_0x0522('0xb'),'fields':[_0x0522('0xc'),_0x0522('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9277=['request-promise','path','rimraf','../../config/environment','define','UserProfileResource','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x9277,0x14e));var _0x7927=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0x9277[_0xd3e0b9];return _0x470133;};'use strict';var _=require('lodash');var util=require(_0x7927('0x0'));var logger=require(_0x7927('0x1'))(_0x7927('0x2'));var moment=require(_0x7927('0x3'));var BPromise=require('bluebird');var rp=require(_0x7927('0x4'));var fs=require('fs');var path=require(_0x7927('0x5'));var rimraf=require(_0x7927('0x6'));var config=require(_0x7927('0x7'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x2d347f,_0x530a84){return _0x2d347f[_0x7927('0x8')](_0x7927('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x7927('0xa'),'fields':[_0x7927('0xb'),_0x7927('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb0a7=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s'];(function(_0x69f8c7,_0xdb0ea8){var _0x4c7cc9=function(_0x41a431){while(--_0x41a431){_0x69f8c7['push'](_0x69f8c7['shift']());}};_0x4c7cc9(++_0xdb0ea8);}(_0xb0a7,0x116));var _0x7b0a=function(_0x32c27b,_0x304cd2){_0x32c27b=_0x32c27b-0x0;var _0x52e86d=_0xb0a7[_0x32c27b];return _0x52e86d;};'use strict';var _=require(_0x7b0a('0x0'));var util=require(_0x7b0a('0x1'));var moment=require(_0x7b0a('0x2'));var BPromise=require(_0x7b0a('0x3'));var rs=require(_0x7b0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b0a('0x5'))['db'];var utils=require(_0x7b0a('0x6'));var logger=require(_0x7b0a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b0a('0x8'));var client=jayson[_0x7b0a('0x9')][_0x7b0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46255b,_0x25ef00,_0x2f28dc){return new BPromise(function(_0x3807df,_0x21bb69){return client['request'](_0x46255b,_0x2f28dc)[_0x7b0a('0xb')](function(_0xa20161){logger[_0x7b0a('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0x7b0a('0xd'));logger[_0x7b0a('0xe')](_0x7b0a('0xf'),_0x25ef00,_0x7b0a('0xd'),JSON[_0x7b0a('0x10')](_0xa20161));if(_0xa20161['error']){if(_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x12')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x13')]);return _0x21bb69(_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x13')]);}logger[_0x7b0a('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0xa20161['error']['message']);return _0x3807df(_0xa20161[_0x7b0a('0x11')][_0x7b0a('0x13')]);}else{logger[_0x7b0a('0xc')](_0x7b0a('0x14'),_0x25ef00,_0x7b0a('0xd'));_0x3807df(_0xa20161[_0x7b0a('0x15')][_0x7b0a('0x13')]);}})[_0x7b0a('0x16')](function(_0x55e6fe){logger[_0x7b0a('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x25ef00,_0x55e6fe);_0x21bb69(_0x55e6fe);});});}
\ No newline at end of file
+var _0x47b6=['then','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x47b6,0x66));var _0x647b=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x47b6[_0x400322];return _0xfdd597;};'use strict';var _=require(_0x647b('0x0'));var util=require(_0x647b('0x1'));var moment=require(_0x647b('0x2'));var BPromise=require('bluebird');var rs=require(_0x647b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x647b('0x4'))['db'];var utils=require(_0x647b('0x5'));var logger=require(_0x647b('0x6'))(_0x647b('0x7'));var config=require(_0x647b('0x8'));var jayson=require(_0x647b('0x9'));var client=jayson[_0x647b('0xa')][_0x647b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40ebb1,_0x3f688a,_0x362d1c){return new BPromise(function(_0x5a116f,_0x49c53c){return client[_0x647b('0xc')](_0x40ebb1,_0x362d1c)[_0x647b('0xd')](function(_0x5e724f){logger[_0x647b('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x3f688a,_0x647b('0xf'));logger['debug'](_0x647b('0x10'),_0x3f688a,_0x647b('0xf'),JSON[_0x647b('0x11')](_0x5e724f));if(_0x5e724f[_0x647b('0x12')]){if(_0x5e724f['error'][_0x647b('0x13')]===0x1f4){logger[_0x647b('0x12')](_0x647b('0x14'),_0x3f688a,_0x5e724f['error'][_0x647b('0x15')]);return _0x49c53c(_0x5e724f['error'][_0x647b('0x15')]);}logger[_0x647b('0x12')](_0x647b('0x14'),_0x3f688a,_0x5e724f[_0x647b('0x12')][_0x647b('0x15')]);return _0x5a116f(_0x5e724f[_0x647b('0x12')][_0x647b('0x15')]);}else{logger[_0x647b('0xe')](_0x647b('0x14'),_0x3f688a,_0x647b('0xf'));_0x5a116f(_0x5e724f[_0x647b('0x16')]['message']);}})['catch'](function(_0x5a4c18){logger[_0x647b('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x3f688a,_0x5a4c18);_0x49c53c(_0x5a4c18);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x741a=['../../config/environment','./userProfileSection.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xb9591f,_0x2b2134){var _0x59da0c=function(_0x30b0b0){while(--_0x30b0b0){_0xb9591f['push'](_0xb9591f['shift']());}};_0x59da0c(++_0x2b2134);}(_0x741a,0x1e0));var _0xa741=function(_0x29e54f,_0x33535a){_0x29e54f=_0x29e54f-0x0;var _0x4c619f=_0x741a[_0x29e54f];return _0x4c619f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa741('0x0'));var timeout=require(_0xa741('0x1'));var express=require(_0xa741('0x2'));var router=express[_0xa741('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa741('0x4'));var interaction=require(_0xa741('0x5'));var config=require(_0xa741('0x6'));var controller=require(_0xa741('0x7'));router[_0xa741('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa741('0x8')](_0xa741('0x9'),auth[_0xa741('0xa')](),controller[_0xa741('0xb')]);router[_0xa741('0x8')](_0xa741('0xc'),auth[_0xa741('0xa')](),controller[_0xa741('0xd')]);router[_0xa741('0xe')]('/',auth[_0xa741('0xa')](),controller[_0xa741('0xf')]);router[_0xa741('0x10')](_0xa741('0xc'),auth[_0xa741('0xa')](),controller['update']);router['delete'](_0xa741('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa741('0x11')]=router;
\ No newline at end of file
+var _0xc3f4=['index','get','isAuthenticated','/:id','show','create','delete','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xc3f4,0x19e));var _0x4c3f=function(_0x1d161b,_0x39869a){_0x1d161b=_0x1d161b-0x0;var _0x1fd4e4=_0xc3f4[_0x1d161b];return _0x1fd4e4;};'use strict';var multer=require(_0x4c3f('0x0'));var util=require(_0x4c3f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c3f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4c3f('0x3'));var config=require(_0x4c3f('0x4'));var controller=require(_0x4c3f('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c3f('0x6')]);router[_0x4c3f('0x7')]('/describe',auth[_0x4c3f('0x8')](),controller['describe']);router[_0x4c3f('0x7')](_0x4c3f('0x9'),auth[_0x4c3f('0x8')](),controller[_0x4c3f('0xa')]);router['post']('/',auth[_0x4c3f('0x8')](),controller[_0x4c3f('0xb')]);router['put'](_0x4c3f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4c3f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4c3f('0xd')]);module[_0x4c3f('0xe')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f4c=['setDataValue','join','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x315746,_0x44c105){var _0x533a49=function(_0x2be178){while(--_0x2be178){_0x315746['push'](_0x315746['shift']());}};_0x533a49(++_0x44c105);}(_0x8f4c,0x113));var _0xc8f4=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x8f4c[_0xf9a6cf];return _0x59e2bc;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc8f4('0x2')],'set':function(_0x47350d){this[_0xc8f4('0x5')]('crudPermissions',_0x47350d?_0x47350d[_0xc8f4('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc8f4('0x7'))['split'](''):[];}}};
\ No newline at end of file
+var _0x7916=['getDataValue','sequelize','STRING','BOOLEAN','crudPermissions'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x7916,0x128));var _0x6791=function(_0x433529,_0x534ce6){_0x433529=_0x433529-0x0;var _0x1ecb58=_0x7916[_0x433529];return _0x1ecb58;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6791('0x1')],'set':function(_0x330476){this['setDataValue'](_0x6791('0x3'),_0x330476?_0x330476['join'](''):[]);},'get':function(){return this[_0x6791('0x4')](_0x6791('0x3'))?this['getDataValue'](_0x6791('0x3'))['split'](''):[];}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xddf5=['name','send','index','map','UserProfileSection','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x4fb51b,_0xe70822){var _0x49cc96=function(_0x41030b){while(--_0x41030b){_0x4fb51b['push'](_0x4fb51b['shift']());}};_0x49cc96(++_0xe70822);}(_0xddf5,0x112));var _0x5ddf=function(_0x1f1f7e,_0x552ba7){_0x1f1f7e=_0x1f1f7e-0x0;var _0x1f55f9=_0xddf5[_0x1f1f7e];return _0x1f55f9;};'use strict';var emlformat=require(_0x5ddf('0x0'));var rimraf=require(_0x5ddf('0x1'));var zipdir=require(_0x5ddf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ddf('0x3'));var moment=require(_0x5ddf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ddf('0x5'));var util=require(_0x5ddf('0x6'));var path=require(_0x5ddf('0x7'));var sox=require(_0x5ddf('0x8'));var csv=require(_0x5ddf('0x9'));var ejs=require(_0x5ddf('0xa'));var fs=require('fs');var fs_extra=require(_0x5ddf('0xb'));var _=require(_0x5ddf('0xc'));var squel=require(_0x5ddf('0xd'));var crypto=require('crypto');var jsforce=require(_0x5ddf('0xe'));var deskjs=require(_0x5ddf('0xf'));var toCsv=require(_0x5ddf('0x9'));var querystring=require(_0x5ddf('0x10'));var Papa=require('papaparse');var Redis=require(_0x5ddf('0x11'));var authService=require(_0x5ddf('0x12'));var qs=require(_0x5ddf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ddf('0x14'));var logger=require(_0x5ddf('0x15'))(_0x5ddf('0x16'));var utils=require('../../config/utils');var config=require(_0x5ddf('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ddf('0x18'))['db'];function respondWithStatusCode(_0x5401b4,_0xeeacf){_0xeeacf=_0xeeacf||0xcc;return function(_0x2042e2){if(_0x2042e2){return _0x5401b4['sendStatus'](_0xeeacf);}return _0x5401b4[_0x5ddf('0x19')](_0xeeacf)[_0x5ddf('0x1a')]();};}function respondWithResult(_0xb7f758,_0x4dd19f){_0x4dd19f=_0x4dd19f||0xc8;return function(_0x3f46db){if(_0x3f46db){return _0xb7f758[_0x5ddf('0x19')](_0x4dd19f)[_0x5ddf('0x1b')](_0x3f46db);}};}function respondWithFilteredResult(_0x6bc2fd,_0x4c78aa){return function(_0x163409){if(_0x163409){var _0x49c15a=typeof _0x4c78aa[_0x5ddf('0x1c')]===_0x5ddf('0x1d')&&typeof _0x4c78aa[_0x5ddf('0x1e')]===_0x5ddf('0x1d');var _0x5df2be=_0x163409[_0x5ddf('0x1f')];var _0x57e401=_0x49c15a?0x0:_0x4c78aa[_0x5ddf('0x1c')];var _0x27ae26=_0x49c15a?_0x163409[_0x5ddf('0x1f')]:_0x4c78aa[_0x5ddf('0x1c')]+_0x4c78aa[_0x5ddf('0x1e')];var _0x59a4bb;if(_0x27ae26>=_0x5df2be){_0x27ae26=_0x5df2be;_0x59a4bb=0xc8;}else{_0x59a4bb=0xce;}_0x6bc2fd[_0x5ddf('0x19')](_0x59a4bb);return _0x6bc2fd[_0x5ddf('0x20')](_0x5ddf('0x21'),_0x57e401+'-'+_0x27ae26+'/'+_0x5df2be)[_0x5ddf('0x1b')](_0x163409);}return null;};}function patchUpdates(_0x1cbe00){return function(_0x1d1433){try{jsonpatch[_0x5ddf('0x22')](_0x1d1433,_0x1cbe00,!![]);}catch(_0x1dfa7d){return BPromise[_0x5ddf('0x23')](_0x1dfa7d);}return _0x1d1433[_0x5ddf('0x24')]();};}function saveUpdates(_0x47d00e,_0x39da32){return function(_0x4d0e6a){if(_0x4d0e6a){return _0x4d0e6a[_0x5ddf('0x25')](_0x47d00e)[_0x5ddf('0x26')](function(_0x85b380){return _0x85b380;});}return null;};}function removeEntity(_0x324b47,_0x29a2c1){return function(_0x64c61a){if(_0x64c61a){return _0x64c61a[_0x5ddf('0x27')]()['then'](function(){_0x324b47['status'](0xcc)[_0x5ddf('0x1a')]();});}};}function handleEntityNotFound(_0x65ac76,_0x28d391){return function(_0x3890f7){if(!_0x3890f7){_0x65ac76[_0x5ddf('0x28')](0x194);}return _0x3890f7;};}function handleError(_0x57ee40,_0x39c85){_0x39c85=_0x39c85||0x1f4;return function(_0x167ae6){logger[_0x5ddf('0x29')](_0x167ae6['stack']);if(_0x167ae6['name']){delete _0x167ae6[_0x5ddf('0x2a')];}_0x57ee40[_0x5ddf('0x19')](_0x39c85)[_0x5ddf('0x2b')](_0x167ae6);};}exports[_0x5ddf('0x2c')]=function(_0x38cf57,_0x11d965){var _0x459321={},_0x3c68e6={},_0x4f5715={'count':0x0,'rows':[]};var _0x398c49=_[_0x5ddf('0x2d')](db[_0x5ddf('0x2e')]['rawAttributes'],function(_0x208f51){return{'name':_0x208f51[_0x5ddf('0x2f')],'type':_0x208f51[_0x5ddf('0x30')]['key']};});_0x3c68e6[_0x5ddf('0x31')]=_[_0x5ddf('0x2d')](_0x398c49,_0x5ddf('0x2a'));_0x3c68e6[_0x5ddf('0x32')]=_[_0x5ddf('0x33')](_0x38cf57[_0x5ddf('0x32')]);_0x3c68e6[_0x5ddf('0x34')]=_['intersection'](_0x3c68e6[_0x5ddf('0x31')],_0x3c68e6['query']);_0x459321[_0x5ddf('0x35')]=_['intersection'](_0x3c68e6[_0x5ddf('0x31')],qs[_0x5ddf('0x36')](_0x38cf57['query'][_0x5ddf('0x36')]));_0x459321[_0x5ddf('0x35')]=_0x459321[_0x5ddf('0x35')]['length']?_0x459321[_0x5ddf('0x35')]:_0x3c68e6['model'];if(!_0x38cf57[_0x5ddf('0x32')][_0x5ddf('0x37')](_0x5ddf('0x38'))){_0x459321[_0x5ddf('0x1e')]=qs[_0x5ddf('0x1e')](_0x38cf57[_0x5ddf('0x32')]['limit']);_0x459321[_0x5ddf('0x1c')]=qs['offset'](_0x38cf57['query'][_0x5ddf('0x1c')]);}_0x459321[_0x5ddf('0x39')]=qs[_0x5ddf('0x3a')](_0x38cf57[_0x5ddf('0x32')]['sort']);_0x459321[_0x5ddf('0x3b')]=qs[_0x5ddf('0x34')](_[_0x5ddf('0x3c')](_0x38cf57[_0x5ddf('0x32')],_0x3c68e6[_0x5ddf('0x34')]),_0x398c49);if(_0x38cf57[_0x5ddf('0x32')][_0x5ddf('0x3d')]){_0x459321[_0x5ddf('0x3b')]=_[_0x5ddf('0x3e')](_0x459321[_0x5ddf('0x3b')],{'$or':_[_0x5ddf('0x2d')](_0x398c49,function(_0x257b5f){if(_0x257b5f[_0x5ddf('0x30')]!==_0x5ddf('0x3f')){var _0x4446e4={};_0x4446e4[_0x257b5f['name']]={'$like':'%'+_0x38cf57['query']['filter']+'%'};return _0x4446e4;}})});}_0x459321=_['merge']({},_0x459321,_0x38cf57['options']);var _0x333418={'where':_0x459321[_0x5ddf('0x3b')]};return db[_0x5ddf('0x2e')][_0x5ddf('0x1f')](_0x333418)[_0x5ddf('0x26')](function(_0x1e25cb){_0x4f5715[_0x5ddf('0x1f')]=_0x1e25cb;if(_0x38cf57[_0x5ddf('0x32')][_0x5ddf('0x40')]){_0x459321[_0x5ddf('0x41')]=[{'all':!![]}];}return db[_0x5ddf('0x2e')][_0x5ddf('0x42')](_0x459321);})[_0x5ddf('0x26')](function(_0x8be300){_0x4f5715[_0x5ddf('0x43')]=_0x8be300;return _0x4f5715;})['then'](respondWithFilteredResult(_0x11d965,_0x459321))[_0x5ddf('0x44')](handleError(_0x11d965,null));};exports[_0x5ddf('0x45')]=function(_0x4e7ea6,_0x2b6107){var _0x5e5b87={'raw':![],'where':{'id':_0x4e7ea6[_0x5ddf('0x46')]['id']}},_0x2b7edc={};_0x2b7edc['model']=_[_0x5ddf('0x33')](db['UserProfileSection'][_0x5ddf('0x47')]);_0x2b7edc[_0x5ddf('0x32')]=_[_0x5ddf('0x33')](_0x4e7ea6[_0x5ddf('0x32')]);_0x2b7edc[_0x5ddf('0x34')]=_['intersection'](_0x2b7edc[_0x5ddf('0x31')],_0x2b7edc[_0x5ddf('0x32')]);_0x5e5b87[_0x5ddf('0x35')]=_[_0x5ddf('0x48')](_0x2b7edc[_0x5ddf('0x31')],qs[_0x5ddf('0x36')](_0x4e7ea6['query'][_0x5ddf('0x36')]));_0x5e5b87[_0x5ddf('0x35')]=_0x5e5b87[_0x5ddf('0x35')][_0x5ddf('0x49')]?_0x5e5b87[_0x5ddf('0x35')]:_0x2b7edc[_0x5ddf('0x31')];if(_0x4e7ea6[_0x5ddf('0x32')][_0x5ddf('0x40')]){_0x5e5b87['include']=[{'all':!![]}];}_0x5e5b87=_[_0x5ddf('0x3e')]({},_0x5e5b87,_0x4e7ea6[_0x5ddf('0x4a')]);return db[_0x5ddf('0x2e')][_0x5ddf('0x4b')](_0x5e5b87)[_0x5ddf('0x26')](handleEntityNotFound(_0x2b6107,null))['then'](respondWithResult(_0x2b6107,null))[_0x5ddf('0x44')](handleError(_0x2b6107,null));};exports[_0x5ddf('0x4c')]=function(_0x4a11c8,_0x801950){return db[_0x5ddf('0x2e')][_0x5ddf('0x4c')](_0x4a11c8[_0x5ddf('0x4d')],{})[_0x5ddf('0x26')](respondWithResult(_0x801950,0xc9))[_0x5ddf('0x44')](handleError(_0x801950,null));};exports[_0x5ddf('0x25')]=function(_0x4d3881,_0x182485){if(_0x4d3881[_0x5ddf('0x4d')]['id']){delete _0x4d3881['body']['id'];}return db['UserProfileSection'][_0x5ddf('0x4b')]({'where':{'id':_0x4d3881[_0x5ddf('0x46')]['id']}})['then'](handleEntityNotFound(_0x182485,null))[_0x5ddf('0x26')](saveUpdates(_0x4d3881[_0x5ddf('0x4d')],null))[_0x5ddf('0x26')](respondWithResult(_0x182485,null))['catch'](handleError(_0x182485,null));};exports[_0x5ddf('0x27')]=function(_0x9d7c4c,_0x4e12d4){return db[_0x5ddf('0x2e')][_0x5ddf('0x4b')]({'where':{'id':_0x9d7c4c[_0x5ddf('0x46')]['id']}})[_0x5ddf('0x26')](handleEntityNotFound(_0x4e12d4,null))[_0x5ddf('0x26')](removeEntity(_0x4e12d4,null))[_0x5ddf('0x44')](handleError(_0x4e12d4,null));};exports[_0x5ddf('0x4e')]=function(_0x1997c5,_0x1d3663){return db[_0x5ddf('0x2e')][_0x5ddf('0x4e')]()[_0x5ddf('0x26')](respondWithResult(_0x1d3663,null))[_0x5ddf('0x44')](handleError(_0x1d3663,null));};
\ No newline at end of file
+var _0x3b30=['error','stack','name','index','map','UserProfileSection','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','json','reject','save','destroy','then'];(function(_0x283123,_0x23e151){var _0x38d66c=function(_0x17bfd2){while(--_0x17bfd2){_0x283123['push'](_0x283123['shift']());}};_0x38d66c(++_0x23e151);}(_0x3b30,0x6b));var _0x03b3=function(_0x5ad2b3,_0x9a1bec){_0x5ad2b3=_0x5ad2b3-0x0;var _0x1f8d12=_0x3b30[_0x5ad2b3];return _0x1f8d12;};'use strict';var emlformat=require(_0x03b3('0x0'));var rimraf=require(_0x03b3('0x1'));var zipdir=require(_0x03b3('0x2'));var jsonpatch=require(_0x03b3('0x3'));var rp=require('request-promise');var moment=require(_0x03b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x03b3('0x5'));var util=require('util');var path=require(_0x03b3('0x6'));var sox=require(_0x03b3('0x7'));var csv=require(_0x03b3('0x8'));var ejs=require(_0x03b3('0x9'));var fs=require('fs');var fs_extra=require(_0x03b3('0xa'));var _=require(_0x03b3('0xb'));var squel=require('squel');var crypto=require(_0x03b3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x03b3('0xd'));var toCsv=require(_0x03b3('0x8'));var querystring=require(_0x03b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x03b3('0xf'));var authService=require(_0x03b3('0x10'));var qs=require(_0x03b3('0x11'));var as=require(_0x03b3('0x12'));var hardwareService=require(_0x03b3('0x13'));var logger=require(_0x03b3('0x14'))(_0x03b3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x03b3('0x16'));var db=require(_0x03b3('0x17'))['db'];function respondWithStatusCode(_0x482907,_0x46599f){_0x46599f=_0x46599f||0xcc;return function(_0x52ac57){if(_0x52ac57){return _0x482907[_0x03b3('0x18')](_0x46599f);}return _0x482907['status'](_0x46599f)[_0x03b3('0x19')]();};}function respondWithResult(_0x4d9c78,_0x5eb12b){_0x5eb12b=_0x5eb12b||0xc8;return function(_0x4b91c0){if(_0x4b91c0){return _0x4d9c78['status'](_0x5eb12b)['json'](_0x4b91c0);}};}function respondWithFilteredResult(_0x4b9662,_0x2076b2){return function(_0x540e10){if(_0x540e10){var _0x4f586d=typeof _0x2076b2[_0x03b3('0x1a')]===_0x03b3('0x1b')&&typeof _0x2076b2['limit']===_0x03b3('0x1b');var _0x565a90=_0x540e10['count'];var _0x45b3fd=_0x4f586d?0x0:_0x2076b2[_0x03b3('0x1a')];var _0x47ff96=_0x4f586d?_0x540e10[_0x03b3('0x1c')]:_0x2076b2[_0x03b3('0x1a')]+_0x2076b2[_0x03b3('0x1d')];var _0xff33f2;if(_0x47ff96>=_0x565a90){_0x47ff96=_0x565a90;_0xff33f2=0xc8;}else{_0xff33f2=0xce;}_0x4b9662[_0x03b3('0x1e')](_0xff33f2);return _0x4b9662[_0x03b3('0x1f')]('Content-Range',_0x45b3fd+'-'+_0x47ff96+'/'+_0x565a90)[_0x03b3('0x20')](_0x540e10);}return null;};}function patchUpdates(_0x11246c){return function(_0x4d37c7){try{jsonpatch['apply'](_0x4d37c7,_0x11246c,!![]);}catch(_0x22215a){return BPromise[_0x03b3('0x21')](_0x22215a);}return _0x4d37c7[_0x03b3('0x22')]();};}function saveUpdates(_0x46ba59,_0x3c6365){return function(_0x3b82f1){if(_0x3b82f1){return _0x3b82f1['update'](_0x46ba59)['then'](function(_0x539321){return _0x539321;});}return null;};}function removeEntity(_0x1f8166,_0x2ef632){return function(_0xac691c){if(_0xac691c){return _0xac691c[_0x03b3('0x23')]()[_0x03b3('0x24')](function(){_0x1f8166['status'](0xcc)[_0x03b3('0x19')]();});}};}function handleEntityNotFound(_0x4d2179,_0x23ea36){return function(_0x2fb218){if(!_0x2fb218){_0x4d2179[_0x03b3('0x18')](0x194);}return _0x2fb218;};}function handleError(_0x4c50fb,_0x21d684){_0x21d684=_0x21d684||0x1f4;return function(_0xcbd477){logger[_0x03b3('0x25')](_0xcbd477[_0x03b3('0x26')]);if(_0xcbd477[_0x03b3('0x27')]){delete _0xcbd477['name'];}_0x4c50fb['status'](_0x21d684)['send'](_0xcbd477);};}exports[_0x03b3('0x28')]=function(_0x3adf35,_0x34bca9){var _0x35118d={},_0x554971={},_0x123840={'count':0x0,'rows':[]};var _0x55dc64=_[_0x03b3('0x29')](db[_0x03b3('0x2a')]['rawAttributes'],function(_0x49ac81){return{'name':_0x49ac81['fieldName'],'type':_0x49ac81[_0x03b3('0x2b')][_0x03b3('0x2c')]};});_0x554971[_0x03b3('0x2d')]=_[_0x03b3('0x29')](_0x55dc64,'name');_0x554971['query']=_[_0x03b3('0x2e')](_0x3adf35[_0x03b3('0x2f')]);_0x554971[_0x03b3('0x30')]=_[_0x03b3('0x31')](_0x554971[_0x03b3('0x2d')],_0x554971[_0x03b3('0x2f')]);_0x35118d[_0x03b3('0x32')]=_['intersection'](_0x554971['model'],qs['fields'](_0x3adf35[_0x03b3('0x2f')][_0x03b3('0x33')]));_0x35118d['attributes']=_0x35118d[_0x03b3('0x32')]['length']?_0x35118d[_0x03b3('0x32')]:_0x554971[_0x03b3('0x2d')];if(!_0x3adf35[_0x03b3('0x2f')][_0x03b3('0x34')](_0x03b3('0x35'))){_0x35118d[_0x03b3('0x1d')]=qs[_0x03b3('0x1d')](_0x3adf35['query'][_0x03b3('0x1d')]);_0x35118d[_0x03b3('0x1a')]=qs[_0x03b3('0x1a')](_0x3adf35['query'][_0x03b3('0x1a')]);}_0x35118d[_0x03b3('0x36')]=qs[_0x03b3('0x37')](_0x3adf35[_0x03b3('0x2f')]['sort']);_0x35118d[_0x03b3('0x38')]=qs[_0x03b3('0x30')](_['pick'](_0x3adf35[_0x03b3('0x2f')],_0x554971[_0x03b3('0x30')]),_0x55dc64);if(_0x3adf35['query'][_0x03b3('0x39')]){_0x35118d[_0x03b3('0x38')]=_['merge'](_0x35118d[_0x03b3('0x38')],{'$or':_['map'](_0x55dc64,function(_0x35893d){if(_0x35893d['type']!=='VIRTUAL'){var _0x5932a3={};_0x5932a3[_0x35893d[_0x03b3('0x27')]]={'$like':'%'+_0x3adf35[_0x03b3('0x2f')][_0x03b3('0x39')]+'%'};return _0x5932a3;}})});}_0x35118d=_[_0x03b3('0x3a')]({},_0x35118d,_0x3adf35[_0x03b3('0x3b')]);var _0x93220a={'where':_0x35118d[_0x03b3('0x38')]};return db[_0x03b3('0x2a')][_0x03b3('0x1c')](_0x93220a)[_0x03b3('0x24')](function(_0x2ff6f8){_0x123840[_0x03b3('0x1c')]=_0x2ff6f8;if(_0x3adf35[_0x03b3('0x2f')][_0x03b3('0x3c')]){_0x35118d[_0x03b3('0x3d')]=[{'all':!![]}];}return db[_0x03b3('0x2a')][_0x03b3('0x3e')](_0x35118d);})[_0x03b3('0x24')](function(_0x475dd8){_0x123840[_0x03b3('0x3f')]=_0x475dd8;return _0x123840;})[_0x03b3('0x24')](respondWithFilteredResult(_0x34bca9,_0x35118d))['catch'](handleError(_0x34bca9,null));};exports['show']=function(_0x51a0ed,_0x168fae){var _0x352ff1={'raw':![],'where':{'id':_0x51a0ed[_0x03b3('0x40')]['id']}},_0x451366={};_0x451366['model']=_[_0x03b3('0x2e')](db[_0x03b3('0x2a')][_0x03b3('0x41')]);_0x451366[_0x03b3('0x2f')]=_['keys'](_0x51a0ed[_0x03b3('0x2f')]);_0x451366[_0x03b3('0x30')]=_[_0x03b3('0x31')](_0x451366[_0x03b3('0x2d')],_0x451366['query']);_0x352ff1[_0x03b3('0x32')]=_[_0x03b3('0x31')](_0x451366[_0x03b3('0x2d')],qs[_0x03b3('0x33')](_0x51a0ed[_0x03b3('0x2f')][_0x03b3('0x33')]));_0x352ff1['attributes']=_0x352ff1[_0x03b3('0x32')]['length']?_0x352ff1[_0x03b3('0x32')]:_0x451366[_0x03b3('0x2d')];if(_0x51a0ed[_0x03b3('0x2f')][_0x03b3('0x3c')]){_0x352ff1[_0x03b3('0x3d')]=[{'all':!![]}];}_0x352ff1=_[_0x03b3('0x3a')]({},_0x352ff1,_0x51a0ed[_0x03b3('0x3b')]);return db[_0x03b3('0x2a')][_0x03b3('0x42')](_0x352ff1)[_0x03b3('0x24')](handleEntityNotFound(_0x168fae,null))[_0x03b3('0x24')](respondWithResult(_0x168fae,null))['catch'](handleError(_0x168fae,null));};exports[_0x03b3('0x43')]=function(_0x5a1d8c,_0x5b9d8b){return db[_0x03b3('0x2a')][_0x03b3('0x43')](_0x5a1d8c[_0x03b3('0x44')],{})[_0x03b3('0x24')](respondWithResult(_0x5b9d8b,0xc9))[_0x03b3('0x45')](handleError(_0x5b9d8b,null));};exports[_0x03b3('0x46')]=function(_0x40466a,_0x42ed67){if(_0x40466a[_0x03b3('0x44')]['id']){delete _0x40466a[_0x03b3('0x44')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x40466a[_0x03b3('0x40')]['id']}})[_0x03b3('0x24')](handleEntityNotFound(_0x42ed67,null))[_0x03b3('0x24')](saveUpdates(_0x40466a[_0x03b3('0x44')],null))['then'](respondWithResult(_0x42ed67,null))[_0x03b3('0x45')](handleError(_0x42ed67,null));};exports[_0x03b3('0x23')]=function(_0x115f75,_0xa6ef4b){return db[_0x03b3('0x2a')][_0x03b3('0x42')]({'where':{'id':_0x115f75[_0x03b3('0x40')]['id']}})[_0x03b3('0x24')](handleEntityNotFound(_0xa6ef4b,null))['then'](removeEntity(_0xa6ef4b,null))[_0x03b3('0x45')](handleError(_0xa6ef4b,null));};exports['describe']=function(_0x385c53,_0x1346b7){return db[_0x03b3('0x2a')][_0x03b3('0x47')]()[_0x03b3('0x24')](respondWithResult(_0x1346b7,null))[_0x03b3('0x45')](handleError(_0x1346b7,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78a7=['compositeIndex','sectionId','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2a116a,_0x3dcbbb){var _0x49d0a0=function(_0x2637f0){while(--_0x2637f0){_0x2a116a['push'](_0x2a116a['shift']());}};_0x49d0a0(++_0x3dcbbb);}(_0x78a7,0x80));var _0x778a=function(_0x55bf96,_0x7267a7){_0x55bf96=_0x55bf96-0x0;var _0x5092ef=_0x78a7[_0x55bf96];return _0x5092ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x778a('0x0'))(_0x778a('0x1'));var moment=require(_0x778a('0x2'));var BPromise=require(_0x778a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x778a('0x4'));var rimraf=require(_0x778a('0x5'));var config=require(_0x778a('0x6'));var attributes=require(_0x778a('0x7'));module[_0x778a('0x8')]=function(_0x45f8b4,_0x5e98c9){return _0x45f8b4[_0x778a('0x9')](_0x778a('0xa'),attributes,{'tableName':_0x778a('0xb'),'paranoid':![],'indexes':[{'name':_0x778a('0xc'),'fields':[_0x778a('0xd'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47f5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x101695,_0x57826d){var _0xa47257=function(_0x4495b3){while(--_0x4495b3){_0x101695['push'](_0x101695['shift']());}};_0xa47257(++_0x57826d);}(_0x47f5,0xa9));var _0x547f=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0x47f5[_0x5caf7e];return _0x5c3435;};'use strict';var _=require(_0x547f('0x0'));var util=require(_0x547f('0x1'));var logger=require(_0x547f('0x2'))(_0x547f('0x3'));var moment=require(_0x547f('0x4'));var BPromise=require(_0x547f('0x5'));var rp=require(_0x547f('0x6'));var fs=require('fs');var path=require(_0x547f('0x7'));var rimraf=require(_0x547f('0x8'));var config=require(_0x547f('0x9'));var attributes=require(_0x547f('0xa'));module[_0x547f('0xb')]=function(_0x721494,_0x16b2c6){return _0x721494[_0x547f('0xc')](_0x547f('0xd'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x547f('0xe'),'fields':[_0x547f('0xf'),_0x547f('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe024=['../../config/environment','jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x2267e9,_0x484306){var _0x46a637=function(_0x2c0ce6){while(--_0x2c0ce6){_0x2267e9['push'](_0x2267e9['shift']());}};_0x46a637(++_0x484306);}(_0xe024,0x161));var _0x4e02=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0xe024[_0x193ddf];return _0x5bc6df;};'use strict';var _=require(_0x4e02('0x0'));var util=require(_0x4e02('0x1'));var moment=require(_0x4e02('0x2'));var BPromise=require(_0x4e02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e02('0x4'));var db=require(_0x4e02('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e02('0x6'));var config=require(_0x4e02('0x7'));var jayson=require(_0x4e02('0x8'));var client=jayson[_0x4e02('0x9')][_0x4e02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dc13b,_0x4651bf,_0x304fe2){return new BPromise(function(_0x175d9a,_0x1ca861){return client['request'](_0x5dc13b,_0x304fe2)[_0x4e02('0xb')](function(_0x245f3c){logger['info'](_0x4e02('0xc'),_0x4651bf,_0x4e02('0xd'));logger['debug'](_0x4e02('0xe'),_0x4651bf,_0x4e02('0xd'),JSON[_0x4e02('0xf')](_0x245f3c));if(_0x245f3c[_0x4e02('0x10')]){if(_0x245f3c[_0x4e02('0x10')]['code']===0x1f4){logger['error'](_0x4e02('0xc'),_0x4651bf,_0x245f3c[_0x4e02('0x10')][_0x4e02('0x11')]);return _0x1ca861(_0x245f3c['error'][_0x4e02('0x11')]);}logger[_0x4e02('0x10')](_0x4e02('0xc'),_0x4651bf,_0x245f3c['error']['message']);return _0x175d9a(_0x245f3c['error'][_0x4e02('0x11')]);}else{logger[_0x4e02('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x4651bf,'request\x20sent');_0x175d9a(_0x245f3c['result']['message']);}})[_0x4e02('0x13')](function(_0x404c87){logger['error'](_0x4e02('0xc'),_0x4651bf,_0x404c87);_0x1ca861(_0x404c87);});});}
\ No newline at end of file
+var _0x4f1c=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s'];(function(_0x1eac11,_0x39b8ef){var _0x2a3dbe=function(_0x402495){while(--_0x402495){_0x1eac11['push'](_0x1eac11['shift']());}};_0x2a3dbe(++_0x39b8ef);}(_0x4f1c,0x18f));var _0xc4f1=function(_0x5f1eac,_0x44bcf4){_0x5f1eac=_0x5f1eac-0x0;var _0x1f0d60=_0x4f1c[_0x5f1eac];return _0x1f0d60;};'use strict';var _=require(_0xc4f1('0x0'));var util=require(_0xc4f1('0x1'));var moment=require(_0xc4f1('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4f1('0x3'));var fs=require('fs');var Redis=require(_0xc4f1('0x4'));var db=require(_0xc4f1('0x5'))['db'];var utils=require(_0xc4f1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc4f1('0x7'));var jayson=require(_0xc4f1('0x8'));var client=jayson['client'][_0xc4f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40d93c,_0x5c7584,_0x1c6c07){return new BPromise(function(_0x2b2c43,_0x41353f){return client[_0xc4f1('0xa')](_0x40d93c,_0x1c6c07)['then'](function(_0x3e603e){logger[_0xc4f1('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x5c7584,_0xc4f1('0xc'));logger[_0xc4f1('0xd')](_0xc4f1('0xe'),_0x5c7584,_0xc4f1('0xc'),JSON[_0xc4f1('0xf')](_0x3e603e));if(_0x3e603e[_0xc4f1('0x10')]){if(_0x3e603e[_0xc4f1('0x10')][_0xc4f1('0x11')]===0x1f4){logger[_0xc4f1('0x10')](_0xc4f1('0x12'),_0x5c7584,_0x3e603e['error'][_0xc4f1('0x13')]);return _0x41353f(_0x3e603e[_0xc4f1('0x10')][_0xc4f1('0x13')]);}logger[_0xc4f1('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5c7584,_0x3e603e[_0xc4f1('0x10')][_0xc4f1('0x13')]);return _0x2b2c43(_0x3e603e[_0xc4f1('0x10')][_0xc4f1('0x13')]);}else{logger[_0xc4f1('0xb')](_0xc4f1('0x12'),_0x5c7584,'request\x20sent');_0x2b2c43(_0x3e603e[_0xc4f1('0x14')][_0xc4f1('0x13')]);}})[_0xc4f1('0x15')](function(_0xc32ec0){logger[_0xc4f1('0x10')](_0xc4f1('0x12'),_0x5c7584,_0xc32ec0);_0x41353f(_0xc32ec0);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5091ac,_0x347ff7){var _0x40524b=function(_0x754225){while(--_0x754225){_0x5091ac['push'](_0x5091ac['shift']());}};_0x40524b(++_0x347ff7);}(_0x70e0,0x17b));var _0x070e=function(_0x19fc20,_0x327b3a){_0x19fc20=_0x19fc20-0x0;var _0x85d9e6=_0x70e0[_0x19fc20];return _0x85d9e6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4fec6a,_0x52151){var _0x892072=function(_0x1aed45){while(--_0x1aed45){_0x4fec6a['push'](_0x4fec6a['shift']());}};_0x892072(++_0x52151);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ed81d,_0x332882){_0x3ed81d=_0x3ed81d-0x0;var _0x3d4362=_0xedd9[_0x3ed81d];return _0x3d4362;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9806=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9806,0x193));var _0x6980=function(_0x125550,_0x11ce62){_0x125550=_0x125550-0x0;var _0x123a1a=_0x9806[_0x125550];return _0x123a1a;};'use strict';var Sequelize=require(_0x6980('0x0'));module[_0x6980('0x1')]={'penalty':{'type':Sequelize[_0x6980('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x43a6=['INTEGER','sequelize','exports'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x43a6,0x9d));var _0x643a=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x43a6[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0x643a('0x0'));module[_0x643a('0x1')]={'penalty':{'type':Sequelize[_0x643a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4cbb4a,_0x532f48){var _0x6f6285=function(_0x60d4d2){while(--_0x60d4d2){_0x4cbb4a['push'](_0x4cbb4a['shift']());}};_0x6f6285(++_0x532f48);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x30cae7,_0x1116cc){_0x30cae7=_0x30cae7-0x0;var _0x38b11b=_0x3f8a[_0x30cae7];return _0x38b11b;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','moment'];(function(_0x5f5bfe,_0x1408a5){var _0x452874=function(_0x3cfec7){while(--_0x3cfec7){_0x5f5bfe['push'](_0x5f5bfe['shift']());}};_0x452874(++_0x1408a5);}(_0x6f44,0x1ea));var _0x46f4=function(_0x231946,_0x31c56f){_0x231946=_0x231946-0x0;var _0x5e6787=_0x6f44[_0x231946];return _0x5e6787;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));module[_0x46f4('0xa')]=function(_0x57f1a9,_0x169a5a){return _0x57f1a9[_0x46f4('0xb')](_0x46f4('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71ce=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x93b4b7,_0x1492dd){var _0x4ef863=function(_0xd7b0f1){while(--_0xd7b0f1){_0x93b4b7['push'](_0x93b4b7['shift']());}};_0x4ef863(++_0x1492dd);}(_0x71ce,0x109));var _0xe71c=function(_0x33bfe5,_0xab5ebd){_0x33bfe5=_0x33bfe5-0x0;var _0x3965c5=_0x71ce[_0x33bfe5];return _0x3965c5;};'use strict';var _=require('lodash');var util=require(_0xe71c('0x0'));var moment=require(_0xe71c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe71c('0x2'));var fs=require('fs');var Redis=require(_0xe71c('0x3'));var db=require(_0xe71c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe71c('0x5'))(_0xe71c('0x6'));var config=require(_0xe71c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe71c('0x8')][_0xe71c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfa464f,_0x4d30d6,_0x73084b){return new BPromise(function(_0x4bbb03,_0x303a35){return client[_0xe71c('0xa')](_0xfa464f,_0x73084b)[_0xe71c('0xb')](function(_0x323a42){logger[_0xe71c('0xc')](_0xe71c('0xd'),_0x4d30d6,_0xe71c('0xe'));logger[_0xe71c('0xf')](_0xe71c('0x10'),_0x4d30d6,'request\x20sent',JSON[_0xe71c('0x11')](_0x323a42));if(_0x323a42[_0xe71c('0x12')]){if(_0x323a42[_0xe71c('0x12')][_0xe71c('0x13')]===0x1f4){logger[_0xe71c('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x4d30d6,_0x323a42[_0xe71c('0x12')][_0xe71c('0x14')]);return _0x303a35(_0x323a42[_0xe71c('0x12')][_0xe71c('0x14')]);}logger[_0xe71c('0x12')](_0xe71c('0xd'),_0x4d30d6,_0x323a42[_0xe71c('0x12')][_0xe71c('0x14')]);return _0x4bbb03(_0x323a42['error'][_0xe71c('0x14')]);}else{logger[_0xe71c('0xc')](_0xe71c('0xd'),_0x4d30d6,_0xe71c('0xe'));_0x4bbb03(_0x323a42[_0xe71c('0x15')]['message']);}})[_0xe71c('0x16')](function(_0x430bea){logger[_0xe71c('0x12')](_0xe71c('0xd'),_0x4d30d6,_0x430bea);_0x303a35(_0x430bea);});});}
\ No newline at end of file
+var _0x15f7=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x31bd38,_0x15d8b9){var _0x157502=function(_0xcde68d){while(--_0xcde68d){_0x31bd38['push'](_0x31bd38['shift']());}};_0x157502(++_0x15d8b9);}(_0x15f7,0x175));var _0x715f=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0x15f7[_0x10e8ed];return _0x4aea4a;};'use strict';var _=require(_0x715f('0x0'));var util=require('util');var moment=require(_0x715f('0x1'));var BPromise=require(_0x715f('0x2'));var rs=require(_0x715f('0x3'));var fs=require('fs');var Redis=require(_0x715f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x715f('0x5'))(_0x715f('0x6'));var config=require(_0x715f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x715f('0x8')][_0x715f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x178c5e,_0x3dd65b,_0xbe929d){return new BPromise(function(_0x3f1337,_0x1427a3){return client[_0x715f('0xa')](_0x178c5e,_0xbe929d)[_0x715f('0xb')](function(_0x3f7efa){logger[_0x715f('0xc')](_0x715f('0xd'),_0x3dd65b,'request\x20sent');logger[_0x715f('0xe')](_0x715f('0xf'),_0x3dd65b,_0x715f('0x10'),JSON['stringify'](_0x3f7efa));if(_0x3f7efa[_0x715f('0x11')]){if(_0x3f7efa[_0x715f('0x11')][_0x715f('0x12')]===0x1f4){logger[_0x715f('0x11')](_0x715f('0xd'),_0x3dd65b,_0x3f7efa[_0x715f('0x11')][_0x715f('0x13')]);return _0x1427a3(_0x3f7efa[_0x715f('0x11')][_0x715f('0x13')]);}logger[_0x715f('0x11')](_0x715f('0xd'),_0x3dd65b,_0x3f7efa['error']['message']);return _0x3f1337(_0x3f7efa[_0x715f('0x11')][_0x715f('0x13')]);}else{logger[_0x715f('0xc')](_0x715f('0xd'),_0x3dd65b,'request\x20sent');_0x3f1337(_0x3f7efa[_0x715f('0x14')][_0x715f('0x13')]);}})[_0x715f('0x15')](function(_0x49d65b){logger[_0x715f('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x3dd65b,_0x49d65b);_0x1427a3(_0x49d65b);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec76=['INTEGER','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xec76,0x121));var _0x6ec7=function(_0x2fd809,_0x2a62cb){_0x2fd809=_0x2fd809-0x0;var _0x13b7b2=_0xec76[_0x2fd809];return _0x13b7b2;};'use strict';var Sequelize=require(_0x6ec7('0x0'));module[_0x6ec7('0x1')]={'UserId':{'type':Sequelize[_0x6ec7('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6ec7('0x2')]}};
\ No newline at end of file
+var _0x0d68=['sequelize','exports','INTEGER'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0d68,0xc3));var _0x80d6=function(_0x2f855c,_0x343689){_0x2f855c=_0x2f855c-0x0;var _0xa235dd=_0x0d68[_0x2f855c];return _0xa235dd;};'use strict';var Sequelize=require(_0x80d6('0x0'));module[_0x80d6('0x1')]={'UserId':{'type':Sequelize[_0x80d6('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x193847,_0x193568){var _0x13eacc=function(_0xe63c5e){while(--_0xe63c5e){_0x193847['push'](_0x193847['shift']());}};_0x13eacc(++_0x193568);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x49cab3,_0x3b3f86){var _0x205abf=function(_0x2b97f4){while(--_0x2b97f4){_0x49cab3['push'](_0x49cab3['shift']());}};_0x205abf(++_0x3b3f86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fc735,_0x11db60){var _0x574095=function(_0x421590){while(--_0x421590){_0x1fc735['push'](_0x1fc735['shift']());}};_0x574095(++_0x11db60);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xc40a2a,_0x2b356e){var _0x5eaafe=function(_0x2a83d3){while(--_0x2a83d3){_0xc40a2a['push'](_0xc40a2a['shift']());}};_0x5eaafe(++_0x2b356e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xcb91[_0x17a32f];return _0x15a293;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef45=['exports','INTEGER','sequelize'];(function(_0x8f70f2,_0x3c8ca9){var _0x4a5e19=function(_0x26fc9c){while(--_0x26fc9c){_0x8f70f2['push'](_0x8f70f2['shift']());}};_0x4a5e19(++_0x3c8ca9);}(_0xef45,0xe3));var _0x5ef4=function(_0x1d8ebd,_0x583b23){_0x1d8ebd=_0x1d8ebd-0x0;var _0x11974c=_0xef45[_0x1d8ebd];return _0x11974c;};'use strict';var Sequelize=require(_0x5ef4('0x0'));module[_0x5ef4('0x1')]={'penalty':{'type':Sequelize[_0x5ef4('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1161=['sequelize','exports','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1161,0x156));var _0x1116=function(_0xa09baf,_0x9765f0){_0xa09baf=_0xa09baf-0x0;var _0x2d1454=_0x1161[_0xa09baf];return _0x2d1454;};'use strict';var Sequelize=require(_0x1116('0x0'));module[_0x1116('0x1')]={'penalty':{'type':Sequelize[_0x1116('0x2')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb4d=['path','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util','../../config/logger','moment','request-promise'];(function(_0x14c3a8,_0x45b63e){var _0x41632f=function(_0x40be03){while(--_0x40be03){_0x14c3a8['push'](_0x14c3a8['shift']());}};_0x41632f(++_0x45b63e);}(_0xdb4d,0x1e1));var _0xddb4=function(_0x45da8e,_0x5e2f98){_0x45da8e=_0x45da8e-0x0;var _0x4375a6=_0xdb4d[_0x45da8e];return _0x4375a6;};'use strict';var _=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var logger=require(_0xddb4('0x2'))('api');var moment=require(_0xddb4('0x3'));var BPromise=require('bluebird');var rp=require(_0xddb4('0x4'));var fs=require('fs');var path=require(_0xddb4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xddb4('0x6'));module[_0xddb4('0x7')]=function(_0x4f4e93,_0x93080f){return _0x4f4e93['define'](_0xddb4('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1c9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x56af03,_0x548a7e){var _0x42f6ba=function(_0x8e6389){while(--_0x8e6389){_0x56af03['push'](_0x56af03['shift']());}};_0x42f6ba(++_0x548a7e);}(_0xf1c9,0x145));var _0x9f1c=function(_0x3f8948,_0x417062){_0x3f8948=_0x3f8948-0x0;var _0x396f2f=_0xf1c9[_0x3f8948];return _0x396f2f;};'use strict';var _=require('lodash');var util=require(_0x9f1c('0x0'));var logger=require(_0x9f1c('0x1'))(_0x9f1c('0x2'));var moment=require(_0x9f1c('0x3'));var BPromise=require(_0x9f1c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f1c('0x5'));var rimraf=require(_0x9f1c('0x6'));var config=require(_0x9f1c('0x7'));var attributes=require(_0x9f1c('0x8'));module[_0x9f1c('0x9')]=function(_0x16b7d9,_0x21b624){return _0x16b7d9[_0x9f1c('0xa')](_0x9f1c('0xb'),attributes,{'tableName':_0x9f1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdef=['jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3e4dca,_0x4541b3){var _0x3d3e08=function(_0x2f9d03){while(--_0x2f9d03){_0x3e4dca['push'](_0x3e4dca['shift']());}};_0x3d3e08(++_0x4541b3);}(_0xbdef,0x1db));var _0xfbde=function(_0x4e47f7,_0x205e52){_0x4e47f7=_0x4e47f7-0x0;var _0x24b111=_0xbdef[_0x4e47f7];return _0x24b111;};'use strict';var _=require(_0xfbde('0x0'));var util=require(_0xfbde('0x1'));var moment=require('moment');var BPromise=require(_0xfbde('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbde('0x3'));var db=require(_0xfbde('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbde('0x5'))(_0xfbde('0x6'));var config=require(_0xfbde('0x7'));var jayson=require(_0xfbde('0x8'));var client=jayson[_0xfbde('0x9')][_0xfbde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15355b,_0x7c126a,_0x59432c){return new BPromise(function(_0x763d7b,_0x2ad794){return client[_0xfbde('0xb')](_0x15355b,_0x59432c)[_0xfbde('0xc')](function(_0x2b0b50){logger[_0xfbde('0xd')](_0xfbde('0xe'),_0x7c126a,_0xfbde('0xf'));logger[_0xfbde('0x10')](_0xfbde('0x11'),_0x7c126a,'request\x20sent',JSON[_0xfbde('0x12')](_0x2b0b50));if(_0x2b0b50['error']){if(_0x2b0b50[_0xfbde('0x13')][_0xfbde('0x14')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x7c126a,_0x2b0b50[_0xfbde('0x13')]['message']);return _0x2ad794(_0x2b0b50[_0xfbde('0x13')][_0xfbde('0x15')]);}logger[_0xfbde('0x13')](_0xfbde('0xe'),_0x7c126a,_0x2b0b50['error'][_0xfbde('0x15')]);return _0x763d7b(_0x2b0b50[_0xfbde('0x13')][_0xfbde('0x15')]);}else{logger['info'](_0xfbde('0xe'),_0x7c126a,_0xfbde('0xf'));_0x763d7b(_0x2b0b50['result'][_0xfbde('0x15')]);}})[_0xfbde('0x16')](function(_0x232069){logger[_0xfbde('0x13')](_0xfbde('0xe'),_0x7c126a,_0x232069);_0x2ad794(_0x232069);});});}
\ No newline at end of file
+var _0x1285=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x545f8b,_0x475cf8){var _0x3ea7c9=function(_0x37cff0){while(--_0x37cff0){_0x545f8b['push'](_0x545f8b['shift']());}};_0x3ea7c9(++_0x475cf8);}(_0x1285,0xa0));var _0x5128=function(_0x36c12a,_0x5d843f){_0x36c12a=_0x36c12a-0x0;var _0x10aa7c=_0x1285[_0x36c12a];return _0x10aa7c;};'use strict';var _=require(_0x5128('0x0'));var util=require('util');var moment=require(_0x5128('0x1'));var BPromise=require(_0x5128('0x2'));var rs=require(_0x5128('0x3'));var fs=require('fs');var Redis=require(_0x5128('0x4'));var db=require(_0x5128('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5128('0x6'))(_0x5128('0x7'));var config=require(_0x5128('0x8'));var jayson=require(_0x5128('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb91fcc,_0x42a704,_0x24a4b5){return new BPromise(function(_0x1f336c,_0x31b500){return client[_0x5128('0xa')](_0xb91fcc,_0x24a4b5)[_0x5128('0xb')](function(_0x4836eb){logger[_0x5128('0xc')](_0x5128('0xd'),_0x42a704,_0x5128('0xe'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x42a704,'request\x20sent',JSON['stringify'](_0x4836eb));if(_0x4836eb['error']){if(_0x4836eb[_0x5128('0xf')][_0x5128('0x10')]===0x1f4){logger[_0x5128('0xf')](_0x5128('0xd'),_0x42a704,_0x4836eb['error']['message']);return _0x31b500(_0x4836eb['error']['message']);}logger[_0x5128('0xf')](_0x5128('0xd'),_0x42a704,_0x4836eb[_0x5128('0xf')][_0x5128('0x11')]);return _0x1f336c(_0x4836eb[_0x5128('0xf')][_0x5128('0x11')]);}else{logger['info'](_0x5128('0xd'),_0x42a704,'request\x20sent');_0x1f336c(_0x4836eb[_0x5128('0x12')][_0x5128('0x11')]);}})[_0x5128('0x13')](function(_0x3e26b3){logger['error'](_0x5128('0xd'),_0x42a704,_0x3e26b3);_0x31b500(_0x3e26b3);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2d6e76,_0x3684f0){var _0x4f651b=function(_0x469f42){while(--_0x469f42){_0x2d6e76['push'](_0x2d6e76['shift']());}};_0x4f651b(++_0x3684f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x137e92,_0x3b3ff9){var _0x389720=function(_0xa11391){while(--_0xa11391){_0x137e92['push'](_0x137e92['shift']());}};_0x389720(++_0x3b3ff9);}(_0xedd9,0xfc));var _0x9edd=function(_0x5c0bbb,_0x3f60d4){_0x5c0bbb=_0x5c0bbb-0x0;var _0x258894=_0xedd9[_0x5c0bbb];return _0x258894;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4053=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x2e68dd,_0x1f1f1d){var _0x29bb3b=function(_0x14b3d3){while(--_0x14b3d3){_0x2e68dd['push'](_0x2e68dd['shift']());}};_0x29bb3b(++_0x1f1f1d);}(_0x4053,0xd7));var _0x3405=function(_0x3420bd,_0x34703d){_0x3420bd=_0x3420bd-0x0;var _0x5c7793=_0x4053[_0x3420bd];return _0x5c7793;};'use strict';var Sequelize=require(_0x3405('0x0'));module[_0x3405('0x1')]={'uniqueid':{'type':Sequelize[_0x3405('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3405('0x3')},'membername':{'type':Sequelize[_0x3405('0x4')],'allowNull':![],'comment':_0x3405('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3405('0x4')],'allowNull':![],'unique':_0x3405('0x5'),'comment':_0x3405('0x3')},'VoiceQueueId':{'type':Sequelize[_0x3405('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x3405('0x3')},'penalty':{'type':Sequelize[_0x3405('0x2')](0xb),'defaultValue':0x0,'comment':_0x3405('0x3')},'paused':{'type':Sequelize[_0x3405('0x2')](0xb),'defaultValue':0x0,'comment':_0x3405('0x3')}};
\ No newline at end of file
+var _0xea60=['queue_interface','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xea60,0xd9));var _0x0ea6=function(_0x48dd89,_0x77fa68){_0x48dd89=_0x48dd89-0x0;var _0x28d9f6=_0xea60[_0x48dd89];return _0x28d9f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0ea6('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0ea6('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0ea6('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0ea6('0x2')],'allowNull':![],'unique':_0x0ea6('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x0ea6('0x0')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0ea6('0x3'),'comment':_0x0ea6('0x1')},'penalty':{'type':Sequelize[_0x0ea6('0x0')](0xb),'defaultValue':0x0,'comment':_0x0ea6('0x1')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0ea6('0x1')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4bf7=['update','remove','emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x3f6fe3,_0x27b19a){var _0x143ba9=function(_0xc7f90f){while(--_0xc7f90f){_0x3f6fe3['push'](_0x3f6fe3['shift']());}};_0x143ba9(++_0x27b19a);}(_0x4bf7,0x6a));var _0x74bf=function(_0x1e9f7c,_0x5941b2){_0x1e9f7c=_0x1e9f7c-0x0;var _0x1112a3=_0x4bf7[_0x1e9f7c];return _0x1112a3;};'use strict';var EventEmitter=require(_0x74bf('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x74bf('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x74bf('0x2')](0x0);var events={'afterCreate':_0x74bf('0x3'),'afterUpdate':_0x74bf('0x4'),'afterDestroy':_0x74bf('0x5')};function emitEvent(_0x39a585){return function(_0x274274,_0xf0beb,_0x185b80){UserVoiceQueueRtEvents['emit'](_0x39a585+':'+_0x274274['id'],_0x274274);UserVoiceQueueRtEvents[_0x74bf('0x6')](_0x39a585,_0x274274);_0x185b80(null);};}for(var e in events){if(events[_0x74bf('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x74bf('0x8')](e,emitEvent(event));}}module[_0x74bf('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xd709=['save','remove','emit','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x3df163,_0x56f0cb){var _0x5c908d=function(_0x49dc1c){while(--_0x49dc1c){_0x3df163['push'](_0x3df163['shift']());}};_0x5c908d(++_0x56f0cb);}(_0xd709,0x8c));var _0x9d70=function(_0x15e943,_0x39f7cd){_0x15e943=_0x15e943-0x0;var _0xd68bef=_0xd709[_0x15e943];return _0xd68bef;};'use strict';var EventEmitter=require(_0x9d70('0x0'));var UserVoiceQueueRt=require(_0x9d70('0x1'))['db'][_0x9d70('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9d70('0x3')](0x0);var events={'afterCreate':_0x9d70('0x4'),'afterUpdate':'update','afterDestroy':_0x9d70('0x5')};function emitEvent(_0x45aa00){return function(_0x4bade6,_0x31ada6,_0x93492d){UserVoiceQueueRtEvents[_0x9d70('0x6')](_0x45aa00+':'+_0x4bade6['id'],_0x4bade6);UserVoiceQueueRtEvents[_0x9d70('0x6')](_0x45aa00,_0x4bade6);_0x93492d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x9d70('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x89f0=['exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird','request-promise','rimraf','./userVoiceQueueRt.attributes'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x89f0,0x143));var _0x089f=function(_0xeb134b,_0x2aa58a){_0xeb134b=_0xeb134b-0x0;var _0x50a9db=_0x89f0[_0xeb134b];return _0x50a9db;};'use strict';var _=require(_0x089f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x089f('0x1'));var moment=require(_0x089f('0x2'));var BPromise=require(_0x089f('0x3'));var rp=require(_0x089f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x089f('0x5'));var config=require('../../config/environment');var attributes=require(_0x089f('0x6'));module[_0x089f('0x7')]=function(_0x55ccdb,_0xa264d3){return _0x55ccdb['define'](_0x089f('0x8'),attributes,{'tableName':_0x089f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f12=['rimraf','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5af145,_0xa96dc7){var _0x5c2ce4=function(_0x48278c){while(--_0x48278c){_0x5af145['push'](_0x5af145['shift']());}};_0x5c2ce4(++_0xa96dc7);}(_0x3f12,0x7d));var _0x23f1=function(_0x499640,_0x543489){_0x499640=_0x499640-0x0;var _0x33d98e=_0x3f12[_0x499640];return _0x33d98e;};'use strict';var _=require(_0x23f1('0x0'));var util=require('util');var logger=require(_0x23f1('0x1'))(_0x23f1('0x2'));var moment=require(_0x23f1('0x3'));var BPromise=require(_0x23f1('0x4'));var rp=require(_0x23f1('0x5'));var fs=require('fs');var path=require(_0x23f1('0x6'));var rimraf=require(_0x23f1('0x7'));var config=require('../../config/environment');var attributes=require(_0x23f1('0x8'));module['exports']=function(_0x3bedd1,_0x493b5b){return _0x3bedd1['define'](_0x23f1('0x9'),attributes,{'tableName':_0x23f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb74b=['result','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','GetVoiceQueueRtPauses','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x393438,_0x4883a6){var _0x2a0986=function(_0x15a93b){while(--_0x15a93b){_0x393438['push'](_0x393438['shift']());}};_0x2a0986(++_0x4883a6);}(_0xb74b,0xbf));var _0xbb74=function(_0x51f84a,_0x445f17){_0x51f84a=_0x51f84a-0x0;var _0x4ba63d=_0xb74b[_0x51f84a];return _0x4ba63d;};'use strict';var _=require(_0xbb74('0x0'));var util=require(_0xbb74('0x1'));var moment=require('moment');var BPromise=require(_0xbb74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb74('0x3'));var db=require(_0xbb74('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb74('0x5'))('rpc');var config=require(_0xbb74('0x6'));var jayson=require(_0xbb74('0x7'));var client=jayson[_0xbb74('0x8')][_0xbb74('0x9')]({'port':0x232a});config[_0xbb74('0xa')]=_[_0xbb74('0xb')](config[_0xbb74('0xa')],{'host':_0xbb74('0xc'),'port':0x18eb});var socket=require(_0xbb74('0xd'))(new Redis(config['redis']));require(_0xbb74('0xe'))[_0xbb74('0xf')](socket);function respondWithRpcPromise(_0x15cc42,_0x4f60ff,_0x14b89c){return new BPromise(function(_0x4ef951,_0x52cf98){return client['request'](_0x15cc42,_0x14b89c)[_0xbb74('0x10')](function(_0x577181){logger['info'](_0xbb74('0x11'),_0x4f60ff,_0xbb74('0x12'));logger[_0xbb74('0x13')](_0xbb74('0x14'),_0x4f60ff,_0xbb74('0x12'),JSON['stringify'](_0x577181));if(_0x577181[_0xbb74('0x15')]){if(_0x577181[_0xbb74('0x15')][_0xbb74('0x16')]===0x1f4){logger[_0xbb74('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4f60ff,_0x577181[_0xbb74('0x15')][_0xbb74('0x17')]);return _0x52cf98(_0x577181[_0xbb74('0x15')][_0xbb74('0x17')]);}logger['error'](_0xbb74('0x11'),_0x4f60ff,_0x577181[_0xbb74('0x15')][_0xbb74('0x17')]);return _0x4ef951(_0x577181[_0xbb74('0x15')]['message']);}else{logger[_0xbb74('0x18')](_0xbb74('0x11'),_0x4f60ff,_0xbb74('0x12'));_0x4ef951(_0x577181[_0xbb74('0x19')][_0xbb74('0x17')]);}})[_0xbb74('0x1a')](function(_0x4ef05c){logger[_0xbb74('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4f60ff,_0x4ef05c);_0x52cf98(_0x4ef05c);});});}exports['GetVoiceQueueRtPauses']=function(_0x3f8d71){var _0x34a326=this;return new Promise(function(_0x28a6ae,_0x528ccb){return db[_0xbb74('0x1b')][_0xbb74('0x1c')]({'raw':_0x3f8d71['options']?_0x3f8d71[_0xbb74('0x1d')][_0xbb74('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f8d71['options']?_0x3f8d71[_0xbb74('0x1d')][_0xbb74('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0xbb74('0x20'),db[_0xbb74('0x21')]['fn']('IF',db[_0xbb74('0x21')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xbb74('0x10')](function(_0xfc9dda){logger['info'](_0xbb74('0x22'),_0x3f8d71);logger[_0xbb74('0x13')]('GetVoiceQueueRtPauses',_0x3f8d71,JSON[_0xbb74('0x23')](_0xfc9dda));_0x28a6ae(_0xfc9dda);})[_0xbb74('0x1a')](function(_0x254dee){logger[_0xbb74('0x15')](_0xbb74('0x22'),_0x254dee['message'],_0x3f8d71);_0x528ccb(_0x34a326[_0xbb74('0x15')](0x1f4,_0x254dee[_0xbb74('0x17')]));});});};
\ No newline at end of file
+var _0x2bba=['socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','info','result','catch','GetVoiceQueueRtPauses','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x170844,_0x63618b){var _0x191513=function(_0x4fe526){while(--_0x4fe526){_0x170844['push'](_0x170844['shift']());}};_0x191513(++_0x63618b);}(_0x2bba,0x197));var _0xa2bb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2bba[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xa2bb('0x0'));var moment=require(_0xa2bb('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2bb('0x2'));var fs=require('fs');var Redis=require(_0xa2bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2bb('0x4'));var logger=require(_0xa2bb('0x5'))(_0xa2bb('0x6'));var config=require(_0xa2bb('0x7'));var jayson=require(_0xa2bb('0x8'));var client=jayson['client'][_0xa2bb('0x9')]({'port':0x232a});config[_0xa2bb('0xa')]=_[_0xa2bb('0xb')](config[_0xa2bb('0xa')],{'host':_0xa2bb('0xc'),'port':0x18eb});var socket=require(_0xa2bb('0xd'))(new Redis(config[_0xa2bb('0xa')]));require('./userVoiceQueueRt.socket')[_0xa2bb('0xe')](socket);function respondWithRpcPromise(_0x4f00a3,_0x3770ba,_0x2d0241){return new BPromise(function(_0x26ca07,_0x119230){return client[_0xa2bb('0xf')](_0x4f00a3,_0x2d0241)[_0xa2bb('0x10')](function(_0x370abf){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3770ba,_0xa2bb('0x11'));logger[_0xa2bb('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3770ba,_0xa2bb('0x11'),JSON[_0xa2bb('0x13')](_0x370abf));if(_0x370abf[_0xa2bb('0x14')]){if(_0x370abf[_0xa2bb('0x14')][_0xa2bb('0x15')]===0x1f4){logger[_0xa2bb('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3770ba,_0x370abf[_0xa2bb('0x14')][_0xa2bb('0x16')]);return _0x119230(_0x370abf[_0xa2bb('0x14')][_0xa2bb('0x16')]);}logger[_0xa2bb('0x14')](_0xa2bb('0x17'),_0x3770ba,_0x370abf[_0xa2bb('0x14')][_0xa2bb('0x16')]);return _0x26ca07(_0x370abf[_0xa2bb('0x14')][_0xa2bb('0x16')]);}else{logger[_0xa2bb('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3770ba,_0xa2bb('0x11'));_0x26ca07(_0x370abf[_0xa2bb('0x19')][_0xa2bb('0x16')]);}})[_0xa2bb('0x1a')](function(_0x11c9bd){logger[_0xa2bb('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3770ba,_0x11c9bd);_0x119230(_0x11c9bd);});});}exports[_0xa2bb('0x1b')]=function(_0x1607b5){var _0x5d2ce9=this;return new Promise(function(_0x20f70c,_0x45963f){return db['UserVoiceQueueRt'][_0xa2bb('0x1c')]({'raw':_0x1607b5[_0xa2bb('0x1d')]?_0x1607b5[_0xa2bb('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1607b5[_0xa2bb('0x1d')]?_0x1607b5['options'][_0xa2bb('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xa2bb('0x1f')]['fn']('IF',db[_0xa2bb('0x1f')][_0xa2bb('0x20')](_0xa2bb('0x21')))),_0xa2bb('0x22')]]})['then'](function(_0x47e825){logger[_0xa2bb('0x18')](_0xa2bb('0x1b'),_0x1607b5);logger['debug'](_0xa2bb('0x1b'),_0x1607b5,JSON[_0xa2bb('0x13')](_0x47e825));_0x20f70c(_0x47e825);})[_0xa2bb('0x1a')](function(_0x17290b){logger[_0xa2bb('0x14')](_0xa2bb('0x1b'),_0x17290b[_0xa2bb('0x16')],_0x1607b5);_0x45963f(_0x5d2ce9[_0xa2bb('0x14')](0x1f4,_0x17290b[_0xa2bb('0x16')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x448a=['removeListener','register','length','save','remove','emit'];(function(_0x7902d0,_0x378152){var _0x2ab4ac=function(_0x1837ee){while(--_0x1837ee){_0x7902d0['push'](_0x7902d0['shift']());}};_0x2ab4ac(++_0x378152);}(_0x448a,0x1ef));var _0xa448=function(_0x2db2e4,_0x49130e){_0x2db2e4=_0x2db2e4-0x0;var _0x2ef52d=_0x448a[_0x2db2e4];return _0x2ef52d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa448('0x0'),_0xa448('0x1'),'update'];function createListener(_0x3f08b0,_0x47909c){return function(_0x5ea7f4){_0x47909c[_0xa448('0x2')](_0x3f08b0,_0x5ea7f4);};}function removeListener(_0x3206fd,_0x57e1ea){return function(){UserVoiceQueueRtEvents[_0xa448('0x3')](_0x3206fd,_0x57e1ea);};}exports[_0xa448('0x4')]=function(_0x343b79){for(var _0x2c16e3=0x0,_0x12b0e2=events[_0xa448('0x5')];_0x2c16e3<_0x12b0e2;_0x2c16e3++){var _0x1ec2d8=events[_0x2c16e3];var _0x54bdb0=createListener('userVoiceQueueRt:'+_0x1ec2d8,_0x343b79);UserVoiceQueueRtEvents['on'](_0x1ec2d8,_0x54bdb0);}};
\ No newline at end of file
+var _0xa786=['removeListener','register','length','userVoiceQueueRt:','remove','update','emit'];(function(_0x1346b4,_0x2e2a46){var _0x2eda7a=function(_0x2c0880){while(--_0x2c0880){_0x1346b4['push'](_0x1346b4['shift']());}};_0x2eda7a(++_0x2e2a46);}(_0xa786,0x1d2));var _0x6a78=function(_0x2ffe86,_0x5ab572){_0x2ffe86=_0x2ffe86-0x0;var _0x2dbb9e=_0xa786[_0x2ffe86];return _0x2dbb9e;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x6a78('0x0'),_0x6a78('0x1')];function createListener(_0x96d812,_0x2c7e2a){return function(_0x22723f){_0x2c7e2a[_0x6a78('0x2')](_0x96d812,_0x22723f);};}function removeListener(_0x34b520,_0x521b4a){return function(){UserVoiceQueueRtEvents[_0x6a78('0x3')](_0x34b520,_0x521b4a);};}exports[_0x6a78('0x4')]=function(_0xc0be8b){for(var _0x45470e=0x0,_0x28d286=events[_0x6a78('0x5')];_0x45470e<_0x28d286;_0x45470e++){var _0x2b8c4c=events[_0x45470e];var _0x2a6de6=createListener(_0x6a78('0x6')+_0x2b8c4c,_0xc0be8b);UserVoiceQueueRtEvents['on'](_0x2b8c4c,_0x2a6de6);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4a1412,_0x2b6ee8){var _0x2cc456=function(_0x2cf4a4){while(--_0x2cf4a4){_0x4a1412['push'](_0x4a1412['shift']());}};_0x2cc456(++_0x2b6ee8);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x51b52e,_0x3c2506){var _0x59a011=function(_0x397663){while(--_0x397663){_0x51b52e['push'](_0x51b52e['shift']());}};_0x59a011(++_0x3c2506);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf36f=['exports','INTEGER','sequelize'];(function(_0x45c3b1,_0x4c7f4d){var _0x4376bb=function(_0x18b344){while(--_0x18b344){_0x45c3b1['push'](_0x45c3b1['shift']());}};_0x4376bb(++_0x4c7f4d);}(_0xf36f,0x155));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff36('0x0'));module[_0xff36('0x1')]={'penalty':{'type':Sequelize[_0xff36('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x60ba=['INTEGER','exports'];(function(_0x12c009,_0x4c0e82){var _0x4a9879=function(_0x1f093c){while(--_0x1f093c){_0x12c009['push'](_0x12c009['shift']());}};_0x4a9879(++_0x4c0e82);}(_0x60ba,0x16f));var _0xa60b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x60ba[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xa60b('0x0')]={'penalty':{'type':Sequelize[_0xa60b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc1f8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0x4f6436,_0x4b59ac){var _0x3756b8=function(_0x3dd272){while(--_0x3dd272){_0x4f6436['push'](_0x4f6436['shift']());}};_0x3756b8(++_0x4b59ac);}(_0xc1f8,0x1df));var _0x8c1f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc1f8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8c1f('0x0'));var util=require('util');var logger=require(_0x8c1f('0x1'))(_0x8c1f('0x2'));var moment=require('moment');var BPromise=require(_0x8c1f('0x3'));var rp=require(_0x8c1f('0x4'));var fs=require('fs');var path=require(_0x8c1f('0x5'));var rimraf=require(_0x8c1f('0x6'));var config=require(_0x8c1f('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x8c1f('0x8')]=function(_0x91c35b,_0xe77753){return _0x91c35b[_0x8c1f('0x9')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf942=['UserWhatsappQueue','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xf942,0x1f0));var _0x2f94=function(_0x11da12,_0x33c978){_0x11da12=_0x11da12-0x0;var _0x37190c=_0xf942[_0x11da12];return _0x37190c;};'use strict';var _=require(_0x2f94('0x0'));var util=require(_0x2f94('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2f94('0x2'));var BPromise=require('bluebird');var rp=require(_0x2f94('0x3'));var fs=require('fs');var path=require(_0x2f94('0x4'));var rimraf=require(_0x2f94('0x5'));var config=require(_0x2f94('0x6'));var attributes=require(_0x2f94('0x7'));module[_0x2f94('0x8')]=function(_0xcc9799,_0x2ecc2b){return _0xcc9799[_0x2f94('0x9')](_0x2f94('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4432=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x550916,_0x5cf877){var _0x2f20d3=function(_0x2f6bcd){while(--_0x2f6bcd){_0x550916['push'](_0x550916['shift']());}};_0x2f20d3(++_0x5cf877);}(_0x4432,0x8e));var _0x2443=function(_0x32c45e,_0x29d229){_0x32c45e=_0x32c45e-0x0;var _0x495bfe=_0x4432[_0x32c45e];return _0x495bfe;};'use strict';var _=require(_0x2443('0x0'));var util=require('util');var moment=require(_0x2443('0x1'));var BPromise=require('bluebird');var rs=require(_0x2443('0x2'));var fs=require('fs');var Redis=require(_0x2443('0x3'));var db=require(_0x2443('0x4'))['db'];var utils=require(_0x2443('0x5'));var logger=require('../../config/logger')(_0x2443('0x6'));var config=require(_0x2443('0x7'));var jayson=require(_0x2443('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9e4355,_0x58dece,_0x598b32){return new BPromise(function(_0x31bff8,_0x30560d){return client[_0x2443('0x9')](_0x9e4355,_0x598b32)[_0x2443('0xa')](function(_0x389aa7){logger[_0x2443('0xb')](_0x2443('0xc'),_0x58dece,_0x2443('0xd'));logger[_0x2443('0xe')](_0x2443('0xf'),_0x58dece,_0x2443('0xd'),JSON[_0x2443('0x10')](_0x389aa7));if(_0x389aa7[_0x2443('0x11')]){if(_0x389aa7[_0x2443('0x11')][_0x2443('0x12')]===0x1f4){logger[_0x2443('0x11')](_0x2443('0xc'),_0x58dece,_0x389aa7[_0x2443('0x11')][_0x2443('0x13')]);return _0x30560d(_0x389aa7[_0x2443('0x11')][_0x2443('0x13')]);}logger[_0x2443('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x58dece,_0x389aa7[_0x2443('0x11')]['message']);return _0x31bff8(_0x389aa7[_0x2443('0x11')][_0x2443('0x13')]);}else{logger[_0x2443('0xb')](_0x2443('0xc'),_0x58dece,_0x2443('0xd'));_0x31bff8(_0x389aa7[_0x2443('0x14')][_0x2443('0x13')]);}})['catch'](function(_0x36bfc4){logger[_0x2443('0x11')](_0x2443('0xc'),_0x58dece,_0x36bfc4);_0x30560d(_0x36bfc4);});});}
\ No newline at end of file
+var _0x872e=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1d503b,_0x468b68){var _0x5bace6=function(_0x2fae68){while(--_0x2fae68){_0x1d503b['push'](_0x1d503b['shift']());}};_0x5bace6(++_0x468b68);}(_0x872e,0x1eb));var _0xe872=function(_0x206cbe,_0x593e74){_0x206cbe=_0x206cbe-0x0;var _0x531873=_0x872e[_0x206cbe];return _0x531873;};'use strict';var _=require(_0xe872('0x0'));var util=require(_0xe872('0x1'));var moment=require(_0xe872('0x2'));var BPromise=require(_0xe872('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe872('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe872('0x5'));var logger=require(_0xe872('0x6'))(_0xe872('0x7'));var config=require('../../config/environment');var jayson=require(_0xe872('0x8'));var client=jayson[_0xe872('0x9')][_0xe872('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28f9db,_0x309a8d,_0x134f5e){return new BPromise(function(_0x13a7e4,_0x25de2b){return client[_0xe872('0xb')](_0x28f9db,_0x134f5e)['then'](function(_0x5ede38){logger[_0xe872('0xc')](_0xe872('0xd'),_0x309a8d,_0xe872('0xe'));logger[_0xe872('0xf')](_0xe872('0x10'),_0x309a8d,'request\x20sent',JSON[_0xe872('0x11')](_0x5ede38));if(_0x5ede38[_0xe872('0x12')]){if(_0x5ede38[_0xe872('0x12')][_0xe872('0x13')]===0x1f4){logger[_0xe872('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x309a8d,_0x5ede38[_0xe872('0x12')]['message']);return _0x25de2b(_0x5ede38['error'][_0xe872('0x14')]);}logger[_0xe872('0x12')](_0xe872('0xd'),_0x309a8d,_0x5ede38[_0xe872('0x12')][_0xe872('0x14')]);return _0x13a7e4(_0x5ede38[_0xe872('0x12')]['message']);}else{logger[_0xe872('0xc')](_0xe872('0xd'),_0x309a8d,_0xe872('0xe'));_0x13a7e4(_0x5ede38[_0xe872('0x15')][_0xe872('0x14')]);}})[_0xe872('0x16')](function(_0x4a08e9){logger[_0xe872('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x309a8d,_0x4a08e9);_0x25de2b(_0x4a08e9);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38c3=['../../components/interaction/service','./variable.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0x38c3,0x13d));var _0x338c=function(_0x4f840d,_0x5d6218){_0x4f840d=_0x4f840d-0x0;var _0x315f81=_0x38c3[_0x4f840d];return _0x315f81;};'use strict';var multer=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var path=require('path');var timeout=require(_0x338c('0x2'));var express=require(_0x338c('0x3'));var router=express[_0x338c('0x4')]();var fs_extra=require(_0x338c('0x5'));var auth=require(_0x338c('0x6'));var interaction=require(_0x338c('0x7'));var config=require('../../config/environment');var controller=require(_0x338c('0x8'));router['get']('/',auth[_0x338c('0x9')](),controller[_0x338c('0xa')]);router['get'](_0x338c('0xb'),auth[_0x338c('0x9')](),controller[_0x338c('0xc')]);router['post']('/',auth[_0x338c('0x9')](),controller[_0x338c('0xd')]);router[_0x338c('0xe')](_0x338c('0xb'),auth[_0x338c('0x9')](),controller[_0x338c('0xf')]);router[_0x338c('0x10')]('/:id',auth[_0x338c('0x9')](),controller[_0x338c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xecd5=['delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x1ff5ba,_0x3b56d7){var _0x402dd5=function(_0x5ad889){while(--_0x5ad889){_0x1ff5ba['push'](_0x1ff5ba['shift']());}};_0x402dd5(++_0x3b56d7);}(_0xecd5,0x110));var _0x5ecd=function(_0x589a6f,_0x3cfb86){_0x589a6f=_0x589a6f-0x0;var _0x12bc02=_0xecd5[_0x589a6f];return _0x12bc02;};'use strict';var multer=require('multer');var util=require(_0x5ecd('0x0'));var path=require(_0x5ecd('0x1'));var timeout=require(_0x5ecd('0x2'));var express=require('express');var router=express[_0x5ecd('0x3')]();var fs_extra=require(_0x5ecd('0x4'));var auth=require(_0x5ecd('0x5'));var interaction=require(_0x5ecd('0x6'));var config=require('../../config/environment');var controller=require(_0x5ecd('0x7'));router['get']('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x9')]);router['get'](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xb')]);router[_0x5ecd('0xc')]('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xd')]);router[_0x5ecd('0xe')](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xf')]);router[_0x5ecd('0x10')](_0x5ecd('0xa'),auth['isAuthenticated'](),controller[_0x5ecd('0x11')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b0c=['sequelize','STRING','name'];(function(_0x4cad2a,_0x572bc4){var _0x431fad=function(_0x55ec52){while(--_0x55ec52){_0x4cad2a['push'](_0x4cad2a['shift']());}};_0x431fad(++_0x572bc4);}(_0x4b0c,0x138));var _0xc4b0=function(_0x3d51eb,_0x5911df){_0x3d51eb=_0x3d51eb-0x0;var _0x203c01=_0x4b0c[_0x3d51eb];return _0x203c01;};'use strict';var Sequelize=require(_0xc4b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4b0('0x1')],'unique':_0xc4b0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x31bb=['STRING','name','exports'];(function(_0xa03445,_0x5c340a){var _0x26e3ef=function(_0xd1603c){while(--_0xd1603c){_0xa03445['push'](_0xa03445['shift']());}};_0x26e3ef(++_0x5c340a);}(_0x31bb,0x1e2));var _0xb31b=function(_0x3bf17f,_0x400711){_0x3bf17f=_0x3bf17f-0x0;var _0x2d0a66=_0x31bb[_0x3bf17f];return _0x2d0a66;};'use strict';var Sequelize=require('sequelize');module[_0xb31b('0x0')]={'name':{'type':Sequelize[_0xb31b('0x1')],'unique':_0xb31b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb31b('0x1')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b2b=['type','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','Variables','error','stack','name','send','index','map','Variable','rawAttributes','fieldName'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b2b,0x171));var _0xb1b2=function(_0x565de9,_0x114287){_0x565de9=_0x565de9-0x0;var _0x5f5dab=_0x1b2b[_0x565de9];return _0x5f5dab;};'use strict';var emlformat=require(_0xb1b2('0x0'));var rimraf=require(_0xb1b2('0x1'));var zipdir=require(_0xb1b2('0x2'));var jsonpatch=require(_0xb1b2('0x3'));var rp=require(_0xb1b2('0x4'));var moment=require(_0xb1b2('0x5'));var BPromise=require(_0xb1b2('0x6'));var Mustache=require(_0xb1b2('0x7'));var util=require(_0xb1b2('0x8'));var path=require(_0xb1b2('0x9'));var sox=require(_0xb1b2('0xa'));var csv=require(_0xb1b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1b2('0xc'));var _=require('lodash');var squel=require(_0xb1b2('0xd'));var crypto=require('crypto');var jsforce=require(_0xb1b2('0xe'));var deskjs=require(_0xb1b2('0xf'));var toCsv=require(_0xb1b2('0xb'));var querystring=require(_0xb1b2('0x10'));var Papa=require(_0xb1b2('0x11'));var Redis=require(_0xb1b2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb1b2('0x13'));var as=require(_0xb1b2('0x14'));var hardwareService=require(_0xb1b2('0x15'));var logger=require(_0xb1b2('0x16'))(_0xb1b2('0x17'));var utils=require(_0xb1b2('0x18'));var config=require(_0xb1b2('0x19'));var licenseUtil=require(_0xb1b2('0x1a'));var db=require(_0xb1b2('0x1b'))['db'];function respondWithStatusCode(_0x1bf366,_0x2a19cd){_0x2a19cd=_0x2a19cd||0xcc;return function(_0x2ebd6b){if(_0x2ebd6b){return _0x1bf366['sendStatus'](_0x2a19cd);}return _0x1bf366[_0xb1b2('0x1c')](_0x2a19cd)[_0xb1b2('0x1d')]();};}function respondWithResult(_0x129630,_0x14244f){_0x14244f=_0x14244f||0xc8;return function(_0x1fe682){if(_0x1fe682){return _0x129630[_0xb1b2('0x1c')](_0x14244f)[_0xb1b2('0x1e')](_0x1fe682);}};}function respondWithFilteredResult(_0x5406be,_0x3bd30c){return function(_0x26e2bc){if(_0x26e2bc){var _0x1cf2a7=typeof _0x3bd30c['offset']===_0xb1b2('0x1f')&&typeof _0x3bd30c['limit']===_0xb1b2('0x1f');var _0x5066a1=_0x26e2bc[_0xb1b2('0x20')];var _0x5981dd=_0x1cf2a7?0x0:_0x3bd30c['offset'];var _0x307b48=_0x1cf2a7?_0x26e2bc['count']:_0x3bd30c[_0xb1b2('0x21')]+_0x3bd30c[_0xb1b2('0x22')];var _0x578977;if(_0x307b48>=_0x5066a1){_0x307b48=_0x5066a1;_0x578977=0xc8;}else{_0x578977=0xce;}_0x5406be[_0xb1b2('0x1c')](_0x578977);return _0x5406be[_0xb1b2('0x23')](_0xb1b2('0x24'),_0x5981dd+'-'+_0x307b48+'/'+_0x5066a1)[_0xb1b2('0x1e')](_0x26e2bc);}return null;};}function patchUpdates(_0x9010e){return function(_0x121930){try{jsonpatch[_0xb1b2('0x25')](_0x121930,_0x9010e,!![]);}catch(_0x3aa9c7){return BPromise[_0xb1b2('0x26')](_0x3aa9c7);}return _0x121930['save']();};}function saveUpdates(_0x37fdf9,_0x4553ac){return function(_0x287d0e){if(_0x287d0e){return _0x287d0e[_0xb1b2('0x27')](_0x37fdf9)[_0xb1b2('0x28')](function(_0xe5816b){return _0xe5816b;});}return null;};}function removeEntity(_0x250849,_0x47cfa4){return function(_0x5e4c7e){if(_0x5e4c7e){return _0x5e4c7e['destroy']()['then'](function(){var _0x2f5406=_0x5e4c7e['get']({'plain':!![]});var _0x317ed7=_0xb1b2('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x317ed7,'resourceId':_0x2f5406['id']}})['then'](function(){return _0x5e4c7e;});})[_0xb1b2('0x28')](function(){_0x250849[_0xb1b2('0x1c')](0xcc)[_0xb1b2('0x1d')]();});}};}function handleEntityNotFound(_0xbd3355,_0x15eda2){return function(_0x2212fe){if(!_0x2212fe){_0xbd3355['sendStatus'](0x194);}return _0x2212fe;};}function handleError(_0x52b108,_0x3a36e8){_0x3a36e8=_0x3a36e8||0x1f4;return function(_0x304a90){logger[_0xb1b2('0x2a')](_0x304a90[_0xb1b2('0x2b')]);if(_0x304a90[_0xb1b2('0x2c')]){delete _0x304a90[_0xb1b2('0x2c')];}_0x52b108[_0xb1b2('0x1c')](_0x3a36e8)[_0xb1b2('0x2d')](_0x304a90);};}exports[_0xb1b2('0x2e')]=function(_0x4eef44,_0x2a2beb){var _0x204033={},_0x925c2a={},_0x21c942={'count':0x0,'rows':[]};var _0x1f9185=_[_0xb1b2('0x2f')](db[_0xb1b2('0x30')][_0xb1b2('0x31')],function(_0x43c052){return{'name':_0x43c052[_0xb1b2('0x32')],'type':_0x43c052[_0xb1b2('0x33')]['key']};});_0x925c2a['model']=_[_0xb1b2('0x2f')](_0x1f9185,_0xb1b2('0x2c'));_0x925c2a[_0xb1b2('0x34')]=_[_0xb1b2('0x35')](_0x4eef44[_0xb1b2('0x34')]);_0x925c2a[_0xb1b2('0x36')]=_[_0xb1b2('0x37')](_0x925c2a[_0xb1b2('0x38')],_0x925c2a[_0xb1b2('0x34')]);_0x204033[_0xb1b2('0x39')]=_[_0xb1b2('0x37')](_0x925c2a[_0xb1b2('0x38')],qs['fields'](_0x4eef44['query']['fields']));_0x204033[_0xb1b2('0x39')]=_0x204033[_0xb1b2('0x39')][_0xb1b2('0x3a')]?_0x204033[_0xb1b2('0x39')]:_0x925c2a[_0xb1b2('0x38')];if(!_0x4eef44[_0xb1b2('0x34')]['hasOwnProperty'](_0xb1b2('0x3b'))){_0x204033[_0xb1b2('0x22')]=qs['limit'](_0x4eef44['query'][_0xb1b2('0x22')]);_0x204033[_0xb1b2('0x21')]=qs['offset'](_0x4eef44[_0xb1b2('0x34')]['offset']);}_0x204033[_0xb1b2('0x3c')]=qs[_0xb1b2('0x3d')](_0x4eef44[_0xb1b2('0x34')][_0xb1b2('0x3d')]);_0x204033[_0xb1b2('0x3e')]=qs['filters'](_[_0xb1b2('0x3f')](_0x4eef44['query'],_0x925c2a[_0xb1b2('0x36')]),_0x1f9185);if(_0x4eef44[_0xb1b2('0x34')]['filter']){_0x204033[_0xb1b2('0x3e')]=_['merge'](_0x204033['where'],{'$or':_[_0xb1b2('0x2f')](_0x1f9185,function(_0x3939e3){if(_0x3939e3[_0xb1b2('0x33')]!==_0xb1b2('0x40')){var _0x4fd424={};_0x4fd424[_0x3939e3[_0xb1b2('0x2c')]]={'$like':'%'+_0x4eef44[_0xb1b2('0x34')]['filter']+'%'};return _0x4fd424;}})});}_0x204033=_[_0xb1b2('0x41')]({},_0x204033,_0x4eef44[_0xb1b2('0x42')]);var _0x50785f={'where':_0x204033[_0xb1b2('0x3e')]};return db['Variable'][_0xb1b2('0x20')](_0x50785f)[_0xb1b2('0x28')](function(_0x4d7973){_0x21c942[_0xb1b2('0x20')]=_0x4d7973;if(_0x4eef44[_0xb1b2('0x34')][_0xb1b2('0x43')]){_0x204033['include']=[{'all':!![]}];}return db['Variable'][_0xb1b2('0x44')](_0x204033);})[_0xb1b2('0x28')](function(_0x51b15f){_0x21c942[_0xb1b2('0x45')]=_0x51b15f;return _0x21c942;})[_0xb1b2('0x28')](respondWithFilteredResult(_0x2a2beb,_0x204033))['catch'](handleError(_0x2a2beb,null));};exports['show']=function(_0x13a9d8,_0xb6bfc3){var _0x15b316={'raw':!![],'where':{'id':_0x13a9d8[_0xb1b2('0x46')]['id']}},_0x553336={};_0x553336['model']=_['keys'](db[_0xb1b2('0x30')]['rawAttributes']);_0x553336[_0xb1b2('0x34')]=_['keys'](_0x13a9d8[_0xb1b2('0x34')]);_0x553336[_0xb1b2('0x36')]=_[_0xb1b2('0x37')](_0x553336[_0xb1b2('0x38')],_0x553336[_0xb1b2('0x34')]);_0x15b316[_0xb1b2('0x39')]=_[_0xb1b2('0x37')](_0x553336[_0xb1b2('0x38')],qs[_0xb1b2('0x47')](_0x13a9d8[_0xb1b2('0x34')][_0xb1b2('0x47')]));_0x15b316[_0xb1b2('0x39')]=_0x15b316[_0xb1b2('0x39')]['length']?_0x15b316[_0xb1b2('0x39')]:_0x553336[_0xb1b2('0x38')];if(_0x13a9d8[_0xb1b2('0x34')]['includeAll']){_0x15b316[_0xb1b2('0x48')]=[{'all':!![]}];}_0x15b316=_[_0xb1b2('0x41')]({},_0x15b316,_0x13a9d8[_0xb1b2('0x42')]);return db['Variable'][_0xb1b2('0x49')](_0x15b316)['then'](handleEntityNotFound(_0xb6bfc3,null))[_0xb1b2('0x28')](respondWithResult(_0xb6bfc3,null))['catch'](handleError(_0xb6bfc3,null));};exports['create']=function(_0x4fa0e1,_0x2eaabc){return db[_0xb1b2('0x30')][_0xb1b2('0x4a')](_0x4fa0e1[_0xb1b2('0x4b')],{})[_0xb1b2('0x28')](function(_0x738ef2){var _0x379219=_0x4fa0e1[_0xb1b2('0x4c')]['get']({'plain':!![]});if(!_0x379219)throw new Error(_0xb1b2('0x4d'));if(_0x379219[_0xb1b2('0x4e')]===_0xb1b2('0x4c')){var _0x3d7f47=_0x738ef2['get']({'plain':!![]});var _0x46f022=_0xb1b2('0x29');return db[_0xb1b2('0x4f')]['find']({'where':{'name':_0x46f022,'userProfileId':_0x379219[_0xb1b2('0x50')]},'raw':!![]})[_0xb1b2('0x28')](function(_0x467272){if(_0x467272&&_0x467272[_0xb1b2('0x51')]===0x0){return db[_0xb1b2('0x52')][_0xb1b2('0x4a')]({'name':_0x3d7f47['name'],'resourceId':_0x3d7f47['id'],'type':_0x467272[_0xb1b2('0x2c')],'sectionId':_0x467272['id']},{})[_0xb1b2('0x28')](function(){return _0x738ef2;});}else{return _0x738ef2;}})[_0xb1b2('0x53')](function(_0x3562c3){logger[_0xb1b2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3562c3);throw _0x3562c3;});}return _0x738ef2;})[_0xb1b2('0x28')](respondWithResult(_0x2eaabc,0xc9))[_0xb1b2('0x53')](handleError(_0x2eaabc,null));};exports['update']=function(_0xfb60ac,_0x57a817){if(_0xfb60ac[_0xb1b2('0x4b')]['id']){delete _0xfb60ac[_0xb1b2('0x4b')]['id'];}return db[_0xb1b2('0x30')][_0xb1b2('0x49')]({'where':{'id':_0xfb60ac[_0xb1b2('0x46')]['id']}})[_0xb1b2('0x28')](handleEntityNotFound(_0x57a817,null))[_0xb1b2('0x28')](saveUpdates(_0xfb60ac[_0xb1b2('0x4b')],null))[_0xb1b2('0x28')](respondWithResult(_0x57a817,null))[_0xb1b2('0x53')](handleError(_0x57a817,null));};exports['destroy']=function(_0x1a6454,_0x2d3f35){return db[_0xb1b2('0x30')]['find']({'where':{'id':_0x1a6454[_0xb1b2('0x46')]['id']}})[_0xb1b2('0x28')](handleEntityNotFound(_0x2d3f35,null))[_0xb1b2('0x28')](removeEntity(_0x2d3f35,null))['catch'](handleError(_0x2d3f35,null));};
\ No newline at end of file
+var _0xf09a=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','error','name','send','index','Variable','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','count','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','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3c26cb,_0x1b19a3){var _0x1f3a28=function(_0x36e3fa){while(--_0x36e3fa){_0x3c26cb['push'](_0x3c26cb['shift']());}};_0x1f3a28(++_0x1b19a3);}(_0xf09a,0x134));var _0xaf09=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0xf09a[_0x4492af];return _0x216729;};'use strict';var emlformat=require(_0xaf09('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf09('0x1'));var jsonpatch=require(_0xaf09('0x2'));var rp=require(_0xaf09('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xaf09('0x4'));var sox=require(_0xaf09('0x5'));var csv=require(_0xaf09('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf09('0x7'));var _=require(_0xaf09('0x8'));var squel=require(_0xaf09('0x9'));var crypto=require(_0xaf09('0xa'));var jsforce=require(_0xaf09('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf09('0x6'));var querystring=require(_0xaf09('0xc'));var Papa=require(_0xaf09('0xd'));var Redis=require('ioredis');var authService=require(_0xaf09('0xe'));var qs=require(_0xaf09('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf09('0x10'));var logger=require(_0xaf09('0x11'))('api');var utils=require(_0xaf09('0x12'));var config=require(_0xaf09('0x13'));var licenseUtil=require(_0xaf09('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x67c1a6,_0x5f3685){_0x5f3685=_0x5f3685||0xcc;return function(_0x6c6d86){if(_0x6c6d86){return _0x67c1a6[_0xaf09('0x15')](_0x5f3685);}return _0x67c1a6[_0xaf09('0x16')](_0x5f3685)[_0xaf09('0x17')]();};}function respondWithResult(_0x3f64b0,_0x2a2272){_0x2a2272=_0x2a2272||0xc8;return function(_0x260db9){if(_0x260db9){return _0x3f64b0[_0xaf09('0x16')](_0x2a2272)[_0xaf09('0x18')](_0x260db9);}};}function respondWithFilteredResult(_0x53ee7a,_0x4e7d51){return function(_0x18f5ff){if(_0x18f5ff){var _0xadc72c=typeof _0x4e7d51[_0xaf09('0x19')]===_0xaf09('0x1a')&&typeof _0x4e7d51[_0xaf09('0x1b')]===_0xaf09('0x1a');var _0x20cd3c=_0x18f5ff['count'];var _0x2c5ffc=_0xadc72c?0x0:_0x4e7d51['offset'];var _0x17c6a7=_0xadc72c?_0x18f5ff['count']:_0x4e7d51['offset']+_0x4e7d51['limit'];var _0x3fd3d9;if(_0x17c6a7>=_0x20cd3c){_0x17c6a7=_0x20cd3c;_0x3fd3d9=0xc8;}else{_0x3fd3d9=0xce;}_0x53ee7a['status'](_0x3fd3d9);return _0x53ee7a['set'](_0xaf09('0x1c'),_0x2c5ffc+'-'+_0x17c6a7+'/'+_0x20cd3c)[_0xaf09('0x18')](_0x18f5ff);}return null;};}function patchUpdates(_0x93c7b4){return function(_0x41ba9a){try{jsonpatch[_0xaf09('0x1d')](_0x41ba9a,_0x93c7b4,!![]);}catch(_0x46cd6f){return BPromise[_0xaf09('0x1e')](_0x46cd6f);}return _0x41ba9a[_0xaf09('0x1f')]();};}function saveUpdates(_0xb16c9b,_0x313085){return function(_0x54a681){if(_0x54a681){return _0x54a681[_0xaf09('0x20')](_0xb16c9b)['then'](function(_0x1042ae){return _0x1042ae;});}return null;};}function removeEntity(_0x563295,_0x480045){return function(_0xc6f00f){if(_0xc6f00f){return _0xc6f00f[_0xaf09('0x21')]()[_0xaf09('0x22')](function(){var _0x30a90c=_0xc6f00f[_0xaf09('0x23')]({'plain':!![]});var _0x58328f=_0xaf09('0x24');return db[_0xaf09('0x25')]['destroy']({'where':{'type':_0x58328f,'resourceId':_0x30a90c['id']}})[_0xaf09('0x22')](function(){return _0xc6f00f;});})['then'](function(){_0x563295[_0xaf09('0x16')](0xcc)[_0xaf09('0x17')]();});}};}function handleEntityNotFound(_0x4b1f90,_0x21293a){return function(_0x49ee57){if(!_0x49ee57){_0x4b1f90[_0xaf09('0x15')](0x194);}return _0x49ee57;};}function handleError(_0xc9ba2a,_0x23c080){_0x23c080=_0x23c080||0x1f4;return function(_0x19d9f8){logger[_0xaf09('0x26')](_0x19d9f8['stack']);if(_0x19d9f8[_0xaf09('0x27')]){delete _0x19d9f8[_0xaf09('0x27')];}_0xc9ba2a[_0xaf09('0x16')](_0x23c080)[_0xaf09('0x28')](_0x19d9f8);};}exports[_0xaf09('0x29')]=function(_0x2c46cc,_0xafbdf5){var _0x11a004={},_0x94b12a={},_0x4d9d81={'count':0x0,'rows':[]};var _0x950b34=_['map'](db[_0xaf09('0x2a')][_0xaf09('0x2b')],function(_0x17361d){return{'name':_0x17361d[_0xaf09('0x2c')],'type':_0x17361d[_0xaf09('0x2d')][_0xaf09('0x2e')]};});_0x94b12a['model']=_[_0xaf09('0x2f')](_0x950b34,'name');_0x94b12a[_0xaf09('0x30')]=_[_0xaf09('0x31')](_0x2c46cc[_0xaf09('0x30')]);_0x94b12a[_0xaf09('0x32')]=_[_0xaf09('0x33')](_0x94b12a[_0xaf09('0x34')],_0x94b12a[_0xaf09('0x30')]);_0x11a004[_0xaf09('0x35')]=_[_0xaf09('0x33')](_0x94b12a[_0xaf09('0x34')],qs[_0xaf09('0x36')](_0x2c46cc[_0xaf09('0x30')][_0xaf09('0x36')]));_0x11a004[_0xaf09('0x35')]=_0x11a004[_0xaf09('0x35')][_0xaf09('0x37')]?_0x11a004[_0xaf09('0x35')]:_0x94b12a[_0xaf09('0x34')];if(!_0x2c46cc[_0xaf09('0x30')][_0xaf09('0x38')]('nolimit')){_0x11a004[_0xaf09('0x1b')]=qs['limit'](_0x2c46cc[_0xaf09('0x30')][_0xaf09('0x1b')]);_0x11a004[_0xaf09('0x19')]=qs[_0xaf09('0x19')](_0x2c46cc['query']['offset']);}_0x11a004[_0xaf09('0x39')]=qs[_0xaf09('0x3a')](_0x2c46cc[_0xaf09('0x30')][_0xaf09('0x3a')]);_0x11a004[_0xaf09('0x3b')]=qs[_0xaf09('0x32')](_['pick'](_0x2c46cc[_0xaf09('0x30')],_0x94b12a[_0xaf09('0x32')]),_0x950b34);if(_0x2c46cc[_0xaf09('0x30')]['filter']){_0x11a004[_0xaf09('0x3b')]=_[_0xaf09('0x3c')](_0x11a004[_0xaf09('0x3b')],{'$or':_[_0xaf09('0x2f')](_0x950b34,function(_0x3421c3){if(_0x3421c3['type']!=='VIRTUAL'){var _0x527bbc={};_0x527bbc[_0x3421c3[_0xaf09('0x27')]]={'$like':'%'+_0x2c46cc[_0xaf09('0x30')][_0xaf09('0x3d')]+'%'};return _0x527bbc;}})});}_0x11a004=_[_0xaf09('0x3c')]({},_0x11a004,_0x2c46cc[_0xaf09('0x3e')]);var _0x303c1e={'where':_0x11a004['where']};return db[_0xaf09('0x2a')][_0xaf09('0x3f')](_0x303c1e)['then'](function(_0x2e9d05){_0x4d9d81['count']=_0x2e9d05;if(_0x2c46cc[_0xaf09('0x30')][_0xaf09('0x40')]){_0x11a004[_0xaf09('0x41')]=[{'all':!![]}];}return db[_0xaf09('0x2a')][_0xaf09('0x42')](_0x11a004);})['then'](function(_0xde76f9){_0x4d9d81[_0xaf09('0x43')]=_0xde76f9;return _0x4d9d81;})[_0xaf09('0x22')](respondWithFilteredResult(_0xafbdf5,_0x11a004))[_0xaf09('0x44')](handleError(_0xafbdf5,null));};exports[_0xaf09('0x45')]=function(_0xbd11e4,_0x46d5b4){var _0x1a9532={'raw':!![],'where':{'id':_0xbd11e4[_0xaf09('0x46')]['id']}},_0xb06bf4={};_0xb06bf4[_0xaf09('0x34')]=_[_0xaf09('0x31')](db[_0xaf09('0x2a')][_0xaf09('0x2b')]);_0xb06bf4['query']=_['keys'](_0xbd11e4[_0xaf09('0x30')]);_0xb06bf4['filters']=_[_0xaf09('0x33')](_0xb06bf4[_0xaf09('0x34')],_0xb06bf4[_0xaf09('0x30')]);_0x1a9532['attributes']=_[_0xaf09('0x33')](_0xb06bf4['model'],qs[_0xaf09('0x36')](_0xbd11e4[_0xaf09('0x30')][_0xaf09('0x36')]));_0x1a9532['attributes']=_0x1a9532[_0xaf09('0x35')][_0xaf09('0x37')]?_0x1a9532[_0xaf09('0x35')]:_0xb06bf4[_0xaf09('0x34')];if(_0xbd11e4[_0xaf09('0x30')][_0xaf09('0x40')]){_0x1a9532['include']=[{'all':!![]}];}_0x1a9532=_[_0xaf09('0x3c')]({},_0x1a9532,_0xbd11e4['options']);return db['Variable'][_0xaf09('0x47')](_0x1a9532)[_0xaf09('0x22')](handleEntityNotFound(_0x46d5b4,null))['then'](respondWithResult(_0x46d5b4,null))[_0xaf09('0x44')](handleError(_0x46d5b4,null));};exports[_0xaf09('0x48')]=function(_0xe0a672,_0x367a48){return db[_0xaf09('0x2a')][_0xaf09('0x48')](_0xe0a672[_0xaf09('0x49')],{})[_0xaf09('0x22')](function(_0x42fb04){var _0x3ee8c3=_0xe0a672[_0xaf09('0x4a')][_0xaf09('0x23')]({'plain':!![]});if(!_0x3ee8c3)throw new Error(_0xaf09('0x4b'));if(_0x3ee8c3[_0xaf09('0x4c')]===_0xaf09('0x4a')){var _0x21ee76=_0x42fb04['get']({'plain':!![]});var _0xd03b74='Variables';return db[_0xaf09('0x4d')][_0xaf09('0x47')]({'where':{'name':_0xd03b74,'userProfileId':_0x3ee8c3[_0xaf09('0x4e')]},'raw':!![]})[_0xaf09('0x22')](function(_0x57f496){if(_0x57f496&&_0x57f496[_0xaf09('0x4f')]===0x0){return db[_0xaf09('0x25')][_0xaf09('0x48')]({'name':_0x21ee76['name'],'resourceId':_0x21ee76['id'],'type':_0x57f496[_0xaf09('0x27')],'sectionId':_0x57f496['id']},{})[_0xaf09('0x22')](function(){return _0x42fb04;});}else{return _0x42fb04;}})['catch'](function(_0x286434){logger[_0xaf09('0x26')](_0xaf09('0x50'),_0x286434);throw _0x286434;});}return _0x42fb04;})[_0xaf09('0x22')](respondWithResult(_0x367a48,0xc9))[_0xaf09('0x44')](handleError(_0x367a48,null));};exports[_0xaf09('0x20')]=function(_0x51d39f,_0x167f59){if(_0x51d39f[_0xaf09('0x49')]['id']){delete _0x51d39f[_0xaf09('0x49')]['id'];}return db[_0xaf09('0x2a')][_0xaf09('0x47')]({'where':{'id':_0x51d39f[_0xaf09('0x46')]['id']}})[_0xaf09('0x22')](handleEntityNotFound(_0x167f59,null))[_0xaf09('0x22')](saveUpdates(_0x51d39f[_0xaf09('0x49')],null))[_0xaf09('0x22')](respondWithResult(_0x167f59,null))[_0xaf09('0x44')](handleError(_0x167f59,null));};exports[_0xaf09('0x21')]=function(_0x2fc63e,_0x95bd92){return db[_0xaf09('0x2a')]['find']({'where':{'id':_0x2fc63e[_0xaf09('0x46')]['id']}})[_0xaf09('0x22')](handleEntityNotFound(_0x95bd92,null))[_0xaf09('0x22')](removeEntity(_0x95bd92,null))[_0xaf09('0x44')](handleError(_0x95bd92,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf46=['../../config/environment','./variable.attributes','exports','define','Variable','util','api','bluebird','request-promise','rimraf'];(function(_0x230420,_0x139548){var _0x4ad453=function(_0x179bcb){while(--_0x179bcb){_0x230420['push'](_0x230420['shift']());}};_0x4ad453(++_0x139548);}(_0xbf46,0x91));var _0x6bf4=function(_0xb2520c,_0x37213e){_0xb2520c=_0xb2520c-0x0;var _0x1d1a4e=_0xbf46[_0xb2520c];return _0x1d1a4e;};'use strict';var _=require('lodash');var util=require(_0x6bf4('0x0'));var logger=require('../../config/logger')(_0x6bf4('0x1'));var moment=require('moment');var BPromise=require(_0x6bf4('0x2'));var rp=require(_0x6bf4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bf4('0x4'));var config=require(_0x6bf4('0x5'));var attributes=require(_0x6bf4('0x6'));module[_0x6bf4('0x7')]=function(_0x468440,_0x2dc290){return _0x468440[_0x6bf4('0x8')](_0x6bf4('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb5d=['path','rimraf','../../config/environment','define','Variable','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d1244,_0x156028){var _0x5d6372=function(_0x509c76){while(--_0x509c76){_0x3d1244['push'](_0x3d1244['shift']());}};_0x5d6372(++_0x156028);}(_0xbb5d,0x1d3));var _0xdbb5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb5d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdbb5('0x0'));var util=require('util');var logger=require(_0xdbb5('0x1'))(_0xdbb5('0x2'));var moment=require(_0xdbb5('0x3'));var BPromise=require(_0xdbb5('0x4'));var rp=require(_0xdbb5('0x5'));var fs=require('fs');var path=require(_0xdbb5('0x6'));var rimraf=require(_0xdbb5('0x7'));var config=require(_0xdbb5('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x547161,_0x6c5f53){return _0x547161[_0xdbb5('0x9')](_0xdbb5('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x3c601b,_0x4e839f){var _0x24f02f=function(_0x6a5086){while(--_0x6a5086){_0x3c601b['push'](_0x3c601b['shift']());}};_0x24f02f(++_0x4e839f);}(_0xe14b,0x93));var _0xbe14=function(_0x52e266,_0x586656){_0x52e266=_0x52e266-0x0;var _0x335947=_0xe14b[_0x52e266];return _0x335947;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});};
\ No newline at end of file
+var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x4b91e0,_0x374090){var _0x295a92=function(_0x2dae1f){while(--_0x2dae1f){_0x4b91e0['push'](_0x4b91e0['shift']());}};_0x295a92(++_0x374090);}(_0xf494,0x1c6));var _0x4f49=function(_0x18f3a8,_0x221031){_0x18f3a8=_0x18f3a8-0x0;var _0x43875d=_0xf494[_0x18f3a8];return _0x43875d;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf05f=['/reset','canUpdate','/pull','/restart','restart','/migrations','exports','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated'];(function(_0x29e398,_0x890225){var _0xd799e2=function(_0x4fcf2f){while(--_0x4fcf2f){_0x29e398['push'](_0x29e398['shift']());}};_0xd799e2(++_0x890225);}(_0xf05f,0x180));var _0xff05=function(_0x34a24b,_0x54cf53){_0x34a24b=_0x34a24b-0x0;var _0x34bd9d=_0xf05f[_0x34a24b];return _0x34bd9d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xff05('0x0'));var controller=require(_0xff05('0x1'));router[_0xff05('0x2')]('/',controller[_0xff05('0x3')]);router[_0xff05('0x2')](_0xff05('0x4'),auth[_0xff05('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0xff05('0x2')](_0xff05('0x6'),auth[_0xff05('0x5')](),auth[_0xff05('0x7')](),controller['reset']);router[_0xff05('0x2')](_0xff05('0x8'),auth['isAuthenticated'](),auth[_0xff05('0x7')](),controller['pull']);router[_0xff05('0x2')](_0xff05('0x9'),auth[_0xff05('0x5')](),controller[_0xff05('0xa')]);router[_0xff05('0x2')](_0xff05('0xb'),controller['migrations']);module[_0xff05('0xc')]=router;
\ No newline at end of file
+var _0xd6e7=['restart','/migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','pull','/restart'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd6e7,0x14d));var _0x7d6e=function(_0x2f762f,_0x50f7e7){_0x2f762f=_0x2f762f-0x0;var _0x1b68d4=_0xd6e7[_0x2f762f];return _0x1b68d4;};'use strict';var express=require('express');var router=express[_0x7d6e('0x0')]();var auth=require(_0x7d6e('0x1'));var controller=require(_0x7d6e('0x2'));router[_0x7d6e('0x3')]('/',controller[_0x7d6e('0x4')]);router['get'](_0x7d6e('0x5'),auth[_0x7d6e('0x6')](),auth[_0x7d6e('0x7')](),controller['fetch']);router[_0x7d6e('0x3')](_0x7d6e('0x8'),auth[_0x7d6e('0x6')](),auth[_0x7d6e('0x7')](),controller[_0x7d6e('0x9')]);router['get']('/pull',auth[_0x7d6e('0x6')](),auth[_0x7d6e('0x7')](),controller[_0x7d6e('0xa')]);router['get'](_0x7d6e('0xb'),auth[_0x7d6e('0x6')](),controller[_0x7d6e('0xc')]);router['get'](_0x7d6e('0xd'),controller['migrations']);module[_0x7d6e('0xe')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fdb=['origin','master','error','info','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','update','simple-git','root','index','exports','query','fetch','latest','2.0.0','status','json'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4fdb,0xfa));var _0xb4fd=function(_0xb4b5c9,_0xb8c2d4){_0xb4b5c9=_0xb4b5c9-0x0;var _0xc67fae=_0x4fdb[_0xb4b5c9];return _0xc67fae;};'use strict';var Umzug=require(_0xb4fd('0x0'));var path=require(_0xb4fd('0x1'));var fs=require('fs');var _=require(_0xb4fd('0x2'));var pkginfo=require(_0xb4fd('0x3'))(module,_0xb4fd('0x4'));var compareVersions=require(_0xb4fd('0x5'));var exec=require(_0xb4fd('0x6'))[_0xb4fd('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0xb4fd('0x8'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb4fd('0x9'));var git=require(_0xb4fd('0xa'))(config[_0xb4fd('0xb')]);exports[_0xb4fd('0xc')]=function(_0x48c4a3,_0x20d49a){var _0x1d08fb={'current':module[_0xb4fd('0xd')][_0xb4fd('0x4')],'phonebar':0x2};if(_0x48c4a3[_0xb4fd('0xe')]&&_0x48c4a3['query']['latest']){return git[_0xb4fd('0xf')]()['tags'](function(_0x247d28,_0x57b202){_0x1d08fb[_0xb4fd('0x10')]=(_0x247d28?module[_0xb4fd('0xd')][_0xb4fd('0x4')]:_0x57b202[_0xb4fd('0x10')])||_0xb4fd('0x11');return _0x20d49a[_0xb4fd('0x12')](0xc8)['json'](_0x1d08fb);});}else{return _0x20d49a[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')](_0x1d08fb);}};exports[_0xb4fd('0xf')]=function(_0x20f9bb,_0x52ef89){return git[_0xb4fd('0xf')]([_0xb4fd('0x14'),_0xb4fd('0x15')],function(_0x331bed){if(_0x331bed){logger[_0xb4fd('0x16')](_0x331bed);return _0x52ef89[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x331bed);}logger[_0xb4fd('0x17')]('git\x20fetch');return _0x52ef89[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xb4fd('0x18')]=function(_0x39eee1,_0x3226fd){return git[_0xb4fd('0x18')]([_0xb4fd('0x19'),'FETCH_HEAD'],function(_0x4ff791){if(_0x4ff791){logger[_0xb4fd('0x16')](_0x4ff791);return _0x3226fd[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x4ff791);}logger[_0xb4fd('0x17')](_0xb4fd('0x1a'));return _0x3226fd[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x1b')});});};exports[_0xb4fd('0x1c')]=function(_0x56d967,_0x405774){exec(_0xb4fd('0x1d'),function(_0xacb392,_0x1f1dcb,_0xf9a022){logger[_0xb4fd('0x17')](_0x1f1dcb);logger[_0xb4fd('0x17')](_0xf9a022);if(_0xacb392){logger[_0xb4fd('0x16')](_0xacb392);return _0x405774['status'](0x1f4)[_0xb4fd('0x13')](_0xacb392);}return _0x405774[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0x1f1dcb});});};exports[_0xb4fd('0x1e')]=function(_0x26e95d,_0x1dacd0){return pm2[_0xb4fd('0x1e')](_0xb4fd('0x1f'))[_0xb4fd('0x20')](function(_0x487706){logger[_0xb4fd('0x17')](_0xb4fd('0x21'),_0x487706);return _0x1dacd0[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x22')});})[_0xb4fd('0x23')](function(_0x73e6b1){logger[_0xb4fd('0x16')](_0x73e6b1);return _0x1dacd0[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x73e6b1);});};exports[_0xb4fd('0x24')]=function(_0x4dc457,_0x31c94f){var _0x278f9e=fs[_0xb4fd('0x25')](path[_0xb4fd('0x26')](config[_0xb4fd('0xb')],_0xb4fd('0x27'),_0xb4fd('0x24')));var _0x14d9cf=[];for(var _0x5700b5=0x0;_0x5700b5<_0x278f9e[_0xb4fd('0x28')];_0x5700b5++){var _0x18b98d=_0x278f9e[_0x5700b5][_0xb4fd('0x29')]('.js','');if(compareVersions(module[_0xb4fd('0xd')][_0xb4fd('0x4')],_0x18b98d)===-0x1){_0x14d9cf[_0xb4fd('0x2a')](_0x18b98d);}}if(_0x14d9cf[_0xb4fd('0x28')]){var _0x4c5f4c=_0x14d9cf[_0xb4fd('0x2b')](compareVersions);var _0x44d0fe=new Umzug({'storage':_0xb4fd('0x2c'),'storageOptions':{'model':db[_0xb4fd('0x2d')],'modelName':_0xb4fd('0x2d'),'columnName':_0xb4fd('0x4')},'migrations':{'params':[db[_0xb4fd('0x2c')][_0xb4fd('0x2e')](),db[_0xb4fd('0x2c')][_0xb4fd('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xb4fd('0x26')](config[_0xb4fd('0xb')],_0xb4fd('0x27'),_0xb4fd('0x24')),'pattern':/\.js$/}});_0x44d0fe['up']({'migrations':_[_0xb4fd('0x30')](_0x4c5f4c,function(_0x95b487){return _0x95b487+_0xb4fd('0x31');})})[_0xb4fd('0x20')](function(){return _0x31c94f['status'](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x32')+module[_0xb4fd('0xd')]['version']+'\x20to\x20'+_[_0xb4fd('0x33')](_0x4c5f4c),'migrations':_[_0xb4fd('0x26')](_0x4c5f4c)});})[_0xb4fd('0x23')](function(_0x293778){if(_0x293778 instanceof db[_0xb4fd('0x2c')][_0xb4fd('0x34')]){return _0x31c94f[_0xb4fd('0x12')](0xc8)[_0xb4fd('0x13')]({'output':_0xb4fd('0x35')});}else{return _0x31c94f[_0xb4fd('0x12')](0x1f4)[_0xb4fd('0x13')](_0x293778);}});}else{return _0x31c94f[_0xb4fd('0x12')](0xc8)['json']({'output':_0xb4fd('0x35')});}};
\ No newline at end of file
+var _0xa5dc=['Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','git\x20fetch','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','catch','readdirSync','server','migrations','length','replace','.js','exports','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','then'];(function(_0x283e1b,_0x37e3ee){var _0x1cf04d=function(_0xe452da){while(--_0xe452da){_0x283e1b['push'](_0x283e1b['shift']());}};_0x1cf04d(++_0x37e3ee);}(_0xa5dc,0x72));var _0xca5d=function(_0x3c6310,_0x13601d){_0x3c6310=_0x3c6310-0x0;var _0x320122=_0xa5dc[_0x3c6310];return _0x320122;};'use strict';var Umzug=require(_0xca5d('0x0'));var path=require(_0xca5d('0x1'));var fs=require('fs');var _=require(_0xca5d('0x2'));var pkginfo=require(_0xca5d('0x3'))(module,_0xca5d('0x4'));var compareVersions=require(_0xca5d('0x5'));var exec=require(_0xca5d('0x6'))[_0xca5d('0x7')];var db=require(_0xca5d('0x8'))['db'];var config=require(_0xca5d('0x9'));var pm2=require(_0xca5d('0xa'));var logger=require(_0xca5d('0xb'))('update');var git=require(_0xca5d('0xc'))(config[_0xca5d('0xd')]);exports[_0xca5d('0xe')]=function(_0x241cd1,_0x327cdc){var _0x535892={'current':module['exports'][_0xca5d('0x4')],'phonebar':0x2};if(_0x241cd1[_0xca5d('0xf')]&&_0x241cd1['query'][_0xca5d('0x10')]){return git[_0xca5d('0x11')]()[_0xca5d('0x12')](function(_0x23bd32,_0x340c3e){_0x535892[_0xca5d('0x10')]=(_0x23bd32?module['exports'][_0xca5d('0x4')]:_0x340c3e[_0xca5d('0x10')])||_0xca5d('0x13');return _0x327cdc[_0xca5d('0x14')](0xc8)[_0xca5d('0x15')](_0x535892);});}else{return _0x327cdc[_0xca5d('0x14')](0xc8)[_0xca5d('0x15')](_0x535892);}};exports[_0xca5d('0x11')]=function(_0x2f5d02,_0x159729){return git[_0xca5d('0x11')]([_0xca5d('0x16'),_0xca5d('0x17')],function(_0xa69dde){if(_0xa69dde){logger[_0xca5d('0x18')](_0xa69dde);return _0x159729['status'](0x1f4)[_0xca5d('0x15')](_0xa69dde);}logger['info'](_0xca5d('0x19'));return _0x159729[_0xca5d('0x14')](0xc8)[_0xca5d('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xca5d('0x1a')]=function(_0x2d25be,_0x5e805c){return git[_0xca5d('0x1a')](['--hard',_0xca5d('0x1b')],function(_0x29f6fb){if(_0x29f6fb){logger[_0xca5d('0x18')](_0x29f6fb);return _0x5e805c[_0xca5d('0x14')](0x1f4)['json'](_0x29f6fb);}logger[_0xca5d('0x1c')](_0xca5d('0x1d'));return _0x5e805c['status'](0xc8)[_0xca5d('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x1f58b9,_0x492a33){exec(_0xca5d('0x1e'),function(_0x46e150,_0xf6e3c7,_0x53feef){logger[_0xca5d('0x1c')](_0xf6e3c7);logger[_0xca5d('0x1c')](_0x53feef);if(_0x46e150){logger[_0xca5d('0x18')](_0x46e150);return _0x492a33[_0xca5d('0x14')](0x1f4)[_0xca5d('0x15')](_0x46e150);}return _0x492a33[_0xca5d('0x14')](0xc8)['json']({'output':_0xf6e3c7});});};exports[_0xca5d('0x1f')]=function(_0x11fe0b,_0x3a9f2b){return pm2[_0xca5d('0x1f')]('motion2')['then'](function(_0x5efeb6){logger['info'](_0xca5d('0x20'),_0x5efeb6);return _0x3a9f2b['status'](0xc8)[_0xca5d('0x15')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xca5d('0x21')](function(_0x1bea16){logger[_0xca5d('0x18')](_0x1bea16);return _0x3a9f2b[_0xca5d('0x14')](0x1f4)[_0xca5d('0x15')](_0x1bea16);});};exports['migrations']=function(_0x56371f,_0x27d0e4){var _0x5b53d0=fs[_0xca5d('0x22')](path['join'](config[_0xca5d('0xd')],_0xca5d('0x23'),_0xca5d('0x24')));var _0x281478=[];for(var _0x2bbdfd=0x0;_0x2bbdfd<_0x5b53d0[_0xca5d('0x25')];_0x2bbdfd++){var _0x16da02=_0x5b53d0[_0x2bbdfd][_0xca5d('0x26')](_0xca5d('0x27'),'');if(compareVersions(module[_0xca5d('0x28')]['version'],_0x16da02)===-0x1){_0x281478[_0xca5d('0x29')](_0x16da02);}}if(_0x281478[_0xca5d('0x25')]){var _0x21b078=_0x281478[_0xca5d('0x2a')](compareVersions);var _0x547a55=new Umzug({'storage':_0xca5d('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0xca5d('0x2c'),'columnName':_0xca5d('0x4')},'migrations':{'params':[db[_0xca5d('0x2b')][_0xca5d('0x2d')](),db[_0xca5d('0x2b')][_0xca5d('0x2e')],function(){throw new Error(_0xca5d('0x2f'));}],'path':path[_0xca5d('0x30')](config['root'],_0xca5d('0x23'),_0xca5d('0x24')),'pattern':/\.js$/}});_0x547a55['up']({'migrations':_[_0xca5d('0x31')](_0x21b078,function(_0x4b2c11){return _0x4b2c11+_0xca5d('0x27');})})[_0xca5d('0x32')](function(){return _0x27d0e4[_0xca5d('0x14')](0xc8)[_0xca5d('0x15')]({'output':_0xca5d('0x33')+module[_0xca5d('0x28')][_0xca5d('0x4')]+'\x20to\x20'+_[_0xca5d('0x34')](_0x21b078),'migrations':_[_0xca5d('0x30')](_0x21b078)});})['catch'](function(_0x14162c){if(_0x14162c instanceof db['sequelize'][_0xca5d('0x35')]){return _0x27d0e4[_0xca5d('0x14')](0xc8)[_0xca5d('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x27d0e4['status'](0x1f4)['json'](_0x14162c);}});}else{return _0x27d0e4[_0xca5d('0x14')](0xc8)[_0xca5d('0x15')]({'output':_0xca5d('0x36')});}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4766=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','delete'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x4766,0xe6));var _0x6476=function(_0x56f4ec,_0x43a0bd){_0x56f4ec=_0x56f4ec-0x0;var _0x841a3a=_0x4766[_0x56f4ec];return _0x841a3a;};'use strict';var multer=require(_0x6476('0x0'));var util=require(_0x6476('0x1'));var path=require(_0x6476('0x2'));var timeout=require(_0x6476('0x3'));var express=require(_0x6476('0x4'));var router=express['Router']();var fs_extra=require(_0x6476('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6476('0x6'));var config=require(_0x6476('0x7'));var controller=require(_0x6476('0x8'));router['get']('/',auth[_0x6476('0x9')](),controller[_0x6476('0xa')]);router[_0x6476('0xb')](_0x6476('0xc'),auth[_0x6476('0x9')](),controller['describe']);router['get'](_0x6476('0xd'),auth[_0x6476('0x9')](),controller['show']);router[_0x6476('0xe')]('/',auth[_0x6476('0x9')](),controller[_0x6476('0xf')]);router['put'](_0x6476('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6476('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6476('0x11')]);module[_0x6476('0x12')]=router;
\ No newline at end of file
+var _0x350f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','/:id','post','put','update','destroy','exports'];(function(_0x359a84,_0x3e9211){var _0x4f80eb=function(_0x1dacf8){while(--_0x1dacf8){_0x359a84['push'](_0x359a84['shift']());}};_0x4f80eb(++_0x3e9211);}(_0x350f,0xd1));var _0xf350=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x350f[_0x401ccd];return _0x5a57ad;};'use strict';var multer=require(_0xf350('0x0'));var util=require(_0xf350('0x1'));var path=require(_0xf350('0x2'));var timeout=require(_0xf350('0x3'));var express=require('express');var router=express[_0xf350('0x4')]();var fs_extra=require(_0xf350('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf350('0x6'));var config=require(_0xf350('0x7'));var controller=require(_0xf350('0x8'));router['get']('/',auth[_0xf350('0x9')](),controller['index']);router[_0xf350('0xa')](_0xf350('0xb'),auth[_0xf350('0x9')](),controller[_0xf350('0xc')]);router[_0xf350('0xa')](_0xf350('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf350('0xe')]('/',auth[_0xf350('0x9')](),controller['create']);router[_0xf350('0xf')]('/:id',auth[_0xf350('0x9')](),controller[_0xf350('0x10')]);router['delete'](_0xf350('0xd'),auth['isAuthenticated'](),controller[_0xf350('0x11')]);module[_0xf350('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7af9=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x560e95,_0x565c20){var _0x20baf2=function(_0x4035fe){while(--_0x4035fe){_0x560e95['push'](_0x560e95['shift']());}};_0x20baf2(++_0x565c20);}(_0x7af9,0x95));var _0x97af=function(_0x369d10,_0x1768c2){_0x369d10=_0x369d10-0x0;var _0xf9ae9a=_0x7af9[_0x369d10];return _0xf9ae9a;};'use strict';var Sequelize=require(_0x97af('0x0'));module['exports']={'type':{'type':Sequelize[_0x97af('0x1')]},'uniqueid':{'type':Sequelize[_0x97af('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97af('0x1')]},'queue':{'type':Sequelize[_0x97af('0x1')]},'interface':{'type':Sequelize[_0x97af('0x1')]},'membername':{'type':Sequelize[_0x97af('0x1')]},'agentcalledAt':{'type':Sequelize[_0x97af('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x97af('0x2')]},'holdtime':{'type':Sequelize[_0x97af('0x3')]},'agentcomplete':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x97af('0x3')]},'agentacw':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x97af('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x97af('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x97af('0x3')]},'channelstatedesc':{'type':Sequelize[_0x97af('0x1')]},'connectedlinenum':{'type':Sequelize[_0x97af('0x1')]},'connectedlinename':{'type':Sequelize[_0x97af('0x1')]},'language':{'type':Sequelize[_0x97af('0x1')]},'accountcode':{'type':Sequelize[_0x97af('0x1')]},'context':{'type':Sequelize[_0x97af('0x1')]},'exten':{'type':Sequelize[_0x97af('0x1')]},'priority':{'type':Sequelize[_0x97af('0x1')]},'destchannel':{'type':Sequelize[_0x97af('0x1')]},'destchannelstate':{'type':Sequelize[_0x97af('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x97af('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x97af('0x1')]},'destlanguage':{'type':Sequelize[_0x97af('0x1')]},'destaccountcode':{'type':Sequelize[_0x97af('0x1')]},'destcontext':{'type':Sequelize[_0x97af('0x1')]},'destexten':{'type':Sequelize[_0x97af('0x1')]},'destpriority':{'type':Sequelize[_0x97af('0x1')]},'destuniqueid':{'type':Sequelize[_0x97af('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x97af('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x97af('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x97af('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x97af('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbb59=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x505ed7,_0x4fced7){var _0x2956f4=function(_0x2bdff7){while(--_0x2bdff7){_0x505ed7['push'](_0x505ed7['shift']());}};_0x2956f4(++_0x4fced7);}(_0xbb59,0xec));var _0x9bb5=function(_0x1d0cf9,_0x1747a0){_0x1d0cf9=_0x1d0cf9-0x0;var _0x1ae352=_0xbb59[_0x1d0cf9];return _0x1ae352;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'type':{'type':Sequelize[_0x9bb5('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9bb5('0x2')]},'queue':{'type':Sequelize[_0x9bb5('0x2')]},'interface':{'type':Sequelize[_0x9bb5('0x2')]},'membername':{'type':Sequelize[_0x9bb5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentdumpAt':{'type':Sequelize[_0x9bb5('0x3')]},'holdtime':{'type':Sequelize[_0x9bb5('0x4')]},'agentcomplete':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9bb5('0x4')]},'agentacw':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9bb5('0x4')]},'reason':{'type':Sequelize[_0x9bb5('0x2')]},'lastevent':{'type':Sequelize[_0x9bb5('0x2')]},'channel':{'type':Sequelize[_0x9bb5('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9bb5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9bb5('0x2')]},'connectedlinename':{'type':Sequelize[_0x9bb5('0x2')]},'language':{'type':Sequelize[_0x9bb5('0x2')]},'accountcode':{'type':Sequelize[_0x9bb5('0x2')]},'context':{'type':Sequelize[_0x9bb5('0x2')]},'exten':{'type':Sequelize[_0x9bb5('0x2')]},'priority':{'type':Sequelize[_0x9bb5('0x2')]},'destchannel':{'type':Sequelize[_0x9bb5('0x2')]},'destchannelstate':{'type':Sequelize[_0x9bb5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x9bb5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9bb5('0x2')]},'destcalleridname':{'type':Sequelize[_0x9bb5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9bb5('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9bb5('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9bb5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9bb5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9bb5('0x2')]},'transfer':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9bb5('0x6')},'transferexten':{'type':Sequelize[_0x9bb5('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9bb5('0x2')]},'agententerreason':{'type':Sequelize[_0x9bb5('0x4')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3be=['destuniqueid','lodash','util','../../config/logger','api','bluebird','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xf3be,0x1e1));var _0xef3b=function(_0x4d606e,_0x1355b7){_0x4d606e=_0x4d606e-0x0;var _0x4bc8a5=_0xf3be[_0x4d606e];return _0x4bc8a5;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var logger=require(_0xef3b('0x2'))(_0xef3b('0x3'));var moment=require('moment');var BPromise=require(_0xef3b('0x4'));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(_0xef3b('0x5'));module[_0xef3b('0x6')]=function(_0x48f499,_0x3dfcc2){return _0x48f499[_0xef3b('0x7')](_0xef3b('0x8'),attributes,{'tableName':_0xef3b('0x9'),'paranoid':![],'indexes':[{'fields':[_0xef3b('0xa'),_0xef3b('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x16a6=['moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','destuniqueid','lodash','util','api'];(function(_0x3c1daf,_0x4e0c73){var _0x32c657=function(_0x3e7ae1){while(--_0x3e7ae1){_0x3c1daf['push'](_0x3c1daf['shift']());}};_0x32c657(++_0x4e0c73);}(_0x16a6,0x15c));var _0x616a=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x16a6[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var logger=require('../../config/logger')(_0x616a('0x2'));var moment=require(_0x616a('0x3'));var BPromise=require(_0x616a('0x4'));var rp=require(_0x616a('0x5'));var fs=require('fs');var path=require(_0x616a('0x6'));var rimraf=require(_0x616a('0x7'));var config=require('../../config/environment');var attributes=require(_0x616a('0x8'));module[_0x616a('0x9')]=function(_0x4c1641,_0x56eaab){return _0x4c1641[_0x616a('0xa')](_0x616a('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x616a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa560=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x3eca13,_0x19d21d){var _0x2c5f29=function(_0xb67653){while(--_0xb67653){_0x3eca13['push'](_0x3eca13['shift']());}};_0x2c5f29(++_0x19d21d);}(_0xa560,0x148));var _0x0a56=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa560[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0a56('0x0'));var util=require(_0x0a56('0x1'));var moment=require(_0x0a56('0x2'));var BPromise=require(_0x0a56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a56('0x4'));var db=require(_0x0a56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a56('0x6'))('rpc');var config=require(_0x0a56('0x7'));var jayson=require(_0x0a56('0x8'));var client=jayson['client'][_0x0a56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4939,_0x53bebf,_0x4e65d0){return new BPromise(function(_0x261031,_0x2e59c2){return client[_0x0a56('0xa')](_0x2b4939,_0x4e65d0)[_0x0a56('0xb')](function(_0x17cdf8){logger[_0x0a56('0xc')](_0x0a56('0xd'),_0x53bebf,_0x0a56('0xe'));logger[_0x0a56('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x53bebf,_0x0a56('0xe'),JSON[_0x0a56('0x10')](_0x17cdf8));if(_0x17cdf8[_0x0a56('0x11')]){if(_0x17cdf8[_0x0a56('0x11')]['code']===0x1f4){logger[_0x0a56('0x11')](_0x0a56('0xd'),_0x53bebf,_0x17cdf8[_0x0a56('0x11')][_0x0a56('0x12')]);return _0x2e59c2(_0x17cdf8[_0x0a56('0x11')][_0x0a56('0x12')]);}logger['error'](_0x0a56('0xd'),_0x53bebf,_0x17cdf8['error'][_0x0a56('0x12')]);return _0x261031(_0x17cdf8[_0x0a56('0x11')][_0x0a56('0x12')]);}else{logger[_0x0a56('0xc')](_0x0a56('0xd'),_0x53bebf,_0x0a56('0xe'));_0x261031(_0x17cdf8[_0x0a56('0x13')][_0x0a56('0x12')]);}})[_0x0a56('0x14')](function(_0x1fad02){logger['error'](_0x0a56('0xd'),_0x53bebf,_0x1fad02);_0x2e59c2(_0x1fad02);});});}exports[_0x0a56('0x15')]=function(_0x4b6e72){var _0xa010fa=this;return new Promise(function(_0x3c4a7e,_0x17a870){return db[_0x0a56('0x16')][_0x0a56('0x17')](_0x4b6e72[_0x0a56('0x18')],{'raw':_0x4b6e72[_0x0a56('0x19')]?_0x4b6e72[_0x0a56('0x19')][_0x0a56('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xb06cad){logger[_0x0a56('0xc')]('CreateVoiceAgentReport',_0x4b6e72);logger[_0x0a56('0xf')](_0x0a56('0x15'),_0x4b6e72,JSON['stringify'](_0xb06cad));_0x3c4a7e(_0xb06cad);})[_0x0a56('0x14')](function(_0x1e7726){logger['error']('CreateVoiceAgentReport',_0x1e7726[_0x0a56('0x12')],_0x4b6e72);_0x17a870(_0xa010fa['error'](0x1f4,_0x1e7726[_0x0a56('0x12')]));});});};exports[_0x0a56('0x1b')]=function(_0x594590){var _0x5106e3=this;return new Promise(function(_0x5d8460,_0x27707f){return db[_0x0a56('0x16')][_0x0a56('0x1c')](_0x594590[_0x0a56('0x18')],{'raw':_0x594590[_0x0a56('0x19')]?_0x594590[_0x0a56('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x594590[_0x0a56('0x19')]?_0x594590['options']['where']||null:null,'attributes':_0x594590[_0x0a56('0x19')]?_0x594590['options'][_0x0a56('0x1d')]||null:null,'limit':_0x594590['options']?_0x594590[_0x0a56('0x19')][_0x0a56('0x1e')]||null:null})[_0x0a56('0xb')](function(_0x6f00b4){logger[_0x0a56('0xc')](_0x0a56('0x1b'),_0x594590);logger[_0x0a56('0xf')](_0x0a56('0x1b'),_0x594590,JSON[_0x0a56('0x10')](_0x6f00b4));_0x5d8460(_0x6f00b4);})[_0x0a56('0x14')](function(_0x14584b){logger['error'](_0x0a56('0x1b'),_0x14584b[_0x0a56('0x12')],_0x594590);_0x27707f(_0x5106e3['error'](0x1f4,_0x14584b['message']));});});};
\ No newline at end of file
+var _0xff5c=['raw','debug','UpdateVoiceAgentReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options'];(function(_0x4134be,_0x56fd04){var _0x20a368=function(_0x3cbd4f){while(--_0x3cbd4f){_0x4134be['push'](_0x4134be['shift']());}};_0x20a368(++_0x56fd04);}(_0xff5c,0x1c0));var _0xcff5=function(_0x2d121d,_0x553392){_0x2d121d=_0x2d121d-0x0;var _0x1b0bf0=_0xff5c[_0x2d121d];return _0x1b0bf0;};'use strict';var _=require(_0xcff5('0x0'));var util=require(_0xcff5('0x1'));var moment=require(_0xcff5('0x2'));var BPromise=require(_0xcff5('0x3'));var rs=require(_0xcff5('0x4'));var fs=require('fs');var Redis=require(_0xcff5('0x5'));var db=require(_0xcff5('0x6'))['db'];var utils=require(_0xcff5('0x7'));var logger=require('../../config/logger')(_0xcff5('0x8'));var config=require(_0xcff5('0x9'));var jayson=require(_0xcff5('0xa'));var client=jayson[_0xcff5('0xb')][_0xcff5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31325a,_0x43754b,_0x52f3d1){return new BPromise(function(_0xd52a8c,_0x3c8898){return client['request'](_0x31325a,_0x52f3d1)[_0xcff5('0xd')](function(_0x181466){logger['info'](_0xcff5('0xe'),_0x43754b,_0xcff5('0xf'));logger['debug'](_0xcff5('0x10'),_0x43754b,_0xcff5('0xf'),JSON[_0xcff5('0x11')](_0x181466));if(_0x181466[_0xcff5('0x12')]){if(_0x181466['error']['code']===0x1f4){logger[_0xcff5('0x12')](_0xcff5('0xe'),_0x43754b,_0x181466[_0xcff5('0x12')][_0xcff5('0x13')]);return _0x3c8898(_0x181466[_0xcff5('0x12')]['message']);}logger[_0xcff5('0x12')](_0xcff5('0xe'),_0x43754b,_0x181466[_0xcff5('0x12')][_0xcff5('0x13')]);return _0xd52a8c(_0x181466[_0xcff5('0x12')][_0xcff5('0x13')]);}else{logger[_0xcff5('0x14')](_0xcff5('0xe'),_0x43754b,_0xcff5('0xf'));_0xd52a8c(_0x181466[_0xcff5('0x15')][_0xcff5('0x13')]);}})[_0xcff5('0x16')](function(_0x4b335b){logger[_0xcff5('0x12')](_0xcff5('0xe'),_0x43754b,_0x4b335b);_0x3c8898(_0x4b335b);});});}exports[_0xcff5('0x17')]=function(_0x5de879){var _0x59bb69=this;return new Promise(function(_0x32f1a6,_0x5ae1f9){return db[_0xcff5('0x18')][_0xcff5('0x19')](_0x5de879[_0xcff5('0x1a')],{'raw':_0x5de879[_0xcff5('0x1b')]?_0x5de879[_0xcff5('0x1b')][_0xcff5('0x1c')]===undefined?!![]:![]:!![]})[_0xcff5('0xd')](function(_0x1d1208){logger[_0xcff5('0x14')](_0xcff5('0x17'),_0x5de879);logger[_0xcff5('0x1d')]('CreateVoiceAgentReport',_0x5de879,JSON[_0xcff5('0x11')](_0x1d1208));_0x32f1a6(_0x1d1208);})['catch'](function(_0x33f671){logger[_0xcff5('0x12')](_0xcff5('0x17'),_0x33f671[_0xcff5('0x13')],_0x5de879);_0x5ae1f9(_0x59bb69[_0xcff5('0x12')](0x1f4,_0x33f671[_0xcff5('0x13')]));});});};exports[_0xcff5('0x1e')]=function(_0x4389e5){var _0x288cd3=this;return new Promise(function(_0x3f6aea,_0x292961){return db[_0xcff5('0x18')][_0xcff5('0x1f')](_0x4389e5['body'],{'raw':_0x4389e5[_0xcff5('0x1b')]?_0x4389e5[_0xcff5('0x1b')][_0xcff5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4389e5[_0xcff5('0x1b')]?_0x4389e5[_0xcff5('0x1b')][_0xcff5('0x20')]||null:null,'attributes':_0x4389e5[_0xcff5('0x1b')]?_0x4389e5[_0xcff5('0x1b')]['attributes']||null:null,'limit':_0x4389e5[_0xcff5('0x1b')]?_0x4389e5[_0xcff5('0x1b')][_0xcff5('0x21')]||null:null})['then'](function(_0x20505a){logger[_0xcff5('0x14')](_0xcff5('0x1e'),_0x4389e5);logger[_0xcff5('0x1d')]('UpdateVoiceAgentReport',_0x4389e5,JSON[_0xcff5('0x11')](_0x20505a));_0x3f6aea(_0x20505a);})[_0xcff5('0x16')](function(_0x4605bc){logger[_0xcff5('0x12')](_0xcff5('0x1e'),_0x4605bc[_0xcff5('0x13')],_0x4389e5);_0x292961(_0x288cd3[_0xcff5('0x12')](0x1f4,_0x4605bc[_0xcff5('0x13')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeec6,0x1c2));var _0x6eec=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0xeec6[_0x291aaf];return _0x5571e6;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router;
\ No newline at end of file
+var _0x9957=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x34d14c,_0x181e9a){var _0x32e9f7=function(_0x1bf18e){while(--_0x1bf18e){_0x34d14c['push'](_0x34d14c['shift']());}};_0x32e9f7(++_0x181e9a);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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('0xf')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0x12'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);module[_0x7995('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bd1=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x39a3ca,_0x2ec458){var _0x3d408a=function(_0x2e8f20){while(--_0x2e8f20){_0x39a3ca['push'](_0x39a3ca['shift']());}};_0x3d408a(++_0x2ec458);}(_0x6bd1,0xe8));var _0x16bd=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x6bd1[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x16bd('0x0'));module[_0x16bd('0x1')]={'uniqueid':{'type':Sequelize[_0x16bd('0x2')]},'type':{'type':Sequelize[_0x16bd('0x3')](_0x16bd('0x4'),_0x16bd('0x5'),'outbound',_0x16bd('0x6'),_0x16bd('0x7'),_0x16bd('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x16bd('0x2')]},'source':{'type':Sequelize[_0x16bd('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x16bd('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x16bd('0x9')]},'starttime':{'type':Sequelize[_0x16bd('0xa')]},'systemanswertime':{'type':Sequelize[_0x16bd('0xa')]},'answertime':{'type':Sequelize[_0x16bd('0xa')]},'endtime':{'type':Sequelize[_0x16bd('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x16bd('0xb')]},'mohtime':{'type':Sequelize[_0x16bd('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x16bd('0x2')]},'amaflags':{'type':Sequelize[_0x16bd('0x2')]},'userfield':{'type':Sequelize[_0x16bd('0x2')]},'userDisposition':{'type':Sequelize[_0x16bd('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x16bd('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x16bd('0x2')]},'prefix':{'type':Sequelize[_0x16bd('0x2')]},'routeid':{'type':Sequelize[_0x16bd('0xb')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x86dc=['inbound','internal','outbound','outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','ENUM'];(function(_0x1f1735,_0x52184e){var _0xe97857=function(_0x261406){while(--_0x261406){_0x1f1735['push'](_0x1f1735['shift']());}};_0xe97857(++_0x52184e);}(_0x86dc,0x13e));var _0xc86d=function(_0x5952af,_0xc4bb03){_0x5952af=_0x5952af-0x0;var _0x53d3ec=_0x86dc[_0x5952af];return _0x53d3ec;};'use strict';var Sequelize=require(_0xc86d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc86d('0x1')](_0xc86d('0x2'),_0xc86d('0x3'),_0xc86d('0x4'),'inbound-fax',_0xc86d('0x5'),'dialer')},'tag':{'type':Sequelize[_0xc86d('0x6')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xc86d('0x6')]},'destination':{'type':Sequelize[_0xc86d('0x6')]},'destinationcontext':{'type':Sequelize[_0xc86d('0x6')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc86d('0x6')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xc86d('0x6')]},'lastdata':{'type':Sequelize[_0xc86d('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xc86d('0x8')]},'endtime':{'type':Sequelize[_0xc86d('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xc86d('0x9')]},'mohtime':{'type':Sequelize[_0xc86d('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc86d('0x6')]},'amaflags':{'type':Sequelize[_0xc86d('0x6')]},'userfield':{'type':Sequelize[_0xc86d('0x6')]},'userDisposition':{'type':Sequelize[_0xc86d('0x6')]},'userSecondDisposition':{'type':Sequelize[_0xc86d('0x6')]},'userThirdDisposition':{'type':Sequelize[_0xc86d('0x6')]},'note':{'type':Sequelize[_0xc86d('0x6')]},'prefix':{'type':Sequelize[_0xc86d('0x6')]},'routeid':{'type':Sequelize[_0xc86d('0x9')]},'sipcallid':{'type':Sequelize[_0xc86d('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x4d0527,_0x216351){var _0x4ad853=function(_0x5f4268){while(--_0x5f4268){_0x4d0527['push'](_0x4d0527['shift']());}};_0x4ad853(++_0x216351);}(_0xb10b,0x12a));var _0xbb10=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0xb10b[_0x46e182];return _0x42ade0;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));};
\ No newline at end of file
+var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x3990d9,_0x21ecd3){var _0x587463=function(_0x1018d3){while(--_0x1018d3){_0x3990d9['push'](_0x3990d9['shift']());}};_0x587463(++_0x21ecd3);}(_0xdb28,0x106));var _0x8db2=function(_0x895435,_0xed01e5){_0x895435=_0x895435-0x0;var _0x131cc4=_0xdb28[_0x895435];return _0x131cc4;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x84fe=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','VoiceCallReport','report_call','lodash'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x84fe,0xdb));var _0xe84f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84fe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe84f('0x0'));var util=require(_0xe84f('0x1'));var logger=require(_0xe84f('0x2'))(_0xe84f('0x3'));var moment=require(_0xe84f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe84f('0x5'));var rimraf=require(_0xe84f('0x6'));var config=require(_0xe84f('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0xe84f('0x8')]=function(_0x33ac1a,_0x6d5bd0){return _0x33ac1a['define'](_0xe84f('0x9'),attributes,{'tableName':_0xe84f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xff2e=['../../config/logger','bluebird','request-promise','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0xff2e,0x198));var _0xeff2=function(_0x5c73df,_0x3dd2aa){_0x5c73df=_0x5c73df-0x0;var _0x57f14c=_0xff2e[_0x5c73df];return _0x57f14c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeff2('0x0'))('api');var moment=require('moment');var BPromise=require(_0xeff2('0x1'));var rp=require(_0xeff2('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeff2('0x3'));module[_0xeff2('0x4')]=function(_0x119e1c,_0x31484e){return _0x119e1c['define'](_0xeff2('0x5'),attributes,{'tableName':_0xeff2('0x6'),'paranoid':![],'indexes':[{'fields':[_0xeff2('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a0f=['util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','GetVoiceCallReport','debug','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash'];(function(_0x46e86f,_0x4819bd){var _0x19d80c=function(_0x554310){while(--_0x554310){_0x46e86f['push'](_0x46e86f['shift']());}};_0x19d80c(++_0x4819bd);}(_0x8a0f,0x10f));var _0xf8a0=function(_0x354892,_0xc5cd4){_0x354892=_0x354892-0x0;var _0x327d2f=_0x8a0f[_0x354892];return _0x327d2f;};'use strict';var _=require(_0xf8a0('0x0'));var util=require(_0xf8a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf8a0('0x3'));var logger=require(_0xf8a0('0x4'))(_0xf8a0('0x5'));var config=require('../../config/environment');var jayson=require(_0xf8a0('0x6'));var client=jayson['client'][_0xf8a0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58b984,_0x424111,_0x599a3c){return new BPromise(function(_0x523620,_0x48ba58){return client['request'](_0x58b984,_0x599a3c)[_0xf8a0('0x8')](function(_0x42bf31){logger[_0xf8a0('0x9')](_0xf8a0('0xa'),_0x424111,'request\x20sent');logger['debug'](_0xf8a0('0xb'),_0x424111,_0xf8a0('0xc'),JSON[_0xf8a0('0xd')](_0x42bf31));if(_0x42bf31[_0xf8a0('0xe')]){if(_0x42bf31['error'][_0xf8a0('0xf')]===0x1f4){logger[_0xf8a0('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x424111,_0x42bf31[_0xf8a0('0xe')][_0xf8a0('0x10')]);return _0x48ba58(_0x42bf31['error'][_0xf8a0('0x10')]);}logger[_0xf8a0('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x424111,_0x42bf31['error'][_0xf8a0('0x10')]);return _0x523620(_0x42bf31[_0xf8a0('0xe')][_0xf8a0('0x10')]);}else{logger['info'](_0xf8a0('0xa'),_0x424111,_0xf8a0('0xc'));_0x523620(_0x42bf31['result'][_0xf8a0('0x10')]);}})['catch'](function(_0x544a3d){logger[_0xf8a0('0xe')](_0xf8a0('0xa'),_0x424111,_0x544a3d);_0x48ba58(_0x544a3d);});});}exports['GetVoiceCallReport']=function(_0x502e50){var _0x115583=this;return new Promise(function(_0x15f98f,_0x4c1c51){return db[_0xf8a0('0x11')][_0xf8a0('0x12')]({'raw':_0x502e50['options']?_0x502e50[_0xf8a0('0x13')][_0xf8a0('0x14')]===undefined?!![]:![]:!![],'where':_0x502e50[_0xf8a0('0x13')]?_0x502e50[_0xf8a0('0x13')]['where']||null:null,'attributes':_0x502e50[_0xf8a0('0x13')]?_0x502e50[_0xf8a0('0x13')][_0xf8a0('0x15')]||null:null,'limit':_0x502e50[_0xf8a0('0x13')]?_0x502e50['options'][_0xf8a0('0x16')]||null:null,'include':_0x502e50[_0xf8a0('0x13')]?_0x502e50[_0xf8a0('0x13')][_0xf8a0('0x17')]?_['map'](_0x502e50['options']['include'],function(_0x2b8e05){return{'model':db[_0x2b8e05['model']],'as':_0x2b8e05['as'],'attributes':_0x2b8e05[_0xf8a0('0x15')],'include':_0x2b8e05[_0xf8a0('0x17')]?_[_0xf8a0('0x18')](_0x2b8e05[_0xf8a0('0x17')],function(_0x2119a3){return{'model':db[_0x2119a3['model']],'as':_0x2119a3['as'],'attributes':_0x2119a3[_0xf8a0('0x15')],'include':_0x2119a3[_0xf8a0('0x17')]?_[_0xf8a0('0x18')](_0x2119a3['include'],function(_0x27143f){return{'model':db[_0x27143f['model']],'as':_0x27143f['as'],'attributes':_0x27143f[_0xf8a0('0x15')]};}):[]};}):[]};}):[]:[]})[_0xf8a0('0x8')](function(_0x32e9dc){logger['info'](_0xf8a0('0x19'),_0x502e50);logger[_0xf8a0('0x1a')]('GetVoiceCallReport',_0x502e50,JSON[_0xf8a0('0xd')](_0x32e9dc));_0x15f98f(_0x32e9dc);})[_0xf8a0('0x1b')](function(_0x292a2d){logger['error']('GetVoiceCallReport',_0x292a2d[_0xf8a0('0x10')],_0x502e50);_0x4c1c51(_0x115583[_0xf8a0('0xe')](0x1f4,_0x292a2d[_0xf8a0('0x10')]));});});};exports[_0xf8a0('0x1c')]=function(_0x472117){var _0x299ce2=this;return new Promise(function(_0x513680,_0x1cddec){return db['VoiceCallReport'][_0xf8a0('0x1d')](_0x472117[_0xf8a0('0x1e')],{'raw':_0x472117['options']?_0x472117[_0xf8a0('0x13')][_0xf8a0('0x14')]===undefined?!![]:![]:!![]})[_0xf8a0('0x8')](function(_0x33c3f9){logger['info'](_0xf8a0('0x1c'),_0x472117);logger[_0xf8a0('0x1a')](_0xf8a0('0x1c'),_0x472117,JSON[_0xf8a0('0xd')](_0x33c3f9));_0x513680(_0x33c3f9);})['catch'](function(_0x1efc4a){logger[_0xf8a0('0xe')](_0xf8a0('0x1c'),_0x1efc4a[_0xf8a0('0x10')],_0x472117);_0x1cddec(_0x299ce2['error'](0x1f4,_0x1efc4a['message']));});});};exports[_0xf8a0('0x1f')]=function(_0x1b3c33){var _0x438c8a=this;return new Promise(function(_0x448544,_0x2063d4){return db['VoiceCallReport'][_0xf8a0('0x20')](_0x1b3c33[_0xf8a0('0x1e')],{'raw':_0x1b3c33['options']?_0x1b3c33[_0xf8a0('0x13')][_0xf8a0('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3c33['options']?_0x1b3c33[_0xf8a0('0x13')][_0xf8a0('0x21')]||null:null,'attributes':_0x1b3c33[_0xf8a0('0x13')]?_0x1b3c33['options'][_0xf8a0('0x15')]||null:null,'limit':_0x1b3c33[_0xf8a0('0x13')]?_0x1b3c33[_0xf8a0('0x13')][_0xf8a0('0x16')]||null:null})[_0xf8a0('0x8')](function(_0x282f3e){logger[_0xf8a0('0x9')](_0xf8a0('0x1f'),_0x1b3c33);logger[_0xf8a0('0x1a')](_0xf8a0('0x1f'),_0x1b3c33,JSON[_0xf8a0('0xd')](_0x282f3e));_0x448544(_0x282f3e);})['catch'](function(_0x7544c){logger[_0xf8a0('0xe')]('UpdateVoiceCallReport',_0x7544c[_0xf8a0('0x10')],_0x1b3c33);_0x2063d4(_0x438c8a[_0xf8a0('0xe')](0x1f4,_0x7544c[_0xf8a0('0x10')]));});});};
\ No newline at end of file
+var _0xacb6=['lodash','util','moment','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceCallReport','CreateVoiceCallReport','update','body','UpdateVoiceCallReport'];(function(_0x86a73e,_0x21d8a9){var _0x21f65e=function(_0x2b28fa){while(--_0x2b28fa){_0x86a73e['push'](_0x86a73e['shift']());}};_0x21f65e(++_0x21d8a9);}(_0xacb6,0x1c7));var _0x6acb=function(_0x128484,_0x5e8cb1){_0x128484=_0x128484-0x0;var _0x1eca05=_0xacb6[_0x128484];return _0x1eca05;};'use strict';var _=require(_0x6acb('0x0'));var util=require(_0x6acb('0x1'));var moment=require(_0x6acb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6acb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6acb('0x4'));var logger=require('../../config/logger')(_0x6acb('0x5'));var config=require('../../config/environment');var jayson=require(_0x6acb('0x6'));var client=jayson[_0x6acb('0x7')][_0x6acb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x362e97,_0x2cc9b3,_0x4829e8){return new BPromise(function(_0x6e790f,_0x28f533){return client[_0x6acb('0x9')](_0x362e97,_0x4829e8)[_0x6acb('0xa')](function(_0x42c88f){logger[_0x6acb('0xb')](_0x6acb('0xc'),_0x2cc9b3,_0x6acb('0xd'));logger[_0x6acb('0xe')](_0x6acb('0xf'),_0x2cc9b3,'request\x20sent',JSON[_0x6acb('0x10')](_0x42c88f));if(_0x42c88f[_0x6acb('0x11')]){if(_0x42c88f[_0x6acb('0x11')]['code']===0x1f4){logger[_0x6acb('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x2cc9b3,_0x42c88f[_0x6acb('0x11')][_0x6acb('0x12')]);return _0x28f533(_0x42c88f['error'][_0x6acb('0x12')]);}logger['error'](_0x6acb('0xc'),_0x2cc9b3,_0x42c88f[_0x6acb('0x11')][_0x6acb('0x12')]);return _0x6e790f(_0x42c88f[_0x6acb('0x11')][_0x6acb('0x12')]);}else{logger[_0x6acb('0xb')](_0x6acb('0xc'),_0x2cc9b3,_0x6acb('0xd'));_0x6e790f(_0x42c88f['result'][_0x6acb('0x12')]);}})[_0x6acb('0x13')](function(_0x278c03){logger[_0x6acb('0x11')](_0x6acb('0xc'),_0x2cc9b3,_0x278c03);_0x28f533(_0x278c03);});});}exports['GetVoiceCallReport']=function(_0x25f47e){var _0x252287=this;return new Promise(function(_0x1ecf70,_0xe93ea4){return db[_0x6acb('0x14')][_0x6acb('0x15')]({'raw':_0x25f47e[_0x6acb('0x16')]?_0x25f47e[_0x6acb('0x16')][_0x6acb('0x17')]===undefined?!![]:![]:!![],'where':_0x25f47e[_0x6acb('0x16')]?_0x25f47e[_0x6acb('0x16')][_0x6acb('0x18')]||null:null,'attributes':_0x25f47e[_0x6acb('0x16')]?_0x25f47e[_0x6acb('0x16')][_0x6acb('0x19')]||null:null,'limit':_0x25f47e['options']?_0x25f47e[_0x6acb('0x16')][_0x6acb('0x1a')]||null:null,'include':_0x25f47e[_0x6acb('0x16')]?_0x25f47e['options']['include']?_[_0x6acb('0x1b')](_0x25f47e[_0x6acb('0x16')][_0x6acb('0x1c')],function(_0x45991c){return{'model':db[_0x45991c[_0x6acb('0x1d')]],'as':_0x45991c['as'],'attributes':_0x45991c[_0x6acb('0x19')],'include':_0x45991c[_0x6acb('0x1c')]?_[_0x6acb('0x1b')](_0x45991c[_0x6acb('0x1c')],function(_0x2fda04){return{'model':db[_0x2fda04[_0x6acb('0x1d')]],'as':_0x2fda04['as'],'attributes':_0x2fda04['attributes'],'include':_0x2fda04[_0x6acb('0x1c')]?_[_0x6acb('0x1b')](_0x2fda04[_0x6acb('0x1c')],function(_0x2b936a){return{'model':db[_0x2b936a['model']],'as':_0x2b936a['as'],'attributes':_0x2b936a[_0x6acb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6acb('0xa')](function(_0x4518fa){logger[_0x6acb('0xb')]('GetVoiceCallReport',_0x25f47e);logger['debug'](_0x6acb('0x1e'),_0x25f47e,JSON[_0x6acb('0x10')](_0x4518fa));_0x1ecf70(_0x4518fa);})[_0x6acb('0x13')](function(_0x382f5e){logger[_0x6acb('0x11')](_0x6acb('0x1e'),_0x382f5e[_0x6acb('0x12')],_0x25f47e);_0xe93ea4(_0x252287[_0x6acb('0x11')](0x1f4,_0x382f5e[_0x6acb('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x156c0a){var _0x2587be=this;return new Promise(function(_0x13564c,_0x48fa94){return db[_0x6acb('0x14')]['create'](_0x156c0a['body'],{'raw':_0x156c0a[_0x6acb('0x16')]?_0x156c0a[_0x6acb('0x16')][_0x6acb('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0287){logger['info'](_0x6acb('0x1f'),_0x156c0a);logger[_0x6acb('0xe')](_0x6acb('0x1f'),_0x156c0a,JSON[_0x6acb('0x10')](_0x4f0287));_0x13564c(_0x4f0287);})[_0x6acb('0x13')](function(_0x1b3de3){logger[_0x6acb('0x11')](_0x6acb('0x1f'),_0x1b3de3[_0x6acb('0x12')],_0x156c0a);_0x48fa94(_0x2587be[_0x6acb('0x11')](0x1f4,_0x1b3de3[_0x6acb('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x1c03ce){var _0x114865=this;return new Promise(function(_0x2ef7ad,_0x5dfed2){return db[_0x6acb('0x14')][_0x6acb('0x20')](_0x1c03ce[_0x6acb('0x21')],{'raw':_0x1c03ce[_0x6acb('0x16')]?_0x1c03ce[_0x6acb('0x16')][_0x6acb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c03ce[_0x6acb('0x16')]?_0x1c03ce[_0x6acb('0x16')][_0x6acb('0x18')]||null:null,'attributes':_0x1c03ce['options']?_0x1c03ce['options']['attributes']||null:null,'limit':_0x1c03ce[_0x6acb('0x16')]?_0x1c03ce['options'][_0x6acb('0x1a')]||null:null})[_0x6acb('0xa')](function(_0x25ffba){logger[_0x6acb('0xb')](_0x6acb('0x22'),_0x1c03ce);logger[_0x6acb('0xe')](_0x6acb('0x22'),_0x1c03ce,JSON['stringify'](_0x25ffba));_0x2ef7ad(_0x25ffba);})[_0x6acb('0x13')](function(_0x5813cb){logger[_0x6acb('0x11')](_0x6acb('0x22'),_0x5813cb[_0x6acb('0x12')],_0x1c03ce);_0x5dfed2(_0x114865[_0x6acb('0x11')](0x1f4,_0x5813cb[_0x6acb('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c0c=['../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0c0c,0x19b));var _0xc0c0=function(_0x28ec75,_0x5a81ae){_0x28ec75=_0x28ec75-0x0;var _0x219ad6=_0x0c0c[_0x28ec75];return _0x219ad6;};'use strict';var multer=require(_0xc0c0('0x0'));var util=require(_0xc0c0('0x1'));var path=require(_0xc0c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0c0('0x3'));var router=express[_0xc0c0('0x4')]();var fs_extra=require(_0xc0c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc0c0('0x6'));var config=require(_0xc0c0('0x7'));var controller=require(_0xc0c0('0x8'));router[_0xc0c0('0x9')]('/',auth['isAuthenticated'](),controller[_0xc0c0('0xa')]);router[_0xc0c0('0x9')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller['show']);router[_0xc0c0('0xd')]('/',auth[_0xc0c0('0xc')](),controller[_0xc0c0('0xe')]);router[_0xc0c0('0xf')](_0xc0c0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc0c0('0x10')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller[_0xc0c0('0x11')]);module[_0xc0c0('0x12')]=router;
\ No newline at end of file
+var _0x58fc=['./voiceChanSpy.controller','get','index','/:id','post','isAuthenticated','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x58fc,0xa3));var _0xc58f=function(_0xe8b766,_0x5ef18f){_0xe8b766=_0xe8b766-0x0;var _0x4e6dee=_0x58fc[_0xe8b766];return _0x4e6dee;};'use strict';var multer=require(_0xc58f('0x0'));var util=require(_0xc58f('0x1'));var path=require('path');var timeout=require(_0xc58f('0x2'));var express=require(_0xc58f('0x3'));var router=express[_0xc58f('0x4')]();var fs_extra=require(_0xc58f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc58f('0x6'));var config=require(_0xc58f('0x7'));var controller=require(_0xc58f('0x8'));router[_0xc58f('0x9')]('/',auth['isAuthenticated'](),controller[_0xc58f('0xa')]);router[_0xc58f('0x9')](_0xc58f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc58f('0xc')]('/',auth[_0xc58f('0xd')](),controller[_0xc58f('0xe')]);router[_0xc58f('0xf')](_0xc58f('0xb'),auth[_0xc58f('0xd')](),controller[_0xc58f('0x10')]);router['delete'](_0xc58f('0xb'),auth['isAuthenticated'](),controller[_0xc58f('0x11')]);module[_0xc58f('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa31a=['options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa31a,0x175));var _0xaa31=function(_0x5672c5,_0x22f273){_0x5672c5=_0x5672c5-0x0;var _0x156413=_0xa31a[_0x5672c5];return _0x156413;};'use strict';var Sequelize=require(_0xaa31('0x0'));module[_0xaa31('0x1')]={'name':{'type':Sequelize[_0xaa31('0x2')]},'prefix':{'type':Sequelize[_0xaa31('0x2')],'unique':_0xaa31('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x292a45){this[_0xaa31('0x4')]('options',_0x292a45?_0x292a45[_0xaa31('0x5')](''):[]);},'get':function(){return this[_0xaa31('0x6')](_0xaa31('0x7'))?this[_0xaa31('0x6')]('options')[_0xaa31('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xaa31('0x2')]},'record':{'type':Sequelize[_0xaa31('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xaa31('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x67ae=['split','BOOLEAN','STRING','setDataValue','getDataValue','options'];(function(_0x2dc00a,_0x2bc359){var _0x2a8789=function(_0x35aaa9){while(--_0x35aaa9){_0x2dc00a['push'](_0x2dc00a['shift']());}};_0x2a8789(++_0x2bc359);}(_0x67ae,0x13a));var _0xe67a=function(_0x2042c0,_0x2f7ba6){_0x2042c0=_0x2042c0-0x0;var _0x20904f=_0x67ae[_0x2042c0];return _0x20904f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xe67a('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xe67a('0x0')],'set':function(_0x27f365){this[_0xe67a('0x1')]('options',_0x27f365?_0x27f365['join'](''):[]);},'get':function(){return this[_0xe67a('0x2')](_0xe67a('0x3'))?this[_0xe67a('0x2')]('options')[_0xe67a('0x4')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xe67a('0x0')]},'record':{'type':Sequelize[_0xe67a('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe67a('0x0')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e54=['apply','reject','save','then','get','ChanSpies','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x550b26,_0xe14aae){var _0x1cf038=function(_0x188080){while(--_0x188080){_0x550b26['push'](_0x550b26['shift']());}};_0x1cf038(++_0xe14aae);}(_0x2e54,0x1dd));var _0x42e5=function(_0x3b8531,_0x441334){_0x3b8531=_0x3b8531-0x0;var _0x133138=_0x2e54[_0x3b8531];return _0x133138;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){var _0xf29221=_0x32380f[_0x42e5('0x25')]({'plain':!![]});var _0x275c80=_0x42e5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x275c80,'resourceId':_0xf29221['id']}})[_0x42e5('0x24')](function(){return _0x32380f;});})['then'](function(){_0x37d10e['status'](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x5b1727,_0x392c6b){return function(_0x2d9e65){if(!_0x2d9e65){_0x5b1727[_0x42e5('0x18')](0x194);}return _0x2d9e65;};}function handleError(_0x1c8ee4,_0x27ae27){_0x27ae27=_0x27ae27||0x1f4;return function(_0x2f1edc){logger['error'](_0x2f1edc[_0x42e5('0x27')]);if(_0x2f1edc[_0x42e5('0x28')]){delete _0x2f1edc[_0x42e5('0x28')];}_0x1c8ee4[_0x42e5('0x19')](_0x27ae27)[_0x42e5('0x29')](_0x2f1edc);};}exports[_0x42e5('0x2a')]=function(_0x383e97,_0x282cbf){var _0x5a4930={},_0x2ba9ef={},_0x2c7542={'count':0x0,'rows':[]};var _0x3d9e8b=_[_0x42e5('0x2b')](db['VoiceChanSpy'][_0x42e5('0x2c')],function(_0xf5a3dc){return{'name':_0xf5a3dc[_0x42e5('0x2d')],'type':_0xf5a3dc[_0x42e5('0x2e')]['key']};});_0x2ba9ef['model']=_[_0x42e5('0x2b')](_0x3d9e8b,'name');_0x2ba9ef[_0x42e5('0x2f')]=_['keys'](_0x383e97[_0x42e5('0x2f')]);_0x2ba9ef[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2ba9ef['model'],_0x2ba9ef[_0x42e5('0x2f')]);_0x5a4930[_0x42e5('0x32')]=_['intersection'](_0x2ba9ef[_0x42e5('0x33')],qs['fields'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x5a4930[_0x42e5('0x32')]=_0x5a4930[_0x42e5('0x32')][_0x42e5('0x35')]?_0x5a4930[_0x42e5('0x32')]:_0x2ba9ef[_0x42e5('0x33')];if(!_0x383e97['query']['hasOwnProperty'](_0x42e5('0x36'))){_0x5a4930[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x383e97['query']['limit']);_0x5a4930['offset']=qs['offset'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x1c')]);}_0x5a4930[_0x42e5('0x37')]=qs[_0x42e5('0x38')](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x38')]);_0x5a4930[_0x42e5('0x39')]=qs[_0x42e5('0x30')](_['pick'](_0x383e97[_0x42e5('0x2f')],_0x2ba9ef['filters']),_0x3d9e8b);if(_0x383e97[_0x42e5('0x2f')][_0x42e5('0x3a')]){_0x5a4930[_0x42e5('0x39')]=_[_0x42e5('0x3b')](_0x5a4930[_0x42e5('0x39')],{'$or':_[_0x42e5('0x2b')](_0x3d9e8b,function(_0xd5e7f5){if(_0xd5e7f5['type']!==_0x42e5('0x3c')){var _0x356ff6={};_0x356ff6[_0xd5e7f5['name']]={'$like':'%'+_0x383e97[_0x42e5('0x2f')]['filter']+'%'};return _0x356ff6;}})});}_0x5a4930=_['merge']({},_0x5a4930,_0x383e97['options']);var _0x1105ea={'where':_0x5a4930[_0x42e5('0x39')]};return db[_0x42e5('0x3d')][_0x42e5('0x1f')](_0x1105ea)[_0x42e5('0x24')](function(_0x77aa22){_0x2c7542[_0x42e5('0x1f')]=_0x77aa22;if(_0x383e97['query'][_0x42e5('0x3e')]){_0x5a4930[_0x42e5('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x42e5('0x40')](_0x5a4930);})[_0x42e5('0x24')](function(_0x5db771){_0x2c7542[_0x42e5('0x41')]=_0x5db771;return _0x2c7542;})[_0x42e5('0x24')](respondWithFilteredResult(_0x282cbf,_0x5a4930))[_0x42e5('0x42')](handleError(_0x282cbf,null));};exports[_0x42e5('0x43')]=function(_0x424304,_0x4d32f4){var _0x41e1fd={'raw':![],'where':{'id':_0x424304[_0x42e5('0x44')]['id']}},_0xc34e51={};_0xc34e51[_0x42e5('0x33')]=_['keys'](db[_0x42e5('0x3d')][_0x42e5('0x2c')]);_0xc34e51[_0x42e5('0x2f')]=_[_0x42e5('0x45')](_0x424304[_0x42e5('0x2f')]);_0xc34e51[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0xc34e51[_0x42e5('0x33')],_0xc34e51['query']);_0x41e1fd[_0x42e5('0x32')]=_['intersection'](_0xc34e51['model'],qs[_0x42e5('0x34')](_0x424304[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x41e1fd[_0x42e5('0x32')]=_0x41e1fd[_0x42e5('0x32')][_0x42e5('0x35')]?_0x41e1fd[_0x42e5('0x32')]:_0xc34e51['model'];if(_0x424304[_0x42e5('0x2f')][_0x42e5('0x3e')]){_0x41e1fd[_0x42e5('0x3f')]=[{'all':!![]}];}_0x41e1fd=_[_0x42e5('0x3b')]({},_0x41e1fd,_0x424304[_0x42e5('0x46')]);return db[_0x42e5('0x3d')][_0x42e5('0x47')](_0x41e1fd)[_0x42e5('0x24')](handleEntityNotFound(_0x4d32f4,null))['then'](respondWithResult(_0x4d32f4,null))[_0x42e5('0x42')](handleError(_0x4d32f4,null));};exports[_0x42e5('0x48')]=function(_0x3616f4,_0x48757e){return db[_0x42e5('0x3d')][_0x42e5('0x48')](_0x3616f4[_0x42e5('0x49')],{})[_0x42e5('0x24')](function(_0x2586b0){var _0x528ddd=_0x3616f4[_0x42e5('0x4a')]['get']({'plain':!![]});if(!_0x528ddd)throw new Error(_0x42e5('0x4b'));if(_0x528ddd[_0x42e5('0x4c')]===_0x42e5('0x4a')){var _0x48b63b=_0x2586b0['get']({'plain':!![]});var _0x4f0639=_0x42e5('0x26');return db[_0x42e5('0x4d')][_0x42e5('0x47')]({'where':{'name':_0x4f0639,'userProfileId':_0x528ddd[_0x42e5('0x4e')]},'raw':!![]})['then'](function(_0x3ae9de){if(_0x3ae9de&&_0x3ae9de[_0x42e5('0x4f')]===0x0){return db[_0x42e5('0x50')]['create']({'name':_0x48b63b[_0x42e5('0x28')],'resourceId':_0x48b63b['id'],'type':_0x3ae9de['name'],'sectionId':_0x3ae9de['id']},{})[_0x42e5('0x24')](function(){return _0x2586b0;});}else{return _0x2586b0;}})[_0x42e5('0x42')](function(_0x53e29b){logger[_0x42e5('0x51')](_0x42e5('0x52'),_0x53e29b);throw _0x53e29b;});}return _0x2586b0;})[_0x42e5('0x24')](respondWithResult(_0x48757e,0xc9))[_0x42e5('0x42')](handleError(_0x48757e,null));};exports[_0x42e5('0x53')]=function(_0x3f043f,_0x41c1dc){if(_0x3f043f[_0x42e5('0x49')]['id']){delete _0x3f043f[_0x42e5('0x49')]['id'];}return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x3f043f[_0x42e5('0x44')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x41c1dc,null))[_0x42e5('0x24')](saveUpdates(_0x3f043f[_0x42e5('0x49')],null))[_0x42e5('0x24')](respondWithResult(_0x41c1dc,null))['catch'](handleError(_0x41c1dc,null));};exports[_0x42e5('0x54')]=function(_0x2b226f,_0x40b633){return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x2b226f['params']['id']}})['then'](handleEntityNotFound(_0x40b633,null))[_0x42e5('0x24')](removeEntity(_0x40b633,null))[_0x42e5('0x42')](handleError(_0x40b633,null));};
\ No newline at end of file
+var _0xfa7c=['VoiceChanSpy','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','get','ChanSpies','UserProfileResource','name','map'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x3c205b,_0x11b105){_0x3c205b=_0x3c205b-0x0;var _0x556d59=_0xfa7c[_0x3c205b];return _0x556d59;};'use strict';var emlformat=require(_0xcfa7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfa7('0x1'));var jsonpatch=require(_0xcfa7('0x2'));var rp=require(_0xcfa7('0x3'));var moment=require(_0xcfa7('0x4'));var BPromise=require(_0xcfa7('0x5'));var Mustache=require(_0xcfa7('0x6'));var util=require(_0xcfa7('0x7'));var path=require(_0xcfa7('0x8'));var sox=require('sox');var csv=require(_0xcfa7('0x9'));var ejs=require(_0xcfa7('0xa'));var fs=require('fs');var fs_extra=require(_0xcfa7('0xb'));var _=require(_0xcfa7('0xc'));var squel=require('squel');var crypto=require(_0xcfa7('0xd'));var jsforce=require(_0xcfa7('0xe'));var deskjs=require(_0xcfa7('0xf'));var toCsv=require(_0xcfa7('0x9'));var querystring=require(_0xcfa7('0x10'));var Papa=require(_0xcfa7('0x11'));var Redis=require('ioredis');var authService=require(_0xcfa7('0x12'));var qs=require(_0xcfa7('0x13'));var as=require(_0xcfa7('0x14'));var hardwareService=require(_0xcfa7('0x15'));var logger=require(_0xcfa7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcfa7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcfa7('0x18'))['db'];function respondWithStatusCode(_0x18e202,_0x53d0fb){_0x53d0fb=_0x53d0fb||0xcc;return function(_0x299280){if(_0x299280){return _0x18e202[_0xcfa7('0x19')](_0x53d0fb);}return _0x18e202[_0xcfa7('0x1a')](_0x53d0fb)[_0xcfa7('0x1b')]();};}function respondWithResult(_0x2f69ef,_0x578718){_0x578718=_0x578718||0xc8;return function(_0x42500c){if(_0x42500c){return _0x2f69ef['status'](_0x578718)['json'](_0x42500c);}};}function respondWithFilteredResult(_0x465d21,_0x470a55){return function(_0x29cef5){if(_0x29cef5){var _0x349679=typeof _0x470a55[_0xcfa7('0x1c')]==='undefined'&&typeof _0x470a55[_0xcfa7('0x1d')]===_0xcfa7('0x1e');var _0x1236d5=_0x29cef5[_0xcfa7('0x1f')];var _0x4e2a46=_0x349679?0x0:_0x470a55[_0xcfa7('0x1c')];var _0x34f829=_0x349679?_0x29cef5['count']:_0x470a55['offset']+_0x470a55[_0xcfa7('0x1d')];var _0x3f582f;if(_0x34f829>=_0x1236d5){_0x34f829=_0x1236d5;_0x3f582f=0xc8;}else{_0x3f582f=0xce;}_0x465d21[_0xcfa7('0x1a')](_0x3f582f);return _0x465d21[_0xcfa7('0x20')](_0xcfa7('0x21'),_0x4e2a46+'-'+_0x34f829+'/'+_0x1236d5)[_0xcfa7('0x22')](_0x29cef5);}return null;};}function patchUpdates(_0x2312fd){return function(_0x602f15){try{jsonpatch['apply'](_0x602f15,_0x2312fd,!![]);}catch(_0x47519a){return BPromise['reject'](_0x47519a);}return _0x602f15['save']();};}function saveUpdates(_0x5a567d,_0xdf35fa){return function(_0x49e624){if(_0x49e624){return _0x49e624[_0xcfa7('0x23')](_0x5a567d)[_0xcfa7('0x24')](function(_0x3816fb){return _0x3816fb;});}return null;};}function removeEntity(_0x3423ad,_0xdd7c11){return function(_0x2d00e1){if(_0x2d00e1){return _0x2d00e1[_0xcfa7('0x25')]()[_0xcfa7('0x24')](function(){var _0x5bff8b=_0x2d00e1[_0xcfa7('0x26')]({'plain':!![]});var _0x222ce2=_0xcfa7('0x27');return db[_0xcfa7('0x28')]['destroy']({'where':{'type':_0x222ce2,'resourceId':_0x5bff8b['id']}})[_0xcfa7('0x24')](function(){return _0x2d00e1;});})[_0xcfa7('0x24')](function(){_0x3423ad[_0xcfa7('0x1a')](0xcc)[_0xcfa7('0x1b')]();});}};}function handleEntityNotFound(_0x948e56,_0x5e59c8){return function(_0x458cc6){if(!_0x458cc6){_0x948e56[_0xcfa7('0x19')](0x194);}return _0x458cc6;};}function handleError(_0x347d17,_0xd8f4c1){_0xd8f4c1=_0xd8f4c1||0x1f4;return function(_0x5daee2){logger['error'](_0x5daee2['stack']);if(_0x5daee2[_0xcfa7('0x29')]){delete _0x5daee2[_0xcfa7('0x29')];}_0x347d17[_0xcfa7('0x1a')](_0xd8f4c1)['send'](_0x5daee2);};}exports['index']=function(_0x169e38,_0x590c35){var _0x569016={},_0x2824ed={},_0x407b68={'count':0x0,'rows':[]};var _0x1d0f70=_[_0xcfa7('0x2a')](db[_0xcfa7('0x2b')][_0xcfa7('0x2c')],function(_0xdea3ba){return{'name':_0xdea3ba[_0xcfa7('0x2d')],'type':_0xdea3ba['type']['key']};});_0x2824ed[_0xcfa7('0x2e')]=_[_0xcfa7('0x2a')](_0x1d0f70,_0xcfa7('0x29'));_0x2824ed['query']=_['keys'](_0x169e38[_0xcfa7('0x2f')]);_0x2824ed[_0xcfa7('0x30')]=_[_0xcfa7('0x31')](_0x2824ed['model'],_0x2824ed[_0xcfa7('0x2f')]);_0x569016['attributes']=_[_0xcfa7('0x31')](_0x2824ed['model'],qs[_0xcfa7('0x32')](_0x169e38[_0xcfa7('0x2f')][_0xcfa7('0x32')]));_0x569016[_0xcfa7('0x33')]=_0x569016[_0xcfa7('0x33')][_0xcfa7('0x34')]?_0x569016[_0xcfa7('0x33')]:_0x2824ed['model'];if(!_0x169e38[_0xcfa7('0x2f')][_0xcfa7('0x35')](_0xcfa7('0x36'))){_0x569016[_0xcfa7('0x1d')]=qs[_0xcfa7('0x1d')](_0x169e38[_0xcfa7('0x2f')][_0xcfa7('0x1d')]);_0x569016[_0xcfa7('0x1c')]=qs[_0xcfa7('0x1c')](_0x169e38[_0xcfa7('0x2f')]['offset']);}_0x569016['order']=qs[_0xcfa7('0x37')](_0x169e38['query'][_0xcfa7('0x37')]);_0x569016[_0xcfa7('0x38')]=qs[_0xcfa7('0x30')](_['pick'](_0x169e38[_0xcfa7('0x2f')],_0x2824ed[_0xcfa7('0x30')]),_0x1d0f70);if(_0x169e38['query'][_0xcfa7('0x39')]){_0x569016[_0xcfa7('0x38')]=_[_0xcfa7('0x3a')](_0x569016['where'],{'$or':_[_0xcfa7('0x2a')](_0x1d0f70,function(_0x3e65d6){if(_0x3e65d6[_0xcfa7('0x3b')]!==_0xcfa7('0x3c')){var _0x213fb1={};_0x213fb1[_0x3e65d6[_0xcfa7('0x29')]]={'$like':'%'+_0x169e38['query'][_0xcfa7('0x39')]+'%'};return _0x213fb1;}})});}_0x569016=_['merge']({},_0x569016,_0x169e38[_0xcfa7('0x3d')]);var _0x381772={'where':_0x569016['where']};return db[_0xcfa7('0x2b')][_0xcfa7('0x1f')](_0x381772)['then'](function(_0x443d5b){_0x407b68['count']=_0x443d5b;if(_0x169e38[_0xcfa7('0x2f')][_0xcfa7('0x3e')]){_0x569016['include']=[{'all':!![]}];}return db[_0xcfa7('0x2b')][_0xcfa7('0x3f')](_0x569016);})[_0xcfa7('0x24')](function(_0x98a340){_0x407b68[_0xcfa7('0x40')]=_0x98a340;return _0x407b68;})[_0xcfa7('0x24')](respondWithFilteredResult(_0x590c35,_0x569016))[_0xcfa7('0x41')](handleError(_0x590c35,null));};exports[_0xcfa7('0x42')]=function(_0x571927,_0x24a46a){var _0x3afc02={'raw':![],'where':{'id':_0x571927[_0xcfa7('0x43')]['id']}},_0x2a5edd={};_0x2a5edd[_0xcfa7('0x2e')]=_['keys'](db[_0xcfa7('0x2b')]['rawAttributes']);_0x2a5edd[_0xcfa7('0x2f')]=_[_0xcfa7('0x44')](_0x571927[_0xcfa7('0x2f')]);_0x2a5edd['filters']=_[_0xcfa7('0x31')](_0x2a5edd[_0xcfa7('0x2e')],_0x2a5edd[_0xcfa7('0x2f')]);_0x3afc02[_0xcfa7('0x33')]=_[_0xcfa7('0x31')](_0x2a5edd[_0xcfa7('0x2e')],qs['fields'](_0x571927[_0xcfa7('0x2f')][_0xcfa7('0x32')]));_0x3afc02[_0xcfa7('0x33')]=_0x3afc02[_0xcfa7('0x33')][_0xcfa7('0x34')]?_0x3afc02[_0xcfa7('0x33')]:_0x2a5edd[_0xcfa7('0x2e')];if(_0x571927[_0xcfa7('0x2f')][_0xcfa7('0x3e')]){_0x3afc02['include']=[{'all':!![]}];}_0x3afc02=_[_0xcfa7('0x3a')]({},_0x3afc02,_0x571927[_0xcfa7('0x3d')]);return db[_0xcfa7('0x2b')][_0xcfa7('0x45')](_0x3afc02)[_0xcfa7('0x24')](handleEntityNotFound(_0x24a46a,null))[_0xcfa7('0x24')](respondWithResult(_0x24a46a,null))[_0xcfa7('0x41')](handleError(_0x24a46a,null));};exports['create']=function(_0x4ba0de,_0x33660d){return db[_0xcfa7('0x2b')]['create'](_0x4ba0de[_0xcfa7('0x46')],{})[_0xcfa7('0x24')](function(_0x58bfbd){var _0x1412d2=_0x4ba0de[_0xcfa7('0x47')][_0xcfa7('0x26')]({'plain':!![]});if(!_0x1412d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1412d2[_0xcfa7('0x48')]===_0xcfa7('0x47')){var _0x57c24d=_0x58bfbd[_0xcfa7('0x26')]({'plain':!![]});var _0x16ea8b=_0xcfa7('0x27');return db[_0xcfa7('0x49')]['find']({'where':{'name':_0x16ea8b,'userProfileId':_0x1412d2[_0xcfa7('0x4a')]},'raw':!![]})[_0xcfa7('0x24')](function(_0x57059a){if(_0x57059a&&_0x57059a[_0xcfa7('0x4b')]===0x0){return db[_0xcfa7('0x28')]['create']({'name':_0x57c24d[_0xcfa7('0x29')],'resourceId':_0x57c24d['id'],'type':_0x57059a[_0xcfa7('0x29')],'sectionId':_0x57059a['id']},{})[_0xcfa7('0x24')](function(){return _0x58bfbd;});}else{return _0x58bfbd;}})['catch'](function(_0x403f51){logger[_0xcfa7('0x4c')](_0xcfa7('0x4d'),_0x403f51);throw _0x403f51;});}return _0x58bfbd;})[_0xcfa7('0x24')](respondWithResult(_0x33660d,0xc9))['catch'](handleError(_0x33660d,null));};exports[_0xcfa7('0x23')]=function(_0x56a3f1,_0x360d4d){if(_0x56a3f1[_0xcfa7('0x46')]['id']){delete _0x56a3f1[_0xcfa7('0x46')]['id'];}return db[_0xcfa7('0x2b')][_0xcfa7('0x45')]({'where':{'id':_0x56a3f1[_0xcfa7('0x43')]['id']}})[_0xcfa7('0x24')](handleEntityNotFound(_0x360d4d,null))[_0xcfa7('0x24')](saveUpdates(_0x56a3f1[_0xcfa7('0x46')],null))[_0xcfa7('0x24')](respondWithResult(_0x360d4d,null))['catch'](handleError(_0x360d4d,null));};exports['destroy']=function(_0x47d1d7,_0x21d297){return db[_0xcfa7('0x2b')][_0xcfa7('0x45')]({'where':{'id':_0x47d1d7[_0xcfa7('0x43')]['id']}})[_0xcfa7('0x24')](handleEntityNotFound(_0x21d297,null))[_0xcfa7('0x24')](removeEntity(_0x21d297,null))[_0xcfa7('0x41')](handleError(_0x21d297,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66d2=['destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','MixMonitor','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','internal','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension'];(function(_0x1c490a,_0x217f34){var _0x1e0b1d=function(_0x3ee02b){while(--_0x3ee02b){_0x1c490a['push'](_0x1c490a['shift']());}};_0x1e0b1d(++_0x217f34);}(_0x66d2,0x17d));var _0x266d=function(_0x231541,_0x41f496){_0x231541=_0x231541-0x0;var _0xf99c1=_0x66d2[_0x231541];return _0xf99c1;};'use strict';var _=require(_0x266d('0x0'));var util=require(_0x266d('0x1'));var BPromise=require(_0x266d('0x2'));var attributes=require(_0x266d('0x3'));var getUserApplications=function(_0x1e247f,_0x310546,_0x1c7a0e){var _0x14fd89=0x1;var _0x1c01ea=[];var _0x1f229e={'context':_0x310546[_0x266d('0x4')]||_0x266d('0x5'),'exten':util[_0x266d('0x6')]('%s%s',_0x1e247f[_0x266d('0x7')],_0x1c7a0e),'type':_0x266d('0x8'),'isApp':![],'ChanSpyId':_0x1e247f['id'],'UserId':_0x310546['id']};_0x1c01ea[_0x266d('0x9')](_[_0x266d('0xa')]({'app':_0x266d('0xb'),'appdata':util[_0x266d('0x6')](_0x266d('0xc'),'chanspy'),'priority':_0x14fd89++},_0x1f229e));if(_0x1e247f['record']){_0x1c01ea[_0x266d('0x9')](_['merge']({'app':_0x266d('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x1e247f['recordingFormat']),'priority':_0x14fd89++},_0x1f229e));}if(_0x1e247f[_0x266d('0xe')]){_0x1c01ea[_0x266d('0x9')](_[_0x266d('0xa')]({'app':_0x266d('0xf'),'appdata':_0x1e247f[_0x266d('0x10')],'priority':_0x14fd89++},_0x1f229e));}_0x1c01ea['push'](_[_0x266d('0xa')]({'app':_0x266d('0x11'),'appdata':util['format'](_0x266d('0x12'),_0x310546[_0x266d('0x13')],_0x1e247f[_0x266d('0x14')]?_0x1e247f[_0x266d('0x14')][_0x266d('0x15')](''):''),'priority':_0x14fd89++},_0x1f229e));if(_0x1e247f[_0x266d('0x16')]){_0x1c01ea[_0x266d('0x9')](_['merge']({'app':_0x266d('0x17'),'priority':_0x14fd89++},_0x1f229e));}return _0x1c01ea;};var getChanSpyApplications=function(_0x3da3ac,_0x1daf1f){var _0x3c38d7=[];for(var _0x2d1561=0x0,_0x2ce78d=0x1;_0x2d1561<_0x1daf1f[_0x266d('0x18')];_0x2d1561++,_0x2ce78d=0x1){_0x3c38d7=_0x3c38d7['concat'](getUserApplications(_0x3da3ac,_0x1daf1f[_0x2d1561],_0x1daf1f[_0x2d1561][_0x266d('0x19')]));if(_0x1daf1f[_0x2d1561]['internal']!=_0x1daf1f[_0x2d1561]['name']){_0x3c38d7=_0x3c38d7['concat'](getUserApplications(_0x3da3ac,_0x1daf1f[_0x2d1561],_0x1daf1f[_0x2d1561][_0x266d('0x13')]));}}return _0x3c38d7;};var getChanSpyPromise=function(_0x56c8a9,_0x35cb0b){return new BPromise(function(_0x7f5e8a,_0x4a820b){return _0x56c8a9[_0x266d('0x1a')][_0x266d('0x1b')]({'attributes':['id',_0x266d('0x13'),_0x266d('0x19')],'where':{'role':_0x266d('0x1c'),'chanspy':!![]},'raw':!![]})[_0x266d('0x1d')](function(_0x255b97){if(_0x255b97){return _0x7f5e8a(getChanSpyApplications(_0x35cb0b,_0x255b97));}return _0x7f5e8a([]);})[_0x266d('0x1e')](function(_0x1223a9){_0x4a820b(_0x1223a9);});});};module[_0x266d('0x1f')]=function(_0x37f71d,_0x20ff94){var _0x28d7a8=_0x37f71d[_0x266d('0x20')];return _0x37f71d['define'](_0x266d('0x21'),attributes,{'tableName':_0x266d('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21cbb1,_0x131247,_0x509404){return getChanSpyPromise(_0x28d7a8,_0x21cbb1)[_0x266d('0x1d')](function(_0x39ad28){if(_0x39ad28&&_0x39ad28[_0x266d('0x18')]){return _0x28d7a8['VoiceExtension'][_0x266d('0x23')](_0x39ad28);}})[_0x266d('0x1d')](function(){_0x509404();})[_0x266d('0x1e')](function(_0x30697c){_0x509404(_0x30697c);});},'afterUpdate':function(_0x30adf7,_0x25cee4,_0x1fd7ab){return _0x28d7a8[_0x266d('0x24')][_0x266d('0x25')]({'where':{'ChanSpyId':_0x30adf7['id']}})[_0x266d('0x1d')](function(){return getChanSpyPromise(_0x28d7a8,_0x30adf7);})[_0x266d('0x1d')](function(_0x1a9b20){if(_0x1a9b20&&_0x1a9b20['length']){return _0x28d7a8[_0x266d('0x24')]['bulkCreate'](_0x1a9b20);}})[_0x266d('0x1d')](function(){_0x1fd7ab();})[_0x266d('0x1e')](function(_0x179d58){_0x1fd7ab(_0x179d58);});},'afterDestroy':function(_0x5c5124,_0x5c65fa,_0x467f7c){return _0x28d7a8['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5c5124['id']}})[_0x266d('0x1d')](function(){_0x467f7c();})[_0x266d('0x1e')](function(_0x334c72){_0x467f7c(_0x334c72);});}}});};
\ No newline at end of file
+var _0x56a1=['bluebird','./voiceChanSpy.attributes','context','format','%s%s','system','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','options','join','record','StopMixMonitor','length','concat','internal','name','agent','catch','exports','models','define','VoiceChanSpy','then','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0x1e29c4,_0x4488ad){var _0x262565=function(_0x186681){while(--_0x186681){_0x1e29c4['push'](_0x1e29c4['shift']());}};_0x262565(++_0x4488ad);}(_0x56a1,0x18b));var _0x156a=function(_0x38a660,_0x3a6593){_0x38a660=_0x38a660-0x0;var _0x5a601c=_0x56a1[_0x38a660];return _0x5a601c;};'use strict';var _=require(_0x156a('0x0'));var util=require('util');var BPromise=require(_0x156a('0x1'));var attributes=require(_0x156a('0x2'));var getUserApplications=function(_0x363d3f,_0x27be74,_0x10519c){var _0xb30852=0x1;var _0x37e778=[];var _0x40d89f={'context':_0x27be74[_0x156a('0x3')]||'from-sip','exten':util[_0x156a('0x4')](_0x156a('0x5'),_0x363d3f['prefix'],_0x10519c),'type':_0x156a('0x6'),'isApp':![],'ChanSpyId':_0x363d3f['id'],'UserId':_0x27be74['id']};_0x37e778[_0x156a('0x7')](_[_0x156a('0x8')]({'app':_0x156a('0x9'),'appdata':util[_0x156a('0x4')](_0x156a('0xa'),_0x156a('0xb')),'priority':_0xb30852++},_0x40d89f));if(_0x363d3f['record']){_0x37e778[_0x156a('0x7')](_[_0x156a('0x8')]({'app':_0x156a('0xc'),'appdata':util[_0x156a('0x4')](_0x156a('0xd'),_0x363d3f[_0x156a('0xe')]),'priority':_0xb30852++},_0x40d89f));}if(_0x363d3f[_0x156a('0xf')]){_0x37e778[_0x156a('0x7')](_[_0x156a('0x8')]({'app':_0x156a('0x10'),'appdata':_0x363d3f['password'],'priority':_0xb30852++},_0x40d89f));}_0x37e778[_0x156a('0x7')](_[_0x156a('0x8')]({'app':_0x156a('0x11'),'appdata':util[_0x156a('0x4')]('SIP/%s,%s',_0x27be74['name'],_0x363d3f[_0x156a('0x12')]?_0x363d3f[_0x156a('0x12')][_0x156a('0x13')](''):''),'priority':_0xb30852++},_0x40d89f));if(_0x363d3f[_0x156a('0x14')]){_0x37e778[_0x156a('0x7')](_[_0x156a('0x8')]({'app':_0x156a('0x15'),'priority':_0xb30852++},_0x40d89f));}return _0x37e778;};var getChanSpyApplications=function(_0x3caa62,_0x464efd){var _0x2fdb12=[];for(var _0xc7fc60=0x0,_0x1052d6=0x1;_0xc7fc60<_0x464efd[_0x156a('0x16')];_0xc7fc60++,_0x1052d6=0x1){_0x2fdb12=_0x2fdb12[_0x156a('0x17')](getUserApplications(_0x3caa62,_0x464efd[_0xc7fc60],_0x464efd[_0xc7fc60]['internal']));if(_0x464efd[_0xc7fc60][_0x156a('0x18')]!=_0x464efd[_0xc7fc60][_0x156a('0x19')]){_0x2fdb12=_0x2fdb12['concat'](getUserApplications(_0x3caa62,_0x464efd[_0xc7fc60],_0x464efd[_0xc7fc60][_0x156a('0x19')]));}}return _0x2fdb12;};var getChanSpyPromise=function(_0x1c161d,_0x429645){return new BPromise(function(_0x1399c7,_0x51114b){return _0x1c161d['User']['findAll']({'attributes':['id',_0x156a('0x19'),_0x156a('0x18')],'where':{'role':_0x156a('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0xf14d03){if(_0xf14d03){return _0x1399c7(getChanSpyApplications(_0x429645,_0xf14d03));}return _0x1399c7([]);})[_0x156a('0x1b')](function(_0x3ccf55){_0x51114b(_0x3ccf55);});});};module[_0x156a('0x1c')]=function(_0x754f71,_0x41f164){var _0xef32e2=_0x754f71[_0x156a('0x1d')];return _0x754f71[_0x156a('0x1e')](_0x156a('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4afc41,_0x5a02c1,_0x48f116){return getChanSpyPromise(_0xef32e2,_0x4afc41)[_0x156a('0x20')](function(_0x1836e2){if(_0x1836e2&&_0x1836e2[_0x156a('0x16')]){return _0xef32e2[_0x156a('0x21')][_0x156a('0x22')](_0x1836e2);}})[_0x156a('0x20')](function(){_0x48f116();})[_0x156a('0x1b')](function(_0x284cad){_0x48f116(_0x284cad);});},'afterUpdate':function(_0xa72c78,_0x139a50,_0x1aa95e){return _0xef32e2['VoiceExtension'][_0x156a('0x23')]({'where':{'ChanSpyId':_0xa72c78['id']}})[_0x156a('0x20')](function(){return getChanSpyPromise(_0xef32e2,_0xa72c78);})['then'](function(_0x4b8995){if(_0x4b8995&&_0x4b8995[_0x156a('0x16')]){return _0xef32e2[_0x156a('0x21')][_0x156a('0x22')](_0x4b8995);}})[_0x156a('0x20')](function(){_0x1aa95e();})['catch'](function(_0x1d0f5b){_0x1aa95e(_0x1d0f5b);});},'afterDestroy':function(_0x14012c,_0x1c7037,_0x7b6f24){return _0xef32e2['VoiceExtension'][_0x156a('0x23')]({'where':{'ChanSpyId':_0x14012c['id']}})['then'](function(){_0x7b6f24();})[_0x156a('0x1b')](function(_0x5e6f3a){_0x7b6f24(_0x5e6f3a);});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x18fd0b,_0xe0f9ed){var _0x3b19a3=function(_0xde37ae){while(--_0xde37ae){_0x18fd0b['push'](_0x18fd0b['shift']());}};_0x3b19a3(++_0xe0f9ed);}(_0x9348,0x10d));var _0x8934=function(_0x275fd9,_0x4bd9b0){_0x275fd9=_0x275fd9-0x0;var _0x19c18e=_0x9348[_0x275fd9];return _0x19c18e;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}
\ No newline at end of file
+var _0xd404=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2e3326,_0x3df674){var _0x15618f=function(_0x25e602){while(--_0x25e602){_0x2e3326['push'](_0x2e3326['shift']());}};_0x15618f(++_0x3df674);}(_0xd404,0x15b));var _0x4d40=function(_0x368abd,_0x42e5ec){_0x368abd=_0x368abd-0x0;var _0x45c3e5=_0xd404[_0x368abd];return _0x45c3e5;};'use strict';var _=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var moment=require('moment');var BPromise=require(_0x4d40('0x2'));var rs=require(_0x4d40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d40('0x4'))['db'];var utils=require(_0x4d40('0x5'));var logger=require(_0x4d40('0x6'))(_0x4d40('0x7'));var config=require(_0x4d40('0x8'));var jayson=require(_0x4d40('0x9'));var client=jayson[_0x4d40('0xa')][_0x4d40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e4bd8,_0x4a635e,_0x292180){return new BPromise(function(_0x116941,_0x5a23a2){return client[_0x4d40('0xc')](_0x2e4bd8,_0x292180)['then'](function(_0x5aeb91){logger[_0x4d40('0xd')](_0x4d40('0xe'),_0x4a635e,_0x4d40('0xf'));logger[_0x4d40('0x10')](_0x4d40('0x11'),_0x4a635e,_0x4d40('0xf'),JSON[_0x4d40('0x12')](_0x5aeb91));if(_0x5aeb91[_0x4d40('0x13')]){if(_0x5aeb91[_0x4d40('0x13')][_0x4d40('0x14')]===0x1f4){logger[_0x4d40('0x13')](_0x4d40('0xe'),_0x4a635e,_0x5aeb91[_0x4d40('0x13')][_0x4d40('0x15')]);return _0x5a23a2(_0x5aeb91['error'][_0x4d40('0x15')]);}logger[_0x4d40('0x13')](_0x4d40('0xe'),_0x4a635e,_0x5aeb91[_0x4d40('0x13')][_0x4d40('0x15')]);return _0x116941(_0x5aeb91['error'][_0x4d40('0x15')]);}else{logger[_0x4d40('0xd')](_0x4d40('0xe'),_0x4a635e,_0x4d40('0xf'));_0x116941(_0x5aeb91[_0x4d40('0x16')][_0x4d40('0x15')]);}})[_0x4d40('0x17')](function(_0x43c902){logger[_0x4d40('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a635e,_0x43c902);_0x5a23a2(_0x43c902);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5eaa=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x5eaa,0xdd));var _0xa5ea=function(_0x3616a4,_0x2b89fa){_0x3616a4=_0x3616a4-0x0;var _0x539472=_0x5eaa[_0x3616a4];return _0x539472;};'use strict';var multer=require(_0xa5ea('0x0'));var util=require(_0xa5ea('0x1'));var path=require(_0xa5ea('0x2'));var timeout=require(_0xa5ea('0x3'));var express=require(_0xa5ea('0x4'));var router=express['Router']();var fs_extra=require(_0xa5ea('0x5'));var auth=require(_0xa5ea('0x6'));var interaction=require(_0xa5ea('0x7'));var config=require(_0xa5ea('0x8'));var controller=require('./voiceContext.controller');router[_0xa5ea('0x9')]('/',auth['isAuthenticated'](),controller[_0xa5ea('0xa')]);router[_0xa5ea('0x9')](_0xa5ea('0xb'),auth[_0xa5ea('0xc')](),controller[_0xa5ea('0xd')]);router[_0xa5ea('0xe')]('/',auth[_0xa5ea('0xc')](),controller[_0xa5ea('0xf')]);router[_0xa5ea('0x10')](_0xa5ea('0xb'),auth[_0xa5ea('0xc')](),controller[_0xa5ea('0x11')]);router[_0xa5ea('0x12')](_0xa5ea('0xb'),auth[_0xa5ea('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xab20=['../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x1b38a8,_0x5bb506){var _0x421f6d=function(_0x515ab4){while(--_0x515ab4){_0x1b38a8['push'](_0x1b38a8['shift']());}};_0x421f6d(++_0x5bb506);}(_0xab20,0x174));var _0x0ab2=function(_0xf96ebe,_0x264f21){_0xf96ebe=_0xf96ebe-0x0;var _0x49fa73=_0xab20[_0xf96ebe];return _0x49fa73;};'use strict';var multer=require(_0x0ab2('0x0'));var util=require(_0x0ab2('0x1'));var path=require(_0x0ab2('0x2'));var timeout=require(_0x0ab2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0ab2('0x4'));var auth=require(_0x0ab2('0x5'));var interaction=require(_0x0ab2('0x6'));var config=require('../../config/environment');var controller=require(_0x0ab2('0x7'));router['get']('/',auth[_0x0ab2('0x8')](),controller[_0x0ab2('0x9')]);router['get'](_0x0ab2('0xa'),auth[_0x0ab2('0x8')](),controller[_0x0ab2('0xb')]);router[_0x0ab2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ab2('0xd')](_0x0ab2('0xa'),auth['isAuthenticated'](),controller[_0x0ab2('0xe')]);router[_0x0ab2('0xf')](_0x0ab2('0xa'),auth['isAuthenticated'](),controller[_0x0ab2('0x10')]);module[_0x0ab2('0x11')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf6e=['name','BOOLEAN','STRING'];(function(_0x48dc7e,_0x5ee759){var _0x5986e1=function(_0xd01224){while(--_0xd01224){_0x48dc7e['push'](_0x48dc7e['shift']());}};_0x5986e1(++_0x5ee759);}(_0xbf6e,0x149));var _0xebf6=function(_0x46319c,_0x5a5ea4){_0x46319c=_0x46319c-0x0;var _0x4b741b=_0xbf6e[_0x46319c];return _0x4b741b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xebf6('0x0')],'unique':_0xebf6('0x1')},'description':{'type':Sequelize[_0xebf6('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xaa68=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x906a,_0x45b0cc){var _0x4b8446=function(_0x282352){while(--_0x282352){_0x906a['push'](_0x906a['shift']());}};_0x4b8446(++_0x45b0cc);}(_0xaa68,0x17e));var _0x8aa6=function(_0x38563c,_0x5be12f){_0x38563c=_0x38563c-0x0;var _0x1c3483=_0xaa68[_0x38563c];return _0x1c3483;};'use strict';var Sequelize=require(_0x8aa6('0x0'));module[_0x8aa6('0x1')]={'name':{'type':Sequelize[_0x8aa6('0x2')],'unique':_0x8aa6('0x3')},'description':{'type':Sequelize[_0x8aa6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8aa6('0x4')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c6d=['key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','create','body','readFileSync','join','root','render','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','update','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','get','Contexts','end','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type'];(function(_0xd7f2eb,_0x29e482){var _0xae3324=function(_0x387d5c){while(--_0x387d5c){_0xd7f2eb['push'](_0xd7f2eb['shift']());}};_0xae3324(++_0x29e482);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x2d6bf1,_0x5b3a23){_0x2d6bf1=_0x2d6bf1-0x0;var _0x5b2495=_0x4c6d[_0x2d6bf1];return _0x5b2495;};'use strict';var emlformat=require(_0xd4c6('0x0'));var rimraf=require(_0xd4c6('0x1'));var zipdir=require(_0xd4c6('0x2'));var jsonpatch=require(_0xd4c6('0x3'));var rp=require(_0xd4c6('0x4'));var moment=require('moment');var BPromise=require(_0xd4c6('0x5'));var Mustache=require(_0xd4c6('0x6'));var util=require(_0xd4c6('0x7'));var path=require('path');var sox=require(_0xd4c6('0x8'));var csv=require(_0xd4c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4c6('0xa'));var _=require(_0xd4c6('0xb'));var squel=require(_0xd4c6('0xc'));var crypto=require('crypto');var jsforce=require(_0xd4c6('0xd'));var deskjs=require(_0xd4c6('0xe'));var toCsv=require(_0xd4c6('0x9'));var querystring=require('querystring');var Papa=require(_0xd4c6('0xf'));var Redis=require(_0xd4c6('0x10'));var authService=require(_0xd4c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd4c6('0x12'));var hardwareService=require(_0xd4c6('0x13'));var logger=require(_0xd4c6('0x14'))(_0xd4c6('0x15'));var utils=require(_0xd4c6('0x16'));var config=require(_0xd4c6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xd4c6('0x18'));var client=jayson['client'][_0xd4c6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1ce98a,_0x191068,_0x2424c3,_0x3a2143){return new BPromise(function(_0x384a98,_0x94f42e){var _0x5b3cf0=_0x3a2143||client;return _0x5b3cf0['request'](_0x1ce98a,_0x2424c3)[_0xd4c6('0x1a')](function(_0x3deb85){logger[_0xd4c6('0x1b')](_0xd4c6('0x1c'),_0x191068,_0xd4c6('0x1d'));logger[_0xd4c6('0x1e')](_0xd4c6('0x1f'),_0x191068,'request\x20sent',JSON[_0xd4c6('0x20')](_0x3deb85));if(_0x3deb85[_0xd4c6('0x21')]){if(_0x3deb85[_0xd4c6('0x21')][_0xd4c6('0x22')]===0x1f4){logger[_0xd4c6('0x21')]('VoiceContext,\x20%s,\x20%s',_0x191068,_0x3deb85[_0xd4c6('0x21')][_0xd4c6('0x23')]);return _0x94f42e(_0x3deb85[_0xd4c6('0x21')]['message']);}logger[_0xd4c6('0x21')](_0xd4c6('0x1c'),_0x191068,_0x3deb85[_0xd4c6('0x21')][_0xd4c6('0x23')]);return _0x384a98(_0x3deb85['error'][_0xd4c6('0x23')]);}else{logger['info'](_0xd4c6('0x1c'),_0x191068,_0xd4c6('0x1d'));_0x384a98(_0x3deb85[_0xd4c6('0x24')][_0xd4c6('0x23')]);}})[_0xd4c6('0x25')](function(_0x27d8eb){logger[_0xd4c6('0x21')](_0xd4c6('0x1c'),_0x191068,_0x27d8eb);_0x94f42e(_0x27d8eb);});});}function respondWithStatusCode(_0x155cb3,_0x466330){_0x466330=_0x466330||0xcc;return function(_0x1ebb17){if(_0x1ebb17){return _0x155cb3[_0xd4c6('0x26')](_0x466330);}return _0x155cb3['status'](_0x466330)['end']();};}function respondWithResult(_0x2f7309,_0x2febbf){_0x2febbf=_0x2febbf||0xc8;return function(_0x4a5390){if(_0x4a5390){return _0x2f7309[_0xd4c6('0x27')](_0x2febbf)[_0xd4c6('0x28')](_0x4a5390);}};}function respondWithFilteredResult(_0x100411,_0x565b25){return function(_0x35b50c){if(_0x35b50c){var _0x30276c=typeof _0x565b25['offset']===_0xd4c6('0x29')&&typeof _0x565b25[_0xd4c6('0x2a')]===_0xd4c6('0x29');var _0x488e7e=_0x35b50c[_0xd4c6('0x2b')];var _0x3b656d=_0x30276c?0x0:_0x565b25[_0xd4c6('0x2c')];var _0x4270d5=_0x30276c?_0x35b50c[_0xd4c6('0x2b')]:_0x565b25[_0xd4c6('0x2c')]+_0x565b25[_0xd4c6('0x2a')];var _0x1f32d8;if(_0x4270d5>=_0x488e7e){_0x4270d5=_0x488e7e;_0x1f32d8=0xc8;}else{_0x1f32d8=0xce;}_0x100411[_0xd4c6('0x27')](_0x1f32d8);return _0x100411[_0xd4c6('0x2d')](_0xd4c6('0x2e'),_0x3b656d+'-'+_0x4270d5+'/'+_0x488e7e)[_0xd4c6('0x28')](_0x35b50c);}return null;};}function patchUpdates(_0x15d312){return function(_0x112969){try{jsonpatch['apply'](_0x112969,_0x15d312,!![]);}catch(_0x25229b){return BPromise[_0xd4c6('0x2f')](_0x25229b);}return _0x112969[_0xd4c6('0x30')]();};}function saveUpdates(_0x38d423,_0x4a4667){return function(_0x4f8a76){if(_0x4f8a76){return _0x4f8a76['update'](_0x38d423)[_0xd4c6('0x1a')](function(_0x42161e){return _0x42161e;});}return null;};}function removeEntity(_0x1eb355,_0x2ee8df){return function(_0x1ac153){if(_0x1ac153){return _0x1ac153[_0xd4c6('0x31')]()[_0xd4c6('0x1a')](function(){var _0x5cd469=_0x1ac153[_0xd4c6('0x32')]({'plain':!![]});var _0x3ae596=_0xd4c6('0x33');return db['UserProfileResource'][_0xd4c6('0x31')]({'where':{'type':_0x3ae596,'resourceId':_0x5cd469['id']}})[_0xd4c6('0x1a')](function(){return _0x1ac153;});})[_0xd4c6('0x1a')](function(){_0x1eb355['status'](0xcc)[_0xd4c6('0x34')]();});}};}function handleEntityNotFound(_0x37a3a1,_0xdff93){return function(_0xe5aa2d){if(!_0xe5aa2d){_0x37a3a1['sendStatus'](0x194);}return _0xe5aa2d;};}function handleError(_0x25b48a,_0x155b05){_0x155b05=_0x155b05||0x1f4;return function(_0x14db11){logger[_0xd4c6('0x21')](_0x14db11[_0xd4c6('0x35')]);if(_0x14db11['name']){delete _0x14db11[_0xd4c6('0x36')];}_0x25b48a[_0xd4c6('0x27')](_0x155b05)[_0xd4c6('0x37')](_0x14db11);};}exports[_0xd4c6('0x38')]=function(_0x24a145,_0x2cdb9d){var _0x554666={},_0x13b552={},_0x3e9e92={'count':0x0,'rows':[]};var _0x3bb951=_['map'](db[_0xd4c6('0x39')][_0xd4c6('0x3a')],function(_0x1c95e3){return{'name':_0x1c95e3[_0xd4c6('0x3b')],'type':_0x1c95e3[_0xd4c6('0x3c')][_0xd4c6('0x3d')]};});_0x13b552[_0xd4c6('0x3e')]=_[_0xd4c6('0x3f')](_0x3bb951,_0xd4c6('0x36'));_0x13b552['query']=_[_0xd4c6('0x40')](_0x24a145['query']);_0x13b552['filters']=_[_0xd4c6('0x41')](_0x13b552[_0xd4c6('0x3e')],_0x13b552[_0xd4c6('0x42')]);_0x554666[_0xd4c6('0x43')]=_[_0xd4c6('0x41')](_0x13b552['model'],qs['fields'](_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x44')]));_0x554666[_0xd4c6('0x43')]=_0x554666[_0xd4c6('0x43')]['length']?_0x554666[_0xd4c6('0x43')]:_0x13b552['model'];if(!_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x45')](_0xd4c6('0x46'))){_0x554666['limit']=qs[_0xd4c6('0x2a')](_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x2a')]);_0x554666[_0xd4c6('0x2c')]=qs[_0xd4c6('0x2c')](_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x2c')]);}_0x554666[_0xd4c6('0x47')]=qs[_0xd4c6('0x48')](_0x24a145['query'][_0xd4c6('0x48')]);_0x554666[_0xd4c6('0x49')]=qs[_0xd4c6('0x4a')](_['pick'](_0x24a145[_0xd4c6('0x42')],_0x13b552[_0xd4c6('0x4a')]),_0x3bb951);if(_0x24a145[_0xd4c6('0x42')]['filter']){_0x554666['where']=_[_0xd4c6('0x4b')](_0x554666[_0xd4c6('0x49')],{'$or':_[_0xd4c6('0x3f')](_0x3bb951,function(_0x5b9816){if(_0x5b9816[_0xd4c6('0x3c')]!==_0xd4c6('0x4c')){var _0x1a53e9={};_0x1a53e9[_0x5b9816[_0xd4c6('0x36')]]={'$like':'%'+_0x24a145[_0xd4c6('0x42')][_0xd4c6('0x4d')]+'%'};return _0x1a53e9;}})});}_0x554666=_['merge']({},_0x554666,_0x24a145[_0xd4c6('0x4e')]);var _0x221f4b={'where':_0x554666[_0xd4c6('0x49')]};return db[_0xd4c6('0x39')][_0xd4c6('0x2b')](_0x221f4b)[_0xd4c6('0x1a')](function(_0x34fb42){_0x3e9e92[_0xd4c6('0x2b')]=_0x34fb42;if(_0x24a145['query']['includeAll']){_0x554666[_0xd4c6('0x4f')]=[{'all':!![]}];}return db[_0xd4c6('0x39')][_0xd4c6('0x50')](_0x554666);})['then'](function(_0x37aa81){_0x3e9e92[_0xd4c6('0x51')]=_0x37aa81;return _0x3e9e92;})[_0xd4c6('0x1a')](respondWithFilteredResult(_0x2cdb9d,_0x554666))['catch'](handleError(_0x2cdb9d,null));};exports[_0xd4c6('0x52')]=function(_0xa6bd55,_0x17193f){var _0x1cefcc={'raw':![],'where':{'id':_0xa6bd55[_0xd4c6('0x53')]['id']}},_0x50b1ee={};_0x50b1ee[_0xd4c6('0x3e')]=_[_0xd4c6('0x40')](db[_0xd4c6('0x39')][_0xd4c6('0x3a')]);_0x50b1ee[_0xd4c6('0x42')]=_[_0xd4c6('0x40')](_0xa6bd55['query']);_0x50b1ee[_0xd4c6('0x4a')]=_[_0xd4c6('0x41')](_0x50b1ee[_0xd4c6('0x3e')],_0x50b1ee['query']);_0x1cefcc[_0xd4c6('0x43')]=_[_0xd4c6('0x41')](_0x50b1ee[_0xd4c6('0x3e')],qs[_0xd4c6('0x44')](_0xa6bd55[_0xd4c6('0x42')][_0xd4c6('0x44')]));_0x1cefcc[_0xd4c6('0x43')]=_0x1cefcc['attributes'][_0xd4c6('0x54')]?_0x1cefcc['attributes']:_0x50b1ee['model'];if(_0xa6bd55[_0xd4c6('0x42')]['includeAll']){_0x1cefcc[_0xd4c6('0x4f')]=[{'all':!![]}];}_0x1cefcc=_['merge']({},_0x1cefcc,_0xa6bd55[_0xd4c6('0x4e')]);return db['VoiceContext']['find'](_0x1cefcc)[_0xd4c6('0x1a')](handleEntityNotFound(_0x17193f,null))[_0xd4c6('0x1a')](respondWithResult(_0x17193f,null))[_0xd4c6('0x25')](handleError(_0x17193f,null));};exports[_0xd4c6('0x55')]=function(_0x5639b6,_0x241e6c,_0x2fc893){var _0x44a904;return db[_0xd4c6('0x39')]['create'](_0x5639b6[_0xd4c6('0x56')],{'raw':!![]})[_0xd4c6('0x1a')](function(_0x3c8e29){_0x44a904=_0x3c8e29;return db[_0xd4c6('0x39')][_0xd4c6('0x50')]({'raw':!![]});})[_0xd4c6('0x1a')](function(_0x37cb1d){var _0x32e0a8=fs[_0xd4c6('0x57')](path[_0xd4c6('0x58')](config[_0xd4c6('0x59')],'server/files/templates/context.ejs'),'utf8');var _0x2dab4a=ejs[_0xd4c6('0x5a')](_0x32e0a8,{'contexts':_0x37cb1d||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2dab4a);})['then'](function(){return respondWithRpcPromise(_0xd4c6('0x5b'),_0xd4c6('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x3915d1=_0x5639b6[_0xd4c6('0x5c')][_0xd4c6('0x32')]({'plain':!![]});if(!_0x3915d1)throw new Error(_0xd4c6('0x5d'));if(_0x3915d1[_0xd4c6('0x5e')]==='user'){var _0x3e9a31=_0x44a904[_0xd4c6('0x32')]({'plain':!![]});return db[_0xd4c6('0x5f')][_0xd4c6('0x60')]({'where':{'name':_0xd4c6('0x33'),'userProfileId':_0x3915d1[_0xd4c6('0x61')]},'raw':!![]})[_0xd4c6('0x1a')](function(_0x1c5dfa){if(_0x1c5dfa&&_0x1c5dfa[_0xd4c6('0x62')]===0x0){return db[_0xd4c6('0x63')][_0xd4c6('0x55')]({'name':_0x3e9a31[_0xd4c6('0x36')],'resourceId':_0x3e9a31['id'],'type':_0x1c5dfa[_0xd4c6('0x36')],'sectionId':_0x1c5dfa['id']},{})['then'](function(){return _0x44a904;});}else{return _0x44a904;}})['catch'](function(_0x3148ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3148ea);throw _0x3148ea;});}return _0x44a904;})['then'](respondWithResult(_0x241e6c,0xc9))[_0xd4c6('0x25')](handleError(_0x241e6c,null));};exports[_0xd4c6('0x64')]=function(_0x1afde2,_0x46e433,_0x5731f6){var _0xbdcb11;return db[_0xd4c6('0x39')]['find']({'where':{'id':_0x1afde2[_0xd4c6('0x53')]['id']}})[_0xd4c6('0x1a')](handleEntityNotFound(_0x46e433,null))[_0xd4c6('0x1a')](saveUpdates(_0x1afde2[_0xd4c6('0x56')],null))['then'](function(_0x3d711c){if(_0x3d711c){_0xbdcb11=_0x3d711c;return db[_0xd4c6('0x39')]['findAll']({'raw':!![]});}})[_0xd4c6('0x1a')](function(_0xbbdb9c){var _0x5ae295=fs[_0xd4c6('0x57')](path[_0xd4c6('0x58')](config['root'],_0xd4c6('0x65')),'utf8');var _0x7aef4=ejs[_0xd4c6('0x5a')](_0x5ae295,{'contexts':_0xbbdb9c||[]});fs[_0xd4c6('0x66')](_0xd4c6('0x67'),_0x7aef4);})[_0xd4c6('0x1a')](function(){return respondWithRpcPromise(_0xd4c6('0x5b'),'update',{'module':_0xd4c6('0x68')});})['then'](function(){return _0xbdcb11;})[_0xd4c6('0x1a')](respondWithResult(_0x46e433,null))[_0xd4c6('0x25')](handleError(_0x46e433,null));};exports['destroy']=function(_0x136fd1,_0xf13eb9,_0x125639){var _0x5d544f;return db[_0xd4c6('0x39')]['find']({'where':{'id':_0x136fd1[_0xd4c6('0x53')]['id']}})[_0xd4c6('0x1a')](handleEntityNotFound(_0xf13eb9,null))['then'](removeEntity(_0xf13eb9,null))[_0xd4c6('0x1a')](function(){return db['VoiceContext'][_0xd4c6('0x50')]({'raw':!![]});})[_0xd4c6('0x1a')](function(_0x4a8eb7){var _0x22032b=fs[_0xd4c6('0x57')](path['join'](config[_0xd4c6('0x59')],_0xd4c6('0x65')),'utf8');var _0x237255=ejs[_0xd4c6('0x5a')](_0x22032b,{'contexts':_0x4a8eb7});fs[_0xd4c6('0x66')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x237255);return respondWithRpcPromise(_0xd4c6('0x5b'),_0xd4c6('0x31'),{'module':_0xd4c6('0x68')});})[_0xd4c6('0x25')](handleError(_0xf13eb9,null));};
\ No newline at end of file
+var _0x5127=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','update','get','Contexts','UserProfileResource','destroy','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','/etc/asterisk/extensions_xcally_contexts.conf','Reload','zip-dir','fast-json-patch','moment','bluebird','util','path','sox'];(function(_0x1e5157,_0x48c9e6){var _0x574ee7=function(_0x43da41){while(--_0x43da41){_0x1e5157['push'](_0x1e5157['shift']());}};_0x574ee7(++_0x48c9e6);}(_0x5127,0x191));var _0x7512=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x5127[_0x40b3f2];return _0x4ce90c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7512('0x0'));var jsonpatch=require(_0x7512('0x1'));var rp=require('request-promise');var moment=require(_0x7512('0x2'));var BPromise=require(_0x7512('0x3'));var Mustache=require('mustache');var util=require(_0x7512('0x4'));var path=require(_0x7512('0x5'));var sox=require(_0x7512('0x6'));var csv=require(_0x7512('0x7'));var ejs=require(_0x7512('0x8'));var fs=require('fs');var fs_extra=require(_0x7512('0x9'));var _=require(_0x7512('0xa'));var squel=require(_0x7512('0xb'));var crypto=require(_0x7512('0xc'));var jsforce=require(_0x7512('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7512('0x7'));var querystring=require(_0x7512('0xe'));var Papa=require(_0x7512('0xf'));var Redis=require(_0x7512('0x10'));var authService=require(_0x7512('0x11'));var qs=require(_0x7512('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7512('0x13'));var logger=require(_0x7512('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7512('0x15'));var db=require(_0x7512('0x16'))['db'];var jayson=require(_0x7512('0x17'));var client=jayson[_0x7512('0x18')][_0x7512('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5a2f6d,_0x296183,_0x3ac81f,_0x6d2058){return new BPromise(function(_0x5be15b,_0x256893){var _0x4e7d50=_0x6d2058||client;return _0x4e7d50[_0x7512('0x1a')](_0x5a2f6d,_0x3ac81f)[_0x7512('0x1b')](function(_0x5e1d5f){logger[_0x7512('0x1c')](_0x7512('0x1d'),_0x296183,_0x7512('0x1e'));logger[_0x7512('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x296183,_0x7512('0x1e'),JSON['stringify'](_0x5e1d5f));if(_0x5e1d5f[_0x7512('0x20')]){if(_0x5e1d5f['error'][_0x7512('0x21')]===0x1f4){logger[_0x7512('0x20')]('VoiceContext,\x20%s,\x20%s',_0x296183,_0x5e1d5f[_0x7512('0x20')][_0x7512('0x22')]);return _0x256893(_0x5e1d5f['error']['message']);}logger['error'](_0x7512('0x1d'),_0x296183,_0x5e1d5f[_0x7512('0x20')][_0x7512('0x22')]);return _0x5be15b(_0x5e1d5f[_0x7512('0x20')][_0x7512('0x22')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x296183,'request\x20sent');_0x5be15b(_0x5e1d5f['result'][_0x7512('0x22')]);}})[_0x7512('0x23')](function(_0x402133){logger['error']('VoiceContext,\x20%s,\x20%s',_0x296183,_0x402133);_0x256893(_0x402133);});});}function respondWithStatusCode(_0x145aba,_0x2ae5b2){_0x2ae5b2=_0x2ae5b2||0xcc;return function(_0x3c8e38){if(_0x3c8e38){return _0x145aba[_0x7512('0x24')](_0x2ae5b2);}return _0x145aba['status'](_0x2ae5b2)['end']();};}function respondWithResult(_0x30febd,_0x1d9952){_0x1d9952=_0x1d9952||0xc8;return function(_0x3ff45c){if(_0x3ff45c){return _0x30febd[_0x7512('0x25')](_0x1d9952)[_0x7512('0x26')](_0x3ff45c);}};}function respondWithFilteredResult(_0x372458,_0x41ff01){return function(_0x4b7d83){if(_0x4b7d83){var _0x26da48=typeof _0x41ff01['offset']===_0x7512('0x27')&&typeof _0x41ff01[_0x7512('0x28')]===_0x7512('0x27');var _0x587857=_0x4b7d83['count'];var _0x472830=_0x26da48?0x0:_0x41ff01[_0x7512('0x29')];var _0x3d8952=_0x26da48?_0x4b7d83[_0x7512('0x2a')]:_0x41ff01[_0x7512('0x29')]+_0x41ff01['limit'];var _0x42d2c4;if(_0x3d8952>=_0x587857){_0x3d8952=_0x587857;_0x42d2c4=0xc8;}else{_0x42d2c4=0xce;}_0x372458['status'](_0x42d2c4);return _0x372458[_0x7512('0x2b')](_0x7512('0x2c'),_0x472830+'-'+_0x3d8952+'/'+_0x587857)[_0x7512('0x26')](_0x4b7d83);}return null;};}function patchUpdates(_0x317ad8){return function(_0x52940e){try{jsonpatch[_0x7512('0x2d')](_0x52940e,_0x317ad8,!![]);}catch(_0x1ffbe4){return BPromise['reject'](_0x1ffbe4);}return _0x52940e['save']();};}function saveUpdates(_0x345c8d,_0x4e6279){return function(_0x356000){if(_0x356000){return _0x356000[_0x7512('0x2e')](_0x345c8d)['then'](function(_0x3b1607){return _0x3b1607;});}return null;};}function removeEntity(_0x400ef9,_0x8734eb){return function(_0x34aad4){if(_0x34aad4){return _0x34aad4['destroy']()[_0x7512('0x1b')](function(){var _0x42feef=_0x34aad4[_0x7512('0x2f')]({'plain':!![]});var _0x3d1d39=_0x7512('0x30');return db[_0x7512('0x31')][_0x7512('0x32')]({'where':{'type':_0x3d1d39,'resourceId':_0x42feef['id']}})[_0x7512('0x1b')](function(){return _0x34aad4;});})[_0x7512('0x1b')](function(){_0x400ef9[_0x7512('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d6d8,_0x5d7683){return function(_0x568c74){if(!_0x568c74){_0x18d6d8[_0x7512('0x24')](0x194);}return _0x568c74;};}function handleError(_0x5073b8,_0x1c9fa2){_0x1c9fa2=_0x1c9fa2||0x1f4;return function(_0x628bb){logger[_0x7512('0x20')](_0x628bb[_0x7512('0x33')]);if(_0x628bb[_0x7512('0x34')]){delete _0x628bb[_0x7512('0x34')];}_0x5073b8[_0x7512('0x25')](_0x1c9fa2)[_0x7512('0x35')](_0x628bb);};}exports['index']=function(_0x20aa4a,_0x3ccc72){var _0x1b2e01={},_0x40cef9={},_0x9ec596={'count':0x0,'rows':[]};var _0x459d66=_[_0x7512('0x36')](db[_0x7512('0x37')][_0x7512('0x38')],function(_0xed661b){return{'name':_0xed661b[_0x7512('0x39')],'type':_0xed661b[_0x7512('0x3a')][_0x7512('0x3b')]};});_0x40cef9['model']=_[_0x7512('0x36')](_0x459d66,_0x7512('0x34'));_0x40cef9['query']=_[_0x7512('0x3c')](_0x20aa4a[_0x7512('0x3d')]);_0x40cef9[_0x7512('0x3e')]=_[_0x7512('0x3f')](_0x40cef9[_0x7512('0x40')],_0x40cef9[_0x7512('0x3d')]);_0x1b2e01[_0x7512('0x41')]=_[_0x7512('0x3f')](_0x40cef9[_0x7512('0x40')],qs[_0x7512('0x42')](_0x20aa4a[_0x7512('0x3d')]['fields']));_0x1b2e01['attributes']=_0x1b2e01['attributes'][_0x7512('0x43')]?_0x1b2e01[_0x7512('0x41')]:_0x40cef9[_0x7512('0x40')];if(!_0x20aa4a[_0x7512('0x3d')][_0x7512('0x44')]('nolimit')){_0x1b2e01[_0x7512('0x28')]=qs['limit'](_0x20aa4a[_0x7512('0x3d')][_0x7512('0x28')]);_0x1b2e01[_0x7512('0x29')]=qs[_0x7512('0x29')](_0x20aa4a[_0x7512('0x3d')][_0x7512('0x29')]);}_0x1b2e01[_0x7512('0x45')]=qs[_0x7512('0x46')](_0x20aa4a['query'][_0x7512('0x46')]);_0x1b2e01['where']=qs['filters'](_[_0x7512('0x47')](_0x20aa4a[_0x7512('0x3d')],_0x40cef9[_0x7512('0x3e')]),_0x459d66);if(_0x20aa4a[_0x7512('0x3d')][_0x7512('0x48')]){_0x1b2e01[_0x7512('0x49')]=_[_0x7512('0x4a')](_0x1b2e01['where'],{'$or':_[_0x7512('0x36')](_0x459d66,function(_0x536713){if(_0x536713['type']!==_0x7512('0x4b')){var _0x95ff56={};_0x95ff56[_0x536713[_0x7512('0x34')]]={'$like':'%'+_0x20aa4a[_0x7512('0x3d')]['filter']+'%'};return _0x95ff56;}})});}_0x1b2e01=_[_0x7512('0x4a')]({},_0x1b2e01,_0x20aa4a[_0x7512('0x4c')]);var _0x105e2b={'where':_0x1b2e01[_0x7512('0x49')]};return db[_0x7512('0x37')][_0x7512('0x2a')](_0x105e2b)[_0x7512('0x1b')](function(_0x59b6ae){_0x9ec596['count']=_0x59b6ae;if(_0x20aa4a[_0x7512('0x3d')][_0x7512('0x4d')]){_0x1b2e01[_0x7512('0x4e')]=[{'all':!![]}];}return db[_0x7512('0x37')][_0x7512('0x4f')](_0x1b2e01);})[_0x7512('0x1b')](function(_0x44b978){_0x9ec596[_0x7512('0x50')]=_0x44b978;return _0x9ec596;})[_0x7512('0x1b')](respondWithFilteredResult(_0x3ccc72,_0x1b2e01))['catch'](handleError(_0x3ccc72,null));};exports['show']=function(_0x506b08,_0x3e10b2){var _0x280e97={'raw':![],'where':{'id':_0x506b08['params']['id']}},_0x5e0cac={};_0x5e0cac['model']=_[_0x7512('0x3c')](db[_0x7512('0x37')][_0x7512('0x38')]);_0x5e0cac['query']=_[_0x7512('0x3c')](_0x506b08[_0x7512('0x3d')]);_0x5e0cac[_0x7512('0x3e')]=_[_0x7512('0x3f')](_0x5e0cac[_0x7512('0x40')],_0x5e0cac[_0x7512('0x3d')]);_0x280e97[_0x7512('0x41')]=_[_0x7512('0x3f')](_0x5e0cac[_0x7512('0x40')],qs[_0x7512('0x42')](_0x506b08['query']['fields']));_0x280e97[_0x7512('0x41')]=_0x280e97['attributes'][_0x7512('0x43')]?_0x280e97[_0x7512('0x41')]:_0x5e0cac[_0x7512('0x40')];if(_0x506b08['query']['includeAll']){_0x280e97[_0x7512('0x4e')]=[{'all':!![]}];}_0x280e97=_['merge']({},_0x280e97,_0x506b08[_0x7512('0x4c')]);return db[_0x7512('0x37')]['find'](_0x280e97)[_0x7512('0x1b')](handleEntityNotFound(_0x3e10b2,null))[_0x7512('0x1b')](respondWithResult(_0x3e10b2,null))[_0x7512('0x23')](handleError(_0x3e10b2,null));};exports[_0x7512('0x51')]=function(_0x36c38c,_0x5e38f5,_0x473dda){var _0x13c23f;return db['VoiceContext']['create'](_0x36c38c[_0x7512('0x52')],{'raw':!![]})[_0x7512('0x1b')](function(_0xd06b47){_0x13c23f=_0xd06b47;return db[_0x7512('0x37')]['findAll']({'raw':!![]});})[_0x7512('0x1b')](function(_0x1413be){var _0x540c18=fs[_0x7512('0x53')](path[_0x7512('0x54')](config[_0x7512('0x55')],_0x7512('0x56')),_0x7512('0x57'));var _0x4bab52=ejs[_0x7512('0x58')](_0x540c18,{'contexts':_0x1413be||[]});fs[_0x7512('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4bab52);})[_0x7512('0x1b')](function(){return respondWithRpcPromise('Reload',_0x7512('0x51'),{'module':_0x7512('0x5a')});})[_0x7512('0x1b')](function(){var _0x55ac93=_0x36c38c[_0x7512('0x5b')][_0x7512('0x2f')]({'plain':!![]});if(!_0x55ac93)throw new Error(_0x7512('0x5c'));if(_0x55ac93[_0x7512('0x5d')]==='user'){var _0x25ad6c=_0x13c23f[_0x7512('0x2f')]({'plain':!![]});return db[_0x7512('0x5e')]['find']({'where':{'name':'Contexts','userProfileId':_0x55ac93[_0x7512('0x5f')]},'raw':!![]})['then'](function(_0xc191aa){if(_0xc191aa&&_0xc191aa[_0x7512('0x60')]===0x0){return db[_0x7512('0x31')][_0x7512('0x51')]({'name':_0x25ad6c[_0x7512('0x34')],'resourceId':_0x25ad6c['id'],'type':_0xc191aa['name'],'sectionId':_0xc191aa['id']},{})[_0x7512('0x1b')](function(){return _0x13c23f;});}else{return _0x13c23f;}})[_0x7512('0x23')](function(_0xdee20b){logger[_0x7512('0x20')](_0x7512('0x61'),_0xdee20b);throw _0xdee20b;});}return _0x13c23f;})[_0x7512('0x1b')](respondWithResult(_0x5e38f5,0xc9))[_0x7512('0x23')](handleError(_0x5e38f5,null));};exports[_0x7512('0x2e')]=function(_0x480d5c,_0x2d6832,_0x40e861){var _0x3ba0ac;return db['VoiceContext'][_0x7512('0x62')]({'where':{'id':_0x480d5c[_0x7512('0x63')]['id']}})['then'](handleEntityNotFound(_0x2d6832,null))['then'](saveUpdates(_0x480d5c[_0x7512('0x52')],null))[_0x7512('0x1b')](function(_0x579fd8){if(_0x579fd8){_0x3ba0ac=_0x579fd8;return db[_0x7512('0x37')][_0x7512('0x4f')]({'raw':!![]});}})[_0x7512('0x1b')](function(_0x33b9da){var _0x48974c=fs[_0x7512('0x53')](path[_0x7512('0x54')](config['root'],_0x7512('0x56')),'utf8');var _0x5f1980=ejs[_0x7512('0x58')](_0x48974c,{'contexts':_0x33b9da||[]});fs[_0x7512('0x59')](_0x7512('0x64'),_0x5f1980);})[_0x7512('0x1b')](function(){return respondWithRpcPromise('Reload',_0x7512('0x2e'),{'module':_0x7512('0x5a')});})[_0x7512('0x1b')](function(){return _0x3ba0ac;})[_0x7512('0x1b')](respondWithResult(_0x2d6832,null))[_0x7512('0x23')](handleError(_0x2d6832,null));};exports[_0x7512('0x32')]=function(_0x560150,_0x28551e,_0x1b76c2){var _0x56af90;return db[_0x7512('0x37')]['find']({'where':{'id':_0x560150['params']['id']}})[_0x7512('0x1b')](handleEntityNotFound(_0x28551e,null))['then'](removeEntity(_0x28551e,null))[_0x7512('0x1b')](function(){return db[_0x7512('0x37')]['findAll']({'raw':!![]});})[_0x7512('0x1b')](function(_0x46234e){var _0x50be5b=fs[_0x7512('0x53')](path[_0x7512('0x54')](config[_0x7512('0x55')],_0x7512('0x56')),_0x7512('0x57'));var _0x53f200=ejs[_0x7512('0x58')](_0x50be5b,{'contexts':_0x46234e});fs[_0x7512('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x53f200);return respondWithRpcPromise(_0x7512('0x65'),_0x7512('0x32'),{'module':'chan_sip.so'});})[_0x7512('0x23')](handleError(_0x28551e,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7ace=['define','VoiceContext','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise','./voiceContext.attributes','exports'];(function(_0x4a5972,_0x22541e){var _0x49a63c=function(_0x4e1d39){while(--_0x4e1d39){_0x4a5972['push'](_0x4a5972['shift']());}};_0x49a63c(++_0x22541e);}(_0x7ace,0x1bb));var _0xe7ac=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7ace[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0xe7ac('0x0'));var logger=require(_0xe7ac('0x1'))(_0xe7ac('0x2'));var moment=require(_0xe7ac('0x3'));var BPromise=require(_0xe7ac('0x4'));var rp=require(_0xe7ac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7ac('0x6'));module[_0xe7ac('0x7')]=function(_0x5ce6bd,_0x3a4680){return _0x5ce6bd[_0xe7ac('0x8')](_0xe7ac('0x9'),attributes,{'tableName':_0xe7ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7373=['path','rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x435273,_0x2418a8){var _0x1e9e18=function(_0xbc38b0){while(--_0xbc38b0){_0x435273['push'](_0x435273['shift']());}};_0x1e9e18(++_0x2418a8);}(_0x7373,0x1db));var _0x3737=function(_0x2648fa,_0x5efcef){_0x2648fa=_0x2648fa-0x0;var _0x234750=_0x7373[_0x2648fa];return _0x234750;};'use strict';var _=require(_0x3737('0x0'));var util=require('util');var logger=require(_0x3737('0x1'))(_0x3737('0x2'));var moment=require(_0x3737('0x3'));var BPromise=require(_0x3737('0x4'));var rp=require(_0x3737('0x5'));var fs=require('fs');var path=require(_0x3737('0x6'));var rimraf=require(_0x3737('0x7'));var config=require('../../config/environment');var attributes=require(_0x3737('0x8'));module[_0x3737('0x9')]=function(_0x4a09e4,_0x161ea0){return _0x4a09e4[_0x3737('0xa')](_0x3737('0xb'),attributes,{'tableName':_0x3737('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57fa=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x291b93,_0x44b715){var _0x4183c8=function(_0x228c59){while(--_0x228c59){_0x291b93['push'](_0x291b93['shift']());}};_0x4183c8(++_0x44b715);}(_0x57fa,0x127));var _0xa57f=function(_0x11b9ae,_0x1a7bb2){_0x11b9ae=_0x11b9ae-0x0;var _0x54ce78=_0x57fa[_0x11b9ae];return _0x54ce78;};'use strict';var _=require(_0xa57f('0x0'));var util=require(_0xa57f('0x1'));var moment=require('moment');var BPromise=require(_0xa57f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa57f('0x3'));var db=require(_0xa57f('0x4'))['db'];var utils=require(_0xa57f('0x5'));var logger=require(_0xa57f('0x6'))(_0xa57f('0x7'));var config=require(_0xa57f('0x8'));var jayson=require(_0xa57f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d84e9,_0x5b7ae5,_0x438665){return new BPromise(function(_0x871646,_0x24d248){return client[_0xa57f('0xa')](_0x3d84e9,_0x438665)[_0xa57f('0xb')](function(_0x575986){logger[_0xa57f('0xc')](_0xa57f('0xd'),_0x5b7ae5,_0xa57f('0xe'));logger[_0xa57f('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5b7ae5,'request\x20sent',JSON[_0xa57f('0x10')](_0x575986));if(_0x575986[_0xa57f('0x11')]){if(_0x575986[_0xa57f('0x11')][_0xa57f('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b7ae5,_0x575986[_0xa57f('0x11')][_0xa57f('0x13')]);return _0x24d248(_0x575986['error'][_0xa57f('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b7ae5,_0x575986[_0xa57f('0x11')]['message']);return _0x871646(_0x575986[_0xa57f('0x11')]['message']);}else{logger[_0xa57f('0xc')](_0xa57f('0xd'),_0x5b7ae5,_0xa57f('0xe'));_0x871646(_0x575986[_0xa57f('0x14')]['message']);}})['catch'](function(_0x4661ef){logger[_0xa57f('0x11')](_0xa57f('0xd'),_0x5b7ae5,_0x4661ef);_0x24d248(_0x4661ef);});});}
\ No newline at end of file
+var _0xb2a6=['rpc','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2e7b6a,_0xdc3bfb){var _0x42a052=function(_0x175b12){while(--_0x175b12){_0x2e7b6a['push'](_0x2e7b6a['shift']());}};_0x42a052(++_0xdc3bfb);}(_0xb2a6,0xf0));var _0x6b2a=function(_0x2b1a89,_0x36a277){_0x2b1a89=_0x2b1a89-0x0;var _0x473ae3=_0xb2a6[_0x2b1a89];return _0x473ae3;};'use strict';var _=require(_0x6b2a('0x0'));var util=require(_0x6b2a('0x1'));var moment=require('moment');var BPromise=require(_0x6b2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b2a('0x3'));var db=require(_0x6b2a('0x4'))['db'];var utils=require(_0x6b2a('0x5'));var logger=require(_0x6b2a('0x6'))(_0x6b2a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6b2a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54b0ce,_0x209ab4,_0x2663f2){return new BPromise(function(_0x3ec52a,_0x1c8fa6){return client[_0x6b2a('0x9')](_0x54b0ce,_0x2663f2)[_0x6b2a('0xa')](function(_0x4b145f){logger[_0x6b2a('0xb')](_0x6b2a('0xc'),_0x209ab4,_0x6b2a('0xd'));logger[_0x6b2a('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x209ab4,_0x6b2a('0xd'),JSON[_0x6b2a('0xf')](_0x4b145f));if(_0x4b145f[_0x6b2a('0x10')]){if(_0x4b145f[_0x6b2a('0x10')]['code']===0x1f4){logger[_0x6b2a('0x10')](_0x6b2a('0xc'),_0x209ab4,_0x4b145f['error'][_0x6b2a('0x11')]);return _0x1c8fa6(_0x4b145f[_0x6b2a('0x10')][_0x6b2a('0x11')]);}logger[_0x6b2a('0x10')](_0x6b2a('0xc'),_0x209ab4,_0x4b145f[_0x6b2a('0x10')][_0x6b2a('0x11')]);return _0x3ec52a(_0x4b145f['error'][_0x6b2a('0x11')]);}else{logger[_0x6b2a('0xb')](_0x6b2a('0xc'),_0x209ab4,_0x6b2a('0xd'));_0x3ec52a(_0x4b145f[_0x6b2a('0x12')]['message']);}})['catch'](function(_0x101bd5){logger[_0x6b2a('0x10')](_0x6b2a('0xc'),_0x209ab4,_0x101bd5);_0x1c8fa6(_0x101bd5);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x82ba=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x18e860,_0x4e7cf2){var _0x50e46e=function(_0x271cfc){while(--_0x271cfc){_0x18e860['push'](_0x18e860['shift']());}};_0x50e46e(++_0x4e7cf2);}(_0x82ba,0x1d9));var _0xa82b=function(_0x314109,_0x40b281){_0x314109=_0x314109-0x0;var _0xa233fd=_0x82ba[_0x314109];return _0xa233fd;};'use strict';var multer=require(_0xa82b('0x0'));var util=require('util');var path=require(_0xa82b('0x1'));var timeout=require(_0xa82b('0x2'));var express=require(_0xa82b('0x3'));var router=express[_0xa82b('0x4')]();var fs_extra=require(_0xa82b('0x5'));var auth=require(_0xa82b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa82b('0x7'));var controller=require(_0xa82b('0x8'));router[_0xa82b('0x9')]('/',auth[_0xa82b('0xa')](),controller['index']);router['get'](_0xa82b('0xb'),auth[_0xa82b('0xa')](),controller['describe']);router[_0xa82b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa82b('0xc')]('/',auth[_0xa82b('0xa')](),controller[_0xa82b('0xd')]);router[_0xa82b('0xe')]('/:id',auth[_0xa82b('0xa')](),controller[_0xa82b('0xf')]);router[_0xa82b('0x10')](_0xa82b('0x11'),auth[_0xa82b('0xa')](),controller[_0xa82b('0x12')]);module[_0xa82b('0x13')]=router;
\ No newline at end of file
+var _0x10ca=['put','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x10ca,0x1a7));var _0xa10c=function(_0x38d736,_0x369041){_0x38d736=_0x38d736-0x0;var _0x2ac4da=_0x10ca[_0x38d736];return _0x2ac4da;};'use strict';var multer=require(_0xa10c('0x0'));var util=require(_0xa10c('0x1'));var path=require('path');var timeout=require(_0xa10c('0x2'));var express=require(_0xa10c('0x3'));var router=express['Router']();var fs_extra=require(_0xa10c('0x4'));var auth=require(_0xa10c('0x5'));var interaction=require(_0xa10c('0x6'));var config=require(_0xa10c('0x7'));var controller=require(_0xa10c('0x8'));router[_0xa10c('0x9')]('/',auth['isAuthenticated'](),controller[_0xa10c('0xa')]);router[_0xa10c('0x9')](_0xa10c('0xb'),auth[_0xa10c('0xc')](),controller[_0xa10c('0xd')]);router[_0xa10c('0x9')](_0xa10c('0xe'),auth[_0xa10c('0xc')](),controller[_0xa10c('0xf')]);router[_0xa10c('0x10')]('/',auth[_0xa10c('0xc')](),controller[_0xa10c('0x11')]);router[_0xa10c('0x12')]('/:id',auth[_0xa10c('0xc')](),controller['update']);router[_0xa10c('0x13')](_0xa10c('0xe'),auth[_0xa10c('0xc')](),controller[_0xa10c('0x14')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x15c4ac,_0x338f49){var _0x5696aa=function(_0x576fa3){while(--_0x576fa3){_0x15c4ac['push'](_0x15c4ac['shift']());}};_0x5696aa(++_0x338f49);}(_0xb821,0xa7));var _0x1b82=function(_0x292318,_0x5d535f){_0x292318=_0x292318-0x0;var _0x238ae6=_0xb821[_0x292318];return _0x238ae6;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x1d1899,_0x1a11af){var _0x1f77da=function(_0x78fbd4){while(--_0x78fbd4){_0x1d1899['push'](_0x1d1899['shift']());}};_0x1f77da(++_0x1a11af);}(_0x81bd,0x7c));var _0xd81b=function(_0x26e105,_0x821a88){_0x26e105=_0x26e105-0x0;var _0x534f19=_0x81bd[_0x26e105];return _0x534f19;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x40ae=['reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceDialReport','includeAll','include','findAll','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply'];(function(_0x5a15a5,_0x1de601){var _0x58f5dd=function(_0x300967){while(--_0x300967){_0x5a15a5['push'](_0x5a15a5['shift']());}};_0x58f5dd(++_0x1de601);}(_0x40ae,0xca));var _0xe40a=function(_0x2229fb,_0x45e3c0){_0x2229fb=_0x2229fb-0x0;var _0x12ed5a=_0x40ae[_0x2229fb];return _0x12ed5a;};'use strict';var emlformat=require(_0xe40a('0x0'));var rimraf=require(_0xe40a('0x1'));var zipdir=require(_0xe40a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe40a('0x3'));var moment=require(_0xe40a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe40a('0x5'));var util=require('util');var path=require(_0xe40a('0x6'));var sox=require('sox');var csv=require(_0xe40a('0x7'));var ejs=require(_0xe40a('0x8'));var fs=require('fs');var fs_extra=require(_0xe40a('0x9'));var _=require(_0xe40a('0xa'));var squel=require(_0xe40a('0xb'));var crypto=require('crypto');var jsforce=require(_0xe40a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe40a('0x7'));var querystring=require(_0xe40a('0xd'));var Papa=require(_0xe40a('0xe'));var Redis=require(_0xe40a('0xf'));var authService=require(_0xe40a('0x10'));var qs=require(_0xe40a('0x11'));var as=require(_0xe40a('0x12'));var hardwareService=require(_0xe40a('0x13'));var logger=require(_0xe40a('0x14'))(_0xe40a('0x15'));var utils=require(_0xe40a('0x16'));var config=require(_0xe40a('0x17'));var licenseUtil=require(_0xe40a('0x18'));var db=require(_0xe40a('0x19'))['db'];function respondWithStatusCode(_0x3f4282,_0x2b0bb1){_0x2b0bb1=_0x2b0bb1||0xcc;return function(_0x51c98f){if(_0x51c98f){return _0x3f4282[_0xe40a('0x1a')](_0x2b0bb1);}return _0x3f4282[_0xe40a('0x1b')](_0x2b0bb1)['end']();};}function respondWithResult(_0xca875d,_0x293d36){_0x293d36=_0x293d36||0xc8;return function(_0x5628cf){if(_0x5628cf){return _0xca875d[_0xe40a('0x1b')](_0x293d36)[_0xe40a('0x1c')](_0x5628cf);}};}function respondWithFilteredResult(_0x257d80,_0x2c8e8c){return function(_0x1ea9fa){if(_0x1ea9fa){var _0x5da4dc=typeof _0x2c8e8c['offset']==='undefined'&&typeof _0x2c8e8c[_0xe40a('0x1d')]===_0xe40a('0x1e');var _0x33b112=_0x1ea9fa[_0xe40a('0x1f')];var _0x3c6f09=_0x5da4dc?0x0:_0x2c8e8c[_0xe40a('0x20')];var _0x15c6f7=_0x5da4dc?_0x1ea9fa[_0xe40a('0x1f')]:_0x2c8e8c[_0xe40a('0x20')]+_0x2c8e8c[_0xe40a('0x1d')];var _0x3a5999;if(_0x15c6f7>=_0x33b112){_0x15c6f7=_0x33b112;_0x3a5999=0xc8;}else{_0x3a5999=0xce;}_0x257d80['status'](_0x3a5999);return _0x257d80['set'](_0xe40a('0x21'),_0x3c6f09+'-'+_0x15c6f7+'/'+_0x33b112)['json'](_0x1ea9fa);}return null;};}function patchUpdates(_0x473237){return function(_0x43c7f0){try{jsonpatch[_0xe40a('0x22')](_0x43c7f0,_0x473237,!![]);}catch(_0x4a0e91){return BPromise[_0xe40a('0x23')](_0x4a0e91);}return _0x43c7f0[_0xe40a('0x24')]();};}function saveUpdates(_0x461f93,_0xc94148){return function(_0x42c2b3){if(_0x42c2b3){return _0x42c2b3[_0xe40a('0x25')](_0x461f93)[_0xe40a('0x26')](function(_0x32efa2){return _0x32efa2;});}return null;};}function removeEntity(_0xbadafa,_0x39e880){return function(_0x22b960){if(_0x22b960){return _0x22b960[_0xe40a('0x27')]()[_0xe40a('0x26')](function(){_0xbadafa[_0xe40a('0x1b')](0xcc)[_0xe40a('0x28')]();});}};}function handleEntityNotFound(_0x5eb3db,_0x4b0eae){return function(_0x25ac2c){if(!_0x25ac2c){_0x5eb3db['sendStatus'](0x194);}return _0x25ac2c;};}function handleError(_0x2eedc1,_0x22d167){_0x22d167=_0x22d167||0x1f4;return function(_0x1c2dbc){logger[_0xe40a('0x29')](_0x1c2dbc[_0xe40a('0x2a')]);if(_0x1c2dbc[_0xe40a('0x2b')]){delete _0x1c2dbc['name'];}_0x2eedc1['status'](_0x22d167)[_0xe40a('0x2c')](_0x1c2dbc);};}exports[_0xe40a('0x2d')]=function(_0xf1d5b7,_0x2e8f2b){var _0xfb67b7={},_0xa13a16={},_0x3c3c30={'count':0x0,'rows':[]};var _0x1051e2=_[_0xe40a('0x2e')](db['VoiceDialReport'][_0xe40a('0x2f')],function(_0x5ca2e4){return{'name':_0x5ca2e4[_0xe40a('0x30')],'type':_0x5ca2e4[_0xe40a('0x31')][_0xe40a('0x32')]};});_0xa13a16[_0xe40a('0x33')]=_[_0xe40a('0x2e')](_0x1051e2,_0xe40a('0x2b'));_0xa13a16[_0xe40a('0x34')]=_[_0xe40a('0x35')](_0xf1d5b7[_0xe40a('0x34')]);_0xa13a16[_0xe40a('0x36')]=_['intersection'](_0xa13a16[_0xe40a('0x33')],_0xa13a16[_0xe40a('0x34')]);_0xfb67b7[_0xe40a('0x37')]=_[_0xe40a('0x38')](_0xa13a16[_0xe40a('0x33')],qs[_0xe40a('0x39')](_0xf1d5b7['query']['fields']));_0xfb67b7[_0xe40a('0x37')]=_0xfb67b7['attributes']['length']?_0xfb67b7[_0xe40a('0x37')]:_0xa13a16[_0xe40a('0x33')];if(!_0xf1d5b7[_0xe40a('0x34')]['hasOwnProperty'](_0xe40a('0x3a'))){_0xfb67b7['limit']=qs[_0xe40a('0x1d')](_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x1d')]);_0xfb67b7[_0xe40a('0x20')]=qs['offset'](_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x20')]);}_0xfb67b7[_0xe40a('0x3b')]=qs[_0xe40a('0x3c')](_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x3c')]);_0xfb67b7[_0xe40a('0x3d')]=qs[_0xe40a('0x36')](_[_0xe40a('0x3e')](_0xf1d5b7[_0xe40a('0x34')],_0xa13a16[_0xe40a('0x36')]),_0x1051e2);if(_0xf1d5b7[_0xe40a('0x34')]['filter']){_0xfb67b7['where']=_[_0xe40a('0x3f')](_0xfb67b7[_0xe40a('0x3d')],{'$or':_[_0xe40a('0x2e')](_0x1051e2,function(_0x47ce9a){if(_0x47ce9a[_0xe40a('0x31')]!==_0xe40a('0x40')){var _0x2cfebc={};_0x2cfebc[_0x47ce9a[_0xe40a('0x2b')]]={'$like':'%'+_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x41')]+'%'};return _0x2cfebc;}})});}_0xfb67b7=_['merge']({},_0xfb67b7,_0xf1d5b7[_0xe40a('0x42')]);var _0x22e548={'where':_0xfb67b7[_0xe40a('0x3d')]};return db[_0xe40a('0x43')]['count'](_0x22e548)[_0xe40a('0x26')](function(_0x13d022){_0x3c3c30[_0xe40a('0x1f')]=_0x13d022;if(_0xf1d5b7[_0xe40a('0x34')][_0xe40a('0x44')]){_0xfb67b7[_0xe40a('0x45')]=[{'all':!![]}];}return db[_0xe40a('0x43')][_0xe40a('0x46')](_0xfb67b7);})['then'](function(_0x531576){_0x3c3c30['rows']=_0x531576;return _0x3c3c30;})[_0xe40a('0x26')](respondWithFilteredResult(_0x2e8f2b,_0xfb67b7))[_0xe40a('0x47')](handleError(_0x2e8f2b,null));};exports[_0xe40a('0x48')]=function(_0x2cf292,_0x299f83){var _0x251dc8={'raw':!![],'where':{'id':_0x2cf292[_0xe40a('0x49')]['id']}},_0x3ba062={};_0x3ba062[_0xe40a('0x33')]=_[_0xe40a('0x35')](db['VoiceDialReport'][_0xe40a('0x2f')]);_0x3ba062[_0xe40a('0x34')]=_[_0xe40a('0x35')](_0x2cf292['query']);_0x3ba062['filters']=_['intersection'](_0x3ba062[_0xe40a('0x33')],_0x3ba062['query']);_0x251dc8[_0xe40a('0x37')]=_['intersection'](_0x3ba062[_0xe40a('0x33')],qs[_0xe40a('0x39')](_0x2cf292[_0xe40a('0x34')][_0xe40a('0x39')]));_0x251dc8[_0xe40a('0x37')]=_0x251dc8[_0xe40a('0x37')][_0xe40a('0x4a')]?_0x251dc8['attributes']:_0x3ba062[_0xe40a('0x33')];if(_0x2cf292[_0xe40a('0x34')]['includeAll']){_0x251dc8[_0xe40a('0x45')]=[{'all':!![]}];}_0x251dc8=_[_0xe40a('0x3f')]({},_0x251dc8,_0x2cf292[_0xe40a('0x42')]);return db[_0xe40a('0x43')]['find'](_0x251dc8)[_0xe40a('0x26')](handleEntityNotFound(_0x299f83,null))[_0xe40a('0x26')](respondWithResult(_0x299f83,null))[_0xe40a('0x47')](handleError(_0x299f83,null));};exports['create']=function(_0x42483a,_0xeeddb7){return db['VoiceDialReport'][_0xe40a('0x4b')](_0x42483a[_0xe40a('0x4c')],{})[_0xe40a('0x26')](respondWithResult(_0xeeddb7,0xc9))[_0xe40a('0x47')](handleError(_0xeeddb7,null));};exports[_0xe40a('0x25')]=function(_0x55d82e,_0x4c355b){if(_0x55d82e[_0xe40a('0x4c')]['id']){delete _0x55d82e[_0xe40a('0x4c')]['id'];}return db[_0xe40a('0x43')][_0xe40a('0x4d')]({'where':{'id':_0x55d82e[_0xe40a('0x49')]['id']}})[_0xe40a('0x26')](handleEntityNotFound(_0x4c355b,null))[_0xe40a('0x26')](saveUpdates(_0x55d82e[_0xe40a('0x4c')],null))[_0xe40a('0x26')](respondWithResult(_0x4c355b,null))['catch'](handleError(_0x4c355b,null));};exports[_0xe40a('0x27')]=function(_0x5a7d2a,_0xed02a7){return db[_0xe40a('0x43')]['find']({'where':{'id':_0x5a7d2a['params']['id']}})[_0xe40a('0x26')](handleEntityNotFound(_0xed02a7,null))[_0xe40a('0x26')](removeEntity(_0xed02a7,null))[_0xe40a('0x47')](handleError(_0xed02a7,null));};exports[_0xe40a('0x4e')]=function(_0x22be32,_0x49366e){return db['VoiceDialReport'][_0xe40a('0x4e')]()[_0xe40a('0x26')](respondWithResult(_0x49366e,null))['catch'](handleError(_0x49366e,null));};
\ No newline at end of file
+var _0x54cb=['intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceDialReport','includeAll','include','rows','params','keys','fields','find','catch','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x54cb,0x64));var _0xb54c=function(_0x4ca589,_0x24924a){_0x4ca589=_0x4ca589-0x0;var _0x17dca0=_0x54cb[_0x4ca589];return _0x17dca0;};'use strict';var emlformat=require(_0xb54c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb54c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb54c('0x2'));var moment=require('moment');var BPromise=require(_0xb54c('0x3'));var Mustache=require(_0xb54c('0x4'));var util=require(_0xb54c('0x5'));var path=require(_0xb54c('0x6'));var sox=require('sox');var csv=require(_0xb54c('0x7'));var ejs=require(_0xb54c('0x8'));var fs=require('fs');var fs_extra=require(_0xb54c('0x9'));var _=require(_0xb54c('0xa'));var squel=require(_0xb54c('0xb'));var crypto=require(_0xb54c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb54c('0xd'));var toCsv=require(_0xb54c('0x7'));var querystring=require(_0xb54c('0xe'));var Papa=require(_0xb54c('0xf'));var Redis=require(_0xb54c('0x10'));var authService=require(_0xb54c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb54c('0x12'));var logger=require(_0xb54c('0x13'))(_0xb54c('0x14'));var utils=require(_0xb54c('0x15'));var config=require(_0xb54c('0x16'));var licenseUtil=require(_0xb54c('0x17'));var db=require(_0xb54c('0x18'))['db'];function respondWithStatusCode(_0x4d98d7,_0xb13f0a){_0xb13f0a=_0xb13f0a||0xcc;return function(_0x5117ce){if(_0x5117ce){return _0x4d98d7['sendStatus'](_0xb13f0a);}return _0x4d98d7[_0xb54c('0x19')](_0xb13f0a)[_0xb54c('0x1a')]();};}function respondWithResult(_0x3a8c3c,_0x2d4af2){_0x2d4af2=_0x2d4af2||0xc8;return function(_0x4bd583){if(_0x4bd583){return _0x3a8c3c['status'](_0x2d4af2)['json'](_0x4bd583);}};}function respondWithFilteredResult(_0x296faa,_0x36c709){return function(_0x3f8877){if(_0x3f8877){var _0x3835b1=typeof _0x36c709['offset']===_0xb54c('0x1b')&&typeof _0x36c709[_0xb54c('0x1c')]===_0xb54c('0x1b');var _0x1cf1c=_0x3f8877[_0xb54c('0x1d')];var _0x405d96=_0x3835b1?0x0:_0x36c709['offset'];var _0x247d75=_0x3835b1?_0x3f8877[_0xb54c('0x1d')]:_0x36c709[_0xb54c('0x1e')]+_0x36c709['limit'];var _0x2a6a24;if(_0x247d75>=_0x1cf1c){_0x247d75=_0x1cf1c;_0x2a6a24=0xc8;}else{_0x2a6a24=0xce;}_0x296faa[_0xb54c('0x19')](_0x2a6a24);return _0x296faa[_0xb54c('0x1f')](_0xb54c('0x20'),_0x405d96+'-'+_0x247d75+'/'+_0x1cf1c)[_0xb54c('0x21')](_0x3f8877);}return null;};}function patchUpdates(_0x114451){return function(_0x74af59){try{jsonpatch[_0xb54c('0x22')](_0x74af59,_0x114451,!![]);}catch(_0xb46e0c){return BPromise[_0xb54c('0x23')](_0xb46e0c);}return _0x74af59['save']();};}function saveUpdates(_0x39cc4e,_0x366518){return function(_0x16a475){if(_0x16a475){return _0x16a475['update'](_0x39cc4e)[_0xb54c('0x24')](function(_0x53af75){return _0x53af75;});}return null;};}function removeEntity(_0x10dca9,_0x34f85d){return function(_0x1e73ac){if(_0x1e73ac){return _0x1e73ac[_0xb54c('0x25')]()[_0xb54c('0x24')](function(){_0x10dca9[_0xb54c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5636,_0x5dcf5b){return function(_0x4b7d9e){if(!_0x4b7d9e){_0x1f5636[_0xb54c('0x26')](0x194);}return _0x4b7d9e;};}function handleError(_0x3e0598,_0x3997a8){_0x3997a8=_0x3997a8||0x1f4;return function(_0x27fcfb){logger[_0xb54c('0x27')](_0x27fcfb['stack']);if(_0x27fcfb[_0xb54c('0x28')]){delete _0x27fcfb[_0xb54c('0x28')];}_0x3e0598[_0xb54c('0x19')](_0x3997a8)[_0xb54c('0x29')](_0x27fcfb);};}exports[_0xb54c('0x2a')]=function(_0x4e1ac6,_0x8ccf1d){var _0x413551={},_0x45f4d2={},_0x2b7ee4={'count':0x0,'rows':[]};var _0xc436e2=_['map'](db['VoiceDialReport'][_0xb54c('0x2b')],function(_0x59e8ac){return{'name':_0x59e8ac[_0xb54c('0x2c')],'type':_0x59e8ac[_0xb54c('0x2d')][_0xb54c('0x2e')]};});_0x45f4d2['model']=_[_0xb54c('0x2f')](_0xc436e2,_0xb54c('0x28'));_0x45f4d2[_0xb54c('0x30')]=_['keys'](_0x4e1ac6['query']);_0x45f4d2[_0xb54c('0x31')]=_[_0xb54c('0x32')](_0x45f4d2['model'],_0x45f4d2['query']);_0x413551[_0xb54c('0x33')]=_[_0xb54c('0x32')](_0x45f4d2[_0xb54c('0x34')],qs['fields'](_0x4e1ac6['query']['fields']));_0x413551[_0xb54c('0x33')]=_0x413551['attributes']['length']?_0x413551[_0xb54c('0x33')]:_0x45f4d2[_0xb54c('0x34')];if(!_0x4e1ac6[_0xb54c('0x30')][_0xb54c('0x35')](_0xb54c('0x36'))){_0x413551['limit']=qs[_0xb54c('0x1c')](_0x4e1ac6[_0xb54c('0x30')]['limit']);_0x413551[_0xb54c('0x1e')]=qs['offset'](_0x4e1ac6[_0xb54c('0x30')][_0xb54c('0x1e')]);}_0x413551[_0xb54c('0x37')]=qs[_0xb54c('0x38')](_0x4e1ac6[_0xb54c('0x30')][_0xb54c('0x38')]);_0x413551[_0xb54c('0x39')]=qs['filters'](_[_0xb54c('0x3a')](_0x4e1ac6[_0xb54c('0x30')],_0x45f4d2['filters']),_0xc436e2);if(_0x4e1ac6[_0xb54c('0x30')]['filter']){_0x413551[_0xb54c('0x39')]=_[_0xb54c('0x3b')](_0x413551['where'],{'$or':_[_0xb54c('0x2f')](_0xc436e2,function(_0xff5435){if(_0xff5435['type']!==_0xb54c('0x3c')){var _0x3ee10b={};_0x3ee10b[_0xff5435[_0xb54c('0x28')]]={'$like':'%'+_0x4e1ac6['query'][_0xb54c('0x3d')]+'%'};return _0x3ee10b;}})});}_0x413551=_['merge']({},_0x413551,_0x4e1ac6[_0xb54c('0x3e')]);var _0x276861={'where':_0x413551[_0xb54c('0x39')]};return db[_0xb54c('0x3f')][_0xb54c('0x1d')](_0x276861)['then'](function(_0x55a898){_0x2b7ee4[_0xb54c('0x1d')]=_0x55a898;if(_0x4e1ac6[_0xb54c('0x30')][_0xb54c('0x40')]){_0x413551[_0xb54c('0x41')]=[{'all':!![]}];}return db[_0xb54c('0x3f')]['findAll'](_0x413551);})[_0xb54c('0x24')](function(_0x5151f3){_0x2b7ee4[_0xb54c('0x42')]=_0x5151f3;return _0x2b7ee4;})[_0xb54c('0x24')](respondWithFilteredResult(_0x8ccf1d,_0x413551))['catch'](handleError(_0x8ccf1d,null));};exports['show']=function(_0x1ca483,_0x3e8650){var _0x551605={'raw':!![],'where':{'id':_0x1ca483[_0xb54c('0x43')]['id']}},_0x2b20ec={};_0x2b20ec['model']=_[_0xb54c('0x44')](db[_0xb54c('0x3f')][_0xb54c('0x2b')]);_0x2b20ec[_0xb54c('0x30')]=_[_0xb54c('0x44')](_0x1ca483['query']);_0x2b20ec[_0xb54c('0x31')]=_['intersection'](_0x2b20ec[_0xb54c('0x34')],_0x2b20ec[_0xb54c('0x30')]);_0x551605['attributes']=_[_0xb54c('0x32')](_0x2b20ec[_0xb54c('0x34')],qs[_0xb54c('0x45')](_0x1ca483[_0xb54c('0x30')][_0xb54c('0x45')]));_0x551605[_0xb54c('0x33')]=_0x551605['attributes']['length']?_0x551605[_0xb54c('0x33')]:_0x2b20ec[_0xb54c('0x34')];if(_0x1ca483[_0xb54c('0x30')][_0xb54c('0x40')]){_0x551605['include']=[{'all':!![]}];}_0x551605=_[_0xb54c('0x3b')]({},_0x551605,_0x1ca483[_0xb54c('0x3e')]);return db['VoiceDialReport'][_0xb54c('0x46')](_0x551605)[_0xb54c('0x24')](handleEntityNotFound(_0x3e8650,null))[_0xb54c('0x24')](respondWithResult(_0x3e8650,null))[_0xb54c('0x47')](handleError(_0x3e8650,null));};exports['create']=function(_0x33ac3d,_0x36621a){return db[_0xb54c('0x3f')][_0xb54c('0x48')](_0x33ac3d[_0xb54c('0x49')],{})['then'](respondWithResult(_0x36621a,0xc9))['catch'](handleError(_0x36621a,null));};exports['update']=function(_0x463065,_0x3f0384){if(_0x463065[_0xb54c('0x49')]['id']){delete _0x463065['body']['id'];}return db[_0xb54c('0x3f')]['find']({'where':{'id':_0x463065[_0xb54c('0x43')]['id']}})[_0xb54c('0x24')](handleEntityNotFound(_0x3f0384,null))[_0xb54c('0x24')](saveUpdates(_0x463065[_0xb54c('0x49')],null))[_0xb54c('0x24')](respondWithResult(_0x3f0384,null))[_0xb54c('0x47')](handleError(_0x3f0384,null));};exports['destroy']=function(_0x31be63,_0x3c5c16){return db[_0xb54c('0x3f')][_0xb54c('0x46')]({'where':{'id':_0x31be63[_0xb54c('0x43')]['id']}})[_0xb54c('0x24')](handleEntityNotFound(_0x3c5c16,null))[_0xb54c('0x24')](removeEntity(_0x3c5c16,null))[_0xb54c('0x47')](handleError(_0x3c5c16,null));};exports['describe']=function(_0x4a867f,_0xe06bf4){return db[_0xb54c('0x3f')][_0xb54c('0x4a')]()[_0xb54c('0x24')](respondWithResult(_0xe06bf4,null))['catch'](handleError(_0xe06bf4,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe421=['uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','VoiceDialReport','report_dial'];(function(_0x55c10e,_0x31af91){var _0x598bcc=function(_0xe48bdf){while(--_0xe48bdf){_0x55c10e['push'](_0x55c10e['shift']());}};_0x598bcc(++_0x31af91);}(_0xe421,0x18d));var _0x1e42=function(_0x35c70b,_0x3c80c7){_0x35c70b=_0x35c70b-0x0;var _0x17fa17=_0xe421[_0x35c70b];return _0x17fa17;};'use strict';var _=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var logger=require(_0x1e42('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1e42('0x3'));var rp=require(_0x1e42('0x4'));var fs=require('fs');var path=require(_0x1e42('0x5'));var rimraf=require('rimraf');var config=require(_0x1e42('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x1e42('0x7')]=function(_0x48f82f,_0x3788d8){return _0x48f82f['define'](_0x1e42('0x8'),attributes,{'tableName':_0x1e42('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1e42('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb646=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','report_dial'];(function(_0x1bceb3,_0x3c7b1c){var _0x6d6e38=function(_0x19d23a){while(--_0x19d23a){_0x1bceb3['push'](_0x1bceb3['shift']());}};_0x6d6e38(++_0x3c7b1c);}(_0xb646,0x83));var _0x6b64=function(_0x3baf61,_0x187408){_0x3baf61=_0x3baf61-0x0;var _0x515476=_0xb646[_0x3baf61];return _0x515476;};'use strict';var _=require(_0x6b64('0x0'));var util=require(_0x6b64('0x1'));var logger=require(_0x6b64('0x2'))(_0x6b64('0x3'));var moment=require(_0x6b64('0x4'));var BPromise=require(_0x6b64('0x5'));var rp=require(_0x6b64('0x6'));var fs=require('fs');var path=require(_0x6b64('0x7'));var rimraf=require('rimraf');var config=require(_0x6b64('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x6b64('0x9')]=function(_0x225141,_0x57e27c){return _0x225141[_0x6b64('0xa')]('VoiceDialReport',attributes,{'tableName':_0x6b64('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6b64('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe937=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','stringify','error','code','message','info','VoiceDialReport,\x20%s,\x20%s','result','CreateVoiceDialReport','create','options','UpdateVoiceDialReport','VoiceDialReport','update','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x21e3d5,_0x443510){var _0x37fff5=function(_0x177dbc){while(--_0x177dbc){_0x21e3d5['push'](_0x21e3d5['shift']());}};_0x37fff5(++_0x443510);}(_0xe937,0xbf));var _0x7e93=function(_0x2ceafe,_0x4914a1){_0x2ceafe=_0x2ceafe-0x0;var _0x271c8e=_0xe937[_0x2ceafe];return _0x271c8e;};'use strict';var _=require(_0x7e93('0x0'));var util=require(_0x7e93('0x1'));var moment=require(_0x7e93('0x2'));var BPromise=require(_0x7e93('0x3'));var rs=require(_0x7e93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e93('0x5'))['db'];var utils=require(_0x7e93('0x6'));var logger=require(_0x7e93('0x7'))(_0x7e93('0x8'));var config=require(_0x7e93('0x9'));var jayson=require(_0x7e93('0xa'));var client=jayson['client'][_0x7e93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ecee6,_0x3cc94d,_0x1ff3e9){return new BPromise(function(_0x10ac69,_0x5645c0){return client['request'](_0x4ecee6,_0x1ff3e9)[_0x7e93('0xc')](function(_0x4f6af5){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3cc94d,_0x7e93('0xd'));logger[_0x7e93('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3cc94d,_0x7e93('0xd'),JSON[_0x7e93('0xf')](_0x4f6af5));if(_0x4f6af5[_0x7e93('0x10')]){if(_0x4f6af5[_0x7e93('0x10')][_0x7e93('0x11')]===0x1f4){logger[_0x7e93('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3cc94d,_0x4f6af5['error']['message']);return _0x5645c0(_0x4f6af5['error']['message']);}logger[_0x7e93('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3cc94d,_0x4f6af5['error'][_0x7e93('0x12')]);return _0x10ac69(_0x4f6af5[_0x7e93('0x10')][_0x7e93('0x12')]);}else{logger[_0x7e93('0x13')](_0x7e93('0x14'),_0x3cc94d,_0x7e93('0xd'));_0x10ac69(_0x4f6af5[_0x7e93('0x15')][_0x7e93('0x12')]);}})['catch'](function(_0x2f8394){logger[_0x7e93('0x10')](_0x7e93('0x14'),_0x3cc94d,_0x2f8394);_0x5645c0(_0x2f8394);});});}exports[_0x7e93('0x16')]=function(_0x421536){var _0x380c85=this;return new Promise(function(_0x113ea0,_0x54085b){return db['VoiceDialReport'][_0x7e93('0x17')](_0x421536['body'],{'raw':_0x421536[_0x7e93('0x18')]?_0x421536['options']['raw']===undefined?!![]:![]:!![]})[_0x7e93('0xc')](function(_0x5216b0){logger[_0x7e93('0x13')]('CreateVoiceDialReport',_0x421536);logger[_0x7e93('0xe')](_0x7e93('0x16'),_0x421536,JSON[_0x7e93('0xf')](_0x5216b0));_0x113ea0(_0x5216b0);})['catch'](function(_0x45ba1f){logger[_0x7e93('0x10')]('CreateVoiceDialReport',_0x45ba1f[_0x7e93('0x12')],_0x421536);_0x54085b(_0x380c85[_0x7e93('0x10')](0x1f4,_0x45ba1f[_0x7e93('0x12')]));});});};exports[_0x7e93('0x19')]=function(_0x5d434b){var _0x1ba465=this;return new Promise(function(_0x5e6f2f,_0x36cadb){return db[_0x7e93('0x1a')][_0x7e93('0x1b')](_0x5d434b['body'],{'raw':_0x5d434b[_0x7e93('0x18')]?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d434b[_0x7e93('0x18')]?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1d')]||null:null,'attributes':_0x5d434b['options']?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1e')]||null:null,'limit':_0x5d434b[_0x7e93('0x18')]?_0x5d434b[_0x7e93('0x18')][_0x7e93('0x1f')]||null:null})['then'](function(_0x206700){logger[_0x7e93('0x13')]('UpdateVoiceDialReport',_0x5d434b);logger['debug']('UpdateVoiceDialReport',_0x5d434b,JSON[_0x7e93('0xf')](_0x206700));_0x5e6f2f(_0x206700);})[_0x7e93('0x20')](function(_0x36687a){logger['error']('UpdateVoiceDialReport',_0x36687a[_0x7e93('0x12')],_0x5d434b);_0x36cadb(_0x1ba465[_0x7e93('0x10')](0x1f4,_0x36687a['message']));});});};
\ No newline at end of file
+var _0x73f6=['client','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','update','where','limit','UpdateVoiceDialReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73f6,0x7d));var _0x673f=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x73f6[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x673f('0x0'));var util=require('util');var moment=require(_0x673f('0x1'));var BPromise=require(_0x673f('0x2'));var rs=require(_0x673f('0x3'));var fs=require('fs');var Redis=require(_0x673f('0x4'));var db=require(_0x673f('0x5'))['db'];var utils=require(_0x673f('0x6'));var logger=require(_0x673f('0x7'))(_0x673f('0x8'));var config=require(_0x673f('0x9'));var jayson=require(_0x673f('0xa'));var client=jayson[_0x673f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28ba79,_0xeb5ac8,_0x45d4ff){return new BPromise(function(_0x3e003b,_0x467c92){return client['request'](_0x28ba79,_0x45d4ff)[_0x673f('0xc')](function(_0x5c9c2f){logger['info'](_0x673f('0xd'),_0xeb5ac8,_0x673f('0xe'));logger[_0x673f('0xf')](_0x673f('0x10'),_0xeb5ac8,_0x673f('0xe'),JSON[_0x673f('0x11')](_0x5c9c2f));if(_0x5c9c2f['error']){if(_0x5c9c2f[_0x673f('0x12')][_0x673f('0x13')]===0x1f4){logger[_0x673f('0x12')](_0x673f('0xd'),_0xeb5ac8,_0x5c9c2f[_0x673f('0x12')][_0x673f('0x14')]);return _0x467c92(_0x5c9c2f[_0x673f('0x12')][_0x673f('0x14')]);}logger[_0x673f('0x12')](_0x673f('0xd'),_0xeb5ac8,_0x5c9c2f['error'][_0x673f('0x14')]);return _0x3e003b(_0x5c9c2f[_0x673f('0x12')]['message']);}else{logger[_0x673f('0x15')](_0x673f('0xd'),_0xeb5ac8,_0x673f('0xe'));_0x3e003b(_0x5c9c2f[_0x673f('0x16')][_0x673f('0x14')]);}})['catch'](function(_0x218e82){logger[_0x673f('0x12')](_0x673f('0xd'),_0xeb5ac8,_0x218e82);_0x467c92(_0x218e82);});});}exports[_0x673f('0x17')]=function(_0x519058){var _0x2c7aeb=this;return new Promise(function(_0x1b62b2,_0x41e56d){return db[_0x673f('0x18')][_0x673f('0x19')](_0x519058[_0x673f('0x1a')],{'raw':_0x519058[_0x673f('0x1b')]?_0x519058[_0x673f('0x1b')][_0x673f('0x1c')]===undefined?!![]:![]:!![]})[_0x673f('0xc')](function(_0xf7417d){logger['info'](_0x673f('0x17'),_0x519058);logger[_0x673f('0xf')]('CreateVoiceDialReport',_0x519058,JSON['stringify'](_0xf7417d));_0x1b62b2(_0xf7417d);})[_0x673f('0x1d')](function(_0x236679){logger[_0x673f('0x12')](_0x673f('0x17'),_0x236679[_0x673f('0x14')],_0x519058);_0x41e56d(_0x2c7aeb[_0x673f('0x12')](0x1f4,_0x236679[_0x673f('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x8519d2){var _0x554b1f=this;return new Promise(function(_0x5701be,_0x11fb21){return db['VoiceDialReport'][_0x673f('0x1e')](_0x8519d2['body'],{'raw':_0x8519d2[_0x673f('0x1b')]?_0x8519d2['options'][_0x673f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8519d2[_0x673f('0x1b')]?_0x8519d2[_0x673f('0x1b')][_0x673f('0x1f')]||null:null,'attributes':_0x8519d2['options']?_0x8519d2[_0x673f('0x1b')]['attributes']||null:null,'limit':_0x8519d2['options']?_0x8519d2[_0x673f('0x1b')][_0x673f('0x20')]||null:null})[_0x673f('0xc')](function(_0x3954a5){logger[_0x673f('0x15')](_0x673f('0x21'),_0x8519d2);logger[_0x673f('0xf')](_0x673f('0x21'),_0x8519d2,JSON[_0x673f('0x11')](_0x3954a5));_0x5701be(_0x3954a5);})[_0x673f('0x1d')](function(_0x1f76ab){logger[_0x673f('0x12')](_0x673f('0x21'),_0x1f76ab['message'],_0x8519d2);_0x11fb21(_0x554b1f[_0x673f('0x12')](0x1f4,_0x1f76ab[_0x673f('0x14')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7675=['multer','connect-timeout','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','post','create','/:id/applications','addApplications','put','delete','destroy','exports'];(function(_0x4b23fb,_0x4a3527){var _0x11f8e9=function(_0x32da42){while(--_0x32da42){_0x4b23fb['push'](_0x4b23fb['shift']());}};_0x11f8e9(++_0x4a3527);}(_0x7675,0x143));var _0x5767=function(_0x1a9812,_0x140bbe){_0x1a9812=_0x1a9812-0x0;var _0x5a87c8=_0x7675[_0x1a9812];return _0x5a87c8;};'use strict';var multer=require(_0x5767('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5767('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5767('0x2'));var config=require(_0x5767('0x3'));var controller=require(_0x5767('0x4'));router[_0x5767('0x5')]('/',auth['isAuthenticated'](),controller[_0x5767('0x6')]);router[_0x5767('0x5')](_0x5767('0x7'),auth[_0x5767('0x8')](),controller['show']);router[_0x5767('0x9')]('/',auth[_0x5767('0x8')](),controller[_0x5767('0xa')]);router['post'](_0x5767('0xb'),auth[_0x5767('0x8')](),controller[_0x5767('0xc')]);router[_0x5767('0xd')](_0x5767('0x7'),auth[_0x5767('0x8')](),controller['update']);router[_0x5767('0xe')](_0x5767('0x7'),auth['isAuthenticated'](),controller[_0x5767('0xf')]);module[_0x5767('0x10')]=router;
\ No newline at end of file
+var _0xbe10=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','update','delete','destroy','exports','connect-timeout'];(function(_0x50c9a9,_0x1a4c43){var _0x352abc=function(_0x4b250a){while(--_0x4b250a){_0x50c9a9['push'](_0x50c9a9['shift']());}};_0x352abc(++_0x1a4c43);}(_0xbe10,0x97));var _0x0be1=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xbe10[_0x4e676e];return _0x336a3c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0be1('0x0'));var express=require(_0x0be1('0x1'));var router=express[_0x0be1('0x2')]();var fs_extra=require(_0x0be1('0x3'));var auth=require(_0x0be1('0x4'));var interaction=require(_0x0be1('0x5'));var config=require(_0x0be1('0x6'));var controller=require('./voiceExtension.controller');router[_0x0be1('0x7')]('/',auth[_0x0be1('0x8')](),controller[_0x0be1('0x9')]);router[_0x0be1('0x7')](_0x0be1('0xa'),auth[_0x0be1('0x8')](),controller[_0x0be1('0xb')]);router[_0x0be1('0xc')]('/',auth[_0x0be1('0x8')](),controller['create']);router['post'](_0x0be1('0xd'),auth[_0x0be1('0x8')](),controller[_0x0be1('0xe')]);router['put']('/:id',auth[_0x0be1('0x8')](),controller[_0x0be1('0xf')]);router[_0x0be1('0x10')](_0x0be1('0xa'),auth[_0x0be1('0x8')](),controller[_0x0be1('0x11')]);module[_0x0be1('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7133=['getDataValue','exten','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','BOOLEAN','INTEGER','wav'];(function(_0x53d088,_0x2d219a){var _0x22675c=function(_0x217b51){while(--_0x217b51){_0x53d088['push'](_0x53d088['shift']());}};_0x22675c(++_0x2d219a);}(_0x7133,0x16a));var _0x3713=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7133[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'defaultValue':'1','unique':_0x3713('0x1')},'tag':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3713('0x2')},'appdata':{'type':Sequelize[_0x3713('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x3713('0x3'),_0x3713('0x4'),_0x3713('0x5'),_0x3713('0x6'),_0x3713('0x7'),'system',_0x3713('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x3713('0x0')]},'interval':{'type':Sequelize[_0x3713('0x0')],'allowNull':![],'defaultValue':_0x3713('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x3713('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3713('0x0')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3713('0xb')]},'recordingFormat':{'type':Sequelize[_0x3713('0x0')],'defaultValue':_0x3713('0xc')},'answer':{'type':Sequelize[_0x3713('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c5ea1){return this[_0x3713('0xd')](_0x3713('0xe'));}},'alias':{'type':Sequelize[_0x3713('0x0')],'allowNull':!![]}};
\ No newline at end of file
+var _0xac0c=['inbound-fax','system','any','*,*,*,*','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xac0c,0xf7));var _0xcac0=function(_0x8f0df1,_0x2ba68f){_0x8f0df1=_0x8f0df1-0x0;var _0x2929a8=_0xac0c[_0x8f0df1];return _0x2929a8;};'use strict';var Sequelize=require(_0xcac0('0x0'));module['exports']={'context':{'type':Sequelize[_0xcac0('0x1')],'allowNull':![],'unique':_0xcac0('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcac0('0x2')},'priority':{'type':Sequelize[_0xcac0('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xcac0('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xcac0('0x1')],'allowNull':![],'defaultValue':_0xcac0('0x3')},'appdata':{'type':Sequelize[_0xcac0('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xcac0('0x4')](_0xcac0('0x5'),_0xcac0('0x6'),_0xcac0('0x7'),_0xcac0('0x8'),'outbound-fax',_0xcac0('0x9'),_0xcac0('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xcac0('0x1')]},'interval':{'type':Sequelize[_0xcac0('0x1')],'allowNull':![],'defaultValue':_0xcac0('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xcac0('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xcac0('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xcac0('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xcac0('0xd')},'answer':{'type':Sequelize[_0xcac0('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xcac0('0xe')],'get':function(_0x9c7bbf){return this[_0xcac0('0xf')](_0xcac0('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf392=['keys','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','then','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf392,0xdc));var _0x2f39=function(_0x41f67b,_0x55ea60){_0x41f67b=_0x41f67b-0x0;var _0x48f8a7=_0xf392[_0x41f67b];return _0x48f8a7;};'use strict';var _=require(_0x2f39('0x0'));var Redis=require(_0x2f39('0x1'));var qs=require(_0x2f39('0x2'));var logger=require(_0x2f39('0x3'))(_0x2f39('0x4'));var config=require(_0x2f39('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2f39('0x6')](config[_0x2f39('0x7')],{'host':_0x2f39('0x8'),'port':0x18eb});var socket=require(_0x2f39('0x9'))(new Redis(config[_0x2f39('0x7')]));require(_0x2f39('0xa'))[_0x2f39('0xb')](socket);function respondWithStatusCode(_0xcd865a,_0x2bb66b){_0x2bb66b=_0x2bb66b||0xcc;return function(_0x311e99){if(_0x311e99){return _0xcd865a[_0x2f39('0xc')](_0x2bb66b);}return _0xcd865a[_0x2f39('0xd')](_0x2bb66b)[_0x2f39('0xe')]();};}function respondWithResult(_0x5b6459,_0x41d51a){_0x41d51a=_0x41d51a||0xc8;return function(_0x47aa1e){if(_0x47aa1e){return _0x5b6459[_0x2f39('0xd')](_0x41d51a)[_0x2f39('0xf')](_0x47aa1e);}};}function respondWithFilteredResult(_0x53dbe3,_0x233404){return function(_0x584a25){if(_0x584a25){var _0xf82811=typeof _0x233404[_0x2f39('0x10')]===_0x2f39('0x11')&&typeof _0x233404[_0x2f39('0x12')]===_0x2f39('0x11');var _0x46116b=_0x584a25['count'];var _0x4a62ff=_0xf82811?0x0:_0x233404[_0x2f39('0x10')];var _0x3c187b=_0xf82811?_0x584a25['count']:_0x233404['offset']+_0x233404[_0x2f39('0x12')];var _0x31645c;if(_0x3c187b>=_0x46116b){_0x3c187b=_0x46116b;_0x31645c=0xc8;}else{_0x31645c=0xce;}_0x53dbe3['status'](_0x31645c);return _0x53dbe3[_0x2f39('0x13')](_0x2f39('0x14'),_0x4a62ff+'-'+_0x3c187b+'/'+_0x46116b)[_0x2f39('0xf')](_0x584a25);}return null;};}function removeEntity(_0x5a5a8d){return function(_0x44ba67){if(_0x44ba67){return _0x44ba67['destroy']()['then'](function(){var _0x12ed66=_0x44ba67[_0x2f39('0x15')]({'plain':!![]});var _0x26b5e6=[{'name':_0x2f39('0x16'),'value':_0x2f39('0x17'),'ignore':![]},{'name':_0x2f39('0x18'),'value':_0x2f39('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0x2f39('0x1a'),'ignore':![]}];var _0x550d6f=_(_0x26b5e6)[_0x2f39('0x1b')](_0x2f39('0x1c'))[_0x2f39('0x1d')]('value')[_0x2f39('0x1e')]();if(_[_0x2f39('0x1f')](_0x550d6f,_0x12ed66[_0x2f39('0x20')])){return;}var _0x575394=_[_0x2f39('0x21')](_0x26b5e6,[_0x2f39('0x1e'),_0x12ed66['type']])[_0x2f39('0x22')];return db[_0x2f39('0x23')][_0x2f39('0x24')]({'where':{'type':_0x575394,'resourceId':_0x12ed66['id']}})[_0x2f39('0x25')](function(){return _0x44ba67;});})['then'](function(){_0x5a5a8d[_0x2f39('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16caef){return function(_0x54221d){if(!_0x54221d){_0x16caef[_0x2f39('0xc')](0x194);}return _0x54221d;};}function handleError(_0x553032,_0x34694f){_0x34694f=_0x34694f||0x1f4;return function(_0x1b95aa){logger[_0x2f39('0x26')](_0x1b95aa[_0x2f39('0x27')]);if(_0x1b95aa[_0x2f39('0x22')]){delete _0x1b95aa[_0x2f39('0x22')];}_0x553032[_0x2f39('0xd')](_0x34694f)['send'](_0x1b95aa);};}exports[_0x2f39('0x28')]=function(_0x4bbf91,_0x135afb){var _0x3ab92c={},_0x22cfa4={},_0x20be28={'count':0x0,'rows':[]};var _0x509106=_[_0x2f39('0x1d')](db[_0x2f39('0x29')][_0x2f39('0x2a')],function(_0x57b962){return{'name':_0x57b962[_0x2f39('0x2b')],'type':_0x57b962[_0x2f39('0x20')][_0x2f39('0x2c')]};});_0x22cfa4['model']=_[_0x2f39('0x1d')](_0x509106,'name');_0x22cfa4['query']=_['keys'](_0x4bbf91[_0x2f39('0x2d')]);_0x22cfa4[_0x2f39('0x2e')]=_[_0x2f39('0x2f')](_0x22cfa4['model'],_0x22cfa4['query']);_0x3ab92c[_0x2f39('0x30')]=_[_0x2f39('0x2f')](_0x22cfa4[_0x2f39('0x31')],qs[_0x2f39('0x32')](_0x4bbf91['query'][_0x2f39('0x32')]));_0x3ab92c[_0x2f39('0x30')]=_0x3ab92c[_0x2f39('0x30')][_0x2f39('0x33')]?_0x3ab92c[_0x2f39('0x30')]:_0x22cfa4[_0x2f39('0x31')];if(!_0x4bbf91[_0x2f39('0x2d')]['hasOwnProperty']('nolimit')){_0x3ab92c['limit']=qs['limit'](_0x4bbf91[_0x2f39('0x2d')][_0x2f39('0x12')]);_0x3ab92c[_0x2f39('0x10')]=qs[_0x2f39('0x10')](_0x4bbf91['query']['offset']);}_0x3ab92c['order']=qs['sort'](_0x4bbf91[_0x2f39('0x2d')][_0x2f39('0x34')]);_0x3ab92c[_0x2f39('0x35')]=qs[_0x2f39('0x2e')](_[_0x2f39('0x36')](_0x4bbf91[_0x2f39('0x2d')],_0x22cfa4['filters']),_0x509106);if(_0x4bbf91[_0x2f39('0x2d')]['filter']){_0x3ab92c['where']=_['merge'](_0x3ab92c[_0x2f39('0x35')],{'$or':_[_0x2f39('0x1d')](_0x509106,function(_0x525884){if(_0x525884[_0x2f39('0x20')]!==_0x2f39('0x37')){var _0x575fad={};_0x575fad[_0x525884[_0x2f39('0x22')]]={'$like':'%'+_0x4bbf91[_0x2f39('0x2d')]['filter']+'%'};return _0x575fad;}})});}_0x3ab92c=_[_0x2f39('0x38')]({},_0x3ab92c,_0x4bbf91[_0x2f39('0x39')]);var _0x2c843c={'where':_0x3ab92c['where']};return db[_0x2f39('0x29')][_0x2f39('0x3a')](_0x2c843c)[_0x2f39('0x25')](function(_0x23def2){_0x20be28['count']=_0x23def2;if(_0x4bbf91[_0x2f39('0x2d')][_0x2f39('0x3b')]){_0x3ab92c[_0x2f39('0x3c')]=[{'all':!![]}];}return db[_0x2f39('0x29')]['findAll'](_0x3ab92c);})['then'](function(_0x7693bd){_0x20be28[_0x2f39('0x3d')]=_0x7693bd;return _0x20be28;})[_0x2f39('0x25')](respondWithFilteredResult(_0x135afb,_0x3ab92c))[_0x2f39('0x3e')](handleError(_0x135afb,null));};exports[_0x2f39('0x3f')]=function(_0x126121,_0x493ce9){var _0x934da3={'raw':![],'where':{'id':_0x126121[_0x2f39('0x40')]['id']}},_0x5c3195={};_0x5c3195[_0x2f39('0x31')]=_[_0x2f39('0x41')](db['VoiceExtension'][_0x2f39('0x2a')]);_0x5c3195['query']=_[_0x2f39('0x41')](_0x126121['query']);_0x5c3195[_0x2f39('0x2e')]=_['intersection'](_0x5c3195[_0x2f39('0x31')],_0x5c3195[_0x2f39('0x2d')]);_0x934da3[_0x2f39('0x30')]=_['intersection'](_0x5c3195['model'],qs[_0x2f39('0x32')](_0x126121[_0x2f39('0x2d')]['fields']));_0x934da3['attributes']=_0x934da3[_0x2f39('0x30')][_0x2f39('0x33')]?_0x934da3[_0x2f39('0x30')]:_0x5c3195[_0x2f39('0x31')];if(_0x126121[_0x2f39('0x2d')][_0x2f39('0x3b')]){_0x934da3[_0x2f39('0x3c')]=[{'all':!![]}];}_0x934da3=_['merge']({},_0x934da3,_0x126121[_0x2f39('0x39')]);return db[_0x2f39('0x29')]['find'](_0x934da3)['then'](handleEntityNotFound(_0x493ce9,null))[_0x2f39('0x25')](respondWithResult(_0x493ce9,null))[_0x2f39('0x3e')](handleError(_0x493ce9,null));};exports['destroy']=function(_0x2e475e,_0x3da8c0){return db[_0x2f39('0x29')][_0x2f39('0x21')]({'where':{'id':_0x2e475e[_0x2f39('0x40')]['id']}})[_0x2f39('0x25')](handleEntityNotFound(_0x3da8c0,null))['then'](removeEntity(_0x3da8c0,null))[_0x2f39('0x3e')](handleError(_0x3da8c0,null));};exports[_0x2f39('0x42')]=function(_0x2e4ef2,_0x3dee15){if(_0x2e4ef2['body'][_0x2f39('0x20')]===_0x2f39('0x19')&&!_['startsWith'](_0x2e4ef2[_0x2f39('0x43')][_0x2f39('0x44')],'_')){_0x2e4ef2[_0x2f39('0x43')]['exten']='_'[_0x2f39('0x45')](_0x2e4ef2[_0x2f39('0x43')][_0x2f39('0x44')]);}return db['VoiceExtension'][_0x2f39('0x42')](_0x2e4ef2[_0x2f39('0x43')],{'raw':![]})['then'](function(_0x38de7d){var _0x386861=_0x2e4ef2['user']['get']({'plain':!![]});if(!_0x386861)throw new Error(_0x2f39('0x46'));if(_0x386861[_0x2f39('0x47')]==='user'){var _0x59f127=_0x38de7d[_0x2f39('0x15')]({'plain':!![]});var _0x478c5b=[{'name':_0x2f39('0x16'),'value':_0x2f39('0x17')},{'name':_0x2f39('0x18'),'value':_0x2f39('0x19')},{'name':_0x2f39('0x48'),'value':'internal'}];var _0x1693e5=_['find'](_0x478c5b,[_0x2f39('0x1e'),_0x59f127[_0x2f39('0x20')]])[_0x2f39('0x22')];return db['UserProfileSection'][_0x2f39('0x21')]({'where':{'name':_0x1693e5,'userProfileId':_0x386861[_0x2f39('0x49')]},'raw':!![]})[_0x2f39('0x25')](function(_0x119790){if(_0x119790&&_0x119790[_0x2f39('0x4a')]===0x0){return db[_0x2f39('0x23')][_0x2f39('0x42')]({'name':_0x59f127['name'],'resourceId':_0x59f127['id'],'type':_0x119790[_0x2f39('0x22')],'sectionId':_0x119790['id']},{})[_0x2f39('0x25')](function(){return _0x38de7d;});}else{return _0x38de7d;}})[_0x2f39('0x3e')](function(_0x3191b6){logger['error'](_0x2f39('0x4b'),_0x3191b6);throw _0x3191b6;});}return _0x38de7d;})['then'](respondWithResult(_0x3dee15,0xc9))[_0x2f39('0x3e')](handleError(_0x3dee15,null));};exports[_0x2f39('0x4c')]=function(_0x214c40,_0x191d91){if(_0x214c40['body']['id']){delete _0x214c40[_0x2f39('0x43')]['id'];}return db[_0x2f39('0x29')][_0x2f39('0x21')]({'where':{'id':_0x214c40[_0x2f39('0x40')]['id']}})[_0x2f39('0x25')](handleEntityNotFound(_0x191d91,null))['then'](function(_0x13f68e){if(_0x13f68e){return db[_0x2f39('0x29')][_0x2f39('0x4c')](_['pick'](_0x214c40[_0x2f39('0x43')],[_0x2f39('0x44'),_0x2f39('0x4d'),_0x2f39('0x4e'),_0x2f39('0x4f'),_0x2f39('0x50'),_0x2f39('0x51'),_0x2f39('0x52')]),{'where':{'context':_0x13f68e[_0x2f39('0x4d')],'exten':_0x13f68e[_0x2f39('0x44')]},'individualHooks':!![]})[_0x2f39('0x25')](function(_0x45fd8a){return _0x45fd8a;});}return null;})[_0x2f39('0x25')](respondWithStatusCode(_0x191d91,null))['catch'](handleError(_0x191d91,null));};exports['addApplications']=function(_0x2ad3c3,_0x487386){var _0x565616=_0x2ad3c3[_0x2f39('0x40')]['id'];var _0x40088a=_0x2ad3c3['body'];var _0x2be6a7=0xc8;var _0x1bdbdf=null;return db['sequelize'][_0x2f39('0x53')]({'isolationLevel':db[_0x2f39('0x54')]['Transaction'][_0x2f39('0x55')][_0x2f39('0x56')]},function(_0x49c3b9){return db[_0x2f39('0x29')][_0x2f39('0x57')]({'where':{'id':_0x565616},'transaction':_0x49c3b9})[_0x2f39('0x25')](function(_0x3136cb){if(_0x3136cb){return db[_0x2f39('0x29')][_0x2f39('0x24')]({'where':{'VoiceExtensionId':_0x565616},'transaction':_0x49c3b9})['then'](function(){var _0x2f5a96=_[_0x2f39('0x1d')](_0x40088a,function(_0x47a16d){_0x47a16d[_0x2f39('0x58')]=_0x565616;_0x47a16d[_0x2f39('0x59')]=!![];return _0x47a16d;});return _0x3136cb['createRouting'](_0x2f5a96);})[_0x2f39('0x25')](function(_0x45d7c2){return db[_0x2f39('0x29')][_0x2f39('0x5a')](_0x45d7c2,{'transaction':_0x49c3b9});});}else{_0x2be6a7=0x194;_0x1bdbdf=[];}});})[_0x2f39('0x25')](function(){if(_0x2be6a7!==0x194){return db[_0x2f39('0x29')][_0x2f39('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x565616},'order':_0x2f39('0x5c')})[_0x2f39('0x25')](function(_0x4e5685){_0x1bdbdf=_0x4e5685;});}})['catch'](function(_0x5c2ace){_0x2be6a7=0x1f4;logger[_0x2f39('0x26')](_0x5c2ace[_0x2f39('0x27')]);if(_0x5c2ace['name']){delete _0x5c2ace[_0x2f39('0x22')];}_0x1bdbdf=_0x5c2ace;})[_0x2f39('0x5d')](function(){if(_0x1bdbdf===null){_0x487386[_0x2f39('0xc')](_0x2be6a7);}else{if(_0x2be6a7===0x1f4){_0x487386[_0x2f39('0xd')](_0x2be6a7)[_0x2f39('0x5e')](_0x1bdbdf);}else{_0x487386['status'](_0x2be6a7)[_0x2f39('0xf')](_0x1bdbdf);}}});};
\ No newline at end of file
+var _0xfd3e=['params','create','body','startsWith','exten','concat','user','role','InternalRoutes','UserProfileSection','userProfileId','update','description','recordingFormat','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','api','../../config/environment','redis','localhost','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','type','find','name','UserProfileResource','end','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd3e,0x185));var _0xefd3=function(_0x310144,_0xe80e24){_0x310144=_0x310144-0x0;var _0x1b45ec=_0xfd3e[_0x310144];return _0x1b45ec;};'use strict';var _=require('lodash');var Redis=require(_0xefd3('0x0'));var qs=require(_0xefd3('0x1'));var logger=require('../../config/logger')(_0xefd3('0x2'));var config=require(_0xefd3('0x3'));var db=require('../../mysqldb')['db'];config[_0xefd3('0x4')]=_['defaults'](config[_0xefd3('0x4')],{'host':_0xefd3('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xefd3('0x4')]));require(_0xefd3('0x6'))[_0xefd3('0x7')](socket);function respondWithStatusCode(_0x503ade,_0x3f91d9){_0x3f91d9=_0x3f91d9||0xcc;return function(_0x11c1e){if(_0x11c1e){return _0x503ade[_0xefd3('0x8')](_0x3f91d9);}return _0x503ade[_0xefd3('0x9')](_0x3f91d9)['end']();};}function respondWithResult(_0x595527,_0x5c947e){_0x5c947e=_0x5c947e||0xc8;return function(_0x419e46){if(_0x419e46){return _0x595527[_0xefd3('0x9')](_0x5c947e)[_0xefd3('0xa')](_0x419e46);}};}function respondWithFilteredResult(_0x16b574,_0x7df790){return function(_0x40e433){if(_0x40e433){var _0x5861ca=typeof _0x7df790[_0xefd3('0xb')]===_0xefd3('0xc')&&typeof _0x7df790[_0xefd3('0xd')]===_0xefd3('0xc');var _0x211695=_0x40e433[_0xefd3('0xe')];var _0x4b58f9=_0x5861ca?0x0:_0x7df790[_0xefd3('0xb')];var _0x38a8aa=_0x5861ca?_0x40e433[_0xefd3('0xe')]:_0x7df790[_0xefd3('0xb')]+_0x7df790[_0xefd3('0xd')];var _0x4535ec;if(_0x38a8aa>=_0x211695){_0x38a8aa=_0x211695;_0x4535ec=0xc8;}else{_0x4535ec=0xce;}_0x16b574['status'](_0x4535ec);return _0x16b574[_0xefd3('0xf')](_0xefd3('0x10'),_0x4b58f9+'-'+_0x38a8aa+'/'+_0x211695)['json'](_0x40e433);}return null;};}function removeEntity(_0x55e06b){return function(_0x142081){if(_0x142081){return _0x142081[_0xefd3('0x11')]()[_0xefd3('0x12')](function(){var _0x4f37c5=_0x142081[_0xefd3('0x13')]({'plain':!![]});var _0x1ef819=[{'name':_0xefd3('0x14'),'value':_0xefd3('0x15'),'ignore':![]},{'name':_0xefd3('0x16'),'value':_0xefd3('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0xefd3('0x18'),'ignore':![]}];var _0x1ebc9b=_(_0x1ef819)[_0xefd3('0x19')](_0xefd3('0x1a'))[_0xefd3('0x1b')](_0xefd3('0x1c'))[_0xefd3('0x1c')]();if(_['includes'](_0x1ebc9b,_0x4f37c5[_0xefd3('0x1d')])){return;}var _0xd57b3c=_[_0xefd3('0x1e')](_0x1ef819,[_0xefd3('0x1c'),_0x4f37c5[_0xefd3('0x1d')]])[_0xefd3('0x1f')];return db[_0xefd3('0x20')][_0xefd3('0x11')]({'where':{'type':_0xd57b3c,'resourceId':_0x4f37c5['id']}})['then'](function(){return _0x142081;});})[_0xefd3('0x12')](function(){_0x55e06b[_0xefd3('0x9')](0xcc)[_0xefd3('0x21')]();});}};}function handleEntityNotFound(_0x4ed34b){return function(_0x256f36){if(!_0x256f36){_0x4ed34b[_0xefd3('0x8')](0x194);}return _0x256f36;};}function handleError(_0x1f19f2,_0x2137d9){_0x2137d9=_0x2137d9||0x1f4;return function(_0x532b3a){logger[_0xefd3('0x22')](_0x532b3a[_0xefd3('0x23')]);if(_0x532b3a[_0xefd3('0x1f')]){delete _0x532b3a['name'];}_0x1f19f2[_0xefd3('0x9')](_0x2137d9)['send'](_0x532b3a);};}exports[_0xefd3('0x24')]=function(_0x2f248b,_0x554ac4){var _0x370d87={},_0x2d3da5={},_0x3cd74e={'count':0x0,'rows':[]};var _0x5e0648=_[_0xefd3('0x1b')](db[_0xefd3('0x25')][_0xefd3('0x26')],function(_0x3b81ed){return{'name':_0x3b81ed[_0xefd3('0x27')],'type':_0x3b81ed['type'][_0xefd3('0x28')]};});_0x2d3da5[_0xefd3('0x29')]=_[_0xefd3('0x1b')](_0x5e0648,'name');_0x2d3da5[_0xefd3('0x2a')]=_[_0xefd3('0x2b')](_0x2f248b[_0xefd3('0x2a')]);_0x2d3da5[_0xefd3('0x2c')]=_[_0xefd3('0x2d')](_0x2d3da5[_0xefd3('0x29')],_0x2d3da5[_0xefd3('0x2a')]);_0x370d87[_0xefd3('0x2e')]=_['intersection'](_0x2d3da5[_0xefd3('0x29')],qs[_0xefd3('0x2f')](_0x2f248b[_0xefd3('0x2a')][_0xefd3('0x2f')]));_0x370d87[_0xefd3('0x2e')]=_0x370d87[_0xefd3('0x2e')][_0xefd3('0x30')]?_0x370d87['attributes']:_0x2d3da5[_0xefd3('0x29')];if(!_0x2f248b['query']['hasOwnProperty'](_0xefd3('0x31'))){_0x370d87[_0xefd3('0xd')]=qs[_0xefd3('0xd')](_0x2f248b[_0xefd3('0x2a')][_0xefd3('0xd')]);_0x370d87[_0xefd3('0xb')]=qs[_0xefd3('0xb')](_0x2f248b['query']['offset']);}_0x370d87['order']=qs['sort'](_0x2f248b[_0xefd3('0x2a')][_0xefd3('0x32')]);_0x370d87[_0xefd3('0x33')]=qs[_0xefd3('0x2c')](_[_0xefd3('0x34')](_0x2f248b[_0xefd3('0x2a')],_0x2d3da5[_0xefd3('0x2c')]),_0x5e0648);if(_0x2f248b[_0xefd3('0x2a')]['filter']){_0x370d87[_0xefd3('0x33')]=_[_0xefd3('0x35')](_0x370d87[_0xefd3('0x33')],{'$or':_[_0xefd3('0x1b')](_0x5e0648,function(_0x4fa246){if(_0x4fa246[_0xefd3('0x1d')]!=='VIRTUAL'){var _0x35201f={};_0x35201f[_0x4fa246[_0xefd3('0x1f')]]={'$like':'%'+_0x2f248b['query'][_0xefd3('0x19')]+'%'};return _0x35201f;}})});}_0x370d87=_[_0xefd3('0x35')]({},_0x370d87,_0x2f248b[_0xefd3('0x36')]);var _0x27e317={'where':_0x370d87[_0xefd3('0x33')]};return db[_0xefd3('0x25')][_0xefd3('0xe')](_0x27e317)['then'](function(_0x203a55){_0x3cd74e[_0xefd3('0xe')]=_0x203a55;if(_0x2f248b[_0xefd3('0x2a')][_0xefd3('0x37')]){_0x370d87[_0xefd3('0x38')]=[{'all':!![]}];}return db['VoiceExtension'][_0xefd3('0x39')](_0x370d87);})[_0xefd3('0x12')](function(_0x148506){_0x3cd74e[_0xefd3('0x3a')]=_0x148506;return _0x3cd74e;})[_0xefd3('0x12')](respondWithFilteredResult(_0x554ac4,_0x370d87))[_0xefd3('0x3b')](handleError(_0x554ac4,null));};exports[_0xefd3('0x3c')]=function(_0x4d9d40,_0x139626){var _0x2cfb3d={'raw':![],'where':{'id':_0x4d9d40[_0xefd3('0x3d')]['id']}},_0x8a8e90={};_0x8a8e90[_0xefd3('0x29')]=_[_0xefd3('0x2b')](db[_0xefd3('0x25')]['rawAttributes']);_0x8a8e90[_0xefd3('0x2a')]=_[_0xefd3('0x2b')](_0x4d9d40[_0xefd3('0x2a')]);_0x8a8e90['filters']=_['intersection'](_0x8a8e90[_0xefd3('0x29')],_0x8a8e90['query']);_0x2cfb3d['attributes']=_['intersection'](_0x8a8e90[_0xefd3('0x29')],qs[_0xefd3('0x2f')](_0x4d9d40[_0xefd3('0x2a')]['fields']));_0x2cfb3d[_0xefd3('0x2e')]=_0x2cfb3d[_0xefd3('0x2e')][_0xefd3('0x30')]?_0x2cfb3d[_0xefd3('0x2e')]:_0x8a8e90[_0xefd3('0x29')];if(_0x4d9d40[_0xefd3('0x2a')][_0xefd3('0x37')]){_0x2cfb3d[_0xefd3('0x38')]=[{'all':!![]}];}_0x2cfb3d=_[_0xefd3('0x35')]({},_0x2cfb3d,_0x4d9d40['options']);return db[_0xefd3('0x25')]['find'](_0x2cfb3d)['then'](handleEntityNotFound(_0x139626,null))[_0xefd3('0x12')](respondWithResult(_0x139626,null))[_0xefd3('0x3b')](handleError(_0x139626,null));};exports[_0xefd3('0x11')]=function(_0x449165,_0x25713c){return db[_0xefd3('0x25')][_0xefd3('0x1e')]({'where':{'id':_0x449165[_0xefd3('0x3d')]['id']}})[_0xefd3('0x12')](handleEntityNotFound(_0x25713c,null))[_0xefd3('0x12')](removeEntity(_0x25713c,null))[_0xefd3('0x3b')](handleError(_0x25713c,null));};exports[_0xefd3('0x3e')]=function(_0x218351,_0x5a438e){if(_0x218351[_0xefd3('0x3f')][_0xefd3('0x1d')]===_0xefd3('0x17')&&!_[_0xefd3('0x40')](_0x218351[_0xefd3('0x3f')][_0xefd3('0x41')],'_')){_0x218351['body'][_0xefd3('0x41')]='_'[_0xefd3('0x42')](_0x218351[_0xefd3('0x3f')][_0xefd3('0x41')]);}return db[_0xefd3('0x25')][_0xefd3('0x3e')](_0x218351[_0xefd3('0x3f')],{'raw':![]})['then'](function(_0x54a155){var _0xde9430=_0x218351[_0xefd3('0x43')]['get']({'plain':!![]});if(!_0xde9430)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xde9430[_0xefd3('0x44')]==='user'){var _0x4a1b30=_0x54a155[_0xefd3('0x13')]({'plain':!![]});var _0x53d4fb=[{'name':_0xefd3('0x14'),'value':_0xefd3('0x15')},{'name':_0xefd3('0x16'),'value':_0xefd3('0x17')},{'name':_0xefd3('0x45'),'value':_0xefd3('0x18')}];var _0x1a18ed=_[_0xefd3('0x1e')](_0x53d4fb,[_0xefd3('0x1c'),_0x4a1b30[_0xefd3('0x1d')]])[_0xefd3('0x1f')];return db[_0xefd3('0x46')][_0xefd3('0x1e')]({'where':{'name':_0x1a18ed,'userProfileId':_0xde9430[_0xefd3('0x47')]},'raw':!![]})[_0xefd3('0x12')](function(_0x29dfe2){if(_0x29dfe2&&_0x29dfe2['autoAssociation']===0x0){return db[_0xefd3('0x20')][_0xefd3('0x3e')]({'name':_0x4a1b30[_0xefd3('0x1f')],'resourceId':_0x4a1b30['id'],'type':_0x29dfe2[_0xefd3('0x1f')],'sectionId':_0x29dfe2['id']},{})[_0xefd3('0x12')](function(){return _0x54a155;});}else{return _0x54a155;}})[_0xefd3('0x3b')](function(_0x84eed9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x84eed9);throw _0x84eed9;});}return _0x54a155;})['then'](respondWithResult(_0x5a438e,0xc9))['catch'](handleError(_0x5a438e,null));};exports['update']=function(_0x52c30d,_0x518814){if(_0x52c30d[_0xefd3('0x3f')]['id']){delete _0x52c30d[_0xefd3('0x3f')]['id'];}return db[_0xefd3('0x25')][_0xefd3('0x1e')]({'where':{'id':_0x52c30d[_0xefd3('0x3d')]['id']}})[_0xefd3('0x12')](handleEntityNotFound(_0x518814,null))[_0xefd3('0x12')](function(_0xc2132b){if(_0xc2132b){return db[_0xefd3('0x25')][_0xefd3('0x48')](_[_0xefd3('0x34')](_0x52c30d[_0xefd3('0x3f')],[_0xefd3('0x41'),'context',_0xefd3('0x49'),_0xefd3('0x4a'),'cutdigits',_0xefd3('0x4b'),_0xefd3('0x4c')]),{'where':{'context':_0xc2132b[_0xefd3('0x4d')],'exten':_0xc2132b[_0xefd3('0x41')]},'individualHooks':!![]})['then'](function(_0x54941b){return _0x54941b;});}return null;})['then'](respondWithStatusCode(_0x518814,null))[_0xefd3('0x3b')](handleError(_0x518814,null));};exports[_0xefd3('0x4e')]=function(_0x2a3271,_0xd60b4f){var _0x318787=_0x2a3271['params']['id'];var _0x533be5=_0x2a3271[_0xefd3('0x3f')];var _0x3e265c=0xc8;var _0x1ca256=null;return db[_0xefd3('0x4f')][_0xefd3('0x50')]({'isolationLevel':db[_0xefd3('0x4f')][_0xefd3('0x51')]['ISOLATION_LEVELS'][_0xefd3('0x52')]},function(_0x3a7211){return db['VoiceExtension'][_0xefd3('0x53')]({'where':{'id':_0x318787},'transaction':_0x3a7211})['then'](function(_0x528a16){if(_0x528a16){return db[_0xefd3('0x25')]['destroy']({'where':{'VoiceExtensionId':_0x318787},'transaction':_0x3a7211})[_0xefd3('0x12')](function(){var _0x4da1e8=_[_0xefd3('0x1b')](_0x533be5,function(_0x1f0127){_0x1f0127[_0xefd3('0x54')]=_0x318787;_0x1f0127[_0xefd3('0x55')]=!![];return _0x1f0127;});return _0x528a16[_0xefd3('0x56')](_0x4da1e8);})[_0xefd3('0x12')](function(_0x56873b){return db[_0xefd3('0x25')]['bulkCreate'](_0x56873b,{'transaction':_0x3a7211});});}else{_0x3e265c=0x194;_0x1ca256=[];}});})[_0xefd3('0x12')](function(){if(_0x3e265c!==0x194){return db[_0xefd3('0x25')][_0xefd3('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x318787},'order':_0xefd3('0x58')})[_0xefd3('0x12')](function(_0x3861fa){_0x1ca256=_0x3861fa;});}})[_0xefd3('0x3b')](function(_0x3d1f0c){_0x3e265c=0x1f4;logger[_0xefd3('0x22')](_0x3d1f0c['stack']);if(_0x3d1f0c[_0xefd3('0x1f')]){delete _0x3d1f0c[_0xefd3('0x1f')];}_0x1ca256=_0x3d1f0c;})[_0xefd3('0x59')](function(){if(_0x1ca256===null){_0xd60b4f['sendStatus'](_0x3e265c);}else{if(_0x3e265c===0x1f4){_0xd60b4f[_0xefd3('0x9')](_0x3e265c)['send'](_0x1ca256);}else{_0xd60b4f['status'](_0x3e265c)[_0xefd3('0xa')](_0x1ca256);}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe9bf=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe9bf,0xab));var _0xfe9b=function(_0xe94a50,_0x1a794c){_0xe94a50=_0xe94a50-0x0;var _0x5b7eba=_0xe9bf[_0xe94a50];return _0x5b7eba;};'use strict';var EventEmitter=require(_0xfe9b('0x0'));var VoiceExtension=require(_0xfe9b('0x1'))['db'][_0xfe9b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfe9b('0x3')](0x0);var events={'afterCreate':_0xfe9b('0x4'),'afterUpdate':_0xfe9b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x27b91d){return function(_0x58f4b5,_0x546acb,_0x2b009f){VoiceExtensionEvents[_0xfe9b('0x6')](_0x27b91d+':'+_0x58f4b5['id'],_0x58f4b5);VoiceExtensionEvents[_0xfe9b('0x6')](_0x27b91d,_0x58f4b5);_0x2b009f(null);};}for(var e in events){if(events[_0xfe9b('0x7')](e)){var event=events[e];VoiceExtension[_0xfe9b('0x8')](e,emitEvent(event));}}module[_0xfe9b('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x905c=['emit','hook','exports','events','VoiceExtension','save','update'];(function(_0x35c2fc,_0xabea37){var _0x4727fd=function(_0x4eccfe){while(--_0x4eccfe){_0x35c2fc['push'](_0x35c2fc['shift']());}};_0x4727fd(++_0xabea37);}(_0x905c,0x1d8));var _0xc905=function(_0xca1d4c,_0x5c27a6){_0xca1d4c=_0xca1d4c-0x0;var _0x1b7fa0=_0x905c[_0xca1d4c];return _0x1b7fa0;};'use strict';var EventEmitter=require(_0xc905('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xc905('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc905('0x2'),'afterUpdate':_0xc905('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1c5186){return function(_0x36bf1c,_0x2976d9,_0x157ece){VoiceExtensionEvents['emit'](_0x1c5186+':'+_0x36bf1c['id'],_0x36bf1c);VoiceExtensionEvents[_0xc905('0x4')](_0x1c5186,_0x36bf1c);_0x157ece(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xc905('0x5')](e,emitEvent(event));}}module[_0xc905('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0848=['custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','Set','type','exten','alias','NoOp','No\x20alias\x20set','context','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','recordingFormat','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','name','param','phone','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','length','intervals','map','toLowerCase','hasOwnProperty','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType'];(function(_0x3ed25a,_0xb6a908){var _0x464480=function(_0x4b84e3){while(--_0x4b84e3){_0x3ed25a['push'](_0x3ed25a['shift']());}};_0x464480(++_0xb6a908);}(_0x0848,0x15d));var _0x8084=function(_0x42d6ac,_0x361177){_0x42d6ac=_0x42d6ac-0x0;var _0x13838b=_0x0848[_0x42d6ac];return _0x13838b;};'use strict';var _=require('lodash');var attributes=require(_0x8084('0x0'));module[_0x8084('0x1')]=function(_0x4501e8){var _0x1e6138=_0x4501e8[_0x8084('0x2')];function _0x1751d1(_0x334860){var _0x5133e8=0x2;var _0x353d88=[{'type':_0x334860['type'],'app':_0x8084('0x3'),'appdata':'CDR(type)='+_0x334860[_0x8084('0x4')],'context':_0x334860['context'],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']},{'type':_0x334860[_0x8084('0x4')],'app':_0x334860[_0x8084('0x6')]?_0x8084('0x3'):_0x8084('0x7'),'appdata':_0x334860[_0x8084('0x6')]?'CDR(routeAlias)='+_0x334860[_0x8084('0x6')]:_0x8084('0x8'),'context':_0x334860[_0x8084('0x9')],'exten':_0x334860['exten'],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']}];if(_0x334860[_0x8084('0x4')]===_0x8084('0xa')){_0x353d88['push']({'type':'inbound','app':'Set','appdata':_0x8084('0xb')+_0x334860['id'],'context':_0x334860['context'],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']});}_0x353d88['push']({'type':_0x334860[_0x8084('0x4')],'app':'Set','appdata':_0x8084('0xc'),'context':_0x334860[_0x8084('0x9')],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']},{'type':_0x334860[_0x8084('0x4')],'app':'Set','appdata':_0x8084('0xd'),'context':_0x334860['context'],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']},{'type':_0x334860[_0x8084('0x4')],'app':_0x8084('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x334860[_0x8084('0x9')],'exten':_0x334860[_0x8084('0x5')],'priority':_0x5133e8++,'VoiceExtensionId':_0x334860['id']});return _0x353d88;}function _0x3ef3e1(_0xd5a45d){var _0xc27461=0x2;var _0x1d7a68=[{'type':'outbound','app':_0x8084('0x3'),'appdata':_0x8084('0xe'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0xd5a45d[_0x8084('0x6')]?_0x8084('0x3'):_0x8084('0x7'),'appdata':_0xd5a45d[_0x8084('0x6')]?_0x8084('0x10')+_0xd5a45d[_0x8084('0x6')]:_0x8084('0x8'),'context':_0xd5a45d['context'],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0x11')+(_0xd5a45d[_0x8084('0x12')]?_0x8084('0x13')+_0xd5a45d[_0x8084('0x12')]+'}':_0x8084('0x14')),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0xb')+_0xd5a45d['id'],'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d['exten'],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':'ExecIf','appdata':_0x8084('0x15')+(_0xc27461+0x2)+_0x8084('0x16')+(_0xc27461+0x1)+')','context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0xd5a45d['cutdigits']?_0x8084('0x17')+_0xd5a45d[_0x8084('0x12')]+'}':_0x8084('0x18'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':'outbound','app':_0x8084('0x3'),'appdata':_0x8084('0xc'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':'outbound','app':_0x8084('0x3'),'appdata':_0x8084('0x19'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':'outboundrouteid='+_0xd5a45d['id'],'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d['exten'],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']}];if(_0xd5a45d['hasOwnProperty']('recordingFormat')&&_0xd5a45d[_0x8084('0x1a')]!==_0x8084('0x1b')){_0x1d7a68[_0x8084('0x1c')]({'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0x1d'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']},{'type':_0x8084('0xf'),'app':_0x8084('0x3'),'appdata':_0x8084('0x1e')+_0xd5a45d[_0x8084('0x1a')]||_0x8084('0x1f'),'context':_0xd5a45d[_0x8084('0x9')],'exten':_0xd5a45d[_0x8084('0x5')],'priority':_0xc27461++,'VoiceExtensionId':_0xd5a45d['id']});}return _0x1d7a68;}function _0x8d0739(_0x1734c7,_0x236db3){var _0xf08f63=[{'name':_0x8084('0x20'),'param':0x0},{'name':_0x8084('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x8084('0x22'),'param':0x3}];var _0x28cec3={};var _0x4f76d9=_0x236db3[_0x8084('0x23')](',');var _0x2091a5=[];for(var _0x54ef2c=0x0;_0x54ef2c<_0xf08f63['length'];_0x54ef2c++){switch(_0xf08f63[_0x54ef2c][_0x8084('0x24')]){case _0x8084('0x20'):_0x28cec3[_0x8084('0x20')]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]][_0x8084('0x23')]('/')[0x1];_0x28cec3[_0x8084('0x26')]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]][_0x8084('0x23')]('/')[0x2];_0x28cec3[_0x8084('0x27')]=_0x28cec3[_0x8084('0x26')]?_0x28cec3[_0x8084('0x26')][_0x8084('0x23')]('$')[0x0]:undefined;_0x28cec3[_0x8084('0x26')]=_0x1734c7['cutdigits']?(_0x28cec3[_0x8084('0x27')]||'')+'${EXTEN:'+_0x1734c7[_0x8084('0x12')]+'}':(_0x28cec3[_0x8084('0x27')]||'')+'${EXTEN}';_0x2091a5[_0xf08f63[_0x54ef2c][_0x8084('0x25')]]=[_0x8084('0x28'),_0x28cec3[_0x8084('0x20')],_0x28cec3[_0x8084('0x26')]][_0x8084('0x29')]('/');break;case _0x8084('0x2a'):_0x28cec3[_0x8084('0x2a')]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]];if(_0x1734c7[_0x8084('0x1a')]!=='none'){if(_0x28cec3['options'][_0x8084('0x2b')](_0x8084('0x2c'))<0x0){_0x28cec3[_0x8084('0x2a')]+=_0x8084('0x2c');}}else{_0x28cec3['options']=_0x28cec3['options'][_0x8084('0x2d')](_0x8084('0x2c'),'');}_0x2091a5[_0xf08f63[_0x54ef2c][_0x8084('0x25')]]=_0x28cec3[_0x8084('0x2a')];break;default:_0x2091a5[_0xf08f63[_0x54ef2c][_0x8084('0x25')]]=_0x4f76d9[_0xf08f63[_0x54ef2c][_0x8084('0x25')]];}}return _0x2091a5[_0x8084('0x29')](',');}function _0x15ef30(_0x3827af,_0x514969,_0x29752c){return new Promise(function(_0x4d1e56,_0xc91f75){var _0x19dec9=[];if(_['isEmpty'](_0x514969))return _0x4d1e56(_0x19dec9);_0x1e6138[_0x8084('0x2e')][_0x8084('0x2f')]({'attributes':['id',_0x8084('0x30'),_0x8084('0x31')],'raw':!![]})[_0x8084('0x32')](function(_0x4597d1){for(var _0x2c4301=0x0,_0x3f584e=0x0;_0x2c4301<_0x514969[_0x8084('0x33')];_0x2c4301++,_0x3f584e=0x0){var _0x4be6a8=_0x514969[_0x2c4301];var _0x10854c=[];var _0x4a97ff=[];delete _0x4be6a8['id'];if(_0x4be6a8['interval']!=='*,*,*,*'){_0x4be6a8[_0x8084('0x34')]=[_0x4be6a8['interval']];}else{_0x4be6a8[_0x8084('0x34')]=_0x4be6a8[_0x8084('0x31')]?_[_0x8084('0x35')](_['filter'](_0x4597d1,{'IntervalId':_0x4be6a8[_0x8084('0x31')]}),'interval'):[];}_0x4be6a8[_0x8084('0x9')]=_0x3827af[_0x8084('0x9')];_0x4be6a8[_0x8084('0x5')]=_0x3827af[_0x8084('0x5')];if(_0x4be6a8['type'])_0x4be6a8['type']=_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')]();if(_0x3827af[_0x8084('0x4')]===_0x8084('0xf')){if(_0x4be6a8[_0x8084('0x37')](_0x8084('0x38'))&&_0x4be6a8[_0x8084('0x38')]&&_0x4be6a8[_0x8084('0x38')]!=='--'){_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':'CDR(tag)='+_0x4be6a8[_0x8084('0x38')],'context':_0x3827af['context'],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8['intervals']['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8['type']['toLowerCase'](),'app':_0x8084('0x39'),'appdata':_0x8084('0x3a')+(_0x4be6a8[_0x8084('0x3b')]?'Set(CALLERID(all)='+_0x4be6a8[_0x8084('0x3b')]+')':_0x8084('0x3c')),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8[_0x8084('0x34')]['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}else{if(_0x4be6a8[_0x8084('0x37')]('answer')){if([_0x8084('0x3d'),_0x8084('0x3e')][_0x8084('0x3f')](_0x4be6a8[_0x8084('0x40')][_0x8084('0x36')]())&&_0x4be6a8[_0x8084('0x41')]!==_0x8084('0x42')){if(_0x4be6a8['answer']){_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8['type']['toLowerCase'](),'app':_0x8084('0x39'),'appdata':_0x8084('0x43'),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8['intervals'][_0x8084('0x33')]+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8['type'][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':_0x8084('0x44'),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af['exten'],'priority':_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')]+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}else{_0x10854c['push']({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x39'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')]+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':_0x8084('0x45'),'context':_0x3827af[_0x8084('0x9')],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8['intervals']['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}}}}for(var _0x3dc1d6=0x0;_0x3dc1d6<_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')];_0x3dc1d6++){var _0x576838=_0x29752c+_0x4be6a8[_0x8084('0x34')][_0x8084('0x33')];var _0x3fe8a0=_0x3dc1d6===_0x4be6a8[_0x8084('0x34')]['length']-0x1?_0x29752c+_0x10854c[_0x8084('0x33')]+_0x4a97ff[_0x8084('0x33')]+0x2:_0x29752c+_0x3dc1d6+0x1;_0x10854c[_0x8084('0x46')](_0x3dc1d6,0x0,{'type':_0x3827af['type'],'app':_0x8084('0x47'),'appdata':_0x4be6a8['intervals'][_0x3dc1d6]+'?'+_0x3827af[_0x8084('0x9')]+',${EXTEN},'+_0x576838+':'+_0x3827af[_0x8084('0x9')]+',${EXTEN},'+_0x3fe8a0,'exten':_0x3827af['exten'],'context':_0x3827af[_0x8084('0x9')],'priority':_0x29752c+_0x3dc1d6,'VoiceExtensionId':_0x3827af['id']});}if(_0x4be6a8['appType']===_0x8084('0x48')){_0x4be6a8[_0x8084('0x49')]=_0x8d0739(_0x3827af,_0x4be6a8[_0x8084('0x49')]);}if(_0x4be6a8[_0x8084('0x41')]==='agi'){_0x10854c[_0x8084('0x1c')]({'type':_0x4be6a8[_0x8084('0x4')][_0x8084('0x36')](),'app':_0x8084('0x3'),'appdata':_0x8084('0x4a'),'context':_0x3827af['context'],'exten':_0x3827af[_0x8084('0x5')],'priority':_0x4be6a8[_0x8084('0x34')]['length']+_0x29752c+_0x3f584e++,'VoiceExtensionId':_0x3827af['id']});}_0x4be6a8[_0x8084('0x4b')]=_0x10854c['length']?_[_0x8084('0x4c')](_0x10854c)['priority']+0x1:_0x29752c;_0x19dec9=_['concat'](_0x19dec9,_0x10854c,[_0x4be6a8],_0x4a97ff);_0x29752c=_[_0x8084('0x4c')](_0x19dec9)[_0x8084('0x4b')]+0x1;}return _0x4d1e56(_0x19dec9);})[_0x8084('0x4d')](function(_0xdad17a){_0xc91f75(_0xdad17a);});});}return _0x4501e8[_0x8084('0x4e')](_0x8084('0x4f'),attributes,{'tableName':_0x8084('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x228a48){var _0x50d149=this[_0x8084('0x51')]({'plain':!![]});var _0x1c4f3f=_0x50d149['type']==='outbound'?_0x3ef3e1(_0x50d149):_0x1751d1(_0x50d149);return _0x15ef30(_0x50d149,_0x228a48,_[_0x8084('0x4c')](_0x1c4f3f)[_0x8084('0x4b')]+0x1)[_0x8084('0x32')](function(_0x1e7ceb){var _0x12d32e=_['concat'](_0x1c4f3f,_0x1e7ceb);_0x12d32e[_0x8084('0x1c')]({'type':_0x50d149[_0x8084('0x4')],'app':_0x8084('0x52'),'exten':_0x50d149[_0x8084('0x5')],'context':_0x50d149[_0x8084('0x9')],'priority':_[_0x8084('0x4c')](_0x12d32e)[_0x8084('0x4b')]+0x1,'VoiceExtensionId':_0x50d149['id']});return _0x12d32e;});}}});};
\ No newline at end of file
+var _0x4820=['trunk','phone','param','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','outboundDial','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','last','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','split','length','name'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x4820,0x83));var _0x0482=function(_0x292c6e,_0x381e8a){_0x292c6e=_0x292c6e-0x0;var _0x1fc3ba=_0x4820[_0x292c6e];return _0x1fc3ba;};'use strict';var _=require(_0x0482('0x0'));var attributes=require(_0x0482('0x1'));module[_0x0482('0x2')]=function(_0x9df14b){var _0x2d62fb=_0x9df14b[_0x0482('0x3')];function _0x1e9a70(_0x1fc962){var _0x167961=0x2;var _0x4a275c=[{'type':_0x1fc962[_0x0482('0x4')],'app':_0x0482('0x5'),'appdata':_0x0482('0x6')+_0x1fc962[_0x0482('0x4')],'context':_0x1fc962[_0x0482('0x7')],'exten':_0x1fc962[_0x0482('0x8')],'priority':_0x167961++,'VoiceExtensionId':_0x1fc962['id']},{'type':_0x1fc962['type'],'app':_0x1fc962[_0x0482('0x9')]?_0x0482('0x5'):_0x0482('0xa'),'appdata':_0x1fc962[_0x0482('0x9')]?_0x0482('0xb')+_0x1fc962[_0x0482('0x9')]:_0x0482('0xc'),'context':_0x1fc962['context'],'exten':_0x1fc962['exten'],'priority':_0x167961++,'VoiceExtensionId':_0x1fc962['id']}];if(_0x1fc962[_0x0482('0x4')]==='inbound'){_0x4a275c[_0x0482('0xd')]({'type':_0x0482('0xe'),'app':_0x0482('0x5'),'appdata':_0x0482('0xf')+_0x1fc962['id'],'context':_0x1fc962[_0x0482('0x7')],'exten':_0x1fc962[_0x0482('0x8')],'priority':_0x167961++,'VoiceExtensionId':_0x1fc962['id']});}_0x4a275c[_0x0482('0xd')]({'type':_0x1fc962[_0x0482('0x4')],'app':_0x0482('0x5'),'appdata':_0x0482('0x10'),'context':_0x1fc962['context'],'exten':_0x1fc962['exten'],'priority':_0x167961++,'VoiceExtensionId':_0x1fc962['id']},{'type':_0x1fc962[_0x0482('0x4')],'app':_0x0482('0x5'),'appdata':_0x0482('0x11'),'context':_0x1fc962['context'],'exten':_0x1fc962[_0x0482('0x8')],'priority':_0x167961++,'VoiceExtensionId':_0x1fc962['id']},{'type':_0x1fc962[_0x0482('0x4')],'app':_0x0482('0x5'),'appdata':_0x0482('0x12'),'context':_0x1fc962['context'],'exten':_0x1fc962[_0x0482('0x8')],'priority':_0x167961++,'VoiceExtensionId':_0x1fc962['id']});return _0x4a275c;}function _0x55d45d(_0x513f93){var _0x187ca5=0x2;var _0x31d1f3=[{'type':_0x0482('0x13'),'app':'Set','appdata':_0x0482('0x14'),'context':_0x513f93['context'],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x513f93['alias']?_0x0482('0x5'):_0x0482('0xa'),'appdata':_0x513f93[_0x0482('0x9')]?_0x0482('0xb')+_0x513f93[_0x0482('0x9')]:'No\x20alias\x20set','context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':'outbound','app':_0x0482('0x5'),'appdata':_0x0482('0x15')+(_0x513f93[_0x0482('0x16')]?_0x0482('0x17')+_0x513f93[_0x0482('0x16')]+'}':_0x0482('0x18')),'context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':_0x0482('0xf')+_0x513f93['id'],'context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':'ExecIf','appdata':_0x0482('0x19')+(_0x187ca5+0x2)+_0x0482('0x1a')+(_0x187ca5+0x1)+')','context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':_0x513f93[_0x0482('0x16')]?_0x0482('0x1b')+_0x513f93['cutdigits']+'}':_0x0482('0x1c'),'context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':_0x0482('0x10'),'context':_0x513f93['context'],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':_0x0482('0x12'),'context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':_0x0482('0x1d')+_0x513f93['id'],'context':_0x513f93['context'],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']}];if(_0x513f93[_0x0482('0x1e')](_0x0482('0x1f'))&&_0x513f93[_0x0482('0x1f')]!==_0x0482('0x20')){_0x31d1f3[_0x0482('0xd')]({'type':_0x0482('0x13'),'app':_0x0482('0x5'),'appdata':_0x0482('0x21'),'context':_0x513f93[_0x0482('0x7')],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']},{'type':'outbound','app':'Set','appdata':_0x0482('0x22')+_0x513f93[_0x0482('0x1f')]||'wav','context':_0x513f93['context'],'exten':_0x513f93[_0x0482('0x8')],'priority':_0x187ca5++,'VoiceExtensionId':_0x513f93['id']});}return _0x31d1f3;}function _0x1a1cce(_0x1f53aa,_0x5ed25c){var _0x214640=[{'name':'trunk','param':0x0},{'name':_0x0482('0x23'),'param':0x1},{'name':_0x0482('0x24'),'param':0x2},{'name':_0x0482('0x25'),'param':0x3}];var _0x47075b={};var _0x49e2f2=_0x5ed25c[_0x0482('0x26')](',');var _0x59899e=[];for(var _0x425d04=0x0;_0x425d04<_0x214640[_0x0482('0x27')];_0x425d04++){switch(_0x214640[_0x425d04][_0x0482('0x28')]){case _0x0482('0x29'):_0x47075b[_0x0482('0x29')]=_0x49e2f2[_0x214640[_0x425d04]['param']]['split']('/')[0x1];_0x47075b[_0x0482('0x2a')]=_0x49e2f2[_0x214640[_0x425d04][_0x0482('0x2b')]]['split']('/')[0x2];_0x47075b['prefix']=_0x47075b[_0x0482('0x2a')]?_0x47075b[_0x0482('0x2a')][_0x0482('0x26')]('$')[0x0]:undefined;_0x47075b['phone']=_0x1f53aa[_0x0482('0x16')]?(_0x47075b[_0x0482('0x2c')]||'')+_0x0482('0x17')+_0x1f53aa[_0x0482('0x16')]+'}':(_0x47075b[_0x0482('0x2c')]||'')+_0x0482('0x18');_0x59899e[_0x214640[_0x425d04][_0x0482('0x2b')]]=['SIP',_0x47075b[_0x0482('0x29')],_0x47075b[_0x0482('0x2a')]][_0x0482('0x2d')]('/');break;case'options':_0x47075b[_0x0482('0x24')]=_0x49e2f2[_0x214640[_0x425d04][_0x0482('0x2b')]];if(_0x1f53aa[_0x0482('0x1f')]!==_0x0482('0x20')){if(_0x47075b[_0x0482('0x24')][_0x0482('0x2e')](_0x0482('0x2f'))<0x0){_0x47075b[_0x0482('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x47075b[_0x0482('0x24')]=_0x47075b[_0x0482('0x24')][_0x0482('0x30')]('U(xcally-mixmonitor-context)','');}_0x59899e[_0x214640[_0x425d04]['param']]=_0x47075b[_0x0482('0x24')];break;default:_0x59899e[_0x214640[_0x425d04][_0x0482('0x2b')]]=_0x49e2f2[_0x214640[_0x425d04][_0x0482('0x2b')]];}}return _0x59899e[_0x0482('0x2d')](',');}function _0x1e2dcb(_0x25b35b,_0x275493,_0x16555f){return new Promise(function(_0x2d86a4,_0x3714f4){var _0x494e92=[];if(_['isEmpty'](_0x275493))return _0x2d86a4(_0x494e92);_0x2d62fb[_0x0482('0x31')][_0x0482('0x32')]({'attributes':['id',_0x0482('0x33'),_0x0482('0x34')],'raw':!![]})['then'](function(_0x4c63b1){for(var _0x4a9c72=0x0,_0x1a952f=0x0;_0x4a9c72<_0x275493[_0x0482('0x27')];_0x4a9c72++,_0x1a952f=0x0){var _0x4b7759=_0x275493[_0x4a9c72];var _0x27106d=[];var _0x59f1af=[];delete _0x4b7759['id'];if(_0x4b7759[_0x0482('0x33')]!==_0x0482('0x35')){_0x4b7759[_0x0482('0x36')]=[_0x4b7759['interval']];}else{_0x4b7759[_0x0482('0x36')]=_0x4b7759[_0x0482('0x34')]?_[_0x0482('0x37')](_[_0x0482('0x38')](_0x4c63b1,{'IntervalId':_0x4b7759[_0x0482('0x34')]}),_0x0482('0x33')):[];}_0x4b7759['context']=_0x25b35b['context'];_0x4b7759['exten']=_0x25b35b[_0x0482('0x8')];if(_0x4b7759[_0x0482('0x4')])_0x4b7759[_0x0482('0x4')]=_0x4b7759[_0x0482('0x4')][_0x0482('0x39')]();if(_0x25b35b['type']===_0x0482('0x13')){if(_0x4b7759[_0x0482('0x1e')](_0x0482('0x3a'))&&_0x4b7759['tag']&&_0x4b7759[_0x0482('0x3a')]!=='--'){_0x27106d[_0x0482('0xd')]({'type':_0x4b7759[_0x0482('0x4')][_0x0482('0x39')](),'app':_0x0482('0x5'),'appdata':_0x0482('0x3b')+_0x4b7759['tag'],'context':_0x25b35b[_0x0482('0x7')],'exten':_0x25b35b[_0x0482('0x8')],'priority':_0x4b7759['intervals'][_0x0482('0x27')]+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});}_0x27106d[_0x0482('0xd')]({'type':_0x4b7759['type'][_0x0482('0x39')](),'app':_0x0482('0x3c'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x4b7759[_0x0482('0x3d')]?_0x0482('0x3e')+_0x4b7759[_0x0482('0x3d')]+')':_0x0482('0x3f')),'context':_0x25b35b[_0x0482('0x7')],'exten':_0x25b35b[_0x0482('0x8')],'priority':_0x4b7759[_0x0482('0x36')][_0x0482('0x27')]+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});}else{if(_0x4b7759[_0x0482('0x1e')]('answer')){if([_0x0482('0x40'),_0x0482('0x41')][_0x0482('0x42')](_0x4b7759[_0x0482('0x43')][_0x0482('0x39')]())&&_0x4b7759[_0x0482('0x44')]!==_0x0482('0x45')){if(_0x4b7759[_0x0482('0x46')]){_0x27106d[_0x0482('0xd')]({'type':_0x4b7759[_0x0482('0x4')]['toLowerCase'](),'app':_0x0482('0x3c'),'appdata':_0x0482('0x47'),'context':_0x25b35b[_0x0482('0x7')],'exten':_0x25b35b['exten'],'priority':_0x4b7759['intervals'][_0x0482('0x27')]+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});_0x27106d[_0x0482('0xd')]({'type':_0x4b7759[_0x0482('0x4')][_0x0482('0x39')](),'app':_0x0482('0x5'),'appdata':_0x0482('0x48'),'context':_0x25b35b['context'],'exten':_0x25b35b[_0x0482('0x8')],'priority':_0x4b7759[_0x0482('0x36')][_0x0482('0x27')]+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});}else{_0x27106d['push']({'type':_0x4b7759['type'][_0x0482('0x39')](),'app':_0x0482('0x3c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x25b35b[_0x0482('0x7')],'exten':_0x25b35b[_0x0482('0x8')],'priority':_0x4b7759[_0x0482('0x36')]['length']+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});_0x27106d['push']({'type':_0x4b7759[_0x0482('0x4')][_0x0482('0x39')](),'app':_0x0482('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x25b35b['context'],'exten':_0x25b35b[_0x0482('0x8')],'priority':_0x4b7759[_0x0482('0x36')][_0x0482('0x27')]+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});}}}}for(var _0x20479e=0x0;_0x20479e<_0x4b7759[_0x0482('0x36')]['length'];_0x20479e++){var _0x28719d=_0x16555f+_0x4b7759['intervals']['length'];var _0x46082e=_0x20479e===_0x4b7759[_0x0482('0x36')][_0x0482('0x27')]-0x1?_0x16555f+_0x27106d[_0x0482('0x27')]+_0x59f1af['length']+0x2:_0x16555f+_0x20479e+0x1;_0x27106d[_0x0482('0x49')](_0x20479e,0x0,{'type':_0x25b35b[_0x0482('0x4')],'app':_0x0482('0x4a'),'appdata':_0x4b7759[_0x0482('0x36')][_0x20479e]+'?'+_0x25b35b[_0x0482('0x7')]+_0x0482('0x4b')+_0x28719d+':'+_0x25b35b[_0x0482('0x7')]+_0x0482('0x4b')+_0x46082e,'exten':_0x25b35b[_0x0482('0x8')],'context':_0x25b35b['context'],'priority':_0x16555f+_0x20479e,'VoiceExtensionId':_0x25b35b['id']});}if(_0x4b7759[_0x0482('0x44')]===_0x0482('0x4c')){_0x4b7759['appdata']=_0x1a1cce(_0x25b35b,_0x4b7759['appdata']);}if(_0x4b7759[_0x0482('0x44')]===_0x0482('0x4d')){_0x27106d[_0x0482('0xd')]({'type':_0x4b7759[_0x0482('0x4')][_0x0482('0x39')](),'app':_0x0482('0x5'),'appdata':_0x0482('0x4e'),'context':_0x25b35b[_0x0482('0x7')],'exten':_0x25b35b[_0x0482('0x8')],'priority':_0x4b7759[_0x0482('0x36')][_0x0482('0x27')]+_0x16555f+_0x1a952f++,'VoiceExtensionId':_0x25b35b['id']});}_0x4b7759[_0x0482('0x4f')]=_0x27106d[_0x0482('0x27')]?_['last'](_0x27106d)[_0x0482('0x4f')]+0x1:_0x16555f;_0x494e92=_[_0x0482('0x50')](_0x494e92,_0x27106d,[_0x4b7759],_0x59f1af);_0x16555f=_[_0x0482('0x51')](_0x494e92)[_0x0482('0x4f')]+0x1;}return _0x2d86a4(_0x494e92);})['catch'](function(_0x204832){_0x3714f4(_0x204832);});});}return _0x9df14b[_0x0482('0x52')](_0x0482('0x53'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4f0518){var _0xa62bfd=this[_0x0482('0x54')]({'plain':!![]});var _0x3bf6a1=_0xa62bfd[_0x0482('0x4')]===_0x0482('0x13')?_0x55d45d(_0xa62bfd):_0x1e9a70(_0xa62bfd);return _0x1e2dcb(_0xa62bfd,_0x4f0518,_[_0x0482('0x51')](_0x3bf6a1)['priority']+0x1)['then'](function(_0x21e60b){var _0x27ea05=_[_0x0482('0x50')](_0x3bf6a1,_0x21e60b);_0x27ea05['push']({'type':_0xa62bfd['type'],'app':_0x0482('0x55'),'exten':_0xa62bfd[_0x0482('0x8')],'context':_0xa62bfd[_0x0482('0x7')],'priority':_[_0x0482('0x51')](_0x27ea05)[_0x0482('0x4f')]+0x1,'VoiceExtensionId':_0xa62bfd['id']});return _0x27ea05;});}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e54=['lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceExtension,\x20%s,\x20%s','result','catch','findAll','options','raw','attributes','limit','include','model','map','GetVoiceExtension'];(function(_0x35af01,_0x4b407e){var _0x53de18=function(_0x83957c){while(--_0x83957c){_0x35af01['push'](_0x35af01['shift']());}};_0x53de18(++_0x4b407e);}(_0x9e54,0x88));var _0x49e5=function(_0x1e3dae,_0x13e381){_0x1e3dae=_0x1e3dae-0x0;var _0xdc7cc6=_0x9e54[_0x1e3dae];return _0xdc7cc6;};'use strict';var _=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49e5('0x2'));var db=require(_0x49e5('0x3'))['db'];var utils=require(_0x49e5('0x4'));var logger=require('../../config/logger')(_0x49e5('0x5'));var config=require(_0x49e5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49e5('0x7')]['http']({'port':0x232a});config['redis']=_[_0x49e5('0x8')](config['redis'],{'host':_0x49e5('0x9'),'port':0x18eb});var socket=require(_0x49e5('0xa'))(new Redis(config[_0x49e5('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x3cee11,_0x5e0dfa,_0x45c7cd){return new BPromise(function(_0x22aec5,_0x134034){return client[_0x49e5('0xc')](_0x3cee11,_0x45c7cd)[_0x49e5('0xd')](function(_0x51cf9b){logger[_0x49e5('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x5e0dfa,_0x49e5('0xf'));logger[_0x49e5('0x10')](_0x49e5('0x11'),_0x5e0dfa,_0x49e5('0xf'),JSON[_0x49e5('0x12')](_0x51cf9b));if(_0x51cf9b['error']){if(_0x51cf9b['error'][_0x49e5('0x13')]===0x1f4){logger[_0x49e5('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x5e0dfa,_0x51cf9b['error'][_0x49e5('0x15')]);return _0x134034(_0x51cf9b['error'][_0x49e5('0x15')]);}logger['error'](_0x49e5('0x16'),_0x5e0dfa,_0x51cf9b[_0x49e5('0x14')][_0x49e5('0x15')]);return _0x22aec5(_0x51cf9b['error'][_0x49e5('0x15')]);}else{logger[_0x49e5('0xe')](_0x49e5('0x16'),_0x5e0dfa,_0x49e5('0xf'));_0x22aec5(_0x51cf9b[_0x49e5('0x17')][_0x49e5('0x15')]);}})[_0x49e5('0x18')](function(_0x4dca4f){logger[_0x49e5('0x14')](_0x49e5('0x16'),_0x5e0dfa,_0x4dca4f);_0x134034(_0x4dca4f);});});}exports['GetVoiceExtension']=function(_0x2370ad){var _0x5b13ed=this;return new Promise(function(_0x305b4c,_0x2b1bbe){return db['VoiceExtension'][_0x49e5('0x19')]({'raw':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')][_0x49e5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')]['where']||null:null,'attributes':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad['options'][_0x49e5('0x1c')]||null:null,'limit':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')][_0x49e5('0x1d')]||null:null,'include':_0x2370ad[_0x49e5('0x1a')]?_0x2370ad[_0x49e5('0x1a')]['include']?_['map'](_0x2370ad[_0x49e5('0x1a')][_0x49e5('0x1e')],function(_0x5531bf){return{'model':db[_0x5531bf[_0x49e5('0x1f')]],'as':_0x5531bf['as'],'attributes':_0x5531bf[_0x49e5('0x1c')],'include':_0x5531bf[_0x49e5('0x1e')]?_[_0x49e5('0x20')](_0x5531bf[_0x49e5('0x1e')],function(_0x21b29a){return{'model':db[_0x21b29a['model']],'as':_0x21b29a['as'],'attributes':_0x21b29a[_0x49e5('0x1c')],'include':_0x21b29a[_0x49e5('0x1e')]?_[_0x49e5('0x20')](_0x21b29a['include'],function(_0x300754){return{'model':db[_0x300754['model']],'as':_0x300754['as'],'attributes':_0x300754[_0x49e5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x49e5('0xd')](function(_0x5a0e10){logger['info'](_0x49e5('0x21'),_0x2370ad);logger[_0x49e5('0x10')]('GetVoiceExtension',_0x2370ad,JSON[_0x49e5('0x12')](_0x5a0e10));_0x305b4c(_0x5a0e10);})['catch'](function(_0x36d49e){logger[_0x49e5('0x14')](_0x49e5('0x21'),_0x36d49e[_0x49e5('0x15')],_0x2370ad);_0x2b1bbe(_0x5b13ed[_0x49e5('0x14')](0x1f4,_0x36d49e['message']));});});};
\ No newline at end of file
+var _0x21cd=['localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x41203d,_0x2dc0f4){var _0x463a2=function(_0x1a0b26){while(--_0x1a0b26){_0x41203d['push'](_0x41203d['shift']());}};_0x463a2(++_0x2dc0f4);}(_0x21cd,0x6a));var _0xd21c=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x21cd[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var moment=require(_0xd21c('0x2'));var BPromise=require(_0xd21c('0x3'));var rs=require(_0xd21c('0x4'));var fs=require('fs');var Redis=require(_0xd21c('0x5'));var db=require(_0xd21c('0x6'))['db'];var utils=require(_0xd21c('0x7'));var logger=require(_0xd21c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd21c('0x9'));var client=jayson[_0xd21c('0xa')][_0xd21c('0xb')]({'port':0x232a});config[_0xd21c('0xc')]=_[_0xd21c('0xd')](config['redis'],{'host':_0xd21c('0xe'),'port':0x18eb});var socket=require(_0xd21c('0xf'))(new Redis(config[_0xd21c('0xc')]));require(_0xd21c('0x10'))[_0xd21c('0x11')](socket);function respondWithRpcPromise(_0x5298c4,_0x380c59,_0x4ad6d1){return new BPromise(function(_0x39dd4a,_0x2e36b0){return client[_0xd21c('0x12')](_0x5298c4,_0x4ad6d1)[_0xd21c('0x13')](function(_0x474042){logger[_0xd21c('0x14')](_0xd21c('0x15'),_0x380c59,'request\x20sent');logger[_0xd21c('0x16')](_0xd21c('0x17'),_0x380c59,_0xd21c('0x18'),JSON[_0xd21c('0x19')](_0x474042));if(_0x474042[_0xd21c('0x1a')]){if(_0x474042[_0xd21c('0x1a')][_0xd21c('0x1b')]===0x1f4){logger[_0xd21c('0x1a')](_0xd21c('0x15'),_0x380c59,_0x474042[_0xd21c('0x1a')][_0xd21c('0x1c')]);return _0x2e36b0(_0x474042[_0xd21c('0x1a')]['message']);}logger[_0xd21c('0x1a')](_0xd21c('0x15'),_0x380c59,_0x474042[_0xd21c('0x1a')][_0xd21c('0x1c')]);return _0x39dd4a(_0x474042[_0xd21c('0x1a')]['message']);}else{logger[_0xd21c('0x14')](_0xd21c('0x15'),_0x380c59,_0xd21c('0x18'));_0x39dd4a(_0x474042['result'][_0xd21c('0x1c')]);}})[_0xd21c('0x1d')](function(_0x580546){logger[_0xd21c('0x1a')](_0xd21c('0x15'),_0x380c59,_0x580546);_0x2e36b0(_0x580546);});});}exports['GetVoiceExtension']=function(_0x4e352a){var _0x50b0b9=this;return new Promise(function(_0x258ef1,_0x21a175){return db[_0xd21c('0x1e')][_0xd21c('0x1f')]({'raw':_0x4e352a['options']?_0x4e352a[_0xd21c('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4e352a['options']?_0x4e352a[_0xd21c('0x20')][_0xd21c('0x21')]||null:null,'attributes':_0x4e352a[_0xd21c('0x20')]?_0x4e352a[_0xd21c('0x20')][_0xd21c('0x22')]||null:null,'limit':_0x4e352a[_0xd21c('0x20')]?_0x4e352a[_0xd21c('0x20')][_0xd21c('0x23')]||null:null,'include':_0x4e352a[_0xd21c('0x20')]?_0x4e352a[_0xd21c('0x20')][_0xd21c('0x24')]?_[_0xd21c('0x25')](_0x4e352a['options'][_0xd21c('0x24')],function(_0x5382bf){return{'model':db[_0x5382bf[_0xd21c('0x26')]],'as':_0x5382bf['as'],'attributes':_0x5382bf['attributes'],'include':_0x5382bf[_0xd21c('0x24')]?_[_0xd21c('0x25')](_0x5382bf[_0xd21c('0x24')],function(_0x46f344){return{'model':db[_0x46f344[_0xd21c('0x26')]],'as':_0x46f344['as'],'attributes':_0x46f344[_0xd21c('0x22')],'include':_0x46f344[_0xd21c('0x24')]?_[_0xd21c('0x25')](_0x46f344[_0xd21c('0x24')],function(_0x14cc32){return{'model':db[_0x14cc32['model']],'as':_0x14cc32['as'],'attributes':_0x14cc32[_0xd21c('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd21c('0x13')](function(_0x5c0e39){logger[_0xd21c('0x14')]('GetVoiceExtension',_0x4e352a);logger['debug']('GetVoiceExtension',_0x4e352a,JSON[_0xd21c('0x19')](_0x5c0e39));_0x258ef1(_0x5c0e39);})[_0xd21c('0x1d')](function(_0x3b7f6e){logger[_0xd21c('0x1a')](_0xd21c('0x27'),_0x3b7f6e[_0xd21c('0x1c')],_0x4e352a);_0x21a175(_0x50b0b9['error'](0x1f4,_0x3b7f6e[_0xd21c('0x1c')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x299a1c,_0x50668c){_0x299a1c=_0x299a1c-0x0;var _0x40530f=_0x1cb9[_0x299a1c];return _0x40530f;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
+var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x2dd9a3,_0x474faf){var _0x1960f3=function(_0x388776){while(--_0x388776){_0x2dd9a3['push'](_0x2dd9a3['shift']());}};_0x1960f3(++_0x474faf);}(_0x1261,0x144));var _0x1126=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x1261[_0x134058];return _0x14a1a9;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x187d=['/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show'];(function(_0x17a749,_0x40908b){var _0x10ee89=function(_0x487af7){while(--_0x487af7){_0x17a749['push'](_0x17a749['shift']());}};_0x10ee89(++_0x40908b);}(_0x187d,0x93));var _0xd187=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x187d[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router;
\ No newline at end of file
+var _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','/:id/messages','create','update','destroy','exports','util'];(function(_0x3bcf9d,_0x12924e){var _0x3c7d30=function(_0x32ddf2){while(--_0x32ddf2){_0x3bcf9d['push'](_0x3bcf9d['shift']());}};_0x3c7d30(++_0x12924e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6d38[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['getMessages']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xa'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce8a=['getDataValue','fullname','\x20-\x20','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x41b167,_0x81b7d7){var _0x5b20b3=function(_0x41178b){while(--_0x41178b){_0x41b167['push'](_0x41b167['shift']());}};_0x5b20b3(++_0x81b7d7);}(_0xce8a,0x111));var _0xace8=function(_0x4ef3f8,_0x223c5d){_0x4ef3f8=_0x4ef3f8-0x0;var _0x5a46a2=_0xce8a[_0x4ef3f8];return _0x5a46a2;};'use strict';var Sequelize=require(_0xace8('0x0'));module[_0xace8('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xace8('0x2'),'unique':_0xace8('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xace8('0x3')},'password':{'type':Sequelize[_0xace8('0x4')]},'fullname':{'type':Sequelize[_0xace8('0x4')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x167af8){this[_0xace8('0x5')](_0xace8('0x6'),typeof _0x167af8==='string'&&_0x167af8['trim']()?_0x167af8[_0xace8('0x7')]():null);}},'pager':{'type':Sequelize[_0xace8('0x4')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xace8('0x8')},'attach':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xace8('0x4')]},'callback':{'type':Sequelize[_0xace8('0x4')]},'review':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xace8('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xace8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xace8('0x9')](_0xace8('0xa'),'no'),'defaultValue':_0xace8('0xa'),'allowNull':![]},'stamp':{'type':_0xace8('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xace8('0x4')]},'maxsecs':{'type':Sequelize[_0xace8('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xace8('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xace8('0xe')],'get':function(){return this[_0xace8('0xf')](_0xace8('0x10'))+_0xace8('0x11')+this['getDataValue']('mailbox');}}};
\ No newline at end of file
+var _0xf4df=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING'];(function(_0x1a31fd,_0x537389){var _0x1453b3=function(_0x336f1d){while(--_0x336f1d){_0x1a31fd['push'](_0x1a31fd['shift']());}};_0x1453b3(++_0x537389);}(_0xf4df,0x1c5));var _0xff4d=function(_0x2cbd8c,_0x4f5428){_0x2cbd8c=_0x2cbd8c-0x0;var _0xf554ad=_0xf4df[_0x2cbd8c];return _0xf554ad;};'use strict';var Sequelize=require(_0xff4d('0x0'));module[_0xff4d('0x1')]={'customer_id':{'type':Sequelize[_0xff4d('0x2')]},'context':{'type':Sequelize[_0xff4d('0x2')],'defaultValue':_0xff4d('0x3'),'unique':_0xff4d('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xff4d('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xff4d('0x2')]},'email':{'type':Sequelize[_0xff4d('0x2')],'validate':{'isEmail':!![]},'set':function(_0xe54600){this[_0xff4d('0x5')](_0xff4d('0x6'),typeof _0xe54600===_0xff4d('0x7')&&_0xe54600[_0xff4d('0x8')]()?_0xe54600['trim']():null);}},'pager':{'type':Sequelize[_0xff4d('0x2')]},'tz':{'type':Sequelize[_0xff4d('0x2')],'defaultValue':_0xff4d('0x9')},'attach':{'type':Sequelize['ENUM'](_0xff4d('0xa'),'no'),'defaultValue':_0xff4d('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':_0xff4d('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xff4d('0x2')]},'callback':{'type':Sequelize[_0xff4d('0x2')]},'review':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xff4d('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xff4d('0xa'),'no'),'defaultValue':_0xff4d('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xff4d('0xb')](_0xff4d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xff4d('0xb')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xff4d('0x2')]},'emailbody':{'type':Sequelize[_0xff4d('0x2')]},'maxsecs':{'type':Sequelize[_0xff4d('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xff4d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xff4d('0xe')],'get':function(){return this[_0xff4d('0xf')](_0xff4d('0x10'))+_0xff4d('0x11')+this['getDataValue'](_0xff4d('0x12'));}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e6c=['sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','body','params','findOne','VoiceMailMessage','nolimit','mailbox','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x204c59,_0x5614ee){var _0x4cd35b=function(_0xf20241){while(--_0xf20241){_0x204c59['push'](_0x204c59['shift']());}};_0x4cd35b(++_0x5614ee);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){var _0x266786=_0x4c35ae[_0xc6e6('0x26')]({'plain':!![]});var _0x2e5e0e=_0xc6e6('0x27');return db['UserProfileResource'][_0xc6e6('0x25')]({'where':{'type':_0x2e5e0e,'resourceId':_0x266786['id']}})['then'](function(){return _0x4c35ae;});})[_0xc6e6('0x24')](function(){_0x36ebfa['status'](0xcc)[_0xc6e6('0x28')]();});}};}function handleEntityNotFound(_0x16dcd9,_0x348888){return function(_0x41e7c2){if(!_0x41e7c2){_0x16dcd9[_0xc6e6('0x17')](0x194);}return _0x41e7c2;};}function handleError(_0x5e34f6,_0x346480){_0x346480=_0x346480||0x1f4;return function(_0x1501bd){logger[_0xc6e6('0x29')](_0x1501bd[_0xc6e6('0x2a')]);if(_0x1501bd['name']){delete _0x1501bd[_0xc6e6('0x2b')];}_0x5e34f6['status'](_0x346480)[_0xc6e6('0x2c')](_0x1501bd);};}exports[_0xc6e6('0x2d')]=function(_0x12c616,_0xc578b3){var _0xd3b63={},_0x402598={},_0x43ff9c={'count':0x0,'rows':[]};var _0x337442=_[_0xc6e6('0x2e')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')],function(_0x214d6a){return{'name':_0x214d6a[_0xc6e6('0x31')],'type':_0x214d6a[_0xc6e6('0x32')][_0xc6e6('0x33')]};});_0x402598[_0xc6e6('0x34')]=_[_0xc6e6('0x2e')](_0x337442,'name');_0x402598[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0x12c616['query']);_0x402598['filters']=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],_0x402598[_0xc6e6('0x35')]);_0xd3b63[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],qs['fields'](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0xd3b63[_0xc6e6('0x38')]=_0xd3b63['attributes']['length']?_0xd3b63[_0xc6e6('0x38')]:_0x402598[_0xc6e6('0x34')];if(!_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x3a')]('nolimit')){_0xd3b63['limit']=qs[_0xc6e6('0x1c')](_0x12c616['query'][_0xc6e6('0x1c')]);_0xd3b63['offset']=qs[_0xc6e6('0x1a')](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0xd3b63[_0xc6e6('0x3b')]=qs['sort'](_0x12c616['query'][_0xc6e6('0x3c')]);_0xd3b63[_0xc6e6('0x3d')]=qs[_0xc6e6('0x3e')](_[_0xc6e6('0x3f')](_0x12c616['query'],_0x402598['filters']),_0x337442);if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]){_0xd3b63[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0xd3b63['where'],{'$or':_[_0xc6e6('0x2e')](_0x337442,function(_0x46c3ef){if(_0x46c3ef['type']!=='VIRTUAL'){var _0x2b01fd={};_0x2b01fd[_0x46c3ef['name']]={'$like':'%'+_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x2b01fd;}})});}_0xd3b63=_['merge']({},_0xd3b63,_0x12c616[_0xc6e6('0x42')]);var _0x50c96d={'where':_0xd3b63[_0xc6e6('0x3d')]};return db['VoiceMail'][_0xc6e6('0x1d')](_0x50c96d)[_0xc6e6('0x24')](function(_0x247076){_0x43ff9c[_0xc6e6('0x1d')]=_0x247076;if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x43')]){_0xd3b63[_0xc6e6('0x44')]=[{'all':!![]}];}return db[_0xc6e6('0x2f')][_0xc6e6('0x45')](_0xd3b63);})['then'](function(_0x3e3da6){_0x43ff9c[_0xc6e6('0x46')]=_0x3e3da6;return _0x43ff9c;})[_0xc6e6('0x24')](respondWithFilteredResult(_0xc578b3,_0xd3b63))[_0xc6e6('0x47')](handleError(_0xc578b3,null));};exports['show']=function(_0xc5f4fb,_0x825640){var _0x3a46ee={'raw':!![],'where':{'id':_0xc5f4fb['params']['id']}},_0x2fa3c5={};_0x2fa3c5[_0xc6e6('0x34')]=_[_0xc6e6('0x36')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')]);_0x2fa3c5[_0xc6e6('0x35')]=_['keys'](_0xc5f4fb[_0xc6e6('0x35')]);_0x2fa3c5['filters']=_[_0xc6e6('0x37')](_0x2fa3c5['model'],_0x2fa3c5[_0xc6e6('0x35')]);_0x3a46ee[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x2fa3c5[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xc5f4fb[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0x3a46ee[_0xc6e6('0x38')]=_0x3a46ee['attributes'][_0xc6e6('0x48')]?_0x3a46ee[_0xc6e6('0x38')]:_0x2fa3c5[_0xc6e6('0x34')];if(_0xc5f4fb['query'][_0xc6e6('0x43')]){_0x3a46ee[_0xc6e6('0x44')]=[{'all':!![]}];}_0x3a46ee=_[_0xc6e6('0x41')]({},_0x3a46ee,_0xc5f4fb[_0xc6e6('0x42')]);return db[_0xc6e6('0x2f')][_0xc6e6('0x49')](_0x3a46ee)[_0xc6e6('0x24')](handleEntityNotFound(_0x825640,null))[_0xc6e6('0x24')](respondWithResult(_0x825640,null))[_0xc6e6('0x47')](handleError(_0x825640,null));};exports[_0xc6e6('0x4a')]=function(_0x3bfe85,_0x470167){return db[_0xc6e6('0x2f')][_0xc6e6('0x4a')](_0x3bfe85['body'],{})[_0xc6e6('0x24')](function(_0x5566df){var _0x2c48e7=_0x3bfe85[_0xc6e6('0x4b')]['get']({'plain':!![]});if(!_0x2c48e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c48e7['role']==='user'){var _0x531dca=_0x5566df[_0xc6e6('0x26')]({'plain':!![]});var _0x40bbe9=_0xc6e6('0x27');return db[_0xc6e6('0x4c')][_0xc6e6('0x49')]({'where':{'name':_0x40bbe9,'userProfileId':_0x2c48e7['userProfileId']},'raw':!![]})['then'](function(_0x335229){if(_0x335229&&_0x335229[_0xc6e6('0x4d')]===0x0){return db[_0xc6e6('0x4e')][_0xc6e6('0x4a')]({'name':_0x531dca['name'],'resourceId':_0x531dca['id'],'type':_0x335229[_0xc6e6('0x2b')],'sectionId':_0x335229['id']},{})[_0xc6e6('0x24')](function(){return _0x5566df;});}else{return _0x5566df;}})[_0xc6e6('0x47')](function(_0x286dcf){logger[_0xc6e6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286dcf);throw _0x286dcf;});}return _0x5566df;})[_0xc6e6('0x24')](respondWithResult(_0x470167,0xc9))[_0xc6e6('0x47')](handleError(_0x470167,null));};exports[_0xc6e6('0x23')]=function(_0x5113e3,_0x3df0db){if(_0x5113e3[_0xc6e6('0x4f')]['id']){delete _0x5113e3[_0xc6e6('0x4f')]['id'];}return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x5113e3['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3df0db,null))[_0xc6e6('0x24')](saveUpdates(_0x5113e3[_0xc6e6('0x4f')],null))[_0xc6e6('0x24')](respondWithResult(_0x3df0db,null))[_0xc6e6('0x47')](handleError(_0x3df0db,null));};exports['destroy']=function(_0x5a7391,_0x58b09b){return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x5a7391[_0xc6e6('0x50')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x58b09b,null))[_0xc6e6('0x24')](removeEntity(_0x58b09b,null))[_0xc6e6('0x47')](handleError(_0x58b09b,null));};exports['getMessages']=function(_0xcd3d5d,_0x50f52a,_0x26f0e0){return db[_0xc6e6('0x2f')][_0xc6e6('0x51')]({'where':{'id':_0xcd3d5d['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x50f52a,null))['then'](function(_0x3b6822){var _0x50ac31;var _0x4a3bb1={},_0x18e101={};_0x18e101['model']=_['keys'](db[_0xc6e6('0x52')][_0xc6e6('0x30')]);_0x18e101[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0xcd3d5d[_0xc6e6('0x35')]);_0x18e101[_0xc6e6('0x3e')]=_[_0xc6e6('0x37')](_0x18e101[_0xc6e6('0x34')],_0x18e101['query']);_0x4a3bb1[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x18e101[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xcd3d5d['query'][_0xc6e6('0x39')]));_0x4a3bb1[_0xc6e6('0x38')]=_0x4a3bb1[_0xc6e6('0x38')]['length']?_0x4a3bb1['attributes']:_0x18e101[_0xc6e6('0x34')];if(!_0xcd3d5d['query']['hasOwnProperty'](_0xc6e6('0x53'))){_0x4a3bb1[_0xc6e6('0x1c')]=qs[_0xc6e6('0x1c')](_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x1c')]);_0x4a3bb1[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0x4a3bb1[_0xc6e6('0x3b')]=qs[_0xc6e6('0x3c')](_0xcd3d5d['query']['sort']);_0x4a3bb1[_0xc6e6('0x3d')]=qs['filters'](_['pick'](_0xcd3d5d[_0xc6e6('0x35')],_0x18e101[_0xc6e6('0x3e')]));if(_0xcd3d5d[_0xc6e6('0x35')]['filter']){_0x4a3bb1[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0x4a3bb1['where'],{'$or':_['map'](_0x4a3bb1[_0xc6e6('0x38')],function(_0x31329c){var _0x9d69b5={};_0x9d69b5[_0x31329c]={'$like':'%'+_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x9d69b5;})});}_0x4a3bb1[_0xc6e6('0x3d')]=_['merge'](_0x4a3bb1[_0xc6e6('0x3d')],{'mailboxuser':_0x3b6822[_0xc6e6('0x54')]});_0x4a3bb1=_[_0xc6e6('0x41')]({},_0x4a3bb1,_0xcd3d5d[_0xc6e6('0x42')]);return db[_0xc6e6('0x52')]['findAndCountAll'](_0x4a3bb1)[_0xc6e6('0x24')](respondWithFilteredResult(_0x50f52a,_0x4a3bb1));})[_0xc6e6('0x47')](handleError(_0x50f52a,null));};
\ No newline at end of file
+var _0xf45e=['request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource','error','stack','name','send','map','VoiceMail','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir'];(function(_0x30e3bb,_0x4626f7){var _0x1960e5=function(_0x2140c2){while(--_0x2140c2){_0x30e3bb['push'](_0x30e3bb['shift']());}};_0x1960e5(++_0x4626f7);}(_0xf45e,0x115));var _0xef45=function(_0x176ef0,_0x562c07){_0x176ef0=_0x176ef0-0x0;var _0x4752cf=_0xf45e[_0x176ef0];return _0x4752cf;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){var _0x315777=_0x7817d0['get']({'plain':!![]});var _0x208b35='Voicemails';return db[_0xef45('0x2a')][_0xef45('0x28')]({'where':{'type':_0x208b35,'resourceId':_0x315777['id']}})['then'](function(){return _0x7817d0;});})[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1096af,_0x4f8c9b){return function(_0x550e18){if(!_0x550e18){_0x1096af['sendStatus'](0x194);}return _0x550e18;};}function handleError(_0x53690e,_0x1f636f){_0x1f636f=_0x1f636f||0x1f4;return function(_0x2f72ef){logger[_0xef45('0x2b')](_0x2f72ef[_0xef45('0x2c')]);if(_0x2f72ef['name']){delete _0x2f72ef[_0xef45('0x2d')];}_0x53690e['status'](_0x1f636f)[_0xef45('0x2e')](_0x2f72ef);};}exports['index']=function(_0x3e6922,_0x5bfd2d){var _0x575734={},_0x14ce5a={},_0x3e45de={'count':0x0,'rows':[]};var _0x390a7a=_[_0xef45('0x2f')](db[_0xef45('0x30')]['rawAttributes'],function(_0x5551ce){return{'name':_0x5551ce['fieldName'],'type':_0x5551ce[_0xef45('0x31')][_0xef45('0x32')]};});_0x14ce5a[_0xef45('0x33')]=_[_0xef45('0x2f')](_0x390a7a,_0xef45('0x2d'));_0x14ce5a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x3e6922['query']);_0x14ce5a['filters']=_[_0xef45('0x36')](_0x14ce5a['model'],_0x14ce5a[_0xef45('0x34')]);_0x575734['attributes']=_[_0xef45('0x36')](_0x14ce5a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x3e6922[_0xef45('0x34')][_0xef45('0x37')]));_0x575734['attributes']=_0x575734[_0xef45('0x38')][_0xef45('0x39')]?_0x575734[_0xef45('0x38')]:_0x14ce5a['model'];if(!_0x3e6922['query'][_0xef45('0x3a')](_0xef45('0x3b'))){_0x575734['limit']=qs[_0xef45('0x20')](_0x3e6922['query']['limit']);_0x575734[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x3e6922[_0xef45('0x34')]['offset']);}_0x575734[_0xef45('0x3c')]=qs[_0xef45('0x3d')](_0x3e6922[_0xef45('0x34')][_0xef45('0x3d')]);_0x575734['where']=qs['filters'](_[_0xef45('0x3e')](_0x3e6922[_0xef45('0x34')],_0x14ce5a[_0xef45('0x3f')]),_0x390a7a);if(_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]){_0x575734[_0xef45('0x41')]=_[_0xef45('0x42')](_0x575734[_0xef45('0x41')],{'$or':_['map'](_0x390a7a,function(_0x4f5877){if(_0x4f5877[_0xef45('0x31')]!==_0xef45('0x43')){var _0x154e72={};_0x154e72[_0x4f5877[_0xef45('0x2d')]]={'$like':'%'+_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]+'%'};return _0x154e72;}})});}_0x575734=_[_0xef45('0x42')]({},_0x575734,_0x3e6922[_0xef45('0x44')]);var _0x3a5082={'where':_0x575734[_0xef45('0x41')]};return db[_0xef45('0x30')][_0xef45('0x21')](_0x3a5082)[_0xef45('0x29')](function(_0xd7d217){_0x3e45de[_0xef45('0x21')]=_0xd7d217;if(_0x3e6922[_0xef45('0x34')]['includeAll']){_0x575734[_0xef45('0x45')]=[{'all':!![]}];}return db[_0xef45('0x30')][_0xef45('0x46')](_0x575734);})[_0xef45('0x29')](function(_0x54ccb8){_0x3e45de[_0xef45('0x47')]=_0x54ccb8;return _0x3e45de;})['then'](respondWithFilteredResult(_0x5bfd2d,_0x575734))[_0xef45('0x48')](handleError(_0x5bfd2d,null));};exports['show']=function(_0x5faf67,_0x2d086f){var _0x2236d9={'raw':!![],'where':{'id':_0x5faf67[_0xef45('0x49')]['id']}},_0x36e81a={};_0x36e81a[_0xef45('0x33')]=_[_0xef45('0x35')](db['VoiceMail'][_0xef45('0x4a')]);_0x36e81a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5faf67[_0xef45('0x34')]);_0x36e81a[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],_0x36e81a[_0xef45('0x34')]);_0x2236d9[_0xef45('0x38')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x5faf67[_0xef45('0x34')][_0xef45('0x37')]));_0x2236d9[_0xef45('0x38')]=_0x2236d9['attributes'][_0xef45('0x39')]?_0x2236d9[_0xef45('0x38')]:_0x36e81a[_0xef45('0x33')];if(_0x5faf67['query']['includeAll']){_0x2236d9['include']=[{'all':!![]}];}_0x2236d9=_[_0xef45('0x42')]({},_0x2236d9,_0x5faf67[_0xef45('0x44')]);return db[_0xef45('0x30')][_0xef45('0x4b')](_0x2236d9)[_0xef45('0x29')](handleEntityNotFound(_0x2d086f,null))[_0xef45('0x29')](respondWithResult(_0x2d086f,null))['catch'](handleError(_0x2d086f,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){return db['VoiceMail']['create'](_0x463796[_0xef45('0x4d')],{})[_0xef45('0x29')](function(_0x4feeb1){var _0x1a56ae=_0x463796[_0xef45('0x4e')][_0xef45('0x4f')]({'plain':!![]});if(!_0x1a56ae)throw new Error(_0xef45('0x50'));if(_0x1a56ae[_0xef45('0x51')]===_0xef45('0x4e')){var _0x23581f=_0x4feeb1[_0xef45('0x4f')]({'plain':!![]});var _0x1961b4=_0xef45('0x52');return db[_0xef45('0x53')][_0xef45('0x4b')]({'where':{'name':_0x1961b4,'userProfileId':_0x1a56ae[_0xef45('0x54')]},'raw':!![]})[_0xef45('0x29')](function(_0x48a391){if(_0x48a391&&_0x48a391[_0xef45('0x55')]===0x0){return db[_0xef45('0x2a')][_0xef45('0x4c')]({'name':_0x23581f['name'],'resourceId':_0x23581f['id'],'type':_0x48a391[_0xef45('0x2d')],'sectionId':_0x48a391['id']},{})[_0xef45('0x29')](function(){return _0x4feeb1;});}else{return _0x4feeb1;}})[_0xef45('0x48')](function(_0x1531ea){logger['error'](_0xef45('0x56'),_0x1531ea);throw _0x1531ea;});}return _0x4feeb1;})[_0xef45('0x29')](respondWithResult(_0x2b2419,0xc9))[_0xef45('0x48')](handleError(_0x2b2419,null));};exports[_0xef45('0x57')]=function(_0x67d57b,_0x41f575){if(_0x67d57b[_0xef45('0x4d')]['id']){delete _0x67d57b[_0xef45('0x4d')]['id'];}return db[_0xef45('0x30')][_0xef45('0x4b')]({'where':{'id':_0x67d57b[_0xef45('0x49')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x41f575,null))['then'](saveUpdates(_0x67d57b[_0xef45('0x4d')],null))[_0xef45('0x29')](respondWithResult(_0x41f575,null))[_0xef45('0x48')](handleError(_0x41f575,null));};exports[_0xef45('0x28')]=function(_0x2fe9cf,_0x32232f){return db['VoiceMail']['find']({'where':{'id':_0x2fe9cf[_0xef45('0x49')]['id']}})['then'](handleEntityNotFound(_0x32232f,null))[_0xef45('0x29')](removeEntity(_0x32232f,null))[_0xef45('0x48')](handleError(_0x32232f,null));};exports[_0xef45('0x58')]=function(_0x5676fb,_0x16b04e,_0x398dc0){return db['VoiceMail'][_0xef45('0x59')]({'where':{'id':_0x5676fb['params']['id']}})['then'](handleEntityNotFound(_0x16b04e,null))[_0xef45('0x29')](function(_0x4f78ac){var _0x189f22;var _0x3fbc26={},_0x22fd64={};_0x22fd64['model']=_[_0xef45('0x35')](db[_0xef45('0x5a')]['rawAttributes']);_0x22fd64[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5676fb[_0xef45('0x34')]);_0x22fd64[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x22fd64[_0xef45('0x33')],_0x22fd64[_0xef45('0x34')]);_0x3fbc26[_0xef45('0x38')]=_['intersection'](_0x22fd64[_0xef45('0x33')],qs['fields'](_0x5676fb['query'][_0xef45('0x37')]));_0x3fbc26['attributes']=_0x3fbc26[_0xef45('0x38')][_0xef45('0x39')]?_0x3fbc26['attributes']:_0x22fd64[_0xef45('0x33')];if(!_0x5676fb[_0xef45('0x34')][_0xef45('0x3a')](_0xef45('0x3b'))){_0x3fbc26[_0xef45('0x20')]=qs[_0xef45('0x20')](_0x5676fb['query'][_0xef45('0x20')]);_0x3fbc26[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x5676fb[_0xef45('0x34')][_0xef45('0x1e')]);}_0x3fbc26['order']=qs[_0xef45('0x3d')](_0x5676fb['query'][_0xef45('0x3d')]);_0x3fbc26[_0xef45('0x41')]=qs['filters'](_[_0xef45('0x3e')](_0x5676fb[_0xef45('0x34')],_0x22fd64[_0xef45('0x3f')]));if(_0x5676fb['query']['filter']){_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'$or':_['map'](_0x3fbc26[_0xef45('0x38')],function(_0x3956b0){var _0x49131e={};_0x49131e[_0x3956b0]={'$like':'%'+_0x5676fb[_0xef45('0x34')]['filter']+'%'};return _0x49131e;})});}_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'mailboxuser':_0x4f78ac[_0xef45('0x5b')]});_0x3fbc26=_[_0xef45('0x42')]({},_0x3fbc26,_0x5676fb[_0xef45('0x44')]);return db[_0xef45('0x5a')][_0xef45('0x5c')](_0x3fbc26)['then'](respondWithFilteredResult(_0x16b04e,_0x3fbc26));})[_0xef45('0x48')](handleError(_0x16b04e,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bce=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x5c74db,_0x478ac1){var _0x37ec4d=function(_0x4b2291){while(--_0x4b2291){_0x5c74db['push'](_0x5c74db['shift']());}};_0x37ec4d(++_0x478ac1);}(_0x9bce,0x151));var _0xe9bc=function(_0x3b2fbe,_0x3663ed){_0x3b2fbe=_0x3b2fbe-0x0;var _0x2834c9=_0x9bce[_0x3b2fbe];return _0x2834c9;};'use strict';var _=require('lodash');var util=require(_0xe9bc('0x0'));var logger=require(_0xe9bc('0x1'))(_0xe9bc('0x2'));var moment=require('moment');var BPromise=require(_0xe9bc('0x3'));var rp=require(_0xe9bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9bc('0x5'));var config=require(_0xe9bc('0x6'));var attributes=require(_0xe9bc('0x7'));module[_0xe9bc('0x8')]=function(_0x396721,_0x6fbf67){return _0x396721[_0xe9bc('0x9')](_0xe9bc('0xa'),attributes,{'tableName':_0xe9bc('0xb'),'paranoid':![],'indexes':[{'name':_0xe9bc('0xc'),'fields':[_0xe9bc('0xd'),_0xe9bc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7812=['mailbox_context','mailbox','context','lodash','util','../../config/logger','api','request-promise','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0x7812,0x16f));var _0x2781=function(_0x16d159,_0x5bbd37){_0x16d159=_0x16d159-0x0;var _0x2da1ab=_0x7812[_0x16d159];return _0x2da1ab;};'use strict';var _=require(_0x2781('0x0'));var util=require(_0x2781('0x1'));var logger=require(_0x2781('0x2'))(_0x2781('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2781('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2781('0x5'));var attributes=require(_0x2781('0x6'));module['exports']=function(_0x30fc25,_0x368896){return _0x30fc25[_0x2781('0x7')](_0x2781('0x8'),attributes,{'tableName':_0x2781('0x9'),'paranoid':![],'indexes':[{'name':_0x2781('0xa'),'fields':[_0x2781('0xb'),_0x2781('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca7f=['then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x140c4c,_0x17b9ec){var _0x11ef65=function(_0x4f5ffc){while(--_0x4f5ffc){_0x140c4c['push'](_0x140c4c['shift']());}};_0x11ef65(++_0x17b9ec);}(_0xca7f,0x68));var _0xfca7=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xca7f[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xfca7('0x0'));var util=require(_0xfca7('0x1'));var moment=require(_0xfca7('0x2'));var BPromise=require('bluebird');var rs=require(_0xfca7('0x3'));var fs=require('fs');var Redis=require(_0xfca7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfca7('0x5'));var logger=require(_0xfca7('0x6'))('rpc');var config=require(_0xfca7('0x7'));var jayson=require(_0xfca7('0x8'));var client=jayson['client'][_0xfca7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a76ed,_0xd5b135,_0x5232e3){return new BPromise(function(_0x6ca47e,_0x3eac5a){return client[_0xfca7('0xa')](_0x5a76ed,_0x5232e3)[_0xfca7('0xb')](function(_0x1c165a){logger[_0xfca7('0xc')]('VoiceMail,\x20%s,\x20%s',_0xd5b135,_0xfca7('0xd'));logger[_0xfca7('0xe')](_0xfca7('0xf'),_0xd5b135,_0xfca7('0xd'),JSON[_0xfca7('0x10')](_0x1c165a));if(_0x1c165a[_0xfca7('0x11')]){if(_0x1c165a[_0xfca7('0x11')][_0xfca7('0x12')]===0x1f4){logger[_0xfca7('0x11')](_0xfca7('0x13'),_0xd5b135,_0x1c165a['error'][_0xfca7('0x14')]);return _0x3eac5a(_0x1c165a['error'][_0xfca7('0x14')]);}logger[_0xfca7('0x11')](_0xfca7('0x13'),_0xd5b135,_0x1c165a['error'][_0xfca7('0x14')]);return _0x6ca47e(_0x1c165a[_0xfca7('0x11')][_0xfca7('0x14')]);}else{logger[_0xfca7('0xc')]('VoiceMail,\x20%s,\x20%s',_0xd5b135,_0xfca7('0xd'));_0x6ca47e(_0x1c165a[_0xfca7('0x15')][_0xfca7('0x14')]);}})[_0xfca7('0x16')](function(_0x590d05){logger['error']('VoiceMail,\x20%s,\x20%s',_0xd5b135,_0x590d05);_0x3eac5a(_0x590d05);});});}
\ No newline at end of file
+var _0x81c6=['rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x81c6,0x117));var _0x681c=function(_0x5ace25,_0x536239){_0x5ace25=_0x5ace25-0x0;var _0x4ba17a=_0x81c6[_0x5ace25];return _0x4ba17a;};'use strict';var _=require(_0x681c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rs=require(_0x681c('0x2'));var fs=require('fs');var Redis=require(_0x681c('0x3'));var db=require(_0x681c('0x4'))['db'];var utils=require(_0x681c('0x5'));var logger=require(_0x681c('0x6'))(_0x681c('0x7'));var config=require(_0x681c('0x8'));var jayson=require(_0x681c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x587de6,_0x5c5976,_0x19f342){return new BPromise(function(_0xcbf9cc,_0x5bad22){return client[_0x681c('0xa')](_0x587de6,_0x19f342)[_0x681c('0xb')](function(_0x4b20de){logger['info']('VoiceMail,\x20%s,\x20%s',_0x5c5976,_0x681c('0xc'));logger[_0x681c('0xd')](_0x681c('0xe'),_0x5c5976,_0x681c('0xc'),JSON[_0x681c('0xf')](_0x4b20de));if(_0x4b20de[_0x681c('0x10')]){if(_0x4b20de['error'][_0x681c('0x11')]===0x1f4){logger[_0x681c('0x10')]('VoiceMail,\x20%s,\x20%s',_0x5c5976,_0x4b20de[_0x681c('0x10')]['message']);return _0x5bad22(_0x4b20de[_0x681c('0x10')][_0x681c('0x12')]);}logger[_0x681c('0x10')](_0x681c('0x13'),_0x5c5976,_0x4b20de[_0x681c('0x10')]['message']);return _0xcbf9cc(_0x4b20de['error'][_0x681c('0x12')]);}else{logger[_0x681c('0x14')]('VoiceMail,\x20%s,\x20%s',_0x5c5976,'request\x20sent');_0xcbf9cc(_0x4b20de['result'][_0x681c('0x12')]);}})[_0x681c('0x15')](function(_0x39a160){logger['error'](_0x681c('0x13'),_0x5c5976,_0x39a160);_0x5bad22(_0x39a160);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbf7=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','get','/:id','show','/:id/download','post','create','put','update','destroy'];(function(_0x4fb017,_0x2af811){var _0x59b1c9=function(_0x2bea51){while(--_0x2bea51){_0x4fb017['push'](_0x4fb017['shift']());}};_0x59b1c9(++_0x2af811);}(_0xdbf7,0x120));var _0x7dbf=function(_0x2384df,_0x44eefd){_0x2384df=_0x2384df-0x0;var _0x741672=_0xdbf7[_0x2384df];return _0x741672;};'use strict';var multer=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var path=require('path');var timeout=require(_0x7dbf('0x2'));var express=require(_0x7dbf('0x3'));var router=express[_0x7dbf('0x4')]();var fs_extra=require(_0x7dbf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7dbf('0x6'));var config=require('../../config/environment');var controller=require(_0x7dbf('0x7'));router['get']('/',auth[_0x7dbf('0x8')](),controller['index']);router[_0x7dbf('0x9')](_0x7dbf('0xa'),auth[_0x7dbf('0x8')](),controller[_0x7dbf('0xb')]);router[_0x7dbf('0x9')](_0x7dbf('0xc'),auth[_0x7dbf('0x8')](),controller['download']);router[_0x7dbf('0xd')]('/',auth['isAuthenticated'](),controller[_0x7dbf('0xe')]);router[_0x7dbf('0xf')](_0x7dbf('0xa'),auth['isAuthenticated'](),controller[_0x7dbf('0x10')]);router['delete'](_0x7dbf('0xa'),auth[_0x7dbf('0x8')](),controller[_0x7dbf('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0d5a=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d5a,0xd0));var _0xa0d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0d5a[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xa0d5('0x0'));var util=require(_0xa0d5('0x1'));var path=require(_0xa0d5('0x2'));var timeout=require(_0xa0d5('0x3'));var express=require('express');var router=express[_0xa0d5('0x4')]();var fs_extra=require(_0xa0d5('0x5'));var auth=require(_0xa0d5('0x6'));var interaction=require(_0xa0d5('0x7'));var config=require(_0xa0d5('0x8'));var controller=require(_0xa0d5('0x9'));router[_0xa0d5('0xa')]('/',auth[_0xa0d5('0xb')](),controller[_0xa0d5('0xc')]);router[_0xa0d5('0xa')](_0xa0d5('0xd'),auth['isAuthenticated'](),controller[_0xa0d5('0xe')]);router[_0xa0d5('0xa')](_0xa0d5('0xf'),auth[_0xa0d5('0xb')](),controller[_0xa0d5('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa0d5('0x11')]);router[_0xa0d5('0x12')](_0xa0d5('0xd'),auth['isAuthenticated'](),controller[_0xa0d5('0x13')]);router[_0xa0d5('0x14')](_0xa0d5('0xd'),auth[_0xa0d5('0xb')](),controller[_0xa0d5('0x15')]);module[_0xa0d5('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b6b=['BLOB','long','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x429f3f,_0x4c17d0){var _0x26491d=function(_0x3e7aed){while(--_0x3e7aed){_0x429f3f['push'](_0x429f3f['shift']());}};_0x26491d(++_0x4c17d0);}(_0x7b6b,0xf6));var _0xb7b6=function(_0x35ff9f,_0x501de5){_0x35ff9f=_0x35ff9f-0x0;var _0x9c0c7c=_0x7b6b[_0x35ff9f];return _0x9c0c7c;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module[_0xb7b6('0x1')]={'name':{'type':Sequelize[_0xb7b6('0x2')],'get':function(_0x25f579){return this[_0xb7b6('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xb7b6('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xb7b6('0x6')](_0xb7b6('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb7b6('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb7b6('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
+var _0x5371=['VIRTUAL','STRING','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x10a6c5,_0x3b8168){var _0x79e4b8=function(_0x4699c8){while(--_0x4699c8){_0x10a6c5['push'](_0x10a6c5['shift']());}};_0x79e4b8(++_0x3b8168);}(_0x5371,0x1bb));var _0x1537=function(_0xded7ee,_0x1db18c){_0xded7ee=_0xded7ee-0x0;var _0x2d2f4f=_0x5371[_0xded7ee];return _0x2d2f4f;};'use strict';var Sequelize=require(_0x1537('0x0'));module['exports']={'name':{'type':Sequelize[_0x1537('0x1')],'get':function(_0x596bf7){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x1537('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0x1537('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x1537('0x4'),'defaultValue':Sequelize['literal'](_0x1537('0x5'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x900d=['order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','.wav\x22','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','VoiceMailMessage','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x900d,0x1af));var _0xd900=function(_0x243ed8,_0x36e82c){_0x243ed8=_0x243ed8-0x0;var _0x89344e=_0x900d[_0x243ed8];return _0x89344e;};'use strict';var emlformat=require(_0xd900('0x0'));var rimraf=require(_0xd900('0x1'));var zipdir=require(_0xd900('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd900('0x3'));var moment=require(_0xd900('0x4'));var BPromise=require(_0xd900('0x5'));var Mustache=require('mustache');var util=require(_0xd900('0x6'));var path=require(_0xd900('0x7'));var sox=require(_0xd900('0x8'));var csv=require('to-csv');var ejs=require(_0xd900('0x9'));var fs=require('fs');var fs_extra=require(_0xd900('0xa'));var _=require(_0xd900('0xb'));var squel=require(_0xd900('0xc'));var crypto=require('crypto');var jsforce=require(_0xd900('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd900('0xe'));var querystring=require(_0xd900('0xf'));var Papa=require(_0xd900('0x10'));var Redis=require('ioredis');var authService=require(_0xd900('0x11'));var qs=require(_0xd900('0x12'));var as=require(_0xd900('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd900('0x14'))('api');var utils=require(_0xd900('0x15'));var config=require(_0xd900('0x16'));var licenseUtil=require(_0xd900('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a2417,_0x1ef915){_0x1ef915=_0x1ef915||0xcc;return function(_0x1806e6){if(_0x1806e6){return _0x3a2417['sendStatus'](_0x1ef915);}return _0x3a2417['status'](_0x1ef915)[_0xd900('0x18')]();};}function respondWithResult(_0x47d2e5,_0x27cb22){_0x27cb22=_0x27cb22||0xc8;return function(_0x38020d){if(_0x38020d){return _0x47d2e5['status'](_0x27cb22)['json'](_0x38020d);}};}function respondWithFilteredResult(_0x1e0cff,_0x191c09){return function(_0x22ede8){if(_0x22ede8){var _0x19089b=typeof _0x191c09['offset']===_0xd900('0x19')&&typeof _0x191c09[_0xd900('0x1a')]==='undefined';var _0x1c254b=_0x22ede8[_0xd900('0x1b')];var _0x5150f4=_0x19089b?0x0:_0x191c09['offset'];var _0xea6479=_0x19089b?_0x22ede8['count']:_0x191c09[_0xd900('0x1c')]+_0x191c09[_0xd900('0x1a')];var _0x2ca8e2;if(_0xea6479>=_0x1c254b){_0xea6479=_0x1c254b;_0x2ca8e2=0xc8;}else{_0x2ca8e2=0xce;}_0x1e0cff[_0xd900('0x1d')](_0x2ca8e2);return _0x1e0cff[_0xd900('0x1e')](_0xd900('0x1f'),_0x5150f4+'-'+_0xea6479+'/'+_0x1c254b)[_0xd900('0x20')](_0x22ede8);}return null;};}function patchUpdates(_0x205bd3){return function(_0x3ae505){try{jsonpatch[_0xd900('0x21')](_0x3ae505,_0x205bd3,!![]);}catch(_0x2c0685){return BPromise[_0xd900('0x22')](_0x2c0685);}return _0x3ae505[_0xd900('0x23')]();};}function saveUpdates(_0x32d739,_0x2a75d7){return function(_0x179159){if(_0x179159){return _0x179159[_0xd900('0x24')](_0x32d739)[_0xd900('0x25')](function(_0x3dfd76){return _0x3dfd76;});}return null;};}function removeEntity(_0x591c99,_0x3edfc1){return function(_0x169a44){if(_0x169a44){return _0x169a44[_0xd900('0x26')]()[_0xd900('0x25')](function(){_0x591c99[_0xd900('0x1d')](0xcc)[_0xd900('0x18')]();});}};}function handleEntityNotFound(_0xfe430b,_0x1c258b){return function(_0x4f6270){if(!_0x4f6270){_0xfe430b['sendStatus'](0x194);}return _0x4f6270;};}function handleError(_0x24da77,_0x2b4b08){_0x2b4b08=_0x2b4b08||0x1f4;return function(_0x278dec){logger['error'](_0x278dec['stack']);if(_0x278dec['name']){delete _0x278dec[_0xd900('0x27')];}_0x24da77['status'](_0x2b4b08)['send'](_0x278dec);};}exports['index']=function(_0x1acca0,_0x1ecd9e){var _0x46d9df={},_0x43c671={},_0x3d8345={'count':0x0,'rows':[]};var _0x3f0732=_[_0xd900('0x28')](db[_0xd900('0x29')][_0xd900('0x2a')],function(_0x52750e){return{'name':_0x52750e[_0xd900('0x2b')],'type':_0x52750e[_0xd900('0x2c')]['key']};});_0x43c671[_0xd900('0x2d')]=_['differenceBy'](_[_0xd900('0x28')](_0x3f0732,_0xd900('0x27')),[_0xd900('0x27')]);_0x43c671['query']=_[_0xd900('0x2e')](_0x1acca0['query']);_0x43c671[_0xd900('0x2f')]=_['intersection'](_0x43c671[_0xd900('0x2d')],_0x43c671[_0xd900('0x30')]);_0x46d9df[_0xd900('0x31')]=_[_0xd900('0x32')](_0x43c671['model'],qs[_0xd900('0x33')](_0x1acca0[_0xd900('0x30')][_0xd900('0x33')]));_0x46d9df[_0xd900('0x31')]=_0x46d9df[_0xd900('0x31')][_0xd900('0x34')]?_0x46d9df['attributes']:_0x43c671['model'];if(!_0x1acca0['query'][_0xd900('0x35')](_0xd900('0x36'))){_0x46d9df[_0xd900('0x1a')]=qs[_0xd900('0x1a')](_0x1acca0['query'][_0xd900('0x1a')]);_0x46d9df[_0xd900('0x1c')]=qs[_0xd900('0x1c')](_0x1acca0[_0xd900('0x30')][_0xd900('0x1c')]);}_0x46d9df[_0xd900('0x37')]=qs[_0xd900('0x38')](_0x1acca0['query'][_0xd900('0x38')]);_0x46d9df[_0xd900('0x39')]=qs['filters'](_[_0xd900('0x3a')](_0x1acca0[_0xd900('0x30')],_0x43c671[_0xd900('0x2f')]),_0x3f0732);if(_0x1acca0['query'][_0xd900('0x3b')]){_0x46d9df[_0xd900('0x39')]=_[_0xd900('0x3c')](_0x46d9df[_0xd900('0x39')],{'$or':_[_0xd900('0x28')](_0x3f0732,function(_0x17bac8){if(_0x17bac8[_0xd900('0x2c')]!==_0xd900('0x3d')){var _0x47471f={};_0x47471f[_0x17bac8['name']]={'$like':'%'+_0x1acca0[_0xd900('0x30')][_0xd900('0x3b')]+'%'};return _0x47471f;}})});}_0x46d9df=_[_0xd900('0x3c')]({},_0x46d9df,_0x1acca0[_0xd900('0x3e')]);var _0x2ef02e={'where':_0x46d9df['where']};return db['VoiceMailMessage'][_0xd900('0x1b')](_0x2ef02e)[_0xd900('0x25')](function(_0x3dfae9){_0x3d8345[_0xd900('0x1b')]=_0x3dfae9;if(_0x1acca0[_0xd900('0x30')]['includeAll']){_0x46d9df[_0xd900('0x3f')]=[{'all':!![]}];}return db[_0xd900('0x29')][_0xd900('0x40')](_0x46d9df);})[_0xd900('0x25')](function(_0x340e16){_0x3d8345[_0xd900('0x41')]=_0x340e16;return _0x3d8345;})['then'](respondWithFilteredResult(_0x1ecd9e,_0x46d9df))['catch'](handleError(_0x1ecd9e,null));};exports[_0xd900('0x42')]=function(_0x339f6b,_0x1af1f4){var _0x2a2e9a={'raw':!![],'where':{'id':_0x339f6b[_0xd900('0x43')]['id']}},_0x29f040={};_0x29f040[_0xd900('0x2d')]=_[_0xd900('0x2e')](db[_0xd900('0x29')][_0xd900('0x2a')]);_0x29f040[_0xd900('0x30')]=_[_0xd900('0x2e')](_0x339f6b['query']);_0x29f040['filters']=_[_0xd900('0x32')](_0x29f040[_0xd900('0x2d')],_0x29f040['query']);_0x2a2e9a[_0xd900('0x31')]=_[_0xd900('0x32')](_0x29f040[_0xd900('0x2d')],qs[_0xd900('0x33')](_0x339f6b[_0xd900('0x30')]['fields']));_0x2a2e9a[_0xd900('0x31')]=_0x2a2e9a[_0xd900('0x31')][_0xd900('0x34')]?_0x2a2e9a[_0xd900('0x31')]:_0x29f040[_0xd900('0x2d')];if(_0x339f6b[_0xd900('0x30')]['includeAll']){_0x2a2e9a[_0xd900('0x3f')]=[{'all':!![]}];}_0x2a2e9a=_[_0xd900('0x3c')]({},_0x2a2e9a,_0x339f6b[_0xd900('0x3e')]);return db['VoiceMailMessage'][_0xd900('0x44')](_0x2a2e9a)['then'](handleEntityNotFound(_0x1af1f4,null))['then'](respondWithResult(_0x1af1f4,null))[_0xd900('0x45')](handleError(_0x1af1f4,null));};exports[_0xd900('0x46')]=function(_0x1d655c,_0xe39e49){return db[_0xd900('0x29')][_0xd900('0x46')](_0x1d655c[_0xd900('0x47')],{})['then'](respondWithResult(_0xe39e49,0xc9))[_0xd900('0x45')](handleError(_0xe39e49,null));};exports[_0xd900('0x24')]=function(_0x454103,_0xe688f8){if(_0x454103[_0xd900('0x47')]['id']){delete _0x454103['body']['id'];}return db[_0xd900('0x29')]['find']({'where':{'id':_0x454103['params']['id']}})['then'](handleEntityNotFound(_0xe688f8,null))[_0xd900('0x25')](saveUpdates(_0x454103['body'],null))[_0xd900('0x25')](respondWithResult(_0xe688f8,null))['catch'](handleError(_0xe688f8,null));};exports[_0xd900('0x26')]=function(_0x4f6ebc,_0x3db10b){return db[_0xd900('0x29')]['find']({'where':{'id':_0x4f6ebc[_0xd900('0x43')]['id']}})[_0xd900('0x25')](handleEntityNotFound(_0x3db10b,null))[_0xd900('0x25')](removeEntity(_0x3db10b,null))['catch'](handleError(_0x3db10b,null));};exports[_0xd900('0x48')]=function(_0x3fd2f6,_0x1cfb8a,_0x392aef){return db[_0xd900('0x29')]['find']({'where':{'id':_0x3fd2f6[_0xd900('0x43')]['id']},'attributes':['id',_0xd900('0x49'),_0xd900('0x4a')]})[_0xd900('0x25')](handleEntityNotFound(_0x1cfb8a,null))[_0xd900('0x25')](function(_0x1efca4){if(_0x1efca4){if(!_0x1efca4[_0xd900('0x49')]){throw new db['Sequelize'][(_0xd900('0x4b'))](_0xd900('0x4c'));}var _0x535138={'Content-Type':_0xd900('0x4d'),'Content-Disposition':'attachment'};if(_0x1efca4[_0xd900('0x4a')]){_0x535138[_0xd900('0x4e')]='attachment;\x20filename=\x22'+_0x1efca4[_0xd900('0x4a')]+_0xd900('0x4f');}_0x1cfb8a[_0xd900('0x1e')](_0x535138);return _0x1cfb8a[_0xd900('0x50')](new Buffer(_0x1efca4[_0xd900('0x49')]));}})[_0xd900('0x45')](handleError(_0x1cfb8a,null));};
\ No newline at end of file
+var _0x929e=['then','error','stack','name','send','index','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','VoiceMailMessage','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','download','msg_id','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','recording','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0x4a367f,_0x4e05f2){var _0x2bedd5=function(_0x5b5e70){while(--_0x5b5e70){_0x4a367f['push'](_0x4a367f['shift']());}};_0x2bedd5(++_0x4e05f2);}(_0x929e,0xd0));var _0xe929=function(_0x190d8d,_0x21006a){_0x190d8d=_0x190d8d-0x0;var _0x836259=_0x929e[_0x190d8d];return _0x836259;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe929('0x0'));var zipdir=require(_0xe929('0x1'));var jsonpatch=require(_0xe929('0x2'));var rp=require(_0xe929('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe929('0x4'));var util=require(_0xe929('0x5'));var path=require(_0xe929('0x6'));var sox=require(_0xe929('0x7'));var csv=require(_0xe929('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe929('0x9'));var _=require('lodash');var squel=require(_0xe929('0xa'));var crypto=require(_0xe929('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe929('0xc'));var toCsv=require(_0xe929('0x8'));var querystring=require(_0xe929('0xd'));var Papa=require(_0xe929('0xe'));var Redis=require(_0xe929('0xf'));var authService=require(_0xe929('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe929('0x11'));var logger=require(_0xe929('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe929('0x13'));var licenseUtil=require(_0xe929('0x14'));var db=require(_0xe929('0x15'))['db'];function respondWithStatusCode(_0x2cee00,_0x410540){_0x410540=_0x410540||0xcc;return function(_0x110cf8){if(_0x110cf8){return _0x2cee00[_0xe929('0x16')](_0x410540);}return _0x2cee00[_0xe929('0x17')](_0x410540)[_0xe929('0x18')]();};}function respondWithResult(_0x452d93,_0x1e0d26){_0x1e0d26=_0x1e0d26||0xc8;return function(_0x41697c){if(_0x41697c){return _0x452d93[_0xe929('0x17')](_0x1e0d26)['json'](_0x41697c);}};}function respondWithFilteredResult(_0x2e0247,_0x30855){return function(_0x1488a8){if(_0x1488a8){var _0x5dc2ba=typeof _0x30855['offset']===_0xe929('0x19')&&typeof _0x30855[_0xe929('0x1a')]===_0xe929('0x19');var _0x3561cb=_0x1488a8[_0xe929('0x1b')];var _0x1c5e5a=_0x5dc2ba?0x0:_0x30855['offset'];var _0xfd13e9=_0x5dc2ba?_0x1488a8[_0xe929('0x1b')]:_0x30855[_0xe929('0x1c')]+_0x30855[_0xe929('0x1a')];var _0x4ff99d;if(_0xfd13e9>=_0x3561cb){_0xfd13e9=_0x3561cb;_0x4ff99d=0xc8;}else{_0x4ff99d=0xce;}_0x2e0247[_0xe929('0x17')](_0x4ff99d);return _0x2e0247[_0xe929('0x1d')](_0xe929('0x1e'),_0x1c5e5a+'-'+_0xfd13e9+'/'+_0x3561cb)[_0xe929('0x1f')](_0x1488a8);}return null;};}function patchUpdates(_0x43ff95){return function(_0x235289){try{jsonpatch[_0xe929('0x20')](_0x235289,_0x43ff95,!![]);}catch(_0x53a5d2){return BPromise[_0xe929('0x21')](_0x53a5d2);}return _0x235289[_0xe929('0x22')]();};}function saveUpdates(_0xfe720b,_0x56c41b){return function(_0x55f565){if(_0x55f565){return _0x55f565['update'](_0xfe720b)[_0xe929('0x23')](function(_0x5effcc){return _0x5effcc;});}return null;};}function removeEntity(_0xa135,_0x12b9ed){return function(_0x3659aa){if(_0x3659aa){return _0x3659aa['destroy']()[_0xe929('0x23')](function(){_0xa135[_0xe929('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea186,_0x1fac3f){return function(_0x3f5fda){if(!_0x3f5fda){_0x3ea186[_0xe929('0x16')](0x194);}return _0x3f5fda;};}function handleError(_0x2deb67,_0x29456d){_0x29456d=_0x29456d||0x1f4;return function(_0x1e2d18){logger[_0xe929('0x24')](_0x1e2d18[_0xe929('0x25')]);if(_0x1e2d18[_0xe929('0x26')]){delete _0x1e2d18[_0xe929('0x26')];}_0x2deb67[_0xe929('0x17')](_0x29456d)[_0xe929('0x27')](_0x1e2d18);};}exports[_0xe929('0x28')]=function(_0x13af75,_0x4954d1){var _0x339d7b={},_0x59cf6c={},_0x51cdf5={'count':0x0,'rows':[]};var _0xce73e8=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x484614){return{'name':_0x484614[_0xe929('0x29')],'type':_0x484614[_0xe929('0x2a')][_0xe929('0x2b')]};});_0x59cf6c[_0xe929('0x2c')]=_[_0xe929('0x2d')](_['map'](_0xce73e8,_0xe929('0x26')),[_0xe929('0x26')]);_0x59cf6c[_0xe929('0x2e')]=_[_0xe929('0x2f')](_0x13af75[_0xe929('0x2e')]);_0x59cf6c[_0xe929('0x30')]=_[_0xe929('0x31')](_0x59cf6c[_0xe929('0x2c')],_0x59cf6c['query']);_0x339d7b[_0xe929('0x32')]=_[_0xe929('0x31')](_0x59cf6c['model'],qs[_0xe929('0x33')](_0x13af75['query'][_0xe929('0x33')]));_0x339d7b[_0xe929('0x32')]=_0x339d7b[_0xe929('0x32')][_0xe929('0x34')]?_0x339d7b[_0xe929('0x32')]:_0x59cf6c['model'];if(!_0x13af75[_0xe929('0x2e')]['hasOwnProperty'](_0xe929('0x35'))){_0x339d7b[_0xe929('0x1a')]=qs[_0xe929('0x1a')](_0x13af75['query'][_0xe929('0x1a')]);_0x339d7b[_0xe929('0x1c')]=qs['offset'](_0x13af75[_0xe929('0x2e')]['offset']);}_0x339d7b[_0xe929('0x36')]=qs[_0xe929('0x37')](_0x13af75[_0xe929('0x2e')]['sort']);_0x339d7b[_0xe929('0x38')]=qs[_0xe929('0x30')](_[_0xe929('0x39')](_0x13af75[_0xe929('0x2e')],_0x59cf6c['filters']),_0xce73e8);if(_0x13af75['query']['filter']){_0x339d7b[_0xe929('0x38')]=_[_0xe929('0x3a')](_0x339d7b[_0xe929('0x38')],{'$or':_[_0xe929('0x3b')](_0xce73e8,function(_0x4a5c1c){if(_0x4a5c1c['type']!==_0xe929('0x3c')){var _0x136b91={};_0x136b91[_0x4a5c1c['name']]={'$like':'%'+_0x13af75[_0xe929('0x2e')][_0xe929('0x3d')]+'%'};return _0x136b91;}})});}_0x339d7b=_[_0xe929('0x3a')]({},_0x339d7b,_0x13af75[_0xe929('0x3e')]);var _0x25e2b3={'where':_0x339d7b[_0xe929('0x38')]};return db[_0xe929('0x3f')][_0xe929('0x1b')](_0x25e2b3)[_0xe929('0x23')](function(_0x4cdbde){_0x51cdf5[_0xe929('0x1b')]=_0x4cdbde;if(_0x13af75['query']['includeAll']){_0x339d7b[_0xe929('0x40')]=[{'all':!![]}];}return db[_0xe929('0x3f')]['findAll'](_0x339d7b);})[_0xe929('0x23')](function(_0x17c526){_0x51cdf5[_0xe929('0x41')]=_0x17c526;return _0x51cdf5;})[_0xe929('0x23')](respondWithFilteredResult(_0x4954d1,_0x339d7b))[_0xe929('0x42')](handleError(_0x4954d1,null));};exports[_0xe929('0x43')]=function(_0x4d2f84,_0x391aa0){var _0x4628ed={'raw':!![],'where':{'id':_0x4d2f84[_0xe929('0x44')]['id']}},_0x549fa2={};_0x549fa2['model']=_[_0xe929('0x2f')](db[_0xe929('0x3f')][_0xe929('0x45')]);_0x549fa2[_0xe929('0x2e')]=_['keys'](_0x4d2f84['query']);_0x549fa2[_0xe929('0x30')]=_[_0xe929('0x31')](_0x549fa2[_0xe929('0x2c')],_0x549fa2['query']);_0x4628ed[_0xe929('0x32')]=_[_0xe929('0x31')](_0x549fa2[_0xe929('0x2c')],qs[_0xe929('0x33')](_0x4d2f84[_0xe929('0x2e')][_0xe929('0x33')]));_0x4628ed[_0xe929('0x32')]=_0x4628ed[_0xe929('0x32')]['length']?_0x4628ed[_0xe929('0x32')]:_0x549fa2[_0xe929('0x2c')];if(_0x4d2f84[_0xe929('0x2e')][_0xe929('0x46')]){_0x4628ed[_0xe929('0x40')]=[{'all':!![]}];}_0x4628ed=_[_0xe929('0x3a')]({},_0x4628ed,_0x4d2f84['options']);return db[_0xe929('0x3f')][_0xe929('0x47')](_0x4628ed)[_0xe929('0x23')](handleEntityNotFound(_0x391aa0,null))[_0xe929('0x23')](respondWithResult(_0x391aa0,null))[_0xe929('0x42')](handleError(_0x391aa0,null));};exports[_0xe929('0x48')]=function(_0x3e275d,_0x51cfa3){return db[_0xe929('0x3f')][_0xe929('0x48')](_0x3e275d[_0xe929('0x49')],{})[_0xe929('0x23')](respondWithResult(_0x51cfa3,0xc9))[_0xe929('0x42')](handleError(_0x51cfa3,null));};exports['update']=function(_0x2b74e8,_0x1288e3){if(_0x2b74e8[_0xe929('0x49')]['id']){delete _0x2b74e8[_0xe929('0x49')]['id'];}return db[_0xe929('0x3f')][_0xe929('0x47')]({'where':{'id':_0x2b74e8[_0xe929('0x44')]['id']}})[_0xe929('0x23')](handleEntityNotFound(_0x1288e3,null))['then'](saveUpdates(_0x2b74e8['body'],null))[_0xe929('0x23')](respondWithResult(_0x1288e3,null))[_0xe929('0x42')](handleError(_0x1288e3,null));};exports[_0xe929('0x4a')]=function(_0x40d651,_0x59bc5e){return db[_0xe929('0x3f')][_0xe929('0x47')]({'where':{'id':_0x40d651[_0xe929('0x44')]['id']}})[_0xe929('0x23')](handleEntityNotFound(_0x59bc5e,null))[_0xe929('0x23')](removeEntity(_0x59bc5e,null))[_0xe929('0x42')](handleError(_0x59bc5e,null));};exports[_0xe929('0x4b')]=function(_0x695319,_0x155712,_0x44559c){return db[_0xe929('0x3f')][_0xe929('0x47')]({'where':{'id':_0x695319[_0xe929('0x44')]['id']},'attributes':['id','recording',_0xe929('0x4c')]})[_0xe929('0x23')](handleEntityNotFound(_0x155712,null))[_0xe929('0x23')](function(_0x277760){if(_0x277760){if(!_0x277760['recording']){throw new db['Sequelize']['ValidationError'](_0xe929('0x4d'));}var _0x5eebf7={'Content-Type':_0xe929('0x4e'),'Content-Disposition':'attachment'};if(_0x277760[_0xe929('0x4c')]){_0x5eebf7[_0xe929('0x4f')]='attachment;\x20filename=\x22'+_0x277760[_0xe929('0x4c')]+'.wav\x22';}_0x155712[_0xe929('0x1d')](_0x5eebf7);return _0x155712[_0xe929('0x27')](new Buffer(_0x277760[_0xe929('0x50')]));}})[_0xe929('0x42')](handleError(_0x155712,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b84=['path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x8b84,0x1ac));var _0x48b8=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8b84[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x48b8('0x0'));var util=require(_0x48b8('0x1'));var logger=require(_0x48b8('0x2'))(_0x48b8('0x3'));var moment=require('moment');var BPromise=require(_0x48b8('0x4'));var rp=require(_0x48b8('0x5'));var fs=require('fs');var path=require(_0x48b8('0x6'));var rimraf=require(_0x48b8('0x7'));var config=require(_0x48b8('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x48b8('0x9')]=function(_0x231b8c,_0x5eeac7){return _0x231b8c[_0x48b8('0xa')](_0x48b8('0xb'),attributes,{'tableName':_0x48b8('0xc'),'paranoid':![],'indexes':[{'name':_0x48b8('0xd'),'fields':[_0x48b8('0xd')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x2a79=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir'];(function(_0x18459a,_0x33fff6){var _0x1acd19=function(_0x463064){while(--_0x463064){_0x18459a['push'](_0x18459a['shift']());}};_0x1acd19(++_0x33fff6);}(_0x2a79,0x16c));var _0x92a7=function(_0x168d23,_0x247e87){_0x168d23=_0x168d23-0x0;var _0x35e8ef=_0x2a79[_0x168d23];return _0x35e8ef;};'use strict';var _=require('lodash');var util=require(_0x92a7('0x0'));var logger=require('../../config/logger')(_0x92a7('0x1'));var moment=require(_0x92a7('0x2'));var BPromise=require(_0x92a7('0x3'));var rp=require(_0x92a7('0x4'));var fs=require('fs');var path=require(_0x92a7('0x5'));var rimraf=require(_0x92a7('0x6'));var config=require(_0x92a7('0x7'));var attributes=require(_0x92a7('0x8'));module[_0x92a7('0x9')]=function(_0x978b9a,_0x1a31df){return _0x978b9a[_0x92a7('0xa')](_0x92a7('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x92a7('0xc'),'fields':[_0x92a7('0xc')]}],'timestamps':![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2395=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2ea5d6,_0x2ef3e7){var _0x20dcb3=function(_0x22ed56){while(--_0x22ed56){_0x2ea5d6['push'](_0x2ea5d6['shift']());}};_0x20dcb3(++_0x2ef3e7);}(_0x2395,0xaf));var _0x5239=function(_0x45d2a9,_0xa564a6){_0x45d2a9=_0x45d2a9-0x0;var _0x2ecaf7=_0x2395[_0x45d2a9];return _0x2ecaf7;};'use strict';var _=require('lodash');var util=require(_0x5239('0x0'));var moment=require(_0x5239('0x1'));var BPromise=require(_0x5239('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5239('0x3'));var db=require(_0x5239('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5239('0x5'))(_0x5239('0x6'));var config=require(_0x5239('0x7'));var jayson=require(_0x5239('0x8'));var client=jayson[_0x5239('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd24fc,_0x8633ac,_0x35c6e4){return new BPromise(function(_0xb237f8,_0x55f482){return client['request'](_0xd24fc,_0x35c6e4)[_0x5239('0xa')](function(_0x652f63){logger[_0x5239('0xb')](_0x5239('0xc'),_0x8633ac,_0x5239('0xd'));logger[_0x5239('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x8633ac,'request\x20sent',JSON[_0x5239('0xf')](_0x652f63));if(_0x652f63[_0x5239('0x10')]){if(_0x652f63[_0x5239('0x10')][_0x5239('0x11')]===0x1f4){logger['error'](_0x5239('0xc'),_0x8633ac,_0x652f63['error'][_0x5239('0x12')]);return _0x55f482(_0x652f63[_0x5239('0x10')][_0x5239('0x12')]);}logger[_0x5239('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x8633ac,_0x652f63['error']['message']);return _0xb237f8(_0x652f63[_0x5239('0x10')][_0x5239('0x12')]);}else{logger[_0x5239('0xb')](_0x5239('0xc'),_0x8633ac,_0x5239('0xd'));_0xb237f8(_0x652f63['result'][_0x5239('0x12')]);}})[_0x5239('0x13')](function(_0x26e7f4){logger['error'](_0x5239('0xc'),_0x8633ac,_0x26e7f4);_0x55f482(_0x26e7f4);});});}
\ No newline at end of file
+var _0x357b=['../../config/environment','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dc1bc,_0x50db83){var _0x5b33a7=function(_0xf40df7){while(--_0xf40df7){_0x3dc1bc['push'](_0x3dc1bc['shift']());}};_0x5b33a7(++_0x50db83);}(_0x357b,0xde));var _0xb357=function(_0x2b9d0a,_0x375e36){_0x2b9d0a=_0x2b9d0a-0x0;var _0x5242d6=_0x357b[_0x2b9d0a];return _0x5242d6;};'use strict';var _=require(_0xb357('0x0'));var util=require(_0xb357('0x1'));var moment=require('moment');var BPromise=require(_0xb357('0x2'));var rs=require(_0xb357('0x3'));var fs=require('fs');var Redis=require(_0xb357('0x4'));var db=require(_0xb357('0x5'))['db'];var utils=require(_0xb357('0x6'));var logger=require(_0xb357('0x7'))('rpc');var config=require(_0xb357('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb357('0x9')][_0xb357('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc7548,_0x1a0b81,_0x1f4980){return new BPromise(function(_0x2b72b4,_0x27cec0){return client[_0xb357('0xb')](_0xbc7548,_0x1f4980)['then'](function(_0x1d351b){logger[_0xb357('0xc')](_0xb357('0xd'),_0x1a0b81,_0xb357('0xe'));logger[_0xb357('0xf')](_0xb357('0x10'),_0x1a0b81,_0xb357('0xe'),JSON[_0xb357('0x11')](_0x1d351b));if(_0x1d351b['error']){if(_0x1d351b[_0xb357('0x12')][_0xb357('0x13')]===0x1f4){logger[_0xb357('0x12')](_0xb357('0xd'),_0x1a0b81,_0x1d351b[_0xb357('0x12')][_0xb357('0x14')]);return _0x27cec0(_0x1d351b[_0xb357('0x12')][_0xb357('0x14')]);}logger[_0xb357('0x12')](_0xb357('0xd'),_0x1a0b81,_0x1d351b['error'][_0xb357('0x14')]);return _0x2b72b4(_0x1d351b[_0xb357('0x12')][_0xb357('0x14')]);}else{logger[_0xb357('0xc')](_0xb357('0xd'),_0x1a0b81,'request\x20sent');_0x2b72b4(_0x1d351b[_0xb357('0x15')][_0xb357('0x14')]);}})[_0xb357('0x16')](function(_0x3e068f){logger[_0xb357('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x1a0b81,_0x3e068f);_0x27cec0(_0x3e068f);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe376=['removeSound','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xe376,0x1c4));var _0x6e37=function(_0xb61d88,_0x388bba){_0xb61d88=_0xb61d88-0x0;var _0x196a0d=_0xe376[_0xb61d88];return _0x196a0d;};'use strict';var multer=require(_0x6e37('0x0'));var util=require(_0x6e37('0x1'));var path=require(_0x6e37('0x2'));var timeout=require(_0x6e37('0x3'));var express=require('express');var router=express[_0x6e37('0x4')]();var fs_extra=require(_0x6e37('0x5'));var auth=require(_0x6e37('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6e37('0x7'));var controller=require(_0x6e37('0x8'));router[_0x6e37('0x9')]('/',auth[_0x6e37('0xa')](),controller['index']);router[_0x6e37('0x9')]('/:id',auth[_0x6e37('0xa')](),controller[_0x6e37('0xb')]);router[_0x6e37('0x9')](_0x6e37('0xc'),auth['isAuthenticated'](),controller[_0x6e37('0xd')]);router[_0x6e37('0xe')]('/',auth[_0x6e37('0xa')](),controller[_0x6e37('0xf')]);router[_0x6e37('0xe')](_0x6e37('0xc'),auth[_0x6e37('0xa')](),controller[_0x6e37('0x10')]);router[_0x6e37('0x11')](_0x6e37('0x12'),auth['isAuthenticated'](),controller[_0x6e37('0x13')]);router[_0x6e37('0x14')]('/:id',auth[_0x6e37('0xa')](),controller[_0x6e37('0x15')]);router[_0x6e37('0x14')](_0x6e37('0x16'),auth[_0x6e37('0xa')](),controller[_0x6e37('0x17')]);module[_0x6e37('0x18')]=router;
\ No newline at end of file
+var _0xa04a=['../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','addSound','put','delete','destroy','/:id/sounds/:id2','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x59bb2c,_0x563785){var _0x4c9d4d=function(_0x3cb9d6){while(--_0x3cb9d6){_0x59bb2c['push'](_0x59bb2c['shift']());}};_0x4c9d4d(++_0x563785);}(_0xa04a,0x72));var _0xaa04=function(_0x4403ff,_0x5aebc4){_0x4403ff=_0x4403ff-0x0;var _0x4d49dc=_0xa04a[_0x4403ff];return _0x4d49dc;};'use strict';var multer=require(_0xaa04('0x0'));var util=require(_0xaa04('0x1'));var path=require('path');var timeout=require(_0xaa04('0x2'));var express=require('express');var router=express[_0xaa04('0x3')]();var fs_extra=require(_0xaa04('0x4'));var auth=require(_0xaa04('0x5'));var interaction=require(_0xaa04('0x6'));var config=require('../../config/environment');var controller=require(_0xaa04('0x7'));router[_0xaa04('0x8')]('/',auth[_0xaa04('0x9')](),controller['index']);router[_0xaa04('0x8')](_0xaa04('0xa'),auth['isAuthenticated'](),controller[_0xaa04('0xb')]);router[_0xaa04('0x8')](_0xaa04('0xc'),auth[_0xaa04('0x9')](),controller[_0xaa04('0xd')]);router[_0xaa04('0xe')]('/',auth[_0xaa04('0x9')](),controller['create']);router[_0xaa04('0xe')](_0xaa04('0xc'),auth[_0xaa04('0x9')](),controller[_0xaa04('0xf')]);router[_0xaa04('0x10')](_0xaa04('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xaa04('0x11')](_0xaa04('0xa'),auth[_0xaa04('0x9')](),controller[_0xaa04('0x12')]);router['delete'](_0xaa04('0x13'),auth[_0xaa04('0x9')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5702=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','exports','STRING','name','ENUM','files'];(function(_0x2ebfe0,_0x3d32e2){var _0x2df263=function(_0x4069a7){while(--_0x4069a7){_0x2ebfe0['push'](_0x2ebfe0['shift']());}};_0x2df263(++_0x3d32e2);}(_0x5702,0x10e));var _0x2570=function(_0x29f487,_0x3eeb94){_0x29f487=_0x29f487-0x0;var _0x4d549e=_0x5702[_0x29f487];return _0x4d549e;};'use strict';var Sequelize=require('sequelize');module[_0x2570('0x0')]={'name':{'type':Sequelize[_0x2570('0x1')],'allowNull':![],'unique':_0x2570('0x2')},'mode':{'type':Sequelize[_0x2570('0x3')]('custom',_0x2570('0x4'),_0x2570('0x5'),_0x2570('0x6'),_0x2570('0x7'),_0x2570('0x8')),'allowNull':!![],'defaultValue':_0x2570('0x4')},'directory':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![],'defaultValue':_0x2570('0x9')},'format':{'type':Sequelize[_0x2570('0x1')],'allowNull':!![]},'stamp':{'type':_0x2570('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6f25=['exports','STRING','name','ENUM','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x51846b,_0x3dd939){var _0x4e48d8=function(_0x3c8c9c){while(--_0x3c8c9c){_0x51846b['push'](_0x51846b['shift']());}};_0x4e48d8(++_0x3dd939);}(_0x6f25,0x135));var _0x56f2=function(_0x224b49,_0x5ea3c4){_0x224b49=_0x224b49-0x0;var _0x241ada=_0x6f25[_0x224b49];return _0x241ada;};'use strict';var Sequelize=require(_0x56f2('0x0'));module[_0x56f2('0x1')]={'name':{'type':Sequelize[_0x56f2('0x2')],'allowNull':![],'unique':_0x56f2('0x3')},'mode':{'type':Sequelize[_0x56f2('0x4')]('custom','files','mp3nb','quietmp3nb',_0x56f2('0x5'),_0x56f2('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x56f2('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x56f2('0x2')],'allowNull':!![],'defaultValue':_0x56f2('0x7')},'format':{'type':Sequelize[_0x56f2('0x2')],'allowNull':!![]},'stamp':{'type':_0x56f2('0x8')},'defaultEntry':{'type':Sequelize[_0x56f2('0x9')],'defaultValue':0x0}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ae9=['name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','catch','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','server/files/sounds/converted','%s.%s','basename','symlinkSync','removeSound','id2','converted_format','unlinkSync','format','filter','getSounds','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource'];(function(_0x1a20c6,_0x363058){var _0x4f5a02=function(_0x115808){while(--_0x115808){_0x1a20c6['push'](_0x1a20c6['shift']());}};_0x4f5a02(++_0x363058);}(_0x0ae9,0x12a));var _0x90ae=function(_0x4d9aa2,_0x37cf1f){_0x4d9aa2=_0x4d9aa2-0x0;var _0x544483=_0x0ae9[_0x4d9aa2];return _0x544483;};'use strict';var emlformat=require(_0x90ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90ae('0x2'));var moment=require(_0x90ae('0x3'));var BPromise=require(_0x90ae('0x4'));var Mustache=require(_0x90ae('0x5'));var util=require(_0x90ae('0x6'));var path=require(_0x90ae('0x7'));var sox=require('sox');var csv=require(_0x90ae('0x8'));var ejs=require(_0x90ae('0x9'));var fs=require('fs');var fs_extra=require(_0x90ae('0xa'));var _=require(_0x90ae('0xb'));var squel=require(_0x90ae('0xc'));var crypto=require(_0x90ae('0xd'));var jsforce=require(_0x90ae('0xe'));var deskjs=require(_0x90ae('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90ae('0x10'));var Redis=require(_0x90ae('0x11'));var authService=require(_0x90ae('0x12'));var qs=require(_0x90ae('0x13'));var as=require(_0x90ae('0x14'));var hardwareService=require(_0x90ae('0x15'));var logger=require(_0x90ae('0x16'))(_0x90ae('0x17'));var utils=require(_0x90ae('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x90ae('0x19'));var db=require(_0x90ae('0x1a'))['db'];function respondWithStatusCode(_0x4335b5,_0x44c7a7){_0x44c7a7=_0x44c7a7||0xcc;return function(_0x4f5de6){if(_0x4f5de6){return _0x4335b5[_0x90ae('0x1b')](_0x44c7a7);}return _0x4335b5['status'](_0x44c7a7)[_0x90ae('0x1c')]();};}function respondWithResult(_0x2356b7,_0x13e484){_0x13e484=_0x13e484||0xc8;return function(_0x2958ba){if(_0x2958ba){return _0x2356b7[_0x90ae('0x1d')](_0x13e484)[_0x90ae('0x1e')](_0x2958ba);}};}function respondWithFilteredResult(_0x26b198,_0x429dc7){return function(_0x1ab0e1){if(_0x1ab0e1){var _0x2c9224=typeof _0x429dc7[_0x90ae('0x1f')]===_0x90ae('0x20')&&typeof _0x429dc7[_0x90ae('0x21')]===_0x90ae('0x20');var _0x12c6d7=_0x1ab0e1[_0x90ae('0x22')];var _0x1dc905=_0x2c9224?0x0:_0x429dc7[_0x90ae('0x1f')];var _0x5df3e5=_0x2c9224?_0x1ab0e1[_0x90ae('0x22')]:_0x429dc7['offset']+_0x429dc7['limit'];var _0x286e7a;if(_0x5df3e5>=_0x12c6d7){_0x5df3e5=_0x12c6d7;_0x286e7a=0xc8;}else{_0x286e7a=0xce;}_0x26b198[_0x90ae('0x1d')](_0x286e7a);return _0x26b198[_0x90ae('0x23')](_0x90ae('0x24'),_0x1dc905+'-'+_0x5df3e5+'/'+_0x12c6d7)[_0x90ae('0x1e')](_0x1ab0e1);}return null;};}function patchUpdates(_0x2fdb70){return function(_0x1587e0){try{jsonpatch['apply'](_0x1587e0,_0x2fdb70,!![]);}catch(_0x2957a4){return BPromise[_0x90ae('0x25')](_0x2957a4);}return _0x1587e0[_0x90ae('0x26')]();};}function saveUpdates(_0x4075c6,_0x55b513){return function(_0x950ea4){if(_0x950ea4){return _0x950ea4[_0x90ae('0x27')](_0x4075c6)[_0x90ae('0x28')](function(_0x400a63){return _0x400a63;});}return null;};}function removeEntity(_0x2c8428,_0x137a91){return function(_0x65703f){if(_0x65703f){return _0x65703f[_0x90ae('0x29')]()[_0x90ae('0x28')](function(){var _0x38dd42=_0x65703f[_0x90ae('0x2a')]({'plain':!![]});var _0x4ad38c='MusicOnHolds';return db[_0x90ae('0x2b')][_0x90ae('0x29')]({'where':{'type':_0x4ad38c,'resourceId':_0x38dd42['id']}})[_0x90ae('0x28')](function(){return _0x65703f;});})['then'](function(){_0x2c8428['status'](0xcc)[_0x90ae('0x1c')]();});}};}function handleEntityNotFound(_0x92b33d,_0x1e1f54){return function(_0x36a42b){if(!_0x36a42b){_0x92b33d[_0x90ae('0x1b')](0x194);}return _0x36a42b;};}function handleError(_0x27c37a,_0x52b8cf){_0x52b8cf=_0x52b8cf||0x1f4;return function(_0x22a19e){logger['error'](_0x22a19e['stack']);if(_0x22a19e[_0x90ae('0x2c')]){delete _0x22a19e[_0x90ae('0x2c')];}_0x27c37a[_0x90ae('0x1d')](_0x52b8cf)[_0x90ae('0x2d')](_0x22a19e);};}exports[_0x90ae('0x2e')]=function(_0x25a528,_0x480d40){var _0x2fd2f2={},_0x306494={},_0x24d009={'count':0x0,'rows':[]};var _0x2341f3=_[_0x90ae('0x2f')](db[_0x90ae('0x30')][_0x90ae('0x31')],function(_0x4c8bcd){return{'name':_0x4c8bcd[_0x90ae('0x32')],'type':_0x4c8bcd['type']['key']};});_0x306494[_0x90ae('0x33')]=_[_0x90ae('0x2f')](_0x2341f3,_0x90ae('0x2c'));_0x306494[_0x90ae('0x34')]=_[_0x90ae('0x35')](_0x25a528['query']);_0x306494['filters']=_[_0x90ae('0x36')](_0x306494[_0x90ae('0x33')],_0x306494[_0x90ae('0x34')]);_0x2fd2f2[_0x90ae('0x37')]=_[_0x90ae('0x36')](_0x306494[_0x90ae('0x33')],qs[_0x90ae('0x38')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x38')]));_0x2fd2f2[_0x90ae('0x37')]=_0x2fd2f2['attributes'][_0x90ae('0x39')]?_0x2fd2f2['attributes']:_0x306494['model'];if(!_0x25a528[_0x90ae('0x34')]['hasOwnProperty'](_0x90ae('0x3a'))){_0x2fd2f2['limit']=qs[_0x90ae('0x21')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x21')]);_0x2fd2f2['offset']=qs[_0x90ae('0x1f')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x1f')]);}_0x2fd2f2[_0x90ae('0x3b')]=qs[_0x90ae('0x3c')](_0x25a528[_0x90ae('0x34')][_0x90ae('0x3c')]);delete _0x25a528[_0x90ae('0x34')][_0x90ae('0x3c')];_0x2fd2f2[_0x90ae('0x3d')]=qs[_0x90ae('0x3e')](_['pick'](_0x25a528[_0x90ae('0x34')],_0x306494[_0x90ae('0x3e')]),_0x2341f3);if(_0x25a528[_0x90ae('0x34')]['filter']){_0x2fd2f2[_0x90ae('0x3d')]=_['merge'](_0x2fd2f2[_0x90ae('0x3d')],{'$or':_[_0x90ae('0x2f')](_0x2341f3,function(_0x24e8c3){if(_0x24e8c3['type']!==_0x90ae('0x3f')){var _0x4e2de7={};_0x4e2de7[_0x24e8c3[_0x90ae('0x2c')]]={'$like':'%'+_0x25a528['query']['filter']+'%'};return _0x4e2de7;}})});}_0x2fd2f2=_[_0x90ae('0x40')]({},_0x2fd2f2,_0x25a528[_0x90ae('0x41')]);var _0x5625d4={'where':_0x2fd2f2[_0x90ae('0x3d')]};return db[_0x90ae('0x30')][_0x90ae('0x22')](_0x5625d4)[_0x90ae('0x28')](function(_0x1d3726){_0x24d009[_0x90ae('0x22')]=_0x1d3726;if(_0x25a528['query']['includeAll']){_0x2fd2f2[_0x90ae('0x42')]=[{'all':!![]}];}return db[_0x90ae('0x30')][_0x90ae('0x43')](_0x2fd2f2);})['then'](function(_0x3d0717){_0x24d009[_0x90ae('0x44')]=_0x3d0717;return _0x24d009;})[_0x90ae('0x28')](respondWithFilteredResult(_0x480d40,_0x2fd2f2))['catch'](handleError(_0x480d40,null));};exports[_0x90ae('0x45')]=function(_0x18c206,_0x2ceaef){var _0x4f3485={'raw':![],'where':{'id':_0x18c206[_0x90ae('0x46')]['id']}},_0x4481ca={};_0x4481ca[_0x90ae('0x33')]=_[_0x90ae('0x35')](db[_0x90ae('0x30')][_0x90ae('0x31')]);_0x4481ca['query']=_[_0x90ae('0x35')](_0x18c206[_0x90ae('0x34')]);_0x4481ca[_0x90ae('0x3e')]=_[_0x90ae('0x36')](_0x4481ca[_0x90ae('0x33')],_0x4481ca[_0x90ae('0x34')]);_0x4f3485[_0x90ae('0x37')]=_[_0x90ae('0x36')](_0x4481ca[_0x90ae('0x33')],qs[_0x90ae('0x38')](_0x18c206[_0x90ae('0x34')][_0x90ae('0x38')]));_0x4f3485[_0x90ae('0x37')]=_0x4f3485[_0x90ae('0x37')]['length']?_0x4f3485[_0x90ae('0x37')]:_0x4481ca['model'];if(_0x18c206['query'][_0x90ae('0x47')]){_0x4f3485[_0x90ae('0x42')]=[{'all':!![]}];}_0x4f3485=_['merge']({},_0x4f3485,_0x18c206[_0x90ae('0x41')]);return db['VoiceMusicOnHold'][_0x90ae('0x48')](_0x4f3485)['then'](handleEntityNotFound(_0x2ceaef,null))['then'](respondWithResult(_0x2ceaef,null))[_0x90ae('0x49')](handleError(_0x2ceaef,null));};exports[_0x90ae('0x27')]=function(_0x441ef6,_0x139189){if(_0x441ef6[_0x90ae('0x4a')]['id']){delete _0x441ef6[_0x90ae('0x4a')]['id'];}return db[_0x90ae('0x30')][_0x90ae('0x48')]({'where':{'id':_0x441ef6[_0x90ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x139189,null))[_0x90ae('0x28')](saveUpdates(_0x441ef6['body'],null))[_0x90ae('0x28')](respondWithResult(_0x139189,null))[_0x90ae('0x49')](handleError(_0x139189,null));};exports[_0x90ae('0x4b')]=function(_0x3f3dd1,_0x301878,_0x148b8d){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0x3e797f){if(_0x3f3dd1['body'][_0x90ae('0x4e')]===_0x90ae('0x4f')){_0x3f3dd1[_0x90ae('0x4a')][_0x90ae('0x50')]=path[_0x90ae('0x51')](config[_0x90ae('0x52')],_0x90ae('0x53'),_0x3f3dd1[_0x90ae('0x4a')]['name']);}return db[_0x90ae('0x30')][_0x90ae('0x4b')](_0x3f3dd1['body'],{'transaction':_0x3e797f})['then'](function(_0x406cc2){if(_0x3f3dd1[_0x90ae('0x4a')][_0x90ae('0x4e')]===_0x90ae('0x4f')){fs[_0x90ae('0x54')](_0x406cc2[_0x90ae('0x50')],parseInt(_0x90ae('0x55'),0x8));}var _0x18761d=_0x3f3dd1[_0x90ae('0x56')][_0x90ae('0x2a')]({'plain':!![]});if(!_0x18761d)throw new Error(_0x90ae('0x57'));if(_0x18761d[_0x90ae('0x58')]===_0x90ae('0x56')){var _0x364004=_0x406cc2[_0x90ae('0x2a')]({'plain':!![]});return db[_0x90ae('0x59')][_0x90ae('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x18761d[_0x90ae('0x5a')]},'raw':!![]})['then'](function(_0x4cf603){if(_0x4cf603&&_0x4cf603['autoAssociation']===0x0){return db['UserProfileResource'][_0x90ae('0x4b')]({'name':_0x364004[_0x90ae('0x2c')],'resourceId':_0x364004['id'],'type':_0x4cf603[_0x90ae('0x2c')],'sectionId':_0x4cf603['id']},{})['then'](function(){return _0x406cc2;});}else{return _0x406cc2;}})[_0x90ae('0x49')](function(_0x140850){logger[_0x90ae('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x140850);});}return _0x406cc2;});})[_0x90ae('0x28')](respondWithResult(_0x301878,0xc9))[_0x90ae('0x49')](handleError(_0x301878,null));};exports[_0x90ae('0x29')]=function(_0x38b0c2,_0x32e400,_0x1ffdd2){var _0x3f9a51;return db[_0x90ae('0x30')][_0x90ae('0x48')]({'where':{'id':_0x38b0c2['params']['id']}})['then'](function(_0x16c09d){if(_0x16c09d){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0x45a877){return _0x16c09d[_0x90ae('0x29')]({'transaction':_0x45a877,'raw':!![]})[_0x90ae('0x28')](function(_0x48b73d){if(_0x48b73d['directory']){fs[_0x90ae('0x5c')](_0x48b73d['directory'])[_0x90ae('0x5d')](function(_0x13a4c2){fs['unlinkSync'](path[_0x90ae('0x51')](_0x48b73d[_0x90ae('0x50')],_0x13a4c2));});fs[_0x90ae('0x5e')](_0x48b73d[_0x90ae('0x50')]);}return _0x48b73d;});})['catch'](function(_0x34f10f){throw new db[(_0x90ae('0x5f'))][(_0x90ae('0x60'))](_0x34f10f[_0x90ae('0x61')]);});}})[_0x90ae('0x28')](handleEntityNotFound(_0x32e400,null))['then'](removeEntity(_0x32e400,null))[_0x90ae('0x49')](handleError(_0x32e400,null));};exports[_0x90ae('0x62')]=function(_0x3d3f3e,_0x294bad,_0x2ae76b){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0xce756d){var _0x368e4d;return db[_0x90ae('0x30')][_0x90ae('0x48')]({'where':{'id':_0x3d3f3e[_0x90ae('0x46')]['id']}})[_0x90ae('0x28')](function(_0x218473){if(_0x218473){_0x368e4d=_0x218473;return _0x218473['addSound'](_0x3d3f3e[_0x90ae('0x4a')]['id'],{'transaction':_0xce756d});}})[_0x90ae('0x28')](function(_0x1add61){if(_0x1add61){return db[_0x90ae('0x63')][_0x90ae('0x64')]({'where':{'id':_0x3d3f3e[_0x90ae('0x4a')]['id']},'attributes':['id','name',_0x90ae('0x65'),'converted_format','createdAt'],'raw':!![]});}})[_0x90ae('0x28')](function(_0x1681b6){if(_0x1681b6){var _0x5a947f=path[_0x90ae('0x51')](config[_0x90ae('0x52')],_0x90ae('0x66'),util['format'](_0x90ae('0x67'),path[_0x90ae('0x68')](_0x1681b6[_0x90ae('0x65')],path['extname'](_0x1681b6[_0x90ae('0x65')])),_0x1681b6['converted_format']));var _0x2922c4=path[_0x90ae('0x51')](config[_0x90ae('0x52')],_0x90ae('0x53'),_0x368e4d[_0x90ae('0x2c')],util['format'](_0x90ae('0x67'),_0x1681b6['name'],_0x1681b6['converted_format']));fs[_0x90ae('0x69')](_0x5a947f,_0x2922c4);return _0x1681b6;}})[_0x90ae('0x49')](function(_0xa542d0){throw new db[(_0x90ae('0x5f'))][(_0x90ae('0x60'))](_0xa542d0[_0x90ae('0x61')]);});})[_0x90ae('0x28')](handleEntityNotFound(_0x294bad,null))[_0x90ae('0x28')](respondWithResult(_0x294bad,0xc9))[_0x90ae('0x49')](handleError(_0x294bad,null));};exports[_0x90ae('0x6a')]=function(_0x22e5a2,_0x534d10,_0x120c71){return db[_0x90ae('0x4c')][_0x90ae('0x4d')](function(_0x43b602){var _0x4ce1d2;return db[_0x90ae('0x30')][_0x90ae('0x64')]({'where':{'id':_0x22e5a2[_0x90ae('0x46')]['id']}})[_0x90ae('0x28')](handleEntityNotFound(_0x534d10,null))[_0x90ae('0x28')](function(_0x4ac836){if(_0x4ac836){_0x4ce1d2=_0x4ac836;return _0x4ac836[_0x90ae('0x6a')](_0x22e5a2[_0x90ae('0x46')][_0x90ae('0x6b')]);}})[_0x90ae('0x28')](function(_0x160b75){if(_0x160b75){return db[_0x90ae('0x63')]['findOne']({'where':{'id':_0x22e5a2[_0x90ae('0x46')][_0x90ae('0x6b')]},'attributes':['id',_0x90ae('0x2c'),'save_name',_0x90ae('0x6c'),'createdAt'],'raw':!![]});}})[_0x90ae('0x28')](function(_0x3739d9){if(_0x3739d9){fs[_0x90ae('0x6d')](path[_0x90ae('0x51')](_0x4ce1d2[_0x90ae('0x50')],util[_0x90ae('0x6e')](_0x90ae('0x67'),_0x3739d9[_0x90ae('0x2c')],_0x3739d9[_0x90ae('0x6c')])));return _0x3739d9;}})[_0x90ae('0x49')](function(_0x3ee88f){throw new db[(_0x90ae('0x5f'))]['ValidationError'](_0x3ee88f[_0x90ae('0x61')]);});})[_0x90ae('0x28')](handleEntityNotFound(_0x534d10,null))[_0x90ae('0x28')](respondWithStatusCode(_0x534d10,0xcc))[_0x90ae('0x49')](handleError(_0x534d10,null));};exports['getSounds']=function(_0xc78866,_0xef0601,_0x2b9dc2){var _0x2aaf65={};var _0x52a958={};var _0x3ed6f3;var _0x51338b;return db[_0x90ae('0x30')][_0x90ae('0x64')]({'where':{'id':_0xc78866[_0x90ae('0x46')]['id']}})[_0x90ae('0x28')](handleEntityNotFound(_0xef0601,null))[_0x90ae('0x28')](function(_0x1a9119){if(_0x1a9119){_0x3ed6f3=_0x1a9119;_0x52a958['model']=_[_0x90ae('0x35')](db[_0x90ae('0x63')][_0x90ae('0x31')]);_0x52a958[_0x90ae('0x34')]=_[_0x90ae('0x35')](_0xc78866[_0x90ae('0x34')]);_0x52a958[_0x90ae('0x3e')]=_[_0x90ae('0x36')](_0x52a958[_0x90ae('0x33')],_0x52a958['query']);_0x2aaf65[_0x90ae('0x37')]=_[_0x90ae('0x36')](_0x52a958[_0x90ae('0x33')],qs[_0x90ae('0x38')](_0xc78866[_0x90ae('0x34')][_0x90ae('0x38')]));_0x2aaf65[_0x90ae('0x37')]=_0x2aaf65[_0x90ae('0x37')][_0x90ae('0x39')]?_0x2aaf65[_0x90ae('0x37')]:_0x52a958[_0x90ae('0x33')];_0x2aaf65['order']=qs[_0x90ae('0x3c')](_0xc78866[_0x90ae('0x34')][_0x90ae('0x3c')]);_0x2aaf65[_0x90ae('0x3d')]=qs[_0x90ae('0x3e')](_['pick'](_0xc78866[_0x90ae('0x34')],_0x52a958['filters']));if(_0xc78866[_0x90ae('0x34')]['filter']){_0x2aaf65[_0x90ae('0x3d')]=_[_0x90ae('0x40')](_0x2aaf65[_0x90ae('0x3d')],{'$or':_[_0x90ae('0x2f')](_0x2aaf65[_0x90ae('0x37')],function(_0x4bbe3b){var _0x44ae54={};_0x44ae54[_0x4bbe3b]={'$like':'%'+_0xc78866[_0x90ae('0x34')][_0x90ae('0x6f')]+'%'};return _0x44ae54;})});}_0x2aaf65=_['merge']({},_0x2aaf65,_0xc78866['options']);return _0x3ed6f3[_0x90ae('0x70')](_0x2aaf65);}})[_0x90ae('0x28')](function(_0x2ffcdb){if(_0x2ffcdb){_0x51338b=_0x2ffcdb['length'];if(!_0xc78866[_0x90ae('0x34')][_0x90ae('0x71')](_0x90ae('0x3a'))){_0x2aaf65[_0x90ae('0x21')]=qs[_0x90ae('0x21')](_0xc78866['query'][_0x90ae('0x21')]);_0x2aaf65['offset']=qs[_0x90ae('0x1f')](_0xc78866[_0x90ae('0x34')][_0x90ae('0x1f')]);}return _0x3ed6f3[_0x90ae('0x70')](_0x2aaf65);}})[_0x90ae('0x28')](function(_0x20a1ca){if(_0x20a1ca){return _0x20a1ca?{'count':_0x51338b,'rows':_0x20a1ca}:null;}})[_0x90ae('0x28')](respondWithResult(_0xef0601,null))[_0x90ae('0x49')](handleError(_0xef0601,null));};
\ No newline at end of file
+var _0x4ed6=['directory','join','root','server/files/moh','mkdirSync','0777','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','message','removeSound','id2','getSounds','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','Content-Range','apply','reject','update','then','get','MusicOnHolds','UserProfileResource','destroy','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','params','length','includeAll','options','find','body','create','sequelize','transaction','mode','files'];(function(_0x1f7abf,_0x5abc55){var _0x110fb4=function(_0x3cf3f9){while(--_0x3cf3f9){_0x1f7abf['push'](_0x1f7abf['shift']());}};_0x110fb4(++_0x5abc55);}(_0x4ed6,0x1dd));var _0x64ed=function(_0x4473b9,_0x15ceb6){_0x4473b9=_0x4473b9-0x0;var _0x1e3029=_0x4ed6[_0x4473b9];return _0x1e3029;};'use strict';var emlformat=require(_0x64ed('0x0'));var rimraf=require(_0x64ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64ed('0x2'));var rp=require('request-promise');var moment=require(_0x64ed('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x64ed('0x4'));var util=require(_0x64ed('0x5'));var path=require(_0x64ed('0x6'));var sox=require(_0x64ed('0x7'));var csv=require(_0x64ed('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64ed('0x9'));var _=require(_0x64ed('0xa'));var squel=require(_0x64ed('0xb'));var crypto=require(_0x64ed('0xc'));var jsforce=require(_0x64ed('0xd'));var deskjs=require(_0x64ed('0xe'));var toCsv=require('to-csv');var querystring=require(_0x64ed('0xf'));var Papa=require(_0x64ed('0x10'));var Redis=require(_0x64ed('0x11'));var authService=require(_0x64ed('0x12'));var qs=require(_0x64ed('0x13'));var as=require(_0x64ed('0x14'));var hardwareService=require(_0x64ed('0x15'));var logger=require(_0x64ed('0x16'))(_0x64ed('0x17'));var utils=require(_0x64ed('0x18'));var config=require(_0x64ed('0x19'));var licenseUtil=require(_0x64ed('0x1a'));var db=require(_0x64ed('0x1b'))['db'];function respondWithStatusCode(_0x16b20d,_0x19702c){_0x19702c=_0x19702c||0xcc;return function(_0x2893d8){if(_0x2893d8){return _0x16b20d[_0x64ed('0x1c')](_0x19702c);}return _0x16b20d[_0x64ed('0x1d')](_0x19702c)['end']();};}function respondWithResult(_0x1e19c5,_0x145781){_0x145781=_0x145781||0xc8;return function(_0x45323b){if(_0x45323b){return _0x1e19c5['status'](_0x145781)[_0x64ed('0x1e')](_0x45323b);}};}function respondWithFilteredResult(_0x3951c6,_0xc2ca8e){return function(_0x223169){if(_0x223169){var _0x2e48a7=typeof _0xc2ca8e['offset']==='undefined'&&typeof _0xc2ca8e['limit']===_0x64ed('0x1f');var _0x4c6128=_0x223169[_0x64ed('0x20')];var _0x204c0a=_0x2e48a7?0x0:_0xc2ca8e[_0x64ed('0x21')];var _0x5545d2=_0x2e48a7?_0x223169['count']:_0xc2ca8e[_0x64ed('0x21')]+_0xc2ca8e['limit'];var _0x2aec19;if(_0x5545d2>=_0x4c6128){_0x5545d2=_0x4c6128;_0x2aec19=0xc8;}else{_0x2aec19=0xce;}_0x3951c6['status'](_0x2aec19);return _0x3951c6['set'](_0x64ed('0x22'),_0x204c0a+'-'+_0x5545d2+'/'+_0x4c6128)['json'](_0x223169);}return null;};}function patchUpdates(_0x199b7f){return function(_0x54307c){try{jsonpatch[_0x64ed('0x23')](_0x54307c,_0x199b7f,!![]);}catch(_0x2f5be7){return BPromise[_0x64ed('0x24')](_0x2f5be7);}return _0x54307c['save']();};}function saveUpdates(_0x5503ed,_0x11dfb5){return function(_0x51ad23){if(_0x51ad23){return _0x51ad23[_0x64ed('0x25')](_0x5503ed)[_0x64ed('0x26')](function(_0x4b7984){return _0x4b7984;});}return null;};}function removeEntity(_0x179152,_0x459b2d){return function(_0x6a8c09){if(_0x6a8c09){return _0x6a8c09['destroy']()[_0x64ed('0x26')](function(){var _0x9824e1=_0x6a8c09[_0x64ed('0x27')]({'plain':!![]});var _0x54ecc3=_0x64ed('0x28');return db[_0x64ed('0x29')][_0x64ed('0x2a')]({'where':{'type':_0x54ecc3,'resourceId':_0x9824e1['id']}})[_0x64ed('0x26')](function(){return _0x6a8c09;});})[_0x64ed('0x26')](function(){_0x179152[_0x64ed('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20dce1,_0x2cc4b1){return function(_0x3ef9ab){if(!_0x3ef9ab){_0x20dce1[_0x64ed('0x1c')](0x194);}return _0x3ef9ab;};}function handleError(_0x1c5aa0,_0x1da523){_0x1da523=_0x1da523||0x1f4;return function(_0x43c6ca){logger['error'](_0x43c6ca[_0x64ed('0x2b')]);if(_0x43c6ca['name']){delete _0x43c6ca[_0x64ed('0x2c')];}_0x1c5aa0[_0x64ed('0x1d')](_0x1da523)[_0x64ed('0x2d')](_0x43c6ca);};}exports[_0x64ed('0x2e')]=function(_0x56c494,_0x34f287){var _0x2c2815={},_0x1daf58={},_0x5916ec={'count':0x0,'rows':[]};var _0x38c684=_[_0x64ed('0x2f')](db[_0x64ed('0x30')][_0x64ed('0x31')],function(_0x9dc665){return{'name':_0x9dc665['fieldName'],'type':_0x9dc665['type']['key']};});_0x1daf58[_0x64ed('0x32')]=_[_0x64ed('0x2f')](_0x38c684,_0x64ed('0x2c'));_0x1daf58[_0x64ed('0x33')]=_[_0x64ed('0x34')](_0x56c494[_0x64ed('0x33')]);_0x1daf58[_0x64ed('0x35')]=_[_0x64ed('0x36')](_0x1daf58[_0x64ed('0x32')],_0x1daf58[_0x64ed('0x33')]);_0x2c2815['attributes']=_[_0x64ed('0x36')](_0x1daf58[_0x64ed('0x32')],qs[_0x64ed('0x37')](_0x56c494[_0x64ed('0x33')][_0x64ed('0x37')]));_0x2c2815[_0x64ed('0x38')]=_0x2c2815[_0x64ed('0x38')]['length']?_0x2c2815[_0x64ed('0x38')]:_0x1daf58[_0x64ed('0x32')];if(!_0x56c494[_0x64ed('0x33')][_0x64ed('0x39')](_0x64ed('0x3a'))){_0x2c2815[_0x64ed('0x3b')]=qs['limit'](_0x56c494['query'][_0x64ed('0x3b')]);_0x2c2815[_0x64ed('0x21')]=qs[_0x64ed('0x21')](_0x56c494['query'][_0x64ed('0x21')]);}_0x2c2815[_0x64ed('0x3c')]=qs[_0x64ed('0x3d')](_0x56c494[_0x64ed('0x33')][_0x64ed('0x3d')]);delete _0x56c494[_0x64ed('0x33')][_0x64ed('0x3d')];_0x2c2815['where']=qs[_0x64ed('0x35')](_[_0x64ed('0x3e')](_0x56c494[_0x64ed('0x33')],_0x1daf58[_0x64ed('0x35')]),_0x38c684);if(_0x56c494[_0x64ed('0x33')][_0x64ed('0x3f')]){_0x2c2815[_0x64ed('0x40')]=_[_0x64ed('0x41')](_0x2c2815['where'],{'$or':_[_0x64ed('0x2f')](_0x38c684,function(_0x2a7176){if(_0x2a7176[_0x64ed('0x42')]!==_0x64ed('0x43')){var _0x4a5731={};_0x4a5731[_0x2a7176[_0x64ed('0x2c')]]={'$like':'%'+_0x56c494[_0x64ed('0x33')][_0x64ed('0x3f')]+'%'};return _0x4a5731;}})});}_0x2c2815=_[_0x64ed('0x41')]({},_0x2c2815,_0x56c494['options']);var _0x1a354b={'where':_0x2c2815[_0x64ed('0x40')]};return db[_0x64ed('0x30')][_0x64ed('0x20')](_0x1a354b)['then'](function(_0x5617f1){_0x5916ec['count']=_0x5617f1;if(_0x56c494[_0x64ed('0x33')]['includeAll']){_0x2c2815[_0x64ed('0x44')]=[{'all':!![]}];}return db[_0x64ed('0x30')][_0x64ed('0x45')](_0x2c2815);})[_0x64ed('0x26')](function(_0x1ab59c){_0x5916ec[_0x64ed('0x46')]=_0x1ab59c;return _0x5916ec;})['then'](respondWithFilteredResult(_0x34f287,_0x2c2815))[_0x64ed('0x47')](handleError(_0x34f287,null));};exports['show']=function(_0x5b8870,_0x40d035){var _0x246ad3={'raw':![],'where':{'id':_0x5b8870[_0x64ed('0x48')]['id']}},_0x559b35={};_0x559b35[_0x64ed('0x32')]=_[_0x64ed('0x34')](db[_0x64ed('0x30')][_0x64ed('0x31')]);_0x559b35[_0x64ed('0x33')]=_[_0x64ed('0x34')](_0x5b8870[_0x64ed('0x33')]);_0x559b35[_0x64ed('0x35')]=_['intersection'](_0x559b35[_0x64ed('0x32')],_0x559b35[_0x64ed('0x33')]);_0x246ad3[_0x64ed('0x38')]=_[_0x64ed('0x36')](_0x559b35[_0x64ed('0x32')],qs[_0x64ed('0x37')](_0x5b8870[_0x64ed('0x33')][_0x64ed('0x37')]));_0x246ad3[_0x64ed('0x38')]=_0x246ad3['attributes'][_0x64ed('0x49')]?_0x246ad3['attributes']:_0x559b35[_0x64ed('0x32')];if(_0x5b8870['query'][_0x64ed('0x4a')]){_0x246ad3[_0x64ed('0x44')]=[{'all':!![]}];}_0x246ad3=_['merge']({},_0x246ad3,_0x5b8870[_0x64ed('0x4b')]);return db['VoiceMusicOnHold'][_0x64ed('0x4c')](_0x246ad3)[_0x64ed('0x26')](handleEntityNotFound(_0x40d035,null))[_0x64ed('0x26')](respondWithResult(_0x40d035,null))[_0x64ed('0x47')](handleError(_0x40d035,null));};exports[_0x64ed('0x25')]=function(_0x38b6b9,_0x4f4a7e){if(_0x38b6b9['body']['id']){delete _0x38b6b9['body']['id'];}return db[_0x64ed('0x30')][_0x64ed('0x4c')]({'where':{'id':_0x38b6b9[_0x64ed('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f4a7e,null))['then'](saveUpdates(_0x38b6b9[_0x64ed('0x4d')],null))[_0x64ed('0x26')](respondWithResult(_0x4f4a7e,null))[_0x64ed('0x47')](handleError(_0x4f4a7e,null));};exports[_0x64ed('0x4e')]=function(_0x23bc5d,_0x24919e,_0x4cc1da){return db[_0x64ed('0x4f')][_0x64ed('0x50')](function(_0x3716ef){if(_0x23bc5d['body'][_0x64ed('0x51')]===_0x64ed('0x52')){_0x23bc5d[_0x64ed('0x4d')][_0x64ed('0x53')]=path[_0x64ed('0x54')](config[_0x64ed('0x55')],_0x64ed('0x56'),_0x23bc5d[_0x64ed('0x4d')][_0x64ed('0x2c')]);}return db[_0x64ed('0x30')]['create'](_0x23bc5d[_0x64ed('0x4d')],{'transaction':_0x3716ef})['then'](function(_0x115c6c){if(_0x23bc5d['body'][_0x64ed('0x51')]===_0x64ed('0x52')){fs[_0x64ed('0x57')](_0x115c6c[_0x64ed('0x53')],parseInt(_0x64ed('0x58'),0x8));}var _0x2cd2cb=_0x23bc5d[_0x64ed('0x59')][_0x64ed('0x27')]({'plain':!![]});if(!_0x2cd2cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cd2cb['role']===_0x64ed('0x59')){var _0x5a15b6=_0x115c6c[_0x64ed('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x64ed('0x4c')]({'where':{'name':_0x64ed('0x28'),'userProfileId':_0x2cd2cb[_0x64ed('0x5a')]},'raw':!![]})[_0x64ed('0x26')](function(_0x55d8f9){if(_0x55d8f9&&_0x55d8f9[_0x64ed('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a15b6['name'],'resourceId':_0x5a15b6['id'],'type':_0x55d8f9[_0x64ed('0x2c')],'sectionId':_0x55d8f9['id']},{})[_0x64ed('0x26')](function(){return _0x115c6c;});}else{return _0x115c6c;}})[_0x64ed('0x47')](function(_0x43c2c2){logger['error'](_0x64ed('0x5c'),_0x43c2c2);});}return _0x115c6c;});})[_0x64ed('0x26')](respondWithResult(_0x24919e,0xc9))[_0x64ed('0x47')](handleError(_0x24919e,null));};exports[_0x64ed('0x2a')]=function(_0x3a7d39,_0x51594a,_0x3ab2e3){var _0x5c4c4c;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3a7d39['params']['id']}})['then'](function(_0x4120cb){if(_0x4120cb){return db[_0x64ed('0x4f')]['transaction'](function(_0x36ea7a){return _0x4120cb[_0x64ed('0x2a')]({'transaction':_0x36ea7a,'raw':!![]})['then'](function(_0x3638a4){if(_0x3638a4[_0x64ed('0x53')]){fs[_0x64ed('0x5d')](_0x3638a4[_0x64ed('0x53')])[_0x64ed('0x5e')](function(_0x337c76){fs[_0x64ed('0x5f')](path[_0x64ed('0x54')](_0x3638a4['directory'],_0x337c76));});fs[_0x64ed('0x60')](_0x3638a4[_0x64ed('0x53')]);}return _0x3638a4;});})[_0x64ed('0x47')](function(_0x4e21f9){throw new db[(_0x64ed('0x61'))][(_0x64ed('0x62'))](_0x4e21f9['message']);});}})[_0x64ed('0x26')](handleEntityNotFound(_0x51594a,null))['then'](removeEntity(_0x51594a,null))[_0x64ed('0x47')](handleError(_0x51594a,null));};exports[_0x64ed('0x63')]=function(_0x59d2cb,_0x3a5ada,_0xfdd354){return db['sequelize'][_0x64ed('0x50')](function(_0x51abd6){var _0x466e99;return db[_0x64ed('0x30')][_0x64ed('0x4c')]({'where':{'id':_0x59d2cb[_0x64ed('0x48')]['id']}})[_0x64ed('0x26')](function(_0x226295){if(_0x226295){_0x466e99=_0x226295;return _0x226295[_0x64ed('0x63')](_0x59d2cb[_0x64ed('0x4d')]['id'],{'transaction':_0x51abd6});}})['then'](function(_0x46a4ca){if(_0x46a4ca){return db[_0x64ed('0x64')][_0x64ed('0x65')]({'where':{'id':_0x59d2cb[_0x64ed('0x4d')]['id']},'attributes':['id',_0x64ed('0x2c'),_0x64ed('0x66'),_0x64ed('0x67'),_0x64ed('0x68')],'raw':!![]});}})['then'](function(_0xcfbce1){if(_0xcfbce1){var _0x4e1bef=path[_0x64ed('0x54')](config[_0x64ed('0x55')],_0x64ed('0x69'),util[_0x64ed('0x6a')](_0x64ed('0x6b'),path['basename'](_0xcfbce1[_0x64ed('0x66')],path['extname'](_0xcfbce1[_0x64ed('0x66')])),_0xcfbce1[_0x64ed('0x67')]));var _0x42b36d=path[_0x64ed('0x54')](config[_0x64ed('0x55')],_0x64ed('0x56'),_0x466e99[_0x64ed('0x2c')],util[_0x64ed('0x6a')](_0x64ed('0x6b'),_0xcfbce1[_0x64ed('0x2c')],_0xcfbce1['converted_format']));fs['symlinkSync'](_0x4e1bef,_0x42b36d);return _0xcfbce1;}})[_0x64ed('0x47')](function(_0x2d596e){throw new db['Sequelize'][(_0x64ed('0x62'))](_0x2d596e[_0x64ed('0x6c')]);});})['then'](handleEntityNotFound(_0x3a5ada,null))[_0x64ed('0x26')](respondWithResult(_0x3a5ada,0xc9))[_0x64ed('0x47')](handleError(_0x3a5ada,null));};exports[_0x64ed('0x6d')]=function(_0x12a96c,_0x5520bd,_0xd20a48){return db[_0x64ed('0x4f')][_0x64ed('0x50')](function(_0x269552){var _0x3e7707;return db[_0x64ed('0x30')][_0x64ed('0x65')]({'where':{'id':_0x12a96c[_0x64ed('0x48')]['id']}})[_0x64ed('0x26')](handleEntityNotFound(_0x5520bd,null))[_0x64ed('0x26')](function(_0x5deb8f){if(_0x5deb8f){_0x3e7707=_0x5deb8f;return _0x5deb8f[_0x64ed('0x6d')](_0x12a96c['params'][_0x64ed('0x6e')]);}})[_0x64ed('0x26')](function(_0xe2d862){if(_0xe2d862){return db[_0x64ed('0x64')][_0x64ed('0x65')]({'where':{'id':_0x12a96c[_0x64ed('0x48')][_0x64ed('0x6e')]},'attributes':['id',_0x64ed('0x2c'),_0x64ed('0x66'),'converted_format',_0x64ed('0x68')],'raw':!![]});}})[_0x64ed('0x26')](function(_0x208b4d){if(_0x208b4d){fs[_0x64ed('0x5f')](path[_0x64ed('0x54')](_0x3e7707['directory'],util[_0x64ed('0x6a')](_0x64ed('0x6b'),_0x208b4d[_0x64ed('0x2c')],_0x208b4d[_0x64ed('0x67')])));return _0x208b4d;}})[_0x64ed('0x47')](function(_0xdd2d92){throw new db[(_0x64ed('0x61'))]['ValidationError'](_0xdd2d92['message']);});})[_0x64ed('0x26')](handleEntityNotFound(_0x5520bd,null))['then'](respondWithStatusCode(_0x5520bd,0xcc))[_0x64ed('0x47')](handleError(_0x5520bd,null));};exports['getSounds']=function(_0x174bd5,_0x16b29b,_0x13c381){var _0x527454={};var _0x399ef3={};var _0x3ccd5a;var _0x209221;return db[_0x64ed('0x30')][_0x64ed('0x65')]({'where':{'id':_0x174bd5[_0x64ed('0x48')]['id']}})[_0x64ed('0x26')](handleEntityNotFound(_0x16b29b,null))['then'](function(_0x1095b0){if(_0x1095b0){_0x3ccd5a=_0x1095b0;_0x399ef3[_0x64ed('0x32')]=_[_0x64ed('0x34')](db['Sound'][_0x64ed('0x31')]);_0x399ef3[_0x64ed('0x33')]=_[_0x64ed('0x34')](_0x174bd5[_0x64ed('0x33')]);_0x399ef3['filters']=_[_0x64ed('0x36')](_0x399ef3[_0x64ed('0x32')],_0x399ef3[_0x64ed('0x33')]);_0x527454[_0x64ed('0x38')]=_['intersection'](_0x399ef3['model'],qs[_0x64ed('0x37')](_0x174bd5[_0x64ed('0x33')][_0x64ed('0x37')]));_0x527454[_0x64ed('0x38')]=_0x527454['attributes'][_0x64ed('0x49')]?_0x527454[_0x64ed('0x38')]:_0x399ef3[_0x64ed('0x32')];_0x527454['order']=qs[_0x64ed('0x3d')](_0x174bd5[_0x64ed('0x33')][_0x64ed('0x3d')]);_0x527454['where']=qs[_0x64ed('0x35')](_[_0x64ed('0x3e')](_0x174bd5[_0x64ed('0x33')],_0x399ef3['filters']));if(_0x174bd5[_0x64ed('0x33')][_0x64ed('0x3f')]){_0x527454[_0x64ed('0x40')]=_[_0x64ed('0x41')](_0x527454[_0x64ed('0x40')],{'$or':_[_0x64ed('0x2f')](_0x527454[_0x64ed('0x38')],function(_0x2e1aa6){var _0x3fc0dd={};_0x3fc0dd[_0x2e1aa6]={'$like':'%'+_0x174bd5[_0x64ed('0x33')][_0x64ed('0x3f')]+'%'};return _0x3fc0dd;})});}_0x527454=_[_0x64ed('0x41')]({},_0x527454,_0x174bd5[_0x64ed('0x4b')]);return _0x3ccd5a[_0x64ed('0x6f')](_0x527454);}})[_0x64ed('0x26')](function(_0x5b2bb6){if(_0x5b2bb6){_0x209221=_0x5b2bb6[_0x64ed('0x49')];if(!_0x174bd5[_0x64ed('0x33')][_0x64ed('0x39')](_0x64ed('0x3a'))){_0x527454[_0x64ed('0x3b')]=qs[_0x64ed('0x3b')](_0x174bd5[_0x64ed('0x33')][_0x64ed('0x3b')]);_0x527454[_0x64ed('0x21')]=qs['offset'](_0x174bd5['query'][_0x64ed('0x21')]);}return _0x3ccd5a[_0x64ed('0x6f')](_0x527454);}})[_0x64ed('0x26')](function(_0x44dce2){if(_0x44dce2){return _0x44dce2?{'count':_0x209221,'rows':_0x44dce2}:null;}})[_0x64ed('0x26')](respondWithResult(_0x16b29b,null))[_0x64ed('0x47')](handleError(_0x16b29b,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e43=['api','moment','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x4c6659,_0x45622b){var _0x3abc20=function(_0x427560){while(--_0x427560){_0x4c6659['push'](_0x4c6659['shift']());}};_0x3abc20(++_0x45622b);}(_0x6e43,0x11b));var _0x36e4=function(_0x30d0a4,_0x52475b){_0x30d0a4=_0x30d0a4-0x0;var _0x58d636=_0x6e43[_0x30d0a4];return _0x58d636;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var logger=require(_0x36e4('0x2'))(_0x36e4('0x3'));var moment=require(_0x36e4('0x4'));var BPromise=require(_0x36e4('0x5'));var rp=require(_0x36e4('0x6'));var fs=require('fs');var path=require(_0x36e4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x36e4('0x8'));module[_0x36e4('0x9')]=function(_0x5de7e3,_0x27719c){return _0x5de7e3[_0x36e4('0xa')](_0x36e4('0xb'),attributes,{'tableName':_0x36e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97b7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger'];(function(_0x4df30f,_0x1b6098){var _0x4e0a49=function(_0x58d1a){while(--_0x58d1a){_0x4df30f['push'](_0x4df30f['shift']());}};_0x4e0a49(++_0x1b6098);}(_0x97b7,0x178));var _0x797b=function(_0x47bedc,_0x3f2ca4){_0x47bedc=_0x47bedc-0x0;var _0x1bbc1a=_0x97b7[_0x47bedc];return _0x1bbc1a;};'use strict';var _=require('lodash');var util=require(_0x797b('0x0'));var logger=require(_0x797b('0x1'))(_0x797b('0x2'));var moment=require(_0x797b('0x3'));var BPromise=require(_0x797b('0x4'));var rp=require(_0x797b('0x5'));var fs=require('fs');var path=require(_0x797b('0x6'));var rimraf=require(_0x797b('0x7'));var config=require(_0x797b('0x8'));var attributes=require(_0x797b('0x9'));module[_0x797b('0xa')]=function(_0x593e17,_0x4f7356){return _0x593e17[_0x797b('0xb')](_0x797b('0xc'),attributes,{'tableName':_0x797b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x1a00e8,_0x2746b8){var _0x5acb59=function(_0x583908){while(--_0x583908){_0x1a00e8['push'](_0x1a00e8['shift']());}};_0x5acb59(++_0x2746b8);}(_0xedd9,0xfc));var _0x9edd=function(_0x48e697,_0x3d43d3){_0x48e697=_0x48e697-0x0;var _0x3a6f5f=_0xedd9[_0x48e697];return _0x3a6f5f;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x10940d,_0xaf6bbb){var _0x552f94=function(_0x261cab){while(--_0x261cab){_0x10940d['push'](_0x10940d['shift']());}};_0x552f94(++_0xaf6bbb);}(_0xedd9,0xfc));var _0x9edd=function(_0xf2cefe,_0x20c705){_0xf2cefe=_0xf2cefe-0x0;var _0x3fec6b=_0xedd9[_0xf2cefe];return _0x3fec6b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa12=['../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','addTeams','update','delete','destroy','removeTeams','exports','multer','util','path','Router','fs-extra'];(function(_0x58bba6,_0x49938f){var _0x54d408=function(_0x299411){while(--_0x299411){_0x58bba6['push'](_0x58bba6['shift']());}};_0x54d408(++_0x49938f);}(_0xfa12,0x1bd));var _0x2fa1=function(_0xf03b59,_0x45b9b3){_0xf03b59=_0xf03b59-0x0;var _0x54e57d=_0xfa12[_0xf03b59];return _0x54e57d;};'use strict';var multer=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var path=require(_0x2fa1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa1('0x3')]();var fs_extra=require(_0x2fa1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fa1('0x5'));var controller=require(_0x2fa1('0x6'));router[_0x2fa1('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fa1('0x8')]);router['get'](_0x2fa1('0x9'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xb')]);router[_0x2fa1('0x7')](_0x2fa1('0xc'),auth[_0x2fa1('0xa')](),controller['show']);router[_0x2fa1('0x7')](_0x2fa1('0xd'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0xe')]);router[_0x2fa1('0x7')](_0x2fa1('0xf'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x10')]);router['post']('/',auth[_0x2fa1('0xa')](),controller['create']);router[_0x2fa1('0x11')]('/:id/users',auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x12')]);router[_0x2fa1('0x11')](_0x2fa1('0xf'),auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x13')]);router['put'](_0x2fa1('0xc'),auth['isAuthenticated'](),controller[_0x2fa1('0x14')]);router[_0x2fa1('0x15')]('/:id',auth[_0x2fa1('0xa')](),controller[_0x2fa1('0x16')]);router[_0x2fa1('0x15')](_0x2fa1('0xd'),auth[_0x2fa1('0xa')](),controller['removeAgents']);router['delete'](_0x2fa1('0xf'),auth['isAuthenticated'](),controller[_0x2fa1('0x17')]);module[_0x2fa1('0x18')]=router;
\ No newline at end of file
+var _0x4eea=['create','addAgents','/:id/teams','addTeams','destroy','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','getTeams','post'];(function(_0x4d7f8a,_0x59c9fe){var _0x252cf8=function(_0x414b67){while(--_0x414b67){_0x4d7f8a['push'](_0x4d7f8a['shift']());}};_0x252cf8(++_0x59c9fe);}(_0x4eea,0x149));var _0xa4ee=function(_0x4ffb68,_0x4da1aa){_0x4ffb68=_0x4ffb68-0x0;var _0x4d44ab=_0x4eea[_0x4ffb68];return _0x4d44ab;};'use strict';var multer=require('multer');var util=require(_0xa4ee('0x0'));var path=require(_0xa4ee('0x1'));var timeout=require('connect-timeout');var express=require(_0xa4ee('0x2'));var router=express[_0xa4ee('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa4ee('0x4'));var interaction=require(_0xa4ee('0x5'));var config=require('../../config/environment');var controller=require(_0xa4ee('0x6'));router[_0xa4ee('0x7')]('/',auth[_0xa4ee('0x8')](),controller['index']);router['get']('/describe',auth[_0xa4ee('0x8')](),controller[_0xa4ee('0x9')]);router['get'](_0xa4ee('0xa'),auth[_0xa4ee('0x8')](),controller[_0xa4ee('0xb')]);router[_0xa4ee('0x7')](_0xa4ee('0xc'),auth[_0xa4ee('0x8')](),controller[_0xa4ee('0xd')]);router[_0xa4ee('0x7')]('/:id/teams',auth[_0xa4ee('0x8')](),controller[_0xa4ee('0xe')]);router[_0xa4ee('0xf')]('/',auth[_0xa4ee('0x8')](),controller[_0xa4ee('0x10')]);router['post'](_0xa4ee('0xc'),auth[_0xa4ee('0x8')](),controller[_0xa4ee('0x11')]);router[_0xa4ee('0xf')](_0xa4ee('0x12'),auth[_0xa4ee('0x8')](),controller[_0xa4ee('0x13')]);router['put'](_0xa4ee('0xa'),auth[_0xa4ee('0x8')](),controller['update']);router['delete']('/:id',auth[_0xa4ee('0x8')](),controller[_0xa4ee('0x14')]);router['delete']('/:id/users',auth[_0xa4ee('0x8')](),controller[_0xa4ee('0x15')]);router['delete'](_0xa4ee('0x12'),auth[_0xa4ee('0x8')](),controller['removeTeams']);module[_0xa4ee('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2935=['name','VIRTUAL','getDataValue','INTEGER','exports','STRING'];(function(_0x1d85e3,_0x125cff){var _0x38f84a=function(_0x1e481b){while(--_0x1e481b){_0x1d85e3['push'](_0x1d85e3['shift']());}};_0x38f84a(++_0x125cff);}(_0x2935,0x8e));var _0x5293=function(_0x4ddb18,_0x433cd5){_0x4ddb18=_0x4ddb18-0x0;var _0x453631=_0x2935[_0x4ddb18];return _0x453631;};'use strict';var Sequelize=require('sequelize');module[_0x5293('0x0')]={'name':{'type':Sequelize[_0x5293('0x1')],'allowNull':![],'unique':_0x5293('0x2')},'prefix':{'type':Sequelize[_0x5293('0x3')],'get':function(_0x4229ec){return'system-'+this[_0x5293('0x4')](_0x5293('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x5293('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x5293('0x5')]}};
\ No newline at end of file
+var _0x8924=['VIRTUAL','system-','getDataValue','name','INTEGER','sequelize','exports','STRING'];(function(_0x709c3a,_0x8b0d25){var _0x270b8c=function(_0x39f9ee){while(--_0x39f9ee){_0x709c3a['push'](_0x709c3a['shift']());}};_0x270b8c(++_0x8b0d25);}(_0x8924,0x15d));var _0x4892=function(_0x35e768,_0xbe0d60){_0x35e768=_0x35e768-0x0;var _0x58cc5f=_0x8924[_0x35e768];return _0x58cc5f;};'use strict';var Sequelize=require(_0x4892('0x0'));module[_0x4892('0x1')]={'name':{'type':Sequelize[_0x4892('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x4892('0x3')],'get':function(_0x321dca){return _0x4892('0x4')+this[_0x4892('0x5')](_0x4892('0x6'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x4892('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x4892('0x7')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e3f=['charAt','update','system-','findById','addAgents','ids','omit','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','online','voicePause','interface','flatMap','get','Agents','addTeams','each','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','join','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','findAll','catch','includeAll','include','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:'];(function(_0x11901e,_0x2896fa){var _0x3e99ae=function(_0x5be476){while(--_0x5be476){_0x11901e['push'](_0x11901e['shift']());}};_0x3e99ae(++_0x2896fa);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];config[_0xf8e3('0x1a')]=_[_0xf8e3('0x1b')](config[_0xf8e3('0x1a')],{'host':_0xf8e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8e3('0x1a')]));require(_0xf8e3('0x1d'))[_0xf8e3('0x1e')](socket);function respondWithStatusCode(_0x4af736,_0x44f631){_0x44f631=_0x44f631||0xcc;return function(_0x5136c6){if(_0x5136c6){return _0x4af736[_0xf8e3('0x1f')](_0x44f631);}return _0x4af736[_0xf8e3('0x20')](_0x44f631)[_0xf8e3('0x21')]();};}function respondWithResult(_0x570ee3,_0x529c92){_0x529c92=_0x529c92||0xc8;return function(_0x564f43){if(_0x564f43){return _0x570ee3[_0xf8e3('0x20')](_0x529c92)[_0xf8e3('0x22')](_0x564f43);}};}function respondWithFilteredResult(_0x3b01ac,_0x110a78){return function(_0x11d4cc){if(_0x11d4cc){var _0x7a81c3=typeof _0x110a78[_0xf8e3('0x23')]===_0xf8e3('0x24')&&typeof _0x110a78[_0xf8e3('0x25')]==='undefined';var _0x20cc64=_0x11d4cc[_0xf8e3('0x26')];var _0x24e8d6=_0x7a81c3?0x0:_0x110a78[_0xf8e3('0x23')];var _0x3128ad=_0x7a81c3?_0x11d4cc[_0xf8e3('0x26')]:_0x110a78[_0xf8e3('0x23')]+_0x110a78[_0xf8e3('0x25')];var _0x5b99b1;if(_0x3128ad>=_0x20cc64){_0x3128ad=_0x20cc64;_0x5b99b1=0xc8;}else{_0x5b99b1=0xce;}_0x3b01ac[_0xf8e3('0x20')](_0x5b99b1);return _0x3b01ac[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x24e8d6+'-'+_0x3128ad+'/'+_0x20cc64)[_0xf8e3('0x22')](_0x11d4cc);}return null;};}function patchUpdates(_0x4a1e5f){return function(_0x39df34){try{jsonpatch['apply'](_0x39df34,_0x4a1e5f,!![]);}catch(_0x286059){return BPromise[_0xf8e3('0x29')](_0x286059);}return _0x39df34[_0xf8e3('0x2a')]();};}function saveUpdates(_0x2dc856,_0x1f4b68){return function(_0x3ac384){if(_0x3ac384){return _0x3ac384['update'](_0x2dc856)[_0xf8e3('0x2b')](function(_0x2fc674){return _0x2fc674;});}return null;};}function removeEntity(_0x3373ca,_0x417b42){return function(_0x1f1363){if(_0x1f1363){return _0x1f1363[_0xf8e3('0x2c')]()[_0xf8e3('0x2b')](function(){var _0x157a2d=_0x1f1363['get']({'plain':!![]});var _0x356e0a=_0xf8e3('0x2d');return db[_0xf8e3('0x2e')][_0xf8e3('0x2c')]({'where':{'type':_0x356e0a,'resourceId':_0x157a2d['id']}})[_0xf8e3('0x2b')](function(){return _0x1f1363;});})[_0xf8e3('0x2b')](function(){_0x3373ca[_0xf8e3('0x20')](0xcc)[_0xf8e3('0x21')]();});}};}function handleEntityNotFound(_0x4f2ae9,_0x21e1c0){return function(_0x243e28){if(!_0x243e28){_0x4f2ae9[_0xf8e3('0x1f')](0x194);}return _0x243e28;};}function handleError(_0x28b2f2,_0x567153){_0x567153=_0x567153||0x1f4;return function(_0x2e507c){logger[_0xf8e3('0x2f')](_0x2e507c[_0xf8e3('0x30')]);if(_0x2e507c[_0xf8e3('0x31')]){delete _0x2e507c[_0xf8e3('0x31')];}_0x28b2f2[_0xf8e3('0x20')](_0x567153)[_0xf8e3('0x32')](_0x2e507c);};}exports[_0xf8e3('0x33')]=function(_0x50ad3f,_0x2c07bf){var _0x527337={},_0x4acd6c={},_0x5d2dd5={'count':0x0,'rows':[]};var _0x5cc1ed=_[_0xf8e3('0x34')](db['VoicePrefix'][_0xf8e3('0x35')],function(_0x41faaa){return{'name':_0x41faaa[_0xf8e3('0x36')],'type':_0x41faaa[_0xf8e3('0x37')]['key']};});_0x4acd6c['model']=_[_0xf8e3('0x34')](_0x5cc1ed,_0xf8e3('0x31'));_0x4acd6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x50ad3f[_0xf8e3('0x38')]);_0x4acd6c[_0xf8e3('0x3a')]=_['intersection'](_0x4acd6c[_0xf8e3('0x3b')],_0x4acd6c['query']);_0x527337['attributes']=_[_0xf8e3('0x3c')](_0x4acd6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x50ad3f[_0xf8e3('0x38')]['fields']));_0x527337['attributes']=_0x527337[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x527337['attributes']:_0x4acd6c[_0xf8e3('0x3b')];if(!_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x40')](_0xf8e3('0x41'))){_0x527337['limit']=qs['limit'](_0x50ad3f['query'][_0xf8e3('0x25')]);_0x527337[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x50ad3f[_0xf8e3('0x38')]['offset']);}_0x527337[_0xf8e3('0x42')]=qs['sort'](_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x527337[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x50ad3f[_0xf8e3('0x38')],_0x4acd6c[_0xf8e3('0x3a')]),_0x5cc1ed);if(_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x527337['where']=_[_0xf8e3('0x47')](_0x527337['where'],{'$or':_[_0xf8e3('0x34')](_0x5cc1ed,function(_0x1e8917){if(_0x1e8917[_0xf8e3('0x37')]!==_0xf8e3('0x48')){var _0x64bfc6={};_0x64bfc6[_0x1e8917[_0xf8e3('0x31')]]={'$like':'%'+_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x64bfc6;}})});}_0x527337=_['merge']({},_0x527337,_0x50ad3f[_0xf8e3('0x49')]);var _0x108b81={'where':_0x527337[_0xf8e3('0x44')]};return db[_0xf8e3('0x4a')][_0xf8e3('0x26')](_0x108b81)[_0xf8e3('0x2b')](function(_0x792190){_0x5d2dd5[_0xf8e3('0x26')]=_0x792190;if(_0x50ad3f['query']['includeAll']){_0x527337['include']=[{'all':!![]}];}return db[_0xf8e3('0x4a')][_0xf8e3('0x4b')](_0x527337);})['then'](function(_0x181908){_0x5d2dd5['rows']=_0x181908;return _0x5d2dd5;})[_0xf8e3('0x2b')](respondWithFilteredResult(_0x2c07bf,_0x527337))[_0xf8e3('0x4c')](handleError(_0x2c07bf,null));};exports['show']=function(_0x1fb64d,_0x4b0791){var _0x679519={'raw':![],'where':{'id':_0x1fb64d['params']['id']}},_0x6875a6={};_0x6875a6[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db[_0xf8e3('0x4a')][_0xf8e3('0x35')]);_0x6875a6['query']=_['keys'](_0x1fb64d['query']);_0x6875a6[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x6875a6[_0xf8e3('0x3b')],_0x6875a6['query']);_0x679519[_0xf8e3('0x3e')]=_['intersection'](_0x6875a6[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x1fb64d['query']['fields']));_0x679519[_0xf8e3('0x3e')]=_0x679519[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x679519[_0xf8e3('0x3e')]:_0x6875a6[_0xf8e3('0x3b')];if(_0x1fb64d[_0xf8e3('0x38')][_0xf8e3('0x4d')]){_0x679519[_0xf8e3('0x4e')]=[{'all':!![]}];}_0x679519=_[_0xf8e3('0x47')]({},_0x679519,_0x1fb64d[_0xf8e3('0x49')]);return db[_0xf8e3('0x4a')]['find'](_0x679519)[_0xf8e3('0x2b')](handleEntityNotFound(_0x4b0791,null))[_0xf8e3('0x2b')](respondWithResult(_0x4b0791,null))[_0xf8e3('0x4c')](handleError(_0x4b0791,null));};exports[_0xf8e3('0x2c')]=function(_0x385a8f,_0x3256e6){return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x385a8f[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3256e6,null))[_0xf8e3('0x2b')](removeEntity(_0x3256e6,null))[_0xf8e3('0x4c')](handleError(_0x3256e6,null));};exports[_0xf8e3('0x51')]=function(_0x5855f2,_0x260f67){return db[_0xf8e3('0x4a')][_0xf8e3('0x51')]()[_0xf8e3('0x2b')](respondWithResult(_0x260f67,null))[_0xf8e3('0x4c')](handleError(_0x260f67,null));};exports[_0xf8e3('0x52')]=function(_0x5990fc,_0x394e45){var _0x1f425f;return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x452b00){return db['VoicePrefix'][_0xf8e3('0x52')](_0x5990fc[_0xf8e3('0x55')],{'transaction':_0x452b00})[_0xf8e3('0x2b')](function(_0x53c897){_0x1f425f=_0x53c897['get']({'plain':!![]});return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x1f425f[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x58ad2f){return createVoicePrefixExtensions(_0x1f425f,_0x58ad2f,_0x452b00);});});})[_0xf8e3('0x2b')](function(){var _0x16bddb=_0x5990fc['user']['get']({'plain':!![]});if(!_0x16bddb)throw new Error(_0xf8e3('0x58'));if(_0x16bddb[_0xf8e3('0x59')]===_0xf8e3('0x5a')){var _0x505477=_0x1f425f;return db['UserProfileSection']['find']({'where':{'name':_0xf8e3('0x2d'),'userProfileId':_0x16bddb[_0xf8e3('0x5b')]},'raw':!![]})['then'](function(_0x4937fc){if(_0x4937fc&&_0x4937fc['autoAssociation']===0x0){return db[_0xf8e3('0x2e')][_0xf8e3('0x52')]({'name':_0x505477['name'],'resourceId':_0x505477['id'],'type':_0x4937fc[_0xf8e3('0x31')],'sectionId':_0x4937fc['id']},{})[_0xf8e3('0x2b')](function(){return _0x1f425f;});}else{return _0x1f425f;}})[_0xf8e3('0x4c')](function(_0x560f42){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560f42);throw _0x560f42;});}return _0x1f425f;})['then'](respondWithResult(_0x394e45,null))[_0xf8e3('0x4c')](handleError(_0x394e45,null));};function Extension(_0x3b120a,_0x3ef144,_0x447efe,_0x442349){this[_0xf8e3('0x5c')]=_0xf8e3('0x5d');this[_0xf8e3('0x5e')]=_0x3b120a;this[_0xf8e3('0x5f')]=_0x447efe;this['type']='system';this[_0xf8e3('0x60')]=_0xf8e3('0x61');this[_0xf8e3('0x62')]=_0x3ef144;this['appdata']=_0x442349;}function createVoicePrefixExtensions(_0x234b06,_0x131c0b,_0x4879c7){return new BPromise(function(_0x48bb3f,_0x256cd5){var _0x4763eb=new Extension(formatPrefixName(_0x234b06[_0xf8e3('0x63')]),0x1,_0xf8e3('0x64'),'Voice\x20Prefix');_0x4763eb['VoicePrefixId']=_0x234b06['id'];return db[_0xf8e3('0x56')][_0xf8e3('0x52')](_0x4763eb,{'transaction':_0x4879c7})[_0xf8e3('0x2b')](function(_0x392d99){var _0x4f1ddb=_0x392d99['get']({'plain':!![]});var _0x324ad5=_[_0xf8e3('0x34')](addVoicePrefixExtensions(_0x234b06,_0x131c0b),function(_0x56a07e){_0x56a07e[_0xf8e3('0x57')]=_0x4f1ddb['id'];_0x56a07e[_0xf8e3('0x65')]=_0x234b06['id'];return _0x56a07e;});return db[_0xf8e3('0x56')][_0xf8e3('0x66')](_0x324ad5,{'transaction':_0x4879c7})['then'](function(_0x11ebb2){if(!_0x11ebb2){return _0x256cd5('Extensions\x20creation\x20failed');}else{return _0x48bb3f(_0x11ebb2);}})[_0xf8e3('0x4c')](function(_0x1cad38){return _0x256cd5(_0x1cad38);});});;});};function addVoicePrefixExtensions(_0x5cbdc6,_0x2ec4f6){var _0x31568b=[];var _0x55418c=formatPrefixName(_0x5cbdc6[_0xf8e3('0x63')]);_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x2,_0xf8e3('0x68'),_0xf8e3('0x69')+_0x5cbdc6['name']));if(_0x5cbdc6[_0xf8e3('0x6a')]){_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x68'),_0xf8e3('0x6b')+_0x5cbdc6[_0xf8e3('0x6a')]));}else{_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x64'),_0xf8e3('0x6c')));}_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x4,_0xf8e3('0x6d'),_0x2ec4f6[_0xf8e3('0x5c')]+','+_0xf8e3('0x6e')+(0x8+_0x5cbdc6['name']['length'])+'}'+','+0x1));return _0x31568b;}function formatPrefixName(_0x2f6cf4){var _0x32eaab='_';for(var _0x5ccdb2=0x0;_0x5ccdb2<_0x2f6cf4[_0xf8e3('0x3f')];_0x5ccdb2++){if(_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)=='-'){_0x32eaab+=_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2);}else{_0x32eaab+='['+_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)+']';}}_0x32eaab+='.';return _0x32eaab;}exports[_0xf8e3('0x70')]=function(_0x5804eb,_0x3e501c,_0x1dcd23){var _0x52e996=_0x5804eb[_0xf8e3('0x55')];_0x52e996['prefix']=_0xf8e3('0x71')+_0x52e996['name']+'-';return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x45361d){return db[_0xf8e3('0x4a')][_0xf8e3('0x70')](_0x52e996,{'where':{'id':_0x52e996['id']},'transaction':_0x45361d})['then'](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x2c')]({'where':{'VoicePrefixId':_0x52e996['id']},'transaction':_0x45361d})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x52e996[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x2ccd34){return createVoicePrefixExtensions(_0x52e996,_0x2ccd34,_0x45361d);});});});})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x4a')][_0xf8e3('0x72')](_0x52e996['id']);})[_0xf8e3('0x2b')](respondWithResult(_0x3e501c,null))['catch'](handleError(_0x3e501c,null));};exports[_0xf8e3('0x73')]=function(_0x280f06,_0x3dc049,_0x4b69db){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x280f06[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3dc049,null))[_0xf8e3('0x2b')](function(_0x40174a){if(_0x40174a){return _0x40174a[_0xf8e3('0x73')](_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')],_[_0xf8e3('0x75')](_0x280f06[_0xf8e3('0x55')],[_0xf8e3('0x74'),'id'])||{})['spread'](function(_0x118cc6){for(var _0xf7cb3a=0x0;_0xf7cb3a<_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')]['length'];_0xf7cb3a+=0x1){socket['emit'](_0xf8e3('0x76'),{'UserId':Number(_0x280f06[_0xf8e3('0x55')]['ids'][_0xf7cb3a]),'VoicePrefixId':Number(_0x280f06['params']['id'])});}return _0x118cc6;});}})[_0xf8e3('0x2b')](respondWithResult(_0x3dc049,null))[_0xf8e3('0x4c')](handleError(_0x3dc049,null));};exports['removeAgents']=function(_0x2a2c6,_0xca5962,_0x16e69a){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x2a2c6['params']['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xca5962,null))[_0xf8e3('0x2b')](function(_0x54db4e){if(_0x54db4e){return _0x54db4e['removeAgents'](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])[_0xf8e3('0x2b')](function(){if(_[_0xf8e3('0x77')](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])){for(var _0x3823b9=0x0;_0x3823b9<_0x2a2c6[_0xf8e3('0x38')]['ids'][_0xf8e3('0x3f')];_0x3823b9+=0x1){socket[_0xf8e3('0x78')](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')][_0x3823b9]),'VoicePrefixId':Number(_0x2a2c6[_0xf8e3('0x50')]['id'])});}}else{socket['emit'](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')]),'VoicePrefixId':Number(_0x2a2c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xca5962,null))[_0xf8e3('0x4c')](handleError(_0xca5962,null));};exports[_0xf8e3('0x7a')]=function(_0x25805c,_0xc01ac,_0x4659ed){var _0x5b8840={};var _0x25bf6c={};var _0x1f5a80;var _0x1bfe33;return db[_0xf8e3('0x4a')][_0xf8e3('0x7b')]({'where':{'id':_0x25805c[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xc01ac,null))[_0xf8e3('0x2b')](function(_0x40b66c){if(_0x40b66c){_0x1f5a80=_0x40b66c;_0x25bf6c['model']=_[_0xf8e3('0x39')](db[_0xf8e3('0x7c')][_0xf8e3('0x35')]);_0x25bf6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x25805c[_0xf8e3('0x38')]);_0x25bf6c[_0xf8e3('0x3a')]=_['intersection'](_0x25bf6c['model'],_0x25bf6c[_0xf8e3('0x38')]);_0x5b8840[_0xf8e3('0x3e')]=_['intersection'](_0x25bf6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x5b8840[_0xf8e3('0x3e')]=_0x5b8840[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x5b8840['attributes']:_0x25bf6c[_0xf8e3('0x3b')];_0x5b8840[_0xf8e3('0x42')]=qs[_0xf8e3('0x43')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x5b8840[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x25805c[_0xf8e3('0x38')],_0x25bf6c[_0xf8e3('0x3a')]));if(_0x25805c[_0xf8e3('0x38')]['filter']){_0x5b8840['where']=_[_0xf8e3('0x47')](_0x5b8840['where'],{'$or':_[_0xf8e3('0x34')](_0x5b8840['attributes'],function(_0x1a3843){var _0x1b2249={};_0x1b2249[_0x1a3843]={'$like':'%'+_0x25805c[_0xf8e3('0x38')]['filter']+'%'};return _0x1b2249;})});}_0x5b8840=_[_0xf8e3('0x47')]({},_0x5b8840,_0x25805c[_0xf8e3('0x49')]);return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x3619cd){if(_0x3619cd){_0x1bfe33=_0x3619cd['length'];if(!_0x25805c[_0xf8e3('0x38')]['hasOwnProperty'](_0xf8e3('0x41'))){_0x5b8840[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x5b8840[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x25805c['query'][_0xf8e3('0x23')]);}return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x1a9ba6){if(_0x1a9ba6){return _0x1a9ba6?{'count':_0x1bfe33,'rows':_0x1a9ba6}:null;}})['then'](respondWithResult(_0xc01ac,null))[_0xf8e3('0x4c')](handleError(_0xc01ac,null));};exports[_0xf8e3('0x7d')]=function(_0x3f7c0e,_0x2da8fb,_0x22fa2f){var _0x18fbd2={};var _0x477589={};var _0x1bb12c;var _0x4a5ad8;return db['VoicePrefix'][_0xf8e3('0x7b')]({'where':{'id':_0x3f7c0e[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x2da8fb,null))[_0xf8e3('0x2b')](function(_0x131625){if(_0x131625){_0x1bb12c=_0x131625;_0x477589[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db['Team'][_0xf8e3('0x35')]);_0x477589['query']=_[_0xf8e3('0x39')](_0x3f7c0e[_0xf8e3('0x38')]);_0x477589[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x477589['model'],_0x477589[_0xf8e3('0x38')]);_0x18fbd2['attributes']=_['intersection'](_0x477589[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x18fbd2['attributes']=_0x18fbd2['attributes'][_0xf8e3('0x3f')]?_0x18fbd2[_0xf8e3('0x3e')]:_0x477589['model'];_0x18fbd2['order']=qs[_0xf8e3('0x43')](_0x3f7c0e[_0xf8e3('0x38')]['sort']);_0x18fbd2[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x3f7c0e[_0xf8e3('0x38')],_0x477589[_0xf8e3('0x3a')]));if(_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x18fbd2['where']=_[_0xf8e3('0x47')](_0x18fbd2[_0xf8e3('0x44')],{'$or':_['map'](_0x18fbd2[_0xf8e3('0x3e')],function(_0x4a8866){var _0x1ca81d={};_0x1ca81d[_0x4a8866]={'$like':'%'+_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x1ca81d;})});}_0x18fbd2=_['merge']({},_0x18fbd2,_0x3f7c0e[_0xf8e3('0x49')]);return _0x1bb12c['getTeams'](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x41ca1b){if(_0x41ca1b){_0x4a5ad8=_0x41ca1b[_0xf8e3('0x3f')];if(!_0x3f7c0e[_0xf8e3('0x38')]['hasOwnProperty']('nolimit')){_0x18fbd2[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x18fbd2[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x3f7c0e['query'][_0xf8e3('0x23')]);}return _0x1bb12c[_0xf8e3('0x7d')](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x348e59){if(_0x348e59){return _0x348e59?{'count':_0x4a5ad8,'rows':_0x348e59}:null;}})['then'](respondWithResult(_0x2da8fb,null))[_0xf8e3('0x4c')](handleError(_0x2da8fb,null));};exports['addTeams']=function(_0x3b51c7,_0xf88bb2,_0x4b27e3){var _0x108168=_0x3b51c7['body'][_0xf8e3('0x74')];var _0x3fba66;return db['Team'][_0xf8e3('0x4b')]({'where':{'id':_0x108168},'attributes':['id'],'include':[{'model':db[_0xf8e3('0x7c')],'as':'Agents','attributes':['id',_0xf8e3('0x31'),_0xf8e3('0x7e'),_0xf8e3('0x7f'),_0xf8e3('0x80')],'raw':!![]}]})[_0xf8e3('0x2b')](function(_0x3b79e1){if(_0x3b79e1){_0x3fba66=_0x3b79e1;var _0x13f467=_[_0xf8e3('0x81')](_0x3b79e1,function(_0x29c04b){var _0x271ed0=_0x29c04b[_0xf8e3('0x82')]({'plain':!![]});return _0x271ed0[_0xf8e3('0x83')];});return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x3b51c7[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](function(_0x48230e){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x7e83fd){return _0x48230e[_0xf8e3('0x84')](_0x108168,{'transaction':_0x7e83fd})[_0xf8e3('0x2b')](function(){return BPromise[_0xf8e3('0x85')](_0x3fba66,function(_0x6d4c09){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x6d4c09['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},{'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){return BPromise['each'](_0x13f467,function(_0x1a85cf){return db[_0xf8e3('0x86')]['findOrCreate']({'where':{'UserId':_0x1a85cf['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){_0x13f467[_0xf8e3('0x87')](function(_0x27d0b6){socket[_0xf8e3('0x78')]('userVoicePrefix:save',{'UserId':_0x27d0b6['id'],'VoicePrefixId':_0x48230e['id']});});});});});}})[_0xf8e3('0x2b')](respondWithStatusCode(_0xf88bb2,null))[_0xf8e3('0x4c')](handleError(_0xf88bb2,null));};exports['removeTeams']=function(_0x4f02bb,_0x237eb6,_0xd9e796){return db[_0xf8e3('0x88')][_0xf8e3('0x4b')]({'where':{'id':_0x4f02bb[_0xf8e3('0x38')][_0xf8e3('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf8e3('0x83'),'attributes':['id'],'raw':!![]}]})[_0xf8e3('0x2b')](handleEntityNotFound(_0x237eb6,null))['then'](function(_0x5ae078){var _0x512d8d=_[_0xf8e3('0x34')](_0x5ae078,'id');var _0x186e42=[];var _0x417af2=[];var _0x29f5d0=squel[_0xf8e3('0x89')]();_0x29f5d0[_0xf8e3('0x8a')](_0xf8e3('0x8b'))['from']('team_has_voice_prefixes','tq')[_0xf8e3('0x8c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf8e3('0x44')](_0xf8e3('0x8d'),_0x4f02bb['params']['id']);for(var _0x1cff32=0x0;_0x1cff32<_0x5ae078[_0xf8e3('0x3f')];_0x1cff32+=0x1){let _0x876d0c=_0x5ae078[_0x1cff32];for(var _0x2c4060=0x0;_0x2c4060<_0x876d0c[_0xf8e3('0x83')][_0xf8e3('0x3f')];_0x2c4060+=0x1){let _0x1b8e99=_0x876d0c[_0xf8e3('0x83')][_0x2c4060];var _0x107896=_0x29f5d0[_0xf8e3('0x8e')]();_0x107896[_0xf8e3('0x44')](_0xf8e3('0x8f'),_0x1b8e99['id']);_0x417af2[_0xf8e3('0x67')](db[_0xf8e3('0x53')][_0xf8e3('0x38')](_0x107896['toString'](),{'type':db[_0xf8e3('0x53')][_0xf8e3('0x90')]['SELECT']})[_0xf8e3('0x2b')](function(_0x4e8329){if(_0x4e8329['length']===0x1){return _0x1b8e99['id'];}else{var _0x5a66ee=_[_0xf8e3('0x91')](_[_0xf8e3('0x34')](_0x4e8329,'TeamId'),function(_0x207393){return _[_0xf8e3('0x92')](_0x512d8d,_0x207393);});if(_0x5a66ee){return _0x1b8e99['id'];}}}));}}return BPromise[_0xf8e3('0x93')](_0x417af2)['then'](function(_0x3a39a8){_0x186e42=_(_0x186e42)[_0xf8e3('0x94')](_0x3a39a8)[_0xf8e3('0x95')]()['value']();return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x4f02bb[_0xf8e3('0x50')]['id']}})['then'](function(_0x42d800){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x13782d){return _0x42d800[_0xf8e3('0x96')](_0x4f02bb[_0xf8e3('0x38')]['ids'],{'transaction':_0x13782d})[_0xf8e3('0x2b')](function(){if(!_[_0xf8e3('0x97')](_0x186e42)){return _0x42d800['removeAgents'](_0x186e42,{'transaction':_0x13782d});}})[_0xf8e3('0x2b')](function(){_0x186e42[_0xf8e3('0x87')](function(_0xcf534f){socket[_0xf8e3('0x78')]('userVoicePrefix:remove',{'UserId':_0xcf534f,'VoicePrefixId':_0x42d800['id']});});});});});});})[_0xf8e3('0x2b')](respondWithStatusCode(_0x237eb6,null))['catch'](handleError(_0x237eb6,null));};
\ No newline at end of file
+var _0x5464=['findById','addAgents','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','order','options','nolimit','getTeams','Team','addTeams','online','interface','flatMap','each','TeamVoicePrefix','upsert','forEach','removeTeams','Agents','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','type','description','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-'];(function(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0x5464,0x15d));var _0x4546=function(_0x36bf98,_0x878cc9){_0x36bf98=_0x36bf98-0x0;var _0x3a6f7a=_0x5464[_0x36bf98];return _0x3a6f7a;};'use strict';var emlformat=require(_0x4546('0x0'));var rimraf=require(_0x4546('0x1'));var zipdir=require(_0x4546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4546('0x3'));var moment=require('moment');var BPromise=require(_0x4546('0x4'));var Mustache=require('mustache');var util=require(_0x4546('0x5'));var path=require(_0x4546('0x6'));var sox=require(_0x4546('0x7'));var csv=require(_0x4546('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0x8'));var querystring=require(_0x4546('0xd'));var Papa=require(_0x4546('0xe'));var Redis=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x11'));var hardwareService=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))('api');var utils=require(_0x4546('0x14'));var config=require(_0x4546('0x15'));var licenseUtil=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];config['redis']=_['defaults'](config[_0x4546('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x4f5571,_0x102180){_0x102180=_0x102180||0xcc;return function(_0x51e279){if(_0x51e279){return _0x4f5571[_0x4546('0x19')](_0x102180);}return _0x4f5571['status'](_0x102180)[_0x4546('0x1a')]();};}function respondWithResult(_0x564f3e,_0x3741f2){_0x3741f2=_0x3741f2||0xc8;return function(_0x18bc09){if(_0x18bc09){return _0x564f3e[_0x4546('0x1b')](_0x3741f2)[_0x4546('0x1c')](_0x18bc09);}};}function respondWithFilteredResult(_0x2a294b,_0x15e09e){return function(_0x57d8de){if(_0x57d8de){var _0x4ffd6b=typeof _0x15e09e['offset']===_0x4546('0x1d')&&typeof _0x15e09e[_0x4546('0x1e')]===_0x4546('0x1d');var _0x3d95c2=_0x57d8de[_0x4546('0x1f')];var _0x337a44=_0x4ffd6b?0x0:_0x15e09e[_0x4546('0x20')];var _0x2f6329=_0x4ffd6b?_0x57d8de[_0x4546('0x1f')]:_0x15e09e[_0x4546('0x20')]+_0x15e09e['limit'];var _0x2d689f;if(_0x2f6329>=_0x3d95c2){_0x2f6329=_0x3d95c2;_0x2d689f=0xc8;}else{_0x2d689f=0xce;}_0x2a294b[_0x4546('0x1b')](_0x2d689f);return _0x2a294b['set'](_0x4546('0x21'),_0x337a44+'-'+_0x2f6329+'/'+_0x3d95c2)[_0x4546('0x1c')](_0x57d8de);}return null;};}function patchUpdates(_0x1a1984){return function(_0x2f065d){try{jsonpatch[_0x4546('0x22')](_0x2f065d,_0x1a1984,!![]);}catch(_0x15b013){return BPromise['reject'](_0x15b013);}return _0x2f065d[_0x4546('0x23')]();};}function saveUpdates(_0x2cca8b,_0x4f9fcf){return function(_0x824698){if(_0x824698){return _0x824698[_0x4546('0x24')](_0x2cca8b)[_0x4546('0x25')](function(_0x4467ee){return _0x4467ee;});}return null;};}function removeEntity(_0x23084b,_0x53ae5e){return function(_0x49dc98){if(_0x49dc98){return _0x49dc98[_0x4546('0x26')]()[_0x4546('0x25')](function(){var _0x48fc36=_0x49dc98['get']({'plain':!![]});var _0x43740e=_0x4546('0x27');return db[_0x4546('0x28')][_0x4546('0x26')]({'where':{'type':_0x43740e,'resourceId':_0x48fc36['id']}})[_0x4546('0x25')](function(){return _0x49dc98;});})[_0x4546('0x25')](function(){_0x23084b[_0x4546('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367b23,_0x52c546){return function(_0x3a2d12){if(!_0x3a2d12){_0x367b23[_0x4546('0x19')](0x194);}return _0x3a2d12;};}function handleError(_0x5396c5,_0x539f74){_0x539f74=_0x539f74||0x1f4;return function(_0xf7a95b){logger['error'](_0xf7a95b[_0x4546('0x29')]);if(_0xf7a95b[_0x4546('0x2a')]){delete _0xf7a95b['name'];}_0x5396c5['status'](_0x539f74)[_0x4546('0x2b')](_0xf7a95b);};}exports[_0x4546('0x2c')]=function(_0x258d26,_0x5716dc){var _0x10db2e={},_0x2c8e44={},_0x540983={'count':0x0,'rows':[]};var _0xad1b9c=_['map'](db[_0x4546('0x2d')][_0x4546('0x2e')],function(_0xe89b7c){return{'name':_0xe89b7c[_0x4546('0x2f')],'type':_0xe89b7c['type'][_0x4546('0x30')]};});_0x2c8e44[_0x4546('0x31')]=_[_0x4546('0x32')](_0xad1b9c,_0x4546('0x2a'));_0x2c8e44[_0x4546('0x33')]=_[_0x4546('0x34')](_0x258d26['query']);_0x2c8e44[_0x4546('0x35')]=_[_0x4546('0x36')](_0x2c8e44['model'],_0x2c8e44['query']);_0x10db2e[_0x4546('0x37')]=_[_0x4546('0x36')](_0x2c8e44['model'],qs[_0x4546('0x38')](_0x258d26[_0x4546('0x33')]['fields']));_0x10db2e['attributes']=_0x10db2e[_0x4546('0x37')][_0x4546('0x39')]?_0x10db2e[_0x4546('0x37')]:_0x2c8e44[_0x4546('0x31')];if(!_0x258d26[_0x4546('0x33')][_0x4546('0x3a')]('nolimit')){_0x10db2e[_0x4546('0x1e')]=qs[_0x4546('0x1e')](_0x258d26['query'][_0x4546('0x1e')]);_0x10db2e['offset']=qs[_0x4546('0x20')](_0x258d26[_0x4546('0x33')]['offset']);}_0x10db2e['order']=qs[_0x4546('0x3b')](_0x258d26[_0x4546('0x33')][_0x4546('0x3b')]);_0x10db2e['where']=qs[_0x4546('0x35')](_[_0x4546('0x3c')](_0x258d26[_0x4546('0x33')],_0x2c8e44[_0x4546('0x35')]),_0xad1b9c);if(_0x258d26[_0x4546('0x33')][_0x4546('0x3d')]){_0x10db2e[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x10db2e['where'],{'$or':_[_0x4546('0x32')](_0xad1b9c,function(_0x9bedd7){if(_0x9bedd7['type']!=='VIRTUAL'){var _0x3bafee={};_0x3bafee[_0x9bedd7[_0x4546('0x2a')]]={'$like':'%'+_0x258d26[_0x4546('0x33')][_0x4546('0x3d')]+'%'};return _0x3bafee;}})});}_0x10db2e=_[_0x4546('0x3f')]({},_0x10db2e,_0x258d26['options']);var _0x977146={'where':_0x10db2e[_0x4546('0x3e')]};return db[_0x4546('0x2d')][_0x4546('0x1f')](_0x977146)[_0x4546('0x25')](function(_0x3fabf0){_0x540983[_0x4546('0x1f')]=_0x3fabf0;if(_0x258d26[_0x4546('0x33')][_0x4546('0x40')]){_0x10db2e['include']=[{'all':!![]}];}return db[_0x4546('0x2d')][_0x4546('0x41')](_0x10db2e);})[_0x4546('0x25')](function(_0x35b51e){_0x540983[_0x4546('0x42')]=_0x35b51e;return _0x540983;})[_0x4546('0x25')](respondWithFilteredResult(_0x5716dc,_0x10db2e))[_0x4546('0x43')](handleError(_0x5716dc,null));};exports[_0x4546('0x44')]=function(_0x426eb9,_0x44752d){var _0x19cdad={'raw':![],'where':{'id':_0x426eb9[_0x4546('0x45')]['id']}},_0x524702={};_0x524702[_0x4546('0x31')]=_['keys'](db[_0x4546('0x2d')][_0x4546('0x2e')]);_0x524702[_0x4546('0x33')]=_['keys'](_0x426eb9[_0x4546('0x33')]);_0x524702[_0x4546('0x35')]=_[_0x4546('0x36')](_0x524702[_0x4546('0x31')],_0x524702[_0x4546('0x33')]);_0x19cdad[_0x4546('0x37')]=_[_0x4546('0x36')](_0x524702[_0x4546('0x31')],qs[_0x4546('0x38')](_0x426eb9[_0x4546('0x33')]['fields']));_0x19cdad[_0x4546('0x37')]=_0x19cdad[_0x4546('0x37')]['length']?_0x19cdad[_0x4546('0x37')]:_0x524702[_0x4546('0x31')];if(_0x426eb9[_0x4546('0x33')][_0x4546('0x40')]){_0x19cdad['include']=[{'all':!![]}];}_0x19cdad=_[_0x4546('0x3f')]({},_0x19cdad,_0x426eb9['options']);return db[_0x4546('0x2d')][_0x4546('0x46')](_0x19cdad)[_0x4546('0x25')](handleEntityNotFound(_0x44752d,null))['then'](respondWithResult(_0x44752d,null))[_0x4546('0x43')](handleError(_0x44752d,null));};exports[_0x4546('0x26')]=function(_0x13f705,_0xc8a1f3){return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x13f705[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0xc8a1f3,null))[_0x4546('0x25')](removeEntity(_0xc8a1f3,null))[_0x4546('0x43')](handleError(_0xc8a1f3,null));};exports[_0x4546('0x47')]=function(_0x49b0d8,_0x2778f2){return db[_0x4546('0x2d')]['describe']()[_0x4546('0x25')](respondWithResult(_0x2778f2,null))[_0x4546('0x43')](handleError(_0x2778f2,null));};exports[_0x4546('0x48')]=function(_0x4ca3a6,_0x422ebc){var _0x31dc1e;return db[_0x4546('0x49')][_0x4546('0x4a')](function(_0x10dfd6){return db[_0x4546('0x2d')][_0x4546('0x48')](_0x4ca3a6[_0x4546('0x4b')],{'transaction':_0x10dfd6})[_0x4546('0x25')](function(_0x15365d){_0x31dc1e=_0x15365d[_0x4546('0x4c')]({'plain':!![]});return db[_0x4546('0x4d')][_0x4546('0x46')]({'where':{'id':_0x31dc1e[_0x4546('0x4e')]},'raw':!![]})[_0x4546('0x25')](function(_0x456ebe){return createVoicePrefixExtensions(_0x31dc1e,_0x456ebe,_0x10dfd6);});});})['then'](function(){var _0x3e13ab=_0x4ca3a6[_0x4546('0x4f')]['get']({'plain':!![]});if(!_0x3e13ab)throw new Error(_0x4546('0x50'));if(_0x3e13ab[_0x4546('0x51')]===_0x4546('0x4f')){var _0x30e748=_0x31dc1e;return db['UserProfileSection'][_0x4546('0x46')]({'where':{'name':_0x4546('0x27'),'userProfileId':_0x3e13ab[_0x4546('0x52')]},'raw':!![]})[_0x4546('0x25')](function(_0x49a106){if(_0x49a106&&_0x49a106[_0x4546('0x53')]===0x0){return db[_0x4546('0x28')][_0x4546('0x48')]({'name':_0x30e748[_0x4546('0x2a')],'resourceId':_0x30e748['id'],'type':_0x49a106[_0x4546('0x2a')],'sectionId':_0x49a106['id']},{})[_0x4546('0x25')](function(){return _0x31dc1e;});}else{return _0x31dc1e;}})['catch'](function(_0x2ece0a){logger[_0x4546('0x54')](_0x4546('0x55'),_0x2ece0a);throw _0x2ece0a;});}return _0x31dc1e;})[_0x4546('0x25')](respondWithResult(_0x422ebc,null))['catch'](handleError(_0x422ebc,null));};function Extension(_0x37d128,_0x4a1a00,_0x28238f,_0x24e66c){this[_0x4546('0x56')]=_0x4546('0x57');this[_0x4546('0x58')]=_0x37d128;this['app']=_0x28238f;this[_0x4546('0x59')]='system';this[_0x4546('0x5a')]='Voice\x20Prefix\x20Extension';this['priority']=_0x4a1a00;this['appdata']=_0x24e66c;}function createVoicePrefixExtensions(_0xbf2eab,_0x5e35bf,_0x29f980){return new BPromise(function(_0x466f19,_0x1e4914){var _0x2a1a21=new Extension(formatPrefixName(_0xbf2eab['prefix']),0x1,_0x4546('0x5b'),_0x4546('0x5c'));_0x2a1a21[_0x4546('0x5d')]=_0xbf2eab['id'];return db[_0x4546('0x4d')][_0x4546('0x48')](_0x2a1a21,{'transaction':_0x29f980})['then'](function(_0xc4be35){var _0x4b3340=_0xc4be35[_0x4546('0x4c')]({'plain':!![]});var _0x4c21d6=_[_0x4546('0x32')](addVoicePrefixExtensions(_0xbf2eab,_0x5e35bf),function(_0x423330){_0x423330[_0x4546('0x4e')]=_0x4b3340['id'];_0x423330['VoicePrefixId']=_0xbf2eab['id'];return _0x423330;});return db[_0x4546('0x4d')][_0x4546('0x5e')](_0x4c21d6,{'transaction':_0x29f980})[_0x4546('0x25')](function(_0x220259){if(!_0x220259){return _0x1e4914(_0x4546('0x5f'));}else{return _0x466f19(_0x220259);}})[_0x4546('0x43')](function(_0x310661){return _0x1e4914(_0x310661);});});;});};function addVoicePrefixExtensions(_0x332ed4,_0x55ecd9){var _0x2b231f=[];var _0x2c0ee3=formatPrefixName(_0x332ed4[_0x4546('0x60')]);_0x2b231f[_0x4546('0x61')](new Extension(_0x2c0ee3,0x2,_0x4546('0x62'),_0x4546('0x63')+_0x332ed4[_0x4546('0x2a')]));if(_0x332ed4[_0x4546('0x64')]){_0x2b231f[_0x4546('0x61')](new Extension(_0x2c0ee3,0x3,_0x4546('0x62'),_0x4546('0x65')+_0x332ed4[_0x4546('0x64')]));}else{_0x2b231f[_0x4546('0x61')](new Extension(_0x2c0ee3,0x3,_0x4546('0x5b'),_0x4546('0x66')));}_0x2b231f['push'](new Extension(_0x2c0ee3,0x4,_0x4546('0x67'),_0x55ecd9['context']+','+_0x4546('0x68')+(0x8+_0x332ed4[_0x4546('0x2a')]['length'])+'}'+','+0x1));return _0x2b231f;}function formatPrefixName(_0x314afc){var _0x335881='_';for(var _0x27680b=0x0;_0x27680b<_0x314afc[_0x4546('0x39')];_0x27680b++){if(_0x314afc[_0x4546('0x69')](_0x27680b)=='-'){_0x335881+=_0x314afc[_0x4546('0x69')](_0x27680b);}else{_0x335881+='['+_0x314afc[_0x4546('0x69')](_0x27680b)+']';}}_0x335881+='.';return _0x335881;}exports[_0x4546('0x24')]=function(_0x275c76,_0x3f3f99,_0x1aa678){var _0x194667=_0x275c76[_0x4546('0x4b')];_0x194667['prefix']=_0x4546('0x6a')+_0x194667[_0x4546('0x2a')]+'-';return db[_0x4546('0x49')]['transaction'](function(_0xb6e936){return db[_0x4546('0x2d')][_0x4546('0x24')](_0x194667,{'where':{'id':_0x194667['id']},'transaction':_0xb6e936})[_0x4546('0x25')](function(){return db[_0x4546('0x4d')][_0x4546('0x26')]({'where':{'VoicePrefixId':_0x194667['id']},'transaction':_0xb6e936})[_0x4546('0x25')](function(){return db['VoiceExtension'][_0x4546('0x46')]({'where':{'id':_0x194667[_0x4546('0x4e')]},'raw':!![]})[_0x4546('0x25')](function(_0x5d14f1){return createVoicePrefixExtensions(_0x194667,_0x5d14f1,_0xb6e936);});});});})['then'](function(){return db[_0x4546('0x2d')][_0x4546('0x6b')](_0x194667['id']);})['then'](respondWithResult(_0x3f3f99,null))[_0x4546('0x43')](handleError(_0x3f3f99,null));};exports[_0x4546('0x6c')]=function(_0x121e51,_0x11e2e4,_0x5e17a2){return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x121e51[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0x11e2e4,null))[_0x4546('0x25')](function(_0x45f510){if(_0x45f510){return _0x45f510[_0x4546('0x6c')](_0x121e51[_0x4546('0x4b')]['ids'],_[_0x4546('0x6d')](_0x121e51[_0x4546('0x4b')],['ids','id'])||{})[_0x4546('0x6e')](function(_0x5a0de1){for(var _0x52419e=0x0;_0x52419e<_0x121e51[_0x4546('0x4b')][_0x4546('0x6f')][_0x4546('0x39')];_0x52419e+=0x1){socket['emit'](_0x4546('0x70'),{'UserId':Number(_0x121e51[_0x4546('0x4b')][_0x4546('0x6f')][_0x52419e]),'VoicePrefixId':Number(_0x121e51[_0x4546('0x45')]['id'])});}return _0x5a0de1;});}})[_0x4546('0x25')](respondWithResult(_0x11e2e4,null))[_0x4546('0x43')](handleError(_0x11e2e4,null));};exports[_0x4546('0x71')]=function(_0x50078a,_0x4cd517,_0x40897f){return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x50078a[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0x4cd517,null))[_0x4546('0x25')](function(_0x4c1a64){if(_0x4c1a64){return _0x4c1a64['removeAgents'](_0x50078a[_0x4546('0x33')][_0x4546('0x6f')])[_0x4546('0x25')](function(){if(_[_0x4546('0x72')](_0x50078a[_0x4546('0x33')][_0x4546('0x6f')])){for(var _0x3e38bd=0x0;_0x3e38bd<_0x50078a[_0x4546('0x33')]['ids'][_0x4546('0x39')];_0x3e38bd+=0x1){socket['emit'](_0x4546('0x73'),{'UserId':Number(_0x50078a[_0x4546('0x33')][_0x4546('0x6f')][_0x3e38bd]),'VoicePrefixId':Number(_0x50078a['params']['id'])});}}else{socket[_0x4546('0x74')](_0x4546('0x73'),{'UserId':Number(_0x50078a[_0x4546('0x33')][_0x4546('0x6f')]),'VoicePrefixId':Number(_0x50078a[_0x4546('0x45')]['id'])});}});}})[_0x4546('0x25')](respondWithStatusCode(_0x4cd517,null))[_0x4546('0x43')](handleError(_0x4cd517,null));};exports[_0x4546('0x75')]=function(_0x3ff208,_0xc35517,_0x5f29c6){var _0x41cb1f={};var _0x454663={};var _0x59021a;var _0x36f8b5;return db[_0x4546('0x2d')][_0x4546('0x76')]({'where':{'id':_0x3ff208[_0x4546('0x45')]['id']}})['then'](handleEntityNotFound(_0xc35517,null))['then'](function(_0x3842fd){if(_0x3842fd){_0x59021a=_0x3842fd;_0x454663[_0x4546('0x31')]=_[_0x4546('0x34')](db[_0x4546('0x77')][_0x4546('0x2e')]);_0x454663['query']=_[_0x4546('0x34')](_0x3ff208[_0x4546('0x33')]);_0x454663[_0x4546('0x35')]=_[_0x4546('0x36')](_0x454663[_0x4546('0x31')],_0x454663['query']);_0x41cb1f[_0x4546('0x37')]=_['intersection'](_0x454663[_0x4546('0x31')],qs[_0x4546('0x38')](_0x3ff208[_0x4546('0x33')][_0x4546('0x38')]));_0x41cb1f[_0x4546('0x37')]=_0x41cb1f[_0x4546('0x37')][_0x4546('0x39')]?_0x41cb1f[_0x4546('0x37')]:_0x454663['model'];_0x41cb1f[_0x4546('0x78')]=qs[_0x4546('0x3b')](_0x3ff208[_0x4546('0x33')][_0x4546('0x3b')]);_0x41cb1f[_0x4546('0x3e')]=qs['filters'](_[_0x4546('0x3c')](_0x3ff208['query'],_0x454663['filters']));if(_0x3ff208['query'][_0x4546('0x3d')]){_0x41cb1f[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x41cb1f[_0x4546('0x3e')],{'$or':_[_0x4546('0x32')](_0x41cb1f[_0x4546('0x37')],function(_0x180a07){var _0x327ae2={};_0x327ae2[_0x180a07]={'$like':'%'+_0x3ff208[_0x4546('0x33')][_0x4546('0x3d')]+'%'};return _0x327ae2;})});}_0x41cb1f=_['merge']({},_0x41cb1f,_0x3ff208[_0x4546('0x79')]);return _0x59021a['getAgents'](_0x41cb1f);}})[_0x4546('0x25')](function(_0x278e43){if(_0x278e43){_0x36f8b5=_0x278e43[_0x4546('0x39')];if(!_0x3ff208[_0x4546('0x33')][_0x4546('0x3a')](_0x4546('0x7a'))){_0x41cb1f[_0x4546('0x1e')]=qs['limit'](_0x3ff208[_0x4546('0x33')][_0x4546('0x1e')]);_0x41cb1f['offset']=qs[_0x4546('0x20')](_0x3ff208[_0x4546('0x33')][_0x4546('0x20')]);}return _0x59021a[_0x4546('0x75')](_0x41cb1f);}})[_0x4546('0x25')](function(_0x2a9010){if(_0x2a9010){return _0x2a9010?{'count':_0x36f8b5,'rows':_0x2a9010}:null;}})[_0x4546('0x25')](respondWithResult(_0xc35517,null))[_0x4546('0x43')](handleError(_0xc35517,null));};exports[_0x4546('0x7b')]=function(_0x3cbef4,_0x264c12,_0x2ba11b){var _0x59b252={};var _0x37d871={};var _0xf3a8dc;var _0x4247db;return db[_0x4546('0x2d')][_0x4546('0x76')]({'where':{'id':_0x3cbef4[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0x264c12,null))[_0x4546('0x25')](function(_0x3855e9){if(_0x3855e9){_0xf3a8dc=_0x3855e9;_0x37d871[_0x4546('0x31')]=_[_0x4546('0x34')](db[_0x4546('0x7c')][_0x4546('0x2e')]);_0x37d871[_0x4546('0x33')]=_[_0x4546('0x34')](_0x3cbef4[_0x4546('0x33')]);_0x37d871[_0x4546('0x35')]=_[_0x4546('0x36')](_0x37d871[_0x4546('0x31')],_0x37d871[_0x4546('0x33')]);_0x59b252[_0x4546('0x37')]=_[_0x4546('0x36')](_0x37d871[_0x4546('0x31')],qs['fields'](_0x3cbef4['query'][_0x4546('0x38')]));_0x59b252['attributes']=_0x59b252[_0x4546('0x37')][_0x4546('0x39')]?_0x59b252[_0x4546('0x37')]:_0x37d871['model'];_0x59b252[_0x4546('0x78')]=qs['sort'](_0x3cbef4['query'][_0x4546('0x3b')]);_0x59b252[_0x4546('0x3e')]=qs[_0x4546('0x35')](_['pick'](_0x3cbef4['query'],_0x37d871[_0x4546('0x35')]));if(_0x3cbef4[_0x4546('0x33')]['filter']){_0x59b252[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x59b252[_0x4546('0x3e')],{'$or':_[_0x4546('0x32')](_0x59b252[_0x4546('0x37')],function(_0x65a6a4){var _0x417e49={};_0x417e49[_0x65a6a4]={'$like':'%'+_0x3cbef4['query'][_0x4546('0x3d')]+'%'};return _0x417e49;})});}_0x59b252=_['merge']({},_0x59b252,_0x3cbef4[_0x4546('0x79')]);return _0xf3a8dc['getTeams'](_0x59b252);}})['then'](function(_0x3d95e5){if(_0x3d95e5){_0x4247db=_0x3d95e5['length'];if(!_0x3cbef4['query'][_0x4546('0x3a')](_0x4546('0x7a'))){_0x59b252[_0x4546('0x1e')]=qs[_0x4546('0x1e')](_0x3cbef4[_0x4546('0x33')][_0x4546('0x1e')]);_0x59b252[_0x4546('0x20')]=qs['offset'](_0x3cbef4[_0x4546('0x33')]['offset']);}return _0xf3a8dc[_0x4546('0x7b')](_0x59b252);}})[_0x4546('0x25')](function(_0x24798b){if(_0x24798b){return _0x24798b?{'count':_0x4247db,'rows':_0x24798b}:null;}})[_0x4546('0x25')](respondWithResult(_0x264c12,null))[_0x4546('0x43')](handleError(_0x264c12,null));};exports[_0x4546('0x7d')]=function(_0x597648,_0x19aeab,_0x22a956){var _0x12eea5=_0x597648[_0x4546('0x4b')]['ids'];var _0x33f125;return db[_0x4546('0x7c')][_0x4546('0x41')]({'where':{'id':_0x12eea5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x4546('0x7e'),'voicePause',_0x4546('0x7f')],'raw':!![]}]})['then'](function(_0x3fc0b8){if(_0x3fc0b8){_0x33f125=_0x3fc0b8;var _0x55ec89=_[_0x4546('0x80')](_0x3fc0b8,function(_0x645df3){var _0x54bd82=_0x645df3[_0x4546('0x4c')]({'plain':!![]});return _0x54bd82['Agents'];});return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x597648[_0x4546('0x45')]['id']}})[_0x4546('0x25')](function(_0x7f3cf0){return db['sequelize'][_0x4546('0x4a')](function(_0x3ab4f4){return _0x7f3cf0[_0x4546('0x7d')](_0x12eea5,{'transaction':_0x3ab4f4})[_0x4546('0x25')](function(){return BPromise[_0x4546('0x81')](_0x33f125,function(_0x4dae4a){return db[_0x4546('0x82')][_0x4546('0x83')]({'TeamId':_0x4dae4a['id'],'VoicePrefixId':_0x597648[_0x4546('0x45')]['id']},{'transaction':_0x3ab4f4});});})[_0x4546('0x25')](function(){return BPromise[_0x4546('0x81')](_0x55ec89,function(_0x14d671){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x14d671['id'],'VoicePrefixId':_0x597648[_0x4546('0x45')]['id']},'transaction':_0x3ab4f4});});})[_0x4546('0x25')](function(){_0x55ec89[_0x4546('0x84')](function(_0x150027){socket[_0x4546('0x74')]('userVoicePrefix:save',{'UserId':_0x150027['id'],'VoicePrefixId':_0x7f3cf0['id']});});});});});}})['then'](respondWithStatusCode(_0x19aeab,null))[_0x4546('0x43')](handleError(_0x19aeab,null));};exports[_0x4546('0x85')]=function(_0x697259,_0x228e87,_0x1470c2){return db[_0x4546('0x7c')][_0x4546('0x41')]({'where':{'id':_0x697259[_0x4546('0x33')][_0x4546('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x4546('0x77')],'as':_0x4546('0x86'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x228e87,null))['then'](function(_0x15a005){var _0x4ba4aa=_[_0x4546('0x32')](_0x15a005,'id');var _0x57dac4=[];var _0x5523f9=[];var _0x55b583=squel[_0x4546('0x87')]();_0x55b583[_0x4546('0x88')](_0x4546('0x89'))[_0x4546('0x8a')](_0x4546('0x8b'),'tq')['join'](_0x4546('0x8c'),'ut',_0x4546('0x8d'))[_0x4546('0x3e')](_0x4546('0x8e'),_0x697259[_0x4546('0x45')]['id']);for(var _0x12ef28=0x0;_0x12ef28<_0x15a005[_0x4546('0x39')];_0x12ef28+=0x1){let _0x12eb2b=_0x15a005[_0x12ef28];for(var _0xc06b87=0x0;_0xc06b87<_0x12eb2b[_0x4546('0x86')]['length'];_0xc06b87+=0x1){let _0x412111=_0x12eb2b[_0x4546('0x86')][_0xc06b87];var _0x5cb58c=_0x55b583['clone']();_0x5cb58c[_0x4546('0x3e')](_0x4546('0x8f'),_0x412111['id']);_0x5523f9['push'](db[_0x4546('0x49')]['query'](_0x5cb58c['toString'](),{'type':db['sequelize'][_0x4546('0x90')][_0x4546('0x91')]})['then'](function(_0x572e86){if(_0x572e86[_0x4546('0x39')]===0x1){return _0x412111['id'];}else{var _0x1bb34e=_[_0x4546('0x92')](_['map'](_0x572e86,_0x4546('0x93')),function(_0x3a9f01){return _[_0x4546('0x94')](_0x4ba4aa,_0x3a9f01);});if(_0x1bb34e){return _0x412111['id'];}}}));}}return BPromise[_0x4546('0x95')](_0x5523f9)[_0x4546('0x25')](function(_0xe806bc){_0x57dac4=_(_0x57dac4)['union'](_0xe806bc)[_0x4546('0x96')]()['value']();return db['VoicePrefix'][_0x4546('0x46')]({'where':{'id':_0x697259['params']['id']}})[_0x4546('0x25')](function(_0x42feda){return db[_0x4546('0x49')][_0x4546('0x4a')](function(_0x305a9a){return _0x42feda['removeTeams'](_0x697259[_0x4546('0x33')][_0x4546('0x6f')],{'transaction':_0x305a9a})['then'](function(){if(!_[_0x4546('0x97')](_0x57dac4)){return _0x42feda['removeAgents'](_0x57dac4,{'transaction':_0x305a9a});}})[_0x4546('0x25')](function(){_0x57dac4['forEach'](function(_0x35eb62){socket[_0x4546('0x74')](_0x4546('0x73'),{'UserId':_0x35eb62,'VoicePrefixId':_0x42feda['id']});});});});});});})[_0x4546('0x25')](respondWithStatusCode(_0x228e87,null))[_0x4546('0x43')](handleError(_0x228e87,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x427f=['events','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0xea6c20,_0x5a0de8){var _0x458655=function(_0x4afe96){while(--_0x4afe96){_0xea6c20['push'](_0xea6c20['shift']());}};_0x458655(++_0x5a0de8);}(_0x427f,0x18f));var _0xf427=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x427f[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0xf427('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf427('0x1')](0x0);var events={'afterCreate':_0xf427('0x2'),'afterUpdate':'update','afterDestroy':_0xf427('0x3')};function emitEvent(_0x274b0c){return function(_0x51acb9,_0x45f0f5,_0x51a20d){VoicePrefixEvents['emit'](_0x274b0c+':'+_0x51acb9['id'],_0x51acb9);VoicePrefixEvents[_0xf427('0x4')](_0x274b0c,_0x51acb9);_0x51a20d(null);};}for(var e in events){if(events[_0xf427('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xf427('0x6')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x180a=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1956d3,_0x2f872f){var _0x39ea98=function(_0x501345){while(--_0x501345){_0x1956d3['push'](_0x1956d3['shift']());}};_0x39ea98(++_0x2f872f);}(_0x180a,0x99));var _0xa180=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x180a[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xa180('0x0'))['db'][_0xa180('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa180('0x2')](0x0);var events={'afterCreate':_0xa180('0x3'),'afterUpdate':_0xa180('0x4'),'afterDestroy':_0xa180('0x5')};function emitEvent(_0x45e2fc){return function(_0x4b7616,_0x47ffd7,_0x3ffb6a){VoicePrefixEvents[_0xa180('0x6')](_0x45e2fc+':'+_0x4b7616['id'],_0x4b7616);VoicePrefixEvents['emit'](_0x45e2fc,_0x4b7616);_0x3ffb6a(null);};}for(var e in events){if(events[_0xa180('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xa180('0x8')]=VoicePrefixEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x51c3=['api','moment','bluebird','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util','../../config/logger'];(function(_0x357a97,_0x5aead2){var _0x28d590=function(_0x54b139){while(--_0x54b139){_0x357a97['push'](_0x357a97['shift']());}};_0x28d590(++_0x5aead2);}(_0x51c3,0xcd));var _0x351c=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x51c3[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var util=require(_0x351c('0x0'));var logger=require(_0x351c('0x1'))(_0x351c('0x2'));var moment=require(_0x351c('0x3'));var BPromise=require(_0x351c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x351c('0x5'));var attributes=require(_0x351c('0x6'));module[_0x351c('0x7')]=function(_0x30d200,_0x3d211c){return _0x30d200['define'](_0x351c('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ed3=['../../config/environment','exports','define','voice_prefixes','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2a84d6,_0x538497){var _0x55c2ea=function(_0x3f5d46){while(--_0x3f5d46){_0x2a84d6['push'](_0x2a84d6['shift']());}};_0x55c2ea(++_0x538497);}(_0x9ed3,0xc2));var _0x39ed=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x9ed3[_0x102f97];return _0xd22058;};'use strict';var _=require(_0x39ed('0x0'));var util=require('util');var logger=require(_0x39ed('0x1'))('api');var moment=require(_0x39ed('0x2'));var BPromise=require(_0x39ed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39ed('0x4'));var rimraf=require(_0x39ed('0x5'));var config=require(_0x39ed('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x39ed('0x7')]=function(_0x45c81e,_0x4d1ec9){return _0x45c81e[_0x39ed('0x8')]('VoicePrefix',attributes,{'tableName':_0x39ed('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd6f=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x38df07,_0x5e619a){var _0x4ed4f8=function(_0x56e08a){while(--_0x56e08a){_0x38df07['push'](_0x38df07['shift']());}};_0x4ed4f8(++_0x5e619a);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x2a2dc6,_0x5a5d5b){_0x2a2dc6=_0x2a2dc6-0x0;var _0x350f2d=_0xcd6f[_0x2a2dc6];return _0x350f2d;};'use strict';var _=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var moment=require(_0xfcd6('0x2'));var BPromise=require(_0xfcd6('0x3'));var rs=require(_0xfcd6('0x4'));var fs=require('fs');var Redis=require(_0xfcd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcd6('0x6'));var logger=require(_0xfcd6('0x7'))(_0xfcd6('0x8'));var config=require(_0xfcd6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfcd6('0xa')]['http']({'port':0x232a});config[_0xfcd6('0xb')]=_['defaults'](config[_0xfcd6('0xb')],{'host':_0xfcd6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcd6('0xb')]));require('./voicePrefix.socket')[_0xfcd6('0xd')](socket);function respondWithRpcPromise(_0x4f8dbf,_0x4c2eb7,_0x4bcd78){return new BPromise(function(_0x43b053,_0x550f2b){return client['request'](_0x4f8dbf,_0x4bcd78)[_0xfcd6('0xe')](function(_0xcc5317){logger['info'](_0xfcd6('0xf'),_0x4c2eb7,_0xfcd6('0x10'));logger[_0xfcd6('0x11')](_0xfcd6('0x12'),_0x4c2eb7,_0xfcd6('0x10'),JSON[_0xfcd6('0x13')](_0xcc5317));if(_0xcc5317[_0xfcd6('0x14')]){if(_0xcc5317[_0xfcd6('0x14')][_0xfcd6('0x15')]===0x1f4){logger[_0xfcd6('0x14')](_0xfcd6('0xf'),_0x4c2eb7,_0xcc5317[_0xfcd6('0x14')][_0xfcd6('0x16')]);return _0x550f2b(_0xcc5317[_0xfcd6('0x14')]['message']);}logger['error'](_0xfcd6('0xf'),_0x4c2eb7,_0xcc5317[_0xfcd6('0x14')]['message']);return _0x43b053(_0xcc5317[_0xfcd6('0x14')][_0xfcd6('0x16')]);}else{logger[_0xfcd6('0x17')](_0xfcd6('0xf'),_0x4c2eb7,'request\x20sent');_0x43b053(_0xcc5317['result'][_0xfcd6('0x16')]);}})[_0xfcd6('0x18')](function(_0x17bb38){logger[_0xfcd6('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x4c2eb7,_0x17bb38);_0x550f2b(_0x17bb38);});});}
\ No newline at end of file
+var _0x6455=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4be3df,_0x36302a){var _0x2bbe7f=function(_0x330ea){while(--_0x330ea){_0x4be3df['push'](_0x4be3df['shift']());}};_0x2bbe7f(++_0x36302a);}(_0x6455,0x97));var _0x5645=function(_0x1da1a8,_0x2f6b16){_0x1da1a8=_0x1da1a8-0x0;var _0x2b7d0b=_0x6455[_0x1da1a8];return _0x2b7d0b;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});config[_0x5645('0xc')]=_[_0x5645('0xd')](config[_0x5645('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5645('0xc')]));require(_0x5645('0xe'))[_0x5645('0xf')](socket);function respondWithRpcPromise(_0x34fe4e,_0x7f9893,_0x16af81){return new BPromise(function(_0x587c61,_0x212e46){return client[_0x5645('0x10')](_0x34fe4e,_0x16af81)[_0x5645('0x11')](function(_0x21e32c){logger['info'](_0x5645('0x12'),_0x7f9893,'request\x20sent');logger[_0x5645('0x13')](_0x5645('0x14'),_0x7f9893,_0x5645('0x15'),JSON[_0x5645('0x16')](_0x21e32c));if(_0x21e32c[_0x5645('0x17')]){if(_0x21e32c[_0x5645('0x17')][_0x5645('0x18')]===0x1f4){logger[_0x5645('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x7f9893,_0x21e32c[_0x5645('0x17')][_0x5645('0x19')]);return _0x212e46(_0x21e32c[_0x5645('0x17')]['message']);}logger['error'](_0x5645('0x12'),_0x7f9893,_0x21e32c[_0x5645('0x17')]['message']);return _0x587c61(_0x21e32c[_0x5645('0x17')][_0x5645('0x19')]);}else{logger[_0x5645('0x1a')]('VoicePrefix,\x20%s,\x20%s',_0x7f9893,_0x5645('0x15'));_0x587c61(_0x21e32c[_0x5645('0x1b')][_0x5645('0x19')]);}})[_0x5645('0x1c')](function(_0x5ac9ee){logger[_0x5645('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x7f9893,_0x5ac9ee);_0x212e46(_0x5ac9ee);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d2e=['voicePrefix:','save','remove','update','register','length'];(function(_0x2a4f10,_0x242620){var _0x2aaee5=function(_0x102074){while(--_0x102074){_0x2a4f10['push'](_0x2a4f10['shift']());}};_0x2aaee5(++_0x242620);}(_0x6d2e,0x97));var _0xe6d2=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0x6d2e[_0x2bbe8d];return _0x539e7a;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xe6d2('0x0'),_0xe6d2('0x1'),_0xe6d2('0x2')];function createListener(_0x3ff4b6,_0x412889){return function(_0xf81df7){_0x412889['emit'](_0x3ff4b6,_0xf81df7);};}function removeListener(_0x2dee74,_0x5dc6e4){return function(){VoicePrefixEvents['removeListener'](_0x2dee74,_0x5dc6e4);};}exports[_0xe6d2('0x3')]=function(_0x2b4bf0){for(var _0x3c0fab=0x0,_0x4d9c9f=events[_0xe6d2('0x4')];_0x3c0fab<_0x4d9c9f;_0x3c0fab++){var _0x53906e=events[_0x3c0fab];var _0x2e227e=createListener(_0xe6d2('0x5')+_0x53906e,_0x2b4bf0);VoicePrefixEvents['on'](_0x53906e,_0x2e227e);}};
\ No newline at end of file
+var _0xb903=['update','emit','removeListener','register','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xb903,0x185));var _0x3b90=function(_0x23bfdd,_0x52ed96){_0x23bfdd=_0x23bfdd-0x0;var _0x3d5fcc=_0xb903[_0x23bfdd];return _0x3d5fcc;};'use strict';var VoicePrefixEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){VoicePrefixEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);VoicePrefixEvents['on'](_0x153283,_0x2e4c06);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x375b34,_0x4c4cfb){var _0x3d3486=function(_0x4697f2){while(--_0x4697f2){_0x375b34['push'](_0x375b34['shift']());}};_0x3d3486(++_0x4c4cfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
+var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x38035b,_0x111622){var _0xb4172e=function(_0x341207){while(--_0x341207){_0x38035b['push'](_0x38035b['shift']());}};_0xb4172e(++_0x111622);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe87d=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','STRING','ENUM','outbound','inbound','default','fewestcalls','linear','strategy','getDataValue','preview','booked','roundrobin','includes','setDataValue','rrmemory','INTEGER','yes','all','once','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xe87d,0x9d));var _0xde87=function(_0x373a43,_0x516820){_0x373a43=_0x373a43-0x0;var _0x474dd3=_0xe87d[_0x373a43];return _0x474dd3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde87('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xde87('0x1')]('inbound',_0xde87('0x2')),'allowNull':![],'defaultValue':_0xde87('0x3')},'musiconhold':{'type':Sequelize[_0xde87('0x0')],'defaultValue':_0xde87('0x4')},'announce':{'type':Sequelize[_0xde87('0x0')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent',_0xde87('0x5'),'random','rrmemory',_0xde87('0x6'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x1585df){this['setDataValue'](_0xde87('0x7'),_0x1585df?_0x1585df:'rrmemory');},'get':function(){var _0x53c324=this[_0xde87('0x8')]('type');var _0x408247=this[_0xde87('0x8')]('dialMethod');var _0x1b0a37=this[_0xde87('0x8')](_0xde87('0x7'));if(_0x53c324===_0xde87('0x2')){if(_0x408247===_0xde87('0x9')){return null;}if(_0x408247===_0xde87('0xa')&&!['rrmemory',_0xde87('0xb')][_0xde87('0xc')](_0x1b0a37)){this[_0xde87('0xd')](_0xde87('0x7'),_0xde87('0xe'));}}return _0x1b0a37;}},'servicelevel':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xde87('0xf')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xde87('0x0')]},'weight':{'type':Sequelize[_0xde87('0xf')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xde87('0x10'),'no'),'defaultValue':_0xde87('0x10')},'autopause':{'type':Sequelize[_0xde87('0x1')]('yes','no',_0xde87('0x11')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xde87('0xf')](0xb)},'autopausebusy':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xde87('0x1')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xde87('0x10'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xde87('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xde87('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xde87('0x1')]('yes','no',_0xde87('0x12')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xde87('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xde87('0x1')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xde87('0xf')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xde87('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xde87('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xde87('0x0')]},'queue_quantity1':{'type':Sequelize[_0xde87('0x0')]},'queue_quantity2':{'type':Sequelize[_0xde87('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0xde87('0x0')]},'queue_less_than':{'type':Sequelize[_0xde87('0x0')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x315bd1){this[_0xde87('0xd')](_0xde87('0x13'),_0x315bd1?_0x315bd1[_0xde87('0x14')](','):[]);},'get':function(){return this[_0xde87('0x8')](_0xde87('0x13'))?this[_0xde87('0x8')](_0xde87('0x13'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xde87('0x0')],'defaultValue':'yes','set':function(_0x37214f){this['setDataValue'](_0xde87('0x15'),_0x37214f?_0x37214f['join'](','):undefined);},'get':function(){return this[_0xde87('0x8')](_0xde87('0x15'))?this[_0xde87('0x8')](_0xde87('0x15'))[_0xde87('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x2dbdc3){this['setDataValue']('leavewhenempty',_0x2dbdc3?_0x2dbdc3[_0xde87('0x14')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0xde87('0x8')](_0xde87('0x17'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x10'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xde87('0x1')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde87('0x0')]},'acw':{'type':Sequelize[_0xde87('0x18')],'defaultValue':0x0,'set':function(_0x29b99b){this[_0xde87('0xd')](_0xde87('0x19'),_0x29b99b);if(_0x29b99b){if(this[_0xde87('0x8')](_0xde87('0x1a'))<0x2){this[_0xde87('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xde87('0xf')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xde87('0x1')]('preview',_0xde87('0x1b'),_0xde87('0x1c'),_0xde87('0x1d'),'booked'),'defaultValue':'progressive','comment':_0xde87('0x1e')},'dialLimitChannel':{'type':Sequelize[_0xde87('0xf')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xde87('0x1f')},'dialLimitQueue':{'type':Sequelize[_0xde87('0xf')](0x4)[_0xde87('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xde87('0x21')},'dialPowerLevel':{'type':Sequelize[_0xde87('0x22')](0x2)[_0xde87('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xde87('0x23')},'dialPredictiveOptimization':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x24'),'dropRate'),'defaultValue':'dropRate','comment':_0xde87('0x25')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xde87('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xde87('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xde87('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x27')},'dialQueueOptions':{'type':Sequelize[_0xde87('0x0')],'defaultValue':'tTxX','comment':_0xde87('0x28')},'dialQueueTimeout':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x29')},'dialQueueProject':{'type':Sequelize[_0xde87('0x0')],'comment':_0xde87('0x2a')},'dialCongestionMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x2b')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x2c')},'dialBusyRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x2e')},'dialGlobalMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xde87('0x0')],'defaultValue':_0xde87('0x2f')},'dialPrefix':{'type':Sequelize[_0xde87('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xde87('0x30'),_0xde87('0x31'),'onlyIfOpen'),'defaultValue':_0xde87('0x30')},'dialAMDActive':{'type':Sequelize[_0xde87('0x18')],'defaultValue':0x0,'comment':_0xde87('0x32')},'dialAMDInitialSilence':{'type':Sequelize[_0xde87('0xf')](0x9)[_0xde87('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xde87('0x33')},'dialAMDGreeting':{'type':Sequelize[_0xde87('0xf')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xde87('0x34')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xde87('0xf')](0x9)[_0xde87('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xde87('0x35')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xde87('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde87('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0xde87('0xf')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xde87('0x37')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xde87('0xf')](0x9)[_0xde87('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xde87('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xde87('0xf')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xde87('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xde87('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde87('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0xde87('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xde87('0x18')],'defaultValue':0x0,'comment':_0xde87('0x3b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xde87('0x1')](_0xde87('0x3c'),_0xde87('0x3d')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xde87('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde87('0x3e')},'dialCutDigit':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde87('0x3f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x40')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x41')},'dialDropMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x42')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde87('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xde87('0xf')](0x5)[_0xde87('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde87('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xde87('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![],'comment':_0xde87('0x4a'),'set':function(_0x3d47bc){if(!_0x3d47bc)this[_0xde87('0xd')]('mandatoryDispositionPauseId',null);this[_0xde87('0xd')](_0xde87('0x4b'),_0x3d47bc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xde87('0xf')](0x3)[_0xde87('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xde87('0x18')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xde87('0x18')],'defaultValue':![]}};
\ No newline at end of file
+var _0x27de=['ENUM','ringall','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','outbound','preview','booked','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','default'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0x27de,0x90));var _0xe27d=function(_0x46596a,_0x2a464e){_0x46596a=_0x46596a-0x0;var _0x17b8a6=_0x27de[_0x46596a];return _0x17b8a6;};'use strict';var Sequelize=require(_0xe27d('0x0'));module[_0xe27d('0x1')]={'name':{'type':Sequelize[_0xe27d('0x2')],'allowNull':![],'unique':_0xe27d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe27d('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xe27d('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xe27d('0x5')},'announce':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe27d('0x6')]('rr',_0xe27d('0x7'),'leastrecent',_0xe27d('0x8'),_0xe27d('0x9'),_0xe27d('0xa'),'linear',_0xe27d('0xb'),_0xe27d('0xc')),'allowNull':![],'defaultValue':_0xe27d('0x7'),'set':function(_0x55cfc6){this[_0xe27d('0xd')](_0xe27d('0xe'),_0x55cfc6?_0x55cfc6:'rrmemory');},'get':function(){var _0x302b7a=this[_0xe27d('0xf')]('type');var _0x195178=this[_0xe27d('0xf')](_0xe27d('0x10'));var _0x376876=this[_0xe27d('0xf')](_0xe27d('0xe'));if(_0x302b7a===_0xe27d('0x11')){if(_0x195178===_0xe27d('0x12')){return null;}if(_0x195178===_0xe27d('0x13')&&![_0xe27d('0xa'),'roundrobin']['includes'](_0x376876)){this['setDataValue']('strategy',_0xe27d('0xa'));}}return _0x376876;}},'servicelevel':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe27d('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xe27d('0x15'),'no'),'defaultValue':_0xe27d('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xe27d('0x15'),'no',_0xe27d('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe27d('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe27d('0x6')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe27d('0x6')]('yes','no'),'defaultValue':_0xe27d('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xe27d('0x15'),'no',_0xe27d('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xe27d('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xe27d('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe27d('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe27d('0x2')]},'queue_youarenext':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe27d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe27d('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe27d('0x2')]},'queue_quantity2':{'type':Sequelize[_0xe27d('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xe27d('0x2')]},'periodic_announce':{'type':Sequelize[_0xe27d('0x18')],'set':function(_0x583e1f){this[_0xe27d('0xd')](_0xe27d('0x19'),_0x583e1f?_0x583e1f[_0xe27d('0x1a')](','):[]);},'get':function(){return this[_0xe27d('0xf')](_0xe27d('0x19'))?this[_0xe27d('0xf')](_0xe27d('0x19'))[_0xe27d('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':_0xe27d('0x15'),'set':function(_0x3a1ce3){this[_0xe27d('0xd')]('joinempty',_0x3a1ce3?_0x3a1ce3[_0xe27d('0x1a')](','):undefined);},'get':function(){return this[_0xe27d('0xf')](_0xe27d('0x1c'))?this[_0xe27d('0xf')](_0xe27d('0x1c'))[_0xe27d('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x590913){this[_0xe27d('0xd')]('leavewhenempty',_0x590913?_0x590913[_0xe27d('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0xe27d('0x1d'))?this[_0xe27d('0xf')](_0xe27d('0x1d'))[_0xe27d('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xe27d('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe27d('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x51db15){this['setDataValue']('acw',_0x51db15);if(_0x51db15){if(this['getDataValue'](_0xe27d('0x1e'))<0x2){this['setDataValue'](_0xe27d('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe27d('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe27d('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x12'),_0xe27d('0x20'),_0xe27d('0x21'),_0xe27d('0x22'),_0xe27d('0x13')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xe27d('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe27d('0x24')},'dialLimitQueue':{'type':Sequelize[_0xe27d('0x14')](0x4)[_0xe27d('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xe27d('0x25')](0x2)[_0xe27d('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe27d('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x27'),'dropRate'),'defaultValue':_0xe27d('0x28'),'comment':_0xe27d('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe27d('0x25')](0x2)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe27d('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xe27d('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe27d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':'tTxX','comment':_0xe27d('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x2d')},'dialQueueProject':{'type':Sequelize[_0xe27d('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)[_0xe27d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)[_0xe27d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe27d('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)[_0xe27d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe27d('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe27d('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe27d('0x6')](_0xe27d('0x34'),_0xe27d('0x35'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe27d('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe27d('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe27d('0x14')](0x9)[_0xe27d('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe27d('0x14')](0x9)[_0xe27d('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe27d('0x36')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe27d('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe27d('0x14')](0x9)[_0xe27d('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe27d('0x14')](0x9)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe27d('0x37')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe27d('0x38')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe27d('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe27d('0x39')},'dialRecallMeTimeout':{'type':Sequelize[_0xe27d('0x14')](0x5)[_0xe27d('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe27d('0x3a')},'dialRecallInQueue':{'type':Sequelize[_0xe27d('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xe27d('0x6')]('DESC',_0xe27d('0x3b')),'defaultValue':_0xe27d('0x3c')},'dialQueueProject2':{'type':Sequelize[_0xe27d('0x2')],'comment':_0xe27d('0x3d')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe27d('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xe27d('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe27d('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x41')},'dialDropRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)[_0xe27d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x45')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe27d('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe27d('0x14')](0x3)[_0xe27d('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe27d('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe27d('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe27d('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe27d('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe27d('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x46a4f3){if(!_0x46a4f3)this['setDataValue'](_0xe27d('0x49'),null);this[_0xe27d('0xd')](_0xe27d('0x4a'),_0x46a4f3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe27d('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe27d('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xe27d('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xe27d('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6aa7,0x178));var _0x76aa=function(_0x2b471b,_0x11dc42){_0x2b471b=_0x2b471b-0x0;var _0x4e0fb5=_0x6aa7[_0x2b471b];return _0x4e0fb5;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));};
\ No newline at end of file
+var _0x5fc3=['redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','UserProfileResource','destroy','stack','name','index','VoiceQueue','fieldName','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','intersection','attributes','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','rawAttributes','fields','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','emit','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','User','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x53b165,_0x2ab643){var _0x5c416e=function(_0x702bfa){while(--_0x702bfa){_0x53b165['push'](_0x53b165['shift']());}};_0x5c416e(++_0x2ab643);}(_0x5fc3,0xa8));var _0x35fc=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x5fc3[_0x36bff5];return _0x80ade5;};'use strict';var moment=require(_0x35fc('0x0'));var BPromise=require(_0x35fc('0x1'));var util=require('util');var _=require(_0x35fc('0x2'));var squel=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var qs=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('api');var config=require(_0x35fc('0x7'));var db=require(_0x35fc('0x8'))['db'];config[_0x35fc('0x9')]=_['defaults'](config['redis'],{'host':_0x35fc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35fc('0x9')]));require(_0x35fc('0xb'))[_0x35fc('0xc')](socket);function respondWithStatusCode(_0x1e5f90,_0x34ff19){_0x34ff19=_0x34ff19||0xcc;return function(_0xf9d3a6){if(_0xf9d3a6){return _0x1e5f90[_0x35fc('0xd')](_0x34ff19);}return _0x1e5f90['status'](_0x34ff19)[_0x35fc('0xe')]();};}function respondWithResult(_0x2a1084,_0x4fdca1){_0x4fdca1=_0x4fdca1||0xc8;return function(_0x471549){if(_0x471549){return _0x2a1084[_0x35fc('0xf')](_0x4fdca1)['json'](_0x471549);}};}function respondWithFilteredResult(_0xda83fb,_0x1a9f2b){return function(_0x5469f5){if(_0x5469f5){var _0x4cbe74=typeof _0x1a9f2b[_0x35fc('0x10')]==='undefined'&&typeof _0x1a9f2b[_0x35fc('0x11')]===_0x35fc('0x12');var _0x2a6ad2=_0x5469f5[_0x35fc('0x13')];var _0x38d9f2=_0x4cbe74?0x0:_0x1a9f2b['offset'];var _0x59507a=_0x4cbe74?_0x5469f5['count']:_0x1a9f2b['offset']+_0x1a9f2b[_0x35fc('0x11')];var _0x229d56;if(_0x59507a>=_0x2a6ad2){_0x59507a=_0x2a6ad2;_0x229d56=0xc8;}else{_0x229d56=0xce;}_0xda83fb[_0x35fc('0xf')](_0x229d56);return _0xda83fb[_0x35fc('0x14')](_0x35fc('0x15'),_0x38d9f2+'-'+_0x59507a+'/'+_0x2a6ad2)[_0x35fc('0x16')](_0x5469f5);}return null;};}function saveUpdates(_0x480851){return function(_0x26ba54){if(_0x26ba54){return _0x26ba54[_0x35fc('0x17')](_0x480851)['then'](function(_0x41e165){return _0x41e165;});}return null;};}function removeEntity(_0x363e47){return function(_0x2e513b){if(_0x2e513b){return _0x2e513b['destroy']()[_0x35fc('0x18')](function(){var _0x3c58ea=_0x2e513b[_0x35fc('0x19')]({'plain':!![]});var _0x488234=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b'),'ignore':![]},{'name':_0x35fc('0x1c'),'value':_0x35fc('0x1d'),'ignore':![]}];var _0x20ffde=_(_0x488234)[_0x35fc('0x1e')](_0x35fc('0x1f'))[_0x35fc('0x20')](_0x35fc('0x21'))[_0x35fc('0x21')]();if(_['includes'](_0x20ffde,_0x3c58ea[_0x35fc('0x22')])){return;}var _0xd5399f=_[_0x35fc('0x23')](_0x488234,[_0x35fc('0x21'),_0x3c58ea[_0x35fc('0x22')]])['name'];return db[_0x35fc('0x24')][_0x35fc('0x25')]({'where':{'type':_0xd5399f,'resourceId':_0x3c58ea['id']}})['then'](function(){return _0x2e513b;});})[_0x35fc('0x18')](function(){_0x363e47[_0x35fc('0xf')](0xcc)[_0x35fc('0xe')]();});}};}function handleEntityNotFound(_0x51cfec){return function(_0x4086e9){if(!_0x4086e9){_0x51cfec['sendStatus'](0x194);}return _0x4086e9;};}function handleError(_0x1bf180,_0xdfab9f){_0xdfab9f=_0xdfab9f||0x1f4;return function(_0x5cb986){logger['error'](_0x5cb986[_0x35fc('0x26')]);if(_0x5cb986['name']){delete _0x5cb986[_0x35fc('0x27')];}_0x1bf180[_0x35fc('0xf')](_0xdfab9f)['send'](_0x5cb986);};}exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={};var _0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x20')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x22')]['key']};});_0x9f3c8a=qs[_0x35fc('0x2b')](_0x134dfa,_0x645eac);var _0x16f067={'where':_0x9f3c8a[_0x35fc('0x2c')]};return db[_0x35fc('0x29')][_0x35fc('0x13')](_0x16f067)[_0x35fc('0x18')](function(_0x222ddb){_0x3735da[_0x35fc('0x13')]=_0x222ddb;_0x9f3c8a[_0x35fc('0x2d')]=qs[_0x35fc('0x2d')](_0x645eac['query']);return db['VoiceQueue'][_0x35fc('0x2e')](_0x9f3c8a);})['then'](function(_0x37b394){_0x3735da[_0x35fc('0x2f')]=_0x37b394;return _0x3735da;})[_0x35fc('0x18')](respondWithFilteredResult(_0x383837,_0x9f3c8a))[_0x35fc('0x30')](handleError(_0x383837,null));};exports[_0x35fc('0x31')]=function(_0x12e78f,_0x4e43b4){var _0x3fe193={'raw':![],'where':{'id':_0x12e78f[_0x35fc('0x32')]['id']}},_0x330a14={};_0x330a14[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x29')]['rawAttributes']);_0x330a14[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x12e78f[_0x35fc('0x35')]);_0x330a14['filters']=_[_0x35fc('0x36')](_0x330a14['model'],_0x330a14[_0x35fc('0x35')]);_0x3fe193[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x330a14[_0x35fc('0x33')],qs['fields'](_0x12e78f['query']['fields']));_0x3fe193[_0x35fc('0x37')]=_0x3fe193['attributes'][_0x35fc('0x38')]?_0x3fe193['attributes']:_0x330a14[_0x35fc('0x33')];if(_0x12e78f[_0x35fc('0x35')][_0x35fc('0x39')]){_0x3fe193[_0x35fc('0x2d')]=[{'all':!![]}];}_0x3fe193=_[_0x35fc('0x3a')]({},_0x3fe193,_0x12e78f[_0x35fc('0x3b')]);return db[_0x35fc('0x29')]['find'](_0x3fe193)[_0x35fc('0x18')](handleEntityNotFound(_0x4e43b4,null))[_0x35fc('0x18')](respondWithResult(_0x4e43b4,null))['catch'](handleError(_0x4e43b4,null));};exports[_0x35fc('0x3c')]=function(_0x1ccc41,_0x1aac67){return db[_0x35fc('0x29')][_0x35fc('0x3c')](_0x1ccc41[_0x35fc('0x3d')],{})['then'](function(_0x3f6480){var _0x267858=_0x1ccc41[_0x35fc('0x3e')]['get']({'plain':!![]});if(!_0x267858)throw new Error(_0x35fc('0x3f'));if(_0x267858[_0x35fc('0x40')]==='user'){var _0x237548=_0x3f6480[_0x35fc('0x19')]({'plain':!![]});var _0x43b77c=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b')},{'name':_0x35fc('0x1c'),'value':_0x35fc('0x1d')}];var _0x3ec51f=_['find'](_0x43b77c,['value',_0x237548[_0x35fc('0x22')]])[_0x35fc('0x27')];return db['UserProfileSection']['find']({'where':{'name':_0x3ec51f,'userProfileId':_0x267858['userProfileId']},'raw':!![]})[_0x35fc('0x18')](function(_0x10f98b){if(_0x10f98b&&_0x10f98b['autoAssociation']===0x0){return db[_0x35fc('0x24')][_0x35fc('0x3c')]({'name':_0x237548[_0x35fc('0x27')],'resourceId':_0x237548['id'],'type':_0x10f98b[_0x35fc('0x27')],'sectionId':_0x10f98b['id']},{})['then'](function(){return _0x3f6480;});}else{return _0x3f6480;}})['catch'](function(_0x5bf2f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bf2f4);throw _0x5bf2f4;});}return _0x3f6480;})[_0x35fc('0x18')](respondWithResult(_0x1aac67,0xc9))[_0x35fc('0x30')](handleError(_0x1aac67,null));};exports['clone']=function(_0x119925,_0x56cf1f){var _0x13d16c={'where':{'id':_0x119925[_0x35fc('0x32')]['id']}},_0x40797d={};_0x40797d[_0x35fc('0x33')]=_[_0x35fc('0x34')](db['VoiceQueue'][_0x35fc('0x41')]);_0x13d16c[_0x35fc('0x37')]=_['intersection'](_0x40797d[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x119925[_0x35fc('0x35')][_0x35fc('0x42')]));_0x13d16c['attributes']=_0x13d16c[_0x35fc('0x37')]['length']?_0x13d16c['attributes']:_0x40797d[_0x35fc('0x33')];if(_0x119925[_0x35fc('0x35')][_0x35fc('0x39')]){_0x13d16c[_0x35fc('0x2d')]=[{'all':!![]}];}_0x13d16c=_[_0x35fc('0x3a')]({},_0x13d16c,_0x119925[_0x35fc('0x3b')]);return db[_0x35fc('0x29')][_0x35fc('0x23')](_0x13d16c)['then'](handleEntityNotFound(_0x56cf1f,null))[_0x35fc('0x18')](function(_0x91d7c0){if(_0x91d7c0){var _0xeca02e=_0x91d7c0[_0x35fc('0x19')]({'plain':!![]});_0xeca02e=qs[_0x35fc('0x43')](_0xeca02e,['id',_0x35fc('0x44'),_0x35fc('0x45')]);_0x119925[_0x35fc('0x3d')]=_[_0x35fc('0x43')](_0x119925[_0x35fc('0x3d')],['id',_0x35fc('0x44'),_0x35fc('0x45')]);return db[_0x35fc('0x29')][_0x35fc('0x3c')](_['merge'](_0xeca02e,_0x119925['body']),{'include':_0x119925[_0x35fc('0x35')][_0x35fc('0x39')]?[{'all':!![]}]:undefined})[_0x35fc('0x18')](function(_0x2bf0b0){var _0x3ee296=_0x119925[_0x35fc('0x3e')]['get']({'plain':!![]});if(!_0x3ee296)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ee296[_0x35fc('0x40')]===_0x35fc('0x3e')){var _0x395d63=_0x2bf0b0[_0x35fc('0x19')]({'plain':!![]});var _0x5b2595=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b')},{'name':'QueueCampaigns','value':_0x35fc('0x1d')}];var _0x2536d3=_['find'](_0x5b2595,[_0x35fc('0x21'),_0x395d63[_0x35fc('0x22')]])[_0x35fc('0x27')];return db[_0x35fc('0x46')]['find']({'where':{'name':_0x2536d3,'userProfileId':_0x3ee296['userProfileId']},'raw':!![]})['then'](function(_0x240338){if(_0x240338&&_0x240338[_0x35fc('0x47')]===0x0){return db['UserProfileResource'][_0x35fc('0x3c')]({'name':_0x395d63[_0x35fc('0x27')],'resourceId':_0x395d63['id'],'type':_0x240338[_0x35fc('0x27')],'sectionId':_0x240338['id']},{})[_0x35fc('0x18')](function(){return _0x2bf0b0;});}else{return _0x2bf0b0;}})[_0x35fc('0x30')](function(_0x538be0){logger[_0x35fc('0x48')](_0x35fc('0x49'),_0x538be0);throw _0x538be0;});}return _0x2bf0b0;});}})[_0x35fc('0x18')](respondWithResult(_0x56cf1f,0xc9))['catch'](handleError(_0x56cf1f,null));};exports[_0x35fc('0x17')]=function(_0x1dbf5a,_0x47fb1a){if(_0x1dbf5a[_0x35fc('0x3d')]['id']){delete _0x1dbf5a[_0x35fc('0x3d')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x1dbf5a[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x47fb1a,null))[_0x35fc('0x18')](saveUpdates(_0x1dbf5a[_0x35fc('0x3d')],null))['then'](respondWithResult(_0x47fb1a,null))[_0x35fc('0x30')](handleError(_0x47fb1a,null));};exports[_0x35fc('0x25')]=function(_0x303927,_0x4fabd4){return db[_0x35fc('0x29')]['find']({'where':{'id':_0x303927['params']['id']}})['then'](handleEntityNotFound(_0x4fabd4,null))[_0x35fc('0x18')](removeEntity(_0x4fabd4,null))[_0x35fc('0x30')](handleError(_0x4fabd4,null));};exports[_0x35fc('0x4a')]=function(_0x13901c,_0x3d06b8){var _0x4bbea0={'raw':![],'where':{}};var _0x579f5a={};var _0x5353ea={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x13901c[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x3d06b8,null))[_0x35fc('0x18')](function(_0x3ef680){if(_0x3ef680){_0x579f5a['model']=_[_0x35fc('0x34')](db[_0x35fc('0x4b')][_0x35fc('0x41')]);_0x579f5a[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x13901c[_0x35fc('0x35')]);_0x579f5a[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x579f5a[_0x35fc('0x33')],_0x579f5a['query']);_0x4bbea0[_0x35fc('0x37')]=_['intersection'](_0x579f5a[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x13901c[_0x35fc('0x35')][_0x35fc('0x42')]));_0x4bbea0['attributes']=_0x4bbea0[_0x35fc('0x37')]['length']?_0x4bbea0['attributes']:_0x579f5a['model'];if(!_0x13901c[_0x35fc('0x35')]['hasOwnProperty'](_0x35fc('0x4d'))){_0x4bbea0['limit']=qs[_0x35fc('0x11')](_0x13901c['query'][_0x35fc('0x11')]);_0x4bbea0[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x13901c[_0x35fc('0x35')]['offset']);}_0x4bbea0[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x13901c[_0x35fc('0x35')]['sort']);_0x4bbea0[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x13901c[_0x35fc('0x35')],_0x579f5a[_0x35fc('0x4c')]));_0x4bbea0[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x3ef680['id'];if(_0x13901c[_0x35fc('0x35')]['filter']){_0x4bbea0[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x4bbea0[_0x35fc('0x2c')],{'$or':_['map'](_0x4bbea0[_0x35fc('0x37')],function(_0x1b76f0){var _0x586729={};_0x586729[_0x1b76f0]={'$like':'%'+_0x13901c['query'][_0x35fc('0x1e')]+'%'};return _0x586729;})});}_0x4bbea0=_['merge']({},_0x4bbea0,_0x13901c[_0x35fc('0x3b')]);return db[_0x35fc('0x4b')][_0x35fc('0x13')]({'where':_0x4bbea0[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x20ddc6){_0x5353ea[_0x35fc('0x13')]=_0x20ddc6;if(_0x13901c[_0x35fc('0x35')][_0x35fc('0x39')]){_0x4bbea0[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x4b')][_0x35fc('0x2e')](_0x4bbea0);})[_0x35fc('0x18')](function(_0x9f034e){_0x5353ea[_0x35fc('0x2f')]=_0x9f034e;return _0x5353ea;});}})[_0x35fc('0x18')](respondWithFilteredResult(_0x3d06b8,_0x4bbea0))[_0x35fc('0x30')](handleError(_0x3d06b8,null));};exports[_0x35fc('0x52')]=function(_0x3b2160,_0x3f3f36){var _0x4ba1b0={'raw':!![],'where':{}};var _0x1797d0={};var _0x55cb69={'count':0x0,'rows':[]};return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x3b2160[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x3f3f36,null))[_0x35fc('0x18')](function(_0x3f56f4){if(_0x3f56f4){_0x1797d0[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x54')][_0x35fc('0x41')]);_0x1797d0[_0x35fc('0x35')]=_['keys'](_0x3b2160[_0x35fc('0x35')]);_0x1797d0[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x1797d0[_0x35fc('0x33')],_0x1797d0[_0x35fc('0x35')]);_0x4ba1b0[_0x35fc('0x37')]=_['intersection'](_0x1797d0[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x42')]));_0x4ba1b0[_0x35fc('0x37')]=_0x4ba1b0[_0x35fc('0x37')][_0x35fc('0x38')]?_0x4ba1b0[_0x35fc('0x37')]:_0x1797d0[_0x35fc('0x33')];if(!_0x3b2160['query'][_0x35fc('0x55')]('nolimit')){_0x4ba1b0[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x3b2160['query'][_0x35fc('0x11')]);_0x4ba1b0[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x4ba1b0[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x4ba1b0['where']=qs['filters'](_['pick'](_0x3b2160['query'],_0x1797d0[_0x35fc('0x4c')]));_0x4ba1b0[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x3f56f4['id'];if(_0x3b2160[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x4ba1b0['where']=_[_0x35fc('0x3a')](_0x4ba1b0[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x4ba1b0[_0x35fc('0x37')],function(_0x584a58){var _0x15e936={};_0x15e936[_0x584a58]={'$like':'%'+_0x3b2160[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x15e936;})});}_0x4ba1b0=_['merge']({},_0x4ba1b0,_0x3b2160[_0x35fc('0x3b')]);return db[_0x35fc('0x54')][_0x35fc('0x13')]({'where':_0x4ba1b0[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x31d276){_0x55cb69[_0x35fc('0x13')]=_0x31d276;if(_0x3b2160[_0x35fc('0x35')]['includeAll']){_0x4ba1b0[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x54')][_0x35fc('0x2e')](_0x4ba1b0);})[_0x35fc('0x18')](function(_0x221c5b){_0x55cb69[_0x35fc('0x2f')]=_0x221c5b;return _0x55cb69;});}})['then'](respondWithFilteredResult(_0x3f3f36,_0x4ba1b0))[_0x35fc('0x30')](handleError(_0x3f3f36,null));};exports['getHopperFinals']=function(_0x4855ee,_0x1a2da0){var _0x597670={'raw':!![],'where':{}};var _0x1246c7={};var _0x233b7d={'count':0x0,'rows':[]};return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x4855ee[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x1a2da0,null))[_0x35fc('0x18')](function(_0x1beb46){if(_0x1beb46){_0x1246c7[_0x35fc('0x33')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x1246c7[_0x35fc('0x35')]=_['keys'](_0x4855ee[_0x35fc('0x35')]);_0x1246c7[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x1246c7[_0x35fc('0x33')],_0x1246c7['query']);_0x597670[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x1246c7[_0x35fc('0x33')],qs['fields'](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x42')]));_0x597670[_0x35fc('0x37')]=_0x597670['attributes']['length']?_0x597670['attributes']:_0x1246c7[_0x35fc('0x33')];if(!_0x4855ee[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x597670['limit']=qs[_0x35fc('0x11')](_0x4855ee[_0x35fc('0x35')]['limit']);_0x597670['offset']=qs[_0x35fc('0x10')](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x597670['order']=qs['sort'](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x597670['where']=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x4855ee[_0x35fc('0x35')],_0x1246c7['filters']));_0x597670[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x1beb46['id'];if(_0x4855ee[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x597670['where']=_[_0x35fc('0x3a')](_0x597670[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x597670['attributes'],function(_0x96dfc){var _0x26d242={};_0x26d242[_0x96dfc]={'$like':'%'+_0x4855ee[_0x35fc('0x35')]['filter']+'%'};return _0x26d242;})});}_0x597670=_[_0x35fc('0x3a')]({},_0x597670,_0x4855ee[_0x35fc('0x3b')]);return db['CmHopperFinal'][_0x35fc('0x13')]({'where':_0x597670[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x45eaae){_0x233b7d[_0x35fc('0x13')]=_0x45eaae;if(_0x4855ee[_0x35fc('0x35')][_0x35fc('0x39')]){_0x597670[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x56')]['findAll'](_0x597670);})[_0x35fc('0x18')](function(_0x3fc6cc){_0x233b7d[_0x35fc('0x2f')]=_0x3fc6cc;return _0x233b7d;});}})[_0x35fc('0x18')](respondWithFilteredResult(_0x1a2da0,_0x597670))['catch'](handleError(_0x1a2da0,null));};exports[_0x35fc('0x57')]=function(_0x1808a3,_0x209d7a){var _0x7b633a={'raw':!![],'where':{}};var _0x4684b6={};var _0x319998={'count':0x0,'rows':[]};return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x1808a3['params']['id']}})['then'](handleEntityNotFound(_0x209d7a,null))[_0x35fc('0x18')](function(_0xafa771){if(_0xafa771){_0x4684b6[_0x35fc('0x33')]=_['keys'](db[_0x35fc('0x58')][_0x35fc('0x41')]);_0x4684b6[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x1808a3['query']);_0x4684b6['filters']=_[_0x35fc('0x36')](_0x4684b6['model'],_0x4684b6[_0x35fc('0x35')]);_0x7b633a[_0x35fc('0x37')]=_['intersection'](_0x4684b6['model'],qs[_0x35fc('0x42')](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x42')]));_0x7b633a['attributes']=_0x7b633a[_0x35fc('0x37')][_0x35fc('0x38')]?_0x7b633a[_0x35fc('0x37')]:_0x4684b6['model'];if(!_0x1808a3[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x7b633a[_0x35fc('0x11')]=qs['limit'](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x11')]);_0x7b633a[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x7b633a['order']=qs[_0x35fc('0x4f')](_0x1808a3[_0x35fc('0x35')]['sort']);_0x7b633a[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_['pick'](_0x1808a3[_0x35fc('0x35')],_0x4684b6[_0x35fc('0x4c')]));_0x7b633a[_0x35fc('0x2c')][_0x35fc('0x51')]=_0xafa771['id'];if(_0x1808a3[_0x35fc('0x35')]['filter']){_0x7b633a[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x7b633a[_0x35fc('0x2c')],{'$or':_['map'](_0x7b633a[_0x35fc('0x37')],function(_0x5a8641){var _0x58d3d5={};_0x58d3d5[_0x5a8641]={'$like':'%'+_0x1808a3[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x58d3d5;})});}_0x7b633a=_[_0x35fc('0x3a')]({},_0x7b633a,_0x1808a3[_0x35fc('0x3b')]);return db[_0x35fc('0x58')]['count']({'where':_0x7b633a[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x44683e){_0x319998['count']=_0x44683e;if(_0x1808a3[_0x35fc('0x35')][_0x35fc('0x39')]){_0x7b633a[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x58')][_0x35fc('0x2e')](_0x7b633a);})['then'](function(_0x1a2d73){_0x319998[_0x35fc('0x2f')]=_0x1a2d73;return _0x319998;});}})['then'](respondWithFilteredResult(_0x209d7a,_0x7b633a))['catch'](handleError(_0x209d7a,null));};exports[_0x35fc('0x59')]=function(_0x44b356,_0x207336){var _0x2b16b2={};var _0x405a43={};var _0x2b2a87;var _0x8c80ca;return db['VoiceQueue']['findOne']({'where':{'id':_0x44b356[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x207336,null))[_0x35fc('0x18')](function(_0x1a92fa){if(_0x1a92fa){_0x2b2a87=_0x1a92fa;_0x405a43[_0x35fc('0x33')]=_['keys'](db['Team'][_0x35fc('0x41')]);_0x405a43[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x44b356[_0x35fc('0x35')]);_0x405a43['filters']=_['intersection'](_0x405a43[_0x35fc('0x33')],_0x405a43[_0x35fc('0x35')]);_0x2b16b2[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x405a43['model'],qs['fields'](_0x44b356[_0x35fc('0x35')][_0x35fc('0x42')]));_0x2b16b2['attributes']=_0x2b16b2[_0x35fc('0x37')][_0x35fc('0x38')]?_0x2b16b2[_0x35fc('0x37')]:_0x405a43[_0x35fc('0x33')];_0x2b16b2[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x44b356[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x2b16b2[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x44b356[_0x35fc('0x35')],_0x405a43[_0x35fc('0x4c')]));if(_0x44b356[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x2b16b2[_0x35fc('0x2c')]=_['merge'](_0x2b16b2[_0x35fc('0x2c')],{'$or':_['map'](_0x2b16b2[_0x35fc('0x37')],function(_0x5d677a){var _0x5aa072={};_0x5aa072[_0x5d677a]={'$like':'%'+_0x44b356[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x5aa072;})});}_0x2b16b2=_[_0x35fc('0x3a')]({},_0x2b16b2,_0x44b356['options']);return _0x2b2a87[_0x35fc('0x59')](_0x2b16b2);}})[_0x35fc('0x18')](function(_0xe9c7c2){if(_0xe9c7c2){_0x8c80ca=_0xe9c7c2[_0x35fc('0x38')];if(!_0x44b356[_0x35fc('0x35')][_0x35fc('0x55')]('nolimit')){_0x2b16b2['limit']=qs[_0x35fc('0x11')](_0x44b356['query']['limit']);_0x2b16b2[_0x35fc('0x10')]=qs['offset'](_0x44b356['query']['offset']);}return _0x2b2a87[_0x35fc('0x59')](_0x2b16b2);}})['then'](function(_0x355154){if(_0x355154){return _0x355154?{'count':_0x8c80ca,'rows':_0x355154}:null;}})[_0x35fc('0x18')](respondWithResult(_0x207336,null))[_0x35fc('0x30')](handleError(_0x207336,null));};exports[_0x35fc('0x5a')]=function(_0x392212,_0x201dfa){var _0x4ab6f9=_0x392212['body'][_0x35fc('0x5b')];var _0x5994ec=_[_0x35fc('0x20')](_0x4ab6f9,'id');return db[_0x35fc('0x5c')]['findAll']({'where':{'id':_0x5994ec},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x35fc('0x27'),_0x35fc('0x5d'),_0x35fc('0x5e'),_0x35fc('0x5f')],'raw':!![]}]})[_0x35fc('0x18')](function(_0x28525f){if(_0x28525f){var _0x9116b1=_[_0x35fc('0x60')](_0x28525f,function(_0x4818ea){var _0x5436a3=_0x4818ea['get']({'plain':!![]});_0x5436a3['Agents'][_0x35fc('0x61')](function(_0x4c9c90){_0x4c9c90[_0x35fc('0x62')]=_['find'](_0x4ab6f9,{'id':_0x5436a3['id']})[_0x35fc('0x62')];});return _0x5436a3[_0x35fc('0x63')];});return db['VoiceQueue']['find']({'where':{'id':_0x392212[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(_0x10ef95){return db[_0x35fc('0x64')][_0x35fc('0x65')](function(_0x4ff80c){return _0x10ef95['addTeams'](_0x5994ec,{'transaction':_0x4ff80c})[_0x35fc('0x18')](function(){return BPromise['each'](_0x4ab6f9,function(_0x15b6be){return db['TeamVoiceQueue'][_0x35fc('0x66')]({'TeamId':_0x15b6be['id'],'VoiceQueueId':_0x392212[_0x35fc('0x32')]['id'],'penalty':_0x15b6be[_0x35fc('0x62')]},{'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){return BPromise['each'](_0x9116b1,function(_0x29a77a){return db['UserVoiceQueue'][_0x35fc('0x67')]({'where':{'UserId':_0x29a77a['id'],'VoiceQueueId':_0x392212['params']['id']},'defaults':{'penalty':_0x29a77a['penalty']},'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){return BPromise['each'](_[_0x35fc('0x1e')](_0x9116b1,{'online':!![]}),function(_0x2c8361){return db[_0x35fc('0x68')][_0x35fc('0x66')]({'membername':_0x2c8361[_0x35fc('0x27')],'UserId':_0x2c8361['id'],'queue_name':_0x10ef95[_0x35fc('0x27')],'VoiceQueueId':_0x10ef95['id'],'interface':_[_0x35fc('0x69')](_0x2c8361[_0x35fc('0x5f')])?util[_0x35fc('0x6a')]('SIP/%s',_0x2c8361[_0x35fc('0x27')]):_0x2c8361[_0x35fc('0x5f')],'paused':_0x2c8361[_0x35fc('0x5e')]||![],'penalty':_0x2c8361[_0x35fc('0x62')]},{'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){_0x9116b1[_0x35fc('0x61')](function(_0x4020ae){socket[_0x35fc('0x6b')]('userVoiceQueue:save',{'UserId':_0x4020ae['id'],'VoiceQueueId':_0x10ef95['id']});});});});});}})['then'](respondWithStatusCode(_0x201dfa,null))['catch'](handleError(_0x201dfa,null));};exports['removeTeams']=function(_0x5c8419,_0x271087){return db[_0x35fc('0x5c')][_0x35fc('0x2e')]({'where':{'id':_0x5c8419[_0x35fc('0x35')][_0x35fc('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x35fc('0x63'),'attributes':['id'],'raw':!![]}]})[_0x35fc('0x18')](handleEntityNotFound(_0x271087,null))[_0x35fc('0x18')](function(_0x2f450e){var _0x370e99=_['map'](_0x2f450e,'id');var _0x195ca3=[];var _0x398359=[];var _0x4188bc=squel['select']();_0x4188bc[_0x35fc('0x6d')](_0x35fc('0x6e'))[_0x35fc('0x6f')](_0x35fc('0x70'),'tq')[_0x35fc('0x71')](_0x35fc('0x72'),'ut',_0x35fc('0x73'))[_0x35fc('0x2c')](_0x35fc('0x74'),_0x5c8419[_0x35fc('0x32')]['id']);for(var _0x3aba1c=0x0;_0x3aba1c<_0x2f450e[_0x35fc('0x38')];_0x3aba1c+=0x1){let _0x225eb1=_0x2f450e[_0x3aba1c];for(var _0x206f0b=0x0;_0x206f0b<_0x225eb1[_0x35fc('0x63')]['length'];_0x206f0b+=0x1){let _0x4ae3d8=_0x225eb1[_0x35fc('0x63')][_0x206f0b];var _0x6a0c44=_0x4188bc[_0x35fc('0x75')]();_0x6a0c44[_0x35fc('0x2c')](_0x35fc('0x76'),_0x4ae3d8['id']);_0x398359[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x6a0c44[_0x35fc('0x78')](),{'type':db[_0x35fc('0x64')][_0x35fc('0x79')][_0x35fc('0x7a')]})[_0x35fc('0x18')](function(_0x336c4a){if(_0x336c4a[_0x35fc('0x38')]===0x1){return _0x4ae3d8['id'];}else{var _0x5824a0=_[_0x35fc('0x7b')](_[_0x35fc('0x20')](_0x336c4a,_0x35fc('0x7c')),function(_0x34e007){return _[_0x35fc('0x7d')](_0x370e99,_0x34e007);});if(_0x5824a0){return _0x4ae3d8['id'];}}}));}}return BPromise[_0x35fc('0x7e')](_0x398359)[_0x35fc('0x18')](function(_0xa4c51a){_0x195ca3=_(_0x195ca3)['union'](_0xa4c51a)['compact']()[_0x35fc('0x21')]();return db[_0x35fc('0x29')]['find']({'where':{'id':_0x5c8419[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(_0x43a794){return db[_0x35fc('0x64')]['transaction'](function(_0x42912c){return _0x43a794[_0x35fc('0x7f')](_0x5c8419[_0x35fc('0x35')][_0x35fc('0x6c')],{'transaction':_0x42912c})['then'](function(){if(!_[_0x35fc('0x80')](_0x195ca3)){return _0x43a794[_0x35fc('0x81')](_0x195ca3,{'transaction':_0x42912c})['then'](function(){return db[_0x35fc('0x68')][_0x35fc('0x25')]({'where':{'VoiceQueueId':_0x5c8419[_0x35fc('0x32')]['id'],'UserId':_0x195ca3},'transaction':_0x42912c});});}})['then'](function(){_0x195ca3[_0x35fc('0x61')](function(_0x4de072){socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':_0x4de072,'VoiceQueueId':_0x43a794['id']});});});});});});})['then'](respondWithStatusCode(_0x271087,null))[_0x35fc('0x30')](handleError(_0x271087,null));};exports[_0x35fc('0x83')]=function(_0x139065,_0x25aedf){var _0x316d37,_0x3fd897;return db[_0x35fc('0x29')]['find']({'where':{'id':_0x139065['params']['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x25aedf,null))[_0x35fc('0x18')](function(_0x2463dd){if(_0x2463dd){_0x3fd897=_0x2463dd;return _0x2463dd[_0x35fc('0x83')](_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0x139065['body'],[_0x35fc('0x6c'),'id'])||{})[_0x35fc('0x84')](function(_0x46b9b6){for(var _0x4cdc31=0x0;_0x4cdc31<_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')][_0x35fc('0x38')];_0x4cdc31+=0x1){socket[_0x35fc('0x6b')](_0x35fc('0x85'),{'UserId':Number(_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')][_0x4cdc31]),'VoiceQueueId':Number(_0x139065[_0x35fc('0x32')]['id'])});}return _0x46b9b6;});}})[_0x35fc('0x18')](function(_0x14e414){_0x316d37=_0x14e414||[];if(_0x3fd897){return db[_0x35fc('0x86')][_0x35fc('0x2e')]({'where':{'id':_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')]},'attributes':['id',_0x35fc('0x27'),_0x35fc('0x5d'),_0x35fc('0x5e'),_0x35fc('0x5f')],'raw':!![]});}})[_0x35fc('0x18')](function(_0x4949ed){if(!_[_0x35fc('0x80')](_0x4949ed)){var _0x4f74ff=[];for(var _0x28cbc8=0x0;_0x28cbc8<_0x4949ed[_0x35fc('0x38')];_0x28cbc8++){if(_0x4949ed[_0x28cbc8]['online']){_0x4f74ff[_0x35fc('0x77')](db[_0x35fc('0x68')][_0x35fc('0x66')]({'membername':_0x4949ed[_0x28cbc8][_0x35fc('0x27')],'UserId':_0x4949ed[_0x28cbc8]['id'],'queue_name':_0x3fd897[_0x35fc('0x27')],'VoiceQueueId':_0x3fd897['id'],'interface':_[_0x35fc('0x69')](_0x4949ed[_0x28cbc8][_0x35fc('0x5f')])?util[_0x35fc('0x6a')]('SIP/%s',_0x4949ed[_0x28cbc8][_0x35fc('0x27')]):_0x4949ed[_0x28cbc8][_0x35fc('0x5f')],'paused':_0x4949ed[_0x28cbc8][_0x35fc('0x5e')]||![],'penalty':_0x139065[_0x35fc('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4f74ff);}})['then'](function(){return _0x316d37;})['then'](respondWithResult(_0x25aedf,null))[_0x35fc('0x30')](handleError(_0x25aedf,null));};exports['removeAgents']=function(_0xcbabdf,_0x2475d6){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0xcbabdf[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x2475d6,null))[_0x35fc('0x18')](function(_0x41cbaa){if(_0x41cbaa){return _0x41cbaa[_0x35fc('0x81')](_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')])[_0x35fc('0x18')](function(){if(_[_0x35fc('0x87')](_0xcbabdf['query'][_0x35fc('0x6c')])){for(var _0x3e8580=0x0;_0x3e8580<_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]['length'];_0x3e8580+=0x1){socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':Number(_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')][_0x3e8580]),'VoiceQueueId':Number(_0xcbabdf[_0x35fc('0x32')]['id'])});}}else{socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':Number(_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]),'VoiceQueueId':Number(_0xcbabdf[_0x35fc('0x32')]['id'])});}});}})[_0x35fc('0x18')](function(_0xa39c4c){return db[_0x35fc('0x68')][_0x35fc('0x25')]({'where':{'VoiceQueueId':_0xcbabdf[_0x35fc('0x32')]['id'],'UserId':_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]}})[_0x35fc('0x18')](function(){return _0xa39c4c;});})[_0x35fc('0x18')](respondWithStatusCode(_0x2475d6,null))[_0x35fc('0x30')](handleError(_0x2475d6,null));};exports[_0x35fc('0x88')]=function(_0x11d0f4,_0x4f150a){var _0x12238e={};var _0x16b52f={};var _0x238242;var _0x452f30;return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x11d0f4[_0x35fc('0x32')]['id']}})['then'](handleEntityNotFound(_0x4f150a,null))[_0x35fc('0x18')](function(_0x156c24){if(_0x156c24){_0x238242=_0x156c24;_0x16b52f[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x86')][_0x35fc('0x41')]);_0x16b52f[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x11d0f4[_0x35fc('0x35')]);_0x16b52f[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x16b52f[_0x35fc('0x33')],_0x16b52f[_0x35fc('0x35')]);_0x12238e[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x16b52f[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x42')]));_0x12238e[_0x35fc('0x37')]=_0x12238e['attributes'][_0x35fc('0x38')]?_0x12238e[_0x35fc('0x37')]:_0x16b52f[_0x35fc('0x33')];_0x12238e['order']=qs[_0x35fc('0x4f')](_0x11d0f4[_0x35fc('0x35')]['sort']);_0x12238e['where']=qs['filters'](_[_0x35fc('0x50')](_0x11d0f4[_0x35fc('0x35')],_0x16b52f['filters']));if(_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x12238e[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x12238e[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x12238e['attributes'],function(_0x13534c){var _0x3be339={};_0x3be339[_0x13534c]={'$like':'%'+_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x3be339;})});}_0x12238e=_[_0x35fc('0x3a')]({},_0x12238e,_0x11d0f4['options']);return _0x238242[_0x35fc('0x88')](_0x12238e);}})[_0x35fc('0x18')](function(_0x52f355){if(_0x52f355){_0x452f30=_0x52f355[_0x35fc('0x38')];if(!_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x12238e[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x11')]);_0x12238e[_0x35fc('0x10')]=qs['offset'](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x238242['getAgents'](_0x12238e);}})[_0x35fc('0x18')](function(_0x4ffbf9){if(_0x4ffbf9){return _0x4ffbf9?{'count':_0x452f30,'rows':_0x4ffbf9}:null;}})[_0x35fc('0x18')](respondWithResult(_0x4f150a,null))[_0x35fc('0x30')](handleError(_0x4f150a,null));};exports[_0x35fc('0x89')]=function(_0x206491,_0x536837){var _0x3cfbd4={};var _0x3ac7fb={};var _0x3916e7;var _0x4bcc53;return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x206491[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x536837,null))[_0x35fc('0x18')](function(_0x3da024){if(_0x3da024){_0x3916e7=_0x3da024;_0x3ac7fb[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x68')][_0x35fc('0x41')]);_0x3ac7fb[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x206491[_0x35fc('0x35')]);_0x3ac7fb[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x3ac7fb[_0x35fc('0x33')],_0x3ac7fb[_0x35fc('0x35')]);_0x3cfbd4['attributes']=_[_0x35fc('0x36')](_0x3ac7fb[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x206491[_0x35fc('0x35')][_0x35fc('0x42')]));_0x3cfbd4[_0x35fc('0x37')]=_0x3cfbd4[_0x35fc('0x37')]['length']?_0x3cfbd4['attributes']:_0x3ac7fb['model'];_0x3cfbd4['order']=qs[_0x35fc('0x4f')](_0x206491['query'][_0x35fc('0x4f')]);_0x3cfbd4[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x206491[_0x35fc('0x35')],_0x3ac7fb[_0x35fc('0x4c')]));if(_0x206491['query'][_0x35fc('0x1e')]){_0x3cfbd4['where']=_[_0x35fc('0x3a')](_0x3cfbd4['where'],{'$or':_['map'](_0x3cfbd4[_0x35fc('0x37')],function(_0x472e13){var _0x2d0512={};_0x2d0512[_0x472e13]={'$like':'%'+_0x206491['query']['filter']+'%'};return _0x2d0512;})});}_0x3cfbd4=_['merge']({},_0x3cfbd4,_0x206491['options']);return _0x3916e7[_0x35fc('0x89')](_0x3cfbd4);}})[_0x35fc('0x18')](function(_0x131db6){if(_0x131db6){_0x4bcc53=_0x131db6[_0x35fc('0x38')];if(!_0x206491[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x3cfbd4[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x206491['query']['limit']);_0x3cfbd4[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x206491[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x3916e7[_0x35fc('0x89')](_0x3cfbd4);}})[_0x35fc('0x18')](function(_0x4f4c68){return _0x4f4c68?{'count':_0x4bcc53,'rows':_0x4f4c68}:null;})[_0x35fc('0x18')](respondWithResult(_0x536837,null))[_0x35fc('0x30')](handleError(_0x536837,null));};exports[_0x35fc('0x8a')]=function(_0x4f9a00,_0x5c097d){var _0x11c117={};var _0x26b1cb={};var _0x84e749;var _0x4f9685;return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x4f9a00[_0x35fc('0x32')]['id']}})['then'](handleEntityNotFound(_0x5c097d,null))[_0x35fc('0x18')](function(_0x546d2e){if(_0x546d2e){_0x84e749=_0x546d2e;_0x26b1cb[_0x35fc('0x33')]=_['keys'](db[_0x35fc('0x8b')][_0x35fc('0x41')]);_0x26b1cb['query']=_[_0x35fc('0x34')](_0x4f9a00[_0x35fc('0x35')]);_0x26b1cb['filters']=_[_0x35fc('0x36')](_0x26b1cb[_0x35fc('0x33')],_0x26b1cb[_0x35fc('0x35')]);_0x11c117[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x26b1cb[_0x35fc('0x33')],qs['fields'](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x42')]));_0x11c117[_0x35fc('0x37')]=_0x11c117[_0x35fc('0x37')][_0x35fc('0x38')]?_0x11c117['attributes']:_0x26b1cb[_0x35fc('0x33')];_0x11c117[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x11c117[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x4f9a00[_0x35fc('0x35')],_0x26b1cb['filters']));if(_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x11c117[_0x35fc('0x2c')]=_['merge'](_0x11c117[_0x35fc('0x2c')],{'$or':_['map'](_0x11c117[_0x35fc('0x37')],function(_0x413a4b){var _0x599121={};_0x599121[_0x413a4b]={'$like':'%'+_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x599121;})});}_0x11c117=_[_0x35fc('0x3a')]({},_0x11c117,_0x4f9a00[_0x35fc('0x3b')]);return _0x84e749[_0x35fc('0x8a')](_0x11c117);}})[_0x35fc('0x18')](function(_0x411d09){if(_0x411d09){_0x4f9685=_0x411d09['length'];if(!_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x11c117['limit']=qs['limit'](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x11')]);_0x11c117[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x84e749[_0x35fc('0x8a')](_0x11c117);}})[_0x35fc('0x18')](function(_0x214f01){if(_0x214f01){return _0x214f01?{'count':_0x4f9685,'rows':_0x214f01}:null;}})[_0x35fc('0x18')](respondWithResult(_0x5c097d,null))[_0x35fc('0x30')](handleError(_0x5c097d,null));};exports[_0x35fc('0x8c')]=function(_0xae43b4,_0x3c5524){var _0x2ceb04=moment()[_0x35fc('0x6a')](_0x35fc('0x8d'));var _0x605f3b,_0x43bb43;return db['VoiceQueue'][_0x35fc('0x23')]({'where':{'id':_0xae43b4['params']['id']}})['then'](handleEntityNotFound(_0x3c5524,null))[_0x35fc('0x18')](function(_0x1d7881){if(_0x1d7881){_0x43bb43=_0x1d7881;return _0x1d7881[_0x35fc('0x8c')](_0xae43b4[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0xae43b4[_0x35fc('0x3d')],[_0x35fc('0x6c'),'id'])||{});}return null;})[_0x35fc('0x84')](function(_0x3e0ebb){var _0x138fe5;_0x605f3b=_0x3e0ebb||[];var _0x3033a0=[];if(_0x3e0ebb){for(var _0x228bb9=0x0;_0x228bb9<_0x3e0ebb[_0x35fc('0x38')];_0x228bb9+=0x1){var _0x163afe=_0x3e0ebb[_0x228bb9][_0x35fc('0x19')]({'plain':!![]});_0x43bb43[_0x35fc('0x8e')]=_0xae43b4[_0x35fc('0x3d')][_0x35fc('0x8e')]?_0xae43b4[_0x35fc('0x3d')]['dialCheckDuplicateType']:_0x43bb43[_0x35fc('0x8e')];switch(_0x43bb43[_0x35fc('0x8e')]){case _0x35fc('0x8f'):_0x138fe5=squel['insert']()[_0x35fc('0x90')](_0x35fc('0x91'))[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),_0x35fc('0x95'),'VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel['select']()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','scheduledAt')['field']('id','ContactId')[_0x35fc('0x6d')](_0x163afe[_0x35fc('0x97')]['toString'](),_0x35fc('0x95'))[_0x35fc('0x6d')](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','updatedAt')[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')](_0x35fc('0x9a'),_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())['where'](_0x35fc('0x9b'))['where'](_0x35fc('0x9c'),squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x9e'))[_0x35fc('0x6f')](_0x35fc('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0xae43b4['params']['id'][_0x35fc('0x78')]()))[_0x35fc('0x2c')](_0x35fc('0x9c'),squel['select']()[_0x35fc('0x6d')](_0x35fc('0xa0'))[_0x35fc('0x6f')](_0x35fc('0x91'))[_0x35fc('0x2c')](_0x35fc('0x74'),_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')]())))[_0x35fc('0x78')]();break;case _0x35fc('0xa1'):_0x138fe5=squel[_0x35fc('0xa2')]()['into'](_0x35fc('0x91'))[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),'ListId','VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x93'))['field']('id',_0x35fc('0x94'))[_0x35fc('0x6d')](_0x163afe[_0x35fc('0x97')]['toString'](),_0x35fc('0x95'))['field'](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x45'))['from']('cm_contacts')[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')]('ListId\x20=\x20?',_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())[_0x35fc('0x2c')](_0x35fc('0x9b'))[_0x35fc('0x2c')](_0x35fc('0x9c'),squel[_0x35fc('0x9d')]()['field']('COALESCE(phone,\x27\x27)')[_0x35fc('0x6f')](_0x35fc('0x91'))['where'](_0x35fc('0x74'),_0xae43b4['params']['id'][_0x35fc('0x78')]())))[_0x35fc('0x78')]();break;default:_0x138fe5=squel[_0x35fc('0xa2')]()[_0x35fc('0x90')]('cm_hopper')[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),_0x35fc('0x95'),'VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x93'))[_0x35fc('0x6d')]('id','ContactId')[_0x35fc('0x6d')](_0x163afe['CmListId']['toString'](),'ListId')[_0x35fc('0x6d')](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x45'))[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))['where'](_0x35fc('0x9a'),_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())[_0x35fc('0x2c')](_0x35fc('0x9b')))[_0x35fc('0x78')]();}_0x3033a0[_0x35fc('0x77')](db['sequelize'][_0x35fc('0x35')](_0x138fe5));}return BPromise['all'](_0x3033a0);}})[_0x35fc('0x18')](function(){var _0x477d70=[];var _0x28533f=squel['insert']()[_0x35fc('0x90')](_0x35fc('0xa3'))[_0x35fc('0x92')]([_0x35fc('0xa4'),_0x35fc('0x96'),_0x35fc('0xa5'),'createdAt',_0x35fc('0x45')],squel['select']()[_0x35fc('0x6d')]('h.id')['field'](_0x35fc('0xa6'))[_0x35fc('0x6d')]('ci.OrderBy+1')[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','updatedAt')[_0x35fc('0x6f')](_0x35fc('0xa7'),'ci')[_0x35fc('0x71')]('cm_hopper','h',_0x35fc('0xa8'))[_0x35fc('0x2c')](_0x35fc('0xa9'),_0x2ceb04)[_0x35fc('0x2c')](_0x35fc('0xaa'),_0x35fc('0xab')))[_0x35fc('0x78')]();_0x477d70[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x28533f));return BPromise[_0x35fc('0x7e')](_0x477d70);})[_0x35fc('0x18')](function(){return _0x605f3b;})[_0x35fc('0x18')](respondWithResult(_0x3c5524,null))[_0x35fc('0x30')](handleError(_0x3c5524,null));};exports['removeLists']=function(_0x57b3f1,_0x8fa3cf){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x57b3f1[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x8fa3cf,null))[_0x35fc('0x18')](function(_0x293c2d){if(_0x293c2d){return _0x293c2d[_0x35fc('0xac')](_0x57b3f1[_0x35fc('0x35')][_0x35fc('0x6c')]);}})['then'](function(_0x4860b4){if(_0x4860b4){return db[_0x35fc('0x4b')][_0x35fc('0x25')]({'where':{'ListId':_0x57b3f1[_0x35fc('0x35')][_0x35fc('0x6c')],'VoiceQueueId':_0x57b3f1[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(){return _0x4860b4;});}})[_0x35fc('0x18')](respondWithStatusCode(_0x8fa3cf,null))[_0x35fc('0x30')](handleError(_0x8fa3cf,null));};exports[_0x35fc('0xad')]=function(_0x55d140,_0x488cea){var _0x1a5f12={};var _0x4c40e5={};var _0x3afdf3;var _0x3b64de;return db['VoiceQueue'][_0x35fc('0x53')]({'where':{'id':_0x55d140['params']['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x488cea,null))[_0x35fc('0x18')](function(_0xa46452){if(_0xa46452){_0x3afdf3=_0xa46452;_0x4c40e5[_0x35fc('0x33')]=_[_0x35fc('0x34')](db['CmList'][_0x35fc('0x41')]);_0x4c40e5[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x55d140['query']);_0x4c40e5[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x4c40e5[_0x35fc('0x33')],_0x4c40e5['query']);_0x1a5f12[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x4c40e5[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x42')]));_0x1a5f12[_0x35fc('0x37')]=_0x1a5f12[_0x35fc('0x37')][_0x35fc('0x38')]?_0x1a5f12[_0x35fc('0x37')]:_0x4c40e5[_0x35fc('0x33')];_0x1a5f12[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x1a5f12[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x55d140[_0x35fc('0x35')],_0x4c40e5[_0x35fc('0x4c')]));if(_0x55d140['query'][_0x35fc('0x1e')]){_0x1a5f12[_0x35fc('0x2c')]=_['merge'](_0x1a5f12[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x1a5f12[_0x35fc('0x37')],function(_0x55c126){var _0x9e7561={};_0x9e7561[_0x55c126]={'$like':'%'+_0x55d140[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x9e7561;})});}_0x1a5f12=_[_0x35fc('0x3a')]({},_0x1a5f12,_0x55d140[_0x35fc('0x3b')]);return _0x3afdf3[_0x35fc('0xad')](_0x1a5f12);}})[_0x35fc('0x18')](function(_0x5545e9){if(_0x5545e9){_0x3b64de=_0x5545e9[_0x35fc('0x38')];if(!_0x55d140[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x1a5f12[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x11')]);_0x1a5f12['offset']=qs['offset'](_0x55d140[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x3afdf3['getBlackLists'](_0x1a5f12);}})[_0x35fc('0x18')](function(_0x2c1181){if(_0x2c1181){return _0x2c1181?{'count':_0x3b64de,'rows':_0x2c1181}:null;}})[_0x35fc('0x18')](respondWithResult(_0x488cea,null))[_0x35fc('0x30')](handleError(_0x488cea,null));};exports[_0x35fc('0xae')]=function(_0x3f7fd7,_0x5e16f1){var _0xa46ffd;return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x3f7fd7[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x5e16f1,null))[_0x35fc('0x18')](function(_0x4abeb5){if(_0x4abeb5){return _0x4abeb5[_0x35fc('0xae')](_0x3f7fd7[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0x3f7fd7[_0x35fc('0x3d')],[_0x35fc('0x6c'),'id'])||{});}return null;})[_0x35fc('0x84')](function(_0x4007f9){var _0x58d0b1;_0xa46ffd=_0x4007f9||[];var _0x4bf83e=[];if(_0x4007f9){for(var _0x1afe94=0x0;_0x1afe94<_0x4007f9[_0x35fc('0x38')];_0x1afe94+=0x1){var _0x108366=_0x4007f9[_0x1afe94][_0x35fc('0x19')]({'plain':!![]});_0x58d0b1=squel['insert']()[_0x35fc('0x90')]('cm_hopper_black')['fromQuery']([_0x35fc('0x96'),_0x35fc('0x94'),_0x35fc('0x95'),_0x35fc('0x51'),_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()['field'](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('id',_0x35fc('0x94'))['field'](_0x108366[_0x35fc('0x97')][_0x35fc('0x78')](),_0x35fc('0x95'))[_0x35fc('0x6d')](_0x3f7fd7[_0x35fc('0x32')]['id']['toString'](),_0x35fc('0x51'))[_0x35fc('0x6d')](_0x35fc('0xaf'),_0x35fc('0x44'))[_0x35fc('0x6d')]('NOW()','updatedAt')[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')](_0x35fc('0x9a'),_0x108366[_0x35fc('0x97')]['toString']())[_0x35fc('0x2c')](_0x35fc('0x9b')))['toString']();_0x4bf83e[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x58d0b1));}return BPromise[_0x35fc('0x7e')](_0x4bf83e);}})[_0x35fc('0x18')](function(){return _0xa46ffd;})[_0x35fc('0x18')](respondWithResult(_0x5e16f1,null))[_0x35fc('0x30')](handleError(_0x5e16f1,null));};exports[_0x35fc('0xb0')]=function(_0x4fd3d4,_0x2dff64){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x4fd3d4['params']['id']}})['then'](handleEntityNotFound(_0x2dff64,null))[_0x35fc('0x18')](function(_0x409a32){if(_0x409a32){return _0x409a32['removeBlackLists'](_0x4fd3d4[_0x35fc('0x35')][_0x35fc('0x6c')]);}})[_0x35fc('0x18')](function(_0x2c0bf5){if(_0x2c0bf5){return db['CmHopperBlack'][_0x35fc('0x25')]({'where':{'ListId':_0x4fd3d4['query']['ids'],'VoiceQueueId':_0x4fd3d4[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(){return _0x2c0bf5;});}})[_0x35fc('0x18')](respondWithStatusCode(_0x2dff64,null))[_0x35fc('0x30')](handleError(_0x2dff64,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f14=['remove','emit','events','save','update'];(function(_0x2e36cc,_0x4d3678){var _0x4a39a=function(_0x2c2eeb){while(--_0x2c2eeb){_0x2e36cc['push'](_0x2e36cc['shift']());}};_0x4a39a(++_0x4d3678);}(_0x9f14,0x156));var _0x49f1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9f14[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x49f1('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x49f1('0x1'),'afterUpdate':_0x49f1('0x2'),'afterDestroy':_0x49f1('0x3')};function emitEvent(_0xdfcd0e){return function(_0x58a7ad,_0x36dc78,_0x3f3e7f){VoiceQueueEvents['emit'](_0xdfcd0e+':'+_0x58a7ad['id'],_0x58a7ad);VoiceQueueEvents[_0x49f1('0x4')](_0xdfcd0e,_0x58a7ad);_0x3f3e7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xf0d0=['events','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x6e09eb,_0x5ef42d){var _0xe5c3e2=function(_0x312e36){while(--_0x312e36){_0x6e09eb['push'](_0x6e09eb['shift']());}};_0xe5c3e2(++_0x5ef42d);}(_0xf0d0,0x1d0));var _0x0f0d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0d0[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x0f0d('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0f0d('0x1')](0x0);var events={'afterCreate':_0x0f0d('0x2'),'afterUpdate':_0x0f0d('0x3'),'afterDestroy':_0x0f0d('0x4')};function emitEvent(_0x296f11){return function(_0x4d3ed5,_0x355ee8,_0x20e990){VoiceQueueEvents['emit'](_0x296f11+':'+_0x4d3ed5['id'],_0x4d3ed5);VoiceQueueEvents[_0x0f0d('0x5')](_0x296f11,_0x4d3ed5);_0x20e990(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x0f0d('0x6')](e,emitEvent(event));}}module[_0x0f0d('0x7')]=VoiceQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x1aee7f,_0x178cc1){var _0x1659e1=function(_0x5b8d70){while(--_0x5b8d70){_0x1aee7f['push'](_0x1aee7f['shift']());}};_0x1659e1(++_0x178cc1);}(_0x34e8,0x12c));var _0x834e=function(_0x2aa6e4,_0x119958){_0x2aa6e4=_0x2aa6e4-0x0;var _0x2ff6d2=_0x34e8[_0x2aa6e4];return _0x2ff6d2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x008c,0x188));var _0xc008=function(_0x48f1db,_0x554c57){_0x48f1db=_0x48f1db-0x0;var _0x27de48=_0x008c[_0x48f1db];return _0x27de48;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1ce=['../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ef39e,_0x496609){var _0x57ad2a=function(_0x413d2b){while(--_0x413d2b){_0x3ef39e['push'](_0x3ef39e['shift']());}};_0x57ad2a(++_0x496609);}(_0xb1ce,0x150));var _0xeb1c=function(_0xe9fca1,_0x5ba251){_0xe9fca1=_0xe9fca1-0x0;var _0x55ae32=_0xb1ce[_0xe9fca1];return _0x55ae32;};'use strict';var _=require(_0xeb1c('0x0'));var util=require(_0xeb1c('0x1'));var moment=require(_0xeb1c('0x2'));var BPromise=require(_0xeb1c('0x3'));var rs=require(_0xeb1c('0x4'));var fs=require('fs');var Redis=require(_0xeb1c('0x5'));var db=require(_0xeb1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb1c('0x7'))(_0xeb1c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb1c('0x9')][_0xeb1c('0xa')]({'port':0x232a});config[_0xeb1c('0xb')]=_[_0xeb1c('0xc')](config['redis'],{'host':_0xeb1c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb1c('0xb')]));require('./voiceQueue.socket')[_0xeb1c('0xe')](socket);function respondWithRpcPromise(_0xc6213f,_0x1bf9db,_0xb7812f){return new BPromise(function(_0xb0ed0d,_0x33040f){return client[_0xeb1c('0xf')](_0xc6213f,_0xb7812f)[_0xeb1c('0x10')](function(_0x302585){logger[_0xeb1c('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0xeb1c('0x12'));logger[_0xeb1c('0x13')](_0xeb1c('0x14'),_0x1bf9db,_0xeb1c('0x12'),JSON[_0xeb1c('0x15')](_0x302585));if(_0x302585[_0xeb1c('0x16')]){if(_0x302585['error']['code']===0x1f4){logger[_0xeb1c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);return _0x33040f(_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);}logger[_0xeb1c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);return _0xb0ed0d(_0x302585[_0xeb1c('0x16')][_0xeb1c('0x17')]);}else{logger[_0xeb1c('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0xeb1c('0x12'));_0xb0ed0d(_0x302585['result']['message']);}})[_0xeb1c('0x18')](function(_0x592bfc){logger[_0xeb1c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1bf9db,_0x592bfc);_0x33040f(_0x592bfc);});});}exports[_0xeb1c('0x19')]=function(_0xb46b83){var _0x1c5492=this;return new Promise(function(_0x4e92b8,_0x2f0173){return db['VoiceQueue'][_0xeb1c('0x1a')]({'raw':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x1c')]===undefined?!![]:![]:!![],'where':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x1d')]||null:null,'attributes':_0xb46b83['options']?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x1e')]||null:null,'limit':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83['options'][_0xeb1c('0x1f')]||null:null,'include':_0xb46b83[_0xeb1c('0x1b')]?_0xb46b83[_0xeb1c('0x1b')][_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0xb46b83[_0xeb1c('0x1b')]['include'],function(_0x4d7937){return{'model':db[_0x4d7937[_0xeb1c('0x22')]],'as':_0x4d7937['as'],'attributes':_0x4d7937[_0xeb1c('0x1e')],'include':_0x4d7937[_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x4d7937['include'],function(_0x590b6){return{'model':db[_0x590b6['model']],'as':_0x590b6['as'],'attributes':_0x590b6['attributes'],'include':_0x590b6['include']?_[_0xeb1c('0x21')](_0x590b6[_0xeb1c('0x20')],function(_0xa0514e){return{'model':db[_0xa0514e['model']],'as':_0xa0514e['as'],'attributes':_0xa0514e['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb1c('0x10')](function(_0x16795f){logger[_0xeb1c('0x11')](_0xeb1c('0x19'),_0xb46b83);logger[_0xeb1c('0x13')]('GetVoiceQueue',_0xb46b83,JSON['stringify'](_0x16795f));_0x4e92b8(_0x16795f);})[_0xeb1c('0x18')](function(_0x1b09bd){logger[_0xeb1c('0x16')](_0xeb1c('0x19'),_0x1b09bd[_0xeb1c('0x17')],_0xb46b83);_0x2f0173(_0x1c5492[_0xeb1c('0x16')](0x1f4,_0x1b09bd[_0xeb1c('0x17')]));});});};exports[_0xeb1c('0x23')]=function(_0x4ce487){var _0xcf00a6=this;return new Promise(function(_0x360179,_0x1002c7){return db[_0xeb1c('0x24')][_0xeb1c('0x25')]({'raw':_0x4ce487['options']?_0x4ce487[_0xeb1c('0x1b')][_0xeb1c('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ce487[_0xeb1c('0x1b')]?_0x4ce487[_0xeb1c('0x1b')][_0xeb1c('0x1d')]||null:null,'attributes':_0x4ce487[_0xeb1c('0x1b')]?_0x4ce487[_0xeb1c('0x1b')]['attributes']||null:null,'include':_0x4ce487[_0xeb1c('0x1b')]?_0x4ce487['options'][_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x4ce487['options'][_0xeb1c('0x20')],function(_0x477957){return{'model':db[_0x477957[_0xeb1c('0x22')]],'as':_0x477957['as'],'attributes':_0x477957[_0xeb1c('0x1e')],'include':_0x477957[_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x477957['include'],function(_0x35b131){return{'model':db[_0x35b131[_0xeb1c('0x22')]],'as':_0x35b131['as'],'attributes':_0x35b131[_0xeb1c('0x1e')],'include':_0x35b131[_0xeb1c('0x20')]?_[_0xeb1c('0x21')](_0x35b131[_0xeb1c('0x20')],function(_0x235187){return{'model':db[_0x235187['model']],'as':_0x235187['as'],'attributes':_0x235187[_0xeb1c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcd5e77){logger[_0xeb1c('0x11')](_0xeb1c('0x23'),_0x4ce487);logger[_0xeb1c('0x13')](_0xeb1c('0x23'),_0x4ce487,JSON['stringify'](_0xcd5e77));_0x360179(_0xcd5e77);})[_0xeb1c('0x18')](function(_0x212439){logger[_0xeb1c('0x16')]('ShowVoiceQueue',_0x212439[_0xeb1c('0x17')],_0x4ce487);_0x1002c7(_0xcf00a6[_0xeb1c('0x16')](0x1f4,_0x212439[_0xeb1c('0x17')]));});});};
\ No newline at end of file
+var _0xc7a9=['map','catch','ShowVoiceQueue','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','model'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc7a9,0x152));var _0x9c7a=function(_0x521121,_0x4eda31){_0x521121=_0x521121-0x0;var _0x763777=_0xc7a9[_0x521121];return _0x763777;};'use strict';var _=require(_0x9c7a('0x0'));var util=require(_0x9c7a('0x1'));var moment=require(_0x9c7a('0x2'));var BPromise=require(_0x9c7a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c7a('0x4'));var db=require(_0x9c7a('0x5'))['db'];var utils=require(_0x9c7a('0x6'));var logger=require('../../config/logger')(_0x9c7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c7a('0x8'));var client=jayson[_0x9c7a('0x9')][_0x9c7a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9c7a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c7a('0xc'))(new Redis(config[_0x9c7a('0xb')]));require(_0x9c7a('0xd'))['register'](socket);function respondWithRpcPromise(_0x5e7164,_0x117727,_0x41caf5){return new BPromise(function(_0x2fb724,_0xe4328e){return client[_0x9c7a('0xe')](_0x5e7164,_0x41caf5)[_0x9c7a('0xf')](function(_0x1fe480){logger[_0x9c7a('0x10')](_0x9c7a('0x11'),_0x117727,_0x9c7a('0x12'));logger[_0x9c7a('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x117727,_0x9c7a('0x12'),JSON[_0x9c7a('0x14')](_0x1fe480));if(_0x1fe480[_0x9c7a('0x15')]){if(_0x1fe480[_0x9c7a('0x15')]['code']===0x1f4){logger[_0x9c7a('0x15')](_0x9c7a('0x11'),_0x117727,_0x1fe480[_0x9c7a('0x15')][_0x9c7a('0x16')]);return _0xe4328e(_0x1fe480[_0x9c7a('0x15')][_0x9c7a('0x16')]);}logger['error'](_0x9c7a('0x11'),_0x117727,_0x1fe480[_0x9c7a('0x15')]['message']);return _0x2fb724(_0x1fe480[_0x9c7a('0x15')][_0x9c7a('0x16')]);}else{logger[_0x9c7a('0x10')](_0x9c7a('0x11'),_0x117727,_0x9c7a('0x12'));_0x2fb724(_0x1fe480['result'][_0x9c7a('0x16')]);}})['catch'](function(_0x17cedf){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x117727,_0x17cedf);_0xe4328e(_0x17cedf);});});}exports[_0x9c7a('0x17')]=function(_0x315dcb){var _0x12110e=this;return new Promise(function(_0x5394d3,_0x4b4e8e){return db[_0x9c7a('0x18')][_0x9c7a('0x19')]({'raw':_0x315dcb[_0x9c7a('0x1a')]?_0x315dcb[_0x9c7a('0x1a')][_0x9c7a('0x1b')]===undefined?!![]:![]:!![],'where':_0x315dcb['options']?_0x315dcb[_0x9c7a('0x1a')]['where']||null:null,'attributes':_0x315dcb['options']?_0x315dcb[_0x9c7a('0x1a')][_0x9c7a('0x1c')]||null:null,'limit':_0x315dcb['options']?_0x315dcb['options'][_0x9c7a('0x1d')]||null:null,'include':_0x315dcb['options']?_0x315dcb[_0x9c7a('0x1a')]['include']?_['map'](_0x315dcb[_0x9c7a('0x1a')][_0x9c7a('0x1e')],function(_0x474959){return{'model':db[_0x474959[_0x9c7a('0x1f')]],'as':_0x474959['as'],'attributes':_0x474959['attributes'],'include':_0x474959['include']?_['map'](_0x474959[_0x9c7a('0x1e')],function(_0x5145be){return{'model':db[_0x5145be[_0x9c7a('0x1f')]],'as':_0x5145be['as'],'attributes':_0x5145be[_0x9c7a('0x1c')],'include':_0x5145be['include']?_[_0x9c7a('0x20')](_0x5145be[_0x9c7a('0x1e')],function(_0x2451f0){return{'model':db[_0x2451f0['model']],'as':_0x2451f0['as'],'attributes':_0x2451f0[_0x9c7a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2276c1){logger[_0x9c7a('0x10')](_0x9c7a('0x17'),_0x315dcb);logger[_0x9c7a('0x13')](_0x9c7a('0x17'),_0x315dcb,JSON[_0x9c7a('0x14')](_0x2276c1));_0x5394d3(_0x2276c1);})[_0x9c7a('0x21')](function(_0x2cdc33){logger[_0x9c7a('0x15')](_0x9c7a('0x17'),_0x2cdc33[_0x9c7a('0x16')],_0x315dcb);_0x4b4e8e(_0x12110e[_0x9c7a('0x15')](0x1f4,_0x2cdc33[_0x9c7a('0x16')]));});});};exports[_0x9c7a('0x22')]=function(_0x4b62a5){var _0x1cd052=this;return new Promise(function(_0x3c59b9,_0x27af1e){return db[_0x9c7a('0x18')][_0x9c7a('0x23')]({'raw':_0x4b62a5[_0x9c7a('0x1a')]?_0x4b62a5['options'][_0x9c7a('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b62a5[_0x9c7a('0x1a')]?_0x4b62a5[_0x9c7a('0x1a')][_0x9c7a('0x24')]||null:null,'attributes':_0x4b62a5[_0x9c7a('0x1a')]?_0x4b62a5[_0x9c7a('0x1a')][_0x9c7a('0x1c')]||null:null,'include':_0x4b62a5[_0x9c7a('0x1a')]?_0x4b62a5[_0x9c7a('0x1a')][_0x9c7a('0x1e')]?_['map'](_0x4b62a5[_0x9c7a('0x1a')]['include'],function(_0x1e1e9d){return{'model':db[_0x1e1e9d['model']],'as':_0x1e1e9d['as'],'attributes':_0x1e1e9d[_0x9c7a('0x1c')],'include':_0x1e1e9d[_0x9c7a('0x1e')]?_['map'](_0x1e1e9d['include'],function(_0x2dc49c){return{'model':db[_0x2dc49c['model']],'as':_0x2dc49c['as'],'attributes':_0x2dc49c['attributes'],'include':_0x2dc49c['include']?_[_0x9c7a('0x20')](_0x2dc49c[_0x9c7a('0x1e')],function(_0x524f63){return{'model':db[_0x524f63[_0x9c7a('0x1f')]],'as':_0x524f63['as'],'attributes':_0x524f63[_0x9c7a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9c7a('0xf')](function(_0x127883){logger['info'](_0x9c7a('0x22'),_0x4b62a5);logger[_0x9c7a('0x13')](_0x9c7a('0x22'),_0x4b62a5,JSON['stringify'](_0x127883));_0x3c59b9(_0x127883);})[_0x9c7a('0x21')](function(_0x4fe4c5){logger[_0x9c7a('0x15')]('ShowVoiceQueue',_0x4fe4c5[_0x9c7a('0x16')],_0x4b62a5);_0x27af1e(_0x1cd052[_0x9c7a('0x15')](0x1f4,_0x4fe4c5[_0x9c7a('0x16')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d6b=['voiceQueue:','save','remove','update','removeListener','register','length'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x2d6b,0x7f));var _0xb2d6=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x2d6b[_0x5f1391];return _0x50ebe3;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb2d6('0x0'),_0xb2d6('0x1'),_0xb2d6('0x2')];function createListener(_0x429031,_0x4c9e4f){return function(_0x11c17d){_0x4c9e4f['emit'](_0x429031,_0x11c17d);};}function removeListener(_0xc8c84c,_0xa2a3ff){return function(){VoiceQueueEvents[_0xb2d6('0x3')](_0xc8c84c,_0xa2a3ff);};}exports[_0xb2d6('0x4')]=function(_0x30efd3){for(var _0x86759d=0x0,_0x305136=events[_0xb2d6('0x5')];_0x86759d<_0x305136;_0x86759d++){var _0x465c91=events[_0x86759d];var _0x396e1c=createListener(_0xb2d6('0x6')+_0x465c91,_0x30efd3);VoiceQueueEvents['on'](_0x465c91,_0x396e1c);}};
\ No newline at end of file
+var _0xbabe=['save','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0xbabe,0xee));var _0xebab=function(_0x986838,_0x37527a){_0x986838=_0x986838-0x0;var _0x200e27=_0xbabe[_0x986838];return _0x200e27;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xebab('0x0'),_0xebab('0x1'),'update'];function createListener(_0x12c936,_0x3f061e){return function(_0x1d0755){_0x3f061e[_0xebab('0x2')](_0x12c936,_0x1d0755);};}function removeListener(_0x142153,_0x33db09){return function(){VoiceQueueEvents[_0xebab('0x3')](_0x142153,_0x33db09);};}exports[_0xebab('0x4')]=function(_0x42d15a){for(var _0x8ba237=0x0,_0x39fe36=events[_0xebab('0x5')];_0x8ba237<_0x39fe36;_0x8ba237++){var _0x14635c=events[_0x8ba237];var _0x581508=createListener(_0xebab('0x6')+_0x14635c,_0x42d15a);VoiceQueueEvents['on'](_0x14635c,_0x581508);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cf6=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','create','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x47917a,_0x44e8bf){_0x47917a=_0x47917a-0x0;var _0x197de5=_0x1cf6[_0x47917a];return _0x197de5;};'use strict';var multer=require('multer');var util=require(_0x61cf('0x0'));var path=require(_0x61cf('0x1'));var timeout=require(_0x61cf('0x2'));var express=require(_0x61cf('0x3'));var router=express[_0x61cf('0x4')]();var fs_extra=require(_0x61cf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x61cf('0x6'));var config=require(_0x61cf('0x7'));var controller=require(_0x61cf('0x8'));router[_0x61cf('0x9')]('/',auth[_0x61cf('0xa')](),controller[_0x61cf('0xb')]);router[_0x61cf('0x9')](_0x61cf('0xc'),auth[_0x61cf('0xa')](),controller[_0x61cf('0xd')]);router[_0x61cf('0x9')](_0x61cf('0xe'),auth[_0x61cf('0xa')](),controller[_0x61cf('0xf')]);router[_0x61cf('0x9')](_0x61cf('0x10'),auth['isAuthenticated'](),controller[_0x61cf('0x11')]);router['post']('/',auth[_0x61cf('0xa')](),controller[_0x61cf('0x12')]);router['put'](_0x61cf('0x10'),auth[_0x61cf('0xa')](),controller[_0x61cf('0x13')]);router[_0x61cf('0x14')](_0x61cf('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x61cf('0x15')]=router;
\ No newline at end of file
+var _0x5a2f=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','describe','/index','getVoiceQueuesReport','/:id','isAuthenticated','show','post'];(function(_0x5a9d15,_0x23d58f){var _0x15cb4d=function(_0x30e248){while(--_0x30e248){_0x5a9d15['push'](_0x5a9d15['shift']());}};_0x15cb4d(++_0x23d58f);}(_0x5a2f,0xea));var _0xf5a2=function(_0x4fc2a4,_0x3f3d7f){_0x4fc2a4=_0x4fc2a4-0x0;var _0x3613ba=_0x5a2f[_0x4fc2a4];return _0x3613ba;};'use strict';var multer=require(_0xf5a2('0x0'));var util=require(_0xf5a2('0x1'));var path=require(_0xf5a2('0x2'));var timeout=require(_0xf5a2('0x3'));var express=require(_0xf5a2('0x4'));var router=express[_0xf5a2('0x5')]();var fs_extra=require(_0xf5a2('0x6'));var auth=require(_0xf5a2('0x7'));var interaction=require(_0xf5a2('0x8'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xf5a2('0x9')]('/',auth['isAuthenticated'](),controller[_0xf5a2('0xa')]);router[_0xf5a2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xf5a2('0xb')]);router[_0xf5a2('0x9')](_0xf5a2('0xc'),auth['isAuthenticated'](),controller[_0xf5a2('0xd')]);router[_0xf5a2('0x9')](_0xf5a2('0xe'),auth[_0xf5a2('0xf')](),controller[_0xf5a2('0x10')]);router[_0xf5a2('0x11')]('/',auth[_0xf5a2('0xf')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf5a2('0x12')]);router['delete'](_0xf5a2('0xe'),auth[_0xf5a2('0xf')](),controller[_0xf5a2('0x13')]);module[_0xf5a2('0x14')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52db=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue'];(function(_0x176f30,_0x353f9b){var _0x1236bc=function(_0x33c9e4){while(--_0x33c9e4){_0x176f30['push'](_0x176f30['shift']());}};_0x1236bc(++_0x353f9b);}(_0x52db,0x7b));var _0xb52d=function(_0xef6c6a,_0x2f7369){_0xef6c6a=_0xef6c6a-0x0;var _0x4bdc83=_0x52db[_0xef6c6a];return _0x4bdc83;};'use strict';var Sequelize=require(_0xb52d('0x0'));var moment=require(_0xb52d('0x1'));module[_0xb52d('0x2')]={'type':{'type':Sequelize[_0xb52d('0x3')]},'uniqueid':{'type':Sequelize[_0xb52d('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xb52d('0x4')],'set':function(_0x17d0a1){var _0x378af=moment(_0x17d0a1);var _0x1b3a3f=moment(this[_0xb52d('0x5')](_0xb52d('0x6')))[_0xb52d('0x7')](_0xb52d('0x8'));var _0x2493e3=_0x378af[_0xb52d('0x9')](_0x1b3a3f,_0xb52d('0xa'));this['setDataValue'](_0xb52d('0xb'),_0x17d0a1);this[_0xb52d('0xc')](_0xb52d('0xd'),_0x2493e3||null);}},'position':{'type':Sequelize[_0xb52d('0xe')]},'count':{'type':Sequelize[_0xb52d('0xe')]},'queuecallerabandon':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb52d('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb52d('0x4')]},'queuecallerexit':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb52d('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xb52d('0x10')},'originalposition':{'type':Sequelize[_0xb52d('0xe')]},'channel':{'type':Sequelize[_0xb52d('0x3')]},'connectedlinenum':{'type':Sequelize[_0xb52d('0x3')]},'connectedlinename':{'type':Sequelize[_0xb52d('0x3')]},'accountcode':{'type':Sequelize[_0xb52d('0x3')]},'context':{'type':Sequelize[_0xb52d('0x3')]},'exten':{'type':Sequelize[_0xb52d('0x3')]},'priority':{'type':Sequelize[_0xb52d('0x3')]},'holdtime':{'type':Sequelize[_0xb52d('0xe')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb52d('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb52d('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xb52d('0x3')]},'transferuniqueid':{'type':Sequelize[_0xb52d('0x3')]},'disposition':{'type':Sequelize[_0xb52d('0x3')]},'secondDisposition':{'type':Sequelize[_0xb52d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb52d('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xb52d('0xe')],'defaultValue':0x0},'note':{'type':Sequelize[_0xb52d('0x3')]}};
\ No newline at end of file
+var _0xa24a=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','setDataValue'];(function(_0x1ceb7b,_0x894d3d){var _0x57c016=function(_0x282306){while(--_0x282306){_0x1ceb7b['push'](_0x1ceb7b['shift']());}};_0x57c016(++_0x894d3d);}(_0xa24a,0x1cc));var _0xaa24=function(_0x58e147,_0xc65185){_0x58e147=_0x58e147-0x0;var _0x5ad2f7=_0xa24a[_0x58e147];return _0x5ad2f7;};'use strict';var Sequelize=require(_0xaa24('0x0'));var moment=require(_0xaa24('0x1'));module['exports']={'type':{'type':Sequelize[_0xaa24('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaa24('0x2')]},'calleridname':{'type':Sequelize[_0xaa24('0x2')]},'queue':{'type':Sequelize[_0xaa24('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xaa24('0x3')],'set':function(_0x10adf7){var _0x2b7f2e=moment(_0x10adf7);var _0x34542d=moment(this[_0xaa24('0x4')](_0xaa24('0x5')))['format'](_0xaa24('0x6'));var _0x4d1508=_0x2b7f2e['diff'](_0x34542d,'seconds');this[_0xaa24('0x7')](_0xaa24('0x8'),_0x10adf7);this[_0xaa24('0x7')](_0xaa24('0x9'),_0x4d1508||null);}},'position':{'type':Sequelize[_0xaa24('0xa')]},'count':{'type':Sequelize[_0xaa24('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xaa24('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xaa24('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaa24('0x3')]},'queuecallerexit':{'type':Sequelize[_0xaa24('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xaa24('0x2')],'comment':_0xaa24('0xc')},'originalposition':{'type':Sequelize[_0xaa24('0xa')]},'channel':{'type':Sequelize[_0xaa24('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa24('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa24('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa24('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xaa24('0x2')]},'holdtime':{'type':Sequelize[_0xaa24('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xaa24('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaa24('0x2')]},'disposition':{'type':Sequelize[_0xaa24('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaa24('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xaa24('0xa')],'defaultValue':0x0},'note':{'type':Sequelize[_0xaa24('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f71=['sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','rawAttributes','create','body','find','destroy','describe','order','options','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','VoiceQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit'];(function(_0xfd166a,_0x2b982b){var _0x37d4d1=function(_0x90c6ca){while(--_0x90c6ca){_0xfd166a['push'](_0xfd166a['shift']());}};_0x37d4d1(++_0x2b982b);}(_0x5f71,0x1bd));var _0x15f7=function(_0x856d6f,_0x23ed79){_0x856d6f=_0x856d6f-0x0;var _0x149de0=_0x5f71[_0x856d6f];return _0x149de0;};'use strict';var emlformat=require(_0x15f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15f7('0x1'));var jsonpatch=require(_0x15f7('0x2'));var rp=require(_0x15f7('0x3'));var moment=require(_0x15f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15f7('0x5'));var util=require(_0x15f7('0x6'));var path=require('path');var sox=require(_0x15f7('0x7'));var csv=require('to-csv');var ejs=require(_0x15f7('0x8'));var fs=require('fs');var fs_extra=require(_0x15f7('0x9'));var _=require(_0x15f7('0xa'));var squel=require(_0x15f7('0xb'));var crypto=require(_0x15f7('0xc'));var jsforce=require(_0x15f7('0xd'));var deskjs=require(_0x15f7('0xe'));var toCsv=require(_0x15f7('0xf'));var querystring=require(_0x15f7('0x10'));var Papa=require(_0x15f7('0x11'));var Redis=require(_0x15f7('0x12'));var authService=require(_0x15f7('0x13'));var qs=require(_0x15f7('0x14'));var as=require(_0x15f7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15f7('0x16'))(_0x15f7('0x17'));var utils=require(_0x15f7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x15f7('0x19'));var db=require(_0x15f7('0x1a'))['db'];config[_0x15f7('0x1b')]=_[_0x15f7('0x1c')](config['redis'],{'host':_0x15f7('0x1d'),'port':0x18eb});var socket=require(_0x15f7('0x1e'))(new Redis(config[_0x15f7('0x1b')]));require('./voiceQueueReport.socket')[_0x15f7('0x1f')](socket);function respondWithStatusCode(_0x467866,_0x4a4248){_0x4a4248=_0x4a4248||0xcc;return function(_0x30a40a){if(_0x30a40a){return _0x467866[_0x15f7('0x20')](_0x4a4248);}return _0x467866[_0x15f7('0x21')](_0x4a4248)[_0x15f7('0x22')]();};}function respondWithResult(_0x139387,_0x2ffaed){_0x2ffaed=_0x2ffaed||0xc8;return function(_0x15feff){if(_0x15feff){return _0x139387[_0x15f7('0x21')](_0x2ffaed)[_0x15f7('0x23')](_0x15feff);}};}function respondWithFilteredResult(_0x3ebd58,_0x273851){return function(_0x2b5112){if(_0x2b5112){var _0x208948=typeof _0x273851[_0x15f7('0x24')]===_0x15f7('0x25')&&typeof _0x273851[_0x15f7('0x26')]===_0x15f7('0x25');var _0x39d6ca=_0x2b5112[_0x15f7('0x27')];var _0x3335f0=_0x208948?0x0:_0x273851['offset'];var _0x34dbd5=_0x208948?_0x2b5112[_0x15f7('0x27')]:_0x273851['offset']+_0x273851[_0x15f7('0x26')];var _0x2350cb;if(_0x34dbd5>=_0x39d6ca){_0x34dbd5=_0x39d6ca;_0x2350cb=0xc8;}else{_0x2350cb=0xce;}_0x3ebd58[_0x15f7('0x21')](_0x2350cb);return _0x3ebd58[_0x15f7('0x28')](_0x15f7('0x29'),_0x3335f0+'-'+_0x34dbd5+'/'+_0x39d6ca)[_0x15f7('0x23')](_0x2b5112);}return null;};}function patchUpdates(_0x5c60a2){return function(_0x52d49f){try{jsonpatch[_0x15f7('0x2a')](_0x52d49f,_0x5c60a2,!![]);}catch(_0x1739b0){return BPromise[_0x15f7('0x2b')](_0x1739b0);}return _0x52d49f['save']();};}function saveUpdates(_0x46346e,_0x37159c){return function(_0x26cb05){if(_0x26cb05){return _0x26cb05[_0x15f7('0x2c')](_0x46346e)[_0x15f7('0x2d')](function(_0x118889){return _0x118889;});}return null;};}function removeEntity(_0x44a61c,_0x509d3c){return function(_0x304573){if(_0x304573){return _0x304573['destroy']()['then'](function(){_0x44a61c['status'](0xcc)[_0x15f7('0x22')]();});}};}function handleEntityNotFound(_0x52bdc8,_0x44357f){return function(_0x13aa75){if(!_0x13aa75){_0x52bdc8[_0x15f7('0x20')](0x194);}return _0x13aa75;};}function handleError(_0x5db40b,_0x181fca){_0x181fca=_0x181fca||0x1f4;return function(_0x326b86){logger[_0x15f7('0x2e')](_0x326b86['stack']);if(_0x326b86[_0x15f7('0x2f')]){delete _0x326b86[_0x15f7('0x2f')];}_0x5db40b['status'](_0x181fca)[_0x15f7('0x30')](_0x326b86);};}exports[_0x15f7('0x31')]=function(_0x44b505,_0x4eb8b4){var _0x56c34d={},_0x175cb4={},_0x5844c4={'count':0x0,'rows':[]};var _0x17138f=_[_0x15f7('0x32')](db[_0x15f7('0x33')]['rawAttributes'],function(_0x568517){return{'name':_0x568517[_0x15f7('0x34')],'type':_0x568517[_0x15f7('0x35')][_0x15f7('0x36')]};});_0x175cb4['model']=_[_0x15f7('0x32')](_0x17138f,_0x15f7('0x2f'));_0x175cb4[_0x15f7('0x37')]=_[_0x15f7('0x38')](_0x44b505[_0x15f7('0x37')]);_0x175cb4[_0x15f7('0x39')]=_[_0x15f7('0x3a')](_0x175cb4['model'],_0x175cb4[_0x15f7('0x37')]);_0x56c34d['attributes']=_['intersection'](_0x175cb4[_0x15f7('0x3b')],qs[_0x15f7('0x3c')](_0x44b505[_0x15f7('0x37')][_0x15f7('0x3c')]));_0x56c34d['attributes']=_0x56c34d['attributes'][_0x15f7('0x3d')]?_0x56c34d[_0x15f7('0x3e')]:_0x175cb4[_0x15f7('0x3b')];if(!_0x44b505[_0x15f7('0x37')][_0x15f7('0x3f')](_0x15f7('0x40'))){_0x56c34d[_0x15f7('0x26')]=qs[_0x15f7('0x26')](_0x44b505[_0x15f7('0x37')][_0x15f7('0x26')]);_0x56c34d[_0x15f7('0x24')]=qs[_0x15f7('0x24')](_0x44b505[_0x15f7('0x37')]['offset']);}_0x56c34d['order']=qs[_0x15f7('0x41')](_0x44b505[_0x15f7('0x37')][_0x15f7('0x41')]);_0x56c34d[_0x15f7('0x42')]=qs[_0x15f7('0x39')](_[_0x15f7('0x43')](_0x44b505[_0x15f7('0x37')],_0x175cb4['filters']),_0x17138f);if(_0x44b505[_0x15f7('0x37')][_0x15f7('0x44')]){_0x56c34d['where']=_[_0x15f7('0x45')](_0x56c34d[_0x15f7('0x42')],{'$or':_[_0x15f7('0x32')](_0x17138f,function(_0x326b2a){if(_0x326b2a['type']!==_0x15f7('0x46')){var _0x3a9f65={};_0x3a9f65[_0x326b2a['name']]={'$like':'%'+_0x44b505['query'][_0x15f7('0x44')]+'%'};return _0x3a9f65;}})});}_0x56c34d=_['merge']({},_0x56c34d,_0x44b505['options']);var _0x2be213={'where':_0x56c34d['where']};return db[_0x15f7('0x33')]['count'](_0x2be213)[_0x15f7('0x2d')](function(_0x14a5ef){_0x5844c4[_0x15f7('0x27')]=_0x14a5ef;if(_0x44b505[_0x15f7('0x37')][_0x15f7('0x47')]){_0x56c34d[_0x15f7('0x48')]=[{'all':!![]}];}return db[_0x15f7('0x33')][_0x15f7('0x49')](_0x56c34d);})[_0x15f7('0x2d')](function(_0x3033dc){_0x5844c4['rows']=_0x3033dc;return _0x5844c4;})['then'](respondWithFilteredResult(_0x4eb8b4,_0x56c34d))[_0x15f7('0x4a')](handleError(_0x4eb8b4,null));};exports[_0x15f7('0x4b')]=function(_0x308936,_0x530097){var _0x1a7514={'raw':![],'where':{'id':_0x308936['params']['id']}},_0x4b23bf={};_0x4b23bf[_0x15f7('0x3b')]=_['keys'](db[_0x15f7('0x33')][_0x15f7('0x4c')]);_0x4b23bf[_0x15f7('0x37')]=_[_0x15f7('0x38')](_0x308936[_0x15f7('0x37')]);_0x4b23bf[_0x15f7('0x39')]=_['intersection'](_0x4b23bf['model'],_0x4b23bf['query']);_0x1a7514[_0x15f7('0x3e')]=_['intersection'](_0x4b23bf['model'],qs['fields'](_0x308936[_0x15f7('0x37')][_0x15f7('0x3c')]));_0x1a7514[_0x15f7('0x3e')]=_0x1a7514[_0x15f7('0x3e')][_0x15f7('0x3d')]?_0x1a7514[_0x15f7('0x3e')]:_0x4b23bf[_0x15f7('0x3b')];if(_0x308936['query'][_0x15f7('0x47')]){_0x1a7514[_0x15f7('0x48')]=[{'all':!![]}];}_0x1a7514=_['merge']({},_0x1a7514,_0x308936['options']);return db[_0x15f7('0x33')]['find'](_0x1a7514)[_0x15f7('0x2d')](handleEntityNotFound(_0x530097,null))[_0x15f7('0x2d')](respondWithResult(_0x530097,null))[_0x15f7('0x4a')](handleError(_0x530097,null));};exports[_0x15f7('0x4d')]=function(_0x1bf8b5,_0x3888f2){return db[_0x15f7('0x33')]['create'](_0x1bf8b5['body'],{})[_0x15f7('0x2d')](respondWithResult(_0x3888f2,0xc9))[_0x15f7('0x4a')](handleError(_0x3888f2,null));};exports[_0x15f7('0x2c')]=function(_0xe963d2,_0x32b338){if(_0xe963d2['body']['id']){delete _0xe963d2[_0x15f7('0x4e')]['id'];}return db['VoiceQueueReport'][_0x15f7('0x4f')]({'where':{'id':_0xe963d2['params']['id']}})[_0x15f7('0x2d')](handleEntityNotFound(_0x32b338,null))[_0x15f7('0x2d')](saveUpdates(_0xe963d2['body'],null))[_0x15f7('0x2d')](respondWithResult(_0x32b338,null))['catch'](handleError(_0x32b338,null));};exports[_0x15f7('0x50')]=function(_0x5721ec,_0x5b10d1){return db[_0x15f7('0x33')][_0x15f7('0x4f')]({'where':{'id':_0x5721ec['params']['id']}})[_0x15f7('0x2d')](handleEntityNotFound(_0x5b10d1,null))[_0x15f7('0x2d')](removeEntity(_0x5b10d1,null))[_0x15f7('0x4a')](handleError(_0x5b10d1,null));};exports['describe']=function(_0x3133d0,_0x48d718){return db[_0x15f7('0x33')][_0x15f7('0x51')]()[_0x15f7('0x2d')](respondWithResult(_0x48d718,null))[_0x15f7('0x4a')](handleError(_0x48d718,null));};exports['getVoiceQueuesReport']=function(_0x27ab9a,_0xf09542){var _0x421477={},_0x56392f={},_0x427550={'count':0x0,'rows':[]};_0x56392f[_0x15f7('0x3b')]=_[_0x15f7('0x38')](db[_0x15f7('0x33')][_0x15f7('0x4c')]);_0x56392f[_0x15f7('0x37')]=_['keys'](_0x27ab9a['query']);_0x56392f[_0x15f7('0x39')]=_[_0x15f7('0x3a')](_0x56392f[_0x15f7('0x3b')],_0x56392f['query']);_0x421477[_0x15f7('0x3e')]=_[_0x15f7('0x3a')](_0x56392f['model'],qs['fields'](_0x27ab9a['query']['fields']));_0x421477[_0x15f7('0x3e')]=_0x421477[_0x15f7('0x3e')][_0x15f7('0x3d')]?_0x421477[_0x15f7('0x3e')]:_0x56392f[_0x15f7('0x3b')];if(!_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x3f')](_0x15f7('0x40'))){_0x421477[_0x15f7('0x26')]=qs[_0x15f7('0x26')](_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x26')]);_0x421477['offset']=qs[_0x15f7('0x24')](_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x24')]);}_0x421477[_0x15f7('0x52')]=qs[_0x15f7('0x41')](_0x27ab9a[_0x15f7('0x37')][_0x15f7('0x41')]);_0x421477[_0x15f7('0x42')]=qs['filters'](_[_0x15f7('0x43')](_0x27ab9a[_0x15f7('0x37')],_0x56392f[_0x15f7('0x39')]));if(_0x27ab9a[_0x15f7('0x37')]['filter']){_0x421477[_0x15f7('0x42')]=_[_0x15f7('0x45')](_0x421477['where'],{'$or':_['map'](_0x421477[_0x15f7('0x3e')],function(_0x521865){var _0xe38734={};_0xe38734[_0x521865]={'$like':'%'+_0x27ab9a[_0x15f7('0x37')]['filter']+'%'};return _0xe38734;})});}_0x421477=_['merge']({},_0x421477,_0x27ab9a[_0x15f7('0x53')]);var _0x38286e={'where':_0x421477[_0x15f7('0x42')]};return db[_0x15f7('0x33')]['count'](_0x38286e)['then'](function(_0x28f2b4){_0x427550[_0x15f7('0x27')]=_0x28f2b4;if(_0x27ab9a[_0x15f7('0x37')]['includeAll']){_0x421477[_0x15f7('0x48')]=[{'all':!![]}];}return db[_0x15f7('0x33')][_0x15f7('0x49')](_0x421477);})['then'](function(_0x4c19c3){_0x427550['rows']=_0x4c19c3;return _0x427550;})['then'](respondWithFilteredResult(_0xf09542,_0x421477,'getVoiceQueuesReport'))[_0x15f7('0x4a')](handleError(_0xf09542,null,_0x15f7('0x54')));};
\ No newline at end of file
+var _0xd8e1=['name','send','index','map','type','key','model','query','keys','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','filter','merge','options','VoiceQueueReport','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','find','body','describe','nolimit','rows','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./voiceQueueReport.socket','register','status','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x1819cf,_0x2840e4){var _0x3543fc=function(_0x3c525d){while(--_0x3c525d){_0x1819cf['push'](_0x1819cf['shift']());}};_0x3543fc(++_0x2840e4);}(_0xd8e1,0x167));var _0x1d8e=function(_0x5c977d,_0x178322){_0x5c977d=_0x5c977d-0x0;var _0x48e5df=_0xd8e1[_0x5c977d];return _0x48e5df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d8e('0x0'));var zipdir=require(_0x1d8e('0x1'));var jsonpatch=require(_0x1d8e('0x2'));var rp=require(_0x1d8e('0x3'));var moment=require(_0x1d8e('0x4'));var BPromise=require(_0x1d8e('0x5'));var Mustache=require(_0x1d8e('0x6'));var util=require(_0x1d8e('0x7'));var path=require(_0x1d8e('0x8'));var sox=require(_0x1d8e('0x9'));var csv=require(_0x1d8e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d8e('0xb'));var squel=require(_0x1d8e('0xc'));var crypto=require(_0x1d8e('0xd'));var jsforce=require(_0x1d8e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1d8e('0xa'));var querystring=require(_0x1d8e('0xf'));var Papa=require('papaparse');var Redis=require(_0x1d8e('0x10'));var authService=require(_0x1d8e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1d8e('0x12'));var hardwareService=require(_0x1d8e('0x13'));var logger=require(_0x1d8e('0x14'))(_0x1d8e('0x15'));var utils=require(_0x1d8e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1d8e('0x17'));var db=require(_0x1d8e('0x18'))['db'];config['redis']=_[_0x1d8e('0x19')](config['redis'],{'host':_0x1d8e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d8e('0x1b')]));require(_0x1d8e('0x1c'))[_0x1d8e('0x1d')](socket);function respondWithStatusCode(_0x394c41,_0x5bce32){_0x5bce32=_0x5bce32||0xcc;return function(_0x1aef4f){if(_0x1aef4f){return _0x394c41['sendStatus'](_0x5bce32);}return _0x394c41[_0x1d8e('0x1e')](_0x5bce32)['end']();};}function respondWithResult(_0x54b4c8,_0x2d638f){_0x2d638f=_0x2d638f||0xc8;return function(_0x3118a6){if(_0x3118a6){return _0x54b4c8[_0x1d8e('0x1e')](_0x2d638f)['json'](_0x3118a6);}};}function respondWithFilteredResult(_0x2412bf,_0xe64b6b){return function(_0x2a80a6){if(_0x2a80a6){var _0x15bc54=typeof _0xe64b6b['offset']===_0x1d8e('0x1f')&&typeof _0xe64b6b['limit']===_0x1d8e('0x1f');var _0x355e5f=_0x2a80a6[_0x1d8e('0x20')];var _0x3afe13=_0x15bc54?0x0:_0xe64b6b[_0x1d8e('0x21')];var _0x23d353=_0x15bc54?_0x2a80a6['count']:_0xe64b6b['offset']+_0xe64b6b['limit'];var _0x4f3adf;if(_0x23d353>=_0x355e5f){_0x23d353=_0x355e5f;_0x4f3adf=0xc8;}else{_0x4f3adf=0xce;}_0x2412bf[_0x1d8e('0x1e')](_0x4f3adf);return _0x2412bf[_0x1d8e('0x22')](_0x1d8e('0x23'),_0x3afe13+'-'+_0x23d353+'/'+_0x355e5f)['json'](_0x2a80a6);}return null;};}function patchUpdates(_0x547274){return function(_0x5b93dc){try{jsonpatch[_0x1d8e('0x24')](_0x5b93dc,_0x547274,!![]);}catch(_0x5b67d6){return BPromise[_0x1d8e('0x25')](_0x5b67d6);}return _0x5b93dc[_0x1d8e('0x26')]();};}function saveUpdates(_0x54ea53,_0x5cc4b3){return function(_0x264338){if(_0x264338){return _0x264338[_0x1d8e('0x27')](_0x54ea53)[_0x1d8e('0x28')](function(_0x1bd60c){return _0x1bd60c;});}return null;};}function removeEntity(_0x30ff48,_0x570842){return function(_0x40d288){if(_0x40d288){return _0x40d288[_0x1d8e('0x29')]()[_0x1d8e('0x28')](function(){_0x30ff48[_0x1d8e('0x1e')](0xcc)[_0x1d8e('0x2a')]();});}};}function handleEntityNotFound(_0x7e3bd4,_0x1c98b6){return function(_0x50515d){if(!_0x50515d){_0x7e3bd4[_0x1d8e('0x2b')](0x194);}return _0x50515d;};}function handleError(_0x55b381,_0x5cb6d2){_0x5cb6d2=_0x5cb6d2||0x1f4;return function(_0xa8c529){logger[_0x1d8e('0x2c')](_0xa8c529[_0x1d8e('0x2d')]);if(_0xa8c529[_0x1d8e('0x2e')]){delete _0xa8c529['name'];}_0x55b381['status'](_0x5cb6d2)[_0x1d8e('0x2f')](_0xa8c529);};}exports[_0x1d8e('0x30')]=function(_0x48a55e,_0x9d35ac){var _0x53a9e0={},_0x598d5e={},_0x2be8c9={'count':0x0,'rows':[]};var _0x56fcae=_[_0x1d8e('0x31')](db['VoiceQueueReport']['rawAttributes'],function(_0x5aed8f){return{'name':_0x5aed8f['fieldName'],'type':_0x5aed8f[_0x1d8e('0x32')][_0x1d8e('0x33')]};});_0x598d5e[_0x1d8e('0x34')]=_[_0x1d8e('0x31')](_0x56fcae,_0x1d8e('0x2e'));_0x598d5e[_0x1d8e('0x35')]=_[_0x1d8e('0x36')](_0x48a55e[_0x1d8e('0x35')]);_0x598d5e['filters']=_['intersection'](_0x598d5e[_0x1d8e('0x34')],_0x598d5e[_0x1d8e('0x35')]);_0x53a9e0[_0x1d8e('0x37')]=_['intersection'](_0x598d5e[_0x1d8e('0x34')],qs[_0x1d8e('0x38')](_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x38')]));_0x53a9e0['attributes']=_0x53a9e0[_0x1d8e('0x37')]['length']?_0x53a9e0[_0x1d8e('0x37')]:_0x598d5e[_0x1d8e('0x34')];if(!_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x39')]('nolimit')){_0x53a9e0[_0x1d8e('0x3a')]=qs[_0x1d8e('0x3a')](_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x3a')]);_0x53a9e0[_0x1d8e('0x21')]=qs[_0x1d8e('0x21')](_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x21')]);}_0x53a9e0[_0x1d8e('0x3b')]=qs[_0x1d8e('0x3c')](_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x3c')]);_0x53a9e0[_0x1d8e('0x3d')]=qs[_0x1d8e('0x3e')](_['pick'](_0x48a55e[_0x1d8e('0x35')],_0x598d5e[_0x1d8e('0x3e')]),_0x56fcae);if(_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x3f')]){_0x53a9e0['where']=_[_0x1d8e('0x40')](_0x53a9e0[_0x1d8e('0x3d')],{'$or':_['map'](_0x56fcae,function(_0x2a8360){if(_0x2a8360['type']!=='VIRTUAL'){var _0x21c3c6={};_0x21c3c6[_0x2a8360[_0x1d8e('0x2e')]]={'$like':'%'+_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x3f')]+'%'};return _0x21c3c6;}})});}_0x53a9e0=_[_0x1d8e('0x40')]({},_0x53a9e0,_0x48a55e[_0x1d8e('0x41')]);var _0x285732={'where':_0x53a9e0[_0x1d8e('0x3d')]};return db[_0x1d8e('0x42')][_0x1d8e('0x20')](_0x285732)['then'](function(_0x380901){_0x2be8c9[_0x1d8e('0x20')]=_0x380901;if(_0x48a55e[_0x1d8e('0x35')][_0x1d8e('0x43')]){_0x53a9e0[_0x1d8e('0x44')]=[{'all':!![]}];}return db[_0x1d8e('0x42')][_0x1d8e('0x45')](_0x53a9e0);})[_0x1d8e('0x28')](function(_0x4b7999){_0x2be8c9['rows']=_0x4b7999;return _0x2be8c9;})[_0x1d8e('0x28')](respondWithFilteredResult(_0x9d35ac,_0x53a9e0))[_0x1d8e('0x46')](handleError(_0x9d35ac,null));};exports[_0x1d8e('0x47')]=function(_0x236561,_0x2e2604){var _0x225ba8={'raw':![],'where':{'id':_0x236561[_0x1d8e('0x48')]['id']}},_0x410e8f={};_0x410e8f[_0x1d8e('0x34')]=_[_0x1d8e('0x36')](db[_0x1d8e('0x42')][_0x1d8e('0x49')]);_0x410e8f[_0x1d8e('0x35')]=_[_0x1d8e('0x36')](_0x236561[_0x1d8e('0x35')]);_0x410e8f['filters']=_[_0x1d8e('0x4a')](_0x410e8f[_0x1d8e('0x34')],_0x410e8f[_0x1d8e('0x35')]);_0x225ba8[_0x1d8e('0x37')]=_[_0x1d8e('0x4a')](_0x410e8f[_0x1d8e('0x34')],qs[_0x1d8e('0x38')](_0x236561[_0x1d8e('0x35')][_0x1d8e('0x38')]));_0x225ba8[_0x1d8e('0x37')]=_0x225ba8[_0x1d8e('0x37')]['length']?_0x225ba8[_0x1d8e('0x37')]:_0x410e8f['model'];if(_0x236561[_0x1d8e('0x35')][_0x1d8e('0x43')]){_0x225ba8[_0x1d8e('0x44')]=[{'all':!![]}];}_0x225ba8=_['merge']({},_0x225ba8,_0x236561[_0x1d8e('0x41')]);return db[_0x1d8e('0x42')][_0x1d8e('0x4b')](_0x225ba8)[_0x1d8e('0x28')](handleEntityNotFound(_0x2e2604,null))['then'](respondWithResult(_0x2e2604,null))[_0x1d8e('0x46')](handleError(_0x2e2604,null));};exports['create']=function(_0x1fd1b5,_0xce7551){return db[_0x1d8e('0x42')]['create'](_0x1fd1b5[_0x1d8e('0x4c')],{})[_0x1d8e('0x28')](respondWithResult(_0xce7551,0xc9))[_0x1d8e('0x46')](handleError(_0xce7551,null));};exports[_0x1d8e('0x27')]=function(_0x4102a3,_0x3d6f59){if(_0x4102a3['body']['id']){delete _0x4102a3['body']['id'];}return db[_0x1d8e('0x42')]['find']({'where':{'id':_0x4102a3[_0x1d8e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d6f59,null))['then'](saveUpdates(_0x4102a3['body'],null))[_0x1d8e('0x28')](respondWithResult(_0x3d6f59,null))['catch'](handleError(_0x3d6f59,null));};exports[_0x1d8e('0x29')]=function(_0x4e8ce8,_0x105501){return db['VoiceQueueReport'][_0x1d8e('0x4b')]({'where':{'id':_0x4e8ce8[_0x1d8e('0x48')]['id']}})[_0x1d8e('0x28')](handleEntityNotFound(_0x105501,null))[_0x1d8e('0x28')](removeEntity(_0x105501,null))['catch'](handleError(_0x105501,null));};exports['describe']=function(_0x2575c1,_0x4ef3cc){return db[_0x1d8e('0x42')][_0x1d8e('0x4d')]()[_0x1d8e('0x28')](respondWithResult(_0x4ef3cc,null))[_0x1d8e('0x46')](handleError(_0x4ef3cc,null));};exports['getVoiceQueuesReport']=function(_0x30fb21,_0x326574){var _0x400b0e={},_0xee968d={},_0x3d683b={'count':0x0,'rows':[]};_0xee968d[_0x1d8e('0x34')]=_[_0x1d8e('0x36')](db['VoiceQueueReport'][_0x1d8e('0x49')]);_0xee968d[_0x1d8e('0x35')]=_[_0x1d8e('0x36')](_0x30fb21[_0x1d8e('0x35')]);_0xee968d['filters']=_[_0x1d8e('0x4a')](_0xee968d[_0x1d8e('0x34')],_0xee968d[_0x1d8e('0x35')]);_0x400b0e[_0x1d8e('0x37')]=_[_0x1d8e('0x4a')](_0xee968d['model'],qs['fields'](_0x30fb21['query'][_0x1d8e('0x38')]));_0x400b0e['attributes']=_0x400b0e[_0x1d8e('0x37')]['length']?_0x400b0e['attributes']:_0xee968d[_0x1d8e('0x34')];if(!_0x30fb21['query'][_0x1d8e('0x39')](_0x1d8e('0x4e'))){_0x400b0e[_0x1d8e('0x3a')]=qs[_0x1d8e('0x3a')](_0x30fb21[_0x1d8e('0x35')][_0x1d8e('0x3a')]);_0x400b0e['offset']=qs[_0x1d8e('0x21')](_0x30fb21[_0x1d8e('0x35')][_0x1d8e('0x21')]);}_0x400b0e[_0x1d8e('0x3b')]=qs[_0x1d8e('0x3c')](_0x30fb21[_0x1d8e('0x35')][_0x1d8e('0x3c')]);_0x400b0e[_0x1d8e('0x3d')]=qs[_0x1d8e('0x3e')](_['pick'](_0x30fb21[_0x1d8e('0x35')],_0xee968d[_0x1d8e('0x3e')]));if(_0x30fb21['query'][_0x1d8e('0x3f')]){_0x400b0e[_0x1d8e('0x3d')]=_[_0x1d8e('0x40')](_0x400b0e[_0x1d8e('0x3d')],{'$or':_['map'](_0x400b0e[_0x1d8e('0x37')],function(_0x5943dd){var _0x4fb46e={};_0x4fb46e[_0x5943dd]={'$like':'%'+_0x30fb21[_0x1d8e('0x35')][_0x1d8e('0x3f')]+'%'};return _0x4fb46e;})});}_0x400b0e=_[_0x1d8e('0x40')]({},_0x400b0e,_0x30fb21['options']);var _0x4730cb={'where':_0x400b0e[_0x1d8e('0x3d')]};return db['VoiceQueueReport'][_0x1d8e('0x20')](_0x4730cb)[_0x1d8e('0x28')](function(_0x488a12){_0x3d683b['count']=_0x488a12;if(_0x30fb21[_0x1d8e('0x35')]['includeAll']){_0x400b0e[_0x1d8e('0x44')]=[{'all':!![]}];}return db[_0x1d8e('0x42')][_0x1d8e('0x45')](_0x400b0e);})[_0x1d8e('0x28')](function(_0x521517){_0x3d683b[_0x1d8e('0x4f')]=_0x521517;return _0x3d683b;})['then'](respondWithFilteredResult(_0x326574,_0x400b0e,_0x1d8e('0x50')))['catch'](handleError(_0x326574,null,_0x1d8e('0x50')));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9477=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x9477,0xb2));var _0x7947=function(_0x26e758,_0x4289f0){_0x26e758=_0x26e758-0x0;var _0x1f8cfe=_0x9477[_0x26e758];return _0x1f8cfe;};'use strict';var EventEmitter=require(_0x7947('0x0'));var VoiceQueueReport=require(_0x7947('0x1'))['db'][_0x7947('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7947('0x3')](0x0);var events={'afterCreate':_0x7947('0x4'),'afterUpdate':_0x7947('0x5'),'afterDestroy':_0x7947('0x6')};function emitEvent(_0x424bad){return function(_0x178a56,_0x5e449a,_0x1a6fbf){VoiceQueueReportEvents[_0x7947('0x7')](_0x424bad+':'+_0x178a56['id'],_0x178a56);VoiceQueueReportEvents[_0x7947('0x7')](_0x424bad,_0x178a56);_0x1a6fbf(null);};}for(var e in events){if(events[_0x7947('0x8')](e)){var event=events[e];VoiceQueueReport[_0x7947('0x9')](e,emitEvent(event));}}module[_0x7947('0xa')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x8ba6=['emit','hasOwnProperty','hook','exports','events','VoiceQueueReport','save','update','remove'];(function(_0x25a3a7,_0x1d6d84){var _0x4c4eb0=function(_0x2dd802){while(--_0x2dd802){_0x25a3a7['push'](_0x25a3a7['shift']());}};_0x4c4eb0(++_0x1d6d84);}(_0x8ba6,0x11b));var _0x68ba=function(_0x44daf9,_0x913932){_0x44daf9=_0x44daf9-0x0;var _0x976a8a=_0x8ba6[_0x44daf9];return _0x976a8a;};'use strict';var EventEmitter=require(_0x68ba('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x68ba('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x68ba('0x2'),'afterUpdate':_0x68ba('0x3'),'afterDestroy':_0x68ba('0x4')};function emitEvent(_0xb30fcb){return function(_0x59c60c,_0x4a5138,_0x77a639){VoiceQueueReportEvents[_0x68ba('0x5')](_0xb30fcb+':'+_0x59c60c['id'],_0x59c60c);VoiceQueueReportEvents[_0x68ba('0x5')](_0xb30fcb,_0x59c60c);_0x77a639(null);};}for(var e in events){if(events[_0x68ba('0x6')](e)){var event=events[e];VoiceQueueReport[_0x68ba('0x7')](e,emitEvent(event));}}module[_0x68ba('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x070d=['calleridnum','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_queue','uniqueid'];(function(_0x1cd08d,_0x332c91){var _0x31455d=function(_0x5eb8c9){while(--_0x5eb8c9){_0x1cd08d['push'](_0x1cd08d['shift']());}};_0x31455d(++_0x332c91);}(_0x070d,0x153));var _0xd070=function(_0x3b934f,_0x59dc45){_0x3b934f=_0x3b934f-0x0;var _0x136c82=_0x070d[_0x3b934f];return _0x136c82;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd070('0x0'))(_0xd070('0x1'));var moment=require(_0xd070('0x2'));var BPromise=require(_0xd070('0x3'));var rp=require(_0xd070('0x4'));var fs=require('fs');var path=require(_0xd070('0x5'));var rimraf=require(_0xd070('0x6'));var config=require(_0xd070('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xd070('0x8')]=function(_0x3a0d10,_0x5452ca){return _0x3a0d10[_0xd070('0x9')]('VoiceQueueReport',attributes,{'tableName':_0xd070('0xa'),'paranoid':![],'indexes':[{'fields':[_0xd070('0xb')]},{'fields':[_0xd070('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x43f3=['report_queue','uniqueid','calleridnum','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport'];(function(_0x402d94,_0x3980d0){var _0xfad2a4=function(_0x386a2a){while(--_0x386a2a){_0x402d94['push'](_0x402d94['shift']());}};_0xfad2a4(++_0x3980d0);}(_0x43f3,0xab));var _0x343f=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x43f3[_0x14fad0];return _0x5c665f;};'use strict';var _=require('lodash');var util=require(_0x343f('0x0'));var logger=require(_0x343f('0x1'))('api');var moment=require(_0x343f('0x2'));var BPromise=require('bluebird');var rp=require(_0x343f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x343f('0x4'));var config=require(_0x343f('0x5'));var attributes=require(_0x343f('0x6'));module['exports']=function(_0x2ec994,_0x693775){return _0x2ec994[_0x343f('0x7')](_0x343f('0x8'),attributes,{'tableName':_0x343f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x343f('0xa')]},{'fields':[_0x343f('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x006c=['where','limit','UpdateVoiceQueueReport','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','attributes','include','map','model','GetVoiceQueueReport','debug','VoiceQueueReport','CreateVoiceQueueReport','update'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x006c,0x97));var _0xc006=function(_0x260878,_0xa9be1a){_0x260878=_0x260878-0x0;var _0x121b93=_0x006c[_0x260878];return _0x121b93;};'use strict';var _=require(_0xc006('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc006('0x1'));var db=require(_0xc006('0x2'))['db'];var utils=require(_0xc006('0x3'));var logger=require('../../config/logger')(_0xc006('0x4'));var config=require(_0xc006('0x5'));var jayson=require(_0xc006('0x6'));var client=jayson['client'][_0xc006('0x7')]({'port':0x232a});config['redis']=_[_0xc006('0x8')](config[_0xc006('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc006('0xa'))(new Redis(config[_0xc006('0x9')]));require(_0xc006('0xb'))['register'](socket);function respondWithRpcPromise(_0x50ab3d,_0x452eed,_0xccf571){return new BPromise(function(_0x2d7f3a,_0x3e011e){return client['request'](_0x50ab3d,_0xccf571)[_0xc006('0xc')](function(_0x5e0db8){logger[_0xc006('0xd')](_0xc006('0xe'),_0x452eed,_0xc006('0xf'));logger['debug'](_0xc006('0x10'),_0x452eed,'request\x20sent',JSON[_0xc006('0x11')](_0x5e0db8));if(_0x5e0db8[_0xc006('0x12')]){if(_0x5e0db8[_0xc006('0x12')]['code']===0x1f4){logger[_0xc006('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x452eed,_0x5e0db8[_0xc006('0x12')][_0xc006('0x13')]);return _0x3e011e(_0x5e0db8[_0xc006('0x12')]['message']);}logger[_0xc006('0x12')](_0xc006('0xe'),_0x452eed,_0x5e0db8[_0xc006('0x12')][_0xc006('0x13')]);return _0x2d7f3a(_0x5e0db8[_0xc006('0x12')]['message']);}else{logger[_0xc006('0xd')](_0xc006('0xe'),_0x452eed,_0xc006('0xf'));_0x2d7f3a(_0x5e0db8[_0xc006('0x14')][_0xc006('0x13')]);}})[_0xc006('0x15')](function(_0x4e4183){logger[_0xc006('0x12')](_0xc006('0xe'),_0x452eed,_0x4e4183);_0x3e011e(_0x4e4183);});});}exports['GetVoiceQueueReport']=function(_0x1aceca){var _0x1ff08b=this;return new Promise(function(_0x342bf6,_0x5a52e7){return db['VoiceQueueReport'][_0xc006('0x16')]({'raw':_0x1aceca['options']?_0x1aceca[_0xc006('0x17')][_0xc006('0x18')]===undefined?!![]:![]:!![],'where':_0x1aceca['options']?_0x1aceca['options']['where']||null:null,'attributes':_0x1aceca[_0xc006('0x17')]?_0x1aceca[_0xc006('0x17')][_0xc006('0x19')]||null:null,'limit':_0x1aceca[_0xc006('0x17')]?_0x1aceca['options']['limit']||null:null,'include':_0x1aceca[_0xc006('0x17')]?_0x1aceca[_0xc006('0x17')][_0xc006('0x1a')]?_[_0xc006('0x1b')](_0x1aceca[_0xc006('0x17')]['include'],function(_0x29604d){return{'model':db[_0x29604d[_0xc006('0x1c')]],'as':_0x29604d['as'],'attributes':_0x29604d[_0xc006('0x19')],'include':_0x29604d[_0xc006('0x1a')]?_[_0xc006('0x1b')](_0x29604d[_0xc006('0x1a')],function(_0x21189d){return{'model':db[_0x21189d[_0xc006('0x1c')]],'as':_0x21189d['as'],'attributes':_0x21189d['attributes'],'include':_0x21189d['include']?_['map'](_0x21189d['include'],function(_0x55cf12){return{'model':db[_0x55cf12[_0xc006('0x1c')]],'as':_0x55cf12['as'],'attributes':_0x55cf12[_0xc006('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc006('0xc')](function(_0x56970b){logger[_0xc006('0xd')](_0xc006('0x1d'),_0x1aceca);logger[_0xc006('0x1e')]('GetVoiceQueueReport',_0x1aceca,JSON[_0xc006('0x11')](_0x56970b));_0x342bf6(_0x56970b);})[_0xc006('0x15')](function(_0x46d0e8){logger[_0xc006('0x12')](_0xc006('0x1d'),_0x46d0e8['message'],_0x1aceca);_0x5a52e7(_0x1ff08b[_0xc006('0x12')](0x1f4,_0x46d0e8[_0xc006('0x13')]));});});};exports['CreateVoiceQueueReport']=function(_0x12cc6c){var _0x332131=this;return new Promise(function(_0x36730b,_0x23d0de){return db[_0xc006('0x1f')]['create'](_0x12cc6c['body'],{'raw':_0x12cc6c[_0xc006('0x17')]?_0x12cc6c['options'][_0xc006('0x18')]===undefined?!![]:![]:!![]})[_0xc006('0xc')](function(_0x40e381){logger['info']('CreateVoiceQueueReport',_0x12cc6c);logger['debug']('CreateVoiceQueueReport',_0x12cc6c,JSON[_0xc006('0x11')](_0x40e381));_0x36730b(_0x40e381);})[_0xc006('0x15')](function(_0xa83dfd){logger[_0xc006('0x12')](_0xc006('0x20'),_0xa83dfd['message'],_0x12cc6c);_0x23d0de(_0x332131[_0xc006('0x12')](0x1f4,_0xa83dfd['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x38d6d9){var _0x17a001=this;return new Promise(function(_0x5c2c45,_0x15f725){return db['VoiceQueueReport'][_0xc006('0x21')](_0x38d6d9['body'],{'raw':_0x38d6d9[_0xc006('0x17')]?_0x38d6d9[_0xc006('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38d6d9['options']?_0x38d6d9[_0xc006('0x17')][_0xc006('0x22')]||null:null,'attributes':_0x38d6d9[_0xc006('0x17')]?_0x38d6d9[_0xc006('0x17')]['attributes']||null:null,'limit':_0x38d6d9[_0xc006('0x17')]?_0x38d6d9[_0xc006('0x17')][_0xc006('0x23')]||null:null})['then'](function(_0x352916){logger['info'](_0xc006('0x24'),_0x38d6d9);logger[_0xc006('0x1e')](_0xc006('0x24'),_0x38d6d9,JSON['stringify'](_0x352916));_0x5c2c45(_0x352916);})[_0xc006('0x15')](function(_0x2daade){logger[_0xc006('0x12')](_0xc006('0x24'),_0x2daade['message'],_0x38d6d9);_0x15f725(_0x17a001[_0xc006('0x12')](0x1f4,_0x2daade['message']));});});};
\ No newline at end of file
+var _0xdcef=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','body','catch','UpdateVoiceQueueReport','lodash','util','moment'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xdcef,0x155));var _0xfdce=function(_0x2de7b7,_0x45d020){_0x2de7b7=_0x2de7b7-0x0;var _0x3ea41d=_0xdcef[_0x2de7b7];return _0x3ea41d;};'use strict';var _=require(_0xfdce('0x0'));var util=require(_0xfdce('0x1'));var moment=require(_0xfdce('0x2'));var BPromise=require(_0xfdce('0x3'));var rs=require(_0xfdce('0x4'));var fs=require('fs');var Redis=require(_0xfdce('0x5'));var db=require(_0xfdce('0x6'))['db'];var utils=require(_0xfdce('0x7'));var logger=require(_0xfdce('0x8'))(_0xfdce('0x9'));var config=require('../../config/environment');var jayson=require(_0xfdce('0xa'));var client=jayson['client'][_0xfdce('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfdce('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdce('0xd'))(new Redis(config[_0xfdce('0xc')]));require(_0xfdce('0xe'))[_0xfdce('0xf')](socket);function respondWithRpcPromise(_0x5ab10a,_0x141374,_0x5ab576){return new BPromise(function(_0x455271,_0xe1ba74){return client[_0xfdce('0x10')](_0x5ab10a,_0x5ab576)[_0xfdce('0x11')](function(_0x4cb437){logger[_0xfdce('0x12')](_0xfdce('0x13'),_0x141374,_0xfdce('0x14'));logger[_0xfdce('0x15')](_0xfdce('0x16'),_0x141374,_0xfdce('0x14'),JSON['stringify'](_0x4cb437));if(_0x4cb437[_0xfdce('0x17')]){if(_0x4cb437[_0xfdce('0x17')][_0xfdce('0x18')]===0x1f4){logger[_0xfdce('0x17')](_0xfdce('0x13'),_0x141374,_0x4cb437[_0xfdce('0x17')][_0xfdce('0x19')]);return _0xe1ba74(_0x4cb437['error'][_0xfdce('0x19')]);}logger[_0xfdce('0x17')](_0xfdce('0x13'),_0x141374,_0x4cb437[_0xfdce('0x17')]['message']);return _0x455271(_0x4cb437[_0xfdce('0x17')][_0xfdce('0x19')]);}else{logger[_0xfdce('0x12')](_0xfdce('0x13'),_0x141374,_0xfdce('0x14'));_0x455271(_0x4cb437['result'][_0xfdce('0x19')]);}})['catch'](function(_0x5cd9e2){logger[_0xfdce('0x17')](_0xfdce('0x13'),_0x141374,_0x5cd9e2);_0xe1ba74(_0x5cd9e2);});});}exports[_0xfdce('0x1a')]=function(_0x3bb615){var _0x594291=this;return new Promise(function(_0x3c9849,_0x1fab1d){return db['VoiceQueueReport'][_0xfdce('0x1b')]({'raw':_0x3bb615[_0xfdce('0x1c')]?_0x3bb615['options'][_0xfdce('0x1d')]===undefined?!![]:![]:!![],'where':_0x3bb615['options']?_0x3bb615['options'][_0xfdce('0x1e')]||null:null,'attributes':_0x3bb615['options']?_0x3bb615['options'][_0xfdce('0x1f')]||null:null,'limit':_0x3bb615[_0xfdce('0x1c')]?_0x3bb615[_0xfdce('0x1c')][_0xfdce('0x20')]||null:null,'include':_0x3bb615['options']?_0x3bb615[_0xfdce('0x1c')][_0xfdce('0x21')]?_['map'](_0x3bb615[_0xfdce('0x1c')][_0xfdce('0x21')],function(_0x50cd45){return{'model':db[_0x50cd45[_0xfdce('0x22')]],'as':_0x50cd45['as'],'attributes':_0x50cd45[_0xfdce('0x1f')],'include':_0x50cd45['include']?_[_0xfdce('0x23')](_0x50cd45[_0xfdce('0x21')],function(_0x573419){return{'model':db[_0x573419[_0xfdce('0x22')]],'as':_0x573419['as'],'attributes':_0x573419[_0xfdce('0x1f')],'include':_0x573419[_0xfdce('0x21')]?_[_0xfdce('0x23')](_0x573419[_0xfdce('0x21')],function(_0x3d63e1){return{'model':db[_0x3d63e1[_0xfdce('0x22')]],'as':_0x3d63e1['as'],'attributes':_0x3d63e1[_0xfdce('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfdce('0x11')](function(_0x32bfee){logger[_0xfdce('0x12')](_0xfdce('0x1a'),_0x3bb615);logger[_0xfdce('0x15')](_0xfdce('0x1a'),_0x3bb615,JSON[_0xfdce('0x24')](_0x32bfee));_0x3c9849(_0x32bfee);})['catch'](function(_0x2d49e5){logger[_0xfdce('0x17')](_0xfdce('0x1a'),_0x2d49e5[_0xfdce('0x19')],_0x3bb615);_0x1fab1d(_0x594291[_0xfdce('0x17')](0x1f4,_0x2d49e5[_0xfdce('0x19')]));});});};exports[_0xfdce('0x25')]=function(_0x1a4e15){var _0x439315=this;return new Promise(function(_0x2537d7,_0x27336e){return db[_0xfdce('0x26')][_0xfdce('0x27')](_0x1a4e15[_0xfdce('0x28')],{'raw':_0x1a4e15[_0xfdce('0x1c')]?_0x1a4e15[_0xfdce('0x1c')][_0xfdce('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x133988){logger[_0xfdce('0x12')](_0xfdce('0x25'),_0x1a4e15);logger[_0xfdce('0x15')](_0xfdce('0x25'),_0x1a4e15,JSON[_0xfdce('0x24')](_0x133988));_0x2537d7(_0x133988);})[_0xfdce('0x29')](function(_0x307c48){logger[_0xfdce('0x17')](_0xfdce('0x25'),_0x307c48['message'],_0x1a4e15);_0x27336e(_0x439315[_0xfdce('0x17')](0x1f4,_0x307c48[_0xfdce('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x5d45a3){var _0x5e0409=this;return new Promise(function(_0x3d1d96,_0x2ebc6d){return db['VoiceQueueReport']['update'](_0x5d45a3[_0xfdce('0x28')],{'raw':_0x5d45a3[_0xfdce('0x1c')]?_0x5d45a3[_0xfdce('0x1c')][_0xfdce('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d45a3[_0xfdce('0x1c')]?_0x5d45a3[_0xfdce('0x1c')][_0xfdce('0x1e')]||null:null,'attributes':_0x5d45a3[_0xfdce('0x1c')]?_0x5d45a3[_0xfdce('0x1c')]['attributes']||null:null,'limit':_0x5d45a3[_0xfdce('0x1c')]?_0x5d45a3[_0xfdce('0x1c')][_0xfdce('0x20')]||null:null})[_0xfdce('0x11')](function(_0x38cac0){logger[_0xfdce('0x12')]('UpdateVoiceQueueReport',_0x5d45a3);logger[_0xfdce('0x15')](_0xfdce('0x2a'),_0x5d45a3,JSON['stringify'](_0x38cac0));_0x3d1d96(_0x38cac0);})[_0xfdce('0x29')](function(_0x4aba4c){logger[_0xfdce('0x17')](_0xfdce('0x2a'),_0x4aba4c['message'],_0x5d45a3);_0x2ebc6d(_0x5e0409[_0xfdce('0x17')](0x1f4,_0x4aba4c['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa261=['remove','update','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x40c73d,_0x427abc){var _0x2883ce=function(_0x39788a){while(--_0x39788a){_0x40c73d['push'](_0x40c73d['shift']());}};_0x2883ce(++_0x427abc);}(_0xa261,0x1a3));var _0x1a26=function(_0x1bc688,_0x5140a8){_0x1bc688=_0x1bc688-0x0;var _0x15055e=_0xa261[_0x1bc688];return _0x15055e;};'use strict';var VoiceQueueReportEvents=require(_0x1a26('0x0'));var events=['save',_0x1a26('0x1'),_0x1a26('0x2')];function createListener(_0x4010fc,_0x151055){return function(_0x698831){_0x151055['emit'](_0x4010fc,_0x698831);};}function removeListener(_0x52360d,_0x52a165){return function(){VoiceQueueReportEvents[_0x1a26('0x3')](_0x52360d,_0x52a165);};}exports[_0x1a26('0x4')]=function(_0x2dad90){for(var _0x392ee0=0x0,_0x120837=events['length'];_0x392ee0<_0x120837;_0x392ee0++){var _0x2dfa27=events[_0x392ee0];var _0x53064d=createListener(_0x1a26('0x5')+_0x2dfa27,_0x2dad90);VoiceQueueReportEvents['on'](_0x2dfa27,_0x53064d);}};
\ No newline at end of file
+var _0xb024=['emit','register','voiceQueueReport:','save','remove','update'];(function(_0x122528,_0x454ccb){var _0x3ce74f=function(_0x5cb4e5){while(--_0x5cb4e5){_0x122528['push'](_0x122528['shift']());}};_0x3ce74f(++_0x454ccb);}(_0xb024,0x1ad));var _0x4b02=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb024[_0x21a9d9];return _0x46adce;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x4b02('0x0'),_0x4b02('0x1'),_0x4b02('0x2')];function createListener(_0x24b0f6,_0xabbbd5){return function(_0x4a6ab2){_0xabbbd5[_0x4b02('0x3')](_0x24b0f6,_0x4a6ab2);};}function removeListener(_0x559b4b,_0xb8f26e){return function(){VoiceQueueReportEvents['removeListener'](_0x559b4b,_0xb8f26e);};}exports[_0x4b02('0x4')]=function(_0x5eb526){for(var _0x206f33=0x0,_0x484064=events['length'];_0x206f33<_0x484064;_0x206f33++){var _0x49543e=events[_0x206f33];var _0x305d39=createListener(_0x4b02('0x5')+_0x49543e,_0x5eb526);VoiceQueueReportEvents['on'](_0x49543e,_0x305d39);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x89b9=['get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller'];(function(_0x55deaa,_0x31e06b){var _0x30864b=function(_0x205140){while(--_0x205140){_0x55deaa['push'](_0x55deaa['shift']());}};_0x30864b(++_0x31e06b);}(_0x89b9,0x17a));var _0x989b=function(_0x59dc6b,_0x175f0b){_0x59dc6b=_0x59dc6b-0x0;var _0xd58605=_0x89b9[_0x59dc6b];return _0xd58605;};'use strict';var multer=require(_0x989b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x989b('0x1')]();var fs_extra=require(_0x989b('0x2'));var auth=require(_0x989b('0x3'));var interaction=require(_0x989b('0x4'));var config=require('../../config/environment');var controller=require(_0x989b('0x5'));router[_0x989b('0x6')]('/',auth[_0x989b('0x7')](),controller['index']);router[_0x989b('0x6')]('/:id',auth[_0x989b('0x7')](),controller[_0x989b('0x8')]);router[_0x989b('0x9')]('/',auth[_0x989b('0x7')](),controller[_0x989b('0xa')]);router[_0x989b('0xb')](_0x989b('0xc'),auth[_0x989b('0x7')](),controller[_0x989b('0xd')]);router['delete'](_0x989b('0xc'),auth[_0x989b('0x7')](),controller[_0x989b('0xe')]);module[_0x989b('0xf')]=router;
\ No newline at end of file
+var _0x5137=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy'];(function(_0x214a7b,_0x13a1e8){var _0x3ab426=function(_0x57c80c){while(--_0x57c80c){_0x214a7b['push'](_0x214a7b['shift']());}};_0x3ab426(++_0x13a1e8);}(_0x5137,0x1c9));var _0x7513=function(_0x1b3715,_0x426234){_0x1b3715=_0x1b3715-0x0;var _0x18bbd5=_0x5137[_0x1b3715];return _0x18bbd5;};'use strict';var multer=require(_0x7513('0x0'));var util=require('util');var path=require(_0x7513('0x1'));var timeout=require(_0x7513('0x2'));var express=require('express');var router=express[_0x7513('0x3')]();var fs_extra=require(_0x7513('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7513('0x5'));var config=require(_0x7513('0x6'));var controller=require(_0x7513('0x7'));router[_0x7513('0x8')]('/',auth[_0x7513('0x9')](),controller[_0x7513('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7513('0xb')]);router[_0x7513('0xc')]('/',auth[_0x7513('0x9')](),controller[_0x7513('0xd')]);router[_0x7513('0xe')](_0x7513('0xf'),auth['isAuthenticated'](),controller[_0x7513('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7513('0x11')]);module[_0x7513('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a05=['sequelize','moment','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x0a05,0x12c));var _0x50a0=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x0a05[_0x39e164];return _0x13fa6b;};'use strict';var Sequelize=require(_0x50a0('0x0'));var moment=require(_0x50a0('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x50a0('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x50a0('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x50a0('0x4')](_0x50a0('0x5'))}};
\ No newline at end of file
+var _0x8f46=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE'];(function(_0x482134,_0x2d3e61){var _0x185ef5=function(_0x59014b){while(--_0x59014b){_0x482134['push'](_0x482134['shift']());}};_0x185ef5(++_0x2d3e61);}(_0x8f46,0x1a5));var _0x68f4=function(_0x13ae91,_0x42ec71){_0x13ae91=_0x13ae91-0x0;var _0x5084c1=_0x8f46[_0x13ae91];return _0x5084c1;};'use strict';var Sequelize=require(_0x68f4('0x0'));var moment=require(_0x68f4('0x1'));module[_0x68f4('0x2')]={'time':{'type':Sequelize[_0x68f4('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x68f4('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x68f4('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x68f4('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x68f4('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x68f4('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x68f4('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x68f4('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x68f4('0x5'))}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7712=['name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack'];(function(_0x26b308,_0x397dfc){var _0x59478d=function(_0x20b4c4){while(--_0x20b4c4){_0x26b308['push'](_0x26b308['shift']());}};_0x59478d(++_0x397dfc);}(_0x7712,0xbb));var _0x2771=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7712[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2771('0x0'));var zipdir=require(_0x2771('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2771('0x2'));var moment=require(_0x2771('0x3'));var BPromise=require(_0x2771('0x4'));var Mustache=require(_0x2771('0x5'));var util=require(_0x2771('0x6'));var path=require(_0x2771('0x7'));var sox=require(_0x2771('0x8'));var csv=require(_0x2771('0x9'));var ejs=require(_0x2771('0xa'));var fs=require('fs');var fs_extra=require(_0x2771('0xb'));var _=require(_0x2771('0xc'));var squel=require(_0x2771('0xd'));var crypto=require(_0x2771('0xe'));var jsforce=require(_0x2771('0xf'));var deskjs=require(_0x2771('0x10'));var toCsv=require(_0x2771('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2771('0x11'));var authService=require(_0x2771('0x12'));var qs=require(_0x2771('0x13'));var as=require(_0x2771('0x14'));var hardwareService=require(_0x2771('0x15'));var logger=require(_0x2771('0x16'))(_0x2771('0x17'));var utils=require('../../config/utils');var config=require(_0x2771('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2771('0x19'))['db'];function respondWithStatusCode(_0x1c04e6,_0x651377){_0x651377=_0x651377||0xcc;return function(_0x139a2b){if(_0x139a2b){return _0x1c04e6['sendStatus'](_0x651377);}return _0x1c04e6['status'](_0x651377)['end']();};}function respondWithResult(_0x1042c9,_0x61fca0){_0x61fca0=_0x61fca0||0xc8;return function(_0x9dea16){if(_0x9dea16){return _0x1042c9[_0x2771('0x1a')](_0x61fca0)[_0x2771('0x1b')](_0x9dea16);}};}function respondWithFilteredResult(_0xc971bd,_0x552b57){return function(_0x290e83){if(_0x290e83){var _0x41e469=typeof _0x552b57[_0x2771('0x1c')]===_0x2771('0x1d')&&typeof _0x552b57[_0x2771('0x1e')]===_0x2771('0x1d');var _0x83336c=_0x290e83[_0x2771('0x1f')];var _0x398062=_0x41e469?0x0:_0x552b57[_0x2771('0x1c')];var _0x58d3dc=_0x41e469?_0x290e83['count']:_0x552b57[_0x2771('0x1c')]+_0x552b57[_0x2771('0x1e')];var _0x149d99;if(_0x58d3dc>=_0x83336c){_0x58d3dc=_0x83336c;_0x149d99=0xc8;}else{_0x149d99=0xce;}_0xc971bd['status'](_0x149d99);return _0xc971bd['set'](_0x2771('0x20'),_0x398062+'-'+_0x58d3dc+'/'+_0x83336c)['json'](_0x290e83);}return null;};}function patchUpdates(_0x628a49){return function(_0x351f7f){try{jsonpatch[_0x2771('0x21')](_0x351f7f,_0x628a49,!![]);}catch(_0x3c8ddd){return BPromise[_0x2771('0x22')](_0x3c8ddd);}return _0x351f7f[_0x2771('0x23')]();};}function saveUpdates(_0x562376,_0x2a50dd){return function(_0x2dcc02){if(_0x2dcc02){return _0x2dcc02[_0x2771('0x24')](_0x562376)[_0x2771('0x25')](function(_0x59aa38){return _0x59aa38;});}return null;};}function removeEntity(_0x1b5055,_0x3990dd){return function(_0x12a971){if(_0x12a971){return _0x12a971[_0x2771('0x26')]()[_0x2771('0x25')](function(){_0x1b5055[_0x2771('0x1a')](0xcc)[_0x2771('0x27')]();});}};}function handleEntityNotFound(_0x3a7868,_0x369316){return function(_0x416853){if(!_0x416853){_0x3a7868['sendStatus'](0x194);}return _0x416853;};}function handleError(_0xfc652a,_0x3e6054){_0x3e6054=_0x3e6054||0x1f4;return function(_0x340d07){logger['error'](_0x340d07[_0x2771('0x28')]);if(_0x340d07[_0x2771('0x29')]){delete _0x340d07[_0x2771('0x29')];}_0xfc652a['status'](_0x3e6054)[_0x2771('0x2a')](_0x340d07);};}exports[_0x2771('0x2b')]=function(_0x51a56f,_0x8be12e){var _0x51f191={},_0x4a7bd1={},_0x1d2836={'count':0x0,'rows':[]};var _0x52c9b9=_[_0x2771('0x2c')](db[_0x2771('0x2d')][_0x2771('0x2e')],function(_0x48924e){return{'name':_0x48924e[_0x2771('0x2f')],'type':_0x48924e['type']['key']};});_0x4a7bd1[_0x2771('0x30')]=_[_0x2771('0x2c')](_0x52c9b9,_0x2771('0x29'));_0x4a7bd1[_0x2771('0x31')]=_['keys'](_0x51a56f[_0x2771('0x31')]);_0x4a7bd1['filters']=_['intersection'](_0x4a7bd1[_0x2771('0x30')],_0x4a7bd1[_0x2771('0x31')]);_0x51f191['attributes']=_[_0x2771('0x32')](_0x4a7bd1[_0x2771('0x30')],qs[_0x2771('0x33')](_0x51a56f[_0x2771('0x31')]['fields']));_0x51f191[_0x2771('0x34')]=_0x51f191['attributes'][_0x2771('0x35')]?_0x51f191[_0x2771('0x34')]:_0x4a7bd1[_0x2771('0x30')];if(!_0x51a56f['query'][_0x2771('0x36')](_0x2771('0x37'))){_0x51f191[_0x2771('0x1e')]=qs[_0x2771('0x1e')](_0x51a56f[_0x2771('0x31')][_0x2771('0x1e')]);_0x51f191[_0x2771('0x1c')]=qs[_0x2771('0x1c')](_0x51a56f[_0x2771('0x31')][_0x2771('0x1c')]);}_0x51f191[_0x2771('0x38')]=qs[_0x2771('0x39')](_0x51a56f[_0x2771('0x31')][_0x2771('0x39')]);_0x51f191[_0x2771('0x3a')]=qs[_0x2771('0x3b')](_[_0x2771('0x3c')](_0x51a56f[_0x2771('0x31')],_0x4a7bd1[_0x2771('0x3b')]),_0x52c9b9);if(_0x51a56f['query'][_0x2771('0x3d')]){_0x51f191[_0x2771('0x3a')]=_['merge'](_0x51f191['where'],{'$or':_[_0x2771('0x2c')](_0x52c9b9,function(_0x3431b2){if(_0x3431b2[_0x2771('0x3e')]!=='VIRTUAL'){var _0x4a01e8={};_0x4a01e8[_0x3431b2['name']]={'$like':'%'+_0x51a56f[_0x2771('0x31')][_0x2771('0x3d')]+'%'};return _0x4a01e8;}})});}_0x51f191=_[_0x2771('0x3f')]({},_0x51f191,_0x51a56f[_0x2771('0x40')]);var _0x6f627a={'where':_0x51f191['where']};return db[_0x2771('0x2d')][_0x2771('0x1f')](_0x6f627a)[_0x2771('0x25')](function(_0x307943){_0x1d2836[_0x2771('0x1f')]=_0x307943;if(_0x51a56f[_0x2771('0x31')][_0x2771('0x41')]){_0x51f191[_0x2771('0x42')]=[{'all':!![]}];}return db[_0x2771('0x2d')][_0x2771('0x43')](_0x51f191);})['then'](function(_0x17a5eb){_0x1d2836[_0x2771('0x44')]=_0x17a5eb;return _0x1d2836;})['then'](respondWithFilteredResult(_0x8be12e,_0x51f191))[_0x2771('0x45')](handleError(_0x8be12e,null));};exports[_0x2771('0x46')]=function(_0x21dd99,_0x31c7af){var _0x1d2f96={'raw':!![],'where':{'id':_0x21dd99[_0x2771('0x47')]['id']}},_0x563760={};_0x563760[_0x2771('0x30')]=_[_0x2771('0x48')](db['VoiceQueuesLog'][_0x2771('0x2e')]);_0x563760['query']=_[_0x2771('0x48')](_0x21dd99['query']);_0x563760[_0x2771('0x3b')]=_[_0x2771('0x32')](_0x563760[_0x2771('0x30')],_0x563760[_0x2771('0x31')]);_0x1d2f96[_0x2771('0x34')]=_[_0x2771('0x32')](_0x563760[_0x2771('0x30')],qs[_0x2771('0x33')](_0x21dd99[_0x2771('0x31')][_0x2771('0x33')]));_0x1d2f96[_0x2771('0x34')]=_0x1d2f96[_0x2771('0x34')][_0x2771('0x35')]?_0x1d2f96['attributes']:_0x563760[_0x2771('0x30')];if(_0x21dd99['query'][_0x2771('0x41')]){_0x1d2f96[_0x2771('0x42')]=[{'all':!![]}];}_0x1d2f96=_[_0x2771('0x3f')]({},_0x1d2f96,_0x21dd99[_0x2771('0x40')]);return db[_0x2771('0x2d')][_0x2771('0x49')](_0x1d2f96)[_0x2771('0x25')](handleEntityNotFound(_0x31c7af,null))[_0x2771('0x25')](respondWithResult(_0x31c7af,null))[_0x2771('0x45')](handleError(_0x31c7af,null));};exports['create']=function(_0x2e6d72,_0x55aefb){return db['VoiceQueuesLog'][_0x2771('0x4a')](_0x2e6d72[_0x2771('0x4b')],{})[_0x2771('0x25')](respondWithResult(_0x55aefb,0xc9))['catch'](handleError(_0x55aefb,null));};exports[_0x2771('0x24')]=function(_0x3236fb,_0x53e606){if(_0x3236fb[_0x2771('0x4b')]['id']){delete _0x3236fb[_0x2771('0x4b')]['id'];}return db[_0x2771('0x2d')][_0x2771('0x49')]({'where':{'id':_0x3236fb[_0x2771('0x47')]['id']}})[_0x2771('0x25')](handleEntityNotFound(_0x53e606,null))['then'](saveUpdates(_0x3236fb[_0x2771('0x4b')],null))['then'](respondWithResult(_0x53e606,null))[_0x2771('0x45')](handleError(_0x53e606,null));};exports['destroy']=function(_0x297d63,_0x57235c){return db[_0x2771('0x2d')]['find']({'where':{'id':_0x297d63[_0x2771('0x47')]['id']}})[_0x2771('0x25')](handleEntityNotFound(_0x57235c,null))[_0x2771('0x25')](removeEntity(_0x57235c,null))[_0x2771('0x45')](handleError(_0x57235c,null));};
\ No newline at end of file
+var _0x4fd1=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','catch','eml-format'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x4fd1,0x133));var _0x14fd=function(_0x155d28,_0x3df544){_0x155d28=_0x155d28-0x0;var _0x36f837=_0x4fd1[_0x155d28];return _0x36f837;};'use strict';var emlformat=require(_0x14fd('0x0'));var rimraf=require(_0x14fd('0x1'));var zipdir=require(_0x14fd('0x2'));var jsonpatch=require(_0x14fd('0x3'));var rp=require(_0x14fd('0x4'));var moment=require(_0x14fd('0x5'));var BPromise=require(_0x14fd('0x6'));var Mustache=require('mustache');var util=require(_0x14fd('0x7'));var path=require(_0x14fd('0x8'));var sox=require(_0x14fd('0x9'));var csv=require('to-csv');var ejs=require(_0x14fd('0xa'));var fs=require('fs');var fs_extra=require(_0x14fd('0xb'));var _=require(_0x14fd('0xc'));var squel=require('squel');var crypto=require(_0x14fd('0xd'));var jsforce=require(_0x14fd('0xe'));var deskjs=require(_0x14fd('0xf'));var toCsv=require(_0x14fd('0x10'));var querystring=require(_0x14fd('0x11'));var Papa=require(_0x14fd('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x14fd('0x13'));var as=require(_0x14fd('0x14'));var hardwareService=require(_0x14fd('0x15'));var logger=require(_0x14fd('0x16'))(_0x14fd('0x17'));var utils=require(_0x14fd('0x18'));var config=require(_0x14fd('0x19'));var licenseUtil=require(_0x14fd('0x1a'));var db=require(_0x14fd('0x1b'))['db'];function respondWithStatusCode(_0x3bfab3,_0x4cef6d){_0x4cef6d=_0x4cef6d||0xcc;return function(_0x181e82){if(_0x181e82){return _0x3bfab3[_0x14fd('0x1c')](_0x4cef6d);}return _0x3bfab3[_0x14fd('0x1d')](_0x4cef6d)[_0x14fd('0x1e')]();};}function respondWithResult(_0x23e547,_0x4c7c59){_0x4c7c59=_0x4c7c59||0xc8;return function(_0x3ab169){if(_0x3ab169){return _0x23e547[_0x14fd('0x1d')](_0x4c7c59)[_0x14fd('0x1f')](_0x3ab169);}};}function respondWithFilteredResult(_0x2b31aa,_0x5ea6ad){return function(_0xec545b){if(_0xec545b){var _0xa950c9=typeof _0x5ea6ad[_0x14fd('0x20')]===_0x14fd('0x21')&&typeof _0x5ea6ad[_0x14fd('0x22')]===_0x14fd('0x21');var _0x4b362f=_0xec545b['count'];var _0x172e77=_0xa950c9?0x0:_0x5ea6ad['offset'];var _0x23f5f0=_0xa950c9?_0xec545b[_0x14fd('0x23')]:_0x5ea6ad[_0x14fd('0x20')]+_0x5ea6ad['limit'];var _0x1af923;if(_0x23f5f0>=_0x4b362f){_0x23f5f0=_0x4b362f;_0x1af923=0xc8;}else{_0x1af923=0xce;}_0x2b31aa[_0x14fd('0x1d')](_0x1af923);return _0x2b31aa[_0x14fd('0x24')](_0x14fd('0x25'),_0x172e77+'-'+_0x23f5f0+'/'+_0x4b362f)[_0x14fd('0x1f')](_0xec545b);}return null;};}function patchUpdates(_0x3b1ee5){return function(_0x2edc92){try{jsonpatch[_0x14fd('0x26')](_0x2edc92,_0x3b1ee5,!![]);}catch(_0xc2075a){return BPromise[_0x14fd('0x27')](_0xc2075a);}return _0x2edc92['save']();};}function saveUpdates(_0x27ec36,_0x1a11cf){return function(_0x4c895e){if(_0x4c895e){return _0x4c895e[_0x14fd('0x28')](_0x27ec36)[_0x14fd('0x29')](function(_0x431c30){return _0x431c30;});}return null;};}function removeEntity(_0x51ad3d,_0x21924c){return function(_0x2631b5){if(_0x2631b5){return _0x2631b5[_0x14fd('0x2a')]()['then'](function(){_0x51ad3d[_0x14fd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c2e63,_0x402d8c){return function(_0x3eab3e){if(!_0x3eab3e){_0x3c2e63[_0x14fd('0x1c')](0x194);}return _0x3eab3e;};}function handleError(_0x1a722e,_0x5c8e85){_0x5c8e85=_0x5c8e85||0x1f4;return function(_0xb8302c){logger['error'](_0xb8302c[_0x14fd('0x2b')]);if(_0xb8302c[_0x14fd('0x2c')]){delete _0xb8302c[_0x14fd('0x2c')];}_0x1a722e['status'](_0x5c8e85)[_0x14fd('0x2d')](_0xb8302c);};}exports[_0x14fd('0x2e')]=function(_0x2063a2,_0x1f075b){var _0x47ba6d={},_0x3a6770={},_0x80b2b1={'count':0x0,'rows':[]};var _0x5dad6c=_['map'](db[_0x14fd('0x2f')][_0x14fd('0x30')],function(_0xd28092){return{'name':_0xd28092[_0x14fd('0x31')],'type':_0xd28092[_0x14fd('0x32')]['key']};});_0x3a6770[_0x14fd('0x33')]=_[_0x14fd('0x34')](_0x5dad6c,'name');_0x3a6770['query']=_[_0x14fd('0x35')](_0x2063a2[_0x14fd('0x36')]);_0x3a6770[_0x14fd('0x37')]=_[_0x14fd('0x38')](_0x3a6770[_0x14fd('0x33')],_0x3a6770[_0x14fd('0x36')]);_0x47ba6d[_0x14fd('0x39')]=_[_0x14fd('0x38')](_0x3a6770[_0x14fd('0x33')],qs[_0x14fd('0x3a')](_0x2063a2[_0x14fd('0x36')][_0x14fd('0x3a')]));_0x47ba6d[_0x14fd('0x39')]=_0x47ba6d[_0x14fd('0x39')][_0x14fd('0x3b')]?_0x47ba6d['attributes']:_0x3a6770[_0x14fd('0x33')];if(!_0x2063a2[_0x14fd('0x36')]['hasOwnProperty'](_0x14fd('0x3c'))){_0x47ba6d[_0x14fd('0x22')]=qs['limit'](_0x2063a2[_0x14fd('0x36')][_0x14fd('0x22')]);_0x47ba6d[_0x14fd('0x20')]=qs['offset'](_0x2063a2[_0x14fd('0x36')][_0x14fd('0x20')]);}_0x47ba6d[_0x14fd('0x3d')]=qs['sort'](_0x2063a2['query']['sort']);_0x47ba6d[_0x14fd('0x3e')]=qs[_0x14fd('0x37')](_[_0x14fd('0x3f')](_0x2063a2[_0x14fd('0x36')],_0x3a6770['filters']),_0x5dad6c);if(_0x2063a2[_0x14fd('0x36')][_0x14fd('0x40')]){_0x47ba6d[_0x14fd('0x3e')]=_['merge'](_0x47ba6d['where'],{'$or':_[_0x14fd('0x34')](_0x5dad6c,function(_0x364a58){if(_0x364a58[_0x14fd('0x32')]!==_0x14fd('0x41')){var _0x410fb5={};_0x410fb5[_0x364a58[_0x14fd('0x2c')]]={'$like':'%'+_0x2063a2[_0x14fd('0x36')][_0x14fd('0x40')]+'%'};return _0x410fb5;}})});}_0x47ba6d=_['merge']({},_0x47ba6d,_0x2063a2[_0x14fd('0x42')]);var _0x7ac9ea={'where':_0x47ba6d['where']};return db[_0x14fd('0x2f')][_0x14fd('0x23')](_0x7ac9ea)['then'](function(_0x56f4c6){_0x80b2b1[_0x14fd('0x23')]=_0x56f4c6;if(_0x2063a2[_0x14fd('0x36')]['includeAll']){_0x47ba6d[_0x14fd('0x43')]=[{'all':!![]}];}return db[_0x14fd('0x2f')][_0x14fd('0x44')](_0x47ba6d);})[_0x14fd('0x29')](function(_0x6875aa){_0x80b2b1[_0x14fd('0x45')]=_0x6875aa;return _0x80b2b1;})[_0x14fd('0x29')](respondWithFilteredResult(_0x1f075b,_0x47ba6d))['catch'](handleError(_0x1f075b,null));};exports[_0x14fd('0x46')]=function(_0x10a034,_0x4e5158){var _0x55b017={'raw':!![],'where':{'id':_0x10a034[_0x14fd('0x47')]['id']}},_0x1ce68c={};_0x1ce68c[_0x14fd('0x33')]=_[_0x14fd('0x35')](db[_0x14fd('0x2f')][_0x14fd('0x30')]);_0x1ce68c['query']=_['keys'](_0x10a034[_0x14fd('0x36')]);_0x1ce68c[_0x14fd('0x37')]=_['intersection'](_0x1ce68c['model'],_0x1ce68c['query']);_0x55b017[_0x14fd('0x39')]=_['intersection'](_0x1ce68c['model'],qs[_0x14fd('0x3a')](_0x10a034[_0x14fd('0x36')][_0x14fd('0x3a')]));_0x55b017[_0x14fd('0x39')]=_0x55b017['attributes'][_0x14fd('0x3b')]?_0x55b017[_0x14fd('0x39')]:_0x1ce68c[_0x14fd('0x33')];if(_0x10a034[_0x14fd('0x36')][_0x14fd('0x48')]){_0x55b017[_0x14fd('0x43')]=[{'all':!![]}];}_0x55b017=_['merge']({},_0x55b017,_0x10a034[_0x14fd('0x42')]);return db[_0x14fd('0x2f')][_0x14fd('0x49')](_0x55b017)[_0x14fd('0x29')](handleEntityNotFound(_0x4e5158,null))[_0x14fd('0x29')](respondWithResult(_0x4e5158,null))['catch'](handleError(_0x4e5158,null));};exports[_0x14fd('0x4a')]=function(_0x5d2e46,_0x26c39e){return db[_0x14fd('0x2f')][_0x14fd('0x4a')](_0x5d2e46[_0x14fd('0x4b')],{})[_0x14fd('0x29')](respondWithResult(_0x26c39e,0xc9))[_0x14fd('0x4c')](handleError(_0x26c39e,null));};exports[_0x14fd('0x28')]=function(_0x34efd2,_0x1044a1){if(_0x34efd2[_0x14fd('0x4b')]['id']){delete _0x34efd2[_0x14fd('0x4b')]['id'];}return db['VoiceQueuesLog'][_0x14fd('0x49')]({'where':{'id':_0x34efd2[_0x14fd('0x47')]['id']}})[_0x14fd('0x29')](handleEntityNotFound(_0x1044a1,null))[_0x14fd('0x29')](saveUpdates(_0x34efd2[_0x14fd('0x4b')],null))[_0x14fd('0x29')](respondWithResult(_0x1044a1,null))['catch'](handleError(_0x1044a1,null));};exports[_0x14fd('0x2a')]=function(_0x56dba7,_0x644af9){return db[_0x14fd('0x2f')][_0x14fd('0x49')]({'where':{'id':_0x56dba7[_0x14fd('0x47')]['id']}})[_0x14fd('0x29')](handleEntityNotFound(_0x644af9,null))['then'](removeEntity(_0x644af9,null))[_0x14fd('0x4c')](handleError(_0x644af9,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b55=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x2f5784,_0x75ac1c){var _0x2ff0fd=function(_0xe6bce0){while(--_0xe6bce0){_0x2f5784['push'](_0x2f5784['shift']());}};_0x2ff0fd(++_0x75ac1c);}(_0x2b55,0x1f0));var _0x52b5=function(_0x25009f,_0x1d6a9f){_0x25009f=_0x25009f-0x0;var _0x5c16a6=_0x2b55[_0x25009f];return _0x5c16a6;};'use strict';var _=require(_0x52b5('0x0'));var util=require(_0x52b5('0x1'));var logger=require(_0x52b5('0x2'))('api');var moment=require(_0x52b5('0x3'));var BPromise=require(_0x52b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52b5('0x5'));var rimraf=require(_0x52b5('0x6'));var config=require(_0x52b5('0x7'));var attributes=require(_0x52b5('0x8'));module[_0x52b5('0x9')]=function(_0x54eb44,_0xd1f017){return _0x54eb44[_0x52b5('0xa')](_0x52b5('0xb'),attributes,{'tableName':_0x52b5('0xc'),'paranoid':![],'indexes':[{'name':_0x52b5('0xd'),'fields':[_0x52b5('0xe'),_0x52b5('0xf')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfdcb=['../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a9459,_0x254c16){var _0x159350=function(_0x430864){while(--_0x430864){_0x1a9459['push'](_0x1a9459['shift']());}};_0x159350(++_0x254c16);}(_0xfdcb,0x134));var _0xbfdc=function(_0x22f82a,_0x36ea1d){_0x22f82a=_0x22f82a-0x0;var _0x3abd49=_0xfdcb[_0x22f82a];return _0x3abd49;};'use strict';var _=require(_0xbfdc('0x0'));var util=require(_0xbfdc('0x1'));var logger=require(_0xbfdc('0x2'))(_0xbfdc('0x3'));var moment=require(_0xbfdc('0x4'));var BPromise=require(_0xbfdc('0x5'));var rp=require(_0xbfdc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbfdc('0x7'));var attributes=require(_0xbfdc('0x8'));module[_0xbfdc('0x9')]=function(_0x499dc1,_0x29b7f2){return _0x499dc1[_0xbfdc('0xa')](_0xbfdc('0xb'),attributes,{'tableName':_0xbfdc('0xc'),'paranoid':![],'indexes':[{'name':_0xbfdc('0xd'),'fields':[_0xbfdc('0xe'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc3fe=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xc3fe,0xff));var _0xec3f=function(_0x5be58b,_0xdfeb83){_0x5be58b=_0x5be58b-0x0;var _0x50c17e=_0xc3fe[_0x5be58b];return _0x50c17e;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});}
\ No newline at end of file
+var _0xbc23=['error','message','info','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x4289ae,_0x3661f4){var _0x3aac36=function(_0x422ccf){while(--_0x422ccf){_0x4289ae['push'](_0x4289ae['shift']());}};_0x3aac36(++_0x3661f4);}(_0xbc23,0x1bd));var _0x3bc2=function(_0x31deb8,_0x5f25cf){_0x31deb8=_0x31deb8-0x0;var _0x6ac851=_0xbc23[_0x31deb8];return _0x6ac851;};'use strict';var _=require(_0x3bc2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3bc2('0x1'));var rs=require(_0x3bc2('0x2'));var fs=require('fs');var Redis=require(_0x3bc2('0x3'));var db=require(_0x3bc2('0x4'))['db'];var utils=require(_0x3bc2('0x5'));var logger=require(_0x3bc2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3bc2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5addfc,_0x12e582,_0x3d80ae){return new BPromise(function(_0x96349e,_0x115135){return client[_0x3bc2('0x8')](_0x5addfc,_0x3d80ae)[_0x3bc2('0x9')](function(_0x319b5d){logger['info'](_0x3bc2('0xa'),_0x12e582,'request\x20sent');logger[_0x3bc2('0xb')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x12e582,_0x3bc2('0xc'),JSON[_0x3bc2('0xd')](_0x319b5d));if(_0x319b5d[_0x3bc2('0xe')]){if(_0x319b5d[_0x3bc2('0xe')]['code']===0x1f4){logger[_0x3bc2('0xe')](_0x3bc2('0xa'),_0x12e582,_0x319b5d[_0x3bc2('0xe')][_0x3bc2('0xf')]);return _0x115135(_0x319b5d['error'][_0x3bc2('0xf')]);}logger['error'](_0x3bc2('0xa'),_0x12e582,_0x319b5d[_0x3bc2('0xe')]['message']);return _0x96349e(_0x319b5d[_0x3bc2('0xe')][_0x3bc2('0xf')]);}else{logger[_0x3bc2('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x12e582,_0x3bc2('0xc'));_0x96349e(_0x319b5d['result'][_0x3bc2('0xf')]);}})['catch'](function(_0x12b3c6){logger[_0x3bc2('0xe')](_0x3bc2('0xa'),_0x12e582,_0x12b3c6);_0x115135(_0x12b3c6);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe724=['./voiceRecording.controller','/describe','isAuthenticated','describe','/:id','show','get','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x120f54,_0x402107){var _0x2e6297=function(_0x1ca170){while(--_0x1ca170){_0x120f54['push'](_0x120f54['shift']());}};_0x2e6297(++_0x402107);}(_0xe724,0x160));var _0x4e72=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0xe724[_0x430f44];return _0x1f6b0f;};'use strict';var multer=require(_0x4e72('0x0'));var util=require(_0x4e72('0x1'));var path=require(_0x4e72('0x2'));var timeout=require(_0x4e72('0x3'));var express=require(_0x4e72('0x4'));var router=express[_0x4e72('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4e72('0x6'));var config=require(_0x4e72('0x7'));var controller=require(_0x4e72('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4e72('0x9'),auth[_0x4e72('0xa')](),controller[_0x4e72('0xb')]);router['get'](_0x4e72('0xc'),auth['isAuthenticated'](),controller[_0x4e72('0xd')]);router[_0x4e72('0xe')](_0x4e72('0xf'),auth[_0x4e72('0xa')](),controller[_0x4e72('0x10')]);router['get']('/:id/downloads',controller[_0x4e72('0x11')]);router['get'](_0x4e72('0x12'),auth[_0x4e72('0xa')](),controller[_0x4e72('0x13')]);router[_0x4e72('0x14')]('/',auth[_0x4e72('0xa')](),controller['create']);router['post'](_0x4e72('0x12'),auth[_0x4e72('0xa')](),controller[_0x4e72('0x15')]);router['put']('/:id',auth[_0x4e72('0xa')](),controller[_0x4e72('0x16')]);router['delete'](_0x4e72('0xc'),auth[_0x4e72('0xa')](),controller['destroy']);module[_0x4e72('0x17')]=router;
\ No newline at end of file
+var _0xbce6=['isAuthenticated','get','/describe','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1c93ef,_0x5d9955){var _0x760059=function(_0x4489c9){while(--_0x4489c9){_0x1c93ef['push'](_0x1c93ef['shift']());}};_0x760059(++_0x5d9955);}(_0xbce6,0x151));var _0x6bce=function(_0x5d3bf7,_0x140459){_0x5d3bf7=_0x5d3bf7-0x0;var _0xff5156=_0xbce6[_0x5d3bf7];return _0xff5156;};'use strict';var multer=require(_0x6bce('0x0'));var util=require(_0x6bce('0x1'));var path=require('path');var timeout=require(_0x6bce('0x2'));var express=require(_0x6bce('0x3'));var router=express[_0x6bce('0x4')]();var fs_extra=require(_0x6bce('0x5'));var auth=require(_0x6bce('0x6'));var interaction=require(_0x6bce('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x6bce('0x8')](),controller['index']);router[_0x6bce('0x9')](_0x6bce('0xa'),auth[_0x6bce('0x8')](),controller['describe']);router['get']('/:id',auth[_0x6bce('0x8')](),controller[_0x6bce('0xb')]);router['get'](_0x6bce('0xc'),auth[_0x6bce('0x8')](),controller[_0x6bce('0xd')]);router[_0x6bce('0x9')](_0x6bce('0xe'),controller[_0x6bce('0xf')]);router[_0x6bce('0x9')]('/:id/transcribe',auth[_0x6bce('0x8')](),controller[_0x6bce('0x10')]);router[_0x6bce('0x11')]('/',auth[_0x6bce('0x8')](),controller[_0x6bce('0x12')]);router[_0x6bce('0x11')](_0x6bce('0x13'),auth[_0x6bce('0x8')](),controller[_0x6bce('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6bce('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x6bce('0x16')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb083=['.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','name','send','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb083,0x1d0));var _0x3b08=function(_0x325d00,_0x58667e){_0x325d00=_0x325d00-0x0;var _0x105041=_0xb083[_0x325d00];return _0x105041;};'use strict';var emlformat=require(_0x3b08('0x0'));var rimraf=require(_0x3b08('0x1'));var zipdir=require(_0x3b08('0x2'));var jsonpatch=require(_0x3b08('0x3'));var rp=require('request-promise');var moment=require(_0x3b08('0x4'));var BPromise=require(_0x3b08('0x5'));var Mustache=require(_0x3b08('0x6'));var util=require(_0x3b08('0x7'));var path=require(_0x3b08('0x8'));var sox=require(_0x3b08('0x9'));var csv=require(_0x3b08('0xa'));var ejs=require(_0x3b08('0xb'));var fs=require('fs');var fs_extra=require(_0x3b08('0xc'));var _=require(_0x3b08('0xd'));var squel=require('squel');var crypto=require(_0x3b08('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3b08('0xf'));var toCsv=require(_0x3b08('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x3b08('0x10'));var uuidv4=require(_0x3b08('0x11'));var Redis=require(_0x3b08('0x12'));var authService=require(_0x3b08('0x13'));var qs=require(_0x3b08('0x14'));var as=require(_0x3b08('0x15'));var hardwareService=require(_0x3b08('0x16'));var logger=require(_0x3b08('0x17'))(_0x3b08('0x18'));var utils=require(_0x3b08('0x19'));var config=require(_0x3b08('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b08('0x1b'))['db'];function respondWithStatusCode(_0x274b4d,_0x36032b){_0x36032b=_0x36032b||0xcc;return function(_0x5396db){if(_0x5396db){return _0x274b4d[_0x3b08('0x1c')](_0x36032b);}return _0x274b4d[_0x3b08('0x1d')](_0x36032b)[_0x3b08('0x1e')]();};}function respondWithResult(_0x34cf4a,_0x90b72a){_0x90b72a=_0x90b72a||0xc8;return function(_0x2d1202){if(_0x2d1202){return _0x34cf4a[_0x3b08('0x1d')](_0x90b72a)[_0x3b08('0x1f')](_0x2d1202);}};}function respondWithFilteredResult(_0x1b799e,_0x9fa0eb){return function(_0x352e08){if(_0x352e08){var _0x15f31b=typeof _0x9fa0eb[_0x3b08('0x20')]===_0x3b08('0x21')&&typeof _0x9fa0eb['limit']===_0x3b08('0x21');var _0x567ac8=_0x352e08[_0x3b08('0x22')];var _0x1f0e53=_0x15f31b?0x0:_0x9fa0eb[_0x3b08('0x20')];var _0x3de63c=_0x15f31b?_0x352e08[_0x3b08('0x22')]:_0x9fa0eb['offset']+_0x9fa0eb[_0x3b08('0x23')];var _0x118932;if(_0x3de63c>=_0x567ac8){_0x3de63c=_0x567ac8;_0x118932=0xc8;}else{_0x118932=0xce;}_0x1b799e[_0x3b08('0x1d')](_0x118932);return _0x1b799e[_0x3b08('0x24')](_0x3b08('0x25'),_0x1f0e53+'-'+_0x3de63c+'/'+_0x567ac8)[_0x3b08('0x1f')](_0x352e08);}return null;};}function patchUpdates(_0x218dc6){return function(_0x425a3d){try{jsonpatch[_0x3b08('0x26')](_0x425a3d,_0x218dc6,!![]);}catch(_0x3b5194){return BPromise['reject'](_0x3b5194);}return _0x425a3d['save']();};}function saveUpdates(_0x23b51b,_0x3a9cd3){return function(_0x4d6b64){if(_0x4d6b64){return _0x4d6b64[_0x3b08('0x27')](_0x23b51b)[_0x3b08('0x28')](function(_0x8ec364){return _0x8ec364;});}return null;};}function removeEntity(_0x30f184,_0xe35955){return function(_0x44b8c9){if(_0x44b8c9){return _0x44b8c9[_0x3b08('0x29')]()[_0x3b08('0x28')](function(){_0x30f184[_0x3b08('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f162,_0x2bc85f){return function(_0x32c626){if(!_0x32c626){_0x23f162['sendStatus'](0x194);}return _0x32c626;};}function handleError(_0x242960,_0x1161b7){_0x1161b7=_0x1161b7||0x1f4;return function(_0x202cf4){logger['error'](_0x202cf4['stack']);if(_0x202cf4['name']){delete _0x202cf4[_0x3b08('0x2a')];}_0x242960[_0x3b08('0x1d')](_0x1161b7)[_0x3b08('0x2b')](_0x202cf4);};}exports['index']=function(_0x33ed28,_0x314c2b){var _0x5e550e={},_0x1a0763={},_0x2857e1={'count':0x0,'rows':[]};var _0x4c18de=_[_0x3b08('0x2c')](db[_0x3b08('0x2d')]['rawAttributes'],function(_0x1f6f08){return{'name':_0x1f6f08[_0x3b08('0x2e')],'type':_0x1f6f08[_0x3b08('0x2f')]['key']};});_0x1a0763[_0x3b08('0x30')]=_[_0x3b08('0x31')](_[_0x3b08('0x2c')](_0x4c18de,'name'),[_0x3b08('0x32')]);_0x1a0763[_0x3b08('0x33')]=_[_0x3b08('0x34')](_0x33ed28['query']);_0x1a0763['filters']=_[_0x3b08('0x35')](_0x1a0763[_0x3b08('0x30')],_0x1a0763[_0x3b08('0x33')]);_0x5e550e[_0x3b08('0x36')]=_[_0x3b08('0x35')](_0x1a0763['model'],qs['fields'](_0x33ed28[_0x3b08('0x33')][_0x3b08('0x37')]));_0x5e550e[_0x3b08('0x36')]=_0x5e550e['attributes'][_0x3b08('0x38')]?_0x5e550e[_0x3b08('0x36')]:_0x1a0763['model'];if(!_0x33ed28[_0x3b08('0x33')][_0x3b08('0x39')](_0x3b08('0x3a'))){_0x5e550e['limit']=qs[_0x3b08('0x23')](_0x33ed28[_0x3b08('0x33')][_0x3b08('0x23')]);_0x5e550e[_0x3b08('0x20')]=qs['offset'](_0x33ed28['query'][_0x3b08('0x20')]);}_0x5e550e[_0x3b08('0x3b')]=qs[_0x3b08('0x3c')](_0x33ed28['query'][_0x3b08('0x3c')]);_0x5e550e[_0x3b08('0x3d')]=qs['filters'](_[_0x3b08('0x3e')](_0x33ed28[_0x3b08('0x33')],_0x1a0763[_0x3b08('0x3f')]),_0x4c18de);if(_0x33ed28[_0x3b08('0x33')]['filter']){_0x5e550e[_0x3b08('0x3d')]=_[_0x3b08('0x40')](_0x5e550e[_0x3b08('0x3d')],{'$or':_[_0x3b08('0x2c')](_0x4c18de,function(_0x963112){if(_0x963112[_0x3b08('0x2f')]!==_0x3b08('0x41')){var _0x18892e={};_0x18892e[_0x963112[_0x3b08('0x2a')]]={'$like':'%'+_0x33ed28[_0x3b08('0x33')][_0x3b08('0x42')]+'%'};return _0x18892e;}})});}_0x5e550e=_[_0x3b08('0x40')]({},_0x5e550e,_0x33ed28[_0x3b08('0x43')]);var _0xc97a9d={'where':_0x5e550e[_0x3b08('0x3d')]};return db[_0x3b08('0x2d')][_0x3b08('0x22')](_0xc97a9d)[_0x3b08('0x28')](function(_0x225277){_0x2857e1[_0x3b08('0x22')]=_0x225277;if(_0x33ed28['query'][_0x3b08('0x44')]){_0x5e550e[_0x3b08('0x45')]=[{'all':!![]}];}return db['VoiceRecording'][_0x3b08('0x46')](_0x5e550e);})[_0x3b08('0x28')](function(_0x5b1d0a){_0x2857e1[_0x3b08('0x47')]=_0x5b1d0a;return _0x2857e1;})[_0x3b08('0x28')](respondWithFilteredResult(_0x314c2b,_0x5e550e))[_0x3b08('0x48')](handleError(_0x314c2b,null));};exports[_0x3b08('0x49')]=function(_0x47c02f,_0x3c79f8){var _0x5b7dcb={'raw':![],'where':{'id':_0x47c02f[_0x3b08('0x4a')]['id']}},_0x315235={};_0x315235['model']=_[_0x3b08('0x34')](db[_0x3b08('0x2d')]['rawAttributes']);_0x315235[_0x3b08('0x33')]=_[_0x3b08('0x34')](_0x47c02f[_0x3b08('0x33')]);_0x315235[_0x3b08('0x3f')]=_['intersection'](_0x315235['model'],_0x315235[_0x3b08('0x33')]);_0x5b7dcb[_0x3b08('0x36')]=_[_0x3b08('0x35')](_0x315235[_0x3b08('0x30')],qs['fields'](_0x47c02f[_0x3b08('0x33')][_0x3b08('0x37')]));_0x5b7dcb[_0x3b08('0x36')]=_0x5b7dcb[_0x3b08('0x36')][_0x3b08('0x38')]?_0x5b7dcb[_0x3b08('0x36')]:_0x315235[_0x3b08('0x30')];if(_0x47c02f[_0x3b08('0x33')][_0x3b08('0x44')]){_0x5b7dcb[_0x3b08('0x45')]=[{'all':!![]}];}_0x5b7dcb=_[_0x3b08('0x40')]({},_0x5b7dcb,_0x47c02f[_0x3b08('0x43')]);return db[_0x3b08('0x2d')]['find'](_0x5b7dcb)[_0x3b08('0x28')](handleEntityNotFound(_0x3c79f8,null))[_0x3b08('0x28')](respondWithResult(_0x3c79f8,null))[_0x3b08('0x48')](handleError(_0x3c79f8,null));};exports[_0x3b08('0x4b')]=function(_0x5e13f7,_0x3daf8f){return db['VoiceRecording'][_0x3b08('0x4b')](_0x5e13f7[_0x3b08('0x4c')],{})[_0x3b08('0x28')](respondWithResult(_0x3daf8f,0xc9))[_0x3b08('0x48')](handleError(_0x3daf8f,null));};exports['update']=function(_0x409c7c,_0x1bbe43){if(_0x409c7c[_0x3b08('0x4c')]['id']){delete _0x409c7c[_0x3b08('0x4c')]['id'];}return db[_0x3b08('0x2d')][_0x3b08('0x4d')]({'where':{'id':_0x409c7c[_0x3b08('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bbe43,null))[_0x3b08('0x28')](saveUpdates(_0x409c7c[_0x3b08('0x4c')],null))[_0x3b08('0x28')](respondWithResult(_0x1bbe43,null))[_0x3b08('0x48')](handleError(_0x1bbe43,null));};exports['describe']=function(_0x26a6c9,_0x3d9083){return db[_0x3b08('0x2d')][_0x3b08('0x4e')]()['then'](respondWithResult(_0x3d9083,null))[_0x3b08('0x48')](handleError(_0x3d9083,null));};exports[_0x3b08('0x4f')]=function(_0x2d86b8,_0x27610d,_0x1fe6b3){var _0x2fbce3=require(_0x3b08('0x50'));var _0x1a8fcf=![];var _0xf7975e={};if(_0x2d86b8[_0x3b08('0x33')][_0x3b08('0x2f')]&&_0x2d86b8[_0x3b08('0x33')]['type']===_0x3b08('0x51')){_0xf7975e[_0x3b08('0x51')]=_0x2d86b8['params']['id'];}else{_0xf7975e['id']=_0x2d86b8[_0x3b08('0x4a')]['id'];}return db[_0x3b08('0x2d')]['find']({'where':_0xf7975e,'attributes':['id','value'],'raw':!![]})[_0x3b08('0x28')](handleEntityNotFound(_0x27610d,null))[_0x3b08('0x28')](function(_0x32792d){if(_0x32792d){var _0x4b4c25=_0x32792d[_0x3b08('0x52')];var _0x5f3092=util[_0x3b08('0x32')](_0x3b08('0x53'),_0x4b4c25);if(fs[_0x3b08('0x54')](_0x5f3092)){_0x1a8fcf=!![];return _0x2fbce3[_0x3b08('0x55')](_0x5f3092,_0x4b4c25,config['secrets'][_0x3b08('0x56')])['then'](function(){return _0x32792d;});}return _0x32792d;}})[_0x3b08('0x28')](function(_0x35e5e2){if(_0x35e5e2){var _0x3e1626=_0x35e5e2[_0x3b08('0x52')];if(!fs['existsSync'](_0x3e1626)){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x59'));}if(_0x35e5e2[_0x3b08('0x5a')]){return _0x27610d['download'](_0x3e1626,_0x35e5e2[_0x3b08('0x5a')]+path[_0x3b08('0x5b')](_0x3e1626),function(){if(_0x1a8fcf){fs[_0x3b08('0x5c')](_0x3e1626);}});}else{return _0x27610d[_0x3b08('0x4f')](_0x3e1626,function(_0x56d314){if(_0x1a8fcf){fs[_0x3b08('0x5c')](_0x3e1626);}});}}})['catch'](function(_0x51ebb3){if(_0x51ebb3[_0x3b08('0x5d')]===_0x3b08('0x59')){_0x27610d['status'](0x194)[_0x3b08('0x2b')](_0x3b08('0x5e'));}else{return handleError(_0x27610d,null);}});};exports[_0x3b08('0x5f')]=function(_0x2d6846,_0xdca5eb,_0x4ce55f){var _0x4ffb9e=require(_0x3b08('0x50'));var _0x34aa54=![];var _0x1cdc88={'$and':[db[_0x3b08('0x60')][_0x3b08('0x3d')](db[_0x3b08('0x60')]['fn'](_0x3b08('0x61'),db['sequelize'][_0x3b08('0x62')]('uniqueid')),_0x2d6846[_0x3b08('0x33')][_0x3b08('0x63')])]};if(_0x2d6846['query'][_0x3b08('0x2f')]&&_0x2d6846[_0x3b08('0x33')][_0x3b08('0x2f')]===_0x3b08('0x51')){_0x1cdc88[_0x3b08('0x64')]['push']({'uniqueid':_0x2d6846['params']['id']});}else{_0x1cdc88[_0x3b08('0x64')][_0x3b08('0x65')]({'id':_0x2d6846[_0x3b08('0x4a')]['id']});}return db[_0x3b08('0x2d')]['find']({'where':_0x1cdc88,'attributes':['id',_0x3b08('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0xdca5eb,null))[_0x3b08('0x28')](function(_0xe462f8){if(_0xe462f8){var _0x5836ca=util[_0x3b08('0x32')](_0x3b08('0x53'),_0xe462f8[_0x3b08('0x52')]);if(fs[_0x3b08('0x54')](_0x5836ca)){_0x34aa54=!![];return _0x4ffb9e[_0x3b08('0x55')](_0x5836ca,_0xe462f8['value'],config['secrets'][_0x3b08('0x56')])['then'](function(){return _0xe462f8;});}return _0xe462f8;}})[_0x3b08('0x28')](function(_0x2bb663){if(_0x2bb663){if(!fs['existsSync'](_0x2bb663[_0x3b08('0x52')])){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x59'));}if(_0x2bb663[_0x3b08('0x5a')]){return _0xdca5eb[_0x3b08('0x4f')](_0x2bb663[_0x3b08('0x52')],_0x2bb663[_0x3b08('0x5a')]+path['extname'](_0x2bb663['value']),function(){if(_0x34aa54){fs[_0x3b08('0x5c')](_0x2bb663[_0x3b08('0x52')]);}});}else{return _0xdca5eb[_0x3b08('0x4f')](_0x2bb663[_0x3b08('0x52')],function(_0x3fc742){if(_0x34aa54){fs[_0x3b08('0x5c')](_0x2bb663['value']);}});}}})[_0x3b08('0x48')](handleError(_0xdca5eb,null));};exports[_0x3b08('0x29')]=function(_0x55d249,_0x3f65da){return db[_0x3b08('0x2d')][_0x3b08('0x4d')]({'where':{'id':_0x55d249['params']['id']}})[_0x3b08('0x28')](function(_0x5ccd59){if(_[_0x3b08('0x66')](_0x5ccd59)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5ccd59;})[_0x3b08('0x28')](function(_0x5c9f78){var _0x3fa0f5=_0x5c9f78[_0x3b08('0x52')];logger['info'](_0x3b08('0x67'),_0x3fa0f5);if(!_[_0x3b08('0x66')](_0x5c9f78[_0x3b08('0x52')])&&fs['existsSync'](_0x3fa0f5)){logger[_0x3b08('0x68')](_0x3b08('0x69')+_0x3fa0f5+_0x3b08('0x6a'));fs[_0x3b08('0x6b')](_0x3fa0f5);}_0x3fa0f5=_0x3fa0f5+'.cypher';if(!_[_0x3b08('0x66')](_0x5c9f78['value'])&&fs[_0x3b08('0x54')](_0x3fa0f5)){logger['info'](_0x3b08('0x69')+_0x3fa0f5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3b08('0x6b')](_0x3fa0f5);}return _0x5c9f78;})[_0x3b08('0x28')](function(_0x5d7e60){if(!_0x5d7e60)throw new InternalError();return _0x5d7e60[_0x3b08('0x29')]();})[_0x3b08('0x28')](function(){_0x3f65da['status'](0xcc)[_0x3b08('0x1e')]();})['catch'](handleError(_0x3f65da,null));};function getBucketslist(_0x54c9c6,_0x57bc38,_0x33ebcb){return new Promise(function(_0x45680b,_0x3f2ff3){var _0x42161a=new AWS['S3']({'accessKeyId':_0x57bc38,'secretAccessKey':_0x54c9c6,'region':_0x33ebcb});_0x42161a[_0x3b08('0x6c')]({},function(_0x383ac9,_0x1c4b22){if(_0x383ac9){return _0x3f2ff3(_0x383ac9);}else{return _0x45680b(_0x1c4b22);}});});}function createBucket(_0x34f4e3,_0x432f65,_0x4f5f7c,_0x3155f6){return new Promise(function(_0x2bd5b6,_0x2ff8cf){var _0x3e2510=new AWS['S3']({'accessKeyId':_0x432f65,'secretAccessKey':_0x34f4e3,'region':_0x4f5f7c});_0x3e2510['createBucket']({'Bucket':_0x3155f6},function(_0x390bdf,_0x58c601){if(_0x390bdf){return _0x2ff8cf(_0x390bdf);}else{return _0x2bd5b6(_0x58c601);}});});}function uploadFile(_0x887cbf,_0x487096,_0x1d0dd2,_0x585917,_0x4771e3,_0x30233c){return new Promise(function(_0x3ac91d,_0x4280ed){var _0x2ffe35=new AWS['S3']({'accessKeyId':_0x487096,'secretAccessKey':_0x887cbf,'region':_0x1d0dd2});_0x2ffe35['upload']({'Bucket':_0x585917,'Key':_0x4771e3,'Body':_0x30233c},function(_0x2d459d,_0x14a936){if(_0x2d459d){return _0x4280ed(_0x2d459d);}else{return _0x3ac91d(_0x14a936);}});});}function startTranscribe(_0x3bde3f,_0x434d61,_0x2e8edb,_0x18ebc2,_0x1bf077,_0x4dc971){return new Promise(function(_0x253c90,_0x134964){var _0x5d7c33=new AWS['TranscribeService']({'accessKeyId':_0x434d61,'secretAccessKey':_0x3bde3f,'region':_0x2e8edb});_0x5d7c33[_0x3b08('0x6d')]({'TranscriptionJobName':_0x18ebc2,'LanguageCode':_0x1bf077,'Media':{'MediaFileUri':_0x4dc971}},function(_0x3e66ca,_0x2a4473){if(_0x3e66ca){return _0x134964(_0x3e66ca);}else{return _0x253c90(_0x2a4473);}});});}function transcribe(_0x3b3ecd,_0x50c738,_0x4eb762,_0x59171c,_0x2aa584,_0x5151d9,_0xd6c6b1){return new Promise(function(_0x23ab1a,_0x8e5531){var _0x12756f={};logger[_0x3b08('0x68')](util['format'](_0x3b08('0x6e'),_0x3b3ecd,_0x2aa584));return uploadFile(_0x50c738,_0x4eb762,_0x59171c,_0x2aa584,path[_0x3b08('0x6f')](_0x5151d9),fs[_0x3b08('0x70')](_0x5151d9))[_0x3b08('0x28')](function(_0x3f8c1b){logger['info'](util[_0x3b08('0x32')](_0x3b08('0x71'),_0x3b3ecd,_0x2aa584,_0x3f8c1b[_0x3b08('0x72')]));_0x12756f[_0x3b08('0x73')]=_0x3f8c1b['Bucket'];_0x12756f[_0x3b08('0x74')]=_0x3f8c1b[_0x3b08('0x72')];logger[_0x3b08('0x68')](util['format'](_0x3b08('0x75'),_0x3b3ecd));return startTranscribe(_0x50c738,_0x4eb762,_0x59171c,uuidv4(),_0xd6c6b1,_0x3f8c1b[_0x3b08('0x72')]);})[_0x3b08('0x28')](function(_0x26ac7e){logger['info'](util['format'](_0x3b08('0x76'),_0x3b3ecd,_0x26ac7e[_0x3b08('0x77')][_0x3b08('0x78')]));_0x12756f[_0x3b08('0x79')]=_0x26ac7e[_0x3b08('0x77')]['TranscriptionJobName'];_0x12756f[_0x3b08('0x7a')]=_0x26ac7e[_0x3b08('0x77')][_0x3b08('0x7b')];return _0x23ab1a(_0x12756f);})[_0x3b08('0x48')](function(_0x8e0545){return _0x8e5531(_0x8e0545);});});}exports['runTranscribe']=function(_0x57ceaf,_0x379fc7,_0x5d745a){var _0x225be4;var _0x1c518a;var _0x18511a;var _0x2d851f=require(_0x3b08('0x50'));return db[_0x3b08('0x2d')][_0x3b08('0x7c')]({'where':{'id':_0x57ceaf[_0x3b08('0x4a')]['id']}})[_0x3b08('0x28')](function(_0x2f7d2d){if(_0x2f7d2d){var _0x221fcb=util[_0x3b08('0x32')](_0x3b08('0x53'),_0x2f7d2d[_0x3b08('0x52')]);if(fs[_0x3b08('0x54')](_0x221fcb)){cypher=!![];return _0x2d851f[_0x3b08('0x55')](_0x221fcb,_0x2f7d2d['value'],config['secrets']['recording'])[_0x3b08('0x28')](function(){return _0x2f7d2d;});}return _0x2f7d2d;}})['then'](function(_0x10dc44){if(!_0x10dc44){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x7d'));}_0x1c518a=_0x10dc44;return db[_0x3b08('0x7e')][_0x3b08('0x7c')]({'where':{'id':0x1}});})[_0x3b08('0x28')](handleEntityNotFound(_0x379fc7,null))[_0x3b08('0x28')](function(_0x179649){if(_0x179649){_0x225be4=_0x179649;if(!_0x225be4[_0x3b08('0x7f')]||!_0x225be4[_0x3b08('0x80')]||!_0x225be4[_0x3b08('0x81')]||!_0x225be4[_0x3b08('0x82')]||!_0x225be4['bucket']){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x83'));}if(_0x57ceaf[_0x3b08('0x4c')][_0x3b08('0x84')]&&(!_0x225be4[_0x3b08('0x85')]||!_0x225be4[_0x3b08('0x86')]||!_0x225be4['sentimentRegion']||!_0x225be4['language']||!_0x225be4['bucket'])){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x87'));}return db[_0x3b08('0x88')][_0x3b08('0x7c')]({'where':{'id':_0x225be4[_0x3b08('0x80')]}});}})[_0x3b08('0x28')](function(_0x4115e1){if(!_0x4115e1){throw new db[(_0x3b08('0x57'))][(_0x3b08('0x58'))](_0x3b08('0x89'));}if(!_0x4115e1[_0x3b08('0x8a')]||!_0x4115e1['data2']){throw new db[(_0x3b08('0x57'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x18511a=_0x4115e1;return getBucketslist(_0x18511a[_0x3b08('0x8a')],_0x18511a[_0x3b08('0x8b')],_0x225be4['transcribeRegion']);})[_0x3b08('0x28')](function(_0x51d629){if(_0x51d629&&_0x51d629['Buckets']){var _0xaf5b06=_[_0x3b08('0x4d')](_0x51d629[_0x3b08('0x8c')],function(_0xad9358){return _0xad9358[_0x3b08('0x8d')]===_0x225be4[_0x3b08('0x73')];});if(!_0xaf5b06){logger[_0x3b08('0x68')](util[_0x3b08('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x57ceaf[_0x3b08('0x4a')]['id'],_0x225be4[_0x3b08('0x73')]));return createBucket(_0x18511a[_0x3b08('0x8a')],_0x18511a['data2'],_0x225be4[_0x3b08('0x81')],_0x225be4[_0x3b08('0x73')]);}logger[_0x3b08('0x68')](util[_0x3b08('0x32')](_0x3b08('0x8e'),_0x57ceaf[_0x3b08('0x4a')]['id'],_0x225be4['bucket']));return;}})[_0x3b08('0x28')](function(_0x489ab7){if(_0x1c518a[_0x3b08('0x7a')]===_0x3b08('0x8f')){return transcribe(_0x57ceaf['params']['id'],_0x18511a[_0x3b08('0x8a')],_0x18511a[_0x3b08('0x8b')],_0x225be4[_0x3b08('0x81')],_0x225be4['bucket'],_0x1c518a['value'],_0x225be4[_0x3b08('0x82')]);}else{logger[_0x3b08('0x68')](util[_0x3b08('0x32')](_0x3b08('0x90'),_0x57ceaf[_0x3b08('0x4a')]['id']));return{'transcribeStatus':_0x3b08('0x91')};}})['then'](function(_0x4ad010){if(_0x4ad010){_0x4ad010['tempSentiment']=_0x57ceaf[_0x3b08('0x4c')][_0x3b08('0x84')];return _0x1c518a[_0x3b08('0x92')](_0x4ad010);}})[_0x3b08('0x28')](respondWithResult(_0x379fc7,null))['catch'](handleError(_0x379fc7,null));};function writeFile(_0xe19df2,_0x26009d){return new Promise(function(_0x1c778b,_0x412f7a){fs[_0x3b08('0x93')](_0x26009d,_0xe19df2,function(_0x7b0572,_0x4312e4){if(_0x7b0572){return _0x412f7a(_0x7b0572);}else{return _0x1c778b(_0x4312e4);}});});}exports[_0x3b08('0x94')]=function(_0x584ca5,_0x81d96,_0x5d0374){return db['VoiceRecording'][_0x3b08('0x7c')]({'where':{'id':_0x584ca5[_0x3b08('0x4a')]['id']}})[_0x3b08('0x28')](handleEntityNotFound(_0x81d96))[_0x3b08('0x28')](function(_0x29e401){if(_0x29e401&&_0x29e401['fileText']){var _0x539eb3=_0x29e401[_0x3b08('0x95')];var _0x45e2cb=config[_0x3b08('0x96')]+_0x3b08('0x97')+_0x29e401['id']+_0x3b08('0x98');if(fs[_0x3b08('0x54')](_0x45e2cb)){return _0x45e2cb;}return writeFile(_0x539eb3,_0x45e2cb)[_0x3b08('0x28')](function(){return _0x45e2cb;});}else{throw new db['Sequelize'][(_0x3b08('0x58'))](_0x3b08('0x99'));}})[_0x3b08('0x28')](function(_0x20992f){return _0x81d96[_0x3b08('0x4f')](_0x20992f);})[_0x3b08('0x48')](handleError(_0x81d96));};
\ No newline at end of file
+var _0xe379=['Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','send','index','map','VoiceRecording','type','model','differenceBy','name','format','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','fields','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','sequelize','MD5','col','token','$and','push','ValidationError','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeRegion','language','sentimentAccountId','sentimentRegion'];(function(_0x2b7584,_0x13431f){var _0x116e53=function(_0x46e61f){while(--_0x46e61f){_0x2b7584['push'](_0x2b7584['shift']());}};_0x116e53(++_0x13431f);}(_0xe379,0xa6));var _0x9e37=function(_0x51182f,_0x14a54f){_0x51182f=_0x51182f-0x0;var _0x406c6c=_0xe379[_0x51182f];return _0x406c6c;};'use strict';var emlformat=require(_0x9e37('0x0'));var rimraf=require(_0x9e37('0x1'));var zipdir=require(_0x9e37('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e37('0x3'));var moment=require('moment');var BPromise=require(_0x9e37('0x4'));var Mustache=require('mustache');var util=require(_0x9e37('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9e37('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e37('0x7'));var _=require(_0x9e37('0x8'));var squel=require(_0x9e37('0x9'));var crypto=require(_0x9e37('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9e37('0x6'));var querystring=require(_0x9e37('0xb'));var Papa=require(_0x9e37('0xc'));var AWS=require(_0x9e37('0xd'));var uuidv4=require(_0x9e37('0xe'));var Redis=require(_0x9e37('0xf'));var authService=require(_0x9e37('0x10'));var qs=require(_0x9e37('0x11'));var as=require(_0x9e37('0x12'));var hardwareService=require(_0x9e37('0x13'));var logger=require(_0x9e37('0x14'))('api');var utils=require(_0x9e37('0x15'));var config=require(_0x9e37('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e37('0x17'))['db'];function respondWithStatusCode(_0x407785,_0x21ac00){_0x21ac00=_0x21ac00||0xcc;return function(_0x437967){if(_0x437967){return _0x407785['sendStatus'](_0x21ac00);}return _0x407785[_0x9e37('0x18')](_0x21ac00)[_0x9e37('0x19')]();};}function respondWithResult(_0x498783,_0x1d7ffd){_0x1d7ffd=_0x1d7ffd||0xc8;return function(_0x224e0a){if(_0x224e0a){return _0x498783[_0x9e37('0x18')](_0x1d7ffd)[_0x9e37('0x1a')](_0x224e0a);}};}function respondWithFilteredResult(_0x16caae,_0x286311){return function(_0x2c03e){if(_0x2c03e){var _0x403459=typeof _0x286311[_0x9e37('0x1b')]==='undefined'&&typeof _0x286311[_0x9e37('0x1c')]===_0x9e37('0x1d');var _0x70e4a7=_0x2c03e[_0x9e37('0x1e')];var _0x5f5504=_0x403459?0x0:_0x286311['offset'];var _0x24cd03=_0x403459?_0x2c03e[_0x9e37('0x1e')]:_0x286311[_0x9e37('0x1b')]+_0x286311['limit'];var _0xb2adfe;if(_0x24cd03>=_0x70e4a7){_0x24cd03=_0x70e4a7;_0xb2adfe=0xc8;}else{_0xb2adfe=0xce;}_0x16caae[_0x9e37('0x18')](_0xb2adfe);return _0x16caae['set'](_0x9e37('0x1f'),_0x5f5504+'-'+_0x24cd03+'/'+_0x70e4a7)[_0x9e37('0x1a')](_0x2c03e);}return null;};}function patchUpdates(_0x5522c0){return function(_0x5b1a71){try{jsonpatch[_0x9e37('0x20')](_0x5b1a71,_0x5522c0,!![]);}catch(_0x4402aa){return BPromise[_0x9e37('0x21')](_0x4402aa);}return _0x5b1a71['save']();};}function saveUpdates(_0x409175,_0x1795f6){return function(_0x1f4fb9){if(_0x1f4fb9){return _0x1f4fb9[_0x9e37('0x22')](_0x409175)['then'](function(_0x6988fc){return _0x6988fc;});}return null;};}function removeEntity(_0x26d34d,_0x1ea118){return function(_0x54f617){if(_0x54f617){return _0x54f617[_0x9e37('0x23')]()[_0x9e37('0x24')](function(){_0x26d34d[_0x9e37('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1971b9,_0x102ae6){return function(_0xeefa68){if(!_0xeefa68){_0x1971b9[_0x9e37('0x25')](0x194);}return _0xeefa68;};}function handleError(_0x9e0f6f,_0x293fca){_0x293fca=_0x293fca||0x1f4;return function(_0x55ae23){logger['error'](_0x55ae23[_0x9e37('0x26')]);if(_0x55ae23['name']){delete _0x55ae23['name'];}_0x9e0f6f['status'](_0x293fca)[_0x9e37('0x27')](_0x55ae23);};}exports[_0x9e37('0x28')]=function(_0x5eb616,_0x5055e5){var _0x1baec6={},_0x267254={},_0x49b8e5={'count':0x0,'rows':[]};var _0x2d098a=_[_0x9e37('0x29')](db[_0x9e37('0x2a')]['rawAttributes'],function(_0x4ac264){return{'name':_0x4ac264['fieldName'],'type':_0x4ac264[_0x9e37('0x2b')]['key']};});_0x267254[_0x9e37('0x2c')]=_[_0x9e37('0x2d')](_[_0x9e37('0x29')](_0x2d098a,_0x9e37('0x2e')),[_0x9e37('0x2f')]);_0x267254[_0x9e37('0x30')]=_['keys'](_0x5eb616['query']);_0x267254[_0x9e37('0x31')]=_['intersection'](_0x267254['model'],_0x267254[_0x9e37('0x30')]);_0x1baec6['attributes']=_[_0x9e37('0x32')](_0x267254[_0x9e37('0x2c')],qs['fields'](_0x5eb616[_0x9e37('0x30')]['fields']));_0x1baec6[_0x9e37('0x33')]=_0x1baec6[_0x9e37('0x33')]['length']?_0x1baec6[_0x9e37('0x33')]:_0x267254['model'];if(!_0x5eb616['query'][_0x9e37('0x34')](_0x9e37('0x35'))){_0x1baec6[_0x9e37('0x1c')]=qs['limit'](_0x5eb616[_0x9e37('0x30')][_0x9e37('0x1c')]);_0x1baec6[_0x9e37('0x1b')]=qs[_0x9e37('0x1b')](_0x5eb616['query'][_0x9e37('0x1b')]);}_0x1baec6[_0x9e37('0x36')]=qs[_0x9e37('0x37')](_0x5eb616[_0x9e37('0x30')][_0x9e37('0x37')]);_0x1baec6[_0x9e37('0x38')]=qs[_0x9e37('0x31')](_[_0x9e37('0x39')](_0x5eb616[_0x9e37('0x30')],_0x267254[_0x9e37('0x31')]),_0x2d098a);if(_0x5eb616[_0x9e37('0x30')][_0x9e37('0x3a')]){_0x1baec6[_0x9e37('0x38')]=_[_0x9e37('0x3b')](_0x1baec6[_0x9e37('0x38')],{'$or':_[_0x9e37('0x29')](_0x2d098a,function(_0x2f8456){if(_0x2f8456[_0x9e37('0x2b')]!==_0x9e37('0x3c')){var _0x1a47c1={};_0x1a47c1[_0x2f8456[_0x9e37('0x2e')]]={'$like':'%'+_0x5eb616['query']['filter']+'%'};return _0x1a47c1;}})});}_0x1baec6=_[_0x9e37('0x3b')]({},_0x1baec6,_0x5eb616[_0x9e37('0x3d')]);var _0x1f2bce={'where':_0x1baec6[_0x9e37('0x38')]};return db['VoiceRecording'][_0x9e37('0x1e')](_0x1f2bce)[_0x9e37('0x24')](function(_0xcc0264){_0x49b8e5[_0x9e37('0x1e')]=_0xcc0264;if(_0x5eb616['query'][_0x9e37('0x3e')]){_0x1baec6[_0x9e37('0x3f')]=[{'all':!![]}];}return db[_0x9e37('0x2a')][_0x9e37('0x40')](_0x1baec6);})[_0x9e37('0x24')](function(_0x32a722){_0x49b8e5[_0x9e37('0x41')]=_0x32a722;return _0x49b8e5;})[_0x9e37('0x24')](respondWithFilteredResult(_0x5055e5,_0x1baec6))['catch'](handleError(_0x5055e5,null));};exports[_0x9e37('0x42')]=function(_0x58a271,_0x52c45a){var _0x5b6a27={'raw':![],'where':{'id':_0x58a271[_0x9e37('0x43')]['id']}},_0x410e06={};_0x410e06[_0x9e37('0x2c')]=_['keys'](db[_0x9e37('0x2a')]['rawAttributes']);_0x410e06[_0x9e37('0x30')]=_[_0x9e37('0x44')](_0x58a271[_0x9e37('0x30')]);_0x410e06[_0x9e37('0x31')]=_[_0x9e37('0x32')](_0x410e06[_0x9e37('0x2c')],_0x410e06['query']);_0x5b6a27[_0x9e37('0x33')]=_[_0x9e37('0x32')](_0x410e06[_0x9e37('0x2c')],qs[_0x9e37('0x45')](_0x58a271[_0x9e37('0x30')]['fields']));_0x5b6a27[_0x9e37('0x33')]=_0x5b6a27[_0x9e37('0x33')]['length']?_0x5b6a27[_0x9e37('0x33')]:_0x410e06[_0x9e37('0x2c')];if(_0x58a271[_0x9e37('0x30')][_0x9e37('0x3e')]){_0x5b6a27[_0x9e37('0x3f')]=[{'all':!![]}];}_0x5b6a27=_[_0x9e37('0x3b')]({},_0x5b6a27,_0x58a271[_0x9e37('0x3d')]);return db[_0x9e37('0x2a')][_0x9e37('0x46')](_0x5b6a27)[_0x9e37('0x24')](handleEntityNotFound(_0x52c45a,null))[_0x9e37('0x24')](respondWithResult(_0x52c45a,null))[_0x9e37('0x47')](handleError(_0x52c45a,null));};exports[_0x9e37('0x48')]=function(_0x50fa0c,_0x5f12ef){return db[_0x9e37('0x2a')]['create'](_0x50fa0c[_0x9e37('0x49')],{})[_0x9e37('0x24')](respondWithResult(_0x5f12ef,0xc9))[_0x9e37('0x47')](handleError(_0x5f12ef,null));};exports[_0x9e37('0x22')]=function(_0x3ef4f5,_0xa536b6){if(_0x3ef4f5[_0x9e37('0x49')]['id']){delete _0x3ef4f5[_0x9e37('0x49')]['id'];}return db[_0x9e37('0x2a')][_0x9e37('0x46')]({'where':{'id':_0x3ef4f5[_0x9e37('0x43')]['id']}})[_0x9e37('0x24')](handleEntityNotFound(_0xa536b6,null))[_0x9e37('0x24')](saveUpdates(_0x3ef4f5['body'],null))[_0x9e37('0x24')](respondWithResult(_0xa536b6,null))[_0x9e37('0x47')](handleError(_0xa536b6,null));};exports[_0x9e37('0x4a')]=function(_0x1a8386,_0x45daf9){return db['VoiceRecording'][_0x9e37('0x4a')]()[_0x9e37('0x24')](respondWithResult(_0x45daf9,null))[_0x9e37('0x47')](handleError(_0x45daf9,null));};exports[_0x9e37('0x4b')]=function(_0x5b9450,_0x64197f,_0x95190b){var _0x542c89=require(_0x9e37('0x4c'));var _0x1c883c=![];var _0x3f64aa={};if(_0x5b9450[_0x9e37('0x30')]['type']&&_0x5b9450[_0x9e37('0x30')]['type']==='uniqueid'){_0x3f64aa[_0x9e37('0x4d')]=_0x5b9450[_0x9e37('0x43')]['id'];}else{_0x3f64aa['id']=_0x5b9450['params']['id'];}return db[_0x9e37('0x2a')][_0x9e37('0x46')]({'where':_0x3f64aa,'attributes':['id',_0x9e37('0x4e')],'raw':!![]})[_0x9e37('0x24')](handleEntityNotFound(_0x64197f,null))[_0x9e37('0x24')](function(_0xfe6d60){if(_0xfe6d60){var _0x5f3b80=_0xfe6d60[_0x9e37('0x4e')];var _0x31757f=util[_0x9e37('0x2f')](_0x9e37('0x4f'),_0x5f3b80);if(fs[_0x9e37('0x50')](_0x31757f)){_0x1c883c=!![];return _0x542c89[_0x9e37('0x51')](_0x31757f,_0x5f3b80,config[_0x9e37('0x52')][_0x9e37('0x53')])['then'](function(){return _0xfe6d60;});}return _0xfe6d60;}})[_0x9e37('0x24')](function(_0x1b6ea5){if(_0x1b6ea5){var _0x1b1b83=_0x1b6ea5[_0x9e37('0x4e')];if(!fs[_0x9e37('0x50')](_0x1b1b83)){throw new db[(_0x9e37('0x54'))]['ValidationError'](_0x9e37('0x55'));}if(_0x1b6ea5['filename']){return _0x64197f[_0x9e37('0x4b')](_0x1b1b83,_0x1b6ea5[_0x9e37('0x56')]+path[_0x9e37('0x57')](_0x1b1b83),function(){if(_0x1c883c){fs[_0x9e37('0x58')](_0x1b1b83);}});}else{return _0x64197f['download'](_0x1b1b83,function(_0x38161b){if(_0x1c883c){fs[_0x9e37('0x58')](_0x1b1b83);}});}}})[_0x9e37('0x47')](function(_0xb6f749){if(_0xb6f749['message']==='VoiceRecording\x20not\x20found'){_0x64197f[_0x9e37('0x18')](0x194)[_0x9e37('0x27')](_0x9e37('0x59'));}else{return handleError(_0x64197f,null);}});};exports['downloads']=function(_0xba40f7,_0x25a887,_0x2d4030){var _0x5623af=require(_0x9e37('0x4c'));var _0x7562ee=![];var _0xe89ed4={'$and':[db['sequelize'][_0x9e37('0x38')](db[_0x9e37('0x5a')]['fn'](_0x9e37('0x5b'),db[_0x9e37('0x5a')][_0x9e37('0x5c')]('uniqueid')),_0xba40f7['query'][_0x9e37('0x5d')])]};if(_0xba40f7[_0x9e37('0x30')][_0x9e37('0x2b')]&&_0xba40f7[_0x9e37('0x30')][_0x9e37('0x2b')]===_0x9e37('0x4d')){_0xe89ed4[_0x9e37('0x5e')][_0x9e37('0x5f')]({'uniqueid':_0xba40f7[_0x9e37('0x43')]['id']});}else{_0xe89ed4[_0x9e37('0x5e')][_0x9e37('0x5f')]({'id':_0xba40f7[_0x9e37('0x43')]['id']});}return db[_0x9e37('0x2a')][_0x9e37('0x46')]({'where':_0xe89ed4,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x25a887,null))['then'](function(_0x70c70d){if(_0x70c70d){var _0x5df1f4=util[_0x9e37('0x2f')](_0x9e37('0x4f'),_0x70c70d[_0x9e37('0x4e')]);if(fs[_0x9e37('0x50')](_0x5df1f4)){_0x7562ee=!![];return _0x5623af[_0x9e37('0x51')](_0x5df1f4,_0x70c70d[_0x9e37('0x4e')],config['secrets'][_0x9e37('0x53')])['then'](function(){return _0x70c70d;});}return _0x70c70d;}})[_0x9e37('0x24')](function(_0x2b0735){if(_0x2b0735){if(!fs[_0x9e37('0x50')](_0x2b0735[_0x9e37('0x4e')])){throw new db[(_0x9e37('0x54'))][(_0x9e37('0x60'))](_0x9e37('0x55'));}if(_0x2b0735[_0x9e37('0x56')]){return _0x25a887[_0x9e37('0x4b')](_0x2b0735[_0x9e37('0x4e')],_0x2b0735[_0x9e37('0x56')]+path[_0x9e37('0x57')](_0x2b0735[_0x9e37('0x4e')]),function(){if(_0x7562ee){fs['unlink'](_0x2b0735[_0x9e37('0x4e')]);}});}else{return _0x25a887[_0x9e37('0x4b')](_0x2b0735[_0x9e37('0x4e')],function(_0x808b05){if(_0x7562ee){fs[_0x9e37('0x58')](_0x2b0735[_0x9e37('0x4e')]);}});}}})[_0x9e37('0x47')](handleError(_0x25a887,null));};exports[_0x9e37('0x23')]=function(_0x15d4d4,_0x18fb91){return db[_0x9e37('0x2a')]['find']({'where':{'id':_0x15d4d4['params']['id']}})[_0x9e37('0x24')](function(_0x3bedf9){if(_[_0x9e37('0x61')](_0x3bedf9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bedf9;})['then'](function(_0x1ef39f){var _0x289b1d=_0x1ef39f[_0x9e37('0x4e')];logger[_0x9e37('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x289b1d);if(!_['isNil'](_0x1ef39f[_0x9e37('0x4e')])&&fs[_0x9e37('0x50')](_0x289b1d)){logger[_0x9e37('0x62')](_0x9e37('0x63')+_0x289b1d+_0x9e37('0x64'));fs['unlinkSync'](_0x289b1d);}_0x289b1d=_0x289b1d+_0x9e37('0x65');if(!_['isNil'](_0x1ef39f[_0x9e37('0x4e')])&&fs[_0x9e37('0x50')](_0x289b1d)){logger['info'](_0x9e37('0x63')+_0x289b1d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9e37('0x66')](_0x289b1d);}return _0x1ef39f;})[_0x9e37('0x24')](function(_0x42efdb){if(!_0x42efdb)throw new InternalError();return _0x42efdb[_0x9e37('0x23')]();})[_0x9e37('0x24')](function(){_0x18fb91[_0x9e37('0x18')](0xcc)['end']();})[_0x9e37('0x47')](handleError(_0x18fb91,null));};function getBucketslist(_0x3ad381,_0x488dc1,_0x51ac61){return new Promise(function(_0x4a5502,_0x4e716b){var _0x35bf23=new AWS['S3']({'accessKeyId':_0x488dc1,'secretAccessKey':_0x3ad381,'region':_0x51ac61});_0x35bf23['listBuckets']({},function(_0x3591ff,_0x48c98e){if(_0x3591ff){return _0x4e716b(_0x3591ff);}else{return _0x4a5502(_0x48c98e);}});});}function createBucket(_0x1eefdc,_0x4b4c3,_0x8fd23e,_0x89a022){return new Promise(function(_0x593c32,_0x2a2509){var _0x3e3879=new AWS['S3']({'accessKeyId':_0x4b4c3,'secretAccessKey':_0x1eefdc,'region':_0x8fd23e});_0x3e3879['createBucket']({'Bucket':_0x89a022},function(_0x55c538,_0x1b87bd){if(_0x55c538){return _0x2a2509(_0x55c538);}else{return _0x593c32(_0x1b87bd);}});});}function uploadFile(_0x4a1b45,_0x238fc2,_0x56f542,_0x3dca6c,_0x55670f,_0x2d1149){return new Promise(function(_0x3f8a46,_0x43ed88){var _0x1dff4b=new AWS['S3']({'accessKeyId':_0x238fc2,'secretAccessKey':_0x4a1b45,'region':_0x56f542});_0x1dff4b['upload']({'Bucket':_0x3dca6c,'Key':_0x55670f,'Body':_0x2d1149},function(_0x534d03,_0x57439b){if(_0x534d03){return _0x43ed88(_0x534d03);}else{return _0x3f8a46(_0x57439b);}});});}function startTranscribe(_0x3f1de9,_0x30fcb7,_0x4df32c,_0x508c1d,_0x411674,_0x2ed420){return new Promise(function(_0x281131,_0x1c8ec5){var _0x59148d=new AWS[(_0x9e37('0x67'))]({'accessKeyId':_0x30fcb7,'secretAccessKey':_0x3f1de9,'region':_0x4df32c});_0x59148d['startTranscriptionJob']({'TranscriptionJobName':_0x508c1d,'LanguageCode':_0x411674,'Media':{'MediaFileUri':_0x2ed420}},function(_0xce2da5,_0xe2f185){if(_0xce2da5){return _0x1c8ec5(_0xce2da5);}else{return _0x281131(_0xe2f185);}});});}function transcribe(_0x1da847,_0x199080,_0x345bcb,_0x4f100f,_0x5154bd,_0x23ae8f,_0x2fa014){return new Promise(function(_0x2cd372,_0x5e8643){var _0x2b3923={};logger[_0x9e37('0x62')](util[_0x9e37('0x2f')](_0x9e37('0x68'),_0x1da847,_0x5154bd));return uploadFile(_0x199080,_0x345bcb,_0x4f100f,_0x5154bd,path[_0x9e37('0x69')](_0x23ae8f),fs[_0x9e37('0x6a')](_0x23ae8f))['then'](function(_0x454c30){logger[_0x9e37('0x62')](util['format'](_0x9e37('0x6b'),_0x1da847,_0x5154bd,_0x454c30[_0x9e37('0x6c')]));_0x2b3923[_0x9e37('0x6d')]=_0x454c30[_0x9e37('0x6e')];_0x2b3923['location']=_0x454c30['Location'];logger['info'](util[_0x9e37('0x2f')](_0x9e37('0x6f'),_0x1da847));return startTranscribe(_0x199080,_0x345bcb,_0x4f100f,uuidv4(),_0x2fa014,_0x454c30['Location']);})[_0x9e37('0x24')](function(_0x117bb9){logger['info'](util[_0x9e37('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1da847,_0x117bb9['TranscriptionJob'][_0x9e37('0x70')]));_0x2b3923[_0x9e37('0x71')]=_0x117bb9[_0x9e37('0x72')][_0x9e37('0x70')];_0x2b3923['transcribeStatus']=_0x117bb9[_0x9e37('0x72')][_0x9e37('0x73')];return _0x2cd372(_0x2b3923);})['catch'](function(_0x2713c2){return _0x5e8643(_0x2713c2);});});}exports[_0x9e37('0x74')]=function(_0x1b6476,_0x4abfa5,_0x5446dc){var _0x599dbf;var _0x435686;var _0x59fb9e;var _0x61bf05=require(_0x9e37('0x4c'));return db[_0x9e37('0x2a')][_0x9e37('0x75')]({'where':{'id':_0x1b6476['params']['id']}})['then'](function(_0x79c226){if(_0x79c226){var _0x4be1fd=util['format'](_0x9e37('0x4f'),_0x79c226[_0x9e37('0x4e')]);if(fs[_0x9e37('0x50')](_0x4be1fd)){cypher=!![];return _0x61bf05[_0x9e37('0x51')](_0x4be1fd,_0x79c226[_0x9e37('0x4e')],config[_0x9e37('0x52')][_0x9e37('0x53')])['then'](function(){return _0x79c226;});}return _0x79c226;}})[_0x9e37('0x24')](function(_0xd60ece){if(!_0xd60ece){throw new db[(_0x9e37('0x54'))]['ValidationError'](_0x9e37('0x76'));}_0x435686=_0xd60ece;return db['Setting'][_0x9e37('0x75')]({'where':{'id':0x1}});})[_0x9e37('0x24')](handleEntityNotFound(_0x4abfa5,null))['then'](function(_0x80b0e8){if(_0x80b0e8){_0x599dbf=_0x80b0e8;if(!_0x599dbf[_0x9e37('0x77')]||!_0x599dbf['transcribeAccountId']||!_0x599dbf[_0x9e37('0x78')]||!_0x599dbf[_0x9e37('0x79')]||!_0x599dbf['bucket']){throw new db[(_0x9e37('0x54'))][(_0x9e37('0x60'))]('Transcribe\x20not\x20configured');}if(_0x1b6476['body']['runSentiment']&&(!_0x599dbf['sentiment']||!_0x599dbf[_0x9e37('0x7a')]||!_0x599dbf[_0x9e37('0x7b')]||!_0x599dbf[_0x9e37('0x79')]||!_0x599dbf[_0x9e37('0x6d')])){throw new db['Sequelize']['ValidationError'](_0x9e37('0x7c'));}return db[_0x9e37('0x7d')]['findOne']({'where':{'id':_0x599dbf['transcribeAccountId']}});}})[_0x9e37('0x24')](function(_0x5514cf){if(!_0x5514cf){throw new db['Sequelize'][(_0x9e37('0x60'))](_0x9e37('0x7e'));}if(!_0x5514cf[_0x9e37('0x7f')]||!_0x5514cf[_0x9e37('0x80')]){throw new db['Sequelize'][(_0x9e37('0x60'))](_0x9e37('0x81'));}_0x59fb9e=_0x5514cf;return getBucketslist(_0x59fb9e[_0x9e37('0x7f')],_0x59fb9e[_0x9e37('0x80')],_0x599dbf[_0x9e37('0x78')]);})[_0x9e37('0x24')](function(_0x590a34){if(_0x590a34&&_0x590a34['Buckets']){var _0x1b7dd3=_['find'](_0x590a34[_0x9e37('0x82')],function(_0x5d62b8){return _0x5d62b8[_0x9e37('0x83')]===_0x599dbf['bucket'];});if(!_0x1b7dd3){logger['info'](util[_0x9e37('0x2f')](_0x9e37('0x84'),_0x1b6476['params']['id'],_0x599dbf[_0x9e37('0x6d')]));return createBucket(_0x59fb9e[_0x9e37('0x7f')],_0x59fb9e[_0x9e37('0x80')],_0x599dbf[_0x9e37('0x78')],_0x599dbf[_0x9e37('0x6d')]);}logger[_0x9e37('0x62')](util[_0x9e37('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1b6476[_0x9e37('0x43')]['id'],_0x599dbf[_0x9e37('0x6d')]));return;}})[_0x9e37('0x24')](function(_0x3f19d5){if(_0x435686[_0x9e37('0x85')]===_0x9e37('0x86')){return transcribe(_0x1b6476[_0x9e37('0x43')]['id'],_0x59fb9e[_0x9e37('0x7f')],_0x59fb9e[_0x9e37('0x80')],_0x599dbf['transcribeRegion'],_0x599dbf[_0x9e37('0x6d')],_0x435686[_0x9e37('0x4e')],_0x599dbf['language']);}else{logger[_0x9e37('0x62')](util['format'](_0x9e37('0x87'),_0x1b6476[_0x9e37('0x43')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x9e37('0x24')](function(_0x3696e9){if(_0x3696e9){_0x3696e9[_0x9e37('0x88')]=_0x1b6476['body'][_0x9e37('0x89')];return _0x435686[_0x9e37('0x8a')](_0x3696e9);}})[_0x9e37('0x24')](respondWithResult(_0x4abfa5,null))[_0x9e37('0x47')](handleError(_0x4abfa5,null));};function writeFile(_0x3583cc,_0x17228f){return new Promise(function(_0x3b053b,_0x244330){fs[_0x9e37('0x8b')](_0x17228f,_0x3583cc,function(_0x2a79b7,_0x48d754){if(_0x2a79b7){return _0x244330(_0x2a79b7);}else{return _0x3b053b(_0x48d754);}});});}exports[_0x9e37('0x8c')]=function(_0x548329,_0x26efe2,_0x262b8c){return db[_0x9e37('0x2a')][_0x9e37('0x75')]({'where':{'id':_0x548329[_0x9e37('0x43')]['id']}})['then'](handleEntityNotFound(_0x26efe2))['then'](function(_0x4e10dd){if(_0x4e10dd&&_0x4e10dd[_0x9e37('0x8d')]){var _0x5d1427=_0x4e10dd[_0x9e37('0x8d')];var _0x307231=config[_0x9e37('0x8e')]+'/server/files/transcribes/transcribe_'+_0x4e10dd['id']+_0x9e37('0x8f');if(fs[_0x9e37('0x50')](_0x307231)){return _0x307231;}return writeFile(_0x5d1427,_0x307231)['then'](function(){return _0x307231;});}else{throw new db[(_0x9e37('0x54'))]['ValidationError'](_0x9e37('0x90'));}})[_0x9e37('0x24')](function(_0x454cb4){return _0x26efe2['download'](_0x454cb4);})[_0x9e37('0x47')](handleError(_0x26efe2));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38df=['./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','transcribeStatus'];(function(_0x380640,_0x185d99){var _0xf3c37=function(_0x182c1c){while(--_0x182c1c){_0x380640['push'](_0x380640['shift']());}};_0xf3c37(++_0x185d99);}(_0x38df,0x144));var _0xf38d=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x38df[_0x2cc569];return _0x1bfc2e;};'use strict';var attributes=require(_0xf38d('0x0'));module[_0xf38d('0x1')]=function(_0x1b738c,_0x40d0df){return _0x1b738c[_0xf38d('0x2')](_0xf38d('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf38d('0x4')]},{'name':_0xf38d('0x5'),'fields':[_0xf38d('0x5')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc18a=['transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x1db600,_0x5d0b70){var _0x2eb207=function(_0xecfe0e){while(--_0xecfe0e){_0x1db600['push'](_0x1db600['shift']());}};_0x2eb207(++_0x5d0b70);}(_0xc18a,0x1cf));var _0xac18=function(_0x474cfa,_0x30f97b){_0x474cfa=_0x474cfa-0x0;var _0x3fae8b=_0xc18a[_0x474cfa];return _0x3fae8b;};'use strict';var attributes=require(_0xac18('0x0'));module[_0xac18('0x1')]=function(_0x1bb84d,_0x249826){return _0x1bb84d['define'](_0xac18('0x2'),attributes,{'tableName':_0xac18('0x3'),'paranoid':![],'indexes':[{'name':_0xac18('0x4'),'fields':[_0xac18('0x4')]},{'name':_0xac18('0x5'),'fields':[_0xac18('0x5')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2da6=['stringify','error','code','message','result','catch','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x46b573,_0x388f6d){var _0x3bcf35=function(_0x531d44){while(--_0x531d44){_0x46b573['push'](_0x46b573['shift']());}};_0x3bcf35(++_0x388f6d);}(_0x2da6,0x1dd));var _0x62da=function(_0x30765d,_0xe40e82){_0x30765d=_0x30765d-0x0;var _0x2b6f37=_0x2da6[_0x30765d];return _0x2b6f37;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['UpdateVoiceRecording']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['update'](_0xa7050b[_0x62da('0x19')],{'raw':_0xa7050b['options']?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1c')]||null:null,'attributes':_0xa7050b[_0x62da('0x1a')]?_0xa7050b[_0x62da('0x1a')][_0x62da('0x1d')]||null:null,'limit':_0xa7050b[_0x62da('0x1a')]?_0xa7050b['options'][_0x62da('0x1e')]||null:null})[_0x62da('0xc')](function(_0x2fd925){logger[_0x62da('0xd')](_0x62da('0x1f'),_0xa7050b);logger[_0x62da('0xf')](_0x62da('0x1f'),_0xa7050b,JSON['stringify'](_0x2fd925));_0x4d6482(_0x2fd925);})['catch'](function(_0x509fd9){logger[_0x62da('0x13')](_0x62da('0x1f'),_0x509fd9[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x509fd9['message']));});});};exports[_0x62da('0x20')]=function(_0x3b9c06){var _0x5f0a9c=this;return new Promise(function(_0x3ccf96,_0x195dc4){var _0x1775ea=require('../../components/encryptor');var _0x41de3a;return db[_0x62da('0x21')][_0x62da('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3c6274){_0x41de3a=_0x3c6274;return db[_0x62da('0x18')][_0x62da('0x23')](_0x3b9c06['body']);})[_0x62da('0xc')](function(_0x2a4681){if(_0x41de3a[_0x62da('0x24')]&&fs[_0x62da('0x25')](_0x2a4681[_0x62da('0x26')])){var _0x1cf765=util['format'](_0x62da('0x27'),_0x2a4681['value']);return _0x1775ea[_0x62da('0x28')](_0x2a4681[_0x62da('0x26')],_0x1cf765,config[_0x62da('0x29')][_0x62da('0x2a')])[_0x62da('0xc')](function(){fs[_0x62da('0x2b')](_0x2a4681['value']);logger[_0x62da('0xd')](_0x62da('0x2c'));return _0x2a4681;});}return _0x2a4681;})[_0x62da('0xc')](function(_0x5107b1){logger[_0x62da('0xd')](_0x62da('0x20'),_0x3b9c06);logger[_0x62da('0xf')]('CreateVoiceRecording',_0x3b9c06,JSON[_0x62da('0x12')](_0x5107b1));_0x3ccf96(_0x5107b1);})[_0x62da('0x17')](function(_0x55eda7){logger[_0x62da('0x13')](_0x62da('0x20'),_0x55eda7['message'],_0x3b9c06);_0x195dc4(_0x5f0a9c[_0x62da('0x13')](0x1f4,_0x55eda7[_0x62da('0x15')]));});});};
\ No newline at end of file
+var _0x0295=['client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','body','options','where','limit','UpdateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b68bc,_0x105900){var _0x3993e4=function(_0x4eab72){while(--_0x4eab72){_0x4b68bc['push'](_0x4b68bc['shift']());}};_0x3993e4(++_0x105900);}(_0x0295,0x1f0));var _0x5029=function(_0x4d5d0a,_0x4148dd){_0x4d5d0a=_0x4d5d0a-0x0;var _0x502c59=_0x0295[_0x4d5d0a];return _0x502c59;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['UpdateVoiceRecording']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')](_0x1ed567[_0x5029('0x17')],{'raw':_0x1ed567['options']?_0x1ed567[_0x5029('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed567[_0x5029('0x18')]?_0x1ed567[_0x5029('0x18')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x18')]?_0x1ed567['options']['attributes']||null:null,'limit':_0x1ed567[_0x5029('0x18')]?_0x1ed567['options'][_0x5029('0x1a')]||null:null})[_0x5029('0xa')](function(_0x1eb228){logger[_0x5029('0xb')](_0x5029('0x1b'),_0x1ed567);logger[_0x5029('0xd')](_0x5029('0x1b'),_0x1ed567,JSON[_0x5029('0xf')](_0x1eb228));_0x35de81(_0x1eb228);})[_0x5029('0x14')](function(_0x4ceaae){logger['error']('UpdateVoiceRecording',_0x4ceaae[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155[_0x5029('0x10')](0x1f4,_0x4ceaae['message']));});});};exports['CreateVoiceRecording']=function(_0x181da0){var _0x1e7e61=this;return new Promise(function(_0x36d810,_0x5527fc){var _0x2c501f=require(_0x5029('0x1c'));var _0x5e45c4;return db[_0x5029('0x1d')][_0x5029('0x1e')]({'attributes':['id',_0x5029('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x32da06){_0x5e45c4=_0x32da06;return db[_0x5029('0x15')][_0x5029('0x20')](_0x181da0['body']);})[_0x5029('0xa')](function(_0x2bb398){if(_0x5e45c4['callRecordingEncryption']&&fs[_0x5029('0x21')](_0x2bb398[_0x5029('0x22')])){var _0x4434ff=util[_0x5029('0x23')](_0x5029('0x24'),_0x2bb398[_0x5029('0x22')]);return _0x2c501f[_0x5029('0x25')](_0x2bb398[_0x5029('0x22')],_0x4434ff,config[_0x5029('0x26')][_0x5029('0x27')])[_0x5029('0xa')](function(){fs[_0x5029('0x28')](_0x2bb398['value']);logger[_0x5029('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2bb398;});}return _0x2bb398;})[_0x5029('0xa')](function(_0x4f672e){logger['info'](_0x5029('0x29'),_0x181da0);logger[_0x5029('0xd')](_0x5029('0x29'),_0x181da0,JSON['stringify'](_0x4f672e));_0x36d810(_0x4f672e);})[_0x5029('0x14')](function(_0x15d882){logger[_0x5029('0x10')](_0x5029('0x29'),_0x15d882[_0x5029('0x12')],_0x181da0);_0x5527fc(_0x1e7e61[_0x5029('0x10')](0x1f4,_0x15d882[_0x5029('0x12')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd630=['../../config/environment','get','isAuthenticated','describe','/:id','show','create','put','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5335cc,_0x44d8f7){var _0x172ecc=function(_0x39241f){while(--_0x39241f){_0x5335cc['push'](_0x5335cc['shift']());}};_0x172ecc(++_0x44d8f7);}(_0xd630,0x1da));var _0x0d63=function(_0x1f9a39,_0x372548){_0x1f9a39=_0x1f9a39-0x0;var _0x4e7cbe=_0xd630[_0x1f9a39];return _0x4e7cbe;};'use strict';var multer=require(_0x0d63('0x0'));var util=require(_0x0d63('0x1'));var path=require('path');var timeout=require(_0x0d63('0x2'));var express=require(_0x0d63('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0d63('0x4'));var interaction=require(_0x0d63('0x5'));var config=require(_0x0d63('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x0d63('0x7')]('/',auth[_0x0d63('0x8')](),controller['index']);router[_0x0d63('0x7')]('/describe',auth[_0x0d63('0x8')](),controller[_0x0d63('0x9')]);router[_0x0d63('0x7')](_0x0d63('0xa'),auth['isAuthenticated'](),controller[_0x0d63('0xb')]);router['post']('/',auth[_0x0d63('0x8')](),controller[_0x0d63('0xc')]);router[_0x0d63('0xd')](_0x0d63('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0d63('0xa'),auth[_0x0d63('0x8')](),controller[_0x0d63('0xe')]);module[_0x0d63('0xf')]=router;
\ No newline at end of file
+var _0xf491=['get','isAuthenticated','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x39c4c1,_0x4b90c6){var _0x125962=function(_0x3fc8c0){while(--_0x3fc8c0){_0x39c4c1['push'](_0x39c4c1['shift']());}};_0x125962(++_0x4b90c6);}(_0xf491,0x14e));var _0x1f49=function(_0x5a5f96,_0x443c1b){_0x5a5f96=_0x5a5f96-0x0;var _0x23a6ab=_0xf491[_0x5a5f96];return _0x23a6ab;};'use strict';var multer=require(_0x1f49('0x0'));var util=require(_0x1f49('0x1'));var path=require(_0x1f49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f49('0x3')]();var fs_extra=require(_0x1f49('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f49('0x5'));var config=require(_0x1f49('0x6'));var controller=require(_0x1f49('0x7'));router[_0x1f49('0x8')]('/',auth[_0x1f49('0x9')](),controller['index']);router[_0x1f49('0x8')](_0x1f49('0xa'),auth[_0x1f49('0x9')](),controller[_0x1f49('0xb')]);router[_0x1f49('0x8')](_0x1f49('0xc'),auth['isAuthenticated'](),controller[_0x1f49('0xd')]);router[_0x1f49('0xe')]('/',auth[_0x1f49('0x9')](),controller[_0x1f49('0xf')]);router[_0x1f49('0x10')](_0x1f49('0xc'),auth[_0x1f49('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1f49('0x11')]);module[_0x1f49('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf739=['STRING','Yes','sequelize','moment','blind'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf739,0x18d));var _0x9f73=function(_0x3358b9,_0x4bdab0){_0x3358b9=_0x3358b9-0x0;var _0x4c15eb=_0xf739[_0x3358b9];return _0x4c15eb;};'use strict';var Sequelize=require(_0x9f73('0x0'));var moment=require(_0x9f73('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x9f73('0x2'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x9f73('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x9f73('0x3')]},'transferercalleridname':{'type':Sequelize[_0x9f73('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9f73('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x9f73('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x9f73('0x3')]},'transferercontext':{'type':Sequelize[_0x9f73('0x3')]},'transfererexten':{'type':Sequelize[_0x9f73('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x9f73('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x9f73('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x9f73('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9f73('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9f73('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x9f73('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x9f73('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x9f73('0x4'),'No')},'context':{'type':Sequelize[_0x9f73('0x3')]},'extension':{'type':Sequelize[_0x9f73('0x3')]}};
\ No newline at end of file
+var _0xecc1=['attended','STRING','ENUM','sequelize','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xecc1,0x80));var _0x1ecc=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xecc1[_0x5eb22e];return _0x27fed5;};'use strict';var Sequelize=require(_0x1ecc('0x0'));var moment=require(_0x1ecc('0x1'));module['exports']={'type':{'type':Sequelize['ENUM']('blind',_0x1ecc('0x2'))},'result':{'type':Sequelize[_0x1ecc('0x3')]},'transfererchannel':{'type':Sequelize[_0x1ecc('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x1ecc('0x3')]},'transferercalleridname':{'type':Sequelize[_0x1ecc('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1ecc('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x1ecc('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x1ecc('0x3')]},'transferercontext':{'type':Sequelize[_0x1ecc('0x3')]},'transfererexten':{'type':Sequelize[_0x1ecc('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x1ecc('0x3')]},'transfereechannel':{'type':Sequelize[_0x1ecc('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x1ecc('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1ecc('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x1ecc('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1ecc('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x1ecc('0x3')]},'isexternal':{'type':Sequelize[_0x1ecc('0x4')]('Yes','No')},'context':{'type':Sequelize[_0x1ecc('0x3')]},'extension':{'type':Sequelize[_0x1ecc('0x3')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1828=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','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','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x3f6402,_0x46ada1){var _0x21a763=function(_0x16fe67){while(--_0x16fe67){_0x3f6402['push'](_0x3f6402['shift']());}};_0x21a763(++_0x46ada1);}(_0x1828,0x1a7));var _0x8182=function(_0x423aab,_0x38e4e3){_0x423aab=_0x423aab-0x0;var _0x42bbe2=_0x1828[_0x423aab];return _0x42bbe2;};'use strict';var emlformat=require(_0x8182('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8182('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8182('0x2'));var moment=require(_0x8182('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8182('0x4'));var util=require(_0x8182('0x5'));var path=require(_0x8182('0x6'));var sox=require(_0x8182('0x7'));var csv=require(_0x8182('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8182('0x9'));var squel=require(_0x8182('0xa'));var crypto=require(_0x8182('0xb'));var jsforce=require(_0x8182('0xc'));var deskjs=require(_0x8182('0xd'));var toCsv=require(_0x8182('0x8'));var querystring=require('querystring');var Papa=require(_0x8182('0xe'));var Redis=require(_0x8182('0xf'));var authService=require(_0x8182('0x10'));var qs=require(_0x8182('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8182('0x12'))(_0x8182('0x13'));var utils=require(_0x8182('0x14'));var config=require(_0x8182('0x15'));var licenseUtil=require(_0x8182('0x16'));var db=require(_0x8182('0x17'))['db'];function respondWithStatusCode(_0x109322,_0x48e505){_0x48e505=_0x48e505||0xcc;return function(_0x4c7a53){if(_0x4c7a53){return _0x109322[_0x8182('0x18')](_0x48e505);}return _0x109322['status'](_0x48e505)[_0x8182('0x19')]();};}function respondWithResult(_0xd69fd2,_0x51395c){_0x51395c=_0x51395c||0xc8;return function(_0x20d7e3){if(_0x20d7e3){return _0xd69fd2[_0x8182('0x1a')](_0x51395c)[_0x8182('0x1b')](_0x20d7e3);}};}function respondWithFilteredResult(_0x275107,_0x3feb81){return function(_0x9008e3){if(_0x9008e3){var _0x12ee42=typeof _0x3feb81[_0x8182('0x1c')]===_0x8182('0x1d')&&typeof _0x3feb81[_0x8182('0x1e')]===_0x8182('0x1d');var _0x3495d2=_0x9008e3[_0x8182('0x1f')];var _0x5793a7=_0x12ee42?0x0:_0x3feb81[_0x8182('0x1c')];var _0x24db20=_0x12ee42?_0x9008e3[_0x8182('0x1f')]:_0x3feb81[_0x8182('0x1c')]+_0x3feb81[_0x8182('0x1e')];var _0x598441;if(_0x24db20>=_0x3495d2){_0x24db20=_0x3495d2;_0x598441=0xc8;}else{_0x598441=0xce;}_0x275107[_0x8182('0x1a')](_0x598441);return _0x275107[_0x8182('0x20')](_0x8182('0x21'),_0x5793a7+'-'+_0x24db20+'/'+_0x3495d2)['json'](_0x9008e3);}return null;};}function patchUpdates(_0x3c6802){return function(_0xe3e0fa){try{jsonpatch[_0x8182('0x22')](_0xe3e0fa,_0x3c6802,!![]);}catch(_0x3a7fd7){return BPromise[_0x8182('0x23')](_0x3a7fd7);}return _0xe3e0fa[_0x8182('0x24')]();};}function saveUpdates(_0x420881,_0x5008fa){return function(_0x25d26e){if(_0x25d26e){return _0x25d26e[_0x8182('0x25')](_0x420881)['then'](function(_0x812d75){return _0x812d75;});}return null;};}function removeEntity(_0x531d00,_0x2d9447){return function(_0x27f9c2){if(_0x27f9c2){return _0x27f9c2[_0x8182('0x26')]()[_0x8182('0x27')](function(){_0x531d00['status'](0xcc)[_0x8182('0x19')]();});}};}function handleEntityNotFound(_0x407c57,_0x4b4c04){return function(_0x231f2a){if(!_0x231f2a){_0x407c57['sendStatus'](0x194);}return _0x231f2a;};}function handleError(_0x45ef62,_0x97c334){_0x97c334=_0x97c334||0x1f4;return function(_0x56cd53){logger[_0x8182('0x28')](_0x56cd53[_0x8182('0x29')]);if(_0x56cd53['name']){delete _0x56cd53[_0x8182('0x2a')];}_0x45ef62['status'](_0x97c334)['send'](_0x56cd53);};}exports[_0x8182('0x2b')]=function(_0x29c156,_0x48781d){var _0x551a92={},_0x2637e6={},_0x464325={'count':0x0,'rows':[]};var _0x51507c=_['map'](db[_0x8182('0x2c')][_0x8182('0x2d')],function(_0x2a57f9){return{'name':_0x2a57f9[_0x8182('0x2e')],'type':_0x2a57f9[_0x8182('0x2f')][_0x8182('0x30')]};});_0x2637e6[_0x8182('0x31')]=_[_0x8182('0x32')](_0x51507c,_0x8182('0x2a'));_0x2637e6[_0x8182('0x33')]=_[_0x8182('0x34')](_0x29c156[_0x8182('0x33')]);_0x2637e6['filters']=_[_0x8182('0x35')](_0x2637e6[_0x8182('0x31')],_0x2637e6[_0x8182('0x33')]);_0x551a92[_0x8182('0x36')]=_['intersection'](_0x2637e6[_0x8182('0x31')],qs[_0x8182('0x37')](_0x29c156['query'][_0x8182('0x37')]));_0x551a92[_0x8182('0x36')]=_0x551a92[_0x8182('0x36')]['length']?_0x551a92[_0x8182('0x36')]:_0x2637e6['model'];if(!_0x29c156['query'][_0x8182('0x38')](_0x8182('0x39'))){_0x551a92['limit']=qs[_0x8182('0x1e')](_0x29c156[_0x8182('0x33')]['limit']);_0x551a92[_0x8182('0x1c')]=qs['offset'](_0x29c156['query']['offset']);}_0x551a92[_0x8182('0x3a')]=qs[_0x8182('0x3b')](_0x29c156[_0x8182('0x33')][_0x8182('0x3b')]);_0x551a92[_0x8182('0x3c')]=qs[_0x8182('0x3d')](_[_0x8182('0x3e')](_0x29c156[_0x8182('0x33')],_0x2637e6[_0x8182('0x3d')]),_0x51507c);if(_0x29c156[_0x8182('0x33')][_0x8182('0x3f')]){_0x551a92[_0x8182('0x3c')]=_[_0x8182('0x40')](_0x551a92[_0x8182('0x3c')],{'$or':_[_0x8182('0x32')](_0x51507c,function(_0x24dd0f){if(_0x24dd0f[_0x8182('0x2f')]!==_0x8182('0x41')){var _0x48f660={};_0x48f660[_0x24dd0f['name']]={'$like':'%'+_0x29c156[_0x8182('0x33')][_0x8182('0x3f')]+'%'};return _0x48f660;}})});}_0x551a92=_[_0x8182('0x40')]({},_0x551a92,_0x29c156['options']);var _0x213bd3={'where':_0x551a92[_0x8182('0x3c')]};return db['VoiceTransferReport'][_0x8182('0x1f')](_0x213bd3)[_0x8182('0x27')](function(_0x4b9bd6){_0x464325[_0x8182('0x1f')]=_0x4b9bd6;if(_0x29c156['query'][_0x8182('0x42')]){_0x551a92[_0x8182('0x43')]=[{'all':!![]}];}return db[_0x8182('0x2c')]['findAll'](_0x551a92);})[_0x8182('0x27')](function(_0x57f3bd){_0x464325[_0x8182('0x44')]=_0x57f3bd;return _0x464325;})[_0x8182('0x27')](respondWithFilteredResult(_0x48781d,_0x551a92))[_0x8182('0x45')](handleError(_0x48781d,null));};exports[_0x8182('0x46')]=function(_0x22fd19,_0x292969){var _0x2bcab0={'raw':!![],'where':{'id':_0x22fd19['params']['id']}},_0x2bdb55={};_0x2bdb55[_0x8182('0x31')]=_['keys'](db[_0x8182('0x2c')][_0x8182('0x2d')]);_0x2bdb55[_0x8182('0x33')]=_[_0x8182('0x34')](_0x22fd19[_0x8182('0x33')]);_0x2bdb55['filters']=_[_0x8182('0x35')](_0x2bdb55[_0x8182('0x31')],_0x2bdb55[_0x8182('0x33')]);_0x2bcab0['attributes']=_['intersection'](_0x2bdb55[_0x8182('0x31')],qs[_0x8182('0x37')](_0x22fd19[_0x8182('0x33')][_0x8182('0x37')]));_0x2bcab0[_0x8182('0x36')]=_0x2bcab0[_0x8182('0x36')]['length']?_0x2bcab0[_0x8182('0x36')]:_0x2bdb55[_0x8182('0x31')];if(_0x22fd19[_0x8182('0x33')][_0x8182('0x42')]){_0x2bcab0[_0x8182('0x43')]=[{'all':!![]}];}_0x2bcab0=_[_0x8182('0x40')]({},_0x2bcab0,_0x22fd19[_0x8182('0x47')]);return db[_0x8182('0x2c')][_0x8182('0x48')](_0x2bcab0)[_0x8182('0x27')](handleEntityNotFound(_0x292969,null))[_0x8182('0x27')](respondWithResult(_0x292969,null))[_0x8182('0x45')](handleError(_0x292969,null));};exports[_0x8182('0x49')]=function(_0x3bdada,_0x41ffee){return db[_0x8182('0x2c')]['create'](_0x3bdada[_0x8182('0x4a')],{})[_0x8182('0x27')](respondWithResult(_0x41ffee,0xc9))['catch'](handleError(_0x41ffee,null));};exports['update']=function(_0x29325a,_0x1784c8){if(_0x29325a[_0x8182('0x4a')]['id']){delete _0x29325a['body']['id'];}return db[_0x8182('0x2c')][_0x8182('0x48')]({'where':{'id':_0x29325a[_0x8182('0x4b')]['id']}})[_0x8182('0x27')](handleEntityNotFound(_0x1784c8,null))[_0x8182('0x27')](saveUpdates(_0x29325a['body'],null))['then'](respondWithResult(_0x1784c8,null))[_0x8182('0x45')](handleError(_0x1784c8,null));};exports['destroy']=function(_0x216127,_0xa9f6c0){return db[_0x8182('0x2c')][_0x8182('0x48')]({'where':{'id':_0x216127[_0x8182('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa9f6c0,null))[_0x8182('0x27')](removeEntity(_0xa9f6c0,null))[_0x8182('0x45')](handleError(_0xa9f6c0,null));};exports['describe']=function(_0x1ed2e6,_0x3967ad){return db[_0x8182('0x2c')]['describe']()[_0x8182('0x27')](respondWithResult(_0x3967ad,null))[_0x8182('0x45')](handleError(_0x3967ad,null));};
\ No newline at end of file
+var _0x2c13=['merge','VIRTUAL','VoiceTransferReport','includeAll','include','findAll','rows','show','params','options','find','catch','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2fc158,_0x1dcafc){var _0xbbdcd3=function(_0x4a7463){while(--_0x4a7463){_0x2fc158['push'](_0x2fc158['shift']());}};_0xbbdcd3(++_0x1dcafc);}(_0x2c13,0xe7));var _0x32c1=function(_0x1a5998,_0x2a3cb7){_0x1a5998=_0x1a5998-0x0;var _0x5e9e82=_0x2c13[_0x1a5998];return _0x5e9e82;};'use strict';var emlformat=require(_0x32c1('0x0'));var rimraf=require(_0x32c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x32c1('0x2'));var rp=require(_0x32c1('0x3'));var moment=require('moment');var BPromise=require(_0x32c1('0x4'));var Mustache=require('mustache');var util=require(_0x32c1('0x5'));var path=require('path');var sox=require(_0x32c1('0x6'));var csv=require(_0x32c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32c1('0x8'));var squel=require('squel');var crypto=require(_0x32c1('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x32c1('0xa'));var toCsv=require(_0x32c1('0x7'));var querystring=require(_0x32c1('0xb'));var Papa=require(_0x32c1('0xc'));var Redis=require(_0x32c1('0xd'));var authService=require(_0x32c1('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32c1('0xf'));var logger=require(_0x32c1('0x10'))(_0x32c1('0x11'));var utils=require(_0x32c1('0x12'));var config=require(_0x32c1('0x13'));var licenseUtil=require(_0x32c1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x65d24,_0x305c54){_0x305c54=_0x305c54||0xcc;return function(_0x276a6e){if(_0x276a6e){return _0x65d24[_0x32c1('0x15')](_0x305c54);}return _0x65d24[_0x32c1('0x16')](_0x305c54)[_0x32c1('0x17')]();};}function respondWithResult(_0x294bf5,_0x4e0ac3){_0x4e0ac3=_0x4e0ac3||0xc8;return function(_0x286b49){if(_0x286b49){return _0x294bf5[_0x32c1('0x16')](_0x4e0ac3)[_0x32c1('0x18')](_0x286b49);}};}function respondWithFilteredResult(_0x37e2b9,_0x351227){return function(_0x388793){if(_0x388793){var _0x33e320=typeof _0x351227[_0x32c1('0x19')]===_0x32c1('0x1a')&&typeof _0x351227[_0x32c1('0x1b')]==='undefined';var _0x3c22fe=_0x388793['count'];var _0x507bf9=_0x33e320?0x0:_0x351227[_0x32c1('0x19')];var _0x5863b7=_0x33e320?_0x388793[_0x32c1('0x1c')]:_0x351227[_0x32c1('0x19')]+_0x351227[_0x32c1('0x1b')];var _0x31e58a;if(_0x5863b7>=_0x3c22fe){_0x5863b7=_0x3c22fe;_0x31e58a=0xc8;}else{_0x31e58a=0xce;}_0x37e2b9[_0x32c1('0x16')](_0x31e58a);return _0x37e2b9['set'](_0x32c1('0x1d'),_0x507bf9+'-'+_0x5863b7+'/'+_0x3c22fe)[_0x32c1('0x18')](_0x388793);}return null;};}function patchUpdates(_0x4d56d8){return function(_0x1b4255){try{jsonpatch['apply'](_0x1b4255,_0x4d56d8,!![]);}catch(_0x19cc85){return BPromise[_0x32c1('0x1e')](_0x19cc85);}return _0x1b4255[_0x32c1('0x1f')]();};}function saveUpdates(_0x4e8351,_0x3d3b0f){return function(_0x33f13f){if(_0x33f13f){return _0x33f13f['update'](_0x4e8351)[_0x32c1('0x20')](function(_0x1c352f){return _0x1c352f;});}return null;};}function removeEntity(_0x436f3c,_0x34b96f){return function(_0x160922){if(_0x160922){return _0x160922[_0x32c1('0x21')]()[_0x32c1('0x20')](function(){_0x436f3c['status'](0xcc)[_0x32c1('0x17')]();});}};}function handleEntityNotFound(_0x3f36b7,_0x16267b){return function(_0x2cf807){if(!_0x2cf807){_0x3f36b7[_0x32c1('0x15')](0x194);}return _0x2cf807;};}function handleError(_0x4c049c,_0x41eeae){_0x41eeae=_0x41eeae||0x1f4;return function(_0x8444b7){logger[_0x32c1('0x22')](_0x8444b7[_0x32c1('0x23')]);if(_0x8444b7[_0x32c1('0x24')]){delete _0x8444b7[_0x32c1('0x24')];}_0x4c049c['status'](_0x41eeae)[_0x32c1('0x25')](_0x8444b7);};}exports['index']=function(_0x1bf941,_0x5871f1){var _0x12fb32={},_0x3a48c6={},_0x390d88={'count':0x0,'rows':[]};var _0x8a6f5=_['map'](db['VoiceTransferReport'][_0x32c1('0x26')],function(_0x2ab1f6){return{'name':_0x2ab1f6['fieldName'],'type':_0x2ab1f6[_0x32c1('0x27')][_0x32c1('0x28')]};});_0x3a48c6[_0x32c1('0x29')]=_[_0x32c1('0x2a')](_0x8a6f5,_0x32c1('0x24'));_0x3a48c6[_0x32c1('0x2b')]=_[_0x32c1('0x2c')](_0x1bf941[_0x32c1('0x2b')]);_0x3a48c6[_0x32c1('0x2d')]=_[_0x32c1('0x2e')](_0x3a48c6['model'],_0x3a48c6[_0x32c1('0x2b')]);_0x12fb32['attributes']=_[_0x32c1('0x2e')](_0x3a48c6[_0x32c1('0x29')],qs['fields'](_0x1bf941['query'][_0x32c1('0x2f')]));_0x12fb32[_0x32c1('0x30')]=_0x12fb32[_0x32c1('0x30')][_0x32c1('0x31')]?_0x12fb32['attributes']:_0x3a48c6[_0x32c1('0x29')];if(!_0x1bf941['query'][_0x32c1('0x32')](_0x32c1('0x33'))){_0x12fb32[_0x32c1('0x1b')]=qs['limit'](_0x1bf941['query'][_0x32c1('0x1b')]);_0x12fb32[_0x32c1('0x19')]=qs[_0x32c1('0x19')](_0x1bf941[_0x32c1('0x2b')][_0x32c1('0x19')]);}_0x12fb32[_0x32c1('0x34')]=qs[_0x32c1('0x35')](_0x1bf941[_0x32c1('0x2b')][_0x32c1('0x35')]);_0x12fb32[_0x32c1('0x36')]=qs[_0x32c1('0x2d')](_[_0x32c1('0x37')](_0x1bf941['query'],_0x3a48c6[_0x32c1('0x2d')]),_0x8a6f5);if(_0x1bf941[_0x32c1('0x2b')][_0x32c1('0x38')]){_0x12fb32[_0x32c1('0x36')]=_[_0x32c1('0x39')](_0x12fb32[_0x32c1('0x36')],{'$or':_[_0x32c1('0x2a')](_0x8a6f5,function(_0x188ead){if(_0x188ead[_0x32c1('0x27')]!==_0x32c1('0x3a')){var _0x2d57b2={};_0x2d57b2[_0x188ead[_0x32c1('0x24')]]={'$like':'%'+_0x1bf941['query'][_0x32c1('0x38')]+'%'};return _0x2d57b2;}})});}_0x12fb32=_['merge']({},_0x12fb32,_0x1bf941['options']);var _0x1c92cf={'where':_0x12fb32[_0x32c1('0x36')]};return db[_0x32c1('0x3b')]['count'](_0x1c92cf)[_0x32c1('0x20')](function(_0x5f0a1a){_0x390d88[_0x32c1('0x1c')]=_0x5f0a1a;if(_0x1bf941[_0x32c1('0x2b')][_0x32c1('0x3c')]){_0x12fb32[_0x32c1('0x3d')]=[{'all':!![]}];}return db[_0x32c1('0x3b')][_0x32c1('0x3e')](_0x12fb32);})[_0x32c1('0x20')](function(_0x3896b1){_0x390d88[_0x32c1('0x3f')]=_0x3896b1;return _0x390d88;})[_0x32c1('0x20')](respondWithFilteredResult(_0x5871f1,_0x12fb32))['catch'](handleError(_0x5871f1,null));};exports[_0x32c1('0x40')]=function(_0x3f63e0,_0x1390ba){var _0x10a999={'raw':!![],'where':{'id':_0x3f63e0[_0x32c1('0x41')]['id']}},_0x5bc5ae={};_0x5bc5ae['model']=_[_0x32c1('0x2c')](db[_0x32c1('0x3b')][_0x32c1('0x26')]);_0x5bc5ae[_0x32c1('0x2b')]=_[_0x32c1('0x2c')](_0x3f63e0[_0x32c1('0x2b')]);_0x5bc5ae[_0x32c1('0x2d')]=_[_0x32c1('0x2e')](_0x5bc5ae[_0x32c1('0x29')],_0x5bc5ae[_0x32c1('0x2b')]);_0x10a999[_0x32c1('0x30')]=_[_0x32c1('0x2e')](_0x5bc5ae[_0x32c1('0x29')],qs[_0x32c1('0x2f')](_0x3f63e0[_0x32c1('0x2b')][_0x32c1('0x2f')]));_0x10a999[_0x32c1('0x30')]=_0x10a999[_0x32c1('0x30')][_0x32c1('0x31')]?_0x10a999[_0x32c1('0x30')]:_0x5bc5ae[_0x32c1('0x29')];if(_0x3f63e0[_0x32c1('0x2b')][_0x32c1('0x3c')]){_0x10a999[_0x32c1('0x3d')]=[{'all':!![]}];}_0x10a999=_[_0x32c1('0x39')]({},_0x10a999,_0x3f63e0[_0x32c1('0x42')]);return db[_0x32c1('0x3b')][_0x32c1('0x43')](_0x10a999)[_0x32c1('0x20')](handleEntityNotFound(_0x1390ba,null))['then'](respondWithResult(_0x1390ba,null))[_0x32c1('0x44')](handleError(_0x1390ba,null));};exports['create']=function(_0x24d7b7,_0x2a9673){return db['VoiceTransferReport']['create'](_0x24d7b7[_0x32c1('0x45')],{})[_0x32c1('0x20')](respondWithResult(_0x2a9673,0xc9))[_0x32c1('0x44')](handleError(_0x2a9673,null));};exports[_0x32c1('0x46')]=function(_0x195690,_0x275953){if(_0x195690[_0x32c1('0x45')]['id']){delete _0x195690[_0x32c1('0x45')]['id'];}return db['VoiceTransferReport'][_0x32c1('0x43')]({'where':{'id':_0x195690[_0x32c1('0x41')]['id']}})[_0x32c1('0x20')](handleEntityNotFound(_0x275953,null))[_0x32c1('0x20')](saveUpdates(_0x195690[_0x32c1('0x45')],null))[_0x32c1('0x20')](respondWithResult(_0x275953,null))[_0x32c1('0x44')](handleError(_0x275953,null));};exports[_0x32c1('0x21')]=function(_0x4928f2,_0x2eb72a){return db['VoiceTransferReport'][_0x32c1('0x43')]({'where':{'id':_0x4928f2['params']['id']}})[_0x32c1('0x20')](handleEntityNotFound(_0x2eb72a,null))[_0x32c1('0x20')](removeEntity(_0x2eb72a,null))[_0x32c1('0x44')](handleError(_0x2eb72a,null));};exports[_0x32c1('0x47')]=function(_0x55caf2,_0xa966e7){return db[_0x32c1('0x3b')]['describe']()[_0x32c1('0x20')](respondWithResult(_0xa966e7,null))[_0x32c1('0x44')](handleError(_0xa966e7,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xccfd=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer'];(function(_0x10b0fa,_0x1eaac5){var _0x548860=function(_0x28d080){while(--_0x28d080){_0x10b0fa['push'](_0x10b0fa['shift']());}};_0x548860(++_0x1eaac5);}(_0xccfd,0x120));var _0xdccf=function(_0x3647cb,_0x5134f9){_0x3647cb=_0x3647cb-0x0;var _0x52aa58=_0xccfd[_0x3647cb];return _0x52aa58;};'use strict';var _=require(_0xdccf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdccf('0x1'));var moment=require(_0xdccf('0x2'));var BPromise=require(_0xdccf('0x3'));var rp=require(_0xdccf('0x4'));var fs=require('fs');var path=require(_0xdccf('0x5'));var rimraf=require(_0xdccf('0x6'));var config=require(_0xdccf('0x7'));var attributes=require(_0xdccf('0x8'));module[_0xdccf('0x9')]=function(_0x2d7b80,_0x273878){return _0x2d7b80[_0xdccf('0xa')]('VoiceTransferReport',attributes,{'tableName':_0xdccf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe178=['define','VoiceTransferReport','lodash','api','moment','bluebird','request-promise','rimraf','./voiceTransferReport.attributes','exports'];(function(_0xf76af,_0x4a9277){var _0x3eb3d8=function(_0x203cb0){while(--_0x203cb0){_0xf76af['push'](_0xf76af['shift']());}};_0x3eb3d8(++_0x4a9277);}(_0xe178,0x66));var _0x8e17=function(_0x1c0ae5,_0x1ca9fc){_0x1c0ae5=_0x1c0ae5-0x0;var _0x3dec45=_0xe178[_0x1c0ae5];return _0x3dec45;};'use strict';var _=require(_0x8e17('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8e17('0x1'));var moment=require(_0x8e17('0x2'));var BPromise=require(_0x8e17('0x3'));var rp=require(_0x8e17('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e17('0x5'));var config=require('../../config/environment');var attributes=require(_0x8e17('0x6'));module[_0x8e17('0x7')]=function(_0x533891,_0x22b4bf){return _0x533891[_0x8e17('0x8')](_0x8e17('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3ba=['http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xff9cb,_0x1b45d7){var _0x455a53=function(_0x50cd1b){while(--_0x50cd1b){_0xff9cb['push'](_0xff9cb['shift']());}};_0x455a53(++_0x1b45d7);}(_0xe3ba,0x16f));var _0xae3b=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xe3ba[_0x547af];return _0x22f7f4;};'use strict';var _=require(_0xae3b('0x0'));var util=require(_0xae3b('0x1'));var moment=require('moment');var BPromise=require(_0xae3b('0x2'));var rs=require(_0xae3b('0x3'));var fs=require('fs');var Redis=require(_0xae3b('0x4'));var db=require(_0xae3b('0x5'))['db'];var utils=require(_0xae3b('0x6'));var logger=require(_0xae3b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae3b('0x8'));var client=jayson[_0xae3b('0x9')][_0xae3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c4369,_0x35e49f,_0x49f9f7){return new BPromise(function(_0x530452,_0x534e3d){return client[_0xae3b('0xb')](_0x5c4369,_0x49f9f7)[_0xae3b('0xc')](function(_0x3dd20f){logger[_0xae3b('0xd')](_0xae3b('0xe'),_0x35e49f,'request\x20sent');logger[_0xae3b('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x35e49f,_0xae3b('0x10'),JSON[_0xae3b('0x11')](_0x3dd20f));if(_0x3dd20f[_0xae3b('0x12')]){if(_0x3dd20f['error'][_0xae3b('0x13')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x35e49f,_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);return _0x534e3d(_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);}logger[_0xae3b('0x12')](_0xae3b('0xe'),_0x35e49f,_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);return _0x530452(_0x3dd20f[_0xae3b('0x12')][_0xae3b('0x14')]);}else{logger[_0xae3b('0xd')](_0xae3b('0xe'),_0x35e49f,_0xae3b('0x10'));_0x530452(_0x3dd20f[_0xae3b('0x15')][_0xae3b('0x14')]);}})['catch'](function(_0x52a708){logger[_0xae3b('0x12')](_0xae3b('0xe'),_0x35e49f,_0x52a708);_0x534e3d(_0x52a708);});});}exports[_0xae3b('0x16')]=function(_0x4408a2){var _0xc648a7=this;return new Promise(function(_0x3840dd,_0x173d58){return db[_0xae3b('0x17')][_0xae3b('0x18')](_0x4408a2[_0xae3b('0x19')],{'raw':_0x4408a2[_0xae3b('0x1a')]?_0x4408a2[_0xae3b('0x1a')][_0xae3b('0x1b')]===undefined?!![]:![]:!![]})[_0xae3b('0xc')](function(_0x2eb39f){logger[_0xae3b('0xd')]('CreateVoiceTransferReport',_0x4408a2);logger[_0xae3b('0xf')](_0xae3b('0x16'),_0x4408a2,JSON[_0xae3b('0x11')](_0x2eb39f));_0x3840dd(_0x2eb39f);})[_0xae3b('0x1c')](function(_0x4ead85){logger[_0xae3b('0x12')](_0xae3b('0x16'),_0x4ead85[_0xae3b('0x14')],_0x4408a2);_0x173d58(_0xc648a7[_0xae3b('0x12')](0x1f4,_0x4ead85[_0xae3b('0x14')]));});});};
\ No newline at end of file
+var _0xafe5=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x1a7716,_0x1f799d){var _0x3b7639=function(_0x5e8034){while(--_0x5e8034){_0x1a7716['push'](_0x1a7716['shift']());}};_0x3b7639(++_0x1f799d);}(_0xafe5,0x129));var _0x5afe=function(_0x1561c3,_0x48baab){_0x1561c3=_0x1561c3-0x0;var _0x37d05e=_0xafe5[_0x1561c3];return _0x37d05e;};'use strict';var _=require(_0x5afe('0x0'));var util=require('util');var moment=require(_0x5afe('0x1'));var BPromise=require(_0x5afe('0x2'));var rs=require(_0x5afe('0x3'));var fs=require('fs');var Redis=require(_0x5afe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5afe('0x5'));var jayson=require(_0x5afe('0x6'));var client=jayson[_0x5afe('0x7')][_0x5afe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x183668,_0x5c7fbe,_0x32de9b){return new BPromise(function(_0x503b65,_0x1e2c4d){return client[_0x5afe('0x9')](_0x183668,_0x32de9b)['then'](function(_0xcc8108){logger[_0x5afe('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c7fbe,_0x5afe('0xb'));logger[_0x5afe('0xc')](_0x5afe('0xd'),_0x5c7fbe,_0x5afe('0xb'),JSON[_0x5afe('0xe')](_0xcc8108));if(_0xcc8108[_0x5afe('0xf')]){if(_0xcc8108[_0x5afe('0xf')][_0x5afe('0x10')]===0x1f4){logger[_0x5afe('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c7fbe,_0xcc8108[_0x5afe('0xf')][_0x5afe('0x11')]);return _0x1e2c4d(_0xcc8108[_0x5afe('0xf')][_0x5afe('0x11')]);}logger[_0x5afe('0xf')](_0x5afe('0x12'),_0x5c7fbe,_0xcc8108[_0x5afe('0xf')]['message']);return _0x503b65(_0xcc8108[_0x5afe('0xf')][_0x5afe('0x11')]);}else{logger[_0x5afe('0xa')](_0x5afe('0x12'),_0x5c7fbe,_0x5afe('0xb'));_0x503b65(_0xcc8108[_0x5afe('0x13')][_0x5afe('0x11')]);}})[_0x5afe('0x14')](function(_0xa2f762){logger[_0x5afe('0xf')](_0x5afe('0x12'),_0x5c7fbe,_0xa2f762);_0x1e2c4d(_0xa2f762);});});}exports[_0x5afe('0x15')]=function(_0x1f9ede){var _0x3ac18a=this;return new Promise(function(_0x1ac993,_0xb5c9e8){return db[_0x5afe('0x16')][_0x5afe('0x17')](_0x1f9ede[_0x5afe('0x18')],{'raw':_0x1f9ede[_0x5afe('0x19')]?_0x1f9ede['options'][_0x5afe('0x1a')]===undefined?!![]:![]:!![]})[_0x5afe('0x1b')](function(_0x27b79b){logger[_0x5afe('0xa')]('CreateVoiceTransferReport',_0x1f9ede);logger[_0x5afe('0xc')]('CreateVoiceTransferReport',_0x1f9ede,JSON[_0x5afe('0xe')](_0x27b79b));_0x1ac993(_0x27b79b);})[_0x5afe('0x14')](function(_0x122837){logger[_0x5afe('0xf')]('CreateVoiceTransferReport',_0x122837['message'],_0x1f9ede);_0xb5c9e8(_0x3ac18a[_0x5afe('0xf')](0x1f4,_0x122837[_0x5afe('0x11')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x306230,_0x5af445){var _0x5934b5=function(_0x29ae21){while(--_0x29ae21){_0x306230['push'](_0x306230['shift']());}};_0x5934b5(++_0x5af445);}(_0x5b02,0xe9));var _0x25b0=function(_0x202bde,_0x3c9901){_0x202bde=_0x202bde-0x0;var _0x21c8ea=_0x5b02[_0x202bde];return _0x21c8ea;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router;
\ No newline at end of file
+var _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x480315,_0xfb76d4){var _0x94eaca=function(_0x11f753){while(--_0x11f753){_0x480315['push'](_0x480315['shift']());}};_0x94eaca(++_0xfb76d4);}(_0xedd9,0xfc));var _0x9edd=function(_0x57c57f,_0x32216f){_0x57c57f=_0x57c57f-0x0;var _0x1056c2=_0xedd9[_0x57c57f];return _0x1056c2;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec56=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','catch','calls','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise'];(function(_0x346c58,_0x360421){var _0x56b4b2=function(_0x2125b0){while(--_0x2125b0){_0x346c58['push'](_0x346c58['shift']());}};_0x56b4b2(++_0x360421);}(_0xec56,0x1bd));var _0x6ec5=function(_0x24b0ac,_0x463141){_0x24b0ac=_0x24b0ac-0x0;var _0x44ac5f=_0xec56[_0x24b0ac];return _0x44ac5f;};'use strict';var path=require(_0x6ec5('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x6ec5('0x1'));var util=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var jayson=require(_0x6ec5('0x4'));var amiClient=jayson[_0x6ec5('0x5')][_0x6ec5('0x6')]({'port':0x232a});var logger=require(_0x6ec5('0x7'))(_0x6ec5('0x8'));var Redis=require(_0x6ec5('0x9'));config[_0x6ec5('0xa')]=_[_0x6ec5('0xb')](config[_0x6ec5('0xa')],{'host':_0x6ec5('0xc'),'port':0x18eb});var io=require(_0x6ec5('0xd'))(new Redis(config[_0x6ec5('0xa')]));var Schema=require(_0x6ec5('0xe'));var originateValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'callNumber':{'type':_0x6ec5('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x6ec5('0x11')},'callbackUrl':{'type':_0x6ec5('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':_0x6ec5('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':_0x6ec5('0x11'),'required':[!![],_0x6ec5('0x12')]},'transferNumber':{'type':_0x6ec5('0x11'),'required':[!![],_0x6ec5('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6ec5('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x6ec5('0xf'),'required':[!![],_0x6ec5('0x10')]}});function emit(_0x4d09fe,_0x13b725,_0x3df696){logger[_0x6ec5('0x14')](_0x4d09fe,_0x13b725,JSON[_0x6ec5('0x15')](_0x3df696));io['to'](_0x4d09fe)[_0x6ec5('0x16')](_0x13b725,_0x3df696);}function handleError(_0x42b690){return function(_0x1dbee9){console[_0x6ec5('0x17')](_0x6ec5('0x18'),_0x1dbee9,_0x1dbee9 instanceof RangeError);logger[_0x6ec5('0x19')](_0x1dbee9[_0x6ec5('0x1a')]);if(_0x1dbee9 instanceof RangeError){if(_0x1dbee9[_0x6ec5('0x1b')]){delete _0x1dbee9[_0x6ec5('0x1b')];}_0x42b690[_0x6ec5('0x1c')](0x194)[_0x6ec5('0x1d')](_0x1dbee9);}else{if(_0x1dbee9[_0x6ec5('0x1b')]){delete _0x1dbee9[_0x6ec5('0x1b')];}_0x42b690['status'](0x1f4)[_0x6ec5('0x1d')](_0x1dbee9);}};}function checkError(){return function(_0x1b1d96){if(!_0x1b1d96){throw new RangeError(_0x6ec5('0x1e'));}return _0x1b1d96;};}function respondWithRpcPromise(_0x20f5a6,_0x3fc9d7){return new BPromise(function(_0x38a821,_0x18243f){var _0x48733b=amiClient;return _0x48733b[_0x6ec5('0x1f')](_0x20f5a6,_0x3fc9d7)[_0x6ec5('0x20')](function(_0x358d18){if(_0x358d18[_0x6ec5('0x19')]){if(_0x358d18['error'][_0x6ec5('0x21')]===0x1f4){return _0x18243f(_0x358d18[_0x6ec5('0x19')]['message']);}return _0x38a821(_0x358d18[_0x6ec5('0x19')][_0x6ec5('0x22')]);}else{_0x38a821(_0x358d18[_0x6ec5('0x23')]);}})['catch'](function(_0x1b779a){_0x18243f(_0x1b779a);});});}function getAgent(_0xd0e8d7){return db[_0x6ec5('0x24')][_0x6ec5('0x25')]({'where':{'id':_0xd0e8d7,'role':_0x6ec5('0x26')}})['then'](checkError());}function getAgentCheckSession(_0x171e2a,_0x267a30){return new BPromise(function(_0x4a9860,_0x2570c7){var _0x3f5ee0=respondWithRpcPromise('VoiceChannels');var _0x3d36cb=getAgent(_0x171e2a);Promise[_0x6ec5('0x27')]([_0x3f5ee0,_0x3d36cb])[_0x6ec5('0x20')](function(_0xa227ff){var _0x116659=_0xa227ff[0x0];var _0x5a30ba=_0xa227ff[0x1];var _0x2b8c99=_[_0x6ec5('0x28')](_0x116659[_0x6ec5('0x29')],function(_0x174164){return _0x174164[_0x6ec5('0x2a')]==_0x5a30ba['id']&&_0x174164[_0x6ec5('0x2b')]==_0x267a30;});if(_0x2b8c99[_0x6ec5('0x2c')]==0x1){_0x4a9860(_0x5a30ba);}else{_0x2570c7(new RangeError('sessionId\x20'+_0x267a30+_0x6ec5('0x2d')));}});});}exports['originate']=function(_0x15e1f6,_0x5c6517){logger[_0x6ec5('0x14')](_0x6ec5('0x2e'),_0x15e1f6['body']);var _0x5db924=originateValidation[_0x6ec5('0xe')](_0x15e1f6[_0x6ec5('0x2f')]);if(_0x5db924['length']>0x0){return _0x5c6517[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x5db924);}var _0x54ab73=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x391c01=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x32')];var _0x23a73c=_0x15e1f6[_0x6ec5('0x2f')][_0x6ec5('0x33')];var _0x4b7a08=_0x15e1f6[_0x6ec5('0x2f')]['callbackUrl'];return getAgent(_0x54ab73)[_0x6ec5('0x20')](function(_0xe1e58){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0xe1e58[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0xe1e58[_0x6ec5('0x1b')]),_0x6ec5('0x37'),{'callNumber':_0x391c01,'callerId':_0x23a73c,'callbackUrl':_0x4b7a08});return _0x5c6517[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5c6517));};exports[_0x6ec5('0x38')]=function(_0x519017,_0xf65d54){logger[_0x6ec5('0x14')](_0x6ec5('0x39'),_0x519017[_0x6ec5('0x2f')]);var _0x2b47ab=hangupValidation[_0x6ec5('0xe')](_0x519017[_0x6ec5('0x2f')]);if(_0x2b47ab['length']>0x0){return _0xf65d54[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2b47ab);}var _0x42b134=_0x519017[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x32db57=_0x519017[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x42b134)[_0x6ec5('0x20')](function(_0x53dcd8){logger[_0x6ec5('0x14')]('entityFound:',_0x53dcd8[_0x6ec5('0x1b')]);emit(util['format'](_0x6ec5('0x36'),_0x53dcd8[_0x6ec5('0x1b')]),'webbar:hangup',{'sessionId':_0x32db57});return _0xf65d54[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x3a')});})['catch'](handleError(_0xf65d54));};exports[_0x6ec5('0x3b')]=function(_0x1fc5cb,_0x4a3e6b){logger[_0x6ec5('0x14')](_0x6ec5('0x3c'),_0x1fc5cb[_0x6ec5('0x2f')]);var _0xb8324=answerValidation[_0x6ec5('0xe')](_0x1fc5cb[_0x6ec5('0x2f')]);if(_0xb8324[_0x6ec5('0x2c')]>0x0){return _0x4a3e6b[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0xb8324);}var _0x5a7b9c=_0x1fc5cb[_0x6ec5('0x2f')]['userId'];var _0x17cfed=_0x1fc5cb[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x5a7b9c)[_0x6ec5('0x20')](function(_0x4be992){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x4be992['name']);emit(util[_0x6ec5('0x35')]('user:%s',_0x4be992[_0x6ec5('0x1b')]),_0x6ec5('0x3d'),{'sessionId':_0x17cfed});return _0x4a3e6b[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x4a3e6b));};exports[_0x6ec5('0x3e')]=function(_0x56dc23,_0x2e69ff){logger[_0x6ec5('0x14')](_0x6ec5('0x3f'),_0x56dc23[_0x6ec5('0x2f')]);var _0x2cf8c7=holdValidation['validate'](_0x56dc23['body']);if(_0x2cf8c7[_0x6ec5('0x2c')]>0x0){return _0x2e69ff[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2cf8c7);}var _0x45972a=_0x56dc23[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x4013b1=_0x56dc23[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x45972a)[_0x6ec5('0x20')](function(_0xd265c){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0xd265c[_0x6ec5('0x1b')]);emit(util['format'](_0x6ec5('0x36'),_0xd265c['name']),_0x6ec5('0x40'),{'sessionId':_0x4013b1});return _0x2e69ff[_0x6ec5('0x1c')](0xc8)['json']({'error':![],'message':_0x6ec5('0x41')});})[_0x6ec5('0x42')](handleError(_0x2e69ff));};exports['unhold']=function(_0x23a64d,_0x21a910){logger['info']('unhold\x20fired:',_0x23a64d[_0x6ec5('0x2f')]);var _0x49fa43=unholdValidation['validate'](_0x23a64d[_0x6ec5('0x2f')]);if(_0x49fa43[_0x6ec5('0x2c')]>0x0){return _0x21a910[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x49fa43);}var _0x5aecab=_0x23a64d[_0x6ec5('0x2f')][_0x6ec5('0x31')];var _0x2bad24=_0x23a64d[_0x6ec5('0x2f')][_0x6ec5('0x2b')];return getAgent(_0x5aecab)[_0x6ec5('0x20')](function(_0x15c0d7){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x15c0d7[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0x15c0d7[_0x6ec5('0x1b')]),'webbar:unhold',{'sessionId':_0x2bad24});return _0x21a910[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x6ec5('0x42')](handleError(_0x21a910));};exports[_0x6ec5('0x43')]=function(_0x377c08,_0x1e80bc){logger[_0x6ec5('0x14')]('calls\x20fired:',_0x1e80bc['body']);var _0x282cbc=callsValidation['validate'](_0x377c08[_0x6ec5('0x2f')]);if(_0x282cbc[_0x6ec5('0x2c')]>0x0){return _0x1e80bc[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x282cbc);}var _0x301e31=_0x377c08['body'][_0x6ec5('0x31')];var _0x4838a9=respondWithRpcPromise('VoiceChannels');var _0x5cedd7=getAgent(_0x301e31);return Promise[_0x6ec5('0x27')]([_0x4838a9,_0x5cedd7])[_0x6ec5('0x20')](function(_0x47d81f){var _0x59fd7f=_0x47d81f[0x0];var _0x36d685=_0x47d81f[0x1];var _0x14d38=_[_0x6ec5('0x28')](_0x59fd7f[_0x6ec5('0x29')],function(_0x34578a){return _0x34578a['UserId']==_0x36d685['id'];});return _0x1e80bc[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'count':_0x14d38[_0x6ec5('0x2c')],'rows':_0x14d38});})[_0x6ec5('0x42')](handleError(_0x1e80bc));};exports[_0x6ec5('0x44')]=function(_0x522966,_0x34a136){logger[_0x6ec5('0x14')](_0x6ec5('0x45'),_0x522966[_0x6ec5('0x2f')]);var _0x2a5a1=conferenceValidation[_0x6ec5('0xe')](_0x522966[_0x6ec5('0x2f')]);if(_0x2a5a1[_0x6ec5('0x2c')]>0x0){return _0x34a136[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x2a5a1);}var _0x42623c=_0x522966[_0x6ec5('0x2f')][_0x6ec5('0x31')];return getAgent(_0x42623c)[_0x6ec5('0x20')](function(_0x3ed512){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x3ed512['name']);emit(util[_0x6ec5('0x35')]('user:%s',_0x3ed512[_0x6ec5('0x1b')]),'webbar:conference');return _0x34a136['status'](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x46')});})[_0x6ec5('0x42')](handleError(_0x34a136));};exports[_0x6ec5('0x47')]=function(_0x1d4424,_0x48b5a9){logger[_0x6ec5('0x14')](_0x6ec5('0x48'),_0x1d4424[_0x6ec5('0x2f')]);var _0x189dbc=transferValidation[_0x6ec5('0xe')](_0x1d4424['body']);if(_0x189dbc[_0x6ec5('0x2c')]>0x0){return _0x48b5a9[_0x6ec5('0x1c')](0x190)[_0x6ec5('0x30')](_0x189dbc);}var _0x974b90=_0x1d4424['body'][_0x6ec5('0x31')];var _0x39f48a=_0x1d4424['body']['sessionId'];var _0x12f741=_0x1d4424[_0x6ec5('0x2f')][_0x6ec5('0x49')];return getAgent(_0x974b90)[_0x6ec5('0x20')](function(_0x23e750){logger[_0x6ec5('0x14')](_0x6ec5('0x34'),_0x23e750[_0x6ec5('0x1b')]);emit(util[_0x6ec5('0x35')](_0x6ec5('0x36'),_0x23e750[_0x6ec5('0x1b')]),'webbar:transfer',{'sessionId':_0x39f48a,'transferNumber':_0x12f741});return _0x48b5a9[_0x6ec5('0x1c')](0xc8)[_0x6ec5('0x30')]({'error':![],'message':_0x6ec5('0x4a')});})[_0x6ec5('0x42')](handleError(_0x48b5a9));};
\ No newline at end of file
+var _0x5c12=['name','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','length','\x20not\x20found!','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','all','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','defaults','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','handleError:','error','status','send'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x5c12,0x188));var _0x25c1=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x5c12[_0x265aa2];return _0x447a3a;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x25c1('0x0'));var db=require(_0x25c1('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var jayson=require(_0x25c1('0x4'));var amiClient=jayson[_0x25c1('0x5')][_0x25c1('0x6')]({'port':0x232a});var logger=require(_0x25c1('0x7'))(_0x25c1('0x8'));var Redis=require('ioredis');config[_0x25c1('0x9')]=_[_0x25c1('0xa')](config[_0x25c1('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x25c1('0x9')]));var Schema=require(_0x25c1('0xb'));var originateValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]},'callNumber':{'type':_0x25c1('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x25c1('0xe')},'callbackUrl':{'type':_0x25c1('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':[!![],_0x25c1('0xf')]},'transferNumber':{'type':_0x25c1('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]},'sessionId':{'type':_0x25c1('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x25c1('0xc'),'required':[!![],_0x25c1('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x25c1('0xd')]}});function emit(_0x55b62d,_0x5d631e,_0x5b852a){logger[_0x25c1('0x10')](_0x55b62d,_0x5d631e,JSON[_0x25c1('0x11')](_0x5b852a));io['to'](_0x55b62d)['emit'](_0x5d631e,_0x5b852a);}function handleError(_0x4c55e7){return function(_0x61a29f){console['log'](_0x25c1('0x12'),_0x61a29f,_0x61a29f instanceof RangeError);logger[_0x25c1('0x13')](_0x61a29f['stack']);if(_0x61a29f instanceof RangeError){if(_0x61a29f['name']){delete _0x61a29f['name'];}_0x4c55e7[_0x25c1('0x14')](0x194)[_0x25c1('0x15')](_0x61a29f);}else{if(_0x61a29f[_0x25c1('0x16')]){delete _0x61a29f[_0x25c1('0x16')];}_0x4c55e7['status'](0x1f4)[_0x25c1('0x15')](_0x61a29f);}};}function checkError(){return function(_0x9f54e3){if(!_0x9f54e3){throw new RangeError(_0x25c1('0x17'));}return _0x9f54e3;};}function respondWithRpcPromise(_0x29e637,_0x517a46){return new BPromise(function(_0x4c3259,_0x2a8a84){var _0xac3335=amiClient;return _0xac3335[_0x25c1('0x18')](_0x29e637,_0x517a46)[_0x25c1('0x19')](function(_0x15cf2f){if(_0x15cf2f[_0x25c1('0x13')]){if(_0x15cf2f[_0x25c1('0x13')][_0x25c1('0x1a')]===0x1f4){return _0x2a8a84(_0x15cf2f[_0x25c1('0x13')][_0x25c1('0x1b')]);}return _0x4c3259(_0x15cf2f[_0x25c1('0x13')][_0x25c1('0x1b')]);}else{_0x4c3259(_0x15cf2f[_0x25c1('0x1c')]);}})['catch'](function(_0x2dadae){_0x2a8a84(_0x2dadae);});});}function getAgent(_0x20dbb9){return db[_0x25c1('0x1d')][_0x25c1('0x1e')]({'where':{'id':_0x20dbb9,'role':_0x25c1('0x1f')}})[_0x25c1('0x19')](checkError());}function getAgentCheckSession(_0x5ad776,_0x17c924){return new BPromise(function(_0x428ce8,_0x6cb14f){var _0x38c1d5=respondWithRpcPromise(_0x25c1('0x20'));var _0x193a68=getAgent(_0x5ad776);Promise['all']([_0x38c1d5,_0x193a68])[_0x25c1('0x19')](function(_0x478f1e){var _0x76b360=_0x478f1e[0x0];var _0x31c153=_0x478f1e[0x1];var _0x2c42b9=_[_0x25c1('0x21')](_0x76b360[_0x25c1('0x22')],function(_0x21069c){return _0x21069c[_0x25c1('0x23')]==_0x31c153['id']&&_0x21069c[_0x25c1('0x24')]==_0x17c924;});if(_0x2c42b9[_0x25c1('0x25')]==0x1){_0x428ce8(_0x31c153);}else{_0x6cb14f(new RangeError('sessionId\x20'+_0x17c924+_0x25c1('0x26')));}});});}exports['originate']=function(_0x492715,_0x3db0ee){logger[_0x25c1('0x10')]('originate\x20fired:',_0x492715[_0x25c1('0x27')]);var _0x5a5a32=originateValidation[_0x25c1('0xb')](_0x492715['body']);if(_0x5a5a32[_0x25c1('0x25')]>0x0){return _0x3db0ee[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x5a5a32);}var _0x148e2a=_0x492715[_0x25c1('0x27')][_0x25c1('0x29')];var _0x461d23=_0x492715[_0x25c1('0x27')]['callNumber'];var _0x20a273=_0x492715['body'][_0x25c1('0x2a')];var _0x56de5e=_0x492715[_0x25c1('0x27')][_0x25c1('0x2b')];return getAgent(_0x148e2a)[_0x25c1('0x19')](function(_0x2f86de){logger[_0x25c1('0x10')](_0x25c1('0x2c'),_0x2f86de[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x2f86de[_0x25c1('0x16')]),_0x25c1('0x2f'),{'callNumber':_0x461d23,'callerId':_0x20a273,'callbackUrl':_0x56de5e});return _0x3db0ee[_0x25c1('0x14')](0xc8)[_0x25c1('0x28')]({'error':![],'message':_0x25c1('0x30')});})[_0x25c1('0x31')](handleError(_0x3db0ee));};exports[_0x25c1('0x32')]=function(_0x349aef,_0x30b1d7){logger[_0x25c1('0x10')](_0x25c1('0x33'),_0x349aef['body']);var _0x32cc49=hangupValidation[_0x25c1('0xb')](_0x349aef['body']);if(_0x32cc49[_0x25c1('0x25')]>0x0){return _0x30b1d7['status'](0x190)[_0x25c1('0x28')](_0x32cc49);}var _0x4f978c=_0x349aef[_0x25c1('0x27')][_0x25c1('0x29')];var _0x1cf0b8=_0x349aef[_0x25c1('0x27')][_0x25c1('0x24')];return getAgent(_0x4f978c)['then'](function(_0x1fe6d7){logger['info'](_0x25c1('0x2c'),_0x1fe6d7[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x1fe6d7['name']),'webbar:hangup',{'sessionId':_0x1cf0b8});return _0x30b1d7['status'](0xc8)[_0x25c1('0x28')]({'error':![],'message':_0x25c1('0x34')});})['catch'](handleError(_0x30b1d7));};exports[_0x25c1('0x35')]=function(_0x58792d,_0x3d5172){logger[_0x25c1('0x10')](_0x25c1('0x36'),_0x58792d['body']);var _0x5502c1=answerValidation['validate'](_0x58792d[_0x25c1('0x27')]);if(_0x5502c1[_0x25c1('0x25')]>0x0){return _0x3d5172['status'](0x190)[_0x25c1('0x28')](_0x5502c1);}var _0x4c90f6=_0x58792d[_0x25c1('0x27')]['userId'];var _0x5e43dc=_0x58792d['body']['sessionId'];return getAgent(_0x4c90f6)[_0x25c1('0x19')](function(_0x259250){logger['info'](_0x25c1('0x2c'),_0x259250[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x259250[_0x25c1('0x16')]),_0x25c1('0x37'),{'sessionId':_0x5e43dc});return _0x3d5172[_0x25c1('0x14')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x25c1('0x31')](handleError(_0x3d5172));};exports[_0x25c1('0x38')]=function(_0x389547,_0x4bed0a){logger[_0x25c1('0x10')](_0x25c1('0x39'),_0x389547[_0x25c1('0x27')]);var _0xa009d1=holdValidation['validate'](_0x389547[_0x25c1('0x27')]);if(_0xa009d1[_0x25c1('0x25')]>0x0){return _0x4bed0a[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0xa009d1);}var _0x5d2ecc=_0x389547['body'][_0x25c1('0x29')];var _0x2cd055=_0x389547[_0x25c1('0x27')][_0x25c1('0x24')];return getAgent(_0x5d2ecc)['then'](function(_0x6eff9e){logger[_0x25c1('0x10')]('entityFound:',_0x6eff9e[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x6eff9e[_0x25c1('0x16')]),'webbar:hold',{'sessionId':_0x2cd055});return _0x4bed0a['status'](0xc8)[_0x25c1('0x28')]({'error':![],'message':_0x25c1('0x3a')});})[_0x25c1('0x31')](handleError(_0x4bed0a));};exports['unhold']=function(_0x19028a,_0x2d874b){logger['info'](_0x25c1('0x3b'),_0x19028a[_0x25c1('0x27')]);var _0x2b58a3=unholdValidation[_0x25c1('0xb')](_0x19028a[_0x25c1('0x27')]);if(_0x2b58a3[_0x25c1('0x25')]>0x0){return _0x2d874b[_0x25c1('0x14')](0x190)['json'](_0x2b58a3);}var _0x5344da=_0x19028a['body'][_0x25c1('0x29')];var _0x5c588c=_0x19028a[_0x25c1('0x27')][_0x25c1('0x24')];return getAgent(_0x5344da)[_0x25c1('0x19')](function(_0x153603){logger[_0x25c1('0x10')](_0x25c1('0x2c'),_0x153603['name']);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x153603[_0x25c1('0x16')]),_0x25c1('0x3c'),{'sessionId':_0x5c588c});return _0x2d874b[_0x25c1('0x14')](0xc8)[_0x25c1('0x28')]({'error':![],'message':'unhold\x20executed!'});})[_0x25c1('0x31')](handleError(_0x2d874b));};exports[_0x25c1('0x3d')]=function(_0x18f7c5,_0xbff8ad){logger[_0x25c1('0x10')]('calls\x20fired:',_0xbff8ad[_0x25c1('0x27')]);var _0x3df219=callsValidation['validate'](_0x18f7c5[_0x25c1('0x27')]);if(_0x3df219[_0x25c1('0x25')]>0x0){return _0xbff8ad[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x3df219);}var _0x30ca5d=_0x18f7c5[_0x25c1('0x27')]['userId'];var _0x20ff17=respondWithRpcPromise(_0x25c1('0x20'));var _0x2760ef=getAgent(_0x30ca5d);return Promise[_0x25c1('0x3e')]([_0x20ff17,_0x2760ef])[_0x25c1('0x19')](function(_0x4052c1){var _0x2745b6=_0x4052c1[0x0];var _0x5d54cd=_0x4052c1[0x1];var _0x321833=_[_0x25c1('0x21')](_0x2745b6[_0x25c1('0x22')],function(_0x2d9e6b){return _0x2d9e6b[_0x25c1('0x23')]==_0x5d54cd['id'];});return _0xbff8ad[_0x25c1('0x14')](0xc8)['json']({'count':_0x321833[_0x25c1('0x25')],'rows':_0x321833});})[_0x25c1('0x31')](handleError(_0xbff8ad));};exports[_0x25c1('0x3f')]=function(_0x7a1d7a,_0x3d3ea2){logger[_0x25c1('0x10')](_0x25c1('0x40'),_0x7a1d7a['body']);var _0x44efc9=conferenceValidation['validate'](_0x7a1d7a[_0x25c1('0x27')]);if(_0x44efc9[_0x25c1('0x25')]>0x0){return _0x3d3ea2[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x44efc9);}var _0x3b0785=_0x7a1d7a[_0x25c1('0x27')][_0x25c1('0x29')];return getAgent(_0x3b0785)[_0x25c1('0x19')](function(_0x4c435c){logger[_0x25c1('0x10')](_0x25c1('0x2c'),_0x4c435c[_0x25c1('0x16')]);emit(util[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x4c435c[_0x25c1('0x16')]),_0x25c1('0x41'));return _0x3d3ea2['status'](0xc8)[_0x25c1('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x3d3ea2));};exports['transfer']=function(_0x188b51,_0x4b1ead){logger[_0x25c1('0x10')](_0x25c1('0x42'),_0x188b51[_0x25c1('0x27')]);var _0x58c743=transferValidation[_0x25c1('0xb')](_0x188b51['body']);if(_0x58c743[_0x25c1('0x25')]>0x0){return _0x4b1ead[_0x25c1('0x14')](0x190)[_0x25c1('0x28')](_0x58c743);}var _0x34579c=_0x188b51[_0x25c1('0x27')][_0x25c1('0x29')];var _0x11bdc4=_0x188b51['body'][_0x25c1('0x24')];var _0x46f71f=_0x188b51[_0x25c1('0x27')][_0x25c1('0x43')];return getAgent(_0x34579c)[_0x25c1('0x19')](function(_0x425f3e){logger['info'](_0x25c1('0x2c'),_0x425f3e['name']);emit(util[_0x25c1('0x2d')]('user:%s',_0x425f3e['name']),_0x25c1('0x44'),{'sessionId':_0x11bdc4,'transferNumber':_0x46f71f});return _0x4b1ead['status'](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x4b1ead));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7db=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/notify','notify','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x201c69,_0x1c2b40){var _0x35cd38=function(_0xeaef7a){while(--_0xeaef7a){_0x201c69['push'](_0x201c69['shift']());}};_0x35cd38(++_0x1c2b40);}(_0xd7db,0xea));var _0xbd7d=function(_0x787067,_0x4da513){_0x787067=_0x787067-0x0;var _0x249a5f=_0xd7db[_0x787067];return _0x249a5f;};'use strict';var multer=require('multer');var util=require(_0xbd7d('0x0'));var path=require(_0xbd7d('0x1'));var timeout=require(_0xbd7d('0x2'));var express=require(_0xbd7d('0x3'));var router=express[_0xbd7d('0x4')]();var fs_extra=require(_0xbd7d('0x5'));var auth=require(_0xbd7d('0x6'));var interaction=require(_0xbd7d('0x7'));var config=require(_0xbd7d('0x8'));var controller=require(_0xbd7d('0x9'));router[_0xbd7d('0xa')]('/',auth['isAuthenticated'](),controller[_0xbd7d('0xb')]);router[_0xbd7d('0xa')]('/describe',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0xd')]);router[_0xbd7d('0xa')]('/:id',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0xe')]);router[_0xbd7d('0xa')](_0xbd7d('0xf'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x10')]);router[_0xbd7d('0xa')]('/:id/canned_answers',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x11')]);router[_0xbd7d('0xa')](_0xbd7d('0x12'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x13')]);router[_0xbd7d('0xa')](_0xbd7d('0x14'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x15')]);router[_0xbd7d('0x16')]('/',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x17')]);router[_0xbd7d('0x16')](_0xbd7d('0xf'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x18')]);router[_0xbd7d('0x16')](_0xbd7d('0x19'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x1a')]);router[_0xbd7d('0x16')](_0xbd7d('0x12'),auth[_0xbd7d('0xc')](),controller['addAgents']);router[_0xbd7d('0x16')]('/:id/applications',auth['isAuthenticated'](),controller[_0xbd7d('0x1b')]);router['post'](_0xbd7d('0x1c'),controller[_0xbd7d('0x1d')]);router[_0xbd7d('0x16')]('/:id/send',auth[_0xbd7d('0xc')](),controller['send']);router[_0xbd7d('0x1e')](_0xbd7d('0x1f'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x20')]);router[_0xbd7d('0x21')]('/:id',auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x22')]);router[_0xbd7d('0x21')](_0xbd7d('0xf'),auth['isAuthenticated'](),controller[_0xbd7d('0x23')]);router['delete'](_0xbd7d('0x19'),auth[_0xbd7d('0xc')](),controller[_0xbd7d('0x24')]);router[_0xbd7d('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xbd7d('0x25')]);module[_0xbd7d('0x26')]=router;
\ No newline at end of file
+var _0xf349=['getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','show','/:id/dispositions'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf349,0x78));var _0x9f34=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0xf349[_0x211bc3];return _0x34c9a2;};'use strict';var multer=require(_0x9f34('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9f34('0x1')]();var fs_extra=require(_0x9f34('0x2'));var auth=require(_0x9f34('0x3'));var interaction=require(_0x9f34('0x4'));var config=require(_0x9f34('0x5'));var controller=require('./whatsappAccount.controller');router[_0x9f34('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9f34('0x6')](_0x9f34('0x7'),auth[_0x9f34('0x8')](),controller['describe']);router[_0x9f34('0x6')](_0x9f34('0x9'),auth[_0x9f34('0x8')](),controller[_0x9f34('0xa')]);router[_0x9f34('0x6')](_0x9f34('0xb'),auth[_0x9f34('0x8')](),controller[_0x9f34('0xc')]);router['get'](_0x9f34('0xd'),auth['isAuthenticated'](),controller[_0x9f34('0xe')]);router['get'](_0x9f34('0xf'),auth[_0x9f34('0x8')](),controller['getAgents']);router['get'](_0x9f34('0x10'),auth[_0x9f34('0x8')](),controller[_0x9f34('0x11')]);router[_0x9f34('0x12')]('/',auth[_0x9f34('0x8')](),controller['create']);router[_0x9f34('0x12')](_0x9f34('0xb'),auth[_0x9f34('0x8')](),controller['addDisposition']);router[_0x9f34('0x12')](_0x9f34('0xd'),auth['isAuthenticated'](),controller[_0x9f34('0x13')]);router[_0x9f34('0x12')]('/:id/users',auth[_0x9f34('0x8')](),controller[_0x9f34('0x14')]);router[_0x9f34('0x12')]('/:id/applications',auth[_0x9f34('0x8')](),controller[_0x9f34('0x15')]);router[_0x9f34('0x12')](_0x9f34('0x16'),controller[_0x9f34('0x17')]);router[_0x9f34('0x12')](_0x9f34('0x18'),auth[_0x9f34('0x8')](),controller[_0x9f34('0x19')]);router['put'](_0x9f34('0x9'),auth['isAuthenticated'](),controller[_0x9f34('0x1a')]);router[_0x9f34('0x1b')](_0x9f34('0x9'),auth[_0x9f34('0x8')](),controller[_0x9f34('0x1c')]);router['delete'](_0x9f34('0xb'),auth[_0x9f34('0x8')](),controller[_0x9f34('0x1d')]);router[_0x9f34('0x1b')](_0x9f34('0xd'),auth['isAuthenticated'](),controller[_0x9f34('0x1e')]);router[_0x9f34('0x1b')](_0x9f34('0xf'),auth[_0x9f34('0x8')](),controller[_0x9f34('0x1f')]);module[_0x9f34('0x20')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8bce=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x1e08fa,_0x2177b8){var _0x48a80f=function(_0x38c6d3){while(--_0x38c6d3){_0x1e08fa['push'](_0x1e08fa['shift']());}};_0x48a80f(++_0x2177b8);}(_0x8bce,0x1d1));var _0xe8bc=function(_0x30cf30,_0xccdd58){_0x30cf30=_0x30cf30-0x0;var _0x344678=_0x8bce[_0x30cf30];return _0x344678;};'use strict';var Sequelize=require(_0xe8bc('0x0'));var rs=require(_0xe8bc('0x1'));module[_0xe8bc('0x2')]={'name':{'type':Sequelize[_0xe8bc('0x3')],'unique':_0xe8bc('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe8bc('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe8bc('0x5')]();}},'phone':{'type':Sequelize[_0xe8bc('0x3')]},'type':{'type':Sequelize[_0xe8bc('0x6')]('twilio',_0xe8bc('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xe8bc('0x8')],'defaultValue':function(){return _0xe8bc('0x9');}},'notificationSound':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe8bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe8bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe8bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe8bc('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe8bc('0xa')],'defaultValue':![],'comment':_0xe8bc('0xc'),'set':function(_0x12baea){if(!_0x12baea){this[_0xe8bc('0xd')](_0xe8bc('0xe'),null);}this[_0xe8bc('0xd')](_0xe8bc('0xf'),_0x12baea);}},'description':{'type':Sequelize[_0xe8bc('0x3')]}};
\ No newline at end of file
+var _0xda8f=['TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','twilio','sinch'];(function(_0x3fdbe3,_0x40e7c0){var _0x194e08=function(_0x32e715){while(--_0x32e715){_0x3fdbe3['push'](_0x3fdbe3['shift']());}};_0x194e08(++_0x40e7c0);}(_0xda8f,0xe9));var _0xfda8=function(_0x1b5ff2,_0x4a4850){_0x1b5ff2=_0x1b5ff2-0x0;var _0x14028e=_0xda8f[_0x1b5ff2];return _0x14028e;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfda8('0x0')]={'name':{'type':Sequelize[_0xfda8('0x1')],'unique':_0xfda8('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xfda8('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xfda8('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xfda8('0x1')]},'type':{'type':Sequelize['ENUM'](_0xfda8('0x3'),_0xfda8('0x4'))},'accountSid':{'type':Sequelize[_0xfda8('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xfda8('0x1')]},'notificationTemplate':{'type':Sequelize[_0xfda8('0x5')],'defaultValue':function(){return _0xfda8('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xfda8('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfda8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfda8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfda8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfda8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfda8('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfda8('0x7')],'defaultValue':![],'comment':_0xfda8('0xa'),'set':function(_0x41be5a){if(!_0x41be5a){this[_0xfda8('0xb')](_0xfda8('0xc'),null);}this['setDataValue'](_0xfda8('0xd'),_0x41be5a);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf556=['unmanaged','*,*,*,*','created','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','updatedAt','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','undefined','count','set','apply','save','update','get','WhatsappAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','nolimit','WhatsappAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','Applications','account','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','mobile','twilio','from','From','replace','Body','messageId','notifications','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','ListId','DESC','list','Contacts','CmContact','contact','WhatsappInteraction','interaction','autoclose','push','close'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xf556,0x19c));var _0x6f55=function(_0x19a9b5,_0x198382){_0x19a9b5=_0x19a9b5-0x0;var _0x632733=_0xf556[_0x19a9b5];return _0x632733;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f55('0x0'));var zipdir=require(_0x6f55('0x1'));var jsonpatch=require(_0x6f55('0x2'));var rp=require(_0x6f55('0x3'));var moment=require(_0x6f55('0x4'));var BPromise=require(_0x6f55('0x5'));var Mustache=require(_0x6f55('0x6'));var util=require(_0x6f55('0x7'));var path=require(_0x6f55('0x8'));var sox=require(_0x6f55('0x9'));var csv=require('to-csv');var ejs=require(_0x6f55('0xa'));var fs=require('fs');var fs_extra=require(_0x6f55('0xb'));var _=require(_0x6f55('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f55('0xd'));var deskjs=require(_0x6f55('0xe'));var toCsv=require(_0x6f55('0xf'));var querystring=require(_0x6f55('0x10'));var Papa=require(_0x6f55('0x11'));var Redis=require(_0x6f55('0x12'));var authService=require(_0x6f55('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6f55('0x14'));var hardwareService=require(_0x6f55('0x15'));var logger=require(_0x6f55('0x16'))(_0x6f55('0x17'));var utils=require(_0x6f55('0x18'));var config=require(_0x6f55('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6f55('0x1a')]=_[_0x6f55('0x1b')](config['redis'],{'host':_0x6f55('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f55('0x1a')]));require(_0x6f55('0x1d'))[_0x6f55('0x1e')](socket);var jayson=require(_0x6f55('0x1f'));var client=jayson[_0x6f55('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x47dc69,_0x4207d0,_0x4cb3ed,_0x19f5cb){return new BPromise(function(_0x6ad544,_0x4ac92d){var _0x5287e9=_0x19f5cb||client;return _0x5287e9[_0x6f55('0x21')](_0x47dc69,_0x4cb3ed)[_0x6f55('0x22')](function(_0x560def){logger[_0x6f55('0x23')](_0x6f55('0x24'),_0x4207d0,_0x6f55('0x25'));logger[_0x6f55('0x26')](_0x6f55('0x27'),_0x4207d0,_0x6f55('0x25'),JSON[_0x6f55('0x28')](_0x560def));if(_0x560def[_0x6f55('0x29')]){if(_0x560def[_0x6f55('0x29')][_0x6f55('0x2a')]===0x1f4){logger[_0x6f55('0x29')](_0x6f55('0x24'),_0x4207d0,_0x560def[_0x6f55('0x29')][_0x6f55('0x2b')]);return _0x4ac92d(_0x560def[_0x6f55('0x29')][_0x6f55('0x2b')]);}logger[_0x6f55('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x4207d0,_0x560def[_0x6f55('0x29')][_0x6f55('0x2b')]);return _0x6ad544(_0x560def[_0x6f55('0x29')]['message']);}else{logger['info'](_0x6f55('0x24'),_0x4207d0,_0x6f55('0x25'));_0x6ad544(_0x560def[_0x6f55('0x2c')][_0x6f55('0x2b')]);}})[_0x6f55('0x2d')](function(_0x2f315e){logger[_0x6f55('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x4207d0,_0x2f315e);_0x4ac92d(_0x2f315e);});});}function respondWithStatusCode(_0x35187d,_0x417d77){_0x417d77=_0x417d77||0xcc;return function(_0x5ee457){if(_0x5ee457){return _0x35187d['sendStatus'](_0x417d77);}return _0x35187d[_0x6f55('0x2e')](_0x417d77)['end']();};}function respondWithResult(_0x2f64ed,_0x58274a){_0x58274a=_0x58274a||0xc8;return function(_0x4b12b5){if(_0x4b12b5){return _0x2f64ed['status'](_0x58274a)[_0x6f55('0x2f')](_0x4b12b5);}};}function respondWithFilteredResult(_0x2a7d0b,_0x1b973f){return function(_0x1a65d8){if(_0x1a65d8){var _0x4f9501=typeof _0x1b973f[_0x6f55('0x30')]==='undefined'&&typeof _0x1b973f[_0x6f55('0x31')]===_0x6f55('0x32');var _0x25c40c=_0x1a65d8[_0x6f55('0x33')];var _0x4b59b3=_0x4f9501?0x0:_0x1b973f['offset'];var _0x2e2568=_0x4f9501?_0x1a65d8[_0x6f55('0x33')]:_0x1b973f['offset']+_0x1b973f[_0x6f55('0x31')];var _0x2cef07;if(_0x2e2568>=_0x25c40c){_0x2e2568=_0x25c40c;_0x2cef07=0xc8;}else{_0x2cef07=0xce;}_0x2a7d0b[_0x6f55('0x2e')](_0x2cef07);return _0x2a7d0b[_0x6f55('0x34')]('Content-Range',_0x4b59b3+'-'+_0x2e2568+'/'+_0x25c40c)[_0x6f55('0x2f')](_0x1a65d8);}return null;};}function patchUpdates(_0x4a5ad4){return function(_0x3fe058){try{jsonpatch[_0x6f55('0x35')](_0x3fe058,_0x4a5ad4,!![]);}catch(_0x566137){return BPromise['reject'](_0x566137);}return _0x3fe058[_0x6f55('0x36')]();};}function saveUpdates(_0x3fcbec,_0x1d237c){return function(_0x41e92c){if(_0x41e92c){return _0x41e92c[_0x6f55('0x37')](_0x3fcbec)['then'](function(_0x54628d){return _0x54628d;});}return null;};}function removeEntity(_0x45c78f,_0x479aac){return function(_0x18accc){if(_0x18accc){return _0x18accc['destroy']()[_0x6f55('0x22')](function(){var _0x532c16=_0x18accc[_0x6f55('0x38')]({'plain':!![]});var _0x1e5644=_0x6f55('0x39');return db[_0x6f55('0x3a')][_0x6f55('0x3b')]({'where':{'type':_0x1e5644,'resourceId':_0x532c16['id']}})[_0x6f55('0x22')](function(){return _0x18accc;});})[_0x6f55('0x22')](function(){_0x45c78f[_0x6f55('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22793f,_0x57524f){return function(_0x4b7099){if(!_0x4b7099){_0x22793f[_0x6f55('0x3c')](0x194);}return _0x4b7099;};}function handleError(_0x52a250,_0x4435a3){_0x4435a3=_0x4435a3||0x1f4;return function(_0x398609){logger[_0x6f55('0x29')](_0x398609[_0x6f55('0x3d')]);if(_0x398609[_0x6f55('0x3e')]){delete _0x398609[_0x6f55('0x3e')];}_0x52a250['status'](_0x4435a3)[_0x6f55('0x3f')](_0x398609);};}exports[_0x6f55('0x40')]=function(_0x211329,_0x2a1dfa){var _0x46644c={'include':[{'model':db[_0x6f55('0x41')],'as':_0x6f55('0x42')}]},_0x5c4831={},_0x318e63={'count':0x0,'rows':[]};var _0x24a0bf=_[_0x6f55('0x43')](db[_0x6f55('0x44')][_0x6f55('0x45')],function(_0xcaae2b){return{'name':_0xcaae2b['fieldName'],'type':_0xcaae2b[_0x6f55('0x46')][_0x6f55('0x47')]};});_0x5c4831['model']=_['map'](_0x24a0bf,_0x6f55('0x3e'));_0x5c4831[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x211329[_0x6f55('0x48')]);_0x5c4831['filters']=_[_0x6f55('0x4a')](_0x5c4831['model'],_0x5c4831['query']);_0x46644c[_0x6f55('0x4b')]=_[_0x6f55('0x4a')](_0x5c4831[_0x6f55('0x4c')],qs['fields'](_0x211329['query'][_0x6f55('0x4d')]));_0x46644c[_0x6f55('0x4b')]=_0x46644c[_0x6f55('0x4b')][_0x6f55('0x4e')]?_0x46644c[_0x6f55('0x4b')]:_0x5c4831[_0x6f55('0x4c')];if(!_0x211329[_0x6f55('0x48')][_0x6f55('0x4f')]('nolimit')){_0x46644c[_0x6f55('0x31')]=qs['limit'](_0x211329[_0x6f55('0x48')][_0x6f55('0x31')]);_0x46644c[_0x6f55('0x30')]=qs[_0x6f55('0x30')](_0x211329[_0x6f55('0x48')][_0x6f55('0x30')]);}_0x46644c[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x211329[_0x6f55('0x48')][_0x6f55('0x51')]);_0x46644c[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x211329[_0x6f55('0x48')],_0x5c4831['filters']),_0x24a0bf);if(_0x211329[_0x6f55('0x48')][_0x6f55('0x55')]){_0x46644c['where']=_[_0x6f55('0x56')](_0x46644c[_0x6f55('0x52')],{'$or':_[_0x6f55('0x43')](_0x24a0bf,function(_0x39e6ec){if(_0x39e6ec['type']!==_0x6f55('0x57')){var _0x13a084={};_0x13a084[_0x39e6ec['name']]={'$like':'%'+_0x211329[_0x6f55('0x48')]['filter']+'%'};return _0x13a084;}})});}_0x46644c=_[_0x6f55('0x56')]({},_0x46644c,_0x211329[_0x6f55('0x58')]);var _0x47a6aa={'where':_0x46644c['where']};return db[_0x6f55('0x44')][_0x6f55('0x33')](_0x47a6aa)[_0x6f55('0x22')](function(_0x56afb2){_0x318e63['count']=_0x56afb2;if(_0x211329[_0x6f55('0x48')][_0x6f55('0x59')]){_0x46644c[_0x6f55('0x5a')]=[{'all':!![]}];}return db[_0x6f55('0x44')][_0x6f55('0x5b')](_0x46644c);})[_0x6f55('0x22')](function(_0x44162e){_0x318e63['rows']=_0x44162e;return _0x318e63;})[_0x6f55('0x22')](respondWithFilteredResult(_0x2a1dfa,_0x46644c))['catch'](handleError(_0x2a1dfa,null));};exports[_0x6f55('0x5c')]=function(_0x567505,_0xadbef){var _0x454f90={'raw':![],'where':{'id':_0x567505[_0x6f55('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x6f55('0x42')}]},_0x2acaa6={};_0x2acaa6[_0x6f55('0x4c')]=_['keys'](db[_0x6f55('0x44')][_0x6f55('0x45')]);_0x2acaa6[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x567505[_0x6f55('0x48')]);_0x2acaa6[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x2acaa6['model'],_0x2acaa6[_0x6f55('0x48')]);_0x454f90[_0x6f55('0x4b')]=_['intersection'](_0x2acaa6[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x567505[_0x6f55('0x48')][_0x6f55('0x4d')]));_0x454f90[_0x6f55('0x4b')]=_0x454f90[_0x6f55('0x4b')]['length']?_0x454f90[_0x6f55('0x4b')]:_0x2acaa6['model'];if(_0x567505['query'][_0x6f55('0x59')]){_0x454f90[_0x6f55('0x5a')]=[{'all':!![]}];}_0x454f90=_[_0x6f55('0x56')]({},_0x454f90,_0x567505[_0x6f55('0x58')]);return db['WhatsappAccount'][_0x6f55('0x5e')](_0x454f90)[_0x6f55('0x22')](handleEntityNotFound(_0xadbef,null))[_0x6f55('0x22')](respondWithResult(_0xadbef,null))['catch'](handleError(_0xadbef,null));};exports[_0x6f55('0x5f')]=function(_0x17b535,_0x2a610e){return db[_0x6f55('0x44')]['create'](_0x17b535['body'],{})['then'](function(_0x3e1deb){var _0xcbc48=_0x17b535['user'][_0x6f55('0x38')]({'plain':!![]});if(!_0xcbc48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcbc48[_0x6f55('0x60')]===_0x6f55('0x61')){var _0x26e59b=_0x3e1deb['get']({'plain':!![]});var _0x528b43='WhatsappAccounts';return db[_0x6f55('0x62')][_0x6f55('0x5e')]({'where':{'name':_0x528b43,'userProfileId':_0xcbc48[_0x6f55('0x63')]},'raw':!![]})[_0x6f55('0x22')](function(_0x359e27){if(_0x359e27&&_0x359e27[_0x6f55('0x64')]===0x0){return db['UserProfileResource'][_0x6f55('0x5f')]({'name':_0x26e59b[_0x6f55('0x3e')],'resourceId':_0x26e59b['id'],'type':_0x359e27[_0x6f55('0x3e')],'sectionId':_0x359e27['id']},{})[_0x6f55('0x22')](function(){return _0x3e1deb;});}else{return _0x3e1deb;}})[_0x6f55('0x2d')](function(_0x551633){logger[_0x6f55('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x551633);throw _0x551633;});}return _0x3e1deb;})[_0x6f55('0x22')](respondWithResult(_0x2a610e,0xc9))['catch'](handleError(_0x2a610e,null));};exports['update']=function(_0x8a828b,_0x364a71){if(_0x8a828b[_0x6f55('0x65')]['id']){delete _0x8a828b[_0x6f55('0x65')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x8a828b[_0x6f55('0x5d')]['id']},'include':[{'model':db[_0x6f55('0x41')],'as':_0x6f55('0x42')}]})['then'](handleEntityNotFound(_0x364a71,null))[_0x6f55('0x22')](saveUpdates(_0x8a828b[_0x6f55('0x65')],null))[_0x6f55('0x22')](respondWithResult(_0x364a71,null))[_0x6f55('0x2d')](handleError(_0x364a71,null));};exports['destroy']=function(_0x1b3550,_0x53dd86){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x1b3550['params']['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x53dd86,null))[_0x6f55('0x22')](removeEntity(_0x53dd86,null))[_0x6f55('0x2d')](handleError(_0x53dd86,null));};exports[_0x6f55('0x66')]=function(_0x4633e4,_0x45f573){return db['WhatsappAccount'][_0x6f55('0x66')]()[_0x6f55('0x22')](respondWithResult(_0x45f573,null))['catch'](handleError(_0x45f573,null));};exports[_0x6f55('0x67')]=function(_0x2fb329,_0x3c76b2,_0xe9dbd6){if(_0x2fb329[_0x6f55('0x65')]['id']){delete _0x2fb329['body']['id'];}return db['WhatsappAccount'][_0x6f55('0x5e')]({'where':{'id':_0x2fb329[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x3c76b2,null))[_0x6f55('0x22')](function(_0x52dd0d){if(_0x52dd0d){_0x2fb329[_0x6f55('0x65')]['WhatsappAccountId']=_0x52dd0d['id'];return db[_0x6f55('0x68')][_0x6f55('0x5f')](_0x2fb329['body']);}})[_0x6f55('0x22')](respondWithResult(_0x3c76b2,null))[_0x6f55('0x2d')](handleError(_0x3c76b2,null));};exports['getDispositions']=function(_0x1b670e,_0x231399,_0x4477e9){var _0x23e8b3={'raw':![],'where':{}};var _0x50f750={};var _0x33407d={'count':0x0,'rows':[]};return db[_0x6f55('0x44')]['findOne']({'where':{'id':_0x1b670e[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x231399,null))[_0x6f55('0x22')](function(_0x4e9787){if(_0x4e9787){_0x50f750[_0x6f55('0x4c')]=_[_0x6f55('0x49')](db[_0x6f55('0x68')][_0x6f55('0x45')]);_0x50f750[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x1b670e['query']);_0x50f750[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x50f750[_0x6f55('0x4c')],_0x50f750[_0x6f55('0x48')]);_0x23e8b3['attributes']=_[_0x6f55('0x4a')](_0x50f750[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x1b670e[_0x6f55('0x48')]['fields']));_0x23e8b3[_0x6f55('0x4b')]=_0x23e8b3[_0x6f55('0x4b')][_0x6f55('0x4e')]?_0x23e8b3[_0x6f55('0x4b')]:_0x50f750[_0x6f55('0x4c')];if(!_0x1b670e['query'][_0x6f55('0x4f')](_0x6f55('0x69'))){_0x23e8b3['limit']=qs[_0x6f55('0x31')](_0x1b670e['query'][_0x6f55('0x31')]);_0x23e8b3['offset']=qs[_0x6f55('0x30')](_0x1b670e['query']['offset']);}_0x23e8b3[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x1b670e[_0x6f55('0x48')][_0x6f55('0x51')]);_0x23e8b3[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_['pick'](_0x1b670e['query'],_0x50f750[_0x6f55('0x53')]));_0x23e8b3[_0x6f55('0x52')][_0x6f55('0x6a')]=_0x4e9787['id'];if(_0x1b670e[_0x6f55('0x48')][_0x6f55('0x55')]){_0x23e8b3[_0x6f55('0x52')]=_['merge'](_0x23e8b3[_0x6f55('0x52')],{'$or':_['map'](_0x23e8b3[_0x6f55('0x4b')],function(_0x43ab96){var _0x4cc0a2={};_0x4cc0a2[_0x43ab96]={'$like':'%'+_0x1b670e['query']['filter']+'%'};return _0x4cc0a2;})});}_0x23e8b3=_[_0x6f55('0x56')]({},_0x23e8b3,_0x1b670e[_0x6f55('0x58')]);return db[_0x6f55('0x68')][_0x6f55('0x33')]({'where':_0x23e8b3['where']})[_0x6f55('0x22')](function(_0x137c14){_0x33407d['count']=_0x137c14;if(_0x1b670e[_0x6f55('0x48')][_0x6f55('0x59')]){_0x23e8b3[_0x6f55('0x5a')]=[{'all':!![]}];}return db[_0x6f55('0x68')][_0x6f55('0x5b')](_0x23e8b3);})[_0x6f55('0x22')](function(_0x4bcfb0){_0x33407d[_0x6f55('0x6b')]=_0x4bcfb0;return _0x33407d;});}})[_0x6f55('0x22')](respondWithFilteredResult(_0x231399,_0x23e8b3))[_0x6f55('0x2d')](handleError(_0x231399,null));};exports['removeDispositions']=function(_0x12e1a2,_0x5ea4c5,_0x227a76){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x12e1a2[_0x6f55('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5ea4c5,null))[_0x6f55('0x22')](function(_0x43a3ce){if(_0x43a3ce){return _0x43a3ce[_0x6f55('0x6c')](_0x12e1a2[_0x6f55('0x48')][_0x6f55('0x6d')]);}})[_0x6f55('0x22')](respondWithStatusCode(_0x5ea4c5,null))[_0x6f55('0x2d')](handleError(_0x5ea4c5,null));};exports[_0x6f55('0x6e')]=function(_0x57e8b6,_0x17045b,_0x45ec5a){if(_0x57e8b6['body']['id']){delete _0x57e8b6['body']['id'];}return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x57e8b6[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x17045b,null))[_0x6f55('0x22')](function(_0x388fc1){if(_0x388fc1){_0x57e8b6[_0x6f55('0x65')][_0x6f55('0x6a')]=_0x388fc1['id'];return db[_0x6f55('0x6f')][_0x6f55('0x5f')](_0x57e8b6['body']);}})[_0x6f55('0x22')](respondWithResult(_0x17045b,null))[_0x6f55('0x2d')](handleError(_0x17045b,null));};exports[_0x6f55('0x70')]=function(_0x51adf6,_0x33e7d5,_0x377231){var _0x3a6b97={'raw':![],'where':{}};var _0x4d847b={};var _0x56d1f0={'count':0x0,'rows':[]};return db[_0x6f55('0x44')]['findOne']({'where':{'id':_0x51adf6[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x33e7d5,null))[_0x6f55('0x22')](function(_0xf46352){if(_0xf46352){_0x4d847b[_0x6f55('0x4c')]=_['keys'](db[_0x6f55('0x6f')][_0x6f55('0x45')]);_0x4d847b[_0x6f55('0x48')]=_[_0x6f55('0x49')](_0x51adf6[_0x6f55('0x48')]);_0x4d847b[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x4d847b[_0x6f55('0x4c')],_0x4d847b[_0x6f55('0x48')]);_0x3a6b97['attributes']=_[_0x6f55('0x4a')](_0x4d847b[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x51adf6[_0x6f55('0x48')][_0x6f55('0x4d')]));_0x3a6b97['attributes']=_0x3a6b97[_0x6f55('0x4b')][_0x6f55('0x4e')]?_0x3a6b97[_0x6f55('0x4b')]:_0x4d847b[_0x6f55('0x4c')];if(!_0x51adf6[_0x6f55('0x48')][_0x6f55('0x4f')]('nolimit')){_0x3a6b97[_0x6f55('0x31')]=qs[_0x6f55('0x31')](_0x51adf6[_0x6f55('0x48')][_0x6f55('0x31')]);_0x3a6b97[_0x6f55('0x30')]=qs[_0x6f55('0x30')](_0x51adf6[_0x6f55('0x48')][_0x6f55('0x30')]);}_0x3a6b97['order']=qs[_0x6f55('0x51')](_0x51adf6['query'][_0x6f55('0x51')]);_0x3a6b97[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x51adf6['query'],_0x4d847b[_0x6f55('0x53')]));_0x3a6b97[_0x6f55('0x52')]['WhatsappAccountId']=_0xf46352['id'];if(_0x51adf6[_0x6f55('0x48')]['filter']){_0x3a6b97[_0x6f55('0x52')]=_[_0x6f55('0x56')](_0x3a6b97[_0x6f55('0x52')],{'$or':_[_0x6f55('0x43')](_0x3a6b97[_0x6f55('0x4b')],function(_0x59a99e){var _0x344f13={};_0x344f13[_0x59a99e]={'$like':'%'+_0x51adf6['query'][_0x6f55('0x55')]+'%'};return _0x344f13;})});}_0x3a6b97=_['merge']({},_0x3a6b97,_0x51adf6[_0x6f55('0x58')]);return db['CannedAnswer']['count']({'where':_0x3a6b97[_0x6f55('0x52')]})[_0x6f55('0x22')](function(_0x4ac292){_0x56d1f0['count']=_0x4ac292;if(_0x51adf6[_0x6f55('0x48')][_0x6f55('0x59')]){_0x3a6b97['include']=[{'all':!![]}];}return db[_0x6f55('0x6f')][_0x6f55('0x5b')](_0x3a6b97);})[_0x6f55('0x22')](function(_0x1dc549){_0x56d1f0[_0x6f55('0x6b')]=_0x1dc549;return _0x56d1f0;});}})[_0x6f55('0x22')](respondWithFilteredResult(_0x33e7d5,_0x3a6b97))[_0x6f55('0x2d')](handleError(_0x33e7d5,null));};exports[_0x6f55('0x71')]=function(_0x5ebf73,_0x64a47d,_0x8ee6e3){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x5ebf73['params']['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x64a47d,null))[_0x6f55('0x22')](function(_0x27edd3){if(_0x27edd3){return _0x27edd3[_0x6f55('0x71')](_0x5ebf73[_0x6f55('0x48')][_0x6f55('0x6d')]);}})['then'](respondWithStatusCode(_0x64a47d,null))[_0x6f55('0x2d')](handleError(_0x64a47d,null));};exports[_0x6f55('0x72')]=function(_0x512c65,_0xf80d74,_0x2723c1){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x512c65['params']['id']}})['then'](handleEntityNotFound(_0xf80d74,null))[_0x6f55('0x22')](function(_0x4a1028){if(_0x4a1028){return _0x4a1028[_0x6f55('0x72')](_0x512c65['body'][_0x6f55('0x6d')],_[_0x6f55('0x73')](_0x512c65[_0x6f55('0x65')],[_0x6f55('0x6d'),'id'])||{})[_0x6f55('0x74')](function(_0x5b3d93){for(var _0x3ac8ba=0x0;_0x3ac8ba<_0x512c65[_0x6f55('0x65')][_0x6f55('0x6d')]['length'];_0x3ac8ba+=0x1){socket[_0x6f55('0x75')](_0x6f55('0x76'),{'UserId':Number(_0x512c65[_0x6f55('0x65')][_0x6f55('0x6d')][_0x3ac8ba]),'WhatsappAccountId':Number(_0x512c65[_0x6f55('0x5d')]['id'])});}return _0x5b3d93;});}})[_0x6f55('0x22')](respondWithResult(_0xf80d74,null))[_0x6f55('0x2d')](handleError(_0xf80d74,null));};exports[_0x6f55('0x77')]=function(_0x456448,_0x52efa3,_0x43e1de){return db[_0x6f55('0x44')][_0x6f55('0x5e')]({'where':{'id':_0x456448[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x52efa3,null))['then'](function(_0x26d858){if(_0x26d858){return _0x26d858['removeAgents'](_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')])['then'](function(){if(_[_0x6f55('0x78')](_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')])){for(var _0x29329a=0x0;_0x29329a<_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')]['length'];_0x29329a+=0x1){socket[_0x6f55('0x75')](_0x6f55('0x79'),{'UserId':Number(_0x456448[_0x6f55('0x48')][_0x6f55('0x6d')][_0x29329a]),'WhatsappAccountId':Number(_0x456448['params']['id'])});}}else{socket[_0x6f55('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x456448['query']['ids']),'WhatsappAccountId':Number(_0x456448[_0x6f55('0x5d')]['id'])});}});}})[_0x6f55('0x22')](respondWithStatusCode(_0x52efa3,null))[_0x6f55('0x2d')](handleError(_0x52efa3,null));};exports[_0x6f55('0x7a')]=function(_0x413545,_0x4386b8,_0x2d04f5){var _0xc1cfe8={};var _0x36f932={};var _0x4acc58;var _0xff51a4;return db[_0x6f55('0x44')]['findOne']({'where':{'id':_0x413545[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x4386b8,null))[_0x6f55('0x22')](function(_0xe55ad4){if(_0xe55ad4){_0x4acc58=_0xe55ad4;_0x36f932['model']=_[_0x6f55('0x49')](db[_0x6f55('0x7b')]['rawAttributes']);_0x36f932['query']=_['keys'](_0x413545[_0x6f55('0x48')]);_0x36f932['filters']=_[_0x6f55('0x4a')](_0x36f932[_0x6f55('0x4c')],_0x36f932[_0x6f55('0x48')]);_0xc1cfe8[_0x6f55('0x4b')]=_[_0x6f55('0x4a')](_0x36f932['model'],qs['fields'](_0x413545[_0x6f55('0x48')][_0x6f55('0x4d')]));_0xc1cfe8['attributes']=_0xc1cfe8['attributes'][_0x6f55('0x4e')]?_0xc1cfe8[_0x6f55('0x4b')]:_0x36f932[_0x6f55('0x4c')];_0xc1cfe8[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x413545[_0x6f55('0x48')]['sort']);_0xc1cfe8['where']=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x413545[_0x6f55('0x48')],_0x36f932[_0x6f55('0x53')]));if(_0x413545['query']['filter']){_0xc1cfe8[_0x6f55('0x52')]=_[_0x6f55('0x56')](_0xc1cfe8['where'],{'$or':_[_0x6f55('0x43')](_0xc1cfe8[_0x6f55('0x4b')],function(_0x5de970){var _0x96951a={};_0x96951a[_0x5de970]={'$like':'%'+_0x413545[_0x6f55('0x48')]['filter']+'%'};return _0x96951a;})});}_0xc1cfe8=_[_0x6f55('0x56')]({},_0xc1cfe8,_0x413545[_0x6f55('0x58')]);return _0x4acc58[_0x6f55('0x7a')](_0xc1cfe8);}})[_0x6f55('0x22')](function(_0x3dc59a){if(_0x3dc59a){_0xff51a4=_0x3dc59a[_0x6f55('0x4e')];if(!_0x413545[_0x6f55('0x48')][_0x6f55('0x4f')](_0x6f55('0x69'))){_0xc1cfe8[_0x6f55('0x31')]=qs[_0x6f55('0x31')](_0x413545[_0x6f55('0x48')][_0x6f55('0x31')]);_0xc1cfe8[_0x6f55('0x30')]=qs[_0x6f55('0x30')](_0x413545['query'][_0x6f55('0x30')]);}return _0x4acc58[_0x6f55('0x7a')](_0xc1cfe8);}})[_0x6f55('0x22')](function(_0xf96e91){if(_0xf96e91){return _0xf96e91?{'count':_0xff51a4,'rows':_0xf96e91}:null;}})[_0x6f55('0x22')](respondWithResult(_0x4386b8,null))['catch'](handleError(_0x4386b8,null));};exports[_0x6f55('0x7c')]=function(_0x1380b4,_0x437458){var _0x199f34=_0x1380b4[_0x6f55('0x5d')]['id'];var _0x399bf1=_0x1380b4[_0x6f55('0x65')];var _0x4e185e=0xc8;var _0x3cfbd9=null;return db['sequelize'][_0x6f55('0x7d')]({'isolationLevel':db['sequelize'][_0x6f55('0x7e')][_0x6f55('0x7f')][_0x6f55('0x80')]},function(_0x202d00){return db['WhatsappAccount'][_0x6f55('0x81')]({'where':{'id':_0x199f34},'transaction':_0x202d00})[_0x6f55('0x22')](function(_0x387d89){if(_0x387d89){return db[_0x6f55('0x82')][_0x6f55('0x3b')]({'where':{'WhatsappAccountId':_0x199f34},'transaction':_0x202d00})['then'](function(){var _0x3d7b9a=_[_0x6f55('0x43')](_0x399bf1,function(_0x330dcf){_0x330dcf['WhatsappAccountId']=_0x199f34;return _0x330dcf;});return db[_0x6f55('0x82')][_0x6f55('0x83')](_0x3d7b9a,{'transaction':_0x202d00});});}else{_0x4e185e=0x194;_0x3cfbd9=[];}});})[_0x6f55('0x22')](function(){if(_0x4e185e!==0x194){return db[_0x6f55('0x82')][_0x6f55('0x84')]({'where':{'WhatsappAccountId':_0x199f34},'order':_0x6f55('0x85')})[_0x6f55('0x22')](function(_0x59b46d){_0x3cfbd9=_0x59b46d;});}})[_0x6f55('0x2d')](function(_0x1ddf1f){_0x4e185e=0x1f4;logger[_0x6f55('0x29')](_0x1ddf1f['stack']);if(_0x1ddf1f[_0x6f55('0x3e')]){delete _0x1ddf1f[_0x6f55('0x3e')];}_0x3cfbd9=_0x1ddf1f;})[_0x6f55('0x86')](function(){if(_0x3cfbd9===null){_0x437458[_0x6f55('0x3c')](_0x4e185e);}else{if(_0x4e185e===0x1f4){_0x437458['status'](_0x4e185e)[_0x6f55('0x3f')](_0x3cfbd9);}else{_0x437458['status'](_0x4e185e)[_0x6f55('0x2f')](_0x3cfbd9);}}});};exports[_0x6f55('0x87')]=function(_0x20a5c8,_0x491fcb,_0x3f5218){var _0x497306={};var _0x16a3fe={};var _0x3f1df3;var _0x2f7ed4;return db[_0x6f55('0x44')][_0x6f55('0x81')]({'where':{'id':_0x20a5c8[_0x6f55('0x5d')]['id']}})[_0x6f55('0x22')](handleEntityNotFound(_0x491fcb,null))[_0x6f55('0x22')](function(_0x2c8c4c){if(_0x2c8c4c){_0x3f1df3=_0x2c8c4c;_0x16a3fe[_0x6f55('0x4c')]=_[_0x6f55('0x49')](db[_0x6f55('0x82')]['rawAttributes']);_0x16a3fe['query']=_[_0x6f55('0x49')](_0x20a5c8['query']);_0x16a3fe[_0x6f55('0x53')]=_[_0x6f55('0x4a')](_0x16a3fe[_0x6f55('0x4c')],_0x16a3fe['query']);_0x497306['attributes']=_[_0x6f55('0x4a')](_0x16a3fe[_0x6f55('0x4c')],qs[_0x6f55('0x4d')](_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x4d')]));_0x497306['attributes']=_0x497306[_0x6f55('0x4b')]['length']?_0x497306['attributes']:_0x16a3fe[_0x6f55('0x4c')];_0x497306[_0x6f55('0x50')]=qs[_0x6f55('0x51')](_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x51')]);_0x497306[_0x6f55('0x52')]=qs[_0x6f55('0x53')](_[_0x6f55('0x54')](_0x20a5c8[_0x6f55('0x48')],_0x16a3fe[_0x6f55('0x53')]));if(_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x55')]){_0x497306[_0x6f55('0x52')]=_[_0x6f55('0x56')](_0x497306['where'],{'$or':_[_0x6f55('0x43')](_0x497306[_0x6f55('0x4b')],function(_0x5668db){var _0x2f3453={};_0x2f3453[_0x5668db]={'$like':'%'+_0x20a5c8[_0x6f55('0x48')]['filter']+'%'};return _0x2f3453;})});}_0x497306=_[_0x6f55('0x56')]({},_0x497306,_0x20a5c8[_0x6f55('0x58')]);return _0x3f1df3[_0x6f55('0x87')](_0x497306);}})[_0x6f55('0x22')](function(_0x144b6c){if(_0x144b6c){_0x2f7ed4=_0x144b6c[_0x6f55('0x4e')];if(!_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x4f')]('nolimit')){_0x497306[_0x6f55('0x31')]=qs[_0x6f55('0x31')](_0x20a5c8[_0x6f55('0x48')]['limit']);_0x497306['offset']=qs[_0x6f55('0x30')](_0x20a5c8[_0x6f55('0x48')][_0x6f55('0x30')]);}return _0x3f1df3[_0x6f55('0x87')](_0x497306);}})['then'](function(_0x10b608){if(_0x10b608){return _0x10b608?{'count':_0x2f7ed4,'rows':_0x10b608}:null;}})['then'](respondWithResult(_0x491fcb,null))['catch'](handleError(_0x491fcb,null));};exports['notify']=function(_0x1e446d,_0x44c24c,_0x589605){var _0x4e894b={'channel':'whatsapp'};var _0x5327a9=[];var _0x43082b=[];var _0x2795f5={};return db[_0x6f55('0x44')]['find']({'where':{'id':_0x1e446d[_0x6f55('0x5d')]['id']},'include':[{'model':db[_0x6f55('0x82')],'as':_0x6f55('0x88')}]})['then'](handleEntityNotFound(_0x44c24c,null))[_0x6f55('0x22')](function(_0x3b3667){_0x4e894b[_0x6f55('0x89')]=_0x3b3667;if(_0x4e894b[_0x6f55('0x89')]&&_0x4e894b[_0x6f55('0x89')][_0x6f55('0x46')]==='sinch'&&_0x1e446d[_0x6f55('0x65')]['statuses']){if(_0x1e446d['body']['statuses']['length']===0x0)return;if(_0x1e446d['body'][_0x6f55('0x8a')][0x0][_0x6f55('0x8b')]!=='read')return;return db[_0x6f55('0x8c')][_0x6f55('0x37')]({'read':!![],'readAt':_0x1e446d['body'][_0x6f55('0x8a')][0x0][_0x6f55('0x8d')]},{'where':{'messageId':_0x1e446d[_0x6f55('0x65')]['statuses'][0x0][_0x6f55('0x8e')]},'individualHooks':!![]})[_0x6f55('0x22')](function(_0x111dfe){return _0x44c24c[_0x6f55('0x2e')](0xc8)[_0x6f55('0x2f')](_0x111dfe);});}_0x4e894b[_0x6f55('0x8f')]=_[_0x6f55('0x90')](_0x3b3667[_0x6f55('0x88')],[_0x6f55('0x85')],[_0x6f55('0x91')]);if(_0x4e894b[_0x6f55('0x89')]['Applications']){delete _0x4e894b['account'][_0x6f55('0x88')];}return db['CmContact'][_0x6f55('0x66')]()['then'](function(_0x3e3599){if(!_0x3e3599){throw new db[(_0x6f55('0x92'))]['ValidationError'](_0x6f55('0x93'));}_0x5327a9=_['difference'](_[_0x6f55('0x49')](_0x3e3599),['createdAt','updatedAt']);_0x43082b=_[_0x6f55('0x94')](_[_0x6f55('0x49')](_0x3e3599),[_0x6f55('0x95'),'updatedAt',_0x6f55('0x96'),'ListId']);_0x4e894b[_0x6f55('0x65')]={'mapKey':_0x6f55('0x97')};if(_0x4e894b[_0x6f55('0x89')]&&_0x4e894b[_0x6f55('0x89')][_0x6f55('0x46')]===_0x6f55('0x98')){_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')]=_0x1e446d[_0x6f55('0x65')][_0x6f55('0x9a')][_0x6f55('0x9b')]('whatsapp:','');_0x4e894b[_0x6f55('0x65')][_0x6f55('0x65')]=_0x1e446d[_0x6f55('0x65')][_0x6f55('0x9c')];_0x4e894b[_0x6f55('0x65')][_0x6f55('0x9d')]=_0x1e446d[_0x6f55('0x65')]['MessageSid'];}if(_0x4e894b[_0x6f55('0x89')]&&_0x4e894b[_0x6f55('0x89')]['type']==='sinch'){_0x4e894b['body'][_0x6f55('0x99')]=_0x1e446d['body'][_0x6f55('0x9e')][0x0][_0x6f55('0x99')];_0x4e894b[_0x6f55('0x65')][_0x6f55('0x65')]=_0x1e446d[_0x6f55('0x65')][_0x6f55('0x9e')][0x0][_0x6f55('0x2b')][_0x6f55('0x65')];_0x4e894b[_0x6f55('0x65')]['messageId']=_0x1e446d[_0x6f55('0x65')]['notifications'][0x0][_0x6f55('0x8e')];}if(_0x4e894b[_0x6f55('0x65')]['id']){delete _0x4e894b[_0x6f55('0x65')]['id'];}if(_['isNil'](_0x4e894b[_0x6f55('0x65')]['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x6f55('0x9f')](_0x4e894b[_0x6f55('0x65')][_0x6f55('0x65')])||_0x4e894b[_0x6f55('0x65')]['body']===''){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))](_0x6f55('0xa1'));}if(_[_0x6f55('0x9f')](_0x4e894b[_0x6f55('0x65')][_0x6f55('0xa2')])){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43082b);}if(!_[_0x6f55('0xa3')](_0x43082b,_0x4e894b['body'][_0x6f55('0xa2')])){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43082b);}_0x2795f5[_0x4e894b['body']['mapKey']]=_0x4e894b[_0x6f55('0x65')]['from'];return db[_0x6f55('0xa4')]['find']({'where':{'id':_0x4e894b[_0x6f55('0x89')][_0x6f55('0xa5')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2795f5,'limit':0x1,'order':[['updatedAt',_0x6f55('0xa6')]]}]});})[_0x6f55('0x22')](handleEntityNotFound(_0x44c24c,null))[_0x6f55('0x22')](function(_0x355803){if(_0x355803){_0x4e894b[_0x6f55('0xa7')]=_['omit'](_0x355803,[_0x6f55('0xa8')]);if(_0x355803[_0x6f55('0xa8')][_0x6f55('0x4e')]){return _0x355803['Contacts'][0x0];}var _0x524010=_[_0x6f55('0x1b')](_0x4e894b['body'],{'firstName':_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')],'ListId':_0x355803['id']});_0x524010[_0x4e894b[_0x6f55('0x65')][_0x6f55('0xa2')]]=_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')];return db[_0x6f55('0xa9')][_0x6f55('0x5f')](_0x524010,{'fields':_0x5327a9,'raw':!![]});}})[_0x6f55('0x22')](handleEntityNotFound(_0x44c24c,null))[_0x6f55('0x22')](function(_0x4e5673){if(_0x4e5673){_0x4e894b[_0x6f55('0xaa')]=_0x4e5673;var _0x329453={'ContactId':_0x4e5673['id'],'phone':_0x4e894b[_0x6f55('0x65')][_0x6f55('0x99')],'WhatsappAccountId':_0x1e446d[_0x6f55('0x5d')]['id']};var _0x15dac0={'ContactId':_0x4e5673['id'],'WhatsappAccountId':_0x1e446d[_0x6f55('0x5d')]['id'],'closed':![]};return db[_0x6f55('0xab')][_0x6f55('0x5e')]({'where':_0x15dac0})[_0x6f55('0x22')](function(_0x2d8b20){if(_0x2d8b20){return[_0x2d8b20,![]];}return db['WhatsappInteraction'][_0x6f55('0x5f')](_0x329453)['then'](function(_0x3c66e9){return[_0x3c66e9,!![]];});});}})[_0x6f55('0x74')](function(_0x20c090,_0x1464a8){_0x4e894b[_0x6f55('0xac')]=_0x20c090[_0x6f55('0x38')]({'plain':!![]});_0x4e894b['interaction']['created']=![];if(_0x1464a8){if(_0x4e894b[_0x6f55('0x89')][_0x6f55('0xad')]){_0x4e894b[_0x6f55('0x8f')][_0x6f55('0xae')]({'id':0x0,'priority':_0x4e894b[_0x6f55('0x8f')][_0x6f55('0x4e')]+0x1,'app':_0x6f55('0xaf'),'appdata':_0x6f55('0xb0'),'interval':_0x6f55('0xb1')});}_0x4e894b['interaction'][_0x6f55('0xb2')]=!![];}return db[_0x6f55('0x8c')]['create']({'phone':_0x4e894b[_0x6f55('0x65')]['from'],'messageId':_0x4e894b[_0x6f55('0x65')][_0x6f55('0x9d')],'body':_0x4e894b['body'][_0x6f55('0x65')],'WhatsappAccountId':_0x1e446d[_0x6f55('0x5d')]['id'],'WhatsappInteractionId':_0x20c090['id'],'direction':'in','ContactId':_0x20c090['ContactId'],'AttachmentId':_0x4e894b[_0x6f55('0x65')]['AttachmentId']});})[_0x6f55('0x22')](function(_0x569942){_0x4e894b['message']=_0x569942;if(!_0x4e894b['interaction']['UserId'])return;return db[_0x6f55('0x7b')][_0x6f55('0x5e')]({'attributes':['id',_0x6f55('0x3e')],'where':{'id':_0x4e894b[_0x6f55('0xac')]['UserId']}});})['then'](function(_0x2de1b7){if(_0x2de1b7){_0x4e894b[_0x6f55('0x8f')][_0x6f55('0xb3')]({'id':0x0,'priority':0x0,'app':_0x6f55('0xb4'),'appdata':_0x2de1b7[_0x6f55('0x3e')]+','+(_0x4e894b[_0x6f55('0x89')][_0x6f55('0xb5')]||0xa),'interval':_0x6f55('0xb1')});}if(!_0x4e894b[_0x6f55('0xac')][_0x6f55('0xb6')])return;return db[_0x6f55('0xb7')][_0x6f55('0x5e')]({'attributes':['id',_0x6f55('0x3e')],'where':{'id':_0x4e894b[_0x6f55('0xac')][_0x6f55('0xb6')]}});})['then'](function(_0x35b032){if(_0x35b032){_0x4e894b[_0x6f55('0x8f')][_0x6f55('0xb3')]({'id':0x0,'priority':0x1,'app':_0x6f55('0xb8'),'appdata':_0x35b032['name']+','+(_0x4e894b['account'][_0x6f55('0xb9')]||0x12c),'interval':_0x6f55('0xb1')});}return respondWithRpcPromise('Start','startRouting',_0x4e894b);})[_0x6f55('0x22')](function(_0x2387a8){if(_0x2387a8){var _0x5b926a=0xc8;var _0x1fc484='receiveMessage';logger[_0x6f55('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1fc484,_0x5b926a,_0x6f55('0xba'));logger['debug'](_0x6f55('0xbb'),_0x1fc484,_0x5b926a,_0x6f55('0xba'),JSON[_0x6f55('0x28')](_0x2387a8));if(_0x4e894b[_0x6f55('0x89')][_0x6f55('0x46')]==='twilio'){return _0x44c24c[_0x6f55('0x2e')](_0x5b926a)[_0x6f55('0x34')]('Content-Type',_0x6f55('0xbc'))[_0x6f55('0x3f')](_0x6f55('0xbd'));}else{return _0x44c24c['status'](_0x5b926a)[_0x6f55('0x2f')](_0x2387a8);}}});})['catch'](handleError(_0x44c24c,null));};exports[_0x6f55('0x3f')]=function(_0x774f51,_0x497436,_0x3b62c1){var _0xd56e78,_0x29016f,_0x560e2b;if(_[_0x6f55('0x9f')](_0x774f51[_0x6f55('0x65')]['body'])||_0x774f51['body'][_0x6f55('0x65')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6f55('0x9f')](_0x774f51[_0x6f55('0x65')]['to'])){throw new db[(_0x6f55('0x92'))][(_0x6f55('0xa0'))](_0x6f55('0xbe'));}_0xd56e78=_0x774f51[_0x6f55('0x65')]['to'];return db['WhatsappAccount'][_0x6f55('0x5e')]({'where':{'id':_0x774f51['params']['id']},'include':[{'model':db[_0x6f55('0xa4')],'as':_0x6f55('0xbf'),'include':[{'model':db[_0x6f55('0xa9')],'as':_0x6f55('0xa8'),'where':{'mobile':_0xd56e78},'limit':0x1,'order':[[_0x6f55('0xc0'),_0x6f55('0xa6')]]}]}]})[_0x6f55('0x22')](handleEntityNotFound(_0x497436,null))[_0x6f55('0x22')](function(_0x5e66c2){if(_0x5e66c2&&_0x5e66c2[_0x6f55('0xbf')]){_0x29016f=_0x5e66c2['get']({'plain':!![]});if(_0x29016f[_0x6f55('0xbf')]&&_0x29016f[_0x6f55('0xbf')]['Contacts'][_0x6f55('0x4e')]){return _0x29016f[_0x6f55('0xbf')]['Contacts'][0x0];}return db[_0x6f55('0xa9')][_0x6f55('0x5f')](_['defaults'](_0x774f51[_0x6f55('0x65')],{'firstName':_0xd56e78,'mobile':_0xd56e78,'phone':_0xd56e78,'ListId':_0x29016f['ListId']}));}})[_0x6f55('0x22')](handleEntityNotFound(_0x497436,null))['then'](function(_0x1c5338){if(_0x1c5338){_0x560e2b=_0x1c5338;return db[_0x6f55('0xab')][_0x6f55('0x5e')]({'where':{'ContactId':_0x560e2b['id'],'closed':![],'WhatsappAccountId':_0x29016f['id']}})['then'](function(_0xb9e3f4){if(_0xb9e3f4){return[_0xb9e3f4,![]];}return db[_0x6f55('0xab')][_0x6f55('0x5f')]({'UserId':_0x774f51[_0x6f55('0x61')]['id'],'ContactId':_0x560e2b['id'],'WhatsappAccountId':_0x29016f['id'],'phone':_0xd56e78,'firstMsgDirection':_0x6f55('0xc1'),'Messages':[_[_0x6f55('0x56')](_0x774f51['body'],{'read':![],'body':_0x774f51[_0x6f55('0x65')][_0x6f55('0x65')],'phone':_0xd56e78,'WhatsappAccountId':_0x29016f['id'],'UserId':_0x774f51[_0x6f55('0x61')]['id'],'ContactId':_0x560e2b['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x6f55('0xc2')}]})[_0x6f55('0x22')](function(_0x25c23c){return[_0x25c23c,!![]];});});}})[_0x6f55('0x74')](function(_0x14a548,_0x439b8c){if(_0x439b8c){return _0x14a548;}return db[_0x6f55('0x8c')][_0x6f55('0x5f')](_[_0x6f55('0x56')](_0x774f51[_0x6f55('0x65')],{'read':![],'body':_0x774f51[_0x6f55('0x65')][_0x6f55('0x65')],'phone':_0xd56e78,'WhatsappAccountId':_0x29016f['id'],'WhatsappInteractionId':_0x14a548['id'],'UserId':_0x774f51[_0x6f55('0x61')]['id'],'ContactId':_0x560e2b['id']}))[_0x6f55('0x22')](function(_0x29cafc){_0x14a548[_0x6f55('0xc3')][_0x6f55('0xc2')]=[];_0x14a548[_0x6f55('0xc3')][_0x6f55('0xc2')][_0x6f55('0xae')](_0x29cafc[_0x6f55('0xc3')]);return _0x14a548;});})['then'](respondWithResult(_0x497436,null))['catch'](handleError(_0x497436,null));};
\ No newline at end of file
+var _0xf4af=['nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','mandatoryDispositionPause','describe','Disposition','getDispositions','findOne','length','WhatsappAccountId','ids','addAnswer','CannedAnswer','getAnswers','filter','removeAnswers','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','update','timestamp','message_id','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','mapKey','WhatsappInteraction','interaction','created','autoclose','applications','push','*,*,*,*','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','DESC','ListId','out','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','get','UserProfileResource','end','stack','name','send','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xf4af,0x7a));var _0xff4a=function(_0x24f107,_0x3c6c88){_0x24f107=_0x24f107-0x0;var _0x5116ab=_0xf4af[_0x24f107];return _0x5116ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff4a('0x0'));var zipdir=require(_0xff4a('0x1'));var jsonpatch=require(_0xff4a('0x2'));var rp=require(_0xff4a('0x3'));var moment=require('moment');var BPromise=require(_0xff4a('0x4'));var Mustache=require(_0xff4a('0x5'));var util=require(_0xff4a('0x6'));var path=require(_0xff4a('0x7'));var sox=require('sox');var csv=require(_0xff4a('0x8'));var ejs=require(_0xff4a('0x9'));var fs=require('fs');var fs_extra=require(_0xff4a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff4a('0xb'));var jsforce=require(_0xff4a('0xc'));var deskjs=require(_0xff4a('0xd'));var toCsv=require(_0xff4a('0x8'));var querystring=require(_0xff4a('0xe'));var Papa=require(_0xff4a('0xf'));var Redis=require(_0xff4a('0x10'));var authService=require(_0xff4a('0x11'));var qs=require(_0xff4a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4a('0x13'));var logger=require(_0xff4a('0x14'))(_0xff4a('0x15'));var utils=require(_0xff4a('0x16'));var config=require(_0xff4a('0x17'));var licenseUtil=require(_0xff4a('0x18'));var db=require('../../mysqldb')['db'];config[_0xff4a('0x19')]=_[_0xff4a('0x1a')](config['redis'],{'host':_0xff4a('0x1b'),'port':0x18eb});var socket=require(_0xff4a('0x1c'))(new Redis(config[_0xff4a('0x19')]));require(_0xff4a('0x1d'))[_0xff4a('0x1e')](socket);var jayson=require(_0xff4a('0x1f'));var client=jayson[_0xff4a('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0xfa6fc,_0x5c0977,_0xc65735,_0xef4df2){return new BPromise(function(_0x483207,_0x365518){var _0x43e3e9=_0xef4df2||client;return _0x43e3e9[_0xff4a('0x21')](_0xfa6fc,_0xc65735)[_0xff4a('0x22')](function(_0x300b9c){logger[_0xff4a('0x23')](_0xff4a('0x24'),_0x5c0977,_0xff4a('0x25'));logger[_0xff4a('0x26')](_0xff4a('0x27'),_0x5c0977,_0xff4a('0x25'),JSON[_0xff4a('0x28')](_0x300b9c));if(_0x300b9c[_0xff4a('0x29')]){if(_0x300b9c[_0xff4a('0x29')]['code']===0x1f4){logger[_0xff4a('0x29')](_0xff4a('0x24'),_0x5c0977,_0x300b9c['error'][_0xff4a('0x2a')]);return _0x365518(_0x300b9c['error'][_0xff4a('0x2a')]);}logger['error'](_0xff4a('0x24'),_0x5c0977,_0x300b9c[_0xff4a('0x29')][_0xff4a('0x2a')]);return _0x483207(_0x300b9c['error'][_0xff4a('0x2a')]);}else{logger[_0xff4a('0x23')](_0xff4a('0x24'),_0x5c0977,_0xff4a('0x25'));_0x483207(_0x300b9c[_0xff4a('0x2b')][_0xff4a('0x2a')]);}})[_0xff4a('0x2c')](function(_0x3bf1c0){logger[_0xff4a('0x29')](_0xff4a('0x24'),_0x5c0977,_0x3bf1c0);_0x365518(_0x3bf1c0);});});}function respondWithStatusCode(_0x3e2027,_0x1a1f2e){_0x1a1f2e=_0x1a1f2e||0xcc;return function(_0x46af57){if(_0x46af57){return _0x3e2027[_0xff4a('0x2d')](_0x1a1f2e);}return _0x3e2027[_0xff4a('0x2e')](_0x1a1f2e)['end']();};}function respondWithResult(_0x530ecb,_0x585d35){_0x585d35=_0x585d35||0xc8;return function(_0x4eb30e){if(_0x4eb30e){return _0x530ecb[_0xff4a('0x2e')](_0x585d35)['json'](_0x4eb30e);}};}function respondWithFilteredResult(_0x3e12e4,_0x44ab82){return function(_0x5425b7){if(_0x5425b7){var _0x4889b6=typeof _0x44ab82[_0xff4a('0x2f')]===_0xff4a('0x30')&&typeof _0x44ab82[_0xff4a('0x31')]==='undefined';var _0x55e311=_0x5425b7[_0xff4a('0x32')];var _0x192a74=_0x4889b6?0x0:_0x44ab82[_0xff4a('0x2f')];var _0x7b0f43=_0x4889b6?_0x5425b7[_0xff4a('0x32')]:_0x44ab82['offset']+_0x44ab82[_0xff4a('0x31')];var _0x48ec7b;if(_0x7b0f43>=_0x55e311){_0x7b0f43=_0x55e311;_0x48ec7b=0xc8;}else{_0x48ec7b=0xce;}_0x3e12e4[_0xff4a('0x2e')](_0x48ec7b);return _0x3e12e4[_0xff4a('0x33')](_0xff4a('0x34'),_0x192a74+'-'+_0x7b0f43+'/'+_0x55e311)[_0xff4a('0x35')](_0x5425b7);}return null;};}function patchUpdates(_0x2f4b56){return function(_0x38c9dc){try{jsonpatch[_0xff4a('0x36')](_0x38c9dc,_0x2f4b56,!![]);}catch(_0x44bd21){return BPromise[_0xff4a('0x37')](_0x44bd21);}return _0x38c9dc['save']();};}function saveUpdates(_0x33998a,_0x34f18d){return function(_0x1bd66b){if(_0x1bd66b){return _0x1bd66b['update'](_0x33998a)['then'](function(_0xb71eca){return _0xb71eca;});}return null;};}function removeEntity(_0x1bf466,_0x4974b5){return function(_0x3b466d){if(_0x3b466d){return _0x3b466d['destroy']()[_0xff4a('0x22')](function(){var _0xf540c5=_0x3b466d[_0xff4a('0x38')]({'plain':!![]});var _0x53c858='WhatsappAccounts';return db[_0xff4a('0x39')]['destroy']({'where':{'type':_0x53c858,'resourceId':_0xf540c5['id']}})[_0xff4a('0x22')](function(){return _0x3b466d;});})[_0xff4a('0x22')](function(){_0x1bf466['status'](0xcc)[_0xff4a('0x3a')]();});}};}function handleEntityNotFound(_0x323871,_0x56350d){return function(_0x163465){if(!_0x163465){_0x323871['sendStatus'](0x194);}return _0x163465;};}function handleError(_0x482c3b,_0x4a5b95){_0x4a5b95=_0x4a5b95||0x1f4;return function(_0x847df1){logger[_0xff4a('0x29')](_0x847df1[_0xff4a('0x3b')]);if(_0x847df1['name']){delete _0x847df1[_0xff4a('0x3c')];}_0x482c3b['status'](_0x4a5b95)[_0xff4a('0x3d')](_0x847df1);};}exports['index']=function(_0xbb3ca3,_0x13fb3e){var _0x4f4839={'include':[{'model':db[_0xff4a('0x3e')],'as':'mandatoryDispositionPause'}]},_0x4ea1c4={},_0x3f333a={'count':0x0,'rows':[]};var _0x491c91=_[_0xff4a('0x3f')](db[_0xff4a('0x40')][_0xff4a('0x41')],function(_0x4fbd04){return{'name':_0x4fbd04[_0xff4a('0x42')],'type':_0x4fbd04[_0xff4a('0x43')]['key']};});_0x4ea1c4[_0xff4a('0x44')]=_[_0xff4a('0x3f')](_0x491c91,_0xff4a('0x3c'));_0x4ea1c4[_0xff4a('0x45')]=_['keys'](_0xbb3ca3['query']);_0x4ea1c4[_0xff4a('0x46')]=_[_0xff4a('0x47')](_0x4ea1c4['model'],_0x4ea1c4[_0xff4a('0x45')]);_0x4f4839[_0xff4a('0x48')]=_['intersection'](_0x4ea1c4[_0xff4a('0x44')],qs[_0xff4a('0x49')](_0xbb3ca3['query'][_0xff4a('0x49')]));_0x4f4839[_0xff4a('0x48')]=_0x4f4839['attributes']['length']?_0x4f4839['attributes']:_0x4ea1c4[_0xff4a('0x44')];if(!_0xbb3ca3['query'][_0xff4a('0x4a')](_0xff4a('0x4b'))){_0x4f4839[_0xff4a('0x31')]=qs[_0xff4a('0x31')](_0xbb3ca3['query'][_0xff4a('0x31')]);_0x4f4839['offset']=qs[_0xff4a('0x2f')](_0xbb3ca3[_0xff4a('0x45')][_0xff4a('0x2f')]);}_0x4f4839[_0xff4a('0x4c')]=qs[_0xff4a('0x4d')](_0xbb3ca3[_0xff4a('0x45')]['sort']);_0x4f4839[_0xff4a('0x4e')]=qs[_0xff4a('0x46')](_[_0xff4a('0x4f')](_0xbb3ca3[_0xff4a('0x45')],_0x4ea1c4[_0xff4a('0x46')]),_0x491c91);if(_0xbb3ca3[_0xff4a('0x45')]['filter']){_0x4f4839['where']=_[_0xff4a('0x50')](_0x4f4839[_0xff4a('0x4e')],{'$or':_[_0xff4a('0x3f')](_0x491c91,function(_0x29c516){if(_0x29c516[_0xff4a('0x43')]!==_0xff4a('0x51')){var _0xeb37f8={};_0xeb37f8[_0x29c516[_0xff4a('0x3c')]]={'$like':'%'+_0xbb3ca3[_0xff4a('0x45')]['filter']+'%'};return _0xeb37f8;}})});}_0x4f4839=_[_0xff4a('0x50')]({},_0x4f4839,_0xbb3ca3[_0xff4a('0x52')]);var _0x30fa0d={'where':_0x4f4839[_0xff4a('0x4e')]};return db[_0xff4a('0x40')][_0xff4a('0x32')](_0x30fa0d)[_0xff4a('0x22')](function(_0x5b6353){_0x3f333a[_0xff4a('0x32')]=_0x5b6353;if(_0xbb3ca3[_0xff4a('0x45')][_0xff4a('0x53')]){_0x4f4839[_0xff4a('0x54')]=[{'all':!![]}];}return db[_0xff4a('0x40')][_0xff4a('0x55')](_0x4f4839);})[_0xff4a('0x22')](function(_0x49899f){_0x3f333a[_0xff4a('0x56')]=_0x49899f;return _0x3f333a;})[_0xff4a('0x22')](respondWithFilteredResult(_0x13fb3e,_0x4f4839))['catch'](handleError(_0x13fb3e,null));};exports['show']=function(_0x3b8ae5,_0xc0c716){var _0x4e03b1={'raw':![],'where':{'id':_0x3b8ae5[_0xff4a('0x57')]['id']},'include':[{'model':db[_0xff4a('0x3e')],'as':'mandatoryDispositionPause'}]},_0x17b612={};_0x17b612['model']=_['keys'](db['WhatsappAccount'][_0xff4a('0x41')]);_0x17b612[_0xff4a('0x45')]=_[_0xff4a('0x58')](_0x3b8ae5[_0xff4a('0x45')]);_0x17b612[_0xff4a('0x46')]=_[_0xff4a('0x47')](_0x17b612[_0xff4a('0x44')],_0x17b612[_0xff4a('0x45')]);_0x4e03b1[_0xff4a('0x48')]=_[_0xff4a('0x47')](_0x17b612[_0xff4a('0x44')],qs['fields'](_0x3b8ae5[_0xff4a('0x45')][_0xff4a('0x49')]));_0x4e03b1[_0xff4a('0x48')]=_0x4e03b1['attributes']['length']?_0x4e03b1['attributes']:_0x17b612['model'];if(_0x3b8ae5[_0xff4a('0x45')]['includeAll']){_0x4e03b1['include']=[{'all':!![]}];}_0x4e03b1=_[_0xff4a('0x50')]({},_0x4e03b1,_0x3b8ae5['options']);return db[_0xff4a('0x40')][_0xff4a('0x59')](_0x4e03b1)[_0xff4a('0x22')](handleEntityNotFound(_0xc0c716,null))['then'](respondWithResult(_0xc0c716,null))['catch'](handleError(_0xc0c716,null));};exports[_0xff4a('0x5a')]=function(_0x98fb3f,_0x37520a){return db[_0xff4a('0x40')]['create'](_0x98fb3f[_0xff4a('0x5b')],{})[_0xff4a('0x22')](function(_0x13ed45){var _0x440197=_0x98fb3f[_0xff4a('0x5c')]['get']({'plain':!![]});if(!_0x440197)throw new Error(_0xff4a('0x5d'));if(_0x440197[_0xff4a('0x5e')]==='user'){var _0xbc7552=_0x13ed45[_0xff4a('0x38')]({'plain':!![]});var _0x532cf2=_0xff4a('0x5f');return db[_0xff4a('0x60')][_0xff4a('0x59')]({'where':{'name':_0x532cf2,'userProfileId':_0x440197['userProfileId']},'raw':!![]})[_0xff4a('0x22')](function(_0xbb6b86){if(_0xbb6b86&&_0xbb6b86['autoAssociation']===0x0){return db[_0xff4a('0x39')][_0xff4a('0x5a')]({'name':_0xbc7552[_0xff4a('0x3c')],'resourceId':_0xbc7552['id'],'type':_0xbb6b86[_0xff4a('0x3c')],'sectionId':_0xbb6b86['id']},{})[_0xff4a('0x22')](function(){return _0x13ed45;});}else{return _0x13ed45;}})[_0xff4a('0x2c')](function(_0x11e695){logger[_0xff4a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11e695);throw _0x11e695;});}return _0x13ed45;})[_0xff4a('0x22')](respondWithResult(_0x37520a,0xc9))[_0xff4a('0x2c')](handleError(_0x37520a,null));};exports['update']=function(_0x4a964a,_0x35281d){if(_0x4a964a[_0xff4a('0x5b')]['id']){delete _0x4a964a[_0xff4a('0x5b')]['id'];}return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0x4a964a['params']['id']},'include':[{'model':db[_0xff4a('0x3e')],'as':_0xff4a('0x61')}]})[_0xff4a('0x22')](handleEntityNotFound(_0x35281d,null))[_0xff4a('0x22')](saveUpdates(_0x4a964a[_0xff4a('0x5b')],null))[_0xff4a('0x22')](respondWithResult(_0x35281d,null))[_0xff4a('0x2c')](handleError(_0x35281d,null));};exports['destroy']=function(_0x1894c1,_0x409d43){return db[_0xff4a('0x40')]['find']({'where':{'id':_0x1894c1['params']['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x409d43,null))[_0xff4a('0x22')](removeEntity(_0x409d43,null))[_0xff4a('0x2c')](handleError(_0x409d43,null));};exports[_0xff4a('0x62')]=function(_0x143a8c,_0x507a8d){return db[_0xff4a('0x40')][_0xff4a('0x62')]()[_0xff4a('0x22')](respondWithResult(_0x507a8d,null))[_0xff4a('0x2c')](handleError(_0x507a8d,null));};exports['addDisposition']=function(_0xfe7aba,_0x326aa1,_0xc82ff){if(_0xfe7aba[_0xff4a('0x5b')]['id']){delete _0xfe7aba['body']['id'];}return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0xfe7aba[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x326aa1,null))[_0xff4a('0x22')](function(_0x34b266){if(_0x34b266){_0xfe7aba[_0xff4a('0x5b')]['WhatsappAccountId']=_0x34b266['id'];return db[_0xff4a('0x63')][_0xff4a('0x5a')](_0xfe7aba['body']);}})['then'](respondWithResult(_0x326aa1,null))[_0xff4a('0x2c')](handleError(_0x326aa1,null));};exports[_0xff4a('0x64')]=function(_0x22d273,_0x2bd72e,_0x3b2faf){var _0x4cda3a={'raw':![],'where':{}};var _0x488148={};var _0x5b2e58={'count':0x0,'rows':[]};return db[_0xff4a('0x40')][_0xff4a('0x65')]({'where':{'id':_0x22d273[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x2bd72e,null))['then'](function(_0x20a46d){if(_0x20a46d){_0x488148[_0xff4a('0x44')]=_[_0xff4a('0x58')](db[_0xff4a('0x63')][_0xff4a('0x41')]);_0x488148['query']=_[_0xff4a('0x58')](_0x22d273[_0xff4a('0x45')]);_0x488148[_0xff4a('0x46')]=_[_0xff4a('0x47')](_0x488148[_0xff4a('0x44')],_0x488148[_0xff4a('0x45')]);_0x4cda3a[_0xff4a('0x48')]=_[_0xff4a('0x47')](_0x488148['model'],qs[_0xff4a('0x49')](_0x22d273[_0xff4a('0x45')][_0xff4a('0x49')]));_0x4cda3a[_0xff4a('0x48')]=_0x4cda3a[_0xff4a('0x48')][_0xff4a('0x66')]?_0x4cda3a[_0xff4a('0x48')]:_0x488148[_0xff4a('0x44')];if(!_0x22d273[_0xff4a('0x45')]['hasOwnProperty'](_0xff4a('0x4b'))){_0x4cda3a[_0xff4a('0x31')]=qs[_0xff4a('0x31')](_0x22d273[_0xff4a('0x45')][_0xff4a('0x31')]);_0x4cda3a[_0xff4a('0x2f')]=qs['offset'](_0x22d273['query']['offset']);}_0x4cda3a[_0xff4a('0x4c')]=qs[_0xff4a('0x4d')](_0x22d273[_0xff4a('0x45')][_0xff4a('0x4d')]);_0x4cda3a['where']=qs[_0xff4a('0x46')](_[_0xff4a('0x4f')](_0x22d273[_0xff4a('0x45')],_0x488148[_0xff4a('0x46')]));_0x4cda3a['where'][_0xff4a('0x67')]=_0x20a46d['id'];if(_0x22d273['query']['filter']){_0x4cda3a[_0xff4a('0x4e')]=_[_0xff4a('0x50')](_0x4cda3a['where'],{'$or':_[_0xff4a('0x3f')](_0x4cda3a[_0xff4a('0x48')],function(_0x5ae70c){var _0x262261={};_0x262261[_0x5ae70c]={'$like':'%'+_0x22d273[_0xff4a('0x45')]['filter']+'%'};return _0x262261;})});}_0x4cda3a=_[_0xff4a('0x50')]({},_0x4cda3a,_0x22d273[_0xff4a('0x52')]);return db['Disposition'][_0xff4a('0x32')]({'where':_0x4cda3a[_0xff4a('0x4e')]})[_0xff4a('0x22')](function(_0x4a80d8){_0x5b2e58[_0xff4a('0x32')]=_0x4a80d8;if(_0x22d273['query']['includeAll']){_0x4cda3a[_0xff4a('0x54')]=[{'all':!![]}];}return db[_0xff4a('0x63')][_0xff4a('0x55')](_0x4cda3a);})['then'](function(_0x15d4e9){_0x5b2e58[_0xff4a('0x56')]=_0x15d4e9;return _0x5b2e58;});}})['then'](respondWithFilteredResult(_0x2bd72e,_0x4cda3a))['catch'](handleError(_0x2bd72e,null));};exports['removeDispositions']=function(_0x3cb94f,_0x3ec4da,_0x155b31){return db['WhatsappAccount'][_0xff4a('0x59')]({'where':{'id':_0x3cb94f[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x3ec4da,null))[_0xff4a('0x22')](function(_0x5b393f){if(_0x5b393f){return _0x5b393f['removeDispositions'](_0x3cb94f[_0xff4a('0x45')][_0xff4a('0x68')]);}})[_0xff4a('0x22')](respondWithStatusCode(_0x3ec4da,null))[_0xff4a('0x2c')](handleError(_0x3ec4da,null));};exports[_0xff4a('0x69')]=function(_0x5d5eb0,_0x4acec9,_0x1bf884){if(_0x5d5eb0[_0xff4a('0x5b')]['id']){delete _0x5d5eb0['body']['id'];}return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0x5d5eb0[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x4acec9,null))[_0xff4a('0x22')](function(_0x4c0b15){if(_0x4c0b15){_0x5d5eb0[_0xff4a('0x5b')][_0xff4a('0x67')]=_0x4c0b15['id'];return db[_0xff4a('0x6a')]['create'](_0x5d5eb0['body']);}})[_0xff4a('0x22')](respondWithResult(_0x4acec9,null))[_0xff4a('0x2c')](handleError(_0x4acec9,null));};exports[_0xff4a('0x6b')]=function(_0x517853,_0x68c760,_0x2a52ed){var _0x159a17={'raw':![],'where':{}};var _0x40a2ad={};var _0x1736af={'count':0x0,'rows':[]};return db[_0xff4a('0x40')][_0xff4a('0x65')]({'where':{'id':_0x517853[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x68c760,null))[_0xff4a('0x22')](function(_0x9cc3f7){if(_0x9cc3f7){_0x40a2ad[_0xff4a('0x44')]=_[_0xff4a('0x58')](db[_0xff4a('0x6a')][_0xff4a('0x41')]);_0x40a2ad[_0xff4a('0x45')]=_[_0xff4a('0x58')](_0x517853[_0xff4a('0x45')]);_0x40a2ad[_0xff4a('0x46')]=_[_0xff4a('0x47')](_0x40a2ad['model'],_0x40a2ad[_0xff4a('0x45')]);_0x159a17[_0xff4a('0x48')]=_[_0xff4a('0x47')](_0x40a2ad['model'],qs[_0xff4a('0x49')](_0x517853[_0xff4a('0x45')]['fields']));_0x159a17[_0xff4a('0x48')]=_0x159a17[_0xff4a('0x48')][_0xff4a('0x66')]?_0x159a17[_0xff4a('0x48')]:_0x40a2ad[_0xff4a('0x44')];if(!_0x517853[_0xff4a('0x45')][_0xff4a('0x4a')](_0xff4a('0x4b'))){_0x159a17['limit']=qs[_0xff4a('0x31')](_0x517853[_0xff4a('0x45')]['limit']);_0x159a17['offset']=qs[_0xff4a('0x2f')](_0x517853[_0xff4a('0x45')][_0xff4a('0x2f')]);}_0x159a17['order']=qs[_0xff4a('0x4d')](_0x517853['query'][_0xff4a('0x4d')]);_0x159a17[_0xff4a('0x4e')]=qs[_0xff4a('0x46')](_[_0xff4a('0x4f')](_0x517853[_0xff4a('0x45')],_0x40a2ad['filters']));_0x159a17[_0xff4a('0x4e')]['WhatsappAccountId']=_0x9cc3f7['id'];if(_0x517853[_0xff4a('0x45')][_0xff4a('0x6c')]){_0x159a17[_0xff4a('0x4e')]=_[_0xff4a('0x50')](_0x159a17[_0xff4a('0x4e')],{'$or':_[_0xff4a('0x3f')](_0x159a17['attributes'],function(_0x23944c){var _0x24b41a={};_0x24b41a[_0x23944c]={'$like':'%'+_0x517853['query'][_0xff4a('0x6c')]+'%'};return _0x24b41a;})});}_0x159a17=_[_0xff4a('0x50')]({},_0x159a17,_0x517853[_0xff4a('0x52')]);return db[_0xff4a('0x6a')][_0xff4a('0x32')]({'where':_0x159a17[_0xff4a('0x4e')]})[_0xff4a('0x22')](function(_0x27961b){_0x1736af[_0xff4a('0x32')]=_0x27961b;if(_0x517853[_0xff4a('0x45')][_0xff4a('0x53')]){_0x159a17['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xff4a('0x55')](_0x159a17);})['then'](function(_0x25f5a0){_0x1736af[_0xff4a('0x56')]=_0x25f5a0;return _0x1736af;});}})[_0xff4a('0x22')](respondWithFilteredResult(_0x68c760,_0x159a17))[_0xff4a('0x2c')](handleError(_0x68c760,null));};exports['removeAnswers']=function(_0x3b355c,_0x209d74,_0x337275){return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0x3b355c[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x209d74,null))[_0xff4a('0x22')](function(_0x3b89e4){if(_0x3b89e4){return _0x3b89e4[_0xff4a('0x6d')](_0x3b355c[_0xff4a('0x45')][_0xff4a('0x68')]);}})[_0xff4a('0x22')](respondWithStatusCode(_0x209d74,null))[_0xff4a('0x2c')](handleError(_0x209d74,null));};exports['addAgents']=function(_0x402a7e,_0x1c8f25,_0x23147d){return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0x402a7e['params']['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x1c8f25,null))[_0xff4a('0x22')](function(_0x595a91){if(_0x595a91){return _0x595a91['addAgents'](_0x402a7e[_0xff4a('0x5b')][_0xff4a('0x68')],_[_0xff4a('0x6e')](_0x402a7e[_0xff4a('0x5b')],['ids','id'])||{})[_0xff4a('0x6f')](function(_0x30fb0c){for(var _0x3b980d=0x0;_0x3b980d<_0x402a7e['body'][_0xff4a('0x68')][_0xff4a('0x66')];_0x3b980d+=0x1){socket[_0xff4a('0x70')](_0xff4a('0x71'),{'UserId':Number(_0x402a7e[_0xff4a('0x5b')][_0xff4a('0x68')][_0x3b980d]),'WhatsappAccountId':Number(_0x402a7e[_0xff4a('0x57')]['id'])});}return _0x30fb0c;});}})[_0xff4a('0x22')](respondWithResult(_0x1c8f25,null))[_0xff4a('0x2c')](handleError(_0x1c8f25,null));};exports[_0xff4a('0x72')]=function(_0x4ca469,_0x3a63b0,_0x12f1b3){return db['WhatsappAccount'][_0xff4a('0x59')]({'where':{'id':_0x4ca469[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x3a63b0,null))[_0xff4a('0x22')](function(_0x2eb5eb){if(_0x2eb5eb){return _0x2eb5eb['removeAgents'](_0x4ca469[_0xff4a('0x45')][_0xff4a('0x68')])[_0xff4a('0x22')](function(){if(_[_0xff4a('0x73')](_0x4ca469[_0xff4a('0x45')][_0xff4a('0x68')])){for(var _0x5cf97c=0x0;_0x5cf97c<_0x4ca469['query'][_0xff4a('0x68')]['length'];_0x5cf97c+=0x1){socket[_0xff4a('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x4ca469[_0xff4a('0x45')]['ids'][_0x5cf97c]),'WhatsappAccountId':Number(_0x4ca469['params']['id'])});}}else{socket[_0xff4a('0x70')](_0xff4a('0x74'),{'UserId':Number(_0x4ca469[_0xff4a('0x45')]['ids']),'WhatsappAccountId':Number(_0x4ca469[_0xff4a('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a63b0,null))[_0xff4a('0x2c')](handleError(_0x3a63b0,null));};exports[_0xff4a('0x75')]=function(_0x13366b,_0x48ea85,_0x31f921){var _0xb25bdd={};var _0x23bc17={};var _0x79bd42;var _0x4e3a8b;return db[_0xff4a('0x40')][_0xff4a('0x65')]({'where':{'id':_0x13366b[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x48ea85,null))[_0xff4a('0x22')](function(_0x37b412){if(_0x37b412){_0x79bd42=_0x37b412;_0x23bc17['model']=_[_0xff4a('0x58')](db[_0xff4a('0x76')][_0xff4a('0x41')]);_0x23bc17[_0xff4a('0x45')]=_[_0xff4a('0x58')](_0x13366b[_0xff4a('0x45')]);_0x23bc17[_0xff4a('0x46')]=_['intersection'](_0x23bc17[_0xff4a('0x44')],_0x23bc17[_0xff4a('0x45')]);_0xb25bdd[_0xff4a('0x48')]=_[_0xff4a('0x47')](_0x23bc17[_0xff4a('0x44')],qs['fields'](_0x13366b[_0xff4a('0x45')][_0xff4a('0x49')]));_0xb25bdd['attributes']=_0xb25bdd[_0xff4a('0x48')]['length']?_0xb25bdd[_0xff4a('0x48')]:_0x23bc17[_0xff4a('0x44')];_0xb25bdd['order']=qs[_0xff4a('0x4d')](_0x13366b[_0xff4a('0x45')][_0xff4a('0x4d')]);_0xb25bdd[_0xff4a('0x4e')]=qs[_0xff4a('0x46')](_[_0xff4a('0x4f')](_0x13366b[_0xff4a('0x45')],_0x23bc17['filters']));if(_0x13366b[_0xff4a('0x45')][_0xff4a('0x6c')]){_0xb25bdd[_0xff4a('0x4e')]=_[_0xff4a('0x50')](_0xb25bdd[_0xff4a('0x4e')],{'$or':_[_0xff4a('0x3f')](_0xb25bdd[_0xff4a('0x48')],function(_0x461bde){var _0x3dab3f={};_0x3dab3f[_0x461bde]={'$like':'%'+_0x13366b[_0xff4a('0x45')][_0xff4a('0x6c')]+'%'};return _0x3dab3f;})});}_0xb25bdd=_[_0xff4a('0x50')]({},_0xb25bdd,_0x13366b[_0xff4a('0x52')]);return _0x79bd42[_0xff4a('0x75')](_0xb25bdd);}})[_0xff4a('0x22')](function(_0x28a864){if(_0x28a864){_0x4e3a8b=_0x28a864['length'];if(!_0x13366b[_0xff4a('0x45')]['hasOwnProperty'](_0xff4a('0x4b'))){_0xb25bdd[_0xff4a('0x31')]=qs[_0xff4a('0x31')](_0x13366b[_0xff4a('0x45')][_0xff4a('0x31')]);_0xb25bdd[_0xff4a('0x2f')]=qs[_0xff4a('0x2f')](_0x13366b[_0xff4a('0x45')][_0xff4a('0x2f')]);}return _0x79bd42[_0xff4a('0x75')](_0xb25bdd);}})[_0xff4a('0x22')](function(_0x577b6a){if(_0x577b6a){return _0x577b6a?{'count':_0x4e3a8b,'rows':_0x577b6a}:null;}})[_0xff4a('0x22')](respondWithResult(_0x48ea85,null))[_0xff4a('0x2c')](handleError(_0x48ea85,null));};exports[_0xff4a('0x77')]=function(_0x39e349,_0x146986){var _0x412726=_0x39e349[_0xff4a('0x57')]['id'];var _0xd9c65e=_0x39e349[_0xff4a('0x5b')];var _0x1dfe3f=0xc8;var _0xd87811=null;return db[_0xff4a('0x78')][_0xff4a('0x79')]({'isolationLevel':db['sequelize']['Transaction'][_0xff4a('0x7a')][_0xff4a('0x7b')]},function(_0xc1861){return db[_0xff4a('0x40')]['findOne']({'where':{'id':_0x412726},'transaction':_0xc1861})[_0xff4a('0x22')](function(_0x1ea945){if(_0x1ea945){return db[_0xff4a('0x7c')]['destroy']({'where':{'WhatsappAccountId':_0x412726},'transaction':_0xc1861})['then'](function(){var _0x25ed70=_[_0xff4a('0x3f')](_0xd9c65e,function(_0x1894d9){_0x1894d9[_0xff4a('0x67')]=_0x412726;return _0x1894d9;});return db[_0xff4a('0x7c')][_0xff4a('0x7d')](_0x25ed70,{'transaction':_0xc1861});});}else{_0x1dfe3f=0x194;_0xd87811=[];}});})[_0xff4a('0x22')](function(){if(_0x1dfe3f!==0x194){return db[_0xff4a('0x7c')][_0xff4a('0x7e')]({'where':{'WhatsappAccountId':_0x412726},'order':_0xff4a('0x7f')})['then'](function(_0x1a30ee){_0xd87811=_0x1a30ee;});}})[_0xff4a('0x2c')](function(_0x320092){_0x1dfe3f=0x1f4;logger[_0xff4a('0x29')](_0x320092['stack']);if(_0x320092[_0xff4a('0x3c')]){delete _0x320092[_0xff4a('0x3c')];}_0xd87811=_0x320092;})[_0xff4a('0x80')](function(){if(_0xd87811===null){_0x146986['sendStatus'](_0x1dfe3f);}else{if(_0x1dfe3f===0x1f4){_0x146986[_0xff4a('0x2e')](_0x1dfe3f)[_0xff4a('0x3d')](_0xd87811);}else{_0x146986[_0xff4a('0x2e')](_0x1dfe3f)[_0xff4a('0x35')](_0xd87811);}}});};exports[_0xff4a('0x81')]=function(_0x392d74,_0x2725f5,_0x50add5){var _0x3881e0={};var _0x313233={};var _0x153577;var _0x3d7bee;return db['WhatsappAccount']['findOne']({'where':{'id':_0x392d74[_0xff4a('0x57')]['id']}})[_0xff4a('0x22')](handleEntityNotFound(_0x2725f5,null))[_0xff4a('0x22')](function(_0x111586){if(_0x111586){_0x153577=_0x111586;_0x313233[_0xff4a('0x44')]=_['keys'](db[_0xff4a('0x7c')]['rawAttributes']);_0x313233[_0xff4a('0x45')]=_[_0xff4a('0x58')](_0x392d74[_0xff4a('0x45')]);_0x313233['filters']=_[_0xff4a('0x47')](_0x313233[_0xff4a('0x44')],_0x313233[_0xff4a('0x45')]);_0x3881e0['attributes']=_[_0xff4a('0x47')](_0x313233[_0xff4a('0x44')],qs[_0xff4a('0x49')](_0x392d74[_0xff4a('0x45')][_0xff4a('0x49')]));_0x3881e0[_0xff4a('0x48')]=_0x3881e0['attributes'][_0xff4a('0x66')]?_0x3881e0[_0xff4a('0x48')]:_0x313233['model'];_0x3881e0[_0xff4a('0x4c')]=qs[_0xff4a('0x4d')](_0x392d74[_0xff4a('0x45')][_0xff4a('0x4d')]);_0x3881e0[_0xff4a('0x4e')]=qs['filters'](_[_0xff4a('0x4f')](_0x392d74[_0xff4a('0x45')],_0x313233['filters']));if(_0x392d74[_0xff4a('0x45')][_0xff4a('0x6c')]){_0x3881e0['where']=_[_0xff4a('0x50')](_0x3881e0[_0xff4a('0x4e')],{'$or':_[_0xff4a('0x3f')](_0x3881e0[_0xff4a('0x48')],function(_0x4902bd){var _0x5d01d3={};_0x5d01d3[_0x4902bd]={'$like':'%'+_0x392d74[_0xff4a('0x45')][_0xff4a('0x6c')]+'%'};return _0x5d01d3;})});}_0x3881e0=_['merge']({},_0x3881e0,_0x392d74[_0xff4a('0x52')]);return _0x153577[_0xff4a('0x81')](_0x3881e0);}})['then'](function(_0x29595b){if(_0x29595b){_0x3d7bee=_0x29595b['length'];if(!_0x392d74[_0xff4a('0x45')][_0xff4a('0x4a')](_0xff4a('0x4b'))){_0x3881e0[_0xff4a('0x31')]=qs['limit'](_0x392d74[_0xff4a('0x45')]['limit']);_0x3881e0[_0xff4a('0x2f')]=qs['offset'](_0x392d74['query'][_0xff4a('0x2f')]);}return _0x153577[_0xff4a('0x81')](_0x3881e0);}})[_0xff4a('0x22')](function(_0x433ac1){if(_0x433ac1){return _0x433ac1?{'count':_0x3d7bee,'rows':_0x433ac1}:null;}})[_0xff4a('0x22')](respondWithResult(_0x2725f5,null))[_0xff4a('0x2c')](handleError(_0x2725f5,null));};exports['notify']=function(_0x3c2171,_0x2e9472,_0x3fc77d){var _0x28c3ba={'channel':_0xff4a('0x82')};var _0x186824=[];var _0x47d317=[];var _0x1f0d23={};return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0x3c2171[_0xff4a('0x57')]['id']},'include':[{'model':db[_0xff4a('0x7c')],'as':_0xff4a('0x83')}]})['then'](handleEntityNotFound(_0x2e9472,null))[_0xff4a('0x22')](function(_0x18b9a2){_0x28c3ba[_0xff4a('0x84')]=_0x18b9a2;if(_0x28c3ba[_0xff4a('0x84')]&&_0x28c3ba[_0xff4a('0x84')]['type']===_0xff4a('0x85')&&_0x3c2171[_0xff4a('0x5b')]['statuses']){if(_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x86')][_0xff4a('0x66')]===0x0)return;if(_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x86')][0x0][_0xff4a('0x87')]!==_0xff4a('0x88'))return;return db[_0xff4a('0x89')][_0xff4a('0x8a')]({'read':!![],'readAt':_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x86')][0x0][_0xff4a('0x8b')]},{'where':{'messageId':_0x3c2171[_0xff4a('0x5b')]['statuses'][0x0][_0xff4a('0x8c')]},'individualHooks':!![]})['then'](function(_0x4f6d59){return _0x2e9472[_0xff4a('0x2e')](0xc8)[_0xff4a('0x35')](_0x4f6d59);});}_0x28c3ba['applications']=_[_0xff4a('0x8d')](_0x18b9a2[_0xff4a('0x83')],[_0xff4a('0x7f')],['asc']);if(_0x28c3ba['account'][_0xff4a('0x83')]){delete _0x28c3ba[_0xff4a('0x84')][_0xff4a('0x83')];}return db[_0xff4a('0x8e')][_0xff4a('0x62')]()[_0xff4a('0x22')](function(_0x3f4e7c){if(!_0x3f4e7c){throw new db[(_0xff4a('0x8f'))][(_0xff4a('0x90'))](_0xff4a('0x91'));}_0x186824=_[_0xff4a('0x92')](_[_0xff4a('0x58')](_0x3f4e7c),[_0xff4a('0x93'),'updatedAt']);_0x47d317=_[_0xff4a('0x92')](_['keys'](_0x3f4e7c),[_0xff4a('0x93'),_0xff4a('0x94'),_0xff4a('0x95'),'ListId']);_0x28c3ba[_0xff4a('0x5b')]={'mapKey':_0xff4a('0x96')};if(_0x28c3ba[_0xff4a('0x84')]&&_0x28c3ba[_0xff4a('0x84')][_0xff4a('0x43')]===_0xff4a('0x97')){_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x98')]=_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x99')][_0xff4a('0x9a')]('whatsapp:','');_0x28c3ba[_0xff4a('0x5b')]['body']=_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x9b')];_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x9c')]=_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x9d')];}if(_0x28c3ba['account']&&_0x28c3ba[_0xff4a('0x84')][_0xff4a('0x43')]===_0xff4a('0x85')){_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x98')]=_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x9e')][0x0][_0xff4a('0x98')];_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x5b')]=_0x3c2171[_0xff4a('0x5b')]['notifications'][0x0][_0xff4a('0x2a')][_0xff4a('0x5b')];_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x9c')]=_0x3c2171[_0xff4a('0x5b')][_0xff4a('0x9e')][0x0][_0xff4a('0x8c')];}if(_0x28c3ba[_0xff4a('0x5b')]['id']){delete _0x28c3ba[_0xff4a('0x5b')]['id'];}if(_[_0xff4a('0x9f')](_0x28c3ba['body'][_0xff4a('0x98')])){throw new db['Sequelize'][(_0xff4a('0x90'))]('from\x20is\x20mandatory');}if(_[_0xff4a('0x9f')](_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x5b')])||_0x28c3ba['body'][_0xff4a('0x5b')]===''){throw new db[(_0xff4a('0x8f'))][(_0xff4a('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xff4a('0x9f')](_0x28c3ba[_0xff4a('0x5b')]['mapKey'])){throw new db[(_0xff4a('0x8f'))]['ValidationError'](_0xff4a('0xa0')+_0x47d317);}if(!_[_0xff4a('0xa1')](_0x47d317,_0x28c3ba['body']['mapKey'])){throw new db[(_0xff4a('0x8f'))][(_0xff4a('0x90'))](_0xff4a('0xa2')+_0x47d317);}_0x1f0d23[_0x28c3ba[_0xff4a('0x5b')]['mapKey']]=_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x98')];return db['CmList'][_0xff4a('0x59')]({'where':{'id':_0x28c3ba['account']['ListId']},'include':[{'model':db[_0xff4a('0x8e')],'as':_0xff4a('0xa3'),'where':_0x1f0d23,'limit':0x1,'order':[[_0xff4a('0x94'),'DESC']]}]});})[_0xff4a('0x22')](handleEntityNotFound(_0x2e9472,null))[_0xff4a('0x22')](function(_0x39ebf0){if(_0x39ebf0){_0x28c3ba[_0xff4a('0xa4')]=_['omit'](_0x39ebf0,[_0xff4a('0xa3')]);if(_0x39ebf0[_0xff4a('0xa3')][_0xff4a('0x66')]){return _0x39ebf0[_0xff4a('0xa3')][0x0];}var _0x199622=_['defaults'](_0x28c3ba['body'],{'firstName':_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x98')],'ListId':_0x39ebf0['id']});_0x199622[_0x28c3ba['body'][_0xff4a('0xa5')]]=_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x98')];return db[_0xff4a('0x8e')][_0xff4a('0x5a')](_0x199622,{'fields':_0x186824,'raw':!![]});}})[_0xff4a('0x22')](handleEntityNotFound(_0x2e9472,null))[_0xff4a('0x22')](function(_0x1436a3){if(_0x1436a3){_0x28c3ba['contact']=_0x1436a3;var _0x5bc7be={'ContactId':_0x1436a3['id'],'phone':_0x28c3ba['body']['from'],'WhatsappAccountId':_0x3c2171[_0xff4a('0x57')]['id']};var _0x57b7f7={'ContactId':_0x1436a3['id'],'WhatsappAccountId':_0x3c2171[_0xff4a('0x57')]['id'],'closed':![]};return db[_0xff4a('0xa6')][_0xff4a('0x59')]({'where':_0x57b7f7})['then'](function(_0x5c5f79){if(_0x5c5f79){return[_0x5c5f79,![]];}return db[_0xff4a('0xa6')][_0xff4a('0x5a')](_0x5bc7be)['then'](function(_0x20bade){return[_0x20bade,!![]];});});}})[_0xff4a('0x6f')](function(_0x574ffb,_0xa4cdfa){_0x28c3ba[_0xff4a('0xa7')]=_0x574ffb[_0xff4a('0x38')]({'plain':!![]});_0x28c3ba[_0xff4a('0xa7')][_0xff4a('0xa8')]=![];if(_0xa4cdfa){if(_0x28c3ba[_0xff4a('0x84')][_0xff4a('0xa9')]){_0x28c3ba[_0xff4a('0xaa')][_0xff4a('0xab')]({'id':0x0,'priority':_0x28c3ba[_0xff4a('0xaa')][_0xff4a('0x66')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xff4a('0xac')});}_0x28c3ba[_0xff4a('0xa7')][_0xff4a('0xa8')]=!![];}return db[_0xff4a('0x89')]['create']({'phone':_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x98')],'messageId':_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0x9c')],'body':_0x28c3ba['body']['body'],'WhatsappAccountId':_0x3c2171[_0xff4a('0x57')]['id'],'WhatsappInteractionId':_0x574ffb['id'],'direction':'in','ContactId':_0x574ffb[_0xff4a('0xad')],'AttachmentId':_0x28c3ba[_0xff4a('0x5b')][_0xff4a('0xae')]});})[_0xff4a('0x22')](function(_0x475bc6){_0x28c3ba[_0xff4a('0x2a')]=_0x475bc6;if(!_0x28c3ba[_0xff4a('0xa7')][_0xff4a('0xaf')])return;return db[_0xff4a('0x76')][_0xff4a('0x59')]({'attributes':['id',_0xff4a('0x3c')],'where':{'id':_0x28c3ba[_0xff4a('0xa7')][_0xff4a('0xaf')]}});})['then'](function(_0x326a94){if(_0x326a94){_0x28c3ba[_0xff4a('0xaa')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x326a94[_0xff4a('0x3c')]+','+(_0x28c3ba[_0xff4a('0x84')][_0xff4a('0xb0')]||0xa),'interval':'*,*,*,*'});}if(!_0x28c3ba[_0xff4a('0xa7')][_0xff4a('0xb1')])return;return db[_0xff4a('0xb2')][_0xff4a('0x59')]({'attributes':['id',_0xff4a('0x3c')],'where':{'id':_0x28c3ba[_0xff4a('0xa7')][_0xff4a('0xb1')]}});})['then'](function(_0x4d3c4b){if(_0x4d3c4b){_0x28c3ba[_0xff4a('0xaa')]['unshift']({'id':0x0,'priority':0x1,'app':_0xff4a('0xb3'),'appdata':_0x4d3c4b[_0xff4a('0x3c')]+','+(_0x28c3ba[_0xff4a('0x84')][_0xff4a('0xb4')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xff4a('0xb5'),_0xff4a('0xb6'),_0x28c3ba);})[_0xff4a('0x22')](function(_0xffd8be){if(_0xffd8be){var _0x68f73b=0xc8;var _0x4656f8=_0xff4a('0xb7');logger[_0xff4a('0x23')](_0xff4a('0x27'),_0x4656f8,_0x68f73b,_0xff4a('0xb8'));logger['debug'](_0xff4a('0xb9'),_0x4656f8,_0x68f73b,_0xff4a('0xb8'),JSON[_0xff4a('0x28')](_0xffd8be));if(_0x28c3ba['account'][_0xff4a('0x43')]==='twilio'){return _0x2e9472[_0xff4a('0x2e')](_0x68f73b)['set'](_0xff4a('0xba'),_0xff4a('0xbb'))[_0xff4a('0x3d')](_0xff4a('0xbc'));}else{return _0x2e9472[_0xff4a('0x2e')](_0x68f73b)[_0xff4a('0x35')](_0xffd8be);}}});})[_0xff4a('0x2c')](handleError(_0x2e9472,null));};exports[_0xff4a('0x3d')]=function(_0x472bbb,_0x12a58,_0xea776){var _0x4ab2d3,_0xf3535a,_0x229a54;if(_['isNil'](_0x472bbb[_0xff4a('0x5b')][_0xff4a('0x5b')])||_0x472bbb['body'][_0xff4a('0x5b')]===''){throw new db['Sequelize'][(_0xff4a('0x90'))](_0xff4a('0xbd'));}if(_['isNil'](_0x472bbb['body']['to'])){throw new db[(_0xff4a('0x8f'))][(_0xff4a('0x90'))](_0xff4a('0xbe'));}_0x4ab2d3=_0x472bbb[_0xff4a('0x5b')]['to'];return db[_0xff4a('0x40')][_0xff4a('0x59')]({'where':{'id':_0x472bbb[_0xff4a('0x57')]['id']},'include':[{'model':db[_0xff4a('0xbf')],'as':_0xff4a('0xc0'),'include':[{'model':db[_0xff4a('0x8e')],'as':'Contacts','where':{'mobile':_0x4ab2d3},'limit':0x1,'order':[[_0xff4a('0x94'),_0xff4a('0xc1')]]}]}]})['then'](handleEntityNotFound(_0x12a58,null))['then'](function(_0x4c9a86){if(_0x4c9a86&&_0x4c9a86[_0xff4a('0xc0')]){_0xf3535a=_0x4c9a86[_0xff4a('0x38')]({'plain':!![]});if(_0xf3535a[_0xff4a('0xc0')]&&_0xf3535a[_0xff4a('0xc0')][_0xff4a('0xa3')][_0xff4a('0x66')]){return _0xf3535a[_0xff4a('0xc0')][_0xff4a('0xa3')][0x0];}return db[_0xff4a('0x8e')]['create'](_[_0xff4a('0x1a')](_0x472bbb['body'],{'firstName':_0x4ab2d3,'mobile':_0x4ab2d3,'phone':_0x4ab2d3,'ListId':_0xf3535a[_0xff4a('0xc2')]}));}})[_0xff4a('0x22')](handleEntityNotFound(_0x12a58,null))[_0xff4a('0x22')](function(_0x5b24ab){if(_0x5b24ab){_0x229a54=_0x5b24ab;return db[_0xff4a('0xa6')][_0xff4a('0x59')]({'where':{'ContactId':_0x229a54['id'],'closed':![],'WhatsappAccountId':_0xf3535a['id']}})['then'](function(_0x299c36){if(_0x299c36){return[_0x299c36,![]];}return db[_0xff4a('0xa6')][_0xff4a('0x5a')]({'UserId':_0x472bbb[_0xff4a('0x5c')]['id'],'ContactId':_0x229a54['id'],'WhatsappAccountId':_0xf3535a['id'],'phone':_0x4ab2d3,'firstMsgDirection':_0xff4a('0xc3'),'Messages':[_['merge'](_0x472bbb[_0xff4a('0x5b')],{'read':![],'body':_0x472bbb[_0xff4a('0x5b')][_0xff4a('0x5b')],'phone':_0x4ab2d3,'WhatsappAccountId':_0xf3535a['id'],'UserId':_0x472bbb['user']['id'],'ContactId':_0x229a54['id']})]},{'include':[{'model':db[_0xff4a('0x89')],'as':'Messages'}]})[_0xff4a('0x22')](function(_0x8d9a7d){return[_0x8d9a7d,!![]];});});}})[_0xff4a('0x6f')](function(_0x21f8bf,_0x2405af){if(_0x2405af){return _0x21f8bf;}return db[_0xff4a('0x89')][_0xff4a('0x5a')](_[_0xff4a('0x50')](_0x472bbb[_0xff4a('0x5b')],{'read':![],'body':_0x472bbb[_0xff4a('0x5b')]['body'],'phone':_0x4ab2d3,'WhatsappAccountId':_0xf3535a['id'],'WhatsappInteractionId':_0x21f8bf['id'],'UserId':_0x472bbb[_0xff4a('0x5c')]['id'],'ContactId':_0x229a54['id']}))[_0xff4a('0x22')](function(_0x4de821){_0x21f8bf[_0xff4a('0xc4')]['Messages']=[];_0x21f8bf[_0xff4a('0xc4')]['Messages'][_0xff4a('0xab')](_0x4de821[_0xff4a('0xc4')]);return _0x21f8bf;});})[_0xff4a('0x22')](respondWithResult(_0x12a58,null))[_0xff4a('0x2c')](handleError(_0x12a58,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54d6=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0x54d6,0x11d));var _0x654d=function(_0x56d177,_0x526378){_0x56d177=_0x56d177-0x0;var _0x5bcfd0=_0x54d6[_0x56d177];return _0x5bcfd0;};'use strict';var EventEmitter=require(_0x654d('0x0'));var WhatsappAccount=require(_0x654d('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x654d('0x2')](0x0);var events={'afterCreate':_0x654d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b82c2){return function(_0x122800,_0x6d1a00,_0xfea275){WhatsappAccountEvents[_0x654d('0x4')](_0x1b82c2+':'+_0x122800['id'],_0x122800);WhatsappAccountEvents[_0x654d('0x4')](_0x1b82c2,_0x122800);_0xfea275(null);};}for(var e in events){if(events[_0x654d('0x5')](e)){var event=events[e];WhatsappAccount[_0x654d('0x6')](e,emitEvent(event));}}module[_0x654d('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xa63c=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount'];(function(_0xb63ce2,_0xf96a54){var _0xf1ec76=function(_0x479d36){while(--_0x479d36){_0xb63ce2['push'](_0xb63ce2['shift']());}};_0xf1ec76(++_0xf96a54);}(_0xa63c,0xe7));var _0xca63=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa63c[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0xca63('0x0'));var WhatsappAccount=require(_0xca63('0x1'))['db'][_0xca63('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca63('0x3'),'afterUpdate':_0xca63('0x4'),'afterDestroy':_0xca63('0x5')};function emitEvent(_0x5bd3ab){return function(_0x2d87ca,_0x17fb81,_0xb4721b){WhatsappAccountEvents[_0xca63('0x6')](_0x5bd3ab+':'+_0x2d87ca['id'],_0x2d87ca);WhatsappAccountEvents['emit'](_0x5bd3ab,_0x2d87ca);_0xb4721b(null);};}for(var e in events){if(events[_0xca63('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xca63('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5c4=['rimraf','./whatsappAccount.attributes','define','WhatsappAccount','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11af81,_0x3d1a99){var _0x367dc6=function(_0x34370a){while(--_0x34370a){_0x11af81['push'](_0x11af81['shift']());}};_0x367dc6(++_0x3d1a99);}(_0xf5c4,0x88));var _0x4f5c=function(_0x231e58,_0x4fda70){_0x231e58=_0x231e58-0x0;var _0x3549b7=_0xf5c4[_0x231e58];return _0x3549b7;};'use strict';var _=require('lodash');var util=require(_0x4f5c('0x0'));var logger=require(_0x4f5c('0x1'))(_0x4f5c('0x2'));var moment=require(_0x4f5c('0x3'));var BPromise=require(_0x4f5c('0x4'));var rp=require(_0x4f5c('0x5'));var fs=require('fs');var path=require(_0x4f5c('0x6'));var rimraf=require(_0x4f5c('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f5c('0x8'));module['exports']=function(_0x54352b,_0x336e26){return _0x54352b[_0x4f5c('0x9')](_0x4f5c('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98f0=['request-promise','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','../../config/logger','moment','bluebird'];(function(_0x18d710,_0x153c7c){var _0x54f4eb=function(_0x170c6b){while(--_0x170c6b){_0x18d710['push'](_0x18d710['shift']());}};_0x54f4eb(++_0x153c7c);}(_0x98f0,0x19f));var _0x098f=function(_0x3617e9,_0x8075f1){_0x3617e9=_0x3617e9-0x0;var _0xb24e1a=_0x98f0[_0x3617e9];return _0xb24e1a;};'use strict';var _=require(_0x098f('0x0'));var util=require(_0x098f('0x1'));var logger=require(_0x098f('0x2'))('api');var moment=require(_0x098f('0x3'));var BPromise=require(_0x098f('0x4'));var rp=require(_0x098f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x098f('0x6'));module[_0x098f('0x7')]=function(_0x474dd0,_0x3ce417){return _0x474dd0[_0x098f('0x8')](_0x098f('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e5f=['socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0x1e5f,0x194));var _0xf1e5=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x1e5f[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0xf1e5('0x0'));var util=require('util');var moment=require(_0xf1e5('0x1'));var BPromise=require(_0xf1e5('0x2'));var rs=require(_0xf1e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1e5('0x4'))['db'];var utils=require(_0xf1e5('0x5'));var logger=require(_0xf1e5('0x6'))(_0xf1e5('0x7'));var config=require('../../config/environment');var jayson=require(_0xf1e5('0x8'));var client=jayson[_0xf1e5('0x9')][_0xf1e5('0xa')]({'port':0x232a});config[_0xf1e5('0xb')]=_[_0xf1e5('0xc')](config[_0xf1e5('0xb')],{'host':_0xf1e5('0xd'),'port':0x18eb});var socket=require(_0xf1e5('0xe'))(new Redis(config[_0xf1e5('0xb')]));require('./whatsappAccount.socket')[_0xf1e5('0xf')](socket);function respondWithRpcPromise(_0xbc606c,_0x1f4fc7,_0x391bb1){return new BPromise(function(_0x119586,_0x788410){return client[_0xf1e5('0x10')](_0xbc606c,_0x391bb1)[_0xf1e5('0x11')](function(_0x10010){logger[_0xf1e5('0x12')](_0xf1e5('0x13'),_0x1f4fc7,_0xf1e5('0x14'));logger[_0xf1e5('0x15')](_0xf1e5('0x16'),_0x1f4fc7,_0xf1e5('0x14'),JSON[_0xf1e5('0x17')](_0x10010));if(_0x10010['error']){if(_0x10010[_0xf1e5('0x18')][_0xf1e5('0x19')]===0x1f4){logger[_0xf1e5('0x18')](_0xf1e5('0x13'),_0x1f4fc7,_0x10010[_0xf1e5('0x18')][_0xf1e5('0x1a')]);return _0x788410(_0x10010[_0xf1e5('0x18')][_0xf1e5('0x1a')]);}logger[_0xf1e5('0x18')](_0xf1e5('0x13'),_0x1f4fc7,_0x10010[_0xf1e5('0x18')]['message']);return _0x119586(_0x10010['error'][_0xf1e5('0x1a')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x1f4fc7,_0xf1e5('0x14'));_0x119586(_0x10010[_0xf1e5('0x1b')][_0xf1e5('0x1a')]);}})['catch'](function(_0x41c79d){logger[_0xf1e5('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x1f4fc7,_0x41c79d);_0x788410(_0x41c79d);});});}exports[_0xf1e5('0x1c')]=function(_0x4dd045){var _0x6f2e12=this;return new Promise(function(_0x2b4e51,_0x298ed1){return db[_0xf1e5('0x1d')][_0xf1e5('0x1e')]({'raw':_0x4dd045[_0xf1e5('0x1f')]?_0x4dd045[_0xf1e5('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4dd045['options']?_0x4dd045[_0xf1e5('0x1f')][_0xf1e5('0x20')]||null:null,'attributes':_0x4dd045[_0xf1e5('0x1f')]?_0x4dd045[_0xf1e5('0x1f')][_0xf1e5('0x21')]||null:null,'include':_0x4dd045[_0xf1e5('0x1f')]?_0x4dd045['options'][_0xf1e5('0x22')]?_[_0xf1e5('0x23')](_0x4dd045[_0xf1e5('0x1f')][_0xf1e5('0x22')],function(_0x566eaa){return{'model':db[_0x566eaa[_0xf1e5('0x24')]],'as':_0x566eaa['as'],'attributes':_0x566eaa[_0xf1e5('0x21')],'include':_0x566eaa[_0xf1e5('0x22')]?_['map'](_0x566eaa[_0xf1e5('0x22')],function(_0x5e584f){return{'model':db[_0x5e584f['model']],'as':_0x5e584f['as'],'attributes':_0x5e584f['attributes'],'include':_0x5e584f[_0xf1e5('0x22')]?_['map'](_0x5e584f[_0xf1e5('0x22')],function(_0xa95a31){return{'model':db[_0xa95a31[_0xf1e5('0x24')]],'as':_0xa95a31['as'],'attributes':_0xa95a31['attributes']};}):[]};}):[]};}):[]:[]})[_0xf1e5('0x11')](function(_0x16e2a3){logger[_0xf1e5('0x12')](_0xf1e5('0x1c'),_0x4dd045);logger[_0xf1e5('0x15')](_0xf1e5('0x1c'),_0x4dd045,JSON[_0xf1e5('0x17')](_0x16e2a3));_0x2b4e51(_0x16e2a3);})[_0xf1e5('0x25')](function(_0x58739b){logger[_0xf1e5('0x18')](_0xf1e5('0x1c'),_0x58739b[_0xf1e5('0x1a')],_0x4dd045);_0x298ed1(_0x6f2e12['error'](0x1f4,_0x58739b[_0xf1e5('0x1a')]));});});};
\ No newline at end of file
+var _0x74ba=['ShowWhatsappAccount','find','options','raw','where','include','map','model','attributes','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x4b5003,_0x4ca751){var _0x180198=function(_0x3f9eb7){while(--_0x3f9eb7){_0x4b5003['push'](_0x4b5003['shift']());}};_0x180198(++_0x4ca751);}(_0x74ba,0x114));var _0xa74b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x74ba[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xa74b('0x0'));var moment=require(_0xa74b('0x1'));var BPromise=require(_0xa74b('0x2'));var rs=require(_0xa74b('0x3'));var fs=require('fs');var Redis=require(_0xa74b('0x4'));var db=require(_0xa74b('0x5'))['db'];var utils=require(_0xa74b('0x6'));var logger=require(_0xa74b('0x7'))(_0xa74b('0x8'));var config=require(_0xa74b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa74b('0xa')]['http']({'port':0x232a});config[_0xa74b('0xb')]=_[_0xa74b('0xc')](config[_0xa74b('0xb')],{'host':_0xa74b('0xd'),'port':0x18eb});var socket=require(_0xa74b('0xe'))(new Redis(config['redis']));require(_0xa74b('0xf'))['register'](socket);function respondWithRpcPromise(_0x52cf4d,_0x579f40,_0x33d01e){return new BPromise(function(_0x1ea7f3,_0x368edc){return client[_0xa74b('0x10')](_0x52cf4d,_0x33d01e)[_0xa74b('0x11')](function(_0x13a83b){logger[_0xa74b('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x579f40,'request\x20sent');logger[_0xa74b('0x13')](_0xa74b('0x14'),_0x579f40,_0xa74b('0x15'),JSON['stringify'](_0x13a83b));if(_0x13a83b[_0xa74b('0x16')]){if(_0x13a83b['error'][_0xa74b('0x17')]===0x1f4){logger[_0xa74b('0x16')](_0xa74b('0x18'),_0x579f40,_0x13a83b['error'][_0xa74b('0x19')]);return _0x368edc(_0x13a83b[_0xa74b('0x16')]['message']);}logger[_0xa74b('0x16')](_0xa74b('0x18'),_0x579f40,_0x13a83b['error'][_0xa74b('0x19')]);return _0x1ea7f3(_0x13a83b[_0xa74b('0x16')][_0xa74b('0x19')]);}else{logger[_0xa74b('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x579f40,_0xa74b('0x15'));_0x1ea7f3(_0x13a83b[_0xa74b('0x1a')][_0xa74b('0x19')]);}})[_0xa74b('0x1b')](function(_0x468270){logger['error'](_0xa74b('0x18'),_0x579f40,_0x468270);_0x368edc(_0x468270);});});}exports[_0xa74b('0x1c')]=function(_0x2da759){var _0x22c1b3=this;return new Promise(function(_0x46ba01,_0x30e72f){return db['WhatsappAccount'][_0xa74b('0x1d')]({'raw':_0x2da759[_0xa74b('0x1e')]?_0x2da759[_0xa74b('0x1e')][_0xa74b('0x1f')]===undefined?!![]:![]:!![],'where':_0x2da759[_0xa74b('0x1e')]?_0x2da759[_0xa74b('0x1e')][_0xa74b('0x20')]||null:null,'attributes':_0x2da759[_0xa74b('0x1e')]?_0x2da759['options']['attributes']||null:null,'include':_0x2da759['options']?_0x2da759[_0xa74b('0x1e')][_0xa74b('0x21')]?_[_0xa74b('0x22')](_0x2da759[_0xa74b('0x1e')][_0xa74b('0x21')],function(_0x251fdc){return{'model':db[_0x251fdc[_0xa74b('0x23')]],'as':_0x251fdc['as'],'attributes':_0x251fdc[_0xa74b('0x24')],'include':_0x251fdc[_0xa74b('0x21')]?_[_0xa74b('0x22')](_0x251fdc[_0xa74b('0x21')],function(_0x3d5118){return{'model':db[_0x3d5118[_0xa74b('0x23')]],'as':_0x3d5118['as'],'attributes':_0x3d5118['attributes'],'include':_0x3d5118[_0xa74b('0x21')]?_[_0xa74b('0x22')](_0x3d5118['include'],function(_0x3fefb1){return{'model':db[_0x3fefb1[_0xa74b('0x23')]],'as':_0x3fefb1['as'],'attributes':_0x3fefb1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa74b('0x11')](function(_0x6ab470){logger[_0xa74b('0x12')](_0xa74b('0x1c'),_0x2da759);logger[_0xa74b('0x13')](_0xa74b('0x1c'),_0x2da759,JSON[_0xa74b('0x25')](_0x6ab470));_0x46ba01(_0x6ab470);})[_0xa74b('0x1b')](function(_0x2ba1f){logger['error'](_0xa74b('0x1c'),_0x2ba1f['message'],_0x2da759);_0x30e72f(_0x22c1b3[_0xa74b('0x16')](0x1f4,_0x2ba1f[_0xa74b('0x19')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x82f3=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','emit'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x82f3,0x130));var _0x382f=function(_0x1277c5,_0x342be3){_0x1277c5=_0x1277c5-0x0;var _0x319f11=_0x82f3[_0x1277c5];return _0x319f11;};'use strict';var WhatsappAccountEvents=require(_0x382f('0x0'));var events=['save','remove','update'];function createListener(_0x1c1b04,_0x2147b3){return function(_0x6278ca){_0x2147b3[_0x382f('0x1')](_0x1c1b04,_0x6278ca);};}function removeListener(_0xd9caa9,_0x182266){return function(){WhatsappAccountEvents[_0x382f('0x2')](_0xd9caa9,_0x182266);};}exports[_0x382f('0x3')]=function(_0x4ebdc9){for(var _0x500ccb=0x0,_0x177989=events[_0x382f('0x4')];_0x500ccb<_0x177989;_0x500ccb++){var _0x23c1a4=events[_0x500ccb];var _0x34ea5e=createListener(_0x382f('0x5')+_0x23c1a4,_0x4ebdc9);WhatsappAccountEvents['on'](_0x23c1a4,_0x34ea5e);}};
\ No newline at end of file
+var _0x9f1c=['save','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x427cd9,_0x1680e0){var _0x40f890=function(_0x4a0bb9){while(--_0x4a0bb9){_0x427cd9['push'](_0x427cd9['shift']());}};_0x40f890(++_0x1680e0);}(_0x9f1c,0x107));var _0xc9f1=function(_0x35e4e8,_0x331a8a){_0x35e4e8=_0x35e4e8-0x0;var _0x31a9bd=_0x9f1c[_0x35e4e8];return _0x31a9bd;};'use strict';var WhatsappAccountEvents=require(_0xc9f1('0x0'));var events=[_0xc9f1('0x1'),'remove',_0xc9f1('0x2')];function createListener(_0x55948b,_0x44fc7e){return function(_0x1aaab6){_0x44fc7e[_0xc9f1('0x3')](_0x55948b,_0x1aaab6);};}function removeListener(_0x116487,_0x2d3a52){return function(){WhatsappAccountEvents[_0xc9f1('0x4')](_0x116487,_0x2d3a52);};}exports[_0xc9f1('0x5')]=function(_0x48cef4){for(var _0x3826c1=0x0,_0x1040b6=events[_0xc9f1('0x6')];_0x3826c1<_0x1040b6;_0x3826c1++){var _0x5d028f=events[_0x3826c1];var _0x3181fa=createListener(_0xc9f1('0x7')+_0x5d028f,_0x48cef4);WhatsappAccountEvents['on'](_0x5d028f,_0x3181fa);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf922=['show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xf922,0xbb));var _0x2f92=function(_0xb8cc0f,_0x189431){_0xb8cc0f=_0xb8cc0f-0x0;var _0x49649b=_0xf922[_0xb8cc0f];return _0x49649b;};'use strict';var multer=require(_0x2f92('0x0'));var util=require(_0x2f92('0x1'));var path=require('path');var timeout=require(_0x2f92('0x2'));var express=require(_0x2f92('0x3'));var router=express[_0x2f92('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f92('0x5'));var interaction=require(_0x2f92('0x6'));var config=require(_0x2f92('0x7'));var controller=require(_0x2f92('0x8'));router[_0x2f92('0x9')]('/',auth[_0x2f92('0xa')](),controller[_0x2f92('0xb')]);router[_0x2f92('0x9')](_0x2f92('0xc'),auth['isAuthenticated'](),controller[_0x2f92('0xd')]);router[_0x2f92('0xe')]('/',auth[_0x2f92('0xa')](),controller['create']);router[_0x2f92('0xf')](_0x2f92('0xc'),auth[_0x2f92('0xa')](),controller[_0x2f92('0x10')]);router[_0x2f92('0x11')](_0x2f92('0xc'),auth['isAuthenticated'](),controller[_0x2f92('0x12')]);module[_0x2f92('0x13')]=router;
\ No newline at end of file
+var _0x013b=['get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x013b,0x198));var _0xb013=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x013b[_0x25d2fb];return _0x1ded53;};'use strict';var multer=require(_0xb013('0x0'));var util=require(_0xb013('0x1'));var path=require(_0xb013('0x2'));var timeout=require(_0xb013('0x3'));var express=require('express');var router=express[_0xb013('0x4')]();var fs_extra=require(_0xb013('0x5'));var auth=require(_0xb013('0x6'));var interaction=require(_0xb013('0x7'));var config=require(_0xb013('0x8'));var controller=require(_0xb013('0x9'));router[_0xb013('0xa')]('/',auth['isAuthenticated'](),controller[_0xb013('0xb')]);router[_0xb013('0xa')]('/:id',auth[_0xb013('0xc')](),controller[_0xb013('0xd')]);router[_0xb013('0xe')]('/',auth[_0xb013('0xc')](),controller[_0xb013('0xf')]);router[_0xb013('0x10')](_0xb013('0x11'),auth[_0xb013('0xc')](),controller[_0xb013('0x12')]);router[_0xb013('0x13')](_0xb013('0x11'),auth['isAuthenticated'](),controller[_0xb013('0x14')]);module[_0xb013('0x15')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a61=['TEXT','*,*,*,*','sequelize','STRING'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x3a61,0x192));var _0x13a6=function(_0x47ea50,_0x4f713f){_0x47ea50=_0x47ea50-0x0;var _0x4986bb=_0x3a61[_0x47ea50];return _0x4986bb;};'use strict';var Sequelize=require(_0x13a6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x13a6('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x13a6('0x2')]()},'description':{'type':Sequelize[_0x13a6('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x13a6('0x3')}};
\ No newline at end of file
+var _0x724f=['INTEGER','TEXT','STRING','*,*,*,*','exports'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x724f,0xf9));var _0xf724=function(_0x19cc6c,_0x1e613d){_0x19cc6c=_0x19cc6c-0x0;var _0x1333f8=_0x724f[_0x19cc6c];return _0x1333f8;};'use strict';var Sequelize=require('sequelize');module[_0xf724('0x0')]={'priority':{'type':Sequelize[_0xf724('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf724('0x2')]()},'description':{'type':Sequelize[_0xf724('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf724('0x4')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x63a6=['pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','count','status','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x63a6,0x1c7));var _0x663a=function(_0x41886e,_0x2f9b3e){_0x41886e=_0x41886e-0x0;var _0x10e7f4=_0x63a6[_0x41886e];return _0x10e7f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x663a('0x0'));var zipdir=require(_0x663a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x663a('0x2'));var moment=require(_0x663a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x663a('0x4'));var util=require(_0x663a('0x5'));var path=require(_0x663a('0x6'));var sox=require(_0x663a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663a('0x8'));var squel=require(_0x663a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x663a('0xa'));var toCsv=require(_0x663a('0xb'));var querystring=require(_0x663a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x663a('0xd'));var qs=require(_0x663a('0xe'));var as=require(_0x663a('0xf'));var hardwareService=require(_0x663a('0x10'));var logger=require(_0x663a('0x11'))(_0x663a('0x12'));var utils=require('../../config/utils');var config=require(_0x663a('0x13'));var licenseUtil=require(_0x663a('0x14'));var db=require(_0x663a('0x15'))['db'];function respondWithStatusCode(_0x581440,_0x583366){_0x583366=_0x583366||0xcc;return function(_0x3f3ef4){if(_0x3f3ef4){return _0x581440['sendStatus'](_0x583366);}return _0x581440['status'](_0x583366)[_0x663a('0x16')]();};}function respondWithResult(_0x39d5d4,_0x558f2f){_0x558f2f=_0x558f2f||0xc8;return function(_0x1eaf35){if(_0x1eaf35){return _0x39d5d4['status'](_0x558f2f)[_0x663a('0x17')](_0x1eaf35);}};}function respondWithFilteredResult(_0x1eab42,_0x15afa0){return function(_0x2d794f){if(_0x2d794f){var _0x1a8d76=typeof _0x15afa0['offset']===_0x663a('0x18')&&typeof _0x15afa0['limit']===_0x663a('0x18');var _0x45f489=_0x2d794f[_0x663a('0x19')];var _0x1508ab=_0x1a8d76?0x0:_0x15afa0['offset'];var _0x2a1f33=_0x1a8d76?_0x2d794f['count']:_0x15afa0['offset']+_0x15afa0['limit'];var _0x2d006c;if(_0x2a1f33>=_0x45f489){_0x2a1f33=_0x45f489;_0x2d006c=0xc8;}else{_0x2d006c=0xce;}_0x1eab42[_0x663a('0x1a')](_0x2d006c);return _0x1eab42['set']('Content-Range',_0x1508ab+'-'+_0x2a1f33+'/'+_0x45f489)[_0x663a('0x17')](_0x2d794f);}return null;};}function patchUpdates(_0x173a10){return function(_0x89d455){try{jsonpatch[_0x663a('0x1b')](_0x89d455,_0x173a10,!![]);}catch(_0x221c83){return BPromise[_0x663a('0x1c')](_0x221c83);}return _0x89d455[_0x663a('0x1d')]();};}function saveUpdates(_0x52d97b,_0x1586f3){return function(_0x21152c){if(_0x21152c){return _0x21152c[_0x663a('0x1e')](_0x52d97b)[_0x663a('0x1f')](function(_0x3d4e7c){return _0x3d4e7c;});}return null;};}function removeEntity(_0x207b26,_0x5e1bd1){return function(_0x310339){if(_0x310339){return _0x310339[_0x663a('0x20')]()['then'](function(){_0x207b26[_0x663a('0x1a')](0xcc)[_0x663a('0x16')]();});}};}function handleEntityNotFound(_0x5463d5,_0x3cb58a){return function(_0x2b2762){if(!_0x2b2762){_0x5463d5['sendStatus'](0x194);}return _0x2b2762;};}function handleError(_0x1e2653,_0x41c552){_0x41c552=_0x41c552||0x1f4;return function(_0x57131d){logger[_0x663a('0x21')](_0x57131d['stack']);if(_0x57131d[_0x663a('0x22')]){delete _0x57131d[_0x663a('0x22')];}_0x1e2653[_0x663a('0x1a')](_0x41c552)[_0x663a('0x23')](_0x57131d);};}exports[_0x663a('0x24')]=function(_0x57f93d,_0xcf9f0a){var _0x71efb={},_0x1ab286={},_0xf68801={'count':0x0,'rows':[]};var _0x210f03=_[_0x663a('0x25')](db[_0x663a('0x26')]['rawAttributes'],function(_0x3b4329){return{'name':_0x3b4329[_0x663a('0x27')],'type':_0x3b4329[_0x663a('0x28')][_0x663a('0x29')]};});_0x1ab286[_0x663a('0x2a')]=_['map'](_0x210f03,_0x663a('0x22'));_0x1ab286['query']=_[_0x663a('0x2b')](_0x57f93d[_0x663a('0x2c')]);_0x1ab286[_0x663a('0x2d')]=_[_0x663a('0x2e')](_0x1ab286[_0x663a('0x2a')],_0x1ab286['query']);_0x71efb[_0x663a('0x2f')]=_['intersection'](_0x1ab286[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x30')]));_0x71efb['attributes']=_0x71efb[_0x663a('0x2f')][_0x663a('0x31')]?_0x71efb[_0x663a('0x2f')]:_0x1ab286[_0x663a('0x2a')];if(!_0x57f93d[_0x663a('0x2c')][_0x663a('0x32')](_0x663a('0x33'))){_0x71efb[_0x663a('0x34')]=qs['limit'](_0x57f93d[_0x663a('0x2c')][_0x663a('0x34')]);_0x71efb['offset']=qs[_0x663a('0x35')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x35')]);}_0x71efb[_0x663a('0x36')]=qs[_0x663a('0x37')](_0x57f93d['query'][_0x663a('0x37')]);_0x71efb['where']=qs[_0x663a('0x2d')](_[_0x663a('0x38')](_0x57f93d['query'],_0x1ab286['filters']),_0x210f03);if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x39')]){_0x71efb['where']=_[_0x663a('0x3a')](_0x71efb[_0x663a('0x3b')],{'$or':_[_0x663a('0x25')](_0x210f03,function(_0x4d0b8d){if(_0x4d0b8d[_0x663a('0x28')]!==_0x663a('0x3c')){var _0x5e2826={};_0x5e2826[_0x4d0b8d[_0x663a('0x22')]]={'$like':'%'+_0x57f93d['query'][_0x663a('0x39')]+'%'};return _0x5e2826;}})});}_0x71efb=_[_0x663a('0x3a')]({},_0x71efb,_0x57f93d['options']);var _0x1aff26={'where':_0x71efb[_0x663a('0x3b')]};return db['WhatsappApplication'][_0x663a('0x19')](_0x1aff26)[_0x663a('0x1f')](function(_0x5de40d){_0xf68801['count']=_0x5de40d;if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x3d')]){_0x71efb[_0x663a('0x3e')]=[{'all':!![]}];}return db[_0x663a('0x26')][_0x663a('0x3f')](_0x71efb);})[_0x663a('0x1f')](function(_0x110afa){_0xf68801[_0x663a('0x40')]=_0x110afa;return _0xf68801;})['then'](respondWithFilteredResult(_0xcf9f0a,_0x71efb))[_0x663a('0x41')](handleError(_0xcf9f0a,null));};exports[_0x663a('0x42')]=function(_0x252963,_0x2e0df7){var _0x51fd91={'raw':!![],'where':{'id':_0x252963['params']['id']}},_0x285ed3={};_0x285ed3['model']=_['keys'](db['WhatsappApplication'][_0x663a('0x43')]);_0x285ed3[_0x663a('0x2c')]=_[_0x663a('0x2b')](_0x252963['query']);_0x285ed3[_0x663a('0x2d')]=_['intersection'](_0x285ed3[_0x663a('0x2a')],_0x285ed3[_0x663a('0x2c')]);_0x51fd91['attributes']=_[_0x663a('0x2e')](_0x285ed3[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x252963[_0x663a('0x2c')][_0x663a('0x30')]));_0x51fd91[_0x663a('0x2f')]=_0x51fd91[_0x663a('0x2f')][_0x663a('0x31')]?_0x51fd91['attributes']:_0x285ed3[_0x663a('0x2a')];if(_0x252963[_0x663a('0x2c')]['includeAll']){_0x51fd91['include']=[{'all':!![]}];}_0x51fd91=_[_0x663a('0x3a')]({},_0x51fd91,_0x252963[_0x663a('0x44')]);return db[_0x663a('0x26')][_0x663a('0x45')](_0x51fd91)['then'](handleEntityNotFound(_0x2e0df7,null))['then'](respondWithResult(_0x2e0df7,null))[_0x663a('0x41')](handleError(_0x2e0df7,null));};exports[_0x663a('0x46')]=function(_0x55b3ed,_0x5efe40){return db[_0x663a('0x26')][_0x663a('0x46')](_0x55b3ed[_0x663a('0x47')],{})[_0x663a('0x1f')](respondWithResult(_0x5efe40,0xc9))[_0x663a('0x41')](handleError(_0x5efe40,null));};exports[_0x663a('0x1e')]=function(_0x1c3bc4,_0x5ec404){if(_0x1c3bc4[_0x663a('0x47')]['id']){delete _0x1c3bc4[_0x663a('0x47')]['id'];}return db[_0x663a('0x26')][_0x663a('0x45')]({'where':{'id':_0x1c3bc4[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x5ec404,null))[_0x663a('0x1f')](saveUpdates(_0x1c3bc4[_0x663a('0x47')],null))[_0x663a('0x1f')](respondWithResult(_0x5ec404,null))[_0x663a('0x41')](handleError(_0x5ec404,null));};exports[_0x663a('0x20')]=function(_0x4a61f5,_0x32fbe2){return db[_0x663a('0x26')]['find']({'where':{'id':_0x4a61f5[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x32fbe2,null))[_0x663a('0x1f')](removeEntity(_0x32fbe2,null))['catch'](handleError(_0x32fbe2,null));};
\ No newline at end of file
+var _0xc373=['error','name','send','index','WhatsappApplication','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','params','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','set','apply','reject','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc373,0x1c7));var _0x3c37=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc373[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c37('0x0'));var zipdir=require(_0x3c37('0x1'));var jsonpatch=require(_0x3c37('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c37('0x3'));var Mustache=require(_0x3c37('0x4'));var util=require(_0x3c37('0x5'));var path=require(_0x3c37('0x6'));var sox=require(_0x3c37('0x7'));var csv=require(_0x3c37('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c37('0x9'));var squel=require(_0x3c37('0xa'));var crypto=require(_0x3c37('0xb'));var jsforce=require(_0x3c37('0xc'));var deskjs=require(_0x3c37('0xd'));var toCsv=require(_0x3c37('0x8'));var querystring=require(_0x3c37('0xe'));var Papa=require(_0x3c37('0xf'));var Redis=require(_0x3c37('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3c37('0x11'));var hardwareService=require(_0x3c37('0x12'));var logger=require(_0x3c37('0x13'))(_0x3c37('0x14'));var utils=require(_0x3c37('0x15'));var config=require(_0x3c37('0x16'));var licenseUtil=require(_0x3c37('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc333c2,_0x454f92){_0x454f92=_0x454f92||0xcc;return function(_0x458002){if(_0x458002){return _0xc333c2['sendStatus'](_0x454f92);}return _0xc333c2['status'](_0x454f92)[_0x3c37('0x18')]();};}function respondWithResult(_0x57c33f,_0x52ab1f){_0x52ab1f=_0x52ab1f||0xc8;return function(_0x37904b){if(_0x37904b){return _0x57c33f[_0x3c37('0x19')](_0x52ab1f)[_0x3c37('0x1a')](_0x37904b);}};}function respondWithFilteredResult(_0x1b70a6,_0x1268b3){return function(_0x22e851){if(_0x22e851){var _0x25d36e=typeof _0x1268b3[_0x3c37('0x1b')]===_0x3c37('0x1c')&&typeof _0x1268b3['limit']===_0x3c37('0x1c');var _0x214a0b=_0x22e851['count'];var _0x55761e=_0x25d36e?0x0:_0x1268b3[_0x3c37('0x1b')];var _0x12a47c=_0x25d36e?_0x22e851[_0x3c37('0x1d')]:_0x1268b3[_0x3c37('0x1b')]+_0x1268b3[_0x3c37('0x1e')];var _0x2b0f25;if(_0x12a47c>=_0x214a0b){_0x12a47c=_0x214a0b;_0x2b0f25=0xc8;}else{_0x2b0f25=0xce;}_0x1b70a6['status'](_0x2b0f25);return _0x1b70a6[_0x3c37('0x1f')]('Content-Range',_0x55761e+'-'+_0x12a47c+'/'+_0x214a0b)['json'](_0x22e851);}return null;};}function patchUpdates(_0x3bc0bb){return function(_0x2882ba){try{jsonpatch[_0x3c37('0x20')](_0x2882ba,_0x3bc0bb,!![]);}catch(_0x7fe4f0){return BPromise[_0x3c37('0x21')](_0x7fe4f0);}return _0x2882ba['save']();};}function saveUpdates(_0x27f83e,_0x54776f){return function(_0x3399a7){if(_0x3399a7){return _0x3399a7['update'](_0x27f83e)[_0x3c37('0x22')](function(_0x2e4226){return _0x2e4226;});}return null;};}function removeEntity(_0x348802,_0x574890){return function(_0x51d25d){if(_0x51d25d){return _0x51d25d['destroy']()['then'](function(){_0x348802['status'](0xcc)[_0x3c37('0x18')]();});}};}function handleEntityNotFound(_0xb334d0,_0x1655c1){return function(_0x3ab6bd){if(!_0x3ab6bd){_0xb334d0['sendStatus'](0x194);}return _0x3ab6bd;};}function handleError(_0x52b5d9,_0x565902){_0x565902=_0x565902||0x1f4;return function(_0x65ac66){logger[_0x3c37('0x23')](_0x65ac66['stack']);if(_0x65ac66['name']){delete _0x65ac66[_0x3c37('0x24')];}_0x52b5d9[_0x3c37('0x19')](_0x565902)[_0x3c37('0x25')](_0x65ac66);};}exports[_0x3c37('0x26')]=function(_0x64474f,_0x56d9c2){var _0x1ce403={},_0x3abacf={},_0x415999={'count':0x0,'rows':[]};var _0xf1d5cb=_['map'](db[_0x3c37('0x27')][_0x3c37('0x28')],function(_0x531931){return{'name':_0x531931['fieldName'],'type':_0x531931[_0x3c37('0x29')][_0x3c37('0x2a')]};});_0x3abacf[_0x3c37('0x2b')]=_['map'](_0xf1d5cb,_0x3c37('0x24'));_0x3abacf['query']=_[_0x3c37('0x2c')](_0x64474f[_0x3c37('0x2d')]);_0x3abacf[_0x3c37('0x2e')]=_[_0x3c37('0x2f')](_0x3abacf[_0x3c37('0x2b')],_0x3abacf[_0x3c37('0x2d')]);_0x1ce403[_0x3c37('0x30')]=_[_0x3c37('0x2f')](_0x3abacf[_0x3c37('0x2b')],qs[_0x3c37('0x31')](_0x64474f['query']['fields']));_0x1ce403['attributes']=_0x1ce403[_0x3c37('0x30')][_0x3c37('0x32')]?_0x1ce403[_0x3c37('0x30')]:_0x3abacf[_0x3c37('0x2b')];if(!_0x64474f[_0x3c37('0x2d')][_0x3c37('0x33')](_0x3c37('0x34'))){_0x1ce403[_0x3c37('0x1e')]=qs[_0x3c37('0x1e')](_0x64474f[_0x3c37('0x2d')][_0x3c37('0x1e')]);_0x1ce403[_0x3c37('0x1b')]=qs['offset'](_0x64474f[_0x3c37('0x2d')][_0x3c37('0x1b')]);}_0x1ce403['order']=qs['sort'](_0x64474f[_0x3c37('0x2d')][_0x3c37('0x35')]);_0x1ce403[_0x3c37('0x36')]=qs[_0x3c37('0x2e')](_[_0x3c37('0x37')](_0x64474f[_0x3c37('0x2d')],_0x3abacf[_0x3c37('0x2e')]),_0xf1d5cb);if(_0x64474f[_0x3c37('0x2d')][_0x3c37('0x38')]){_0x1ce403['where']=_[_0x3c37('0x39')](_0x1ce403[_0x3c37('0x36')],{'$or':_[_0x3c37('0x3a')](_0xf1d5cb,function(_0x280e81){if(_0x280e81[_0x3c37('0x29')]!==_0x3c37('0x3b')){var _0xf76905={};_0xf76905[_0x280e81[_0x3c37('0x24')]]={'$like':'%'+_0x64474f[_0x3c37('0x2d')][_0x3c37('0x38')]+'%'};return _0xf76905;}})});}_0x1ce403=_['merge']({},_0x1ce403,_0x64474f[_0x3c37('0x3c')]);var _0x18acc3={'where':_0x1ce403[_0x3c37('0x36')]};return db[_0x3c37('0x27')][_0x3c37('0x1d')](_0x18acc3)['then'](function(_0x2ac3ca){_0x415999[_0x3c37('0x1d')]=_0x2ac3ca;if(_0x64474f[_0x3c37('0x2d')][_0x3c37('0x3d')]){_0x1ce403['include']=[{'all':!![]}];}return db[_0x3c37('0x27')]['findAll'](_0x1ce403);})[_0x3c37('0x22')](function(_0x51687d){_0x415999[_0x3c37('0x3e')]=_0x51687d;return _0x415999;})[_0x3c37('0x22')](respondWithFilteredResult(_0x56d9c2,_0x1ce403))[_0x3c37('0x3f')](handleError(_0x56d9c2,null));};exports['show']=function(_0x3bf68a,_0x34096f){var _0x2e82d0={'raw':!![],'where':{'id':_0x3bf68a[_0x3c37('0x40')]['id']}},_0x2a4300={};_0x2a4300['model']=_[_0x3c37('0x2c')](db[_0x3c37('0x27')][_0x3c37('0x28')]);_0x2a4300[_0x3c37('0x2d')]=_[_0x3c37('0x2c')](_0x3bf68a[_0x3c37('0x2d')]);_0x2a4300[_0x3c37('0x2e')]=_['intersection'](_0x2a4300[_0x3c37('0x2b')],_0x2a4300[_0x3c37('0x2d')]);_0x2e82d0[_0x3c37('0x30')]=_['intersection'](_0x2a4300[_0x3c37('0x2b')],qs['fields'](_0x3bf68a[_0x3c37('0x2d')][_0x3c37('0x31')]));_0x2e82d0[_0x3c37('0x30')]=_0x2e82d0[_0x3c37('0x30')]['length']?_0x2e82d0['attributes']:_0x2a4300['model'];if(_0x3bf68a[_0x3c37('0x2d')][_0x3c37('0x3d')]){_0x2e82d0['include']=[{'all':!![]}];}_0x2e82d0=_['merge']({},_0x2e82d0,_0x3bf68a[_0x3c37('0x3c')]);return db['WhatsappApplication'][_0x3c37('0x41')](_0x2e82d0)[_0x3c37('0x22')](handleEntityNotFound(_0x34096f,null))[_0x3c37('0x22')](respondWithResult(_0x34096f,null))[_0x3c37('0x3f')](handleError(_0x34096f,null));};exports[_0x3c37('0x42')]=function(_0x300d58,_0x436b28){return db[_0x3c37('0x27')][_0x3c37('0x42')](_0x300d58[_0x3c37('0x43')],{})[_0x3c37('0x22')](respondWithResult(_0x436b28,0xc9))['catch'](handleError(_0x436b28,null));};exports[_0x3c37('0x44')]=function(_0x1869ad,_0x4b8351){if(_0x1869ad[_0x3c37('0x43')]['id']){delete _0x1869ad[_0x3c37('0x43')]['id'];}return db[_0x3c37('0x27')]['find']({'where':{'id':_0x1869ad[_0x3c37('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b8351,null))[_0x3c37('0x22')](saveUpdates(_0x1869ad[_0x3c37('0x43')],null))[_0x3c37('0x22')](respondWithResult(_0x4b8351,null))['catch'](handleError(_0x4b8351,null));};exports[_0x3c37('0x45')]=function(_0x415bac,_0x1dc208){return db[_0x3c37('0x27')][_0x3c37('0x41')]({'where':{'id':_0x415bac[_0x3c37('0x40')]['id']}})[_0x3c37('0x22')](handleEntityNotFound(_0x1dc208,null))[_0x3c37('0x22')](removeEntity(_0x1dc208,null))[_0x3c37('0x3f')](handleError(_0x1dc208,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb458=['path','rimraf','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x43a7c5,_0x2b90fc){var _0x531ee4=function(_0x6cef5d){while(--_0x6cef5d){_0x43a7c5['push'](_0x43a7c5['shift']());}};_0x531ee4(++_0x2b90fc);}(_0xb458,0x103));var _0x8b45=function(_0x65eae,_0x32dc5f){_0x65eae=_0x65eae-0x0;var _0x18e82b=_0xb458[_0x65eae];return _0x18e82b;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b45('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf5a7=['../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x599b3c,_0x17abbf){var _0x5336b9=function(_0x260cdf){while(--_0x260cdf){_0x599b3c['push'](_0x599b3c['shift']());}};_0x5336b9(++_0x17abbf);}(_0xf5a7,0x133));var _0x7f5a=function(_0x439723,_0xaa27e1){_0x439723=_0x439723-0x0;var _0x18cf70=_0xf5a7[_0x439723];return _0x18cf70;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('WhatsappApplication',attributes,{'tableName':_0x7f5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f5a('0xd'),'collate':_0x7f5a('0xe')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0xe5b3,0x133));var _0x3e5b=function(_0x15f347,_0x547ffe){_0x15f347=_0x15f347-0x0;var _0x3045a6=_0xe5b3[_0x15f347];return _0x3045a6;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});}
\ No newline at end of file
+var _0x84ab=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xa7c7be,_0x2df0cf){var _0x38496e=function(_0x10f1d2){while(--_0x10f1d2){_0xa7c7be['push'](_0xa7c7be['shift']());}};_0x38496e(++_0x2df0cf);}(_0x84ab,0x12f));var _0xb84a=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x84ab[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc496,_0xd445b5,_0x4fac4d){return new BPromise(function(_0x3e9086,_0x8d9dbe){return client['request'](_0x4dc496,_0x4fac4d)[_0xb84a('0xa')](function(_0x525cb7){logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,_0xb84a('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xd445b5,'request\x20sent',JSON[_0xb84a('0xe')](_0x525cb7));if(_0x525cb7[_0xb84a('0xf')]){if(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x10')]===0x1f4){logger[_0xb84a('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x8d9dbe(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x3e9086(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}else{logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,'request\x20sent');_0x3e9086(_0x525cb7[_0xb84a('0x12')][_0xb84a('0x11')]);}})[_0xb84a('0x13')](function(_0x3c0b54){logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x3c0b54);_0x8d9dbe(_0x3c0b54);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4317=['./whatsappInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd769bc,_0x5bdf82){var _0x21b8df=function(_0x1630f1){while(--_0x1630f1){_0xd769bc['push'](_0xd769bc['shift']());}};_0x21b8df(++_0x5bdf82);}(_0x4317,0x7c));var _0x7431=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4317[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xa')](_0x7431('0xe'),auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0xa')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0xa')](_0x7431('0x12'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);router[_0x7431('0x14')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0x15')]);router[_0x7431('0x14')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x16')]);router['post'](_0x7431('0x17'),auth[_0x7431('0xc')](),interaction[_0x7431('0x18')]('whatsapp',_0x7431('0x19')),controller[_0x7431('0x1a')]);router[_0x7431('0x1b')]('/:id',auth[_0x7431('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x7431('0x1c')]);router[_0x7431('0x1d')](_0x7431('0xe'),auth[_0x7431('0xc')](),interaction['tracked']('whatsapp',_0x7431('0x1e')),controller[_0x7431('0x1f')]);router[_0x7431('0x1d')](_0x7431('0x17'),auth[_0x7431('0xc')](),controller[_0x7431('0x20')]);module['exports']=router;
\ No newline at end of file
+var _0xe015=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','whatsapp','put','tracked','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','Router'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe015,0x13b));var _0x5e01=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe015[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/describe',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller[_0x5e01('0xd')]);router['get'](_0x5e01('0xe'),auth['isAuthenticated'](),controller[_0x5e01('0xf')]);router['get'](_0x5e01('0x10'),auth[_0x5e01('0x8')](),controller['download']);router[_0x5e01('0x11')]('/',auth[_0x5e01('0x8')](),controller['create']);router['post'](_0x5e01('0xe'),auth[_0x5e01('0x8')](),controller[_0x5e01('0x12')]);router[_0x5e01('0x11')](_0x5e01('0x13'),auth[_0x5e01('0x8')](),interaction['tracked'](_0x5e01('0x14'),'whatsappinteraction:addtags'),controller['addTags']);router[_0x5e01('0x15')](_0x5e01('0xc'),auth['isAuthenticated'](),interaction[_0x5e01('0x16')]('whatsapp',_0x5e01('0x17')),controller['update']);router[_0x5e01('0x18')]('/:id',auth[_0x5e01('0x8')](),interaction['tracked']('whatsapp',_0x5e01('0x19')),controller[_0x5e01('0x1a')]);router['delete'](_0x5e01('0x13'),auth[_0x5e01('0x8')](),controller[_0x5e01('0x1b')]);module[_0x5e01('0x1c')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4a2=['sequelize','BOOLEAN','STRING','DATE','ENUM','out','INTEGER'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd4a2,0x173));var _0x2d4a=function(_0x3dcd64,_0x12fdcc){_0x3dcd64=_0x3dcd64-0x0;var _0x22ae8f=_0xd4a2[_0x3dcd64];return _0x22ae8f;};'use strict';var Sequelize=require(_0x2d4a('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2d4a('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2d4a('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2d4a('0x2')]},'read1stAt':{'type':Sequelize[_0x2d4a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2d4a('0x4')]('in',_0x2d4a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2d4a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2d4a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2d4a('0x6')]}};
\ No newline at end of file
+var _0x225b=['ENUM','out','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x160e09,_0x5038d2){var _0x42545a=function(_0x4fa027){while(--_0x4fa027){_0x160e09['push'](_0x160e09['shift']());}};_0x42545a(++_0x5038d2);}(_0x225b,0xb1));var _0xb225=function(_0x5b2a70,_0x2303f6){_0x5b2a70=_0x5b2a70-0x0;var _0x3a68f2=_0x225b[_0x5b2a70];return _0x3a68f2;};'use strict';var Sequelize=require(_0xb225('0x0'));var moment=require(_0xb225('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb225('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb225('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb225('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb225('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb225('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb225('0x5')]('in',_0xb225('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb225('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb225('0x5')]('in',_0xb225('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb225('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15ad=['register','sendStatus','status','json','offset','undefined','set','update','then','end','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','whatsapp','query','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','options','create','body','catch','find','destroy','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','split','count','include','findAll','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','server','tmp','files','format','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','get','mkdirSync','Whatsapp','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','out','System','Contact','value','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15ad,0x6e));var _0xd15a=function(_0x3f10b0,_0x35bca0){_0x3f10b0=_0x3f10b0-0x0;var _0x1029c4=_0x15ad[_0x3f10b0];return _0x1029c4;};'use strict';var rimraf=require(_0xd15a('0x0'));var zipdir=require(_0xd15a('0x1'));var moment=require('moment');var BPromise=require(_0xd15a('0x2'));var util=require(_0xd15a('0x3'));var path=require(_0xd15a('0x4'));var ejs=require(_0xd15a('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd15a('0x6'));var interaction=require(_0xd15a('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xd15a('0x8'));var logger=require(_0xd15a('0x9'))('api');var config=require('../../config/environment');var db=require(_0xd15a('0xa'))['db'];config[_0xd15a('0xb')]=_['defaults'](config[_0xd15a('0xb')],{'host':_0xd15a('0xc'),'port':0x18eb});var socket=require(_0xd15a('0xd'))(new Redis(config[_0xd15a('0xb')]));require('./whatsappInteraction.socket')[_0xd15a('0xe')](socket);function respondWithStatusCode(_0x5ba25b,_0x116a3f){_0x116a3f=_0x116a3f||0xcc;return function(_0x2f35d6){if(_0x2f35d6){return _0x5ba25b[_0xd15a('0xf')](_0x116a3f);}return _0x5ba25b['status'](_0x116a3f)['end']();};}function respondWithResult(_0x2e5851,_0x2d2940){_0x2d2940=_0x2d2940||0xc8;return function(_0x50bf8f){if(_0x50bf8f){return _0x2e5851[_0xd15a('0x10')](_0x2d2940)[_0xd15a('0x11')](_0x50bf8f);}};}function respondWithFilteredResult(_0x4674d6,_0x9898b8){return function(_0xbdbdff){if(_0xbdbdff){var _0x31c38d=typeof _0x9898b8[_0xd15a('0x12')]==='undefined'&&typeof _0x9898b8['limit']===_0xd15a('0x13');var _0x135737=_0xbdbdff['count'];var _0x208f46=_0x31c38d?0x0:_0x9898b8['offset'];var _0xc20782=_0x31c38d?_0xbdbdff['count']:_0x9898b8['offset']+_0x9898b8['limit'];var _0x423e9e;if(_0xc20782>=_0x135737){_0xc20782=_0x135737;_0x423e9e=0xc8;}else{_0x423e9e=0xce;}_0x4674d6[_0xd15a('0x10')](_0x423e9e);return _0x4674d6[_0xd15a('0x14')]('Content-Range',_0x208f46+'-'+_0xc20782+'/'+_0x135737)[_0xd15a('0x11')](_0xbdbdff);}return null;};}function saveUpdates(_0x25f5c0){return function(_0xc5bba){if(_0xc5bba){return _0xc5bba[_0xd15a('0x15')](_0x25f5c0)[_0xd15a('0x16')](function(_0x533e09){return _0x533e09;});}return null;};}function removeEntity(_0x3fd425){return function(_0x24edbd){if(_0x24edbd){return _0x24edbd['destroy']()[_0xd15a('0x16')](function(){_0x3fd425[_0xd15a('0x10')](0xcc)[_0xd15a('0x17')]();});}};}function handleEntityNotFound(_0x34ff4d){return function(_0xa1ae57){if(!_0xa1ae57){_0x34ff4d[_0xd15a('0xf')](0x194);}return _0xa1ae57;};}function handleError(_0x4b79c7,_0x14cf46){_0x14cf46=_0x14cf46||0x1f4;return function(_0x5a32b1){logger[_0xd15a('0x18')](_0x5a32b1[_0xd15a('0x19')]);if(_0x5a32b1[_0xd15a('0x1a')]){delete _0x5a32b1['name'];}_0x4b79c7[_0xd15a('0x10')](_0x14cf46)[_0xd15a('0x1b')](_0x5a32b1);};}exports[_0xd15a('0x1c')]=function(_0x39d52d,_0x42820c){var _0xb4af6b={};var _0x1334d1=_[_0xd15a('0x1d')](db[_0xd15a('0x1e')][_0xd15a('0x1f')],function(_0x37b2f8){return{'name':_0x37b2f8[_0xd15a('0x20')],'type':_0x37b2f8[_0xd15a('0x21')]['key']};});_0xb4af6b=qs[_0xd15a('0x22')](_0x1334d1,_0x39d52d);return interaction['findAll'](_0xd15a('0x23'),_0x39d52d[_0xd15a('0x24')],_0x39d52d['user'],_0xb4af6b,_0x1334d1)[_0xd15a('0x16')](respondWithFilteredResult(_0x42820c,_0xb4af6b))['catch'](handleError(_0x42820c,null));};exports[_0xd15a('0x25')]=function(_0x479344,_0x1284cd){var _0x3dd580={'raw':![],'where':{'id':_0x479344[_0xd15a('0x26')]['id']}},_0x4e5a7a={};_0x4e5a7a[_0xd15a('0x27')]=_['keys'](db['WhatsappInteraction'][_0xd15a('0x1f')]);_0x4e5a7a['query']=_[_0xd15a('0x28')](_0x479344['query']);_0x4e5a7a[_0xd15a('0x29')]=_[_0xd15a('0x2a')](_0x4e5a7a['model'],_0x4e5a7a['query']);_0x3dd580['attributes']=_[_0xd15a('0x2a')](_0x4e5a7a[_0xd15a('0x27')],qs[_0xd15a('0x2b')](_0x479344[_0xd15a('0x24')]['fields']));_0x3dd580[_0xd15a('0x2c')]=_0x3dd580[_0xd15a('0x2c')][_0xd15a('0x2d')]?_0x3dd580[_0xd15a('0x2c')]:_0x4e5a7a[_0xd15a('0x27')];if(_0x479344[_0xd15a('0x24')][_0xd15a('0x2e')]){_0x3dd580['include']=[{'all':!![]}];}_0x3dd580=_['merge']({},_0x3dd580,_0x479344[_0xd15a('0x2f')]);return db[_0xd15a('0x1e')]['find'](_0x3dd580)[_0xd15a('0x16')](handleEntityNotFound(_0x1284cd,null))[_0xd15a('0x16')](respondWithResult(_0x1284cd,null))['catch'](handleError(_0x1284cd,null));};exports[_0xd15a('0x30')]=function(_0xf52071,_0x4f814b){return db[_0xd15a('0x1e')]['create'](_0xf52071[_0xd15a('0x31')],{})['then'](respondWithResult(_0x4f814b,0xc9))[_0xd15a('0x32')](handleError(_0x4f814b,null));};exports[_0xd15a('0x15')]=function(_0x5a1c9e,_0xe71469){if(_0x5a1c9e['body']['id']){delete _0x5a1c9e[_0xd15a('0x31')]['id'];}return db[_0xd15a('0x1e')][_0xd15a('0x33')]({'where':{'id':_0x5a1c9e['params']['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0xe71469,null))[_0xd15a('0x16')](saveUpdates(_0x5a1c9e[_0xd15a('0x31')],null))[_0xd15a('0x16')](respondWithResult(_0xe71469,null))[_0xd15a('0x32')](handleError(_0xe71469,null));};exports[_0xd15a('0x34')]=function(_0x25b7d0,_0x1a548c){return db['WhatsappInteraction']['find']({'where':{'id':_0x25b7d0['params']['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0x1a548c,null))['then'](removeEntity(_0x1a548c,null))[_0xd15a('0x32')](handleError(_0x1a548c,null));};exports[_0xd15a('0x35')]=function(_0x4db015,_0x4c5cdf){return db['WhatsappInteraction']['describe']()[_0xd15a('0x16')](respondWithResult(_0x4c5cdf,null))[_0xd15a('0x32')](handleError(_0x4c5cdf,null));};exports[_0xd15a('0x36')]=function(_0x356da6,_0x56516c){return db[_0xd15a('0x37')][_0xd15a('0x33')]({'where':{'id':_0x356da6[_0xd15a('0x26')]['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0x56516c,null))[_0xd15a('0x16')](function(_0x20aa48){if(_0x20aa48){return _0x20aa48[_0xd15a('0x36')](_0x356da6['body']['ids'],_[_0xd15a('0x38')](_0x356da6[_0xd15a('0x31')],[_0xd15a('0x39'),'id'])||{});}})[_0xd15a('0x16')](respondWithResult(_0x56516c,null))[_0xd15a('0x32')](handleError(_0x56516c,null));};exports[_0xd15a('0x3a')]=function(_0x26853a,_0x51490b){var _0x327492={'raw':![],'where':{}};var _0x1e2207={};var _0x35bd7b={'count':0x0,'rows':[]};return db[_0xd15a('0x1e')][_0xd15a('0x3b')]({'where':{'id':_0x26853a[_0xd15a('0x26')]['id']}})['then'](handleEntityNotFound(_0x51490b,null))[_0xd15a('0x16')](function(_0x59ae58){if(_0x59ae58){_0x1e2207[_0xd15a('0x27')]=_[_0xd15a('0x28')](db[_0xd15a('0x37')][_0xd15a('0x1f')]);_0x1e2207[_0xd15a('0x24')]=_[_0xd15a('0x28')](_0x26853a[_0xd15a('0x24')]);_0x1e2207[_0xd15a('0x29')]=_[_0xd15a('0x2a')](_0x1e2207[_0xd15a('0x27')],_0x1e2207[_0xd15a('0x24')]);_0x327492['attributes']=_[_0xd15a('0x2a')](_0x1e2207[_0xd15a('0x27')],qs[_0xd15a('0x2b')](_0x26853a[_0xd15a('0x24')][_0xd15a('0x2b')]));_0x327492['attributes']=_0x327492[_0xd15a('0x2c')]['length']?_0x327492[_0xd15a('0x2c')]:_0x1e2207['model'];if(!_0x26853a[_0xd15a('0x24')][_0xd15a('0x3c')](_0xd15a('0x3d'))){_0x327492[_0xd15a('0x3e')]=qs['limit'](_0x26853a['query']['limit']);_0x327492[_0xd15a('0x12')]=qs[_0xd15a('0x12')](_0x26853a['query'][_0xd15a('0x12')]);}_0x327492[_0xd15a('0x3f')]=qs[_0xd15a('0x40')](_0x26853a[_0xd15a('0x24')][_0xd15a('0x40')]);_0x327492[_0xd15a('0x41')]=qs[_0xd15a('0x29')](_['pick'](_0x26853a[_0xd15a('0x24')],_0x1e2207[_0xd15a('0x29')]));_0x327492['where']['WhatsappInteractionId']=_0x59ae58['id'];if(_0x26853a[_0xd15a('0x24')][_0xd15a('0x42')]){_0x327492[_0xd15a('0x41')]=_[_0xd15a('0x43')](_0x327492[_0xd15a('0x41')],{'$or':_[_0xd15a('0x1d')](_0x327492['attributes'],function(_0x324d69){var _0x954312={};_0x954312[_0x324d69]={'$like':'%'+_0x26853a['query'][_0xd15a('0x42')]+'%'};return _0x954312;})});}if(_0x26853a[_0xd15a('0x24')]['$gte']){var _0x22b4db=_0x26853a['query']['$gte'][_0xd15a('0x44')](',');var _0x15f490={};_0x15f490[_0x22b4db[0x0]]={'$gte':moment(_0x22b4db[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x327492[_0xd15a('0x41')]=_[_0xd15a('0x43')](_0x327492[_0xd15a('0x41')],_0x15f490);}_0x327492=_[_0xd15a('0x43')]({},_0x327492,_0x26853a['options']);return db[_0xd15a('0x37')][_0xd15a('0x45')]({'where':_0x327492[_0xd15a('0x41')]})[_0xd15a('0x16')](function(_0x30c94f){_0x35bd7b[_0xd15a('0x45')]=_0x30c94f;if(_0x26853a[_0xd15a('0x24')][_0xd15a('0x2e')]){_0x327492[_0xd15a('0x46')]=[{'all':!![]}];}return db[_0xd15a('0x37')][_0xd15a('0x47')](_0x327492);})[_0xd15a('0x16')](function(_0x2f3d74){_0x35bd7b[_0xd15a('0x48')]=_0x2f3d74;return _0x35bd7b;});}})[_0xd15a('0x16')](respondWithFilteredResult(_0x51490b,_0x327492))[_0xd15a('0x32')](handleError(_0x51490b,null));};exports['addTags']=function(_0xcc5890,_0xa7fd78){return db[_0xd15a('0x1e')][_0xd15a('0x33')]({'where':{'id':_0xcc5890[_0xd15a('0x26')]['id']}})[_0xd15a('0x16')](handleEntityNotFound(_0xa7fd78,null))[_0xd15a('0x16')](function(_0x34e9c0){if(_0x34e9c0){return _0x34e9c0[_0xd15a('0x49')](_0xcc5890['body'][_0xd15a('0x39')],_['omit'](_0xcc5890[_0xd15a('0x31')],[_0xd15a('0x39'),'id'])||{})[_0xd15a('0x4a')](function(){return db[_0xd15a('0x4b')][_0xd15a('0x47')]({'attributes':['id',_0xd15a('0x1a'),_0xd15a('0x4c')],'where':{'id':_0xcc5890[_0xd15a('0x31')][_0xd15a('0x39')]}});})[_0xd15a('0x16')](function(_0x5335a6){socket[_0xd15a('0x4d')]('whatsappInteractionTags:save',{'id':Number(_0xcc5890['params']['id']),'tags':_0x5335a6||[]});return{'id':Number(_0xcc5890[_0xd15a('0x26')]['id']),'tags':_0x5335a6||[]};});}})[_0xd15a('0x16')](respondWithResult(_0xa7fd78,null))[_0xd15a('0x32')](handleError(_0xa7fd78,null));};exports['removeTags']=function(_0x128bc3,_0x4728c0){return db['WhatsappInteraction']['find']({'where':{'id':_0x128bc3[_0xd15a('0x26')]['id']}})['then'](handleEntityNotFound(_0x4728c0,null))[_0xd15a('0x16')](function(_0x16a679){if(_0x16a679){return _0x16a679[_0xd15a('0x4e')](_0x128bc3[_0xd15a('0x24')]['ids']);}})['then'](respondWithStatusCode(_0x4728c0,null))[_0xd15a('0x32')](handleError(_0x4728c0,null));};exports[_0xd15a('0x4f')]=function(_0x2504b5,_0x13a8d2){var _0x30cba9=moment()[_0xd15a('0x50')]()['toString']();var _0x199c97=path[_0xd15a('0x51')](config[_0xd15a('0x52')],_0xd15a('0x53'),'files',_0xd15a('0x54'));var _0x314f5c=path[_0xd15a('0x51')](config[_0xd15a('0x52')],_0xd15a('0x53'),_0xd15a('0x55'),'attachments');var _0x180d25=path[_0xd15a('0x51')](_0x199c97,_0x30cba9);var _0x2a661c=util[_0xd15a('0x56')]('transcript-%d-%s.zip',_0x2504b5[_0xd15a('0x26')]['id'],_0x30cba9);var _0x280d9c=path[_0xd15a('0x51')](_0x199c97,_0x2a661c);var _0x2c94f7=[];_0x2c94f7[_0xd15a('0x57')]({'model':db[_0xd15a('0x58')],'as':_0xd15a('0x58'),'attributes':['id',_0xd15a('0x59')],'raw':!![]});_0x2c94f7[_0xd15a('0x57')]({'model':db[_0xd15a('0x5a')],'as':'Contact','attributes':['id',_0xd15a('0x5b'),_0xd15a('0x5c')],'raw':!![]});if(_0x2504b5['query'][_0xd15a('0x5d')]){_0x2c94f7[_0xd15a('0x57')]({'model':db['Attachment'],'as':_0xd15a('0x5e'),'raw':!![]});}var _0x26571d=[{'model':db['WhatsappMessage'],'as':_0xd15a('0x5f'),'attributes':['id',_0xd15a('0x31'),_0xd15a('0x60'),_0xd15a('0x61'),_0xd15a('0x62'),_0xd15a('0x63')],'include':_0x2c94f7}];_0x26571d['push']({'model':db[_0xd15a('0x64')],'as':'Account','attributes':['id',_0xd15a('0x1a')]});_0x26571d[_0xd15a('0x57')]({'model':db[_0xd15a('0x58')],'as':'Owner','attributes':['id','fullname']});return db[_0xd15a('0x1e')][_0xd15a('0x33')]({'where':{'id':_0x2504b5[_0xd15a('0x26')]['id']},'include':_0x26571d})['then'](handleEntityNotFound(_0x13a8d2,null))['then'](function(_0x3f8f0b){if(_0x3f8f0b){var _0x23b965=_0x3f8f0b[_0xd15a('0x65')]({'plain':!![]});fs[_0xd15a('0x66')](_0x180d25);var _0x5dffbf={'channel':_0xd15a('0x67'),'account':_0x23b965[_0xd15a('0x68')]['name'],'agent':_0x23b965[_0xd15a('0x69')]?_0x23b965[_0xd15a('0x69')]['fullname']:'N.A.','createdAt':moment(_0x23b965['createdAt'])['format'](_0xd15a('0x6a'))[_0xd15a('0x6b')](),'closedAt':_0x23b965[_0xd15a('0x6c')]?moment(_0x23b965[_0xd15a('0x6d')])[_0xd15a('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd15a('0x6b')]():'','disposition':_0x23b965[_0xd15a('0x6e')],'messages':_(_0x23b965[_0xd15a('0x5f')])[_0xd15a('0x42')]({'secret':![]})[_0xd15a('0x1d')](function(_0xfec887){if(_0xfec887[_0xd15a('0x5e')]){var _0x3de3f5=path[_0xd15a('0x51')](_0x314f5c,_0xfec887[_0xd15a('0x5e')][_0xd15a('0x6f')]);if(fs['existsSync'](_0x3de3f5)){fs[_0xd15a('0x70')](_0x3de3f5)[_0xd15a('0x71')](fs[_0xd15a('0x72')](path[_0xd15a('0x51')](_0x180d25,_0xfec887[_0xd15a('0x5e')]['basename'])));}}return{'date':moment(_0xfec887[_0xd15a('0x60')])[_0xd15a('0x56')](_0xd15a('0x6a'))[_0xd15a('0x6b')](),'sender':_0xfec887['direction']===_0xd15a('0x73')?_0xfec887[_0xd15a('0x58')]?_0xfec887[_0xd15a('0x58')][_0xd15a('0x59')]:_0xd15a('0x74'):_0xfec887[_0xd15a('0x75')][_0xd15a('0x5b')]+(_0xfec887['Contact']['lastName']?'\x20'+_0xfec887['Contact']['lastName']:''),'body':_0xfec887[_0xd15a('0x5e')]?_0xfec887[_0xd15a('0x5e')][_0xd15a('0x6f')]:_0xfec887[_0xd15a('0x31')],'direction':_0xfec887[_0xd15a('0x61')]===_0xd15a('0x73')?'A':'C','secret':_0xfec887['secret'],'read':_0xfec887[_0xd15a('0x63')],'attachment':_0xfec887['Attachment']};})[_0xd15a('0x76')]()};return ejs['renderFile'](path[_0xd15a('0x51')](config[_0xd15a('0x52')],_0xd15a('0x53'),'views',_0xd15a('0x77')),{'interaction':_0x5dffbf})[_0xd15a('0x16')](function(_0x49a443){var _0x2151a6=path[_0xd15a('0x51')](_0x180d25,_0xd15a('0x78')+_0x23b965['id']+'-'+_0x30cba9+_0xd15a('0x79'));var _0x3d8962={'path':_0x2151a6,'channel':_0xd15a('0x67'),'interactionId':_0x23b965['id']};return pdf['createPdfFromHTML'](_0x49a443,_0x3d8962);})['then'](function(){return new BPromise(function(_0x2ea226,_0x41862d){zipdir(_0x180d25,{'saveTo':_0x280d9c},function(_0x27d76b,_0x4ba895){if(_0x27d76b)return _0x41862d(_0x27d76b);return _0x2ea226(_0x4ba895);});})[_0xd15a('0x16')](function(){return new BPromise(function(_0x17da32,_0x43adb7){rimraf(_0x180d25,function(_0x3fc931){if(_0x3fc931)_0x43adb7(_0x3fc931);return _0x17da32();});});})[_0xd15a('0x16')](function(){return _0x13a8d2[_0xd15a('0x4f')](_0x280d9c,_0x2a661c,function(_0x2da8c3){if(_0x2da8c3){console[_0xd15a('0x7a')]('err',_0x2da8c3);}else{fs[_0xd15a('0x7b')](_0x280d9c);}});});});}else{return _0x13a8d2[_0xd15a('0xf')](0xc8);}})[_0xd15a('0x32')](handleError(_0x13a8d2,null));};
\ No newline at end of file
+var _0x7a27=['ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','offset','count','set','update','then','destroy','end','error','stack','name','index','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','query','show','params','model','keys','intersection','attributes','length','include','merge','options','create','body','find','catch','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','filters','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','setTags','spread','Tag','color','download','unix','toString','join','root','server','files','tmp','attachments','push','User','CmContact','Contact','Attachment','Messages','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','createdAt','closed','closedAt','map','basename','createReadStream','pipe','out','fullname','lastName','direction','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a27,0x172));var _0x77a2=function(_0x45a54c,_0x322290){_0x45a54c=_0x45a54c-0x0;var _0x2987de=_0x7a27[_0x45a54c];return _0x2987de;};'use strict';var rimraf=require(_0x77a2('0x0'));var zipdir=require(_0x77a2('0x1'));var moment=require(_0x77a2('0x2'));var BPromise=require(_0x77a2('0x3'));var util=require('util');var path=require(_0x77a2('0x4'));var ejs=require(_0x77a2('0x5'));var fs=require('fs');var _=require(_0x77a2('0x6'));var Redis=require(_0x77a2('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x77a2('0x8'));var pdf=require(_0x77a2('0x9'));var logger=require(_0x77a2('0xa'))(_0x77a2('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x77a2('0xc')](config[_0x77a2('0xd')],{'host':_0x77a2('0xe'),'port':0x18eb});var socket=require(_0x77a2('0xf'))(new Redis(config[_0x77a2('0xd')]));require('./whatsappInteraction.socket')[_0x77a2('0x10')](socket);function respondWithStatusCode(_0x4b766e,_0x4f6950){_0x4f6950=_0x4f6950||0xcc;return function(_0x517b28){if(_0x517b28){return _0x4b766e[_0x77a2('0x11')](_0x4f6950);}return _0x4b766e['status'](_0x4f6950)['end']();};}function respondWithResult(_0x1d1c41,_0x9d2713){_0x9d2713=_0x9d2713||0xc8;return function(_0xef9396){if(_0xef9396){return _0x1d1c41[_0x77a2('0x12')](_0x9d2713)[_0x77a2('0x13')](_0xef9396);}};}function respondWithFilteredResult(_0x414aa6,_0x497dd3){return function(_0x1a51f2){if(_0x1a51f2){var _0x133f98=typeof _0x497dd3['offset']===_0x77a2('0x14')&&typeof _0x497dd3['limit']===_0x77a2('0x14');var _0x154e25=_0x1a51f2['count'];var _0xbc9d03=_0x133f98?0x0:_0x497dd3[_0x77a2('0x15')];var _0x495560=_0x133f98?_0x1a51f2[_0x77a2('0x16')]:_0x497dd3[_0x77a2('0x15')]+_0x497dd3['limit'];var _0x29b568;if(_0x495560>=_0x154e25){_0x495560=_0x154e25;_0x29b568=0xc8;}else{_0x29b568=0xce;}_0x414aa6[_0x77a2('0x12')](_0x29b568);return _0x414aa6[_0x77a2('0x17')]('Content-Range',_0xbc9d03+'-'+_0x495560+'/'+_0x154e25)[_0x77a2('0x13')](_0x1a51f2);}return null;};}function saveUpdates(_0x76196d){return function(_0x390b91){if(_0x390b91){return _0x390b91[_0x77a2('0x18')](_0x76196d)[_0x77a2('0x19')](function(_0x37b6a8){return _0x37b6a8;});}return null;};}function removeEntity(_0x27e93a){return function(_0x37f6af){if(_0x37f6af){return _0x37f6af[_0x77a2('0x1a')]()[_0x77a2('0x19')](function(){_0x27e93a['status'](0xcc)[_0x77a2('0x1b')]();});}};}function handleEntityNotFound(_0x655995){return function(_0x5cb26b){if(!_0x5cb26b){_0x655995[_0x77a2('0x11')](0x194);}return _0x5cb26b;};}function handleError(_0x2f671c,_0x5c3e1b){_0x5c3e1b=_0x5c3e1b||0x1f4;return function(_0x3a05b0){logger[_0x77a2('0x1c')](_0x3a05b0[_0x77a2('0x1d')]);if(_0x3a05b0[_0x77a2('0x1e')]){delete _0x3a05b0[_0x77a2('0x1e')];}_0x2f671c[_0x77a2('0x12')](_0x5c3e1b)['send'](_0x3a05b0);};}exports[_0x77a2('0x1f')]=function(_0x1b4c14,_0x33e386){var _0x480c9b={};var _0x1171e7=_['map'](db[_0x77a2('0x20')][_0x77a2('0x21')],function(_0x24dc45){return{'name':_0x24dc45[_0x77a2('0x22')],'type':_0x24dc45[_0x77a2('0x23')]['key']};});_0x480c9b=qs[_0x77a2('0x24')](_0x1171e7,_0x1b4c14);return interaction[_0x77a2('0x25')]('whatsapp',_0x1b4c14[_0x77a2('0x26')],_0x1b4c14['user'],_0x480c9b,_0x1171e7)['then'](respondWithFilteredResult(_0x33e386,_0x480c9b))['catch'](handleError(_0x33e386,null));};exports[_0x77a2('0x27')]=function(_0x49b1a6,_0x5b978a){var _0x105158={'raw':![],'where':{'id':_0x49b1a6[_0x77a2('0x28')]['id']}},_0x575c9b={};_0x575c9b[_0x77a2('0x29')]=_['keys'](db[_0x77a2('0x20')][_0x77a2('0x21')]);_0x575c9b[_0x77a2('0x26')]=_[_0x77a2('0x2a')](_0x49b1a6[_0x77a2('0x26')]);_0x575c9b['filters']=_[_0x77a2('0x2b')](_0x575c9b[_0x77a2('0x29')],_0x575c9b[_0x77a2('0x26')]);_0x105158[_0x77a2('0x2c')]=_['intersection'](_0x575c9b[_0x77a2('0x29')],qs['fields'](_0x49b1a6[_0x77a2('0x26')]['fields']));_0x105158[_0x77a2('0x2c')]=_0x105158[_0x77a2('0x2c')][_0x77a2('0x2d')]?_0x105158[_0x77a2('0x2c')]:_0x575c9b[_0x77a2('0x29')];if(_0x49b1a6['query']['includeAll']){_0x105158[_0x77a2('0x2e')]=[{'all':!![]}];}_0x105158=_[_0x77a2('0x2f')]({},_0x105158,_0x49b1a6[_0x77a2('0x30')]);return db['WhatsappInteraction']['find'](_0x105158)['then'](handleEntityNotFound(_0x5b978a,null))[_0x77a2('0x19')](respondWithResult(_0x5b978a,null))['catch'](handleError(_0x5b978a,null));};exports[_0x77a2('0x31')]=function(_0x5305d8,_0x5783e6){return db[_0x77a2('0x20')][_0x77a2('0x31')](_0x5305d8[_0x77a2('0x32')],{})[_0x77a2('0x19')](respondWithResult(_0x5783e6,0xc9))['catch'](handleError(_0x5783e6,null));};exports[_0x77a2('0x18')]=function(_0x346f86,_0x37bf75){if(_0x346f86[_0x77a2('0x32')]['id']){delete _0x346f86[_0x77a2('0x32')]['id'];}return db[_0x77a2('0x20')][_0x77a2('0x33')]({'where':{'id':_0x346f86['params']['id']}})['then'](handleEntityNotFound(_0x37bf75,null))[_0x77a2('0x19')](saveUpdates(_0x346f86[_0x77a2('0x32')],null))[_0x77a2('0x19')](respondWithResult(_0x37bf75,null))['catch'](handleError(_0x37bf75,null));};exports['destroy']=function(_0x528037,_0x2fafce){return db[_0x77a2('0x20')][_0x77a2('0x33')]({'where':{'id':_0x528037[_0x77a2('0x28')]['id']}})[_0x77a2('0x19')](handleEntityNotFound(_0x2fafce,null))['then'](removeEntity(_0x2fafce,null))[_0x77a2('0x34')](handleError(_0x2fafce,null));};exports['describe']=function(_0x44bc4a,_0x39ab2d){return db[_0x77a2('0x20')][_0x77a2('0x35')]()['then'](respondWithResult(_0x39ab2d,null))['catch'](handleError(_0x39ab2d,null));};exports[_0x77a2('0x36')]=function(_0xdf4627,_0x563ae6){return db[_0x77a2('0x37')]['find']({'where':{'id':_0xdf4627[_0x77a2('0x28')]['id']}})['then'](handleEntityNotFound(_0x563ae6,null))[_0x77a2('0x19')](function(_0x28b755){if(_0x28b755){return _0x28b755[_0x77a2('0x36')](_0xdf4627[_0x77a2('0x32')][_0x77a2('0x38')],_[_0x77a2('0x39')](_0xdf4627[_0x77a2('0x32')],['ids','id'])||{});}})['then'](respondWithResult(_0x563ae6,null))[_0x77a2('0x34')](handleError(_0x563ae6,null));};exports[_0x77a2('0x3a')]=function(_0x14f8c7,_0x1dc71c){var _0x461a62={'raw':![],'where':{}};var _0x470fe3={};var _0x7a4c94={'count':0x0,'rows':[]};return db[_0x77a2('0x20')][_0x77a2('0x3b')]({'where':{'id':_0x14f8c7['params']['id']}})[_0x77a2('0x19')](handleEntityNotFound(_0x1dc71c,null))['then'](function(_0x4ba5fa){if(_0x4ba5fa){_0x470fe3[_0x77a2('0x29')]=_[_0x77a2('0x2a')](db[_0x77a2('0x37')][_0x77a2('0x21')]);_0x470fe3[_0x77a2('0x26')]=_[_0x77a2('0x2a')](_0x14f8c7[_0x77a2('0x26')]);_0x470fe3[_0x77a2('0x3c')]=_['intersection'](_0x470fe3[_0x77a2('0x29')],_0x470fe3[_0x77a2('0x26')]);_0x461a62[_0x77a2('0x2c')]=_['intersection'](_0x470fe3[_0x77a2('0x29')],qs['fields'](_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x3d')]));_0x461a62[_0x77a2('0x2c')]=_0x461a62['attributes'][_0x77a2('0x2d')]?_0x461a62[_0x77a2('0x2c')]:_0x470fe3[_0x77a2('0x29')];if(!_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x3e')](_0x77a2('0x3f'))){_0x461a62[_0x77a2('0x40')]=qs['limit'](_0x14f8c7[_0x77a2('0x26')]['limit']);_0x461a62[_0x77a2('0x15')]=qs[_0x77a2('0x15')](_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x15')]);}_0x461a62[_0x77a2('0x41')]=qs[_0x77a2('0x42')](_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x42')]);_0x461a62[_0x77a2('0x43')]=qs[_0x77a2('0x3c')](_[_0x77a2('0x44')](_0x14f8c7[_0x77a2('0x26')],_0x470fe3['filters']));_0x461a62['where'][_0x77a2('0x45')]=_0x4ba5fa['id'];if(_0x14f8c7['query'][_0x77a2('0x46')]){_0x461a62['where']=_[_0x77a2('0x2f')](_0x461a62[_0x77a2('0x43')],{'$or':_['map'](_0x461a62[_0x77a2('0x2c')],function(_0xafb4e8){var _0x665f3={};_0x665f3[_0xafb4e8]={'$like':'%'+_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x46')]+'%'};return _0x665f3;})});}if(_0x14f8c7['query'][_0x77a2('0x47')]){var _0x4b9c41=_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x47')][_0x77a2('0x48')](',');var _0x2f3c55={};_0x2f3c55[_0x4b9c41[0x0]]={'$gte':moment(_0x4b9c41[0x1])[_0x77a2('0x49')](_0x77a2('0x4a'))};_0x461a62[_0x77a2('0x43')]=_[_0x77a2('0x2f')](_0x461a62[_0x77a2('0x43')],_0x2f3c55);}_0x461a62=_[_0x77a2('0x2f')]({},_0x461a62,_0x14f8c7[_0x77a2('0x30')]);return db[_0x77a2('0x37')]['count']({'where':_0x461a62[_0x77a2('0x43')]})[_0x77a2('0x19')](function(_0x30f8af){_0x7a4c94[_0x77a2('0x16')]=_0x30f8af;if(_0x14f8c7[_0x77a2('0x26')][_0x77a2('0x4b')]){_0x461a62[_0x77a2('0x2e')]=[{'all':!![]}];}return db[_0x77a2('0x37')][_0x77a2('0x25')](_0x461a62);})['then'](function(_0x1459da){_0x7a4c94[_0x77a2('0x4c')]=_0x1459da;return _0x7a4c94;});}})['then'](respondWithFilteredResult(_0x1dc71c,_0x461a62))[_0x77a2('0x34')](handleError(_0x1dc71c,null));};exports['addTags']=function(_0x46df6e,_0x38201a){return db[_0x77a2('0x20')]['find']({'where':{'id':_0x46df6e[_0x77a2('0x28')]['id']}})[_0x77a2('0x19')](handleEntityNotFound(_0x38201a,null))[_0x77a2('0x19')](function(_0x24074f){if(_0x24074f){return _0x24074f[_0x77a2('0x4d')](_0x46df6e[_0x77a2('0x32')]['ids'],_['omit'](_0x46df6e[_0x77a2('0x32')],[_0x77a2('0x38'),'id'])||{})[_0x77a2('0x4e')](function(){return db[_0x77a2('0x4f')]['findAll']({'attributes':['id',_0x77a2('0x1e'),_0x77a2('0x50')],'where':{'id':_0x46df6e[_0x77a2('0x32')][_0x77a2('0x38')]}});})['then'](function(_0x1b7b21){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x46df6e[_0x77a2('0x28')]['id']),'tags':_0x1b7b21||[]});return{'id':Number(_0x46df6e[_0x77a2('0x28')]['id']),'tags':_0x1b7b21||[]};});}})[_0x77a2('0x19')](respondWithResult(_0x38201a,null))[_0x77a2('0x34')](handleError(_0x38201a,null));};exports['removeTags']=function(_0x6b6ae7,_0x57a183){return db[_0x77a2('0x20')][_0x77a2('0x33')]({'where':{'id':_0x6b6ae7['params']['id']}})[_0x77a2('0x19')](handleEntityNotFound(_0x57a183,null))[_0x77a2('0x19')](function(_0x4992f4){if(_0x4992f4){return _0x4992f4['removeTags'](_0x6b6ae7[_0x77a2('0x26')][_0x77a2('0x38')]);}})[_0x77a2('0x19')](respondWithStatusCode(_0x57a183,null))[_0x77a2('0x34')](handleError(_0x57a183,null));};exports[_0x77a2('0x51')]=function(_0x552856,_0x1c3790){var _0x1c4a13=moment()[_0x77a2('0x52')]()[_0x77a2('0x53')]();var _0x292584=path[_0x77a2('0x54')](config[_0x77a2('0x55')],_0x77a2('0x56'),_0x77a2('0x57'),_0x77a2('0x58'));var _0x417988=path[_0x77a2('0x54')](config[_0x77a2('0x55')],_0x77a2('0x56'),_0x77a2('0x57'),_0x77a2('0x59'));var _0x13c54e=path['join'](_0x292584,_0x1c4a13);var _0x255ce5=util[_0x77a2('0x49')]('transcript-%d-%s.zip',_0x552856[_0x77a2('0x28')]['id'],_0x1c4a13);var _0x40e4dc=path[_0x77a2('0x54')](_0x292584,_0x255ce5);var _0x216a8f=[];_0x216a8f[_0x77a2('0x5a')]({'model':db[_0x77a2('0x5b')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x216a8f['push']({'model':db[_0x77a2('0x5c')],'as':_0x77a2('0x5d'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x552856[_0x77a2('0x26')][_0x77a2('0x59')]){_0x216a8f[_0x77a2('0x5a')]({'model':db[_0x77a2('0x5e')],'as':'Attachment','raw':!![]});}var _0x3b8ab3=[{'model':db['WhatsappMessage'],'as':_0x77a2('0x5f'),'attributes':['id',_0x77a2('0x32'),'createdAt','direction',_0x77a2('0x60'),'read'],'include':_0x216a8f}];_0x3b8ab3[_0x77a2('0x5a')]({'model':db[_0x77a2('0x61')],'as':'Account','attributes':['id',_0x77a2('0x1e')]});_0x3b8ab3[_0x77a2('0x5a')]({'model':db[_0x77a2('0x5b')],'as':_0x77a2('0x62'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x77a2('0x33')]({'where':{'id':_0x552856[_0x77a2('0x28')]['id']},'include':_0x3b8ab3})[_0x77a2('0x19')](handleEntityNotFound(_0x1c3790,null))[_0x77a2('0x19')](function(_0x4b71f1){if(_0x4b71f1){var _0x410897=_0x4b71f1[_0x77a2('0x63')]({'plain':!![]});fs[_0x77a2('0x64')](_0x13c54e);var _0x1c9332={'channel':_0x77a2('0x65'),'account':_0x410897[_0x77a2('0x66')][_0x77a2('0x1e')],'agent':_0x410897['Owner']?_0x410897[_0x77a2('0x62')]['fullname']:_0x77a2('0x67'),'createdAt':moment(_0x410897[_0x77a2('0x68')])[_0x77a2('0x49')](_0x77a2('0x4a'))[_0x77a2('0x53')](),'closedAt':_0x410897[_0x77a2('0x69')]?moment(_0x410897[_0x77a2('0x6a')])[_0x77a2('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x77a2('0x53')]():'','disposition':_0x410897['disposition'],'messages':_(_0x410897[_0x77a2('0x5f')])[_0x77a2('0x46')]({'secret':![]})[_0x77a2('0x6b')](function(_0x562776){if(_0x562776[_0x77a2('0x5e')]){var _0x38439f=path[_0x77a2('0x54')](_0x417988,_0x562776[_0x77a2('0x5e')][_0x77a2('0x6c')]);if(fs['existsSync'](_0x38439f)){fs[_0x77a2('0x6d')](_0x38439f)[_0x77a2('0x6e')](fs['createWriteStream'](path[_0x77a2('0x54')](_0x13c54e,_0x562776[_0x77a2('0x5e')]['basename'])));}}return{'date':moment(_0x562776[_0x77a2('0x68')])[_0x77a2('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x77a2('0x53')](),'sender':_0x562776['direction']===_0x77a2('0x6f')?_0x562776[_0x77a2('0x5b')]?_0x562776[_0x77a2('0x5b')][_0x77a2('0x70')]:'System':_0x562776[_0x77a2('0x5d')]['firstName']+(_0x562776[_0x77a2('0x5d')][_0x77a2('0x71')]?'\x20'+_0x562776[_0x77a2('0x5d')][_0x77a2('0x71')]:''),'body':_0x562776[_0x77a2('0x5e')]?_0x562776[_0x77a2('0x5e')][_0x77a2('0x6c')]:_0x562776[_0x77a2('0x32')],'direction':_0x562776[_0x77a2('0x72')]===_0x77a2('0x6f')?'A':'C','secret':_0x562776[_0x77a2('0x60')],'read':_0x562776[_0x77a2('0x73')],'attachment':_0x562776[_0x77a2('0x5e')]};})[_0x77a2('0x74')]()};return ejs[_0x77a2('0x75')](path['join'](config[_0x77a2('0x55')],_0x77a2('0x56'),_0x77a2('0x76'),_0x77a2('0x77')),{'interaction':_0x1c9332})[_0x77a2('0x19')](function(_0x510ed7){var _0x5cf5d1=path[_0x77a2('0x54')](_0x13c54e,_0x77a2('0x78')+_0x410897['id']+'-'+_0x1c4a13+_0x77a2('0x79'));var _0x3b0a69={'path':_0x5cf5d1,'channel':_0x77a2('0x65'),'interactionId':_0x410897['id']};return pdf[_0x77a2('0x7a')](_0x510ed7,_0x3b0a69);})['then'](function(){return new BPromise(function(_0x54b19d,_0x1a8802){zipdir(_0x13c54e,{'saveTo':_0x40e4dc},function(_0xe7d36c,_0x45fdbe){if(_0xe7d36c)return _0x1a8802(_0xe7d36c);return _0x54b19d(_0x45fdbe);});})['then'](function(){return new BPromise(function(_0x2f4236,_0x2fad0b){rimraf(_0x13c54e,function(_0x2c75dd){if(_0x2c75dd)_0x2fad0b(_0x2c75dd);return _0x2f4236();});});})[_0x77a2('0x19')](function(){return _0x1c3790[_0x77a2('0x51')](_0x40e4dc,_0x255ce5,function(_0x363d0b){if(_0x363d0b){console[_0x77a2('0x7b')](_0x77a2('0x7c'),_0x363d0b);}else{fs['unlinkSync'](_0x40e4dc);}});});});}else{return _0x1c3790['sendStatus'](0xc8);}})['catch'](handleError(_0x1c3790,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9090=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','getUsers','then'];(function(_0x235440,_0x506074){var _0x44c709=function(_0x4b04d8){while(--_0x4b04d8){_0x235440['push'](_0x235440['shift']());}};_0x44c709(++_0x506074);}(_0x9090,0x17f));var _0x0909=function(_0x4d0680,_0x4ce218){_0x4d0680=_0x4d0680-0x0;var _0x125442=_0x9090[_0x4d0680];return _0x125442;};'use strict';var EventEmitter=require(_0x0909('0x0'));var WhatsappInteraction=require(_0x0909('0x1'))['db'][_0x0909('0x2')];var WhatsappMessage=require(_0x0909('0x1'))['db'][_0x0909('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0909('0x4'),'afterDestroy':_0x0909('0x5')};function emitEvent(_0x29bc19){return function(_0x572e6e,_0x1a5cff,_0x42af40){_0x572e6e[_0x0909('0x6')]({'attributes':['id'],'raw':!![]})[_0x0909('0x7')](function(_0x26dfbe){_0x572e6e[_0x0909('0x8')](_0x0909('0x9'),_0x26dfbe['map'](function(_0x203b1b){return{'id':_0x203b1b['id']};}));return WhatsappMessage[_0x0909('0xa')]({'where':{'WhatsappInteractionId':_0x572e6e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3b86e7){_0x572e6e['setDataValue'](_0x0909('0xb'),_0x3b86e7[_0x0909('0xc')]);WhatsappInteractionEvents[_0x0909('0xd')](_0x29bc19+':'+_0x572e6e['id'],_0x572e6e);WhatsappInteractionEvents[_0x0909('0xd')](_0x29bc19,_0x572e6e);_0x42af40(null);})['catch'](_0x42af40(null));};}for(var e in events){if(events[_0x0909('0xe')](e)){var event=events[e];WhatsappInteraction[_0x0909('0xf')](e,emitEvent(event));}}module[_0x0909('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xfd3a=['../../mysqldb','WhatsappInteraction','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','length','catch','hasOwnProperty','events'];(function(_0x5a837b,_0x5128cf){var _0x1fb295=function(_0x967825){while(--_0x967825){_0x5a837b['push'](_0x5a837b['shift']());}};_0x1fb295(++_0x5128cf);}(_0xfd3a,0x179));var _0xafd3=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0xfd3a[_0x38854e];return _0x3f8415;};'use strict';var EventEmitter=require(_0xafd3('0x0'));var WhatsappInteraction=require(_0xafd3('0x1'))['db'][_0xafd3('0x2')];var WhatsappMessage=require(_0xafd3('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xafd3('0x3'),'afterUpdate':_0xafd3('0x4'),'afterDestroy':_0xafd3('0x5')};function emitEvent(_0x415217){return function(_0x960eb3,_0x567815,_0x9db715){_0x960eb3[_0xafd3('0x6')]({'attributes':['id'],'raw':!![]})[_0xafd3('0x7')](function(_0x3766aa){_0x960eb3[_0xafd3('0x8')]('Users',_0x3766aa['map'](function(_0x1e81b3){return{'id':_0x1e81b3['id']};}));return WhatsappMessage[_0xafd3('0x9')]({'where':{'WhatsappInteractionId':_0x960eb3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1e2d7c){_0x960eb3[_0xafd3('0x8')](_0xafd3('0xa'),_0x1e2d7c[_0xafd3('0xb')]);WhatsappInteractionEvents['emit'](_0x415217+':'+_0x960eb3['id'],_0x960eb3);WhatsappInteractionEvents['emit'](_0x415217,_0x960eb3);_0x9db715(null);})[_0xafd3('0xc')](_0x9db715(null));};}for(var e in events){if(events[_0xafd3('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfae=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xdfae,0x191));var _0xedfa=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0xdfae[_0x28b0a1];return _0x21470c;};'use strict';var _=require(_0xedfa('0x0'));var util=require(_0xedfa('0x1'));var logger=require(_0xedfa('0x2'))(_0xedfa('0x3'));var moment=require(_0xedfa('0x4'));var BPromise=require(_0xedfa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedfa('0x6'));var rimraf=require(_0xedfa('0x7'));var config=require('../../config/environment');var attributes=require(_0xedfa('0x8'));module[_0xedfa('0x9')]=function(_0x27090c,_0x52750d){return _0x27090c[_0xedfa('0xa')](_0xedfa('0xb'),attributes,{'tableName':_0xedfa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb4700,_0x49f7c1,_0x4f60e2){if(_0xb4700[_0xedfa('0xd')](_0xedfa('0xe'))){_0xb4700[_0xedfa('0xf')]=moment()[_0xedfa('0x10')](_0xedfa('0x11'));}_0x4f60e2(null,_0xb4700);}}});};
\ No newline at end of file
+var _0xc65a=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird'];(function(_0x426bf4,_0x268ee9){var _0x27aba8=function(_0x2ce9d1){while(--_0x2ce9d1){_0x426bf4['push'](_0x426bf4['shift']());}};_0x27aba8(++_0x268ee9);}(_0xc65a,0x1ca));var _0xac65=function(_0x48928a,_0x1af84d){_0x48928a=_0x48928a-0x0;var _0x4cff5e=_0xc65a[_0x48928a];return _0x4cff5e;};'use strict';var _=require(_0xac65('0x0'));var util=require(_0xac65('0x1'));var logger=require('../../config/logger')(_0xac65('0x2'));var moment=require('moment');var BPromise=require(_0xac65('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xac65('0x4'));var config=require(_0xac65('0x5'));var attributes=require(_0xac65('0x6'));module[_0xac65('0x7')]=function(_0x54f503,_0x507a62){return _0x54f503[_0xac65('0x8')](_0xac65('0x9'),attributes,{'tableName':_0xac65('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e557f,_0x53da14,_0x358567){if(_0x2e557f['changed']('closed')){_0x2e557f[_0xac65('0xb')]=moment()[_0xac65('0xc')](_0xac65('0xd'));}_0x358567(null,_0x2e557f);}}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e10=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','WhatsappInteraction','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','body','omit','ids','spread','AddTags'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7e10,0xdc));var _0x07e1=function(_0x1c7188,_0x16a7fb){_0x1c7188=_0x1c7188-0x0;var _0x50db34=_0x7e10[_0x1c7188];return _0x50db34;};'use strict';var _=require(_0x07e1('0x0'));var util=require('util');var moment=require(_0x07e1('0x1'));var BPromise=require(_0x07e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07e1('0x3'));var db=require(_0x07e1('0x4'))['db'];var utils=require(_0x07e1('0x5'));var logger=require(_0x07e1('0x6'))(_0x07e1('0x7'));var config=require(_0x07e1('0x8'));var jayson=require(_0x07e1('0x9'));var client=jayson[_0x07e1('0xa')][_0x07e1('0xb')]({'port':0x232a});config[_0x07e1('0xc')]=_[_0x07e1('0xd')](config[_0x07e1('0xc')],{'host':_0x07e1('0xe'),'port':0x18eb});var socket=require(_0x07e1('0xf'))(new Redis(config[_0x07e1('0xc')]));require('./whatsappInteraction.socket')[_0x07e1('0x10')](socket);function respondWithRpcPromise(_0x1bfb12,_0x488cb4,_0x401549){return new BPromise(function(_0x632bd1,_0x1c148d){return client[_0x07e1('0x11')](_0x1bfb12,_0x401549)[_0x07e1('0x12')](function(_0x5325b7){logger[_0x07e1('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x488cb4,_0x07e1('0x14'));logger[_0x07e1('0x15')](_0x07e1('0x16'),_0x488cb4,'request\x20sent',JSON[_0x07e1('0x17')](_0x5325b7));if(_0x5325b7[_0x07e1('0x18')]){if(_0x5325b7[_0x07e1('0x18')][_0x07e1('0x19')]===0x1f4){logger[_0x07e1('0x18')](_0x07e1('0x1a'),_0x488cb4,_0x5325b7[_0x07e1('0x18')][_0x07e1('0x1b')]);return _0x1c148d(_0x5325b7[_0x07e1('0x18')][_0x07e1('0x1b')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x488cb4,_0x5325b7['error'][_0x07e1('0x1b')]);return _0x632bd1(_0x5325b7[_0x07e1('0x18')][_0x07e1('0x1b')]);}else{logger['info'](_0x07e1('0x1a'),_0x488cb4,'request\x20sent');_0x632bd1(_0x5325b7[_0x07e1('0x1c')]['message']);}})['catch'](function(_0x2e6909){logger[_0x07e1('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x488cb4,_0x2e6909);_0x1c148d(_0x2e6909);});});}exports['UpdateWhatsappInteraction']=function(_0x4f476f){var _0x483085=this;return new Promise(function(_0x56d2da,_0x17ba65){return db[_0x07e1('0x1d')]['update'](_0x4f476f['body'],{'raw':_0x4f476f['options']?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f476f[_0x07e1('0x1e')]?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x20')]||null:null,'attributes':_0x4f476f[_0x07e1('0x1e')]?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x21')]||null:null,'limit':_0x4f476f[_0x07e1('0x1e')]?_0x4f476f[_0x07e1('0x1e')][_0x07e1('0x22')]||null:null})[_0x07e1('0x12')](function(_0x7e9b8b){logger[_0x07e1('0x13')]('UpdateWhatsappInteraction',_0x4f476f);logger[_0x07e1('0x15')]('UpdateWhatsappInteraction',_0x4f476f,JSON[_0x07e1('0x17')](_0x7e9b8b));_0x56d2da(_0x7e9b8b);})['catch'](function(_0x49e211){logger[_0x07e1('0x18')](_0x07e1('0x23'),_0x49e211[_0x07e1('0x1b')],_0x4f476f);_0x17ba65(_0x483085[_0x07e1('0x18')](0x1f4,_0x49e211[_0x07e1('0x1b')]));});});};exports[_0x07e1('0x24')]=function(_0x8c9a70){return new Promise(function(_0x1fca0d,_0x2af774){return db[_0x07e1('0x1d')][_0x07e1('0x25')]({'where':_0x8c9a70[_0x07e1('0x1e')]?_0x8c9a70['options'][_0x07e1('0x20')]||null:null})['then'](function(_0x115920){if(_0x115920){return _0x115920[_0x07e1('0x26')](_0x8c9a70[_0x07e1('0x27')]['ids'],_[_0x07e1('0x28')](_0x8c9a70['body'],[_0x07e1('0x29'),'id'])||{});}})[_0x07e1('0x2a')](function(_0x3988ae){logger[_0x07e1('0x13')](_0x07e1('0x2b'),_0x8c9a70);logger[_0x07e1('0x15')](_0x07e1('0x2b'),_0x8c9a70,JSON[_0x07e1('0x17')](_0x3988ae));_0x1fca0d(_0x3988ae);})['catch'](function(_0x518c5d){logger[_0x07e1('0x18')]('AddTags',_0x518c5d[_0x07e1('0x1b')],_0x8c9a70);_0x2af774(_this[_0x07e1('0x18')](0x1f4,_0x518c5d[_0x07e1('0x1b')]));});});};
\ No newline at end of file
+var _0x6b4b=['update','options','raw','where','attributes','limit','UpdateWhatsappInteraction','catch','AddTagsToWhatsappInteraction','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappInteraction'];(function(_0x5065fd,_0x2f54b7){var _0x2ba821=function(_0x14754b){while(--_0x14754b){_0x5065fd['push'](_0x5065fd['shift']());}};_0x2ba821(++_0x2f54b7);}(_0x6b4b,0x165));var _0xb6b4=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x6b4b[_0x17928f];return _0x500b63;};'use strict';var _=require('lodash');var util=require(_0xb6b4('0x0'));var moment=require('moment');var BPromise=require(_0xb6b4('0x1'));var rs=require(_0xb6b4('0x2'));var fs=require('fs');var Redis=require(_0xb6b4('0x3'));var db=require(_0xb6b4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6b4('0x5'))(_0xb6b4('0x6'));var config=require(_0xb6b4('0x7'));var jayson=require(_0xb6b4('0x8'));var client=jayson[_0xb6b4('0x9')][_0xb6b4('0xa')]({'port':0x232a});config[_0xb6b4('0xb')]=_[_0xb6b4('0xc')](config[_0xb6b4('0xb')],{'host':_0xb6b4('0xd'),'port':0x18eb});var socket=require(_0xb6b4('0xe'))(new Redis(config[_0xb6b4('0xb')]));require(_0xb6b4('0xf'))[_0xb6b4('0x10')](socket);function respondWithRpcPromise(_0x6e77a6,_0xa799e1,_0x47c9eb){return new BPromise(function(_0x62b055,_0x41084f){return client[_0xb6b4('0x11')](_0x6e77a6,_0x47c9eb)[_0xb6b4('0x12')](function(_0x4356f8){logger[_0xb6b4('0x13')](_0xb6b4('0x14'),_0xa799e1,_0xb6b4('0x15'));logger[_0xb6b4('0x16')](_0xb6b4('0x17'),_0xa799e1,_0xb6b4('0x15'),JSON[_0xb6b4('0x18')](_0x4356f8));if(_0x4356f8[_0xb6b4('0x19')]){if(_0x4356f8['error'][_0xb6b4('0x1a')]===0x1f4){logger['error'](_0xb6b4('0x14'),_0xa799e1,_0x4356f8['error'][_0xb6b4('0x1b')]);return _0x41084f(_0x4356f8['error'][_0xb6b4('0x1b')]);}logger[_0xb6b4('0x19')](_0xb6b4('0x14'),_0xa799e1,_0x4356f8['error'][_0xb6b4('0x1b')]);return _0x62b055(_0x4356f8['error']['message']);}else{logger[_0xb6b4('0x13')](_0xb6b4('0x14'),_0xa799e1,_0xb6b4('0x15'));_0x62b055(_0x4356f8[_0xb6b4('0x1c')]['message']);}})['catch'](function(_0xa9908f){logger[_0xb6b4('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0xa799e1,_0xa9908f);_0x41084f(_0xa9908f);});});}exports['UpdateWhatsappInteraction']=function(_0x134020){var _0xa1bd2d=this;return new Promise(function(_0x59dd55,_0x51749b){return db[_0xb6b4('0x1d')][_0xb6b4('0x1e')](_0x134020['body'],{'raw':_0x134020[_0xb6b4('0x1f')]?_0x134020[_0xb6b4('0x1f')][_0xb6b4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134020['options']?_0x134020[_0xb6b4('0x1f')][_0xb6b4('0x21')]||null:null,'attributes':_0x134020[_0xb6b4('0x1f')]?_0x134020['options'][_0xb6b4('0x22')]||null:null,'limit':_0x134020[_0xb6b4('0x1f')]?_0x134020[_0xb6b4('0x1f')][_0xb6b4('0x23')]||null:null})['then'](function(_0x3dec1d){logger[_0xb6b4('0x13')](_0xb6b4('0x24'),_0x134020);logger['debug'](_0xb6b4('0x24'),_0x134020,JSON[_0xb6b4('0x18')](_0x3dec1d));_0x59dd55(_0x3dec1d);})[_0xb6b4('0x25')](function(_0x24ca72){logger[_0xb6b4('0x19')](_0xb6b4('0x24'),_0x24ca72['message'],_0x134020);_0x51749b(_0xa1bd2d[_0xb6b4('0x19')](0x1f4,_0x24ca72[_0xb6b4('0x1b')]));});});};exports[_0xb6b4('0x26')]=function(_0xf8d41f){return new Promise(function(_0x178a06,_0x4ec0fa){return db[_0xb6b4('0x1d')]['find']({'where':_0xf8d41f[_0xb6b4('0x1f')]?_0xf8d41f[_0xb6b4('0x1f')]['where']||null:null})['then'](function(_0x23d7f5){if(_0x23d7f5){return _0x23d7f5[_0xb6b4('0x27')](_0xf8d41f['body'][_0xb6b4('0x28')],_['omit'](_0xf8d41f['body'],[_0xb6b4('0x28'),'id'])||{});}})[_0xb6b4('0x29')](function(_0x78d6a1){logger[_0xb6b4('0x13')](_0xb6b4('0x2a'),_0xf8d41f);logger[_0xb6b4('0x16')](_0xb6b4('0x2a'),_0xf8d41f,JSON['stringify'](_0x78d6a1));_0x178a06(_0x78d6a1);})[_0xb6b4('0x25')](function(_0x3f99f){logger[_0xb6b4('0x19')](_0xb6b4('0x2a'),_0x3f99f[_0xb6b4('0x1b')],_0xf8d41f);_0x4ec0fa(_this['error'](0x1f4,_0x3f99f['message']));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd58=['emit','register','length','whatsappInteraction:','update'];(function(_0x2bdf04,_0x5e608e){var _0x33ce04=function(_0x357c41){while(--_0x357c41){_0x2bdf04['push'](_0x2bdf04['shift']());}};_0x33ce04(++_0x5e608e);}(_0xcd58,0x15d));var _0x8cd5=function(_0x440f7a,_0x4368eb){_0x440f7a=_0x440f7a-0x0;var _0x5325e1=_0xcd58[_0x440f7a];return _0x5325e1;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0x8cd5('0x0')];function createListener(_0x4441f4,_0x5720c6){return function(_0x4f28e4){_0x5720c6[_0x8cd5('0x1')](_0x4441f4,_0x4f28e4);};}function removeListener(_0x1186b2,_0x3551d7){return function(){WhatsappInteractionEvents['removeListener'](_0x1186b2,_0x3551d7);};}exports[_0x8cd5('0x2')]=function(_0x46e05b){for(var _0x2abe4f=0x0,_0x5b02c9=events[_0x8cd5('0x3')];_0x2abe4f<_0x5b02c9;_0x2abe4f++){var _0x97be8f=events[_0x2abe4f];var _0x3c309b=createListener(_0x8cd5('0x4')+_0x97be8f,_0x46e05b);WhatsappInteractionEvents['on'](_0x97be8f,_0x3c309b);}};
\ No newline at end of file
+var _0x5103=['save','remove','update','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x5103,0x7f));var _0x3510=function(_0x4687b8,_0x4160db){_0x4687b8=_0x4687b8-0x0;var _0x29eb47=_0x5103[_0x4687b8];return _0x29eb47;};'use strict';var WhatsappInteractionEvents=require(_0x3510('0x0'));var events=[_0x3510('0x1'),_0x3510('0x2'),_0x3510('0x3')];function createListener(_0x4ce05c,_0x25aee3){return function(_0x4d17a8){_0x25aee3[_0x3510('0x4')](_0x4ce05c,_0x4d17a8);};}function removeListener(_0x2eb56b,_0x4d12c9){return function(){WhatsappInteractionEvents[_0x3510('0x5')](_0x2eb56b,_0x4d12c9);};}exports['register']=function(_0x205cac){for(var _0x22f5b8=0x0,_0x53989d=events[_0x3510('0x6')];_0x22f5b8<_0x53989d;_0x22f5b8++){var _0x8def93=events[_0x22f5b8];var _0x45e28c=createListener(_0x3510('0x7')+_0x8def93,_0x205cac);WhatsappInteractionEvents['on'](_0x8def93,_0x45e28c);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49cd=['show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/:id'];(function(_0x2d1405,_0xb72e8){var _0x36d2e7=function(_0x11a039){while(--_0x11a039){_0x2d1405['push'](_0x2d1405['shift']());}};_0x36d2e7(++_0xb72e8);}(_0x49cd,0xe5));var _0xd49c=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0x49cd[_0x296144];return _0x5329b1;};'use strict';var multer=require(_0xd49c('0x0'));var util=require(_0xd49c('0x1'));var path=require('path');var timeout=require(_0xd49c('0x2'));var express=require(_0xd49c('0x3'));var router=express[_0xd49c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd49c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd49c('0x6'));var controller=require(_0xd49c('0x7'));router[_0xd49c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd49c('0x8')]('/describe',auth[_0xd49c('0x9')](),controller['describe']);router['get'](_0xd49c('0xa'),auth[_0xd49c('0x9')](),controller[_0xd49c('0xb')]);router[_0xd49c('0xc')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xd49c('0xd'),_0xd49c('0xe')),controller[_0xd49c('0xf')]);router[_0xd49c('0xc')](_0xd49c('0x10'),controller[_0xd49c('0x11')]);router[_0xd49c('0x12')](_0xd49c('0xa'),auth[_0xd49c('0x9')](),controller[_0xd49c('0x13')]);router['put']('/:id/accept',auth[_0xd49c('0x9')](),controller[_0xd49c('0x14')]);router[_0xd49c('0x12')](_0xd49c('0x15'),auth[_0xd49c('0x9')](),controller['reject']);router[_0xd49c('0x16')](_0xd49c('0xa'),auth[_0xd49c('0x9')](),controller[_0xd49c('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x44f8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','describe','show','post','whatsappmessage:create','create','/:id/status','put','/:id','/:id/accept','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5ea22f,_0x128142){var _0x4d878c=function(_0x334e3c){while(--_0x334e3c){_0x5ea22f['push'](_0x5ea22f['shift']());}};_0x4d878c(++_0x128142);}(_0x44f8,0x10e));var _0x844f=function(_0x553a7c,_0x1ae4ea){_0x553a7c=_0x553a7c-0x0;var _0x5345da=_0x44f8[_0x553a7c];return _0x5345da;};'use strict';var multer=require(_0x844f('0x0'));var util=require('util');var path=require(_0x844f('0x1'));var timeout=require(_0x844f('0x2'));var express=require(_0x844f('0x3'));var router=express[_0x844f('0x4')]();var fs_extra=require(_0x844f('0x5'));var auth=require(_0x844f('0x6'));var interaction=require(_0x844f('0x7'));var config=require(_0x844f('0x8'));var controller=require(_0x844f('0x9'));router['get']('/',auth[_0x844f('0xa')](),controller[_0x844f('0xb')]);router[_0x844f('0xc')]('/describe',auth[_0x844f('0xa')](),controller[_0x844f('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x844f('0xe')]);router[_0x844f('0xf')]('/',auth[_0x844f('0xa')](),interaction['tracked']('whatsapp',_0x844f('0x10')),controller[_0x844f('0x11')]);router[_0x844f('0xf')](_0x844f('0x12'),controller['status']);router[_0x844f('0x13')](_0x844f('0x14'),auth['isAuthenticated'](),controller['update']);router['put'](_0x844f('0x15'),auth[_0x844f('0xa')](),controller['accept']);router[_0x844f('0x13')]('/:id/reject',auth[_0x844f('0xa')](),controller['reject']);router[_0x844f('0x16')]('/:id',auth[_0x844f('0xa')](),controller[_0x844f('0x17')]);module[_0x844f('0x18')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5ad=['STRING','DATE','exports','TEXT','ENUM','out'];(function(_0x572ffa,_0x33b7fa){var _0x36c8e5=function(_0x420ab0){while(--_0x420ab0){_0x572ffa['push'](_0x572ffa['shift']());}};_0x36c8e5(++_0x33b7fa);}(_0xe5ad,0x158));var _0xde5a=function(_0x118ded,_0x44f172){_0x118ded=_0x118ded-0x0;var _0x59ee8e=_0xe5ad[_0x118ded];return _0x59ee8e;};'use strict';var Sequelize=require('sequelize');module[_0xde5a('0x0')]={'body':{'type':Sequelize[_0xde5a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xde5a('0x2')]('in',_0xde5a('0x3')),'defaultValue':_0xde5a('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xde5a('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xde5a('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x63b0=['STRING','DATE','TEXT','medium','out'];(function(_0x1631ef,_0x50c20a){var _0x3e812f=function(_0x5eb683){while(--_0x5eb683){_0x1631ef['push'](_0x1631ef['shift']());}};_0x3e812f(++_0x50c20a);}(_0x63b0,0x192));var _0x063b=function(_0x16c488,_0x49eb4b){_0x16c488=_0x16c488-0x0;var _0x293b59=_0x63b0[_0x16c488];return _0x293b59;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x063b('0x0')](_0x063b('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x063b('0x2')),'defaultValue':_0x063b('0x2'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x063b('0x3')]},'readAt':{'type':Sequelize[_0x063b('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x063b('0x0')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c2e=['UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','fullname','SIP/%s','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','end','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c2e,0xbc));var _0xe0c2=function(_0x386f38,_0x26d8ec){_0x386f38=_0x386f38-0x0;var _0x38e927=_0x0c2e[_0x386f38];return _0x38e927;};'use strict';var emlformat=require(_0xe0c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0c2('0x1'));var jsonpatch=require(_0xe0c2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe0c2('0x3'));var Mustache=require(_0xe0c2('0x4'));var util=require(_0xe0c2('0x5'));var path=require(_0xe0c2('0x6'));var sox=require(_0xe0c2('0x7'));var csv=require(_0xe0c2('0x8'));var ejs=require(_0xe0c2('0x9'));var fs=require('fs');var fs_extra=require(_0xe0c2('0xa'));var _=require(_0xe0c2('0xb'));var squel=require(_0xe0c2('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0c2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe0c2('0x8'));var querystring=require(_0xe0c2('0xe'));var Papa=require(_0xe0c2('0xf'));var Redis=require(_0xe0c2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe0c2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0c2('0x12'));var logger=require(_0xe0c2('0x13'))(_0xe0c2('0x14'));var utils=require(_0xe0c2('0x15'));var config=require(_0xe0c2('0x16'));var licenseUtil=require(_0xe0c2('0x17'));var db=require(_0xe0c2('0x18'))['db'];config[_0xe0c2('0x19')]=_[_0xe0c2('0x1a')](config['redis'],{'host':_0xe0c2('0x1b'),'port':0x18eb});var socket=require(_0xe0c2('0x1c'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xe0c2('0x1d')](socket);var jayson=require(_0xe0c2('0x1e'));var client=jayson[_0xe0c2('0x1f')][_0xe0c2('0x20')]({'port':0x232c});var client9002=jayson[_0xe0c2('0x1f')][_0xe0c2('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3d3738,_0x35f501,_0x2dfcf4,_0x1f1563){return new BPromise(function(_0x529e85,_0x168e89){var _0x561cae=_0x1f1563||client;return _0x561cae[_0xe0c2('0x21')](_0x3d3738,_0x2dfcf4)[_0xe0c2('0x22')](function(_0x33a249){logger[_0xe0c2('0x23')](_0xe0c2('0x24'),_0x35f501,_0xe0c2('0x25'));logger[_0xe0c2('0x26')](_0xe0c2('0x27'),_0x35f501,'request\x20sent',JSON[_0xe0c2('0x28')](_0x33a249));if(_0x33a249[_0xe0c2('0x29')]){if(_0x33a249[_0xe0c2('0x29')][_0xe0c2('0x2a')]===0x1f4){logger[_0xe0c2('0x29')](_0xe0c2('0x24'),_0x35f501,_0x33a249['error'][_0xe0c2('0x2b')]);return _0x168e89(_0x33a249[_0xe0c2('0x29')][_0xe0c2('0x2b')]);}logger[_0xe0c2('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x35f501,_0x33a249[_0xe0c2('0x29')][_0xe0c2('0x2b')]);return _0x529e85(_0x33a249['error']['message']);}else{logger[_0xe0c2('0x23')](_0xe0c2('0x24'),_0x35f501,_0xe0c2('0x25'));_0x529e85(_0x33a249[_0xe0c2('0x2c')][_0xe0c2('0x2b')]);}})['catch'](function(_0x14506d){logger['error'](_0xe0c2('0x24'),_0x35f501,_0x14506d);_0x168e89(_0x14506d);});});}function respondWithStatusCode(_0x38f9ca,_0x1f6995){_0x1f6995=_0x1f6995||0xcc;return function(_0x5271e6){if(_0x5271e6){return _0x38f9ca[_0xe0c2('0x2d')](_0x1f6995);}return _0x38f9ca[_0xe0c2('0x2e')](_0x1f6995)['end']();};}function respondWithResult(_0x534b81,_0x29f35d){_0x29f35d=_0x29f35d||0xc8;return function(_0xcec29a){if(_0xcec29a){return _0x534b81['status'](_0x29f35d)[_0xe0c2('0x2f')](_0xcec29a);}};}function respondWithFilteredResult(_0x2b3f59,_0x262f4c){return function(_0x247953){if(_0x247953){var _0x2c5138=typeof _0x262f4c['offset']===_0xe0c2('0x30')&&typeof _0x262f4c[_0xe0c2('0x31')]===_0xe0c2('0x30');var _0x5333a0=_0x247953['count'];var _0x182d22=_0x2c5138?0x0:_0x262f4c[_0xe0c2('0x32')];var _0x5f3c81=_0x2c5138?_0x247953['count']:_0x262f4c[_0xe0c2('0x32')]+_0x262f4c[_0xe0c2('0x31')];var _0x35b638;if(_0x5f3c81>=_0x5333a0){_0x5f3c81=_0x5333a0;_0x35b638=0xc8;}else{_0x35b638=0xce;}_0x2b3f59[_0xe0c2('0x2e')](_0x35b638);return _0x2b3f59[_0xe0c2('0x33')](_0xe0c2('0x34'),_0x182d22+'-'+_0x5f3c81+'/'+_0x5333a0)[_0xe0c2('0x2f')](_0x247953);}return null;};}function patchUpdates(_0x237304){return function(_0x47be71){try{jsonpatch['apply'](_0x47be71,_0x237304,!![]);}catch(_0x597e56){return BPromise[_0xe0c2('0x35')](_0x597e56);}return _0x47be71[_0xe0c2('0x36')]();};}function saveUpdates(_0x5dbeb2,_0x29ec6c){return function(_0x5ecf69){if(_0x5ecf69){return _0x5ecf69[_0xe0c2('0x37')](_0x5dbeb2)[_0xe0c2('0x22')](function(_0x430595){return _0x430595;});}return null;};}function removeEntity(_0x578a8e,_0x159cbd){return function(_0x2ae4d9){if(_0x2ae4d9){return _0x2ae4d9[_0xe0c2('0x38')]()[_0xe0c2('0x22')](function(){_0x578a8e[_0xe0c2('0x2e')](0xcc)[_0xe0c2('0x39')]();});}};}function handleEntityNotFound(_0x3c890e,_0x5d9ca0){return function(_0x87d4ef){if(!_0x87d4ef){_0x3c890e[_0xe0c2('0x2d')](0x194);}return _0x87d4ef;};}function handleError(_0x4b5d29,_0x31ed63){_0x31ed63=_0x31ed63||0x1f4;return function(_0x517252){logger[_0xe0c2('0x29')](_0x517252['stack']);if(_0x517252[_0xe0c2('0x3a')]){delete _0x517252[_0xe0c2('0x3a')];}_0x4b5d29['status'](_0x31ed63)[_0xe0c2('0x3b')](_0x517252);};}exports[_0xe0c2('0x3c')]=function(_0x37ebae,_0x14e0ff){var _0x52931d={},_0x18c1fd={},_0x2995ea={'count':0x0,'rows':[]};var _0x1d0cf9=_['map'](db[_0xe0c2('0x3d')][_0xe0c2('0x3e')],function(_0x386346){return{'name':_0x386346[_0xe0c2('0x3f')],'type':_0x386346[_0xe0c2('0x40')][_0xe0c2('0x41')]};});_0x18c1fd['model']=_[_0xe0c2('0x42')](_0x1d0cf9,_0xe0c2('0x3a'));_0x18c1fd[_0xe0c2('0x43')]=_[_0xe0c2('0x44')](_0x37ebae[_0xe0c2('0x43')]);_0x18c1fd[_0xe0c2('0x45')]=_[_0xe0c2('0x46')](_0x18c1fd[_0xe0c2('0x47')],_0x18c1fd[_0xe0c2('0x43')]);_0x52931d[_0xe0c2('0x48')]=_['intersection'](_0x18c1fd['model'],qs[_0xe0c2('0x49')](_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x49')]));_0x52931d['attributes']=_0x52931d[_0xe0c2('0x48')]['length']?_0x52931d[_0xe0c2('0x48')]:_0x18c1fd[_0xe0c2('0x47')];if(!_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4a')]('nolimit')){_0x52931d['limit']=qs[_0xe0c2('0x31')](_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x31')]);_0x52931d[_0xe0c2('0x32')]=qs[_0xe0c2('0x32')](_0x37ebae[_0xe0c2('0x43')]['offset']);}_0x52931d[_0xe0c2('0x4b')]=qs[_0xe0c2('0x4c')](_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4c')]);_0x52931d['where']=qs['filters'](_[_0xe0c2('0x4d')](_0x37ebae[_0xe0c2('0x43')],_0x18c1fd[_0xe0c2('0x45')]),_0x1d0cf9);if(_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4e')]){_0x52931d[_0xe0c2('0x4f')]=_[_0xe0c2('0x50')](_0x52931d[_0xe0c2('0x4f')],{'$or':_['map'](_0x1d0cf9,function(_0x3d86dc){if(_0x3d86dc[_0xe0c2('0x40')]!==_0xe0c2('0x51')){var _0x394daa={};_0x394daa[_0x3d86dc[_0xe0c2('0x3a')]]={'$like':'%'+_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x4e')]+'%'};return _0x394daa;}})});}_0x52931d=_[_0xe0c2('0x50')]({},_0x52931d,_0x37ebae[_0xe0c2('0x52')]);var _0x69a071={'where':_0x52931d[_0xe0c2('0x4f')]};return db['WhatsappMessage']['count'](_0x69a071)[_0xe0c2('0x22')](function(_0x39a532){_0x2995ea['count']=_0x39a532;if(_0x37ebae[_0xe0c2('0x43')][_0xe0c2('0x53')]){_0x52931d['include']=[{'all':!![]}];}return db[_0xe0c2('0x3d')][_0xe0c2('0x54')](_0x52931d);})[_0xe0c2('0x22')](function(_0x137588){_0x2995ea[_0xe0c2('0x55')]=_0x137588;return _0x2995ea;})['then'](respondWithFilteredResult(_0x14e0ff,_0x52931d))['catch'](handleError(_0x14e0ff,null));};exports[_0xe0c2('0x56')]=function(_0x1790ed,_0x288621){var _0x1413be={'raw':!![],'where':{'id':_0x1790ed[_0xe0c2('0x57')]['id']}},_0x53a220={};_0x53a220[_0xe0c2('0x47')]=_['keys'](db['WhatsappMessage'][_0xe0c2('0x3e')]);_0x53a220['query']=_[_0xe0c2('0x44')](_0x1790ed[_0xe0c2('0x43')]);_0x53a220[_0xe0c2('0x45')]=_['intersection'](_0x53a220[_0xe0c2('0x47')],_0x53a220[_0xe0c2('0x43')]);_0x1413be[_0xe0c2('0x48')]=_[_0xe0c2('0x46')](_0x53a220[_0xe0c2('0x47')],qs['fields'](_0x1790ed[_0xe0c2('0x43')][_0xe0c2('0x49')]));_0x1413be[_0xe0c2('0x48')]=_0x1413be[_0xe0c2('0x48')][_0xe0c2('0x58')]?_0x1413be[_0xe0c2('0x48')]:_0x53a220[_0xe0c2('0x47')];if(_0x1790ed['query'][_0xe0c2('0x53')]){_0x1413be[_0xe0c2('0x59')]=[{'all':!![]}];}_0x1413be=_[_0xe0c2('0x50')]({},_0x1413be,_0x1790ed[_0xe0c2('0x52')]);return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')](_0x1413be)[_0xe0c2('0x22')](handleEntityNotFound(_0x288621,null))['then'](respondWithResult(_0x288621,null))[_0xe0c2('0x5b')](handleError(_0x288621,null));};exports[_0xe0c2('0x5c')]=function(_0x37c404,_0x553b80){return db[_0xe0c2('0x3d')][_0xe0c2('0x5c')](_0x37c404[_0xe0c2('0x5d')],{})[_0xe0c2('0x22')](respondWithResult(_0x553b80,0xc9))['catch'](handleError(_0x553b80,null));};exports[_0xe0c2('0x37')]=function(_0x3ab296,_0x4ef274){if(_0x3ab296[_0xe0c2('0x5d')]['id']){delete _0x3ab296[_0xe0c2('0x5d')]['id'];}return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x3ab296[_0xe0c2('0x57')]['id']}})[_0xe0c2('0x22')](handleEntityNotFound(_0x4ef274,null))[_0xe0c2('0x22')](saveUpdates(_0x3ab296[_0xe0c2('0x5d')],null))[_0xe0c2('0x22')](respondWithResult(_0x4ef274,null))[_0xe0c2('0x5b')](handleError(_0x4ef274,null));};exports['destroy']=function(_0x355df6,_0x2bd72d){return db['WhatsappMessage'][_0xe0c2('0x5a')]({'where':{'id':_0x355df6[_0xe0c2('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bd72d,null))[_0xe0c2('0x22')](removeEntity(_0x2bd72d,null))[_0xe0c2('0x5b')](handleError(_0x2bd72d,null));};exports[_0xe0c2('0x5e')]=function(_0x393914,_0xca177c){return db[_0xe0c2('0x3d')][_0xe0c2('0x5e')]()[_0xe0c2('0x22')](respondWithResult(_0xca177c,null))[_0xe0c2('0x5b')](handleError(_0xca177c,null));};var interaction_log=require(_0xe0c2('0x13'))(_0xe0c2('0x5f'));exports[_0xe0c2('0x60')]=function(_0x2c2248,_0x59b145,_0x1cc4ad){var _0x4bb479={'agent':{},'channel':_0xe0c2('0x61')};if(_0x2c2248['body']['id']){delete _0x2c2248[_0xe0c2('0x5d')]['id'];}_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x62')]=!![];_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x63')]=moment()[_0xe0c2('0x64')](_0xe0c2('0x65'));_0x2c2248['body'][_0xe0c2('0x66')]=_0x2c2248['body'][_0xe0c2('0x66')]||_0x2c2248[_0xe0c2('0x67')]['id'];_0x4bb479[_0xe0c2('0x68')]['id']=_0x2c2248['body']['UserId'];return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x2c2248[_0xe0c2('0x57')]['id'],'UserId':null}})[_0xe0c2('0x22')](handleEntityNotFound(_0x59b145,null))['then'](saveUpdates(_0x2c2248['body'],null))[_0xe0c2('0x22')](function(_0x48ef72){if(_0x48ef72){_0x4bb479[_0xe0c2('0x2b')]=_0x48ef72['get']({'plain':!![]});return db[_0xe0c2('0x69')]['find']({'where':{'id':_0x48ef72[_0xe0c2('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x59b145,null))['then'](function(_0x109ec5){if(_0x109ec5){return _0x109ec5[_0xe0c2('0x37')]({'UserId':_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x66')],'read1stAt':_[_0xe0c2('0x6b')](_0x109ec5[_0xe0c2('0x6c')])?moment()[_0xe0c2('0x64')](_0xe0c2('0x65')):undefined});}return null;})[_0xe0c2('0x22')](function(_0x154e4a){if(_0x154e4a){_0x4bb479[_0xe0c2('0x6d')]=_0x154e4a[_0xe0c2('0x6e')]({'plain':!![]});interaction_log[_0xe0c2('0x23')](_0xe0c2('0x6f'),_0x2c2248[_0xe0c2('0x67')]['id'],_0x2c2248['user'][_0xe0c2('0x3a')],_0x2c2248[_0xe0c2('0x67')]['role'],_0x4bb479[_0xe0c2('0x6d')]['id'],_0x2c2248[_0xe0c2('0x5d')]?JSON['stringify'](_0x2c2248[_0xe0c2('0x5d')]):_0xe0c2('0x70'));return respondWithRpcPromise(_0xe0c2('0x71'),_0xe0c2('0x72'),_0x4bb479);}return null;})[_0xe0c2('0x22')](function(_0x582102){var _0x4c98db=_0xe0c2('0x73')+_0x582102[_0xe0c2('0x2b')][_0xe0c2('0x74')];return db[_0xe0c2('0x75')][_0xe0c2('0x43')](_0x4c98db,{'type':db[_0xe0c2('0x76')][_0xe0c2('0x77')][_0xe0c2('0x78')],'raw':!![]})[_0xe0c2('0x22')](function(_0x26c37d){return _0x26c37d;});})['then'](function(_0x40bf8d){if(_0x40bf8d){_0x4bb479['message'][_0xe0c2('0x79')]=_0x40bf8d[0x0];if(!_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x66')])return;return db[_0xe0c2('0x7a')][_0xe0c2('0x5a')]({'where':{'id':_0x2c2248[_0xe0c2('0x5d')]['UserId'],'role':_0xe0c2('0x68')},'attributes':['id','name','fullname',_0xe0c2('0x7b'),_0xe0c2('0x7c')],'raw':!![]});}return null;})[_0xe0c2('0x22')](function(_0x25cb4d){if(!_0x25cb4d)return null;_0x4bb479[_0xe0c2('0x2b')][_0xe0c2('0x68')]=_0x25cb4d;return _0x4bb479;})[_0xe0c2('0x22')](function(_0x19e97c){if(_0x19e97c){if(_0x2c2248[_0xe0c2('0x5d')][_0xe0c2('0x7d')]){_0x4bb479[_0xe0c2('0x2b')][_0xe0c2('0x7e')]=util['format']('SIP/%s',_0x2c2248[_0xe0c2('0x67')][_0xe0c2('0x3a')]);_0x4bb479[_0xe0c2('0x2b')][_0xe0c2('0x7f')]=_0x4bb479['channel'];_0x4bb479['message'][_0xe0c2('0x80')]=_0x4bb479[_0xe0c2('0x7f')];_0x4bb479[_0xe0c2('0x2b')]['event']=_0xe0c2('0x60');return respondWithRpcPromise('EventManager',_0xe0c2('0x81'),{'event':'acceptmessage','message':_0x4bb479['message']},client9002)[_0xe0c2('0x22')](function(){return _0x4bb479;});}return _0x4bb479;}return null;})[_0xe0c2('0x22')](respondWithResult(_0x59b145,null))['catch'](handleError(_0x59b145,null));};var interaction_log=require(_0xe0c2('0x13'))('whatsapp-interactions');exports['reject']=function(_0x5b1e6a,_0x470f16,_0xdf2c14){var _0x1fccac={'agent':{},'channel':_0xe0c2('0x61')};if(_0x5b1e6a['body']['id']){delete _0x5b1e6a[_0xe0c2('0x5d')]['id'];}_0x5b1e6a['body'][_0xe0c2('0x66')]=_0x5b1e6a[_0xe0c2('0x5d')]['UserId']||_0x5b1e6a['user']['id'];_0x1fccac['agent']['id']=_0x5b1e6a['body']['UserId'];return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x5b1e6a[_0xe0c2('0x57')]['id'],'UserId':null}})[_0xe0c2('0x22')](handleEntityNotFound(_0x470f16,null))[_0xe0c2('0x22')](function(_0x52e782){if(_0x52e782){_0x1fccac['message']=_0x52e782['get']({'plain':!![]});return db[_0xe0c2('0x69')][_0xe0c2('0x5a')]({'where':{'id':_0x52e782[_0xe0c2('0x6a')]}});}return null;})[_0xe0c2('0x22')](handleEntityNotFound(_0x470f16,null))[_0xe0c2('0x22')](function(_0x13f2c1){if(_0x13f2c1){_0x1fccac[_0xe0c2('0x6d')]=_0x13f2c1[_0xe0c2('0x6e')]({'plain':!![]});interaction_log[_0xe0c2('0x23')](_0xe0c2('0x82'),_0x5b1e6a['user']['id'],_0x5b1e6a['user'][_0xe0c2('0x3a')],_0x5b1e6a['user'][_0xe0c2('0x83')],_0x1fccac['interaction']['id'],_0x5b1e6a[_0xe0c2('0x5d')]?JSON[_0xe0c2('0x28')](_0x5b1e6a[_0xe0c2('0x5d')]):_0xe0c2('0x70'));return respondWithRpcPromise(_0xe0c2('0x84'),_0xe0c2('0x85'),_0x1fccac);}return null;})['then'](function(_0x1bf1d9){var _0x47a663='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bf1d9[_0xe0c2('0x2b')][_0xe0c2('0x74')];return db[_0xe0c2('0x75')][_0xe0c2('0x43')](_0x47a663,{'type':db[_0xe0c2('0x76')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe0c2('0x22')](function(_0x5be7ac){return _0x5be7ac;});})[_0xe0c2('0x22')](function(_0x31b736){if(_0x31b736){_0x1fccac[_0xe0c2('0x2b')][_0xe0c2('0x79')]=_0x31b736[0x0];if(!_0x5b1e6a[_0xe0c2('0x5d')][_0xe0c2('0x66')])return;return db[_0xe0c2('0x7a')][_0xe0c2('0x5a')]({'where':{'id':_0x5b1e6a[_0xe0c2('0x5d')]['UserId'],'role':_0xe0c2('0x68')},'attributes':['id',_0xe0c2('0x3a'),_0xe0c2('0x86'),_0xe0c2('0x7b'),'internal'],'raw':!![]});}return null;})[_0xe0c2('0x22')](function(_0x3909dd){if(!_0x3909dd)return null;_0x1fccac[_0xe0c2('0x2b')]['agent']=_0x3909dd;return _0x1fccac;})[_0xe0c2('0x22')](function(_0x242f62){if(_0x242f62){_0x242f62['message'][_0xe0c2('0x7e')]=util[_0xe0c2('0x64')](_0xe0c2('0x87'),_0x5b1e6a['user'][_0xe0c2('0x3a')]);_0x242f62[_0xe0c2('0x2b')]['channel']=_0x1fccac[_0xe0c2('0x7f')];_0x242f62[_0xe0c2('0x2b')]['motionChannel']=_0x1fccac['channel'];_0x242f62[_0xe0c2('0x2b')][_0xe0c2('0x88')]='reject';respondWithRpcPromise(_0xe0c2('0x81'),'EventManager',{'event':'rejectmessage','message':_0x242f62[_0xe0c2('0x2b')]},client9002);return _0x1fccac;}return null;})['then'](respondWithResult(_0x470f16,null))['catch'](handleError(_0x470f16,null));};exports[_0xe0c2('0x2e')]=function(_0x2d02f1,_0x11931d,_0x5e1cae){if(_0x2d02f1['body']['id']){delete _0x2d02f1['body']['id'];}var _0x334fbf;return db[_0xe0c2('0x3d')][_0xe0c2('0x5a')]({'where':{'id':_0x2d02f1['params']['id']}})[_0xe0c2('0x22')](handleEntityNotFound(_0x11931d,null))[_0xe0c2('0x22')](function(_0x20df7e){if(_0x20df7e){_0x334fbf=_0x20df7e;return db[_0xe0c2('0x89')][_0xe0c2('0x5a')]({'where':{'id':_0x20df7e[_0xe0c2('0x8a')]}});}})['then'](handleEntityNotFound(_0x11931d,null))[_0xe0c2('0x22')](function(_0x598114){if(_0x598114){logger[_0xe0c2('0x26')](_0xe0c2('0x8b'),_0xe0c2('0x2e'),'received\x20delivery\x20report\x20from',_0x598114[_0xe0c2('0x40')],util[_0xe0c2('0x8c')](_0x2d02f1['body'],{'showHidden':![],'depth':null}));switch(_0x598114[_0xe0c2('0x40')]){case _0xe0c2('0x8d'):if(_0x2d02f1[_0xe0c2('0x5d')]['MessageSid']&&_0x2d02f1['body']['MessageSid']===_0x334fbf[_0xe0c2('0x8e')]&&_0x2d02f1['body'][_0xe0c2('0x8f')]&&_0x2d02f1['body']['MessageStatus']==='read'){return _0x334fbf[_0xe0c2('0x37')]({'read':!![]});}else{logger[_0xe0c2('0x29')](_0xe0c2('0x90'),_0xe0c2('0x2e'),_0xe0c2('0x8d'),util[_0xe0c2('0x8c')](_0x2d02f1[_0xe0c2('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x334fbf;}})[_0xe0c2('0x22')](respondWithResult(_0x11931d,null))[_0xe0c2('0x5b')](handleError(_0x11931d,null));};
\ No newline at end of file
+var _0xf63e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','./whatsappMessage.socket','register','jayson/promise','client','http','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','filters','includeAll','create','body','find','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','MessageStatus','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x473931,_0x22a4c3){var _0x5b19bf=function(_0x455025){while(--_0x455025){_0x473931['push'](_0x473931['shift']());}};_0x5b19bf(++_0x22a4c3);}(_0xf63e,0x19b));var _0xef63=function(_0x2bd752,_0x4c0bdc){_0x2bd752=_0x2bd752-0x0;var _0x2bb044=_0xf63e[_0x2bd752];return _0x2bb044;};'use strict';var emlformat=require(_0xef63('0x0'));var rimraf=require(_0xef63('0x1'));var zipdir=require(_0xef63('0x2'));var jsonpatch=require(_0xef63('0x3'));var rp=require(_0xef63('0x4'));var moment=require(_0xef63('0x5'));var BPromise=require(_0xef63('0x6'));var Mustache=require(_0xef63('0x7'));var util=require(_0xef63('0x8'));var path=require(_0xef63('0x9'));var sox=require(_0xef63('0xa'));var csv=require(_0xef63('0xb'));var ejs=require(_0xef63('0xc'));var fs=require('fs');var fs_extra=require(_0xef63('0xd'));var _=require('lodash');var squel=require(_0xef63('0xe'));var crypto=require(_0xef63('0xf'));var jsforce=require(_0xef63('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xef63('0xb'));var querystring=require(_0xef63('0x11'));var Papa=require(_0xef63('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xef63('0x13'));var as=require(_0xef63('0x14'));var hardwareService=require(_0xef63('0x15'));var logger=require(_0xef63('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xef63('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xef63('0x18')]=_['defaults'](config[_0xef63('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xef63('0x19'))[_0xef63('0x1a')](socket);var jayson=require(_0xef63('0x1b'));var client=jayson[_0xef63('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xef63('0x1c')][_0xef63('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x340af6,_0x568f90,_0x31a105,_0x2d62a2){return new BPromise(function(_0x398cab,_0x2f99d8){var _0x530a5b=_0x2d62a2||client;return _0x530a5b[_0xef63('0x1e')](_0x340af6,_0x31a105)['then'](function(_0x59c533){logger['info'](_0xef63('0x1f'),_0x568f90,_0xef63('0x20'));logger[_0xef63('0x21')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x568f90,_0xef63('0x20'),JSON[_0xef63('0x22')](_0x59c533));if(_0x59c533['error']){if(_0x59c533['error'][_0xef63('0x23')]===0x1f4){logger[_0xef63('0x24')](_0xef63('0x1f'),_0x568f90,_0x59c533[_0xef63('0x24')][_0xef63('0x25')]);return _0x2f99d8(_0x59c533[_0xef63('0x24')][_0xef63('0x25')]);}logger[_0xef63('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x568f90,_0x59c533[_0xef63('0x24')][_0xef63('0x25')]);return _0x398cab(_0x59c533['error']['message']);}else{logger[_0xef63('0x26')](_0xef63('0x1f'),_0x568f90,_0xef63('0x20'));_0x398cab(_0x59c533[_0xef63('0x27')][_0xef63('0x25')]);}})[_0xef63('0x28')](function(_0x31b665){logger[_0xef63('0x24')](_0xef63('0x1f'),_0x568f90,_0x31b665);_0x2f99d8(_0x31b665);});});}function respondWithStatusCode(_0x45e223,_0x4c919b){_0x4c919b=_0x4c919b||0xcc;return function(_0x24feae){if(_0x24feae){return _0x45e223[_0xef63('0x29')](_0x4c919b);}return _0x45e223[_0xef63('0x2a')](_0x4c919b)[_0xef63('0x2b')]();};}function respondWithResult(_0x4e97be,_0x508cfb){_0x508cfb=_0x508cfb||0xc8;return function(_0x5296e5){if(_0x5296e5){return _0x4e97be[_0xef63('0x2a')](_0x508cfb)[_0xef63('0x2c')](_0x5296e5);}};}function respondWithFilteredResult(_0x3677db,_0x4105ba){return function(_0x22c0a5){if(_0x22c0a5){var _0x17dd74=typeof _0x4105ba[_0xef63('0x2d')]===_0xef63('0x2e')&&typeof _0x4105ba['limit']==='undefined';var _0x564152=_0x22c0a5[_0xef63('0x2f')];var _0x16c093=_0x17dd74?0x0:_0x4105ba[_0xef63('0x2d')];var _0x2a7391=_0x17dd74?_0x22c0a5[_0xef63('0x2f')]:_0x4105ba[_0xef63('0x2d')]+_0x4105ba[_0xef63('0x30')];var _0xf88e70;if(_0x2a7391>=_0x564152){_0x2a7391=_0x564152;_0xf88e70=0xc8;}else{_0xf88e70=0xce;}_0x3677db[_0xef63('0x2a')](_0xf88e70);return _0x3677db[_0xef63('0x31')](_0xef63('0x32'),_0x16c093+'-'+_0x2a7391+'/'+_0x564152)[_0xef63('0x2c')](_0x22c0a5);}return null;};}function patchUpdates(_0x2bd0c0){return function(_0x5a4e45){try{jsonpatch[_0xef63('0x33')](_0x5a4e45,_0x2bd0c0,!![]);}catch(_0x1f7ad9){return BPromise[_0xef63('0x34')](_0x1f7ad9);}return _0x5a4e45['save']();};}function saveUpdates(_0x409fe0,_0x53e4db){return function(_0x9dd186){if(_0x9dd186){return _0x9dd186[_0xef63('0x35')](_0x409fe0)[_0xef63('0x36')](function(_0x509e88){return _0x509e88;});}return null;};}function removeEntity(_0x19c55f,_0x2cbd2f){return function(_0x5a4bbf){if(_0x5a4bbf){return _0x5a4bbf[_0xef63('0x37')]()[_0xef63('0x36')](function(){_0x19c55f[_0xef63('0x2a')](0xcc)[_0xef63('0x2b')]();});}};}function handleEntityNotFound(_0x139a3d,_0x42ff65){return function(_0x9dd4f8){if(!_0x9dd4f8){_0x139a3d[_0xef63('0x29')](0x194);}return _0x9dd4f8;};}function handleError(_0x1858ac,_0x4eb9a5){_0x4eb9a5=_0x4eb9a5||0x1f4;return function(_0x5a36c){logger[_0xef63('0x24')](_0x5a36c[_0xef63('0x38')]);if(_0x5a36c[_0xef63('0x39')]){delete _0x5a36c['name'];}_0x1858ac['status'](_0x4eb9a5)[_0xef63('0x3a')](_0x5a36c);};}exports['index']=function(_0x59b45b,_0x58c9a3){var _0x27fc90={},_0xcbc8b={},_0xb9c5d={'count':0x0,'rows':[]};var _0x2ab66c=_[_0xef63('0x3b')](db[_0xef63('0x3c')][_0xef63('0x3d')],function(_0x287bb0){return{'name':_0x287bb0['fieldName'],'type':_0x287bb0['type'][_0xef63('0x3e')]};});_0xcbc8b[_0xef63('0x3f')]=_[_0xef63('0x3b')](_0x2ab66c,_0xef63('0x39'));_0xcbc8b[_0xef63('0x40')]=_[_0xef63('0x41')](_0x59b45b[_0xef63('0x40')]);_0xcbc8b['filters']=_['intersection'](_0xcbc8b[_0xef63('0x3f')],_0xcbc8b[_0xef63('0x40')]);_0x27fc90[_0xef63('0x42')]=_[_0xef63('0x43')](_0xcbc8b[_0xef63('0x3f')],qs[_0xef63('0x44')](_0x59b45b[_0xef63('0x40')][_0xef63('0x44')]));_0x27fc90['attributes']=_0x27fc90[_0xef63('0x42')][_0xef63('0x45')]?_0x27fc90[_0xef63('0x42')]:_0xcbc8b[_0xef63('0x3f')];if(!_0x59b45b[_0xef63('0x40')]['hasOwnProperty'](_0xef63('0x46'))){_0x27fc90['limit']=qs['limit'](_0x59b45b[_0xef63('0x40')][_0xef63('0x30')]);_0x27fc90['offset']=qs[_0xef63('0x2d')](_0x59b45b[_0xef63('0x40')][_0xef63('0x2d')]);}_0x27fc90[_0xef63('0x47')]=qs[_0xef63('0x48')](_0x59b45b[_0xef63('0x40')][_0xef63('0x48')]);_0x27fc90[_0xef63('0x49')]=qs['filters'](_[_0xef63('0x4a')](_0x59b45b[_0xef63('0x40')],_0xcbc8b['filters']),_0x2ab66c);if(_0x59b45b[_0xef63('0x40')]['filter']){_0x27fc90[_0xef63('0x49')]=_[_0xef63('0x4b')](_0x27fc90['where'],{'$or':_[_0xef63('0x3b')](_0x2ab66c,function(_0x586dbf){if(_0x586dbf['type']!==_0xef63('0x4c')){var _0x57780c={};_0x57780c[_0x586dbf[_0xef63('0x39')]]={'$like':'%'+_0x59b45b['query'][_0xef63('0x4d')]+'%'};return _0x57780c;}})});}_0x27fc90=_[_0xef63('0x4b')]({},_0x27fc90,_0x59b45b[_0xef63('0x4e')]);var _0x2f762a={'where':_0x27fc90[_0xef63('0x49')]};return db[_0xef63('0x3c')]['count'](_0x2f762a)[_0xef63('0x36')](function(_0x389e6b){_0xb9c5d[_0xef63('0x2f')]=_0x389e6b;if(_0x59b45b['query']['includeAll']){_0x27fc90[_0xef63('0x4f')]=[{'all':!![]}];}return db[_0xef63('0x3c')][_0xef63('0x50')](_0x27fc90);})[_0xef63('0x36')](function(_0x1a138f){_0xb9c5d[_0xef63('0x51')]=_0x1a138f;return _0xb9c5d;})[_0xef63('0x36')](respondWithFilteredResult(_0x58c9a3,_0x27fc90))['catch'](handleError(_0x58c9a3,null));};exports[_0xef63('0x52')]=function(_0x1c320c,_0x5741e2){var _0x10b91f={'raw':!![],'where':{'id':_0x1c320c['params']['id']}},_0x557655={};_0x557655['model']=_['keys'](db[_0xef63('0x3c')][_0xef63('0x3d')]);_0x557655[_0xef63('0x40')]=_[_0xef63('0x41')](_0x1c320c[_0xef63('0x40')]);_0x557655[_0xef63('0x53')]=_[_0xef63('0x43')](_0x557655['model'],_0x557655[_0xef63('0x40')]);_0x10b91f['attributes']=_['intersection'](_0x557655['model'],qs['fields'](_0x1c320c[_0xef63('0x40')][_0xef63('0x44')]));_0x10b91f[_0xef63('0x42')]=_0x10b91f[_0xef63('0x42')]['length']?_0x10b91f[_0xef63('0x42')]:_0x557655[_0xef63('0x3f')];if(_0x1c320c['query'][_0xef63('0x54')]){_0x10b91f[_0xef63('0x4f')]=[{'all':!![]}];}_0x10b91f=_[_0xef63('0x4b')]({},_0x10b91f,_0x1c320c[_0xef63('0x4e')]);return db[_0xef63('0x3c')]['find'](_0x10b91f)['then'](handleEntityNotFound(_0x5741e2,null))[_0xef63('0x36')](respondWithResult(_0x5741e2,null))[_0xef63('0x28')](handleError(_0x5741e2,null));};exports[_0xef63('0x55')]=function(_0x4b53b4,_0x5dc5ed){return db['WhatsappMessage']['create'](_0x4b53b4[_0xef63('0x56')],{})['then'](respondWithResult(_0x5dc5ed,0xc9))[_0xef63('0x28')](handleError(_0x5dc5ed,null));};exports[_0xef63('0x35')]=function(_0x176d42,_0x2e76ab){if(_0x176d42[_0xef63('0x56')]['id']){delete _0x176d42[_0xef63('0x56')]['id'];}return db[_0xef63('0x3c')][_0xef63('0x57')]({'where':{'id':_0x176d42[_0xef63('0x58')]['id']}})[_0xef63('0x36')](handleEntityNotFound(_0x2e76ab,null))[_0xef63('0x36')](saveUpdates(_0x176d42[_0xef63('0x56')],null))['then'](respondWithResult(_0x2e76ab,null))['catch'](handleError(_0x2e76ab,null));};exports[_0xef63('0x37')]=function(_0x2fd7d2,_0x582ce0){return db[_0xef63('0x3c')]['find']({'where':{'id':_0x2fd7d2['params']['id']}})[_0xef63('0x36')](handleEntityNotFound(_0x582ce0,null))[_0xef63('0x36')](removeEntity(_0x582ce0,null))[_0xef63('0x28')](handleError(_0x582ce0,null));};exports[_0xef63('0x59')]=function(_0x5aa715,_0x334c72){return db[_0xef63('0x3c')][_0xef63('0x59')]()[_0xef63('0x36')](respondWithResult(_0x334c72,null))[_0xef63('0x28')](handleError(_0x334c72,null));};var interaction_log=require(_0xef63('0x16'))(_0xef63('0x5a'));exports[_0xef63('0x5b')]=function(_0x5ad3e7,_0x14442a,_0x35e22b){var _0x5972c5={'agent':{},'channel':_0xef63('0x5c')};if(_0x5ad3e7[_0xef63('0x56')]['id']){delete _0x5ad3e7[_0xef63('0x56')]['id'];}_0x5ad3e7[_0xef63('0x56')][_0xef63('0x5d')]=!![];_0x5ad3e7[_0xef63('0x56')][_0xef63('0x5e')]=moment()[_0xef63('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ad3e7[_0xef63('0x56')][_0xef63('0x60')]=_0x5ad3e7['body'][_0xef63('0x60')]||_0x5ad3e7[_0xef63('0x61')]['id'];_0x5972c5[_0xef63('0x62')]['id']=_0x5ad3e7[_0xef63('0x56')][_0xef63('0x60')];return db[_0xef63('0x3c')][_0xef63('0x57')]({'where':{'id':_0x5ad3e7[_0xef63('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14442a,null))['then'](saveUpdates(_0x5ad3e7[_0xef63('0x56')],null))[_0xef63('0x36')](function(_0x2d2086){if(_0x2d2086){_0x5972c5[_0xef63('0x25')]=_0x2d2086[_0xef63('0x63')]({'plain':!![]});return db[_0xef63('0x64')]['find']({'where':{'id':_0x2d2086[_0xef63('0x65')]}});}return null;})[_0xef63('0x36')](handleEntityNotFound(_0x14442a,null))[_0xef63('0x36')](function(_0x2f1f92){if(_0x2f1f92){return _0x2f1f92[_0xef63('0x35')]({'UserId':_0x5ad3e7[_0xef63('0x56')][_0xef63('0x60')],'read1stAt':_[_0xef63('0x66')](_0x2f1f92[_0xef63('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xef63('0x36')](function(_0x407e2a){if(_0x407e2a){_0x5972c5[_0xef63('0x68')]=_0x407e2a[_0xef63('0x63')]({'plain':!![]});interaction_log['info'](_0xef63('0x69'),_0x5ad3e7['user']['id'],_0x5ad3e7[_0xef63('0x61')][_0xef63('0x39')],_0x5ad3e7['user'][_0xef63('0x6a')],_0x5972c5[_0xef63('0x68')]['id'],_0x5ad3e7[_0xef63('0x56')]?JSON[_0xef63('0x22')](_0x5ad3e7[_0xef63('0x56')]):_0xef63('0x6b'));return respondWithRpcPromise(_0xef63('0x6c'),_0xef63('0x6d'),_0x5972c5);}return null;})[_0xef63('0x36')](function(_0x477c67){var _0xc73a45=_0xef63('0x6e')+_0x477c67['message'][_0xef63('0x6f')];return db[_0xef63('0x70')][_0xef63('0x40')](_0xc73a45,{'type':db[_0xef63('0x71')][_0xef63('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x5d1b25){return _0x5d1b25;});})[_0xef63('0x36')](function(_0x415fb6){if(_0x415fb6){_0x5972c5[_0xef63('0x25')][_0xef63('0x73')]=_0x415fb6[0x0];if(!_0x5ad3e7[_0xef63('0x56')][_0xef63('0x60')])return;return db['User'][_0xef63('0x57')]({'where':{'id':_0x5ad3e7[_0xef63('0x56')]['UserId'],'role':_0xef63('0x62')},'attributes':['id',_0xef63('0x39'),'fullname',_0xef63('0x74'),_0xef63('0x75')],'raw':!![]});}return null;})[_0xef63('0x36')](function(_0xadf0c1){if(!_0xadf0c1)return null;_0x5972c5[_0xef63('0x25')]['agent']=_0xadf0c1;return _0x5972c5;})[_0xef63('0x36')](function(_0x39617e){if(_0x39617e){if(_0x5ad3e7[_0xef63('0x56')]['manual']){_0x5972c5[_0xef63('0x25')][_0xef63('0x76')]=util['format']('SIP/%s',_0x5ad3e7[_0xef63('0x61')][_0xef63('0x39')]);_0x5972c5['message']['channel']=_0x5972c5[_0xef63('0x77')];_0x5972c5['message'][_0xef63('0x78')]=_0x5972c5[_0xef63('0x77')];_0x5972c5[_0xef63('0x25')][_0xef63('0x79')]=_0xef63('0x5b');return respondWithRpcPromise(_0xef63('0x7a'),_0xef63('0x7a'),{'event':_0xef63('0x7b'),'message':_0x5972c5[_0xef63('0x25')]},client9002)[_0xef63('0x36')](function(){return _0x5972c5;});}return _0x5972c5;}return null;})['then'](respondWithResult(_0x14442a,null))[_0xef63('0x28')](handleError(_0x14442a,null));};var interaction_log=require(_0xef63('0x16'))(_0xef63('0x5a'));exports[_0xef63('0x34')]=function(_0xec5750,_0x49bd1d,_0x1c7c6a){var _0x239d6a={'agent':{},'channel':_0xef63('0x5c')};if(_0xec5750[_0xef63('0x56')]['id']){delete _0xec5750[_0xef63('0x56')]['id'];}_0xec5750[_0xef63('0x56')][_0xef63('0x60')]=_0xec5750[_0xef63('0x56')]['UserId']||_0xec5750['user']['id'];_0x239d6a[_0xef63('0x62')]['id']=_0xec5750[_0xef63('0x56')][_0xef63('0x60')];return db['WhatsappMessage'][_0xef63('0x57')]({'where':{'id':_0xec5750[_0xef63('0x58')]['id'],'UserId':null}})[_0xef63('0x36')](handleEntityNotFound(_0x49bd1d,null))[_0xef63('0x36')](function(_0x222033){if(_0x222033){_0x239d6a[_0xef63('0x25')]=_0x222033[_0xef63('0x63')]({'plain':!![]});return db[_0xef63('0x64')][_0xef63('0x57')]({'where':{'id':_0x222033[_0xef63('0x65')]}});}return null;})[_0xef63('0x36')](handleEntityNotFound(_0x49bd1d,null))['then'](function(_0x27980c){if(_0x27980c){_0x239d6a['interaction']=_0x27980c['get']({'plain':!![]});interaction_log['info'](_0xef63('0x7c'),_0xec5750[_0xef63('0x61')]['id'],_0xec5750[_0xef63('0x61')][_0xef63('0x39')],_0xec5750['user']['role'],_0x239d6a[_0xef63('0x68')]['id'],_0xec5750[_0xef63('0x56')]?JSON['stringify'](_0xec5750[_0xef63('0x56')]):_0xef63('0x6b'));return respondWithRpcPromise('RejectMessage',_0xef63('0x7d'),_0x239d6a);}return null;})[_0xef63('0x36')](function(_0x5551e8){var _0x12dc64=_0xef63('0x6e')+_0x5551e8[_0xef63('0x25')][_0xef63('0x6f')];return db[_0xef63('0x70')][_0xef63('0x40')](_0x12dc64,{'type':db[_0xef63('0x71')][_0xef63('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x590f65){return _0x590f65;});})[_0xef63('0x36')](function(_0x2989a4){if(_0x2989a4){_0x239d6a[_0xef63('0x25')][_0xef63('0x73')]=_0x2989a4[0x0];if(!_0xec5750['body'][_0xef63('0x60')])return;return db['User'][_0xef63('0x57')]({'where':{'id':_0xec5750[_0xef63('0x56')][_0xef63('0x60')],'role':_0xef63('0x62')},'attributes':['id',_0xef63('0x39'),_0xef63('0x7e'),_0xef63('0x74'),_0xef63('0x75')],'raw':!![]});}return null;})[_0xef63('0x36')](function(_0xc27ed6){if(!_0xc27ed6)return null;_0x239d6a['message']['agent']=_0xc27ed6;return _0x239d6a;})[_0xef63('0x36')](function(_0x43a03f){if(_0x43a03f){_0x43a03f['message'][_0xef63('0x76')]=util['format'](_0xef63('0x7f'),_0xec5750['user']['name']);_0x43a03f[_0xef63('0x25')][_0xef63('0x77')]=_0x239d6a['channel'];_0x43a03f['message'][_0xef63('0x78')]=_0x239d6a[_0xef63('0x77')];_0x43a03f[_0xef63('0x25')][_0xef63('0x79')]=_0xef63('0x34');respondWithRpcPromise(_0xef63('0x7a'),_0xef63('0x7a'),{'event':_0xef63('0x80'),'message':_0x43a03f[_0xef63('0x25')]},client9002);return _0x239d6a;}return null;})[_0xef63('0x36')](respondWithResult(_0x49bd1d,null))[_0xef63('0x28')](handleError(_0x49bd1d,null));};exports[_0xef63('0x2a')]=function(_0x33f023,_0xc77bb4,_0x45dea9){if(_0x33f023[_0xef63('0x56')]['id']){delete _0x33f023[_0xef63('0x56')]['id'];}var _0x516e54;return db['WhatsappMessage'][_0xef63('0x57')]({'where':{'id':_0x33f023[_0xef63('0x58')]['id']}})[_0xef63('0x36')](handleEntityNotFound(_0xc77bb4,null))[_0xef63('0x36')](function(_0x59f3b8){if(_0x59f3b8){_0x516e54=_0x59f3b8;return db[_0xef63('0x81')][_0xef63('0x57')]({'where':{'id':_0x59f3b8[_0xef63('0x82')]}});}})[_0xef63('0x36')](handleEntityNotFound(_0xc77bb4,null))[_0xef63('0x36')](function(_0x8c623c){if(_0x8c623c){logger['debug'](_0xef63('0x83'),_0xef63('0x2a'),_0xef63('0x84'),_0x8c623c[_0xef63('0x85')],util['inspect'](_0x33f023['body'],{'showHidden':![],'depth':null}));switch(_0x8c623c['type']){case _0xef63('0x86'):if(_0x33f023[_0xef63('0x56')][_0xef63('0x87')]&&_0x33f023[_0xef63('0x56')]['MessageSid']===_0x516e54[_0xef63('0x88')]&&_0x33f023[_0xef63('0x56')][_0xef63('0x89')]&&_0x33f023[_0xef63('0x56')][_0xef63('0x89')]==='read'){return _0x516e54[_0xef63('0x35')]({'read':!![]});}else{logger[_0xef63('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xef63('0x86'),util[_0xef63('0x8a')](_0x33f023['body'],{'showHidden':![],'depth':null}));}break;}return _0x516e54;}})[_0xef63('0x36')](respondWithResult(_0xc77bb4,null))['catch'](handleError(_0xc77bb4,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x657b=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x657b,0x131));var _0xb657=function(_0x5cb559,_0x5d07ec){_0x5cb559=_0x5cb559-0x0;var _0x414e08=_0x657b[_0x5cb559];return _0x414e08;};'use strict';var EventEmitter=require(_0xb657('0x0'));var WhatsappMessage=require(_0xb657('0x1'))['db'][_0xb657('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb657('0x3')](0x0);var events={'afterCreate':_0xb657('0x4'),'afterUpdate':'update','afterDestroy':_0xb657('0x5')};function emitEvent(_0xa41497){return function(_0x5da1bc,_0x175072,_0x322e57){WhatsappMessageEvents[_0xb657('0x6')](_0xa41497+':'+_0x5da1bc['id'],_0x5da1bc);WhatsappMessageEvents[_0xb657('0x6')](_0xa41497,_0x5da1bc);_0x322e57(null);};}for(var e in events){if(events[_0xb657('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb657('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x6582=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove'];(function(_0x367fb6,_0x502a1a){var _0x1fa5dd=function(_0x22ef84){while(--_0x22ef84){_0x367fb6['push'](_0x367fb6['shift']());}};_0x1fa5dd(++_0x502a1a);}(_0x6582,0x108));var _0x2658=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x6582[_0x34232c];return _0x4d4f4e;};'use strict';var EventEmitter=require(_0x2658('0x0'));var WhatsappMessage=require(_0x2658('0x1'))['db'][_0x2658('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2658('0x3')](0x0);var events={'afterCreate':_0x2658('0x4'),'afterUpdate':'update','afterDestroy':_0x2658('0x5')};function emitEvent(_0x304ec5){return function(_0xd13472,_0x5b50cb,_0x4bf3c5){WhatsappMessageEvents['emit'](_0x304ec5+':'+_0xd13472['id'],_0xd13472);WhatsappMessageEvents[_0x2658('0x6')](_0x304ec5,_0xd13472);_0x4bf3c5(null);};}for(var e in events){if(events[_0x2658('0x7')](e)){var event=events[e];WhatsappMessage[_0x2658('0x8')](e,emitEvent(event));}}module[_0x2658('0x9')]=WhatsappMessageEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7564=['exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','get','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','direction','catch','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','body','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','node-fetch','path','rimraf','../../config/environment'];(function(_0x42d0b5,_0x1fdfa5){var _0x9dfb43=function(_0x57b6d0){while(--_0x57b6d0){_0x42d0b5['push'](_0x42d0b5['shift']());}};_0x9dfb43(++_0x1fdfa5);}(_0x7564,0xaa));var _0x4756=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x7564[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x4756('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4756('0x1'));var BPromise=require('bluebird');var rp=require(_0x4756('0x2'));var fetch=require(_0x4756('0x3'));var fs=require('fs');var path=require(_0x4756('0x4'));var rimraf=require(_0x4756('0x5'));var config=require(_0x4756('0x6'));var attributes=require('./whatsappMessage.attributes');module[_0x4756('0x7')]=function(_0x5bd7fd,_0x2e6628){return _0x5bd7fd[_0x4756('0x8')](_0x4756('0x9'),attributes,{'tableName':_0x4756('0xa'),'paranoid':![],'indexes':[{'name':_0x4756('0xb'),'fields':['messageId']},{'name':_0x4756('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x295eb7,_0x6f387e,_0x407bba){var _0x5207ee=_0x5bd7fd['models'];var _0x4c10b6=_0x295eb7[_0x4756('0xd')]({'plain':!![]});if(_0x4c10b6['direction'][_0x4756('0xe')]()==='in'||_0x4c10b6['direction'][_0x4756('0xe')]()===_0x4756('0xf')&&!_0x4c10b6['secret']&&!_[_0x4756('0x10')](_0x4c10b6['UserId'])){_0x5207ee[_0x4756('0x11')][_0x4756('0x12')]({'where':{'id':_0x4c10b6[_0x4756('0x13')]}})[_0x4756('0x14')](function(_0x1dff5a){if(_0x1dff5a){_0x1dff5a[_0x4756('0x15')]({'lastMsgAt':_0x4c10b6[_0x4756('0x16')],'lastMsgDirection':_0x4c10b6[_0x4756('0x17')][_0x4756('0xe')]()});}})[_0x4756('0x18')](function(_0x54fb63){console['error'](_0x54fb63);});}if(_0x4c10b6[_0x4756('0x17')]===_0x4756('0xf')&&!_0x4c10b6[_0x4756('0x19')]){var _0x504a79;_0x5207ee[_0x4756('0x1a')]['find']({'where':{'id':_0x4c10b6[_0x4756('0x1b')]},'raw':!![]})['then'](function(_0x7c1759){_0x504a79=_0x7c1759;if(_0x504a79&&_0x504a79[_0x4756('0x1c')]){switch(_0x504a79[_0x4756('0x1c')]){case _0x4756('0x1d'):var _0x2e8a49=require(_0x4756('0x1d'));if(_0x504a79[_0x4756('0x1e')]&&_0x504a79[_0x4756('0x1f')]&&_0x504a79[_0x4756('0x20')]){var _0x2c13b3=new _0x2e8a49(_0x504a79[_0x4756('0x1e')],_0x504a79['authToken']);_0x2c13b3[_0x4756('0x21')][_0x4756('0x22')]({'body':_0x4c10b6['body'],'to':_0x4756('0x23')+_0x4c10b6['phone'],'from':'whatsapp:'+_0x504a79[_0x4756('0x20')],'statusCallback':_0x504a79[_0x4756('0x24')]+_0x4756('0x25')+_0x4c10b6['id']+_0x4756('0x26')+_0x504a79[_0x4756('0x27')]})[_0x4756('0x14')](function(_0x5daea7){if(_0x5daea7['sid']){return _0x295eb7['update']({'messageId':_0x5daea7[_0x4756('0x28')]});}})[_0x4756('0x18')](function(_0xb1d19b){logger['error'](_0x4756('0x29'),_0x4756('0x2a'),_0x4756('0x1d'),util[_0x4756('0x2b')](_0xb1d19b,{'showHidden':![],'depth':null}));});}else{logger[_0x4756('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x4756('0x2d'));}break;case _0x4756('0x2e'):var _0x4aaaf8=_0x504a79[_0x4756('0x1e')];var _0x181f69=_0x504a79[_0x4756('0x1f')];var _0x5a98da=_0x504a79['baseUrl']+_0x4756('0x2f')+_0x4aaaf8+_0x4756('0x30');var _0x3ff88b={'to':[_0x4c10b6[_0x4756('0x20')]],'message':{'type':'text','text':_0x4c10b6[_0x4756('0x31')]}};var _0x13c70f={'method':_0x4756('0x32'),'uri':_0x5a98da,'headers':{'Authorization':_0x4756('0x33')+_0x181f69,'Content-Type':_0x4756('0x34')},'body':_0x3ff88b,'json':!![]};rp(_0x13c70f)['then'](function(_0x2c6297){if(_0x2c6297[_0x4756('0x35')][0x0][_0x4756('0x36')]){return _0x295eb7[_0x4756('0x15')]({'messageId':_0x2c6297['statuses'][0x0][_0x4756('0x36')]});}})[_0x4756('0x18')](function(_0x29ed2b){logger[_0x4756('0x37')]('WhatsappMessage,\x20%s',_0x29ed2b);});break;}}})[_0x4756('0x38')](function(){_0x407bba();});}else{_0x407bba();}}},'charset':_0x4756('0x39'),'collate':_0x4756('0x3a')});};
\ No newline at end of file
+var _0x16a6=['exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','WhatsappInteractionId','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','body','remote','/api/whatsapp/messages/','token','then','update','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','node-fetch','rimraf'];(function(_0x603c54,_0x465796){var _0x584039=function(_0xc0198b){while(--_0xc0198b){_0x603c54['push'](_0x603c54['shift']());}};_0x584039(++_0x465796);}(_0x16a6,0x14e));var _0x616a=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x16a6[_0xd63e3a];return _0x19c178;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var logger=require(_0x616a('0x2'))(_0x616a('0x3'));var moment=require(_0x616a('0x4'));var BPromise=require(_0x616a('0x5'));var rp=require('request-promise');var fetch=require(_0x616a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x616a('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x616a('0x8')]=function(_0x54ba7d,_0x39c8da){return _0x54ba7d[_0x616a('0x9')](_0x616a('0xa'),attributes,{'tableName':_0x616a('0xb'),'paranoid':![],'indexes':[{'name':_0x616a('0xc'),'fields':[_0x616a('0xc')]},{'name':_0x616a('0xd'),'fields':['body'],'type':_0x616a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x386da3,_0x1f449e,_0x3869a2){var _0x46d68a=_0x54ba7d[_0x616a('0xf')];var _0x4f4573=_0x386da3[_0x616a('0x10')]({'plain':!![]});if(_0x4f4573[_0x616a('0x11')][_0x616a('0x12')]()==='in'||_0x4f4573['direction'][_0x616a('0x12')]()===_0x616a('0x13')&&!_0x4f4573['secret']&&!_[_0x616a('0x14')](_0x4f4573[_0x616a('0x15')])){_0x46d68a['WhatsappInteraction'][_0x616a('0x16')]({'where':{'id':_0x4f4573[_0x616a('0x17')]}})['then'](function(_0x181b57){if(_0x181b57){_0x181b57['update']({'lastMsgAt':_0x4f4573[_0x616a('0x18')],'lastMsgDirection':_0x4f4573[_0x616a('0x11')][_0x616a('0x12')]()});}})[_0x616a('0x19')](function(_0x19d8a7){console[_0x616a('0x1a')](_0x19d8a7);});}if(_0x4f4573[_0x616a('0x11')]===_0x616a('0x13')&&!_0x4f4573['secret']){var _0x3839c6;_0x46d68a[_0x616a('0x1b')]['find']({'where':{'id':_0x4f4573[_0x616a('0x1c')]},'raw':!![]})['then'](function(_0x3ae78b){_0x3839c6=_0x3ae78b;if(_0x3839c6&&_0x3839c6['type']){switch(_0x3839c6[_0x616a('0x1d')]){case _0x616a('0x1e'):var _0x13c107=require(_0x616a('0x1e'));if(_0x3839c6[_0x616a('0x1f')]&&_0x3839c6[_0x616a('0x20')]&&_0x3839c6[_0x616a('0x21')]){var _0x34241b=new _0x13c107(_0x3839c6[_0x616a('0x1f')],_0x3839c6[_0x616a('0x20')]);_0x34241b[_0x616a('0x22')]['create']({'body':_0x4f4573[_0x616a('0x23')],'to':'whatsapp:'+_0x4f4573[_0x616a('0x21')],'from':'whatsapp:'+_0x3839c6[_0x616a('0x21')],'statusCallback':_0x3839c6[_0x616a('0x24')]+_0x616a('0x25')+_0x4f4573['id']+'/status?token='+_0x3839c6[_0x616a('0x26')]})[_0x616a('0x27')](function(_0x2f4576){if(_0x2f4576['sid']){return _0x386da3[_0x616a('0x28')]({'messageId':_0x2f4576[_0x616a('0x29')]});}})['catch'](function(_0x13349b){logger[_0x616a('0x1a')](_0x616a('0x2a'),'afterCreate',_0x616a('0x1e'),util['inspect'](_0x13349b,{'showHidden':![],'depth':null}));});}else{logger[_0x616a('0x1a')](_0x616a('0x2a'),_0x616a('0x2b'),_0x616a('0x1e'),_0x616a('0x2c'));}break;case _0x616a('0x2d'):var _0x364c25=_0x3839c6[_0x616a('0x1f')];var _0x1f219c=_0x3839c6['authToken'];var _0x4e5e1f=_0x3839c6['baseUrl']+_0x616a('0x2e')+_0x364c25+_0x616a('0x2f');var _0x3e14fa={'to':[_0x4f4573[_0x616a('0x21')]],'message':{'type':_0x616a('0x30'),'text':_0x4f4573[_0x616a('0x23')]}};var _0xc5884c={'method':_0x616a('0x31'),'uri':_0x4e5e1f,'headers':{'Authorization':_0x616a('0x32')+_0x1f219c,'Content-Type':_0x616a('0x33')},'body':_0x3e14fa,'json':!![]};rp(_0xc5884c)['then'](function(_0x1875a6){if(_0x1875a6[_0x616a('0x34')][0x0][_0x616a('0x35')]){return _0x386da3[_0x616a('0x28')]({'messageId':_0x1875a6['statuses'][0x0]['message_id']});}})[_0x616a('0x19')](function(_0x4c6903){logger[_0x616a('0x36')]('WhatsappMessage,\x20%s',_0x4c6903);});break;}}})['finally'](function(){_0x3869a2();});}else{_0x3869a2();}}},'charset':_0x616a('0x37'),'collate':_0x616a('0x38')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5553=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5553,0xa6));var _0x3555=function(_0x3fbd49,_0x3974f5){_0x3fbd49=_0x3fbd49-0x0;var _0xf0fbd4=_0x5553[_0x3fbd49];return _0xf0fbd4;};'use strict';var _=require(_0x3555('0x0'));var util=require('util');var moment=require(_0x3555('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(_0x3555('0x2'));var logger=require(_0x3555('0x3'))('rpc');var config=require(_0x3555('0x4'));var jayson=require(_0x3555('0x5'));var client=jayson[_0x3555('0x6')][_0x3555('0x7')]({'port':0x232a});config[_0x3555('0x8')]=_[_0x3555('0x9')](config[_0x3555('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3555('0xa'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x3555('0xb')](socket);function respondWithRpcPromise(_0x388fab,_0x19380a,_0x2da8bc){return new BPromise(function(_0x2a4619,_0x31d0c2){return client[_0x3555('0xc')](_0x388fab,_0x2da8bc)[_0x3555('0xd')](function(_0x240813){logger['info'](_0x3555('0xe'),_0x19380a,_0x3555('0xf'));logger[_0x3555('0x10')](_0x3555('0x11'),_0x19380a,_0x3555('0xf'),JSON[_0x3555('0x12')](_0x240813));if(_0x240813['error']){if(_0x240813['error'][_0x3555('0x13')]===0x1f4){logger[_0x3555('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x19380a,_0x240813[_0x3555('0x14')]['message']);return _0x31d0c2(_0x240813[_0x3555('0x14')]['message']);}logger[_0x3555('0x14')](_0x3555('0xe'),_0x19380a,_0x240813['error'][_0x3555('0x15')]);return _0x2a4619(_0x240813[_0x3555('0x14')]['message']);}else{logger[_0x3555('0x16')](_0x3555('0xe'),_0x19380a,'request\x20sent');_0x2a4619(_0x240813[_0x3555('0x17')]['message']);}})[_0x3555('0x18')](function(_0x357e8b){logger[_0x3555('0x14')](_0x3555('0xe'),_0x19380a,_0x357e8b);_0x31d0c2(_0x357e8b);});});}exports[_0x3555('0x19')]=function(_0x31088e){var _0x5bc2df=this;return new Promise(function(_0x22688a,_0x29328b){return db[_0x3555('0x1a')]['create'](_0x31088e[_0x3555('0x1b')],{'raw':_0x31088e[_0x3555('0x1c')]?_0x31088e[_0x3555('0x1c')][_0x3555('0x1d')]===undefined?!![]:![]:!![]})[_0x3555('0xd')](function(_0x2c61f1){logger[_0x3555('0x16')]('CreateWhatsappMessage',_0x31088e);logger[_0x3555('0x10')]('CreateWhatsappMessage',_0x31088e,JSON[_0x3555('0x12')](_0x2c61f1));_0x22688a(_0x2c61f1);})[_0x3555('0x18')](function(_0x91866c){logger['error'](_0x3555('0x19'),_0x91866c[_0x3555('0x15')],_0x31088e);_0x29328b(_0x5bc2df['error'](0x1f4,_0x91866c[_0x3555('0x15')]));});});};
\ No newline at end of file
+var _0x299a=['lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body','options','then','CreateWhatsappMessage','catch'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x299a,0x108));var _0xa299=function(_0x9d9843,_0x2c8703){_0x9d9843=_0x9d9843-0x0;var _0x65594f=_0x299a[_0x9d9843];return _0x65594f;};'use strict';var _=require(_0xa299('0x0'));var util=require(_0xa299('0x1'));var moment=require('moment');var BPromise=require(_0xa299('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa299('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa299('0x4'));var logger=require(_0xa299('0x5'))('rpc');var config=require(_0xa299('0x6'));var jayson=require(_0xa299('0x7'));var client=jayson[_0xa299('0x8')][_0xa299('0x9')]({'port':0x232a});config['redis']=_[_0xa299('0xa')](config[_0xa299('0xb')],{'host':_0xa299('0xc'),'port':0x18eb});var socket=require(_0xa299('0xd'))(new Redis(config[_0xa299('0xb')]));require(_0xa299('0xe'))[_0xa299('0xf')](socket);function respondWithRpcPromise(_0x1edfae,_0x384815,_0x15259d){return new BPromise(function(_0x185f32,_0x128e61){return client[_0xa299('0x10')](_0x1edfae,_0x15259d)['then'](function(_0x3e59cc){logger[_0xa299('0x11')](_0xa299('0x12'),_0x384815,_0xa299('0x13'));logger[_0xa299('0x14')](_0xa299('0x15'),_0x384815,_0xa299('0x13'),JSON[_0xa299('0x16')](_0x3e59cc));if(_0x3e59cc[_0xa299('0x17')]){if(_0x3e59cc['error'][_0xa299('0x18')]===0x1f4){logger[_0xa299('0x17')](_0xa299('0x12'),_0x384815,_0x3e59cc[_0xa299('0x17')]['message']);return _0x128e61(_0x3e59cc[_0xa299('0x17')]['message']);}logger[_0xa299('0x17')](_0xa299('0x12'),_0x384815,_0x3e59cc[_0xa299('0x17')][_0xa299('0x19')]);return _0x185f32(_0x3e59cc['error']['message']);}else{logger[_0xa299('0x11')](_0xa299('0x12'),_0x384815,_0xa299('0x13'));_0x185f32(_0x3e59cc[_0xa299('0x1a')][_0xa299('0x19')]);}})['catch'](function(_0x188865){logger[_0xa299('0x17')](_0xa299('0x12'),_0x384815,_0x188865);_0x128e61(_0x188865);});});}exports['CreateWhatsappMessage']=function(_0xa67e12){var _0x1d2958=this;return new Promise(function(_0x251feb,_0x97790c){return db['WhatsappMessage'][_0xa299('0x1b')](_0xa67e12[_0xa299('0x1c')],{'raw':_0xa67e12[_0xa299('0x1d')]?_0xa67e12[_0xa299('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xa299('0x1e')](function(_0x594d1a){logger[_0xa299('0x11')](_0xa299('0x1f'),_0xa67e12);logger['debug'](_0xa299('0x1f'),_0xa67e12,JSON[_0xa299('0x16')](_0x594d1a));_0x251feb(_0x594d1a);})[_0xa299('0x20')](function(_0x46b6e0){logger[_0xa299('0x17')](_0xa299('0x1f'),_0x46b6e0[_0xa299('0x19')],_0xa67e12);_0x97790c(_0x1d2958['error'](0x1f4,_0x46b6e0[_0xa299('0x19')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b5d=['./whatsappMessage.events','save','update','emit','removeListener','register','length'];(function(_0x427bd4,_0x4c2aa2){var _0x46c675=function(_0x109076){while(--_0x109076){_0x427bd4['push'](_0x427bd4['shift']());}};_0x46c675(++_0x4c2aa2);}(_0x5b5d,0x1dc));var _0xd5b5=function(_0x460e12,_0x335b3f){_0x460e12=_0x460e12-0x0;var _0x367951=_0x5b5d[_0x460e12];return _0x367951;};'use strict';var WhatsappMessageEvents=require(_0xd5b5('0x0'));var events=[_0xd5b5('0x1'),'remove',_0xd5b5('0x2')];function createListener(_0x1f6ca8,_0x4dec38){return function(_0x1f71e6){_0x4dec38[_0xd5b5('0x3')](_0x1f6ca8,_0x1f71e6);};}function removeListener(_0x4daca2,_0x4a9c5a){return function(){WhatsappMessageEvents[_0xd5b5('0x4')](_0x4daca2,_0x4a9c5a);};}exports[_0xd5b5('0x5')]=function(_0x351f75){for(var _0x15080a=0x0,_0x44934d=events[_0xd5b5('0x6')];_0x15080a<_0x44934d;_0x15080a++){var _0x2136d4=events[_0x15080a];var _0x4d5d4d=createListener('whatsappMessage:'+_0x2136d4,_0x351f75);WhatsappMessageEvents['on'](_0x2136d4,_0x4d5d4d);}};
\ No newline at end of file
+var _0xddb5=['whatsappMessage:','./whatsappMessage.events','remove','update','removeListener'];(function(_0x3d32d6,_0x25c147){var _0x3db593=function(_0x5d903b){while(--_0x5d903b){_0x3d32d6['push'](_0x3d32d6['shift']());}};_0x3db593(++_0x25c147);}(_0xddb5,0x10f));var _0x5ddb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xddb5[_0x17d9e3];return _0x14192d;};'use strict';var WhatsappMessageEvents=require(_0x5ddb('0x0'));var events=['save',_0x5ddb('0x1'),_0x5ddb('0x2')];function createListener(_0x1ad54b,_0x2f4541){return function(_0x497ff7){_0x2f4541['emit'](_0x1ad54b,_0x497ff7);};}function removeListener(_0x961a49,_0x1fb646){return function(){WhatsappMessageEvents[_0x5ddb('0x3')](_0x961a49,_0x1fb646);};}exports['register']=function(_0x4c8a12){for(var _0x162a98=0x0,_0x204424=events['length'];_0x162a98<_0x204424;_0x162a98++){var _0x201aad=events[_0x162a98];var _0x58a580=createListener(_0x5ddb('0x4')+_0x201aad,_0x4c8a12);WhatsappMessageEvents['on'](_0x201aad,_0x58a580);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc718=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc718,0x1e9));var _0x8c71=function(_0x3b9388,_0xc4ab13){_0x3b9388=_0x3b9388-0x0;var _0x3d82d2=_0xc718[_0x3b9388];return _0x3d82d2;};'use strict';var multer=require(_0x8c71('0x0'));var util=require(_0x8c71('0x1'));var path=require(_0x8c71('0x2'));var timeout=require(_0x8c71('0x3'));var express=require('express');var router=express[_0x8c71('0x4')]();var fs_extra=require(_0x8c71('0x5'));var auth=require(_0x8c71('0x6'));var interaction=require(_0x8c71('0x7'));var config=require(_0x8c71('0x8'));var controller=require('./whatsappQueue.controller');router[_0x8c71('0x9')]('/',auth[_0x8c71('0xa')](),controller[_0x8c71('0xb')]);router['get'](_0x8c71('0xc'),auth['isAuthenticated'](),controller[_0x8c71('0xd')]);router[_0x8c71('0x9')](_0x8c71('0xe'),auth['isAuthenticated'](),controller[_0x8c71('0xf')]);router[_0x8c71('0x9')](_0x8c71('0x10'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x11')]);router['get'](_0x8c71('0x12'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x13')]);router['get'](_0x8c71('0x14'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x15')]);router[_0x8c71('0x16')]('/',auth[_0x8c71('0xa')](),controller['create']);router[_0x8c71('0x16')]('/:id/teams',auth[_0x8c71('0xa')](),controller[_0x8c71('0x17')]);router['post'](_0x8c71('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x8c71('0x18')](_0x8c71('0xe'),auth['isAuthenticated'](),controller[_0x8c71('0x19')]);router[_0x8c71('0x1a')](_0x8c71('0xe'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x1b')]);router['delete'](_0x8c71('0x12'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x1c')]);router[_0x8c71('0x1a')](_0x8c71('0x14'),auth[_0x8c71('0xa')](),controller[_0x8c71('0x1d')]);module[_0x8c71('0x1e')]=router;
\ No newline at end of file
+var _0x01c9=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x3ce533,_0xeec953){var _0x1f5235=function(_0xcea720){while(--_0xcea720){_0x3ce533['push'](_0x3ce533['shift']());}};_0x1f5235(++_0xeec953);}(_0x01c9,0x7f));var _0x901c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x01c9[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x901c('0x0'));var util=require(_0x901c('0x1'));var path=require(_0x901c('0x2'));var timeout=require('connect-timeout');var express=require(_0x901c('0x3'));var router=express[_0x901c('0x4')]();var fs_extra=require(_0x901c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x901c('0x6'));var config=require(_0x901c('0x7'));var controller=require(_0x901c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x901c('0x9')]);router[_0x901c('0xa')](_0x901c('0xb'),auth[_0x901c('0xc')](),controller[_0x901c('0xd')]);router[_0x901c('0xa')](_0x901c('0xe'),auth[_0x901c('0xc')](),controller[_0x901c('0xf')]);router['get'](_0x901c('0x10'),auth[_0x901c('0xc')](),controller[_0x901c('0x11')]);router[_0x901c('0xa')](_0x901c('0x12'),auth[_0x901c('0xc')](),controller[_0x901c('0x13')]);router[_0x901c('0xa')](_0x901c('0x14'),auth[_0x901c('0xc')](),controller[_0x901c('0x15')]);router[_0x901c('0x16')]('/',auth[_0x901c('0xc')](),controller[_0x901c('0x17')]);router[_0x901c('0x16')](_0x901c('0x12'),auth[_0x901c('0xc')](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x901c('0x18')]);router[_0x901c('0x19')](_0x901c('0xe'),auth[_0x901c('0xc')](),controller[_0x901c('0x1a')]);router[_0x901c('0x1b')](_0x901c('0xe'),auth[_0x901c('0xc')](),controller[_0x901c('0x1c')]);router[_0x901c('0x1b')](_0x901c('0x12'),auth[_0x901c('0xc')](),controller[_0x901c('0x1d')]);router[_0x901c('0x1b')]('/:id/users',auth[_0x901c('0xc')](),controller[_0x901c('0x1e')]);module[_0x901c('0x1f')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa101=['STRING','sequelize','exports','name','INTEGER','rrmemory','beepall'];(function(_0x186591,_0x4b9f84){var _0x52353b=function(_0x16105a){while(--_0x16105a){_0x186591['push'](_0x186591['shift']());}};_0x52353b(++_0x4b9f84);}(_0xa101,0x15f));var _0x1a10=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0xa101[_0x2b1551];return _0x2fc2a1;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1a10('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1a10('0x4'),_0x1a10('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x1a10('0x6')]}};
\ No newline at end of file
+var _0x5825=['roundrobin','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5825,0x78));var _0x5582=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5825[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5582('0x0'));module[_0x5582('0x1')]={'name':{'type':Sequelize[_0x5582('0x2')],'unique':_0x5582('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5582('0x4')]('rrmemory',_0x5582('0x5'),_0x5582('0x6'))},'description':{'type':Sequelize[_0x5582('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfebf=['length','includeAll','options','find','catch','create','body','user','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappQueueId','filter','merge','map','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','findAll','Agents','online','voicePause','sequelize','transaction','addTeams','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','status','offset','limit','count','json','update','then','get','WhatsappQueues','destroy','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','params','model','keys','filters','intersection','attributes','fields'];(function(_0xf30c64,_0x37a900){var _0x36287d=function(_0x285927){while(--_0x285927){_0xf30c64['push'](_0xf30c64['shift']());}};_0x36287d(++_0x37a900);}(_0xfebf,0x13c));var _0xffeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebf[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xffeb('0x0'));var util=require(_0xffeb('0x1'));var _=require(_0xffeb('0x2'));var squel=require(_0xffeb('0x3'));var Redis=require(_0xffeb('0x4'));var qs=require(_0xffeb('0x5'));var logger=require(_0xffeb('0x6'))(_0xffeb('0x7'));var config=require(_0xffeb('0x8'));var db=require(_0xffeb('0x9'))['db'];config[_0xffeb('0xa')]=_[_0xffeb('0xb')](config['redis'],{'host':_0xffeb('0xc'),'port':0x18eb});var socket=require(_0xffeb('0xd'))(new Redis(config[_0xffeb('0xa')]));require(_0xffeb('0xe'))['register'](socket);function respondWithStatusCode(_0xf4f2c5,_0x23fc87){_0x23fc87=_0x23fc87||0xcc;return function(_0x2df920){if(_0x2df920){return _0xf4f2c5[_0xffeb('0xf')](_0x23fc87);}return _0xf4f2c5['status'](_0x23fc87)[_0xffeb('0x10')]();};}function respondWithResult(_0x1c6886,_0x297827){_0x297827=_0x297827||0xc8;return function(_0x3e89fe){if(_0x3e89fe){return _0x1c6886[_0xffeb('0x11')](_0x297827)['json'](_0x3e89fe);}};}function respondWithFilteredResult(_0x425823,_0x5b1c48){return function(_0x55b76b){if(_0x55b76b){var _0x4c46df=typeof _0x5b1c48[_0xffeb('0x12')]==='undefined'&&typeof _0x5b1c48[_0xffeb('0x13')]==='undefined';var _0x4ced07=_0x55b76b[_0xffeb('0x14')];var _0x542d8a=_0x4c46df?0x0:_0x5b1c48[_0xffeb('0x12')];var _0x2fa43a=_0x4c46df?_0x55b76b[_0xffeb('0x14')]:_0x5b1c48[_0xffeb('0x12')]+_0x5b1c48[_0xffeb('0x13')];var _0x3ce8c4;if(_0x2fa43a>=_0x4ced07){_0x2fa43a=_0x4ced07;_0x3ce8c4=0xc8;}else{_0x3ce8c4=0xce;}_0x425823[_0xffeb('0x11')](_0x3ce8c4);return _0x425823['set']('Content-Range',_0x542d8a+'-'+_0x2fa43a+'/'+_0x4ced07)[_0xffeb('0x15')](_0x55b76b);}return null;};}function saveUpdates(_0x442d59){return function(_0x5d02c9){if(_0x5d02c9){return _0x5d02c9[_0xffeb('0x16')](_0x442d59)[_0xffeb('0x17')](function(_0x383129){return _0x383129;});}return null;};}function removeEntity(_0x53f453){return function(_0x219c0c){if(_0x219c0c){return _0x219c0c['destroy']()[_0xffeb('0x17')](function(){var _0x309ca2=_0x219c0c[_0xffeb('0x18')]({'plain':!![]});var _0x46b951=_0xffeb('0x19');return db['UserProfileResource'][_0xffeb('0x1a')]({'where':{'type':_0x46b951,'resourceId':_0x309ca2['id']}})[_0xffeb('0x17')](function(){return _0x219c0c;});})[_0xffeb('0x17')](function(){_0x53f453['status'](0xcc)[_0xffeb('0x10')]();});}};}function handleEntityNotFound(_0x3ae3e4){return function(_0x125ccc){if(!_0x125ccc){_0x3ae3e4['sendStatus'](0x194);}return _0x125ccc;};}function handleError(_0x35488e,_0x3f7f6d){_0x3f7f6d=_0x3f7f6d||0x1f4;return function(_0x28dc56){logger['error'](_0x28dc56[_0xffeb('0x1b')]);if(_0x28dc56[_0xffeb('0x1c')]){delete _0x28dc56['name'];}_0x35488e['status'](_0x3f7f6d)[_0xffeb('0x1d')](_0x28dc56);};}exports[_0xffeb('0x1e')]=function(_0x3bfd6e,_0x32967c){var _0xcbed19={};var _0x2fad60={'count':0x0,'rows':[]};var _0x75b760=_['map'](db[_0xffeb('0x1f')][_0xffeb('0x20')],function(_0x36ba8a){return{'name':_0x36ba8a[_0xffeb('0x21')],'type':_0x36ba8a[_0xffeb('0x22')][_0xffeb('0x23')]};});_0xcbed19=qs[_0xffeb('0x24')](_0x75b760,_0x3bfd6e);var _0x3afbc9={'where':_0xcbed19['where']};return db[_0xffeb('0x1f')][_0xffeb('0x14')](_0x3afbc9)[_0xffeb('0x17')](function(_0x249283){_0x2fad60['count']=_0x249283;_0xcbed19[_0xffeb('0x25')]=qs['include'](_0x3bfd6e[_0xffeb('0x26')]);return db[_0xffeb('0x1f')]['findAll'](_0xcbed19);})[_0xffeb('0x17')](function(_0x2d6247){_0x2fad60[_0xffeb('0x27')]=_0x2d6247;return _0x2fad60;})[_0xffeb('0x17')](respondWithFilteredResult(_0x32967c,_0xcbed19))['catch'](handleError(_0x32967c,null));};exports['show']=function(_0x20a623,_0x30534c){var _0x293d8d={'raw':!![],'where':{'id':_0x20a623[_0xffeb('0x28')]['id']}},_0x162dc1={};_0x162dc1[_0xffeb('0x29')]=_[_0xffeb('0x2a')](db[_0xffeb('0x1f')][_0xffeb('0x20')]);_0x162dc1['query']=_['keys'](_0x20a623[_0xffeb('0x26')]);_0x162dc1[_0xffeb('0x2b')]=_[_0xffeb('0x2c')](_0x162dc1['model'],_0x162dc1[_0xffeb('0x26')]);_0x293d8d[_0xffeb('0x2d')]=_['intersection'](_0x162dc1['model'],qs[_0xffeb('0x2e')](_0x20a623[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x293d8d[_0xffeb('0x2d')]=_0x293d8d[_0xffeb('0x2d')][_0xffeb('0x2f')]?_0x293d8d[_0xffeb('0x2d')]:_0x162dc1[_0xffeb('0x29')];if(_0x20a623[_0xffeb('0x26')][_0xffeb('0x30')]){_0x293d8d[_0xffeb('0x25')]=[{'all':!![]}];}_0x293d8d=_['merge']({},_0x293d8d,_0x20a623[_0xffeb('0x31')]);return db[_0xffeb('0x1f')][_0xffeb('0x32')](_0x293d8d)[_0xffeb('0x17')](handleEntityNotFound(_0x30534c,null))[_0xffeb('0x17')](respondWithResult(_0x30534c,null))[_0xffeb('0x33')](handleError(_0x30534c,null));};exports['create']=function(_0x224db9,_0x2e27b2){return db[_0xffeb('0x1f')][_0xffeb('0x34')](_0x224db9[_0xffeb('0x35')],{})[_0xffeb('0x17')](function(_0x275d43){var _0x337cb2=_0x224db9[_0xffeb('0x36')][_0xffeb('0x18')]({'plain':!![]});if(!_0x337cb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x337cb2[_0xffeb('0x37')]===_0xffeb('0x36')){var _0x512e01=_0x275d43['get']({'plain':!![]});var _0x1e0b46=_0xffeb('0x19');return db['UserProfileSection'][_0xffeb('0x32')]({'where':{'name':_0x1e0b46,'userProfileId':_0x337cb2['userProfileId']},'raw':!![]})['then'](function(_0x5a498a){if(_0x5a498a&&_0x5a498a[_0xffeb('0x38')]===0x0){return db[_0xffeb('0x39')][_0xffeb('0x34')]({'name':_0x512e01[_0xffeb('0x1c')],'resourceId':_0x512e01['id'],'type':_0x5a498a[_0xffeb('0x1c')],'sectionId':_0x5a498a['id']},{})[_0xffeb('0x17')](function(){return _0x275d43;});}else{return _0x275d43;}})['catch'](function(_0x373cb4){logger[_0xffeb('0x3a')](_0xffeb('0x3b'),_0x373cb4);throw _0x373cb4;});}return _0x275d43;})[_0xffeb('0x17')](respondWithResult(_0x2e27b2,0xc9))['catch'](handleError(_0x2e27b2,null));};exports['update']=function(_0x2f1004,_0x3059a6){if(_0x2f1004[_0xffeb('0x35')]['id']){delete _0x2f1004['body']['id'];}return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0x2f1004[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x3059a6,null))['then'](saveUpdates(_0x2f1004[_0xffeb('0x35')],null))[_0xffeb('0x17')](respondWithResult(_0x3059a6,null))[_0xffeb('0x33')](handleError(_0x3059a6,null));};exports['destroy']=function(_0x4b5f54,_0x41dfdd){return db['WhatsappQueue'][_0xffeb('0x32')]({'where':{'id':_0x4b5f54[_0xffeb('0x28')]['id']}})['then'](handleEntityNotFound(_0x41dfdd,null))[_0xffeb('0x17')](removeEntity(_0x41dfdd,null))[_0xffeb('0x33')](handleError(_0x41dfdd,null));};exports['describe']=function(_0x59ba54,_0x53450f){return db['WhatsappQueue'][_0xffeb('0x3c')]()[_0xffeb('0x17')](respondWithResult(_0x53450f,null))[_0xffeb('0x33')](handleError(_0x53450f,null));};exports[_0xffeb('0x3d')]=function(_0x37ffd7,_0x4bf2a3){var _0x42b524={'raw':!![],'where':{}},_0x366d16={},_0x17394c;return db[_0xffeb('0x1f')][_0xffeb('0x3e')]({'where':{'id':_0x37ffd7[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x4bf2a3,null))[_0xffeb('0x17')](function(_0x33a0b1){if(_0x33a0b1){_0x17394c=_0x33a0b1[_0xffeb('0x18')]({'plain':!![]});_0x366d16[_0xffeb('0x29')]=_['keys'](db[_0xffeb('0x3f')]['rawAttributes']);_0x366d16[_0xffeb('0x26')]=_[_0xffeb('0x2a')](_0x37ffd7[_0xffeb('0x26')]);_0x366d16[_0xffeb('0x2b')]=_[_0xffeb('0x2c')](_0x366d16['model'],_0x366d16[_0xffeb('0x26')]);_0x42b524[_0xffeb('0x2d')]=_[_0xffeb('0x2c')](_0x366d16['model'],qs[_0xffeb('0x2e')](_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x42b524[_0xffeb('0x2d')]=_0x42b524[_0xffeb('0x2d')]['length']?_0x42b524[_0xffeb('0x2d')]:_0x366d16[_0xffeb('0x29')];if(!_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x40')](_0xffeb('0x41'))){_0x42b524[_0xffeb('0x13')]=qs[_0xffeb('0x13')](_0x37ffd7['query'][_0xffeb('0x13')]);_0x42b524[_0xffeb('0x12')]=qs[_0xffeb('0x12')](_0x37ffd7['query']['offset']);}_0x42b524[_0xffeb('0x42')]=qs['sort'](_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x43')]);_0x42b524[_0xffeb('0x44')]=qs[_0xffeb('0x2b')](_[_0xffeb('0x45')](_0x37ffd7['query'],_0x366d16['filters']));_0x42b524['where'][_0xffeb('0x46')]=_0x33a0b1['id'];if(_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x47')]){_0x42b524['where']=_[_0xffeb('0x48')](_0x42b524[_0xffeb('0x44')],{'$or':_[_0xffeb('0x49')](_0x42b524[_0xffeb('0x2d')],function(_0x23a10e){var _0x577105={};_0x577105[_0x23a10e]={'$like':'%'+_0x37ffd7[_0xffeb('0x26')][_0xffeb('0x47')]+'%'};return _0x577105;})});}_0x42b524=_[_0xffeb('0x48')]({},_0x42b524,_0x37ffd7[_0xffeb('0x31')]);return db[_0xffeb('0x3f')]['findAll'](_0x42b524);}})[_0xffeb('0x17')](function(_0x2ac53b){if(_0x2ac53b){return db[_0xffeb('0x4a')][_0xffeb('0x4b')]({'where':{'id':_[_0xffeb('0x49')](_0x2ac53b,_0xffeb('0x4c')),'role':_0xffeb('0x4d')},'attributes':['id',_0xffeb('0x1c'),_0xffeb('0x4e'),_0xffeb('0x4f'),_0xffeb('0x50')]});}})['then'](function(_0x10a599){if(_0x10a599){return{'count':_0x10a599['count'],'rows':_[_0xffeb('0x49')](_0x10a599[_0xffeb('0x27')],function(_0x252754){return{'membername':_0x252754[_0xffeb('0x1c')],'UserId':_0x252754['id'],'queue_name':_0x17394c['name'],'WhatsappQueueId':_0x17394c['id'],'interface':util[_0xffeb('0x51')](_0xffeb('0x52'),'SIP',_0x252754[_0xffeb('0x1c')]),'penalty':0x0,'paused':_0x252754[_0xffeb('0x4e')],'createdAt':_0x252754[_0xffeb('0x50')],'updatedAt':_0x252754['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xffeb('0x17')](respondWithFilteredResult(_0x4bf2a3,_0x42b524))[_0xffeb('0x33')](handleError(_0x4bf2a3,null));};exports[_0xffeb('0x53')]=function(_0x37fff8,_0x2113cf){var _0x4447db={};var _0xb080e6={};var _0x42f727;var _0x3f12bb;return db[_0xffeb('0x1f')][_0xffeb('0x3e')]({'where':{'id':_0x37fff8['params']['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x2113cf,null))['then'](function(_0x28df7b){if(_0x28df7b){_0x42f727=_0x28df7b;_0xb080e6['model']=_[_0xffeb('0x2a')](db[_0xffeb('0x54')][_0xffeb('0x20')]);_0xb080e6[_0xffeb('0x26')]=_[_0xffeb('0x2a')](_0x37fff8['query']);_0xb080e6[_0xffeb('0x2b')]=_[_0xffeb('0x2c')](_0xb080e6[_0xffeb('0x29')],_0xb080e6['query']);_0x4447db[_0xffeb('0x2d')]=_[_0xffeb('0x2c')](_0xb080e6['model'],qs[_0xffeb('0x2e')](_0x37fff8[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x4447db['attributes']=_0x4447db[_0xffeb('0x2d')][_0xffeb('0x2f')]?_0x4447db[_0xffeb('0x2d')]:_0xb080e6[_0xffeb('0x29')];_0x4447db[_0xffeb('0x42')]=qs['sort'](_0x37fff8[_0xffeb('0x26')]['sort']);_0x4447db['where']=qs['filters'](_[_0xffeb('0x45')](_0x37fff8['query'],_0xb080e6[_0xffeb('0x2b')]));if(_0x37fff8['query'][_0xffeb('0x47')]){_0x4447db[_0xffeb('0x44')]=_['merge'](_0x4447db[_0xffeb('0x44')],{'$or':_[_0xffeb('0x49')](_0x4447db[_0xffeb('0x2d')],function(_0x458398){var _0x3f99c7={};_0x3f99c7[_0x458398]={'$like':'%'+_0x37fff8['query'][_0xffeb('0x47')]+'%'};return _0x3f99c7;})});}_0x4447db=_['merge']({},_0x4447db,_0x37fff8[_0xffeb('0x31')]);return _0x42f727[_0xffeb('0x53')](_0x4447db);}})[_0xffeb('0x17')](function(_0x4eee27){if(_0x4eee27){_0x3f12bb=_0x4eee27['length'];if(!_0x37fff8['query'][_0xffeb('0x40')](_0xffeb('0x41'))){_0x4447db[_0xffeb('0x13')]=qs[_0xffeb('0x13')](_0x37fff8[_0xffeb('0x26')]['limit']);_0x4447db['offset']=qs[_0xffeb('0x12')](_0x37fff8[_0xffeb('0x26')][_0xffeb('0x12')]);}return _0x42f727['getTeams'](_0x4447db);}})[_0xffeb('0x17')](function(_0x314515){if(_0x314515){return _0x314515?{'count':_0x3f12bb,'rows':_0x314515}:null;}})['then'](respondWithResult(_0x2113cf,null))[_0xffeb('0x33')](handleError(_0x2113cf,null));};exports['addTeams']=function(_0x2bab95,_0x24e77f){var _0x31b0ad=_0x2bab95[_0xffeb('0x35')][_0xffeb('0x55')];return db['Team'][_0xffeb('0x56')]({'where':{'id':_0x31b0ad},'attributes':['id'],'include':[{'model':db[_0xffeb('0x4a')],'as':_0xffeb('0x57'),'attributes':['id',_0xffeb('0x1c'),_0xffeb('0x58'),_0xffeb('0x59'),'interface'],'raw':!![]}]})['then'](function(_0xba7f3d){if(_0xba7f3d){var _0x3d9a38=_['flatMap'](_0xba7f3d,function(_0x5d1232){var _0x4679c9=_0x5d1232[_0xffeb('0x18')]({'plain':!![]});return _0x4679c9[_0xffeb('0x57')];});return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0x2bab95[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](function(_0x49f89f){return db[_0xffeb('0x5a')][_0xffeb('0x5b')](function(_0x32a53c){return _0x49f89f[_0xffeb('0x5c')](_0x31b0ad,{'transaction':_0x32a53c})[_0xffeb('0x17')](function(){return BPromise[_0xffeb('0x5d')](_0x3d9a38,function(_0x51ba51){return db[_0xffeb('0x3f')]['findOrCreate']({'where':{'UserId':_0x51ba51['id'],'WhatsappQueueId':_0x2bab95[_0xffeb('0x28')]['id']},'transaction':_0x32a53c});});})[_0xffeb('0x17')](function(){_0x3d9a38[_0xffeb('0x5e')](function(_0x11c720){socket[_0xffeb('0x5f')](_0xffeb('0x60'),{'UserId':_0x11c720['id'],'WhatsappQueueId':_0x49f89f['id']});});});});});}})[_0xffeb('0x17')](respondWithStatusCode(_0x24e77f,null))[_0xffeb('0x33')](handleError(_0x24e77f,null));};exports[_0xffeb('0x61')]=function(_0x41d932,_0x22ec66){return db[_0xffeb('0x54')]['findAll']({'where':{'id':_0x41d932['query'][_0xffeb('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xffeb('0x57'),'attributes':['id'],'raw':!![]}]})[_0xffeb('0x17')](handleEntityNotFound(_0x22ec66,null))[_0xffeb('0x17')](function(_0x58d55f){var _0x859ec2=_['map'](_0x58d55f,'id');var _0x2cbac5=[];var _0x5ad883=[];var _0x29fd9a=squel[_0xffeb('0x62')]();_0x29fd9a[_0xffeb('0x63')](_0xffeb('0x64'))['from'](_0xffeb('0x65'),'tq')['join'](_0xffeb('0x66'),'ut',_0xffeb('0x67'))['where'](_0xffeb('0x68'),_0x41d932[_0xffeb('0x28')]['id']);for(var _0x434e5b=0x0;_0x434e5b<_0x58d55f[_0xffeb('0x2f')];_0x434e5b+=0x1){let _0x18ef32=_0x58d55f[_0x434e5b];for(var _0x5d222f=0x0;_0x5d222f<_0x18ef32[_0xffeb('0x57')][_0xffeb('0x2f')];_0x5d222f+=0x1){let _0x271fc0=_0x18ef32[_0xffeb('0x57')][_0x5d222f];var _0x3cc79b=_0x29fd9a['clone']();_0x3cc79b[_0xffeb('0x44')]('ut.UserId\x20=\x20?',_0x271fc0['id']);_0x5ad883[_0xffeb('0x69')](db[_0xffeb('0x5a')][_0xffeb('0x26')](_0x3cc79b[_0xffeb('0x6a')](),{'type':db[_0xffeb('0x5a')][_0xffeb('0x6b')][_0xffeb('0x6c')]})[_0xffeb('0x17')](function(_0x1c6d2a){if(_0x1c6d2a['length']===0x1){return _0x271fc0['id'];}else{var _0x57eaa0=_['every'](_[_0xffeb('0x49')](_0x1c6d2a,_0xffeb('0x6d')),function(_0x1bdb30){return _[_0xffeb('0x6e')](_0x859ec2,_0x1bdb30);});if(_0x57eaa0){return _0x271fc0['id'];}}}));}}return BPromise['all'](_0x5ad883)['then'](function(_0x44c99d){_0x2cbac5=_(_0x2cbac5)[_0xffeb('0x6f')](_0x44c99d)[_0xffeb('0x70')]()[_0xffeb('0x71')]();return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0x41d932[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](function(_0x3464dc){return db[_0xffeb('0x5a')][_0xffeb('0x5b')](function(_0xe79db5){return _0x3464dc[_0xffeb('0x61')](_0x41d932[_0xffeb('0x26')]['ids'],{'transaction':_0xe79db5})['then'](function(){if(!_[_0xffeb('0x72')](_0x2cbac5)){return _0x3464dc[_0xffeb('0x73')](_0x2cbac5,{'transaction':_0xe79db5});}})[_0xffeb('0x17')](function(){_0x2cbac5[_0xffeb('0x5e')](function(_0x29c9f4){socket[_0xffeb('0x5f')]('userWhatsappQueue:remove',{'UserId':_0x29c9f4,'WhatsappQueueId':_0x3464dc['id']});});});});});});})['then'](respondWithStatusCode(_0x22ec66,null))[_0xffeb('0x33')](handleError(_0x22ec66,null));};exports[_0xffeb('0x74')]=function(_0xbdc7d4,_0x7a6e5e){return db[_0xffeb('0x1f')][_0xffeb('0x32')]({'where':{'id':_0xbdc7d4[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x7a6e5e,null))[_0xffeb('0x17')](function(_0x3b84e4){if(_0x3b84e4){return _0x3b84e4['addAgents'](_0xbdc7d4[_0xffeb('0x35')]['ids'],_[_0xffeb('0x75')](_0xbdc7d4[_0xffeb('0x35')],['ids','id'])||{})[_0xffeb('0x76')](function(_0x3660a3){for(var _0xa84f0e=0x0;_0xa84f0e<_0xbdc7d4['body'][_0xffeb('0x55')][_0xffeb('0x2f')];_0xa84f0e+=0x1){socket[_0xffeb('0x5f')]('userWhatsappQueue:save',{'UserId':Number(_0xbdc7d4[_0xffeb('0x35')][_0xffeb('0x55')][_0xa84f0e]),'WhatsappQueueId':Number(_0xbdc7d4[_0xffeb('0x28')]['id'])});}return _0x3660a3;});}})['then'](respondWithResult(_0x7a6e5e,null))[_0xffeb('0x33')](handleError(_0x7a6e5e,null));};exports[_0xffeb('0x73')]=function(_0x1bf46c,_0x3ec6ea){return db['WhatsappQueue'][_0xffeb('0x32')]({'where':{'id':_0x1bf46c['params']['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x3ec6ea,null))[_0xffeb('0x17')](function(_0x18a36a){if(_0x18a36a){return _0x18a36a[_0xffeb('0x73')](_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')])[_0xffeb('0x17')](function(){if(_['isArray'](_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')])){for(var _0x2f9129=0x0;_0x2f9129<_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')][_0xffeb('0x2f')];_0x2f9129+=0x1){socket['emit'](_0xffeb('0x77'),{'UserId':Number(_0x1bf46c['query'][_0xffeb('0x55')][_0x2f9129]),'WhatsappQueueId':Number(_0x1bf46c['params']['id'])});}}else{socket[_0xffeb('0x5f')](_0xffeb('0x77'),{'UserId':Number(_0x1bf46c[_0xffeb('0x26')][_0xffeb('0x55')]),'WhatsappQueueId':Number(_0x1bf46c[_0xffeb('0x28')]['id'])});}});}})[_0xffeb('0x17')](respondWithStatusCode(_0x3ec6ea,null))[_0xffeb('0x33')](handleError(_0x3ec6ea,null));};exports[_0xffeb('0x78')]=function(_0x26cffb,_0x3d202c){var _0x112138={};var _0x4979ab={};var _0x5509ce;var _0xddd220;return db[_0xffeb('0x1f')][_0xffeb('0x3e')]({'where':{'id':_0x26cffb[_0xffeb('0x28')]['id']}})[_0xffeb('0x17')](handleEntityNotFound(_0x3d202c,null))['then'](function(_0x147252){if(_0x147252){_0x5509ce=_0x147252;_0x4979ab['model']=_['keys'](db[_0xffeb('0x4a')][_0xffeb('0x20')]);_0x4979ab[_0xffeb('0x26')]=_[_0xffeb('0x2a')](_0x26cffb[_0xffeb('0x26')]);_0x4979ab[_0xffeb('0x2b')]=_['intersection'](_0x4979ab[_0xffeb('0x29')],_0x4979ab[_0xffeb('0x26')]);_0x112138[_0xffeb('0x2d')]=_[_0xffeb('0x2c')](_0x4979ab[_0xffeb('0x29')],qs['fields'](_0x26cffb[_0xffeb('0x26')][_0xffeb('0x2e')]));_0x112138[_0xffeb('0x2d')]=_0x112138[_0xffeb('0x2d')][_0xffeb('0x2f')]?_0x112138['attributes']:_0x4979ab[_0xffeb('0x29')];_0x112138[_0xffeb('0x42')]=qs[_0xffeb('0x43')](_0x26cffb['query'][_0xffeb('0x43')]);_0x112138[_0xffeb('0x44')]=qs[_0xffeb('0x2b')](_[_0xffeb('0x45')](_0x26cffb[_0xffeb('0x26')],_0x4979ab[_0xffeb('0x2b')]));if(_0x26cffb[_0xffeb('0x26')][_0xffeb('0x47')]){_0x112138[_0xffeb('0x44')]=_[_0xffeb('0x48')](_0x112138[_0xffeb('0x44')],{'$or':_[_0xffeb('0x49')](_0x112138[_0xffeb('0x2d')],function(_0x4a480d){var _0x42bab2={};_0x42bab2[_0x4a480d]={'$like':'%'+_0x26cffb['query'][_0xffeb('0x47')]+'%'};return _0x42bab2;})});}_0x112138=_[_0xffeb('0x48')]({},_0x112138,_0x26cffb[_0xffeb('0x31')]);return _0x5509ce['getAgents'](_0x112138);}})[_0xffeb('0x17')](function(_0x59da9e){if(_0x59da9e){_0xddd220=_0x59da9e['length'];if(!_0x26cffb[_0xffeb('0x26')][_0xffeb('0x40')](_0xffeb('0x41'))){_0x112138[_0xffeb('0x13')]=qs['limit'](_0x26cffb[_0xffeb('0x26')][_0xffeb('0x13')]);_0x112138['offset']=qs[_0xffeb('0x12')](_0x26cffb['query'][_0xffeb('0x12')]);}return _0x5509ce[_0xffeb('0x78')](_0x112138);}})[_0xffeb('0x17')](function(_0xe9c039){if(_0xe9c039){return _0xe9c039?{'count':_0xddd220,'rows':_0xe9c039}:null;}})['then'](respondWithResult(_0x3d202c,null))[_0xffeb('0x33')](handleError(_0x3d202c,null));};
\ No newline at end of file
+var _0x7054=['team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','userWhatsappQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','findOne','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','where','include','rows','catch','params','keys','query','model','intersection','fields','attributes','length','merge','options','find','body','user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','filters','hasOwnProperty','nolimit','sort','pick','WhatsappQueueId','filter','findAll','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','%s/%s','SIP','updatedAt','Team','order','getTeams','addTeams','ids','Agents','online','voicePause','interface','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from'];(function(_0x11ed4d,_0xbaadfd){var _0x1169d0=function(_0x5436fa){while(--_0x5436fa){_0x11ed4d['push'](_0x11ed4d['shift']());}};_0x1169d0(++_0xbaadfd);}(_0x7054,0x96));var _0x4705=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0x7054[_0x5b8685];return _0xa3ef57;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x4705('0x0'));var squel=require(_0x4705('0x1'));var Redis=require(_0x4705('0x2'));var qs=require(_0x4705('0x3'));var logger=require('../../config/logger')(_0x4705('0x4'));var config=require(_0x4705('0x5'));var db=require(_0x4705('0x6'))['db'];config['redis']=_[_0x4705('0x7')](config[_0x4705('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4705('0x9'))(new Redis(config[_0x4705('0x8')]));require('./whatsappQueue.socket')[_0x4705('0xa')](socket);function respondWithStatusCode(_0x5d6d19,_0x5516f4){_0x5516f4=_0x5516f4||0xcc;return function(_0x29b045){if(_0x29b045){return _0x5d6d19['sendStatus'](_0x5516f4);}return _0x5d6d19[_0x4705('0xb')](_0x5516f4)['end']();};}function respondWithResult(_0x4fc931,_0x38f502){_0x38f502=_0x38f502||0xc8;return function(_0x1c0ed2){if(_0x1c0ed2){return _0x4fc931[_0x4705('0xb')](_0x38f502)[_0x4705('0xc')](_0x1c0ed2);}};}function respondWithFilteredResult(_0x29cbe5,_0x3860b2){return function(_0x32dffd){if(_0x32dffd){var _0x2d8f03=typeof _0x3860b2[_0x4705('0xd')]===_0x4705('0xe')&&typeof _0x3860b2['limit']===_0x4705('0xe');var _0x1ce8af=_0x32dffd[_0x4705('0xf')];var _0x7d86ad=_0x2d8f03?0x0:_0x3860b2[_0x4705('0xd')];var _0x593698=_0x2d8f03?_0x32dffd[_0x4705('0xf')]:_0x3860b2[_0x4705('0xd')]+_0x3860b2[_0x4705('0x10')];var _0x20189a;if(_0x593698>=_0x1ce8af){_0x593698=_0x1ce8af;_0x20189a=0xc8;}else{_0x20189a=0xce;}_0x29cbe5[_0x4705('0xb')](_0x20189a);return _0x29cbe5[_0x4705('0x11')]('Content-Range',_0x7d86ad+'-'+_0x593698+'/'+_0x1ce8af)['json'](_0x32dffd);}return null;};}function saveUpdates(_0x15d396){return function(_0x1480a2){if(_0x1480a2){return _0x1480a2[_0x4705('0x12')](_0x15d396)[_0x4705('0x13')](function(_0x20e486){return _0x20e486;});}return null;};}function removeEntity(_0x5049e7){return function(_0x149d57){if(_0x149d57){return _0x149d57[_0x4705('0x14')]()[_0x4705('0x13')](function(){var _0x1b5a40=_0x149d57[_0x4705('0x15')]({'plain':!![]});var _0x5edad6=_0x4705('0x16');return db[_0x4705('0x17')][_0x4705('0x14')]({'where':{'type':_0x5edad6,'resourceId':_0x1b5a40['id']}})[_0x4705('0x13')](function(){return _0x149d57;});})['then'](function(){_0x5049e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1a6ba){return function(_0x3d4efe){if(!_0x3d4efe){_0xf1a6ba[_0x4705('0x18')](0x194);}return _0x3d4efe;};}function handleError(_0x3f56c9,_0x7feae5){_0x7feae5=_0x7feae5||0x1f4;return function(_0x9a1d38){logger[_0x4705('0x19')](_0x9a1d38[_0x4705('0x1a')]);if(_0x9a1d38[_0x4705('0x1b')]){delete _0x9a1d38[_0x4705('0x1b')];}_0x3f56c9['status'](_0x7feae5)[_0x4705('0x1c')](_0x9a1d38);};}exports[_0x4705('0x1d')]=function(_0x3cd317,_0x5d8a54){var _0x1a5791={};var _0x4f6008={'count':0x0,'rows':[]};var _0x53f16f=_[_0x4705('0x1e')](db[_0x4705('0x1f')][_0x4705('0x20')],function(_0x316822){return{'name':_0x316822[_0x4705('0x21')],'type':_0x316822[_0x4705('0x22')][_0x4705('0x23')]};});_0x1a5791=qs[_0x4705('0x24')](_0x53f16f,_0x3cd317);var _0x452281={'where':_0x1a5791[_0x4705('0x25')]};return db[_0x4705('0x1f')][_0x4705('0xf')](_0x452281)['then'](function(_0x24bd0c){_0x4f6008[_0x4705('0xf')]=_0x24bd0c;_0x1a5791[_0x4705('0x26')]=qs['include'](_0x3cd317['query']);return db['WhatsappQueue']['findAll'](_0x1a5791);})[_0x4705('0x13')](function(_0x242a22){_0x4f6008[_0x4705('0x27')]=_0x242a22;return _0x4f6008;})[_0x4705('0x13')](respondWithFilteredResult(_0x5d8a54,_0x1a5791))[_0x4705('0x28')](handleError(_0x5d8a54,null));};exports['show']=function(_0x4683a7,_0x2d87d8){var _0x1f6a0d={'raw':!![],'where':{'id':_0x4683a7[_0x4705('0x29')]['id']}},_0x1ee8cd={};_0x1ee8cd['model']=_[_0x4705('0x2a')](db[_0x4705('0x1f')][_0x4705('0x20')]);_0x1ee8cd[_0x4705('0x2b')]=_[_0x4705('0x2a')](_0x4683a7['query']);_0x1ee8cd['filters']=_['intersection'](_0x1ee8cd[_0x4705('0x2c')],_0x1ee8cd[_0x4705('0x2b')]);_0x1f6a0d['attributes']=_[_0x4705('0x2d')](_0x1ee8cd[_0x4705('0x2c')],qs['fields'](_0x4683a7[_0x4705('0x2b')][_0x4705('0x2e')]));_0x1f6a0d[_0x4705('0x2f')]=_0x1f6a0d[_0x4705('0x2f')][_0x4705('0x30')]?_0x1f6a0d[_0x4705('0x2f')]:_0x1ee8cd[_0x4705('0x2c')];if(_0x4683a7[_0x4705('0x2b')]['includeAll']){_0x1f6a0d[_0x4705('0x26')]=[{'all':!![]}];}_0x1f6a0d=_[_0x4705('0x31')]({},_0x1f6a0d,_0x4683a7[_0x4705('0x32')]);return db['WhatsappQueue'][_0x4705('0x33')](_0x1f6a0d)[_0x4705('0x13')](handleEntityNotFound(_0x2d87d8,null))[_0x4705('0x13')](respondWithResult(_0x2d87d8,null))[_0x4705('0x28')](handleError(_0x2d87d8,null));};exports['create']=function(_0x1a232c,_0x1c5a3d){return db[_0x4705('0x1f')]['create'](_0x1a232c[_0x4705('0x34')],{})[_0x4705('0x13')](function(_0x5d1e80){var _0x229688=_0x1a232c[_0x4705('0x35')][_0x4705('0x15')]({'plain':!![]});if(!_0x229688)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x229688[_0x4705('0x36')]===_0x4705('0x35')){var _0x4e6531=_0x5d1e80[_0x4705('0x15')]({'plain':!![]});var _0x389298='WhatsappQueues';return db['UserProfileSection'][_0x4705('0x33')]({'where':{'name':_0x389298,'userProfileId':_0x229688[_0x4705('0x37')]},'raw':!![]})[_0x4705('0x13')](function(_0x17f054){if(_0x17f054&&_0x17f054[_0x4705('0x38')]===0x0){return db[_0x4705('0x17')][_0x4705('0x39')]({'name':_0x4e6531[_0x4705('0x1b')],'resourceId':_0x4e6531['id'],'type':_0x17f054['name'],'sectionId':_0x17f054['id']},{})['then'](function(){return _0x5d1e80;});}else{return _0x5d1e80;}})[_0x4705('0x28')](function(_0x3083d2){logger['error'](_0x4705('0x3a'),_0x3083d2);throw _0x3083d2;});}return _0x5d1e80;})[_0x4705('0x13')](respondWithResult(_0x1c5a3d,0xc9))[_0x4705('0x28')](handleError(_0x1c5a3d,null));};exports['update']=function(_0x5c64a2,_0x393a80){if(_0x5c64a2[_0x4705('0x34')]['id']){delete _0x5c64a2[_0x4705('0x34')]['id'];}return db[_0x4705('0x1f')][_0x4705('0x33')]({'where':{'id':_0x5c64a2[_0x4705('0x29')]['id']}})[_0x4705('0x13')](handleEntityNotFound(_0x393a80,null))['then'](saveUpdates(_0x5c64a2[_0x4705('0x34')],null))[_0x4705('0x13')](respondWithResult(_0x393a80,null))[_0x4705('0x28')](handleError(_0x393a80,null));};exports[_0x4705('0x14')]=function(_0x446d03,_0x38305d){return db[_0x4705('0x1f')][_0x4705('0x33')]({'where':{'id':_0x446d03[_0x4705('0x29')]['id']}})['then'](handleEntityNotFound(_0x38305d,null))[_0x4705('0x13')](removeEntity(_0x38305d,null))[_0x4705('0x28')](handleError(_0x38305d,null));};exports[_0x4705('0x3b')]=function(_0x22c022,_0x57bc92){return db[_0x4705('0x1f')][_0x4705('0x3b')]()[_0x4705('0x13')](respondWithResult(_0x57bc92,null))[_0x4705('0x28')](handleError(_0x57bc92,null));};exports[_0x4705('0x3c')]=function(_0x27bea5,_0x4598e0){var _0x27d269={'raw':!![],'where':{}},_0x216f04={},_0x3c4217;return db[_0x4705('0x1f')]['findOne']({'where':{'id':_0x27bea5[_0x4705('0x29')]['id']}})[_0x4705('0x13')](handleEntityNotFound(_0x4598e0,null))[_0x4705('0x13')](function(_0x1b3556){if(_0x1b3556){_0x3c4217=_0x1b3556[_0x4705('0x15')]({'plain':!![]});_0x216f04['model']=_[_0x4705('0x2a')](db[_0x4705('0x3d')][_0x4705('0x20')]);_0x216f04['query']=_[_0x4705('0x2a')](_0x27bea5[_0x4705('0x2b')]);_0x216f04[_0x4705('0x3e')]=_[_0x4705('0x2d')](_0x216f04[_0x4705('0x2c')],_0x216f04['query']);_0x27d269[_0x4705('0x2f')]=_[_0x4705('0x2d')](_0x216f04[_0x4705('0x2c')],qs[_0x4705('0x2e')](_0x27bea5['query'][_0x4705('0x2e')]));_0x27d269[_0x4705('0x2f')]=_0x27d269[_0x4705('0x2f')][_0x4705('0x30')]?_0x27d269[_0x4705('0x2f')]:_0x216f04[_0x4705('0x2c')];if(!_0x27bea5[_0x4705('0x2b')][_0x4705('0x3f')](_0x4705('0x40'))){_0x27d269[_0x4705('0x10')]=qs[_0x4705('0x10')](_0x27bea5['query'][_0x4705('0x10')]);_0x27d269['offset']=qs[_0x4705('0xd')](_0x27bea5[_0x4705('0x2b')][_0x4705('0xd')]);}_0x27d269['order']=qs[_0x4705('0x41')](_0x27bea5[_0x4705('0x2b')][_0x4705('0x41')]);_0x27d269['where']=qs['filters'](_[_0x4705('0x42')](_0x27bea5[_0x4705('0x2b')],_0x216f04[_0x4705('0x3e')]));_0x27d269[_0x4705('0x25')][_0x4705('0x43')]=_0x1b3556['id'];if(_0x27bea5[_0x4705('0x2b')][_0x4705('0x44')]){_0x27d269[_0x4705('0x25')]=_[_0x4705('0x31')](_0x27d269[_0x4705('0x25')],{'$or':_[_0x4705('0x1e')](_0x27d269['attributes'],function(_0x462690){var _0x467f50={};_0x467f50[_0x462690]={'$like':'%'+_0x27bea5['query'][_0x4705('0x44')]+'%'};return _0x467f50;})});}_0x27d269=_[_0x4705('0x31')]({},_0x27d269,_0x27bea5[_0x4705('0x32')]);return db[_0x4705('0x3d')][_0x4705('0x45')](_0x27d269);}})[_0x4705('0x13')](function(_0x5ce091){if(_0x5ce091){return db[_0x4705('0x46')][_0x4705('0x47')]({'where':{'id':_[_0x4705('0x1e')](_0x5ce091,_0x4705('0x48')),'role':_0x4705('0x49')},'attributes':['id',_0x4705('0x1b'),_0x4705('0x4a'),'updatedAt',_0x4705('0x4b')]});}})[_0x4705('0x13')](function(_0x3bdd13){if(_0x3bdd13){return{'count':_0x3bdd13[_0x4705('0xf')],'rows':_[_0x4705('0x1e')](_0x3bdd13[_0x4705('0x27')],function(_0x34829c){return{'membername':_0x34829c['name'],'UserId':_0x34829c['id'],'queue_name':_0x3c4217[_0x4705('0x1b')],'WhatsappQueueId':_0x3c4217['id'],'interface':util['format'](_0x4705('0x4c'),_0x4705('0x4d'),_0x34829c[_0x4705('0x1b')]),'penalty':0x0,'paused':_0x34829c['whatsappPause'],'createdAt':_0x34829c[_0x4705('0x4b')],'updatedAt':_0x34829c[_0x4705('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4705('0x13')](respondWithFilteredResult(_0x4598e0,_0x27d269))[_0x4705('0x28')](handleError(_0x4598e0,null));};exports['getTeams']=function(_0x1075f8,_0x35c178){var _0x47ea92={};var _0x22148c={};var _0x389f63;var _0x10967f;return db[_0x4705('0x1f')]['findOne']({'where':{'id':_0x1075f8['params']['id']}})[_0x4705('0x13')](handleEntityNotFound(_0x35c178,null))[_0x4705('0x13')](function(_0x380a23){if(_0x380a23){_0x389f63=_0x380a23;_0x22148c[_0x4705('0x2c')]=_[_0x4705('0x2a')](db[_0x4705('0x4f')][_0x4705('0x20')]);_0x22148c['query']=_[_0x4705('0x2a')](_0x1075f8[_0x4705('0x2b')]);_0x22148c['filters']=_[_0x4705('0x2d')](_0x22148c['model'],_0x22148c[_0x4705('0x2b')]);_0x47ea92['attributes']=_[_0x4705('0x2d')](_0x22148c[_0x4705('0x2c')],qs[_0x4705('0x2e')](_0x1075f8[_0x4705('0x2b')][_0x4705('0x2e')]));_0x47ea92[_0x4705('0x2f')]=_0x47ea92[_0x4705('0x2f')]['length']?_0x47ea92['attributes']:_0x22148c[_0x4705('0x2c')];_0x47ea92[_0x4705('0x50')]=qs['sort'](_0x1075f8[_0x4705('0x2b')]['sort']);_0x47ea92[_0x4705('0x25')]=qs[_0x4705('0x3e')](_['pick'](_0x1075f8[_0x4705('0x2b')],_0x22148c[_0x4705('0x3e')]));if(_0x1075f8[_0x4705('0x2b')][_0x4705('0x44')]){_0x47ea92['where']=_[_0x4705('0x31')](_0x47ea92['where'],{'$or':_[_0x4705('0x1e')](_0x47ea92[_0x4705('0x2f')],function(_0x3c9c24){var _0x10f05e={};_0x10f05e[_0x3c9c24]={'$like':'%'+_0x1075f8['query'][_0x4705('0x44')]+'%'};return _0x10f05e;})});}_0x47ea92=_['merge']({},_0x47ea92,_0x1075f8['options']);return _0x389f63[_0x4705('0x51')](_0x47ea92);}})[_0x4705('0x13')](function(_0x3d1812){if(_0x3d1812){_0x10967f=_0x3d1812[_0x4705('0x30')];if(!_0x1075f8[_0x4705('0x2b')][_0x4705('0x3f')]('nolimit')){_0x47ea92[_0x4705('0x10')]=qs['limit'](_0x1075f8['query'][_0x4705('0x10')]);_0x47ea92[_0x4705('0xd')]=qs[_0x4705('0xd')](_0x1075f8[_0x4705('0x2b')][_0x4705('0xd')]);}return _0x389f63[_0x4705('0x51')](_0x47ea92);}})[_0x4705('0x13')](function(_0x104471){if(_0x104471){return _0x104471?{'count':_0x10967f,'rows':_0x104471}:null;}})[_0x4705('0x13')](respondWithResult(_0x35c178,null))[_0x4705('0x28')](handleError(_0x35c178,null));};exports[_0x4705('0x52')]=function(_0x3aaebf,_0x68998e){var _0x23da54=_0x3aaebf[_0x4705('0x34')][_0x4705('0x53')];return db[_0x4705('0x4f')][_0x4705('0x45')]({'where':{'id':_0x23da54},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4705('0x54'),'attributes':['id',_0x4705('0x1b'),_0x4705('0x55'),_0x4705('0x56'),_0x4705('0x57')],'raw':!![]}]})[_0x4705('0x13')](function(_0x4fa69d){if(_0x4fa69d){var _0x4cf261=_['flatMap'](_0x4fa69d,function(_0x88bdb0){var _0x4d98b7=_0x88bdb0[_0x4705('0x15')]({'plain':!![]});return _0x4d98b7[_0x4705('0x54')];});return db[_0x4705('0x1f')]['find']({'where':{'id':_0x3aaebf[_0x4705('0x29')]['id']}})[_0x4705('0x13')](function(_0x333e70){return db['sequelize']['transaction'](function(_0x4b8434){return _0x333e70['addTeams'](_0x23da54,{'transaction':_0x4b8434})['then'](function(){return BPromise[_0x4705('0x58')](_0x4cf261,function(_0x350a37){return db[_0x4705('0x3d')][_0x4705('0x59')]({'where':{'UserId':_0x350a37['id'],'WhatsappQueueId':_0x3aaebf['params']['id']},'transaction':_0x4b8434});});})[_0x4705('0x13')](function(){_0x4cf261[_0x4705('0x5a')](function(_0x36c614){socket[_0x4705('0x5b')](_0x4705('0x5c'),{'UserId':_0x36c614['id'],'WhatsappQueueId':_0x333e70['id']});});});});});}})['then'](respondWithStatusCode(_0x68998e,null))[_0x4705('0x28')](handleError(_0x68998e,null));};exports[_0x4705('0x5d')]=function(_0x5bd46f,_0x2ddb72){return db[_0x4705('0x4f')]['findAll']({'where':{'id':_0x5bd46f[_0x4705('0x2b')][_0x4705('0x53')]},'attributes':['id'],'include':[{'model':db[_0x4705('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4705('0x13')](handleEntityNotFound(_0x2ddb72,null))['then'](function(_0x39030f){var _0x21763c=_['map'](_0x39030f,'id');var _0x42edb2=[];var _0x54fb27=[];var _0xc24d2f=squel[_0x4705('0x5e')]();_0xc24d2f[_0x4705('0x5f')](_0x4705('0x60'))[_0x4705('0x61')](_0x4705('0x62'),'tq')[_0x4705('0x63')](_0x4705('0x64'),'ut',_0x4705('0x65'))[_0x4705('0x25')](_0x4705('0x66'),_0x5bd46f[_0x4705('0x29')]['id']);for(var _0x20c958=0x0;_0x20c958<_0x39030f[_0x4705('0x30')];_0x20c958+=0x1){let _0x50f1a6=_0x39030f[_0x20c958];for(var _0x1a5aa3=0x0;_0x1a5aa3<_0x50f1a6[_0x4705('0x54')]['length'];_0x1a5aa3+=0x1){let _0x3574f4=_0x50f1a6[_0x4705('0x54')][_0x1a5aa3];var _0x41af53=_0xc24d2f['clone']();_0x41af53[_0x4705('0x25')](_0x4705('0x67'),_0x3574f4['id']);_0x54fb27[_0x4705('0x68')](db['sequelize'][_0x4705('0x2b')](_0x41af53[_0x4705('0x69')](),{'type':db[_0x4705('0x6a')][_0x4705('0x6b')][_0x4705('0x6c')]})[_0x4705('0x13')](function(_0xd5f4fb){if(_0xd5f4fb['length']===0x1){return _0x3574f4['id'];}else{var _0x243611=_[_0x4705('0x6d')](_[_0x4705('0x1e')](_0xd5f4fb,_0x4705('0x6e')),function(_0x5e5b36){return _['includes'](_0x21763c,_0x5e5b36);});if(_0x243611){return _0x3574f4['id'];}}}));}}return BPromise[_0x4705('0x6f')](_0x54fb27)['then'](function(_0xb652e7){_0x42edb2=_(_0x42edb2)[_0x4705('0x70')](_0xb652e7)[_0x4705('0x71')]()[_0x4705('0x72')]();return db['WhatsappQueue']['find']({'where':{'id':_0x5bd46f[_0x4705('0x29')]['id']}})[_0x4705('0x13')](function(_0x1e3cfc){return db[_0x4705('0x6a')][_0x4705('0x73')](function(_0x3c3323){return _0x1e3cfc['removeTeams'](_0x5bd46f[_0x4705('0x2b')][_0x4705('0x53')],{'transaction':_0x3c3323})[_0x4705('0x13')](function(){if(!_[_0x4705('0x74')](_0x42edb2)){return _0x1e3cfc['removeAgents'](_0x42edb2,{'transaction':_0x3c3323});}})[_0x4705('0x13')](function(){_0x42edb2[_0x4705('0x5a')](function(_0x1c27bd){socket[_0x4705('0x5b')](_0x4705('0x75'),{'UserId':_0x1c27bd,'WhatsappQueueId':_0x1e3cfc['id']});});});});});});})[_0x4705('0x13')](respondWithStatusCode(_0x2ddb72,null))[_0x4705('0x28')](handleError(_0x2ddb72,null));};exports[_0x4705('0x76')]=function(_0x18bba8,_0x5c7372){return db['WhatsappQueue'][_0x4705('0x33')]({'where':{'id':_0x18bba8[_0x4705('0x29')]['id']}})['then'](handleEntityNotFound(_0x5c7372,null))['then'](function(_0x39b02e){if(_0x39b02e){return _0x39b02e[_0x4705('0x76')](_0x18bba8[_0x4705('0x34')]['ids'],_[_0x4705('0x77')](_0x18bba8[_0x4705('0x34')],['ids','id'])||{})['spread'](function(_0x43117f){for(var _0x5a2d9c=0x0;_0x5a2d9c<_0x18bba8[_0x4705('0x34')][_0x4705('0x53')][_0x4705('0x30')];_0x5a2d9c+=0x1){socket[_0x4705('0x5b')](_0x4705('0x5c'),{'UserId':Number(_0x18bba8[_0x4705('0x34')][_0x4705('0x53')][_0x5a2d9c]),'WhatsappQueueId':Number(_0x18bba8[_0x4705('0x29')]['id'])});}return _0x43117f;});}})[_0x4705('0x13')](respondWithResult(_0x5c7372,null))[_0x4705('0x28')](handleError(_0x5c7372,null));};exports['removeAgents']=function(_0x418689,_0x4f1782){return db[_0x4705('0x1f')]['find']({'where':{'id':_0x418689[_0x4705('0x29')]['id']}})[_0x4705('0x13')](handleEntityNotFound(_0x4f1782,null))[_0x4705('0x13')](function(_0x4cae4d){if(_0x4cae4d){return _0x4cae4d[_0x4705('0x78')](_0x418689[_0x4705('0x2b')][_0x4705('0x53')])['then'](function(){if(_[_0x4705('0x79')](_0x418689['query'][_0x4705('0x53')])){for(var _0x23f2c8=0x0;_0x23f2c8<_0x418689[_0x4705('0x2b')][_0x4705('0x53')][_0x4705('0x30')];_0x23f2c8+=0x1){socket[_0x4705('0x5b')](_0x4705('0x75'),{'UserId':Number(_0x418689[_0x4705('0x2b')][_0x4705('0x53')][_0x23f2c8]),'WhatsappQueueId':Number(_0x418689[_0x4705('0x29')]['id'])});}}else{socket[_0x4705('0x5b')](_0x4705('0x75'),{'UserId':Number(_0x418689[_0x4705('0x2b')][_0x4705('0x53')]),'WhatsappQueueId':Number(_0x418689['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4f1782,null))[_0x4705('0x28')](handleError(_0x4f1782,null));};exports[_0x4705('0x7a')]=function(_0x5d96c9,_0x929571){var _0x1eb207={};var _0x520975={};var _0x1e23e5;var _0x12535b;return db[_0x4705('0x1f')][_0x4705('0x7b')]({'where':{'id':_0x5d96c9[_0x4705('0x29')]['id']}})['then'](handleEntityNotFound(_0x929571,null))[_0x4705('0x13')](function(_0x3f69fc){if(_0x3f69fc){_0x1e23e5=_0x3f69fc;_0x520975[_0x4705('0x2c')]=_[_0x4705('0x2a')](db['User'][_0x4705('0x20')]);_0x520975[_0x4705('0x2b')]=_[_0x4705('0x2a')](_0x5d96c9['query']);_0x520975['filters']=_[_0x4705('0x2d')](_0x520975[_0x4705('0x2c')],_0x520975[_0x4705('0x2b')]);_0x1eb207[_0x4705('0x2f')]=_[_0x4705('0x2d')](_0x520975[_0x4705('0x2c')],qs[_0x4705('0x2e')](_0x5d96c9['query']['fields']));_0x1eb207[_0x4705('0x2f')]=_0x1eb207[_0x4705('0x2f')][_0x4705('0x30')]?_0x1eb207[_0x4705('0x2f')]:_0x520975[_0x4705('0x2c')];_0x1eb207['order']=qs['sort'](_0x5d96c9[_0x4705('0x2b')][_0x4705('0x41')]);_0x1eb207[_0x4705('0x25')]=qs['filters'](_[_0x4705('0x42')](_0x5d96c9['query'],_0x520975[_0x4705('0x3e')]));if(_0x5d96c9[_0x4705('0x2b')]['filter']){_0x1eb207[_0x4705('0x25')]=_[_0x4705('0x31')](_0x1eb207['where'],{'$or':_[_0x4705('0x1e')](_0x1eb207[_0x4705('0x2f')],function(_0xae1d39){var _0x1dbc0e={};_0x1dbc0e[_0xae1d39]={'$like':'%'+_0x5d96c9[_0x4705('0x2b')][_0x4705('0x44')]+'%'};return _0x1dbc0e;})});}_0x1eb207=_[_0x4705('0x31')]({},_0x1eb207,_0x5d96c9[_0x4705('0x32')]);return _0x1e23e5[_0x4705('0x7a')](_0x1eb207);}})[_0x4705('0x13')](function(_0x166b08){if(_0x166b08){_0x12535b=_0x166b08['length'];if(!_0x5d96c9[_0x4705('0x2b')][_0x4705('0x3f')](_0x4705('0x40'))){_0x1eb207['limit']=qs['limit'](_0x5d96c9[_0x4705('0x2b')][_0x4705('0x10')]);_0x1eb207['offset']=qs[_0x4705('0xd')](_0x5d96c9[_0x4705('0x2b')][_0x4705('0xd')]);}return _0x1e23e5['getAgents'](_0x1eb207);}})[_0x4705('0x13')](function(_0x479e09){if(_0x479e09){return _0x479e09?{'count':_0x12535b,'rows':_0x479e09}:null;}})[_0x4705('0x13')](respondWithResult(_0x929571,null))[_0x4705('0x28')](handleError(_0x929571,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd7b=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x4b523f,_0xddef26){var _0x287bd8=function(_0x3fa74d){while(--_0x3fa74d){_0x4b523f['push'](_0x4b523f['shift']());}};_0x287bd8(++_0xddef26);}(_0xdd7b,0xec));var _0xbdd7=function(_0x1e30a2,_0x1f16a2){_0x1e30a2=_0x1e30a2-0x0;var _0x4942e0=_0xdd7b[_0x1e30a2];return _0x4942e0;};'use strict';var EventEmitter=require(_0xbdd7('0x0'));var WhatsappQueue=require(_0xbdd7('0x1'))['db'][_0xbdd7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbdd7('0x3')](0x0);var events={'afterCreate':_0xbdd7('0x4'),'afterUpdate':_0xbdd7('0x5'),'afterDestroy':_0xbdd7('0x6')};function emitEvent(_0x5ce929){return function(_0x3dfa67,_0x5dd07e,_0x29ae2d){WhatsappQueueEvents[_0xbdd7('0x7')](_0x5ce929+':'+_0x3dfa67['id'],_0x3dfa67);WhatsappQueueEvents[_0xbdd7('0x7')](_0x5ce929,_0x3dfa67);_0x29ae2d(null);};}for(var e in events){if(events[_0xbdd7('0x8')](e)){var event=events[e];WhatsappQueue[_0xbdd7('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0xd3d4=['emit','hasOwnProperty','hook','events','WhatsappQueue','save','update','remove'];(function(_0x5cd2bb,_0x4a063f){var _0x1e5ecc=function(_0x542815){while(--_0x542815){_0x5cd2bb['push'](_0x5cd2bb['shift']());}};_0x1e5ecc(++_0x4a063f);}(_0xd3d4,0x163));var _0x4d3d=function(_0x1a7395,_0x24cd8b){_0x1a7395=_0x1a7395-0x0;var _0x16d4ee=_0xd3d4[_0x1a7395];return _0x16d4ee;};'use strict';var EventEmitter=require(_0x4d3d('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x4d3d('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4d3d('0x2'),'afterUpdate':_0x4d3d('0x3'),'afterDestroy':_0x4d3d('0x4')};function emitEvent(_0x4497f8){return function(_0x16147e,_0x2fd1d5,_0x1e42bf){WhatsappQueueEvents[_0x4d3d('0x5')](_0x4497f8+':'+_0x16147e['id'],_0x16147e);WhatsappQueueEvents['emit'](_0x4497f8,_0x16147e);_0x1e42bf(null);};}for(var e in events){if(events[_0x4d3d('0x6')](e)){var event=events[e];WhatsappQueue[_0x4d3d('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1384=['path','../../config/environment','define','WhatsappQueue','lodash','util','api','moment','bluebird'];(function(_0x32f326,_0x26dd4a){var _0x2b9fdd=function(_0x5b7bf4){while(--_0x5b7bf4){_0x32f326['push'](_0x32f326['shift']());}};_0x2b9fdd(++_0x26dd4a);}(_0x1384,0x1e1));var _0x4138=function(_0xcfcd8c,_0x5dcccf){_0xcfcd8c=_0xcfcd8c-0x0;var _0x5c68cb=_0x1384[_0xcfcd8c];return _0x5c68cb;};'use strict';var _=require(_0x4138('0x0'));var util=require(_0x4138('0x1'));var logger=require('../../config/logger')(_0x4138('0x2'));var moment=require(_0x4138('0x3'));var BPromise=require(_0x4138('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4138('0x5'));var rimraf=require('rimraf');var config=require(_0x4138('0x6'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0xb3cfbb,_0x1cafba){return _0xb3cfbb[_0x4138('0x7')](_0x4138('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x113d=['rimraf','../../config/environment','exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x3c18bd,_0x5eda61){var _0x29ae98=function(_0x58ea35){while(--_0x58ea35){_0x3c18bd['push'](_0x3c18bd['shift']());}};_0x29ae98(++_0x5eda61);}(_0x113d,0xc0));var _0xd113=function(_0x334beb,_0x50afdb){_0x334beb=_0x334beb-0x0;var _0xf89def=_0x113d[_0x334beb];return _0xf89def;};'use strict';var _=require(_0xd113('0x0'));var util=require(_0xd113('0x1'));var logger=require(_0xd113('0x2'))(_0xd113('0x3'));var moment=require('moment');var BPromise=require(_0xd113('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd113('0x5'));var rimraf=require(_0xd113('0x6'));var config=require(_0xd113('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0xd113('0x8')]=function(_0x28478b,_0xa776fc){return _0x28478b['define'](_0xd113('0x9'),attributes,{'tableName':_0xd113('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b83=['catch','ShowWhatsappQueue','find','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetWhatsappQueue','findAll','options','raw','attributes','limit','map','model','include','then','debug','stringify'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x6b83,0xdc));var _0x36b8=function(_0x2d1840,_0x5dc27e){_0x2d1840=_0x2d1840-0x0;var _0xd06a88=_0x6b83[_0x2d1840];return _0xd06a88;};'use strict';var _=require(_0x36b8('0x0'));var util=require('util');var moment=require(_0x36b8('0x1'));var BPromise=require(_0x36b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36b8('0x4'));var logger=require(_0x36b8('0x5'))(_0x36b8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x36b8('0x7')]['http']({'port':0x232a});config[_0x36b8('0x8')]=_[_0x36b8('0x9')](config[_0x36b8('0x8')],{'host':_0x36b8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36b8('0x8')]));require('./whatsappQueue.socket')[_0x36b8('0xb')](socket);function respondWithRpcPromise(_0x1caa7c,_0x1690f4,_0x454d90){return new BPromise(function(_0xf48b8c,_0x1f4dff){return client[_0x36b8('0xc')](_0x1caa7c,_0x454d90)['then'](function(_0x17ad20){logger[_0x36b8('0xd')](_0x36b8('0xe'),_0x1690f4,_0x36b8('0xf'));logger['debug'](_0x36b8('0x10'),_0x1690f4,_0x36b8('0xf'),JSON['stringify'](_0x17ad20));if(_0x17ad20[_0x36b8('0x11')]){if(_0x17ad20['error']['code']===0x1f4){logger[_0x36b8('0x11')](_0x36b8('0xe'),_0x1690f4,_0x17ad20[_0x36b8('0x11')][_0x36b8('0x12')]);return _0x1f4dff(_0x17ad20[_0x36b8('0x11')][_0x36b8('0x12')]);}logger[_0x36b8('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x1690f4,_0x17ad20['error'][_0x36b8('0x12')]);return _0xf48b8c(_0x17ad20[_0x36b8('0x11')][_0x36b8('0x12')]);}else{logger['info'](_0x36b8('0xe'),_0x1690f4,'request\x20sent');_0xf48b8c(_0x17ad20[_0x36b8('0x13')][_0x36b8('0x12')]);}})['catch'](function(_0x3f3909){logger['error'](_0x36b8('0xe'),_0x1690f4,_0x3f3909);_0x1f4dff(_0x3f3909);});});}exports[_0x36b8('0x14')]=function(_0x409569){var _0xf8bb4d=this;return new Promise(function(_0x271712,_0x54904f){return db['WhatsappQueue'][_0x36b8('0x15')]({'raw':_0x409569[_0x36b8('0x16')]?_0x409569['options'][_0x36b8('0x17')]===undefined?!![]:![]:!![],'where':_0x409569[_0x36b8('0x16')]?_0x409569[_0x36b8('0x16')]['where']||null:null,'attributes':_0x409569[_0x36b8('0x16')]?_0x409569[_0x36b8('0x16')][_0x36b8('0x18')]||null:null,'limit':_0x409569[_0x36b8('0x16')]?_0x409569[_0x36b8('0x16')][_0x36b8('0x19')]||null:null,'include':_0x409569['options']?_0x409569['options']['include']?_[_0x36b8('0x1a')](_0x409569[_0x36b8('0x16')]['include'],function(_0x1b7ac2){return{'model':db[_0x1b7ac2[_0x36b8('0x1b')]],'as':_0x1b7ac2['as'],'attributes':_0x1b7ac2['attributes'],'include':_0x1b7ac2['include']?_[_0x36b8('0x1a')](_0x1b7ac2['include'],function(_0x2969f8){return{'model':db[_0x2969f8[_0x36b8('0x1b')]],'as':_0x2969f8['as'],'attributes':_0x2969f8[_0x36b8('0x18')],'include':_0x2969f8[_0x36b8('0x1c')]?_[_0x36b8('0x1a')](_0x2969f8[_0x36b8('0x1c')],function(_0x433ad0){return{'model':db[_0x433ad0['model']],'as':_0x433ad0['as'],'attributes':_0x433ad0['attributes']};}):[]};}):[]};}):[]:[]})[_0x36b8('0x1d')](function(_0x1de0c1){logger['info'](_0x36b8('0x14'),_0x409569);logger[_0x36b8('0x1e')](_0x36b8('0x14'),_0x409569,JSON[_0x36b8('0x1f')](_0x1de0c1));_0x271712(_0x1de0c1);})[_0x36b8('0x20')](function(_0x46d014){logger[_0x36b8('0x11')]('GetWhatsappQueue',_0x46d014[_0x36b8('0x12')],_0x409569);_0x54904f(_0xf8bb4d[_0x36b8('0x11')](0x1f4,_0x46d014[_0x36b8('0x12')]));});});};exports[_0x36b8('0x21')]=function(_0x16e5d8){var _0x470579=this;return new Promise(function(_0x1f732a,_0x269e2b){return db['WhatsappQueue'][_0x36b8('0x22')]({'raw':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8[_0x36b8('0x16')][_0x36b8('0x17')]===undefined?!![]:![]:!![],'where':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8[_0x36b8('0x16')][_0x36b8('0x23')]||null:null,'attributes':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8[_0x36b8('0x16')]['attributes']||null:null,'include':_0x16e5d8[_0x36b8('0x16')]?_0x16e5d8['options']['include']?_[_0x36b8('0x1a')](_0x16e5d8['options'][_0x36b8('0x1c')],function(_0x423fcb){return{'model':db[_0x423fcb[_0x36b8('0x1b')]],'as':_0x423fcb['as'],'attributes':_0x423fcb[_0x36b8('0x18')],'include':_0x423fcb[_0x36b8('0x1c')]?_[_0x36b8('0x1a')](_0x423fcb[_0x36b8('0x1c')],function(_0x1ded85){return{'model':db[_0x1ded85[_0x36b8('0x1b')]],'as':_0x1ded85['as'],'attributes':_0x1ded85[_0x36b8('0x18')],'include':_0x1ded85['include']?_[_0x36b8('0x1a')](_0x1ded85[_0x36b8('0x1c')],function(_0x1b7307){return{'model':db[_0x1b7307[_0x36b8('0x1b')]],'as':_0x1b7307['as'],'attributes':_0x1b7307[_0x36b8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x36b8('0x1d')](function(_0x170b99){logger[_0x36b8('0xd')](_0x36b8('0x21'),_0x16e5d8);logger[_0x36b8('0x1e')](_0x36b8('0x21'),_0x16e5d8,JSON[_0x36b8('0x1f')](_0x170b99));_0x1f732a(_0x170b99);})[_0x36b8('0x20')](function(_0x348abe){logger['error']('ShowWhatsappQueue',_0x348abe['message'],_0x16e5d8);_0x269e2b(_0x470579['error'](0x1f4,_0x348abe[_0x36b8('0x12')]));});});};
\ No newline at end of file
+var _0x8997=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','options','limit','include','attributes','map','catch','ShowWhatsappQueue','find','raw','where','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./whatsappQueue.socket','register','request','then'];(function(_0x111c56,_0x4de5ec){var _0x540598=function(_0x505c30){while(--_0x505c30){_0x111c56['push'](_0x111c56['shift']());}};_0x540598(++_0x4de5ec);}(_0x8997,0x100));var _0x7899=function(_0x3234ab,_0x5926b3){_0x3234ab=_0x3234ab-0x0;var _0x391c4e=_0x8997[_0x3234ab];return _0x391c4e;};'use strict';var _=require(_0x7899('0x0'));var util=require(_0x7899('0x1'));var moment=require('moment');var BPromise=require(_0x7899('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7899('0x3'));var db=require(_0x7899('0x4'))['db'];var utils=require(_0x7899('0x5'));var logger=require(_0x7899('0x6'))(_0x7899('0x7'));var config=require(_0x7899('0x8'));var jayson=require(_0x7899('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x7899('0xa')]=_[_0x7899('0xb')](config['redis'],{'host':_0x7899('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7899('0xa')]));require(_0x7899('0xd'))[_0x7899('0xe')](socket);function respondWithRpcPromise(_0xf120f1,_0x365e2b,_0x13fa44){return new BPromise(function(_0x3bdaa5,_0x3ad2ad){return client[_0x7899('0xf')](_0xf120f1,_0x13fa44)[_0x7899('0x10')](function(_0x23c47b){logger[_0x7899('0x11')](_0x7899('0x12'),_0x365e2b,_0x7899('0x13'));logger[_0x7899('0x14')](_0x7899('0x15'),_0x365e2b,_0x7899('0x13'),JSON[_0x7899('0x16')](_0x23c47b));if(_0x23c47b[_0x7899('0x17')]){if(_0x23c47b[_0x7899('0x17')][_0x7899('0x18')]===0x1f4){logger['error'](_0x7899('0x12'),_0x365e2b,_0x23c47b[_0x7899('0x17')]['message']);return _0x3ad2ad(_0x23c47b['error']['message']);}logger['error'](_0x7899('0x12'),_0x365e2b,_0x23c47b[_0x7899('0x17')][_0x7899('0x19')]);return _0x3bdaa5(_0x23c47b[_0x7899('0x17')][_0x7899('0x19')]);}else{logger[_0x7899('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x365e2b,_0x7899('0x13'));_0x3bdaa5(_0x23c47b['result'][_0x7899('0x19')]);}})['catch'](function(_0x1d63f0){logger[_0x7899('0x17')](_0x7899('0x12'),_0x365e2b,_0x1d63f0);_0x3ad2ad(_0x1d63f0);});});}exports[_0x7899('0x1a')]=function(_0xd699e6){var _0x52a306=this;return new Promise(function(_0x3dbadd,_0x3954af){return db[_0x7899('0x1b')]['findAll']({'raw':_0xd699e6['options']?_0xd699e6[_0x7899('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xd699e6['options']?_0xd699e6[_0x7899('0x1c')]['where']||null:null,'attributes':_0xd699e6[_0x7899('0x1c')]?_0xd699e6[_0x7899('0x1c')]['attributes']||null:null,'limit':_0xd699e6[_0x7899('0x1c')]?_0xd699e6['options'][_0x7899('0x1d')]||null:null,'include':_0xd699e6['options']?_0xd699e6[_0x7899('0x1c')][_0x7899('0x1e')]?_['map'](_0xd699e6[_0x7899('0x1c')][_0x7899('0x1e')],function(_0x5ea37b){return{'model':db[_0x5ea37b['model']],'as':_0x5ea37b['as'],'attributes':_0x5ea37b[_0x7899('0x1f')],'include':_0x5ea37b[_0x7899('0x1e')]?_[_0x7899('0x20')](_0x5ea37b[_0x7899('0x1e')],function(_0xbd5d02){return{'model':db[_0xbd5d02['model']],'as':_0xbd5d02['as'],'attributes':_0xbd5d02[_0x7899('0x1f')],'include':_0xbd5d02[_0x7899('0x1e')]?_['map'](_0xbd5d02[_0x7899('0x1e')],function(_0x3e1c27){return{'model':db[_0x3e1c27['model']],'as':_0x3e1c27['as'],'attributes':_0x3e1c27[_0x7899('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41c978){logger[_0x7899('0x11')](_0x7899('0x1a'),_0xd699e6);logger['debug']('GetWhatsappQueue',_0xd699e6,JSON[_0x7899('0x16')](_0x41c978));_0x3dbadd(_0x41c978);})[_0x7899('0x21')](function(_0x59b5c3){logger[_0x7899('0x17')]('GetWhatsappQueue',_0x59b5c3[_0x7899('0x19')],_0xd699e6);_0x3954af(_0x52a306[_0x7899('0x17')](0x1f4,_0x59b5c3[_0x7899('0x19')]));});});};exports[_0x7899('0x22')]=function(_0x17e3ef){var _0x44d742=this;return new Promise(function(_0x1bf674,_0x551b06){return db['WhatsappQueue'][_0x7899('0x23')]({'raw':_0x17e3ef[_0x7899('0x1c')]?_0x17e3ef[_0x7899('0x1c')][_0x7899('0x24')]===undefined?!![]:![]:!![],'where':_0x17e3ef['options']?_0x17e3ef[_0x7899('0x1c')][_0x7899('0x25')]||null:null,'attributes':_0x17e3ef[_0x7899('0x1c')]?_0x17e3ef['options'][_0x7899('0x1f')]||null:null,'include':_0x17e3ef[_0x7899('0x1c')]?_0x17e3ef[_0x7899('0x1c')][_0x7899('0x1e')]?_['map'](_0x17e3ef[_0x7899('0x1c')]['include'],function(_0x3c04f7){return{'model':db[_0x3c04f7[_0x7899('0x26')]],'as':_0x3c04f7['as'],'attributes':_0x3c04f7['attributes'],'include':_0x3c04f7[_0x7899('0x1e')]?_[_0x7899('0x20')](_0x3c04f7['include'],function(_0x162676){return{'model':db[_0x162676[_0x7899('0x26')]],'as':_0x162676['as'],'attributes':_0x162676['attributes'],'include':_0x162676[_0x7899('0x1e')]?_[_0x7899('0x20')](_0x162676['include'],function(_0x2edfe8){return{'model':db[_0x2edfe8[_0x7899('0x26')]],'as':_0x2edfe8['as'],'attributes':_0x2edfe8['attributes']};}):[]};}):[]};}):[]:[]})[_0x7899('0x10')](function(_0x3b6975){logger[_0x7899('0x11')]('ShowWhatsappQueue',_0x17e3ef);logger[_0x7899('0x14')](_0x7899('0x22'),_0x17e3ef,JSON[_0x7899('0x16')](_0x3b6975));_0x1bf674(_0x3b6975);})[_0x7899('0x21')](function(_0x26d774){logger[_0x7899('0x17')](_0x7899('0x22'),_0x26d774[_0x7899('0x19')],_0x17e3ef);_0x551b06(_0x44d742[_0x7899('0x17')](0x1f4,_0x26d774[_0x7899('0x19')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebf5=['length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xebf5,0x1e2));var _0x5ebf=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xebf5[_0x1f44e4];return _0x591989;};'use strict';var WhatsappQueueEvents=require(_0x5ebf('0x0'));var events=['save',_0x5ebf('0x1'),_0x5ebf('0x2')];function createListener(_0x350c75,_0xbb9292){return function(_0x4dfe93){_0xbb9292[_0x5ebf('0x3')](_0x350c75,_0x4dfe93);};}function removeListener(_0x5475a7,_0x1148f2){return function(){WhatsappQueueEvents[_0x5ebf('0x4')](_0x5475a7,_0x1148f2);};}exports[_0x5ebf('0x5')]=function(_0x2946c1){for(var _0x1d0d5e=0x0,_0x80fa8f=events[_0x5ebf('0x6')];_0x1d0d5e<_0x80fa8f;_0x1d0d5e++){var _0x13ce45=events[_0x1d0d5e];var _0x1a3323=createListener(_0x5ebf('0x7')+_0x13ce45,_0x2946c1);WhatsappQueueEvents['on'](_0x13ce45,_0x1a3323);}};
\ No newline at end of file
+var _0x4377=['remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x4377,0xa1));var _0x7437=function(_0x1b64bd,_0x3071e2){_0x1b64bd=_0x1b64bd-0x0;var _0x303f29=_0x4377[_0x1b64bd];return _0x303f29;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x7437('0x0'),_0x7437('0x1')];function createListener(_0x5d7001,_0x5e48ef){return function(_0x331817){_0x5e48ef[_0x7437('0x2')](_0x5d7001,_0x331817);};}function removeListener(_0x3e7aef,_0x7df4b4){return function(){WhatsappQueueEvents[_0x7437('0x3')](_0x3e7aef,_0x7df4b4);};}exports[_0x7437('0x4')]=function(_0x3642b9){for(var _0x3f59f5=0x0,_0x560142=events[_0x7437('0x5')];_0x3f59f5<_0x560142;_0x3f59f5++){var _0x2ebc9f=events[_0x3f59f5];var _0x892ed1=createListener(_0x7437('0x6')+_0x2ebc9f,_0x3642b9);WhatsappQueueEvents['on'](_0x2ebc9f,_0x892ed1);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7624=['/describe','describe','show','create','put','/:id','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x468523,_0x4acf52){var _0x39dd57=function(_0x152e15){while(--_0x152e15){_0x468523['push'](_0x468523['shift']());}};_0x39dd57(++_0x4acf52);}(_0x7624,0x1e7));var _0x4762=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7624[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4762('0x0'));var express=require(_0x4762('0x1'));var router=express[_0x4762('0x2')]();var fs_extra=require(_0x4762('0x3'));var auth=require(_0x4762('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4762('0x5'));router[_0x4762('0x6')]('/',auth[_0x4762('0x7')](),controller[_0x4762('0x8')]);router[_0x4762('0x6')](_0x4762('0x9'),auth[_0x4762('0x7')](),controller[_0x4762('0xa')]);router[_0x4762('0x6')]('/:id',auth[_0x4762('0x7')](),controller[_0x4762('0xb')]);router['post']('/',auth[_0x4762('0x7')](),controller[_0x4762('0xc')]);router[_0x4762('0xd')]('/:id',auth[_0x4762('0x7')](),controller['update']);router['delete'](_0x4762('0xe'),auth[_0x4762('0x7')](),controller[_0x4762('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x0da7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','path'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x0da7,0x17a));var _0x70da=function(_0x53ed59,_0x4beb34){_0x53ed59=_0x53ed59-0x0;var _0x5834ca=_0x0da7[_0x53ed59];return _0x5834ca;};'use strict';var multer=require(_0x70da('0x0'));var util=require('util');var path=require(_0x70da('0x1'));var timeout=require('connect-timeout');var express=require(_0x70da('0x2'));var router=express[_0x70da('0x3')]();var fs_extra=require(_0x70da('0x4'));var auth=require(_0x70da('0x5'));var interaction=require(_0x70da('0x6'));var config=require(_0x70da('0x7'));var controller=require(_0x70da('0x8'));router[_0x70da('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x70da('0x9')](_0x70da('0xa'),auth['isAuthenticated'](),controller[_0x70da('0xb')]);router[_0x70da('0x9')](_0x70da('0xc'),auth[_0x70da('0xd')](),controller[_0x70da('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x70da('0xf')]);router[_0x70da('0x10')]('/:id',auth[_0x70da('0xd')](),controller['update']);router[_0x70da('0x11')](_0x70da('0xc'),auth[_0x70da('0xd')](),controller[_0x70da('0x12')]);module[_0x70da('0x13')]=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x28d43f,_0x326cb4){var _0x646bf=function(_0x5e5769){while(--_0x5e5769){_0x28d43f['push'](_0x28d43f['shift']());}};_0x646bf(++_0x326cb4);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4e52ac,_0x598968){var _0x38bbf2=function(_0x29ed45){while(--_0x29ed45){_0x4e52ac['push'](_0x4e52ac['shift']());}};_0x38bbf2(++_0x598968);}(_0x7a54,0x106));var _0x47a5=function(_0x198475,_0x38ffb3){_0x198475=_0x198475-0x0;var _0x4efd41=_0x7a54[_0x198475];return _0x4efd41;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1339=['../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','WhatsappQueueReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x484cd0,_0x249fee){var _0x2b6362=function(_0x9140a1){while(--_0x9140a1){_0x484cd0['push'](_0x484cd0['shift']());}};_0x2b6362(++_0x249fee);}(_0x1339,0x1ed));var _0x9133=function(_0x59ff04,_0x508027){_0x59ff04=_0x59ff04-0x0;var _0x43effc=_0x1339[_0x59ff04];return _0x43effc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};exports[_0x9133('0x49')]=function(_0x4f7b1e,_0x2342f4){return db[_0x9133('0x29')][_0x9133('0x49')]()[_0x9133('0x20')](respondWithResult(_0x2342f4,null))['catch'](handleError(_0x2342f4,null));};
\ No newline at end of file
+var _0x236c=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','WhatsappQueueReport','fieldName','key','query','filters','intersection'];(function(_0x46e7d5,_0x54bec0){var _0x4dbf4d=function(_0x5023fe){while(--_0x5023fe){_0x46e7d5['push'](_0x46e7d5['shift']());}};_0x4dbf4d(++_0x54bec0);}(_0x236c,0x155));var _0xc236=function(_0x20faa8,_0x56c2d4){_0x20faa8=_0x20faa8-0x0;var _0xf70ae1=_0x236c[_0x20faa8];return _0xf70ae1;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x21fab8[_0xc236('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308cd6,_0x21d78f){return function(_0x356042){if(!_0x356042){_0x308cd6[_0xc236('0x26')](0x194);}return _0x356042;};}function handleError(_0x561da1,_0x42f248){_0x42f248=_0x42f248||0x1f4;return function(_0x5da4b2){logger['error'](_0x5da4b2[_0xc236('0x27')]);if(_0x5da4b2['name']){delete _0x5da4b2[_0xc236('0x28')];}_0x561da1['status'](_0x42f248)[_0xc236('0x29')](_0x5da4b2);};}exports['index']=function(_0x423842,_0x1d144b){var _0x4f5175={},_0x5a61b5={},_0x265c8d={'count':0x0,'rows':[]};var _0x1fd31d=_[_0xc236('0x2a')](db[_0xc236('0x2b')]['rawAttributes'],function(_0x4e3262){return{'name':_0x4e3262[_0xc236('0x2c')],'type':_0x4e3262['type'][_0xc236('0x2d')]};});_0x5a61b5['model']=_[_0xc236('0x2a')](_0x1fd31d,_0xc236('0x28'));_0x5a61b5['query']=_['keys'](_0x423842[_0xc236('0x2e')]);_0x5a61b5[_0xc236('0x2f')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],_0x5a61b5[_0xc236('0x2e')]);_0x4f5175[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x423842['query']['fields']));_0x4f5175['attributes']=_0x4f5175[_0xc236('0x32')][_0xc236('0x34')]?_0x4f5175[_0xc236('0x32')]:_0x5a61b5[_0xc236('0x31')];if(!_0x423842[_0xc236('0x2e')][_0xc236('0x35')](_0xc236('0x36'))){_0x4f5175['limit']=qs[_0xc236('0x37')](_0x423842[_0xc236('0x2e')][_0xc236('0x37')]);_0x4f5175['offset']=qs[_0xc236('0x1a')](_0x423842[_0xc236('0x2e')][_0xc236('0x1a')]);}_0x4f5175[_0xc236('0x38')]=qs['sort'](_0x423842[_0xc236('0x2e')][_0xc236('0x39')]);_0x4f5175[_0xc236('0x3a')]=qs[_0xc236('0x2f')](_[_0xc236('0x3b')](_0x423842[_0xc236('0x2e')],_0x5a61b5[_0xc236('0x2f')]),_0x1fd31d);if(_0x423842[_0xc236('0x2e')][_0xc236('0x3c')]){_0x4f5175[_0xc236('0x3a')]=_[_0xc236('0x3d')](_0x4f5175[_0xc236('0x3a')],{'$or':_[_0xc236('0x2a')](_0x1fd31d,function(_0x237193){if(_0x237193[_0xc236('0x3e')]!==_0xc236('0x3f')){var _0x46db5a={};_0x46db5a[_0x237193['name']]={'$like':'%'+_0x423842['query']['filter']+'%'};return _0x46db5a;}})});}_0x4f5175=_['merge']({},_0x4f5175,_0x423842[_0xc236('0x40')]);var _0x5c4739={'where':_0x4f5175[_0xc236('0x3a')]};return db[_0xc236('0x2b')][_0xc236('0x1c')](_0x5c4739)[_0xc236('0x24')](function(_0xdf7897){_0x265c8d[_0xc236('0x1c')]=_0xdf7897;if(_0x423842[_0xc236('0x2e')][_0xc236('0x41')]){_0x4f5175[_0xc236('0x42')]=[{'all':!![]}];}return db[_0xc236('0x2b')][_0xc236('0x43')](_0x4f5175);})[_0xc236('0x24')](function(_0x3b2f2f){_0x265c8d[_0xc236('0x44')]=_0x3b2f2f;return _0x265c8d;})[_0xc236('0x24')](respondWithFilteredResult(_0x1d144b,_0x4f5175))['catch'](handleError(_0x1d144b,null));};exports[_0xc236('0x45')]=function(_0x24b851,_0x506ba0){var _0xb90a83={'raw':!![],'where':{'id':_0x24b851[_0xc236('0x46')]['id']}},_0x5b0bc5={};_0x5b0bc5['model']=_[_0xc236('0x47')](db[_0xc236('0x2b')][_0xc236('0x48')]);_0x5b0bc5['query']=_[_0xc236('0x47')](_0x24b851[_0xc236('0x2e')]);_0x5b0bc5[_0xc236('0x2f')]=_['intersection'](_0x5b0bc5[_0xc236('0x31')],_0x5b0bc5[_0xc236('0x2e')]);_0xb90a83[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5b0bc5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x24b851['query'][_0xc236('0x33')]));_0xb90a83['attributes']=_0xb90a83[_0xc236('0x32')][_0xc236('0x34')]?_0xb90a83[_0xc236('0x32')]:_0x5b0bc5[_0xc236('0x31')];if(_0x24b851[_0xc236('0x2e')][_0xc236('0x41')]){_0xb90a83[_0xc236('0x42')]=[{'all':!![]}];}_0xb90a83=_['merge']({},_0xb90a83,_0x24b851[_0xc236('0x40')]);return db['WhatsappQueueReport'][_0xc236('0x49')](_0xb90a83)[_0xc236('0x24')](handleEntityNotFound(_0x506ba0,null))['then'](respondWithResult(_0x506ba0,null))[_0xc236('0x4a')](handleError(_0x506ba0,null));};exports[_0xc236('0x4b')]=function(_0x3c1c5c,_0x161890){return db[_0xc236('0x2b')][_0xc236('0x4b')](_0x3c1c5c[_0xc236('0x4c')],{})['then'](respondWithResult(_0x161890,0xc9))['catch'](handleError(_0x161890,null));};exports[_0xc236('0x23')]=function(_0x2afed2,_0x510f7f){if(_0x2afed2[_0xc236('0x4c')]['id']){delete _0x2afed2[_0xc236('0x4c')]['id'];}return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x2afed2[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x510f7f,null))[_0xc236('0x24')](saveUpdates(_0x2afed2[_0xc236('0x4c')],null))[_0xc236('0x24')](respondWithResult(_0x510f7f,null))['catch'](handleError(_0x510f7f,null));};exports[_0xc236('0x25')]=function(_0x307663,_0x41b7d5){return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x307663[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x41b7d5,null))['then'](removeEntity(_0x41b7d5,null))[_0xc236('0x4a')](handleError(_0x41b7d5,null));};exports[_0xc236('0x4d')]=function(_0x17c86b,_0x16ff63){return db['WhatsappQueueReport'][_0xc236('0x4d')]()[_0xc236('0x24')](respondWithResult(_0x16ff63,null))[_0xc236('0x4a')](handleError(_0x16ff63,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e47=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x1e47,0x115));var _0x71e4=function(_0x5f0129,_0x56c699){_0x5f0129=_0x5f0129-0x0;var _0x231531=_0x1e47[_0x5f0129];return _0x231531;};'use strict';var _=require(_0x71e4('0x0'));var util=require(_0x71e4('0x1'));var logger=require(_0x71e4('0x2'))(_0x71e4('0x3'));var moment=require('moment');var BPromise=require(_0x71e4('0x4'));var rp=require(_0x71e4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x71e4('0x6'));var attributes=require(_0x71e4('0x7'));module[_0x71e4('0x8')]=function(_0x279aa9,_0x276f4d){return _0x279aa9[_0x71e4('0x9')](_0x71e4('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x71e4('0xb'),'fields':[_0x71e4('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd470=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x77d522,_0x156821){var _0x16ca26=function(_0x28a48e){while(--_0x28a48e){_0x77d522['push'](_0x77d522['shift']());}};_0x16ca26(++_0x156821);}(_0xd470,0x194));var _0x0d47=function(_0x196b9d,_0x3d05da){_0x196b9d=_0x196b9d-0x0;var _0x8560e4=_0xd470[_0x196b9d];return _0x8560e4;};'use strict';var _=require(_0x0d47('0x0'));var util=require(_0x0d47('0x1'));var logger=require(_0x0d47('0x2'))(_0x0d47('0x3'));var moment=require(_0x0d47('0x4'));var BPromise=require(_0x0d47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d47('0x6'));var rimraf=require('rimraf');var config=require(_0x0d47('0x7'));var attributes=require(_0x0d47('0x8'));module[_0x0d47('0x9')]=function(_0x2eeaef,_0x8240fc){return _0x2eeaef['define'](_0x0d47('0xa'),attributes,{'tableName':_0x0d47('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0d47('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef5b=['util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','debug','UpdateWhatsappQueueReport','update','where','attributes','lodash'];(function(_0x4a9433,_0x5337cb){var _0x434947=function(_0x3ab6cd){while(--_0x3ab6cd){_0x4a9433['push'](_0x4a9433['shift']());}};_0x434947(++_0x5337cb);}(_0xef5b,0x17f));var _0xbef5=function(_0x29c62e,_0x267c9f){_0x29c62e=_0x29c62e-0x0;var _0x2df4cd=_0xef5b[_0x29c62e];return _0x2df4cd;};'use strict';var _=require(_0xbef5('0x0'));var util=require(_0xbef5('0x1'));var moment=require(_0xbef5('0x2'));var BPromise=require('bluebird');var rs=require(_0xbef5('0x3'));var fs=require('fs');var Redis=require(_0xbef5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbef5('0x5'));var logger=require('../../config/logger')(_0xbef5('0x6'));var config=require(_0xbef5('0x7'));var jayson=require(_0xbef5('0x8'));var client=jayson[_0xbef5('0x9')][_0xbef5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa528,_0x551030,_0x817706){return new BPromise(function(_0x2e8d9b,_0x55184d){return client['request'](_0x4aa528,_0x817706)['then'](function(_0x210be7){logger[_0xbef5('0xb')](_0xbef5('0xc'),_0x551030,_0xbef5('0xd'));logger['debug'](_0xbef5('0xe'),_0x551030,_0xbef5('0xd'),JSON[_0xbef5('0xf')](_0x210be7));if(_0x210be7[_0xbef5('0x10')]){if(_0x210be7['error']['code']===0x1f4){logger[_0xbef5('0x10')](_0xbef5('0xc'),_0x551030,_0x210be7[_0xbef5('0x10')]['message']);return _0x55184d(_0x210be7[_0xbef5('0x10')]['message']);}logger[_0xbef5('0x10')](_0xbef5('0xc'),_0x551030,_0x210be7[_0xbef5('0x10')]['message']);return _0x2e8d9b(_0x210be7[_0xbef5('0x10')][_0xbef5('0x11')]);}else{logger[_0xbef5('0xb')](_0xbef5('0xc'),_0x551030,_0xbef5('0xd'));_0x2e8d9b(_0x210be7[_0xbef5('0x12')]['message']);}})[_0xbef5('0x13')](function(_0x2c610e){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x551030,_0x2c610e);_0x55184d(_0x2c610e);});});}exports[_0xbef5('0x14')]=function(_0x593ad7){var _0x15f3bf=this;return new Promise(function(_0x4e201a,_0x2f1bc3){return db[_0xbef5('0x15')][_0xbef5('0x16')](_0x593ad7[_0xbef5('0x17')],{'raw':_0x593ad7[_0xbef5('0x18')]?_0x593ad7[_0xbef5('0x18')][_0xbef5('0x19')]===undefined?!![]:![]:!![]})[_0xbef5('0x1a')](function(_0x32a225){logger[_0xbef5('0xb')](_0xbef5('0x14'),_0x593ad7);logger[_0xbef5('0x1b')](_0xbef5('0x14'),_0x593ad7,JSON['stringify'](_0x32a225));_0x4e201a(_0x32a225);})[_0xbef5('0x13')](function(_0x99e3a5){logger[_0xbef5('0x10')](_0xbef5('0x14'),_0x99e3a5[_0xbef5('0x11')],_0x593ad7);_0x2f1bc3(_0x15f3bf[_0xbef5('0x10')](0x1f4,_0x99e3a5[_0xbef5('0x11')]));});});};exports[_0xbef5('0x1c')]=function(_0x1e591b){var _0x16ecd3=this;return new Promise(function(_0x3de277,_0x1c2150){return db[_0xbef5('0x15')][_0xbef5('0x1d')](_0x1e591b[_0xbef5('0x17')],{'raw':_0x1e591b[_0xbef5('0x18')]?_0x1e591b[_0xbef5('0x18')][_0xbef5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e591b['options']?_0x1e591b['options'][_0xbef5('0x1e')]||null:null,'attributes':_0x1e591b[_0xbef5('0x18')]?_0x1e591b['options'][_0xbef5('0x1f')]||null:null,'limit':_0x1e591b[_0xbef5('0x18')]?_0x1e591b[_0xbef5('0x18')]['limit']||null:null})[_0xbef5('0x1a')](function(_0x385327){logger[_0xbef5('0xb')](_0xbef5('0x1c'),_0x1e591b);logger[_0xbef5('0x1b')]('UpdateWhatsappQueueReport',_0x1e591b,JSON['stringify'](_0x385327));_0x3de277(_0x385327);})[_0xbef5('0x13')](function(_0x32bbc7){logger['error'](_0xbef5('0x1c'),_0x32bbc7[_0xbef5('0x11')],_0x1e591b);_0x1c2150(_0x16ecd3[_0xbef5('0x10')](0x1f4,_0x32bbc7[_0xbef5('0x11')]));});});};
\ No newline at end of file
+var _0x502f=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateWhatsappQueueReport','stringify','WhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','util'];(function(_0x467519,_0x173a26){var _0x2b5837=function(_0x15ebf3){while(--_0x15ebf3){_0x467519['push'](_0x467519['shift']());}};_0x2b5837(++_0x173a26);}(_0x502f,0x1d0));var _0xf502=function(_0x4cbba6,_0xbaac82){_0x4cbba6=_0x4cbba6-0x0;var _0x4322ac=_0x502f[_0x4cbba6];return _0x4322ac;};'use strict';var _=require('lodash');var util=require(_0xf502('0x0'));var moment=require(_0xf502('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf502('0x2'))['db'];var utils=require(_0xf502('0x3'));var logger=require(_0xf502('0x4'))(_0xf502('0x5'));var config=require(_0xf502('0x6'));var jayson=require(_0xf502('0x7'));var client=jayson[_0xf502('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36f3d2,_0x35675d,_0x558af7){return new BPromise(function(_0x49b858,_0x12a777){return client[_0xf502('0x9')](_0x36f3d2,_0x558af7)[_0xf502('0xa')](function(_0x12c251){logger[_0xf502('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x35675d,_0xf502('0xc'));logger[_0xf502('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x35675d,_0xf502('0xc'),JSON['stringify'](_0x12c251));if(_0x12c251[_0xf502('0xe')]){if(_0x12c251['error']['code']===0x1f4){logger[_0xf502('0xe')](_0xf502('0xf'),_0x35675d,_0x12c251[_0xf502('0xe')][_0xf502('0x10')]);return _0x12a777(_0x12c251[_0xf502('0xe')][_0xf502('0x10')]);}logger['error'](_0xf502('0xf'),_0x35675d,_0x12c251['error'][_0xf502('0x10')]);return _0x49b858(_0x12c251[_0xf502('0xe')][_0xf502('0x10')]);}else{logger[_0xf502('0xb')](_0xf502('0xf'),_0x35675d,_0xf502('0xc'));_0x49b858(_0x12c251[_0xf502('0x11')][_0xf502('0x10')]);}})[_0xf502('0x12')](function(_0x34c9df){logger[_0xf502('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x35675d,_0x34c9df);_0x12a777(_0x34c9df);});});}exports['CreateWhatsappQueueReport']=function(_0x309406){var _0x5dd56a=this;return new Promise(function(_0x407bc7,_0x39d502){return db['WhatsappQueueReport'][_0xf502('0x13')](_0x309406[_0xf502('0x14')],{'raw':_0x309406['options']?_0x309406[_0xf502('0x15')][_0xf502('0x16')]===undefined?!![]:![]:!![]})[_0xf502('0xa')](function(_0xae6bc8){logger[_0xf502('0xb')]('CreateWhatsappQueueReport',_0x309406);logger[_0xf502('0xd')](_0xf502('0x17'),_0x309406,JSON[_0xf502('0x18')](_0xae6bc8));_0x407bc7(_0xae6bc8);})['catch'](function(_0x32f3d8){logger[_0xf502('0xe')](_0xf502('0x17'),_0x32f3d8[_0xf502('0x10')],_0x309406);_0x39d502(_0x5dd56a['error'](0x1f4,_0x32f3d8['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x46e6f9){var _0x15fca0=this;return new Promise(function(_0x3f628d,_0x4e7cd2){return db[_0xf502('0x19')][_0xf502('0x1a')](_0x46e6f9[_0xf502('0x14')],{'raw':_0x46e6f9['options']?_0x46e6f9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e6f9[_0xf502('0x15')]?_0x46e6f9['options'][_0xf502('0x1b')]||null:null,'attributes':_0x46e6f9[_0xf502('0x15')]?_0x46e6f9[_0xf502('0x15')][_0xf502('0x1c')]||null:null,'limit':_0x46e6f9['options']?_0x46e6f9[_0xf502('0x15')][_0xf502('0x1d')]||null:null})[_0xf502('0xa')](function(_0x7b55f7){logger[_0xf502('0xb')]('UpdateWhatsappQueueReport',_0x46e6f9);logger[_0xf502('0xd')](_0xf502('0x1e'),_0x46e6f9,JSON[_0xf502('0x18')](_0x7b55f7));_0x3f628d(_0x7b55f7);})[_0xf502('0x12')](function(_0x4e8d3d){logger[_0xf502('0xe')](_0xf502('0x1e'),_0x4e8d3d[_0xf502('0x10')],_0x46e6f9);_0x4e7cd2(_0x15fca0['error'](0x1f4,_0x4e8d3d[_0xf502('0x10')]));});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65c0=['get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x192cc3,_0x5edef6){var _0x4f1774=function(_0x53d916){while(--_0x53d916){_0x192cc3['push'](_0x192cc3['shift']());}};_0x4f1774(++_0x5edef6);}(_0x65c0,0x172));var _0x065c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x65c0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x065c('0x0'));var path=require(_0x065c('0x1'));var timeout=require(_0x065c('0x2'));var express=require(_0x065c('0x3'));var router=express[_0x065c('0x4')]();var fs_extra=require(_0x065c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x065c('0x6'));var config=require(_0x065c('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x065c('0x8')]('/',auth[_0x065c('0x9')](),controller[_0x065c('0xa')]);router[_0x065c('0x8')](_0x065c('0xb'),auth[_0x065c('0x9')](),controller[_0x065c('0xc')]);router[_0x065c('0x8')]('/:id',auth[_0x065c('0x9')](),controller['show']);router[_0x065c('0xd')]('/',auth[_0x065c('0x9')](),controller[_0x065c('0xe')]);router[_0x065c('0xf')](_0x065c('0x10'),auth[_0x065c('0x9')](),controller[_0x065c('0x11')]);router[_0x065c('0x12')](_0x065c('0x10'),auth['isAuthenticated'](),controller[_0x065c('0x13')]);module[_0x065c('0x14')]=router;
\ No newline at end of file
+var _0x6983=['connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','put','update','destroy','multer','util','path'];(function(_0x33506f,_0xa68303){var _0x5dcb28=function(_0x2e1064){while(--_0x2e1064){_0x33506f['push'](_0x33506f['shift']());}};_0x5dcb28(++_0xa68303);}(_0x6983,0x85));var _0x3698=function(_0x28ac71,_0x1b793c){_0x28ac71=_0x28ac71-0x0;var _0x4680af=_0x6983[_0x28ac71];return _0x4680af;};'use strict';var multer=require(_0x3698('0x0'));var util=require(_0x3698('0x1'));var path=require(_0x3698('0x2'));var timeout=require(_0x3698('0x3'));var express=require(_0x3698('0x4'));var router=express[_0x3698('0x5')]();var fs_extra=require(_0x3698('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3698('0x7'));var controller=require(_0x3698('0x8'));router[_0x3698('0x9')]('/',auth[_0x3698('0xa')](),controller[_0x3698('0xb')]);router[_0x3698('0x9')]('/describe',auth[_0x3698('0xa')](),controller[_0x3698('0xc')]);router[_0x3698('0x9')](_0x3698('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3698('0xa')](),controller['create']);router[_0x3698('0xe')](_0x3698('0xd'),auth[_0x3698('0xa')](),controller[_0x3698('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3698('0x10')]);module['exports']=router;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5523=['ENUM','account','agent','queue','DATE','STRING'];(function(_0x4824c1,_0x12548d){var _0x1972f0=function(_0x1940c2){while(--_0x1940c2){_0x4824c1['push'](_0x4824c1['shift']());}};_0x1972f0(++_0x12548d);}(_0x5523,0x137));var _0x3552=function(_0x43addb,_0xedcfc5){_0x43addb=_0x43addb-0x0;var _0x291816=_0x5523[_0x43addb];return _0x291816;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3552('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3552('0x1')](_0x3552('0x2'),_0x3552('0x3'),_0x3552('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x3552('0x5')]}};
\ No newline at end of file
+var _0x7292=['ENUM','account','agent','DATE','sequelize','exports','STRING'];(function(_0x4f15f9,_0x1a8591){var _0x157fdc=function(_0x15ff7d){while(--_0x15ff7d){_0x4f15f9['push'](_0x4f15f9['shift']());}};_0x157fdc(++_0x1a8591);}(_0x7292,0x6d));var _0x2729=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x7292[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'uniqueid':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x4'),_0x2729('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2729('0x6')]}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05e8=['../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','filters','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3001d9,_0x299963){var _0x315068=function(_0x570f06){while(--_0x570f06){_0x3001d9['push'](_0x3001d9['shift']());}};_0x315068(++_0x299963);}(_0x05e8,0xc9));var _0x805e=function(_0x1e6124,_0x209962){_0x1e6124=_0x1e6124-0x0;var _0x490597=_0x05e8[_0x1e6124];return _0x490597;};'use strict';var emlformat=require(_0x805e('0x0'));var rimraf=require(_0x805e('0x1'));var zipdir=require(_0x805e('0x2'));var jsonpatch=require(_0x805e('0x3'));var rp=require('request-promise');var moment=require(_0x805e('0x4'));var BPromise=require(_0x805e('0x5'));var Mustache=require(_0x805e('0x6'));var util=require(_0x805e('0x7'));var path=require('path');var sox=require(_0x805e('0x8'));var csv=require('to-csv');var ejs=require(_0x805e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x805e('0xa'));var squel=require('squel');var crypto=require(_0x805e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x805e('0xc'));var querystring=require(_0x805e('0xd'));var Papa=require(_0x805e('0xe'));var Redis=require(_0x805e('0xf'));var authService=require(_0x805e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x805e('0x11'));var hardwareService=require(_0x805e('0x12'));var logger=require(_0x805e('0x13'))(_0x805e('0x14'));var utils=require(_0x805e('0x15'));var config=require(_0x805e('0x16'));var licenseUtil=require(_0x805e('0x17'));var db=require(_0x805e('0x18'))['db'];function respondWithStatusCode(_0x3d9d94,_0x5658e7){_0x5658e7=_0x5658e7||0xcc;return function(_0xacb97a){if(_0xacb97a){return _0x3d9d94['sendStatus'](_0x5658e7);}return _0x3d9d94[_0x805e('0x19')](_0x5658e7)[_0x805e('0x1a')]();};}function respondWithResult(_0x1e0a26,_0x8773cd){_0x8773cd=_0x8773cd||0xc8;return function(_0xc9cb3a){if(_0xc9cb3a){return _0x1e0a26[_0x805e('0x19')](_0x8773cd)['json'](_0xc9cb3a);}};}function respondWithFilteredResult(_0x5216f2,_0x4ba0b8){return function(_0x4d6034){if(_0x4d6034){var _0x20367c=typeof _0x4ba0b8[_0x805e('0x1b')]===_0x805e('0x1c')&&typeof _0x4ba0b8[_0x805e('0x1d')]===_0x805e('0x1c');var _0x3af7b9=_0x4d6034[_0x805e('0x1e')];var _0x41d629=_0x20367c?0x0:_0x4ba0b8[_0x805e('0x1b')];var _0x46c265=_0x20367c?_0x4d6034[_0x805e('0x1e')]:_0x4ba0b8[_0x805e('0x1b')]+_0x4ba0b8[_0x805e('0x1d')];var _0x569b6b;if(_0x46c265>=_0x3af7b9){_0x46c265=_0x3af7b9;_0x569b6b=0xc8;}else{_0x569b6b=0xce;}_0x5216f2[_0x805e('0x19')](_0x569b6b);return _0x5216f2[_0x805e('0x1f')](_0x805e('0x20'),_0x41d629+'-'+_0x46c265+'/'+_0x3af7b9)[_0x805e('0x21')](_0x4d6034);}return null;};}function patchUpdates(_0x38c6f0){return function(_0x19a107){try{jsonpatch[_0x805e('0x22')](_0x19a107,_0x38c6f0,!![]);}catch(_0x29171d){return BPromise[_0x805e('0x23')](_0x29171d);}return _0x19a107[_0x805e('0x24')]();};}function saveUpdates(_0x59594a,_0x3750b0){return function(_0x28f8d4){if(_0x28f8d4){return _0x28f8d4[_0x805e('0x25')](_0x59594a)[_0x805e('0x26')](function(_0x93dc98){return _0x93dc98;});}return null;};}function removeEntity(_0x5c8dbd,_0x16e27a){return function(_0x4626c9){if(_0x4626c9){return _0x4626c9[_0x805e('0x27')]()[_0x805e('0x26')](function(){_0x5c8dbd['status'](0xcc)[_0x805e('0x1a')]();});}};}function handleEntityNotFound(_0x413298,_0x388ceb){return function(_0x334a1b){if(!_0x334a1b){_0x413298[_0x805e('0x28')](0x194);}return _0x334a1b;};}function handleError(_0x483a34,_0x5ad757){_0x5ad757=_0x5ad757||0x1f4;return function(_0x28499a){logger['error'](_0x28499a[_0x805e('0x29')]);if(_0x28499a[_0x805e('0x2a')]){delete _0x28499a['name'];}_0x483a34[_0x805e('0x19')](_0x5ad757)['send'](_0x28499a);};}exports[_0x805e('0x2b')]=function(_0x57a9b1,_0x19b766){var _0x38be2a={},_0x183bb5={},_0x1cafea={'count':0x0,'rows':[]};var _0x316913=_[_0x805e('0x2c')](db[_0x805e('0x2d')][_0x805e('0x2e')],function(_0x3b299e){return{'name':_0x3b299e['fieldName'],'type':_0x3b299e[_0x805e('0x2f')][_0x805e('0x30')]};});_0x183bb5[_0x805e('0x31')]=_[_0x805e('0x2c')](_0x316913,_0x805e('0x2a'));_0x183bb5[_0x805e('0x32')]=_[_0x805e('0x33')](_0x57a9b1[_0x805e('0x32')]);_0x183bb5['filters']=_[_0x805e('0x34')](_0x183bb5['model'],_0x183bb5[_0x805e('0x32')]);_0x38be2a['attributes']=_[_0x805e('0x34')](_0x183bb5['model'],qs[_0x805e('0x35')](_0x57a9b1[_0x805e('0x32')]['fields']));_0x38be2a[_0x805e('0x36')]=_0x38be2a[_0x805e('0x36')][_0x805e('0x37')]?_0x38be2a[_0x805e('0x36')]:_0x183bb5['model'];if(!_0x57a9b1[_0x805e('0x32')][_0x805e('0x38')](_0x805e('0x39'))){_0x38be2a['limit']=qs[_0x805e('0x1d')](_0x57a9b1[_0x805e('0x32')][_0x805e('0x1d')]);_0x38be2a[_0x805e('0x1b')]=qs[_0x805e('0x1b')](_0x57a9b1[_0x805e('0x32')][_0x805e('0x1b')]);}_0x38be2a[_0x805e('0x3a')]=qs['sort'](_0x57a9b1[_0x805e('0x32')]['sort']);_0x38be2a[_0x805e('0x3b')]=qs['filters'](_[_0x805e('0x3c')](_0x57a9b1[_0x805e('0x32')],_0x183bb5['filters']),_0x316913);if(_0x57a9b1[_0x805e('0x32')][_0x805e('0x3d')]){_0x38be2a['where']=_[_0x805e('0x3e')](_0x38be2a[_0x805e('0x3b')],{'$or':_[_0x805e('0x2c')](_0x316913,function(_0x21d9b8){if(_0x21d9b8[_0x805e('0x2f')]!==_0x805e('0x3f')){var _0x24e89b={};_0x24e89b[_0x21d9b8[_0x805e('0x2a')]]={'$like':'%'+_0x57a9b1[_0x805e('0x32')]['filter']+'%'};return _0x24e89b;}})});}_0x38be2a=_['merge']({},_0x38be2a,_0x57a9b1['options']);var _0x4c0648={'where':_0x38be2a[_0x805e('0x3b')]};return db[_0x805e('0x2d')]['count'](_0x4c0648)[_0x805e('0x26')](function(_0x167819){_0x1cafea[_0x805e('0x1e')]=_0x167819;if(_0x57a9b1[_0x805e('0x32')][_0x805e('0x40')]){_0x38be2a['include']=[{'all':!![]}];}return db[_0x805e('0x2d')]['findAll'](_0x38be2a);})['then'](function(_0x1c4fc0){_0x1cafea[_0x805e('0x41')]=_0x1c4fc0;return _0x1cafea;})['then'](respondWithFilteredResult(_0x19b766,_0x38be2a))['catch'](handleError(_0x19b766,null));};exports[_0x805e('0x42')]=function(_0x224684,_0x58660e){var _0x3cb2a2={'raw':!![],'where':{'id':_0x224684['params']['id']}},_0x2278ba={};_0x2278ba[_0x805e('0x31')]=_['keys'](db[_0x805e('0x2d')][_0x805e('0x2e')]);_0x2278ba[_0x805e('0x32')]=_[_0x805e('0x33')](_0x224684[_0x805e('0x32')]);_0x2278ba[_0x805e('0x43')]=_[_0x805e('0x34')](_0x2278ba[_0x805e('0x31')],_0x2278ba['query']);_0x3cb2a2[_0x805e('0x36')]=_[_0x805e('0x34')](_0x2278ba[_0x805e('0x31')],qs[_0x805e('0x35')](_0x224684[_0x805e('0x32')][_0x805e('0x35')]));_0x3cb2a2[_0x805e('0x36')]=_0x3cb2a2[_0x805e('0x36')]['length']?_0x3cb2a2[_0x805e('0x36')]:_0x2278ba[_0x805e('0x31')];if(_0x224684[_0x805e('0x32')]['includeAll']){_0x3cb2a2[_0x805e('0x44')]=[{'all':!![]}];}_0x3cb2a2=_[_0x805e('0x3e')]({},_0x3cb2a2,_0x224684['options']);return db[_0x805e('0x2d')][_0x805e('0x45')](_0x3cb2a2)[_0x805e('0x26')](handleEntityNotFound(_0x58660e,null))['then'](respondWithResult(_0x58660e,null))[_0x805e('0x46')](handleError(_0x58660e,null));};exports[_0x805e('0x47')]=function(_0x3c1e0c,_0x4e2dfb){return db[_0x805e('0x2d')][_0x805e('0x47')](_0x3c1e0c[_0x805e('0x48')],{})['then'](respondWithResult(_0x4e2dfb,0xc9))[_0x805e('0x46')](handleError(_0x4e2dfb,null));};exports[_0x805e('0x25')]=function(_0x433ebe,_0x2b87f0){if(_0x433ebe[_0x805e('0x48')]['id']){delete _0x433ebe['body']['id'];}return db['WhatsappTransferReport'][_0x805e('0x45')]({'where':{'id':_0x433ebe['params']['id']}})[_0x805e('0x26')](handleEntityNotFound(_0x2b87f0,null))[_0x805e('0x26')](saveUpdates(_0x433ebe[_0x805e('0x48')],null))[_0x805e('0x26')](respondWithResult(_0x2b87f0,null))['catch'](handleError(_0x2b87f0,null));};exports[_0x805e('0x27')]=function(_0x3f030e,_0x4588e3){return db[_0x805e('0x2d')][_0x805e('0x45')]({'where':{'id':_0x3f030e[_0x805e('0x49')]['id']}})[_0x805e('0x26')](handleEntityNotFound(_0x4588e3,null))['then'](removeEntity(_0x4588e3,null))[_0x805e('0x46')](handleError(_0x4588e3,null));};exports[_0x805e('0x4a')]=function(_0xe90867,_0x2b2286){return db[_0x805e('0x2d')][_0x805e('0x4a')]()[_0x805e('0x26')](respondWithResult(_0x2b2286,null))['catch'](handleError(_0x2b2286,null));};
\ No newline at end of file
+var _0xf398=['order','sort','where','pick','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','name','keys','query','filters','intersection','model','attributes','fields'];(function(_0x34682b,_0x2294ad){var _0x29ab88=function(_0x4a29e5){while(--_0x4a29e5){_0x34682b['push'](_0x34682b['shift']());}};_0x29ab88(++_0x2294ad);}(_0xf398,0x134));var _0x8f39=function(_0x34d74c,_0x4ed50d){_0x34d74c=_0x34d74c-0x0;var _0x38554f=_0xf398[_0x34d74c];return _0x38554f;};'use strict';var emlformat=require(_0x8f39('0x0'));var rimraf=require(_0x8f39('0x1'));var zipdir=require(_0x8f39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f39('0x3'));var Mustache=require(_0x8f39('0x4'));var util=require(_0x8f39('0x5'));var path=require(_0x8f39('0x6'));var sox=require(_0x8f39('0x7'));var csv=require(_0x8f39('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f39('0x9'));var _=require(_0x8f39('0xa'));var squel=require(_0x8f39('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f39('0xc'));var toCsv=require(_0x8f39('0x8'));var querystring=require(_0x8f39('0xd'));var Papa=require(_0x8f39('0xe'));var Redis=require(_0x8f39('0xf'));var authService=require(_0x8f39('0x10'));var qs=require(_0x8f39('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f39('0x12'));var logger=require(_0x8f39('0x13'))(_0x8f39('0x14'));var utils=require('../../config/utils');var config=require(_0x8f39('0x15'));var licenseUtil=require(_0x8f39('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13655d,_0x1730a8){_0x1730a8=_0x1730a8||0xcc;return function(_0x603a26){if(_0x603a26){return _0x13655d['sendStatus'](_0x1730a8);}return _0x13655d[_0x8f39('0x17')](_0x1730a8)[_0x8f39('0x18')]();};}function respondWithResult(_0x239dba,_0xc1c7c3){_0xc1c7c3=_0xc1c7c3||0xc8;return function(_0x7caa4a){if(_0x7caa4a){return _0x239dba[_0x8f39('0x17')](_0xc1c7c3)[_0x8f39('0x19')](_0x7caa4a);}};}function respondWithFilteredResult(_0x2bbf61,_0x21b27d){return function(_0x22c902){if(_0x22c902){var _0x279892=typeof _0x21b27d['offset']===_0x8f39('0x1a')&&typeof _0x21b27d[_0x8f39('0x1b')]===_0x8f39('0x1a');var _0x45f259=_0x22c902[_0x8f39('0x1c')];var _0x5dc921=_0x279892?0x0:_0x21b27d['offset'];var _0x1600e8=_0x279892?_0x22c902[_0x8f39('0x1c')]:_0x21b27d[_0x8f39('0x1d')]+_0x21b27d['limit'];var _0x24b8ca;if(_0x1600e8>=_0x45f259){_0x1600e8=_0x45f259;_0x24b8ca=0xc8;}else{_0x24b8ca=0xce;}_0x2bbf61[_0x8f39('0x17')](_0x24b8ca);return _0x2bbf61[_0x8f39('0x1e')](_0x8f39('0x1f'),_0x5dc921+'-'+_0x1600e8+'/'+_0x45f259)['json'](_0x22c902);}return null;};}function patchUpdates(_0x12178c){return function(_0x6af6bf){try{jsonpatch[_0x8f39('0x20')](_0x6af6bf,_0x12178c,!![]);}catch(_0x28b47b){return BPromise[_0x8f39('0x21')](_0x28b47b);}return _0x6af6bf[_0x8f39('0x22')]();};}function saveUpdates(_0x3f15e1,_0x52eaf6){return function(_0x31b85e){if(_0x31b85e){return _0x31b85e['update'](_0x3f15e1)[_0x8f39('0x23')](function(_0x3e9d3a){return _0x3e9d3a;});}return null;};}function removeEntity(_0xe338d1,_0x1b2210){return function(_0x466483){if(_0x466483){return _0x466483['destroy']()[_0x8f39('0x23')](function(){_0xe338d1[_0x8f39('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b6a23,_0x34ee28){return function(_0x9bd1fe){if(!_0x9bd1fe){_0x4b6a23[_0x8f39('0x24')](0x194);}return _0x9bd1fe;};}function handleError(_0x5da2c6,_0x27b5cb){_0x27b5cb=_0x27b5cb||0x1f4;return function(_0x344042){logger[_0x8f39('0x25')](_0x344042['stack']);if(_0x344042['name']){delete _0x344042['name'];}_0x5da2c6[_0x8f39('0x17')](_0x27b5cb)[_0x8f39('0x26')](_0x344042);};}exports[_0x8f39('0x27')]=function(_0x20e4f9,_0x10c8fb){var _0x3717b2={},_0x373854={},_0x361a68={'count':0x0,'rows':[]};var _0x17a0d1=_[_0x8f39('0x28')](db['WhatsappTransferReport'][_0x8f39('0x29')],function(_0x472de5){return{'name':_0x472de5[_0x8f39('0x2a')],'type':_0x472de5[_0x8f39('0x2b')]['key']};});_0x373854['model']=_[_0x8f39('0x28')](_0x17a0d1,_0x8f39('0x2c'));_0x373854['query']=_[_0x8f39('0x2d')](_0x20e4f9[_0x8f39('0x2e')]);_0x373854[_0x8f39('0x2f')]=_[_0x8f39('0x30')](_0x373854[_0x8f39('0x31')],_0x373854[_0x8f39('0x2e')]);_0x3717b2[_0x8f39('0x32')]=_[_0x8f39('0x30')](_0x373854[_0x8f39('0x31')],qs[_0x8f39('0x33')](_0x20e4f9[_0x8f39('0x2e')]['fields']));_0x3717b2['attributes']=_0x3717b2[_0x8f39('0x32')]['length']?_0x3717b2['attributes']:_0x373854['model'];if(!_0x20e4f9[_0x8f39('0x2e')]['hasOwnProperty']('nolimit')){_0x3717b2[_0x8f39('0x1b')]=qs[_0x8f39('0x1b')](_0x20e4f9[_0x8f39('0x2e')]['limit']);_0x3717b2[_0x8f39('0x1d')]=qs[_0x8f39('0x1d')](_0x20e4f9['query']['offset']);}_0x3717b2[_0x8f39('0x34')]=qs[_0x8f39('0x35')](_0x20e4f9[_0x8f39('0x2e')][_0x8f39('0x35')]);_0x3717b2[_0x8f39('0x36')]=qs[_0x8f39('0x2f')](_[_0x8f39('0x37')](_0x20e4f9['query'],_0x373854[_0x8f39('0x2f')]),_0x17a0d1);if(_0x20e4f9[_0x8f39('0x2e')]['filter']){_0x3717b2[_0x8f39('0x36')]=_[_0x8f39('0x38')](_0x3717b2[_0x8f39('0x36')],{'$or':_['map'](_0x17a0d1,function(_0x4d753a){if(_0x4d753a[_0x8f39('0x2b')]!==_0x8f39('0x39')){var _0x24687d={};_0x24687d[_0x4d753a[_0x8f39('0x2c')]]={'$like':'%'+_0x20e4f9['query']['filter']+'%'};return _0x24687d;}})});}_0x3717b2=_[_0x8f39('0x38')]({},_0x3717b2,_0x20e4f9[_0x8f39('0x3a')]);var _0x27d2bf={'where':_0x3717b2[_0x8f39('0x36')]};return db[_0x8f39('0x3b')][_0x8f39('0x1c')](_0x27d2bf)['then'](function(_0x4a9826){_0x361a68['count']=_0x4a9826;if(_0x20e4f9[_0x8f39('0x2e')][_0x8f39('0x3c')]){_0x3717b2[_0x8f39('0x3d')]=[{'all':!![]}];}return db[_0x8f39('0x3b')][_0x8f39('0x3e')](_0x3717b2);})[_0x8f39('0x23')](function(_0x5e000c){_0x361a68[_0x8f39('0x3f')]=_0x5e000c;return _0x361a68;})[_0x8f39('0x23')](respondWithFilteredResult(_0x10c8fb,_0x3717b2))[_0x8f39('0x40')](handleError(_0x10c8fb,null));};exports['show']=function(_0x2753b8,_0x2c894d){var _0x481754={'raw':!![],'where':{'id':_0x2753b8['params']['id']}},_0x503145={};_0x503145['model']=_['keys'](db[_0x8f39('0x3b')][_0x8f39('0x29')]);_0x503145[_0x8f39('0x2e')]=_[_0x8f39('0x2d')](_0x2753b8[_0x8f39('0x2e')]);_0x503145[_0x8f39('0x2f')]=_['intersection'](_0x503145[_0x8f39('0x31')],_0x503145[_0x8f39('0x2e')]);_0x481754[_0x8f39('0x32')]=_[_0x8f39('0x30')](_0x503145[_0x8f39('0x31')],qs[_0x8f39('0x33')](_0x2753b8[_0x8f39('0x2e')][_0x8f39('0x33')]));_0x481754['attributes']=_0x481754['attributes'][_0x8f39('0x41')]?_0x481754[_0x8f39('0x32')]:_0x503145[_0x8f39('0x31')];if(_0x2753b8['query'][_0x8f39('0x3c')]){_0x481754[_0x8f39('0x3d')]=[{'all':!![]}];}_0x481754=_[_0x8f39('0x38')]({},_0x481754,_0x2753b8[_0x8f39('0x3a')]);return db[_0x8f39('0x3b')][_0x8f39('0x42')](_0x481754)['then'](handleEntityNotFound(_0x2c894d,null))[_0x8f39('0x23')](respondWithResult(_0x2c894d,null))[_0x8f39('0x40')](handleError(_0x2c894d,null));};exports[_0x8f39('0x43')]=function(_0x1b78ba,_0x5151ee){return db[_0x8f39('0x3b')][_0x8f39('0x43')](_0x1b78ba[_0x8f39('0x44')],{})[_0x8f39('0x23')](respondWithResult(_0x5151ee,0xc9))[_0x8f39('0x40')](handleError(_0x5151ee,null));};exports[_0x8f39('0x45')]=function(_0x5b18b6,_0x5939c8){if(_0x5b18b6[_0x8f39('0x44')]['id']){delete _0x5b18b6[_0x8f39('0x44')]['id'];}return db[_0x8f39('0x3b')]['find']({'where':{'id':_0x5b18b6[_0x8f39('0x46')]['id']}})[_0x8f39('0x23')](handleEntityNotFound(_0x5939c8,null))[_0x8f39('0x23')](saveUpdates(_0x5b18b6[_0x8f39('0x44')],null))[_0x8f39('0x23')](respondWithResult(_0x5939c8,null))[_0x8f39('0x40')](handleError(_0x5939c8,null));};exports['destroy']=function(_0x4bbdf4,_0x519c01){return db[_0x8f39('0x3b')][_0x8f39('0x42')]({'where':{'id':_0x4bbdf4[_0x8f39('0x46')]['id']}})[_0x8f39('0x23')](handleEntityNotFound(_0x519c01,null))[_0x8f39('0x23')](removeEntity(_0x519c01,null))['catch'](handleError(_0x519c01,null));};exports[_0x8f39('0x47')]=function(_0x2154d0,_0x3f4589){return db[_0x8f39('0x3b')][_0x8f39('0x47')]()[_0x8f39('0x23')](respondWithResult(_0x3f4589,null))[_0x8f39('0x40')](handleError(_0x3f4589,null));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb603=['rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','api','bluebird','request-promise','path'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0xb603,0xc6));var _0x3b60=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xb603[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x3b60('0x0'));var util=require(_0x3b60('0x1'));var logger=require('../../config/logger')(_0x3b60('0x2'));var moment=require('moment');var BPromise=require(_0x3b60('0x3'));var rp=require(_0x3b60('0x4'));var fs=require('fs');var path=require(_0x3b60('0x5'));var rimraf=require(_0x3b60('0x6'));var config=require(_0x3b60('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x3b60('0x8')]=function(_0x41c038,_0x290b14){return _0x41c038[_0x3b60('0x9')](_0x3b60('0xa'),attributes,{'tableName':_0x3b60('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa722=['../../config/logger','moment','path','rimraf','WhatsappTransferReport','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa722,0x195));var _0x2a72=function(_0x4f7a97,_0x14f986){_0x4f7a97=_0x4f7a97-0x0;var _0x2d97cb=_0xa722[_0x4f7a97];return _0x2d97cb;};'use strict';var _=require(_0x2a72('0x0'));var util=require('util');var logger=require(_0x2a72('0x1'))('api');var moment=require(_0x2a72('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a72('0x3'));var rimraf=require(_0x2a72('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0xfa5eb8,_0x3bf064){return _0xfa5eb8['define'](_0x2a72('0x5'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x2a72('0x6'),'fields':[_0x2a72('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9323=['../../config/logger','jayson/promise','client','http','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ed406,_0x3b3184){var _0x359b38=function(_0x35dc97){while(--_0x35dc97){_0x1ed406['push'](_0x1ed406['shift']());}};_0x359b38(++_0x3b3184);}(_0x9323,0x1dc));var _0x3932=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9323[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x3932('0x0'));var util=require(_0x3932('0x1'));var moment=require(_0x3932('0x2'));var BPromise=require(_0x3932('0x3'));var rs=require(_0x3932('0x4'));var fs=require('fs');var Redis=require(_0x3932('0x5'));var db=require(_0x3932('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3932('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3932('0x8'));var client=jayson[_0x3932('0x9')][_0x3932('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31e994,_0x1e38b4,_0x1288d7){return new BPromise(function(_0x164890,_0x1902f0){return client['request'](_0x31e994,_0x1288d7)[_0x3932('0xb')](function(_0x5d6968){logger['info'](_0x3932('0xc'),_0x1e38b4,_0x3932('0xd'));logger[_0x3932('0xe')](_0x3932('0xf'),_0x1e38b4,_0x3932('0xd'),JSON[_0x3932('0x10')](_0x5d6968));if(_0x5d6968[_0x3932('0x11')]){if(_0x5d6968[_0x3932('0x11')]['code']===0x1f4){logger[_0x3932('0x11')](_0x3932('0xc'),_0x1e38b4,_0x5d6968[_0x3932('0x11')][_0x3932('0x12')]);return _0x1902f0(_0x5d6968[_0x3932('0x11')][_0x3932('0x12')]);}logger[_0x3932('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e38b4,_0x5d6968['error']['message']);return _0x164890(_0x5d6968[_0x3932('0x11')][_0x3932('0x12')]);}else{logger[_0x3932('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e38b4,_0x3932('0xd'));_0x164890(_0x5d6968['result'][_0x3932('0x12')]);}})[_0x3932('0x14')](function(_0x39d105){logger[_0x3932('0x11')](_0x3932('0xc'),_0x1e38b4,_0x39d105);_0x1902f0(_0x39d105);});});}
\ No newline at end of file
+var _0xbbc3=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result'];(function(_0x2526bd,_0x751acd){var _0x5991a7=function(_0x2a1fde){while(--_0x2a1fde){_0x2526bd['push'](_0x2526bd['shift']());}};_0x5991a7(++_0x751acd);}(_0xbbc3,0x9b));var _0x3bbc=function(_0x57157e,_0x2b5be9){_0x57157e=_0x57157e-0x0;var _0x8cd477=_0xbbc3[_0x57157e];return _0x8cd477;};'use strict';var _=require('lodash');var util=require(_0x3bbc('0x0'));var moment=require(_0x3bbc('0x1'));var BPromise=require('bluebird');var rs=require(_0x3bbc('0x2'));var fs=require('fs');var Redis=require(_0x3bbc('0x3'));var db=require(_0x3bbc('0x4'))['db'];var utils=require(_0x3bbc('0x5'));var logger=require('../../config/logger')(_0x3bbc('0x6'));var config=require(_0x3bbc('0x7'));var jayson=require(_0x3bbc('0x8'));var client=jayson[_0x3bbc('0x9')][_0x3bbc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bd915,_0x5c782f,_0x5d1315){return new BPromise(function(_0x3714f0,_0x2d9484){return client[_0x3bbc('0xb')](_0x5bd915,_0x5d1315)[_0x3bbc('0xc')](function(_0x52a5ce){logger['info'](_0x3bbc('0xd'),_0x5c782f,_0x3bbc('0xe'));logger[_0x3bbc('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5c782f,_0x3bbc('0xe'),JSON[_0x3bbc('0x10')](_0x52a5ce));if(_0x52a5ce['error']){if(_0x52a5ce[_0x3bbc('0x11')]['code']===0x1f4){logger[_0x3bbc('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c782f,_0x52a5ce[_0x3bbc('0x11')][_0x3bbc('0x12')]);return _0x2d9484(_0x52a5ce[_0x3bbc('0x11')][_0x3bbc('0x12')]);}logger[_0x3bbc('0x11')](_0x3bbc('0xd'),_0x5c782f,_0x52a5ce[_0x3bbc('0x11')][_0x3bbc('0x12')]);return _0x3714f0(_0x52a5ce[_0x3bbc('0x11')][_0x3bbc('0x12')]);}else{logger[_0x3bbc('0x13')](_0x3bbc('0xd'),_0x5c782f,_0x3bbc('0xe'));_0x3714f0(_0x52a5ce[_0x3bbc('0x14')][_0x3bbc('0x12')]);}})[_0x3bbc('0x15')](function(_0x5cc01a){logger['error'](_0x3bbc('0xd'),_0x5c782f,_0x5cc01a);_0x2d9484(_0x5cc01a);});});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6334=['map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','filter','join','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','seedDB','default','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x6334,0x119));var _0x4633=function(_0x1f1f3b,_0x227aa9){_0x1f1f3b=_0x1f1f3b-0x0;var _0x2e63aa=_0x6334[_0x1f1f3b];return _0x2e63aa;};'use strict';var _=require(_0x4633('0x0'));var db=require(_0x4633('0x1'))['db'];var seedDb=require(_0x4633('0x2'));var checkLicense=require(_0x4633('0x3'));var rpc=require(_0x4633('0x4'));var config=require(_0x4633('0x5'));var logger=require('./config/logger')(_0x4633('0x6'));var pm2=require(_0x4633('0x7'));var pm2Config=require(_0x4633('0x8'));var schedule=require(_0x4633('0x9'));var chat=require(_0x4633('0xa'));var whatsapp=require(_0x4633('0xb'));var transcribe=require(_0x4633('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x4633('0xd')]['sync']()[_0x4633('0xe')](function(){if(config[_0x4633('0xf')]){return seedDb['default']();}})[_0x4633('0xe')](function(){return checkLicense[_0x4633('0x10')]();})[_0x4633('0xe')](function(){return rpc['listen']();})[_0x4633('0xe')](function(_0x2f07fa){logger['info'](_0x2f07fa);return chat[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return whatsapp[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return schedule['start']();})[_0x4633('0xe')](function(){return transcribe[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return provider['start']();})['then'](function(_0x49f5c3){logger[_0x4633('0x12')](_0x49f5c3);return pm2[_0x4633('0x11')](pm2Config);})['then'](function(_0x52955e){var _0x1d967e=_0x52955e['filter'](function(_0xcdffcc){return typeof _0xcdffcc[_0x4633('0x13')]===_0x4633('0x14')&&_0xcdffcc[_0x4633('0x13')]>=0x0;});if(_0x1d967e['length']>0x0){throw new Error(_0x1d967e[_0x4633('0x15')]+_0x4633('0x16')+_[_0x4633('0x17')](_0x1d967e,function(_0x4ffad5){return'\x22'+_0x4ffad5[_0x4633('0x18')][_0x4633('0x19')]+'\x22';}));}logger[_0x4633('0x12')](_0x4633('0x1a'),_[_0x4633('0x17')](_['filter'](_0x52955e,{'status':_0x4633('0x1b')}),_0x4633('0x19'))['join']());logger['info'](_0x4633('0x1c'),_['map'](_[_0x4633('0x1d')](_0x52955e,function(_0x5b5011){return _0x5b5011['status']!==_0x4633('0x1b');}),_0x4633('0x19'))[_0x4633('0x1e')]()||_0x4633('0x1f'));console[_0x4633('0x20')](_0x4633('0x21'));})['catch'](function(_0x2b1976){console['log'](_0x4633('0x22'),_0x2b1976);logger[_0x4633('0x23')](_0x4633('0x24'),_0x2b1976);process[_0x4633('0x25')](0x1);});}main();
\ No newline at end of file
+var _0x55ca=['./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','lodash','./mysqldb','./config/environment'];(function(_0x388d6f,_0x1fa0c5){var _0x5c579a=function(_0x404872){while(--_0x404872){_0x388d6f['push'](_0x388d6f['shift']());}};_0x5c579a(++_0x1fa0c5);}(_0x55ca,0x126));var _0xa55c=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x55ca[_0x4314d7];return _0x5c599b;};'use strict';var _=require(_0xa55c('0x0'));var db=require(_0xa55c('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0xa55c('0x2'));var logger=require(_0xa55c('0x3'))('app');var pm2=require(_0xa55c('0x4'));var pm2Config=require(_0xa55c('0x5'));var schedule=require(_0xa55c('0x6'));var chat=require(_0xa55c('0x7'));var whatsapp=require(_0xa55c('0x8'));var transcribe=require(_0xa55c('0x9'));var provider=require(_0xa55c('0xa'));function main(){return db['sequelize'][_0xa55c('0xb')]()[_0xa55c('0xc')](function(){if(config['seedDB']){return seedDb[_0xa55c('0xd')]();}})[_0xa55c('0xc')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xa55c('0xe')]();})[_0xa55c('0xc')](function(_0x381d07){logger[_0xa55c('0xf')](_0x381d07);return chat[_0xa55c('0x10')]();})[_0xa55c('0xc')](function(){return whatsapp[_0xa55c('0x10')]();})[_0xa55c('0xc')](function(){return schedule[_0xa55c('0x10')]();})[_0xa55c('0xc')](function(){return transcribe['start']();})['then'](function(){return provider[_0xa55c('0x10')]();})['then'](function(_0x5a3672){logger['info'](_0x5a3672);return pm2[_0xa55c('0x10')](pm2Config);})[_0xa55c('0xc')](function(_0x462cd6){var _0x938bd6=_0x462cd6[_0xa55c('0x11')](function(_0x247e77){return typeof _0x247e77['exitCode']===_0xa55c('0x12')&&_0x247e77[_0xa55c('0x13')]>=0x0;});if(_0x938bd6[_0xa55c('0x14')]>0x0){throw new Error(_0x938bd6[_0xa55c('0x14')]+_0xa55c('0x15')+_[_0xa55c('0x16')](_0x938bd6,function(_0x51590e){return'\x22'+_0x51590e[_0xa55c('0x17')][_0xa55c('0x18')]+'\x22';}));}logger['info'](_0xa55c('0x19'),_[_0xa55c('0x16')](_[_0xa55c('0x11')](_0x462cd6,{'status':_0xa55c('0x1a')}),_0xa55c('0x18'))[_0xa55c('0x1b')]());logger['info']('Offline\x20apps:',_[_0xa55c('0x16')](_[_0xa55c('0x11')](_0x462cd6,function(_0xade4c4){return _0xade4c4['status']!==_0xa55c('0x1a');}),_0xa55c('0x18'))['join']()||_0xa55c('0x1c'));console[_0xa55c('0x1d')](_0xa55c('0x1e'));})[_0xa55c('0x1f')](function(_0x234372){console['log'](_0xa55c('0x20'),_0x234372);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x234372);process['exit'](0x1);});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb688=['use','user','findOne','params','disposition','then','unmanaged','json','Unmanaged.','headers','authorization','startsWith','find','authenticate','pass','Wrong\x20credentials.','catch','Bearer','status','Unknown\x20authorization\x20format','query','apikey','getUuid','User','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','promisify','secret','secrets','payload','verify','hex','floor','HS512','toString','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','messengerSoundNotification','isAuthenticated'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xb688,0xcf));var _0x8b68=function(_0x12d4b9,_0x39a033){_0x12d4b9=_0x12d4b9-0x0;var _0x2022cc=_0xb688[_0x12d4b9];return _0x2022cc;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x8b68('0x0'));var hardwareConf=require(_0x8b68('0x1'));var licenseUtil=require(_0x8b68('0x2'));var encryptor=require(_0x8b68('0x3'));var _=require(_0x8b68('0x4'));var jwt=require(_0x8b68('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x8b68('0x6'));var basicAuth=require(_0x8b68('0x7'));var crypto=require(_0x8b68('0x8'));var BPromise=require(_0x8b68('0x9'));var util=require('util');var moment=require(_0x8b68('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0x8b68('0xb')]});var userAttributes=['id',_0x8b68('0xc'),_0x8b68('0xd'),_0x8b68('0xe'),_0x8b68('0xf'),_0x8b68('0x10'),_0x8b68('0x11'),_0x8b68('0x12'),_0x8b68('0x13'),_0x8b68('0x14'),_0x8b68('0x15'),_0x8b68('0x16'),_0x8b68('0x17'),'smsPause',_0x8b68('0x18'),_0x8b68('0x19'),_0x8b68('0x1a'),_0x8b68('0x1b'),_0x8b68('0x1c'),_0x8b68('0x1d'),_0x8b68('0x1e'),_0x8b68('0x1f'),_0x8b68('0x20'),'phoneBarAutoAnswer',_0x8b68('0x21'),'phoneBarDnd','phoneBarEnableRecording',_0x8b68('0x22'),_0x8b68('0x23'),_0x8b68('0x24'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0x8b68('0x25'),'hotdesk',_0x8b68('0x26'),_0x8b68('0x27'),_0x8b68('0x28'),_0x8b68('0x29'),'wssPort',_0x8b68('0x2a'),_0x8b68('0x2b'),'downloadAttachments',_0x8b68('0x2c'),_0x8b68('0x2d'),_0x8b68('0x2e'),_0x8b68('0x2f'),_0x8b68('0x30'),'emailAutoanswerDelay',_0x8b68('0x31'),_0x8b68('0x32'),_0x8b68('0x33'),_0x8b68('0x34'),_0x8b68('0x35'),_0x8b68('0x36'),'whatsappAutoanswer','whatsappAutoanswerDelay',_0x8b68('0x37')];exports['isChatInteractionAuthorized']=function(){return this[_0x8b68('0x38')](!![])[_0x8b68('0x39')](function(_0x13aee5,_0x21ecca,_0x32ddc5){if(_0x13aee5[_0x8b68('0x3a')]){_0x32ddc5();}else{return db['ChatInteraction'][_0x8b68('0x3b')]({'where':{'id':_0x13aee5[_0x8b68('0x3c')]['id']},'attributes':['id','closed',_0x8b68('0x3d')],'raw':!![]})[_0x8b68('0x3e')](function(_0x240b0b){if(_0x240b0b&&_0x240b0b['closed']){return _0x21ecca['status'](_0x240b0b['disposition']===_0x8b68('0x3f')?0x195:0x193)[_0x8b68('0x40')]({'message':_0x240b0b[_0x8b68('0x3d')]==='unmanaged'?_0x8b68('0x41'):'Forbidden.'});}else{_0x32ddc5();}})['catch'](function(_0x3865ea){_0x32ddc5(_0x3865ea);});}});};exports['isAuthenticated']=function isAuthenticated(_0x26cad7){return compose()[_0x8b68('0x39')](function(_0x48e2c8,_0x494ce4,_0x357635){var _0x1cd230;if(_0x48e2c8[_0x8b68('0x42')][_0x8b68('0x43')]){if(_[_0x8b68('0x44')](_0x48e2c8[_0x8b68('0x42')][_0x8b68('0x43')],'Basic')){var _0x3b6d1b=basicAuth(_0x48e2c8);db['User'][_0x8b68('0x45')]({'where':{'name':_0x3b6d1b[_0x8b68('0xe')]}})['then'](function(_0x216aa6){if(!_0x216aa6||!_0x216aa6[_0x8b68('0x46')](_0x3b6d1b[_0x8b68('0x47')])){return _0x494ce4['status'](0x191)['json']({'message':_0x8b68('0x48')});}_0x48e2c8[_0x8b68('0x3a')]={'id':_0x216aa6['id']};_0x357635();})[_0x8b68('0x49')](function(_0x394cca){_0x357635(_0x394cca);});}else if(_[_0x8b68('0x44')](_0x48e2c8[_0x8b68('0x42')][_0x8b68('0x43')],_0x8b68('0x4a'))){validateJwt(_0x48e2c8,_0x494ce4,_0x357635);}else{if(_0x26cad7){_0x357635();}else{return _0x494ce4[_0x8b68('0x4b')](0x193)[_0x8b68('0x40')]({'message':_0x8b68('0x4c')});}}}else if(_0x48e2c8[_0x8b68('0x4d')][_0x8b68('0x4e')]){try{var _0x439d36={'audience':hardwareConf[_0x8b68('0x4f')](),'issuer':hardwareConf[_0x8b68('0x4f')]()};verifyJwt(_0x48e2c8[_0x8b68('0x4d')][_0x8b68('0x4e')],_0x439d36)[_0x8b68('0x3e')](function(_0x18dfae){return db[_0x8b68('0x50')][_0x8b68('0x45')]({'where':{'id':_0x18dfae['sub']}})['then'](function(_0x24026c){_0x1cd230=_0x24026c;return db[_0x8b68('0x51')][_0x8b68('0x3b')]({'where':{'id':0x1},'attributes':[_0x8b68('0x52'),_0x8b68('0x53')],'raw':!![]});})[_0x8b68('0x3e')](function(_0x75a62f){if(!_0x1cd230||!_[_0x8b68('0x54')](_0x1cd230['apiKeyNonce'],_0x18dfae[_0x8b68('0x55')])){return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':_0x8b68('0x56')});}if(_0x1cd230[_0x8b68('0x57')]){return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':_0x8b68('0x58')});}if(_0x1cd230['blocked']){if(_0x75a62f[_0x8b68('0x53')]>0x0){if(moment(_0x1cd230[_0x8b68('0x59')])[_0x8b68('0x5a')](_0x75a62f[_0x8b68('0x53')],_0x8b68('0x5b'))>moment()){return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x494ce4[_0x8b68('0x4b')](0x191)[_0x8b68('0x40')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x48e2c8[_0x8b68('0x3a')]={'id':_0x1cd230['id']};_0x357635();});})[_0x8b68('0x49')](function(){return _0x494ce4['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x4a093e){_0x357635(_0x4a093e);}}else if(_0x26cad7){_0x357635();}else{return _0x494ce4[_0x8b68('0x4b')](0x193)[_0x8b68('0x40')]({'message':'Unknown\x20authorization\x20format'});}})[_0x8b68('0x39')](function(_0x5960fc,_0x6a2a54,_0x3841d2){if(_0x5960fc['user']){db[_0x8b68('0x50')]['find']({'where':{'id':_0x5960fc['user']['id']},'attributes':userAttributes})['then'](function(_0x3ec20a){if(!_0x3ec20a){return _0x6a2a54[_0x8b68('0x4b')](0x194)[_0x8b68('0x40')]({'message':_0x8b68('0x5c')});}_0x5960fc['user']=_0x3ec20a;_0x3841d2();})[_0x8b68('0x49')](function(_0x58a5e3){_0x3841d2(_0x58a5e3);});}else if(_0x26cad7){_0x3841d2();}else{return _0x6a2a54[_0x8b68('0x4b')](0x194)[_0x8b68('0x40')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x8b68('0x5d')]=function canUpdate(){return compose()[_0x8b68('0x39')](function(_0x422f91,_0x225d67,_0x5f136f){return licenseUtil[_0x8b68('0x5e')]()[_0x8b68('0x3e')](function(_0xd2b889){if(_0xd2b889[_0x8b68('0x5f')]){_0x5f136f();}else{return _0x225d67[_0x8b68('0x4b')](0x193)[_0x8b68('0x40')]({'message':_0x8b68('0x60')});}})[_0x8b68('0x49')](function(_0x29e265){_0x5f136f(_0x29e265);});});};exports[_0x8b68('0x61')]=function isWebrtcLicence(){return compose()[_0x8b68('0x39')](function(_0x2a2a99,_0x1af430,_0x108c8d){return licenseUtil[_0x8b68('0x5e')]()[_0x8b68('0x3e')](function(_0x50099e){if(_0x50099e[_0x8b68('0x62')]){_0x108c8d();}else{return _0x1af430[_0x8b68('0x4b')](0x193)['json']({'message':_0x8b68('0x60')});}})['catch'](function(_0x58cf66){_0x108c8d(_0x58cf66);});});};exports['isMiddleware']=function(_0x1c8a3e,_0x35874b,_0x34047c){_0x1c8a3e[_0x8b68('0x63')]=!![];return _0x34047c();};exports['signToken']=function signToken(_0x522f47){return signJwt(_0x522f47);};exports[_0x8b68('0x64')]=function(_0x163fd5,_0x1e900f){if(!_0x163fd5['user']){return _0x1e900f[_0x8b68('0x4b')](0x194)[_0x8b68('0x40')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x429ebb={'payload':{'id':_0x163fd5[_0x8b68('0x3a')]['id'],'role':_0x163fd5['user'][_0x8b68('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x429ebb)[_0x8b68('0x3e')](function(_0x51bf1b){_0x1e900f[_0x8b68('0x65')](_0x8b68('0x66'),_0x51bf1b);_0x1e900f['redirect']('/dashboards/general');})['catch'](function(_0x28f82d){return _0x1e900f[_0x8b68('0x4b')](0x1f4)[_0x8b68('0x67')](_0x28f82d);});};exports[_0x8b68('0x68')]=function(_0x55aad3){if(_['isNil'](_0x55aad3[_0x8b68('0x69')])||_[_0x8b68('0x6a')](_0x55aad3[_0x8b68('0x6b')])){return null;}else{return createJwt(_0x55aad3);}};exports['generateApiKey']=function(_0x2053a7){_0x2053a7[_0x8b68('0x69')]=generateNonce();_0x2053a7[_0x8b68('0x6b')]=generateIssuedAt();return createJwt(_0x2053a7);};exports['regenerateApiKey']=function(_0x49dc86,_0x4825df){var _0x2b1fd8=_0x49dc86[_0x8b68('0x4d')]['apikey'];if(_0x2b1fd8){var _0xba7139={'nonce':_0x4825df[_0x8b68('0x69')],'iat':_0x4825df[_0x8b68('0x6b')],'audience':hardwareConf[_0x8b68('0x4f')](),'issuer':hardwareConf[_0x8b68('0x4f')]()};return verifyJwt(_0x2b1fd8,_0xba7139)['then'](function(){return generateApiKey(_0x4825df);});}else{throw{'message':_0x8b68('0x6c')};}};exports[_0x8b68('0x6d')]=function(_0x32cd05){var _0x31a090=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x31a090[_0x8b68('0x6e')](_0x32cd05))throw new db[(_0x8b68('0x6f'))][(_0x8b68('0x70'))](_0x8b68('0x71'));return;};exports['validatePasswordHistory']=function(_0x3f423e,_0x1a85da,_0x1e8694){var _0x3cc1f4=encryptor[_0x8b68('0x72')](_0x1a85da)[_0x8b68('0x73')](',');for(var _0x3a90ba=0x0;_0x3a90ba<_0x1e8694;_0x3a90ba++){if(!_0x3cc1f4[_0x3a90ba])break;if(_0x3f423e[_0x8b68('0x74')]()===_0x3cc1f4[_0x3a90ba][_0x8b68('0x74')]()){var _0x271dbe=util[_0x8b68('0x75')](_0x8b68('0x76'),_0x1e8694);if(_0x1e8694===0x1){_0x271dbe=_0x8b68('0x77');}throw new db[(_0x8b68('0x6f'))][(_0x8b68('0x70'))](_0x271dbe);}}return;};exports[_0x8b68('0x78')]=function(_0xf07a90,_0x3da7b4){var _0xae90f0=_0x3da7b4?encryptor[_0x8b68('0x72')](_0x3da7b4)['split'](','):[];if(_0xae90f0[_0x8b68('0x79')]===0x5){_0xae90f0['splice'](-0x1,0x1);}_0xae90f0['unshift'](_0xf07a90);return encryptor[_0x8b68('0x7a')](_0xae90f0['join'](','));};function signJwt(_0x43f826){var _0x61dac8=BPromise[_0x8b68('0x7b')](jwt['sign'],{'context':jwt});var _0x3a034a=_0x43f826[_0x8b68('0x7c')]||config[_0x8b68('0x7d')][_0x8b68('0xb')];return new BPromise(function(_0x401c20,_0x3031d1){_0x61dac8(_0x43f826[_0x8b68('0x7e')],_0x3a034a,_0x43f826['options'])['then'](function(_0x20aac1){_0x401c20(_0x20aac1);})[_0x8b68('0x49')](function(_0x250528){_0x3031d1(_0x250528);});});}function verifyJwt(_0x371526,_0x3c930d,_0x37da34){var _0x2d1519=BPromise[_0x8b68('0x7b')](jwt[_0x8b68('0x7f')],{'context':jwt});var _0x36d47a=_0x37da34||config[_0x8b68('0x7d')][_0x8b68('0xb')];return new BPromise(function(_0x316652,_0x195f82){_0x2d1519(_0x371526,_0x36d47a,_0x3c930d)[_0x8b68('0x3e')](function(_0x414096){_0x316652(_0x414096);})[_0x8b68('0x49')](function(_0x10e8b7){_0x195f82(_0x10e8b7);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x8b68('0x80'));}function generateIssuedAt(){return Math[_0x8b68('0x81')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x574aca){var _0x39a04e={'payload':{'iat':_0x574aca[_0x8b68('0x6b')],'nonce':_0x574aca[_0x8b68('0x69')]},'options':{'algorithm':_0x8b68('0x82'),'subject':_0x574aca['id'][_0x8b68('0x83')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x8b68('0x4f')]()}};return signJwt(_0x39a04e)[_0x8b68('0x3e')](function(_0x5c24f8){return{'iat':_0x574aca[_0x8b68('0x6b')],'nonce':_0x574aca['apiKeyNonce'],'token':_0x5c24f8};});}
\ No newline at end of file
+var _0x1775=['isEqual','apiKeyNonce','nonce','status','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','use','User\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','closed','disposition','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','find','sub','then','Setting','allowedLoginAttempts','blockDuration'];(function(_0x11dbce,_0x3ed3c6){var _0x5dae4d=function(_0x19d82d){while(--_0x19d82d){_0x11dbce['push'](_0x11dbce['shift']());}};_0x5dae4d(++_0x3ed3c6);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x5177('0x0'));var hardwareConf=require(_0x5177('0x1'));var licenseUtil=require(_0x5177('0x2'));var encryptor=require(_0x5177('0x3'));var _=require(_0x5177('0x4'));var jwt=require(_0x5177('0x5'));var expressJwt=require(_0x5177('0x6'));var compose=require(_0x5177('0x7'));var basicAuth=require(_0x5177('0x8'));var crypto=require(_0x5177('0x9'));var BPromise=require(_0x5177('0xa'));var util=require(_0x5177('0xb'));var moment=require(_0x5177('0xc'));var validateJwt=expressJwt({'secret':config[_0x5177('0xd')][_0x5177('0xe')]});var userAttributes=['id',_0x5177('0xf'),_0x5177('0x10'),_0x5177('0x11'),_0x5177('0x12'),_0x5177('0x13'),_0x5177('0x14'),_0x5177('0x15'),'md5secret','voicePause',_0x5177('0x16'),_0x5177('0x17'),_0x5177('0x18'),_0x5177('0x19'),_0x5177('0x1a'),'pauseType',_0x5177('0x1b'),_0x5177('0x1c'),_0x5177('0x1d'),_0x5177('0x1e'),_0x5177('0x1f'),_0x5177('0x20'),_0x5177('0x21'),_0x5177('0x22'),_0x5177('0x23'),_0x5177('0x24'),_0x5177('0x25'),_0x5177('0x26'),_0x5177('0x27'),_0x5177('0x28'),_0x5177('0x29'),_0x5177('0x2a'),_0x5177('0x2b'),_0x5177('0x2c'),_0x5177('0x2d'),'userProfileId',_0x5177('0x2e'),_0x5177('0x2f'),_0x5177('0x30'),_0x5177('0x31'),'downloadOmnichannelInteractions',_0x5177('0x32'),_0x5177('0x33'),_0x5177('0x34'),'chatAutoanswer',_0x5177('0x35'),'emailAutoanswer',_0x5177('0x36'),_0x5177('0x37'),_0x5177('0x38'),_0x5177('0x39'),_0x5177('0x3a'),_0x5177('0x3b'),_0x5177('0x3c'),_0x5177('0x3d'),_0x5177('0x3e'),_0x5177('0x3f')];exports[_0x5177('0x40')]=function(){return this[_0x5177('0x41')](!![])['use'](function(_0x3dcea1,_0x556f96,_0x30b60f){if(_0x3dcea1[_0x5177('0x42')]){_0x30b60f();}else{return db[_0x5177('0x43')][_0x5177('0x44')]({'where':{'id':_0x3dcea1['params']['id']},'attributes':['id',_0x5177('0x45'),'disposition'],'raw':!![]})['then'](function(_0x19a0c2){if(_0x19a0c2&&_0x19a0c2[_0x5177('0x45')]){return _0x556f96['status'](_0x19a0c2[_0x5177('0x46')]==='unmanaged'?0x195:0x193)[_0x5177('0x47')]({'message':_0x19a0c2[_0x5177('0x46')]==='unmanaged'?_0x5177('0x48'):_0x5177('0x49')});}else{_0x30b60f();}})[_0x5177('0x4a')](function(_0x7f86e){_0x30b60f(_0x7f86e);});}});};exports[_0x5177('0x41')]=function isAuthenticated(_0x1cef5d){return compose()['use'](function(_0x498fcd,_0x45cf20,_0x1c660e){var _0x7dae59;if(_0x498fcd[_0x5177('0x4b')][_0x5177('0x4c')]){if(_[_0x5177('0x4d')](_0x498fcd[_0x5177('0x4b')][_0x5177('0x4c')],'Basic')){var _0x42e1db=basicAuth(_0x498fcd);db[_0x5177('0x4e')]['find']({'where':{'name':_0x42e1db[_0x5177('0x11')]}})['then'](function(_0x172b36){if(!_0x172b36||!_0x172b36[_0x5177('0x4f')](_0x42e1db[_0x5177('0x50')])){return _0x45cf20['status'](0x191)['json']({'message':_0x5177('0x51')});}_0x498fcd[_0x5177('0x42')]={'id':_0x172b36['id']};_0x1c660e();})[_0x5177('0x4a')](function(_0x3735e9){_0x1c660e(_0x3735e9);});}else if(_[_0x5177('0x4d')](_0x498fcd[_0x5177('0x4b')][_0x5177('0x4c')],_0x5177('0x52'))){validateJwt(_0x498fcd,_0x45cf20,_0x1c660e);}else{if(_0x1cef5d){_0x1c660e();}else{return _0x45cf20['status'](0x193)[_0x5177('0x47')]({'message':_0x5177('0x53')});}}}else if(_0x498fcd['query'][_0x5177('0x54')]){try{var _0x2a26fc={'audience':hardwareConf[_0x5177('0x55')](),'issuer':hardwareConf[_0x5177('0x55')]()};verifyJwt(_0x498fcd[_0x5177('0x56')][_0x5177('0x54')],_0x2a26fc)['then'](function(_0x40c607){return db[_0x5177('0x4e')][_0x5177('0x57')]({'where':{'id':_0x40c607[_0x5177('0x58')]}})[_0x5177('0x59')](function(_0xacaa96){_0x7dae59=_0xacaa96;return db[_0x5177('0x5a')]['findOne']({'where':{'id':0x1},'attributes':[_0x5177('0x5b'),_0x5177('0x5c')],'raw':!![]});})['then'](function(_0x486dd5){if(!_0x7dae59||!_[_0x5177('0x5d')](_0x7dae59[_0x5177('0x5e')],_0x40c607[_0x5177('0x5f')])){return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x61')});}if(_0x7dae59[_0x5177('0x62')]){return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x63')});}if(_0x7dae59[_0x5177('0x64')]){if(_0x486dd5[_0x5177('0x5c')]>0x0){if(moment(_0x7dae59[_0x5177('0x65')])['add'](_0x486dd5[_0x5177('0x5c')],_0x5177('0x66'))>moment()){return _0x45cf20['status'](0x191)[_0x5177('0x47')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x63')});}}_0x498fcd['user']={'id':_0x7dae59['id']};_0x1c660e();});})['catch'](function(){return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x63')});});}catch(_0x177c4b){_0x1c660e(_0x177c4b);}}else if(_0x1cef5d){_0x1c660e();}else{return _0x45cf20[_0x5177('0x60')](0x193)[_0x5177('0x47')]({'message':_0x5177('0x53')});}})[_0x5177('0x67')](function(_0x4e287e,_0xe1c75c,_0x51ecc0){if(_0x4e287e['user']){db[_0x5177('0x4e')][_0x5177('0x57')]({'where':{'id':_0x4e287e['user']['id']},'attributes':userAttributes})[_0x5177('0x59')](function(_0x508178){if(!_0x508178){return _0xe1c75c['status'](0x194)[_0x5177('0x47')]({'message':_0x5177('0x68')});}_0x4e287e[_0x5177('0x42')]=_0x508178;_0x51ecc0();})[_0x5177('0x4a')](function(_0x191973){_0x51ecc0(_0x191973);});}else if(_0x1cef5d){_0x51ecc0();}else{return _0xe1c75c[_0x5177('0x60')](0x194)[_0x5177('0x47')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x5177('0x67')](function(_0x511dc0,_0x23be2a,_0x3476d3){return licenseUtil[_0x5177('0x69')]()[_0x5177('0x59')](function(_0x570812){if(_0x570812[_0x5177('0x6a')]){_0x3476d3();}else{return _0x23be2a[_0x5177('0x60')](0x193)[_0x5177('0x47')]({'message':_0x5177('0x6b')});}})[_0x5177('0x4a')](function(_0x10b370){_0x3476d3(_0x10b370);});});};exports[_0x5177('0x6c')]=function isWebrtcLicence(){return compose()[_0x5177('0x67')](function(_0x1ada68,_0x296a98,_0x3fec49){return licenseUtil['getLicense']()[_0x5177('0x59')](function(_0x481bda){if(_0x481bda['webrtc']){_0x3fec49();}else{return _0x296a98['status'](0x193)[_0x5177('0x47')]({'message':_0x5177('0x6b')});}})['catch'](function(_0x326405){_0x3fec49(_0x326405);});});};exports[_0x5177('0x6d')]=function(_0x208483,_0x4891fe,_0x1d4ae4){_0x208483['isMiddleware']=!![];return _0x1d4ae4();};exports['signToken']=function signToken(_0x5bd97b){return signJwt(_0x5bd97b);};exports[_0x5177('0x6e')]=function(_0x37d5dd,_0x1300d7){if(!_0x37d5dd['user']){return _0x1300d7['status'](0x194)[_0x5177('0x47')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x262ac4={'payload':{'id':_0x37d5dd[_0x5177('0x42')]['id'],'role':_0x37d5dd[_0x5177('0x42')][_0x5177('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x262ac4)[_0x5177('0x59')](function(_0xa0edd7){_0x1300d7[_0x5177('0x6f')](_0x5177('0x70'),_0xa0edd7);_0x1300d7[_0x5177('0x71')](_0x5177('0x72'));})[_0x5177('0x4a')](function(_0xb08267){return _0x1300d7[_0x5177('0x60')](0x1f4)['send'](_0xb08267);});};exports['retrieveApiKey']=function(_0x29ff0f){if(_['isNil'](_0x29ff0f[_0x5177('0x5e')])||_['isNil'](_0x29ff0f[_0x5177('0x73')])){return null;}else{return createJwt(_0x29ff0f);}};exports[_0x5177('0x74')]=function(_0x1e838a){_0x1e838a['apiKeyNonce']=generateNonce();_0x1e838a['apiKeyIat']=generateIssuedAt();return createJwt(_0x1e838a);};exports[_0x5177('0x75')]=function(_0x43b5b9,_0x2eb560){var _0xcc37fb=_0x43b5b9['query']['apikey'];if(_0xcc37fb){var _0x3f0e89={'nonce':_0x2eb560[_0x5177('0x5e')],'iat':_0x2eb560[_0x5177('0x73')],'audience':hardwareConf[_0x5177('0x55')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xcc37fb,_0x3f0e89)[_0x5177('0x59')](function(){return generateApiKey(_0x2eb560);});}else{throw{'message':_0x5177('0x76')};}};exports[_0x5177('0x77')]=function(_0x589da8){var _0x2b39ba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2b39ba[_0x5177('0x78')](_0x589da8))throw new db[(_0x5177('0x79'))]['ValidationError'](_0x5177('0x7a'));return;};exports['validatePasswordHistory']=function(_0x40dfd6,_0x39fb92,_0x3268bd){var _0x5101fc=encryptor[_0x5177('0x7b')](_0x39fb92)[_0x5177('0x7c')](',');for(var _0xea44e=0x0;_0xea44e<_0x3268bd;_0xea44e++){if(!_0x5101fc[_0xea44e])break;if(_0x40dfd6[_0x5177('0x7d')]()===_0x5101fc[_0xea44e][_0x5177('0x7d')]()){var _0x74589e=util[_0x5177('0x7e')](_0x5177('0x7f'),_0x3268bd);if(_0x3268bd===0x1){_0x74589e='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize']['ValidationError'](_0x74589e);}}return;};exports[_0x5177('0x80')]=function(_0x18222f,_0x35aa22){var _0x75cc0e=_0x35aa22?encryptor[_0x5177('0x7b')](_0x35aa22)[_0x5177('0x7c')](','):[];if(_0x75cc0e['length']===0x5){_0x75cc0e['splice'](-0x1,0x1);}_0x75cc0e[_0x5177('0x81')](_0x18222f);return encryptor[_0x5177('0x82')](_0x75cc0e[_0x5177('0x83')](','));};function signJwt(_0x336017){var _0x123d40=BPromise[_0x5177('0x84')](jwt[_0x5177('0x85')],{'context':jwt});var _0xd9c1db=_0x336017[_0x5177('0x86')]||config['secrets'][_0x5177('0xe')];return new BPromise(function(_0x25a0be,_0x57e199){_0x123d40(_0x336017[_0x5177('0x87')],_0xd9c1db,_0x336017[_0x5177('0x88')])['then'](function(_0x69c264){_0x25a0be(_0x69c264);})[_0x5177('0x4a')](function(_0x11a63c){_0x57e199(_0x11a63c);});});}function verifyJwt(_0x4be4b2,_0x23b246,_0x400e27){var _0x5f5bd5=BPromise['promisify'](jwt[_0x5177('0x89')],{'context':jwt});var _0x4f76d7=_0x400e27||config[_0x5177('0xd')]['session'];return new BPromise(function(_0x2771fa,_0x16f17c){_0x5f5bd5(_0x4be4b2,_0x4f76d7,_0x23b246)['then'](function(_0x2af938){_0x2771fa(_0x2af938);})[_0x5177('0x4a')](function(_0x1975a3){_0x16f17c(_0x1975a3);});});}function generateNonce(){return crypto[_0x5177('0x8a')](0x10)[_0x5177('0x8b')](_0x5177('0x8c'));}function generateIssuedAt(){return Math[_0x5177('0x8d')](Date['now']()/0x3e8)[_0x5177('0x8b')]();}function createJwt(_0x54aabd){var _0x54c301={'payload':{'iat':_0x54aabd[_0x5177('0x73')],'nonce':_0x54aabd[_0x5177('0x5e')]},'options':{'algorithm':'HS512','subject':_0x54aabd['id'][_0x5177('0x8b')](),'issuer':hardwareConf[_0x5177('0x55')](),'audience':hardwareConf[_0x5177('0x55')]()}};return signJwt(_0x54c301)[_0x5177('0x59')](function(_0x19b587){return{'iat':_0x54aabd[_0x5177('0x73')],'nonce':_0x54aabd[_0x5177('0x5e')],'token':_0x19b587};});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb24=['search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','ids','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','catch','CmContact','keys','startsWith','cf_','slice','length','type','map','lodash','./sql-utils','findAll','getContactsSubquery','resolve','then'];(function(_0x1963de,_0x340358){var _0x5aa543=function(_0x4b6eff){while(--_0x4b6eff){_0x1963de['push'](_0x1963de['shift']());}};_0x5aa543(++_0x340358);}(_0xcb24,0x144));var _0x4cb2=function(_0x553277,_0x15dea4){_0x553277=_0x553277-0x0;var _0x6f7ee2=_0xcb24[_0x553277];return _0x6f7ee2;};'use strict';var _=require(_0x4cb2('0x0'));var sqlUtils=require(_0x4cb2('0x1'));var db=require('../../mysqldb')['db'];exports[_0x4cb2('0x2')]=function(_0x584efa,_0x4e25ae,_0x3a7905,_0x14e14c){var _0x54daef={'count':0x0,'rows':[]};var _0x335a1b=sqlUtils['skipContactsQuery'](_0x4e25ae,_0x584efa);if(_0x335a1b){return Promise['resolve'](_0x54daef);}var _0x31ea59=sqlUtils[_0x4cb2('0x3')]();var _0xeaccb9={};var _0x238d4d=![];var _0x40eff7=![];return Promise[_0x4cb2('0x4')]()[_0x4cb2('0x5')](function(){if(_0x584efa[_0x4cb2('0x6')]){return sqlUtils[_0x4cb2('0x7')](_0x584efa['search'],_0x14e14c);}else{return sqlUtils[_0x4cb2('0x8')](_0x584efa,_0x14e14c);}})['then'](function(_0x3a1874){_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xa')]);_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xb')]);_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xc')]);_0x31ea59[_0x4cb2('0x9')](_0x3a1874[_0x4cb2('0xd')][_0x4cb2('0xe')]);_0xeaccb9=_0x3a1874[_0x4cb2('0xf')];_0x40eff7=_0x3a1874[_0x4cb2('0xd')][_0x4cb2('0x10')];return sqlUtils['checkListsRestrictions'](_0x4e25ae,_0x584efa,_0x40eff7);})[_0x4cb2('0x5')](function(_0x518f95){_0x31ea59[_0x4cb2('0x9')](_0x518f95);var _0x30348e=_0x584efa[_0x4cb2('0x6')]?_0xeaccb9[_0x4cb2('0x11')]:_0x584efa[_0x4cb2('0x12')];_0x238d4d=_0x30348e?!![]:![];return sqlUtils[_0x4cb2('0x13')](_0x31ea59,_0x30348e);})[_0x4cb2('0x5')](function(_0x4664ae){_0x54daef['count']=_0x4664ae;if(_0x54daef[_0x4cb2('0x14')]===0x0){return;}if(_0x584efa[_0x4cb2('0x15')]){_0x40eff7=!![];}return sqlUtils[_0x4cb2('0x16')](_0x31ea59,_0x584efa[_0x4cb2('0xb')],_0x3a7905,_0x238d4d,_0xeaccb9[_0x4cb2('0xe')],_0x40eff7);})[_0x4cb2('0x5')](function(_0xd90f4e){if(!_0xd90f4e){return[];}return sqlUtils[_0x4cb2('0x17')](_0xd90f4e,_0x584efa,_0x3a7905);})[_0x4cb2('0x5')](function(_0x3b60cc){_0x54daef['rows']=_0x3b60cc;return _0x54daef;})[_0x4cb2('0x18')](function(_0x906200){throw _0x906200;});};exports['describe']=function(){var _0x34d040={};var _0x196334=[];return db[_0x4cb2('0x19')]['describe']()['then'](function(_0x55ac64){_0x34d040=_0x55ac64;var _0x4bcc44=Object[_0x4cb2('0x1a')](_0x34d040)[_0x4cb2('0xc')](function(_0x1eb744){return _[_0x4cb2('0x1b')](_0x1eb744,_0x4cb2('0x1c'))?_0x1eb744:undefined;});var _0x4e927f=_0x4bcc44['map'](function(_0x226c82){return db['CmCustomField']['findOne']({'where':{'id':_0x226c82[_0x4cb2('0x1d')](0x3)},'raw':!![]});});return Promise['all'](_0x4e927f);})[_0x4cb2('0x5')](function(_0x8d88a8){for(var _0x85589a=0x0;_0x85589a<_0x8d88a8[_0x4cb2('0x1e')];_0x85589a++){if(_0x8d88a8[_0x85589a]){var _0x3c72fd=_0x4cb2('0x1c')+_0x8d88a8[_0x85589a]['id'];_0x34d040[_0x3c72fd]['fieldType']=_0x8d88a8[_0x85589a][_0x4cb2('0x1f')];}}_0x196334=_[_0x4cb2('0x20')](Object[_0x4cb2('0x1a')](_0x34d040),function(_0x17c54f){return{'name':_0x17c54f,'type':_0x34d040[_0x17c54f][_0x4cb2('0x1f')]};});return _0x196334;})['catch'](function(_0x4c21f7){throw _0x4c21f7;});};
\ No newline at end of file
+var _0x49d3=['startsWith','map','CmCustomField','findOne','slice','length','fieldType','type','lodash','./sql-utils','findAll','skipContactsQuery','resolve','parseAdvancedSearchFilter','search','parseQueryParameters','then','where','default','fields','user','clause','tags','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x49d3,0xf6));var _0x349d=function(_0x26e28f,_0x57a426){_0x26e28f=_0x26e28f-0x0;var _0x5c46fe=_0x49d3[_0x26e28f];return _0x5c46fe;};'use strict';var _=require(_0x349d('0x0'));var sqlUtils=require(_0x349d('0x1'));var db=require('../../mysqldb')['db'];exports[_0x349d('0x2')]=function(_0x95cbcb,_0x5537a7,_0x1af23b,_0x2db74b){var _0x239b3d={'count':0x0,'rows':[]};var _0x4a697a=sqlUtils[_0x349d('0x3')](_0x5537a7,_0x95cbcb);if(_0x4a697a){return Promise['resolve'](_0x239b3d);}var _0x5b5775=sqlUtils['getContactsSubquery']();var _0x1a3db7={};var _0x23eadb=![];var _0x3b8cd8=![];return Promise[_0x349d('0x4')]()['then'](function(){if(_0x95cbcb['search']){return sqlUtils[_0x349d('0x5')](_0x95cbcb[_0x349d('0x6')],_0x2db74b);}else{return sqlUtils[_0x349d('0x7')](_0x95cbcb,_0x2db74b);}})[_0x349d('0x8')](function(_0x2caf56){_0x5b5775[_0x349d('0x9')](_0x2caf56[_0x349d('0xa')]);_0x5b5775[_0x349d('0x9')](_0x2caf56[_0x349d('0xb')]);_0x5b5775[_0x349d('0x9')](_0x2caf56['filter']);_0x5b5775['where'](_0x2caf56[_0x349d('0xc')][_0x349d('0xd')]);_0x1a3db7=_0x2caf56[_0x349d('0xe')];_0x3b8cd8=_0x2caf56[_0x349d('0xc')]['skip'];return sqlUtils['checkListsRestrictions'](_0x5537a7,_0x95cbcb,_0x3b8cd8);})['then'](function(_0x38d2b8){_0x5b5775[_0x349d('0x9')](_0x38d2b8);var _0xd2b2d3=_0x95cbcb[_0x349d('0x6')]?_0x1a3db7['ids']:_0x95cbcb[_0x349d('0xf')];_0x23eadb=_0xd2b2d3?!![]:![];return sqlUtils[_0x349d('0x10')](_0x5b5775,_0xd2b2d3);})[_0x349d('0x8')](function(_0x24b1d4){_0x239b3d[_0x349d('0x11')]=_0x24b1d4;if(_0x239b3d['count']===0x0){return;}if(_0x95cbcb[_0x349d('0x12')]){_0x3b8cd8=!![];}return sqlUtils[_0x349d('0x13')](_0x5b5775,_0x95cbcb[_0x349d('0xb')],_0x1af23b,_0x23eadb,_0x1a3db7[_0x349d('0xd')],_0x3b8cd8);})[_0x349d('0x8')](function(_0x1e202a){if(!_0x1e202a){return[];}return sqlUtils[_0x349d('0x14')](_0x1e202a,_0x95cbcb,_0x1af23b);})[_0x349d('0x8')](function(_0xc8454e){_0x239b3d[_0x349d('0x15')]=_0xc8454e;return _0x239b3d;})[_0x349d('0x16')](function(_0x53032b){throw _0x53032b;});};exports[_0x349d('0x17')]=function(){var _0xf82e6={};var _0x2239c4=[];return db[_0x349d('0x18')][_0x349d('0x17')]()[_0x349d('0x8')](function(_0x56575b){_0xf82e6=_0x56575b;var _0x41ebae=Object[_0x349d('0x19')](_0xf82e6)['filter'](function(_0x4743bd){return _[_0x349d('0x1a')](_0x4743bd,'cf_')?_0x4743bd:undefined;});var _0x46a333=_0x41ebae[_0x349d('0x1b')](function(_0x287224){return db[_0x349d('0x1c')][_0x349d('0x1d')]({'where':{'id':_0x287224[_0x349d('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x46a333);})[_0x349d('0x8')](function(_0x22e536){for(var _0x274b44=0x0;_0x274b44<_0x22e536[_0x349d('0x1f')];_0x274b44++){if(_0x22e536[_0x274b44]){var _0x436822='cf_'+_0x22e536[_0x274b44]['id'];_0xf82e6[_0x436822][_0x349d('0x20')]=_0x22e536[_0x274b44]['type'];}}_0x2239c4=_[_0x349d('0x1b')](Object[_0x349d('0x19')](_0xf82e6),function(_0x693046){return{'name':_0x693046,'type':_0xf82e6[_0x693046][_0x349d('0x21')]};});return _0x2239c4;})[_0x349d('0x16')](function(_0x390a50){throw _0x390a50;});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe105=['Tags','clone','isEmpty','t.id\x20IN\x20?','SELECT','COUNT(*)','exports','squel','../parsers/qs','../../mysqldb','agent','search','ListId','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','email','createdAt','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','datetime','castTo','DATE','buildExpression','type','default','text','start','split','map','clause','and','tags','ids','User','uc.UserId\x20=\x20?','value','user','skip','keys','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','limit','offset','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','toString','TagIds'];(function(_0x325169,_0x1b3ee8){var _0x202a0b=function(_0x5772d3){while(--_0x5772d3){_0x325169['push'](_0x325169['shift']());}};_0x202a0b(++_0x1b3ee8);}(_0xe105,0x19f));var _0x5e10=function(_0x3ddb8e,_0x5e12a5){_0x3ddb8e=_0x3ddb8e-0x0;var _0x398328=_0xe105[_0x3ddb8e];return _0x398328;};'use strict';var _=require('lodash');var squel=require(_0x5e10('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x5e10('0x1'));var utils=require('../interaction/utils');var db=require(_0x5e10('0x2'))['db'];function skipContactsQuery(_0x31db84,_0x326d23){var _0x481f6b=![];if(_0x31db84['role']===_0x5e10('0x3')&&!_0x326d23[_0x5e10('0x4')]&&!_0x326d23[_0x5e10('0x5')]&&_0x326d23['autocomplete']!=='true'){_0x481f6b=!![];}return _0x481f6b;}function getContactsSubquery(){return squel[_0x5e10('0x6')]()[_0x5e10('0x7')](_0x5e10('0x8'),'c')['where'](_0x5e10('0x9'));}function applyJoinClauses(_0x1a7118,_0x699def){var _0x49b705=_0x699def?'c':_0x5e10('0xa');_0x1a7118[_0x5e10('0xb')]('cm_user_has_contacts','uc',_0x5e10('0xc')+_0x49b705+_0x5e10('0xd'))['left_join']('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20'+_0x49b705+_0x5e10('0xd'))[_0x5e10('0xb')]('tools_tags','t',_0x5e10('0xe'));return _0x1a7118;}function addFieldsToQuery(_0x8e48df,_0x1a69d8,_0x34352f,_0x5ddd27,_0x3dd597){var _0x32c31b=_0x3dd597?'c':_0x5e10('0xa');if(!_0x1a69d8){_0x1a69d8=['id',_0x5e10('0xf'),_0x5e10('0x10'),'phone',_0x5e10('0x11'),_0x5e10('0x12'),_0x5e10('0x13'),_0x5e10('0x5'),'CompanyId',_0x5e10('0x14'),'updatedAt','deletedAt','TagIds'];}else if(!_0x1a69d8['includes']('id')){_0x1a69d8[_0x5e10('0x15')]('id');}var _0x4cb282=_0x34352f&&_0x3dd597||!_0x34352f&&!_0x3dd597;if(_0x5ddd27){_0x4cb282=_0x5ddd27&&_0x3dd597||!_0x5ddd27&&!_0x3dd597;}_0x1a69d8[_0x5e10('0x16')](function(_0x341313){if(_0x341313==='TagIds'){if(_0x4cb282){_0x8e48df[_0x5e10('0x17')](_0x5e10('0x18'),_0x341313);}else if(_0x34352f||_0x5ddd27){_0x8e48df[_0x5e10('0x17')](_0x32c31b+'.'+_0x341313);}}else{_0x8e48df['field'](_0x32c31b+'.'+_0x341313);}});return _0x8e48df;}function getSqlClauses(){var _0x15bf7c={'default':squel[_0x5e10('0x19')](),'fields':squel[_0x5e10('0x19')](),'filter':squel[_0x5e10('0x19')](),'tags':{'clause':squel[_0x5e10('0x19')](),'ids':null},'user':{'clause':squel[_0x5e10('0x19')](),'skip':![]}};return _0x15bf7c;}function parseTagParameter(_0x398bb9){var _0x52537b=squel[_0x5e10('0x19')]();if(_0x398bb9){var _0x19c818=utils[_0x5e10('0x1a')](_0x398bb9);_0x19c818[_0x5e10('0x16')](function(_0x1fac3e){_0x52537b['or'](_0x5e10('0x1b'),'%,'+_0x1fac3e+',%');});}return _0x52537b;}function parseSearchFilter(_0x5dbb0d){var _0x5e3c71=squel[_0x5e10('0x19')]();if(_0x5dbb0d){var _0xd041ef=_0x5dbb0d[_0x5e10('0x1c')]('\x5c','\x5c\x5c')[_0x5e10('0x1c')](/'/g,'\x27\x27');if(_0xd041ef['split']('\x20')['length']>0x1){_0x5e3c71['or'](_0x5e10('0x1d'),qs[_0x5e10('0x1e')](_0xd041ef,!![]),null);}else{if(qs[_0x5e10('0x1f')](_0xd041ef)){_0x5e3c71['or'](_0x5e10('0x20'),_0xd041ef+'%');_0x5e3c71['or'](_0x5e10('0x21'),_0xd041ef+'%');_0x5e3c71['or'](_0x5e10('0x22'),_0xd041ef+'%');_0x5e3c71['or']('c.fax\x20LIKE\x20?',_0xd041ef+'%');}else if(qs[_0x5e10('0x23')](_0xd041ef)){_0x5e3c71['or']('c.email\x20LIKE\x20?',_0xd041ef+'%');}else{_0x5e3c71['or'](_0x5e10('0x24'),'%'+_0xd041ef+'%');_0x5e3c71['or'](_0x5e10('0x25'),'%'+_0xd041ef+'%');_0x5e3c71['or']('c.email\x20LIKE\x20?','%'+_0xd041ef+'%');}}}return _0x5e3c71;}function parseAdvancedSearchFilter(_0x2945b3,_0x8482b4){var _0x331dbb=getSqlClauses();var _0x28815a=as[_0x5e10('0x26')](_0x2945b3);var _0x28f1bc=_0x28815a[_0x5e10('0x27')];for(var _0x5e7473=0x0;_0x5e7473<_0x28815a[_0x5e10('0x28')][_0x5e10('0x29')];_0x5e7473++){var _0xa8b36b=_0x28815a[_0x5e10('0x28')][_0x5e7473];var _0x2017e3='c';var _0xe5e160=_[_0x5e10('0x2a')](_0x8482b4,[_0x5e10('0x2b'),_0xa8b36b[_0x5e10('0x17')]]);if(_0xe5e160){if(_0xa8b36b[_0x5e10('0x17')]===_0x5e10('0x2c')||_0xe5e160['fieldType']===_0x5e10('0x2d')){_0xa8b36b[_0x5e10('0x2e')]=_0x5e10('0x2f');}var _0x1a6c87=as[_0x5e10('0x30')](_0x2017e3,_0xe5e160[_0x5e10('0x31')],_0xa8b36b);_0x331dbb[_0x5e10('0x32')][_0x28f1bc](_0x1a6c87[_0x5e10('0x33')],_0x1a6c87['value'][_0x5e10('0x34')],_0x1a6c87['value']['end']);}else{if(_0xa8b36b[_0x5e10('0x17')]==='Tag'){var _0x2d0d60=_0xa8b36b['value'][_0x5e10('0x35')](',')[_0x5e10('0x36')](function(_0x1c4d5e){return Number(_0x1c4d5e);});var _0x561e21=parseTagParameter(_0x2d0d60);_0x331dbb['tags'][_0x5e10('0x37')][_0x5e10('0x38')](_0x561e21);_0x331dbb[_0x5e10('0x39')][_0x5e10('0x3a')]=_0x2d0d60;}else if(_0xa8b36b[_0x5e10('0x17')]===_0x5e10('0x3b')){_0x331dbb['user'][_0x5e10('0x37')][_0x5e10('0x38')](_0x5e10('0x3c'),_0xa8b36b[_0x5e10('0x3d')]);_0x331dbb[_0x5e10('0x3e')][_0x5e10('0x3f')]=!![];}}}return _0x331dbb;}function parseModelFields(_0x4f4144,_0x5abd99){var _0x4f7092=squel['expr']();var _0x5df86b=_(_0x4f4144)[_0x5e10('0x40')]()['map'](function(_0x52b7d9){return _[_0x5e10('0x41')](_0x5abd99,[_0x5e10('0x2b'),_0x52b7d9])?_0x52b7d9:undefined;})[_0x5e10('0x42')]()['value']();if(_0x4f4144[_0x5e10('0x43')]){_0x5df86b[_0x5e10('0x15')](_0x5e10('0x43'));}if(_0x4f4144[_0x5e10('0x3b')]){_0x5df86b[_0x5e10('0x15')]('User');}if(_0x5df86b[_0x5e10('0x29')]>0x0){_0x5df86b[_0x5e10('0x16')](function(_0x5b8484){if(_0x5b8484==='ListId'){_0x4f7092[_0x5e10('0x38')]('c.ListId\x20IN\x20?',[][_0x5e10('0x44')](_0x4f4144[_0x5b8484]));}else if(_0x5b8484===_0x5e10('0x43')){var _0x3a2428='%'+_0x4f4144[_0x5b8484]+'%';_0x4f7092['and'](_0x5e10('0x45'),_0x3a2428);}else if(_0x5b8484===_0x5e10('0x3b')){_0x4f7092[_0x5e10('0x38')](_0x5e10('0x3c'),_0x4f4144[_0x5b8484]);}else{_0x4f7092['and']('c.'+_0x5b8484+'\x20=\x20?',_0x4f4144[_0x5b8484]);}});}return _0x4f7092;}function parseQueryParameters(_0x3ee48c,_0x57e233){var _0x3402c3=getSqlClauses();return Promise[_0x5e10('0x46')]()[_0x5e10('0x47')](function(){return parseModelFields(_0x3ee48c,_0x57e233);})[_0x5e10('0x47')](function(_0x1014ea){_0x3402c3[_0x5e10('0x48')]['and'](_0x1014ea);return parseTagParameter(_0x3ee48c[_0x5e10('0x49')]);})[_0x5e10('0x47')](function(_0x10350c){_0x3402c3[_0x5e10('0x39')][_0x5e10('0x37')][_0x5e10('0x38')](_0x10350c);return parseSearchFilter(_0x3ee48c[_0x5e10('0x4a')]);})[_0x5e10('0x47')](function(_0x1a2f82){_0x3402c3[_0x5e10('0x4a')]=_0x1a2f82;return _0x3402c3;});}function checkListsRestrictions(_0x34faa3,_0xf77f12,_0x30173b){var _0x3de4f3=squel[_0x5e10('0x19')]();return Promise[_0x5e10('0x46')]()[_0x5e10('0x47')](function(){if(_0xf77f12[_0x5e10('0x4')]&&_0x34faa3[_0x5e10('0x4b')]===_0x5e10('0x3')&&!_0x30173b){return _0x34faa3[_0x5e10('0x4c')]({'attributes':['id'],'raw':!![]});}})[_0x5e10('0x47')](function(_0x3babce){if(_0x3babce){if(_0x3babce[_0x5e10('0x29')]===0x0){_0x3de4f3[_0x5e10('0x38')](_0x5e10('0x4d'));}else{_0x3de4f3['and'](_0x5e10('0x4e'),_[_0x5e10('0x36')](_0x3babce,'id'));}}})[_0x5e10('0x47')](function(){return _0x3de4f3;});}function buildContactsQuery(_0xc48d27,_0x158dde,_0x3b2d46,_0x441976,_0x2b395f,_0x375570){if(_0x158dde){_0x158dde=_0x3b2d46[_0x5e10('0x4f')];}_0xc48d27=addFieldsToQuery(_0xc48d27,_0x158dde,_0x441976,_0x375570,!![]);var _0x3c2f87=squel[_0x5e10('0x6')]();_0x3c2f87=addFieldsToQuery(_0x3c2f87,_0x158dde,_0x441976,_0x375570,![]);if(_0x441976||_0x375570){_0xc48d27=applyJoinClauses(_0xc48d27,!![]);_0xc48d27[_0x5e10('0x50')]('c.id');if(_0x3b2d46[_0x5e10('0x51')]){_0x3c2f87['limit'](_0x3b2d46['limit']);}if(_0x3b2d46[_0x5e10('0x52')]){_0x3c2f87[_0x5e10('0x52')](_0x3b2d46[_0x5e10('0x52')]);}}else{_0x3c2f87=applyJoinClauses(_0x3c2f87,![]);_0x3c2f87[_0x5e10('0x50')]('subqry.id');if(_0x3b2d46[_0x5e10('0x51')]){_0xc48d27['limit'](_0x3b2d46[_0x5e10('0x51')]);}if(_0x3b2d46[_0x5e10('0x52')]){_0xc48d27[_0x5e10('0x52')](_0x3b2d46[_0x5e10('0x52')]);}}_0x3c2f87[_0x5e10('0x53')](_0x2b395f);if(_0x3b2d46['order']){_0x3b2d46[_0x5e10('0x54')]['forEach'](function(_0x4a5629){_0xc48d27[_0x5e10('0x54')]('c.'+_0x4a5629[0x0],_0x4a5629[0x1]===_0x5e10('0x55')?![]:!![]);_0x3c2f87['order']('subqry.'+_0x4a5629[0x0],_0x4a5629[0x1]===_0x5e10('0x55')?![]:!![]);});}_0x3c2f87[_0x5e10('0x7')](_0xc48d27,_0x5e10('0xa'));return _0x3c2f87;}function getFilteredContacts(_0x5f0fae){var _0x2fea9d=[];return db['Tag'][_0x5e10('0x56')]({'attributes':['id','name',_0x5e10('0x57')],'raw':!![]})[_0x5e10('0x47')](function(_0x2533f4){_0x2fea9d=_[_0x5e10('0x58')](_0x2533f4,'id');var _0x4d59ba={'type':db[_0x5e10('0x59')][_0x5e10('0x5a')]['SELECT'],'model':db[_0x5e10('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5e10('0x5c')]['query'](_0x5f0fae[_0x5e10('0x5d')](),_0x4d59ba);})['then'](function(_0x686ba5){_0x686ba5[_0x5e10('0x16')](function(_0x43e4b9){if(_0x43e4b9[_0x5e10('0x5e')]){_0x43e4b9[_0x5e10('0x5f')]=[];_0x43e4b9[_0x5e10('0x5e')][_0x5e10('0x35')](',')[_0x5e10('0x16')](function(_0x22ae84){_0x43e4b9[_0x5e10('0x5f')][_0x5e10('0x15')](_0x2fea9d[_0x22ae84]);});}delete _0x43e4b9[_0x5e10('0x5e')];});return _0x686ba5;});}function countFilteredContacts(_0xe7754,_0x5674db){var _0x241ac7=_0xe7754[_0x5e10('0x60')]();_0x241ac7[_0x5e10('0x17')]('COUNT(*)');_0x241ac7=applyJoinClauses(_0x241ac7,!![]);_0xe7754[_0x5e10('0x50')]('c.id');var _0x2f5bdc=utils[_0x5e10('0x1a')](_0x5674db);if(!_[_0x5e10('0x61')](_0x2f5bdc)){_0x241ac7['where'](_0x5e10('0x62'),_0x2f5bdc);}var _0x12fbc7={'type':db['Sequelize'][_0x5e10('0x5a')][_0x5e10('0x63')],'raw':!![]};return db[_0x5e10('0x5c')]['query'](_0x241ac7['toString'](),_0x12fbc7)['then'](function(_0x2fad40){return _0x2fad40[0x0][_0x5e10('0x64')];});}module[_0x5e10('0x65')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
+var _0x2d81=['c.id','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','ListId','autocomplete','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','type','text','value','start','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','filter','search','agent','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','order','DESC','subqry.','Tag','findAll','color','Sequelize','QueryTypes','CmContact','sequelize','query','toString','Tags'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2d81,0x146));var _0x12d8=function(_0x5571d9,_0x299343){_0x5571d9=_0x5571d9-0x0;var _0x5862a2=_0x2d81[_0x5571d9];return _0x5862a2;};'use strict';var _=require(_0x12d8('0x0'));var squel=require(_0x12d8('0x1'));var as=require(_0x12d8('0x2'));var qs=require(_0x12d8('0x3'));var utils=require(_0x12d8('0x4'));var db=require(_0x12d8('0x5'))['db'];function skipContactsQuery(_0x4e7ee0,_0x364a42){var _0x20e8f9=![];if(_0x4e7ee0[_0x12d8('0x6')]==='agent'&&!_0x364a42['search']&&!_0x364a42[_0x12d8('0x7')]&&_0x364a42[_0x12d8('0x8')]!=='true'){_0x20e8f9=!![];}return _0x20e8f9;}function getContactsSubquery(){return squel[_0x12d8('0x9')]()[_0x12d8('0xa')](_0x12d8('0xb'),'c')[_0x12d8('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x5991f1,_0x50f7a1){var _0x36b937=_0x50f7a1?'c':_0x12d8('0xd');_0x5991f1[_0x12d8('0xe')](_0x12d8('0xf'),'uc',_0x12d8('0x10')+_0x36b937+'.id')[_0x12d8('0xe')](_0x12d8('0x11'),'ct',_0x12d8('0x12')+_0x36b937+'.id')[_0x12d8('0xe')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x5991f1;}function addFieldsToQuery(_0x245070,_0x1d5098,_0x30895b,_0x3991cb,_0x329f9c){var _0x3df193=_0x329f9c?'c':_0x12d8('0xd');if(!_0x1d5098){_0x1d5098=['id',_0x12d8('0x13'),_0x12d8('0x14'),_0x12d8('0x15'),_0x12d8('0x16'),_0x12d8('0x17'),_0x12d8('0x18'),_0x12d8('0x7'),_0x12d8('0x19'),_0x12d8('0x1a'),'updatedAt','deletedAt',_0x12d8('0x1b')];}else if(!_0x1d5098[_0x12d8('0x1c')]('id')){_0x1d5098[_0x12d8('0x1d')]('id');}var _0x4aa6b4=_0x30895b&&_0x329f9c||!_0x30895b&&!_0x329f9c;if(_0x3991cb){_0x4aa6b4=_0x3991cb&&_0x329f9c||!_0x3991cb&&!_0x329f9c;}_0x1d5098[_0x12d8('0x1e')](function(_0x3a0138){if(_0x3a0138===_0x12d8('0x1b')){if(_0x4aa6b4){_0x245070[_0x12d8('0x1f')](_0x12d8('0x20'),_0x3a0138);}else if(_0x30895b||_0x3991cb){_0x245070[_0x12d8('0x1f')](_0x3df193+'.'+_0x3a0138);}}else{_0x245070['field'](_0x3df193+'.'+_0x3a0138);}});return _0x245070;}function getSqlClauses(){var _0x388e78={'default':squel['expr'](),'fields':squel[_0x12d8('0x21')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x12d8('0x21')](),'ids':null},'user':{'clause':squel[_0x12d8('0x21')](),'skip':![]}};return _0x388e78;}function parseTagParameter(_0x4461b5){var _0x2fe710=squel[_0x12d8('0x21')]();if(_0x4461b5){var _0xd8c61c=utils[_0x12d8('0x22')](_0x4461b5);_0xd8c61c[_0x12d8('0x1e')](function(_0x1a5b12){_0x2fe710['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1a5b12+',%');});}return _0x2fe710;}function parseSearchFilter(_0x4a53ad){var _0x298b12=squel[_0x12d8('0x21')]();if(_0x4a53ad){var _0xdaa53b=_0x4a53ad[_0x12d8('0x23')]('\x5c','\x5c\x5c')[_0x12d8('0x23')](/'/g,'\x27\x27');if(_0xdaa53b[_0x12d8('0x24')]('\x20')[_0x12d8('0x25')]>0x1){_0x298b12['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x12d8('0x26')](_0xdaa53b,!![]),null);}else{if(qs[_0x12d8('0x27')](_0xdaa53b)){_0x298b12['or'](_0x12d8('0x28'),_0xdaa53b+'%');_0x298b12['or'](_0x12d8('0x29'),_0xdaa53b+'%');_0x298b12['or'](_0x12d8('0x2a'),_0xdaa53b+'%');_0x298b12['or'](_0x12d8('0x2b'),_0xdaa53b+'%');}else if(qs[_0x12d8('0x2c')](_0xdaa53b)){_0x298b12['or'](_0x12d8('0x2d'),_0xdaa53b+'%');}else{_0x298b12['or'](_0x12d8('0x2e'),'%'+_0xdaa53b+'%');_0x298b12['or']('c.lastName\x20LIKE\x20?','%'+_0xdaa53b+'%');_0x298b12['or'](_0x12d8('0x2d'),'%'+_0xdaa53b+'%');}}}return _0x298b12;}function parseAdvancedSearchFilter(_0x476434,_0xf5580b){var _0x2fc855=getSqlClauses();var _0xc48d85=as[_0x12d8('0x2f')](_0x476434);var _0x42a21b=_0xc48d85[_0x12d8('0x30')];for(var _0x12ad27=0x0;_0x12ad27<_0xc48d85[_0x12d8('0x31')][_0x12d8('0x25')];_0x12ad27++){var _0x153f7c=_0xc48d85[_0x12d8('0x31')][_0x12ad27];var _0x1bbab5='c';var _0x1efff7=_[_0x12d8('0x32')](_0xf5580b,[_0x12d8('0x33'),_0x153f7c[_0x12d8('0x1f')]]);if(_0x1efff7){if(_0x153f7c['field']===_0x12d8('0x34')||_0x1efff7[_0x12d8('0x35')]===_0x12d8('0x36')){_0x153f7c[_0x12d8('0x37')]=_0x12d8('0x38');}var _0xd2131e=as['buildExpression'](_0x1bbab5,_0x1efff7[_0x12d8('0x39')],_0x153f7c);_0x2fc855['default'][_0x42a21b](_0xd2131e[_0x12d8('0x3a')],_0xd2131e[_0x12d8('0x3b')][_0x12d8('0x3c')],_0xd2131e[_0x12d8('0x3b')]['end']);}else{if(_0x153f7c[_0x12d8('0x1f')]==='Tag'){var _0x599cea=_0x153f7c[_0x12d8('0x3b')][_0x12d8('0x24')](',')[_0x12d8('0x3d')](function(_0x3563d0){return Number(_0x3563d0);});var _0xd2a0a6=parseTagParameter(_0x599cea);_0x2fc855[_0x12d8('0x3e')][_0x12d8('0x3f')][_0x12d8('0x40')](_0xd2a0a6);_0x2fc855[_0x12d8('0x3e')][_0x12d8('0x41')]=_0x599cea;}else if(_0x153f7c[_0x12d8('0x1f')]===_0x12d8('0x42')){_0x2fc855[_0x12d8('0x43')][_0x12d8('0x3f')][_0x12d8('0x40')](_0x12d8('0x44'),_0x153f7c['value']);_0x2fc855[_0x12d8('0x43')][_0x12d8('0x45')]=!![];}}}return _0x2fc855;}function parseModelFields(_0x43e178,_0x2fa7bb){var _0x45c5ef=squel[_0x12d8('0x21')]();var _0x13f55d=_(_0x43e178)[_0x12d8('0x46')]()['map'](function(_0x33919d){return _[_0x12d8('0x47')](_0x2fa7bb,[_0x12d8('0x33'),_0x33919d])?_0x33919d:undefined;})[_0x12d8('0x48')]()[_0x12d8('0x3b')]();if(_0x43e178['Contact']){_0x13f55d[_0x12d8('0x1d')](_0x12d8('0x49'));}if(_0x43e178[_0x12d8('0x42')]){_0x13f55d[_0x12d8('0x1d')](_0x12d8('0x42'));}if(_0x13f55d[_0x12d8('0x25')]>0x0){_0x13f55d['forEach'](function(_0x5df08a){if(_0x5df08a===_0x12d8('0x7')){_0x45c5ef['and'](_0x12d8('0x4a'),[][_0x12d8('0x4b')](_0x43e178[_0x5df08a]));}else if(_0x5df08a==='Contact'){var _0x55ad3b='%'+_0x43e178[_0x5df08a]+'%';_0x45c5ef[_0x12d8('0x40')](_0x12d8('0x4c'),_0x55ad3b);}else if(_0x5df08a==='User'){_0x45c5ef[_0x12d8('0x40')](_0x12d8('0x44'),_0x43e178[_0x5df08a]);}else{_0x45c5ef[_0x12d8('0x40')]('c.'+_0x5df08a+_0x12d8('0x4d'),_0x43e178[_0x5df08a]);}});}return _0x45c5ef;}function parseQueryParameters(_0x2682a2,_0x268fbc){var _0x1a6a14=getSqlClauses();return Promise[_0x12d8('0x4e')]()[_0x12d8('0x4f')](function(){return parseModelFields(_0x2682a2,_0x268fbc);})[_0x12d8('0x4f')](function(_0x34b9c5){_0x1a6a14['fields'][_0x12d8('0x40')](_0x34b9c5);return parseTagParameter(_0x2682a2['tag']);})[_0x12d8('0x4f')](function(_0xb78354){_0x1a6a14['tags'][_0x12d8('0x3f')][_0x12d8('0x40')](_0xb78354);return parseSearchFilter(_0x2682a2[_0x12d8('0x50')]);})[_0x12d8('0x4f')](function(_0x4543f1){_0x1a6a14[_0x12d8('0x50')]=_0x4543f1;return _0x1a6a14;});}function checkListsRestrictions(_0x300c44,_0x1e84b9,_0x195842){var _0x2edcc9=squel[_0x12d8('0x21')]();return Promise[_0x12d8('0x4e')]()[_0x12d8('0x4f')](function(){if(_0x1e84b9[_0x12d8('0x51')]&&_0x300c44[_0x12d8('0x6')]===_0x12d8('0x52')&&!_0x195842){return _0x300c44['getLists']({'attributes':['id'],'raw':!![]});}})[_0x12d8('0x4f')](function(_0x591d83){if(_0x591d83){if(_0x591d83[_0x12d8('0x25')]===0x0){_0x2edcc9[_0x12d8('0x40')](_0x12d8('0x53'));}else{_0x2edcc9[_0x12d8('0x40')]('c.ListId\x20IN\x20?',_[_0x12d8('0x3d')](_0x591d83,'id'));}}})[_0x12d8('0x4f')](function(){return _0x2edcc9;});}function buildContactsQuery(_0x15aa37,_0x12c790,_0x1019e0,_0x18e7a7,_0x4c9305,_0x258329){if(_0x12c790){_0x12c790=_0x1019e0[_0x12d8('0x54')];}_0x15aa37=addFieldsToQuery(_0x15aa37,_0x12c790,_0x18e7a7,_0x258329,!![]);var _0x2cc8e1=squel[_0x12d8('0x9')]();_0x2cc8e1=addFieldsToQuery(_0x2cc8e1,_0x12c790,_0x18e7a7,_0x258329,![]);if(_0x18e7a7||_0x258329){_0x15aa37=applyJoinClauses(_0x15aa37,!![]);_0x15aa37[_0x12d8('0x55')]('c.id');if(_0x1019e0[_0x12d8('0x56')]){_0x2cc8e1[_0x12d8('0x56')](_0x1019e0[_0x12d8('0x56')]);}if(_0x1019e0['offset']){_0x2cc8e1[_0x12d8('0x57')](_0x1019e0['offset']);}}else{_0x2cc8e1=applyJoinClauses(_0x2cc8e1,![]);_0x2cc8e1[_0x12d8('0x55')](_0x12d8('0x58'));if(_0x1019e0[_0x12d8('0x56')]){_0x15aa37['limit'](_0x1019e0['limit']);}if(_0x1019e0['offset']){_0x15aa37[_0x12d8('0x57')](_0x1019e0[_0x12d8('0x57')]);}}_0x2cc8e1['having'](_0x4c9305);if(_0x1019e0[_0x12d8('0x59')]){_0x1019e0['order'][_0x12d8('0x1e')](function(_0x28b8a1){_0x15aa37['order']('c.'+_0x28b8a1[0x0],_0x28b8a1[0x1]===_0x12d8('0x5a')?![]:!![]);_0x2cc8e1[_0x12d8('0x59')](_0x12d8('0x5b')+_0x28b8a1[0x0],_0x28b8a1[0x1]===_0x12d8('0x5a')?![]:!![]);});}_0x2cc8e1['from'](_0x15aa37,_0x12d8('0xd'));return _0x2cc8e1;}function getFilteredContacts(_0x5bb828){var _0x56eb99=[];return db[_0x12d8('0x5c')][_0x12d8('0x5d')]({'attributes':['id','name',_0x12d8('0x5e')],'raw':!![]})[_0x12d8('0x4f')](function(_0x162680){_0x56eb99=_['keyBy'](_0x162680,'id');var _0x4f9b26={'type':db[_0x12d8('0x5f')][_0x12d8('0x60')]['SELECT'],'model':db[_0x12d8('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x12d8('0x62')][_0x12d8('0x63')](_0x5bb828[_0x12d8('0x64')](),_0x4f9b26);})[_0x12d8('0x4f')](function(_0x2f0286){_0x2f0286[_0x12d8('0x1e')](function(_0x3716c1){if(_0x3716c1[_0x12d8('0x1b')]){_0x3716c1['Tags']=[];_0x3716c1['TagIds'][_0x12d8('0x24')](',')[_0x12d8('0x1e')](function(_0x503b0b){_0x3716c1[_0x12d8('0x65')][_0x12d8('0x1d')](_0x56eb99[_0x503b0b]);});}delete _0x3716c1[_0x12d8('0x1b')];});return _0x2f0286;});}function countFilteredContacts(_0x5c3f34,_0x39246e){var _0x4b74a8=_0x5c3f34['clone']();_0x4b74a8[_0x12d8('0x1f')]('COUNT(*)');_0x4b74a8=applyJoinClauses(_0x4b74a8,!![]);_0x5c3f34[_0x12d8('0x55')](_0x12d8('0x66'));var _0x1ffcc1=utils[_0x12d8('0x22')](_0x39246e);if(!_[_0x12d8('0x67')](_0x1ffcc1)){_0x4b74a8[_0x12d8('0xc')](_0x12d8('0x68'),_0x1ffcc1);}var _0x1ee7f4={'type':db[_0x12d8('0x5f')][_0x12d8('0x60')][_0x12d8('0x69')],'raw':!![]};return db['sequelize'][_0x12d8('0x63')](_0x4b74a8[_0x12d8('0x64')](),_0x1ee7f4)[_0x12d8('0x4f')](function(_0x357aa9){return _0x357aa9[0x0]['COUNT(*)'];});}module[_0x12d8('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x916b=['lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','binary','write','end','final','decryptFile','createWriteStream','createDecipher','close','unlink','encryptString','secret','base64','utf8','crypto'];(function(_0x2ca9e2,_0xdc1986){var _0x434604=function(_0x1345b2){while(--_0x1345b2){_0x2ca9e2['push'](_0x2ca9e2['shift']());}};_0x434604(++_0xdc1986);}(_0x916b,0x175));var _0xb916=function(_0x20d4c0,_0x281bca){_0x20d4c0=_0x20d4c0-0x0;var _0x515a4c=_0x916b[_0x20d4c0];return _0x515a4c;};'use strict';var crypto=require(_0xb916('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xb916('0x1'));var config=require(_0xb916('0x2'));var logger=require(_0xb916('0x3'))(_0xb916('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb916('0x5')][_0xb916('0x6')],'algorithm':_0xb916('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0xb916('0x8')]&&config[_0xb916('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0xb916('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0xb916('0x8')][_0xb916('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xb916('0xa')](config[_0xb916('0x8')]['algorithm'],_0xb916('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x55067b){return AES_SUPPORTED_RX[_0xb916('0xc')](_0x55067b);}function getSupportedCiphers(){return crypto[_0xb916('0xd')]()[_0xb916('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2d305c){return getSupportedCiphers()[_0xb916('0xf')](_0x2d305c)>-0x1;}function combineOptions(_0x5bcd66){var _0x4bd2f7={};for(var _0x3b738f in fileOptions){if(fileOptions[_0xb916('0x10')](_0x3b738f)){_0x4bd2f7[_0x3b738f]=fileOptions[_0x3b738f];}}if(_0x5bcd66){for(var _0x11de7d in _0x5bcd66){if(_0x5bcd66[_0xb916('0x10')](_0x11de7d)){_0x4bd2f7[_0x11de7d]=_0x5bcd66[_0x11de7d];}}}return _0x4bd2f7;}exports['encryptFile']=function(_0x34a8d6,_0x4e83f7,_0x2dc176,_0x202067){return new BPromise(function(_0x531bf8,_0x5d36c6){_0x202067=combineOptions(_0x202067);var _0x2fef31=new Buffer(_0x2dc176);var _0x2c6ee9=fs[_0xb916('0x11')](_0x34a8d6);var _0x19bac3=fs['createWriteStream'](_0x4e83f7);var _0x52ea5b=crypto[_0xb916('0x12')](_0x202067[_0xb916('0x9')],_0x2fef31);_0x2c6ee9['on'](_0xb916('0x13'),function(_0xdba2b8){var _0x515120=new Buffer(_0x52ea5b[_0xb916('0x14')](_0xdba2b8),_0xb916('0x15'));_0x19bac3[_0xb916('0x16')](_0x515120);});_0x2c6ee9['on'](_0xb916('0x17'),function(){try{var _0x489356=new Buffer(_0x52ea5b[_0xb916('0x18')](_0xb916('0x15')),_0xb916('0x15'));_0x19bac3[_0xb916('0x16')](_0x489356);_0x19bac3[_0xb916('0x17')]();_0x19bac3['on']('close',function(){return _0x531bf8(_0x4e83f7);});}catch(_0xa703a3){fs['unlink'](_0x4e83f7);return _0x5d36c6(_0xa703a3);}});});};exports[_0xb916('0x19')]=function(_0x2ca488,_0x4a390a,_0x481410,_0x583f7a){return new BPromise(function(_0x39c31c,_0x47a528){_0x583f7a=combineOptions(_0x583f7a);var _0xd9546b=new Buffer(_0x481410);var _0x3eb16e=fs[_0xb916('0x11')](_0x2ca488);var _0xeefc19=fs[_0xb916('0x1a')](_0x4a390a);var _0x373882=crypto[_0xb916('0x1b')](_0x583f7a[_0xb916('0x9')],_0xd9546b);_0x3eb16e['on']('data',function(_0x3ecd4b){var _0x548f16=new Buffer(_0x373882[_0xb916('0x14')](_0x3ecd4b),'binary');_0xeefc19[_0xb916('0x16')](_0x548f16);});_0x3eb16e['on'](_0xb916('0x17'),function(){try{var _0x1c7460=new Buffer(_0x373882['final'](_0xb916('0x15')),'binary');_0xeefc19[_0xb916('0x16')](_0x1c7460);_0xeefc19[_0xb916('0x17')]();_0xeefc19['on'](_0xb916('0x1c'),function(){return _0x39c31c(_0x4a390a);});}catch(_0x580556){fs[_0xb916('0x1d')](_0x4a390a);return _0x47a528(_0x580556);}});});};exports[_0xb916('0x1e')]=function(_0x1707b7,_0x1459c0,_0x4f287c){var _0x496a49=_0x4f287c||stringOptions[_0xb916('0x9')];var _0x2bdac8=_0x1459c0||stringOptions[_0xb916('0x1f')];var _0x1bb49e=crypto[_0xb916('0x12')](_0x496a49,_0x2bdac8);var _0x5ab4c7=_0x1bb49e[_0xb916('0x14')](_0x1707b7,'utf8',_0xb916('0x20'));_0x5ab4c7+=_0x1bb49e[_0xb916('0x18')]('base64');return _0x5ab4c7;};exports['decryptString']=function(_0x5c6337,_0x1cd949,_0xc0de06){var _0x33f0aa=_0xc0de06||stringOptions['algorithm'];var _0x413c43=_0x1cd949||stringOptions[_0xb916('0x1f')];var _0x1d6186=crypto['createDecipher'](_0x33f0aa,_0x413c43);var _0x43e610=_0x1d6186[_0xb916('0x14')](_0x5c6337,_0xb916('0x20'),'utf8');_0x43e610+=_0x1d6186['final'](_0xb916('0x21'));return _0x43e610;};
\ No newline at end of file
+var _0xcfb3=['data','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createDecipher'];(function(_0x1182ae,_0x4b1516){var _0x24047a=function(_0x1947c9){while(--_0x1947c9){_0x1182ae['push'](_0x1182ae['shift']());}};_0x24047a(++_0x4b1516);}(_0xcfb3,0xe4));var _0x3cfb=function(_0x50222c,_0x120c24){_0x50222c=_0x50222c-0x0;var _0x1dc95c=_0xcfb3[_0x50222c];return _0x1dc95c;};'use strict';var crypto=require(_0x3cfb('0x0'));var fs=require('fs');var BPromise=require(_0x3cfb('0x1'));var _=require(_0x3cfb('0x2'));var config=require(_0x3cfb('0x3'));var logger=require(_0x3cfb('0x4'))(_0x3cfb('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3cfb('0x6')][_0x3cfb('0x7')],'algorithm':_0x3cfb('0x8')};const fileOptions={'algorithm':_0x3cfb('0x9')};if(config[_0x3cfb('0xa')]&&config[_0x3cfb('0xa')][_0x3cfb('0xb')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x3cfb('0xb')]);if(isSupported){fileOptions[_0x3cfb('0xb')]=config[_0x3cfb('0xa')][_0x3cfb('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3cfb('0xc')](',\x20');logger[_0x3cfb('0xd')](config[_0x3cfb('0xa')][_0x3cfb('0xb')],_0x3cfb('0xe'),supportedAlgorithms);}}function isASupportedCipher(_0x1c5a64){return AES_SUPPORTED_RX[_0x3cfb('0xf')](_0x1c5a64);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x3cfb('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x57be66){return getSupportedCiphers()['indexOf'](_0x57be66)>-0x1;}function combineOptions(_0x477010){var _0x35a237={};for(var _0x29e1f5 in fileOptions){if(fileOptions[_0x3cfb('0x11')](_0x29e1f5)){_0x35a237[_0x29e1f5]=fileOptions[_0x29e1f5];}}if(_0x477010){for(var _0x142976 in _0x477010){if(_0x477010[_0x3cfb('0x11')](_0x142976)){_0x35a237[_0x142976]=_0x477010[_0x142976];}}}return _0x35a237;}exports[_0x3cfb('0x12')]=function(_0x33f599,_0x3eaa05,_0x449659,_0x1ed850){return new BPromise(function(_0x27319a,_0x1a5755){_0x1ed850=combineOptions(_0x1ed850);var _0x177839=new Buffer(_0x449659);var _0x583826=fs[_0x3cfb('0x13')](_0x33f599);var _0x225a26=fs[_0x3cfb('0x14')](_0x3eaa05);var _0x4d0780=crypto[_0x3cfb('0x15')](_0x1ed850[_0x3cfb('0xb')],_0x177839);_0x583826['on']('data',function(_0x3bce3c){var _0x1cc7d7=new Buffer(_0x4d0780[_0x3cfb('0x16')](_0x3bce3c),_0x3cfb('0x17'));_0x225a26[_0x3cfb('0x18')](_0x1cc7d7);});_0x583826['on'](_0x3cfb('0x19'),function(){try{var _0x2019f3=new Buffer(_0x4d0780[_0x3cfb('0x1a')]('binary'),_0x3cfb('0x17'));_0x225a26[_0x3cfb('0x18')](_0x2019f3);_0x225a26[_0x3cfb('0x19')]();_0x225a26['on'](_0x3cfb('0x1b'),function(){return _0x27319a(_0x3eaa05);});}catch(_0x39ed9f){fs[_0x3cfb('0x1c')](_0x3eaa05);return _0x1a5755(_0x39ed9f);}});});};exports[_0x3cfb('0x1d')]=function(_0x15ba27,_0x317ab0,_0x28e255,_0x3d34a4){return new BPromise(function(_0x474e11,_0x543ca2){_0x3d34a4=combineOptions(_0x3d34a4);var _0x284f53=new Buffer(_0x28e255);var _0x4abce8=fs[_0x3cfb('0x13')](_0x15ba27);var _0x450650=fs['createWriteStream'](_0x317ab0);var _0x2039a3=crypto[_0x3cfb('0x1e')](_0x3d34a4[_0x3cfb('0xb')],_0x284f53);_0x4abce8['on'](_0x3cfb('0x1f'),function(_0x5672e6){var _0x2d626f=new Buffer(_0x2039a3[_0x3cfb('0x16')](_0x5672e6),_0x3cfb('0x17'));_0x450650[_0x3cfb('0x18')](_0x2d626f);});_0x4abce8['on'](_0x3cfb('0x19'),function(){try{var _0x3ff0e3=new Buffer(_0x2039a3[_0x3cfb('0x1a')]('binary'),_0x3cfb('0x17'));_0x450650['write'](_0x3ff0e3);_0x450650[_0x3cfb('0x19')]();_0x450650['on']('close',function(){return _0x474e11(_0x317ab0);});}catch(_0x5b555b){fs[_0x3cfb('0x1c')](_0x317ab0);return _0x543ca2(_0x5b555b);}});});};exports[_0x3cfb('0x20')]=function(_0xbdba73,_0x5d2c78,_0x45e640){var _0x3299c0=_0x45e640||stringOptions[_0x3cfb('0xb')];var _0x503951=_0x5d2c78||stringOptions[_0x3cfb('0x21')];var _0x1bf54b=crypto[_0x3cfb('0x15')](_0x3299c0,_0x503951);var _0x274dd0=_0x1bf54b[_0x3cfb('0x16')](_0xbdba73,_0x3cfb('0x22'),_0x3cfb('0x23'));_0x274dd0+=_0x1bf54b[_0x3cfb('0x1a')](_0x3cfb('0x23'));return _0x274dd0;};exports[_0x3cfb('0x24')]=function(_0x4dcf13,_0x4fc08f,_0x363771){var _0x26e11a=_0x363771||stringOptions[_0x3cfb('0xb')];var _0x3db499=_0x4fc08f||stringOptions[_0x3cfb('0x21')];var _0x9bc971=crypto[_0x3cfb('0x1e')](_0x26e11a,_0x3db499);var _0x71d1d1=_0x9bc971[_0x3cfb('0x16')](_0x4dcf13,_0x3cfb('0x23'),_0x3cfb('0x22'));_0x71d1d1+=_0x9bc971['final']('utf8');return _0x71d1d1;};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4312=['split','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','join','each','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','sequelize','query','SELECT','then','num','Empty'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4312,0x14b));var _0x2431=function(_0x944797,_0x147b4c){_0x944797=_0x944797-0x0;var _0x1908ca=_0x4312[_0x944797];return _0x1908ca;};'use strict';var util=require(_0x2431('0x0'));var path=require(_0x2431('0x1'));var _=require(_0x2431('0x2'));var csv=require(_0x2431('0x3'));var fs=require('fs');var BPromise=require(_0x2431('0x4'));var zipdir=require(_0x2431('0x5'));var rimraf=require(_0x2431('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2431('0x7'))[_0x2431('0x8')];var logger=require(_0x2431('0x9'))(_0x2431('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2431('0xb')][0x3];var PATH=process[_0x2431('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x6a7e12,_0x4198d1){var _0x104cf6={'status':_0x6a7e12};var _0xdbaff9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4198d1){_0x104cf6[_0x2431('0xc')]=_0x4198d1;}return db[_0x2431('0xd')]['update'](_0x104cf6,_0xdbaff9);}function main(){var _0xe85d63=0x1388;var _0x3639a9;logger[_0x2431('0xe')](util[_0x2431('0xf')](_0x2431('0x10'),EXTRACTED_REPORT_ID,_0x2431('0x11')));return db[_0x2431('0x12')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x4b76b4){if(_0x4b76b4){_0x3639a9=_0x4b76b4;_0xe85d63=_0x3639a9[_0x2431('0x13')]||0x1388;}})['then'](function(){return dbH[_0x2431('0x14')][_0x2431('0x15')](util[_0x2431('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2431('0x14')]['QueryTypes'][_0x2431('0x16')]});})[_0x2431('0x17')](function(_0x4e63fc){if(!_0x4e63fc[0x0][_0x2431('0x18')]){return analyticExtractedReport(_0x2431('0x19'));}var _0x22a0c9=[];var _0x445591=0x0;if(_0x3639a9[_0x2431('0x1a')]){if(_0x4e63fc&&_0x4e63fc[_0x2431('0x1b')]){var _0x286e7b=_[_0x2431('0x1c')](_0x4e63fc[0x0][_0x2431('0x18')]/_0xe85d63);var _0x3c1228=Number['isInteger'](_0x4e63fc[0x0][_0x2431('0x18')]/_0xe85d63)?_0x4e63fc[0x0][_0x2431('0x18')]%_0xe85d63:0x0;_0x286e7b[_0x2431('0x1d')](function(_0x18fc90){if(_0x18fc90>0x0){_0x445591+=_0xe85d63;}_0x22a0c9[_0x2431('0x1e')](dbH[_0x2431('0x14')][_0x2431('0x15')](util[_0x2431('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe85d63,_0x445591),{'type':dbH['sequelize']['QueryTypes'][_0x2431('0x16')]}));});if(_0x3c1228>0x0){_0x445591+=_0xe85d63;_0x22a0c9[_0x2431('0x1e')](dbH['sequelize']['query'](util['format'](_0x2431('0x1f'),QUERY,_0x3c1228,_0x445591),{'type':dbH[_0x2431('0x14')]['QueryTypes'][_0x2431('0x16')]}));}}}else{_0x22a0c9[_0x2431('0x1e')](dbH['sequelize'][_0x2431('0x15')](QUERY,{'type':dbH['sequelize'][_0x2431('0x20')]['SELECT']}));}var _0x24944d=path[_0x2431('0x21')](PATH);var _0x56e2e8=path[_0x2431('0x22')](PATH,_0x2431('0x23'));var _0x4a920b=_0x3639a9['split']&&_0x22a0c9['length']>0x1;var _0x1e851d=[];if(!fs['existsSync'](path[_0x2431('0x24')](_0x24944d,_0x56e2e8))&&_0x4a920b){fs['mkdirSync'](path['join'](_0x24944d,_0x56e2e8));}return BPromise[_0x2431('0x25')](_0x22a0c9,function(_0x736af8){_0x1e851d[_0x2431('0x1e')](_0x736af8);})[_0x2431('0x17')](function(){for(var _0x42548d=0x0;_0x42548d<_0x1e851d[_0x2431('0x1b')];_0x42548d+=0x1){var _0x1d2aab;var _0x4aada8=_0x1e851d[_0x42548d];if(_0x4a920b){_0x1d2aab=path[_0x2431('0x24')](_0x24944d,_0x56e2e8,util[_0x2431('0xf')]('%s%d.%s',_0x56e2e8,_0x42548d,_0x2431('0x26')));}else{_0x1d2aab=path[_0x2431('0x24')](_0x24944d,util[_0x2431('0xf')](_0x2431('0x27'),_0x56e2e8,_0x2431('0x26')));}fs[_0x2431('0x28')](_0x1d2aab,csv(_0x4aada8));}})[_0x2431('0x17')](function(){if(_0x4a920b){return new Promise(function(_0xe1ab7c){zipdir(path['join'](_0x24944d,_0x56e2e8),{'saveTo':path['join'](_0x24944d,util[_0x2431('0xf')](_0x2431('0x27'),_0x56e2e8,'zip'))},function(_0x58db7c,_0x2eec52){rimraf(path[_0x2431('0x24')](_0x24944d,_0x56e2e8),function(){});_0xe1ab7c(_0x2431('0x29'));});});}})[_0x2431('0x17')](function(){logger['info'](util[_0x2431('0xf')](_0x2431('0x2a'),EXTRACTED_REPORT_ID,_0x2431('0x11')));return analyticExtractedReport(_0x2431('0x2b'),_0x4a920b?util[_0x2431('0xf')](_0x2431('0x27'),_0x56e2e8,_0x4a920b?_0x2431('0x2c'):_0x2431('0x26')):null);});})[_0x2431('0x2d')](function(_0x157584){logger[_0x2431('0xe')](util[_0x2431('0xf')](_0x2431('0x2e'),EXTRACTED_REPORT_ID,_0x2431('0x11')),util[_0x2431('0x2f')](_0x157584,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2431('0x30'));})[_0x2431('0x31')](function(){process[_0x2431('0x32')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x5ec5=['forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','push','.csv','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ec5,0xdf));var _0x55ec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5ec5[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x55ec('0x0'));var path=require(_0x55ec('0x1'));var _=require(_0x55ec('0x2'));var csv=require(_0x55ec('0x3'));var fs=require('fs');var BPromise=require(_0x55ec('0x4'));var zipdir=require(_0x55ec('0x5'));var rimraf=require(_0x55ec('0x6'));var db=require(_0x55ec('0x7'))['db'];var dbH=require(_0x55ec('0x7'))[_0x55ec('0x8')];var logger=require(_0x55ec('0x9'))(_0x55ec('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x55ec('0xb')][0x2]);var QUERY=process[_0x55ec('0xb')][0x3];var PATH=process[_0x55ec('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x44faaf,_0x639c73){var _0x36d80f={'status':_0x44faaf};var _0x468e1f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x639c73){_0x36d80f[_0x55ec('0xc')]=_0x639c73;}return db[_0x55ec('0xd')][_0x55ec('0xe')](_0x36d80f,_0x468e1f);}function main(){var _0x38c86d=0x1388;var _0x345346;logger[_0x55ec('0xf')](util[_0x55ec('0x10')](_0x55ec('0x11'),EXTRACTED_REPORT_ID,_0x55ec('0x12')));return db[_0x55ec('0x13')][_0x55ec('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x55ec('0x15'),_0x55ec('0x16')]})[_0x55ec('0x17')](function(_0x5dd4e3){if(_0x5dd4e3){_0x345346=_0x5dd4e3;_0x38c86d=_0x345346[_0x55ec('0x16')]||0x1388;}})[_0x55ec('0x17')](function(){return dbH[_0x55ec('0x18')][_0x55ec('0x19')](util[_0x55ec('0x10')](_0x55ec('0x1a'),QUERY),{'type':dbH[_0x55ec('0x18')]['QueryTypes']['SELECT']});})[_0x55ec('0x17')](function(_0x6773bd){if(!_0x6773bd[0x0][_0x55ec('0x1b')]){return analyticExtractedReport(_0x55ec('0x1c'));}var _0x3a9de9=[];var _0x360a2e=0x0;if(_0x345346[_0x55ec('0x15')]){if(_0x6773bd&&_0x6773bd[_0x55ec('0x1d')]){var _0x34691b=_[_0x55ec('0x1e')](_0x6773bd[0x0][_0x55ec('0x1b')]/_0x38c86d);var _0x5bd442=Number[_0x55ec('0x1f')](_0x6773bd[0x0]['num']/_0x38c86d)?_0x6773bd[0x0][_0x55ec('0x1b')]%_0x38c86d:0x0;_0x34691b[_0x55ec('0x20')](function(_0xe40973){if(_0xe40973>0x0){_0x360a2e+=_0x38c86d;}_0x3a9de9['push'](dbH[_0x55ec('0x18')]['query'](util[_0x55ec('0x10')](_0x55ec('0x21'),QUERY,_0x38c86d,_0x360a2e),{'type':dbH['sequelize'][_0x55ec('0x22')][_0x55ec('0x23')]}));});if(_0x5bd442>0x0){_0x360a2e+=_0x38c86d;_0x3a9de9[_0x55ec('0x24')](dbH[_0x55ec('0x18')][_0x55ec('0x19')](util['format'](_0x55ec('0x21'),QUERY,_0x5bd442,_0x360a2e),{'type':dbH[_0x55ec('0x18')][_0x55ec('0x22')][_0x55ec('0x23')]}));}}}else{_0x3a9de9[_0x55ec('0x24')](dbH[_0x55ec('0x18')][_0x55ec('0x19')](QUERY,{'type':dbH[_0x55ec('0x18')]['QueryTypes'][_0x55ec('0x23')]}));}var _0x2b4bed=path['dirname'](PATH);var _0x251938=path['basename'](PATH,_0x55ec('0x25'));var _0x3b37f5=_0x345346[_0x55ec('0x15')]&&_0x3a9de9[_0x55ec('0x1d')]>0x1;var _0x579f05=[];if(!fs['existsSync'](path[_0x55ec('0x26')](_0x2b4bed,_0x251938))&&_0x3b37f5){fs[_0x55ec('0x27')](path[_0x55ec('0x26')](_0x2b4bed,_0x251938));}return BPromise[_0x55ec('0x28')](_0x3a9de9,function(_0x57341e){_0x579f05[_0x55ec('0x24')](_0x57341e);})['then'](function(){for(var _0x516522=0x0;_0x516522<_0x579f05[_0x55ec('0x1d')];_0x516522+=0x1){var _0x4c867b;var _0x2d7a8c=_0x579f05[_0x516522];if(_0x3b37f5){_0x4c867b=path[_0x55ec('0x26')](_0x2b4bed,_0x251938,util[_0x55ec('0x10')](_0x55ec('0x29'),_0x251938,_0x516522,_0x55ec('0x2a')));}else{_0x4c867b=path[_0x55ec('0x26')](_0x2b4bed,util[_0x55ec('0x10')](_0x55ec('0x2b'),_0x251938,_0x55ec('0x2a')));}fs[_0x55ec('0x2c')](_0x4c867b,csv(_0x2d7a8c));}})['then'](function(){if(_0x3b37f5){return new Promise(function(_0x39e7de){zipdir(path[_0x55ec('0x26')](_0x2b4bed,_0x251938),{'saveTo':path[_0x55ec('0x26')](_0x2b4bed,util[_0x55ec('0x10')]('%s.%s',_0x251938,'zip'))},function(_0x346eec,_0x5b2ba5){rimraf(path['join'](_0x2b4bed,_0x251938),function(){});_0x39e7de('zip\x20finished');});});}})[_0x55ec('0x17')](function(){logger['info'](util[_0x55ec('0x10')](_0x55ec('0x2d'),EXTRACTED_REPORT_ID,_0x55ec('0x12')));return analyticExtractedReport(_0x55ec('0x2e'),_0x3b37f5?util[_0x55ec('0x10')]('%s.%s',_0x251938,_0x3b37f5?_0x55ec('0x2f'):_0x55ec('0x2a')):null);});})['catch'](function(_0x43075e){logger[_0x55ec('0xf')](util[_0x55ec('0x10')](_0x55ec('0x30'),EXTRACTED_REPORT_ID,_0x55ec('0x12')),util[_0x55ec('0x31')](_0x43075e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x55ec('0x32'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8dec=['pick','toString','value','fill','auto','body','concat','chunk','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','length','header','pageBreak','margin','landscape','footer','Arial','black','num','Empty','Setting','find','splitSizePdf','then','split','isInteger','sequelize','query','QueryTypes','SELECT','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader'];(function(_0x31fa75,_0x2f6615){var _0x59d721=function(_0x2e19e3){while(--_0x2e19e3){_0x31fa75['push'](_0x31fa75['shift']());}};_0x59d721(++_0x2f6615);}(_0x8dec,0x19c));var _0xc8de=function(_0x310994,_0x4c5d81){_0x310994=_0x310994-0x0;var _0x3c0b9a=_0x8dec[_0x310994];return _0x3c0b9a;};'use strict';var _=require(_0xc8de('0x0'));var fs=require('fs');var util=require(_0xc8de('0x1'));var path=require(_0xc8de('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xc8de('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xc8de('0x4'));var JSDOM=require(_0xc8de('0x5'))[_0xc8de('0x6')];var window=new JSDOM('')[_0xc8de('0x7')];var BPromise=require(_0xc8de('0x8'));var db=require(_0xc8de('0x9'))['db'];var dbH=require(_0xc8de('0x9'))['dbH'];var logger=require(_0xc8de('0xa'))(_0xc8de('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc8de('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xc8de('0xc')][0x5];var FORMAT=_0xc8de('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x330093,_0x51a09f){var _0x26badf={'status':_0x330093};var _0x4ee47c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51a09f){_0x26badf[_0xc8de('0xe')]=_0x51a09f;}return db['AnalyticExtractedReport'][_0xc8de('0xf')](_0x26badf,_0x4ee47c);}function getHeaders(_0x5a525f){return _[_0xc8de('0x10')](_0x5a525f,function(_0x4af524){return{'text':_0x4af524,'style':_0xc8de('0x11')};});}function getRows(_0xabe469,_0x5002e8){return _[_0xc8de('0x10')](_0x5002e8,function(_0x35a87d){return _(_0x35a87d)[_0xc8de('0x12')](_0xabe469)[_0xc8de('0x10')](function(_0x40a3e4){return _0x40a3e4?_[_0xc8de('0x13')](_0x40a3e4):'';})[_0xc8de('0x14')]();});}function createTable(_0x41ff30,_0x185d70){var _0x97d8da={'widths':_[_0xc8de('0x15')](Array(_0x41ff30['length']),0x91),'heights':function(_0x19d20d){return _0x19d20d===0x0?_0xc8de('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3a7703=getHeaders(_0x41ff30);_0x97d8da[_0xc8de('0x17')]['push'](_0x3a7703);var _0x1ed0c6=getRows(_0x41ff30,_0x185d70);_0x97d8da[_0xc8de('0x17')]=_0x97d8da['body'][_0xc8de('0x18')](_0x1ed0c6);return _0x97d8da;}function createTables(_0x579dbb){var _0x37297c=[];var _0x1d7ca9=_[_0xc8de('0x19')](Object['keys'](_0x579dbb[0x0]),0x5);_0x1d7ca9[_0xc8de('0x1a')](function(_0x5500b6){_0x37297c[_0xc8de('0x1b')](createTable(_0x5500b6,_0x579dbb));});return _0x37297c;}function getPDFDocDefinition(_0x1f35e3){var _0x1375cd=util[_0xc8de('0x1c')](_0xc8de('0x1d'),NAME,EXTRACTED_REPORT[_0xc8de('0x1e')],moment(EXTRACTED_REPORT['startDate'])[_0xc8de('0x1c')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xc8de('0x1c')](FORMAT));var _0x1bc218=[];for(var _0x17ee6c=0x0;_0x17ee6c<_0x1f35e3[_0xc8de('0x1f')];_0x17ee6c++){var _0x2a2281=[];if(_0x17ee6c===0x0){_0x2a2281['push']({'text':_0x1375cd,'style':_0xc8de('0x20')});}var _0x1b19b7={'table':_0x1f35e3[_0x17ee6c]};if(_0x17ee6c>0x0){_0x1b19b7[_0xc8de('0x21')]='before';_0x1b19b7[_0xc8de('0x22')]=[0x0,0x46,0x0,0x0];}_0x2a2281[_0xc8de('0x1b')](_0x1b19b7);_0x1bc218[_0xc8de('0x1b')](_0x2a2281);}return{'pageSize':'A4','pageOrientation':_0xc8de('0x23'),'content':_0x1bc218,'footer':function(_0x242973,_0x18b22f){return{'text':_0x242973[_0xc8de('0x13')]()+'\x20/\x20'+_0x18b22f,'style':_0xc8de('0x24')};},'defaultStyle':{'font':_0xc8de('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc8de('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3d14fa){var _0x4df004=0x1388;var _0x10112d;if(!_0x3d14fa[0x0][_0xc8de('0x27')]){return analyticExtractedReport(_0xc8de('0x28'));}return db[_0xc8de('0x29')][_0xc8de('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x5ed04a){if(_0x5ed04a){_0x10112d=_0x5ed04a;_0x4df004=_0x10112d[_0xc8de('0x2b')]||0x3e8;}})[_0xc8de('0x2c')](function(){var _0x25e90c=[];var _0x55bd1d=0x0;if(_0x10112d[_0xc8de('0x2d')]){if(_0x3d14fa&&_0x3d14fa[_0xc8de('0x1f')]){var _0x20ed4e=_['range'](_0x3d14fa[0x0][_0xc8de('0x27')]/_0x4df004);var _0x27c938=Number[_0xc8de('0x2e')](_0x3d14fa[0x0][_0xc8de('0x27')]/_0x4df004)?_0x3d14fa[0x0][_0xc8de('0x27')]%_0x4df004:0x0;_0x20ed4e['forEach'](function(_0x51ebc5){if(_0x51ebc5>0x0){_0x55bd1d+=_0x4df004;}_0x25e90c['push'](dbH[_0xc8de('0x2f')][_0xc8de('0x30')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4df004,_0x55bd1d),{'type':dbH[_0xc8de('0x2f')][_0xc8de('0x31')][_0xc8de('0x32')]}));});if(_0x27c938>0x0){_0x55bd1d+=_0x4df004;_0x25e90c['push'](dbH[_0xc8de('0x2f')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x27c938,_0x55bd1d),{'type':dbH[_0xc8de('0x2f')]['QueryTypes'][_0xc8de('0x32')]}));}}}else{_0x25e90c[_0xc8de('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xc8de('0x2f')][_0xc8de('0x31')][_0xc8de('0x32')]}));}var _0x1b581c=path['dirname'](PATH);var _0xcc17a5=path['basename'](PATH,'.pdf');var _0x36f18c=_0x10112d['split']&&_0x25e90c['length']>0x1;var _0x29fd8a=[];if(!fs[_0xc8de('0x33')](path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5))&&_0x36f18c){fs[_0xc8de('0x35')](path['join'](_0x1b581c,_0xcc17a5));}return BPromise['each'](_0x25e90c,function(_0x45b50a){_0x29fd8a[_0xc8de('0x1b')](_0x45b50a);})[_0xc8de('0x2c')](function(){var _0x3d0b5d=[];for(var _0x505523=0x0;_0x505523<_0x29fd8a[_0xc8de('0x1f')];_0x505523+=0x1){var _0x57c909=_0x29fd8a[_0x505523];var _0x572e78=createTables(_[_0xc8de('0x36')](_0x57c909));var _0x1f9523;var _0x30489c=getPDFDocDefinition(_0x572e78);var _0x5b7d52=getPDFPrinter();var _0x216411=_0x5b7d52[_0xc8de('0x37')](_0x30489c);if(_0x36f18c){_0x1f9523=path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5,util[_0xc8de('0x1c')](_0xc8de('0x38'),_0xcc17a5,_0x505523,'pdf'));}else{_0x1f9523=path['join'](_0x1b581c,util['format'](_0xc8de('0x39'),_0xcc17a5,_0xc8de('0x3a')));}_0x3d0b5d['push'](writePDFDocument(_0x216411,_0x1f9523));}return Promise[_0xc8de('0x3b')](_0x3d0b5d);})[_0xc8de('0x2c')](function(){if(_0x36f18c){return new Promise(function(_0x3ea01b){zipdir(path['join'](_0x1b581c,_0xcc17a5),{'saveTo':path['join'](_0x1b581c,util[_0xc8de('0x1c')](_0xc8de('0x39'),_0xcc17a5,_0xc8de('0x3c')))},function(){rimraf(path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5),function(){});_0x3ea01b('zip\x20finished');});});}})[_0xc8de('0x2c')](function(){if(!_0x36f18c)return;rimraf(path[_0xc8de('0x34')](_0x1b581c,_0xcc17a5),function(){});})[_0xc8de('0x2c')](function(){logger[_0xc8de('0x3d')](util[_0xc8de('0x1c')](_0xc8de('0x3e'),EXTRACTED_REPORT_ID,_0xc8de('0x3f')));return analyticExtractedReport('Completed',_0x36f18c?util[_0xc8de('0x1c')](_0xc8de('0x39'),_0xcc17a5,_0x36f18c?_0xc8de('0x3c'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc8de('0x3d')](util[_0xc8de('0x1c')](_0xc8de('0x40'),EXTRACTED_REPORT_ID,_0xc8de('0x3f')));return db[_0xc8de('0x41')][_0xc8de('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc8de('0x2c')](function(_0x1b9527){EXTRACTED_REPORT=_0x1b9527;return dbH['sequelize'][_0xc8de('0x30')](util[_0xc8de('0x1c')](_0xc8de('0x43'),QUERY),{'type':dbH[_0xc8de('0x2f')][_0xc8de('0x31')][_0xc8de('0x32')]});})['then'](extractReport)[_0xc8de('0x44')](function(_0x37dc1e){logger[_0xc8de('0x3d')](util[_0xc8de('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc8de('0x3f')),util[_0xc8de('0x45')](_0x37dc1e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc8de('0x46')](function(){process[_0xc8de('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x337a1a=new PdfPrinter({'Arial':{'normal':__dirname+_0xc8de('0x48'),'bold':__dirname+_0xc8de('0x49'),'italics':__dirname+_0xc8de('0x4a'),'bolditalics':__dirname+_0xc8de('0x4b')}});return _0x337a1a;}function getPDFDocDefinitionFromHTML(_0x71a906,_0x1c4e5b){var _0x5f39bc=util[_0xc8de('0x1c')]('%s\x20#%d',_0x1c4e5b[_0xc8de('0x4c')],_0x1c4e5b['interactionId']);var _0x5d2ddf=moment()[_0xc8de('0x1c')](_0xc8de('0x4d'))[_0xc8de('0x13')]();var _0x5983af=htmlToPdfmake(_0x71a906,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5983af],'defaultStyle':{'font':_0xc8de('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc8de('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc8de('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc8de('0x4e')}},'header':function(){return[{'text':_0xc8de('0x4f'),'style':'header'}];},'footer':function(_0x224d21,_0x1ffc88){return[{'text':util[_0xc8de('0x1c')](_0xc8de('0x50'),_0x5f39bc,_0x224d21,_0x1ffc88,_0x5d2ddf),'style':'footer'}];}};}function writePDFDocument(_0x431688,_0x568780){return new Promise(function(_0x5480c0,_0x243642){var _0x17630f=_0x431688[_0xc8de('0x51')](fs['createWriteStream'](_0x568780));_0x17630f['on'](_0xc8de('0x52'),function(){_0x5480c0(_0xc8de('0x52'));});_0x17630f['on'](_0xc8de('0x53'),function(_0x3ffaa5){_0x243642(_0x3ffaa5);});_0x431688[_0xc8de('0x54')]();});}exports[_0xc8de('0x55')]=function(_0x86822b,_0x1bd92d){var _0x205993=getPDFPrinter();var _0x2d35fb=getPDFDocDefinitionFromHTML(_0x86822b,_0x1bd92d);var _0x1ed9de=_0x205993[_0xc8de('0x37')](_0x2d35fb);return writePDFDocument(_0x1ed9de,_0x1bd92d[_0xc8de('0x2')])[_0xc8de('0x44')](function(_0x3886f2){throw _0x3886f2;});};
\ No newline at end of file
+var _0x53b2=['Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','push','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','find','split','splitSizePdf','then','forEach','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','pdf','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','createPdfFromHTML','lodash','util','path','moment','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','tableHeader','toString','value','fill','length','auto','body','concat','chunk','format'];(function(_0x1c7a92,_0xeee946){var _0x34dfab=function(_0x40c7f5){while(--_0x40c7f5){_0x1c7a92['push'](_0x1c7a92['shift']());}};_0x34dfab(++_0xeee946);}(_0x53b2,0x148));var _0x253b=function(_0x4c68a6,_0x4c7077){_0x4c68a6=_0x4c68a6-0x0;var _0xbeced0=_0x53b2[_0x4c68a6];return _0xbeced0;};'use strict';var _=require(_0x253b('0x0'));var fs=require('fs');var util=require(_0x253b('0x1'));var path=require(_0x253b('0x2'));var moment=require(_0x253b('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x253b('0x4'));var JSDOM=require(_0x253b('0x5'))[_0x253b('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0x253b('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0x253b('0x8'))['dbH'];var logger=require(_0x253b('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x253b('0xa')][0x2]);var QUERY=process[_0x253b('0xa')][0x3];var PATH=process[_0x253b('0xa')][0x4];var NAME=process[_0x253b('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xa3c659,_0x2874bd){var _0x1d21f3={'status':_0xa3c659};var _0x2172b8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2874bd){_0x1d21f3[_0x253b('0xb')]=_0x2874bd;}return db[_0x253b('0xc')][_0x253b('0xd')](_0x1d21f3,_0x2172b8);}function getHeaders(_0x4a4287){return _['map'](_0x4a4287,function(_0x3efd94){return{'text':_0x3efd94,'style':_0x253b('0xe')};});}function getRows(_0x38e5aa,_0x4760f1){return _['map'](_0x4760f1,function(_0x8f2684){return _(_0x8f2684)['pick'](_0x38e5aa)['map'](function(_0x3e3232){return _0x3e3232?_[_0x253b('0xf')](_0x3e3232):'';})[_0x253b('0x10')]();});}function createTable(_0x2e5abf,_0xbe20e1){var _0x44b242={'widths':_[_0x253b('0x11')](Array(_0x2e5abf[_0x253b('0x12')]),0x91),'heights':function(_0xe8bbc7){return _0xe8bbc7===0x0?_0x253b('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1b472c=getHeaders(_0x2e5abf);_0x44b242['body']['push'](_0x1b472c);var _0x33c476=getRows(_0x2e5abf,_0xbe20e1);_0x44b242['body']=_0x44b242[_0x253b('0x14')][_0x253b('0x15')](_0x33c476);return _0x44b242;}function createTables(_0x1148c1){var _0x41ccc8=[];var _0x4447f2=_[_0x253b('0x16')](Object['keys'](_0x1148c1[0x0]),0x5);_0x4447f2['forEach'](function(_0x1f79bd){_0x41ccc8['push'](createTable(_0x1f79bd,_0x1148c1));});return _0x41ccc8;}function getPDFDocDefinition(_0x29fd03){var _0x1c2849=util[_0x253b('0x17')](_0x253b('0x18'),NAME,EXTRACTED_REPORT[_0x253b('0x19')],moment(EXTRACTED_REPORT[_0x253b('0x1a')])[_0x253b('0x17')](FORMAT),moment(EXTRACTED_REPORT[_0x253b('0x1b')])['format'](FORMAT));var _0x42af5b=[];for(var _0x47c069=0x0;_0x47c069<_0x29fd03[_0x253b('0x12')];_0x47c069++){var _0xa1c30c=[];if(_0x47c069===0x0){_0xa1c30c['push']({'text':_0x1c2849,'style':_0x253b('0x1c')});}var _0x43d2df={'table':_0x29fd03[_0x47c069]};if(_0x47c069>0x0){_0x43d2df[_0x253b('0x1d')]=_0x253b('0x1e');_0x43d2df[_0x253b('0x1f')]=[0x0,0x46,0x0,0x0];}_0xa1c30c[_0x253b('0x20')](_0x43d2df);_0x42af5b[_0x253b('0x20')](_0xa1c30c);}return{'pageSize':'A4','pageOrientation':_0x253b('0x21'),'content':_0x42af5b,'footer':function(_0xb10bc0,_0x1052a2){return{'text':_0xb10bc0[_0x253b('0xf')]()+_0x253b('0x22')+_0x1052a2,'style':_0x253b('0x23')};},'defaultStyle':{'font':_0x253b('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x253b('0x25')},'footer':{'alignment':_0x253b('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x26f510){var _0x250b28=0x1388;var _0x180332;if(!_0x26f510[0x0][_0x253b('0x27')]){return analyticExtractedReport(_0x253b('0x28'));}return db['Setting'][_0x253b('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x253b('0x2a'),_0x253b('0x2b')]})[_0x253b('0x2c')](function(_0x8985ea){if(_0x8985ea){_0x180332=_0x8985ea;_0x250b28=_0x180332[_0x253b('0x2b')]||0x3e8;}})[_0x253b('0x2c')](function(){var _0x568cc6=[];var _0x1b72d5=0x0;if(_0x180332['split']){if(_0x26f510&&_0x26f510[_0x253b('0x12')]){var _0x5b418b=_['range'](_0x26f510[0x0]['num']/_0x250b28);var _0x33db3f=Number['isInteger'](_0x26f510[0x0]['num']/_0x250b28)?_0x26f510[0x0][_0x253b('0x27')]%_0x250b28:0x0;_0x5b418b[_0x253b('0x2d')](function(_0x58b82){if(_0x58b82>0x0){_0x1b72d5+=_0x250b28;}_0x568cc6[_0x253b('0x20')](dbH[_0x253b('0x2e')][_0x253b('0x2f')](util[_0x253b('0x17')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x250b28,_0x1b72d5),{'type':dbH[_0x253b('0x2e')][_0x253b('0x30')][_0x253b('0x31')]}));});if(_0x33db3f>0x0){_0x1b72d5+=_0x250b28;_0x568cc6['push'](dbH['sequelize']['query'](util[_0x253b('0x17')](_0x253b('0x32'),QUERY,_0x33db3f,_0x1b72d5),{'type':dbH[_0x253b('0x2e')][_0x253b('0x30')][_0x253b('0x31')]}));}}}else{_0x568cc6[_0x253b('0x20')](dbH[_0x253b('0x2e')][_0x253b('0x2f')](QUERY,{'type':dbH[_0x253b('0x2e')][_0x253b('0x30')][_0x253b('0x31')]}));}var _0x51a8d3=path[_0x253b('0x33')](PATH);var _0x5e9b26=path['basename'](PATH,_0x253b('0x34'));var _0x25f5ac=_0x180332[_0x253b('0x2a')]&&_0x568cc6[_0x253b('0x12')]>0x1;var _0x234dd3=[];if(!fs[_0x253b('0x35')](path['join'](_0x51a8d3,_0x5e9b26))&&_0x25f5ac){fs[_0x253b('0x36')](path[_0x253b('0x37')](_0x51a8d3,_0x5e9b26));}return BPromise[_0x253b('0x38')](_0x568cc6,function(_0x52f455){_0x234dd3['push'](_0x52f455);})[_0x253b('0x2c')](function(){var _0x4386a5=[];for(var _0x1fda60=0x0;_0x1fda60<_0x234dd3[_0x253b('0x12')];_0x1fda60+=0x1){var _0x447356=_0x234dd3[_0x1fda60];var _0x410ac2=createTables(_[_0x253b('0x39')](_0x447356));var _0x3c1eb1;var _0x242c0f=getPDFDocDefinition(_0x410ac2);var _0x4f13ea=getPDFPrinter();var _0x30ab6e=_0x4f13ea[_0x253b('0x3a')](_0x242c0f);if(_0x25f5ac){_0x3c1eb1=path[_0x253b('0x37')](_0x51a8d3,_0x5e9b26,util[_0x253b('0x17')]('%s%d.%s',_0x5e9b26,_0x1fda60,_0x253b('0x3b')));}else{_0x3c1eb1=path['join'](_0x51a8d3,util[_0x253b('0x17')]('%s.%s',_0x5e9b26,_0x253b('0x3b')));}_0x4386a5[_0x253b('0x20')](writePDFDocument(_0x30ab6e,_0x3c1eb1));}return Promise[_0x253b('0x3c')](_0x4386a5);})[_0x253b('0x2c')](function(){if(_0x25f5ac){return new Promise(function(_0x111f88){zipdir(path[_0x253b('0x37')](_0x51a8d3,_0x5e9b26),{'saveTo':path[_0x253b('0x37')](_0x51a8d3,util[_0x253b('0x17')]('%s.%s',_0x5e9b26,'zip'))},function(){rimraf(path[_0x253b('0x37')](_0x51a8d3,_0x5e9b26),function(){});_0x111f88('zip\x20finished');});});}})['then'](function(){if(!_0x25f5ac)return;rimraf(path['join'](_0x51a8d3,_0x5e9b26),function(){});})[_0x253b('0x2c')](function(){logger[_0x253b('0x3d')](util[_0x253b('0x17')](_0x253b('0x3e'),EXTRACTED_REPORT_ID,_0x253b('0x3f')));return analyticExtractedReport(_0x253b('0x40'),_0x25f5ac?util[_0x253b('0x17')](_0x253b('0x41'),_0x5e9b26,_0x25f5ac?_0x253b('0x42'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x253b('0x3d')](util[_0x253b('0x17')](_0x253b('0x43'),EXTRACTED_REPORT_ID,_0x253b('0x3f')));return db[_0x253b('0xc')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x44adec){EXTRACTED_REPORT=_0x44adec;return dbH[_0x253b('0x2e')][_0x253b('0x2f')](util[_0x253b('0x17')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x253b('0x30')][_0x253b('0x31')]});})[_0x253b('0x2c')](extractReport)[_0x253b('0x44')](function(_0x5a99bb){logger['info'](util['format'](_0x253b('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0x253b('0x46')](_0x5a99bb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x253b('0x47'));})[_0x253b('0x48')](function(){process[_0x253b('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1300f7=new PdfPrinter({'Arial':{'normal':__dirname+_0x253b('0x4a'),'bold':__dirname+_0x253b('0x4b'),'italics':__dirname+_0x253b('0x4c'),'bolditalics':__dirname+_0x253b('0x4d')}});return _0x1300f7;}function getPDFDocDefinitionFromHTML(_0xec9791,_0x4116be){var _0x5ea340=util[_0x253b('0x17')](_0x253b('0x4e'),_0x4116be['channel'],_0x4116be[_0x253b('0x4f')]);var _0x578bb4=moment()[_0x253b('0x17')](_0x253b('0x50'))[_0x253b('0xf')]();var _0x979d11=htmlToPdfmake(_0xec9791,{'window':window,'tableAutoSize':!![]});return{'content':[_0x979d11],'defaultStyle':{'font':_0x253b('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x253b('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x253b('0x52'),'style':'header'}];},'footer':function(_0x5e378a,_0x5e9050){return[{'text':util['format'](_0x253b('0x53'),_0x5ea340,_0x5e378a,_0x5e9050,_0x578bb4),'style':'footer'}];}};}function writePDFDocument(_0x102939,_0xcd0e9b){return new Promise(function(_0x272c9f,_0x38a746){var _0x5454f1=_0x102939['pipe'](fs['createWriteStream'](_0xcd0e9b));_0x5454f1['on'](_0x253b('0x54'),function(){_0x272c9f(_0x253b('0x54'));});_0x5454f1['on'](_0x253b('0x55'),function(_0x5895d7){_0x38a746(_0x5895d7);});_0x102939[_0x253b('0x56')]();});}exports[_0x253b('0x57')]=function(_0x4e49c0,_0x40cb29){var _0x450644=getPDFPrinter();var _0x4b0308=getPDFDocDefinitionFromHTML(_0x4e49c0,_0x40cb29);var _0x356b15=_0x450644[_0x253b('0x3a')](_0x4b0308);return writePDFDocument(_0x356b15,_0x40cb29[_0x253b('0x2')])[_0x253b('0x44')](function(_0x58d5d2){throw _0x58d5d2;});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6fa=['util','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','XLSX','Setting','split','splitSizeXlsx','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','isInteger','forEach','query','QueryTypes','push','basename','.xlsx','existsSync','mkdirSync','join','each','length','xlsx','%s.%s','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','finally','exit'];(function(_0x5e99f1,_0x2b9658){var _0x24fcb3=function(_0x414fe8){while(--_0x414fe8){_0x5e99f1['push'](_0x5e99f1['shift']());}};_0x24fcb3(++_0x2b9658);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xb6fa[_0x2c2980];return _0x2a20a9;};'use strict';var util=require(_0xab6f('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0xab6f('0x1'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xab6f('0x2'));var db=require(_0xab6f('0x3'))['db'];var dbH=require('../../mysqldb')[_0xab6f('0x4')];var logger=require(_0xab6f('0x5'))(_0xab6f('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xab6f('0x7')][0x2]);var QUERY=process[_0xab6f('0x7')][0x3];var PATH=process[_0xab6f('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16b84e,_0x1b4da9){var _0x46b0f6={'status':_0x16b84e};var _0x85cb19={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b4da9){_0x46b0f6[_0xab6f('0x8')]=_0x1b4da9;}return db[_0xab6f('0x9')][_0xab6f('0xa')](_0x46b0f6,_0x85cb19);}function main(){var _0x67bfd1=0x1388;var _0x85d4c1;logger[_0xab6f('0xb')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xab6f('0xc')));return db[_0xab6f('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xab6f('0xe'),_0xab6f('0xf')]})[_0xab6f('0x10')](function(_0x437b32){if(_0x437b32){_0x85d4c1=_0x437b32;_0x67bfd1=_0x85d4c1[_0xab6f('0xf')]||0x1388;}})[_0xab6f('0x10')](function(){return dbH[_0xab6f('0x11')]['query'](util[_0xab6f('0x12')](_0xab6f('0x13'),QUERY),{'type':dbH[_0xab6f('0x11')]['QueryTypes'][_0xab6f('0x14')]});})['then'](function(_0x49d9f1){if(!_0x49d9f1[0x0][_0xab6f('0x15')]){return analyticExtractedReport('Empty');}var _0x422850=[];var _0x3653f0=0x0;if(_0x85d4c1[_0xab6f('0xe')]){if(_0x49d9f1&&_0x49d9f1['length']){var _0x255021=_['range'](_0x49d9f1[0x0][_0xab6f('0x15')]/_0x67bfd1);var _0x439b73=Number[_0xab6f('0x16')](_0x49d9f1[0x0][_0xab6f('0x15')]/_0x67bfd1)?_0x49d9f1[0x0][_0xab6f('0x15')]%_0x67bfd1:0x0;_0x255021[_0xab6f('0x17')](function(_0x455c20){if(_0x455c20>0x0){_0x3653f0+=_0x67bfd1;}_0x422850['push'](dbH[_0xab6f('0x11')][_0xab6f('0x18')](util[_0xab6f('0x12')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x67bfd1,_0x3653f0),{'type':dbH[_0xab6f('0x11')][_0xab6f('0x19')][_0xab6f('0x14')]}));});if(_0x439b73>0x0){_0x3653f0+=_0x67bfd1;_0x422850[_0xab6f('0x1a')](dbH[_0xab6f('0x11')][_0xab6f('0x18')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x439b73,_0x3653f0),{'type':dbH[_0xab6f('0x11')][_0xab6f('0x19')][_0xab6f('0x14')]}));}}}else{_0x422850[_0xab6f('0x1a')](dbH[_0xab6f('0x11')][_0xab6f('0x18')](QUERY,{'type':dbH[_0xab6f('0x11')]['QueryTypes'][_0xab6f('0x14')]}));}var _0xf849b5=path['dirname'](PATH);var _0x1f8db7=path[_0xab6f('0x1b')](PATH,_0xab6f('0x1c'));var _0x2e10a7=_0x85d4c1[_0xab6f('0xe')]&&_0x422850['length']>0x1;var _0x8d2357=[];if(!fs[_0xab6f('0x1d')](path['join'](_0xf849b5,_0x1f8db7))&&_0x2e10a7){fs[_0xab6f('0x1e')](path[_0xab6f('0x1f')](_0xf849b5,_0x1f8db7));}return BPromise[_0xab6f('0x20')](_0x422850,function(_0x2f8ebc){_0x8d2357[_0xab6f('0x1a')](_0x2f8ebc);})[_0xab6f('0x10')](function(){for(var _0x4952f9=0x0;_0x4952f9<_0x8d2357[_0xab6f('0x21')];_0x4952f9+=0x1){var _0x526d95;var _0x4ab3b2=_0x8d2357[_0x4952f9];if(_0x2e10a7){_0x526d95=path['join'](_0xf849b5,_0x1f8db7,util['format']('%s%d.%s',_0x1f8db7,_0x4952f9,_0xab6f('0x22')));}else{_0x526d95=path[_0xab6f('0x1f')](_0xf849b5,util[_0xab6f('0x12')](_0xab6f('0x23'),_0x1f8db7,_0xab6f('0x22')));}fs['writeFileSync'](_0x526d95,json2xls(_0x4ab3b2),_0xab6f('0x24'));}})[_0xab6f('0x10')](function(){if(_0x2e10a7){return new Promise(function(_0x86ed70){zipdir(path[_0xab6f('0x1f')](_0xf849b5,_0x1f8db7),{'saveTo':path[_0xab6f('0x1f')](_0xf849b5,util[_0xab6f('0x12')](_0xab6f('0x23'),_0x1f8db7,'zip'))},function(_0x19b056,_0xab5bb){rimraf(path[_0xab6f('0x1f')](_0xf849b5,_0x1f8db7),function(){});_0x86ed70('zip\x20finished');});});}})[_0xab6f('0x10')](function(){logger['info'](util[_0xab6f('0x12')](_0xab6f('0x25'),EXTRACTED_REPORT_ID,_0xab6f('0xc')));return analyticExtractedReport(_0xab6f('0x26'),_0x2e10a7?util[_0xab6f('0x12')](_0xab6f('0x23'),_0x1f8db7,_0x2e10a7?_0xab6f('0x27'):_0xab6f('0x22')):null);});})[_0xab6f('0x28')](function(_0x543750){logger[_0xab6f('0xb')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xab6f('0xc')),util[_0xab6f('0x29')](_0x543750,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xab6f('0x2a'));})[_0xab6f('0x2b')](function(){process[_0xab6f('0x2c')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xd755=['range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length'];(function(_0x120e05,_0x223bbd){var _0x237ec0=function(_0x276fd5){while(--_0x276fd5){_0x120e05['push'](_0x120e05['shift']());}};_0x237ec0(++_0x223bbd);}(_0xd755,0x109));var _0x5d75=function(_0x13647c,_0x4822a7){_0x13647c=_0x13647c-0x0;var _0x341ecb=_0xd755[_0x13647c];return _0x341ecb;};'use strict';var util=require(_0x5d75('0x0'));var path=require(_0x5d75('0x1'));var _=require(_0x5d75('0x2'));var fs=require('fs');var json2xls=require(_0x5d75('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x5d75('0x4'));var rimraf=require(_0x5d75('0x5'));var db=require(_0x5d75('0x6'))['db'];var dbH=require(_0x5d75('0x6'))['dbH'];var logger=require(_0x5d75('0x7'))(_0x5d75('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5d75('0x9')][0x2]);var QUERY=process[_0x5d75('0x9')][0x3];var PATH=process[_0x5d75('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ab586,_0x4c3736){var _0x3def3a={'status':_0x3ab586};var _0x4c4391={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4c3736){_0x3def3a[_0x5d75('0xa')]=_0x4c3736;}return db[_0x5d75('0xb')][_0x5d75('0xc')](_0x3def3a,_0x4c4391);}function main(){var _0x233f1f=0x1388;var _0x576c78;logger[_0x5d75('0xd')](util[_0x5d75('0xe')](_0x5d75('0xf'),EXTRACTED_REPORT_ID,_0x5d75('0x10')));return db[_0x5d75('0x11')][_0x5d75('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5d75('0x13'),'splitSizeXlsx']})['then'](function(_0x1ecc83){if(_0x1ecc83){_0x576c78=_0x1ecc83;_0x233f1f=_0x576c78['splitSizeXlsx']||0x1388;}})[_0x5d75('0x14')](function(){return dbH[_0x5d75('0x15')][_0x5d75('0x16')](util[_0x5d75('0xe')](_0x5d75('0x17'),QUERY),{'type':dbH[_0x5d75('0x15')][_0x5d75('0x18')][_0x5d75('0x19')]});})['then'](function(_0x564bb7){if(!_0x564bb7[0x0][_0x5d75('0x1a')]){return analyticExtractedReport(_0x5d75('0x1b'));}var _0x3d89e5=[];var _0x184ea0=0x0;if(_0x576c78[_0x5d75('0x13')]){if(_0x564bb7&&_0x564bb7[_0x5d75('0x1c')]){var _0x4ca974=_[_0x5d75('0x1d')](_0x564bb7[0x0][_0x5d75('0x1a')]/_0x233f1f);var _0x1117c2=Number['isInteger'](_0x564bb7[0x0][_0x5d75('0x1a')]/_0x233f1f)?_0x564bb7[0x0][_0x5d75('0x1a')]%_0x233f1f:0x0;_0x4ca974[_0x5d75('0x1e')](function(_0x41dbe1){if(_0x41dbe1>0x0){_0x184ea0+=_0x233f1f;}_0x3d89e5[_0x5d75('0x1f')](dbH[_0x5d75('0x15')][_0x5d75('0x16')](util['format'](_0x5d75('0x20'),QUERY,_0x233f1f,_0x184ea0),{'type':dbH[_0x5d75('0x15')][_0x5d75('0x18')][_0x5d75('0x19')]}));});if(_0x1117c2>0x0){_0x184ea0+=_0x233f1f;_0x3d89e5[_0x5d75('0x1f')](dbH[_0x5d75('0x15')]['query'](util[_0x5d75('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1117c2,_0x184ea0),{'type':dbH['sequelize'][_0x5d75('0x18')][_0x5d75('0x19')]}));}}}else{_0x3d89e5[_0x5d75('0x1f')](dbH[_0x5d75('0x15')][_0x5d75('0x16')](QUERY,{'type':dbH[_0x5d75('0x15')][_0x5d75('0x18')][_0x5d75('0x19')]}));}var _0x3199a1=path['dirname'](PATH);var _0x11ce93=path[_0x5d75('0x21')](PATH,_0x5d75('0x22'));var _0x4ad17f=_0x576c78[_0x5d75('0x13')]&&_0x3d89e5['length']>0x1;var _0x1b5219=[];if(!fs[_0x5d75('0x23')](path[_0x5d75('0x24')](_0x3199a1,_0x11ce93))&&_0x4ad17f){fs[_0x5d75('0x25')](path[_0x5d75('0x24')](_0x3199a1,_0x11ce93));}return BPromise[_0x5d75('0x26')](_0x3d89e5,function(_0x7505c8){_0x1b5219['push'](_0x7505c8);})['then'](function(){for(var _0x3debca=0x0;_0x3debca<_0x1b5219[_0x5d75('0x1c')];_0x3debca+=0x1){var _0x49bba7;var _0x51a8b4=_0x1b5219[_0x3debca];if(_0x4ad17f){_0x49bba7=path[_0x5d75('0x24')](_0x3199a1,_0x11ce93,util[_0x5d75('0xe')](_0x5d75('0x27'),_0x11ce93,_0x3debca,_0x5d75('0x28')));}else{_0x49bba7=path[_0x5d75('0x24')](_0x3199a1,util['format'](_0x5d75('0x29'),_0x11ce93,_0x5d75('0x28')));}fs[_0x5d75('0x2a')](_0x49bba7,json2xls(_0x51a8b4),_0x5d75('0x2b'));}})[_0x5d75('0x14')](function(){if(_0x4ad17f){return new Promise(function(_0x154fab){zipdir(path[_0x5d75('0x24')](_0x3199a1,_0x11ce93),{'saveTo':path['join'](_0x3199a1,util[_0x5d75('0xe')](_0x5d75('0x29'),_0x11ce93,_0x5d75('0x2c')))},function(_0x1cd7a8,_0x2e7162){rimraf(path[_0x5d75('0x24')](_0x3199a1,_0x11ce93),function(){});_0x154fab('zip\x20finished');});});}})[_0x5d75('0x14')](function(){logger[_0x5d75('0xd')](util[_0x5d75('0xe')](_0x5d75('0x2d'),EXTRACTED_REPORT_ID,_0x5d75('0x10')));return analyticExtractedReport(_0x5d75('0x2e'),_0x4ad17f?util['format']('%s.%s',_0x11ce93,_0x4ad17f?_0x5d75('0x2c'):_0x5d75('0x28')):null);});})['catch'](function(_0x116350){logger[_0x5d75('0xd')](util[_0x5d75('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5d75('0x10')),util['inspect'](_0x116350,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x5d75('0x2f')](function(){process[_0x5d75('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b98=['outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','IntervalId','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','filter','queue','playback','hasOwnProperty','extension','find','extensions','type','Set','format','CDR(type)=%s','context','priority','push','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix'];(function(_0x45495a,_0x353d64){var _0xf6fb7c=function(_0x499820){while(--_0x499820){_0x45495a['push'](_0x45495a['shift']());}};_0xf6fb7c(++_0x353d64);}(_0x7b98,0x1cf));var _0x87b9=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x7b98[_0x4695ba];return _0x524b7d;};'use strict';var _=require(_0x87b9('0x0'));var util=require(_0x87b9('0x1'));function rewrite(_0x91c21,_0x5e74ed){var _0x230ec1=this;return _0x91c21[_0x87b9('0x2')][_0x87b9('0x3')][_0x87b9('0x4')]({'raw':!![]})[_0x87b9('0x5')](function(_0x2af842){_0x230ec1['intervals']=_0x2af842;return _0x91c21[_0x87b9('0x2')][_0x87b9('0x6')][_0x87b9('0x4')]({'where':{'IntervalId':_0x5e74ed['IntervalId']},'raw':!![]});})[_0x87b9('0x5')](function(_0x2c9c22){return _0x91c21[_0x87b9('0x2')]['VoiceExtension'][_0x87b9('0x4')]({'where':{'exten':{'$in':_[_0x87b9('0x7')](_[_0x87b9('0x8')](_0x2c9c22,_0x87b9('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x87b9('0x5')](function(_0x362526){var _0x400a62=_[_0x87b9('0xa')](_0x362526,{'priority':'1'});var _0x300243=_[_0x87b9('0xa')](_0x362526,{'isApp':0x1});var _0x2c2b48=_['groupBy'](_0x300243,_0x87b9('0x9'));var _0x3c6af7=[_0x87b9('0xb'),_0x87b9('0xc')];var _0x580b94=[];var _0x47afe7=[];for(var _0x136bf1 in _0x2c2b48){if(_0x2c2b48[_0x87b9('0xd')](_0x136bf1)){_0x230ec1['priority']=0x2;_0x230ec1['extensions']=[];_0x230ec1[_0x87b9('0xe')]=_[_0x87b9('0xf')](_0x400a62,{'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')]});_0x230ec1[_0x87b9('0x10')]['push']({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':util[_0x87b9('0x13')](_0x87b9('0x14'),_0x2c2b48[_0x136bf1][0x0]['type']),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});if(_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')]==='inbound'){_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x18')+_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}else if(_0x2c2b48[_0x136bf1][0x0]['type']===_0x87b9('0x1a')){if(_0x230ec1[_0x87b9('0xe')]){_0x230ec1['extensions']['push']({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':'CDR(destination)='+(_0x230ec1[_0x87b9('0xe')][_0x87b9('0x1b')]?_0x87b9('0x1c')+_0x230ec1[_0x87b9('0xe')]['cutdigits']+'}':_0x87b9('0x1d')),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1['priority']++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x18')+_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId'],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1['priority']++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});var _0x1d6464=_0x230ec1[_0x87b9('0x16')]++;_0x230ec1['extensions'][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x1e'),'appdata':_0x87b9('0x1f')+(_0x1d6464+0x2)+'):Goto('+(_0x1d6464+0x1)+')','context':_0x2c2b48[_0x136bf1][0x0]['context'],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x1d6464,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});if(_0x230ec1[_0x87b9('0xe')]){_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x230ec1[_0x87b9('0xe')]['cutdigits']?_0x87b9('0x20')+_0x230ec1[_0x87b9('0xe')][_0x87b9('0x1b')]+'}':_0x87b9('0x21'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1['priority']++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':'Set','appdata':_0x87b9('0x22')+_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});if(_0x230ec1[_0x87b9('0xe')]&&_0x230ec1[_0x87b9('0xe')][_0x87b9('0xd')](_0x87b9('0x23'))&&_0x230ec1[_0x87b9('0xe')][_0x87b9('0x23')]!==_0x87b9('0x24')){_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x25'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x230ec1[_0x87b9('0x10')]['push']({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x26')+_0x230ec1[_0x87b9('0xe')]['recordingFormat']||_0x87b9('0x27'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});}}_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':'Set','appdata':_0x87b9('0x28'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0]['exten'],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x29'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x230ec1[_0x87b9('0x10')][_0x87b9('0x17')]({'type':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x2a'),'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'exten':_0x2c2b48[_0x136bf1][0x0]['exten'],'priority':_0x230ec1[_0x87b9('0x16')]++,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0]['VoiceExtensionId']});for(var _0x4a3e2f=0x0,_0x2668ba=0x0;_0x4a3e2f<_0x2c2b48[_0x136bf1][_0x87b9('0x2b')];_0x4a3e2f+=0x1,_0x2668ba=0x0){var _0x3535c2=_0x2c2b48[_0x136bf1][_0x4a3e2f];if(_0x3535c2[_0x87b9('0x11')]){_0x3535c2[_0x87b9('0x11')]=_0x3535c2['type'][_0x87b9('0x2c')]();}var _0x2044ba=[];var _0x39ee9f=[];delete _0x3535c2['id'];delete _0x3535c2['createdAt'];delete _0x3535c2[_0x87b9('0x2d')];var _0x29d07b=_0x3535c2[_0x87b9('0x2e')]!=='*,*,*,*'?[_0x3535c2['interval']]:_0x3535c2[_0x87b9('0x2f')]?_[_0x87b9('0x8')](_['filter'](_0x230ec1[_0x87b9('0x30')],{'IntervalId':_0x3535c2[_0x87b9('0x2f')]}),'interval'):[];if(_0x3535c2[_0x87b9('0xd')](_0x87b9('0x31'))){if(_0x3535c2['tag']&&_0x3535c2[_0x87b9('0x31')]!=='--'){_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':'Set','appdata':_0x87b9('0x32')+_0x3535c2[_0x87b9('0x31')],'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b['length']+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2[_0x87b9('0x19')]});}}if(_0x3535c2[_0x87b9('0x11')]==='outbound'&&_0x3535c2['hasOwnProperty'](_0x87b9('0x33'))){if(_0x3535c2[_0x87b9('0x33')]){_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x1e'),'appdata':_0x87b9('0x34')+_0x3535c2['callerID']+')','context':_0x3535c2[_0x87b9('0x15')],'exten':_0x3535c2['exten'],'priority':_0x29d07b['length']+_0x230ec1['priority']+_0x2668ba++,'VoiceExtensionId':_0x3535c2[_0x87b9('0x19')]});}else{_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2['type'],'app':_0x87b9('0x1e'),'appdata':_0x87b9('0x35'),'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});}}if(_0x3535c2[_0x87b9('0xd')](_0x87b9('0x36'))){if(_0x3c6af7['indexOf'](_0x3535c2['app']['toLowerCase']())>=0x0&&_0x3535c2[_0x87b9('0x37')]!=='custom'){if(_0x3535c2[_0x87b9('0x36')]){_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':'ExecIf','appdata':_0x87b9('0x38'),'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b['length']+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x39'),'context':_0x3535c2['context'],'exten':_0x3535c2[_0x87b9('0x9')],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});}else{_0x2044ba['push']({'type':_0x3535c2['type'],'app':'ExecIf','appdata':_0x87b9('0x3a'),'context':_0x3535c2['context'],'exten':_0x3535c2['exten'],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});_0x2044ba[_0x87b9('0x17')]({'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x12'),'appdata':_0x87b9('0x3b'),'context':_0x3535c2['context'],'exten':_0x3535c2[_0x87b9('0x9')],'priority':_0x29d07b[_0x87b9('0x2b')]+_0x230ec1[_0x87b9('0x16')]+_0x2668ba++,'VoiceExtensionId':_0x3535c2['VoiceExtensionId']});}}}for(var _0x189731=0x0;_0x189731<_0x29d07b[_0x87b9('0x2b')];_0x189731+=0x1){var _0x1226ca=_0x230ec1[_0x87b9('0x16')]+_0x29d07b[_0x87b9('0x2b')];var _0x585613=_0x189731===_0x29d07b['length']-0x1?_0x230ec1[_0x87b9('0x16')]+_0x2044ba[_0x87b9('0x2b')]+_0x39ee9f[_0x87b9('0x2b')]+0x2:_0x230ec1[_0x87b9('0x16')]+_0x189731+0x1;_0x2044ba['splice'](_0x189731,0x0,{'type':_0x3535c2[_0x87b9('0x11')],'app':_0x87b9('0x3c'),'appdata':_0x29d07b[_0x189731]+'?'+_0x3535c2['context']+',${EXTEN},'+_0x1226ca+':'+_0x3535c2[_0x87b9('0x15')]+_0x87b9('0x3d')+_0x585613,'exten':_0x3535c2[_0x87b9('0x9')],'context':_0x3535c2['context'],'priority':_0x230ec1[_0x87b9('0x16')]+_0x189731,'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});}_0x3535c2['priority']=_0x2044ba[_0x87b9('0x2b')]?_[_0x87b9('0x3e')](_0x2044ba)['priority']+0x1:_0x230ec1[_0x87b9('0x16')];_0x230ec1[_0x87b9('0x16')]=(_0x39ee9f['length']?_[_0x87b9('0x3e')](_0x39ee9f)[_0x87b9('0x16')]:_0x3535c2['priority'])+0x1;_0x230ec1[_0x87b9('0x10')]=_[_0x87b9('0x3f')](_0x230ec1[_0x87b9('0x10')],_0x2044ba,[_0x3535c2],_0x39ee9f);}_0x230ec1['extensions']['push']({'type':_0x2c2b48[_0x136bf1][0x0]['type'],'app':_0x87b9('0x40'),'exten':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x9')],'context':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x15')],'priority':_0x230ec1[_0x87b9('0x16')],'VoiceExtensionId':_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]});_0x580b94[_0x87b9('0x17')](_0x2c2b48[_0x136bf1][0x0][_0x87b9('0x19')]);_0x47afe7=_['concat'](_0x47afe7,_0x230ec1[_0x87b9('0x10')]);}}return _0x91c21[_0x87b9('0x41')](function(_0x3dff73){return _0x91c21['models']['VoiceExtension'][_0x87b9('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x580b94}},'transaction':_0x3dff73})['then'](function(_0x151c98){return _0x91c21[_0x87b9('0x2')][_0x87b9('0x6')]['bulkCreate'](_[_0x87b9('0x43')](_0x47afe7,_0x87b9('0x16')),{'transaction':_0x3dff73});});});})[_0x87b9('0x44')](function(_0x5b6a60){console[_0x87b9('0x45')](_0x5b6a60);});}exports[_0x87b9('0x46')]=rewrite;
\ No newline at end of file
+var _0xb6d2=['destroy','bulkCreate','lodash','util','Interval','findAll','then','intervals','models','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','IntervalId','tag','CDR(tag)=','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','VoiceExtension'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xb6d2,0x1a6));var _0x2b6d=function(_0x4a7930,_0xcfda20){_0x4a7930=_0x4a7930-0x0;var _0x1c44a7=_0xb6d2[_0x4a7930];return _0x1c44a7;};'use strict';var _=require(_0x2b6d('0x0'));var util=require(_0x2b6d('0x1'));function rewrite(_0x43ce9d,_0x5c2775){var _0xa891c8=this;return _0x43ce9d['models'][_0x2b6d('0x2')][_0x2b6d('0x3')]({'raw':!![]})[_0x2b6d('0x4')](function(_0x5794c){_0xa891c8[_0x2b6d('0x5')]=_0x5794c;return _0x43ce9d['models']['VoiceExtension'][_0x2b6d('0x3')]({'where':{'IntervalId':_0x5c2775['IntervalId']},'raw':!![]});})[_0x2b6d('0x4')](function(_0x315fc0){return _0x43ce9d[_0x2b6d('0x6')]['VoiceExtension'][_0x2b6d('0x3')]({'where':{'exten':{'$in':_[_0x2b6d('0x7')](_[_0x2b6d('0x8')](_0x315fc0,_0x2b6d('0x9')))}},'order':[{'raw':_0x2b6d('0xa')}],'raw':!![]});})[_0x2b6d('0x4')](function(_0x356a1f){var _0x2f4d4a=_[_0x2b6d('0xb')](_0x356a1f,{'priority':'1'});var _0x10a867=_[_0x2b6d('0xb')](_0x356a1f,{'isApp':0x1});var _0x4e5538=_[_0x2b6d('0xc')](_0x10a867,_0x2b6d('0x9'));var _0x55181c=[_0x2b6d('0xd'),'playback'];var _0x40fac5=[];var _0x4d0239=[];for(var _0x575ded in _0x4e5538){if(_0x4e5538[_0x2b6d('0xe')](_0x575ded)){_0xa891c8[_0x2b6d('0xf')]=0x2;_0xa891c8[_0x2b6d('0x10')]=[];_0xa891c8[_0x2b6d('0x11')]=_[_0x2b6d('0x12')](_0x2f4d4a,{'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')]});_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':util[_0x2b6d('0x16')]('CDR(type)=%s',_0x4e5538[_0x575ded][0x0]['type']),'context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0]['exten'],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});if(_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')]===_0x2b6d('0x19')){_0xa891c8[_0x2b6d('0x10')]['push']({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':'Set','appdata':_0x2b6d('0x1a')+_0x4e5538[_0x575ded][0x0]['VoiceExtensionId'],'context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});}else if(_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')]===_0x2b6d('0x1b')){if(_0xa891c8[_0x2b6d('0x11')]){_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':'Set','appdata':_0x2b6d('0x1c')+(_0xa891c8['extension']['cutdigits']?_0x2b6d('0x1d')+_0xa891c8[_0x2b6d('0x11')][_0x2b6d('0x1e')]+'}':'${EXTEN}'),'context':_0x4e5538[_0x575ded][0x0]['context'],'exten':_0x4e5538[_0x575ded][0x0]['exten'],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});}_0xa891c8['extensions'][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x1a')+_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')],'context':_0x4e5538[_0x575ded][0x0]['context'],'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});var _0x20e899=_0xa891c8[_0x2b6d('0xf')]++;_0xa891c8[_0x2b6d('0x10')]['push']({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':'ExecIf','appdata':_0x2b6d('0x1f')+(_0x20e899+0x2)+_0x2b6d('0x20')+(_0x20e899+0x1)+')','context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'priority':_0x20e899,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});if(_0xa891c8[_0x2b6d('0x11')]){_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0xa891c8[_0x2b6d('0x11')][_0x2b6d('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0xa891c8['extension'][_0x2b6d('0x1e')]+'}':'CDR(prefix)=noprefix','context':_0x4e5538[_0x575ded][0x0]['context'],'exten':_0x4e5538[_0x575ded][0x0]['exten'],'priority':_0xa891c8['priority']++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});}_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0]['type'],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x21')+_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')],'context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});if(_0xa891c8[_0x2b6d('0x11')]&&_0xa891c8[_0x2b6d('0x11')][_0x2b6d('0xe')](_0x2b6d('0x22'))&&_0xa891c8[_0x2b6d('0x11')]['recordingFormat']!==_0x2b6d('0x23')){_0xa891c8['extensions'][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0]['type'],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x24'),'context':_0x4e5538[_0x575ded][0x0]['context'],'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0]['type'],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x25')+_0xa891c8[_0x2b6d('0x11')][_0x2b6d('0x22')]||_0x2b6d('0x26'),'context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'priority':_0xa891c8['priority']++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});}}_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':'Set','appdata':_0x2b6d('0x27'),'context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0]['exten'],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x28'),'context':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x17')],'exten':_0x4e5538[_0x575ded][0x0]['exten'],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});_0xa891c8[_0x2b6d('0x10')]['push']({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x29'),'context':_0x4e5538[_0x575ded][0x0]['context'],'exten':_0x4e5538[_0x575ded][0x0]['exten'],'priority':_0xa891c8[_0x2b6d('0xf')]++,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0]['VoiceExtensionId']});for(var _0x90c82d=0x0,_0x34c7e3=0x0;_0x90c82d<_0x4e5538[_0x575ded]['length'];_0x90c82d+=0x1,_0x34c7e3=0x0){var _0x49f437=_0x4e5538[_0x575ded][_0x90c82d];if(_0x49f437[_0x2b6d('0x14')]){_0x49f437[_0x2b6d('0x14')]=_0x49f437[_0x2b6d('0x14')][_0x2b6d('0x2a')]();}var _0x9da6e0=[];var _0xded7da=[];delete _0x49f437['id'];delete _0x49f437[_0x2b6d('0x2b')];delete _0x49f437[_0x2b6d('0x2c')];var _0x597197=_0x49f437[_0x2b6d('0x2d')]!=='*,*,*,*'?[_0x49f437['interval']]:_0x49f437[_0x2b6d('0x2e')]?_[_0x2b6d('0x8')](_[_0x2b6d('0xb')](_0xa891c8[_0x2b6d('0x5')],{'IntervalId':_0x49f437[_0x2b6d('0x2e')]}),_0x2b6d('0x2d')):[];if(_0x49f437[_0x2b6d('0xe')](_0x2b6d('0x2f'))){if(_0x49f437['tag']&&_0x49f437[_0x2b6d('0x2f')]!=='--'){_0x9da6e0[_0x2b6d('0x13')]({'type':_0x49f437[_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x30')+_0x49f437[_0x2b6d('0x2f')],'context':_0x49f437[_0x2b6d('0x17')],'exten':_0x49f437[_0x2b6d('0x9')],'priority':_0x597197[_0x2b6d('0x31')]+_0xa891c8[_0x2b6d('0xf')]+_0x34c7e3++,'VoiceExtensionId':_0x49f437[_0x2b6d('0x18')]});}}if(_0x49f437['type']===_0x2b6d('0x1b')&&_0x49f437['hasOwnProperty'](_0x2b6d('0x32'))){if(_0x49f437['callerID']){_0x9da6e0[_0x2b6d('0x13')]({'type':_0x49f437[_0x2b6d('0x14')],'app':_0x2b6d('0x33'),'appdata':_0x2b6d('0x34')+_0x49f437[_0x2b6d('0x32')]+')','context':_0x49f437[_0x2b6d('0x17')],'exten':_0x49f437['exten'],'priority':_0x597197[_0x2b6d('0x31')]+_0xa891c8['priority']+_0x34c7e3++,'VoiceExtensionId':_0x49f437['VoiceExtensionId']});}else{_0x9da6e0['push']({'type':_0x49f437['type'],'app':_0x2b6d('0x33'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x49f437['context'],'exten':_0x49f437[_0x2b6d('0x9')],'priority':_0x597197[_0x2b6d('0x31')]+_0xa891c8['priority']+_0x34c7e3++,'VoiceExtensionId':_0x49f437[_0x2b6d('0x18')]});}}if(_0x49f437[_0x2b6d('0xe')](_0x2b6d('0x35'))){if(_0x55181c[_0x2b6d('0x36')](_0x49f437[_0x2b6d('0x37')][_0x2b6d('0x2a')]())>=0x0&&_0x49f437[_0x2b6d('0x38')]!==_0x2b6d('0x39')){if(_0x49f437[_0x2b6d('0x35')]){_0x9da6e0['push']({'type':_0x49f437[_0x2b6d('0x14')],'app':_0x2b6d('0x33'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x49f437['context'],'exten':_0x49f437[_0x2b6d('0x9')],'priority':_0x597197[_0x2b6d('0x31')]+_0xa891c8['priority']+_0x34c7e3++,'VoiceExtensionId':_0x49f437[_0x2b6d('0x18')]});_0x9da6e0['push']({'type':_0x49f437[_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x3a'),'context':_0x49f437['context'],'exten':_0x49f437[_0x2b6d('0x9')],'priority':_0x597197['length']+_0xa891c8[_0x2b6d('0xf')]+_0x34c7e3++,'VoiceExtensionId':_0x49f437['VoiceExtensionId']});}else{_0x9da6e0[_0x2b6d('0x13')]({'type':_0x49f437[_0x2b6d('0x14')],'app':'ExecIf','appdata':_0x2b6d('0x3b'),'context':_0x49f437[_0x2b6d('0x17')],'exten':_0x49f437['exten'],'priority':_0x597197[_0x2b6d('0x31')]+_0xa891c8['priority']+_0x34c7e3++,'VoiceExtensionId':_0x49f437['VoiceExtensionId']});_0x9da6e0['push']({'type':_0x49f437[_0x2b6d('0x14')],'app':_0x2b6d('0x15'),'appdata':_0x2b6d('0x3c'),'context':_0x49f437[_0x2b6d('0x17')],'exten':_0x49f437[_0x2b6d('0x9')],'priority':_0x597197[_0x2b6d('0x31')]+_0xa891c8[_0x2b6d('0xf')]+_0x34c7e3++,'VoiceExtensionId':_0x49f437[_0x2b6d('0x18')]});}}}for(var _0x640ee6=0x0;_0x640ee6<_0x597197[_0x2b6d('0x31')];_0x640ee6+=0x1){var _0x4ee696=_0xa891c8[_0x2b6d('0xf')]+_0x597197[_0x2b6d('0x31')];var _0x2ee7c0=_0x640ee6===_0x597197['length']-0x1?_0xa891c8[_0x2b6d('0xf')]+_0x9da6e0[_0x2b6d('0x31')]+_0xded7da[_0x2b6d('0x31')]+0x2:_0xa891c8[_0x2b6d('0xf')]+_0x640ee6+0x1;_0x9da6e0[_0x2b6d('0x3d')](_0x640ee6,0x0,{'type':_0x49f437['type'],'app':_0x2b6d('0x3e'),'appdata':_0x597197[_0x640ee6]+'?'+_0x49f437[_0x2b6d('0x17')]+_0x2b6d('0x3f')+_0x4ee696+':'+_0x49f437[_0x2b6d('0x17')]+',${EXTEN},'+_0x2ee7c0,'exten':_0x49f437[_0x2b6d('0x9')],'context':_0x49f437[_0x2b6d('0x17')],'priority':_0xa891c8[_0x2b6d('0xf')]+_0x640ee6,'VoiceExtensionId':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x18')]});}_0x49f437['priority']=_0x9da6e0[_0x2b6d('0x31')]?_[_0x2b6d('0x40')](_0x9da6e0)[_0x2b6d('0xf')]+0x1:_0xa891c8[_0x2b6d('0xf')];_0xa891c8[_0x2b6d('0xf')]=(_0xded7da[_0x2b6d('0x31')]?_['last'](_0xded7da)[_0x2b6d('0xf')]:_0x49f437['priority'])+0x1;_0xa891c8[_0x2b6d('0x10')]=_[_0x2b6d('0x41')](_0xa891c8[_0x2b6d('0x10')],_0x9da6e0,[_0x49f437],_0xded7da);}_0xa891c8[_0x2b6d('0x10')][_0x2b6d('0x13')]({'type':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x14')],'app':'Hangup','exten':_0x4e5538[_0x575ded][0x0][_0x2b6d('0x9')],'context':_0x4e5538[_0x575ded][0x0]['context'],'priority':_0xa891c8[_0x2b6d('0xf')],'VoiceExtensionId':_0x4e5538[_0x575ded][0x0]['VoiceExtensionId']});_0x40fac5[_0x2b6d('0x13')](_0x4e5538[_0x575ded][0x0]['VoiceExtensionId']);_0x4d0239=_[_0x2b6d('0x41')](_0x4d0239,_0xa891c8[_0x2b6d('0x10')]);}}return _0x43ce9d[_0x2b6d('0x42')](function(_0x346a0c){return _0x43ce9d[_0x2b6d('0x6')][_0x2b6d('0x43')][_0x2b6d('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x40fac5}},'transaction':_0x346a0c})[_0x2b6d('0x4')](function(_0x132b84){return _0x43ce9d[_0x2b6d('0x6')][_0x2b6d('0x43')][_0x2b6d('0x45')](_['sortBy'](_0x4d0239,_0x2b6d('0xf')),{'transaction':_0x346a0c});});});})['catch'](function(_0x24fa11){console['error'](_0x24fa11);});}exports['rewrite']=rewrite;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac06=['generalCheckHopper','finally','contact:csv_','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','undefined','argv','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','into','cm_hopper','ListId','updatedAt','select','field','scheduledAt','ContactId','toString','NOW()','createdAt','from','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','sequelize','VoiceQueueId','then','onlyIfOpen','query','CmList','BlackLists','get','Campaign','CampaignId','all','cmContact,\x20%s,\x20%s'];(function(_0x23d074,_0x610d9b){var _0x3e2283=function(_0x4caa68){while(--_0x4caa68){_0x23d074['push'](_0x23d074['shift']());}};_0x3e2283(++_0x610d9b);}(_0xac06,0xeb));var _0x6ac0=function(_0x5bd95c,_0x17a0a7){_0x5bd95c=_0x5bd95c-0x0;var _0x54e71b=_0xac06[_0x5bd95c];return _0x54e71b;};'use strict';var BPromise=require(_0x6ac0('0x0'));var util=require('util');var _=require(_0x6ac0('0x1'));var fs=require('fs');var squel=require(_0x6ac0('0x2'));var Papa=require(_0x6ac0('0x3'));var Redis=require(_0x6ac0('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x6ac0('0x5'));var logger=require(_0x6ac0('0x6'))(_0x6ac0('0x7'));config[_0x6ac0('0x8')]=_[_0x6ac0('0x9')](config['redis'],{'host':_0x6ac0('0xa'),'port':0x18eb});var socket=require(_0x6ac0('0xb'))(new Redis(config[_0x6ac0('0x8')]));require(_0x6ac0('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x2]===_0x6ac0('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x6ac0('0xe')][0x3]||process[_0x6ac0('0xe')][0x3]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x3]==='null'||!process[_0x6ac0('0xe')][0x4]||process['argv'][0x4]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x4]===_0x6ac0('0xf')){throw new Error(_0x6ac0('0x10'));}var FIELDS=_['zipObject'](process[_0x6ac0('0xe')][0x3][_0x6ac0('0x11')](','),process[_0x6ac0('0xe')][0x4][_0x6ac0('0x11')](','));if(!process['argv'][0x5]||process[_0x6ac0('0xe')][0x5]===_0x6ac0('0xd')||process[_0x6ac0('0xe')][0x5]===_0x6ac0('0xf')){throw new Error(_0x6ac0('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x6ac0('0xe')][0x6]&&process[_0x6ac0('0xe')][0x6]!==_0x6ac0('0xd')&&process['argv'][0x6]!==_0x6ac0('0xf')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x6ac0('0xd')&&process['argv'][0x7]!==_0x6ac0('0xf')?process[_0x6ac0('0xe')][0x7]:null;if(!process[_0x6ac0('0xe')][0x8]||process[_0x6ac0('0xe')][0x8]===_0x6ac0('0xd')||process['argv'][0x8]===_0x6ac0('0xf')){throw new Error(_0x6ac0('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xd1c76c){logger[_0x6ac0('0x14')](_0xd1c76c);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x434fcb,_0x1a5538,_0x5448f5,_0x4ec728){var _0x34bb25={'message':_0x1a5538};_0x34bb25[_0x434fcb]=!![];if(_0x5448f5){_0x34bb25['contact']=_0x5448f5;}if(_0x4ec728){_0x34bb25[_0x6ac0('0x15')]=_0x4ec728;}return _0x34bb25;}function isEmail(_0xf9bd36){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x6ac0('0x16')](_0xf9bd36);}function checkRow(_0x19ace7,_0x393914,_0x49a6f4){return new BPromise(function(_0x33c47c,_0x299bb4){if(_[_0x6ac0('0x17')](_0x19ace7)){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x18'),null,_0x49a6f4));}if(_0x19ace7[_0x6ac0('0x19')]&&_0x19ace7[_0x6ac0('0x19')][_0x6ac0('0x1a')]){var _0x4cd15c=_[_0x6ac0('0x1b')](_0x19ace7[_0x6ac0('0x19')],_0x6ac0('0x1c'))[_0x6ac0('0x1d')](';');return _0x299bb4(handleCheckRowError('error',_0x4cd15c,null,_0x49a6f4));}var _0x3af8c2={};for(var _0x5143ed in FIELDS){if(FIELDS[_0x6ac0('0x1e')](_0x5143ed)&&FIELDS[_0x5143ed]){_0x3af8c2[_0x5143ed]=_0x19ace7[_0x6ac0('0x1f')][0x0][FIELDS[_0x5143ed]]||_0x19ace7[_0x6ac0('0x1f')][0x0]['\ufeff'+FIELDS[_0x5143ed]];}}if(!_0x3af8c2['firstName']){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x20'),null,_0x49a6f4));}if(!_0x3af8c2[_0x6ac0('0x21')]){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x22'),null,_0x49a6f4));}if(_0x3af8c2[_0x6ac0('0x23')]){var _0x2d596b=moment(_0x3af8c2[_0x6ac0('0x23')],_0x6ac0('0x24'));if(!_0x2d596b[_0x6ac0('0x25')]()){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x49a6f4));}}if(_0x3af8c2[_0x6ac0('0x26')]){if(!isEmail(_0x3af8c2[_0x6ac0('0x26')])){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x27'),null,_0x49a6f4));}}_0x3af8c2['ListId']=LISTID;_0x3af8c2[_0x6ac0('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6ac0('0x1a')]&&_0x393914){var _0x808522={};for(var _0x5298be=0x0,_0x4f1fcd=DUPLICATES[_0x6ac0('0x1a')];_0x5298be<_0x4f1fcd;_0x5298be+=0x1){_0x808522[DUPLICATES[_0x5298be]]=_0x3af8c2[DUPLICATES[_0x5298be]];}var _0x24b912=_[_0x6ac0('0x29')](_0x393914,_0x808522);if(_0x24b912){return _0x299bb4(handleCheckRowError(_0x6ac0('0x2a'),_0x6ac0('0x2b'),_0x24b912,_0x49a6f4));}}return db[_0x6ac0('0x2c')]['create'](_0x3af8c2,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3af8c2)})['then'](function(_0x488b24){if(DUPLICATES&&DUPLICATES[_0x6ac0('0x1a')]&&_0x393914){_0x393914[_0x6ac0('0x2d')](_[_0x6ac0('0x2e')](_0x3af8c2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x488b24['id'];return _0x33c47c();})[_0x6ac0('0x2f')](function(_0x3ba257){return _0x299bb4(handleCheckRowError(_0x6ac0('0x14'),_0x6ac0('0x30')+(_0x3ba257['message']||JSON[_0x6ac0('0x31')](_0x3ba257)),null,_0x49a6f4));});});}function checkHopper(){function _0x56db11(){return function(_0xd3145e){logger['error']('cmContact',_0x6ac0('0x32'),util[_0x6ac0('0x33')](_0xd3145e,{'showHidden':![],'depth':null}));};}var _0x3e5b0c=function(_0x401e95,_0x30cfa8){var _0x363645=squel['insert']()[_0x6ac0('0x34')](_0x6ac0('0x35'))['fromQuery']([_0x6ac0('0x21'),'scheduledAt','ContactId',_0x6ac0('0x36'),_0x30cfa8,'createdAt',_0x6ac0('0x37')],squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')]('NOW()',_0x6ac0('0x3a'))['field']('id',_0x6ac0('0x3b'))['field'](LISTID[_0x6ac0('0x3c')](),'ListId')[_0x6ac0('0x39')](_0x401e95['id'][_0x6ac0('0x3c')](),_0x30cfa8)[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x3e'))[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x37'))[_0x6ac0('0x3f')]('cm_contacts')['where'](_0x6ac0('0x40'))[_0x6ac0('0x41')](_0x6ac0('0x42'),LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')](_0x6ac0('0x43'))[_0x6ac0('0x41')](_0x6ac0('0x44'),squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'))[_0x6ac0('0x3f')](_0x6ac0('0x35'))[_0x6ac0('0x41')](_0x30cfa8+'\x20=\x20?',_0x401e95['id'][_0x6ac0('0x3c')]())))[_0x6ac0('0x3c')]();return _0x363645;};var _0x3bb349=function(_0x12da19,_0x4a392f){var _0xca33a3=squel[_0x6ac0('0x45')]()[_0x6ac0('0x34')](_0x6ac0('0x35'))['fromQuery']([_0x6ac0('0x21'),_0x6ac0('0x3a'),_0x6ac0('0x3b'),'ListId',_0x4a392f,'createdAt',_0x6ac0('0x37')],squel['select']()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')]('NOW()',_0x6ac0('0x3a'))[_0x6ac0('0x39')]('id',_0x6ac0('0x3b'))[_0x6ac0('0x39')](LISTID[_0x6ac0('0x3c')](),_0x6ac0('0x36'))['field'](_0x12da19['id'][_0x6ac0('0x3c')](),_0x4a392f)[_0x6ac0('0x39')](_0x6ac0('0x3d'),'createdAt')[_0x6ac0('0x39')]('NOW()',_0x6ac0('0x37'))['from'](_0x6ac0('0x46'))[_0x6ac0('0x41')](_0x6ac0('0x40'))[_0x6ac0('0x41')]('ListId\x20=\x20?',LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')](_0x6ac0('0x47'),squel[_0x6ac0('0x48')](hopperContacts))[_0x6ac0('0x41')](_0x6ac0('0x43'))[_0x6ac0('0x41')](_0x6ac0('0x44'),squel[_0x6ac0('0x38')]()['field'](_0x6ac0('0x49'))[_0x6ac0('0x3f')](_0x6ac0('0x4a'))[_0x6ac0('0x41')](_0x4a392f+_0x6ac0('0x4b'),_0x12da19['id'][_0x6ac0('0x3c')]()))[_0x6ac0('0x41')](_0x6ac0('0x44'),squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'))[_0x6ac0('0x3f')](_0x6ac0('0x35'))[_0x6ac0('0x41')](_0x4a392f+_0x6ac0('0x4b'),_0x12da19['id'][_0x6ac0('0x3c')]())))['toString']();return _0xca33a3;};function _0x2c5c22(_0x47dcec,_0x2a5ad5){var _0x2500fa=squel[_0x6ac0('0x45')]()['into'](_0x6ac0('0x35'))['fromQuery'](['phone',_0x6ac0('0x3a'),_0x6ac0('0x3b'),_0x6ac0('0x36'),_0x2a5ad5,_0x6ac0('0x3e'),'updatedAt'],squel[_0x6ac0('0x38')]()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x3a'))[_0x6ac0('0x39')]('id','ContactId')['field'](LISTID[_0x6ac0('0x3c')](),_0x6ac0('0x36'))[_0x6ac0('0x39')](_0x47dcec['id'][_0x6ac0('0x3c')](),_0x2a5ad5)[_0x6ac0('0x39')](_0x6ac0('0x3d'),_0x6ac0('0x3e'))[_0x6ac0('0x39')](_0x6ac0('0x3d'),'updatedAt')['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x6ac0('0x41')]('ListId\x20=\x20?',LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')](_0x6ac0('0x47'),squel[_0x6ac0('0x48')](hopperContacts))[_0x6ac0('0x41')](_0x6ac0('0x43')))['toString']();return _0x2500fa;}function _0x5ba5d4(_0x439903,_0x15b2c9){var _0x94fb80=squel[_0x6ac0('0x45')]()['into'](_0x6ac0('0x4c'))['fromQuery'](['phone','ContactId',_0x6ac0('0x36'),_0x15b2c9,_0x6ac0('0x3e'),_0x6ac0('0x37')],squel['select']()[_0x6ac0('0x39')](_0x6ac0('0x21'),_0x6ac0('0x21'))[_0x6ac0('0x39')]('id',_0x6ac0('0x3b'))['field'](LISTID[_0x6ac0('0x3c')](),_0x6ac0('0x36'))[_0x6ac0('0x39')](_0x439903['id'][_0x6ac0('0x3c')](),_0x15b2c9)['field'](_0x6ac0('0x3d'),_0x6ac0('0x3e'))['field'](_0x6ac0('0x3d'),'updatedAt')[_0x6ac0('0x3f')](_0x6ac0('0x46'))[_0x6ac0('0x41')]('deletedAt\x20IS\x20NULL')[_0x6ac0('0x41')](_0x6ac0('0x42'),LISTID[_0x6ac0('0x3c')]())[_0x6ac0('0x41')]('id\x20IN\x20?',squel[_0x6ac0('0x48')](hopperContacts))[_0x6ac0('0x41')](_0x6ac0('0x43')))[_0x6ac0('0x3c')]();return _0x94fb80;}return db[_0x6ac0('0x4d')][_0x6ac0('0x4e')]({'where':{'type':_0x6ac0('0x4f')},'attributes':['id',_0x6ac0('0x50')],'include':[{'model':db['CmList'],'as':_0x6ac0('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x3efb7f){var _0x23f47a=[];if(_0x3efb7f){var _0x5b3717;for(var _0x142983=0x0,_0x5aa5a4;_0x142983<_0x3efb7f[_0x6ac0('0x1a')];_0x142983+=0x1){_0x5aa5a4=_0x3efb7f[_0x142983]['get']({'plain':!![]});switch(_0x5aa5a4[_0x6ac0('0x50')]){case _0x6ac0('0x52'):_0x23f47a[_0x6ac0('0x2d')](db[_0x6ac0('0x53')]['query'](_0x3bb349(_0x5aa5a4,_0x6ac0('0x54')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;case _0x6ac0('0x56'):_0x23f47a[_0x6ac0('0x2d')](db['sequelize'][_0x6ac0('0x57')](_0x3e5b0c(_0x5aa5a4,_0x6ac0('0x54')))['then'](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;default:_0x23f47a[_0x6ac0('0x2d')](db[_0x6ac0('0x53')][_0x6ac0('0x57')](_0x2c5c22(_0x5aa5a4,_0x6ac0('0x54')))[_0x6ac0('0x55')](function(){})['catch'](_0x56db11()));}}}return _0x23f47a;})['all']()['then'](function(){return db[_0x6ac0('0x4d')][_0x6ac0('0x4e')]({'where':{'type':_0x6ac0('0x4f')},'attributes':['id'],'include':[{'model':db[_0x6ac0('0x58')],'as':_0x6ac0('0x59'),'where':{'id':LISTID}}]})[_0x6ac0('0x55')](function(_0x3e282a){var _0x1796c0=[];if(_0x3e282a){var _0x4f2f0d;for(var _0x50ea39=0x0,_0x4e4e17;_0x50ea39<_0x3e282a[_0x6ac0('0x1a')];_0x50ea39+=0x1){_0x4e4e17=_0x3e282a[_0x50ea39][_0x6ac0('0x5a')]({'plain':!![]});_0x1796c0['push'](db['sequelize'][_0x6ac0('0x57')](_0x5ba5d4(_0x4e4e17,_0x6ac0('0x54')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));}}return _0x1796c0;})['all']();})[_0x6ac0('0x55')](function(){return db[_0x6ac0('0x5b')][_0x6ac0('0x4e')]({'attributes':['id',_0x6ac0('0x50')],'include':[{'model':db[_0x6ac0('0x58')],'as':_0x6ac0('0x51'),'where':{'id':LISTID}}]})[_0x6ac0('0x55')](function(_0x3f1c7f){var _0x51bf9b=[];if(_0x3f1c7f){for(var _0x4c2fab=0x0,_0x16d33e;_0x4c2fab<_0x3f1c7f[_0x6ac0('0x1a')];_0x4c2fab+=0x1){_0x16d33e=_0x3f1c7f[_0x4c2fab][_0x6ac0('0x5a')]({'plain':!![]});switch(_0x16d33e[_0x6ac0('0x50')]){case'always':_0x51bf9b[_0x6ac0('0x2d')](db[_0x6ac0('0x53')][_0x6ac0('0x57')](_0x3bb349(_0x16d33e,_0x6ac0('0x5c')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;case _0x6ac0('0x56'):_0x51bf9b[_0x6ac0('0x2d')](db[_0x6ac0('0x53')][_0x6ac0('0x57')](_0x3e5b0c(_0x16d33e,_0x6ac0('0x5c')))[_0x6ac0('0x55')](function(){})[_0x6ac0('0x2f')](_0x56db11()));break;default:_0x51bf9b['push'](db[_0x6ac0('0x53')]['query'](_0x2c5c22(_0x16d33e,'CampaignId'))[_0x6ac0('0x55')](function(){})['catch'](_0x56db11()));}}}return _0x51bf9b;})['all']();})[_0x6ac0('0x55')](function(){return db[_0x6ac0('0x5b')][_0x6ac0('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x6ac0('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x4fe1db){var _0x46e6c6=[];if(_0x4fe1db){for(var _0x106913=0x0,_0x51bb69;_0x106913<_0x4fe1db[_0x6ac0('0x1a')];_0x106913+=0x1){_0x51bb69=_0x4fe1db[_0x106913]['get']({'plain':!![]});_0x46e6c6[_0x6ac0('0x2d')](db['sequelize'][_0x6ac0('0x57')](_0x5ba5d4(_0x51bb69,_0x6ac0('0x5c')))['then'](function(){})[_0x6ac0('0x2f')](_0x56db11()));}}return _0x46e6c6;})[_0x6ac0('0x5d')]();})[_0x6ac0('0x2f')](function(_0x26e35f){logger[_0x6ac0('0x14')](_0x6ac0('0x5e'),_0x6ac0('0x5f'),_0x26e35f[_0x6ac0('0x1c')]);});}var processPromises=function(_0x1435ea){return BPromise['all'](promises)[_0x6ac0('0x55')](function(_0x327588){})['catch'](function(_0x24c07f){logger[_0x6ac0('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0x6ac0('0x31')](_0x24c07f));})[_0x6ac0('0x60')](function(){socket['emit'](_0x6ac0('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1435ea){return _0x1435ea['resume']();}});};var endCsv=function(){return BPromise[_0x6ac0('0x62')]()[_0x6ac0('0x55')](function(){if(hopperContacts){return checkHopper();}})[_0x6ac0('0x55')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6ac0('0x63')](FILEPATH);}catch(_0x306e34){logger[_0x6ac0('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x306e34));}finally{process[_0x6ac0('0x64')](0x0);}});};process['on'](_0x6ac0('0x65'),function(){logger[_0x6ac0('0x66')](_0x6ac0('0x67'));endCsv();});function main(){return BPromise[_0x6ac0('0x62')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6ac0('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6ac0('0x55')](function(_0x4eef8e){var _0x2cf069=fs[_0x6ac0('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6ac0('0x69')](_0x2cf069,{'header':!![],'skipEmptyLines':!![],'step':function(_0x640f1d,_0x47143d){total+=0x1;var _0x2a5dc3=total;promises[_0x6ac0('0x2d')](checkRow(_0x640f1d,_0x4eef8e,_0x2a5dc3)['then'](function(){success+=0x1;})[_0x6ac0('0x2f')](function(_0x45aecd){if(_0x45aecd[_0x6ac0('0x14')]){errors+=0x1;delete _0x45aecd[_0x6ac0('0x14')];}else if(_0x45aecd[_0x6ac0('0x2a')]){duplicates+=0x1;delete _0x45aecd['duplicate'];}rows[_0x6ac0('0x2d')](_0x45aecd);}));if(total%0xc8===0x0){_0x47143d[_0x6ac0('0x6a')]();return processPromises(_0x47143d);}},'complete':function(){return processPromises()[_0x6ac0('0x55')](function(){logger[_0x6ac0('0x66')](_0x6ac0('0x6b'));endCsv();});},'error':function(_0x26dc6a,_0x12a904){logger[_0x6ac0('0x66')](_0x6ac0('0x6c'),JSON[_0x6ac0('0x31')](_0x26dc6a));endCsv();}});})['catch'](function(_0x7d723){logger[_0x6ac0('0x14')](_0x6ac0('0x6d'),JSON['stringify'](_0x7d723));});}main();
\ No newline at end of file
+var _0x00d1=['calleridnum','cm_hopper_final','insert','outbound','dialCheckDuplicateType','Lists','then','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','findAll','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','phone','birthDate','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','into','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_hopper','fromQuery','scheduledAt','id\x20IN\x20?','str'];(function(_0x51fc7c,_0x475586){var _0x1482a7=function(_0x1a3f5f){while(--_0x1a3f5f){_0x51fc7c['push'](_0x51fc7c['shift']());}};_0x1482a7(++_0x475586);}(_0x00d1,0x1c7));var _0x100d=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x00d1[_0x419e17];return _0x1f2044;};'use strict';var BPromise=require(_0x100d('0x0'));var util=require(_0x100d('0x1'));var _=require(_0x100d('0x2'));var fs=require('fs');var squel=require(_0x100d('0x3'));var Papa=require('papaparse');var Redis=require(_0x100d('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x100d('0x5'));var logger=require(_0x100d('0x6'))('api');config['redis']=_[_0x100d('0x7')](config[_0x100d('0x8')],{'host':_0x100d('0x9'),'port':0x18eb});var socket=require(_0x100d('0xa'))(new Redis(config['redis']));require(_0x100d('0xb'))['register'](socket);try{if(!process[_0x100d('0xc')][0x2]||process[_0x100d('0xc')][0x2]===_0x100d('0xd')||process['argv'][0x2]===_0x100d('0xe')){throw new Error(_0x100d('0xf'));}var FILEPATH=process[_0x100d('0xc')][0x2];if(!process[_0x100d('0xc')][0x3]||process['argv'][0x3]===_0x100d('0xd')||process[_0x100d('0xc')][0x3]===_0x100d('0xe')||!process[_0x100d('0xc')][0x4]||process[_0x100d('0xc')][0x4]===_0x100d('0xd')||process[_0x100d('0xc')][0x4]===_0x100d('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x100d('0x10')](process[_0x100d('0xc')][0x3][_0x100d('0x11')](','),process[_0x100d('0xc')][0x4]['split'](','));if(!process[_0x100d('0xc')][0x5]||process[_0x100d('0xc')][0x5]==='undefined'||process['argv'][0x5]===_0x100d('0xe')){throw new Error(_0x100d('0x12'));}var LISTID=process[_0x100d('0xc')][0x5];var COMPANYID=process[_0x100d('0xc')][0x6]&&process['argv'][0x6]!=='undefined'&&process['argv'][0x6]!==_0x100d('0xe')?process[_0x100d('0xc')][0x6]:null;var DUPLICATES=process[_0x100d('0xc')][0x7]&&process['argv'][0x7]!==_0x100d('0xd')&&process[_0x100d('0xc')][0x7]!==_0x100d('0xe')?process[_0x100d('0xc')][0x7]:null;if(!process[_0x100d('0xc')][0x8]||process[_0x100d('0xc')][0x8]===_0x100d('0xd')||process[_0x100d('0xc')][0x8]===_0x100d('0xe')){throw new Error(_0x100d('0x13'));}var SOCKET_TIMESTAMP=process[_0x100d('0xc')][0x8];}catch(_0x138b24){logger[_0x100d('0x14')](_0x138b24);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x1af13d,_0x394fc8,_0x5b2036,_0x143704){var _0x292c14={'message':_0x394fc8};_0x292c14[_0x1af13d]=!![];if(_0x5b2036){_0x292c14[_0x100d('0x15')]=_0x5b2036;}if(_0x143704){_0x292c14[_0x100d('0x16')]=_0x143704;}return _0x292c14;}function isEmail(_0xaa3262){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0xaa3262);}function checkRow(_0x2e3771,_0x5dfd33,_0x577999){return new BPromise(function(_0x4ae09a,_0x468593){if(_[_0x100d('0x17')](_0x2e3771)){return _0x468593(handleCheckRowError('error',_0x100d('0x18'),null,_0x577999));}if(_0x2e3771[_0x100d('0x19')]&&_0x2e3771[_0x100d('0x19')][_0x100d('0x1a')]){var _0x15494e=_[_0x100d('0x1b')](_0x2e3771[_0x100d('0x19')],_0x100d('0x1c'))[_0x100d('0x1d')](';');return _0x468593(handleCheckRowError('error',_0x15494e,null,_0x577999));}var _0x1816b6={};for(var _0x569067 in FIELDS){if(FIELDS[_0x100d('0x1e')](_0x569067)&&FIELDS[_0x569067]){_0x1816b6[_0x569067]=_0x2e3771['data'][0x0][FIELDS[_0x569067]]||_0x2e3771[_0x100d('0x1f')][0x0]['\ufeff'+FIELDS[_0x569067]];}}if(!_0x1816b6['firstName']){return _0x468593(handleCheckRowError(_0x100d('0x14'),'firstName\x20not\x20specified!',null,_0x577999));}if(!_0x1816b6[_0x100d('0x20')]){return _0x468593(handleCheckRowError(_0x100d('0x14'),'phone\x20not\x20specified!',null,_0x577999));}if(_0x1816b6[_0x100d('0x21')]){var _0x27a60e=moment(_0x1816b6[_0x100d('0x21')],'YYYY-MM-DD');if(!_0x27a60e[_0x100d('0x22')]()){return _0x468593(handleCheckRowError(_0x100d('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x577999));}}if(_0x1816b6['email']){if(!isEmail(_0x1816b6[_0x100d('0x23')])){return _0x468593(handleCheckRowError(_0x100d('0x14'),_0x100d('0x24'),null,_0x577999));}}_0x1816b6['ListId']=LISTID;_0x1816b6[_0x100d('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x100d('0x1a')]&&_0x5dfd33){var _0x419346={};for(var _0x5eea33=0x0,_0x1f03e8=DUPLICATES[_0x100d('0x1a')];_0x5eea33<_0x1f03e8;_0x5eea33+=0x1){_0x419346[DUPLICATES[_0x5eea33]]=_0x1816b6[DUPLICATES[_0x5eea33]];}var _0x474c6d=_[_0x100d('0x26')](_0x5dfd33,_0x419346);if(_0x474c6d){return _0x468593(handleCheckRowError(_0x100d('0x27'),_0x100d('0x28'),_0x474c6d,_0x577999));}}return db[_0x100d('0x29')]['create'](_0x1816b6,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1816b6)})['then'](function(_0x35c46a){if(DUPLICATES&&DUPLICATES['length']&&_0x5dfd33){_0x5dfd33[_0x100d('0x2a')](_['pick'](_0x1816b6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x35c46a['id'];return _0x4ae09a();})[_0x100d('0x2b')](function(_0x201113){return _0x468593(handleCheckRowError(_0x100d('0x14'),_0x100d('0x2c')+(_0x201113[_0x100d('0x1c')]||JSON[_0x100d('0x2d')](_0x201113)),null,_0x577999));});});}function checkHopper(){function _0x2c50fc(){return function(_0xd33337){logger['error'](_0x100d('0x2e'),_0x100d('0x2f'),util['inspect'](_0xd33337,{'showHidden':![],'depth':null}));};}var _0x51318a=function(_0x5b9c52,_0x1b43d2){var _0x71ecde=squel['insert']()[_0x100d('0x30')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x100d('0x31'),_0x100d('0x32'),_0x1b43d2,_0x100d('0x33'),_0x100d('0x34')],squel[_0x100d('0x35')]()[_0x100d('0x36')](_0x100d('0x20'),_0x100d('0x20'))[_0x100d('0x36')](_0x100d('0x37'),'scheduledAt')['field']('id',_0x100d('0x31'))[_0x100d('0x36')](LISTID[_0x100d('0x38')](),_0x100d('0x32'))[_0x100d('0x36')](_0x5b9c52['id'][_0x100d('0x38')](),_0x1b43d2)['field'](_0x100d('0x37'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x100d('0x39'))[_0x100d('0x3a')](_0x100d('0x3b'))['where'](_0x100d('0x3c'),LISTID['toString']())['where'](_0x100d('0x3d'))[_0x100d('0x3a')](_0x100d('0x3e'),squel[_0x100d('0x35')]()[_0x100d('0x36')](_0x100d('0x20'))[_0x100d('0x3f')]('cm_hopper')[_0x100d('0x3a')](_0x1b43d2+_0x100d('0x40'),_0x5b9c52['id']['toString']())))[_0x100d('0x38')]();return _0x71ecde;};var _0x4a0bfa=function(_0x52c6c3,_0x36bacf){var _0x317d75=squel['insert']()[_0x100d('0x30')](_0x100d('0x41'))[_0x100d('0x42')]([_0x100d('0x20'),_0x100d('0x43'),'ContactId','ListId',_0x36bacf,_0x100d('0x33'),_0x100d('0x34')],squel[_0x100d('0x35')]()['field'](_0x100d('0x20'),_0x100d('0x20'))[_0x100d('0x36')](_0x100d('0x37'),_0x100d('0x43'))[_0x100d('0x36')]('id','ContactId')[_0x100d('0x36')](LISTID['toString'](),_0x100d('0x32'))['field'](_0x52c6c3['id'][_0x100d('0x38')](),_0x36bacf)[_0x100d('0x36')]('NOW()','createdAt')['field'](_0x100d('0x37'),_0x100d('0x34'))[_0x100d('0x3f')](_0x100d('0x39'))[_0x100d('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x100d('0x3c'),LISTID['toString']())[_0x100d('0x3a')](_0x100d('0x44'),squel[_0x100d('0x45')](hopperContacts))[_0x100d('0x3a')](_0x100d('0x3d'))[_0x100d('0x3a')](_0x100d('0x3e'),squel[_0x100d('0x35')]()['field'](_0x100d('0x46'))[_0x100d('0x3f')](_0x100d('0x47'))[_0x100d('0x3a')](_0x36bacf+_0x100d('0x40'),_0x52c6c3['id']['toString']()))[_0x100d('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x100d('0x35')]()[_0x100d('0x36')](_0x100d('0x20'))[_0x100d('0x3f')](_0x100d('0x41'))['where'](_0x36bacf+_0x100d('0x40'),_0x52c6c3['id'][_0x100d('0x38')]())))['toString']();return _0x317d75;};function _0x153797(_0x4d641b,_0x49af47){var _0x26be06=squel[_0x100d('0x48')]()['into']('cm_hopper')['fromQuery']([_0x100d('0x20'),_0x100d('0x43'),_0x100d('0x31'),_0x100d('0x32'),_0x49af47,_0x100d('0x33'),_0x100d('0x34')],squel[_0x100d('0x35')]()[_0x100d('0x36')](_0x100d('0x20'),_0x100d('0x20'))[_0x100d('0x36')](_0x100d('0x37'),_0x100d('0x43'))['field']('id',_0x100d('0x31'))[_0x100d('0x36')](LISTID[_0x100d('0x38')](),_0x100d('0x32'))[_0x100d('0x36')](_0x4d641b['id'][_0x100d('0x38')](),_0x49af47)[_0x100d('0x36')](_0x100d('0x37'),_0x100d('0x33'))[_0x100d('0x36')]('NOW()','updatedAt')['from'](_0x100d('0x39'))['where'](_0x100d('0x3b'))['where'](_0x100d('0x3c'),LISTID['toString']())[_0x100d('0x3a')](_0x100d('0x44'),squel[_0x100d('0x45')](hopperContacts))[_0x100d('0x3a')](_0x100d('0x3d')))[_0x100d('0x38')]();return _0x26be06;}function _0x496952(_0x535afb,_0x233218){var _0x500efc=squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0x100d('0x20'),_0x100d('0x31'),'ListId',_0x233218,_0x100d('0x33'),'updatedAt'],squel[_0x100d('0x35')]()['field'](_0x100d('0x20'),_0x100d('0x20'))['field']('id','ContactId')[_0x100d('0x36')](LISTID[_0x100d('0x38')](),_0x100d('0x32'))['field'](_0x535afb['id']['toString'](),_0x233218)[_0x100d('0x36')](_0x100d('0x37'),_0x100d('0x33'))['field']('NOW()',_0x100d('0x34'))[_0x100d('0x3f')](_0x100d('0x39'))[_0x100d('0x3a')](_0x100d('0x3b'))['where']('ListId\x20=\x20?',LISTID[_0x100d('0x38')]())[_0x100d('0x3a')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x100d('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x100d('0x38')]();return _0x500efc;}return db['VoiceQueue']['findAll']({'where':{'type':_0x100d('0x49')},'attributes':['id',_0x100d('0x4a')],'include':[{'model':db['CmList'],'as':_0x100d('0x4b'),'where':{'id':LISTID}}]})[_0x100d('0x4c')](function(_0x25aead){var _0x35e65f=[];if(_0x25aead){var _0x1db0c4;for(var _0x1c198f=0x0,_0x5737fa;_0x1c198f<_0x25aead['length'];_0x1c198f+=0x1){_0x5737fa=_0x25aead[_0x1c198f][_0x100d('0x4d')]({'plain':!![]});switch(_0x5737fa[_0x100d('0x4a')]){case _0x100d('0x4e'):_0x35e65f[_0x100d('0x2a')](db[_0x100d('0x4f')][_0x100d('0x50')](_0x4a0bfa(_0x5737fa,_0x100d('0x51')))[_0x100d('0x4c')](function(){})['catch'](_0x2c50fc()));break;case _0x100d('0x52'):_0x35e65f[_0x100d('0x2a')](db[_0x100d('0x4f')][_0x100d('0x50')](_0x51318a(_0x5737fa,_0x100d('0x51')))[_0x100d('0x4c')](function(){})[_0x100d('0x2b')](_0x2c50fc()));break;default:_0x35e65f[_0x100d('0x2a')](db[_0x100d('0x4f')]['query'](_0x153797(_0x5737fa,_0x100d('0x51')))[_0x100d('0x4c')](function(){})['catch'](_0x2c50fc()));}}}return _0x35e65f;})[_0x100d('0x53')]()[_0x100d('0x4c')](function(){return db[_0x100d('0x54')][_0x100d('0x55')]({'where':{'type':_0x100d('0x49')},'attributes':['id'],'include':[{'model':db[_0x100d('0x56')],'as':_0x100d('0x57'),'where':{'id':LISTID}}]})[_0x100d('0x4c')](function(_0x3caddd){var _0x28f406=[];if(_0x3caddd){var _0x2a8975;for(var _0x51c9e5=0x0,_0x5c814a;_0x51c9e5<_0x3caddd[_0x100d('0x1a')];_0x51c9e5+=0x1){_0x5c814a=_0x3caddd[_0x51c9e5][_0x100d('0x4d')]({'plain':!![]});_0x28f406['push'](db['sequelize']['query'](_0x496952(_0x5c814a,'VoiceQueueId'))[_0x100d('0x4c')](function(){})[_0x100d('0x2b')](_0x2c50fc()));}}return _0x28f406;})['all']();})[_0x100d('0x4c')](function(){return db[_0x100d('0x58')][_0x100d('0x55')]({'attributes':['id',_0x100d('0x4a')],'include':[{'model':db[_0x100d('0x56')],'as':_0x100d('0x4b'),'where':{'id':LISTID}}]})[_0x100d('0x4c')](function(_0x1bc1a9){var _0x408ff7=[];if(_0x1bc1a9){for(var _0x35b54d=0x0,_0x4f3273;_0x35b54d<_0x1bc1a9[_0x100d('0x1a')];_0x35b54d+=0x1){_0x4f3273=_0x1bc1a9[_0x35b54d][_0x100d('0x4d')]({'plain':!![]});switch(_0x4f3273[_0x100d('0x4a')]){case _0x100d('0x4e'):_0x408ff7[_0x100d('0x2a')](db[_0x100d('0x4f')][_0x100d('0x50')](_0x4a0bfa(_0x4f3273,_0x100d('0x59')))[_0x100d('0x4c')](function(){})[_0x100d('0x2b')](_0x2c50fc()));break;case _0x100d('0x52'):_0x408ff7[_0x100d('0x2a')](db[_0x100d('0x4f')][_0x100d('0x50')](_0x51318a(_0x4f3273,_0x100d('0x59')))[_0x100d('0x4c')](function(){})[_0x100d('0x2b')](_0x2c50fc()));break;default:_0x408ff7[_0x100d('0x2a')](db[_0x100d('0x4f')]['query'](_0x153797(_0x4f3273,'CampaignId'))[_0x100d('0x4c')](function(){})[_0x100d('0x2b')](_0x2c50fc()));}}}return _0x408ff7;})[_0x100d('0x53')]();})[_0x100d('0x4c')](function(){return db[_0x100d('0x58')][_0x100d('0x55')]({'attributes':['id'],'include':[{'model':db[_0x100d('0x56')],'as':_0x100d('0x57'),'where':{'id':LISTID}}]})[_0x100d('0x4c')](function(_0x1841e0){var _0x162e3f=[];if(_0x1841e0){for(var _0x244e23=0x0,_0x35339f;_0x244e23<_0x1841e0['length'];_0x244e23+=0x1){_0x35339f=_0x1841e0[_0x244e23]['get']({'plain':!![]});_0x162e3f['push'](db[_0x100d('0x4f')][_0x100d('0x50')](_0x496952(_0x35339f,_0x100d('0x59')))[_0x100d('0x4c')](function(){})[_0x100d('0x2b')](_0x2c50fc()));}}return _0x162e3f;})[_0x100d('0x53')]();})[_0x100d('0x2b')](function(_0x3691e2){logger[_0x100d('0x14')](_0x100d('0x5a'),_0x100d('0x5b'),_0x3691e2[_0x100d('0x1c')]);});}var processPromises=function(_0x273305){return BPromise[_0x100d('0x53')](promises)[_0x100d('0x4c')](function(_0x4110a0){})['catch'](function(_0x536aa7){logger[_0x100d('0x14')](_0x100d('0x5c'),JSON[_0x100d('0x2d')](_0x536aa7));})['finally'](function(){socket[_0x100d('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x273305){return _0x273305[_0x100d('0x5e')]();}});};var endCsv=function(){return BPromise[_0x100d('0x5f')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x100d('0x4c')](function(){socket[_0x100d('0x5d')](_0x100d('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x100d('0x61')](FILEPATH);}catch(_0x1ca8ec){logger[_0x100d('0x14')](_0x100d('0x62'),JSON['stringify'](_0x1ca8ec));}finally{process['exit'](0x0);}});};process['on'](_0x100d('0x63'),function(){logger[_0x100d('0x64')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x100d('0x5f')]()[_0x100d('0x4c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x100d('0x11')](',');return db[_0x100d('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x100d('0x4c')](function(_0x897342){var _0x443ae9=fs[_0x100d('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x443ae9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x460ca2,_0x16c32d){total+=0x1;var _0x44e00a=total;promises[_0x100d('0x2a')](checkRow(_0x460ca2,_0x897342,_0x44e00a)[_0x100d('0x4c')](function(){success+=0x1;})[_0x100d('0x2b')](function(_0x38ef80){if(_0x38ef80[_0x100d('0x14')]){errors+=0x1;delete _0x38ef80[_0x100d('0x14')];}else if(_0x38ef80[_0x100d('0x27')]){duplicates+=0x1;delete _0x38ef80[_0x100d('0x27')];}rows[_0x100d('0x2a')](_0x38ef80);}));if(total%0xc8===0x0){_0x16c32d[_0x100d('0x66')]();return processPromises(_0x16c32d);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x100d('0x67'));endCsv();});},'error':function(_0xf0a072,_0x595e0b){logger[_0x100d('0x64')](_0x100d('0x68'),JSON[_0x100d('0x2d')](_0xf0a072));endCsv();}});})[_0x100d('0x2b')](function(_0x2d3bfb){logger[_0x100d('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x2d3bfb));});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdbd=['spread','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','all','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','sequelize','timezones','dialTimezone','set','offset','main','stringify','send','start','binding','clone','server/files/tmp','.csv','keys','includes','findAll','name','_description','parse','createReadStream','data','errors','find','hasOwnProperty','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','utcOffset','firstName','\x20not\x20specified','trim','replace','itemTypeId','description','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','phone','from','.id\x20=\x20','where','\x20=\x20','CmContact','AdditionalPhones','length','push','then','split','isNil','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.id','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','join','cm_contacts','field','cm_hopper_black','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','\x22always\x22','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','query'];(function(_0x4a2a99,_0x404a3d){var _0x232f86=function(_0x546890){while(--_0x546890){_0x4a2a99['push'](_0x4a2a99['shift']());}};_0x232f86(++_0x404a3d);}(_0xbdbd,0x1cf));var _0xdbdb=function(_0x2ccfd5,_0x518930){_0x2ccfd5=_0x2ccfd5-0x0;var _0x5e7dae=_0xbdbd[_0x2ccfd5];return _0x5e7dae;};'use strict';var fs=require('fs');var path=require(_0xdbdb('0x0'));var _=require(_0xdbdb('0x1'));var Papa=require(_0xdbdb('0x2'));var util=require(_0xdbdb('0x3'));var BPromise=require(_0xdbdb('0x4'));var moment=require(_0xdbdb('0x5'));var squel=require('squel');var Redis=require(_0xdbdb('0x6'));var db=require(_0xdbdb('0x7'))['db'];var config=require(_0xdbdb('0x8'));var shared=require(_0xdbdb('0x9'));var logger=require('../../../config/logger')(_0xdbdb('0xa'));config[_0xdbdb('0xb')]=_['defaults'](config['redis'],{'host':_0xdbdb('0xc'),'port':0x18eb});var socket=require(_0xdbdb('0xd'))(new Redis(config[_0xdbdb('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xdbdb('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xdbdb('0xf')](_0xdbdb('0xe'));function isEmail(_0x454e34){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xdbdb('0x10')](_0x454e34);}function selectNotIn(_0x846d78,_0x441af6,_0x4641b6,_0x545060,_0x33219f){return squel[_0xdbdb('0x11')]()['field'](_0xdbdb('0x12'))[_0xdbdb('0x13')](_0x545060)['join'](_0x441af6,null,_0x441af6+_0xdbdb('0x14')+_0x545060+'.'+_0x4641b6)[_0xdbdb('0x15')](_0x545060+'.'+_0x4641b6+_0xdbdb('0x16')+_0x846d78+'.'+_0x4641b6)['where'](_0x441af6+'.dialCheckDuplicateType\x20IN\x20('+_0x33219f['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x38d149,_0x3f4b1e){promisesAdditionalPhones=[];return db[_0xdbdb('0x17')]['findAll']({'raw':!![],'attributes':['id',_0xdbdb('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x247ed5){if(_0x247ed5!==null){var _0x22e6f3=[];for(var _0x4cc13b=0x0;_0x4cc13b<_0x247ed5[_0xdbdb('0x19')];_0x4cc13b++){var _0x30bf1e=_0x247ed5[_0x4cc13b];_0x22e6f3[_0xdbdb('0x1a')](insertAdditionalPhones(_0x30bf1e));}}Promise['all'](_0x22e6f3)[_0xdbdb('0x1b')](function(){_0x38d149({'val':0x1});});});});}function insertAdditionalPhones(_0x5b8a9e){return new Promise(function(_0x52e646,_0x12f6db){var _0x112bd7=_0x5b8a9e[_0xdbdb('0x18')];var _0x215a19=_0x112bd7[_0xdbdb('0x1c')](';');var _0x1cfad8=[];orderBy=0x0;for(var _0xa277fe=0x0;_0xa277fe<_0x215a19['length'];_0xa277fe++){_0x1cfad8['push'](splitAdditionalPhone(_0x5b8a9e['id'],_0x215a19[_0xa277fe]));}Promise['all'](_0x1cfad8)[_0xdbdb('0x1b')](function(){_0x52e646({'val':_0x215a19[_0xdbdb('0x19')]});});});}function splitAdditionalPhone(_0x55e1e0,_0x41a3e9){return new Promise(function(_0x52f102,_0x265318){var _0x1b7c1b=_0x41a3e9['split'](':');var _0x5c93da=_0x1b7c1b[0x0];var _0x136719=_0x1b7c1b[0x1];if(!_[_0xdbdb('0x1d')](_0x136719)){var _0x4dcbb5=_0x136719['split']('|');var _0x25a83f=[];for(var _0x1fac83=0x0;_0x1fac83<_0x4dcbb5[_0xdbdb('0x19')];_0x1fac83++){if(_0x4dcbb5[_0x1fac83]!==''){var _0x1990af=_[_0xdbdb('0x1e')](promisesAdditionalPhones,{'contactId':_0x55e1e0,'phone':_0x4dcbb5[_0x1fac83]});if(_0x1990af[_0xdbdb('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xdbdb('0x1a')]({'contactId':_0x55e1e0,'contactTypeId':_0x5c93da,'phone':_0x4dcbb5[_0x1fac83],'orderBy':orderBy});}}}_0x52f102({'ok':0x1});}else _0x52f102({'res':0x0});});}function createAdditionalPhone(_0x1aae35,_0x5c50db,_0xa71d8a,_0x4090ac){var _0x5b9203='';var _0x5d320c='';var _0x51f8ca=_0xa71d8a[_0xdbdb('0x1c')]('§');_0x5b9203=_0x51f8ca[0x0];if(_0x51f8ca['length']==0x2)_0x5d320c=_0x51f8ca[0x1];return new Promise(function(_0xde87e8,_0x211cd4){return db['CmContactHasItem'][_0xdbdb('0x1f')]({'where':{'CmContactId':_0x1aae35,'item':_0x5b9203}})[_0xdbdb('0x1b')](function(_0x5e3465){if(_0x5e3465){return db[_0xdbdb('0x20')][_0xdbdb('0x21')]({'ItemTypeId':_0x5c50db,'description':_0x5d320c,'OrderBy':_0x4090ac},{'where':{'CmContactId':_0x1aae35,'item':_0x5b9203}})[_0xdbdb('0x1b')](function(_0xd3dd74){_0xde87e8({'res':_0xdbdb('0x22')});});}else{return db['CmContactHasItem'][_0xdbdb('0x23')]({'CmContactId':_0x1aae35,'item':_0x5b9203,'description':_0x5d320c,'ItemTypeId':_0x5c50db,'OrderBy':_0x4090ac,'ItemClass':_0xdbdb('0x24')})[_0xdbdb('0x1b')](function(_0x177b9f){_0xde87e8({'res':_0xdbdb('0x25')});});}});});}function insertCmHopper(_0x43b8f8,_0x4f273e,_0x445f87,_0x37294f,_0x30c45c){var _0x41bce3=['cm_contacts.phone','cm_contacts.scheduledat',_0xdbdb('0x26'),'cm_contacts.ListId',_0x4f273e+'.'+_0x37294f,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xdbdb('0x27'),_0xdbdb('0x28'),'\x22'+_0x30c45c+'\x22'];return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x2b'))[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2d'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x37294f,_0xdbdb('0x30'),_0xdbdb('0x31'),_0xdbdb('0x32'),_0xdbdb('0x33'),_0xdbdb('0x34')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x41bce3)[_0xdbdb('0x13')](_0x4f273e)['join']('cm_contacts',null,_0xdbdb('0x36')+_0x4f273e+_0xdbdb('0x37'))['join'](_0x445f87,null,_0x445f87+_0xdbdb('0x14')+_0x4f273e+'.'+_0x37294f)[_0xdbdb('0x15')](_0x4f273e+_0xdbdb('0x38'),_0x43b8f8)[_0xdbdb('0x15')](_0xdbdb('0x39'),NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),selectNotIn(_0x4f273e,_0x445f87,_0x37294f,_0xdbdb('0x2b'),['\x22always\x22',_0xdbdb('0x3b')]))[_0xdbdb('0x15')](_0xdbdb('0x3a'),selectNotIn(_0x4f273e,_0x445f87,_0x37294f,_0xdbdb('0x2b'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x318c48,_0x485f65,_0x15294b,_0x41c057){var _0x4f0a75=[_0xdbdb('0x3c'),'cm_contacts.id',_0xdbdb('0x3d'),_0x485f65+'.'+_0x41c057,_0xdbdb('0x3e'),_0xdbdb('0x3f')];return squel['insert']()[_0xdbdb('0x2a')]('cm_hopper_black')[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x41c057,_0xdbdb('0x30'),_0xdbdb('0x31')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x4f0a75)[_0xdbdb('0x13')](_0x485f65)[_0xdbdb('0x40')](_0xdbdb('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x485f65+_0xdbdb('0x37'))['join'](_0x15294b,null,_0x15294b+_0xdbdb('0x14')+_0x485f65+'.'+_0x41c057)['where'](_0x485f65+_0xdbdb('0x38'),_0x318c48)['where'](_0xdbdb('0x39'),NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),squel[_0xdbdb('0x11')]()[_0xdbdb('0x42')]('phone')[_0xdbdb('0x13')](_0xdbdb('0x43'))['where']('ListId\x20=\x20?',_0x318c48)[_0xdbdb('0x15')](_0x41c057+'\x20=\x20'+_0x485f65+'.'+_0x41c057)))[_0xdbdb('0x44')]();}function insertTzCmHopper(_0x5f082b,_0x2cc3de,_0x3b0152,_0x464d99,_0x5c81b4,_0x37a70b){var _0x5bd491=[_0xdbdb('0x3c'),_0xdbdb('0x45')+_0x37a70b+_0xdbdb('0x46'),_0xdbdb('0x26'),_0xdbdb('0x3d'),_0x2cc3de+'.'+_0x464d99,_0xdbdb('0x3e'),_0xdbdb('0x3f'),_0xdbdb('0x27'),_0xdbdb('0x28'),'\x22'+_0x5c81b4+'\x22'];var _0x10b7e3=squel['insert']()['into']('cm_hopper')[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2d'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x464d99,_0xdbdb('0x30'),_0xdbdb('0x31'),_0xdbdb('0x32'),_0xdbdb('0x33'),_0xdbdb('0x34')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x5bd491)[_0xdbdb('0x13')](_0x2cc3de)[_0xdbdb('0x40')](_0xdbdb('0x41'),null,_0xdbdb('0x36')+_0x2cc3de+_0xdbdb('0x37'))['join'](_0x3b0152,null,_0x3b0152+_0xdbdb('0x14')+_0x2cc3de+'.'+_0x464d99)['join'](_0x37a70b,null,_0x37a70b+_0xdbdb('0x14')+_0x2cc3de+'.'+_0x464d99)[_0xdbdb('0x15')](_0x2cc3de+_0xdbdb('0x38'),_0x5f082b)[_0xdbdb('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),selectNotIn(_0x2cc3de,_0x3b0152,_0x464d99,_0xdbdb('0x2b'),[_0xdbdb('0x47'),'\x22onlyIfOpen\x22']))['where'](_0xdbdb('0x3a'),selectNotIn(_0x2cc3de,_0x3b0152,_0x464d99,_0xdbdb('0x2b'),[_0xdbdb('0x47')])))['toString']();return _0x10b7e3;}function insertTzCmHopperBlack(_0x1d9792,_0x59bdc9,_0x5d4f45,_0x4cd149){var _0x492a63=[_0xdbdb('0x3c'),'cm_contacts.id',_0xdbdb('0x3d'),_0x59bdc9+'.'+_0x4cd149,_0xdbdb('0x3e'),_0xdbdb('0x3f')];return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x43'))[_0xdbdb('0x2c')]([_0xdbdb('0x12'),_0xdbdb('0x2e'),_0xdbdb('0x2f'),_0x4cd149,'createdAt',_0xdbdb('0x31')],squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x492a63)['from'](_0x59bdc9)[_0xdbdb('0x40')](_0xdbdb('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x59bdc9+'.CmListId')['join'](_0x5d4f45,null,_0x5d4f45+_0xdbdb('0x14')+_0x59bdc9+'.'+_0x4cd149)[_0xdbdb('0x15')](_0x59bdc9+'.CmListId\x20=\x20?',_0x1d9792)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdbdb('0x15')](_0xdbdb('0x3a'),squel[_0xdbdb('0x11')]()[_0xdbdb('0x42')](_0xdbdb('0x12'))[_0xdbdb('0x13')]('cm_hopper_black')[_0xdbdb('0x15')]('ListId\x20=\x20?',_0x1d9792)['where'](_0x4cd149+_0xdbdb('0x16')+_0x59bdc9+'.'+_0x4cd149)))['toString']();}function insertCmHopperAdditionalPhones(_0x15a571){var _0x110093=[_0xdbdb('0x48'),'cm_contact_has_items.item',_0xdbdb('0x49'),_0xdbdb('0x4a'),'cm_contact_has_items.updatedAt'];return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x4b'))[_0xdbdb('0x2c')]([_0xdbdb('0x4c'),_0xdbdb('0x12'),'OrderBy',_0xdbdb('0x30'),'updatedAt'],squel[_0xdbdb('0x11')]()['fields'](_0x110093)[_0xdbdb('0x13')](_0xdbdb('0x2b'))[_0xdbdb('0x40')](_0xdbdb('0x41'),null,_0xdbdb('0x4d'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xdbdb('0x15')](_0xdbdb('0x4e'),_0x15a571)[_0xdbdb('0x15')](_0xdbdb('0x39'),NOW))[_0xdbdb('0x44')]();}function insertCmContact(_0x401fc5,_0x9094bc,_0x580cbd,_0x4a7b57){var _0x4cd573=_['concat'](_['keys'](_0x4a7b57),[_0xdbdb('0x2f'),_0xdbdb('0x4f'),_0xdbdb('0x30'),_0xdbdb('0x31'),_0xdbdb('0x50')]);return squel[_0xdbdb('0x29')]()[_0xdbdb('0x2a')](_0xdbdb('0x41'))['fromQuery'](_0x4cd573,squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](_0x4cd573)['from'](_0x9094bc)[_0xdbdb('0x15')]('('+_0x580cbd[_0xdbdb('0x40')](',')+_0xdbdb('0x51'),squel['select']()[_0xdbdb('0x35')](_0x580cbd)[_0xdbdb('0x13')](_0xdbdb('0x41'))['where'](_0xdbdb('0x52'),_0x401fc5)[_0xdbdb('0x15')](_0xdbdb('0x53')))[_0xdbdb('0x15')](_0xdbdb('0x54'),squel['select']()[_0xdbdb('0x42')](_0xdbdb('0x55'),_0xdbdb('0x56'))[_0xdbdb('0x13')](_0x9094bc)[_0xdbdb('0x57')](_0x580cbd[_0xdbdb('0x40')](','))))['toString']();}function handleStop(){logger[_0xdbdb('0x58')](_0xdbdb('0x59'));stopped=!![];}function handleUncaughtException(_0x52f1a1){logger[_0xdbdb('0x5a')](_0x52f1a1[_0xdbdb('0x5b')]);process[_0xdbdb('0x5c')](0x1);}function handleError(_0x5b2de6,_0x24bb9b){stats['errors']['push']({'name':_0x24bb9b[_0xdbdb('0x5d')],'message':_0x24bb9b['message'],'row':_0x5b2de6});}function handleQuery(_0xfb5642){logger[_0xdbdb('0x58')](_0xfb5642);return db['sequelize'][_0xdbdb('0x5e')](_0xfb5642)[_0xdbdb('0x5f')](function(_0x3410f0){results[_0xdbdb('0x1a')](_0x3410f0);})[_0xdbdb('0x60')](function(_0x1eb920){logger[_0xdbdb('0x5a')](_0x1eb920['message']);});}function updateTzCampaigns(_0x2901db){return new Promise(function(_0x95ebe3,_0x391883){var _0x211054=squel[_0xdbdb('0x11')]()[_0xdbdb('0x35')](['campaigns.id',_0xdbdb('0x61')])[_0xdbdb('0x13')](_0xdbdb('0x62'))['join'](_0xdbdb('0x63'),null,_0xdbdb('0x64'))[_0xdbdb('0x15')]('campaigns_has_cm_lists.CmListId='+_0x2901db);db['sequelize'][_0xdbdb('0x5e')](_0x211054[_0xdbdb('0x44')]())[_0xdbdb('0x5f')](function(_0x27972b){var _0x13fce8=[];for(var _0x4869d7=0x0;_0x4869d7<_0x27972b[_0xdbdb('0x19')];_0x4869d7++){_0x13fce8[_0xdbdb('0x1a')](getTimezoneData(_0x27972b[_0x4869d7],tmp_campaigns));}BPromise[_0xdbdb('0x65')](_0x13fce8)[_0xdbdb('0x1b')](function(){_0x95ebe3({'val':0x1});});})[_0xdbdb('0x60')](function(_0x337fc2){logger[_0xdbdb('0x5a')](_0x337fc2[_0xdbdb('0x5b')]);_0x95ebe3({'val':0x0});});});}function updateTzVoiceQueues(_0x5887d9){return new Promise(function(_0x2dd964,_0xdbcb92){var _0xeaa370=squel['select']()[_0xdbdb('0x35')]([_0xdbdb('0x66'),_0xdbdb('0x67')])['from']('voice_queues')[_0xdbdb('0x40')](_0xdbdb('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xdbdb('0x15')](_0xdbdb('0x69')+_0x5887d9);db[_0xdbdb('0x6a')]['query'](_0xeaa370[_0xdbdb('0x44')]())['spread'](function(_0xb779d6){var _0x2aee36=[];for(var _0x5e4196=0x0;_0x5e4196<_0xb779d6['length'];_0x5e4196++){_0x2aee36[_0xdbdb('0x1a')](getTimezoneData(_0xb779d6[_0x5e4196],tmp_voice_queues));}BPromise[_0xdbdb('0x65')](_0x2aee36)[_0xdbdb('0x1b')](function(){_0x2dd964({'val':0x1});});})[_0xdbdb('0x60')](function(_0x40368c){logger['error'](_0x40368c[_0xdbdb('0x5b')]);_0x2dd964({'val':0x0});});});}function getTimezoneData(_0x290bfa,_0x3543c4){return new Promise(function(_0x558e79,_0x331644){var _0x584190=shared[_0xdbdb('0x6b')];var _0x296136=_0x584190[_0x290bfa[_0xdbdb('0x6c')]];if(_[_0xdbdb('0x1d')](_0x296136)){_0x558e79({'ret':0x1});}else{var _0x3114f9=_0x296136['utcOffset'];var _0x5a61ab=squel[_0xdbdb('0x29')]()['into'](_0x3543c4)[_0xdbdb('0x6d')]('id',_0x290bfa['id'])['set'](_0xdbdb('0x6e'),_0x3114f9)[_0xdbdb('0x6d')](_0xdbdb('0x6c'),_0x290bfa['dialTimezone'])[_0xdbdb('0x44')]();return db[_0xdbdb('0x6a')][_0xdbdb('0x5e')](_0x5a61ab)[_0xdbdb('0x5f')](function(_0x57faf9){_0x558e79({'ret':0x1});})[_0xdbdb('0x60')](function(_0x75394a){logger['error'](_0x75394a[_0xdbdb('0x5b')]);_0x331644({'ret':0x1});});}});}function handleTZQuery(_0x26495c){logger[_0xdbdb('0x58')](_0x26495c);return db[_0xdbdb('0x6a')]['query'](_0x26495c)[_0xdbdb('0x5f')](function(_0x5b9389){})[_0xdbdb('0x60')](function(_0x88478d){logger[_0xdbdb('0x5a')](_0x88478d[_0xdbdb('0x5b')]);});}function main(_0x39b998,_0x4a54f5,_0x466b38,_0x344a74){logger[_0xdbdb('0x58')](_0xdbdb('0x6f'),_0x39b998,JSON[_0xdbdb('0x70')](_0x4a54f5));process[_0xdbdb('0x71')](_0xdbdb('0x72'));var _0x3aa6e5=_0x4a54f5[_0xdbdb('0x73')];var _0x1b0c92=_[_0xdbdb('0x74')](_0x3aa6e5);var _0x22684f=_0x4a54f5['socket_timestamp'];var _0x43807e=path[_0xdbdb('0x40')](config['root'],_0xdbdb('0x75'),_0x22684f+_0xdbdb('0x76'));hasTZ=_[_0xdbdb('0x77')](_0x3aa6e5)[_0xdbdb('0x78')]('dialTimezone');var _0x15f7b6=_['keys'](_0x3aa6e5)[_0xdbdb('0x40')]();logger[_0xdbdb('0x58')]('header',_0x15f7b6);db['ContactItemType'][_0xdbdb('0x79')]({'raw':!![],'attributes':['id',_0xdbdb('0x7a')]})[_0xdbdb('0x1b')](function(_0x1de159){for(var _0x246dd3=0x0;_0x246dd3<_0x1de159['length'];_0x246dd3++){if(_0x1de159[_0x246dd3][_0xdbdb('0x7a')]in _0x3aa6e5){contactItemTypes[_0xdbdb('0x1a')](_0x1de159[_0x246dd3]);delete _0x1b0c92[_0x1de159[_0x246dd3][_0xdbdb('0x7a')]];hasAdditionalPhones=!![];}for(var _0x55638b in _0x3aa6e5){if(_0x1de159[_0x246dd3][_0xdbdb('0x7a')]+_0xdbdb('0x7b')===_0x55638b){phoneDescriptions[_0xdbdb('0x1a')]({'itemTypeId':_0x1de159[_0x246dd3]['id'],'description':_0x55638b});delete _0x1b0c92[_0x55638b];}}}if(hasAdditionalPhones)_0x1b0c92['AdditionalPhones']='';var _0xf0dfcc=_['keys'](_0x1b0c92)['join']();logger[_0xdbdb('0x58')]('header',_0xf0dfcc);fs['writeFileSync'](_0x43807e,_0xf0dfcc+'\x0a');Papa[_0xdbdb('0x7c')](fs[_0xdbdb('0x7d')](_0x39b998),{'header':!![],'skipEmptyLines':!![],'step':function(_0x32dcdf,_0x305608){try{for(var _0x38987b=0x0,_0x5668ea=[];_0x38987b<_0x32dcdf['data'][_0xdbdb('0x19')];_0x38987b++){stats['rows']+=0x1;if(_0x32dcdf['errors'][_0x38987b]){handleError(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b],_0x32dcdf[_0xdbdb('0x7f')][_0x38987b]);}else{var _0x624eb8=[];var _0x137a37=[];var _0x33e37d={};for(var _0x3fa08d in _0x3aa6e5){let _0x291413=contactItemTypes['find'](_0x5e1915=>_0x5e1915['name']===_0x3fa08d);let _0x51f8ef=contactItemTypes[_0xdbdb('0x80')](_0x27d574=>_0x27d574[_0xdbdb('0x7a')]+'_description'===_0x3fa08d);if(_['isNil'](_0x291413)&&_[_0xdbdb('0x1d')](_0x51f8ef)){if(_0x3aa6e5[_0xdbdb('0x81')](_0x3fa08d)){if(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x3fa08d]]){var _0x52a5b5=_['trim'](_0x32dcdf['data'][_0x38987b][_0x3aa6e5[_0x3fa08d]]['replace'](/"/g,'\x27'));switch(_0x3fa08d){case'scheduledat':var _0x18c77b=moment(_0x52a5b5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x18c77b[_0xdbdb('0x82')]()){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x52a5b5+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')](_0xdbdb('0x83'));}break;case _0xdbdb('0x32'):var _0x1ef1a5=parseInt(_0x52a5b5);_0x52a5b5=_[_0xdbdb('0x84')](_0x1ef1a5)||_0x1ef1a5<0x0||_0x1ef1a5>0x4?_0x344a74?0x3:0x2:_0x1ef1a5;_0x5668ea['push']('\x22'+_0x52a5b5+'\x22');break;case _0xdbdb('0x33'):var _0x1e01af=parseInt(_0x52a5b5);if(_[_0xdbdb('0x85')](_0x1e01af)&&_[_0xdbdb('0x78')](_0x466b38,_0x1e01af)){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x1e01af+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')](_0xdbdb('0x86'));}break;case _0xdbdb('0x87'):if(isEmail(_0x52a5b5)){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x52a5b5+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')](_0xdbdb('0x88'));}break;case _0xdbdb('0x89'):var _0x7f47df=moment(_0x52a5b5,_0xdbdb('0x8a'),!![]);if(_0x7f47df[_0xdbdb('0x82')]()){_0x5668ea['push']('\x22'+_0x52a5b5+'\x22');}else{_0x624eb8[_0xdbdb('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xdbdb('0x6c'):var _0x5cff4f=shared[_0xdbdb('0x6b')];var _0x566256=_0x5cff4f[_0x52a5b5];if(!_[_0xdbdb('0x1d')](_0x566256)){var _0x1fb8a4=_0x566256[_0xdbdb('0x8b')];_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x52a5b5+'\x22');_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x1fb8a4+'\x22');}break;default:_0x5668ea['push']('\x22'+_0x52a5b5+'\x22');}}else{switch(_0x3fa08d){case _0xdbdb('0x8c'):case _0xdbdb('0x12'):_0x624eb8[_0xdbdb('0x1a')](_0x3fa08d+_0xdbdb('0x8d'));break;default:_0x5668ea[_0xdbdb('0x1a')]('\x22\x22');}}}}else{var _0x1be028='';if(!_['isNil'](_0x291413)){if(!_0x33e37d[_0xdbdb('0x81')](_0x291413['id'])){if(!_['isNil'](_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x3fa08d]])){var _0x52a5b5=_[_0xdbdb('0x8e')](_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x3fa08d]][_0xdbdb('0x8f')](/"/g,'\x27'));var _0x1b001a=phoneDescriptions['find'](_0x23885c=>_0x23885c[_0xdbdb('0x90')]===_0x291413['id']);if(!_[_0xdbdb('0x1d')](_0x1b001a)){var _0x52bf52=_[_0xdbdb('0x8e')](_0x32dcdf[_0xdbdb('0x7e')][_0x38987b][_0x3aa6e5[_0x1b001a[_0xdbdb('0x91')]]]['replace'](/"/g,'\x27'));if(!_[_0xdbdb('0x1d')](_0x52bf52))_0x52a5b5=_0x52a5b5+'§'+_0x52bf52;}if(_0x1be028=='')_0x1be028=_0x52a5b5;else _0x1be028+='|'+_0x52a5b5;}_0x137a37[_0xdbdb('0x1a')](_0x291413['id']+':'+_0x1be028);_0x33e37d[_0x291413['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5668ea[_0xdbdb('0x1a')]('\x22'+_0x137a37[_0xdbdb('0x40')](';')+'\x22');}if(_0x624eb8[_0xdbdb('0x19')]){handleError(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b],{'code':'SystemRow','message':_0x624eb8[_0xdbdb('0x40')]()});}else{fs['appendFileSync'](_0x43807e,_0x5668ea[_0xdbdb('0x40')]()+'\x0a');}_0x5668ea=[];}if(!(stats[_0xdbdb('0x92')]%0xc8)){socket[_0xdbdb('0x93')](_0xdbdb('0x94')+_0x22684f,stats);stats[_0xdbdb('0x7f')]=[];}}if(stopped){logger[_0xdbdb('0x58')](_0xdbdb('0x95'));_0x305608[_0xdbdb('0x96')]();}}catch(_0x3a5377){handleError(_0x32dcdf[_0xdbdb('0x7e')][_0x38987b],{'code':_0xdbdb('0x97'),'message':_0x3a5377[_0xdbdb('0x5b')]});logger['error'](_0xdbdb('0x98'),_0x3a5377[_0xdbdb('0x5b')]);}},'complete':function(){try{var _0x4a8c62=[];var _0x2dea07=[];var _0x289a9a='cm_contacts';if(_0x4a54f5[_0xdbdb('0x99')]&&_0x4a54f5[_0xdbdb('0x99')][_0xdbdb('0x19')]){_0x289a9a=_0xdbdb('0x9a')+_0x22684f;_0x4a8c62[_0xdbdb('0x1a')]('CREATE\x20TABLE\x20'+_0x289a9a+_0xdbdb('0x9b'));}tmp_campaigns=_0xdbdb('0x9c')+_0x22684f;tmp_voice_queues=_0xdbdb('0x9d')+_0x22684f;_0x2dea07[_0xdbdb('0x1a')](_0xdbdb('0x9e')+tmp_campaigns+_0xdbdb('0x9f'));_0x2dea07[_0xdbdb('0x1a')](_0xdbdb('0x9e')+tmp_voice_queues+_0xdbdb('0x9f'));BPromise['each'](_0x2dea07,handleTZQuery)[_0xdbdb('0x1b')](function(_0x5f38ab){updateTzCampaigns(_0x4a54f5[_0xdbdb('0x2f')])[_0xdbdb('0x1b')](function(_0x38dc5d){updateTzVoiceQueues(_0x4a54f5[_0xdbdb('0x2f')])[_0xdbdb('0x1b')](function(_0x456d58){if(hasTZ)_0xf0dfcc=_0xf0dfcc['replace'](_0xdbdb('0x6c'),_0xdbdb('0xa0'));var _0x577762=util[_0xdbdb('0xf')](_0xdbdb('0xa1'),_0x43807e,_0x289a9a,_0xf0dfcc,_0x4a54f5[_0xdbdb('0x2f')],_0x4a54f5[_0xdbdb('0x4f')]||null,NOW,NOW);if(_[_0xdbdb('0x1d')](_0x3aa6e5[_0xdbdb('0x2d')])){_0x577762+=',\x20scheduledAt\x20=\x20NOW()';}_0x4a8c62[_0xdbdb('0x1a')](_0x577762);if(_0x4a54f5[_0xdbdb('0x99')]&&_0x4a54f5[_0xdbdb('0x99')]['length']){_0x4a8c62[_0xdbdb('0x1a')](insertCmContact(_0x4a54f5[_0xdbdb('0x2f')],_0x289a9a,_0x4a54f5[_0xdbdb('0x99')],_0x3aa6e5));_0x4a8c62[_0xdbdb('0x1a')]('DROP\x20TABLE\x20'+_0x289a9a+';');}BPromise['each'](_0x4a8c62,handleQuery)[_0xdbdb('0x1b')](function(_0x897134){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x4a8c62=[];for(var _0x48fb8d=0x0;_0x48fb8d<promisesAdditionalPhones[_0xdbdb('0x19')];_0x48fb8d++){if(promisesAdditionalPhones[_0x48fb8d][_0xdbdb('0x12')]!='§'){_0x4a8c62[_0xdbdb('0x1a')](createAdditionalPhone(promisesAdditionalPhones[_0x48fb8d][_0xdbdb('0xa2')],promisesAdditionalPhones[_0x48fb8d][_0xdbdb('0xa3')],promisesAdditionalPhones[_0x48fb8d][_0xdbdb('0x12')],promisesAdditionalPhones[_0x48fb8d][_0xdbdb('0xa4')]));}}BPromise[_0xdbdb('0x65')](_0x4a8c62)['then'](function(){_0x4a8c62=[];if(hasTZ){_0x4a8c62[_0xdbdb('0x1a')](insertTzCmHopper(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0x68'),_0xdbdb('0xa5'),_0xdbdb('0xa6'),_0x344a74,tmp_voice_queues));_0x4a8c62['push'](insertTzCmHopperBlack(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0xa7'),_0xdbdb('0xa5'),_0xdbdb('0xa6')));_0x4a8c62[_0xdbdb('0x1a')](insertTzCmHopper(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0x63'),_0xdbdb('0x62'),_0xdbdb('0xa8'),_0x344a74,tmp_campaigns));_0x4a8c62[_0xdbdb('0x1a')](insertTzCmHopperBlack(_0x4a54f5[_0xdbdb('0x2f')],'campaigns_has_cm_blacklists',_0xdbdb('0x62'),_0xdbdb('0xa8')));_0x4a8c62['push'](insertCmHopperAdditionalPhones(_0x4a54f5[_0xdbdb('0x2f')]));}else{_0x4a8c62[_0xdbdb('0x1a')](insertCmHopper(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0x68'),_0xdbdb('0xa5'),_0xdbdb('0xa6'),_0x344a74));_0x4a8c62[_0xdbdb('0x1a')](insertCmHopperBlack(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0xa7'),_0xdbdb('0xa5'),_0xdbdb('0xa6')));_0x4a8c62[_0xdbdb('0x1a')](insertCmHopper(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0x63'),_0xdbdb('0x62'),_0xdbdb('0xa8'),_0x344a74));_0x4a8c62['push'](insertCmHopperBlack(_0x4a54f5[_0xdbdb('0x2f')],_0xdbdb('0xa9'),_0xdbdb('0x62'),_0xdbdb('0xa8')));_0x4a8c62[_0xdbdb('0x1a')](insertCmHopperAdditionalPhones(_0x4a54f5['ListId']));}_0x4a8c62['push']('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x4a8c62['push'](_0xdbdb('0xaa')+tmp_voice_queues+';');BPromise['each'](_0x4a8c62,handleQuery)['then'](function(_0x2034ee){stats[_0xdbdb('0xab')]=!![];stats[_0xdbdb('0xac')]=_0x4a54f5['duplicates']&&_0x4a54f5[_0xdbdb('0x99')]['length']?results[0x2][_0xdbdb('0xac')]:results[0x0][_0xdbdb('0xac')];socket[_0xdbdb('0x93')](_0xdbdb('0x94')+_0x22684f,stats);fs[_0xdbdb('0xad')](_0x39b998);fs[_0xdbdb('0xad')](_0x43807e);process[_0xdbdb('0x5c')](0x0);})[_0xdbdb('0x60')](function(_0x23ec79){logger[_0xdbdb('0x5a')](_0x23ec79[_0xdbdb('0x5b')]);process['exit'](0x1);});});});})[_0xdbdb('0x60')](function(_0x50d1da){logger[_0xdbdb('0x5a')](_0x50d1da[_0xdbdb('0x5b')]);process[_0xdbdb('0x5c')](0x1);});});});});}catch(_0xf47cb5){logger[_0xdbdb('0x5a')](_0xdbdb('0xae'),_0xf47cb5[_0xdbdb('0x5b')]);process['exit'](0x1);}},'error':function(_0x263ce0,_0x576871,_0x4afdb3,_0x40e77f){throw new Error(_0x40e77f);}});});}function validate(){if(process[_0xdbdb('0xaf')]&&process['argv']['length']<0x4){throw new Error(_0xdbdb('0xb0'));}var _0x122344=path[_0xdbdb('0x40')](config[_0xdbdb('0xb1')],'server/files/tmp',process[_0xdbdb('0xaf')][0x2]);if(!fs[_0xdbdb('0xb2')](_0x122344)){throw new Error(_0xdbdb('0xb3'));}var _0x252f4c={};try{_0x252f4c=JSON[_0xdbdb('0x7c')](process['argv'][0x3]);if(!_0x252f4c[_0xdbdb('0x73')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x252f4c[_0xdbdb('0x73')][_0xdbdb('0x12')]){throw new Error(_0xdbdb('0xb4'));}if(!_0x252f4c[_0xdbdb('0x73')][_0xdbdb('0x8c')]){throw new Error('firstName\x20is\x20mandatory');}var _0xb5ad64=0x0;if(_0x252f4c[_0xdbdb('0x73')][_0xdbdb('0x33')]){_0xb5ad64=0x1;}if(!_0x252f4c[_0xdbdb('0x2f')]){throw new Error(_0xdbdb('0xb5'));}}catch(_0x189d12){throw new Error(_0xdbdb('0xb6'));}var _0x44e607=[];try{_0x44e607=_[_0xdbdb('0xb7')](JSON[_0xdbdb('0x7c')](process[_0xdbdb('0xaf')][0x4]),'id');}catch(_0x49edde){logger['info'](_0xdbdb('0xb8'));}main(_0x122344,_0x252f4c,_0x44e607,_0xb5ad64);}validate();process['on']('SIGINT',handleStop);process['on'](_0xdbdb('0xb9'),handleUncaughtException);
\ No newline at end of file
+var _0x74a2=['campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','data','find','hasOwnProperty','isNaN','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','replace','SystemRow','appendFileSync','rows','Abort\x20parser','abort','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','duplicates','contactId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','parse','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','length','all','then','split','push','isNil','findOne','update','updated','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','UserId','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','cm_hopper_black','ListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','recallme','fields','toString','\x20=\x20','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','spread','catch','campaigns.id'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x74a2,0x1cb));var _0x274a=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x74a2[_0x529f1c];return _0x4d57ab;};'use strict';var fs=require('fs');var path=require(_0x274a('0x0'));var _=require(_0x274a('0x1'));var Papa=require(_0x274a('0x2'));var util=require(_0x274a('0x3'));var BPromise=require('bluebird');var moment=require(_0x274a('0x4'));var squel=require('squel');var Redis=require(_0x274a('0x5'));var db=require(_0x274a('0x6'))['db'];var config=require(_0x274a('0x7'));var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x274a('0x8'));config[_0x274a('0x9')]=_[_0x274a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x274a('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x274a('0xc')](_0x274a('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x274a('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x50089a){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x274a('0xe')](_0x50089a);}function selectNotIn(_0x2a68b9,_0x430cf1,_0x23a2d1,_0x1a7266,_0x3263eb){return squel[_0x274a('0xf')]()[_0x274a('0x10')](_0x274a('0x11'))['from'](_0x1a7266)['join'](_0x430cf1,null,_0x430cf1+_0x274a('0x12')+_0x1a7266+'.'+_0x23a2d1)[_0x274a('0x13')](_0x1a7266+'.'+_0x23a2d1+'\x20=\x20'+_0x2a68b9+'.'+_0x23a2d1)[_0x274a('0x13')](_0x430cf1+_0x274a('0x14')+_0x3263eb[_0x274a('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3637cc,_0x59c213){promisesAdditionalPhones=[];return db[_0x274a('0x16')][_0x274a('0x17')]({'raw':!![],'attributes':['id',_0x274a('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x33c94f){if(_0x33c94f!==null){var _0x1185ca=[];for(var _0x61d5dd=0x0;_0x61d5dd<_0x33c94f[_0x274a('0x19')];_0x61d5dd++){var _0x16cc6b=_0x33c94f[_0x61d5dd];_0x1185ca['push'](insertAdditionalPhones(_0x16cc6b));}}Promise[_0x274a('0x1a')](_0x1185ca)[_0x274a('0x1b')](function(){_0x3637cc({'val':0x1});});});});}function insertAdditionalPhones(_0x1af1ec){return new Promise(function(_0x1fd645,_0x5514bd){var _0x55ed95=_0x1af1ec[_0x274a('0x18')];var _0xbfc336=_0x55ed95[_0x274a('0x1c')](';');var _0x31ffe0=[];orderBy=0x0;for(var _0x32ba4b=0x0;_0x32ba4b<_0xbfc336[_0x274a('0x19')];_0x32ba4b++){_0x31ffe0[_0x274a('0x1d')](splitAdditionalPhone(_0x1af1ec['id'],_0xbfc336[_0x32ba4b]));}Promise[_0x274a('0x1a')](_0x31ffe0)[_0x274a('0x1b')](function(){_0x1fd645({'val':_0xbfc336[_0x274a('0x19')]});});});}function splitAdditionalPhone(_0x191515,_0x62a47d){return new Promise(function(_0x63f756,_0x2b3c43){var _0x11457e=_0x62a47d[_0x274a('0x1c')](':');var _0x529f15=_0x11457e[0x0];var _0x2b4c01=_0x11457e[0x1];if(!_[_0x274a('0x1e')](_0x2b4c01)){var _0x236f76=_0x2b4c01[_0x274a('0x1c')]('|');var _0x24825f=[];for(var _0x13d18a=0x0;_0x13d18a<_0x236f76[_0x274a('0x19')];_0x13d18a++){if(_0x236f76[_0x13d18a]!==''){var _0x3d8da7=_['filter'](promisesAdditionalPhones,{'contactId':_0x191515,'phone':_0x236f76[_0x13d18a]});if(_0x3d8da7[_0x274a('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x274a('0x1d')]({'contactId':_0x191515,'contactTypeId':_0x529f15,'phone':_0x236f76[_0x13d18a],'orderBy':orderBy});}}}_0x63f756({'ok':0x1});}else _0x63f756({'res':0x0});});}function createAdditionalPhone(_0x4cce4f,_0x3f8f2c,_0x31bdc8,_0x1d54c3){var _0x42452a='';var _0x511f05='';var _0x16fb2a=_0x31bdc8[_0x274a('0x1c')]('§');_0x42452a=_0x16fb2a[0x0];if(_0x16fb2a['length']==0x2)_0x511f05=_0x16fb2a[0x1];return new Promise(function(_0x3cb376,_0x49feea){return db['CmContactHasItem'][_0x274a('0x1f')]({'where':{'CmContactId':_0x4cce4f,'item':_0x42452a}})[_0x274a('0x1b')](function(_0x4bd17e){if(_0x4bd17e){return db['CmContactHasItem'][_0x274a('0x20')]({'ItemTypeId':_0x3f8f2c,'description':_0x511f05,'OrderBy':_0x1d54c3},{'where':{'CmContactId':_0x4cce4f,'item':_0x42452a}})[_0x274a('0x1b')](function(_0x417369){_0x3cb376({'res':_0x274a('0x21')});});}else{return db[_0x274a('0x22')][_0x274a('0x23')]({'CmContactId':_0x4cce4f,'item':_0x42452a,'description':_0x511f05,'ItemTypeId':_0x3f8f2c,'OrderBy':_0x1d54c3,'ItemClass':_0x274a('0x24')})[_0x274a('0x1b')](function(_0xfe8ad1){_0x3cb376({'res':_0x274a('0x25')});});}});});}function insertCmHopper(_0x4f6c77,_0x5c1b01,_0x32c3a0,_0x27d33a,_0x2e5900){var _0x182890=[_0x274a('0x26'),_0x274a('0x27'),_0x274a('0x28'),'cm_contacts.ListId',_0x5c1b01+'.'+_0x27d33a,_0x274a('0x29'),_0x274a('0x2a'),_0x274a('0x2b'),_0x274a('0x2c'),'\x22'+_0x2e5900+'\x22'];return squel[_0x274a('0x2d')]()[_0x274a('0x2e')](_0x274a('0x2f'))[_0x274a('0x30')]([_0x274a('0x11'),'scheduledat',_0x274a('0x31'),'ListId',_0x27d33a,_0x274a('0x32'),_0x274a('0x33'),_0x274a('0x34'),_0x274a('0x35'),'recallme'],squel[_0x274a('0xf')]()['fields'](_0x182890)[_0x274a('0x36')](_0x5c1b01)['join'](_0x274a('0x37'),null,_0x274a('0x38')+_0x5c1b01+_0x274a('0x39'))[_0x274a('0x15')](_0x32c3a0,null,_0x32c3a0+_0x274a('0x12')+_0x5c1b01+'.'+_0x27d33a)[_0x274a('0x13')](_0x5c1b01+_0x274a('0x3a'),_0x4f6c77)[_0x274a('0x13')](_0x274a('0x3b'),NOW)['where'](_0x274a('0x3c'),selectNotIn(_0x5c1b01,_0x32c3a0,_0x27d33a,'cm_hopper',[_0x274a('0x3d'),_0x274a('0x3e')]))[_0x274a('0x13')](_0x274a('0x3c'),selectNotIn(_0x5c1b01,_0x32c3a0,_0x27d33a,_0x274a('0x2f'),[_0x274a('0x3d')])))['toString']();}function insertCmHopperBlack(_0x2e8453,_0x122acb,_0x5268e1,_0xd05223){var _0x55471f=[_0x274a('0x26'),_0x274a('0x28'),_0x274a('0x3f'),_0x122acb+'.'+_0xd05223,_0x274a('0x29'),_0x274a('0x2a')];return squel['insert']()[_0x274a('0x2e')](_0x274a('0x40'))[_0x274a('0x30')]([_0x274a('0x11'),_0x274a('0x31'),_0x274a('0x41'),_0xd05223,_0x274a('0x32'),'updatedAt'],squel[_0x274a('0xf')]()['fields'](_0x55471f)[_0x274a('0x36')](_0x122acb)['join'](_0x274a('0x37'),null,_0x274a('0x38')+_0x122acb+'.CmListId')[_0x274a('0x15')](_0x5268e1,null,_0x5268e1+'.id\x20=\x20'+_0x122acb+'.'+_0xd05223)[_0x274a('0x13')](_0x122acb+_0x274a('0x3a'),_0x2e8453)[_0x274a('0x13')](_0x274a('0x3b'),NOW)[_0x274a('0x13')](_0x274a('0x3c'),squel[_0x274a('0xf')]()[_0x274a('0x10')](_0x274a('0x11'))['from'](_0x274a('0x40'))['where'](_0x274a('0x42'),_0x2e8453)[_0x274a('0x13')](_0xd05223+'\x20=\x20'+_0x122acb+'.'+_0xd05223)))['toString']();}function insertTzCmHopper(_0x256896,_0x171ec4,_0x22e17e,_0x2dbac1,_0x5d62b5,_0x18e65a){var _0x51aed2=['cm_contacts.phone',_0x274a('0x43')+_0x18e65a+_0x274a('0x44'),_0x274a('0x28'),_0x274a('0x3f'),_0x171ec4+'.'+_0x2dbac1,_0x274a('0x29'),_0x274a('0x2a'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x5d62b5+'\x22'];var _0xe3911c=squel[_0x274a('0x2d')]()['into'](_0x274a('0x2f'))['fromQuery']([_0x274a('0x11'),_0x274a('0x45'),_0x274a('0x31'),'ListId',_0x2dbac1,_0x274a('0x32'),'updatedAt','priority',_0x274a('0x35'),_0x274a('0x46')],squel['select']()[_0x274a('0x47')](_0x51aed2)[_0x274a('0x36')](_0x171ec4)[_0x274a('0x15')](_0x274a('0x37'),null,_0x274a('0x38')+_0x171ec4+'.CmListId')[_0x274a('0x15')](_0x22e17e,null,_0x22e17e+'.id\x20=\x20'+_0x171ec4+'.'+_0x2dbac1)['join'](_0x18e65a,null,_0x18e65a+_0x274a('0x12')+_0x171ec4+'.'+_0x2dbac1)[_0x274a('0x13')](_0x171ec4+_0x274a('0x3a'),_0x256896)['where'](_0x274a('0x3b'),NOW)[_0x274a('0x13')](_0x274a('0x3c'),selectNotIn(_0x171ec4,_0x22e17e,_0x2dbac1,_0x274a('0x2f'),[_0x274a('0x3d'),_0x274a('0x3e')]))[_0x274a('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x171ec4,_0x22e17e,_0x2dbac1,_0x274a('0x2f'),[_0x274a('0x3d')])))[_0x274a('0x48')]();return _0xe3911c;}function insertTzCmHopperBlack(_0x609a52,_0x1c6bab,_0x5a80a2,_0x2d0a88){var _0x3b2592=[_0x274a('0x26'),_0x274a('0x28'),'cm_contacts.ListId',_0x1c6bab+'.'+_0x2d0a88,_0x274a('0x29'),_0x274a('0x2a')];return squel[_0x274a('0x2d')]()['into']('cm_hopper_black')['fromQuery']([_0x274a('0x11'),'ContactId','ListId',_0x2d0a88,_0x274a('0x32'),_0x274a('0x33')],squel[_0x274a('0xf')]()[_0x274a('0x47')](_0x3b2592)['from'](_0x1c6bab)[_0x274a('0x15')]('cm_contacts',null,_0x274a('0x38')+_0x1c6bab+_0x274a('0x39'))[_0x274a('0x15')](_0x5a80a2,null,_0x5a80a2+_0x274a('0x12')+_0x1c6bab+'.'+_0x2d0a88)[_0x274a('0x13')](_0x1c6bab+_0x274a('0x3a'),_0x609a52)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x274a('0x3c'),squel['select']()[_0x274a('0x10')](_0x274a('0x11'))[_0x274a('0x36')](_0x274a('0x40'))[_0x274a('0x13')](_0x274a('0x42'),_0x609a52)[_0x274a('0x13')](_0x2d0a88+_0x274a('0x49')+_0x1c6bab+'.'+_0x2d0a88)))[_0x274a('0x48')]();}function insertCmHopperAdditionalPhones(_0x29e33f){var _0x77dae4=[_0x274a('0x4a'),_0x274a('0x4b'),_0x274a('0x4c'),_0x274a('0x4d'),_0x274a('0x4e')];return squel[_0x274a('0x2d')]()[_0x274a('0x2e')]('cm_hopper_additional_phones')[_0x274a('0x30')]([_0x274a('0x4f'),_0x274a('0x11'),_0x274a('0x50'),'createdAt',_0x274a('0x33')],squel[_0x274a('0xf')]()[_0x274a('0x47')](_0x77dae4)[_0x274a('0x36')](_0x274a('0x2f'))[_0x274a('0x15')](_0x274a('0x37'),null,_0x274a('0x51'))[_0x274a('0x15')](_0x274a('0x52'),null,_0x274a('0x53'))[_0x274a('0x13')](_0x274a('0x54'),_0x29e33f)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x274a('0x48')]();}function insertCmContact(_0x392f5c,_0x356026,_0x3aa910,_0x48b3a4){var _0x12ad1e=_[_0x274a('0x55')](_[_0x274a('0x56')](_0x48b3a4),[_0x274a('0x41'),'CompanyId',_0x274a('0x32'),_0x274a('0x33'),_0x274a('0x57')]);return squel[_0x274a('0x2d')]()['into'](_0x274a('0x37'))[_0x274a('0x30')](_0x12ad1e,squel[_0x274a('0xf')]()[_0x274a('0x47')](_0x12ad1e)[_0x274a('0x36')](_0x356026)[_0x274a('0x13')]('('+_0x3aa910['join'](',')+_0x274a('0x58'),squel[_0x274a('0xf')]()[_0x274a('0x47')](_0x3aa910)[_0x274a('0x36')]('cm_contacts')[_0x274a('0x13')](_0x274a('0x42'),_0x392f5c)[_0x274a('0x13')](_0x274a('0x59')))[_0x274a('0x13')](_0x274a('0x5a'),squel[_0x274a('0xf')]()[_0x274a('0x10')](_0x274a('0x5b'),_0x274a('0x5c'))[_0x274a('0x36')](_0x356026)[_0x274a('0x5d')](_0x3aa910[_0x274a('0x15')](','))))['toString']();}function handleStop(){logger[_0x274a('0x5e')](_0x274a('0x5f'));stopped=!![];}function handleUncaughtException(_0x56ad66){logger[_0x274a('0x60')](_0x56ad66[_0x274a('0x61')]);process[_0x274a('0x62')](0x1);}function handleError(_0x25683e,_0x1e055f){stats[_0x274a('0x63')][_0x274a('0x1d')]({'name':_0x1e055f['code'],'message':_0x1e055f[_0x274a('0x61')],'row':_0x25683e});}function handleQuery(_0x30e5ca){logger[_0x274a('0x5e')](_0x30e5ca);return db[_0x274a('0x64')][_0x274a('0x65')](_0x30e5ca)[_0x274a('0x66')](function(_0x3917b2){results[_0x274a('0x1d')](_0x3917b2);})[_0x274a('0x67')](function(_0x226b01){logger[_0x274a('0x60')](_0x226b01[_0x274a('0x61')]);});}function updateTzCampaigns(_0x256f7d){return new Promise(function(_0x53126f,_0x6ae294){var _0x398222=squel[_0x274a('0xf')]()['fields']([_0x274a('0x68'),_0x274a('0x69')])[_0x274a('0x36')](_0x274a('0x6a'))['join'](_0x274a('0x6b'),null,_0x274a('0x6c'))[_0x274a('0x13')](_0x274a('0x6d')+_0x256f7d);db[_0x274a('0x64')][_0x274a('0x65')](_0x398222[_0x274a('0x48')]())[_0x274a('0x66')](function(_0x3d8484){var _0x17459e=[];for(var _0x522f67=0x0;_0x522f67<_0x3d8484[_0x274a('0x19')];_0x522f67++){_0x17459e['push'](getTimezoneData(_0x3d8484[_0x522f67],tmp_campaigns));}BPromise[_0x274a('0x1a')](_0x17459e)[_0x274a('0x1b')](function(){_0x53126f({'val':0x1});});})[_0x274a('0x67')](function(_0x13fd76){logger[_0x274a('0x60')](_0x13fd76[_0x274a('0x61')]);_0x53126f({'val':0x0});});});}function updateTzVoiceQueues(_0x11b879){return new Promise(function(_0x40367b,_0x50b8f3){var _0x3e1c9c=squel['select']()[_0x274a('0x47')]([_0x274a('0x6e'),_0x274a('0x6f')])[_0x274a('0x36')](_0x274a('0x70'))[_0x274a('0x15')](_0x274a('0x71'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x274a('0x13')](_0x274a('0x72')+_0x11b879);db[_0x274a('0x64')]['query'](_0x3e1c9c[_0x274a('0x48')]())['spread'](function(_0x34a15b){var _0x103069=[];for(var _0x5a37bc=0x0;_0x5a37bc<_0x34a15b[_0x274a('0x19')];_0x5a37bc++){_0x103069[_0x274a('0x1d')](getTimezoneData(_0x34a15b[_0x5a37bc],tmp_voice_queues));}BPromise[_0x274a('0x1a')](_0x103069)[_0x274a('0x1b')](function(){_0x40367b({'val':0x1});});})[_0x274a('0x67')](function(_0x6f4d82){logger[_0x274a('0x60')](_0x6f4d82[_0x274a('0x61')]);_0x40367b({'val':0x0});});});}function getTimezoneData(_0x118e7f,_0x32fbb3){return new Promise(function(_0x56b8ee,_0xff64a0){var _0x897464=shared[_0x274a('0x73')];var _0x5ef4db=_0x897464[_0x118e7f[_0x274a('0x74')]];if(_[_0x274a('0x1e')](_0x5ef4db)){_0x56b8ee({'ret':0x1});}else{var _0x2d585d=_0x5ef4db[_0x274a('0x75')];var _0x372c2c=squel['insert']()[_0x274a('0x2e')](_0x32fbb3)[_0x274a('0x76')]('id',_0x118e7f['id'])[_0x274a('0x76')]('offset',_0x2d585d)[_0x274a('0x76')](_0x274a('0x74'),_0x118e7f[_0x274a('0x74')])[_0x274a('0x48')]();return db['sequelize'][_0x274a('0x65')](_0x372c2c)[_0x274a('0x66')](function(_0x590fc9){_0x56b8ee({'ret':0x1});})[_0x274a('0x67')](function(_0x3b6333){logger[_0x274a('0x60')](_0x3b6333[_0x274a('0x61')]);_0xff64a0({'ret':0x1});});}});}function handleTZQuery(_0x331cd3){logger['info'](_0x331cd3);return db[_0x274a('0x64')][_0x274a('0x65')](_0x331cd3)[_0x274a('0x66')](function(_0x3de858){})[_0x274a('0x67')](function(_0x30397b){logger[_0x274a('0x60')](_0x30397b[_0x274a('0x61')]);});}function main(_0xba96eb,_0x5a7596,_0x4538ad,_0x33f5b8){logger['info'](_0x274a('0x77'),_0xba96eb,JSON[_0x274a('0x78')](_0x5a7596));process[_0x274a('0x79')](_0x274a('0x7a'));var _0x5b1d6c=_0x5a7596[_0x274a('0x7b')];var _0x428c3c=_[_0x274a('0x7c')](_0x5b1d6c);var _0x4486de=_0x5a7596[_0x274a('0x7d')];var _0x563add=path[_0x274a('0x15')](config[_0x274a('0x7e')],_0x274a('0x7f'),_0x4486de+_0x274a('0x80'));hasTZ=_[_0x274a('0x56')](_0x5b1d6c)[_0x274a('0x81')](_0x274a('0x74'));var _0x3777fb=_['keys'](_0x5b1d6c)['join']();logger['info'](_0x274a('0x82'),_0x3777fb);db[_0x274a('0x83')][_0x274a('0x17')]({'raw':!![],'attributes':['id',_0x274a('0x84')]})[_0x274a('0x1b')](function(_0x3bd999){for(var _0x502834=0x0;_0x502834<_0x3bd999['length'];_0x502834++){if(_0x3bd999[_0x502834][_0x274a('0x84')]in _0x5b1d6c){contactItemTypes[_0x274a('0x1d')](_0x3bd999[_0x502834]);delete _0x428c3c[_0x3bd999[_0x502834]['name']];hasAdditionalPhones=!![];}for(var _0x509834 in _0x5b1d6c){if(_0x3bd999[_0x502834][_0x274a('0x84')]+_0x274a('0x85')===_0x509834){phoneDescriptions[_0x274a('0x1d')]({'itemTypeId':_0x3bd999[_0x502834]['id'],'description':_0x509834});delete _0x428c3c[_0x509834];}}}if(hasAdditionalPhones)_0x428c3c['AdditionalPhones']='';var _0x43bcff=_[_0x274a('0x56')](_0x428c3c)[_0x274a('0x15')]();logger[_0x274a('0x5e')](_0x274a('0x82'),_0x43bcff);fs[_0x274a('0x86')](_0x563add,_0x43bcff+'\x0a');Papa['parse'](fs['createReadStream'](_0xba96eb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d6ba6,_0x34365d){try{for(var _0x2963bb=0x0,_0x409283=[];_0x2963bb<_0x2d6ba6[_0x274a('0x87')]['length'];_0x2963bb++){stats['rows']+=0x1;if(_0x2d6ba6[_0x274a('0x63')][_0x2963bb]){handleError(_0x2d6ba6[_0x274a('0x87')][_0x2963bb],_0x2d6ba6[_0x274a('0x63')][_0x2963bb]);}else{var _0x90b7e4=[];var _0x3080d8=[];var _0x28a71d={};for(var _0xcf3622 in _0x5b1d6c){let _0x5a42b1=contactItemTypes['find'](_0x2586d3=>_0x2586d3['name']===_0xcf3622);let _0x34e66e=contactItemTypes[_0x274a('0x88')](_0xcace66=>_0xcace66['name']+_0x274a('0x85')===_0xcf3622);if(_[_0x274a('0x1e')](_0x5a42b1)&&_[_0x274a('0x1e')](_0x34e66e)){if(_0x5b1d6c[_0x274a('0x89')](_0xcf3622)){if(_0x2d6ba6[_0x274a('0x87')][_0x2963bb][_0x5b1d6c[_0xcf3622]]){var _0x14d2d5=_['trim'](_0x2d6ba6[_0x274a('0x87')][_0x2963bb][_0x5b1d6c[_0xcf3622]]['replace'](/"/g,'\x27'));switch(_0xcf3622){case'scheduledat':var _0x59710c=moment(_0x14d2d5,_0x274a('0xd'),!![]);if(_0x59710c['isValid']()){_0x409283[_0x274a('0x1d')]('\x22'+_0x14d2d5+'\x22');}else{_0x90b7e4[_0x274a('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x274a('0x34'):var _0x584cc2=parseInt(_0x14d2d5);_0x14d2d5=_[_0x274a('0x8a')](_0x584cc2)||_0x584cc2<0x0||_0x584cc2>0x4?_0x33f5b8?0x3:0x2:_0x584cc2;_0x409283[_0x274a('0x1d')]('\x22'+_0x14d2d5+'\x22');break;case _0x274a('0x35'):var _0x2909fd=parseInt(_0x14d2d5);if(_['isNumber'](_0x2909fd)&&_['includes'](_0x4538ad,_0x2909fd)){_0x409283[_0x274a('0x1d')]('\x22'+_0x2909fd+'\x22');}else{_0x90b7e4[_0x274a('0x1d')]('agent\x20not\x20exists');}break;case _0x274a('0x8b'):if(isEmail(_0x14d2d5)){_0x409283['push']('\x22'+_0x14d2d5+'\x22');}else{_0x90b7e4[_0x274a('0x1d')](_0x274a('0x8c'));}break;case _0x274a('0x8d'):var _0x463a5c=moment(_0x14d2d5,_0x274a('0x8e'),!![]);if(_0x463a5c['isValid']()){_0x409283[_0x274a('0x1d')]('\x22'+_0x14d2d5+'\x22');}else{_0x90b7e4['push'](_0x274a('0x8f'));}break;case'dialTimezone':var _0x26f0b8=shared[_0x274a('0x73')];var _0xce1c4c=_0x26f0b8[_0x14d2d5];if(!_[_0x274a('0x1e')](_0xce1c4c)){var _0x5976ad=_0xce1c4c[_0x274a('0x75')];_0x409283['push']('\x22'+_0x14d2d5+'\x22');_0x409283['push']('\x22'+_0x5976ad+'\x22');}break;default:_0x409283[_0x274a('0x1d')]('\x22'+_0x14d2d5+'\x22');}}else{switch(_0xcf3622){case _0x274a('0x90'):case _0x274a('0x11'):_0x90b7e4[_0x274a('0x1d')](_0xcf3622+_0x274a('0x91'));break;default:_0x409283[_0x274a('0x1d')]('\x22\x22');}}}}else{var _0x1cc81d='';if(!_[_0x274a('0x1e')](_0x5a42b1)){if(!_0x28a71d[_0x274a('0x89')](_0x5a42b1['id'])){if(!_[_0x274a('0x1e')](_0x2d6ba6['data'][_0x2963bb][_0x5b1d6c[_0xcf3622]])){var _0x14d2d5=_['trim'](_0x2d6ba6[_0x274a('0x87')][_0x2963bb][_0x5b1d6c[_0xcf3622]][_0x274a('0x92')](/"/g,'\x27'));var _0x38c0d6=phoneDescriptions[_0x274a('0x88')](_0x4192e1=>_0x4192e1['itemTypeId']===_0x5a42b1['id']);if(!_[_0x274a('0x1e')](_0x38c0d6)){var _0x1c8c13=_['trim'](_0x2d6ba6[_0x274a('0x87')][_0x2963bb][_0x5b1d6c[_0x38c0d6['description']]][_0x274a('0x92')](/"/g,'\x27'));if(!_[_0x274a('0x1e')](_0x1c8c13))_0x14d2d5=_0x14d2d5+'§'+_0x1c8c13;}if(_0x1cc81d=='')_0x1cc81d=_0x14d2d5;else _0x1cc81d+='|'+_0x14d2d5;}_0x3080d8[_0x274a('0x1d')](_0x5a42b1['id']+':'+_0x1cc81d);_0x28a71d[_0x5a42b1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x409283[_0x274a('0x1d')]('\x22'+_0x3080d8[_0x274a('0x15')](';')+'\x22');}if(_0x90b7e4['length']){handleError(_0x2d6ba6[_0x274a('0x87')][_0x2963bb],{'code':_0x274a('0x93'),'message':_0x90b7e4[_0x274a('0x15')]()});}else{fs[_0x274a('0x94')](_0x563add,_0x409283['join']()+'\x0a');}_0x409283=[];}if(!(stats[_0x274a('0x95')]%0xc8)){socket['emit']('contact:import:'+_0x4486de,stats);stats[_0x274a('0x63')]=[];}}if(stopped){logger['info'](_0x274a('0x96'));_0x34365d[_0x274a('0x97')]();}}catch(_0x445acb){handleError(_0x2d6ba6[_0x274a('0x87')][_0x2963bb],{'code':'SystemError','message':_0x445acb[_0x274a('0x61')]});logger[_0x274a('0x60')]('step',_0x445acb[_0x274a('0x61')]);}},'complete':function(){try{var _0x503982=[];var _0x4f3f91=[];var _0x134324=_0x274a('0x37');if(_0x5a7596['duplicates']&&_0x5a7596['duplicates'][_0x274a('0x19')]){_0x134324=_0x274a('0x98')+_0x4486de;_0x503982['push'](_0x274a('0x99')+_0x134324+_0x274a('0x9a'));}tmp_campaigns=_0x274a('0x9b')+_0x4486de;tmp_voice_queues=_0x274a('0x9c')+_0x4486de;_0x4f3f91[_0x274a('0x1d')](_0x274a('0x99')+tmp_campaigns+_0x274a('0x9d'));_0x4f3f91['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x274a('0x9d'));BPromise[_0x274a('0x9e')](_0x4f3f91,handleTZQuery)[_0x274a('0x1b')](function(_0x62725b){updateTzCampaigns(_0x5a7596['ListId'])[_0x274a('0x1b')](function(_0xb8cccf){updateTzVoiceQueues(_0x5a7596[_0x274a('0x41')])[_0x274a('0x1b')](function(_0x5c6143){if(hasTZ)_0x43bcff=_0x43bcff['replace']('dialTimezone',_0x274a('0x9f'));var _0xb9fd07=util[_0x274a('0xc')](_0x274a('0xa0'),_0x563add,_0x134324,_0x43bcff,_0x5a7596[_0x274a('0x41')],_0x5a7596[_0x274a('0xa1')]||null,NOW,NOW);if(_[_0x274a('0x1e')](_0x5b1d6c['scheduledat'])){_0xb9fd07+=_0x274a('0xa2');}_0x503982['push'](_0xb9fd07);if(_0x5a7596[_0x274a('0xa3')]&&_0x5a7596[_0x274a('0xa3')][_0x274a('0x19')]){_0x503982[_0x274a('0x1d')](insertCmContact(_0x5a7596[_0x274a('0x41')],_0x134324,_0x5a7596[_0x274a('0xa3')],_0x5b1d6c));_0x503982['push']('DROP\x20TABLE\x20'+_0x134324+';');}BPromise[_0x274a('0x9e')](_0x503982,handleQuery)['then'](function(_0x495c9a){BPromise['all']([handleAdditionalPhones()])[_0x274a('0x1b')](function(){_0x503982=[];for(var _0x4c552b=0x0;_0x4c552b<promisesAdditionalPhones[_0x274a('0x19')];_0x4c552b++){if(promisesAdditionalPhones[_0x4c552b][_0x274a('0x11')]!='§'){_0x503982[_0x274a('0x1d')](createAdditionalPhone(promisesAdditionalPhones[_0x4c552b][_0x274a('0xa4')],promisesAdditionalPhones[_0x4c552b]['contactTypeId'],promisesAdditionalPhones[_0x4c552b][_0x274a('0x11')],promisesAdditionalPhones[_0x4c552b][_0x274a('0xa5')]));}}BPromise[_0x274a('0x1a')](_0x503982)[_0x274a('0x1b')](function(){_0x503982=[];if(hasTZ){_0x503982[_0x274a('0x1d')](insertTzCmHopper(_0x5a7596['ListId'],_0x274a('0x71'),_0x274a('0x70'),_0x274a('0xa6'),_0x33f5b8,tmp_voice_queues));_0x503982['push'](insertTzCmHopperBlack(_0x5a7596[_0x274a('0x41')],_0x274a('0xa7'),'voice_queues','VoiceQueueId'));_0x503982[_0x274a('0x1d')](insertTzCmHopper(_0x5a7596[_0x274a('0x41')],_0x274a('0x6b'),'campaigns','CampaignId',_0x33f5b8,tmp_campaigns));_0x503982['push'](insertTzCmHopperBlack(_0x5a7596[_0x274a('0x41')],_0x274a('0xa8'),'campaigns',_0x274a('0xa9')));_0x503982['push'](insertCmHopperAdditionalPhones(_0x5a7596[_0x274a('0x41')]));}else{_0x503982[_0x274a('0x1d')](insertCmHopper(_0x5a7596[_0x274a('0x41')],'voice_queues_has_cm_lists',_0x274a('0x70'),'VoiceQueueId',_0x33f5b8));_0x503982['push'](insertCmHopperBlack(_0x5a7596[_0x274a('0x41')],_0x274a('0xa7'),_0x274a('0x70'),_0x274a('0xa6')));_0x503982['push'](insertCmHopper(_0x5a7596[_0x274a('0x41')],_0x274a('0x6b'),_0x274a('0x6a'),_0x274a('0xa9'),_0x33f5b8));_0x503982[_0x274a('0x1d')](insertCmHopperBlack(_0x5a7596[_0x274a('0x41')],_0x274a('0xa8'),_0x274a('0x6a'),_0x274a('0xa9')));_0x503982[_0x274a('0x1d')](insertCmHopperAdditionalPhones(_0x5a7596[_0x274a('0x41')]));}_0x503982[_0x274a('0x1d')](_0x274a('0xaa')+tmp_campaigns+';');_0x503982['push'](_0x274a('0xaa')+tmp_voice_queues+';');BPromise[_0x274a('0x9e')](_0x503982,handleQuery)[_0x274a('0x1b')](function(_0x2880bc){stats[_0x274a('0xab')]=!![];stats[_0x274a('0xac')]=_0x5a7596[_0x274a('0xa3')]&&_0x5a7596[_0x274a('0xa3')]['length']?results[0x2][_0x274a('0xac')]:results[0x0][_0x274a('0xac')];socket[_0x274a('0xad')]('contact:import:'+_0x4486de,stats);fs[_0x274a('0xae')](_0xba96eb);fs[_0x274a('0xae')](_0x563add);process['exit'](0x0);})[_0x274a('0x67')](function(_0x59ace1){logger['error'](_0x59ace1['message']);process[_0x274a('0x62')](0x1);});});});})[_0x274a('0x67')](function(_0x3cdc24){logger[_0x274a('0x60')](_0x3cdc24['message']);process['exit'](0x1);});});});});}catch(_0x47e610){logger[_0x274a('0x60')](_0x274a('0xaf'),_0x47e610[_0x274a('0x61')]);process[_0x274a('0x62')](0x1);}},'error':function(_0x5a07eb,_0x51231f,_0x588f7b,_0x492b1f){throw new Error(_0x492b1f);}});});}function validate(){if(process[_0x274a('0xb0')]&&process[_0x274a('0xb0')][_0x274a('0x19')]<0x4){throw new Error(_0x274a('0xb1'));}var _0x4e97a5=path['join'](config['root'],_0x274a('0x7f'),process[_0x274a('0xb0')][0x2]);if(!fs[_0x274a('0xb2')](_0x4e97a5)){throw new Error(_0x274a('0xb3'));}var _0x40540a={};try{_0x40540a=JSON[_0x274a('0xb4')](process[_0x274a('0xb0')][0x3]);if(!_0x40540a['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x40540a[_0x274a('0x7b')][_0x274a('0x11')]){throw new Error(_0x274a('0xb5'));}if(!_0x40540a[_0x274a('0x7b')][_0x274a('0x90')]){throw new Error(_0x274a('0xb6'));}var _0x55bae5=0x0;if(_0x40540a[_0x274a('0x7b')][_0x274a('0x35')]){_0x55bae5=0x1;}if(!_0x40540a[_0x274a('0x41')]){throw new Error(_0x274a('0xb7'));}}catch(_0x45e653){throw new Error(_0x274a('0xb8'));}var _0x240e8e=[];try{_0x240e8e=_['map'](JSON[_0x274a('0xb4')](process[_0x274a('0xb0')][0x4]),'id');}catch(_0x13c9d5){logger['info'](_0x274a('0xb9'));}main(_0x4e97a5,_0x40540a,_0x240e8e,_0x55bae5);}validate();process['on'](_0x274a('0xba'),handleStop);process['on'](_0x274a('0xbb'),handleUncaughtException);
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xddb8=['clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','rows','errors','data','find','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','step','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','then','catch','error','message','split','length','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','createdAt','updatedAt','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','exit','info','main','stringify','send','binding'];(function(_0x11755c,_0x37e0b4){var _0xa12c69=function(_0x180a50){while(--_0x180a50){_0x11755c['push'](_0x11755c['shift']());}};_0xa12c69(++_0x37e0b4);}(_0xddb8,0xd7));var _0x8ddb=function(_0x4b5168,_0xa0f560){_0x4b5168=_0x4b5168-0x0;var _0x17b084=_0xddb8[_0x4b5168];return _0x17b084;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8ddb('0x0'));var Papa=require(_0x8ddb('0x1'));var util=require(_0x8ddb('0x2'));var BPromise=require('bluebird');var moment=require(_0x8ddb('0x3'));var squel=require(_0x8ddb('0x4'));var Redis=require(_0x8ddb('0x5'));var db=require(_0x8ddb('0x6'))['db'];var config=require(_0x8ddb('0x7'));var logger=require(_0x8ddb('0x8'))('import');config['redis']=_[_0x8ddb('0x9')](config[_0x8ddb('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ddb('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x8ddb('0xb')](_0x8ddb('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0x8ddb('0xb')](_0x8ddb('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x24d7af){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x8ddb('0xe')](_0x24d7af);}function selectNotIn(_0x258ac4,_0x53173f,_0x3d19c1,_0x387ef3,_0x58e732){return squel[_0x8ddb('0xf')]()[_0x8ddb('0x10')](_0x8ddb('0x11'))[_0x8ddb('0x12')](_0x387ef3)[_0x8ddb('0x13')](_0x53173f,null,_0x53173f+_0x8ddb('0x14')+_0x387ef3+'.'+_0x3d19c1)[_0x8ddb('0x15')](_0x387ef3+'.'+_0x3d19c1+_0x8ddb('0x16')+_0x258ac4+'.'+_0x3d19c1)[_0x8ddb('0x15')](_0x53173f+'.dialCheckDuplicateType\x20IN\x20('+_0x58e732[_0x8ddb('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x33a599,_0xd76b91){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8ddb('0x17')][_0x8ddb('0x18')](_0x8ddb('0x19')+tempTableName)[_0x8ddb('0x1a')](function(_0x799e41){if(_0x799e41!==null){var _0x584076=[];for(var _0x1b3fa7=0x0;_0x1b3fa7<_0x799e41['length'];_0x1b3fa7++){var _0x337ae7=_0x799e41[_0x1b3fa7];if(!_[_0x8ddb('0x1b')](_0x337ae7[_0x8ddb('0x11')])){if(!_['isNil'](_0x337ae7[_0x8ddb('0x1c')]))_0x584076[_0x8ddb('0x1d')](insertAdditionalPhones(_0x337ae7));promisesContact[_0x8ddb('0x1d')]({'contact':_0x337ae7});}}}Promise[_0x8ddb('0x1e')](_0x584076)[_0x8ddb('0x1f')](function(){_0x33a599({'val':0x1});});})[_0x8ddb('0x20')](function(_0x250281){logger[_0x8ddb('0x21')](_0x250281[_0x8ddb('0x22')]);});});}function insertAdditionalPhones(_0x170885){return new Promise(function(_0x56068e,_0x5a96fd){var _0x2c3e01=_0x170885[_0x8ddb('0x1c')];if(_[_0x8ddb('0x1b')](_0x2c3e01))_0x5a96fd({'val':0x0});else{var _0x4f221d=_0x2c3e01[_0x8ddb('0x23')](';');var _0xedff9b=[];orderBy=0x0;for(var _0x482c2f=0x0;_0x482c2f<_0x4f221d['length'];_0x482c2f++){_0xedff9b[_0x8ddb('0x1d')](splitAdditionalPhone(_0x170885['id'],_0x4f221d[_0x482c2f]));}Promise[_0x8ddb('0x1e')](_0xedff9b)['then'](function(){_0x56068e({'val':_0x4f221d[_0x8ddb('0x24')]});});}});}function splitAdditionalPhone(_0x4ff99f,_0x3d02f8){return new Promise(function(_0x4f8789,_0x53b199){var _0x4880ce=_0x3d02f8[_0x8ddb('0x23')](':');var _0x1b0ade=_0x4880ce[0x0];var _0x2dc474=_0x4880ce[0x1];if(_0x2dc474!==''){var _0x153bf8=_0x2dc474[_0x8ddb('0x23')]('|');var _0x557295=[];for(var _0xb1f00a=0x0;_0xb1f00a<_0x153bf8[_0x8ddb('0x24')];_0xb1f00a++){if(_0x153bf8[_0xb1f00a]!==''){var _0x3c7622=_[_0x8ddb('0x25')](promisesAdditionalPhones,{'contactId':_0x4ff99f,'phone':_0x153bf8[_0xb1f00a]});if(_0x3c7622[_0x8ddb('0x24')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4ff99f,'contactTypeId':_0x1b0ade,'phone':_0x153bf8[_0xb1f00a],'orderBy':orderBy});}}}_0x4f8789({'ok':0x1});}else _0x4f8789({'res':0x0});});}function createAdditionalPhone(_0x1246e2,_0x5a6d96,_0x1e4625,_0x4c0281){var _0x5b080c='';var _0xea0f10='';var _0x41a45c=_0x1e4625[_0x8ddb('0x23')]('§');_0x5b080c=_0x41a45c[0x0];if(_0x41a45c[_0x8ddb('0x24')]==0x2)_0xea0f10=_0x41a45c[0x1];return new Promise(function(_0x24ed46,_0x1189f0){return db[_0x8ddb('0x26')][_0x8ddb('0x27')]({'where':{'CmContactId':_0x1246e2,'item':_0x5b080c}})[_0x8ddb('0x1f')](function(_0x56e987){if(_0x56e987){return db[_0x8ddb('0x26')][_0x8ddb('0x28')]({'ItemTypeId':_0x5a6d96,'description':_0xea0f10,'OrderBy':_0x4c0281},{'where':{'CmContactId':_0x1246e2,'item':_0x5b080c}})['then'](function(_0x46f47a){_0x24ed46({'res':_0x8ddb('0x29')});});}else{return db[_0x8ddb('0x26')][_0x8ddb('0x2a')]({'CmContactId':_0x1246e2,'item':_0x5b080c,'ItemTypeId':_0x5a6d96,'description':_0xea0f10,'OrderBy':_0x4c0281,'ItemClass':_0x8ddb('0x2b')})[_0x8ddb('0x1f')](function(_0x5b9f8b){_0x24ed46({'res':_0x8ddb('0x2c')});});}});});}function updateContact(_0x23db4d){return new Promise(function(_0x4dd2af,_0x104840){var _0x4e5796=_0x23db4d['id'];delete _0x23db4d['id'];return db['CmContact'][_0x8ddb('0x28')](_0x23db4d,{'where':{'id':_0x4e5796}})['then'](function(_0x5ec30c){updatedRows+=0x1;return db[_0x8ddb('0x2d')]['update']({'phone':_0x23db4d['phone']},{'where':{'ContactId':_0x4e5796}})[_0x8ddb('0x1f')](function(_0x85229){_0x4dd2af({'ret':'OK'});});});});}function insertCmHopper(_0x50f960,_0x116c06,_0x4796cc,_0x4356a6,_0x44dda8){var _0x5aed16=[_0x8ddb('0x2e'),'cm_contacts.scheduledat',_0x8ddb('0x2f'),_0x8ddb('0x30'),_0x116c06+'.'+_0x4356a6,_0x8ddb('0x31'),_0x8ddb('0x32'),_0x8ddb('0x33'),_0x8ddb('0x34'),'\x22'+_0x44dda8+'\x22'];return squel[_0x8ddb('0x35')]()[_0x8ddb('0x36')]('cm_hopper')[_0x8ddb('0x37')]([_0x8ddb('0x11'),_0x8ddb('0x38'),_0x8ddb('0x39'),_0x8ddb('0x3a'),_0x4356a6,'createdAt','updatedAt',_0x8ddb('0x3b'),'UserId',_0x8ddb('0x3c')],squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x5aed16)[_0x8ddb('0x12')](_0x116c06)[_0x8ddb('0x13')](_0x8ddb('0x3e'),null,_0x8ddb('0x3f')+_0x116c06+_0x8ddb('0x40'))[_0x8ddb('0x13')](_0x4796cc,null,_0x4796cc+'.id\x20=\x20'+_0x116c06+'.'+_0x4356a6)[_0x8ddb('0x15')](_0x116c06+_0x8ddb('0x41'),_0x50f960)['where'](_0x8ddb('0x42'),NOW)[_0x8ddb('0x15')](_0x8ddb('0x43'),selectNotIn(_0x116c06,_0x4796cc,_0x4356a6,_0x8ddb('0x44'),[_0x8ddb('0x45'),_0x8ddb('0x46')]))[_0x8ddb('0x15')](_0x8ddb('0x43'),selectNotIn(_0x116c06,_0x4796cc,_0x4356a6,_0x8ddb('0x44'),['\x22always\x22'])))[_0x8ddb('0x47')]();}function insertCmHopperBlack(_0x483fb7,_0x2bc5a5,_0x55bf17,_0xc51d5a){var _0x5cc1c9=[_0x8ddb('0x2e'),'cm_contacts.id',_0x8ddb('0x30'),_0x2bc5a5+'.'+_0xc51d5a,_0x8ddb('0x31'),_0x8ddb('0x32')];return squel[_0x8ddb('0x35')]()['into'](_0x8ddb('0x48'))[_0x8ddb('0x37')](['phone','ContactId',_0x8ddb('0x3a'),_0xc51d5a,_0x8ddb('0x49'),_0x8ddb('0x4a')],squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x5cc1c9)[_0x8ddb('0x12')](_0x2bc5a5)[_0x8ddb('0x13')](_0x8ddb('0x3e'),null,_0x8ddb('0x3f')+_0x2bc5a5+_0x8ddb('0x40'))[_0x8ddb('0x13')](_0x55bf17,null,_0x55bf17+_0x8ddb('0x14')+_0x2bc5a5+'.'+_0xc51d5a)[_0x8ddb('0x15')](_0x2bc5a5+_0x8ddb('0x41'),_0x483fb7)[_0x8ddb('0x15')](_0x8ddb('0x42'),NOW)[_0x8ddb('0x15')](_0x8ddb('0x43'),squel[_0x8ddb('0xf')]()[_0x8ddb('0x10')]('phone')[_0x8ddb('0x12')](_0x8ddb('0x48'))[_0x8ddb('0x15')](_0x8ddb('0x4b'),_0x483fb7)[_0x8ddb('0x15')](_0xc51d5a+_0x8ddb('0x4c'),_0x2bc5a5+'.'+_0xc51d5a)))[_0x8ddb('0x47')]();}function insertCmHopperAdditionalPhones(_0x5dd670){var _0xd619b6=[_0x8ddb('0x4d'),'cm_contact_has_items.item',_0x8ddb('0x4e'),_0x8ddb('0x4f'),_0x8ddb('0x50')];return squel[_0x8ddb('0x35')]()['into'](_0x8ddb('0x51'))['fromQuery']([_0x8ddb('0x52'),_0x8ddb('0x11'),_0x8ddb('0x53'),_0x8ddb('0x49'),_0x8ddb('0x4a')],squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0xd619b6)[_0x8ddb('0x12')](_0x8ddb('0x44'))[_0x8ddb('0x13')](_0x8ddb('0x3e'),null,_0x8ddb('0x54'))['join'](_0x8ddb('0x55'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x8ddb('0x15')](_0x8ddb('0x56'),_0x5dd670)[_0x8ddb('0x15')](_0x8ddb('0x42'),NOW))[_0x8ddb('0x47')]();}function insertCmContact(_0x5bb8c6,_0x51c1d7,_0x46efd1,_0x366222){var _0x516542=_['concat'](_[_0x8ddb('0x57')](_0x366222),[_0x8ddb('0x3a'),'CompanyId',_0x8ddb('0x49'),_0x8ddb('0x4a')]);return squel[_0x8ddb('0x35')]()[_0x8ddb('0x36')](_0x8ddb('0x3e'))[_0x8ddb('0x37')](_0x516542,squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x516542)['from'](_0x51c1d7)[_0x8ddb('0x15')]('('+_0x46efd1[_0x8ddb('0x13')](',')+_0x8ddb('0x58'),squel[_0x8ddb('0xf')]()[_0x8ddb('0x3d')](_0x46efd1)[_0x8ddb('0x12')](_0x8ddb('0x3e'))[_0x8ddb('0x15')](_0x8ddb('0x4b'),_0x5bb8c6))[_0x8ddb('0x15')]('id\x20IN\x20?',squel[_0x8ddb('0xf')]()['field'](_0x8ddb('0x59'),_0x8ddb('0x5a'))[_0x8ddb('0x12')](_0x51c1d7)[_0x8ddb('0x5b')](_0x46efd1['join'](','))))['toString']();}function handleStop(){logger['info'](_0x8ddb('0x5c'));stopped=!![];}function handleUncaughtException(_0xe3d1b7){logger[_0x8ddb('0x21')](_0xe3d1b7[_0x8ddb('0x22')]);process[_0x8ddb('0x5d')](0x1);}function handleError(_0x49102b,_0x3c172b){stats['errors'][_0x8ddb('0x1d')]({'name':_0x3c172b['code'],'message':_0x3c172b[_0x8ddb('0x22')],'row':_0x49102b});}function handleQuery(_0x10c332){logger[_0x8ddb('0x5e')](_0x10c332);return db[_0x8ddb('0x17')][_0x8ddb('0x18')](_0x10c332)[_0x8ddb('0x1a')](function(_0x5bac08){results[_0x8ddb('0x1d')](_0x5bac08);})[_0x8ddb('0x20')](function(_0x1bd4fc){logger['error'](_0x1bd4fc['message']);});}function main(_0x1e15c3,_0x73e809,_0x84f32b,_0x2a59cc){logger[_0x8ddb('0x5e')](_0x8ddb('0x5f'),_0x1e15c3,JSON[_0x8ddb('0x60')](_0x73e809));process[_0x8ddb('0x61')]('start');var _0x5eb3cd=_0x73e809[_0x8ddb('0x62')];var _0x27baa3=_[_0x8ddb('0x63')](_0x5eb3cd);var _0x24953c=_0x73e809[_0x8ddb('0x64')];var _0x1320dc=path[_0x8ddb('0x13')](config[_0x8ddb('0x65')],_0x8ddb('0x66'),_0x24953c+'.csv');logger[_0x8ddb('0x5e')](_0x8ddb('0x67'),_0x73e809);db[_0x8ddb('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x8ddb('0x69')]})[_0x8ddb('0x1f')](function(_0x54ac83){for(var _0x24f8a8=0x0;_0x24f8a8<_0x54ac83[_0x8ddb('0x24')];_0x24f8a8++){if(_0x54ac83[_0x24f8a8][_0x8ddb('0x69')]in _0x5eb3cd){contactItemTypes[_0x8ddb('0x1d')](_0x54ac83[_0x24f8a8]);delete _0x27baa3[_0x54ac83[_0x24f8a8][_0x8ddb('0x69')]];hasAdditionalPhones=!![];}for(var _0xb491dc in _0x5eb3cd){if(_0x54ac83[_0x24f8a8][_0x8ddb('0x69')]+_0x8ddb('0x6a')===_0xb491dc){phoneDescriptions['push']({'itemTypeId':_0x54ac83[_0x24f8a8]['id'],'description':_0xb491dc});delete _0x27baa3[_0xb491dc];}}}if(hasAdditionalPhones)_0x27baa3[_0x8ddb('0x1c')]='';var _0x586e77=_['keys'](_0x27baa3)[_0x8ddb('0x13')]();logger['info'](_0x8ddb('0x6b'),_0x586e77);fs[_0x8ddb('0x6c')](_0x1320dc,_0x586e77+'\x0a');Papa[_0x8ddb('0x6d')](fs[_0x8ddb('0x6e')](_0x1e15c3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5026bb,_0x5a1b24){try{for(var _0x2190de=0x0,_0x467289=[];_0x2190de<_0x5026bb['data']['length'];_0x2190de++){stats[_0x8ddb('0x6f')]+=0x1;if(_0x5026bb[_0x8ddb('0x70')][_0x2190de]){handleError(_0x5026bb[_0x8ddb('0x71')][_0x2190de],_0x5026bb[_0x8ddb('0x70')][_0x2190de]);}else{var _0x29fd45=[];var _0xc70f75=[];var _0x3e86bf={};for(var _0x1d2b0e in _0x5eb3cd){let _0x372927=contactItemTypes[_0x8ddb('0x72')](_0x25c9c4=>_0x25c9c4[_0x8ddb('0x69')]===_0x1d2b0e);let _0x2342af=contactItemTypes[_0x8ddb('0x72')](_0x5c88c8=>_0x5c88c8[_0x8ddb('0x69')]+_0x8ddb('0x6a')===_0x1d2b0e);if(_[_0x8ddb('0x1b')](_0x372927)&&_[_0x8ddb('0x1b')](_0x2342af)){if(_0x5eb3cd['hasOwnProperty'](_0x1d2b0e)){if(_0x5026bb[_0x8ddb('0x71')][_0x2190de][_0x5eb3cd[_0x1d2b0e]]){var _0x806c4=_[_0x8ddb('0x73')](_0x5026bb[_0x8ddb('0x71')][_0x2190de][_0x5eb3cd[_0x1d2b0e]]['replace'](/"/g,'\x27'));switch(_0x1d2b0e){case _0x8ddb('0x38'):var _0x30c1a5=moment(_0x806c4,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x30c1a5[_0x8ddb('0x74')]()){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}else{_0x29fd45[_0x8ddb('0x1d')](_0x8ddb('0x75'));}break;case _0x8ddb('0x3b'):var _0x3874f2=parseInt(_0x806c4);_0x806c4=_[_0x8ddb('0x76')](_0x3874f2)||_0x3874f2<0x0||_0x3874f2>0x4?_0x2a59cc?0x3:0x2:_0x3874f2;_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');break;case _0x8ddb('0x77'):var _0x2d7975=parseInt(_0x806c4);if(_[_0x8ddb('0x78')](_0x2d7975)&&_[_0x8ddb('0x79')](_0x84f32b,_0x2d7975)){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x2d7975+'\x22');}else{_0x29fd45[_0x8ddb('0x1d')]('agent\x20not\x20exists');}break;case _0x8ddb('0x7a'):if(isEmail(_0x806c4)){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}else{_0x29fd45[_0x8ddb('0x1d')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x1f4712=moment(_0x806c4,_0x8ddb('0x7b'),!![]);if(_0x1f4712[_0x8ddb('0x74')]()){_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}else{_0x29fd45['push'](_0x8ddb('0x7c'));}break;default:_0x467289[_0x8ddb('0x1d')]('\x22'+_0x806c4+'\x22');}}else{switch(_0x1d2b0e){case _0x8ddb('0x7d'):case _0x8ddb('0x11'):_0x29fd45['push'](_0x1d2b0e+_0x8ddb('0x7e'));break;default:_0x467289[_0x8ddb('0x1d')]('\x22\x22');}}}}else{var _0x451375='';if(!_[_0x8ddb('0x1b')](_0x372927)){if(!_0x3e86bf[_0x8ddb('0x7f')](_0x372927['id'])){for(var _0x1caee1=0x0;_0x1caee1<_0x5eb3cd[_0x1d2b0e][_0x8ddb('0x24')];_0x1caee1++){var _0x806c4=_[_0x8ddb('0x73')](_0x5026bb[_0x8ddb('0x71')][_0x2190de][_0x5eb3cd[_0x1d2b0e][_0x1caee1]][_0x8ddb('0x80')](/"/g,'\x27'));var _0x3b9c4e=phoneDescriptions[_0x8ddb('0x72')](_0x4fcbce=>_0x4fcbce[_0x8ddb('0x81')]===_0x372927['id']);if(!_['isNil'](_0x3b9c4e)){var _0x31e563=_[_0x8ddb('0x73')](_0x5026bb['data'][_0x2190de][_0x5eb3cd[_0x3b9c4e[_0x8ddb('0x82')]][0x0]][_0x8ddb('0x80')](/"/g,'\x27'));if(!_[_0x8ddb('0x1b')](_0x31e563))_0x806c4=_0x806c4+'§'+_0x31e563;}if(_0x451375=='')_0x451375=_0x806c4;else _0x451375+='|'+_0x806c4;}_0xc70f75[_0x8ddb('0x1d')](_0x372927['id']+':'+_0x451375);_0x3e86bf[_0x372927['id']]=0x1;}}}}if(hasAdditionalPhones){_0x467289[_0x8ddb('0x1d')]('\x22'+_0xc70f75[_0x8ddb('0x13')](';')+'\x22');}if(_0x29fd45[_0x8ddb('0x24')]){handleError(_0x5026bb[_0x8ddb('0x71')][_0x2190de],{'code':_0x8ddb('0x83'),'message':_0x29fd45['join']()});}else{fs[_0x8ddb('0x84')](_0x1320dc,_0x467289[_0x8ddb('0x13')]()+'\x0a');}_0x467289=[];}if(!(stats[_0x8ddb('0x6f')]%0xc8)){socket[_0x8ddb('0x85')](_0x8ddb('0x86')+_0x24953c,stats);stats[_0x8ddb('0x70')]=[];}}if(stopped){logger['info'](_0x8ddb('0x87'));_0x5a1b24['abort']();}}catch(_0x41f5f6){handleError(_0x5026bb[_0x8ddb('0x71')][_0x2190de],{'code':'SystemError','message':_0x41f5f6['message']});logger[_0x8ddb('0x21')](_0x8ddb('0x88'),_0x41f5f6[_0x8ddb('0x22')]);}},'complete':function(){try{var _0x1b59b5=[];var _0x2a6518=tempTableName;_0x1b59b5[_0x8ddb('0x1d')](_0x8ddb('0x89')+_0x2a6518+'\x20LIKE\x20cm_contacts;');logger[_0x8ddb('0x5e')]('CIS\x20len',contactItemTypes['length']);var _0x3948c8=util[_0x8ddb('0xb')](_0x8ddb('0x8a'),_0x1320dc,_0x2a6518,_0x586e77,_0x73e809[_0x8ddb('0x3a')],_0x73e809[_0x8ddb('0x8b')]||null,NOW,NOW);if(_[_0x8ddb('0x1b')](_0x5eb3cd[_0x8ddb('0x38')])){_0x3948c8+=',\x20scheduledAt\x20=\x20NOW()';}_0x1b59b5['push'](_0x3948c8);BPromise['each'](_0x1b59b5,handleQuery)[_0x8ddb('0x1f')](function(_0x230fbb){BPromise[_0x8ddb('0x1e')]([handleAdditionalPhones()])['then'](function(){_0x1b59b5=[];for(var _0x2d8669=0x0;_0x2d8669<promisesContact['length'];_0x2d8669++){_0x1b59b5[_0x8ddb('0x1d')](updateContact(promisesContact[_0x2d8669][_0x8ddb('0x8c')]));}BPromise[_0x8ddb('0x1e')](_0x1b59b5)[_0x8ddb('0x1f')](function(){_0x1b59b5=[];for(var _0x5f5b16=0x0;_0x5f5b16<promisesAdditionalPhones[_0x8ddb('0x24')];_0x5f5b16++){_0x1b59b5['push'](createAdditionalPhone(promisesAdditionalPhones[_0x5f5b16][_0x8ddb('0x8d')],promisesAdditionalPhones[_0x5f5b16][_0x8ddb('0x8e')],promisesAdditionalPhones[_0x5f5b16][_0x8ddb('0x11')],promisesAdditionalPhones[_0x5f5b16][_0x8ddb('0x8f')]));}BPromise[_0x8ddb('0x1e')](_0x1b59b5)[_0x8ddb('0x1f')](function(){_0x1b59b5=[];_0x1b59b5['push'](insertCmHopperAdditionalPhones(_0x73e809[_0x8ddb('0x3a')]));_0x1b59b5['push'](_0x8ddb('0x90')+_0x2a6518+';');BPromise[_0x8ddb('0x91')](_0x1b59b5,handleQuery)['then'](function(_0x431f65){stats[_0x8ddb('0x92')]=!![];stats[_0x8ddb('0x93')]=updatedRows;socket['emit'](_0x8ddb('0x86')+_0x24953c,stats);fs[_0x8ddb('0x94')](_0x1e15c3);fs[_0x8ddb('0x94')](_0x1320dc);process[_0x8ddb('0x5d')](0x0);})[_0x8ddb('0x20')](function(_0x537c65){logger['error'](_0x537c65[_0x8ddb('0x22')]);process[_0x8ddb('0x5d')](0x1);});});});});})['catch'](function(_0x43439e){logger['error'](_0x43439e[_0x8ddb('0x22')]);process[_0x8ddb('0x5d')](0x1);});}catch(_0x8cb018){logger[_0x8ddb('0x21')](_0x8ddb('0x95'),_0x8cb018[_0x8ddb('0x22')]);process['exit'](0x1);}},'error':function(_0x452c55,_0x488ee7,_0x9ce0f6,_0x1882ab){throw new Error(_0x1882ab);}});});}function validate(){if(process[_0x8ddb('0x96')]&&process[_0x8ddb('0x96')][_0x8ddb('0x24')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x3169f1=path[_0x8ddb('0x13')](config['root'],'server/files/tmp',process[_0x8ddb('0x96')][0x2]);if(!fs[_0x8ddb('0x97')](_0x3169f1)){throw new Error(_0x8ddb('0x98'));}var _0xe4d835={};try{_0xe4d835=JSON[_0x8ddb('0x6d')](process[_0x8ddb('0x96')][0x3]);if(!_0xe4d835[_0x8ddb('0x62')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x26d8c1=0x0;if(_0xe4d835[_0x8ddb('0x62')]['UserId']){_0x26d8c1=0x1;}if(!_0xe4d835['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x164bd1){throw new Error('body\x20id\x20mandatory');}var _0x3b6991=[];try{_0x3b6991=_[_0x8ddb('0x99')](JSON[_0x8ddb('0x6d')](process[_0x8ddb('0x96')][0x4]),'id');}catch(_0x3fc5b3){logger[_0x8ddb('0x5e')](_0x8ddb('0x9a'));}main(_0x3169f1,_0xe4d835,_0x3b6991,_0x26d8c1);}validate();process['on'](_0x8ddb('0x9b'),handleStop);process['on'](_0x8ddb('0x9c'),handleUncaughtException);
\ No newline at end of file
+var _0xabf9=['file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','isNil','AdditionalPhones','push','all','then','catch','message','split','CmContactHasItem','update','create','PHONE','inserted','CmHopper','cm_contacts.scheduledat','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','ListId','updatedAt','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','field','min_id','group','info','Received\x20SIGINT','error','errors','code','main','stringify','send','clone','socket_timestamp','server/files/tmp','.csv','body','ContactItemType','name','_description','header','parse','createReadStream','data','rows','find','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','orderBy','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync'];(function(_0x294421,_0x17d482){var _0x510cea=function(_0x36ad25){while(--_0x36ad25){_0x294421['push'](_0x294421['shift']());}};_0x510cea(++_0x17d482);}(_0xabf9,0x1e4));var _0x9abf=function(_0x3a4d04,_0x14f419){_0x3a4d04=_0x3a4d04-0x0;var _0x1a4249=_0xabf9[_0x3a4d04];return _0x1a4249;};'use strict';var fs=require('fs');var path=require(_0x9abf('0x0'));var _=require(_0x9abf('0x1'));var Papa=require(_0x9abf('0x2'));var util=require(_0x9abf('0x3'));var BPromise=require(_0x9abf('0x4'));var moment=require(_0x9abf('0x5'));var squel=require(_0x9abf('0x6'));var Redis=require(_0x9abf('0x7'));var db=require(_0x9abf('0x8'))['db'];var config=require(_0x9abf('0x9'));var logger=require(_0x9abf('0xa'))(_0x9abf('0xb'));config[_0x9abf('0xc')]=_[_0x9abf('0xd')](config[_0x9abf('0xc')],{'host':_0x9abf('0xe'),'port':0x18eb});var socket=require(_0x9abf('0xf'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x9abf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x9abf('0x11')+moment()[_0x9abf('0x10')](_0x9abf('0x12'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4adc94){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x9abf('0x13')](_0x4adc94);}function selectNotIn(_0x2cc0e,_0x2f4c97,_0x21fe89,_0x22a841,_0x1e2bc0){return squel[_0x9abf('0x14')]()['field'](_0x9abf('0x15'))[_0x9abf('0x16')](_0x22a841)[_0x9abf('0x17')](_0x2f4c97,null,_0x2f4c97+'.id\x20=\x20'+_0x22a841+'.'+_0x21fe89)[_0x9abf('0x18')](_0x22a841+'.'+_0x21fe89+_0x9abf('0x19')+_0x2cc0e+'.'+_0x21fe89)[_0x9abf('0x18')](_0x2f4c97+_0x9abf('0x1a')+_0x1e2bc0[_0x9abf('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1fdfbe,_0x56d795){promisesAdditionalPhones=[];promisesContact=[];return db[_0x9abf('0x1b')][_0x9abf('0x1c')]('select\x20*\x20from\x20'+tempTableName)[_0x9abf('0x1d')](function(_0x1f1eb9){if(_0x1f1eb9!==null){var _0x52c1b2=[];for(var _0x443762=0x0;_0x443762<_0x1f1eb9[_0x9abf('0x1e')];_0x443762++){var _0x8fb8a6=_0x1f1eb9[_0x443762];if(!_[_0x9abf('0x1f')](_0x8fb8a6[_0x9abf('0x15')])){if(!_['isNil'](_0x8fb8a6[_0x9abf('0x20')]))_0x52c1b2[_0x9abf('0x21')](insertAdditionalPhones(_0x8fb8a6));promisesContact['push']({'contact':_0x8fb8a6});}}}Promise[_0x9abf('0x22')](_0x52c1b2)[_0x9abf('0x23')](function(){_0x1fdfbe({'val':0x1});});})[_0x9abf('0x24')](function(_0x12855e){logger['error'](_0x12855e[_0x9abf('0x25')]);});});}function insertAdditionalPhones(_0x5ba4ab){return new Promise(function(_0x11e19e,_0x14e868){var _0x565901=_0x5ba4ab[_0x9abf('0x20')];if(_[_0x9abf('0x1f')](_0x565901))_0x14e868({'val':0x0});else{var _0x409515=_0x565901[_0x9abf('0x26')](';');var _0x409bd8=[];orderBy=0x0;for(var _0x55c919=0x0;_0x55c919<_0x409515['length'];_0x55c919++){_0x409bd8['push'](splitAdditionalPhone(_0x5ba4ab['id'],_0x409515[_0x55c919]));}Promise['all'](_0x409bd8)[_0x9abf('0x23')](function(){_0x11e19e({'val':_0x409515[_0x9abf('0x1e')]});});}});}function splitAdditionalPhone(_0x24c17e,_0x15a889){return new Promise(function(_0x35e6af,_0x11aed5){var _0x25ca7e=_0x15a889[_0x9abf('0x26')](':');var _0x2c8981=_0x25ca7e[0x0];var _0x49bec0=_0x25ca7e[0x1];if(_0x49bec0!==''){var _0xfe906e=_0x49bec0[_0x9abf('0x26')]('|');var _0x3009ce=[];for(var _0x17ffa3=0x0;_0x17ffa3<_0xfe906e[_0x9abf('0x1e')];_0x17ffa3++){if(_0xfe906e[_0x17ffa3]!==''){var _0x516e02=_['filter'](promisesAdditionalPhones,{'contactId':_0x24c17e,'phone':_0xfe906e[_0x17ffa3]});if(_0x516e02['length']==0x0){orderBy++;promisesAdditionalPhones[_0x9abf('0x21')]({'contactId':_0x24c17e,'contactTypeId':_0x2c8981,'phone':_0xfe906e[_0x17ffa3],'orderBy':orderBy});}}}_0x35e6af({'ok':0x1});}else _0x35e6af({'res':0x0});});}function createAdditionalPhone(_0x345586,_0x36ed61,_0x3468cc,_0x2fbb00){var _0xabbce8='';var _0x22a6bb='';var _0x5422af=_0x3468cc[_0x9abf('0x26')]('§');_0xabbce8=_0x5422af[0x0];if(_0x5422af[_0x9abf('0x1e')]==0x2)_0x22a6bb=_0x5422af[0x1];return new Promise(function(_0x5bbf3a,_0x537e73){return db[_0x9abf('0x27')]['findOne']({'where':{'CmContactId':_0x345586,'item':_0xabbce8}})[_0x9abf('0x23')](function(_0x127fd6){if(_0x127fd6){return db[_0x9abf('0x27')][_0x9abf('0x28')]({'ItemTypeId':_0x36ed61,'description':_0x22a6bb,'OrderBy':_0x2fbb00},{'where':{'CmContactId':_0x345586,'item':_0xabbce8}})[_0x9abf('0x23')](function(_0x9956c2){_0x5bbf3a({'res':'updated'});});}else{return db[_0x9abf('0x27')][_0x9abf('0x29')]({'CmContactId':_0x345586,'item':_0xabbce8,'ItemTypeId':_0x36ed61,'description':_0x22a6bb,'OrderBy':_0x2fbb00,'ItemClass':_0x9abf('0x2a')})[_0x9abf('0x23')](function(_0x18f90c){_0x5bbf3a({'res':_0x9abf('0x2b')});});}});});}function updateContact(_0x322717){return new Promise(function(_0x53af98,_0x390576){var _0x295cc2=_0x322717['id'];delete _0x322717['id'];return db['CmContact']['update'](_0x322717,{'where':{'id':_0x295cc2}})[_0x9abf('0x23')](function(_0xbf0d8f){updatedRows+=0x1;return db[_0x9abf('0x2c')][_0x9abf('0x28')]({'phone':_0x322717[_0x9abf('0x15')]},{'where':{'ContactId':_0x295cc2}})['then'](function(_0x2a3a62){_0x53af98({'ret':'OK'});});});});}function insertCmHopper(_0x5b1b63,_0x4d41d9,_0xb01ec7,_0x1a350f,_0x3badfc){var _0x1571ac=['cm_contacts.phone',_0x9abf('0x2d'),'cm_contacts.id','cm_contacts.ListId',_0x4d41d9+'.'+_0x1a350f,'cm_contacts.createdAt',_0x9abf('0x2e'),_0x9abf('0x2f'),_0x9abf('0x30'),'\x22'+_0x3badfc+'\x22'];return squel[_0x9abf('0x31')]()[_0x9abf('0x32')](_0x9abf('0x33'))[_0x9abf('0x34')]([_0x9abf('0x15'),_0x9abf('0x35'),_0x9abf('0x36'),'ListId',_0x1a350f,_0x9abf('0x37'),'updatedAt',_0x9abf('0x38'),_0x9abf('0x39'),_0x9abf('0x3a')],squel['select']()[_0x9abf('0x3b')](_0x1571ac)[_0x9abf('0x16')](_0x4d41d9)['join'](_0x9abf('0x3c'),null,_0x9abf('0x3d')+_0x4d41d9+'.CmListId')['join'](_0xb01ec7,null,_0xb01ec7+_0x9abf('0x3e')+_0x4d41d9+'.'+_0x1a350f)[_0x9abf('0x18')](_0x4d41d9+_0x9abf('0x3f'),_0x5b1b63)[_0x9abf('0x18')](_0x9abf('0x40'),NOW)[_0x9abf('0x18')](_0x9abf('0x41'),selectNotIn(_0x4d41d9,_0xb01ec7,_0x1a350f,'cm_hopper',[_0x9abf('0x42'),_0x9abf('0x43')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4d41d9,_0xb01ec7,_0x1a350f,'cm_hopper',[_0x9abf('0x42')])))[_0x9abf('0x44')]();}function insertCmHopperBlack(_0x4b54c2,_0x52580e,_0x202bd1,_0x49e4ae){var _0x1803ba=[_0x9abf('0x45'),_0x9abf('0x46'),_0x9abf('0x47'),_0x52580e+'.'+_0x49e4ae,_0x9abf('0x48'),_0x9abf('0x2e')];return squel[_0x9abf('0x31')]()[_0x9abf('0x32')]('cm_hopper_black')[_0x9abf('0x34')]([_0x9abf('0x15'),_0x9abf('0x36'),_0x9abf('0x49'),_0x49e4ae,_0x9abf('0x37'),_0x9abf('0x4a')],squel[_0x9abf('0x14')]()['fields'](_0x1803ba)[_0x9abf('0x16')](_0x52580e)[_0x9abf('0x17')](_0x9abf('0x3c'),null,_0x9abf('0x3d')+_0x52580e+'.CmListId')[_0x9abf('0x17')](_0x202bd1,null,_0x202bd1+'.id\x20=\x20'+_0x52580e+'.'+_0x49e4ae)['where'](_0x52580e+'.CmListId\x20=\x20?',_0x4b54c2)[_0x9abf('0x18')](_0x9abf('0x40'),NOW)['where'](_0x9abf('0x41'),squel[_0x9abf('0x14')]()['field'](_0x9abf('0x15'))['from'](_0x9abf('0x4b'))[_0x9abf('0x18')](_0x9abf('0x4c'),_0x4b54c2)[_0x9abf('0x18')](_0x49e4ae+_0x9abf('0x4d'),_0x52580e+'.'+_0x49e4ae)))[_0x9abf('0x44')]();}function insertCmHopperAdditionalPhones(_0x5eb776){var _0x58c256=[_0x9abf('0x4e'),'cm_contact_has_items.item',_0x9abf('0x4f'),_0x9abf('0x50'),_0x9abf('0x51')];return squel[_0x9abf('0x31')]()[_0x9abf('0x32')]('cm_hopper_additional_phones')[_0x9abf('0x34')](['CmHopperId',_0x9abf('0x15'),_0x9abf('0x52'),'createdAt',_0x9abf('0x4a')],squel['select']()['fields'](_0x58c256)['from'](_0x9abf('0x33'))[_0x9abf('0x17')]('cm_contacts',null,_0x9abf('0x53'))[_0x9abf('0x17')](_0x9abf('0x54'),null,_0x9abf('0x55'))[_0x9abf('0x18')](_0x9abf('0x56'),_0x5eb776)[_0x9abf('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x9abf('0x44')]();}function insertCmContact(_0x12978e,_0x1e7c5d,_0x39daf8,_0x206baf){var _0xa4f022=_['concat'](_[_0x9abf('0x57')](_0x206baf),[_0x9abf('0x49'),_0x9abf('0x58'),_0x9abf('0x37'),_0x9abf('0x4a')]);return squel['insert']()[_0x9abf('0x32')](_0x9abf('0x3c'))[_0x9abf('0x34')](_0xa4f022,squel['select']()[_0x9abf('0x3b')](_0xa4f022)['from'](_0x1e7c5d)[_0x9abf('0x18')]('('+_0x39daf8[_0x9abf('0x17')](',')+_0x9abf('0x59'),squel[_0x9abf('0x14')]()['fields'](_0x39daf8)['from'](_0x9abf('0x3c'))[_0x9abf('0x18')](_0x9abf('0x4c'),_0x12978e))[_0x9abf('0x18')]('id\x20IN\x20?',squel[_0x9abf('0x14')]()[_0x9abf('0x5a')]('MIN(id)',_0x9abf('0x5b'))[_0x9abf('0x16')](_0x1e7c5d)[_0x9abf('0x5c')](_0x39daf8[_0x9abf('0x17')](','))))[_0x9abf('0x44')]();}function handleStop(){logger[_0x9abf('0x5d')](_0x9abf('0x5e'));stopped=!![];}function handleUncaughtException(_0x5d48b5){logger[_0x9abf('0x5f')](_0x5d48b5[_0x9abf('0x25')]);process['exit'](0x1);}function handleError(_0x2f141f,_0xf6f7d0){stats[_0x9abf('0x60')][_0x9abf('0x21')]({'name':_0xf6f7d0[_0x9abf('0x61')],'message':_0xf6f7d0[_0x9abf('0x25')],'row':_0x2f141f});}function handleQuery(_0x918c23){logger[_0x9abf('0x5d')](_0x918c23);return db['sequelize'][_0x9abf('0x1c')](_0x918c23)['spread'](function(_0x265281){results[_0x9abf('0x21')](_0x265281);})['catch'](function(_0x47affe){logger[_0x9abf('0x5f')](_0x47affe[_0x9abf('0x25')]);});}function main(_0x3fbfb6,_0x19471c,_0x3c375b,_0x3e8563){logger[_0x9abf('0x5d')](_0x9abf('0x62'),_0x3fbfb6,JSON[_0x9abf('0x63')](_0x19471c));process[_0x9abf('0x64')]('start');var _0x1f13a8=_0x19471c['binding'];var _0x21c5ba=_[_0x9abf('0x65')](_0x1f13a8);var _0x3704bc=_0x19471c[_0x9abf('0x66')];var _0x11f7a6=path[_0x9abf('0x17')](config['root'],_0x9abf('0x67'),_0x3704bc+_0x9abf('0x68'));logger['info'](_0x9abf('0x69'),_0x19471c);db[_0x9abf('0x6a')]['findAll']({'raw':!![],'attributes':['id',_0x9abf('0x6b')]})['then'](function(_0x12736a){for(var _0x362d4d=0x0;_0x362d4d<_0x12736a['length'];_0x362d4d++){if(_0x12736a[_0x362d4d][_0x9abf('0x6b')]in _0x1f13a8){contactItemTypes['push'](_0x12736a[_0x362d4d]);delete _0x21c5ba[_0x12736a[_0x362d4d][_0x9abf('0x6b')]];hasAdditionalPhones=!![];}for(var _0x586ea1 in _0x1f13a8){if(_0x12736a[_0x362d4d]['name']+_0x9abf('0x6c')===_0x586ea1){phoneDescriptions[_0x9abf('0x21')]({'itemTypeId':_0x12736a[_0x362d4d]['id'],'description':_0x586ea1});delete _0x21c5ba[_0x586ea1];}}}if(hasAdditionalPhones)_0x21c5ba['AdditionalPhones']='';var _0x552c67=_['keys'](_0x21c5ba)['join']();logger['info'](_0x9abf('0x6d'),_0x552c67);fs['writeFileSync'](_0x11f7a6,_0x552c67+'\x0a');Papa[_0x9abf('0x6e')](fs[_0x9abf('0x6f')](_0x3fbfb6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4c8ddb,_0x4b37be){try{for(var _0x15de45=0x0,_0x226dc1=[];_0x15de45<_0x4c8ddb[_0x9abf('0x70')][_0x9abf('0x1e')];_0x15de45++){stats[_0x9abf('0x71')]+=0x1;if(_0x4c8ddb['errors'][_0x15de45]){handleError(_0x4c8ddb[_0x9abf('0x70')][_0x15de45],_0x4c8ddb[_0x9abf('0x60')][_0x15de45]);}else{var _0x348644=[];var _0x21bd47=[];var _0x2ec249={};for(var _0x44d536 in _0x1f13a8){let _0x25500a=contactItemTypes[_0x9abf('0x72')](_0x202309=>_0x202309[_0x9abf('0x6b')]===_0x44d536);let _0x479de5=contactItemTypes[_0x9abf('0x72')](_0x487ced=>_0x487ced[_0x9abf('0x6b')]+_0x9abf('0x6c')===_0x44d536);if(_[_0x9abf('0x1f')](_0x25500a)&&_['isNil'](_0x479de5)){if(_0x1f13a8[_0x9abf('0x73')](_0x44d536)){if(_0x4c8ddb[_0x9abf('0x70')][_0x15de45][_0x1f13a8[_0x44d536]]){var _0x2d6074=_[_0x9abf('0x74')](_0x4c8ddb['data'][_0x15de45][_0x1f13a8[_0x44d536]]['replace'](/"/g,'\x27'));switch(_0x44d536){case _0x9abf('0x35'):var _0x596b2d=moment(_0x2d6074,_0x9abf('0x75'),!![]);if(_0x596b2d[_0x9abf('0x76')]()){_0x226dc1[_0x9abf('0x21')]('\x22'+_0x2d6074+'\x22');}else{_0x348644['push'](_0x9abf('0x77'));}break;case _0x9abf('0x38'):var _0xbdda09=parseInt(_0x2d6074);_0x2d6074=_[_0x9abf('0x78')](_0xbdda09)||_0xbdda09<0x0||_0xbdda09>0x4?_0x3e8563?0x3:0x2:_0xbdda09;_0x226dc1[_0x9abf('0x21')]('\x22'+_0x2d6074+'\x22');break;case _0x9abf('0x39'):var _0x1df7da=parseInt(_0x2d6074);if(_[_0x9abf('0x79')](_0x1df7da)&&_[_0x9abf('0x7a')](_0x3c375b,_0x1df7da)){_0x226dc1[_0x9abf('0x21')]('\x22'+_0x1df7da+'\x22');}else{_0x348644['push']('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x2d6074)){_0x226dc1[_0x9abf('0x21')]('\x22'+_0x2d6074+'\x22');}else{_0x348644[_0x9abf('0x21')](_0x9abf('0x7b'));}break;case _0x9abf('0x7c'):var _0x27f407=moment(_0x2d6074,_0x9abf('0x7d'),!![]);if(_0x27f407[_0x9abf('0x76')]()){_0x226dc1[_0x9abf('0x21')]('\x22'+_0x2d6074+'\x22');}else{_0x348644[_0x9abf('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x226dc1[_0x9abf('0x21')]('\x22'+_0x2d6074+'\x22');}}else{switch(_0x44d536){case _0x9abf('0x7e'):case _0x9abf('0x15'):_0x348644[_0x9abf('0x21')](_0x44d536+_0x9abf('0x7f'));break;default:_0x226dc1[_0x9abf('0x21')]('\x22\x22');}}}}else{var _0x4e3cdf='';if(!_[_0x9abf('0x1f')](_0x25500a)){if(!_0x2ec249[_0x9abf('0x73')](_0x25500a['id'])){for(var _0x1429b3=0x0;_0x1429b3<_0x1f13a8[_0x44d536]['length'];_0x1429b3++){var _0x2d6074=_['trim'](_0x4c8ddb[_0x9abf('0x70')][_0x15de45][_0x1f13a8[_0x44d536][_0x1429b3]][_0x9abf('0x80')](/"/g,'\x27'));var _0x4bcfb8=phoneDescriptions[_0x9abf('0x72')](_0x120866=>_0x120866['itemTypeId']===_0x25500a['id']);if(!_[_0x9abf('0x1f')](_0x4bcfb8)){var _0x5dcc1e=_['trim'](_0x4c8ddb[_0x9abf('0x70')][_0x15de45][_0x1f13a8[_0x4bcfb8['description']][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x9abf('0x1f')](_0x5dcc1e))_0x2d6074=_0x2d6074+'§'+_0x5dcc1e;}if(_0x4e3cdf=='')_0x4e3cdf=_0x2d6074;else _0x4e3cdf+='|'+_0x2d6074;}_0x21bd47['push'](_0x25500a['id']+':'+_0x4e3cdf);_0x2ec249[_0x25500a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x226dc1[_0x9abf('0x21')]('\x22'+_0x21bd47[_0x9abf('0x17')](';')+'\x22');}if(_0x348644['length']){handleError(_0x4c8ddb[_0x9abf('0x70')][_0x15de45],{'code':_0x9abf('0x81'),'message':_0x348644[_0x9abf('0x17')]()});}else{fs[_0x9abf('0x82')](_0x11f7a6,_0x226dc1[_0x9abf('0x17')]()+'\x0a');}_0x226dc1=[];}if(!(stats[_0x9abf('0x71')]%0xc8)){socket[_0x9abf('0x83')](_0x9abf('0x84')+_0x3704bc,stats);stats[_0x9abf('0x60')]=[];}}if(stopped){logger[_0x9abf('0x5d')](_0x9abf('0x85'));_0x4b37be[_0x9abf('0x86')]();}}catch(_0x2e17a9){handleError(_0x4c8ddb['data'][_0x15de45],{'code':_0x9abf('0x87'),'message':_0x2e17a9['message']});logger['error'](_0x9abf('0x88'),_0x2e17a9[_0x9abf('0x25')]);}},'complete':function(){try{var _0x46b7b4=[];var _0x5dd86d=tempTableName;_0x46b7b4[_0x9abf('0x21')]('CREATE\x20TABLE\x20'+_0x5dd86d+'\x20LIKE\x20cm_contacts;');logger[_0x9abf('0x5d')](_0x9abf('0x89'),contactItemTypes[_0x9abf('0x1e')]);var _0x47b2d=util['format'](_0x9abf('0x8a'),_0x11f7a6,_0x5dd86d,_0x552c67,_0x19471c[_0x9abf('0x49')],_0x19471c[_0x9abf('0x58')]||null,NOW,NOW);if(_[_0x9abf('0x1f')](_0x1f13a8[_0x9abf('0x35')])){_0x47b2d+=_0x9abf('0x8b');}_0x46b7b4[_0x9abf('0x21')](_0x47b2d);BPromise[_0x9abf('0x8c')](_0x46b7b4,handleQuery)['then'](function(_0x14d9a3){BPromise[_0x9abf('0x22')]([handleAdditionalPhones()])[_0x9abf('0x23')](function(){_0x46b7b4=[];for(var _0x23aa47=0x0;_0x23aa47<promisesContact[_0x9abf('0x1e')];_0x23aa47++){_0x46b7b4['push'](updateContact(promisesContact[_0x23aa47][_0x9abf('0x8d')]));}BPromise['all'](_0x46b7b4)[_0x9abf('0x23')](function(){_0x46b7b4=[];for(var _0x4a67b1=0x0;_0x4a67b1<promisesAdditionalPhones[_0x9abf('0x1e')];_0x4a67b1++){_0x46b7b4['push'](createAdditionalPhone(promisesAdditionalPhones[_0x4a67b1][_0x9abf('0x8e')],promisesAdditionalPhones[_0x4a67b1]['contactTypeId'],promisesAdditionalPhones[_0x4a67b1][_0x9abf('0x15')],promisesAdditionalPhones[_0x4a67b1][_0x9abf('0x8f')]));}BPromise[_0x9abf('0x22')](_0x46b7b4)[_0x9abf('0x23')](function(){_0x46b7b4=[];_0x46b7b4[_0x9abf('0x21')](insertCmHopperAdditionalPhones(_0x19471c[_0x9abf('0x49')]));_0x46b7b4[_0x9abf('0x21')]('DROP\x20TABLE\x20'+_0x5dd86d+';');BPromise[_0x9abf('0x8c')](_0x46b7b4,handleQuery)[_0x9abf('0x23')](function(_0x54ed61){stats[_0x9abf('0x90')]=!![];stats[_0x9abf('0x91')]=updatedRows;socket[_0x9abf('0x83')](_0x9abf('0x84')+_0x3704bc,stats);fs[_0x9abf('0x92')](_0x3fbfb6);fs[_0x9abf('0x92')](_0x11f7a6);process['exit'](0x0);})['catch'](function(_0x13b8c3){logger[_0x9abf('0x5f')](_0x13b8c3[_0x9abf('0x25')]);process['exit'](0x1);});});});});})[_0x9abf('0x24')](function(_0xe0470d){logger[_0x9abf('0x5f')](_0xe0470d[_0x9abf('0x25')]);process['exit'](0x1);});}catch(_0x3c554d){logger[_0x9abf('0x5f')](_0x9abf('0x93'),_0x3c554d[_0x9abf('0x25')]);process['exit'](0x1);}},'error':function(_0x59377a,_0x11eadd,_0x239d90,_0x40789f){throw new Error(_0x40789f);}});});}function validate(){if(process[_0x9abf('0x94')]&&process[_0x9abf('0x94')][_0x9abf('0x1e')]<0x4){throw new Error(_0x9abf('0x95'));}var _0x513972=path[_0x9abf('0x17')](config[_0x9abf('0x96')],'server/files/tmp',process[_0x9abf('0x94')][0x2]);if(!fs[_0x9abf('0x97')](_0x513972)){throw new Error(_0x9abf('0x98'));}var _0x4be7ed={};try{_0x4be7ed=JSON[_0x9abf('0x6e')](process[_0x9abf('0x94')][0x3]);if(!_0x4be7ed['binding']){throw new Error(_0x9abf('0x99'));}var _0x35ddc4=0x0;if(_0x4be7ed[_0x9abf('0x9a')][_0x9abf('0x39')]){_0x35ddc4=0x1;}if(!_0x4be7ed[_0x9abf('0x49')]){throw new Error(_0x9abf('0x9b'));}}catch(_0x1d1d63){throw new Error('body\x20id\x20mandatory');}var _0x363a04=[];try{_0x363a04=_[_0x9abf('0x9c')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x19303a){logger[_0x9abf('0x5d')](_0x9abf('0x9d'));}main(_0x513972,_0x4be7ed,_0x363a04,_0x35ddc4);}validate();process['on'](_0x9abf('0x9e'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x883a=['billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call','***\x20Call\x20Info\x20***','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','keyValue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','destcalleridnum','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x883a,0x88));var _0xa883=function(_0xc579db,_0x445118){_0xc579db=_0xc579db-0x0;var _0x1f3f28=_0x883a[_0xc579db];return _0x1f3f28;};'use strict';exports[_0xa883('0x0')]=function(_0x42a7ea,_0x5c8e63){var _0x5492b6=[{'type':_0xa883('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x42a7ea[_0xa883('0x2')]()){case _0xa883('0x3'):switch(_0x5c8e63[_0xa883('0x2')]()){case _0xa883('0x4'):_0x5492b6[_0xa883('0x5')]({'type':'variable','content':'','variableName':_0xa883('0x6')});_0x5492b6[_0xa883('0x5')]({'type':_0xa883('0x7'),'content':'','variableName':_0xa883('0x8')});break;case _0xa883('0x9'):_0x5492b6[_0xa883('0x5')]({'type':_0xa883('0x1'),'content':_0xa883('0xa'),'variableName':null});_0x5492b6[_0xa883('0x5')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x5492b6;};exports['getDescriptions']=function(_0x1c8ad7,_0x2a9dde){var _0x5779f3=[];switch(_0x1c8ad7['toLowerCase']()){case _0xa883('0x3'):switch(_0x2a9dde[_0xa883('0x2')]()){case _0xa883('0x4'):_0x5779f3=[{'type':_0xa883('0x1'),'content':_0xa883('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa883('0xc'),'keyType':'variable','variableName':_0xa883('0x8')},{'type':'keyValue','content':'','key':_0xa883('0xd'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0xe')},{'type':'keyValue','content':'','key':_0xa883('0xf'),'keyType':'variable','variableName':_0xa883('0x10')},{'type':'keyValue','content':'','key':_0xa883('0x11'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x6')},{'type':'keyValue','content':'','key':_0xa883('0x12'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x13')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x15'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x16')},{'type':_0xa883('0x1'),'content':_0xa883('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa883('0x14'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0xa883('0x18')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0xa883('0x7'),'variableName':'destcalleridnum'},{'type':_0xa883('0x1'),'content':_0xa883('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa883('0x1a'),'keyType':'variable','variableName':_0xa883('0x16')},{'type':'keyValue','content':'','key':_0xa883('0x1b'),'keyType':_0xa883('0x7'),'variableName':'agentconnectAt'},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x1c'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x1d')},{'type':'keyValue','content':'','key':_0xa883('0x1e'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x1f')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x20'),'keyType':_0xa883('0x7'),'variableName':_0xa883('0x21')}];break;case'outbound':_0x5779f3=[{'type':_0xa883('0x1'),'content':_0xa883('0xb'),'variableName':null},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x22'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x23')},{'type':_0xa883('0x14'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0xa883('0x24')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x12'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x13')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x15'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x25')},{'type':_0xa883('0x1'),'content':_0xa883('0x19')},{'type':'keyValue','content':'','key':_0xa883('0x26'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x27')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x28'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x29')},{'type':_0xa883('0x14'),'content':'','key':_0xa883('0x2a'),'keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x2b')},{'type':_0xa883('0x14'),'content':'','key':'Billable\x20Time','keyType':_0xa883('0x7'),'keyContent':'','variableName':_0xa883('0x2c')}];break;}}return _0x5779f3;};
\ No newline at end of file
+var _0x2848=['Queue','UniqueId','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','Hold\x20Time','Talk\x20Time','Called\x20Number','Member\x20Name','uniqueid','starttime','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','destexten'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x2848,0xf8));var _0x8284=function(_0xd573b6,_0xdec08c){_0xd573b6=_0xd573b6-0x0;var _0x1dbe9a=_0x2848[_0xd573b6];return _0x1dbe9a;};'use strict';exports[_0x8284('0x0')]=function(_0x79ce5d,_0x3a8f6b){var _0x54f879=[{'type':_0x8284('0x1'),'content':_0x8284('0x2'),'variableName':null}];switch(_0x79ce5d[_0x8284('0x3')]()){case'voice':switch(_0x3a8f6b[_0x8284('0x3')]()){case _0x8284('0x4'):_0x54f879[_0x8284('0x5')]({'type':'variable','content':'','variableName':_0x8284('0x6')});_0x54f879[_0x8284('0x5')]({'type':_0x8284('0x7'),'content':'','variableName':_0x8284('0x8')});break;case _0x8284('0x9'):_0x54f879[_0x8284('0x5')]({'type':'string','content':_0x8284('0xa'),'variableName':null});_0x54f879[_0x8284('0x5')]({'type':_0x8284('0x7'),'content':'','variableName':_0x8284('0xb')});break;}}return _0x54f879;};exports[_0x8284('0xc')]=function(_0x6e01b7,_0x2ddcbc){var _0x55f6f4=[];switch(_0x6e01b7[_0x8284('0x3')]()){case'voice':switch(_0x2ddcbc['toLowerCase']()){case _0x8284('0x4'):_0x55f6f4=[{'type':_0x8284('0x1'),'content':_0x8284('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0xf'),'keyType':_0x8284('0x7'),'variableName':'calleridnum'},{'type':_0x8284('0xe'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0x8284('0x10')},{'type':_0x8284('0xe'),'content':'','key':'Call\x20To','keyType':_0x8284('0x7'),'variableName':_0x8284('0x11')},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x12'),'keyType':'variable','variableName':_0x8284('0x6')},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x13'),'keyType':_0x8284('0x7'),'variableName':'uniqueid'},{'type':_0x8284('0xe'),'content':'','key':'Date','keyType':_0x8284('0x7'),'variableName':'agentcalledAt'},{'type':_0x8284('0x1'),'content':_0x8284('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x15'),'keyType':'variable','variableName':_0x8284('0x16')},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x17'),'keyType':_0x8284('0x7'),'variableName':_0x8284('0xb')},{'type':_0x8284('0x1'),'content':_0x8284('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x8284('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x8284('0x7'),'variableName':_0x8284('0x19')},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x1a'),'keyType':_0x8284('0x7'),'variableName':'agentconnectAt'},{'type':_0x8284('0xe'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':'agentcompleteAt'},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x1b'),'keyType':_0x8284('0x7'),'variableName':'holdtime'},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x1c'),'keyType':_0x8284('0x7'),'variableName':'talktime'}];break;case _0x8284('0x9'):_0x55f6f4=[{'type':_0x8284('0x1'),'content':_0x8284('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0x8284('0x1d'),'keyType':_0x8284('0x7'),'keyContent':'','variableName':_0x8284('0xb')},{'type':_0x8284('0xe'),'content':'','key':_0x8284('0x1e'),'keyType':_0x8284('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x8284('0xe'),'content':'','key':'UniqueId','keyType':_0x8284('0x7'),'keyContent':'','variableName':_0x8284('0x1f')},{'type':_0x8284('0xe'),'content':'','key':'Date','keyType':_0x8284('0x7'),'keyContent':'','variableName':_0x8284('0x20')},{'type':_0x8284('0x1'),'content':_0x8284('0x18')},{'type':_0x8284('0xe'),'content':'','key':'Answer\x20Time','keyType':_0x8284('0x7'),'keyContent':'','variableName':_0x8284('0x21')},{'type':'keyValue','content':'','key':_0x8284('0x22'),'keyType':'variable','keyContent':'','variableName':_0x8284('0x23')},{'type':_0x8284('0xe'),'content':'','key':'Duration','keyType':_0x8284('0x7'),'keyContent':'','variableName':_0x8284('0x24')},{'type':'keyValue','content':'','key':_0x8284('0x25'),'keyType':_0x8284('0x7'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x55f6f4;};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe6ee=['length','having','clause','order','forEach','contactName','getClosedOrderClause','getFilteredInteractions','catch','tracked','query','clone','omit','phone','updateUser','lodash','./sql-utils','./utils','findAll','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact','default','fields','user','tags','checkAccountsRestrictions','group','ids','count'];(function(_0x105f15,_0x39d8da){var _0xe08e21=function(_0x10dc14){while(--_0x10dc14){_0x105f15['push'](_0x105f15['shift']());}};_0xe08e21(++_0x39d8da);}(_0xe6ee,0x153));var _0xee6e=function(_0x1a5220,_0x329db5){_0x1a5220=_0x1a5220-0x0;var _0x1a1a1a=_0xe6ee[_0x1a5220];return _0x1a1a1a;};'use strict';var _=require(_0xee6e('0x0'));var sqlUtils=require(_0xee6e('0x1'));var utils=require(_0xee6e('0x2'));exports[_0xee6e('0x3')]=function(_0x3d02c8,_0x120598,_0x57ecfd,_0xb852af,_0x3759c3){var _0x4e60d6={'count':0x0,'rows':[]};var _0x12621d=sqlUtils['skipInteractionsQuery'](_0x3d02c8,_0x57ecfd,_0x120598);if(_0x12621d){return Promise[_0xee6e('0x4')](_0x4e60d6);}var _0x51beb3=sqlUtils[_0xee6e('0x5')](_0x3d02c8);var _0x3c68c3={};return Promise[_0xee6e('0x4')]()[_0xee6e('0x6')](function(){if(_0x120598[_0xee6e('0x7')]){return sqlUtils[_0xee6e('0x8')](_0x120598['search'],_0x3759c3);}else{return sqlUtils[_0xee6e('0x9')](_0x3d02c8,_0x120598,_0x3759c3);}})[_0xee6e('0x6')](function(_0x38d994){_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xb')]);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xc')]);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xd')]);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xe')]);_0x51beb3[_0xee6e('0xa')](_0x38d994['filter']);_0x51beb3[_0xee6e('0xa')](_0x38d994[_0xee6e('0xf')]);_0x51beb3['having'](_0x38d994['read']);_0x3c68c3=_0x38d994[_0xee6e('0x10')];return sqlUtils[_0xee6e('0x11')](_0x3d02c8,_0x57ecfd,_0x120598);})[_0xee6e('0x6')](function(_0x550246){_0x51beb3['where'](_0x550246);_0x51beb3[_0xee6e('0x12')]('i.id');var _0x314f4c=_0x120598[_0xee6e('0x7')]?_0x3c68c3[_0xee6e('0x13')]:_0x120598['tag'];return sqlUtils['countFilteredInteractions'](_0x51beb3,_0x314f4c);})['then'](function(_0x52c546){_0x4e60d6[_0xee6e('0x14')]=_0x52c546[_0xee6e('0x15')];if(_0x4e60d6[_0xee6e('0x14')]===0x0){return[];}_0x51beb3[_0xee6e('0x16')](_0x3c68c3[_0xee6e('0x17')]);if(_0xb852af['order']){_0xb852af[_0xee6e('0x18')][_0xee6e('0x19')](function(_0x4d3d74){var _0x5c6daa=_0x4d3d74[0x0]===_0xee6e('0x1a')?_0x4d3d74[0x0]:'i.'+_0x4d3d74[0x0];_0x51beb3['order'](_0x5c6daa,_0x4d3d74[0x1]==='DESC'?![]:!![]);if(_0x4d3d74[0x0]==='closed'){var _0x19380c=sqlUtils[_0xee6e('0x1b')](_0x3d02c8,_0x120598);_0x51beb3[_0xee6e('0x18')](_0x19380c,_0x4d3d74[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0xee6e('0x1c')](_0x3d02c8,_0x51beb3,_0x120598,_0xb852af);})[_0xee6e('0x6')](function(_0x3b624e){_0x4e60d6['rows']=_0x3b624e;return _0x4e60d6;})[_0xee6e('0x1d')](function(_0x101f15){throw _0x101f15;});};exports[_0xee6e('0x1e')]=function(_0xce0676,_0x3f4821){return function(_0x24a8ab,_0x31ecee,_0x461249){var _0x55b809=_0x24a8ab['user'];var _0x10bcde={};var _0x27b8e4=_0x24a8ab[_0xee6e('0x1f')];if(_0x10bcde){_0x10bcde=_[_0xee6e('0x20')](_0x24a8ab[_0xee6e('0xb')]);_0x10bcde=_[_0xee6e('0x21')](_0x10bcde,[_0xee6e('0xb'),'html',_0xee6e('0x22'),'fax','mobile']);}utils[_0xee6e('0x23')](_0x55b809,_0x10bcde,_0x27b8e4,_0xce0676,_0x3f4821);_0x461249(null);};};
\ No newline at end of file
+var _0x333e=['body','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','catch','tracked','query','clone','omit','phone','fax','mobile','updateUser','lodash','./sql-utils','findAll','skipInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where'];(function(_0x4dbcdc,_0x1e1153){var _0x2fff22=function(_0x11f9a8){while(--_0x11f9a8){_0x4dbcdc['push'](_0x4dbcdc['shift']());}};_0x2fff22(++_0x1e1153);}(_0x333e,0x14f));var _0xe333=function(_0x38efe1,_0x34a883){_0x38efe1=_0x38efe1-0x0;var _0x44c9fb=_0x333e[_0x38efe1];return _0x44c9fb;};'use strict';var _=require(_0xe333('0x0'));var sqlUtils=require(_0xe333('0x1'));var utils=require('./utils');exports[_0xe333('0x2')]=function(_0x45a991,_0x259306,_0x46ff00,_0x1db935,_0x30dd36){var _0x25fa75={'count':0x0,'rows':[]};var _0x53ea6c=sqlUtils[_0xe333('0x3')](_0x45a991,_0x46ff00,_0x259306);if(_0x53ea6c){return Promise['resolve'](_0x25fa75);}var _0xac55d1=sqlUtils['getInteractionsQuery'](_0x45a991);var _0x20abd4={};return Promise['resolve']()[_0xe333('0x4')](function(){if(_0x259306[_0xe333('0x5')]){return sqlUtils[_0xe333('0x6')](_0x259306[_0xe333('0x5')],_0x30dd36);}else{return sqlUtils[_0xe333('0x7')](_0x45a991,_0x259306,_0x30dd36);}})[_0xe333('0x4')](function(_0x5dddf0){_0xac55d1[_0xe333('0x8')](_0x5dddf0[_0xe333('0x9')]);_0xac55d1[_0xe333('0x8')](_0x5dddf0[_0xe333('0xa')]);_0xac55d1['where'](_0x5dddf0[_0xe333('0xb')]);_0xac55d1[_0xe333('0x8')](_0x5dddf0[_0xe333('0xc')]);_0xac55d1[_0xe333('0x8')](_0x5dddf0[_0xe333('0xd')]);_0xac55d1[_0xe333('0x8')](_0x5dddf0[_0xe333('0xe')]);_0xac55d1[_0xe333('0xf')](_0x5dddf0[_0xe333('0x10')]);_0x20abd4=_0x5dddf0[_0xe333('0x11')];return sqlUtils[_0xe333('0x12')](_0x45a991,_0x46ff00,_0x259306);})[_0xe333('0x4')](function(_0x2643f1){_0xac55d1[_0xe333('0x8')](_0x2643f1);_0xac55d1[_0xe333('0x13')](_0xe333('0x14'));var _0xd4290f=_0x259306[_0xe333('0x5')]?_0x20abd4[_0xe333('0x15')]:_0x259306[_0xe333('0x16')];return sqlUtils[_0xe333('0x17')](_0xac55d1,_0xd4290f);})[_0xe333('0x4')](function(_0x22357d){_0x25fa75[_0xe333('0x18')]=_0x22357d[_0xe333('0x19')];if(_0x25fa75[_0xe333('0x18')]===0x0){return[];}_0xac55d1['having'](_0x20abd4[_0xe333('0x1a')]);if(_0x1db935[_0xe333('0x1b')]){_0x1db935[_0xe333('0x1b')][_0xe333('0x1c')](function(_0x1b236d){var _0x481e90=_0x1b236d[0x0]===_0xe333('0x1d')?_0x1b236d[0x0]:'i.'+_0x1b236d[0x0];_0xac55d1[_0xe333('0x1b')](_0x481e90,_0x1b236d[0x1]===_0xe333('0x1e')?![]:!![]);if(_0x1b236d[0x0]===_0xe333('0x1f')){var _0x3f6abc=sqlUtils[_0xe333('0x20')](_0x45a991,_0x259306);_0xac55d1[_0xe333('0x1b')](_0x3f6abc,_0x1b236d[0x1]===_0xe333('0x1e')?![]:!![]);}});}return sqlUtils[_0xe333('0x21')](_0x45a991,_0xac55d1,_0x259306,_0x1db935);})['then'](function(_0x38a5b2){_0x25fa75['rows']=_0x38a5b2;return _0x25fa75;})[_0xe333('0x22')](function(_0x29972e){throw _0x29972e;});};exports[_0xe333('0x23')]=function(_0x41a208,_0x14b6b4){return function(_0x395886,_0x3cbf96,_0x5c0dcc){var _0x344d42=_0x395886[_0xe333('0xe')];var _0x22f270={};var _0x20a437=_0x395886[_0xe333('0x24')];if(_0x22f270){_0x22f270=_[_0xe333('0x25')](_0x395886['body']);_0x22f270=_[_0xe333('0x26')](_0x22f270,[_0xe333('0x9'),'html',_0xe333('0x27'),_0xe333('0x28'),_0xe333('0x29')]);}utils[_0xe333('0x2a')](_0x344d42,_0x22f270,_0x20a437,_0x41a208,_0x14b6b4);_0x5c0dcc(null);};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17b1=['keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','i.id','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','SELECT','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','type','default','text','value','start','unreadMessages','read','and','operator','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','end','Tag','tags','clause','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','some','compact','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','role','\x20IS\x20NOT\x20NULL','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','QueryTypes','sequelize','query','toString'];(function(_0x1bbce7,_0x581b65){var _0xe3a3ef=function(_0x58c0c7){while(--_0x58c0c7){_0x1bbce7['push'](_0x1bbce7['shift']());}};_0xe3a3ef(++_0x581b65);}(_0x17b1,0x182));var _0x117b=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x17b1[_0x2e2681];return _0x368a64;};'use strict';var _=require(_0x117b('0x0'));var squel=require(_0x117b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x117b('0x2'));var updateInteraction=require('./update-interaction')[_0x117b('0x3')];var utils=require(_0x117b('0x4'));var db=require(_0x117b('0x5'))['db'];function skipInteractionsQuery(_0x3bc8e2,_0x216e94,_0x2d3f2e){var _0x3bcda3=![];var _0x406350=utils[_0x117b('0x6')](_0x3bc8e2);if(_0x216e94['role']==='agent'&&!_0x2d3f2e[_0x117b('0x7')]&&!_0x2d3f2e[_0x406350]){_0x3bcda3=!![];}return _0x3bcda3;}function getTagsQuery(){return squel[_0x117b('0x8')]()[_0x117b('0x9')]('id')[_0x117b('0x9')](_0x117b('0xa'))[_0x117b('0x9')](_0x117b('0xb'))[_0x117b('0xc')](_0x117b('0xd'));}function getUsersQuery(_0x4820c5,_0x13b5c1){var _0x38cb9c=utils[_0x117b('0xe')](_0x4820c5);var _0x3ab62a=_0x117b('0xf')+_0x4820c5+_0x117b('0x10');var _0x5c8b60=squel[_0x117b('0x8')]()['field'](_0x117b('0x11'))[_0x117b('0x9')](_0x117b('0x12'))[_0x117b('0x9')]('ui.'+_0x38cb9c)[_0x117b('0xc')](_0x3ab62a,'ui')[_0x117b('0x13')](_0x117b('0x14'),'u',_0x117b('0x15'));if(_0x13b5c1[_0x117b('0x16')]>0x0){_0x5c8b60[_0x117b('0x17')](_0x117b('0x18')+_0x38cb9c+_0x117b('0x19'),_[_0x117b('0x1a')](_0x13b5c1,'id'));}return _0x5c8b60;}function getInteractionsQuery(_0x111a4d){var _0x19b257=utils[_0x117b('0x1b')](_0x111a4d);var _0x5ee5c5=utils[_0x117b('0x6')](_0x111a4d);var _0x4d996c=utils[_0x117b('0xe')](_0x111a4d);return squel[_0x117b('0x8')]()[_0x117b('0xc')](_0x19b257[_0x117b('0x1c')],'i')[_0x117b('0x13')](_0x117b('0x1d'),'c',_0x117b('0x1e'))[_0x117b('0x13')](_0x117b('0x14'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x19b257[_0x117b('0x1f')],'a',_0x117b('0x20')+_0x5ee5c5)['left_join'](_0x19b257['messages'],'me',_0x117b('0x21')+_0x4d996c+_0x117b('0x22'))[_0x117b('0x13')](_0x19b257[_0x117b('0x23')],'it',_0x117b('0x24')+_0x4d996c+_0x117b('0x22'))[_0x117b('0x13')](_0x117b('0xd'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x8f2045={'body':squel[_0x117b('0x25')](),'contact':squel['expr'](),'default':squel[_0x117b('0x25')](),'fields':squel[_0x117b('0x25')](),'filter':squel[_0x117b('0x25')](),'read':squel['expr'](),'tags':{'clause':squel[_0x117b('0x25')](),'ids':null},'user':squel['expr']()};return _0x8f2045;}function parseTagParameter(_0xc8cf9a){var _0x19549d=squel[_0x117b('0x25')]();if(_0xc8cf9a){var _0x5e0884=utils[_0x117b('0x26')](_0xc8cf9a);_0x5e0884[_0x117b('0x27')](function(_0x39610f){_0x19549d['or'](_0x117b('0x28'),'%,'+_0x39610f+',%');});}return _0x19549d;}function parseReadParameter(_0x1a3033){var _0x5b670a='';if(_0x1a3033){_0x5b670a='unreadMessages\x20{OPERATOR}\x200';if(_0x1a3033==='1'){_0x5b670a=_0x5b670a[_0x117b('0x29')](_0x117b('0x2a'),'=');}else{_0x5b670a=_0x5b670a[_0x117b('0x29')](_0x117b('0x2a'),'>');}}return _0x5b670a;}function parseSearchFilter(_0xb8ed38,_0x306c20){var _0x1a0e21=squel[_0x117b('0x25')]();if(_0x306c20){var _0x364259=_0x306c20[_0x117b('0x29')]('\x5c','\x5c\x5c')[_0x117b('0x29')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x364259)){_0x1a0e21['or'](_0x117b('0x2b'),_0x364259+'%');if([_0x117b('0x2c'),_0x117b('0x2d')]['includes'](_0xb8ed38)){_0x1a0e21['or'](_0x117b('0x2e'),_0x364259+'%');}else if(_0xb8ed38===_0x117b('0x2f')){_0x1a0e21['or'](_0x117b('0x30'),_0x364259+'%');}else if(_0xb8ed38===_0x117b('0x31')){_0x1a0e21['or'](_0x117b('0x32'),_0x364259+'%');}}else if(_0xb8ed38===_0x117b('0x33')&&qs[_0x117b('0x34')](_0x364259)){_0x1a0e21['or'](_0x117b('0x35'),_0x364259+'%');}else{if(_0xb8ed38===_0x117b('0x33')){_0x1a0e21['or'](_0x117b('0x36'),qs['getFullTextValue'](_0x364259,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x117b('0x37')](_0x364259));}else if(_0xb8ed38!==_0x117b('0x2f')){_0x1a0e21['or'](_0x117b('0x38'),qs[_0x117b('0x37')](_0x364259));}_0x1a0e21['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x117b('0x37')](_0x364259,!![]),null);}}return _0x1a0e21;}function parseAdvancedSearchFilter(_0x3a61bb,_0x26d15b){var _0x275122=getSqlClauses();var _0x59a91b=as[_0x117b('0x39')](_0x3a61bb);var _0x12ff41=_0x59a91b[_0x117b('0x3a')];for(var _0x15cbd5=0x0;_0x15cbd5<_0x59a91b['conditions'][_0x117b('0x16')];_0x15cbd5++){var _0x3a99cc=_0x59a91b[_0x117b('0x3b')][_0x15cbd5];var _0x389b14='i';var _0x58bd56=_[_0x117b('0x3c')](_0x26d15b,[_0x117b('0xa'),_0x3a99cc['field']]);if(_0x58bd56){var _0x25c816=as['buildExpression'](_0x389b14,_0x58bd56[_0x117b('0x3d')],_0x3a99cc);_0x275122[_0x117b('0x3e')][_0x12ff41](_0x25c816[_0x117b('0x3f')],_0x25c816[_0x117b('0x40')][_0x117b('0x41')],_0x25c816[_0x117b('0x40')]['end']);}else{switch(_0x3a99cc[_0x117b('0x9')]){case _0x117b('0x42'):var _0x4fdc49=parseReadParameter(_0x3a99cc[_0x117b('0x40')]);_0x275122[_0x117b('0x43')][_0x117b('0x44')](_0x4fdc49);break;case'Contact':if(_0x3a99cc[_0x117b('0x45')]==='$substring'){if(_0x3a99cc[_0x117b('0x40')][_0x117b('0x46')]('\x20')[_0x117b('0x16')]>0x1){_0x275122[_0x117b('0x47')][_0x12ff41](_0x117b('0x48'),qs[_0x117b('0x37')](_0x3a99cc['value'],!![]),null);}else{var _0x2ba922='%'+_0x3a99cc['value']+'%';_0x275122[_0x117b('0x47')][_0x12ff41](_0x117b('0x49'),_0x2ba922,_0x2ba922,_0x2ba922);}}else{_0x58bd56=_[_0x117b('0x3c')](_0x26d15b,['name',_0x117b('0x4a')]);_0x3a99cc['field']=_0x117b('0x4a');_0x25c816=as[_0x117b('0x4b')](_0x389b14,_0x58bd56['type'],_0x3a99cc);_0x275122['contact'][_0x12ff41](_0x25c816[_0x117b('0x3f')],_0x25c816[_0x117b('0x40')][_0x117b('0x41')],_0x25c816['value'][_0x117b('0x4c')]);}break;case _0x117b('0x4d'):var _0x2fa3ba=_0x3a99cc[_0x117b('0x40')][_0x117b('0x46')](',')[_0x117b('0x1a')](function(_0x29ebe1){return Number(_0x29ebe1);});var _0x240632=parseTagParameter(_0x2fa3ba);_0x275122[_0x117b('0x4e')][_0x117b('0x4f')]['and'](_0x240632);_0x275122['tags'][_0x117b('0x50')]=_0x2fa3ba;break;case'User':if(_0x3a99cc[_0x117b('0x45')]==='$substring'){_0x275122[_0x117b('0x51')][_0x12ff41](_0x117b('0x52'),'%'+_0x3a99cc[_0x117b('0x40')]+'%',null);}else{_0x58bd56=_[_0x117b('0x3c')](_0x26d15b,[_0x117b('0xa'),_0x117b('0x53')]);_0x3a99cc[_0x117b('0x9')]=_0x117b('0x53');_0x25c816=as[_0x117b('0x4b')](_0x389b14,_0x58bd56[_0x117b('0x3d')],_0x3a99cc);_0x275122[_0x117b('0x51')][_0x12ff41](_0x25c816[_0x117b('0x3f')],_0x25c816[_0x117b('0x40')]['start'],_0x25c816[_0x117b('0x40')]['end']);}break;case _0x117b('0x54'):case _0x117b('0x55'):_0x25c816=as[_0x117b('0x4b')]('me',null,_0x3a99cc);_0x275122[_0x117b('0x54')][_0x12ff41](_0x25c816['text'],_0x25c816[_0x117b('0x40')][_0x117b('0x41')],_0x25c816[_0x117b('0x40')][_0x117b('0x4c')]);break;}}}return _0x275122;}function parseModelFields(_0x5c5b4d,_0x10a2fd,_0x12bd7f){var _0x477d11=utils[_0x117b('0x6')](_0x5c5b4d);var _0x478899=squel['expr']();var _0x388845=_(_0x10a2fd)['keys']()[_0x117b('0x1a')](function(_0x559fc5){return _[_0x117b('0x56')](_0x12bd7f,['name',_0x559fc5])?_0x559fc5:undefined;})[_0x117b('0x57')]()[_0x117b('0x40')]();if(_0x388845['length']>0x0){_0x388845[_0x117b('0x27')](function(_0x4493ce){if(_0x4493ce===_0x477d11){_0x478899['and']('i.'+_0x477d11+_0x117b('0x19'),[][_0x117b('0x58')](_0x10a2fd[_0x4493ce]));}else if(_0x4493ce==='createdAt'){var _0x3500a6=JSON[_0x117b('0x59')](_0x10a2fd[_0x4493ce])['$gte'];var _0xad9e34=JSON[_0x117b('0x59')](_0x10a2fd[_0x4493ce])[_0x117b('0x5a')];_0x478899[_0x117b('0x44')](_0x117b('0x5b'),_0x3500a6,_0xad9e34);}else{if(_0x10a2fd[_0x4493ce]==='null'){_0x478899[_0x117b('0x44')]('i.'+_0x4493ce+_0x117b('0x5c'));}else{_0x478899['and']('i.'+_0x4493ce+'\x20=\x20?',_0x10a2fd[_0x4493ce]);}}});}return _0x478899;}function parseQueryParameters(_0x347554,_0x336398,_0x53b9a3){var _0x18cf56=getSqlClauses();return Promise[_0x117b('0x5d')]()[_0x117b('0x5e')](function(){return parseModelFields(_0x347554,_0x336398,_0x53b9a3);})[_0x117b('0x5e')](function(_0x138b04){_0x18cf56[_0x117b('0x5f')][_0x117b('0x44')](_0x138b04);return parseReadParameter(_0x336398[_0x117b('0x43')]);})[_0x117b('0x5e')](function(_0x409ba0){_0x18cf56[_0x117b('0x43')][_0x117b('0x44')](_0x409ba0);return parseTagParameter(_0x336398[_0x117b('0x60')]);})[_0x117b('0x5e')](function(_0x57f708){_0x18cf56[_0x117b('0x4e')][_0x117b('0x4f')][_0x117b('0x44')](_0x57f708);return parseSearchFilter(_0x347554,_0x336398[_0x117b('0x61')]);})['then'](function(_0x127882){_0x18cf56[_0x117b('0x61')]=_0x127882;return _0x18cf56;});}function checkAccountsRestrictions(_0x2fa6fb,_0x4b85d,_0x14dd45){var _0x54e8ff=utils[_0x117b('0x6')](_0x2fa6fb);var _0x4a2a22=_0x117b('0x62')+_[_0x117b('0x63')](_0x2fa6fb)+(_0x2fa6fb===_0x117b('0x64')?_0x117b('0x65'):_0x117b('0x66'));var _0x3fca46=squel[_0x117b('0x25')]();return Promise[_0x117b('0x5d')]()[_0x117b('0x5e')](function(){if(_0x14dd45[_0x117b('0x7')]&&_0x4b85d[_0x117b('0x67')]==='agent'){return _0x4b85d[_0x4a2a22]({'attributes':['id'],'raw':!![]});}})[_0x117b('0x5e')](function(_0x4fd014){if(_0x4fd014){if(_0x4fd014['length']===0x0){_0x3fca46[_0x117b('0x44')]('i.'+_0x54e8ff+'\x20IS\x20NULL');}else{_0x3fca46['and']('i.'+_0x54e8ff+_0x117b('0x19'),_[_0x117b('0x1a')](_0x4fd014,'id'));}}else if(!_0x14dd45[_0x54e8ff]){_0x3fca46[_0x117b('0x44')]('i.'+_0x54e8ff+_0x117b('0x68'));}})[_0x117b('0x5e')](function(){return _0x3fca46;});}function getClosedOrderClause(_0x1123c1,_0x327d91){var _0x2fa756='';var _0x39cd04=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x1123c1===_0x117b('0x33')){_0x39cd04[_0x117b('0x69')](_0x117b('0x6a'));}if(_0x327d91[_0x117b('0x6b')]==='0'&&_0x1123c1==='mail'){_0x2fa756='i.substatus';}else{if(_0x327d91['closed']==='1'){_0x39cd04[_0x117b('0x6c')]();}_0x2fa756=_0x117b('0x6d')+_0x39cd04[_0x117b('0x6e')](',\x20')+')';}return _0x2fa756;}function getFilteredInteractions(_0x598868,_0x4367f6,_0x2cf1c0,_0x1d836a){var _0x26311d=utils[_0x117b('0xe')](_0x598868);var _0x2546b7=_[_0x117b('0x63')](_0x598868)+'Interaction';var _0x962821=[];var _0x5a30e1=getTagsQuery();var _0x1c5f2c={'type':db['Sequelize'][_0x117b('0x6f')]['SELECT'],'raw':!![]};var _0x1d9d33=[];var _0x205d5c=[];return db[_0x117b('0x70')][_0x117b('0x71')](_0x5a30e1[_0x117b('0x72')](),_0x1c5f2c)[_0x117b('0x5e')](function(_0x1ead02){_0x962821=_[_0x117b('0x73')](_0x1ead02,'id');_0x1c5f2c=_['merge'](_0x1c5f2c,{'model':db[_0x2546b7],'mapToModel':!![],'nest':!![]});if(_0x2cf1c0[_0x117b('0x5f')]){_0x1d836a[_0x117b('0x74')][_0x117b('0x27')](function(_0x51079f){_0x4367f6[_0x117b('0x9')]('i.'+_0x51079f);});}else{_0x4367f6[_0x117b('0x9')](_0x117b('0x75'),_0x117b('0x42'));_0x4367f6[_0x117b('0x9')](_0x117b('0x76'),_0x117b('0x77'));_0x4367f6[_0x117b('0x9')](_0x117b('0x78'),_0x117b('0x79'));if(_0x598868==='mail'){_0x4367f6[_0x117b('0x9')](_0x117b('0x7a'),_0x117b('0x7b'));_0x4367f6[_0x117b('0x9')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4367f6['field'](_0x117b('0x7c'));_0x4367f6[_0x117b('0x9')]('i.createdAt');_0x4367f6[_0x117b('0x9')]('i.updatedAt');_0x4367f6[_0x117b('0x9')](_0x117b('0x7d'));_0x4367f6[_0x117b('0x9')](_0x117b('0x7e'));_0x4367f6[_0x117b('0x9')]('i.attach');_0x4367f6[_0x117b('0x9')](_0x117b('0x7f'));_0x4367f6[_0x117b('0x9')]('i.lastMsgDirection');_0x4367f6[_0x117b('0x9')](_0x117b('0x80'));_0x4367f6[_0x117b('0x9')](_0x117b('0x81'));_0x4367f6[_0x117b('0x9')](_0x117b('0x82'));_0x4367f6[_0x117b('0x9')](_0x117b('0x83'));_0x4367f6[_0x117b('0x9')]('i.substatus');_0x4367f6[_0x117b('0x9')](_0x117b('0x84'));_0x4367f6[_0x117b('0x9')](_0x117b('0x85'));_0x4367f6[_0x117b('0x9')](_0x117b('0x86'));_0x4367f6[_0x117b('0x9')](_0x117b('0x87'));}else if(_0x598868==='openchannel'){_0x4367f6[_0x117b('0x9')](_0x117b('0x88'),_0x117b('0x89'));}else{_0x4367f6['field'](_0x117b('0x8a'),_0x117b('0x89'));}if(_0x598868!==_0x117b('0x33')){_0x4367f6['field'](_0x117b('0x8b'));}_0x4367f6[_0x117b('0x9')](_0x117b('0x8c'),_0x117b('0x8d'));_0x4367f6[_0x117b('0x9')](_0x117b('0x8e'),'Contact.lastName');_0x4367f6[_0x117b('0x9')]('c.email',_0x117b('0x8f'));_0x4367f6[_0x117b('0x9')](_0x117b('0x90'),_0x117b('0x91'));_0x4367f6[_0x117b('0x9')](_0x117b('0x92'),'Contact.mobile');_0x4367f6[_0x117b('0x9')](_0x117b('0x93'),_0x117b('0x94'));_0x4367f6['field']('o.fullname',_0x117b('0x95'));_0x4367f6[_0x117b('0x9')](_0x117b('0x96'),_0x117b('0x97'));_0x4367f6['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x117b('0x98'));}if(_0x1d836a[_0x117b('0x99')]){_0x4367f6['limit'](_0x1d836a[_0x117b('0x99')]);}if(_0x1d836a[_0x117b('0x9a')]){_0x4367f6[_0x117b('0x9a')](_0x1d836a[_0x117b('0x9a')]);}return db[_0x117b('0x70')][_0x117b('0x71')](_0x4367f6[_0x117b('0x72')](),_0x1c5f2c);})[_0x117b('0x5e')](function(_0x52a9a1){_0x1d9d33=_0x52a9a1;var _0x4b4bca=getUsersQuery(_0x598868,_0x1d9d33);return db[_0x117b('0x70')][_0x117b('0x71')](_0x4b4bca[_0x117b('0x72')](),_0x1c5f2c);})[_0x117b('0x5e')](function(_0x77ee65){_0x205d5c=_[_0x117b('0x9b')](_0x77ee65,_0x26311d);if(_0x598868===_0x117b('0x33')){return db[_0x117b('0x9c')][_0x117b('0x9d')]({'attributes':[_0x117b('0x9e')],'raw':!![]});}})[_0x117b('0x5e')](function(_0x5ae5a7){var _0x4613c2=_0x5ae5a7?_0x5ae5a7[_0x117b('0x9e')]:undefined;var _0x599133=_0x1d9d33[_0x117b('0x1a')](function(_0x597494){return updateInteraction(_0x597494,_0x962821,_0x205d5c,_0x4613c2);});return Promise[_0x117b('0x9f')](_0x599133);});}function countFilteredInteractions(_0x26f353,_0x25cbc0){var _0x40e709=_0x26f353[_0x117b('0xa0')]();_0x40e709[_0x117b('0x9')](_0x117b('0xa1'));_0x40e709[_0x117b('0x9')](_0x117b('0x75'),_0x117b('0x42'));var _0x3ccaf1=utils[_0x117b('0x26')](_0x25cbc0);if(!_[_0x117b('0xa2')](_0x3ccaf1)){_0x40e709['where'](_0x117b('0xa3'),_0x3ccaf1);}var _0x2f403b={'type':db[_0x117b('0xa4')][_0x117b('0x6f')][_0x117b('0xa5')],'raw':!![]};return db[_0x117b('0x70')][_0x117b('0x71')](_0x40e709['toString'](),_0x2f403b);}module[_0x117b('0xa6')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
+var _0x7cbf=['openchannel','mail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','length','find','default','text','value','start','end','unreadMessages','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','Tag','clause','tags','UserId','body','keys','some','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','fields','read','tag','get','capitalize','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','Interaction','SELECT','sequelize','query','toString','merge','attributes','forEach','a.key','Account.key','a.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','where','t.id\x20IN\x20?','Sequelize','QueryTypes','exports','lodash','squel','./update-interaction','updateInteraction','../../mysqldb','getAccountFK','role','agent','search','field','name','color','_interactions','u.id','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','\x20IN\x20?','map','getInteractionsTables','getInteractionFK','select','interactions','cm_contacts','left_join','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','whatsapp','fax','i.fax\x20LIKE\x20?'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0x7cbf,0x71));var _0xf7cb=function(_0x3ace73,_0x3e0278){_0x3ace73=_0x3ace73-0x0;var _0x464c5c=_0x7cbf[_0x3ace73];return _0x464c5c;};'use strict';var _=require(_0xf7cb('0x0'));var squel=require(_0xf7cb('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0xf7cb('0x2'))[_0xf7cb('0x3')];var utils=require('./utils');var db=require(_0xf7cb('0x4'))['db'];function skipInteractionsQuery(_0x4dd995,_0x5105dc,_0xaf0371){var _0x437534=![];var _0x19195b=utils[_0xf7cb('0x5')](_0x4dd995);if(_0x5105dc[_0xf7cb('0x6')]===_0xf7cb('0x7')&&!_0xaf0371[_0xf7cb('0x8')]&&!_0xaf0371[_0x19195b]){_0x437534=!![];}return _0x437534;}function getTagsQuery(){return squel['select']()['field']('id')[_0xf7cb('0x9')](_0xf7cb('0xa'))['field'](_0xf7cb('0xb'))['from']('tools_tags');}function getUsersQuery(_0x447f20,_0x23c899){var _0x26562b=utils['getInteractionFK'](_0x447f20);var _0x217a62='user_has_'+_0x447f20+_0xf7cb('0xc');var _0x42c76c=squel['select']()[_0xf7cb('0x9')](_0xf7cb('0xd'))[_0xf7cb('0x9')](_0xf7cb('0xe'))[_0xf7cb('0x9')](_0xf7cb('0xf')+_0x26562b)['from'](_0x217a62,'ui')['left_join'](_0xf7cb('0x10'),'u',_0xf7cb('0x11'));if(_0x23c899['length']>0x0){_0x42c76c['where'](_0xf7cb('0xf')+_0x26562b+_0xf7cb('0x12'),_[_0xf7cb('0x13')](_0x23c899,'id'));}return _0x42c76c;}function getInteractionsQuery(_0x2eac28){var _0x2c4331=utils[_0xf7cb('0x14')](_0x2eac28);var _0xbfc9ad=utils['getAccountFK'](_0x2eac28);var _0x13fd0a=utils[_0xf7cb('0x15')](_0x2eac28);return squel[_0xf7cb('0x16')]()['from'](_0x2c4331[_0xf7cb('0x17')],'i')['left_join'](_0xf7cb('0x18'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf7cb('0x19')](_0xf7cb('0x10'),'o','o.id\x20=\x20i.UserId')[_0xf7cb('0x19')](_0x2c4331[_0xf7cb('0x1a')],'a',_0xf7cb('0x1b')+_0xbfc9ad)[_0xf7cb('0x19')](_0x2c4331[_0xf7cb('0x1c')],'me',_0xf7cb('0x1d')+_0x13fd0a+'\x20=\x20i.id')[_0xf7cb('0x19')](_0x2c4331[_0xf7cb('0x1e')],'it',_0xf7cb('0x1f')+_0x13fd0a+'\x20=\x20i.id')[_0xf7cb('0x19')]('tools_tags','t',_0xf7cb('0x20'));}function getSqlClauses(){var _0x261a51={'body':squel[_0xf7cb('0x21')](),'contact':squel[_0xf7cb('0x21')](),'default':squel[_0xf7cb('0x21')](),'fields':squel[_0xf7cb('0x21')](),'filter':squel['expr'](),'read':squel[_0xf7cb('0x21')](),'tags':{'clause':squel[_0xf7cb('0x21')](),'ids':null},'user':squel['expr']()};return _0x261a51;}function parseTagParameter(_0x3ded4d){var _0x1b558f=squel[_0xf7cb('0x21')]();if(_0x3ded4d){var _0x51a309=utils[_0xf7cb('0x22')](_0x3ded4d);_0x51a309['forEach'](function(_0x5ed34b){_0x1b558f['or'](_0xf7cb('0x23'),'%,'+_0x5ed34b+',%');});}return _0x1b558f;}function parseReadParameter(_0x24d71b){var _0x58e370='';if(_0x24d71b){_0x58e370='unreadMessages\x20{OPERATOR}\x200';if(_0x24d71b==='1'){_0x58e370=_0x58e370[_0xf7cb('0x24')](_0xf7cb('0x25'),'=');}else{_0x58e370=_0x58e370[_0xf7cb('0x24')](_0xf7cb('0x25'),'>');}}return _0x58e370;}function parseSearchFilter(_0x56c0c6,_0x1b6109){var _0x4a8da6=squel[_0xf7cb('0x21')]();if(_0x1b6109){var _0x339238=_0x1b6109[_0xf7cb('0x24')]('\x5c','\x5c\x5c')[_0xf7cb('0x24')](/'/g,'\x27\x27');if(qs[_0xf7cb('0x26')](_0x339238)){_0x4a8da6['or']('i.id\x20LIKE\x20?',_0x339238+'%');if(['sms',_0xf7cb('0x27')]['includes'](_0x56c0c6)){_0x4a8da6['or']('i.phone\x20LIKE\x20?',_0x339238+'%');}else if(_0x56c0c6===_0xf7cb('0x28')){_0x4a8da6['or'](_0xf7cb('0x29'),_0x339238+'%');}else if(_0x56c0c6===_0xf7cb('0x2a')){_0x4a8da6['or']('i.from\x20LIKE\x20?',_0x339238+'%');}}else if(_0x56c0c6===_0xf7cb('0x2b')&&qs['isEmail'](_0x339238)){_0x4a8da6['or'](_0xf7cb('0x2c'),_0x339238+'%');}else{if(_0x56c0c6===_0xf7cb('0x2b')){_0x4a8da6['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x339238,!![]))['or'](_0xf7cb('0x2d'),qs[_0xf7cb('0x2e')](_0x339238));}else if(_0x56c0c6!=='fax'){_0x4a8da6['or'](_0xf7cb('0x2f'),qs[_0xf7cb('0x2e')](_0x339238));}_0x4a8da6['or'](_0xf7cb('0x30'),qs['getFullTextValue'](_0x339238,!![]),null);}}return _0x4a8da6;}function parseAdvancedSearchFilter(_0x11e9d7,_0x514431){var _0x117ee9=getSqlClauses();var _0x1df67d=as[_0xf7cb('0x31')](_0x11e9d7);var _0x394dbe=_0x1df67d['sqlOperator'];for(var _0x43fbc5=0x0;_0x43fbc5<_0x1df67d[_0xf7cb('0x32')][_0xf7cb('0x33')];_0x43fbc5++){var _0x52b770=_0x1df67d[_0xf7cb('0x32')][_0x43fbc5];var _0x287fb9='i';var _0x42e729=_[_0xf7cb('0x34')](_0x514431,[_0xf7cb('0xa'),_0x52b770[_0xf7cb('0x9')]]);if(_0x42e729){var _0x5c7ad2=as['buildExpression'](_0x287fb9,_0x42e729['type'],_0x52b770);_0x117ee9[_0xf7cb('0x35')][_0x394dbe](_0x5c7ad2[_0xf7cb('0x36')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x38')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x39')]);}else{switch(_0x52b770[_0xf7cb('0x9')]){case _0xf7cb('0x3a'):var _0x1ecee4=parseReadParameter(_0x52b770['value']);_0x117ee9['read'][_0xf7cb('0x3b')](_0x1ecee4);break;case _0xf7cb('0x3c'):if(_0x52b770[_0xf7cb('0x3d')]===_0xf7cb('0x3e')){if(_0x52b770[_0xf7cb('0x37')][_0xf7cb('0x3f')]('\x20')['length']>0x1){_0x117ee9[_0xf7cb('0x40')][_0x394dbe](_0xf7cb('0x30'),qs[_0xf7cb('0x2e')](_0x52b770[_0xf7cb('0x37')],!![]),null);}else{var _0x352a48='%'+_0x52b770['value']+'%';_0x117ee9['contact'][_0x394dbe](_0xf7cb('0x41'),_0x352a48,_0x352a48,_0x352a48);}}else{_0x42e729=_[_0xf7cb('0x34')](_0x514431,[_0xf7cb('0xa'),_0xf7cb('0x42')]);_0x52b770[_0xf7cb('0x9')]=_0xf7cb('0x42');_0x5c7ad2=as[_0xf7cb('0x43')](_0x287fb9,_0x42e729[_0xf7cb('0x44')],_0x52b770);_0x117ee9['contact'][_0x394dbe](_0x5c7ad2[_0xf7cb('0x36')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x38')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x39')]);}break;case _0xf7cb('0x45'):var _0xbdca16=_0x52b770[_0xf7cb('0x37')]['split'](',')[_0xf7cb('0x13')](function(_0x43b968){return Number(_0x43b968);});var _0x5b9112=parseTagParameter(_0xbdca16);_0x117ee9['tags'][_0xf7cb('0x46')]['and'](_0x5b9112);_0x117ee9[_0xf7cb('0x47')]['ids']=_0xbdca16;break;case'User':if(_0x52b770[_0xf7cb('0x3d')]===_0xf7cb('0x3e')){_0x117ee9['user'][_0x394dbe]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x52b770[_0xf7cb('0x37')]+'%',null);}else{_0x42e729=_[_0xf7cb('0x34')](_0x514431,[_0xf7cb('0xa'),_0xf7cb('0x48')]);_0x52b770[_0xf7cb('0x9')]='UserId';_0x5c7ad2=as[_0xf7cb('0x43')](_0x287fb9,_0x42e729['type'],_0x52b770);_0x117ee9['user'][_0x394dbe](_0x5c7ad2[_0xf7cb('0x36')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x38')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x39')]);}break;case'body':case'plainBody':_0x5c7ad2=as[_0xf7cb('0x43')]('me',null,_0x52b770);_0x117ee9[_0xf7cb('0x49')][_0x394dbe](_0x5c7ad2[_0xf7cb('0x36')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x38')],_0x5c7ad2[_0xf7cb('0x37')][_0xf7cb('0x39')]);break;}}}return _0x117ee9;}function parseModelFields(_0x35ead2,_0x443883,_0x134f85){var _0x172c58=utils['getAccountFK'](_0x35ead2);var _0x4d7cf4=squel[_0xf7cb('0x21')]();var _0x3071dc=_(_0x443883)[_0xf7cb('0x4a')]()[_0xf7cb('0x13')](function(_0x552805){return _[_0xf7cb('0x4b')](_0x134f85,['name',_0x552805])?_0x552805:undefined;})['compact']()[_0xf7cb('0x37')]();if(_0x3071dc[_0xf7cb('0x33')]>0x0){_0x3071dc['forEach'](function(_0x504b6d){if(_0x504b6d===_0x172c58){_0x4d7cf4['and']('i.'+_0x172c58+_0xf7cb('0x12'),[]['concat'](_0x443883[_0x504b6d]));}else if(_0x504b6d===_0xf7cb('0x4c')){var _0x516ee7=JSON[_0xf7cb('0x4d')](_0x443883[_0x504b6d])[_0xf7cb('0x4e')];var _0x3f4d0a=JSON[_0xf7cb('0x4d')](_0x443883[_0x504b6d])[_0xf7cb('0x4f')];_0x4d7cf4[_0xf7cb('0x3b')](_0xf7cb('0x50'),_0x516ee7,_0x3f4d0a);}else{if(_0x443883[_0x504b6d]===_0xf7cb('0x51')){_0x4d7cf4['and']('i.'+_0x504b6d+_0xf7cb('0x52'));}else{_0x4d7cf4[_0xf7cb('0x3b')]('i.'+_0x504b6d+_0xf7cb('0x53'),_0x443883[_0x504b6d]);}}});}return _0x4d7cf4;}function parseQueryParameters(_0x2cd95d,_0x2f817d,_0xe6a194){var _0x517904=getSqlClauses();return Promise['resolve']()[_0xf7cb('0x54')](function(){return parseModelFields(_0x2cd95d,_0x2f817d,_0xe6a194);})[_0xf7cb('0x54')](function(_0x14a924){_0x517904[_0xf7cb('0x55')][_0xf7cb('0x3b')](_0x14a924);return parseReadParameter(_0x2f817d[_0xf7cb('0x56')]);})[_0xf7cb('0x54')](function(_0x402f15){_0x517904['read'][_0xf7cb('0x3b')](_0x402f15);return parseTagParameter(_0x2f817d[_0xf7cb('0x57')]);})[_0xf7cb('0x54')](function(_0x24080e){_0x517904['tags'][_0xf7cb('0x46')][_0xf7cb('0x3b')](_0x24080e);return parseSearchFilter(_0x2cd95d,_0x2f817d['filter']);})[_0xf7cb('0x54')](function(_0x5b5535){_0x517904['filter']=_0x5b5535;return _0x517904;});}function checkAccountsRestrictions(_0x4eac69,_0x108c37,_0xa90ac){var _0xd2c7f=utils[_0xf7cb('0x5')](_0x4eac69);var _0xb9818d=_0xf7cb('0x58')+_[_0xf7cb('0x59')](_0x4eac69)+(_0x4eac69==='chat'?_0xf7cb('0x5a'):_0xf7cb('0x5b'));var _0x1116b0=squel['expr']();return Promise[_0xf7cb('0x5c')]()[_0xf7cb('0x54')](function(){if(_0xa90ac[_0xf7cb('0x8')]&&_0x108c37[_0xf7cb('0x6')]===_0xf7cb('0x7')){return _0x108c37[_0xb9818d]({'attributes':['id'],'raw':!![]});}})[_0xf7cb('0x54')](function(_0x5df993){if(_0x5df993){if(_0x5df993[_0xf7cb('0x33')]===0x0){_0x1116b0['and']('i.'+_0xd2c7f+_0xf7cb('0x52'));}else{_0x1116b0[_0xf7cb('0x3b')]('i.'+_0xd2c7f+_0xf7cb('0x12'),_[_0xf7cb('0x13')](_0x5df993,'id'));}}else if(!_0xa90ac[_0xd2c7f]){_0x1116b0[_0xf7cb('0x3b')]('i.'+_0xd2c7f+_0xf7cb('0x5d'));}})[_0xf7cb('0x54')](function(){return _0x1116b0;});}function getClosedOrderClause(_0xd1b19f,_0x21a94f){var _0x27876b='';var _0x40e1d0=['i.thirdDisposition',_0xf7cb('0x5e'),_0xf7cb('0x5f')];if(_0xd1b19f===_0xf7cb('0x2b')){_0x40e1d0[_0xf7cb('0x60')]('i.substatus');}if(_0x21a94f['closed']==='0'&&_0xd1b19f===_0xf7cb('0x2b')){_0x27876b=_0xf7cb('0x61');}else{if(_0x21a94f[_0xf7cb('0x62')]==='1'){_0x40e1d0[_0xf7cb('0x63')]();}_0x27876b='CONCAT_WS(\x27\x27,\x20'+_0x40e1d0['join'](',\x20')+')';}return _0x27876b;}function getFilteredInteractions(_0x576620,_0x4329d8,_0x14c583,_0x34f908){var _0x342987=utils[_0xf7cb('0x15')](_0x576620);var _0x52f859=_[_0xf7cb('0x59')](_0x576620)+_0xf7cb('0x64');var _0x1d1d0a=[];var _0x12d838=getTagsQuery();var _0x30d3ae={'type':db['Sequelize']['QueryTypes'][_0xf7cb('0x65')],'raw':!![]};var _0x317679=[];var _0x44ea82=[];return db[_0xf7cb('0x66')][_0xf7cb('0x67')](_0x12d838[_0xf7cb('0x68')](),_0x30d3ae)[_0xf7cb('0x54')](function(_0x187724){_0x1d1d0a=_['keyBy'](_0x187724,'id');_0x30d3ae=_[_0xf7cb('0x69')](_0x30d3ae,{'model':db[_0x52f859],'mapToModel':!![],'nest':!![]});if(_0x14c583[_0xf7cb('0x55')]){_0x34f908[_0xf7cb('0x6a')][_0xf7cb('0x6b')](function(_0x404bfb){_0x4329d8[_0xf7cb('0x9')]('i.'+_0x404bfb);});}else{_0x4329d8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf7cb('0x3a'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x6c'),_0xf7cb('0x6d'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x6e'),'Account.mandatoryDisposition');if(_0x576620===_0xf7cb('0x2b')){_0x4329d8['field']('a.email',_0xf7cb('0x6f'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x70'),_0xf7cb('0x71'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x72'));_0x4329d8[_0xf7cb('0x9')]('i.createdAt');_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x73'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x74'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x75'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x76'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x77'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x78'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x79'));_0x4329d8['field'](_0xf7cb('0x5f'));_0x4329d8['field'](_0xf7cb('0x5e'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x7a'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x61'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x7b'));_0x4329d8[_0xf7cb('0x9')]('i.ContactId');_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x7c'));_0x4329d8['field'](_0xf7cb('0x7d'));}else if(_0x576620==='openchannel'){_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x7e'),_0xf7cb('0x71'));}else{_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x7f'),_0xf7cb('0x71'));}if(_0x576620!==_0xf7cb('0x2b')){_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x80'));}_0x4329d8['field'](_0xf7cb('0x81'),_0xf7cb('0x82'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x83'),_0xf7cb('0x84'));_0x4329d8['field'](_0xf7cb('0x85'),_0xf7cb('0x86'));_0x4329d8['field'](_0xf7cb('0x87'),'Contact.phone');_0x4329d8['field']('c.mobile',_0xf7cb('0x88'));_0x4329d8[_0xf7cb('0x9')]('c.fax','Contact.fax');_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x89'),_0xf7cb('0x8a'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x8b'),_0xf7cb('0x8c'));_0x4329d8[_0xf7cb('0x9')](_0xf7cb('0x8d'),'TagIds');}if(_0x34f908[_0xf7cb('0x8e')]){_0x4329d8['limit'](_0x34f908[_0xf7cb('0x8e')]);}if(_0x34f908['offset']){_0x4329d8[_0xf7cb('0x8f')](_0x34f908['offset']);}return db[_0xf7cb('0x66')][_0xf7cb('0x67')](_0x4329d8[_0xf7cb('0x68')](),_0x30d3ae);})[_0xf7cb('0x54')](function(_0x3135a9){_0x317679=_0x3135a9;var _0x30abd5=getUsersQuery(_0x576620,_0x317679);return db[_0xf7cb('0x66')][_0xf7cb('0x67')](_0x30abd5[_0xf7cb('0x68')](),_0x30d3ae);})[_0xf7cb('0x54')](function(_0xe35a93){_0x44ea82=_[_0xf7cb('0x90')](_0xe35a93,_0x342987);if(_0x576620===_0xf7cb('0x2b')){return db['Setting'][_0xf7cb('0x91')]({'attributes':[_0xf7cb('0x92')],'raw':!![]});}})[_0xf7cb('0x54')](function(_0x5aec72){var _0xd5ca77=_0x5aec72?_0x5aec72['enableEmailPreview']:undefined;var _0x29d5aa=_0x317679[_0xf7cb('0x13')](function(_0x5ee340){return updateInteraction(_0x5ee340,_0x1d1d0a,_0x44ea82,_0xd5ca77);});return Promise[_0xf7cb('0x93')](_0x29d5aa);});}function countFilteredInteractions(_0x4eddaf,_0x28bfde){var _0x1b4688=_0x4eddaf[_0xf7cb('0x94')]();_0x1b4688[_0xf7cb('0x9')]('COUNT(*)');_0x1b4688[_0xf7cb('0x9')](_0xf7cb('0x95'),_0xf7cb('0x3a'));var _0x2353fa=utils[_0xf7cb('0x22')](_0x28bfde);if(!_['isEmpty'](_0x2353fa)){_0x1b4688[_0xf7cb('0x96')](_0xf7cb('0x97'),_0x2353fa);}var _0x38dfb9={'type':db[_0xf7cb('0x98')][_0xf7cb('0x99')][_0xf7cb('0x65')],'raw':!![]};return db[_0xf7cb('0x66')][_0xf7cb('0x67')](_0x1b4688['toString'](),_0x38dfb9);}module[_0xf7cb('0x9a')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x803f=['total','disposition','UserId','MailMessage','-id','trimStart','catch','then','Tags','TagIds','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned'];(function(_0x3d017f,_0x11978e){var _0x57a0f3=function(_0xb2b0fa){while(--_0xb2b0fa){_0x3d017f['push'](_0x3d017f['shift']());}};_0x57a0f3(++_0x11978e);}(_0x803f,0x1ea));var _0xf803=function(_0x27ec7f,_0x195aa6){_0x27ec7f=_0x27ec7f-0x0;var _0x265800=_0x803f[_0x27ec7f];return _0x265800;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x31bef0,_0x222ee8){return new Promise(function(_0x2f608c,_0xaec968){try{var _0x33624a=[];if(_0x222ee8[_0x31bef0]){_0x33624a=_0x222ee8[_0x31bef0][_0xf803('0x0')](function(_0x42d3d4){return{'id':_0x42d3d4['id'],'fullname':_0x42d3d4[_0xf803('0x1')]};});}return _0x2f608c(_0x33624a);}catch(_0x2b4d3b){_0xaec968(_0x2b4d3b);}});}function getInteractionTags(_0x58ff48,_0x238a06){var _0x4002d7=[];if(_0x58ff48){_0x58ff48[_0xf803('0x2')](',')[_0xf803('0x3')](function(_0x115609){_0x4002d7[_0xf803('0x4')](_0x238a06[_0x115609]);});}return _0x4002d7;}function updateWaitingCounter(_0x5ab7e8){if(_0x5ab7e8[_0xf803('0x5')]){_0x5ab7e8[_0xf803('0x5')]-=0x1;}}function updateInteractionCounters(_0x4c9681){_0x4c9681[_0xf803('0x5')]=0x0;_0x4c9681[_0xf803('0x6')]=0x0;_0x4c9681[_0xf803('0x7')]=0x0;_0x4c9681[_0xf803('0x8')]=0x0;_0x4c9681[_0xf803('0x9')]=0x0;_0x4c9681[_0xf803('0xa')]=0x0;if(_0x4c9681['closed']){if(_0x4c9681[_0xf803('0xb')]===_0xf803('0x9')){_0x4c9681[_0xf803('0x9')]+=0x1;updateWaitingCounter(_0x4c9681);}if(_0x4c9681[_0xf803('0xc')]){_0x4c9681['answered']+=0x1;if(_0x4c9681[_0xf803('0x6')]){_0x4c9681[_0xf803('0x6')]-=0x1;}}else{if(_0x4c9681['disposition']){_0x4c9681[_0xf803('0x8')]+=0x1;updateWaitingCounter(_0x4c9681);}}}else{if(!_0x4c9681['UserId']){_0x4c9681[_0xf803('0x5')]+=0x1;}if(_0x4c9681[_0xf803('0xc')]){_0x4c9681[_0xf803('0x6')]+=0x1;updateWaitingCounter(_0x4c9681);}}_0x4c9681['total']+=0x1;return _0x4c9681;}function getLastMessageText(_0x1bb0c8){return db[_0xf803('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1bb0c8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xf803('0xe'),'raw':!![]})['then'](function(_0x336791){if(_0x336791&&_0x336791['plainBody']){_0x1bb0c8['lastMsgText']=_[_0xf803('0xf')](_0x336791['plainBody']);}return _0x1bb0c8;})[_0xf803('0x10')](function(_0x5c69ca){throw _0x5c69ca;});}exports['updateInteraction']=function(_0x15d3c7,_0x48ec7b,_0x3b5b24,_0x166740){return new Promise(function(_0x2e9357,_0x48820b){return getInteractionUsers(_0x15d3c7['id'],_0x3b5b24)[_0xf803('0x11')](function(_0x4d91ef){_0x15d3c7['Users']=_0x4d91ef;return getInteractionTags(_0x15d3c7['TagIds'],_0x48ec7b);})[_0xf803('0x11')](function(_0x262b87){_0x15d3c7[_0xf803('0x12')]=_0x262b87;delete _0x15d3c7[_0xf803('0x13')];return updateInteractionCounters(_0x15d3c7);})['then'](function(_0x16b84e){if(_0x166740){return getLastMessageText(_0x16b84e);}else{return _0x16b84e;}})[_0xf803('0x11')](function(_0x77463a){_0x2e9357(_0x77463a);})[_0xf803('0x10')](function(_0x415b23){_0x48820b(_0x415b23);});});};
\ No newline at end of file
+var _0x513c=['Users','Tags','TagIds','lodash','fullname','forEach','push','waiting','talking','unmanaged','abandoned','total','disposition','UserId','answered','MailMessage','findOne','plainBody','then','lastMsgText','catch'];(function(_0x3a8390,_0x5c5cae){var _0x264c8f=function(_0x44c7d5){while(--_0x44c7d5){_0x3a8390['push'](_0x3a8390['shift']());}};_0x264c8f(++_0x5c5cae);}(_0x513c,0x96));var _0xc513=function(_0x372047,_0x7f5c2b){_0x372047=_0x372047-0x0;var _0x44f282=_0x513c[_0x372047];return _0x44f282;};'use strict';var _=require(_0xc513('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0xcc80c8,_0x2c525c){return new Promise(function(_0x506655,_0x4e73a1){try{var _0x51a222=[];if(_0x2c525c[_0xcc80c8]){_0x51a222=_0x2c525c[_0xcc80c8]['map'](function(_0x5ca8b0){return{'id':_0x5ca8b0['id'],'fullname':_0x5ca8b0[_0xc513('0x1')]};});}return _0x506655(_0x51a222);}catch(_0x43706e){_0x4e73a1(_0x43706e);}});}function getInteractionTags(_0x38f637,_0x1bd3d2){var _0x3dcbc1=[];if(_0x38f637){_0x38f637['split'](',')[_0xc513('0x2')](function(_0x1bf4ef){_0x3dcbc1[_0xc513('0x3')](_0x1bd3d2[_0x1bf4ef]);});}return _0x3dcbc1;}function updateWaitingCounter(_0x20ec1b){if(_0x20ec1b[_0xc513('0x4')]){_0x20ec1b[_0xc513('0x4')]-=0x1;}}function updateInteractionCounters(_0x5da451){_0x5da451['waiting']=0x0;_0x5da451[_0xc513('0x5')]=0x0;_0x5da451['answered']=0x0;_0x5da451[_0xc513('0x6')]=0x0;_0x5da451[_0xc513('0x7')]=0x0;_0x5da451[_0xc513('0x8')]=0x0;if(_0x5da451['closed']){if(_0x5da451[_0xc513('0x9')]===_0xc513('0x7')){_0x5da451[_0xc513('0x7')]+=0x1;updateWaitingCounter(_0x5da451);}if(_0x5da451[_0xc513('0xa')]){_0x5da451[_0xc513('0xb')]+=0x1;if(_0x5da451[_0xc513('0x5')]){_0x5da451[_0xc513('0x5')]-=0x1;}}else{if(_0x5da451[_0xc513('0x9')]){_0x5da451[_0xc513('0x6')]+=0x1;updateWaitingCounter(_0x5da451);}}}else{if(!_0x5da451[_0xc513('0xa')]){_0x5da451['waiting']+=0x1;}if(_0x5da451[_0xc513('0xa')]){_0x5da451[_0xc513('0x5')]+=0x1;updateWaitingCounter(_0x5da451);}}_0x5da451[_0xc513('0x8')]+=0x1;return _0x5da451;}function getLastMessageText(_0x1608c0){return db[_0xc513('0xc')][_0xc513('0xd')]({'where':{'$and':[{'MailInteractionId':_0x1608c0['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc513('0xe')],'order':'-id','raw':!![]})[_0xc513('0xf')](function(_0x4e7584){if(_0x4e7584&&_0x4e7584[_0xc513('0xe')]){_0x1608c0[_0xc513('0x10')]=_['trimStart'](_0x4e7584[_0xc513('0xe')]);}return _0x1608c0;})[_0xc513('0x11')](function(_0x572187){throw _0x572187;});}exports['updateInteraction']=function(_0x4b35d6,_0x5baa4a,_0x28c7ec,_0x29a790){return new Promise(function(_0x23abcd,_0x2338f4){return getInteractionUsers(_0x4b35d6['id'],_0x28c7ec)['then'](function(_0x9e5d74){_0x4b35d6[_0xc513('0x12')]=_0x9e5d74;return getInteractionTags(_0x4b35d6['TagIds'],_0x5baa4a);})[_0xc513('0xf')](function(_0x554d67){_0x4b35d6[_0xc513('0x13')]=_0x554d67;delete _0x4b35d6[_0xc513('0x14')];return updateInteractionCounters(_0x4b35d6);})[_0xc513('0xf')](function(_0x1d7f93){if(_0x29a790){return getLastMessageText(_0x1d7f93);}else{return _0x1d7f93;}})[_0xc513('0xf')](function(_0xb5ca4d){_0x23abcd(_0xb5ca4d);})[_0xc513('0x11')](function(_0x3822d9){_0x2338f4(_0x3822d9);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24f4=['role','stringify','null','Interaction','findOne','then','info','catch','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_messages','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x37cab9,_0x3bedf0){var _0x5c0cd2=function(_0x225a75){while(--_0x225a75){_0x37cab9['push'](_0x37cab9['shift']());}};_0x5c0cd2(++_0x3bedf0);}(_0x24f4,0x148));var _0x424f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x424f('0x0'));var db=require(_0x424f('0x1'))['db'];var loggers={'openchannel':require(_0x424f('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x424f('0x3')),'fax':require(_0x424f('0x2'))(_0x424f('0x4')),'sms':require(_0x424f('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x424f('0x5')),'whatsapp':require(_0x424f('0x2'))(_0x424f('0x6'))};function getAccountFK(_0x31d2f7){return _[_0x424f('0x7')](_0x31d2f7)+(_0x31d2f7===_0x424f('0x8')?_0x424f('0x9'):_0x424f('0xa'))+'Id';}function getInteractionFK(_0x211566){return _[_0x424f('0x7')](_0x211566)+_0x424f('0xb');}function getInteractionId(_0x34ac9f,_0x3b0374,_0x45061a){if(_0x34ac9f&&_0x34ac9f[_['upperFirst'](_0x45061a)+_0x424f('0xb')]){return _0x34ac9f[_[_0x424f('0xc')](_0x45061a)+'InteractionId'];}else if(_0x34ac9f&&_0x34ac9f['id']){return _0x34ac9f['id'];}else if(_0x3b0374&&_0x3b0374['id']){return _0x3b0374['id'];}else{return'unknown';}}function getInteractionsTables(_0x4a2909){return{'accounts':_0x4a2909+'_'+(_0x4a2909==='chat'?_0x424f('0xd'):_0x424f('0xe')),'interactions':_0x4a2909+'_interactions','interactionsTags':_0x4a2909+'_interaction_has_tags','messages':_0x4a2909+_0x424f('0xf'),'userInteractions':'user_has_'+_0x4a2909+_0x424f('0x10')};}function getSelectedTags(_0x19e353){var _0x29edd3=[];if(_0x19e353){_0x29edd3=Array[_0x424f('0x11')](_0x19e353)?_0x19e353:[_0x19e353];}return _0x29edd3;}function log(_0x448eb6,_0x39dd44,_0x2641e7,_0x9a77db,_0x28c777,_0x2c47a5){loggers[_0x28c777[_0x424f('0x12')]()][_0x448eb6](_0x424f('0x13'),_0x2c47a5['toUpperCase'](),_0x39dd44?_0x39dd44['id']:null,_0x39dd44?_0x39dd44['name']:null,_0x39dd44?_0x39dd44[_0x424f('0x14')]:null,getInteractionId(_0x2641e7,_0x9a77db,_0x28c777),_0x2641e7?JSON[_0x424f('0x15')](_0x2641e7):_0x424f('0x16'));}function updateUser(_0x37b676,_0x295110,_0x52ac98,_0x216f29,_0xf41105){db[_[_0x424f('0xc')](_0x216f29)+_0x424f('0x17')][_0x424f('0x18')]({'where':{'id':getInteractionId(_0x295110,_0x52ac98,_0x216f29)}})[_0x424f('0x19')](function(_0x36976c){if(_0x36976c){return _0x36976c['update']({'UserId':_0x37b676?_0x37b676['id']:null});}})[_0x424f('0x19')](function(_0xf33292){if(_0xf33292){log(_0x424f('0x1a'),_0x37b676,_0x295110,_0x52ac98,_0x216f29,_0xf41105);}})[_0x424f('0x1b')](function(){log('error',_0x37b676,_0x295110,_0x52ac98,_0x216f29,_0xf41105);});}module[_0x424f('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
+var _0xf22a=['Account','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','capitalize','Website'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xf22a,0x141));var _0xaf22=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xf22a[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xaf22('0x0'));var db=require(_0xaf22('0x1'))['db'];var loggers={'openchannel':require(_0xaf22('0x2'))(_0xaf22('0x3')),'mail':require(_0xaf22('0x2'))(_0xaf22('0x4')),'fax':require(_0xaf22('0x2'))(_0xaf22('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')(_0xaf22('0x6')),'whatsapp':require(_0xaf22('0x2'))('whatsapp-interactions')};function getAccountFK(_0x230b8a){return _[_0xaf22('0x7')](_0x230b8a)+(_0x230b8a==='chat'?_0xaf22('0x8'):_0xaf22('0x9'))+'Id';}function getInteractionFK(_0x5abede){return _[_0xaf22('0x7')](_0x5abede)+_0xaf22('0xa');}function getInteractionId(_0x18157b,_0x879a0c,_0x5aa0a9){if(_0x18157b&&_0x18157b[_[_0xaf22('0xb')](_0x5aa0a9)+_0xaf22('0xa')]){return _0x18157b[_[_0xaf22('0xb')](_0x5aa0a9)+_0xaf22('0xa')];}else if(_0x18157b&&_0x18157b['id']){return _0x18157b['id'];}else if(_0x879a0c&&_0x879a0c['id']){return _0x879a0c['id'];}else{return _0xaf22('0xc');}}function getInteractionsTables(_0x1cddec){return{'accounts':_0x1cddec+'_'+(_0x1cddec==='chat'?_0xaf22('0xd'):_0xaf22('0xe')),'interactions':_0x1cddec+'_interactions','interactionsTags':_0x1cddec+_0xaf22('0xf'),'messages':_0x1cddec+_0xaf22('0x10'),'userInteractions':_0xaf22('0x11')+_0x1cddec+_0xaf22('0x12')};}function getSelectedTags(_0x4a44ea){var _0x14bcc6=[];if(_0x4a44ea){_0x14bcc6=Array[_0xaf22('0x13')](_0x4a44ea)?_0x4a44ea:[_0x4a44ea];}return _0x14bcc6;}function log(_0x511d33,_0x14f7f7,_0x4d5f3a,_0x3c8210,_0x4bda90,_0x1e6933){loggers[_0x4bda90[_0xaf22('0x14')]()][_0x511d33](_0xaf22('0x15'),_0x1e6933[_0xaf22('0x16')](),_0x14f7f7?_0x14f7f7['id']:null,_0x14f7f7?_0x14f7f7[_0xaf22('0x17')]:null,_0x14f7f7?_0x14f7f7[_0xaf22('0x18')]:null,getInteractionId(_0x4d5f3a,_0x3c8210,_0x4bda90),_0x4d5f3a?JSON['stringify'](_0x4d5f3a):'null');}function updateUser(_0x78f9ea,_0x86d1f7,_0x5a69b1,_0x2f52a1,_0x59f0cf){db[_['upperFirst'](_0x2f52a1)+_0xaf22('0x19')][_0xaf22('0x1a')]({'where':{'id':getInteractionId(_0x86d1f7,_0x5a69b1,_0x2f52a1)}})[_0xaf22('0x1b')](function(_0x128291){if(_0x128291){return _0x128291[_0xaf22('0x1c')]({'UserId':_0x78f9ea?_0x78f9ea['id']:null});}})[_0xaf22('0x1b')](function(_0x3e3a8d){if(_0x3e3a8d){log(_0xaf22('0x1d'),_0x78f9ea,_0x86d1f7,_0x5a69b1,_0x2f52a1,_0x59f0cf);}})[_0xaf22('0x1e')](function(){log(_0xaf22('0x1f'),_0x78f9ea,_0x86d1f7,_0x5a69b1,_0x2f52a1,_0x59f0cf);});}module[_0xaf22('0x20')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7494=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','util','composable-middleware'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x7494,0x184));var _0x4749=function(_0x58fad9,_0x2240fe){_0x58fad9=_0x58fad9-0x0;var _0x164653=_0x7494[_0x58fad9];return _0x164653;};'use strict';var crypto=require('crypto');var util=require(_0x4749('0x0'));var compose=require(_0x4749('0x1'));var db=require(_0x4749('0x2'))['db'];var config=require(_0x4749('0x3'));function getValueFromLicense(_0x46cb36,_0x21a2e9){if(_0x46cb36&&_0x21a2e9){if(_0x21a2e9[_0x4749('0x4')]&&_0x21a2e9[_0x4749('0x5')]){var _0x42b6ab=_0x21a2e9[_0x4749('0x4')];var _0x377697=_0x21a2e9['license'];var _0x4ba070=_0x42b6ab[_0x4749('0x6')]('-')[0x4];var _0x3da7ad=_0x42b6ab['split']('-')[0x0];var _0x2f1923=crypto[_0x4749('0x7')]('aes-256-ctr',util[_0x4749('0x8')](_0x4749('0x9'),_0x4ba070,_0x42b6ab,_0x3da7ad));var _0x5eb979=_0x2f1923[_0x4749('0xa')](_0x377697,_0x4749('0xb'),_0x4749('0xc'));_0x5eb979+=_0x2f1923['final'](_0x4749('0xc'));var _0x38a9a0=JSON[_0x4749('0xd')](_0x5eb979);return _0x38a9a0[_0x4749('0xe')](_0x46cb36)?_0x38a9a0[_0x46cb36]:null;}}return null;}function isLimit(_0x1e14e0,_0x329267,_0x301320,_0xbd25b5){var _0x45f56b=_0x329267;return compose()['use'](function(_0x417e6b,_0x3468df,_0x5c43b9){return db[_0x4749('0xf')][_0x4749('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xeaea79){var _0x3b6a3e=getValueFromLicense(_0x1e14e0,_0xeaea79);return _0x3b6a3e?_0x3b6a3e:_0x45f56b;})[_0x4749('0x11')](function(_0x3b95b5){_0x45f56b=_0x3b95b5;return _0x301320[_0x4749('0x12')](_0xbd25b5);})[_0x4749('0x11')](function(_0x1e443e){if(_0x1e443e>=_0x45f56b){return _0x3468df[_0x4749('0x13')](0x193)[_0x4749('0x14')]({'message':util[_0x4749('0x8')](_0x4749('0x15'),_0x1e14e0)});}_0x5c43b9();})[_0x4749('0x16')](function(_0x172bc7){_0x5c43b9(_0x172bc7);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x4749('0x17')},{'role':_0x4749('0x18')}]}});}exports[_0x4749('0x19')]=isUserLimit;
\ No newline at end of file
+var _0xb8f0=['parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','isUserLimit','composable-middleware','../../mysqldb','../../config/environment','data1','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','final'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xb8f0,0x6d));var _0x0b8f=function(_0x34fafb,_0x50b7ab){_0x34fafb=_0x34fafb-0x0;var _0x2eee99=_0xb8f0[_0x34fafb];return _0x2eee99;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x0b8f('0x0'));var db=require(_0x0b8f('0x1'))['db'];var config=require(_0x0b8f('0x2'));function getValueFromLicense(_0x1caff6,_0x4da4ab){if(_0x1caff6&&_0x4da4ab){if(_0x4da4ab['data1']&&_0x4da4ab['license']){var _0x4ef3a9=_0x4da4ab[_0x0b8f('0x3')];var _0x84ebc8=_0x4da4ab['license'];var _0x3f64e0=_0x4ef3a9[_0x0b8f('0x4')]('-')[0x4];var _0x2fbc42=_0x4ef3a9['split']('-')[0x0];var _0x1ea34b=crypto['createDecipher'](_0x0b8f('0x5'),util[_0x0b8f('0x6')](_0x0b8f('0x7'),_0x3f64e0,_0x4ef3a9,_0x2fbc42));var _0x100fce=_0x1ea34b['update'](_0x84ebc8,_0x0b8f('0x8'),_0x0b8f('0x9'));_0x100fce+=_0x1ea34b[_0x0b8f('0xa')](_0x0b8f('0x9'));var _0x5581ed=JSON[_0x0b8f('0xb')](_0x100fce);return _0x5581ed[_0x0b8f('0xc')](_0x1caff6)?_0x5581ed[_0x1caff6]:null;}}return null;}function isLimit(_0x42f30d,_0x27ec33,_0x2611ff,_0x3da90b){var _0x467754=_0x27ec33;return compose()[_0x0b8f('0xd')](function(_0x570d8d,_0x321b44,_0x3bb078){return db[_0x0b8f('0xe')][_0x0b8f('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x0b8f('0x10')](function(_0x45c65e){var _0xccede8=getValueFromLicense(_0x42f30d,_0x45c65e);return _0xccede8?_0xccede8:_0x467754;})[_0x0b8f('0x10')](function(_0x2d0b32){_0x467754=_0x2d0b32;return _0x2611ff[_0x0b8f('0x11')](_0x3da90b);})[_0x0b8f('0x10')](function(_0x4a2937){if(_0x4a2937>=_0x467754){return _0x321b44[_0x0b8f('0x12')](0x193)[_0x0b8f('0x13')]({'message':util[_0x0b8f('0x6')](_0x0b8f('0x14'),_0x42f30d)});}_0x3bb078();})[_0x0b8f('0x15')](function(_0x10faa1){_0x3bb078(_0x10faa1);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x0b8f('0x16')},{'role':'user'}]}});}exports[_0x0b8f('0x17')]=isUserLimit;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb697=['NOT\x20IN\x20?','=\x20?','<>\x20?','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$startsWith','shift','utcOffset','add','hours','moment','parseSearch','startsWith','and','replace','[$and]','split','match','forEach','filter','indexOf','map','conditions','buildExpression','DATE','$eq','operator','$between','includes','$lte','value','format','YYYY-MM-DD','CAST(','field','\x20AS\x20','text','$ne','\x20IS\x20NULL)','$in','IN\x20?','$notIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb697,0xa8));var _0x7b69=function(_0x4c45e8,_0x140356){_0x4c45e8=_0x4c45e8-0x0;var _0x551fed=_0xb697[_0x4c45e8];return _0x551fed;};'use strict';var _=require('lodash');var moment=require(_0x7b69('0x0'));exports[_0x7b69('0x1')]=function(_0x1d0260){var _0x2a8808={'conditions':[]};_0x2a8808['sqlOperator']=_[_0x7b69('0x2')](_0x1d0260,'[$or]')?'or':_0x7b69('0x3');var _0x5e6665=_0x1d0260[_0x7b69('0x4')](_0x7b69('0x5'),'')['replace']('[$or]','')[_0x7b69('0x6')]('||');for(var _0x362a52=0x0;_0x362a52<_0x5e6665['length'];_0x362a52++){var _0x13a1ff=_0x5e6665[_0x362a52]['split'](':=');var _0x349d0d=_0x13a1ff[0x0];var _0x51d91e=_0x13a1ff['slice'](0x1);_0x51d91e['forEach'](function(_0x206f77){var _0x1b0551=_0x206f77[_0x7b69('0x6')]('[')['shift']();var _0x1c80e1=_0x206f77[_0x7b69('0x7')](/\[(.*?)\]/g);_0x1c80e1[_0x7b69('0x8')](function(_0x51488f){var _0x140697=_0x51488f['split']('[')[_0x7b69('0x9')](function(_0x2f5fda){return _0x2f5fda[_0x7b69('0xa')](']')>-0x1;})[_0x7b69('0xb')](function(_0x5c0ffc){return _0x5c0ffc['split'](']')[0x0];})[0x0];_0x2a8808[_0x7b69('0xc')]['push']({'field':_0x349d0d,'operator':_0x1b0551,'value':_0x140697});});});}return _0x2a8808;};exports[_0x7b69('0xd')]=function(_0x84dbad,_0x5d50dd,_0x2a3c83){var _0x3434a7={};if(_0x5d50dd===_0x7b69('0xe')){if(_0x2a3c83['operator']===_0x7b69('0xf')){_0x2a3c83[_0x7b69('0x10')]=_0x7b69('0x11');_0x2a3c83['value']+=','+_0x2a3c83['value'];}else if(_[_0x7b69('0x12')](['$gt',_0x7b69('0x13')],_0x2a3c83[_0x7b69('0x10')])){_0x2a3c83['value']=moment(_0x2a3c83[_0x7b69('0x14')])['add'](0x1,'days')[_0x7b69('0x15')](_0x7b69('0x16'));}}if(_0x2a3c83['castTo']){_0x5d50dd=_0x2a3c83['castTo'];_0x3434a7['text']=_0x7b69('0x17')+_0x84dbad+'.'+_0x2a3c83[_0x7b69('0x18')]+_0x7b69('0x19')+_0x2a3c83['castTo']+')\x20'+parseOperator(_0x2a3c83[_0x7b69('0x10')]);}else{_0x3434a7[_0x7b69('0x1a')]=_0x84dbad+'.'+_0x2a3c83[_0x7b69('0x18')]+'\x20'+parseOperator(_0x2a3c83[_0x7b69('0x10')]);}if(_[_0x7b69('0x12')]([_0x7b69('0x1b'),'$notIn'],_0x2a3c83[_0x7b69('0x10')]))_0x3434a7[_0x7b69('0x1a')]='('+_0x3434a7[_0x7b69('0x1a')]+'\x20OR\x20'+_0x84dbad+'.'+_0x2a3c83[_0x7b69('0x18')]+_0x7b69('0x1c');_0x3434a7['value']=parseValue(_0x5d50dd,_0x2a3c83['operator'],_0x2a3c83['value']);return _0x3434a7;};function parseOperator(_0x2b8943){var _0xfc1209;switch(_0x2b8943){case _0x7b69('0x1d'):_0xfc1209=_0x7b69('0x1e');break;case _0x7b69('0x1f'):_0xfc1209=_0x7b69('0x20');break;case _0x7b69('0xf'):_0xfc1209=_0x7b69('0x21');break;case _0x7b69('0x1b'):_0xfc1209=_0x7b69('0x22');break;case'$substring':case'$startsWith':case'$endsWith':_0xfc1209=_0x7b69('0x23');break;case _0x7b69('0x24'):_0xfc1209=_0x7b69('0x25');break;case'$gt':_0xfc1209=_0x7b69('0x26');break;case _0x7b69('0x13'):_0xfc1209=_0x7b69('0x27');break;case _0x7b69('0x28'):_0xfc1209=_0x7b69('0x29');break;case _0x7b69('0x11'):_0xfc1209=_0x7b69('0x2a');break;}return _0xfc1209;}function parseValue(_0x46d40e,_0x1cf1c9,_0x242948){var _0x297822={'start':undefined,'end':undefined};switch(_0x1cf1c9){case'$in':case _0x7b69('0x1f'):_0x297822[_0x7b69('0x2b')]=_0x242948[_0x7b69('0x6')](',');break;case _0x7b69('0x2c'):_0x297822[_0x7b69('0x2b')]='%'+_0x242948+'%';break;case _0x7b69('0x2d'):_0x297822[_0x7b69('0x2b')]=_0x242948+'%';break;case'$endsWith':_0x297822[_0x7b69('0x2b')]='%'+_0x242948;break;case _0x7b69('0x11'):var _0xe5b2aa=_0x242948[_0x7b69('0x6')](',');var _0x242948=_0xe5b2aa[_0x7b69('0x2e')]();var _0x34a45e=_0xe5b2aa['pop']();if(_0x46d40e===_0x7b69('0xe')){_0x242948=moment(_0x242948)[_0x7b69('0x2f')](0x0,!![])[_0x7b69('0x15')]();_0x34a45e=moment(_0x34a45e)['utcOffset'](0x0,!![])[_0x7b69('0x30')](0x17,_0x7b69('0x31'))[_0x7b69('0x30')](0x3b,'minutes')[_0x7b69('0x30')](0x3b,'seconds')[_0x7b69('0x15')]();}_0x297822={'start':_0x242948,'end':_0x34a45e};break;default:_0x297822[_0x7b69('0x2b')]=_0x242948;break;}return _0x297822;}
\ No newline at end of file
+var _0xd2c2=['utcOffset','hours','minutes','seconds','moment','[$or]','[$and]','replace','length','slice','forEach','indexOf','split','conditions','push','buildExpression','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','DATE'];(function(_0x46efff,_0x56f657){var _0x196cfc=function(_0x5212b1){while(--_0x5212b1){_0x46efff['push'](_0x46efff['shift']());}};_0x196cfc(++_0x56f657);}(_0xd2c2,0xfe));var _0x2d2c=function(_0x3f47ce,_0x168d68){_0x3f47ce=_0x3f47ce-0x0;var _0x1578d2=_0xd2c2[_0x3f47ce];return _0x1578d2;};'use strict';var _=require('lodash');var moment=require(_0x2d2c('0x0'));exports['parseSearch']=function(_0x11877e){var _0x58eaf0={'conditions':[]};_0x58eaf0['sqlOperator']=_['startsWith'](_0x11877e,_0x2d2c('0x1'))?'or':'and';var _0x30f75d=_0x11877e['replace'](_0x2d2c('0x2'),'')[_0x2d2c('0x3')](_0x2d2c('0x1'),'')['split']('||');for(var _0xe72888=0x0;_0xe72888<_0x30f75d[_0x2d2c('0x4')];_0xe72888++){var _0x405d22=_0x30f75d[_0xe72888]['split'](':=');var _0x4bf29b=_0x405d22[0x0];var _0x16c208=_0x405d22[_0x2d2c('0x5')](0x1);_0x16c208[_0x2d2c('0x6')](function(_0x285ed3){var _0x3eb5e4=_0x285ed3['split']('[')['shift']();var _0x74fa7f=_0x285ed3['match'](/\[(.*?)\]/g);_0x74fa7f[_0x2d2c('0x6')](function(_0x5caa4e){var _0x2959c5=_0x5caa4e['split']('[')['filter'](function(_0x363aba){return _0x363aba[_0x2d2c('0x7')](']')>-0x1;})['map'](function(_0x2196ac){return _0x2196ac[_0x2d2c('0x8')](']')[0x0];})[0x0];_0x58eaf0[_0x2d2c('0x9')][_0x2d2c('0xa')]({'field':_0x4bf29b,'operator':_0x3eb5e4,'value':_0x2959c5});});});}return _0x58eaf0;};exports[_0x2d2c('0xb')]=function(_0x49ba9b,_0x13d86a,_0x2d6995){var _0x36d0e2={};if(_0x13d86a==='DATE'){if(_0x2d6995[_0x2d2c('0xc')]==='$eq'){_0x2d6995[_0x2d2c('0xc')]=_0x2d2c('0xd');_0x2d6995[_0x2d2c('0xe')]+=','+_0x2d6995[_0x2d2c('0xe')];}else if(_[_0x2d2c('0xf')]([_0x2d2c('0x10'),_0x2d2c('0x11')],_0x2d6995['operator'])){_0x2d6995[_0x2d2c('0xe')]=moment(_0x2d6995[_0x2d2c('0xe')])[_0x2d2c('0x12')](0x1,_0x2d2c('0x13'))[_0x2d2c('0x14')](_0x2d2c('0x15'));}}if(_0x2d6995[_0x2d2c('0x16')]){_0x13d86a=_0x2d6995['castTo'];_0x36d0e2[_0x2d2c('0x17')]=_0x2d2c('0x18')+_0x49ba9b+'.'+_0x2d6995[_0x2d2c('0x19')]+_0x2d2c('0x1a')+_0x2d6995[_0x2d2c('0x16')]+')\x20'+parseOperator(_0x2d6995['operator']);}else{_0x36d0e2[_0x2d2c('0x17')]=_0x49ba9b+'.'+_0x2d6995[_0x2d2c('0x19')]+'\x20'+parseOperator(_0x2d6995['operator']);}if(_[_0x2d2c('0xf')]([_0x2d2c('0x1b'),_0x2d2c('0x1c')],_0x2d6995[_0x2d2c('0xc')]))_0x36d0e2['text']='('+_0x36d0e2[_0x2d2c('0x17')]+_0x2d2c('0x1d')+_0x49ba9b+'.'+_0x2d6995[_0x2d2c('0x19')]+_0x2d2c('0x1e');_0x36d0e2[_0x2d2c('0xe')]=parseValue(_0x13d86a,_0x2d6995[_0x2d2c('0xc')],_0x2d6995[_0x2d2c('0xe')]);return _0x36d0e2;};function parseOperator(_0xcd5f33){var _0x42301b;switch(_0xcd5f33){case _0x2d2c('0x1f'):_0x42301b=_0x2d2c('0x20');break;case _0x2d2c('0x1c'):_0x42301b=_0x2d2c('0x21');break;case _0x2d2c('0x22'):_0x42301b='=\x20?';break;case _0x2d2c('0x1b'):_0x42301b='<>\x20?';break;case _0x2d2c('0x23'):case _0x2d2c('0x24'):case _0x2d2c('0x25'):_0x42301b=_0x2d2c('0x26');break;case _0x2d2c('0x27'):_0x42301b='<\x20?';break;case _0x2d2c('0x10'):_0x42301b='>\x20?';break;case _0x2d2c('0x11'):_0x42301b=_0x2d2c('0x28');break;case _0x2d2c('0x29'):_0x42301b=_0x2d2c('0x2a');break;case _0x2d2c('0xd'):_0x42301b=_0x2d2c('0x2b');break;}return _0x42301b;}function parseValue(_0x5b18ab,_0x5c322c,_0x4474ea){var _0x3b6dec={'start':undefined,'end':undefined};switch(_0x5c322c){case _0x2d2c('0x1f'):case _0x2d2c('0x1c'):_0x3b6dec[_0x2d2c('0x2c')]=_0x4474ea['split'](',');break;case _0x2d2c('0x23'):_0x3b6dec[_0x2d2c('0x2c')]='%'+_0x4474ea+'%';break;case _0x2d2c('0x24'):_0x3b6dec[_0x2d2c('0x2c')]=_0x4474ea+'%';break;case'$endsWith':_0x3b6dec[_0x2d2c('0x2c')]='%'+_0x4474ea;break;case _0x2d2c('0xd'):var _0x4f43c4=_0x4474ea[_0x2d2c('0x8')](',');var _0x4474ea=_0x4f43c4['shift']();var _0xd90d5d=_0x4f43c4['pop']();if(_0x5b18ab===_0x2d2c('0x2d')){_0x4474ea=moment(_0x4474ea)[_0x2d2c('0x2e')](0x0,!![])[_0x2d2c('0x14')]();_0xd90d5d=moment(_0xd90d5d)['utcOffset'](0x0,!![])[_0x2d2c('0x12')](0x17,_0x2d2c('0x2f'))[_0x2d2c('0x12')](0x3b,_0x2d2c('0x30'))[_0x2d2c('0x12')](0x3b,_0x2d2c('0x31'))[_0x2d2c('0x14')]();}_0x3b6dec={'start':_0x4474ea,'end':_0xd90d5d};break;default:_0x3b6dec[_0x2d2c('0x2c')]=_0x4474ea;break;}return _0x3b6dec;}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85d8=['match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','push','replace','join','getOptions','query','$id','name','intersection','attributes','nolimit','where','pick','filter','object','columns','type','lower','options','include','lodash','sequelize','moment','../../mysqldb','parse','keys','model','alias','fields','raw','split','filters','isEmpty','forOwn','DATE','isPlainObject','$gte','utc','format','$lte','YYYY-MM-DD','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','cast','col','priority','substr','DESC','unsigned','ASC','omit','length','isObject','isString','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0x85d8,0x1b0));var _0x885d=function(_0x12bb96,_0x286131){_0x12bb96=_0x12bb96-0x0;var _0x385fd7=_0x85d8[_0x12bb96];return _0x385fd7;};'use strict';var _=require(_0x885d('0x0'));var sequelize=require(_0x885d('0x1'));var moment=require(_0x885d('0x2'));var db=require(_0x885d('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3e5eab){var _0x5bad48=['ne'];try{var _0x328261=JSON[_0x885d('0x4')](_0x3e5eab);var _0x320d7d=Object[_0x885d('0x5')](_0x328261)[0x0];return _0x5bad48['includes'](_0x320d7d);}catch(_0x586a81){return![];}}function getOperatorValue(_0x186504){var _0x30dcc2=JSON[_0x885d('0x4')](_0x186504);var _0x1df2e5=Object[_0x885d('0x5')](_0x30dcc2)[0x0];var _0x11e6d7=_0x30dcc2[_0x1df2e5];return{['$'+_0x1df2e5]:_0x11e6d7};}function parseIncludeModel(_0x1a9f6e){var _0xe09cf7=JSON[_0x885d('0x4')](_0x1a9f6e);return{'model':db[_0xe09cf7[_0x885d('0x6')]],'as':_0xe09cf7[_0x885d('0x7')],'attributes':_0xe09cf7[_0x885d('0x8')],'raw':_0xe09cf7[_0x885d('0x9')]};}exports[_0x885d('0x8')]=function(_0x19c903){var _0x46bd88=null;if(_0x19c903){_0x46bd88=_0x19c903[_0x885d('0xa')](',');}return _0x46bd88;};exports[_0x885d('0xb')]=function(_0x37a4b1,_0x503ea7){var _0x542805={};if(!_[_0x885d('0xc')](_0x37a4b1)){_[_0x885d('0xd')](_0x37a4b1,function(_0x495a56,_0x330b42){try{if(_0x503ea7){var _0x458d5d=_['find'](_0x503ea7,{'name':_0x330b42})||{};if(hasSequelizeOperator(_0x495a56)){_0x542805[_0x330b42]=getOperatorValue(_0x495a56);}else if(_0x458d5d['type']===_0x885d('0xe')&&_[_0x885d('0xf')](_0x495a56)){var _0x143ee3=JSON[_0x885d('0x4')](_0x495a56);var _0x2ecb5c={'$gte':moment(moment(_0x143ee3[_0x885d('0x10')])['format']('YYYY-MM-DD'))[_0x885d('0x11')]()[_0x885d('0x12')](),'$lte':moment(moment(_0x143ee3[_0x885d('0x13')])[_0x885d('0x12')](_0x885d('0x14')))[_0x885d('0x11')]()[_0x885d('0x15')](0x1,'s')[_0x885d('0x12')]()};_0x542805[_0x330b42]=_0x2ecb5c;}else if(_0x458d5d['name']===_0x885d('0x16')){_0x542805[_0x330b42]=_0x495a56;}else{_0x542805[_0x330b42]=_[_0x885d('0x17')](_0x495a56)?_0x495a56:JSON[_0x885d('0x4')](_0x495a56);}}else{_0x542805[_0x330b42]=_[_0x885d('0x17')](_0x495a56)?_0x495a56:JSON[_0x885d('0x4')](_0x495a56);}}catch(_0x5a72b8){_0x542805[_0x330b42]=_0x495a56[_0x885d('0xa')](',');}});}return _0x542805;};exports[_0x885d('0x18')]=function(_0x55738d){_0x55738d=parseInt(_0x55738d,0xa);if(!_0x55738d||_0x55738d<0x0){_0x55738d=LIMIT_VALUE;}return _0x55738d;};exports[_0x885d('0x19')]=function(_0x583637){_0x583637=parseInt(_0x583637,0xa);if(!_0x583637||_0x583637<0x0){_0x583637=0x0;}return _0x583637;};exports[_0x885d('0x1a')]=function(_0x2a1c31){var _0x22550d,_0x90589=null;if(_0x2a1c31){_0x22550d=_0x2a1c31[_0x885d('0xa')](',');_0x90589=_[_0x885d('0x1b')](_0x22550d,function(_0x22220e){if(_0x22220e[_0x885d('0x1c')]('-')===0x0){return[_0x22220e==='priority'?sequelize[_0x885d('0x1d')](sequelize[_0x885d('0x1e')](_0x885d('0x1f')),'unsigned'):_0x22220e[_0x885d('0x20')](0x1),_0x885d('0x21')];}else{return[_0x22220e===_0x885d('0x1f')?sequelize[_0x885d('0x1d')](sequelize[_0x885d('0x1e')](_0x885d('0x1f')),_0x885d('0x22')):_0x22220e,_0x885d('0x23')];}});}return _0x90589;};exports[_0x885d('0x24')]=function(_0x54e121,_0x5eb6a0){if(_[_0x885d('0xc')](_0x54e121)){return _0x54e121;}if(_['isArray'](_0x54e121)){for(var _0x1dda46=0x0;_0x1dda46<_0x54e121[_0x885d('0x25')];_0x1dda46+=0x1){_0x54e121[_0x1dda46]=this[_0x885d('0x24')](_0x54e121[_0x1dda46],_0x5eb6a0);}return _0x54e121;}if(!_[_0x885d('0x26')](_0x54e121)){return _0x54e121;}if(_[_0x885d('0x27')](_0x5eb6a0)){_0x5eb6a0=[_0x5eb6a0];}if(!_[_0x885d('0x17')](_0x5eb6a0)){return _0x54e121;}for(var _0x537886=0x0;_0x537886<_0x5eb6a0[_0x885d('0x25')];_0x537886+=0x1){_[_0x885d('0x28')](_0x54e121,_0x5eb6a0[_0x537886]);}for(var _0x502e8d in _0x54e121){if(_0x54e121[_0x885d('0x29')](_0x502e8d)){_0x54e121[_0x502e8d]=this['omit'](_0x54e121[_0x502e8d],_0x5eb6a0);}}return _0x54e121;};exports['isNumeric']=function(_0x3db722){return _0x3db722['match'](RegExp(_0x885d('0x2a')))?!![]:![];};exports[_0x885d('0x2b')]=function(_0x20a5f8){return _0x20a5f8[_0x885d('0x2c')](/^\S+@\S+$/)?!![]:![];};exports[_0x885d('0x2d')]=function(_0x2b0ea6,_0x5a0f63){var _0x3347da=[];var _0x197c27=/[ `!@#$%^&*()_\-?~]/;var _0x3aab64=_0x5a0f63?_0x885d('0x2e'):_0x885d('0x2f');_0x2b0ea6['split'](/[ ,]+/)[_0x885d('0x30')](function(_0x426b38){_0x426b38=_0x426b38['replace'](/([^:]")"+/g,'$1');_0x426b38='+'+_0x426b38+'*';var _0x168a2a=_0x426b38[_0x885d('0x2c')](_0x197c27);if(_0x168a2a){_0x426b38='\x22'+_0x426b38+'\x22';}_0x3347da[_0x885d('0x31')](_0x426b38);});_0x3aab64=_0x3aab64[_0x885d('0x32')](_0x885d('0x2f'),_0x3347da[_0x885d('0x33')]('\x20'));return _0x3aab64;};exports[_0x885d('0x34')]=function(_0x46694c,_0x5547e8,_0x5b9d7b){var _0x5560af={},_0x488a93={};if(_0x5547e8[_0x885d('0x35')][_0x885d('0x36')]){_0x5547e8['query']['id']=_0x5547e8[_0x885d('0x35')]['$id'];delete _0x5547e8[_0x885d('0x35')][_0x885d('0x36')];}_0x5560af[_0x885d('0x6')]=_[_0x885d('0x1b')](_0x46694c,_0x885d('0x37'));_0x5560af[_0x885d('0x35')]=_[_0x885d('0x5')](_0x5547e8['query']);_0x5560af['filters']=_[_0x885d('0x38')](_0x5560af['model'],_0x5560af[_0x885d('0x35')]);_0x488a93['attributes']=_['intersection'](_0x5560af[_0x885d('0x6')],this[_0x885d('0x8')](_0x5547e8[_0x885d('0x35')][_0x885d('0x8')]));_0x488a93[_0x885d('0x39')]=_0x488a93[_0x885d('0x39')][_0x885d('0x25')]?_0x488a93[_0x885d('0x39')]:_0x5560af[_0x885d('0x6')];if(!_0x5547e8[_0x885d('0x35')][_0x885d('0x29')](_0x885d('0x3a'))){_0x488a93[_0x885d('0x18')]=this[_0x885d('0x18')](_0x5547e8[_0x885d('0x35')][_0x885d('0x18')]);_0x488a93['offset']=this[_0x885d('0x19')](_0x5547e8[_0x885d('0x35')][_0x885d('0x19')]);}_0x488a93['order']=this['sort'](_0x5547e8[_0x885d('0x35')][_0x885d('0x1a')]);_0x488a93[_0x885d('0x3b')]=this[_0x885d('0xb')](_[_0x885d('0x3c')](_0x5547e8['query'],_0x5560af[_0x885d('0xb')]),_0x46694c);if(_0x5547e8['query'][_0x885d('0x3d')]){var _0x13a74c=_0x46694c;var _0x52b601=_0x5547e8[_0x885d('0x35')]['filter'];if(typeof _0x52b601===_0x885d('0x3e')){_0x13a74c=_[_0x885d('0x3d')](_0x46694c,function(_0x484094){return _['includes'](_0x52b601[_0x885d('0x3f')],_0x484094[_0x885d('0x37')]);});_0x52b601=_0x52b601['value'];}_0x488a93['where']=_['merge'](_0x488a93[_0x885d('0x3b')],{'$or':_[_0x885d('0x1b')](_0x13a74c,function(_0x123e25){if(_0x123e25[_0x885d('0x40')]!=='VIRTUAL'){if(_0x5b9d7b){return sequelize[_0x885d('0x3b')](sequelize['fn'](_0x885d('0x41'),sequelize[_0x885d('0x1e')](_0x123e25[_0x885d('0x37')])),{'$like':sequelize['fn'](_0x885d('0x41'),'%'+_0x5547e8[_0x885d('0x35')][_0x885d('0x3d')]+'%')});}else{var _0x28ca61={};_0x28ca61[_0x123e25['name']]={'$like':'%'+_0x5547e8[_0x885d('0x35')][_0x885d('0x3d')]+'%'};return _0x28ca61;}}})});}_0x488a93=_['merge']({},_0x488a93,_0x5547e8[_0x885d('0x42')]);return _0x488a93;};exports[_0x885d('0x43')]=function(_0xe429ff){var _0x5c414c=[];if(_0xe429ff['includeAll']){_0x5c414c[_0x885d('0x31')]({'all':!![]});}else if(_0xe429ff[_0x885d('0x43')]){if(Array[_0x885d('0x17')](_0xe429ff[_0x885d('0x43')])){_0x5c414c=Object[_0x885d('0x5')](_0xe429ff[_0x885d('0x43')])[_0x885d('0x1b')](function(_0x4cce44){return parseIncludeModel(_0xe429ff['include'][_0x4cce44]);});}else{var _0x151615=parseIncludeModel(_0xe429ff[_0x885d('0x43')]);_0x5c414c[_0x885d('0x31')](_0x151615);}}return _0x5c414c;};
\ No newline at end of file
+var _0xf421=['priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','query','$id','attributes','nolimit','order','pick','filter','object','columns','where','merge','VIRTUAL','lower','options','include','sequelize','moment','../../mysqldb','keys','includes','parse','model','alias','fields','filters','isEmpty','forOwn','find','type','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','split','limit','offset','sort','map','cast','col'];(function(_0x1a5c58,_0x4e1971){var _0x24a840=function(_0x50ac79){while(--_0x50ac79){_0x1a5c58['push'](_0x1a5c58['shift']());}};_0x24a840(++_0x4e1971);}(_0xf421,0x64));var _0x1f42=function(_0xdb628e,_0x103e9a){_0xdb628e=_0xdb628e-0x0;var _0x493aa5=_0xf421[_0xdb628e];return _0x493aa5;};'use strict';var _=require('lodash');var sequelize=require(_0x1f42('0x0'));var moment=require(_0x1f42('0x1'));var db=require(_0x1f42('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2800cb){var _0xb3d252=['ne'];try{var _0xa65d9f=JSON['parse'](_0x2800cb);var _0x12ec7a=Object[_0x1f42('0x3')](_0xa65d9f)[0x0];return _0xb3d252[_0x1f42('0x4')](_0x12ec7a);}catch(_0x264046){return![];}}function getOperatorValue(_0x1dd444){var _0x5e507c=JSON['parse'](_0x1dd444);var _0x1eb2a6=Object[_0x1f42('0x3')](_0x5e507c)[0x0];var _0x42ee5b=_0x5e507c[_0x1eb2a6];return{['$'+_0x1eb2a6]:_0x42ee5b};}function parseIncludeModel(_0x3006c7){var _0x452baf=JSON[_0x1f42('0x5')](_0x3006c7);return{'model':db[_0x452baf[_0x1f42('0x6')]],'as':_0x452baf[_0x1f42('0x7')],'attributes':_0x452baf[_0x1f42('0x8')],'raw':_0x452baf['raw']};}exports[_0x1f42('0x8')]=function(_0xa9bbea){var _0x4dfa15=null;if(_0xa9bbea){_0x4dfa15=_0xa9bbea['split'](',');}return _0x4dfa15;};exports[_0x1f42('0x9')]=function(_0x12513c,_0x529608){var _0x15bde4={};if(!_[_0x1f42('0xa')](_0x12513c)){_[_0x1f42('0xb')](_0x12513c,function(_0x2d4312,_0x477311){try{if(_0x529608){var _0x35502b=_[_0x1f42('0xc')](_0x529608,{'name':_0x477311})||{};if(hasSequelizeOperator(_0x2d4312)){_0x15bde4[_0x477311]=getOperatorValue(_0x2d4312);}else if(_0x35502b[_0x1f42('0xd')]==='DATE'&&_['isPlainObject'](_0x2d4312)){var _0x1b554f=JSON[_0x1f42('0x5')](_0x2d4312);var _0x2281cb={'$gte':moment(moment(_0x1b554f[_0x1f42('0xe')])['format'](_0x1f42('0xf')))[_0x1f42('0x10')]()[_0x1f42('0x11')](),'$lte':moment(moment(_0x1b554f[_0x1f42('0x12')])[_0x1f42('0x11')](_0x1f42('0xf')))[_0x1f42('0x10')]()[_0x1f42('0x13')](0x1,'s')['format']()};_0x15bde4[_0x477311]=_0x2281cb;}else if(_0x35502b[_0x1f42('0x14')]===_0x1f42('0x15')){_0x15bde4[_0x477311]=_0x2d4312;}else{_0x15bde4[_0x477311]=_['isArray'](_0x2d4312)?_0x2d4312:JSON[_0x1f42('0x5')](_0x2d4312);}}else{_0x15bde4[_0x477311]=_[_0x1f42('0x16')](_0x2d4312)?_0x2d4312:JSON[_0x1f42('0x5')](_0x2d4312);}}catch(_0x12a84a){_0x15bde4[_0x477311]=_0x2d4312[_0x1f42('0x17')](',');}});}return _0x15bde4;};exports[_0x1f42('0x18')]=function(_0x3a4479){_0x3a4479=parseInt(_0x3a4479,0xa);if(!_0x3a4479||_0x3a4479<0x0){_0x3a4479=LIMIT_VALUE;}return _0x3a4479;};exports[_0x1f42('0x19')]=function(_0x399b5e){_0x399b5e=parseInt(_0x399b5e,0xa);if(!_0x399b5e||_0x399b5e<0x0){_0x399b5e=0x0;}return _0x399b5e;};exports[_0x1f42('0x1a')]=function(_0x2d5c8d){var _0x21fef8,_0x55b55a=null;if(_0x2d5c8d){_0x21fef8=_0x2d5c8d[_0x1f42('0x17')](',');_0x55b55a=_[_0x1f42('0x1b')](_0x21fef8,function(_0x205566){if(_0x205566['indexOf']('-')===0x0){return[_0x205566==='priority'?sequelize[_0x1f42('0x1c')](sequelize[_0x1f42('0x1d')](_0x1f42('0x1e')),_0x1f42('0x1f')):_0x205566['substr'](0x1),_0x1f42('0x20')];}else{return[_0x205566===_0x1f42('0x1e')?sequelize[_0x1f42('0x1c')](sequelize['col']('priority'),'unsigned'):_0x205566,_0x1f42('0x21')];}});}return _0x55b55a;};exports[_0x1f42('0x22')]=function(_0x4f043d,_0x3e2a68){if(_[_0x1f42('0xa')](_0x4f043d)){return _0x4f043d;}if(_[_0x1f42('0x16')](_0x4f043d)){for(var _0x3be169=0x0;_0x3be169<_0x4f043d[_0x1f42('0x23')];_0x3be169+=0x1){_0x4f043d[_0x3be169]=this[_0x1f42('0x22')](_0x4f043d[_0x3be169],_0x3e2a68);}return _0x4f043d;}if(!_[_0x1f42('0x24')](_0x4f043d)){return _0x4f043d;}if(_[_0x1f42('0x25')](_0x3e2a68)){_0x3e2a68=[_0x3e2a68];}if(!_[_0x1f42('0x16')](_0x3e2a68)){return _0x4f043d;}for(var _0x503f1c=0x0;_0x503f1c<_0x3e2a68[_0x1f42('0x23')];_0x503f1c+=0x1){_[_0x1f42('0x26')](_0x4f043d,_0x3e2a68[_0x503f1c]);}for(var _0x221a09 in _0x4f043d){if(_0x4f043d[_0x1f42('0x27')](_0x221a09)){_0x4f043d[_0x221a09]=this['omit'](_0x4f043d[_0x221a09],_0x3e2a68);}}return _0x4f043d;};exports[_0x1f42('0x28')]=function(_0x364b77){return _0x364b77['match'](RegExp(_0x1f42('0x29')))?!![]:![];};exports[_0x1f42('0x2a')]=function(_0x135708){return _0x135708[_0x1f42('0x2b')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x360665,_0x1d78e4){var _0x524de7=[];var _0x138a1e=/[ `!@#$%^&*()_\-?~]/;var _0x3f310a=_0x1d78e4?_0x1f42('0x2c'):_0x1f42('0x2d');_0x360665['split'](/[ ,]+/)[_0x1f42('0x2e')](function(_0x3845c1){_0x3845c1=_0x3845c1[_0x1f42('0x2f')](/([^:]")"+/g,'$1');_0x3845c1='+'+_0x3845c1+'*';var _0x4b4477=_0x3845c1[_0x1f42('0x2b')](_0x138a1e);if(_0x4b4477){_0x3845c1='\x22'+_0x3845c1+'\x22';}_0x524de7[_0x1f42('0x30')](_0x3845c1);});_0x3f310a=_0x3f310a[_0x1f42('0x2f')](_0x1f42('0x2d'),_0x524de7[_0x1f42('0x31')]('\x20'));return _0x3f310a;};exports['getOptions']=function(_0x4a7772,_0x296037,_0x412317){var _0x53e262={},_0x4953d1={};if(_0x296037[_0x1f42('0x32')]['$id']){_0x296037['query']['id']=_0x296037[_0x1f42('0x32')][_0x1f42('0x33')];delete _0x296037[_0x1f42('0x32')]['$id'];}_0x53e262[_0x1f42('0x6')]=_[_0x1f42('0x1b')](_0x4a7772,_0x1f42('0x14'));_0x53e262['query']=_['keys'](_0x296037[_0x1f42('0x32')]);_0x53e262[_0x1f42('0x9')]=_['intersection'](_0x53e262[_0x1f42('0x6')],_0x53e262[_0x1f42('0x32')]);_0x4953d1[_0x1f42('0x34')]=_['intersection'](_0x53e262[_0x1f42('0x6')],this[_0x1f42('0x8')](_0x296037['query'][_0x1f42('0x8')]));_0x4953d1['attributes']=_0x4953d1[_0x1f42('0x34')][_0x1f42('0x23')]?_0x4953d1[_0x1f42('0x34')]:_0x53e262[_0x1f42('0x6')];if(!_0x296037[_0x1f42('0x32')][_0x1f42('0x27')](_0x1f42('0x35'))){_0x4953d1[_0x1f42('0x18')]=this[_0x1f42('0x18')](_0x296037[_0x1f42('0x32')][_0x1f42('0x18')]);_0x4953d1['offset']=this[_0x1f42('0x19')](_0x296037[_0x1f42('0x32')][_0x1f42('0x19')]);}_0x4953d1[_0x1f42('0x36')]=this['sort'](_0x296037[_0x1f42('0x32')]['sort']);_0x4953d1['where']=this[_0x1f42('0x9')](_[_0x1f42('0x37')](_0x296037[_0x1f42('0x32')],_0x53e262[_0x1f42('0x9')]),_0x4a7772);if(_0x296037[_0x1f42('0x32')][_0x1f42('0x38')]){var _0x4e602e=_0x4a7772;var _0x51f921=_0x296037['query'][_0x1f42('0x38')];if(typeof _0x51f921===_0x1f42('0x39')){_0x4e602e=_['filter'](_0x4a7772,function(_0x282098){return _[_0x1f42('0x4')](_0x51f921[_0x1f42('0x3a')],_0x282098[_0x1f42('0x14')]);});_0x51f921=_0x51f921['value'];}_0x4953d1[_0x1f42('0x3b')]=_[_0x1f42('0x3c')](_0x4953d1['where'],{'$or':_[_0x1f42('0x1b')](_0x4e602e,function(_0x5f5b31){if(_0x5f5b31[_0x1f42('0xd')]!==_0x1f42('0x3d')){if(_0x412317){return sequelize[_0x1f42('0x3b')](sequelize['fn'](_0x1f42('0x3e'),sequelize[_0x1f42('0x1d')](_0x5f5b31['name'])),{'$like':sequelize['fn'](_0x1f42('0x3e'),'%'+_0x296037[_0x1f42('0x32')][_0x1f42('0x38')]+'%')});}else{var _0xedd2df={};_0xedd2df[_0x5f5b31['name']]={'$like':'%'+_0x296037[_0x1f42('0x32')][_0x1f42('0x38')]+'%'};return _0xedd2df;}}})});}_0x4953d1=_[_0x1f42('0x3c')]({},_0x4953d1,_0x296037[_0x1f42('0x3f')]);return _0x4953d1;};exports[_0x1f42('0x40')]=function(_0x6667df){var _0x39a133=[];if(_0x6667df['includeAll']){_0x39a133[_0x1f42('0x30')]({'all':!![]});}else if(_0x6667df[_0x1f42('0x40')]){if(Array[_0x1f42('0x16')](_0x6667df[_0x1f42('0x40')])){_0x39a133=Object[_0x1f42('0x3')](_0x6667df[_0x1f42('0x40')])[_0x1f42('0x1b')](function(_0x5e6904){return parseIncludeModel(_0x6667df['include'][_0x5e6904]);});}else{var _0x1c1fbe=parseIncludeModel(_0x6667df[_0x1f42('0x40')]);_0x39a133[_0x1f42('0x30')](_0x1c1fbe);}}return _0x39a133;};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7da7=['whatsappStatus','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','unknown','*pause','busy','isArray','startCase','Queue','map','getAgents','all','then','flatten','uniq','value','getAgentIdsByStatus','includes','User','findAll','chatPause','openchannelPause','pauseType','globalStatus','split','fields','order','DESC','fullname','indexOf','internal','validateSortParameter','pause','toLowerCase','sortAgentsByStatus','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','filterAgentAttributes','name','role','userpic','voiceStatusTime','whatsappStatusTime','openchannelCapacity','chatCurrentCapacity','smsCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','smsPause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voicePause','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus'];(function(_0x49391e,_0x52f162){var _0x331497=function(_0x58a7b9){while(--_0x58a7b9){_0x49391e['push'](_0x49391e['shift']());}};_0x331497(++_0x52f162);}(_0x7da7,0x10d));var _0x77da=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x7da7[_0x4a5f6c];return _0x281ffd;};'use strict';var _=require(_0x77da('0x0'));var jayson=require(_0x77da('0x1'));var db=require(_0x77da('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x77da('0x3')][_0x77da('0x4')]({'port':0x232c});function isAgentPaused(_0x4f60c3,_0x3a9fa6){var _0x37b3d9=[_0x4f60c3['chatPause'],_0x4f60c3[_0x77da('0x5')],_0x4f60c3[_0x77da('0x6')],_0x4f60c3['openchannelPause'],_0x4f60c3[_0x77da('0x7')],_0x4f60c3['voicePause'],_0x4f60c3[_0x77da('0x8')]];if(!_0x3a9fa6)return _[_0x77da('0x9')](_0x37b3d9);var _0x37c5ab=_[_0x77da('0xa')](_0x37b3d9);return _0x37c5ab[_0x77da('0xb')]>0x0&&_0x37c5ab['length']<_0x37b3d9[_0x77da('0xb')]?!![]:![];}function isIdle(_0xb55827){return _0xb55827===_0x77da('0xc')||_0xb55827==='unknown'||_0xb55827===_0x77da('0xd')||_0xb55827===_0x77da('0xe')||_[_0x77da('0xf')](_0xb55827);}function isAgentIdle(_0x2a675a){if(_0x2a675a['voiceStatus']!==_0x77da('0xc')&&_0x2a675a[_0x77da('0x10')]){_0x2a675a[_0x77da('0x11')]='pause';return![];}return _['every']([_0x2a675a[_0x77da('0x12')],_0x2a675a[_0x77da('0x13')],_0x2a675a['mailStatus'],_0x2a675a[_0x77da('0x14')],_0x2a675a[_0x77da('0x15')],_0x2a675a[_0x77da('0x11')],_0x2a675a[_0x77da('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x77da('0x17'),{})['then'](function(_0x29cd7b){if(_0x29cd7b[_0x77da('0x18')]){throw new Error(_0x77da('0x19'));}var _0x4500c4=_0x29cd7b['result'];return routingClient['request']('Agents',{})['then'](function(_0x103e46){if(_0x103e46[_0x77da('0x18')]){throw new Error(_0x77da('0x1a'));}var _0x335dcb=_0x103e46[_0x77da('0x1b')];return _[_0x77da('0x1c')]({},_0x4500c4,_0x335dcb);});})[_0x77da('0x1d')](function(_0x3b6dde){throw _0x3b6dde;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x492063){var _0xd5a809=_0x77da('0x1e');if(isAgentPaused(_0x492063))_0xd5a809='pause';else if(isAgentPaused(_0x492063,!![]))_0xd5a809=_0x77da('0x1f');else if(isAgentIdle(_0x492063))_0xd5a809=_0x77da('0xc');else _0xd5a809=_0x77da('0x20');return _0xd5a809;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x58270c,_0x3e6cfe){var _0x58f6c1=_[_0x77da('0x21')](_0x58270c)?_0x58270c:[_0x58270c];var _0x1c27aa=_[_0x77da('0x22')](_0x3e6cfe)+_0x77da('0x23');var _0x10399a=_[_0x77da('0x24')](_0x58f6c1,function(_0x95b5db){return db[_0x1c27aa]['findOne']({'where':{'id':_0x95b5db}})['then'](function(_0xfd160){if(!_0xfd160)return[];return _0xfd160[_0x77da('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x77da('0x26')](_0x10399a)[_0x77da('0x27')](function(_0x545654){var _0x42240b=_(_0x545654)[_0x77da('0x28')]()[_0x77da('0x24')]('id')[_0x77da('0x29')]()[_0x77da('0x2a')]();return _0x42240b;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xce24b8,_0x3e090d,_0x1f2279){try{if(_0x3e090d[_0x77da('0xb')]>0x0){_0xce24b8=_0xce24b8['filter'](function(_0x5b4638){return _0x3e090d['includes'](_0x5b4638['id']);});}var _0x2258e9=_0xce24b8[_0x77da('0xa')](function(_0x410d09){var _0x3394d6=_0x77da('0x20');if(isAgentIdle(_0x410d09)){_0x3394d6='idle';}return _0x3394d6===_0x1f2279;});return _[_0x77da('0x24')](_0x2258e9,'id');}catch(_0x26f5a0){throw _0x26f5a0;}}exports[_0x77da('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d381b,_0x1e7853,_0x46e6b4){return Promise['resolve']()[_0x77da('0x27')](function(){if(_0x1e7853[_0x77da('0xb')]>0x0){_0x1d381b=_0x1d381b[_0x77da('0xa')](function(_0x38643a){return _0x1e7853[_0x77da('0x2c')](_0x38643a['id']);});}return _0x1d381b;})[_0x77da('0x27')](function(){return db[_0x77da('0x2d')][_0x77da('0x2e')]({'attributes':['id','name','fullname',_0x77da('0x2f'),_0x77da('0x5'),'mailPause',_0x77da('0x30'),_0x77da('0x7'),_0x77da('0x10'),_0x77da('0x8'),_0x77da('0x31')],'where':{'id':{'$in':_[_0x77da('0x24')](_0x1d381b,'id')}},'raw':!![]});})[_0x77da('0x27')](function(_0x5c4a03){return _0x5c4a03[_0x77da('0x24')](function(_0x4df4b9){var _0x54b7f2=_['find'](_0x1d381b,['id',_0x4df4b9['id']]);var _0x17d236=filterAgentAttributes(_0x54b7f2);_['merge'](_0x4df4b9,_0x17d236);_0x4df4b9[_0x77da('0x32')]=getAgentStatus(_0x4df4b9);return _0x4df4b9;});})[_0x77da('0x27')](function(_0xce9df2){var _0x3cc78b=sortAgentsByStatus(_0xce9df2,_0x46e6b4);return _[_0x77da('0x24')](_0x3cc78b,'id');})[_0x77da('0x1d')](function(_0x43c20a){throw _0x43c20a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x297d49){var _0x467410={'fields':[],'order':null};var _0x1ca53a=_0x297d49[_0x77da('0x33')](',');_0x467410[_0x77da('0x34')]=_[_0x77da('0xa')](_0x1ca53a,function(_0x48fccc){if(!_0x48fccc[_0x77da('0x2c')](_0x77da('0x32'))){return!![];}_0x467410[_0x77da('0x35')]=_['startsWith'](_0x48fccc,'-')?_0x77da('0x36'):'ASC';return![];});return _0x467410;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x599e21){if(!_0x599e21){_0x599e21='fullname,internal';}if(_0x599e21[_0x77da('0x2c')](_0x77da('0x37'))&&!_0x599e21[_0x77da('0x2c')]('internal')){var _0x21d337=_0x599e21['substring'](0x0,_0x599e21[_0x77da('0x38')]('fullname'));_0x599e21+=','+_0x21d337+_0x77da('0x39');}return _0x599e21;}exports[_0x77da('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x290667,_0x1612b7){var _0x240bee=_0x290667['sort'](function(_0x759b86,_0x1f48bd){if(_0x759b86[_0x77da('0x32')]===_0x1f48bd[_0x77da('0x32')]){if(_0x759b86[_0x77da('0x32')]===_0x77da('0x3b')){if(_0x1612b7==='DESC'){return(_0x759b86[_0x77da('0x31')]||'')<(_0x1f48bd[_0x77da('0x31')]||'')||_0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()>_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?0x1:-0x1;}else{return(_0x759b86['pauseType']||'')<(_0x1f48bd[_0x77da('0x31')]||'')||_0x759b86['fullname'][_0x77da('0x3c')]()>_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?-0x1:0x1;}}else{if(_0x1612b7==='DESC'){return _0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()<_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?0x1:-0x1;}else{return _0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()<_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?-0x1:0x1;}}}else{if(_0x1612b7===_0x77da('0x36')){return _0x759b86['globalStatus']<_0x1f48bd[_0x77da('0x32')]?0x1:-0x1;}else{return _0x759b86[_0x77da('0x32')]<_0x1f48bd[_0x77da('0x32')]?-0x1:0x1;}}});return _0x240bee;}exports[_0x77da('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x4644f3){var _0x2e3c38=['userpic','online',_0x77da('0x3e'),_0x77da('0x3f'),_0x77da('0x31'),_0x77da('0x3f'),_0x77da('0x39'),_0x77da('0x40'),'chatPause',_0x77da('0x30'),_0x77da('0x6'),_0x77da('0x7'),_0x77da('0x8'),'faxPause',_0x77da('0x10'),'chatCapacity','openchannelCapacity',_0x77da('0x41'),_0x77da('0x42'),_0x77da('0x43'),_0x77da('0x44'),'chatCurrentCapacity',_0x77da('0x45'),_0x77da('0x46'),'smsCurrentCapacity',_0x77da('0x47'),_0x77da('0x48'),'chatStatus',_0x77da('0x14'),_0x77da('0x49'),_0x77da('0x15'),_0x77da('0x16'),_0x77da('0x13'),_0x77da('0x11'),_0x77da('0x4a'),_0x77da('0x4b'),_0x77da('0x4c'),_0x77da('0x4d'),'whatsappStatusTime',_0x77da('0x4e'),'voiceStatusTime',_0x77da('0x4f'),_0x77da('0x50'),_0x77da('0x51'),_0x77da('0x52'),_0x77da('0x53'),_0x77da('0x54')];var _0x3a78d2=['chatPause',_0x77da('0x30'),_0x77da('0x6'),_0x77da('0x7'),_0x77da('0x8'),'faxPause',_0x77da('0x10'),_0x77da('0x55')];var _0x133b14=_(_0x4644f3)['omit'](_0x3a78d2)['pick'](_0x2e3c38)[_0x77da('0x2a')]();return _0x133b14;}exports[_0x77da('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x77da('0x57'),_0x77da('0x37'),_0x77da('0x58'),'internal','online',_0x77da('0x32'),_0x77da('0x59'),'lastLoginAt',_0x77da('0x31'),_0x77da('0x3f'),_0x77da('0x5'),'chatPause',_0x77da('0x6'),_0x77da('0x30'),'smsPause',_0x77da('0x10'),_0x77da('0x8'),_0x77da('0x12'),_0x77da('0x13'),_0x77da('0x49'),_0x77da('0x14'),_0x77da('0x15'),_0x77da('0x11'),_0x77da('0x16'),'chatStatusTime',_0x77da('0x4e'),_0x77da('0x4c'),_0x77da('0x4b'),_0x77da('0x4d'),_0x77da('0x5a'),_0x77da('0x5b'),'chatCapacity',_0x77da('0x44'),_0x77da('0x41'),_0x77da('0x5c'),'smsCapacity',_0x77da('0x43'),_0x77da('0x5d'),_0x77da('0x48'),_0x77da('0x46'),_0x77da('0x45'),_0x77da('0x5e'),_0x77da('0x47'),'phoneBarEnableScreenRecordingByAgent',_0x77da('0x53'),'destconnectedlinenum',_0x77da('0x5f'),_0x77da('0x4f'),_0x77da('0x54'),'screenrecording'];}exports[_0x77da('0x60')]=getRealtimeAgentsQueryFields;
\ No newline at end of file
+var _0x98a8=['lastPauseAt','openchannelCapacity','mailCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','faxStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','filterAgentAttributes','online','faxStatusTime','openchannelStatusTime','voiceStatusTime','faxCapacity','smsCapacity','smsCurrentCapacity','onhold','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','whatsappPause','filter','length','idle','unknown','unavailable','isNil','voiceStatus','voicePause','pause','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','catch','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','uniq','value','getAgentIdsByQueues','getAgentIdsByStatus','resolve','includes','name','fullname','openchannelPause','pauseType','find','merge','fields','startsWith','DESC','fullname,internal','internal','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt'];(function(_0x32d055,_0x29b72d){var _0xad929f=function(_0x4ae6ad){while(--_0x4ae6ad){_0x32d055['push'](_0x32d055['shift']());}};_0xad929f(++_0x29b72d);}(_0x98a8,0x12c));var _0x898a=function(_0x1e5c6c,_0x385237){_0x1e5c6c=_0x1e5c6c-0x0;var _0x120d79=_0x98a8[_0x1e5c6c];return _0x120d79;};'use strict';var _=require(_0x898a('0x0'));var jayson=require(_0x898a('0x1'));var db=require(_0x898a('0x2'))['db'];var amiClient=jayson[_0x898a('0x3')][_0x898a('0x4')]({'port':0x232a});var routingClient=jayson[_0x898a('0x3')][_0x898a('0x4')]({'port':0x232c});function isAgentPaused(_0x4a0836,_0x2bb3e2){var _0xf84a19=[_0x4a0836[_0x898a('0x5')],_0x4a0836[_0x898a('0x6')],_0x4a0836[_0x898a('0x7')],_0x4a0836['openchannelPause'],_0x4a0836[_0x898a('0x8')],_0x4a0836['voicePause'],_0x4a0836[_0x898a('0x9')]];if(!_0x2bb3e2)return _['every'](_0xf84a19);var _0x42021d=_[_0x898a('0xa')](_0xf84a19);return _0x42021d[_0x898a('0xb')]>0x0&&_0x42021d[_0x898a('0xb')]<_0xf84a19[_0x898a('0xb')]?!![]:![];}function isIdle(_0x388a47){return _0x388a47===_0x898a('0xc')||_0x388a47===_0x898a('0xd')||_0x388a47===_0x898a('0xe')||_0x388a47==='ringing'||_[_0x898a('0xf')](_0x388a47);}function isAgentIdle(_0x502e95){if(_0x502e95[_0x898a('0x10')]!=='idle'&&_0x502e95[_0x898a('0x11')]){_0x502e95[_0x898a('0x10')]=_0x898a('0x12');return![];}return _['every']([_0x502e95['chatStatus'],_0x502e95['faxStatus'],_0x502e95[_0x898a('0x13')],_0x502e95[_0x898a('0x14')],_0x502e95[_0x898a('0x15')],_0x502e95[_0x898a('0x10')],_0x502e95[_0x898a('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x898a('0x17')]('Agents',{})[_0x898a('0x18')](function(_0x53a4b8){if(_0x53a4b8[_0x898a('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x303321=_0x53a4b8['result'];return routingClient[_0x898a('0x17')]('Agents',{})[_0x898a('0x18')](function(_0x3197f7){if(_0x3197f7[_0x898a('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x1faf4c=_0x3197f7['result'];return _['merge']({},_0x303321,_0x1faf4c);});})[_0x898a('0x1a')](function(_0x1455ab){throw _0x1455ab;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4d374b){var _0x12bc0f=_0x898a('0xd');if(isAgentPaused(_0x4d374b))_0x12bc0f=_0x898a('0x12');else if(isAgentPaused(_0x4d374b,!![]))_0x12bc0f=_0x898a('0x1b');else if(isAgentIdle(_0x4d374b))_0x12bc0f=_0x898a('0xc');else _0x12bc0f=_0x898a('0x1c');return _0x12bc0f;}exports[_0x898a('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x483212,_0x247cfc){var _0x50718e=_[_0x898a('0x1e')](_0x483212)?_0x483212:[_0x483212];var _0x3cfd9c=_[_0x898a('0x1f')](_0x247cfc)+_0x898a('0x20');var _0x4e254d=_[_0x898a('0x21')](_0x50718e,function(_0x16c318){return db[_0x3cfd9c][_0x898a('0x22')]({'where':{'id':_0x16c318}})[_0x898a('0x18')](function(_0x3901ab){if(!_0x3901ab)return[];return _0x3901ab[_0x898a('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x4e254d)[_0x898a('0x18')](function(_0x51d501){var _0x513c6b=_(_0x51d501)['flatten']()[_0x898a('0x21')]('id')[_0x898a('0x24')]()[_0x898a('0x25')]();return _0x513c6b;});}exports[_0x898a('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x28ae6a,_0x2efde2,_0x398e98){try{if(_0x2efde2[_0x898a('0xb')]>0x0){_0x28ae6a=_0x28ae6a[_0x898a('0xa')](function(_0x58149d){return _0x2efde2['includes'](_0x58149d['id']);});}var _0x47f1ed=_0x28ae6a[_0x898a('0xa')](function(_0x62fe93){var _0x3b7704=_0x898a('0x1c');if(isAgentIdle(_0x62fe93)){_0x3b7704=_0x898a('0xc');}return _0x3b7704===_0x398e98;});return _[_0x898a('0x21')](_0x47f1ed,'id');}catch(_0xe3c983){throw _0xe3c983;}}exports[_0x898a('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x18773a,_0x4287da,_0x44c5d2){return Promise[_0x898a('0x28')]()['then'](function(){if(_0x4287da[_0x898a('0xb')]>0x0){_0x18773a=_0x18773a[_0x898a('0xa')](function(_0x26eead){return _0x4287da[_0x898a('0x29')](_0x26eead['id']);});}return _0x18773a;})[_0x898a('0x18')](function(){return db['User']['findAll']({'attributes':['id',_0x898a('0x2a'),_0x898a('0x2b'),_0x898a('0x5'),'faxPause',_0x898a('0x7'),_0x898a('0x2c'),_0x898a('0x8'),_0x898a('0x11'),_0x898a('0x9'),_0x898a('0x2d')],'where':{'id':{'$in':_[_0x898a('0x21')](_0x18773a,'id')}},'raw':!![]});})[_0x898a('0x18')](function(_0x50bb4b){return _0x50bb4b[_0x898a('0x21')](function(_0x5baf5b){var _0x573eb3=_[_0x898a('0x2e')](_0x18773a,['id',_0x5baf5b['id']]);var _0x58d997=filterAgentAttributes(_0x573eb3);_[_0x898a('0x2f')](_0x5baf5b,_0x58d997);_0x5baf5b['globalStatus']=getAgentStatus(_0x5baf5b);return _0x5baf5b;});})[_0x898a('0x18')](function(_0x4f202c){var _0x299371=sortAgentsByStatus(_0x4f202c,_0x44c5d2);return _[_0x898a('0x21')](_0x299371,'id');})[_0x898a('0x1a')](function(_0x50c0e4){throw _0x50c0e4;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x47966e){var _0x1575d2={'fields':[],'order':null};var _0x429c32=_0x47966e['split'](',');_0x1575d2[_0x898a('0x30')]=_[_0x898a('0xa')](_0x429c32,function(_0xe84f7e){if(!_0xe84f7e[_0x898a('0x29')]('globalStatus')){return!![];}_0x1575d2['order']=_[_0x898a('0x31')](_0xe84f7e,'-')?_0x898a('0x32'):'ASC';return![];});return _0x1575d2;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x168f92){if(!_0x168f92){_0x168f92=_0x898a('0x33');}if(_0x168f92[_0x898a('0x29')](_0x898a('0x2b'))&&!_0x168f92['includes'](_0x898a('0x34'))){var _0x369c02=_0x168f92['substring'](0x0,_0x168f92['indexOf']('fullname'));_0x168f92+=','+_0x369c02+_0x898a('0x34');}return _0x168f92;}exports[_0x898a('0x35')]=validateSortParameter;function sortAgentsByStatus(_0x35d767,_0x22f464){var _0x20a6eb=_0x35d767[_0x898a('0x36')](function(_0x10daf6,_0x1432ec){if(_0x10daf6[_0x898a('0x37')]===_0x1432ec[_0x898a('0x37')]){if(_0x10daf6[_0x898a('0x37')]===_0x898a('0x12')){if(_0x22f464===_0x898a('0x32')){return(_0x10daf6[_0x898a('0x2d')]||'')<(_0x1432ec[_0x898a('0x2d')]||'')||_0x10daf6['fullname'][_0x898a('0x38')]()>_0x1432ec[_0x898a('0x2b')][_0x898a('0x38')]()?0x1:-0x1;}else{return(_0x10daf6['pauseType']||'')<(_0x1432ec[_0x898a('0x2d')]||'')||_0x10daf6[_0x898a('0x2b')][_0x898a('0x38')]()>_0x1432ec[_0x898a('0x2b')][_0x898a('0x38')]()?-0x1:0x1;}}else{if(_0x22f464===_0x898a('0x32')){return _0x10daf6[_0x898a('0x2b')][_0x898a('0x38')]()<_0x1432ec['fullname'][_0x898a('0x38')]()?0x1:-0x1;}else{return _0x10daf6[_0x898a('0x2b')][_0x898a('0x38')]()<_0x1432ec[_0x898a('0x2b')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x22f464===_0x898a('0x32')){return _0x10daf6[_0x898a('0x37')]<_0x1432ec['globalStatus']?0x1:-0x1;}else{return _0x10daf6[_0x898a('0x37')]<_0x1432ec['globalStatus']?-0x1:0x1;}}});return _0x20a6eb;}exports[_0x898a('0x39')]=sortAgentsByStatus;function filterAgentAttributes(_0x5137c4){var _0x486e66=[_0x898a('0x3a'),'online',_0x898a('0x3b'),_0x898a('0x3c'),'pauseType',_0x898a('0x3c'),_0x898a('0x34'),'address',_0x898a('0x5'),_0x898a('0x2c'),_0x898a('0x7'),_0x898a('0x8'),'whatsappPause',_0x898a('0x6'),_0x898a('0x11'),'chatCapacity',_0x898a('0x3d'),_0x898a('0x3e'),'smsCapacity',_0x898a('0x3f'),'faxCapacity',_0x898a('0x40'),_0x898a('0x41'),_0x898a('0x42'),'smsCurrentCapacity',_0x898a('0x43'),_0x898a('0x44'),_0x898a('0x45'),_0x898a('0x14'),'mailStatus',_0x898a('0x15'),'whatsappStatus',_0x898a('0x46'),_0x898a('0x10'),_0x898a('0x47'),'openchannelStatusTime',_0x898a('0x48'),_0x898a('0x49'),_0x898a('0x4a'),'faxStatusTime','voiceStatusTime',_0x898a('0x4b'),_0x898a('0x4c'),_0x898a('0x4d'),_0x898a('0x4e'),_0x898a('0x4f'),_0x898a('0x50')];var _0x369f33=[_0x898a('0x5'),_0x898a('0x2c'),_0x898a('0x7'),_0x898a('0x8'),'whatsappPause',_0x898a('0x6'),_0x898a('0x11'),'online'];var _0x36d7aa=_(_0x5137c4)['omit'](_0x369f33)['pick'](_0x486e66)[_0x898a('0x25')]();return _0x36d7aa;}exports[_0x898a('0x51')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x898a('0x2a'),'fullname','role',_0x898a('0x34'),_0x898a('0x52'),'globalStatus',_0x898a('0x3a'),_0x898a('0x3b'),'pauseType',_0x898a('0x3c'),_0x898a('0x6'),_0x898a('0x5'),'mailPause',_0x898a('0x2c'),_0x898a('0x8'),_0x898a('0x11'),_0x898a('0x9'),_0x898a('0x45'),_0x898a('0x46'),'mailStatus',_0x898a('0x14'),'smsStatus',_0x898a('0x10'),_0x898a('0x16'),_0x898a('0x47'),_0x898a('0x53'),_0x898a('0x48'),_0x898a('0x54'),_0x898a('0x49'),_0x898a('0x55'),_0x898a('0x4a'),'chatCapacity',_0x898a('0x56'),_0x898a('0x3e'),_0x898a('0x3d'),_0x898a('0x57'),_0x898a('0x3f'),_0x898a('0x40'),_0x898a('0x44'),_0x898a('0x42'),_0x898a('0x41'),_0x898a('0x58'),_0x898a('0x43'),_0x898a('0x4e'),_0x898a('0x4f'),_0x898a('0x4c'),_0x898a('0x59'),'queue',_0x898a('0x50'),_0x898a('0x4d')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeaf8=['predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','concat','outbound','map','get','paused','busy','pTalking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','waiting','invalid','loggedInDb','notInUse','onHold','ringing','talking','unavailable','unknown','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeaf8,0xf1));var _0x8eaf=function(_0x488d8e,_0x11d17f){_0x488d8e=_0x488d8e-0x0;var _0x5561f6=_0xeaf8[_0x488d8e];return _0x5561f6;};'use strict';var _=require(_0x8eaf('0x0'));var jayson=require(_0x8eaf('0x1'));var util=require(_0x8eaf('0x2'));var amiClient=jayson[_0x8eaf('0x3')][_0x8eaf('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x8eaf('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x8eaf('0x5'),_0x8eaf('0x6'),'paused',_0x8eaf('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x8eaf('0x8'),_0x8eaf('0x9'),_0x8eaf('0xa'),_0x8eaf('0xb'),_0x8eaf('0xc'),'ringInUse',_0x8eaf('0xd'),_0x8eaf('0xe'),_0x8eaf('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x8eaf('0x10'),_0x8eaf('0x11'),_0x8eaf('0x12'),_0x8eaf('0x13'),_0x8eaf('0x14'),_0x8eaf('0x15'),_0x8eaf('0x16'),'startProgressive',_0x8eaf('0x17'),_0x8eaf('0x18'),_0x8eaf('0x19'),'erlangBusyFactor',_0x8eaf('0x1a'),'dialPredictiveIntervalMaxThreshold',_0x8eaf('0x1b'),_0x8eaf('0x1c'),_0x8eaf('0x1d'),_0x8eaf('0x1e'),_0x8eaf('0x1f'),_0x8eaf('0x20'),'predictiveIntervalAvgHoldtime',_0x8eaf('0x21')];function getRealtimeQueues(_0x5e0a93,_0x3f4f59){var _0x28dd2f=_0x3f4f59===_0x8eaf('0x22')?amiClient:routingClient;return _0x28dd2f[_0x8eaf('0x23')](_[_0x8eaf('0x24')](_0x3f4f59)+_0x8eaf('0x25'),_0x5e0a93)[_0x8eaf('0x26')](function(_0x125735){if(_0x125735['error'])throw new Error(util[_0x8eaf('0x27')](_0x8eaf('0x28'),_0x3f4f59));return _0x125735[_0x8eaf('0x29')];})['catch'](function(_0x1ad04f){throw _0x1ad04f;});}exports[_0x8eaf('0x2a')]=getRealtimeQueues;function initializeQueues(_0x10b312,_0x16ae9c,_0x3df82e,_0x3d32f5){var _0xe7b72d=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3df82e==='voice'){if(_0x3d32f5==='inbound'){_0xe7b72d=_0xe7b72d[_0x8eaf('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3d32f5===_0x8eaf('0x2c')){_0xe7b72d=_0xe7b72d[_0x8eaf('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x10b312[_0x8eaf('0x2d')](function(_0x3ada43){var _0x4cd4d6=_0x3ada43[_0x8eaf('0x2e')]({'plain':!![]});_0x4cd4d6[_0x8eaf('0x2f')]=0x0;_0x4cd4d6[_0x8eaf('0x9')]=0x0;_0x4cd4d6['loggedIn']=0x0;_0x4cd4d6[_0x8eaf('0x5')]=0x0;_0x4cd4d6['waiting']=0x0;if(_0x3df82e===_0x8eaf('0x22')){_0x4cd4d6['talking']=0x0;_0x4cd4d6[_0x8eaf('0x30')]=0x0;if(_0x3d32f5===_0x8eaf('0x2c')){_0x4cd4d6[_0x8eaf('0x31')]=0x0;_0x4cd4d6[_0x8eaf('0x10')]=0x0;}}var _0x1a2666=_[_0x8eaf('0x32')](_0x16ae9c,['id',_0x4cd4d6['id']]);if(_0x1a2666){_[_0x8eaf('0x33')](_0x4cd4d6,_[_0x8eaf('0x34')](_0x1a2666,_0xe7b72d));}return _0x4cd4d6;});}exports[_0x8eaf('0x35')]=initializeQueues;
\ No newline at end of file
+var _0x28f8=['catch','concat','outbound','map','get','loggedIn','find','initializeQueues','lodash','jayson/promise','util','client','available','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result'];(function(_0x4db54a,_0x1c8ece){var _0x485fc4=function(_0xe7ce9d){while(--_0xe7ce9d){_0x4db54a['push'](_0x4db54a['shift']());}};_0x485fc4(++_0x1c8ece);}(_0x28f8,0x72));var _0x828f=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x28f8[_0x146484];return _0x4c7aa3;};'use strict';var _=require(_0x828f('0x0'));var jayson=require(_0x828f('0x1'));var util=require(_0x828f('0x2'));var amiClient=jayson[_0x828f('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x828f('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x828f('0x4'),'loggedIn',_0x828f('0x5'),_0x828f('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x828f('0x7'),_0x828f('0x8'),_0x828f('0x9'),_0x828f('0xa'),_0x828f('0xb'),_0x828f('0xc'),_0x828f('0xd'),_0x828f('0xe'),_0x828f('0xf'),_0x828f('0x10'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x828f('0x11'),_0x828f('0x12'),_0x828f('0x13'),_0x828f('0x14'),_0x828f('0x15'),_0x828f('0x16'),_0x828f('0x17'),_0x828f('0x18'),_0x828f('0x19'),'erlangCalls',_0x828f('0x1a'),_0x828f('0x1b'),_0x828f('0x1c'),_0x828f('0x1d'),_0x828f('0x1e'),_0x828f('0x1f'),'predictiveIntervalAvailable',_0x828f('0x20'),'predictiveIntervalAnsweredCalls',_0x828f('0x21'),_0x828f('0x22'),_0x828f('0x23'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x4cf18b,_0x52cb5f){var _0x2a77c0=_0x52cb5f===_0x828f('0x24')?amiClient:routingClient;return _0x2a77c0[_0x828f('0x25')](_[_0x828f('0x26')](_0x52cb5f)+_0x828f('0x27'),_0x4cf18b)[_0x828f('0x28')](function(_0xfa7db9){if(_0xfa7db9[_0x828f('0x29')])throw new Error(util[_0x828f('0x2a')](_0x828f('0x2b'),_0x52cb5f));return _0xfa7db9[_0x828f('0x2c')];})[_0x828f('0x2d')](function(_0x32832c){throw _0x32832c;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x17a96b,_0x3fc086,_0x1d5dd0,_0x50cedf){var _0x5d198b=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1d5dd0===_0x828f('0x24')){if(_0x50cedf==='inbound'){_0x5d198b=_0x5d198b[_0x828f('0x2e')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x50cedf===_0x828f('0x2f')){_0x5d198b=_0x5d198b['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x17a96b[_0x828f('0x30')](function(_0x2f0fa5){var _0x55fc36=_0x2f0fa5[_0x828f('0x31')]({'plain':!![]});_0x55fc36[_0x828f('0x5')]=0x0;_0x55fc36['loggedInDb']=0x0;_0x55fc36[_0x828f('0x32')]=0x0;_0x55fc36['available']=0x0;_0x55fc36[_0x828f('0x6')]=0x0;if(_0x1d5dd0===_0x828f('0x24')){_0x55fc36[_0x828f('0xf')]=0x0;_0x55fc36[_0x828f('0x7')]=0x0;if(_0x50cedf===_0x828f('0x2f')){_0x55fc36[_0x828f('0x11')]=0x0;_0x55fc36['originated']=0x0;}}var _0x4714e5=_[_0x828f('0x33')](_0x3fc086,['id',_0x55fc36['id']]);if(_0x4714e5){_['merge'](_0x55fc36,_['pick'](_0x4714e5,_0x5d198b));}return _0x55fc36;});}exports[_0x828f('0x34')]=initializeQueues;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x1ae6b3,_0xe6d8e9){var _0x598044=function(_0x3c6b07){while(--_0x3c6b07){_0x1ae6b3['push'](_0x1ae6b3['shift']());}};_0x598044(++_0xe6d8e9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ No newline at end of file
+var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce3b=['replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','concat','head','mac','address','cpus','map','model','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','utf8'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xce3b,0xd0));var _0xbce3=function(_0x3bf456,_0x29833e){_0x3bf456=_0x3bf456-0x0;var _0x2b8964=_0xce3b[_0x3bf456];return _0x2b8964;};'use strict';var _=require(_0xbce3('0x0'));var os=require('os');var crypto=require(_0xbce3('0x1'));var machine=require(_0xbce3('0x2'));var exec=require(_0xbce3('0x3'))[_0xbce3('0x4')];var config=require('../environment');function getInterfaces(){var _0x43861=[];var _0x4251ae=os[_0xbce3('0x5')]();var _0x110786=_[_0xbce3('0x6')](_[_0xbce3('0x7')](_0x4251ae));for(var _0x154e37=0x0;_0x154e37<_0x110786['length'];_0x154e37++){var _0x484bca=_0x4251ae[_0x110786[_0x154e37]][_0xbce3('0x8')](function(_0x23881f){return _0x23881f[_0xbce3('0x9')]===_0xbce3('0xa')&&_0x23881f[_0xbce3('0xb')]===![];});_0x43861=_0x43861[_0xbce3('0xc')](_0x484bca);}return _0x43861;}function getFirstInterface(){var _0x30ed9f=_[_0xbce3('0xd')](getInterfaces());return{'macAddress':_0x30ed9f&&_0x30ed9f[_0xbce3('0xe')]?_0x30ed9f[_0xbce3('0xe')]:'00:00:00:00:00:00','ipAddress':_0x30ed9f&&_0x30ed9f['address']?_0x30ed9f[_0xbce3('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x1f6586=_[_0xbce3('0x6')](os[_0xbce3('0x10')]()[_0xbce3('0x11')](function(_0x25a510){return _0x25a510[_0xbce3('0x12')];}))['join'](':');return crypto[_0xbce3('0x13')](_0xbce3('0x14'))[_0xbce3('0x15')](_0x1f6586)[_0xbce3('0x16')](_0xbce3('0x17'));}exports[_0xbce3('0x18')]=function(){var _0x16371e=os[_0xbce3('0x19')]();var _0x55c444=/[0-9a-f-]{36}/;if(config[_0xbce3('0x1a')]&&_0x55c444[_0xbce3('0x1b')](config['licenseToken'])){return config['licenseToken'];}else if(_0x16371e===_0xbce3('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xbce3('0x1d')})[_0xbce3('0x1e')]('\x0d\x0a','');}else{var _0x53aa9a=getFirstInterface();var _0x3aef07=getCPUhash();var _0x21dc4c=_0x3aef07+'|'+os[_0xbce3('0x1f')]()+'|'+_0x53aa9a['macAddress']+'|'+_0x53aa9a[_0xbce3('0x20')];var _0xd55e26=crypto[_0xbce3('0x13')](_0xbce3('0x14'))[_0xbce3('0x15')](_0x21dc4c)['digest'](_0xbce3('0x17'));return _0xd55e26[_0xbce3('0x21')](0x0,0x8)+'-'+_0xd55e26[_0xbce3('0x21')](0x8,0xc)+'-'+_0xd55e26['substring'](0xc,0x10)+'-'+_0xd55e26[_0xbce3('0x21')](0x10,0x14)+'-'+_0xd55e26[_0xbce3('0x21')](0x14);}};
\ No newline at end of file
+var _0x9612=['mac','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','filter','family','IPv4','internal','concat','head'];(function(_0x2cd11d,_0x4410f0){var _0x3e6f02=function(_0x4841a2){while(--_0x4841a2){_0x2cd11d['push'](_0x2cd11d['shift']());}};_0x3e6f02(++_0x4410f0);}(_0x9612,0xa7));var _0x2961=function(_0xeb268d,_0x564ef5){_0xeb268d=_0xeb268d-0x0;var _0x30c4d4=_0x9612[_0xeb268d];return _0x30c4d4;};'use strict';var _=require(_0x2961('0x0'));var os=require('os');var crypto=require(_0x2961('0x1'));var machine=require(_0x2961('0x2'));var exec=require('child_process')[_0x2961('0x3')];var config=require(_0x2961('0x4'));function getInterfaces(){var _0x330e4a=[];var _0x42b820=os[_0x2961('0x5')]();var _0x4975ea=_[_0x2961('0x6')](_['keys'](_0x42b820));for(var _0x246f8e=0x0;_0x246f8e<_0x4975ea['length'];_0x246f8e++){var _0x4940f1=_0x42b820[_0x4975ea[_0x246f8e]][_0x2961('0x7')](function(_0x1fcf0a){return _0x1fcf0a[_0x2961('0x8')]===_0x2961('0x9')&&_0x1fcf0a[_0x2961('0xa')]===![];});_0x330e4a=_0x330e4a[_0x2961('0xb')](_0x4940f1);}return _0x330e4a;}function getFirstInterface(){var _0x51e602=_[_0x2961('0xc')](getInterfaces());return{'macAddress':_0x51e602&&_0x51e602[_0x2961('0xd')]?_0x51e602[_0x2961('0xd')]:'00:00:00:00:00:00','ipAddress':_0x51e602&&_0x51e602['address']?_0x51e602['address']:_0x2961('0xe')};}exports[_0x2961('0xf')]=getFirstInterface;function getCPUhash(){var _0x1dbfdc=_[_0x2961('0x6')](os[_0x2961('0x10')]()['map'](function(_0x31b0c6){return _0x31b0c6[_0x2961('0x11')];}))[_0x2961('0x12')](':');return crypto[_0x2961('0x13')](_0x2961('0x14'))[_0x2961('0x15')](_0x1dbfdc)[_0x2961('0x16')]('hex');}exports[_0x2961('0x17')]=function(){var _0x29e919=os[_0x2961('0x18')]();var _0x2d5303=/[0-9a-f-]{36}/;if(config[_0x2961('0x19')]&&_0x2d5303[_0x2961('0x1a')](config['licenseToken'])){return config['licenseToken'];}else if(_0x29e919===_0x2961('0x1b')){return exec(_0x2961('0x1c'),{'encoding':_0x2961('0x1d')})[_0x2961('0x1e')]('\x0d\x0a','');}else{var _0x450afc=getFirstInterface();var _0x86be17=getCPUhash();var _0x34acbe=_0x86be17+'|'+os[_0x2961('0x1f')]()+'|'+_0x450afc[_0x2961('0x20')]+'|'+_0x450afc[_0x2961('0x21')];var _0x48dfae=crypto[_0x2961('0x13')]('md5')['update'](_0x34acbe)['digest'](_0x2961('0x22'));return _0x48dfae[_0x2961('0x23')](0x0,0x8)+'-'+_0x48dfae['substring'](0x8,0xc)+'-'+_0x48dfae['substring'](0xc,0x10)+'-'+_0x48dfae[_0x2961('0x23')](0x10,0x14)+'-'+_0x48dfae[_0x2961('0x23')](0x14);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x021e=['../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','request-promise','pkginfo','version','../../mysqldb'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x021e,0x114));var _0xe021=function(_0x3c854f,_0x36e601){_0x3c854f=_0x3c854f-0x0;var _0x1888bb=_0x021e[_0x3c854f];return _0x1888bb;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0xe021('0x0'));var BPromise=require('bluebird');var pkginfo=require(_0xe021('0x1'))(module,_0xe021('0x2'));var db=require(_0xe021('0x3'))['db'];var encryptor=require(_0xe021('0x4'));var hardware=require(_0xe021('0x5'));var logger=require('../logger')('license');var HOST=_0xe021('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4f9587){return new BPromise(function(_0x25aa89,_0x520d31){var _0x34d9cb=util[_0xe021('0x7')](_0xe021('0x8'),HOST,_0x4f9587,module[_0xe021('0x9')]['version']);if(oldToken){_0x34d9cb=util[_0xe021('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4f9587,module[_0xe021('0x9')][_0xe021('0x2')],oldToken);}var _0x4c30f4={'uri':_0x34d9cb,'method':_0xe021('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x4c30f4)[_0xe021('0xb')](function(_0x78e5e5){_0x25aa89(_0x78e5e5);})[_0xe021('0xc')](function(_0x45183d){_0x520d31(_0x45183d);});});}function manageLicense(_0x2da0b0,_0x581a25){var _0x2b92fd=_0x581a25[_0xe021('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x2b92fd[_0xe021('0xe')]!==_0x2da0b0&&!_0x2b92fd[_0xe021('0xf')]){oldToken=_0x2b92fd[_0xe021('0xe')];}httpRequest(_0x2da0b0)[_0xe021('0xb')](function(_0x4adaac){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4adaac[_0xe021('0x10')]){isOldTokenSent=![];if(!_0x2b92fd[_0xe021('0x11')]&&_0x2b92fd[_0xe021('0x11')]!=_0x4adaac['license']||_0x2b92fd[_0xe021('0x11')]&&_0x2b92fd[_0xe021('0xf')]){logger[_0xe021('0x12')](_0xe021('0x13'));}if(_0x2b92fd[_0xe021('0x11')]&&!_0x2b92fd[_0xe021('0xf')]&&_0x2b92fd[_0xe021('0x11')]!=_0x4adaac['license']){logger[_0xe021('0x12')](_0xe021('0x14'));}if(_0x2b92fd['license']&&!_0x2b92fd[_0xe021('0xf')]&&_0x2b92fd[_0xe021('0x11')]==_0x4adaac[_0xe021('0x11')]){return _0x581a25;}return _0x581a25[_0xe021('0x15')]({'data1':_0x2da0b0,'data2':null,'license':_0x4adaac['license']});}else{if(_0x4adaac[_0xe021('0x11')]||_0x2b92fd[_0xe021('0x11')]){if(!_0x2b92fd[_0xe021('0xf')]){if(_0x2b92fd[_0xe021('0xe')]==_0x2da0b0){GRAY_PERIOD_REASON=_0xe021('0x16');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xe021('0x17');logger['info'](_0xe021('0x18'),_0x2b92fd[_0xe021('0xe')],_0x2da0b0);}logger[_0xe021('0x12')](_0xe021('0x19'),GRAY_PERIOD_REASON[_0xe021('0x1a')](),moment()[_0xe021('0x7')](_0xe021('0x1b')));return _0x581a25['update']({'data2':encryptor[_0xe021('0x1c')](moment()[_0xe021('0x7')](_0xe021('0x1b')))});}else{if(moment()[_0xe021('0x1d')](encryptor['decryptString'](_0x2b92fd[_0xe021('0xf')]),_0xe021('0x1e'))>DAYS){logger[_0xe021('0x12')](_0xe021('0x1f'),moment()[_0xe021('0x7')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x581a25[_0xe021('0x15')]({'data1':_0x2da0b0,'data2':null,'license':null});}}}else{if(_0x2b92fd['data1']!=_0x2da0b0){logger[_0xe021('0x12')](_0xe021('0x18'),_0x2b92fd['data1'],_0x2da0b0);return _0x581a25[_0xe021('0x15')]({'data1':_0x2da0b0,'data2':null,'license':null});}}}return _0x581a25;})[_0xe021('0xb')](function(_0x37e96c){_0x581a25=_0x37e96c;})[_0xe021('0xc')](function(_0x153c11){logger[_0xe021('0x20')](_0x153c11[_0xe021('0x21')]);})[_0xe021('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x581a25);},TIME);});}function defaultLicense(){var _0x13e037=hardware[_0xe021('0x23')]();if(_0x13e037){return db[_0xe021('0x24')][_0xe021('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x13e037}})[_0xe021('0x26')](function(_0x4e80f7,_0x4158d2){logger['info'](_0xe021('0x27'),_0x13e037);manageLicense(_0x13e037,_0x4e80f7);})[_0xe021('0xc')](function(_0x125673){logger[_0xe021('0x20')](_0x125673['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x63b6=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','update','catch','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','get','data1','data2'];(function(_0x537712,_0x2eab92){var _0x5a33a5=function(_0xef21e8){while(--_0xef21e8){_0x537712['push'](_0x537712['shift']());}};_0x5a33a5(++_0x2eab92);}(_0x63b6,0xa4));var _0x663b=function(_0x1ffabb,_0x49c9cc){_0x1ffabb=_0x1ffabb-0x0;var _0x34953a=_0x63b6[_0x1ffabb];return _0x34953a;};'use strict';var util=require('util');var moment=require(_0x663b('0x0'));var rp=require(_0x663b('0x1'));var BPromise=require(_0x663b('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x663b('0x3'));var hardware=require(_0x663b('0x4'));var logger=require(_0x663b('0x5'))(_0x663b('0x6'));var HOST=_0x663b('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x144f7e){return new BPromise(function(_0x1d3b65,_0x159005){var _0x434e6e=util[_0x663b('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x144f7e,module['exports']['version']);if(oldToken){_0x434e6e=util['format'](_0x663b('0x9'),HOST,_0x144f7e,module['exports'][_0x663b('0xa')],oldToken);}var _0x3a2b9e={'uri':_0x434e6e,'method':_0x663b('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x3a2b9e)[_0x663b('0xc')](function(_0x3d7588){_0x1d3b65(_0x3d7588);})['catch'](function(_0x4be4e6){_0x159005(_0x4be4e6);});});}function manageLicense(_0x180457,_0x167e02){var _0x5d0910=_0x167e02[_0x663b('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x5d0910[_0x663b('0xe')]!==_0x180457&&!_0x5d0910['data2']){oldToken=_0x5d0910[_0x663b('0xe')];}httpRequest(_0x180457)['then'](function(_0x2c8b9e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2c8b9e['active']){isOldTokenSent=![];if(!_0x5d0910['license']&&_0x5d0910[_0x663b('0x6')]!=_0x2c8b9e[_0x663b('0x6')]||_0x5d0910['license']&&_0x5d0910[_0x663b('0xf')]){logger['info'](_0x663b('0x10'));}if(_0x5d0910[_0x663b('0x6')]&&!_0x5d0910['data2']&&_0x5d0910['license']!=_0x2c8b9e[_0x663b('0x6')]){logger[_0x663b('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5d0910[_0x663b('0x6')]&&!_0x5d0910[_0x663b('0xf')]&&_0x5d0910[_0x663b('0x6')]==_0x2c8b9e[_0x663b('0x6')]){return _0x167e02;}return _0x167e02['update']({'data1':_0x180457,'data2':null,'license':_0x2c8b9e[_0x663b('0x6')]});}else{if(_0x2c8b9e[_0x663b('0x6')]||_0x5d0910['license']){if(!_0x5d0910[_0x663b('0xf')]){if(_0x5d0910[_0x663b('0xe')]==_0x180457){GRAY_PERIOD_REASON=_0x663b('0x12');logger[_0x663b('0x11')](_0x663b('0x13'));}else{GRAY_PERIOD_REASON=_0x663b('0x14');logger[_0x663b('0x11')](_0x663b('0x15'),_0x5d0910['data1'],_0x180457);}logger[_0x663b('0x11')](_0x663b('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x663b('0x8')](_0x663b('0x17')));return _0x167e02['update']({'data2':encryptor['encryptString'](moment()[_0x663b('0x8')](_0x663b('0x17')))});}else{if(moment()[_0x663b('0x18')](encryptor['decryptString'](_0x5d0910[_0x663b('0xf')]),_0x663b('0x19'))>DAYS){logger['info'](_0x663b('0x1a'),moment()[_0x663b('0x8')](_0x663b('0x17')));isOldTokenSent=![];return _0x167e02[_0x663b('0x1b')]({'data1':_0x180457,'data2':null,'license':null});}}}else{if(_0x5d0910[_0x663b('0xe')]!=_0x180457){logger[_0x663b('0x11')](_0x663b('0x15'),_0x5d0910['data1'],_0x180457);return _0x167e02[_0x663b('0x1b')]({'data1':_0x180457,'data2':null,'license':null});}}}return _0x167e02;})[_0x663b('0xc')](function(_0x193e3d){_0x167e02=_0x193e3d;})[_0x663b('0x1c')](function(_0x5d915b){logger[_0x663b('0x1d')](_0x5d915b['message']);})[_0x663b('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x663b('0x1f')](),_0x167e02);},TIME);});}function defaultLicense(){var _0xee1213=hardware[_0x663b('0x1f')]();if(_0xee1213){return db['License'][_0x663b('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0xee1213}})[_0x663b('0x21')](function(_0xd8b4a1,_0x19cfff){logger['info'](_0x663b('0x22'),_0xee1213);manageLicense(_0xee1213,_0xd8b4a1);})['catch'](function(_0x537ba2){logger[_0x663b('0x1d')](_0x537ba2['message']);});}}exports[_0x663b('0x23')]=defaultLicense;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x692f=['COUNT','col','count','telephone','users','telephones','admin','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','demo','machineUuid','decryptString','add','days','grayReason','changed','disabled','message','User','role','sequelize'];(function(_0x809314,_0xaf27c0){var _0x1a94b6=function(_0x450f50){while(--_0x450f50){_0x809314['push'](_0x809314['shift']());}};_0x1a94b6(++_0xaf27c0);}(_0x692f,0x11a));var _0xf692=function(_0x46ce98,_0x52d764){_0x46ce98=_0x46ce98-0x0;var _0x172f46=_0x692f[_0x46ce98];return _0x172f46;};'use strict';var util=require(_0xf692('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xf692('0x1'));var hardware=require(_0xf692('0x2'));var encryptor=require(_0xf692('0x3'));var db=require(_0xf692('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf692('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf692('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf692('0x6'),'machineUuid':hardware[_0xf692('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x247259){return new BPromise(function(_0x1ea1dd,_0x55c0f5){return db[_0xf692('0x8')]['find'](_[_0xf692('0x9')](_0x247259,{'raw':!![],'where':{'id':0x1}}))[_0xf692('0xa')](function(_0x4b4ccb){return checkLicense(_0x4b4ccb,null);})[_0xf692('0xa')](function(_0x21a607){_0x1ea1dd(_0x21a607);return;})[_0xf692('0xb')](function(_0xd14350){_0x55c0f5(_0xd14350);});});}function checkLicense(_0x49165f,_0x4ecaa0){if(!_0x49165f){demoLicense[_0xf692('0xc')]=_0x49165f[_0xf692('0xd')];return demoLicense;}try{var _0x3cdfd7=_0x4ecaa0||_0x49165f[_0xf692('0xe')];if(_[_0xf692('0xf')](_0x3cdfd7)){throw new Error(_0xf692('0x10'));}var _0x3cc503=_0x49165f[_0xf692('0xd')];var _0xa9e1=_0x49165f[_0xf692('0x11')];var _0xa35331=_0x3cc503['split']('-')[0x4];var _0x3f6553=_0x3cc503[_0xf692('0x12')]('-')[0x0];var _0x2fa963=encryptor['decryptString'](_0x3cdfd7,util[_0xf692('0x13')](_0xf692('0x14'),_0xa35331,_0x3cc503,_0x3f6553));var _0x441673=JSON['parse'](_0x2fa963);_0x441673[_0xf692('0x15')]=![];_0x441673[_0xf692('0xc')]=_0x3cc503;_0x441673[_0xf692('0x16')]=hardware[_0xf692('0x7')]();if(_0xa9e1){var _0x44b160=encryptor[_0xf692('0x17')](_0xa9e1);_0x441673['gray']=_0x44b160;_0x441673['deadline']=moment(_0x44b160)[_0xf692('0x18')](0x7,_0xf692('0x19'))[_0xf692('0x13')]();_0x441673[_0xf692('0x1a')]=_0x441673[_0xf692('0xc')]!=_0x441673[_0xf692('0x16')]?_0xf692('0x1b'):_0xf692('0x1c');}return _0x441673;}catch(_0x4e48ad){breakingLicense[_0xf692('0xc')]=_0x49165f[_0xf692('0xd')];breakingLicense[_0xf692('0x1d')]=_0x4e48ad[_0xf692('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xc652d4,_0x3802c1){getLicense()[_0xf692('0xa')](function(_0x14fd8a){return db[_0xf692('0x1e')]['findAll']({'attributes':[_0xf692('0x1f'),[db[_0xf692('0x20')]['fn'](_0xf692('0x21'),db[_0xf692('0x20')][_0xf692('0x22')](_0xf692('0x1f'))),_0xf692('0x23')]],'group':_0xf692('0x1f'),'where':{'role':{'$or':['admin','user',_0xf692('0x24')]}},'raw':!![]})[_0xf692('0xa')](function(_0x50d60e){var _0x5673d4={'user':_0x14fd8a[_0xf692('0x25')]||0x0,'telephone':_0x14fd8a[_0xf692('0x26')]||0x0};_0x50d60e['forEach'](function(_0x5e8080){var _0x58b6a1=_0x5e8080[_0xf692('0x1f')]===_0xf692('0x27')?_0xf692('0x28'):_0x5e8080[_0xf692('0x1f')];_0x5673d4[_0x58b6a1]-=_0x5e8080[_0xf692('0x23')];if(_0x5673d4[_0x58b6a1]<0x0)_0x5673d4[_0x58b6a1]=0x0;});_0xc652d4(_0x5673d4);return;});})[_0xf692('0xb')](function(_0x48e59f){_0x3802c1(_0x48e59f);});});}function checkUserLimits(_0x16a60a){return new BPromise(function(_0x2e4b19,_0x4594ac){getLimits()[_0xf692('0xa')](function(_0x1cd60f){var _0x296b3c=_[_0xf692('0x29')](_[_0xf692('0x2a')](_0x16a60a,_0xf692('0x1f')),['admin',_0xf692('0x28'),'telephone']);var _0x47a6cc=(_0x296b3c['admin']||0x0)+(_0x296b3c['user']||0x0);var _0x5329ea=_0x296b3c[_0xf692('0x24')]||0x0;if(_0x47a6cc>_0x1cd60f[_0xf692('0x28')])return _0x4594ac('License\x20limit\x20reached\x20for\x20users');if(_0x5329ea>_0x1cd60f['telephone'])return _0x4594ac(_0xf692('0x2b'));return _0x2e4b19();})[_0xf692('0xb')](function(_0x14ca1a){_0x4594ac(_0x14ca1a);});});}module[_0xf692('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x2d61=['admin','user','telephone','users','telephones','forEach','pick','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','split','format','%s:%s:%s','machineUuid','decryptString','gray','deadline','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count'];(function(_0x52f960,_0x56791d){var _0x44106d=function(_0x11ebda){while(--_0x11ebda){_0x52f960['push'](_0x52f960['shift']());}};_0x44106d(++_0x56791d);}(_0x2d61,0x117));var _0x12d6=function(_0x395d30,_0x22760e){_0x395d30=_0x395d30-0x0;var _0xba5c2=_0x2d61[_0x395d30];return _0xba5c2;};'use strict';var util=require('util');var _=require(_0x12d6('0x0'));var moment=require('moment');var BPromise=require(_0x12d6('0x1'));var hardware=require(_0x12d6('0x2'));var encryptor=require(_0x12d6('0x3'));var db=require(_0x12d6('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x12d6('0x5'),'machineUuid':hardware[_0x12d6('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x12d6('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x12d6('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2e7f8d){return new BPromise(function(_0x12ad3b,_0x312d89){return db[_0x12d6('0x8')][_0x12d6('0x9')](_[_0x12d6('0xa')](_0x2e7f8d,{'raw':!![],'where':{'id':0x1}}))[_0x12d6('0xb')](function(_0x4c3a1b){return checkLicense(_0x4c3a1b,null);})[_0x12d6('0xb')](function(_0xbd54e3){_0x12ad3b(_0xbd54e3);return;})[_0x12d6('0xc')](function(_0x168d5d){_0x312d89(_0x168d5d);});});}function checkLicense(_0x23caec,_0x5c635d){if(!_0x23caec){demoLicense[_0x12d6('0xd')]=_0x23caec[_0x12d6('0xe')];return demoLicense;}try{var _0x5d9380=_0x5c635d||_0x23caec[_0x12d6('0xf')];if(_['isEmpty'](_0x5d9380)){throw new Error(_0x12d6('0x10'));}var _0x733b6c=_0x23caec[_0x12d6('0xe')];var _0x2d2d67=_0x23caec['data2'];var _0x382bf=_0x733b6c[_0x12d6('0x11')]('-')[0x4];var _0x254b95=_0x733b6c[_0x12d6('0x11')]('-')[0x0];var _0x102d94=encryptor['decryptString'](_0x5d9380,util[_0x12d6('0x12')](_0x12d6('0x13'),_0x382bf,_0x733b6c,_0x254b95));var _0x297bea=JSON['parse'](_0x102d94);_0x297bea['demo']=![];_0x297bea[_0x12d6('0xd')]=_0x733b6c;_0x297bea[_0x12d6('0x14')]=hardware[_0x12d6('0x6')]();if(_0x2d2d67){var _0x55aa49=encryptor[_0x12d6('0x15')](_0x2d2d67);_0x297bea[_0x12d6('0x16')]=_0x55aa49;_0x297bea[_0x12d6('0x17')]=moment(_0x55aa49)[_0x12d6('0x18')](0x7,'days')[_0x12d6('0x12')]();_0x297bea[_0x12d6('0x19')]=_0x297bea[_0x12d6('0xd')]!=_0x297bea[_0x12d6('0x14')]?_0x12d6('0x1a'):_0x12d6('0x1b');}return _0x297bea;}catch(_0x54fb2e){breakingLicense['uuid']=_0x23caec[_0x12d6('0xe')];breakingLicense[_0x12d6('0x1c')]=_0x54fb2e[_0x12d6('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x50c89f,_0x1bce90){getLicense()[_0x12d6('0xb')](function(_0x32d19a){return db[_0x12d6('0x1d')][_0x12d6('0x1e')]({'attributes':[_0x12d6('0x1f'),[db[_0x12d6('0x20')]['fn'](_0x12d6('0x21'),db[_0x12d6('0x20')][_0x12d6('0x22')](_0x12d6('0x1f'))),_0x12d6('0x23')]],'group':_0x12d6('0x1f'),'where':{'role':{'$or':[_0x12d6('0x24'),_0x12d6('0x25'),_0x12d6('0x26')]}},'raw':!![]})[_0x12d6('0xb')](function(_0xff8683){var _0x5392c8={'user':_0x32d19a[_0x12d6('0x27')]||0x0,'telephone':_0x32d19a[_0x12d6('0x28')]||0x0};_0xff8683[_0x12d6('0x29')](function(_0x514eea){var _0x4a1edd=_0x514eea[_0x12d6('0x1f')]===_0x12d6('0x24')?_0x12d6('0x25'):_0x514eea['role'];_0x5392c8[_0x4a1edd]-=_0x514eea[_0x12d6('0x23')];if(_0x5392c8[_0x4a1edd]<0x0)_0x5392c8[_0x4a1edd]=0x0;});_0x50c89f(_0x5392c8);return;});})[_0x12d6('0xc')](function(_0x35ca44){_0x1bce90(_0x35ca44);});});}function checkUserLimits(_0x16fef2){return new BPromise(function(_0x2c80b5,_0x5e3409){getLimits()[_0x12d6('0xb')](function(_0x16ad8c){var _0x4083d6=_[_0x12d6('0x2a')](_['countBy'](_0x16fef2,'role'),[_0x12d6('0x24'),'user',_0x12d6('0x26')]);var _0x1102c6=(_0x4083d6[_0x12d6('0x24')]||0x0)+(_0x4083d6[_0x12d6('0x25')]||0x0);var _0x4d1b2e=_0x4083d6['telephone']||0x0;if(_0x1102c6>_0x16ad8c[_0x12d6('0x25')])return _0x5e3409('License\x20limit\x20reached\x20for\x20users');if(_0x4d1b2e>_0x16ad8c['telephone'])return _0x5e3409(_0x12d6('0x2b'));return _0x2c80b5();})[_0x12d6('0xc')](function(_0x9a5673){_0x5e3409(_0x9a5673);});});}module[_0x12d6('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14a0=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x5b8705,_0x19d2b3){var _0x3d8b53=function(_0x221066){while(--_0x221066){_0x5b8705['push'](_0x5b8705['shift']());}};_0x3d8b53(++_0x19d2b3);}(_0x14a0,0x8e));var _0x014a=function(_0x9b6210,_0x148de8){_0x9b6210=_0x9b6210-0x0;var _0x53955d=_0x14a0[_0x9b6210];return _0x53955d;};'use strict';module['exports']={'DOMAIN':_0x014a('0x0'),'SESSION_SECRET':_0x014a('0x1'),'GOOGLE_ID':_0x014a('0x2'),'GOOGLE_SECRET':_0x014a('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x7916=['myappanuglar-secret','app-id','exports'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x7916,0x128));var _0x6791=function(_0xbbcb0d,_0x21f7ee){_0xbbcb0d=_0xbbcb0d-0x0;var _0x439c4a=_0x7916[_0xbbcb0d];return _0x439c4a;};'use strict';module[_0x6791('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x6791('0x1'),'GOOGLE_ID':_0x6791('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd894=['fileLogger','exports','../utils/loggers'];(function(_0x1eb786,_0x1b5f72){var _0x460cad=function(_0x3ec7a6){while(--_0x3ec7a6){_0x1eb786['push'](_0x1eb786['shift']());}};_0x460cad(++_0x1b5f72);}(_0xd894,0xb3));var _0x4d89=function(_0x2d0cad,_0x320aaf){_0x2d0cad=_0x2d0cad-0x0;var _0x1b4688=_0xd894[_0x2d0cad];return _0x1b4688;};'use strict';var fileLogger=require(_0x4d89('0x0'))[_0x4d89('0x1')];module[_0x4d89('0x2')]=fileLogger;
\ No newline at end of file
+var _0xc3af=['fileLogger','exports','../utils/loggers'];(function(_0x363948,_0x24925f){var _0x11ab47=function(_0x2c7b35){while(--_0x2c7b35){_0x363948['push'](_0x363948['shift']());}};_0x11ab47(++_0x24925f);}(_0xc3af,0xa4));var _0xfc3a=function(_0x44606e,_0x2bf244){_0x44606e=_0x44606e-0x0;var _0xe68388=_0xc3af[_0x44606e];return _0xe68388;};'use strict';var fileLogger=require(_0xfc3a('0x0'))[_0xfc3a('0x1')];module[_0xfc3a('0x2')]=fileLogger;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x03a0=['legacy-libs','express','../../services/express/index.js','../../services/ami/index.js','agi','join','../../services/agi/index.js','../../services/email/index.js','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root'];(function(_0x47122f,_0x1ed27d){var _0x2484ed=function(_0x47c818){while(--_0x47c818){_0x47122f['push'](_0x47122f['shift']());}};_0x2484ed(++_0x1ed27d);}(_0x03a0,0x13e));var _0x003a=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x03a0[_0x53c256];return _0x25feb6;};'use strict';var path=require(_0x003a('0x0'));var cfg=require(_0x003a('0x1'));var env={'NODE_PATH':path[_0x003a('0x2')](path['join'](cfg[_0x003a('0x3')],_0x003a('0x4')))};var pm2config={'apps':[{'name':_0x003a('0x5'),'script':path['join'](__dirname,_0x003a('0x6')),'env':env},{'name':'ami','script':path['join'](__dirname,_0x003a('0x7')),'env':env},{'name':_0x003a('0x8'),'script':path[_0x003a('0x9')](__dirname,_0x003a('0xa')),'env':env},{'name':'email','script':path['join'](__dirname,_0x003a('0xb')),'env':env},{'name':'routing','script':path[_0x003a('0x9')](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path['join'](__dirname,_0x003a('0xc')),'env':env}]};module[_0x003a('0xd')]=pm2config;
\ No newline at end of file
+var _0x5c39=['xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root','legacy-libs','express','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/routing/index.js'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x5c39,0x14d));var _0x95c3=function(_0x52cfa7,_0x4934de){_0x52cfa7=_0x52cfa7-0x0;var _0x4510e8=_0x5c39[_0x52cfa7];return _0x4510e8;};'use strict';var path=require(_0x95c3('0x0'));var cfg=require(_0x95c3('0x1'));var env={'NODE_PATH':path[_0x95c3('0x2')](path['join'](cfg[_0x95c3('0x3')],_0x95c3('0x4')))};var pm2config={'apps':[{'name':_0x95c3('0x5'),'script':path[_0x95c3('0x6')](__dirname,_0x95c3('0x7')),'env':env},{'name':'ami','script':path[_0x95c3('0x6')](__dirname,_0x95c3('0x8')),'env':env},{'name':_0x95c3('0x9'),'script':path[_0x95c3('0x6')](__dirname,_0x95c3('0xa')),'env':env},{'name':'email','script':path[_0x95c3('0x6')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path['join'](__dirname,_0x95c3('0xb')),'env':env},{'name':_0x95c3('0xc'),'script':path['join'](__dirname,_0x95c3('0xd')),'env':env}]};module[_0x95c3('0xe')]=pm2config;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb8f1=['describe','delete','dump','./config','connect','start','then','disconnect','stop','restart','list'];(function(_0x121a6a,_0x3f6b8e){var _0x22a7d2=function(_0x51e3d6){while(--_0x51e3d6){_0x121a6a['push'](_0x121a6a['shift']());}};_0x22a7d2(++_0x3f6b8e);}(_0xb8f1,0xb3));var _0x1b8f=function(_0x59b258,_0x1ff184){_0x59b258=_0x59b258-0x0;var _0x26ffcf=_0xb8f1[_0x59b258];return _0x26ffcf;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1b8f('0x0'));function connect(){return new BPromise(function(_0x5cef66,_0x446dfe){return pm2[_0x1b8f('0x1')](function(_0x3682b2){if(_0x3682b2){return _0x446dfe(_0x3682b2);}return _0x5cef66('connected');});});};exports[_0x1b8f('0x2')]=function(_0x5e93ac){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x1d7e43,_0x5cbf23){return pm2[_0x1b8f('0x2')](_0x5e93ac,function(_0x439b7a,_0x53229e){if(_0x439b7a){return _0x5cbf23(_0x439b7a);}pm2[_0x1b8f('0x4')]();return _0x1d7e43(_0x53229e);});});});};exports[_0x1b8f('0x5')]=function(_0x21f7b6){return connect()['then'](function(){return new BPromise(function(_0x5a5a46,_0x4e9ee3){return pm2['stop'](_0x21f7b6,function(_0x2f9466,_0x205bb4){if(_0x2f9466){return _0x4e9ee3(_0x2f9466);}pm2[_0x1b8f('0x4')]();return _0x5a5a46(_0x205bb4);});});});};exports[_0x1b8f('0x6')]=function(_0x12e6f6){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x1c48c5,_0x462043){return pm2[_0x1b8f('0x6')](_0x12e6f6,function(_0xdd03fd,_0x3f51b9){if(_0xdd03fd){return _0x462043(_0xdd03fd);}pm2[_0x1b8f('0x4')]();return _0x1c48c5(_0x3f51b9);});});});};exports[_0x1b8f('0x7')]=function(){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x1306a2,_0x23fce0){return pm2[_0x1b8f('0x7')](function(_0x3c295b,_0x5f1c4a){if(_0x3c295b){return _0x23fce0(_0x3c295b);}pm2[_0x1b8f('0x4')]();return _0x1306a2(_0x5f1c4a);});});});};exports['describe']=function(_0x268b30){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x2759ac,_0x2579e6){return pm2[_0x1b8f('0x8')](_0x268b30,function(_0x477ee6,_0x4891bf){if(_0x477ee6){return _0x2579e6(_0x477ee6);}pm2[_0x1b8f('0x4')]();return _0x2759ac(_0x4891bf);});});});};exports[_0x1b8f('0x9')]=function(_0x484c11){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0x2600d9,_0x546b1c){return pm2[_0x1b8f('0x9')](_0x484c11,function(_0x1f5ccd,_0x33f704){if(_0x1f5ccd){return _0x546b1c(_0x1f5ccd);}pm2[_0x1b8f('0x4')]();return _0x2600d9(_0x33f704);});});});};exports[_0x1b8f('0xa')]=function(){return connect()[_0x1b8f('0x3')](function(){return new BPromise(function(_0xe8b405,_0x402622){return pm2[_0x1b8f('0xa')](function(_0x69b7da){if(_0x69b7da){return _0x402622(_0x69b7da);}return _0xe8b405('saved');});});});};
\ No newline at end of file
+var _0x0beb=['bluebird','./config','connect','connected','disconnect','stop','then','restart','list','describe','delete','dump','saved'];(function(_0x5ee5aa,_0x176991){var _0x581d83=function(_0x894cdd){while(--_0x894cdd){_0x5ee5aa['push'](_0x5ee5aa['shift']());}};_0x581d83(++_0x176991);}(_0x0beb,0xb6));var _0xb0be=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0beb[_0xfae23b];return _0x200640;};'use strict';var pm2=require('pm2');var BPromise=require(_0xb0be('0x0'));var config=require(_0xb0be('0x1'));function connect(){return new BPromise(function(_0x53f9c4,_0x437bb1){return pm2[_0xb0be('0x2')](function(_0x1552b6){if(_0x1552b6){return _0x437bb1(_0x1552b6);}return _0x53f9c4(_0xb0be('0x3'));});});};exports['start']=function(_0x487a7e){return connect()['then'](function(){return new BPromise(function(_0x485a36,_0x4e5644){return pm2['start'](_0x487a7e,function(_0x31fb11,_0x44a924){if(_0x31fb11){return _0x4e5644(_0x31fb11);}pm2[_0xb0be('0x4')]();return _0x485a36(_0x44a924);});});});};exports[_0xb0be('0x5')]=function(_0x15033e){return connect()[_0xb0be('0x6')](function(){return new BPromise(function(_0x41b204,_0x480cdc){return pm2[_0xb0be('0x5')](_0x15033e,function(_0x5b71b4,_0x40c60a){if(_0x5b71b4){return _0x480cdc(_0x5b71b4);}pm2[_0xb0be('0x4')]();return _0x41b204(_0x40c60a);});});});};exports[_0xb0be('0x7')]=function(_0xdac4e7){return connect()[_0xb0be('0x6')](function(){return new BPromise(function(_0x311408,_0x5b1914){return pm2['restart'](_0xdac4e7,function(_0x2c34d8,_0x56ba6c){if(_0x2c34d8){return _0x5b1914(_0x2c34d8);}pm2['disconnect']();return _0x311408(_0x56ba6c);});});});};exports[_0xb0be('0x8')]=function(){return connect()[_0xb0be('0x6')](function(){return new BPromise(function(_0x4d4cbd,_0x11d092){return pm2[_0xb0be('0x8')](function(_0x58447b,_0xc7cff2){if(_0x58447b){return _0x11d092(_0x58447b);}pm2[_0xb0be('0x4')]();return _0x4d4cbd(_0xc7cff2);});});});};exports['describe']=function(_0x1e36d3){return connect()[_0xb0be('0x6')](function(){return new BPromise(function(_0x349f58,_0x572b31){return pm2[_0xb0be('0x9')](_0x1e36d3,function(_0x2ce752,_0x298c06){if(_0x2ce752){return _0x572b31(_0x2ce752);}pm2[_0xb0be('0x4')]();return _0x349f58(_0x298c06);});});});};exports[_0xb0be('0xa')]=function(_0x34aefd){return connect()[_0xb0be('0x6')](function(){return new BPromise(function(_0xb3032a,_0x17371b){return pm2[_0xb0be('0xa')](_0x34aefd,function(_0x6c2663,_0x2e8fbb){if(_0x6c2663){return _0x17371b(_0x6c2663);}pm2[_0xb0be('0x4')]();return _0xb3032a(_0x2e8fbb);});});});};exports[_0xb0be('0xb')]=function(){return connect()[_0xb0be('0x6')](function(){return new BPromise(function(_0x594f8c,_0x1b9316){return pm2[_0xb0be('0xb')](function(_0x37ba8c){if(_0x37ba8c){return _0x1b9316(_0x37ba8c);}return _0x594f8c(_0xb0be('0xc'));});});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2413=['ChatInteraction','findAll','lastMsgAt','minutes','length','info','join','system','timeout','format','then','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x2413,0x105));var _0x3241=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2413[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x3241('0x0'))(_0x3241('0x1'));config['redis']=_[_0x3241('0x2')](config[_0x3241('0x3')],{'host':_0x3241('0x4'),'port':0x18eb});var io=require(_0x3241('0x5'))(new Redis(config[_0x3241('0x3')]));function closeInteractions(){var _0x34d720=0x0;var _0x182e5c=[];return db[_0x3241('0x6')][_0x3241('0x7')]({'raw':!![],'attributes':['id',_0x3241('0x8')],'where':{'id':0x1}})['then'](function(_0x646398){_0x34d720=_0x646398[_0x3241('0x8')];if(_0x34d720){return db[_0x3241('0x9')][_0x3241('0xa')]({'raw':!![],'attributes':['id',_0x3241('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x646398[_0x3241('0x8')],_0x3241('0xc'))}}});}else{return[];}})['then'](function(_0x419ead){if(_0x419ead&&_0x419ead[_0x3241('0xd')]){_0x182e5c=_['map'](_0x419ead||[],'id');logger[_0x3241('0xe')]('[CHAT]\x20Interactions\x20to\x20close:',_0x182e5c[_0x3241('0xf')]());return db['ChatInteraction']['update']({'closeReason':_0x3241('0x10'),'disposition':_0x3241('0x11'),'closed':!![],'closedAt':moment()[_0x3241('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x182e5c}});}})[_0x3241('0x13')](function(){if(_0x182e5c&&_0x182e5c['length']){logger[_0x3241('0xe')](_0x3241('0x14'),_0x182e5c[_0x3241('0xf')]());for(var _0x2b8239=0x0;_0x2b8239<_0x182e5c[_0x3241('0xd')];_0x2b8239++){io[_0x3241('0x15')](_0x3241('0x16'),{'id':_0x182e5c[_0x2b8239],'closed':!![]});}}})[_0x3241('0x17')](function(_0x108f60){logger[_0x3241('0x18')](_0x3241('0x19'),_0x108f60?util[_0x3241('0x1a')](_0x108f60,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x15d9=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','schedule','redis','defaults','Setting','find','then','findAll','lastMsgAt','subtract','chatTimeout','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','length'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0x15d9,0x64));var _0x915d=function(_0x38e346,_0x42d04d){_0x38e346=_0x38e346-0x0;var _0x57246a=_0x15d9[_0x38e346];return _0x57246a;};'use strict';var _=require(_0x915d('0x0'));var moment=require('moment');var Redis=require(_0x915d('0x1'));var util=require(_0x915d('0x2'));var config=require(_0x915d('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x915d('0x4'));config[_0x915d('0x5')]=_[_0x915d('0x6')](config[_0x915d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x915d('0x5')]));function closeInteractions(){var _0x4ce363=0x0;var _0x1a926c=[];return db[_0x915d('0x7')][_0x915d('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x915d('0x9')](function(_0x479e93){_0x4ce363=_0x479e93['chatTimeout'];if(_0x4ce363){return db['ChatInteraction'][_0x915d('0xa')]({'raw':!![],'attributes':['id',_0x915d('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x915d('0xc')](_0x479e93[_0x915d('0xd')],_0x915d('0xe'))}}});}else{return[];}})['then'](function(_0x3e0d8a){if(_0x3e0d8a&&_0x3e0d8a['length']){_0x1a926c=_[_0x915d('0xf')](_0x3e0d8a||[],'id');logger[_0x915d('0x10')](_0x915d('0x11'),_0x1a926c[_0x915d('0x12')]());return db[_0x915d('0x13')][_0x915d('0x14')]({'closeReason':_0x915d('0x15'),'disposition':_0x915d('0x16'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1a926c}});}})[_0x915d('0x9')](function(){if(_0x1a926c&&_0x1a926c[_0x915d('0x17')]){logger[_0x915d('0x10')](_0x915d('0x18'),_0x1a926c[_0x915d('0x12')]());for(var _0x2aaee4=0x0;_0x2aaee4<_0x1a926c[_0x915d('0x17')];_0x2aaee4++){io[_0x915d('0x19')](_0x915d('0x1a'),{'id':_0x1a926c[_0x2aaee4],'closed':!![]});}}})[_0x915d('0x1b')](function(_0x212e3d){logger['error'](_0x915d('0x1c'),_0x212e3d?util[_0x915d('0x1d')](_0x212e3d,{'showHidden':![],'depth':null}):'');});}exports[_0x915d('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3254=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x3254,0x182));var _0x4325=function(_0x2a8d5e,_0x1abf24){_0x2a8d5e=_0x2a8d5e-0x0;var _0x195f9b=_0x3254[_0x2a8d5e];return _0x195f9b;};'use strict';function start(){var _0x139d74=require(_0x4325('0x0'));return _0x139d74[_0x4325('0x1')]();}module[_0x4325('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x6a68=['exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6a68,0xe8));var _0x86a6=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x6a68[_0x55abd9];return _0x3e5669;};'use strict';function start(){var _0x1d5373=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1d5373['startAllRefreshIntervals']();}module[_0x86a6('0x0')]={'intervals':{},'start':start};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x756e=['bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','%s.%s','savename','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','isNil','subtractNumber','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','difference','length','exists','stop','deleteJob','delete\x20cron','my\x20id','cron','active','isBetween','endAt','add\x20cron','stop\x20cron','startAt','update','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise'];(function(_0x579af8,_0x2edf89){var _0x5c5da4=function(_0x3aa9ef){while(--_0x3aa9ef){_0x579af8['push'](_0x579af8['shift']());}};_0x5c5da4(++_0x2edf89);}(_0x756e,0x94));var _0xe756=function(_0x5e179f,_0xcf2d6d){_0x5e179f=_0x5e179f-0x0;var _0x5090f9=_0x756e[_0x5e179f];return _0x5090f9;};'use strict';var fs=require('fs');var util=require(_0xe756('0x0'));var path=require(_0xe756('0x1'));var _=require(_0xe756('0x2'));var moment=require(_0xe756('0x3'));var CronJobManager=require(_0xe756('0x4'));var jayson=require(_0xe756('0x5'));var BPromise=require(_0xe756('0x6'));var logger=require(_0xe756('0x7'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xe756('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xe756('0x9')][_0xe756('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e5a4b,_0x3952a4){return function(){logger['info'](_0xe756('0xb'),_0x1e5a4b[_0xe756('0xc')]);var _0x37b246=!![];var _0x539c5b=_0x1e5a4b[_0xe756('0xd')][_0xe756('0xe')]();var _0x56757b={'account':_0x539c5b,'message':{'from':util[_0xe756('0xf')](_0xe756('0x10'),_0x1e5a4b[_0xe756('0xd')][_0xe756('0x11')],_0x1e5a4b[_0xe756('0xd')][_0xe756('0xc')]||_0x1e5a4b['MailAccount'][_0xe756('0x12')]['user']),'to':_0x1e5a4b[_0xe756('0xc')],'cc':_0x1e5a4b['cc'],'bcc':_0x1e5a4b['bcc'],'subject':util[_0xe756('0xf')](_0xe756('0x13'),_0x3952a4[_0xe756('0x11')],_0x1e5a4b['subtractNumber'],_0x1e5a4b['subtractUnit'])}};var _0xc59755=path[_0xe756('0x14')](__dirname,_0xe756('0x15'));var _0xbfef29=_0x3952a4['savename'];var _0x22d275=util[_0xe756('0xf')](_0xe756('0x16'),path['basename'](_0x3952a4['savename'],path['extname'](_0x3952a4[_0xe756('0x17')])),'zip');var _0x3d7a4c=path[_0xe756('0x14')](_0xc59755,_0xbfef29);var _0x32b3e9=path['join'](_0xc59755,_0x22d275);if(fs['existsSync'](_0x3d7a4c)){_0x3952a4[_0xe756('0x18')]=_0xe756('0x19');_0x56757b[_0xe756('0x1a')][_0xe756('0x1b')]=[{'filename':_0xbfef29,'path':_0x3d7a4c}];_0x56757b[_0xe756('0x1a')][_0xe756('0x1c')]=util[_0xe756('0xf')](_0xe756('0x1d'),JSON[_0xe756('0x1e')](_0x3952a4,null,0x2));}else if(fs[_0xe756('0x1f')](_0x32b3e9)){_0x3952a4[_0xe756('0x18')]='Sent';_0x56757b['message'][_0xe756('0x1b')]=[{'filename':_0x22d275,'path':_0x32b3e9}];}else{_0x56757b['message']['text']=_0xe756('0x20');if(!_0x1e5a4b[_0xe756('0x21')]){_0x37b246=![];logger[_0xe756('0x22')](_0xe756('0x23'));}}if(_0x37b246){return client[_0xe756('0x24')]('SendMail',_0x56757b)[_0xe756('0x25')](function(_0x1a2b9e){if(_0x1a2b9e[_0xe756('0x26')]){return logger[_0xe756('0x26')](_0xe756('0x27'),JSON[_0xe756('0x1e')](_0x1a2b9e));}return logger[_0xe756('0x22')](_0xe756('0x28'));})['catch'](function(_0x450ce0){return logger[_0xe756('0x26')](_0xe756('0x27'),JSON[_0xe756('0x1e')](_0x450ce0));});}};}function handleError(){return function(_0x56aa27){return logger[_0xe756('0x26')](JSON[_0xe756('0x1e')](_0x56aa27));};}function handleResult(_0x2feb43){return function(_0xfdafc7){logger[_0xe756('0x22')]('data',JSON[_0xe756('0x1e')](_0xfdafc7));if(_0x2feb43[_0xe756('0xd')]&&_0x2feb43[_0xe756('0xd')][_0xe756('0x12')]&&!_['isNil'](_0x2feb43['email'])){setTimeout(handleSendEmail(_0x2feb43,_0xfdafc7),0x3c*0x3e8);}};}function handleJob(_0x44b545){return function(){try{if(_[_0xe756('0x29')](_0x44b545[_0xe756('0x2a')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe756('0x29')](_0x44b545[_0xe756('0x2b')])){return logger[_0xe756('0x22')]('subtractUnit\x20null\x20or\x20undefined');}var _0x4b03ec={'startDate':moment()[_0xe756('0x2c')](_0x44b545[_0xe756('0x2a')],_0x44b545['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xe756('0xf')](_0xe756('0x2d')),'type':_0xe756('0x2e'),'output':_0x44b545['output'],'name':_0x44b545['name']};if(!_[_0xe756('0x29')](_0x44b545[_0xe756('0x2f')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x44b545[_0xe756('0x2f')]);return analyticDefaultReportController[_0xe756('0x30')]({'id':_0x44b545[_0xe756('0x2f')]},_0x4b03ec)[_0xe756('0x25')](handleResult(_0x44b545))[_0xe756('0x31')](handleError());}if(!_[_0xe756('0x29')](_0x44b545[_0xe756('0x32')])){logger[_0xe756('0x22')](_0xe756('0x33'),_0x44b545[_0xe756('0x32')]);return analyticCustomReportController[_0xe756('0x30')]({'id':_0x44b545[_0xe756('0x32')]},_0x4b03ec)[_0xe756('0x25')](handleResult(_0x44b545))[_0xe756('0x31')](handleError());}}catch(_0xccb0c5){logger[_0xe756('0x26')](JSON[_0xe756('0x1e')](_0xccb0c5));}return logger[_0xe756('0x22')]('no\x20report\x20id');};}function getJobs(_0x383019){var _0xd27e56={};if(_0x383019){_0xd27e56['id']=_0x383019;}return db[_0xe756('0x34')][_0xe756('0x35')]({'where':_0xd27e56,'include':[{'model':db[_0xe756('0xd')],'attributes':['id',_0xe756('0x11'),_0xe756('0xc')],'include':[{'model':db[_0xe756('0x36')],'as':'Smtp','include':[{'model':db[_0xe756('0x37')],'as':_0xe756('0x37')}]}]}]})[_0xe756('0x25')](function(_0x59bcf8){var _0x411041=_['keys'](manager[_0xe756('0x38')]);var _0x45f720=_[_0xe756('0x39')](_0x59bcf8,function(_0x4d1d7c){return _0x4d1d7c['id'][_0xe756('0x3a')]();});var _0x546d23=_['keyBy'](_0x59bcf8,function(_0xd4bc14){return _0xd4bc14['id'][_0xe756('0x3a')]();});var _0x3e99a4=_0x383019?_0x45f720:_[_0xe756('0x3b')](_0x45f720,_0x411041);var _0x2d5288=_['intersection'](_0x45f720,_0x411041);var _0x52339a=_['difference'](_0x411041,_0x45f720);var _0x21b593;var _0x5c5397;for(_0x21b593=0x0;_0x21b593<_0x52339a[_0xe756('0x3c')]&&!_0x383019;_0x21b593+=0x1){_0x5c5397=_0x52339a[_0x21b593]['toString']();if(manager[_0xe756('0x3d')](_0x5c5397)){manager[_0xe756('0x3e')](_0x5c5397);manager[_0xe756('0x3f')](_0x5c5397);logger[_0xe756('0x22')](_0xe756('0x40'),_0x5c5397);}}logger[_0xe756('0x22')]('toRun',JSON['stringify'](_0x3e99a4));for(_0x21b593=0x0;_0x21b593<_0x3e99a4[_0xe756('0x3c')];_0x21b593+=0x1){_0x5c5397=_0x3e99a4[_0x21b593]['toString']();logger['info']('index',_0x5c5397);if(_0x383019){logger[_0xe756('0x22')](_0xe756('0x41'),_0x383019);logger[_0xe756('0x22')](JSON[_0xe756('0x1e')](_0x546d23[_0x5c5397]));BPromise['resolve']()[_0xe756('0x25')](handleJob(_0x546d23[_0x5c5397]));logger[_0xe756('0x22')]('run\x20job',_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}else if(_0x546d23[_0x5c5397][_0xe756('0x42')]&&_0x546d23[_0x5c5397][_0xe756('0x43')]&&moment()[_0xe756('0x44')](_0x546d23[_0x5c5397]['startAt'],_0x546d23[_0x5c5397][_0xe756('0x45')])){manager['add'](_0x5c5397,_0x546d23[_0x5c5397][_0xe756('0x42')],handleJob(_0x546d23[_0x5c5397]));manager['start'](_0x5c5397);logger[_0xe756('0x22')](_0xe756('0x46'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}else if(manager[_0xe756('0x3d')](_0x5c5397)){manager['stop'](_0x5c5397);manager[_0xe756('0x3f')](_0x5c5397);logger['info'](_0xe756('0x47'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}}for(_0x21b593=0x0,_0x5c5397;_0x21b593<_0x2d5288[_0xe756('0x3c')]&&!_0x383019;_0x21b593+=0x1){_0x5c5397=_0x2d5288[_0x21b593][_0xe756('0x3a')]();if(manager['exists'](_0x5c5397)){if(_0x546d23[_0x5c5397][_0xe756('0x42')]&&_0x546d23[_0x5c5397]['active']&&moment()[_0xe756('0x44')](_0x546d23[_0x5c5397][_0xe756('0x48')],_0x546d23[_0x5c5397][_0xe756('0x45')])){manager[_0xe756('0x49')](_0x5c5397,_0x546d23[_0x5c5397][_0xe756('0x42')],handleJob(_0x546d23[_0x5c5397]));logger['info'](_0xe756('0x4a'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397][_0xe756('0x42')]);}else{manager[_0xe756('0x3e')](_0x5c5397);manager[_0xe756('0x3f')](_0x5c5397);logger[_0xe756('0x22')](_0xe756('0x47'),_0x546d23[_0x5c5397][_0xe756('0x11')],_0x546d23[_0x5c5397]['cron']);}}}})[_0xe756('0x31')](function(_0x2a3b9b){logger[_0xe756('0x26')](JSON[_0xe756('0x1e')](_0x2a3b9b));});}exports[_0xe756('0x4b')]=function(_0xaee585){return getJobs(_0xaee585);};exports[_0xe756('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x5d95=['no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','endAt','add','start','add\x20cron','isBetween','update','update\x20cron','stop\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','extname','join','existsSync','status','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId'];(function(_0x1f9614,_0x18ab22){var _0x1ecf71=function(_0x228638){while(--_0x228638){_0x1f9614['push'](_0x1f9614['shift']());}};_0x1ecf71(++_0x18ab22);}(_0x5d95,0x161));var _0x55d9=function(_0x849a3,_0x2e8622){_0x849a3=_0x849a3-0x0;var _0x4459f1=_0x5d95[_0x849a3];return _0x4459f1;};'use strict';var fs=require('fs');var util=require(_0x55d9('0x0'));var path=require(_0x55d9('0x1'));var _=require('lodash');var moment=require(_0x55d9('0x2'));var CronJobManager=require(_0x55d9('0x3'));var jayson=require(_0x55d9('0x4'));var BPromise=require(_0x55d9('0x5'));var logger=require(_0x55d9('0x6'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x55d9('0x7'));var client=jayson[_0x55d9('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x50d0db,_0x162921){return function(){logger[_0x55d9('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x50d0db[_0x55d9('0xa')]);var _0x99d169=!![];var _0x35c808=_0x50d0db['MailAccount'][_0x55d9('0xb')]();var _0x6d89b6={'account':_0x35c808,'message':{'from':util[_0x55d9('0xc')](_0x55d9('0xd'),_0x50d0db[_0x55d9('0xe')][_0x55d9('0xf')],_0x50d0db[_0x55d9('0xe')][_0x55d9('0xa')]||_0x50d0db[_0x55d9('0xe')][_0x55d9('0x10')]['user']),'to':_0x50d0db[_0x55d9('0xa')],'cc':_0x50d0db['cc'],'bcc':_0x50d0db['bcc'],'subject':util[_0x55d9('0xc')](_0x55d9('0x11'),_0x162921[_0x55d9('0xf')],_0x50d0db[_0x55d9('0x12')],_0x50d0db[_0x55d9('0x13')])}};var _0x5317ff=path['join'](__dirname,_0x55d9('0x14'));var _0x27aeb3=_0x162921[_0x55d9('0x15')];var _0x3fdd4b=util[_0x55d9('0xc')](_0x55d9('0x16'),path['basename'](_0x162921['savename'],path[_0x55d9('0x17')](_0x162921[_0x55d9('0x15')])),'zip');var _0x455d78=path[_0x55d9('0x18')](_0x5317ff,_0x27aeb3);var _0x4017cb=path[_0x55d9('0x18')](_0x5317ff,_0x3fdd4b);if(fs[_0x55d9('0x19')](_0x455d78)){_0x162921[_0x55d9('0x1a')]='Sent';_0x6d89b6[_0x55d9('0x1b')]['attachments']=[{'filename':_0x27aeb3,'path':_0x455d78}];_0x6d89b6[_0x55d9('0x1b')]['text']=util['format'](_0x55d9('0x1c'),JSON[_0x55d9('0x1d')](_0x162921,null,0x2));}else if(fs[_0x55d9('0x19')](_0x4017cb)){_0x162921[_0x55d9('0x1a')]=_0x55d9('0x1e');_0x6d89b6['message']['attachments']=[{'filename':_0x3fdd4b,'path':_0x4017cb}];}else{_0x6d89b6[_0x55d9('0x1b')][_0x55d9('0x1f')]=_0x55d9('0x20');if(!_0x50d0db[_0x55d9('0x21')]){_0x99d169=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x99d169){return client[_0x55d9('0x22')](_0x55d9('0x23'),_0x6d89b6)['then'](function(_0x1431d8){if(_0x1431d8[_0x55d9('0x24')]){return logger['error'](_0x55d9('0x25'),JSON[_0x55d9('0x1d')](_0x1431d8));}return logger[_0x55d9('0x9')](_0x55d9('0x26'));})[_0x55d9('0x27')](function(_0x247338){return logger[_0x55d9('0x24')]('error\x20mail',JSON[_0x55d9('0x1d')](_0x247338));});}};}function handleError(){return function(_0xe1394){return logger[_0x55d9('0x24')](JSON[_0x55d9('0x1d')](_0xe1394));};}function handleResult(_0x4f46ba){return function(_0x471f96){logger[_0x55d9('0x9')](_0x55d9('0x28'),JSON[_0x55d9('0x1d')](_0x471f96));if(_0x4f46ba[_0x55d9('0xe')]&&_0x4f46ba[_0x55d9('0xe')][_0x55d9('0x10')]&&!_['isNil'](_0x4f46ba[_0x55d9('0xa')])){setTimeout(handleSendEmail(_0x4f46ba,_0x471f96),0x3c*0x3e8);}};}function handleJob(_0x285e78){return function(){try{if(_[_0x55d9('0x29')](_0x285e78[_0x55d9('0x12')])){return logger[_0x55d9('0x9')](_0x55d9('0x2a'));}if(_[_0x55d9('0x29')](_0x285e78['subtractUnit'])){return logger[_0x55d9('0x9')](_0x55d9('0x2b'));}var _0xb71384={'startDate':moment()[_0x55d9('0x2c')](_0x285e78[_0x55d9('0x12')],_0x285e78[_0x55d9('0x13')])[_0x55d9('0xc')](_0x55d9('0x2d')),'endDate':moment()[_0x55d9('0xc')](_0x55d9('0x2d')),'type':_0x55d9('0x2e'),'output':_0x285e78['output'],'name':_0x285e78[_0x55d9('0xf')]};if(!_[_0x55d9('0x29')](_0x285e78[_0x55d9('0x2f')])){logger[_0x55d9('0x9')]('exec\x20defaul\x20report\x20id:%s',_0x285e78[_0x55d9('0x2f')]);return analyticDefaultReportController[_0x55d9('0x30')]({'id':_0x285e78['DefaultReportId']},_0xb71384)[_0x55d9('0x31')](handleResult(_0x285e78))[_0x55d9('0x27')](handleError());}if(!_[_0x55d9('0x29')](_0x285e78['CustomReportId'])){logger[_0x55d9('0x9')](_0x55d9('0x32'),_0x285e78[_0x55d9('0x33')]);return analyticCustomReportController[_0x55d9('0x30')]({'id':_0x285e78['CustomReportId']},_0xb71384)[_0x55d9('0x31')](handleResult(_0x285e78))['catch'](handleError());}}catch(_0x496b12){logger[_0x55d9('0x24')](JSON[_0x55d9('0x1d')](_0x496b12));}return logger['info'](_0x55d9('0x34'));};}function getJobs(_0x58b940){var _0x59b874={};if(_0x58b940){_0x59b874['id']=_0x58b940;}return db[_0x55d9('0x35')][_0x55d9('0x36')]({'where':_0x59b874,'include':[{'model':db[_0x55d9('0xe')],'attributes':['id',_0x55d9('0xf'),_0x55d9('0xa')],'include':[{'model':db['MailServerOut'],'as':_0x55d9('0x10'),'include':[{'model':db['CloudProvider'],'as':_0x55d9('0x37')}]}]}]})[_0x55d9('0x31')](function(_0x470aaf){var _0x39cee9=_[_0x55d9('0x38')](manager[_0x55d9('0x39')]);var _0x2bd918=_[_0x55d9('0x3a')](_0x470aaf,function(_0x42fc6c){return _0x42fc6c['id'][_0x55d9('0x3b')]();});var _0x2707a9=_['keyBy'](_0x470aaf,function(_0x92aec0){return _0x92aec0['id']['toString']();});var _0x1be4ad=_0x58b940?_0x2bd918:_[_0x55d9('0x3c')](_0x2bd918,_0x39cee9);var _0x3b1fe3=_[_0x55d9('0x3d')](_0x2bd918,_0x39cee9);var _0x513290=_[_0x55d9('0x3c')](_0x39cee9,_0x2bd918);var _0x30f750;var _0x41909e;for(_0x30f750=0x0;_0x30f750<_0x513290[_0x55d9('0x3e')]&&!_0x58b940;_0x30f750+=0x1){_0x41909e=_0x513290[_0x30f750][_0x55d9('0x3b')]();if(manager[_0x55d9('0x3f')](_0x41909e)){manager[_0x55d9('0x40')](_0x41909e);manager[_0x55d9('0x41')](_0x41909e);logger[_0x55d9('0x9')](_0x55d9('0x42'),_0x41909e);}}logger[_0x55d9('0x9')]('toRun',JSON[_0x55d9('0x1d')](_0x1be4ad));for(_0x30f750=0x0;_0x30f750<_0x1be4ad['length'];_0x30f750+=0x1){_0x41909e=_0x1be4ad[_0x30f750][_0x55d9('0x3b')]();logger[_0x55d9('0x9')]('index',_0x41909e);if(_0x58b940){logger[_0x55d9('0x9')](_0x55d9('0x43'),_0x58b940);logger[_0x55d9('0x9')](JSON[_0x55d9('0x1d')](_0x2707a9[_0x41909e]));BPromise[_0x55d9('0x44')]()[_0x55d9('0x31')](handleJob(_0x2707a9[_0x41909e]));logger[_0x55d9('0x9')](_0x55d9('0x45'),_0x2707a9[_0x41909e][_0x55d9('0xf')],_0x2707a9[_0x41909e][_0x55d9('0x46')]);}else if(_0x2707a9[_0x41909e]['cron']&&_0x2707a9[_0x41909e][_0x55d9('0x47')]&&moment()['isBetween'](_0x2707a9[_0x41909e]['startAt'],_0x2707a9[_0x41909e][_0x55d9('0x48')])){manager[_0x55d9('0x49')](_0x41909e,_0x2707a9[_0x41909e]['cron'],handleJob(_0x2707a9[_0x41909e]));manager[_0x55d9('0x4a')](_0x41909e);logger[_0x55d9('0x9')](_0x55d9('0x4b'),_0x2707a9[_0x41909e]['name'],_0x2707a9[_0x41909e]['cron']);}else if(manager['exists'](_0x41909e)){manager[_0x55d9('0x40')](_0x41909e);manager[_0x55d9('0x41')](_0x41909e);logger[_0x55d9('0x9')]('stop\x20cron',_0x2707a9[_0x41909e]['name'],_0x2707a9[_0x41909e][_0x55d9('0x46')]);}}for(_0x30f750=0x0,_0x41909e;_0x30f750<_0x3b1fe3[_0x55d9('0x3e')]&&!_0x58b940;_0x30f750+=0x1){_0x41909e=_0x3b1fe3[_0x30f750][_0x55d9('0x3b')]();if(manager[_0x55d9('0x3f')](_0x41909e)){if(_0x2707a9[_0x41909e]['cron']&&_0x2707a9[_0x41909e]['active']&&moment()[_0x55d9('0x4c')](_0x2707a9[_0x41909e]['startAt'],_0x2707a9[_0x41909e][_0x55d9('0x48')])){manager[_0x55d9('0x4d')](_0x41909e,_0x2707a9[_0x41909e][_0x55d9('0x46')],handleJob(_0x2707a9[_0x41909e]));logger[_0x55d9('0x9')](_0x55d9('0x4e'),_0x2707a9[_0x41909e]['name'],_0x2707a9[_0x41909e][_0x55d9('0x46')]);}else{manager[_0x55d9('0x40')](_0x41909e);manager[_0x55d9('0x41')](_0x41909e);logger['info'](_0x55d9('0x4f'),_0x2707a9[_0x41909e][_0x55d9('0xf')],_0x2707a9[_0x41909e][_0x55d9('0x46')]);}}}})['catch'](function(_0x3734c5){logger[_0x55d9('0x24')](JSON['stringify'](_0x3734c5));});}exports[_0x55d9('0x50')]=function(_0x450835){return getJobs(_0x450835);};exports[_0x55d9('0x4a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d41=['aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','ValidationError','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','sentiment','CloudProvider','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Cloud\x20Provider\x20not\x20available','push','all','start','lodash'];(function(_0x4e02ea,_0x1d08bf){var _0x55a1e2=function(_0x46b345){while(--_0x46b345){_0x4e02ea['push'](_0x4e02ea['shift']());}};_0x55a1e2(++_0x1d08bf);}(_0x4d41,0x153));var _0x14d4=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x4d41[_0x2bbc07];return _0x6879e4;};var _=require(_0x14d4('0x0'));var AWS=require(_0x14d4('0x1'));var rp=require(_0x14d4('0x2'));var util=require('util');var BPromise=require(_0x14d4('0x3'));var db=require(_0x14d4('0x4'))['db'];var logger=require(_0x14d4('0x5'))(_0x14d4('0x6'));function getTranscriptionJob(_0x1d6194,_0x1b8e61,_0x582ae6,_0x579772){return new Promise(function(_0x21f1f2,_0x35eabb){var _0x2f7d30=new AWS['TranscribeService']({'accessKeyId':_0x1b8e61,'secretAccessKey':_0x1d6194,'region':_0x582ae6});_0x2f7d30['getTranscriptionJob']({'TranscriptionJobName':_0x579772},function(_0x5af0d5,_0x38ad4e){if(_0x5af0d5){return _0x35eabb(_0x5af0d5);}else{return _0x21f1f2(_0x38ad4e);}});});}function sentiment(_0x1bceeb,_0x28d13a,_0x466286,_0x4dab73,_0x54ed12){return new Promise(function(_0x14e477,_0x3031cc){var _0x2f4309=new AWS['Comprehend']({'accessKeyId':_0x28d13a,'secretAccessKey':_0x1bceeb,'region':_0x466286});_0x2f4309['detectSentiment']({'Text':_0x4dab73,'LanguageCode':_0x54ed12[_0x14d4('0x7')](0x0,0x2)},function(_0x5e42e7,_0x1ddd8b){if(_0x5e42e7){return _0x3031cc(_0x5e42e7);}else{return _0x14e477(_0x1ddd8b);}});});}function checkTranscribeJob(_0x1f3b0b,_0x53babc,_0x1b6d6b){var _0xb92ef4;return new BPromise(function(_0x1aec75,_0xce7f14){logger[_0x14d4('0x8')](util[_0x14d4('0x9')](_0x14d4('0xa'),_0x1f3b0b['id'],_0x1f3b0b[_0x14d4('0xb')]));return getTranscriptionJob(_0x1b6d6b[_0x14d4('0xc')],_0x1b6d6b['data2'],_0x53babc[_0x14d4('0xd')],_0x1f3b0b[_0x14d4('0xb')])[_0x14d4('0xe')](function(_0x512c79){logger[_0x14d4('0x8')](util[_0x14d4('0x9')](_0x14d4('0xf'),_0x1f3b0b['id'],_0x1f3b0b[_0x14d4('0xb')],_0x512c79[_0x14d4('0x10')][_0x14d4('0x11')]));if(!_0x1f3b0b[_0x14d4('0x12')]){switch(_0x512c79[_0x14d4('0x10')][_0x14d4('0x11')]){case _0x14d4('0x13'):var _0x75287d={'transcribeStatus':_0x512c79[_0x14d4('0x10')]['TranscriptionJobStatus'],'fileUri':_0x512c79[_0x14d4('0x10')][_0x14d4('0x14')][_0x14d4('0x15')]};logger['info'](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x1f3b0b['id']));return rp({'uri':_0x512c79[_0x14d4('0x10')][_0x14d4('0x14')][_0x14d4('0x15')],'json':!![]})[_0x14d4('0xe')](function(_0x39022f){logger['info'](util[_0x14d4('0x9')](_0x14d4('0x16'),_0x1f3b0b['id']));if(_0x39022f&&_0x39022f[_0x14d4('0x17')]&&_0x39022f['results']['transcripts']&&_0x39022f[_0x14d4('0x17')][_0x14d4('0x18')][_0x14d4('0x19')]){_0x75287d['fileText']='';for(var _0x2ffca8=0x0;_0x2ffca8<_0x39022f[_0x14d4('0x17')]['transcripts'][_0x14d4('0x19')];_0x2ffca8++){_0x75287d[_0x14d4('0x12')]+=_0x39022f[_0x14d4('0x17')][_0x14d4('0x18')][_0x2ffca8]['transcript']+'';}}return _0x1f3b0b[_0x14d4('0x1a')](_0x75287d);})['then'](function(){logger['info'](util[_0x14d4('0x9')](_0x14d4('0x1b'),_0x1f3b0b['id']));if(!_0x1f3b0b[_0x14d4('0x1c')]){throw new db[(_0x14d4('0x1d'))]['ValidationError'](_0x14d4('0x1e'));}if(!_0x53babc['sentiment']||!_0x53babc[_0x14d4('0x1f')]||!_0x53babc[_0x14d4('0x20')]||!_0x53babc['language']||!_0x53babc[_0x14d4('0x21')]){throw new db[(_0x14d4('0x1d'))]['ValidationError'](_0x14d4('0x22'));}if(!_0x75287d[_0x14d4('0x12')]){throw new Error(_0x14d4('0x23'));}if(_0x53babc['sentimentAccountId']===_0x1b6d6b['id']){return _0x1b6d6b;}else{return db['CloudProvider'][_0x14d4('0x24')]({'where':{'id':_settings[_0x14d4('0x1f')]}});}})['then'](function(_0x136309){if(!_0x136309){throw new db['Sequelize'][(_0x14d4('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x136309[_0x14d4('0xc')]||!_0x136309[_0x14d4('0x26')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))](_0x14d4('0x27'));}_0xb92ef4=_0x136309;logger[_0x14d4('0x8')](util[_0x14d4('0x9')](_0x14d4('0x28'),_0x1f3b0b['id']));return sentiment(_0xb92ef4['data1'],_0xb92ef4[_0x14d4('0x26')],_0x53babc[_0x14d4('0x20')],_0x75287d[_0x14d4('0x12')],_0x53babc[_0x14d4('0x29')]);})[_0x14d4('0xe')](function(_0x3a47bd){logger['info'](util[_0x14d4('0x9')](_0x14d4('0x2a'),_0x1f3b0b['id']));return _0x1f3b0b[_0x14d4('0x1a')]({'sentiment':_0x3a47bd[_0x14d4('0x2b')],'sPositive':_0x3a47bd[_0x14d4('0x2c')][_0x14d4('0x2d')],'sNegative':_0x3a47bd[_0x14d4('0x2c')]['Negative'],'sMixed':_0x3a47bd[_0x14d4('0x2c')][_0x14d4('0x2e')],'sNeutral':_0x3a47bd[_0x14d4('0x2c')][_0x14d4('0x2f')]});})[_0x14d4('0xe')](function(){logger[_0x14d4('0x8')](util['format'](_0x14d4('0x1b'),_0x1f3b0b['id']));_0x1aec75();});case _0x14d4('0x30'):return _0x1f3b0b['update']({'transcribeStatus':_0x14d4('0x30'),'failureReason':_0x512c79[_0x14d4('0x10')][_0x14d4('0x31')]})['then'](function(){logger[_0x14d4('0x8')](util['format'](_0x14d4('0x1b'),_0x1f3b0b['id']));_0x1aec75();});default:logger[_0x14d4('0x8')](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1f3b0b['id']));break;}}else{return BPromise[_0x14d4('0x32')]()[_0x14d4('0xe')](function(){if(!_0x1f3b0b[_0x14d4('0x1c')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x53babc[_0x14d4('0x33')]||!_0x53babc[_0x14d4('0x1f')]||!_0x53babc[_0x14d4('0x20')]||!_0x53babc[_0x14d4('0x29')]||!_0x53babc[_0x14d4('0x21')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))](_0x14d4('0x22'));}if(!_0x1f3b0b[_0x14d4('0x12')]){throw new Error(_0x14d4('0x23'));}if(_0x53babc[_0x14d4('0x1f')]===_0x1b6d6b['id']){return _0x1b6d6b;}else{return db[_0x14d4('0x34')][_0x14d4('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x14d4('0xe')](function(_0x25bce6){if(!_0x25bce6){throw new db['Sequelize'][(_0x14d4('0x25'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x25bce6['data1']||!_0x25bce6[_0x14d4('0x26')]){throw new db[(_0x14d4('0x1d'))][(_0x14d4('0x25'))]('Cloud\x20Provider\x20not\x20configured');}_0xb92ef4=_0x25bce6;logger[_0x14d4('0x8')](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1f3b0b['id']));return sentiment(_0xb92ef4[_0x14d4('0xc')],_0xb92ef4[_0x14d4('0x26')],_0x53babc[_0x14d4('0x20')],_0x1f3b0b[_0x14d4('0x12')],_0x53babc[_0x14d4('0x29')]);})['then'](function(_0x372275){logger['info'](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1f3b0b['id']));return _0x1f3b0b['update']({'sentiment':_0x372275[_0x14d4('0x2b')],'sPositive':_0x372275[_0x14d4('0x2c')][_0x14d4('0x2d')],'sNegative':_0x372275[_0x14d4('0x2c')][_0x14d4('0x35')],'sMixed':_0x372275['SentimentScore'][_0x14d4('0x2e')],'sNeutral':_0x372275[_0x14d4('0x2c')][_0x14d4('0x2f')],'transcribeStatus':_0x14d4('0x13')});})[_0x14d4('0xe')](function(){logger[_0x14d4('0x8')](util[_0x14d4('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1f3b0b['id']));_0x1aec75();});}})[_0x14d4('0x36')](function(_0x5bef7d){if(_0x5bef7d){if(!_0x5bef7d[_0x14d4('0x37')]||_0x5bef7d[_0x14d4('0x37')]!==_0x14d4('0x38')){logger[_0x14d4('0x39')](util['format'](_0x14d4('0x3a'),_0x1f3b0b['id']),util[_0x14d4('0x3b')](_0x5bef7d,{'showHidden':![],'depth':null}));}}_0x1aec75();});});}function checkTranscribe(){var _0x3e9087;var _0x4acd72;var _0x586119;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x14d4('0x3c')}})[_0x14d4('0xe')](function(_0x34d0d4){if(!_0x34d0d4||!_0x34d0d4['length']){throw new db['Sequelize'][(_0x14d4('0x25'))](_0x14d4('0x3d'));}_0x3e9087=_0x34d0d4;return db[_0x14d4('0x3e')][_0x14d4('0x24')]({'where':{'id':0x1}});})[_0x14d4('0xe')](function(_0x18fd50){if(!_0x18fd50){throw new db['Sequelize'][(_0x14d4('0x25'))]('Settings\x20not\x20available');}_0x4acd72=_0x18fd50;if(!_0x4acd72[_0x14d4('0x6')]||!_0x4acd72[_0x14d4('0x3f')]||!_0x4acd72[_0x14d4('0xd')]||!_0x4acd72[_0x14d4('0x29')]||!_0x4acd72[_0x14d4('0x21')]){throw new db['Sequelize'][(_0x14d4('0x25'))]('Transcribe\x20not\x20configured');}return db[_0x14d4('0x34')]['findOne']({'where':{'id':_0x4acd72[_0x14d4('0x3f')]}});})[_0x14d4('0xe')](function(_0x5b2c71){if(!_0x5b2c71){throw new db['Sequelize'][(_0x14d4('0x25'))](_0x14d4('0x40'));}if(!_0x5b2c71['data1']||!_0x5b2c71[_0x14d4('0x26')]){throw new db['Sequelize'][(_0x14d4('0x25'))](_0x14d4('0x27'));}_0x586119=_0x5b2c71;var _0x39086e=[];_0x3e9087['forEach'](function(_0x3ecd97){_0x39086e[_0x14d4('0x41')](checkTranscribeJob(_0x3ecd97,_0x4acd72,_0x586119));});return BPromise[_0x14d4('0x42')](_0x39086e);})[_0x14d4('0x36')](function(_0x128c2d){if(_0x128c2d){if(!_0x128c2d[_0x14d4('0x37')]||_0x128c2d[_0x14d4('0x37')]!==_0x14d4('0x38')){logger[_0x14d4('0x39')](util['inspect'](_0x128c2d,{'showHidden':![],'depth':null}));}}});}exports[_0x14d4('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x4e61=['request-promise','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','info','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','sentimentAccountId','Sequelize','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','findOne','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','start','lodash','aws-sdk'];(function(_0x4a583a,_0x59c184){var _0x2b561f=function(_0x3a1100){while(--_0x3a1100){_0x4a583a['push'](_0x4a583a['shift']());}};_0x2b561f(++_0x59c184);}(_0x4e61,0x8c));var _0x14e6=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4e61[_0x27af45];return _0x18df21;};var _=require(_0x14e6('0x0'));var AWS=require(_0x14e6('0x1'));var rp=require(_0x14e6('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x14e6('0x3'))['db'];var logger=require(_0x14e6('0x4'))(_0x14e6('0x5'));function getTranscriptionJob(_0xdcdb2a,_0x1cef29,_0x2b4538,_0x723ba9){return new Promise(function(_0x5ae983,_0x78f960){var _0x9f9c31=new AWS[(_0x14e6('0x6'))]({'accessKeyId':_0x1cef29,'secretAccessKey':_0xdcdb2a,'region':_0x2b4538});_0x9f9c31[_0x14e6('0x7')]({'TranscriptionJobName':_0x723ba9},function(_0x34b4eb,_0x1200e5){if(_0x34b4eb){return _0x78f960(_0x34b4eb);}else{return _0x5ae983(_0x1200e5);}});});}function sentiment(_0x24326b,_0x8c10fd,_0x17eeed,_0x40ce5d,_0x4bc647){return new Promise(function(_0x213bf3,_0x473ed2){var _0x1ae9be=new AWS[(_0x14e6('0x8'))]({'accessKeyId':_0x8c10fd,'secretAccessKey':_0x24326b,'region':_0x17eeed});_0x1ae9be['detectSentiment']({'Text':_0x40ce5d,'LanguageCode':_0x4bc647['substring'](0x0,0x2)},function(_0x53ab5d,_0x4d7ec0){if(_0x53ab5d){return _0x473ed2(_0x53ab5d);}else{return _0x213bf3(_0x4d7ec0);}});});}function checkTranscribeJob(_0x404d21,_0x5de0ea,_0x5a1ced){var _0x128e45;return new BPromise(function(_0x2eea38,_0x3834c2){logger['info'](util[_0x14e6('0x9')](_0x14e6('0xa'),_0x404d21['id'],_0x404d21[_0x14e6('0xb')]));return getTranscriptionJob(_0x5a1ced[_0x14e6('0xc')],_0x5a1ced[_0x14e6('0xd')],_0x5de0ea['transcribeRegion'],_0x404d21[_0x14e6('0xb')])[_0x14e6('0xe')](function(_0x753064){logger[_0x14e6('0xf')](util[_0x14e6('0x9')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x404d21['id'],_0x404d21[_0x14e6('0xb')],_0x753064['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x404d21['fileText']){switch(_0x753064[_0x14e6('0x10')][_0x14e6('0x11')]){case _0x14e6('0x12'):var _0x3423b3={'transcribeStatus':_0x753064['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x753064[_0x14e6('0x10')][_0x14e6('0x13')][_0x14e6('0x14')]};logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x15'),_0x404d21['id']));return rp({'uri':_0x753064[_0x14e6('0x10')][_0x14e6('0x13')][_0x14e6('0x14')],'json':!![]})[_0x14e6('0xe')](function(_0x20ea17){logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x16'),_0x404d21['id']));if(_0x20ea17&&_0x20ea17[_0x14e6('0x17')]&&_0x20ea17[_0x14e6('0x17')][_0x14e6('0x18')]&&_0x20ea17[_0x14e6('0x17')][_0x14e6('0x18')][_0x14e6('0x19')]){_0x3423b3[_0x14e6('0x1a')]='';for(var _0x4a5084=0x0;_0x4a5084<_0x20ea17[_0x14e6('0x17')][_0x14e6('0x18')][_0x14e6('0x19')];_0x4a5084++){_0x3423b3[_0x14e6('0x1a')]+=_0x20ea17[_0x14e6('0x17')][_0x14e6('0x18')][_0x4a5084][_0x14e6('0x1b')]+'';}}return _0x404d21['update'](_0x3423b3);})[_0x14e6('0xe')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x404d21['id']));if(!_0x404d21[_0x14e6('0x1c')]){throw new db['Sequelize'][(_0x14e6('0x1d'))](_0x14e6('0x1e'));}if(!_0x5de0ea[_0x14e6('0x1f')]||!_0x5de0ea['sentimentAccountId']||!_0x5de0ea[_0x14e6('0x20')]||!_0x5de0ea[_0x14e6('0x21')]||!_0x5de0ea[_0x14e6('0x22')]){throw new db['Sequelize'][(_0x14e6('0x1d'))](_0x14e6('0x23'));}if(!_0x3423b3[_0x14e6('0x1a')]){throw new Error(_0x14e6('0x24'));}if(_0x5de0ea['sentimentAccountId']===_0x5a1ced['id']){return _0x5a1ced;}else{return db[_0x14e6('0x25')]['findOne']({'where':{'id':_settings[_0x14e6('0x26')]}});}})[_0x14e6('0xe')](function(_0x52dafa){if(!_0x52dafa){throw new db[(_0x14e6('0x27'))][(_0x14e6('0x1d'))](_0x14e6('0x28'));}if(!_0x52dafa[_0x14e6('0xc')]||!_0x52dafa['data2']){throw new db[(_0x14e6('0x27'))][(_0x14e6('0x1d'))](_0x14e6('0x29'));}_0x128e45=_0x52dafa;logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x2a'),_0x404d21['id']));return sentiment(_0x128e45[_0x14e6('0xc')],_0x128e45['data2'],_0x5de0ea[_0x14e6('0x20')],_0x3423b3[_0x14e6('0x1a')],_0x5de0ea[_0x14e6('0x21')]);})[_0x14e6('0xe')](function(_0x47ecac){logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x2b'),_0x404d21['id']));return _0x404d21[_0x14e6('0x2c')]({'sentiment':_0x47ecac[_0x14e6('0x2d')],'sPositive':_0x47ecac[_0x14e6('0x2e')][_0x14e6('0x2f')],'sNegative':_0x47ecac[_0x14e6('0x2e')][_0x14e6('0x30')],'sMixed':_0x47ecac[_0x14e6('0x2e')][_0x14e6('0x31')],'sNeutral':_0x47ecac[_0x14e6('0x2e')]['Neutral']});})[_0x14e6('0xe')](function(){logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x32'),_0x404d21['id']));_0x2eea38();});case _0x14e6('0x33'):return _0x404d21[_0x14e6('0x2c')]({'transcribeStatus':_0x14e6('0x33'),'failureReason':_0x753064[_0x14e6('0x10')][_0x14e6('0x34')]})[_0x14e6('0xe')](function(){logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x32'),_0x404d21['id']));_0x2eea38();});default:logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x35'),_0x404d21['id']));break;}}else{return BPromise[_0x14e6('0x36')]()['then'](function(){if(!_0x404d21[_0x14e6('0x1c')]){throw new db['Sequelize'][(_0x14e6('0x1d'))](_0x14e6('0x1e'));}if(!_0x5de0ea[_0x14e6('0x1f')]||!_0x5de0ea[_0x14e6('0x26')]||!_0x5de0ea['sentimentRegion']||!_0x5de0ea[_0x14e6('0x21')]||!_0x5de0ea[_0x14e6('0x22')]){throw new db['Sequelize'][(_0x14e6('0x1d'))](_0x14e6('0x23'));}if(!_0x404d21[_0x14e6('0x1a')]){throw new Error(_0x14e6('0x24'));}if(_0x5de0ea[_0x14e6('0x26')]===_0x5a1ced['id']){return _0x5a1ced;}else{return db['CloudProvider'][_0x14e6('0x37')]({'where':{'id':_settings[_0x14e6('0x26')]}});}})['then'](function(_0x4a7155){if(!_0x4a7155){throw new db[(_0x14e6('0x27'))][(_0x14e6('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4a7155['data1']||!_0x4a7155[_0x14e6('0xd')]){throw new db[(_0x14e6('0x27'))][(_0x14e6('0x1d'))](_0x14e6('0x29'));}_0x128e45=_0x4a7155;logger[_0x14e6('0xf')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x404d21['id']));return sentiment(_0x128e45['data1'],_0x128e45[_0x14e6('0xd')],_0x5de0ea[_0x14e6('0x20')],_0x404d21[_0x14e6('0x1a')],_0x5de0ea[_0x14e6('0x21')]);})[_0x14e6('0xe')](function(_0x36ba4d){logger[_0x14e6('0xf')](util[_0x14e6('0x9')](_0x14e6('0x2b'),_0x404d21['id']));return _0x404d21[_0x14e6('0x2c')]({'sentiment':_0x36ba4d['Sentiment'],'sPositive':_0x36ba4d[_0x14e6('0x2e')][_0x14e6('0x2f')],'sNegative':_0x36ba4d['SentimentScore'][_0x14e6('0x30')],'sMixed':_0x36ba4d[_0x14e6('0x2e')]['Mixed'],'sNeutral':_0x36ba4d[_0x14e6('0x2e')][_0x14e6('0x38')],'transcribeStatus':_0x14e6('0x12')});})['then'](function(){logger['info'](util[_0x14e6('0x9')](_0x14e6('0x32'),_0x404d21['id']));_0x2eea38();});}})[_0x14e6('0x39')](function(_0x16f205){if(_0x16f205){if(!_0x16f205['name']||_0x16f205[_0x14e6('0x3a')]!==_0x14e6('0x3b')){logger[_0x14e6('0x3c')](util['format'](_0x14e6('0x3d'),_0x404d21['id']),util[_0x14e6('0x3e')](_0x16f205,{'showHidden':![],'depth':null}));}}_0x2eea38();});});}function checkTranscribe(){var _0xb5ad23;var _0x14bc25;var _0x4b26f5;return db[_0x14e6('0x3f')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x14e6('0xe')](function(_0x2e9072){if(!_0x2e9072||!_0x2e9072[_0x14e6('0x19')]){throw new db[(_0x14e6('0x27'))][(_0x14e6('0x1d'))](_0x14e6('0x40'));}_0xb5ad23=_0x2e9072;return db[_0x14e6('0x41')][_0x14e6('0x37')]({'where':{'id':0x1}});})[_0x14e6('0xe')](function(_0x2ccd96){if(!_0x2ccd96){throw new db['Sequelize']['ValidationError']('Settings\x20not\x20available');}_0x14bc25=_0x2ccd96;if(!_0x14bc25[_0x14e6('0x5')]||!_0x14bc25[_0x14e6('0x42')]||!_0x14bc25['transcribeRegion']||!_0x14bc25['language']||!_0x14bc25[_0x14e6('0x22')]){throw new db[(_0x14e6('0x27'))][(_0x14e6('0x1d'))](_0x14e6('0x43'));}return db[_0x14e6('0x25')]['findOne']({'where':{'id':_0x14bc25[_0x14e6('0x42')]}});})[_0x14e6('0xe')](function(_0x3dd00d){if(!_0x3dd00d){throw new db[(_0x14e6('0x27'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3dd00d[_0x14e6('0xc')]||!_0x3dd00d[_0x14e6('0xd')]){throw new db['Sequelize'][(_0x14e6('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x4b26f5=_0x3dd00d;var _0x1c5d22=[];_0xb5ad23[_0x14e6('0x44')](function(_0x4c030b){_0x1c5d22[_0x14e6('0x45')](checkTranscribeJob(_0x4c030b,_0x14bc25,_0x4b26f5));});return BPromise['all'](_0x1c5d22);})[_0x14e6('0x39')](function(_0x4aeda2){if(_0x4aeda2){if(!_0x4aeda2['name']||_0x4aeda2[_0x14e6('0x3a')]!==_0x14e6('0x3b')){logger[_0x14e6('0x3c')](util['inspect'](_0x4aeda2,{'showHidden':![],'depth':null}));}}});}exports[_0x14e6('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7623=['hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','inspect','start','lodash','moment','ioredis','../../config/environment','../logger','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x7623,0x11e));var _0x3762=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0x7623[_0x23733d];return _0x4a9cc4;};'use strict';var _=require(_0x3762('0x0'));var moment=require(_0x3762('0x1'));var Redis=require(_0x3762('0x2'));var util=require('util');var config=require(_0x3762('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x3762('0x4'))('schedule');config['redis']=_[_0x3762('0x5')](config[_0x3762('0x6')],{'host':_0x3762('0x7'),'port':0x18eb});var io=require(_0x3762('0x8'))(new Redis(config[_0x3762('0x6')]));function closeInteractions(){var _0x264cd2=[];return db[_0x3762('0x9')][_0x3762('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x3762('0xb'))}}})['then'](function(_0x5b2a62){if(_0x5b2a62&&_0x5b2a62[_0x3762('0xc')]){_0x264cd2=_['map'](_0x5b2a62||[],'id');logger[_0x3762('0xd')](_0x3762('0xe'),_0x264cd2['join']());return db[_0x3762('0x9')][_0x3762('0xf')]({'closeReason':_0x3762('0x10'),'disposition':_0x3762('0x11'),'closed':!![],'closedAt':moment()[_0x3762('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x264cd2}});}})[_0x3762('0x13')](function(){if(_0x264cd2&&_0x264cd2['length']){logger[_0x3762('0xd')](_0x3762('0x14'),_0x264cd2[_0x3762('0x15')]());for(var _0x2494f6=0x0;_0x2494f6<_0x264cd2[_0x3762('0xc')];_0x2494f6++){io[_0x3762('0x16')]('whatsappInteraction:update',{'id':_0x264cd2[_0x2494f6],'closed':!![]});}}})[_0x3762('0x17')](function(_0x1f632b){logger[_0x3762('0x18')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1f632b?util[_0x3762('0x19')](_0x1f632b,{'showHidden':![],'depth':null}):'');});}exports[_0x3762('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x9ac4=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','socket.io-emitter','redis','lastMsgAt','hours','then','length'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x9ac4,0x132));var _0x49ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ac4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x49ac('0x0'));var Redis=require(_0x49ac('0x1'));var util=require(_0x49ac('0x2'));var config=require('../../config/environment');var db=require(_0x49ac('0x3'))['db'];var logger=require(_0x49ac('0x4'))(_0x49ac('0x5'));config['redis']=_[_0x49ac('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49ac('0x7'))(new Redis(config[_0x49ac('0x8')]));function closeInteractions(){var _0x14f57f=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x49ac('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x49ac('0xa'))}}})[_0x49ac('0xb')](function(_0x2ff1fb){if(_0x2ff1fb&&_0x2ff1fb[_0x49ac('0xc')]){_0x14f57f=_[_0x49ac('0xd')](_0x2ff1fb||[],'id');logger[_0x49ac('0xe')](_0x49ac('0xf'),_0x14f57f['join']());return db[_0x49ac('0x10')][_0x49ac('0x11')]({'closeReason':'system','disposition':_0x49ac('0x12'),'closed':!![],'closedAt':moment()[_0x49ac('0x13')](_0x49ac('0x14'))},{'where':{'id':_0x14f57f}});}})['then'](function(){if(_0x14f57f&&_0x14f57f['length']){logger['info'](_0x49ac('0x15'),_0x14f57f[_0x49ac('0x16')]());for(var _0x57f3b1=0x0;_0x57f3b1<_0x14f57f[_0x49ac('0xc')];_0x57f3b1++){io['emit'](_0x49ac('0x17'),{'id':_0x14f57f[_0x57f3b1],'closed':!![]});}}})[_0x49ac('0x18')](function(_0x479bd0){logger[_0x49ac('0x19')](_0x49ac('0x1a'),_0x479bd0?util[_0x49ac('0x1b')](_0x479bd0,{'showHidden':![],'depth':null}):'');});}exports[_0x49ac('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa7bc=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','then','CmContact','log','finished\x20populating','contacts1','CmHopper','bulkCreate','contacts2'];(function(_0x4f7a0d,_0x52af6b){var _0x11c586=function(_0x3dfe48){while(--_0x3dfe48){_0x4f7a0d['push'](_0x4f7a0d['shift']());}};_0x11c586(++_0x52af6b);}(_0xa7bc,0x18e));var _0xca7b=function(_0x1883d8,_0x1c3c87){_0x1883d8=_0x1883d8-0x0;var _0x55d856=_0xa7bc[_0x1883d8];return _0x55d856;};'use strict';var util=require(_0xca7b('0x0'));var db=require(_0xca7b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xca7b('0x2')]({'id':i,'firstName':_0xca7b('0x3')+i,'lastName':_0xca7b('0x4')+i,'phone':0xf879fb460+i,'email':_0xca7b('0x5')+i+_0xca7b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xca7b('0x3')+i,'lastName':_0xca7b('0x4')+i,'phone':0xf879fb460+i,'email':_0xca7b('0x5')+i+_0xca7b('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xca7b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xca7b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xca7b('0x7')]()});}db['CmContact']['destroy']({'where':{}})[_0xca7b('0x8')](function(){return db[_0xca7b('0x9')]['bulkCreate'](contacts);})[_0xca7b('0x8')](function(){console[_0xca7b('0xa')](_0xca7b('0xb'),_0xca7b('0xc'));return db[_0xca7b('0xd')]['destroy']({'where':{}});})[_0xca7b('0x8')](function(){return db[_0xca7b('0xd')][_0xca7b('0xe')](hopper);})[_0xca7b('0x8')](function(){console[_0xca7b('0xa')](_0xca7b('0xb'),'hopper1');return db[_0xca7b('0x9')][_0xca7b('0xe')](contacts2);})['then'](function(){console[_0xca7b('0xa')]('finished\x20populating',_0xca7b('0xf'));return db[_0xca7b('0xd')][_0xca7b('0xe')](hopper2);})[_0xca7b('0x8')](function(){console['log'](_0xca7b('0xb'),_0xca7b('0x10'));})[_0xca7b('0x11')](function(_0x1e7121){console['log'](_0x1e7121);});
\ No newline at end of file
+var _0x12db=['CmContact','then','bulkCreate','log','contacts1','CmHopper','destroy','finished\x20populating','contacts2','catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo'];(function(_0x556198,_0x2c237d){var _0x582e4b=function(_0x2c9881){while(--_0x2c9881){_0x556198['push'](_0x556198['shift']());}};_0x582e4b(++_0x2c237d);}(_0x12db,0xe2));var _0xb12d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x12db[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0xb12d('0x0'));var db=require(_0xb12d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb12d('0x2')]({'id':i,'firstName':_0xb12d('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xb12d('0x4')+i+_0xb12d('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xb12d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb12d('0x6')](),'updatedAt':Date[_0xb12d('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb12d('0x2')]({'id':i,'firstName':_0xb12d('0x3')+i,'lastName':_0xb12d('0x7')+i,'phone':0xf879fb460+i,'email':_0xb12d('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb12d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb12d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb12d('0x6')](),'updatedAt':Date['now']()});}db[_0xb12d('0x8')]['destroy']({'where':{}})[_0xb12d('0x9')](function(){return db['CmContact'][_0xb12d('0xa')](contacts);})[_0xb12d('0x9')](function(){console[_0xb12d('0xb')]('finished\x20populating',_0xb12d('0xc'));return db[_0xb12d('0xd')][_0xb12d('0xe')]({'where':{}});})['then'](function(){return db[_0xb12d('0xd')][_0xb12d('0xa')](hopper);})['then'](function(){console[_0xb12d('0xb')](_0xb12d('0xf'),'hopper1');return db[_0xb12d('0x8')][_0xb12d('0xa')](contacts2);})['then'](function(){console['log']('finished\x20populating',_0xb12d('0x10'));return db[_0xb12d('0xd')]['bulkCreate'](hopper2);})[_0xb12d('0x9')](function(){console[_0xb12d('0xb')](_0xb12d('0xf'),'hopper2');})[_0xb12d('0x11')](function(_0x19b960){console['log'](_0x19b960);});
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde65=['User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x1249b4,_0x5cb242){var _0xe6122d=function(_0x35b58d){while(--_0x35b58d){_0x1249b4['push'](_0x1249b4['shift']());}};_0xe6122d(++_0x5cb242);}(_0xde65,0x116));var _0x5de6=function(_0x54a54a,_0x5eae31){_0x54a54a=_0x54a54a-0x0;var _0x4aeb04=_0xde65[_0x54a54a];return _0x4aeb04;};'use strict';var util=require(_0x5de6('0x0'));var db=require(_0x5de6('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5de6('0x2')]({'name':util[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),i),'fullname':util[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),i),'email':util[_0x5de6('0x3')](_0x5de6('0x6'),_0x5de6('0x5'),i),'role':_0x5de6('0x5'),'password':'password','internal':0xfa0+i,'type':_0x5de6('0x7'),'transport':[_0x5de6('0x8'),'ws',_0x5de6('0x9')],'disallow':['all'],'allow':[_0x5de6('0xa')],'defaultuser':util['format'](_0x5de6('0x4'),_0x5de6('0x5'),i),'encryption':_0x5de6('0xb'),'avpf':_0x5de6('0xb'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x5de6('0xb'),'dtlsverify':'no','dtlscertfile':_0x5de6('0xc'),'dtlsprivatekey':_0x5de6('0xd'),'dtlssetup':_0x5de6('0xe'),'callerid':util[_0x5de6('0x3')](_0x5de6('0xf'),util[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),i),0xfa0+i)});}db[_0x5de6('0x10')][_0x5de6('0x11')](users)['then'](function(){console[_0x5de6('0x12')](_0x5de6('0x13'));})[_0x5de6('0x14')](function(_0x12e20c){console[_0x5de6('0x12')](_0x12e20c);});
\ No newline at end of file
+var _0x9940=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','log','catch','util','../mysqldb','push','format','agent','%s%s','password','friend','udp','ulaw','yes'];(function(_0x39a95b,_0x29db9e){var _0x3fadf9=function(_0x42661d){while(--_0x42661d){_0x39a95b['push'](_0x39a95b['shift']());}};_0x3fadf9(++_0x29db9e);}(_0x9940,0x116));var _0x0994=function(_0x17decb,_0x1b367f){_0x17decb=_0x17decb-0x0;var _0x42bc30=_0x9940[_0x17decb];return _0x42bc30;};'use strict';var util=require(_0x0994('0x0'));var db=require(_0x0994('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x0994('0x2')]({'name':util[_0x0994('0x3')]('%s%s',_0x0994('0x4'),i),'fullname':util[_0x0994('0x3')](_0x0994('0x5'),'agent',i),'email':util[_0x0994('0x3')]('%s%s@xcally.com',_0x0994('0x4'),i),'role':_0x0994('0x4'),'password':_0x0994('0x6'),'internal':0xfa0+i,'type':_0x0994('0x7'),'transport':[_0x0994('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0x0994('0x9')],'defaultuser':util[_0x0994('0x3')]('%s%s',_0x0994('0x4'),i),'encryption':_0x0994('0xa'),'avpf':_0x0994('0xa'),'force_avp':_0x0994('0xa'),'icesupport':_0x0994('0xa'),'dtlsenable':_0x0994('0xa'),'dtlsverify':'no','dtlscertfile':_0x0994('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x0994('0xc'),'callerid':util[_0x0994('0x3')](_0x0994('0xd'),util[_0x0994('0x3')](_0x0994('0x5'),_0x0994('0x4'),i),0xfa0+i)});}db['User'][_0x0994('0xe')](users)['then'](function(){console[_0x0994('0xf')]('add\x20user');})[_0x0994('0x10')](function(_0x53bbd5){console[_0x0994('0xf')](_0x53bbd5);});
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfb1=['userProfileId','MailQueue','Trunks','Trunk','getVoiceQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','sms','mail','whatsapp','agent','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','catch','log','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','resourceId','then','map','where','role','format','length','user:%s','handshake','query','find','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Campaign','user','voice:outbound'];(function(_0x22828c,_0x3a66b0){var _0x25b4dd=function(_0xda31b){while(--_0xda31b){_0x22828c['push'](_0x22828c['shift']());}};_0x25b4dd(++_0x3a66b0);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x32014b,_0x261e8b){_0x32014b=_0x32014b-0x0;var _0x488881=_0xdfb1[_0x32014b];return _0x488881;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var BPromise=require(_0x1dfb('0x2'));var db=require(_0x1dfb('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x1dfb('0x4')],'include':[{'as':_0x1dfb('0x5'),'model':db[_0x1dfb('0x6')],'attributes':['id',_0x1dfb('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1dfb('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1dfb('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x1dfb('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1dfb('0x4'),_0x1dfb('0x8')],'where':{'type':_0x1dfb('0x9')}};function getAssociatedResources(_0x190198,_0x5a14dd,_0x24d8b9){return db[_0x1dfb('0xa')][_0x1dfb('0xb')]({'where':{'name':_0x190198,'userProfileId':_0x5a14dd},'raw':!![]})['then'](function(_0xd747ac){if(_0xd747ac){if(_0xd747ac[_0x1dfb('0xc')]){switch(_0x190198){case _0x1dfb('0xd'):case _0x1dfb('0xe'):case _0x1dfb('0xf'):case _0x1dfb('0x10'):case _0x1dfb('0x11'):case _0x1dfb('0x12'):case _0x1dfb('0x13'):return db[_0x24d8b9]['findAll'](queryQueues);case _0x1dfb('0x14'):return db[_0x24d8b9][_0x1dfb('0x15')](queryTelephones);case'Trunks':return db[_0x24d8b9][_0x1dfb('0x15')](queryTrunks);case _0x1dfb('0x16'):return db[_0x24d8b9][_0x1dfb('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1dfb('0x15')]({'attributes':[_0x1dfb('0x17')],'where':{'sectionId':_0xd747ac['id']},'raw':!![]})[_0x1dfb('0x18')](function(_0x5ccfcc){if(_0x5ccfcc){var _0xdaf261={'where':{'id':_[_0x1dfb('0x19')](_0x5ccfcc,_0x1dfb('0x17'))},'raw':!![]};switch(_0x24d8b9){case'User':_0xdaf261[_0x1dfb('0x1a')][_0x1dfb('0x1b')]=_0x1dfb('0x7');break;case'Campaign':_0xdaf261['where'][_0x1dfb('0x8')]=_0x1dfb('0x9');break;}return db[_0x24d8b9][_0x1dfb('0x15')](_0xdaf261);}else{return[];}});}}else{return[];}})[_0x1dfb('0x18')](function(_0x50f2ec){return _0x50f2ec;});}function joinOrLeaveQueues(_0x2305e2,_0x33f6e5,_0x2842e7,_0x358465){_0x2305e2[_0x33f6e5](util[_0x1dfb('0x1c')]('%s:queue:%s',_0x2842e7,_0x358465[_0x1dfb('0x4')]));if(_0x358465['Agents']){for(var _0x54cd15=0x0;_0x54cd15<_0x358465['Agents'][_0x1dfb('0x1d')];_0x54cd15+=0x1){_0x2305e2[_0x33f6e5](util[_0x1dfb('0x1c')](_0x1dfb('0x1e'),_0x358465['Agents'][_0x54cd15]['name']));}}}function joinOrLeave(_0x5de3c9,_0x2c9a0c,_0x1ceaab){var _0x1cf4cd;if(_0x5de3c9[_0x1dfb('0x1f')][_0x1dfb('0x20')]['id']){db[_0x1dfb('0x6')][_0x1dfb('0x21')]({'attributes':['id',_0x1dfb('0x4'),_0x1dfb('0x1b'),'userProfileId'],'where':{'id':_0x5de3c9['handshake'][_0x1dfb('0x20')]['id']},'include':[{'model':db[_0x1dfb('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1dfb('0x23')],'as':_0x1dfb('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x1dfb('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1dfb('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1dfb('0x27')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x1dfb('0x18')](function(_0x417f71){if(_0x417f71){_0x1cf4cd=_0x417f71;_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')]('user:%s',_0x417f71[_0x1dfb('0x4')]));var _0x82339a=[];switch(_0x417f71[_0x1dfb('0x1b')]){case _0x1dfb('0x28'):_0x5de3c9[_0x2c9a0c](_0x1dfb('0x29'));_0x5de3c9[_0x2c9a0c]('voice:outbound');if(queryQueues[_0x1dfb('0x2a')](_0x1dfb('0x2b'))){delete queryQueues['include'];}_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2d')]['findAll'](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2e')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2f')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x30')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db['MailQueue'][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x31')]['findAll'](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x32')][_0x1dfb('0x15')](queryQueues));_0x82339a['push'](db['User'][_0x1dfb('0x15')](queryTelephones));_0x82339a[_0x1dfb('0x2c')](db['Trunk'][_0x1dfb('0x15')](queryTrunks));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x33')]['findAll'](queryCampaigns));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x6')][_0x1dfb('0x15')](queryAgents));break;case _0x1dfb('0x34'):_0x5de3c9[_0x2c9a0c]('voice:inbound');_0x5de3c9[_0x2c9a0c](_0x1dfb('0x35'));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('VoiceQueues',_0x417f71['userProfileId'],_0x1dfb('0x2d')));_0x82339a['push'](getAssociatedResources(_0x1dfb('0xe'),_0x417f71['userProfileId'],'ChatQueue'));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0xf'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x2f')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('SmsQueues',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x30')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x11'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x37')));_0x82339a['push'](getAssociatedResources('OpenchannelQueues',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x31')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('WhatsappQueues',_0x417f71['userProfileId'],_0x1dfb('0x32')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('Telephones',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x6')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x38'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x39')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x16'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x33')));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x6')]['findAll'](queryAgents));break;case'agent':_0x5de3c9[_0x2c9a0c](_0x1dfb('0x29'));_0x5de3c9[_0x2c9a0c]('voice:outbound');_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3a')]({'attributes':['id','name']}));_0x82339a[_0x1dfb('0x2c')](_0x417f71['getChatQueues']({'attributes':['id','name']}));_0x82339a['push'](_0x417f71[_0x1dfb('0x3b')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71['getSmsQueues']({'attributes':['id','name']}));_0x82339a['push'](_0x417f71[_0x1dfb('0x3c')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3d')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3e')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x82339a);}})[_0x1dfb('0x18')](function(_0x26710a){if(_0x26710a&&_0x26710a[_0x1dfb('0x1d')]){for(var _0x56de99=0x0;_0x56de99<_0x26710a[_0x1dfb('0x1d')];_0x56de99+=0x1){for(var _0x2ff784=0x0;_0x2ff784<_0x26710a[_0x56de99][_0x1dfb('0x1d')];_0x2ff784+=0x1){switch(_0x56de99){case 0x0:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x3f'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x1:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x40'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x2:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,'fax',_0x26710a[_0x56de99][_0x2ff784]);break;case 0x3:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x41'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x4:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x42'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x5:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,'openchannel',_0x26710a[_0x56de99][_0x2ff784]);break;case 0x6:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x43'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x7:if(_0x1cf4cd[_0x1dfb('0x1b')]!=='agent')_0x5de3c9[_0x2c9a0c](util['format']('telephone:%s',_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x4')]));break;case 0x8:if(_0x1cf4cd[_0x1dfb('0x1b')]!==_0x1dfb('0x44'))_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x45'),_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x4')]));break;case 0x9:if(_0x1cf4cd[_0x1dfb('0x1b')]!=='agent')_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x46'),_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x8')],_0x26710a[_0x56de99][_0x2ff784]['name']));break;case 0xa:_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x1e'),_0x26710a[_0x56de99][_0x2ff784]['name']));break;}}}}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x3de05f=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x48')],'id');return _0x1cf4cd[_0x1dfb('0x49')](_0x3de05f)[_0x1dfb('0x18')](function(){for(var _0x325ef8=0x0;_0x325ef8<_0x3de05f[_0x1dfb('0x1d')];_0x325ef8+=0x1){_0x1ceaab['emit'](_0x1dfb('0x4a'),{'ChatInteractionId':Number(_0x3de05f[_0x325ef8]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x556de4=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x4b')],'id');return _0x1cf4cd[_0x1dfb('0x4c')](_0x556de4)[_0x1dfb('0x18')](function(){for(var _0x25e455=0x0;_0x25e455<_0x556de4['length'];_0x25e455+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x556de4[_0x25e455]),'UserId':Number(_0x1cf4cd['id'])});}});}})['then'](function(){if(_0x2c9a0c==='leave'){var _0x51ee9c=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x24')],'id');return _0x1cf4cd[_0x1dfb('0x4e')](_0x51ee9c)[_0x1dfb('0x18')](function(){for(var _0x1ee0cf=0x0;_0x1ee0cf<_0x51ee9c[_0x1dfb('0x1d')];_0x1ee0cf+=0x1){_0x1ceaab[_0x1dfb('0x4d')](_0x1dfb('0x4f'),{'FaxInteractionId':Number(_0x51ee9c[_0x1ee0cf]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x41cb03=_['map'](_0x1cf4cd[_0x1dfb('0x25')],'id');return _0x1cf4cd[_0x1dfb('0x50')](_0x41cb03)['then'](function(){for(var _0x3c7e8d=0x0;_0x3c7e8d<_0x41cb03[_0x1dfb('0x1d')];_0x3c7e8d+=0x1){_0x1ceaab[_0x1dfb('0x4d')](_0x1dfb('0x51'),{'SmsInteractionId':Number(_0x41cb03[_0x3c7e8d]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x54d8fe=_['map'](_0x1cf4cd[_0x1dfb('0x26')],'id');return _0x1cf4cd[_0x1dfb('0x52')](_0x54d8fe)['then'](function(){for(var _0x530ba9=0x0;_0x530ba9<_0x54d8fe['length'];_0x530ba9+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x54d8fe[_0x530ba9]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0xef7a1=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x53')],'id');return _0x1cf4cd[_0x1dfb('0x54')](_0xef7a1)[_0x1dfb('0x18')](function(){for(var _0xfdf97c=0x0;_0xfdf97c<_0xef7a1['length'];_0xfdf97c+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xef7a1[_0xfdf97c]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x55')](function(_0x123e5e){_0x5de3c9[_0x1dfb('0x56')](_0x123e5e);});}}function onDisconnect(_0x47c899,_0x545f5b){joinOrLeave(_0x47c899,_0x1dfb('0x47'),_0x545f5b);}function onConnect(_0xabb993){joinOrLeave(_0xabb993,'join');}exports[_0x1dfb('0x57')]=function(_0x19795d){_0x19795d['on'](_0x1dfb('0x58'),function(_0x8eaf81){_0x8eaf81[_0x1dfb('0x59')](0x0);_0x8eaf81[_0x1dfb('0x5a')]=_0x8eaf81[_0x1dfb('0x5b')][_0x1dfb('0x58')]['remoteAddress']+':'+_0x8eaf81[_0x1dfb('0x5b')][_0x1dfb('0x58')][_0x1dfb('0x5c')];_0x8eaf81[_0x1dfb('0x5d')]=new Date();_0x8eaf81['log']=function(_0x17c15a){console[_0x1dfb('0x56')](_0x1dfb('0x5e')+_0x8eaf81[_0x1dfb('0x5f')][_0x1dfb('0x4')]+'['+_0x8eaf81[_0x1dfb('0x5a')]+']',_0x17c15a);};_0x8eaf81['on']('disconnect',function(){onDisconnect(_0x8eaf81,_0x19795d);_0x8eaf81[_0x1dfb('0x56')]('DISCONNECTED');});onConnect(_0x8eaf81);_0x8eaf81[_0x1dfb('0x56')](_0x1dfb('0x60'));});};
\ No newline at end of file
+var _0xd448=['../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','FaxQueue','getVoiceQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','voice','sms','mail','openchannel','telephone:%s','trunk:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird'];(function(_0x2504b0,_0x3196b8){var _0x41bd42=function(_0x14bc39){while(--_0x14bc39){_0x2504b0['push'](_0x2504b0['shift']());}};_0x41bd42(++_0x3196b8);}(_0xd448,0x172));var _0x8d44=function(_0x1917a4,_0x5bdd51){_0x1917a4=_0x1917a4-0x0;var _0x1714e3=_0xd448[_0x1917a4];return _0x1714e3;};'use strict';var _=require('lodash');var util=require(_0x8d44('0x0'));var BPromise=require(_0x8d44('0x1'));var db=require(_0x8d44('0x2'))['db'];var config=require(_0x8d44('0x3'));var queryQueues={'attributes':['id',_0x8d44('0x4')],'include':[{'as':_0x8d44('0x5'),'model':db[_0x8d44('0x6')],'attributes':['id',_0x8d44('0x4'),_0x8d44('0x7')],'raw':!![],'where':{'role':_0x8d44('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x8d44('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x8d44('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8d44('0x4'),_0x8d44('0xa')],'where':{'type':_0x8d44('0xb')}};function getAssociatedResources(_0x51e368,_0x320046,_0x2a5da6){return db['UserProfileSection']['findOne']({'where':{'name':_0x51e368,'userProfileId':_0x320046},'raw':!![]})[_0x8d44('0xc')](function(_0x362ed8){if(_0x362ed8){if(_0x362ed8[_0x8d44('0xd')]){switch(_0x51e368){case'VoiceQueues':case _0x8d44('0xe'):case _0x8d44('0xf'):case _0x8d44('0x10'):case _0x8d44('0x11'):case'OpenchannelQueues':case _0x8d44('0x12'):return db[_0x2a5da6][_0x8d44('0x13')](queryQueues);case _0x8d44('0x14'):return db[_0x2a5da6][_0x8d44('0x13')](queryTelephones);case _0x8d44('0x15'):return db[_0x2a5da6]['findAll'](queryTrunks);case _0x8d44('0x16'):return db[_0x2a5da6][_0x8d44('0x13')](queryCampaigns);}}else{return db[_0x8d44('0x17')][_0x8d44('0x13')]({'attributes':[_0x8d44('0x18')],'where':{'sectionId':_0x362ed8['id']},'raw':!![]})['then'](function(_0x407d70){if(_0x407d70){var _0x54aa00={'where':{'id':_[_0x8d44('0x19')](_0x407d70,_0x8d44('0x18'))},'raw':!![]};switch(_0x2a5da6){case _0x8d44('0x6'):_0x54aa00[_0x8d44('0x1a')][_0x8d44('0x7')]=_0x8d44('0x9');break;case _0x8d44('0x1b'):_0x54aa00[_0x8d44('0x1a')]['type']=_0x8d44('0xb');break;}return db[_0x2a5da6][_0x8d44('0x13')](_0x54aa00);}else{return[];}});}}else{return[];}})['then'](function(_0x4499f6){return _0x4499f6;});}function joinOrLeaveQueues(_0x12c37a,_0x3a9a17,_0x482455,_0x5f6fcb){_0x12c37a[_0x3a9a17](util[_0x8d44('0x1c')](_0x8d44('0x1d'),_0x482455,_0x5f6fcb[_0x8d44('0x4')]));if(_0x5f6fcb['Agents']){for(var _0x31f991=0x0;_0x31f991<_0x5f6fcb[_0x8d44('0x5')][_0x8d44('0x1e')];_0x31f991+=0x1){_0x12c37a[_0x3a9a17](util['format'](_0x8d44('0x1f'),_0x5f6fcb[_0x8d44('0x5')][_0x31f991][_0x8d44('0x4')]));}}}function joinOrLeave(_0x119998,_0x1f78c4,_0x4b5eb8){var _0x45251a;if(_0x119998[_0x8d44('0x20')][_0x8d44('0x21')]['id']){db['User']['find']({'attributes':['id',_0x8d44('0x4'),_0x8d44('0x7'),_0x8d44('0x22')],'where':{'id':_0x119998[_0x8d44('0x20')][_0x8d44('0x21')]['id']},'include':[{'model':db[_0x8d44('0x23')],'as':_0x8d44('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8d44('0x25')],'as':_0x8d44('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x8d44('0x27')],'as':_0x8d44('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x8d44('0x29')],'as':_0x8d44('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x8d44('0x2b')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x8d44('0xc')](function(_0x5eb0c5){if(_0x5eb0c5){_0x45251a=_0x5eb0c5;_0x119998[_0x1f78c4](util['format'](_0x8d44('0x1f'),_0x5eb0c5[_0x8d44('0x4')]));var _0x2b4391=[];switch(_0x5eb0c5[_0x8d44('0x7')]){case _0x8d44('0x2c'):_0x119998[_0x1f78c4](_0x8d44('0x2d'));_0x119998[_0x1f78c4](_0x8d44('0x2e'));if(queryQueues['hasOwnProperty'](_0x8d44('0x2f'))){delete queryQueues['include'];}_0x2b4391['push'](db['VoiceQueue']['findAll'](queryQueues));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x31')][_0x8d44('0x13')](queryQueues));_0x2b4391[_0x8d44('0x30')](db['FaxQueue'][_0x8d44('0x13')](queryQueues));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x32')][_0x8d44('0x13')](queryQueues));_0x2b4391['push'](db[_0x8d44('0x33')][_0x8d44('0x13')](queryQueues));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x34')][_0x8d44('0x13')](queryQueues));_0x2b4391[_0x8d44('0x30')](db['WhatsappQueue'][_0x8d44('0x13')](queryQueues));_0x2b4391['push'](db[_0x8d44('0x6')][_0x8d44('0x13')](queryTelephones));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x35')][_0x8d44('0x13')](queryTrunks));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x1b')][_0x8d44('0x13')](queryCampaigns));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x6')][_0x8d44('0x13')](queryAgents));break;case _0x8d44('0x36'):_0x119998[_0x1f78c4](_0x8d44('0x2d'));_0x119998[_0x1f78c4](_0x8d44('0x2e'));_0x2b4391['push'](getAssociatedResources('VoiceQueues',_0x5eb0c5[_0x8d44('0x22')],'VoiceQueue'));_0x2b4391[_0x8d44('0x30')](getAssociatedResources(_0x8d44('0xe'),_0x5eb0c5[_0x8d44('0x22')],_0x8d44('0x31')));_0x2b4391[_0x8d44('0x30')](getAssociatedResources(_0x8d44('0xf'),_0x5eb0c5[_0x8d44('0x22')],_0x8d44('0x37')));_0x2b4391[_0x8d44('0x30')](getAssociatedResources(_0x8d44('0x10'),_0x5eb0c5['userProfileId'],_0x8d44('0x32')));_0x2b4391[_0x8d44('0x30')](getAssociatedResources('MailQueues',_0x5eb0c5['userProfileId'],_0x8d44('0x33')));_0x2b4391[_0x8d44('0x30')](getAssociatedResources('OpenchannelQueues',_0x5eb0c5[_0x8d44('0x22')],_0x8d44('0x34')));_0x2b4391[_0x8d44('0x30')](getAssociatedResources(_0x8d44('0x12'),_0x5eb0c5['userProfileId'],'WhatsappQueue'));_0x2b4391['push'](getAssociatedResources(_0x8d44('0x14'),_0x5eb0c5['userProfileId'],_0x8d44('0x6')));_0x2b4391['push'](getAssociatedResources(_0x8d44('0x15'),_0x5eb0c5[_0x8d44('0x22')],_0x8d44('0x35')));_0x2b4391[_0x8d44('0x30')](getAssociatedResources(_0x8d44('0x16'),_0x5eb0c5[_0x8d44('0x22')],'Campaign'));_0x2b4391[_0x8d44('0x30')](db[_0x8d44('0x6')][_0x8d44('0x13')](queryAgents));break;case _0x8d44('0x8'):_0x119998[_0x1f78c4](_0x8d44('0x2d'));_0x119998[_0x1f78c4](_0x8d44('0x2e'));_0x2b4391[_0x8d44('0x30')](_0x5eb0c5[_0x8d44('0x38')]({'attributes':['id',_0x8d44('0x4')]}));_0x2b4391[_0x8d44('0x30')](_0x5eb0c5['getChatQueues']({'attributes':['id',_0x8d44('0x4')]}));_0x2b4391[_0x8d44('0x30')](_0x5eb0c5['getFaxQueues']({'attributes':['id','name']}));_0x2b4391[_0x8d44('0x30')](_0x5eb0c5[_0x8d44('0x39')]({'attributes':['id',_0x8d44('0x4')]}));_0x2b4391[_0x8d44('0x30')](_0x5eb0c5['getMailQueues']({'attributes':['id',_0x8d44('0x4')]}));_0x2b4391['push'](_0x5eb0c5[_0x8d44('0x3a')]({'attributes':['id',_0x8d44('0x4')]}));_0x2b4391[_0x8d44('0x30')](_0x5eb0c5[_0x8d44('0x3b')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x2b4391);}})[_0x8d44('0xc')](function(_0x28dac1){if(_0x28dac1&&_0x28dac1[_0x8d44('0x1e')]){for(var _0x45a83d=0x0;_0x45a83d<_0x28dac1[_0x8d44('0x1e')];_0x45a83d+=0x1){for(var _0x181044=0x0;_0x181044<_0x28dac1[_0x45a83d][_0x8d44('0x1e')];_0x181044+=0x1){switch(_0x45a83d){case 0x0:joinOrLeaveQueues(_0x119998,_0x1f78c4,_0x8d44('0x3c'),_0x28dac1[_0x45a83d][_0x181044]);break;case 0x1:joinOrLeaveQueues(_0x119998,_0x1f78c4,'chat',_0x28dac1[_0x45a83d][_0x181044]);break;case 0x2:joinOrLeaveQueues(_0x119998,_0x1f78c4,'fax',_0x28dac1[_0x45a83d][_0x181044]);break;case 0x3:joinOrLeaveQueues(_0x119998,_0x1f78c4,_0x8d44('0x3d'),_0x28dac1[_0x45a83d][_0x181044]);break;case 0x4:joinOrLeaveQueues(_0x119998,_0x1f78c4,_0x8d44('0x3e'),_0x28dac1[_0x45a83d][_0x181044]);break;case 0x5:joinOrLeaveQueues(_0x119998,_0x1f78c4,_0x8d44('0x3f'),_0x28dac1[_0x45a83d][_0x181044]);break;case 0x6:joinOrLeaveQueues(_0x119998,_0x1f78c4,'whatsapp',_0x28dac1[_0x45a83d][_0x181044]);break;case 0x7:if(_0x45251a[_0x8d44('0x7')]!==_0x8d44('0x8'))_0x119998[_0x1f78c4](util[_0x8d44('0x1c')](_0x8d44('0x40'),_0x28dac1[_0x45a83d][_0x181044][_0x8d44('0x4')]));break;case 0x8:if(_0x45251a[_0x8d44('0x7')]!=='agent')_0x119998[_0x1f78c4](util['format'](_0x8d44('0x41'),_0x28dac1[_0x45a83d][_0x181044][_0x8d44('0x4')]));break;case 0x9:if(_0x45251a['role']!==_0x8d44('0x8'))_0x119998[_0x1f78c4](util[_0x8d44('0x1c')]('campaign:%s:%s',_0x28dac1[_0x45a83d][_0x181044][_0x8d44('0xa')],_0x28dac1[_0x45a83d][_0x181044]['name']));break;case 0xa:_0x119998[_0x1f78c4](util[_0x8d44('0x1c')](_0x8d44('0x1f'),_0x28dac1[_0x45a83d][_0x181044][_0x8d44('0x4')]));break;}}}}})[_0x8d44('0xc')](function(){if(_0x1f78c4==='leave'){var _0x2031b3=_[_0x8d44('0x19')](_0x45251a[_0x8d44('0x24')],'id');return _0x45251a[_0x8d44('0x42')](_0x2031b3)[_0x8d44('0xc')](function(){for(var _0xac206b=0x0;_0xac206b<_0x2031b3[_0x8d44('0x1e')];_0xac206b+=0x1){_0x4b5eb8[_0x8d44('0x43')](_0x8d44('0x44'),{'ChatInteractionId':Number(_0x2031b3[_0xac206b]),'UserId':Number(_0x45251a['id'])});}});}})[_0x8d44('0xc')](function(){if(_0x1f78c4===_0x8d44('0x45')){var _0xb860f7=_[_0x8d44('0x19')](_0x45251a[_0x8d44('0x46')],'id');return _0x45251a['removeMailInteractions'](_0xb860f7)['then'](function(){for(var _0x1a031f=0x0;_0x1a031f<_0xb860f7[_0x8d44('0x1e')];_0x1a031f+=0x1){_0x4b5eb8[_0x8d44('0x43')](_0x8d44('0x47'),{'MailInteractionId':Number(_0xb860f7[_0x1a031f]),'UserId':Number(_0x45251a['id'])});}});}})[_0x8d44('0xc')](function(){if(_0x1f78c4===_0x8d44('0x45')){var _0x5aed5=_[_0x8d44('0x19')](_0x45251a[_0x8d44('0x26')],'id');return _0x45251a[_0x8d44('0x48')](_0x5aed5)['then'](function(){for(var _0x3e4ff0=0x0;_0x3e4ff0<_0x5aed5[_0x8d44('0x1e')];_0x3e4ff0+=0x1){_0x4b5eb8[_0x8d44('0x43')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5aed5[_0x3e4ff0]),'UserId':Number(_0x45251a['id'])});}});}})[_0x8d44('0xc')](function(){if(_0x1f78c4===_0x8d44('0x45')){var _0x4a7cb3=_['map'](_0x45251a[_0x8d44('0x28')],'id');return _0x45251a[_0x8d44('0x49')](_0x4a7cb3)['then'](function(){for(var _0x647962=0x0;_0x647962<_0x4a7cb3[_0x8d44('0x1e')];_0x647962+=0x1){_0x4b5eb8[_0x8d44('0x43')](_0x8d44('0x4a'),{'SmsInteractionId':Number(_0x4a7cb3[_0x647962]),'UserId':Number(_0x45251a['id'])});}});}})[_0x8d44('0xc')](function(){if(_0x1f78c4===_0x8d44('0x45')){var _0x2774fc=_['map'](_0x45251a[_0x8d44('0x2a')],'id');return _0x45251a[_0x8d44('0x4b')](_0x2774fc)['then'](function(){for(var _0x2588d8=0x0;_0x2588d8<_0x2774fc['length'];_0x2588d8+=0x1){_0x4b5eb8[_0x8d44('0x43')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2774fc[_0x2588d8]),'UserId':Number(_0x45251a['id'])});}});}})[_0x8d44('0xc')](function(){if(_0x1f78c4===_0x8d44('0x45')){var _0x4449e8=_[_0x8d44('0x19')](_0x45251a[_0x8d44('0x4c')],'id');return _0x45251a[_0x8d44('0x4d')](_0x4449e8)[_0x8d44('0xc')](function(){for(var _0x41bf55=0x0;_0x41bf55<_0x4449e8[_0x8d44('0x1e')];_0x41bf55+=0x1){_0x4b5eb8[_0x8d44('0x43')](_0x8d44('0x4e'),{'WhatsappInteractionId':Number(_0x4449e8[_0x41bf55]),'UserId':Number(_0x45251a['id'])});}});}})[_0x8d44('0x4f')](function(_0x34e4b2){_0x119998[_0x8d44('0x50')](_0x34e4b2);});}}function onDisconnect(_0x36e583,_0x32f879){joinOrLeave(_0x36e583,_0x8d44('0x45'),_0x32f879);}function onConnect(_0x5093f0){joinOrLeave(_0x5093f0,_0x8d44('0x51'));}exports[_0x8d44('0x52')]=function(_0x593eb3){_0x593eb3['on'](_0x8d44('0x53'),function(_0x1b26be){_0x1b26be['setMaxListeners'](0x0);_0x1b26be[_0x8d44('0x54')]=_0x1b26be[_0x8d44('0x55')][_0x8d44('0x53')][_0x8d44('0x56')]+':'+_0x1b26be[_0x8d44('0x55')]['connection']['remotePort'];_0x1b26be[_0x8d44('0x57')]=new Date();_0x1b26be[_0x8d44('0x50')]=function(_0x81fc0b){console[_0x8d44('0x50')](_0x8d44('0x58')+_0x1b26be[_0x8d44('0x59')][_0x8d44('0x4')]+'['+_0x1b26be[_0x8d44('0x54')]+']',_0x81fc0b);};_0x1b26be['on'](_0x8d44('0x5a'),function(){onDisconnect(_0x1b26be,_0x593eb3);_0x1b26be[_0x8d44('0x50')](_0x8d44('0x5b'));});onConnect(_0x1b26be);_0x1b26be[_0x8d44('0x50')](_0x8d44('0x5c'));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd7e=['Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','get','channel','motionChannel','event','direction','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','contact','UserId','undefined','interface','SIP/%s','name','agent','incomingmessage','catch','offlineMessage','resolve','SELECT','format','AfterCreate','changed','closed','substatus','AfterUpdate','User','fullname','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','newmessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction'];(function(_0x5d5d25,_0x3b8c9d){var _0x4b25ca=function(_0x5ea089){while(--_0x5ea089){_0x5d5d25['push'](_0x5d5d25['shift']());}};_0x4b25ca(++_0x3b8c9d);}(_0xbd7e,0x7e));var _0xebd7=function(_0x1da778,_0x39d34c){_0x1da778=_0x1da778-0x0;var _0x87ed15=_0xbd7e[_0x1da778];return _0x87ed15;};'use strict';var util=require(_0xebd7('0x0'));var db=require(_0xebd7('0x1'))['db'];var jayson=require(_0xebd7('0x2'));var logger=require('../logger')(_0xebd7('0x3'));var client=jayson[_0xebd7('0x4')][_0xebd7('0x5')]({'port':0x232a});var triggers=[{'channel':_0xebd7('0x6'),'model':_0xebd7('0x7'),'event':_0xebd7('0x8'),'condition':_0xebd7('0x9'),'callback':afterCreate},{'channel':_0xebd7('0x6'),'model':'ChatInteraction','event':_0xebd7('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xebd7('0x6'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xebd7('0x6'),'model':'ChatOfflineMessage','event':_0xebd7('0x8'),'condition':_0xebd7('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xebd7('0xc'),'model':_0xebd7('0xd'),'event':_0xebd7('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0xebd7('0xd'),'event':_0xebd7('0xa'),'condition':_0xebd7('0xe'),'callback':afterUpdate},{'channel':_0xebd7('0xc'),'model':_0xebd7('0xf'),'event':'afterCreate','condition':_0xebd7('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xebd7('0x8'),'condition':_0xebd7('0x9'),'callback':afterCreate},{'channel':_0xebd7('0x10'),'model':_0xebd7('0x11'),'event':_0xebd7('0xa'),'condition':_0xebd7('0xe'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xebd7('0x12'),'event':_0xebd7('0x8'),'condition':_0xebd7('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xebd7('0x13'),'event':_0xebd7('0x8'),'condition':_0xebd7('0x9'),'callback':afterCreate},{'channel':_0xebd7('0x14'),'model':'FaxInteraction','event':_0xebd7('0xa'),'condition':_0xebd7('0xe'),'callback':afterUpdate},{'channel':_0xebd7('0x14'),'model':_0xebd7('0x15'),'event':_0xebd7('0x8'),'condition':_0xebd7('0xb'),'callback':afterCreateMessage},{'channel':_0xebd7('0x16'),'model':'MailInteraction','event':_0xebd7('0x8'),'condition':_0xebd7('0x9'),'callback':afterCreate},{'channel':_0xebd7('0x16'),'model':_0xebd7('0x17'),'event':'afterUpdate','condition':_0xebd7('0xe'),'callback':afterUpdate},{'channel':'Mail','model':_0xebd7('0x18'),'event':_0xebd7('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0xebd7('0x19'),'event':_0xebd7('0x8'),'condition':_0xebd7('0x9'),'callback':afterCreate},{'channel':'Openchannel','model':_0xebd7('0x19'),'event':_0xebd7('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xebd7('0x1a'),'model':_0xebd7('0x1b'),'event':_0xebd7('0x8'),'condition':_0xebd7('0xb'),'callback':afterCreateMessage}];function request(_0xdf15f2){return client[_0xebd7('0x1c')](_0xebd7('0x1d'),_0xdf15f2)[_0xebd7('0x1e')](function(_0x3e5a91){logger['info'](_0xebd7('0x1f'),_0xebd7('0x1d'),_0x3e5a91);if(_0x3e5a91[_0xebd7('0x20')]){if(_0x3e5a91[_0xebd7('0x20')][_0xebd7('0x21')]===0x1f4){logger[_0xebd7('0x20')](_0xebd7('0x1f'),'EventManager',_0x3e5a91[_0xebd7('0x20')]);}}})['catch'](function(_0x974fc1){logger[_0xebd7('0x20')](_0xebd7('0x1f'),'EventManager',_0x974fc1);});}function afterCreateMessage(_0x2bb920){return function(_0xb618a9){_0xb618a9=_0xb618a9[_0xebd7('0x22')]({'plain':!![]});_0xb618a9[_0xebd7('0x23')]=_0x2bb920;_0xb618a9[_0xebd7('0x24')]=_0x2bb920;_0xb618a9[_0xebd7('0x25')]=_0xb618a9[_0xebd7('0x26')];Promise['resolve']()[_0xebd7('0x1e')](function(){if(typeof _0xb618a9[_0xebd7('0x27')]==='undefined')return null;var _0x44326e=_0xebd7('0x28')+_0xb618a9[_0xebd7('0x27')];return db[_0xebd7('0x29')][_0xebd7('0x2a')](_0x44326e,{'type':db[_0xebd7('0x2b')][_0xebd7('0x2c')]['SELECT'],'raw':!![]});})[_0xebd7('0x1e')](function(_0xede9a9){if(_0xede9a9){_0xb618a9[_0xebd7('0x2d')]=_0xede9a9[0x0];}if(typeof _0xb618a9[_0xebd7('0x2e')]===_0xebd7('0x2f'))return;return getAgent(_0xb618a9['UserId']);})[_0xebd7('0x1e')](function(_0x32723f){if(_0x32723f){_0xb618a9[_0xebd7('0x30')]=util['format'](_0xebd7('0x31'),_0x32723f[_0xebd7('0x32')]);_0xb618a9[_0xebd7('0x33')]=_0x32723f;_0xb618a9['channel']=_0x2bb920;return request({'event':_0xebd7('0x34'),'message':_0xb618a9});}else{return request({'event':'outgoingmessage','message':_0xb618a9});}})[_0xebd7('0x35')](function(_0x200578){logger[_0xebd7('0x20')](_0xebd7('0x1f'),'AfterCreateMessage',_0x200578);});};}function afterCreateOfflineMessage(_0x5dfda9){return function(_0x47db0c){_0x47db0c=_0x47db0c[_0xebd7('0x22')]({'plain':!![]});_0x47db0c[_0xebd7('0x23')]=_0x5dfda9;_0x47db0c[_0xebd7('0x24')]=_0x5dfda9;_0x47db0c[_0xebd7('0x25')]=_0xebd7('0x36');return request({'event':_0x47db0c[_0xebd7('0x25')],'message':_0x47db0c});};}function afterCreate(_0x200c91,_0x5a37b5){return function(_0xff32f){_0xff32f=_0xff32f[_0xebd7('0x22')]({'plain':!![]});_0xff32f[_0xebd7('0x23')]=_0x200c91;_0xff32f['motionChannel']=_0x200c91;_0xff32f[_0xebd7('0x25')]='opened';Promise[_0xebd7('0x37')]()[_0xebd7('0x1e')](function(){var _0x1ce699='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xff32f['ContactId'];return db[_0xebd7('0x29')]['query'](_0x1ce699,{'type':db['Sequelize']['QueryTypes'][_0xebd7('0x38')],'raw':!![]});})['then'](function(_0x2b0630){if(_0x2b0630){_0xff32f['contact']=_0x2b0630[0x0];}if(typeof _0xff32f[_0xebd7('0x2e')]===_0xebd7('0x2f'))return;return getAgent(_0xff32f[_0xebd7('0x2e')]);})['then'](function(_0x444d90){if(_0x444d90){_0xff32f['interface']=util[_0xebd7('0x39')](_0xebd7('0x31'),_0x444d90[_0xebd7('0x32')]);_0xff32f[_0xebd7('0x33')]=_0x444d90;}return request({'event':_0x5a37b5,'message':_0xff32f});})['catch'](function(_0x17b258){logger[_0xebd7('0x20')](_0xebd7('0x1f'),_0xebd7('0x3a'),_0x17b258);});};}function afterUpdate(_0x485c6f){return function(_0x3df267){var _0x146058=_0x3df267[_0xebd7('0x3b')](_0xebd7('0x3c'))&&_0x3df267[_0xebd7('0x3c')];var _0x3886d4=_0x3df267[_0xebd7('0x3b')]('substatus');if(_0x146058||_0x3886d4){var _0x1f4539=_0x146058?_0xebd7('0xe'):_0xebd7('0x3d');var _0x49eb9c=_0x3df267[_0xebd7('0x22')]({'plain':!![]});_0x49eb9c[_0xebd7('0x23')]=_0x485c6f;_0x49eb9c[_0xebd7('0x24')]=_0x485c6f;_0x49eb9c[_0xebd7('0x25')]=_0x146058?_0xebd7('0x3c'):_0xebd7('0x3d');var _0x44eab3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49eb9c[_0xebd7('0x27')];return db['sequelize'][_0xebd7('0x2a')](_0x44eab3,{'type':db[_0xebd7('0x2b')][_0xebd7('0x2c')][_0xebd7('0x38')],'raw':!![]})[_0xebd7('0x1e')](function(_0x18cbb0){if(_0x18cbb0){_0x49eb9c[_0xebd7('0x2d')]=_0x18cbb0[0x0];}if(typeof _0x49eb9c['UserId']===_0xebd7('0x2f'))return;return getAgent(_0x49eb9c['UserId']);})[_0xebd7('0x1e')](function(_0xb6bb98){if(_0xb6bb98){_0x49eb9c[_0xebd7('0x30')]=util[_0xebd7('0x39')](_0xebd7('0x31'),_0xb6bb98[_0xebd7('0x32')]);_0x49eb9c['agent']=_0xb6bb98;}return request({'event':_0x1f4539,'message':_0x49eb9c});})[_0xebd7('0x35')](function(_0x7960bf){logger[_0xebd7('0x20')](_0xebd7('0x1f'),_0xebd7('0x3e'),_0x7960bf);});}};}function getAgent(_0x3b1593){return db[_0xebd7('0x3f')]['find']({'where':{'id':_0x3b1593},'attributes':['id',_0xebd7('0x32'),_0xebd7('0x40'),'email',_0xebd7('0x41')],'raw':!![]})[_0xebd7('0x1e')](function(_0x2994f3){return _0x2994f3;});}exports[_0xebd7('0x42')]=function(){for(var _0x3abe4f=0x0;_0x3abe4f<triggers[_0xebd7('0x43')];_0x3abe4f+=0x1){if(db[_0xebd7('0x44')](triggers[_0x3abe4f][_0xebd7('0x45')])){db[triggers[_0x3abe4f]['model']][_0xebd7('0x46')](triggers[_0x3abe4f][_0xebd7('0x25')],triggers[_0x3abe4f][_0xebd7('0x47')](triggers[_0x3abe4f]['channel'][_0xebd7('0x48')](),triggers[_0x3abe4f]['condition']));}}};
\ No newline at end of file
+var _0xea8f=['contact','UserId','interface','format','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','opened','sequelize','Sequelize','AfterCreate','closed','changed','substatus','SIP/%s','AfterUpdate','fullname','email','internal','default','model','hook','callback','toLowerCase','condition','util','../logger','triggers','client','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','newinteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','QueryTypes','SELECT'];(function(_0x1e30e9,_0x344310){var _0x491aee=function(_0x42f2e7){while(--_0x42f2e7){_0x1e30e9['push'](_0x1e30e9['shift']());}};_0x491aee(++_0x344310);}(_0xea8f,0x13f));var _0xfea8=function(_0x77a9be,_0x196b26){_0x77a9be=_0x77a9be-0x0;var _0x227721=_0xea8f[_0x77a9be];return _0x227721;};'use strict';var util=require(_0xfea8('0x0'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0xfea8('0x1'))(_0xfea8('0x2'));var client=jayson[_0xfea8('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0xfea8('0x4'),'model':_0xfea8('0x5'),'event':_0xfea8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0xfea8('0x7'),'condition':_0xfea8('0x8'),'callback':afterUpdate},{'channel':_0xfea8('0x4'),'model':_0xfea8('0x9'),'event':_0xfea8('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':_0xfea8('0x6'),'condition':_0xfea8('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xfea8('0xb'),'model':_0xfea8('0xc'),'event':_0xfea8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xfea8('0xb'),'model':_0xfea8('0xc'),'event':_0xfea8('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xfea8('0xb'),'model':_0xfea8('0xd'),'event':_0xfea8('0x6'),'condition':_0xfea8('0xa'),'callback':afterCreateMessage},{'channel':_0xfea8('0xe'),'model':_0xfea8('0xf'),'event':_0xfea8('0x6'),'condition':_0xfea8('0x10'),'callback':afterCreate},{'channel':_0xfea8('0xe'),'model':'WhatsappInteraction','event':_0xfea8('0x7'),'condition':_0xfea8('0x8'),'callback':afterUpdate},{'channel':_0xfea8('0xe'),'model':_0xfea8('0x11'),'event':_0xfea8('0x6'),'condition':_0xfea8('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xfea8('0x12'),'event':_0xfea8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xfea8('0x13'),'model':_0xfea8('0x12'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xfea8('0x13'),'model':_0xfea8('0x14'),'event':_0xfea8('0x6'),'condition':_0xfea8('0xa'),'callback':afterCreateMessage},{'channel':_0xfea8('0x15'),'model':_0xfea8('0x16'),'event':_0xfea8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xfea8('0x15'),'model':_0xfea8('0x16'),'event':_0xfea8('0x7'),'condition':_0xfea8('0x8'),'callback':afterUpdate},{'channel':_0xfea8('0x15'),'model':_0xfea8('0x17'),'event':_0xfea8('0x6'),'condition':_0xfea8('0xa'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xfea8('0x18'),'event':_0xfea8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xfea8('0x19'),'model':'OpenchannelInteraction','event':_0xfea8('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xfea8('0x1a'),'event':_0xfea8('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x253f9e){return client[_0xfea8('0x1b')](_0xfea8('0x1c'),_0x253f9e)['then'](function(_0xb1c8e7){logger[_0xfea8('0x1d')](_0xfea8('0x1e'),_0xfea8('0x1c'),_0xb1c8e7);if(_0xb1c8e7[_0xfea8('0x1f')]){if(_0xb1c8e7[_0xfea8('0x1f')][_0xfea8('0x20')]===0x1f4){logger[_0xfea8('0x1f')](_0xfea8('0x1e'),_0xfea8('0x1c'),_0xb1c8e7[_0xfea8('0x1f')]);}}})[_0xfea8('0x21')](function(_0x5b24df){logger['error'](_0xfea8('0x1e'),_0xfea8('0x1c'),_0x5b24df);});}function afterCreateMessage(_0x11bb53){return function(_0x32bdc9){_0x32bdc9=_0x32bdc9[_0xfea8('0x22')]({'plain':!![]});_0x32bdc9[_0xfea8('0x23')]=_0x11bb53;_0x32bdc9[_0xfea8('0x24')]=_0x11bb53;_0x32bdc9[_0xfea8('0x25')]=_0x32bdc9['direction'];Promise[_0xfea8('0x26')]()[_0xfea8('0x27')](function(){if(typeof _0x32bdc9[_0xfea8('0x28')]===_0xfea8('0x29'))return null;var _0xda4624=_0xfea8('0x2a')+_0x32bdc9['ContactId'];return db['sequelize'][_0xfea8('0x2b')](_0xda4624,{'type':db['Sequelize'][_0xfea8('0x2c')][_0xfea8('0x2d')],'raw':!![]});})[_0xfea8('0x27')](function(_0x595bf1){if(_0x595bf1){_0x32bdc9[_0xfea8('0x2e')]=_0x595bf1[0x0];}if(typeof _0x32bdc9[_0xfea8('0x2f')]==='undefined')return;return getAgent(_0x32bdc9[_0xfea8('0x2f')]);})[_0xfea8('0x27')](function(_0x3aad92){if(_0x3aad92){_0x32bdc9[_0xfea8('0x30')]=util[_0xfea8('0x31')]('SIP/%s',_0x3aad92[_0xfea8('0x32')]);_0x32bdc9[_0xfea8('0x33')]=_0x3aad92;_0x32bdc9[_0xfea8('0x23')]=_0x11bb53;return request({'event':_0xfea8('0x34'),'message':_0x32bdc9});}else{return request({'event':_0xfea8('0x35'),'message':_0x32bdc9});}})[_0xfea8('0x21')](function(_0x2fa65b){logger[_0xfea8('0x1f')](_0xfea8('0x1e'),_0xfea8('0x36'),_0x2fa65b);});};}function afterCreateOfflineMessage(_0x2b6eb4){return function(_0x1143ed){_0x1143ed=_0x1143ed[_0xfea8('0x22')]({'plain':!![]});_0x1143ed['channel']=_0x2b6eb4;_0x1143ed['motionChannel']=_0x2b6eb4;_0x1143ed[_0xfea8('0x25')]='offlineMessage';return request({'event':_0x1143ed[_0xfea8('0x25')],'message':_0x1143ed});};}function afterCreate(_0x39a53e,_0x4a83af){return function(_0x2aeaab){_0x2aeaab=_0x2aeaab[_0xfea8('0x22')]({'plain':!![]});_0x2aeaab[_0xfea8('0x23')]=_0x39a53e;_0x2aeaab[_0xfea8('0x24')]=_0x39a53e;_0x2aeaab['event']=_0xfea8('0x37');Promise[_0xfea8('0x26')]()[_0xfea8('0x27')](function(){var _0x3bd03f=_0xfea8('0x2a')+_0x2aeaab[_0xfea8('0x28')];return db[_0xfea8('0x38')][_0xfea8('0x2b')](_0x3bd03f,{'type':db[_0xfea8('0x39')][_0xfea8('0x2c')][_0xfea8('0x2d')],'raw':!![]});})[_0xfea8('0x27')](function(_0x3bf317){if(_0x3bf317){_0x2aeaab[_0xfea8('0x2e')]=_0x3bf317[0x0];}if(typeof _0x2aeaab[_0xfea8('0x2f')]===_0xfea8('0x29'))return;return getAgent(_0x2aeaab[_0xfea8('0x2f')]);})[_0xfea8('0x27')](function(_0x565284){if(_0x565284){_0x2aeaab[_0xfea8('0x30')]=util[_0xfea8('0x31')]('SIP/%s',_0x565284[_0xfea8('0x32')]);_0x2aeaab[_0xfea8('0x33')]=_0x565284;}return request({'event':_0x4a83af,'message':_0x2aeaab});})[_0xfea8('0x21')](function(_0x1fe126){logger[_0xfea8('0x1f')](_0xfea8('0x1e'),_0xfea8('0x3a'),_0x1fe126);});};}function afterUpdate(_0x44b5f0){return function(_0xb9564e){var _0x4e8b64=_0xb9564e['changed'](_0xfea8('0x3b'))&&_0xb9564e['closed'];var _0x29424e=_0xb9564e[_0xfea8('0x3c')](_0xfea8('0x3d'));if(_0x4e8b64||_0x29424e){var _0x4d045f=_0x4e8b64?_0xfea8('0x8'):'substatus';var _0xdc035d=_0xb9564e[_0xfea8('0x22')]({'plain':!![]});_0xdc035d[_0xfea8('0x23')]=_0x44b5f0;_0xdc035d[_0xfea8('0x24')]=_0x44b5f0;_0xdc035d['event']=_0x4e8b64?_0xfea8('0x3b'):'substatus';var _0x20bf1d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xdc035d[_0xfea8('0x28')];return db[_0xfea8('0x38')]['query'](_0x20bf1d,{'type':db['Sequelize'][_0xfea8('0x2c')][_0xfea8('0x2d')],'raw':!![]})[_0xfea8('0x27')](function(_0x19f818){if(_0x19f818){_0xdc035d['contact']=_0x19f818[0x0];}if(typeof _0xdc035d[_0xfea8('0x2f')]===_0xfea8('0x29'))return;return getAgent(_0xdc035d[_0xfea8('0x2f')]);})[_0xfea8('0x27')](function(_0x2d334d){if(_0x2d334d){_0xdc035d['interface']=util[_0xfea8('0x31')](_0xfea8('0x3e'),_0x2d334d[_0xfea8('0x32')]);_0xdc035d[_0xfea8('0x33')]=_0x2d334d;}return request({'event':_0x4d045f,'message':_0xdc035d});})[_0xfea8('0x21')](function(_0x3699ea){logger[_0xfea8('0x1f')](_0xfea8('0x1e'),_0xfea8('0x3f'),_0x3699ea);});}};}function getAgent(_0x344c91){return db['User']['find']({'where':{'id':_0x344c91},'attributes':['id',_0xfea8('0x32'),_0xfea8('0x40'),_0xfea8('0x41'),_0xfea8('0x42')],'raw':!![]})[_0xfea8('0x27')](function(_0x46134a){return _0x46134a;});}exports[_0xfea8('0x43')]=function(){for(var _0xf85544=0x0;_0xf85544<triggers['length'];_0xf85544+=0x1){if(db['hasOwnProperty'](triggers[_0xf85544][_0xfea8('0x44')])){db[triggers[_0xf85544]['model']][_0xfea8('0x45')](triggers[_0xf85544][_0xfea8('0x25')],triggers[_0xf85544][_0xfea8('0x46')](triggers[_0xf85544][_0xfea8('0x23')][_0xfea8('0x47')](),triggers[_0xf85544][_0xfea8('0x48')]));}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32b0=['Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','sms','whatsapp','openchannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents'];(function(_0x2c4051,_0x170811){var _0x515009=function(_0x5a553f){while(--_0x5a553f){_0x2c4051['push'](_0x2c4051['shift']());}};_0x515009(++_0x170811);}(_0x32b0,0x155));var _0x032b=function(_0x27d68c,_0x400adb){_0x27d68c=_0x27d68c-0x0;var _0x4e6572=_0x32b0[_0x27d68c];return _0x4e6572;};'use strict';var _=require(_0x032b('0x0'));var BPromise=require(_0x032b('0x1'));var db=require(_0x032b('0x2'))['db'];var util=require(_0x032b('0x3'));var channels=[_0x032b('0x4'),'mail','chat','fax',_0x032b('0x5'),_0x032b('0x6'),_0x032b('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x188b0d){_0x188b0d=_0x188b0d[_0x032b('0x8')]();return _['includes'](channels,_0x188b0d);};exports[_0x032b('0x9')]=function(_0x41eb5e,_0xab1517,_0x1a0aa3,_0x302faa){var _0x598d84={'loginAttempts':_0xab1517,'blocked':_0x1a0aa3};if(!_[_0x032b('0xa')](_0x302faa)){_0x598d84[_0x032b('0xb')]=_0x302faa;}return _0x41eb5e[_0x032b('0xc')](_0x598d84);};exports[_0x032b('0xd')]=function(_0x4d9813){return new BPromise(function(_0x21d9ee,_0x7b0c28){var _0x17265f=0x0;if(_0x4d9813['role']!==_0x032b('0xe')){_0x21d9ee(_0x4d9813);}db[_0x032b('0xf')][_0x032b('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4d9813['id']}}})[_0x032b('0x11')](function(_0x3ca5cb){_0x17265f=_0x3ca5cb;return util['getLicense']();})['then'](function(_0x265e11){if(_0x265e11&&_0x265e11[_0x032b('0x12')]&&_0x17265f>=_0x265e11[_0x032b('0x12')]){throw Error(_0x032b('0x13'));}_0x21d9ee(_0x4d9813);})['catch'](function(_0x437bbc){_0x7b0c28(_0x437bbc);});});};
\ No newline at end of file
+var _0xa548=['toLowerCase','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','mail','chat','fax','whatsapp','openchannel','isValidChannel'];(function(_0x16b77e,_0x4a56a3){var _0x3ae284=function(_0x5d2481){while(--_0x5d2481){_0x16b77e['push'](_0x16b77e['shift']());}};_0x3ae284(++_0x4a56a3);}(_0xa548,0x139));var _0x8a54=function(_0x574207,_0x16d547){_0x574207=_0x574207-0x0;var _0x295dcd=_0xa548[_0x574207];return _0x295dcd;};'use strict';var _=require(_0x8a54('0x0'));var BPromise=require('bluebird');var db=require(_0x8a54('0x1'))['db'];var util=require(_0x8a54('0x2'));var channels=['voice',_0x8a54('0x3'),_0x8a54('0x4'),_0x8a54('0x5'),'sms',_0x8a54('0x6'),_0x8a54('0x7')];exports['getChannels']=function(){return channels;};exports[_0x8a54('0x8')]=function(_0x4a30dc){_0x4a30dc=_0x4a30dc[_0x8a54('0x9')]();return _[_0x8a54('0xa')](channels,_0x4a30dc);};exports['clearBlockUser']=function(_0x598f6b,_0x2dffcc,_0x231beb,_0x4943df){var _0xc85500={'loginAttempts':_0x2dffcc,'blocked':_0x231beb};if(!_[_0x8a54('0xb')](_0x4943df)){_0xc85500[_0x8a54('0xc')]=_0x4943df;}return _0x598f6b[_0x8a54('0xd')](_0xc85500);};exports[_0x8a54('0xe')]=function(_0x29697c){return new BPromise(function(_0x526c40,_0x4a1092){var _0x49b4d0=0x0;if(_0x29697c[_0x8a54('0xf')]!==_0x8a54('0x10')){_0x526c40(_0x29697c);}db[_0x8a54('0x11')][_0x8a54('0x12')]({'where':{'role':_0x8a54('0x10'),'online':!![],'id':{'$ne':_0x29697c['id']}}})[_0x8a54('0x13')](function(_0x4e34a1){_0x49b4d0=_0x4e34a1;return util[_0x8a54('0xe')]();})['then'](function(_0x4db56c){if(_0x4db56c&&_0x4db56c[_0x8a54('0x14')]&&_0x49b4d0>=_0x4db56c['agents']){throw Error(_0x8a54('0x15'));}_0x526c40(_0x29697c);})[_0x8a54('0x16')](function(_0x4a3a00){_0x4a1092(_0x4a3a00);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0x870e0d,_0x5f5572){var _0x28fd9a=function(_0x291dd9){while(--_0x291dd9){_0x870e0d['push'](_0x870e0d['shift']());}};_0x28fd9a(++_0x5f5572);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0xb100ef,_0x13e765){var _0x47d5dc=function(_0x22daa7){while(--_0x22daa7){_0xb100ef['push'](_0xb100ef['shift']());}};_0x47d5dc(++_0x13e765);}(_0xadb5,0xad));var _0x5adb=function(_0x3796d4,_0x346092){_0x3796d4=_0x3796d4-0x0;var _0x1d9c98=_0xadb5[_0x3796d4];return _0x1d9c98;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a41=['status','render','exports','404'];(function(_0x5095cc,_0x2b5d57){var _0x25bd2e=function(_0x5e39d2){while(--_0x5e39d2){_0x5095cc['push'](_0x5095cc['shift']());}};_0x25bd2e(++_0x2b5d57);}(_0x2a41,0x126));var _0x12a4=function(_0x9a2618,_0x7fd0c6){_0x9a2618=_0x9a2618-0x0;var _0x44d3a3=_0x2a41[_0x9a2618];return _0x44d3a3;};'use strict';module[_0x12a4('0x0')][0x194]=function pageNotFound(_0x4b1478,_0x2067f8){var _0x1bcc7a=_0x12a4('0x1');var _0x321075=0x194;var _0x1b4dd3={'status':_0x321075};_0x2067f8[_0x12a4('0x2')](_0x1b4dd3[_0x12a4('0x2')]);_0x2067f8[_0x12a4('0x3')](_0x1bcc7a,{},function(_0x3ae504,_0x501fcf){if(_0x3ae504){return _0x2067f8[_0x12a4('0x2')](_0x1b4dd3[_0x12a4('0x2')])['json'](_0x1b4dd3);}_0x2067f8['send'](_0x501fcf);});};
\ No newline at end of file
+var _0x18af=['render','exports','404','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18af,0x19d));var _0xf18a=function(_0x12de1d,_0x5416e3){_0x12de1d=_0x12de1d-0x0;var _0x3483f2=_0x18af[_0x12de1d];return _0x3483f2;};'use strict';module[_0xf18a('0x0')][0x194]=function pageNotFound(_0x57b97f,_0x1d327f){var _0x272d38=_0xf18a('0x1');var _0x4de6c4=0x194;var _0x4b13ec={'status':_0x4de6c4};_0x1d327f[_0xf18a('0x2')](_0x4b13ec[_0xf18a('0x2')]);_0x1d327f[_0xf18a('0x3')](_0x272d38,{},function(_0x4d7595,_0xa3c489){if(_0x4d7595){return _0x1d327f[_0xf18a('0x2')](_0x4b13ec[_0xf18a('0x2')])['json'](_0x4b13ec);}_0x1d327f['send'](_0xa3c489);});};
\ No newline at end of file
};
module.exports = {
- up: function(queryInterface, Sequelize ) {
+ up: function(queryInterface /*, Sequelize */) {
return new BPromise(function(resolve) {
var migration = new Migration(queryInterface);
// Add your migration code here
- migration.addColumn('settings', 'filterFullName', {
- type: Sequelize.BOOLEAN,
- defaultValue: false,
- })
+
// START FINAL
migration.final(resolve);
// END FINAL
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x544a=['./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','setupLoggers','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper_black'];(function(_0xdd430b,_0x25cf87){var _0x59d745=function(_0x3b5e98){while(--_0x3b5e98){_0xdd430b['push'](_0xdd430b['shift']());}};_0x59d745(++_0x25cf87);}(_0x544a,0xbd));var _0xa544=function(_0x2f494d,_0x121424){_0x2f494d=_0x2f494d-0x0;var _0x158ec4=_0x544a[_0x2f494d];return _0x158ec4;};'use strict';var path=require(_0xa544('0x0'));var express=require(_0xa544('0x1'));var errors=require(_0xa544('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xa544('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0xa544('0x4')]=function(_0xdca212){return setupLoggers(_0xdca212)['then'](function(){_0xdca212[_0xa544('0x5')](_0xa544('0x6'),require(_0xa544('0x7')));_0xdca212[_0xa544('0x5')](_0xa544('0x8'),require('./api/voiceChanSpy'));_0xdca212[_0xa544('0x5')]('/api/voice/contexts',require(_0xa544('0x9')));_0xdca212[_0xa544('0x5')]('/api/voice/extensions',require(_0xa544('0xa')));_0xdca212[_0xa544('0x5')](_0xa544('0xb'),require(_0xa544('0xc')));_0xdca212['use'](_0xa544('0xd'),require(_0xa544('0xe')));_0xdca212['use'](_0xa544('0xf'),require('./api/voiceRecording'));_0xdca212[_0xa544('0x5')](_0xa544('0x10'),require('./api/screenRecording'));_0xdca212[_0xa544('0x5')](_0xa544('0x11'),require(_0xa544('0x12')));_0xdca212[_0xa544('0x5')](_0xa544('0x13'),require(_0xa544('0x14')));_0xdca212[_0xa544('0x5')](_0xa544('0x15'),require(_0xa544('0x16')));_0xdca212[_0xa544('0x5')](_0xa544('0x17'),require(_0xa544('0x18')));_0xdca212['use'](_0xa544('0x19'),require(_0xa544('0x1a')));_0xdca212['use'](_0xa544('0x1b'),require(_0xa544('0x1c')));_0xdca212[_0xa544('0x5')](_0xa544('0x1d'),require(_0xa544('0x1e')));_0xdca212[_0xa544('0x5')](_0xa544('0x1f'),require(_0xa544('0x20')));_0xdca212[_0xa544('0x5')](_0xa544('0x21'),require('./api/voiceTransferReport'));_0xdca212['use'](_0xa544('0x22'),require(_0xa544('0x23')));_0xdca212[_0xa544('0x5')]('/api/mail/accounts',require(_0xa544('0x24')));_0xdca212[_0xa544('0x5')]('/api/mail/queues',require(_0xa544('0x25')));_0xdca212[_0xa544('0x5')](_0xa544('0x26'),require(_0xa544('0x27')));_0xdca212[_0xa544('0x5')]('/api/mail/interactions',require('./api/mailInteraction'));_0xdca212[_0xa544('0x5')]('/api/mail/messages',require(_0xa544('0x28')));_0xdca212[_0xa544('0x5')](_0xa544('0x29'),require(_0xa544('0x2a')));_0xdca212[_0xa544('0x5')](_0xa544('0x2b'),require(_0xa544('0x2c')));_0xdca212[_0xa544('0x5')](_0xa544('0x2d'),require('./api/dashboard'));_0xdca212[_0xa544('0x5')](_0xa544('0x2e'),require('./api/dashboardItem'));_0xdca212[_0xa544('0x5')](_0xa544('0x2f'),require(_0xa544('0x30')));_0xdca212['use'](_0xa544('0x31'),require(_0xa544('0x32')));_0xdca212[_0xa544('0x5')](_0xa544('0x33'),require('./api/faxInteraction'));_0xdca212[_0xa544('0x5')](_0xa544('0x34'),require(_0xa544('0x35')));_0xdca212['use'](_0xa544('0x36'),require(_0xa544('0x37')));_0xdca212['use']('/api/fax/reports/queue',require(_0xa544('0x38')));_0xdca212[_0xa544('0x5')](_0xa544('0x39'),require('./api/smsAccount'));_0xdca212[_0xa544('0x5')](_0xa544('0x3a'),require(_0xa544('0x3b')));_0xdca212['use'](_0xa544('0x3c'),require(_0xa544('0x3d')));_0xdca212['use'](_0xa544('0x3e'),require('./api/smsMessage'));_0xdca212[_0xa544('0x5')](_0xa544('0x3f'),require(_0xa544('0x40')));_0xdca212['use']('/api/openchannel/accounts',require(_0xa544('0x41')));_0xdca212[_0xa544('0x5')](_0xa544('0x42'),require('./api/openchannelApplication'));_0xdca212['use'](_0xa544('0x43'),require(_0xa544('0x44')));_0xdca212[_0xa544('0x5')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0xdca212[_0xa544('0x5')](_0xa544('0x45'),require(_0xa544('0x46')));_0xdca212[_0xa544('0x5')](_0xa544('0x47'),require(_0xa544('0x48')));_0xdca212[_0xa544('0x5')]('/api/openchannel/reports/queue',require(_0xa544('0x49')));_0xdca212[_0xa544('0x5')](_0xa544('0x4a'),require(_0xa544('0x4b')));_0xdca212['use'](_0xa544('0x4c'),require(_0xa544('0x4d')));_0xdca212[_0xa544('0x5')](_0xa544('0x4e'),require('./api/chatMessage'));_0xdca212[_0xa544('0x5')](_0xa544('0x4f'),require(_0xa544('0x50')));_0xdca212['use'](_0xa544('0x51'),require(_0xa544('0x52')));_0xdca212[_0xa544('0x5')](_0xa544('0x53'),require('./api/chatGroup'));_0xdca212['use'](_0xa544('0x54'),require(_0xa544('0x55')));_0xdca212['use'](_0xa544('0x56'),require(_0xa544('0x57')));_0xdca212[_0xa544('0x5')](_0xa544('0x58'),require('./api/cmContact'));_0xdca212[_0xa544('0x5')]('/api/cm/hopper',require('./api/cmHopper'));_0xdca212[_0xa544('0x5')](_0xa544('0x59'),require(_0xa544('0x5a')));_0xdca212[_0xa544('0x5')](_0xa544('0x5b'),require(_0xa544('0x5c')));_0xdca212[_0xa544('0x5')](_0xa544('0x5d'),require(_0xa544('0x5e')));_0xdca212[_0xa544('0x5')]('/api/cm/custom_fields',require(_0xa544('0x5f')));_0xdca212[_0xa544('0x5')]('/api/actions',require('./api/action'));_0xdca212[_0xa544('0x5')](_0xa544('0x60'),require('./api/automation'));_0xdca212[_0xa544('0x5')]('/api/canned_answers',require(_0xa544('0x61')));_0xdca212[_0xa544('0x5')](_0xa544('0x62'),require(_0xa544('0x63')));_0xdca212[_0xa544('0x5')](_0xa544('0x64'),require('./api/condition'));_0xdca212['use'](_0xa544('0x65'),require(_0xa544('0x66')));_0xdca212[_0xa544('0x5')]('/api/pauses',require('./api/pause'));_0xdca212[_0xa544('0x5')](_0xa544('0x67'),require(_0xa544('0x68')));_0xdca212[_0xa544('0x5')](_0xa544('0x69'),require(_0xa544('0x6a')));_0xdca212[_0xa544('0x5')](_0xa544('0x6b'),require(_0xa544('0x6c')));_0xdca212[_0xa544('0x5')]('/api/sounds',require(_0xa544('0x6d')));_0xdca212[_0xa544('0x5')](_0xa544('0x6e'),require(_0xa544('0x6f')));_0xdca212[_0xa544('0x5')](_0xa544('0x70'),require('./api/contactItemType'));_0xdca212['use'](_0xa544('0x71'),require(_0xa544('0x72')));_0xdca212[_0xa544('0x5')](_0xa544('0x73'),require(_0xa544('0x74')));_0xdca212[_0xa544('0x5')](_0xa544('0x75'),require('./api/template'));_0xdca212['use'](_0xa544('0x76'),require(_0xa544('0x77')));_0xdca212[_0xa544('0x5')](_0xa544('0x78'),require(_0xa544('0x79')));_0xdca212['use'](_0xa544('0x7a'),require(_0xa544('0x7b')));_0xdca212[_0xa544('0x5')](_0xa544('0x7c'),require('./api/integrationReport'));_0xdca212[_0xa544('0x5')](_0xa544('0x7d'),require(_0xa544('0x7e')));_0xdca212['use'](_0xa544('0x7f'),require(_0xa544('0x80')));_0xdca212[_0xa544('0x5')](_0xa544('0x81'),require(_0xa544('0x82')));_0xdca212[_0xa544('0x5')](_0xa544('0x83'),require('./api/analyticMetric'));_0xdca212[_0xa544('0x5')](_0xa544('0x84'),require(_0xa544('0x85')));_0xdca212[_0xa544('0x5')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0xdca212['use'](_0xa544('0x86'),require(_0xa544('0x87')));_0xdca212[_0xa544('0x5')](_0xa544('0x88'),require(_0xa544('0x89')));_0xdca212[_0xa544('0x5')](_0xa544('0x8a'),require(_0xa544('0x8b')));_0xdca212['use'](_0xa544('0x8c'),require(_0xa544('0x8d')));_0xdca212[_0xa544('0x5')](_0xa544('0x8e'),require(_0xa544('0x8f')));_0xdca212['use'](_0xa544('0x90'),require(_0xa544('0x91')));_0xdca212[_0xa544('0x5')]('/api/integrations/desk/accounts',require(_0xa544('0x92')));_0xdca212[_0xa544('0x5')](_0xa544('0x93'),require(_0xa544('0x94')));_0xdca212[_0xa544('0x5')](_0xa544('0x95'),require(_0xa544('0x96')));_0xdca212[_0xa544('0x5')](_0xa544('0x97'),require(_0xa544('0x98')));_0xdca212[_0xa544('0x5')](_0xa544('0x99'),require(_0xa544('0x9a')));_0xdca212['use'](_0xa544('0x9b'),require('./api/intZohoField'));_0xdca212[_0xa544('0x5')](_0xa544('0x9c'),require(_0xa544('0x9d')));_0xdca212[_0xa544('0x5')](_0xa544('0x9e'),require(_0xa544('0x9f')));_0xdca212['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0xdca212[_0xa544('0x5')](_0xa544('0xa0'),require(_0xa544('0xa1')));_0xdca212[_0xa544('0x5')](_0xa544('0xa2'),require(_0xa544('0xa3')));_0xdca212[_0xa544('0x5')]('/api/integrations/freshdesk/fields',require(_0xa544('0xa4')));_0xdca212[_0xa544('0x5')](_0xa544('0xa5'),require('./api/intVtigerAccount'));_0xdca212[_0xa544('0x5')](_0xa544('0xa6'),require(_0xa544('0xa7')));_0xdca212[_0xa544('0x5')](_0xa544('0xa8'),require(_0xa544('0xa9')));_0xdca212[_0xa544('0x5')]('/api/integrations/servicenow/accounts',require(_0xa544('0xaa')));_0xdca212[_0xa544('0x5')](_0xa544('0xab'),require('./api/intServicenowConfiguration'));_0xdca212[_0xa544('0x5')]('/api/integrations/servicenow/fields',require(_0xa544('0xac')));_0xdca212[_0xa544('0x5')]('/api/integrations/dynamics365/accounts',require(_0xa544('0xad')));_0xdca212[_0xa544('0x5')]('/api/integrations/dynamics365/configurations',require(_0xa544('0xae')));_0xdca212[_0xa544('0x5')](_0xa544('0xaf'),require(_0xa544('0xb0')));_0xdca212[_0xa544('0x5')](_0xa544('0xb1'),require(_0xa544('0xb2')));_0xdca212[_0xa544('0x5')](_0xa544('0xb3'),require('./api/intFreshsalesConfiguration'));_0xdca212[_0xa544('0x5')]('/api/integrations/freshsales/fields',require(_0xa544('0xb4')));_0xdca212[_0xa544('0x5')](_0xa544('0xb5'),require(_0xa544('0xb6')));_0xdca212['use'](_0xa544('0xb7'),require('./api/chatQueueReport'));_0xdca212[_0xa544('0x5')](_0xa544('0xb8'),require(_0xa544('0xb9')));_0xdca212['use'](_0xa544('0xba'),require(_0xa544('0xbb')));_0xdca212['use']('/api/jscripty/questions/reports',require(_0xa544('0xbc')));_0xdca212[_0xa544('0x5')](_0xa544('0xbd'),require(_0xa544('0xbe')));_0xdca212[_0xa544('0x5')]('/api/sms/reports/queue',require(_0xa544('0xbf')));_0xdca212['use'](_0xa544('0xc0'),require(_0xa544('0xc1')));_0xdca212['use'](_0xa544('0xc2'),require(_0xa544('0xc3')));_0xdca212[_0xa544('0x5')](_0xa544('0xc4'),require(_0xa544('0xc5')));_0xdca212['use'](_0xa544('0xc6'),require('./api/setting'));_0xdca212['use'](_0xa544('0xc7'),require(_0xa544('0xc8')));_0xdca212['use'](_0xa544('0xc9'),require(_0xa544('0xca')));_0xdca212[_0xa544('0x5')]('/api/square/recordings',require(_0xa544('0xcb')));_0xdca212[_0xa544('0x5')](_0xa544('0xcc'),require(_0xa544('0xcd')));_0xdca212[_0xa544('0x5')]('/api/teams',require('./api/team'));_0xdca212[_0xa544('0x5')](_0xa544('0xce'),require(_0xa544('0xcf')));_0xdca212[_0xa544('0x5')](_0xa544('0xd0'),require(_0xa544('0xd1')));_0xdca212['use']('/api/migrations',require(_0xa544('0xd2')));_0xdca212[_0xa544('0x5')](_0xa544('0xd3'),require(_0xa544('0xd4')));_0xdca212[_0xa544('0x5')](_0xa544('0xd5'),require(_0xa544('0xd6')));_0xdca212['use']('/api/mail/reports/transfer',require(_0xa544('0xd7')));_0xdca212[_0xa544('0x5')](_0xa544('0xd8'),require(_0xa544('0xd9')));_0xdca212[_0xa544('0x5')](_0xa544('0xda'),require(_0xa544('0xdb')));_0xdca212[_0xa544('0x5')](_0xa544('0xdc'),require(_0xa544('0xdd')));_0xdca212[_0xa544('0x5')](_0xa544('0xde'),require(_0xa544('0xdf')));_0xdca212[_0xa544('0x5')](_0xa544('0xe0'),require(_0xa544('0xe1')));_0xdca212[_0xa544('0x5')](_0xa544('0xe2'),require(_0xa544('0xe3')));_0xdca212[_0xa544('0x5')]('/api/userProfiles',require(_0xa544('0xe4')));_0xdca212['use'](_0xa544('0xe5'),require('./api/userProfileSection'));_0xdca212['use'](_0xa544('0xe6'),require(_0xa544('0xe7')));_0xdca212[_0xa544('0x5')]('/api/userNotifications',require(_0xa544('0xe8')));_0xdca212[_0xa544('0x5')](_0xa544('0xe9'),require('./api/whatsappAccount'));_0xdca212['use'](_0xa544('0xea'),require('./api/whatsappApplication'));_0xdca212[_0xa544('0x5')](_0xa544('0xeb'),require('./api/whatsappInteraction'));_0xdca212['use'](_0xa544('0xec'),require(_0xa544('0xed')));_0xdca212['use'](_0xa544('0xee'),require(_0xa544('0xef')));_0xdca212[_0xa544('0x5')](_0xa544('0xf0'),require('./api/whatsappTransferReport'));_0xdca212[_0xa544('0x5')](_0xa544('0xf1'),require('./api/whatsappQueue'));_0xdca212[_0xa544('0x5')](_0xa544('0xf2'),require('./api/cloudProvider'));_0xdca212[_0xa544('0x5')](_0xa544('0xf3'),require(_0xa544('0xf4')));_0xdca212[_0xa544('0x5')](_0xa544('0xf5'),require(_0xa544('0xf6')));_0xdca212['use'](_0xa544('0xf7'),require('./api/authLocal'));_0xdca212[_0xa544('0x5')](_0xa544('0xf8'),require(_0xa544('0xf9')));_0xdca212[_0xa544('0x5')](_0xa544('0xfa'),require(_0xa544('0xfb')));_0xdca212[_0xa544('0x5')](_0xa544('0xfc'),require(_0xa544('0xfd')));_0xdca212['use'](_0xa544('0xfe'),require(_0xa544('0xff')));_0xdca212[_0xa544('0x5')]('/api/version',require(_0xa544('0x100')));_0xdca212['use'](_0xa544('0x101'),require('./api/system'));_0xdca212[_0xa544('0x5')](_0xa544('0x102'),require(_0xa544('0x103')));_0xdca212[_0xa544('0x5')](_0xa544('0x104'),require(_0xa544('0x105')));_0xdca212[_0xa544('0x5')](_0xa544('0x106'),clientSideLogs);_0xdca212[_0xa544('0x5')](_0xa544('0x107'),express[_0xa544('0x108')](path['join'](config[_0xa544('0x109')],'/apidoc')));_0xdca212[_0xa544('0x5')](_0xa544('0x10a'),express[_0xa544('0x108')](path[_0xa544('0x10b')](config[_0xa544('0x109')],_0xa544('0x10a'))));_0xdca212['use'](_0xa544('0x10c'),express[_0xa544('0x108')](path['join'](config[_0xa544('0x109')],_0xa544('0x10c'))));_0xdca212[_0xa544('0x5')]('/snippet',express[_0xa544('0x108')](path[_0xa544('0x10b')](config[_0xa544('0x109')],_0xa544('0x10d'),_0xa544('0x10e'))));_0xdca212[_0xa544('0x5')](_0xa544('0x10f'),express[_0xa544('0x108')](path[_0xa544('0x10b')](config['root'],_0xa544('0x110'))));_0xdca212[_0xa544('0x111')](_0xa544('0x112'))[_0xa544('0x113')](errors[0x194]);_0xdca212['route']('/*')[_0xa544('0x113')](function(_0x5c380a,_0x3eb91a){_0x3eb91a['sendFile'](path[_0xa544('0x114')](_0xdca212['get'](_0xa544('0x115'))+_0xa544('0x116')));});return _0xdca212;});};
\ No newline at end of file
+var _0xcdd2=['./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.8.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','default','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages'];(function(_0x3259e8,_0x42c539){var _0x462ee9=function(_0x35ac47){while(--_0x35ac47){_0x3259e8['push'](_0x3259e8['shift']());}};_0x462ee9(++_0x42c539);}(_0xcdd2,0x1eb));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var express=require(_0x2cdd('0x0'));var errors=require(_0x2cdd('0x1'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x2cdd('0x2')]=function(_0x18739b){return setupLoggers(_0x18739b)[_0x2cdd('0x3')](function(){_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x5'),require('./api/user'));_0x18739b['use'](_0x2cdd('0x6'),require(_0x2cdd('0x7')));_0x18739b[_0x2cdd('0x4')]('/api/voice/contexts',require(_0x2cdd('0x8')));_0x18739b['use'](_0x2cdd('0x9'),require(_0x2cdd('0xa')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xb'),require(_0x2cdd('0xc')));_0x18739b[_0x2cdd('0x4')]('/api/voice/queues',require(_0x2cdd('0xd')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xe'),require(_0x2cdd('0xf')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x10'),require(_0x2cdd('0x11')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x12'),require('./api/voiceMail'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x13'),require(_0x2cdd('0x14')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x15'),require(_0x2cdd('0x16')));_0x18739b['use']('/api/voice/dials/reports',require(_0x2cdd('0x17')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x18'),require(_0x2cdd('0x19')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x1a'),require(_0x2cdd('0x1b')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x1c'),require(_0x2cdd('0x1d')));_0x18739b['use'](_0x2cdd('0x1e'),require(_0x2cdd('0x1f')));_0x18739b['use'](_0x2cdd('0x20'),require(_0x2cdd('0x21')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x22'),require(_0x2cdd('0x23')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x24'),require(_0x2cdd('0x25')));_0x18739b['use'](_0x2cdd('0x26'),require(_0x2cdd('0x27')));_0x18739b[_0x2cdd('0x4')]('/api/mail/substatuses',require(_0x2cdd('0x28')));_0x18739b[_0x2cdd('0x4')]('/api/mail/interactions',require(_0x2cdd('0x29')));_0x18739b['use'](_0x2cdd('0x2a'),require(_0x2cdd('0x2b')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x2c'),require('./api/mailApplication'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x2d'),require(_0x2cdd('0x2e')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x2f'),require(_0x2cdd('0x30')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x31'),require('./api/dashboardItem'));_0x18739b[_0x2cdd('0x4')]('/api/fax/accounts',require(_0x2cdd('0x32')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x33'),require(_0x2cdd('0x34')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x35'),require(_0x2cdd('0x36')));_0x18739b[_0x2cdd('0x4')]('/api/fax/messages',require(_0x2cdd('0x37')));_0x18739b[_0x2cdd('0x4')]('/api/fax/queues',require(_0x2cdd('0x38')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x39'),require(_0x2cdd('0x3a')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x3b'),require(_0x2cdd('0x3c')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x3d'),require('./api/smsApplication'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x3e'),require(_0x2cdd('0x3f')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x40'),require(_0x2cdd('0x41')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x42'),require('./api/smsQueue'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x43'),require(_0x2cdd('0x44')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x45'),require(_0x2cdd('0x46')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x47'),require('./api/openchannelInteraction'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x48'),require(_0x2cdd('0x49')));_0x18739b['use'](_0x2cdd('0x4a'),require(_0x2cdd('0x4b')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x4c'),require(_0x2cdd('0x4d')));_0x18739b['use'](_0x2cdd('0x4e'),require(_0x2cdd('0x4f')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x50'),require(_0x2cdd('0x51')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x52'),require('./api/chatInteraction'));_0x18739b[_0x2cdd('0x4')]('/api/chat/messages',require(_0x2cdd('0x53')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x54'),require(_0x2cdd('0x55')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x56'),require('./api/chatQueue'));_0x18739b['use'](_0x2cdd('0x57'),require(_0x2cdd('0x58')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x59'),require(_0x2cdd('0x5a')));_0x18739b[_0x2cdd('0x4')]('/api/cm/companies',require(_0x2cdd('0x5b')));_0x18739b[_0x2cdd('0x4')]('/api/cm/contacts',require(_0x2cdd('0x5c')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x5d'),require('./api/cmHopper'));_0x18739b[_0x2cdd('0x4')]('/api/cm/hopper_black',require(_0x2cdd('0x5e')));_0x18739b['use'](_0x2cdd('0x5f'),require(_0x2cdd('0x60')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x61'),require(_0x2cdd('0x62')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x63'),require('./api/cmCustomField'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x64'),require('./api/action'));_0x18739b[_0x2cdd('0x4')]('/api/automations',require('./api/automation'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x65'),require(_0x2cdd('0x66')));_0x18739b['use'](_0x2cdd('0x67'),require('./api/disposition'));_0x18739b['use'](_0x2cdd('0x68'),require(_0x2cdd('0x69')));_0x18739b[_0x2cdd('0x4')]('/api/intervals',require('./api/interval'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x6a'),require(_0x2cdd('0x6b')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x6c'),require('./api/cdr'));_0x18739b[_0x2cdd('0x4')]('/api/voiceQueuesLog',require(_0x2cdd('0x6d')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x6e'),require('./api/schedule'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x6f'),require(_0x2cdd('0x70')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x71'),require('./api/tag'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x72'),require(_0x2cdd('0x73')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x74'),require(_0x2cdd('0x75')));_0x18739b['use'](_0x2cdd('0x76'),require(_0x2cdd('0x77')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x78'),require('./api/template'));_0x18739b[_0x2cdd('0x4')]('/api/triggers',require(_0x2cdd('0x79')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x7a'),require(_0x2cdd('0x7b')));_0x18739b['use'](_0x2cdd('0x7c'),require(_0x2cdd('0x7d')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x7e'),require(_0x2cdd('0x7f')));_0x18739b[_0x2cdd('0x4')]('/api/analytics/custom_reports',require(_0x2cdd('0x80')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x81'),require(_0x2cdd('0x82')));_0x18739b['use']('/api/analytics/extracted_reports',require(_0x2cdd('0x83')));_0x18739b['use'](_0x2cdd('0x84'),require(_0x2cdd('0x85')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x86'),require(_0x2cdd('0x87')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x88'),require(_0x2cdd('0x89')));_0x18739b['use'](_0x2cdd('0x8a'),require(_0x2cdd('0x8b')));_0x18739b[_0x2cdd('0x4')]('/api/integrations/salesforce/configurations',require(_0x2cdd('0x8c')));_0x18739b['use'](_0x2cdd('0x8d'),require('./api/intSalesforceField'));_0x18739b['use']('/api/integrations/sugarcrm/accounts',require(_0x2cdd('0x8e')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x8f'),require(_0x2cdd('0x90')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x91'),require(_0x2cdd('0x92')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x93'),require(_0x2cdd('0x94')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x95'),require(_0x2cdd('0x96')));_0x18739b['use'](_0x2cdd('0x97'),require(_0x2cdd('0x98')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x99'),require(_0x2cdd('0x9a')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x9b'),require(_0x2cdd('0x9c')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x9d'),require(_0x2cdd('0x9e')));_0x18739b[_0x2cdd('0x4')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x18739b[_0x2cdd('0x4')]('/api/integrations/zendesk/configurations',require(_0x2cdd('0x9f')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xa0'),require(_0x2cdd('0xa1')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xa2'),require(_0x2cdd('0xa3')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xa4'),require(_0x2cdd('0xa5')));_0x18739b['use'](_0x2cdd('0xa6'),require(_0x2cdd('0xa7')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xa8'),require(_0x2cdd('0xa9')));_0x18739b['use']('/api/integrations/vtiger/configurations',require(_0x2cdd('0xaa')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xab'),require(_0x2cdd('0xac')));_0x18739b['use']('/api/integrations/servicenow/accounts',require(_0x2cdd('0xad')));_0x18739b[_0x2cdd('0x4')]('/api/integrations/servicenow/configurations',require(_0x2cdd('0xae')));_0x18739b['use'](_0x2cdd('0xaf'),require(_0x2cdd('0xb0')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xb1'),require(_0x2cdd('0xb2')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xb3'),require(_0x2cdd('0xb4')));_0x18739b['use'](_0x2cdd('0xb5'),require('./api/intDynamics365Field'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xb6'),require('./api/intFreshsalesAccount'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xb7'),require(_0x2cdd('0xb8')));_0x18739b['use'](_0x2cdd('0xb9'),require(_0x2cdd('0xba')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xbb'),require('./api/network'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xbc'),require(_0x2cdd('0xbd')));_0x18739b[_0x2cdd('0x4')]('/api/chat/internal/messages',require(_0x2cdd('0xbe')));_0x18739b['use'](_0x2cdd('0xbf'),require(_0x2cdd('0xc0')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xc1'),require('./api/jscriptyQuestionReport'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xc2'),require(_0x2cdd('0xc3')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xc4'),require(_0x2cdd('0xc5')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xc6'),require(_0x2cdd('0xc7')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xc8'),require('./api/squareReportDetail'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xc9'),require(_0x2cdd('0xca')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xcb'),require('./api/setting'));_0x18739b['use'](_0x2cdd('0xcc'),require(_0x2cdd('0xcd')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xce'),require('./api/squareProject'));_0x18739b[_0x2cdd('0x4')]('/api/square/recordings',require(_0x2cdd('0xcf')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd0'),require('./api/squareMessage'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd1'),require(_0x2cdd('0xd2')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd3'),require('./api/license'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd4'),require(_0x2cdd('0xd5')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd6'),require(_0x2cdd('0xd7')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd8'),require('./api/attachment'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xd9'),require('./api/plugin'));_0x18739b[_0x2cdd('0x4')]('/api/mail/reports/transfer',require(_0x2cdd('0xda')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xdb'),require('./api/chatTransferReport'));_0x18739b[_0x2cdd('0x4')]('/api/fax/reports/transfer',require(_0x2cdd('0xdc')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xdd'),require('./api/openchannelTransferReport'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xde'),require(_0x2cdd('0xdf')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xe0'),require('./api/cmList'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xe1'),require(_0x2cdd('0xe2')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xe3'),require(_0x2cdd('0xe4')));_0x18739b[_0x2cdd('0x4')]('/api/userProfile/sections',require(_0x2cdd('0xe5')));_0x18739b['use'](_0x2cdd('0xe6'),require(_0x2cdd('0xe7')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xe8'),require(_0x2cdd('0xe9')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xea'),require(_0x2cdd('0xeb')));_0x18739b[_0x2cdd('0x4')]('/api/whatsapp/applications',require(_0x2cdd('0xec')));_0x18739b[_0x2cdd('0x4')]('/api/whatsapp/interactions',require(_0x2cdd('0xed')));_0x18739b['use'](_0x2cdd('0xee'),require(_0x2cdd('0xef')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xf0'),require(_0x2cdd('0xf1')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xf2'),require(_0x2cdd('0xf3')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xf4'),require('./api/whatsappQueue'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xf5'),require('./api/cloudProvider'));_0x18739b[_0x2cdd('0x4')]('/api/realtime',require(_0x2cdd('0xf6')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xf7'),require(_0x2cdd('0xf8')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xf9'),require(_0x2cdd('0xfa')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xfb'),require(_0x2cdd('0xfc')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xfd'),require('./api/authActiveDirectory'));_0x18739b[_0x2cdd('0x4')]('/api/jira',require(_0x2cdd('0xfe')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0xff'),require(_0x2cdd('0x100')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x101'),require(_0x2cdd('0x102')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x103'),require('./api/system'));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x104'),require(_0x2cdd('0x105')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x106'),require(_0x2cdd('0x107')));_0x18739b['use'](_0x2cdd('0x108'),clientSideLogs);_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x109'),express[_0x2cdd('0x10a')](path[_0x2cdd('0x10b')](config[_0x2cdd('0x10c')],_0x2cdd('0x109'))));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x10d'),express[_0x2cdd('0x10a')](path['join'](config[_0x2cdd('0x10c')],_0x2cdd('0x10d'))));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x10e'),express['static'](path[_0x2cdd('0x10b')](config['root'],'/demo')));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x10f'),express[_0x2cdd('0x10a')](path[_0x2cdd('0x10b')](config['root'],'snippet',_0x2cdd('0x110'))));_0x18739b[_0x2cdd('0x4')](_0x2cdd('0x111'),express[_0x2cdd('0x10a')](path[_0x2cdd('0x10b')](config[_0x2cdd('0x10c')],_0x2cdd('0x112'))));_0x18739b[_0x2cdd('0x113')](_0x2cdd('0x114'))[_0x2cdd('0x115')](errors[0x194]);_0x18739b[_0x2cdd('0x113')]('/*')['get'](function(_0x5c27e5,_0x279768){_0x279768[_0x2cdd('0x116')](path[_0x2cdd('0x117')](_0x18739b[_0x2cdd('0x115')](_0x2cdd('0x118'))+_0x2cdd('0x119')));});return _0x18739b;});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe02e=['../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','../config/triggers','lodash'];(function(_0x7ee037,_0x38392b){var _0x450919=function(_0x2b0e45){while(--_0x2b0e45){_0x7ee037['push'](_0x7ee037['shift']());}};_0x450919(++_0x38392b);}(_0xe02e,0x1f0));var _0xee02=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe02e[_0x3b380d];return _0x54502b;};'use strict';var jayson=require('jayson/promise');var _=require(_0xee02('0x0'));var config=require(_0xee02('0x1'));exports['listen']=function(){return new Promise(function(_0x5c7559,_0xb2749a){var _0x1425fc={};_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x4')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x5')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x6')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x7')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x8')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x9')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/memberReport/memberReport.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xa')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xb')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0xc')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xd')));_0x1425fc=_['merge'](_0x1425fc,require('../api/mailAccount/mailAccount.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xe')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0xf')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x10')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x11')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x12')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x13')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x14')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/faxInteraction/faxInteraction.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x15')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x16')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x17')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x18')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x19')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1a')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1b')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1c')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x1d')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1e')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x1f')));_0x1425fc=_['merge'](_0x1425fc,require('../api/chatMessage/chatMessage.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x20')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x21')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x22')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x23')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x24')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x25')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x26')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x27')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x28')));_0x1425fc=_['merge'](_0x1425fc,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x29')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2a')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/variable/variable.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x2b')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2c')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2d')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2e')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x2f')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x30')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x31')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x32')));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x33')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x34')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x35')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x36')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x37')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/setting/setting.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x38')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x39')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3a')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/squareMessage/squareMessage.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/campaign/campaign.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3b')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/plugin/plugin.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3c')));_0x1425fc=_['merge'](_0x1425fc,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1425fc=_['merge'](_0x1425fc,require(_0xee02('0x3d')));_0x1425fc=_[_0xee02('0x2')](_0x1425fc,require(_0xee02('0x3e')));var _0x2a9b1e=jayson[_0xee02('0x3f')](_0x1425fc)[_0xee02('0x40')]();var _0xf74e30=config[_0xee02('0x41')][_0xee02('0x42')]||config['port']+0x1;var _0x435db9=config[_0xee02('0x41')]['ip']||_0xee02('0x43');_0x2a9b1e['on'](_0xee02('0x44'),function(_0x4940dc){return _0xb2749a(_0x4940dc);});_0x2a9b1e[_0xee02('0x45')](_0xf74e30,_0x435db9,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x435db9,_0xf74e30);require(_0xee02('0x46'))['default']();return _0x5c7559('RPC\x20listening\x20on\x20'+_0x435db9+':'+_0xf74e30);});});};
\ No newline at end of file
+var _0x507b=['../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc'];(function(_0x93adeb,_0x76e852){var _0xed761b=function(_0x160317){while(--_0x160317){_0x93adeb['push'](_0x93adeb['shift']());}};_0xed761b(++_0x76e852);}(_0x507b,0x187));var _0xb507=function(_0x377ea2,_0x4d6337){_0x377ea2=_0x377ea2-0x0;var _0x42ca60=_0x507b[_0x377ea2];return _0x42ca60;};'use strict';var jayson=require('jayson/promise');var _=require(_0xb507('0x0'));var config=require('../config/environment');exports[_0xb507('0x1')]=function(){return new Promise(function(_0x36c3dd,_0x5db7e1){var _0x3d0eb2={};_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x3')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x4')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x5')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x6')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x7')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x8')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x9')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0xa')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0xb')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0xc')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0xd')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0xe')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0xf')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x10')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/mailQueue/mailQueue.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/mailInteraction/mailInteraction.rpc'));_0x3d0eb2=_['merge'](_0x3d0eb2,require('../api/mailMessage/mailMessage.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x11')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x12')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/faxAccount/faxAccount.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x13')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x14')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x15')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x16')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x17')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x18')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x19')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x1a')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x1b')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x1c')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x1d')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x1e')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x1f')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x20')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x21')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/chatMessage/chatMessage.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x22')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x23')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x24')));_0x3d0eb2=_['merge'](_0x3d0eb2,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x25')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/interval/interval.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x26')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x27')));_0x3d0eb2=_['merge'](_0x3d0eb2,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x28')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x29')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x2a')));_0x3d0eb2=_['merge'](_0x3d0eb2,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x2b')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x2c')));_0x3d0eb2=_['merge'](_0x3d0eb2,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x2d')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x2e')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x2f')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x30')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x31')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x32')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x33')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x34')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x35')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x36')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x37')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x38')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x39')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x3a')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x3b')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x3c')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x3d')));_0x3d0eb2=_['merge'](_0x3d0eb2,require(_0xb507('0x3e')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x3f')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x40')));_0x3d0eb2=_[_0xb507('0x2')](_0x3d0eb2,require(_0xb507('0x41')));var _0x1d2051=jayson[_0xb507('0x42')](_0x3d0eb2)['http']();var _0x195157=config[_0xb507('0x43')][_0xb507('0x44')]||config[_0xb507('0x44')]+0x1;var _0x59132c=config[_0xb507('0x43')]['ip']||_0xb507('0x45');_0x1d2051['on'](_0xb507('0x46'),function(_0x1896b7){return _0x5db7e1(_0x1896b7);});_0x1d2051[_0xb507('0x1')](_0x195157,_0x59132c,function(){console[_0xb507('0x47')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x59132c,_0x195157);require(_0xb507('0x48'))[_0xb507('0x49')]();return _0x36c3dd(_0xb507('0x4a')+_0x59132c+':'+_0x195157);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x86be=['setTimeout','setEncoding','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','inherits','sendRequest','sync','prototype','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','format','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','utf8'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x86be,0x176));var _0xe86b=function(_0x1a0c1c,_0xcf7748){_0x1a0c1c=_0x1a0c1c-0x0;var _0x5366cc=_0x86be[_0x1a0c1c];return _0x5366cc;};'use strict';var util=require(_0xe86b('0x0'));var _=require('lodash');var EventEmitter=require(_0xe86b('0x1'))[_0xe86b('0x2')];var AGIReply=require(_0xe86b('0x3'));var AGIError=require(_0xe86b('0x4'));function AGIChannel(_0x348267){var _0x3c3b51=this,_0x815b97=new AGIReply(),_0x2ef1e1=![],_0x47ba5d={};EventEmitter['call'](_0x3c3b51);_0x348267['setEncoding'](_0xe86b('0x5'));_0x348267[_0xe86b('0x6')](0x8*0x3c*0x3c*0x3e8);_0x815b97[_0xe86b('0x7')](_0xe86b('0x5'));_0x815b97['on']('headers',function(_0x451793){for(var _0x69d6c9 in _0x451793){_0x3c3b51[_0x69d6c9]=_0x451793[_0x69d6c9];}_0x3c3b51[_0xe86b('0x8')]('ready');});_0x815b97['on'](_0xe86b('0x9'),function(_0x3d4c45){if(_0x3d4c45[_0xe86b('0xa')]()=='hangup'){_0x3c3b51[_0xe86b('0x8')](_0xe86b('0xb'));return;}if(_0x3d4c45[_0xe86b('0xc')](0x0,0xb)==_0xe86b('0xd')){_0x2ef1e1=!![];}if(_0x2ef1e1){_0x47ba5d['rx']+=_0x3d4c45+'\x0a';if(_0x3d4c45[_0xe86b('0xe')](_0xe86b('0xf'))!=-0x1){_0x2ef1e1=![];}}else{_0x47ba5d['rx']=_0x3d4c45;}if(_0x2ef1e1){return;}if(typeof _0x47ba5d['cb']==_0xe86b('0x10')){var _0x1d716d=_0x47ba5d['rx'][_0xe86b('0xc')](0x0,0x3),_0x48c991=null,_0x574825=null;_0x1d716d=parseInt(_0x1d716d);if(isNaN(_0x1d716d)){_0x47ba5d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe86b('0x11')});return;}if(_0x1d716d!=0xc8){_0x47ba5d['cb'](null,{'code':_0x1d716d,'result':-0x1,'extra':'KO'});return;}_0x48c991=_0x47ba5d['rx'][_0xe86b('0xc')](0x4)[_0xe86b('0x12')](_0xe86b('0x13'),'');if(_0x48c991[_0xe86b('0x14')]('\x20')!=-0x1){_0x48c991=_0x48c991[_0xe86b('0x15')](0x0,_0x48c991[_0xe86b('0x14')]('\x20'));}if(_[_0xe86b('0x16')](_0x48c991,'-1')){_0x48c991=parseInt(_0x48c991);}_0x574825=_0x47ba5d['rx'][_0xe86b('0x17')]('\x20');if(_0x574825[_0xe86b('0x18')]==0x3){_0x574825=_0x574825[0x2]['substring'](0x1,_0x574825[0x2][_0xe86b('0x18')]-0x1);}else if(_0x574825['length']>0x3){var _0x3c5ad6=/\((.+)\)/;var _0x180264=_0x47ba5d['rx'][_0xe86b('0x19')](_0x3c5ad6);if(_0x180264){_0x574825=_0x180264[0x1];}else{_0x574825=null;}}else{_0x574825=null;}_0x47ba5d['cb'](null,{'code':_0x1d716d,'result':_0x48c991,'extra':_0x574825});}});_0x348267['on'](_0xe86b('0x1a'),function(_0x1b6f44){_0x3c3b51[_0xe86b('0x8')](_0xe86b('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x1b6f44[_0xe86b('0x1b')]));});_0x348267['on']('close',function(){_0x3c3b51[_0xe86b('0x8')]('close',new AGIError(_0xe86b('0x1c')));});_0x348267['on'](_0xe86b('0x1d'),function(){_0x3c3b51[_0xe86b('0x8')](_0xe86b('0x1d'),new AGIError(_0xe86b('0x1e')));_0x348267[_0xe86b('0x1f')]();});_0x348267['pipe'](_0x815b97);this[_0xe86b('0x20')]=function(_0x145a54,_0x2f3486){var _0x145a54=_0x145a54||'',_0x2f3486=typeof _0x2f3486==_0xe86b('0x10')?_0x2f3486:new Function();_0x47ba5d={'tx':_0x145a54,'rx':'','cb':_0x2f3486};_0x348267['write'](_0x145a54+'\x0a');},this['close']=function(){_0x348267['destroy']();};}util[_0xe86b('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xe86b('0x22')]=function(_0x15f771){return this[_0xe86b('0x20')][_0xe86b('0x23')](this,_0x15f771);};AGIChannel[_0xe86b('0x24')]['answer']=function(){return this[_0xe86b('0x22')]('ANSWER');};AGIChannel[_0xe86b('0x24')][_0xe86b('0x25')]=function(_0x4869df,_0x5d5d44,_0xd1bf16){_0x4869df=_0x4869df===undefined?_0xe86b('0x26'):_0x4869df;_0x5d5d44=_0x5d5d44===undefined?'5':_0x5d5d44;_0xd1bf16=_0xd1bf16===undefined?'1':_0xd1bf16;return this[_0xe86b('0x22')](util['format'](_0xe86b('0x27'),_0x4869df,_0x5d5d44*0x3e8,_0xd1bf16));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x28')]=function(_0x43d168){_0x43d168=_0x43d168||_0xe86b('0x29');return this[_0xe86b('0x22')](util['format'](_0xe86b('0x2a'),_0x43d168));};AGIChannel[_0xe86b('0x24')]['exec']=function(_0x7bcbae,_0x146cc4){if(_['isArray'](_0x146cc4)){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x2c'),_0x7bcbae,_0x146cc4[_0xe86b('0x2d')](',')));}return this['sendRequest'](util['format'](_0xe86b('0x2c'),_0x7bcbae,_0x146cc4));};AGIChannel['prototype'][_0xe86b('0x2e')]=function(_0x348b55){return this[_0xe86b('0x22')](util['format'](_0xe86b('0x2f'),_0x348b55));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x30')]=function(_0x2012f5){return this[_0xe86b('0x22')](util['format'](_0xe86b('0x31'),_0x2012f5));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x32')]=function(_0x5af3d0){return this['sendRequest'](util[_0xe86b('0x2b')](_0xe86b('0x33'),_0x5af3d0));};AGIChannel['prototype'][_0xe86b('0xb')]=function(){return this['sendRequest'](_0xe86b('0x34'));};AGIChannel[_0xe86b('0x24')]['setVariable']=function(_0x1657f5,_0x115536){var _0x53a536=_[_0xe86b('0x35')](_0x115536)||_[_0xe86b('0x36')](_0x115536)?_0x115536['toString']():_0x115536;return this[_0xe86b('0x22')](util[_0xe86b('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1657f5,_0x53a536?_0x53a536[_0xe86b('0x37')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xe86b('0x38')]=function(_0x3aa95e,_0x401292){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x3aa95e,_0x401292));};AGIChannel[_0xe86b('0x24')]['sayDigits']=function(_0x1ac9b1,_0x5c0283){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x39'),_0x1ac9b1,_0x5c0283));};AGIChannel['prototype'][_0xe86b('0x3a')]=function(_0x19d010,_0x4c13ec){return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x3b'),_0x19d010,_0x4c13ec));};AGIChannel[_0xe86b('0x24')]['continueAt']=function(_0x2266f2,_0x4a6a31,_0x300f50){_0x4a6a31=_0x4a6a31||this['extension'];_0x300f50=_0x300f50||0x1;this[_0xe86b('0x2e')](_0x2266f2);this[_0xe86b('0x30')](_0x4a6a31);this[_0xe86b('0x32')](_0x300f50);return this['noop'](util[_0xe86b('0x2b')](_0xe86b('0x3c'),_0x2266f2,_0x4a6a31,_0x300f50));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x3d')]=function(_0x4e5ad3){return this[_0xe86b('0x22')](util['format'](_0xe86b('0x3e'),_0x4e5ad3));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x3f')]=function(_0x1a1470,_0x3334c3,_0xf6e09,_0x1fd2e1,_0xbbdf18,_0x25fa8a){_0x3334c3=_0x3334c3||_0xe86b('0x40');_0xf6e09=_0xf6e09||'';_0x1fd2e1=_0x1fd2e1===undefined?-0x1:_0x1fd2e1==='-1'?-0x1:_0x1fd2e1*0x3e8;_0xbbdf18=_0xbbdf18===undefined?'':'s='+_0xbbdf18;_0x25fa8a=_0x25fa8a?_0xe86b('0x41'):'';return this[_0xe86b('0x22')](util[_0xe86b('0x2b')](_0xe86b('0x42'),_0x1a1470,_0x3334c3,_0xf6e09,_0x1fd2e1,_0x25fa8a,_0xbbdf18));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x43')]=function(_0x17f0a3,_0x2e08ad){_0x2e08ad=_0x2e08ad||'';return this[_0xe86b('0x22')](util[_0xe86b('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x17f0a3,_0x2e08ad));};AGIChannel[_0xe86b('0x24')][_0xe86b('0x44')]=function(_0x23e0ba){return this[_0xe86b('0x45')](_0xe86b('0x46'),_0x23e0ba);};AGIChannel[_0xe86b('0x24')][_0xe86b('0x47')]=function(_0x4fae41){return this['exec'](_0xe86b('0x48'),_0x4fae41);};AGIChannel[_0xe86b('0x24')][_0xe86b('0x1a')]=function(_0x35b72d,_0x1f577f){this['noop'](util[_0xe86b('0x2b')](_0xe86b('0x49'),_0x35b72d['id'],_0x35b72d[_0xe86b('0x4a')],_0x1f577f));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe86b('0x4b')]=AGIChannel;
\ No newline at end of file
+var _0x3ef8=['replace','result=','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','./error','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','no\x20code'];(function(_0x4fc14e,_0x3e8fe8){var _0x1eb64d=function(_0xc0ae3d){while(--_0xc0ae3d){_0x4fc14e['push'](_0x4fc14e['shift']());}};_0x1eb64d(++_0x3e8fe8);}(_0x3ef8,0xc6));var _0x83ef=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3ef8[_0x432682];return _0x463d05;};'use strict';var util=require('util');var _=require(_0x83ef('0x0'));var EventEmitter=require(_0x83ef('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x83ef('0x2'));function AGIChannel(_0x48d1fb){var _0x182cd2=this,_0x567740=new AGIReply(),_0x3a1589=![],_0x9c827c={};EventEmitter['call'](_0x182cd2);_0x48d1fb[_0x83ef('0x3')](_0x83ef('0x4'));_0x48d1fb[_0x83ef('0x5')](0x8*0x3c*0x3c*0x3e8);_0x567740[_0x83ef('0x3')]('utf8');_0x567740['on']('headers',function(_0x25c53e){for(var _0x3da8a8 in _0x25c53e){_0x182cd2[_0x3da8a8]=_0x25c53e[_0x3da8a8];}_0x182cd2[_0x83ef('0x6')]('ready');});_0x567740['on'](_0x83ef('0x7'),function(_0x3a6002){if(_0x3a6002[_0x83ef('0x8')]()==_0x83ef('0x9')){_0x182cd2[_0x83ef('0x6')](_0x83ef('0x9'));return;}if(_0x3a6002['substring'](0x0,0xb)==_0x83ef('0xa')){_0x3a1589=!![];}if(_0x3a1589){_0x9c827c['rx']+=_0x3a6002+'\x0a';if(_0x3a6002['search'](_0x83ef('0xb'))!=-0x1){_0x3a1589=![];}}else{_0x9c827c['rx']=_0x3a6002;}if(_0x3a1589){return;}if(typeof _0x9c827c['cb']==_0x83ef('0xc')){var _0x2b7fb0=_0x9c827c['rx'][_0x83ef('0xd')](0x0,0x3),_0x3cbe7f=null,_0x4071ea=null;_0x2b7fb0=parseInt(_0x2b7fb0);if(isNaN(_0x2b7fb0)){_0x9c827c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x83ef('0xe')});return;}if(_0x2b7fb0!=0xc8){_0x9c827c['cb'](null,{'code':_0x2b7fb0,'result':-0x1,'extra':'KO'});return;}_0x3cbe7f=_0x9c827c['rx']['substring'](0x4)[_0x83ef('0xf')](_0x83ef('0x10'),'');if(_0x3cbe7f['indexOf']('\x20')!=-0x1){_0x3cbe7f=_0x3cbe7f[_0x83ef('0x11')](0x0,_0x3cbe7f['indexOf']('\x20'));}if(_[_0x83ef('0x12')](_0x3cbe7f,'-1')){_0x3cbe7f=parseInt(_0x3cbe7f);}_0x4071ea=_0x9c827c['rx'][_0x83ef('0x13')]('\x20');if(_0x4071ea[_0x83ef('0x14')]==0x3){_0x4071ea=_0x4071ea[0x2][_0x83ef('0xd')](0x1,_0x4071ea[0x2]['length']-0x1);}else if(_0x4071ea['length']>0x3){var _0x31137f=/\((.+)\)/;var _0x2b85a4=_0x9c827c['rx'][_0x83ef('0x15')](_0x31137f);if(_0x2b85a4){_0x4071ea=_0x2b85a4[0x1];}else{_0x4071ea=null;}}else{_0x4071ea=null;}_0x9c827c['cb'](null,{'code':_0x2b7fb0,'result':_0x3cbe7f,'extra':_0x4071ea});}});_0x48d1fb['on'](_0x83ef('0x16'),function(_0x598b6e){_0x182cd2[_0x83ef('0x6')](_0x83ef('0x16'),new AGIError(_0x83ef('0x17'),_0x598b6e[_0x83ef('0x18')]));});_0x48d1fb['on'](_0x83ef('0x19'),function(){_0x182cd2[_0x83ef('0x6')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x48d1fb['on'](_0x83ef('0x1a'),function(){_0x182cd2[_0x83ef('0x6')](_0x83ef('0x1a'),new AGIError(_0x83ef('0x1b')));_0x48d1fb[_0x83ef('0x1c')]();});_0x48d1fb['pipe'](_0x567740);this[_0x83ef('0x1d')]=function(_0x500208,_0x5cbe30){var _0x500208=_0x500208||'',_0x5cbe30=typeof _0x5cbe30=='function'?_0x5cbe30:new Function();_0x9c827c={'tx':_0x500208,'rx':'','cb':_0x5cbe30};_0x48d1fb['write'](_0x500208+'\x0a');},this['close']=function(){_0x48d1fb[_0x83ef('0x1c')]();};}util[_0x83ef('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0x83ef('0x1f')][_0x83ef('0x20')]=function(_0x34e47c){return this[_0x83ef('0x1d')][_0x83ef('0x21')](this,_0x34e47c);};AGIChannel['prototype'][_0x83ef('0x22')]=function(){return this[_0x83ef('0x20')](_0x83ef('0x23'));};AGIChannel[_0x83ef('0x1f')]['getData']=function(_0x4cf57b,_0x53e17a,_0x1b62e9){_0x4cf57b=_0x4cf57b===undefined?_0x83ef('0x24'):_0x4cf57b;_0x53e17a=_0x53e17a===undefined?'5':_0x53e17a;_0x1b62e9=_0x1b62e9===undefined?'1':_0x1b62e9;return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x26'),_0x4cf57b,_0x53e17a*0x3e8,_0x1b62e9));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x27')]=function(_0x52f3c4){_0x52f3c4=_0x52f3c4||_0x83ef('0x28');return this[_0x83ef('0x20')](util['format']('VERBOSE\x20\x22%s\x22',_0x52f3c4));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x29')]=function(_0x12976f,_0x1b27ed){if(_[_0x83ef('0x2a')](_0x1b27ed)){return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x2b'),_0x12976f,_0x1b27ed[_0x83ef('0x2c')](',')));}return this['sendRequest'](util[_0x83ef('0x25')]('EXEC\x20%s\x20%s',_0x12976f,_0x1b27ed));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x2d')]=function(_0x487de4){return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x2e'),_0x487de4));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x2f')]=function(_0x5f4fed){return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x30'),_0x5f4fed));};AGIChannel['prototype'][_0x83ef('0x31')]=function(_0x45606c){return this[_0x83ef('0x20')](util[_0x83ef('0x25')]('SET\x20PRIORITY\x20%s',_0x45606c));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x9')]=function(){return this[_0x83ef('0x20')](_0x83ef('0x32'));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x33')]=function(_0x49b7dc,_0x2c44a7){var _0x33d8e9=_[_0x83ef('0x34')](_0x2c44a7)||_[_0x83ef('0x35')](_0x2c44a7)?_0x2c44a7[_0x83ef('0x36')]():_0x2c44a7;return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x37'),_0x49b7dc,_0x33d8e9?_0x33d8e9['toString']()[_0x83ef('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x38')]=function(_0xd29880,_0x372e97){return this[_0x83ef('0x20')](util['format'](_0x83ef('0x39'),_0xd29880,_0x372e97));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x3a')]=function(_0xb250a3,_0x276503){return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x3b'),_0xb250a3,_0x276503));};AGIChannel['prototype'][_0x83ef('0x3c')]=function(_0x1a945c,_0x181ca7){return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x3d'),_0x1a945c,_0x181ca7));};AGIChannel['prototype'][_0x83ef('0x3e')]=function(_0x8d5a79,_0x42bf86,_0x51ba25){_0x42bf86=_0x42bf86||this['extension'];_0x51ba25=_0x51ba25||0x1;this['setContext'](_0x8d5a79);this[_0x83ef('0x2f')](_0x42bf86);this[_0x83ef('0x31')](_0x51ba25);return this[_0x83ef('0x27')](util['format'](_0x83ef('0x3f'),_0x8d5a79,_0x42bf86,_0x51ba25));};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x40')]=function(_0x30b3d0){return this[_0x83ef('0x20')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x30b3d0));};AGIChannel['prototype'][_0x83ef('0x41')]=function(_0x1d8344,_0x2e22bc,_0x475a68,_0x27d2a8,_0x3cd62,_0x2141df){_0x2e22bc=_0x2e22bc||'wav';_0x475a68=_0x475a68||'';_0x27d2a8=_0x27d2a8===undefined?-0x1:_0x27d2a8==='-1'?-0x1:_0x27d2a8*0x3e8;_0x3cd62=_0x3cd62===undefined?'':'s='+_0x3cd62;_0x2141df=_0x2141df?_0x83ef('0x42'):'';return this[_0x83ef('0x20')](util[_0x83ef('0x25')](_0x83ef('0x43'),_0x1d8344,_0x2e22bc,_0x475a68,_0x27d2a8,_0x2141df,_0x3cd62));};AGIChannel['prototype']['streamFile']=function(_0x4b4b54,_0x3abca4){_0x3abca4=_0x3abca4||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x4b4b54,_0x3abca4));};AGIChannel[_0x83ef('0x1f')]['agi']=function(_0x51786e){return this[_0x83ef('0x29')]('AGI',_0x51786e);};AGIChannel['prototype']['wait']=function(_0x1738ef){return this[_0x83ef('0x29')]('WAIT',_0x1738ef);};AGIChannel[_0x83ef('0x1f')][_0x83ef('0x16')]=function(_0x196fcc,_0x23acc0){this[_0x83ef('0x27')](util[_0x83ef('0x25')](_0x83ef('0x44'),_0x196fcc['id'],_0x196fcc[_0x83ef('0x45')],_0x23acc0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x83ef('0x46')]=AGIChannel;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28e7=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x5d43fa,_0x2906cc){var _0x94d13d=function(_0x19d923){while(--_0x19d923){_0x5d43fa['push'](_0x5d43fa['shift']());}};_0x94d13d(++_0x2906cc);}(_0x28e7,0x94));var _0x728e=function(_0x5f14c9,_0x643aa3){_0x5f14c9=_0x5f14c9-0x0;var _0x15f67c=_0x28e7[_0x5f14c9];return _0x15f67c;};'use strict';var util=require(_0x728e('0x0'));var error={'E_AGI_UNDEFINED':_0x728e('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x728e('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x728e('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x728e('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x728e('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x728e('0x6'),'E_AGI_COMMAND_EMPTY':_0x728e('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x728e('0x8'),'E_AGI_IVR_ENTRY':_0x728e('0x9')};function AGIError(_0x476f21){var _0x476f21=_0x476f21||null,_0x43a816=_0x43a816||[],_0x51c377=0x1,_0x53fc9a='';if(!error[_0x476f21]){_0x476f21=_0x728e('0xa');}_0x43a816[_0x728e('0xb')](error[_0x476f21]);while(arguments[_0x51c377]){_0x43a816[_0x728e('0xb')](arguments[_0x51c377]);_0x51c377++;}_0x53fc9a=util[_0x728e('0xc')][_0x728e('0xd')](util,_0x43a816);this[_0x728e('0xe')]=_0x53fc9a;this[_0x728e('0xf')]=_0x476f21;}module[_0x728e('0x10')]=AGIError;
\ No newline at end of file
+var _0x2148=['Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x170b0b,_0x4aa600){var _0x33cd22=function(_0x35263c){while(--_0x35263c){_0x170b0b['push'](_0x170b0b['shift']());}};_0x33cd22(++_0x4aa600);}(_0x2148,0xda));var _0x8214=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x2148[_0x2fe689];return _0x35ea44;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x8214('0x0'),'E_AGI_ARGUMENT_PORT':_0x8214('0x1'),'E_AGI_SERVER_ERROR':_0x8214('0x2'),'E_AGI_SERVER_CLOSE':_0x8214('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x8214('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x8214('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x8214('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x8214('0x7')};function AGIError(_0x33d738){var _0x33d738=_0x33d738||null,_0x2c30e6=_0x2c30e6||[],_0x3b7997=0x1,_0x118599='';if(!error[_0x33d738]){_0x33d738=_0x8214('0x8');}_0x2c30e6[_0x8214('0x9')](error[_0x33d738]);while(arguments[_0x3b7997]){_0x2c30e6[_0x8214('0x9')](arguments[_0x3b7997]);_0x3b7997++;}_0x118599=util[_0x8214('0xa')]['apply'](util,_0x2c30e6);this[_0x8214('0xb')]=_0x118599;this[_0x8214('0xc')]=_0x33d738;}module[_0x8214('0xd')]=AGIError;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14bf=['../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x14bf,0x1f3));var _0xf14b=function(_0x5f3295,_0x123fbc){_0x5f3295=_0x5f3295-0x0;var _0x555ccc=_0x14bf[_0x5f3295];return _0x555ccc;};'use strict';var _=require(_0xf14b('0x0'));var EventEmitter=require(_0xf14b('0x1'))[_0xf14b('0x2')];var Redis=require(_0xf14b('0x3'));var AGIError=require(_0xf14b('0x4'));var config=require(_0xf14b('0x5'));config[_0xf14b('0x6')]=_[_0xf14b('0x7')](config['redis'],{'host':_0xf14b('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xf14b('0x6')]);sub[_0xf14b('0x9')](_0xf14b('0xa'),function(_0x1be84e){if(_0x1be84e)return eventEmitter[_0xf14b('0xb')](_0xf14b('0xc'),new AGIError(_0xf14b('0xd'),_0x1be84e));});sub['on'](_0xf14b('0xe'),function(_0x342d1e,_0x12b6ee){if(_0x342d1e!==_0xf14b('0xa'))return;try{var _0x58babd=JSON[_0xf14b('0xf')](_0x12b6ee);eventEmitter['emit'](_0xf14b('0x10'),_0x58babd);}catch(_0x53da11){eventEmitter[_0xf14b('0xb')]('error',new AGIError(_0xf14b('0xd'),_0x53da11));}});module[_0xf14b('0x11')]={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0xa12c=['redis','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','projectUpdate','error','exports','lodash','events','EventEmitter','defaults'];(function(_0x4eae0e,_0x447048){var _0x332400=function(_0x4a0c9c){while(--_0x4a0c9c){_0x4eae0e['push'](_0x4eae0e['shift']());}};_0x332400(++_0x447048);}(_0xa12c,0x1c3));var _0xca12=function(_0x3e78eb,_0x198a0d){_0x3e78eb=_0x3e78eb-0x0;var _0x11257e=_0xa12c[_0x3e78eb];return _0x11257e;};'use strict';var _=require(_0xca12('0x0'));var EventEmitter=require(_0xca12('0x1'))[_0xca12('0x2')];var Redis=require('ioredis');var AGIError=require('./error');var config=require('../../config/environment');config['redis']=_[_0xca12('0x3')](config[_0xca12('0x4')],{'host':_0xca12('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xca12('0x4')]);sub[_0xca12('0x6')](_0xca12('0x7'),function(_0xbf867c){if(_0xbf867c)return eventEmitter[_0xca12('0x8')]('error',new AGIError(_0xca12('0x9'),_0xbf867c));});sub['on']('message',function(_0x1c04c8,_0x33f690){if(_0x1c04c8!==_0xca12('0x7'))return;try{var _0xf2c845=JSON['parse'](_0x33f690);eventEmitter[_0xca12('0x8')](_0xca12('0xa'),_0xf2c845);}catch(_0x36661d){eventEmitter['emit'](_0xca12('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x36661d));}});module[_0xca12('0xc')]={'EventEmitter':eventEmitter};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb15f=['no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','lodash','../../../config/logger','agi','menu','getdigits','vertices','addVertex','edges','prototype','push','numberOfEdges','size','getVertex','traverseBFS','info'];(function(_0x5b9b68,_0x1678d4){var _0x34908c=function(_0x558ca5){while(--_0x558ca5){_0x5b9b68['push'](_0x5b9b68['shift']());}};_0x34908c(++_0x1678d4);}(_0xb15f,0x179));var _0xfb15=function(_0x10b005,_0x33f9e2){_0x10b005=_0x10b005-0x0;var _0x15c2dc=_0xb15f[_0x10b005];return _0x15c2dc;};'use strict';var _=require(_0xfb15('0x0'));var logger=require(_0xfb15('0x1'))(_0xfb15('0x2'));var verticesWithRetry=[_0xfb15('0x3'),_0xfb15('0x4'),'getsecretdigits'];var Graph=function(){this[_0xfb15('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph['prototype'][_0xfb15('0x6')]=function(_0x4a6c1a){this[_0xfb15('0x5')][_0x4a6c1a['id']]=_0x4a6c1a;this[_0xfb15('0x7')][_0x4a6c1a['id']]=[];};Graph[_0xfb15('0x8')]['addEdge']=function(_0x677f5a,_0x43e716,_0x49d422){this['edges'][_0x677f5a][_0xfb15('0x9')]({'target':_0x43e716,'condition':_0x49d422});this[_0xfb15('0xa')]+=0x1;};Graph['prototype'][_0xfb15('0xb')]=function(){return _[_0xfb15('0xb')](this[_0xfb15('0x5')]);};Graph[_0xfb15('0x8')]['relations']=function(){return this[_0xfb15('0xa')];};Graph[_0xfb15('0x8')][_0xfb15('0xc')]=function(_0x5a74f1){return this[_0xfb15('0x5')][_0x5a74f1];};Graph[_0xfb15('0x8')][_0xfb15('0xd')]=function(_0x3970a8,_0x828ecf){if(!this['vertices'][_0x3970a8]){return logger[_0xfb15('0xe')](_0xfb15('0xf'));}var _0x99363c=_0x828ecf(this[_0xfb15('0x5')][_0x3970a8]);if(!_0x99363c){return logger[_0xfb15('0xe')](_0xfb15('0x10'));}if(this[_0xfb15('0x7')][_0x3970a8][_0xfb15('0x11')]===0x0){return logger[_0xfb15('0xe')](_0xfb15('0x12'));}for(var _0x30afd7=0x0,_0x4178a3=[],_0x3f5ad7=![];_0x30afd7<this['edges'][_0x3970a8]['length'];_0x30afd7+=0x1){if(this['edges'][_0x3970a8][_0x30afd7][_0xfb15('0x13')]){_0x4178a3=this[_0xfb15('0x7')][_0x3970a8][_0x30afd7]['condition'][_0xfb15('0x14')](',');for(var _0x438a0f=0x0;_0x438a0f<_0x4178a3[_0xfb15('0x11')];_0x438a0f+=0x1){if(this[_0xfb15('0x5')][_0x3970a8][_0xfb15('0x15')]===_0xfb15('0x16')&&_0x4178a3[_0x438a0f]==='-'){_0x3f5ad7=this['edges'][_0x3970a8][_0x30afd7][_0xfb15('0x17')];logger[_0xfb15('0xe')](_0xfb15('0x18'),_0x4178a3[_0x438a0f],this[_0xfb15('0x7')][_0x3970a8][_0x30afd7][_0xfb15('0x17')]);}else if(this['vertices'][_0x3970a8][_0xfb15('0x15')]==='menu'&&_0x4178a3[_0x438a0f]==='i'){_0x3f5ad7=this['edges'][_0x3970a8][_0x30afd7][_0xfb15('0x17')];logger[_0xfb15('0xe')](_0xfb15('0x19'),_0x4178a3[_0x438a0f],this[_0xfb15('0x7')][_0x3970a8][_0x30afd7][_0xfb15('0x17')]);}if(_0x4178a3[_0x438a0f]===_0x99363c){return this['traverseBFS'](this[_0xfb15('0x7')][_0x3970a8][_0x30afd7][_0xfb15('0x17')],_0x828ecf);}}}else{return this[_0xfb15('0xd')](this['edges'][_0x3970a8][_0x30afd7][_0xfb15('0x17')],_0x828ecf);}}if(_0x4178a3[_0xfb15('0x11')]){if(this[_0xfb15('0x5')][_0x3970a8][_0xfb15('0x15')]===_0xfb15('0x16')){if(_0x3f5ad7){return this[_0xfb15('0xd')](_0x3f5ad7,_0x828ecf);}return logger[_0xfb15('0xe')](_0xfb15('0x1a'));}else if(_['includes'](verticesWithRetry,this[_0xfb15('0x5')][_0x3970a8]['agicommand'])){if(_0x99363c==='-'){return logger[_0xfb15('0xe')](_0xfb15('0x1b'));}if(_0x3f5ad7&&_0x99363c!=='t'){return this['traverseBFS'](_0x3f5ad7,_0x828ecf);}return this[_0xfb15('0xd')](_0x3970a8,_0x828ecf);}return logger[_0xfb15('0xe')]('condition\x20not\x20found');}};module['exports']=Graph;
\ No newline at end of file
+var _0x0195=['stop\x20traverse','length','no\x20edge/s\x20available','split','vswitch','target','invalid','traverseBFS','agicommand','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','prototype','vertices','addEdge','edges','push','numberOfEdges','size','relations','getVertex','info','no\x20vertex\x20found'];(function(_0x14016c,_0x5d7d8e){var _0x44a523=function(_0x2e4fca){while(--_0x2e4fca){_0x14016c['push'](_0x14016c['shift']());}};_0x44a523(++_0x5d7d8e);}(_0x0195,0x168));var _0x5019=function(_0x1dfaf2,_0x548e7){_0x1dfaf2=_0x1dfaf2-0x0;var _0x24435e=_0x0195[_0x1dfaf2];return _0x24435e;};'use strict';var _=require(_0x5019('0x0'));var logger=require(_0x5019('0x1'))(_0x5019('0x2'));var verticesWithRetry=[_0x5019('0x3'),_0x5019('0x4'),_0x5019('0x5')];var Graph=function(){this['vertices']={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x5019('0x6')]['addVertex']=function(_0x351aa7){this[_0x5019('0x7')][_0x351aa7['id']]=_0x351aa7;this['edges'][_0x351aa7['id']]=[];};Graph['prototype'][_0x5019('0x8')]=function(_0x394d82,_0x545ac6,_0x57bc33){this[_0x5019('0x9')][_0x394d82][_0x5019('0xa')]({'target':_0x545ac6,'condition':_0x57bc33});this[_0x5019('0xb')]+=0x1;};Graph[_0x5019('0x6')][_0x5019('0xc')]=function(){return _[_0x5019('0xc')](this[_0x5019('0x7')]);};Graph[_0x5019('0x6')][_0x5019('0xd')]=function(){return this[_0x5019('0xb')];};Graph['prototype'][_0x5019('0xe')]=function(_0x1efef6){return this['vertices'][_0x1efef6];};Graph[_0x5019('0x6')]['traverseBFS']=function(_0x172c9f,_0x21ab56){if(!this[_0x5019('0x7')][_0x172c9f]){return logger[_0x5019('0xf')](_0x5019('0x10'));}var _0x32e5ce=_0x21ab56(this[_0x5019('0x7')][_0x172c9f]);if(!_0x32e5ce){return logger[_0x5019('0xf')](_0x5019('0x11'));}if(this['edges'][_0x172c9f][_0x5019('0x12')]===0x0){return logger[_0x5019('0xf')](_0x5019('0x13'));}for(var _0x466392=0x0,_0x1b8634=[],_0x14a996=![];_0x466392<this[_0x5019('0x9')][_0x172c9f][_0x5019('0x12')];_0x466392+=0x1){if(this['edges'][_0x172c9f][_0x466392]['condition']){_0x1b8634=this['edges'][_0x172c9f][_0x466392]['condition'][_0x5019('0x14')](',');for(var _0x1cf608=0x0;_0x1cf608<_0x1b8634[_0x5019('0x12')];_0x1cf608+=0x1){if(this[_0x5019('0x7')][_0x172c9f]['agicommand']===_0x5019('0x15')&&_0x1b8634[_0x1cf608]==='-'){_0x14a996=this[_0x5019('0x9')][_0x172c9f][_0x466392]['target'];logger[_0x5019('0xf')]('default',_0x1b8634[_0x1cf608],this[_0x5019('0x9')][_0x172c9f][_0x466392][_0x5019('0x16')]);}else if(this['vertices'][_0x172c9f]['agicommand']===_0x5019('0x3')&&_0x1b8634[_0x1cf608]==='i'){_0x14a996=this[_0x5019('0x9')][_0x172c9f][_0x466392][_0x5019('0x16')];logger['info'](_0x5019('0x17'),_0x1b8634[_0x1cf608],this[_0x5019('0x9')][_0x172c9f][_0x466392][_0x5019('0x16')]);}if(_0x1b8634[_0x1cf608]===_0x32e5ce){return this['traverseBFS'](this[_0x5019('0x9')][_0x172c9f][_0x466392]['target'],_0x21ab56);}}}else{return this[_0x5019('0x18')](this[_0x5019('0x9')][_0x172c9f][_0x466392][_0x5019('0x16')],_0x21ab56);}}if(_0x1b8634[_0x5019('0x12')]){if(this[_0x5019('0x7')][_0x172c9f][_0x5019('0x19')]===_0x5019('0x15')){if(_0x14a996){return this['traverseBFS'](_0x14a996,_0x21ab56);}return logger[_0x5019('0xf')]('default\x20on\x20switch\x20not\x20found');}else if(_['includes'](verticesWithRetry,this['vertices'][_0x172c9f][_0x5019('0x19')])){if(_0x32e5ce==='-'){return logger['info'](_0x5019('0x1a'));}if(_0x14a996&&_0x32e5ce!=='t'){return this[_0x5019('0x18')](_0x14a996,_0x21ab56);}return this[_0x5019('0x18')](_0x172c9f,_0x21ab56);}return logger[_0x5019('0xf')](_0x5019('0x1b'));}};module[_0x5019('0x1c')]=Graph;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16c3=['initialize','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','finally','listening','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','evtHangup','find','handleNotFound','handleUnpublished'];(function(_0x1205f8,_0x3e9e32){var _0x7e9648=function(_0x1135ce){while(--_0x1135ce){_0x1205f8['push'](_0x1205f8['shift']());}};_0x7e9648(++_0x3e9e32);}(_0x16c3,0x1f0));var _0x316c=function(_0xcb38a4,_0xd92302){_0xcb38a4=_0xcb38a4-0x0;var _0x4a86be=_0x16c3[_0xcb38a4];return _0x4a86be;};'use strict';var _=require('lodash');var syncho=require(_0x316c('0x0'));var util=require(_0x316c('0x1'));var config=require('../../config/environment');var logger=require(_0x316c('0x2'))(_0x316c('0x3'));var utilLicense=require(_0x316c('0x4'));var rpc=require(_0x316c('0x5'));var Project=require(_0x316c('0x6'));var AGIEmitter=require(_0x316c('0x7'))['EventEmitter'];var projects=[];config[_0x316c('0x3')]=_['defaults'](config[_0x316c('0x3')],{'ip':_0x316c('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0xaeddf3){process[_0x316c('0x9')](function(){syncho(function(){try{setChannelVariables(_0xaeddf3);agiHandler(_0xaeddf3);}catch(_0xa0732b){logger[_0x316c('0xa')](_0xa0732b[_0x316c('0xb')]);}});});}function projectUpdateHandler(_0xe6bad7){try{var _0xeee72b=_[_0x316c('0xc')](projects,['id',_0xe6bad7['id']]);if(_0xeee72b>-0x1){if(_0xe6bad7[_0x316c('0xd')]===!![]){projects[_0x316c('0xe')](_0xeee72b,0x1);}else{projects[_0xeee72b]=_0xe6bad7;}}else{projects[_0x316c('0xf')](_0xe6bad7);}}catch(_0x2aa39e){logger[_0x316c('0xa')](_0x2aa39e[_0x316c('0xb')]);}}function listeningHandler(){console[_0x316c('0x10')](_0x316c('0x11'),config[_0x316c('0x3')][_0x316c('0x12')]);logger['info'](util[_0x316c('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x316c('0x3')]['ip'],config['agi'][_0x316c('0x12')]));}function errorHandler(_0xa89fcc){if(_0xa89fcc&&_0xa89fcc[_0x316c('0x14')]&&_0xa89fcc[_0x316c('0x15')]){logger[_0x316c('0xa')](util[_0x316c('0x13')](_0x316c('0x16'),_0xa89fcc[_0x316c('0x14')],_0xa89fcc[_0x316c('0x15')]));}else{logger['error'](util['format'](_0x316c('0x17'),_0xa89fcc['stack']));}}function closeHandler(){logger[_0x316c('0x18')](util[_0x316c('0x13')](_0x316c('0x19'),this[_0x316c('0x1a')],this['calleridname'],this[_0x316c('0x1b')],this[_0x316c('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x55819e){logger['error'](_0x55819e[_0x316c('0xb')]);}}function timeoutHandler(){logger[_0x316c('0x18')](util[_0x316c('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x316c('0x1a')],this[_0x316c('0x1d')],this[_0x316c('0x1b')],this[_0x316c('0x1c')],this[_0x316c('0x1e')]));}function hangupHandler(){logger[_0x316c('0x18')](util[_0x316c('0x13')](_0x316c('0x1f'),this[_0x316c('0x1a')],this['calleridname'],this[_0x316c('0x1b')],this['dnid'],this[_0x316c('0x1e')]));this['evtHangup']=!![];}function createSquareReport(_0x34a017,_0x32f9a1){rpc[_0x316c('0x20')](_0x34a017)['then'](function(_0x337b1f){if(_0x32f9a1){_0x32f9a1(null,_0x337b1f);}})['catch'](function(_0x202e0d){if(_0x32f9a1){_0x32f9a1(null,_0x202e0d);}});}function setChannelVariables(_0x24f35c){for(var _0x7a6654 in _0x24f35c){if(_0x24f35c[_0x316c('0x21')](_0x7a6654)){if(_0x7a6654[_0x316c('0x22')](_0x316c('0x23'))===0x0){_0x24f35c[_0x7a6654[_0x316c('0x24')](0x4)]=_0x24f35c[_0x7a6654];delete _0x24f35c[_0x7a6654];}}}}function agiHandler(_0x5af912){logger[_0x316c('0x25')](_0x316c('0x26'),JSON[_0x316c('0x27')](_0x5af912,null,0x2));logger[_0x316c('0x18')](util[_0x316c('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5af912['arg_1'],_0x5af912[_0x316c('0x1d')],_0x5af912[_0x316c('0x1b')],_0x5af912[_0x316c('0x1c')],_0x5af912['uniqueid']));_0x5af912['on'](_0x316c('0xa'),errorHandler);_0x5af912['on']('close',closeHandler);_0x5af912['on']('timeout',timeoutHandler);_0x5af912[_0x316c('0x28')]=![];_0x5af912['on']('hangup',hangupHandler);var _0x1a321f=_[_0x316c('0x29')](projects,[_0x316c('0x14'),_0x5af912[_0x316c('0x1a')]]);if(!_0x1a321f)return Project[_0x316c('0x2a')](_0x5af912);if(!_0x1a321f['production'])return Project[_0x316c('0x2b')](_0x5af912);return Project[_0x316c('0x2c')](_0x1a321f,_0x5af912);}function main(){var _0x57751e;return utilLicense[_0x316c('0x2d')]()['then'](function(_0x2f950f){if(!_0x2f950f)return;if(_0x2f950f[_0x316c('0x2e')]){if(_0x2f950f['callysquare']&&_0x2f950f['callysquare']>0x0){logger[_0x316c('0x18')](util[_0x316c('0x13')](_0x316c('0x2f'),_0x2f950f[_0x316c('0x30')]));_0x57751e=_0x2f950f[_0x316c('0x30')];}else{logger[_0x316c('0x18')](_0x316c('0x31'));}}else{logger[_0x316c('0x18')](_0x316c('0x32'));_0x57751e=-0x1;}})['then'](function(){return Project['getAll']();})['then'](function(_0x406cf6){projects=_0x406cf6;return;})[_0x316c('0x33')](function(_0x5a6d4a){logger[_0x316c('0xa')]('[LICENSE]',_0x5a6d4a['stack']);})[_0x316c('0x34')](function(){var _0x3883b8=require('./server')(config[_0x316c('0x3')]['port'],config[_0x316c('0x3')]['ip'],_0x57751e);_0x3883b8['on'](_0x316c('0xa'),errorHandler);_0x3883b8['on'](_0x316c('0x35'),listeningHandler);_0x3883b8['on']('connection',connectionHandler);_0x3883b8['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0x80d3=['stack','findIndex','deleted','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','./server','listening','lodash','syncho','../../config/environment','agi','../../config/license/util','./rpc','EventEmitter','projectUpdate','nextTick','error'];(function(_0x1e82fb,_0x350341){var _0x3dd780=function(_0x55009d){while(--_0x55009d){_0x1e82fb['push'](_0x1e82fb['shift']());}};_0x3dd780(++_0x350341);}(_0x80d3,0x169));var _0x380d=function(_0x2c3bd9,_0x17d57b){_0x2c3bd9=_0x2c3bd9-0x0;var _0x6803cd=_0x80d3[_0x2c3bd9];return _0x6803cd;};'use strict';var _=require(_0x380d('0x0'));var syncho=require(_0x380d('0x1'));var util=require('util');var config=require(_0x380d('0x2'));var logger=require('../../config/logger')(_0x380d('0x3'));var utilLicense=require(_0x380d('0x4'));var rpc=require(_0x380d('0x5'));var Project=require('./project');var AGIEmitter=require('./events')[_0x380d('0x6')];var projects=[];config[_0x380d('0x3')]=_['defaults'](config[_0x380d('0x3')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x380d('0x7'),projectUpdateHandler);function connectionHandler(_0x3e6665){process[_0x380d('0x8')](function(){syncho(function(){try{setChannelVariables(_0x3e6665);agiHandler(_0x3e6665);}catch(_0x2f6c4d){logger[_0x380d('0x9')](_0x2f6c4d[_0x380d('0xa')]);}});});}function projectUpdateHandler(_0x352fff){try{var _0x2030e3=_[_0x380d('0xb')](projects,['id',_0x352fff['id']]);if(_0x2030e3>-0x1){if(_0x352fff[_0x380d('0xc')]===!![]){projects['splice'](_0x2030e3,0x1);}else{projects[_0x2030e3]=_0x352fff;}}else{projects['push'](_0x352fff);}}catch(_0x1ad327){logger[_0x380d('0x9')](_0x1ad327[_0x380d('0xa')]);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x380d('0x3')][_0x380d('0xd')]);logger[_0x380d('0xe')](util[_0x380d('0xf')](_0x380d('0x10'),config[_0x380d('0x3')]['ip'],config['agi']['port']));}function errorHandler(_0x36cd54){if(_0x36cd54&&_0x36cd54[_0x380d('0x11')]&&_0x36cd54['message']){logger[_0x380d('0x9')](util['format']('[%s]\x20%s',_0x36cd54[_0x380d('0x11')],_0x36cd54[_0x380d('0x12')]));}else{logger[_0x380d('0x9')](util[_0x380d('0xf')](_0x380d('0x13'),_0x36cd54[_0x380d('0xa')]));}}function closeHandler(){logger[_0x380d('0xe')](util[_0x380d('0xf')](_0x380d('0x14'),this[_0x380d('0x15')],this[_0x380d('0x16')],this['callerid'],this[_0x380d('0x17')],this[_0x380d('0x18')]));try{createSquareReport(this);}catch(_0x573136){logger[_0x380d('0x9')](_0x573136['stack']);}}function timeoutHandler(){logger['info'](util[_0x380d('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x380d('0x15')],this[_0x380d('0x16')],this[_0x380d('0x19')],this[_0x380d('0x17')],this[_0x380d('0x18')]));}function hangupHandler(){logger[_0x380d('0xe')](util[_0x380d('0xf')](_0x380d('0x1a'),this[_0x380d('0x15')],this[_0x380d('0x16')],this[_0x380d('0x19')],this[_0x380d('0x17')],this[_0x380d('0x18')]));this['evtHangup']=!![];}function createSquareReport(_0x373e9f,_0x2f98a7){rpc[_0x380d('0x1b')](_0x373e9f)[_0x380d('0x1c')](function(_0x3e8028){if(_0x2f98a7){_0x2f98a7(null,_0x3e8028);}})[_0x380d('0x1d')](function(_0x5ed531){if(_0x2f98a7){_0x2f98a7(null,_0x5ed531);}});}function setChannelVariables(_0x9e488c){for(var _0xdae9bd in _0x9e488c){if(_0x9e488c[_0x380d('0x1e')](_0xdae9bd)){if(_0xdae9bd[_0x380d('0x1f')](_0x380d('0x20'))===0x0){_0x9e488c[_0xdae9bd['substring'](0x4)]=_0x9e488c[_0xdae9bd];delete _0x9e488c[_0xdae9bd];}}}}function agiHandler(_0x2ee08d){logger[_0x380d('0x21')](_0x380d('0x22'),JSON[_0x380d('0x23')](_0x2ee08d,null,0x2));logger['info'](util['format'](_0x380d('0x24'),_0x2ee08d[_0x380d('0x15')],_0x2ee08d[_0x380d('0x16')],_0x2ee08d['callerid'],_0x2ee08d[_0x380d('0x17')],_0x2ee08d[_0x380d('0x18')]));_0x2ee08d['on']('error',errorHandler);_0x2ee08d['on'](_0x380d('0x25'),closeHandler);_0x2ee08d['on'](_0x380d('0x26'),timeoutHandler);_0x2ee08d['evtHangup']=![];_0x2ee08d['on']('hangup',hangupHandler);var _0x3cab34=_[_0x380d('0x27')](projects,[_0x380d('0x11'),_0x2ee08d[_0x380d('0x15')]]);if(!_0x3cab34)return Project[_0x380d('0x28')](_0x2ee08d);if(!_0x3cab34[_0x380d('0x29')])return Project[_0x380d('0x2a')](_0x2ee08d);return Project[_0x380d('0x2b')](_0x3cab34,_0x2ee08d);}function main(){var _0x590f53;return utilLicense['getLicense']()['then'](function(_0xf69f96){if(!_0xf69f96)return;if(_0xf69f96[_0x380d('0x2c')]){if(_0xf69f96[_0x380d('0x2d')]&&_0xf69f96[_0x380d('0x2d')]>0x0){logger[_0x380d('0xe')](util[_0x380d('0xf')](_0x380d('0x2e'),_0xf69f96[_0x380d('0x2d')]));_0x590f53=_0xf69f96[_0x380d('0x2d')];}else{logger[_0x380d('0xe')](_0x380d('0x2f'));}}else{logger[_0x380d('0xe')](_0x380d('0x30'));_0x590f53=-0x1;}})['then'](function(){return Project[_0x380d('0x31')]();})[_0x380d('0x1c')](function(_0x1b0449){projects=_0x1b0449;return;})['catch'](function(_0x43011f){logger[_0x380d('0x9')]('[LICENSE]',_0x43011f[_0x380d('0xa')]);})[_0x380d('0x32')](function(){var _0x165f72=require(_0x380d('0x33'))(config[_0x380d('0x3')][_0x380d('0xd')],config[_0x380d('0x3')]['ip'],_0x590f53);_0x165f72['on']('error',errorHandler);_0x165f72['on'](_0x380d('0x34'),listeningHandler);_0x165f72['on']('connection',connectionHandler);_0x165f72['on']('close',closeHandler);});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed89=['catch','client','error','message','result'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xed89,0x14b));var _0x9ed8=function(_0x208832,_0x9d6d2b){_0x208832=_0x208832-0x0;var _0x50269d=_0xed89[_0x208832];return _0x50269d;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x9ed8('0x0')]['http']({'port':0x232b});function request(_0x3dd90f,_0x2c53cc){return new BPromise(function(_0x9b1457,_0x1f9d4f){return client['request'](_0x3dd90f,_0x2c53cc)['then'](function(_0x530ea3){if(_0x530ea3[_0x9ed8('0x1')]){return _0x1f9d4f(_0x530ea3[_0x9ed8('0x1')][_0x9ed8('0x2')]);}else{return _0x9b1457(_0x530ea3[_0x9ed8('0x3')]);}})[_0x9ed8('0x4')](function(_0xb5da32){return _0x1f9d4f(_0xb5da32);});});}exports['sendMailMessage']=function(_0x18db5b,_0x211126){return request('SendMail',{'account':_0x18db5b,'message':_0x211126});};
\ No newline at end of file
+var _0x504b=['bluebird','jayson/promise','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x4e85d2,_0x580eb1){var _0x1fece2=function(_0x112727){while(--_0x112727){_0x4e85d2['push'](_0x4e85d2['shift']());}};_0x1fece2(++_0x580eb1);}(_0x504b,0x10e));var _0xb504=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x504b[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xb504('0x0'));var jayson=require(_0xb504('0x1'));var client=jayson['client'][_0xb504('0x2')]({'port':0x232b});function request(_0x3faf74,_0x443897){return new BPromise(function(_0x5edd09,_0x171d2d){return client[_0xb504('0x3')](_0x3faf74,_0x443897)[_0xb504('0x4')](function(_0x300563){if(_0x300563[_0xb504('0x5')]){return _0x171d2d(_0x300563['error']['message']);}else{return _0x5edd09(_0x300563[_0xb504('0x6')]);}})[_0xb504('0x7')](function(_0x3aa00b){return _0x171d2d(_0x3aa00b);});});}exports[_0xb504('0x8')]=function(_0x2fccaa,_0x9d9d04){return request(_0xb504('0x9'),{'account':_0x2fccaa,'message':_0x9d9d04});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x37ed=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','moment','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','clear','vertex','stringify','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','toString','response','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','traverseBFS','agicommand\x20not\x20found'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0x37ed,0xc9));var _0xd37e=function(_0x4d45d6,_0x2c74f0){_0x4d45d6=_0x4d45d6-0x0;var _0x19cd3f=_0x37ed[_0x4d45d6];return _0x19cd3f;};'use strict';var _=require('lodash');var moment=require(_0xd37e('0x0'));var parser=require(_0xd37e('0x1'));var util=require(_0xd37e('0x2'));var logger=require(_0xd37e('0x3'))(_0xd37e('0x4'));var rpc=require(_0xd37e('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xd37e('0x6'));var Vertices=require(_0xd37e('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xd37e('0x8')]()[_0xd37e('0x9')](function(_0x3eb8ed){logger[_0xd37e('0xa')](_0xd37e('0xb'),_0x3eb8ed['stack']);return[];});}function addVertex(_0x3aa801,_0x58eccd,_0x9dcf37){_0x58eccd['agicommand']=_0x9dcf37;if(_0x58eccd[_0xd37e('0xc')]('retry')){_0x58eccd[_0xd37e('0xd')]=parseInt(_0x58eccd[_0xd37e('0xe')],0xa);}_0x3aa801[_0xd37e('0xf')](_[_0xd37e('0x10')](_0x58eccd,_0xd37e('0x11')));}function initGraph(_0x1a9e21,_0x4317bc){var _0x56238c=new Graph();for(var _0x4ebd3f in _0x1a9e21){if(_0x1a9e21['hasOwnProperty'](_0x4ebd3f)){if(_[_0xd37e('0x12')](_0x1a9e21[_0x4ebd3f])){for(var _0x415613=0x0;_0x415613<_0x1a9e21[_0x4ebd3f][_0xd37e('0x13')];_0x415613+=0x1){addVertex(_0x56238c,_0x1a9e21[_0x4ebd3f][_0x415613],_0x4ebd3f);}}else{addVertex(_0x56238c,_0x1a9e21[_0x4ebd3f],_0x4ebd3f);}}}for(var _0x9f9653=0x0;_0x9f9653<_0x4317bc['length'];_0x9f9653+=0x1){if(_0x4317bc[_0x9f9653]['source']&&_0x4317bc[_0x9f9653][_0xd37e('0x14')]){_0x56238c[_0xd37e('0x15')](_0x4317bc[_0x9f9653][_0xd37e('0x16')],_0x4317bc[_0x9f9653]['target'],_0x4317bc[_0x9f9653][_0xd37e('0x17')]);}}return _0x56238c;}function getRoot(_0x422abd){return parser[_0xd37e('0x18')](_0x422abd,{'object':!![]})[_0xd37e('0x19')][_0xd37e('0x1a')];}function inspect(_0x46c5fc){return util[_0xd37e('0x1b')](_0x46c5fc,{'showHidden':![],'depth':null});}function initialize(_0x297d4e,_0x4bb4ca){var _0x5332a9=getRoot(_0x297d4e[_0xd37e('0x1c')]);if(!_0x5332a9||!_0x5332a9[_0xd37e('0x1d')])return;var _0x42b3bb,_0x37d259,_0x1db5e4;logger[_0xd37e('0x1e')](_0xd37e('0x1a'),JSON['stringify'](_0x5332a9,null,0x2));_0x4bb4ca[_0xd37e('0x1f')]=moment()[_0xd37e('0x20')]('YYYY-MM-DD\x20HH:mm:ss');_0x42b3bb=initGraph(_[_0xd37e('0x10')](_0x5332a9,_0xd37e('0x11')),_0x5332a9[_0xd37e('0x11')]);_0x37d259=new Vertices(_0x4bb4ca,rpc,mailRpc);logger[_0xd37e('0x21')](util[_0xd37e('0x20')](_0xd37e('0x22'),_0x4bb4ca['arg_1'],_0x4bb4ca['calleridname'],_0x4bb4ca[_0xd37e('0x23')],_0x4bb4ca[_0xd37e('0x24')],_0x4bb4ca[_0xd37e('0x25')]));_0x42b3bb['traverseBFS'](_0x5332a9[_0xd37e('0x1d')]['id'],function(_0x5a2df2){try{_0x5a2df2=_0x37d259[_0xd37e('0x26')](_0x5a2df2);logger[_0xd37e('0x1e')](_0xd37e('0x27'),JSON[_0xd37e('0x28')](_0x5a2df2,null,0x2));if(_0x5a2df2[_0xd37e('0x29')]===_0xd37e('0x2a')){logger[_0xd37e('0x21')](_0xd37e('0x2b'));_0x4bb4ca['context']=_0x5a2df2[_0xd37e('0x2c')]||_0x4bb4ca[_0xd37e('0x2c')];_0x4bb4ca[_0xd37e('0x2d')]=_0x5a2df2[_0xd37e('0x2d')];_0x4bb4ca[_0xd37e('0x2e')]=_0x5a2df2[_0xd37e('0x2e')]?_0x5a2df2[_0xd37e('0x2e')]-0x1:0x1;return null;}else if(_0x5a2df2&&_0x37d259[_0x5a2df2[_0xd37e('0x29')]]){_0x1db5e4=_0x37d259[_0x5a2df2[_0xd37e('0x29')]](_0x5a2df2);logger[_0xd37e('0x21')]('response',JSON[_0xd37e('0x28')](_0x1db5e4,null,0x2));if(_0x1db5e4&&_0x1db5e4[_0xd37e('0x2f')]===AGI_CODE_SUCCESS&&_0x1db5e4[_0xd37e('0x30')]!==AGI_RESULT_ERROR&&!_0x4bb4ca[_0xd37e('0x31')]){logger[_0xd37e('0x1e')]('response',inspect(_0x1db5e4));return _['isUndefined'](_0x1db5e4[_0xd37e('0x30')])?null:_0x1db5e4[_0xd37e('0x30')][_0xd37e('0x32')]();}else{logger['error'](_0xd37e('0x33'),inspect(_0x1db5e4));return null;}}else{logger[_0xd37e('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x23e0e8){logger[_0xd37e('0xa')](_0x23e0e8[_0xd37e('0x34')]);return null;}});if(_0x5332a9[_0xd37e('0x35')]){logger['info'](util[_0xd37e('0x20')](_0xd37e('0x36'),_0x4bb4ca[_0xd37e('0x37')],_0x4bb4ca[_0xd37e('0x38')],_0x4bb4ca[_0xd37e('0x23')],_0x4bb4ca[_0xd37e('0x24')],_0x4bb4ca[_0xd37e('0x25')]));_0x42b3bb[_0xd37e('0x39')](_0x5332a9[_0xd37e('0x35')]['id'],function(_0x2b05f4){try{_0x2b05f4=_0x37d259['clear'](_0x2b05f4);logger[_0xd37e('0x1e')](_0xd37e('0x27'),JSON['stringify'](_0x2b05f4,null,0x2));if(_0x2b05f4&&_0x37d259[_0x2b05f4['agicommand']]){_0x1db5e4=_0x37d259[_0x2b05f4[_0xd37e('0x29')]](_0x2b05f4);if(_0x1db5e4){logger['debug'](_0xd37e('0x33'),inspect(_0x1db5e4));return _['isUndefined'](_0x1db5e4[_0xd37e('0x30')])?null:_0x1db5e4[_0xd37e('0x30')][_0xd37e('0x32')]();}else{logger[_0xd37e('0xa')](_0xd37e('0x33'),inspect(_0x1db5e4));return null;}}else{logger[_0xd37e('0xa')](_0xd37e('0x3a'));return null;}}catch(_0x4a744c){logger[_0xd37e('0xa')](_0x4a744c[_0xd37e('0x34')]);return null;}});}logger['info'](util['format'](_0xd37e('0x3b'),_0x4bb4ca['arg_1'],_0x4bb4ca[_0xd37e('0x38')],_0x4bb4ca[_0xd37e('0x23')],_0x4bb4ca[_0xd37e('0x24')],_0x4bb4ca[_0xd37e('0x25')]));logger[_0xd37e('0x21')](util['format'](_0xd37e('0x3c'),_0x4bb4ca['context'],_0x4bb4ca[_0xd37e('0x2d')],parseInt(_0x4bb4ca[_0xd37e('0x2e')],0xa)+0x1));_0x4bb4ca[_0xd37e('0x3d')](_0x4bb4ca['context'],_0x4bb4ca['extension'],parseInt(_0x4bb4ca[_0xd37e('0x2e')],0xa)+0x1);_0x4bb4ca['close']();}function handleNotFound(_0x96fefc){logger[_0xd37e('0xa')](util[_0xd37e('0x20')](_0xd37e('0x3e'),_0x96fefc[_0xd37e('0x37')]));_0x96fefc['continueAt'](_0x96fefc[_0xd37e('0x2c')],_0x96fefc[_0xd37e('0x2d')],parseInt(_0x96fefc[_0xd37e('0x2e')],0xa)+0x1);_0x96fefc[_0xd37e('0x3f')]();}function handleUnpublished(_0x264b2a){logger[_0xd37e('0xa')](util[_0xd37e('0x20')](_0xd37e('0x40'),_0x264b2a[_0xd37e('0x37')]));_0x264b2a[_0xd37e('0x3d')](_0x264b2a['context'],_0x264b2a[_0xd37e('0x2d')],parseInt(_0x264b2a[_0xd37e('0x2e')],0xa)+0x1);_0x264b2a['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x54c5=['calleridname','callerid','uniqueid','traverseBFS','start','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','addVertex','omit','length','source','target','addEdge','value','mxGraphModel','root','inspect','production','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','arg_1'];(function(_0x3ec6bd,_0x336b61){var _0x17a824=function(_0x341f6f){while(--_0x341f6f){_0x3ec6bd['push'](_0x3ec6bd['shift']());}};_0x17a824(++_0x336b61);}(_0x54c5,0x92));var _0x554c=function(_0xb5ac99,_0x166f89){_0xb5ac99=_0xb5ac99-0x0;var _0x290cce=_0x54c5[_0xb5ac99];return _0x290cce;};'use strict';var _=require(_0x554c('0x0'));var moment=require(_0x554c('0x1'));var parser=require('xml2json');var util=require(_0x554c('0x2'));var logger=require(_0x554c('0x3'))('agi');var rpc=require(_0x554c('0x4'));var mailRpc=require(_0x554c('0x5'));var Graph=require(_0x554c('0x6'));var Vertices=require(_0x554c('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x554c('0x8')]()['catch'](function(_0x461bcb){logger['error'](_0x554c('0x9'),_0x461bcb['stack']);return[];});}function addVertex(_0x54267a,_0xd55981,_0x3b5c7f){_0xd55981[_0x554c('0xa')]=_0x3b5c7f;if(_0xd55981[_0x554c('0xb')]('retry')){_0xd55981['maxRetry']=parseInt(_0xd55981['retry'],0xa);}_0x54267a[_0x554c('0xc')](_[_0x554c('0xd')](_0xd55981,'mxCell'));}function initGraph(_0x26be47,_0x5f0904){var _0x29623d=new Graph();for(var _0x4275e2 in _0x26be47){if(_0x26be47['hasOwnProperty'](_0x4275e2)){if(_['isArray'](_0x26be47[_0x4275e2])){for(var _0x97b7b3=0x0;_0x97b7b3<_0x26be47[_0x4275e2]['length'];_0x97b7b3+=0x1){addVertex(_0x29623d,_0x26be47[_0x4275e2][_0x97b7b3],_0x4275e2);}}else{addVertex(_0x29623d,_0x26be47[_0x4275e2],_0x4275e2);}}}for(var _0xf00387=0x0;_0xf00387<_0x5f0904[_0x554c('0xe')];_0xf00387+=0x1){if(_0x5f0904[_0xf00387][_0x554c('0xf')]&&_0x5f0904[_0xf00387][_0x554c('0x10')]){_0x29623d[_0x554c('0x11')](_0x5f0904[_0xf00387][_0x554c('0xf')],_0x5f0904[_0xf00387][_0x554c('0x10')],_0x5f0904[_0xf00387][_0x554c('0x12')]);}}return _0x29623d;}function getRoot(_0x2480ca){return parser['toJson'](_0x2480ca,{'object':!![]})[_0x554c('0x13')][_0x554c('0x14')];}function inspect(_0x2be5ce){return util[_0x554c('0x15')](_0x2be5ce,{'showHidden':![],'depth':null});}function initialize(_0x35517c,_0x49dc14){var _0x26c99f=getRoot(_0x35517c[_0x554c('0x16')]);if(!_0x26c99f||!_0x26c99f['start'])return;var _0x508c32,_0x567794,_0x4fdb37;logger[_0x554c('0x17')](_0x554c('0x14'),JSON[_0x554c('0x18')](_0x26c99f,null,0x2));_0x49dc14[_0x554c('0x19')]=moment()[_0x554c('0x1a')](_0x554c('0x1b'));_0x508c32=initGraph(_[_0x554c('0xd')](_0x26c99f,_0x554c('0x1c')),_0x26c99f[_0x554c('0x1c')]);_0x567794=new Vertices(_0x49dc14,rpc,mailRpc);logger[_0x554c('0x1d')](util[_0x554c('0x1a')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49dc14[_0x554c('0x1e')],_0x49dc14[_0x554c('0x1f')],_0x49dc14[_0x554c('0x20')],_0x49dc14['dnid'],_0x49dc14[_0x554c('0x21')]));_0x508c32[_0x554c('0x22')](_0x26c99f[_0x554c('0x23')]['id'],function(_0xb9ea66){try{_0xb9ea66=_0x567794['clear'](_0xb9ea66);logger['debug'](_0x554c('0x24'),JSON['stringify'](_0xb9ea66,null,0x2));if(_0xb9ea66[_0x554c('0xa')]===_0x554c('0x25')){logger[_0x554c('0x1d')](_0x554c('0x26'));_0x49dc14[_0x554c('0x27')]=_0xb9ea66[_0x554c('0x27')]||_0x49dc14[_0x554c('0x27')];_0x49dc14[_0x554c('0x28')]=_0xb9ea66['extension'];_0x49dc14[_0x554c('0x29')]=_0xb9ea66['priority']?_0xb9ea66[_0x554c('0x29')]-0x1:0x1;return null;}else if(_0xb9ea66&&_0x567794[_0xb9ea66[_0x554c('0xa')]]){_0x4fdb37=_0x567794[_0xb9ea66[_0x554c('0xa')]](_0xb9ea66);logger[_0x554c('0x1d')](_0x554c('0x2a'),JSON['stringify'](_0x4fdb37,null,0x2));if(_0x4fdb37&&_0x4fdb37[_0x554c('0x2b')]===AGI_CODE_SUCCESS&&_0x4fdb37['result']!==AGI_RESULT_ERROR&&!_0x49dc14[_0x554c('0x2c')]){logger['debug']('response',inspect(_0x4fdb37));return _[_0x554c('0x2d')](_0x4fdb37[_0x554c('0x2e')])?null:_0x4fdb37[_0x554c('0x2e')][_0x554c('0x2f')]();}else{logger[_0x554c('0x30')](_0x554c('0x2a'),inspect(_0x4fdb37));return null;}}else{logger['error'](_0x554c('0x31'));return null;}}catch(_0x425595){logger[_0x554c('0x30')](_0x425595['stack']);return null;}});if(_0x26c99f[_0x554c('0x32')]){logger[_0x554c('0x1d')](util[_0x554c('0x1a')](_0x554c('0x33'),_0x49dc14[_0x554c('0x1e')],_0x49dc14[_0x554c('0x1f')],_0x49dc14[_0x554c('0x20')],_0x49dc14['dnid'],_0x49dc14['uniqueid']));_0x508c32[_0x554c('0x22')](_0x26c99f['finally']['id'],function(_0x4bac81){try{_0x4bac81=_0x567794[_0x554c('0x34')](_0x4bac81);logger[_0x554c('0x17')](_0x554c('0x24'),JSON[_0x554c('0x18')](_0x4bac81,null,0x2));if(_0x4bac81&&_0x567794[_0x4bac81[_0x554c('0xa')]]){_0x4fdb37=_0x567794[_0x4bac81[_0x554c('0xa')]](_0x4bac81);if(_0x4fdb37){logger['debug']('response',inspect(_0x4fdb37));return _['isUndefined'](_0x4fdb37[_0x554c('0x2e')])?null:_0x4fdb37[_0x554c('0x2e')][_0x554c('0x2f')]();}else{logger['error'](_0x554c('0x2a'),inspect(_0x4fdb37));return null;}}else{logger[_0x554c('0x30')]('agicommand\x20not\x20found');return null;}}catch(_0x3dc22b){logger['error'](_0x3dc22b['stack']);return null;}});}logger[_0x554c('0x1d')](util[_0x554c('0x1a')](_0x554c('0x35'),_0x49dc14['arg_1'],_0x49dc14[_0x554c('0x1f')],_0x49dc14[_0x554c('0x20')],_0x49dc14['dnid'],_0x49dc14['uniqueid']));logger[_0x554c('0x1d')](util[_0x554c('0x1a')](_0x554c('0x36'),_0x49dc14[_0x554c('0x27')],_0x49dc14[_0x554c('0x28')],parseInt(_0x49dc14[_0x554c('0x29')],0xa)+0x1));_0x49dc14[_0x554c('0x37')](_0x49dc14[_0x554c('0x27')],_0x49dc14[_0x554c('0x28')],parseInt(_0x49dc14[_0x554c('0x29')],0xa)+0x1);_0x49dc14[_0x554c('0x38')]();}function handleNotFound(_0x179b09){logger[_0x554c('0x30')](util[_0x554c('0x1a')]('Project\x20%s\x20not\x20found',_0x179b09[_0x554c('0x1e')]));_0x179b09[_0x554c('0x37')](_0x179b09[_0x554c('0x27')],_0x179b09[_0x554c('0x28')],parseInt(_0x179b09['priority'],0xa)+0x1);_0x179b09[_0x554c('0x38')]();}function handleUnpublished(_0x2847fa){logger['error'](util[_0x554c('0x1a')](_0x554c('0x39'),_0x2847fa[_0x554c('0x1e')]));_0x2847fa[_0x554c('0x37')](_0x2847fa[_0x554c('0x27')],_0x2847fa[_0x554c('0x28')],parseInt(_0x2847fa['priority'],0xa)+0x1);_0x2847fa['close']();}module[_0x554c('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa56c=['indexOf','substring','slice','trim','length','emit','exports','util','stream','call','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa56c,0x1f4));var _0xca56=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa56c[_0x4a53d];return _0x27410e;};'use strict';var util=require(_0xca56('0x0'));var Transform=require(_0xca56('0x1'))['Transform'];function AGIReply(_0x2a42f7){Transform[_0xca56('0x2')](this,_0x2a42f7);this[_0xca56('0x3')]='';this['_inBody']=![];}util[_0xca56('0x4')](AGIReply,Transform);AGIReply[_0xca56('0x5')][_0xca56('0x6')]=function(_0x1c26f8,_0x1b2815,_0x613e75){var _0x5d2108='\x0a',_0x3366cc=['\x0a\x0a',_0xca56('0x7')],_0xc289c0=-0x1,_0x180774=-0x1,_0x35b267='',_0x3367e9=0x0,_0x595822='',_0x4f76d3='';this['_localBuffer']+=_0x1c26f8[_0xca56('0x8')]();_0x595822=this[_0xca56('0x3')];if(!this[_0xca56('0x9')]){_0x3367e9=0x0;while(_0x3366cc[_0x3367e9]){while((_0x180774=_0x595822[_0xca56('0xa')](_0x3366cc[_0x3367e9]))!=-0x1){_0x35b267=_0x3366cc[_0x3367e9];_0x4f76d3=_0x595822[_0xca56('0xb')](0x0,_0x180774);_0x595822=_0x595822[_0xca56('0xb')](_0x180774+_0x35b267['length']);var _0x2a74b9=_0x4f76d3['split'](_0x5d2108),_0x342790=0x0,_0x1c3ada={},_0x1ebd30='',_0x580ca7='',_0xcddbc3=-0x1;while(_0x2a74b9[_0x342790]){_0xcddbc3=_0x2a74b9[_0x342790][_0xca56('0xa')](':');if(_0xcddbc3!=-0x1){_0x1ebd30=_0x2a74b9[_0x342790][_0xca56('0xc')](0x0,_0xcddbc3)[_0xca56('0xd')]();_0x580ca7=_0x2a74b9[_0x342790]['slice'](_0xcddbc3+0x1)[_0xca56('0xd')]();if(_0x1ebd30[_0xca56('0xe')]>0x0){_0x1c3ada[_0x1ebd30]=_0x580ca7;}}else{}_0x342790++;}this[_0xca56('0xf')]('headers',_0x1c3ada);this['_inBody']=!![];}_0x3367e9++;}this[_0xca56('0x3')]=_0x595822;}else{while((_0xc289c0=_0x595822[_0xca56('0xa')](_0x5d2108))!=-0x1){_0x4f76d3=_0x595822[_0xca56('0xb')](0x0,_0xc289c0);this[_0xca56('0xf')]('line',_0x4f76d3);_0x595822=_0x595822[_0xca56('0xb')](_0xc289c0+_0x5d2108[_0xca56('0xe')]);}this[_0xca56('0x3')]=_0x595822;}_0x613e75();};module[_0xca56('0x10')]=AGIReply;
\ No newline at end of file
+var _0x925a=['stream','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x925a,0x109));var _0xa925=function(_0x3c5203,_0x63fb03){_0x3c5203=_0x3c5203-0x0;var _0x46c93e=_0x925a[_0x3c5203];return _0x46c93e;};'use strict';var util=require(_0xa925('0x0'));var Transform=require(_0xa925('0x1'))['Transform'];function AGIReply(_0xe25356){Transform[_0xa925('0x2')](this,_0xe25356);this[_0xa925('0x3')]='';this[_0xa925('0x4')]=![];}util[_0xa925('0x5')](AGIReply,Transform);AGIReply[_0xa925('0x6')][_0xa925('0x7')]=function(_0x4ada30,_0x4b27cb,_0x352937){var _0x110e7c='\x0a',_0x5d3fbb=['\x0a\x0a',_0xa925('0x8')],_0x1191d5=-0x1,_0x49f8b4=-0x1,_0x5352aa='',_0x59caab=0x0,_0x811ee2='',_0x27efe5='';this[_0xa925('0x3')]+=_0x4ada30['toString']();_0x811ee2=this['_localBuffer'];if(!this['_inBody']){_0x59caab=0x0;while(_0x5d3fbb[_0x59caab]){while((_0x49f8b4=_0x811ee2[_0xa925('0x9')](_0x5d3fbb[_0x59caab]))!=-0x1){_0x5352aa=_0x5d3fbb[_0x59caab];_0x27efe5=_0x811ee2[_0xa925('0xa')](0x0,_0x49f8b4);_0x811ee2=_0x811ee2[_0xa925('0xa')](_0x49f8b4+_0x5352aa[_0xa925('0xb')]);var _0x57c05f=_0x27efe5[_0xa925('0xc')](_0x110e7c),_0x484133=0x0,_0x25b48e={},_0x241bdc='',_0x20221b='',_0x471aea=-0x1;while(_0x57c05f[_0x484133]){_0x471aea=_0x57c05f[_0x484133]['indexOf'](':');if(_0x471aea!=-0x1){_0x241bdc=_0x57c05f[_0x484133][_0xa925('0xd')](0x0,_0x471aea)[_0xa925('0xe')]();_0x20221b=_0x57c05f[_0x484133][_0xa925('0xd')](_0x471aea+0x1)[_0xa925('0xe')]();if(_0x241bdc[_0xa925('0xb')]>0x0){_0x25b48e[_0x241bdc]=_0x20221b;}}else{}_0x484133++;}this[_0xa925('0xf')](_0xa925('0x10'),_0x25b48e);this[_0xa925('0x4')]=!![];}_0x59caab++;}this[_0xa925('0x3')]=_0x811ee2;}else{while((_0x1191d5=_0x811ee2[_0xa925('0x9')](_0x110e7c))!=-0x1){_0x27efe5=_0x811ee2[_0xa925('0xa')](0x0,_0x1191d5);this[_0xa925('0xf')](_0xa925('0x11'),_0x27efe5);_0x811ee2=_0x811ee2[_0xa925('0xa')](_0x1191d5+_0x110e7c[_0xa925('0xb')]);}this[_0xa925('0x3')]=_0x811ee2;}_0x352937();};module[_0xa925('0x12')]=AGIReply;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9de3=['ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','result','catch','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareMessage','createCmContact','ShowCmHopper'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x9de3,0xea));var _0x39de=function(_0x28873c,_0x19359b){_0x28873c=_0x28873c-0x0;var _0x709671=_0x9de3[_0x28873c];return _0x709671;};'use strict';var _=require(_0x39de('0x0'));var moment=require('moment');var jayson=require(_0x39de('0x1'));var client=jayson[_0x39de('0x2')][_0x39de('0x3')]({'port':0x2329});function request(_0x4f43f9,_0x3c8483){return new Promise(function(_0x515fba,_0x1010da){return client[_0x39de('0x4')](_0x4f43f9,_0x3c8483)[_0x39de('0x5')](function(_0x1d59d6){if(_0x1d59d6['error']){return _0x1010da(_0x1d59d6[_0x39de('0x6')][_0x39de('0x7')]);}else{return _0x515fba(_0x1d59d6[_0x39de('0x8')]);}})[_0x39de('0x9')](function(_0x2604fa){return _0x1010da(_0x2604fa);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x39de('0xa')]}});};exports[_0x39de('0xb')]=function(_0x3e92d9){return request(_0x39de('0xc'),{'options':{'raw':![],'where':{'name':_0x3e92d9},'attributes':[_0x39de('0xa')]}});};exports[_0x39de('0xd')]=function(_0x431b4a){return request(_0x39de('0xe'),{'options':{'raw':![],'where':{'id':_0x431b4a},'include':[{'model':'MailServerOut','as':_0x39de('0xf'),'include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id',_0x39de('0x10'),_0x39de('0x11')],'smtp':!![]}});};exports[_0x39de('0x12')]=function(_0x494764){return request(_0x39de('0xc'),{'options':{'where':{'id':_0x494764},'attributes':[_0x39de('0x10')]}});};exports[_0x39de('0x13')]=function(_0x905132){return request(_0x39de('0x14'),{'options':{'where':{'id':_0x905132},'attributes':[_0x39de('0x10')]}});};exports[_0x39de('0x15')]=function(_0x25ca17){return request(_0x39de('0x16'),{'options':{'where':{'id':_0x25ca17},'attributes':[_0x39de('0x10')]}});};exports['getSquareOdbcById']=function(_0x1f36e0){return request(_0x39de('0x17'),{'options':{'where':{'id':_0x1f36e0},'attributes':[_0x39de('0x18')]}});};exports[_0x39de('0x19')]=function(_0x493200){return request('ShowUser',{'options':{'where':{'id':_0x493200},'attributes':[_0x39de('0x10')]}});};exports['getContactByPhone']=function(_0x1fb6fa){return request(_0x39de('0x1a'),{'options':{'where':{'phone':_0x1fb6fa['phone']},'attributes':['id']}});};exports[_0x39de('0x1b')]=function(_0x5dcb96){return request(_0x39de('0x1c'),{'options':{'where':{'id':_0x5dcb96},'attributes':[_0x39de('0x10')]}});};exports['getSoundById']=function(_0x5d34dd){return request(_0x39de('0x1d'),{'options':{'where':{'id':_0x5d34dd},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x315e4a){return request(_0x39de('0x1e'),{'options':{'raw':![],'where':{'id':_0x315e4a},'include':[{'model':_0x39de('0x1f'),'as':_0x39de('0x20')}]}});};exports[_0x39de('0x21')]=function(_0x10c0fc){return request('ShowSmsAccount',{'options':{'where':{'id':_0x10c0fc},'attributes':['id',_0x39de('0x10')]}});};exports[_0x39de('0x22')]=function(_0x45abce){return request('CreateSmsMessage',{'body':_0x45abce});};exports[_0x39de('0x23')]=function(_0x483d49){return request(_0x39de('0x24'),{'body':_0x483d49});};exports[_0x39de('0x25')]=function(_0x30c3e3){return request(_0x39de('0x26'),{'body':_[_0x39de('0x27')](_0x30c3e3,{'project_name':_0x30c3e3['arg_1'],'prev_project_name':_0x30c3e3[_0x39de('0x28')]||'','is_subproject':_0x30c3e3[_0x39de('0x28')]?!![]:![],'leaveAt':moment()[_0x39de('0x29')](_0x39de('0x2a'))})});};exports['createSquareRecording']=function(_0x3fd91a){return request('CreateSquareRecording',{'body':_0x3fd91a});};exports['createSquareMessage']=function(_0x17d876){return request(_0x39de('0x2b'),{'body':_0x17d876});};exports[_0x39de('0x2c')]=function(_0x3ff4d8){return request(_0x39de('0x2d'),{'options':{'raw':![],'where':{'phone':_0x3ff4d8['phone'],'ListId':_0x3ff4d8[_0x39de('0x2e')]}}})[_0x39de('0x5')](function(_0x46dfd2){if(_0x46dfd2){return _0x46dfd2;}return request(_0x39de('0x2f'),{'body':_0x3ff4d8});});};exports[_0x39de('0x30')]=function(_0x2db103){return request(_0x39de('0x31'),{'options':{'where':{'id':_0x2db103},'attributes':['name']}});};exports[_0x39de('0x32')]=function(_0x2ca57d,_0x3760c7){return request(_0x39de('0x33'),{'body':{'interface':_0x3760c7},'options':{'where':_0x2ca57d}});};exports['agentPause']=function(_0x44df77,_0x3d6562,_0x410d9e){return request(_0x39de('0x34'),{'body':{'type':_0x3d6562,'uniqueid':_0x410d9e},'options':{'where':_0x44df77}});};exports['agentUnpause']=function(_0x184ea6){return request(_0x39de('0x35'),{'body':{},'options':{'where':_0x184ea6}});};exports[_0x39de('0x36')]=function(_0x363eff){return request(_0x39de('0x37'),{'body':{},'options':{'where':_0x363eff}});};
\ No newline at end of file
+var _0xca66=['getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','then','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','lodash','client','http','request','error','message','result','catch','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xca66,0x8b));var _0x6ca6=function(_0x2b4147,_0x361a){_0x2b4147=_0x2b4147-0x0;var _0x2c2827=_0xca66[_0x2b4147];return _0x2c2827;};'use strict';var _=require(_0x6ca6('0x0'));var moment=require('moment');var jayson=require('jayson/promise');var client=jayson[_0x6ca6('0x1')][_0x6ca6('0x2')]({'port':0x2329});function request(_0x44d1de,_0x571335){return new Promise(function(_0x3c03b2,_0x4b1a10){return client[_0x6ca6('0x3')](_0x44d1de,_0x571335)['then'](function(_0x2e886d){if(_0x2e886d[_0x6ca6('0x4')]){return _0x4b1a10(_0x2e886d[_0x6ca6('0x4')][_0x6ca6('0x5')]);}else{return _0x3c03b2(_0x2e886d[_0x6ca6('0x6')]);}})[_0x6ca6('0x7')](function(_0x27d280){return _0x4b1a10(_0x27d280);});});}exports['getSquareProjects']=function(){return request(_0x6ca6('0x8'),{'options':{'raw':![],'attributes':['id',_0x6ca6('0x9'),_0x6ca6('0xa')]}});};exports[_0x6ca6('0xb')]=function(_0x231f4c){return request(_0x6ca6('0xc'),{'options':{'raw':![],'where':{'name':_0x231f4c},'attributes':[_0x6ca6('0xa')]}});};exports['getMailAccountById']=function(_0x38678e){return request(_0x6ca6('0xd'),{'options':{'raw':![],'where':{'id':_0x38678e},'include':[{'model':_0x6ca6('0xe'),'as':_0x6ca6('0xf'),'include':[{'model':_0x6ca6('0x10'),'as':_0x6ca6('0x10')}]}],'attributes':['id','name',_0x6ca6('0x11')],'smtp':!![]}});};exports[_0x6ca6('0x12')]=function(_0x55238b){return request(_0x6ca6('0xc'),{'options':{'where':{'id':_0x55238b},'attributes':[_0x6ca6('0x9')]}});};exports[_0x6ca6('0x13')]=function(_0x3570f1){return request(_0x6ca6('0x14'),{'options':{'where':{'id':_0x3570f1},'attributes':[_0x6ca6('0x9')]}});};exports['getVariableById']=function(_0x52c59a){return request('ShowVariable',{'options':{'where':{'id':_0x52c59a},'attributes':[_0x6ca6('0x9')]}});};exports[_0x6ca6('0x15')]=function(_0x260b56){return request(_0x6ca6('0x16'),{'options':{'where':{'id':_0x260b56},'attributes':[_0x6ca6('0x17')]}});};exports[_0x6ca6('0x18')]=function(_0x25dc6c){return request('ShowUser',{'options':{'where':{'id':_0x25dc6c},'attributes':[_0x6ca6('0x9')]}});};exports[_0x6ca6('0x19')]=function(_0xc97f0){return request(_0x6ca6('0x1a'),{'options':{'where':{'phone':_0xc97f0[_0x6ca6('0x1b')]},'attributes':['id']}});};exports[_0x6ca6('0x1c')]=function(_0x16a3d7){return request(_0x6ca6('0x1d'),{'options':{'where':{'id':_0x16a3d7},'attributes':[_0x6ca6('0x9')]}});};exports[_0x6ca6('0x1e')]=function(_0x3c4132){return request('ShowSound',{'options':{'where':{'id':_0x3c4132},'attributes':[_0x6ca6('0x1f')]}});};exports[_0x6ca6('0x20')]=function(_0x38cad4){return request(_0x6ca6('0x21'),{'options':{'raw':![],'where':{'id':_0x38cad4},'include':[{'model':_0x6ca6('0x22'),'as':_0x6ca6('0x23')}]}});};exports['getSmsAccountById']=function(_0xfb962d){return request(_0x6ca6('0x24'),{'options':{'where':{'id':_0xfb962d},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0xfbf496){return request(_0x6ca6('0x25'),{'body':_0xfbf496});};exports[_0x6ca6('0x26')]=function(_0x224a1f){return request(_0x6ca6('0x27'),{'body':_0x224a1f});};exports['createSquareReport']=function(_0x222373){return request(_0x6ca6('0x28'),{'body':_[_0x6ca6('0x29')](_0x222373,{'project_name':_0x222373[_0x6ca6('0x2a')],'prev_project_name':_0x222373[_0x6ca6('0x2b')]||'','is_subproject':_0x222373[_0x6ca6('0x2b')]?!![]:![],'leaveAt':moment()[_0x6ca6('0x2c')](_0x6ca6('0x2d'))})});};exports['createSquareRecording']=function(_0x55b07f){return request(_0x6ca6('0x2e'),{'body':_0x55b07f});};exports[_0x6ca6('0x2f')]=function(_0xf1d821){return request(_0x6ca6('0x30'),{'body':_0xf1d821});};exports['createCmContact']=function(_0x5ea6f7){return request(_0x6ca6('0x31'),{'options':{'raw':![],'where':{'phone':_0x5ea6f7['phone'],'ListId':_0x5ea6f7['ListId']}}})[_0x6ca6('0x32')](function(_0xefd407){if(_0xefd407){return _0xefd407;}return request('CreateCmContact',{'body':_0x5ea6f7});});};exports[_0x6ca6('0x33')]=function(_0xf829ee){return request(_0x6ca6('0x34'),{'options':{'where':{'id':_0xf829ee},'attributes':[_0x6ca6('0x9')]}});};exports['agentLogin']=function(_0x28af50,_0x23112a){return request(_0x6ca6('0x35'),{'body':{'interface':_0x23112a},'options':{'where':_0x28af50}});};exports[_0x6ca6('0x36')]=function(_0x480264,_0x467a89,_0x15b962){return request(_0x6ca6('0x37'),{'body':{'type':_0x467a89,'uniqueid':_0x15b962},'options':{'where':_0x480264}});};exports[_0x6ca6('0x38')]=function(_0x5788a2){return request('UnpauseUser',{'body':{},'options':{'where':_0x5788a2}});};exports['agentLogout']=function(_0x56dd6a){return request('LogoutUser',{'body':{},'options':{'where':_0x56dd6a}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f4a=['./lex','exports','./polly'];(function(_0x490b8a,_0x6e2622){var _0x40769d=function(_0x48fb78){while(--_0x48fb78){_0x490b8a['push'](_0x490b8a['shift']());}};_0x40769d(++_0x6e2622);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2f4a[_0x432682];return _0x463d05;};var polly=require(_0xa2f4('0x0'));var lex=require(_0xa2f4('0x1'));module[_0xa2f4('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x556b=['./polly','./lex','exports'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x556b,0x1d7));var _0xb556=function(_0x17368f,_0xb999a){_0x17368f=_0x17368f-0x0;var _0x3b1110=_0x556b[_0x17368f];return _0x3b1110;};var polly=require(_0xb556('0x0'));var lex=require(_0xb556('0x1'));module[_0xb556('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x668b=['./lib/api','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x668b,0x140));var _0xb668=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x668b[_0x2bf141];return _0x48277b;};'use strict';var lex=require(_0xb668('0x0'));module[_0xb668('0x1')]=function(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83){return lex(_0x51555f,_0x15fbea,_0x2c30c1,_0x49a53b,_0x336ba4,_0x5e2e83);};
\ No newline at end of file
+var _0xb688=['exports'];(function(_0x140c8b,_0x185186){var _0x9acb82=function(_0x15d714){while(--_0x15d714){_0x140c8b['push'](_0x140c8b['shift']());}};_0x9acb82(++_0x185186);}(_0xb688,0xcf));var _0x8b68=function(_0x1a988f,_0x36a897){_0x1a988f=_0x1a988f-0x0;var _0xc2e9f6=_0xb688[_0x1a988f];return _0xc2e9f6;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x391df4,_0x1fbb2f){var _0x39f6f4=function(_0x2a7c32){while(--_0x2a7c32){_0x391df4['push'](_0x391df4['shift']());}};_0x39f6f4(++_0x1fbb2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x518c5a,_0x5e64b0){var _0x1d7131=function(_0x489fab){while(--_0x489fab){_0x518c5a['push'](_0x518c5a['shift']());}};_0x1d7131(++_0x5e64b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0524=['exports'];(function(_0x20ad2f,_0x7f1a9f){var _0x5b0cdb=function(_0x3f34ee){while(--_0x3f34ee){_0x20ad2f['push'](_0x20ad2f['shift']());}};_0x5b0cdb(++_0x7f1a9f);}(_0x0524,0xb5));var _0x4052=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x0524[_0x28b0a4];return _0x105ce6;};'use strict';var polly=require('./lib/api');module[_0x4052('0x0')]=function(_0x1823f4,_0x4f1da9,_0x51d9b0,_0x1d439d,_0x57a030,_0x34b7fe,_0x23d4c7){return polly(_0x1823f4,_0x4f1da9,_0x51d9b0,_0x1d439d,_0x57a030,_0x34b7fe,_0x23d4c7);};
\ No newline at end of file
+var _0xb01a=['./lib/api'];(function(_0x2f1172,_0x5f5b26){var _0x58e374=function(_0x1a61fa){while(--_0x1a61fa){_0x2f1172['push'](_0x2f1172['shift']());}};_0x58e374(++_0x5f5b26);}(_0xb01a,0x8e));var _0xab01=function(_0x67cfa6,_0x528438){_0x67cfa6=_0x67cfa6-0x0;var _0x529112=_0xb01a[_0x67cfa6];return _0x529112;};'use strict';var polly=require(_0xab01('0x0'));module['exports']=function(_0x139394,_0x542f1b,_0x124929,_0xe6b0be,_0x35b035,_0x15e81b,_0x2817f5){return polly(_0x139394,_0x542f1b,_0x124929,_0xe6b0be,_0x35b035,_0x15e81b,_0x2817f5);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x298c=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech'];(function(_0x3d6340,_0x28b4e8){var _0x4a6e7b=function(_0x26ba7d){while(--_0x26ba7d){_0x3d6340['push'](_0x3d6340['shift']());}};_0x4a6e7b(++_0x28b4e8);}(_0x298c,0x1dc));var _0xc298=function(_0x59ff5b,_0x5cd4ca){_0x59ff5b=_0x59ff5b-0x0;var _0x583022=_0x298c[_0x59ff5b];return _0x583022;};'use strict';var fs=require('fs');var path=require(_0xc298('0x0'));var BPromise=require(_0xc298('0x1'));var rs=require(_0xc298('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x593559,_0x23159c,_0x38a2c0){return new BPromise(function(_0x628ee1,_0x4cca66){_0x593559[_0xc298('0x3')](_0x23159c,function(_0x2f0638,_0xe3c3f0){if(_0x2f0638){_0x4cca66(_0x2f0638);}else if(_0xe3c3f0){if(_0xe3c3f0[_0xc298('0x4')]instanceof Buffer){fs[_0xc298('0x5')](_0x38a2c0,_0xe3c3f0[_0xc298('0x4')],function(_0xef09c9){if(_0xef09c9){_0x4cca66(_0xef09c9);}else{_0x628ee1();}});}else{_0x4cca66(new Error(_0xc298('0x6')));}}else{_0x4cca66(new Error(_0xc298('0x7')));}});});}module[_0xc298('0x8')]=function(_0x4df14f,_0x3ddfc0,_0x258b1a,_0x56d631,_0x21e452,_0x17d4ec,_0x285f9e){var _0x41dd49=new AWS[(_0xc298('0x9'))]({'accessKeyId':_0x4df14f,'secretAccessKey':_0x3ddfc0,'region':_0x258b1a});var _0x1cc659={'Text':_0x21e452,'TextType':_0x17d4ec||_0xc298('0xa'),'OutputFormat':_0xc298('0xb'),'VoiceId':_0x56d631};return pollyResult(_0x41dd49,_0x1cc659,_0x285f9e);};
\ No newline at end of file
+var _0x73d7=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','bluebird','randomstring','aws-sdk'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x73d7,0x1c9));var _0x773d=function(_0x2772df,_0x3020c1){_0x2772df=_0x2772df-0x0;var _0x286e3a=_0x73d7[_0x2772df];return _0x286e3a;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x773d('0x0'));var rs=require(_0x773d('0x1'));var AWS=require(_0x773d('0x2'));function pollyResult(_0x9be22b,_0x20fe45,_0x5cff7b){return new BPromise(function(_0x545988,_0x9e6429){_0x9be22b[_0x773d('0x3')](_0x20fe45,function(_0x423850,_0x3983f0){if(_0x423850){_0x9e6429(_0x423850);}else if(_0x3983f0){if(_0x3983f0['AudioStream']instanceof Buffer){fs[_0x773d('0x4')](_0x5cff7b,_0x3983f0[_0x773d('0x5')],function(_0x1d96ce){if(_0x1d96ce){_0x9e6429(_0x1d96ce);}else{_0x545988();}});}else{_0x9e6429(new Error(_0x773d('0x6')));}}else{_0x9e6429(new Error(_0x773d('0x7')));}});});}module[_0x773d('0x8')]=function(_0x150f69,_0x57f49d,_0x50b996,_0xf078c7,_0x31d2c3,_0x467b11,_0x565481){var _0x47db57=new AWS['Polly']({'accessKeyId':_0x150f69,'secretAccessKey':_0x57f49d,'region':_0x50b996});var _0x27ae47={'Text':_0x31d2c3,'TextType':_0x467b11||_0x773d('0x9'),'OutputFormat':'mp3','VoiceId':_0xf078c7};return pollyResult(_0x47db57,_0x27ae47,_0x565481);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5834=['exports','./lib/api'];(function(_0x5de8fa,_0x4665af){var _0x136868=function(_0xf16f59){while(--_0xf16f59){_0x5de8fa['push'](_0x5de8fa['shift']());}};_0x136868(++_0x4665af);}(_0x5834,0x1a1));var _0x4583=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x5834[_0x4b7895];return _0x264180;};'use strict';var asr=require(_0x4583('0x0'));module[_0x4583('0x1')]=function(_0x3168c7,_0x19c65e,_0x188799,_0x43f41e){return asr(_0x3168c7,_0x19c65e,_0x188799);};
\ No newline at end of file
+'use strict';var asr=require('./lib/api');module['exports']=function(_0x10ce9d,_0x3f27e0,_0x8513ed,_0x2f1d24){return asr(_0x10ce9d,_0x3f27e0,_0x8513ed);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35aa=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x16167f,_0x38a605){var _0x187192=function(_0x189b3f){while(--_0x189b3f){_0x16167f['push'](_0x16167f['shift']());}};_0x187192(++_0x38a605);}(_0x35aa,0xbe));var _0xa35a=function(_0x564adf,_0x861a9){_0x564adf=_0x564adf-0x0;var _0x506f27=_0x35aa[_0x564adf];return _0x506f27;};'use strict';var url=require('url');var BPromise=require(_0xa35a('0x0'));var fs=require('fs');var host=_0xa35a('0x1');module[_0xa35a('0x2')]=function(_0x3518ac,_0x5c294c,_0x2e9bcf){return new BPromise(function(_0x4303b4,_0x24cc2){var _0x11f841;if(typeof _0x3518ac!==_0xa35a('0x3')||_0x3518ac[_0xa35a('0x4')]===0x0){return _0x24cc2(_0xa35a('0x5'));}if(typeof _0x5c294c!==_0xa35a('0x3')||_0x5c294c['length']===0x0){return _0x24cc2(_0xa35a('0x6'));}if(typeof _0x2e9bcf!=='undefined'&&(typeof _0x2e9bcf!==_0xa35a('0x3')||_0x2e9bcf[_0xa35a('0x4')]===0x0)){return _0x24cc2(_0xa35a('0x7'));}try{_0x11f841=fs[_0xa35a('0x8')](_0x3518ac)[_0xa35a('0x9')](_0xa35a('0xa'));}catch(_0x48f7f4){return _0x24cc2(_0x48f7f4);}return _0x4303b4({'method':_0xa35a('0xb'),'uri':host+_0xa35a('0xc')+_0x5c294c,'body':{'config':{'encoding':_0xa35a('0xd'),'sampleRateHertz':_0xa35a('0xe'),'languageCode':_0x2e9bcf},'audio':{'content':_0x11f841}},'json':!![]});});};
\ No newline at end of file
+var _0x2750=['/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x2750,0x13b));var _0x0275=function(_0x4b35f9,_0x2d3c83){_0x4b35f9=_0x4b35f9-0x0;var _0x575142=_0x2750[_0x4b35f9];return _0x575142;};'use strict';var url=require(_0x0275('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x0275('0x1');module[_0x0275('0x2')]=function(_0x372744,_0x429a37,_0x101b26){return new BPromise(function(_0x41ec06,_0x20273d){var _0x4960;if(typeof _0x372744!==_0x0275('0x3')||_0x372744[_0x0275('0x4')]===0x0){return _0x20273d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x429a37!==_0x0275('0x3')||_0x429a37[_0x0275('0x4')]===0x0){return _0x20273d(_0x0275('0x5'));}if(typeof _0x101b26!==_0x0275('0x6')&&(typeof _0x101b26!=='string'||_0x101b26[_0x0275('0x4')]===0x0)){return _0x20273d(_0x0275('0x7'));}try{_0x4960=fs[_0x0275('0x8')](_0x372744)['toString']('base64');}catch(_0x224e0f){return _0x20273d(_0x224e0f);}return _0x41ec06({'method':'POST','uri':host+_0x0275('0x9')+_0x429a37,'body':{'config':{'encoding':_0x0275('0xa'),'sampleRateHertz':_0x0275('0xb'),'languageCode':_0x101b26},'audio':{'content':_0x4960}},'json':!![]});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x853d=['./asr','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x853d,0x1c4));var _0xd853=function(_0x1eecf2,_0x5eddc2){_0x1eecf2=_0x1eecf2-0x0;var _0x3e3d86=_0x853d[_0x1eecf2];return _0x3e3d86;};var asr=require(_0xd853('0x0'));module[_0xd853('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xb8c3=['./asr','exports'];(function(_0x502ec7,_0x8e99b3){var _0x362b0f=function(_0x379598){while(--_0x379598){_0x502ec7['push'](_0x502ec7['shift']());}};_0x362b0f(++_0x8e99b3);}(_0xb8c3,0x12e));var _0x3b8c=function(_0x42f23e,_0x221c5d){_0x42f23e=_0x42f23e-0x0;var _0x18ab15=_0xb8c3[_0x42f23e];return _0x18ab15;};var asr=require(_0x3b8c('0x0'));module[_0x3b8c('0x1')]={'asr':asr};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdda3=['replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','md5','path','request-promise','randomstring','url','parse','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','data','transcode','error\x20convert','resolve','tmp','generate','writeFileSync','then','chmodSync','777','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','\x22\x20might\x20not\x20exist','.wav','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2'];(function(_0x121cf3,_0x2e8b1d){var _0x8aa6c9=function(_0xde74e6){while(--_0xde74e6){_0x121cf3['push'](_0x121cf3['shift']());}};_0x8aa6c9(++_0x2e8b1d);}(_0xdda3,0xaa));var _0x3dda=function(_0x13b65c,_0x1aa36f){_0x13b65c=_0x13b65c-0x0;var _0xb7b670=_0xdda3[_0x13b65c];return _0xb7b670;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x3dda('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x3dda('0x1'));var path=require(_0x3dda('0x2'));var querystring=require('querystring');var rp=require(_0x3dda('0x3'));var rs=require(_0x3dda('0x4'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x3dda('0x5'))[_0x3dda('0x6')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0x3dda('0x7'));var tilde=require(_0x3dda('0x8'));var logger=require('../../../config/logger')(_0x3dda('0x9'));var ISPEECH_API=_0x3dda('0xa');function downloadFile(_0x39fd0c,_0x23285a){return new BPromise(function(_0x321742,_0x5f5cee){var _0xb6bb36=urlParse(_0x39fd0c);var _0x4b7832=_0xb6bb36[_0x3dda('0xb')]===_0x3dda('0xc')?https:http;var _0x1724e4={'host':_0xb6bb36['host'],'path':_0xb6bb36[_0x3dda('0x2')],'headers':{'user-agent':_0x3dda('0xd')}};_0x4b7832[_0x3dda('0xe')](_0x1724e4,function(_0x3904a2){if(_0x3904a2[_0x3dda('0xf')]!==0xc8){logger[_0x3dda('0x10')](_0x3dda('0x11')+_0x39fd0c+_0x3dda('0x12')+_0x3904a2[_0x3dda('0xf')]+'\x20('+_0x3904a2['statusMessage']+')');_0x5f5cee(new Error(_0x3dda('0x11')+_0x39fd0c+_0x3dda('0x12')+_0x3904a2[_0x3dda('0xf')]+'\x20('+_0x3904a2[_0x3dda('0x13')]+')'));return;}var _0x142b69=fs[_0x3dda('0x14')](_0x23285a);_0x142b69['on'](_0x3dda('0x15'),function(){logger[_0x3dda('0x16')](_0x3dda('0x17'));_0x142b69[_0x3dda('0x18')](_0x321742);});_0x142b69['on'](_0x3dda('0x10'),function(_0x210ebd){fs[_0x3dda('0x19')](_0x23285a);logger[_0x3dda('0x10')](_0x3dda('0x1a'),_0x210ebd);_0x5f5cee(_0x210ebd);});_0x3904a2[_0x3dda('0x1b')](_0x142b69);})['on'](_0x3dda('0x10'),function(_0x3b324f){logger[_0x3dda('0x10')](_0x3b324f);_0x5f5cee(_0x3b324f);})[_0x3dda('0x1c')]();});}function uploadFile(_0x4243d1){return new BPromise(function(_0xdac27c,_0x182ecd){var _0x27ed05=urlParse(_0x4243d1);var _0x2cf4fd=_0x27ed05[_0x3dda('0xb')]===_0x3dda('0xc')?https:http;var _0x1aba0d={'host':_0x27ed05[_0x3dda('0x1d')],'path':_0x27ed05[_0x3dda('0x2')],'headers':{'user-agent':_0x3dda('0xd')}};_0x2cf4fd[_0x3dda('0xe')](_0x1aba0d,function(_0x1d882e){if(_0x1d882e[_0x3dda('0xf')]!==0xc8){_0x182ecd(new Error(_0x3dda('0x11')+_0x4243d1+_0x3dda('0x12')+_0x1d882e[_0x3dda('0xf')]+'\x20('+_0x1d882e[_0x3dda('0x13')]+')'));return;}var _0x1c2dc5='';_0x1d882e['on'](_0x3dda('0x1e'),function(_0x35db66){_0x1c2dc5+=_0x35db66;});_0x1d882e['on'](_0x3dda('0x1c'),function(){_0xdac27c(_0x1c2dc5);});})['on'](_0x3dda('0x10'),function(_0x1012da){_0x182ecd(_0x1012da);})[_0x3dda('0x1c')]();});}function convertFile(_0x559b1e,_0xbca677){return new BPromise(function(_0x11a440,_0x311276){var _0x5def94=sox[_0x3dda('0x1f')](_0x559b1e,_0xbca677,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5def94['on'](_0x3dda('0x10'),function(_0xcb3d8b){logger[_0x3dda('0x10')](_0x3dda('0x20'),_0xcb3d8b);_0x311276(_0xcb3d8b);});_0x5def94['on'](_0x3dda('0x1c'),function(){logger['info']('finish\x20to\x20convert');_0x11a440();});_0x5def94['start']();});}function base64Decode(_0xae9765,_0x71b881){var _0x2b00d4=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+'.wav');fs[_0x3dda('0x24')](_0x2b00d4,_0xae9765,'base64');return convertFile(_0x2b00d4,_0x71b881)[_0x3dda('0x25')](function(){try{fs[_0x3dda('0x19')](_0x2b00d4);fs[_0x3dda('0x26')](_0x71b881,_0x3dda('0x27'));}catch(_0x36472f){logger[_0x3dda('0x10')](_0x36472f);}return _0x71b881[_0x3dda('0x28')]('.')[0x0];});}function base64Encode(_0x560885){var _0x24dbd5=fs[_0x3dda('0x29')](_0x560885);return new Buffer(_0x24dbd5)['toString'](_0x3dda('0x2a'));}exports[_0x3dda('0x2b')]=function(_0x592ee6,_0x3a4a4f,_0x33f3af,_0x52133d,_0x859a74,_0x4f2f1c){var _0x9af645,_0x402a8f;var _0x513981=_0x3dda('0x2c');var _0x1cc517='?key='+_0x592ee6;var _0x5e28ba={};if(_0x3a4a4f===_0x3dda('0x2d')){_0x5e28ba['input']={'ssml':_0x33f3af};}else{_0x5e28ba[_0x3dda('0x2e')]={'text':_0x33f3af};};_0x5e28ba['voice']={'languageCode':_0x52133d,'ssmlGender':_0x859a74};_0x5e28ba[_0x3dda('0x2f')]={'audioEncoding':_0x3dda('0x30'),'sampleRateHertz':0x1f40};var _0x56ef24={'url':_0x513981+_0x3dda('0x31')+_0x1cc517,'method':_0x3dda('0x32'),'json':!![],'body':_0x5e28ba};return rp(_0x56ef24)[_0x3dda('0x25')](function(_0x68d624){return new BPromise(function(_0x499d65,_0x362d85){_0x9af645=path['resolve'](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x33'));var _0x18fb33=Buffer[_0x3dda('0x34')](_0x68d624[_0x3dda('0x35')],_0x3dda('0x2a'));return fs[_0x3dda('0x36')](_0x9af645,_0x18fb33,function(_0x4f33b){_0x362d85(_0x4f33b);},function(_0x3cd5a3){fs[_0x3dda('0x26')](_0x9af645,_0x3dda('0x27'));_0x499d65(_0x3cd5a3);});});})['then'](function(_0x2c5c22){_0x402a8f=path['resolve'](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+'.wav');return convertFile(_0x9af645,_0x402a8f);})[_0x3dda('0x25')](function(){try{fs['unlink'](_0x9af645);fs[_0x3dda('0x26')](_0x402a8f,'777');}catch(_0x5eeda5){logger['error'](_0x5eeda5);}logger[_0x3dda('0x16')]('googleCloudTTS\x20path',_0x402a8f[_0x3dda('0x28')]('.')[0x0]);return _0x402a8f['split']('.')[0x0];});};exports[_0x3dda('0x37')]=function(_0x1a25ce,_0x34054a){var _0x14b566='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x175085,_0x13321d;var _0xf179f2;var _0x37f7fb={'encoding':_0x3dda('0x38'),'method':'POST','timeout':0x2710,'url':_0x14b566,'headers':{'Content-Type':_0x3dda('0x39')},'body':_0x3dda('0x3a')+encodeURIComponent(JSON['stringify']([[[_0x3dda('0x3b'),JSON[_0x3dda('0x3c')]([_0x1a25ce,_0x34054a||'en',![],_0x3dda('0x3d')]),null,_0x3dda('0x3e')]]]))};return rp(_0x37f7fb)[_0x3dda('0x25')](function(_0x81c09){try{_0xf179f2=eval(_0x81c09[_0x3dda('0x3f')](0x5))[0x0][0x2];}catch(_0x49e607){throw new Error(_0x3dda('0x40')+_0x81c09[_0x3dda('0x1e')]);}if(!_0xf179f2){if(_0x1a25ce['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x34054a+_0x3dda('0x41'));}}try{_0xf179f2=eval(_0xf179f2)[0x0];}catch(_0x53c5ee){throw new Error(_0x3dda('0x40')+res[_0x3dda('0x1e')]);}const _0x2ea7c5=_0xf179f2;_0x175085=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs['generate'](0x4)+_0x3dda('0x33'));fs[_0x3dda('0x24')](_0x175085,_0xf179f2,{'encoding':_0x3dda('0x2a')});_0x13321d=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42'));return convertFile(_0x175085,_0x13321d);})[_0x3dda('0x25')](function(){try{fs[_0x3dda('0x19')](_0x175085);fs[_0x3dda('0x26')](_0x13321d,'777');}catch(_0x3469df){logger['error'](_0x3469df);}logger[_0x3dda('0x16')](_0x3dda('0x43'),_0x13321d[_0x3dda('0x28')]('.')[0x0]);return _0x13321d[_0x3dda('0x28')]('.')[0x0];});};exports[_0x3dda('0x44')]=function(_0x361255,_0x32c801,_0x27ccf9){return google['asr'](_0x361255,_0x32c801,_0x27ccf9)[_0x3dda('0x25')](function(_0x37aaf9){logger[_0x3dda('0x16')](_0x37aaf9['uri']);return rp(_0x37aaf9);})[_0x3dda('0x25')](function(_0x14fe95){var _0x517f76='';var _0x2de923=0x0;try{fs[_0x3dda('0x19')](_0x361255);}catch(_0x3e115a){logger[_0x3dda('0x10')](_0x3e115a);}if(_0x14fe95&&_0x14fe95[_0x3dda('0x45')]){_0x517f76=_0x14fe95[_0x3dda('0x45')][_0x3dda('0x46')](function(_0xbe590a){return _0xbe590a&&_0xbe590a[_0x3dda('0x47')][0x0]&&_0xbe590a[_0x3dda('0x47')][0x0]['transcript']?_0xbe590a[_0x3dda('0x47')][0x0][_0x3dda('0x48')]:'';})[_0x3dda('0x49')]('\x0a');_0x2de923=_0x14fe95['results'][_0x3dda('0x46')](function(_0x26a78f){return _0x26a78f&&_0x26a78f[_0x3dda('0x47')][0x0]&&_0x26a78f[_0x3dda('0x47')][0x0][_0x3dda('0x4a')]?_0x26a78f[_0x3dda('0x47')][0x0][_0x3dda('0x4a')]:0x0;})['join']('\x0a');}logger['info'](_0x3dda('0x4b'),_0x517f76);logger['info'](_0x3dda('0x4c'),_0x2de923);return{'transcript':_0x517f76,'confidence':_0x2de923};})[_0x3dda('0x4d')](function(_0x1281b2){logger[_0x3dda('0x10')]('[%s]\x20%s:%s',_0x1281b2[_0x3dda('0xf')],_0x1281b2['name'],_0x1281b2[_0x3dda('0x4e')]);});};exports['googleDialogflow']=function(_0x58b75f,_0x1eb3fd,_0x259751,_0x2328d0){var _0x2c7308=apiai(_0x1eb3fd,{'language':_0x2328d0||'en'});return _0x2c7308[_0x3dda('0x4f')](_0x259751,{'sessionId':md5(_0x58b75f)})[_0x3dda('0x25')](function(_0xfca36){logger[_0x3dda('0x16')](JSON[_0x3dda('0x3c')](_0xfca36));return{'source':_0xfca36[_0x3dda('0x50')][_0x3dda('0x51')],'resolvedQuery':_0xfca36[_0x3dda('0x50')][_0x3dda('0x52')],'action':_0xfca36[_0x3dda('0x50')]['action'],'actionIncomplete':_0xfca36[_0x3dda('0x50')][_0x3dda('0x53')],'speech':_0xfca36[_0x3dda('0x50')][_0x3dda('0x54')][_0x3dda('0x55')],'score':_0xfca36[_0x3dda('0x50')][_0x3dda('0x56')],'statusCode':_0xfca36['status'][_0x3dda('0x57')],'endConversation':_0xfca36[_0x3dda('0x50')][_0x3dda('0x58')][_0x3dda('0x59')]||![],'isFallbackIntent':_0xfca36[_0x3dda('0x50')][_0x3dda('0x58')][_0x3dda('0x5a')]};});};exports[_0x3dda('0x5b')]=function(_0x41b279,_0x309e09,_0x1796ec,_0x8aae,_0xe9dd95,_0xe5ac94){var _0x37c6d0=_0x8aae[_0x3dda('0x5c')](/\\n/g,'\x0a');var _0x189096={'credentials':{'private_key':_0x37c6d0,'client_email':_0x1796ec}};var _0x555b89=new dialogflow[(_0x3dda('0x5d'))](_0x189096);var _0x5f2459=_0x555b89[_0x3dda('0x5e')](_0x309e09,md5(_0x41b279));var _0x3fdae9={'session':_0x5f2459,'queryInput':{'text':{'text':_0xe9dd95,'languageCode':_0xe5ac94}}};return _0x555b89[_0x3dda('0x5f')](_0x3fdae9)[_0x3dda('0x25')](function(_0x8150f2){if(_0x8150f2&&_0x8150f2['length']){logger[_0x3dda('0x16')](_0x3dda('0x60'),JSON['stringify'](_0x8150f2));var _0x38daf0=_0x8150f2[0x0];if(_0x38daf0){var _0x4e8207={'action':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x62')],'allRequiredParamsPresent':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x63')],'endConversation':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x64')]&&_0x38daf0[_0x3dda('0x61')]['diagnosticInfo'][_0x3dda('0x65')]?_0x38daf0['queryResult'][_0x3dda('0x64')][_0x3dda('0x65')][_0x3dda('0x66')][_0x3dda('0x67')]:![],'fulfillmentText':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x68')],'intentName':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x69')][_0x3dda('0x6a')],'intentDisplayName':_0x38daf0['queryResult'][_0x3dda('0x69')]['displayName'],'isFallbackIntent':_0x38daf0['queryResult'][_0x3dda('0x69')]['isFallback'],'languageCode':_0x38daf0['queryResult'][_0x3dda('0x6b')],'queryText':_0x38daf0[_0x3dda('0x61')]['queryText'],'responseId':_0x38daf0[_0x3dda('0x6c')],'score':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x6d')],'speech':_0x38daf0[_0x3dda('0x61')][_0x3dda('0x68')],'providerResponse':JSON[_0x3dda('0x3c')](_0x8150f2)};return _0x4e8207;}}});};exports[_0x3dda('0x6e')]=function(_0x4249bc,_0x1cf6b4,_0x35b403,_0x1a6cbc){return tilde['asr'](_0x4249bc,_0x1cf6b4,_0x35b403,_0x1a6cbc)['then'](function(_0x48f572){try{fs['unlink'](_0x4249bc);}catch(_0x1e8646){logger[_0x3dda('0x10')](_0x1e8646);}logger[_0x3dda('0x16')](_0x3dda('0x6f'),_0x48f572[_0x3dda('0x48')]);logger[_0x3dda('0x16')](_0x3dda('0x70'),_0x48f572[_0x3dda('0x4a')]);return _0x48f572;});};exports['awsPolly']=function(_0x53b5f8,_0x5f3c52,_0x435150,_0x4fc47b,_0x85afa7,_0x4494da){var _0x2a082c=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x33'));var _0x3decb2;return aws[_0x3dda('0x71')](_0x53b5f8,_0x5f3c52,_0x435150,_0x4fc47b,_0x85afa7,_0x4494da,_0x2a082c)['then'](function(){_0x3decb2=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42'));return convertFile(_0x2a082c,_0x3decb2);})[_0x3dda('0x25')](function(){try{fs[_0x3dda('0x19')](_0x2a082c);fs['chmodSync'](_0x3decb2,'777');}catch(_0x5817fc){logger[_0x3dda('0x10')](_0x5817fc);}return _0x3decb2[_0x3dda('0x28')]('.')[0x0];});};exports[_0x3dda('0x72')]=function(_0x49e104,_0x3d40fd,_0x41801e,_0x153972,_0x5c1fd4,_0x2deb67){return aws[_0x3dda('0x73')](_0x49e104,_0x3d40fd,_0x41801e,_0x153972,_0x5c1fd4,_0x2deb67)[_0x3dda('0x25')](function(_0x3be3d6){logger[_0x3dda('0x16')](JSON[_0x3dda('0x3c')](_0x3be3d6));return _0x3be3d6;});};exports[_0x3dda('0x74')]=function(_0x23e9c0,_0x3f806f,_0xe420e3,_0x3f1962){var _0x24bb66=util[_0x3dda('0x75')](_0x3dda('0x76'),ISPEECH_API,_0x23e9c0,encodeURIComponent(_0x3f806f),_0xe420e3,_0x3f1962);var _0x2aea9b=path['resolve'](__dirname,_0x3dda('0x22'),rs['generate'](0x4)+_0x3dda('0x33'));var _0x2a3bcb;return downloadFile(_0x24bb66,_0x2aea9b)[_0x3dda('0x25')](function(){_0x2a3bcb=path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42'));return convertFile(_0x2aea9b,_0x2a3bcb);})[_0x3dda('0x25')](function(){try{fs['unlink'](_0x2aea9b);fs[_0x3dda('0x26')](_0x2a3bcb,'777');}catch(_0x162495){logger[_0x3dda('0x10')](_0x162495);}return _0x2a3bcb[_0x3dda('0x28')]('.')[0x0];});};exports['ispeechASR']=function(_0x5aab9b,_0x350d7d,_0x72a75,_0x51b1c3){var _0x37b817=util['format'](_0x3dda('0x77'),ISPEECH_API,_0x350d7d,_0x72a75,base64Encode(_0x5aab9b),_0x51b1c3?util[_0x3dda('0x75')](_0x3dda('0x78'),encodeURIComponent(_0x51b1c3)):_0x3dda('0x79'));return uploadFile(_0x37b817)[_0x3dda('0x25')](function(_0x582499){return querystring[_0x3dda('0x6')](_0x582499);});};exports['sestekNDA']=function(_0x3de63a,_0x226e64){return sestek[_0x3dda('0x7a')](_0x3de63a,_0x226e64)['then'](function(_0x23ce36){logger[_0x3dda('0x16')](JSON[_0x3dda('0x3c')](_0x23ce36));var _0xfb9b47={'speech':_0x23ce36[_0x3dda('0x7b')],'action':_0x23ce36[_0x3dda('0x7c')]?_0x23ce36[_0x3dda('0x7c')][_0x3dda('0x7d')]:undefined,'actiondata':_0x23ce36[_0x3dda('0x7c')]?_0x23ce36[_0x3dda('0x7c')][_0x3dda('0x7e')]:undefined};if(_0x23ce36[_0x3dda('0x7c')]&&_0x23ce36[_0x3dda('0x7c')][_0x3dda('0x7f')]){return base64Decode(_0x23ce36[_0x3dda('0x7c')]['AudioFromTts'][_0x3dda('0x80')],path[_0x3dda('0x21')](__dirname,_0x3dda('0x22'),rs[_0x3dda('0x23')](0x4)+_0x3dda('0x42')))[_0x3dda('0x25')](function(_0xee4de6){_0xfb9b47[_0x3dda('0x81')]=_0xee4de6;return _0xfb9b47;});}return _0xfb9b47;});};exports[_0x3dda('0x82')]=function(){return __dirname;};
\ No newline at end of file
+var _0x84fc=['ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','parse','sestekNDA','nda','channelData','CustomAction','CustomActionData','Data','audiofile','dirName','apiai-promise','bluebird','http','md5','path','querystring','request-promise','randomstring','sox','url','util','./aws','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','finish\x20download\x20file','close','error','end','https:','data','wav','info','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','unlink','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','googleASR','asr','uri','map','alternatives','transcript','results','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','actionIncomplete','fulfillment','speech','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','responseId','tildeASR','Tilde\x20ASR\x20confidence','lex'];(function(_0x101c18,_0x6cbef2){var _0x1dbaa4=function(_0x447cf8){while(--_0x447cf8){_0x101c18['push'](_0x101c18['shift']());}};_0x1dbaa4(++_0x6cbef2);}(_0x84fc,0x93));var _0xc84f=function(_0x23e2bb,_0xd82b6d){_0x23e2bb=_0x23e2bb-0x0;var _0x2dd8ed=_0x84fc[_0x23e2bb];return _0x2dd8ed;};'use strict';var apiai=require(_0xc84f('0x0'));var BPromise=require(_0xc84f('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xc84f('0x2'));var https=require('https');var md5=require(_0xc84f('0x3'));var path=require(_0xc84f('0x4'));var querystring=require(_0xc84f('0x5'));var rp=require(_0xc84f('0x6'));var rs=require(_0xc84f('0x7'));var sox=require(_0xc84f('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xc84f('0x9'))['parse'];var util=require(_0xc84f('0xa'));var aws=require(_0xc84f('0xb'));var google=require('./google');var sestek=require(_0xc84f('0xc'));var tilde=require(_0xc84f('0xd'));var logger=require(_0xc84f('0xe'))('agi');var ISPEECH_API=_0xc84f('0xf');function downloadFile(_0x163168,_0x39d16c){return new BPromise(function(_0x10e62e,_0x324b7f){var _0x1e6378=urlParse(_0x163168);var _0x5a3f57=_0x1e6378[_0xc84f('0x10')]==='https:'?https:http;var _0x575426={'host':_0x1e6378[_0xc84f('0x11')],'path':_0x1e6378[_0xc84f('0x4')],'headers':{'user-agent':_0xc84f('0x12')}};_0x5a3f57[_0xc84f('0x13')](_0x575426,function(_0x42ec95){if(_0x42ec95['statusCode']!==0xc8){logger['error'](_0xc84f('0x14')+_0x163168+_0xc84f('0x15')+_0x42ec95[_0xc84f('0x16')]+'\x20('+_0x42ec95[_0xc84f('0x17')]+')');_0x324b7f(new Error('request\x20to\x20'+_0x163168+_0xc84f('0x15')+_0x42ec95[_0xc84f('0x16')]+'\x20('+_0x42ec95[_0xc84f('0x17')]+')'));return;}var _0x27d649=fs['createWriteStream'](_0x39d16c);_0x27d649['on'](_0xc84f('0x18'),function(){logger['info'](_0xc84f('0x19'));_0x27d649[_0xc84f('0x1a')](_0x10e62e);});_0x27d649['on'](_0xc84f('0x1b'),function(_0x1235dd){fs['unlink'](_0x39d16c);logger[_0xc84f('0x1b')]('download\x20error',_0x1235dd);_0x324b7f(_0x1235dd);});_0x42ec95['pipe'](_0x27d649);})['on']('error',function(_0x3841bf){logger[_0xc84f('0x1b')](_0x3841bf);_0x324b7f(_0x3841bf);})[_0xc84f('0x1c')]();});}function uploadFile(_0x4ce7f4){return new BPromise(function(_0x5465c6,_0x4c1a95){var _0x4d9ebb=urlParse(_0x4ce7f4);var _0x3225c3=_0x4d9ebb['protocol']===_0xc84f('0x1d')?https:http;var _0x2cf8a4={'host':_0x4d9ebb[_0xc84f('0x11')],'path':_0x4d9ebb[_0xc84f('0x4')],'headers':{'user-agent':_0xc84f('0x12')}};_0x3225c3[_0xc84f('0x13')](_0x2cf8a4,function(_0x150b56){if(_0x150b56[_0xc84f('0x16')]!==0xc8){_0x4c1a95(new Error(_0xc84f('0x14')+_0x4ce7f4+_0xc84f('0x15')+_0x150b56[_0xc84f('0x16')]+'\x20('+_0x150b56[_0xc84f('0x17')]+')'));return;}var _0x26eabb='';_0x150b56['on'](_0xc84f('0x1e'),function(_0xd8a8a7){_0x26eabb+=_0xd8a8a7;});_0x150b56['on'](_0xc84f('0x1c'),function(){_0x5465c6(_0x26eabb);});})['on'](_0xc84f('0x1b'),function(_0x3270a6){_0x4c1a95(_0x3270a6);})['end']();});}function convertFile(_0x138e15,_0x1163c9){return new BPromise(function(_0x7751b2,_0x23b869){var _0x3aadec=sox['transcode'](_0x138e15,_0x1163c9,{'sampleRate':0x1f40,'format':_0xc84f('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3aadec['on'](_0xc84f('0x1b'),function(_0x35f88b){logger[_0xc84f('0x1b')]('error\x20convert',_0x35f88b);_0x23b869(_0x35f88b);});_0x3aadec['on'](_0xc84f('0x1c'),function(){logger[_0xc84f('0x20')](_0xc84f('0x21'));_0x7751b2();});_0x3aadec[_0xc84f('0x22')]();});}function base64Decode(_0x50b945,_0x575d62){var _0x1e2498=path[_0xc84f('0x23')](__dirname,'tmp',rs[_0xc84f('0x24')](0x4)+_0xc84f('0x25'));fs[_0xc84f('0x26')](_0x1e2498,_0x50b945,'base64');return convertFile(_0x1e2498,_0x575d62)['then'](function(){try{fs[_0xc84f('0x27')](_0x1e2498);fs[_0xc84f('0x28')](_0x575d62,_0xc84f('0x29'));}catch(_0x4d05de){logger[_0xc84f('0x1b')](_0x4d05de);}return _0x575d62[_0xc84f('0x2a')]('.')[0x0];});}function base64Encode(_0x2f9e10){var _0x2b33aa=fs[_0xc84f('0x2b')](_0x2f9e10);return new Buffer(_0x2b33aa)[_0xc84f('0x2c')](_0xc84f('0x2d'));}exports[_0xc84f('0x2e')]=function(_0x59053d,_0x100fbe,_0x22df81,_0x3b5a20,_0x5ee6bc,_0x237b55){var _0x251f38,_0x11f358;var _0x48f427='https://texttospeech.googleapis.com/v1/';var _0x4f81d6=_0xc84f('0x2f')+_0x59053d;var _0x57b9c3={};if(_0x100fbe===_0xc84f('0x30')){_0x57b9c3[_0xc84f('0x31')]={'ssml':_0x22df81};}else{_0x57b9c3[_0xc84f('0x31')]={'text':_0x22df81};};_0x57b9c3[_0xc84f('0x32')]={'languageCode':_0x3b5a20,'ssmlGender':_0x5ee6bc};_0x57b9c3[_0xc84f('0x33')]={'audioEncoding':_0xc84f('0x34'),'sampleRateHertz':0x1f40};var _0x1fd93d={'url':_0x48f427+_0xc84f('0x35')+_0x4f81d6,'method':_0xc84f('0x36'),'json':!![],'body':_0x57b9c3};return rp(_0x1fd93d)['then'](function(_0x4fd0e7){return new BPromise(function(_0x593baf,_0x51ff1d){_0x251f38=path[_0xc84f('0x23')](__dirname,_0xc84f('0x37'),rs[_0xc84f('0x24')](0x4)+_0xc84f('0x38'));var _0x3ae949=Buffer[_0xc84f('0x39')](_0x4fd0e7[_0xc84f('0x3a')],'base64');return fs[_0xc84f('0x3b')](_0x251f38,_0x3ae949,function(_0x12ccd3){_0x51ff1d(_0x12ccd3);},function(_0x340335){fs[_0xc84f('0x28')](_0x251f38,_0xc84f('0x29'));_0x593baf(_0x340335);});});})[_0xc84f('0x3c')](function(_0x2ea4cc){_0x11f358=path['resolve'](__dirname,'tmp',rs[_0xc84f('0x24')](0x4)+_0xc84f('0x25'));return convertFile(_0x251f38,_0x11f358);})[_0xc84f('0x3c')](function(){try{fs[_0xc84f('0x27')](_0x251f38);fs['chmodSync'](_0x11f358,_0xc84f('0x29'));}catch(_0x53ce77){logger[_0xc84f('0x1b')](_0x53ce77);}logger[_0xc84f('0x20')](_0xc84f('0x3d'),_0x11f358['split']('.')[0x0]);return _0x11f358['split']('.')[0x0];});};exports[_0xc84f('0x3e')]=function(_0x54b644,_0x59f9fa){var _0x17f4ea=_0xc84f('0x3f');var _0x22c8ab,_0x143c26;var _0x4bad83;var _0x2fdc04={'encoding':_0xc84f('0x40'),'method':_0xc84f('0x36'),'timeout':0x2710,'url':_0x17f4ea,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xc84f('0x41')+encodeURIComponent(JSON[_0xc84f('0x42')]([[[_0xc84f('0x43'),JSON[_0xc84f('0x42')]([_0x54b644,_0x59f9fa||'en',![],_0xc84f('0x44')]),null,_0xc84f('0x45')]]]))};return rp(_0x2fdc04)[_0xc84f('0x3c')](function(_0x1ea652){try{_0x4bad83=eval(_0x1ea652[_0xc84f('0x46')](0x5))[0x0][0x2];}catch(_0x11f468){throw new Error(_0xc84f('0x47')+_0x1ea652['data']);}if(!_0x4bad83){if(_0x54b644[_0xc84f('0x48')]>0xc8){throw new Error(_0xc84f('0x49'));}else{throw new Error('lang\x20\x22'+_0x59f9fa+_0xc84f('0x4a'));}}try{_0x4bad83=eval(_0x4bad83)[0x0];}catch(_0x36f8f3){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xc84f('0x1e')]);}const _0x2f1860=_0x4bad83;_0x22c8ab=path[_0xc84f('0x23')](__dirname,'tmp',rs[_0xc84f('0x24')](0x4)+_0xc84f('0x38'));fs[_0xc84f('0x26')](_0x22c8ab,_0x4bad83,{'encoding':_0xc84f('0x2d')});_0x143c26=path['resolve'](__dirname,_0xc84f('0x37'),rs[_0xc84f('0x24')](0x4)+_0xc84f('0x25'));return convertFile(_0x22c8ab,_0x143c26);})[_0xc84f('0x3c')](function(){try{fs['unlink'](_0x22c8ab);fs['chmodSync'](_0x143c26,'777');}catch(_0x2d79d6){logger[_0xc84f('0x1b')](_0x2d79d6);}logger[_0xc84f('0x20')]('goggleTTS\x20path',_0x143c26[_0xc84f('0x2a')]('.')[0x0]);return _0x143c26[_0xc84f('0x2a')]('.')[0x0];});};exports[_0xc84f('0x4b')]=function(_0x279923,_0x31f77c,_0x4a78fc){return google[_0xc84f('0x4c')](_0x279923,_0x31f77c,_0x4a78fc)['then'](function(_0x452ebf){logger[_0xc84f('0x20')](_0x452ebf[_0xc84f('0x4d')]);return rp(_0x452ebf);})['then'](function(_0xcba3d1){var _0x545662='';var _0x45d871=0x0;try{fs[_0xc84f('0x27')](_0x279923);}catch(_0x4264f3){logger[_0xc84f('0x1b')](_0x4264f3);}if(_0xcba3d1&&_0xcba3d1['results']){_0x545662=_0xcba3d1['results'][_0xc84f('0x4e')](function(_0x1defe3){return _0x1defe3&&_0x1defe3[_0xc84f('0x4f')][0x0]&&_0x1defe3['alternatives'][0x0][_0xc84f('0x50')]?_0x1defe3['alternatives'][0x0][_0xc84f('0x50')]:'';})['join']('\x0a');_0x45d871=_0xcba3d1[_0xc84f('0x51')][_0xc84f('0x4e')](function(_0x20cd05){return _0x20cd05&&_0x20cd05['alternatives'][0x0]&&_0x20cd05[_0xc84f('0x4f')][0x0]['confidence']?_0x20cd05[_0xc84f('0x4f')][0x0][_0xc84f('0x52')]:0x0;})['join']('\x0a');}logger[_0xc84f('0x20')]('googleASR\x20transcription',_0x545662);logger[_0xc84f('0x20')](_0xc84f('0x53'),_0x45d871);return{'transcript':_0x545662,'confidence':_0x45d871};})[_0xc84f('0x54')](function(_0x154a12){logger['error'](_0xc84f('0x55'),_0x154a12[_0xc84f('0x16')],_0x154a12[_0xc84f('0x56')],_0x154a12[_0xc84f('0x57')]);});};exports[_0xc84f('0x58')]=function(_0x43251d,_0x3e6d3a,_0x4b1f63,_0x46b205){var _0x4930a3=apiai(_0x3e6d3a,{'language':_0x46b205||'en'});return _0x4930a3[_0xc84f('0x59')](_0x4b1f63,{'sessionId':md5(_0x43251d)})['then'](function(_0x492e5f){logger[_0xc84f('0x20')](JSON['stringify'](_0x492e5f));return{'source':_0x492e5f['result'][_0xc84f('0x5a')],'resolvedQuery':_0x492e5f[_0xc84f('0x5b')][_0xc84f('0x5c')],'action':_0x492e5f[_0xc84f('0x5b')]['action'],'actionIncomplete':_0x492e5f[_0xc84f('0x5b')][_0xc84f('0x5d')],'speech':_0x492e5f[_0xc84f('0x5b')][_0xc84f('0x5e')][_0xc84f('0x5f')],'score':_0x492e5f[_0xc84f('0x5b')]['score'],'statusCode':_0x492e5f[_0xc84f('0x60')][_0xc84f('0x61')],'endConversation':_0x492e5f[_0xc84f('0x5b')][_0xc84f('0x62')]['endConversation']||![],'isFallbackIntent':_0x492e5f['result']['metadata'][_0xc84f('0x63')]};});};exports[_0xc84f('0x64')]=function(_0xde0ae7,_0x1f63a4,_0x55309d,_0xa8668,_0x1059f7,_0x5e6209){var _0x528494=_0xa8668['replace'](/\\n/g,'\x0a');var _0x582ad4={'credentials':{'private_key':_0x528494,'client_email':_0x55309d}};var _0x282a1d=new dialogflow[(_0xc84f('0x65'))](_0x582ad4);var _0x1f8cfd=_0x282a1d[_0xc84f('0x66')](_0x1f63a4,md5(_0xde0ae7));var _0x12613a={'session':_0x1f8cfd,'queryInput':{'text':{'text':_0x1059f7,'languageCode':_0x5e6209}}};return _0x282a1d[_0xc84f('0x67')](_0x12613a)[_0xc84f('0x3c')](function(_0x461ba2){if(_0x461ba2&&_0x461ba2[_0xc84f('0x48')]){logger[_0xc84f('0x20')](_0xc84f('0x68'),JSON[_0xc84f('0x42')](_0x461ba2));var _0x94f83f=_0x461ba2[0x0];if(_0x94f83f){var _0x445799={'action':_0x94f83f[_0xc84f('0x69')][_0xc84f('0x6a')],'allRequiredParamsPresent':_0x94f83f['queryResult']['allRequiredParamsPresent'],'endConversation':_0x94f83f['queryResult'][_0xc84f('0x6b')]&&_0x94f83f[_0xc84f('0x69')][_0xc84f('0x6b')][_0xc84f('0x6c')]?_0x94f83f[_0xc84f('0x69')]['diagnosticInfo']['fields'][_0xc84f('0x6d')][_0xc84f('0x6e')]:![],'fulfillmentText':_0x94f83f['queryResult'][_0xc84f('0x6f')],'intentName':_0x94f83f[_0xc84f('0x69')][_0xc84f('0x70')][_0xc84f('0x56')],'intentDisplayName':_0x94f83f[_0xc84f('0x69')]['intent'][_0xc84f('0x71')],'isFallbackIntent':_0x94f83f['queryResult'][_0xc84f('0x70')][_0xc84f('0x72')],'languageCode':_0x94f83f[_0xc84f('0x69')]['languageCode'],'queryText':_0x94f83f[_0xc84f('0x69')]['queryText'],'responseId':_0x94f83f[_0xc84f('0x73')],'score':_0x94f83f[_0xc84f('0x69')]['intentDetectionConfidence'],'speech':_0x94f83f[_0xc84f('0x69')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x461ba2)};return _0x445799;}}});};exports[_0xc84f('0x74')]=function(_0x11486f,_0x31ef04,_0x886223,_0x3ad326){return tilde[_0xc84f('0x4c')](_0x11486f,_0x31ef04,_0x886223,_0x3ad326)['then'](function(_0x2fb715){try{fs['unlink'](_0x11486f);}catch(_0x1c9de8){logger[_0xc84f('0x1b')](_0x1c9de8);}logger[_0xc84f('0x20')]('Tilde\x20ASR\x20transcription',_0x2fb715[_0xc84f('0x50')]);logger[_0xc84f('0x20')](_0xc84f('0x75'),_0x2fb715[_0xc84f('0x52')]);return _0x2fb715;});};exports['awsPolly']=function(_0x1e5629,_0x25f16b,_0x53eb5b,_0x308dfd,_0x361545,_0x683f61){var _0x29ac59=path[_0xc84f('0x23')](__dirname,_0xc84f('0x37'),rs['generate'](0x4)+_0xc84f('0x38'));var _0x227322;return aws['polly'](_0x1e5629,_0x25f16b,_0x53eb5b,_0x308dfd,_0x361545,_0x683f61,_0x29ac59)[_0xc84f('0x3c')](function(){_0x227322=path[_0xc84f('0x23')](__dirname,_0xc84f('0x37'),rs[_0xc84f('0x24')](0x4)+_0xc84f('0x25'));return convertFile(_0x29ac59,_0x227322);})[_0xc84f('0x3c')](function(){try{fs['unlink'](_0x29ac59);fs[_0xc84f('0x28')](_0x227322,_0xc84f('0x29'));}catch(_0x23154c){logger[_0xc84f('0x1b')](_0x23154c);}return _0x227322[_0xc84f('0x2a')]('.')[0x0];});};exports['awsLex']=function(_0x22a6d9,_0x261f31,_0x5c8f6b,_0x5781b0,_0x4dc412,_0x403898){return aws[_0xc84f('0x76')](_0x22a6d9,_0x261f31,_0x5c8f6b,_0x5781b0,_0x4dc412,_0x403898)[_0xc84f('0x3c')](function(_0x4c5ab5){logger[_0xc84f('0x20')](JSON[_0xc84f('0x42')](_0x4c5ab5));return _0x4c5ab5;});};exports[_0xc84f('0x77')]=function(_0x3884ec,_0x157328,_0x9301,_0x4c22d9){var _0xd90edc=util[_0xc84f('0x78')](_0xc84f('0x79'),ISPEECH_API,_0x3884ec,encodeURIComponent(_0x157328),_0x9301,_0x4c22d9);var _0xf95b41=path[_0xc84f('0x23')](__dirname,_0xc84f('0x37'),rs[_0xc84f('0x24')](0x4)+_0xc84f('0x38'));var _0x213a6c;return downloadFile(_0xd90edc,_0xf95b41)[_0xc84f('0x3c')](function(){_0x213a6c=path['resolve'](__dirname,'tmp',rs[_0xc84f('0x24')](0x4)+_0xc84f('0x25'));return convertFile(_0xf95b41,_0x213a6c);})[_0xc84f('0x3c')](function(){try{fs[_0xc84f('0x27')](_0xf95b41);fs[_0xc84f('0x28')](_0x213a6c,'777');}catch(_0x2e0f49){logger[_0xc84f('0x1b')](_0x2e0f49);}return _0x213a6c[_0xc84f('0x2a')]('.')[0x0];});};exports[_0xc84f('0x7a')]=function(_0x38c903,_0x3fae1f,_0x1a51fb,_0x2464b0){var _0x2d54c1=util[_0xc84f('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3fae1f,_0x1a51fb,base64Encode(_0x38c903),_0x2464b0?util[_0xc84f('0x78')](_0xc84f('0x7b'),encodeURIComponent(_0x2464b0)):'freeform=3');return uploadFile(_0x2d54c1)[_0xc84f('0x3c')](function(_0x47b253){return querystring[_0xc84f('0x7c')](_0x47b253);});};exports[_0xc84f('0x7d')]=function(_0x14d94b,_0x1881ef){return sestek[_0xc84f('0x7e')](_0x14d94b,_0x1881ef)[_0xc84f('0x3c')](function(_0x379e29){logger[_0xc84f('0x20')](JSON['stringify'](_0x379e29));var _0x2dc140={'speech':_0x379e29['text'],'action':_0x379e29['channelData']?_0x379e29[_0xc84f('0x7f')][_0xc84f('0x80')]:undefined,'actiondata':_0x379e29[_0xc84f('0x7f')]?_0x379e29[_0xc84f('0x7f')][_0xc84f('0x81')]:undefined};if(_0x379e29[_0xc84f('0x7f')]&&_0x379e29['channelData']['AudioFromTts']){return base64Decode(_0x379e29[_0xc84f('0x7f')]['AudioFromTts'][_0xc84f('0x82')],path[_0xc84f('0x23')](__dirname,_0xc84f('0x37'),rs[_0xc84f('0x24')](0x4)+_0xc84f('0x25')))[_0xc84f('0x3c')](function(_0x884a1f){_0x2dc140[_0xc84f('0x83')]=_0x884a1f;return _0x2dc140;});}return _0x2dc140;});};exports[_0xc84f('0x84')]=function(){return __dirname;};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79b1=['./nda','exports'];(function(_0x35c577,_0x1c7f6e){var _0xb58a85=function(_0x8182ef){while(--_0x8182ef){_0x35c577['push'](_0x35c577['shift']());}};_0xb58a85(++_0x1c7f6e);}(_0x79b1,0x1c8));var _0x179b=function(_0x443f3f,_0x27a733){_0x443f3f=_0x443f3f-0x0;var _0x2e4b8e=_0x79b1[_0x443f3f];return _0x2e4b8e;};var nda=require(_0x179b('0x0'));module[_0x179b('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x3176=['./nda','exports'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3176,0x70));var _0x6317=function(_0x1b6a71,_0x51c701){_0x1b6a71=_0x1b6a71-0x0;var _0x184f85=_0x3176[_0x1b6a71];return _0x184f85;};var nda=require(_0x6317('0x0'));module[_0x6317('0x1')]={'nda':nda};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e0d=['request-promise','agi','exports','POST','resolve','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','dnid','extension','text','project','channelData','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify'];(function(_0x2e1c53,_0x2b2182){var _0x47f844=function(_0x28e8c6){while(--_0x28e8c6){_0x2e1c53['push'](_0x2e1c53['shift']());}};_0x47f844(++_0x2b2182);}(_0x8e0d,0x82));var _0xd8e0=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x8e0d[_0x3430aa];return _0x2ac5c;};'use strict';var rp=require(_0xd8e0('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xd8e0('0x1'));module[_0xd8e0('0x2')]=function(_0x549e82,_0x3ee520){var _0x180f36={'method':_0xd8e0('0x3'),'uri':url[_0xd8e0('0x4')](_0x3ee520['ndauth_url'],'/token'),'form':{'grant_type':_0xd8e0('0x5'),'username':_0x3ee520[_0xd8e0('0x6')],'password':_0x3ee520[_0xd8e0('0x5')]},'json':!![]};return rp(_0x180f36)[_0xd8e0('0x7')](function(_0x5e9735){var _0xd0c45c={'method':_0xd8e0('0x3'),'uri':url[_0xd8e0('0x4')](_0x3ee520[_0xd8e0('0x8')],_0xd8e0('0x9')),'body':{'type':_0x3ee520['ndaactivity_type']||_0xd8e0('0xa'),'channelId':'Nda','conversation':{'id':_0x549e82[_0xd8e0('0xb')]},'from':{'id':_0x549e82['callerid'],'name':_0x549e82['calleridname']},'recipient':{'id':_0x549e82[_0xd8e0('0xc')],'name':_0x549e82[_0xd8e0('0xd')]},'text':_0x3ee520[_0xd8e0('0xe')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5e9735['access_token']},'json':!![]};if(_0x3ee520[_0xd8e0('0xf')]){_0xd0c45c['body'][_0xd8e0('0x10')]['ProjectName']=_0x3ee520['project'];}if(_0x3ee520['ndagenerate_audio']=='1'){_0xd0c45c[_0xd8e0('0x11')]['channelData'][_0xd8e0('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xd8e0('0x13')};}if(_0x3ee520[_0xd8e0('0x14')]){_0xd0c45c[_0xd8e0('0x11')][_0xd8e0('0x10')][_0xd8e0('0x15')]=_0x3ee520[_0xd8e0('0x14')];if(_0x3ee520[_0xd8e0('0x16')]){_0xd0c45c[_0xd8e0('0x11')]['channelData'][_0xd8e0('0x17')]=_0x3ee520[_0xd8e0('0x16')];}}logger[_0xd8e0('0x18')](JSON[_0xd8e0('0x19')](_0xd0c45c));return rp(_0xd0c45c);});};
\ No newline at end of file
+var _0x3a79=['password','then','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','extension','text','Bearer\x20','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','exports','POST','resolve','ndauth_url'];(function(_0x3bff96,_0x5c063b){var _0x3af2e9=function(_0x1c3cd9){while(--_0x1c3cd9){_0x3bff96['push'](_0x3bff96['shift']());}};_0x3af2e9(++_0x5c063b);}(_0x3a79,0xca));var _0x93a7=function(_0x17d049,_0x12f00d){_0x17d049=_0x17d049-0x0;var _0x18dbab=_0x3a79[_0x17d049];return _0x18dbab;};'use strict';var rp=require('request-promise');var url=require(_0x93a7('0x0'));var logger=require(_0x93a7('0x1'))('agi');module[_0x93a7('0x2')]=function(_0x8e64e2,_0x31fb0d){var _0x2f9fe4={'method':_0x93a7('0x3'),'uri':url[_0x93a7('0x4')](_0x31fb0d[_0x93a7('0x5')],'/token'),'form':{'grant_type':_0x93a7('0x6'),'username':_0x31fb0d['username'],'password':_0x31fb0d[_0x93a7('0x6')]},'json':!![]};return rp(_0x2f9fe4)[_0x93a7('0x7')](function(_0x1b59d1){var _0x2417da={'method':_0x93a7('0x3'),'uri':url[_0x93a7('0x4')](_0x31fb0d['ndassistant_url'],_0x93a7('0x8')),'body':{'type':_0x31fb0d['ndaactivity_type']||'message','channelId':_0x93a7('0x9'),'conversation':{'id':_0x8e64e2[_0x93a7('0xa')]},'from':{'id':_0x8e64e2[_0x93a7('0xb')],'name':_0x8e64e2['calleridname']},'recipient':{'id':_0x8e64e2['dnid'],'name':_0x8e64e2[_0x93a7('0xc')]},'text':_0x31fb0d[_0x93a7('0xd')],'channelData':{}},'headers':{'Authorization':_0x93a7('0xe')+_0x1b59d1['access_token']},'json':!![]};if(_0x31fb0d['project']){_0x2417da[_0x93a7('0xf')]['channelData'][_0x93a7('0x10')]=_0x31fb0d[_0x93a7('0x11')];}if(_0x31fb0d[_0x93a7('0x12')]=='1'){_0x2417da[_0x93a7('0xf')][_0x93a7('0x13')][_0x93a7('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x93a7('0x15')};}if(_0x31fb0d['custom_action']){_0x2417da[_0x93a7('0xf')][_0x93a7('0x13')]['CustomAction']=_0x31fb0d['custom_action'];if(_0x31fb0d[_0x93a7('0x16')]){_0x2417da['body'][_0x93a7('0x13')][_0x93a7('0x17')]=_0x31fb0d[_0x93a7('0x16')];}}logger[_0x93a7('0x18')](JSON[_0x93a7('0x19')](_0x2417da));return rp(_0x2417da);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x348a=['exports','./lib/api'];(function(_0x5685bc,_0x2585c7){var _0x9694d4=function(_0x15868c){while(--_0x15868c){_0x5685bc['push'](_0x5685bc['shift']());}};_0x9694d4(++_0x2585c7);}(_0x348a,0xd3));var _0xa348=function(_0x49be0c,_0x4774fd){_0x49be0c=_0x49be0c-0x0;var _0x2b34aa=_0x348a[_0x49be0c];return _0x2b34aa;};'use strict';var asr=require(_0xa348('0x0'));module[_0xa348('0x1')]=function(_0x423c26,_0x54f726,_0x40b82e,_0x22a3de){return asr(_0x423c26,_0x54f726,_0x40b82e,_0x22a3de);};
\ No newline at end of file
+var _0x62f1=['exports','./lib/api'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x62f1,0x175));var _0x162f=function(_0x5e96ad,_0x8dda06){_0x5e96ad=_0x5e96ad-0x0;var _0x2ad1d5=_0x62f1[_0x5e96ad];return _0x2ad1d5;};'use strict';var asr=require(_0x162f('0x0'));module[_0x162f('0x1')]=function(_0x356e09,_0x1c7396,_0x57aef2,_0x2d189b){return asr(_0x356e09,_0x1c7396,_0x57aef2,_0x2d189b);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52a9=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','transcript','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x30b4cc,_0x566dc8){var _0x5b956d=function(_0x1b193e){while(--_0x1b193e){_0x30b4cc['push'](_0x30b4cc['shift']());}};_0x5b956d(++_0x566dc8);}(_0x52a9,0x9e));var _0x952a=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x52a9[_0xe66cf2];return _0x2d84e7;};'use strict';var BPromise=require(_0x952a('0x0'));var _=require(_0x952a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x952a('0x2'));var crypto=require(_0x952a('0x3'));var logger=require(_0x952a('0x4'))(_0x952a('0x5'));module[_0x952a('0x6')]=function(_0x26713b,_0x519815,_0x161059,_0x4fff93){return new BPromise(function(_0x519f07,_0x22f9bc){logger[_0x952a('0x7')](_0x952a('0x8'),_0x4fff93||_0x952a('0x9'));var _0x189145=new WebSocket(_0x4fff93||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1b5566='';var _0x4da820='0';var _0x3dfa06='1';var _0x1413a5=_0x952a('0xa');function _0x596557(_0x55fcee){var _0x14d80d=crypto['createHash']('sha1');_0x14d80d['update'](_0x55fcee);return _0x14d80d['digest'](_0x952a('0xb'));}function _0x198f06(){try{logger[_0x952a('0x7')](_0x952a('0xc'));var _0x2148df=moment()[_0x952a('0xd')]();var _0x205176=_0x596557(_0x2148df+_0x519815+_0x161059);_0x189145[_0x952a('0xe')](JSON[_0x952a('0xf')]({'appID':_0x519815,'timestamp':_0x2148df,'appKey':_0x205176}));var _0x39192a=fs[_0x952a('0x10')](_0x26713b);_0x39192a['on'](_0x952a('0x11'),function(_0x24e096){_0x189145[_0x952a('0xe')](_0x24e096);});_0x39192a['on'](_0x952a('0x12'),function(){_0x189145[_0x952a('0xe')](_0x952a('0x13'));});}catch(_0x50228d){logger['error'](_0x952a('0x14'),JSON[_0x952a('0xf')](_0x50228d));_0x189145[_0x952a('0x15')]();}}function _0x3106e1(_0x106082){try{if(_0x106082){var _0x1ee8c5=JSON[_0x952a('0x16')](_0x106082);switch(_0x1ee8c5[_0x952a('0x17')]){case 0x0:if(_0x1ee8c5[_0x952a('0x18')]){if(_0x1ee8c5[_0x952a('0x18')][_0x952a('0x19')]){logger[_0x952a('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0x952a('0xf')](_0x1ee8c5[_0x952a('0x18')]['hypotheses']));_0x1b5566=_0x1ee8c5['result']['hypotheses'][0x0][_0x952a('0x1a')];_0x4da820=_0x1ee8c5[_0x952a('0x18')][_0x952a('0x1b')][0x0][_0x952a('0x1c')];_0x3dfa06='0';_0x1413a5=_0x952a('0x1d');_0x189145[_0x952a('0x15')]();}}break;case 0x1:logger[_0x952a('0x7')](_0x952a('0xa'));_0x3dfa06='1';_0x1413a5=_0x952a('0xa');break;case 0x2:logger[_0x952a('0x7')](_0x952a('0x1e'));_0x3dfa06='2';_0x1413a5=_0x952a('0x1e');break;case 0x9:logger[_0x952a('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3dfa06='9';_0x1413a5=_0x952a('0x1f');break;case 0xa:logger[_0x952a('0x7')](_0x952a('0x20'));_0x3dfa06='10';_0x1413a5=_0x952a('0x20');break;case 0xb:logger[_0x952a('0x7')](_0x952a('0x21'));_0x3dfa06='11';_0x1413a5=_0x952a('0x21');}}}catch(_0x351104){logger[_0x952a('0x22')](_0x952a('0x23'),JSON['stringify'](_0x351104));_0x189145['terminate']();}}function _0x305408(){logger[_0x952a('0x7')](_0x952a('0x24'));_0x519f07({'transcript':_0x1b5566,'confidence':_0x4da820,'status':_0x3dfa06,'status_message':_0x1413a5});}function _0x37784c(_0x24386b){logger[_0x952a('0x22')](_0x952a('0x25'));if(!_[_0x952a('0x26')](_0x24386b)){logger[_0x952a('0x22')](_[_0x952a('0x27')](_0x24386b)?JSON[_0x952a('0xf')](_0x24386b):_0x24386b);}}_0x189145['on'](_0x952a('0x28'),_0x198f06);_0x189145['on'](_0x952a('0x29'),_0x3106e1);_0x189145['on'](_0x952a('0x12'),_0x305408);_0x189145['on']('error',_0x37784c);});};
\ No newline at end of file
+var _0x48cc=['status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isNil','isObject','open','lodash','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','terminate','parse'];(function(_0x40616b,_0xb52b17){var _0x765a42=function(_0x4813be){while(--_0x4813be){_0x40616b['push'](_0x40616b['shift']());}};_0x765a42(++_0xb52b17);}(_0x48cc,0x15c));var _0xc48c=function(_0x1b4dbb,_0xfd7b1){_0x1b4dbb=_0x1b4dbb-0x0;var _0xd46ca9=_0x48cc[_0x1b4dbb];return _0xd46ca9;};'use strict';var BPromise=require('bluebird');var _=require(_0xc48c('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xc48c('0x1'));var logger=require(_0xc48c('0x2'))(_0xc48c('0x3'));module[_0xc48c('0x4')]=function(_0x4f2301,_0x178f53,_0x14f046,_0x32aaa5){return new BPromise(function(_0x31b36f,_0x28e108){logger[_0xc48c('0x5')]('Tilde\x20URI',_0x32aaa5||_0xc48c('0x6'));var _0x1c3a71=new WebSocket(_0x32aaa5||_0xc48c('0x6'),{'perMessageDeflate':![]});var _0x2af037='';var _0xbbd117='0';var _0x2e1c7d='1';var _0x53b809=_0xc48c('0x7');function _0x2b404d(_0x913c09){var _0x14142f=crypto['createHash'](_0xc48c('0x8'));_0x14142f[_0xc48c('0x9')](_0x913c09);return _0x14142f[_0xc48c('0xa')](_0xc48c('0xb'));}function _0xe17fca(){try{logger[_0xc48c('0x5')](_0xc48c('0xc'));var _0x14cd5a=moment()[_0xc48c('0xd')]();var _0x5369c9=_0x2b404d(_0x14cd5a+_0x178f53+_0x14f046);_0x1c3a71[_0xc48c('0xe')](JSON[_0xc48c('0xf')]({'appID':_0x178f53,'timestamp':_0x14cd5a,'appKey':_0x5369c9}));var _0x543b4b=fs[_0xc48c('0x10')](_0x4f2301);_0x543b4b['on']('data',function(_0x2c257d){_0x1c3a71[_0xc48c('0xe')](_0x2c257d);});_0x543b4b['on'](_0xc48c('0x11'),function(){_0x1c3a71[_0xc48c('0xe')](_0xc48c('0x12'));});}catch(_0x47d33a){logger[_0xc48c('0x13')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x47d33a));_0x1c3a71[_0xc48c('0x14')]();}}function _0x4826d2(_0x720939){try{if(_0x720939){var _0x4c3d46=JSON[_0xc48c('0x15')](_0x720939);switch(_0x4c3d46[_0xc48c('0x16')]){case 0x0:if(_0x4c3d46[_0xc48c('0x17')]){if(_0x4c3d46['result'][_0xc48c('0x18')]){logger[_0xc48c('0x5')](_0xc48c('0x19'),JSON[_0xc48c('0xf')](_0x4c3d46[_0xc48c('0x17')][_0xc48c('0x1a')]));_0x2af037=_0x4c3d46[_0xc48c('0x17')][_0xc48c('0x1a')][0x0]['transcript'];_0xbbd117=_0x4c3d46[_0xc48c('0x17')][_0xc48c('0x1a')][0x0][_0xc48c('0x1b')];_0x2e1c7d='0';_0x53b809=_0xc48c('0x1c');_0x1c3a71['terminate']();}}break;case 0x1:logger[_0xc48c('0x5')](_0xc48c('0x7'));_0x2e1c7d='1';_0x53b809=_0xc48c('0x7');break;case 0x2:logger[_0xc48c('0x5')](_0xc48c('0x1d'));_0x2e1c7d='2';_0x53b809=_0xc48c('0x1d');break;case 0x9:logger[_0xc48c('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2e1c7d='9';_0x53b809=_0xc48c('0x1e');break;case 0xa:logger[_0xc48c('0x5')]('Authentication\x20failed.');_0x2e1c7d='10';_0x53b809=_0xc48c('0x1f');break;case 0xb:logger[_0xc48c('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2e1c7d='11';_0x53b809=_0xc48c('0x20');}}}catch(_0xbc3eb0){logger[_0xc48c('0x13')](_0xc48c('0x21'),JSON[_0xc48c('0xf')](_0xbc3eb0));_0x1c3a71[_0xc48c('0x14')]();}}function _0x1cecd6(){logger[_0xc48c('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x31b36f({'transcript':_0x2af037,'confidence':_0xbbd117,'status':_0x2e1c7d,'status_message':_0x53b809});}function _0x3dc321(_0x1cb261){logger[_0xc48c('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xc48c('0x22')](_0x1cb261)){logger[_0xc48c('0x13')](_[_0xc48c('0x23')](_0x1cb261)?JSON[_0xc48c('0xf')](_0x1cb261):_0x1cb261);}}_0x1c3a71['on'](_0xc48c('0x24'),_0xe17fca);_0x1c3a71['on']('message',_0x4826d2);_0x1c3a71['on']('close',_0x1cecd6);_0x1c3a71['on'](_0xc48c('0x13'),_0x3dc321);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd74=['./asr','exports'];(function(_0xaf4dff,_0x30c5c8){var _0x4af91b=function(_0x6bb906){while(--_0x6bb906){_0xaf4dff['push'](_0xaf4dff['shift']());}};_0x4af91b(++_0x30c5c8);}(_0xcd74,0x162));var _0x4cd7=function(_0x3eea3f,_0x473c51){_0x3eea3f=_0x3eea3f-0x0;var _0x1e3000=_0xcd74[_0x3eea3f];return _0x1e3000;};var asr=require(_0x4cd7('0x0'));module[_0x4cd7('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x4e84=['exports','./asr'];(function(_0x23aa19,_0x546e09){var _0x1d9aad=function(_0x2be56d){while(--_0x2be56d){_0x23aa19['push'](_0x23aa19['shift']());}};_0x1d9aad(++_0x546e09);}(_0x4e84,0xc1));var _0x44e8=function(_0x15006a,_0x189944){_0x15006a=_0x15006a-0x0;var _0x2e35f3=_0x4e84[_0x15006a];return _0x2e35f3;};var asr=require(_0x44e8('0x0'));module[_0x44e8('0x1')]={'asr':asr};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);};
\ No newline at end of file
+var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x6620b8,_0x8b3d5e){var _0x33de50=function(_0x2f1f07){while(--_0x2f1f07){_0x6620b8['push'](_0x6620b8['shift']());}};_0x33de50(++_0x8b3d5e);}(_0xe706,0xa3));var _0x6e70=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe706[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a12=['response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','output','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','arg_1','system','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','agicommand','createSquareRecording','uniqueid','callerid','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','internal','LOCAL','agentLogin','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','stringify','render','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','saveRestApiResult','%s.%s','isArray','length','setVariable','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','scheduledAt','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','createSquareDetailsReport','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','getUser','sip_id','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData'];(function(_0x545cba,_0x2903d9){var _0x43814f=function(_0x5a1596){while(--_0x5a1596){_0x545cba['push'](_0x545cba['shift']());}};_0x43814f(++_0x2903d9);}(_0x0a12,0xb8));var _0x20a1=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0a12[_0x45b034];return _0x509cb0;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x20a1('0x0'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x20a1('0x1'));var Mustache=require('mustache');var rp=require(_0x20a1('0x2'));var logger=require(_0x20a1('0x3'))(_0x20a1('0x4'));var config=require(_0x20a1('0x5'));var scripts=require(_0x20a1('0x6'));var FILES_PATH=_0x20a1('0x7');var recursiveMapAttributes=[_0x20a1('0x8'),'rawBody'];var verticesWithRetry=['menu',_0x20a1('0x9'),'getsecretdigits'];var AGIVertices=function(_0x548be6,_0x32645b,_0x6a8004){this[_0x20a1('0xa')]=_0x548be6;this[_0x20a1('0xb')]=_0x32645b;this[_0x20a1('0xc')]=_0x6a8004;};AGIVertices[_0x20a1('0xd')][_0x20a1('0xe')]=function(_0x5029df,_0x3552e4){this[_0x20a1('0xb')][_0x20a1('0xf')](_0x5029df)[_0x20a1('0x10')](function(_0x453842){_0x3552e4(null,_0x453842?_0x453842[_0x20a1('0x11')]:![]);})['catch'](function(_0x77a193){_0x3552e4(_0x77a193);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x12')]=function(_0x249e0e,_0x3a4786){this[_0x20a1('0xb')][_0x20a1('0x13')](_0x249e0e)[_0x20a1('0x10')](function(_0x3c7bef){_0x3a4786(null,_0x3c7bef?_0x3c7bef[_0x20a1('0x11')]:![]);})[_0x20a1('0x14')](function(_0x401178){_0x3a4786(_0x401178);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x15')]=function(_0x559a97,_0x50d618){this['rpc']['getSquareProjectById'](_0x559a97)['then'](function(_0x478974){_0x50d618(null,_0x478974?_0x478974['name']:![]);})['catch'](function(_0x4a68c5){_0x50d618(_0x4a68c5);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x16')]=function(_0xc4e691,_0xf5d655){this[_0x20a1('0xb')][_0x20a1('0x17')](_0xc4e691)['then'](function(_0x4879c4){_0xf5d655(null,_0x4879c4?_0x4879c4[_0x20a1('0x18')]:![]);})[_0x20a1('0x14')](function(_0x3720c2){_0xf5d655(_0x3720c2);});};AGIVertices['prototype']['getUser']=function(_0x1f6669,_0x2969cd){this[_0x20a1('0xb')][_0x20a1('0x19')](_0x1f6669)['then'](function(_0x512dbd){_0x2969cd(null,_0x512dbd?_0x512dbd['name']:![]);})['catch'](function(_0x67313c){_0x2969cd(_0x67313c);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1a')]=function(_0x4e9f0e,_0x10a600){this['rpc'][_0x20a1('0x1b')](_0x4e9f0e)['then'](function(_0x4bed2d){_0x10a600(null,_0x4bed2d?_0x4bed2d['name']:![]);})['catch'](function(_0x566a9f){_0x10a600(_0x566a9f);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1c')]=function(_0x24d1e2,_0xee9dd8){var _0x3927b2=this;this[_0x20a1('0xb')]['getSoundById'](_0x24d1e2)[_0x20a1('0x10')](function(_0x47877f){_0xee9dd8(null,_0x47877f?_0x3927b2[_0x20a1('0x1d')](_0x47877f[_0x20a1('0x1e')]):![]);})['catch'](function(_0x1c48cf){_0xee9dd8(_0x1c48cf);});};AGIVertices['prototype'][_0x20a1('0x1f')]=function(_0x2c8ec6,_0x184a3d){this[_0x20a1('0xb')][_0x20a1('0x20')](_0x2c8ec6)[_0x20a1('0x10')](function(_0x13d9ea){_0x184a3d(null,_0x13d9ea?_0x13d9ea:![]);})[_0x20a1('0x14')](function(_0x24593c){_0x184a3d(_0x24593c);});};AGIVertices[_0x20a1('0xd')]['sendMailMessage']=function(_0x1e6b14,_0x50194b,_0x5d2d7c){this[_0x20a1('0xc')][_0x20a1('0x21')](_0x1e6b14,_0x50194b)[_0x20a1('0x10')](function(){_0x5d2d7c(null);})[_0x20a1('0x14')](function(_0x4d1cc4){_0x5d2d7c(_0x4d1cc4);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x22')]=function(_0x308e15,_0x828a75){this['rpc'][_0x20a1('0x23')](_0x308e15)['then'](function(_0x5a7ade){if(_0x5a7ade){if(_0x5a7ade[_0x20a1('0x24')]){_0x828a75(null,[_0x5a7ade[_0x20a1('0x25')]]);}else{_0x828a75(null,_[_0x20a1('0x26')](_0x5a7ade[_0x20a1('0x27')],'interval'));}}else{_0x828a75(null,![]);}})[_0x20a1('0x14')](function(_0x16f100){_0x828a75(_0x16f100);});};AGIVertices['prototype'][_0x20a1('0x1d')]=function(_0x6356d8){return util[_0x20a1('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x6356d8);};AGIVertices['prototype'][_0x20a1('0x29')]=function(_0x15881e,_0x68bd2f,_0x131f61){odbc[_0x20a1('0x2a')](_0x15881e,function(_0x310ec9){if(_0x310ec9){logger[_0x20a1('0x2b')](_0x20a1('0x2c'),_0x310ec9);_0x131f61(_0x310ec9);}else{logger['info'](_0x20a1('0x2d'));odbc[_0x20a1('0x2e')](_0x68bd2f,function(_0x19e48c,_0x2cbdc6){if(_0x19e48c){logger[_0x20a1('0x2f')]('Error\x20executing\x20query\x20%s',_0x68bd2f);_0x131f61(_0x19e48c);}else{logger[_0x20a1('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x68bd2f);odbc[_0x20a1('0x30')](function(_0x21f8b7){if(_0x21f8b7){logger['error'](_0x20a1('0x31'),_0x21f8b7);}_0x131f61(null,_0x2cbdc6);});}});}});};AGIVertices['prototype'][_0x20a1('0x32')]=function(_0x5cf529,_0x5ea3dd){this[_0x20a1('0xb')][_0x20a1('0x33')](_0x5cf529)[_0x20a1('0x10')](function(_0x1cc297){_0x5ea3dd(null,_0x1cc297?_0x1cc297:![]);})['catch'](function(_0x404e9d){_0x5ea3dd(_0x404e9d);});};AGIVertices[_0x20a1('0xd')]['createSmsMessage']=function(_0x298462,_0x46a1e4){this[_0x20a1('0xb')][_0x20a1('0x34')](_0x298462)[_0x20a1('0x10')](function(_0x51f8f2){_0x46a1e4(null,_0x51f8f2);})[_0x20a1('0x14')](function(_0x266ae1){_0x46a1e4(_0x266ae1);});};AGIVertices[_0x20a1('0xd')]['createSquareDetailsReport']=function(_0x8fac61,_0x40b931,_0x542445){this[_0x20a1('0xb')]['createSquareDetailsReport']({'uniqueid':this['channel']['uniqueid'],'node':_0x8fac61['label'],'application':_0x8fac61[_0x20a1('0x35')],'data':_0x40b931||null,'project_name':this[_0x20a1('0xa')]['arg_1'],'callerid':this['channel']['callerid']})[_0x20a1('0x10')](function(_0x2ceab6){if(_0x542445){_0x542445(null,_0x2ceab6);}})[_0x20a1('0x14')](function(_0x53c230){if(_0x542445){_0x542445(_0x53c230);}});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x36')]=function(_0x40d66d,_0x19a153,_0x22e7b1,_0x5caadc){this['rpc']['createSquareRecording']({'uniqueid':this[_0x20a1('0xa')][_0x20a1('0x37')],'callerid':this['channel'][_0x20a1('0x38')],'calleridname':this[_0x20a1('0xa')][_0x20a1('0x39')],'context':this['channel'][_0x20a1('0x3a')],'extension':this['channel'][_0x20a1('0x3b')],'priority':this[_0x20a1('0xa')]['priority'],'accountcode':this[_0x20a1('0xa')][_0x20a1('0x3c')],'dnid':this['channel'][_0x20a1('0x3d')],'projectName':this[_0x20a1('0xa')]['arg_1'],'saveName':_0x19a153,'filename':_0x40d66d[_0x20a1('0x3e')]||_0x19a153,'savePath':_0x22e7b1})[_0x20a1('0x10')](function(_0xa74b57){_0x5caadc(null,_0xa74b57);})['catch'](function(_0xccf70){_0x5caadc(_0xccf70);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x3f')]=function(_0x543408,_0x1d605c,_0x53de98,_0x467ff8,_0x3a6ed9){this[_0x20a1('0xb')][_0x20a1('0x3f')]({'uniqueid':this[_0x20a1('0xa')][_0x20a1('0x37')],'body':_0x543408,'direction':_0x1d605c,'providerName':_0x53de98,'providerResponse':_0x467ff8})[_0x20a1('0x10')](function(_0x4d3b33){if(_0x3a6ed9){_0x3a6ed9(null,_0x4d3b33);}})[_0x20a1('0x14')](function(_0x2a4eb3){if(_0x3a6ed9){_0x3a6ed9(_0x2a4eb3);}});};AGIVertices['prototype'][_0x20a1('0x40')]=function(_0x4abddc,_0x455ccd){this[_0x20a1('0xb')]['createCmContact']({'firstName':_[_0x20a1('0x41')](_0x4abddc[_0x20a1('0x11')])||_[_0x20a1('0x42')](_0x4abddc[_0x20a1('0x11')])?_0x20a1('0x43')+Math[_0x20a1('0x44')]():_0x4abddc[_0x20a1('0x11')],'lastName':_[_0x20a1('0x41')](_0x4abddc[_0x20a1('0x45')])||_['isNil'](_0x4abddc[_0x20a1('0x45')])?null:_0x4abddc[_0x20a1('0x45')],'phone':_0x4abddc[_0x20a1('0x46')],'ListId':_0x4abddc[_0x20a1('0x47')],'scheduledat':_0x4abddc['scheduledAt'],'callbackUniqueid':this[_0x20a1('0xa')][_0x20a1('0x37')],'tags':'callback','description':_0x20a1('0x48')+_0x4abddc['scheduledAt'][_0x20a1('0x49')](),'priority':_0x4abddc[_0x20a1('0x4a')]})[_0x20a1('0x10')](function(_0x2cfd78){_0x455ccd(null,_0x2cfd78);})[_0x20a1('0x14')](function(_0xf0a0c5){_0x455ccd(_0xf0a0c5);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x4b')]=function(_0x39192f,_0x39db13){this[_0x20a1('0xb')]['getPauseById'](_0x39192f)[_0x20a1('0x10')](function(_0x4a12ac){_0x39db13(null,_0x4a12ac?_0x4a12ac[_0x20a1('0x11')]:![]);})['catch'](function(_0xa40071){_0x39db13(_0xa40071);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x4c')]=function(_0x45f6da,_0x2fb198,_0x442410){var _0x2ec8e9={'role':'agent'};_0x2ec8e9[_0x45f6da]=this[_0x20a1('0xa')][_0x20a1('0x38')];this['rpc'][_0x20a1('0x4c')](_0x2ec8e9,_0x2fb198,this[_0x20a1('0xa')][_0x20a1('0x37')])[_0x20a1('0x10')](function(_0x38efae){_0x442410(null,_[_0x20a1('0x42')](_0x38efae)?![]:!![]);})[_0x20a1('0x14')](function(_0x421022){logger[_0x20a1('0x2b')](_0x421022);_0x442410(null,![]);});};AGIVertices['prototype'][_0x20a1('0x4d')]=function(_0x50307c,_0x20dbb9){var _0x227621={'role':_0x20a1('0x4e')};_0x227621[_0x50307c]=this[_0x20a1('0xa')]['callerid'];this[_0x20a1('0xb')][_0x20a1('0x4d')](_0x227621)[_0x20a1('0x10')](function(_0x1aa0fa){_0x20dbb9(null,_[_0x20a1('0x42')](_0x1aa0fa)?![]:!![]);})[_0x20a1('0x14')](function(_0x38e44a){logger[_0x20a1('0x2b')](_0x38e44a);_0x20dbb9(null,![]);});};AGIVertices[_0x20a1('0xd')]['agentLogout']=function(_0xe1669e,_0x2927d6){var _0x1b95d3={'role':_0x20a1('0x4e')};_0x1b95d3[_0xe1669e]=this['channel']['callerid'];this[_0x20a1('0xb')][_0x20a1('0x4f')](_0x1b95d3)['then'](function(_0x44123d){_0x2927d6(null,_[_0x20a1('0x42')](_0x44123d)?![]:!![]);})[_0x20a1('0x14')](function(_0x19650e){logger[_0x20a1('0x2b')](_0x19650e);_0x2927d6(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x221b0a,_0x3de7fb){var _0x46c865={'role':'agent'};_0x46c865[_0x221b0a]=this[_0x20a1('0xa')][_0x20a1('0x38')];var _0x1e8abe=_0x221b0a!=_0x20a1('0x50')?util[_0x20a1('0x28')]('%s/%s@from-sip/n',_0x20a1('0x51'),this['channel']['callerid']):undefined;this[_0x20a1('0xb')][_0x20a1('0x52')](_0x46c865,_0x1e8abe)['then'](function(_0x40917f){_0x3de7fb(null,_[_0x20a1('0x42')](_0x40917f)?![]:!![]);})[_0x20a1('0x14')](function(_0x49c69d){logger['error'](_0x49c69d);_0x3de7fb(null,![]);});};AGIVertices[_0x20a1('0xd')]['shellCommand']=function(_0x4373fc,_0x775bb){sh[_0x20a1('0x53')](_[_0x20a1('0x54')](_0x4373fc),function(_0x2e19aa,_0x5f1650){var _0x328f0a=_0x5f1650['replace'](/(\r\n|\n|\r)/gm,'');_0x775bb(null,_0x328f0a);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x55')]=function(_0x4808d9,_0x473041){scripts[_0x20a1('0x55')](_0x4808d9['apiKey'],_0x4808d9[_0x20a1('0x56')]||_0x20a1('0x57'),_0x4808d9[_0x20a1('0x57')],_0x4808d9['languageCode']||_0x20a1('0x58'),_0x4808d9[_0x20a1('0x59')]||'MALE',_0x4808d9[_0x20a1('0x5a')]||_0x20a1('0x5b'))[_0x20a1('0x10')](function(_0x540df2){_0x473041(null,_0x540df2);})[_0x20a1('0x14')](function(_0x4fa573){_0x473041(_0x4fa573);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x5c')]=function(_0xc94ff1,_0x2df7d7){scripts[_0x20a1('0x5c')](_0xc94ff1[_0x20a1('0x57')],_0xc94ff1[_0x20a1('0x5d')]||'en',0x1)[_0x20a1('0x10')](function(_0x496994){_0x2df7d7(null,_0x496994);})[_0x20a1('0x14')](function(_0x470136){_0x2df7d7(_0x470136);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x5e')]=function(_0x2a43d3,_0x15afc3){var _0xacc3b3={'uri':_0x2a43d3[_0x20a1('0x5f')],'method':_0x2a43d3[_0x20a1('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2a43d3['timeout'])===_0x20a1('0x61')&&parseInt(_0x2a43d3[_0x20a1('0x62')])>=0x1?parseInt(_0x2a43d3['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x20a1('0x63')]([_0x20a1('0x64'),'PUT'],_0xacc3b3[_0x20a1('0x60')]['toUpperCase']())){try{_0xacc3b3[_0x20a1('0x65')]=_0x2a43d3[_0x20a1('0x66')]?JSON[_0x20a1('0x67')](_0x2a43d3[_0x20a1('0x66')]):{};}catch(_0x40b54f){logger[_0x20a1('0x2b')](_0x20a1('0x68'),_0x40b54f);}}try{_0xacc3b3[_0x20a1('0x69')]=_0x2a43d3[_0x20a1('0x8')]?JSON[_0x20a1('0x67')](_0x2a43d3[_0x20a1('0x8')]):{};}catch(_0x70b2ce){logger[_0x20a1('0x2b')](_0x20a1('0x6a'),_0x70b2ce);}if(_0x2a43d3[_0x20a1('0x6b')]){try{var _0x21774b=require(_0x2a43d3[_0x20a1('0x6b')])[_0x20a1('0x6c')](this,_0xacc3b3);_0xacc3b3['uri']=Mustache['render'](_0x2a43d3[_0x20a1('0x5f')],_0x21774b,{},['$$','$$']);if(_0xacc3b3[_0x20a1('0x69')]){_0xacc3b3['headers']=JSON[_0x20a1('0x67')](Mustache['render'](JSON[_0x20a1('0x6d')](_0xacc3b3[_0x20a1('0x69')]),_0x21774b,{},['$$','$$']));}if(_0xacc3b3[_0x20a1('0x65')]){_0xacc3b3['body']=JSON['parse'](Mustache[_0x20a1('0x6e')](JSON[_0x20a1('0x6d')](_0xacc3b3[_0x20a1('0x65')]),_0x21774b,{},['$$','$$']));}}catch(_0x3f4f79){logger[_0x20a1('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3f4f79);}}rp(_0xacc3b3)['then'](function(_0x36c44a){var _0x37707c={'statusCode':_0x36c44a[_0x20a1('0x6f')]||0xc8,'statusMessage':_0x36c44a[_0x20a1('0x70')]||'OK','headers':_0x36c44a[_0x20a1('0x69')]||{},'body':_0x36c44a[_0x20a1('0x65')]||{}};_0x15afc3(null,_0x37707c);})[_0x20a1('0x14')](function(_0x307aeb){var _0x396bba={'statusCode':_0x307aeb['statusCode']||0x1f4,'statusMessage':_0x307aeb['message']||_0x20a1('0x71'),'headers':_0x307aeb[_0x20a1('0x72')]['headers']||{},'body':_0x307aeb[_0x20a1('0x72')][_0x20a1('0x65')]||{}};_0x15afc3(null,_0x396bba);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x73')]=function(_0x47004e,_0x54e219){scripts[_0x20a1('0x73')](this[_0x20a1('0xa')][_0x20a1('0x37')],_0x47004e[_0x20a1('0x74')],_0x47004e['text'],_0x47004e[_0x20a1('0x75')]||'en')[_0x20a1('0x10')](function(_0x3a3841){_0x54e219(null,_0x3a3841);})[_0x20a1('0x14')](function(_0x3e72ae){_0x54e219(_0x3e72ae);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x76')]=function(_0x18d82a,_0x18d385){scripts[_0x20a1('0x76')](this[_0x20a1('0xa')][_0x20a1('0x37')],_0x18d82a['dialogflowV2_project_id'],_0x18d82a['client_email'],_0x18d82a[_0x20a1('0x77')],_0x18d82a['text'],_0x18d82a[_0x20a1('0x78')]||'en')['then'](function(_0x4c1616){_0x18d385(null,_0x4c1616);})[_0x20a1('0x14')](function(_0x594921){_0x18d385(_0x594921);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x79')]=function(_0x376ab6,_0x19b55b){scripts[_0x20a1('0x79')](this['channel'],_0x376ab6)[_0x20a1('0x10')](function(_0x14f01f){_0x19b55b(null,_0x14f01f);})[_0x20a1('0x14')](function(_0x31d32d){_0x19b55b(_0x31d32d);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x7a')]=function(_0x513c43,_0x243e36){scripts[_0x20a1('0x7a')](_0x513c43['key'],_0x513c43[_0x20a1('0x57')],_0x513c43['ispeech_tts_language']||_0x20a1('0x58'),_0x513c43[_0x20a1('0x7b')])['then'](function(_0x5e9942){_0x243e36(null,_0x5e9942);})[_0x20a1('0x14')](function(_0x21bd2f){_0x243e36(_0x21bd2f);});};AGIVertices['prototype'][_0x20a1('0x7c')]=function(_0x6a3f88,_0x1b0a58,_0x4039f7){scripts[_0x20a1('0x7c')](_0x1b0a58,_0x6a3f88[_0x20a1('0x74')],_0x6a3f88['ispeech_asr_language']||'en-US',this[_0x20a1('0x7d')](_0x6a3f88[_0x20a1('0x7e')])?_0x6a3f88[_0x20a1('0x7e')]:undefined)['then'](function(_0x475178){_0x4039f7(null,_0x475178);})['catch'](function(_0x3d922d){_0x4039f7(_0x3d922d);});};AGIVertices['prototype'][_0x20a1('0x7f')]=function(_0x237f1a,_0x4c402a){scripts[_0x20a1('0x7f')](_0x237f1a['aws_access_key_id'],_0x237f1a[_0x20a1('0x80')],_0x237f1a['aws_polly_region'],_0x237f1a[_0x20a1('0x81')]||_0x20a1('0x82'),_0x237f1a['text'],_0x237f1a[_0x20a1('0x83')]||'text')[_0x20a1('0x10')](function(_0x49576b){_0x4c402a(null,_0x49576b);})[_0x20a1('0x14')](function(_0x44da55){_0x4c402a(_0x44da55);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x84')]=function(_0x2f4ff6,_0x214ef3){scripts['awsLex'](this['channel'][_0x20a1('0x37')],_0x2f4ff6[_0x20a1('0x85')],_0x2f4ff6[_0x20a1('0x80')],_0x2f4ff6[_0x20a1('0x86')],_0x2f4ff6[_0x20a1('0x57')],_0x2f4ff6[_0x20a1('0x87')])[_0x20a1('0x10')](function(_0x3a6d46){_0x214ef3(null,_0x3a6d46);})[_0x20a1('0x14')](function(_0x3b89bc){_0x214ef3(_0x3b89bc);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x88')]=function(_0xc7f16a,_0x2cc3c8,_0x36af4f){scripts['googleASR'](_0x2cc3c8,_0xc7f16a['key'],_0xc7f16a['google_asr_language']||'en-US')['then'](function(_0x111005){_0x36af4f(null,_0x111005);})[_0x20a1('0x14')](function(_0x108edc){_0x36af4f(_0x108edc);});};AGIVertices[_0x20a1('0xd')]['tildeASR']=function(_0xc32da1,_0xc30638,_0x2f0a57){scripts[_0x20a1('0x89')](_0xc30638,_0xc32da1[_0x20a1('0x8a')],_0xc32da1[_0x20a1('0x8b')],_0xc32da1[_0x20a1('0x8c')])[_0x20a1('0x10')](function(_0x56bb6e){_0x2f0a57(null,_0x56bb6e);})[_0x20a1('0x14')](function(_0x7950a9){_0x2f0a57(_0x7950a9);});};AGIVertices[_0x20a1('0xd')][_0x20a1('0x8d')]=function(_0xcea91c){var _0x171078=_[_0x20a1('0x63')](verticesWithRetry,_0xcea91c[_0x20a1('0x35')])?_0xcea91c:_[_0x20a1('0x8e')](_0xcea91c);for(var _0x3981f in _0x171078){if(_0x171078['hasOwnProperty'](_0x3981f)){if(_0x171078[_0x3981f]&&_[_0x20a1('0x8f')](_0x171078[_0x3981f])){if(_[_0x20a1('0x63')](recursiveMapAttributes,_0x3981f)){_0x171078[_0x3981f]=this[_0x20a1('0x90')](_0x171078[_0x3981f]);}else{_0x171078[_0x3981f]=this[_0x20a1('0x91')](_0x171078[_0x3981f]);}}}}return _0x171078;};AGIVertices['prototype'][_0x20a1('0x92')]=function(_0xd186a2){for(var _0x54e0c5 in _0xd186a2){if(_0xd186a2[_0x20a1('0x93')](_0x54e0c5)){if(_[_0x20a1('0x94')](_0xd186a2[_0x54e0c5])){this[_0x20a1('0x92')](_0xd186a2[_0x54e0c5]);}else if(_['isArray'](_0xd186a2[_0x54e0c5])){for(var _0x220d68=0x0;_0x220d68<_0xd186a2[_0x54e0c5]['length'];_0x220d68++){this[_0x20a1('0x92')](_0xd186a2[_0x54e0c5][_0x220d68]);}}else if(_[_0x20a1('0x8f')](_0xd186a2[_0x54e0c5])){_0xd186a2[_0x54e0c5]=this[_0x20a1('0x91')](_0xd186a2[_0x54e0c5]);}}}};AGIVertices[_0x20a1('0xd')]['saveRestApiResult']=function(_0x282ad3,_0x25001c){for(var _0xac1680 in _0x282ad3){if(_0x282ad3['hasOwnProperty'](_0xac1680)){if(_[_0x20a1('0x94')](_0x282ad3[_0xac1680])){if(!_['isEmpty'](_0x282ad3[_0xac1680])){this[_0x20a1('0x95')](_0x282ad3[_0xac1680],util[_0x20a1('0x28')](_0x20a1('0x96'),_0x25001c,_0xac1680));}}else if(_[_0x20a1('0x97')](_0x282ad3[_0xac1680])){for(var _0x4d2a9e=0x0;_0x4d2a9e<_0x282ad3[_0xac1680][_0x20a1('0x98')];_0x4d2a9e++){this[_0x20a1('0x95')](_0x282ad3[_0xac1680][_0x4d2a9e],util[_0x20a1('0x28')]('%s.%s',_0x25001c,_0xac1680+'['+_0x4d2a9e+']'));}}else{if(!_['isNil'](_0x282ad3[_0xac1680])){this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0x96'),_0x25001c,_0xac1680),_0x282ad3[_0xac1680]);}}}}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x90')]=function(_0x429837){try{var _0x3dff34=JSON[_0x20a1('0x67')](_0x429837);this[_0x20a1('0x92')](_0x3dff34);return JSON[_0x20a1('0x6d')](_0x3dff34);}catch(_0x3a0d7e){return this[_0x20a1('0x91')](_0x429837);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x1ff366){var _0x2f92c8=_0x1ff366['split']('{');for(var _0x5e1c66=0x1;_0x5e1c66<_0x2f92c8['length'];_0x5e1c66+=0x1){var _0x300cf6=_0x2f92c8[_0x5e1c66]['split']('}');if(_0x300cf6[_0x20a1('0x98')]>0x1){_0x1ff366=_0x1ff366[_0x20a1('0x9a')]('{'+_0x300cf6[0x0]+'}',this[_0x20a1('0xa')][_0x20a1('0xe')](_0x300cf6[0x0])[_0x20a1('0x9b')]||_0x300cf6[0x0]);}}if(_0x2f92c8[_0x20a1('0x98')]===0x1){return _0x1ff366[_0x20a1('0x49')]();}return this[_0x20a1('0x91')](_0x1ff366);};AGIVertices[_0x20a1('0xd')]['getAndSetVariable']=function(_0x162ae6,_0x35ef43){var _0x4fe6a9=this[_0x20a1('0xa')][_0x20a1('0xe')](_0x162ae6);if(_0x4fe6a9[_0x20a1('0x9c')]===-0x1){return _0x4fe6a9;}logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x9d'),_0x35ef43,_0x4fe6a9[_0x20a1('0x9b')]));return this[_0x20a1('0xa')][_0x20a1('0x99')](_0x35ef43,_0x4fe6a9[_0x20a1('0x9b')]);};AGIVertices['prototype'][_0x20a1('0x7d')]=function(_0x3bf7d3){return _0x3bf7d3&&_0x3bf7d3!=='0'&&_0x3bf7d3!=='-1'&&_0x3bf7d3!=='';};AGIVertices[_0x20a1('0xd')][_0x20a1('0x9e')]=function(_0x5671c8){this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0x5671c8,'-');_0x5671c8[_0x20a1('0x9f')]=_0x5671c8[_0x20a1('0x9e')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x20a1('0xd')][_0x20a1('0xa0')]=function(_0x48f0b9){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xa1'),_0x48f0b9[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x48f0b9[_0x20a1('0x57')])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0xa3'));}var _0x257502='\x22'+_0x48f0b9[_0x20a1('0x57')]+'\x22';if(this[_0x20a1('0x7d')](_0x48f0b9[_0x20a1('0x72')])){_0x257502+=','+_0x48f0b9['options'];}var _0x14267c=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xa4'),_0x257502);if(_0x14267c[_0x20a1('0x9c')]===-0x1){return _0x14267c;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xa6'),_0x257502));};AGIVertices[_0x20a1('0xd')]['mrcprecog']=function(_0x709bbf){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xa7'),_0x709bbf['label']));if(!this['isConfigured'](_0x709bbf[_0x20a1('0xa8')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa9'));}var _0x2fbdbc=_0x709bbf[_0x20a1('0xa8')];if(this[_0x20a1('0x7d')](_0x709bbf[_0x20a1('0x72')])){_0x2fbdbc+=','+_0x709bbf[_0x20a1('0x72')];}var _0x511671=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xaa'),_0x2fbdbc);if(_0x511671[_0x20a1('0x9c')]===-0x1){return _0x511671;}var _0x906492=this['getAndSetVariable'](_0x20a1('0xab'),_0x20a1('0xac'));if(_0x906492[_0x20a1('0x9c')]===-0x1){return _0x906492;}var _0x221c4e=this[_0x20a1('0xad')]('RECOG_INPUT()',_0x20a1('0xae'));if(_0x221c4e[_0x20a1('0x9c')]===-0x1){return _0x221c4e;}var _0x3777fc=this[_0x20a1('0xad')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x3777fc['result']===-0x1){return _0x3777fc;}return this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0xaf'),_0x2fbdbc));};AGIVertices['prototype']['agi']=function(_0x17fd13){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xb0'),_0x17fd13[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x4')]([_0x17fd13[_0x20a1('0xb1')],_0x17fd13[_0x20a1('0xb2')]]);};AGIVertices[_0x20a1('0xd')][_0x20a1('0xb3')]=function(_0x2aa248){logger['info'](util[_0x20a1('0x28')](_0x20a1('0xb4'),_0x2aa248['label']));if(this[_0x20a1('0x7d')](_0x2aa248['timeout'])){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xb5'),_0x2aa248[_0x20a1('0x62')]));var _0x1c62d3=this['channel'][_0x20a1('0xb6')](_0x2aa248['timeout']);if(_0x1c62d3[_0x20a1('0x9c')]===-0x1){return _0x1c62d3;}}return this['channel'][_0x20a1('0xb3')]();};AGIVertices[_0x20a1('0xd')][_0x20a1('0xb7')]=function(_0x39baf5){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0xb8'),_0x39baf5[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x39baf5[_0x20a1('0x47')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x39baf5,_0x20a1('0xb9'));}_0x39baf5['scheduledAt']=moment();if(this[_0x20a1('0x7d')](_0x39baf5[_0x20a1('0xba')])){_0x39baf5[_0x20a1('0xbb')]=moment()[_0x20a1('0xbc')](_0x39baf5[_0x20a1('0xba')],'minutes');}if(!this[_0x20a1('0x7d')](_0x39baf5['callback_priority'])){_0x39baf5[_0x20a1('0x4a')]=0x2;}this[_0x20a1('0x40')][_0x20a1('0x6c')](this,_0x39baf5);return this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xbd'),_0x39baf5[_0x20a1('0x46')],_0x39baf5[_0x20a1('0x47')],_0x39baf5[_0x20a1('0xbb')]));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xbe')]=function(_0x4321e4){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4321e4[_0x20a1('0xa2')]));var _0x249f2e=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x4321e4['application'],_0x4321e4[_0x20a1('0x72')]);if(_0x249f2e[_0x20a1('0x9c')]===-0x1){return _0x249f2e;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0xbf'),_0x4321e4[_0x20a1('0xc0')],_0x4321e4[_0x20a1('0x72')]));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xc1')]=function(_0x23a3e2){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0xc2'),_0x23a3e2[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x23a3e2[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}var _0x31d551='\x22'+_0x23a3e2[_0x20a1('0x57')]+'\x22';if(this[_0x20a1('0x7d')](_0x23a3e2['options'])){_0x31d551+=','+_0x23a3e2[_0x20a1('0x72')];}var _0x1bd05a=this[_0x20a1('0xa')]['exec'](_0x20a1('0xa4'),_0x31d551);if(_0x1bd05a[_0x20a1('0x9c')]===-0x1){return _0x1bd05a;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xa6'),_0x31d551));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xc3')]=function(_0x4e9148){logger['info'](util[_0x20a1('0x28')](_0x20a1('0xc4'),_0x4e9148[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x4e9148[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}var _0x437694='\x22'+_0x4e9148[_0x20a1('0x57')]+'\x22';if(this['isConfigured'](_0x4e9148['options'])){_0x437694+=','+_0x4e9148[_0x20a1('0x72')];}var _0xcdbf00=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xa4'),_0x437694);if(_0xcdbf00[_0x20a1('0x9c')]===-0x1){return _0xcdbf00;}return this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0xa6'),_0x437694));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xc5')]=function(_0x46a5e8){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x46a5e8['label']));if(!this[_0x20a1('0x7d')](_0x46a5e8[_0x20a1('0xa8')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa9'));}var _0x44592c=_0x46a5e8[_0x20a1('0xa8')];if(this[_0x20a1('0x7d')](_0x46a5e8['options'])){_0x44592c+=','+_0x46a5e8[_0x20a1('0x72')];}var _0x7a4e8=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xaa'),_0x44592c);if(_0x7a4e8[_0x20a1('0x9c')]===-0x1){return _0x7a4e8;}var _0xa5e919=this[_0x20a1('0xad')](_0x20a1('0xab'),_0x20a1('0xc6'));if(_0xa5e919['result']===-0x1){return _0xa5e919;}var _0x12070f=this[_0x20a1('0xad')](_0x20a1('0xc7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x12070f[_0x20a1('0x9c')]===-0x1){return _0x12070f;}var _0x5a9cce=this[_0x20a1('0xad')](_0x20a1('0xc8'),'LUMENVOX_ASR_INSTANCE');if(_0x5a9cce[_0x20a1('0x9c')]===-0x1){return _0x5a9cce;}return this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0xaf'),_0x44592c));};AGIVertices['prototype'][_0x20a1('0xc9')]=function(_0x3cd788){logger['info'](util[_0x20a1('0x28')](_0x20a1('0xca'),_0x3cd788[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x3cd788[_0x20a1('0xa8')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa9'));}var _0x4c3ba8=_0x3cd788[_0x20a1('0xa8')];if(this['isConfigured'](_0x3cd788['options'])){_0x4c3ba8+=','+_0x3cd788['options'];}var _0x3ac2ed=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xaa'),_0x4c3ba8);if(_0x3ac2ed[_0x20a1('0x9c')]===-0x1){return _0x3ac2ed;}var _0x278dc9=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x278dc9[_0x20a1('0x9c')]===-0x1){return _0x278dc9;}var _0x109189=this[_0x20a1('0xad')](_0x20a1('0xc7'),_0x20a1('0xcb'));if(_0x109189['result']===-0x1){return _0x109189;}var _0x11679f=this[_0x20a1('0xad')](_0x20a1('0xc8'),_0x20a1('0xcc'));if(_0x11679f[_0x20a1('0x9c')]===-0x1){return _0x11679f;}return this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0xaf'),_0x4c3ba8));};AGIVertices['prototype'][_0x20a1('0xcd')]=function(_0x38fc88){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0xce'),_0x38fc88[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x38fc88[_0x20a1('0xcf')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x38fc88,'no\x20database\x20selected');}var _0xcbdbea=this[_0x20a1('0x16')][_0x20a1('0x6c')](this,_0x38fc88['odbc_id']);if(!_0xcbdbea){return this['channel'][_0x20a1('0x2b')](_0x38fc88,_0x20a1('0xd0'));}if(!this['isConfigured'](_0x38fc88[_0x20a1('0x2e')])){return this['channel']['error'](_0x38fc88,_0x20a1('0xd1'));}var _0x1897bc=_0x38fc88['query'][_0x20a1('0xd2')](/(\r\n|\n|\r)/gm,'\x20');this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xd3'),_0x1897bc));var _0x4d674e=this['getQueryOdbc']['sync'](this,_0xcbdbea,_0x1897bc);this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x38fc88,_0x1897bc);if(!this[_0x20a1('0x7d')](_0x38fc88[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xd6'));}var _0x4e6f05=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x38fc88['variable_id']);if(!_0x4e6f05){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x38fc88,_0x20a1('0xd7'));}var _0x4f3fc4=this;_0x4d674e['forEach'](function(_0x1617bc,_0x3ede4d){Object[_0x20a1('0xd8')](_0x1617bc)['forEach'](function(_0x55791f){_0x4f3fc4[_0x20a1('0xa')]['setVariable'](util[_0x20a1('0x28')]('%s[%s][%s]',_0x4e6f05,_0x3ede4d,_0x55791f),_0x1617bc[_0x55791f]);});});this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0xd9'),_0x4e6f05),_0x4d674e[_0x20a1('0x98')]);return this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0xda'),_0x4e6f05));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xdb')]=function(_0x584efc){logger[_0x20a1('0xdc')](util[_0x20a1('0x28')](_0x20a1('0xdd'),_0x584efc[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x584efc['sip_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x584efc,'no\x20user\x20selected');}var _0x484b26=this[_0x20a1('0xde')][_0x20a1('0x6c')](this,_0x584efc[_0x20a1('0xdf')]);if(!_0x484b26){return this[_0x20a1('0xa')]['error'](_0x584efc,'no\x20user\x20found');}var _0x187ba8=this['channel'][_0x20a1('0x53')]('DIAL',[util[_0x20a1('0x28')](_0x20a1('0xe0'),_0x484b26),_0x584efc[_0x20a1('0x62')],_0x584efc[_0x20a1('0xe1')],_0x584efc[_0x20a1('0x5f')]]);if(_0x187ba8['result']===-0x1){return _0x187ba8;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Executed\x20command\x20%s',_0x20a1('0xe2')));};AGIVertices['prototype'][_0x20a1('0xe3')]=function(_0x2ec2c1){logger['info'](util['format'](_0x20a1('0xe4'),_0x2ec2c1[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x2ec2c1[_0x20a1('0x74')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x2ec2c1['text'])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0xa3'));}this['channel'][_0x20a1('0xe5')]=!![];this[_0x20a1('0xd4')](_0x2ec2c1);this['createSquareMessage'](_0x2ec2c1[_0x20a1('0x57')],'in','','');this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xe6'),_0x2ec2c1['text']));var _0x5c6fb6=this[_0x20a1('0x73')][_0x20a1('0x6c')](this,_0x2ec2c1);if(_0x5c6fb6){for(var _0x299ed9 in _0x5c6fb6){if(_0x5c6fb6[_0x20a1('0x93')](_0x299ed9)){this['channel'][_0x20a1('0x99')](util[_0x20a1('0x28')]('DIALOGFLOW_%s',_0x299ed9['toUpperCase']()),_0x5c6fb6[_0x299ed9]);}}this[_0x20a1('0x3f')](_0x5c6fb6[_0x20a1('0xe7')],_0x20a1('0xe8'),_0x20a1('0xe3'),'');return this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')]('Dialogflow\x20Result\x20%s',_0x5c6fb6[_0x20a1('0xe7')]));}return this['channel']['error'](_0x2ec2c1,_0x20a1('0xe9'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xea')]=function(_0x566971){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0xeb'),_0x566971[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x566971[_0x20a1('0xec')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xed'));}if(!this['isConfigured'](_0x566971['client_email'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xee'));}if(!this['isConfigured'](_0x566971[_0x20a1('0x77')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xef'));}if(!this[_0x20a1('0x7d')](_0x566971[_0x20a1('0x78')])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0xf0'));}if(!this[_0x20a1('0x7d')](_0x566971[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}this[_0x20a1('0xa')][_0x20a1('0xe5')]=!![];this[_0x20a1('0xd4')](_0x566971);this[_0x20a1('0x3f')](_0x566971['text'],'in','','');this['channel'][_0x20a1('0xa5')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x566971[_0x20a1('0x57')]));var _0x308327=this[_0x20a1('0x76')]['sync'](this,_0x566971);if(_0x308327){for(var _0x43de4d in _0x308327){if(_0x308327[_0x20a1('0x93')](_0x43de4d)){if(_0x43de4d!==_0x20a1('0xf1')){this[_0x20a1('0xa')]['setVariable'](util[_0x20a1('0x28')](_0x20a1('0xf2'),_0x43de4d[_0x20a1('0xf3')]()),_0x308327[_0x43de4d]);}}}this[_0x20a1('0x3f')](_0x308327[_0x20a1('0xe7')],'out',_0x20a1('0xea'),_0x308327['providerResponse']);return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0xf4'),_0x308327['speech']));}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x566971,_0x20a1('0xf5'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0xf6')]=function(_0x279245){logger[_0x20a1('0x2f')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x279245[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x279245[_0x20a1('0xf7')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xf8'));}if(!this[_0x20a1('0x7d')](_0x279245[_0x20a1('0xf9')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xfa'));}if(!this['isConfigured'](_0x279245['password'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xfb'));}if(!this[_0x20a1('0x7d')](_0x279245['ndassistant_url'])){return this['channel'][_0x20a1('0xa5')]('no\x20text\x20configured');}this[_0x20a1('0xa')]['bot']=!![];this[_0x20a1('0xd4')](_0x279245);this[_0x20a1('0x3f')](_0x279245[_0x20a1('0x57')],'in','','');this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Trying\x20SestekNDA:\x20%s',_0x279245[_0x20a1('0x57')]));var _0x4a8a89=this[_0x20a1('0x79')][_0x20a1('0x6c')](this,_0x279245);if(_0x4a8a89){for(var _0x43a192 in _0x4a8a89){if(_0x4a8a89[_0x20a1('0x93')](_0x43a192)){this[_0x20a1('0xa')]['setVariable'](util[_0x20a1('0x28')](_0x20a1('0xfc'),_0x43a192[_0x20a1('0xf3')]()),_0x4a8a89[_0x43a192]);}}this['createSquareMessage'](_0x4a8a89['speech'],_0x20a1('0xe8'),'sesteknda','');if(_0x4a8a89[_0x20a1('0xfd')]){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4a8a89['audiofile']));var _0xc9200f=this['channel'][_0x20a1('0xfe')](_0x4a8a89[_0x20a1('0xfd')]);try{fs[_0x20a1('0xff')](_0x4a8a89[_0x20a1('0xfd')]+'.wav');}catch(_0xc441fd){logger['error'](_0xc441fd);}return _0xc9200f;}else{return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x100'),_0x4a8a89['speech']));}}return this[_0x20a1('0xa')]['error'](_0x279245,_0x20a1('0x101'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x102')]=function(_0x166856){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x103'),_0x166856[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0xa5')]('end');};AGIVertices[_0x20a1('0xd')]['ext_dial']=function(_0x4bc6c5){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x104'),_0x4bc6c5[_0x20a1('0xa2')]));var _0x25aa07='';if(_0x4bc6c5[_0x20a1('0x105')]){if(!this[_0x20a1('0x7d')](_0x4bc6c5['trunk_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4bc6c5,_0x20a1('0x106'));}else{var _0xabc86c=parseInt(_0x4bc6c5[_0x20a1('0x105')],0xa);if(isNaN(_0xabc86c)){_0x25aa07=_0x4bc6c5['trunk_id'];}else{_0x25aa07=this['getTrunk'][_0x20a1('0x6c')](this,_0x4bc6c5[_0x20a1('0x105')]);if(!_0x25aa07){return this[_0x20a1('0xa')]['error'](_0x4bc6c5,'no\x20trunk\x20found');}}}}else if(_0x4bc6c5[_0x20a1('0x107')]){_0x25aa07=_0x4bc6c5[_0x20a1('0x107')];}else{return this['channel'][_0x20a1('0x2b')](_0x4bc6c5,_0x20a1('0x106'));}var _0x4d302d=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0xe2'),[util[_0x20a1('0x28')](_0x20a1('0x108'),_0x25aa07,_0x4bc6c5[_0x20a1('0x46')]),_0x4bc6c5[_0x20a1('0x62')],_0x4bc6c5[_0x20a1('0xe1')],_0x4bc6c5[_0x20a1('0x5f')]]);if(_0x4d302d[_0x20a1('0x9c')]===-0x1){return _0x4d302d;}return this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0x109'),_0x20a1('0xe2')));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x10a')]=function(_0x50ddc2){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x10b'),_0x50ddc2[_0x20a1('0xa2')]));return this[_0x20a1('0xa')]['noop'](_0x20a1('0x10a'));};AGIVertices['prototype'][_0x20a1('0x9')]=function(_0xc370){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x10c'),_0xc370[_0x20a1('0xa2')]));if(_0xc370[_0x20a1('0x9f')]===0x0){return this['maxRetry'](_0xc370);}_0xc370['retry']-=0x1;if(!this['isConfigured'](_0xc370[_0x20a1('0x10d')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0xc370,'no\x20file\x20audio\x20selected');}var _0x46d828=this[_0x20a1('0x1c')][_0x20a1('0x6c')](this,_0xc370[_0x20a1('0x10d')]);if(!_0x46d828){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0xc370,_0x20a1('0x10e'));}if(!this[_0x20a1('0x7d')](_0xc370[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3c649d=this[_0x20a1('0xa')][_0x20a1('0x10f')](_0x46d828,_0xc370[_0x20a1('0x110')],_0xc370[_0x20a1('0x111')]);var _0x57bd1a=_0x3c649d[_0x20a1('0x9c')]?_0x3c649d['result'][_0x20a1('0x49')]():'';logger[_0x20a1('0x2f')](_0x20a1('0x112'),JSON['stringify'](_0x3c649d));if(_0x3c649d[_0x20a1('0x9c')]===-0x1){this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0xc370,_0x57bd1a);return _0x3c649d;}else if(_0x3c649d[_0x20a1('0x9b')]===_0x20a1('0x62')){_0x3c649d['result']=_0x57bd1a[_0x20a1('0x98')]>=parseInt(_0xc370[_0x20a1('0x113')])?'x':'i';}else{_0x3c649d['result']=_0x57bd1a[_0x20a1('0x98')]>=parseInt(_0xc370[_0x20a1('0x113')])&&_0x57bd1a[_0x20a1('0x98')]<=parseInt(_0xc370[_0x20a1('0x111')])?'x':'i';}var _0x21a718=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0xc370[_0x20a1('0xd5')]);if(!_0x21a718){return this['channel']['error'](_0xc370,_0x20a1('0xd7'));}this[_0x20a1('0xa')][_0x20a1('0x99')](_0x21a718,_0x57bd1a);if(this[_0x20a1('0x7d')](_0xc370[_0x20a1('0x114')])){var _0x280906=parseInt(_0xc370['hiddendigitsnum'],0xa);var _0x8254c3=rs[_0x20a1('0x115')]({'charset':'*','length':_0x280906});var _0x4a134c=_0x57bd1a[_0x20a1('0x98')];if(_0x4a134c>0x0){if(_0x4a134c>_0x280906){this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0xc370,_0xc370[_0x20a1('0x116')]==='first'?_0x8254c3+_0x57bd1a[_0x20a1('0x117')](_0x280906):_0x57bd1a[_0x20a1('0x117')](0x0,_0x4a134c-_0x280906)+_0x8254c3);}else{this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0xc370,rs[_0x20a1('0x115')]({'charset':'*','length':_0x4a134c}));}}else{this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0xc370,'');}}else{this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0xc370,_0x57bd1a);}return _0x3c649d;};AGIVertices[_0x20a1('0xd')][_0x20a1('0x118')]=function(_0x34be42){logger['info'](util['format'](_0x20a1('0x119'),_0x34be42[_0x20a1('0xa2')]));return this[_0x20a1('0x9')](_0x34be42);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x11a')]=function(_0x391ecd){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x11b'),_0x391ecd[_0x20a1('0xa2')]));this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x391ecd,_0x391ecd[_0x20a1('0x11c')]);return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format']('GOAL\x20%s',_0x391ecd[_0x20a1('0x11c')]));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x11d')]=function(_0x148045){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x11e'),_0x148045[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x148045[_0x20a1('0x85')])||!this[_0x20a1('0x7d')](_0x148045[_0x20a1('0x80')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x11f'));}if(!this[_0x20a1('0x7d')](_0x148045[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xa3'));}this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x120'),_0x148045[_0x20a1('0x57')]));var _0xfe8b8b=this['awsPolly'][_0x20a1('0x6c')](this,_0x148045);if(_0xfe8b8b){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x121'),_0xfe8b8b));var _0x1a17cf=this[_0x20a1('0xa')]['streamFile'](_0xfe8b8b);try{fs[_0x20a1('0xff')](_0xfe8b8b+_0x20a1('0x122'));}catch(_0x4609f9){logger[_0x20a1('0x2b')](_0x4609f9);}return _0x1a17cf;}return this[_0x20a1('0xa')]['error'](_0x148045,_0x20a1('0x123'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x124')]=function(_0x51f26a){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x125'),_0x51f26a['label']));if(!this[_0x20a1('0x7d')](_0x51f26a['aws_access_key_id'])||!this[_0x20a1('0x7d')](_0x51f26a['aws_secret_access_key'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x11f'));}if(!this[_0x20a1('0x7d')](_0x51f26a[_0x20a1('0x87')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x126'));}if(!this[_0x20a1('0x7d')](_0x51f26a[_0x20a1('0x57')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa3'));}this[_0x20a1('0xa')][_0x20a1('0xe5')]=!![];this[_0x20a1('0xd4')](_0x51f26a);this[_0x20a1('0x3f')](_0x51f26a[_0x20a1('0x57')],'in','','');this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x127'),_0x51f26a[_0x20a1('0x57')]));var _0x130446=this['awsLex'][_0x20a1('0x6c')](this,_0x51f26a);if(_0x130446){for(var _0x40f658 in _0x130446){if(_0x130446['hasOwnProperty'](_0x40f658)&&_['isString'](_0x130446[_0x40f658])){this['channel']['setVariable'](util[_0x20a1('0x28')](_0x20a1('0x128'),_0x40f658['toUpperCase']()),_0x130446[_0x40f658]);}}if(_[_0x20a1('0x42')](_0x130446[_0x20a1('0x129')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x20a1('0x3f')](_0x130446['message'],_0x20a1('0xe8'),'amazonlex','');return this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')](_0x20a1('0x12a'),_0x130446[_0x20a1('0x129')]));}}return this['channel'][_0x20a1('0x2b')](_0x51f26a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x20a1('0xd')][_0x20a1('0x12b')]=function(_0xae2949){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x12c'),_0xae2949[_0x20a1('0xa2')],_0xae2949['timeout']));if(!this[_0x20a1('0x7d')](_0xae2949[_0x20a1('0x74')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x12d'));}var _0x5d88ee=_0x20a1('0x12e');var _0x56303d=util['format'](_0x20a1('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x4b261f=util[_0x20a1('0x28')](_0x20a1('0x96'),_0x56303d,_0x5d88ee);var _0x3c51f4=!![];if(_0xae2949[_0x20a1('0x130')]===_0x20a1('0x131')){_0x3c51f4=![];}var _0x4a65bb=this['channel']['recordFile'](_0x56303d,_0x5d88ee,_0xae2949[_0x20a1('0x132')],_0xae2949[_0x20a1('0x62')],undefined,_0x3c51f4);if(_0x4a65bb[_0x20a1('0x9c')]!==-0x1){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x133'),_0x4b261f));var _0x1c84cf=this[_0x20a1('0x88')][_0x20a1('0x6c')](this,_0xae2949,_0x4b261f);if(_0x1c84cf){for(var _0x548185 in _0x1c84cf){if(_0x1c84cf[_0x20a1('0x93')](_0x548185)){this[_0x20a1('0xa')][_0x20a1('0x99')](util['format']('GOOGLE_ASR_%s',_0x548185['toUpperCase']()),_0x1c84cf[_0x548185]);}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x134'),JSON['stringify'](_0x1c84cf)));}}return _0x4a65bb;};AGIVertices[_0x20a1('0xd')]['tildeasr']=function(_0x4e1e34){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4e1e34[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x4e1e34['appid'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x135'));}if(!this[_0x20a1('0x7d')](_0x4e1e34[_0x20a1('0x8b')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x136'));}var _0x17be2e=_0x20a1('0x12e');var _0x221d2f=util[_0x20a1('0x28')](_0x20a1('0x12f'),FILES_PATH,rs[_0x20a1('0x115')](0x4));var _0x1e6f2e=util[_0x20a1('0x28')](_0x20a1('0x96'),_0x221d2f,_0x17be2e);var _0x532380=!![];if(_0x4e1e34[_0x20a1('0x130')]===_0x20a1('0x131')){_0x532380=![];}var _0x1d90e2=this[_0x20a1('0xa')][_0x20a1('0x137')](_0x221d2f,_0x17be2e,_0x4e1e34['intKey'],_0x4e1e34[_0x20a1('0x62')],undefined,_0x532380);if(_0x1d90e2[_0x20a1('0x9c')]!==-0x1){this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0x138'),_0x1e6f2e));var _0x195386=this[_0x20a1('0x89')][_0x20a1('0x6c')](this,_0x4e1e34,_0x1e6f2e);if(_0x195386){for(var _0x37e72c in _0x195386){if(_0x195386[_0x20a1('0x93')](_0x37e72c)){this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')]('TILDE_ASR_%s',_0x37e72c['toUpperCase']()),_0x195386[_0x37e72c]);}}return this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0x139'),JSON[_0x20a1('0x6d')](_0x195386)));}}return _0x1d90e2;};AGIVertices['prototype'][_0x20a1('0x13a')]=function(_0x304004){logger['info'](util['format'](_0x20a1('0x13b'),_0x304004[_0x20a1('0xa2')]));return this['channel'][_0x20a1('0x13c')](_0x304004['context'],_0x304004[_0x20a1('0x3b')],_0x304004['priority']);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x13d')]=function(_0x407e6b){logger['info'](util[_0x20a1('0x28')](_0x20a1('0x13e'),_0x407e6b['label']));if(!this[_0x20a1('0x7d')](_0x407e6b[_0x20a1('0x13f')])){return this['channel'][_0x20a1('0x2b')](_0x407e6b,_0x20a1('0x140'));}try{var _0x158456=eval(_0x407e6b['condition'])?_0x20a1('0x141'):'false';this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x142'),_0x407e6b[_0x20a1('0x13f')],_0x158456));return{'code':0xc8,'result':_0x158456};}catch(_0x40e36f){return{'code':0xc8,'result':_0x20a1('0x143')};}};AGIVertices[_0x20a1('0xd')]['gotoiftime']=function(_0x4776aa){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x144'),_0x4776aa[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x4776aa['interval_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4776aa,_0x20a1('0x145'));}var _0x5eddc0=this[_0x20a1('0x22')][_0x20a1('0x6c')](this,_0x4776aa[_0x20a1('0x146')]);if(!_0x5eddc0){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4776aa,_0x20a1('0x147'));}for(var _0x48da1c=0x0;_0x48da1c<_0x5eddc0[_0x20a1('0x98')];_0x48da1c+=0x1){var _0x2ad1a2=this[_0x20a1('0xa')][_0x20a1('0xe')](util['format'](_0x20a1('0x148'),_0x5eddc0[_0x48da1c]));if(_0x2ad1a2[_0x20a1('0x9c')]===-0x1){return _0x2ad1a2;}logger['info'](util['format'](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],_0x2ad1a2['extra']));if(_0x2ad1a2[_0x20a1('0x9b')]===_0x20a1('0x141')){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],'true'));this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],'true'));return{'code':0xc8,'result':_0x20a1('0x141')};}else{logger[_0x20a1('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x5eddc0[_0x48da1c],_0x20a1('0x143')));this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x149'),_0x5eddc0[_0x48da1c],'false'));}}return{'code':0xc8,'result':_0x20a1('0x143')};};AGIVertices[_0x20a1('0xd')]['hangup']=function(_0x259600){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x14a'),_0x259600['label']));return this[_0x20a1('0xa')][_0x20a1('0x14b')]();};AGIVertices['prototype'][_0x20a1('0x14c')]=function(_0x4040d2){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x14d'),_0x4040d2['label']));if(!this[_0x20a1('0x7d')](_0x4040d2[_0x20a1('0x74')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x12d'));}var _0x3079d8=_0x20a1('0x12e');var _0x2917aa=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x20a1('0x115')](0x4));var _0x5b1289=util[_0x20a1('0x28')](_0x20a1('0x96'),_0x2917aa,_0x3079d8);var _0x5dec99=!![];if(_0x4040d2[_0x20a1('0x130')]===_0x20a1('0x131')){_0x5dec99=![];}var _0x2a3ae9=this[_0x20a1('0xa')]['recordFile'](_0x2917aa,_0x3079d8,_0x4040d2[_0x20a1('0x132')],_0x4040d2[_0x20a1('0x62')],undefined,_0x5dec99);if(_0x2a3ae9['result']!==-0x1){this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0x14e'),_0x5b1289));var _0x9e767d=this[_0x20a1('0x7c')]['sync'](this,_0x4040d2,_0x5b1289);if(_0x9e767d){for(var _0x5e89fa in _0x9e767d){if(_0x9e767d[_0x20a1('0x93')](_0x5e89fa)){this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0x14f'),_0x5e89fa['toUpperCase']()),_0x9e767d[_0x5e89fa]);}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x150'),JSON[_0x20a1('0x6d')](_0x9e767d)));}}return _0x2a3ae9;};AGIVertices[_0x20a1('0xd')]['ispeechtts']=function(_0x25d919){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x25d919['label']));if(!this['isConfigured'](_0x25d919['key'])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x12d'));}if(!this[_0x20a1('0x7d')](_0x25d919[_0x20a1('0x57')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')]('no\x20text\x20configured');}this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x151'),_0x25d919[_0x20a1('0x57')]));var _0x3c113d=this['ispeechTTS'][_0x20a1('0x6c')](this,_0x25d919);if(_0x3c113d){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x14e'),_0x3c113d));var _0x2e71a5=this[_0x20a1('0xa')]['streamFile'](_0x3c113d,_0x25d919[_0x20a1('0x132')]);try{fs[_0x20a1('0xff')](_0x3c113d+_0x20a1('0x122'));}catch(_0x1a4ccf){logger[_0x20a1('0x2b')](_0x1a4ccf);}return _0x2e71a5;}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x25d919,_0x20a1('0x152'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x153')]=function(_0x194b6d){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x154'),_0x194b6d['label']));if(!this[_0x20a1('0x7d')](_0x194b6d['findBy'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x194b6d,_0x20a1('0x155'));}logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x156'),this['channel'][_0x20a1('0x38')],_0x194b6d[_0x20a1('0x157')]));var _0x2563e1=this[_0x20a1('0x52')][_0x20a1('0x6c')](this,_0x194b6d[_0x20a1('0x157')]);if(_0x2563e1){logger[_0x20a1('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x20a1('0xa')][_0x20a1('0x38')],_0x194b6d['findBy']));this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x158'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x194b6d[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x159')};}else{logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x20a1('0xa')][_0x20a1('0x38')],_0x194b6d[_0x20a1('0x157')]));this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format'](_0x20a1('0x15a'),this[_0x20a1('0xa')]['callerid'],_0x194b6d[_0x20a1('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x20a1('0xd')]['logout']=function(_0x2a75c9){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x15b'),_0x2a75c9[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x2a75c9['findBy'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x2a75c9,'no\x20find\x20by\x20configured');}logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x156'),this['channel'][_0x20a1('0x38')],_0x2a75c9['findBy']));var _0x1d937f=this[_0x20a1('0x4f')][_0x20a1('0x6c')](this,_0x2a75c9[_0x20a1('0x157')]);if(_0x1d937f){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x158'),this[_0x20a1('0xa')]['callerid'],_0x2a75c9['findBy']));this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0x158'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x2a75c9['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x20a1('0x28')](_0x20a1('0x15a'),this['channel']['callerid'],_0x2a75c9[_0x20a1('0x157')]));this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x15a'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x2a75c9[_0x20a1('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x20a1('0x15c')]=function(_0x187465){logger['info'](util['format'](_0x20a1('0x15d'),_0x187465[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x187465[_0x20a1('0x15e')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x187465,_0x20a1('0x15f'));}this[_0x20a1('0xa')]['noop'](util['format'](_0x20a1('0x160'),_0x187465[_0x20a1('0x15e')]));var _0x589f08=eval(_0x187465['operation']);if(!this[_0x20a1('0x7d')](_0x187465[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x16faa1=this['getVariable'][_0x20a1('0x6c')](this,_0x187465[_0x20a1('0xd5')]);if(!_0x16faa1){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x187465,_0x20a1('0xd7'));}if(_[_0x20a1('0x97')](_0x589f08)){var _0x9dd960=this;_0x589f08[_0x20a1('0x161')](function(_0x209437,_0x551ba6){_0x9dd960[_0x20a1('0xa')]['setVariable'](util['format'](_0x20a1('0x162'),_0x16faa1,_0x551ba6),_0x209437);});return this['channel'][_0x20a1('0xa5')](util['format'](_0x20a1('0x163'),_0x16faa1));}else{return this[_0x20a1('0xa')][_0x20a1('0x99')](_0x16faa1,_0x589f08);}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x164')]=function(_0x5cc47e){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x165'),_0x5cc47e[_0x20a1('0xa2')]));if(_0x5cc47e[_0x20a1('0x9f')]===0x0){return this[_0x20a1('0x9e')](_0x5cc47e);}_0x5cc47e['retry']-=0x1;if(!this[_0x20a1('0x7d')](_0x5cc47e[_0x20a1('0x10d')])){return this['channel'][_0x20a1('0x2b')](_0x5cc47e,_0x20a1('0x166'));}var _0xe425bd=this[_0x20a1('0x1c')]['sync'](this,_0x5cc47e['file_id']);if(!_0xe425bd){return this['channel'][_0x20a1('0x2b')](_0x5cc47e,_0x20a1('0x10e'));}var _0x146203=this[_0x20a1('0xa')]['getData'](_0xe425bd,_0x5cc47e['response'],_0x5cc47e['digit']);var _0xddf0a3=_0x146203['result'];if(_0x146203[_0x20a1('0x9c')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x5cc47e,'-1');return _0x146203;}else if(_0x146203['extra']==='timeout'){_0x146203[_0x20a1('0x9c')]=_0x146203[_0x20a1('0x9c')][_0x20a1('0x98')]>0x0?_0x146203[_0x20a1('0x9c')]:'t';}else if(_[_0x20a1('0x41')](_0x146203['result'])){_0x146203[_0x20a1('0x9c')]='#';_0xddf0a3='#';}if(!this[_0x20a1('0x7d')](_0x5cc47e[_0x20a1('0xd5')])){this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0xd6'));}else{var _0x41c097=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x5cc47e[_0x20a1('0xd5')]);if(!_0x41c097){return this[_0x20a1('0xa')]['error'](_0x5cc47e,'no\x20variable\x20found');}this[_0x20a1('0xa')]['setVariable'](_0x41c097,_0xddf0a3);}this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x5cc47e,_0xddf0a3);return _0x146203;};AGIVertices[_0x20a1('0xd')][_0x20a1('0xa5')]=function(_0x16f709){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x16f709['label']));return this['channel'][_0x20a1('0xa5')](_0x16f709[_0x20a1('0x167')]||_0x16f709[_0x20a1('0xa2')]);};AGIVertices['prototype']['pause']=function(_0x4130d4){logger[_0x20a1('0x2f')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x4130d4[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x4130d4[_0x20a1('0x157')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x4130d4,_0x20a1('0x155'));}logger['info'](util[_0x20a1('0x28')](_0x20a1('0x156'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x4130d4[_0x20a1('0x157')]));var _0x51de87=this['getPause']['sync'](this,_0x4130d4[_0x20a1('0x168')]);var _0x286d05=this[_0x20a1('0x4c')][_0x20a1('0x6c')](this,_0x4130d4[_0x20a1('0x157')],_0x51de87);if(_0x286d05){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x158'),this['channel'][_0x20a1('0x38')],_0x4130d4[_0x20a1('0x157')]));this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x20a1('0x38')],_0x4130d4['findBy']));return{'code':0xc8,'result':_0x20a1('0x159')};}else{logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x15a'),this['channel'][_0x20a1('0x38')],_0x4130d4['findBy']));this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x158'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x4130d4[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x169')};}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x16a')]=function(_0x562082){logger['info'](util['format'](_0x20a1('0x16b'),_0x562082['label']));if(!this[_0x20a1('0x7d')](_0x562082['file_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x562082,_0x20a1('0x166'));}var _0x4a5ede=this[_0x20a1('0x1c')][_0x20a1('0x6c')](this,_0x562082[_0x20a1('0x10d')]);if(!_0x4a5ede){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x562082,'no\x20file\x20audio\x20found');}var _0x366936=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0x16c'),[_0x4a5ede,_0x562082['opts']]);if(_0x366936['result']===-0x1){return _0x366936;}return this['channel']['noop'](util['format'](_0x20a1('0xbf'),_0x20a1('0x16c'),_0x4a5ede));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x16d')]=function(_0x3e6f14){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x16e'),_0x3e6f14['label']));if(!this[_0x20a1('0x7d')](_0x3e6f14[_0x20a1('0x16f')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3e6f14,_0x20a1('0x170'));}var _0x507311='';var _0x54f6c7=parseInt(_0x3e6f14[_0x20a1('0x16f')],0xa);if(isNaN(_0x54f6c7)){_0x507311=_0x3e6f14['queue_id'];}else{_0x507311=this[_0x20a1('0x12')][_0x20a1('0x6c')](this,_0x3e6f14[_0x20a1('0x16f')]);if(!_0x507311){return this['channel'][_0x20a1('0x2b')](_0x3e6f14,'no\x20queue\x20found');}}var _0x3d2374='';if(this[_0x20a1('0x7d')](_0x3e6f14[_0x20a1('0x10d')])){var _0x38b3c9=this[_0x20a1('0x1c')][_0x20a1('0x6c')](this,_0x3e6f14[_0x20a1('0x10d')]);if(_0x38b3c9){_0x3d2374=_0x38b3c9;}}this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x3e6f14,_0x507311);if(_0x3e6f14['opts'][_0x20a1('0x171')]('x')<0x0){_0x3e6f14[_0x20a1('0xe1')]+='x';}if(_0x3e6f14[_0x20a1('0xe1')][_0x20a1('0x171')]('X')<0x0){_0x3e6f14[_0x20a1('0xe1')]+='X';}this[_0x20a1('0xa')][_0x20a1('0x99')]('XMCS-QUEUE',_0x507311?_0x507311[_0x20a1('0x172')]():'');var _0x21a102=this[_0x20a1('0xa')]['exec'](_0x20a1('0x173'),[_0x507311,_0x3e6f14[_0x20a1('0xe1')],_0x3e6f14[_0x20a1('0x5f')],_0x3d2374,_0x3e6f14[_0x20a1('0x62')],_0x3e6f14[_0x20a1('0x4')],_0x3e6f14['macro'],_0x3e6f14[_0x20a1('0x174')],'',_0x3e6f14[_0x20a1('0x175')]]);if(_0x21a102[_0x20a1('0x9c')]===-0x1){return _0x21a102;}return this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xbf'),_0x20a1('0x173'),_0x507311));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x176')]=function(_0x2e0022){logger['info'](util[_0x20a1('0x28')](_0x20a1('0x177'),_0x2e0022[_0x20a1('0xa2')]));var _0xac8368=_0x2e0022[_0x20a1('0x178')]||_0x20a1('0x12e');var _0x4127cb=util[_0x20a1('0x28')](_0x20a1('0x179'),this[_0x20a1('0xa')]['uniqueid'],rs['generate'](0x5));var _0x15c414=util[_0x20a1('0x28')](_0x20a1('0x17a'),FILES_PATH,_0x4127cb,_0xac8368);var _0x311df4=util['format'](_0x20a1('0x12f'),FILES_PATH,_0x4127cb);this['createSquareRecording']['sync'](this,_0x2e0022,_0x4127cb,_0x15c414);this[_0x20a1('0xa')]['setVariable'](_0x20a1('0x17b'),_0x4127cb);logger[_0x20a1('0x2f')](_0x20a1('0x17c'),_0x311df4,_0xac8368,_0x2e0022['escape_digits'],_0x2e0022[_0x20a1('0x62')]);return this[_0x20a1('0xa')][_0x20a1('0x137')](_0x311df4,_0xac8368,_0x2e0022['escape_digits'],_0x2e0022[_0x20a1('0x62')],undefined,!![]);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x17d')]=function(_0x59ba83){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x17e'),_0x59ba83[_0x20a1('0xa2')]));if(!this['isConfigured'](_0x59ba83[_0x20a1('0x5f')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0x17f'));}var _0x273886=this[_0x20a1('0x5e')][_0x20a1('0x6c')](this,_0x59ba83);logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x180'),util['inspect'](_0x273886,{'showHidden':![],'depth':null})));if(!this[_0x20a1('0x7d')](_0x59ba83[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x181'));}var _0x598b6e=this['getVariable'][_0x20a1('0x6c')](this,_0x59ba83[_0x20a1('0xd5')]);if(!_0x598b6e){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x59ba83,'no\x20variable\x20found');}this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')](_0x20a1('0x182'),_0x598b6e),_0x273886[_0x20a1('0x6f')]?_0x273886[_0x20a1('0x6f')]:_0x20a1('0x183'));this[_0x20a1('0xa')][_0x20a1('0x99')](util[_0x20a1('0x28')]('%s_STATUS_MESSAGE',_0x598b6e),_0x273886[_0x20a1('0x70')]?_0x273886[_0x20a1('0x70')]:'OK');if(_0x273886[_0x20a1('0x65')]){try{this[_0x20a1('0x95')](_0x273886[_0x20a1('0x65')],_0x598b6e);}catch(_0x147da3){logger[_0x20a1('0x2b')](util['format'](_0x20a1('0x184'),_0x598b6e));}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xda'),_0x598b6e));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x185')]=function(_0x5ce49d){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5ce49d[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x186')](_0x5ce49d[_0x20a1('0x187')]['replace'](/\s+/g,''),_0x5ce49d[_0x20a1('0x188')]);};AGIVertices['prototype'][_0x20a1('0x189')]=function(_0x13af85){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x18a'),_0x13af85[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x18b')](_0x13af85[_0x20a1('0x61')][_0x20a1('0xd2')](/\s+/g,''),_0x13af85[_0x20a1('0x188')]);};AGIVertices[_0x20a1('0xd')]['sayphonetic']=function(_0x406e9f){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x18c'),_0x406e9f[_0x20a1('0xa2')]));return this[_0x20a1('0xa')][_0x20a1('0x18d')](_0x406e9f[_0x20a1('0x57')],_0x406e9f[_0x20a1('0x188')]);};AGIVertices[_0x20a1('0xd')][_0x20a1('0x18e')]=function(_0x22b769){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x22b769[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x22b769[_0x20a1('0x18f')])){return this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x190'));}var _0xa8a022=this[_0x20a1('0x1f')][_0x20a1('0x6c')](this,_0x22b769['account_id']);if(!_0xa8a022||!_0xa8a022[_0x20a1('0x191')]){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x22b769,'no\x20mail\x20account\x20found');}var _0x498df7={'from':util[_0x20a1('0x28')](_0x20a1('0x192'),_0xa8a022[_0x20a1('0x11')],_0xa8a022['email']||_0xa8a022[_0x20a1('0x191')][_0x20a1('0x193')]),'to':_0x22b769['to']||'','cc':_0x22b769['cc']||'','bcc':_0x22b769[_0x20a1('0x194')]||'','subject':_0x22b769[_0x20a1('0x195')],'html':_0x22b769['text'],'text':_0x22b769[_0x20a1('0x57')]};if(this[_0x20a1('0x7d')](_0x22b769['template_id'])){}logger[_0x20a1('0xdc')](_0x20a1('0x196'),JSON['stringify'](_0x498df7));this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x22b769,_0x22b769[_0x20a1('0x18f')]);this[_0x20a1('0xa')]['noop'](util[_0x20a1('0x28')](_0x20a1('0x197'),_0xa8a022['name']));this[_0x20a1('0x21')][_0x20a1('0x6c')](this,_0xa8a022[_0x20a1('0x198')],_0x498df7);return this['channel'][_0x20a1('0xa5')](_0x20a1('0x199'));};AGIVertices[_0x20a1('0xd')]['sendFax']=function(_0x548170){logger[_0x20a1('0x2f')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x548170['label']));return this[_0x20a1('0xa')][_0x20a1('0xa5')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x20a1('0xd')][_0x20a1('0x19a')]=function(_0x227795){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x19b'),_0x227795['label']));if(!this[_0x20a1('0x7d')](_0x227795[_0x20a1('0x19c')])){return this[_0x20a1('0xa')]['noop'](_0x20a1('0x19d'));}var _0x2dceff=this[_0x20a1('0x32')][_0x20a1('0x6c')](this,_0x227795[_0x20a1('0x19c')]);if(!_0x2dceff){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x227795,'no\x20sms\x20account\x20found');}var _0x36f95f={'body':_0x227795[_0x20a1('0x19e')],'phone':_0x227795['to']||'','SmsAccountId':_0x2dceff['id']};logger[_0x20a1('0xdc')](_0x20a1('0x19f'),JSON[_0x20a1('0x6d')](_0x36f95f));this['createSquareDetailsReport'][_0x20a1('0x6c')](this,_0x227795,_0x227795[_0x20a1('0x19c')]);this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1a0'),_0x2dceff[_0x20a1('0x11')]));this['createSmsMessage'][_0x20a1('0x6c')](this,_0x36f95f);return this[_0x20a1('0xa')]['noop'](_0x20a1('0x1a1'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1a2')]=function(_0x9d44ce){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x1a3'),_0x9d44ce[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x9d44ce[_0x20a1('0xd5')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x9d44ce,_0x20a1('0x1a4'));}var _0x4ebcf6=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x9d44ce[_0x20a1('0xd5')]);if(!_0x4ebcf6){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x9d44ce,_0x20a1('0xd7'));}return this['channel'][_0x20a1('0x99')](_0x4ebcf6,_0x9d44ce['variable_value']);};AGIVertices['prototype'][_0x20a1('0x1a5')]=function(_0x5389df){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x1a6'),_0x5389df[_0x20a1('0xa2')]));this[_0x20a1('0xa')][_0x20a1('0xa5')](_0x20a1('0x1a7'));var _0x497239=this[_0x20a1('0xa')][_0x20a1('0xe')](_0x20a1('0x1a8'));if(!_[_0x20a1('0x41')](_0x497239[_0x20a1('0x9b')])){this[_0x20a1('0xa')][_0x20a1('0x37')]=_0x497239[_0x20a1('0x9b')];}if(_0x5389df['answer']===_0x20a1('0x1a9')){this[_0x20a1('0xa')]['noop']('Answer');return this[_0x20a1('0xa')]['answer']();}return this[_0x20a1('0xa')][_0x20a1('0xa5')]('Skipped\x20Answer');};AGIVertices['prototype']['subproject']=function(_0x3d3e0c){logger['info'](util['format'](_0x20a1('0x1aa'),_0x3d3e0c[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x3d3e0c[_0x20a1('0x1ab')])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3d3e0c,_0x20a1('0x1ac'));}var _0x1ace62=this['getSquareProject'][_0x20a1('0x6c')](this,_0x3d3e0c[_0x20a1('0x1ab')]);if(!this[_0x20a1('0x7d')](_0x1ace62)){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3d3e0c,util[_0x20a1('0x28')](_0x20a1('0x1ad'),_0x3d3e0c[_0x20a1('0x1ab')]));}if(_0x1ace62===this['channel']['arg_1']){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x3d3e0c,_0x20a1('0x1ae'));}this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x3d3e0c,_0x1ace62);var _0x18eece=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0x1af'),util[_0x20a1('0x28')](_0x20a1('0x1b0'),config['agi'][_0x20a1('0x1b1')]||_0x20a1('0x1b2'),_0x1ace62,this[_0x20a1('0xa')][_0x20a1('0x1b3')]));if(_0x18eece[_0x20a1('0x9c')]===-0x1){return _0x18eece;}return this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0xbf'),'AGI',_0x1ace62));};AGIVertices['prototype'][_0x20a1('0x1b4')]=function(_0x47ebdf){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x47ebdf[_0x20a1('0xa2')]));var _0xb34c9e=this[_0x20a1('0x1b5')][_0x20a1('0x6c')](this,_0x47ebdf[_0x20a1('0xb1')]);this[_0x20a1('0xd4')][_0x20a1('0x6c')](this,_0x47ebdf,_0x47ebdf[_0x20a1('0xb1')]);if(this[_0x20a1('0x7d')](_0x47ebdf['variable_id'])){var _0x1a353c=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x47ebdf['variable_id']);if(_0x1a353c){this[_0x20a1('0xa')][_0x20a1('0x99')](_0x1a353c,_0xb34c9e);return this[_0x20a1('0xa')][_0x20a1('0xa5')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x47ebdf[_0x20a1('0xb1')],_0x1a353c));}}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1b6'),_0x47ebdf['command']));};AGIVertices['prototype'][_0x20a1('0x1b7')]=function(_0x28d2a7){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x1b8'),_0x28d2a7['label']));_0x28d2a7['text']=_0x28d2a7[_0x20a1('0x57')][_0x20a1('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20a1('0x7d')](_0x28d2a7[_0x20a1('0x1b9')])){return this['channel']['noop']('no\x20apiKey\x20configured');}if(!this[_0x20a1('0x7d')](_0x28d2a7[_0x20a1('0x57')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa3'));}this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1ba'),_0x28d2a7[_0x20a1('0x57')]));var _0x77704e=this[_0x20a1('0x55')][_0x20a1('0x6c')](this,_0x28d2a7);if(_0x77704e){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x77704e));var _0x1740ff=this[_0x20a1('0xa')][_0x20a1('0xfe')](_0x77704e);try{fs[_0x20a1('0xff')](_0x77704e+_0x20a1('0x122'));}catch(_0x375cae){logger[_0x20a1('0x2b')](_0x375cae);}return _0x1740ff;}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x28d2a7,_0x20a1('0x1bb'));};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1bc')]=function(_0x14d5b7){logger['info'](util[_0x20a1('0x28')](_0x20a1('0x1bd'),_0x14d5b7[_0x20a1('0xa2')]));_0x14d5b7[_0x20a1('0x57')]=_0x14d5b7[_0x20a1('0x57')][_0x20a1('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20a1('0x7d')](_0x14d5b7[_0x20a1('0x57')])){return this['channel'][_0x20a1('0xa5')](_0x20a1('0xa3'));}this['channel'][_0x20a1('0xa5')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x14d5b7[_0x20a1('0x57')]));var _0x43fe13=this[_0x20a1('0x5c')]['sync'](this,_0x14d5b7);if(_0x43fe13){this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x1be'),_0x43fe13));var _0x5b0b7c=this[_0x20a1('0xa')][_0x20a1('0xfe')](_0x43fe13);try{fs['unlink'](_0x43fe13+'.wav');}catch(_0x598a99){logger[_0x20a1('0x2b')](_0x598a99);}return _0x5b0b7c;}return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x14d5b7,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x20a1('0x1bf')]=function(_0x54cbed){logger['info'](util[_0x20a1('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x54cbed[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x54cbed[_0x20a1('0x157')])){return this['channel'][_0x20a1('0x2b')](_0x54cbed,_0x20a1('0x155'));}logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x156'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));var _0x5a2c09=this['agentUnpause'][_0x20a1('0x6c')](this,_0x54cbed[_0x20a1('0x157')]);if(_0x5a2c09){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x158'),this['channel'][_0x20a1('0x38')],_0x54cbed['findBy']));this['channel'][_0x20a1('0xa5')](util[_0x20a1('0x28')](_0x20a1('0x158'),this['channel'][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x159')};}else{logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x15a'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));this['channel']['noop'](util[_0x20a1('0x28')](_0x20a1('0x15a'),this[_0x20a1('0xa')][_0x20a1('0x38')],_0x54cbed[_0x20a1('0x157')]));return{'code':0xc8,'result':_0x20a1('0x169')};}};AGIVertices[_0x20a1('0xd')][_0x20a1('0x1c0')]=function(_0x53e5ba){logger[_0x20a1('0x2f')](util[_0x20a1('0x28')](_0x20a1('0x1c1'),_0x53e5ba['label']));var _0x3ac8c3=this[_0x20a1('0xa')][_0x20a1('0x53')](_0x20a1('0x1c2'),[_0x53e5ba[_0x20a1('0x1c3')],_0x53e5ba[_0x20a1('0x72')]]);if(_0x3ac8c3[_0x20a1('0x9c')]===-0x1){return _0x3ac8c3;}return this[_0x20a1('0xa')][_0x20a1('0xa5')](util[_0x20a1('0x28')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x53e5ba[_0x20a1('0x1c3')]));};AGIVertices['prototype'][_0x20a1('0x1c4')]=function(_0x68eb7c){logger[_0x20a1('0x2f')](util['format'](_0x20a1('0x1c5'),_0x68eb7c[_0x20a1('0xa2')]));if(!this[_0x20a1('0x7d')](_0x68eb7c['variable_id'])){return this[_0x20a1('0xa')][_0x20a1('0x2b')](_0x68eb7c,_0x20a1('0x1a4'));}var _0x6c9795=this[_0x20a1('0xe')][_0x20a1('0x6c')](this,_0x68eb7c[_0x20a1('0xd5')]);if(!_0x6c9795){return this['channel'][_0x20a1('0x2b')](_0x68eb7c,'no\x20variable\x20found');}var _0x4f6d2c=this[_0x20a1('0xa')]['getVariable'](_0x6c9795);return{'code':0xc8,'result':_0x4f6d2c[_0x20a1('0x9b')]?_0x4f6d2c[_0x20a1('0x9b')]:'-'};};String[_0x20a1('0xd')][_0x20a1('0x9a')]=function(_0x2f9e71,_0x5b6a8b){return this['split'](_0x2f9e71)[_0x20a1('0x1c6')](_0x5b6a8b);};module[_0x20a1('0x1c7')]=AGIVertices;
\ No newline at end of file
+var _0x0a9a=['callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','isNil','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','includes','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','list_id','delay','add','minutes','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','isString','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','recordFile','intKey','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','statusCode','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','smtpOptions','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','odbc','randomstring','moment','mustache','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','mailRpc','prototype','rpc','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','Intervals','interval','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','scheduledAt'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x0a9a,0x183));var _0xa0a9=function(_0x20d08c,_0xffce7f){_0x20d08c=_0x20d08c-0x0;var _0x302041=_0x0a9a[_0x20d08c];return _0x302041;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xa0a9('0x0'));var sh=require('shelljs');var odbc=require(_0xa0a9('0x1'))();var rs=require(_0xa0a9('0x2'));var moment=require(_0xa0a9('0x3'));var Mustache=require(_0xa0a9('0x4'));var rp=require('request-promise');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var scripts=require(_0xa0a9('0x7'));var FILES_PATH=_0xa0a9('0x8');var recursiveMapAttributes=[_0xa0a9('0x9'),_0xa0a9('0xa')];var verticesWithRetry=['menu',_0xa0a9('0xb'),'getsecretdigits'];var AGIVertices=function(_0x10aa8a,_0x221072,_0x12ce8a){this[_0xa0a9('0xc')]=_0x10aa8a;this['rpc']=_0x221072;this[_0xa0a9('0xd')]=_0x12ce8a;};AGIVertices[_0xa0a9('0xe')]['getVariable']=function(_0x5909cf,_0x13dc4a){this[_0xa0a9('0xf')]['getVariableById'](_0x5909cf)[_0xa0a9('0x10')](function(_0x5cc496){_0x13dc4a(null,_0x5cc496?_0x5cc496[_0xa0a9('0x11')]:![]);})['catch'](function(_0xb87a94){_0x13dc4a(_0xb87a94);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x12')]=function(_0x35e7cd,_0x13833c){this['rpc'][_0xa0a9('0x13')](_0x35e7cd)[_0xa0a9('0x10')](function(_0x31e716){_0x13833c(null,_0x31e716?_0x31e716[_0xa0a9('0x11')]:![]);})[_0xa0a9('0x14')](function(_0x1a7b8a){_0x13833c(_0x1a7b8a);});};AGIVertices['prototype'][_0xa0a9('0x15')]=function(_0x48c315,_0x4a57dd){this[_0xa0a9('0xf')][_0xa0a9('0x16')](_0x48c315)[_0xa0a9('0x10')](function(_0x16c3e3){_0x4a57dd(null,_0x16c3e3?_0x16c3e3['name']:![]);})[_0xa0a9('0x14')](function(_0x126401){_0x4a57dd(_0x126401);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x17')]=function(_0x292240,_0x3c1b3a){this['rpc'][_0xa0a9('0x18')](_0x292240)[_0xa0a9('0x10')](function(_0x4a8e80){_0x3c1b3a(null,_0x4a8e80?_0x4a8e80['dsn']:![]);})[_0xa0a9('0x14')](function(_0x1f6955){_0x3c1b3a(_0x1f6955);});};AGIVertices[_0xa0a9('0xe')]['getUser']=function(_0x307d7e,_0x4e6f4c){this[_0xa0a9('0xf')]['getUserById'](_0x307d7e)[_0xa0a9('0x10')](function(_0x504786){_0x4e6f4c(null,_0x504786?_0x504786[_0xa0a9('0x11')]:![]);})[_0xa0a9('0x14')](function(_0x4938da){_0x4e6f4c(_0x4938da);});};AGIVertices[_0xa0a9('0xe')]['getTrunk']=function(_0x20b318,_0x1f78e1){this[_0xa0a9('0xf')][_0xa0a9('0x19')](_0x20b318)['then'](function(_0x7c1502){_0x1f78e1(null,_0x7c1502?_0x7c1502[_0xa0a9('0x11')]:![]);})[_0xa0a9('0x14')](function(_0x3f4bea){_0x1f78e1(_0x3f4bea);});};AGIVertices['prototype'][_0xa0a9('0x1a')]=function(_0x38e454,_0x2eae30){var _0x5c446e=this;this['rpc'][_0xa0a9('0x1b')](_0x38e454)[_0xa0a9('0x10')](function(_0x10bbfd){_0x2eae30(null,_0x10bbfd?_0x5c446e[_0xa0a9('0x1c')](_0x10bbfd[_0xa0a9('0x1d')]):![]);})[_0xa0a9('0x14')](function(_0x2386c9){_0x2eae30(_0x2386c9);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x1e')]=function(_0x42024c,_0x41e994){this['rpc'][_0xa0a9('0x1f')](_0x42024c)[_0xa0a9('0x10')](function(_0x4fc94a){_0x41e994(null,_0x4fc94a?_0x4fc94a:![]);})[_0xa0a9('0x14')](function(_0x122f56){_0x41e994(_0x122f56);});};AGIVertices['prototype']['sendMailMessage']=function(_0x45374e,_0x5291e3,_0x5a1095){this[_0xa0a9('0xd')][_0xa0a9('0x20')](_0x45374e,_0x5291e3)[_0xa0a9('0x10')](function(){_0x5a1095(null);})[_0xa0a9('0x14')](function(_0x37f2d){_0x5a1095(_0x37f2d);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x21')]=function(_0x4bbcc2,_0x366ba9){this[_0xa0a9('0xf')]['getIntervalById'](_0x4bbcc2)[_0xa0a9('0x10')](function(_0x2f98f6){if(_0x2f98f6){if(_0x2f98f6[_0xa0a9('0x22')]){_0x366ba9(null,[_0x2f98f6['interval']]);}else{_0x366ba9(null,_['map'](_0x2f98f6[_0xa0a9('0x23')],_0xa0a9('0x24')));}}else{_0x366ba9(null,![]);}})[_0xa0a9('0x14')](function(_0x42fd7a){_0x366ba9(_0x42fd7a);});};AGIVertices['prototype'][_0xa0a9('0x1c')]=function(_0x19a122){return util[_0xa0a9('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x19a122);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x26')]=function(_0x4e121e,_0x53dfd1,_0x3ae735){odbc[_0xa0a9('0x27')](_0x4e121e,function(_0x41c056){if(_0x41c056){logger[_0xa0a9('0x28')](_0xa0a9('0x29'),_0x41c056);_0x3ae735(_0x41c056);}else{logger[_0xa0a9('0x2a')](_0xa0a9('0x2b'));odbc[_0xa0a9('0x2c')](_0x53dfd1,function(_0x20e23d,_0x2ea301){if(_0x20e23d){logger[_0xa0a9('0x2a')](_0xa0a9('0x2d'),_0x53dfd1);_0x3ae735(_0x20e23d);}else{logger[_0xa0a9('0x2a')](_0xa0a9('0x2e'),_0x53dfd1);odbc[_0xa0a9('0x2f')](function(_0x1b1aff){if(_0x1b1aff){logger[_0xa0a9('0x28')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1b1aff);}_0x3ae735(null,_0x2ea301);});}});}});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x30')]=function(_0x3d3769,_0x5aadc9){this[_0xa0a9('0xf')][_0xa0a9('0x31')](_0x3d3769)[_0xa0a9('0x10')](function(_0xbbd377){_0x5aadc9(null,_0xbbd377?_0xbbd377:![]);})['catch'](function(_0x26ffb8){_0x5aadc9(_0x26ffb8);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x32')]=function(_0x17c40b,_0x38be3f){this['rpc'][_0xa0a9('0x32')](_0x17c40b)[_0xa0a9('0x10')](function(_0x39c02a){_0x38be3f(null,_0x39c02a);})[_0xa0a9('0x14')](function(_0x1c0fec){_0x38be3f(_0x1c0fec);});};AGIVertices['prototype'][_0xa0a9('0x33')]=function(_0x11c130,_0x27358c,_0x1a0c79){this[_0xa0a9('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xa0a9('0xc')][_0xa0a9('0x34')],'node':_0x11c130['label'],'application':_0x11c130['agicommand'],'data':_0x27358c||null,'project_name':this[_0xa0a9('0xc')][_0xa0a9('0x35')],'callerid':this[_0xa0a9('0xc')][_0xa0a9('0x36')]})['then'](function(_0x464499){if(_0x1a0c79){_0x1a0c79(null,_0x464499);}})[_0xa0a9('0x14')](function(_0x1dc4ed){if(_0x1a0c79){_0x1a0c79(_0x1dc4ed);}});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x37')]=function(_0x1304e0,_0x39fa5b,_0x9690d6,_0xbdce0e){this[_0xa0a9('0xf')][_0xa0a9('0x37')]({'uniqueid':this[_0xa0a9('0xc')][_0xa0a9('0x34')],'callerid':this[_0xa0a9('0xc')][_0xa0a9('0x36')],'calleridname':this[_0xa0a9('0xc')][_0xa0a9('0x38')],'context':this['channel'][_0xa0a9('0x39')],'extension':this['channel'][_0xa0a9('0x3a')],'priority':this[_0xa0a9('0xc')][_0xa0a9('0x3b')],'accountcode':this[_0xa0a9('0xc')][_0xa0a9('0x3c')],'dnid':this[_0xa0a9('0xc')][_0xa0a9('0x3d')],'projectName':this[_0xa0a9('0xc')][_0xa0a9('0x35')],'saveName':_0x39fa5b,'filename':_0x1304e0['file']||_0x39fa5b,'savePath':_0x9690d6})[_0xa0a9('0x10')](function(_0x46a9ca){_0xbdce0e(null,_0x46a9ca);})[_0xa0a9('0x14')](function(_0x54cfa8){_0xbdce0e(_0x54cfa8);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x3e')]=function(_0x2c9c29,_0x4a35dd,_0xc1a16b,_0x7e1058,_0x2d0b1c){this[_0xa0a9('0xf')]['createSquareMessage']({'uniqueid':this[_0xa0a9('0xc')][_0xa0a9('0x34')],'body':_0x2c9c29,'direction':_0x4a35dd,'providerName':_0xc1a16b,'providerResponse':_0x7e1058})[_0xa0a9('0x10')](function(_0x2f97e2){if(_0x2d0b1c){_0x2d0b1c(null,_0x2f97e2);}})[_0xa0a9('0x14')](function(_0x41128b){if(_0x2d0b1c){_0x2d0b1c(_0x41128b);}});};AGIVertices[_0xa0a9('0xe')]['createCmContact']=function(_0x63cbda,_0x429c65){this['rpc'][_0xa0a9('0x3f')]({'firstName':_[_0xa0a9('0x40')](_0x63cbda[_0xa0a9('0x11')])||_['isNil'](_0x63cbda['name'])?_0xa0a9('0x41')+Math[_0xa0a9('0x42')]():_0x63cbda[_0xa0a9('0x11')],'lastName':_[_0xa0a9('0x40')](_0x63cbda['lastName'])||_['isNil'](_0x63cbda[_0xa0a9('0x43')])?null:_0x63cbda[_0xa0a9('0x43')],'phone':_0x63cbda['phone'],'ListId':_0x63cbda['list_id'],'scheduledat':_0x63cbda[_0xa0a9('0x44')],'callbackUniqueid':this[_0xa0a9('0xc')][_0xa0a9('0x34')],'tags':_0xa0a9('0x45'),'description':_0xa0a9('0x46')+_0x63cbda[_0xa0a9('0x44')][_0xa0a9('0x47')](),'priority':_0x63cbda[_0xa0a9('0x48')]})[_0xa0a9('0x10')](function(_0x23f1b1){_0x429c65(null,_0x23f1b1);})[_0xa0a9('0x14')](function(_0x52d34c){_0x429c65(_0x52d34c);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x49')]=function(_0xb0a05c,_0x481184){this[_0xa0a9('0xf')][_0xa0a9('0x4a')](_0xb0a05c)[_0xa0a9('0x10')](function(_0x4a1912){_0x481184(null,_0x4a1912?_0x4a1912[_0xa0a9('0x11')]:![]);})[_0xa0a9('0x14')](function(_0xe2d6f2){_0x481184(_0xe2d6f2);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x4b')]=function(_0x47107f,_0x12f97d,_0x577c1f){var _0x2b447f={'role':_0xa0a9('0x4c')};_0x2b447f[_0x47107f]=this[_0xa0a9('0xc')][_0xa0a9('0x36')];this[_0xa0a9('0xf')][_0xa0a9('0x4b')](_0x2b447f,_0x12f97d,this[_0xa0a9('0xc')]['uniqueid'])['then'](function(_0x4a2307){_0x577c1f(null,_[_0xa0a9('0x4d')](_0x4a2307)?![]:!![]);})['catch'](function(_0x331a0a){logger['error'](_0x331a0a);_0x577c1f(null,![]);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x4e')]=function(_0x5d06e0,_0x2f7ab4){var _0x31d3c0={'role':_0xa0a9('0x4c')};_0x31d3c0[_0x5d06e0]=this[_0xa0a9('0xc')][_0xa0a9('0x36')];this['rpc']['agentUnpause'](_0x31d3c0)[_0xa0a9('0x10')](function(_0x50249c){_0x2f7ab4(null,_[_0xa0a9('0x4d')](_0x50249c)?![]:!![]);})[_0xa0a9('0x14')](function(_0x3c526a){logger['error'](_0x3c526a);_0x2f7ab4(null,![]);});};AGIVertices[_0xa0a9('0xe')]['agentLogout']=function(_0x89b5bb,_0x194087){var _0x16873a={'role':'agent'};_0x16873a[_0x89b5bb]=this[_0xa0a9('0xc')]['callerid'];this[_0xa0a9('0xf')]['agentLogout'](_0x16873a)[_0xa0a9('0x10')](function(_0x4829f9){_0x194087(null,_[_0xa0a9('0x4d')](_0x4829f9)?![]:!![]);})[_0xa0a9('0x14')](function(_0x258aa4){logger[_0xa0a9('0x28')](_0x258aa4);_0x194087(null,![]);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x4f')]=function(_0x4cc06d,_0x2f5ea0){var _0x273a8c={'role':_0xa0a9('0x4c')};_0x273a8c[_0x4cc06d]=this['channel'][_0xa0a9('0x36')];var _0x184b0e=_0x4cc06d!=_0xa0a9('0x50')?util[_0xa0a9('0x25')](_0xa0a9('0x51'),'LOCAL',this[_0xa0a9('0xc')][_0xa0a9('0x36')]):undefined;this[_0xa0a9('0xf')][_0xa0a9('0x4f')](_0x273a8c,_0x184b0e)[_0xa0a9('0x10')](function(_0x3514d8){_0x2f5ea0(null,_[_0xa0a9('0x4d')](_0x3514d8)?![]:!![]);})[_0xa0a9('0x14')](function(_0x3a6b21){logger[_0xa0a9('0x28')](_0x3a6b21);_0x2f5ea0(null,![]);});};AGIVertices['prototype'][_0xa0a9('0x52')]=function(_0x1bae56,_0x183d4b){sh[_0xa0a9('0x53')](_[_0xa0a9('0x54')](_0x1bae56),function(_0x278cad,_0x1f47c){var _0x2bf2c2=_0x1f47c[_0xa0a9('0x55')](/(\r\n|\n|\r)/gm,'');_0x183d4b(null,_0x2bf2c2);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x56')]=function(_0x2915a4,_0x27cdcc){scripts[_0xa0a9('0x56')](_0x2915a4[_0xa0a9('0x57')],_0x2915a4[_0xa0a9('0x58')]||'text',_0x2915a4[_0xa0a9('0x59')],_0x2915a4['languageCode']||_0xa0a9('0x5a'),_0x2915a4['ssmlGender']||_0xa0a9('0x5b'),_0x2915a4[_0xa0a9('0x5c')]||_0xa0a9('0x5d'))[_0xa0a9('0x10')](function(_0x4755ce){_0x27cdcc(null,_0x4755ce);})[_0xa0a9('0x14')](function(_0x2aec78){_0x27cdcc(_0x2aec78);});};AGIVertices['prototype'][_0xa0a9('0x5e')]=function(_0x2faa44,_0x44a73b){scripts[_0xa0a9('0x5e')](_0x2faa44[_0xa0a9('0x59')],_0x2faa44[_0xa0a9('0x5f')]||'en',0x1)[_0xa0a9('0x10')](function(_0x23b7ca){_0x44a73b(null,_0x23b7ca);})[_0xa0a9('0x14')](function(_0x4da18d){_0x44a73b(_0x4da18d);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x60')]=function(_0x36dbf4,_0x2a0a40){var _0x465c12={'uri':_0x36dbf4[_0xa0a9('0x61')],'method':_0x36dbf4[_0xa0a9('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x36dbf4[_0xa0a9('0x63')])==='number'&&parseInt(_0x36dbf4[_0xa0a9('0x63')])>=0x1?parseInt(_0x36dbf4[_0xa0a9('0x63')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xa0a9('0x64'),_0xa0a9('0x65')],_0x465c12[_0xa0a9('0x62')][_0xa0a9('0x66')]())){try{_0x465c12[_0xa0a9('0x67')]=_0x36dbf4[_0xa0a9('0xa')]?JSON[_0xa0a9('0x68')](_0x36dbf4[_0xa0a9('0xa')]):{};}catch(_0x8a5178){logger[_0xa0a9('0x28')](_0xa0a9('0x69'),_0x8a5178);}}try{_0x465c12[_0xa0a9('0x6a')]=_0x36dbf4[_0xa0a9('0x9')]?JSON['parse'](_0x36dbf4['rawHeaders']):{};}catch(_0x3d809d){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3d809d);}if(_0x36dbf4[_0xa0a9('0x6b')]){try{var _0x2b408a=require(_0x36dbf4['computedVariables'])[_0xa0a9('0x6c')](this,_0x465c12);_0x465c12[_0xa0a9('0x6d')]=Mustache[_0xa0a9('0x6e')](_0x36dbf4[_0xa0a9('0x61')],_0x2b408a,{},['$$','$$']);if(_0x465c12[_0xa0a9('0x6a')]){_0x465c12[_0xa0a9('0x6a')]=JSON[_0xa0a9('0x68')](Mustache['render'](JSON[_0xa0a9('0x6f')](_0x465c12['headers']),_0x2b408a,{},['$$','$$']));}if(_0x465c12['body']){_0x465c12['body']=JSON[_0xa0a9('0x68')](Mustache[_0xa0a9('0x6e')](JSON['stringify'](_0x465c12[_0xa0a9('0x67')]),_0x2b408a,{},['$$','$$']));}}catch(_0x435f68){logger[_0xa0a9('0x28')](_0xa0a9('0x70'),_0x435f68);}}rp(_0x465c12)[_0xa0a9('0x10')](function(_0x26adae){var _0x1bd849={'statusCode':_0x26adae['statusCode']||0xc8,'statusMessage':_0x26adae[_0xa0a9('0x71')]||'OK','headers':_0x26adae['headers']||{},'body':_0x26adae[_0xa0a9('0x67')]||{}};_0x2a0a40(null,_0x1bd849);})[_0xa0a9('0x14')](function(_0x1a3fe4){var _0x132b50={'statusCode':_0x1a3fe4['statusCode']||0x1f4,'statusMessage':_0x1a3fe4['message']||_0xa0a9('0x72'),'headers':_0x1a3fe4[_0xa0a9('0x73')][_0xa0a9('0x6a')]||{},'body':_0x1a3fe4[_0xa0a9('0x73')][_0xa0a9('0x67')]||{}};_0x2a0a40(null,_0x132b50);});};AGIVertices[_0xa0a9('0xe')]['googleDialogflow']=function(_0x51bfd8,_0x44d006){scripts[_0xa0a9('0x74')](this[_0xa0a9('0xc')][_0xa0a9('0x34')],_0x51bfd8[_0xa0a9('0x75')],_0x51bfd8[_0xa0a9('0x59')],_0x51bfd8[_0xa0a9('0x76')]||'en')['then'](function(_0xfd9faf){_0x44d006(null,_0xfd9faf);})[_0xa0a9('0x14')](function(_0x503b24){_0x44d006(_0x503b24);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x77')]=function(_0x591449,_0x32575f){scripts[_0xa0a9('0x77')](this['channel']['uniqueid'],_0x591449['dialogflowV2_project_id'],_0x591449[_0xa0a9('0x78')],_0x591449['private_key'],_0x591449[_0xa0a9('0x59')],_0x591449[_0xa0a9('0x79')]||'en')[_0xa0a9('0x10')](function(_0x58e78e){_0x32575f(null,_0x58e78e);})['catch'](function(_0x51aa68){_0x32575f(_0x51aa68);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x7a')]=function(_0x4f0b5f,_0x53197f){scripts['sestekNDA'](this[_0xa0a9('0xc')],_0x4f0b5f)[_0xa0a9('0x10')](function(_0x295145){_0x53197f(null,_0x295145);})[_0xa0a9('0x14')](function(_0x50fae3){_0x53197f(_0x50fae3);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x7b')]=function(_0x5c943d,_0x455b37){scripts[_0xa0a9('0x7b')](_0x5c943d[_0xa0a9('0x75')],_0x5c943d['text'],_0x5c943d[_0xa0a9('0x7c')]||_0xa0a9('0x5a'),_0x5c943d[_0xa0a9('0x7d')])['then'](function(_0x10ff5a){_0x455b37(null,_0x10ff5a);})[_0xa0a9('0x14')](function(_0x5e793d){_0x455b37(_0x5e793d);});};AGIVertices[_0xa0a9('0xe')]['ispeechASR']=function(_0x565979,_0x930af7,_0x4ff01d){scripts['ispeechASR'](_0x930af7,_0x565979[_0xa0a9('0x75')],_0x565979[_0xa0a9('0x7e')]||'en-US',this[_0xa0a9('0x7f')](_0x565979['model'])?_0x565979[_0xa0a9('0x80')]:undefined)[_0xa0a9('0x10')](function(_0x5dc92b){_0x4ff01d(null,_0x5dc92b);})[_0xa0a9('0x14')](function(_0x130428){_0x4ff01d(_0x130428);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x81')]=function(_0x182ef3,_0x4ae8e2){scripts[_0xa0a9('0x81')](_0x182ef3[_0xa0a9('0x82')],_0x182ef3[_0xa0a9('0x83')],_0x182ef3[_0xa0a9('0x84')],_0x182ef3[_0xa0a9('0x85')]||'Amy',_0x182ef3[_0xa0a9('0x59')],_0x182ef3[_0xa0a9('0x86')]||_0xa0a9('0x59'))[_0xa0a9('0x10')](function(_0x48c9f5){_0x4ae8e2(null,_0x48c9f5);})[_0xa0a9('0x14')](function(_0x23a2bf){_0x4ae8e2(_0x23a2bf);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x87')]=function(_0x411c1a,_0x357bfe){scripts[_0xa0a9('0x87')](this['channel']['uniqueid'],_0x411c1a[_0xa0a9('0x82')],_0x411c1a[_0xa0a9('0x83')],_0x411c1a[_0xa0a9('0x88')],_0x411c1a[_0xa0a9('0x59')],_0x411c1a[_0xa0a9('0x89')])['then'](function(_0x4d3705){_0x357bfe(null,_0x4d3705);})[_0xa0a9('0x14')](function(_0x3ca8ed){_0x357bfe(_0x3ca8ed);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x8a')]=function(_0x3788d3,_0x19f07a,_0x3a742f){scripts[_0xa0a9('0x8a')](_0x19f07a,_0x3788d3[_0xa0a9('0x75')],_0x3788d3[_0xa0a9('0x8b')]||_0xa0a9('0x5a'))[_0xa0a9('0x10')](function(_0x27d117){_0x3a742f(null,_0x27d117);})[_0xa0a9('0x14')](function(_0x308196){_0x3a742f(_0x308196);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x8c')]=function(_0x160473,_0x3db961,_0x36a501){scripts[_0xa0a9('0x8c')](_0x3db961,_0x160473[_0xa0a9('0x8d')],_0x160473[_0xa0a9('0x8e')],_0x160473['uri'])['then'](function(_0x5cf91e){_0x36a501(null,_0x5cf91e);})[_0xa0a9('0x14')](function(_0x21e364){_0x36a501(_0x21e364);});};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x8f')]=function(_0x3ed1c3){var _0x283324=_['includes'](verticesWithRetry,_0x3ed1c3[_0xa0a9('0x90')])?_0x3ed1c3:_[_0xa0a9('0x91')](_0x3ed1c3);for(var _0x3b8d17 in _0x283324){if(_0x283324[_0xa0a9('0x92')](_0x3b8d17)){if(_0x283324[_0x3b8d17]&&_['isString'](_0x283324[_0x3b8d17])){if(_[_0xa0a9('0x93')](recursiveMapAttributes,_0x3b8d17)){_0x283324[_0x3b8d17]=this[_0xa0a9('0x94')](_0x283324[_0x3b8d17]);}else{_0x283324[_0x3b8d17]=this[_0xa0a9('0x95')](_0x283324[_0x3b8d17]);}}}}return _0x283324;};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x96')]=function(_0x6f0c1a){for(var _0x63e1f8 in _0x6f0c1a){if(_0x6f0c1a['hasOwnProperty'](_0x63e1f8)){if(_['isPlainObject'](_0x6f0c1a[_0x63e1f8])){this['recursiveNodeIndex'](_0x6f0c1a[_0x63e1f8]);}else if(_[_0xa0a9('0x97')](_0x6f0c1a[_0x63e1f8])){for(var _0x21bd11=0x0;_0x21bd11<_0x6f0c1a[_0x63e1f8][_0xa0a9('0x98')];_0x21bd11++){this[_0xa0a9('0x96')](_0x6f0c1a[_0x63e1f8][_0x21bd11]);}}else if(_['isString'](_0x6f0c1a[_0x63e1f8])){_0x6f0c1a[_0x63e1f8]=this['replaceAllVariables'](_0x6f0c1a[_0x63e1f8]);}}}};AGIVertices[_0xa0a9('0xe')]['saveRestApiResult']=function(_0x9d50c5,_0x5bdebb){for(var _0xb5dbbe in _0x9d50c5){if(_0x9d50c5[_0xa0a9('0x92')](_0xb5dbbe)){if(_['isPlainObject'](_0x9d50c5[_0xb5dbbe])){if(!_[_0xa0a9('0x40')](_0x9d50c5[_0xb5dbbe])){this[_0xa0a9('0x99')](_0x9d50c5[_0xb5dbbe],util['format'](_0xa0a9('0x9a'),_0x5bdebb,_0xb5dbbe));}}else if(_[_0xa0a9('0x97')](_0x9d50c5[_0xb5dbbe])){for(var _0xe93099=0x0;_0xe93099<_0x9d50c5[_0xb5dbbe][_0xa0a9('0x98')];_0xe93099++){this[_0xa0a9('0x99')](_0x9d50c5[_0xb5dbbe][_0xe93099],util[_0xa0a9('0x25')](_0xa0a9('0x9a'),_0x5bdebb,_0xb5dbbe+'['+_0xe93099+']'));}}else{if(!_['isNil'](_0x9d50c5[_0xb5dbbe])){this['channel'][_0xa0a9('0x9b')](util[_0xa0a9('0x25')]('%s.%s',_0x5bdebb,_0xb5dbbe),_0x9d50c5[_0xb5dbbe]);}}}}};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x94')]=function(_0x13e6c5){try{var _0x2a1b0f=JSON[_0xa0a9('0x68')](_0x13e6c5);this[_0xa0a9('0x96')](_0x2a1b0f);return JSON['stringify'](_0x2a1b0f);}catch(_0x1b3c8e){return this['replaceAllVariables'](_0x13e6c5);}};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x95')]=function(_0x54cc2e){var _0x8b0cdd=_0x54cc2e[_0xa0a9('0x9c')]('{');for(var _0x2f9e19=0x1;_0x2f9e19<_0x8b0cdd[_0xa0a9('0x98')];_0x2f9e19+=0x1){var _0x2c1e79=_0x8b0cdd[_0x2f9e19][_0xa0a9('0x9c')]('}');if(_0x2c1e79['length']>0x1){_0x54cc2e=_0x54cc2e[_0xa0a9('0x9d')]('{'+_0x2c1e79[0x0]+'}',this[_0xa0a9('0xc')][_0xa0a9('0x9e')](_0x2c1e79[0x0])[_0xa0a9('0x9f')]||_0x2c1e79[0x0]);}}if(_0x8b0cdd['length']===0x1){return _0x54cc2e[_0xa0a9('0x47')]();}return this['replaceAllVariables'](_0x54cc2e);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xa0')]=function(_0x44a188,_0x41dc60){var _0x49470a=this[_0xa0a9('0xc')][_0xa0a9('0x9e')](_0x44a188);if(_0x49470a['result']===-0x1){return _0x49470a;}logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0xa1'),_0x41dc60,_0x49470a['extra']));return this[_0xa0a9('0xc')][_0xa0a9('0x9b')](_0x41dc60,_0x49470a[_0xa0a9('0x9f')]);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x7f')]=function(_0x1d0c93){return _0x1d0c93&&_0x1d0c93!=='0'&&_0x1d0c93!=='-1'&&_0x1d0c93!=='';};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xa2')]=function(_0x3de7b5){this['createSquareDetailsReport'][_0xa0a9('0x6c')](this,_0x3de7b5,'-');_0x3de7b5[_0xa0a9('0xa3')]=_0x3de7b5[_0xa0a9('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa0a9('0xe')]['mrcpsynth']=function(_0x5b5986){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0xa4'),_0x5b5986[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x5b5986[_0xa0a9('0x59')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20text\x20configured');}var _0x3c9f79='\x22'+_0x5b5986[_0xa0a9('0x59')]+'\x22';if(this[_0xa0a9('0x7f')](_0x5b5986[_0xa0a9('0x73')])){_0x3c9f79+=','+_0x5b5986[_0xa0a9('0x73')];}var _0x3c1e9e=this[_0xa0a9('0xc')][_0xa0a9('0x53')]('MRCPSynth',_0x3c9f79);if(_0x3c1e9e[_0xa0a9('0xa7')]===-0x1){return _0x3c1e9e;}return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')](_0xa0a9('0xa8'),_0x3c9f79));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xa9')]=function(_0x4a836e){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0xaa'),_0x4a836e[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x4a836e[_0xa0a9('0xab')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20grammar\x20configured');}var _0x1dbada=_0x4a836e[_0xa0a9('0xab')];if(this[_0xa0a9('0x7f')](_0x4a836e[_0xa0a9('0x73')])){_0x1dbada+=','+_0x4a836e[_0xa0a9('0x73')];}var _0x2f2539=this[_0xa0a9('0xc')]['exec'](_0xa0a9('0xac'),_0x1dbada);if(_0x2f2539[_0xa0a9('0xa7')]===-0x1){return _0x2f2539;}var _0x91a180=this[_0xa0a9('0xa0')](_0xa0a9('0xad'),_0xa0a9('0xae'));if(_0x91a180[_0xa0a9('0xa7')]===-0x1){return _0x91a180;}var _0x436650=this[_0xa0a9('0xa0')](_0xa0a9('0xaf'),_0xa0a9('0xb0'));if(_0x436650[_0xa0a9('0xa7')]===-0x1){return _0x436650;}var _0x391446=this[_0xa0a9('0xa0')](_0xa0a9('0xb1'),_0xa0a9('0xb2'));if(_0x391446[_0xa0a9('0xa7')]===-0x1){return _0x391446;}return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')](_0xa0a9('0xb3'),_0x1dbada));};AGIVertices['prototype'][_0xa0a9('0x6')]=function(_0x22841a){logger['info'](util[_0xa0a9('0x25')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x22841a['label']));return this[_0xa0a9('0xc')][_0xa0a9('0x6')]([_0x22841a[_0xa0a9('0xb4')],_0x22841a['args']]);};AGIVertices[_0xa0a9('0xe')]['answer']=function(_0x3ff32e){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0xb5'),_0x3ff32e[_0xa0a9('0xa5')]));if(this[_0xa0a9('0x7f')](_0x3ff32e[_0xa0a9('0x63')])){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0xb6'),_0x3ff32e[_0xa0a9('0x63')]));var _0x27b2b9=this[_0xa0a9('0xc')][_0xa0a9('0xb7')](_0x3ff32e[_0xa0a9('0x63')]);if(_0x27b2b9['result']===-0x1){return _0x27b2b9;}}return this[_0xa0a9('0xc')][_0xa0a9('0xb8')]();};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x45')]=function(_0x14038e){logger['info'](util[_0xa0a9('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x14038e[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x14038e[_0xa0a9('0xb9')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x14038e,'no\x20list\x20selected');}_0x14038e[_0xa0a9('0x44')]=moment();if(this['isConfigured'](_0x14038e[_0xa0a9('0xba')])){_0x14038e[_0xa0a9('0x44')]=moment()[_0xa0a9('0xbb')](_0x14038e[_0xa0a9('0xba')],_0xa0a9('0xbc'));}if(!this['isConfigured'](_0x14038e[_0xa0a9('0x48')])){_0x14038e['callback_priority']=0x2;}this[_0xa0a9('0x3f')][_0xa0a9('0x6c')](this,_0x14038e);return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x14038e[_0xa0a9('0xbd')],_0x14038e['list_id'],_0x14038e[_0xa0a9('0x44')]));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xbe')]=function(_0x54f636){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0xbf'),_0x54f636['label']));var _0x58180d=this[_0xa0a9('0xc')]['exec'](_0x54f636['application'],_0x54f636['options']);if(_0x58180d[_0xa0a9('0xa7')]===-0x1){return _0x58180d;}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('Executed\x20command\x20%s\x20%s',_0x54f636[_0xa0a9('0xc0')],_0x54f636['options']));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xc1')]=function(_0x3e6f25){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0xc2'),_0x3e6f25[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x3e6f25[_0xa0a9('0x59')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}var _0x42628b='\x22'+_0x3e6f25[_0xa0a9('0x59')]+'\x22';if(this[_0xa0a9('0x7f')](_0x3e6f25['options'])){_0x42628b+=','+_0x3e6f25[_0xa0a9('0x73')];}var _0x2d43db=this[_0xa0a9('0xc')][_0xa0a9('0x53')](_0xa0a9('0xc4'),_0x42628b);if(_0x2d43db[_0xa0a9('0xa7')]===-0x1){return _0x2d43db;}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format'](_0xa0a9('0xa8'),_0x42628b));};AGIVertices['prototype'][_0xa0a9('0xc5')]=function(_0x2d27bb){logger['info'](util['format'](_0xa0a9('0xc6'),_0x2d27bb[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x2d27bb[_0xa0a9('0x59')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}var _0x693cb8='\x22'+_0x2d27bb[_0xa0a9('0x59')]+'\x22';if(this[_0xa0a9('0x7f')](_0x2d27bb[_0xa0a9('0x73')])){_0x693cb8+=','+_0x2d27bb['options'];}var _0x5ba663=this[_0xa0a9('0xc')][_0xa0a9('0x53')](_0xa0a9('0xc4'),_0x693cb8);if(_0x5ba663[_0xa0a9('0xa7')]===-0x1){return _0x5ba663;}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0xa8'),_0x693cb8));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xc7')]=function(_0x3c40e7){logger['info'](util[_0xa0a9('0x25')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3c40e7[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x3c40e7[_0xa0a9('0xab')])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0xc8'));}var _0x189a6d=_0x3c40e7[_0xa0a9('0xab')];if(this[_0xa0a9('0x7f')](_0x3c40e7[_0xa0a9('0x73')])){_0x189a6d+=','+_0x3c40e7[_0xa0a9('0x73')];}var _0x79cac0=this[_0xa0a9('0xc')][_0xa0a9('0x53')]('MRCPRecog',_0x189a6d);if(_0x79cac0[_0xa0a9('0xa7')]===-0x1){return _0x79cac0;}var _0x14a805=this[_0xa0a9('0xa0')]('RECOG_CONFIDENCE()',_0xa0a9('0xc9'));if(_0x14a805[_0xa0a9('0xa7')]===-0x1){return _0x14a805;}var _0x12b2fd=this[_0xa0a9('0xa0')]('RECOG_INPUT()',_0xa0a9('0xca'));if(_0x12b2fd[_0xa0a9('0xa7')]===-0x1){return _0x12b2fd;}var _0x397629=this[_0xa0a9('0xa0')]('RECOG_INSTANCE()',_0xa0a9('0xcb'));if(_0x397629[_0xa0a9('0xa7')]===-0x1){return _0x397629;}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0xb3'),_0x189a6d));};AGIVertices[_0xa0a9('0xe')]['sestekasr']=function(_0x132475){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x132475['label']));if(!this[_0xa0a9('0x7f')](_0x132475[_0xa0a9('0xab')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc8'));}var _0x519cf5=_0x132475[_0xa0a9('0xab')];if(this[_0xa0a9('0x7f')](_0x132475[_0xa0a9('0x73')])){_0x519cf5+=','+_0x132475['options'];}var _0x53b4b9=this[_0xa0a9('0xc')]['exec'](_0xa0a9('0xac'),_0x519cf5);if(_0x53b4b9[_0xa0a9('0xa7')]===-0x1){return _0x53b4b9;}var _0x1543ee=this['getAndSetVariable'](_0xa0a9('0xad'),'SESTEK_ASR_CONFIDENCE');if(_0x1543ee[_0xa0a9('0xa7')]===-0x1){return _0x1543ee;}var _0xd3816f=this['getAndSetVariable'](_0xa0a9('0xaf'),_0xa0a9('0xcc'));if(_0xd3816f['result']===-0x1){return _0xd3816f;}var _0xcd4e5b=this[_0xa0a9('0xa0')]('RECOG_INSTANCE()',_0xa0a9('0xcd'));if(_0xcd4e5b[_0xa0a9('0xa7')]===-0x1){return _0xcd4e5b;}return this['channel']['noop'](util[_0xa0a9('0x25')](_0xa0a9('0xb3'),_0x519cf5));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xce')]=function(_0x3ee61d){logger[_0xa0a9('0x2a')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3ee61d[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x3ee61d[_0xa0a9('0xcf')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x3ee61d,_0xa0a9('0xd0'));}var _0x568c78=this[_0xa0a9('0x17')][_0xa0a9('0x6c')](this,_0x3ee61d[_0xa0a9('0xcf')]);if(!_0x568c78){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x3ee61d,_0xa0a9('0xd1'));}if(!this['isConfigured'](_0x3ee61d[_0xa0a9('0x2c')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x3ee61d,_0xa0a9('0xd2'));}var _0x50987c=_0x3ee61d['query'][_0xa0a9('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0xd3'),_0x50987c));var _0x6e8b08=this[_0xa0a9('0x26')][_0xa0a9('0x6c')](this,_0x568c78,_0x50987c);this['createSquareDetailsReport'][_0xa0a9('0x6c')](this,_0x3ee61d,_0x50987c);if(!this['isConfigured'](_0x3ee61d[_0xa0a9('0xd4')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xd5'));}var _0x4761d5=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x3ee61d[_0xa0a9('0xd4')]);if(!_0x4761d5){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x3ee61d,_0xa0a9('0xd6'));}var _0x207e6f=this;_0x6e8b08['forEach'](function(_0x3f82e8,_0x5553ab){Object['keys'](_0x3f82e8)[_0xa0a9('0xd7')](function(_0x2776dc){_0x207e6f['channel']['setVariable'](util[_0xa0a9('0x25')](_0xa0a9('0xd8'),_0x4761d5,_0x5553ab,_0x2776dc),_0x3f82e8[_0x2776dc]);});});this[_0xa0a9('0xc')]['setVariable'](util[_0xa0a9('0x25')](_0xa0a9('0xd9'),_0x4761d5),_0x6e8b08[_0xa0a9('0x98')]);return this['channel'][_0xa0a9('0xa6')](util['format'](_0xa0a9('0xda'),_0x4761d5));};AGIVertices[_0xa0a9('0xe')]['dial']=function(_0x4c0f65){logger[_0xa0a9('0xdb')](util['format'](_0xa0a9('0xdc'),_0x4c0f65['label']));if(!this[_0xa0a9('0x7f')](_0x4c0f65[_0xa0a9('0xdd')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x4c0f65,'no\x20user\x20selected');}var _0x25c27b=this[_0xa0a9('0xde')][_0xa0a9('0x6c')](this,_0x4c0f65['sip_id']);if(!_0x25c27b){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x4c0f65,_0xa0a9('0xdf'));}var _0x1d3efd=this[_0xa0a9('0xc')][_0xa0a9('0x53')](_0xa0a9('0xe0'),[util[_0xa0a9('0x25')](_0xa0a9('0xe1'),_0x25c27b),_0x4c0f65[_0xa0a9('0x63')],_0x4c0f65[_0xa0a9('0xe2')],_0x4c0f65['url']]);if(_0x1d3efd['result']===-0x1){return _0x1d3efd;}return this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0xe3'),'DIAL'));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0xe4')]=function(_0x4d1058){logger[_0xa0a9('0x2a')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4d1058[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x4d1058['key'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20key\x20configured');}if(!this[_0xa0a9('0x7f')](_0x4d1058[_0xa0a9('0x59')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this[_0xa0a9('0xc')][_0xa0a9('0xe5')]=!![];this['createSquareDetailsReport'](_0x4d1058);this[_0xa0a9('0x3e')](_0x4d1058[_0xa0a9('0x59')],'in','','');this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')]('Trying\x20Dialogflow:\x20%s',_0x4d1058['text']));var _0x425c9d=this[_0xa0a9('0x74')][_0xa0a9('0x6c')](this,_0x4d1058);if(_0x425c9d){for(var _0x142963 in _0x425c9d){if(_0x425c9d['hasOwnProperty'](_0x142963)){this[_0xa0a9('0xc')][_0xa0a9('0x9b')](util['format'](_0xa0a9('0xe6'),_0x142963[_0xa0a9('0x66')]()),_0x425c9d[_0x142963]);}}this[_0xa0a9('0x3e')](_0x425c9d[_0xa0a9('0xe7')],_0xa0a9('0xe8'),_0xa0a9('0xe4'),'');return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')](_0xa0a9('0xe9'),_0x425c9d[_0xa0a9('0xe7')]));}return this[_0xa0a9('0xc')]['error'](_0x4d1058,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x48cd82){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0xea'),_0x48cd82[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x48cd82[_0xa0a9('0xeb')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20project_id\x20configured');}if(!this[_0xa0a9('0x7f')](_0x48cd82[_0xa0a9('0x78')])){return this[_0xa0a9('0xc')]['noop'](_0xa0a9('0xec'));}if(!this['isConfigured'](_0x48cd82['private_key'])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0xed'));}if(!this['isConfigured'](_0x48cd82['dialogflowV2_language'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xee'));}if(!this[_0xa0a9('0x7f')](_0x48cd82['text'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this[_0xa0a9('0xc')][_0xa0a9('0xe5')]=!![];this[_0xa0a9('0x33')](_0x48cd82);this[_0xa0a9('0x3e')](_0x48cd82[_0xa0a9('0x59')],'in','','');this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0xef'),_0x48cd82['text']));var _0x2f6e21=this[_0xa0a9('0x77')][_0xa0a9('0x6c')](this,_0x48cd82);if(_0x2f6e21){for(var _0x197d0f in _0x2f6e21){if(_0x2f6e21[_0xa0a9('0x92')](_0x197d0f)){if(_0x197d0f!==_0xa0a9('0xf0')){this[_0xa0a9('0xc')][_0xa0a9('0x9b')](util['format']('DIALOGFLOW_%s',_0x197d0f[_0xa0a9('0x66')]()),_0x2f6e21[_0x197d0f]);}}}this['createSquareMessage'](_0x2f6e21[_0xa0a9('0xe7')],_0xa0a9('0xe8'),_0xa0a9('0xf1'),_0x2f6e21[_0xa0a9('0xf0')]);return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0xf2'),_0x2f6e21[_0xa0a9('0xe7')]));}return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x48cd82,_0xa0a9('0xf3'));};AGIVertices['prototype'][_0xa0a9('0xf4')]=function(_0x3e4442){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0xf5'),_0x3e4442[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x3e4442['ndauth_url'])){return this['channel']['noop'](_0xa0a9('0xf6'));}if(!this[_0xa0a9('0x7f')](_0x3e4442['username'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xf7'));}if(!this[_0xa0a9('0x7f')](_0x3e4442[_0xa0a9('0xf8')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xf9'));}if(!this['isConfigured'](_0x3e4442[_0xa0a9('0xfa')])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x3e4442);this[_0xa0a9('0x3e')](_0x3e4442[_0xa0a9('0x59')],'in','','');this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format']('Trying\x20SestekNDA:\x20%s',_0x3e4442[_0xa0a9('0x59')]));var _0x334e81=this[_0xa0a9('0x7a')][_0xa0a9('0x6c')](this,_0x3e4442);if(_0x334e81){for(var _0x38463d in _0x334e81){if(_0x334e81[_0xa0a9('0x92')](_0x38463d)){this[_0xa0a9('0xc')][_0xa0a9('0x9b')](util[_0xa0a9('0x25')](_0xa0a9('0xfb'),_0x38463d[_0xa0a9('0x66')]()),_0x334e81[_0x38463d]);}}this[_0xa0a9('0x3e')](_0x334e81[_0xa0a9('0xe7')],'out','sesteknda','');if(_0x334e81[_0xa0a9('0xfc')]){this[_0xa0a9('0xc')]['noop'](util['format'](_0xa0a9('0xfd'),_0x334e81[_0xa0a9('0xfc')]));var _0x3c9b49=this[_0xa0a9('0xc')][_0xa0a9('0xfe')](_0x334e81[_0xa0a9('0xfc')]);try{fs[_0xa0a9('0xff')](_0x334e81[_0xa0a9('0xfc')]+_0xa0a9('0x100'));}catch(_0x307abf){logger[_0xa0a9('0x28')](_0x307abf);}return _0x3c9b49;}else{return this['channel']['noop'](util['format'](_0xa0a9('0x101'),_0x334e81['speech']));}}return this['channel'][_0xa0a9('0x28')](_0x3e4442,_0xa0a9('0x102'));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x103')]=function(_0xef2bd6){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x104'),_0xef2bd6[_0xa0a9('0xa5')]));return this[_0xa0a9('0xc')]['noop'](_0xa0a9('0x103'));};AGIVertices['prototype'][_0xa0a9('0x105')]=function(_0xe0bda5){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xe0bda5[_0xa0a9('0xa5')]));var _0x25b313='';if(_0xe0bda5['trunk_id']){if(!this[_0xa0a9('0x7f')](_0xe0bda5['trunk_id'])){return this['channel'][_0xa0a9('0x28')](_0xe0bda5,_0xa0a9('0x106'));}else{var _0x59c2a1=parseInt(_0xe0bda5[_0xa0a9('0x107')],0xa);if(isNaN(_0x59c2a1)){_0x25b313=_0xe0bda5[_0xa0a9('0x107')];}else{_0x25b313=this['getTrunk'][_0xa0a9('0x6c')](this,_0xe0bda5[_0xa0a9('0x107')]);if(!_0x25b313){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0xe0bda5,_0xa0a9('0x108'));}}}}else if(_0xe0bda5[_0xa0a9('0x109')]){_0x25b313=_0xe0bda5[_0xa0a9('0x109')];}else{return this[_0xa0a9('0xc')]['error'](_0xe0bda5,_0xa0a9('0x106'));}var _0x34c880=this[_0xa0a9('0xc')][_0xa0a9('0x53')](_0xa0a9('0xe0'),[util[_0xa0a9('0x25')](_0xa0a9('0x10a'),_0x25b313,_0xe0bda5[_0xa0a9('0xbd')]),_0xe0bda5[_0xa0a9('0x63')],_0xe0bda5[_0xa0a9('0xe2')],_0xe0bda5[_0xa0a9('0x61')]]);if(_0x34c880[_0xa0a9('0xa7')]===-0x1){return _0x34c880;}return this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('Executed\x20command\x20%s',_0xa0a9('0xe0')));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x10b')]=function(_0x481ae1){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x10c'),_0x481ae1['label']));return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x10b'));};AGIVertices['prototype'][_0xa0a9('0xb')]=function(_0x170e40){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x170e40[_0xa0a9('0xa5')]));if(_0x170e40[_0xa0a9('0xa3')]===0x0){return this[_0xa0a9('0xa2')](_0x170e40);}_0x170e40[_0xa0a9('0xa3')]-=0x1;if(!this[_0xa0a9('0x7f')](_0x170e40[_0xa0a9('0x10d')])){return this['channel']['error'](_0x170e40,'no\x20file\x20audio\x20selected');}var _0x26ea60=this[_0xa0a9('0x1a')][_0xa0a9('0x6c')](this,_0x170e40[_0xa0a9('0x10d')]);if(!_0x26ea60){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x170e40,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x170e40[_0xa0a9('0xd4')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5403b1=this[_0xa0a9('0xc')]['getData'](_0x26ea60,_0x170e40['response'],_0x170e40[_0xa0a9('0x10e')]);var _0x22b3a3=_0x5403b1['result']?_0x5403b1[_0xa0a9('0xa7')][_0xa0a9('0x47')]():'';logger[_0xa0a9('0x2a')]('test',JSON[_0xa0a9('0x6f')](_0x5403b1));if(_0x5403b1[_0xa0a9('0xa7')]===-0x1){this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x170e40,_0x22b3a3);return _0x5403b1;}else if(_0x5403b1['extra']===_0xa0a9('0x63')){_0x5403b1[_0xa0a9('0xa7')]=_0x22b3a3[_0xa0a9('0x98')]>=parseInt(_0x170e40[_0xa0a9('0x10f')])?'x':'i';}else{_0x5403b1[_0xa0a9('0xa7')]=_0x22b3a3[_0xa0a9('0x98')]>=parseInt(_0x170e40[_0xa0a9('0x10f')])&&_0x22b3a3['length']<=parseInt(_0x170e40['maxdigit'])?'x':'i';}var _0x51c79b=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x170e40[_0xa0a9('0xd4')]);if(!_0x51c79b){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x170e40,'no\x20variable\x20found');}this['channel'][_0xa0a9('0x9b')](_0x51c79b,_0x22b3a3);if(this[_0xa0a9('0x7f')](_0x170e40[_0xa0a9('0x110')])){var _0x57f984=parseInt(_0x170e40[_0xa0a9('0x110')],0xa);var _0x31b519=rs[_0xa0a9('0x111')]({'charset':'*','length':_0x57f984});var _0x3fa016=_0x22b3a3[_0xa0a9('0x98')];if(_0x3fa016>0x0){if(_0x3fa016>_0x57f984){this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x170e40,_0x170e40[_0xa0a9('0x112')]===_0xa0a9('0x113')?_0x31b519+_0x22b3a3[_0xa0a9('0x114')](_0x57f984):_0x22b3a3['substr'](0x0,_0x3fa016-_0x57f984)+_0x31b519);}else{this['createSquareDetailsReport'][_0xa0a9('0x6c')](this,_0x170e40,rs[_0xa0a9('0x111')]({'charset':'*','length':_0x3fa016}));}}else{this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x170e40,'');}}else{this[_0xa0a9('0x33')]['sync'](this,_0x170e40,_0x22b3a3);}return _0x5403b1;};AGIVertices['prototype'][_0xa0a9('0x115')]=function(_0x33cab2){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x33cab2[_0xa0a9('0xa5')]));return this[_0xa0a9('0xb')](_0x33cab2);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x116')]=function(_0x8c4d7b){logger['info'](util['format'](_0xa0a9('0x117'),_0x8c4d7b['label']));this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x8c4d7b,_0x8c4d7b['goalname']);return this['channel'][_0xa0a9('0xa6')](util['format'](_0xa0a9('0x118'),_0x8c4d7b[_0xa0a9('0x119')]));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x11a')]=function(_0xcb18a8){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x11b'),_0xcb18a8['label']));if(!this[_0xa0a9('0x7f')](_0xcb18a8['aws_access_key_id'])||!this[_0xa0a9('0x7f')](_0xcb18a8[_0xa0a9('0x83')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xa0a9('0x7f')](_0xcb18a8['text'])){return this[_0xa0a9('0xc')]['noop'](_0xa0a9('0xc3'));}this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x11c'),_0xcb18a8[_0xa0a9('0x59')]));var _0x53707c=this[_0xa0a9('0x81')][_0xa0a9('0x6c')](this,_0xcb18a8);if(_0x53707c){this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x11d'),_0x53707c));var _0x527505=this[_0xa0a9('0xc')]['streamFile'](_0x53707c);try{fs[_0xa0a9('0xff')](_0x53707c+_0xa0a9('0x100'));}catch(_0x315f78){logger[_0xa0a9('0x28')](_0x315f78);}return _0x527505;}return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0xcb18a8,_0xa0a9('0x11e'));};AGIVertices['prototype'][_0xa0a9('0x11f')]=function(_0x460151){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x120'),_0x460151[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x460151[_0xa0a9('0x82')])||!this[_0xa0a9('0x7f')](_0x460151[_0xa0a9('0x83')])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0x121'));}if(!this[_0xa0a9('0x7f')](_0x460151['aws_bot_name'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x122'));}if(!this[_0xa0a9('0x7f')](_0x460151[_0xa0a9('0x59')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this['channel'][_0xa0a9('0xe5')]=!![];this[_0xa0a9('0x33')](_0x460151);this[_0xa0a9('0x3e')](_0x460151[_0xa0a9('0x59')],'in','','');this['channel'][_0xa0a9('0xa6')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x460151[_0xa0a9('0x59')]));var _0x4c5e90=this[_0xa0a9('0x87')]['sync'](this,_0x460151);if(_0x4c5e90){for(var _0x39c99b in _0x4c5e90){if(_0x4c5e90[_0xa0a9('0x92')](_0x39c99b)&&_[_0xa0a9('0x123')](_0x4c5e90[_0x39c99b])){this[_0xa0a9('0xc')]['setVariable'](util[_0xa0a9('0x25')]('AWS_LEX_%s',_0x39c99b[_0xa0a9('0x66')]()),_0x4c5e90[_0x39c99b]);}}if(_[_0xa0a9('0x4d')](_0x4c5e90['message'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x124'));}else{this['createSquareMessage'](_0x4c5e90[_0xa0a9('0x125')],_0xa0a9('0xe8'),'amazonlex','');return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x4c5e90['message']));}}return this['channel'][_0xa0a9('0x28')](_0x460151,_0xa0a9('0x126'));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x127')]=function(_0x533fbd){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x128'),_0x533fbd[_0xa0a9('0xa5')],_0x533fbd[_0xa0a9('0x63')]));if(!this[_0xa0a9('0x7f')](_0x533fbd[_0xa0a9('0x75')])){return this[_0xa0a9('0xc')]['noop'](_0xa0a9('0x129'));}var _0x14ca83=_0xa0a9('0x12a');var _0x12beca=util[_0xa0a9('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0xa0a9('0x111')](0x4));var _0x3c4a85=util[_0xa0a9('0x25')](_0xa0a9('0x9a'),_0x12beca,_0x14ca83);var _0x41b80b=!![];if(_0x533fbd[_0xa0a9('0x12b')]==='NOBEEP'){_0x41b80b=![];}var _0x46ef3a=this[_0xa0a9('0xc')][_0xa0a9('0x12c')](_0x12beca,_0x14ca83,_0x533fbd[_0xa0a9('0x12d')],_0x533fbd[_0xa0a9('0x63')],undefined,_0x41b80b);if(_0x46ef3a['result']!==-0x1){this['channel']['noop'](util[_0xa0a9('0x25')]('google\x20%s\x20file\x20created',_0x3c4a85));var _0x215ca8=this[_0xa0a9('0x8a')][_0xa0a9('0x6c')](this,_0x533fbd,_0x3c4a85);if(_0x215ca8){for(var _0x27c8fa in _0x215ca8){if(_0x215ca8[_0xa0a9('0x92')](_0x27c8fa)){this['channel'][_0xa0a9('0x9b')](util[_0xa0a9('0x25')]('GOOGLE_ASR_%s',_0x27c8fa[_0xa0a9('0x66')]()),_0x215ca8[_0x27c8fa]);}}return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')]('GoogleASR\x20Result\x20%s',JSON[_0xa0a9('0x6f')](_0x215ca8)));}}return _0x46ef3a;};AGIVertices['prototype'][_0xa0a9('0x12e')]=function(_0x4ab3a0){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4ab3a0[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x4ab3a0['appid'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x12f'));}if(!this['isConfigured'](_0x4ab3a0[_0xa0a9('0x8e')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x130'));}var _0x53c26d=_0xa0a9('0x12a');var _0x217f42=util[_0xa0a9('0x25')](_0xa0a9('0x131'),FILES_PATH,rs[_0xa0a9('0x111')](0x4));var _0x55e686=util[_0xa0a9('0x25')]('%s.%s',_0x217f42,_0x53c26d);var _0x117ab2=!![];if(_0x4ab3a0[_0xa0a9('0x12b')]===_0xa0a9('0x132')){_0x117ab2=![];}var _0xc45312=this[_0xa0a9('0xc')]['recordFile'](_0x217f42,_0x53c26d,_0x4ab3a0[_0xa0a9('0x12d')],_0x4ab3a0[_0xa0a9('0x63')],undefined,_0x117ab2);if(_0xc45312[_0xa0a9('0xa7')]!==-0x1){this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x133'),_0x55e686));var _0x2a481e=this['tildeASR'][_0xa0a9('0x6c')](this,_0x4ab3a0,_0x55e686);if(_0x2a481e){for(var _0x43ba25 in _0x2a481e){if(_0x2a481e[_0xa0a9('0x92')](_0x43ba25)){this[_0xa0a9('0xc')][_0xa0a9('0x9b')](util['format'](_0xa0a9('0x134'),_0x43ba25[_0xa0a9('0x66')]()),_0x2a481e[_0x43ba25]);}}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x135'),JSON[_0xa0a9('0x6f')](_0x2a481e)));}}return _0xc45312;};AGIVertices[_0xa0a9('0xe')]['gotoc']=function(_0x10ab6e){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x10ab6e[_0xa0a9('0xa5')]));return this['channel'][_0xa0a9('0x136')](_0x10ab6e[_0xa0a9('0x39')],_0x10ab6e[_0xa0a9('0x3a')],_0x10ab6e[_0xa0a9('0x3b')]);};AGIVertices['prototype']['gotoif']=function(_0x520373){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x137'),_0x520373[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x520373[_0xa0a9('0x138')])){return this['channel']['error'](_0x520373,_0xa0a9('0x139'));}try{var _0x254905=eval(_0x520373['condition'])?'true':_0xa0a9('0x13a');this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x13b'),_0x520373[_0xa0a9('0x138')],_0x254905));return{'code':0xc8,'result':_0x254905};}catch(_0x52579d){return{'code':0xc8,'result':_0xa0a9('0x13a')};}};AGIVertices[_0xa0a9('0xe')]['gotoiftime']=function(_0x326dc1){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x13c'),_0x326dc1['label']));if(!this[_0xa0a9('0x7f')](_0x326dc1['interval_id'])){return this['channel']['error'](_0x326dc1,_0xa0a9('0x13d'));}var _0x53a278=this[_0xa0a9('0x21')][_0xa0a9('0x6c')](this,_0x326dc1[_0xa0a9('0x13e')]);if(!_0x53a278){return this[_0xa0a9('0xc')]['error'](_0x326dc1,_0xa0a9('0x13f'));}for(var _0x2220c1=0x0;_0x2220c1<_0x53a278['length'];_0x2220c1+=0x1){var _0x558886=this[_0xa0a9('0xc')]['getVariable'](util[_0xa0a9('0x25')](_0xa0a9('0x140'),_0x53a278[_0x2220c1]));if(_0x558886[_0xa0a9('0xa7')]===-0x1){return _0x558886;}logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x141'),_0x53a278[_0x2220c1],_0x558886[_0xa0a9('0x9f')]));if(_0x558886[_0xa0a9('0x9f')]==='true'){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x141'),_0x53a278[_0x2220c1],_0xa0a9('0x142')));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x141'),_0x53a278[_0x2220c1],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x141'),_0x53a278[_0x2220c1],_0xa0a9('0x13a')));this[_0xa0a9('0xc')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x53a278[_0x2220c1],_0xa0a9('0x13a')));}}return{'code':0xc8,'result':_0xa0a9('0x13a')};};AGIVertices['prototype']['hangup']=function(_0x20a3b5){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x143'),_0x20a3b5['label']));return this[_0xa0a9('0xc')][_0xa0a9('0x144')]();};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x145')]=function(_0x1b009a){logger['info'](util['format'](_0xa0a9('0x146'),_0x1b009a['label']));if(!this[_0xa0a9('0x7f')](_0x1b009a[_0xa0a9('0x75')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x129'));}var _0x4a6125=_0xa0a9('0x12a');var _0x19761c=util[_0xa0a9('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0xa0a9('0x111')](0x4));var _0x40632c=util[_0xa0a9('0x25')](_0xa0a9('0x9a'),_0x19761c,_0x4a6125);var _0x2f0486=!![];if(_0x1b009a[_0xa0a9('0x12b')]===_0xa0a9('0x132')){_0x2f0486=![];}var _0x5bddb1=this[_0xa0a9('0xc')][_0xa0a9('0x12c')](_0x19761c,_0x4a6125,_0x1b009a[_0xa0a9('0x12d')],_0x1b009a[_0xa0a9('0x63')],undefined,_0x2f0486);if(_0x5bddb1[_0xa0a9('0xa7')]!==-0x1){this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x147'),_0x40632c));var _0x1df97c=this['ispeechASR'][_0xa0a9('0x6c')](this,_0x1b009a,_0x40632c);if(_0x1df97c){for(var _0x4bfa83 in _0x1df97c){if(_0x1df97c[_0xa0a9('0x92')](_0x4bfa83)){this[_0xa0a9('0xc')][_0xa0a9('0x9b')](util[_0xa0a9('0x25')](_0xa0a9('0x148'),_0x4bfa83[_0xa0a9('0x66')]()),_0x1df97c[_0x4bfa83]);}}return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x1df97c)));}}return _0x5bddb1;};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x149')]=function(_0x27a388){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x14a'),_0x27a388['label']));if(!this['isConfigured'](_0x27a388[_0xa0a9('0x75')])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0x129'));}if(!this[_0xa0a9('0x7f')](_0x27a388[_0xa0a9('0x59')])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format'](_0xa0a9('0x14b'),_0x27a388[_0xa0a9('0x59')]));var _0x30ec81=this[_0xa0a9('0x7b')][_0xa0a9('0x6c')](this,_0x27a388);if(_0x30ec81){this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('ispeech\x20%s\x20file\x20created',_0x30ec81));var _0x2588f4=this['channel'][_0xa0a9('0xfe')](_0x30ec81,_0x27a388[_0xa0a9('0x12d')]);try{fs[_0xa0a9('0xff')](_0x30ec81+_0xa0a9('0x100'));}catch(_0x49e173){logger[_0xa0a9('0x28')](_0x49e173);}return _0x2588f4;}return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x27a388,_0xa0a9('0x14c'));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x14d')]=function(_0x1c291d){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x14e'),_0x1c291d[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x1c291d[_0xa0a9('0x14f')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x1c291d,_0xa0a9('0x150'));}logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa0a9('0xc')]['callerid'],_0x1c291d[_0xa0a9('0x14f')]));var _0xddf2a0=this['agentLogin'][_0xa0a9('0x6c')](this,_0x1c291d[_0xa0a9('0x14f')]);if(_0xddf2a0){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x151'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x1c291d[_0xa0a9('0x14f')]));this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x1c291d[_0xa0a9('0x14f')]));return{'code':0xc8,'result':_0xa0a9('0x152')};}else{logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x153'),this[_0xa0a9('0xc')]['callerid'],_0x1c291d[_0xa0a9('0x14f')]));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x153'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x1c291d[_0xa0a9('0x14f')]));return{'code':0xc8,'result':_0xa0a9('0x154')};}};AGIVertices['prototype']['logout']=function(_0x5000f9){logger['info'](util[_0xa0a9('0x25')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5000f9[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x5000f9[_0xa0a9('0x14f')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x5000f9,_0xa0a9('0x150'));}logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x155'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5000f9['findBy']));var _0x3671cb=this[_0xa0a9('0x156')][_0xa0a9('0x6c')](this,_0x5000f9[_0xa0a9('0x14f')]);if(_0x3671cb){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x151'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5000f9['findBy']));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x151'),this['channel'][_0xa0a9('0x36')],_0x5000f9[_0xa0a9('0x14f')]));return{'code':0xc8,'result':_0xa0a9('0x152')};}else{logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x153'),this[_0xa0a9('0xc')]['callerid'],_0x5000f9['findBy']));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa0a9('0x36')],_0x5000f9[_0xa0a9('0x14f')]));return{'code':0xc8,'result':_0xa0a9('0x154')};}};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x157')]=function(_0x41f41e){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x158'),_0x41f41e['label']));if(!this['isConfigured'](_0x41f41e[_0xa0a9('0x159')])){return this['channel']['error'](_0x41f41e,_0xa0a9('0x15a'));}this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x15b'),_0x41f41e[_0xa0a9('0x159')]));var _0x5e6a97=eval(_0x41f41e['operation']);if(!this[_0xa0a9('0x7f')](_0x41f41e[_0xa0a9('0xd4')])){return this[_0xa0a9('0xc')]['noop'](_0xa0a9('0xd5'));}var _0x2488a5=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x41f41e[_0xa0a9('0xd4')]);if(!_0x2488a5){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x41f41e,_0xa0a9('0xd6'));}if(_['isArray'](_0x5e6a97)){var _0x54c63c=this;_0x5e6a97[_0xa0a9('0xd7')](function(_0x370cb1,_0x3afa59){_0x54c63c['channel'][_0xa0a9('0x9b')](util['format']('%s[%s]',_0x2488a5,_0x3afa59),_0x370cb1);});return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('variable\x20%s[key]\x20set',_0x2488a5));}else{return this['channel']['setVariable'](_0x2488a5,_0x5e6a97);}};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x15c')]=function(_0x45eadb){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x15d'),_0x45eadb[_0xa0a9('0xa5')]));if(_0x45eadb[_0xa0a9('0xa3')]===0x0){return this[_0xa0a9('0xa2')](_0x45eadb);}_0x45eadb[_0xa0a9('0xa3')]-=0x1;if(!this[_0xa0a9('0x7f')](_0x45eadb[_0xa0a9('0x10d')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x45eadb,'no\x20file\x20audio\x20selected');}var _0xfe6dc9=this[_0xa0a9('0x1a')][_0xa0a9('0x6c')](this,_0x45eadb[_0xa0a9('0x10d')]);if(!_0xfe6dc9){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x45eadb,_0xa0a9('0x15e'));}var _0x474ed9=this[_0xa0a9('0xc')][_0xa0a9('0x15f')](_0xfe6dc9,_0x45eadb['response'],_0x45eadb[_0xa0a9('0x160')]);var _0x1d1895=_0x474ed9['result'];if(_0x474ed9['result']===-0x1){this[_0xa0a9('0x33')]['sync'](this,_0x45eadb,'-1');return _0x474ed9;}else if(_0x474ed9['extra']===_0xa0a9('0x63')){_0x474ed9['result']=_0x474ed9[_0xa0a9('0xa7')]['length']>0x0?_0x474ed9[_0xa0a9('0xa7')]:'t';}else if(_[_0xa0a9('0x40')](_0x474ed9[_0xa0a9('0xa7')])){_0x474ed9[_0xa0a9('0xa7')]='#';_0x1d1895='#';}if(!this[_0xa0a9('0x7f')](_0x45eadb['variable_id'])){this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2ec38c=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x45eadb[_0xa0a9('0xd4')]);if(!_0x2ec38c){return this['channel']['error'](_0x45eadb,_0xa0a9('0xd6'));}this[_0xa0a9('0xc')]['setVariable'](_0x2ec38c,_0x1d1895);}this[_0xa0a9('0x33')]['sync'](this,_0x45eadb,_0x1d1895);return _0x474ed9;};AGIVertices['prototype'][_0xa0a9('0xa6')]=function(_0x53ba4f){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x161'),_0x53ba4f[_0xa0a9('0xa5')]));return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0x53ba4f[_0xa0a9('0x162')]||_0x53ba4f['label']);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x163')]=function(_0x342a28){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x164'),_0x342a28[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x342a28[_0xa0a9('0x14f')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x342a28,_0xa0a9('0x150'));}logger['info'](util[_0xa0a9('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x342a28['findBy']));var _0x4b0f0e=this[_0xa0a9('0x49')][_0xa0a9('0x6c')](this,_0x342a28[_0xa0a9('0x165')]);var _0x3fab02=this[_0xa0a9('0x4b')][_0xa0a9('0x6c')](this,_0x342a28['findBy'],_0x4b0f0e);if(_0x3fab02){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x342a28['findBy']));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa0a9('0x36')],_0x342a28[_0xa0a9('0x14f')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x153'),this[_0xa0a9('0xc')]['callerid'],_0x342a28[_0xa0a9('0x14f')]));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa0a9('0x36')],_0x342a28['findBy']));return{'code':0xc8,'result':_0xa0a9('0x154')};}};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x166')]=function(_0x1b5cb8){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x167'),_0x1b5cb8[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x1b5cb8[_0xa0a9('0x10d')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x1b5cb8,_0xa0a9('0x168'));}var _0x39ecb8=this[_0xa0a9('0x1a')]['sync'](this,_0x1b5cb8[_0xa0a9('0x10d')]);if(!_0x39ecb8){return this['channel'][_0xa0a9('0x28')](_0x1b5cb8,_0xa0a9('0x15e'));}var _0x26a86e=this[_0xa0a9('0xc')]['exec'](_0xa0a9('0x169'),[_0x39ecb8,_0x1b5cb8['opts']]);if(_0x26a86e[_0xa0a9('0xa7')]===-0x1){return _0x26a86e;}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x16a'),_0xa0a9('0x169'),_0x39ecb8));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x16b')]=function(_0x205587){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x16c'),_0x205587['label']));if(!this[_0xa0a9('0x7f')](_0x205587[_0xa0a9('0x16d')])){return this['channel']['error'](_0x205587,'no\x20queue\x20selected');}var _0x30b59e='';var _0x27f23b=parseInt(_0x205587[_0xa0a9('0x16d')],0xa);if(isNaN(_0x27f23b)){_0x30b59e=_0x205587[_0xa0a9('0x16d')];}else{_0x30b59e=this['getVoiceQueue'][_0xa0a9('0x6c')](this,_0x205587[_0xa0a9('0x16d')]);if(!_0x30b59e){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x205587,'no\x20queue\x20found');}}var _0x39fe97='';if(this[_0xa0a9('0x7f')](_0x205587[_0xa0a9('0x10d')])){var _0x1277d2=this[_0xa0a9('0x1a')][_0xa0a9('0x6c')](this,_0x205587['file_id']);if(_0x1277d2){_0x39fe97=_0x1277d2;}}this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x205587,_0x30b59e);if(_0x205587[_0xa0a9('0xe2')][_0xa0a9('0x16e')]('x')<0x0){_0x205587['opts']+='x';}if(_0x205587[_0xa0a9('0xe2')][_0xa0a9('0x16e')]('X')<0x0){_0x205587[_0xa0a9('0xe2')]+='X';}this[_0xa0a9('0xc')][_0xa0a9('0x9b')](_0xa0a9('0x16f'),_0x30b59e?_0x30b59e[_0xa0a9('0x170')]():'');var _0x28fc06=this[_0xa0a9('0xc')]['exec'](_0xa0a9('0x171'),[_0x30b59e,_0x205587[_0xa0a9('0xe2')],_0x205587[_0xa0a9('0x61')],_0x39fe97,_0x205587[_0xa0a9('0x63')],_0x205587[_0xa0a9('0x6')],_0x205587[_0xa0a9('0x172')],_0x205587[_0xa0a9('0x173')],'',_0x205587[_0xa0a9('0x174')]]);if(_0x28fc06[_0xa0a9('0xa7')]===-0x1){return _0x28fc06;}return this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')](_0xa0a9('0x16a'),_0xa0a9('0x171'),_0x30b59e));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x175')]=function(_0x131589){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x176'),_0x131589[_0xa0a9('0xa5')]));var _0xe199cb=_0x131589[_0xa0a9('0x177')]||_0xa0a9('0x12a');var _0x95e1cc=util[_0xa0a9('0x25')](_0xa0a9('0x178'),this[_0xa0a9('0xc')][_0xa0a9('0x34')],rs[_0xa0a9('0x111')](0x5));var _0x3dea59=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x95e1cc,_0xe199cb);var _0x30bdf5=util[_0xa0a9('0x25')](_0xa0a9('0x131'),FILES_PATH,_0x95e1cc);this[_0xa0a9('0x37')]['sync'](this,_0x131589,_0x95e1cc,_0x3dea59);this[_0xa0a9('0xc')][_0xa0a9('0x9b')](_0xa0a9('0x179'),_0x95e1cc);logger['info'](_0xa0a9('0x17a'),_0x30bdf5,_0xe199cb,_0x131589[_0xa0a9('0x17b')],_0x131589[_0xa0a9('0x63')]);return this[_0xa0a9('0xc')][_0xa0a9('0x12c')](_0x30bdf5,_0xe199cb,_0x131589[_0xa0a9('0x17b')],_0x131589[_0xa0a9('0x63')],undefined,!![]);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x17c')]=function(_0x3b65b3){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x17d'),_0x3b65b3[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x3b65b3['url'])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0x17e'));}var _0x119cac=this['restAPI'][_0xa0a9('0x6c')](this,_0x3b65b3);logger['info'](util[_0xa0a9('0x25')]('Response:',util[_0xa0a9('0x17f')](_0x119cac,{'showHidden':![],'depth':null})));if(!this[_0xa0a9('0x7f')](_0x3b65b3[_0xa0a9('0xd4')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x180'));}var _0x37f444=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x3b65b3[_0xa0a9('0xd4')]);if(!_0x37f444){return this[_0xa0a9('0xc')]['error'](_0x3b65b3,_0xa0a9('0xd6'));}this['channel'][_0xa0a9('0x9b')](util[_0xa0a9('0x25')]('%s_STATUS_CODE',_0x37f444),_0x119cac[_0xa0a9('0x181')]?_0x119cac[_0xa0a9('0x181')]:_0xa0a9('0x182'));this[_0xa0a9('0xc')]['setVariable'](util[_0xa0a9('0x25')](_0xa0a9('0x183'),_0x37f444),_0x119cac['statusMessage']?_0x119cac[_0xa0a9('0x71')]:'OK');if(_0x119cac[_0xa0a9('0x67')]){try{this[_0xa0a9('0x99')](_0x119cac[_0xa0a9('0x67')],_0x37f444);}catch(_0x2a9c9f){logger[_0xa0a9('0x28')](util['format'](_0xa0a9('0x184'),_0x37f444));}}return this['channel']['noop'](util['format']('variable\x20%s\x20set',_0x37f444));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x185')]=function(_0x340024){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x186'),_0x340024['label']));return this['channel'][_0xa0a9('0x187')](_0x340024['digits'][_0xa0a9('0x55')](/\s+/g,''),_0x340024['escape_digits']);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x188')]=function(_0x57108f){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x189'),_0x57108f['label']));return this[_0xa0a9('0xc')][_0xa0a9('0x18a')](_0x57108f[_0xa0a9('0x18b')][_0xa0a9('0x55')](/\s+/g,''),_0x57108f[_0xa0a9('0x17b')]);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x18c')]=function(_0x4e6bb2){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x18d'),_0x4e6bb2[_0xa0a9('0xa5')]));return this['channel'][_0xa0a9('0x18e')](_0x4e6bb2[_0xa0a9('0x59')],_0x4e6bb2[_0xa0a9('0x17b')]);};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x18f')]=function(_0x2a27d6){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2a27d6[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x2a27d6['account_id'])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('no\x20mail\x20account\x20configured');}var _0x522c5b=this[_0xa0a9('0x1e')][_0xa0a9('0x6c')](this,_0x2a27d6[_0xa0a9('0x190')]);if(!_0x522c5b||!_0x522c5b[_0xa0a9('0x191')]){return this['channel'][_0xa0a9('0x28')](_0x2a27d6,_0xa0a9('0x192'));}var _0x480ba2={'from':util['format'](_0xa0a9('0x193'),_0x522c5b[_0xa0a9('0x11')],_0x522c5b[_0xa0a9('0x194')]||_0x522c5b[_0xa0a9('0x191')][_0xa0a9('0x195')]),'to':_0x2a27d6['to']||'','cc':_0x2a27d6['cc']||'','bcc':_0x2a27d6[_0xa0a9('0x196')]||'','subject':_0x2a27d6[_0xa0a9('0x197')],'html':_0x2a27d6['text'],'text':_0x2a27d6['text']};if(this[_0xa0a9('0x7f')](_0x2a27d6[_0xa0a9('0x198')])){}logger[_0xa0a9('0xdb')]('sendMail\x20message',JSON[_0xa0a9('0x6f')](_0x480ba2));this['createSquareDetailsReport'][_0xa0a9('0x6c')](this,_0x2a27d6,_0x2a27d6['account_id']);this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x522c5b[_0xa0a9('0x11')]));this[_0xa0a9('0x20')][_0xa0a9('0x6c')](this,_0x522c5b[_0xa0a9('0x199')],_0x480ba2);return this[_0xa0a9('0xc')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa0a9('0xe')]['sendFax']=function(_0x42585f){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x19a'),_0x42585f[_0xa0a9('0xa5')]));return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xa0a9('0xe')]['sendSMS']=function(_0x2792d7){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x19b'),_0x2792d7[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x2792d7['sms_account_id'])){return this[_0xa0a9('0xc')]['noop'](_0xa0a9('0x19c'));}var _0x46706a=this[_0xa0a9('0x30')][_0xa0a9('0x6c')](this,_0x2792d7[_0xa0a9('0x19d')]);if(!_0x46706a){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x2792d7,'no\x20sms\x20account\x20found');}var _0x52bb5b={'body':_0x2792d7[_0xa0a9('0x19e')],'phone':_0x2792d7['to']||'','SmsAccountId':_0x46706a['id']};logger[_0xa0a9('0xdb')](_0xa0a9('0x19f'),JSON['stringify'](_0x52bb5b));this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x2792d7,_0x2792d7[_0xa0a9('0x19d')]);this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x46706a[_0xa0a9('0x11')]));this[_0xa0a9('0x32')][_0xa0a9('0x6c')](this,_0x52bb5b);return this[_0xa0a9('0xc')][_0xa0a9('0xa6')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x1a0')]=function(_0x1259f1){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x1a1'),_0x1259f1[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x1259f1[_0xa0a9('0xd4')])){return this[_0xa0a9('0xc')]['error'](_0x1259f1,_0xa0a9('0x1a2'));}var _0x5c0ae9=this['getVariable'][_0xa0a9('0x6c')](this,_0x1259f1['variable_id']);if(!_0x5c0ae9){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x1259f1,_0xa0a9('0xd6'));}return this[_0xa0a9('0xc')][_0xa0a9('0x9b')](_0x5c0ae9,_0x1259f1['variable_value']);};AGIVertices['prototype']['start']=function(_0x39255b){logger['info'](util['format'](_0xa0a9('0x1a3'),_0x39255b[_0xa0a9('0xa5')]));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x1a4'));var _0x1c845c=this['channel'][_0xa0a9('0x9e')](_0xa0a9('0x1a5'));if(!_['isEmpty'](_0x1c845c[_0xa0a9('0x9f')])){this[_0xa0a9('0xc')][_0xa0a9('0x34')]=_0x1c845c[_0xa0a9('0x9f')];}if(_0x39255b[_0xa0a9('0xb8')]==='yes'){this[_0xa0a9('0xc')]['noop'](_0xa0a9('0x1a6'));return this[_0xa0a9('0xc')][_0xa0a9('0xb8')]();}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x1a7'));};AGIVertices[_0xa0a9('0xe')]['subproject']=function(_0x423b44){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x1a8'),_0x423b44['label']));if(!this[_0xa0a9('0x7f')](_0x423b44[_0xa0a9('0x1a9')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x423b44,_0xa0a9('0x1aa'));}var _0x257a29=this[_0xa0a9('0x15')][_0xa0a9('0x6c')](this,_0x423b44['project_id']);if(!this[_0xa0a9('0x7f')](_0x257a29)){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x423b44,util[_0xa0a9('0x25')](_0xa0a9('0x1ab'),_0x423b44[_0xa0a9('0x1a9')]));}if(_0x257a29===this[_0xa0a9('0xc')][_0xa0a9('0x35')]){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x423b44,_0xa0a9('0x1ac'));}this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x423b44,_0x257a29);var _0xcecd05=this['channel'][_0xa0a9('0x53')](_0xa0a9('0x1ad'),util[_0xa0a9('0x25')](_0xa0a9('0x1ae'),config[_0xa0a9('0x6')][_0xa0a9('0x1af')]||_0xa0a9('0x1b0'),_0x257a29,this[_0xa0a9('0xc')][_0xa0a9('0x35')]));if(_0xcecd05[_0xa0a9('0xa7')]===-0x1){return _0xcecd05;}return this['channel']['noop'](util[_0xa0a9('0x25')](_0xa0a9('0x16a'),_0xa0a9('0x1ad'),_0x257a29));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x1b1')]=function(_0x4ee731){logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x1b2'),_0x4ee731[_0xa0a9('0xa5')]));var _0x2039e6=this[_0xa0a9('0x52')][_0xa0a9('0x6c')](this,_0x4ee731[_0xa0a9('0xb4')]);this[_0xa0a9('0x33')][_0xa0a9('0x6c')](this,_0x4ee731,_0x4ee731['command']);if(this[_0xa0a9('0x7f')](_0x4ee731[_0xa0a9('0xd4')])){var _0x53a95f=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x4ee731[_0xa0a9('0xd4')]);if(_0x53a95f){this[_0xa0a9('0xc')][_0xa0a9('0x9b')](_0x53a95f,_0x2039e6);return this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x1b3'),_0x4ee731[_0xa0a9('0xb4')],_0x53a95f));}}return this['channel'][_0xa0a9('0xa6')](util['format'](_0xa0a9('0x1b4'),_0x4ee731['command']));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x1b5')]=function(_0x11535b){logger['info'](util[_0xa0a9('0x25')](_0xa0a9('0x1b6'),_0x11535b[_0xa0a9('0xa5')]));_0x11535b[_0xa0a9('0x59')]=_0x11535b[_0xa0a9('0x59')][_0xa0a9('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x11535b[_0xa0a9('0x57')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0x1b7'));}if(!this[_0xa0a9('0x7f')](_0x11535b[_0xa0a9('0x59')])){return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format'](_0xa0a9('0x1b8'),_0x11535b[_0xa0a9('0x59')]));var _0x5f461a=this[_0xa0a9('0x56')][_0xa0a9('0x6c')](this,_0x11535b);if(_0x5f461a){this['channel'][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x1b9'),_0x5f461a));var _0x253557=this['channel'][_0xa0a9('0xfe')](_0x5f461a);try{fs[_0xa0a9('0xff')](_0x5f461a+_0xa0a9('0x100'));}catch(_0x111157){logger[_0xa0a9('0x28')](_0x111157);}return _0x253557;}return this[_0xa0a9('0xc')]['error'](_0x11535b,_0xa0a9('0x1ba'));};AGIVertices[_0xa0a9('0xe')][_0xa0a9('0x1bb')]=function(_0x22beaf){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x1bc'),_0x22beaf[_0xa0a9('0xa5')]));_0x22beaf['text']=_0x22beaf['text'][_0xa0a9('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa0a9('0x7f')](_0x22beaf['text'])){return this['channel'][_0xa0a9('0xa6')](_0xa0a9('0xc3'));}this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format'](_0xa0a9('0x1bd'),_0x22beaf[_0xa0a9('0x59')]));var _0x1ae48c=this[_0xa0a9('0x5e')]['sync'](this,_0x22beaf);if(_0x1ae48c){this[_0xa0a9('0xc')]['noop'](util[_0xa0a9('0x25')](_0xa0a9('0x1be'),_0x1ae48c));var _0x27f802=this[_0xa0a9('0xc')][_0xa0a9('0xfe')](_0x1ae48c);try{fs['unlink'](_0x1ae48c+_0xa0a9('0x100'));}catch(_0x3095f3){logger[_0xa0a9('0x28')](_0x3095f3);}return _0x27f802;}return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x22beaf,_0xa0a9('0x1bf'));};AGIVertices['prototype']['unpause']=function(_0x5d0d21){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x1c0'),_0x5d0d21[_0xa0a9('0xa5')]));if(!this['isConfigured'](_0x5d0d21[_0xa0a9('0x14f')])){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x5d0d21,_0xa0a9('0x150'));}logger[_0xa0a9('0x2a')](util['format'](_0xa0a9('0x155'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5d0d21['findBy']));var _0x103d3b=this[_0xa0a9('0x4e')]['sync'](this,_0x5d0d21[_0xa0a9('0x14f')]);if(_0x103d3b){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x151'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5d0d21[_0xa0a9('0x14f')]));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util['format'](_0xa0a9('0x151'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5d0d21['findBy']));return{'code':0xc8,'result':_0xa0a9('0x152')};}else{logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x153'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5d0d21[_0xa0a9('0x14f')]));this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x153'),this[_0xa0a9('0xc')][_0xa0a9('0x36')],_0x5d0d21['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xa0a9('0x1c1')]=function(_0x47ee14){logger[_0xa0a9('0x2a')](util[_0xa0a9('0x25')](_0xa0a9('0x1c2'),_0x47ee14['label']));var _0x3ba09e=this[_0xa0a9('0xc')][_0xa0a9('0x53')](_0xa0a9('0x1c3'),[_0x47ee14[_0xa0a9('0x1c4')],_0x47ee14[_0xa0a9('0x73')]]);if(_0x3ba09e[_0xa0a9('0xa7')]===-0x1){return _0x3ba09e;}return this[_0xa0a9('0xc')][_0xa0a9('0xa6')](util[_0xa0a9('0x25')](_0xa0a9('0x16a'),_0xa0a9('0x1c3'),_0x47ee14['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x1d173a){logger['info'](util['format'](_0xa0a9('0x1c5'),_0x1d173a[_0xa0a9('0xa5')]));if(!this[_0xa0a9('0x7f')](_0x1d173a['variable_id'])){return this['channel'][_0xa0a9('0x28')](_0x1d173a,'no\x20variable\x20selected');}var _0x5d879a=this[_0xa0a9('0x9e')][_0xa0a9('0x6c')](this,_0x1d173a['variable_id']);if(!_0x5d879a){return this[_0xa0a9('0xc')][_0xa0a9('0x28')](_0x1d173a,_0xa0a9('0xd6'));}var _0x14961c=this[_0xa0a9('0xc')][_0xa0a9('0x9e')](_0x5d879a);return{'code':0xc8,'result':_0x14961c[_0xa0a9('0x9f')]?_0x14961c[_0xa0a9('0x9f')]:'-'};};String['prototype']['replaceAll']=function(_0x60e20a,_0x5ad400){return this['split'](_0x60e20a)[_0xa0a9('0x1c6')](_0x5ad400);};module[_0xa0a9('0x1c7')]=AGIVertices;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda7c=['stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer'];(function(_0x4060ae,_0x4a46d4){var _0x16582b=function(_0x2b691f){while(--_0x2b691f){_0x4060ae['push'](_0x4060ae['shift']());}};_0x16582b(++_0x4a46d4);}(_0xda7c,0xc5));var _0xcda7=function(_0x4033b3,_0x3b7d25){_0x4033b3=_0x4033b3-0x0;var _0x25a184=_0xda7c[_0x4033b3];return _0x25a184;};'use strict';var _=require(_0xcda7('0x0'));var moment=require(_0xcda7('0x1'));var ami=require(_0xcda7('0x2'));var logger=require(_0xcda7('0x3'))(_0xcda7('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xcda7('0x5'));function Acw(_0x5160ce){this[_0xcda7('0x6')]=_0x5160ce[_0xcda7('0x6')];this['agents']=_0x5160ce[_0xcda7('0x7')];this[_0xcda7('0x8')]=_0x5160ce[_0xcda7('0x8')];this[_0xcda7('0x9')]={};ami['on'](_0xcda7('0xa'),this[_0xcda7('0xb')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0xd'),this[_0xcda7('0xe')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0xf'),this[_0xcda7('0x10')]['bind'](this));ami['on'](_0xcda7('0x11'),this['syncAgentRingNoAnswer'][_0xcda7('0xc')](this));ami['on'](_0xcda7('0x12'),this[_0xcda7('0x13')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0x14'),this[_0xcda7('0x15')][_0xcda7('0xc')](this));ami['on'](_0xcda7('0x16'),this[_0xcda7('0x17')][_0xcda7('0xc')](this));}function getDiff(_0x344aa9){var _0x852b99=moment()[_0xcda7('0x18')](0x0);var _0x139bbc=moment(_0x344aa9)[_0xcda7('0x18')](0x0);return _0x852b99[_0xcda7('0x19')](_0x139bbc,_0xcda7('0x1a'));}Acw[_0xcda7('0x1b')]['updateAcw']=function(_0x3e3b4a,_0x611f84){var _0xa20956=this;var _0x191ada=getDiff(_0xa20956[_0xcda7('0x8')][_0x3e3b4a]['lastPauseAt']);clearTimeout(_0xa20956['timers'][_0x3e3b4a]['timer']);_0xa20956['timers'][_0x3e3b4a]['timer']=![];return RpcVoiceAgentReport[_0xcda7('0x1c')]({'acwtime':_0x191ada},_0xa20956[_0xcda7('0x8')][_0x3e3b4a][_0xcda7('0x1d')],_0x3e3b4a)[_0xcda7('0x1e')](function(_0x2f4149){logger['info'](_0xcda7('0x1f'),_0x611f84,_0x191ada,_0x2f4149);})[_0xcda7('0x20')](function(_0x2faac3){logger[_0xcda7('0x21')](_0xcda7('0x22'),_0x611f84,_0x2faac3);})[_0xcda7('0x23')](function(){delete _0xa20956[_0xcda7('0x8')][_0x3e3b4a];});};Acw[_0xcda7('0x1b')][_0xcda7('0x24')]=function(_0x59cd55){try{var _0x4af6aa=this;var _0x3cf969=this[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x25')];var _0x5b0f51=this[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x26')];var _0x263114=this[_0xcda7('0x6')][_0x5b0f51];var _0xd34d01=![];var _0x13cd4d=_0xcda7('0x27');if(_0x263114['mandatoryDisposition']&&_0x263114[_0xcda7('0x28')][_0xcda7('0x29')]){_0xd34d01=!![];_0x13cd4d=_0x263114['mandatoryDispositionPause'][_0xcda7('0x29')];}if(!_0x4af6aa[_0xcda7('0x7')][_0x3cf969]){return Promise['resolve']();}return RpcUser[_0xcda7('0x2a')](_0x4af6aa[_0xcda7('0x7')][_0x3cf969]['id'])[_0xcda7('0x1e')](function(_0x56902c){if(!_0x56902c||_0x56902c[_0xcda7('0x2b')]){logger['info'](_0xcda7('0x2c'),_0x59cd55,_0x3cf969,_0x5b0f51);return;}logger[_0xcda7('0x2d')](_0xcda7('0x2e'),_0x59cd55,_0x3cf969,_0x5b0f51);var _0x586b8c=_0x4af6aa[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x2f')]&&_0x4af6aa[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x30')]?_0x4af6aa[_0xcda7('0x9')][_0x59cd55][_0xcda7('0x30')]:_0x59cd55;return RpcUser['savePause'](_0x4af6aa[_0xcda7('0x7')][_0x3cf969],_0x13cd4d,_0x586b8c)[_0xcda7('0x1e')](function(_0x15c5fb){_0x4af6aa[_0xcda7('0x6')][_0x5b0f51][_0xcda7('0x31')]-=0x1;_0x4af6aa[_0xcda7('0x6')][_0x5b0f51][_0xcda7('0x32')]+=0x1;return _0x15c5fb;});})[_0xcda7('0x1e')](function(_0x3caab6){if(_0xd34d01||!_0x3caab6){return;}_0x4af6aa[_0xcda7('0x8')][_0x3cf969]={};logger[_0xcda7('0x2d')](_0xcda7('0x33'),_0x59cd55,_0x4af6aa['voiceQueues'][_0x5b0f51][_0xcda7('0x34')],_0x3cf969,_0x5b0f51);_0x4af6aa['timers'][_0x3cf969][_0xcda7('0x35')]=setTimeout(_0x4af6aa[_0xcda7('0x36')][_0xcda7('0xc')](_0x4af6aa,_0x3cf969),_0x4af6aa[_0xcda7('0x6')][_0x5b0f51]['acwTimeout']*0x3e8);_0x4af6aa[_0xcda7('0x8')][_0x3cf969][_0xcda7('0x37')]=moment()[_0xcda7('0x38')](_0xcda7('0x39'));_0x4af6aa[_0xcda7('0x8')][_0x3cf969][_0xcda7('0x1d')]=_0x59cd55;_0x4af6aa[_0xcda7('0x8')][_0x3cf969][_0xcda7('0x26')]=_0x5b0f51;_0x4af6aa[_0xcda7('0x8')][_0x3cf969]['updateAcw']=_0x4af6aa[_0xcda7('0x3a')][_0xcda7('0xc')](_0x4af6aa,_0x3cf969,_0x59cd55);})['catch'](function(){logger['error'](_0xcda7('0x33'),_0x59cd55,_0x4af6aa[_0xcda7('0x6')][_0x5b0f51][_0xcda7('0x34')],_0x3cf969,_0x5b0f51);})[_0xcda7('0x23')](function(){delete _0x4af6aa['channels'][_0x59cd55];});}catch(_0x5ed01c){logger['error']('[ACW][START]\x20%s',_0x5ed01c[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0x36')]=function(_0x434039){try{var _0x4cd7d0=this;if(_0x4cd7d0[_0xcda7('0x8')][_0x434039]){_0x4cd7d0['timers'][_0x434039][_0xcda7('0x35')]=![];var _0x3b5ba8=_0x4cd7d0[_0xcda7('0x8')][_0x434039][_0xcda7('0x1d')];var _0x35fb7=_0x4cd7d0[_0xcda7('0x8')][_0x434039][_0xcda7('0x26')];var _0x5741f0=_0x4cd7d0[_0xcda7('0x6')][_0x35fb7]['acwTimeout'];logger[_0xcda7('0x2d')](_0xcda7('0x3c'),_0x3b5ba8,_0x434039);RpcUser['getAgent'](this['agents'][_0x434039]['id'])[_0xcda7('0x1e')](function(_0x4ea837){if(_0x4ea837[_0xcda7('0x3d')]===_0xcda7('0x27')){return RpcUser[_0xcda7('0x3e')](_0x4cd7d0['agents'][_0x434039]);}});RpcVoiceAgentReport[_0xcda7('0x1c')]({'acwtime':_0x5741f0,'agentacw':!![]},_0x3b5ba8,_0x434039)['then'](function(_0x176004){logger['info'](_0xcda7('0x1f'),_0x3b5ba8,_0x5741f0,_0x176004);})['catch'](function(_0x36c17a){logger[_0xcda7('0x21')](_0xcda7('0x22'),_0x3b5ba8,_0x36c17a);});}else{logger['error'](_0xcda7('0x3f'),_0x434039);if(_0x4cd7d0[_0xcda7('0x8')]){logger[_0xcda7('0x2d')]('[ACW][TIMERS]',JSON[_0xcda7('0x40')](_0x4cd7d0[_0xcda7('0x8')]));}}}catch(_0x5c1ebb){logger[_0xcda7('0x21')](_0xcda7('0x41'),_0x5c1ebb[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0xb')]=function(_0x384c85){try{if(this[_0xcda7('0x6')][_0x384c85[_0xcda7('0x26')]]&&(this[_0xcda7('0x6')][_0x384c85['queue']][_0xcda7('0x4')]||this[_0xcda7('0x6')][_0x384c85['queue']][_0xcda7('0x42')])){if(this['agents'][_0x384c85['interface']]){this['channels'][_0x384c85[_0xcda7('0x1d')]]={'queue':_0x384c85[_0xcda7('0x26')],'interface':_0x384c85['interface'],'destlinkedid':_0x384c85[_0xcda7('0x30')]};}}}catch(_0x181b85){logger[_0xcda7('0x21')](_0xcda7('0x43'),_0x181b85[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0x17')]=function(_0x4044c9){try{if(this['voiceQueues'][_0x4044c9['queue']]&&(this[_0xcda7('0x6')][_0x4044c9[_0xcda7('0x26')]][_0xcda7('0x4')]||this['voiceQueues'][_0x4044c9['queue']][_0xcda7('0x42')])){if(this[_0xcda7('0x7')][_0x4044c9[_0xcda7('0x25')]]){this['channels'][_0x4044c9[_0xcda7('0x1d')]]={'queue':_0x4044c9[_0xcda7('0x26')],'interface':_0x4044c9[_0xcda7('0x25')]};}}}catch(_0x3e762b){logger[_0xcda7('0x21')](_0xcda7('0x44'),_0x3e762b[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0xe')]=function(_0x37e9f1){try{if(this[_0xcda7('0x9')][_0x37e9f1['uniqueid']]&&_[_0xcda7('0x45')](this['channels'][_0x37e9f1[_0xcda7('0x1d')]]['attended'])){logger[_0xcda7('0x2d')]('[%s][HANGUP:UNIQUEID]',_0x37e9f1[_0xcda7('0x1d')]);this[_0xcda7('0x24')](_0x37e9f1['uniqueid']);}else if(this[_0xcda7('0x9')][_0x37e9f1[_0xcda7('0x46')]]&&_['isUndefined'](this[_0xcda7('0x9')][_0x37e9f1['linkedid']][_0xcda7('0x2f')])){logger['info'](_0xcda7('0x47'),_0x37e9f1[_0xcda7('0x46')]);this['startAcw'](_0x37e9f1[_0xcda7('0x46')]);}}catch(_0x1f0670){logger[_0xcda7('0x21')]('[ACW][syncHangupRequest]\x20%s',_0x1f0670[_0xcda7('0x3b')]);}};Acw['prototype'][_0xcda7('0x10')]=function(_0x195587){try{if(this[_0xcda7('0x9')][_0x195587['uniqueid']]&&this[_0xcda7('0x9')][_0x195587[_0xcda7('0x1d')]][_0xcda7('0x2f')]){logger[_0xcda7('0x2d')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x195587[_0xcda7('0x1d')]);this[_0xcda7('0x24')](_0x195587['uniqueid']);}else if(this[_0xcda7('0x9')][_0x195587[_0xcda7('0x46')]]&&this[_0xcda7('0x9')][_0x195587[_0xcda7('0x46')]]['attended']){logger[_0xcda7('0x2d')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x195587[_0xcda7('0x46')]);this[_0xcda7('0x24')](_0x195587[_0xcda7('0x46')]);}}catch(_0x10a1f1){logger[_0xcda7('0x21')]('[ACW][syncHangup]\x20%s',_0x10a1f1[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')]['syncAttendedTransfer']=function(_0x148177){try{if(!_['isNil'](this[_0xcda7('0x9')][_0x148177[_0xcda7('0x48')]])){this[_0xcda7('0x24')](_0x148177['transfereeuniqueid']);if(this[_0xcda7('0x9')][_0x148177[_0xcda7('0x49')]]){this['channels'][_0x148177[_0xcda7('0x49')]][_0xcda7('0x2f')]=!![];this['channels'][_0x148177[_0xcda7('0x4a')]]=this[_0xcda7('0x9')][_0x148177[_0xcda7('0x49')]];delete this['channels'][_0x148177[_0xcda7('0x49')]];}}else if(!_[_0xcda7('0x4b')](this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4a')]])){this['startAcw'](_0x148177['transfertargetuniqueid']);if(this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4c')]]){this['channels'][_0x148177[_0xcda7('0x4c')]][_0xcda7('0x2f')]=!![];this[_0xcda7('0x9')][_0x148177['transfereeuniqueid']]=this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4c')]];delete this[_0xcda7('0x9')][_0x148177[_0xcda7('0x4c')]];}}}catch(_0x5a0aea){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x5a0aea[_0xcda7('0x3b')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x511868){try{if(this[_0xcda7('0x9')][_0x511868[_0xcda7('0x4d')]]){logger[_0xcda7('0x2d')](_0xcda7('0x4e'),JSON[_0xcda7('0x40')](_0x511868['transfereruniqueid']));this[_0xcda7('0x24')](_0x511868[_0xcda7('0x4d')]);}else if(this[_0xcda7('0x9')][_0x511868[_0xcda7('0x4f')]]){logger[_0xcda7('0x2d')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xcda7('0x40')](_0x511868[_0xcda7('0x4f')]));this[_0xcda7('0x24')](_0x511868[_0xcda7('0x4f')]);}}catch(_0x46aa63){logger[_0xcda7('0x21')](_0xcda7('0x50'),_0x46aa63[_0xcda7('0x3b')]);}};Acw[_0xcda7('0x1b')][_0xcda7('0x51')]=function(_0x283c80){try{if(this[_0xcda7('0x6')][_0x283c80[_0xcda7('0x26')]]&&this['voiceQueues'][_0x283c80[_0xcda7('0x26')]][_0xcda7('0x52')]===_0xcda7('0x53')){if(this['agents'][_0x283c80[_0xcda7('0x25')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x283c80[_0xcda7('0x1d')],_0x283c80[_0xcda7('0x25')],_0x283c80['queue']);return RpcUser['savePause'](this['agents'][_0x283c80[_0xcda7('0x25')]],_0xcda7('0x54'),_0x283c80[_0xcda7('0x1d')]);}}}catch(_0x4b9a61){logger[_0xcda7('0x21')](_0xcda7('0x55'),_0x4b9a61[_0xcda7('0x3b')]);}};module[_0xcda7('0x56')]=Acw;
\ No newline at end of file
+var _0x37ae=['exports','lodash','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','resolve','getAgent','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','format','acwTimeout','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','acw','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s'];(function(_0x22a9c4,_0xa91fc6){var _0x4c0e71=function(_0x2239cf){while(--_0x2239cf){_0x22a9c4['push'](_0x22a9c4['shift']());}};_0x4c0e71(++_0xa91fc6);}(_0x37ae,0xa9));var _0xe37a=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x37ae[_0x424357];return _0x29c68e;};'use strict';var _=require(_0xe37a('0x0'));var moment=require('moment');var ami=require(_0xe37a('0x1'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0xe37a('0x2'));var RpcVoiceAgentReport=require(_0xe37a('0x3'));function Acw(_0x135e3e){this[_0xe37a('0x4')]=_0x135e3e[_0xe37a('0x4')];this['agents']=_0x135e3e[_0xe37a('0x5')];this[_0xe37a('0x6')]=_0x135e3e[_0xe37a('0x6')];this[_0xe37a('0x7')]={};ami['on'](_0xe37a('0x8'),this[_0xe37a('0x9')][_0xe37a('0xa')](this));ami['on'](_0xe37a('0xb'),this[_0xe37a('0xc')][_0xe37a('0xa')](this));ami['on'](_0xe37a('0xd'),this[_0xe37a('0xe')][_0xe37a('0xa')](this));ami['on']('agentringnoanswer',this[_0xe37a('0xf')][_0xe37a('0xa')](this));ami['on']('attendedtransfer',this[_0xe37a('0x10')][_0xe37a('0xa')](this));ami['on'](_0xe37a('0x11'),this[_0xe37a('0x12')][_0xe37a('0xa')](this));ami['on'](_0xe37a('0x13'),this['syncAgentConnectPreview'][_0xe37a('0xa')](this));}function getDiff(_0x2cffe6){var _0x387452=moment()[_0xe37a('0x14')](0x0);var _0x32c96a=moment(_0x2cffe6)[_0xe37a('0x14')](0x0);return _0x387452[_0xe37a('0x15')](_0x32c96a,_0xe37a('0x16'));}Acw[_0xe37a('0x17')][_0xe37a('0x18')]=function(_0x21cd40,_0x403f5a){var _0x2ffc91=this;var _0x799f91=getDiff(_0x2ffc91['timers'][_0x21cd40][_0xe37a('0x19')]);clearTimeout(_0x2ffc91[_0xe37a('0x6')][_0x21cd40][_0xe37a('0x1a')]);_0x2ffc91[_0xe37a('0x6')][_0x21cd40][_0xe37a('0x1a')]=![];return RpcVoiceAgentReport[_0xe37a('0x1b')]({'acwtime':_0x799f91},_0x2ffc91[_0xe37a('0x6')][_0x21cd40][_0xe37a('0x1c')],_0x21cd40)[_0xe37a('0x1d')](function(_0x571d90){logger[_0xe37a('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x403f5a,_0x799f91,_0x571d90);})[_0xe37a('0x1f')](function(_0x22e88e){logger[_0xe37a('0x20')](_0xe37a('0x21'),_0x403f5a,_0x22e88e);})[_0xe37a('0x22')](function(){delete _0x2ffc91[_0xe37a('0x6')][_0x21cd40];});};Acw[_0xe37a('0x17')][_0xe37a('0x23')]=function(_0x13644a){try{var _0x3be16b=this;var _0x16c78a=this[_0xe37a('0x7')][_0x13644a][_0xe37a('0x24')];var _0x35d55b=this[_0xe37a('0x7')][_0x13644a][_0xe37a('0x25')];var _0x58bd50=this[_0xe37a('0x4')][_0x35d55b];var _0x1fff7c=![];var _0x3e21f2=_0xe37a('0x26');if(_0x58bd50['mandatoryDisposition']&&_0x58bd50[_0xe37a('0x27')][_0xe37a('0x28')]){_0x1fff7c=!![];_0x3e21f2=_0x58bd50[_0xe37a('0x27')][_0xe37a('0x28')];}if(!_0x3be16b[_0xe37a('0x5')][_0x16c78a]){return Promise[_0xe37a('0x29')]();}return RpcUser[_0xe37a('0x2a')](_0x3be16b['agents'][_0x16c78a]['id'])[_0xe37a('0x1d')](function(_0x1693f3){if(!_0x1693f3||_0x1693f3['voicePause']){logger[_0xe37a('0x1e')](_0xe37a('0x2b'),_0x13644a,_0x16c78a,_0x35d55b);return;}logger['info'](_0xe37a('0x2c'),_0x13644a,_0x16c78a,_0x35d55b);var _0x13f1a0=_0x3be16b[_0xe37a('0x7')][_0x13644a][_0xe37a('0x2d')]&&_0x3be16b[_0xe37a('0x7')][_0x13644a][_0xe37a('0x2e')]?_0x3be16b[_0xe37a('0x7')][_0x13644a][_0xe37a('0x2e')]:_0x13644a;return RpcUser['savePause'](_0x3be16b[_0xe37a('0x5')][_0x16c78a],_0x3e21f2,_0x13f1a0)[_0xe37a('0x1d')](function(_0x551c76){_0x3be16b['voiceQueues'][_0x35d55b][_0xe37a('0x2f')]-=0x1;_0x3be16b[_0xe37a('0x4')][_0x35d55b][_0xe37a('0x30')]+=0x1;return _0x551c76;});})[_0xe37a('0x1d')](function(_0x3aadd4){if(_0x1fff7c||!_0x3aadd4){return;}_0x3be16b[_0xe37a('0x6')][_0x16c78a]={};logger[_0xe37a('0x1e')](_0xe37a('0x31'),_0x13644a,_0x3be16b[_0xe37a('0x4')][_0x35d55b]['acwTimeout'],_0x16c78a,_0x35d55b);_0x3be16b[_0xe37a('0x6')][_0x16c78a]['timer']=setTimeout(_0x3be16b[_0xe37a('0x32')][_0xe37a('0xa')](_0x3be16b,_0x16c78a),_0x3be16b[_0xe37a('0x4')][_0x35d55b]['acwTimeout']*0x3e8);_0x3be16b['timers'][_0x16c78a][_0xe37a('0x19')]=moment()[_0xe37a('0x33')]('YYYY-MM-DD\x20HH:mm:ss');_0x3be16b[_0xe37a('0x6')][_0x16c78a]['uniqueid']=_0x13644a;_0x3be16b[_0xe37a('0x6')][_0x16c78a][_0xe37a('0x25')]=_0x35d55b;_0x3be16b[_0xe37a('0x6')][_0x16c78a]['updateAcw']=_0x3be16b[_0xe37a('0x18')][_0xe37a('0xa')](_0x3be16b,_0x16c78a,_0x13644a);})['catch'](function(){logger[_0xe37a('0x20')](_0xe37a('0x31'),_0x13644a,_0x3be16b[_0xe37a('0x4')][_0x35d55b]['acwTimeout'],_0x16c78a,_0x35d55b);})[_0xe37a('0x22')](function(){delete _0x3be16b[_0xe37a('0x7')][_0x13644a];});}catch(_0x4c8ef1){logger[_0xe37a('0x20')]('[ACW][START]\x20%s',_0x4c8ef1['message']);}};Acw[_0xe37a('0x17')][_0xe37a('0x32')]=function(_0x112776){try{var _0x4e45dd=this;if(_0x4e45dd[_0xe37a('0x6')][_0x112776]){_0x4e45dd['timers'][_0x112776][_0xe37a('0x1a')]=![];var _0x4682d3=_0x4e45dd[_0xe37a('0x6')][_0x112776]['uniqueid'];var _0x24e021=_0x4e45dd[_0xe37a('0x6')][_0x112776][_0xe37a('0x25')];var _0x4314c2=_0x4e45dd[_0xe37a('0x4')][_0x24e021][_0xe37a('0x34')];logger[_0xe37a('0x1e')]('[%s][TIMER][STOP][AGENT:%s]',_0x4682d3,_0x112776);RpcUser['getAgent'](this[_0xe37a('0x5')][_0x112776]['id'])[_0xe37a('0x1d')](function(_0x38ad16){if(_0x38ad16['pauseType']===_0xe37a('0x26')){return RpcUser[_0xe37a('0x35')](_0x4e45dd[_0xe37a('0x5')][_0x112776]);}});RpcVoiceAgentReport['update']({'acwtime':_0x4314c2,'agentacw':!![]},_0x4682d3,_0x112776)['then'](function(_0xf0cd36){logger[_0xe37a('0x1e')](_0xe37a('0x36'),_0x4682d3,_0x4314c2,_0xf0cd36);})[_0xe37a('0x1f')](function(_0x533146){logger[_0xe37a('0x20')](_0xe37a('0x21'),_0x4682d3,_0x533146);});}else{logger[_0xe37a('0x20')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x112776);if(_0x4e45dd['timers']){logger[_0xe37a('0x1e')](_0xe37a('0x37'),JSON[_0xe37a('0x38')](_0x4e45dd['timers']));}}}catch(_0x64723c){logger[_0xe37a('0x20')](_0xe37a('0x39'),_0x64723c[_0xe37a('0x3a')]);}};Acw[_0xe37a('0x17')][_0xe37a('0x9')]=function(_0x562d56){try{if(this[_0xe37a('0x4')][_0x562d56[_0xe37a('0x25')]]&&(this[_0xe37a('0x4')][_0x562d56['queue']][_0xe37a('0x3b')]||this[_0xe37a('0x4')][_0x562d56['queue']][_0xe37a('0x3c')])){if(this[_0xe37a('0x5')][_0x562d56[_0xe37a('0x24')]]){this[_0xe37a('0x7')][_0x562d56['uniqueid']]={'queue':_0x562d56[_0xe37a('0x25')],'interface':_0x562d56[_0xe37a('0x24')],'destlinkedid':_0x562d56['destlinkedid']};}}}catch(_0x184c9b){logger['error'](_0xe37a('0x3d'),_0x184c9b[_0xe37a('0x3a')]);}};Acw[_0xe37a('0x17')]['syncAgentConnectPreview']=function(_0x5de15f){try{if(this['voiceQueues'][_0x5de15f[_0xe37a('0x25')]]&&(this[_0xe37a('0x4')][_0x5de15f['queue']][_0xe37a('0x3b')]||this[_0xe37a('0x4')][_0x5de15f[_0xe37a('0x25')]][_0xe37a('0x3c')])){if(this['agents'][_0x5de15f[_0xe37a('0x24')]]){this[_0xe37a('0x7')][_0x5de15f[_0xe37a('0x1c')]]={'queue':_0x5de15f[_0xe37a('0x25')],'interface':_0x5de15f[_0xe37a('0x24')]};}}}catch(_0x29c883){logger['error'](_0xe37a('0x3e'),_0x29c883[_0xe37a('0x3a')]);}};Acw[_0xe37a('0x17')][_0xe37a('0xc')]=function(_0x58bb76){try{if(this['channels'][_0x58bb76[_0xe37a('0x1c')]]&&_[_0xe37a('0x3f')](this[_0xe37a('0x7')][_0x58bb76[_0xe37a('0x1c')]][_0xe37a('0x2d')])){logger[_0xe37a('0x1e')](_0xe37a('0x40'),_0x58bb76[_0xe37a('0x1c')]);this[_0xe37a('0x23')](_0x58bb76[_0xe37a('0x1c')]);}else if(this[_0xe37a('0x7')][_0x58bb76[_0xe37a('0x41')]]&&_[_0xe37a('0x3f')](this[_0xe37a('0x7')][_0x58bb76[_0xe37a('0x41')]][_0xe37a('0x2d')])){logger['info'](_0xe37a('0x42'),_0x58bb76[_0xe37a('0x41')]);this[_0xe37a('0x23')](_0x58bb76[_0xe37a('0x41')]);}}catch(_0x365016){logger['error'](_0xe37a('0x43'),_0x365016['message']);}};Acw[_0xe37a('0x17')]['syncHangup']=function(_0x1beb51){try{if(this['channels'][_0x1beb51[_0xe37a('0x1c')]]&&this[_0xe37a('0x7')][_0x1beb51['uniqueid']][_0xe37a('0x2d')]){logger[_0xe37a('0x1e')](_0xe37a('0x44'),_0x1beb51[_0xe37a('0x1c')]);this[_0xe37a('0x23')](_0x1beb51[_0xe37a('0x1c')]);}else if(this[_0xe37a('0x7')][_0x1beb51[_0xe37a('0x41')]]&&this[_0xe37a('0x7')][_0x1beb51[_0xe37a('0x41')]][_0xe37a('0x2d')]){logger[_0xe37a('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1beb51['linkedid']);this[_0xe37a('0x23')](_0x1beb51[_0xe37a('0x41')]);}}catch(_0x145c40){logger['error'](_0xe37a('0x45'),_0x145c40[_0xe37a('0x3a')]);}};Acw[_0xe37a('0x17')][_0xe37a('0x10')]=function(_0x4d4ffb){try{if(!_[_0xe37a('0x46')](this[_0xe37a('0x7')][_0x4d4ffb[_0xe37a('0x47')]])){this[_0xe37a('0x23')](_0x4d4ffb['transfereeuniqueid']);if(this[_0xe37a('0x7')][_0x4d4ffb['secondtransfereruniqueid']]){this[_0xe37a('0x7')][_0x4d4ffb['secondtransfereruniqueid']][_0xe37a('0x2d')]=!![];this[_0xe37a('0x7')][_0x4d4ffb['transfertargetuniqueid']]=this[_0xe37a('0x7')][_0x4d4ffb[_0xe37a('0x48')]];delete this[_0xe37a('0x7')][_0x4d4ffb['secondtransfereruniqueid']];}}else if(!_['isNil'](this['channels'][_0x4d4ffb[_0xe37a('0x49')]])){this['startAcw'](_0x4d4ffb[_0xe37a('0x49')]);if(this[_0xe37a('0x7')][_0x4d4ffb[_0xe37a('0x4a')]]){this[_0xe37a('0x7')][_0x4d4ffb[_0xe37a('0x4a')]][_0xe37a('0x2d')]=!![];this[_0xe37a('0x7')][_0x4d4ffb['transfereeuniqueid']]=this[_0xe37a('0x7')][_0x4d4ffb[_0xe37a('0x4a')]];delete this[_0xe37a('0x7')][_0x4d4ffb['origtransfereruniqueid']];}}}catch(_0x25b0b5){logger[_0xe37a('0x20')]('[ACW][syncAttendedTransfer]\x20%s',_0x25b0b5[_0xe37a('0x3a')]);}};Acw[_0xe37a('0x17')][_0xe37a('0x12')]=function(_0x40fa83){try{if(this[_0xe37a('0x7')][_0x40fa83[_0xe37a('0x4b')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x40fa83[_0xe37a('0x4b')]));this[_0xe37a('0x23')](_0x40fa83[_0xe37a('0x4b')]);}else if(this[_0xe37a('0x7')][_0x40fa83['transfererlinkedid']]){logger[_0xe37a('0x1e')](_0xe37a('0x4c'),JSON['stringify'](_0x40fa83[_0xe37a('0x4d')]));this[_0xe37a('0x23')](_0x40fa83[_0xe37a('0x4d')]);}}catch(_0x1b1772){logger[_0xe37a('0x20')](_0xe37a('0x4e'),_0x1b1772['message']);}};Acw[_0xe37a('0x17')][_0xe37a('0xf')]=function(_0x22e746){try{if(this[_0xe37a('0x4')][_0x22e746[_0xe37a('0x25')]]&&this['voiceQueues'][_0x22e746['queue']][_0xe37a('0x4f')]==='all'){if(this[_0xe37a('0x5')][_0x22e746['interface']]){logger[_0xe37a('0x1e')](_0xe37a('0x50'),_0x22e746[_0xe37a('0x1c')],_0x22e746['interface'],_0x22e746[_0xe37a('0x25')]);return RpcUser['savePause'](this[_0xe37a('0x5')][_0x22e746['interface']],_0xe37a('0x51'),_0x22e746[_0xe37a('0x1c')]);}}}catch(_0x13d779){logger[_0xe37a('0x20')](_0xe37a('0x52'),_0x13d779[_0xe37a('0x3a')]);}};module[_0xe37a('0x53')]=Acw;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78d9=['devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','coreshowchannels','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionCoreShowChannels','[ami.js][fullybooted]','close','exports','bluebird','util','../../config/logger','asterisk','port','username','password','keepConnected','Action','promisify','error','actionSipShowRegistry'];(function(_0xe4d8e8,_0x1eefca){var _0x14c0ed=function(_0x4c257f){while(--_0x4c257f){_0xe4d8e8['push'](_0xe4d8e8['shift']());}};_0x14c0ed(++_0x1eefca);}(_0x78d9,0xdb));var _0x978d=function(_0x2e6149,_0x380c23){_0x2e6149=_0x2e6149-0x0;var _0x3a7dce=_0x78d9[_0x2e6149];return _0x3a7dce;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x978d('0x0'));var util=require(_0x978d('0x1'));var logger=require(_0x978d('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x978d('0x3')][_0x978d('0x4')],config[_0x978d('0x3')]['ip'],config[_0x978d('0x3')][_0x978d('0x5')],config[_0x978d('0x3')][_0x978d('0x6')],!![]);ami[_0x978d('0x7')]();ami[_0x978d('0x8')]=BPromise[_0x978d('0x9')](ami['action']);function error(_0x68e53d){logger[_0x978d('0xa')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config['asterisk'][_0x978d('0x4')],util['inspect'](_0x68e53d,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config[_0x978d('0x3')][_0x978d('0x4')]));}ami[_0x978d('0xb')]=function(){return function(){return ami[_0x978d('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x978d('0x8')]({'action':_0x978d('0xc')});};};ami[_0x978d('0xd')]=function(){return function(){return ami[_0x978d('0x8')]({'action':'sippeerstatus'});};};ami[_0x978d('0xe')]=function(){return function(){return ami['Action']({'action':_0x978d('0xf')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x978d('0x8')]({'action':_0x978d('0x10')});};};function connect(){logger['info'](util[_0x978d('0x11')](_0x978d('0x12'),config[_0x978d('0x3')][_0x978d('0x5')],config[_0x978d('0x3')]['ip'],config['asterisk'][_0x978d('0x4')]));ami[_0x978d('0x13')](_0x978d('0xa'),error);ami[_0x978d('0x13')]('close',close);}ami['on']('connect',connect);ami['on'](_0x978d('0x14'),function(_0xd9b273){logger[_0x978d('0x15')](util['format'](_0x978d('0x16'),config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config['asterisk'][_0x978d('0x4')],util[_0x978d('0x17')](_0xd9b273,![],null)));});ami['on'](_0x978d('0x18'),function(){logger[_0x978d('0x15')](util['format'](_0x978d('0x19'),config[_0x978d('0x3')][_0x978d('0x5')],config['asterisk']['ip'],config[_0x978d('0x3')][_0x978d('0x4')]));return Promise[_0x978d('0x1a')]()['then'](ami[_0x978d('0xb')]())[_0x978d('0x1b')](ami[_0x978d('0x1c')]())['then'](ami[_0x978d('0xd')]())[_0x978d('0x1b')](ami[_0x978d('0xe')]())['then'](ami[_0x978d('0x1d')]())['catch'](function(_0x488949){logger[_0x978d('0xa')](_0x978d('0x1e'),util['inspect'](_0x488949,{'showHidden':![],'depth':null}));});});ami[_0x978d('0x13')](_0x978d('0xa'),error);ami[_0x978d('0x13')](_0x978d('0x1f'),close);module[_0x978d('0x20')]=ami;
\ No newline at end of file
+var _0xea8d=['asterisk-manager','bluebird','util','ami','../../config/environment','asterisk','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','actionDeviceStateList','sippeerstatus','actionQueueSummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch'];(function(_0x378307,_0x2b2456){var _0x3d31d4=function(_0x51d863){while(--_0x51d863){_0x378307['push'](_0x378307['shift']());}};_0x3d31d4(++_0x2b2456);}(_0xea8d,0x1e0));var _0xdea8=function(_0x6c97b5,_0x23f020){_0x6c97b5=_0x6c97b5-0x0;var _0x598ab5=_0xea8d[_0x6c97b5];return _0x598ab5;};'use strict';var Manager=require(_0xdea8('0x0'));var BPromise=require(_0xdea8('0x1'));var util=require(_0xdea8('0x2'));var logger=require('../../config/logger')(_0xdea8('0x3'));var config=require(_0xdea8('0x4'));var ami=new Manager(config['asterisk']['port'],config[_0xdea8('0x5')]['ip'],config['asterisk'][_0xdea8('0x6')],config[_0xdea8('0x5')][_0xdea8('0x7')],!![]);ami[_0xdea8('0x8')]();ami[_0xdea8('0x9')]=BPromise['promisify'](ami[_0xdea8('0xa')]);function error(_0x2580e2){logger[_0xdea8('0xb')](util[_0xdea8('0xc')](_0xdea8('0xd'),config[_0xdea8('0x5')][_0xdea8('0x6')],config[_0xdea8('0x5')]['ip'],config[_0xdea8('0x5')]['port'],util[_0xdea8('0xe')](_0x2580e2,![],null)));}function close(){logger['error'](util[_0xdea8('0xc')](_0xdea8('0xf'),config[_0xdea8('0x5')][_0xdea8('0x6')],config['asterisk']['ip'],config[_0xdea8('0x5')][_0xdea8('0x10')]));}ami[_0xdea8('0x11')]=function(){return function(){return ami[_0xdea8('0x9')]({'action':'sipshowregistry'});};};ami[_0xdea8('0x12')]=function(){return function(){return ami[_0xdea8('0x9')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xdea8('0x9')]({'action':_0xdea8('0x13')});};};ami[_0xdea8('0x14')]=function(){return function(){return ami[_0xdea8('0x9')]({'action':'queuesummary'});};};ami[_0xdea8('0x15')]=function(){return function(){return ami[_0xdea8('0x9')]({'action':'coreshowchannels'});};};function connect(){logger[_0xdea8('0x16')](util[_0xdea8('0xc')](_0xdea8('0x17'),config[_0xdea8('0x5')][_0xdea8('0x6')],config[_0xdea8('0x5')]['ip'],config[_0xdea8('0x5')][_0xdea8('0x10')]));ami[_0xdea8('0x18')](_0xdea8('0xb'),error);ami[_0xdea8('0x18')](_0xdea8('0x19'),close);}ami['on'](_0xdea8('0x1a'),connect);ami['on']('shutdown',function(_0x1dabe1){logger[_0xdea8('0x16')](util[_0xdea8('0xc')](_0xdea8('0x1b'),config[_0xdea8('0x5')][_0xdea8('0x6')],config[_0xdea8('0x5')]['ip'],config[_0xdea8('0x5')][_0xdea8('0x10')],util[_0xdea8('0xe')](_0x1dabe1,![],null)));});ami['on'](_0xdea8('0x1c'),function(){logger[_0xdea8('0x16')](util[_0xdea8('0xc')](_0xdea8('0x1d'),config[_0xdea8('0x5')][_0xdea8('0x6')],config[_0xdea8('0x5')]['ip'],config[_0xdea8('0x5')][_0xdea8('0x10')]));return Promise['resolve']()[_0xdea8('0x1e')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())['then'](ami['actionSipPeerStatus']())[_0xdea8('0x1e')](ami['actionQueueSummary']())[_0xdea8('0x1e')](ami['actionCoreShowChannels']())[_0xdea8('0x1f')](function(_0x3ea476){logger[_0xdea8('0xb')]('[ami.js][fullybooted]',util[_0xdea8('0xe')](_0x3ea476,{'showHidden':![],'depth':null}));});});ami[_0xdea8('0x18')](_0xdea8('0xb'),error);ami[_0xdea8('0x18')](_0xdea8('0x19'),close);module['exports']=ami;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcb91[_0x42cae2];return _0x5f256f;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client;
\ No newline at end of file
+var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0xe706,0xa3));var _0x6e70=function(_0x2a332d,_0x3d5865){_0x2a332d=_0x2a332d-0x0;var _0x5d24c4=_0xe706[_0x2a332d];return _0x5d24c4;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2afa=['dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectRetryFrequency','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAvgTalktime','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','checkIsBlackListIvr','checkContactBlack','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[countReScheduled]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','erlangb','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','syncQueueSummary','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','Interval','isIVRCampaignActive','INACTIVE','isIVRCampaign','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','Action','iftime\x20%s,%s','interval','timezones','indexOf','true','catch','command','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','responsetime','outboundDropCallsDayTimeout','Drop','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','countdropretry','add','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','starttime','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','minutes','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','pick','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HangupInAMD','membername','AMD','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','Machine','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','[syncHangupInAMDIvr]','countnoanswerretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','statusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','filter','online','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','getCallerId','dialOriginateCallerIdName'];(function(_0x3b8d77,_0x34d393){var _0x31e0d5=function(_0x5efa35){while(--_0x5efa35){_0x3b8d77['push'](_0x3b8d77['shift']());}};_0x31e0d5(++_0x34d393);}(_0x2afa,0xaa));var _0xa2af=function(_0xea6c7f,_0x18302f){_0xea6c7f=_0xea6c7f-0x0;var _0x3ae97e=_0x2afa[_0xea6c7f];return _0x3ae97e;};'use strict';var util=require(_0xa2af('0x0'));var _=require(_0xa2af('0x1'));var uuid=require(_0xa2af('0x2'));var moment=require(_0xa2af('0x3'));var rr=require('rr');var Redis=require(_0xa2af('0x4'));var utils=require(_0xa2af('0x5'));var hopperUtils=require(_0xa2af('0x6'));var ut=require(_0xa2af('0x7'));var config=require(_0xa2af('0x8'));var logger=require('../../../config/logger')(_0xa2af('0x9'));var loggerBooked=require(_0xa2af('0xa'))(_0xa2af('0xb'));var loggerPredictive=require(_0xa2af('0xa'))(_0xa2af('0xc'));var loggerPredictiveCalls=require(_0xa2af('0xa'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xa2af('0xd'));var ami=require('../ami');config['redis']=_[_0xa2af('0xe')](config[_0xa2af('0xf')],{'host':'localhost','port':0x18eb});var io=require(_0xa2af('0x10'))(new Redis(config[_0xa2af('0xf')]));var cmHopper=require(_0xa2af('0x11'));var voiceQueueRt=require(_0xa2af('0x12'));var RpcSetting=require(_0xa2af('0x13'));var Interval=require(_0xa2af('0x14'));var Action=require(_0xa2af('0x15'));var History=require(_0xa2af('0x16'));var Final=require(_0xa2af('0x17'));var AgentComplete=require(_0xa2af('0x18'));var QueueCallerAbandon=require(_0xa2af('0x19'));var Hangup=require(_0xa2af('0x1a'));var ipAgi=process[_0xa2af('0x1b')]['XCALLY_IP_AGI']||_0xa2af('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xa2af('0x1d')]=function(_0x272aaa){this['tail']=this[_0xa2af('0x1e')]?this[_0xa2af('0x1e')][_0xa2af('0x1f')](_0x272aaa):_0x272aaa();};function Dialer(_0x504090,_0xf29c8e){this[_0xa2af('0x20')]=new Sequence();this[_0xa2af('0x21')]=_0xf29c8e;this[_0xa2af('0x22')]=_0x504090[_0xa2af('0x22')];this[_0xa2af('0x23')]=_0x504090[_0xa2af('0x23')];this[_0xa2af('0x24')]=_0x504090[_0xa2af('0x24')];this['trunks']=_0x504090[_0xa2af('0x25')];this['maxNumberOriginate']=config[_0xa2af('0x26')]||0x2;this[_0xa2af('0x27')]={};this[_0xa2af('0x28')]={};this[_0xa2af('0x29')]={};this[_0xa2af('0x2a')]={};this[_0xa2af('0x2b')]={};this[_0xa2af('0x2c')]={};this[_0xa2af('0x2d')]={};this[_0xa2af('0x2e')]={};this[_0xa2af('0x2f')]={};this['queueBookedRR']={};this[_0xa2af('0x30')]={};ami['on']('agentconnect',this[_0xa2af('0x31')][_0xa2af('0x32')](this));ami['on'](_0xa2af('0x33'),this[_0xa2af('0x34')][_0xa2af('0x32')](this));ami['on']('originateresponse',this[_0xa2af('0x35')][_0xa2af('0x32')](this));ami['on'](_0xa2af('0x36'),this[_0xa2af('0x37')][_0xa2af('0x32')](this));ami['on']('custom:queuesummary',this['syncQueueSummary']['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0xa2af('0x38')]['bind'](this));ami['on'](_0xa2af('0x39'),this[_0xa2af('0x3a')]['bind'](this));ami['on'](_0xa2af('0x3b'),this[_0xa2af('0x3c')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xa2af('0x32')](this));ami['on'](_0xa2af('0x3d'),this['syncQueueMember']['bind'](this));ami['on'](_0xa2af('0x3e'),this[_0xa2af('0x3f')][_0xa2af('0x32')](this));this[_0xa2af('0x40')]();this[_0xa2af('0x41')]();RpcSetting['getSettings']()[_0xa2af('0x42')](function(_0x3b6a3c){previewRecallmeReminderInterval=_0x3b6a3c[_0xa2af('0x43')];});}function isNotNull(_0x1d6316){return _0x1d6316!==null&&!_[_0xa2af('0x44')](_0x1d6316);}function msgResponse(_0x564ddf,_0x526082,_0x19aefe){return{'action':_0x564ddf,'response':_0x526082,'message':_0x19aefe,'stack':_0x19aefe};}function emit(_0x201fca,_0x45cb64,_0x5f13d8){io['to'](_0x201fca)[_0xa2af('0x45')](_0x45cb64,_0x5f13d8);}function emitOutboundVoiceQueueSummary(_0x15310d){if(_0x15310d[_0xa2af('0x46')]===_0xa2af('0x47')){logger['debug'](_0xa2af('0x48'),util[_0xa2af('0x49')](_0x15310d,{'showHidden':![],'depth':null}));emit(util[_0xa2af('0x4a')](_0xa2af('0x4b'),_0x15310d[_0xa2af('0x4c')]),_0xa2af('0x4d'),_0x15310d);}}function checkGetDataPredictive(_0x40c05e){if(isNotNull(_0x40c05e)&&!_[_0xa2af('0x4e')](_0x40c05e)){loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x50'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40c05e[_0xa2af('0x51')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x52'),_0x40c05e[_0xa2af('0x53')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x54'),_0x40c05e[_0xa2af('0x55')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40c05e[_0xa2af('0x56')]);loggerPredictive['info'](_0xa2af('0x57'),_0x40c05e[_0xa2af('0x58')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x59'),_0x40c05e['predictiveIntervalAvgTalktime']);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5a'));if(_0x40c05e[_0xa2af('0x51')]>0x0){if(!_[_0xa2af('0x44')](_0x40c05e['predictiveIntervalAvgTalktime'])&&_0x40c05e['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xa2af('0x44')](_0x40c05e[_0xa2af('0x58')])&&_0x40c05e['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5b'));}else{loggerPredictive['info'](_0xa2af('0x5c'));}}else{loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5d'));}return![];}function mergeDataErlangB(_0x2e6939){return function(_0x32e6d0){loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5e'));loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5f'),_0x32e6d0[_0xa2af('0x60')]);loggerPredictive[_0xa2af('0x4f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32e6d0[_0xa2af('0x61')]);loggerPredictive[_0xa2af('0x4f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32e6d0[_0xa2af('0x62')]);loggerPredictive[_0xa2af('0x4f')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32e6d0[_0xa2af('0x63')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x64'),_0x32e6d0[_0xa2af('0x62')]);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5a'));_[_0xa2af('0x65')](_0x2e6939,_0x32e6d0);};}function ifInterval(_0x4e4f07,_0x10629f){if(_[_0xa2af('0x44')](_0x10629f)){return![];}return utils[_0xa2af('0x66')](undefined,_0x10629f)<_0x4e4f07*0x3c;}function clearPredictiveAttributes(_0x465da4){if(_0x465da4[_0xa2af('0x2d')]){_0x465da4[_0xa2af('0x2d')]=undefined;loggerPredictive[_0xa2af('0x67')](_0x465da4[_0xa2af('0x4c')],_0xa2af('0x68'));}if(_0x465da4[_0xa2af('0x2c')]){_0x465da4[_0xa2af('0x2c')]=undefined;loggerPredictive['debug'](_0x465da4['name'],_0xa2af('0x69'));}if(_0x465da4[_0xa2af('0x6a')]){clearInterval(_0x465da4[_0xa2af('0x6a')]);_0x465da4[_0xa2af('0x6a')]=undefined;loggerPredictive[_0xa2af('0x67')](_0x465da4[_0xa2af('0x4c')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x1724f4,_0x337fdb){return function(_0x56b83a){loggerPredictive[_0xa2af('0x6b')](_0x337fdb[_0xa2af('0x4c')],_0x1724f4);loggerPredictive[_0xa2af('0x6b')](_0x56b83a[_0xa2af('0x6c')]);clearPredictiveAttributes(_0x337fdb);};}function loggerCatch(_0x33e86e){return function(_0x5c31c8){logger[_0xa2af('0x6b')](_0x33e86e,util[_0xa2af('0x49')](_0x5c31c8,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2cc1ba,_0x73e030,_0x45c790){return function(_0x1c096b){utils[_0xa2af('0x6d')](_0x73e030,_0x45c790,0x0);_0x73e030[_0xa2af('0x6e')]=0x0;logger['error'](_0x2cc1ba,util['inspect'](_0x1c096b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x12358e){return function(_0x4455ef){if(isNotNull(_0x4455ef)&&isNotNull(_0x4455ef[0x0])){if(_0x4455ef[0x0]['contactsRescheduled']>0x0){_0x12358e[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x71')];logger['info']('[getContactDialer2][ReScheduled]'+_0x12358e[_0xa2af('0x4c')],_0x4455ef[0x0][_0xa2af('0x72')],_0xa2af('0x73'));}else{_0x12358e['message']=utils[_0xa2af('0x70')][_0xa2af('0x74')];logger['info']('[getContactDialer2][Empty]'+_0x12358e[_0xa2af('0x4c')]);}}};}function createObjHistory(_0x3fbc1b,_0x772ceb,_0x8c5bbe,_0x23b3ab,_0x346698){_0x3fbc1b[_0xa2af('0x6f')]=_0x8c5bbe;var _0x5c09f5=new Action(_0x3fbc1b,_0x772ceb);var _0x1b83d6=new History(_0x5c09f5);_0x1b83d6[_0xa2af('0x75')]=_0x23b3ab;_0x1b83d6[_0xa2af('0x76')]=_0x346698;_0x1b83d6[_0xa2af('0x77')]=_0x5c09f5['starttime'];return _0x1b83d6;}function unlockQueueStatus(_0x226f07,_0x2abe80){setTimeout(function(){if(_[_0xa2af('0x44')](_0x226f07[_0xa2af('0x78')])){loggerBooked[_0xa2af('0x6b')](_0xa2af('0x79'),_0x2abe80);}_0x226f07[_0xa2af('0x78')]=!![];loggerBooked[_0xa2af('0x4f')](_0xa2af('0x7a'),_0x2abe80,JSON[_0xa2af('0x7b')](_['pick'](_0x226f07,[_0xa2af('0x4c'),_0xa2af('0x78')])));},0x1f3);}function checkInterval(_0x292b57){return function(){if(!isNotNull(_0x292b57['Interval'])){_0x292b57[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x7c')];throw _0x292b57[_0xa2af('0x4c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x292b57['Interval'][_0xa2af('0x7d')])){_0x292b57[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x7c')];throw _0x292b57['name']+_0xa2af('0x7e');}if(!isNotNull(_['isEmpty'](_0x292b57[_0xa2af('0x7f')][_0xa2af('0x7d')]))){_0x292b57[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x7c')];throw _0x292b57[_0xa2af('0x4c')]+_0xa2af('0x7e');}};}function checkIsIVRCampaignActive(_0x48b9bc){return function(){if(!utils[_0xa2af('0x80')](_0x48b9bc)){_0x48b9bc[_0xa2af('0x6f')]=utils['CAMPAIGN_STATUS'][_0xa2af('0x81')];throw _0x48b9bc[_0xa2af('0x4c')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x1fa6b1){if(utils[_0xa2af('0x82')](_0x1fa6b1)){emit(util[_0xa2af('0x4a')]('campaign:ivr:%s',_0x1fa6b1[_0xa2af('0x4c')]),'campaign:save',_0x1fa6b1);}}function loggerCatchQueueSummary(_0x34b48b,_0x1adeac){return function(_0x4f554a){clearPredictiveAttributes(_0x1adeac);emitCampaignSummary(_0x1adeac);loggerSyncQueueSummary['debug'](_0x34b48b,util['inspect'](_0x4f554a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3ebe9b){if(_0x3ebe9b[_0xa2af('0x83')]){if(_0x3ebe9b['originated']===0x0){_0x3ebe9b[_0xa2af('0x83')]=![];_0x3ebe9b[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x81')];loggerSyncQueueSummary[_0xa2af('0x67')](_0xa2af('0x84'),_0x3ebe9b[_0xa2af('0x4c')],_0xa2af('0x85'));}else{_0x3ebe9b[_0xa2af('0x6f')]=utils[_0xa2af('0x70')]['DISACTIVED'];loggerSyncQueueSummary[_0xa2af('0x67')](_0xa2af('0x84'),_0x3ebe9b['name'],_0xa2af('0x86'));}emitCampaignSummary(_0x3ebe9b);}}function myreject(_0xe41f04){return function(_0x293302){return _0xe41f04(msgResponse(_0xa2af('0x87'),_0xa2af('0x88'),JSON[_0xa2af('0x7b')](_0x293302)));};}Dialer[_0xa2af('0x89')][_0xa2af('0x8a')]=function(_0x20f846){return!_[_0xa2af('0x44')](_0x20f846)&&_0x20f846&&!_[_0xa2af('0x44')](_0x20f846['name'])&&!_[_0xa2af('0x44')](_0x20f846[_0xa2af('0x8b')])&&_0x20f846[_0xa2af('0x8b')]&&(this[_0xa2af('0x25')][util['format'](_0xa2af('0x8c'),_0x20f846[_0xa2af('0x4c')])][_0xa2af('0x8d')]===_0xa2af('0x8e')||this[_0xa2af('0x25')][util[_0xa2af('0x4a')](_0xa2af('0x8c'),_0x20f846[_0xa2af('0x4c')])][_0xa2af('0x8d')]===_0xa2af('0x8f'));};Dialer[_0xa2af('0x89')]['checkIsTrunkReachable']=function(_0x4d133e){var _0x4ab55d=this;return function(){if(!_0x4ab55d[_0xa2af('0x8a')](_0x4d133e['Trunk'])){if(!_0x4ab55d[_0xa2af('0x8a')](_0x4d133e['TrunkBackup'])){_0x4d133e['message']=utils[_0xa2af('0x70')][_0xa2af('0x90')];throw _0x4d133e[_0xa2af('0x4c')]+_0xa2af('0x91');}}};};Dialer['prototype']['checkIfTime']=function(_0x3876b1,_0x2bea0f,_0x23628f,_0x28a0c8){var _0x2c3108=this;return function(){var _0x1d511=!![];return _0x2c3108[_0xa2af('0x92')](_0x3876b1,_0x2bea0f,_0x23628f,_0x28a0c8,_0x1d511);};};Dialer[_0xa2af('0x89')][_0xa2af('0x93')]=function(_0xd1766f,_0x27166c,_0x25d8ec,_0x49f872){var _0x460e9e=this;return function(){var _0x52ad09=![];return _0x460e9e[_0xa2af('0x92')](_0xd1766f['Intervals'],_0x27166c,_0x25d8ec,_0x49f872,_0x52ad09);};};Dialer[_0xa2af('0x89')][_0xa2af('0x92')]=function(_0x37bc40,_0x3f34e1,_0x39f577,_0x32e447,_0x57bb14){var _0x125d83=[];return new Promise(function(_0x17ff51,_0xa91e7){if(!isNotNull(_0x37bc40)){_0x32e447[_0xa2af('0x6f')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0xa91e7(msgResponse(_0xa2af('0x94'),_0xa2af('0x95'),_0x39f577+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xa2af('0x4e')](_0x37bc40)){_0x32e447[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x96')];return _0xa91e7(msgResponse('ifTime',_0xa2af('0x95'),_0x39f577+_0xa2af('0x97')));}if(_0x3f34e1&&_[_0xa2af('0x44')](config['timezones'][_0x3f34e1])){_0x32e447[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x98')];return _0xa91e7(msgResponse(_0xa2af('0x94'),_0xa2af('0x95'),_0x39f577+_0xa2af('0x99')+_0x3f34e1));}if(_['isArray'](_0x37bc40)){for(var _0x1453d7=0x0;_0x1453d7<_0x37bc40['length'];_0x1453d7+=0x1){_0x125d83[_0xa2af('0x9a')](ami[_0xa2af('0x9b')]({'action':'command','command':util[_0xa2af('0x4a')](_0xa2af('0x9c'),_0x37bc40[_0x1453d7][_0xa2af('0x9d')],!_[_0xa2af('0x44')](config[_0xa2af('0x9e')][_0x3f34e1])?_0x3f34e1:'')})['then'](function(_0x47de6a){return _0x47de6a['content'][_0xa2af('0x9f')](_0xa2af('0xa0'))>=0x0;})[_0xa2af('0xa1')](myreject(_0xa91e7)));}}else{_0x125d83[_0xa2af('0x9a')](ami[_0xa2af('0x9b')]({'action':_0xa2af('0xa2'),'command':util[_0xa2af('0x4a')](_0xa2af('0x9c'),_0x37bc40,!_[_0xa2af('0x44')](config[_0xa2af('0x9e')][_0x3f34e1])?_0x3f34e1:'')})[_0xa2af('0x42')](function(_0x264ae7){return _0x264ae7[_0xa2af('0xa3')]['indexOf'](_0xa2af('0xa0'))>=0x0;})[_0xa2af('0xa1')](myreject(_0xa91e7)));}Promise[_0xa2af('0xa4')](_0x125d83)['then'](function(_0x35323d){var _0x32d239=_[_0xa2af('0xa5')](_0x35323d);if(_0x32d239){return _0x17ff51(_0x32d239);}else{_0x32e447[_0xa2af('0x6f')]=_0x57bb14?utils[_0xa2af('0x70')][_0xa2af('0xa6')]:utils['CAMPAIGN_STATUS'][_0xa2af('0xa7')];return _0xa91e7(msgResponse(_0xa2af('0xa8'),_0xa2af('0x95'),_0xa2af('0xa9')+_0x57bb14+'\x20'+_0x39f577+_0xa2af('0xaa')+util['inspect'](_0x37bc40,{'showHidden':![],'depth':null})+_0xa2af('0xab')+_0x3f34e1));}})[_0xa2af('0xa1')](function(_0x411331){return _0xa91e7(msgResponse('ifTime',_0xa2af('0x95'),JSON[_0xa2af('0x7b')](_0x411331)));});});};Dialer[_0xa2af('0x89')]['loopCampaigns']=function(){var _0x3a3ad4=this;return cmHopper[_0xa2af('0xac')]({'active':![]},{'where':{'active':!![]}})[_0xa2af('0x42')](function(){setInterval(function(){_0x3a3ad4[_0xa2af('0xad')]();},0x3e8);});};Dialer[_0xa2af('0x89')][_0xa2af('0xad')]=function(){var _0x55bbe1=this;var _0x253062;for(var _0x58a79c in this[_0xa2af('0x23')]){if(typeof this[_0xa2af('0x23')][_0x58a79c]!==_0xa2af('0xae')){_0x253062=this[_0xa2af('0x23')][_0x58a79c];if(utils['isIVRCampaign'](_0x253062)&&utils['isIVRCampaignActive'](_0x253062)){_0x253062['sendMessageOneNotActive']=!![];Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](checkIsIVRCampaignActive(_0x253062))[_0xa2af('0x42')](checkInterval(_0x253062))[_0xa2af('0x42')](_0x55bbe1[_0xa2af('0xb0')](_0x253062))[_0xa2af('0x42')](_0x55bbe1[_0xa2af('0xb1')](_0x253062[_0xa2af('0xb2')],_0x253062[_0xa2af('0xb3')],_0x253062[_0xa2af('0x4c')],_0x253062))[_0xa2af('0x42')](_0x55bbe1['checkIfTimeIntervals'](_0x253062[_0xa2af('0x7f')],_0x253062[_0xa2af('0xb3')],_0x253062['name'],_0x253062))[_0xa2af('0x42')](_0x55bbe1[_0xa2af('0xb4')](_0x253062))[_0xa2af('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0x253062));}else{notSendMessagesCampaign(_0x253062);}}}};Dialer[_0xa2af('0x89')][_0xa2af('0xb5')]=function(_0x2c52f7){if(_0x2c52f7[_0xa2af('0xb6')]!==_0xa2af('0xc')){clearPredictiveAttributes(_0x2c52f7);}switch(_0x2c52f7['dialMethod']){case _0xa2af('0xb7'):this[_0xa2af('0xb8')](_0x2c52f7,0x1);break;case _0xa2af('0xb9'):this['handlePower'](_0x2c52f7,_0x2c52f7['dialPowerLevel']);break;case _0xa2af('0xc'):this[_0xa2af('0xc')](_0x2c52f7);break;case _0xa2af('0xb'):this['handlePower'](_0x2c52f7,0x1);break;default:logger[_0xa2af('0x6b')](_0xa2af('0xba'),_0x2c52f7[_0xa2af('0x4c')],_0xa2af('0xbb'));}};Dialer['prototype'][_0xa2af('0x94')]=function(_0x2d8818,_0x2a4e0a){var _0x3b71bf=_0x2d8818[_0xa2af('0xb3')];var _0x18ce50=_0x2a4e0a?_0x2d8818[_0xa2af('0xb2')]:_0x2d8818[_0xa2af('0x7f')][_0xa2af('0x7d')];logger[_0xa2af('0xbc')](_0xa2af('0xbd'),_0x18ce50,_0x3b71bf,_0x2d8818[_0xa2af('0x4c')],util[_0xa2af('0x4a')](_0xa2af('0xbe'),_0x2d8818[_0xa2af('0x4c')],_0x2d8818['id']));var _0x407e57=null;return Interval[_0xa2af('0xbf')](_0x18ce50,_0x3b71bf)[_0xa2af('0x42')](function(_0x5b72c1){if(_0x5b72c1===!![]){return _0x5b72c1;}else{_0x2d8818['message']=_0x2a4e0a?utils['CAMPAIGN_STATUS'][_0xa2af('0xa6')]:utils['CAMPAIGN_STATUS'][_0xa2af('0xa7')];_0x407e57=msgResponse('[ifTime][promiseAll]','Failure',_0xa2af('0xa9')+_0x2a4e0a+'\x20'+_0x2d8818[_0xa2af('0x4c')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa2af('0x49')](_0x18ce50,{'showHidden':![],'depth':null})+_0xa2af('0xab')+_0x3b71bf);}if(_0x407e57!==null){logger[_0xa2af('0xbc')](_0xa2af('0xc0'),_0x407e57);_0x407e57[_0xa2af('0xc1')]=_0x2a4e0a;throw _0x407e57;}})[_0xa2af('0xa1')](function(_0x1ddf65){logger[_0xa2af('0x6b')](_0xa2af('0xc2'),_0x1ddf65);throw msgResponse(_0xa2af('0x87'),_0xa2af('0x88'),util['inspect'](_0x1ddf65,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xa2af('0x31')]=function(_0x540cd1){if(this[_0xa2af('0x22')][_0x540cd1[_0xa2af('0xc3')]]){if(this[_0xa2af('0x2a')][_0x540cd1[_0xa2af('0xc4')]]&&this[_0xa2af('0x2a')][_0x540cd1['uniqueid']]['type']!==_0xa2af('0xc5')){this['updateOriginated'](this['voiceQueues'][_0x540cd1[_0xa2af('0xc3')]]);this[_0xa2af('0x2a')][_0x540cd1['uniqueid']][_0xa2af('0xc6')]=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));}}};Dialer[_0xa2af('0x89')][_0xa2af('0x37')]=function(_0x33cb2c){var _0x5dae5f=this[_0xa2af('0x2a')][_0x33cb2c[_0xa2af('0xc4')]];if(this[_0xa2af('0x22')][_0x33cb2c[_0xa2af('0xc3')]]){if(_0x5dae5f&&_0x5dae5f['type']!==_0xa2af('0xc5')){delete this['uniqueId'][_0x33cb2c['uniqueid']];this[_0xa2af('0x22')][_0x33cb2c[_0xa2af('0xc3')]][_0xa2af('0xc8')]+=0x1;var _0x54d07b=new AgentComplete(_0x5dae5f,_0x33cb2c);if(_0x33cb2c[_0xa2af('0xc9')]===_0xa2af('0xca')){_0x54d07b[_0xa2af('0xcb')]=this[_0xa2af('0x22')][_0x33cb2c[_0xa2af('0xc3')]][_0xa2af('0xcc')]&&this[_0xa2af('0x22')][_0x33cb2c['queue']]['dialAgiAfterHangupAgent']?moment()[_0xa2af('0x4a')](_0xa2af('0xc7')):undefined;}hopperUtils[_0xa2af('0xcd')](_0x54d07b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xce')));hopperUtils[_0xa2af('0xcf')](_0x54d07b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xd0')));}}};Dialer[_0xa2af('0x89')]['syncQueueCallerAbandon']=function(_0x430660){var _0x2ce890=this['uniqueId'][_0x430660[_0xa2af('0xc4')]];var _0x34026e=this;var _0x154926=![];var _0x1ff74a;var _0x1c1c8e;if(this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]]){if(_0x2ce890&&_0x2ce890[_0xa2af('0x46')]!==_0xa2af('0xc5')){delete this[_0xa2af('0x2a')][_0x430660[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this[_0xa2af('0x22')][_0x430660['queue']]);_0x2ce890['droptime']=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));var _0xb464c9=new QueueCallerAbandon(_0x2ce890,_0x430660);if(utils[_0xa2af('0x66')](_0x2ce890['droptime'],_0x2ce890[_0xa2af('0xd2')])>=_0x2ce890['dialQueueTimeout']){this[_0xa2af('0x22')][_0x430660['queue']][_0xa2af('0x55')]+=0x1;this['voiceQueues'][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xd3')]+=0x1;this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xb464c9[_0xa2af('0x75')]=0xa;_0xb464c9[_0xa2af('0x76')]=_0xa2af('0xd4');_0xb464c9['dropreason']='TIMEOUT';_0xb464c9['agiafterat']=this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xcc')]?moment()[_0xa2af('0x4a')](_0xa2af('0xc7')):undefined;_0xb464c9['countdropretry']+=0x1;_0xb464c9[_0xa2af('0xd5')]+=0x1;_0x1ff74a=this[_0xa2af('0x22')][_0x430660['queue']][_0xa2af('0xd6')];_0x1c1c8e=this['voiceQueues'][_0x430660[_0xa2af('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xa2af('0xd7')](_0xb464c9,_0xb464c9[_0xa2af('0x75')],_0x2ce890[_0xa2af('0xd8')])['then'](function(_0x3a0cc9){_0x154926=_0x3a0cc9[_0xa2af('0xd9')]==0x1;if(_0xb464c9['countdropretry']>=_0x34026e[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xda')]){_0x34026e[_0xa2af('0xdb')](_0xb464c9,_0x3a0cc9[_0xa2af('0xd9')]);}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countdropretry':_0xb464c9[_0xa2af('0xdd')],'scheduledat':moment()[_0xa2af('0xde')](_0x34026e[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]]['dialDropRetryFrequency'],'minutes')[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2ce890[_0xa2af('0xdf')],'ListId':_0x2ce890[_0xa2af('0xe0')],'VoiceQueueId':_0x2ce890[_0xa2af('0xe1')]||undefined,'CampaignId':_0x2ce890[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xe3')));var _0x40c43c=new History(_0xb464c9);_0x40c43c[_0xa2af('0x75')]=0xa;_0x40c43c[_0xa2af('0x76')]='Drop';_0x40c43c[_0xa2af('0xe4')]=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));_0x40c43c[_0xa2af('0x77')]=_0x40c43c[_0xa2af('0xe4')];_0x40c43c['calleridname']=_0xb464c9['calleridname'];_0x40c43c[_0xa2af('0xe5')]=_0xb464c9[_0xa2af('0xe5')];hopperUtils['createHistory'](_0x40c43c)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xe6')));}})[_0xa2af('0x42')](function(){if(_0x154926)hopperUtils[_0xa2af('0xe7')](_0xb464c9,_0x1ff74a,_0x1c1c8e)[_0xa2af('0x42')](function(){return 0x1;});});}else{this['voiceQueues'][_0x430660[_0xa2af('0xc3')]][_0xa2af('0x56')]+=0x1;this[_0xa2af('0x22')][_0x430660['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0xb464c9[_0xa2af('0x75')]=0xb;_0xb464c9[_0xa2af('0x76')]=_0xa2af('0xe8');_0xb464c9[_0xa2af('0xe9')]=_0xa2af('0xea');_0xb464c9[_0xa2af('0xeb')]+=0x1;_0xb464c9[_0xa2af('0xd5')]+=0x1;_0x1ff74a=this[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xec')];_0x1c1c8e=this['voiceQueues'][_0x430660[_0xa2af('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xa2af('0xd7')](_0xb464c9,_0xb464c9[_0xa2af('0x75')],_0x2ce890[_0xa2af('0xd8')])[_0xa2af('0x42')](function(_0x2bc4f0){if(_0xb464c9['countabandonedretry']>=_0x34026e[_0xa2af('0x22')][_0x430660['queue']][_0xa2af('0xed')]){_0x34026e[_0xa2af('0xdb')](_0xb464c9,_0x2bc4f0[_0xa2af('0xd9')]);}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countabandonedretry':_0xb464c9[_0xa2af('0xeb')],'scheduledat':moment()[_0xa2af('0xde')](_0x34026e[_0xa2af('0x22')][_0x430660[_0xa2af('0xc3')]][_0xa2af('0xec')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x2ce890[_0xa2af('0xdf')],'ListId':_0x2ce890[_0xa2af('0xe0')],'VoiceQueueId':_0x2ce890[_0xa2af('0xe1')]||undefined,'CampaignId':_0x2ce890['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xef')));var _0x30217f=new History(_0xb464c9);_0x30217f['state']=0xb;_0x30217f['statedesc']=_0xa2af('0xe8');_0x30217f[_0xa2af('0xe4')]=moment()[_0xa2af('0x4a')](_0xa2af('0xc7'));_0x30217f[_0xa2af('0x77')]=_0x30217f[_0xa2af('0xe4')];_0x30217f[_0xa2af('0xf0')]=_0xb464c9[_0xa2af('0xf0')];_0x30217f[_0xa2af('0xe5')]=_0xb464c9['calleridnum'];hopperUtils[_0xa2af('0xcd')](_0x30217f)['catch'](loggerCatch(_0xa2af('0xf1')));}})[_0xa2af('0x42')](function(){if(_0x154926)hopperUtils[_0xa2af('0xe7')](_0xb464c9,_0x1ff74a,_0x1c1c8e)[_0xa2af('0x42')](function(){return 0x1;});});}}}};Dialer[_0xa2af('0x89')][_0xa2af('0x3c')]=function(_0x4d0fe9){if(this['actions'][_0x4d0fe9[_0xa2af('0xc4')]]){this[_0xa2af('0x28')][_0x4d0fe9[_0xa2af('0xc4')]]['channel']=_0x4d0fe9[_0xa2af('0xf2')];}if(this['uniqueId'][_0x4d0fe9['uniqueid']]){this['uniqueId'][_0x4d0fe9['uniqueid']][_0xa2af('0xf2')]=_0x4d0fe9[_0xa2af('0xf2')];}};Dialer[_0xa2af('0x89')][_0xa2af('0xf3')]=function(_0x539cca){if(!this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]){return;}var _0x35923f=this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]['queue']][_0xa2af('0xf5')]||_0xa2af('0xf6');if(_0x35923f===_0xa2af('0xf7')){if(this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]&&_[_0xa2af('0xf8')](this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xf9')])&&_0x539cca[_0xa2af('0x8d')]==='1'&&_0x539cca[_0xa2af('0xfa')]==='0'){if(this[_0xa2af('0x24')][_0x539cca['stateinterface']]){if(!this[_0xa2af('0x24')][_0x539cca[_0xa2af('0xfb')]][_0xa2af('0xf9')]){this['agents'][_0x539cca[_0xa2af('0xfb')]][_0xa2af('0xf9')]=!![];this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xf9')]=!![];this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xfb')]=_0x539cca[_0xa2af('0xfb')];}}}}else if(_0x35923f===_0xa2af('0xf6')){if(this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]){if(this[_0xa2af('0x24')][_0x539cca[_0xa2af('0xfb')]]){this[_0xa2af('0x28')][_0x539cca['actionid']][_0xa2af('0xfb')]=_0x539cca[_0xa2af('0xfb')];if(_[_0xa2af('0xf8')](this['queueBooked'][this['actions'][_0x539cca[_0xa2af('0xf4')]]['queue']])){this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]][_0xa2af('0xc3')]]=[];}this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]]['queue']][_0xa2af('0x9a')](_[_0xa2af('0x65')](_[_0xa2af('0xfc')](this[_0xa2af('0x28')][_0x539cca[_0xa2af('0xf4')]],[_0xa2af('0xfd'),'stateinterface']),{'status':_0x539cca[_0xa2af('0x8d')],'paused':_0x539cca[_0xa2af('0xfa')]}));}}}};Dialer[_0xa2af('0x89')]['syncQueueStatusComplete']=function(_0x2dec0a){if(!this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]]){return;}var _0x1ff7c9=this;var _0x431313=this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]];var _0x1a10d9=_0x431313[_0xa2af('0xf5')]||'rrmemory';if(_0x1a10d9===_0xa2af('0xf7')){if(this['actions'][_0x2dec0a[_0xa2af('0xf4')]]&&this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xfb')]){this[_0xa2af('0x21')][_0xa2af('0xfe')](this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xfd')],this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xfb')])[_0xa2af('0xa1')](function(_0x52f7ca){logger[_0xa2af('0x6b')](_0xa2af('0xff'),util[_0xa2af('0x49')](_0x52f7ca,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1ff7c9[_0xa2af('0xd1')](_0x1ff7c9[_0xa2af('0x22')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);_0x1ff7c9['agents'][_0x1ff7c9['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xfb')]][_0xa2af('0xf9')]=![];delete _0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]];unlockQueueStatus(_0x431313);});}else{this['updateOriginated'](this[_0xa2af('0x22')][this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);hopperUtils[_0xa2af('0xdc')]({'active':![],'ContactId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xdf')],'ListId':this['actions'][_0x2dec0a['actionid']][_0xa2af('0xe0')],'VoiceQueueId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe1')]||undefined,'CampaignId':this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe2')]||undefined})['catch'](loggerCatch(_0xa2af('0x100')));delete this[_0xa2af('0x28')][_0x2dec0a['actionid']];unlockQueueStatus(_0x431313);}}else if(_0x1a10d9===_0xa2af('0xf6')){var _0x550fa0;if(this['actions'][_0x2dec0a[_0xa2af('0xf4')]]&&!_['isEmpty'](this[_0xa2af('0x2f')][this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]])){if(this[_0xa2af('0x101')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]]['queue']]){this[_0xa2af('0x101')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]=this[_0xa2af('0x101')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]?this['queueBookedRR'][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]:this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x2dec0a['actionid']]['queue']]?this[_0xa2af('0x2f')][this['actions'][_0x2dec0a['actionid']][_0xa2af('0xc3')]][_0xa2af('0x102')]||0x0:0x0;}this[_0xa2af('0x2f')][this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]][_0xa2af('0x102')]=this[_0xa2af('0x101')][this[_0xa2af('0x28')][_0x2dec0a['actionid']]['queue']];for(var _0x2e7008=0x0;_0x2e7008<this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xc3')]]['length'];_0x2e7008+=0x1){_0x550fa0=rr(this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);this[_0xa2af('0x101')][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a['actionid']]['queue']]=this[_0xa2af('0x2f')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]][_0xa2af('0x102')];if(_0x550fa0[_0xa2af('0x8d')]==='1'&&_0x550fa0[_0xa2af('0xfa')]==='0'){break;}}if(!_[_0xa2af('0xf8')](_0x550fa0)){this[_0xa2af('0x24')][_0x550fa0['stateinterface']]['unlockRR']=_['isUndefined'](this[_0xa2af('0x24')][_0x550fa0['stateinterface']][_0xa2af('0x103')])?!![]:this[_0xa2af('0x24')][_0x550fa0[_0xa2af('0xfb')]][_0xa2af('0x103')];}loggerBooked[_0xa2af('0x4f')](_0xa2af('0x104'),_0x2dec0a[_0xa2af('0xf4')],_0xa2af('0x105'),JSON[_0xa2af('0x7b')](_[_0xa2af('0xfc')](this['agents'][_0x550fa0[_0xa2af('0xfb')]],[_0xa2af('0x4c'),_0xa2af('0x103')])),_0xa2af('0x106'),JSON[_0xa2af('0x7b')](_0x550fa0[_0xa2af('0xfd')]));if(!_[_0xa2af('0xf8')](_0x550fa0)&&_0x550fa0[_0xa2af('0x8d')]==='1'&&_0x550fa0['paused']==='0'&&this[_0xa2af('0x24')][_0x550fa0[_0xa2af('0xfb')]]['unlockRR']){this[_0xa2af('0x24')][_0x550fa0[_0xa2af('0xfb')]][_0xa2af('0x103')]=![];this['queueBooked'][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a['actionid']]['queue']]=[];this['preview'][_0xa2af('0xfe')](_0x550fa0[_0xa2af('0xfd')],_0x550fa0[_0xa2af('0xfb')])['catch'](function(_0x190e55){logger[_0xa2af('0x6b')](_0xa2af('0xff'),util[_0xa2af('0x49')](_0x190e55,{'showHidden':![],'depth':null}));})[_0xa2af('0x1f')](function(){_0x1ff7c9[_0xa2af('0xd1')](_0x1ff7c9['voiceQueues'][_0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);setTimeout(function(){_0x1ff7c9[_0xa2af('0x24')][_0x550fa0[_0xa2af('0xfb')]][_0xa2af('0x103')]=!![];loggerBooked[_0xa2af('0x4f')]('[booked][RR][finaly]',_0x2dec0a[_0xa2af('0xf4')],_0xa2af('0x105'),JSON[_0xa2af('0x7b')](_['pick'](_0x1ff7c9[_0xa2af('0x24')][_0x550fa0[_0xa2af('0xfb')]],['name',_0xa2af('0x103')])),'contactAgent-idHopper:\x20',JSON[_0xa2af('0x7b')](_0x550fa0[_0xa2af('0xfd')]));},0xc7);delete _0x1ff7c9[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]];unlockQueueStatus(_0x431313,_0x2dec0a[_0xa2af('0xf4')]);});}else{loggerBooked[_0xa2af('0x4f')](_0xa2af('0x107'));this[_0xa2af('0xd1')](this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xc3')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xdf')],'ListId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe0')],'VoiceQueueId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe1')]||undefined,'CampaignId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x2dec0a[_0xa2af('0xf4')]];unlockQueueStatus(_0x431313);}}else{loggerBooked['info']('[booked][unlock2]');this[_0xa2af('0xd1')](this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xdf')],'ListId':this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xe0')],'VoiceQueueId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x108')));delete this[_0xa2af('0x28')][_0x2dec0a['actionid']];unlockQueueStatus(_0x431313);}}else{loggerBooked['info'](_0xa2af('0x109'));this[_0xa2af('0xd1')](this[_0xa2af('0x22')][this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xc3')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xdf')],'ListId':this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xe0')],'VoiceQueueId':this[_0xa2af('0x28')][_0x2dec0a['actionid']][_0xa2af('0xe1')]||undefined,'CampaignId':this[_0xa2af('0x28')][_0x2dec0a[_0xa2af('0xf4')]][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x10a')));delete this[_0xa2af('0x28')][_0x2dec0a['actionid']];unlockQueueStatus(_0x431313);}};Dialer[_0xa2af('0x89')][_0xa2af('0x35')]=function(_0x21d62b){var _0x3ac090=this[_0xa2af('0x28')][_0x21d62b['actionid']];if(_0x3ac090){delete this[_0xa2af('0x28')][_0x21d62b[_0xa2af('0xf4')]];_0x3ac090['responsetime']=moment()[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x302db9=_0x3ac090[_0xa2af('0x46')]==='ivr'?this['campaigns'][_0x3ac090[_0xa2af('0xc3')]]:this[_0xa2af('0x22')][_0x3ac090['getQueue']()];if(_0x21d62b[_0xa2af('0x10b')]!==_0xa2af('0x10c')){this[_0xa2af('0xd1')](_0x302db9);return this['callProgressDetecting'](_0x3ac090,_0x302db9,_0x21d62b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x10d')));}this['uniqueId'][_0x21d62b[_0xa2af('0xc4')]]=_0x3ac090;}};Dialer[_0xa2af('0x89')][_0xa2af('0x10e')]=function(_0x52a41e){var _0x1a1475=this;var _0x2b454c=this[_0xa2af('0x2a')][_0x52a41e[_0xa2af('0xc4')]];var _0x28a760;if(!_[_0xa2af('0xf8')](_0x52a41e)&&!_[_0xa2af('0xf8')](_0x52a41e[_0xa2af('0x10f')])&&!_['isNil'](_0x52a41e['variable'][_0xa2af('0x110')])&&_0x52a41e[_0xa2af('0x111')]===_0xa2af('0x112')&&_0x2b454c){if(_0x2b454c[_0xa2af('0x46')]!==_0xa2af('0xc5')&&this[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0x113')]&&_0x52a41e['value']==='HANGUP'){delete this[_0xa2af('0x2a')][_0x52a41e[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]]);this[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0xc8')]+=0x1;this[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x28a760=new Hangup(_0x2b454c,_0x52a41e);_0x28a760['state']=0x12;_0x28a760[_0xa2af('0x76')]=_0xa2af('0x114');_0x28a760[_0xa2af('0x115')]=_0xa2af('0x116');ami[_0xa2af('0x45')]('custom:amd',ut['buildObj'](_0x28a760,_0xa2af('0x117')));this[_0xa2af('0x118')](_0x28a760,_0xa2af('0x119'),_0xa2af('0x11a'));}if(_0x2b454c[_0xa2af('0x46')]!==_0xa2af('0xc5')&&this[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]]['dialAMDActive']&&_0x52a41e[_0xa2af('0x11b')]===_0xa2af('0x11c')){return new Promise(function(_0x52029f,_0x46adb1){delete _0x1a1475[_0xa2af('0x2a')][_0x52a41e[_0xa2af('0xc4')]];_0x1a1475['updateOriginated'](_0x1a1475[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]]);_0x1a1475['voiceQueues'][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0xc8')]+=0x1;_0x1a1475[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0x11d')]+=0x1;var _0xe1aa1d=_0x1a1475[_0xa2af('0x22')][_0x2b454c[_0xa2af('0xc3')]];var _0x24e4e6=new Hangup(_0x2b454c,_0x52a41e);_0x24e4e6[_0xa2af('0x75')]=0x13;_0x24e4e6['statedesc']=_0xa2af('0x11e');_0x24e4e6['membername']=_0xa2af('0x116');_0x24e4e6['countmachineretry']+=0x1;_0x24e4e6[_0xa2af('0xd5')]+=0x1;_0x24e4e6[_0xa2af('0x117')]=!![];ami[_0xa2af('0x45')](_0xa2af('0x11f'),ut[_0xa2af('0x120')](_0x24e4e6,'amd'));hopperUtils['createHistory'](_0x24e4e6)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x121')));if(_0x24e4e6[_0xa2af('0x122')]+_0x24e4e6[_0xa2af('0x123')]+_0x24e4e6['countnoanswerretry']+_0x24e4e6[_0xa2af('0x124')]+_0x24e4e6['countdropretry']+_0x24e4e6['countabandonedretry']+_0x24e4e6[_0xa2af('0x125')]+_0x24e4e6[_0xa2af('0x126')]>=_0xe1aa1d[_0xa2af('0x127')]){_0x1a1475[_0xa2af('0x128')](_0x24e4e6,_0x52029f,_0x46adb1,_0xa2af('0x129'));}else{if(_0x24e4e6['countmachineretry']>=_0xe1aa1d[_0xa2af('0x12a')]){_0x1a1475[_0xa2af('0x12b')](_0x24e4e6,_0x52029f,_0x46adb1,_0xa2af('0x12c'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x24e4e6[_0xa2af('0x125')],'scheduledat':moment()[_0xa2af('0xde')](_0xe1aa1d[_0xa2af('0x12d')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x24e4e6[_0xa2af('0xdf')],'ListId':_0x24e4e6[_0xa2af('0xe0')],'VoiceQueueId':_0x24e4e6['VoiceQueueId']||undefined,'CampaignId':_0x24e4e6[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x52029f({'reschedule':0x1});}}});}if(_0x2b454c[_0xa2af('0x46')]===_0xa2af('0xc5')&&this[_0xa2af('0x23')][_0x2b454c['queue']][_0xa2af('0x113')]&&_0x52a41e[_0xa2af('0x11b')]===_0xa2af('0x12e')){delete this[_0xa2af('0x2a')][_0x52a41e[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this['campaigns'][_0x2b454c[_0xa2af('0xc3')]]);_0x28a760=new Hangup(_0x2b454c,_0x52a41e);_0x28a760[_0xa2af('0x75')]=0x12;_0x28a760[_0xa2af('0x76')]=_0xa2af('0x114');_0x28a760[_0xa2af('0x115')]=_0xa2af('0x116');ami[_0xa2af('0x45')](_0xa2af('0x11f'),ut[_0xa2af('0x120')](_0x28a760,'amd'));this[_0xa2af('0x118')](_0x28a760,'[syncHangupInAMDIvr][createHistory]',_0xa2af('0x12f'));}if(_0x2b454c[_0xa2af('0x46')]===_0xa2af('0xc5')&&this[_0xa2af('0x23')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0x113')]&&_0x52a41e[_0xa2af('0x11b')]===_0xa2af('0x11c')){return new Promise(function(_0x54644c,_0x309290){delete _0x1a1475[_0xa2af('0x2a')][_0x52a41e['uniqueid']];_0x1a1475['updateOriginated'](_0x1a1475['campaigns'][_0x2b454c[_0xa2af('0xc3')]]);_0x1a1475[_0xa2af('0x23')][_0x2b454c[_0xa2af('0xc3')]]['outboundAnswerCallsDay']+=0x1;_0x1a1475[_0xa2af('0x23')][_0x2b454c[_0xa2af('0xc3')]][_0xa2af('0x11d')]+=0x1;var _0x23ad41=_0x1a1475['campaigns'][_0x2b454c[_0xa2af('0xc3')]];var _0x3762e9=new Hangup(_0x2b454c,_0x52a41e);_0x3762e9[_0xa2af('0x75')]=0x13;_0x3762e9[_0xa2af('0x76')]=_0xa2af('0x11e');_0x3762e9[_0xa2af('0x115')]=_0xa2af('0x116');_0x3762e9['countmachineretry']+=0x1;_0x3762e9['countglobal']+=0x1;_0x3762e9['amd']=!![];ami[_0xa2af('0x45')]('custom:amd',ut['buildObj'](_0x3762e9,_0xa2af('0x117')));hopperUtils[_0xa2af('0xcd')](_0x3762e9)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x121')));if(_0x3762e9['countbusyretry']+_0x3762e9['countcongestionretry']+_0x3762e9[_0xa2af('0x130')]+_0x3762e9[_0xa2af('0x124')]+_0x3762e9[_0xa2af('0xdd')]+_0x3762e9[_0xa2af('0xeb')]+_0x3762e9['countmachineretry']+_0x3762e9['countagentrejectretry']>=_0x23ad41[_0xa2af('0x127')]){_0x1a1475[_0xa2af('0x128')](_0x3762e9,_0x54644c,_0x309290,_0xa2af('0x129'));}else{if(_0x3762e9['countmachineretry']>=_0x23ad41['dialMachineMaxRetry']){_0x1a1475['createStateFinal'](_0x3762e9,_0x54644c,_0x309290,_0xa2af('0x12c'));}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countmachineretry':_0x3762e9[_0xa2af('0x125')],'scheduledat':moment()[_0xa2af('0xde')](_0x23ad41['dialMachineRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x3762e9['ContactId'],'ListId':_0x3762e9[_0xa2af('0xe0')],'VoiceQueueId':_0x3762e9[_0xa2af('0xe1')]||undefined,'CampaignId':_0x3762e9['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x131')));_0x54644c({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xa2af('0x3a')]=function(_0x4002b7){var _0x3d6518=this[_0xa2af('0x2a')][_0x4002b7[_0xa2af('0xc4')]];var _0x16f4be;if(_0x3d6518&&_0x3d6518['type']==='ivr'){delete this[_0xa2af('0x2a')][_0x4002b7[_0xa2af('0xc4')]];this[_0xa2af('0xd1')](this[_0xa2af('0x23')][_0x3d6518[_0xa2af('0xc3')]]);this[_0xa2af('0x23')][_0x3d6518[_0xa2af('0xc3')]][_0xa2af('0x132')]+=0x1;_0x16f4be=new Hangup(_0x3d6518,_0x4002b7);hopperUtils[_0xa2af('0xcd')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x133')));hopperUtils['moveContactManagedDialer'](_0x16f4be)['catch'](loggerCatch(_0xa2af('0x134')));}if(_0x3d6518&&_0x3d6518[_0xa2af('0x46')]!==_0xa2af('0xc5')&&isNotNull(this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]['dialQueueProject'])){delete this['uniqueId'][_0x4002b7[_0xa2af('0xc4')]];this['updateOriginated'](this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]);this[_0xa2af('0x22')][_0x3d6518['queue']][_0xa2af('0xc8')]+=0x1;this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]][_0xa2af('0x11d')]+=0x1;_0x16f4be=new Hangup(_0x3d6518,_0x4002b7);_0x16f4be[_0xa2af('0x75')]=0x10;_0x16f4be['statedesc']=_0xa2af('0x135');_0x16f4be[_0xa2af('0x115')]=_0xa2af('0x136');hopperUtils[_0xa2af('0xcd')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa2af('0xcf')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x3d6518&&_0x3d6518[_0xa2af('0x46')]!==_0xa2af('0xc5')&&!isNotNull(this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]['dialQueueProject'])){delete this[_0xa2af('0x2a')][_0x4002b7[_0xa2af('0xc4')]];this['updateOriginated'](this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]]);this[_0xa2af('0x22')][_0x3d6518[_0xa2af('0xc3')]][_0xa2af('0x137')]+=0x1;_0x16f4be=new Hangup(_0x3d6518,_0x4002b7);_0x16f4be[_0xa2af('0x75')]=0xc;_0x16f4be[_0xa2af('0x76')]=_0x4002b7[_0xa2af('0x138')];_0x16f4be[_0xa2af('0x115')]=_0xa2af('0x139');hopperUtils[_0xa2af('0xcd')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa2af('0xcf')](_0x16f4be)[_0xa2af('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xa2af('0x89')][_0xa2af('0xd')]=function(_0x3cac3b){var _0x30c21f=this;if(!_0x30c21f['queuesSummary'][_0x3cac3b[_0xa2af('0x4c')]]){_0x30c21f['queuesSummary'][_0x3cac3b[_0xa2af('0x4c')]]={'running':![]};}else if(_0x30c21f[_0xa2af('0x30')][_0x3cac3b[_0xa2af('0x4c')]][_0xa2af('0x13a')]===!![]){return;}else if(_0x30c21f['queuesSummary'][_0x3cac3b['name']][_0xa2af('0x13a')]===![]){_0x30c21f[_0xa2af('0x30')][_0x3cac3b[_0xa2af('0x4c')]][_0xa2af('0x13a')]=!![];}var _0x56f107=_0x30c21f[_0xa2af('0x22')][_0x3cac3b[_0xa2af('0x4c')]];var _0x1b3443=_0x56f107[_0xa2af('0x6f')]!==utils[_0xa2af('0x70')][_0xa2af('0x81')];var _0x294898=utils['isPreviewCampaign'](_0x56f107);_0x56f107[_0xa2af('0x13b')]=utils['getQueueCampaignStatusMessage'](_0x56f107,_0x30c21f[_0xa2af('0x25')]);Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](function(){if(_0x56f107[_0xa2af('0x13b')]===utils[_0xa2af('0x70')][_0xa2af('0x81')]){if(_0x1b3443){clearPredictiveAttributes(_0x56f107);_0x3cac3b[_0xa2af('0x2c')]=undefined;_0x3cac3b[_0xa2af('0x2d')]=undefined;}if(_0x56f107['statusMessage']===utils[_0xa2af('0x70')]['INACTIVE']){_0x3cac3b[_0xa2af('0x13c')]=0x0;_0x3cac3b[_0xa2af('0xfa')]=0x0;_0x3cac3b[_0xa2af('0x13d')]=0x0;_0x3cac3b[_0xa2af('0x13e')]=0x0;_0x3cac3b[_0xa2af('0x13f')]=0x0;}}else if(_0x56f107[_0xa2af('0x13b')]===utils['CAMPAIGN_STATUS'][_0xa2af('0x140')]&&!_0x294898){return _0x30c21f[_0xa2af('0x94')](_0x56f107,!![])['then'](function(){return _0x30c21f[_0xa2af('0x94')](_0x56f107,![]);})[_0xa2af('0x42')](function(){return _0x30c21f['checkDialMethod'](_0x56f107);})[_0xa2af('0xa1')](function(_0x367ef1){loggerSyncQueueSummary[_0xa2af('0x67')](_0xa2af('0x141'),util[_0xa2af('0x49')](_0x367ef1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x56f107);});}else{clearPredictiveAttributes(_0x56f107);}})[_0xa2af('0x42')](function(){var _0x2e468d=_0x3cac3b['compareToOutboundQueue'](_0x56f107);if(_0x2e468d||_0x56f107[_0xa2af('0x142')]){_0x56f107[_0xa2af('0x142')]=![];_0x3cac3b[_0xa2af('0x143')](_0x56f107);Object[_0xa2af('0x144')](_0x56f107,_0x3cac3b);emitOutboundVoiceQueueSummary(_0x3cac3b);}_0x30c21f['queuesSummary'][_0x56f107[_0xa2af('0x4c')]][_0xa2af('0x13a')]=![];})[_0xa2af('0xa1')](function(_0x4ae32f){logger[_0xa2af('0x6b')](_0xa2af('0x141'),util[_0xa2af('0x49')](_0x4ae32f,{'showHidden':![],'depth':null}));_0x30c21f[_0xa2af('0x30')][_0x56f107[_0xa2af('0x4c')]][_0xa2af('0x13a')]=![];});};Dialer['prototype'][_0xa2af('0x38')]=_[_0xa2af('0x145')](function(){var _0x122f69=_['filter'](this['voiceQueues'],function(_0x42ce38){return _0x42ce38[_0xa2af('0x146')];});var _0xde4392=_[_0xa2af('0x147')](this['agents'],function(_0x2430ec){return _0x2430ec[_0xa2af('0x148')]&&_0x2430ec[_0xa2af('0x8d')]===_0xa2af('0x8e');});if(_0x122f69[_0xa2af('0x149')]>0x0&&_0xde4392['length']>0x0){return Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](cmHopper[_0xa2af('0x14a')](_[_0xa2af('0x14b')](_0x122f69,'id'),previewRecallmeReminderInterval,_['map'](_0xde4392,'id')))[_0xa2af('0x42')](function(_0x8a6404){for(var _0x718ac9=0x0;_0x718ac9<_0x8a6404[_0xa2af('0x149')];_0x718ac9++){var _0x30674f=_0x8a6404[_0x718ac9][_0xa2af('0x14c')]['name'];if(_0x30674f)io['to'](util[_0xa2af('0x4a')](_0xa2af('0x14d'),_0x30674f))[_0xa2af('0x45')](_0xa2af('0x14e'),{'hopper':_0x8a6404[_0x718ac9]});}})[_0xa2af('0xa1')](function(_0x5a5ea5){logger[_0xa2af('0x6b')](_0xa2af('0x14f'),_0x5a5ea5);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa2af('0x89')][_0xa2af('0x41')]=function(){var _0x41ff13=this;setInterval(function(){_0x41ff13[_0xa2af('0x150')](_0x41ff13[_0xa2af('0x2a')],_0xa2af('0x151'));_0x41ff13[_0xa2af('0x150')](_0x41ff13[_0xa2af('0x28')],'[actions]');},0x32c8);};Dialer[_0xa2af('0x89')][_0xa2af('0x150')]=function(_0xb2c119,_0x2491f2){var _0x3b311e=this;for(var _0x5dc608 in _0xb2c119){if(typeof _0xb2c119[_0x5dc608]!=='undefined'){this[_0xa2af('0x20')][_0xa2af('0x1d')](function(){if(!_['isNil'](_0xb2c119[_0x5dc608])){return ami['Action']({'action':'status','channel':_0xb2c119[_0x5dc608]['channel']})[_0xa2af('0xa1')](function(_0xa16990){if(_0xa16990[_0xa2af('0x6f')]===_0xa2af('0x152')){setTimeout(function(){if(_0xb2c119[_0x5dc608]&&_0xb2c119[_0x5dc608]['type']!=='ivr'){_0x3b311e['updateOriginated'](_0x3b311e['voiceQueues'][_0xb2c119[_0x5dc608][_0xa2af('0xc3')]]);logger[_0xa2af('0x6b')](_0xa2af('0x153'),_0x2491f2,_0x5dc608,_0xb2c119[_0x5dc608]['queue']);delete _0xb2c119[_0x5dc608];}if(_0xb2c119[_0x5dc608]&&_0xb2c119[_0x5dc608][_0xa2af('0x46')]==='ivr'){_0x3b311e[_0xa2af('0xd1')](_0x3b311e[_0xa2af('0x23')][_0xb2c119[_0x5dc608][_0xa2af('0xc3')]]);logger['error'](_0xa2af('0x154'),_0x2491f2,_0x5dc608,_0xb2c119[_0x5dc608]['queue']);delete _0xb2c119[_0x5dc608];}},0x2328);}});}});}}};Dialer[_0xa2af('0x89')][_0xa2af('0x155')]=function(_0x287d14){return Promise[_0xa2af('0xaf')]()[_0xa2af('0x42')](voiceQueueRt[_0xa2af('0x155')](_0x287d14))[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x156')));};Dialer[_0xa2af('0x89')][_0xa2af('0xd1')]=function(_0xfada28){if(!_['isUndefined'](_0xfada28)&&_0xfada28!==null){if(typeof _0xfada28[_0xa2af('0x157')]!=='undefined'){if(_0xfada28[_0xa2af('0x157')]>0x0){_0xfada28[_0xa2af('0x157')]-=0x1;}else{logger[_0xa2af('0x6b')](_0xa2af('0x158'));}}}else{logger['error'](_0xa2af('0x159'));}};Dialer[_0xa2af('0x89')][_0xa2af('0x15a')]=function(_0x56e81c,_0x4d19d4){var _0x260b87=this;return function(_0x71e276){_0x260b87['updateOriginated'](_0x4d19d4);logger[_0xa2af('0x6b')](_0x56e81c,util[_0xa2af('0x49')](_0x71e276,{'showHidden':![],'depth':null}));};};Dialer[_0xa2af('0x89')][_0xa2af('0x15b')]=function(_0x3b20d5,_0x2cfc10,_0x11a546){var _0x295d41={'state':0x19,'statedesc':_0xa2af('0x15c')};this[_0xa2af('0xd1')](_0x2cfc10);this[_0xa2af('0x118')](_[_0xa2af('0x65')](_0x295d41,_[_0xa2af('0xfc')](_0x11a546,[_0xa2af('0xdf'),'ListId',_0xa2af('0x15d'),_0xa2af('0xe1'),_0xa2af('0xe2')])),_0xa2af('0x15e'),_0xa2af('0x15f'));logger[_0xa2af('0x6b')](_0x3b20d5);};Dialer['prototype']['saveInDb']=function(_0x34fb0a,_0x38a529,_0x13d381){hopperUtils[_0xa2af('0xcd')](_0x34fb0a)['catch'](loggerCatch(_0x38a529));hopperUtils['moveContactManagedDialer'](_0x34fb0a)[_0xa2af('0xa1')](loggerCatch(_0x13d381));};Dialer[_0xa2af('0x89')]['queueCallerAbandonCreateState']=function(_0x197fcf,_0x5a1599){hopperUtils[_0xa2af('0xcd')](_0x197fcf)[_0xa2af('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x5a1599==0x0){hopperUtils['moveContactManagedDialer'](_0x197fcf)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xa2af('0x89')][_0xa2af('0x14f')]=function(_0x1d08cd){return Promise[_0xa2af('0xaf')]()['then'](cmHopper[_0xa2af('0x14a')](_0x1d08cd['id'],previewRecallmeReminderInterval))['then'](function(_0x398202){for(var _0xa7172b=0x0;_0xa7172b<_0x398202[_0xa2af('0x149')];_0xa7172b++){var _0x19e9bd=_0x398202[_0xa7172b][_0xa2af('0x14c')][_0xa2af('0x4c')];if(_0x19e9bd)io['to'](util[_0xa2af('0x4a')]('user:%s',_0x19e9bd))[_0xa2af('0x45')]('user:dialPreviewRecallReminder',{'hopper':_0x398202[_0xa7172b]});}})[_0xa2af('0xa1')](function(){});};Dialer[_0xa2af('0x89')][_0xa2af('0xb4')]=function(_0x8cfdcc){var _0x1d60d9=this;return function(){_0x1d60d9[_0xa2af('0x160')](_0x8cfdcc);};};Dialer[_0xa2af('0x89')][_0xa2af('0x161')]=function(_0x15ea32,_0x4efc30){var _0x1907cc=this;var _0x52fb08=uuid['v4']();this[_0xa2af('0x28')][_0x52fb08]=new Action(_0x15ea32,_0x4efc30,_0x52fb08);return new Promise(function(_0x12aaba,_0x5c3b5a){if(_[_0xa2af('0x44')](_0x15ea32)&&typeof _0x15ea32!=='object'){return _0x5c3b5a(msgResponse(_0xa2af('0x162'),_0xa2af('0x95'),_0xa2af('0x163')));}if(_[_0xa2af('0x44')](_0x4efc30['phone'])||_0x4efc30[_0xa2af('0x164')]===null){return _0x5c3b5a(msgResponse(_0xa2af('0x162'),'Failure',_0xa2af('0x165')));}var _0x311771={'XMD-CALLERID':_0x1907cc['actions'][_0x52fb08][_0xa2af('0x166')](),'XMD-AGI':_0x15ea32[_0xa2af('0x167')]?util[_0xa2af('0x4a')](_0xa2af('0x168'),ipAgi,_0x15ea32[_0xa2af('0x167')]):'NONE','XMD-AGIAFTER':_0x15ea32[_0xa2af('0xcc')]?util[_0xa2af('0x4a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x15ea32[_0xa2af('0xcc')]):'NONE','XMD-QUEUE':utils[_0xa2af('0x169')](_0x15ea32)?util[_0xa2af('0x4a')](_0xa2af('0x16a'),_0x15ea32['name'],_0x15ea32[_0xa2af('0x16b')]||'',_0x15ea32[_0xa2af('0x16c')]?'c':'',_0x15ea32[_0xa2af('0x16d')]||0x3):_0xa2af('0x16e'),'XMD-CONTACTID':_0x4efc30[_0xa2af('0xdf')],'XMD-CDRTYPE':_0xa2af('0x9'),'CALLERID(all)':_0x1907cc[_0xa2af('0x28')][_0x52fb08][_0xa2af('0x166')](),'XMD-AMD':_0x15ea32['dialAMDActive']?_0xa2af('0x140'):_0xa2af('0x16e'),'XMD-DESTINATION':_0xa2af('0x112')};if(_0x15ea32[_0xa2af('0x113')]){_0x311771[_0xa2af('0x16f')]=_0x15ea32[_0xa2af('0x170')]||0x9c4;_0x311771[_0xa2af('0x171')]=_0x15ea32[_0xa2af('0x172')]||0x5dc;_0x311771['XMD-AMDAFTERGREETINGSILENCE']=_0x15ea32['dialAMDAfterGreetingSilence']||0x320;_0x311771[_0xa2af('0x173')]=_0x15ea32[_0xa2af('0x174')]||0x1388;_0x311771['XMD-AMDMINWORDLENGTH']=_0x15ea32[_0xa2af('0x175')]||0x64;_0x311771['XMD-AMDBETWEENWORDSSILENCE']=_0x15ea32[_0xa2af('0x176')]||0x32;_0x311771[_0xa2af('0x177')]=_0x15ea32[_0xa2af('0x178')]||0x3;_0x311771['XMD-AMDSILENCETHRESHOLD']=_0x15ea32[_0xa2af('0x179')]||0x100;_0x311771['XMD-AMDMAXIMUMWORDLENGTH']=_0x15ea32[_0xa2af('0x17a')]||0x1388;}if(utils['isOutboundQueue'](_0x15ea32)){_0x311771['XMD-VOICEQUEUEID']=_0x4efc30['VoiceQueueId'];}else{_0x311771[_0xa2af('0x17b')]=_0x4efc30['CampaignId'];}var _0x515cd9=utils[_0xa2af('0x17c')](_0x4efc30[_0xa2af('0x17d')]);Object['assign'](_0x311771,_0x515cd9);var _0x1d6055=_0x1907cc[_0xa2af('0x8a')](_0x15ea32[_0xa2af('0x17e')])?utils[_0xa2af('0x17f')](_0x15ea32[_0xa2af('0x17e')]['callerid'],_0x15ea32[_0xa2af('0x180')],_0x15ea32[_0xa2af('0x181')]>0x0?utils[_0xa2af('0x182')](_0x15ea32[_0xa2af('0x183')],_0x15ea32[_0xa2af('0x181')]):_0x15ea32[_0xa2af('0x183')]):utils['getCallerId'](_[_0xa2af('0xf8')](_0x15ea32['TrunkBackup'])?_0x15ea32[_0xa2af('0x17e')][_0xa2af('0x184')]:_0x15ea32[_0xa2af('0x185')]['callerid'],_0x15ea32[_0xa2af('0x180')],_0x15ea32['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xa2af('0x182')](_0x15ea32[_0xa2af('0x183')],_0x15ea32[_0xa2af('0x181')]):_0x15ea32['dialOriginateCallerIdNumber']);if(_0x1d6055){_0x311771[_0xa2af('0x186')]=_0x1907cc[_0xa2af('0x28')][_0x52fb08][_0xa2af('0x187')]=utils[_0xa2af('0x188')](_0x1d6055);_0x311771[_0xa2af('0x189')]=_0x4efc30[_0xa2af('0x164')];}_0x15ea32[_0xa2af('0x18a')]=_0x311771;return ami['Action']({'actionid':_0x52fb08,'action':'originate','channel':_0x1907cc['isTrunkReachable'](_0x15ea32[_0xa2af('0x17e')])?util[_0xa2af('0x4a')](_0xa2af('0x18b'),_0x15ea32[_0xa2af('0x17e')]['name'],isNotNull(_0x15ea32['dialPrefix'])?_0x15ea32[_0xa2af('0x18c')][_0xa2af('0x18d')]()||'':'',_0x15ea32['dialCutDigit']>0x0?_0x4efc30[_0xa2af('0x164')][_0xa2af('0x18e')](_0x15ea32[_0xa2af('0x18f')]):_0x4efc30[_0xa2af('0x164')]):util[_0xa2af('0x4a')](_0xa2af('0x18b'),_[_0xa2af('0xf8')](_0x15ea32['TrunkBackup'])?_0x15ea32['Trunk']['name']:_0x15ea32[_0xa2af('0x185')][_0xa2af('0x4c')],isNotNull(_0x15ea32[_0xa2af('0x18c')])?_0x15ea32[_0xa2af('0x18c')][_0xa2af('0x18d')]()||'':'',_0x15ea32[_0xa2af('0x18f')]>0x0?_0x4efc30[_0xa2af('0x164')]['substring'](_0x15ea32[_0xa2af('0x18f')]):_0x4efc30[_0xa2af('0x164')]),'callerid':_0x1d6055,'Exten':_0xa2af('0x112'),'Context':_0xa2af('0x190'),'Priority':'1','variable':_0x311771,'timeout':(_0x15ea32[_0xa2af('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52fb08})[_0xa2af('0x42')](function(_0xfb86f1){return _0x12aaba(_0xfb86f1);})[_0xa2af('0xa1')](function(_0xf82531){_0x15ea32['outboundOriginateFailureCallsDay']+=0x1;var _0x45efc0=new History(_0x1907cc[_0xa2af('0x28')][_0x52fb08]);logger['error'](util[_0xa2af('0x4a')](_0xa2af('0x192'),JSON['stringify'](_0xf82531)));_0x45efc0[_0xa2af('0x75')]=0xe;_0x45efc0[_0xa2af('0x76')]=_0xa2af('0x193');_0x45efc0['starttime']=moment()['format'](_0xa2af('0xc7'));_0x45efc0['endtime']=_0x45efc0[_0xa2af('0xe4')];hopperUtils[_0xa2af('0xcd')](_0x45efc0)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x194')));_0x1907cc[_0xa2af('0xcf')](_0x45efc0)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x194')))[_0xa2af('0x1f')](function(){delete _0x1907cc[_0xa2af('0x28')][_0x52fb08];return _0x5c3b5a(msgResponse('originate',_0xa2af('0x88'),_0xa2af('0x195')));});});});};Dialer[_0xa2af('0x89')][_0xa2af('0x196')]=function(_0x12feb6,_0x446a99,_0x2608a1){var _0x54139c=new History(_0x446a99);if(_0x54139c[_0xa2af('0x122')]+_0x54139c['countcongestionretry']+_0x54139c[_0xa2af('0x130')]+_0x54139c[_0xa2af('0x124')]+_0x54139c[_0xa2af('0xdd')]+_0x54139c[_0xa2af('0xeb')]+_0x54139c['countmachineretry']+_0x54139c[_0xa2af('0x126')]>=_0x2608a1['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x12feb6){case 0x3:if(_0x54139c['countnoanswerretry']>=_0x2608a1[_0xa2af('0x197')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countnoanswerretry':_0x54139c[_0xa2af('0x130')]+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1[_0xa2af('0x198')],_0xa2af('0xee'))['format'](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x199')));break;case 0x5:if(_0x54139c[_0xa2af('0x122')]>=_0x2608a1[_0xa2af('0x19a')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countbusyretry':_0x54139c['countbusyretry']+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1['dialBusyRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c['VoiceQueueId']||undefined,'CampaignId':_0x54139c['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x54139c['countcongestionretry']>=_0x2608a1[_0xa2af('0x19b')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countcongestionretry':_0x54139c[_0xa2af('0x123')]+=0x1,'scheduledat':moment()['add'](_0x2608a1[_0xa2af('0x19c')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c['ListId'],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x19d')));break;case 0x0:if(_0x54139c['countnosuchnumberretry']>=_0x2608a1[_0xa2af('0x19e')]-0x1){return!![];}else{hopperUtils[_0xa2af('0xdc')]({'active':![],'countnosuchnumberretry':_0x54139c[_0xa2af('0x124')]+=0x1,'scheduledat':moment()['add'](_0x2608a1[_0xa2af('0x19f')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c['ContactId'],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})['catch'](loggerCatch(_0xa2af('0x1a0')));}break;case 0xa:if(_0x54139c[_0xa2af('0xdd')]>=_0x2608a1[_0xa2af('0xda')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countdropretry':_0x54139c['countdropretry']+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1[_0xa2af('0xd6')],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c['CampaignId']||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xe3')));break;case 0xb:if(_0x54139c[_0xa2af('0xeb')]>=_0x2608a1['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countabandonedretry':_0x54139c[_0xa2af('0xeb')]+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1[_0xa2af('0xec')],'minutes')[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c['ContactId'],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xef')));break;case 0x13:if(_0x54139c[_0xa2af('0x125')]>=_0x2608a1[_0xa2af('0x12a')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countmachineretry':_0x54139c[_0xa2af('0x125')]+=0x1,'scheduledat':moment()[_0xa2af('0xde')](_0x2608a1['dialMachineRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')](_0xa2af('0xc7')),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x131')));break;case 0x14:if(_0x54139c[_0xa2af('0x126')]>=_0x2608a1[_0xa2af('0x1a1')]-0x1){return!![];}hopperUtils[_0xa2af('0xdc')]({'active':![],'countagentrejectretry':_0x54139c['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x2608a1['dialAgentRejectRetryFrequency'],_0xa2af('0xee'))[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54139c[_0xa2af('0xdf')],'ListId':_0x54139c[_0xa2af('0xe0')],'VoiceQueueId':_0x54139c[_0xa2af('0xe1')]||undefined,'CampaignId':_0x54139c[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1a2')));break;default:return!![];}};Dialer[_0xa2af('0x89')][_0xa2af('0x1a3')]=function(_0x209d62,_0x38055a,_0x15272e){var _0x104c99=this;var _0x14103b=new History(_0x209d62);var _0x275924=![];var _0x4c2c88;var _0x5a86f2;return new Promise(function(_0x4d238e,_0x809153){if(_['isUndefined'](_0x38055a)&&typeof _0x38055a!==_0xa2af('0x1a4')){return _0x809153(msgResponse(_0xa2af('0x1a5'),_0xa2af('0x95'),_0xa2af('0x1a6')));}if(_['isUndefined'](_0x15272e)&&typeof _0x15272e!==_0xa2af('0x1a4')){return _0x809153(msgResponse(_0xa2af('0x1a5'),_0xa2af('0x95'),_0xa2af('0x1a7')));}hopperUtils[_0xa2af('0xd7')](_0x14103b,_0x15272e[_0xa2af('0xc9')],_0x38055a)['then'](function(_0x512185){if(_0x512185['additional']==0x1)_0x275924=!![];switch(_0x15272e['reason']){case'0':_0x38055a[_0xa2af('0x1a8')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x0;_0x14103b['statedesc']=_0xa2af('0x1a9');_0x14103b[_0xa2af('0x124')]+=0x1;_0x14103b[_0xa2af('0xd5')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0xa2af('0x120')](_0x209d62,_0xa2af('0x1aa')));_0x4c2c88=_0x38055a[_0xa2af('0x19f')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x121')));if(_0x104c99[_0xa2af('0x196')](0x0,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x124')]>=_0x38055a['dialNoSuchNumberMaxRetry']){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1ac'));}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1ac'));}}break;case'3':_0x38055a[_0xa2af('0x1ad')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x3;_0x14103b[_0xa2af('0x76')]=_0xa2af('0x1ae');_0x14103b[_0xa2af('0x130')]+=0x1;_0x14103b[_0xa2af('0xd5')]+=0x1;var _0x4a8601=ut[_0xa2af('0x1af')](_0x209d62,_0x38055a);ami[_0xa2af('0x45')](_0xa2af('0x1b0'),_0x4a8601);_0x4c2c88=_0x38055a['dialNoAnswerRetryFrequency'];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1b1')));if(_0x104c99[_0xa2af('0x196')](0x3,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x130')]>=_0x38055a['dialNoAnswerMaxRetry']){_0x104c99['createStateFinal'](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1b2'));}else{_0x104c99['stateGlobal'](_0x14103b,_0x4d238e,_0x809153,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x38055a[_0xa2af('0x1b3')]+=0x1;_0x14103b['state']=0x5;_0x14103b[_0xa2af('0x76')]='Busy';_0x14103b[_0xa2af('0x122')]+=0x1;_0x14103b['countglobal']+=0x1;ami[_0xa2af('0x45')](_0xa2af('0x1b4'),ut[_0xa2af('0x120')](_0x209d62,'busy'));_0x4c2c88=_0x38055a[_0xa2af('0x1b5')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)['catch'](loggerCatch(_0xa2af('0x1b6')));if(_0x104c99[_0xa2af('0x196')](0x5,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b['countbusyretry']>=_0x38055a[_0xa2af('0x19a')]){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1b7'));}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1b7'));}}break;case'8':_0x38055a[_0xa2af('0x1b8')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x8;_0x14103b['statedesc']=_0xa2af('0x1b9');_0x14103b[_0xa2af('0x123')]+=0x1;_0x14103b['countglobal']+=0x1;_0x4c2c88=_0x38055a[_0xa2af('0x19c')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];ami[_0xa2af('0x45')](_0xa2af('0x1ba'),ut[_0xa2af('0x120')](_0x209d62,_0xa2af('0x1bb')));hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1bc')));if(_0x104c99[_0xa2af('0x196')](0x8,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x123')]>=_0x38055a[_0xa2af('0x19b')]){_0x104c99['createStateFinal'](_0x14103b,_0x4d238e,_0x809153,'reason\x208\x20congestion');}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1bd'));}}break;case'11':_0x38055a[_0xa2af('0x1be')]+=0x1;_0x14103b[_0xa2af('0x75')]=0xb;_0x14103b[_0xa2af('0x76')]=_0xa2af('0xe8');_0x14103b[_0xa2af('0xeb')]+=0x1;_0x14103b['countglobal']+=0x1;_0x4c2c88=_0x38055a[_0xa2af('0xec')];_0x5a86f2=_0x38055a['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0xf1')));if(_0x104c99[_0xa2af('0x196')](0xb,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0xeb')]>=_0x38055a['dialAbandonedMaxRetry']){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1bf'));}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0xa2af('0x1bf'));}}break;case'20':_0x38055a[_0xa2af('0x1c0')]+=0x1;_0x14103b[_0xa2af('0x75')]=0x14;_0x14103b[_0xa2af('0x76')]=_0xa2af('0x1c1');_0x14103b[_0xa2af('0x126')]+=0x1;_0x14103b[_0xa2af('0xd5')]+=0x1;_0x4c2c88=_0x38055a['dialAgentRejectRetryFrequency'];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];ami[_0xa2af('0x45')](_0xa2af('0x1c2'),ut[_0xa2af('0x120')](_0x209d62,'agentreject'));hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1c3')));if(_0x104c99[_0xa2af('0x196')](0x14,_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b['countagentrejectretry']>=_0x38055a[_0xa2af('0x1a1')]){_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,'reason\x2020\x20agentreject');}else{_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,'reason\x2020\x20agentreject');}}break;default:_0x38055a['outboundUnknownCallsDay']+=0x1;_0x14103b[_0xa2af('0x75')]=0xc;_0x14103b['statedesc']=_0x15272e['reason'];_0x4c2c88=_0x38055a[_0xa2af('0x1c4')];_0x5a86f2=_0x38055a[_0xa2af('0x1ab')];hopperUtils[_0xa2af('0xcd')](_0x14103b)[_0xa2af('0xa1')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x104c99[_0xa2af('0x196')](_0x15272e['reason'],_0x209d62,_0x38055a)&&!_0x275924){if(_0x14103b[_0xa2af('0x122')]+_0x14103b[_0xa2af('0x123')]+_0x14103b[_0xa2af('0x130')]+_0x14103b['countnosuchnumberretry']+_0x14103b[_0xa2af('0xdd')]+_0x14103b[_0xa2af('0xeb')]+_0x14103b['countmachineretry']+_0x14103b[_0xa2af('0x126')]>=_0x38055a[_0xa2af('0x127')]){_0x104c99[_0xa2af('0x128')](_0x14103b,_0x4d238e,_0x809153,_0x15272e[_0xa2af('0xc9')]);}else{_0x104c99[_0xa2af('0x12b')](_0x14103b,_0x4d238e,_0x809153,_0x15272e['reason']);}}}})[_0xa2af('0x42')](function(){if(_0x275924){hopperUtils[_0xa2af('0xe7')](_0x14103b,_0x4c2c88,_0x5a86f2)['then'](function(){return _0x4d238e(0x1);});}});});};Dialer[_0xa2af('0x89')]['stateGlobal']=function(_0x1b3dc1,_0x2d13ad,_0x459dbe,_0x22b146){var _0x12deae=new Final(_0x1b3dc1);_0x12deae['state']=0xf;_0x12deae[_0xa2af('0x76')]='Global';this['createStateFinal'](_0x12deae,_0x2d13ad,_0x459dbe,_0x22b146);};Dialer[_0xa2af('0x89')][_0xa2af('0x12b')]=function(_0x5dc612,_0x31cf2d,_0x96609d,_0xf589c2){hopperUtils['moveContactManagedDialer'](_0x5dc612)['then'](function(){return _0x31cf2d(msgResponse(_0xa2af('0x1a5'),_0xa2af('0x10c'),_0xf589c2));})['catch'](function(){return _0x96609d(msgResponse('[moveContactManagedDialer][0]',_0xa2af('0x95'),_0xa2af('0x1c5')));});};Dialer['prototype'][_0xa2af('0xc')]=function(_0xae421a){var _0x41d06b=_0xae421a[_0xa2af('0x1c6')]/0x64;var _0x11c857=_0xae421a[_0xa2af('0xd3')]/(_0xae421a[_0xa2af('0xd3')]+_0xae421a['outboundAnswerCallsDay']);var _0x1db2d0=Math[_0xa2af('0x1c7')](_0xae421a['predictiveIntervalAvailable']*(_0xae421a[_0xa2af('0x1c8')]/0x64));var _0x51d030=Math['round'](_0xae421a['predictiveIntervalAvailable']*(_0xae421a[_0xa2af('0x1c9')]/0x64));var _0x23c942=_0xae421a['available']+_0xae421a[_0xa2af('0x13e')];var _0x235e63=Math['floor'](_0xae421a[_0xa2af('0x60')]*_0xae421a[_0xa2af('0x62')]*_0xae421a[_0xa2af('0x1ca')]*_0xae421a['predictiveIntervalMultiplicativeFactor']);if(_[_0xa2af('0x44')](_0xae421a['startProgressive'])){if(!_['isUndefined'](_0xae421a[_0xa2af('0x2c')])){_0xae421a[_0xa2af('0x2c')]=undefined;loggerPredictive[_0xa2af('0x6b')](_0xa2af('0x1cb'),_0xa2af('0x1cc'));}if(!_[_0xa2af('0x44')](_0xae421a['handlePredictive'])){loggerPredictive[_0xa2af('0x6b')](_0xa2af('0x1cb'),_0xa2af('0x1cd'));clearInterval(_0xae421a[_0xa2af('0x6a')]);_0xae421a['handlePredictive']=undefined;}_0xae421a[_0xa2af('0x2d')]=moment()['format'](_0xa2af('0xc7'));loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],_0xa2af('0x1ce'),_0xae421a['startProgressive']);this[_0xa2af('0xb8')](_0xae421a,0x1);}else if(ifInterval(_0xae421a[_0xa2af('0x1cf')],_0xae421a[_0xa2af('0x2d')])){this[_0xa2af('0xb8')](_0xae421a,0x1);loggerPredictiveCalls[_0xa2af('0x4f')](_0xa2af('0x1d0'),_0xae421a[_0xa2af('0x2d')],_0xae421a[_0xa2af('0x4c')]);_0xae421a[_0xa2af('0x60')]=0x0;_0xae421a[_0xa2af('0x1d1')]=0x0;}else if(_0x41d06b<_0x11c857&&_0xae421a[_0xa2af('0x1d2')]===_0xa2af('0x1d3')){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x1d4'),_0xa2af('0x1d5'),_0x11c857,'startProgressive',_0xae421a[_0xa2af('0x4c')]);}else if(_0x235e63<_0xae421a['predictiveIntervalErlangCallsDroppedCalls']&&_0xae421a['dialPredictiveOptimization']===_0xa2af('0x1d3')){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x1d6'),_0xa2af('0x1d7'),_0x235e63,_0xa2af('0x1d8'),_0xae421a['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0xae421a['name']);}else if(!ifInterval(_0xae421a['dialPredictiveInterval'],_0xae421a[_0xa2af('0x2d')])&&_[_0xa2af('0x44')](_0xae421a[_0xa2af('0x2c')])&&!_[_0xa2af('0x44')](_0xae421a['startProgressive'])){_0xae421a[_0xa2af('0x2c')]=moment()['format'](_0xa2af('0xc7'));loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],_0xa2af('0x1d9'),_0xae421a[_0xa2af('0x2c')]);hopperUtils[_0xa2af('0x1da')](_0xae421a[_0xa2af('0x1cf')])['then'](this[_0xa2af('0x1db')](_0xae421a))['then'](mergeDataErlangB(_0xae421a))[_0xa2af('0x42')](this[_0xa2af('0x1dc')](_0xae421a))[_0xa2af('0xa1')](loggerCatchPredictive(_0xa2af('0x1dd'),_0xae421a));}else if(!ifInterval(_0xae421a[_0xa2af('0x1cf')],_0xae421a[_0xa2af('0x2c')])){_0xae421a[_0xa2af('0x1d1')]=0x0;_0xae421a['startPredictive']=moment()[_0xa2af('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa2af('0x4f')](_0xae421a['name'],'recalculate\x20predictive\x20at',_0xae421a[_0xa2af('0x2c')]);clearInterval(_0xae421a[_0xa2af('0x6a')]);_0xae421a[_0xa2af('0x6a')]=undefined;hopperUtils[_0xa2af('0x1da')](_0xae421a[_0xa2af('0x1cf')])[_0xa2af('0x42')](this[_0xa2af('0x1db')](_0xae421a))[_0xa2af('0x42')](mergeDataErlangB(_0xae421a))['then'](this[_0xa2af('0x1dc')](_0xae421a))[_0xa2af('0xa1')](loggerCatchPredictive(_0xa2af('0x1de'),_0xae421a));}else if(_0xae421a[_0xa2af('0x1df')]&&_0x23c942<_0xae421a['predictiveIntervalAvailable']-_0x51d030){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],_0xa2af('0x1e0'),_0x23c942,_0xa2af('0x1e1'),_0xae421a[_0xa2af('0x1df')],'-',_0x51d030,'=',_0xae421a[_0xa2af('0x1df')]-_0x51d030,')');}else if(_0xae421a[_0xa2af('0x1df')]&&_0x23c942>_0xae421a[_0xa2af('0x1df')]+_0x1db2d0){clearPredictiveAttributes(_0xae421a);loggerPredictive[_0xa2af('0x4f')](_0xae421a[_0xa2af('0x4c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x23c942,_0xa2af('0x1e2'),_0xae421a['predictiveIntervalAvailable'],'+',_0x1db2d0,'=',_0xae421a[_0xa2af('0x1df')]+_0x1db2d0,')');}};Dialer[_0xa2af('0x89')]['getDataPredictive']=function(_0x32dd00){var _0x5b8f55=this;return function(_0x2ae781){return new Promise(function(_0x2ebe82,_0x27f0da){_[_0xa2af('0x65')](_0x32dd00,_0x2ae781[0x0]);if(checkGetDataPredictive(_0x2ae781[0x0])){var _0x1d7f21=_0x32dd00[_0xa2af('0x1df')]=_0x32dd00[_0xa2af('0x13e')]+_0x32dd00[_0xa2af('0x13c')];var _0x5abc57=_0x32dd00[_0xa2af('0x1cf')]*0x3c;var _0x1fa75e=_0x2ae781[0x0][_0xa2af('0x1e3')]+_0x2ae781[0x0]['predictiveIntervalAvgHoldtime'];var _0x27180f=(_0x2ae781[0x0][_0xa2af('0x53')]+_0x2ae781[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2ae781[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2ae781[0x0]['predictiveIntervalTotalCalls'];_0x32dd00[_0xa2af('0x1ca')]=_0x27180f>0x0?_0x27180f:0x1;switch(_0x32dd00[_0xa2af('0x1d2')]){case _0xa2af('0x1d3'):var _0xa982f0=_0x32dd00['dialPredictiveOptimizationPercentage']/0x64;return _0x5b8f55['abandonmentRate'](_0x1d7f21,_0x5abc57,_0x1fa75e,_0x27180f,_0xa982f0)[_0xa2af('0x42')](function(_0xfb1467){return _0x2ebe82(_0xfb1467);});case _0xa2af('0x1e4'):var _0x740a39=_0x32dd00['dialPredictiveOptimizationPercentage']/0x64;return _0x5b8f55[_0xa2af('0x1e5')](_0x1d7f21,_0x5abc57,_0x1fa75e,_0x27180f,_0x740a39)[_0xa2af('0x42')](function(_0x5be74a){return _0x2ebe82(_0x5be74a);});default:return _0x27f0da(msgResponse(_0xa2af('0x1e6'),'Failure',_0xa2af('0x1e7')));}}else{return _0x27f0da(msgResponse(_0xa2af('0x1e6'),_0xa2af('0x95'),_0xa2af('0x1e8')));}});};};Dialer[_0xa2af('0x89')]['getDataPredictiveOld']=function(_0x1decd2){var _0x577667=this;return function(_0x402aa4){return new Promise(function(_0x56b1d1,_0x279f8c){_[_0xa2af('0x65')](_0x1decd2,_0x402aa4[0x0]);if(checkGetDataPredictive(_0x402aa4[0x0])){loggerPredictive[_0xa2af('0x4f')](JSON[_0xa2af('0x7b')](_0x402aa4[0x0]));if(_0x1decd2[_0xa2af('0x1d2')]===_0xa2af('0x1d3')){return _0x577667['getVoiceQueueRtPauses'](_0x1decd2['id'])['then'](function(_0x5e9e20){var _0x56ffff=_0x1decd2[_0xa2af('0x1e9')]-_0x5e9e20[0x0][_0xa2af('0x1ea')];var _0x5e6d5b=_0x1decd2[_0xa2af('0x1cf')]*0x3c;var _0x3306f0=_0x402aa4[0x0][_0xa2af('0x1e3')]+_0x402aa4[0x0]['predictiveIntervalAvgHoldtime'];var _0x9818bf=(_0x402aa4[0x0][_0xa2af('0x53')]+_0x402aa4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x402aa4[0x0][_0xa2af('0x56')])/_0x402aa4[0x0][_0xa2af('0x51')];var _0x134bb7=_0x1decd2[_0xa2af('0x1c6')]/0x64;_0x1decd2[_0xa2af('0x1eb')]=_0x5e9e20[0x0][_0xa2af('0x1ea')]||0x0;_0x1decd2[_0xa2af('0x1ca')]=_0x9818bf>0x0?_0x9818bf:0x1;return _0x577667['abandonmentRate'](_0x56ffff,_0x5e6d5b,_0x3306f0,_0x9818bf,_0x134bb7);})[_0xa2af('0x42')](function(_0x409f96){return _0x56b1d1(_0x409f96);})['catch'](function(_0x473c1d){return _0x279f8c(msgResponse(_0xa2af('0x1ec'),_0xa2af('0x95'),JSON[_0xa2af('0x7b')](_0x473c1d)));});}if(_0x1decd2['dialPredictiveOptimization']===_0xa2af('0x1e4')){return _0x577667[_0xa2af('0x155')](_0x1decd2['id'])['then'](function(_0x2d4a6e){var _0x53dc05=_0x1decd2[_0xa2af('0x1e9')]-_0x2d4a6e[0x0][_0xa2af('0x1ea')];var _0x293a2b=_0x1decd2[_0xa2af('0x1cf')]*0x3c;var _0x8933fd=_0x402aa4[0x0][_0xa2af('0x1e3')]+_0x402aa4[0x0][_0xa2af('0x58')];var _0x114061=(_0x402aa4[0x0][_0xa2af('0x53')]+_0x402aa4[0x0][_0xa2af('0x55')]+_0x402aa4[0x0][_0xa2af('0x56')])/_0x402aa4[0x0][_0xa2af('0x51')];var _0x3bebaa=_0x1decd2['dialPredictiveOptimizationPercentage']/0x64;_0x1decd2[_0xa2af('0x1eb')]=_0x2d4a6e[0x0]['outboundQueuePauses']||0x0;_0x1decd2[_0xa2af('0x1ca')]=_0x114061>0x0?_0x114061:0x1;return _0x577667[_0xa2af('0x1e5')](_0x53dc05,_0x293a2b,_0x8933fd,_0x114061,_0x3bebaa);})['then'](function(_0x506ef3){return _0x56b1d1(_0x506ef3);})[_0xa2af('0xa1')](function(_0x5cf039){return _0x279f8c(msgResponse('[CatchErlangB]',_0xa2af('0x95'),JSON[_0xa2af('0x7b')](_0x5cf039)));});}}else{return _0x279f8c(msgResponse(_0xa2af('0x1e6'),_0xa2af('0x95'),_0xa2af('0x1e8')));}});};};Dialer[_0xa2af('0x89')][_0xa2af('0x1dc')]=function(_0x52de09){var _0xbc2b4d=this;return function(){var _0x456a6f=0x0;var _0xb0c349=Math['floor'](_0x52de09[_0xa2af('0x61')]*0x3e8);if(_0xb0c349>0x0){_0xb0c349=_0xb0c349<0x64?0x64:_0xb0c349;loggerPredictive['info'](_0x52de09['name'],_0xa2af('0x1ed'),_0xb0c349,'milliseconds');_0x52de09[_0xa2af('0x6a')]=setInterval(function(){_0xbc2b4d['handlePredictive'](_0x52de09);loggerPredictiveCalls[_0xa2af('0x4f')](_0xa2af('0x1ee'),_0x456a6f+=0x1);},_0xb0c349);}else{loggerPredictive[_0xa2af('0x4f')](_0x52de09[_0xa2af('0x4c')],_0xa2af('0x1ef'));}};};Dialer[_0xa2af('0x89')]['checkContactBlack']=function(_0x2be7af,_0x438b9d){var _0x26c795=this;return function(_0x4fa90f){if(_[_0xa2af('0x4e')](_0x4fa90f)){if(_['isNil'](_0x438b9d[_0xa2af('0x15d')])||!_0x438b9d[_0xa2af('0x1f0')]){if(_0x2be7af['dialMethod']===_0xa2af('0xb')){_0x2be7af['queueStatusComplete']=_['isUndefined'](_0x2be7af['queueStatusComplete'])?!![]:_0x2be7af[_0xa2af('0x78')];var _0x3d2444=uuid['v4']();_0x26c795['actions'][_0x3d2444]=new Action(_0x2be7af,_0x438b9d,_0x3d2444);loggerBooked['info'](_0xa2af('0x1f1'),_0x3d2444,'queueStatusComplete:\x20',JSON[_0xa2af('0x7b')](_0x2be7af[_0xa2af('0x78')]),_0xa2af('0x1f2'),_0x2be7af[_0xa2af('0x4c')]);if(_0x2be7af[_0xa2af('0x78')]){_0x2be7af[_0xa2af('0x78')]=![];_0x26c795['queueBooked'][_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xc3')]]=[];ami[_0xa2af('0x9b')]({'actionid':_0x3d2444,'action':_0xa2af('0x1f3'),'queue':_0x2be7af['name']})[_0xa2af('0xa1')](function(){_0x26c795[_0xa2af('0xd1')](_0x2be7af);hopperUtils[_0xa2af('0xdc')]({'active':![],'ContactId':_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xdf')],'ListId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xe0')],'VoiceQueueId':_0x26c795[_0xa2af('0x28')][_0x3d2444]['VoiceQueueId']||undefined,'CampaignId':_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1f4')));delete _0x26c795[_0xa2af('0x28')][_0x3d2444];});}else{loggerBooked['info'](_0xa2af('0x1f5'),JSON[_0xa2af('0x7b')](_0x2be7af[_0xa2af('0x78')]),_0xa2af('0x1f2'),_0x2be7af[_0xa2af('0x4c')]);_0x26c795[_0xa2af('0xd1')](_0x2be7af);hopperUtils[_0xa2af('0xdc')]({'active':![],'ContactId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xdf')],'ListId':_0x26c795[_0xa2af('0x28')][_0x3d2444][_0xa2af('0xe0')],'VoiceQueueId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xe1')]||undefined,'CampaignId':_0x26c795['actions'][_0x3d2444][_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1f4')));delete _0x26c795[_0xa2af('0x28')][_0x3d2444];}}else{return _0x26c795[_0xa2af('0x161')](_0x2be7af,_0x438b9d);}}else{if(utils['getSeconds'](undefined,_0x438b9d[_0xa2af('0x1f6')])<_0x2be7af['dialRecallMeTimeout']*0x3c){if(_0x438b9d['Agent']&&!_0x438b9d[_0xa2af('0x14c')][_0xa2af('0x1f7')]){_0x26c795[_0xa2af('0x21')]['run'](_0x438b9d['id'])['finally'](function(){_0x26c795[_0xa2af('0xd1')](_0x2be7af);});}else{hopperUtils[_0xa2af('0x1f8')]({'active':![]},_0x438b9d['id'],0x1)[_0xa2af('0x1f')](function(){_0x26c795[_0xa2af('0xd1')](_0x2be7af);});}}else{_0x2be7af[_0xa2af('0x1f9')]+=0x1;_0x26c795[_0xa2af('0xd1')](_0x2be7af);if(_0x2be7af['dialRecallInQueue']){hopperUtils[_0xa2af('0xdc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x438b9d[_0xa2af('0xdf')],'ListId':_0x438b9d[_0xa2af('0xe0')],'VoiceQueueId':_0x438b9d[_0xa2af('0xe1')]||undefined,'CampaignId':_0x438b9d[_0xa2af('0xe2')]||undefined})[_0xa2af('0xa1')](loggerCatch(_0xa2af('0x1fa')));hopperUtils[_0xa2af('0xcd')](createObjHistory(_0x2be7af,_0x438b9d,utils[_0xa2af('0x70')][_0xa2af('0x1fb')],0x17,_0xa2af('0x1fc')))['catch'](loggerCatch(_0xa2af('0x1fd')));}else{_0x26c795['saveInDb'](createObjHistory(_0x2be7af,_0x438b9d,utils[_0xa2af('0x70')]['RECALL_TIMEOUT'],0x16,_0xa2af('0x1fe')),'[Originate][HistoryRecallClose][historyCatch]',_0xa2af('0x1ff'));}}}}else{_0x2be7af[_0xa2af('0x200')]+=0x1;_0x26c795[_0xa2af('0x118')](createObjHistory(_0x2be7af,_0x438b9d,utils['CAMPAIGN_STATUS'][_0xa2af('0x201')],0xd,_0xa2af('0x202')),_0xa2af('0x203'),_0xa2af('0x204'));throw _0xa2af('0x205');}};};Dialer[_0xa2af('0x89')][_0xa2af('0x160')]=function(_0x5dc5e8){var _0x189003=this;var _0x8487d7=_0x5dc5e8[_0xa2af('0x206')]-_0x5dc5e8['originated'];emitCampaignSummary(_0x5dc5e8);if(_0x8487d7>0x0&&_0x5dc5e8[_0xa2af('0x6e')]==0x0){if(_0x8487d7>this[_0xa2af('0x26')]){_0x8487d7=this[_0xa2af('0x26')];}_0x5dc5e8['temp']=0x1;hopperUtils[_0xa2af('0x207')](_0x5dc5e8,_0x8487d7)['then'](function(_0x56254d){_0x5dc5e8['temp']=0x0;if(_0x56254d){if(!utils[_0xa2af('0x208')](_0x56254d)){_0x5dc5e8[_0xa2af('0x6f')]=utils['CAMPAIGN_STATUS'][_0xa2af('0x74')];logger[_0xa2af('0x4f')](_0xa2af('0x209')+_0x5dc5e8[_0xa2af('0x4c')]);}else{_0x5dc5e8['originated']+=_0x56254d['length'];_0x5dc5e8['message']=utils[_0xa2af('0x70')][_0xa2af('0x20a')];for(var _0x4424f9=0x0;_0x4424f9<_0x56254d[_0xa2af('0x149')];_0x4424f9+=0x1){_0x5dc5e8['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x56254d[_0x4424f9])||_[_0xa2af('0xf8')](_0x56254d[_0x4424f9]['Contact'])||_[_0xa2af('0xf8')](_0x56254d[_0x4424f9][_0xa2af('0x164')])){_0x189003[_0xa2af('0x15b')]('[actionOriginate]\x20',_0x5dc5e8,_0x56254d[_0x4424f9]);}else{hopperUtils[_0xa2af('0x20b')](_[_0xa2af('0xfc')](_0x56254d[_0x4424f9],['CampaignId','phone']))['then'](_0x189003[_0xa2af('0x20c')](_0x5dc5e8,_0x56254d[_0x4424f9]))[_0xa2af('0xa1')](_0x189003[_0xa2af('0x15a')]('[actionOriginateIvr]\x20',_0x5dc5e8));}}}}})[_0xa2af('0xa1')](loggerGetContactDialer(_0xa2af('0x20d'),_0x5dc5e8,_0x8487d7));}};Dialer['prototype'][_0xa2af('0xb8')]=function(_0x471161,_0x2620f9){var _0x5a6279=this;var _0x1698f4=[];if(_0x2620f9<0x1||_0x471161[_0xa2af('0xb6')]===_0xa2af('0xb')){_0x2620f9=0x1;}var _0x288c4c=Math[_0xa2af('0x20e')](_0x471161[_0xa2af('0x13c')]*_0x2620f9)-_0x471161[_0xa2af('0x157')];if(_0x471161[_0xa2af('0x20f')]>0x0){var _0x520903=_0x471161[_0xa2af('0x20f')]-_0x471161[_0xa2af('0x157')]-_0x471161['talking']-_0x471161[_0xa2af('0x13f')];if(_0x288c4c>_0x520903){_0x288c4c=_0x520903;}}if(_0x288c4c>0x0&&_0x471161[_0xa2af('0x6e')]==0x0){if(_0x471161[_0xa2af('0xb6')]===_0xa2af('0xb')){_0x288c4c=0x1;}if(_0x288c4c>this[_0xa2af('0x26')]){_0x288c4c=this[_0xa2af('0x26')];}for(var _0x2fcb7e in this[_0xa2af('0x24')]){if(typeof this[_0xa2af('0x24')][_0x2fcb7e]!=='undefined'){if(this['agents'][_0x2fcb7e][_0xa2af('0x75')]===_0xa2af('0x210')&&this['agents'][_0x2fcb7e][_0xa2af('0x8d')]===_0xa2af('0x8e')){_0x1698f4[_0xa2af('0x9a')](this[_0xa2af('0x24')][_0x2fcb7e]['id']);}}}_0x471161[_0xa2af('0x6e')]=0x1;hopperUtils[_0xa2af('0x211')](_0x471161,_0x1698f4,_0x288c4c)['then'](function(_0x1dcdc2){_0x471161[_0xa2af('0x6e')]=0x0;if(_0x1dcdc2){if(!utils[_0xa2af('0x208')](_0x1dcdc2)){hopperUtils[_0xa2af('0x212')](_0x471161)[_0xa2af('0x42')](sendMessageReschedule(_0x471161))[_0xa2af('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x471161[_0xa2af('0x157')]+=_0x1dcdc2[_0xa2af('0x149')];_0x471161['message']=_0x471161[_0xa2af('0xb6')]===_0xa2af('0xb')?utils[_0xa2af('0x70')]['ACTIVE']:utils[_0xa2af('0x70')][_0xa2af('0x20a')];for(var _0x56d034=0x0;_0x56d034<_0x1dcdc2['length'];_0x56d034+=0x1){if(_[_0xa2af('0xf8')](_0x1dcdc2[_0x56d034])||_[_0xa2af('0xf8')](_0x1dcdc2[_0x56d034][_0xa2af('0x17d')])||_['isNil'](_0x1dcdc2[_0x56d034]['phone'])){_0x5a6279['emptyContact'](_0xa2af('0x213'),_0x471161,_0x1dcdc2[_0x56d034]);}else{hopperUtils[_0xa2af('0x214')](_['pick'](_0x1dcdc2[_0x56d034],[_0xa2af('0xe1'),'phone']))[_0xa2af('0x42')](_0x5a6279[_0xa2af('0x20c')](_0x471161,_0x1dcdc2[_0x56d034]))['catch'](_0x5a6279[_0xa2af('0x15a')](_0xa2af('0x213'),_0x471161));}}}}})['catch'](loggerGetContactDialer(_0xa2af('0x215'),_0x471161,_0x288c4c));}};Dialer['prototype'][_0xa2af('0x6a')]=function(_0x467587){if(_0x467587[_0xa2af('0x20f')]>0x0){var _0x3ce495=_0x467587[_0xa2af('0x20f')]-_0x467587[_0xa2af('0x157')]-_0x467587[_0xa2af('0x13e')];if(_0x3ce495>0x0&&_0x467587[_0xa2af('0x6e')]==0x0){this['tryOriginatePredictive'](_0x467587);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0xa2af('0x216')](_0x467587);}};Dialer[_0xa2af('0x89')][_0xa2af('0x216')]=function(_0x4466ee){var _0x191e72=this;var _0x534ee2=[];_0x4466ee[_0xa2af('0x157')]+=0x1;for(var _0x3846b2 in this[_0xa2af('0x24')]){if(typeof this[_0xa2af('0x24')][_0x3846b2]!==_0xa2af('0xae')){if(this[_0xa2af('0x24')][_0x3846b2][_0xa2af('0x75')]===_0xa2af('0x210')&&this['agents'][_0x3846b2][_0xa2af('0x8d')]===_0xa2af('0x8e')){_0x534ee2[_0xa2af('0x9a')](this[_0xa2af('0x24')][_0x3846b2]['id']);}}}_0x4466ee[_0xa2af('0x6e')]=0x1;return this[_0xa2af('0x211')](_0x4466ee['id'],_0x534ee2,0x1,_0x4466ee['dialOrderByScheduledAt'],_0x4466ee)[_0xa2af('0x42')](function(_0xb219c9){_0x4466ee['temp']=0x1;if(_0xb219c9){if(!utils[_0xa2af('0x208')](_0xb219c9)){utils[_0xa2af('0x6d')](_0x4466ee,0x1,0x0);return hopperUtils[_0xa2af('0x212')](_0x4466ee)[_0xa2af('0x42')](sendMessageReschedule(_0x4466ee))['catch'](loggerCatch(_0xa2af('0x217')));}else{_0x4466ee[_0xa2af('0x6f')]=utils[_0xa2af('0x70')][_0xa2af('0x20a')];if(_[_0xa2af('0xf8')](_0xb219c9[0x0])||_[_0xa2af('0xf8')](_0xb219c9[0x0]['Contact'])||_[_0xa2af('0xf8')](_0xb219c9[0x0][_0xa2af('0x164')])){_0x191e72[_0xa2af('0x15b')](_0xa2af('0x213'),_0x4466ee,_0xb219c9[0x0]);}else{return hopperUtils[_0xa2af('0x214')](_[_0xa2af('0xfc')](_0xb219c9[0x0],[_0xa2af('0xe1'),_0xa2af('0x164')]))[_0xa2af('0x42')](_0x191e72['checkContactBlack'](_0x4466ee,_0xb219c9[0x0]))[_0xa2af('0xa1')](_0x191e72[_0xa2af('0x15a')]('[actionOriginatePredictive]\x20',_0x4466ee));}}}})['catch'](loggerGetContactDialer(_0xa2af('0x218'),_0x4466ee,0x1));};Dialer['prototype'][_0xa2af('0x219')]=function(_0x5ab911,_0x23a44c,_0x4d2a13,_0x3b9301,_0x3e0db3,_0x1c7666){loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21a'));loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21b'),_0x5ab911);loggerPredictive['info'](_0xa2af('0x21c'),_0x23a44c);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21d'),_0x4d2a13);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21e'),_0x3b9301);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21f'),_0x3e0db3);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x5a'));return new Promise(function(_0x196b72,_0x39cb15){if(_0x5ab911<=0x0||isNaN(_0x5ab911)){return _0x39cb15(msgResponse('[abandonmentRate]',_0xa2af('0x88'),_0xa2af('0x220')+_0x5ab911));}if(_0x4d2a13<=0x0||isNaN(_0x4d2a13)){return _0x39cb15(msgResponse(_0xa2af('0x221'),_0xa2af('0x88'),_0xa2af('0x222')+_0x4d2a13));}if(_0x3b9301<=0x0||isNaN(_0x3b9301)){return _0x39cb15(msgResponse('[abandonmentRate]',_0xa2af('0x88'),_0xa2af('0x223')+_0x3b9301));}if(_0x23a44c<=0x0||isNaN(_0x23a44c)){return _0x39cb15(msgResponse(_0xa2af('0x221'),_0xa2af('0x88'),_0xa2af('0x224')+_0x23a44c));}if(_0x3e0db3<=0x0||isNaN(_0x3e0db3)){return _0x39cb15(msgResponse(_0xa2af('0x221'),_0xa2af('0x88'),_0xa2af('0x225')+_0x3e0db3));}_0x1c7666=_0x1c7666||0x0;var _0x473a83=0x1/_0x4d2a13;var _0x1eaa5e=0x0;var _0x5ea6df=0x0;var _0x53cc2a=0x0;var _0x40ff83=0x0;for(var _0x386ea5=0x0;_0x53cc2a<_0x3e0db3;_0x386ea5+=0x1){_0x5ea6df=_0x386ea5/_0x23a44c;_0x1eaa5e=(_0x3b9301*_0x5ea6df+_0x1c7666)/_0x473a83;_0x53cc2a=utils['erlangb'](_0x1eaa5e,_0x5ab911);_0x40ff83=_0x1eaa5e/_0x5ab911*(0x1-utils['erlangb'](_0x1eaa5e,_0x5ab911));}return _0x196b72({'erlangCalls':_0x386ea5,'erlangCallToSecond':_0x23a44c/_0x386ea5,'erlangAbandonmentRate':_0x53cc2a,'erlangBusyFactor':_0x40ff83});});};Dialer[_0xa2af('0x89')][_0xa2af('0x1e5')]=function(_0x3d971d,_0x243adf,_0x2970fc,_0x11584e,_0x1b1ec3,_0xa00b3e){loggerPredictive['info'](_0xa2af('0x226'));loggerPredictive[_0xa2af('0x4f')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d971d);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x243adf);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2970fc);loggerPredictive[_0xa2af('0x4f')](_0xa2af('0x21e'),_0x11584e);loggerPredictive[_0xa2af('0x4f')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1b1ec3);loggerPredictive['info']('---------------------------');return new Promise(function(_0x6e3b14,_0x131967){if(_0x3d971d<=0x0||isNaN(_0x3d971d)){return _0x131967(msgResponse(_0xa2af('0x227'),_0xa2af('0x88'),'m\x20=\x20'+_0x3d971d));}if(_0x2970fc<=0x0||isNaN(_0x2970fc)){return _0x131967(msgResponse(_0xa2af('0x227'),_0xa2af('0x88'),_0xa2af('0x222')+_0x2970fc));}if(_0x11584e<=0x0||isNaN(_0x11584e)){return _0x131967(msgResponse(_0xa2af('0x227'),_0xa2af('0x88'),_0xa2af('0x223')+_0x11584e));}if(_0x243adf<=0x0||isNaN(_0x243adf)){return _0x131967(msgResponse(_0xa2af('0x227'),'Error',_0xa2af('0x224')+_0x243adf));}if(_0x1b1ec3<=0x0||isNaN(_0x1b1ec3)){return _0x131967(msgResponse(_0xa2af('0x227'),'Error',_0xa2af('0x228')+_0x1b1ec3));}_0xa00b3e=_0xa00b3e||0x0;var _0x190eea=0x1/_0x2970fc;var _0x5c8b82=0x0;var _0x56b541=0x0;var _0x26e093=0x0;var _0x20c2d3=0x0;for(var _0x99fb2f=0x0;_0x20c2d3<_0x1b1ec3;_0x99fb2f+=0x1){_0x56b541=_0x99fb2f/_0x243adf;_0x5c8b82=(_0x11584e*_0x56b541+_0xa00b3e)/_0x190eea;_0x26e093=utils[_0xa2af('0x229')](_0x5c8b82,_0x3d971d);_0x20c2d3=_0x5c8b82/_0x3d971d*(0x1-utils[_0xa2af('0x229')](_0x5c8b82,_0x3d971d));}return _0x6e3b14({'erlangCalls':_0x99fb2f,'erlangCallToSecond':_0x243adf/_0x99fb2f,'erlangAbandonmentRate':_0x26e093,'erlangBusyFactor':_0x20c2d3});});};module[_0xa2af('0x22a')]=Dialer;
\ No newline at end of file
+var _0x6cf6=['handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','[originateError]:\x20%s','endtime','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','busyFactor','one\x20call\x20every:','milliseconds','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','Contact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','getContactDialer','dialOrderByScheduledAt','countReScheduled','checkIsBlackList','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','moment','ioredis','./utils/hopper','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummaryComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','outbound','debug','inspect','format','voice:queue:%s','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','getSeconds','name','startProgressive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','message','[unlockQueueStatus][undefined]','queueStatusComplete','pick','Interval','Intervals','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isEmpty','INACTIVE','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','reachable','status','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','length','push','command','interval','content','indexOf','true','catch','Action','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','stringify','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','dialPowerLevel','handlePower','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','isGlobal','AMI\x20IfTime','Error','queue','uniqueId','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','ivr','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','statedesc','Drop','starttime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','rescheduleContact','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','rrmemory','merge','idHopper','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','MACHINE','Machine','createStateFinal','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','filter','online','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','clearZombieChannels','enqueue','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s'];(function(_0x48ad11,_0x52a7f1){var _0x5a0be9=function(_0x3aca25){while(--_0x3aca25){_0x48ad11['push'](_0x48ad11['shift']());}};_0x5a0be9(++_0x52a7f1);}(_0x6cf6,0xc0));var _0x66cf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6cf6[_0x2f5ac5];return _0x37c9a8;};'use strict';var util=require(_0x66cf('0x0'));var _=require(_0x66cf('0x1'));var uuid=require('uuid');var moment=require(_0x66cf('0x2'));var rr=require('rr');var Redis=require(_0x66cf('0x3'));var utils=require('./utils');var hopperUtils=require(_0x66cf('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x66cf('0x5'))(_0x66cf('0x6'));var loggerBooked=require('../../../config/logger')(_0x66cf('0x7'));var loggerPredictive=require(_0x66cf('0x5'))(_0x66cf('0x8'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x66cf('0x5'))(_0x66cf('0x9'));var ami=require(_0x66cf('0xa'));config[_0x66cf('0xb')]=_[_0x66cf('0xc')](config[_0x66cf('0xb')],{'host':_0x66cf('0xd'),'port':0x18eb});var io=require(_0x66cf('0xe'))(new Redis(config['redis']));var cmHopper=require(_0x66cf('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0x66cf('0x10'));var Action=require(_0x66cf('0x11'));var History=require('./models/history');var Final=require(_0x66cf('0x12'));var AgentComplete=require(_0x66cf('0x13'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x66cf('0x14'));var ipAgi=process[_0x66cf('0x15')][_0x66cf('0x16')]||_0x66cf('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x66cf('0x18')]['enqueue']=function(_0x1e783b){this['tail']=this['tail']?this[_0x66cf('0x19')][_0x66cf('0x1a')](_0x1e783b):_0x1e783b();};function Dialer(_0x36948b,_0x5b4ece){this[_0x66cf('0x1b')]=new Sequence();this['preview']=_0x5b4ece;this[_0x66cf('0x1c')]=_0x36948b['voiceQueues'];this[_0x66cf('0x1d')]=_0x36948b[_0x66cf('0x1d')];this[_0x66cf('0x1e')]=_0x36948b[_0x66cf('0x1e')];this[_0x66cf('0x1f')]=_0x36948b[_0x66cf('0x1f')];this[_0x66cf('0x20')]=config['maxNumberOriginate']||0x2;this[_0x66cf('0x21')]={};this[_0x66cf('0x22')]={};this['contactsId']={};this['uniqueId']={};this[_0x66cf('0x23')]={};this[_0x66cf('0x24')]={};this[_0x66cf('0x25')]={};this[_0x66cf('0x26')]={};this[_0x66cf('0x27')]={};this[_0x66cf('0x28')]={};this['queuesSummary']={};ami['on']('agentconnect',this[_0x66cf('0x29')][_0x66cf('0x2a')](this));ami['on']('queuecallerabandon',this[_0x66cf('0x2b')][_0x66cf('0x2a')](this));ami['on'](_0x66cf('0x2c'),this[_0x66cf('0x2d')]['bind'](this));ami['on'](_0x66cf('0x2e'),this['syncAgentComplete'][_0x66cf('0x2a')](this));ami['on'](_0x66cf('0x2f'),this[_0x66cf('0x9')][_0x66cf('0x2a')](this));ami['on']('custom:queuesummarycomplete',this[_0x66cf('0x30')][_0x66cf('0x2a')](this));ami['on'](_0x66cf('0x31'),this['syncHangup'][_0x66cf('0x2a')](this));ami['on'](_0x66cf('0x32'),this[_0x66cf('0x33')][_0x66cf('0x2a')](this));ami['on'](_0x66cf('0x34'),this[_0x66cf('0x35')]['bind'](this));ami['on'](_0x66cf('0x36'),this[_0x66cf('0x37')][_0x66cf('0x2a')](this));ami['on'](_0x66cf('0x38'),this[_0x66cf('0x39')][_0x66cf('0x2a')](this));this[_0x66cf('0x3a')]();this[_0x66cf('0x3b')]();RpcSetting[_0x66cf('0x3c')]()[_0x66cf('0x3d')](function(_0x4b635f){previewRecallmeReminderInterval=_0x4b635f[_0x66cf('0x3e')];});}function isNotNull(_0x19bf3d){return _0x19bf3d!==null&&!_[_0x66cf('0x3f')](_0x19bf3d);}function msgResponse(_0x3ce90f,_0x56706a,_0x2b1eef){return{'action':_0x3ce90f,'response':_0x56706a,'message':_0x2b1eef,'stack':_0x2b1eef};}function emit(_0x140e08,_0x439c7b,_0x3cf072){io['to'](_0x140e08)['emit'](_0x439c7b,_0x3cf072);}function emitOutboundVoiceQueueSummary(_0xa9b6cc){if(_0xa9b6cc[_0x66cf('0x40')]===_0x66cf('0x41')){logger[_0x66cf('0x42')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x66cf('0x43')](_0xa9b6cc,{'showHidden':![],'depth':null}));emit(util[_0x66cf('0x44')](_0x66cf('0x45'),_0xa9b6cc['name']),_0x66cf('0x46'),_0xa9b6cc);}}function checkGetDataPredictive(_0xf798e){if(isNotNull(_0xf798e)&&!_['isEmpty'](_0xf798e)){loggerPredictive[_0x66cf('0x47')](_0x66cf('0x48'));loggerPredictive[_0x66cf('0x47')](_0x66cf('0x49'),_0xf798e[_0x66cf('0x4a')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf798e[_0x66cf('0x4b')]);loggerPredictive['info'](_0x66cf('0x4c'),_0xf798e[_0x66cf('0x4d')]);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x4e'),_0xf798e[_0x66cf('0x4f')]);loggerPredictive[_0x66cf('0x47')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf798e[_0x66cf('0x50')]);loggerPredictive['info'](_0x66cf('0x51'),_0xf798e[_0x66cf('0x52')]);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x53'));if(_0xf798e[_0x66cf('0x4a')]>0x0){if(!_[_0x66cf('0x3f')](_0xf798e[_0x66cf('0x52')])&&_0xf798e[_0x66cf('0x52')]>0x0){return!![];}loggerPredictive['info'](_0x66cf('0x54'));if(!_[_0x66cf('0x3f')](_0xf798e[_0x66cf('0x50')])&&_0xf798e[_0x66cf('0x50')]>0x0){return!![];}loggerPredictive[_0x66cf('0x47')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x66cf('0x47')](_0x66cf('0x55'));}}else{loggerPredictive[_0x66cf('0x47')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x17c894){return function(_0x69893b){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x66cf('0x56'),_0x69893b[_0x66cf('0x57')]);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x58'),_0x69893b[_0x66cf('0x59')]);loggerPredictive['info'](_0x66cf('0x5a'),_0x69893b[_0x66cf('0x5b')]);loggerPredictive[_0x66cf('0x47')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x69893b[_0x66cf('0x5c')]);loggerPredictive['info'](_0x66cf('0x5a'),_0x69893b['erlangAbandonmentRate']);loggerPredictive[_0x66cf('0x47')]('---------------------------');_['merge'](_0x17c894,_0x69893b);};}function ifInterval(_0x42bdab,_0x22e8cb){if(_[_0x66cf('0x3f')](_0x22e8cb)){return![];}return utils[_0x66cf('0x5d')](undefined,_0x22e8cb)<_0x42bdab*0x3c;}function clearPredictiveAttributes(_0x5343b7){if(_0x5343b7['startProgressive']){_0x5343b7[_0x66cf('0x25')]=undefined;loggerPredictive[_0x66cf('0x42')](_0x5343b7[_0x66cf('0x5e')],_0x66cf('0x5f'));}if(_0x5343b7[_0x66cf('0x24')]){_0x5343b7[_0x66cf('0x24')]=undefined;loggerPredictive[_0x66cf('0x42')](_0x5343b7[_0x66cf('0x5e')],'startPredictive\x20value\x20cleared');}if(_0x5343b7[_0x66cf('0x60')]){clearInterval(_0x5343b7[_0x66cf('0x60')]);_0x5343b7[_0x66cf('0x60')]=undefined;loggerPredictive[_0x66cf('0x42')](_0x5343b7[_0x66cf('0x5e')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0xe7c7e1,_0x5b95da){return function(_0x3ed4bb){loggerPredictive['error'](_0x5b95da[_0x66cf('0x5e')],_0xe7c7e1);loggerPredictive[_0x66cf('0x61')](_0x3ed4bb[_0x66cf('0x62')]);clearPredictiveAttributes(_0x5b95da);};}function loggerCatch(_0x1d1ca1){return function(_0x2ea9d2){logger[_0x66cf('0x61')](_0x1d1ca1,util[_0x66cf('0x43')](_0x2ea9d2,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1a2557,_0x3f2cec,_0x213100){return function(_0x100b57){utils[_0x66cf('0x63')](_0x3f2cec,_0x213100,0x0);_0x3f2cec[_0x66cf('0x64')]=0x0;logger[_0x66cf('0x61')](_0x1a2557,util['inspect'](_0x100b57,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3dd791){return function(_0x4f8c1b){if(isNotNull(_0x4f8c1b)&&isNotNull(_0x4f8c1b[0x0])){if(_0x4f8c1b[0x0][_0x66cf('0x65')]>0x0){_0x3dd791['message']=utils[_0x66cf('0x66')][_0x66cf('0x67')];logger[_0x66cf('0x47')](_0x66cf('0x68')+_0x3dd791['name'],_0x4f8c1b[0x0][_0x66cf('0x65')],_0x66cf('0x69'));}else{_0x3dd791['message']=utils['CAMPAIGN_STATUS'][_0x66cf('0x6a')];logger[_0x66cf('0x47')]('[getContactDialer2][Empty]'+_0x3dd791['name']);}}};}function createObjHistory(_0x20ca74,_0xe15c1f,_0x4c9dab,_0xa4f1a7,_0x24f8cf){_0x20ca74[_0x66cf('0x6b')]=_0x4c9dab;var _0x3e0e3e=new Action(_0x20ca74,_0xe15c1f);var _0x5358ea=new History(_0x3e0e3e);_0x5358ea['state']=_0xa4f1a7;_0x5358ea['statedesc']=_0x24f8cf;_0x5358ea['endtime']=_0x3e0e3e['starttime'];return _0x5358ea;}function unlockQueueStatus(_0x21cf14,_0x5bcf2e){setTimeout(function(){if(_[_0x66cf('0x3f')](_0x21cf14['queueStatusComplete'])){loggerBooked[_0x66cf('0x61')](_0x66cf('0x6c'),_0x5bcf2e);}_0x21cf14[_0x66cf('0x6d')]=!![];loggerBooked[_0x66cf('0x47')]('[booked][unlockQueueStatus]',_0x5bcf2e,JSON['stringify'](_[_0x66cf('0x6e')](_0x21cf14,['name',_0x66cf('0x6d')])));},0x1f3);}function checkInterval(_0x3248f7){return function(){if(!isNotNull(_0x3248f7[_0x66cf('0x6f')])){_0x3248f7['message']=utils[_0x66cf('0x66')]['NULL_INTERVAL'];throw _0x3248f7['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3248f7['Interval'][_0x66cf('0x70')])){_0x3248f7['message']=utils[_0x66cf('0x66')][_0x66cf('0x71')];throw _0x3248f7[_0x66cf('0x5e')]+_0x66cf('0x72');}if(!isNotNull(_[_0x66cf('0x73')](_0x3248f7[_0x66cf('0x6f')][_0x66cf('0x70')]))){_0x3248f7[_0x66cf('0x6b')]=utils['CAMPAIGN_STATUS'][_0x66cf('0x71')];throw _0x3248f7[_0x66cf('0x5e')]+_0x66cf('0x72');}};}function checkIsIVRCampaignActive(_0x5584f2){return function(){if(!utils['isIVRCampaignActive'](_0x5584f2)){_0x5584f2[_0x66cf('0x6b')]=utils[_0x66cf('0x66')][_0x66cf('0x74')];throw _0x5584f2['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x4f5c75){if(utils[_0x66cf('0x75')](_0x4f5c75)){emit(util[_0x66cf('0x44')](_0x66cf('0x76'),_0x4f5c75['name']),_0x66cf('0x77'),_0x4f5c75);}}function loggerCatchQueueSummary(_0x462372,_0x1d8d5f){return function(_0x4af302){clearPredictiveAttributes(_0x1d8d5f);emitCampaignSummary(_0x1d8d5f);loggerSyncQueueSummary[_0x66cf('0x42')](_0x462372,util['inspect'](_0x4af302,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1673d1){if(_0x1673d1[_0x66cf('0x78')]){if(_0x1673d1[_0x66cf('0x79')]===0x0){_0x1673d1[_0x66cf('0x78')]=![];_0x1673d1[_0x66cf('0x6b')]=utils[_0x66cf('0x66')]['INACTIVE'];loggerSyncQueueSummary[_0x66cf('0x42')](_0x66cf('0x7a'),_0x1673d1[_0x66cf('0x5e')],_0x66cf('0x7b'));}else{_0x1673d1[_0x66cf('0x6b')]=utils[_0x66cf('0x66')]['DISACTIVED'];loggerSyncQueueSummary[_0x66cf('0x42')](_0x66cf('0x7a'),_0x1673d1[_0x66cf('0x5e')],_0x66cf('0x7c'));}emitCampaignSummary(_0x1673d1);}}function myreject(_0xc328b4){return function(_0x4c1039){return _0xc328b4(msgResponse(_0x66cf('0x7d'),'Error',JSON['stringify'](_0x4c1039)));};}Dialer[_0x66cf('0x18')][_0x66cf('0x7e')]=function(_0x2b2d96){return!_[_0x66cf('0x3f')](_0x2b2d96)&&_0x2b2d96&&!_['isUndefined'](_0x2b2d96[_0x66cf('0x5e')])&&!_['isUndefined'](_0x2b2d96[_0x66cf('0x7f')])&&_0x2b2d96[_0x66cf('0x7f')]&&(this['trunks'][util['format'](_0x66cf('0x80'),_0x2b2d96['name'])]['status']===_0x66cf('0x81')||this[_0x66cf('0x1f')][util[_0x66cf('0x44')]('SIP/%s',_0x2b2d96[_0x66cf('0x5e')])][_0x66cf('0x82')]==='unmonitored');};Dialer['prototype'][_0x66cf('0x83')]=function(_0x12fa95){var _0x137622=this;return function(){if(!_0x137622[_0x66cf('0x7e')](_0x12fa95[_0x66cf('0x84')])){if(!_0x137622[_0x66cf('0x7e')](_0x12fa95[_0x66cf('0x85')])){_0x12fa95[_0x66cf('0x6b')]=utils[_0x66cf('0x66')][_0x66cf('0x86')];throw _0x12fa95[_0x66cf('0x5e')]+_0x66cf('0x87');}}};};Dialer[_0x66cf('0x18')][_0x66cf('0x88')]=function(_0x53d3de,_0x345a9e,_0x273de7,_0xaff6d5){var _0x33d71c=this;return function(){var _0x59c7f8=!![];return _0x33d71c['ifTimeIvr'](_0x53d3de,_0x345a9e,_0x273de7,_0xaff6d5,_0x59c7f8);};};Dialer[_0x66cf('0x18')][_0x66cf('0x89')]=function(_0x50921a,_0x29d0ca,_0x2ce37b,_0x1ff286){var _0x33f827=this;return function(){var _0x180246=![];return _0x33f827[_0x66cf('0x8a')](_0x50921a[_0x66cf('0x70')],_0x29d0ca,_0x2ce37b,_0x1ff286,_0x180246);};};Dialer['prototype']['ifTimeIvr']=function(_0x93782,_0x30c182,_0x909de3,_0x2ad4c8,_0x2b0663){var _0x1ff5e1=[];return new Promise(function(_0x436145,_0x168451){if(!isNotNull(_0x93782)){_0x2ad4c8[_0x66cf('0x6b')]=utils['CAMPAIGN_STATUS'][_0x66cf('0x71')];return _0x168451(msgResponse('ifTime','Failure',_0x909de3+_0x66cf('0x8b')));}if(_[_0x66cf('0x73')](_0x93782)){_0x2ad4c8['message']=utils[_0x66cf('0x66')][_0x66cf('0x8c')];return _0x168451(msgResponse(_0x66cf('0x8d'),_0x66cf('0x8e'),_0x909de3+_0x66cf('0x8f')));}if(_0x30c182&&_[_0x66cf('0x3f')](config[_0x66cf('0x90')][_0x30c182])){_0x2ad4c8['message']=utils[_0x66cf('0x66')][_0x66cf('0x91')];return _0x168451(msgResponse('ifTime',_0x66cf('0x8e'),_0x909de3+'\x20Timezone\x20unknow\x20'+_0x30c182));}if(_['isArray'](_0x93782)){for(var _0x1513f9=0x0;_0x1513f9<_0x93782[_0x66cf('0x92')];_0x1513f9+=0x1){_0x1ff5e1[_0x66cf('0x93')](ami['Action']({'action':_0x66cf('0x94'),'command':util[_0x66cf('0x44')]('iftime\x20%s,%s',_0x93782[_0x1513f9][_0x66cf('0x95')],!_['isUndefined'](config['timezones'][_0x30c182])?_0x30c182:'')})['then'](function(_0x1612d7){return _0x1612d7[_0x66cf('0x96')][_0x66cf('0x97')](_0x66cf('0x98'))>=0x0;})[_0x66cf('0x99')](myreject(_0x168451)));}}else{_0x1ff5e1[_0x66cf('0x93')](ami[_0x66cf('0x9a')]({'action':_0x66cf('0x94'),'command':util[_0x66cf('0x44')](_0x66cf('0x9b'),_0x93782,!_['isUndefined'](config[_0x66cf('0x90')][_0x30c182])?_0x30c182:'')})[_0x66cf('0x3d')](function(_0x5ce293){return _0x5ce293[_0x66cf('0x96')][_0x66cf('0x97')]('true')>=0x0;})[_0x66cf('0x99')](myreject(_0x168451)));}Promise[_0x66cf('0x9c')](_0x1ff5e1)[_0x66cf('0x3d')](function(_0x435dad){var _0x19e165=_[_0x66cf('0x9d')](_0x435dad);if(_0x19e165){return _0x436145(_0x19e165);}else{_0x2ad4c8[_0x66cf('0x6b')]=_0x2b0663?utils[_0x66cf('0x66')][_0x66cf('0x9e')]:utils[_0x66cf('0x66')][_0x66cf('0x9f')];return _0x168451(msgResponse(_0x66cf('0xa0'),_0x66cf('0x8e'),_0x66cf('0xa1')+_0x2b0663+'\x20'+_0x909de3+_0x66cf('0xa2')+util['inspect'](_0x93782,{'showHidden':![],'depth':null})+_0x66cf('0xa3')+_0x30c182));}})[_0x66cf('0x99')](function(_0x3516a1){return _0x168451(msgResponse('ifTime',_0x66cf('0x8e'),JSON[_0x66cf('0xa4')](_0x3516a1)));});});};Dialer['prototype'][_0x66cf('0x3a')]=function(){var _0x27e526=this;return cmHopper[_0x66cf('0xa5')]({'active':![]},{'where':{'active':!![]}})[_0x66cf('0x3d')](function(){setInterval(function(){_0x27e526['syncCampaigns']();},0x3e8);});};Dialer[_0x66cf('0x18')][_0x66cf('0xa6')]=function(){var _0x1ed665=this;var _0x4f3ed1;for(var _0x2ef57b in this[_0x66cf('0x1d')]){if(typeof this['campaigns'][_0x2ef57b]!==_0x66cf('0xa7')){_0x4f3ed1=this[_0x66cf('0x1d')][_0x2ef57b];if(utils[_0x66cf('0x75')](_0x4f3ed1)&&utils[_0x66cf('0xa8')](_0x4f3ed1)){_0x4f3ed1['sendMessageOneNotActive']=!![];Promise[_0x66cf('0xa9')]()[_0x66cf('0x3d')](checkIsIVRCampaignActive(_0x4f3ed1))[_0x66cf('0x3d')](checkInterval(_0x4f3ed1))[_0x66cf('0x3d')](_0x1ed665['checkIsTrunkReachable'](_0x4f3ed1))[_0x66cf('0x3d')](_0x1ed665[_0x66cf('0x88')](_0x4f3ed1[_0x66cf('0xaa')],_0x4f3ed1[_0x66cf('0xab')],_0x4f3ed1['name'],_0x4f3ed1))[_0x66cf('0x3d')](_0x1ed665[_0x66cf('0x89')](_0x4f3ed1[_0x66cf('0x6f')],_0x4f3ed1[_0x66cf('0xab')],_0x4f3ed1[_0x66cf('0x5e')],_0x4f3ed1))[_0x66cf('0x3d')](_0x1ed665[_0x66cf('0xac')](_0x4f3ed1))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x4f3ed1));}else{notSendMessagesCampaign(_0x4f3ed1);}}}};Dialer[_0x66cf('0x18')][_0x66cf('0xad')]=function(_0x3681b1){if(_0x3681b1[_0x66cf('0xae')]!==_0x66cf('0x8')){clearPredictiveAttributes(_0x3681b1);}switch(_0x3681b1['dialMethod']){case _0x66cf('0xaf'):this['handlePower'](_0x3681b1,0x1);break;case'power':this['handlePower'](_0x3681b1,_0x3681b1[_0x66cf('0xb0')]);break;case'predictive':this[_0x66cf('0x8')](_0x3681b1);break;case _0x66cf('0x7'):this[_0x66cf('0xb1')](_0x3681b1,0x1);break;default:logger[_0x66cf('0x61')](_0x66cf('0xb2'),_0x3681b1[_0x66cf('0x5e')],_0x66cf('0xb3'));}};Dialer[_0x66cf('0x18')][_0x66cf('0x8d')]=function(_0x1bce06,_0x1635db){var _0x270514=_0x1bce06['dialTimezone'];var _0x28c1b7=_0x1635db?_0x1bce06['dialGlobalInterval']:_0x1bce06[_0x66cf('0x6f')][_0x66cf('0x70')];logger[_0x66cf('0xb4')](_0x66cf('0xb5'),_0x28c1b7,_0x270514,_0x1bce06['name'],util[_0x66cf('0x44')]('Voice\x20Queue\x20%s\x20$s',_0x1bce06[_0x66cf('0x5e')],_0x1bce06['id']));var _0x2b1058=null;return Interval['intervalIftime'](_0x28c1b7,_0x270514)[_0x66cf('0x3d')](function(_0x518931){if(_0x518931===!![]){return _0x518931;}else{_0x1bce06[_0x66cf('0x6b')]=_0x1635db?utils[_0x66cf('0x66')][_0x66cf('0x9e')]:utils[_0x66cf('0x66')][_0x66cf('0x9f')];_0x2b1058=msgResponse('[ifTime][promiseAll]','Failure',_0x66cf('0xa1')+_0x1635db+'\x20'+_0x1bce06['name']+_0x66cf('0xa2')+util[_0x66cf('0x43')](_0x28c1b7,{'showHidden':![],'depth':null})+_0x66cf('0xa3')+_0x270514);}if(_0x2b1058!==null){logger[_0x66cf('0xb4')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x2b1058);_0x2b1058[_0x66cf('0xb6')]=_0x1635db;throw _0x2b1058;}})[_0x66cf('0x99')](function(_0x23245d){logger['error'](_0x66cf('0xb7'),_0x23245d);throw msgResponse('[ifTime][Action]',_0x66cf('0xb8'),util[_0x66cf('0x43')](_0x23245d,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x66cf('0x29')]=function(_0x465753){if(this['voiceQueues'][_0x465753[_0x66cf('0xb9')]]){if(this[_0x66cf('0xba')][_0x465753[_0x66cf('0xbb')]]&&this[_0x66cf('0xba')][_0x465753[_0x66cf('0xbb')]][_0x66cf('0x40')]!=='ivr'){this['updateOriginated'](this[_0x66cf('0x1c')][_0x465753[_0x66cf('0xb9')]]);this['uniqueId'][_0x465753[_0x66cf('0xbb')]][_0x66cf('0xbc')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));}}};Dialer[_0x66cf('0x18')][_0x66cf('0xbe')]=function(_0x2cd923){var _0x48bce4=this[_0x66cf('0xba')][_0x2cd923[_0x66cf('0xbb')]];if(this[_0x66cf('0x1c')][_0x2cd923[_0x66cf('0xb9')]]){if(_0x48bce4&&_0x48bce4[_0x66cf('0x40')]!==_0x66cf('0xbf')){delete this['uniqueId'][_0x2cd923[_0x66cf('0xbb')]];this['voiceQueues'][_0x2cd923[_0x66cf('0xb9')]][_0x66cf('0xc0')]+=0x1;var _0x54a95c=new AgentComplete(_0x48bce4,_0x2cd923);if(_0x2cd923[_0x66cf('0xc1')]===_0x66cf('0xc2')){_0x54a95c['agiafterat']=this['voiceQueues'][_0x2cd923[_0x66cf('0xb9')]][_0x66cf('0xc3')]&&this[_0x66cf('0x1c')][_0x2cd923[_0x66cf('0xb9')]][_0x66cf('0xc4')]?moment()[_0x66cf('0x44')](_0x66cf('0xbd')):undefined;}hopperUtils['createHistory'](_0x54a95c)[_0x66cf('0x99')](loggerCatch(_0x66cf('0xc5')));hopperUtils[_0x66cf('0xc6')](_0x54a95c)[_0x66cf('0x99')](loggerCatch(_0x66cf('0xc7')));}}};Dialer['prototype'][_0x66cf('0x2b')]=function(_0x347635){var _0x292c89=this[_0x66cf('0xba')][_0x347635['uniqueid']];var _0x20af4a=this;var _0x37c14b=![];var _0x1f0b17;var _0x4fb656;if(this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]]){if(_0x292c89&&_0x292c89[_0x66cf('0x40')]!=='ivr'){delete this[_0x66cf('0xba')][_0x347635[_0x66cf('0xbb')]];this[_0x66cf('0xc8')](this[_0x66cf('0x1c')][_0x347635['queue']]);_0x292c89[_0x66cf('0xc9')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));var _0xe9a486=new QueueCallerAbandon(_0x292c89,_0x347635);if(utils[_0x66cf('0x5d')](_0x292c89['droptime'],_0x292c89[_0x66cf('0xca')])>=_0x292c89['dialQueueTimeout']){this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x66cf('0x1c')][_0x347635['queue']][_0x66cf('0xcb')]+=0x1;this['voiceQueues'][_0x347635[_0x66cf('0xb9')]][_0x66cf('0xcc')]+=0x1;_0xe9a486[_0x66cf('0xcd')]=0xa;_0xe9a486['statedesc']='Drop';_0xe9a486['dropreason']=_0x66cf('0xce');_0xe9a486['agiafterat']=this[_0x66cf('0x1c')][_0x347635['queue']][_0x66cf('0xc3')]?moment()['format'](_0x66cf('0xbd')):undefined;_0xe9a486[_0x66cf('0xcf')]+=0x1;_0xe9a486[_0x66cf('0xd0')]+=0x1;_0x1f0b17=this['voiceQueues'][_0x347635[_0x66cf('0xb9')]][_0x66cf('0xd1')];_0x4fb656=this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]][_0x66cf('0xd2')];hopperUtils[_0x66cf('0xd3')](_0xe9a486,_0xe9a486[_0x66cf('0xcd')],_0x292c89['voiceQueue'])[_0x66cf('0x3d')](function(_0x373b34){_0x37c14b=_0x373b34[_0x66cf('0xd4')]==0x1;if(_0xe9a486[_0x66cf('0xcf')]>=_0x20af4a[_0x66cf('0x1c')][_0x347635['queue']][_0x66cf('0xd5')]){_0x20af4a[_0x66cf('0xd6')](_0xe9a486,_0x373b34[_0x66cf('0xd4')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0xe9a486[_0x66cf('0xcf')],'scheduledat':moment()[_0x66cf('0xd7')](_0x20af4a['voiceQueues'][_0x347635['queue']][_0x66cf('0xd1')],_0x66cf('0xd8'))[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x292c89[_0x66cf('0xd9')],'ListId':_0x292c89[_0x66cf('0xda')],'VoiceQueueId':_0x292c89[_0x66cf('0xdb')]||undefined,'CampaignId':_0x292c89[_0x66cf('0xdc')]||undefined})['catch'](loggerCatch(_0x66cf('0xdd')));var _0x1af149=new History(_0xe9a486);_0x1af149[_0x66cf('0xcd')]=0xa;_0x1af149[_0x66cf('0xde')]=_0x66cf('0xdf');_0x1af149[_0x66cf('0xe0')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));_0x1af149['endtime']=_0x1af149['starttime'];_0x1af149[_0x66cf('0xe1')]=_0xe9a486['calleridname'];_0x1af149[_0x66cf('0xe2')]=_0xe9a486[_0x66cf('0xe2')];hopperUtils[_0x66cf('0xe3')](_0x1af149)[_0x66cf('0x99')](loggerCatch(_0x66cf('0xe4')));}})['then'](function(){if(_0x37c14b)hopperUtils['swapAdditionalPhones'](_0xe9a486,_0x1f0b17,_0x4fb656)[_0x66cf('0x3d')](function(){return 0x1;});});}else{this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]]['outboundDropCallsDayCallersExit']+=0x1;_0xe9a486[_0x66cf('0xcd')]=0xb;_0xe9a486['statedesc']='Abandoned';_0xe9a486[_0x66cf('0xe5')]=_0x66cf('0xe6');_0xe9a486[_0x66cf('0xe7')]+=0x1;_0xe9a486[_0x66cf('0xd0')]+=0x1;_0x1f0b17=this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]][_0x66cf('0xe8')];_0x4fb656=this[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]][_0x66cf('0xd2')];hopperUtils[_0x66cf('0xd3')](_0xe9a486,_0xe9a486['state'],_0x292c89[_0x66cf('0xe9')])[_0x66cf('0x3d')](function(_0x1d5ac3){if(_0xe9a486['countabandonedretry']>=_0x20af4a[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]][_0x66cf('0xea')]){_0x20af4a['queueCallerAbandonCreateState'](_0xe9a486,_0x1d5ac3[_0x66cf('0xd4')]);}else{hopperUtils[_0x66cf('0xeb')]({'active':![],'countabandonedretry':_0xe9a486[_0x66cf('0xe7')],'scheduledat':moment()[_0x66cf('0xd7')](_0x20af4a[_0x66cf('0x1c')][_0x347635[_0x66cf('0xb9')]]['dialAbandonedRetryFrequency'],_0x66cf('0xd8'))[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x292c89['ContactId'],'ListId':_0x292c89[_0x66cf('0xda')],'VoiceQueueId':_0x292c89[_0x66cf('0xdb')]||undefined,'CampaignId':_0x292c89[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0xec')));var _0x3b693a=new History(_0xe9a486);_0x3b693a[_0x66cf('0xcd')]=0xb;_0x3b693a[_0x66cf('0xde')]=_0x66cf('0xed');_0x3b693a[_0x66cf('0xe0')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));_0x3b693a['endtime']=_0x3b693a[_0x66cf('0xe0')];_0x3b693a[_0x66cf('0xe1')]=_0xe9a486[_0x66cf('0xe1')];_0x3b693a[_0x66cf('0xe2')]=_0xe9a486[_0x66cf('0xe2')];hopperUtils[_0x66cf('0xe3')](_0x3b693a)[_0x66cf('0x99')](loggerCatch(_0x66cf('0xee')));}})[_0x66cf('0x3d')](function(){if(_0x37c14b)hopperUtils[_0x66cf('0xef')](_0xe9a486,_0x1f0b17,_0x4fb656)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0x66cf('0x33')]=function(_0x2673ae){if(this[_0x66cf('0x22')][_0x2673ae['uniqueid']]){this[_0x66cf('0x22')][_0x2673ae['uniqueid']][_0x66cf('0xf0')]=_0x2673ae[_0x66cf('0xf0')];}if(this[_0x66cf('0xba')][_0x2673ae[_0x66cf('0xbb')]]){this[_0x66cf('0xba')][_0x2673ae['uniqueid']][_0x66cf('0xf0')]=_0x2673ae[_0x66cf('0xf0')];}};Dialer['prototype'][_0x66cf('0x37')]=function(_0x270aaa){if(!this[_0x66cf('0x22')][_0x270aaa[_0x66cf('0xf1')]]){return;}var _0x5c504a=this[_0x66cf('0x1c')][this[_0x66cf('0x22')][_0x270aaa[_0x66cf('0xf1')]][_0x66cf('0xb9')]][_0x66cf('0xf2')]||'rrmemory';if(_0x5c504a===_0x66cf('0xf3')){if(this[_0x66cf('0x22')][_0x270aaa['actionid']]&&_[_0x66cf('0xf4')](this[_0x66cf('0x22')][_0x270aaa[_0x66cf('0xf1')]][_0x66cf('0xf5')])&&_0x270aaa[_0x66cf('0x82')]==='1'&&_0x270aaa[_0x66cf('0xf6')]==='0'){if(this['agents'][_0x270aaa[_0x66cf('0xf7')]]){if(!this[_0x66cf('0x1e')][_0x270aaa[_0x66cf('0xf7')]][_0x66cf('0xf5')]){this[_0x66cf('0x1e')][_0x270aaa[_0x66cf('0xf7')]][_0x66cf('0xf5')]=!![];this[_0x66cf('0x22')][_0x270aaa[_0x66cf('0xf1')]][_0x66cf('0xf5')]=!![];this['actions'][_0x270aaa['actionid']]['stateinterface']=_0x270aaa['stateinterface'];}}}}else if(_0x5c504a===_0x66cf('0xf8')){if(this[_0x66cf('0x22')][_0x270aaa['actionid']]){if(this[_0x66cf('0x1e')][_0x270aaa['stateinterface']]){this[_0x66cf('0x22')][_0x270aaa['actionid']]['stateinterface']=_0x270aaa['stateinterface'];if(_[_0x66cf('0xf4')](this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x270aaa['actionid']]['queue']])){this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x270aaa['actionid']][_0x66cf('0xb9')]]=[];}this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x270aaa['actionid']]['queue']][_0x66cf('0x93')](_[_0x66cf('0xf9')](_[_0x66cf('0x6e')](this[_0x66cf('0x22')][_0x270aaa[_0x66cf('0xf1')]],[_0x66cf('0xfa'),_0x66cf('0xf7')]),{'status':_0x270aaa[_0x66cf('0x82')],'paused':_0x270aaa['paused']}));}}}};Dialer[_0x66cf('0x18')][_0x66cf('0x39')]=function(_0x5b6eb7){if(!this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]){return;}var _0x3eea50=this;var _0x566a0e=this[_0x66cf('0x1c')][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]];var _0x5eb6b4=_0x566a0e[_0x66cf('0xf2')]||_0x66cf('0xf8');if(_0x5eb6b4===_0x66cf('0xf3')){if(this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]&&this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xf7')]){this[_0x66cf('0xfb')][_0x66cf('0xfc')](this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xfa')],this['actions'][_0x5b6eb7['actionid']][_0x66cf('0xf7')])[_0x66cf('0x99')](function(_0x5003a4){logger[_0x66cf('0x61')](_0x66cf('0xfd'),util[_0x66cf('0x43')](_0x5003a4,{'showHidden':![],'depth':null}));})[_0x66cf('0x1a')](function(){_0x3eea50['updateOriginated'](_0x3eea50['voiceQueues'][_0x3eea50[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]);_0x3eea50['agents'][_0x3eea50['actions'][_0x5b6eb7['actionid']][_0x66cf('0xf7')]][_0x66cf('0xf5')]=![];delete _0x3eea50[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]];unlockQueueStatus(_0x566a0e);});}else{this[_0x66cf('0xc8')](this[_0x66cf('0x1c')][this[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xb9')]]);hopperUtils[_0x66cf('0xeb')]({'active':![],'ContactId':this['actions'][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xd9')],'ListId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xda')],'VoiceQueueId':this['actions'][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xdb')]||undefined,'CampaignId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]['CampaignId']||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0xfe')));delete this['actions'][_0x5b6eb7[_0x66cf('0xf1')]];unlockQueueStatus(_0x566a0e);}}else if(_0x5eb6b4===_0x66cf('0xf8')){var _0x59ebf5;if(this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]&&!_[_0x66cf('0x73')](this['queueBooked'][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]])){if(this[_0x66cf('0x28')][_0x3eea50[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xb9')]]){this[_0x66cf('0x28')][_0x3eea50[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xb9')]]=this[_0x66cf('0x28')][this['actions'][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]?this['queueBookedRR'][this[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xb9')]]:this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]['queue']]?this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]][_0x66cf('0xff')]||0x0:0x0;}this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xb9')]][_0x66cf('0xff')]=this['queueBookedRR'][this['actions'][_0x5b6eb7[_0x66cf('0xf1')]]['queue']];for(var _0xead68=0x0;_0xead68<this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]['queue']]['length'];_0xead68+=0x1){_0x59ebf5=rr(this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]);this[_0x66cf('0x28')][_0x3eea50['actions'][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]=this[_0x66cf('0x27')][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]][_0x66cf('0xff')];if(_0x59ebf5[_0x66cf('0x82')]==='1'&&_0x59ebf5['paused']==='0'){break;}}if(!_[_0x66cf('0xf4')](_0x59ebf5)){this['agents'][_0x59ebf5[_0x66cf('0xf7')]][_0x66cf('0x100')]=_[_0x66cf('0x3f')](this['agents'][_0x59ebf5[_0x66cf('0xf7')]][_0x66cf('0x100')])?!![]:this['agents'][_0x59ebf5[_0x66cf('0xf7')]][_0x66cf('0x100')];}loggerBooked['info']('[booked][RR]',_0x5b6eb7[_0x66cf('0xf1')],'Agent:\x20',JSON[_0x66cf('0xa4')](_['pick'](this[_0x66cf('0x1e')][_0x59ebf5[_0x66cf('0xf7')]],[_0x66cf('0x5e'),_0x66cf('0x100')])),_0x66cf('0x101'),JSON[_0x66cf('0xa4')](_0x59ebf5[_0x66cf('0xfa')]));if(!_[_0x66cf('0xf4')](_0x59ebf5)&&_0x59ebf5['status']==='1'&&_0x59ebf5[_0x66cf('0xf6')]==='0'&&this['agents'][_0x59ebf5[_0x66cf('0xf7')]][_0x66cf('0x100')]){this[_0x66cf('0x1e')][_0x59ebf5[_0x66cf('0xf7')]][_0x66cf('0x100')]=![];this[_0x66cf('0x27')][_0x3eea50['actions'][_0x5b6eb7[_0x66cf('0xf1')]]['queue']]=[];this[_0x66cf('0xfb')][_0x66cf('0xfc')](_0x59ebf5['idHopper'],_0x59ebf5[_0x66cf('0xf7')])[_0x66cf('0x99')](function(_0x41d3fe){logger[_0x66cf('0x61')](_0x66cf('0xfd'),util[_0x66cf('0x43')](_0x41d3fe,{'showHidden':![],'depth':null}));})[_0x66cf('0x1a')](function(){_0x3eea50[_0x66cf('0xc8')](_0x3eea50['voiceQueues'][_0x3eea50[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]);setTimeout(function(){_0x3eea50['agents'][_0x59ebf5[_0x66cf('0xf7')]][_0x66cf('0x100')]=!![];loggerBooked[_0x66cf('0x47')](_0x66cf('0x102'),_0x5b6eb7[_0x66cf('0xf1')],_0x66cf('0x103'),JSON[_0x66cf('0xa4')](_['pick'](_0x3eea50[_0x66cf('0x1e')][_0x59ebf5[_0x66cf('0xf7')]],[_0x66cf('0x5e'),_0x66cf('0x100')])),_0x66cf('0x101'),JSON['stringify'](_0x59ebf5[_0x66cf('0xfa')]));},0xc7);delete _0x3eea50[_0x66cf('0x22')][_0x5b6eb7['actionid']];unlockQueueStatus(_0x566a0e,_0x5b6eb7[_0x66cf('0xf1')]);});}else{loggerBooked[_0x66cf('0x47')](_0x66cf('0x104'));this['updateOriginated'](this[_0x66cf('0x1c')][this[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xb9')]]);hopperUtils[_0x66cf('0xeb')]({'active':![],'ContactId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xd9')],'ListId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]['ListId'],'VoiceQueueId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xdb')]||undefined,'CampaignId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xdc')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x5b6eb7[_0x66cf('0xf1')]];unlockQueueStatus(_0x566a0e);}}else{loggerBooked['info'](_0x66cf('0x105'));this[_0x66cf('0xc8')](this['voiceQueues'][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]);hopperUtils[_0x66cf('0xeb')]({'active':![],'ContactId':this[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xd9')],'ListId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xda')],'VoiceQueueId':this[_0x66cf('0x22')][_0x5b6eb7['actionid']][_0x66cf('0xdb')]||undefined,'CampaignId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xdc')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]];unlockQueueStatus(_0x566a0e);}}else{loggerBooked[_0x66cf('0x47')](_0x66cf('0x106'));this[_0x66cf('0xc8')](this['voiceQueues'][this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xb9')]]);hopperUtils[_0x66cf('0xeb')]({'active':![],'ContactId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xd9')],'ListId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xda')],'VoiceQueueId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]][_0x66cf('0xdb')]||undefined,'CampaignId':this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]]['CampaignId']||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x107')));delete this[_0x66cf('0x22')][_0x5b6eb7[_0x66cf('0xf1')]];unlockQueueStatus(_0x566a0e);}};Dialer[_0x66cf('0x18')][_0x66cf('0x2d')]=function(_0x518d4a){var _0xf02871=this[_0x66cf('0x22')][_0x518d4a[_0x66cf('0xf1')]];if(_0xf02871){delete this[_0x66cf('0x22')][_0x518d4a[_0x66cf('0xf1')]];_0xf02871[_0x66cf('0xca')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));var _0x1cc75b=_0xf02871[_0x66cf('0x40')]===_0x66cf('0xbf')?this[_0x66cf('0x1d')][_0xf02871[_0x66cf('0xb9')]]:this[_0x66cf('0x1c')][_0xf02871[_0x66cf('0x108')]()];if(_0x518d4a[_0x66cf('0x109')]!==_0x66cf('0x10a')){this[_0x66cf('0xc8')](_0x1cc75b);return this['callProgressDetecting'](_0xf02871,_0x1cc75b,_0x518d4a)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x66cf('0xba')][_0x518d4a[_0x66cf('0xbb')]]=_0xf02871;}};Dialer[_0x66cf('0x18')][_0x66cf('0x35')]=function(_0x4b5445){var _0x46952c=this;var _0x46270c=this['uniqueId'][_0x4b5445[_0x66cf('0xbb')]];var _0xef8f1e;if(!_['isNil'](_0x4b5445)&&!_[_0x66cf('0xf4')](_0x4b5445[_0x66cf('0x10b')])&&!_[_0x66cf('0xf4')](_0x4b5445[_0x66cf('0x10b')][_0x66cf('0x10c')])&&_0x4b5445[_0x66cf('0x10d')]===_0x66cf('0x10e')&&_0x46270c){if(_0x46270c[_0x66cf('0x40')]!==_0x66cf('0xbf')&&this['voiceQueues'][_0x46270c[_0x66cf('0xb9')]][_0x66cf('0x10f')]&&_0x4b5445[_0x66cf('0x110')]===_0x66cf('0x111')){delete this['uniqueId'][_0x4b5445[_0x66cf('0xbb')]];this[_0x66cf('0xc8')](this['voiceQueues'][_0x46270c[_0x66cf('0xb9')]]);this[_0x66cf('0x1c')][_0x46270c['queue']][_0x66cf('0xc0')]+=0x1;this[_0x66cf('0x1c')][_0x46270c['queue']][_0x66cf('0x112')]+=0x1;_0xef8f1e=new Hangup(_0x46270c,_0x4b5445);_0xef8f1e['state']=0x12;_0xef8f1e[_0x66cf('0xde')]=_0x66cf('0x113');_0xef8f1e[_0x66cf('0x114')]=_0x66cf('0x115');ami[_0x66cf('0x116')](_0x66cf('0x117'),ut[_0x66cf('0x118')](_0xef8f1e,_0x66cf('0x119')));this[_0x66cf('0x11a')](_0xef8f1e,'[syncHangupInAMD][createHistory]',_0x66cf('0x11b'));}if(_0x46270c[_0x66cf('0x40')]!==_0x66cf('0xbf')&&this[_0x66cf('0x1c')][_0x46270c[_0x66cf('0xb9')]][_0x66cf('0x10f')]&&_0x4b5445['value']==='MACHINE'){return new Promise(function(_0xab81a8,_0x4bfa23){delete _0x46952c[_0x66cf('0xba')][_0x4b5445[_0x66cf('0xbb')]];_0x46952c[_0x66cf('0xc8')](_0x46952c[_0x66cf('0x1c')][_0x46270c[_0x66cf('0xb9')]]);_0x46952c[_0x66cf('0x1c')][_0x46270c[_0x66cf('0xb9')]][_0x66cf('0xc0')]+=0x1;_0x46952c['voiceQueues'][_0x46270c[_0x66cf('0xb9')]][_0x66cf('0x112')]+=0x1;var _0x466c14=_0x46952c['voiceQueues'][_0x46270c['queue']];var _0x5de58d=new Hangup(_0x46270c,_0x4b5445);_0x5de58d[_0x66cf('0xcd')]=0x13;_0x5de58d['statedesc']='Machine';_0x5de58d[_0x66cf('0x114')]=_0x66cf('0x115');_0x5de58d[_0x66cf('0x11c')]+=0x1;_0x5de58d[_0x66cf('0xd0')]+=0x1;_0x5de58d[_0x66cf('0x119')]=!![];ami['emit'](_0x66cf('0x117'),ut[_0x66cf('0x118')](_0x5de58d,_0x66cf('0x119')));hopperUtils[_0x66cf('0xe3')](_0x5de58d)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x11d')));if(_0x5de58d[_0x66cf('0x11e')]+_0x5de58d[_0x66cf('0x11f')]+_0x5de58d[_0x66cf('0x120')]+_0x5de58d[_0x66cf('0x121')]+_0x5de58d[_0x66cf('0xcf')]+_0x5de58d[_0x66cf('0xe7')]+_0x5de58d[_0x66cf('0x11c')]+_0x5de58d[_0x66cf('0x122')]>=_0x466c14[_0x66cf('0x123')]){_0x46952c[_0x66cf('0x124')](_0x5de58d,_0xab81a8,_0x4bfa23,'reason19\x20machine....');}else{if(_0x5de58d[_0x66cf('0x11c')]>=_0x466c14[_0x66cf('0x125')]){_0x46952c['createStateFinal'](_0x5de58d,_0xab81a8,_0x4bfa23,_0x66cf('0x126'));}else{hopperUtils[_0x66cf('0xeb')]({'active':![],'countmachineretry':_0x5de58d[_0x66cf('0x11c')],'scheduledat':moment()['add'](_0x466c14[_0x66cf('0x127')],_0x66cf('0xd8'))[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x5de58d['ContactId'],'ListId':_0x5de58d[_0x66cf('0xda')],'VoiceQueueId':_0x5de58d['VoiceQueueId']||undefined,'CampaignId':_0x5de58d[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x128')));_0xab81a8({'reschedule':0x1});}}});}if(_0x46270c[_0x66cf('0x40')]===_0x66cf('0xbf')&&this[_0x66cf('0x1d')][_0x46270c['queue']][_0x66cf('0x10f')]&&_0x4b5445['value']===_0x66cf('0x111')){delete this[_0x66cf('0xba')][_0x4b5445[_0x66cf('0xbb')]];this[_0x66cf('0xc8')](this[_0x66cf('0x1d')][_0x46270c[_0x66cf('0xb9')]]);_0xef8f1e=new Hangup(_0x46270c,_0x4b5445);_0xef8f1e['state']=0x12;_0xef8f1e['statedesc']=_0x66cf('0x113');_0xef8f1e[_0x66cf('0x114')]=_0x66cf('0x115');ami['emit']('custom:amd',ut[_0x66cf('0x118')](_0xef8f1e,'amd'));this[_0x66cf('0x11a')](_0xef8f1e,'[syncHangupInAMDIvr][createHistory]',_0x66cf('0x129'));}if(_0x46270c[_0x66cf('0x40')]===_0x66cf('0xbf')&&this[_0x66cf('0x1d')][_0x46270c['queue']][_0x66cf('0x10f')]&&_0x4b5445[_0x66cf('0x110')]===_0x66cf('0x12a')){return new Promise(function(_0x362e0d,_0x12ea62){delete _0x46952c[_0x66cf('0xba')][_0x4b5445['uniqueid']];_0x46952c[_0x66cf('0xc8')](_0x46952c[_0x66cf('0x1d')][_0x46270c[_0x66cf('0xb9')]]);_0x46952c[_0x66cf('0x1d')][_0x46270c[_0x66cf('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x46952c[_0x66cf('0x1d')][_0x46270c[_0x66cf('0xb9')]][_0x66cf('0x112')]+=0x1;var _0x3cdb99=_0x46952c[_0x66cf('0x1d')][_0x46270c[_0x66cf('0xb9')]];var _0x2a92f9=new Hangup(_0x46270c,_0x4b5445);_0x2a92f9[_0x66cf('0xcd')]=0x13;_0x2a92f9[_0x66cf('0xde')]=_0x66cf('0x12b');_0x2a92f9['membername']=_0x66cf('0x115');_0x2a92f9[_0x66cf('0x11c')]+=0x1;_0x2a92f9[_0x66cf('0xd0')]+=0x1;_0x2a92f9['amd']=!![];ami['emit'](_0x66cf('0x117'),ut[_0x66cf('0x118')](_0x2a92f9,_0x66cf('0x119')));hopperUtils[_0x66cf('0xe3')](_0x2a92f9)[_0x66cf('0x99')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2a92f9[_0x66cf('0x11e')]+_0x2a92f9[_0x66cf('0x11f')]+_0x2a92f9[_0x66cf('0x120')]+_0x2a92f9[_0x66cf('0x121')]+_0x2a92f9[_0x66cf('0xcf')]+_0x2a92f9['countabandonedretry']+_0x2a92f9[_0x66cf('0x11c')]+_0x2a92f9[_0x66cf('0x122')]>=_0x3cdb99[_0x66cf('0x123')]){_0x46952c[_0x66cf('0x124')](_0x2a92f9,_0x362e0d,_0x12ea62,'reason19\x20machine....');}else{if(_0x2a92f9[_0x66cf('0x11c')]>=_0x3cdb99[_0x66cf('0x125')]){_0x46952c[_0x66cf('0x12c')](_0x2a92f9,_0x362e0d,_0x12ea62,_0x66cf('0x126'));}else{hopperUtils[_0x66cf('0xeb')]({'active':![],'countmachineretry':_0x2a92f9[_0x66cf('0x11c')],'scheduledat':moment()[_0x66cf('0xd7')](_0x3cdb99[_0x66cf('0x127')],_0x66cf('0xd8'))[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x2a92f9['ContactId'],'ListId':_0x2a92f9[_0x66cf('0xda')],'VoiceQueueId':_0x2a92f9[_0x66cf('0xdb')]||undefined,'CampaignId':_0x2a92f9[_0x66cf('0xdc')]||undefined})['catch'](loggerCatch(_0x66cf('0x128')));_0x362e0d({'reschedule':0x1});}}});}}};Dialer[_0x66cf('0x18')][_0x66cf('0x12d')]=function(_0x30ba45){var _0x4032fe=this[_0x66cf('0xba')][_0x30ba45['uniqueid']];var _0x11dda9;if(_0x4032fe&&_0x4032fe[_0x66cf('0x40')]===_0x66cf('0xbf')){delete this[_0x66cf('0xba')][_0x30ba45[_0x66cf('0xbb')]];this['updateOriginated'](this[_0x66cf('0x1d')][_0x4032fe[_0x66cf('0xb9')]]);this[_0x66cf('0x1d')][_0x4032fe[_0x66cf('0xb9')]][_0x66cf('0x12e')]+=0x1;_0x11dda9=new Hangup(_0x4032fe,_0x30ba45);hopperUtils['createHistory'](_0x11dda9)['catch'](loggerCatch(_0x66cf('0x12f')));hopperUtils[_0x66cf('0xc6')](_0x11dda9)[_0x66cf('0x99')](loggerCatch('[syncHangupIvr]'));}if(_0x4032fe&&_0x4032fe[_0x66cf('0x40')]!==_0x66cf('0xbf')&&isNotNull(this['voiceQueues'][_0x4032fe[_0x66cf('0xb9')]][_0x66cf('0x130')])){delete this[_0x66cf('0xba')][_0x30ba45['uniqueid']];this[_0x66cf('0xc8')](this['voiceQueues'][_0x4032fe[_0x66cf('0xb9')]]);this[_0x66cf('0x1c')][_0x4032fe[_0x66cf('0xb9')]][_0x66cf('0xc0')]+=0x1;this[_0x66cf('0x1c')][_0x4032fe[_0x66cf('0xb9')]][_0x66cf('0x112')]+=0x1;_0x11dda9=new Hangup(_0x4032fe,_0x30ba45);_0x11dda9[_0x66cf('0xcd')]=0x10;_0x11dda9[_0x66cf('0xde')]=_0x66cf('0x131');_0x11dda9[_0x66cf('0x114')]='AGI';hopperUtils['createHistory'](_0x11dda9)[_0x66cf('0x99')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x66cf('0xc6')](_0x11dda9)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x132')));}if(_0x4032fe&&_0x4032fe[_0x66cf('0x40')]!==_0x66cf('0xbf')&&!isNotNull(this['voiceQueues'][_0x4032fe[_0x66cf('0xb9')]][_0x66cf('0x130')])){delete this[_0x66cf('0xba')][_0x30ba45[_0x66cf('0xbb')]];this['updateOriginated'](this[_0x66cf('0x1c')][_0x4032fe[_0x66cf('0xb9')]]);this[_0x66cf('0x1c')][_0x4032fe[_0x66cf('0xb9')]][_0x66cf('0x133')]+=0x1;_0x11dda9=new Hangup(_0x4032fe,_0x30ba45);_0x11dda9[_0x66cf('0xcd')]=0xc;_0x11dda9[_0x66cf('0xde')]=_0x30ba45[_0x66cf('0x134')];_0x11dda9[_0x66cf('0x114')]=_0x66cf('0x135');hopperUtils[_0x66cf('0xe3')](_0x11dda9)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x12f')));hopperUtils['moveContactManagedDialer'](_0x11dda9)['catch'](loggerCatch(_0x66cf('0x132')));}};Dialer[_0x66cf('0x18')]['syncQueueSummary']=function(_0x441f26){var _0x47b919=this;if(!_0x47b919['queuesSummary'][_0x441f26[_0x66cf('0x5e')]]){_0x47b919[_0x66cf('0x136')][_0x441f26['name']]={'running':![]};}else if(_0x47b919['queuesSummary'][_0x441f26[_0x66cf('0x5e')]]['running']===!![]){return;}else if(_0x47b919[_0x66cf('0x136')][_0x441f26[_0x66cf('0x5e')]][_0x66cf('0x137')]===![]){_0x47b919[_0x66cf('0x136')][_0x441f26['name']]['running']=!![];}var _0x2f6dce=_0x47b919[_0x66cf('0x1c')][_0x441f26[_0x66cf('0x5e')]];var _0x2ad27c=_0x2f6dce[_0x66cf('0x6b')]!==utils['CAMPAIGN_STATUS'][_0x66cf('0x74')];var _0x274a73=utils[_0x66cf('0x138')](_0x2f6dce);_0x2f6dce[_0x66cf('0x139')]=utils[_0x66cf('0x13a')](_0x2f6dce,_0x47b919[_0x66cf('0x1f')]);Promise['resolve']()[_0x66cf('0x3d')](function(){if(_0x2f6dce[_0x66cf('0x139')]===utils[_0x66cf('0x66')][_0x66cf('0x74')]){if(_0x2ad27c){clearPredictiveAttributes(_0x2f6dce);_0x441f26[_0x66cf('0x24')]=undefined;_0x441f26[_0x66cf('0x25')]=undefined;}if(_0x2f6dce[_0x66cf('0x139')]===utils['CAMPAIGN_STATUS'][_0x66cf('0x74')]){_0x441f26[_0x66cf('0x13b')]=0x0;_0x441f26[_0x66cf('0xf6')]=0x0;_0x441f26[_0x66cf('0x13c')]=0x0;_0x441f26[_0x66cf('0x13d')]=0x0;_0x441f26[_0x66cf('0x13e')]=0x0;}}else if(_0x2f6dce[_0x66cf('0x139')]===utils[_0x66cf('0x66')][_0x66cf('0x13f')]&&!_0x274a73){return _0x47b919[_0x66cf('0x8d')](_0x2f6dce,!![])['then'](function(){return _0x47b919[_0x66cf('0x8d')](_0x2f6dce,![]);})['then'](function(){return _0x47b919[_0x66cf('0xad')](_0x2f6dce);})[_0x66cf('0x99')](function(_0x51a088){loggerSyncQueueSummary['debug'](_0x66cf('0x140'),util[_0x66cf('0x43')](_0x51a088,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2f6dce);});}else{clearPredictiveAttributes(_0x2f6dce);}})[_0x66cf('0x3d')](function(){var _0x444b56=_0x441f26[_0x66cf('0x141')](_0x2f6dce);if(_0x444b56||_0x2f6dce[_0x66cf('0x142')]){_0x2f6dce[_0x66cf('0x142')]=![];_0x441f26['updateReportFromOutboundQueue'](_0x2f6dce);Object[_0x66cf('0x143')](_0x2f6dce,_0x441f26);emitOutboundVoiceQueueSummary(_0x441f26);}_0x47b919[_0x66cf('0x136')][_0x2f6dce[_0x66cf('0x5e')]]['running']=![];})[_0x66cf('0x99')](function(_0x5b7003){logger[_0x66cf('0x61')]('[syncQueueSummary]',util['inspect'](_0x5b7003,{'showHidden':![],'depth':null}));_0x47b919[_0x66cf('0x136')][_0x2f6dce['name']][_0x66cf('0x137')]=![];});};Dialer['prototype'][_0x66cf('0x30')]=_['throttle'](function(){var _0x15a165=_[_0x66cf('0x144')](this[_0x66cf('0x1c')],function(_0x281bf5){return _0x281bf5['dialPreviewRecallmeReminder'];});var _0x543af1=_['filter'](this[_0x66cf('0x1e')],function(_0x216719){return _0x216719[_0x66cf('0x145')]&&_0x216719[_0x66cf('0x82')]===_0x66cf('0x81');});if(_0x15a165[_0x66cf('0x92')]>0x0&&_0x543af1[_0x66cf('0x92')]>0x0){return Promise['resolve']()[_0x66cf('0x3d')](cmHopper[_0x66cf('0x146')](_['map'](_0x15a165,'id'),previewRecallmeReminderInterval,_['map'](_0x543af1,'id')))[_0x66cf('0x3d')](function(_0x391054){for(var _0x160f45=0x0;_0x160f45<_0x391054[_0x66cf('0x92')];_0x160f45++){var _0x5aa1fc=_0x391054[_0x160f45][_0x66cf('0x147')][_0x66cf('0x5e')];if(_0x5aa1fc)io['to'](util[_0x66cf('0x44')]('user:%s',_0x5aa1fc))[_0x66cf('0x116')](_0x66cf('0x148'),{'hopper':_0x391054[_0x160f45]});}})[_0x66cf('0x99')](function(_0x23a36c){logger[_0x66cf('0x61')]('checkPreviewRecallReminder',_0x23a36c);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x66cf('0x18')][_0x66cf('0x3b')]=function(){var _0x4d45c6=this;setInterval(function(){_0x4d45c6['clearZombieChannels'](_0x4d45c6[_0x66cf('0xba')],'[uniqueid]');_0x4d45c6[_0x66cf('0x149')](_0x4d45c6[_0x66cf('0x22')],'[actions]');},0x32c8);};Dialer[_0x66cf('0x18')][_0x66cf('0x149')]=function(_0xad8413,_0x855f04){var _0x57f9cc=this;for(var _0x2a3c2b in _0xad8413){if(typeof _0xad8413[_0x2a3c2b]!==_0x66cf('0xa7')){this[_0x66cf('0x1b')][_0x66cf('0x14a')](function(){if(!_[_0x66cf('0xf4')](_0xad8413[_0x2a3c2b])){return ami[_0x66cf('0x9a')]({'action':_0x66cf('0x82'),'channel':_0xad8413[_0x2a3c2b][_0x66cf('0xf0')]})[_0x66cf('0x99')](function(_0x1ae9f5){if(_0x1ae9f5[_0x66cf('0x6b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xad8413[_0x2a3c2b]&&_0xad8413[_0x2a3c2b][_0x66cf('0x40')]!==_0x66cf('0xbf')){_0x57f9cc['updateOriginated'](_0x57f9cc[_0x66cf('0x1c')][_0xad8413[_0x2a3c2b][_0x66cf('0xb9')]]);logger[_0x66cf('0x61')](_0x66cf('0x14b'),_0x855f04,_0x2a3c2b,_0xad8413[_0x2a3c2b][_0x66cf('0xb9')]);delete _0xad8413[_0x2a3c2b];}if(_0xad8413[_0x2a3c2b]&&_0xad8413[_0x2a3c2b][_0x66cf('0x40')]===_0x66cf('0xbf')){_0x57f9cc[_0x66cf('0xc8')](_0x57f9cc['campaigns'][_0xad8413[_0x2a3c2b][_0x66cf('0xb9')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x855f04,_0x2a3c2b,_0xad8413[_0x2a3c2b][_0x66cf('0xb9')]);delete _0xad8413[_0x2a3c2b];}},0x2328);}});}});}}};Dialer['prototype'][_0x66cf('0x14c')]=function(_0x2e1d14){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x2e1d14))[_0x66cf('0x99')](loggerCatch(_0x66cf('0x14d')));};Dialer[_0x66cf('0x18')][_0x66cf('0xc8')]=function(_0x5c2d56){if(!_['isUndefined'](_0x5c2d56)&&_0x5c2d56!==null){if(typeof _0x5c2d56[_0x66cf('0x79')]!=='undefined'){if(_0x5c2d56[_0x66cf('0x79')]>0x0){_0x5c2d56[_0x66cf('0x79')]-=0x1;}else{logger['error'](_0x66cf('0x14e'));}}}else{logger['error'](_0x66cf('0x14f'));}};Dialer[_0x66cf('0x18')][_0x66cf('0x150')]=function(_0x485a2c,_0x4f61b7){var _0x516efa=this;return function(_0x2bc096){_0x516efa[_0x66cf('0xc8')](_0x4f61b7);logger[_0x66cf('0x61')](_0x485a2c,util[_0x66cf('0x43')](_0x2bc096,{'showHidden':![],'depth':null}));};};Dialer[_0x66cf('0x18')][_0x66cf('0x151')]=function(_0x15e7ef,_0x3a0866,_0x201a52){var _0x512d70={'state':0x19,'statedesc':_0x66cf('0x152')};this[_0x66cf('0xc8')](_0x3a0866);this[_0x66cf('0x11a')](_[_0x66cf('0xf9')](_0x512d70,_['pick'](_0x201a52,[_0x66cf('0xd9'),_0x66cf('0xda'),_0x66cf('0x153'),_0x66cf('0xdb'),_0x66cf('0xdc')])),_0x66cf('0x154'),_0x66cf('0x155'));logger[_0x66cf('0x61')](_0x15e7ef);};Dialer[_0x66cf('0x18')][_0x66cf('0x11a')]=function(_0x43fe6c,_0x45f161,_0x4c3d49){hopperUtils[_0x66cf('0xe3')](_0x43fe6c)['catch'](loggerCatch(_0x45f161));hopperUtils[_0x66cf('0xc6')](_0x43fe6c)[_0x66cf('0x99')](loggerCatch(_0x4c3d49));};Dialer['prototype'][_0x66cf('0xd6')]=function(_0x4f793b,_0x4ce391){hopperUtils[_0x66cf('0xe3')](_0x4f793b)[_0x66cf('0x99')](loggerCatch(_0x66cf('0xc5')));if(_0x4ce391==0x0){hopperUtils['moveContactManagedDialer'](_0x4f793b)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x156')));}};Dialer[_0x66cf('0x18')][_0x66cf('0x157')]=function(_0x151f29){return Promise[_0x66cf('0xa9')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x151f29['id'],previewRecallmeReminderInterval))[_0x66cf('0x3d')](function(_0x8dff7d){for(var _0x2e5cbf=0x0;_0x2e5cbf<_0x8dff7d['length'];_0x2e5cbf++){var _0x1cef79=_0x8dff7d[_0x2e5cbf][_0x66cf('0x147')][_0x66cf('0x5e')];if(_0x1cef79)io['to'](util[_0x66cf('0x44')](_0x66cf('0x158'),_0x1cef79))[_0x66cf('0x116')]('user:dialPreviewRecallReminder',{'hopper':_0x8dff7d[_0x2e5cbf]});}})[_0x66cf('0x99')](function(){});};Dialer[_0x66cf('0x18')][_0x66cf('0xac')]=function(_0x41cbb7){var _0x539b0b=this;return function(){_0x539b0b[_0x66cf('0x159')](_0x41cbb7);};};Dialer['prototype'][_0x66cf('0x15a')]=function(_0x229059,_0x20645b){var _0x52f58d=this;var _0x34cabc=uuid['v4']();this[_0x66cf('0x22')][_0x34cabc]=new Action(_0x229059,_0x20645b,_0x34cabc);return new Promise(function(_0x4b8068,_0x5ecc36){if(_[_0x66cf('0x3f')](_0x229059)&&typeof _0x229059!==_0x66cf('0x15b')){return _0x5ecc36(msgResponse(_0x66cf('0x15c'),_0x66cf('0x8e'),_0x66cf('0x15d')));}if(_['isUndefined'](_0x20645b['phone'])||_0x20645b[_0x66cf('0x15e')]===null){return _0x5ecc36(msgResponse(_0x66cf('0x15c'),_0x66cf('0x8e'),_0x66cf('0x15f')));}var _0x5cc2f1={'XMD-CALLERID':_0x52f58d['actions'][_0x34cabc][_0x66cf('0x160')](),'XMD-AGI':_0x229059[_0x66cf('0x130')]?util[_0x66cf('0x44')](_0x66cf('0x161'),ipAgi,_0x229059[_0x66cf('0x130')]):'NONE','XMD-AGIAFTER':_0x229059[_0x66cf('0xc3')]?util[_0x66cf('0x44')](_0x66cf('0x161'),ipAgi,_0x229059[_0x66cf('0xc3')]):_0x66cf('0x162'),'XMD-QUEUE':utils[_0x66cf('0x163')](_0x229059)?util[_0x66cf('0x44')](_0x66cf('0x164'),_0x229059[_0x66cf('0x5e')],_0x229059[_0x66cf('0x165')]||'',_0x229059['dialAgiAfterHangupAgent']?'c':'',_0x229059[_0x66cf('0x166')]||0x3):_0x66cf('0x162'),'XMD-CONTACTID':_0x20645b['ContactId'],'XMD-CDRTYPE':_0x66cf('0x6'),'CALLERID(all)':_0x52f58d[_0x66cf('0x22')][_0x34cabc][_0x66cf('0x160')](),'XMD-AMD':_0x229059[_0x66cf('0x10f')]?'ACTIVE':_0x66cf('0x162'),'XMD-DESTINATION':_0x66cf('0x10e')};if(_0x229059[_0x66cf('0x10f')]){_0x5cc2f1[_0x66cf('0x167')]=_0x229059[_0x66cf('0x168')]||0x9c4;_0x5cc2f1[_0x66cf('0x169')]=_0x229059[_0x66cf('0x16a')]||0x5dc;_0x5cc2f1[_0x66cf('0x16b')]=_0x229059['dialAMDAfterGreetingSilence']||0x320;_0x5cc2f1[_0x66cf('0x16c')]=_0x229059[_0x66cf('0x16d')]||0x1388;_0x5cc2f1[_0x66cf('0x16e')]=_0x229059[_0x66cf('0x16f')]||0x64;_0x5cc2f1[_0x66cf('0x170')]=_0x229059[_0x66cf('0x171')]||0x32;_0x5cc2f1[_0x66cf('0x172')]=_0x229059['dialAMDMaximumNumberOfWords']||0x3;_0x5cc2f1[_0x66cf('0x173')]=_0x229059[_0x66cf('0x174')]||0x100;_0x5cc2f1[_0x66cf('0x175')]=_0x229059[_0x66cf('0x176')]||0x1388;}if(utils[_0x66cf('0x163')](_0x229059)){_0x5cc2f1['XMD-VOICEQUEUEID']=_0x20645b[_0x66cf('0xdb')];}else{_0x5cc2f1['XMD-CAMPAIGNID']=_0x20645b['CampaignId'];}var _0x2b8e9e=utils[_0x66cf('0x177')](_0x20645b['Contact']);Object[_0x66cf('0x143')](_0x5cc2f1,_0x2b8e9e);var _0x40862d=_0x52f58d[_0x66cf('0x7e')](_0x229059[_0x66cf('0x84')])?utils['getCallerId'](_0x229059[_0x66cf('0x84')][_0x66cf('0x178')],_0x229059[_0x66cf('0x179')],_0x229059[_0x66cf('0x17a')]>0x0?utils['getCallerIdRandom'](_0x229059[_0x66cf('0x17b')],_0x229059[_0x66cf('0x17a')]):_0x229059['dialOriginateCallerIdNumber']):utils[_0x66cf('0x17c')](_['isNil'](_0x229059[_0x66cf('0x85')])?_0x229059[_0x66cf('0x84')][_0x66cf('0x178')]:_0x229059['TrunkBackup'][_0x66cf('0x178')],_0x229059[_0x66cf('0x179')],_0x229059[_0x66cf('0x17a')]>0x0?utils[_0x66cf('0x17d')](_0x229059[_0x66cf('0x17b')],_0x229059['dialRandomLastDigitCallerIdNumber']):_0x229059[_0x66cf('0x17b')]);if(_0x40862d){_0x5cc2f1[_0x66cf('0x17e')]=_0x52f58d['actions'][_0x34cabc][_0x66cf('0x17f')]=utils[_0x66cf('0x180')](_0x40862d);_0x5cc2f1[_0x66cf('0x181')]=_0x20645b[_0x66cf('0x15e')];}_0x229059[_0x66cf('0x182')]=_0x5cc2f1;return ami[_0x66cf('0x9a')]({'actionid':_0x34cabc,'action':_0x66cf('0x15c'),'channel':_0x52f58d['isTrunkReachable'](_0x229059[_0x66cf('0x84')])?util[_0x66cf('0x44')](_0x66cf('0x183'),_0x229059['Trunk'][_0x66cf('0x5e')],isNotNull(_0x229059[_0x66cf('0x184')])?_0x229059[_0x66cf('0x184')][_0x66cf('0x185')]()||'':'',_0x229059[_0x66cf('0x186')]>0x0?_0x20645b[_0x66cf('0x15e')][_0x66cf('0x187')](_0x229059[_0x66cf('0x186')]):_0x20645b[_0x66cf('0x15e')]):util[_0x66cf('0x44')](_0x66cf('0x183'),_[_0x66cf('0xf4')](_0x229059[_0x66cf('0x85')])?_0x229059[_0x66cf('0x84')][_0x66cf('0x5e')]:_0x229059[_0x66cf('0x85')][_0x66cf('0x5e')],isNotNull(_0x229059[_0x66cf('0x184')])?_0x229059[_0x66cf('0x184')][_0x66cf('0x185')]()||'':'',_0x229059[_0x66cf('0x186')]>0x0?_0x20645b[_0x66cf('0x15e')][_0x66cf('0x187')](_0x229059['dialCutDigit']):_0x20645b[_0x66cf('0x15e')]),'callerid':_0x40862d,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x5cc2f1,'timeout':(_0x229059[_0x66cf('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x34cabc})['then'](function(_0x2530de){return _0x4b8068(_0x2530de);})[_0x66cf('0x99')](function(_0x518647){_0x229059['outboundOriginateFailureCallsDay']+=0x1;var _0x3dc205=new History(_0x52f58d[_0x66cf('0x22')][_0x34cabc]);logger[_0x66cf('0x61')](util[_0x66cf('0x44')](_0x66cf('0x189'),JSON['stringify'](_0x518647)));_0x3dc205[_0x66cf('0xcd')]=0xe;_0x3dc205[_0x66cf('0xde')]='OriginateError';_0x3dc205['starttime']=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));_0x3dc205[_0x66cf('0x18a')]=_0x3dc205[_0x66cf('0xe0')];hopperUtils[_0x66cf('0xe3')](_0x3dc205)[_0x66cf('0x99')](loggerCatch('[originate][error]'));_0x52f58d[_0x66cf('0xc6')](_0x3dc205)['catch'](loggerCatch(_0x66cf('0x18b')))['finally'](function(){delete _0x52f58d[_0x66cf('0x22')][_0x34cabc];return _0x5ecc36(msgResponse(_0x66cf('0x15c'),_0x66cf('0xb8'),_0x66cf('0x18c')));});});});};Dialer[_0x66cf('0x18')]['checkRetriveMax']=function(_0x51b928,_0xeade0d,_0x21f053){var _0x469aa3=new History(_0xeade0d);if(_0x469aa3[_0x66cf('0x11e')]+_0x469aa3[_0x66cf('0x11f')]+_0x469aa3[_0x66cf('0x120')]+_0x469aa3[_0x66cf('0x121')]+_0x469aa3[_0x66cf('0xcf')]+_0x469aa3[_0x66cf('0xe7')]+_0x469aa3[_0x66cf('0x11c')]+_0x469aa3[_0x66cf('0x122')]>=_0x21f053['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x51b928){case 0x3:if(_0x469aa3[_0x66cf('0x120')]>=_0x21f053[_0x66cf('0x18d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x469aa3['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x66cf('0xd7')](_0x21f053[_0x66cf('0x18e')],'minutes')[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x469aa3[_0x66cf('0xd9')],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3[_0x66cf('0xdb')]||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x18f')));break;case 0x5:if(_0x469aa3['countbusyretry']>=_0x21f053[_0x66cf('0x190')]-0x1){return!![];}hopperUtils[_0x66cf('0xeb')]({'active':![],'countbusyretry':_0x469aa3[_0x66cf('0x11e')]+=0x1,'scheduledat':moment()[_0x66cf('0xd7')](_0x21f053[_0x66cf('0x191')],'minutes')[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x469aa3[_0x66cf('0xd9')],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3[_0x66cf('0xdb')]||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x192')));break;case 0x8:if(_0x469aa3[_0x66cf('0x11f')]>=_0x21f053[_0x66cf('0x193')]-0x1){return!![];}hopperUtils[_0x66cf('0xeb')]({'active':![],'countcongestionretry':_0x469aa3['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x21f053['dialCongestionRetryFrequency'],_0x66cf('0xd8'))[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x469aa3['ContactId'],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3[_0x66cf('0xdb')]||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x469aa3[_0x66cf('0x121')]>=_0x21f053[_0x66cf('0x194')]-0x1){return!![];}else{hopperUtils[_0x66cf('0xeb')]({'active':![],'countnosuchnumberretry':_0x469aa3[_0x66cf('0x121')]+=0x1,'scheduledat':moment()[_0x66cf('0xd7')](_0x21f053['dialNoSuchNumberRetryFrequency'],_0x66cf('0xd8'))['format'](_0x66cf('0xbd')),'ContactId':_0x469aa3[_0x66cf('0xd9')],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3[_0x66cf('0xdb')]||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x195')));}break;case 0xa:if(_0x469aa3[_0x66cf('0xcf')]>=_0x21f053[_0x66cf('0xd5')]-0x1){return!![];}hopperUtils[_0x66cf('0xeb')]({'active':![],'countdropretry':_0x469aa3[_0x66cf('0xcf')]+=0x1,'scheduledat':moment()['add'](_0x21f053[_0x66cf('0xd1')],_0x66cf('0xd8'))['format'](_0x66cf('0xbd')),'ContactId':_0x469aa3['ContactId'],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3[_0x66cf('0xdb')]||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0xdd')));break;case 0xb:if(_0x469aa3['countabandonedretry']>=_0x21f053['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x66cf('0xeb')]({'active':![],'countabandonedretry':_0x469aa3[_0x66cf('0xe7')]+=0x1,'scheduledat':moment()[_0x66cf('0xd7')](_0x21f053[_0x66cf('0xe8')],_0x66cf('0xd8'))[_0x66cf('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x469aa3[_0x66cf('0xd9')],'ListId':_0x469aa3['ListId'],'VoiceQueueId':_0x469aa3[_0x66cf('0xdb')]||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0xec')));break;case 0x13:if(_0x469aa3[_0x66cf('0x11c')]>=_0x21f053['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x66cf('0xeb')]({'active':![],'countmachineretry':_0x469aa3['countmachineretry']+=0x1,'scheduledat':moment()[_0x66cf('0xd7')](_0x21f053['dialMachineRetryFrequency'],_0x66cf('0xd8'))[_0x66cf('0x44')](_0x66cf('0xbd')),'ContactId':_0x469aa3[_0x66cf('0xd9')],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3['VoiceQueueId']||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x128')));break;case 0x14:if(_0x469aa3[_0x66cf('0x122')]>=_0x21f053[_0x66cf('0x196')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x469aa3['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x66cf('0xd7')](_0x21f053['dialAgentRejectRetryFrequency'],_0x66cf('0xd8'))['format'](_0x66cf('0xbd')),'ContactId':_0x469aa3[_0x66cf('0xd9')],'ListId':_0x469aa3[_0x66cf('0xda')],'VoiceQueueId':_0x469aa3['VoiceQueueId']||undefined,'CampaignId':_0x469aa3[_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch(_0x66cf('0x197')));break;default:return!![];}};Dialer[_0x66cf('0x18')][_0x66cf('0x198')]=function(_0x6636da,_0x4b3fbf,_0x57555f){var _0x52004c=this;var _0x333bff=new History(_0x6636da);var _0x350894=![];var _0x50dad7;var _0x5aeea2;return new Promise(function(_0x2e1c92,_0x511caa){if(_[_0x66cf('0x3f')](_0x4b3fbf)&&typeof _0x4b3fbf!=='object'){return _0x511caa(msgResponse(_0x66cf('0x199'),_0x66cf('0x8e'),'entity\x20is\x20undefine'));}if(_[_0x66cf('0x3f')](_0x57555f)&&typeof _0x57555f!==_0x66cf('0x15b')){return _0x511caa(msgResponse(_0x66cf('0x199'),_0x66cf('0x8e'),_0x66cf('0x19a')));}hopperUtils['verifyAdditionalPhones'](_0x333bff,_0x57555f[_0x66cf('0xc1')],_0x4b3fbf)['then'](function(_0x58ab24){if(_0x58ab24[_0x66cf('0xd4')]==0x1)_0x350894=!![];switch(_0x57555f[_0x66cf('0xc1')]){case'0':_0x4b3fbf[_0x66cf('0x19b')]+=0x1;_0x333bff[_0x66cf('0xcd')]=0x0;_0x333bff[_0x66cf('0xde')]=_0x66cf('0x19c');_0x333bff[_0x66cf('0x121')]+=0x1;_0x333bff[_0x66cf('0xd0')]+=0x1;ami['emit'](_0x66cf('0x19d'),ut['buildObj'](_0x6636da,_0x66cf('0x19e')));_0x50dad7=_0x4b3fbf[_0x66cf('0x19f')];_0x5aeea2=_0x4b3fbf[_0x66cf('0xd2')];hopperUtils[_0x66cf('0xe3')](_0x333bff)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x11d')));if(_0x52004c[_0x66cf('0x1a0')](0x0,_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff['countnosuchnumberretry']>=_0x4b3fbf[_0x66cf('0x194')]){_0x52004c[_0x66cf('0x12c')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1a1'));}else{_0x52004c[_0x66cf('0x124')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1a1'));}}break;case'3':_0x4b3fbf[_0x66cf('0x1a2')]+=0x1;_0x333bff[_0x66cf('0xcd')]=0x3;_0x333bff[_0x66cf('0xde')]=_0x66cf('0x1a3');_0x333bff[_0x66cf('0x120')]+=0x1;_0x333bff[_0x66cf('0xd0')]+=0x1;var _0x1dab8f=ut[_0x66cf('0x1a4')](_0x6636da,_0x4b3fbf);ami['emit'](_0x66cf('0x1a5'),_0x1dab8f);_0x50dad7=_0x4b3fbf[_0x66cf('0x18e')];_0x5aeea2=_0x4b3fbf[_0x66cf('0xd2')];hopperUtils[_0x66cf('0xe3')](_0x333bff)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x1a6')));if(_0x52004c['checkRetriveMax'](0x3,_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff[_0x66cf('0x120')]>=_0x4b3fbf[_0x66cf('0x18d')]){_0x52004c['createStateFinal'](_0x333bff,_0x2e1c92,_0x511caa,'reason\x203\x20ringing\x20no\x20answer');}else{_0x52004c[_0x66cf('0x124')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1a7'));}}break;case'5':_0x4b3fbf[_0x66cf('0x1a8')]+=0x1;_0x333bff['state']=0x5;_0x333bff[_0x66cf('0xde')]=_0x66cf('0x1a9');_0x333bff['countbusyretry']+=0x1;_0x333bff[_0x66cf('0xd0')]+=0x1;ami[_0x66cf('0x116')]('custom:agentbusy',ut[_0x66cf('0x118')](_0x6636da,_0x66cf('0x1aa')));_0x50dad7=_0x4b3fbf[_0x66cf('0x191')];_0x5aeea2=_0x4b3fbf[_0x66cf('0xd2')];hopperUtils['createHistory'](_0x333bff)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x1ab')));if(_0x52004c[_0x66cf('0x1a0')](0x5,_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff[_0x66cf('0x11e')]>=_0x4b3fbf[_0x66cf('0x190')]){_0x52004c[_0x66cf('0x12c')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1ac'));}else{_0x52004c['stateGlobal'](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1ac'));}}break;case'8':_0x4b3fbf[_0x66cf('0x1ad')]+=0x1;_0x333bff[_0x66cf('0xcd')]=0x8;_0x333bff[_0x66cf('0xde')]=_0x66cf('0x1ae');_0x333bff['countcongestionretry']+=0x1;_0x333bff[_0x66cf('0xd0')]+=0x1;_0x50dad7=_0x4b3fbf[_0x66cf('0x1af')];_0x5aeea2=_0x4b3fbf[_0x66cf('0xd2')];ami[_0x66cf('0x116')](_0x66cf('0x1b0'),ut[_0x66cf('0x118')](_0x6636da,_0x66cf('0x1b1')));hopperUtils['createHistory'](_0x333bff)[_0x66cf('0x99')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x52004c[_0x66cf('0x1a0')](0x8,_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff['countcongestionretry']>=_0x4b3fbf[_0x66cf('0x193')]){_0x52004c[_0x66cf('0x12c')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1b2'));}else{_0x52004c[_0x66cf('0x124')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1b2'));}}break;case'11':_0x4b3fbf['outboundAbandonedCallsDay']+=0x1;_0x333bff[_0x66cf('0xcd')]=0xb;_0x333bff[_0x66cf('0xde')]='Abandoned';_0x333bff[_0x66cf('0xe7')]+=0x1;_0x333bff['countglobal']+=0x1;_0x50dad7=_0x4b3fbf[_0x66cf('0xe8')];_0x5aeea2=_0x4b3fbf[_0x66cf('0xd2')];hopperUtils[_0x66cf('0xe3')](_0x333bff)[_0x66cf('0x99')](loggerCatch(_0x66cf('0xee')));if(_0x52004c[_0x66cf('0x1a0')](0xb,_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff[_0x66cf('0xe7')]>=_0x4b3fbf[_0x66cf('0xea')]){_0x52004c[_0x66cf('0x12c')](_0x333bff,_0x2e1c92,_0x511caa,'reason\x2011\x20abandoned');}else{_0x52004c[_0x66cf('0x124')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1b3'));}}break;case'20':_0x4b3fbf[_0x66cf('0x1b4')]+=0x1;_0x333bff[_0x66cf('0xcd')]=0x14;_0x333bff[_0x66cf('0xde')]=_0x66cf('0x1b5');_0x333bff[_0x66cf('0x122')]+=0x1;_0x333bff[_0x66cf('0xd0')]+=0x1;_0x50dad7=_0x4b3fbf[_0x66cf('0x1b6')];_0x5aeea2=_0x4b3fbf['callAdditionalPhoneAfterMin'];ami[_0x66cf('0x116')]('custom:agentreject',ut[_0x66cf('0x118')](_0x6636da,_0x66cf('0x1b7')));hopperUtils[_0x66cf('0xe3')](_0x333bff)[_0x66cf('0x99')](loggerCatch(_0x66cf('0x1b8')));if(_0x52004c[_0x66cf('0x1a0')](0x14,_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff[_0x66cf('0x122')]>=_0x4b3fbf[_0x66cf('0x196')]){_0x52004c[_0x66cf('0x12c')](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1b9'));}else{_0x52004c['stateGlobal'](_0x333bff,_0x2e1c92,_0x511caa,_0x66cf('0x1b9'));}}break;default:_0x4b3fbf[_0x66cf('0x133')]+=0x1;_0x333bff[_0x66cf('0xcd')]=0xc;_0x333bff[_0x66cf('0xde')]=_0x57555f[_0x66cf('0xc1')];_0x50dad7=_0x4b3fbf[_0x66cf('0x1b6')];_0x5aeea2=_0x4b3fbf[_0x66cf('0xd2')];hopperUtils[_0x66cf('0xe3')](_0x333bff)['catch'](loggerCatch(_0x66cf('0x1ba')));if(_0x52004c[_0x66cf('0x1a0')](_0x57555f['reason'],_0x6636da,_0x4b3fbf)&&!_0x350894){if(_0x333bff['countbusyretry']+_0x333bff['countcongestionretry']+_0x333bff['countnoanswerretry']+_0x333bff[_0x66cf('0x121')]+_0x333bff['countdropretry']+_0x333bff[_0x66cf('0xe7')]+_0x333bff[_0x66cf('0x11c')]+_0x333bff['countagentrejectretry']>=_0x4b3fbf['dialGlobalMaxRetry']){_0x52004c[_0x66cf('0x124')](_0x333bff,_0x2e1c92,_0x511caa,_0x57555f[_0x66cf('0xc1')]);}else{_0x52004c[_0x66cf('0x12c')](_0x333bff,_0x2e1c92,_0x511caa,_0x57555f[_0x66cf('0xc1')]);}}}})[_0x66cf('0x3d')](function(){if(_0x350894){hopperUtils['swapAdditionalPhones'](_0x333bff,_0x50dad7,_0x5aeea2)[_0x66cf('0x3d')](function(){return _0x2e1c92(0x1);});}});});};Dialer[_0x66cf('0x18')][_0x66cf('0x124')]=function(_0x15bea9,_0x279ab1,_0x5d133e,_0xd26878){var _0x32494b=new Final(_0x15bea9);_0x32494b[_0x66cf('0xcd')]=0xf;_0x32494b['statedesc']=_0x66cf('0x1bb');this['createStateFinal'](_0x32494b,_0x279ab1,_0x5d133e,_0xd26878);};Dialer['prototype']['createStateFinal']=function(_0x14fa67,_0x47fdbf,_0x32dfee,_0x442413){hopperUtils['moveContactManagedDialer'](_0x14fa67)[_0x66cf('0x3d')](function(){return _0x47fdbf(msgResponse(_0x66cf('0x199'),'Success',_0x442413));})[_0x66cf('0x99')](function(){return _0x32dfee(msgResponse(_0x66cf('0x1bc'),'Failure',_0x66cf('0x1bd')));});};Dialer[_0x66cf('0x18')]['predictive']=function(_0x3a252f){var _0x4f8ec9=_0x3a252f['dialPredictiveOptimizationPercentage']/0x64;var _0x340a4c=_0x3a252f[_0x66cf('0xcb')]/(_0x3a252f[_0x66cf('0xcb')]+_0x3a252f[_0x66cf('0xc0')]);var _0x42466c=Math[_0x66cf('0x1be')](_0x3a252f[_0x66cf('0x1bf')]*(_0x3a252f[_0x66cf('0x1c0')]/0x64));var _0x1c47f0=Math[_0x66cf('0x1be')](_0x3a252f[_0x66cf('0x1bf')]*(_0x3a252f[_0x66cf('0x1c1')]/0x64));var _0x3b6077=_0x3a252f[_0x66cf('0x13b')]+_0x3a252f['talking'];var _0x4b109d=Math[_0x66cf('0x1c2')](_0x3a252f[_0x66cf('0x57')]*_0x3a252f[_0x66cf('0x5b')]*_0x3a252f[_0x66cf('0x1c3')]*_0x3a252f['predictiveIntervalMultiplicativeFactor']);if(_[_0x66cf('0x3f')](_0x3a252f[_0x66cf('0x25')])){if(!_['isUndefined'](_0x3a252f['startPredictive'])){_0x3a252f[_0x66cf('0x24')]=undefined;loggerPredictive[_0x66cf('0x61')](_0x66cf('0x1c4'),_0x66cf('0x1c5'));}if(!_[_0x66cf('0x3f')](_0x3a252f['handlePredictive'])){loggerPredictive[_0x66cf('0x61')]('[startMethodPredictive][StartProgressive]',_0x66cf('0x1c6'));clearInterval(_0x3a252f[_0x66cf('0x60')]);_0x3a252f[_0x66cf('0x60')]=undefined;}_0x3a252f[_0x66cf('0x25')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));loggerPredictive[_0x66cf('0x47')](_0x3a252f[_0x66cf('0x5e')],'collection\x20data\x20in\x20progressive\x20at',_0x3a252f[_0x66cf('0x25')]);this[_0x66cf('0xb1')](_0x3a252f,0x1);}else if(ifInterval(_0x3a252f[_0x66cf('0x1c7')],_0x3a252f[_0x66cf('0x25')])){this['handlePower'](_0x3a252f,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x3a252f[_0x66cf('0x25')],_0x3a252f['name']);_0x3a252f[_0x66cf('0x57')]=0x0;_0x3a252f[_0x66cf('0xcc')]=0x0;}else if(_0x4f8ec9<_0x340a4c&&_0x3a252f[_0x66cf('0x1c8')]===_0x66cf('0x1c9')){clearPredictiveAttributes(_0x3a252f);loggerPredictive[_0x66cf('0x47')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x66cf('0x1ca'),_0x340a4c,'startProgressive',_0x3a252f['name']);}else if(_0x4b109d<_0x3a252f['predictiveIntervalErlangCallsDroppedCalls']&&_0x3a252f[_0x66cf('0x1c8')]==='dropRate'){clearPredictiveAttributes(_0x3a252f);loggerPredictive['info'](_0x66cf('0x1cb'),'Max\x20Drop\x20',_0x4b109d,'Drop\x20in\x20this\x20interval',_0x3a252f[_0x66cf('0xcc')],_0x66cf('0x25'),_0x3a252f[_0x66cf('0x5e')]);}else if(!ifInterval(_0x3a252f[_0x66cf('0x1c7')],_0x3a252f[_0x66cf('0x25')])&&_[_0x66cf('0x3f')](_0x3a252f[_0x66cf('0x24')])&&!_[_0x66cf('0x3f')](_0x3a252f[_0x66cf('0x25')])){_0x3a252f[_0x66cf('0x24')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));loggerPredictive['info'](_0x3a252f['name'],'started\x20in\x20predictive\x20at',_0x3a252f[_0x66cf('0x24')]);hopperUtils['avgHandleTime'](_0x3a252f[_0x66cf('0x1c7')])['then'](this[_0x66cf('0x1cc')](_0x3a252f))['then'](mergeDataErlangB(_0x3a252f))[_0x66cf('0x3d')](this[_0x66cf('0x1cd')](_0x3a252f))[_0x66cf('0x99')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3a252f));}else if(!ifInterval(_0x3a252f[_0x66cf('0x1c7')],_0x3a252f[_0x66cf('0x24')])){_0x3a252f[_0x66cf('0xcc')]=0x0;_0x3a252f[_0x66cf('0x24')]=moment()[_0x66cf('0x44')](_0x66cf('0xbd'));loggerPredictive['info'](_0x3a252f[_0x66cf('0x5e')],_0x66cf('0x1ce'),_0x3a252f[_0x66cf('0x24')]);clearInterval(_0x3a252f[_0x66cf('0x60')]);_0x3a252f[_0x66cf('0x60')]=undefined;hopperUtils[_0x66cf('0x1cf')](_0x3a252f['dialPredictiveInterval'])[_0x66cf('0x3d')](this[_0x66cf('0x1cc')](_0x3a252f))[_0x66cf('0x3d')](mergeDataErlangB(_0x3a252f))[_0x66cf('0x3d')](this[_0x66cf('0x1cd')](_0x3a252f))[_0x66cf('0x99')](loggerCatchPredictive(_0x66cf('0x1d0'),_0x3a252f));}else if(_0x3a252f[_0x66cf('0x1bf')]&&_0x3b6077<_0x3a252f[_0x66cf('0x1bf')]-_0x1c47f0){clearPredictiveAttributes(_0x3a252f);loggerPredictive[_0x66cf('0x47')](_0x3a252f[_0x66cf('0x5e')],_0x66cf('0x1d1'),_0x3b6077,_0x66cf('0x1d2'),_0x3a252f[_0x66cf('0x1bf')],'-',_0x1c47f0,'=',_0x3a252f['predictiveIntervalAvailable']-_0x1c47f0,')');}else if(_0x3a252f[_0x66cf('0x1bf')]&&_0x3b6077>_0x3a252f[_0x66cf('0x1bf')]+_0x42466c){clearPredictiveAttributes(_0x3a252f);loggerPredictive['info'](_0x3a252f[_0x66cf('0x5e')],_0x66cf('0x1d1'),_0x3b6077,')\x20are\x20more\x20than\x20threshold\x20(',_0x3a252f['predictiveIntervalAvailable'],'+',_0x42466c,'=',_0x3a252f[_0x66cf('0x1bf')]+_0x42466c,')');}};Dialer[_0x66cf('0x18')][_0x66cf('0x1cc')]=function(_0xdd8598){var _0x5ee89b=this;return function(_0x40e203){return new Promise(function(_0x2e1f12,_0x5a01ef){_['merge'](_0xdd8598,_0x40e203[0x0]);if(checkGetDataPredictive(_0x40e203[0x0])){var _0x97f9de=_0xdd8598[_0x66cf('0x1bf')]=_0xdd8598[_0x66cf('0x13d')]+_0xdd8598[_0x66cf('0x13b')];var _0x1c6088=_0xdd8598[_0x66cf('0x1c7')]*0x3c;var _0x18b815=_0x40e203[0x0][_0x66cf('0x52')]+_0x40e203[0x0][_0x66cf('0x50')];var _0x4c851f=(_0x40e203[0x0]['predictiveIntervalAnsweredCalls']+_0x40e203[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x40e203[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x40e203[0x0][_0x66cf('0x4a')];_0xdd8598[_0x66cf('0x1c3')]=_0x4c851f>0x0?_0x4c851f:0x1;switch(_0xdd8598[_0x66cf('0x1c8')]){case _0x66cf('0x1c9'):var _0x16fbc4=_0xdd8598[_0x66cf('0x1d3')]/0x64;return _0x5ee89b['abandonmentRate'](_0x97f9de,_0x1c6088,_0x18b815,_0x4c851f,_0x16fbc4)['then'](function(_0x1b01e1){return _0x2e1f12(_0x1b01e1);});case _0x66cf('0x1d4'):var _0x37f123=_0xdd8598['dialPredictiveOptimizationPercentage']/0x64;return _0x5ee89b['busyFactor'](_0x97f9de,_0x1c6088,_0x18b815,_0x4c851f,_0x37f123)[_0x66cf('0x3d')](function(_0x1b1f37){return _0x2e1f12(_0x1b1f37);});default:return _0x5a01ef(msgResponse(_0x66cf('0x1d5'),_0x66cf('0x8e'),_0x66cf('0x1d6')));}}else{return _0x5a01ef(msgResponse(_0x66cf('0x1d5'),_0x66cf('0x8e'),_0x66cf('0x1d7')));}});};};Dialer[_0x66cf('0x18')][_0x66cf('0x1d8')]=function(_0x25d34f){var _0x42613f=this;return function(_0x5a6360){return new Promise(function(_0x49774b,_0x11d026){_[_0x66cf('0xf9')](_0x25d34f,_0x5a6360[0x0]);if(checkGetDataPredictive(_0x5a6360[0x0])){loggerPredictive[_0x66cf('0x47')](JSON['stringify'](_0x5a6360[0x0]));if(_0x25d34f[_0x66cf('0x1c8')]==='dropRate'){return _0x42613f['getVoiceQueueRtPauses'](_0x25d34f['id'])[_0x66cf('0x3d')](function(_0x115a11){var _0x51724d=_0x25d34f[_0x66cf('0x1d9')]-_0x115a11[0x0][_0x66cf('0x1da')];var _0x150f2a=_0x25d34f[_0x66cf('0x1c7')]*0x3c;var _0x32f2be=_0x5a6360[0x0][_0x66cf('0x52')]+_0x5a6360[0x0]['predictiveIntervalAvgHoldtime'];var _0x2ba514=(_0x5a6360[0x0][_0x66cf('0x4b')]+_0x5a6360[0x0][_0x66cf('0x4d')]+_0x5a6360[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5a6360[0x0][_0x66cf('0x4a')];var _0x37c6a0=_0x25d34f[_0x66cf('0x1d3')]/0x64;_0x25d34f['predictiveIntervalPauses']=_0x115a11[0x0][_0x66cf('0x1da')]||0x0;_0x25d34f[_0x66cf('0x1c3')]=_0x2ba514>0x0?_0x2ba514:0x1;return _0x42613f['abandonmentRate'](_0x51724d,_0x150f2a,_0x32f2be,_0x2ba514,_0x37c6a0);})['then'](function(_0x1fd79a){return _0x49774b(_0x1fd79a);})[_0x66cf('0x99')](function(_0x2ed9a2){return _0x11d026(msgResponse(_0x66cf('0x1db'),_0x66cf('0x8e'),JSON['stringify'](_0x2ed9a2)));});}if(_0x25d34f['dialPredictiveOptimization']===_0x66cf('0x1d4')){return _0x42613f[_0x66cf('0x14c')](_0x25d34f['id'])[_0x66cf('0x3d')](function(_0x2ca7cf){var _0xd72a13=_0x25d34f['loggedIn']-_0x2ca7cf[0x0][_0x66cf('0x1da')];var _0x1e4d74=_0x25d34f[_0x66cf('0x1c7')]*0x3c;var _0x5c2bd6=_0x5a6360[0x0]['predictiveIntervalAvgTalktime']+_0x5a6360[0x0][_0x66cf('0x50')];var _0x5dca82=(_0x5a6360[0x0][_0x66cf('0x4b')]+_0x5a6360[0x0][_0x66cf('0x4d')]+_0x5a6360[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5a6360[0x0][_0x66cf('0x4a')];var _0x42b86d=_0x25d34f['dialPredictiveOptimizationPercentage']/0x64;_0x25d34f[_0x66cf('0x1dc')]=_0x2ca7cf[0x0][_0x66cf('0x1da')]||0x0;_0x25d34f[_0x66cf('0x1c3')]=_0x5dca82>0x0?_0x5dca82:0x1;return _0x42613f[_0x66cf('0x1dd')](_0xd72a13,_0x1e4d74,_0x5c2bd6,_0x5dca82,_0x42b86d);})[_0x66cf('0x3d')](function(_0x5acbee){return _0x49774b(_0x5acbee);})[_0x66cf('0x99')](function(_0x1c26ce){return _0x11d026(msgResponse('[CatchErlangB]',_0x66cf('0x8e'),JSON[_0x66cf('0xa4')](_0x1c26ce)));});}}else{return _0x11d026(msgResponse(_0x66cf('0x1d5'),_0x66cf('0x8e'),_0x66cf('0x1d7')));}});};};Dialer[_0x66cf('0x18')][_0x66cf('0x1cd')]=function(_0x19ba67){var _0x603d06=this;return function(){var _0x9d3d7=0x0;var _0x31122c=Math[_0x66cf('0x1c2')](_0x19ba67['erlangCallToSecond']*0x3e8);if(_0x31122c>0x0){_0x31122c=_0x31122c<0x64?0x64:_0x31122c;loggerPredictive['info'](_0x19ba67[_0x66cf('0x5e')],_0x66cf('0x1de'),_0x31122c,_0x66cf('0x1df'));_0x19ba67[_0x66cf('0x60')]=setInterval(function(){_0x603d06['handlePredictive'](_0x19ba67);loggerPredictiveCalls['info']('[handlePredictive]',_0x9d3d7+=0x1);},_0x31122c);}else{loggerPredictive[_0x66cf('0x47')](_0x19ba67['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x66cf('0x18')][_0x66cf('0x1e0')]=function(_0x36f6c2,_0x1d29bb){var _0x593863=this;return function(_0x13adef){if(_['isEmpty'](_0x13adef)){if(_[_0x66cf('0xf4')](_0x1d29bb[_0x66cf('0x153')])||!_0x1d29bb[_0x66cf('0x1e1')]){if(_0x36f6c2[_0x66cf('0xae')]===_0x66cf('0x7')){_0x36f6c2[_0x66cf('0x6d')]=_['isUndefined'](_0x36f6c2[_0x66cf('0x6d')])?!![]:_0x36f6c2[_0x66cf('0x6d')];var _0x5363e2=uuid['v4']();_0x593863[_0x66cf('0x22')][_0x5363e2]=new Action(_0x36f6c2,_0x1d29bb,_0x5363e2);loggerBooked[_0x66cf('0x47')]('[booked][checkContactBlack]',_0x5363e2,_0x66cf('0x1e2'),JSON[_0x66cf('0xa4')](_0x36f6c2[_0x66cf('0x6d')]),_0x66cf('0x1e3'),_0x36f6c2['name']);if(_0x36f6c2['queueStatusComplete']){_0x36f6c2[_0x66cf('0x6d')]=![];_0x593863[_0x66cf('0x27')][_0x593863[_0x66cf('0x22')][_0x5363e2][_0x66cf('0xb9')]]=[];ami[_0x66cf('0x9a')]({'actionid':_0x5363e2,'action':'queuestatus','queue':_0x36f6c2[_0x66cf('0x5e')]})[_0x66cf('0x99')](function(){_0x593863[_0x66cf('0xc8')](_0x36f6c2);hopperUtils[_0x66cf('0xeb')]({'active':![],'ContactId':_0x593863[_0x66cf('0x22')][_0x5363e2][_0x66cf('0xd9')],'ListId':_0x593863[_0x66cf('0x22')][_0x5363e2][_0x66cf('0xda')],'VoiceQueueId':_0x593863[_0x66cf('0x22')][_0x5363e2][_0x66cf('0xdb')]||undefined,'CampaignId':_0x593863[_0x66cf('0x22')][_0x5363e2]['CampaignId']||undefined})['catch'](loggerCatch(_0x66cf('0x1e4')));delete _0x593863[_0x66cf('0x22')][_0x5363e2];});}else{loggerBooked[_0x66cf('0x47')](_0x66cf('0x1e5'),JSON[_0x66cf('0xa4')](_0x36f6c2['queueStatusComplete']),_0x66cf('0x1e3'),_0x36f6c2[_0x66cf('0x5e')]);_0x593863[_0x66cf('0xc8')](_0x36f6c2);hopperUtils[_0x66cf('0xeb')]({'active':![],'ContactId':_0x593863[_0x66cf('0x22')][_0x5363e2][_0x66cf('0xd9')],'ListId':_0x593863['actions'][_0x5363e2][_0x66cf('0xda')],'VoiceQueueId':_0x593863[_0x66cf('0x22')][_0x5363e2]['VoiceQueueId']||undefined,'CampaignId':_0x593863[_0x66cf('0x22')][_0x5363e2][_0x66cf('0xdc')]||undefined})[_0x66cf('0x99')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x593863[_0x66cf('0x22')][_0x5363e2];}}else{return _0x593863[_0x66cf('0x15a')](_0x36f6c2,_0x1d29bb);}}else{if(utils[_0x66cf('0x5d')](undefined,_0x1d29bb[_0x66cf('0x1e6')])<_0x36f6c2[_0x66cf('0x1e7')]*0x3c){if(_0x1d29bb[_0x66cf('0x147')]&&!_0x1d29bb['Agent'][_0x66cf('0x1e8')]){_0x593863[_0x66cf('0xfb')]['run'](_0x1d29bb['id'])[_0x66cf('0x1a')](function(){_0x593863[_0x66cf('0xc8')](_0x36f6c2);});}else{hopperUtils[_0x66cf('0x1e9')]({'active':![]},_0x1d29bb['id'],0x1)['finally'](function(){_0x593863['updateOriginated'](_0x36f6c2);});}}else{_0x36f6c2[_0x66cf('0x1ea')]+=0x1;_0x593863['updateOriginated'](_0x36f6c2);if(_0x36f6c2[_0x66cf('0x1eb')]){hopperUtils[_0x66cf('0xeb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1d29bb[_0x66cf('0xd9')],'ListId':_0x1d29bb[_0x66cf('0xda')],'VoiceQueueId':_0x1d29bb['VoiceQueueId']||undefined,'CampaignId':_0x1d29bb[_0x66cf('0xdc')]||undefined})['catch'](loggerCatch(_0x66cf('0x1ec')));hopperUtils[_0x66cf('0xe3')](createObjHistory(_0x36f6c2,_0x1d29bb,utils[_0x66cf('0x66')]['QUEUE_RECALL'],0x17,_0x66cf('0x1ed')))[_0x66cf('0x99')](loggerCatch(_0x66cf('0x1ee')));}else{_0x593863[_0x66cf('0x11a')](createObjHistory(_0x36f6c2,_0x1d29bb,utils[_0x66cf('0x66')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x66cf('0x1ef'),_0x66cf('0x1f0'));}}}}else{_0x36f6c2[_0x66cf('0x1f1')]+=0x1;_0x593863[_0x66cf('0x11a')](createObjHistory(_0x36f6c2,_0x1d29bb,utils[_0x66cf('0x66')]['BLACKLIST'],0xd,_0x66cf('0x1f2')),'[Originate][historyBlacklist]',_0x66cf('0x1f3'));throw _0x66cf('0x1f4');}};};Dialer['prototype'][_0x66cf('0x159')]=function(_0x541bfe){var _0x314fe4=this;var _0x5ba55f=_0x541bfe[_0x66cf('0x1f5')]-_0x541bfe['originated'];emitCampaignSummary(_0x541bfe);if(_0x5ba55f>0x0&&_0x541bfe[_0x66cf('0x64')]==0x0){if(_0x5ba55f>this[_0x66cf('0x20')]){_0x5ba55f=this[_0x66cf('0x20')];}_0x541bfe[_0x66cf('0x64')]=0x1;hopperUtils[_0x66cf('0x1f6')](_0x541bfe,_0x5ba55f)[_0x66cf('0x3d')](function(_0x39f8bf){_0x541bfe['temp']=0x0;if(_0x39f8bf){if(!utils[_0x66cf('0x1f7')](_0x39f8bf)){_0x541bfe[_0x66cf('0x6b')]=utils[_0x66cf('0x66')][_0x66cf('0x6a')];logger['info']('[getContactCampaign2][Empty]'+_0x541bfe['name']);}else{_0x541bfe[_0x66cf('0x79')]+=_0x39f8bf[_0x66cf('0x92')];_0x541bfe[_0x66cf('0x6b')]=utils[_0x66cf('0x66')][_0x66cf('0x1f8')];for(var _0x4fa95d=0x0;_0x4fa95d<_0x39f8bf['length'];_0x4fa95d+=0x1){_0x541bfe[_0x66cf('0x1f9')]+=0x1;if(_[_0x66cf('0xf4')](_0x39f8bf[_0x4fa95d])||_['isNil'](_0x39f8bf[_0x4fa95d][_0x66cf('0x1fa')])||_[_0x66cf('0xf4')](_0x39f8bf[_0x4fa95d]['phone'])){_0x314fe4[_0x66cf('0x151')](_0x66cf('0x1fb'),_0x541bfe,_0x39f8bf[_0x4fa95d]);}else{hopperUtils[_0x66cf('0x1fc')](_[_0x66cf('0x6e')](_0x39f8bf[_0x4fa95d],[_0x66cf('0xdc'),_0x66cf('0x15e')]))[_0x66cf('0x3d')](_0x314fe4[_0x66cf('0x1e0')](_0x541bfe,_0x39f8bf[_0x4fa95d]))['catch'](_0x314fe4[_0x66cf('0x150')](_0x66cf('0x1fd'),_0x541bfe));}}}}})[_0x66cf('0x99')](loggerGetContactDialer(_0x66cf('0x1fe'),_0x541bfe,_0x5ba55f));}};Dialer[_0x66cf('0x18')]['handlePower']=function(_0x1dcf6b,_0x1fe927){var _0x5d4c99=this;var _0x3ba702=[];if(_0x1fe927<0x1||_0x1dcf6b[_0x66cf('0xae')]===_0x66cf('0x7')){_0x1fe927=0x1;}var _0x34141c=Math['floor'](_0x1dcf6b[_0x66cf('0x13b')]*_0x1fe927)-_0x1dcf6b[_0x66cf('0x79')];if(_0x1dcf6b['dialLimitQueue']>0x0){var _0x4391db=_0x1dcf6b[_0x66cf('0x1ff')]-_0x1dcf6b[_0x66cf('0x79')]-_0x1dcf6b[_0x66cf('0x13d')]-_0x1dcf6b[_0x66cf('0x13e')];if(_0x34141c>_0x4391db){_0x34141c=_0x4391db;}}if(_0x34141c>0x0&&_0x1dcf6b[_0x66cf('0x64')]==0x0){if(_0x1dcf6b[_0x66cf('0xae')]==='booked'){_0x34141c=0x1;}if(_0x34141c>this['maxNumberOriginate']){_0x34141c=this[_0x66cf('0x20')];}for(var _0x2c3861 in this[_0x66cf('0x1e')]){if(typeof this[_0x66cf('0x1e')][_0x2c3861]!=='undefined'){if(this[_0x66cf('0x1e')][_0x2c3861]['state']===_0x66cf('0x200')&&this[_0x66cf('0x1e')][_0x2c3861]['status']===_0x66cf('0x81')){_0x3ba702[_0x66cf('0x93')](this[_0x66cf('0x1e')][_0x2c3861]['id']);}}}_0x1dcf6b[_0x66cf('0x64')]=0x1;hopperUtils['getContactDialer'](_0x1dcf6b,_0x3ba702,_0x34141c)[_0x66cf('0x3d')](function(_0x17ddaf){_0x1dcf6b[_0x66cf('0x64')]=0x0;if(_0x17ddaf){if(!utils['checkContactEmpty'](_0x17ddaf)){hopperUtils['countReScheduled'](_0x1dcf6b)['then'](sendMessageReschedule(_0x1dcf6b))['catch'](loggerCatch(_0x66cf('0x201')));}else{_0x1dcf6b[_0x66cf('0x79')]+=_0x17ddaf['length'];_0x1dcf6b['message']=_0x1dcf6b['dialMethod']===_0x66cf('0x7')?utils['CAMPAIGN_STATUS'][_0x66cf('0x13f')]:utils[_0x66cf('0x66')][_0x66cf('0x1f8')];for(var _0x32529f=0x0;_0x32529f<_0x17ddaf[_0x66cf('0x92')];_0x32529f+=0x1){if(_['isNil'](_0x17ddaf[_0x32529f])||_[_0x66cf('0xf4')](_0x17ddaf[_0x32529f]['Contact'])||_['isNil'](_0x17ddaf[_0x32529f]['phone'])){_0x5d4c99[_0x66cf('0x151')]('[actionOriginate]\x20',_0x1dcf6b,_0x17ddaf[_0x32529f]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x17ddaf[_0x32529f],[_0x66cf('0xdb'),_0x66cf('0x15e')]))[_0x66cf('0x3d')](_0x5d4c99['checkContactBlack'](_0x1dcf6b,_0x17ddaf[_0x32529f]))[_0x66cf('0x99')](_0x5d4c99[_0x66cf('0x150')](_0x66cf('0x1fb'),_0x1dcf6b));}}}}})['catch'](loggerGetContactDialer(_0x66cf('0x202'),_0x1dcf6b,_0x34141c));}};Dialer[_0x66cf('0x18')]['handlePredictive']=function(_0x23cea3){if(_0x23cea3['dialLimitQueue']>0x0){var _0xeec7=_0x23cea3[_0x66cf('0x1ff')]-_0x23cea3[_0x66cf('0x79')]-_0x23cea3[_0x66cf('0x13d')];if(_0xeec7>0x0&&_0x23cea3[_0x66cf('0x64')]==0x0){this[_0x66cf('0x203')](_0x23cea3);}else{loggerPredictiveCalls[_0x66cf('0x47')]('[handlePredictive][limitChannel]');}}else{this[_0x66cf('0x203')](_0x23cea3);}};Dialer['prototype'][_0x66cf('0x203')]=function(_0x1a2228){var _0x3f0914=this;var _0x1d72a0=[];_0x1a2228['originated']+=0x1;for(var _0x5c7c02 in this[_0x66cf('0x1e')]){if(typeof this[_0x66cf('0x1e')][_0x5c7c02]!==_0x66cf('0xa7')){if(this[_0x66cf('0x1e')][_0x5c7c02][_0x66cf('0xcd')]===_0x66cf('0x200')&&this['agents'][_0x5c7c02][_0x66cf('0x82')]===_0x66cf('0x81')){_0x1d72a0[_0x66cf('0x93')](this['agents'][_0x5c7c02]['id']);}}}_0x1a2228['temp']=0x1;return this[_0x66cf('0x204')](_0x1a2228['id'],_0x1d72a0,0x1,_0x1a2228[_0x66cf('0x205')],_0x1a2228)[_0x66cf('0x3d')](function(_0x163713){_0x1a2228[_0x66cf('0x64')]=0x1;if(_0x163713){if(!utils[_0x66cf('0x1f7')](_0x163713)){utils[_0x66cf('0x63')](_0x1a2228,0x1,0x0);return hopperUtils[_0x66cf('0x206')](_0x1a2228)[_0x66cf('0x3d')](sendMessageReschedule(_0x1a2228))['catch'](loggerCatch(_0x66cf('0x201')));}else{_0x1a2228[_0x66cf('0x6b')]=utils['CAMPAIGN_STATUS'][_0x66cf('0x1f8')];if(_['isNil'](_0x163713[0x0])||_['isNil'](_0x163713[0x0][_0x66cf('0x1fa')])||_[_0x66cf('0xf4')](_0x163713[0x0][_0x66cf('0x15e')])){_0x3f0914[_0x66cf('0x151')]('[actionOriginate]\x20',_0x1a2228,_0x163713[0x0]);}else{return hopperUtils[_0x66cf('0x207')](_['pick'](_0x163713[0x0],['VoiceQueueId','phone']))['then'](_0x3f0914[_0x66cf('0x1e0')](_0x1a2228,_0x163713[0x0]))[_0x66cf('0x99')](_0x3f0914[_0x66cf('0x150')]('[actionOriginatePredictive]\x20',_0x1a2228));}}}})[_0x66cf('0x99')](loggerGetContactDialer(_0x66cf('0x208'),_0x1a2228,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x219fa0,_0x4144ca,_0x27c393,_0x42eff0,_0x80a1fc,_0x5018f0){loggerPredictive[_0x66cf('0x47')](_0x66cf('0x209'));loggerPredictive[_0x66cf('0x47')](_0x66cf('0x20a'),_0x219fa0);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x20b'),_0x4144ca);loggerPredictive[_0x66cf('0x47')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x27c393);loggerPredictive['info'](_0x66cf('0x20c'),_0x42eff0);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x20d'),_0x80a1fc);loggerPredictive['info'](_0x66cf('0x53'));return new Promise(function(_0x3db61f,_0x54d7b5){if(_0x219fa0<=0x0||isNaN(_0x219fa0)){return _0x54d7b5(msgResponse(_0x66cf('0x20e'),'Error',_0x66cf('0x20f')+_0x219fa0));}if(_0x27c393<=0x0||isNaN(_0x27c393)){return _0x54d7b5(msgResponse(_0x66cf('0x20e'),'Error',_0x66cf('0x210')+_0x27c393));}if(_0x42eff0<=0x0||isNaN(_0x42eff0)){return _0x54d7b5(msgResponse(_0x66cf('0x20e'),_0x66cf('0xb8'),_0x66cf('0x211')+_0x42eff0));}if(_0x4144ca<=0x0||isNaN(_0x4144ca)){return _0x54d7b5(msgResponse('[abandonmentRate]',_0x66cf('0xb8'),_0x66cf('0x212')+_0x4144ca));}if(_0x80a1fc<=0x0||isNaN(_0x80a1fc)){return _0x54d7b5(msgResponse('[abandonmentRate]',_0x66cf('0xb8'),_0x66cf('0x213')+_0x80a1fc));}_0x5018f0=_0x5018f0||0x0;var _0x15e268=0x1/_0x27c393;var _0x3cbb28=0x0;var _0x44a402=0x0;var _0x29bbb0=0x0;var _0x278542=0x0;for(var _0x53f420=0x0;_0x29bbb0<_0x80a1fc;_0x53f420+=0x1){_0x44a402=_0x53f420/_0x4144ca;_0x3cbb28=(_0x42eff0*_0x44a402+_0x5018f0)/_0x15e268;_0x29bbb0=utils['erlangb'](_0x3cbb28,_0x219fa0);_0x278542=_0x3cbb28/_0x219fa0*(0x1-utils[_0x66cf('0x214')](_0x3cbb28,_0x219fa0));}return _0x3db61f({'erlangCalls':_0x53f420,'erlangCallToSecond':_0x4144ca/_0x53f420,'erlangAbandonmentRate':_0x29bbb0,'erlangBusyFactor':_0x278542});});};Dialer[_0x66cf('0x18')][_0x66cf('0x1dd')]=function(_0x24abbe,_0x5193d8,_0x5e700d,_0x5763a5,_0x335c5a,_0x1e6f18){loggerPredictive[_0x66cf('0x47')](_0x66cf('0x215'));loggerPredictive[_0x66cf('0x47')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24abbe);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x20b'),_0x5193d8);loggerPredictive['info'](_0x66cf('0x216'),_0x5e700d);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x20c'),_0x5763a5);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x335c5a);loggerPredictive[_0x66cf('0x47')](_0x66cf('0x53'));return new Promise(function(_0x16a6fd,_0x342bc7){if(_0x24abbe<=0x0||isNaN(_0x24abbe)){return _0x342bc7(msgResponse('[busyFactor]',_0x66cf('0xb8'),_0x66cf('0x20f')+_0x24abbe));}if(_0x5e700d<=0x0||isNaN(_0x5e700d)){return _0x342bc7(msgResponse('[busyFactor]',_0x66cf('0xb8'),'Ts\x20=\x20'+_0x5e700d));}if(_0x5763a5<=0x0||isNaN(_0x5763a5)){return _0x342bc7(msgResponse('[busyFactor]',_0x66cf('0xb8'),_0x66cf('0x211')+_0x5763a5));}if(_0x5193d8<=0x0||isNaN(_0x5193d8)){return _0x342bc7(msgResponse(_0x66cf('0x217'),_0x66cf('0xb8'),_0x66cf('0x212')+_0x5193d8));}if(_0x335c5a<=0x0||isNaN(_0x335c5a)){return _0x342bc7(msgResponse(_0x66cf('0x217'),_0x66cf('0xb8'),'Umin\x20=\x20'+_0x335c5a));}_0x1e6f18=_0x1e6f18||0x0;var _0x283384=0x1/_0x5e700d;var _0x11af05=0x0;var _0x299b46=0x0;var _0x22bbb8=0x0;var _0x50d6b8=0x0;for(var _0x4b3d81=0x0;_0x50d6b8<_0x335c5a;_0x4b3d81+=0x1){_0x299b46=_0x4b3d81/_0x5193d8;_0x11af05=(_0x5763a5*_0x299b46+_0x1e6f18)/_0x283384;_0x22bbb8=utils[_0x66cf('0x214')](_0x11af05,_0x24abbe);_0x50d6b8=_0x11af05/_0x24abbe*(0x1-utils['erlangb'](_0x11af05,_0x24abbe));}return _0x16a6fd({'erlangCalls':_0x4b3d81,'erlangCallToSecond':_0x5193d8/_0x4b3d81,'erlangAbandonmentRate':_0x22bbb8,'erlangBusyFactor':_0x50d6b8});});};module[_0x66cf('0x218')]=Dialer;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb18=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName'];(function(_0x731de5,_0x1e2bc2){var _0x29b95c=function(_0xe718de){while(--_0xe718de){_0x731de5['push'](_0x731de5['shift']());}};_0x29b95c(++_0x1e2bc2);}(_0xcb18,0x98));var _0x8cb1=function(_0x158ec1,_0x4a9fde){_0x158ec1=_0x158ec1-0x0;var _0x3bdf30=_0xcb18[_0x158ec1];return _0x3bdf30;};'use strict';var util=require(_0x8cb1('0x0'));var _=require(_0x8cb1('0x1'));var moment=require(_0x8cb1('0x2'));function checkNameSurname(_0x393b6a,_0x36198b,_0x16b4c0){var _0x428dd5='';if(!_[_0x8cb1('0x3')](_0x36198b)&&_0x8cb1('0x4')===typeof _0x36198b){_0x428dd5+=_0x36198b;}if(!_['isNil'](_0x16b4c0)&&_0x8cb1('0x4')===typeof _0x16b4c0){_0x428dd5+='\x20'+_0x16b4c0;}if(_0x428dd5!==''){return _0x428dd5;}return _0x393b6a;}function Action(_0x5f2eed,_0x2be72e,_0x414b8a){this[_0x8cb1('0x5')]=_0x5f2eed;this[_0x8cb1('0x6')]=_0x414b8a||undefined;this[_0x8cb1('0x7')]=checkNameSurname(_0x2be72e['Contact'][_0x8cb1('0x8')],_0x2be72e[_0x8cb1('0x9')]['firstName'],_0x2be72e['Contact'][_0x8cb1('0xa')]);this[_0x8cb1('0xb')]=_0x2be72e[_0x8cb1('0x8')];this[_0x8cb1('0xc')]=_0x5f2eed[_0x8cb1('0x7')];this['active']=_0x2be72e['active']||![];this[_0x8cb1('0xd')]=_0x5f2eed[_0x8cb1('0xd')];this['dialQueueTimeout']=_0x5f2eed[_0x8cb1('0xe')]||0x3;this[_0x8cb1('0xf')]=_0x2be72e[_0x8cb1('0xf')];this['countbusyretry']=_0x2be72e[_0x8cb1('0x10')];this[_0x8cb1('0x11')]=_0x2be72e[_0x8cb1('0x11')];this[_0x8cb1('0x12')]=_0x2be72e[_0x8cb1('0x12')];this['countnosuchnumberretry']=_0x2be72e[_0x8cb1('0x13')];this[_0x8cb1('0x14')]=_0x2be72e[_0x8cb1('0x14')];this[_0x8cb1('0x15')]=_0x2be72e['countabandonedretry'];this[_0x8cb1('0x16')]=_0x2be72e['countmachineretry'];this[_0x8cb1('0x17')]=_0x2be72e[_0x8cb1('0x17')];this[_0x8cb1('0x18')]=_0x2be72e[_0x8cb1('0x18')];this[_0x8cb1('0x19')]=_0x2be72e[_0x8cb1('0x19')];this['UserId']=_0x2be72e[_0x8cb1('0x1a')];this[_0x8cb1('0x1b')]=_0x2be72e['VoiceQueueId'];this[_0x8cb1('0x1c')]=_0x2be72e[_0x8cb1('0x1c')];this[_0x8cb1('0x1d')]=_0x2be72e['id'];this[_0x8cb1('0x1e')]=_0x2be72e[_0x8cb1('0x9')][_0x8cb1('0x1f')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8cb1('0x20')]=_0x2be72e[_0x8cb1('0x20')];this['callbackuniqueid']=_0x2be72e[_0x8cb1('0x21')];this['callbackat']=_0x2be72e[_0x8cb1('0x22')];this[_0x8cb1('0x23')]=_0x2be72e[_0x8cb1('0x23')];this[_0x8cb1('0x24')]='';this[_0x8cb1('0x25')]='';}Action[_0x8cb1('0x26')][_0x8cb1('0x27')]=function(){return util[_0x8cb1('0x28')](_0x8cb1('0x29'),this[_0x8cb1('0x7')],this[_0x8cb1('0x5')][_0x8cb1('0x2a')]>0x0?this[_0x8cb1('0xb')][_0x8cb1('0x2b')](this[_0x8cb1('0x5')]['dialCutDigit']):this['number']);};Action[_0x8cb1('0x26')][_0x8cb1('0x2c')]=function(){return this[_0x8cb1('0xc')];};module[_0x8cb1('0x2d')]=Action;
\ No newline at end of file
+var _0x469d=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','number','getQueue','exports','util','lodash','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x240a07,_0x2132bf){var _0x525aef=function(_0xad1ccf){while(--_0xad1ccf){_0x240a07['push'](_0x240a07['shift']());}};_0x525aef(++_0x2132bf);}(_0x469d,0x6e));var _0xd469=function(_0x531d7d,_0x501e86){_0x531d7d=_0x531d7d-0x0;var _0x5cd47f=_0x469d[_0x531d7d];return _0x5cd47f;};'use strict';var util=require(_0xd469('0x0'));var _=require(_0xd469('0x1'));var moment=require('moment');function checkNameSurname(_0x3f927a,_0x67780b,_0x42eecd){var _0x56f2db='';if(!_['isNil'](_0x67780b)&&_0xd469('0x2')===typeof _0x67780b){_0x56f2db+=_0x67780b;}if(!_[_0xd469('0x3')](_0x42eecd)&&_0xd469('0x2')===typeof _0x42eecd){_0x56f2db+='\x20'+_0x42eecd;}if(_0x56f2db!==''){return _0x56f2db;}return _0x3f927a;}function Action(_0x585559,_0x1de56c,_0x57f882){this[_0xd469('0x4')]=_0x585559;this[_0xd469('0x5')]=_0x57f882||undefined;this[_0xd469('0x6')]=checkNameSurname(_0x1de56c[_0xd469('0x7')][_0xd469('0x8')],_0x1de56c[_0xd469('0x7')][_0xd469('0x9')],_0x1de56c[_0xd469('0x7')][_0xd469('0xa')]);this['number']=_0x1de56c[_0xd469('0x8')];this[_0xd469('0xb')]=_0x585559['name'];this[_0xd469('0xc')]=_0x1de56c['active']||![];this[_0xd469('0xd')]=_0x585559[_0xd469('0xd')];this['dialQueueTimeout']=_0x585559[_0xd469('0xe')]||0x3;this[_0xd469('0xf')]=_0x1de56c['scheduledat'];this[_0xd469('0x10')]=_0x1de56c[_0xd469('0x10')];this[_0xd469('0x11')]=_0x1de56c['countcongestionretry'];this[_0xd469('0x12')]=_0x1de56c[_0xd469('0x12')];this[_0xd469('0x13')]=_0x1de56c[_0xd469('0x13')];this[_0xd469('0x14')]=_0x1de56c[_0xd469('0x14')];this[_0xd469('0x15')]=_0x1de56c[_0xd469('0x15')];this[_0xd469('0x16')]=_0x1de56c['countmachineretry'];this[_0xd469('0x17')]=_0x1de56c['countagentrejectretry'];this[_0xd469('0x18')]=_0x1de56c[_0xd469('0x18')];this[_0xd469('0x19')]=_0x1de56c[_0xd469('0x19')];this[_0xd469('0x1a')]=_0x1de56c[_0xd469('0x1a')];this[_0xd469('0x1b')]=_0x1de56c[_0xd469('0x1b')];this[_0xd469('0x1c')]=_0x1de56c[_0xd469('0x1c')];this[_0xd469('0x1d')]=_0x1de56c['id'];this[_0xd469('0x1e')]=_0x1de56c[_0xd469('0x7')]['firstName']||'';this[_0xd469('0x1f')]=moment()[_0xd469('0x20')](_0xd469('0x21'));this['callback']=_0x1de56c['callback'];this[_0xd469('0x22')]=_0x1de56c[_0xd469('0x22')];this[_0xd469('0x23')]=_0x1de56c['callbackat'];this['recallme']=_0x1de56c[_0xd469('0x24')];this[_0xd469('0x25')]='';this['originatecalleridname']='';}Action[_0xd469('0x26')][_0xd469('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xd469('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xd469('0x28')]['substring'](this[_0xd469('0x4')]['dialCutDigit']):this['number']);};Action[_0xd469('0x26')][_0xd469('0x29')]=function(){return this[_0xd469('0xb')];};module[_0xd469('0x2a')]=Action;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e5b=['calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x6e5b,0x178));var _0xb6e5=function(_0x504282,_0x56712d){_0x504282=_0x504282-0x0;var _0x25a59f=_0x6e5b[_0x504282];return _0x25a59f;};'use strict';var moment=require(_0xb6e5('0x0'));var utils=require(_0xb6e5('0x1'));function AgentComplete(_0x3e09be,_0x5f5bbd){this[_0xb6e5('0x2')]=0x4;this[_0xb6e5('0x3')]=_0xb6e5('0x4');this[_0xb6e5('0x5')]=_0x3e09be[_0xb6e5('0x5')];this[_0xb6e5('0x6')]=_0x3e09be[_0xb6e5('0x6')];this['campaigntype']=_0x3e09be['type']===_0xb6e5('0x7')?_0xb6e5('0x8'):_0x3e09be['type'];this[_0xb6e5('0x9')]=_0x3e09be[_0xb6e5('0x9')];this[_0xb6e5('0xa')]=_0x3e09be['countcongestionretry'];this[_0xb6e5('0xb')]=_0x3e09be['countnoanswerretry'];this[_0xb6e5('0xc')]=_0x3e09be[_0xb6e5('0x9')]+_0x3e09be[_0xb6e5('0xa')]+_0x3e09be['countnoanswerretry']+_0x3e09be[_0xb6e5('0xd')]+_0x3e09be[_0xb6e5('0xe')]+_0x3e09be[_0xb6e5('0xf')]+_0x3e09be[_0xb6e5('0x10')]+_0x3e09be[_0xb6e5('0x11')];this['countnosuchnumberretry']=_0x3e09be[_0xb6e5('0xd')];this[_0xb6e5('0xe')]=_0x3e09be[_0xb6e5('0xe')];this['countabandonedretry']=_0x3e09be[_0xb6e5('0xf')];this[_0xb6e5('0x10')]=_0x3e09be[_0xb6e5('0x10')];this[_0xb6e5('0x11')]=_0x3e09be[_0xb6e5('0x11')];this[_0xb6e5('0x12')]=_0x5f5bbd[_0xb6e5('0x12')];this['calleridname']=_0x3e09be[_0xb6e5('0x13')];this[_0xb6e5('0x14')]=_0x3e09be[_0xb6e5('0x15')];this[_0xb6e5('0x16')]=_0x3e09be[_0xb6e5('0x16')];this[_0xb6e5('0x17')]=_0x3e09be[_0xb6e5('0x17')];this[_0xb6e5('0x18')]=_0x3e09be[_0xb6e5('0x18')];this[_0xb6e5('0x19')]=moment()[_0xb6e5('0x1a')](_0xb6e5('0x1b'));this[_0xb6e5('0x1c')]=utils[_0xb6e5('0x1d')](_0x3e09be[_0xb6e5('0x17')],_0x3e09be['starttime']);this['holdtime']=utils['getSeconds'](_0x3e09be[_0xb6e5('0x18')],_0x3e09be['responsetime']);this['talktime']=utils[_0xb6e5('0x1d')](this[_0xb6e5('0x19')],_0x3e09be[_0xb6e5('0x18')]);this[_0xb6e5('0x8')]=_0x5f5bbd[_0xb6e5('0x8')];this[_0xb6e5('0x1e')]=_0x5f5bbd['membername'];this[_0xb6e5('0x1f')]=_0x5f5bbd['reason'];this[_0xb6e5('0x20')]=_0x3e09be[_0xb6e5('0x20')];this[_0xb6e5('0x21')]=_0x3e09be[_0xb6e5('0x21')];this[_0xb6e5('0x22')]=_0x3e09be['callbackat'];this[_0xb6e5('0x23')]=_0x3e09be[_0xb6e5('0x23')];this[_0xb6e5('0x24')]=_0x3e09be[_0xb6e5('0x24')];this[_0xb6e5('0x25')]=_0x3e09be[_0xb6e5('0x25')];this[_0xb6e5('0x26')]=_0x3e09be[_0xb6e5('0x26')];this[_0xb6e5('0x27')]=_0x3e09be[_0xb6e5('0x27')];this[_0xb6e5('0x28')]=_0x3e09be[_0xb6e5('0x28')];this[_0xb6e5('0x29')]=_0x3e09be[_0xb6e5('0x29')]||'';this[_0xb6e5('0x2a')]=_0x3e09be[_0xb6e5('0x2a')]||'';this[_0xb6e5('0x2b')]=_0x3e09be[_0xb6e5('0x2b')];}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x5926=['countbusyretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','scheduledat','type','outbound','queue','countnoanswerretry','countglobal'];(function(_0x28d92c,_0x564534){var _0x4bd9cb=function(_0x92f68c){while(--_0x92f68c){_0x28d92c['push'](_0x28d92c['shift']());}};_0x4bd9cb(++_0x564534);}(_0x5926,0xd5));var _0x6592=function(_0x50987a,_0x537988){_0x50987a=_0x50987a-0x0;var _0x3a5160=_0x5926[_0x50987a];return _0x3a5160;};'use strict';var moment=require(_0x6592('0x0'));var utils=require(_0x6592('0x1'));function AgentComplete(_0x5ea4bc,_0x521b25){this[_0x6592('0x2')]=0x4;this['statedesc']='Answer';this[_0x6592('0x3')]=_0x5ea4bc['scheduledat'];this[_0x6592('0x4')]=_0x5ea4bc[_0x6592('0x4')];this['campaigntype']=_0x5ea4bc[_0x6592('0x4')]===_0x6592('0x5')?_0x6592('0x6'):_0x5ea4bc[_0x6592('0x4')];this['countbusyretry']=_0x5ea4bc['countbusyretry'];this['countcongestionretry']=_0x5ea4bc['countcongestionretry'];this[_0x6592('0x7')]=_0x5ea4bc[_0x6592('0x7')];this[_0x6592('0x8')]=_0x5ea4bc[_0x6592('0x9')]+_0x5ea4bc['countcongestionretry']+_0x5ea4bc[_0x6592('0x7')]+_0x5ea4bc['countnosuchnumberretry']+_0x5ea4bc['countdropretry']+_0x5ea4bc[_0x6592('0xa')]+_0x5ea4bc[_0x6592('0xb')]+_0x5ea4bc['countagentrejectretry'];this['countnosuchnumberretry']=_0x5ea4bc['countnosuchnumberretry'];this[_0x6592('0xc')]=_0x5ea4bc[_0x6592('0xc')];this[_0x6592('0xa')]=_0x5ea4bc['countabandonedretry'];this[_0x6592('0xb')]=_0x5ea4bc['countmachineretry'];this[_0x6592('0xd')]=_0x5ea4bc['countagentrejectretry'];this['uniqueid']=_0x521b25['uniqueid'];this[_0x6592('0xe')]=_0x5ea4bc['name'];this[_0x6592('0xf')]=_0x5ea4bc[_0x6592('0x10')];this[_0x6592('0x11')]=_0x5ea4bc[_0x6592('0x11')];this[_0x6592('0x12')]=_0x5ea4bc[_0x6592('0x12')];this[_0x6592('0x13')]=_0x5ea4bc[_0x6592('0x13')];this['endtime']=moment()['format'](_0x6592('0x14'));this[_0x6592('0x15')]=utils[_0x6592('0x16')](_0x5ea4bc[_0x6592('0x12')],_0x5ea4bc[_0x6592('0x11')]);this['holdtime']=utils['getSeconds'](_0x5ea4bc[_0x6592('0x13')],_0x5ea4bc[_0x6592('0x12')]);this['talktime']=utils[_0x6592('0x16')](this[_0x6592('0x17')],_0x5ea4bc['answertime']);this[_0x6592('0x6')]=_0x521b25[_0x6592('0x6')];this[_0x6592('0x18')]=_0x521b25[_0x6592('0x18')];this[_0x6592('0x19')]=_0x521b25[_0x6592('0x19')];this[_0x6592('0x1a')]=_0x5ea4bc[_0x6592('0x1a')];this[_0x6592('0x1b')]=_0x5ea4bc[_0x6592('0x1b')];this[_0x6592('0x1c')]=_0x5ea4bc[_0x6592('0x1c')];this[_0x6592('0x1d')]=_0x5ea4bc[_0x6592('0x1d')];this[_0x6592('0x1e')]=_0x5ea4bc['ContactId'];this[_0x6592('0x1f')]=_0x5ea4bc[_0x6592('0x1f')];this[_0x6592('0x20')]=_0x5ea4bc[_0x6592('0x20')];this[_0x6592('0x21')]=_0x5ea4bc[_0x6592('0x21')];this['CampaignId']=_0x5ea4bc['CampaignId'];this[_0x6592('0x22')]=_0x5ea4bc[_0x6592('0x22')]||'';this[_0x6592('0x23')]=_0x5ea4bc[_0x6592('0x23')]||'';this[_0x6592('0x24')]=_0x5ea4bc['agiafterat'];}module['exports']=AgentComplete;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4c0=['originatecalleridnum','originatecalleridname','state','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x4c488c,_0x2a9a09){var _0x82392f=function(_0x24eeec){while(--_0x24eeec){_0x4c488c['push'](_0x4c488c['shift']());}};_0x82392f(++_0x2a9a09);}(_0xc4c0,0xd6));var _0x0c4c=function(_0x129fa8,_0x3dba2a){_0x129fa8=_0x129fa8-0x0;var _0x546bab=_0xc4c0[_0x129fa8];return _0x546bab;};'use strict';function Final(_0x5c4e3b){this[_0x0c4c('0x0')]=_0x5c4e3b[_0x0c4c('0x0')];this[_0x0c4c('0x1')]=_0x5c4e3b[_0x0c4c('0x1')];this[_0x0c4c('0x2')]=_0x5c4e3b['type'];this[_0x0c4c('0x3')]=_0x5c4e3b[_0x0c4c('0x2')]==='outbound'?_0x0c4c('0x4'):_0x5c4e3b[_0x0c4c('0x2')];this[_0x0c4c('0x5')]=_0x5c4e3b[_0x0c4c('0x5')];this[_0x0c4c('0x6')]=_0x5c4e3b[_0x0c4c('0x6')];this[_0x0c4c('0x7')]=_0x5c4e3b[_0x0c4c('0x7')];this[_0x0c4c('0x8')]=_0x5c4e3b[_0x0c4c('0x5')]+_0x5c4e3b['countcongestionretry']+_0x5c4e3b['countnoanswerretry']+_0x5c4e3b['countnosuchnumberretry']+_0x5c4e3b[_0x0c4c('0x9')]+_0x5c4e3b[_0x0c4c('0xa')]+_0x5c4e3b['countmachineretry']+_0x5c4e3b[_0x0c4c('0xb')];this[_0x0c4c('0xc')]=_0x5c4e3b['countnosuchnumberretry'];this[_0x0c4c('0x9')]=_0x5c4e3b[_0x0c4c('0x9')];this[_0x0c4c('0xa')]=_0x5c4e3b[_0x0c4c('0xa')];this['countmachineretry']=_0x5c4e3b[_0x0c4c('0xd')];this[_0x0c4c('0xb')]=_0x5c4e3b['countagentrejectretry'];this[_0x0c4c('0x4')]=_0x5c4e3b[_0x0c4c('0x4')];this[_0x0c4c('0xe')]=_0x5c4e3b[_0x0c4c('0xe')];this[_0x0c4c('0xf')]=_0x5c4e3b['calleridnum'];this['starttime']=_0x5c4e3b[_0x0c4c('0x10')];this[_0x0c4c('0x11')]=_0x5c4e3b[_0x0c4c('0x11')];this[_0x0c4c('0x12')]=_0x5c4e3b[_0x0c4c('0x11')];this[_0x0c4c('0x13')]=_0x5c4e3b[_0x0c4c('0x13')]||0x0;this[_0x0c4c('0x14')]=_0x5c4e3b[_0x0c4c('0x14')]||0x0;this[_0x0c4c('0x15')]=_0x5c4e3b[_0x0c4c('0x15')]||0x0;this[_0x0c4c('0x16')]=_0x5c4e3b[_0x0c4c('0x16')];this[_0x0c4c('0x17')]=_0x5c4e3b['callbackuniqueid'];this[_0x0c4c('0x18')]=_0x5c4e3b[_0x0c4c('0x18')];this[_0x0c4c('0x19')]=_0x5c4e3b[_0x0c4c('0x19')];this['ContactId']=_0x5c4e3b[_0x0c4c('0x1a')];this[_0x0c4c('0x1b')]=_0x5c4e3b[_0x0c4c('0x1b')];this[_0x0c4c('0x1c')]=_0x5c4e3b[_0x0c4c('0x1c')];this[_0x0c4c('0x1d')]=_0x5c4e3b[_0x0c4c('0x1d')];this[_0x0c4c('0x1e')]=_0x5c4e3b[_0x0c4c('0x1e')];this[_0x0c4c('0x1f')]=_0x5c4e3b[_0x0c4c('0x1f')]||'';this[_0x0c4c('0x20')]=_0x5c4e3b['originatecalleridname']||'';this[_0x0c4c('0x21')]=_0x5c4e3b['state'];this['statedesc']=_0x5c4e3b['statedesc'];}module[_0x0c4c('0x22')]=Final;
\ No newline at end of file
+var _0x4256=['countnoanswerretry','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal'];(function(_0xe8580c,_0x16c179){var _0x2a17a6=function(_0xd0b312){while(--_0xd0b312){_0xe8580c['push'](_0xe8580c['shift']());}};_0x2a17a6(++_0x16c179);}(_0x4256,0x1d3));var _0x6425=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x4256[_0x53abe5];return _0xc1c37e;};'use strict';function Final(_0x6e05c2){this[_0x6425('0x0')]=_0x6e05c2[_0x6425('0x0')];this[_0x6425('0x1')]=_0x6e05c2[_0x6425('0x1')];this[_0x6425('0x2')]=_0x6e05c2[_0x6425('0x2')];this[_0x6425('0x3')]=_0x6e05c2[_0x6425('0x2')]===_0x6425('0x4')?_0x6425('0x5'):_0x6e05c2[_0x6425('0x2')];this[_0x6425('0x6')]=_0x6e05c2[_0x6425('0x6')];this[_0x6425('0x7')]=_0x6e05c2[_0x6425('0x7')];this['countnoanswerretry']=_0x6e05c2['countnoanswerretry'];this[_0x6425('0x8')]=_0x6e05c2[_0x6425('0x6')]+_0x6e05c2[_0x6425('0x7')]+_0x6e05c2[_0x6425('0x9')]+_0x6e05c2['countnosuchnumberretry']+_0x6e05c2[_0x6425('0xa')]+_0x6e05c2['countabandonedretry']+_0x6e05c2[_0x6425('0xb')]+_0x6e05c2['countagentrejectretry'];this[_0x6425('0xc')]=_0x6e05c2[_0x6425('0xc')];this[_0x6425('0xa')]=_0x6e05c2[_0x6425('0xa')];this['countabandonedretry']=_0x6e05c2[_0x6425('0xd')];this['countmachineretry']=_0x6e05c2[_0x6425('0xb')];this[_0x6425('0xe')]=_0x6e05c2[_0x6425('0xe')];this[_0x6425('0x5')]=_0x6e05c2[_0x6425('0x5')];this['calleridname']=_0x6e05c2['calleridname'];this[_0x6425('0xf')]=_0x6e05c2['calleridnum'];this[_0x6425('0x10')]=_0x6e05c2[_0x6425('0x10')];this['responsetime']=_0x6e05c2[_0x6425('0x11')];this['endtime']=_0x6e05c2[_0x6425('0x11')];this[_0x6425('0x12')]=_0x6e05c2['ringtime']||0x0;this[_0x6425('0x13')]=_0x6e05c2[_0x6425('0x13')]||0x0;this['talktime']=_0x6e05c2[_0x6425('0x14')]||0x0;this[_0x6425('0x15')]=_0x6e05c2[_0x6425('0x15')];this[_0x6425('0x16')]=_0x6e05c2[_0x6425('0x16')];this['callbackat']=_0x6e05c2[_0x6425('0x17')];this[_0x6425('0x18')]=_0x6e05c2[_0x6425('0x18')];this[_0x6425('0x19')]=_0x6e05c2[_0x6425('0x19')];this[_0x6425('0x1a')]=_0x6e05c2[_0x6425('0x1a')];this['UserId']=_0x6e05c2[_0x6425('0x1b')];this[_0x6425('0x1c')]=_0x6e05c2['VoiceQueueId'];this[_0x6425('0x1d')]=_0x6e05c2[_0x6425('0x1d')];this['originatecalleridnum']=_0x6e05c2['originatecalleridnum']||'';this[_0x6425('0x1e')]=_0x6e05c2[_0x6425('0x1e')]||'';this['state']=_0x6e05c2[_0x6425('0x1f')];this[_0x6425('0x20')]=_0x6e05c2[_0x6425('0x20')];}module[_0x6425('0x21')]=Final;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x93c2=['calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname'];(function(_0x2be272,_0x1cc13a){var _0x5da7cb=function(_0x9ea820){while(--_0x9ea820){_0x2be272['push'](_0x2be272['shift']());}};_0x5da7cb(++_0x1cc13a);}(_0x93c2,0xad));var _0x293c=function(_0x26c087,_0x5c8264){_0x26c087=_0x26c087-0x0;var _0x16fc2f=_0x93c2[_0x26c087];return _0x16fc2f;};'use strict';var moment=require(_0x293c('0x0'));var utils=require(_0x293c('0x1'));function Hangup(_0x5f56b5,_0x189bc1){this[_0x293c('0x2')]=0x4;this[_0x293c('0x3')]=_0x293c('0x4');this[_0x293c('0x5')]=_0x5f56b5['scheduledat'];this[_0x293c('0x6')]=_0x5f56b5[_0x293c('0x6')];this[_0x293c('0x7')]=_0x5f56b5['type']===_0x293c('0x8')?_0x293c('0x9'):_0x5f56b5['type'];this[_0x293c('0xa')]=_0x5f56b5[_0x293c('0xa')]||![];this[_0x293c('0xb')]=_0x5f56b5[_0x293c('0xb')];this['countcongestionretry']=_0x5f56b5[_0x293c('0xc')];this[_0x293c('0xd')]=_0x5f56b5['countnoanswerretry'];this[_0x293c('0xe')]=_0x5f56b5[_0x293c('0xb')]+_0x5f56b5[_0x293c('0xc')]+_0x5f56b5[_0x293c('0xd')]+_0x5f56b5[_0x293c('0xf')]+_0x5f56b5['countdropretry']+_0x5f56b5[_0x293c('0x10')]+_0x5f56b5[_0x293c('0x11')]+_0x5f56b5[_0x293c('0x12')];this[_0x293c('0xf')]=_0x5f56b5['countnosuchnumberretry'];this[_0x293c('0x13')]=_0x5f56b5[_0x293c('0x13')];this['countabandonedretry']=_0x5f56b5['countabandonedretry'];this['countmachineretry']=_0x5f56b5[_0x293c('0x11')];this[_0x293c('0x12')]=_0x5f56b5[_0x293c('0x12')];this['uniqueid']=_0x189bc1[_0x293c('0x14')];this[_0x293c('0x15')]=_0x5f56b5['name'];this[_0x293c('0x16')]=_0x5f56b5[_0x293c('0x17')];this[_0x293c('0x18')]=_0x5f56b5[_0x293c('0x18')];this[_0x293c('0x19')]=_0x5f56b5['responsetime'];this['endtime']=moment()['format'](_0x293c('0x1a'));this['ringtime']=utils[_0x293c('0x1b')](_0x5f56b5['responsetime'],_0x5f56b5[_0x293c('0x18')]);this['holdtime']=0x0;this[_0x293c('0x1c')]=utils[_0x293c('0x1b')](this['endtime'],_0x5f56b5[_0x293c('0x19')]);this[_0x293c('0x9')]=_0x5f56b5[_0x293c('0x9')];this['membername']=_0x293c('0x1d');this['reason']=_0x189bc1[_0x293c('0x1e')];this['callback']=_0x5f56b5[_0x293c('0x1f')];this[_0x293c('0x20')]=_0x5f56b5[_0x293c('0x20')];this['callbackat']=_0x5f56b5[_0x293c('0x21')];this['recallme']=_0x5f56b5['recallme'];this[_0x293c('0x22')]=_0x5f56b5[_0x293c('0x22')];this[_0x293c('0x23')]=_0x5f56b5[_0x293c('0x23')];this['UserId']=_0x5f56b5[_0x293c('0x24')];this[_0x293c('0x25')]=_0x5f56b5['VoiceQueueId'];this[_0x293c('0x26')]=_0x5f56b5[_0x293c('0x26')];}module['exports']=Hangup;
\ No newline at end of file
+var _0x24d6=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime'];(function(_0x456f79,_0x303e8b){var _0x57c261=function(_0x1db5f0){while(--_0x1db5f0){_0x456f79['push'](_0x456f79['shift']());}};_0x57c261(++_0x303e8b);}(_0x24d6,0x1ed));var _0x624d=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x24d6[_0x58d5ac];return _0x37985c;};'use strict';var moment=require('moment');var utils=require(_0x624d('0x0'));function Hangup(_0x5b785d,_0x409675){this[_0x624d('0x1')]=0x4;this['statedesc']=_0x624d('0x2');this[_0x624d('0x3')]=_0x5b785d[_0x624d('0x3')];this['type']=_0x5b785d[_0x624d('0x4')];this[_0x624d('0x5')]=_0x5b785d[_0x624d('0x4')]==='outbound'?_0x624d('0x6'):_0x5b785d[_0x624d('0x4')];this[_0x624d('0x7')]=_0x5b785d[_0x624d('0x7')]||![];this[_0x624d('0x8')]=_0x5b785d[_0x624d('0x8')];this[_0x624d('0x9')]=_0x5b785d[_0x624d('0x9')];this[_0x624d('0xa')]=_0x5b785d[_0x624d('0xa')];this[_0x624d('0xb')]=_0x5b785d[_0x624d('0x8')]+_0x5b785d[_0x624d('0x9')]+_0x5b785d[_0x624d('0xa')]+_0x5b785d[_0x624d('0xc')]+_0x5b785d['countdropretry']+_0x5b785d[_0x624d('0xd')]+_0x5b785d['countmachineretry']+_0x5b785d[_0x624d('0xe')];this[_0x624d('0xc')]=_0x5b785d[_0x624d('0xc')];this[_0x624d('0xf')]=_0x5b785d['countdropretry'];this[_0x624d('0xd')]=_0x5b785d['countabandonedretry'];this[_0x624d('0x10')]=_0x5b785d['countmachineretry'];this[_0x624d('0xe')]=_0x5b785d['countagentrejectretry'];this[_0x624d('0x11')]=_0x409675['uniqueid'];this['calleridname']=_0x5b785d[_0x624d('0x12')];this[_0x624d('0x13')]=_0x5b785d[_0x624d('0x14')];this[_0x624d('0x15')]=_0x5b785d[_0x624d('0x15')];this[_0x624d('0x16')]=_0x5b785d['responsetime'];this[_0x624d('0x17')]=moment()[_0x624d('0x18')](_0x624d('0x19'));this['ringtime']=utils[_0x624d('0x1a')](_0x5b785d[_0x624d('0x16')],_0x5b785d['starttime']);this[_0x624d('0x1b')]=0x0;this[_0x624d('0x1c')]=utils['getSeconds'](this['endtime'],_0x5b785d[_0x624d('0x16')]);this[_0x624d('0x6')]=_0x5b785d[_0x624d('0x6')];this[_0x624d('0x1d')]=_0x624d('0x1e');this[_0x624d('0x1f')]=_0x409675[_0x624d('0x20')];this[_0x624d('0x21')]=_0x5b785d[_0x624d('0x21')];this[_0x624d('0x22')]=_0x5b785d[_0x624d('0x22')];this[_0x624d('0x23')]=_0x5b785d[_0x624d('0x23')];this[_0x624d('0x24')]=_0x5b785d[_0x624d('0x24')];this['ContactId']=_0x5b785d[_0x624d('0x25')];this[_0x624d('0x26')]=_0x5b785d[_0x624d('0x26')];this[_0x624d('0x27')]=_0x5b785d[_0x624d('0x27')];this[_0x624d('0x28')]=_0x5b785d[_0x624d('0x28')];this['CampaignId']=_0x5b785d[_0x624d('0x29')];}module[_0x624d('0x2a')]=Hangup;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1652=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','campaigntype','outbound','queue'];(function(_0x53c6b2,_0x4c2b79){var _0x99daa6=function(_0x412b73){while(--_0x412b73){_0x53c6b2['push'](_0x53c6b2['shift']());}};_0x99daa6(++_0x4c2b79);}(_0x1652,0x18a));var _0x2165=function(_0x2a3b3e,_0x415238){_0x2a3b3e=_0x2a3b3e-0x0;var _0x3bb5f6=_0x1652[_0x2a3b3e];return _0x3bb5f6;};'use strict';var utils=require(_0x2165('0x0'));function History(_0x2fd43e){this[_0x2165('0x1')]=_0x2fd43e[_0x2165('0x1')];this['scheduledat']=_0x2fd43e['scheduledat']||undefined;this[_0x2165('0x2')]=_0x2fd43e[_0x2165('0x2')];this[_0x2165('0x3')]=_0x2fd43e[_0x2165('0x2')]===_0x2165('0x4')?_0x2165('0x5'):_0x2fd43e[_0x2165('0x2')];this[_0x2165('0x6')]=_0x2fd43e[_0x2165('0x6')];this[_0x2165('0x7')]=_0x2fd43e[_0x2165('0x7')];this[_0x2165('0x8')]=_0x2fd43e[_0x2165('0x8')];this[_0x2165('0x9')]=_0x2fd43e[_0x2165('0x6')]+_0x2fd43e['countcongestionretry']+_0x2fd43e[_0x2165('0x8')]+_0x2fd43e[_0x2165('0xa')]+_0x2fd43e[_0x2165('0xb')]+_0x2fd43e[_0x2165('0xc')]+_0x2fd43e['countmachineretry']+_0x2fd43e[_0x2165('0xd')];this['countnosuchnumberretry']=_0x2fd43e[_0x2165('0xa')];this['countdropretry']=_0x2fd43e[_0x2165('0xb')];this[_0x2165('0xc')]=_0x2fd43e['countabandonedretry'];this['countmachineretry']=_0x2fd43e[_0x2165('0xe')];this[_0x2165('0xd')]=_0x2fd43e[_0x2165('0xd')];this[_0x2165('0x5')]=_0x2fd43e[_0x2165('0x5')];this[_0x2165('0xf')]=_0x2fd43e[_0x2165('0x10')];this[_0x2165('0x11')]=_0x2fd43e[_0x2165('0x12')];this['starttime']=_0x2fd43e[_0x2165('0x13')];this[_0x2165('0x14')]=_0x2fd43e[_0x2165('0x14')];this[_0x2165('0x15')]=_0x2fd43e[_0x2165('0x14')];this[_0x2165('0x16')]=utils[_0x2165('0x17')](_0x2fd43e[_0x2165('0x14')],_0x2fd43e[_0x2165('0x13')]);this[_0x2165('0x18')]=0x0;this[_0x2165('0x19')]=0x0;this[_0x2165('0x1a')]=_0x2fd43e[_0x2165('0x1a')];this[_0x2165('0x1b')]=_0x2fd43e[_0x2165('0x1b')];this[_0x2165('0x1c')]=_0x2fd43e[_0x2165('0x1c')];this['recallme']=_0x2fd43e[_0x2165('0x1d')];this[_0x2165('0x1e')]=_0x2fd43e[_0x2165('0x1e')];this[_0x2165('0x1f')]=_0x2fd43e['ListId'];this[_0x2165('0x20')]=_0x2fd43e[_0x2165('0x20')];this[_0x2165('0x21')]=_0x2fd43e[_0x2165('0x21')];this[_0x2165('0x22')]=_0x2fd43e[_0x2165('0x22')];this[_0x2165('0x23')]=_0x2fd43e[_0x2165('0x23')]||'';this['originatecalleridname']=_0x2fd43e[_0x2165('0x24')]||'';this['state']=_0x2fd43e[_0x2165('0x25')];this[_0x2165('0x26')]=_0x2fd43e[_0x2165('0x26')];}module[_0x2165('0x27')]=History;
\ No newline at end of file
+var _0x9a64=['ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime'];(function(_0x13ee59,_0x44a2a5){var _0x5d16f1=function(_0x1bda59){while(--_0x1bda59){_0x13ee59['push'](_0x13ee59['shift']());}};_0x5d16f1(++_0x44a2a5);}(_0x9a64,0xa6));var _0x49a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a64[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x49a6('0x0'));function History(_0x44c754){this['uniqueid']=_0x44c754[_0x49a6('0x1')];this['scheduledat']=_0x44c754[_0x49a6('0x2')]||undefined;this[_0x49a6('0x3')]=_0x44c754[_0x49a6('0x3')];this['campaigntype']=_0x44c754[_0x49a6('0x3')]==='outbound'?'queue':_0x44c754[_0x49a6('0x3')];this[_0x49a6('0x4')]=_0x44c754['countbusyretry'];this[_0x49a6('0x5')]=_0x44c754['countcongestionretry'];this['countnoanswerretry']=_0x44c754[_0x49a6('0x6')];this['countglobal']=_0x44c754[_0x49a6('0x4')]+_0x44c754['countcongestionretry']+_0x44c754[_0x49a6('0x6')]+_0x44c754[_0x49a6('0x7')]+_0x44c754[_0x49a6('0x8')]+_0x44c754['countabandonedretry']+_0x44c754[_0x49a6('0x9')]+_0x44c754[_0x49a6('0xa')];this[_0x49a6('0x7')]=_0x44c754[_0x49a6('0x7')];this[_0x49a6('0x8')]=_0x44c754['countdropretry'];this[_0x49a6('0xb')]=_0x44c754[_0x49a6('0xb')];this['countmachineretry']=_0x44c754[_0x49a6('0x9')];this[_0x49a6('0xa')]=_0x44c754[_0x49a6('0xa')];this[_0x49a6('0xc')]=_0x44c754[_0x49a6('0xc')];this[_0x49a6('0xd')]=_0x44c754[_0x49a6('0xe')];this[_0x49a6('0xf')]=_0x44c754['number'];this[_0x49a6('0x10')]=_0x44c754[_0x49a6('0x10')];this[_0x49a6('0x11')]=_0x44c754[_0x49a6('0x11')];this[_0x49a6('0x12')]=_0x44c754[_0x49a6('0x11')];this[_0x49a6('0x13')]=utils[_0x49a6('0x14')](_0x44c754[_0x49a6('0x11')],_0x44c754[_0x49a6('0x10')]);this[_0x49a6('0x15')]=0x0;this[_0x49a6('0x16')]=0x0;this[_0x49a6('0x17')]=_0x44c754[_0x49a6('0x17')];this[_0x49a6('0x18')]=_0x44c754[_0x49a6('0x18')];this['callbackat']=_0x44c754[_0x49a6('0x19')];this['recallme']=_0x44c754[_0x49a6('0x1a')];this['ContactId']=_0x44c754[_0x49a6('0x1b')];this[_0x49a6('0x1c')]=_0x44c754['ListId'];this[_0x49a6('0x1d')]=_0x44c754['UserId'];this['VoiceQueueId']=_0x44c754[_0x49a6('0x1e')];this[_0x49a6('0x1f')]=_0x44c754[_0x49a6('0x1f')];this[_0x49a6('0x20')]=_0x44c754[_0x49a6('0x20')]||'';this['originatecalleridname']=_0x44c754[_0x49a6('0x21')]||'';this[_0x49a6('0x22')]=_0x44c754['state'];this[_0x49a6('0x23')]=_0x44c754[_0x49a6('0x23')];}module[_0x49a6('0x24')]=History;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9400=['droptime','dropreason','endtime','ringtime','responsetime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','starttime'];(function(_0x476ee0,_0x2254fc){var _0x1aae6f=function(_0x18899d){while(--_0x18899d){_0x476ee0['push'](_0x476ee0['shift']());}};_0x1aae6f(++_0x2254fc);}(_0x9400,0x1c6));var _0x0940=function(_0x219742,_0x220c6e){_0x219742=_0x219742-0x0;var _0x2efafa=_0x9400[_0x219742];return _0x2efafa;};'use strict';var utils=require(_0x0940('0x0'));function QueueCallerAbandon(_0x1954a9,_0x33a4cc){this[_0x0940('0x1')]=_0x1954a9[_0x0940('0x1')];this[_0x0940('0x2')]=_0x1954a9[_0x0940('0x2')];this[_0x0940('0x3')]=_0x1954a9[_0x0940('0x2')]===_0x0940('0x4')?_0x0940('0x5'):_0x1954a9[_0x0940('0x2')];this[_0x0940('0x6')]=_0x1954a9['countbusyretry'];this[_0x0940('0x7')]=_0x1954a9[_0x0940('0x7')];this[_0x0940('0x8')]=_0x1954a9[_0x0940('0x8')];this[_0x0940('0x9')]=_0x1954a9[_0x0940('0x6')]+_0x1954a9['countcongestionretry']+_0x1954a9[_0x0940('0x8')]+_0x1954a9[_0x0940('0xa')]+_0x1954a9[_0x0940('0xb')]+_0x1954a9[_0x0940('0xc')]+_0x1954a9['countmachineretry']+_0x1954a9[_0x0940('0xd')];this['countnosuchnumberretry']=_0x1954a9[_0x0940('0xa')];this[_0x0940('0xb')]=_0x1954a9['countdropretry'];this[_0x0940('0xc')]=_0x1954a9['countabandonedretry'];this['countmachineretry']=_0x1954a9[_0x0940('0xe')];this['countagentrejectretry']=_0x1954a9[_0x0940('0xd')];this[_0x0940('0xf')]=_0x33a4cc[_0x0940('0xf')];this[_0x0940('0x10')]=_0x1954a9[_0x0940('0x11')];this['calleridnum']=_0x1954a9['number'];this[_0x0940('0x12')]=_0x1954a9['starttime'];this['responsetime']=_0x1954a9['responsetime'];this[_0x0940('0x13')]=_0x1954a9[_0x0940('0x13')];this['dropreason']=_0x1954a9[_0x0940('0x14')];this[_0x0940('0x15')]=this['droptime'];this[_0x0940('0x16')]=utils['getSeconds'](_0x1954a9[_0x0940('0x17')],_0x1954a9[_0x0940('0x12')]);this['holdtime']=utils[_0x0940('0x18')](this[_0x0940('0x13')],_0x1954a9[_0x0940('0x17')]);this[_0x0940('0x19')]=0x0;this[_0x0940('0x5')]=_0x33a4cc[_0x0940('0x5')];this[_0x0940('0x1a')]=_0x33a4cc[_0x0940('0x1b')];this[_0x0940('0x1c')]=_0x33a4cc[_0x0940('0x1c')];this[_0x0940('0x1d')]=_0x1954a9[_0x0940('0x1d')];this[_0x0940('0x1e')]=_0x1954a9[_0x0940('0x1e')];this[_0x0940('0x1f')]=_0x1954a9[_0x0940('0x1f')];this[_0x0940('0x20')]=_0x1954a9[_0x0940('0x20')];this[_0x0940('0x21')]=_0x1954a9[_0x0940('0x21')];this[_0x0940('0x22')]=_0x1954a9[_0x0940('0x22')];this[_0x0940('0x23')]=_0x1954a9[_0x0940('0x23')];this['VoiceQueueId']=_0x1954a9[_0x0940('0x24')];this[_0x0940('0x25')]=_0x1954a9[_0x0940('0x25')];this[_0x0940('0x26')]=_0x1954a9[_0x0940('0x26')]||'';this['originatecalleridname']=_0x1954a9[_0x0940('0x27')]||'';this['agiafterat']=_0x1954a9['agiafterat'];this[_0x0940('0x28')]=_0x1954a9['state'];this['statedesc']=_0x1954a9[_0x0940('0x29')];}module[_0x0940('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x5628=['countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x4f3207,_0x264c78){var _0x87adb6=function(_0x562c05){while(--_0x562c05){_0x4f3207['push'](_0x4f3207['shift']());}};_0x87adb6(++_0x264c78);}(_0x5628,0x16a));var _0x8562=function(_0x4e012d,_0x546e89){_0x4e012d=_0x4e012d-0x0;var _0x53b323=_0x5628[_0x4e012d];return _0x53b323;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x2b6497,_0x349817){this[_0x8562('0x0')]=_0x2b6497[_0x8562('0x0')];this[_0x8562('0x1')]=_0x2b6497[_0x8562('0x1')];this[_0x8562('0x2')]=_0x2b6497[_0x8562('0x1')]===_0x8562('0x3')?_0x8562('0x4'):_0x2b6497['type'];this['countbusyretry']=_0x2b6497[_0x8562('0x5')];this[_0x8562('0x6')]=_0x2b6497[_0x8562('0x6')];this['countnoanswerretry']=_0x2b6497[_0x8562('0x7')];this[_0x8562('0x8')]=_0x2b6497[_0x8562('0x5')]+_0x2b6497['countcongestionretry']+_0x2b6497[_0x8562('0x7')]+_0x2b6497['countnosuchnumberretry']+_0x2b6497[_0x8562('0x9')]+_0x2b6497['countabandonedretry']+_0x2b6497[_0x8562('0xa')]+_0x2b6497[_0x8562('0xb')];this[_0x8562('0xc')]=_0x2b6497[_0x8562('0xc')];this[_0x8562('0x9')]=_0x2b6497['countdropretry'];this['countabandonedretry']=_0x2b6497[_0x8562('0xd')];this['countmachineretry']=_0x2b6497[_0x8562('0xa')];this[_0x8562('0xb')]=_0x2b6497[_0x8562('0xb')];this[_0x8562('0xe')]=_0x349817[_0x8562('0xe')];this[_0x8562('0xf')]=_0x2b6497[_0x8562('0x10')];this[_0x8562('0x11')]=_0x2b6497['number'];this[_0x8562('0x12')]=_0x2b6497['starttime'];this['responsetime']=_0x2b6497[_0x8562('0x13')];this[_0x8562('0x14')]=_0x2b6497[_0x8562('0x14')];this['dropreason']=_0x2b6497['dropreason'];this[_0x8562('0x15')]=this['droptime'];this[_0x8562('0x16')]=utils['getSeconds'](_0x2b6497[_0x8562('0x13')],_0x2b6497[_0x8562('0x12')]);this[_0x8562('0x17')]=utils['getSeconds'](this['droptime'],_0x2b6497[_0x8562('0x13')]);this[_0x8562('0x18')]=0x0;this['queue']=_0x349817[_0x8562('0x4')];this['membername']=_0x349817[_0x8562('0x19')];this[_0x8562('0x1a')]=_0x349817[_0x8562('0x1a')];this[_0x8562('0x1b')]=_0x2b6497['callback'];this[_0x8562('0x1c')]=_0x2b6497[_0x8562('0x1c')];this[_0x8562('0x1d')]=_0x2b6497[_0x8562('0x1d')];this['recallme']=_0x2b6497['recallme'];this[_0x8562('0x1e')]=_0x2b6497[_0x8562('0x1e')];this[_0x8562('0x1f')]=_0x2b6497[_0x8562('0x1f')];this[_0x8562('0x20')]=_0x2b6497[_0x8562('0x20')];this[_0x8562('0x21')]=_0x2b6497[_0x8562('0x21')];this[_0x8562('0x22')]=_0x2b6497['CampaignId'];this[_0x8562('0x23')]=_0x2b6497[_0x8562('0x23')]||'';this[_0x8562('0x24')]=_0x2b6497['originatecalleridname']||'';this[_0x8562('0x25')]=_0x2b6497['agiafterat'];this['state']=_0x2b6497[_0x8562('0x26')];this[_0x8562('0x27')]=_0x2b6497[_0x8562('0x27')];}module[_0x8562('0x28')]=QueueCallerAbandon;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3da=['../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','util'];(function(_0x1e758e,_0x157fa3){var _0x23840b=function(_0x54b1a8){while(--_0x54b1a8){_0x1e758e['push'](_0x1e758e['shift']());}};_0x23840b(++_0x157fa3);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xae3d('0x0'));var logger=require(_0xae3d('0x1'))(_0xae3d('0x2'));var cmHopper=require(_0xae3d('0x3'));var cmHopperAdditionalPhone=require(_0xae3d('0x4'));var cmHopperBlack=require(_0xae3d('0x5'));var cmHopperHistory=require(_0xae3d('0x6'));function inspectError(_0x17952f){return util[_0xae3d('0x7')](_0x17952f,{'showHidden':![],'depth':null});}function getContactDialer(_0x22bacf,_0x1b9397,_0x26282d){return cmHopper[_0xae3d('0x8')](_0x22bacf['id'],_0x1b9397,_0x26282d,_0x22bacf[_0xae3d('0x9')])[_0xae3d('0xa')](function(_0x33c089){_0x22bacf['temp']=0x0;logger[_0xae3d('0xb')](_0xae3d('0xc'),inspectError(_0x33c089));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x577070,_0x459592){return cmHopper[_0xae3d('0xd')](_0x577070['id'],_0x459592,_0x577070[_0xae3d('0x9')])[_0xae3d('0xa')](function(_0x2705b8){_0x577070[_0xae3d('0xe')]=0x0;logger['error'](_0xae3d('0xf'),inspectError(_0x2705b8));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0xc7bd1c){return cmHopper[_0xae3d('0x10')](_0xc7bd1c)[_0xae3d('0xa')](function(_0x172f7a){logger['error'](_0xae3d('0x11'),inspectError(_0x172f7a));});}exports[_0xae3d('0x10')]=countReScheduled;function rescheduleContact(_0x16fd19){return cmHopper[_0xae3d('0x12')](_0x16fd19)[_0xae3d('0xa')](function(_0x430659){logger[_0xae3d('0xb')]('[rescheduleContact]',inspectError(_0x430659));});}exports[_0xae3d('0x12')]=rescheduleContact;function unlockContact(_0x42f4b4,_0x46295b,_0x230afb){return cmHopper[_0xae3d('0x13')](_0x42f4b4,_0x46295b,_0x230afb)[_0xae3d('0xa')](function(_0x585160){logger[_0xae3d('0xb')](_0xae3d('0x14'),inspectError(_0x585160));});}exports[_0xae3d('0x13')]=unlockContact;function moveContactManagedDialer(_0x5303c2){return cmHopper[_0xae3d('0x15')](_0x5303c2)[_0xae3d('0xa')](function(_0x558e42){logger['error'](_0xae3d('0x16'),inspectError(_0x558e42));});}exports[_0xae3d('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x19c44d){return cmHopperBlack[_0xae3d('0x17')](_0x19c44d)[_0xae3d('0xa')](function(_0x577f62){logger[_0xae3d('0xb')]('[checkIsBlackList]',inspectError(_0x577f62));});}exports[_0xae3d('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x2d138f){return cmHopperBlack[_0xae3d('0x18')](_0x2d138f)[_0xae3d('0xa')](function(_0x1facc1){logger[_0xae3d('0xb')](_0xae3d('0x19'),inspectError(_0x1facc1));});}exports[_0xae3d('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3224ff,_0x11ecf7,_0x300be8){return cmHopperAdditionalPhone[_0xae3d('0x1a')](_0x3224ff,_0x11ecf7,_0x300be8)[_0xae3d('0xa')](function(_0x1b2acb){logger[_0xae3d('0xb')](_0xae3d('0x1b'),inspectError(_0x1b2acb));});}exports[_0xae3d('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x21b608,_0x2131e9,_0x1b1217){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x21b608,_0x2131e9,_0x1b1217)[_0xae3d('0xa')](function(_0x185e71){logger[_0xae3d('0xb')](_0xae3d('0x1c'),inspectError(_0x185e71));});}exports[_0xae3d('0x1d')]=swapAdditionalPhones;function avgHandleTime(_0x4391db){return cmHopperHistory[_0xae3d('0x1e')](_0x4391db)['catch'](function(_0x57864e){logger[_0xae3d('0xb')](_0xae3d('0x1f'),inspectError(_0x57864e));});}exports[_0xae3d('0x1e')]=avgHandleTime;function createHistory(_0x3114f9){return cmHopperHistory[_0xae3d('0x20')](_0x3114f9)['catch'](function(_0x1d1483){logger[_0xae3d('0xb')]('[createHistory]',inspectError(_0x1d1483));});}exports[_0xae3d('0x20')]=createHistory;
\ No newline at end of file
+var _0xd101=['createHistory','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[createHistory]'];(function(_0x47e7a6,_0x4a658b){var _0x49602e=function(_0x485f67){while(--_0x485f67){_0x47e7a6['push'](_0x47e7a6['shift']());}};_0x49602e(++_0x4a658b);}(_0xd101,0xc1));var _0x1d10=function(_0x4096b4,_0x305e49){_0x4096b4=_0x4096b4-0x0;var _0x2fdd64=_0xd101[_0x4096b4];return _0x2fdd64;};'use strict';var util=require(_0x1d10('0x0'));var logger=require('../../../../config/logger')(_0x1d10('0x1'));var cmHopper=require(_0x1d10('0x2'));var cmHopperAdditionalPhone=require(_0x1d10('0x3'));var cmHopperBlack=require(_0x1d10('0x4'));var cmHopperHistory=require(_0x1d10('0x5'));function inspectError(_0x25b425){return util[_0x1d10('0x6')](_0x25b425,{'showHidden':![],'depth':null});}function getContactDialer(_0x1e83e0,_0x5c5c42,_0x42b6d2){return cmHopper[_0x1d10('0x7')](_0x1e83e0['id'],_0x5c5c42,_0x42b6d2,_0x1e83e0[_0x1d10('0x8')])[_0x1d10('0x9')](function(_0xb9e08){_0x1e83e0[_0x1d10('0xa')]=0x0;logger[_0x1d10('0xb')](_0x1d10('0xc'),inspectError(_0xb9e08));});}exports[_0x1d10('0x7')]=getContactDialer;function getContactDialerIvr(_0x182c87,_0xf7926b){return cmHopper[_0x1d10('0xd')](_0x182c87['id'],_0xf7926b,_0x182c87[_0x1d10('0x8')])[_0x1d10('0x9')](function(_0x42efad){_0x182c87[_0x1d10('0xa')]=0x0;logger[_0x1d10('0xb')]('[getContactDialerIvr]',inspectError(_0x42efad));});}exports[_0x1d10('0xd')]=getContactDialerIvr;function countReScheduled(_0x93cb59){return cmHopper[_0x1d10('0xe')](_0x93cb59)[_0x1d10('0x9')](function(_0x268506){logger['error'](_0x1d10('0xf'),inspectError(_0x268506));});}exports[_0x1d10('0xe')]=countReScheduled;function rescheduleContact(_0x1a6586){return cmHopper[_0x1d10('0x10')](_0x1a6586)[_0x1d10('0x9')](function(_0x183bc4){logger['error'](_0x1d10('0x11'),inspectError(_0x183bc4));});}exports[_0x1d10('0x10')]=rescheduleContact;function unlockContact(_0x306953,_0x2ad3c0,_0x4f014a){return cmHopper[_0x1d10('0x12')](_0x306953,_0x2ad3c0,_0x4f014a)[_0x1d10('0x9')](function(_0x41152c){logger[_0x1d10('0xb')](_0x1d10('0x13'),inspectError(_0x41152c));});}exports[_0x1d10('0x12')]=unlockContact;function moveContactManagedDialer(_0x4528a6){return cmHopper['moveContactManagedDialer'](_0x4528a6)[_0x1d10('0x9')](function(_0x1163dd){logger[_0x1d10('0xb')](_0x1d10('0x14'),inspectError(_0x1163dd));});}exports[_0x1d10('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x5e61f8){return cmHopperBlack['checkIsBlackList'](_0x5e61f8)[_0x1d10('0x9')](function(_0x57ec1c){logger['error']('[checkIsBlackList]',inspectError(_0x57ec1c));});}exports[_0x1d10('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x2496bc){return cmHopperBlack[_0x1d10('0x17')](_0x2496bc)[_0x1d10('0x9')](function(_0x4ce84a){logger['error'](_0x1d10('0x18'),inspectError(_0x4ce84a));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x68b09,_0x474321,_0x160802){return cmHopperAdditionalPhone[_0x1d10('0x19')](_0x68b09,_0x474321,_0x160802)[_0x1d10('0x9')](function(_0x3601ba){logger[_0x1d10('0xb')](_0x1d10('0x1a'),inspectError(_0x3601ba));});}exports[_0x1d10('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x84055f,_0xf1e4c8,_0x5abc58){return cmHopperAdditionalPhone[_0x1d10('0x1b')](_0x84055f,_0xf1e4c8,_0x5abc58)[_0x1d10('0x9')](function(_0x475934){logger[_0x1d10('0xb')](_0x1d10('0x1c'),inspectError(_0x475934));});}exports[_0x1d10('0x1b')]=swapAdditionalPhones;function avgHandleTime(_0x38f583){return cmHopperHistory[_0x1d10('0x1d')](_0x38f583)['catch'](function(_0x355e10){logger[_0x1d10('0xb')]('[avgHandleTime]',inspectError(_0x355e10));});}exports[_0x1d10('0x1d')]=avgHandleTime;function createHistory(_0x52d514){return cmHopperHistory['createHistory'](_0x52d514)[_0x1d10('0x9')](function(_0x597aea){logger[_0x1d10('0xb')](_0x1d10('0x1e'),inspectError(_0x597aea));});}exports[_0x1d10('0x1f')]=createHistory;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a62=['random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','%s%s','XMD-','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','dialActive','message','available','loggedIn','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialGlobalInterval','Interval','isNil','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','format','replace'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x2a62,0xb8));var _0x22a6=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x2a62[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x22a6('0x0'));var moment=require(_0x22a6('0x1'));var util=require(_0x22a6('0x2'));var logger=require('../../../../config/logger')(_0x22a6('0x3'));var timezones=require(_0x22a6('0x4'))[_0x22a6('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x22a6('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x22a6('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x22a6('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x22a6('0x9'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x22a6('0xa'),'OVERTIME_GLOBAL_INTERVAL':_0x22a6('0xb'),'QUEUE_RECALL':_0x22a6('0xc'),'RECALL_TIMEOUT':_0x22a6('0xd'),'RUNNING':_0x22a6('0xe'),'UNKNOWN_TIMEZONE':_0x22a6('0xf'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2c2654){return _0x2c2654[_0x22a6('0x10')]===_0x22a6('0x11');}exports[_0x22a6('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x46b730){return _0x46b730[_0x22a6('0x13')]===_0x22a6('0x14');}exports[_0x22a6('0x15')]=isIVRCampaign;function isOutboundQueue(_0x5cd991){return _0x5cd991[_0x22a6('0x13')]===_0x22a6('0x16');}exports[_0x22a6('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x7db7dc){return _0x7db7dc['dialActive'];}exports[_0x22a6('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4daecf){return _0x4daecf['active'];}exports[_0x22a6('0x19')]=isIVRCampaignActive;function getSeconds(_0x32e2bc,_0x4dad55){var _0x42d302=moment(_0x32e2bc)[_0x22a6('0x1a')](0x0);var _0x3a8789=moment(_0x4dad55)[_0x22a6('0x1a')](0x0);return _0x42d302['diff'](_0x3a8789,_0x22a6('0x1b'));}exports[_0x22a6('0x1c')]=getSeconds;function hasQueueCampaignDataChanged(_0x3b03aa,_0x46ee3a){var _0x6e3656=![];var _0x48c17e=_0x3b03aa['dialMethod']!==_0x46ee3a[_0x22a6('0x10')]||_0x3b03aa['dialActive']!==_0x46ee3a[_0x22a6('0x1d')]||_0x3b03aa['message']!==_0x46ee3a[_0x22a6('0x1e')];var _0x34fcb2=_0x3b03aa[_0x22a6('0x1f')]!==_0x46ee3a[_0x22a6('0x1f')]||_0x3b03aa[_0x22a6('0x20')]!==_0x46ee3a[_0x22a6('0x20')]||_0x3b03aa['loggedInDb']!==_0x46ee3a['loggedInDb']||_0x3b03aa['paused']!==_0x46ee3a[_0x22a6('0x21')]||_0x3b03aa[_0x22a6('0x22')]!==_0x46ee3a[_0x22a6('0x22')]||_0x3b03aa['pTalking']!==_0x46ee3a[_0x22a6('0x23')]||_0x3b03aa['waiting']!==_0x46ee3a[_0x22a6('0x24')]||_0x3b03aa[_0x22a6('0x25')]!==_0x46ee3a[_0x22a6('0x25')]||_0x3b03aa[_0x22a6('0x26')]!==_0x46ee3a[_0x22a6('0x26')];if(_0x3b03aa[_0x22a6('0x27')]&&_0x46ee3a[_0x22a6('0x27')]){_0x6e3656=_0x3b03aa[_0x22a6('0x27')]['name']!==_0x46ee3a[_0x22a6('0x27')][_0x22a6('0x28')]||_0x3b03aa[_0x22a6('0x27')][_0x22a6('0x29')]!==_0x46ee3a[_0x22a6('0x27')]['active'];}return _0x48c17e||_0x34fcb2||_0x6e3656;}exports[_0x22a6('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2b989f){var _0x7d8091=null;var _0x4c52e1=_0x2b989f['dialTimezone'];if(_['isNil'](_0x2b989f[_0x22a6('0x2b')])||_['isNil'](_0x2b989f[_0x22a6('0x2c')])||_[_0x22a6('0x2d')](_0x2b989f['Interval']['Intervals'])){_0x7d8091=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x22a6('0x2e')](_0x2b989f[_0x22a6('0x2b')])||_[_0x22a6('0x2e')](_0x2b989f[_0x22a6('0x2c')][_0x22a6('0x2f')])){_0x7d8091=CAMPAIGN_STATUS[_0x22a6('0x30')];}else if(_0x4c52e1&&!timezones[_0x4c52e1]){_0x7d8091=CAMPAIGN_STATUS[_0x22a6('0x31')];}return _0x7d8091;}function checkAnyValidTrunk(_0x3aeb41,_0x4610f2){var _0x12e6bf=null;var _0x1a4fb6='SIP/';var _0x4c8625=['reachable',_0x22a6('0x32')];var _0x471b4e=!![];if(_0x3aeb41[_0x22a6('0x27')]&&_0x3aeb41[_0x22a6('0x27')][_0x22a6('0x29')]){_0x1a4fb6+=_0x3aeb41[_0x22a6('0x27')][_0x22a6('0x28')];_0x12e6bf=_0x4610f2[_0x1a4fb6];_0x471b4e=_0x4c8625[_0x22a6('0x33')](_0x12e6bf[_0x22a6('0x34')]);}else if(_0x3aeb41[_0x22a6('0x35')]&&_0x3aeb41[_0x22a6('0x35')][_0x22a6('0x29')]){_0x1a4fb6+=_0x3aeb41['TrunkBackup'][_0x22a6('0x28')];_0x12e6bf=_0x4610f2[_0x1a4fb6];_0x471b4e=_0x4c8625[_0x22a6('0x33')](_0x12e6bf[_0x22a6('0x34')]);}return _0x471b4e;}function getQueueCampaignStatusMessage(_0x49d1ad,_0x208d87){var _0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x6')];var _0x20025e=isPreviewCampaign(_0x49d1ad);if(!isQueueCampaignActive(_0x49d1ad)){if(_0x20025e){_0x5d225d=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x49d1ad['originated']===0x0&&_0x49d1ad[_0x22a6('0x22')]===0x0&&_0x49d1ad[_0x22a6('0x24')]===0x0&&(_0x49d1ad[_0x22a6('0x23')]||0x0)===0x0){_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x36')];}else{_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x37')];}}}else if(_0x49d1ad[_0x22a6('0x20')]===0x0){_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x38')];}else if(!checkAnyValidTrunk(_0x49d1ad,_0x208d87)){_0x5d225d=CAMPAIGN_STATUS[_0x22a6('0x39')];}else if(!isPreviewCampaign(_0x49d1ad)){var _0x289838=checkAnyValidQueueCampaignInterval(_0x49d1ad);if(_0x289838){_0x5d225d=_0x289838;}}return _0x5d225d;}exports[_0x22a6('0x3a')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5ddc64){var _0x116daf=CAMPAIGN_STATUS[_0x22a6('0x37')];if(_0x5ddc64[_0x22a6('0x26')]===0x0&&_0x5ddc64[_0x22a6('0x22')]===0x0&&_0x5ddc64[_0x22a6('0x24')]===0x0&&(_0x5ddc64[_0x22a6('0x23')]||0x0)===0x0){_0x116daf=CAMPAIGN_STATUS[_0x22a6('0x36')];}return _0x116daf;}exports[_0x22a6('0x3b')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1dbea3){var _0xf0b90b=_0x1dbea3[_0x22a6('0x3c')](/"(.*?)"/);return _0xf0b90b?_0xf0b90b[0x1]:_0x1dbea3;}exports[_0x22a6('0x3d')]=extractCalleridName;function getCallerId(_0x26a199,_0x2e8f41,_0x33735e){if(!_[_0x22a6('0x3e')](_0x33735e)&&typeof _0x33735e===_0x22a6('0x3f')&&!_[_0x22a6('0x2e')](_0x33735e)){if(!_[_0x22a6('0x3e')](_0x2e8f41)&&typeof _0x2e8f41===_0x22a6('0x3f')&&!_['isEmpty'](_0x2e8f41)){return util['format']('\x22%s\x22\x20<%s>',_0x2e8f41,_0x33735e);}return util['format'](_0x22a6('0x40'),_0x33735e,_0x33735e);}if(!_[_0x22a6('0x3e')](_0x26a199)&&typeof _0x26a199===_0x22a6('0x3f')&&!_['isEmpty'](_0x26a199)){return _0x26a199;}return _0x22a6('0x41');}exports[_0x22a6('0x42')]=getCallerId;function getCallerIdRandom(_0xec3308,_0x13baf4){var _0x58543e;var _0x1e32c6;var _0x201b1f;if(_0x13baf4<=0x0){_0x13baf4=0x1;}_0x58543e=new RegExp(_0x22a6('0x43')+_0x13baf4+'}$');_0x1e32c6=Math[_0x22a6('0x44')](0xa,_0x13baf4-0x1);_0x201b1f=Math['pow'](0xa,_0x13baf4)-0x1;return util[_0x22a6('0x45')]('%s',_[_0x22a6('0x46')](_0xec3308,_0x58543e,_[_0x22a6('0x47')](_0x1e32c6,_0x201b1f)[_0x22a6('0x48')]()));}exports[_0x22a6('0x49')]=getCallerIdRandom;function decrementOriginate(_0x3a370e){if(_0x3a370e[_0x22a6('0x26')]&&_0x3a370e[_0x22a6('0x26')]>0x0){_0x3a370e['originated']-=0x1;}else{logger[_0x22a6('0x4a')](_0x22a6('0x4b'));}}exports[_0x22a6('0x4c')]=decrementOriginate;function checkContactEmpty(_0x19a2d9){return _0x19a2d9&&_0x19a2d9['length']>0x0;}exports[_0x22a6('0x4d')]=checkContactEmpty;function erlangb(_0x2e1cd9,_0x3bbd49){if(_0x3bbd49===0x0){return 0x0;}var _0x13e4f2=0x1;for(var _0x3a0bcf=0x1;_0x3a0bcf<=_0x3bbd49;_0x3a0bcf+=0x1){_0x13e4f2=0x1+_0x13e4f2*_0x3a0bcf/_0x2e1cd9;}return 0x1/_0x13e4f2;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x3cd7c7,_0x2cbd92,_0x4e7ee6){if(_0x2cbd92>_0x4e7ee6){for(var _0x44127a=0x0;_0x44127a<_0x2cbd92-_0x4e7ee6;_0x44127a+=0x1){decrementOriginate(_0x3cd7c7);}}}exports[_0x22a6('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x3fc2bb){var _0x469fff={};var _0x572d1a=['id',_0x22a6('0x4f'),'description','tags',_0x22a6('0x50')];if(_0x3fc2bb){for(var _0xc3d6ce in _0x3fc2bb){if(typeof _0x3fc2bb[_0xc3d6ce]!==_0x22a6('0x51')){if(!_['isNil'](_0x3fc2bb[_0xc3d6ce])&&!_0x572d1a['includes'](_0xc3d6ce)){_0x469fff[util['format'](_0x22a6('0x52'),_0x22a6('0x53'),_0xc3d6ce['toUpperCase']())]=_0x3fc2bb[_0xc3d6ce];}}}}return _0x469fff;}exports[_0x22a6('0x54')]=setXMDContactVariables;
\ No newline at end of file
+var _0xbe7a=['isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','updatedAt','%s%s','XMD-','toUpperCase','setXMDContactVariables','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','dialMethod','preview'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xbe7a,0x99));var _0xabe7=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xbe7a[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var moment=require(_0xabe7('0x0'));var util=require(_0xabe7('0x1'));var logger=require(_0xabe7('0x2'))(_0xabe7('0x3'));var timezones=require(_0xabe7('0x4'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xabe7('0x5'),'BLACKLIST':_0xabe7('0x6'),'CONTACTS_RESCHEDULED':_0xabe7('0x7'),'DEACTIVATED':_0xabe7('0x8'),'DISACTIVED':_0xabe7('0x9'),'EMPTY_INTERVAL':_0xabe7('0xa'),'INACTIVE':_0xabe7('0xb'),'NO_AGENTS_LOGGED':_0xabe7('0xc'),'NO_AVAILABLE_CONTACTS':_0xabe7('0xd'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xabe7('0xe'),'QUEUE_RECALL':_0xabe7('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xabe7('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5119ec){return _0x5119ec[_0xabe7('0x11')]===_0xabe7('0x12');}exports[_0xabe7('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x543213){return _0x543213[_0xabe7('0x14')]===_0xabe7('0x15');}exports[_0xabe7('0x16')]=isIVRCampaign;function isOutboundQueue(_0x3d465b){return _0x3d465b[_0xabe7('0x14')]===_0xabe7('0x17');}exports[_0xabe7('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0xa067f3){return _0xa067f3[_0xabe7('0x19')];}exports[_0xabe7('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x458773){return _0x458773['active'];}exports[_0xabe7('0x1b')]=isIVRCampaignActive;function getSeconds(_0x2ebc73,_0x38be1a){var _0x3ef09a=moment(_0x2ebc73)['milliseconds'](0x0);var _0x2dc129=moment(_0x38be1a)[_0xabe7('0x1c')](0x0);return _0x3ef09a[_0xabe7('0x1d')](_0x2dc129,_0xabe7('0x1e'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x3b57b1,_0x4c0c93){var _0x4ca414=![];var _0x251d37=_0x3b57b1['dialMethod']!==_0x4c0c93['dialMethod']||_0x3b57b1[_0xabe7('0x19')]!==_0x4c0c93[_0xabe7('0x19')]||_0x3b57b1['message']!==_0x4c0c93[_0xabe7('0x1f')];var _0x317deb=_0x3b57b1[_0xabe7('0x20')]!==_0x4c0c93['available']||_0x3b57b1[_0xabe7('0x21')]!==_0x4c0c93[_0xabe7('0x21')]||_0x3b57b1['loggedInDb']!==_0x4c0c93[_0xabe7('0x22')]||_0x3b57b1[_0xabe7('0x23')]!==_0x4c0c93[_0xabe7('0x23')]||_0x3b57b1['talking']!==_0x4c0c93[_0xabe7('0x24')]||_0x3b57b1[_0xabe7('0x25')]!==_0x4c0c93['pTalking']||_0x3b57b1[_0xabe7('0x26')]!==_0x4c0c93[_0xabe7('0x26')]||_0x3b57b1[_0xabe7('0x27')]!==_0x4c0c93[_0xabe7('0x27')]||_0x3b57b1[_0xabe7('0x28')]!==_0x4c0c93[_0xabe7('0x28')];if(_0x3b57b1[_0xabe7('0x29')]&&_0x4c0c93[_0xabe7('0x29')]){_0x4ca414=_0x3b57b1[_0xabe7('0x29')][_0xabe7('0x2a')]!==_0x4c0c93[_0xabe7('0x29')][_0xabe7('0x2a')]||_0x3b57b1['Trunk']['active']!==_0x4c0c93[_0xabe7('0x29')][_0xabe7('0x2b')];}return _0x251d37||_0x317deb||_0x4ca414;}exports[_0xabe7('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4291f6){var _0x5b4ebc=null;var _0x249ca6=_0x4291f6[_0xabe7('0x2d')];if(_[_0xabe7('0x2e')](_0x4291f6[_0xabe7('0x2f')])||_[_0xabe7('0x2e')](_0x4291f6[_0xabe7('0x30')])||_[_0xabe7('0x2e')](_0x4291f6[_0xabe7('0x30')][_0xabe7('0x31')])){_0x5b4ebc=CAMPAIGN_STATUS[_0xabe7('0x32')];}else if(_[_0xabe7('0x33')](_0x4291f6[_0xabe7('0x2f')])||_[_0xabe7('0x33')](_0x4291f6[_0xabe7('0x30')][_0xabe7('0x31')])){_0x5b4ebc=CAMPAIGN_STATUS[_0xabe7('0x34')];}else if(_0x249ca6&&!timezones[_0x249ca6]){_0x5b4ebc=CAMPAIGN_STATUS[_0xabe7('0x35')];}return _0x5b4ebc;}function checkAnyValidTrunk(_0x11e35e,_0xfbf343){var _0x18820e=null;var _0x4e6213='SIP/';var _0x5e343c=[_0xabe7('0x36'),'unmonitored'];var _0x2fb568=!![];if(_0x11e35e[_0xabe7('0x29')]&&_0x11e35e[_0xabe7('0x29')][_0xabe7('0x2b')]){_0x4e6213+=_0x11e35e[_0xabe7('0x29')][_0xabe7('0x2a')];_0x18820e=_0xfbf343[_0x4e6213];_0x2fb568=_0x5e343c[_0xabe7('0x37')](_0x18820e[_0xabe7('0x38')]);}else if(_0x11e35e[_0xabe7('0x39')]&&_0x11e35e['TrunkBackup'][_0xabe7('0x2b')]){_0x4e6213+=_0x11e35e[_0xabe7('0x39')][_0xabe7('0x2a')];_0x18820e=_0xfbf343[_0x4e6213];_0x2fb568=_0x5e343c[_0xabe7('0x37')](_0x18820e[_0xabe7('0x38')]);}return _0x2fb568;}function getQueueCampaignStatusMessage(_0x4f50bf,_0x53d432){var _0x17fcde=CAMPAIGN_STATUS[_0xabe7('0x5')];var _0x706a5e=isPreviewCampaign(_0x4f50bf);if(!isQueueCampaignActive(_0x4f50bf)){if(_0x706a5e){_0x17fcde=CAMPAIGN_STATUS[_0xabe7('0x3a')];}else{if(_0x4f50bf[_0xabe7('0x28')]===0x0&&_0x4f50bf[_0xabe7('0x24')]===0x0&&_0x4f50bf[_0xabe7('0x26')]===0x0&&(_0x4f50bf[_0xabe7('0x25')]||0x0)===0x0){_0x17fcde=CAMPAIGN_STATUS[_0xabe7('0x3a')];}else{_0x17fcde=CAMPAIGN_STATUS[_0xabe7('0x3b')];}}}else if(_0x4f50bf['loggedIn']===0x0){_0x17fcde=CAMPAIGN_STATUS[_0xabe7('0x3c')];}else if(!checkAnyValidTrunk(_0x4f50bf,_0x53d432)){_0x17fcde=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x4f50bf)){var _0x352d3d=checkAnyValidQueueCampaignInterval(_0x4f50bf);if(_0x352d3d){_0x17fcde=_0x352d3d;}}return _0x17fcde;}exports[_0xabe7('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x8e77f0){var _0x33fc51=CAMPAIGN_STATUS[_0xabe7('0x3b')];if(_0x8e77f0['originated']===0x0&&_0x8e77f0[_0xabe7('0x24')]===0x0&&_0x8e77f0['waiting']===0x0&&(_0x8e77f0[_0xabe7('0x25')]||0x0)===0x0){_0x33fc51=CAMPAIGN_STATUS[_0xabe7('0x3a')];}return _0x33fc51;}exports[_0xabe7('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2b5b9b){var _0x26456c=_0x2b5b9b[_0xabe7('0x3f')](/"(.*?)"/);return _0x26456c?_0x26456c[0x1]:_0x2b5b9b;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x15df20,_0x39d264,_0x423544){if(!_[_0xabe7('0x40')](_0x423544)&&typeof _0x423544===_0xabe7('0x41')&&!_[_0xabe7('0x33')](_0x423544)){if(!_[_0xabe7('0x40')](_0x39d264)&&typeof _0x39d264===_0xabe7('0x41')&&!_[_0xabe7('0x33')](_0x39d264)){return util[_0xabe7('0x42')]('\x22%s\x22\x20<%s>',_0x39d264,_0x423544);}return util[_0xabe7('0x42')](_0xabe7('0x43'),_0x423544,_0x423544);}if(!_[_0xabe7('0x40')](_0x15df20)&&typeof _0x15df20===_0xabe7('0x41')&&!_[_0xabe7('0x33')](_0x15df20)){return _0x15df20;}return _0xabe7('0x44');}exports[_0xabe7('0x45')]=getCallerId;function getCallerIdRandom(_0x1d320b,_0x3e0330){var _0x3c7ed2;var _0x5dad8a;var _0x121cae;if(_0x3e0330<=0x0){_0x3e0330=0x1;}_0x3c7ed2=new RegExp(_0xabe7('0x46')+_0x3e0330+'}$');_0x5dad8a=Math[_0xabe7('0x47')](0xa,_0x3e0330-0x1);_0x121cae=Math[_0xabe7('0x47')](0xa,_0x3e0330)-0x1;return util[_0xabe7('0x42')]('%s',_[_0xabe7('0x48')](_0x1d320b,_0x3c7ed2,_[_0xabe7('0x49')](_0x5dad8a,_0x121cae)['toString']()));}exports[_0xabe7('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x10531a){if(_0x10531a[_0xabe7('0x28')]&&_0x10531a[_0xabe7('0x28')]>0x0){_0x10531a[_0xabe7('0x28')]-=0x1;}else{logger['error'](_0xabe7('0x4b'));}}exports[_0xabe7('0x4c')]=decrementOriginate;function checkContactEmpty(_0x9a36fd){return _0x9a36fd&&_0x9a36fd[_0xabe7('0x4d')]>0x0;}exports[_0xabe7('0x4e')]=checkContactEmpty;function erlangb(_0x480dbe,_0x22df8e){if(_0x22df8e===0x0){return 0x0;}var _0xf1c699=0x1;for(var _0x5aa327=0x1;_0x5aa327<=_0x22df8e;_0x5aa327+=0x1){_0xf1c699=0x1+_0xf1c699*_0x5aa327/_0x480dbe;}return 0x1/_0xf1c699;}exports[_0xabe7('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0xe3471f,_0x546c78,_0xe534e5){if(_0x546c78>_0xe534e5){for(var _0x73ba4a=0x0;_0x73ba4a<_0x546c78-_0xe534e5;_0x73ba4a+=0x1){decrementOriginate(_0xe3471f);}}}exports[_0xabe7('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x447d2b){var _0x59fd22={};var _0x302160=['id','createdAt','description','tags',_0xabe7('0x51')];if(_0x447d2b){for(var _0x4c0e28 in _0x447d2b){if(typeof _0x447d2b[_0x4c0e28]!=='undefined'){if(!_[_0xabe7('0x2e')](_0x447d2b[_0x4c0e28])&&!_0x302160[_0xabe7('0x37')](_0x4c0e28)){_0x59fd22[util[_0xabe7('0x42')](_0xabe7('0x52'),_0xabe7('0x53'),_0x4c0e28[_0xabe7('0x54')]())]=_0x447d2b[_0x4c0e28];}}}}return _0x59fd22;}exports[_0xabe7('0x55')]=setXMDContactVariables;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2688c3,_0x25f2de){var _0x942e76=function(_0x1f3e35){while(--_0x1f3e35){_0x2688c3['push'](_0x2688c3['shift']());}};_0x942e76(++_0x25f2de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x31bd0d,_0x3f4104){var _0x4a58d9=function(_0x287a08){while(--_0x287a08){_0x31bd0d['push'](_0x31bd0d['shift']());}};_0x4a58d9(++_0x3f4104);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3ed=['Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','format','path','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xe3ed,0x1d5));var _0xde3e=function(_0x5ea1ad,_0x2dfa93){_0x5ea1ad=_0x5ea1ad-0x0;var _0x16726c=_0xe3ed[_0x5ea1ad];return _0x16726c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xde3e('0x0'));var uuid=require(_0xde3e('0x1'));var moment=require(_0xde3e('0x2'));var path=require('path');var tiff2pdf=require(_0xde3e('0x3'));var gs=require(_0xde3e('0x4'));var logger=require(_0xde3e('0x5'))(_0xde3e('0x6'));var ami=require(_0xde3e('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0xde3e('0x8'));var ut=require(_0xde3e('0x9'));var Action=require(_0xde3e('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xde3e('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x279509){this[_0xde3e('0xc')]={};this[_0xde3e('0xd')]=_0x279509[_0xde3e('0xd')];this[_0xde3e('0xe')]=_0x279509[_0xde3e('0xe')];this[_0xde3e('0xf')]={};ami['on'](_0xde3e('0x10'),this[_0xde3e('0x11')][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x13'),this['syncVarSet'][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x14'),this['syncNewState']['bind'](this));ami['on'](_0xde3e('0x15'),this['syncNewExten'][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x16'),this[_0xde3e('0x17')]['bind'](this));ami['on'](_0xde3e('0x18'),this['syncReceiveFax'][_0xde3e('0x12')](this));ami['on'](_0xde3e('0x19'),this[_0xde3e('0x1a')]['bind'](this));ami['on'](_0xde3e('0x1b'),this[_0xde3e('0x1c')][_0xde3e('0x12')](this));}Fax[_0xde3e('0x1d')][_0xde3e('0x11')]=function(_0x228dd1){if(_0x228dd1['context']===_0xde3e('0x1e')){for(var _0x5b2a72 in this[_0xde3e('0xd')]){if(this['faxAccounts'][_0xde3e('0x1f')](_0x5b2a72)){if(_0x228dd1['exten']===this[_0xde3e('0xd')][_0x5b2a72][_0xde3e('0x20')]){this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]={};this['channels'][_0x228dd1[_0xde3e('0x21')]][_0xde3e('0x22')]=_0x228dd1['channel'];this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]['id']=this[_0xde3e('0xd')][_0x5b2a72]['id'];this['channels'][_0x228dd1['uniqueid']]['name']=this[_0xde3e('0xd')][_0x5b2a72][_0xde3e('0x23')];logger[_0xde3e('0x24')](_0x228dd1[_0xde3e('0x21')],_0xde3e('0x25'));}}}}if(this['actions'][_0x228dd1[_0xde3e('0x21')]]){this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]={};this[_0xde3e('0xc')][_0x228dd1[_0xde3e('0x21')]]['channel']=_0x228dd1[_0xde3e('0x22')];logger[_0xde3e('0x24')](_0x228dd1[_0xde3e('0x21')],_0xde3e('0x25'));}};Fax[_0xde3e('0x1d')][_0xde3e('0x26')]=function(_0x1b4f95){if(this[_0xde3e('0xc')][_0x1b4f95[_0xde3e('0x21')]]){for(var _0x41fe33 in _0x1b4f95[_0xde3e('0x27')]){if(_0x1b4f95[_0xde3e('0x27')][_0xde3e('0x1f')](_0x41fe33)){this['channels'][_0x1b4f95[_0xde3e('0x21')]][_0x41fe33]=_0x1b4f95[_0xde3e('0x28')];}}}};Fax[_0xde3e('0x1d')][_0xde3e('0x29')]=function(_0x347ae1){if(this[_0xde3e('0xc')][_0x347ae1[_0xde3e('0x21')]]){this[_0xde3e('0xc')][_0x347ae1[_0xde3e('0x21')]][_0xde3e('0x2a')]=_0x347ae1['channelstate'];this[_0xde3e('0xc')][_0x347ae1[_0xde3e('0x21')]][_0xde3e('0x2b')]=_0x347ae1[_0xde3e('0x2b')];}};Fax[_0xde3e('0x1d')][_0xde3e('0x2c')]=function(_0x187be0){if(this['channels'][_0x187be0[_0xde3e('0x21')]]){for(var _0x30c1fa in _0x187be0[_0xde3e('0x27')]){if(_0x187be0[_0xde3e('0x27')][_0xde3e('0x1f')](_0x30c1fa)){this['channels'][_0x187be0[_0xde3e('0x21')]][_0x30c1fa]=_0x187be0[_0xde3e('0x28')];}}}};Fax[_0xde3e('0x1d')]['syncFaxStatus']=function(_0x3aa19f){if(this['channels'][_0x3aa19f[_0xde3e('0x21')]]){this['channels'][_0x3aa19f[_0xde3e('0x21')]]['operation']=_0x3aa19f['operation'];this[_0xde3e('0xc')][_0x3aa19f['uniqueid']]['status']=_0x3aa19f[_0xde3e('0x2d')];this[_0xde3e('0xc')][_0x3aa19f['uniqueid']][_0xde3e('0x20')]=_0x3aa19f['localstationid'];this[_0xde3e('0xc')][_0x3aa19f['uniqueid']][_0xde3e('0x2e')]=_0x3aa19f[_0xde3e('0x2e')];logger[_0xde3e('0x24')](_0x3aa19f[_0xde3e('0x21')],_0xde3e('0x2f'));}};Fax['prototype']['syncReceiveFax']=function(_0x4ebc17){var _0x299114=this;if(this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]]){var _0x4b9682=this[_0xde3e('0xc')][_0x4ebc17['uniqueid']]['id'];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x30')]=_0x4ebc17[_0xde3e('0x30')];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]]['pagestransferred']=_0x4ebc17['pagestransferred'];this['channels'][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x20')]=_0x4ebc17[_0xde3e('0x20')];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x31')]=_0x4ebc17[_0xde3e('0x31')];this['channels'][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x32')]=_0x4ebc17[_0xde3e('0x32')];this['channels'][_0x4ebc17['uniqueid']][_0xde3e('0x2e')]=_0x4ebc17['filename'];this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x33')]=_0x4ebc17[_0xde3e('0x33')];if(this[_0xde3e('0xc')][_0x4ebc17[_0xde3e('0x21')]][_0xde3e('0x34')]>0x0){tiff2pdf(_0x4ebc17[_0xde3e('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x1d2f3c){logger[_0xde3e('0x24')](_0x4ebc17['uniqueid'],_0xde3e('0x35'),_0x1d2f3c[_0xde3e('0x36')]);attachment[_0xde3e('0x37')]({'name':path[_0xde3e('0x38')](_0x4ebc17[_0xde3e('0x2e')])['name'],'basename':path['parse'](_0x4ebc17[_0xde3e('0x2e')])[_0xde3e('0x23')]+_0xde3e('0x39'),'type':_0xde3e('0x3a')})[_0xde3e('0x3b')](function(_0x26dd0f){faxAccount['notify'](_0x4b9682,{'from':_0x4ebc17[_0xde3e('0x33')],'mapKey':'fax','body':path[_0xde3e('0x38')](_0x4ebc17['filename'])[_0xde3e('0x23')]+_0xde3e('0x39'),'AttachmentId':_0x26dd0f['id']})[_0xde3e('0x3c')](function(_0x47b92e){logger[_0xde3e('0x3d')](_0x4ebc17[_0xde3e('0x21')],'\x20notify\x20',JSON[_0xde3e('0x3e')](_0x47b92e));});})['catch'](function(_0x60636d){logger[_0xde3e('0x3d')](_0x4ebc17['uniqueid'],_0xde3e('0x3f'),JSON['stringify'](_0x60636d));});});}logger[_0xde3e('0x24')](_0x4ebc17[_0xde3e('0x21')],_0xde3e('0x3f'));}};Fax[_0xde3e('0x1d')][_0xde3e('0x1c')]=function(_0x6fb482){if(this[_0xde3e('0xf')][_0x6fb482[_0xde3e('0x21')]]){_[_0xde3e('0x40')](this['channels'][_0x6fb482['uniqueid']],_[_0xde3e('0x41')](_0x6fb482,[_0xde3e('0x42'),_0xde3e('0x43')]));}};function updateStatus(_0x5aeb34){if(_0x5aeb34[_0xde3e('0x44')]){faxMessage['update'](_0x5aeb34[_0xde3e('0x44')],{'failMessage':_0xde3e('0x45')})['then'](function(_0x2173e4){ut[_0xde3e('0x46')]('[Fax][Message][Error][Updated]',_0x2173e4);})[_0xde3e('0x3c')](function(_0x4c9749){ut[_0xde3e('0x46')](_0xde3e('0x47'),_0x4c9749);});}else{ut[_0xde3e('0x46')](_0xde3e('0x48'));}}Fax[_0xde3e('0x1d')][_0xde3e('0x49')]=function(_0x233795,_0x186385,_0x5ed13a){var _0x4a5ae8=this;var _0x1a4140={};if(_0x186385){_0x1a4140={'read':_0x186385};}else{_0x1a4140={'failMessage':_0x5ed13a};}if(this['actions'][_0x233795][_0xde3e('0x44')]){faxMessage[_0xde3e('0x4a')](this[_0xde3e('0xf')][_0x233795]['AttachmentId'],_0x1a4140)[_0xde3e('0x3b')](function(_0x5408d9){ut[_0xde3e('0x46')](_0xde3e('0x4b'),_0x5408d9);})[_0xde3e('0x3c')](function(_0x3e8bc8){ut[_0xde3e('0x46')]('[Fax][Message][NoUpdate1]',_0x3e8bc8);})[_0xde3e('0x4c')](function(){delete _0x4a5ae8[_0xde3e('0xc')][_0x233795];delete _0x4a5ae8['actions'][_0x233795];});}else{ut['logger'](_0xde3e('0x4d'));delete this[_0xde3e('0xc')][_0x233795];delete this['actions'][_0x233795];}};Fax['prototype'][_0xde3e('0x1a')]=function(_0x287bf5){var _0x2d2ad2=this;if(this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]]){if(this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]){this['channels'][_0x287bf5[_0xde3e('0x21')]]['id']=this[_0xde3e('0xf')][_0x287bf5['uniqueid']]['id'];this['channels'][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x23')]=this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]['name'];}logger['info'](_0x287bf5[_0xde3e('0x21')],this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]?_0xde3e('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0xde3e('0x3e')](this['channels'][_0x287bf5[_0xde3e('0x21')]]));if(this[_0xde3e('0xf')][_0x287bf5[_0xde3e('0x21')]]){if(this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x4f')]>0x0&&this[_0xde3e('0xc')][_0x287bf5['uniqueid']][_0xde3e('0x16')]===_0xde3e('0x50')){this[_0xde3e('0x49')](_0x287bf5[_0xde3e('0x21')],!![]);}else{this[_0xde3e('0x49')](_0x287bf5[_0xde3e('0x21')],![],this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x51')]?'SENDING\x20FAILED:\x20'+this[_0xde3e('0xc')][_0x287bf5[_0xde3e('0x21')]][_0xde3e('0x51')]:_0xde3e('0x52'));}}}};Fax['prototype'][_0xde3e('0x53')]=function(_0xf8c5e9){var _0x457607=this;return new BPromise(function(_0x405c2b,_0x2436e6){_0x457607[_0xde3e('0x54')](_0xf8c5e9,_0x457607[_0xde3e('0xd')][_0xf8c5e9[_0xde3e('0x55')]])[_0xde3e('0x3b')](function(_0x1a6ecd){ut[_0xde3e('0x46')](_0xde3e('0x56'),_0x1a6ecd);_0x405c2b(ut[_0xde3e('0x36')](_0xde3e('0x57')));})['catch'](function(_0xfe3441){ut[_0xde3e('0x46')](_0xde3e('0x58'),_0xfe3441);updateStatus(_0xf8c5e9);_0x2436e6(ut[_0xde3e('0x36')](_0xde3e('0x59')));});});};Fax['prototype'][_0xde3e('0x5a')]=function(_0xe8e060){var _0x14d84b=this;return new BPromise(function(_0x54978a,_0x3f0956){var _0x1d8a47=_0x14d84b['checkTrunk'](_0x14d84b[_0xde3e('0xd')][_0xe8e060[_0xde3e('0x55')]][_0xde3e('0x5b')],_0xe8e060);if(_0x1d8a47[_0xde3e('0x5c')]){_0x54978a(ut['message']('Trunk\x20Reachable'));}else{_0x3f0956(ut[_0xde3e('0x36')](_0x1d8a47['message']));}});};function originate(_0x3b40a4,_0x37f569,_0x1d550e){return new BPromise(function(_0x1884a6,_0x42da41){if(_0x1d550e){var _0x480ee3=util[_0xde3e('0x5d')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xde3e('0x38')](_0x3b40a4[_0xde3e('0x5e')])['name'],_0x3b40a4[_0xde3e('0x5e')]);gs[_0xde3e('0x5f')](_0x480ee3)[_0xde3e('0x3b')](function(){_0x3b40a4[_0xde3e('0x5e')]=util[_0xde3e('0x5d')](_0xde3e('0x60'),path['parse'](_0x3b40a4[_0xde3e('0x5e')])[_0xde3e('0x61')],path['parse'](_0x3b40a4['path'])[_0xde3e('0x23')]);_0x37f569[_0xde3e('0x62')]=_0x3b40a4[_0xde3e('0x5e')];ut[_0xde3e('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0xde3e('0x63')](ut['variablesAction'](_0x3b40a4,_0x37f569))[_0xde3e('0x3b')](function(_0x10e786){_0x1884a6(_0x10e786);})[_0xde3e('0x3c')](function(_0xd52bfe){_0x42da41(_0xd52bfe);});})[_0xde3e('0x3c')](function(_0x143760){_0x42da41(_0x143760);});}else{ami[_0xde3e('0x63')](ut[_0xde3e('0x64')](_0x3b40a4,_0x37f569))['then'](function(_0x117b6a){_0x1884a6(_0x117b6a);})[_0xde3e('0x3c')](function(_0xe28897){_0x42da41(_0xe28897);});}});}Fax[_0xde3e('0x1d')][_0xde3e('0x54')]=function(_0x18fe77,_0x2a42ed){var _0xa89255=this;return new BPromise(function(_0x1582d6,_0x157dbb){var _0x230c68=uuid['v4']();var _0x7e8c46=ut[_0xde3e('0x65')](_0x18fe77,_0x2a42ed);_0xa89255[_0xde3e('0xf')][_0x230c68]=new Action(_0x230c68,_0x2a42ed,_0x18fe77);var _0x2b26fa=_0xa89255[_0xde3e('0xf')][_0x230c68];if(path[_0xde3e('0x38')](_0x18fe77['path'])[_0xde3e('0x66')]==='.pdf'){originate(_0x2b26fa,_0x7e8c46,!![])['then'](function(_0x4e745b){_0x1582d6(_0x4e745b);})[_0xde3e('0x3c')](function(_0x1dc00a){_0x157dbb(_0x1dc00a);});}else{originate(_0x2b26fa,_0x7e8c46,![])[_0xde3e('0x3b')](function(_0x236f06){_0x1582d6(_0x236f06);})['catch'](function(_0x5a3972){_0x157dbb(_0x5a3972);});}});};Fax[_0xde3e('0x1d')][_0xde3e('0x67')]=function(_0x5c22cf){return!_[_0xde3e('0x68')](_0x5c22cf)&&!_[_0xde3e('0x68')](_0x5c22cf[_0xde3e('0x23')])&&!_[_0xde3e('0x68')](_0x5c22cf[_0xde3e('0x69')])&&_0x5c22cf[_0xde3e('0x69')]&&!_['isNil'](this[_0xde3e('0xe')][util[_0xde3e('0x5d')](_0xde3e('0x6a'),_0x5c22cf[_0xde3e('0x23')])])&&!_[_0xde3e('0x68')](this[_0xde3e('0xe')][util[_0xde3e('0x5d')](_0xde3e('0x6a'),_0x5c22cf[_0xde3e('0x23')])][_0xde3e('0x2d')])&&(this['trunks'][util['format']('SIP/%s',_0x5c22cf['name'])][_0xde3e('0x2d')]===_0xde3e('0x6b')||this[_0xde3e('0xe')][util['format']('SIP/%s',_0x5c22cf['name'])]['status']===_0xde3e('0x6c'));};Fax[_0xde3e('0x1d')][_0xde3e('0x6d')]=function(_0x24eea5,_0x2ad7eb){if(!this[_0xde3e('0x67')](_0x24eea5)){ut['logger'](_0xde3e('0x6e'),_['isNil'](_0x24eea5)?'':_0x24eea5[_0xde3e('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xde3e('0x68')](_0x2ad7eb[_0xde3e('0x6')])){ut[_0xde3e('0x46')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xde3e('0x3e')](_0x2ad7eb));return{'isValid':![],'message':_0xde3e('0x6f')};}if(_[_0xde3e('0x68')](_0x2ad7eb[_0xde3e('0x5e')])){ut[_0xde3e('0x46')](_0xde3e('0x70'),JSON[_0xde3e('0x3e')](_0x2ad7eb));return{'isValid':![],'message':_0xde3e('0x71')};}return{'isValid':!![],'message':_0xde3e('0x72')};};module[_0xde3e('0x73')]=Fax;
\ No newline at end of file
+var _0xb923=['Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','util','lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','channels','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','reason','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','actions','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb923,0xfe));var _0x3b92=function(_0x23898c,_0x25d8a2){_0x23898c=_0x23898c-0x0;var _0xcf58ac=_0xb923[_0x23898c];return _0xcf58ac;};'use strict';var util=require(_0x3b92('0x0'));var _=require(_0x3b92('0x1'));var BPromise=require('bluebird');var uuid=require(_0x3b92('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3b92('0x3'));var gs=require(_0x3b92('0x4'));var logger=require(_0x3b92('0x5'))(_0x3b92('0x6'));var ami=require('../ami');var rpcDb=require(_0x3b92('0x7'));var Channel=require(_0x3b92('0x8'));var ut=require(_0x3b92('0x9'));var Action=require(_0x3b92('0xa'));var faxAccount=require(_0x3b92('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x3b92('0xc'));function Fax(_0x43c2eb){this['channels']={};this['faxAccounts']=_0x43c2eb[_0x3b92('0xd')];this[_0x3b92('0xe')]=_0x43c2eb[_0x3b92('0xe')];this['actions']={};ami['on'](_0x3b92('0xf'),this[_0x3b92('0x10')]['bind'](this));ami['on'](_0x3b92('0x11'),this[_0x3b92('0x12')][_0x3b92('0x13')](this));ami['on'](_0x3b92('0x14'),this[_0x3b92('0x15')][_0x3b92('0x13')](this));ami['on'](_0x3b92('0x16'),this[_0x3b92('0x17')]['bind'](this));ami['on'](_0x3b92('0x18'),this[_0x3b92('0x19')][_0x3b92('0x13')](this));ami['on'](_0x3b92('0x1a'),this[_0x3b92('0x1b')][_0x3b92('0x13')](this));ami['on'](_0x3b92('0x1c'),this[_0x3b92('0x1d')][_0x3b92('0x13')](this));ami['on'](_0x3b92('0x1e'),this[_0x3b92('0x1f')][_0x3b92('0x13')](this));}Fax[_0x3b92('0x20')][_0x3b92('0x10')]=function(_0x1ea66b){if(_0x1ea66b[_0x3b92('0x21')]===_0x3b92('0x22')){for(var _0x1f4910 in this['faxAccounts']){if(this[_0x3b92('0xd')]['hasOwnProperty'](_0x1f4910)){if(_0x1ea66b[_0x3b92('0x23')]===this[_0x3b92('0xd')][_0x1f4910][_0x3b92('0x24')]){this['channels'][_0x1ea66b[_0x3b92('0x25')]]={};this['channels'][_0x1ea66b[_0x3b92('0x25')]]['channel']=_0x1ea66b[_0x3b92('0x26')];this['channels'][_0x1ea66b[_0x3b92('0x25')]]['id']=this[_0x3b92('0xd')][_0x1f4910]['id'];this[_0x3b92('0x27')][_0x1ea66b[_0x3b92('0x25')]][_0x3b92('0x28')]=this['faxAccounts'][_0x1f4910]['name'];logger[_0x3b92('0x29')](_0x1ea66b['uniqueid'],_0x3b92('0x2a'));}}}}if(this['actions'][_0x1ea66b[_0x3b92('0x25')]]){this[_0x3b92('0x27')][_0x1ea66b[_0x3b92('0x25')]]={};this[_0x3b92('0x27')][_0x1ea66b['uniqueid']][_0x3b92('0x26')]=_0x1ea66b['channel'];logger[_0x3b92('0x29')](_0x1ea66b[_0x3b92('0x25')],_0x3b92('0x2a'));}};Fax[_0x3b92('0x20')][_0x3b92('0x12')]=function(_0x571006){if(this[_0x3b92('0x27')][_0x571006[_0x3b92('0x25')]]){for(var _0x344ac4 in _0x571006[_0x3b92('0x2b')]){if(_0x571006[_0x3b92('0x2b')][_0x3b92('0x2c')](_0x344ac4)){this[_0x3b92('0x27')][_0x571006[_0x3b92('0x25')]][_0x344ac4]=_0x571006['value'];}}}};Fax[_0x3b92('0x20')][_0x3b92('0x15')]=function(_0x5a9b5d){if(this[_0x3b92('0x27')][_0x5a9b5d['uniqueid']]){this[_0x3b92('0x27')][_0x5a9b5d[_0x3b92('0x25')]][_0x3b92('0x2d')]=_0x5a9b5d[_0x3b92('0x2d')];this[_0x3b92('0x27')][_0x5a9b5d[_0x3b92('0x25')]][_0x3b92('0x2e')]=_0x5a9b5d['channelstatedesc'];}};Fax[_0x3b92('0x20')][_0x3b92('0x17')]=function(_0x420fbb){if(this[_0x3b92('0x27')][_0x420fbb['uniqueid']]){for(var _0x1110a2 in _0x420fbb['variable']){if(_0x420fbb['variable'][_0x3b92('0x2c')](_0x1110a2)){this['channels'][_0x420fbb[_0x3b92('0x25')]][_0x1110a2]=_0x420fbb['value'];}}}};Fax[_0x3b92('0x20')][_0x3b92('0x19')]=function(_0x3e079b){if(this[_0x3b92('0x27')][_0x3e079b['uniqueid']]){this[_0x3b92('0x27')][_0x3e079b['uniqueid']]['operation']=_0x3e079b[_0x3b92('0x2f')];this['channels'][_0x3e079b[_0x3b92('0x25')]][_0x3b92('0x30')]=_0x3e079b[_0x3b92('0x30')];this[_0x3b92('0x27')][_0x3e079b[_0x3b92('0x25')]][_0x3b92('0x24')]=_0x3e079b['localstationid'];this[_0x3b92('0x27')][_0x3e079b[_0x3b92('0x25')]][_0x3b92('0x31')]=_0x3e079b['filename'];logger[_0x3b92('0x29')](_0x3e079b['uniqueid'],_0x3b92('0x32'));}};Fax[_0x3b92('0x20')]['syncReceiveFax']=function(_0x278b6e){var _0x468cdd=this;if(this['channels'][_0x278b6e['uniqueid']]){var _0x27098e=this[_0x3b92('0x27')][_0x278b6e[_0x3b92('0x25')]]['id'];this['channels'][_0x278b6e[_0x3b92('0x25')]]['remotestationid']=_0x278b6e['remotestationid'];this[_0x3b92('0x27')][_0x278b6e[_0x3b92('0x25')]][_0x3b92('0x33')]=_0x278b6e[_0x3b92('0x33')];this['channels'][_0x278b6e['uniqueid']]['localstationid']=_0x278b6e[_0x3b92('0x24')];this[_0x3b92('0x27')][_0x278b6e[_0x3b92('0x25')]]['resolution']=_0x278b6e[_0x3b92('0x34')];this['channels'][_0x278b6e[_0x3b92('0x25')]][_0x3b92('0x35')]=_0x278b6e[_0x3b92('0x35')];this[_0x3b92('0x27')][_0x278b6e['uniqueid']]['filename']=_0x278b6e[_0x3b92('0x31')];this['channels'][_0x278b6e['uniqueid']][_0x3b92('0x36')]=_0x278b6e[_0x3b92('0x36')];if(this[_0x3b92('0x27')][_0x278b6e[_0x3b92('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0x278b6e['filename'],_0x3b92('0x37'),function(_0x4795b7){logger['info'](_0x278b6e[_0x3b92('0x25')],'\x20result\x20conversion\x20file\x20',_0x4795b7['message']);attachment[_0x3b92('0x38')]({'name':path[_0x3b92('0x39')](_0x278b6e[_0x3b92('0x31')])[_0x3b92('0x28')],'basename':path[_0x3b92('0x39')](_0x278b6e[_0x3b92('0x31')])['name']+_0x3b92('0x3a'),'type':'application/pdf'})['then'](function(_0x423291){faxAccount[_0x3b92('0x3b')](_0x27098e,{'from':_0x278b6e['calleridnum'],'mapKey':_0x3b92('0x6'),'body':path['parse'](_0x278b6e['filename'])[_0x3b92('0x28')]+_0x3b92('0x3a'),'AttachmentId':_0x423291['id']})[_0x3b92('0x3c')](function(_0x40ca77){logger[_0x3b92('0x3d')](_0x278b6e[_0x3b92('0x25')],_0x3b92('0x3e'),JSON[_0x3b92('0x3f')](_0x40ca77));});})[_0x3b92('0x3c')](function(_0x486f1e){logger[_0x3b92('0x3d')](_0x278b6e[_0x3b92('0x25')],_0x3b92('0x40'),JSON[_0x3b92('0x3f')](_0x486f1e));});});}logger[_0x3b92('0x29')](_0x278b6e['uniqueid'],_0x3b92('0x40'));}};Fax[_0x3b92('0x20')][_0x3b92('0x1f')]=function(_0x576d19){if(this['actions'][_0x576d19[_0x3b92('0x25')]]){_[_0x3b92('0x41')](this['channels'][_0x576d19['uniqueid']],_['pick'](_0x576d19,['response',_0x3b92('0x42')]));}};function updateStatus(_0x24e6dd){if(_0x24e6dd['AttachmentId']){faxMessage[_0x3b92('0x43')](_0x24e6dd['AttachmentId'],{'failMessage':_0x3b92('0x44')})[_0x3b92('0x45')](function(_0x5a6d9d){ut['logger'](_0x3b92('0x46'),_0x5a6d9d);})[_0x3b92('0x3c')](function(_0x22f5b0){ut[_0x3b92('0x47')](_0x3b92('0x48'),_0x22f5b0);});}else{ut['logger'](_0x3b92('0x49'));}}Fax[_0x3b92('0x20')][_0x3b92('0x4a')]=function(_0x3edc06,_0x43f55a,_0x203114){var _0x282930=this;var _0x4ca3c8={};if(_0x43f55a){_0x4ca3c8={'read':_0x43f55a};}else{_0x4ca3c8={'failMessage':_0x203114};}if(this['actions'][_0x3edc06][_0x3b92('0x4b')]){faxMessage['update'](this[_0x3b92('0x4c')][_0x3edc06][_0x3b92('0x4b')],_0x4ca3c8)[_0x3b92('0x45')](function(_0x503f1d){ut[_0x3b92('0x47')](_0x3b92('0x4d'),_0x503f1d);})[_0x3b92('0x3c')](function(_0xec721a){ut[_0x3b92('0x47')](_0x3b92('0x4e'),_0xec721a);})[_0x3b92('0x4f')](function(){delete _0x282930[_0x3b92('0x27')][_0x3edc06];delete _0x282930[_0x3b92('0x4c')][_0x3edc06];});}else{ut[_0x3b92('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x3b92('0x27')][_0x3edc06];delete this[_0x3b92('0x4c')][_0x3edc06];}};Fax[_0x3b92('0x20')]['syncHangup']=function(_0x4784ee){var _0x22613a=this;if(this[_0x3b92('0x27')][_0x4784ee[_0x3b92('0x25')]]){if(this[_0x3b92('0x4c')][_0x4784ee[_0x3b92('0x25')]]){this[_0x3b92('0x27')][_0x4784ee['uniqueid']]['id']=this[_0x3b92('0x4c')][_0x4784ee['uniqueid']]['id'];this[_0x3b92('0x27')][_0x4784ee[_0x3b92('0x25')]][_0x3b92('0x28')]=this['actions'][_0x4784ee['uniqueid']][_0x3b92('0x28')];}logger[_0x3b92('0x29')](_0x4784ee[_0x3b92('0x25')],this[_0x3b92('0x4c')][_0x4784ee[_0x3b92('0x25')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x3b92('0x27')][_0x4784ee[_0x3b92('0x25')]]));if(this[_0x3b92('0x4c')][_0x4784ee['uniqueid']]){if(this['channels'][_0x4784ee[_0x3b92('0x25')]][_0x3b92('0x50')]>0x0&&this['channels'][_0x4784ee[_0x3b92('0x25')]][_0x3b92('0x18')]===_0x3b92('0x51')){this[_0x3b92('0x4a')](_0x4784ee[_0x3b92('0x25')],!![]);}else{this[_0x3b92('0x4a')](_0x4784ee[_0x3b92('0x25')],![],this[_0x3b92('0x27')][_0x4784ee[_0x3b92('0x25')]]['faxstatusstring']?_0x3b92('0x52')+this['channels'][_0x4784ee[_0x3b92('0x25')]][_0x3b92('0x53')]:_0x3b92('0x54'));}}}};Fax[_0x3b92('0x20')][_0x3b92('0x55')]=function(_0x27e733){var _0x266218=this;return new BPromise(function(_0x38311b,_0x1f5ade){_0x266218[_0x3b92('0x56')](_0x27e733,_0x266218[_0x3b92('0xd')][_0x27e733[_0x3b92('0x57')]])['then'](function(_0xbe9508){ut[_0x3b92('0x47')](_0x3b92('0x58'),_0xbe9508);_0x38311b(ut[_0x3b92('0x59')](_0x3b92('0x5a')));})['catch'](function(_0xe6983a){ut[_0x3b92('0x47')](_0x3b92('0x5b'),_0xe6983a);updateStatus(_0x27e733);_0x1f5ade(ut[_0x3b92('0x59')]('Fax\x20failed'));});});};Fax['prototype'][_0x3b92('0x5c')]=function(_0x5b4557){var _0x2f5406=this;return new BPromise(function(_0x516e31,_0x2204ae){var _0x1683aa=_0x2f5406[_0x3b92('0x5d')](_0x2f5406[_0x3b92('0xd')][_0x5b4557[_0x3b92('0x57')]][_0x3b92('0x5e')],_0x5b4557);if(_0x1683aa['isValid']){_0x516e31(ut['message'](_0x3b92('0x5f')));}else{_0x2204ae(ut['message'](_0x1683aa['message']));}});};function originate(_0x3c64f3,_0x5c325b,_0xabbec){return new BPromise(function(_0x335af3,_0x3784f5){if(_0xabbec){var _0x405fd7=util[_0x3b92('0x60')](_0x3b92('0x61'),path[_0x3b92('0x39')](_0x3c64f3[_0x3b92('0x62')])['name'],_0x3c64f3[_0x3b92('0x62')]);gs[_0x3b92('0x63')](_0x405fd7)[_0x3b92('0x45')](function(){_0x3c64f3[_0x3b92('0x62')]=util['format'](_0x3b92('0x64'),path['parse'](_0x3c64f3[_0x3b92('0x62')])['dir'],path['parse'](_0x3c64f3[_0x3b92('0x62')])[_0x3b92('0x28')]);_0x5c325b[_0x3b92('0x65')]=_0x3c64f3[_0x3b92('0x62')];ut[_0x3b92('0x47')](_0x3b92('0x66'),'');ami[_0x3b92('0x67')](ut['variablesAction'](_0x3c64f3,_0x5c325b))[_0x3b92('0x45')](function(_0x27442f){_0x335af3(_0x27442f);})[_0x3b92('0x3c')](function(_0x478e8f){_0x3784f5(_0x478e8f);});})[_0x3b92('0x3c')](function(_0x390b2f){_0x3784f5(_0x390b2f);});}else{ami[_0x3b92('0x67')](ut[_0x3b92('0x68')](_0x3c64f3,_0x5c325b))[_0x3b92('0x45')](function(_0x3bc7ab){_0x335af3(_0x3bc7ab);})[_0x3b92('0x3c')](function(_0x3ab5d6){_0x3784f5(_0x3ab5d6);});}});}Fax[_0x3b92('0x20')][_0x3b92('0x56')]=function(_0x1396ef,_0x2b89ed){var _0x2d4871=this;return new BPromise(function(_0x47f2c2,_0x1164f9){var _0x1eadd7=uuid['v4']();var _0x548085=ut[_0x3b92('0x69')](_0x1396ef,_0x2b89ed);_0x2d4871[_0x3b92('0x4c')][_0x1eadd7]=new Action(_0x1eadd7,_0x2b89ed,_0x1396ef);var _0x1ee9ed=_0x2d4871[_0x3b92('0x4c')][_0x1eadd7];if(path[_0x3b92('0x39')](_0x1396ef[_0x3b92('0x62')])[_0x3b92('0x6a')]===_0x3b92('0x3a')){originate(_0x1ee9ed,_0x548085,!![])[_0x3b92('0x45')](function(_0x3d0f8f){_0x47f2c2(_0x3d0f8f);})[_0x3b92('0x3c')](function(_0x388914){_0x1164f9(_0x388914);});}else{originate(_0x1ee9ed,_0x548085,![])[_0x3b92('0x45')](function(_0x1c2c0d){_0x47f2c2(_0x1c2c0d);})['catch'](function(_0x17f363){_0x1164f9(_0x17f363);});}});};Fax[_0x3b92('0x20')][_0x3b92('0x6b')]=function(_0x39acc6){return!_[_0x3b92('0x6c')](_0x39acc6)&&!_[_0x3b92('0x6c')](_0x39acc6[_0x3b92('0x28')])&&!_[_0x3b92('0x6c')](_0x39acc6[_0x3b92('0x6d')])&&_0x39acc6[_0x3b92('0x6d')]&&!_[_0x3b92('0x6c')](this[_0x3b92('0xe')][util[_0x3b92('0x60')]('SIP/%s',_0x39acc6[_0x3b92('0x28')])])&&!_[_0x3b92('0x6c')](this[_0x3b92('0xe')][util['format'](_0x3b92('0x6e'),_0x39acc6[_0x3b92('0x28')])][_0x3b92('0x30')])&&(this['trunks'][util['format']('SIP/%s',_0x39acc6['name'])]['status']===_0x3b92('0x6f')||this[_0x3b92('0xe')][util[_0x3b92('0x60')]('SIP/%s',_0x39acc6[_0x3b92('0x28')])][_0x3b92('0x30')]==='unmonitored');};Fax['prototype'][_0x3b92('0x5d')]=function(_0x27846a,_0x1e80f6){if(!this[_0x3b92('0x6b')](_0x27846a)){ut[_0x3b92('0x47')](_0x3b92('0x70'),_[_0x3b92('0x6c')](_0x27846a)?'':_0x27846a[_0x3b92('0x28')]+_0x3b92('0x71'));return{'isValid':![],'message':_0x3b92('0x72')};}if(_[_0x3b92('0x6c')](_0x1e80f6[_0x3b92('0x6')])){ut[_0x3b92('0x47')](_0x3b92('0x73'),JSON[_0x3b92('0x3f')](_0x1e80f6));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x1e80f6[_0x3b92('0x62')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x3b92('0x3f')](_0x1e80f6));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x69eb=['notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger','lodash','error'];(function(_0x236a16,_0x1c007a){var _0x12121e=function(_0x4ad913){while(--_0x4ad913){_0x236a16['push'](_0x236a16['shift']());}};_0x12121e(++_0x1c007a);}(_0x69eb,0xa7));var _0xb69e=function(_0x20747d,_0x13867b){_0x20747d=_0x20747d-0x0;var _0x349e36=_0x69eb[_0x20747d];return _0x349e36;};'use strict';var util=require('util');var BPromise=require(_0xb69e('0x0'));var logger=require(_0xb69e('0x1'))('preview');var _=require(_0xb69e('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1546ef){return function(_0x1dcf97){logger[_0xb69e('0x3')](_0x1546ef,util['inspect'](_0x1dcf97,{'showHidden':![],'depth':null}));};}exports[_0xb69e('0x4')]=function(_0x51cf24,_0x349d3f){return BPromise[_0xb69e('0x5')]()[_0xb69e('0x6')](faxAccount[_0xb69e('0x4')](_0x51cf24,_0x349d3f))[_0xb69e('0x7')](loggerCatch(_0xb69e('0x8')));};
\ No newline at end of file
+var _0xdbfd=['error','resolve','then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x357b0f,_0x23dadb){var _0x767777=function(_0x1efcef){while(--_0x1efcef){_0x357b0f['push'](_0x357b0f['shift']());}};_0x767777(++_0x23dadb);}(_0xdbfd,0x72));var _0xddbf=function(_0x3d6ae9,_0x53b3a4){_0x3d6ae9=_0x3d6ae9-0x0;var _0x6de605=_0xdbfd[_0x3d6ae9];return _0x6de605;};'use strict';var util=require(_0xddbf('0x0'));var BPromise=require(_0xddbf('0x1'));var logger=require(_0xddbf('0x2'))(_0xddbf('0x3'));var _=require(_0xddbf('0x4'));var faxAccount=require(_0xddbf('0x5'));function loggerCatch(_0x2aa7bd){return function(_0x56c1cc){logger[_0xddbf('0x6')](_0x2aa7bd,util['inspect'](_0x56c1cc,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x3bbfaa,_0x3dd71f){return BPromise[_0xddbf('0x7')]()[_0xddbf('0x8')](faxAccount[_0xddbf('0x9')](_0x3bbfaa,_0x3dd71f))[_0xddbf('0xa')](loggerCatch(_0xddbf('0xb')));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa924=['Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','bluebird','info'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa924,0x105));var _0x4a92=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa924[_0x2112d4];return _0x434972;};'use strict';var util=require('util');var logger=require(_0x4a92('0x0'))('fax');var BPromise=require(_0x4a92('0x1'));var exec=require('child_process')['exec'];exports['execute']=function(_0x1e3553){return new BPromise(function(_0x1d3200,_0x3f494f){exec(_0x1e3553,function(_0x327e0f,_0x207b76,_0x300346){logger[_0x4a92('0x2')](_0x4a92('0x3'),_0x207b76);if(_0x327e0f){logger[_0x4a92('0x2')](_0x4a92('0x3'),_0x4a92('0x4'),util[_0x4a92('0x5')](_0x327e0f,{'showHidden':![],'depth':null}),_0x207b76,_0x300346);_0x3f494f(_0x327e0f);}_0x1d3200(_0x207b76);});});};
\ No newline at end of file
+var _0xef24=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','exec'];(function(_0xac83f5,_0x5d9fe6){var _0x5d4ed0=function(_0x4771ff){while(--_0x4771ff){_0xac83f5['push'](_0xac83f5['shift']());}};_0x5d4ed0(++_0x5d9fe6);}(_0xef24,0xde));var _0x4ef2=function(_0x523e64,_0x576981){_0x523e64=_0x523e64-0x0;var _0xa571fe=_0xef24[_0x523e64];return _0xa571fe;};'use strict';var util=require('util');var logger=require(_0x4ef2('0x0'))('fax');var BPromise=require('bluebird');var exec=require('child_process')[_0x4ef2('0x1')];exports[_0x4ef2('0x2')]=function(_0x560017){return new BPromise(function(_0x13c15e,_0xe59dcb){exec(_0x560017,function(_0x1001f3,_0xc3528f,_0x5609c2){logger[_0x4ef2('0x3')](_0x4ef2('0x4'),_0xc3528f);if(_0x1001f3){logger[_0x4ef2('0x3')]('Exec\x20gs',_0x4ef2('0x5'),util[_0x4ef2('0x6')](_0x1001f3,{'showHidden':![],'depth':null}),_0xc3528f,_0x5609c2);_0xe59dcb(_0x1001f3);}_0x13c15e(_0xc3528f);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x309d=['localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout'];(function(_0x197783,_0x32f814){var _0x55caba=function(_0x12780e){while(--_0x12780e){_0x197783['push'](_0x197783['shift']());}};_0x55caba(++_0x32f814);}(_0x309d,0x1e5));var _0xd309=function(_0x3257f7,_0x49eec1){_0x3257f7=_0x3257f7-0x0;var _0x482883=_0x309d[_0x3257f7];return _0x482883;};'use strict';var util=require('util');var _=require(_0xd309('0x0'));var moment=require(_0xd309('0x1'));var logger=require(_0xd309('0x2'))('fax');exports['message']=function(_0x402199){return{'message':_0x402199};};exports[_0xd309('0x3')]=function(_0x13b06e,_0x18e858){logger['info'](_0x13b06e,util[_0xd309('0x4')](_0x18e858,{'showHidden':![],'depth':null}));};exports[_0xd309('0x5')]=function(_0x40f0ba,_0x2cf2fc){var _0x38d58a={'XMF-ECM':_0x2cf2fc[_0xd309('0x6')],'XMF-HEADERINFO':_0x2cf2fc[_0xd309('0x7')],'XMF-MINRATE':_0x2cf2fc[_0xd309('0x8')],'XMF-MAXRATE':_0x2cf2fc[_0xd309('0x9')],'XMF-MODEM':util['format'](_0xd309('0xa'),_0x2cf2fc[_0xd309('0xb')]),'XMF-GATEWAY':_0x2cf2fc[_0xd309('0xc')],'XMF-FAXDETECT':_0x2cf2fc[_0xd309('0xd')],'XMF-T38TIMEOUT':_0x2cf2fc[_0xd309('0xe')],'XMF-LOCALSTATIONID':_0x2cf2fc[_0xd309('0xf')],'XMF-PATH':_0x40f0ba[_0xd309('0x10')]};return _0x38d58a;};exports[_0xd309('0x11')]=function(_0x127832,_0x5aa477){return{'actionid':_0x127832[_0xd309('0x12')],'action':_0xd309('0x13'),'channel':_0x127832[_0xd309('0x14')],'Exten':_0xd309('0x15'),'Context':_0xd309('0x16'),'Priority':'1','callerid':util[_0xd309('0x17')](_0xd309('0x18'),_0x127832[_0xd309('0x7')]?_0x127832[_0xd309('0x7')]:'',_0x127832[_0xd309('0xf')]),'variable':_0x5aa477,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x127832['uniqueid']};};
\ No newline at end of file
+var _0x6133=['modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','../../../../config/logger','fax','logger','info','inspect','addVariables','minrate','format','\x22%s\x22'];(function(_0xfcb672,_0x570f04){var _0x7848c5=function(_0x57e225){while(--_0x57e225){_0xfcb672['push'](_0xfcb672['shift']());}};_0x7848c5(++_0x570f04);}(_0x6133,0x72));var _0x3613=function(_0xd5639d,_0xc6da0b){_0xd5639d=_0xd5639d-0x0;var _0x5a1773=_0x6133[_0xd5639d];return _0x5a1773;};'use strict';var util=require('util');var _=require(_0x3613('0x0'));var moment=require(_0x3613('0x1'));var logger=require(_0x3613('0x2'))(_0x3613('0x3'));exports['message']=function(_0x44dbef){return{'message':_0x44dbef};};exports[_0x3613('0x4')]=function(_0xd9e76,_0x564047){logger[_0x3613('0x5')](_0xd9e76,util[_0x3613('0x6')](_0x564047,{'showHidden':![],'depth':null}));};exports[_0x3613('0x7')]=function(_0x16d917,_0x30d6b2){var _0x5c2214={'XMF-ECM':_0x30d6b2['ecm'],'XMF-HEADERINFO':_0x30d6b2['headerinfo'],'XMF-MINRATE':_0x30d6b2[_0x3613('0x8')],'XMF-MAXRATE':_0x30d6b2['maxrate'],'XMF-MODEM':util[_0x3613('0x9')](_0x3613('0xa'),_0x30d6b2[_0x3613('0xb')]),'XMF-GATEWAY':_0x30d6b2[_0x3613('0xc')],'XMF-FAXDETECT':_0x30d6b2[_0x3613('0xd')],'XMF-T38TIMEOUT':_0x30d6b2[_0x3613('0xe')],'XMF-LOCALSTATIONID':_0x30d6b2[_0x3613('0xf')],'XMF-PATH':_0x16d917[_0x3613('0x10')]};return _0x5c2214;};exports[_0x3613('0x11')]=function(_0x2f9fa2,_0x161b49){return{'actionid':_0x2f9fa2[_0x3613('0x12')],'action':_0x3613('0x13'),'channel':_0x2f9fa2[_0x3613('0x14')],'Exten':_0x3613('0x15'),'Context':_0x3613('0x16'),'Priority':'1','callerid':util[_0x3613('0x9')](_0x3613('0x17'),_0x2f9fa2[_0x3613('0x18')]?_0x2f9fa2['headerinfo']:'',_0x2f9fa2[_0x3613('0xf')]),'variable':_0x161b49,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2f9fa2[_0x3613('0x12')]};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c67=['getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','sync','inspect','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts'];(function(_0x171fce,_0x10c9db){var _0x1a5554=function(_0x487bfd){while(--_0x487bfd){_0x171fce['push'](_0x171fce['shift']());}};_0x1a5554(++_0x10c9db);}(_0x8c67,0xd2));var _0x78c6=function(_0x4962ca,_0x583983){_0x4962ca=_0x4962ca-0x0;var _0x480654=_0x8c67[_0x4962ca];return _0x480654;};'use strict';var util=require('util');var moment=require(_0x78c6('0x0'));var server=require(_0x78c6('0x1'));var Realtime=require(_0x78c6('0x2'));var Report=require(_0x78c6('0x3'));var Acw=require(_0x78c6('0x4'));var Trigger=require(_0x78c6('0x5'));var Dialer=require(_0x78c6('0x6'));var Preview=require(_0x78c6('0x7'));var Fax=require('./fax');var user=require(_0x78c6('0x8'));var voiceQueue=require(_0x78c6('0x9'));var voiceQueueReport=require(_0x78c6('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x78c6('0xb'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x78c6('0xc'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x78c6('0xd'));var freshdesk=require(_0x78c6('0xe'));var desk=require(_0x78c6('0xf'));var zoho=require(_0x78c6('0x10'));var vtiger=require(_0x78c6('0x11'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x78c6('0x12'));var dynamics365=require(_0x78c6('0x13'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x78c6('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x78c6('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x78c6('0x16')](_0x78c6('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x78c6('0x17')]()[_0x78c6('0x18')](user[_0x78c6('0x19')]())[_0x78c6('0x18')](realtime[_0x78c6('0x1a')]())['then'](user[_0x78c6('0x1b')]())['then'](realtime[_0x78c6('0x1c')]())[_0x78c6('0x18')](trunk['getTrunks']())[_0x78c6('0x18')](realtime[_0x78c6('0x1d')]())[_0x78c6('0x18')](voiceQueue[_0x78c6('0x1e')]())[_0x78c6('0x18')](realtime[_0x78c6('0x1f')]())[_0x78c6('0x18')](trigger[_0x78c6('0x20')]())[_0x78c6('0x18')](realtime[_0x78c6('0x21')]())['then'](template['getTemplates']())[_0x78c6('0x18')](realtime[_0x78c6('0x22')]())[_0x78c6('0x18')](zendesk[_0x78c6('0x23')]())[_0x78c6('0x18')](realtime[_0x78c6('0x24')]())[_0x78c6('0x18')](salesforce[_0x78c6('0x25')]())[_0x78c6('0x18')](realtime[_0x78c6('0x26')]())[_0x78c6('0x18')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x78c6('0x27')]())[_0x78c6('0x18')](freshdesk[_0x78c6('0x28')]())[_0x78c6('0x18')](realtime[_0x78c6('0x29')]())['then'](desk[_0x78c6('0x2a')]())[_0x78c6('0x18')](realtime[_0x78c6('0x2b')]())[_0x78c6('0x18')](zoho[_0x78c6('0x2c')]())[_0x78c6('0x18')](realtime[_0x78c6('0x2d')]())[_0x78c6('0x18')](vtiger[_0x78c6('0x2e')]())['then'](realtime[_0x78c6('0x2f')]())[_0x78c6('0x18')](freshsales['getFreshsalesAccounts']())[_0x78c6('0x18')](realtime['initFreshsalesAccounts']())[_0x78c6('0x18')](servicenow[_0x78c6('0x30')]())[_0x78c6('0x18')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x78c6('0x31')]())['then'](realtime['initDynamics365Accounts']())[_0x78c6('0x18')](campaign['getCampaigns']())['then'](realtime[_0x78c6('0x32')]())['then'](voiceExtension['getVoiceExtensions']())[_0x78c6('0x18')](realtime['initVoiceExtensions']())[_0x78c6('0x18')](faxAccount[_0x78c6('0x33')]())['then'](realtime[_0x78c6('0x34')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x78c6('0x17')]()[_0x78c6('0x18')](voiceQueueReport[_0x78c6('0x35')]())[_0x78c6('0x18')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x78c6('0x36')]())[_0x78c6('0x18')](realtime[_0x78c6('0x37')]())[_0x78c6('0x18')](cmHopperHistory[_0x78c6('0x38')]())[_0x78c6('0x18')](realtime[_0x78c6('0x39')]())[_0x78c6('0x18')](voiceCallReport[_0x78c6('0x3a')]())[_0x78c6('0x18')](realtime['initVoiceCallReports']())[_0x78c6('0x3b')](function(_0x20b9a6){logger[_0x78c6('0x3c')]('[index.js][initParams]',util['inspect'](_0x20b9a6,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x78c6('0x18')](function(){return initRealtime();})[_0x78c6('0x18')](function(){return initParams();})[_0x78c6('0x18')](function(){report[_0x78c6('0x3d')]();setInterval(initRealtime,0x1388);})[_0x78c6('0x3b')](function(_0x2880b0){logger[_0x78c6('0x3c')]('[index.js][main]',util[_0x78c6('0x3e')](_0x2880b0,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x169e=['./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','inspect','util','moment','./server'];(function(_0x3ba735,_0x44b2a6){var _0x19fca5=function(_0x2e1940){while(--_0x2e1940){_0x3ba735['push'](_0x3ba735['shift']());}};_0x19fca5(++_0x44b2a6);}(_0x169e,0x174));var _0xe169=function(_0x3481bc,_0x36311f){_0x3481bc=_0x3481bc-0x0;var _0x52ba82=_0x169e[_0x3481bc];return _0x52ba82;};'use strict';var util=require(_0xe169('0x0'));var moment=require(_0xe169('0x1'));var server=require(_0xe169('0x2'));var Realtime=require(_0xe169('0x3'));var Report=require(_0xe169('0x4'));var Acw=require(_0xe169('0x5'));var Trigger=require(_0xe169('0x6'));var Dialer=require(_0xe169('0x7'));var Preview=require(_0xe169('0x8'));var Fax=require('./fax');var user=require(_0xe169('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe169('0xa'));var trunk=require(_0xe169('0xb'));var trigger=require(_0xe169('0xc'));var template=require(_0xe169('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe169('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xe169('0xf'));var zendesk=require(_0xe169('0x10'));var salesforce=require(_0xe169('0x11'));var sugarcrm=require(_0xe169('0x12'));var freshdesk=require(_0xe169('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xe169('0x14'));var vtiger=require(_0xe169('0x15'));var freshsales=require(_0xe169('0x16'));var servicenow=require(_0xe169('0x17'));var dynamics365=require(_0xe169('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xe169('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe169('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe169('0x1a')](_0xe169('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xe169('0x1c')]()[_0xe169('0x1d')](user[_0xe169('0x1e')]())[_0xe169('0x1d')](realtime[_0xe169('0x1f')]())['then'](user[_0xe169('0x20')]())['then'](realtime[_0xe169('0x21')]())[_0xe169('0x1d')](trunk[_0xe169('0x22')]())[_0xe169('0x1d')](realtime[_0xe169('0x23')]())[_0xe169('0x1d')](voiceQueue[_0xe169('0x24')]())[_0xe169('0x1d')](realtime[_0xe169('0x25')]())[_0xe169('0x1d')](trigger[_0xe169('0x26')]())[_0xe169('0x1d')](realtime[_0xe169('0x27')]())['then'](template[_0xe169('0x28')]())[_0xe169('0x1d')](realtime[_0xe169('0x29')]())[_0xe169('0x1d')](zendesk[_0xe169('0x2a')]())['then'](realtime['initZendeskAccounts']())['then'](salesforce[_0xe169('0x2b')]())['then'](realtime[_0xe169('0x2c')]())[_0xe169('0x1d')](sugarcrm[_0xe169('0x2d')]())[_0xe169('0x1d')](realtime[_0xe169('0x2e')]())[_0xe169('0x1d')](freshdesk[_0xe169('0x2f')]())[_0xe169('0x1d')](realtime[_0xe169('0x30')]())['then'](desk[_0xe169('0x31')]())[_0xe169('0x1d')](realtime[_0xe169('0x32')]())['then'](zoho['getZohoAccounts']())[_0xe169('0x1d')](realtime[_0xe169('0x33')]())[_0xe169('0x1d')](vtiger[_0xe169('0x34')]())[_0xe169('0x1d')](realtime[_0xe169('0x35')]())['then'](freshsales[_0xe169('0x36')]())[_0xe169('0x1d')](realtime[_0xe169('0x37')]())['then'](servicenow[_0xe169('0x38')]())[_0xe169('0x1d')](realtime[_0xe169('0x39')]())[_0xe169('0x1d')](dynamics365[_0xe169('0x3a')]())[_0xe169('0x1d')](realtime['initDynamics365Accounts']())[_0xe169('0x1d')](campaign[_0xe169('0x3b')]())[_0xe169('0x1d')](realtime[_0xe169('0x3c')]())['then'](voiceExtension[_0xe169('0x3d')]())[_0xe169('0x1d')](realtime[_0xe169('0x3e')]())[_0xe169('0x1d')](faxAccount[_0xe169('0x3f')]())[_0xe169('0x1d')](realtime[_0xe169('0x40')]())[_0xe169('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0xe169('0x1c')]()[_0xe169('0x1d')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0xe169('0x41')]())[_0xe169('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xe169('0x1d')](realtime['initVoiceQueueHopperHistory']())[_0xe169('0x1d')](cmHopperHistory['getCampaignHopperHistory']())[_0xe169('0x1d')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0xe169('0x42')]())['then'](realtime[_0xe169('0x43')]())[_0xe169('0x44')](function(_0x230caa){logger[_0xe169('0x45')](_0xe169('0x46'),util['inspect'](_0x230caa,{'showHidden':![],'depth':null}));});}function main(){return server[_0xe169('0x47')](realtime,preview,fax)[_0xe169('0x1d')](function(){return initRealtime();})[_0xe169('0x1d')](function(){return initParams();})[_0xe169('0x1d')](function(){report[_0xe169('0x48')]();setInterval(initRealtime,0x1388);})[_0xe169('0x44')](function(_0x1f7c2e){logger['error'](_0xe169('0x49'),util[_0xe169('0x4a')](_0x1f7c2e,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x59b7=['stateTime','stringify','format','user:%s','user:ami:update','omit','user:presence','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','email','fullname','state','unknown','status','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','updateStatusRealtime','toLowerCase','inuse','talking','toNumber','voiceStatus','name','accountcode'];(function(_0x1f5176,_0x3f1313){var _0x234647=function(_0x8c4445){while(--_0x8c4445){_0x1f5176['push'](_0x1f5176['shift']());}};_0x234647(++_0x3f1313);}(_0x59b7,0xc5));var _0x759b=function(_0x1e3e52,_0x30ecda){_0x1e3e52=_0x1e3e52-0x0;var _0xfe2e49=_0x59b7[_0x1e3e52];return _0xfe2e49;};'use strict';var _=require(_0x759b('0x0'));var util=require(_0x759b('0x1'));var moment=require(_0x759b('0x2'));var md5=require(_0x759b('0x3'));var Redis=require(_0x759b('0x4'));var config=require(_0x759b('0x5'));config[_0x759b('0x6')]=_[_0x759b('0x7')](config[_0x759b('0x6')],{'host':_0x759b('0x8'),'port':0x18eb});var io=require(_0x759b('0x9'))(new Redis(config['redis']));function Agent(_0x15c36c){this['id']=_0x15c36c['id']||0x0;this['name']=_0x15c36c['name']||'';this[_0x759b('0xa')]=_0x15c36c[_0x759b('0xa')]||'';this['accountcode']=_0x15c36c['accountcode']||'';this['fullname']=_0x15c36c[_0x759b('0xb')]||'';this[_0x759b('0xc')]=_0x759b('0xd');this['stateTime']=0x0;this[_0x759b('0xe')]='unknown';this[_0x759b('0xf')]='';this[_0x759b('0x10')]='';this[_0x759b('0x11')]='';this[_0x759b('0x12')]='';this[_0x759b('0x13')]=_0x15c36c[_0x759b('0x13')]||![];this['voiceStatus']='unknown';this[_0x759b('0x14')]=0x0;this[_0x759b('0x15')]='';this[_0x759b('0x16')]='';this['onhold']=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x759b('0x17')]=function(_0x49d39b){var _0x196776;if(_0x49d39b&&_0x49d39b['state']){_0x196776=_0x49d39b[_0x759b('0xc')][_0x759b('0x18')]();switch(_0x196776){case'not_inuse':_0x196776='idle';break;case _0x759b('0x19'):_0x196776=_0x759b('0x1a');break;}}if(_0x196776&&this['voiceStatus']!==_0x196776||_0x49d39b['statePause']){this[_0x759b('0x14')]=_[_0x759b('0x1b')](moment()['format']('x'));}if(_0x196776){this[_0x759b('0x1c')]=_0x196776;}var _0x87b37={'id':this['id'],'name':this[_0x759b('0x1d')],'email':this['email'],'accountcode':this[_0x759b('0x1e')],'fullname':this[_0x759b('0xb')],'state':this[_0x759b('0xc')],'stateTime':this[_0x759b('0x1f')],'status':this[_0x759b('0xe')],'address':this['address'],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x759b('0x15')],'voiceStatusQueue':this[_0x759b('0x16')],'interface':this[_0x759b('0x12')],'onhold':this['onhold']};var _0x4075a5=md5(JSON[_0x759b('0x20')](_0x87b37));if(this[_0x759b('0x3')]!==_0x4075a5){this[_0x759b('0x3')]=_0x4075a5;io['to'](util[_0x759b('0x21')](_0x759b('0x22'),_0x87b37[_0x759b('0x1d')]))['emit'](_0x759b('0x23'),_[_0x759b('0x24')](_0x87b37,[_0x759b('0x13')]));io['emit'](_0x759b('0x25'),_0x87b37);}};module['exports']=Agent;
\ No newline at end of file
+var _0x1ad6=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','fullname','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','state','toLowerCase','not_inuse','talking','toNumber','accountcode','stringify','format','emit','user:ami:update','user:presence','exports','lodash','md5'];(function(_0x237637,_0x3939c7){var _0x23ab28=function(_0x1dc595){while(--_0x1dc595){_0x237637['push'](_0x237637['shift']());}};_0x23ab28(++_0x3939c7);}(_0x1ad6,0x170));var _0x61ad=function(_0x3bf572,_0x232485){_0x3bf572=_0x3bf572-0x0;var _0xd04388=_0x1ad6[_0x3bf572];return _0xd04388;};'use strict';var _=require(_0x61ad('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x61ad('0x1'));var Redis=require(_0x61ad('0x2'));var config=require(_0x61ad('0x3'));config[_0x61ad('0x4')]=_[_0x61ad('0x5')](config[_0x61ad('0x4')],{'host':_0x61ad('0x6'),'port':0x18eb});var io=require(_0x61ad('0x7'))(new Redis(config['redis']));function Agent(_0x5cf41f){this['id']=_0x5cf41f['id']||0x0;this['name']=_0x5cf41f[_0x61ad('0x8')]||'';this[_0x61ad('0x9')]=_0x5cf41f['email']||'';this['accountcode']=_0x5cf41f['accountcode']||'';this[_0x61ad('0xa')]=_0x5cf41f[_0x61ad('0xa')]||'';this['state']=_0x61ad('0xb');this[_0x61ad('0xc')]=0x0;this[_0x61ad('0xd')]='unknown';this['address']='';this[_0x61ad('0xe')]='';this[_0x61ad('0xf')]='';this[_0x61ad('0x10')]='';this[_0x61ad('0x11')]=_0x5cf41f[_0x61ad('0x11')]||![];this[_0x61ad('0x12')]=_0x61ad('0xb');this[_0x61ad('0x13')]=0x0;this[_0x61ad('0x14')]='';this[_0x61ad('0x15')]='';this[_0x61ad('0x16')]=![];this[_0x61ad('0x17')]=![];this[_0x61ad('0x1')]='';}Agent[_0x61ad('0x18')]['updateStatusRealtime']=function(_0x1a2d88){var _0x4a78de;if(_0x1a2d88&&_0x1a2d88[_0x61ad('0x19')]){_0x4a78de=_0x1a2d88[_0x61ad('0x19')][_0x61ad('0x1a')]();switch(_0x4a78de){case _0x61ad('0x1b'):_0x4a78de='idle';break;case'inuse':_0x4a78de=_0x61ad('0x1c');break;}}if(_0x4a78de&&this[_0x61ad('0x12')]!==_0x4a78de||_0x1a2d88['statePause']){this[_0x61ad('0x13')]=_[_0x61ad('0x1d')](moment()['format']('x'));}if(_0x4a78de){this[_0x61ad('0x12')]=_0x4a78de;}var _0x388515={'id':this['id'],'name':this[_0x61ad('0x8')],'email':this['email'],'accountcode':this[_0x61ad('0x1e')],'fullname':this[_0x61ad('0xa')],'state':this[_0x61ad('0x19')],'stateTime':this[_0x61ad('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x61ad('0x11')],'voiceStatus':this[_0x61ad('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x61ad('0x14')],'voiceStatusQueue':this[_0x61ad('0x15')],'interface':this[_0x61ad('0x10')],'onhold':this[_0x61ad('0x16')]};var _0x59dd03=md5(JSON[_0x61ad('0x1f')](_0x388515));if(this['md5']!==_0x59dd03){this[_0x61ad('0x1')]=_0x59dd03;io['to'](util[_0x61ad('0x20')]('user:%s',_0x388515['name']))[_0x61ad('0x21')](_0x61ad('0x22'),_['omit'](_0x388515,[_0x61ad('0x11')]));io['emit'](_0x61ad('0x23'),_0x388515);}};module[_0x61ad('0x24')]=Agent;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x40e9=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence'];(function(_0x193a6e,_0x45dd00){var _0x599a9b=function(_0x37a9e2){while(--_0x37a9e2){_0x193a6e['push'](_0x193a6e['shift']());}};_0x599a9b(++_0x45dd00);}(_0x40e9,0xe8));var _0x940e=function(_0xe2da1b,_0x1c6a86){_0xe2da1b=_0xe2da1b-0x0;var _0x116760=_0x40e9[_0xe2da1b];return _0x116760;};'use strict';function Campaign(_0x2acb6d){this['id']=_0x2acb6d['id']||0x0;this[_0x940e('0x0')]=_0x2acb6d[_0x940e('0x0')]||'';this['type']=_0x2acb6d[_0x940e('0x1')]||'campaign';this[_0x940e('0x2')]=0x0;this[_0x940e('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x940e('0x4')]=0x0;this[_0x940e('0x5')]='';this[_0x940e('0x6')]=!![];this[_0x940e('0x7')]=_0x2acb6d[_0x940e('0x7')];this['limitCalls']=_0x2acb6d['limitCalls'];this['dialTimezone']=_0x2acb6d[_0x940e('0x8')]||null;this['dialGlobalInterval']=_0x2acb6d[_0x940e('0x9')]?_0x2acb6d[_0x940e('0x9')]:null;this['dialOriginateCallerIdName']=_0x2acb6d['dialOriginateCallerIdName'];this[_0x940e('0xa')]=_0x2acb6d[_0x940e('0xa')];this['dialOriginateTimeout']=_0x2acb6d[_0x940e('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x2acb6d[_0x940e('0xc')];this['dialCongestionRetryFrequency']=_0x2acb6d['dialCongestionRetryFrequency'];this[_0x940e('0xd')]=_0x2acb6d[_0x940e('0xd')];this[_0x940e('0xe')]=_0x2acb6d[_0x940e('0xe')];this[_0x940e('0xf')]=_0x2acb6d['dialNoAnswerMaxRetry'];this[_0x940e('0x10')]=_0x2acb6d[_0x940e('0x10')];this[_0x940e('0x11')]=_0x2acb6d['dialGlobalMaxRetry'];this[_0x940e('0x12')]=_0x2acb6d['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2acb6d[_0x940e('0x13')]||0x96;this[_0x940e('0x14')]=_0x2acb6d[_0x940e('0x14')]||0x3;this[_0x940e('0x15')]=_0x2acb6d[_0x940e('0x15')]||0x96;this[_0x940e('0x16')]=_0x2acb6d[_0x940e('0x16')]||0x3;this[_0x940e('0x17')]=_0x2acb6d[_0x940e('0x17')]||0x96;this[_0x940e('0x18')]=_0x2acb6d[_0x940e('0x18')]||0x3;this[_0x940e('0x19')]=_0x2acb6d[_0x940e('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x2acb6d['dialAgentRejectMaxRetry']||0x3;this[_0x940e('0x1a')]=_0x2acb6d[_0x940e('0x1a')]||0x96;this['dialOrderByScheduledAt']=_0x2acb6d['dialOrderByScheduledAt']||_0x940e('0x1b');this['dialPrefix']=_0x2acb6d[_0x940e('0x1c')]||undefined;this[_0x940e('0x1d')]=_0x2acb6d[_0x940e('0x1d')]||undefined;this[_0x940e('0x1e')]=_0x2acb6d[_0x940e('0x1e')]||undefined;this[_0x940e('0x1f')]=_0x2acb6d[_0x940e('0x1f')]?_0x2acb6d[_0x940e('0x1f')]:undefined;this[_0x940e('0x20')]=_0x2acb6d['Trunk']?_0x2acb6d[_0x940e('0x20')]:undefined;this[_0x940e('0x21')]=_0x2acb6d[_0x940e('0x21')]?_0x2acb6d[_0x940e('0x21')]:undefined;this[_0x940e('0x22')]=_0x2acb6d[_0x940e('0x22')]?_0x2acb6d['SquareProject']:undefined;this['dialQueueProject']=_0x2acb6d[_0x940e('0x22')]?_0x2acb6d['SquareProject']['name']:undefined;this['dialAMDActive']=_0x2acb6d[_0x940e('0x23')]||![];this['dialAMDInitialSilence']=_0x2acb6d[_0x940e('0x24')];this['dialAMDGreeting']=_0x2acb6d['dialAMDGreeting'];this[_0x940e('0x25')]=_0x2acb6d['dialAMDAfterGreetingSilence'];this[_0x940e('0x26')]=_0x2acb6d[_0x940e('0x26')];this['dialAMDMinWordLength']=_0x2acb6d[_0x940e('0x27')];this[_0x940e('0x28')]=_0x2acb6d[_0x940e('0x28')];this[_0x940e('0x29')]=_0x2acb6d['dialAMDMaximumNumberOfWords'];this[_0x940e('0x2a')]=_0x2acb6d['dialAMDSilenceThreshold'];this[_0x940e('0x2b')]=_0x2acb6d['dialAMDMaximumWordLength'];}module[_0x940e('0x2c')]=Campaign;
\ No newline at end of file
+var _0x6a69=['TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber'];(function(_0xff58a9,_0xcdfb28){var _0x1e9b6c=function(_0x46866d){while(--_0x46866d){_0xff58a9['push'](_0xff58a9['shift']());}};_0x1e9b6c(++_0xcdfb28);}(_0x6a69,0xa2));var _0x96a6=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x6a69[_0x374ada];return _0x449ed8;};'use strict';function Campaign(_0x4ecfa2){this['id']=_0x4ecfa2['id']||0x0;this['name']=_0x4ecfa2['name']||'';this[_0x96a6('0x0')]=_0x4ecfa2[_0x96a6('0x0')]||_0x96a6('0x1');this[_0x96a6('0x2')]=0x0;this[_0x96a6('0x3')]=0x0;this[_0x96a6('0x4')]=0x0;this[_0x96a6('0x5')]=0x0;this[_0x96a6('0x6')]='';this[_0x96a6('0x7')]=!![];this['active']=_0x4ecfa2['active'];this[_0x96a6('0x8')]=_0x4ecfa2[_0x96a6('0x8')];this[_0x96a6('0x9')]=_0x4ecfa2[_0x96a6('0x9')]||null;this[_0x96a6('0xa')]=_0x4ecfa2[_0x96a6('0xa')]?_0x4ecfa2[_0x96a6('0xa')]:null;this[_0x96a6('0xb')]=_0x4ecfa2[_0x96a6('0xb')];this[_0x96a6('0xc')]=_0x4ecfa2[_0x96a6('0xc')];this[_0x96a6('0xd')]=_0x4ecfa2[_0x96a6('0xd')]||0x1e;this[_0x96a6('0xe')]=_0x4ecfa2[_0x96a6('0xe')];this[_0x96a6('0xf')]=_0x4ecfa2[_0x96a6('0xf')];this[_0x96a6('0x10')]=_0x4ecfa2['dialBusyMaxRetry'];this[_0x96a6('0x11')]=_0x4ecfa2[_0x96a6('0x11')];this['dialNoAnswerMaxRetry']=_0x4ecfa2['dialNoAnswerMaxRetry'];this[_0x96a6('0x12')]=_0x4ecfa2[_0x96a6('0x12')];this[_0x96a6('0x13')]=_0x4ecfa2[_0x96a6('0x13')];this[_0x96a6('0x14')]=_0x4ecfa2[_0x96a6('0x14')]||0x3;this[_0x96a6('0x15')]=_0x4ecfa2[_0x96a6('0x15')]||0x96;this[_0x96a6('0x16')]=_0x4ecfa2['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4ecfa2[_0x96a6('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x4ecfa2[_0x96a6('0x18')]||0x3;this[_0x96a6('0x19')]=_0x4ecfa2['dialAbandonedRetryFrequency']||0x96;this[_0x96a6('0x1a')]=_0x4ecfa2['dialMachineMaxRetry']||0x3;this[_0x96a6('0x1b')]=_0x4ecfa2[_0x96a6('0x1b')]||0x96;this[_0x96a6('0x1c')]=_0x4ecfa2[_0x96a6('0x1c')]||0x3;this[_0x96a6('0x1d')]=_0x4ecfa2[_0x96a6('0x1d')]||0x96;this[_0x96a6('0x1e')]=_0x4ecfa2[_0x96a6('0x1e')]||_0x96a6('0x1f');this[_0x96a6('0x20')]=_0x4ecfa2[_0x96a6('0x20')]||undefined;this[_0x96a6('0x21')]=_0x4ecfa2[_0x96a6('0x21')]||undefined;this['dialCutDigit']=_0x4ecfa2['dialCutDigit']||undefined;this[_0x96a6('0x22')]=_0x4ecfa2[_0x96a6('0x22')]?_0x4ecfa2[_0x96a6('0x22')]:undefined;this[_0x96a6('0x23')]=_0x4ecfa2['Trunk']?_0x4ecfa2[_0x96a6('0x23')]:undefined;this[_0x96a6('0x24')]=_0x4ecfa2[_0x96a6('0x24')]?_0x4ecfa2['Interval']:undefined;this[_0x96a6('0x25')]=_0x4ecfa2[_0x96a6('0x25')]?_0x4ecfa2[_0x96a6('0x25')]:undefined;this[_0x96a6('0x26')]=_0x4ecfa2[_0x96a6('0x25')]?_0x4ecfa2[_0x96a6('0x25')]['name']:undefined;this[_0x96a6('0x27')]=_0x4ecfa2[_0x96a6('0x27')]||![];this['dialAMDInitialSilence']=_0x4ecfa2[_0x96a6('0x28')];this[_0x96a6('0x29')]=_0x4ecfa2['dialAMDGreeting'];this[_0x96a6('0x2a')]=_0x4ecfa2[_0x96a6('0x2a')];this[_0x96a6('0x2b')]=_0x4ecfa2['dialAMDTotalAnalysisTime'];this[_0x96a6('0x2c')]=_0x4ecfa2[_0x96a6('0x2c')];this['dialAMDBetweenWordsSilence']=_0x4ecfa2['dialAMDBetweenWordsSilence'];this[_0x96a6('0x2d')]=_0x4ecfa2['dialAMDMaximumNumberOfWords'];this[_0x96a6('0x2e')]=_0x4ecfa2[_0x96a6('0x2e')];this[_0x96a6('0x2f')]=_0x4ecfa2['dialAMDMaximumWordLength'];}module[_0x96a6('0x30')]=Campaign;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa7c8=['exten','answertime','unmanaged','abandoned','lastapplication','billableseconds','holdtime','type','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinename','context','uniqueid','linkedid'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa7c8,0x82));var _0x8a7c=function(_0x4ba9d9,_0x147210){_0x4ba9d9=_0x4ba9d9-0x0;var _0xaca26a=_0xa7c8[_0x4ba9d9];return _0xaca26a;};'use strict';function Channel(){this[_0x8a7c('0x0')]=null;this['channel']='';this[_0x8a7c('0x1')]='';this[_0x8a7c('0x2')]=0x0;this[_0x8a7c('0x3')]='';this['connectedlinenum']=undefined;this[_0x8a7c('0x4')]=undefined;this['accountcode']=0x0;this[_0x8a7c('0x5')]='';this[_0x8a7c('0x6')]=0x0;this[_0x8a7c('0x7')]=0x0;this[_0x8a7c('0x8')]=0x0;this['answered']=![];this[_0x8a7c('0x9')]=null;this['endtime']=null;this[_0x8a7c('0xa')]=![];this[_0x8a7c('0xb')]=![];this[_0x8a7c('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0x8a7c('0xd')]=0x0;this[_0x8a7c('0xe')]=0x0;this[_0x8a7c('0xf')]=null;this['tag']=null;this['disposition']=null;this[_0x8a7c('0x10')]=![];this[_0x8a7c('0x11')]=null;this[_0x8a7c('0x12')]=null;this[_0x8a7c('0x13')]=[];this[_0x8a7c('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x8a7c('0x15')]=undefined;this['mohtime']=0x0;}module[_0x8a7c('0x16')]=Channel;
\ No newline at end of file
+var _0x86be=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname'];(function(_0x249934,_0x1b2fd1){var _0x1a84a8=function(_0x1a0ecf){while(--_0x1a0ecf){_0x249934['push'](_0x249934['shift']());}};_0x1a84a8(++_0x1b2fd1);}(_0x86be,0x176));var _0xe86b=function(_0x4f5445,_0x4195c0){_0x4f5445=_0x4f5445-0x0;var _0x39f1e8=_0x86be[_0x4f5445];return _0x39f1e8;};'use strict';function Channel(){this[_0xe86b('0x0')]=null;this['channel']='';this[_0xe86b('0x1')]='';this[_0xe86b('0x2')]=0x0;this[_0xe86b('0x3')]='';this[_0xe86b('0x4')]=undefined;this[_0xe86b('0x5')]=undefined;this[_0xe86b('0x6')]=0x0;this[_0xe86b('0x7')]='';this[_0xe86b('0x8')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this['answered']=![];this[_0xe86b('0x9')]=null;this[_0xe86b('0xa')]=null;this[_0xe86b('0xb')]=![];this[_0xe86b('0xc')]=![];this['lastapplication']='';this[_0xe86b('0xd')]='';this[_0xe86b('0xe')]=0x0;this[_0xe86b('0xf')]=0x0;this['holdtime']=0x0;this[_0xe86b('0x10')]=null;this[_0xe86b('0x11')]=null;this[_0xe86b('0x12')]=null;this['monitor']=![];this[_0xe86b('0x13')]=null;this[_0xe86b('0x14')]=null;this[_0xe86b('0x15')]=[];this[_0xe86b('0x16')]=undefined;this[_0xe86b('0x17')]=undefined;this[_0xe86b('0x18')]=undefined;this[_0xe86b('0x19')]=0x0;}module[_0xe86b('0x1a')]=Channel;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4908=['name','username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','Configurations'];(function(_0x2fba0c,_0x2cf2c0){var _0x263a96=function(_0x895beb){while(--_0x895beb){_0x2fba0c['push'](_0x2fba0c['shift']());}};_0x263a96(++_0x2cf2c0);}(_0x4908,0x186));var _0x8490=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4908[_0x1f9f37];return _0x21c080;};'use strict';function DeskAccount(_0x4b29c9){this['id']=_0x4b29c9['id']||0x0;this[_0x8490('0x0')]=_0x4b29c9['name']||'';this[_0x8490('0x1')]=_0x4b29c9[_0x8490('0x1')]||'';this['remoteUri']=_0x4b29c9['remoteUri']||'';this[_0x8490('0x2')]=_0x4b29c9[_0x8490('0x2')]||'';this[_0x8490('0x3')]=_0x4b29c9[_0x8490('0x3')]||'';this['consumerKey']=_0x4b29c9[_0x8490('0x4')]||'';this[_0x8490('0x5')]=_0x4b29c9['consumerSecret']||'';this[_0x8490('0x6')]=_0x4b29c9[_0x8490('0x6')]||'';this[_0x8490('0x7')]=_0x4b29c9['tokenSecret']||'';this[_0x8490('0x8')]=_0x4b29c9[_0x8490('0x8')]||'';this['serverUrl']=_0x4b29c9['serverUrl']||'';this[_0x8490('0x9')]=_0x4b29c9[_0x8490('0x9')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x72d3=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x3d35c2,_0x42ab88){var _0x2f052d=function(_0x3310e9){while(--_0x3310e9){_0x3d35c2['push'](_0x3d35c2['shift']());}};_0x2f052d(++_0x42ab88);}(_0x72d3,0xa8));var _0x372d=function(_0x27ed41,_0xb780a1){_0x27ed41=_0x27ed41-0x0;var _0x507934=_0x72d3[_0x27ed41];return _0x507934;};'use strict';function DeskAccount(_0x28cba8){this['id']=_0x28cba8['id']||0x0;this[_0x372d('0x0')]=_0x28cba8['name']||'';this[_0x372d('0x1')]=_0x28cba8[_0x372d('0x1')]||'';this[_0x372d('0x2')]=_0x28cba8[_0x372d('0x2')]||'';this[_0x372d('0x3')]=_0x28cba8[_0x372d('0x3')]||'';this[_0x372d('0x4')]=_0x28cba8['password']||'';this['consumerKey']=_0x28cba8[_0x372d('0x5')]||'';this[_0x372d('0x6')]=_0x28cba8['consumerSecret']||'';this[_0x372d('0x7')]=_0x28cba8[_0x372d('0x7')]||'';this[_0x372d('0x8')]=_0x28cba8[_0x372d('0x8')]||'';this[_0x372d('0x9')]=_0x28cba8[_0x372d('0x9')]||'';this[_0x372d('0xa')]=_0x28cba8[_0x372d('0xa')]||'';this[_0x372d('0xb')]=_0x28cba8[_0x372d('0xb')]||{};}module[_0x372d('0xc')]=DeskAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x108b=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x1f2e7a,_0x408d6d){var _0x5beb54=function(_0x45a8d2){while(--_0x45a8d2){_0x1f2e7a['push'](_0x1f2e7a['shift']());}};_0x5beb54(++_0x408d6d);}(_0x108b,0x133));var _0xb108=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0x108b[_0x5e6cb8];return _0x41754f;};'use strict';function Dynamics365Account(_0x3aa4bb){this['id']=_0x3aa4bb['id']||0x0;this[_0xb108('0x0')]=_0x3aa4bb[_0xb108('0x0')]||'';this[_0xb108('0x1')]=_0x3aa4bb[_0xb108('0x1')]||'';this[_0xb108('0x2')]=_0x3aa4bb['password']||'';this[_0xb108('0x3')]=_0x3aa4bb[_0xb108('0x3')]||'';this[_0xb108('0x4')]=_0x3aa4bb[_0xb108('0x4')]||'';this[_0xb108('0x5')]=_0x3aa4bb['clientId']||'';this[_0xb108('0x6')]=_0x3aa4bb[_0xb108('0x6')]||{};this[_0xb108('0x7')]=_0x3aa4bb[_0xb108('0x7')]||'';this[_0xb108('0x8')]=_0x3aa4bb[_0xb108('0x8')]||![];this[_0xb108('0x9')]=_0x3aa4bb[_0xb108('0x9')]||{};this[_0xb108('0xa')]=_0x3aa4bb[_0xb108('0xa')]||{};}module[_0xb108('0xb')]=Dynamics365Account;
\ No newline at end of file
+var _0x759c=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x5d02d2,_0x444125){var _0x43396a=function(_0x4585ac){while(--_0x4585ac){_0x5d02d2['push'](_0x5d02d2['shift']());}};_0x43396a(++_0x444125);}(_0x759c,0xd4));var _0xc759=function(_0x1fba16,_0x456452){_0x1fba16=_0x1fba16-0x0;var _0x2cc082=_0x759c[_0x1fba16];return _0x2cc082;};'use strict';function Dynamics365Account(_0x224129){this['id']=_0x224129['id']||0x0;this['name']=_0x224129[_0xc759('0x0')]||'';this[_0xc759('0x1')]=_0x224129[_0xc759('0x1')]||'';this[_0xc759('0x2')]=_0x224129[_0xc759('0x2')]||'';this[_0xc759('0x3')]=_0x224129[_0xc759('0x3')]||'';this[_0xc759('0x4')]=_0x224129[_0xc759('0x4')]||'';this[_0xc759('0x5')]=_0x224129[_0xc759('0x5')]||'';this[_0xc759('0x6')]=_0x224129[_0xc759('0x6')]||{};this[_0xc759('0x7')]=_0x224129[_0xc759('0x7')]||'';this['modernAuthentication']=_0x224129['modernAuthentication']||![];this[_0xc759('0x8')]=_0x224129[_0xc759('0x8')]||{};this[_0xc759('0x9')]=_0x224129[_0xc759('0x9')]||{};}module[_0xc759('0xa')]=Dynamics365Account;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5085=['SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x473c5f,_0x1a4606){var _0x1dbea4=function(_0x120f32){while(--_0x120f32){_0x473c5f['push'](_0x473c5f['shift']());}};_0x1dbea4(++_0x1a4606);}(_0x5085,0x164));var _0x5508=function(_0x2dcda8,_0x516ce2){_0x2dcda8=_0x2dcda8-0x0;var _0x1b5ccb=_0x5085[_0x2dcda8];return _0x1b5ccb;};'use strict';function FaxAccount(_0x5851e7){this['id']=_0x5851e7['id']||0x0;this[_0x5508('0x0')]=_0x5851e7[_0x5508('0x0')]||'';this[_0x5508('0x1')]=_0x5851e7[_0x5508('0x1')];this[_0x5508('0x2')]=_0x5851e7['ecm'];this[_0x5508('0x3')]=_0x5851e7[_0x5508('0x3')];this['localstationid']=_0x5851e7[_0x5508('0x4')];this[_0x5508('0x5')]=_0x5851e7[_0x5508('0x5')]||0x960;this[_0x5508('0x6')]=_0x5851e7[_0x5508('0x6')]||0x3840;this[_0x5508('0x7')]=_0x5851e7['modem']||'v17,v27,v29';this[_0x5508('0x8')]=_0x5851e7[_0x5508('0x8')]||'no';this[_0x5508('0x9')]=_0x5851e7['faxdetect']||'no';this['t38timeout']=_0x5851e7[_0x5508('0xa')]||0x1388;this[_0x5508('0xb')]=_0x5851e7[_0x5508('0xb')]||_0x5508('0xc');this[_0x5508('0xd')]=_0x5851e7[_0x5508('0xd')]?_0x5851e7[_0x5508('0xd')]:undefined;this['ListId']=_0x5851e7['ListId'];this[_0x5508('0xe')]=_0x5851e7['key'];}module[_0x5508('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x902d=['tech','SIP','Trunk','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x5c7e64,_0x404350){var _0x350311=function(_0x49f794){while(--_0x49f794){_0x5c7e64['push'](_0x5c7e64['shift']());}};_0x350311(++_0x404350);}(_0x902d,0x121));var _0xd902=function(_0x2a0b01,_0x5ab050){_0x2a0b01=_0x2a0b01-0x0;var _0x3781b1=_0x902d[_0x2a0b01];return _0x3781b1;};'use strict';function FaxAccount(_0x3cc16a){this['id']=_0x3cc16a['id']||0x0;this[_0xd902('0x0')]=_0x3cc16a[_0xd902('0x0')]||'';this[_0xd902('0x1')]=_0x3cc16a['description'];this[_0xd902('0x2')]=_0x3cc16a[_0xd902('0x2')];this[_0xd902('0x3')]=_0x3cc16a[_0xd902('0x3')];this[_0xd902('0x4')]=_0x3cc16a['localstationid'];this[_0xd902('0x5')]=_0x3cc16a[_0xd902('0x5')]||0x960;this[_0xd902('0x6')]=_0x3cc16a[_0xd902('0x6')]||0x3840;this['modem']=_0x3cc16a['modem']||_0xd902('0x7');this['gateway']=_0x3cc16a[_0xd902('0x8')]||'no';this[_0xd902('0x9')]=_0x3cc16a[_0xd902('0x9')]||'no';this[_0xd902('0xa')]=_0x3cc16a[_0xd902('0xa')]||0x1388;this[_0xd902('0xb')]=_0x3cc16a[_0xd902('0xb')]||_0xd902('0xc');this['Trunk']=_0x3cc16a['Trunk']?_0x3cc16a[_0xd902('0xd')]:undefined;this['ListId']=_0x3cc16a['ListId'];this[_0xd902('0xe')]=_0x3cc16a['key'];}module['exports']=FaxAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe419=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x57c2bd,_0xd53c54){var _0x562428=function(_0x416026){while(--_0x416026){_0x57c2bd['push'](_0x57c2bd['shift']());}};_0x562428(++_0xd53c54);}(_0xe419,0x129));var _0x9e41=function(_0x429e43,_0x27bae2){_0x429e43=_0x429e43-0x0;var _0x5db12f=_0xe419[_0x429e43];return _0x5db12f;};'use strict';function FreshdeskAccount(_0x5296b8){this['id']=_0x5296b8['id']||0x0;this[_0x9e41('0x0')]=_0x5296b8[_0x9e41('0x0')]||'';this['username']=_0x5296b8[_0x9e41('0x1')]||'';this[_0x9e41('0x2')]=_0x5296b8[_0x9e41('0x3')]||'';this[_0x9e41('0x4')]=_0x5296b8[_0x9e41('0x4')]||'';this[_0x9e41('0x5')]=_0x5296b8[_0x9e41('0x5')]||'';this[_0x9e41('0x6')]=_0x5296b8[_0x9e41('0x6')]||{};}module[_0x9e41('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0x88e8=['token','remoteUri','serverUrl','exports','name','username','apiKey'];(function(_0x5d1981,_0x2e5724){var _0x49cda5=function(_0x6fe8fe){while(--_0x6fe8fe){_0x5d1981['push'](_0x5d1981['shift']());}};_0x49cda5(++_0x2e5724);}(_0x88e8,0x1d2));var _0x888e=function(_0x32ecf5,_0x345f85){_0x32ecf5=_0x32ecf5-0x0;var _0xb8b77b=_0x88e8[_0x32ecf5];return _0xb8b77b;};'use strict';function FreshdeskAccount(_0x235ef2){this['id']=_0x235ef2['id']||0x0;this[_0x888e('0x0')]=_0x235ef2[_0x888e('0x0')]||'';this[_0x888e('0x1')]=_0x235ef2['username']||'';this[_0x888e('0x2')]=_0x235ef2[_0x888e('0x3')]||'';this['remoteUri']=_0x235ef2[_0x888e('0x4')]||'';this[_0x888e('0x5')]=_0x235ef2[_0x888e('0x5')]||'';this['Configurations']=_0x235ef2['Configurations']||{};}module[_0x888e('0x6')]=FreshdeskAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04f1=['exports','name','apiKey','token','remoteUri'];(function(_0x433c9f,_0x390cf6){var _0x3f07b0=function(_0x56fefd){while(--_0x56fefd){_0x433c9f['push'](_0x433c9f['shift']());}};_0x3f07b0(++_0x390cf6);}(_0x04f1,0x92));var _0x104f=function(_0x424801,_0x2a99af){_0x424801=_0x424801-0x0;var _0x584a33=_0x04f1[_0x424801];return _0x584a33;};'use strict';function FreshsalesAccount(_0x2550ff){this['id']=_0x2550ff['id']||0x0;this[_0x104f('0x0')]=_0x2550ff[_0x104f('0x0')]||'';this['username']=_0x2550ff['username']||'';this[_0x104f('0x1')]=_0x2550ff[_0x104f('0x2')]||'';this[_0x104f('0x3')]=_0x2550ff['remoteUri']||'';this['serverUrl']=_0x2550ff['serverUrl']||'';this['Configurations']=_0x2550ff['Configurations']||{};}module[_0x104f('0x4')]=FreshsalesAccount;
\ No newline at end of file
+var _0x1c3b=['serverUrl','Configurations','exports','name','apiKey','token','remoteUri'];(function(_0x22521a,_0x2abb2a){var _0x4a076c=function(_0x3d8ea7){while(--_0x3d8ea7){_0x22521a['push'](_0x22521a['shift']());}};_0x4a076c(++_0x2abb2a);}(_0x1c3b,0xab));var _0xb1c3=function(_0x4aaf7e,_0x40453c){_0x4aaf7e=_0x4aaf7e-0x0;var _0x442fa3=_0x1c3b[_0x4aaf7e];return _0x442fa3;};'use strict';function FreshsalesAccount(_0x2e067d){this['id']=_0x2e067d['id']||0x0;this[_0xb1c3('0x0')]=_0x2e067d[_0xb1c3('0x0')]||'';this['username']=_0x2e067d['username']||'';this[_0xb1c3('0x1')]=_0x2e067d[_0xb1c3('0x2')]||'';this[_0xb1c3('0x3')]=_0x2e067d[_0xb1c3('0x3')]||'';this[_0xb1c3('0x4')]=_0x2e067d[_0xb1c3('0x4')]||'';this['Configurations']=_0x2e067d[_0xb1c3('0x5')]||{};}module[_0xb1c3('0x6')]=FreshsalesAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25df=['motionChannel','voice','routealias','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','lastAssignedTo'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0x25df,0x6c));var _0xf25d=function(_0x30658c,_0x17bf62){_0x30658c=_0x30658c-0x0;var _0x2996e5=_0x25df[_0x30658c];return _0x2996e5;};'use strict';function QueueReport(){this[_0xf25d('0x0')]=_0xf25d('0x1');this[_0xf25d('0x2')]='';this[_0xf25d('0x3')]='';this[_0xf25d('0x4')]='';this[_0xf25d('0x5')]='';this[_0xf25d('0x6')]=null;this[_0xf25d('0x7')]=null;this[_0xf25d('0x8')]=0x1;this['count']=0x1;this[_0xf25d('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xf25d('0xa')]=![];this[_0xf25d('0xb')]=null;this[_0xf25d('0xc')]=![];this[_0xf25d('0xd')]=null;this[_0xf25d('0xe')]=0x1;this['channel']='';this[_0xf25d('0xf')]='';this[_0xf25d('0x10')]='';this[_0xf25d('0x11')]='';this[_0xf25d('0x12')]='';this[_0xf25d('0x13')]='';this[_0xf25d('0x14')]='';this['holdtime']=0x0;this['assigned']=![];this[_0xf25d('0x15')]='';this[_0xf25d('0x16')]=_0xf25d('0x17');this[_0xf25d('0x18')]=null;this['mohtime']=0x0;this[_0xf25d('0x19')]={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0xf46c=['assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime'];(function(_0x14f754,_0x514bd8){var _0x8119eb=function(_0x291d5c){while(--_0x291d5c){_0x14f754['push'](_0x14f754['shift']());}};_0x8119eb(++_0x514bd8);}(_0xf46c,0xce));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this[_0xcf46('0x0')]=_0xcf46('0x1');this['uniqueid']='';this['calleridnum']='';this[_0xcf46('0x2')]='';this[_0xcf46('0x3')]='';this[_0xcf46('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xcf46('0x5')]=0x1;this[_0xcf46('0x6')]=0x1;this[_0xcf46('0x7')]=![];this[_0xcf46('0x8')]=null;this[_0xcf46('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xcf46('0xa')]=null;this[_0xcf46('0xb')]=0x1;this[_0xcf46('0xc')]='';this[_0xcf46('0xd')]='';this[_0xcf46('0xe')]='';this[_0xcf46('0xf')]='';this[_0xcf46('0x10')]='';this[_0xcf46('0x11')]='';this['priority']='';this[_0xcf46('0x12')]=0x0;this[_0xcf46('0x13')]=![];this[_0xcf46('0x14')]='';this[_0xcf46('0x15')]=_0xcf46('0x16');this['routealias']=null;this['mohtime']=0x0;this[_0xcf46('0x17')]={};}module[_0xcf46('0x18')]=QueueReport;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1aa9=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations'];(function(_0x50d419,_0x5df67c){var _0x480c4b=function(_0x4773e1){while(--_0x4773e1){_0x50d419['push'](_0x50d419['shift']());}};_0x480c4b(++_0x5df67c);}(_0x1aa9,0x1a3));var _0x91aa=function(_0x210729,_0x48136d){_0x210729=_0x210729-0x0;var _0x7687ee=_0x1aa9[_0x210729];return _0x7687ee;};'use strict';function SalesforceAccount(_0x2cf670){this['id']=_0x2cf670['id']||0x0;this[_0x91aa('0x0')]=_0x2cf670[_0x91aa('0x0')]||'';this[_0x91aa('0x1')]=_0x2cf670[_0x91aa('0x1')]||'';this['remoteUri']=_0x2cf670[_0x91aa('0x2')]||'';this['password']=_0x2cf670[_0x91aa('0x3')]||'';this[_0x91aa('0x4')]=_0x2cf670['clientId']||'';this[_0x91aa('0x5')]=_0x2cf670['clientSecret']||'';this[_0x91aa('0x6')]=_0x2cf670[_0x91aa('0x6')]||'';this['type']=_0x2cf670[_0x91aa('0x7')]||'integrationTab';this[_0x91aa('0x8')]=_0x2cf670['serverUrl']||'';this[_0x91aa('0x9')]=_0x2cf670[_0x91aa('0x9')]||{};}module[_0x91aa('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0x61d0=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','Configurations'];(function(_0x11e927,_0x34fbd3){var _0x58e4a4=function(_0x186269){while(--_0x186269){_0x11e927['push'](_0x11e927['shift']());}};_0x58e4a4(++_0x34fbd3);}(_0x61d0,0x187));var _0x061d=function(_0x5e5568,_0x300d0d){_0x5e5568=_0x5e5568-0x0;var _0x557045=_0x61d0[_0x5e5568];return _0x557045;};'use strict';function SalesforceAccount(_0x191969){this['id']=_0x191969['id']||0x0;this['name']=_0x191969[_0x061d('0x0')]||'';this[_0x061d('0x1')]=_0x191969['username']||'';this[_0x061d('0x2')]=_0x191969['remoteUri']||'';this[_0x061d('0x3')]=_0x191969[_0x061d('0x3')]||'';this['clientId']=_0x191969[_0x061d('0x4')]||'';this[_0x061d('0x5')]=_0x191969[_0x061d('0x5')]||'';this[_0x061d('0x6')]=_0x191969[_0x061d('0x6')]||'';this[_0x061d('0x7')]=_0x191969[_0x061d('0x7')]||'integrationTab';this['serverUrl']=_0x191969['serverUrl']||'';this[_0x061d('0x8')]=_0x191969['Configurations']||{};}module[_0x061d('0x9')]=SalesforceAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb200=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0xbd6821,_0x51a02a){var _0x2de2e1=function(_0x34ba60){while(--_0x34ba60){_0xbd6821['push'](_0xbd6821['shift']());}};_0x2de2e1(++_0x51a02a);}(_0xb200,0xc3));var _0x0b20=function(_0x499b83,_0xde81d0){_0x499b83=_0x499b83-0x0;var _0x15d62a=_0xb200[_0x499b83];return _0x15d62a;};'use strict';function ServicenowAccount(_0x10f872){this['id']=_0x10f872['id']||0x0;this[_0x0b20('0x0')]=_0x10f872[_0x0b20('0x0')]||'';this[_0x0b20('0x1')]=_0x10f872[_0x0b20('0x1')]||'';this[_0x0b20('0x2')]=_0x10f872['password']||'';this[_0x0b20('0x3')]=_0x10f872[_0x0b20('0x3')]||'';this['serverUrl']=_0x10f872[_0x0b20('0x4')]||'';this[_0x0b20('0x5')]=_0x10f872[_0x0b20('0x5')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0xaa16=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1814c2,_0x24b982){var _0x530e4e=function(_0x59c500){while(--_0x59c500){_0x1814c2['push'](_0x1814c2['shift']());}};_0x530e4e(++_0x24b982);}(_0xaa16,0x1cf));var _0x6aa1=function(_0x1dab8c,_0x2fd0a0){_0x1dab8c=_0x1dab8c-0x0;var _0x44ffab=_0xaa16[_0x1dab8c];return _0x44ffab;};'use strict';function ServicenowAccount(_0x749b9c){this['id']=_0x749b9c['id']||0x0;this[_0x6aa1('0x0')]=_0x749b9c[_0x6aa1('0x0')]||'';this[_0x6aa1('0x1')]=_0x749b9c[_0x6aa1('0x1')]||'';this[_0x6aa1('0x2')]=_0x749b9c[_0x6aa1('0x2')]||'';this['remoteUri']=_0x749b9c[_0x6aa1('0x3')]||'';this['serverUrl']=_0x749b9c[_0x6aa1('0x4')]||'';this[_0x6aa1('0x5')]=_0x749b9c['Configurations']||{};}module[_0x6aa1('0x6')]=ServicenowAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3e9=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x18913f,_0x1aef94){var _0x38d764=function(_0x50ca6c){while(--_0x50ca6c){_0x18913f['push'](_0x18913f['shift']());}};_0x38d764(++_0x1aef94);}(_0xf3e9,0xe9));var _0x9f3e=function(_0x4724b8,_0x106564){_0x4724b8=_0x4724b8-0x0;var _0x3c02ba=_0xf3e9[_0x4724b8];return _0x3c02ba;};'use strict';function SugarcrmAccount(_0x422a1e){this['id']=_0x422a1e['id']||0x0;this[_0x9f3e('0x0')]=_0x422a1e['name']||'';this['username']=_0x422a1e['username']||'';this['password']=_0x422a1e[_0x9f3e('0x1')]||'';this[_0x9f3e('0x2')]=_0x422a1e[_0x9f3e('0x2')]||'';this[_0x9f3e('0x3')]=_0x422a1e[_0x9f3e('0x3')]||'';this['Configurations']=_0x422a1e[_0x9f3e('0x4')]||{};}module[_0x9f3e('0x5')]=SugarcrmAccount;
\ No newline at end of file
+var _0xfcba=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x43f7c0,_0x1867ea){var _0xe4da3a=function(_0x29a7e2){while(--_0x29a7e2){_0x43f7c0['push'](_0x43f7c0['shift']());}};_0xe4da3a(++_0x1867ea);}(_0xfcba,0x1f3));var _0xafcb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfcba[_0x167cc1];return _0x10bc4b;};'use strict';function SugarcrmAccount(_0x4d82e3){this['id']=_0x4d82e3['id']||0x0;this[_0xafcb('0x0')]=_0x4d82e3['name']||'';this[_0xafcb('0x1')]=_0x4d82e3[_0xafcb('0x1')]||'';this[_0xafcb('0x2')]=_0x4d82e3[_0xafcb('0x2')]||'';this[_0xafcb('0x3')]=_0x4d82e3[_0xafcb('0x3')]||'';this['serverUrl']=_0x4d82e3[_0xafcb('0x4')]||'';this[_0xafcb('0x5')]=_0x4d82e3[_0xafcb('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa4ad=['address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xa4ad,0x80));var _0xda4a=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xa4ad[_0x2f9467];return _0x39894c;};'use strict';function Telephone(_0x4fae24){this['id']=_0x4fae24['id']||0x0;this['name']=_0x4fae24[_0xda4a('0x0')]||'';this[_0xda4a('0x1')]=_0x4fae24[_0xda4a('0x1')]||'';this[_0xda4a('0x2')]=_0xda4a('0x3');this[_0xda4a('0x4')]=0x0;this['status']='unknown';this[_0xda4a('0x5')]='';}module[_0xda4a('0x6')]=Telephone;
\ No newline at end of file
+var _0xbcde=['unknown','address','exports','name','accountcode','state'];(function(_0xb0ed0c,_0x1a1fb1){var _0x5d5356=function(_0x562be0){while(--_0x562be0){_0xb0ed0c['push'](_0xb0ed0c['shift']());}};_0x5d5356(++_0x1a1fb1);}(_0xbcde,0x1ef));var _0xebcd=function(_0x140f71,_0x2393c9){_0x140f71=_0x140f71-0x0;var _0x592b4a=_0xbcde[_0x140f71];return _0x592b4a;};'use strict';function Telephone(_0x13b76a){this['id']=_0x13b76a['id']||0x0;this[_0xebcd('0x0')]=_0x13b76a[_0xebcd('0x0')]||'';this[_0xebcd('0x1')]=_0x13b76a[_0xebcd('0x1')]||'';this[_0xebcd('0x2')]=_0xebcd('0x3');this['stateTime']=0x0;this['status']=_0xebcd('0x3');this[_0xebcd('0x4')]='';}module[_0xebcd('0x5')]=Telephone;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x13c2e2,_0x7a62b8){var _0x29fb34=function(_0x432494){while(--_0x432494){_0x13c2e2['push'](_0x13c2e2['shift']());}};_0x29fb34(++_0x7a62b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xb10b=['name','html'];(function(_0x194456,_0x2b4f4e){var _0x3af119=function(_0x28cc1a){while(--_0x28cc1a){_0x194456['push'](_0x194456['shift']());}};_0x3af119(++_0x2b4f4e);}(_0xb10b,0x12a));var _0xbb10=function(_0x48b122,_0x2e66d2){_0x48b122=_0x48b122-0x0;var _0x5f573a=_0xb10b[_0x48b122];return _0x5f573a;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger;
\ No newline at end of file
+var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1114b8,_0x38a20e){var _0x5d51d1=function(_0x25ae67){while(--_0x25ae67){_0x1114b8['push'](_0x1114b8['shift']());}};_0x5d51d1(++_0x38a20e);}(_0x4fc2,0x111));var _0x24fc=function(_0x3e9155,_0x38e9d2){_0x3e9155=_0x3e9155-0x0;var _0x5de67a=_0x4fc2[_0x3e9155];return _0x5de67a;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b5d=['defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','address'];(function(_0x11de83,_0x49e1c1){var _0x45bdb0=function(_0x51041e){while(--_0x51041e){_0x11de83['push'](_0x11de83['shift']());}};_0x45bdb0(++_0x49e1c1);}(_0x0b5d,0x68));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x165f3c){this['id']=_0x165f3c['id']||0x0;this[_0xd0b5('0x0')]=_0x165f3c['active']||![];this[_0xd0b5('0x1')]=_0x165f3c[_0xd0b5('0x1')]||'';this[_0xd0b5('0x2')]=_0xd0b5('0x3');this[_0xd0b5('0x4')]=0x0;this[_0xd0b5('0x5')]='unknown';this[_0xd0b5('0x6')]=_0x165f3c['registry']&&_0x165f3c['registry'][_0xd0b5('0x7')](':')?_0x165f3c['registry'][_0xd0b5('0x8')](':')[0x0]:'';this[_0xd0b5('0x9')]='';this[_0xd0b5('0xa')]='';this[_0xd0b5('0xb')]='';this[_0xd0b5('0xc')]='';this[_0xd0b5('0xd')]='';this['stateRegistry']=_0xd0b5('0x3');this['registrationtime']='';this[_0xd0b5('0xe')]='';this[_0xd0b5('0xf')]=_0x165f3c[_0xd0b5('0xf')]||'';}module[_0xd0b5('0x10')]=Trunk;
\ No newline at end of file
+var _0xca35=['defaultuser','exports','active','name','state','unknown','stateTime','registry','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xca35,0x92));var _0x5ca3=function(_0x230951,_0x4dad52){_0x230951=_0x230951-0x0;var _0xeb26b1=_0xca35[_0x230951];return _0xeb26b1;};'use strict';function Trunk(_0x4c1504){this['id']=_0x4c1504['id']||0x0;this[_0x5ca3('0x0')]=_0x4c1504[_0x5ca3('0x0')]||![];this[_0x5ca3('0x1')]=_0x4c1504['name']||'';this[_0x5ca3('0x2')]=_0x5ca3('0x3');this[_0x5ca3('0x4')]=0x0;this['status']=_0x5ca3('0x3');this[_0x5ca3('0x5')]=_0x4c1504['registry']&&_0x4c1504[_0x5ca3('0x5')]['indexOf'](':')?_0x4c1504[_0x5ca3('0x5')][_0x5ca3('0x6')](':')[0x0]:'';this[_0x5ca3('0x7')]='';this[_0x5ca3('0x8')]='';this[_0x5ca3('0x9')]='';this[_0x5ca3('0xa')]='';this[_0x5ca3('0xb')]='';this[_0x5ca3('0xc')]=_0x5ca3('0x3');this[_0x5ca3('0xd')]='';this['address']='';this[_0x5ca3('0xe')]=_0x4c1504[_0x5ca3('0xe')]||'';}module[_0x5ca3('0xf')]=Trunk;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5241=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x5241,0x176));var _0x1524=function(_0x387f3f,_0x2651b1){_0x387f3f=_0x387f3f-0x0;var _0x38e2ac=_0x5241[_0x387f3f];return _0x38e2ac;};'use strict';function voiceExtension(_0x785366){this['id']=_0x785366['id']||0x0;this[_0x1524('0x0')]=_0x785366[_0x1524('0x0')]||'';this[_0x1524('0x1')]=_0x785366[_0x1524('0x1')]||_0x1524('0x2');this[_0x1524('0x3')]=_0x785366[_0x1524('0x3')]||![];}module[_0x1524('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x631b=['exten','none','mandatoryDisposition'];(function(_0x2577ed,_0x1e41cc){var _0x1b5275=function(_0x5a0c1c){while(--_0x5a0c1c){_0x2577ed['push'](_0x2577ed['shift']());}};_0x1b5275(++_0x1e41cc);}(_0x631b,0xba));var _0xb631=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0x631b[_0x41d02a];return _0x4c3983;};'use strict';function voiceExtension(_0x4eba61){this['id']=_0x4eba61['id']||0x0;this[_0xb631('0x0')]=_0x4eba61['exten']||'';this['recordingFormat']=_0x4eba61['recordingFormat']||_0xb631('0x1');this[_0xb631('0x2')]=_0x4eba61[_0xb631('0x2')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','abandoned','available','inUse','invalid','onHold','ringing','ringInUse','talking','unavailable','unknown','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x5aa1a7,_0x4975ff){var _0xac5d6=function(_0x5a7aa0){while(--_0x5a7aa0){_0x5aa1a7['push'](_0x5aa1a7['shift']());}};_0xac5d6(++_0x4975ff);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x5fc3[_0x5ebc04];return _0x17845c;};'use strict';var monitorFormat={'wav':_0x35fc('0x0'),'wav49':_0x35fc('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x35fc('0x2'),'leastrecent':_0x35fc('0x3'),'linear':_0x35fc('0x4'),'random':_0x35fc('0x5'),'ringall':_0x35fc('0x6'),'rr':'roundrobin','rrmemory':_0x35fc('0x7'),'rrordered':_0x35fc('0x8'),'wrandom':_0x35fc('0x9')};function VoiceQueue(_0x5b85ad){this['id']=_0x5b85ad['id']||0x0;this['name']=_0x5b85ad[_0x35fc('0xa')]||'';this['monitor_format']=_0x5b85ad[_0x35fc('0xb')]||'';this[_0x35fc('0xc')]=_0x5b85ad[_0x35fc('0xc')]||_0x35fc('0xd');this[_0x35fc('0xe')]=0x0;this[_0x35fc('0xf')]=0x0;this[_0x35fc('0x10')]=0x0;this['sumDuration']=0x0;this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;this['unmanaged']=0x0;this[_0x35fc('0x13')]=0x0;this[_0x35fc('0x14')]=0x0;this['busy']=0x0;this[_0x35fc('0x15')]=0x0;this[_0x35fc('0x16')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x35fc('0x17')]=0x0;this['paused']=0x0;this[_0x35fc('0x18')]=0x0;this[_0x35fc('0x19')]=0x0;this[_0x35fc('0x1a')]=0x0;this[_0x35fc('0x1b')]=0x0;this[_0x35fc('0x1c')]=0x0;this['acw']=_0x5b85ad['acw']||![];this['acwTimeout']=_0x5b85ad['acwTimeout']||0xa;this[_0x35fc('0x1d')]=_0x5b85ad[_0x35fc('0x1d')]||'no';this[_0x35fc('0x1e')]=!![];this[_0x35fc('0x1f')]='';this[_0x35fc('0x20')]='';this[_0x35fc('0x21')]=0x0;this['temp']=0x0;this[_0x35fc('0x22')]=_0x5b85ad[_0x35fc('0x22')]||null;this['dialGlobalInterval']=_0x5b85ad[_0x35fc('0x23')]?_0x5b85ad[_0x35fc('0x23')]:null;this[_0x35fc('0x24')]=_0x5b85ad['dialActive'];this[_0x35fc('0x25')]=_0x5b85ad[_0x35fc('0x25')]||_0x35fc('0x26');this['dialLimitChannel']=_0x5b85ad[_0x35fc('0x27')]||0x0;this[_0x35fc('0x28')]=_0x5b85ad[_0x35fc('0x28')]||0x0;this[_0x35fc('0x29')]=_0x5b85ad[_0x35fc('0x29')]||0x1;this[_0x35fc('0x2a')]=_0x5b85ad[_0x35fc('0x2a')]||_0x35fc('0x2b');this[_0x35fc('0x2c')]=_0x5b85ad[_0x35fc('0x2c')]||0.03;this['dialPredictiveInterval']=_0x5b85ad[_0x35fc('0x2d')]||0x258;this[_0x35fc('0x2e')]=_0x5b85ad[_0x35fc('0x2e')]||_0x35fc('0x2f');this[_0x35fc('0x30')]=_0x5b85ad['dialOriginateCallerIdNumber']||_0x35fc('0x2f');this[_0x35fc('0x31')]=_0x5b85ad['dialOriginateTimeout']||0x1e;this[_0x35fc('0x32')]=_0x5b85ad[_0x35fc('0x32')]||_0x35fc('0x33');this['dialQueueTimeout']=_0x5b85ad[_0x35fc('0x34')]||0x3;this['dialQueueProject']=_0x5b85ad[_0x35fc('0x35')]||undefined;this[_0x35fc('0x36')]=_0x5b85ad['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x5b85ad[_0x35fc('0x37')]||0x96;this['dialBusyMaxRetry']=_0x5b85ad[_0x35fc('0x38')]||0x3;this[_0x35fc('0x39')]=_0x5b85ad['dialBusyRetryFrequency']||0x96;this[_0x35fc('0x3a')]=_0x5b85ad[_0x35fc('0x3a')]||0x3;this[_0x35fc('0x3b')]=_0x5b85ad[_0x35fc('0x3b')]||0x96;this[_0x35fc('0x3c')]=_0x5b85ad[_0x35fc('0x3c')]||0x3;this[_0x35fc('0x3d')]=_0x5b85ad[_0x35fc('0x3d')]||0x96;this['dialDropMaxRetry']=_0x5b85ad[_0x35fc('0x3e')]||0x3;this[_0x35fc('0x3f')]=_0x5b85ad[_0x35fc('0x3f')]||0x96;this['dialAbandonedMaxRetry']=_0x5b85ad[_0x35fc('0x40')]||0x3;this[_0x35fc('0x41')]=_0x5b85ad[_0x35fc('0x41')]||0x96;this[_0x35fc('0x42')]=_0x5b85ad[_0x35fc('0x42')]||0x3;this[_0x35fc('0x43')]=_0x5b85ad[_0x35fc('0x43')]||0x96;this[_0x35fc('0x44')]=_0x5b85ad[_0x35fc('0x44')]||0x3;this[_0x35fc('0x45')]=_0x5b85ad['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x5b85ad[_0x35fc('0x46')]||0x3;this['dialGlobalMaxRetry']=_0x5b85ad[_0x35fc('0x47')]||0x4;this[_0x35fc('0x48')]=_0x5b85ad[_0x35fc('0x48')]?_0x5b85ad[_0x35fc('0x48')]:undefined;this[_0x35fc('0x49')]=_0x5b85ad[_0x35fc('0x49')]?_0x5b85ad['TrunkBackup']:undefined;this[_0x35fc('0x4a')]=_0x5b85ad[_0x35fc('0x4a')]||undefined;this[_0x35fc('0x4b')]=_0x5b85ad[_0x35fc('0x4b')]?_0x5b85ad[_0x35fc('0x4b')]:undefined;this[_0x35fc('0x4c')]=_0x5b85ad['dialOrderByScheduledAt']||_0x35fc('0x4d');this[_0x35fc('0x4e')]=_0x5b85ad[_0x35fc('0x4e')]||undefined;this['dialCutDigit']=_0x5b85ad[_0x35fc('0x4f')]||undefined;this['strategy']=strategy[_0x5b85ad[_0x35fc('0x50')]];this[_0x35fc('0x51')]=!![];this[_0x35fc('0x52')]=_0x5b85ad[_0x35fc('0x52')]||![];this['dialAMDInitialSilence']=_0x5b85ad['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x5b85ad[_0x35fc('0x53')];this['dialAMDAfterGreetingSilence']=_0x5b85ad[_0x35fc('0x54')];this['dialAMDTotalAnalysisTime']=_0x5b85ad[_0x35fc('0x55')];this[_0x35fc('0x56')]=_0x5b85ad[_0x35fc('0x56')];this[_0x35fc('0x57')]=_0x5b85ad[_0x35fc('0x57')];this[_0x35fc('0x58')]=_0x5b85ad[_0x35fc('0x58')];this['dialAMDSilenceThreshold']=_0x5b85ad[_0x35fc('0x59')];this[_0x35fc('0x5a')]=_0x5b85ad['dialAMDMaximumWordLength'];this[_0x35fc('0x5b')]=0x0;this[_0x35fc('0x5c')]=0x0;this[_0x35fc('0x5d')]=_0x5b85ad[_0x35fc('0x5d')];this[_0x35fc('0x5e')]=0x0;this[_0x35fc('0x5f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x35fc('0x60')]=0x0;this[_0x35fc('0x61')]=0x0;this[_0x35fc('0x62')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x35fc('0x63')]=0x0;this[_0x35fc('0x64')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x35fc('0x65')]=0x0;this[_0x35fc('0x66')]=0x0;this[_0x35fc('0x67')]=0x0;this[_0x35fc('0x68')]=0x0;this[_0x35fc('0x69')]=undefined;this[_0x35fc('0x6a')]=undefined;this[_0x35fc('0x6b')]=undefined;this[_0x35fc('0x6c')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x35fc('0x6d')]=0x0;this[_0x35fc('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x35fc('0x6f')]=0x0;this[_0x35fc('0x70')]=_0x5b85ad['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x35fc('0x71')]=_0x5b85ad[_0x35fc('0x72')]||0xa;this[_0x35fc('0x73')]=0x0;this[_0x35fc('0x74')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x35fc('0x75')]=_0x5b85ad[_0x35fc('0x75')]||0x1e;this['dialRecallInQueue']=_0x5b85ad[_0x35fc('0x76')]||![];this['dialPreviewAutoRecallMe']=!!_0x5b85ad[_0x35fc('0x77')]||![];this[_0x35fc('0x78')]=!!_0x5b85ad[_0x35fc('0x78')]||![];this[_0x35fc('0x79')]=_0x5b85ad[_0x35fc('0x79')]||undefined;this['dialAgiAfterHangupClient']=_0x5b85ad[_0x35fc('0x7a')]||![];this[_0x35fc('0x7b')]=_0x5b85ad['dialAgiAfterHangupAgent']||![];this[_0x35fc('0xb')]=monitorFormat[_0x5b85ad[_0x35fc('0xb')]]?monitorFormat[_0x5b85ad[_0x35fc('0xb')]]:undefined;this[_0x35fc('0x7c')]=_0x5b85ad['mandatoryDisposition']||![];this[_0x35fc('0x7d')]=_0x5b85ad['mandatoryDispositionPause']?_0x5b85ad['mandatoryDispositionPause']:undefined;this[_0x35fc('0x7e')]=![];}module[_0x35fc('0x7f')]=VoiceQueue;
\ No newline at end of file
+var _0xc21c=['rrordered','wrandom','name','monitor_format','type','inbound','total','sumDuration','sumBillable','unmanaged','busy','inUse','loggedIn','onHold','paused','ringing','talking','unknown','acw','acwTimeout','autopause','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','roundrobin','rrmemory'];(function(_0x1468a6,_0x36f745){var _0xa0810=function(_0x3add99){while(--_0x3add99){_0x1468a6['push'](_0x1468a6['shift']());}};_0xa0810(++_0x36f745);}(_0xc21c,0x166));var _0xcc21=function(_0x322bab,_0x158ce1){_0x322bab=_0x322bab-0x0;var _0x585e9c=_0xc21c[_0x322bab];return _0x585e9c;};'use strict';var monitorFormat={'wav':_0xcc21('0x0'),'wav49':_0xcc21('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0xcc21('0x2'),'leastrecent':_0xcc21('0x3'),'linear':_0xcc21('0x4'),'random':_0xcc21('0x5'),'ringall':'ringall','rr':_0xcc21('0x6'),'rrmemory':_0xcc21('0x7'),'rrordered':_0xcc21('0x8'),'wrandom':_0xcc21('0x9')};function VoiceQueue(_0x1ff108){this['id']=_0x1ff108['id']||0x0;this[_0xcc21('0xa')]=_0x1ff108[_0xcc21('0xa')]||'';this['monitor_format']=_0x1ff108[_0xcc21('0xb')]||'';this[_0xcc21('0xc')]=_0x1ff108[_0xcc21('0xc')]||_0xcc21('0xd');this['waiting']=0x0;this[_0xcc21('0xe')]=0x0;this['answered']=0x0;this[_0xcc21('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0xcc21('0x10')]=0x0;this[_0xcc21('0x11')]=0x0;this['abandoned']=0x0;this['available']=0x0;this[_0xcc21('0x12')]=0x0;this[_0xcc21('0x13')]=0x0;this['invalid']=0x0;this[_0xcc21('0x14')]=0x0;this['notInUse']=0x0;this[_0xcc21('0x15')]=0x0;this[_0xcc21('0x16')]=0x0;this[_0xcc21('0x17')]=0x0;this['ringInUse']=0x0;this[_0xcc21('0x18')]=0x0;this['unavailable']=0x0;this[_0xcc21('0x19')]=0x0;this[_0xcc21('0x1a')]=_0x1ff108[_0xcc21('0x1a')]||![];this[_0xcc21('0x1b')]=_0x1ff108[_0xcc21('0x1b')]||0xa;this[_0xcc21('0x1c')]=_0x1ff108[_0xcc21('0x1c')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xcc21('0x1d')]='';this['originated']=0x0;this[_0xcc21('0x1e')]=0x0;this[_0xcc21('0x1f')]=_0x1ff108[_0xcc21('0x1f')]||null;this[_0xcc21('0x20')]=_0x1ff108[_0xcc21('0x20')]?_0x1ff108['dialGlobalInterval']:null;this[_0xcc21('0x21')]=_0x1ff108[_0xcc21('0x21')];this[_0xcc21('0x22')]=_0x1ff108[_0xcc21('0x22')]||'progressive';this[_0xcc21('0x23')]=_0x1ff108[_0xcc21('0x23')]||0x0;this[_0xcc21('0x24')]=_0x1ff108[_0xcc21('0x24')]||0x0;this[_0xcc21('0x25')]=_0x1ff108['dialPowerLevel']||0x1;this[_0xcc21('0x26')]=_0x1ff108[_0xcc21('0x26')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x1ff108[_0xcc21('0x27')]||0.03;this['dialPredictiveInterval']=_0x1ff108[_0xcc21('0x28')]||0x258;this[_0xcc21('0x29')]=_0x1ff108[_0xcc21('0x29')]||_0xcc21('0x2a');this[_0xcc21('0x2b')]=_0x1ff108[_0xcc21('0x2b')]||'anonymous';this[_0xcc21('0x2c')]=_0x1ff108['dialOriginateTimeout']||0x1e;this[_0xcc21('0x2d')]=_0x1ff108[_0xcc21('0x2d')]||_0xcc21('0x2e');this[_0xcc21('0x2f')]=_0x1ff108['dialQueueTimeout']||0x3;this[_0xcc21('0x30')]=_0x1ff108['dialQueueProject']||undefined;this[_0xcc21('0x31')]=_0x1ff108[_0xcc21('0x31')]||0x3;this[_0xcc21('0x32')]=_0x1ff108[_0xcc21('0x32')]||0x96;this[_0xcc21('0x33')]=_0x1ff108[_0xcc21('0x33')]||0x3;this[_0xcc21('0x34')]=_0x1ff108[_0xcc21('0x34')]||0x96;this[_0xcc21('0x35')]=_0x1ff108[_0xcc21('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1ff108[_0xcc21('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1ff108[_0xcc21('0x37')]||0x3;this[_0xcc21('0x38')]=_0x1ff108[_0xcc21('0x38')]||0x96;this['dialDropMaxRetry']=_0x1ff108[_0xcc21('0x39')]||0x3;this['dialDropRetryFrequency']=_0x1ff108[_0xcc21('0x3a')]||0x96;this['dialAbandonedMaxRetry']=_0x1ff108['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x1ff108['dialAbandonedRetryFrequency']||0x96;this[_0xcc21('0x3b')]=_0x1ff108['dialMachineMaxRetry']||0x3;this[_0xcc21('0x3c')]=_0x1ff108['dialMachineRetryFrequency']||0x96;this[_0xcc21('0x3d')]=_0x1ff108[_0xcc21('0x3d')]||0x3;this[_0xcc21('0x3e')]=_0x1ff108['dialAgentRejectRetryFrequency']||0x96;this[_0xcc21('0x3f')]=_0x1ff108[_0xcc21('0x3f')]||0x3;this[_0xcc21('0x40')]=_0x1ff108[_0xcc21('0x40')]||0x4;this['Trunk']=_0x1ff108['Trunk']?_0x1ff108[_0xcc21('0x41')]:undefined;this['TrunkBackup']=_0x1ff108[_0xcc21('0x42')]?_0x1ff108[_0xcc21('0x42')]:undefined;this[_0xcc21('0x43')]=_0x1ff108['dialPrefix']||undefined;this[_0xcc21('0x44')]=_0x1ff108['Interval']?_0x1ff108['Interval']:undefined;this[_0xcc21('0x45')]=_0x1ff108[_0xcc21('0x45')]||'DESC';this[_0xcc21('0x46')]=_0x1ff108[_0xcc21('0x46')]||undefined;this[_0xcc21('0x47')]=_0x1ff108[_0xcc21('0x47')]||undefined;this[_0xcc21('0x48')]=strategy[_0x1ff108[_0xcc21('0x48')]];this['queueStatusComplete']=!![];this[_0xcc21('0x49')]=_0x1ff108[_0xcc21('0x49')]||![];this[_0xcc21('0x4a')]=_0x1ff108[_0xcc21('0x4a')];this[_0xcc21('0x4b')]=_0x1ff108['dialAMDGreeting'];this[_0xcc21('0x4c')]=_0x1ff108[_0xcc21('0x4c')];this[_0xcc21('0x4d')]=_0x1ff108['dialAMDTotalAnalysisTime'];this[_0xcc21('0x4e')]=_0x1ff108[_0xcc21('0x4e')];this[_0xcc21('0x4f')]=_0x1ff108[_0xcc21('0x4f')];this['dialAMDMaximumNumberOfWords']=_0x1ff108['dialAMDMaximumNumberOfWords'];this[_0xcc21('0x50')]=_0x1ff108[_0xcc21('0x50')];this['dialAMDMaximumWordLength']=_0x1ff108[_0xcc21('0x51')];this[_0xcc21('0x52')]=0x0;this[_0xcc21('0x53')]=0x0;this[_0xcc21('0x54')]=_0x1ff108[_0xcc21('0x54')];this[_0xcc21('0x55')]=0x0;this[_0xcc21('0x56')]=0x0;this[_0xcc21('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xcc21('0x58')]=0x0;this[_0xcc21('0x59')]=0x0;this[_0xcc21('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xcc21('0x5b')]=0x0;this[_0xcc21('0x5c')]=0x0;this[_0xcc21('0x5d')]=0x0;this[_0xcc21('0x5e')]=0x0;this[_0xcc21('0x5f')]=undefined;this['startPredictive']=undefined;this[_0xcc21('0x60')]=undefined;this[_0xcc21('0x61')]=1.05;this[_0xcc21('0x62')]=0x0;this[_0xcc21('0x63')]=0x0;this[_0xcc21('0x64')]=0x0;this[_0xcc21('0x65')]=0x0;this[_0xcc21('0x66')]=0x0;this[_0xcc21('0x67')]=0x0;this[_0xcc21('0x68')]=0x0;this[_0xcc21('0x69')]=0x0;this[_0xcc21('0x6a')]=_0x1ff108[_0xcc21('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x1ff108['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xcc21('0x6c')]=0x0;this[_0xcc21('0x6d')]=0x1;this[_0xcc21('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0xcc21('0x6f')]=_0x1ff108[_0xcc21('0x6f')]||0x1e;this[_0xcc21('0x70')]=_0x1ff108[_0xcc21('0x70')]||![];this[_0xcc21('0x71')]=!!_0x1ff108[_0xcc21('0x71')]||![];this[_0xcc21('0x72')]=!!_0x1ff108['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x1ff108[_0xcc21('0x73')]||undefined;this[_0xcc21('0x74')]=_0x1ff108[_0xcc21('0x74')]||![];this['dialAgiAfterHangupAgent']=_0x1ff108[_0xcc21('0x75')]||![];this[_0xcc21('0xb')]=monitorFormat[_0x1ff108[_0xcc21('0xb')]]?monitorFormat[_0x1ff108[_0xcc21('0xb')]]:undefined;this['mandatoryDisposition']=_0x1ff108[_0xcc21('0x76')]||![];this[_0xcc21('0x77')]=_0x1ff108[_0xcc21('0x77')]?_0x1ff108[_0xcc21('0x77')]:undefined;this[_0xcc21('0x78')]=![];}module[_0xcc21('0x79')]=VoiceQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbea5=['startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','invalid','loggedin','callers','length','SIP/','incall','includes','status','dialMethod','booked','dialer','exten','prototype','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedIn','paused','ringing','talking','waiting','originated','outboundBlacklistCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','inUse','loggedInDb','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xbea5,0x177));var _0x5bea=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0xbea5[_0x1e2080];return _0x260111;};'use strict';var INBOUND_COUNTERS=[_0x5bea('0x0'),_0x5bea('0x1'),'loggedInDb',_0x5bea('0x2'),_0x5bea('0x3'),_0x5bea('0x4'),_0x5bea('0x5')];var OUTBOUND_COUNTERS=[_0x5bea('0x0'),'answered','inUse',_0x5bea('0x1'),'loggedInDb',_0x5bea('0x6'),'outboundAbandonedCallsDay','outboundAnswerCallsDay',_0x5bea('0x7'),'outboundBusyCallsDay','outboundCongestionCallsDay',_0x5bea('0x8'),_0x5bea('0x9'),_0x5bea('0xa'),'outboundRejectCallsDay',_0x5bea('0xb'),'paused','pTalking',_0x5bea('0x4'),_0x5bea('0xc'),_0x5bea('0xd'),_0x5bea('0xe'),_0x5bea('0x5')];function VoiceQueueSummary(_0x386f92){this['id']=_0x386f92['id'];this['name']=_0x386f92[_0x5bea('0xf')];this[_0x5bea('0x10')]=_0x386f92['strategy'];this[_0x5bea('0x11')]=_0x386f92[_0x5bea('0x11')]||0x0;this['answered']=_0x386f92[_0x5bea('0x12')]||0x0;this[_0x5bea('0x0')]=_0x386f92[_0x5bea('0x0')]||0x0;this[_0x5bea('0x13')]=_0x386f92[_0x5bea('0x13')]||0x0;this[_0x5bea('0x14')]=_0x386f92[_0x5bea('0x14')]||0x0;this['invalid']=_0x386f92['invalid']||0x0;this[_0x5bea('0x1')]=_0x386f92[_0x5bea('0x1')]||0x0;this[_0x5bea('0x15')]=_0x386f92['loggedInDb']||0x0;this[_0x5bea('0x16')]=_0x386f92[_0x5bea('0x16')]||0x0;this[_0x5bea('0x17')]=_0x386f92['notInUse']||0x0;this[_0x5bea('0x2')]=_0x386f92[_0x5bea('0x2')]||0x0;this['ringing']=_0x386f92[_0x5bea('0x3')]||0x0;this['ringInUse']=_0x386f92[_0x5bea('0x18')];this[_0x5bea('0xc')]=_0x386f92[_0x5bea('0xc')];this['sumDuration']=_0x386f92['sumDuration'];this[_0x5bea('0x19')]=_0x386f92[_0x5bea('0x19')]||0x0;this[_0x5bea('0x4')]=_0x386f92['talking']||0x0;this[_0x5bea('0xe')]=_0x386f92[_0x5bea('0xe')]||0x0;this[_0x5bea('0x1a')]=_0x386f92[_0x5bea('0x1a')];this['unavailable']=_0x386f92[_0x5bea('0x1b')]||0x0;this[_0x5bea('0x1c')]=_0x386f92[_0x5bea('0x1c')]||0x0;this[_0x5bea('0x1d')]=_0x386f92['unmanaged']||0x0;this[_0x5bea('0x5')]=_0x386f92['waiting']||0x0;if(_0x386f92[_0x5bea('0x1a')]==='outbound'){this[_0x5bea('0x1e')]=_0x386f92[_0x5bea('0x1e')]||0x0;this[_0x5bea('0x1f')]=_0x386f92[_0x5bea('0x1f')];this['dialMethod']=_0x386f92['dialMethod'];this['dialOriginateCallerIdName']=_0x386f92[_0x5bea('0x20')];this[_0x5bea('0x21')]=_0x386f92['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x386f92[_0x5bea('0x22')];this[_0x5bea('0x23')]=_0x386f92['dialPrefix'];this[_0x5bea('0x24')]=_0x386f92['temp'];this['outboundAnswerAgiCallsDay']=_0x386f92[_0x5bea('0x25')];this[_0x5bea('0x26')]=_0x386f92[_0x5bea('0x26')];this[_0x5bea('0x7')]=_0x386f92[_0x5bea('0x7')];this[_0x5bea('0x27')]=_0x386f92[_0x5bea('0x27')];this[_0x5bea('0x28')]=_0x386f92[_0x5bea('0x28')];this['outboundDropCallsDayACS']=_0x386f92['outboundDropCallsDayACS'];this[_0x5bea('0x29')]=_0x386f92[_0x5bea('0x29')];this[_0x5bea('0x2a')]=_0x386f92[_0x5bea('0x2a')];this['outboundNoAnswerCallsDay']=_0x386f92[_0x5bea('0x8')];this[_0x5bea('0x9')]=_0x386f92[_0x5bea('0x9')];this[_0x5bea('0x2b')]=_0x386f92['outboundOriginateFailureCallsDay'];this[_0x5bea('0xa')]=_0x386f92[_0x5bea('0xa')];this[_0x5bea('0x2c')]=_0x386f92['outboundRejectCallsDay'];this[_0x5bea('0xb')]=_0x386f92[_0x5bea('0xb')];this[_0x5bea('0x2d')]=_0x386f92[_0x5bea('0x2d')];this[_0x5bea('0x2e')]=_0x386f92[_0x5bea('0x2e')];this['predictiveIntervalAvgTalktime']=_0x386f92['predictiveIntervalAvgTalktime'];this[_0x5bea('0x2f')]=_0x386f92[_0x5bea('0x2f')];this['predictiveIntervalDroppedCallsTimeout']=_0x386f92[_0x5bea('0x30')];this['predictiveIntervalErlangCalls']=_0x386f92[_0x5bea('0x31')];this[_0x5bea('0x32')]=_0x386f92['predictiveIntervalErlangCallsDroppedCalls'];this[_0x5bea('0x33')]=_0x386f92[_0x5bea('0x33')];this[_0x5bea('0x34')]=_0x386f92['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x386f92[_0x5bea('0x35')];this[_0x5bea('0x36')]=_0x386f92[_0x5bea('0x36')];this[_0x5bea('0x37')]=_0x386f92[_0x5bea('0x37')];this['originated']=_0x386f92[_0x5bea('0x6')];this['erlangCalls']=_0x386f92[_0x5bea('0x38')];this[_0x5bea('0x39')]=_0x386f92[_0x5bea('0x39')];this[_0x5bea('0x3a')]=_0x386f92[_0x5bea('0x3a')];this['erlangBusyFactor']=_0x386f92[_0x5bea('0x3b')];this[_0x5bea('0x3c')]=_0x386f92[_0x5bea('0x3c')];this[_0x5bea('0x3d')]=_0x386f92['startProgressive'];this[_0x5bea('0x3e')]=_0x386f92[_0x5bea('0x3e')];this[_0x5bea('0x3f')]=_0x386f92[_0x5bea('0x3f')];}if(_0x386f92[_0x5bea('0x40')]){this['Trunk']={'id':_0x386f92[_0x5bea('0x40')]['id'],'name':_0x386f92[_0x5bea('0x40')]['name'],'active':_0x386f92[_0x5bea('0x40')][_0x5bea('0x41')],'callerid':_0x386f92[_0x5bea('0x40')][_0x5bea('0x42')]};}}VoiceQueueSummary['prototype'][_0x5bea('0x43')]=function(_0x2e1976,_0xb805ab,_0x3690f0,_0x45c7bd){this[_0x5bea('0x15')]=0x0;this['talking']=0x0;this[_0x5bea('0x2')]=0x0;this['unknown']=0x0;this[_0x5bea('0x17')]=0x0;this[_0x5bea('0x14')]=0x0;this[_0x5bea('0x13')]=0x0;this[_0x5bea('0x44')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x5bea('0x16')]=0x0;if(_0x3690f0){if(_0x3690f0[_0x5bea('0x0')]){this[_0x5bea('0x0')]=Number(_0x3690f0['available']);}if(_0x3690f0[_0x5bea('0x45')]){this[_0x5bea('0x1')]=Number(_0x3690f0[_0x5bea('0x45')]);}if(_0x3690f0['callers']){this['waiting']=Number(_0x3690f0[_0x5bea('0x46')]);}}for(var _0x48355b=0x0;_0x48355b<_0x2e1976[_0x5bea('0x47')];_0x48355b++){var _0x2fea06=_0xb805ab[_0x5bea('0x48')+_0x2e1976[_0x48355b][_0x5bea('0xf')]];if(_0x2fea06&&_0x2fea06['online']){this[_0x5bea('0x15')]+=0x1;}if(_0x2e1976[_0x48355b][_0x5bea('0x49')]==='1'){this[_0x5bea('0x4')]+=0x1;}if(_0x2e1976[_0x48355b][_0x5bea('0x2')]==='1'&&!['2','7','8'][_0x5bea('0x4a')](_0x2e1976[_0x48355b]['status'])){this['paused']+=0x1;}switch(_0x2e1976[_0x48355b][_0x5bea('0x4b')]){case'0':this[_0x5bea('0x1c')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x5bea('0x14')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x5bea('0x44')]+=0x1;break;case'5':this[_0x5bea('0x1b')]+=0x1;break;case'6':this[_0x5bea('0x3')]+=0x1;break;case'7':this[_0x5bea('0x18')]+=0x1;break;case'8':this[_0x5bea('0x16')]+=0x1;break;}}if(this[_0x5bea('0x4c')]===_0x5bea('0x4d')){var _0x16771e=Object['keys'](_0x45c7bd);for(var _0x4b6783=0x0;_0x4b6783<_0x16771e['length'];_0x4b6783++){var _0x101a3b=_0x16771e[_0x4b6783];var _0x3c0bc3=_0x45c7bd[_0x101a3b];if(_0x3c0bc3['queue']===this[_0x5bea('0xf')]&&_0x3c0bc3['type']===_0x5bea('0x4e')&&_0x3c0bc3[_0x5bea('0x4f')]==='xcally-motion-preview'){this[_0x5bea('0x4')]+=0x1;}}if(this[_0x5bea('0x4')]>this[_0x5bea('0x14')]){this[_0x5bea('0x4')]=this[_0x5bea('0x14')];}this[_0x5bea('0x1e')]=0x0;}return this;};VoiceQueueSummary[_0x5bea('0x50')]['compareToInboundQueue']=function(_0x2a39a4){var _0x2a4fa4=![];if(_0x2a39a4){_0x2a4fa4=INBOUND_COUNTERS[_0x5bea('0x51')](function(_0x3c4dd2){return this[_0x3c4dd2]!==_0x2a39a4[_0x3c4dd2];},this);}return _0x2a4fa4;};VoiceQueueSummary[_0x5bea('0x50')][_0x5bea('0x52')]=function(_0x4941fe){var _0x3dbf5b=![];var _0x1863df=![];var _0xd0a1e7=![];if(_0x4941fe){_0x3dbf5b=this[_0x5bea('0x4c')]!==_0x4941fe[_0x5bea('0x4c')]||this[_0x5bea('0x1f')]!==_0x4941fe[_0x5bea('0x1f')]||this[_0x5bea('0x3e')]!==_0x4941fe[_0x5bea('0x3e')]||this[_0x5bea('0x3f')]!==_0x4941fe[_0x5bea('0x3f')];_0x1863df=OUTBOUND_COUNTERS[_0x5bea('0x51')](function(_0x117df9){return this[_0x117df9]!==_0x4941fe[_0x117df9];},this);if(this['Trunk']&&_0x4941fe[_0x5bea('0x40')]){_0xd0a1e7=this['Trunk'][_0x5bea('0xf')]!==_0x4941fe[_0x5bea('0x40')][_0x5bea('0xf')]||this[_0x5bea('0x40')]['active']!==_0x4941fe[_0x5bea('0x40')][_0x5bea('0x41')];}}return _0x3dbf5b||_0x1863df||_0xd0a1e7;};VoiceQueueSummary[_0x5bea('0x50')][_0x5bea('0x53')]=function(_0x24f441){this[_0x5bea('0x12')]=_0x24f441[_0x5bea('0x12')];this[_0x5bea('0x3e')]=_0x24f441[_0x5bea('0x3e')];this['statusMessage']=_0x24f441[_0x5bea('0x3f')];this[_0x5bea('0x6')]=_0x24f441[_0x5bea('0x6')];this[_0x5bea('0x54')]=_0x24f441['outboundAbandonedCallsDay'];this[_0x5bea('0x26')]=_0x24f441[_0x5bea('0x26')];this[_0x5bea('0x7')]=_0x24f441[_0x5bea('0x7')];this['outboundBusyCallsDay']=_0x24f441[_0x5bea('0x27')];this[_0x5bea('0x28')]=_0x24f441[_0x5bea('0x28')];this[_0x5bea('0x8')]=_0x24f441['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x24f441[_0x5bea('0x9')];this['outboundReCallsDay']=_0x24f441[_0x5bea('0xa')];this['outboundRejectCallsDay']=_0x24f441[_0x5bea('0x2c')];this['outboundUnknownCallsDay']=_0x24f441[_0x5bea('0xb')];this[_0x5bea('0xc')]=_0x24f441[_0x5bea('0xc')];this[_0x5bea('0xd')]=_0x24f441[_0x5bea('0xd')];this[_0x5bea('0xe')]=_0x24f441[_0x5bea('0xe')];if(this[_0x5bea('0x4c')]===_0x5bea('0x55')){this['pTalking']=_0x24f441['pTalking'];}};module[_0x5bea('0x56')]=VoiceQueueSummary;
\ No newline at end of file
+var _0xae24=['status','booked','keys','length','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','compareToOutboundQueue','some','active','updateReportFromOutboundQueue','exports','available','loggedInDb','ringing','talking','answered','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','waiting','name','strategy','abandoned','busy','invalid','onHold','notInUse','paused','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','inUse','loggedin','callers','SIP/','incall','includes'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0xae24,0x182));var _0x4ae2=function(_0x337eeb,_0x4f17e9){_0x337eeb=_0x337eeb-0x0;var _0x2dfdd8=_0xae24[_0x337eeb];return _0x2dfdd8;};'use strict';var INBOUND_COUNTERS=[_0x4ae2('0x0'),'loggedIn',_0x4ae2('0x1'),'paused',_0x4ae2('0x2'),_0x4ae2('0x3'),'waiting'];var OUTBOUND_COUNTERS=['available',_0x4ae2('0x4'),'inUse',_0x4ae2('0x5'),_0x4ae2('0x1'),_0x4ae2('0x6'),_0x4ae2('0x7'),_0x4ae2('0x8'),_0x4ae2('0x9'),'outboundBusyCallsDay','outboundCongestionCallsDay',_0x4ae2('0xa'),'outboundNoSuchCallsDay','outboundReCallsDay',_0x4ae2('0xb'),_0x4ae2('0xc'),'paused',_0x4ae2('0xd'),_0x4ae2('0x3'),_0x4ae2('0xe'),_0x4ae2('0xf'),'total',_0x4ae2('0x10')];function VoiceQueueSummary(_0xcbd76d){this['id']=_0xcbd76d['id'];this[_0x4ae2('0x11')]=_0xcbd76d['name'];this[_0x4ae2('0x12')]=_0xcbd76d[_0x4ae2('0x12')];this[_0x4ae2('0x13')]=_0xcbd76d[_0x4ae2('0x13')]||0x0;this[_0x4ae2('0x4')]=_0xcbd76d[_0x4ae2('0x4')]||0x0;this[_0x4ae2('0x0')]=_0xcbd76d[_0x4ae2('0x0')]||0x0;this[_0x4ae2('0x14')]=_0xcbd76d['busy']||0x0;this['inUse']=_0xcbd76d['inUse']||0x0;this[_0x4ae2('0x15')]=_0xcbd76d[_0x4ae2('0x15')]||0x0;this['loggedIn']=_0xcbd76d[_0x4ae2('0x5')]||0x0;this[_0x4ae2('0x1')]=_0xcbd76d[_0x4ae2('0x1')]||0x0;this[_0x4ae2('0x16')]=_0xcbd76d[_0x4ae2('0x16')]||0x0;this[_0x4ae2('0x17')]=_0xcbd76d[_0x4ae2('0x17')]||0x0;this[_0x4ae2('0x18')]=_0xcbd76d[_0x4ae2('0x18')]||0x0;this[_0x4ae2('0x2')]=_0xcbd76d['ringing']||0x0;this['ringInUse']=_0xcbd76d[_0x4ae2('0x19')];this[_0x4ae2('0xe')]=_0xcbd76d['sumBillable'];this[_0x4ae2('0xf')]=_0xcbd76d[_0x4ae2('0xf')];this[_0x4ae2('0x1a')]=_0xcbd76d[_0x4ae2('0x1a')]||0x0;this[_0x4ae2('0x3')]=_0xcbd76d['talking']||0x0;this[_0x4ae2('0x1b')]=_0xcbd76d['total']||0x0;this['type']=_0xcbd76d[_0x4ae2('0x1c')];this[_0x4ae2('0x1d')]=_0xcbd76d[_0x4ae2('0x1d')]||0x0;this[_0x4ae2('0x1e')]=_0xcbd76d[_0x4ae2('0x1e')]||0x0;this['unmanaged']=_0xcbd76d[_0x4ae2('0x1f')]||0x0;this['waiting']=_0xcbd76d[_0x4ae2('0x10')]||0x0;if(_0xcbd76d[_0x4ae2('0x1c')]===_0x4ae2('0x20')){this['pTalking']=_0xcbd76d[_0x4ae2('0xd')]||0x0;this[_0x4ae2('0x21')]=_0xcbd76d[_0x4ae2('0x21')];this[_0x4ae2('0x22')]=_0xcbd76d[_0x4ae2('0x22')];this[_0x4ae2('0x23')]=_0xcbd76d['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0xcbd76d[_0x4ae2('0x24')];this[_0x4ae2('0x25')]=_0xcbd76d[_0x4ae2('0x25')];this[_0x4ae2('0x26')]=_0xcbd76d[_0x4ae2('0x26')];this[_0x4ae2('0x27')]=_0xcbd76d['temp'];this['outboundAnswerAgiCallsDay']=_0xcbd76d[_0x4ae2('0x28')];this['outboundAnswerCallsDay']=_0xcbd76d['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0xcbd76d[_0x4ae2('0x9')];this[_0x4ae2('0x29')]=_0xcbd76d['outboundBusyCallsDay'];this[_0x4ae2('0x2a')]=_0xcbd76d[_0x4ae2('0x2a')];this[_0x4ae2('0x2b')]=_0xcbd76d[_0x4ae2('0x2b')];this[_0x4ae2('0x2c')]=_0xcbd76d[_0x4ae2('0x2c')];this[_0x4ae2('0x2d')]=_0xcbd76d[_0x4ae2('0x2d')];this[_0x4ae2('0xa')]=_0xcbd76d[_0x4ae2('0xa')];this[_0x4ae2('0x2e')]=_0xcbd76d[_0x4ae2('0x2e')];this[_0x4ae2('0x2f')]=_0xcbd76d[_0x4ae2('0x2f')];this[_0x4ae2('0x30')]=_0xcbd76d[_0x4ae2('0x30')];this[_0x4ae2('0xb')]=_0xcbd76d['outboundRejectCallsDay'];this[_0x4ae2('0xc')]=_0xcbd76d['outboundUnknownCallsDay'];this[_0x4ae2('0x31')]=_0xcbd76d[_0x4ae2('0x31')];this['predictiveIntervalAvgHoldtime']=_0xcbd76d[_0x4ae2('0x32')];this[_0x4ae2('0x33')]=_0xcbd76d[_0x4ae2('0x33')];this[_0x4ae2('0x34')]=_0xcbd76d['predictiveIntervalDroppedCallsCallersExit'];this[_0x4ae2('0x35')]=_0xcbd76d[_0x4ae2('0x35')];this[_0x4ae2('0x36')]=_0xcbd76d[_0x4ae2('0x36')];this[_0x4ae2('0x37')]=_0xcbd76d[_0x4ae2('0x37')];this[_0x4ae2('0x38')]=_0xcbd76d[_0x4ae2('0x38')];this[_0x4ae2('0x39')]=_0xcbd76d['predictiveIntervalMultiplicativeFactor'];this[_0x4ae2('0x3a')]=_0xcbd76d['predictiveIntervalPauses'];this[_0x4ae2('0x3b')]=_0xcbd76d[_0x4ae2('0x3b')];this[_0x4ae2('0x3c')]=_0xcbd76d[_0x4ae2('0x3c')];this[_0x4ae2('0x6')]=_0xcbd76d[_0x4ae2('0x6')];this['erlangCalls']=_0xcbd76d[_0x4ae2('0x3d')];this[_0x4ae2('0x3e')]=_0xcbd76d[_0x4ae2('0x3e')];this[_0x4ae2('0x3f')]=_0xcbd76d['erlangAbandonmentRate'];this[_0x4ae2('0x40')]=_0xcbd76d[_0x4ae2('0x40')];this[_0x4ae2('0x41')]=_0xcbd76d[_0x4ae2('0x41')];this[_0x4ae2('0x42')]=_0xcbd76d[_0x4ae2('0x42')];this[_0x4ae2('0x43')]=_0xcbd76d[_0x4ae2('0x43')];this[_0x4ae2('0x44')]=_0xcbd76d[_0x4ae2('0x44')];}if(_0xcbd76d[_0x4ae2('0x45')]){this['Trunk']={'id':_0xcbd76d[_0x4ae2('0x45')]['id'],'name':_0xcbd76d[_0x4ae2('0x45')][_0x4ae2('0x11')],'active':_0xcbd76d[_0x4ae2('0x45')]['active'],'callerid':_0xcbd76d['Trunk'][_0x4ae2('0x46')]};}}VoiceQueueSummary[_0x4ae2('0x47')][_0x4ae2('0x48')]=function(_0x3cdf23,_0x567371,_0x3c0a56,_0x178898){this['loggedInDb']=0x0;this[_0x4ae2('0x3')]=0x0;this[_0x4ae2('0x18')]=0x0;this[_0x4ae2('0x1e')]=0x0;this['notInUse']=0x0;this[_0x4ae2('0x49')]=0x0;this[_0x4ae2('0x14')]=0x0;this[_0x4ae2('0x15')]=0x0;this[_0x4ae2('0x1d')]=0x0;this[_0x4ae2('0x2')]=0x0;this[_0x4ae2('0x19')]=0x0;this[_0x4ae2('0x16')]=0x0;if(_0x3c0a56){if(_0x3c0a56[_0x4ae2('0x0')]){this['available']=Number(_0x3c0a56[_0x4ae2('0x0')]);}if(_0x3c0a56[_0x4ae2('0x4a')]){this['loggedIn']=Number(_0x3c0a56[_0x4ae2('0x4a')]);}if(_0x3c0a56[_0x4ae2('0x4b')]){this['waiting']=Number(_0x3c0a56[_0x4ae2('0x4b')]);}}for(var _0x30ac85=0x0;_0x30ac85<_0x3cdf23['length'];_0x30ac85++){var _0x21baf4=_0x567371[_0x4ae2('0x4c')+_0x3cdf23[_0x30ac85][_0x4ae2('0x11')]];if(_0x21baf4&&_0x21baf4['online']){this['loggedInDb']+=0x1;}if(_0x3cdf23[_0x30ac85][_0x4ae2('0x4d')]==='1'){this[_0x4ae2('0x3')]+=0x1;}if(_0x3cdf23[_0x30ac85][_0x4ae2('0x18')]==='1'&&!['2','7','8'][_0x4ae2('0x4e')](_0x3cdf23[_0x30ac85]['status'])){this[_0x4ae2('0x18')]+=0x1;}switch(_0x3cdf23[_0x30ac85][_0x4ae2('0x4f')]){case'0':this[_0x4ae2('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x4ae2('0x49')]+=0x1;break;case'3':this[_0x4ae2('0x14')]+=0x1;break;case'4':this[_0x4ae2('0x15')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x4ae2('0x2')]+=0x1;break;case'7':this[_0x4ae2('0x19')]+=0x1;break;case'8':this[_0x4ae2('0x16')]+=0x1;break;}}if(this[_0x4ae2('0x22')]===_0x4ae2('0x50')){var _0x1b3b0b=Object[_0x4ae2('0x51')](_0x178898);for(var _0x2fe532=0x0;_0x2fe532<_0x1b3b0b[_0x4ae2('0x52')];_0x2fe532++){var _0xf6d12a=_0x1b3b0b[_0x2fe532];var _0x48afbb=_0x178898[_0xf6d12a];if(_0x48afbb[_0x4ae2('0x53')]===this[_0x4ae2('0x11')]&&_0x48afbb[_0x4ae2('0x1c')]===_0x4ae2('0x54')&&_0x48afbb[_0x4ae2('0x55')]===_0x4ae2('0x56')){this[_0x4ae2('0x3')]+=0x1;}}if(this[_0x4ae2('0x3')]>this['inUse']){this[_0x4ae2('0x3')]=this[_0x4ae2('0x49')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x4ae2('0x47')][_0x4ae2('0x57')]=function(_0x4f7206){var _0x46af88=![];if(_0x4f7206){_0x46af88=INBOUND_COUNTERS['some'](function(_0x426d29){return this[_0x426d29]!==_0x4f7206[_0x426d29];},this);}return _0x46af88;};VoiceQueueSummary['prototype'][_0x4ae2('0x58')]=function(_0x74b5be){var _0x43cfef=![];var _0x1a21ad=![];var _0x8525c4=![];if(_0x74b5be){_0x43cfef=this[_0x4ae2('0x22')]!==_0x74b5be[_0x4ae2('0x22')]||this[_0x4ae2('0x21')]!==_0x74b5be[_0x4ae2('0x21')]||this['message']!==_0x74b5be[_0x4ae2('0x43')]||this[_0x4ae2('0x44')]!==_0x74b5be[_0x4ae2('0x44')];_0x1a21ad=OUTBOUND_COUNTERS[_0x4ae2('0x59')](function(_0x4ab531){return this[_0x4ab531]!==_0x74b5be[_0x4ab531];},this);if(this[_0x4ae2('0x45')]&&_0x74b5be[_0x4ae2('0x45')]){_0x8525c4=this[_0x4ae2('0x45')]['name']!==_0x74b5be['Trunk'][_0x4ae2('0x11')]||this[_0x4ae2('0x45')][_0x4ae2('0x5a')]!==_0x74b5be[_0x4ae2('0x45')][_0x4ae2('0x5a')];}}return _0x43cfef||_0x1a21ad||_0x8525c4;};VoiceQueueSummary[_0x4ae2('0x47')][_0x4ae2('0x5b')]=function(_0x390c1f){this[_0x4ae2('0x4')]=_0x390c1f['answered'];this[_0x4ae2('0x43')]=_0x390c1f['message'];this[_0x4ae2('0x44')]=_0x390c1f[_0x4ae2('0x44')];this[_0x4ae2('0x6')]=_0x390c1f[_0x4ae2('0x6')];this[_0x4ae2('0x7')]=_0x390c1f[_0x4ae2('0x7')];this[_0x4ae2('0x8')]=_0x390c1f[_0x4ae2('0x8')];this['outboundBlacklistCallsDay']=_0x390c1f['outboundBlacklistCallsDay'];this[_0x4ae2('0x29')]=_0x390c1f[_0x4ae2('0x29')];this[_0x4ae2('0x2a')]=_0x390c1f['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x390c1f[_0x4ae2('0xa')];this[_0x4ae2('0x2e')]=_0x390c1f[_0x4ae2('0x2e')];this[_0x4ae2('0x30')]=_0x390c1f[_0x4ae2('0x30')];this['outboundRejectCallsDay']=_0x390c1f['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x390c1f[_0x4ae2('0xc')];this['sumBillable']=_0x390c1f['sumBillable'];this[_0x4ae2('0xf')]=_0x390c1f['sumDuration'];this[_0x4ae2('0x1b')]=_0x390c1f['total'];if(this[_0x4ae2('0x22')]==='preview'){this[_0x4ae2('0xd')]=_0x390c1f['pTalking'];}};module[_0x4ae2('0x5c')]=VoiceQueueSummary;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0434=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x288897,_0x1c4166){var _0x33f6aa=function(_0x3a6757){while(--_0x3a6757){_0x288897['push'](_0x288897['shift']());}};_0x33f6aa(++_0x1c4166);}(_0x0434,0xa4));var _0x4043=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x0434[_0x39e283];return _0x7de89f;};'use strict';function VtigerAccount(_0x112bf8){this['id']=_0x112bf8['id']||0x0;this['name']=_0x112bf8[_0x4043('0x0')]||'';this[_0x4043('0x1')]=_0x112bf8['username']||'';this[_0x4043('0x2')]=_0x112bf8[_0x4043('0x2')]||'';this[_0x4043('0x3')]=_0x112bf8[_0x4043('0x3')]||'';this[_0x4043('0x4')]=_0x112bf8[_0x4043('0x4')]||'';this[_0x4043('0x5')]=_0x112bf8[_0x4043('0x5')]||{};}module[_0x4043('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x186e=['accessKey','remoteUri','Configurations','name','username'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x186e,0xbc));var _0xe186=function(_0x510e20,_0x1ae643){_0x510e20=_0x510e20-0x0;var _0x4cf5b6=_0x186e[_0x510e20];return _0x4cf5b6;};'use strict';function VtigerAccount(_0x3361ad){this['id']=_0x3361ad['id']||0x0;this[_0xe186('0x0')]=_0x3361ad[_0xe186('0x0')]||'';this[_0xe186('0x1')]=_0x3361ad[_0xe186('0x1')]||'';this['accessKey']=_0x3361ad[_0xe186('0x2')]||'';this[_0xe186('0x3')]=_0x3361ad[_0xe186('0x3')]||'';this['serverUrl']=_0x3361ad['serverUrl']||'';this[_0xe186('0x4')]=_0x3361ad['Configurations']||{};}module['exports']=VtigerAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e11=['integrationTab','serverUrl','exports','name','username','password','token','authType','type'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0x0e11,0x135));var _0x10e1=function(_0x46734c,_0x52047f){_0x46734c=_0x46734c-0x0;var _0x5a9b4d=_0x0e11[_0x46734c];return _0x5a9b4d;};'use strict';function ZendeskAccount(_0x476910){this['id']=_0x476910['id']||0x0;this[_0x10e1('0x0')]=_0x476910[_0x10e1('0x0')]||'';this[_0x10e1('0x1')]=_0x476910[_0x10e1('0x1')]||'';this['password']=_0x476910[_0x10e1('0x2')]||'';this[_0x10e1('0x3')]=_0x476910[_0x10e1('0x3')]||'';this['remoteUri']=_0x476910['remoteUri']||'';this[_0x10e1('0x4')]=_0x476910[_0x10e1('0x4')]||'';this[_0x10e1('0x5')]=_0x476910[_0x10e1('0x5')]||_0x10e1('0x6');this[_0x10e1('0x7')]=_0x476910[_0x10e1('0x7')]||'';this['Configurations']=_0x476910['Configurations']||{};}module[_0x10e1('0x8')]=ZendeskAccount;
\ No newline at end of file
+var _0x29d4=['authType','type','serverUrl','Configurations','exports','name','username','password','token'];(function(_0xda4a49,_0x23312a){var _0x19c839=function(_0x46016a){while(--_0x46016a){_0xda4a49['push'](_0xda4a49['shift']());}};_0x19c839(++_0x23312a);}(_0x29d4,0x164));var _0x429d=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x29d4[_0x4e1d03];return _0x362d4b;};'use strict';function ZendeskAccount(_0x52c628){this['id']=_0x52c628['id']||0x0;this[_0x429d('0x0')]=_0x52c628['name']||'';this[_0x429d('0x1')]=_0x52c628['username']||'';this[_0x429d('0x2')]=_0x52c628[_0x429d('0x2')]||'';this[_0x429d('0x3')]=_0x52c628[_0x429d('0x3')]||'';this['remoteUri']=_0x52c628['remoteUri']||'';this[_0x429d('0x4')]=_0x52c628[_0x429d('0x4')]||'';this[_0x429d('0x5')]=_0x52c628[_0x429d('0x5')]||'integrationTab';this['serverUrl']=_0x52c628[_0x429d('0x6')]||'';this['Configurations']=_0x52c628[_0x429d('0x7')]||{};}module[_0x429d('0x8')]=ZendeskAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x654b=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x654b,0x1c2));var _0xb654=function(_0x4d62bc,_0x393272){_0x4d62bc=_0x4d62bc-0x0;var _0x1dea32=_0x654b[_0x4d62bc];return _0x1dea32;};'use strict';function ZohoAccount(_0x4d90f7){this['id']=_0x4d90f7['id']||0x0;this[_0xb654('0x0')]=_0x4d90f7['name']||'';this[_0xb654('0x1')]=_0x4d90f7[_0xb654('0x1')]||'';this[_0xb654('0x2')]=_0x4d90f7[_0xb654('0x2')]||'';this[_0xb654('0x3')]=_0x4d90f7[_0xb654('0x3')]||'';this[_0xb654('0x4')]=_0x4d90f7['clientId']||'';this[_0xb654('0x5')]=_0x4d90f7[_0xb654('0x5')]||'';this[_0xb654('0x6')]=_0x4d90f7['serverUrl']||'';this[_0xb654('0x7')]=_0x4d90f7[_0xb654('0x7')]||'';this[_0xb654('0x8')]=_0x4d90f7[_0xb654('0x8')]||'';this[_0xb654('0x9')]=_0x4d90f7[_0xb654('0x9')]||{};}module[_0xb654('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x0ed7=['Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0x0ed7,0x14b));var _0x70ed=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0x0ed7[_0x132558];return _0x34f138;};'use strict';function ZohoAccount(_0x3d9167){this['id']=_0x3d9167['id']||0x0;this[_0x70ed('0x0')]=_0x3d9167['name']||'';this[_0x70ed('0x1')]=_0x3d9167['description']||'';this['host']=_0x3d9167[_0x70ed('0x2')]||'';this[_0x70ed('0x3')]=_0x3d9167[_0x70ed('0x3')]||'';this['clientId']=_0x3d9167[_0x70ed('0x4')]||'';this[_0x70ed('0x5')]=_0x3d9167[_0x70ed('0x5')]||'';this[_0x70ed('0x6')]=_0x3d9167[_0x70ed('0x6')]||'';this[_0x70ed('0x7')]=_0x3d9167['code']||'';this[_0x70ed('0x8')]=_0x3d9167[_0x70ed('0x8')]||'';this[_0x70ed('0x9')]=_0x3d9167['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1775=['countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry'];(function(_0x29ef18,_0x5a68c3){var _0x2f5ee0=function(_0x4caf88){while(--_0x4caf88){_0x29ef18['push'](_0x29ef18['shift']());}};_0x2f5ee0(++_0x5a68c3);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));function checkNameSurname(_0x6abfb8,_0x2ca33b,_0xaad33e){var _0x38ee08='';if(!_[_0x5177('0x2')](_0x2ca33b)&&_0x5177('0x3')===typeof _0x2ca33b){_0x38ee08+=_0x2ca33b;}if(!_[_0x5177('0x2')](_0xaad33e)&&_0x5177('0x3')===typeof _0xaad33e){_0x38ee08+='\x20'+_0xaad33e;}if(_0x38ee08!==''){return _0x38ee08;}return _0x6abfb8;}function Action(_0x159a20,_0x2c5c42,_0x153c1a,_0x2ac1c6,_0x300b43){this[_0x5177('0x4')]=_0x153c1a||undefined;this[_0x5177('0x5')]=_0x159a20['id'];this[_0x5177('0x6')]=_0x2c5c42[_0x5177('0x7')];this[_0x5177('0x8')]=_0x2c5c42[_0x5177('0x8')];this[_0x5177('0x9')]='queue';this['dialAnswer']=![];this[_0x5177('0xa')]=_[_0x5177('0x2')](_0x159a20[_0x5177('0xb')])?undefined:_0x159a20[_0x5177('0xb')][_0x5177('0x7')];this['channelAgent']=this[_0x5177('0xa')]?util[_0x5177('0xc')](_0x5177('0xd'),this[_0x5177('0xa')]):_0x2ac1c6||undefined;this[_0x5177('0xe')]=checkNameSurname(_0x159a20[_0x5177('0xf')][_0x5177('0x10')],_0x159a20[_0x5177('0xf')][_0x5177('0x11')],_0x159a20[_0x5177('0xf')][_0x5177('0x12')]);this[_0x5177('0x13')]=_0x159a20[_0x5177('0x13')]||![];this[_0x5177('0x14')]=_0x159a20[_0x5177('0x10')];this[_0x5177('0x15')]=_0x159a20[_0x5177('0x15')];this[_0x5177('0x16')]=_0x159a20[_0x5177('0x16')]||0x0;this['countcongestionretry']=_0x159a20[_0x5177('0x17')]||0x0;this[_0x5177('0x18')]=_0x159a20[_0x5177('0x18')]||0x0;this[_0x5177('0x19')]=(_0x159a20['countbusyretry']||0x0)+(_0x159a20[_0x5177('0x17')]||0x0)+(_0x159a20[_0x5177('0x18')]||0x0)+(_0x159a20[_0x5177('0x1a')]||0x0)+(_0x159a20['countdropretry']||0x0)+(_0x159a20[_0x5177('0x1b')]||0x0)+(_0x159a20['countmachineretry']||0x0)+(_0x159a20[_0x5177('0x1c')]||0x0);this[_0x5177('0x1a')]=_0x159a20[_0x5177('0x1a')]||0x0;this[_0x5177('0x1d')]=_0x159a20[_0x5177('0x1d')]||0x0;this[_0x5177('0x1b')]=_0x159a20[_0x5177('0x1b')]||0x0;this[_0x5177('0x1e')]=_0x159a20[_0x5177('0x1e')]||0x0;this[_0x5177('0x1c')]=_0x159a20[_0x5177('0x1c')]||0x0;this[_0x5177('0x1f')]=_0x159a20['callback'];this[_0x5177('0x20')]=_0x159a20['callbackuniqueid'];this[_0x5177('0x21')]=_0x159a20[_0x5177('0x21')];this[_0x5177('0x22')]=_0x159a20[_0x5177('0x22')];this['ContactId']=_0x159a20[_0x5177('0x23')];this['ListId']=_0x159a20['ListId'];this[_0x5177('0x24')]=_[_0x5177('0x2')](_0x159a20['Agent'])?_0x159a20[_0x5177('0x24')]:_0x159a20['Agent']['id'];this[_0x5177('0x25')]=_0x159a20[_0x5177('0x25')];this['originatecalleridnum']='';this[_0x5177('0x26')]='';}Action[_0x5177('0x27')][_0x5177('0x28')]=function(){return util[_0x5177('0xc')](_0x5177('0x29'),this[_0x5177('0xe')],this['number']);};module['exports']=Action;
\ No newline at end of file
+var _0x36ee=['callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','exports','moment','isNil','string','idContact','name','type','queue','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe36e('0x0'));function checkNameSurname(_0x521ff3,_0xf6b517,_0x4018bf){var _0x36c9f6='';if(!_[_0xe36e('0x1')](_0xf6b517)&&_0xe36e('0x2')===typeof _0xf6b517){_0x36c9f6+=_0xf6b517;}if(!_[_0xe36e('0x1')](_0x4018bf)&&_0xe36e('0x2')===typeof _0x4018bf){_0x36c9f6+='\x20'+_0x4018bf;}if(_0x36c9f6!==''){return _0x36c9f6;}return _0x521ff3;}function Action(_0x3f29e1,_0x25a07d,_0x190404,_0x21be0b,_0x1aa596){this['uniqueid']=_0x190404||undefined;this[_0xe36e('0x3')]=_0x3f29e1['id'];this['queue']=_0x25a07d[_0xe36e('0x4')];this[_0xe36e('0x5')]=_0x25a07d[_0xe36e('0x5')];this['campaigntype']=_0xe36e('0x6');this['dialAnswer']=![];this[_0xe36e('0x7')]=_[_0xe36e('0x1')](_0x3f29e1[_0xe36e('0x8')])?undefined:_0x3f29e1[_0xe36e('0x8')][_0xe36e('0x4')];this[_0xe36e('0x9')]=this[_0xe36e('0x7')]?util[_0xe36e('0xa')]('SIP/%s',this[_0xe36e('0x7')]):_0x21be0b||undefined;this[_0xe36e('0xb')]=checkNameSurname(_0x3f29e1[_0xe36e('0xc')][_0xe36e('0xd')],_0x3f29e1['Contact'][_0xe36e('0xe')],_0x3f29e1['Contact']['lastName']);this[_0xe36e('0xf')]=_0x3f29e1[_0xe36e('0xf')]||![];this[_0xe36e('0x10')]=_0x3f29e1[_0xe36e('0xd')];this[_0xe36e('0x11')]=_0x3f29e1[_0xe36e('0x11')];this[_0xe36e('0x12')]=_0x3f29e1[_0xe36e('0x12')]||0x0;this[_0xe36e('0x13')]=_0x3f29e1[_0xe36e('0x13')]||0x0;this['countnoanswerretry']=_0x3f29e1[_0xe36e('0x14')]||0x0;this[_0xe36e('0x15')]=(_0x3f29e1['countbusyretry']||0x0)+(_0x3f29e1[_0xe36e('0x13')]||0x0)+(_0x3f29e1['countnoanswerretry']||0x0)+(_0x3f29e1[_0xe36e('0x16')]||0x0)+(_0x3f29e1[_0xe36e('0x17')]||0x0)+(_0x3f29e1['countabandonedretry']||0x0)+(_0x3f29e1[_0xe36e('0x18')]||0x0)+(_0x3f29e1[_0xe36e('0x19')]||0x0);this[_0xe36e('0x16')]=_0x3f29e1['countnosuchnumberretry']||0x0;this[_0xe36e('0x17')]=_0x3f29e1[_0xe36e('0x17')]||0x0;this[_0xe36e('0x1a')]=_0x3f29e1[_0xe36e('0x1a')]||0x0;this[_0xe36e('0x18')]=_0x3f29e1[_0xe36e('0x18')]||0x0;this['countagentrejectretry']=_0x3f29e1[_0xe36e('0x19')]||0x0;this[_0xe36e('0x1b')]=_0x3f29e1[_0xe36e('0x1b')];this[_0xe36e('0x1c')]=_0x3f29e1[_0xe36e('0x1c')];this['callbackat']=_0x3f29e1['callbackat'];this[_0xe36e('0x1d')]=_0x3f29e1[_0xe36e('0x1d')];this[_0xe36e('0x1e')]=_0x3f29e1[_0xe36e('0x1e')];this[_0xe36e('0x1f')]=_0x3f29e1[_0xe36e('0x1f')];this[_0xe36e('0x20')]=_['isNil'](_0x3f29e1[_0xe36e('0x8')])?_0x3f29e1[_0xe36e('0x20')]:_0x3f29e1[_0xe36e('0x8')]['id'];this[_0xe36e('0x21')]=_0x3f29e1['VoiceQueueId'];this[_0xe36e('0x22')]='';this['originatecalleridname']='';}Action[_0xe36e('0x23')]['getCaller']=function(){return util[_0xe36e('0xa')]('\x22%s\x22\x20<%s>',this[_0xe36e('0xb')],this['number']);};module[_0xe36e('0x24')]=Action;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x33880d,_0x462a76){var _0x5ac3de=function(_0xa04308){while(--_0xa04308){_0x33880d['push'](_0x33880d['shift']());}};_0x5ac3de(++_0x462a76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview;
\ No newline at end of file
+var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x89a36f,_0x62538c){var _0x1335ef=function(_0x36ad82){while(--_0x36ad82){_0x89a36f['push'](_0x89a36f['shift']());}};_0x1335ef(++_0x62538c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x90bf=['[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','then','[moveContactManagedDialer]\x20','checkIsBlackList','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90bf,0x12e));var _0xf90b=function(_0x7030f5,_0x4cf872){_0x7030f5=_0x7030f5-0x0;var _0x5b1726=_0x90bf[_0x7030f5];return _0x5b1726;};'use strict';var util=require(_0xf90b('0x0'));var BPromise=require(_0xf90b('0x1'));var logger=require(_0xf90b('0x2'))(_0xf90b('0x3'));var cmHopper=require(_0xf90b('0x4'));var cmHopperHistory=require(_0xf90b('0x5'));var cmHopperBlack=require(_0xf90b('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xf90b('0x7'));function loggerCatch(_0x25bbbb){return function(_0x351236){logger[_0xf90b('0x8')](_0x25bbbb,util[_0xf90b('0x9')](_0x351236,{'showHidden':![],'depth':null}));};}function create(_0x29f971){return cmHopperHistory[_0xf90b('0xa')](_0x29f971)[_0xf90b('0xb')](loggerCatch(_0xf90b('0xc')));}function createAgent(_0x3e354d){return BPromise['resolve']()[_0xf90b('0xd')](agentReportPreview[_0xf90b('0xa')](_0x3e354d))[_0xf90b('0xb')](loggerCatch(_0xf90b('0xc')));}function moveContact(_0x432c2a){return cmHopper['moveContactManagedDialer'](_0x432c2a,!![])[_0xf90b('0xb')](loggerCatch(_0xf90b('0xe')));}exports[_0xf90b('0xf')]=function(_0x3b611b){return cmHopperBlack[_0xf90b('0xf')](_0x3b611b)[_0xf90b('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x1482b8){return BPromise[_0xf90b('0x10')]()[_0xf90b('0xd')](cmHopper['getContactPreview'](_0x1482b8))[_0xf90b('0xb')](loggerCatch(_0xf90b('0x11')));};exports[_0xf90b('0xa')]=function(_0x2f1b15,_0x4985ac){create(_0x2f1b15)[_0xf90b('0xb')](loggerCatch(_0x4985ac));moveContact(_0x2f1b15)[_0xf90b('0xb')](loggerCatch(_0x4985ac));};exports[_0xf90b('0x12')]=function(_0xddb3d7,_0x33c2f9){createAgent(_0xddb3d7)[_0xf90b('0xb')](loggerCatch(_0x33c2f9));};exports[_0xf90b('0x13')]=function(_0x4f188c,_0x163aa8){create(_0x4f188c)['catch'](loggerCatch(_0x163aa8));};exports[_0xf90b('0x14')]=function(_0xfa4545,_0x534881){moveContact(_0xfa4545)[_0xf90b('0xb')](loggerCatch(_0x534881));};exports[_0xf90b('0x15')]=function(_0x288af2,_0x33becc,_0x307378){if(_0x33becc){_0x288af2['UserId']=null;}if(_0x307378){_0x288af2[_0xf90b('0x16')]=![];}return cmHopper[_0xf90b('0x15')](_0x288af2)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x17')));};exports[_0xf90b('0x18')]=function(_0xb89538){return cmHopper[_0xf90b('0x18')](_0xb89538)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x19')));};exports[_0xf90b('0x1a')]=function(_0x339a69){return cmHopper[_0xf90b('0x1a')]({'UserId':null},_0x339a69,0x1)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x1b')));};exports['disableContact']=function(_0x26dfe7){return cmHopper[_0xf90b('0x1a')]({'active':![]},_0x26dfe7,0x1)[_0xf90b('0xb')](loggerCatch(_0xf90b('0x1c')));};exports[_0xf90b('0x1d')]=function(_0x161b19){var _0x5372d5={};_0x5372d5[_0xf90b('0x1e')]=_0x161b19['type'];_0x5372d5[_0xf90b('0x1f')]=_0x161b19[_0xf90b('0x1f')];_0x5372d5[_0xf90b('0x20')]=_0x161b19[_0xf90b('0x20')];_0x5372d5[_0xf90b('0x21')]=_0x161b19[_0xf90b('0x21')];_0x5372d5[_0xf90b('0x22')]=_0x161b19[_0xf90b('0x22')];_0x5372d5['queuecallerjoinAt']=_0x161b19[_0xf90b('0x23')];_0x5372d5[_0xf90b('0x24')]=_0x161b19[_0xf90b('0x23')];_0x5372d5[_0xf90b('0x25')]=0x1;_0x5372d5[_0xf90b('0x26')]=_0x161b19[_0xf90b('0x27')];_0x5372d5[_0xf90b('0x28')]=_0x161b19[_0xf90b('0x29')];_0x5372d5[_0xf90b('0x2a')]=_0xf90b('0x2b');_0x5372d5['exten']=_0xf90b('0x2c');_0x5372d5['holdtime']=0x0;_0x5372d5[_0xf90b('0x2d')]=0x1;_0x5372d5[_0xf90b('0x2e')]=_0x161b19[_0xf90b('0x29')];_0x5372d5[_0xf90b('0x2f')]=_0xf90b('0x30');return BPromise[_0xf90b('0x10')]()[_0xf90b('0xd')](voiceQueueReport[_0xf90b('0x31')](_0x5372d5))[_0xf90b('0xb')](loggerCatch(_0xf90b('0x32')));};exports['getContactRecallMe']=function(_0x488f6a,_0x41c642){return BPromise[_0xf90b('0x10')]()[_0xf90b('0xd')](cmHopper[_0xf90b('0x33')](_0x488f6a,_0x41c642))[_0xf90b('0xb')](loggerCatch(_0xf90b('0x34')));};exports[_0xf90b('0x35')]=function(_0x16e275){return cmHopper[_0xf90b('0x15')](_0x16e275,!![],!![])[_0xf90b('0xb')](loggerCatch(_0xf90b('0x36')));};
\ No newline at end of file
+var _0x36bb=['assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime'];(function(_0x31f617,_0x443721){var _0x5e2512=function(_0x59f635){while(--_0x59f635){_0x31f617['push'](_0x31f617['shift']());}};_0x5e2512(++_0x443721);}(_0x36bb,0x11b));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xb36b('0x0'));var BPromise=require(_0xb36b('0x1'));var logger=require(_0xb36b('0x2'))(_0xb36b('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb36b('0x4'));var cmHopperBlack=require(_0xb36b('0x5'));var agentReportPreview=require(_0xb36b('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x40ec9a){return function(_0xb79ef0){logger[_0xb36b('0x7')](_0x40ec9a,util[_0xb36b('0x8')](_0xb79ef0,{'showHidden':![],'depth':null}));};}function create(_0x4702c5){return cmHopperHistory[_0xb36b('0x9')](_0x4702c5)[_0xb36b('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x433976){return BPromise[_0xb36b('0xb')]()[_0xb36b('0xc')](agentReportPreview['createHistory'](_0x433976))[_0xb36b('0xa')](loggerCatch(_0xb36b('0xd')));}function moveContact(_0x2e4385){return cmHopper[_0xb36b('0xe')](_0x2e4385,!![])[_0xb36b('0xa')](loggerCatch(_0xb36b('0xf')));}exports['checkIsBlackList']=function(_0x4175bf){return cmHopperBlack['checkIsBlackList'](_0x4175bf)[_0xb36b('0xa')](loggerCatch(_0xb36b('0x10')));};exports['getContactPreview']=function(_0x3d4850){return BPromise[_0xb36b('0xb')]()[_0xb36b('0xc')](cmHopper[_0xb36b('0x11')](_0x3d4850))[_0xb36b('0xa')](loggerCatch(_0xb36b('0x12')));};exports['createHistory']=function(_0x1bb65f,_0x25e9e7){create(_0x1bb65f)[_0xb36b('0xa')](loggerCatch(_0x25e9e7));moveContact(_0x1bb65f)[_0xb36b('0xa')](loggerCatch(_0x25e9e7));};exports[_0xb36b('0x13')]=function(_0x468a05,_0x5874b3){createAgent(_0x468a05)[_0xb36b('0xa')](loggerCatch(_0x5874b3));};exports['createCustomerHistory']=function(_0x21ca1b,_0x4ffea6){create(_0x21ca1b)[_0xb36b('0xa')](loggerCatch(_0x4ffea6));};exports[_0xb36b('0x14')]=function(_0x5c10a2,_0x8a0de8){moveContact(_0x5c10a2)[_0xb36b('0xa')](loggerCatch(_0x8a0de8));};exports[_0xb36b('0x15')]=function(_0x4a3b90,_0x4a8fdf,_0x224876){if(_0x4a8fdf){_0x4a3b90[_0xb36b('0x16')]=null;}if(_0x224876){_0x4a3b90[_0xb36b('0x17')]=![];}return cmHopper[_0xb36b('0x15')](_0x4a3b90)[_0xb36b('0xa')](loggerCatch(_0xb36b('0x18')));};exports[_0xb36b('0x19')]=function(_0x258e90){return cmHopper[_0xb36b('0x19')](_0x258e90)[_0xb36b('0xa')](loggerCatch(_0xb36b('0x1a')));};exports[_0xb36b('0x1b')]=function(_0x10bf68){return cmHopper['unlockContact']({'UserId':null},_0x10bf68,0x1)[_0xb36b('0xa')](loggerCatch('[unlockContact]\x20'));};exports[_0xb36b('0x1c')]=function(_0x5b345a){return cmHopper[_0xb36b('0x1b')]({'active':![]},_0x5b345a,0x1)['catch'](loggerCatch(_0xb36b('0x1d')));};exports['crateCustomerReportQueue']=function(_0x219309){var _0xdd43b6={};_0xdd43b6['type']=_0x219309[_0xb36b('0x1e')];_0xdd43b6[_0xb36b('0x1f')]=_0x219309[_0xb36b('0x1f')];_0xdd43b6[_0xb36b('0x20')]=_0x219309['calleridnum'];_0xdd43b6[_0xb36b('0x21')]=_0x219309['calleridname'];_0xdd43b6['queue']=_0x219309[_0xb36b('0x22')];_0xdd43b6[_0xb36b('0x23')]=_0x219309['answertime'];_0xdd43b6[_0xb36b('0x24')]=_0x219309['answertime'];_0xdd43b6[_0xb36b('0x25')]=0x1;_0xdd43b6[_0xb36b('0x26')]=_0x219309[_0xb36b('0x27')];_0xdd43b6[_0xb36b('0x28')]=_0x219309[_0xb36b('0x29')];_0xdd43b6[_0xb36b('0x2a')]=_0xb36b('0x2b');_0xdd43b6[_0xb36b('0x2c')]=_0xb36b('0x2d');_0xdd43b6[_0xb36b('0x2e')]=0x0;_0xdd43b6[_0xb36b('0x2f')]=0x1;_0xdd43b6[_0xb36b('0x30')]=_0x219309[_0xb36b('0x29')];_0xdd43b6[_0xb36b('0x31')]=_0xb36b('0x32');return BPromise[_0xb36b('0xb')]()[_0xb36b('0xc')](voiceQueueReport[_0xb36b('0x33')](_0xdd43b6))[_0xb36b('0xa')](loggerCatch(_0xb36b('0x34')));};exports[_0xb36b('0x35')]=function(_0x14dee1,_0x323609){return BPromise[_0xb36b('0xb')]()[_0xb36b('0xc')](cmHopper['getContactRecallMe'](_0x14dee1,_0x323609))[_0xb36b('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0xdaee91){return cmHopper[_0xb36b('0x15')](_0xdaee91,!![],!![])['catch'](loggerCatch(_0xb36b('0x36')));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb184=['calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','membername','UserId','talktime','answertime','getSeconds','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','inspect','logger','loggerError','error','info','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','isActive','isNil','addVariables','Queue','name'];(function(_0x3b44be,_0x396815){var _0x3c6131=function(_0x29be93){while(--_0x29be93){_0x3b44be['push'](_0x3b44be['shift']());}};_0x3c6131(++_0x396815);}(_0xb184,0xf7));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4b18('0x0'));var _=require(_0x4b18('0x1'));var moment=require(_0x4b18('0x2'));var logger=require(_0x4b18('0x3'))(_0x4b18('0x4'));var ipAgi=process['env'][_0x4b18('0x5')]||_0x4b18('0x6');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x4588af){return function(_0x1a58c1){logger['error'](_0x4588af,util[_0x4b18('0x7')](_0x1a58c1,{'showHidden':![],'depth':null}));};};exports[_0x4b18('0x8')]=function(_0x40b000,_0x1fb9ec){logger['info'](_0x40b000,util[_0x4b18('0x7')](_0x1fb9ec,{'showHidden':![],'depth':null}));};exports[_0x4b18('0x9')]=function(_0x4a4e16,_0x892ce2){logger[_0x4b18('0xa')](_0x4a4e16,util[_0x4b18('0x7')](_0x892ce2,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x2caf44){return function(_0x124392){logger[_0x4b18('0xb')](_0x2caf44,util[_0x4b18('0x7')](_0x124392,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x49aa0e,_0x208a59,_0x20f904){return{'message':_0x49aa0e,'unlock':_0x208a59,'active':_0x20f904};};exports[_0x4b18('0xc')]=function(_0x263c38,_0x17869e,_0xafaec8){if(!_[_0x4b18('0xd')](_0xafaec8)&&'string'===typeof _0xafaec8&&!_[_0x4b18('0xe')](_0xafaec8)){if(!_[_0x4b18('0xd')](_0x17869e)&&'string'===typeof _0x17869e&&!_['isEmpty'](_0x17869e)){return util[_0x4b18('0xf')](_0x4b18('0x10'),_0x17869e,_0xafaec8);}return util[_0x4b18('0xf')](_0x4b18('0x10'),_0xafaec8,_0xafaec8);}if(!_['isUndefined'](_0x263c38)&&_0x4b18('0x11')===typeof _0x263c38&&!_[_0x4b18('0xe')](_0x263c38)){return _0x263c38;}return'\x22\x22\x20<>';};exports[_0x4b18('0x12')]=function(_0x472546){if(_[_0x4b18('0x13')](_0x472546)){return![];}return _0x472546;};exports[_0x4b18('0x14')]=function(_0x384832,_0x3f1213,_0x32cab0,_0x9d3111,_0x5ed0c4,_0x5d9c74){var _0xdf74d6={'XMD-QUEUE':_0x3f1213[_0x4b18('0x15')]?_0x3f1213[_0x4b18('0x15')][_0x4b18('0x16')]:'','XMD-CALLERID':_0x9d3111,'XMD-CALLERID-PREVIEW':_0x5d9c74?util['format'](_0x4b18('0x10'),_0x5d9c74[_0x4b18('0x17')],_0x5d9c74[_0x4b18('0x18')]):_0x9d3111,'XMD-DIALID':_0x5ed0c4,'XMD-CONTACTID':_0x3f1213[_0x4b18('0x19')],'XMD-CDRTYPE':_0x4b18('0x1a'),'CALLERID(all)':_0x9d3111,'XMD-VOICEQUEUEID':_0x3f1213[_0x4b18('0x1b')],'XMD-DIALCHANNEL':_0x32cab0,'XMD-DIALTIMEOUT':_0x384832[_0x4b18('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x384832[_0x4b18('0x1d')]?'g':'',_['isEmpty'](_0x384832[_0x4b18('0x1e')])?'':_0x4b18('0x1f')),'XMD-DIALURL':_0x384832[_0x4b18('0x20')]||'','XMD-AGI':_0x384832[_0x4b18('0x21')]?util[_0x4b18('0xf')](_0x4b18('0x22'),ipAgi,_0x384832[_0x4b18('0x21')]):_0x4b18('0x23'),'XMD-AGIAFTER':_0x384832['dialQueueProject2']?util[_0x4b18('0xf')](_0x4b18('0x22'),ipAgi,_0x384832[_0x4b18('0x1d')]):_0x4b18('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x5d9c74?_0x5d9c74[_0x4b18('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d9c74?_0x5d9c74['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x4b18('0xe')](_0x384832[_0x4b18('0x1e')])){_0xdf74d6[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x384832['monitor_format'];_0xdf74d6[util[_0x4b18('0xf')]('%s',_0x4b18('0x25'))]=_0x5ed0c4;}return _0xdf74d6;};exports[_0x4b18('0x26')]=function(_0x4e4d8c){var _0x154b75={};for(var _0x179669 in _0x4e4d8c){if(_0x4e4d8c[_0x4b18('0x27')](_0x179669)){_0x154b75[util['format']('%s',_[_0x4b18('0x28')](_0x179669))]=_0x4e4d8c[_0x179669];}}return{'variables':_0x154b75};};exports[_0x4b18('0x29')]=function(_0x52cb9c,_0x3fe049){if(!_[_0x4b18('0x13')](_0x52cb9c)){if(_0x52cb9c[_0x4b18('0x27')](_0x4b18('0x2a'))){if(_0x52cb9c[_0x4b18('0x2a')]>0x0){_0x52cb9c['originated']-=0x1;}else{logger['error'](_0x4b18('0x2b'),_0x3fe049);}}}else{logger[_0x4b18('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3fe049);}};exports[_0x4b18('0x2c')]=function(_0x5ac312){var _0x52342a=moment()[_0x4b18('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ac312[_0x4b18('0x2d')]=0xd;_0x5ac312[_0x4b18('0x2e')]=_0x4b18('0x2f');_0x5ac312[_0x4b18('0x30')]=_0x52342a;_0x5ac312[_0x4b18('0x31')]=_0x52342a;_0x5ac312[_0x4b18('0x32')]=_0x52342a;};exports['logAgent']=function(_0x3e5737,_0x3d33a1,_0x2c7db4){var _0x1ad5fa=moment()[_0x4b18('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e5737[_0x4b18('0x2d')]=_0x3d33a1;_0x3e5737[_0x4b18('0x2e')]=_0x2c7db4;_0x3e5737['responsetime']=_0x1ad5fa;_0x3e5737[_0x4b18('0x33')]=utils['getSeconds'](_0x3e5737[_0x4b18('0x31')],_0x3e5737[_0x4b18('0x30')]);};exports['logLookAgent']=function(_0x5dfe38,_0x7ab911,_0x490765){_0x5dfe38[_0x4b18('0x34')]=_0x7ab911;_0x5dfe38[_0x4b18('0x35')]=_0x490765;};exports['logCustomer']=function(_0x217634,_0x2b5a98,_0x3a118a){var _0x1b5ec1=moment()[_0x4b18('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x217634['state']=_0x2b5a98;_0x217634[_0x4b18('0x2e')]=_0x3a118a;_0x217634[_0x4b18('0x31')]=_0x217634[_0x4b18('0x31')]?_0x217634[_0x4b18('0x31')]:_0x1b5ec1;_0x217634[_0x4b18('0x32')]=_0x217634[_0x4b18('0x32')]?_0x217634[_0x4b18('0x32')]:_0x1b5ec1;_0x217634['ringtime']=utils['getSeconds'](_0x217634[_0x4b18('0x31')]||0x0,_0x217634[_0x4b18('0x30')]||0x0);_0x217634[_0x4b18('0x36')]=_0x217634[_0x4b18('0x37')]?utils[_0x4b18('0x38')](_0x217634[_0x4b18('0x32')],_0x217634['answertime']):0x0;};exports['isFailure']=function(_0x3b7f03){return _0x3b7f03==='Failure';};exports['variablesAction']=function(_0x5dde6c,_0x57082c,_0x4053e8,_0x39034a,_0x197929){var _0x224c62=_0x39034a?_0x4b18('0x39'):_0x5dde6c[_0x4b18('0x17')];_0x224c62=_0x197929?_0x4b18('0x3a'):_0x224c62;return{'actionid':_0x5dde6c[_0x4b18('0x3b')],'action':_0x4b18('0x3c'),'channel':_0x5dde6c[_0x4b18('0x3d')],'callerid':util['format'](_0x4b18('0x10'),_0x224c62,_0x5dde6c[_0x4b18('0x18')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x4053e8,'timeout':(_0x57082c[_0x4b18('0x3e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5dde6c[_0x4b18('0x3b')]};};exports[_0x4b18('0x3f')]=function(_0x3462fe){return _0x3462fe[_0x4b18('0x40')]+_0x3462fe[_0x4b18('0x41')]+_0x3462fe[_0x4b18('0x42')]+_0x3462fe[_0x4b18('0x43')]+_0x3462fe[_0x4b18('0x44')];};exports['cloneAction']=function(_0x2dfc41){var _0x262491=_[_0x4b18('0x45')](_0x2dfc41);_0x262491[_0x4b18('0x2d')]=0xf;_0x262491[_0x4b18('0x2e')]=_0x4b18('0x46');return _0x262491;};exports[_0x4b18('0x47')]=function(_0x55da54,_0x3e0cff,_0x2a8c05){var _0x30a1fd={};_0x30a1fd[_0x3e0cff]=_0x55da54[_0x3e0cff];_0x30a1fd[_0x4b18('0x48')]=![];_0x30a1fd['scheduledat']=moment()[_0x4b18('0x49')](_0x2a8c05,_0x4b18('0x4a'))[_0x4b18('0xf')](_0x4b18('0x4b'));_0x30a1fd[_0x4b18('0x19')]=_0x55da54[_0x4b18('0x19')];_0x30a1fd[_0x4b18('0x4c')]=_0x55da54[_0x4b18('0x4c')];_0x30a1fd['VoiceQueueId']=_0x55da54[_0x4b18('0x1b')]||undefined;return _0x30a1fd;};exports[_0x4b18('0x4d')]=function(_0x2daf77,_0x2c19c5){if(!_[_0x4b18('0x13')](_0x2daf77)){if(_0x2daf77[_0x4b18('0x4e')]>0x0){_0x2daf77['pTalking']-=0x1;}else{logger[_0x4b18('0xa')](_0x2c19c5,_0x4b18('0x4f'));}}else{logger['error'](_0x2c19c5,_0x4b18('0x50'));}};exports['IsNotLoggedIn']=function(_0x52e126){if(_0x52e126<=0x0){return!![];}return![];};function buildObj(_0x3bc719,_0x2247d3,_0x181312){_0x3bc719[_0x4b18('0x51')]=_0x2247d3;_0x3bc719[_0x4b18('0x16')]=_0x3bc719[_0x4b18('0x52')];_0x3bc719[_0x4b18('0x53')]=_0x3bc719[_0x4b18('0x3d')];_0x3bc719['motionChannel']=_0x4b18('0x54');if(_0x181312){_0x3bc719['mandatoryDisposition']=_0x181312[_0x4b18('0x55')];}return _0x3bc719;}exports[_0x4b18('0x56')]=buildObj;exports[_0x4b18('0x57')]=function(_0x2b7789){var _0x42e37d=[];for(var _0x4b1b56 in _0x2b7789){if(_0x2b7789[_0x4b18('0x27')](_0x4b1b56)){if(!_[_0x4b18('0x13')](_0x2b7789[_0x4b1b56])&&_0x2b7789[_0x4b1b56][_0x4b18('0x2d')]==='not_inuse'&&_0x2b7789[_0x4b1b56][_0x4b18('0x58')]===_0x4b18('0x59')){_0x42e37d[_0x4b18('0x5a')](_0x2b7789[_0x4b1b56]['id']);}}}return _0x42e37d;};exports[_0x4b18('0x5b')]=function(_0x48cac3){var _0xab9738=moment()[_0x4b18('0x5c')](0x0);var _0x54a375=moment(_0x48cac3)[_0x4b18('0x5c')](0x0);return _0xab9738[_0x4b18('0x5d')](_0x54a375,_0x4b18('0x5e'));};exports[_0x4b18('0x5f')]=function(_0x5af843){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5af843[_0x4b18('0x19')],'ListId':_0x5af843[_0x4b18('0x4c')],'VoiceQueueId':_0x5af843['VoiceQueueId']||undefined,'CampaignId':_0x5af843[_0x4b18('0x60')]||undefined};};exports[_0x4b18('0x61')]=function(_0x533d2a){if(_0x533d2a===_0x4b18('0x3b')||_0x533d2a===_0x4b18('0x62')||_0x533d2a==='queue'||_0x533d2a===_0x4b18('0x63')||_0x533d2a===_0x4b18('0x64')||_0x533d2a===_0x4b18('0x65')||_0x533d2a===_0x4b18('0x34')||_0x533d2a==='channelAgent'||_0x533d2a===_0x4b18('0x17')||_0x533d2a==='active'||_0x533d2a===_0x4b18('0x18')||_0x533d2a===_0x4b18('0x66')||_0x533d2a===_0x4b18('0x40')||_0x533d2a===_0x4b18('0x41')||_0x533d2a===_0x4b18('0x42')||_0x533d2a==='countglobal'||_0x533d2a===_0x4b18('0x67')||_0x533d2a===_0x4b18('0x68')||_0x533d2a===_0x4b18('0x69')||_0x533d2a===_0x4b18('0x6a')||_0x533d2a===_0x4b18('0x19')||_0x533d2a===_0x4b18('0x4c')||_0x533d2a===_0x4b18('0x35')||_0x533d2a===_0x4b18('0x1b')||_0x533d2a===_0x4b18('0x6b')||_0x533d2a===_0x4b18('0x6c')||_0x533d2a===_0x4b18('0x6d')||_0x533d2a==='xmd-phone'||_0x533d2a===_0x4b18('0x6e')||_0x533d2a==='xmd-dialurl'||_0x533d2a===_0x4b18('0x6f')||_0x533d2a===_0x4b18('0x70')||_0x533d2a===_0x4b18('0x71')||_0x533d2a===_0x4b18('0x72')||_0x533d2a==='xmd-contactid'||_0x533d2a==='xmd-cdrtype'||_0x533d2a==='xmd-callerid'||_0x533d2a===_0x4b18('0x73')||_0x533d2a===_0x4b18('0x74')||_0x533d2a===_0x4b18('0x75')||_0x533d2a==='rtpaudioqosbridged'||_0x533d2a===_0x4b18('0x76')||_0x533d2a==='rtpaudioqosjitterbridged'||_0x533d2a===_0x4b18('0x77')||_0x533d2a===_0x4b18('0x78')||_0x533d2a===_0x4b18('0x79')||_0x533d2a==='rtpaudioqosrttbridged'||_0x533d2a===_0x4b18('0x75')||_0x533d2a==='rtpaudioqosbridged'||_0x533d2a==='rtpaudioqosjitter'||_0x533d2a===_0x4b18('0x7a')||_0x533d2a===_0x4b18('0x77')||_0x533d2a===_0x4b18('0x78')||_0x533d2a===_0x4b18('0x79')||_0x533d2a==='rtpaudioqosrttbridged'||_0x533d2a===_0x4b18('0x7b')||_0x533d2a===_0x4b18('0x7c')||_0x533d2a===_0x4b18('0x2d')||_0x533d2a===_0x4b18('0x2e')){return![];}return!![];};exports[_0x4b18('0x7d')]=function(_0x4e5d00,_0x24adb7){var _0xbafdce,_0x4df7c8,_0x4d415d;if(_0x24adb7<=0x0){_0x24adb7=0x1;}_0xbafdce=new RegExp('\x5cw{0,'+_0x24adb7+'}$');_0x4df7c8=Math[_0x4b18('0x7e')](0xa,_0x24adb7-0x1);_0x4d415d=Math[_0x4b18('0x7e')](0xa,_0x24adb7)-0x1;return util[_0x4b18('0xf')]('%s',_['replace'](_0x4e5d00,_0xbafdce,_[_0x4b18('0x7f')](_0x4df7c8,_0x4d415d)));};exports[_0x4b18('0x80')]=function(_0x134599){var _0x56ad35=_0x134599[_0x4b18('0x81')](/"(.*?)"/);return _0x56ad35?_0x56ad35[0x1]:_0x134599;};exports[_0x4b18('0x82')]=function(_0x145433){var _0x45713c=_0x145433['match'](/<(.*?)>/);return _0x45713c?_0x45713c[0x1]:_0x145433;};function buildNoAnswerEventPayload(_0x44ae4b,_0x251852){var _0x370df5=buildObj(_0x44ae4b,_0x4b18('0x83'));if(!_[_0x4b18('0xe')](_0x251852['variables'])){Object[_0x4b18('0x84')](_0x251852['variables'])['forEach'](function(_0x2d3996){_0x370df5[_0x2d3996[_0x4b18('0x85')]()]=_0x251852['variables'][_0x2d3996];});}return _0x370df5;}exports[_0x4b18('0x86')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x5f7a=['rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','match','noanswer','keys','forEach','toLowerCase','variables','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','statedesc','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','variablesAction','BOOKED','uniqueid','originate','timeout','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','campaigntype','dialAnswer','scheduledat','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss'];(function(_0x4bc396,_0x136623){var _0x25d3d8=function(_0x27c2a8){while(--_0x27c2a8){_0x4bc396['push'](_0x4bc396['shift']());}};_0x25d3d8(++_0x136623);}(_0x5f7a,0x120));var _0xa5f7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5f7a[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0xa5f7('0x0'));var _=require(_0xa5f7('0x1'));var moment=require(_0xa5f7('0x2'));var logger=require('../../../../config/logger')(_0xa5f7('0x3'));var ipAgi=process[_0xa5f7('0x4')][_0xa5f7('0x5')]||_0xa5f7('0x6');var utils=require(_0xa5f7('0x7'));exports['loggerCatch']=function(_0x3387e6){return function(_0x380987){logger[_0xa5f7('0x8')](_0x3387e6,util[_0xa5f7('0x9')](_0x380987,{'showHidden':![],'depth':null}));};};exports[_0xa5f7('0xa')]=function(_0x2027d6,_0x2ccd46){logger[_0xa5f7('0xb')](_0x2027d6,util[_0xa5f7('0x9')](_0x2ccd46,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1b5fab,_0x24cf5d){logger[_0xa5f7('0x8')](_0x1b5fab,util[_0xa5f7('0x9')](_0x24cf5d,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x507c3c){return function(_0x235aac){logger[_0xa5f7('0xb')](_0x507c3c,util[_0xa5f7('0x9')](_0x235aac,{'showHidden':![],'depth':null}));};};exports[_0xa5f7('0xc')]=function(_0x151220,_0x437c33,_0x1f1fca){return{'message':_0x151220,'unlock':_0x437c33,'active':_0x1f1fca};};exports[_0xa5f7('0xd')]=function(_0x15b621,_0x592cd8,_0x5a758e){if(!_[_0xa5f7('0xe')](_0x5a758e)&&_0xa5f7('0xf')===typeof _0x5a758e&&!_[_0xa5f7('0x10')](_0x5a758e)){if(!_['isUndefined'](_0x592cd8)&&_0xa5f7('0xf')===typeof _0x592cd8&&!_[_0xa5f7('0x10')](_0x592cd8)){return util['format']('\x22%s\x22\x20<%s>',_0x592cd8,_0x5a758e);}return util[_0xa5f7('0x11')](_0xa5f7('0x12'),_0x5a758e,_0x5a758e);}if(!_['isUndefined'](_0x15b621)&&_0xa5f7('0xf')===typeof _0x15b621&&!_['isEmpty'](_0x15b621)){return _0x15b621;}return _0xa5f7('0x13');};exports[_0xa5f7('0x14')]=function(_0x293943){if(_[_0xa5f7('0x15')](_0x293943)){return![];}return _0x293943;};exports[_0xa5f7('0x16')]=function(_0x22c095,_0x5c271f,_0x27f782,_0x2b9e85,_0x261f69,_0x44c768){var _0xcdfcd2={'XMD-QUEUE':_0x5c271f['Queue']?_0x5c271f[_0xa5f7('0x17')][_0xa5f7('0x18')]:'','XMD-CALLERID':_0x2b9e85,'XMD-CALLERID-PREVIEW':_0x44c768?util[_0xa5f7('0x11')](_0xa5f7('0x12'),_0x44c768[_0xa5f7('0x19')],_0x44c768[_0xa5f7('0x1a')]):_0x2b9e85,'XMD-DIALID':_0x261f69,'XMD-CONTACTID':_0x5c271f[_0xa5f7('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2b9e85,'XMD-VOICEQUEUEID':_0x5c271f[_0xa5f7('0x1c')],'XMD-DIALCHANNEL':_0x27f782,'XMD-DIALTIMEOUT':_0x22c095['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xa5f7('0x11')](_0xa5f7('0x1d'),_0x22c095[_0xa5f7('0x1e')]?'g':'',_[_0xa5f7('0x10')](_0x22c095[_0xa5f7('0x1f')])?'':_0xa5f7('0x20')),'XMD-DIALURL':_0x22c095['dialPreviewUrl']||'','XMD-AGI':_0x22c095['dialQueueProject']?util[_0xa5f7('0x11')](_0xa5f7('0x21'),ipAgi,_0x22c095[_0xa5f7('0x22')]):_0xa5f7('0x23'),'XMD-AGIAFTER':_0x22c095[_0xa5f7('0x1e')]?util['format'](_0xa5f7('0x21'),ipAgi,_0x22c095['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x44c768?_0x44c768['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x44c768?_0x44c768['originatecalleridname']:'','XMD-DESTINATION':_0xa5f7('0x24'),'SIPADDHEADER':_0xa5f7('0x25')};if(!_[_0xa5f7('0x10')](_0x22c095['monitor_format'])){_0xcdfcd2[util['format']('%s',_0xa5f7('0x26'))]=_0x22c095['monitor_format'];_0xcdfcd2[util[_0xa5f7('0x11')]('%s',_0xa5f7('0x27'))]=_0x261f69;}return _0xcdfcd2;};exports[_0xa5f7('0x28')]=function(_0x50930b){var _0x57e6dc={};for(var _0x2904e3 in _0x50930b){if(_0x50930b[_0xa5f7('0x29')](_0x2904e3)){_0x57e6dc[util[_0xa5f7('0x11')]('%s',_[_0xa5f7('0x2a')](_0x2904e3))]=_0x50930b[_0x2904e3];}}return{'variables':_0x57e6dc};};exports[_0xa5f7('0x2b')]=function(_0x7bf05d,_0x52a0f0){if(!_['isNil'](_0x7bf05d)){if(_0x7bf05d[_0xa5f7('0x29')](_0xa5f7('0x2c'))){if(_0x7bf05d['originated']>0x0){_0x7bf05d['originated']-=0x1;}else{logger[_0xa5f7('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x52a0f0);}}}else{logger[_0xa5f7('0x8')](_0xa5f7('0x2d'),_0x52a0f0);}};exports['logBlacklist']=function(_0x28d4ac){var _0x299e65=moment()[_0xa5f7('0x11')](_0xa5f7('0x2e'));_0x28d4ac[_0xa5f7('0x2f')]=0xd;_0x28d4ac['statedesc']=_0xa5f7('0x30');_0x28d4ac[_0xa5f7('0x31')]=_0x299e65;_0x28d4ac[_0xa5f7('0x32')]=_0x299e65;_0x28d4ac['endtime']=_0x299e65;};exports[_0xa5f7('0x33')]=function(_0x42a698,_0x44b434,_0x4e1168){var _0x52e971=moment()['format'](_0xa5f7('0x2e'));_0x42a698[_0xa5f7('0x2f')]=_0x44b434;_0x42a698[_0xa5f7('0x34')]=_0x4e1168;_0x42a698[_0xa5f7('0x32')]=_0x52e971;_0x42a698[_0xa5f7('0x35')]=utils[_0xa5f7('0x36')](_0x42a698[_0xa5f7('0x32')],_0x42a698[_0xa5f7('0x31')]);};exports[_0xa5f7('0x37')]=function(_0x61b2a3,_0xfacc04,_0x2c47a2){_0x61b2a3[_0xa5f7('0x38')]=_0xfacc04;_0x61b2a3[_0xa5f7('0x39')]=_0x2c47a2;};exports[_0xa5f7('0x3a')]=function(_0x3a516d,_0x419621,_0x52f5e5){var _0x833e6d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3a516d[_0xa5f7('0x2f')]=_0x419621;_0x3a516d[_0xa5f7('0x34')]=_0x52f5e5;_0x3a516d['responsetime']=_0x3a516d['responsetime']?_0x3a516d[_0xa5f7('0x32')]:_0x833e6d;_0x3a516d[_0xa5f7('0x3b')]=_0x3a516d[_0xa5f7('0x3b')]?_0x3a516d[_0xa5f7('0x3b')]:_0x833e6d;_0x3a516d['ringtime']=utils['getSeconds'](_0x3a516d['responsetime']||0x0,_0x3a516d[_0xa5f7('0x31')]||0x0);_0x3a516d[_0xa5f7('0x3c')]=_0x3a516d[_0xa5f7('0x3d')]?utils[_0xa5f7('0x36')](_0x3a516d[_0xa5f7('0x3b')],_0x3a516d[_0xa5f7('0x3d')]):0x0;};exports[_0xa5f7('0x3e')]=function(_0x3f37fc){return _0x3f37fc==='Failure';};exports[_0xa5f7('0x3f')]=function(_0xde7c4e,_0x5301e4,_0x2777f2,_0x383341,_0xf97e56){var _0x5bd535=_0x383341?'RECALL':_0xde7c4e['calleridname'];_0x5bd535=_0xf97e56?_0xa5f7('0x40'):_0x5bd535;return{'actionid':_0xde7c4e[_0xa5f7('0x41')],'action':_0xa5f7('0x42'),'channel':_0xde7c4e['channelAgent'],'callerid':util['format'](_0xa5f7('0x12'),_0x5bd535,_0xde7c4e[_0xa5f7('0x1a')]),'Exten':_0xa5f7('0x24'),'Context':'from-sip','Priority':'1','variable':_0x2777f2,'timeout':(_0x5301e4[_0xa5f7('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0xde7c4e[_0xa5f7('0x41')]};};exports['totalGlobal']=function(_0x4c0618){return _0x4c0618['countbusyretry']+_0x4c0618['countcongestionretry']+_0x4c0618[_0xa5f7('0x44')]+_0x4c0618[_0xa5f7('0x45')]+_0x4c0618[_0xa5f7('0x46')];};exports[_0xa5f7('0x47')]=function(_0x5f1e14){var _0x3edfbd=_['clone'](_0x5f1e14);_0x3edfbd[_0xa5f7('0x2f')]=0xf;_0x3edfbd[_0xa5f7('0x34')]=_0xa5f7('0x48');return _0x3edfbd;};exports[_0xa5f7('0x49')]=function(_0x3070dc,_0x4bccc0,_0x337364){var _0x5ef181={};_0x5ef181[_0x4bccc0]=_0x3070dc[_0x4bccc0];_0x5ef181[_0xa5f7('0x4a')]=![];_0x5ef181['scheduledat']=moment()['add'](_0x337364,_0xa5f7('0x4b'))['format'](_0xa5f7('0x2e'));_0x5ef181['ContactId']=_0x3070dc['ContactId'];_0x5ef181[_0xa5f7('0x4c')]=_0x3070dc[_0xa5f7('0x4c')];_0x5ef181[_0xa5f7('0x1c')]=_0x3070dc[_0xa5f7('0x1c')]||undefined;return _0x5ef181;};exports[_0xa5f7('0x4d')]=function(_0x1e1fa2,_0x4413e8){if(!_[_0xa5f7('0x15')](_0x1e1fa2)){if(_0x1e1fa2[_0xa5f7('0x4e')]>0x0){_0x1e1fa2['pTalking']-=0x1;}else{logger[_0xa5f7('0x8')](_0x4413e8,_0xa5f7('0x4f'));}}else{logger[_0xa5f7('0x8')](_0x4413e8,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x469498){if(_0x469498<=0x0){return!![];}return![];};function buildObj(_0x143536,_0x55c42e,_0x43dbf0){_0x143536[_0xa5f7('0x50')]=_0x55c42e;_0x143536[_0xa5f7('0x18')]=_0x143536[_0xa5f7('0x51')];_0x143536['interface']=_0x143536[_0xa5f7('0x52')];_0x143536[_0xa5f7('0x53')]=_0xa5f7('0x54');if(_0x43dbf0){_0x143536[_0xa5f7('0x55')]=_0x43dbf0[_0xa5f7('0x55')];}return _0x143536;}exports[_0xa5f7('0x56')]=buildObj;exports[_0xa5f7('0x57')]=function(_0x221d66){var _0x2d492f=[];for(var _0x82aef1 in _0x221d66){if(_0x221d66[_0xa5f7('0x29')](_0x82aef1)){if(!_[_0xa5f7('0x15')](_0x221d66[_0x82aef1])&&_0x221d66[_0x82aef1][_0xa5f7('0x2f')]===_0xa5f7('0x58')&&_0x221d66[_0x82aef1]['status']==='reachable'){_0x2d492f[_0xa5f7('0x59')](_0x221d66[_0x82aef1]['id']);}}}return _0x2d492f;};exports[_0xa5f7('0x5a')]=function(_0x39f28b){var _0xc1d0dc=moment()[_0xa5f7('0x5b')](0x0);var _0x4cc0a2=moment(_0x39f28b)[_0xa5f7('0x5b')](0x0);return _0xc1d0dc[_0xa5f7('0x5c')](_0x4cc0a2,_0xa5f7('0x5d'));};exports[_0xa5f7('0x5e')]=function(_0x15246b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x15246b['ContactId'],'ListId':_0x15246b[_0xa5f7('0x4c')],'VoiceQueueId':_0x15246b['VoiceQueueId']||undefined,'CampaignId':_0x15246b[_0xa5f7('0x5f')]||undefined};};exports['filterKey']=function(_0x245891){if(_0x245891==='uniqueid'||_0x245891==='idContact'||_0x245891==='queue'||_0x245891==='type'||_0x245891===_0xa5f7('0x60')||_0x245891===_0xa5f7('0x61')||_0x245891==='membername'||_0x245891===_0xa5f7('0x52')||_0x245891===_0xa5f7('0x19')||_0x245891==='active'||_0x245891==='calleridnum'||_0x245891===_0xa5f7('0x62')||_0x245891==='countbusyretry'||_0x245891===_0xa5f7('0x63')||_0x245891===_0xa5f7('0x44')||_0x245891==='countglobal'||_0x245891===_0xa5f7('0x64')||_0x245891===_0xa5f7('0x65')||_0x245891===_0xa5f7('0x66')||_0x245891===_0xa5f7('0x67')||_0x245891==='ContactId'||_0x245891==='ListId'||_0x245891===_0xa5f7('0x39')||_0x245891===_0xa5f7('0x1c')||_0x245891==='sipcallid'||_0x245891===_0xa5f7('0x68')||_0x245891===_0xa5f7('0x69')||_0x245891==='xmd-phone'||_0x245891===_0xa5f7('0x6a')||_0x245891==='xmd-dialurl'||_0x245891===_0xa5f7('0x6b')||_0x245891==='xmd-dialoptions'||_0x245891===_0xa5f7('0x6c')||_0x245891===_0xa5f7('0x6d')||_0x245891===_0xa5f7('0x6e')||_0x245891==='xmd-cdrtype'||_0x245891===_0xa5f7('0x6f')||_0x245891===_0xa5f7('0x70')||_0x245891===_0xa5f7('0x71')||_0x245891===_0xa5f7('0x72')||_0x245891==='rtpaudioqosbridged'||_0x245891===_0xa5f7('0x73')||_0x245891==='rtpaudioqosjitterbridged'||_0x245891===_0xa5f7('0x74')||_0x245891===_0xa5f7('0x75')||_0x245891===_0xa5f7('0x76')||_0x245891==='rtpaudioqosrttbridged'||_0x245891===_0xa5f7('0x72')||_0x245891===_0xa5f7('0x77')||_0x245891===_0xa5f7('0x73')||_0x245891==='rtpaudioqosjitterbridged'||_0x245891===_0xa5f7('0x74')||_0x245891===_0xa5f7('0x75')||_0x245891===_0xa5f7('0x76')||_0x245891===_0xa5f7('0x78')||_0x245891===_0xa5f7('0x79')||_0x245891===_0xa5f7('0x7a')||_0x245891===_0xa5f7('0x2f')||_0x245891===_0xa5f7('0x34')){return![];}return!![];};exports[_0xa5f7('0x7b')]=function(_0x1a484d,_0x38d9c3){var _0x399c80,_0x354a0a,_0xac0690;if(_0x38d9c3<=0x0){_0x38d9c3=0x1;}_0x399c80=new RegExp(_0xa5f7('0x7c')+_0x38d9c3+'}$');_0x354a0a=Math[_0xa5f7('0x7d')](0xa,_0x38d9c3-0x1);_0xac0690=Math['pow'](0xa,_0x38d9c3)-0x1;return util[_0xa5f7('0x11')]('%s',_[_0xa5f7('0x7e')](_0x1a484d,_0x399c80,_['random'](_0x354a0a,_0xac0690)));};exports[_0xa5f7('0x7f')]=function(_0x4f9db4){var _0x32bcd5=_0x4f9db4['match'](/"(.*?)"/);return _0x32bcd5?_0x32bcd5[0x1]:_0x4f9db4;};exports[_0xa5f7('0x80')]=function(_0x5e8c51){var _0x25468b=_0x5e8c51[_0xa5f7('0x81')](/<(.*?)>/);return _0x25468b?_0x25468b[0x1]:_0x5e8c51;};function buildNoAnswerEventPayload(_0x2a7b68,_0x28962a){var _0x4db2a2=buildObj(_0x2a7b68,_0xa5f7('0x82'));if(!_['isEmpty'](_0x28962a['variables'])){Object[_0xa5f7('0x83')](_0x28962a['variables'])[_0xa5f7('0x84')](function(_0x63816){_0x4db2a2[_0x63816[_0xa5f7('0x85')]()]=_0x28962a[_0xa5f7('0x86')][_0x63816];});}return _0x4db2a2;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x63a9=['queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x49990b,_0x13c15f){var _0x6f9811=function(_0x899911){while(--_0x899911){_0x49990b['push'](_0x49990b['shift']());}};_0x6f9811(++_0x13c15f);}(_0x63a9,0x125));var _0x963a=function(_0x371122,_0x590e56){_0x371122=_0x371122-0x0;var _0x421cf6=_0x63a9[_0x371122];return _0x421cf6;};'use strict';exports['queueadd']={'queue':{'type':_0x963a('0x0'),'required':!![]},'interface':{'type':_0x963a('0x0'),'required':!![]},'membername':{'type':_0x963a('0x0'),'required':!![]},'penalty':{'type':_0x963a('0x1'),'required':![]},'paused':{'type':_0x963a('0x2'),'required':![]}};exports[_0x963a('0x3')]={'queue':{'type':_0x963a('0x0'),'required':!![]},'interface':{'type':_0x963a('0x0'),'required':!![]}};exports[_0x963a('0x4')]={'interface':{'type':_0x963a('0x0'),'required':!![]},'paused':{'type':_0x963a('0x2')},'reason':{'type':_0x963a('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x963a('0x5')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]}};exports[_0x963a('0x6')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]},'filename':{'type':_0x963a('0x0')},'format':{'type':_0x963a('0x0')},'mixmonitorid':{'type':_0x963a('0x0')}};exports[_0x963a('0x7')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]}};exports[_0x963a('0x8')]={'uniqueid':{'type':_0x963a('0x0'),'required':!![]},'exten':{'type':_0x963a('0x0'),'required':!![]},'context':{'type':_0x963a('0x0')}};
\ No newline at end of file
+var _0x7760=['voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x281a92,_0x4725ed){var _0x3fcf34=function(_0x43d403){while(--_0x43d403){_0x281a92['push'](_0x281a92['shift']());}};_0x3fcf34(++_0x4725ed);}(_0x7760,0x174));var _0x0776=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x7760[_0x31eb67];return _0x2a8cb8;};'use strict';exports[_0x0776('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0776('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x0776('0x2'),'required':![]},'paused':{'type':_0x0776('0x3'),'required':![]}};exports[_0x0776('0x4')]={'queue':{'type':_0x0776('0x1'),'required':!![]},'interface':{'type':_0x0776('0x1'),'required':!![]}};exports[_0x0776('0x5')]={'interface':{'type':_0x0776('0x1'),'required':!![]},'paused':{'type':_0x0776('0x3')},'reason':{'type':_0x0776('0x1'),'required':![]}};exports[_0x0776('0x6')]={'module':{'type':_0x0776('0x1'),'required':![]}};exports[_0x0776('0x7')]={'uniqueid':{'type':_0x0776('0x1'),'required':!![]}};exports[_0x0776('0x8')]={'uniqueid':{'type':_0x0776('0x1'),'required':!![]},'filename':{'type':_0x0776('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x0776('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x0776('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x0776('0x1'),'required':!![]},'context':{'type':_0x0776('0x1')}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x139303,_0x295f61){var _0x57af43=function(_0x39b309){while(--_0x39b309){_0x139303['push'](_0x139303['shift']());}};_0x57af43(++_0x295f61);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d719c,_0x59b346){_0x2d719c=_0x2d719c-0x0;var _0x16c7e8=_0xb10b[_0x2d719c];return _0x16c7e8;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x3359c9,_0x2fd793){var _0x3848bc=function(_0x212d67){while(--_0x212d67){_0x3359c9['push'](_0x3359c9['shift']());}};_0x3848bc(++_0x2fd793);}(_0xb10b,0x12a));var _0xbb10=function(_0x16a7d8,_0x326d5c){_0x16a7d8=_0x16a7d8-0x0;var _0xa4b589=_0xb10b[_0x16a7d8];return _0xa4b589;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd79=['assign'];(function(_0x2533f4,_0x59837b){var _0x2f8f97=function(_0x5b76ec){while(--_0x5b76ec){_0x2533f4['push'](_0x2533f4['shift']());}};_0x2f8f97(++_0x59837b);}(_0xbd79,0xd3));var _0x9bd7=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0xbd79[_0xc889e1];return _0x17ab9e;};'use strict';function mergeDBDataToRealtime(_0x4df1f2,_0xd2b113){var _0xd8c9f9=Object[_0x9bd7('0x0')]({},_0x4df1f2);for(var _0x1e1d71 in _0xd2b113){if(_0xd8c9f9['hasOwnProperty'](_0x1e1d71)){_0xd8c9f9[_0x1e1d71]=_0xd2b113[_0x1e1d71];}}return _0xd8c9f9;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime;
\ No newline at end of file
+var _0xa420=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x37edcb,_0x3b46dc){var _0x8cbe20=function(_0x1cb3d3){while(--_0x1cb3d3){_0x37edcb['push'](_0x37edcb['shift']());}};_0x8cbe20(++_0x3b46dc);}(_0xa420,0xa5));var _0x0a42=function(_0x42556b,_0x2a23f8){_0x42556b=_0x42556b-0x0;var _0x4ec16f=_0xa420[_0x42556b];return _0x4ec16f;};'use strict';function mergeDBDataToRealtime(_0x1f2e7e,_0x488c9f){var _0x8e20cb=Object[_0x0a42('0x0')]({},_0x1f2e7e);for(var _0x1601fd in _0x488c9f){if(_0x8e20cb[_0x0a42('0x1')](_0x1601fd)){_0x8e20cb[_0x1601fd]=_0x488c9f[_0x1601fd];}}return _0x8e20cb;}exports[_0x0a42('0x2')]=mergeDBDataToRealtime;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dff=['UserId','membername','monitor','monitors','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','telephones','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','destinationchannel','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3dff,0x130));var _0xf3df=function(_0x26094d,_0x2c9402){_0x26094d=_0x26094d-0x0;var _0x177d02=_0x3dff[_0x26094d];return _0x177d02;};'use strict';var _=require(_0xf3df('0x0'));var moment=require(_0xf3df('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0xf3df('0x2'));var RpcVoiceAgentReport=require(_0xf3df('0x3'));var RpcVoiceCallReport=require(_0xf3df('0x4'));var RpcVoiceDialReport=require(_0xf3df('0x5'));var RpcMemberReport=require(_0xf3df('0x6'));var RpcVoiceQueueReport=require(_0xf3df('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xf3df('0x8'));var VoiceQueueReport=require(_0xf3df('0x9'));var VoiceCallReport=require(_0xf3df('0xa'));var VoiceAgentReport=require(_0xf3df('0xb'));var VoiceDialReport=require(_0xf3df('0xc'));var UserReport=require(_0xf3df('0xd'));function Report(_0x4e077c){this[_0xf3df('0xe')]=_0x4e077c;this[_0xf3df('0xf')]=_0x4e077c['agents'];this['telephones']=_0x4e077c['telephones'];}Report[_0xf3df('0x10')][_0xf3df('0x11')]=function(_0x499f7c){var _0xba890d=new VoiceQueueReport(this[_0xf3df('0xe')]);var _0x5d73d4=new VoiceAgentReport(this[_0xf3df('0xe')]);var _0x4a1c13=new VoiceDialReport(this[_0xf3df('0xe')]);var _0x2a05b6=new VoiceCallReport(this['realtime']);var _0x4d1b5a=new UserReport(this['realtime']);if(config[_0xf3df('0x12')]&&config[_0xf3df('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xf3df('0x13')]['bind'](this));ami['on'](_0xf3df('0x14'),this[_0xf3df('0x15')][_0xf3df('0x16')](this));ami['on'](_0xf3df('0x17'),this[_0xf3df('0x18')][_0xf3df('0x16')](this));ami['on']('custom:voiceDialReport',this[_0xf3df('0x19')][_0xf3df('0x16')](this));ami['on']('blindtransfer',this[_0xf3df('0x1a')][_0xf3df('0x16')](this));ami['on'](_0xf3df('0x1b'),this[_0xf3df('0x1c')]['bind'](this));}};Report[_0xf3df('0x10')][_0xf3df('0x1d')]=function(_0x5f3757){var _0x1f6886;_0x1f6886=_[_0xf3df('0x1e')](this[_0xf3df('0xf')],function(_0x1ba25b){return _0x1ba25b['accountcode']==_0x5f3757||_0x1ba25b['name']==_0x5f3757;});if(_[_0xf3df('0x1f')](_0x1f6886)){var _0x3fa4cb=_[_0xf3df('0x1e')](this[_0xf3df('0x20')],function(_0x2e6fa1){return _0x2e6fa1[_0xf3df('0x21')]==_0x5f3757||_0x2e6fa1[_0xf3df('0x22')]==_0x5f3757;});if(_0x3fa4cb){_0x1f6886=_[_0xf3df('0x1e')](this[_0xf3df('0xf')],function(_0x7ffa55){return _0x7ffa55[_0xf3df('0x23')]==util[_0xf3df('0x24')](_0xf3df('0x25'),_0x3fa4cb['name']);});}}return _0x1f6886;};Report[_0xf3df('0x10')][_0xf3df('0x13')]=function(_0x3e84ea){for(var _0x3b9143=0x0;_0x3b9143<_0x3e84ea[_0xf3df('0x26')];_0x3b9143+=0x1){var _0x52232c=this[_0xf3df('0x1d')](_0x3e84ea[_0x3b9143][_0xf3df('0x27')]);if(_0x52232c){_0x3e84ea[_0x3b9143][_0xf3df('0x21')]=_0x52232c[_0xf3df('0x21')];_0x3e84ea[_0x3b9143][_0xf3df('0x28')]=!![];_0x3e84ea[_0x3b9143][_0xf3df('0x29')]=_0x52232c[_0xf3df('0x22')];_0x3e84ea[_0x3b9143][_0xf3df('0x23')]=_[_0xf3df('0x1f')](_0x52232c[_0xf3df('0x23')])?util[_0xf3df('0x24')]('SIP/%s',_0x52232c[_0xf3df('0x22')]):_0x52232c[_0xf3df('0x23')];if(_0x3e84ea[_0x3b9143][_0xf3df('0x2a')]){_0x3e84ea[_0x3b9143][_0xf3df('0x2b')]=moment()[_0xf3df('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e84ea[_0x3b9143][_0xf3df('0x2c')]){_0x3e84ea[_0x3b9143][_0xf3df('0x2d')]=moment()[_0xf3df('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xf3df('0x13')](_0x3e84ea[_0x3b9143]);}RpcVoiceQueueReport[_0xf3df('0x2e')](_0x3e84ea[_0x3b9143]);}};function extractCalleridNumber(_0x32736e){var _0x1d10b9=_0x32736e[_0xf3df('0x2f')](/<(.*?)>/);return _0x1d10b9?_0x1d10b9[0x1]:_0x32736e;}Report[_0xf3df('0x10')][_0xf3df('0x30')]=function(_0x156088){for(var _0x56a4ca=0x0;_0x56a4ca<Object[_0xf3df('0x31')](this[_0xf3df('0xf')])[_0xf3df('0x26')];_0x56a4ca++){var _0x3f2432=Object[_0xf3df('0x31')](this['agents'])[_0x56a4ca];var _0x111e1b=this[_0xf3df('0xf')][_0x3f2432];if(_0x111e1b[_0xf3df('0x21')]===Number(_0x156088))return _0x111e1b;}return null;};Report[_0xf3df('0x10')][_0xf3df('0x32')]=function(_0x168ac8){var _0x1db228=_0x168ac8['channel'][_0xf3df('0x33')]('-')[0x0];var _0x882e7d=this[_0xf3df('0xf')][_0x1db228];if(!_0x882e7d)_0x882e7d=this['getAgentByInternal'](_0x168ac8[_0xf3df('0x34')]);return!_0x882e7d?_0xf3df('0x35'):_0xf3df('0x36');};Report[_0xf3df('0x10')][_0xf3df('0x15')]=function(_0x44d95f){_0x44d95f[_0xf3df('0x37')]=_0x44d95f[_0xf3df('0x37')]||_0x44d95f['exten'];if(_0x44d95f[_0xf3df('0x38')]==_0xf3df('0x39')){_0x44d95f[_0xf3df('0x3a')]='queue';_0x44d95f[_0xf3df('0x3b')]=_0x44d95f['queue'];if(_0x44d95f[_0xf3df('0x3c')]==_0xf3df('0x3d')){_0x44d95f[_0xf3df('0x21')]='';_0x44d95f[_0xf3df('0x37')]=extractCalleridNumber(_0x44d95f['callerid']);}else if(_0x44d95f[_0xf3df('0x3c')]==_0xf3df('0x3e')){if(_0x44d95f[_0xf3df('0x37')]==_0xf3df('0x3f')){_0x44d95f[_0xf3df('0x37')]=extractCalleridNumber(_0x44d95f[_0xf3df('0x40')]);_0x44d95f[_0xf3df('0x34')]=_0x44d95f[_0xf3df('0x41')];_0x44d95f['destinationchannel']=[_0x44d95f[_0xf3df('0x42')],_0x44d95f[_0xf3df('0x42')]=_0x44d95f[_0xf3df('0x43')]][0x0];_0x44d95f['callerid']=_0x44d95f[_0xf3df('0x40')];}else{_0x44d95f[_0xf3df('0x37')]=_0x44d95f[_0xf3df('0x34')];_0x44d95f[_0xf3df('0x34')]=_0x44d95f[_0xf3df('0x41')];if(_0x44d95f['disposition']==_0xf3df('0x44')){_0x44d95f[_0xf3df('0x21')]=_0x44d95f[_0xf3df('0x27')];}else{_0x44d95f[_0xf3df('0x21')]='';}}}}else{_0x44d95f[_0xf3df('0x45')]=util[_0xf3df('0x24')](_0xf3df('0x46'),_0x44d95f[_0xf3df('0x47')],_0x44d95f[_0xf3df('0x34')]);}if(RpcVoiceTransferReport[_0xf3df('0x48')][_0x44d95f[_0xf3df('0x49')]]){var _0x54980a=RpcVoiceTransferReport[_0xf3df('0x48')][_0x44d95f['linkedid']];_0x54980a[_0xf3df('0x4a')]=_0x44d95f[_0xf3df('0x4b')];RpcVoiceTransferReport['blindTransfer'](_0x54980a);delete RpcVoiceTransferReport['transfers'][_0x44d95f['linkedid']];}if(_[_0xf3df('0x1f')](_0x44d95f[_0xf3df('0x38')])){_0x44d95f[_0xf3df('0x38')]=this['getCallType'](_0x44d95f);}if(_[_0xf3df('0x1f')](_0x44d95f[_0xf3df('0x4c')])){var _0x285f73=_0x44d95f[_0xf3df('0x42')]['split']('-')[0x0];var _0x3a3cc0=this[_0xf3df('0xf')][_0x285f73];if(!_0x3a3cc0)_0x3a3cc0=this['getAgentByInternal'](_0x44d95f['accountcode']);if(_0x3a3cc0){_0x44d95f['UserId']=_0x3a3cc0['id'];_0x44d95f[_0xf3df('0x4d')]=_0x3a3cc0['name'];}}RpcVoiceCallReport[_0xf3df('0x2e')](_0x44d95f);if(_0x44d95f[_0xf3df('0x4e')]){for(var _0x2d1895=0x0;_0x2d1895<_0x44d95f[_0xf3df('0x4f')][_0xf3df('0x26')];_0x2d1895+=0x1){_0x44d95f['monitorFilename']=_0x44d95f[_0xf3df('0x4f')][_0x2d1895][_0xf3df('0x50')];_0x44d95f[_0xf3df('0x51')]=_0x44d95f[_0xf3df('0x4f')][_0x2d1895][_0xf3df('0x51')];if(_0x44d95f[_0xf3df('0x52')]==_0xf3df('0x3f')){_0x44d95f['calleridnum']=_0x44d95f[_0xf3df('0x27')];_0x44d95f[_0xf3df('0x47')]=_0x44d95f[_0xf3df('0x53')];_0x44d95f[_0xf3df('0x27')]=_0x44d95f[_0xf3df('0x21')];_0x44d95f['connectedlinename']=_0x44d95f[_0xf3df('0x4d')];_0x44d95f[_0xf3df('0x52')]=_0x44d95f[_0xf3df('0x41')];}else if(_0x44d95f[_0xf3df('0x52')]==_0xf3df('0x54')){_0x44d95f[_0xf3df('0x34')]=_0x44d95f[_0xf3df('0x37')];_0x44d95f[_0xf3df('0x52')]=_0x44d95f[_0xf3df('0x41')];}RpcVoiceRecording[_0xf3df('0x2e')](_0x44d95f);}}};Report['prototype']['voiceAgentReport']=function(_0x14aa46){if(_[_0xf3df('0x55')](_0x14aa46)){_0x14aa46[_0xf3df('0x56')](function(_0x5a917c){RpcVoiceAgentReport[_0xf3df('0x2e')](_0x5a917c);});}else{RpcVoiceAgentReport['create'](_0x14aa46);}};Report[_0xf3df('0x10')]['voiceDialReport']=function(_0x2fa462){RpcVoiceDialReport['create'](_0x2fa462);var _0x5b87c1;var _0x4e7047;var _0x1cbcfc=_0x2fa462[_0xf3df('0x42')];if(_[_0xf3df('0x57')](_0x1cbcfc,_0xf3df('0x58'))){_0x4e7047=_0x1cbcfc[_0xf3df('0x59')](_0x1cbcfc[_0xf3df('0x5a')]('/')+0x1,_0x1cbcfc[_0xf3df('0x5a')]('@'));_0x5b87c1=_[_0xf3df('0x1e')](this[_0xf3df('0xf')],function(_0x4fb3d7){return _0x4fb3d7['mobile']==_0x4e7047||_0x4fb3d7[_0xf3df('0x5b')]==_0x4e7047||_0x4fb3d7[_0xf3df('0x21')]==_0x4e7047;});}else{_0x4e7047=_0x1cbcfc[_0xf3df('0x59')](_0x1cbcfc[_0xf3df('0x5a')]('/')+0x1,_0x1cbcfc[_0xf3df('0x5c')]('-'));_0x5b87c1=this['findAgent'](_0x4e7047);}if(_0x5b87c1){_0x2fa462[_0xf3df('0x23')]=_[_0xf3df('0x1f')](_0x5b87c1[_0xf3df('0x23')])?util['format'](_0xf3df('0x25'),_0x5b87c1['name']):_0x5b87c1[_0xf3df('0x23')];_0x2fa462[_0xf3df('0x4d')]=_0x5b87c1['name'];_0x2fa462[_0xf3df('0x21')]=_0x5b87c1['accountcode'];RpcMemberReport[_0xf3df('0x19')](_0x2fa462);}};Report[_0xf3df('0x10')]['blindTransfer']=function(_0x42c63d){RpcVoiceTransferReport[_0xf3df('0x48')][_0x42c63d[_0xf3df('0x5d')]]=_0x42c63d;};Report[_0xf3df('0x10')]['attendedTransfer']=function(_0x5a6392){RpcVoiceTransferReport[_0xf3df('0x1c')](_0x5a6392);};module[_0xf3df('0x5e')]=Report;
\ No newline at end of file
+var _0x4e6c=['../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','format','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','length','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','transfers','transfereelinkedid','uniqueid','linkedid','UserId','membername','monitor','monitorFilename','filename','monitors','createdAt','calleridname','xcally-motion-dialer','isArray','substring','indexOf','mobile','phone','transfererlinkedid','attendedTransfer','exports','moment','util','../../../config/environment','../ami'];(function(_0x3a04c6,_0x12a482){var _0xf4131a=function(_0x413ea2){while(--_0x413ea2){_0x3a04c6['push'](_0x3a04c6['shift']());}};_0xf4131a(++_0x12a482);}(_0x4e6c,0xb8));var _0xc4e6=function(_0x408b2e,_0x50eee8){_0x408b2e=_0x408b2e-0x0;var _0x452d4e=_0x4e6c[_0x408b2e];return _0x452d4e;};'use strict';var _=require('lodash');var moment=require(_0xc4e6('0x0'));var util=require(_0xc4e6('0x1'));var config=require(_0xc4e6('0x2'));var ami=require(_0xc4e6('0x3'));var RpcVoiceAgentReport=require(_0xc4e6('0x4'));var RpcVoiceCallReport=require(_0xc4e6('0x5'));var RpcVoiceDialReport=require(_0xc4e6('0x6'));var RpcMemberReport=require(_0xc4e6('0x7'));var RpcVoiceQueueReport=require(_0xc4e6('0x8'));var RpcVoiceRecording=require(_0xc4e6('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xc4e6('0xa'));var VoiceCallReport=require(_0xc4e6('0xb'));var VoiceAgentReport=require(_0xc4e6('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x1be3a6){this[_0xc4e6('0xd')]=_0x1be3a6;this[_0xc4e6('0xe')]=_0x1be3a6['agents'];this[_0xc4e6('0xf')]=_0x1be3a6['telephones'];}Report[_0xc4e6('0x10')]['sync']=function(_0x3eab46){var _0x253e01=new VoiceQueueReport(this['realtime']);var _0x726258=new VoiceAgentReport(this[_0xc4e6('0xd')]);var _0x174c51=new VoiceDialReport(this[_0xc4e6('0xd')]);var _0x4fc4fb=new VoiceCallReport(this[_0xc4e6('0xd')]);var _0x3805ba=new UserReport(this[_0xc4e6('0xd')]);if(config[_0xc4e6('0x11')]&&config[_0xc4e6('0x11')][_0xc4e6('0x12')]){ami['on'](_0xc4e6('0x13'),this[_0xc4e6('0x14')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xc4e6('0x15')][_0xc4e6('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0xc4e6('0x17')][_0xc4e6('0x16')](this));ami['on'](_0xc4e6('0x18'),this[_0xc4e6('0x19')][_0xc4e6('0x16')](this));ami['on'](_0xc4e6('0x1a'),this[_0xc4e6('0x1b')]['bind'](this));ami['on'](_0xc4e6('0x1c'),this['attendedTransfer'][_0xc4e6('0x16')](this));}};Report['prototype'][_0xc4e6('0x1d')]=function(_0x4b07fe){var _0x44d5bd;_0x44d5bd=_[_0xc4e6('0x1e')](this[_0xc4e6('0xe')],function(_0x20f09e){return _0x20f09e[_0xc4e6('0x1f')]==_0x4b07fe||_0x20f09e[_0xc4e6('0x20')]==_0x4b07fe;});if(_[_0xc4e6('0x21')](_0x44d5bd)){var _0x33ef0b=_[_0xc4e6('0x1e')](this[_0xc4e6('0xf')],function(_0x37e74d){return _0x37e74d['accountcode']==_0x4b07fe||_0x37e74d[_0xc4e6('0x20')]==_0x4b07fe;});if(_0x33ef0b){_0x44d5bd=_[_0xc4e6('0x1e')](this['agents'],function(_0x3fea27){return _0x3fea27[_0xc4e6('0x22')]==util['format'](_0xc4e6('0x23'),_0x33ef0b[_0xc4e6('0x20')]);});}}return _0x44d5bd;};Report[_0xc4e6('0x10')][_0xc4e6('0x14')]=function(_0x7955a9){for(var _0x2b754a=0x0;_0x2b754a<_0x7955a9['length'];_0x2b754a+=0x1){var _0x51fc4b=this['findAgent'](_0x7955a9[_0x2b754a]['connectedlinenum']);if(_0x51fc4b){_0x7955a9[_0x2b754a]['accountcode']=_0x51fc4b[_0xc4e6('0x1f')];_0x7955a9[_0x2b754a][_0xc4e6('0x24')]=!![];_0x7955a9[_0x2b754a][_0xc4e6('0x25')]=_0x51fc4b['name'];_0x7955a9[_0x2b754a][_0xc4e6('0x22')]=_[_0xc4e6('0x21')](_0x51fc4b['interface'])?util['format'](_0xc4e6('0x23'),_0x51fc4b[_0xc4e6('0x20')]):_0x51fc4b[_0xc4e6('0x22')];if(_0x7955a9[_0x2b754a][_0xc4e6('0x26')]){_0x7955a9[_0x2b754a][_0xc4e6('0x27')]=moment()[_0xc4e6('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7955a9[_0x2b754a][_0xc4e6('0x29')]){_0x7955a9[_0x2b754a][_0xc4e6('0x2a')]=moment()[_0xc4e6('0x28')](_0xc4e6('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x7955a9[_0x2b754a]);}RpcVoiceQueueReport[_0xc4e6('0x2c')](_0x7955a9[_0x2b754a]);}};function extractCalleridNumber(_0x119c2a){var _0x44912b=_0x119c2a[_0xc4e6('0x2d')](/<(.*?)>/);return _0x44912b?_0x44912b[0x1]:_0x119c2a;}Report[_0xc4e6('0x10')][_0xc4e6('0x2e')]=function(_0x349c18){for(var _0x50dfb3=0x0;_0x50dfb3<Object['keys'](this[_0xc4e6('0xe')])[_0xc4e6('0x2f')];_0x50dfb3++){var _0x483491=Object[_0xc4e6('0x30')](this[_0xc4e6('0xe')])[_0x50dfb3];var _0x5960e9=this['agents'][_0x483491];if(_0x5960e9['accountcode']===Number(_0x349c18))return _0x5960e9;}return null;};Report['prototype'][_0xc4e6('0x31')]=function(_0x18c9fc){var _0x518c34=_0x18c9fc[_0xc4e6('0x32')][_0xc4e6('0x33')]('-')[0x0];var _0x24967b=this[_0xc4e6('0xe')][_0x518c34];if(!_0x24967b)_0x24967b=this[_0xc4e6('0x2e')](_0x18c9fc[_0xc4e6('0x34')]);return!_0x24967b?_0xc4e6('0x35'):_0xc4e6('0x36');};Report[_0xc4e6('0x10')]['voiceCallReport']=function(_0xaf9387){_0xaf9387['destination']=_0xaf9387[_0xc4e6('0x37')]||_0xaf9387[_0xc4e6('0x38')];if(_0xaf9387[_0xc4e6('0x39')]==_0xc4e6('0x3a')){_0xaf9387[_0xc4e6('0x3b')]=_0xc4e6('0x3c');_0xaf9387[_0xc4e6('0x3d')]=_0xaf9387[_0xc4e6('0x3c')];if(_0xaf9387[_0xc4e6('0x3e')]==_0xc4e6('0x3f')){_0xaf9387[_0xc4e6('0x1f')]='';_0xaf9387[_0xc4e6('0x37')]=extractCalleridNumber(_0xaf9387[_0xc4e6('0x40')]);}else if(_0xaf9387['context']==_0xc4e6('0x41')){if(_0xaf9387['destination']==_0xc4e6('0x42')){_0xaf9387[_0xc4e6('0x37')]=extractCalleridNumber(_0xaf9387[_0xc4e6('0x43')]);_0xaf9387[_0xc4e6('0x34')]=_0xaf9387[_0xc4e6('0x44')];_0xaf9387[_0xc4e6('0x45')]=[_0xaf9387['channel'],_0xaf9387[_0xc4e6('0x32')]=_0xaf9387['destinationchannel']][0x0];_0xaf9387[_0xc4e6('0x40')]=_0xaf9387[_0xc4e6('0x43')];}else{_0xaf9387['destination']=_0xaf9387[_0xc4e6('0x34')];_0xaf9387['calleridnum']=_0xaf9387['originatecalleridnum'];if(_0xaf9387[_0xc4e6('0x46')]==_0xc4e6('0x47')){_0xaf9387[_0xc4e6('0x1f')]=_0xaf9387[_0xc4e6('0x48')];}else{_0xaf9387[_0xc4e6('0x1f')]='';}}}}else{_0xaf9387[_0xc4e6('0x40')]=util[_0xc4e6('0x28')]('\x22%s\x22\x20<%s>',_0xaf9387['calleridname'],_0xaf9387[_0xc4e6('0x34')]);}if(RpcVoiceTransferReport[_0xc4e6('0x49')][_0xaf9387['linkedid']]){var _0x4b21d=RpcVoiceTransferReport['transfers'][_0xaf9387['linkedid']];_0x4b21d[_0xc4e6('0x4a')]=_0xaf9387[_0xc4e6('0x4b')];RpcVoiceTransferReport[_0xc4e6('0x1b')](_0x4b21d);delete RpcVoiceTransferReport[_0xc4e6('0x49')][_0xaf9387[_0xc4e6('0x4c')]];}if(_[_0xc4e6('0x21')](_0xaf9387['type'])){_0xaf9387[_0xc4e6('0x39')]=this[_0xc4e6('0x31')](_0xaf9387);}if(_[_0xc4e6('0x21')](_0xaf9387[_0xc4e6('0x4d')])){var _0x15b700=_0xaf9387[_0xc4e6('0x32')]['split']('-')[0x0];var _0x6ad1b2=this['agents'][_0x15b700];if(!_0x6ad1b2)_0x6ad1b2=this['getAgentByInternal'](_0xaf9387['accountcode']);if(_0x6ad1b2){_0xaf9387[_0xc4e6('0x4d')]=_0x6ad1b2['id'];_0xaf9387[_0xc4e6('0x4e')]=_0x6ad1b2[_0xc4e6('0x20')];}}RpcVoiceCallReport[_0xc4e6('0x2c')](_0xaf9387);if(_0xaf9387[_0xc4e6('0x4f')]){for(var _0x3bdff9=0x0;_0x3bdff9<_0xaf9387['monitors']['length'];_0x3bdff9+=0x1){_0xaf9387[_0xc4e6('0x50')]=_0xaf9387['monitors'][_0x3bdff9][_0xc4e6('0x51')];_0xaf9387['createdAt']=_0xaf9387[_0xc4e6('0x52')][_0x3bdff9][_0xc4e6('0x53')];if(_0xaf9387['exten']=='xcally-motion-preview'){_0xaf9387[_0xc4e6('0x34')]=_0xaf9387['connectedlinenum'];_0xaf9387[_0xc4e6('0x54')]=_0xaf9387['connectedlinename'];_0xaf9387['connectedlinenum']=_0xaf9387[_0xc4e6('0x1f')];_0xaf9387['connectedlinename']=_0xaf9387[_0xc4e6('0x4e')];_0xaf9387[_0xc4e6('0x38')]=_0xaf9387[_0xc4e6('0x44')];}else if(_0xaf9387['exten']==_0xc4e6('0x55')){_0xaf9387[_0xc4e6('0x34')]=_0xaf9387['destination'];_0xaf9387[_0xc4e6('0x38')]=_0xaf9387[_0xc4e6('0x44')];}RpcVoiceRecording[_0xc4e6('0x2c')](_0xaf9387);}}};Report['prototype'][_0xc4e6('0x17')]=function(_0x58a34d){if(_[_0xc4e6('0x56')](_0x58a34d)){_0x58a34d['forEach'](function(_0x2d5767){RpcVoiceAgentReport[_0xc4e6('0x2c')](_0x2d5767);});}else{RpcVoiceAgentReport['create'](_0x58a34d);}};Report[_0xc4e6('0x10')]['voiceDialReport']=function(_0x342768){RpcVoiceDialReport[_0xc4e6('0x2c')](_0x342768);var _0x1b6297;var _0x148270;var _0x51f918=_0x342768[_0xc4e6('0x32')];if(_['startsWith'](_0x51f918,'Local')){_0x148270=_0x51f918[_0xc4e6('0x57')](_0x51f918['indexOf']('/')+0x1,_0x51f918[_0xc4e6('0x58')]('@'));_0x1b6297=_[_0xc4e6('0x1e')](this[_0xc4e6('0xe')],function(_0x504761){return _0x504761[_0xc4e6('0x59')]==_0x148270||_0x504761[_0xc4e6('0x5a')]==_0x148270||_0x504761[_0xc4e6('0x1f')]==_0x148270;});}else{_0x148270=_0x51f918[_0xc4e6('0x57')](_0x51f918[_0xc4e6('0x58')]('/')+0x1,_0x51f918['lastIndexOf']('-'));_0x1b6297=this[_0xc4e6('0x1d')](_0x148270);}if(_0x1b6297){_0x342768[_0xc4e6('0x22')]=_[_0xc4e6('0x21')](_0x1b6297[_0xc4e6('0x22')])?util[_0xc4e6('0x28')]('SIP/%s',_0x1b6297[_0xc4e6('0x20')]):_0x1b6297[_0xc4e6('0x22')];_0x342768[_0xc4e6('0x4e')]=_0x1b6297['name'];_0x342768[_0xc4e6('0x1f')]=_0x1b6297[_0xc4e6('0x1f')];RpcMemberReport['voiceDialReport'](_0x342768);}};Report[_0xc4e6('0x10')]['blindTransfer']=function(_0x44afd3){RpcVoiceTransferReport[_0xc4e6('0x49')][_0x44afd3[_0xc4e6('0x5b')]]=_0x44afd3;};Report[_0xc4e6('0x10')][_0xc4e6('0x5c')]=function(_0x49a15c){RpcVoiceTransferReport['attendedTransfer'](_0x49a15c);};module[_0xc4e6('0x5d')]=Report;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a9b=['actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','syncRegistry','info','state','debug','[userReport][registry]','username','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','updateStatusRealtime','toNumber','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','ioredis','../../../config/logger','ami','defaults','redis','localhost','trunks','agents','telephones','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','[userReport][devicestatelist]'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x2a9b,0x18c));var _0xb2a9=function(_0x524d7c,_0x484bcc){_0x524d7c=_0x524d7c-0x0;var _0x480cfb=_0x2a9b[_0x524d7c];return _0x480cfb;};'use strict';var _=require('lodash');var moment=require(_0xb2a9('0x0'));var util=require('util');var Redis=require(_0xb2a9('0x1'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0xb2a9('0x2'))(_0xb2a9('0x3'));var ami=require('../ami');config['redis']=_[_0xb2a9('0x4')](config[_0xb2a9('0x5')],{'host':_0xb2a9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb2a9('0x5')]));function UserReport(_0x15734b){this[_0xb2a9('0x7')]=_0x15734b[_0xb2a9('0x7')];this[_0xb2a9('0x8')]=_0x15734b['agents'];this['telephones']=_0x15734b[_0xb2a9('0x9')];ami['on']('registryentry',this['syncRegistry'][_0xb2a9('0xa')](this));ami['on'](_0xb2a9('0xb'),this['syncRegistry'][_0xb2a9('0xa')](this));ami['on'](_0xb2a9('0xc'),this[_0xb2a9('0xd')][_0xb2a9('0xa')](this));ami['on'](_0xb2a9('0xe'),this[_0xb2a9('0xf')][_0xb2a9('0xa')](this));return this[_0xb2a9('0x10')]();}function showSipRegistrations(){Promise[_0xb2a9('0x11')]()[_0xb2a9('0x12')](ami[_0xb2a9('0x13')]())[_0xb2a9('0x14')](function(_0x5d3a14){logger[_0xb2a9('0x15')]('[userReport][sipshowregistry]',util[_0xb2a9('0x16')](_0x5d3a14,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xb2a9('0x11')]()[_0xb2a9('0x12')](ami['actionDeviceStateList']())['catch'](function(_0x47b950){logger[_0xb2a9('0x15')](_0xb2a9('0x17'),util[_0xb2a9('0x16')](_0x47b950,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb2a9('0x11')]()['then'](ami[_0xb2a9('0x18')]())['catch'](function(_0x55de45){logger[_0xb2a9('0x15')](_0xb2a9('0x19'),util[_0xb2a9('0x16')](_0x55de45,{'showHidden':![],'depth':null}));});}UserReport[_0xb2a9('0x1a')][_0xb2a9('0x10')]=function(){setInterval(function(){BPromise[_0xb2a9('0x11')]()[_0xb2a9('0x12')](showSipRegistrations())[_0xb2a9('0x12')](listDeviceStates())[_0xb2a9('0x12')](showPeersStatus());},0x32c8);};UserReport[_0xb2a9('0x1a')][_0xb2a9('0x1b')]=function(_0x329b18){return _0x329b18!==null&&!_[_0xb2a9('0x1c')](_0x329b18);};UserReport['prototype'][_0xb2a9('0x1d')]=function(_0x549db2,_0x1bbdf0,_0x1ce30d){io['to'](_0x549db2)[_0xb2a9('0x1d')](_0x1bbdf0,_0x1ce30d);};UserReport[_0xb2a9('0x1a')][_0xb2a9('0x1e')]=function(_0x375f9b){try{if(this[_0xb2a9('0x1b')](_0x375f9b)){logger[_0xb2a9('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x375f9b['username'],_0x375f9b[_0xb2a9('0x20')]);logger[_0xb2a9('0x21')](_0xb2a9('0x22'),util['inspect'](_0x375f9b,{'showHidden':![],'depth':null}));var _0x198b7a=_['find'](this['trunks'],{'defaultuser':_0x375f9b[_0xb2a9('0x23')]});if(_0x198b7a){_0x375f9b['stateRegistry']=_0x375f9b[_0xb2a9('0x20')];_[_0xb2a9('0x24')](_0x198b7a,_[_0xb2a9('0x25')](_0x375f9b,['event',_0xb2a9('0x26'),'username',_0xb2a9('0x20')]));logger[_0xb2a9('0x21')](_0xb2a9('0x27'),util[_0xb2a9('0x16')](_0x198b7a,{'showHidden':![],'depth':null}));this[_0xb2a9('0x1d')](util[_0xb2a9('0x28')](_0xb2a9('0x29'),_0x198b7a['name']),'trunk:save',_0x198b7a);}}}catch(_0x261fc9){logger[_0xb2a9('0x15')]('[userReport][registry]',util[_0xb2a9('0x16')](_0x261fc9,{'showHidden':![],'depth':null}));}};UserReport[_0xb2a9('0x1a')][_0xb2a9('0xd')]=function(_0x58491b){try{if(this[_0xb2a9('0x1b')](_0x58491b)){logger[_0xb2a9('0x1f')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x58491b['device'],_0x58491b['state']);logger[_0xb2a9('0x21')](_0xb2a9('0x2a'),util[_0xb2a9('0x16')](_0x58491b,{'showHidden':![],'depth':null}));if(this[_0xb2a9('0x8')][_0x58491b[_0xb2a9('0x2b')]]){if(!this[_0xb2a9('0x8')][_0x58491b['device']][_0xb2a9('0x2c')]||_0x58491b[_0xb2a9('0x20')][_0xb2a9('0x2d')]()==_0xb2a9('0x2e')){this['agents'][_0x58491b[_0xb2a9('0x2b')]]['local']=![];if(this[_0xb2a9('0x8')][_0x58491b[_0xb2a9('0x2b')]]['state']!==_0x58491b['state']['toLowerCase']()){this[_0xb2a9('0x8')][_0x58491b[_0xb2a9('0x2b')]][_0xb2a9('0x2f')]=_['toNumber'](moment()['format']('x'));}this[_0xb2a9('0x8')][_0x58491b['device']][_0xb2a9('0x20')]=_0x58491b['state'][_0xb2a9('0x2d')]();this[_0xb2a9('0x8')][_0x58491b[_0xb2a9('0x2b')]][_0xb2a9('0x30')](_0x58491b);}}else if(this[_0xb2a9('0x9')][_0x58491b[_0xb2a9('0x2b')]]){if(this[_0xb2a9('0x9')][_0x58491b['device']]['state']!==_0x58491b['state']['toLowerCase']()){this[_0xb2a9('0x9')][_0x58491b['device']][_0xb2a9('0x2f')]=_[_0xb2a9('0x31')](moment()['format']('x'));}this[_0xb2a9('0x9')][_0x58491b[_0xb2a9('0x2b')]]['state']=_0x58491b['state'][_0xb2a9('0x2d')]();logger[_0xb2a9('0x21')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xb2a9('0x16')](this['telephones'][_0x58491b[_0xb2a9('0x2b')]],{'showHidden':![],'depth':null}));this[_0xb2a9('0x1d')](util[_0xb2a9('0x28')](_0xb2a9('0x32'),this['telephones'][_0x58491b['device']][_0xb2a9('0x33')]),_0xb2a9('0x34'),this['telephones'][_0x58491b[_0xb2a9('0x2b')]]);}else if(this[_0xb2a9('0x7')][_0x58491b['device']]){if(this[_0xb2a9('0x7')][_0x58491b[_0xb2a9('0x2b')]][_0xb2a9('0x20')]!==_0x58491b[_0xb2a9('0x20')][_0xb2a9('0x2d')]()){this[_0xb2a9('0x7')][_0x58491b[_0xb2a9('0x2b')]][_0xb2a9('0x2f')]=_[_0xb2a9('0x31')](moment()[_0xb2a9('0x28')]('x'));}this[_0xb2a9('0x7')][_0x58491b[_0xb2a9('0x2b')]][_0xb2a9('0x20')]=_0x58491b[_0xb2a9('0x20')][_0xb2a9('0x2d')]();logger[_0xb2a9('0x21')](_0xb2a9('0x35'),util[_0xb2a9('0x16')](this[_0xb2a9('0x7')][_0x58491b[_0xb2a9('0x2b')]],{'showHidden':![],'depth':null}));this[_0xb2a9('0x1d')](util[_0xb2a9('0x28')](_0xb2a9('0x29'),this['trunks'][_0x58491b[_0xb2a9('0x2b')]][_0xb2a9('0x33')]),'trunk:save',this[_0xb2a9('0x7')][_0x58491b[_0xb2a9('0x2b')]]);}else if(_[_0xb2a9('0x36')](_0x58491b['device'],_0xb2a9('0x37'))){var _0x2ea641=_0x58491b[_0xb2a9('0x2b')];var _0x21b43b=_0x2ea641[_0xb2a9('0x38')](_0x2ea641['indexOf']('/')+0x1,_0x2ea641[_0xb2a9('0x39')]('@'));var _0x21c0b5=_[_0xb2a9('0x3a')](this[_0xb2a9('0x8')],function(_0x844dce){return _0x844dce['mobile']==_0x21b43b||_0x844dce[_0xb2a9('0x3b')]==_0x21b43b||_0x844dce[_0xb2a9('0x3c')]==_0x21b43b;});if(_0x21c0b5){if(_0x21c0b5[_0xb2a9('0x20')]!==_0x58491b['state'][_0xb2a9('0x2d')]()){_0x21c0b5[_0xb2a9('0x2f')]=_[_0xb2a9('0x31')](moment()['format']('x'));}_0x21c0b5[_0xb2a9('0x20')]=_0x58491b['state'][_0xb2a9('0x2d')]();_0x21c0b5['local']=!![];_0x21c0b5['updateStatusRealtime'](_0x58491b);}}}}catch(_0x6342c5){logger[_0xb2a9('0x15')]('[userReport][devicestatechange]',util[_0xb2a9('0x16')](_0x6342c5,{'showHidden':![],'depth':null}));}};UserReport[_0xb2a9('0x1a')][_0xb2a9('0xf')]=function(_0x268517){try{if(this['isNotNull'](_0x268517)&&this[_0xb2a9('0x1b')](_0x268517[_0xb2a9('0xe')])){logger[_0xb2a9('0x1f')](_0xb2a9('0x3d'),_0x268517['peer'],_0x268517[_0xb2a9('0x3e')],_0x268517[_0xb2a9('0xe')]);logger[_0xb2a9('0x21')](_0xb2a9('0x3f'),util['inspect'](_0x268517,{'showHidden':![],'depth':null}));if(this[_0xb2a9('0x8')][_0x268517[_0xb2a9('0x40')]]){if(!this[_0xb2a9('0x8')][_0x268517[_0xb2a9('0x40')]][_0xb2a9('0x2c')]||_0x268517['peerstatus'][_0xb2a9('0x2d')]()==_0xb2a9('0x41')){this['agents'][_0x268517['peer']][_0xb2a9('0x2c')]=![];this['agents'][_0x268517[_0xb2a9('0x40')]][_0xb2a9('0x42')]=_0x268517['peerstatus'][_0xb2a9('0x2d')]();this[_0xb2a9('0x8')][_0x268517['peer']][_0xb2a9('0x3e')]=_0x268517['address'];this[_0xb2a9('0x8')][_0x268517[_0xb2a9('0x40')]][_0xb2a9('0x30')](_0x268517);}}else if(this['telephones'][_0x268517[_0xb2a9('0x40')]]){this[_0xb2a9('0x9')][_0x268517[_0xb2a9('0x40')]]['status']=_0x268517['peerstatus'][_0xb2a9('0x2d')]();this['telephones'][_0x268517[_0xb2a9('0x40')]][_0xb2a9('0x3e')]=_0x268517[_0xb2a9('0x3e')];logger[_0xb2a9('0x21')](_0xb2a9('0x43'),util['inspect'](this[_0xb2a9('0x9')][_0x268517['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0xb2a9('0x28')]('telephone:%s',this['telephones'][_0x268517[_0xb2a9('0x40')]][_0xb2a9('0x33')]),'telephone:save',this[_0xb2a9('0x9')][_0x268517['peer']]);}else if(this['trunks'][_0x268517[_0xb2a9('0x40')]]){this[_0xb2a9('0x7')][_0x268517[_0xb2a9('0x40')]][_0xb2a9('0x42')]=_0x268517['peerstatus'][_0xb2a9('0x2d')]();this[_0xb2a9('0x7')][_0x268517['peer']]['address']=_0x268517[_0xb2a9('0x3e')];logger[_0xb2a9('0x21')](_0xb2a9('0x44'),util[_0xb2a9('0x16')](this[_0xb2a9('0x7')][_0x268517[_0xb2a9('0x40')]],{'showHidden':![],'depth':null}));this[_0xb2a9('0x1d')](util[_0xb2a9('0x28')]('trunk:%s',this[_0xb2a9('0x7')][_0x268517['peer']][_0xb2a9('0x33')]),'trunk:save',this['trunks'][_0x268517['peer']]);}}}catch(_0x5ad43f){logger[_0xb2a9('0x15')](_0xb2a9('0x3f'),util[_0xb2a9('0x16')](_0x5ad43f,{'showHidden':![],'depth':null}));}};module[_0xb2a9('0x45')]=UserReport;
\ No newline at end of file
+var _0x05d3=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','resolve','actionSipShowRegistry','catch','error','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','inspect','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','state','merge','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','syncDeviceState','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','format','updateStatusRealtime','telephone:save','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered'];(function(_0x2a1d9d,_0x4af24){var _0x5f65bf=function(_0x4e4022){while(--_0x4e4022){_0x2a1d9d['push'](_0x2a1d9d['shift']());}};_0x5f65bf(++_0x4af24);}(_0x05d3,0x98));var _0x305d=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x05d3[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x305d('0x0'));var moment=require(_0x305d('0x1'));var util=require(_0x305d('0x2'));var Redis=require(_0x305d('0x3'));var BPromise=require(_0x305d('0x4'));var config=require(_0x305d('0x5'));var logger=require('../../../config/logger')(_0x305d('0x6'));var ami=require(_0x305d('0x7'));config[_0x305d('0x8')]=_[_0x305d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x305d('0xa'))(new Redis(config[_0x305d('0x8')]));function UserReport(_0x1decaf){this['trunks']=_0x1decaf[_0x305d('0xb')];this[_0x305d('0xc')]=_0x1decaf[_0x305d('0xc')];this[_0x305d('0xd')]=_0x1decaf[_0x305d('0xd')];ami['on'](_0x305d('0xe'),this['syncRegistry']['bind'](this));ami['on']('registry',this[_0x305d('0xf')][_0x305d('0x10')](this));ami['on'](_0x305d('0x11'),this['syncDeviceState'][_0x305d('0x10')](this));ami['on'](_0x305d('0x12'),this['syncPeerStatus'][_0x305d('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x305d('0x13')]()['then'](ami[_0x305d('0x14')]())[_0x305d('0x15')](function(_0x44b2f7){logger[_0x305d('0x16')]('[userReport][sipshowregistry]',util['inspect'](_0x44b2f7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x305d('0x13')]()[_0x305d('0x17')](ami[_0x305d('0x18')]())['catch'](function(_0x24bcbb){logger[_0x305d('0x16')](_0x305d('0x19'),util['inspect'](_0x24bcbb,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x305d('0x13')]()[_0x305d('0x17')](ami[_0x305d('0x1a')]())['catch'](function(_0xf2a8bf){logger['error']('[userReport][sippeerstatus]',util[_0x305d('0x1b')](_0xf2a8bf,{'showHidden':![],'depth':null}));});}UserReport[_0x305d('0x1c')][_0x305d('0x1d')]=function(){setInterval(function(){BPromise[_0x305d('0x13')]()[_0x305d('0x17')](showSipRegistrations())[_0x305d('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x305d('0x1e')]=function(_0x477389){return _0x477389!==null&&!_[_0x305d('0x1f')](_0x477389);};UserReport[_0x305d('0x1c')][_0x305d('0x20')]=function(_0x41e512,_0x13ddd2,_0x20ebe3){io['to'](_0x41e512)['emit'](_0x13ddd2,_0x20ebe3);};UserReport[_0x305d('0x1c')]['syncRegistry']=function(_0x51ee9c){try{if(this[_0x305d('0x1e')](_0x51ee9c)){logger['info'](_0x305d('0x21'),_0x51ee9c[_0x305d('0x22')],_0x51ee9c['state']);logger[_0x305d('0x23')](_0x305d('0x24'),util[_0x305d('0x1b')](_0x51ee9c,{'showHidden':![],'depth':null}));var _0x990065=_[_0x305d('0x25')](this[_0x305d('0xb')],{'defaultuser':_0x51ee9c[_0x305d('0x22')]});if(_0x990065){_0x51ee9c[_0x305d('0x26')]=_0x51ee9c[_0x305d('0x27')];_[_0x305d('0x28')](_0x990065,_['omit'](_0x51ee9c,['event','actionid',_0x305d('0x22'),'state']));logger[_0x305d('0x23')](_0x305d('0x29'),util['inspect'](_0x990065,{'showHidden':![],'depth':null}));this[_0x305d('0x20')](util['format'](_0x305d('0x2a'),_0x990065[_0x305d('0x2b')]),_0x305d('0x2c'),_0x990065);}}}catch(_0x467b64){logger[_0x305d('0x16')](_0x305d('0x24'),util[_0x305d('0x1b')](_0x467b64,{'showHidden':![],'depth':null}));}};UserReport[_0x305d('0x1c')][_0x305d('0x2d')]=function(_0x5d128e){try{if(this[_0x305d('0x1e')](_0x5d128e)){logger[_0x305d('0x2e')](_0x305d('0x2f'),_0x5d128e[_0x305d('0x30')],_0x5d128e[_0x305d('0x27')]);logger[_0x305d('0x23')](_0x305d('0x31'),util[_0x305d('0x1b')](_0x5d128e,{'showHidden':![],'depth':null}));if(this[_0x305d('0xc')][_0x5d128e[_0x305d('0x30')]]){if(!this[_0x305d('0xc')][_0x5d128e[_0x305d('0x30')]][_0x305d('0x32')]||_0x5d128e[_0x305d('0x27')][_0x305d('0x33')]()==_0x305d('0x34')){this[_0x305d('0xc')][_0x5d128e[_0x305d('0x30')]][_0x305d('0x32')]=![];if(this[_0x305d('0xc')][_0x5d128e[_0x305d('0x30')]][_0x305d('0x27')]!==_0x5d128e[_0x305d('0x27')][_0x305d('0x33')]()){this['agents'][_0x5d128e[_0x305d('0x30')]]['stateTime']=_['toNumber'](moment()[_0x305d('0x35')]('x'));}this[_0x305d('0xc')][_0x5d128e['device']]['state']=_0x5d128e[_0x305d('0x27')][_0x305d('0x33')]();this[_0x305d('0xc')][_0x5d128e[_0x305d('0x30')]][_0x305d('0x36')](_0x5d128e);}}else if(this[_0x305d('0xd')][_0x5d128e[_0x305d('0x30')]]){if(this[_0x305d('0xd')][_0x5d128e['device']][_0x305d('0x27')]!==_0x5d128e[_0x305d('0x27')]['toLowerCase']()){this[_0x305d('0xd')][_0x5d128e[_0x305d('0x30')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this['telephones'][_0x5d128e['device']][_0x305d('0x27')]=_0x5d128e[_0x305d('0x27')][_0x305d('0x33')]();logger[_0x305d('0x23')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this['telephones'][_0x5d128e[_0x305d('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x305d('0x35')]('telephone:%s',this[_0x305d('0xd')][_0x5d128e['device']][_0x305d('0x2b')]),_0x305d('0x37'),this[_0x305d('0xd')][_0x5d128e['device']]);}else if(this[_0x305d('0xb')][_0x5d128e[_0x305d('0x30')]]){if(this[_0x305d('0xb')][_0x5d128e[_0x305d('0x30')]][_0x305d('0x27')]!==_0x5d128e[_0x305d('0x27')][_0x305d('0x33')]()){this[_0x305d('0xb')][_0x5d128e[_0x305d('0x30')]][_0x305d('0x38')]=_[_0x305d('0x39')](moment()['format']('x'));}this[_0x305d('0xb')][_0x5d128e['device']][_0x305d('0x27')]=_0x5d128e[_0x305d('0x27')][_0x305d('0x33')]();logger[_0x305d('0x23')](_0x305d('0x3a'),util['inspect'](this['trunks'][_0x5d128e[_0x305d('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x305d('0x35')](_0x305d('0x2a'),this[_0x305d('0xb')][_0x5d128e[_0x305d('0x30')]]['name']),_0x305d('0x2c'),this[_0x305d('0xb')][_0x5d128e[_0x305d('0x30')]]);}else if(_[_0x305d('0x3b')](_0x5d128e['device'],_0x305d('0x3c'))){var _0x3335e6=_0x5d128e[_0x305d('0x30')];var _0x4dbf96=_0x3335e6[_0x305d('0x3d')](_0x3335e6[_0x305d('0x3e')]('/')+0x1,_0x3335e6[_0x305d('0x3e')]('@'));var _0x4a0d1f=_[_0x305d('0x25')](this[_0x305d('0xc')],function(_0x3950da){return _0x3950da[_0x305d('0x3f')]==_0x4dbf96||_0x3950da['phone']==_0x4dbf96||_0x3950da['accountcode']==_0x4dbf96;});if(_0x4a0d1f){if(_0x4a0d1f[_0x305d('0x27')]!==_0x5d128e[_0x305d('0x27')]['toLowerCase']()){_0x4a0d1f[_0x305d('0x38')]=_['toNumber'](moment()[_0x305d('0x35')]('x'));}_0x4a0d1f[_0x305d('0x27')]=_0x5d128e[_0x305d('0x27')]['toLowerCase']();_0x4a0d1f['local']=!![];_0x4a0d1f[_0x305d('0x36')](_0x5d128e);}}}}catch(_0x416199){logger['error']('[userReport][devicestatechange]',util['inspect'](_0x416199,{'showHidden':![],'depth':null}));}};UserReport[_0x305d('0x1c')][_0x305d('0x40')]=function(_0x476c22){try{if(this[_0x305d('0x1e')](_0x476c22)&&this[_0x305d('0x1e')](_0x476c22['peerstatus'])){logger[_0x305d('0x2e')](_0x305d('0x41'),_0x476c22[_0x305d('0x42')],_0x476c22[_0x305d('0x43')],_0x476c22['peerstatus']);logger['debug'](_0x305d('0x44'),util[_0x305d('0x1b')](_0x476c22,{'showHidden':![],'depth':null}));if(this[_0x305d('0xc')][_0x476c22[_0x305d('0x42')]]){if(!this[_0x305d('0xc')][_0x476c22[_0x305d('0x42')]][_0x305d('0x32')]||_0x476c22[_0x305d('0x12')][_0x305d('0x33')]()==_0x305d('0x45')){this['agents'][_0x476c22[_0x305d('0x42')]][_0x305d('0x32')]=![];this[_0x305d('0xc')][_0x476c22[_0x305d('0x42')]][_0x305d('0x46')]=_0x476c22[_0x305d('0x12')][_0x305d('0x33')]();this[_0x305d('0xc')][_0x476c22['peer']][_0x305d('0x43')]=_0x476c22[_0x305d('0x43')];this[_0x305d('0xc')][_0x476c22[_0x305d('0x42')]][_0x305d('0x36')](_0x476c22);}}else if(this[_0x305d('0xd')][_0x476c22[_0x305d('0x42')]]){this[_0x305d('0xd')][_0x476c22['peer']][_0x305d('0x46')]=_0x476c22[_0x305d('0x12')][_0x305d('0x33')]();this[_0x305d('0xd')][_0x476c22[_0x305d('0x42')]][_0x305d('0x43')]=_0x476c22[_0x305d('0x43')];logger[_0x305d('0x23')](_0x305d('0x47'),util[_0x305d('0x1b')](this[_0x305d('0xd')][_0x476c22[_0x305d('0x42')]],{'showHidden':![],'depth':null}));this[_0x305d('0x20')](util[_0x305d('0x35')]('telephone:%s',this['telephones'][_0x476c22[_0x305d('0x42')]][_0x305d('0x2b')]),_0x305d('0x37'),this[_0x305d('0xd')][_0x476c22[_0x305d('0x42')]]);}else if(this['trunks'][_0x476c22[_0x305d('0x42')]]){this['trunks'][_0x476c22[_0x305d('0x42')]][_0x305d('0x46')]=_0x476c22['peerstatus'][_0x305d('0x33')]();this['trunks'][_0x476c22[_0x305d('0x42')]][_0x305d('0x43')]=_0x476c22[_0x305d('0x43')];logger[_0x305d('0x23')](_0x305d('0x48'),util[_0x305d('0x1b')](this[_0x305d('0xb')][_0x476c22[_0x305d('0x42')]],{'showHidden':![],'depth':null}));this[_0x305d('0x20')](util[_0x305d('0x35')](_0x305d('0x2a'),this[_0x305d('0xb')][_0x476c22[_0x305d('0x42')]][_0x305d('0x2b')]),_0x305d('0x2c'),this[_0x305d('0xb')][_0x476c22[_0x305d('0x42')]]);}}}catch(_0x31d4f4){logger[_0x305d('0x16')](_0x305d('0x44'),util[_0x305d('0x1b')](_0x31d4f4,{'showHidden':![],'depth':null}));}};module[_0x305d('0x49')]=UserReport;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6401=['called','mandatoryDisposition','type','inbound','voice','assign','omit','event','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','membername','user:called','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','user:agentconnect','agentringnoanswer','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','reason','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','agentcompleteAt','complete','talktime','acw','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','transfer','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','interface','voiceQueues','queue','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f5feb,_0xb3d3f8){var _0x46e1ed=function(_0x465936){while(--_0x465936){_0x3f5feb['push'](_0x3f5feb['shift']());}};_0x46e1ed(++_0xb3d3f8);}(_0x6401,0x116));var _0x1640=function(_0x3cfcf3,_0x15267b){_0x3cfcf3=_0x3cfcf3-0x0;var _0x1745e3=_0x6401[_0x3cfcf3];return _0x1745e3;};'use strict';var _=require(_0x1640('0x0'));var moment=require(_0x1640('0x1'));var util=require(_0x1640('0x2'));var Redis=require(_0x1640('0x3'));var config=require(_0x1640('0x4'));var logger=require('../../../config/logger')(_0x1640('0x5'));var ami=require(_0x1640('0x6'));config[_0x1640('0x7')]=_[_0x1640('0x8')](config[_0x1640('0x7')],{'host':_0x1640('0x9'),'port':0x18eb});var io=require(_0x1640('0xa'))(new Redis(config[_0x1640('0x7')]));function VoiceAgentReport(_0x32fc61){this['channels']={};this['voiceChannels']=_0x32fc61[_0x1640('0xb')];this['voiceQueues']=_0x32fc61['voiceQueues'];this[_0x1640('0xc')]=_0x32fc61[_0x1640('0xc')];this[_0x1640('0xd')]={};ami['on'](_0x1640('0xe'),this[_0x1640('0xf')][_0x1640('0x10')](this));ami['on'](_0x1640('0x11'),this[_0x1640('0x12')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x1640('0x13'),this[_0x1640('0x14')][_0x1640('0x10')](this));ami['on']('agentcomplete',this[_0x1640('0x15')]['bind'](this));ami['on']('varset',this[_0x1640('0x16')][_0x1640('0x10')](this));ami['on'](_0x1640('0x17'),this['syncHangup']['bind'](this));ami['on'](_0x1640('0x18'),this[_0x1640('0x19')][_0x1640('0x10')](this));ami['on'](_0x1640('0x1a'),this[_0x1640('0x1b')][_0x1640('0x10')](this));ami['on'](_0x1640('0x1c'),this['syncAttendedTransfer'][_0x1640('0x10')](this));ami['on'](_0x1640('0x1d'),this[_0x1640('0x1e')][_0x1640('0x10')](this));}VoiceAgentReport[_0x1640('0x1f')]['emit']=function(_0x56cb1f,_0x17bd07,_0x4ed6b1){io['to'](_0x56cb1f)[_0x1640('0x20')](_0x17bd07,_0x4ed6b1);};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x21')]=function(_0xdff766){return _0xdff766!==null&&!_[_0x1640('0x22')](_0xdff766);};VoiceAgentReport['prototype'][_0x1640('0xf')]=function(_0x28fd51){try{if(this[_0x1640('0x21')](_0x28fd51)){logger[_0x1640('0x23')](_0x1640('0x24'),_0x28fd51['uniqueid'],_0x28fd51['membername'],_0x28fd51[_0x1640('0x25')]);logger['debug'](_0x1640('0x26'),_0x28fd51[_0x1640('0x27')],util['inspect'](_0x28fd51,{'showHidden':![],'depth':null}));if(_[_0x1640('0x22')](this['channels'][_0x28fd51[_0x1640('0x27')]])){this[_0x1640('0xb')][_0x28fd51[_0x1640('0x27')]]={};}var _0x1983cb=this['agents'][_0x28fd51[_0x1640('0x28')]];var _0x12d33d=this[_0x1640('0xb')][_0x28fd51['uniqueid']][_0x28fd51[_0x1640('0x25')]];var _0x9356a=this[_0x1640('0x29')][_0x28fd51[_0x1640('0x2a')]];var _0x4d4521=this[_0x1640('0xd')][_0x28fd51[_0x1640('0x27')]];if(_[_0x1640('0x22')](_0x12d33d)){_0x12d33d={'agentcalledAt':moment()['format'](_0x1640('0x2b')),'lastevent':_0x1640('0x2c'),'mandatoryDisposition':_0x9356a&&_0x9356a['mandatoryDisposition']?_0x9356a[_0x1640('0x2d')]:![],'type':_0x9356a&&_0x9356a[_0x1640('0x2e')]?_0x9356a[_0x1640('0x2e')]:_0x1640('0x2f'),'variables':_0x4d4521,'motionChannel':_0x1640('0x30')};}Object[_0x1640('0x31')](_0x12d33d,_[_0x1640('0x32')](_0x28fd51,[_0x1640('0x33'),'privilege']));this[_0x1640('0xb')][_0x28fd51['uniqueid']][_0x28fd51[_0x1640('0x25')]]=_0x12d33d;logger[_0x1640('0x34')](_0x1640('0x35'),_0x28fd51['uniqueid'],util[_0x1640('0x36')](_0x12d33d,{'showHidden':![],'depth':null}));ami['emit'](_0x1640('0x37'),_0x12d33d);var _0x1d11ba={'id':_0x1983cb['id'],'calleridnum':_0x12d33d[_0x1640('0x38')],'queue':_0x12d33d[_0x1640('0x2a')],'variables':_0x12d33d[_0x1640('0xd')],'uniqueid':_0x28fd51[_0x1640('0x27')]};logger[_0x1640('0x34')](_0x1640('0x39'),_0x28fd51[_0x1640('0x27')],util[_0x1640('0x36')](_0x1d11ba,{'showHidden':![],'depth':null}));this[_0x1640('0x20')](util[_0x1640('0x3a')](_0x1640('0x3b'),_0x28fd51[_0x1640('0x3c')]),_0x1640('0x3d'),_0x1d11ba);}}catch(_0x34f8b0){logger['error']('[%s][voiceAgentReport][agentcalled]',_0x28fd51[_0x1640('0x27')],util[_0x1640('0x36')](_0x34f8b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x12')]=function(_0x916143){try{if(this[_0x1640('0x21')](_0x916143)){if(this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]]){for(var _0x57e4d4 in this['channels'][_0x916143[_0x1640('0x27')]]){if(this[_0x1640('0xb')][_0x916143['uniqueid']][_0x1640('0x3e')](_0x57e4d4)){if(_0x916143['destuniqueid']===_0x57e4d4){logger[_0x1640('0x23')](_0x1640('0x3f'),_0x916143[_0x1640('0x27')],_0x916143[_0x1640('0x3c')],_0x916143[_0x1640('0x25')]);this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4]['agentconnectAt']=moment()['format'](_0x1640('0x2b'));this[_0x1640('0xb')][_0x916143['uniqueid']][_0x57e4d4][_0x1640('0x40')]=_0x916143[_0x1640('0x40')];this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x41')]=_0x916143['connectedlinenum'];this[_0x1640('0xb')][_0x916143['uniqueid']][_0x57e4d4]['destchannelstate']=_0x916143['destchannelstate'];this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x42')]=_0x916143['destchannelstatedesc'];this['channels'][_0x916143['uniqueid']][_0x57e4d4][_0x1640('0x43')]=_0x916143[_0x1640('0x43')];this['channels'][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x44')]=_0x1640('0x45');if(this[_0x1640('0x46')][this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4]['uniqueid']]){var _0x55e947=this[_0x1640('0x46')][this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x27')]]['routealias'];this[_0x1640('0xb')][_0x916143['uniqueid']][_0x57e4d4]['routealias']=_0x55e947;_0x916143[_0x1640('0x47')]=_0x55e947;}_[_0x1640('0x48')](this[_0x1640('0xc')][_0x916143[_0x1640('0x28')]],_[_0x1640('0x49')](_0x916143,['queue',_0x1640('0x4a'),_0x1640('0x47')]));var _0x35de29=this[_0x1640('0xc')][_0x916143['interface']];var _0x812f94={'id':_0x35de29['id'],'name':_0x35de29[_0x1640('0x4b')],'agentconnected':!![],'destaccountcode':_0x35de29[_0x1640('0x4c')],'destconnectedlinenum':this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x916143[_0x1640('0x25')]][_0x1640('0x4d')],'queue':this[_0x1640('0xb')][_0x916143['uniqueid']][_0x916143[_0x1640('0x25')]][_0x1640('0x2a')],'routealias':this['channels'][_0x916143[_0x1640('0x27')]][_0x916143[_0x1640('0x25')]][_0x1640('0x47')],'uniqueid':this['channels'][_0x916143[_0x1640('0x27')]][_0x916143[_0x1640('0x25')]][_0x1640('0x27')]};ami[_0x1640('0x20')](_0x1640('0x4e'),this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x916143['destuniqueid']]);this[_0x1640('0x20')](util[_0x1640('0x3a')](_0x1640('0x3b'),_0x916143[_0x1640('0x3c')]),_0x1640('0x4f'),_0x812f94);}else if(!this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x50')]&&!this['channels'][_0x916143['uniqueid']][_0x57e4d4][_0x1640('0x51')]){logger[_0x1640('0x23')](_0x1640('0x52'),_0x916143[_0x1640('0x27')],this['channels'][_0x916143[_0x1640('0x27')]][_0x57e4d4]['membername'],_0x57e4d4);this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4]['agentringnoanswer']=!![];this['channels'][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x53')]=moment()[_0x1640('0x3a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x54')]=_0x916143[_0x1640('0x25')];this[_0x1640('0xb')][_0x916143['uniqueid']][_0x57e4d4]['answeredelsewheremembername']=_0x916143[_0x1640('0x3c')];this[_0x1640('0xb')][_0x916143['uniqueid']][_0x57e4d4][_0x1640('0x44')]='answered_elsewhere';this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4][_0x1640('0x55')]=_0x1640('0x56');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x916143['uniqueid'],util[_0x1640('0x36')](this['channels'][_0x916143['uniqueid']][_0x57e4d4],{'showHidden':![],'depth':null}));ami['emit'](_0x1640('0x57'),this[_0x1640('0xb')][_0x916143[_0x1640('0x27')]][_0x57e4d4]);}else{logger['debug'](_0x1640('0x58'),_0x916143[_0x1640('0x27')]);}}}}}}catch(_0x5ec173){logger[_0x1640('0x59')](_0x1640('0x5a'),_0x916143['uniqueid'],util[_0x1640('0x36')](_0x5ec173,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')]['syncAgentRingNoAnswer']=function(_0x319fea){try{if(this['isNotNull'](_0x319fea)){logger[_0x1640('0x34')](_0x1640('0x5b'),_0x319fea['uniqueid'],util[_0x1640('0x36')](_0x319fea,{'showHidden':![],'depth':null}));if(this[_0x1640('0xb')][_0x319fea[_0x1640('0x27')]]&&this['channels'][_0x319fea['uniqueid']][_0x319fea[_0x1640('0x25')]]){logger[_0x1640('0x23')](_0x1640('0x5c'),_0x319fea['uniqueid'],_0x319fea['membername'],_0x319fea['destuniqueid']);var _0x80e92f=this[_0x1640('0xc')][_0x319fea[_0x1640('0x28')]];var _0x15e68e=this[_0x1640('0xb')][_0x319fea[_0x1640('0x27')]][_0x319fea['destuniqueid']];_0x15e68e['agentringnoanswer']=!![];_0x15e68e['agentringnoanswerAt']=moment()[_0x1640('0x3a')](_0x1640('0x2b'));_0x15e68e[_0x1640('0x44')]=_0x1640('0x5d');_0x15e68e['reason']=_0x1640('0x5d');var _0x32c7a9={'id':_0x80e92f['id'],'name':_0x80e92f[_0x1640('0x4b')],'queue':_0x15e68e[_0x1640('0x2a')],'uniqueid':_0x15e68e[_0x1640('0x27')]};logger[_0x1640('0x34')](_0x1640('0x5e'),_0x319fea[_0x1640('0x27')],util[_0x1640('0x36')](_0x32c7a9,{'showHidden':![],'depth':null}));this[_0x1640('0x20')](util[_0x1640('0x3a')]('user:%s',_0x80e92f[_0x1640('0x4b')]),'user:agentringnoanswer',_0x32c7a9);ami['emit'](_0x1640('0x5f'),_0x15e68e);this['channels'][_0x319fea[_0x1640('0x27')]][_0x319fea[_0x1640('0x25')]]=Object[_0x1640('0x31')]({},_0x15e68e);}}}catch(_0x4d17f5){logger[_0x1640('0x59')]('[%s][voiceAgentReport][agentringnoanswer]',_0x319fea[_0x1640('0x27')],util['inspect'](_0x4d17f5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x14')]=function(_0x1693e3){try{if(this[_0x1640('0x21')](_0x1693e3)){logger['debug'](_0x1640('0x60'),_0x1693e3['uniqueid'],util[_0x1640('0x36')](_0x1693e3,{'showHidden':![],'depth':null}));if(this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]]){for(var _0x1661fc in this['channels'][_0x1693e3[_0x1640('0x27')]]){if(this['channels'][_0x1693e3[_0x1640('0x27')]]['hasOwnProperty'](_0x1661fc)&&!this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]][_0x1661fc][_0x1640('0x50')]&&!this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]][_0x1661fc][_0x1640('0x51')]){logger[_0x1640('0x23')](_0x1640('0x61'),_0x1693e3[_0x1640('0x27')],this[_0x1640('0xb')][_0x1693e3['uniqueid']][_0x1661fc]['membername'],_0x1661fc);this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]][_0x1661fc]['agentringnoanswer']=!![];this['channels'][_0x1693e3[_0x1640('0x27')]][_0x1661fc]['agentringnoanswerAt']=moment()[_0x1640('0x3a')](_0x1640('0x2b'));this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]][_0x1661fc][_0x1640('0x44')]='abandoned';this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]][_0x1661fc][_0x1640('0x55')]=_0x1640('0x62');logger[_0x1640('0x34')](_0x1640('0x63'),_0x1693e3[_0x1640('0x27')],util[_0x1640('0x36')](this[_0x1640('0xb')][_0x1693e3[_0x1640('0x27')]][_0x1661fc],{'showHidden':![],'depth':null}));ami[_0x1640('0x20')](_0x1640('0x64'),this[_0x1640('0xb')][_0x1693e3['uniqueid']][_0x1661fc]);}}}}}catch(_0x50ee6d){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x1693e3[_0x1640('0x27')],util[_0x1640('0x36')](_0x50ee6d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1640('0x15')]=function(_0x2cd015){try{if(this[_0x1640('0x21')](_0x2cd015)){logger[_0x1640('0x34')](_0x1640('0x65'),_0x2cd015[_0x1640('0x27')],util['inspect'](_0x2cd015,{'showHidden':![],'depth':null}));if(this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]]){for(var _0x3e9698 in this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]]){if(this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]]['hasOwnProperty'](_0x3e9698)){if(this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698][_0x1640('0x66')]&&!this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698][_0x1640('0x51')]){logger['info']('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2cd015['uniqueid'],this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698][_0x1640('0x3c')],_0x3e9698);this['channels'][_0x2cd015['uniqueid']][_0x3e9698][_0x1640('0x51')]=!![];this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698][_0x1640('0x67')]=moment()['format'](_0x1640('0x2b'));this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698][_0x1640('0x44')]=_0x1640('0x68');this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698]['reason']=_0x2cd015['reason']=='transfer'?'agent':_0x2cd015[_0x1640('0x55')];this[_0x1640('0xb')][_0x2cd015['uniqueid']][_0x3e9698][_0x1640('0x69')]=_0x2cd015[_0x1640('0x69')];if(this['voiceQueues'][_0x2cd015[_0x1640('0x2a')]]&&this[_0x1640('0x29')][_0x2cd015['queue']][_0x1640('0x6a')]){this[_0x1640('0xb')][_0x2cd015['uniqueid']][_0x3e9698]['acwtime']=this[_0x1640('0x29')][_0x2cd015['queue']]['acwTimeout'];this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698][_0x1640('0x6b')]=!![];}this[_0x1640('0xc')][_0x2cd015[_0x1640('0x28')]]=_['omit'](this[_0x1640('0xc')][_0x2cd015[_0x1640('0x28')]],[_0x1640('0x2a'),_0x1640('0x4a')]);logger['debug'](_0x1640('0x6c'),_0x2cd015[_0x1640('0x27')],util[_0x1640('0x36')](this['channels'][_0x2cd015[_0x1640('0x27')]][_0x3e9698],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x1640('0xb')][_0x2cd015[_0x1640('0x27')]][_0x3e9698]);logger[_0x1640('0x34')](_0x1640('0x6d'),_0x2cd015['uniqueid'],util[_0x1640('0x36')]({'id':this[_0x1640('0xc')][_0x2cd015[_0x1640('0x28')]]['id'],'destaccountcode':_0x2cd015[_0x1640('0x6e')]},{'showHidden':![],'depth':null}));this[_0x1640('0x20')](util[_0x1640('0x3a')]('user:%s',_0x2cd015[_0x1640('0x3c')]),_0x1640('0x6f'),{'id':this[_0x1640('0xc')][_0x2cd015[_0x1640('0x28')]]['id'],'destaccountcode':Number(_0x2cd015['destaccountcode'])});}}}}}}catch(_0x2ba8a7){logger[_0x1640('0x59')](_0x1640('0x70'),_0x2cd015['uniqueid'],util[_0x1640('0x36')](_0x2ba8a7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x16')]=function(_0x2f1cab){try{if(this['isNotNull'](_0x2f1cab)){logger[_0x1640('0x34')](_0x1640('0x71'),_0x2f1cab[_0x1640('0x27')],util[_0x1640('0x36')](_0x2f1cab,{'showHidden':![],'depth':null}));this[_0x1640('0x72')](_0x2f1cab[_0x1640('0x27')],_[_0x1640('0x73')](_0x2f1cab[_0x1640('0x74')])[0x0],_0x2f1cab[_0x1640('0x75')]);if(this[_0x1640('0xb')][_0x2f1cab[_0x1640('0x27')]]){for(var _0x1d8548 in this['channels'][_0x2f1cab[_0x1640('0x27')]]){if(this[_0x1640('0xb')][_0x2f1cab[_0x1640('0x27')]][_0x1640('0x3e')](_0x1d8548)){logger[_0x1640('0x23')](_0x1640('0x76'),_0x2f1cab[_0x1640('0x27')],_0x1d8548,_[_0x1640('0x73')](_0x2f1cab[_0x1640('0x74')])[0x0],_0x2f1cab[_0x1640('0x75')]);if(_['isUndefined'](this[_0x1640('0xb')][_0x2f1cab[_0x1640('0x27')]][_0x1d8548]['variables'])){this[_0x1640('0xb')][_0x2f1cab[_0x1640('0x27')]][_0x1d8548]['variables']={};}this[_0x1640('0xb')][_0x2f1cab['uniqueid']][_0x1d8548][_0x1640('0xd')]=this[_0x1640('0xd')][_0x2f1cab['uniqueid']];}}}}}catch(_0x2d4509){logger[_0x1640('0x59')](_0x1640('0x77'),_0x2f1cab[_0x1640('0x27')],util[_0x1640('0x36')](_0x2d4509,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x72')]=function(_0x157fad,_0x5596b2,_0x14ec55){var _0x4fcca7=[_0x1640('0x78'),_0x1640('0x79'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0x1640('0x7a'),_0x1640('0x7b'),_0x1640('0x7c'),_0x1640('0x7d'),_0x1640('0x7e'),_0x1640('0x7f'),_0x1640('0x80'),_0x1640('0x81'),_0x1640('0x82'),_0x1640('0x83'),_0x1640('0x84'),_0x1640('0x3c'),'memberpenalty',_0x1640('0x85')];if(!_[_0x1640('0x86')](_0x5596b2)&&!_[_0x1640('0x87')](_0x4fcca7,_0x5596b2)){if(_['isUndefined'](this[_0x1640('0xd')][_0x157fad])){this[_0x1640('0xd')][_0x157fad]={};}this['variables'][_0x157fad][_0x5596b2]=_0x14ec55;}};VoiceAgentReport[_0x1640('0x1f')]['syncHangup']=function(_0x1129f0){try{if(this['isNotNull'](_0x1129f0)){logger['debug'](_0x1640('0x88'),_0x1129f0[_0x1640('0x27')],util[_0x1640('0x36')](_0x1129f0,{'showHidden':![],'depth':null}));if(this[_0x1640('0xb')][_0x1129f0[_0x1640('0x27')]]){for(var _0x535e55 in this['channels'][_0x1129f0['uniqueid']]){if(this[_0x1640('0xb')][_0x1129f0[_0x1640('0x27')]][_0x1640('0x3e')](_0x535e55)){if(this['channels'][_0x1129f0[_0x1640('0x27')]][_0x535e55][_0x1640('0x55')]=='transfer'&&this[_0x1640('0xb')][_0x1129f0[_0x1640('0x27')]][_0x535e55][_0x1640('0x51')]){logger[_0x1640('0x23')](_0x1640('0x89'),_0x1129f0[_0x1640('0x27')],_0x535e55);this[_0x1640('0xb')][_0x1129f0['uniqueid']][_0x535e55][_0x1640('0x67')]=moment()['format'](_0x1640('0x2b'));}}}logger[_0x1640('0x34')](_0x1640('0x8a'),_0x1129f0['uniqueid'],util[_0x1640('0x36')](_['values'](this[_0x1640('0xb')][_0x1129f0[_0x1640('0x27')]]),{'showHidden':![],'depth':null}));ami[_0x1640('0x20')](_0x1640('0x8b'),_[_0x1640('0x8c')](this[_0x1640('0xb')][_0x1129f0[_0x1640('0x27')]]));delete this[_0x1640('0xb')][_0x1129f0[_0x1640('0x27')]];}if(this[_0x1640('0xd')][_0x1129f0[_0x1640('0x27')]]){delete this['variables'][_0x1129f0[_0x1640('0x27')]];}}}catch(_0x168f4c){logger['error'](_0x1640('0x8d'),_0x1129f0[_0x1640('0x27')],util[_0x1640('0x36')](_0x168f4c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x8e')]=function(_0x5308d3){try{if(this[_0x1640('0x21')](_0x5308d3)){logger[_0x1640('0x34')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x5308d3[_0x1640('0x27')],util[_0x1640('0x36')](_0x5308d3,{'showHidden':![],'depth':null}));if(this[_0x1640('0xb')][_0x5308d3['transfereeuniqueid']]){for(var _0x535789 in this[_0x1640('0xb')][_0x5308d3[_0x1640('0x8f')]]){if(this[_0x1640('0xb')][_0x5308d3[_0x1640('0x8f')]][_0x1640('0x3e')](_0x535789)){if(_0x5308d3['origtransfereruniqueid']===_0x535789){logger[_0x1640('0x23')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5308d3[_0x1640('0x27')],this[_0x1640('0xb')][_0x5308d3['transfereeuniqueid']][_0x535789][_0x1640('0x3c')],_0x535789);var _0x439596=moment();this['channels'][_0x5308d3[_0x1640('0x8f')]][_0x535789][_0x1640('0x51')]=!![];this[_0x1640('0xb')][_0x5308d3[_0x1640('0x8f')]][_0x535789]['agentcompleteAt']=moment()[_0x1640('0x3a')](_0x1640('0x2b'));this[_0x1640('0xb')][_0x5308d3[_0x1640('0x8f')]][_0x535789][_0x1640('0x44')]=_0x1640('0x68');this[_0x1640('0xb')][_0x5308d3[_0x1640('0x8f')]][_0x535789][_0x1640('0x55')]=_0x1640('0x90');this[_0x1640('0xb')][_0x5308d3[_0x1640('0x8f')]][_0x535789]['talktime']=_0x439596['diff'](this[_0x1640('0xb')][_0x5308d3['transfereeuniqueid']][_0x535789][_0x1640('0x66')],_0x1640('0x91'));}}}}if(this[_0x1640('0xb')][_0x5308d3[_0x1640('0x92')]]){var _0xccda3b=this['channels'][_0x5308d3['secondtransfereruniqueid']];this[_0x1640('0xb')][_0x5308d3[_0x1640('0x92')]]=this[_0x1640('0xb')][_0x5308d3['transfereeuniqueid']];this['channels'][_0x5308d3[_0x1640('0x8f')]]=_0xccda3b;}}}catch(_0x408839){logger[_0x1640('0x59')](_0x1640('0x93'),_0x5308d3[_0x1640('0x27')],util[_0x1640('0x36')](_0x408839,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x1e')]=function(_0x4bc385){try{if(this[_0x1640('0x21')](_0x4bc385)){logger[_0x1640('0x34')](_0x1640('0x94'),_0x4bc385[_0x1640('0x27')],util[_0x1640('0x36')](_0x4bc385,{'showHidden':![],'depth':null}));if(this[_0x1640('0xb')][_0x4bc385['transfereeuniqueid']]){for(var _0x1c6a16 in this[_0x1640('0xb')][_0x4bc385[_0x1640('0x8f')]]){if(this['channels'][_0x4bc385['transfereeuniqueid']][_0x1640('0x3e')](_0x1c6a16)){if(_0x4bc385[_0x1640('0x95')]===_0x1c6a16){logger[_0x1640('0x23')](_0x1640('0x96'),_0x4bc385[_0x1640('0x27')],this[_0x1640('0xb')][_0x4bc385['transfereeuniqueid']][_0x1c6a16][_0x1640('0x3c')],_0x1c6a16);var _0x2e1eec=moment();this[_0x1640('0xb')][_0x4bc385[_0x1640('0x8f')]][_0x1c6a16][_0x1640('0x51')]=!![];this[_0x1640('0xb')][_0x4bc385[_0x1640('0x8f')]][_0x1c6a16][_0x1640('0x67')]=_0x2e1eec;this[_0x1640('0xb')][_0x4bc385['transfereeuniqueid']][_0x1c6a16][_0x1640('0x44')]='complete';this[_0x1640('0xb')][_0x4bc385[_0x1640('0x8f')]][_0x1c6a16][_0x1640('0x55')]='transfer';this['channels'][_0x4bc385['transfereeuniqueid']][_0x1c6a16][_0x1640('0x69')]=_0x2e1eec['diff'](this[_0x1640('0xb')][_0x4bc385[_0x1640('0x8f')]][_0x1c6a16]['agentconnectAt'],_0x1640('0x91'));}}}}}}catch(_0x530d46){logger[_0x1640('0x59')](_0x1640('0x97'),_0x4bc385[_0x1640('0x27')],util['inspect'](_0x530d46,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x19')]=function(_0x31e3f3){var _0x9366be='';try{if(this[_0x1640('0x21')](_0x31e3f3)){logger[_0x1640('0x34')](_0x1640('0x98'),_0x31e3f3[_0x1640('0x27')],util['inspect'](_0x31e3f3,{'showHidden':![],'depth':null}));if(_0x31e3f3[_0x1640('0x99')]){_0x9366be=_0x31e3f3[_0x1640('0x99')][_0x1640('0x9a')](0x0,_0x31e3f3['channel'][_0x1640('0x9b')]('-'));if(this['agents'][_0x9366be]){logger[_0x1640('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x31e3f3['uniqueid'],_0x9366be);this[_0x1640('0xc')][_0x9366be][_0x1640('0x9c')]=!![];}}}}catch(_0x2cc3d8){logger[_0x1640('0x59')]('[%s][voiceAgentReport][musiconholdstart]',_0x31e3f3[_0x1640('0x27')],util['inspect'](_0x2cc3d8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1640('0x1f')][_0x1640('0x1b')]=function(_0x53a717){var _0x49e9f7='';try{if(this[_0x1640('0x21')](_0x53a717)){logger[_0x1640('0x34')](_0x1640('0x9d'),_0x53a717['uniqueid'],util[_0x1640('0x36')](_0x53a717,{'showHidden':![],'depth':null}));if(_0x53a717[_0x1640('0x99')]){_0x49e9f7=_0x53a717['channel'][_0x1640('0x9a')](0x0,_0x53a717[_0x1640('0x99')][_0x1640('0x9b')]('-'));if(this[_0x1640('0xc')][_0x49e9f7]){logger['info'](_0x1640('0x9e'),_0x53a717[_0x1640('0x27')],_0x49e9f7);this['agents'][_0x49e9f7][_0x1640('0x9c')]=![];}}}}catch(_0x516cae){logger[_0x1640('0x59')](_0x1640('0x9f'),_0x53a717[_0x1640('0x27')],util['inspect'](_0x516cae,{'showHidden':![],'depth':null}));}};module[_0x1640('0xa0')]=VoiceAgentReport;
\ No newline at end of file
+var _0xf033=['[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','assign','omit','event','privilege','custom:agentcalled','calleridnum','queue','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','error','[%s][voiceAgentReport][agentcalled]','agentconnectAt','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','interface','destconnectedlinenum','name','accountcode','custom:agentconnect','user:%s','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','agentcomplete','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acwtime','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0xf033,0x73));var _0x3f03=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xf033[_0x365e54];return _0x13317a;};'use strict';var _=require(_0x3f03('0x0'));var moment=require(_0x3f03('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x3f03('0x2'));var logger=require(_0x3f03('0x3'))(_0x3f03('0x4'));var ami=require(_0x3f03('0x5'));config[_0x3f03('0x6')]=_['defaults'](config[_0x3f03('0x6')],{'host':_0x3f03('0x7'),'port':0x18eb});var io=require(_0x3f03('0x8'))(new Redis(config[_0x3f03('0x6')]));function VoiceAgentReport(_0x2c268e){this[_0x3f03('0x9')]={};this[_0x3f03('0xa')]=_0x2c268e[_0x3f03('0x9')];this[_0x3f03('0xb')]=_0x2c268e[_0x3f03('0xb')];this['agents']=_0x2c268e[_0x3f03('0xc')];this[_0x3f03('0xd')]={};ami['on'](_0x3f03('0xe'),this[_0x3f03('0xf')][_0x3f03('0x10')](this));ami['on']('agentconnect',this[_0x3f03('0x11')][_0x3f03('0x10')](this));ami['on']('agentringnoanswer',this[_0x3f03('0x12')][_0x3f03('0x10')](this));ami['on'](_0x3f03('0x13'),this[_0x3f03('0x14')][_0x3f03('0x10')](this));ami['on']('agentcomplete',this[_0x3f03('0x15')][_0x3f03('0x10')](this));ami['on'](_0x3f03('0x16'),this[_0x3f03('0x17')][_0x3f03('0x10')](this));ami['on']('hangup',this[_0x3f03('0x18')][_0x3f03('0x10')](this));ami['on']('musiconholdstart',this[_0x3f03('0x19')][_0x3f03('0x10')](this));ami['on'](_0x3f03('0x1a'),this[_0x3f03('0x1b')]['bind'](this));ami['on'](_0x3f03('0x1c'),this[_0x3f03('0x1d')][_0x3f03('0x10')](this));ami['on'](_0x3f03('0x1e'),this[_0x3f03('0x1f')][_0x3f03('0x10')](this));}VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x21')]=function(_0x133eff,_0x3c8d2e,_0x2c0a56){io['to'](_0x133eff)[_0x3f03('0x21')](_0x3c8d2e,_0x2c0a56);};VoiceAgentReport['prototype'][_0x3f03('0x22')]=function(_0xb95c8a){return _0xb95c8a!==null&&!_[_0x3f03('0x23')](_0xb95c8a);};VoiceAgentReport[_0x3f03('0x20')]['syncAgentCalled']=function(_0x5af09d){try{if(this['isNotNull'](_0x5af09d)){logger[_0x3f03('0x24')](_0x3f03('0x25'),_0x5af09d[_0x3f03('0x26')],_0x5af09d[_0x3f03('0x27')],_0x5af09d[_0x3f03('0x28')]);logger[_0x3f03('0x29')](_0x3f03('0x2a'),_0x5af09d[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x5af09d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x3f03('0x9')][_0x5af09d['uniqueid']])){this[_0x3f03('0x9')][_0x5af09d[_0x3f03('0x26')]]={};}var _0x35ab65=this['agents'][_0x5af09d['interface']];var _0x15cc4d=this[_0x3f03('0x9')][_0x5af09d[_0x3f03('0x26')]][_0x5af09d[_0x3f03('0x28')]];var _0x40d06d=this[_0x3f03('0xb')][_0x5af09d['queue']];var _0x43aec5=this[_0x3f03('0xd')][_0x5af09d[_0x3f03('0x26')]];if(_[_0x3f03('0x23')](_0x15cc4d)){_0x15cc4d={'agentcalledAt':moment()[_0x3f03('0x2c')](_0x3f03('0x2d')),'lastevent':_0x3f03('0x2e'),'mandatoryDisposition':_0x40d06d&&_0x40d06d['mandatoryDisposition']?_0x40d06d[_0x3f03('0x2f')]:![],'type':_0x40d06d&&_0x40d06d[_0x3f03('0x30')]?_0x40d06d[_0x3f03('0x30')]:'inbound','variables':_0x43aec5,'motionChannel':'voice'};}Object[_0x3f03('0x31')](_0x15cc4d,_[_0x3f03('0x32')](_0x5af09d,[_0x3f03('0x33'),_0x3f03('0x34')]));this[_0x3f03('0x9')][_0x5af09d['uniqueid']][_0x5af09d[_0x3f03('0x28')]]=_0x15cc4d;logger[_0x3f03('0x29')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x5af09d[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x15cc4d,{'showHidden':![],'depth':null}));ami[_0x3f03('0x21')](_0x3f03('0x35'),_0x15cc4d);var _0x4557ed={'id':_0x35ab65['id'],'calleridnum':_0x15cc4d[_0x3f03('0x36')],'queue':_0x15cc4d[_0x3f03('0x37')],'variables':_0x15cc4d[_0x3f03('0xd')],'uniqueid':_0x5af09d['uniqueid']};logger['debug'](_0x3f03('0x38'),_0x5af09d[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x4557ed,{'showHidden':![],'depth':null}));this[_0x3f03('0x21')](util['format']('user:%s',_0x5af09d[_0x3f03('0x27')]),'user:called',_0x4557ed);}}catch(_0x3ef289){logger[_0x3f03('0x39')](_0x3f03('0x3a'),_0x5af09d[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x3ef289,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x11')]=function(_0x2e1ee8){try{if(this[_0x3f03('0x22')](_0x2e1ee8)){if(this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]]){for(var _0x4bc88d in this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]]){if(this['channels'][_0x2e1ee8[_0x3f03('0x26')]]['hasOwnProperty'](_0x4bc88d)){if(_0x2e1ee8['destuniqueid']===_0x4bc88d){logger[_0x3f03('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2e1ee8[_0x3f03('0x26')],_0x2e1ee8[_0x3f03('0x27')],_0x2e1ee8[_0x3f03('0x28')]);this['channels'][_0x2e1ee8['uniqueid']][_0x4bc88d][_0x3f03('0x3b')]=moment()[_0x3f03('0x2c')](_0x3f03('0x2d'));this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x3c')]=_0x2e1ee8[_0x3f03('0x3c')];this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d]['connectedlinenum']=_0x2e1ee8[_0x3f03('0x3d')];this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d]['destchannelstate']=_0x2e1ee8['destchannelstate'];this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x3e')]=_0x2e1ee8[_0x3f03('0x3e')];this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x3f')]=_0x2e1ee8['holdtime'];this[_0x3f03('0x9')][_0x2e1ee8['uniqueid']][_0x4bc88d][_0x3f03('0x40')]=_0x3f03('0x41');if(this[_0x3f03('0xa')][this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x26')]]){var _0x422185=this[_0x3f03('0xa')][this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x26')]][_0x3f03('0x42')];this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x42')]=_0x422185;_0x2e1ee8[_0x3f03('0x42')]=_0x422185;}_[_0x3f03('0x43')](this['agents'][_0x2e1ee8[_0x3f03('0x44')]],_['pick'](_0x2e1ee8,[_0x3f03('0x37'),_0x3f03('0x45'),_0x3f03('0x42')]));var _0x5a8ecf=this[_0x3f03('0xc')][_0x2e1ee8[_0x3f03('0x44')]];var _0x1d3643={'id':_0x5a8ecf['id'],'name':_0x5a8ecf[_0x3f03('0x46')],'agentconnected':!![],'destaccountcode':_0x5a8ecf[_0x3f03('0x47')],'destconnectedlinenum':this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x2e1ee8[_0x3f03('0x28')]]['exten'],'queue':this[_0x3f03('0x9')][_0x2e1ee8['uniqueid']][_0x2e1ee8[_0x3f03('0x28')]][_0x3f03('0x37')],'routealias':this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x2e1ee8[_0x3f03('0x28')]]['routealias'],'uniqueid':this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x2e1ee8[_0x3f03('0x28')]]['uniqueid']};ami[_0x3f03('0x21')](_0x3f03('0x48'),this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x2e1ee8[_0x3f03('0x28')]]);this[_0x3f03('0x21')](util['format'](_0x3f03('0x49'),_0x2e1ee8[_0x3f03('0x27')]),'user:agentconnect',_0x1d3643);}else if(!this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x4a')]&&!this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d]['agentcomplete']){logger[_0x3f03('0x24')](_0x3f03('0x4b'),_0x2e1ee8[_0x3f03('0x26')],this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x27')],_0x4bc88d);this['channels'][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x4a')]=!![];this[_0x3f03('0x9')][_0x2e1ee8['uniqueid']][_0x4bc88d][_0x3f03('0x4c')]=moment()[_0x3f03('0x2c')](_0x3f03('0x2d'));this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x4d')]=_0x2e1ee8[_0x3f03('0x28')];this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d][_0x3f03('0x4e')]=_0x2e1ee8[_0x3f03('0x27')];this[_0x3f03('0x9')][_0x2e1ee8['uniqueid']][_0x4bc88d][_0x3f03('0x40')]=_0x3f03('0x4f');this[_0x3f03('0x9')][_0x2e1ee8['uniqueid']][_0x4bc88d][_0x3f03('0x50')]='answered_elsewhere';logger[_0x3f03('0x29')](_0x3f03('0x51'),_0x2e1ee8['uniqueid'],util[_0x3f03('0x2b')](this['channels'][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d],{'showHidden':![],'depth':null}));ami[_0x3f03('0x21')]('custom:agentansweredelsewhere',this[_0x3f03('0x9')][_0x2e1ee8[_0x3f03('0x26')]][_0x4bc88d]);}else{logger['debug'](_0x3f03('0x52'),_0x2e1ee8[_0x3f03('0x26')]);}}}}}}catch(_0x35b3b4){logger[_0x3f03('0x39')](_0x3f03('0x53'),_0x2e1ee8['uniqueid'],util['inspect'](_0x35b3b4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')]['syncAgentRingNoAnswer']=function(_0x3244c6){try{if(this[_0x3f03('0x22')](_0x3244c6)){logger[_0x3f03('0x29')](_0x3f03('0x54'),_0x3244c6[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x3244c6,{'showHidden':![],'depth':null}));if(this['channels'][_0x3244c6['uniqueid']]&&this[_0x3f03('0x9')][_0x3244c6[_0x3f03('0x26')]][_0x3244c6[_0x3f03('0x28')]]){logger[_0x3f03('0x24')](_0x3f03('0x55'),_0x3244c6[_0x3f03('0x26')],_0x3244c6[_0x3f03('0x27')],_0x3244c6[_0x3f03('0x28')]);var _0x402ed2=this[_0x3f03('0xc')][_0x3244c6[_0x3f03('0x44')]];var _0x38b6e2=this['channels'][_0x3244c6[_0x3f03('0x26')]][_0x3244c6[_0x3f03('0x28')]];_0x38b6e2['agentringnoanswer']=!![];_0x38b6e2[_0x3f03('0x4c')]=moment()[_0x3f03('0x2c')](_0x3f03('0x2d'));_0x38b6e2[_0x3f03('0x40')]=_0x3f03('0x56');_0x38b6e2[_0x3f03('0x50')]='rejected';var _0x4ee206={'id':_0x402ed2['id'],'name':_0x402ed2[_0x3f03('0x46')],'queue':_0x38b6e2['queue'],'uniqueid':_0x38b6e2['uniqueid']};logger[_0x3f03('0x29')](_0x3f03('0x57'),_0x3244c6[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x4ee206,{'showHidden':![],'depth':null}));this[_0x3f03('0x21')](util[_0x3f03('0x2c')](_0x3f03('0x49'),_0x402ed2[_0x3f03('0x46')]),_0x3f03('0x58'),_0x4ee206);ami[_0x3f03('0x21')](_0x3f03('0x59'),_0x38b6e2);this[_0x3f03('0x9')][_0x3244c6[_0x3f03('0x26')]][_0x3244c6[_0x3f03('0x28')]]=Object['assign']({},_0x38b6e2);}}}catch(_0x1f4eff){logger[_0x3f03('0x39')](_0x3f03('0x5a'),_0x3244c6['uniqueid'],util[_0x3f03('0x2b')](_0x1f4eff,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x52a2b6){try{if(this['isNotNull'](_0x52a2b6)){logger[_0x3f03('0x29')](_0x3f03('0x5b'),_0x52a2b6['uniqueid'],util['inspect'](_0x52a2b6,{'showHidden':![],'depth':null}));if(this['channels'][_0x52a2b6[_0x3f03('0x26')]]){for(var _0x731345 in this[_0x3f03('0x9')][_0x52a2b6[_0x3f03('0x26')]]){if(this[_0x3f03('0x9')][_0x52a2b6['uniqueid']][_0x3f03('0x5c')](_0x731345)&&!this[_0x3f03('0x9')][_0x52a2b6[_0x3f03('0x26')]][_0x731345][_0x3f03('0x4a')]&&!this[_0x3f03('0x9')][_0x52a2b6['uniqueid']][_0x731345][_0x3f03('0x5d')]){logger[_0x3f03('0x24')](_0x3f03('0x5e'),_0x52a2b6[_0x3f03('0x26')],this[_0x3f03('0x9')][_0x52a2b6[_0x3f03('0x26')]][_0x731345][_0x3f03('0x27')],_0x731345);this['channels'][_0x52a2b6[_0x3f03('0x26')]][_0x731345][_0x3f03('0x4a')]=!![];this[_0x3f03('0x9')][_0x52a2b6[_0x3f03('0x26')]][_0x731345][_0x3f03('0x4c')]=moment()[_0x3f03('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3f03('0x9')][_0x52a2b6['uniqueid']][_0x731345][_0x3f03('0x40')]='abandoned';this[_0x3f03('0x9')][_0x52a2b6[_0x3f03('0x26')]][_0x731345][_0x3f03('0x50')]=_0x3f03('0x5f');logger['debug'](_0x3f03('0x60'),_0x52a2b6[_0x3f03('0x26')],util[_0x3f03('0x2b')](this['channels'][_0x52a2b6[_0x3f03('0x26')]][_0x731345],{'showHidden':![],'depth':null}));ami['emit'](_0x3f03('0x61'),this[_0x3f03('0x9')][_0x52a2b6[_0x3f03('0x26')]][_0x731345]);}}}}}catch(_0x2a371d){logger[_0x3f03('0x39')](_0x3f03('0x62'),_0x52a2b6[_0x3f03('0x26')],util['inspect'](_0x2a371d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x15')]=function(_0x450823){try{if(this[_0x3f03('0x22')](_0x450823)){logger[_0x3f03('0x29')](_0x3f03('0x63'),_0x450823[_0x3f03('0x26')],util['inspect'](_0x450823,{'showHidden':![],'depth':null}));if(this['channels'][_0x450823['uniqueid']]){for(var _0x2854b2 in this[_0x3f03('0x9')][_0x450823['uniqueid']]){if(this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x3f03('0x5c')](_0x2854b2)){if(this['channels'][_0x450823[_0x3f03('0x26')]][_0x2854b2]['agentconnectAt']&&!this[_0x3f03('0x9')][_0x450823['uniqueid']][_0x2854b2][_0x3f03('0x5d')]){logger[_0x3f03('0x24')](_0x3f03('0x64'),_0x450823[_0x3f03('0x26')],this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x2854b2]['membername'],_0x2854b2);this['channels'][_0x450823['uniqueid']][_0x2854b2][_0x3f03('0x5d')]=!![];this['channels'][_0x450823[_0x3f03('0x26')]][_0x2854b2][_0x3f03('0x65')]=moment()[_0x3f03('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x2854b2][_0x3f03('0x40')]=_0x3f03('0x66');this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x2854b2][_0x3f03('0x50')]=_0x450823['reason']=='transfer'?_0x3f03('0x67'):_0x450823[_0x3f03('0x50')];this[_0x3f03('0x9')][_0x450823['uniqueid']][_0x2854b2][_0x3f03('0x68')]=_0x450823[_0x3f03('0x68')];if(this['voiceQueues'][_0x450823['queue']]&&this[_0x3f03('0xb')][_0x450823['queue']]['acw']){this['channels'][_0x450823['uniqueid']][_0x2854b2][_0x3f03('0x69')]=this['voiceQueues'][_0x450823[_0x3f03('0x37')]]['acwTimeout'];this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x2854b2][_0x3f03('0x6a')]=!![];}this[_0x3f03('0xc')][_0x450823[_0x3f03('0x44')]]=_[_0x3f03('0x32')](this[_0x3f03('0xc')][_0x450823[_0x3f03('0x44')]],[_0x3f03('0x37'),_0x3f03('0x45')]);logger[_0x3f03('0x29')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x450823[_0x3f03('0x26')],util[_0x3f03('0x2b')](this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x2854b2],{'showHidden':![],'depth':null}));ami[_0x3f03('0x21')](_0x3f03('0x6b'),this[_0x3f03('0x9')][_0x450823[_0x3f03('0x26')]][_0x2854b2]);logger[_0x3f03('0x29')](_0x3f03('0x6c'),_0x450823[_0x3f03('0x26')],util[_0x3f03('0x2b')]({'id':this['agents'][_0x450823[_0x3f03('0x44')]]['id'],'destaccountcode':_0x450823['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x3f03('0x21')](util[_0x3f03('0x2c')](_0x3f03('0x49'),_0x450823[_0x3f03('0x27')]),_0x3f03('0x6d'),{'id':this[_0x3f03('0xc')][_0x450823['interface']]['id'],'destaccountcode':Number(_0x450823[_0x3f03('0x6e')])});}}}}}}catch(_0x585ac2){logger[_0x3f03('0x39')]('[%s][voiceAgentReport][agentcomplete]',_0x450823[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x585ac2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x17')]=function(_0x9856b1){try{if(this[_0x3f03('0x22')](_0x9856b1)){logger[_0x3f03('0x29')]('[%s][voiceAgentReport][varset]\x20event:',_0x9856b1[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x9856b1,{'showHidden':![],'depth':null}));this['addVariable'](_0x9856b1[_0x3f03('0x26')],_['keys'](_0x9856b1[_0x3f03('0x6f')])[0x0],_0x9856b1[_0x3f03('0x70')]);if(this[_0x3f03('0x9')][_0x9856b1['uniqueid']]){for(var _0x4db06e in this[_0x3f03('0x9')][_0x9856b1[_0x3f03('0x26')]]){if(this[_0x3f03('0x9')][_0x9856b1[_0x3f03('0x26')]][_0x3f03('0x5c')](_0x4db06e)){logger[_0x3f03('0x24')](_0x3f03('0x71'),_0x9856b1[_0x3f03('0x26')],_0x4db06e,_[_0x3f03('0x72')](_0x9856b1[_0x3f03('0x6f')])[0x0],_0x9856b1[_0x3f03('0x70')]);if(_[_0x3f03('0x23')](this[_0x3f03('0x9')][_0x9856b1[_0x3f03('0x26')]][_0x4db06e][_0x3f03('0xd')])){this[_0x3f03('0x9')][_0x9856b1[_0x3f03('0x26')]][_0x4db06e][_0x3f03('0xd')]={};}this[_0x3f03('0x9')][_0x9856b1[_0x3f03('0x26')]][_0x4db06e][_0x3f03('0xd')]=this['variables'][_0x9856b1[_0x3f03('0x26')]];}}}}}catch(_0x56244b){logger['error'](_0x3f03('0x73'),_0x9856b1[_0x3f03('0x26')],util['inspect'](_0x56244b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3f03('0x74')]=function(_0x8e3465,_0x24aeea,_0x535e8d){var _0x369543=[_0x3f03('0x75'),_0x3f03('0x76'),_0x3f03('0x77'),_0x3f03('0x78'),_0x3f03('0x79'),_0x3f03('0x7a'),'rtpaudioqosrtt',_0x3f03('0x7b'),'sipcallid','sipuri',_0x3f03('0x7c'),_0x3f03('0x7d'),_0x3f03('0x7e'),_0x3f03('0x7f'),_0x3f03('0x80'),_0x3f03('0x81'),_0x3f03('0x27'),_0x3f03('0x82'),_0x3f03('0x83')];if(!_[_0x3f03('0x84')](_0x24aeea)&&!_[_0x3f03('0x85')](_0x369543,_0x24aeea)){if(_['isUndefined'](this[_0x3f03('0xd')][_0x8e3465])){this['variables'][_0x8e3465]={};}this['variables'][_0x8e3465][_0x24aeea]=_0x535e8d;}};VoiceAgentReport[_0x3f03('0x20')]['syncHangup']=function(_0x1dafdd){try{if(this['isNotNull'](_0x1dafdd)){logger[_0x3f03('0x29')](_0x3f03('0x86'),_0x1dafdd[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x1dafdd,{'showHidden':![],'depth':null}));if(this[_0x3f03('0x9')][_0x1dafdd[_0x3f03('0x26')]]){for(var _0x163f52 in this[_0x3f03('0x9')][_0x1dafdd[_0x3f03('0x26')]]){if(this[_0x3f03('0x9')][_0x1dafdd[_0x3f03('0x26')]][_0x3f03('0x5c')](_0x163f52)){if(this[_0x3f03('0x9')][_0x1dafdd['uniqueid']][_0x163f52][_0x3f03('0x50')]==_0x3f03('0x87')&&this['channels'][_0x1dafdd['uniqueid']][_0x163f52][_0x3f03('0x5d')]){logger[_0x3f03('0x24')](_0x3f03('0x88'),_0x1dafdd[_0x3f03('0x26')],_0x163f52);this['channels'][_0x1dafdd[_0x3f03('0x26')]][_0x163f52][_0x3f03('0x65')]=moment()[_0x3f03('0x2c')](_0x3f03('0x2d'));}}}logger[_0x3f03('0x29')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x1dafdd[_0x3f03('0x26')],util[_0x3f03('0x2b')](_[_0x3f03('0x89')](this['channels'][_0x1dafdd[_0x3f03('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x3f03('0x21')](_0x3f03('0x8a'),_['values'](this['channels'][_0x1dafdd[_0x3f03('0x26')]]));delete this[_0x3f03('0x9')][_0x1dafdd[_0x3f03('0x26')]];}if(this[_0x3f03('0xd')][_0x1dafdd[_0x3f03('0x26')]]){delete this[_0x3f03('0xd')][_0x1dafdd[_0x3f03('0x26')]];}}}catch(_0x3da587){logger['error'](_0x3f03('0x8b'),_0x1dafdd[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x3da587,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3f03('0x1d')]=function(_0x3930aa){try{if(this[_0x3f03('0x22')](_0x3930aa)){logger[_0x3f03('0x29')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x3930aa[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x3930aa,{'showHidden':![],'depth':null}));if(this[_0x3f03('0x9')][_0x3930aa[_0x3f03('0x8c')]]){for(var _0x25b322 in this[_0x3f03('0x9')][_0x3930aa['transfereeuniqueid']]){if(this['channels'][_0x3930aa['transfereeuniqueid']]['hasOwnProperty'](_0x25b322)){if(_0x3930aa['origtransfereruniqueid']===_0x25b322){logger[_0x3f03('0x24')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3930aa[_0x3f03('0x26')],this['channels'][_0x3930aa['transfereeuniqueid']][_0x25b322][_0x3f03('0x27')],_0x25b322);var _0x10096c=moment();this['channels'][_0x3930aa[_0x3f03('0x8c')]][_0x25b322]['agentcomplete']=!![];this[_0x3f03('0x9')][_0x3930aa[_0x3f03('0x8c')]][_0x25b322]['agentcompleteAt']=moment()['format'](_0x3f03('0x2d'));this[_0x3f03('0x9')][_0x3930aa[_0x3f03('0x8c')]][_0x25b322][_0x3f03('0x40')]=_0x3f03('0x66');this[_0x3f03('0x9')][_0x3930aa[_0x3f03('0x8c')]][_0x25b322]['reason']=_0x3f03('0x87');this['channels'][_0x3930aa[_0x3f03('0x8c')]][_0x25b322][_0x3f03('0x68')]=_0x10096c[_0x3f03('0x8d')](this[_0x3f03('0x9')][_0x3930aa['transfereeuniqueid']][_0x25b322][_0x3f03('0x3b')],_0x3f03('0x8e'));}}}}if(this['channels'][_0x3930aa[_0x3f03('0x8f')]]){var _0x240ba0=this[_0x3f03('0x9')][_0x3930aa[_0x3f03('0x8f')]];this[_0x3f03('0x9')][_0x3930aa[_0x3f03('0x8f')]]=this['channels'][_0x3930aa['transfereeuniqueid']];this['channels'][_0x3930aa[_0x3f03('0x8c')]]=_0x240ba0;}}}catch(_0x3e9538){logger[_0x3f03('0x39')](_0x3f03('0x90'),_0x3930aa[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x3e9538,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x1f')]=function(_0x282e34){try{if(this[_0x3f03('0x22')](_0x282e34)){logger[_0x3f03('0x29')](_0x3f03('0x91'),_0x282e34[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x282e34,{'showHidden':![],'depth':null}));if(this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]]){for(var _0x18ae9e in this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]]){if(this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]][_0x3f03('0x5c')](_0x18ae9e)){if(_0x282e34[_0x3f03('0x92')]===_0x18ae9e){logger[_0x3f03('0x24')](_0x3f03('0x93'),_0x282e34[_0x3f03('0x26')],this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]][_0x18ae9e][_0x3f03('0x27')],_0x18ae9e);var _0x553801=moment();this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]][_0x18ae9e][_0x3f03('0x5d')]=!![];this[_0x3f03('0x9')][_0x282e34['transfereeuniqueid']][_0x18ae9e][_0x3f03('0x65')]=_0x553801;this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]][_0x18ae9e][_0x3f03('0x40')]=_0x3f03('0x66');this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]][_0x18ae9e][_0x3f03('0x50')]='transfer';this[_0x3f03('0x9')][_0x282e34[_0x3f03('0x8c')]][_0x18ae9e][_0x3f03('0x68')]=_0x553801['diff'](this[_0x3f03('0x9')][_0x282e34['transfereeuniqueid']][_0x18ae9e]['agentconnectAt'],_0x3f03('0x8e'));}}}}}}catch(_0x19afe0){logger[_0x3f03('0x39')]('[%s][voiceAgentReport][blindtransfer]',_0x282e34['uniqueid'],util[_0x3f03('0x2b')](_0x19afe0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x19')]=function(_0x2129c1){var _0x278191='';try{if(this[_0x3f03('0x22')](_0x2129c1)){logger[_0x3f03('0x29')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x2129c1['uniqueid'],util[_0x3f03('0x2b')](_0x2129c1,{'showHidden':![],'depth':null}));if(_0x2129c1[_0x3f03('0x94')]){_0x278191=_0x2129c1[_0x3f03('0x94')][_0x3f03('0x95')](0x0,_0x2129c1['channel'][_0x3f03('0x96')]('-'));if(this[_0x3f03('0xc')][_0x278191]){logger[_0x3f03('0x24')](_0x3f03('0x97'),_0x2129c1[_0x3f03('0x26')],_0x278191);this['agents'][_0x278191][_0x3f03('0x98')]=!![];}}}}catch(_0x37a521){logger[_0x3f03('0x39')](_0x3f03('0x99'),_0x2129c1[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x37a521,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3f03('0x20')][_0x3f03('0x1b')]=function(_0x2bf201){var _0x1f7a6d='';try{if(this[_0x3f03('0x22')](_0x2bf201)){logger[_0x3f03('0x29')](_0x3f03('0x9a'),_0x2bf201[_0x3f03('0x26')],util[_0x3f03('0x2b')](_0x2bf201,{'showHidden':![],'depth':null}));if(_0x2bf201['channel']){_0x1f7a6d=_0x2bf201['channel'][_0x3f03('0x95')](0x0,_0x2bf201[_0x3f03('0x94')]['lastIndexOf']('-'));if(this[_0x3f03('0xc')][_0x1f7a6d]){logger[_0x3f03('0x24')](_0x3f03('0x9b'),_0x2bf201[_0x3f03('0x26')],_0x1f7a6d);this[_0x3f03('0xc')][_0x1f7a6d][_0x3f03('0x98')]=![];}}}}catch(_0x203afd){logger[_0x3f03('0x39')](_0x3f03('0x9c'),_0x2bf201['uniqueid'],util[_0x3f03('0x2b')](_0x203afd,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6e0=['applicationdata','appdata','startsWith','queue','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','set','cdr(','type','isNil','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','channelstate','answered','answertime','diff','connectedlinename','UserId','membername','destinationchannel','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','user:agentcomplete','transferType','then','transferToInternal','getSettings','resolve','Action','StopMixMonitor','finally','webbar:stopmonitors','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','syncNewExten','newchannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','pick','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application'];(function(_0x1887e1,_0x424c4a){var _0x43ac15=function(_0x1084af){while(--_0x1084af){_0x1887e1['push'](_0x1887e1['shift']());}};_0x43ac15(++_0x424c4a);}(_0xb6e0,0x1df));var _0x0b6e=function(_0x1383ee,_0x14aa2f){_0x1383ee=_0x1383ee-0x0;var _0x526b41=_0xb6e0[_0x1383ee];return _0x526b41;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x0b6e('0x0'));var path=require(_0x0b6e('0x1'));var Redis=require(_0x0b6e('0x2'));var config=require(_0x0b6e('0x3'));var logger=require(_0x0b6e('0x4'))(_0x0b6e('0x5'));var ami=require(_0x0b6e('0x6'));var Channel=require(_0x0b6e('0x7'));var RpcSetting=require('../rpc/setting');var applications=['set','queue','agi','dial','playback','voicemail'];var dispositions=[_0x0b6e('0x8'),'FAILED',_0x0b6e('0x9'),'NO\x20ANSWER',_0x0b6e('0x8'),_0x0b6e('0x8'),_0x0b6e('0xa'),_0x0b6e('0xb'),_0x0b6e('0x9'),_0x0b6e('0x9'),_0x0b6e('0x9')];config[_0x0b6e('0xc')]=_['defaults'](config['redis'],{'host':_0x0b6e('0xd'),'port':0x18eb});var io=require(_0x0b6e('0xe'))(new Redis(config[_0x0b6e('0xc')]));function VoiceCallReport(_0x8fe8d9){this[_0x0b6e('0xf')]=_0x8fe8d9[_0x0b6e('0xf')];this['agents']=_0x8fe8d9[_0x0b6e('0x10')];this[_0x0b6e('0x11')]={};ami['on'](_0x0b6e('0x12'),this['syncNewExten'][_0x0b6e('0x13')](this));ami['on']('newexten',this[_0x0b6e('0x14')][_0x0b6e('0x13')](this));ami['on'](_0x0b6e('0x15'),this['syncNewChannel'][_0x0b6e('0x13')](this));ami['on'](_0x0b6e('0x16'),this['syncNewState']['bind'](this));ami['on'](_0x0b6e('0x17'),this[_0x0b6e('0x18')][_0x0b6e('0x13')](this));ami['on'](_0x0b6e('0x19'),this[_0x0b6e('0x1a')][_0x0b6e('0x13')](this));ami['on'](_0x0b6e('0x1b'),this['syncNewCallerId'][_0x0b6e('0x13')](this));ami['on'](_0x0b6e('0x1c'),this[_0x0b6e('0x1d')][_0x0b6e('0x13')](this));ami['on']('blindtransfer',this[_0x0b6e('0x1e')][_0x0b6e('0x13')](this));ami['on']('musiconholdstart',this[_0x0b6e('0x1f')][_0x0b6e('0x13')](this));ami['on'](_0x0b6e('0x20'),this[_0x0b6e('0x21')][_0x0b6e('0x13')](this));try{logger[_0x0b6e('0x22')](_0x0b6e('0x23'));ami['actionCoreShowChannels']();}catch(_0x5d95f6){logger[_0x0b6e('0x24')](_0x0b6e('0x25'),util['inspect'](_0x5d95f6,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x27')]=function(_0x4ececb){return _0x4ececb!==null&&!_[_0x0b6e('0x28')](_0x4ececb);};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x29')]=function(_0x2f93bf,_0x20378b,_0x515b7c){io['to'](_0x2f93bf)['emit'](_0x20378b,_0x515b7c);};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x2a')]=function(_0x231928){try{if(this['isNotNull'](_0x231928)){logger[_0x0b6e('0x22')](_0x0b6e('0x2b'),_0x231928[_0x0b6e('0x2c')],_0x231928[_0x0b6e('0x2d')],_0x231928['calleridnum']);logger[_0x0b6e('0x2e')](_0x0b6e('0x2f'),_0x231928[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x231928,{'showHidden':![],'depth':null}));if(_0x231928[_0x0b6e('0x2c')]===_0x231928[_0x0b6e('0x31')]){if(!_[_0x0b6e('0x28')](this[_0x0b6e('0xf')][_0x231928[_0x0b6e('0x2c')]])){_[_0x0b6e('0x32')](this[_0x0b6e('0xf')][_0x231928[_0x0b6e('0x2c')]],_[_0x0b6e('0x33')](_0x231928,_[_0x0b6e('0x34')](this['channels'][_0x231928[_0x0b6e('0x2c')]])));}}if(_0x231928['context']===_0x0b6e('0x35')){var _0x26a9e0=this[_0x0b6e('0x10')][_0x231928[_0x0b6e('0x36')][_0x0b6e('0x37')]('-')[0x0]];if(_0x26a9e0){if(_0x231928[_0x0b6e('0x38')]==_0x0b6e('0x39')){_0x26a9e0[_0x0b6e('0x3a')]=_0x231928[_0x0b6e('0x3b')];this[_0x0b6e('0x29')](util[_0x0b6e('0x3c')](_0x0b6e('0x3d'),_0x26a9e0['name']),_0x0b6e('0x3e'),{'id':_0x26a9e0['id'],'destaccountcode':_0x26a9e0[_0x0b6e('0x3f')],'destconnectedlinenum':_0x231928[_0x0b6e('0x3b')]});}}}}}catch(_0x2d37ed){logger['error'](_0x0b6e('0x40'),_0x231928['uniqueid'],util[_0x0b6e('0x30')](_0x2d37ed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x41')]=function(_0x3389b){try{if(this[_0x0b6e('0x27')](_0x3389b)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x3389b[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x3389b,{'showHidden':![],'depth':null}));if(this['channels'][_0x3389b['uniqueid']]){return;}if(_0x3389b[_0x0b6e('0x36')]===_0x0b6e('0x42')){return;}if(_0x3389b[_0x0b6e('0x2c')]!==_0x3389b['linkedid']&&!this[_0x0b6e('0x11')][_0x3389b[_0x0b6e('0x31')]]){return;}logger['info'](_0x0b6e('0x43'),_0x3389b[_0x0b6e('0x2c')],_0x3389b[_0x0b6e('0x44')],_0x3389b[_0x0b6e('0x38')]);this[_0x0b6e('0xf')][_0x3389b[_0x0b6e('0x2c')]]=new Channel();this[_0x0b6e('0xf')][_0x3389b['uniqueid']][_0x0b6e('0x45')]=moment()['format'](_0x0b6e('0x46'));this['channels'][_0x3389b[_0x0b6e('0x2c')]][_0x0b6e('0x47')]=dispositions[_[_0x0b6e('0x48')](_0x3389b['channelstate'])];_[_0x0b6e('0x32')](this[_0x0b6e('0xf')][_0x3389b['uniqueid']],_['pick'](_0x3389b,_[_0x0b6e('0x34')](this[_0x0b6e('0xf')][_0x3389b['uniqueid']])));if(_0x3389b[_0x0b6e('0x44')]==='from-sip'){var _0x1990f1=this[_0x0b6e('0x10')][_0x3389b['channel'][_0x0b6e('0x37')]('-')[0x0]];if(_0x1990f1&&typeof _0x1990f1[_0x0b6e('0x3a')]===_0x0b6e('0x49')){_0x1990f1[_0x0b6e('0x3a')]=_0x3389b[_0x0b6e('0x38')];logger[_0x0b6e('0x2e')](_0x0b6e('0x4a'),_0x3389b[_0x0b6e('0x2c')],util[_0x0b6e('0x30')]({'id':_0x1990f1['id'],'destaccountcode':_0x1990f1['accountcode'],'destconnectedlinenum':_0x3389b[_0x0b6e('0x38')]},{'showHidden':![],'depth':null}));this[_0x0b6e('0x29')](util[_0x0b6e('0x3c')](_0x0b6e('0x3d'),_0x1990f1[_0x0b6e('0x4b')]),_0x0b6e('0x3e'),{'id':_0x1990f1['id'],'destaccountcode':_0x1990f1['accountcode'],'destconnectedlinenum':_0x3389b[_0x0b6e('0x38')]});}}}}catch(_0x30ee89){logger[_0x0b6e('0x24')](_0x0b6e('0x4c'),_0x3389b[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x30ee89,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0b6e('0x14')]=function(_0x3bf2e9){try{if(this['isNotNull'](_0x3bf2e9)){logger['debug'](_0x0b6e('0x4d'),_0x3bf2e9[_0x0b6e('0x2c')],util['inspect'](_0x3bf2e9,{'showHidden':![],'depth':null}));if(_0x3bf2e9[_0x0b6e('0x36')]===_0x0b6e('0x42')||_0x3bf2e9[_0x0b6e('0x38')]==='h')return;if(_0x3bf2e9[_0x0b6e('0x2c')]===_0x3bf2e9['linkedid']||this['blindTransfers'][_0x3bf2e9['linkedid']]){_0x3bf2e9[_0x0b6e('0x4e')]=_0x3bf2e9[_0x0b6e('0x4e')]?_0x3bf2e9['application']['toLowerCase']():undefined;_0x3bf2e9[_0x0b6e('0x4f')]=_0x3bf2e9[_0x0b6e('0x50')]||_0x3bf2e9['applicationdata'];if(_0x3bf2e9['appdata']&&!_0x3bf2e9[_0x0b6e('0x50')][_0x0b6e('0x51')]('CDR(routeAlias)')&&_0x3bf2e9[_0x0b6e('0x4e')]!==_0x0b6e('0x52')){_0x3bf2e9[_0x0b6e('0x4f')]=_0x3bf2e9[_0x0b6e('0x4f')][_0x0b6e('0x53')]();}logger[_0x0b6e('0x22')](_0x0b6e('0x54'),_0x3bf2e9[_0x0b6e('0x2c')],_0x3bf2e9['application'],_0x3bf2e9['applicationdata']);if(_[_0x0b6e('0x28')](this['channels'][_0x3bf2e9['uniqueid']])){this[_0x0b6e('0xf')][_0x3bf2e9[_0x0b6e('0x2c')]]=new Channel();this[_0x0b6e('0xf')][_0x3bf2e9[_0x0b6e('0x2c')]][_0x0b6e('0x45')]=_0x3bf2e9['duration']?moment()['subtract'](moment['duration'](_0x3bf2e9[_0x0b6e('0x55')])['seconds'](),_0x0b6e('0x56'))[_0x0b6e('0x3c')](_0x0b6e('0x46')):moment()[_0x0b6e('0x3c')](_0x0b6e('0x46'));this[_0x0b6e('0xf')][_0x3bf2e9['uniqueid']][_0x0b6e('0x47')]=_0x0b6e('0x8');}_[_0x0b6e('0x32')](this['channels'][_0x3bf2e9[_0x0b6e('0x2c')]],_['pick'](_0x3bf2e9,_[_0x0b6e('0x34')](this[_0x0b6e('0xf')][_0x3bf2e9[_0x0b6e('0x2c')]])));if(_[_0x0b6e('0x57')](applications,_0x3bf2e9[_0x0b6e('0x4e')])){this[_0x0b6e('0xf')][_0x3bf2e9[_0x0b6e('0x2c')]]['lastapplication']=_0x3bf2e9[_0x0b6e('0x4e')];this[_0x0b6e('0xf')][_0x3bf2e9[_0x0b6e('0x2c')]]['lastdata']=_0x3bf2e9[_0x0b6e('0x4f')];if(_0x3bf2e9['application']===_0x0b6e('0x58')&&_[_0x0b6e('0x51')](_0x3bf2e9[_0x0b6e('0x4f')][_0x0b6e('0x53')](),_0x0b6e('0x59'))){var _0x4d8e47=_0x3bf2e9[_0x0b6e('0x4f')][_0x0b6e('0x37')]('=');var _0x539e2b=_0x4d8e47[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x539e2b){if(_0x539e2b[0x1]===_0x0b6e('0x5a')&&!_[_0x0b6e('0x5b')](this['channels'][_0x3bf2e9[_0x0b6e('0x2c')]][_0x539e2b[0x1]]))return;this[_0x0b6e('0xf')][_0x3bf2e9['uniqueid']][_0x539e2b[0x1]]=_0x4d8e47[0x1];}}else if(_0x3bf2e9[_0x0b6e('0x4e')]===_0x0b6e('0x52')){this[_0x0b6e('0xf')][_0x3bf2e9[_0x0b6e('0x2c')]]['queue']=_0x3bf2e9[_0x0b6e('0x4f')][_0x0b6e('0x37')](',')[0x0];}}}}}catch(_0x3f6b8d){logger[_0x0b6e('0x24')](_0x0b6e('0x5c'),_0x3bf2e9[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x3f6b8d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0b6e('0x5d')]=function(_0x3a6603){try{if(this[_0x0b6e('0x27')](_0x3a6603)){logger['info'](_0x0b6e('0x5e'),_0x3a6603[_0x0b6e('0x2c')],_0x3a6603['linkedid'],_0x3a6603[_0x0b6e('0x2d')],_0x3a6603[_0x0b6e('0x5f')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x3a6603[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x3a6603,{'showHidden':![],'depth':null}));if(_0x3a6603[_0x0b6e('0x60')]!=='6')return;var _0x15a370=this[_0x0b6e('0x10')][_0x3a6603[_0x0b6e('0x36')][_0x0b6e('0x37')]('-')[0x0]];if(_0x3a6603[_0x0b6e('0x2c')]!==_0x3a6603[_0x0b6e('0x31')]){var _0x52e1d2=moment();if(this[_0x0b6e('0xf')][_0x3a6603['linkedid']]){if(!this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x61')]){this['channels'][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x61')]=!![];this['channels'][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x62')]=_0x52e1d2[_0x0b6e('0x3c')](_0x0b6e('0x46'));if(this['channels'][_0x3a6603[_0x0b6e('0x31')]]['starttime']){this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]]['holdtime']=_0x52e1d2[_0x0b6e('0x63')](this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x45')],_0x0b6e('0x56'));}}this['channels'][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x31')]=_0x3a6603[_0x0b6e('0x2c')];if(_0x3a6603[_0x0b6e('0x5f')]!==_0x0b6e('0x39')){this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x3b')]=_0x3a6603[_0x0b6e('0x5f')];}this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x64')]=_0x3a6603[_0x0b6e('0x2d')];this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]]['destinationchannel']=_0x3a6603[_0x0b6e('0x36')];this[_0x0b6e('0xf')][_0x3a6603['linkedid']][_0x0b6e('0x47')]=dispositions[_['toNumber'](_0x3a6603[_0x0b6e('0x60')])];if(_0x15a370){this[_0x0b6e('0xf')][_0x3a6603['linkedid']][_0x0b6e('0x65')]=_0x15a370['id'];this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x66')]=_0x15a370[_0x0b6e('0x4b')];}}if(this[_0x0b6e('0xf')][_0x3a6603['uniqueid']]){if(!this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x61')]){this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x61')]=!![];this['channels'][_0x3a6603[_0x0b6e('0x2c')]]['answertime']=_0x52e1d2[_0x0b6e('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x45')]){this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]]['holdtime']=_0x52e1d2[_0x0b6e('0x63')](this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x45')],_0x0b6e('0x56'));}}if(_0x3a6603[_0x0b6e('0x5f')]!==_0x0b6e('0x39')){this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x3b')]=_0x3a6603[_0x0b6e('0x5f')];}this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x64')]=_0x3a6603[_0x0b6e('0x2d')];this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x67')]=_0x3a6603['channel'];this['channels'][_0x3a6603[_0x0b6e('0x2c')]]['disposition']=dispositions[_[_0x0b6e('0x48')](_0x3a6603[_0x0b6e('0x60')])];}}else{if(this['channels'][_0x3a6603[_0x0b6e('0x2c')]]){if(_0x15a370){this['channels'][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x65')]=_0x15a370['id'];this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x66')]=_0x15a370[_0x0b6e('0x4b')];}}}if(_0x3a6603[_0x0b6e('0x44')]==='from-sip'){if(_0x15a370){_0x15a370[_0x0b6e('0x3a')]=_0x3a6603[_0x0b6e('0x38')];var _0x4c6050,_0xe4f4c0;if(this['channels'][_0x3a6603['uniqueid']]){_0x4c6050=this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]]['routealias'];_0xe4f4c0=this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x2c')]][_0x0b6e('0x52')];}else if(this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]]){_0x4c6050=this[_0x0b6e('0xf')][_0x3a6603[_0x0b6e('0x31')]][_0x0b6e('0x68')];_0xe4f4c0=this[_0x0b6e('0xf')][_0x3a6603['linkedid']][_0x0b6e('0x52')];}_0x15a370[_0x0b6e('0x52')]=_0xe4f4c0;_0x15a370[_0x0b6e('0x68')]=_0x4c6050;var _0x29eab8={'id':_0x15a370['id'],'name':_0x15a370['name'],'agentconnected':!![],'destaccountcode':_0x15a370[_0x0b6e('0x3f')],'destconnectedlinenum':_0x3a6603[_0x0b6e('0x38')],'queue':_0xe4f4c0||undefined,'routealias':_0x4c6050,'uniqueid':_0x3a6603[_0x0b6e('0x31')]};logger['debug'](_0x0b6e('0x69'),_0x3a6603['uniqueid'],util[_0x0b6e('0x30')](_0x29eab8,{'showHidden':![],'depth':null}));this['emit'](util[_0x0b6e('0x3c')](_0x0b6e('0x3d'),_0x15a370[_0x0b6e('0x4b')]),_0x0b6e('0x3e'),_0x29eab8);}}}}catch(_0x15d5ca){logger[_0x0b6e('0x24')](_0x0b6e('0x6a'),_0x3a6603[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x15d5ca,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x6b')]=function(_0x4fb93e,_0x572bcb){try{if(this['channels'][_0x4fb93e]){logger[_0x0b6e('0x22')](_0x0b6e('0x6c'),_0x4fb93e,_0x572bcb);this[_0x0b6e('0xf')][_0x4fb93e][_0x0b6e('0x6d')]=!![];if(_['endsWith'](_0x572bcb,'.wav49')){_0x572bcb=_0x572bcb['replace']('.wav49','.WAV');}this[_0x0b6e('0xf')][_0x4fb93e]['monitorFilename']=_0x572bcb;var _0x572b62=_[_0x0b6e('0x6e')](this[_0x0b6e('0xf')][_0x4fb93e][_0x0b6e('0x6f')],{'filename':_0x572bcb});if(_[_0x0b6e('0x5b')](_0x572b62)){this[_0x0b6e('0xf')][_0x4fb93e]['monitors'][_0x0b6e('0x70')]({'filename':_0x572bcb,'createdAt':moment()[_0x0b6e('0x3c')](_0x0b6e('0x46')),'mixmonitorid':'','status':_0x0b6e('0x71')});}}}catch(_0x3a4270){logger[_0x0b6e('0x24')](_0x0b6e('0x72'),_0x4fb93e,util[_0x0b6e('0x30')](_0x3a4270,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x18')]=function(_0x38bf7f){try{if(this['isNotNull'](_0x38bf7f)){logger[_0x0b6e('0x2e')](_0x0b6e('0x73'),_0x38bf7f[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x38bf7f,{'showHidden':![],'depth':null}));if(this[_0x0b6e('0xf')][_0x38bf7f['uniqueid']]&&_0x38bf7f[_0x0b6e('0x36')]!=_0x0b6e('0x42')){if(this['isNotNull'](_0x38bf7f[_0x0b6e('0x74')])){if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x75')])){logger[_0x0b6e('0x22')](_0x0b6e('0x76'),_0x38bf7f['uniqueid'],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0x6b')](_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f[_0x0b6e('0x77')]);}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x78')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x5f')]=_0x38bf7f[_0x0b6e('0x77')];}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x79')])){logger[_0x0b6e('0x22')](_0x0b6e('0x7a'),_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f['value']);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x7b')]=_0x38bf7f[_0x0b6e('0x77')];}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')]['xmd-cdrtype'])){logger[_0x0b6e('0x22')](_0x0b6e('0x7c'),_0x38bf7f['uniqueid'],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x5a')]=_0x38bf7f[_0x0b6e('0x77')];}else if(this[_0x0b6e('0x27')](_0x38bf7f['variable'][_0x0b6e('0x7d')])){logger[_0x0b6e('0x22')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f['value']['split'](',')[0x0]);this['channels'][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x52')]=_0x38bf7f[_0x0b6e('0x77')][_0x0b6e('0x37')](',')[0x0];}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x7e')])){logger[_0x0b6e('0x22')](_0x0b6e('0x7f'),_0x38bf7f['uniqueid'],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0xf')][_0x38bf7f['uniqueid']][_0x0b6e('0x80')]=_0x38bf7f[_0x0b6e('0x77')];}else if(this['isNotNull'](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x81')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f['value']);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x82')]=_0x38bf7f[_0x0b6e('0x77')];}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x83')])){logger[_0x0b6e('0x22')](_0x0b6e('0x84'),_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x85')]=_0x38bf7f['value'];}else if(this[_0x0b6e('0x27')](_0x38bf7f['variable'][_0x0b6e('0x86')])){logger[_0x0b6e('0x22')](_0x0b6e('0x87'),_0x38bf7f['uniqueid'],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x52')]=_0x38bf7f['value'];}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x88')])){logger['info'](_0x0b6e('0x89'),_0x38bf7f[_0x0b6e('0x2c')],_0x38bf7f['value']);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x2c')]][_0x0b6e('0x8a')]=_0x38bf7f[_0x0b6e('0x77')];}}}else if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x75')])){if(_0x38bf7f['value']){var _0x44515e=path['parse'](_0x38bf7f[_0x0b6e('0x77')])['name'];logger['info'](_0x0b6e('0x76'),_0x44515e,_0x38bf7f['value']);this['syncMixMonitorFilename'](_0x44515e,_0x38bf7f[_0x0b6e('0x77')]);}}else if(this[_0x0b6e('0xf')][_0x38bf7f['linkedid']]){if(this[_0x0b6e('0x27')](_0x38bf7f['variable'])){if(this[_0x0b6e('0x27')](_0x38bf7f[_0x0b6e('0x74')][_0x0b6e('0x88')])){logger['info'](_0x0b6e('0x89'),_0x38bf7f[_0x0b6e('0x31')],_0x38bf7f[_0x0b6e('0x77')]);this[_0x0b6e('0xf')][_0x38bf7f[_0x0b6e('0x31')]][_0x0b6e('0x8b')]=_0x38bf7f['value'];}}}}}catch(_0xe7b5cf){logger[_0x0b6e('0x24')](_0x0b6e('0x8c'),_0x38bf7f[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0xe7b5cf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x1a')]=function(_0x95d208){try{if(this[_0x0b6e('0x27')](_0x95d208)){logger[_0x0b6e('0x2e')](_0x0b6e('0x8d'),_0x95d208['uniqueid'],util[_0x0b6e('0x30')](_0x95d208,{'showHidden':![],'depth':null}));if(this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]]){if(this['channels'][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]]){this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]][_0x0b6e('0x2c')]=_0x95d208['uniqueid'];this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]]['linkedid']][_0x0b6e('0x61')]=this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x61')];this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]]['answertime']=this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x62')];this['channels'][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]]['destinationchannel']=this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]][_0x0b6e('0x36')];this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]][_0x0b6e('0x47')]=this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x47')];this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]=this['channels'][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]];delete this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x31')]];}else if(this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208['linkedid']]['uniqueid']]){this['channels'][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x2c')]]['uniqueid']=[this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]]['uniqueid']][_0x0b6e('0x31')],this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]]['uniqueid']]['linkedid']=this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208['linkedid']][_0x0b6e('0x2c')]][_0x0b6e('0x2c')]][0x0];this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x2c')]]['answered']=this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x61')];this['channels'][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]]['uniqueid']][_0x0b6e('0x62')]=this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x62')];this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x2c')]][_0x0b6e('0x67')]=this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208['linkedid']][_0x0b6e('0x2c')]][_0x0b6e('0x36')];this[_0x0b6e('0xf')][this['blindTransfers'][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x2c')]][_0x0b6e('0x47')]=this['channels'][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x47')];this['channels'][_0x95d208['uniqueid']]=this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x2c')]];delete this[_0x0b6e('0xf')][this[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x31')]][_0x0b6e('0x2c')]];}}if(this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x95d208[_0x0b6e('0x2c')],_0x95d208[_0x0b6e('0x8e')]);var _0x156156=moment();this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x8f')]=_0x156156[_0x0b6e('0x3c')](_0x0b6e('0x46'));this[_0x0b6e('0xf')][_0x95d208['uniqueid']]['duration']=_0x156156[_0x0b6e('0x63')](this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x45')],_0x0b6e('0x56'));if(this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]['answered']){this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x90')]=_0x156156[_0x0b6e('0x63')](this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]['answertime'],'seconds');this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]['holdtime']=this[_0x0b6e('0xf')][_0x95d208['uniqueid']][_0x0b6e('0x55')]-this[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x90')];}if(_0x95d208[_0x0b6e('0x44')]===_0x0b6e('0x35')){if(this[_0x0b6e('0x10')][_0x95d208[_0x0b6e('0x36')][_0x0b6e('0x37')]('-')[0x0]]){this[_0x0b6e('0x10')][_0x95d208[_0x0b6e('0x36')][_0x0b6e('0x37')]('-')[0x0]]=_['omit'](this['agents'][_0x95d208[_0x0b6e('0x36')][_0x0b6e('0x37')]('-')[0x0]],[_0x0b6e('0x3a')]);logger[_0x0b6e('0x2e')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x95d208[_0x0b6e('0x2c')],util['inspect']({'id':this[_0x0b6e('0x10')][_0x95d208['channel'][_0x0b6e('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0x0b6e('0x10')][_0x95d208['channel'][_0x0b6e('0x37')]('-')[0x0]][_0x0b6e('0x3f')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x0b6e('0x3c')](_0x0b6e('0x3d'),this[_0x0b6e('0x10')][_0x95d208['channel'][_0x0b6e('0x37')]('-')[0x0]][_0x0b6e('0x4b')]),_0x0b6e('0x91'),{'id':this[_0x0b6e('0x10')][_0x95d208['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x0b6e('0x10')][_0x95d208['channel'][_0x0b6e('0x37')]('-')[0x0]][_0x0b6e('0x3f')]});for(var _0x3573c0=0x0;_0x3573c0<Object[_0x0b6e('0x34')](this[_0x0b6e('0x10')])['length'];_0x3573c0++){var _0x31dd46=Object[_0x0b6e('0x34')](this[_0x0b6e('0x10')])[_0x3573c0];var _0x446d44=this['agents'][_0x31dd46];if(_0x446d44['accountcode']===Number(this[_0x0b6e('0xf')][_0x95d208['uniqueid']][_0x0b6e('0x3b')])){this['emit'](util[_0x0b6e('0x3c')](_0x0b6e('0x3d'),_0x446d44[_0x0b6e('0x4b')]),_0x0b6e('0x91'),{'id':_0x446d44['id'],'destaccountcode':_0x446d44[_0x0b6e('0x3f')],'transfer':this['channels'][_0x95d208['uniqueid']][_0x0b6e('0x92')]});break;}}}}var _0x27aaa0=this;Promise['resolve']()[_0x0b6e('0x93')](function(){var _0x25fe41=_0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]];if(typeof _0x25fe41['transferType']===_0x0b6e('0x49')){return;}if(_0x25fe41[_0x0b6e('0x94')]===!![]){return;}if(_['isEmpty'](_0x25fe41[_0x0b6e('0x6f')])){return;}return RpcSetting[_0x0b6e('0x95')]()[_0x0b6e('0x93')](function(_0xf9827a){if(!_0xf9827a['stopRecordingOnTransfer'])return;return Promise[_0x0b6e('0x96')]()[_0x0b6e('0x93')](function(){return ami[_0x0b6e('0x97')]({'action':'StopMixMonitor','channel':_0x25fe41[_0x0b6e('0x36')]})['catch'](function(){});})[_0x0b6e('0x93')](function(){return ami['Action']({'action':_0x0b6e('0x98'),'channel':_0x25fe41[_0x0b6e('0x67')]})['catch'](function(){})[_0x0b6e('0x99')](function(){var _0x4c990d=_0x27aaa0[_0x0b6e('0x10')][_0x25fe41['destinationchannel'][_0x0b6e('0x37')]('-')[0x0]];if(!_0x4c990d)return;io[_0x0b6e('0x29')](_0x0b6e('0x9a'),{'agentId':_0x4c990d['id'],'uniqueid':_0x25fe41['uniqueid']});});});});})[_0x0b6e('0x93')](function(){if(_0x95d208['event']==='BlindTransfer'){_0x27aaa0[_0x0b6e('0x11')][_0x95d208['uniqueid']]=_0x95d208;}else{if(_0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]&&_0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x5a')]==='outbound'&&_0x27aaa0[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x2c')]]){_0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x2c')]=[_0x27aaa0[_0x0b6e('0xf')][_0x95d208['uniqueid']][_0x0b6e('0x31')],_0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]]['linkedid']=_0x27aaa0['channels'][_0x95d208[_0x0b6e('0x2c')]][_0x0b6e('0x2c')]][0x0];delete _0x27aaa0[_0x0b6e('0x11')][_0x95d208[_0x0b6e('0x2c')]];}}logger[_0x0b6e('0x2e')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x95d208[_0x0b6e('0x2c')],util['inspect'](_0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]],{'showHidden':![],'depth':null}));ami[_0x0b6e('0x29')](_0x0b6e('0x9b'),_0x27aaa0[_0x0b6e('0xf')][_0x95d208['uniqueid']]);delete _0x27aaa0[_0x0b6e('0xf')][_0x95d208[_0x0b6e('0x2c')]];});}}}catch(_0x2401e5){logger[_0x0b6e('0x24')]('[%s][voiceCallReport][hangup]',_0x95d208[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x2401e5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x1d')]=function(_0x4ea5f9){try{if(this[_0x0b6e('0x27')](_0x4ea5f9)){logger[_0x0b6e('0x22')](_0x0b6e('0x9c'),_0x4ea5f9[_0x0b6e('0x2c')],_0x4ea5f9[_0x0b6e('0x9d')],_0x4ea5f9['transfertargetcalleridnum']);logger[_0x0b6e('0x2e')](_0x0b6e('0x9e'),_0x4ea5f9[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x4ea5f9,{'showHidden':![],'depth':null}));var _0xe93710;if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0x9f')]]){this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0x9f')]][_0x0b6e('0xa0')]=_0x4ea5f9[_0x0b6e('0x9d')];this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0x9f')]][_0x0b6e('0xa1')]=_0x4ea5f9['transfertargetcalleridnum'];if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa2')]]){_0xe93710=this['channels'][_0x4ea5f9['secondtransfereruniqueid']];this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa2')]]=this['channels'][_0x4ea5f9['transfereeuniqueid']];this['channels'][_0x4ea5f9[_0x0b6e('0x9f')]]=_0xe93710;}this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa2')]][_0x0b6e('0x92')]=_0x0b6e('0xa3');}else if(this['channels'][_0x4ea5f9[_0x0b6e('0xa4')]]){this[_0x0b6e('0xf')][_0x4ea5f9['transfertargetuniqueid']]['transfercalleridnum']=_0x4ea5f9[_0x0b6e('0x9d')];this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa4')]][_0x0b6e('0xa1')]=_0x4ea5f9[_0x0b6e('0xa5')];if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa6')]]){_0xe93710=this['channels'][_0x4ea5f9[_0x0b6e('0xa6')]];this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa6')]]=this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa4')]];this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa4')]]=_0xe93710;}this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa4')]]['transferType']=_0x0b6e('0xa3');}if((this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa6')]]||this['channels'][_0x4ea5f9[_0x0b6e('0xa7')]])&&this[_0x0b6e('0xf')][_0x4ea5f9['secondtransfereruniqueid']]){var _0x941c9f=_[_0x0b6e('0xa8')]([this[_0x0b6e('0xf')][_0x4ea5f9['origtransfereruniqueid']],this[_0x0b6e('0xf')][_0x4ea5f9['origtransfererlinkedid']],this[_0x0b6e('0xf')][_0x4ea5f9['secondtransfereruniqueid']]],function(_0x5edff4){return _0x5edff4&&_0x5edff4['type']==='outbound'&&_0x5edff4[_0x0b6e('0xa9')];});if(_0x941c9f){if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa6')]])this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa6')]]['transferType']=_0x0b6e('0xa3');if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa7')]])this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa7')]]['transferType']='ATTENDED';this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa2')]][_0x0b6e('0x92')]=_0x0b6e('0xa3');}else{if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0x9f')]]){this[_0x0b6e('0xf')][_0x4ea5f9['secondtransfereruniqueid']][_0x0b6e('0x94')]=!![];}if(this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa4')]]){this[_0x0b6e('0xf')][_0x4ea5f9[_0x0b6e('0xa4')]][_0x0b6e('0x94')]=!![];}}}}}catch(_0x1bfaf2){logger[_0x0b6e('0x24')](_0x0b6e('0xaa'),_0x4ea5f9[_0x0b6e('0x2c')],util['inspect'](_0x1bfaf2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x1e')]=function(_0x1f9bb7){try{if(this[_0x0b6e('0x27')](_0x1f9bb7)){logger[_0x0b6e('0x22')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1f9bb7[_0x0b6e('0x2c')],_0x1f9bb7[_0x0b6e('0xab')],_0x1f9bb7[_0x0b6e('0xac')]);logger[_0x0b6e('0x2e')](_0x0b6e('0xad'),_0x1f9bb7['uniqueid'],util['inspect'](_0x1f9bb7,{'showHidden':![],'depth':null}));if(this['channels'][_0x1f9bb7[_0x0b6e('0x9f')]]){this[_0x0b6e('0xf')][_0x1f9bb7[_0x0b6e('0x9f')]][_0x0b6e('0xa0')]=_0x1f9bb7[_0x0b6e('0xab')];this[_0x0b6e('0xf')][_0x1f9bb7[_0x0b6e('0x9f')]][_0x0b6e('0xa1')]=_0x1f9bb7[_0x0b6e('0xac')];this[_0x0b6e('0xf')][_0x1f9bb7[_0x0b6e('0x9f')]][_0x0b6e('0x92')]=_0x0b6e('0xae');this[_0x0b6e('0x1a')]({'event':_0x0b6e('0xaf'),'uniqueid':_0x1f9bb7['transfereeuniqueid'],'linkedid':_0x1f9bb7['transfereruniqueid'],'context':_0x1f9bb7['context'],'channel':_0x1f9bb7['transfererchannel']});}else{this[_0x0b6e('0xf')][_0x1f9bb7[_0x0b6e('0xb0')]][_0x0b6e('0x92')]='BLIND';this[_0x0b6e('0x1a')]({'event':_0x0b6e('0xaf'),'uniqueid':_0x1f9bb7['transfereruniqueid'],'linkedid':_0x1f9bb7[_0x0b6e('0x9f')],'context':_0x1f9bb7[_0x0b6e('0x44')],'channel':_0x1f9bb7[_0x0b6e('0xb1')]});}}}catch(_0x1e81e3){logger[_0x0b6e('0x24')]('[%s][voiceCallReport][blindtransfer]',_0x1f9bb7[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x1e81e3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')]['syncMusicOnHoldStart']=function(_0xb30518){try{if(this[_0x0b6e('0x27')](_0xb30518)){logger[_0x0b6e('0x2e')](_0x0b6e('0xb2'),_0xb30518[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0xb30518,{'showHidden':![],'depth':null}));if(this[_0x0b6e('0xf')][_0xb30518[_0x0b6e('0x2c')]]){if(!_[_0x0b6e('0x5b')](this[_0x0b6e('0xf')][_0xb30518[_0x0b6e('0x2c')]][_0x0b6e('0x62')])){this['channels'][_0xb30518[_0x0b6e('0x2c')]][_0x0b6e('0xb3')]=moment()[_0x0b6e('0x3c')](_0x0b6e('0x46'));logger[_0x0b6e('0x22')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0xb30518[_0x0b6e('0x2c')],this[_0x0b6e('0xf')][_0xb30518['uniqueid']][_0x0b6e('0xb3')]);}}}}catch(_0xe0323c){logger[_0x0b6e('0x24')](_0x0b6e('0xb4'),_0xb30518[_0x0b6e('0x2c')],util['inspect'](_0xe0323c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0b6e('0x26')][_0x0b6e('0x21')]=function(_0xe48774){try{if(this['isNotNull'](_0xe48774)){logger[_0x0b6e('0x2e')](_0x0b6e('0xb5'),_0xe48774['uniqueid'],util['inspect'](_0xe48774,{'showHidden':![],'depth':null}));if(this[_0x0b6e('0xf')][_0xe48774[_0x0b6e('0x2c')]]){if(!_[_0x0b6e('0x5b')](this['channels'][_0xe48774[_0x0b6e('0x2c')]][_0x0b6e('0xb3')])){this[_0x0b6e('0xf')][_0xe48774[_0x0b6e('0x2c')]][_0x0b6e('0xb6')]+=moment()[_0x0b6e('0xb7')](0x0)['diff'](this[_0x0b6e('0xf')][_0xe48774[_0x0b6e('0x2c')]]['mohstarttime'],'seconds');logger['info'](_0x0b6e('0xb8'),_0xe48774[_0x0b6e('0x2c')],this[_0x0b6e('0xf')][_0xe48774[_0x0b6e('0x2c')]][_0x0b6e('0xb6')]);delete this['channels'][_0xe48774[_0x0b6e('0x2c')]][_0x0b6e('0xb3')];}}}}catch(_0x3e1112){logger[_0x0b6e('0x24')]('[%s][voiceCallReport][musiconholdstop]',_0xe48774[_0x0b6e('0x2c')],util[_0x0b6e('0x30')](_0x3e1112,{'showHidden':![],'depth':null}));}};module[_0x0b6e('0xb9')]=VoiceCallReport;
\ No newline at end of file
+var _0xb60b=['newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','from-sip','channel','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','OutgoingSpoolFailed','blindTransfers','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','split','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','pick','includes','lastapplication','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','calleridname','channelstate','answered','diff','connectedlinename','destinationchannel','toNumber','UserId','answertime','holdtime','membername','routealias','user:%s','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','user:agentcomplete','transferType','transferToInternal','isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','some','routeid','origtransfererlinkedid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../ami','../model/channel','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup'];(function(_0x292bab,_0x18b725){var _0x3a1de1=function(_0x8d52cf){while(--_0x8d52cf){_0x292bab['push'](_0x292bab['shift']());}};_0x3a1de1(++_0x18b725);}(_0xb60b,0x16a));var _0xbb60=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xb60b[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xbb60('0x0'));var moment=require(_0xbb60('0x1'));var util=require(_0xbb60('0x2'));var path=require(_0xbb60('0x3'));var Redis=require(_0xbb60('0x4'));var config=require(_0xbb60('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0xbb60('0x6'));var Channel=require(_0xbb60('0x7'));var RpcSetting=require('../rpc/setting');var applications=[_0xbb60('0x8'),_0xbb60('0x9'),_0xbb60('0xa'),_0xbb60('0xb'),_0xbb60('0xc'),_0xbb60('0xd')];var dispositions=['NO\x20ANSWER',_0xbb60('0xe'),'FAILED',_0xbb60('0xf'),_0xbb60('0xf'),_0xbb60('0xf'),_0xbb60('0x10'),_0xbb60('0x11'),'FAILED',_0xbb60('0xe'),_0xbb60('0xe')];config[_0xbb60('0x12')]=_[_0xbb60('0x13')](config[_0xbb60('0x12')],{'host':'localhost','port':0x18eb});var io=require(_0xbb60('0x14'))(new Redis(config[_0xbb60('0x12')]));function VoiceCallReport(_0x8fbbc2){this[_0xbb60('0x15')]=_0x8fbbc2[_0xbb60('0x15')];this['agents']=_0x8fbbc2[_0xbb60('0x16')];this['blindTransfers']={};ami['on'](_0xbb60('0x17'),this[_0xbb60('0x18')]['bind'](this));ami['on'](_0xbb60('0x19'),this[_0xbb60('0x18')][_0xbb60('0x1a')](this));ami['on'](_0xbb60('0x1b'),this['syncNewChannel']['bind'](this));ami['on'](_0xbb60('0x1c'),this[_0xbb60('0x1d')][_0xbb60('0x1a')](this));ami['on'](_0xbb60('0x1e'),this[_0xbb60('0x1f')]['bind'](this));ami['on'](_0xbb60('0x20'),this[_0xbb60('0x21')][_0xbb60('0x1a')](this));ami['on'](_0xbb60('0x22'),this[_0xbb60('0x23')][_0xbb60('0x1a')](this));ami['on'](_0xbb60('0x24'),this[_0xbb60('0x25')][_0xbb60('0x1a')](this));ami['on'](_0xbb60('0x26'),this[_0xbb60('0x27')][_0xbb60('0x1a')](this));ami['on'](_0xbb60('0x28'),this['syncMusicOnHoldStart'][_0xbb60('0x1a')](this));ami['on']('musiconholdstop',this[_0xbb60('0x29')]['bind'](this));try{logger[_0xbb60('0x2a')](_0xbb60('0x2b'));ami['actionCoreShowChannels']();}catch(_0x3f4960){logger[_0xbb60('0x2c')](_0xbb60('0x2d'),util[_0xbb60('0x2e')](_0x3f4960,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x30')]=function(_0x4592d1){return _0x4592d1!==null&&!_[_0xbb60('0x31')](_0x4592d1);};VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x32')]=function(_0x4c3a40,_0x5d6176,_0x2c26fc){io['to'](_0x4c3a40)[_0xbb60('0x32')](_0x5d6176,_0x2c26fc);};VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x23')]=function(_0x47f80f){try{if(this[_0xbb60('0x30')](_0x47f80f)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x47f80f[_0xbb60('0x33')],_0x47f80f['calleridname'],_0x47f80f[_0xbb60('0x34')]);logger[_0xbb60('0x35')](_0xbb60('0x36'),_0x47f80f[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x47f80f,{'showHidden':![],'depth':null}));if(_0x47f80f['uniqueid']===_0x47f80f[_0xbb60('0x37')]){if(!_[_0xbb60('0x31')](this['channels'][_0x47f80f[_0xbb60('0x33')]])){_[_0xbb60('0x38')](this['channels'][_0x47f80f['uniqueid']],_['pick'](_0x47f80f,_[_0xbb60('0x39')](this[_0xbb60('0x15')][_0x47f80f[_0xbb60('0x33')]])));}}if(_0x47f80f[_0xbb60('0x3a')]===_0xbb60('0x3b')){var _0x3ba05d=this['agents'][_0x47f80f[_0xbb60('0x3c')]['split']('-')[0x0]];if(_0x3ba05d){if(_0x47f80f['exten']==_0xbb60('0x3d')){_0x3ba05d[_0xbb60('0x3e')]=_0x47f80f[_0xbb60('0x3f')];this[_0xbb60('0x32')](util[_0xbb60('0x40')]('user:%s',_0x3ba05d[_0xbb60('0x41')]),_0xbb60('0x42'),{'id':_0x3ba05d['id'],'destaccountcode':_0x3ba05d[_0xbb60('0x43')],'destconnectedlinenum':_0x47f80f['connectedlinenum']});}}}}}catch(_0x4317a3){logger[_0xbb60('0x2c')](_0xbb60('0x44'),_0x47f80f['uniqueid'],util[_0xbb60('0x2e')](_0x4317a3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x45')]=function(_0x1ad2ab){try{if(this[_0xbb60('0x30')](_0x1ad2ab)){logger[_0xbb60('0x35')]('[%s][voiceCallReport][newchannel]\x20event:',_0x1ad2ab[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x1ad2ab,{'showHidden':![],'depth':null}));if(this[_0xbb60('0x15')][_0x1ad2ab[_0xbb60('0x33')]]){return;}if(_0x1ad2ab[_0xbb60('0x3c')]===_0xbb60('0x46')){return;}if(_0x1ad2ab[_0xbb60('0x33')]!==_0x1ad2ab[_0xbb60('0x37')]&&!this[_0xbb60('0x47')][_0x1ad2ab['linkedid']]){return;}logger[_0xbb60('0x2a')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x1ad2ab[_0xbb60('0x33')],_0x1ad2ab[_0xbb60('0x3a')],_0x1ad2ab[_0xbb60('0x48')]);this['channels'][_0x1ad2ab[_0xbb60('0x33')]]=new Channel();this[_0xbb60('0x15')][_0x1ad2ab[_0xbb60('0x33')]][_0xbb60('0x49')]=moment()[_0xbb60('0x40')](_0xbb60('0x4a'));this[_0xbb60('0x15')][_0x1ad2ab[_0xbb60('0x33')]][_0xbb60('0x4b')]=dispositions[_['toNumber'](_0x1ad2ab['channelstate'])];_[_0xbb60('0x38')](this[_0xbb60('0x15')][_0x1ad2ab['uniqueid']],_['pick'](_0x1ad2ab,_['keys'](this[_0xbb60('0x15')][_0x1ad2ab['uniqueid']])));if(_0x1ad2ab[_0xbb60('0x3a')]===_0xbb60('0x3b')){var _0x934a13=this['agents'][_0x1ad2ab['channel'][_0xbb60('0x4c')]('-')[0x0]];if(_0x934a13&&typeof _0x934a13['destconnectedlinenum']==='undefined'){_0x934a13[_0xbb60('0x3e')]=_0x1ad2ab['exten'];logger[_0xbb60('0x35')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x1ad2ab[_0xbb60('0x33')],util[_0xbb60('0x2e')]({'id':_0x934a13['id'],'destaccountcode':_0x934a13[_0xbb60('0x43')],'destconnectedlinenum':_0x1ad2ab[_0xbb60('0x48')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',_0x934a13[_0xbb60('0x41')]),'user:agentconnect',{'id':_0x934a13['id'],'destaccountcode':_0x934a13[_0xbb60('0x43')],'destconnectedlinenum':_0x1ad2ab[_0xbb60('0x48')]});}}}}catch(_0x4d9b60){logger[_0xbb60('0x2c')](_0xbb60('0x4d'),_0x1ad2ab[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x4d9b60,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x18')]=function(_0x2b1480){try{if(this['isNotNull'](_0x2b1480)){logger[_0xbb60('0x35')](_0xbb60('0x4e'),_0x2b1480[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x2b1480,{'showHidden':![],'depth':null}));if(_0x2b1480[_0xbb60('0x3c')]==='OutgoingSpoolFailed'||_0x2b1480[_0xbb60('0x48')]==='h')return;if(_0x2b1480[_0xbb60('0x33')]===_0x2b1480[_0xbb60('0x37')]||this[_0xbb60('0x47')][_0x2b1480[_0xbb60('0x37')]]){_0x2b1480[_0xbb60('0x4f')]=_0x2b1480[_0xbb60('0x4f')]?_0x2b1480[_0xbb60('0x4f')][_0xbb60('0x50')]():undefined;_0x2b1480[_0xbb60('0x51')]=_0x2b1480[_0xbb60('0x52')]||_0x2b1480[_0xbb60('0x51')];if(_0x2b1480[_0xbb60('0x52')]&&!_0x2b1480[_0xbb60('0x52')][_0xbb60('0x53')](_0xbb60('0x54'))&&_0x2b1480[_0xbb60('0x4f')]!==_0xbb60('0x9')){_0x2b1480[_0xbb60('0x51')]=_0x2b1480[_0xbb60('0x51')][_0xbb60('0x50')]();}logger[_0xbb60('0x2a')](_0xbb60('0x55'),_0x2b1480[_0xbb60('0x33')],_0x2b1480[_0xbb60('0x4f')],_0x2b1480['applicationdata']);if(_[_0xbb60('0x31')](this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]])){this['channels'][_0x2b1480['uniqueid']]=new Channel();this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]]['starttime']=_0x2b1480[_0xbb60('0x56')]?moment()['subtract'](moment[_0xbb60('0x56')](_0x2b1480['duration'])['seconds'](),_0xbb60('0x57'))[_0xbb60('0x40')](_0xbb60('0x4a')):moment()[_0xbb60('0x40')](_0xbb60('0x4a'));this['channels'][_0x2b1480[_0xbb60('0x33')]][_0xbb60('0x4b')]=_0xbb60('0xf');}_[_0xbb60('0x38')](this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]],_[_0xbb60('0x58')](_0x2b1480,_[_0xbb60('0x39')](this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]])));if(_[_0xbb60('0x59')](applications,_0x2b1480['application'])){this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]][_0xbb60('0x5a')]=_0x2b1480['application'];this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]][_0xbb60('0x5b')]=_0x2b1480[_0xbb60('0x51')];if(_0x2b1480[_0xbb60('0x4f')]===_0xbb60('0x8')&&_[_0xbb60('0x53')](_0x2b1480[_0xbb60('0x51')][_0xbb60('0x50')](),_0xbb60('0x5c'))){var _0x1902ef=_0x2b1480[_0xbb60('0x51')][_0xbb60('0x4c')]('=');var _0x372eac=_0x1902ef[0x0][_0xbb60('0x50')]()[_0xbb60('0x5d')](/cdr\((.*)\)/);if(_0x372eac){if(_0x372eac[0x1]===_0xbb60('0x5e')&&!_[_0xbb60('0x5f')](this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]][_0x372eac[0x1]]))return;this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]][_0x372eac[0x1]]=_0x1902ef[0x1];}}else if(_0x2b1480[_0xbb60('0x4f')]==='queue'){this[_0xbb60('0x15')][_0x2b1480[_0xbb60('0x33')]][_0xbb60('0x9')]=_0x2b1480[_0xbb60('0x51')][_0xbb60('0x4c')](',')[0x0];}}}}}catch(_0x85ba70){logger['error'](_0xbb60('0x60'),_0x2b1480['uniqueid'],util[_0xbb60('0x2e')](_0x85ba70,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbb60('0x1d')]=function(_0x21579d){try{if(this['isNotNull'](_0x21579d)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x21579d['uniqueid'],_0x21579d['linkedid'],_0x21579d[_0xbb60('0x61')],_0x21579d[_0xbb60('0x34')]);logger[_0xbb60('0x35')]('[%s][voiceCallReport][newstate]\x20event:',_0x21579d[_0xbb60('0x33')],util['inspect'](_0x21579d,{'showHidden':![],'depth':null}));if(_0x21579d[_0xbb60('0x62')]!=='6')return;var _0x1f2f1d=this[_0xbb60('0x16')][_0x21579d[_0xbb60('0x3c')][_0xbb60('0x4c')]('-')[0x0]];if(_0x21579d[_0xbb60('0x33')]!==_0x21579d[_0xbb60('0x37')]){var _0x39a98b=moment();if(this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]){if(!this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x63')]){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x63')]=!![];this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]['answertime']=_0x39a98b[_0xbb60('0x40')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xbb60('0x15')][_0x21579d['linkedid']][_0xbb60('0x49')]){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]['holdtime']=_0x39a98b[_0xbb60('0x64')](this['channels'][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x49')],'seconds');}}this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]['linkedid']=_0x21579d[_0xbb60('0x33')];if(_0x21579d[_0xbb60('0x34')]!==_0xbb60('0x3d')){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x3f')]=_0x21579d['calleridnum'];}this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x65')]=_0x21579d[_0xbb60('0x61')];this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x66')]=_0x21579d[_0xbb60('0x3c')];this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]['disposition']=dispositions[_[_0xbb60('0x67')](_0x21579d[_0xbb60('0x62')])];if(_0x1f2f1d){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x68')]=_0x1f2f1d['id'];this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]['membername']=_0x1f2f1d['name'];}}if(this['channels'][_0x21579d[_0xbb60('0x33')]]){if(!this['channels'][_0x21579d['uniqueid']]['answered']){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]]['answered']=!![];this[_0xbb60('0x15')][_0x21579d['uniqueid']][_0xbb60('0x69')]=_0x39a98b[_0xbb60('0x40')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x49')]){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x6a')]=_0x39a98b[_0xbb60('0x64')](this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x49')],_0xbb60('0x57'));}}if(_0x21579d[_0xbb60('0x34')]!=='xcally-motion-preview'){this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x3f')]=_0x21579d[_0xbb60('0x34')];}this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x65')]=_0x21579d[_0xbb60('0x61')];this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x66')]=_0x21579d[_0xbb60('0x3c')];this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x4b')]=dispositions[_[_0xbb60('0x67')](_0x21579d[_0xbb60('0x62')])];}}else{if(this['channels'][_0x21579d[_0xbb60('0x33')]]){if(_0x1f2f1d){this['channels'][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x68')]=_0x1f2f1d['id'];this['channels'][_0x21579d[_0xbb60('0x33')]][_0xbb60('0x6b')]=_0x1f2f1d[_0xbb60('0x41')];}}}if(_0x21579d[_0xbb60('0x3a')]===_0xbb60('0x3b')){if(_0x1f2f1d){_0x1f2f1d[_0xbb60('0x3e')]=_0x21579d[_0xbb60('0x48')];var _0x434e2f,_0x42eb40;if(this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x33')]]){_0x434e2f=this['channels'][_0x21579d['uniqueid']]['routealias'];_0x42eb40=this[_0xbb60('0x15')][_0x21579d['uniqueid']][_0xbb60('0x9')];}else if(this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]]){_0x434e2f=this[_0xbb60('0x15')][_0x21579d[_0xbb60('0x37')]][_0xbb60('0x6c')];_0x42eb40=this[_0xbb60('0x15')][_0x21579d['linkedid']][_0xbb60('0x9')];}_0x1f2f1d[_0xbb60('0x9')]=_0x42eb40;_0x1f2f1d[_0xbb60('0x6c')]=_0x434e2f;var _0x3c142e={'id':_0x1f2f1d['id'],'name':_0x1f2f1d[_0xbb60('0x41')],'agentconnected':!![],'destaccountcode':_0x1f2f1d['accountcode'],'destconnectedlinenum':_0x21579d[_0xbb60('0x48')],'queue':_0x42eb40||undefined,'routealias':_0x434e2f,'uniqueid':_0x21579d[_0xbb60('0x37')]};logger[_0xbb60('0x35')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x21579d['uniqueid'],util[_0xbb60('0x2e')](_0x3c142e,{'showHidden':![],'depth':null}));this[_0xbb60('0x32')](util[_0xbb60('0x40')](_0xbb60('0x6d'),_0x1f2f1d[_0xbb60('0x41')]),_0xbb60('0x42'),_0x3c142e);}}}}catch(_0xfa50a3){logger['error']('[%s][voiceCallReport][newstate]',_0x21579d['uniqueid'],util[_0xbb60('0x2e')](_0xfa50a3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')]['syncMixMonitorFilename']=function(_0x359ca6,_0x267798){try{if(this[_0xbb60('0x15')][_0x359ca6]){logger[_0xbb60('0x2a')](_0xbb60('0x6e'),_0x359ca6,_0x267798);this['channels'][_0x359ca6]['monitor']=!![];if(_[_0xbb60('0x6f')](_0x267798,_0xbb60('0x70'))){_0x267798=_0x267798[_0xbb60('0x71')]('.wav49',_0xbb60('0x72'));}this[_0xbb60('0x15')][_0x359ca6][_0xbb60('0x73')]=_0x267798;var _0x4a9a70=_['find'](this['channels'][_0x359ca6][_0xbb60('0x74')],{'filename':_0x267798});if(_['isNil'](_0x4a9a70)){this[_0xbb60('0x15')][_0x359ca6]['monitors'][_0xbb60('0x75')]({'filename':_0x267798,'createdAt':moment()['format'](_0xbb60('0x4a')),'mixmonitorid':'','status':_0xbb60('0x76')});}}}catch(_0x3b7497){logger[_0xbb60('0x2c')]('[%s][voiceCallReport][mixMonitorFilename]',_0x359ca6,util[_0xbb60('0x2e')](_0x3b7497,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbb60('0x1f')]=function(_0x4910c8){try{if(this[_0xbb60('0x30')](_0x4910c8)){logger[_0xbb60('0x35')](_0xbb60('0x77'),_0x4910c8['uniqueid'],util[_0xbb60('0x2e')](_0x4910c8,{'showHidden':![],'depth':null}));if(this[_0xbb60('0x15')][_0x4910c8['uniqueid']]&&_0x4910c8['channel']!=_0xbb60('0x46')){if(this[_0xbb60('0x30')](_0x4910c8[_0xbb60('0x78')])){if(this['isNotNull'](_0x4910c8[_0xbb60('0x78')][_0xbb60('0x79')])){logger[_0xbb60('0x2a')](_0xbb60('0x7a'),_0x4910c8[_0xbb60('0x33')],_0x4910c8[_0xbb60('0x7b')]);this[_0xbb60('0x7c')](_0x4910c8[_0xbb60('0x33')],_0x4910c8['value']);}else if(this[_0xbb60('0x30')](_0x4910c8['variable'][_0xbb60('0x7d')])){logger[_0xbb60('0x2a')](_0xbb60('0x7e'),_0x4910c8[_0xbb60('0x33')],_0x4910c8['value']);this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x34')]=_0x4910c8['value'];}else if(this['isNotNull'](_0x4910c8[_0xbb60('0x78')]['xmd-callerid'])){logger[_0xbb60('0x2a')](_0xbb60('0x7f'),_0x4910c8[_0xbb60('0x33')],_0x4910c8['value']);this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x33')]]['callerid']=_0x4910c8[_0xbb60('0x7b')];}else if(this[_0xbb60('0x30')](_0x4910c8[_0xbb60('0x78')][_0xbb60('0x80')])){logger[_0xbb60('0x2a')](_0xbb60('0x81'),_0x4910c8[_0xbb60('0x33')],_0x4910c8[_0xbb60('0x7b')]);this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x5e')]=_0x4910c8[_0xbb60('0x7b')];}else if(this['isNotNull'](_0x4910c8['variable'][_0xbb60('0x82')])){logger[_0xbb60('0x2a')](_0xbb60('0x83'),_0x4910c8[_0xbb60('0x33')],_0x4910c8[_0xbb60('0x7b')][_0xbb60('0x4c')](',')[0x0]);this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x9')]=_0x4910c8[_0xbb60('0x7b')][_0xbb60('0x4c')](',')[0x0];}else if(this[_0xbb60('0x30')](_0x4910c8[_0xbb60('0x78')]['xmd-originatecalleridnum'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x4910c8[_0xbb60('0x33')],_0x4910c8[_0xbb60('0x7b')]);this[_0xbb60('0x15')][_0x4910c8['uniqueid']]['originatecalleridnum']=_0x4910c8[_0xbb60('0x7b')];}else if(this['isNotNull'](_0x4910c8[_0xbb60('0x78')][_0xbb60('0x84')])){logger[_0xbb60('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x4910c8[_0xbb60('0x33')],_0x4910c8['value']);this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x85')]=_0x4910c8[_0xbb60('0x7b')];}else if(this[_0xbb60('0x30')](_0x4910c8['variable'][_0xbb60('0x86')])){logger[_0xbb60('0x2a')](_0xbb60('0x87'),_0x4910c8[_0xbb60('0x33')],_0x4910c8[_0xbb60('0x7b')]);this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x88')]=_0x4910c8['value'];}else if(this[_0xbb60('0x30')](_0x4910c8['variable'][_0xbb60('0x89')])){logger[_0xbb60('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x4910c8['uniqueid'],_0x4910c8[_0xbb60('0x7b')]);this['channels'][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x9')]=_0x4910c8[_0xbb60('0x7b')];}else if(this[_0xbb60('0x30')](_0x4910c8[_0xbb60('0x78')][_0xbb60('0x8a')])){logger[_0xbb60('0x2a')](_0xbb60('0x8b'),_0x4910c8['uniqueid'],_0x4910c8['value']);this['channels'][_0x4910c8[_0xbb60('0x33')]][_0xbb60('0x8c')]=_0x4910c8[_0xbb60('0x7b')];}}}else if(this[_0xbb60('0x30')](_0x4910c8[_0xbb60('0x78')][_0xbb60('0x79')])){if(_0x4910c8['value']){var _0x5e867b=path[_0xbb60('0x8d')](_0x4910c8[_0xbb60('0x7b')])[_0xbb60('0x41')];logger[_0xbb60('0x2a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5e867b,_0x4910c8[_0xbb60('0x7b')]);this[_0xbb60('0x7c')](_0x5e867b,_0x4910c8['value']);}}else if(this[_0xbb60('0x15')][_0x4910c8[_0xbb60('0x37')]]){if(this['isNotNull'](_0x4910c8[_0xbb60('0x78')])){if(this[_0xbb60('0x30')](_0x4910c8[_0xbb60('0x78')]['sipcallid'])){logger[_0xbb60('0x2a')](_0xbb60('0x8b'),_0x4910c8[_0xbb60('0x37')],_0x4910c8[_0xbb60('0x7b')]);this['channels'][_0x4910c8[_0xbb60('0x37')]][_0xbb60('0x8e')]=_0x4910c8[_0xbb60('0x7b')];}}}}}catch(_0x15729c){logger[_0xbb60('0x2c')]('[%s][voiceCallReport][varset]',_0x4910c8[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x15729c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')]['syncHangup']=function(_0x2dbc5e){try{if(this[_0xbb60('0x30')](_0x2dbc5e)){logger[_0xbb60('0x35')](_0xbb60('0x8f'),_0x2dbc5e[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x2dbc5e,{'showHidden':![],'depth':null}));if(this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]]){if(this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x37')]]){this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x37')]]['uniqueid']=_0x2dbc5e['uniqueid'];this['channels'][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x37')]][_0xbb60('0x63')]=this['channels'][_0x2dbc5e[_0xbb60('0x33')]]['answered'];this[_0xbb60('0x15')][this['blindTransfers'][_0x2dbc5e['linkedid']][_0xbb60('0x37')]][_0xbb60('0x69')]=this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x69')];this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x37')]][_0xbb60('0x66')]=this['channels'][this['blindTransfers'][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x37')]]['channel'];this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e['linkedid']]['linkedid']]['disposition']=this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x4b')];this[_0xbb60('0x15')][_0x2dbc5e['uniqueid']]=this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]]['linkedid']];delete this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e['linkedid']][_0xbb60('0x37')]];}else if(this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]]){this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x33')]=[this[_0xbb60('0x15')][this['blindTransfers'][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x37')],this[_0xbb60('0x15')][this['blindTransfers'][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x37')]=this[_0xbb60('0x15')][this['blindTransfers'][_0x2dbc5e[_0xbb60('0x37')]]['uniqueid']][_0xbb60('0x33')]][0x0];this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e['linkedid']][_0xbb60('0x33')]]['answered']=this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]['answered'];this['channels'][this['blindTransfers'][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x69')]=this['channels'][_0x2dbc5e['uniqueid']][_0xbb60('0x69')];this['channels'][this['blindTransfers'][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x66')]=this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x3c')];this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]][_0xbb60('0x4b')]=this[_0xbb60('0x15')][_0x2dbc5e['uniqueid']]['disposition'];this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]=this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e['linkedid']][_0xbb60('0x33')]];delete this[_0xbb60('0x15')][this[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x37')]][_0xbb60('0x33')]];}}if(this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]){logger[_0xbb60('0x2a')](_0xbb60('0x90'),_0x2dbc5e[_0xbb60('0x33')],_0x2dbc5e['cause-txt']);var _0x2a219c=moment();this['channels'][_0x2dbc5e['uniqueid']][_0xbb60('0x91')]=_0x2a219c['format'](_0xbb60('0x4a'));this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]['duration']=_0x2a219c['diff'](this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x49')],'seconds');if(this['channels'][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x63')]){this['channels'][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x92')]=_0x2a219c[_0xbb60('0x64')](this['channels'][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x69')],_0xbb60('0x57'));this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x6a')]=this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x56')]-this['channels'][_0x2dbc5e['uniqueid']][_0xbb60('0x92')];}if(_0x2dbc5e[_0xbb60('0x3a')]===_0xbb60('0x3b')){if(this['agents'][_0x2dbc5e[_0xbb60('0x3c')][_0xbb60('0x4c')]('-')[0x0]]){this[_0xbb60('0x16')][_0x2dbc5e[_0xbb60('0x3c')][_0xbb60('0x4c')]('-')[0x0]]=_[_0xbb60('0x93')](this[_0xbb60('0x16')][_0x2dbc5e[_0xbb60('0x3c')][_0xbb60('0x4c')]('-')[0x0]],['destconnectedlinenum']);logger[_0xbb60('0x35')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x2dbc5e['uniqueid'],util[_0xbb60('0x2e')]({'id':this[_0xbb60('0x16')][_0x2dbc5e['channel'][_0xbb60('0x4c')]('-')[0x0]]['id'],'destaccountcode':this[_0xbb60('0x16')][_0x2dbc5e[_0xbb60('0x3c')][_0xbb60('0x4c')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0xbb60('0x32')](util['format'](_0xbb60('0x6d'),this[_0xbb60('0x16')][_0x2dbc5e['channel'][_0xbb60('0x4c')]('-')[0x0]][_0xbb60('0x41')]),_0xbb60('0x94'),{'id':this[_0xbb60('0x16')][_0x2dbc5e[_0xbb60('0x3c')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xbb60('0x16')][_0x2dbc5e[_0xbb60('0x3c')][_0xbb60('0x4c')]('-')[0x0]][_0xbb60('0x43')]});for(var _0x5072ba=0x0;_0x5072ba<Object[_0xbb60('0x39')](this[_0xbb60('0x16')])['length'];_0x5072ba++){var _0x40cbcb=Object[_0xbb60('0x39')](this['agents'])[_0x5072ba];var _0xe1942b=this[_0xbb60('0x16')][_0x40cbcb];if(_0xe1942b['accountcode']===Number(this[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x3f')])){this[_0xbb60('0x32')](util[_0xbb60('0x40')](_0xbb60('0x6d'),_0xe1942b['name']),_0xbb60('0x94'),{'id':_0xe1942b['id'],'destaccountcode':_0xe1942b[_0xbb60('0x43')],'transfer':this['channels'][_0x2dbc5e[_0xbb60('0x33')]]['transferType']});break;}}}}var _0x45d554=this;Promise['resolve']()['then'](function(){var _0x5c3cfe=_0x45d554[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]];if(typeof _0x5c3cfe[_0xbb60('0x95')]==='undefined'){return;}if(_0x5c3cfe[_0xbb60('0x96')]===!![]){return;}if(_[_0xbb60('0x97')](_0x5c3cfe[_0xbb60('0x74')])){return;}return RpcSetting[_0xbb60('0x98')]()[_0xbb60('0x99')](function(_0xb6890c){if(!_0xb6890c[_0xbb60('0x9a')])return;return Promise[_0xbb60('0x9b')]()[_0xbb60('0x99')](function(){return ami[_0xbb60('0x9c')]({'action':_0xbb60('0x9d'),'channel':_0x5c3cfe[_0xbb60('0x3c')]})[_0xbb60('0x9e')](function(){});})[_0xbb60('0x99')](function(){return ami[_0xbb60('0x9c')]({'action':_0xbb60('0x9d'),'channel':_0x5c3cfe[_0xbb60('0x66')]})[_0xbb60('0x9e')](function(){})[_0xbb60('0x9f')](function(){var _0x1dfc3a=_0x45d554[_0xbb60('0x16')][_0x5c3cfe[_0xbb60('0x66')]['split']('-')[0x0]];if(!_0x1dfc3a)return;io[_0xbb60('0x32')](_0xbb60('0xa0'),{'agentId':_0x1dfc3a['id'],'uniqueid':_0x5c3cfe[_0xbb60('0x33')]});});});});})[_0xbb60('0x99')](function(){if(_0x2dbc5e[_0xbb60('0xa1')]===_0xbb60('0xa2')){_0x45d554['blindTransfers'][_0x2dbc5e[_0xbb60('0x33')]]=_0x2dbc5e;}else{if(_0x45d554[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]&&_0x45d554[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]['type']===_0xbb60('0xa3')&&_0x45d554[_0xbb60('0x47')][_0x2dbc5e[_0xbb60('0x33')]]){_0x45d554[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x33')]=[_0x45d554[_0xbb60('0x15')][_0x2dbc5e['uniqueid']][_0xbb60('0x37')],_0x45d554[_0xbb60('0x15')][_0x2dbc5e['uniqueid']][_0xbb60('0x37')]=_0x45d554['channels'][_0x2dbc5e[_0xbb60('0x33')]][_0xbb60('0x33')]][0x0];delete _0x45d554['blindTransfers'][_0x2dbc5e['uniqueid']];}}logger[_0xbb60('0x35')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x2dbc5e[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x45d554[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]],{'showHidden':![],'depth':null}));ami[_0xbb60('0x32')](_0xbb60('0xa4'),_0x45d554[_0xbb60('0x15')][_0x2dbc5e[_0xbb60('0x33')]]);delete _0x45d554['channels'][_0x2dbc5e[_0xbb60('0x33')]];});}}}catch(_0x445093){logger['error'](_0xbb60('0xa5'),_0x2dbc5e[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x445093,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x25')]=function(_0x2c6533){try{if(this[_0xbb60('0x30')](_0x2c6533)){logger[_0xbb60('0x2a')](_0xbb60('0xa6'),_0x2c6533[_0xbb60('0x33')],_0x2c6533[_0xbb60('0xa7')],_0x2c6533[_0xbb60('0xa8')]);logger['debug'](_0xbb60('0xa9'),_0x2c6533['uniqueid'],util[_0xbb60('0x2e')](_0x2c6533,{'showHidden':![],'depth':null}));var _0x32fd2a;if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaa')]]){this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaa')]][_0xbb60('0xab')]=_0x2c6533[_0xbb60('0xa7')];this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaa')]][_0xbb60('0xac')]=_0x2c6533['transfertargetcalleridnum'];if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xad')]]){_0x32fd2a=this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xad')]];this['channels'][_0x2c6533[_0xbb60('0xad')]]=this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaa')]];this[_0xbb60('0x15')][_0x2c6533['transfereeuniqueid']]=_0x32fd2a;}this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xad')]]['transferType']=_0xbb60('0xae');}else if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]]){this[_0xbb60('0x15')][_0x2c6533['transfertargetuniqueid']][_0xbb60('0xab')]=_0x2c6533[_0xbb60('0xa7')];this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]][_0xbb60('0xac')]=_0x2c6533[_0xbb60('0xa8')];if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb0')]]){_0x32fd2a=this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb0')]];this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb0')]]=this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]];this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]]=_0x32fd2a;}this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]][_0xbb60('0x95')]=_0xbb60('0xae');}if((this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb0')]]||this[_0xbb60('0x15')][_0x2c6533['origtransfererlinkedid']])&&this[_0xbb60('0x15')][_0x2c6533['secondtransfereruniqueid']]){var _0x968112=_[_0xbb60('0xb1')]([this['channels'][_0x2c6533[_0xbb60('0xb0')]],this[_0xbb60('0x15')][_0x2c6533['origtransfererlinkedid']],this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xad')]]],function(_0x4f5ae2){return _0x4f5ae2&&_0x4f5ae2[_0xbb60('0x5e')]==='outbound'&&_0x4f5ae2[_0xbb60('0xb2')];});if(_0x968112){if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb0')]])this['channels'][_0x2c6533[_0xbb60('0xb0')]][_0xbb60('0x95')]='ATTENDED';if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb3')]])this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xb3')]][_0xbb60('0x95')]=_0xbb60('0xae');this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xad')]][_0xbb60('0x95')]=_0xbb60('0xae');}else{if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaa')]]){this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xad')]][_0xbb60('0x96')]=!![];}if(this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]]){this[_0xbb60('0x15')][_0x2c6533[_0xbb60('0xaf')]][_0xbb60('0x96')]=!![];}}}}}catch(_0x2b8cec){logger[_0xbb60('0x2c')](_0xbb60('0xb4'),_0x2c6533['uniqueid'],util[_0xbb60('0x2e')](_0x2b8cec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')]['syncBlindTransfer']=function(_0x1cc1f3){try{if(this[_0xbb60('0x30')](_0x1cc1f3)){logger[_0xbb60('0x2a')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1cc1f3[_0xbb60('0x33')],_0x1cc1f3[_0xbb60('0xb5')],_0x1cc1f3[_0xbb60('0xb6')]);logger[_0xbb60('0x35')](_0xbb60('0xb7'),_0x1cc1f3[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x1cc1f3,{'showHidden':![],'depth':null}));if(this['channels'][_0x1cc1f3[_0xbb60('0xaa')]]){this[_0xbb60('0x15')][_0x1cc1f3[_0xbb60('0xaa')]][_0xbb60('0xab')]=_0x1cc1f3[_0xbb60('0xb5')];this[_0xbb60('0x15')][_0x1cc1f3[_0xbb60('0xaa')]][_0xbb60('0xac')]=_0x1cc1f3['extension'];this[_0xbb60('0x15')][_0x1cc1f3[_0xbb60('0xaa')]][_0xbb60('0x95')]=_0xbb60('0xb8');this[_0xbb60('0x21')]({'event':_0xbb60('0xa2'),'uniqueid':_0x1cc1f3[_0xbb60('0xaa')],'linkedid':_0x1cc1f3[_0xbb60('0xb9')],'context':_0x1cc1f3['context'],'channel':_0x1cc1f3[_0xbb60('0xba')]});}else{this[_0xbb60('0x15')][_0x1cc1f3[_0xbb60('0xb9')]][_0xbb60('0x95')]=_0xbb60('0xb8');this[_0xbb60('0x21')]({'event':_0xbb60('0xa2'),'uniqueid':_0x1cc1f3[_0xbb60('0xb9')],'linkedid':_0x1cc1f3[_0xbb60('0xaa')],'context':_0x1cc1f3[_0xbb60('0x3a')],'channel':_0x1cc1f3[_0xbb60('0xba')]});}}}catch(_0x2bf727){logger[_0xbb60('0x2c')](_0xbb60('0xbb'),_0x1cc1f3[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x2bf727,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')]['syncMusicOnHoldStart']=function(_0x5a1c8a){try{if(this['isNotNull'](_0x5a1c8a)){logger[_0xbb60('0x35')](_0xbb60('0xbc'),_0x5a1c8a[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x5a1c8a,{'showHidden':![],'depth':null}));if(this['channels'][_0x5a1c8a['uniqueid']]){if(!_['isNil'](this['channels'][_0x5a1c8a[_0xbb60('0x33')]][_0xbb60('0x69')])){this[_0xbb60('0x15')][_0x5a1c8a[_0xbb60('0x33')]]['mohstarttime']=moment()[_0xbb60('0x40')]('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0xbb60('0xbd'),_0x5a1c8a['uniqueid'],this[_0xbb60('0x15')][_0x5a1c8a[_0xbb60('0x33')]][_0xbb60('0xbe')]);}}}}catch(_0x27e6f0){logger[_0xbb60('0x2c')](_0xbb60('0xbf'),_0x5a1c8a[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x27e6f0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbb60('0x2f')][_0xbb60('0x29')]=function(_0x50dea6){try{if(this[_0xbb60('0x30')](_0x50dea6)){logger[_0xbb60('0x35')](_0xbb60('0xc0'),_0x50dea6['uniqueid'],util[_0xbb60('0x2e')](_0x50dea6,{'showHidden':![],'depth':null}));if(this[_0xbb60('0x15')][_0x50dea6['uniqueid']]){if(!_['isNil'](this[_0xbb60('0x15')][_0x50dea6['uniqueid']]['mohstarttime'])){this[_0xbb60('0x15')][_0x50dea6['uniqueid']]['mohtime']+=moment()[_0xbb60('0xc1')](0x0)[_0xbb60('0x64')](this[_0xbb60('0x15')][_0x50dea6[_0xbb60('0x33')]][_0xbb60('0xbe')],_0xbb60('0x57'));logger[_0xbb60('0x2a')](_0xbb60('0xc2'),_0x50dea6[_0xbb60('0x33')],this[_0xbb60('0x15')][_0x50dea6[_0xbb60('0x33')]][_0xbb60('0xc3')]);delete this[_0xbb60('0x15')][_0x50dea6[_0xbb60('0x33')]][_0xbb60('0xbe')];}}}}catch(_0x23a86a){logger['error'](_0xbb60('0xc4'),_0x50dea6[_0xbb60('0x33')],util[_0xbb60('0x2e')](_0x23a86a,{'showHidden':![],'depth':null}));}};module[_0xbb60('0xc5')]=VoiceCallReport;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['called','channel','substring','lastIndexOf','omit','privilege','info','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','diff','starttime','seconds','complete','outbound','total','holdtime','sumHoldTime','sumBillable','billableseconds','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','applications','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncHangup','prototype','isUndefined','emit','syncDialBegin','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge'];(function(_0x568512,_0x5310d5){var _0x24614b=function(_0x45f72c){while(--_0x45f72c){_0x568512['push'](_0x568512['shift']());}};_0x24614b(++_0x5310d5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xac4a('0x0'));var moment=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));var logger=require(_0xac4a('0x5'))('ami');var ami=require('../ami');config['redis']=_[_0xac4a('0x6')](config[_0xac4a('0x7')],{'host':_0xac4a('0x8'),'port':0x18eb});var io=require(_0xac4a('0x9'))(new Redis(config[_0xac4a('0x7')]));function VoiceDialReport(_0x15cd34){this[_0xac4a('0xa')]=_0x15cd34[_0xac4a('0xb')];this['outbound']=_0x15cd34['outbound'];this[_0xac4a('0xc')]={};this[_0xac4a('0xd')]={};ami['on'](_0xac4a('0xe'),this['syncDialBegin'][_0xac4a('0xf')](this));ami['on'](_0xac4a('0x10'),this[_0xac4a('0x11')]['bind'](this));ami['on'](_0xac4a('0x12'),this['syncVarSet'][_0xac4a('0xf')](this));ami['on']('hangup',this[_0xac4a('0x13')][_0xac4a('0xf')](this));}VoiceDialReport[_0xac4a('0x14')]['isNotNull']=function(_0x21a79){return _0x21a79!==null&&!_[_0xac4a('0x15')](_0x21a79);};VoiceDialReport[_0xac4a('0x14')][_0xac4a('0x16')]=function(_0x1b4313,_0x3b71c0,_0x34bc01){io['to'](_0x1b4313)[_0xac4a('0x16')](_0x3b71c0,_0x34bc01);};VoiceDialReport[_0xac4a('0x14')][_0xac4a('0x17')]=function(_0x11e101){try{if(this[_0xac4a('0x18')](_0x11e101)){logger['debug'](_0xac4a('0x19'),_0x11e101[_0xac4a('0x1a')],util[_0xac4a('0x1b')](_0x11e101,{'showHidden':![],'depth':null}));if(this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]]){_[_0xac4a('0x1c')](this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xac4a('0x1d'),'interface':_0x11e101[_0xac4a('0x1e')][_0xac4a('0x1f')](0x0,_0x11e101['channel'][_0xac4a('0x20')]('-')),'membername':_0x11e101[_0xac4a('0x1e')][_0xac4a('0x1f')](_0x11e101[_0xac4a('0x1e')][_0xac4a('0x20')]('/')+0x1,_0x11e101[_0xac4a('0x1e')][_0xac4a('0x20')]('-'))},_[_0xac4a('0x21')](_0x11e101,['event',_0xac4a('0x22')]));logger[_0xac4a('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x11e101[_0xac4a('0x1a')],this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]][_0xac4a('0x24')],this['channels'][_0x11e101[_0xac4a('0x1a')]][_0xac4a('0x25')]);logger[_0xac4a('0x26')](_0xac4a('0x27'),_0x11e101[_0xac4a('0x1a')],util[_0xac4a('0x1b')](this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0xac4a('0xc')][_0x11e101[_0xac4a('0x1a')]])_[_0xac4a('0x1c')](this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]],this[_0xac4a('0xc')][_0x11e101[_0xac4a('0x1a')]]);this[_0xac4a('0x16')]('voice:outbound',_0xac4a('0x28'),this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]]);logger[_0xac4a('0x26')](_0xac4a('0x29'),_0x11e101['uniqueid'],util['inspect'](this[_0xac4a('0xa')][_0x11e101[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xac4a('0x16')]('custom:dialbegin',this['channels'][_0x11e101[_0xac4a('0x1a')]]);}}}catch(_0x2896bc){logger[_0xac4a('0x2a')](_0xac4a('0x2b'),_0x11e101[_0xac4a('0x1a')],util['inspect'](_0x2896bc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xac4a('0x14')]['syncDialEnd']=function(_0x30364b){try{if(this['isNotNull'](_0x30364b)){logger[_0xac4a('0x26')](_0xac4a('0x2c'),_0x30364b[_0xac4a('0x1a')],util[_0xac4a('0x1b')](_0x30364b,{'showHidden':![],'depth':null}));if(this[_0xac4a('0xa')][_0x30364b[_0xac4a('0x1a')]]){this[_0xac4a('0xa')][_0x30364b[_0xac4a('0x1a')]][_0xac4a('0x2d')]=_0x30364b[_0xac4a('0x2d')];if(_0x30364b[_0xac4a('0x2d')]===_0xac4a('0x2e')){this[_0xac4a('0xa')][_0x30364b[_0xac4a('0x1a')]]['connectedlinenum']=_0x30364b[_0xac4a('0x2f')];this[_0xac4a('0xa')][_0x30364b['uniqueid']][_0xac4a('0x30')]=_0x30364b[_0xac4a('0x30')];this['channels'][_0x30364b['uniqueid']][_0xac4a('0x31')]=moment()[_0xac4a('0x32')](_0xac4a('0x33'));this[_0xac4a('0xa')][_0x30364b['uniqueid']][_0xac4a('0x34')]=_0xac4a('0x35');logger['info'](_0xac4a('0x36'),_0x30364b[_0xac4a('0x1a')],_0x30364b[_0xac4a('0x1e')]['substring'](_0x30364b[_0xac4a('0x1e')][_0xac4a('0x20')]('/')+0x1,_0x30364b[_0xac4a('0x1e')]['lastIndexOf']('-')));logger[_0xac4a('0x26')](_0xac4a('0x37'),_0x30364b['uniqueid'],util['inspect'](this[_0xac4a('0xa')][_0x30364b['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialconnect',this['channels'][_0x30364b[_0xac4a('0x1a')]]);}logger[_0xac4a('0x26')](_0xac4a('0x38'),_0x30364b[_0xac4a('0x1a')],util[_0xac4a('0x1b')](this[_0xac4a('0xa')][_0x30364b[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));this[_0xac4a('0x16')](_0xac4a('0x39'),_0xac4a('0x28'),this[_0xac4a('0xa')][_0x30364b[_0xac4a('0x1a')]]);}}}catch(_0x4e4994){logger['error']('[%s][voiceDialReport][dialend]',_0x30364b[_0xac4a('0x1a')],util[_0xac4a('0x1b')](_0x4e4994,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xac4a('0x14')][_0xac4a('0x3a')]=function(_0x9efd8d){try{if(this[_0xac4a('0x18')](_0x9efd8d)){logger[_0xac4a('0x26')](_0xac4a('0x3b'),_0x9efd8d[_0xac4a('0x1a')],util[_0xac4a('0x1b')](_0x9efd8d,{'showHidden':![],'depth':null}));this['addVariable'](_0x9efd8d[_0xac4a('0x1a')],_[_0xac4a('0x3c')](_0x9efd8d[_0xac4a('0x3d')])[0x0],_0x9efd8d[_0xac4a('0x3e')]);if(this[_0xac4a('0x18')](_0x9efd8d['variable'])&&this[_0xac4a('0x18')](_0x9efd8d[_0xac4a('0x3d')]['outboundrouteid'])){if(_[_0xac4a('0x15')](this['channels'][_0x9efd8d[_0xac4a('0x1a')]])){this[_0xac4a('0xa')][_0x9efd8d[_0xac4a('0x1a')]]={'routeId':_0x9efd8d[_0xac4a('0x3e')],'variables':this[_0xac4a('0xd')][_0x9efd8d[_0xac4a('0x1a')]],'motionChannel':_0xac4a('0x3f')};logger[_0xac4a('0x23')](_0xac4a('0x40'),_0x9efd8d[_0xac4a('0x1a')],_0x9efd8d[_0xac4a('0x3d')][_0xac4a('0x41')],_['keys'](_0x9efd8d[_0xac4a('0x3d')])[0x0],_0x9efd8d[_0xac4a('0x3e')]);logger[_0xac4a('0x26')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x9efd8d[_0xac4a('0x1a')],util[_0xac4a('0x1b')](this['channels'][_0x9efd8d[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0xac4a('0x39'),_0xac4a('0x28'),this[_0xac4a('0xa')][_0x9efd8d['uniqueid']]);}}}}catch(_0x588374){logger[_0xac4a('0x2a')]('[%s][voiceDialReport][varset]',_0x9efd8d[_0xac4a('0x1a')],util['inspect'](_0x588374,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xac4a('0x14')]['addVariable']=function(_0x3be103,_0x369eb8,_0x424f9b){var _0x1c8c39=['rtpaudioqos',_0xac4a('0x42'),_0xac4a('0x43'),_0xac4a('0x44'),_0xac4a('0x45'),_0xac4a('0x46'),_0xac4a('0x47'),_0xac4a('0x48'),'sipcallid',_0xac4a('0x49'),_0xac4a('0x4a'),'bridgepvtcallid',_0xac4a('0x4b'),_0xac4a('0x4c'),_0xac4a('0x4d'),_0xac4a('0x4e'),'membername',_0xac4a('0x4f'),_0xac4a('0x50')];if(!_[_0xac4a('0x51')](_0x369eb8)&&!_[_0xac4a('0x52')](_0x1c8c39,_0x369eb8)){if(_[_0xac4a('0x15')](this['variables'][_0x3be103])){this[_0xac4a('0xd')][_0x3be103]={};}this['variables'][_0x3be103][_0x369eb8]=_0x424f9b;}};VoiceDialReport[_0xac4a('0x14')][_0xac4a('0x13')]=function(_0x4872e5){try{if(this['isNotNull'](_0x4872e5)){logger[_0xac4a('0x26')](_0xac4a('0x53'),_0x4872e5['uniqueid'],util[_0xac4a('0x1b')](_0x4872e5,{'showHidden':![],'depth':null}));if(this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]]){logger[_0xac4a('0x23')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x4872e5[_0xac4a('0x1a')],_0x4872e5[_0xac4a('0x54')]);this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x55')]=moment()[_0xac4a('0x32')](_0xac4a('0x33'));this['channels'][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x56')]=moment(this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x55')])[_0xac4a('0x57')](this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x58')],_0xac4a('0x59'));this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x34')]=_0xac4a('0x5a');this[_0xac4a('0x5b')][_0xac4a('0x5c')]+=0x1;if(this['channels'][_0x4872e5[_0xac4a('0x1a')]]['answertime']){this[_0xac4a('0x5b')]['answered']+=0x1;this[_0xac4a('0xa')][_0x4872e5['uniqueid']][_0xac4a('0x5d')]=moment(this['channels'][_0x4872e5['uniqueid']][_0xac4a('0x31')])[_0xac4a('0x57')](this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x58')],_0xac4a('0x59'));this['channels'][_0x4872e5[_0xac4a('0x1a')]]['billableseconds']=moment(this[_0xac4a('0xa')][_0x4872e5['uniqueid']][_0xac4a('0x55')])[_0xac4a('0x57')](this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x31')],_0xac4a('0x59'));this[_0xac4a('0x5b')][_0xac4a('0x5e')]+=this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x5d')]||0x0;this[_0xac4a('0x5b')][_0xac4a('0x5f')]+=this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]][_0xac4a('0x60')];}this[_0xac4a('0x5b')]['sumDuration']+=this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]]['duration'];logger[_0xac4a('0x26')](_0xac4a('0x61'),_0x4872e5[_0xac4a('0x1a')],util[_0xac4a('0x1b')](this[_0xac4a('0xa')][_0x4872e5['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xac4a('0x62'),this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]]);logger[_0xac4a('0x26')](_0xac4a('0x63'),_0x4872e5[_0xac4a('0x1a')],util[_0xac4a('0x1b')](this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));ami[_0xac4a('0x16')](_0xac4a('0x64'),this['channels'][_0x4872e5['uniqueid']]);logger[_0xac4a('0x26')](_0xac4a('0x65'),_0x4872e5[_0xac4a('0x1a')],util[_0xac4a('0x1b')](this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));this[_0xac4a('0x16')](_0xac4a('0x39'),_0xac4a('0x66'),this[_0xac4a('0x5b')]);logger[_0xac4a('0x23')](_0xac4a('0x67'),JSON['stringify'](this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]]));logger[_0xac4a('0x26')](_0xac4a('0x68'),_0x4872e5['uniqueid'],util[_0xac4a('0x1b')](this['channels'][_0x4872e5[_0xac4a('0x1a')]],{'showHidden':![],'depth':null}));this[_0xac4a('0x16')]('voice:outbound','voice_outbound_channel:remove',this[_0xac4a('0xa')][_0x4872e5[_0xac4a('0x1a')]]);delete this[_0xac4a('0xa')][_0x4872e5['uniqueid']];}else if(this[_0xac4a('0xa')][_0x4872e5['linkedid']]){this[_0xac4a('0xa')][_0x4872e5['linkedid']]['uniqueid']=this[_0xac4a('0xa')][_0x4872e5['linkedid']][_0xac4a('0x69')];}if(this['variables'][_0x4872e5[_0xac4a('0x1a')]]){delete this[_0xac4a('0xd')][_0x4872e5['uniqueid']];}}}catch(_0x3980ae){logger['error'](_0xac4a('0x6a'),_0x4872e5[_0xac4a('0x1a')],util['inspect'](_0x3980ae,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xac4a('0x14')]['syncNewExten']=function(_0x5a9111){try{if(this[_0xac4a('0x18')](_0x5a9111)){logger['debug'](_0xac4a('0x6b'),_0x5a9111['uniqueid'],util['inspect'](_0x5a9111,{'showHidden':![],'depth':null}));if(_0x5a9111[_0xac4a('0x6c')][_0xac4a('0x6d')]()===_0xac4a('0x6e')){_0x5a9111['applicationdata']=(_0x5a9111['appdata']||_0x5a9111[_0xac4a('0x6f')])[_0xac4a('0x6d')]();if(_['startsWith'](_0x5a9111['applicationdata'],_0xac4a('0x70'))){if(_[_0xac4a('0x15')](this[_0xac4a('0xc')][_0x5a9111[_0xac4a('0x1a')]]))this[_0xac4a('0xc')][_0x5a9111[_0xac4a('0x1a')]]={};logger[_0xac4a('0x23')](_0xac4a('0x71'),_0x5a9111[_0xac4a('0x1a')],_0x5a9111['application'],_0x5a9111[_0xac4a('0x6f')]);var _0x440dc4=_0x5a9111[_0xac4a('0x6f')]['split']('=');var _0x1d310c=_0x440dc4[0x0][_0xac4a('0x72')](/cdr\((.*)\)/);if(_0x1d310c)this[_0xac4a('0xc')][_0x5a9111[_0xac4a('0x1a')]][_0x1d310c[0x1]]=_0x440dc4[0x1];}}}}catch(_0x3d2b5c){logger['error'](_0xac4a('0x73'),_0x5a9111[_0xac4a('0x1a')],util[_0xac4a('0x1b')](_0x3d2b5c,{'showHidden':![],'depth':null}));}};module[_0xac4a('0x74')]=VoiceDialReport;
\ No newline at end of file
+var _0x31f0=['emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','channels','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','info','interface','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]','keys','variable','outboundrouteid','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','diff','starttime','seconds','total','answertime','holdtime','sumBillable','billableseconds','sumDuration','duration','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','startsWith','split','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined'];(function(_0x4023f9,_0x5ebeaa){var _0x24fa4e=function(_0xe09a3c){while(--_0xe09a3c){_0x4023f9['push'](_0x4023f9['shift']());}};_0x24fa4e(++_0x5ebeaa);}(_0x31f0,0xb7));var _0x031f=function(_0x3db083,_0x1ccaa5){_0x3db083=_0x3db083-0x0;var _0x3e2951=_0x31f0[_0x3db083];return _0x3e2951;};'use strict';var _=require(_0x031f('0x0'));var moment=require('moment');var util=require(_0x031f('0x1'));var Redis=require('ioredis');var config=require(_0x031f('0x2'));var logger=require(_0x031f('0x3'))(_0x031f('0x4'));var ami=require(_0x031f('0x5'));config['redis']=_[_0x031f('0x6')](config[_0x031f('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x3dc98e){this['channels']=_0x3dc98e[_0x031f('0x8')];this[_0x031f('0x9')]=_0x3dc98e[_0x031f('0x9')];this[_0x031f('0xa')]={};this['variables']={};ami['on'](_0x031f('0xb'),this[_0x031f('0xc')][_0x031f('0xd')](this));ami['on'](_0x031f('0xe'),this[_0x031f('0xf')][_0x031f('0xd')](this));ami['on'](_0x031f('0x10'),this[_0x031f('0x11')]['bind'](this));ami['on'](_0x031f('0x12'),this[_0x031f('0x13')][_0x031f('0xd')](this));}VoiceDialReport[_0x031f('0x14')][_0x031f('0x15')]=function(_0x405896){return _0x405896!==null&&!_[_0x031f('0x16')](_0x405896);};VoiceDialReport['prototype'][_0x031f('0x17')]=function(_0x23b40c,_0x17a699,_0x2e3dfe){io['to'](_0x23b40c)[_0x031f('0x17')](_0x17a699,_0x2e3dfe);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x1f08db){try{if(this[_0x031f('0x15')](_0x1f08db)){logger[_0x031f('0x18')](_0x031f('0x19'),_0x1f08db['uniqueid'],util[_0x031f('0x1a')](_0x1f08db,{'showHidden':![],'depth':null}));if(this[_0x031f('0x1b')][_0x1f08db['uniqueid']]){_[_0x031f('0x1c')](this['channels'][_0x1f08db[_0x031f('0x1d')]],{'starttime':moment()[_0x031f('0x1e')](_0x031f('0x1f')),'lastevent':_0x031f('0x20'),'interface':_0x1f08db[_0x031f('0x21')][_0x031f('0x22')](0x0,_0x1f08db[_0x031f('0x21')][_0x031f('0x23')]('-')),'membername':_0x1f08db[_0x031f('0x21')][_0x031f('0x22')](_0x1f08db[_0x031f('0x21')]['lastIndexOf']('/')+0x1,_0x1f08db[_0x031f('0x21')][_0x031f('0x23')]('-'))},_[_0x031f('0x24')](_0x1f08db,['event','privilege']));logger[_0x031f('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1f08db[_0x031f('0x1d')],this['channels'][_0x1f08db['uniqueid']]['membername'],this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]][_0x031f('0x26')]);logger[_0x031f('0x18')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1f08db[_0x031f('0x1d')],util['inspect'](this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));if(this[_0x031f('0xa')][_0x1f08db['uniqueid']])_[_0x031f('0x1c')](this[_0x031f('0x1b')][_0x1f08db['uniqueid']],this[_0x031f('0xa')][_0x1f08db[_0x031f('0x1d')]]);this[_0x031f('0x17')]('voice:outbound',_0x031f('0x27'),this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]]);logger[_0x031f('0x18')](_0x031f('0x28'),_0x1f08db[_0x031f('0x1d')],util['inspect'](this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x031f('0x17')](_0x031f('0x29'),this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]]);}}}catch(_0x378692){logger[_0x031f('0x2a')](_0x031f('0x2b'),_0x1f08db[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x378692,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x031f('0xf')]=function(_0xe5f11c){try{if(this[_0x031f('0x15')](_0xe5f11c)){logger[_0x031f('0x18')](_0x031f('0x2c'),_0xe5f11c[_0x031f('0x1d')],util[_0x031f('0x1a')](_0xe5f11c,{'showHidden':![],'depth':null}));if(this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]]){this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]][_0x031f('0x2d')]=_0xe5f11c[_0x031f('0x2d')];if(_0xe5f11c['dialstatus']===_0x031f('0x2e')){this[_0x031f('0x1b')][_0xe5f11c['uniqueid']][_0x031f('0x2f')]=_0xe5f11c[_0x031f('0x2f')];this['channels'][_0xe5f11c[_0x031f('0x1d')]][_0x031f('0x30')]=_0xe5f11c[_0x031f('0x30')];this[_0x031f('0x1b')][_0xe5f11c['uniqueid']]['answertime']=moment()[_0x031f('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]][_0x031f('0x31')]='connect';logger['info'](_0x031f('0x32'),_0xe5f11c['uniqueid'],_0xe5f11c['channel'][_0x031f('0x22')](_0xe5f11c[_0x031f('0x21')][_0x031f('0x23')]('/')+0x1,_0xe5f11c[_0x031f('0x21')][_0x031f('0x23')]('-')));logger[_0x031f('0x18')](_0x031f('0x33'),_0xe5f11c['uniqueid'],util[_0x031f('0x1a')](this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x031f('0x17')]('custom:dialconnect',this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]]);}logger[_0x031f('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0xe5f11c[_0x031f('0x1d')],util[_0x031f('0x1a')](this['channels'][_0xe5f11c[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this[_0x031f('0x17')]('voice:outbound','voice_outbound_channel:save',this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]]);}}}catch(_0x9efbc4){logger[_0x031f('0x2a')](_0x031f('0x34'),_0xe5f11c[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x9efbc4,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x031f('0x11')]=function(_0xe71615){try{if(this['isNotNull'](_0xe71615)){logger[_0x031f('0x18')]('[%s][voiceDialReport][varset]\x20event:',_0xe71615[_0x031f('0x1d')],util[_0x031f('0x1a')](_0xe71615,{'showHidden':![],'depth':null}));this['addVariable'](_0xe71615[_0x031f('0x1d')],_[_0x031f('0x35')](_0xe71615[_0x031f('0x36')])[0x0],_0xe71615['value']);if(this[_0x031f('0x15')](_0xe71615[_0x031f('0x36')])&&this[_0x031f('0x15')](_0xe71615[_0x031f('0x36')][_0x031f('0x37')])){if(_[_0x031f('0x16')](this[_0x031f('0x1b')][_0xe71615[_0x031f('0x1d')]])){this[_0x031f('0x1b')][_0xe71615['uniqueid']]={'routeId':_0xe71615[_0x031f('0x38')],'variables':this[_0x031f('0x39')][_0xe71615[_0x031f('0x1d')]],'motionChannel':_0x031f('0x3a')};logger[_0x031f('0x25')](_0x031f('0x3b'),_0xe71615[_0x031f('0x1d')],_0xe71615[_0x031f('0x36')][_0x031f('0x37')],_['keys'](_0xe71615[_0x031f('0x36')])[0x0],_0xe71615['value']);logger['debug'](_0x031f('0x3c'),_0xe71615[_0x031f('0x1d')],util[_0x031f('0x1a')](this[_0x031f('0x1b')][_0xe71615[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this['emit'](_0x031f('0x3d'),_0x031f('0x27'),this[_0x031f('0x1b')][_0xe71615['uniqueid']]);}}}}catch(_0x274166){logger[_0x031f('0x2a')](_0x031f('0x3e'),_0xe71615[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x274166,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x031f('0x14')]['addVariable']=function(_0x569d8f,_0xd28ade,_0x579b17){var _0x3b8c04=[_0x031f('0x3f'),'rtpaudioqosbridged',_0x031f('0x40'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x031f('0x41'),'rtpaudioqosrtt',_0x031f('0x42'),'sipcallid',_0x031f('0x43'),_0x031f('0x44'),'bridgepvtcallid',_0x031f('0x45'),_0x031f('0x46'),'memberinterface',_0x031f('0x47'),'membername',_0x031f('0x48'),'memberrealtime'];if(!_[_0x031f('0x49')](_0xd28ade)&&!_[_0x031f('0x4a')](_0x3b8c04,_0xd28ade)){if(_[_0x031f('0x16')](this[_0x031f('0x39')][_0x569d8f])){this[_0x031f('0x39')][_0x569d8f]={};}this['variables'][_0x569d8f][_0xd28ade]=_0x579b17;}};VoiceDialReport[_0x031f('0x14')]['syncHangup']=function(_0x186957){try{if(this[_0x031f('0x15')](_0x186957)){logger['debug'](_0x031f('0x4b'),_0x186957[_0x031f('0x1d')],util['inspect'](_0x186957,{'showHidden':![],'depth':null}));if(this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]){logger[_0x031f('0x25')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x186957[_0x031f('0x1d')],_0x186957['cause-txt']);this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x4c')]=moment()['format'](_0x031f('0x1f'));this[_0x031f('0x1b')][_0x186957['uniqueid']]['duration']=moment(this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]['endtime'])[_0x031f('0x4d')](this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x4e')],_0x031f('0x4f'));this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x31')]='complete';this[_0x031f('0x9')][_0x031f('0x50')]+=0x1;if(this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x51')]){this[_0x031f('0x9')]['answered']+=0x1;this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x52')]=moment(this[_0x031f('0x1b')][_0x186957['uniqueid']]['answertime'])['diff'](this['channels'][_0x186957[_0x031f('0x1d')]][_0x031f('0x4e')],'seconds');this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]['billableseconds']=moment(this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x4c')])[_0x031f('0x4d')](this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x51')],_0x031f('0x4f'));this[_0x031f('0x9')]['sumHoldTime']+=this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x52')]||0x0;this[_0x031f('0x9')][_0x031f('0x53')]+=this['channels'][_0x186957['uniqueid']][_0x031f('0x54')];}this[_0x031f('0x9')][_0x031f('0x55')]+=this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x56')];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x186957[_0x031f('0x1d')],util['inspect'](this['channels'][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x031f('0x17')](_0x031f('0x57'),this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x186957[_0x031f('0x1d')],util['inspect'](this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami['emit'](_0x031f('0x58'),this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]);logger[_0x031f('0x18')](_0x031f('0x59'),_0x186957[_0x031f('0x1d')],util['inspect'](this['channels'][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this[_0x031f('0x17')](_0x031f('0x3d'),_0x031f('0x5a'),this[_0x031f('0x9')]);logger[_0x031f('0x25')](_0x031f('0x5b'),JSON['stringify'](this['channels'][_0x186957['uniqueid']]));logger['debug'](_0x031f('0x5c'),_0x186957[_0x031f('0x1d')],util[_0x031f('0x1a')](this['channels'][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this[_0x031f('0x17')]('voice:outbound',_0x031f('0x5d'),this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]);delete this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]];}else if(this[_0x031f('0x1b')][_0x186957[_0x031f('0x5e')]]){this['channels'][_0x186957['linkedid']][_0x031f('0x1d')]=this['channels'][_0x186957[_0x031f('0x5e')]]['destuniqueid'];}if(this[_0x031f('0x39')][_0x186957[_0x031f('0x1d')]]){delete this[_0x031f('0x39')][_0x186957['uniqueid']];}}}catch(_0x46507a){logger['error'](_0x031f('0x5f'),_0x186957[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x46507a,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x031f('0x60')]=function(_0x398e7c){try{if(this[_0x031f('0x15')](_0x398e7c)){logger[_0x031f('0x18')](_0x031f('0x61'),_0x398e7c['uniqueid'],util['inspect'](_0x398e7c,{'showHidden':![],'depth':null}));if(_0x398e7c[_0x031f('0x62')][_0x031f('0x63')]()==='set'){_0x398e7c[_0x031f('0x64')]=(_0x398e7c['appdata']||_0x398e7c[_0x031f('0x64')])[_0x031f('0x63')]();if(_[_0x031f('0x65')](_0x398e7c[_0x031f('0x64')],'cdr(')){if(_[_0x031f('0x16')](this[_0x031f('0xa')][_0x398e7c[_0x031f('0x1d')]]))this['applications'][_0x398e7c[_0x031f('0x1d')]]={};logger[_0x031f('0x25')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x398e7c[_0x031f('0x1d')],_0x398e7c[_0x031f('0x62')],_0x398e7c[_0x031f('0x64')]);var _0x2fb2a8=_0x398e7c[_0x031f('0x64')][_0x031f('0x66')]('=');var _0x3f3582=_0x2fb2a8[0x0]['match'](/cdr\((.*)\)/);if(_0x3f3582)this[_0x031f('0xa')][_0x398e7c[_0x031f('0x1d')]][_0x3f3582[0x1]]=_0x2fb2a8[0x1];}}}}catch(_0x23cc40){logger['error']('[%s][voiceDialReport][newexten]',_0x398e7c[_0x031f('0x1d')],util['inspect'](_0x23cc40,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c1f=['isUndefined','queuecallerjoinAt','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','keys','[%s][voiceQueueReport][queuecallerabandon]','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','membername','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','seconds','transfertype','FORWARD','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','handleHangup','length','sumHoldTime','diff','ATTENDEDTRANSFER','COMPLETEDBYAGENT','milliseconds','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumDuration','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','syncHangup','cause','cause-txt','transferid','[%s][voiceQueueReport][hangup]','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','transferuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','application','applicationdata','appdata','cdr(','match','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','localhost','prototype','enqueue','tail','sequence','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','syncQueueSummary','bind','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','pTalking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','switch','isNil','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','queueReports','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','queue','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','queuecallerexitreason','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','then','actionid','queuestatus','createQueueSummaryReport','summaryEvent','createReport','handleInboundQueueSummaryReport','assign','emitInboundVoiceQueueSummary','custom:queuesummary','statusRequests','syncQueueSummaryComplete','completeEvent','syncQueueMember','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]'];(function(_0x1cdae1,_0x39e125){var _0x4a3893=function(_0x555908){while(--_0x555908){_0x1cdae1['push'](_0x1cdae1['shift']());}};_0x4a3893(++_0x39e125);}(_0x2c1f,0x162));var _0xf2c1=function(_0x48d8e7,_0x5a9030){_0x48d8e7=_0x48d8e7-0x0;var _0x50beed=_0x2c1f[_0x48d8e7];return _0x50beed;};'use strict';var _=require('lodash');var moment=require(_0xf2c1('0x0'));var util=require(_0xf2c1('0x1'));var Redis=require(_0xf2c1('0x2'));var config=require(_0xf2c1('0x3'));var logger=require(_0xf2c1('0x4'))(_0xf2c1('0x5'));var ami=require(_0xf2c1('0x6'));var QueueReport=require(_0xf2c1('0x7'));var VoiceQueueSummary=require(_0xf2c1('0x8'));config[_0xf2c1('0x9')]=_['defaults'](config[_0xf2c1('0x9')],{'host':_0xf2c1('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf2c1('0x9')]));var Sequence=function(){};Sequence[_0xf2c1('0xb')][_0xf2c1('0xc')]=function(_0x1f59ca){this[_0xf2c1('0xd')]=this['tail']?this[_0xf2c1('0xd')]['finally'](_0x1f59ca):_0x1f59ca();};function VoiceQueueReport(_0x220346){this[_0xf2c1('0xe')]=new Sequence();this['queueReports']={};this[_0xf2c1('0xf')]=_0x220346;this[_0xf2c1('0x10')]=_0x220346[_0xf2c1('0x10')];this[_0xf2c1('0x11')]=_0x220346[_0xf2c1('0x12')];this[_0xf2c1('0x13')]=_0x220346[_0xf2c1('0x13')];this['campaigns']=_0x220346[_0xf2c1('0x14')];this[_0xf2c1('0x15')]=initializeSummary();this[_0xf2c1('0x16')]={};ami['on'](_0xf2c1('0x17'),this[_0xf2c1('0x18')][_0xf2c1('0x19')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xf2c1('0x19')](this));ami['on']('queuemember',this['syncQueueMember'][_0xf2c1('0x19')](this));ami['on']('queuestatuscomplete',this[_0xf2c1('0x1a')][_0xf2c1('0x19')](this));ami['on'](_0xf2c1('0x1b'),this[_0xf2c1('0x1c')][_0xf2c1('0x19')](this));ami['on'](_0xf2c1('0x1d'),this[_0xf2c1('0x1e')][_0xf2c1('0x19')](this));ami['on']('queuecallerleave',this[_0xf2c1('0x1f')][_0xf2c1('0x19')](this));ami['on'](_0xf2c1('0x20'),this[_0xf2c1('0x21')][_0xf2c1('0x19')](this));ami['on'](_0xf2c1('0x22'),this[_0xf2c1('0x23')][_0xf2c1('0x19')](this));ami['on'](_0xf2c1('0x24'),this[_0xf2c1('0x25')][_0xf2c1('0x19')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('fullybooted',this[_0xf2c1('0x26')]['bind'](this));ami['on'](_0xf2c1('0x27'),this[_0xf2c1('0x28')][_0xf2c1('0x19')](this));ami['on'](_0xf2c1('0x29'),this[_0xf2c1('0x2a')][_0xf2c1('0x19')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xf2c1('0x2b')]['bind'](this));this[_0xf2c1('0x2c')]();this[_0xf2c1('0x2d')]();}function clearChannels(_0x3cde44){if(!_[_0xf2c1('0x2e')](_0x3cde44)){for(var _0x3f7797 in _0x3cde44){if(_0x3cde44['hasOwnProperty'](_0x3f7797)){delete _0x3cde44[_0x3f7797];}}}}function clearCampaigns(_0x4e2f78){if(!_['isEmpty'](_0x4e2f78)){for(var _0x562a85 in _0x4e2f78){if(_0x4e2f78['hasOwnProperty'](_0x562a85)){_0x4e2f78[_0x562a85][_0xf2c1('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x56c5a8){if(!_['isEmpty'](_0x56c5a8)){for(var _0x558ae0 in _0x56c5a8){if(_0x56c5a8[_0xf2c1('0x30')](_0x558ae0)){_0x56c5a8[_0x558ae0][_0xf2c1('0x2f')]=0x0;_0x56c5a8[_0x558ae0][_0xf2c1('0x31')]=0x0;_0x56c5a8[_0x558ae0][_0xf2c1('0x32')]=0x0;_0x56c5a8[_0x558ae0][_0xf2c1('0x33')]=0x0;_0x56c5a8[_0x558ae0][_0xf2c1('0x34')]=!![];}}}}function clearAgentBooked(_0x4aa776){if(!_[_0xf2c1('0x2e')](_0x4aa776)){for(var _0x248309 in _0x4aa776){if(_0x4aa776[_0xf2c1('0x30')](_0x248309)){_0x4aa776[_0x248309][_0xf2c1('0x35')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x214ddb){return _0x214ddb[_0xf2c1('0x36')]||_0x214ddb[_0xf2c1('0x1d')]||_0x214ddb[_0xf2c1('0x37')];}VoiceQueueReport[_0xf2c1('0xb')]['clearZombieChannels']=function(){var _0x101e84=this;for(var _0xcc7694 in this[_0xf2c1('0x11')]){if(this['channels']['hasOwnProperty'](_0xcc7694)&&!this[_0xf2c1('0x11')][_0xcc7694][_0xf2c1('0x38')]){this['sequence'][_0xf2c1('0xc')](function(){if(!_[_0xf2c1('0x39')](_0x101e84['channels'][_0xcc7694])){return ami['Action']({'action':_0xf2c1('0x3a'),'channel':_0x101e84[_0xf2c1('0x11')][_0xcc7694][_0xf2c1('0x3b')]})[_0xf2c1('0x3c')](function(_0x23748a){if(_0x23748a[_0xf2c1('0x3d')]===_0xf2c1('0x3e')){setTimeout(function(){if(_0x101e84[_0xf2c1('0x11')][_0xcc7694]){delete _0x101e84[_0xf2c1('0x11')][_0xcc7694];logger[_0xf2c1('0x3f')](_0xf2c1('0x40'),_0xcc7694,util['inspect'](_0x23748a,{'showHidden':![],'depth':null}));}if(_0x101e84[_0xf2c1('0x41')][_0xcc7694]){delete _0x101e84['queueReports'][_0xcc7694];logger[_0xf2c1('0x3f')](_0xf2c1('0x42'),_0xcc7694,util[_0xf2c1('0x43')](_0x23748a,{'showHidden':![],'depth':null}));}if(_0x101e84['variables'][_0xcc7694]){delete _0x101e84['variables'][_0xcc7694];logger[_0xf2c1('0x3f')](_0xf2c1('0x44'),_0xcc7694,util[_0xf2c1('0x43')](_0x23748a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x26')]=function(){logger['error'](_0xf2c1('0x45'));clearChannels(this[_0xf2c1('0x11')]);this[_0xf2c1('0x46')](this[_0xf2c1('0x41')]);clearAgentBooked(this[_0xf2c1('0x10')]);clearVoiceQueues(this[_0xf2c1('0x13')]);clearCampaigns(this[_0xf2c1('0x14')]);this[_0xf2c1('0x15')]=initializeSummary();};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x46')]=function(_0x444a05){var _0x25b9d9=this;if(!_[_0xf2c1('0x2e')](_0x444a05)){for(var _0x4b96c5 in _0x444a05){if(_0x444a05['hasOwnProperty'](_0x4b96c5)){_0x25b9d9[_0xf2c1('0x47')](_0x444a05[_0x4b96c5],_0xf2c1('0x48'));delete _0x444a05[_0x4b96c5];}}}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x49')]=function(_0x76a09c,_0x26d0bb,_0x2e152b){io['to'](_0x76a09c)['emit'](_0x26d0bb,_0x2e152b);};VoiceQueueReport['prototype'][_0xf2c1('0x4a')]=function(_0x24c837,_0x87e627){logger[_0xf2c1('0x4b')](_0xf2c1('0x4c')+_0x87e627+_0xf2c1('0x4d'),_0x24c837['uniqueid'],util[_0xf2c1('0x43')](_0x24c837,{'showHidden':![],'depth':null}));this['emit'](util[_0xf2c1('0x4e')]('voice:queue:%s',_0x24c837[_0xf2c1('0x4f')]),_0xf2c1('0x50'),_0x24c837);io[_0xf2c1('0x49')](_0xf2c1('0x51'),_0x24c837);};VoiceQueueReport[_0xf2c1('0xb')]['emitVoiceQueueChannelRemove']=function(_0xac8e27,_0xc9fdf9){logger[_0xf2c1('0x4b')](_0xf2c1('0x4c')+_0xc9fdf9+_0xf2c1('0x52'),_0xac8e27[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0xac8e27,{'showHidden':![],'depth':null}));if(_0xac8e27[_0xf2c1('0x54')]==='ATTENDEDTRANSFER'){return;}this[_0xf2c1('0x49')](util[_0xf2c1('0x4e')](_0xf2c1('0x55'),_0xac8e27[_0xf2c1('0x4f')]),_0xf2c1('0x56'),_0xac8e27);io[_0xf2c1('0x49')](_0xf2c1('0x57'),_0xac8e27);};VoiceQueueReport[_0xf2c1('0xb')]['emitInboundVoiceQueueSummary']=function(_0x3c4693){if(_0x3c4693[_0xf2c1('0x58')]===_0xf2c1('0x59')){logger['debug'](_0xf2c1('0x5a'),util[_0xf2c1('0x43')](_0x3c4693,{'showHidden':![],'depth':null}));this['emit'](util[_0xf2c1('0x4e')](_0xf2c1('0x55'),_0x3c4693[_0xf2c1('0x5b')]),_0xf2c1('0x5c'),_0x3c4693);}};VoiceQueueReport['prototype'][_0xf2c1('0x5d')]=function(_0x240298){return _0x240298!==null&&!_['isUndefined'](_0x240298);};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x2d')]=function(){var _0x4043ed=this;setInterval(function(){_0x4043ed[_0xf2c1('0x5e')]();ami[_0xf2c1('0x5f')]({'action':_0xf2c1('0x60')})[_0xf2c1('0x3c')](function(_0x5652e4){logger[_0xf2c1('0x3f')](_0xf2c1('0x61'),util['inspect'](_0x5652e4,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x2c')]=function(){var _0x4892bc=this;setInterval(function(){if(!_0x4892bc['summary']['isRunning']){return ami[_0xf2c1('0x5f')]({'action':_0xf2c1('0x17')})[_0xf2c1('0x62')](function(_0x486596){_0x4892bc[_0xf2c1('0x15')]['id']=_0x486596[_0xf2c1('0x63')];_0x4892bc['summary']['isRunning']=!![];_0x4892bc['summary'][_0xf2c1('0x64')][_0x486596[_0xf2c1('0x63')]]={};})[_0xf2c1('0x3c')](function(_0x526de1){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x526de1,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x65')]=function(_0x35d56f,_0x51091f){var _0x58edaa;if(this['summary']&&this['summary']['queues']&&this[_0xf2c1('0x15')][_0xf2c1('0x60')][_0x35d56f[_0xf2c1('0x5b')]]){_0x58edaa=this['summary'][_0xf2c1('0x60')][_0x35d56f[_0xf2c1('0x5b')]][_0xf2c1('0x66')];}var _0x2e8ec9=new VoiceQueueSummary(_0x35d56f);return _0x2e8ec9[_0xf2c1('0x67')](_0x51091f[_0xf2c1('0x10')],this['agents'],_0x58edaa,this[_0xf2c1('0xf')]['channels']);};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x68')]=function(_0x5b1583,_0xcc29cc){var _0x108b76=this[_0xf2c1('0x65')](_0x5b1583,_0xcc29cc);var _0x42aee7=![];_0x42aee7=_0x108b76['compareToInboundQueue'](_0x5b1583);if(_0x42aee7){Object[_0xf2c1('0x69')](_0x5b1583,_0x108b76);this[_0xf2c1('0xf')][_0xf2c1('0x13')][_0x5b1583['name']]=_0x5b1583;this[_0xf2c1('0x6a')](_0x108b76);}};VoiceQueueReport[_0xf2c1('0xb')]['syncQueueStatusComplete']=function(_0x48ed62){var _0x366968=null;var _0x345c4c=this[_0xf2c1('0x15')]['id'];if(this[_0xf2c1('0x15')]['queuestatus'][_0x345c4c]){_0x366968=this[_0xf2c1('0x15')][_0xf2c1('0x64')][_0x345c4c][_0x48ed62[_0xf2c1('0x63')]];}if(!_0x366968){this[_0xf2c1('0x15')]=initializeSummary();return;}var _0x5a08b7=this['voiceQueues'][_0x366968[_0xf2c1('0x4f')]];if(_0x5a08b7[_0xf2c1('0x58')]===_0xf2c1('0x59')){this[_0xf2c1('0x68')](_0x5a08b7,_0x366968);}else if(_0x5a08b7[_0xf2c1('0x58')]==='outbound'){var _0x13304e=this[_0xf2c1('0x65')](_0x5a08b7,_0x366968);ami['emit'](_0xf2c1('0x6b'),_0x13304e);}this[_0xf2c1('0x15')][_0xf2c1('0x6c')]-=0x1;var _0x480f6f=this[_0xf2c1('0x15')][_0xf2c1('0x6c')]>0x0?!![]:![];if(!_0x480f6f){return this[_0xf2c1('0x6d')](this[_0xf2c1('0x15')][_0xf2c1('0x6e')]);}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x6f')]=function(_0x2fbae0){var _0xc38d35=this['summary']['id'];if(this[_0xf2c1('0x15')][_0xf2c1('0x64')][_0xc38d35]&&this['summary'][_0xf2c1('0x64')][_0xc38d35][_0x2fbae0[_0xf2c1('0x63')]]){this[_0xf2c1('0x15')]['queuestatus'][_0xc38d35][_0x2fbae0['actionid']][_0xf2c1('0x10')][_0xf2c1('0x70')](_0x2fbae0);}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x18')]=function(_0xeca0b8){var _0x37eed8=this;try{if(this[_0xf2c1('0x5d')](_0xeca0b8)&&this[_0xf2c1('0x5d')](_0xeca0b8['queue'])){logger[_0xf2c1('0x4b')](_0xf2c1('0x71'),util[_0xf2c1('0x43')](_0xeca0b8,{'showHidden':![],'depth':null}));var _0x22ae04=this[_0xf2c1('0x13')][_0xeca0b8[_0xf2c1('0x4f')]];if(_0x22ae04){logger['debug'](_0xf2c1('0x72'),_0x22ae04[_0xf2c1('0x5b')]);this[_0xf2c1('0x15')]['queues'][_0x22ae04[_0xf2c1('0x5b')]]={'summaryEvent':_0xeca0b8};this[_0xf2c1('0x15')]['statusRequests']+=0x1;return ami[_0xf2c1('0x5f')]({'action':'queuestatus','queue':_0x22ae04[_0xf2c1('0x5b')]})[_0xf2c1('0x62')](function(_0x1511a2){if(!_0x37eed8[_0xf2c1('0x15')][_0xf2c1('0x64')][_0xeca0b8[_0xf2c1('0x63')]]){_0x37eed8[_0xf2c1('0x15')]['queuestatus'][_0xeca0b8['actionid']]={};}_0x37eed8[_0xf2c1('0x15')][_0xf2c1('0x64')][_0xeca0b8[_0xf2c1('0x63')]][_0x1511a2[_0xf2c1('0x63')]]={'queue':_0x22ae04['name'],'agents':[]};})[_0xf2c1('0x3c')](function(_0x26f8cf){throw _0x26f8cf;});}}}catch(_0x51192b){logger['error'](_0xf2c1('0x73'),util[_0xf2c1('0x43')](_0x51192b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x6d')]=function(_0x51d26c){if(this['summary'][_0xf2c1('0x6c')]>0x0){this['summary'][_0xf2c1('0x6e')]=_0x51d26c;return;}logger[_0xf2c1('0x4b')](_0xf2c1('0x74'),util[_0xf2c1('0x43')](_0x51d26c,{'showHidden':![],'depth':null}));this[_0xf2c1('0x15')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x1c')]=function(_0x3cef99){try{if(this[_0xf2c1('0x5d')](_0x3cef99)){logger[_0xf2c1('0x4b')](_0xf2c1('0x75'),_0x3cef99['uniqueid'],util[_0xf2c1('0x43')](_0x3cef99,{'showHidden':![],'depth':null}));if(_[_0xf2c1('0x76')](this[_0xf2c1('0x41')][_0x3cef99[_0xf2c1('0x53')]])){this[_0xf2c1('0x41')][_0x3cef99[_0xf2c1('0x53')]]=[];}if(_[_0xf2c1('0x76')](this[_0xf2c1('0x11')][_0x3cef99[_0xf2c1('0x53')]])){this[_0xf2c1('0x11')][_0x3cef99[_0xf2c1('0x53')]]={};}var _0x1c2ae0=new QueueReport();_0x1c2ae0['queue']=_0x3cef99[_0xf2c1('0x4f')];_0x1c2ae0[_0xf2c1('0x58')]=this['voiceQueues'][_0x1c2ae0[_0xf2c1('0x4f')]]&&this[_0xf2c1('0x13')][_0x1c2ae0[_0xf2c1('0x4f')]][_0xf2c1('0x58')]?this[_0xf2c1('0x13')][_0x1c2ae0['queue']][_0xf2c1('0x58')]||_0xf2c1('0x59'):_0xf2c1('0x59');_0x1c2ae0[_0xf2c1('0x77')]=moment()[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c2ae0['position']=_0x3cef99[_0xf2c1('0x78')];_0x1c2ae0[_0xf2c1('0x79')]=_0x3cef99['count'];_0x1c2ae0['uniqueid']=_0x3cef99[_0xf2c1('0x53')];_0x1c2ae0[_0xf2c1('0x7a')]=this['channels'][_0x3cef99['uniqueid']][_0xf2c1('0x7a')];logger[_0xf2c1('0x7b')](_0xf2c1('0x7c'),_0x1c2ae0[_0xf2c1('0x4f')],_0x1c2ae0[_0xf2c1('0x58')]);Object[_0xf2c1('0x69')](_0x1c2ae0,_['pick'](_0x3cef99,_[_0xf2c1('0x7d')](_0x1c2ae0)));this['queueReports'][_0x3cef99['uniqueid']][_0xf2c1('0x70')](_0x1c2ae0);this[_0xf2c1('0x11')][_0x3cef99[_0xf2c1('0x53')]]=_0x1c2ae0;this['emitVoiceQueueChannelSave'](_0x1c2ae0,_0xf2c1('0x1b'));}}catch(_0x5ceff9){logger[_0xf2c1('0x3f')](_0xf2c1('0x75'),_0x3cef99[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x5ceff9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')]['syncQueueCallerAbandon']=function(_0x574978){try{if(this[_0xf2c1('0x5d')](_0x574978)){logger[_0xf2c1('0x4b')](_0xf2c1('0x7e'),_0x574978[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x574978,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x574978[_0xf2c1('0x53')]]){var _0x272233=_['last'](this[_0xf2c1('0x41')][_0x574978['uniqueid']]);_0x272233[_0xf2c1('0x37')]=![];_0x272233['queuecallercompleteAt']=null;_0x272233[_0xf2c1('0x7f')]=_0x574978['holdtime'];_0x272233[_0xf2c1('0x80')]=_0x574978[_0xf2c1('0x80')];_0x272233[_0xf2c1('0x1d')]=!![];_0x272233['queuecallerabandonAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0x272233[_0xf2c1('0x54')]=_0xf2c1('0x82');_0x272233['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x272233[_0xf2c1('0x4f')],_0x272233[_0xf2c1('0x58')]);this[_0xf2c1('0x11')][_0x574978['uniqueid']]=_0x272233;this['emitVoiceQueueChannelRemove'](_0x272233,_0xf2c1('0x1d'));}}}catch(_0x3aec91){logger['error'](_0xf2c1('0x7e'),_0x574978[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x3aec91,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5b193e){try{if(this[_0xf2c1('0x5d')](_0x5b193e)){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b193e['uniqueid'],util[_0xf2c1('0x43')](_0x5b193e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5b193e[_0xf2c1('0x53')]]){var _0x3d0b60=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x5b193e[_0xf2c1('0x53')]]);_0x3d0b60[_0xf2c1('0x84')]=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0x3d0b60[_0xf2c1('0x85')]=_0x5b193e['connectedlinenum'];_0x3d0b60[_0xf2c1('0x86')]=_0x5b193e[_0xf2c1('0x86')];logger['info'](_0xf2c1('0x87'),_0x3d0b60[_0xf2c1('0x4f')],_0x3d0b60[_0xf2c1('0x58')],_0x5b193e[_0xf2c1('0x85')],_0x5b193e[_0xf2c1('0x86')]);this[_0xf2c1('0x11')][_0x5b193e[_0xf2c1('0x53')]]=_0x3d0b60;this[_0xf2c1('0x4a')](_0x3d0b60,'queuecallerleave');}}}catch(_0x4d71ae){logger[_0xf2c1('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b193e[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x4d71ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf2c1('0x23')]=function(_0x271001){try{if(this[_0xf2c1('0x5d')](_0x271001)){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][agentconnect]',_0x271001[_0xf2c1('0x53')],util['inspect'](_0x271001,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x271001[_0xf2c1('0x53')]]){var _0x3f369b=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x271001[_0xf2c1('0x53')]]);_0x3f369b['queuecallercomplete']=!![];_0x3f369b[_0xf2c1('0x54')]='COMPLETEDBYAGENT';logger[_0xf2c1('0x7b')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x3f369b[_0xf2c1('0x4f')],_0x3f369b[_0xf2c1('0x58')]);}}}catch(_0x5c3686){logger[_0xf2c1('0x3f')](_0xf2c1('0x88'),_0x271001['uniqueid'],util[_0xf2c1('0x43')](_0x5c3686,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf2c1('0x21')]=function(_0x4f6032){try{if(this[_0xf2c1('0x5d')](_0x4f6032)){logger[_0xf2c1('0x4b')](_0xf2c1('0x89'),_0x4f6032[_0xf2c1('0x53')],util['inspect'](_0x4f6032,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x53')]]){var _0x307680=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x53')]]);_0x307680[_0xf2c1('0x1d')]=![];_0x307680[_0xf2c1('0x8a')]=null;_0x307680['assigned']=!![];_0x307680['lastAssignedTo']=_0x4f6032[_0xf2c1('0x8b')];_0x307680[_0xf2c1('0x7f')]=_0x4f6032[_0xf2c1('0x7f')];_0x307680[_0xf2c1('0x37')]=!![];_0x307680[_0xf2c1('0x36')]=![];_0x307680['queuecallerexitAt']=null;if(!_0x307680[_0xf2c1('0x8c')]){if(_0x4f6032[_0xf2c1('0x8d')]==_0xf2c1('0x8c')){_0x307680[_0xf2c1('0x54')]='COMPLETED';logger[_0xf2c1('0x7b')](_0xf2c1('0x8e'),_0x307680[_0xf2c1('0x4f')],_0x307680['type']);}else{if(_[_0xf2c1('0x8f')](_0x4f6032['channel'][_0xf2c1('0x90')](),_0xf2c1('0x91'))){if(this['queueReports'][_0x4f6032[_0xf2c1('0x92')]]){var _0x2b65ed=_[_0xf2c1('0x83')](this['queueReports'][_0x4f6032[_0xf2c1('0x92')]]);_0x2b65ed[_0xf2c1('0x37')]=![];_0x2b65ed['queuecallerexit']=!![];_0x2b65ed[_0xf2c1('0x93')]=moment(_0x307680[_0xf2c1('0x77')])['add'](_0x4f6032['holdtime'],_0xf2c1('0x94'))[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b65ed[_0xf2c1('0x54')]='FORWARDTRANSFER';_0x2b65ed[_0xf2c1('0x8c')]=!![];_0x2b65ed[_0xf2c1('0x95')]=_0xf2c1('0x96');_0x2b65ed['transferexten']=_0x4f6032[_0xf2c1('0x97')];_0x2b65ed['transferuniqueid']=_0x4f6032[_0xf2c1('0x53')];logger['info'](_0xf2c1('0x98'),_0x2b65ed[_0xf2c1('0x4f')],_0x2b65ed['type']);var _0x4b5f64=this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x92')]];this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x92')]]=this[_0xf2c1('0x41')][_0x4f6032['uniqueid']];this[_0xf2c1('0x41')][_0x4f6032[_0xf2c1('0x53')]]=_0x4b5f64;}}else{_0x307680[_0xf2c1('0x54')]=_0xf2c1('0x99')+_0x4f6032[_0xf2c1('0x8d')][_0xf2c1('0x9a')]();logger[_0xf2c1('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x307680[_0xf2c1('0x4f')],_0x307680['type'],_0x307680[_0xf2c1('0x54')]);}}}this[_0xf2c1('0x11')][_0x4f6032[_0xf2c1('0x53')]]=_0x307680;}}}catch(_0x59dbcd){logger[_0xf2c1('0x3f')](_0xf2c1('0x89'),_0x4f6032['uniqueid'],util[_0xf2c1('0x43')](_0x59dbcd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x25')]=function(_0x40b8f6){try{if(this[_0xf2c1('0x5d')](_0x40b8f6)){logger['debug'](_0xf2c1('0x9b'),_0x40b8f6['uniqueid'],util[_0xf2c1('0x43')](_0x40b8f6,{'showHidden':![],'depth':null}));this[_0xf2c1('0x9c')](_0x40b8f6[_0xf2c1('0x53')],_[_0xf2c1('0x7d')](_0x40b8f6[_0xf2c1('0x9d')])[0x0],_0x40b8f6[_0xf2c1('0x9e')]);if(this['queueReports'][_0x40b8f6[_0xf2c1('0x53')]]){var _0xd6a167=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x40b8f6[_0xf2c1('0x53')]]);if(_0xd6a167){if(this['isNotNull'](_0x40b8f6[_0xf2c1('0x9d')])&&this['isNotNull'](_0x40b8f6[_0xf2c1('0x9d')][_0xf2c1('0x64')])){switch(_0x40b8f6[_0xf2c1('0x9e')]){case _0xf2c1('0x9f'):_0xd6a167[_0xf2c1('0x36')]=![];_0xd6a167[_0xf2c1('0x93')]=null;break;case'TIMEOUT':_0xd6a167[_0xf2c1('0xa0')]=_0xf2c1('0xa1');_0xd6a167[_0xf2c1('0x36')]=!![];_0xd6a167[_0xf2c1('0x93')]=moment()[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0xd6a167[_0xf2c1('0x84')]=moment()[_0xf2c1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xf2c1('0x4b')](_0xf2c1('0xa2'),_0x40b8f6[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0xd6a167,{'showHidden':![],'depth':null}));ami[_0xf2c1('0x49')]('custom:timeout',_0xd6a167);break;default:_0xd6a167[_0xf2c1('0x36')]=!![];_0xd6a167['queuecallerexitAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0xd6a167[_0xf2c1('0x84')]=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));}_0xd6a167[_0xf2c1('0x1d')]=![];_0xd6a167[_0xf2c1('0x8a')]=null;_0xd6a167['queuecallerexitreason']=_0x40b8f6['value'];this[_0xf2c1('0x11')][_0x40b8f6[_0xf2c1('0x53')]]=_0xd6a167;this['emitVoiceQueueChannelRemove'](_0xd6a167,_0xf2c1('0x24'));}else if(this[_0xf2c1('0x5d')](_0x40b8f6[_0xf2c1('0x9d')])&&this[_0xf2c1('0x5d')](_0x40b8f6[_0xf2c1('0x9d')][_0xf2c1('0xa3')])){if(!_0xd6a167['queuecallerabandon']){_0xd6a167[_0xf2c1('0x36')]=!![];_0xd6a167[_0xf2c1('0x93')]=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0xd6a167['queuecallerexitreason']=_0xf2c1('0xa4');_0xd6a167['queuecallerleaveAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));this[_0xf2c1('0x11')][_0x40b8f6['uniqueid']]=_0xd6a167;}}logger['info'](_0xf2c1('0xa5'),_0x40b8f6['uniqueid'],_0xd6a167[_0xf2c1('0x4f')],_0xd6a167[_0xf2c1('0x58')],_[_0xf2c1('0x7d')](_0x40b8f6[_0xf2c1('0x9d')])[0x0],_0x40b8f6[_0xf2c1('0x9e')]);_0xd6a167[_0xf2c1('0x16')]=this[_0xf2c1('0x16')][_0x40b8f6[_0xf2c1('0x53')]];}}}}catch(_0x3280b5){logger[_0xf2c1('0x3f')]('[%s][voiceQueueReport][varset]',_0x40b8f6['uniqueid'],util['inspect'](_0x3280b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x9c')]=function(_0x5f4557,_0x19c38b,_0x242da6){var _0xd4bf41=[_0xf2c1('0xa6'),_0xf2c1('0xa7'),_0xf2c1('0xa8'),_0xf2c1('0xa9'),_0xf2c1('0xaa'),_0xf2c1('0xab'),_0xf2c1('0xac'),_0xf2c1('0xad'),'sipcallid',_0xf2c1('0xae'),_0xf2c1('0xaf'),'bridgepvtcallid',_0xf2c1('0xb0'),_0xf2c1('0xb1'),_0xf2c1('0xb2'),'memberlastcall',_0xf2c1('0x8b'),_0xf2c1('0xb3'),_0xf2c1('0xb4')];if(!_[_0xf2c1('0x39')](_0x19c38b)&&!_['includes'](_0xd4bf41,_0x19c38b)){if(_[_0xf2c1('0x76')](this[_0xf2c1('0x16')][_0x5f4557])){this[_0xf2c1('0x16')][_0x5f4557]={};}this[_0xf2c1('0x16')][_0x5f4557][_0x19c38b]=_0x242da6;}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0xb5')]=function(_0x5567d1,_0x1f9101,_0x120e7d){try{var _0x3e0800={};if(this['queueReports'][_0x5567d1]){for(var _0x425581=0x0;_0x425581<this[_0xf2c1('0x41')][_0x5567d1][_0xf2c1('0xb6')];_0x425581+=0x1){_0x3e0800=this[_0xf2c1('0x41')][_0x5567d1][_0x425581];var _0x33f963=this[_0xf2c1('0x13')][_0x3e0800[_0xf2c1('0x4f')]];if(_0x33f963){_0x33f963[_0xf2c1('0xb7')]+=moment(_0x3e0800['queuecallerleaveAt'])[_0xf2c1('0xb8')](_0x3e0800[_0xf2c1('0x77')],_0xf2c1('0x94'))||0x0;if(_0x120e7d&&_0x3e0800[_0xf2c1('0x54')]===_0xf2c1('0xb9')){_0x3e0800[_0xf2c1('0x54')]=_0xf2c1('0xba');}if(_0x425581===this[_0xf2c1('0x41')][_0x5567d1]['length']-0x1){_0x33f963['sumDuration']+=moment()[_0xf2c1('0xbb')](0x0)[_0xf2c1('0xb8')](_0x3e0800[_0xf2c1('0x77')],_0xf2c1('0x94'));if(hasCallerLeftTheQueue(_0x3e0800)&&_0x3e0800['queuecallerexitreason']!==_0xf2c1('0xb9')){_0x33f963[_0xf2c1('0xbc')]+=0x1;}if(_0x3e0800[_0xf2c1('0x37')]){_0x33f963[_0xf2c1('0xbd')]+=0x1;_0x33f963[_0xf2c1('0xbe')]+=moment()[_0xf2c1('0xbb')](0x0)[_0xf2c1('0xb8')](_0x3e0800[_0xf2c1('0x84')],_0xf2c1('0x94'));_0x3e0800['queuecallercompleteAt']=moment()[_0xf2c1('0x4e')](_0xf2c1('0x81'));_0x3e0800[_0xf2c1('0x36')]=![];_0x3e0800[_0xf2c1('0x93')]=null;}if(_0x3e0800['queuecallerexit']&&_0x3e0800[_0xf2c1('0x8c')]!=!![]){_0x33f963[_0xf2c1('0xbf')]+=0x1;_0x3e0800[_0xf2c1('0xa0')]='unmanaged';logger['debug'](_0xf2c1('0xc0'),_0x5567d1,util[_0xf2c1('0x43')](_0x3e0800,{'showHidden':![],'depth':null}));ami[_0xf2c1('0x49')](_0xf2c1('0xc1'),_0x3e0800);}if(_0x3e0800[_0xf2c1('0x1d')]){_0x33f963[_0xf2c1('0xc2')]+=0x1;_0x3e0800[_0xf2c1('0xa0')]=_0xf2c1('0xc2');logger[_0xf2c1('0x4b')](_0xf2c1('0xc3'),_0x5567d1,util[_0xf2c1('0x43')](_0x3e0800,{'showHidden':![],'depth':null}));ami[_0xf2c1('0x49')](_0xf2c1('0xc4'),_0x3e0800);}}else{_0x33f963[_0xf2c1('0xc5')]+=_0x33f963[_0xf2c1('0xb7')];}logger['info'](_0xf2c1('0xc6'),_0x5567d1,_0x3e0800[_0xf2c1('0x4f')],_0x3e0800[_0xf2c1('0x58')],_0x1f9101);this[_0xf2c1('0x11')][_0x5567d1]=_0x3e0800;Object[_0xf2c1('0x69')](this[_0xf2c1('0x13')][_0x3e0800[_0xf2c1('0x4f')]],_0x33f963);if(_0x3e0800[_0xf2c1('0x84')]){this[_0xf2c1('0x47')](_0x3e0800,_0xf2c1('0xc7'));}}}logger[_0xf2c1('0x4b')](_0xf2c1('0xc8'),_0x5567d1,util[_0xf2c1('0x43')](this['queueReports'][_0x5567d1],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x3e0800)&&_0x3e0800['queuecallerexitreason']!=='ATTENDEDTRANSFER'){ami[_0xf2c1('0x49')]('custom:voiceQueueReport',this['queueReports'][_0x5567d1]);if(this['queueReports'][_0x5567d1]){delete this[_0xf2c1('0x41')][_0x5567d1];}if(this['channels'][_0x5567d1]){delete this[_0xf2c1('0x11')][_0x5567d1];}if(this[_0xf2c1('0x16')][_0x5567d1]){delete this[_0xf2c1('0x16')][_0x5567d1];}}}}catch(_0x3e0d33){logger[_0xf2c1('0x3f')]('[%s][voiceQueueReport][handleHangup]',_0x5567d1,util[_0xf2c1('0x43')](_0x3e0d33,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0xc9')]=function(_0x437d33){try{if(this[_0xf2c1('0x5d')](_0x437d33)){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][hangup]',_0x437d33[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x437d33,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x437d33[_0xf2c1('0x53')]]){return this['handleHangup'](_0x437d33[_0xf2c1('0x53')],_0x437d33['cause-txt'],![]);}if(this[_0xf2c1('0x41')][_0x437d33['linkedid']]){if(_0x437d33[_0xf2c1('0xca')]==='21'){return;}return this[_0xf2c1('0xb5')](_0x437d33['linkedid'],_0x437d33[_0xf2c1('0xcb')],!![]);}var _0x199a9c=Object[_0xf2c1('0x7d')](this[_0xf2c1('0x41')]);for(var _0x15a58d=0x0;_0x15a58d<_0x199a9c[_0xf2c1('0xb6')];_0x15a58d++){var _0x5c9d47=_['last'](this[_0xf2c1('0x41')][_0x199a9c[_0x15a58d]]);if(_0x5c9d47&&_0x5c9d47[_0xf2c1('0xcc')]===_0x437d33[_0xf2c1('0x53')]){return this[_0xf2c1('0xb5')](_0x5c9d47[_0xf2c1('0x53')],_0x437d33[_0xf2c1('0xcb')],!![]);}}if(!this[_0xf2c1('0x41')][_0x437d33[_0xf2c1('0x53')]]){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0x437d33[_0xf2c1('0x53')]);if(this['channels'][_0x437d33[_0xf2c1('0x53')]]){delete this['channels'][_0x437d33[_0xf2c1('0x53')]];}if(this[_0xf2c1('0x16')][_0x437d33[_0xf2c1('0x53')]]){delete this[_0xf2c1('0x16')][_0x437d33['uniqueid']];}}}}catch(_0x1ccbb9){logger[_0xf2c1('0x3f')](_0xf2c1('0xcd'),_0x437d33[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x1ccbb9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0xce')]=function(_0x1e8636){try{if(this[_0xf2c1('0x5d')](_0x1e8636)){logger[_0xf2c1('0x4b')](_0xf2c1('0xcf'),_0x1e8636[_0xf2c1('0x53')],util['inspect'](_0x1e8636,{'showHidden':![],'depth':null}));var _0x2a605c;var _0x9520e;var _0x34ea72;if(this['queueReports'][_0x1e8636[_0xf2c1('0xd0')]]){_0x2a605c=_['last'](this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd0')]]);_0x2a605c[_0xf2c1('0xd1')]=_0x1e8636[_0xf2c1('0xd2')];_0x2a605c['transferuniqueid']=_0x1e8636[_0xf2c1('0xd3')];_0x2a605c[_0xf2c1('0x54')]=_0xf2c1('0xb9');_0x2a605c['transfer']=!![];_0x2a605c[_0xf2c1('0x95')]=_0xf2c1('0xd4');if(this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd3')]]){_0x34ea72=this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd3')]];this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd3')]]=this['queueReports'][_0x1e8636[_0xf2c1('0xd0')]];this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd0')]]=_0x34ea72;_0x9520e=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd0')]]);_0x9520e[_0xf2c1('0x38')]=!![];}logger[_0xf2c1('0x7b')](_0xf2c1('0xd5'),_0x1e8636[_0xf2c1('0x53')],_0x2a605c[_0xf2c1('0x4f')],_0x2a605c[_0xf2c1('0x58')],_0x2a605c[_0xf2c1('0xd1')],_0x2a605c['transferuniqueid']);}else if(this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd6')]]){_0x2a605c=_['last'](this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd6')]]);_0x2a605c[_0xf2c1('0xd1')]=_0x1e8636['origtransfererexten'];_0x2a605c[_0xf2c1('0xd7')]=_0x1e8636[_0xf2c1('0xd8')];_0x2a605c[_0xf2c1('0x54')]=_0xf2c1('0xb9');_0x2a605c[_0xf2c1('0x8c')]=!![];_0x2a605c[_0xf2c1('0x95')]=_0xf2c1('0xd4');if(this['queueReports'][_0x1e8636[_0xf2c1('0xd8')]]){_0x34ea72=this[_0xf2c1('0x41')][_0x1e8636['origtransfereruniqueid']];this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd8')]]=this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd6')]];this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd6')]]=_0x34ea72;_0x9520e=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd6')]]);_0x9520e[_0xf2c1('0x38')]=!![];}logger[_0xf2c1('0x7b')](_0xf2c1('0xd5'),_0x1e8636[_0xf2c1('0x53')],_0x2a605c[_0xf2c1('0x4f')],_0x2a605c[_0xf2c1('0x58')],_0x2a605c[_0xf2c1('0xd1')],_0x2a605c[_0xf2c1('0xd7')]);}else if(this[_0xf2c1('0x41')][_0x1e8636['origtransfereruniqueid']]){_0x2a605c=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd8')]]);_0x2a605c[_0xf2c1('0xd1')]=_0x1e8636['origtransfererexten'];_0x2a605c[_0xf2c1('0xd7')]=_0x1e8636['origtransfereruniqueid'];_0x2a605c[_0xf2c1('0x54')]=_0xf2c1('0xb9');_0x2a605c['transfer']=!![];_0x2a605c[_0xf2c1('0x95')]=_0xf2c1('0xd4');_0x2a605c[_0xf2c1('0x38')]=!![];_0x2a605c[_0xf2c1('0xcc')]=_0x1e8636['transfereeuniqueid'];}else if(this[_0xf2c1('0x41')][_0x1e8636[_0xf2c1('0xd3')]]){_0x2a605c=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x1e8636['secondtransfereruniqueid']]);_0x2a605c[_0xf2c1('0xd1')]=_0x1e8636[_0xf2c1('0xd2')];_0x2a605c['transferuniqueid']=_0x1e8636['secondtransfereruniqueid'];_0x2a605c[_0xf2c1('0x54')]=_0xf2c1('0xb9');_0x2a605c[_0xf2c1('0x8c')]=!![];_0x2a605c[_0xf2c1('0x95')]='ATTENDED';_0x2a605c['switch']=!![];_0x2a605c[_0xf2c1('0xcc')]=_0x1e8636['transfertargetuniqueid'];}}}catch(_0x17e030){logger[_0xf2c1('0x3f')](_0xf2c1('0xcf'),_0x1e8636[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x17e030,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')]['syncBlindTransfer']=function(_0x270c16){try{if(this[_0xf2c1('0x5d')](_0x270c16)){logger[_0xf2c1('0x4b')](_0xf2c1('0xd9'),_0x270c16['uniqueid'],util[_0xf2c1('0x43')](_0x270c16,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x270c16['transfereeuniqueid']]){var _0x87b356=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x270c16[_0xf2c1('0xd0')]]);_0x87b356[_0xf2c1('0x54')]='BLINDTRANSFER';_0x87b356['transfer']=!![];_0x87b356['transfertype']=_0xf2c1('0xda');_0x87b356['transferexten']=_0x270c16[_0xf2c1('0xdb')];_0x87b356[_0xf2c1('0xd7')]=_0x270c16['transfereeuniqueid'];logger[_0xf2c1('0x7b')](_0xf2c1('0xdc'),_0x270c16[_0xf2c1('0x53')],_0x87b356['queue'],_0x87b356[_0xf2c1('0x58')],_0x87b356[_0xf2c1('0xd1')],_0x87b356[_0xf2c1('0xd7')]);this[_0xf2c1('0xc9')]({'event':_0xf2c1('0xdd'),'uniqueid':_0x270c16['transfereeuniqueid'],'context':_0x270c16[_0xf2c1('0xde')],'channel':_0x270c16[_0xf2c1('0xdf')]});}}}catch(_0x11659d){logger[_0xf2c1('0x3f')](_0xf2c1('0xd9'),_0x270c16[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x11659d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')][_0xf2c1('0x28')]=function(_0x564cdc){try{if(this['isNotNull'](_0x564cdc)){logger[_0xf2c1('0x4b')](_0xf2c1('0xe0'),_0x564cdc[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x564cdc,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x564cdc[_0xf2c1('0x53')]]){var _0x119fea=_[_0xf2c1('0x83')](this[_0xf2c1('0x41')][_0x564cdc[_0xf2c1('0x53')]]);if(!_[_0xf2c1('0x39')](_0x119fea[_0xf2c1('0x84')])){_0x119fea[_0xf2c1('0xe1')]=moment()['format'](_0xf2c1('0x81'));logger[_0xf2c1('0x7b')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x564cdc['uniqueid'],_0x119fea[_0xf2c1('0xe1')]);}}}}catch(_0x2124cd){logger[_0xf2c1('0x3f')](_0xf2c1('0xe0'),_0x564cdc['uniqueid'],util[_0xf2c1('0x43')](_0x2124cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf2c1('0xb')]['syncMusicOnHoldStop']=function(_0x29f0cd){try{if(this['isNotNull'](_0x29f0cd)){logger[_0xf2c1('0x4b')](_0xf2c1('0xe2'),_0x29f0cd[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x29f0cd,{'showHidden':![],'depth':null}));if(this[_0xf2c1('0x41')][_0x29f0cd[_0xf2c1('0x53')]]){var _0xa3ea10=_['last'](this[_0xf2c1('0x41')][_0x29f0cd['uniqueid']]);if(!_[_0xf2c1('0x39')](_0xa3ea10[_0xf2c1('0xe1')])){_0xa3ea10[_0xf2c1('0xe3')]+=moment()[_0xf2c1('0xbb')](0x0)['diff'](_0xa3ea10[_0xf2c1('0xe1')],_0xf2c1('0x94'));logger[_0xf2c1('0x7b')](_0xf2c1('0xe4'),_0x29f0cd[_0xf2c1('0x53')],_0xa3ea10['mohtime']);delete _0xa3ea10['mohstarttime'];}}}}catch(_0x2a0294){logger[_0xf2c1('0x3f')]('[%s][voiceQueueReport][musiconholdstop]',_0x29f0cd[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x2a0294,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncNewExten']=function(_0x511799){try{if(this[_0xf2c1('0x5d')](_0x511799)){logger[_0xf2c1('0x4b')]('[%s][voiceQueueReport][newexten]\x20event:',_0x511799[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x511799,{'showHidden':![],'depth':null}));if(_0x511799[_0xf2c1('0xe5')]['toLowerCase']()==='set'){_0x511799[_0xf2c1('0xe6')]=_0x511799['appdata']&&_0x511799[_0xf2c1('0xe7')][_0xf2c1('0x8f')]('CDR(routeAlias)')?_0x511799[_0xf2c1('0xe7')]:(_0x511799['appdata']||_0x511799['applicationdata'])[_0xf2c1('0x90')]();if(_[_0xf2c1('0x8f')](_0x511799[_0xf2c1('0xe6')]['toLowerCase'](),_0xf2c1('0xe8'))){logger[_0xf2c1('0x7b')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x511799[_0xf2c1('0x53')],_0x511799[_0xf2c1('0xe5')],_0x511799[_0xf2c1('0xe6')]);if(_[_0xf2c1('0x76')](this[_0xf2c1('0x11')][_0x511799[_0xf2c1('0x53')]]))this[_0xf2c1('0x11')][_0x511799['uniqueid']]={};var _0x43b96b=_0x511799[_0xf2c1('0xe6')]['split']('=');var _0x3c6426=_0x43b96b[0x0][_0xf2c1('0x90')]()[_0xf2c1('0xe9')](/cdr\((.*)\)/);if(_0x3c6426)this[_0xf2c1('0x11')][_0x511799[_0xf2c1('0x53')]][_0x3c6426[0x1]]=_0x43b96b[0x1];}}}}catch(_0x54c40c){logger[_0xf2c1('0x3f')](_0xf2c1('0xea'),_0x511799[_0xf2c1('0x53')],util[_0xf2c1('0x43')](_0x54c40c,{'showHidden':![],'depth':null}));}};module[_0xf2c1('0xeb')]=VoiceQueueReport;
\ No newline at end of file
+var _0xbdc2=['mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','match','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','realtime','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','queuestatuscomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queuecallerexit','queuecallerabandon','clearZombieChannels','switch','enqueue','isNil','Action','channel','catch','message','No\x20such\x20channel','inspect','queueReports','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','summary','emitVoiceQueueChannelRemove','emit','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','actionid','isRunning','queuestatus','[voiceQueueReport][queuesummary]','summaryEvent','createReport','handleInboundQueueSummaryReport','assign','type','outbound','createQueueSummaryReport','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','emitVoiceQueueChannelSave','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','queuecallerabandonAt','ABANDONED','lastAssignedTo','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][agentcomplete]','addVariable','keys','variable','value','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberinterface','memberlastcall','includes','length','sumHoldTime','diff','sumDuration','milliseconds','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','handleHangup','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transferid','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]'];(function(_0x147cfa,_0x6c3360){var _0x472588=function(_0x21a6bb){while(--_0x21a6bb){_0x147cfa['push'](_0x147cfa['shift']());}};_0x472588(++_0x6c3360);}(_0xbdc2,0x1f2));var _0x2bdc=function(_0x393909,_0x2e0350){_0x393909=_0x393909-0x0;var _0x27d291=_0xbdc2[_0x393909];return _0x27d291;};'use strict';var _=require(_0x2bdc('0x0'));var moment=require(_0x2bdc('0x1'));var util=require(_0x2bdc('0x2'));var Redis=require(_0x2bdc('0x3'));var config=require(_0x2bdc('0x4'));var logger=require(_0x2bdc('0x5'))(_0x2bdc('0x6'));var ami=require(_0x2bdc('0x7'));var QueueReport=require(_0x2bdc('0x8'));var VoiceQueueSummary=require(_0x2bdc('0x9'));config[_0x2bdc('0xa')]=_[_0x2bdc('0xb')](config[_0x2bdc('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x2bdc('0xc'))(new Redis(config[_0x2bdc('0xa')]));var Sequence=function(){};Sequence[_0x2bdc('0xd')]['enqueue']=function(_0x43c535){this[_0x2bdc('0xe')]=this[_0x2bdc('0xe')]?this[_0x2bdc('0xe')][_0x2bdc('0xf')](_0x43c535):_0x43c535();};function VoiceQueueReport(_0x22d108){this[_0x2bdc('0x10')]=new Sequence();this['queueReports']={};this[_0x2bdc('0x11')]=_0x22d108;this['agents']=_0x22d108[_0x2bdc('0x12')];this[_0x2bdc('0x13')]=_0x22d108[_0x2bdc('0x14')];this[_0x2bdc('0x15')]=_0x22d108[_0x2bdc('0x15')];this['campaigns']=_0x22d108[_0x2bdc('0x16')];this['summary']=initializeSummary();this[_0x2bdc('0x17')]={};ami['on'](_0x2bdc('0x18'),this[_0x2bdc('0x19')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x1b'),this[_0x2bdc('0x1c')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x1d'),this[_0x2bdc('0x1e')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x1f'),this['syncQueueStatusComplete']['bind'](this));ami['on'](_0x2bdc('0x20'),this[_0x2bdc('0x21')][_0x2bdc('0x1a')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x22'),this['syncQueueCallerLeave'][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x23'),this[_0x2bdc('0x24')]['bind'](this));ami['on'](_0x2bdc('0x25'),this[_0x2bdc('0x26')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x27'),this[_0x2bdc('0x28')]['bind'](this));ami['on'](_0x2bdc('0x29'),this[_0x2bdc('0x2a')][_0x2bdc('0x1a')](this));ami['on']('fullybooted',this[_0x2bdc('0x2b')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x2c'),this['syncMusicOnHoldStart'][_0x2bdc('0x1a')](this));ami['on']('musiconholdstop',this[_0x2bdc('0x2d')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x2e'),this[_0x2bdc('0x2f')][_0x2bdc('0x1a')](this));ami['on'](_0x2bdc('0x30'),this[_0x2bdc('0x31')][_0x2bdc('0x1a')](this));this['loopQueueSummary']();this[_0x2bdc('0x32')]();}function clearChannels(_0x562264){if(!_[_0x2bdc('0x33')](_0x562264)){for(var _0x533136 in _0x562264){if(_0x562264[_0x2bdc('0x34')](_0x533136)){delete _0x562264[_0x533136];}}}}function clearCampaigns(_0x19bd37){if(!_[_0x2bdc('0x33')](_0x19bd37)){for(var _0x2f8724 in _0x19bd37){if(_0x19bd37['hasOwnProperty'](_0x2f8724)){_0x19bd37[_0x2f8724]['originated']=0x0;}}}}function clearVoiceQueues(_0x54d941){if(!_['isEmpty'](_0x54d941)){for(var _0x2b1858 in _0x54d941){if(_0x54d941['hasOwnProperty'](_0x2b1858)){_0x54d941[_0x2b1858][_0x2bdc('0x35')]=0x0;_0x54d941[_0x2b1858][_0x2bdc('0x36')]=0x0;_0x54d941[_0x2b1858][_0x2bdc('0x37')]=0x0;_0x54d941[_0x2b1858][_0x2bdc('0x38')]=0x0;_0x54d941[_0x2b1858]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x2b9a14){if(!_['isEmpty'](_0x2b9a14)){for(var _0x5350f5 in _0x2b9a14){if(_0x2b9a14[_0x2bdc('0x34')](_0x5350f5)){_0x2b9a14[_0x5350f5]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x2c492d){return _0x2c492d[_0x2bdc('0x39')]||_0x2c492d[_0x2bdc('0x3a')]||_0x2c492d['queuecallercomplete'];}VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x3b')]=function(){var _0x1d42af=this;for(var _0x2ea77b in this['channels']){if(this[_0x2bdc('0x13')][_0x2bdc('0x34')](_0x2ea77b)&&!this[_0x2bdc('0x13')][_0x2ea77b][_0x2bdc('0x3c')]){this[_0x2bdc('0x10')][_0x2bdc('0x3d')](function(){if(!_[_0x2bdc('0x3e')](_0x1d42af[_0x2bdc('0x13')][_0x2ea77b])){return ami[_0x2bdc('0x3f')]({'action':'status','channel':_0x1d42af['channels'][_0x2ea77b][_0x2bdc('0x40')]})[_0x2bdc('0x41')](function(_0x2b3606){if(_0x2b3606[_0x2bdc('0x42')]===_0x2bdc('0x43')){setTimeout(function(){if(_0x1d42af['channels'][_0x2ea77b]){delete _0x1d42af['channels'][_0x2ea77b];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x2ea77b,util[_0x2bdc('0x44')](_0x2b3606,{'showHidden':![],'depth':null}));}if(_0x1d42af[_0x2bdc('0x45')][_0x2ea77b]){delete _0x1d42af[_0x2bdc('0x45')][_0x2ea77b];logger[_0x2bdc('0x46')](_0x2bdc('0x47'),_0x2ea77b,util[_0x2bdc('0x44')](_0x2b3606,{'showHidden':![],'depth':null}));}if(_0x1d42af[_0x2bdc('0x17')][_0x2ea77b]){delete _0x1d42af['variables'][_0x2ea77b];logger['error'](_0x2bdc('0x48'),_0x2ea77b,util[_0x2bdc('0x44')](_0x2b3606,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x2b')]=function(){logger['error'](_0x2bdc('0x49'));clearChannels(this[_0x2bdc('0x13')]);this[_0x2bdc('0x4a')](this['queueReports']);clearAgentBooked(this[_0x2bdc('0x12')]);clearVoiceQueues(this[_0x2bdc('0x15')]);clearCampaigns(this['campaigns']);this[_0x2bdc('0x4b')]=initializeSummary();};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x4a')]=function(_0x6b2860){var _0x7c265d=this;if(!_['isEmpty'](_0x6b2860)){for(var _0x22abad in _0x6b2860){if(_0x6b2860[_0x2bdc('0x34')](_0x22abad)){_0x7c265d[_0x2bdc('0x4c')](_0x6b2860[_0x22abad],'clearqueuereport');delete _0x6b2860[_0x22abad];}}}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x4d')]=function(_0x268c99,_0x483ae9,_0x17777b){io['to'](_0x268c99)[_0x2bdc('0x4d')](_0x483ae9,_0x17777b);};VoiceQueueReport[_0x2bdc('0xd')]['emitVoiceQueueChannelSave']=function(_0x435e54,_0xe27ab8){logger['debug'](_0x2bdc('0x4e')+_0xe27ab8+']\x20sending\x20voice_queue_channel:save\x20event:',_0x435e54[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x435e54,{'showHidden':![],'depth':null}));this['emit'](util[_0x2bdc('0x50')](_0x2bdc('0x51'),_0x435e54[_0x2bdc('0x52')]),_0x2bdc('0x53'),_0x435e54);io[_0x2bdc('0x4d')](_0x2bdc('0x54'),_0x435e54);};VoiceQueueReport[_0x2bdc('0xd')]['emitVoiceQueueChannelRemove']=function(_0x5c6d74,_0x3e8c01){logger[_0x2bdc('0x55')](_0x2bdc('0x4e')+_0x3e8c01+_0x2bdc('0x56'),_0x5c6d74[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x5c6d74,{'showHidden':![],'depth':null}));if(_0x5c6d74[_0x2bdc('0x57')]===_0x2bdc('0x58')){return;}this[_0x2bdc('0x4d')](util[_0x2bdc('0x50')]('voice:queue:%s',_0x5c6d74['queue']),_0x2bdc('0x59'),_0x5c6d74);io[_0x2bdc('0x4d')](_0x2bdc('0x5a'),_0x5c6d74);};VoiceQueueReport['prototype'][_0x2bdc('0x5b')]=function(_0x15482a){if(_0x15482a['type']===_0x2bdc('0x5c')){logger[_0x2bdc('0x55')](_0x2bdc('0x5d'),util[_0x2bdc('0x44')](_0x15482a,{'showHidden':![],'depth':null}));this[_0x2bdc('0x4d')](util[_0x2bdc('0x50')](_0x2bdc('0x51'),_0x15482a[_0x2bdc('0x5e')]),_0x2bdc('0x5f'),_0x15482a);}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x60')]=function(_0x8c9da1){return _0x8c9da1!==null&&!_[_0x2bdc('0x61')](_0x8c9da1);};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x32')]=function(){var _0x39a316=this;setInterval(function(){_0x39a316[_0x2bdc('0x3b')]();ami[_0x2bdc('0x3f')]({'action':_0x2bdc('0x62')})[_0x2bdc('0x41')](function(_0x481ea2){logger[_0x2bdc('0x46')](_0x2bdc('0x63'),util[_0x2bdc('0x44')](_0x481ea2,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x2bdc('0xd')]['loopQueueSummary']=function(){var _0x5ea564=this;setInterval(function(){if(!_0x5ea564[_0x2bdc('0x4b')]['isRunning']){return ami['Action']({'action':_0x2bdc('0x18')})[_0x2bdc('0x64')](function(_0x31baa1){_0x5ea564['summary']['id']=_0x31baa1[_0x2bdc('0x65')];_0x5ea564[_0x2bdc('0x4b')][_0x2bdc('0x66')]=!![];_0x5ea564['summary'][_0x2bdc('0x67')][_0x31baa1['actionid']]={};})[_0x2bdc('0x41')](function(_0xde23d1){logger['error'](_0x2bdc('0x68'),util[_0x2bdc('0x44')](_0xde23d1,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x2bdc('0xd')]['createQueueSummaryReport']=function(_0x3edd7a,_0x131477){var _0x276708;if(this[_0x2bdc('0x4b')]&&this[_0x2bdc('0x4b')]['queues']&&this[_0x2bdc('0x4b')][_0x2bdc('0x62')][_0x3edd7a[_0x2bdc('0x5e')]]){_0x276708=this['summary']['queues'][_0x3edd7a[_0x2bdc('0x5e')]][_0x2bdc('0x69')];}var _0x305401=new VoiceQueueSummary(_0x3edd7a);return _0x305401[_0x2bdc('0x6a')](_0x131477['agents'],this[_0x2bdc('0x12')],_0x276708,this[_0x2bdc('0x11')]['channels']);};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x6b')]=function(_0x1a0059,_0x45cec7){var _0x18d663=this['createQueueSummaryReport'](_0x1a0059,_0x45cec7);var _0x579b34=![];_0x579b34=_0x18d663['compareToInboundQueue'](_0x1a0059);if(_0x579b34){Object[_0x2bdc('0x6c')](_0x1a0059,_0x18d663);this[_0x2bdc('0x11')][_0x2bdc('0x15')][_0x1a0059[_0x2bdc('0x5e')]]=_0x1a0059;this[_0x2bdc('0x5b')](_0x18d663);}};VoiceQueueReport[_0x2bdc('0xd')]['syncQueueStatusComplete']=function(_0x749f79){var _0x362ae6=null;var _0x5dbde6=this['summary']['id'];if(this[_0x2bdc('0x4b')][_0x2bdc('0x67')][_0x5dbde6]){_0x362ae6=this[_0x2bdc('0x4b')][_0x2bdc('0x67')][_0x5dbde6][_0x749f79['actionid']];}if(!_0x362ae6){this[_0x2bdc('0x4b')]=initializeSummary();return;}var _0xba8825=this[_0x2bdc('0x15')][_0x362ae6[_0x2bdc('0x52')]];if(_0xba8825[_0x2bdc('0x6d')]===_0x2bdc('0x5c')){this[_0x2bdc('0x6b')](_0xba8825,_0x362ae6);}else if(_0xba8825[_0x2bdc('0x6d')]===_0x2bdc('0x6e')){var _0x38e023=this[_0x2bdc('0x6f')](_0xba8825,_0x362ae6);ami[_0x2bdc('0x4d')](_0x2bdc('0x70'),_0x38e023);}this[_0x2bdc('0x4b')][_0x2bdc('0x71')]-=0x1;var _0x5ddca2=this['summary'][_0x2bdc('0x71')]>0x0?!![]:![];if(!_0x5ddca2){return this['syncQueueSummaryComplete'](this['summary'][_0x2bdc('0x72')]);}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x1e')]=function(_0x39caea){var _0x256d1d=this['summary']['id'];if(this[_0x2bdc('0x4b')][_0x2bdc('0x67')][_0x256d1d]&&this[_0x2bdc('0x4b')]['queuestatus'][_0x256d1d][_0x39caea[_0x2bdc('0x65')]]){this[_0x2bdc('0x4b')][_0x2bdc('0x67')][_0x256d1d][_0x39caea[_0x2bdc('0x65')]][_0x2bdc('0x12')][_0x2bdc('0x73')](_0x39caea);}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x19')]=function(_0x226663){var _0x17b8ac=this;try{if(this[_0x2bdc('0x60')](_0x226663)&&this['isNotNull'](_0x226663[_0x2bdc('0x52')])){logger[_0x2bdc('0x55')](_0x2bdc('0x74'),util[_0x2bdc('0x44')](_0x226663,{'showHidden':![],'depth':null}));var _0x12ec45=this[_0x2bdc('0x15')][_0x226663['queue']];if(_0x12ec45){logger['debug'](_0x2bdc('0x75'),_0x12ec45[_0x2bdc('0x5e')]);this[_0x2bdc('0x4b')][_0x2bdc('0x62')][_0x12ec45[_0x2bdc('0x5e')]]={'summaryEvent':_0x226663};this['summary']['statusRequests']+=0x1;return ami[_0x2bdc('0x3f')]({'action':_0x2bdc('0x67'),'queue':_0x12ec45['name']})['then'](function(_0x440547){if(!_0x17b8ac['summary']['queuestatus'][_0x226663[_0x2bdc('0x65')]]){_0x17b8ac[_0x2bdc('0x4b')][_0x2bdc('0x67')][_0x226663[_0x2bdc('0x65')]]={};}_0x17b8ac['summary'][_0x2bdc('0x67')][_0x226663[_0x2bdc('0x65')]][_0x440547['actionid']]={'queue':_0x12ec45[_0x2bdc('0x5e')],'agents':[]};})[_0x2bdc('0x41')](function(_0xce5a9a){throw _0xce5a9a;});}}}catch(_0x466d31){logger[_0x2bdc('0x46')](_0x2bdc('0x68'),util['inspect'](_0x466d31,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x1c')]=function(_0x25ed3a){if(this[_0x2bdc('0x4b')]['statusRequests']>0x0){this['summary'][_0x2bdc('0x72')]=_0x25ed3a;return;}logger[_0x2bdc('0x55')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x2bdc('0x44')](_0x25ed3a,{'showHidden':![],'depth':null}));this[_0x2bdc('0x4b')]=initializeSummary();ami['emit'](_0x2bdc('0x76'),{});};VoiceQueueReport[_0x2bdc('0xd')]['syncQueueCallerJoin']=function(_0x5a1944){try{if(this[_0x2bdc('0x60')](_0x5a1944)){logger[_0x2bdc('0x55')](_0x2bdc('0x77'),_0x5a1944[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x5a1944,{'showHidden':![],'depth':null}));if(_[_0x2bdc('0x61')](this[_0x2bdc('0x45')][_0x5a1944[_0x2bdc('0x4f')]])){this[_0x2bdc('0x45')][_0x5a1944['uniqueid']]=[];}if(_[_0x2bdc('0x61')](this[_0x2bdc('0x13')][_0x5a1944['uniqueid']])){this[_0x2bdc('0x13')][_0x5a1944['uniqueid']]={};}var _0x4cc020=new QueueReport();_0x4cc020[_0x2bdc('0x52')]=_0x5a1944[_0x2bdc('0x52')];_0x4cc020[_0x2bdc('0x6d')]=this[_0x2bdc('0x15')][_0x4cc020['queue']]&&this['voiceQueues'][_0x4cc020[_0x2bdc('0x52')]][_0x2bdc('0x6d')]?this[_0x2bdc('0x15')][_0x4cc020[_0x2bdc('0x52')]][_0x2bdc('0x6d')]||'inbound':_0x2bdc('0x5c');_0x4cc020[_0x2bdc('0x78')]=moment()[_0x2bdc('0x50')](_0x2bdc('0x79'));_0x4cc020[_0x2bdc('0x7a')]=_0x5a1944['position'];_0x4cc020[_0x2bdc('0x7b')]=_0x5a1944[_0x2bdc('0x7b')];_0x4cc020['uniqueid']=_0x5a1944[_0x2bdc('0x4f')];_0x4cc020[_0x2bdc('0x7c')]=this[_0x2bdc('0x13')][_0x5a1944[_0x2bdc('0x4f')]][_0x2bdc('0x7c')];logger[_0x2bdc('0x7d')](_0x2bdc('0x7e'),_0x4cc020[_0x2bdc('0x52')],_0x4cc020[_0x2bdc('0x6d')]);Object[_0x2bdc('0x6c')](_0x4cc020,_[_0x2bdc('0x7f')](_0x5a1944,_['keys'](_0x4cc020)));this[_0x2bdc('0x45')][_0x5a1944['uniqueid']][_0x2bdc('0x73')](_0x4cc020);this[_0x2bdc('0x13')][_0x5a1944[_0x2bdc('0x4f')]]=_0x4cc020;this[_0x2bdc('0x80')](_0x4cc020,'queuecallerjoin');}}catch(_0x4a4b10){logger['error'](_0x2bdc('0x77'),_0x5a1944['uniqueid'],util['inspect'](_0x4a4b10,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x81')]=function(_0x1ad2b5){try{if(this[_0x2bdc('0x60')](_0x1ad2b5)){logger[_0x2bdc('0x55')](_0x2bdc('0x82'),_0x1ad2b5[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x1ad2b5,{'showHidden':![],'depth':null}));if(this[_0x2bdc('0x45')][_0x1ad2b5[_0x2bdc('0x4f')]]){var _0x5a805e=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x1ad2b5['uniqueid']]);_0x5a805e[_0x2bdc('0x84')]=![];_0x5a805e[_0x2bdc('0x85')]=null;_0x5a805e[_0x2bdc('0x86')]=_0x1ad2b5['holdtime'];_0x5a805e['originalposition']=_0x1ad2b5['originalposition'];_0x5a805e['queuecallerabandon']=!![];_0x5a805e[_0x2bdc('0x87')]=moment()['format'](_0x2bdc('0x79'));_0x5a805e[_0x2bdc('0x57')]=_0x2bdc('0x88');_0x5a805e[_0x2bdc('0x89')]=null;logger[_0x2bdc('0x7d')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5a805e[_0x2bdc('0x52')],_0x5a805e[_0x2bdc('0x6d')]);this[_0x2bdc('0x13')][_0x1ad2b5[_0x2bdc('0x4f')]]=_0x5a805e;this['emitVoiceQueueChannelRemove'](_0x5a805e,'queuecallerabandon');}}}catch(_0x5a8a61){logger[_0x2bdc('0x46')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1ad2b5[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x5a8a61,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x8a')]=function(_0x3767b8){try{if(this[_0x2bdc('0x60')](_0x3767b8)){logger[_0x2bdc('0x55')](_0x2bdc('0x8b'),_0x3767b8[_0x2bdc('0x4f')],util['inspect'](_0x3767b8,{'showHidden':![],'depth':null}));if(this[_0x2bdc('0x45')][_0x3767b8[_0x2bdc('0x4f')]]){var _0x346fa2=_['last'](this[_0x2bdc('0x45')][_0x3767b8[_0x2bdc('0x4f')]]);_0x346fa2[_0x2bdc('0x8c')]=moment()['format'](_0x2bdc('0x79'));_0x346fa2[_0x2bdc('0x8d')]=_0x3767b8['connectedlinenum'];_0x346fa2[_0x2bdc('0x8e')]=_0x3767b8['connectedlinename'];logger[_0x2bdc('0x7d')](_0x2bdc('0x8f'),_0x346fa2[_0x2bdc('0x52')],_0x346fa2[_0x2bdc('0x6d')],_0x3767b8[_0x2bdc('0x8d')],_0x3767b8[_0x2bdc('0x8e')]);this[_0x2bdc('0x13')][_0x3767b8[_0x2bdc('0x4f')]]=_0x346fa2;this[_0x2bdc('0x80')](_0x346fa2,_0x2bdc('0x22'));}}}catch(_0xb9cea7){logger[_0x2bdc('0x46')](_0x2bdc('0x8b'),_0x3767b8[_0x2bdc('0x4f')],util['inspect'](_0xb9cea7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x26')]=function(_0x95cc7a){try{if(this['isNotNull'](_0x95cc7a)){logger[_0x2bdc('0x55')](_0x2bdc('0x90'),_0x95cc7a[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x95cc7a,{'showHidden':![],'depth':null}));if(this[_0x2bdc('0x45')][_0x95cc7a[_0x2bdc('0x4f')]]){var _0x2566e3=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x95cc7a['uniqueid']]);_0x2566e3[_0x2bdc('0x84')]=!![];_0x2566e3['queuecallerexitreason']=_0x2bdc('0x91');logger[_0x2bdc('0x7d')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2566e3['queue'],_0x2566e3[_0x2bdc('0x6d')]);}}}catch(_0x7b3252){logger['error'](_0x2bdc('0x90'),_0x95cc7a[_0x2bdc('0x4f')],util['inspect'](_0x7b3252,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bdc('0x24')]=function(_0x2a47d5){try{if(this[_0x2bdc('0x60')](_0x2a47d5)){logger[_0x2bdc('0x55')]('[%s][voiceQueueReport][agentcomplete]',_0x2a47d5[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x2a47d5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2a47d5[_0x2bdc('0x4f')]]){var _0x25f8c8=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x2a47d5[_0x2bdc('0x4f')]]);_0x25f8c8[_0x2bdc('0x3a')]=![];_0x25f8c8['queuecallerabandonAt']=null;_0x25f8c8[_0x2bdc('0x92')]=!![];_0x25f8c8[_0x2bdc('0x89')]=_0x2a47d5[_0x2bdc('0x93')];_0x25f8c8[_0x2bdc('0x86')]=_0x2a47d5[_0x2bdc('0x86')];_0x25f8c8[_0x2bdc('0x84')]=!![];_0x25f8c8[_0x2bdc('0x39')]=![];_0x25f8c8[_0x2bdc('0x94')]=null;if(!_0x25f8c8[_0x2bdc('0x95')]){if(_0x2a47d5[_0x2bdc('0x96')]=='transfer'){_0x25f8c8[_0x2bdc('0x57')]=_0x2bdc('0x97');logger[_0x2bdc('0x7d')](_0x2bdc('0x98'),_0x25f8c8['queue'],_0x25f8c8['type']);}else{if(_[_0x2bdc('0x99')](_0x2a47d5[_0x2bdc('0x40')][_0x2bdc('0x9a')](),_0x2bdc('0x9b'))){if(this[_0x2bdc('0x45')][_0x2a47d5[_0x2bdc('0x9c')]]){var _0xfbdbdd=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x2a47d5[_0x2bdc('0x9c')]]);_0xfbdbdd[_0x2bdc('0x84')]=![];_0xfbdbdd[_0x2bdc('0x39')]=!![];_0xfbdbdd[_0x2bdc('0x94')]=moment(_0x25f8c8['queuecallerjoinAt'])[_0x2bdc('0x9d')](_0x2a47d5[_0x2bdc('0x86')],_0x2bdc('0x9e'))[_0x2bdc('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0xfbdbdd[_0x2bdc('0x57')]=_0x2bdc('0x9f');_0xfbdbdd[_0x2bdc('0x95')]=!![];_0xfbdbdd[_0x2bdc('0xa0')]=_0x2bdc('0xa1');_0xfbdbdd[_0x2bdc('0xa2')]=_0x2a47d5[_0x2bdc('0xa3')];_0xfbdbdd['transferuniqueid']=_0x2a47d5[_0x2bdc('0x4f')];logger[_0x2bdc('0x7d')](_0x2bdc('0xa4'),_0xfbdbdd[_0x2bdc('0x52')],_0xfbdbdd[_0x2bdc('0x6d')]);var _0x3ecbb8=this[_0x2bdc('0x45')][_0x2a47d5['linkedid']];this[_0x2bdc('0x45')][_0x2a47d5[_0x2bdc('0x9c')]]=this[_0x2bdc('0x45')][_0x2a47d5[_0x2bdc('0x4f')]];this[_0x2bdc('0x45')][_0x2a47d5[_0x2bdc('0x4f')]]=_0x3ecbb8;}}else{_0x25f8c8[_0x2bdc('0x57')]=_0x2bdc('0xa5')+_0x2a47d5[_0x2bdc('0x96')][_0x2bdc('0xa6')]();logger[_0x2bdc('0x7d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x25f8c8['queue'],_0x25f8c8[_0x2bdc('0x6d')],_0x25f8c8[_0x2bdc('0x57')]);}}}this[_0x2bdc('0x13')][_0x2a47d5[_0x2bdc('0x4f')]]=_0x25f8c8;}}}catch(_0x2b0dfc){logger[_0x2bdc('0x46')](_0x2bdc('0xa7'),_0x2a47d5[_0x2bdc('0x4f')],util['inspect'](_0x2b0dfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')]['syncVarSet']=function(_0x1e00fd){try{if(this['isNotNull'](_0x1e00fd)){logger[_0x2bdc('0x55')]('[%s][voiceQueueReport][varset]',_0x1e00fd[_0x2bdc('0x4f')],util['inspect'](_0x1e00fd,{'showHidden':![],'depth':null}));this[_0x2bdc('0xa8')](_0x1e00fd['uniqueid'],_[_0x2bdc('0xa9')](_0x1e00fd[_0x2bdc('0xaa')])[0x0],_0x1e00fd[_0x2bdc('0xab')]);if(this[_0x2bdc('0x45')][_0x1e00fd[_0x2bdc('0x4f')]]){var _0x47f6f8=_[_0x2bdc('0x83')](this['queueReports'][_0x1e00fd[_0x2bdc('0x4f')]]);if(_0x47f6f8){if(this[_0x2bdc('0x60')](_0x1e00fd[_0x2bdc('0xaa')])&&this[_0x2bdc('0x60')](_0x1e00fd[_0x2bdc('0xaa')]['queuestatus'])){switch(_0x1e00fd[_0x2bdc('0xab')]){case'CONTINUE':_0x47f6f8[_0x2bdc('0x39')]=![];_0x47f6f8[_0x2bdc('0x94')]=null;break;case _0x2bdc('0xac'):_0x47f6f8[_0x2bdc('0xad')]=_0x2bdc('0xae');_0x47f6f8[_0x2bdc('0x39')]=!![];_0x47f6f8['queuecallerexitAt']=moment()[_0x2bdc('0x50')](_0x2bdc('0x79'));_0x47f6f8[_0x2bdc('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2bdc('0x55')](_0x2bdc('0xaf'),_0x1e00fd['uniqueid'],util[_0x2bdc('0x44')](_0x47f6f8,{'showHidden':![],'depth':null}));ami[_0x2bdc('0x4d')](_0x2bdc('0xb0'),_0x47f6f8);break;default:_0x47f6f8[_0x2bdc('0x39')]=!![];_0x47f6f8[_0x2bdc('0x94')]=moment()['format'](_0x2bdc('0x79'));_0x47f6f8[_0x2bdc('0x8c')]=moment()[_0x2bdc('0x50')](_0x2bdc('0x79'));}_0x47f6f8[_0x2bdc('0x3a')]=![];_0x47f6f8['queuecallerabandonAt']=null;_0x47f6f8[_0x2bdc('0x57')]=_0x1e00fd['value'];this['channels'][_0x1e00fd[_0x2bdc('0x4f')]]=_0x47f6f8;this[_0x2bdc('0x4c')](_0x47f6f8,_0x2bdc('0x27'));}else if(this[_0x2bdc('0x60')](_0x1e00fd[_0x2bdc('0xaa')])&&this['isNotNull'](_0x1e00fd[_0x2bdc('0xaa')][_0x2bdc('0xb1')])){if(!_0x47f6f8['queuecallerabandon']){_0x47f6f8[_0x2bdc('0x39')]=!![];_0x47f6f8['queuecallerexitAt']=moment()['format'](_0x2bdc('0x79'));_0x47f6f8[_0x2bdc('0x57')]='EXITWITHKEY';_0x47f6f8[_0x2bdc('0x8c')]=moment()[_0x2bdc('0x50')](_0x2bdc('0x79'));this[_0x2bdc('0x13')][_0x1e00fd[_0x2bdc('0x4f')]]=_0x47f6f8;}}logger['info'](_0x2bdc('0xb2'),_0x1e00fd[_0x2bdc('0x4f')],_0x47f6f8[_0x2bdc('0x52')],_0x47f6f8[_0x2bdc('0x6d')],_[_0x2bdc('0xa9')](_0x1e00fd[_0x2bdc('0xaa')])[0x0],_0x1e00fd['value']);_0x47f6f8[_0x2bdc('0x17')]=this[_0x2bdc('0x17')][_0x1e00fd[_0x2bdc('0x4f')]];}}}}catch(_0xa9467b){logger[_0x2bdc('0x46')]('[%s][voiceQueueReport][varset]',_0x1e00fd[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0xa9467b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0xa8')]=function(_0x49bb91,_0x14ab13,_0x2c6955){var _0x562c55=[_0x2bdc('0xb3'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0x2bdc('0xb4'),_0x2bdc('0xb5'),_0x2bdc('0xb6'),_0x2bdc('0xb7'),'sipuri','bridgepeer',_0x2bdc('0xb8'),_0x2bdc('0xb9'),'memberdynamic',_0x2bdc('0xba'),_0x2bdc('0xbb'),_0x2bdc('0x93'),'memberpenalty','memberrealtime'];if(!_[_0x2bdc('0x3e')](_0x14ab13)&&!_[_0x2bdc('0xbc')](_0x562c55,_0x14ab13)){if(_['isUndefined'](this[_0x2bdc('0x17')][_0x49bb91])){this[_0x2bdc('0x17')][_0x49bb91]={};}this[_0x2bdc('0x17')][_0x49bb91][_0x14ab13]=_0x2c6955;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x13d67b,_0x3ca901,_0x4b527e){try{var _0x2c0457={};if(this[_0x2bdc('0x45')][_0x13d67b]){for(var _0x3471b8=0x0;_0x3471b8<this[_0x2bdc('0x45')][_0x13d67b][_0x2bdc('0xbd')];_0x3471b8+=0x1){_0x2c0457=this[_0x2bdc('0x45')][_0x13d67b][_0x3471b8];var _0x4477b6=this[_0x2bdc('0x15')][_0x2c0457[_0x2bdc('0x52')]];if(_0x4477b6){_0x4477b6[_0x2bdc('0xbe')]+=moment(_0x2c0457[_0x2bdc('0x8c')])[_0x2bdc('0xbf')](_0x2c0457[_0x2bdc('0x78')],_0x2bdc('0x9e'))||0x0;if(_0x4b527e&&_0x2c0457[_0x2bdc('0x57')]===_0x2bdc('0x58')){_0x2c0457[_0x2bdc('0x57')]=_0x2bdc('0x91');}if(_0x3471b8===this[_0x2bdc('0x45')][_0x13d67b][_0x2bdc('0xbd')]-0x1){_0x4477b6[_0x2bdc('0xc0')]+=moment()[_0x2bdc('0xc1')](0x0)[_0x2bdc('0xbf')](_0x2c0457[_0x2bdc('0x78')],_0x2bdc('0x9e'));if(hasCallerLeftTheQueue(_0x2c0457)&&_0x2c0457[_0x2bdc('0x57')]!=='ATTENDEDTRANSFER'){_0x4477b6['total']+=0x1;}if(_0x2c0457[_0x2bdc('0x84')]){_0x4477b6['answered']+=0x1;_0x4477b6['sumBillable']+=moment()[_0x2bdc('0xc1')](0x0)[_0x2bdc('0xbf')](_0x2c0457[_0x2bdc('0x8c')],'seconds');_0x2c0457[_0x2bdc('0x85')]=moment()[_0x2bdc('0x50')](_0x2bdc('0x79'));_0x2c0457[_0x2bdc('0x39')]=![];_0x2c0457['queuecallerexitAt']=null;}if(_0x2c0457[_0x2bdc('0x39')]&&_0x2c0457['transfer']!=!![]){_0x4477b6[_0x2bdc('0xc2')]+=0x1;_0x2c0457[_0x2bdc('0xad')]='unmanaged';logger['debug'](_0x2bdc('0xc3'),_0x13d67b,util[_0x2bdc('0x44')](_0x2c0457,{'showHidden':![],'depth':null}));ami[_0x2bdc('0x4d')](_0x2bdc('0xc4'),_0x2c0457);}if(_0x2c0457[_0x2bdc('0x3a')]){_0x4477b6[_0x2bdc('0xc5')]+=0x1;_0x2c0457[_0x2bdc('0xad')]=_0x2bdc('0xc5');logger[_0x2bdc('0x55')](_0x2bdc('0xc6'),_0x13d67b,util[_0x2bdc('0x44')](_0x2c0457,{'showHidden':![],'depth':null}));ami[_0x2bdc('0x4d')]('custom:queuecallerabandon',_0x2c0457);}}else{_0x4477b6[_0x2bdc('0xc0')]+=_0x4477b6[_0x2bdc('0xbe')];}logger[_0x2bdc('0x7d')](_0x2bdc('0xc7'),_0x13d67b,_0x2c0457['queue'],_0x2c0457[_0x2bdc('0x6d')],_0x3ca901);this['channels'][_0x13d67b]=_0x2c0457;Object['assign'](this['voiceQueues'][_0x2c0457[_0x2bdc('0x52')]],_0x4477b6);if(_0x2c0457[_0x2bdc('0x8c')]){this['emitVoiceQueueChannelRemove'](_0x2c0457,_0x2bdc('0x29'));}}}logger[_0x2bdc('0x55')](_0x2bdc('0xc8'),_0x13d67b,util[_0x2bdc('0x44')](this['queueReports'][_0x13d67b],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x2c0457)&&_0x2c0457[_0x2bdc('0x57')]!==_0x2bdc('0x58')){ami[_0x2bdc('0x4d')](_0x2bdc('0xc9'),this[_0x2bdc('0x45')][_0x13d67b]);if(this[_0x2bdc('0x45')][_0x13d67b]){delete this[_0x2bdc('0x45')][_0x13d67b];}if(this['channels'][_0x13d67b]){delete this[_0x2bdc('0x13')][_0x13d67b];}if(this[_0x2bdc('0x17')][_0x13d67b]){delete this[_0x2bdc('0x17')][_0x13d67b];}}}}catch(_0x4093ab){logger[_0x2bdc('0x46')]('[%s][voiceQueueReport][handleHangup]',_0x13d67b,util[_0x2bdc('0x44')](_0x4093ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x2a')]=function(_0x1d2a1b){try{if(this[_0x2bdc('0x60')](_0x1d2a1b)){logger[_0x2bdc('0x55')](_0x2bdc('0xca'),_0x1d2a1b['uniqueid'],util['inspect'](_0x1d2a1b,{'showHidden':![],'depth':null}));if(this[_0x2bdc('0x45')][_0x1d2a1b['uniqueid']]){return this['handleHangup'](_0x1d2a1b[_0x2bdc('0x4f')],_0x1d2a1b[_0x2bdc('0xcb')],![]);}if(this['queueReports'][_0x1d2a1b[_0x2bdc('0x9c')]]){if(_0x1d2a1b[_0x2bdc('0xcc')]==='21'){return;}return this[_0x2bdc('0xcd')](_0x1d2a1b[_0x2bdc('0x9c')],_0x1d2a1b[_0x2bdc('0xcb')],!![]);}var _0x3bdad3=Object[_0x2bdc('0xa9')](this[_0x2bdc('0x45')]);for(var _0x5d7cb6=0x0;_0x5d7cb6<_0x3bdad3['length'];_0x5d7cb6++){var _0x560381=_['last'](this[_0x2bdc('0x45')][_0x3bdad3[_0x5d7cb6]]);if(_0x560381&&_0x560381['transferid']===_0x1d2a1b[_0x2bdc('0x4f')]){return this[_0x2bdc('0xcd')](_0x560381[_0x2bdc('0x4f')],_0x1d2a1b[_0x2bdc('0xcb')],!![]);}}if(!this[_0x2bdc('0x45')][_0x1d2a1b['uniqueid']]){logger[_0x2bdc('0x55')](_0x2bdc('0xce'),_0x1d2a1b['uniqueid']);if(this[_0x2bdc('0x13')][_0x1d2a1b[_0x2bdc('0x4f')]]){delete this[_0x2bdc('0x13')][_0x1d2a1b['uniqueid']];}if(this[_0x2bdc('0x17')][_0x1d2a1b[_0x2bdc('0x4f')]]){delete this[_0x2bdc('0x17')][_0x1d2a1b[_0x2bdc('0x4f')]];}}}}catch(_0x47d2e7){logger[_0x2bdc('0x46')](_0x2bdc('0xca'),_0x1d2a1b[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x47d2e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bdc('0x2f')]=function(_0x1f3406){try{if(this[_0x2bdc('0x60')](_0x1f3406)){logger[_0x2bdc('0x55')](_0x2bdc('0xcf'),_0x1f3406[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x1f3406,{'showHidden':![],'depth':null}));var _0x5d2623;var _0x168273;var _0x4b1bab;if(this['queueReports'][_0x1f3406[_0x2bdc('0xd0')]]){_0x5d2623=_['last'](this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd0')]]);_0x5d2623[_0x2bdc('0xa2')]=_0x1f3406[_0x2bdc('0xd1')];_0x5d2623[_0x2bdc('0xd2')]=_0x1f3406[_0x2bdc('0xd3')];_0x5d2623[_0x2bdc('0x57')]=_0x2bdc('0x58');_0x5d2623[_0x2bdc('0x95')]=!![];_0x5d2623[_0x2bdc('0xa0')]=_0x2bdc('0xd4');if(this['queueReports'][_0x1f3406['secondtransfereruniqueid']]){_0x4b1bab=this[_0x2bdc('0x45')][_0x1f3406['secondtransfereruniqueid']];this[_0x2bdc('0x45')][_0x1f3406['secondtransfereruniqueid']]=this['queueReports'][_0x1f3406[_0x2bdc('0xd0')]];this[_0x2bdc('0x45')][_0x1f3406['transfereeuniqueid']]=_0x4b1bab;_0x168273=_[_0x2bdc('0x83')](this['queueReports'][_0x1f3406[_0x2bdc('0xd0')]]);_0x168273['switch']=!![];}logger[_0x2bdc('0x7d')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1f3406[_0x2bdc('0x4f')],_0x5d2623[_0x2bdc('0x52')],_0x5d2623[_0x2bdc('0x6d')],_0x5d2623[_0x2bdc('0xa2')],_0x5d2623[_0x2bdc('0xd2')]);}else if(this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd5')]]){_0x5d2623=_['last'](this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd5')]]);_0x5d2623[_0x2bdc('0xa2')]=_0x1f3406[_0x2bdc('0xd6')];_0x5d2623[_0x2bdc('0xd2')]=_0x1f3406[_0x2bdc('0xd7')];_0x5d2623[_0x2bdc('0x57')]=_0x2bdc('0x58');_0x5d2623[_0x2bdc('0x95')]=!![];_0x5d2623[_0x2bdc('0xa0')]=_0x2bdc('0xd4');if(this['queueReports'][_0x1f3406[_0x2bdc('0xd7')]]){_0x4b1bab=this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd7')]];this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd7')]]=this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd5')]];this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd5')]]=_0x4b1bab;_0x168273=_['last'](this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd5')]]);_0x168273['switch']=!![];}logger[_0x2bdc('0x7d')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1f3406[_0x2bdc('0x4f')],_0x5d2623['queue'],_0x5d2623[_0x2bdc('0x6d')],_0x5d2623[_0x2bdc('0xa2')],_0x5d2623[_0x2bdc('0xd2')]);}else if(this['queueReports'][_0x1f3406[_0x2bdc('0xd7')]]){_0x5d2623=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd7')]]);_0x5d2623[_0x2bdc('0xa2')]=_0x1f3406[_0x2bdc('0xd6')];_0x5d2623[_0x2bdc('0xd2')]=_0x1f3406['origtransfereruniqueid'];_0x5d2623[_0x2bdc('0x57')]=_0x2bdc('0x58');_0x5d2623[_0x2bdc('0x95')]=!![];_0x5d2623[_0x2bdc('0xa0')]='ATTENDED';_0x5d2623[_0x2bdc('0x3c')]=!![];_0x5d2623[_0x2bdc('0xd8')]=_0x1f3406[_0x2bdc('0xd0')];}else if(this[_0x2bdc('0x45')][_0x1f3406[_0x2bdc('0xd3')]]){_0x5d2623=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x1f3406['secondtransfereruniqueid']]);_0x5d2623[_0x2bdc('0xa2')]=_0x1f3406[_0x2bdc('0xd1')];_0x5d2623[_0x2bdc('0xd2')]=_0x1f3406[_0x2bdc('0xd3')];_0x5d2623[_0x2bdc('0x57')]='ATTENDEDTRANSFER';_0x5d2623[_0x2bdc('0x95')]=!![];_0x5d2623[_0x2bdc('0xa0')]=_0x2bdc('0xd4');_0x5d2623[_0x2bdc('0x3c')]=!![];_0x5d2623[_0x2bdc('0xd8')]=_0x1f3406[_0x2bdc('0xd5')];}}}catch(_0x4c4e7f){logger[_0x2bdc('0x46')]('[%s][voiceQueueReport][attendedtransfer]',_0x1f3406['uniqueid'],util[_0x2bdc('0x44')](_0x4c4e7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x31')]=function(_0x1cf39b){try{if(this['isNotNull'](_0x1cf39b)){logger[_0x2bdc('0x55')](_0x2bdc('0xd9'),_0x1cf39b['uniqueid'],util[_0x2bdc('0x44')](_0x1cf39b,{'showHidden':![],'depth':null}));if(this[_0x2bdc('0x45')][_0x1cf39b[_0x2bdc('0xd0')]]){var _0x52ed1d=_[_0x2bdc('0x83')](this[_0x2bdc('0x45')][_0x1cf39b[_0x2bdc('0xd0')]]);_0x52ed1d[_0x2bdc('0x57')]='BLINDTRANSFER';_0x52ed1d[_0x2bdc('0x95')]=!![];_0x52ed1d['transfertype']=_0x2bdc('0xda');_0x52ed1d[_0x2bdc('0xa2')]=_0x1cf39b[_0x2bdc('0xdb')];_0x52ed1d[_0x2bdc('0xd2')]=_0x1cf39b['transfereeuniqueid'];logger['info'](_0x2bdc('0xdc'),_0x1cf39b[_0x2bdc('0x4f')],_0x52ed1d[_0x2bdc('0x52')],_0x52ed1d[_0x2bdc('0x6d')],_0x52ed1d['transferexten'],_0x52ed1d['transferuniqueid']);this[_0x2bdc('0x2a')]({'event':'BlindTransfer','uniqueid':_0x1cf39b[_0x2bdc('0xd0')],'context':_0x1cf39b[_0x2bdc('0xdd')],'channel':_0x1cf39b[_0x2bdc('0xde')]});}}}catch(_0x30ced6){logger['error'](_0x2bdc('0xd9'),_0x1cf39b[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x30ced6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0xdf')]=function(_0x59dcb1){try{if(this[_0x2bdc('0x60')](_0x59dcb1)){logger[_0x2bdc('0x55')](_0x2bdc('0xe0'),_0x59dcb1[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x59dcb1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x59dcb1['uniqueid']]){var _0x112edf=_['last'](this[_0x2bdc('0x45')][_0x59dcb1[_0x2bdc('0x4f')]]);if(!_['isNil'](_0x112edf[_0x2bdc('0x8c')])){_0x112edf[_0x2bdc('0xe1')]=moment()[_0x2bdc('0x50')](_0x2bdc('0x79'));logger[_0x2bdc('0x7d')](_0x2bdc('0xe2'),_0x59dcb1[_0x2bdc('0x4f')],_0x112edf[_0x2bdc('0xe1')]);}}}}catch(_0x43951d){logger['error'](_0x2bdc('0xe0'),_0x59dcb1['uniqueid'],util[_0x2bdc('0x44')](_0x43951d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bdc('0xd')][_0x2bdc('0x2d')]=function(_0xe8ba29){try{if(this[_0x2bdc('0x60')](_0xe8ba29)){logger[_0x2bdc('0x55')]('[%s][voiceQueueReport][musiconholdstop]',_0xe8ba29[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0xe8ba29,{'showHidden':![],'depth':null}));if(this[_0x2bdc('0x45')][_0xe8ba29[_0x2bdc('0x4f')]]){var _0xe85e2c=_[_0x2bdc('0x83')](this['queueReports'][_0xe8ba29[_0x2bdc('0x4f')]]);if(!_[_0x2bdc('0x3e')](_0xe85e2c[_0x2bdc('0xe1')])){_0xe85e2c['mohtime']+=moment()[_0x2bdc('0xc1')](0x0)[_0x2bdc('0xbf')](_0xe85e2c['mohstarttime'],_0x2bdc('0x9e'));logger['info'](_0x2bdc('0xe3'),_0xe8ba29['uniqueid'],_0xe85e2c[_0x2bdc('0xe4')]);delete _0xe85e2c[_0x2bdc('0xe1')];}}}}catch(_0x4d4442){logger[_0x2bdc('0x46')](_0x2bdc('0xe5'),_0xe8ba29[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x4d4442,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bdc('0xe6')]=function(_0x1e7cef){try{if(this[_0x2bdc('0x60')](_0x1e7cef)){logger[_0x2bdc('0x55')](_0x2bdc('0xe7'),_0x1e7cef['uniqueid'],util['inspect'](_0x1e7cef,{'showHidden':![],'depth':null}));if(_0x1e7cef[_0x2bdc('0xe8')]['toLowerCase']()===_0x2bdc('0xe9')){_0x1e7cef[_0x2bdc('0xea')]=_0x1e7cef[_0x2bdc('0xeb')]&&_0x1e7cef[_0x2bdc('0xeb')]['startsWith'](_0x2bdc('0xec'))?_0x1e7cef[_0x2bdc('0xeb')]:(_0x1e7cef[_0x2bdc('0xeb')]||_0x1e7cef[_0x2bdc('0xea')])[_0x2bdc('0x9a')]();if(_[_0x2bdc('0x99')](_0x1e7cef[_0x2bdc('0xea')][_0x2bdc('0x9a')](),_0x2bdc('0xed'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x1e7cef[_0x2bdc('0x4f')],_0x1e7cef['application'],_0x1e7cef[_0x2bdc('0xea')]);if(_['isUndefined'](this[_0x2bdc('0x13')][_0x1e7cef[_0x2bdc('0x4f')]]))this[_0x2bdc('0x13')][_0x1e7cef[_0x2bdc('0x4f')]]={};var _0x575e4a=_0x1e7cef[_0x2bdc('0xea')][_0x2bdc('0xee')]('=');var _0x2e8d7b=_0x575e4a[0x0][_0x2bdc('0x9a')]()[_0x2bdc('0xef')](/cdr\((.*)\)/);if(_0x2e8d7b)this[_0x2bdc('0x13')][_0x1e7cef[_0x2bdc('0x4f')]][_0x2e8d7b[0x1]]=_0x575e4a[0x1];}}}}catch(_0x5bd405){logger[_0x2bdc('0x46')]('[%s][voiceQueueReport][newexten]',_0x1e7cef[_0x2bdc('0x4f')],util[_0x2bdc('0x44')](_0x5bd405,{'showHidden':![],'depth':null}));}};module[_0x2bdc('0xf0')]=VoiceQueueReport;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80a7=['CreateReportAgentPreview','createHistory','campaign','Request'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0x80a7,0x175));var _0x780a=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x80a7[_0x13606d];return _0x1b85b0;};'use strict';var client=require('../client');exports[_0x780a('0x0')]=function(_0x4b6610){return function(){_0x4b6610[_0x780a('0x1')]=_0x4b6610['queue'];return client[_0x780a('0x2')](_0x780a('0x3'),{'body':_0x4b6610,'log':_0x780a('0x3')});};};
\ No newline at end of file
+var _0xcc72=['createHistory','campaign','Request','CreateReportAgentPreview','../client'];(function(_0x5945a7,_0x226bf8){var _0x49fbed=function(_0x300eab){while(--_0x300eab){_0x5945a7['push'](_0x5945a7['shift']());}};_0x49fbed(++_0x226bf8);}(_0xcc72,0x1e4));var _0x2cc7=function(_0x13f1a0,_0x368032){_0x13f1a0=_0x13f1a0-0x0;var _0x4d9edd=_0xcc72[_0x13f1a0];return _0x4d9edd;};'use strict';var client=require(_0x2cc7('0x0'));exports[_0x2cc7('0x1')]=function(_0x37a822){return function(){_0x37a822[_0x2cc7('0x2')]=_0x37a822['queue'];return client[_0x2cc7('0x3')]('CreateReportAgentPreview',{'body':_0x37a822,'log':_0x2cc7('0x4')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x74ba=['../client','Request'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x74ba,0x174));var _0xa74b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x74ba[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xa74b('0x0'));exports['create']=function(_0x52e211){return client[_0xa74b('0x1')]('CreateAttachment',{'body':_0x52e211,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x93cc=['CreateAttachment','../client','create','Request'];(function(_0x28cea5,_0x522c80){var _0x2d406e=function(_0x224d8d){while(--_0x224d8d){_0x28cea5['push'](_0x28cea5['shift']());}};_0x2d406e(++_0x522c80);}(_0x93cc,0xc9));var _0xc93c=function(_0x26f17c,_0x120b8d){_0x26f17c=_0x26f17c-0x0;var _0x38e884=_0x93cc[_0x26f17c];return _0x38e884;};'use strict';var client=require(_0xc93c('0x0'));exports[_0xc93c('0x1')]=function(_0x468a2a){return client[_0xc93c('0x2')](_0xc93c('0x3'),{'body':_0x468a2a,'log':_0xc93c('0x3')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','active','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry'];(function(_0x155b3d,_0x42dce4){var _0x540635=function(_0x32178f){while(--_0x32178f){_0x155b3d['push'](_0x155b3d['shift']());}};_0x540635(++_0x42dce4);}(_0x7a54,0x106));var _0x47a5=function(_0x559fa3,_0x512bd0){_0x559fa3=_0x559fa3-0x0;var _0x1d3eb5=_0x7a54[_0x559fa3];return _0x1d3eb5;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(){return client[_0x47a5('0x2')]('GetCampaign',{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),_0x47a5('0x4'),'active',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'dialCongestionRetryFrequency',_0x47a5('0xa'),'dialBusyRetryFrequency',_0x47a5('0xb'),_0x47a5('0xc'),'dialGlobalMaxRetry',_0x47a5('0xd'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x47a5('0xe'),_0x47a5('0xf'),'dialMachineMaxRetry',_0x47a5('0x10'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'dialAMDMinWordLength',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f')],'include':[{'model':'Trunk','as':_0x47a5('0x20'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x21'),_0x47a5('0x22')]},{'model':_0x47a5('0x20'),'as':'TrunkBackup','attributes':['id','name',_0x47a5('0x21'),'active']},{'model':'Interval','as':_0x47a5('0x23'),'attributes':['id',_0x47a5('0x3')],'include':[{'model':_0x47a5('0x23'),'as':_0x47a5('0x24'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x25')]}]},{'model':_0x47a5('0x26'),'as':_0x47a5('0x26'),'attributes':['id',_0x47a5('0x3')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0xdb28=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','Interval','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt'];(function(_0x4e4bc0,_0x22d8f2){var _0x51ee7d=function(_0xf7eca6){while(--_0xf7eca6){_0x4e4bc0['push'](_0x4e4bc0['shift']());}};_0x51ee7d(++_0x22d8f2);}(_0xdb28,0x106));var _0x8db2=function(_0x43a544,_0x171399){_0x43a544=_0x43a544-0x0;var _0x3f8ad7=_0xdb28[_0x43a544];return _0x3f8ad7;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(){return client[_0x8db2('0x2')](_0x8db2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'dialOriginateTimeout',_0x8db2('0x9'),_0x8db2('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'dialAbandonedMaxRetry',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'dialAgentRejectMaxRetry',_0x8db2('0x15'),_0x8db2('0x16'),'dialGlobalInterval',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21'),_0x8db2('0x22')],'include':[{'model':_0x8db2('0x23'),'as':_0x8db2('0x23'),'attributes':['id',_0x8db2('0x24'),'callerid',_0x8db2('0x5')]},{'model':_0x8db2('0x23'),'as':'TrunkBackup','attributes':['id',_0x8db2('0x24'),_0x8db2('0x25'),_0x8db2('0x5')]},{'model':_0x8db2('0x26'),'as':_0x8db2('0x26'),'attributes':['id',_0x8db2('0x24')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8db2('0x24'),_0x8db2('0x27')]}]},{'model':_0x8db2('0x28'),'as':_0x8db2('0x28'),'attributes':['id','name']}]},'log':_0x8db2('0x29')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b5c=['CreateCmContact','getContacts','GetCmContact','../client','createContact'];(function(_0xe248e8,_0x309fba){var _0x3afd2b=function(_0x421013){while(--_0x421013){_0xe248e8['push'](_0xe248e8['shift']());}};_0x3afd2b(++_0x309fba);}(_0x7b5c,0x13e));var _0xc7b5=function(_0x1cf44c,_0x37b327){_0x1cf44c=_0x1cf44c-0x0;var _0x1ec0eb=_0x7b5c[_0x1cf44c];return _0x1ec0eb;};'use strict';var client=require(_0xc7b5('0x0'));exports[_0xc7b5('0x1')]=function(_0x53d0d1){return function(){return client['Request'](_0xc7b5('0x2'),{'body':_0x53d0d1,'log':'CreateCmContact'});};};exports[_0xc7b5('0x3')]=function(_0x43e6e2){return function(){return client['Request']('GetCmContact',{'options':_0x43e6e2,'log':_0xc7b5('0x4')});};};
\ No newline at end of file
+var _0x9211=['getContacts','GetCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x2f6af7,_0x35996f){var _0x5aeb8f=function(_0x26a0a0){while(--_0x26a0a0){_0x2f6af7['push'](_0x2f6af7['shift']());}};_0x5aeb8f(++_0x35996f);}(_0x9211,0xb6));var _0x1921=function(_0x4bf264,_0x3be730){_0x4bf264=_0x4bf264-0x0;var _0x3c855f=_0x9211[_0x4bf264];return _0x3c855f;};'use strict';var client=require(_0x1921('0x0'));exports[_0x1921('0x1')]=function(_0x4416e9){return function(){return client[_0x1921('0x2')](_0x1921('0x3'),{'body':_0x4416e9,'log':_0x1921('0x3')});};};exports[_0x1921('0x4')]=function(_0x2da3c2){return function(){return client[_0x1921('0x2')](_0x1921('0x5'),{'options':_0x2da3c2,'log':_0x1921('0x5')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf698=['GetCmHopper','CmContact','Contact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','Request','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','priority','scheduledat','ASC','GetContactDialer','DESC','GetContactDialerIvr','MoveContactManagedDialer','CountReScheduled','GetCmHopperPreview','User','Agent','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','handlePreviewRecallNotifications','../client','moment'];(function(_0x56e4cd,_0x51fbb8){var _0x35f002=function(_0x4ce6ca){while(--_0x4ce6ca){_0x56e4cd['push'](_0x56e4cd['shift']());}};_0x35f002(++_0x51fbb8);}(_0xf698,0x1de));var _0x8f69=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0xf698[_0x7729b1];return _0x349504;};'use strict';var client=require(_0x8f69('0x0'));var moment=require(_0x8f69('0x1'));exports['getContacts']=function(_0x1d6ed2,_0x1f7a66){return function(){return client['Request'](_0x8f69('0x2'),{'options':{'where':{'VoiceQueueId':_0x1d6ed2},'include':[{'model':_0x8f69('0x3'),'as':_0x8f69('0x4')}],'limit':_0x1f7a66,'raw':![]},'log':_0x8f69('0x5')});};};exports['updateContacts']=function(_0x3cfa2c,_0x57876d,_0x56df1b){return function(){return client['Request'](_0x8f69('0x6'),{'body':_0x3cfa2c,'options':{'where':{'VoiceQueueId':_0x57876d,'scheduledat':{'$lte':moment()[_0x8f69('0x7')](_0x8f69('0x8'))}},'limit':_0x56df1b},'log':_0x8f69('0x6')});};};exports[_0x8f69('0x9')]=function(_0x3db195){return client[_0x8f69('0xa')](_0x8f69('0x6'),{'body':_0x3db195,'options':{'where':{'ContactId':_0x3db195[_0x8f69('0xb')],'ListId':_0x3db195[_0x8f69('0xc')],'VoiceQueueId':_0x3db195[_0x8f69('0xd')],'CampaignId':_0x3db195[_0x8f69('0xe')]}},'log':'rescheduleContact'});};exports[_0x8f69('0xf')]=function(_0x573d9b,_0x30e2b9,_0x5460e7){return function(){return client[_0x8f69('0xa')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x573d9b,'ListId':_0x30e2b9,'ContactId':_0x5460e7}},'log':_0x8f69('0x10')});};};exports[_0x8f69('0x11')]=function(_0x18cbed,_0x4f3145,_0x527b35,_0x22157a){return client[_0x8f69('0xa')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x18cbed,'active':![],'scheduledat':{'$lte':moment()[_0x8f69('0x7')](_0x8f69('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4f3145}}]},'order':[[_0x8f69('0x12'),'DESC'],[_0x8f69('0x13'),_0x22157a],['id',_0x8f69('0x14')]],'raw':!![],'limit':_0x527b35},'log':_0x8f69('0x15')});};exports['getContactDialerIvr']=function(_0x2aa302,_0x143318,_0x29a6a6){return client[_0x8f69('0xa')](_0x8f69('0x15'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2aa302,'active':![],'scheduledat':{'$lte':moment()[_0x8f69('0x7')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x8f69('0x3'),'as':_0x8f69('0x4')}],'order':[[_0x8f69('0x12'),_0x8f69('0x16')],['scheduledat',_0x29a6a6],['id',_0x8f69('0x14')]],'raw':!![],'limit':_0x143318},'log':_0x8f69('0x17')});};exports['moveContactManagedDialer']=function(_0x2b2978,_0x3d2526){_0x2b2978['campaign']=_0x2b2978['queue'];return client[_0x8f69('0xa')](_0x8f69('0x18'),{'body':_0x2b2978,'options':{'where':{'ContactId':_0x2b2978[_0x8f69('0xb')],'ListId':_0x2b2978[_0x8f69('0xc')],'VoiceQueueId':_0x2b2978[_0x8f69('0xd')],'CampaignId':_0x2b2978['CampaignId'],'active':_0x3d2526?undefined:!![]}},'log':_0x8f69('0x18')});};exports['countReScheduled']=function(_0x597ba2){return client['Request'](_0x8f69('0x19'),{'options':{'where':{'VoiceQueueId':_0x597ba2['id']?_0x597ba2['id']||null:null}},'log':'countReScheduled'});};exports['getContactPreview']=function(_0x5ce53f){return function(){return client[_0x8f69('0xa')](_0x8f69('0x1a'),{'options':{'where':{'id':_0x5ce53f},'include':[{'model':_0x8f69('0x3'),'as':'Contact'},{'model':_0x8f69('0x1b'),'as':_0x8f69('0x1c'),'attributes':['id',_0x8f69('0x1d')]},{'model':_0x8f69('0x1e'),'as':'Queue','attributes':['id','name']}],'raw':!![]},'log':_0x8f69('0x5')});};};exports[_0x8f69('0x1f')]=function(_0x2a117c,_0x1fe41a,_0x4130d9){return client['Request'](_0x8f69('0x6'),{'body':_0x2a117c,'options':{'where':{'id':_0x1fe41a},'limit':_0x4130d9},'log':_0x8f69('0x6')});};exports[_0x8f69('0x20')]=function(_0x469c2e,_0x124d72){return function(){return client['Request'](_0x8f69('0x21'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x469c2e,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x8f69('0x7')](_0x8f69('0x8'))},'UserId':{'$in':_0x124d72}},'order':[[_0x8f69('0x12'),_0x8f69('0x16')],['scheduledat','DESC'],['id',_0x8f69('0x14')]],'include':[{'model':_0x8f69('0x3'),'as':_0x8f69('0x4')},{'model':_0x8f69('0x1b'),'as':'Agent','attributes':['id',_0x8f69('0x1d'),_0x8f69('0x22')]}],'group':_0x8f69('0x23'),'raw':!![]},'log':_0x8f69('0x15')});};};exports[_0x8f69('0x24')]=function(_0x5ed75a,_0x349427){return client[_0x8f69('0xa')](_0x8f69('0x25'),{'body':_0x5ed75a,'options':_0x349427||{},'log':_0x8f69('0x25')});};exports['handlePreviewRecallNotifications']=function(_0x33654c,_0x4078a0,_0x3e25f0){return function(){return client[_0x8f69('0xa')](_0x8f69('0x26'),{'body':{'where':{'voiceQueueIds':_0x33654c,'interval':_0x4078a0,'availableAgentsIds':_0x3e25f0}},'log':_0x8f69('0x27')});};};
\ No newline at end of file
+var _0xcf12=['name','Queue','getContactRecallMe','User','voicePause','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','moment','Request','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','priority','DESC','ASC','getContactDialerIvr','scheduledat','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','ContactId','ListId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0xcf12,0x140));var _0x2cf1=function(_0xd24418,_0xf7267f){_0xd24418=_0xd24418-0x0;var _0x2c5eeb=_0xcf12[_0xd24418];return _0x2c5eeb;};'use strict';var client=require('../client');var moment=require(_0x2cf1('0x0'));exports['getContacts']=function(_0x333ac6,_0x361548){return function(){return client[_0x2cf1('0x1')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x333ac6},'include':[{'model':_0x2cf1('0x2'),'as':_0x2cf1('0x3')}],'limit':_0x361548,'raw':![]},'log':_0x2cf1('0x4')});};};exports[_0x2cf1('0x5')]=function(_0xec83cf,_0x2da534,_0x445f40){return function(){return client[_0x2cf1('0x1')](_0x2cf1('0x6'),{'body':_0xec83cf,'options':{'where':{'VoiceQueueId':_0x2da534,'scheduledat':{'$lte':moment()['format'](_0x2cf1('0x7'))}},'limit':_0x445f40},'log':_0x2cf1('0x6')});};};exports[_0x2cf1('0x8')]=function(_0xc607bd){return client[_0x2cf1('0x1')](_0x2cf1('0x6'),{'body':_0xc607bd,'options':{'where':{'ContactId':_0xc607bd['ContactId'],'ListId':_0xc607bd['ListId'],'VoiceQueueId':_0xc607bd['VoiceQueueId'],'CampaignId':_0xc607bd[_0x2cf1('0x9')]}},'log':'rescheduleContact'});};exports[_0x2cf1('0xa')]=function(_0x25a814,_0x25c6c8,_0x5ec458){return function(){return client[_0x2cf1('0x1')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x25a814,'ListId':_0x25c6c8,'ContactId':_0x5ec458}},'log':_0x2cf1('0xb')});};};exports[_0x2cf1('0xc')]=function(_0xdc71f3,_0x3ae4e1,_0x419a4d,_0xedeff5){return client[_0x2cf1('0x1')](_0x2cf1('0xd'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xdc71f3,'active':![],'scheduledat':{'$lte':moment()[_0x2cf1('0xe')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x3ae4e1}}]},'order':[[_0x2cf1('0xf'),_0x2cf1('0x10')],['scheduledat',_0xedeff5],['id',_0x2cf1('0x11')]],'raw':!![],'limit':_0x419a4d},'log':_0x2cf1('0xd')});};exports[_0x2cf1('0x12')]=function(_0x200378,_0x622567,_0x16ad2d){return client[_0x2cf1('0x1')](_0x2cf1('0xd'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x200378,'active':![],'scheduledat':{'$lte':moment()[_0x2cf1('0xe')](_0x2cf1('0x7'))}},'include':[{'model':_0x2cf1('0x2'),'as':'Contact'}],'order':[[_0x2cf1('0xf'),'DESC'],[_0x2cf1('0x13'),_0x16ad2d],['id',_0x2cf1('0x11')]],'raw':!![],'limit':_0x622567},'log':_0x2cf1('0x14')});};exports[_0x2cf1('0x15')]=function(_0x16f681,_0x37c3ef){_0x16f681[_0x2cf1('0x16')]=_0x16f681[_0x2cf1('0x17')];return client['Request'](_0x2cf1('0x18'),{'body':_0x16f681,'options':{'where':{'ContactId':_0x16f681[_0x2cf1('0x19')],'ListId':_0x16f681[_0x2cf1('0x1a')],'VoiceQueueId':_0x16f681['VoiceQueueId'],'CampaignId':_0x16f681[_0x2cf1('0x9')],'active':_0x37c3ef?undefined:!![]}},'log':'MoveContactManagedDialer'});};exports[_0x2cf1('0x1b')]=function(_0x369dcd){return client[_0x2cf1('0x1')](_0x2cf1('0x1c'),{'options':{'where':{'VoiceQueueId':_0x369dcd['id']?_0x369dcd['id']||null:null}},'log':'countReScheduled'});};exports[_0x2cf1('0x1d')]=function(_0x3e5cae){return function(){return client[_0x2cf1('0x1')](_0x2cf1('0x1e'),{'options':{'where':{'id':_0x3e5cae},'include':[{'model':'CmContact','as':_0x2cf1('0x3')},{'model':'User','as':'Agent','attributes':['id',_0x2cf1('0x1f')]},{'model':'VoiceQueue','as':_0x2cf1('0x20'),'attributes':['id',_0x2cf1('0x1f')]}],'raw':!![]},'log':_0x2cf1('0x4')});};};exports['unlockContact']=function(_0x276d3b,_0x4f143e,_0x4c564a){return client[_0x2cf1('0x1')](_0x2cf1('0x6'),{'body':_0x276d3b,'options':{'where':{'id':_0x4f143e},'limit':_0x4c564a},'log':_0x2cf1('0x6')});};exports[_0x2cf1('0x21')]=function(_0x2beee9,_0xd1b3a1){return function(){return client['Request']('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2beee9,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x2cf1('0xe')](_0x2cf1('0x7'))},'UserId':{'$in':_0xd1b3a1}},'order':[[_0x2cf1('0xf'),_0x2cf1('0x10')],[_0x2cf1('0x13'),_0x2cf1('0x10')],['id','ASC']],'include':[{'model':_0x2cf1('0x2'),'as':'Contact'},{'model':_0x2cf1('0x22'),'as':'Agent','attributes':['id',_0x2cf1('0x1f'),_0x2cf1('0x23')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x2cf1('0xd')});};};exports[_0x2cf1('0x24')]=function(_0x22f1a0,_0x43cc82){return client['Request'](_0x2cf1('0x25'),{'body':_0x22f1a0,'options':_0x43cc82||{},'log':_0x2cf1('0x25')});};exports[_0x2cf1('0x26')]=function(_0x2e352b,_0x3e20fe,_0x36be01){return function(){return client['Request']('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x2e352b,'interval':_0x3e20fe,'availableAgentsIds':_0x36be01}},'log':_0x2cf1('0x26')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec6b=['incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones','VerifyAdditionalPhones','swapAdditionalPhones','Request','SwapAdditionalPhones'];(function(_0x2835bd,_0xeacf99){var _0x3a1252=function(_0x189627){while(--_0x189627){_0x2835bd['push'](_0x2835bd['shift']());}};_0x3a1252(++_0xeacf99);}(_0xec6b,0xf2));var _0xbec6=function(_0x44ce72,_0xa3f558){_0x44ce72=_0x44ce72-0x0;var _0x1d3710=_0xec6b[_0x44ce72];return _0x1d3710;};'use strict';var client=require(_0xbec6('0x0'));exports[_0xbec6('0x1')]=function(_0x1015e4,_0x2bbead,_0xffef59){return client['Request'](_0xbec6('0x2'),{'body':_0x1015e4,'reason':_0x2bbead,'entity':_0xffef59,'log':_0xbec6('0x2')});};exports[_0xbec6('0x3')]=function(_0x3b6203,_0x1a48dc,_0x538a19){return client[_0xbec6('0x4')](_0xbec6('0x5'),{'body':_0x3b6203,'duration':_0x1a48dc,'waitTime':_0x538a19,'log':_0xbec6('0x5')});};exports[_0xbec6('0x6')]=function(_0x438107){return function(){return client[_0xbec6('0x4')](_0xbec6('0x7'),{'body':_0x438107,'log':'IncrementPreviewCounters'});};};
\ No newline at end of file
+var _0x8ea8=['swapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones','Request','VerifyAdditionalPhones'];(function(_0x515c6b,_0x14ac60){var _0x4ae2dd=function(_0x583387){while(--_0x583387){_0x515c6b['push'](_0x515c6b['shift']());}};_0x4ae2dd(++_0x14ac60);}(_0x8ea8,0xb9));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x88ea('0x0'));exports[_0x88ea('0x1')]=function(_0x23077f,_0x111ce3,_0xa8aa98){return client[_0x88ea('0x2')]('VerifyAdditionalPhones',{'body':_0x23077f,'reason':_0x111ce3,'entity':_0xa8aa98,'log':_0x88ea('0x3')});};exports[_0x88ea('0x4')]=function(_0x2e94f5,_0xb9afae,_0x4e3032){return client['Request']('SwapAdditionalPhones',{'body':_0x2e94f5,'duration':_0xb9afae,'waitTime':_0x4e3032,'log':'SwapAdditionalPhones'});};exports[_0x88ea('0x5')]=function(_0x2bdf00){return function(){return client[_0x88ea('0x2')](_0x88ea('0x6'),{'body':_0x2bdf00,'log':_0x88ea('0x6')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b28=['CampaignId','../client','checkIsBlackList','Request','GetCmHopperBlack','phone'];(function(_0x3c33ba,_0x162f00){var _0x16a740=function(_0x56bfb5){while(--_0x56bfb5){_0x3c33ba['push'](_0x3c33ba['shift']());}};_0x16a740(++_0x162f00);}(_0x5b28,0x193));var _0x85b2=function(_0x4da64c,_0x179ace){_0x4da64c=_0x4da64c-0x0;var _0x4410ac=_0x5b28[_0x4da64c];return _0x4410ac;};'use strict';var client=require(_0x85b2('0x0'));exports[_0x85b2('0x1')]=function(_0x568580){return client[_0x85b2('0x2')](_0x85b2('0x3'),{'options':{'where':{'VoiceQueueId':_0x568580['VoiceQueueId'],'phone':_0x568580[_0x85b2('0x4')]},'raw':![]},'log':_0x85b2('0x3')});};exports['checkIsBlackListIvr']=function(_0x56a0b6){return client[_0x85b2('0x2')](_0x85b2('0x3'),{'options':{'where':{'CampaignId':_0x56a0b6[_0x85b2('0x5')],'phone':_0x56a0b6[_0x85b2('0x4')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};
\ No newline at end of file
+var _0xb236=['GetCmHopperBlack','phone','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request'];(function(_0x10f9c7,_0x14e869){var _0x43fe47=function(_0x13e77f){while(--_0x13e77f){_0x10f9c7['push'](_0x10f9c7['shift']());}};_0x43fe47(++_0x14e869);}(_0xb236,0x169));var _0x6b23=function(_0x3da4d0,_0x251347){_0x3da4d0=_0x3da4d0-0x0;var _0x453384=_0xb236[_0x3da4d0];return _0x453384;};'use strict';var client=require(_0x6b23('0x0'));exports[_0x6b23('0x1')]=function(_0x51709e){return client[_0x6b23('0x2')](_0x6b23('0x3'),{'options':{'where':{'VoiceQueueId':_0x51709e['VoiceQueueId'],'phone':_0x51709e[_0x6b23('0x4')]},'raw':![]},'log':_0x6b23('0x3')});};exports['checkIsBlackListIvr']=function(_0x20099b){return client[_0x6b23('0x2')](_0x6b23('0x3'),{'options':{'where':{'CampaignId':_0x20099b[_0x6b23('0x5')],'phone':_0x20099b[_0x6b23('0x4')]},'raw':![]},'log':_0x6b23('0x6')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb13c=['../client','queue','Request','CreateCmHopperFinal'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb13c,0x1b8));var _0xcb13=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xb13c[_0x35e75a];return _0xb23c7f;};'use strict';var client=require(_0xcb13('0x0'));exports['createContact']=function(_0x56843a){return function(){_0x56843a['campaign']=_0x56843a[_0xcb13('0x1')];return client[_0xcb13('0x2')](_0xcb13('0x3'),{'body':_0x56843a,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0x1d30=['campaign','queue','CreateCmHopperFinal','../client','createContact'];(function(_0x2d40fe,_0x168a46){var _0x1a5413=function(_0x4d86df){while(--_0x4d86df){_0x2d40fe['push'](_0x2d40fe['shift']());}};_0x1a5413(++_0x168a46);}(_0x1d30,0x193));var _0x01d3=function(_0x52d023,_0x127913){_0x52d023=_0x52d023-0x0;var _0x5c2541=_0x1d30[_0x52d023];return _0x5c2541;};'use strict';var client=require(_0x01d3('0x0'));exports[_0x01d3('0x1')]=function(_0x3c4972){return function(){_0x3c4972[_0x01d3('0x2')]=_0x3c4972[_0x01d3('0x3')];return client['Request']('CreateCmHopperFinal',{'body':_0x3c4972,'log':_0x01d3('0x4')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec3d=['campaign','queue','CreateCmHopperHistory','Request','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','day','endOf','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','startOf','ivr','../client','moment','createHistory'];(function(_0x58c070,_0x56e7fa){var _0x56d41d=function(_0x46ba89){while(--_0x46ba89){_0x58c070['push'](_0x58c070['shift']());}};_0x56d41d(++_0x56e7fa);}(_0xec3d,0x1a1));var _0xdec3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec3d[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xdec3('0x0'));var moment=require(_0xdec3('0x1'));exports[_0xdec3('0x2')]=function(_0x256daa){_0x256daa[_0xdec3('0x3')]=_0x256daa[_0xdec3('0x4')];return client['Request'](_0xdec3('0x5'),{'body':_0x256daa,'log':_0xdec3('0x5')});};exports['avgHandleTime']=function(_0x1249e6){return client[_0xdec3('0x6')](_0xdec3('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0xdec3('0x8')](_0x1249e6,_0xdec3('0x9'))[_0xdec3('0xa')](_0xdec3('0xb')),moment()[_0xdec3('0xa')](_0xdec3('0xb'))]}},'raw':![]},'log':_0xdec3('0xc')});};exports[_0xdec3('0xd')]=function(){return function(){return client[_0xdec3('0x6')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xdec3('0xe'))['format'](_0xdec3('0xb')),moment()[_0xdec3('0xf')]('day')[_0xdec3('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xdec3('0x4')},'raw':![]},'log':_0xdec3('0x10')});};};exports['getCampaignHopperHistory']=function(){return function(){return client['Request'](_0xdec3('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xdec3('0x12')](_0xdec3('0xe'))[_0xdec3('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xdec3('0xf')](_0xdec3('0xe'))[_0xdec3('0xa')](_0xdec3('0xb'))]},'campaigntype':_0xdec3('0x13')},'raw':![]},'log':_0xdec3('0x11')});};};
\ No newline at end of file
+var _0xf505=['getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory'];(function(_0xa07f29,_0x4a74e6){var _0x15c6df=function(_0x275ac0){while(--_0x275ac0){_0xa07f29['push'](_0xa07f29['shift']());}};_0x15c6df(++_0x4a74e6);}(_0xf505,0x14b));var _0x5f50=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0xf505[_0x2e4a0f];return _0x25a3cd;};'use strict';var client=require('../client');var moment=require('moment');exports[_0x5f50('0x0')]=function(_0x351e37){_0x351e37[_0x5f50('0x1')]=_0x351e37[_0x5f50('0x2')];return client[_0x5f50('0x3')](_0x5f50('0x4'),{'body':_0x351e37,'log':'CreateCmHopperHistory'});};exports[_0x5f50('0x5')]=function(_0xf80138){return client[_0x5f50('0x3')](_0x5f50('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0xf80138,_0x5f50('0x7'))['format'](_0x5f50('0x8')),moment()[_0x5f50('0x9')](_0x5f50('0x8'))]}},'raw':![]},'log':_0x5f50('0xa')});};exports[_0x5f50('0xb')]=function(){return function(){return client[_0x5f50('0x3')](_0x5f50('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x5f50('0xd')](_0x5f50('0xe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x5f50('0xf')]('day')['format'](_0x5f50('0x8'))]},'campaigntype':_0x5f50('0x2')},'raw':![]},'log':_0x5f50('0xc')});};};exports[_0x5f50('0x10')]=function(){return function(){return client[_0x5f50('0x3')](_0x5f50('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x5f50('0xd')](_0x5f50('0xe'))[_0x5f50('0x9')](_0x5f50('0x8')),moment()['endOf'](_0x5f50('0xe'))[_0x5f50('0x9')](_0x5f50('0x8'))]},'campaigntype':_0x5f50('0x12')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x22b4=['getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','localstationid','maxrate','modem','gateway','faxdetect','t38timeout','tech','ListId','Trunk','callerid','active','getFaxAccount','NotifyFaxAccount','../client'];(function(_0x27b8d0,_0x562f8a){var _0xbdd693=function(_0x2e892b){while(--_0x2e892b){_0x27b8d0['push'](_0x27b8d0['shift']());}};_0xbdd693(++_0x562f8a);}(_0x22b4,0x8b));var _0x422b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x22b4[_0x413feb];return _0x40ee88;};'use strict';var client=require(_0x422b('0x0'));exports[_0x422b('0x1')]=function(){return function(){return client[_0x422b('0x2')](_0x422b('0x3'),{'options':{'raw':![],'attributes':['id',_0x422b('0x4'),_0x422b('0x5'),'ecm',_0x422b('0x6'),_0x422b('0x7'),'minrate',_0x422b('0x8'),_0x422b('0x9'),_0x422b('0xa'),_0x422b('0xb'),_0x422b('0xc'),_0x422b('0xd'),'TrunkId',_0x422b('0xe'),'key'],'include':[{'model':_0x422b('0xf'),'as':_0x422b('0xf'),'attributes':['id',_0x422b('0x4'),_0x422b('0x10'),_0x422b('0x11')]}]},'log':_0x422b('0x12')});};};exports['notify']=function(_0x3bfc9a,_0x2a99b6){return client[_0x422b('0x2')](_0x422b('0x13'),{'account':{'id':_0x3bfc9a},'body':_0x2a99b6,'log':_0x422b('0x13')});};
\ No newline at end of file
+var _0xe1c4=['faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','name','callerid','active','getFaxAccount','NotifyFaxAccount','../client','getFaxAccounts','Request','description','headerinfo','localstationid','minrate','gateway'];(function(_0xdb47d8,_0x933e5b){var _0x5cdfd9=function(_0x3b69a8){while(--_0x3b69a8){_0xdb47d8['push'](_0xdb47d8['shift']());}};_0x5cdfd9(++_0x933e5b);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x2cefdb,_0x59dbda){_0x2cefdb=_0x2cefdb-0x0;var _0x241c07=_0xe1c4[_0x2cefdb];return _0x241c07;};'use strict';var client=require(_0x4e1c('0x0'));exports[_0x4e1c('0x1')]=function(){return function(){return client[_0x4e1c('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id','name',_0x4e1c('0x3'),'ecm',_0x4e1c('0x4'),_0x4e1c('0x5'),_0x4e1c('0x6'),'maxrate','modem',_0x4e1c('0x7'),_0x4e1c('0x8'),_0x4e1c('0x9'),_0x4e1c('0xa'),_0x4e1c('0xb'),_0x4e1c('0xc'),_0x4e1c('0xd')],'include':[{'model':_0x4e1c('0xe'),'as':_0x4e1c('0xe'),'attributes':['id',_0x4e1c('0xf'),_0x4e1c('0x10'),_0x4e1c('0x11')]}]},'log':_0x4e1c('0x12')});};};exports['notify']=function(_0x37b5fd,_0x133a2a){return client['Request'](_0x4e1c('0x13'),{'account':{'id':_0x37b5fd},'body':_0x133a2a,'log':_0x4e1c('0x13')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf478=['update','Request','UpdateFaxMessage','../client'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xf478,0x19f));var _0x8f47=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xf478[_0x433a86];return _0x23000c;};'use strict';var client=require(_0x8f47('0x0'));exports[_0x8f47('0x1')]=function(_0x850806,_0x48eadd){return client[_0x8f47('0x2')](_0x8f47('0x3'),{'body':_0x48eadd,'options':{'where':{'AttachmentId':_0x850806}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0xb5e9=['update','Request','UpdateFaxMessage'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xb5e9,0x1ad));var _0x9b5e=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0xb5e9[_0x33a694];return _0x41ff01;};'use strict';var client=require('../client');exports[_0x9b5e('0x0')]=function(_0x4f0f2a,_0x55c815){return client[_0x9b5e('0x1')](_0x9b5e('0x2'),{'body':_0x55c815,'options':{'where':{'AttachmentId':_0x4f0f2a}},'log':_0x9b5e('0x2')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6cac=['Request','GetDeskAccount','name','description','remoteUri','authType','type','Configurations','DeskField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','idField','customField','getDeskAccounts'];(function(_0x49d7e3,_0xf33e03){var _0x4c4bd5=function(_0x3c834c){while(--_0x3c834c){_0x49d7e3['push'](_0x49d7e3['shift']());}};_0x4c4bd5(++_0xf33e03);}(_0x6cac,0xb3));var _0xc6ca=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6cac[_0x3947c9];return _0x2e7871;};'use strict';var client=require('../../client');exports[_0xc6ca('0x0')]=function(){return function(_0x418bd2){return client[_0xc6ca('0x1')](_0xc6ca('0x2'),{'options':{'raw':![],'attributes':['id',_0xc6ca('0x3'),_0xc6ca('0x4'),'username','password',_0xc6ca('0x5'),_0xc6ca('0x6'),_0xc6ca('0x7'),'serverUrl'],'include':[{'model':'DeskConfiguration','as':_0xc6ca('0x8'),'attributes':['id',_0xc6ca('0x3')],'include':[{'model':_0xc6ca('0x9'),'as':_0xc6ca('0xa'),'attributes':['id',_0xc6ca('0x7'),'content','variableName'],'include':[{'model':'Variable','as':_0xc6ca('0xb'),'attributes':['id',_0xc6ca('0x3')]}]},{'model':'DeskField','as':_0xc6ca('0xc'),'attributes':['id',_0xc6ca('0x7'),_0xc6ca('0xd'),_0xc6ca('0xe'),_0xc6ca('0xf'),'keyContent',_0xc6ca('0x10')],'include':[{'model':_0xc6ca('0xb'),'as':_0xc6ca('0xb'),'attributes':['id',_0xc6ca('0x3')]}]},{'model':_0xc6ca('0x9'),'as':_0xc6ca('0x11'),'attributes':['id','type','content',_0xc6ca('0x12'),'nameField',_0xc6ca('0x13'),_0xc6ca('0x10')],'include':[{'model':_0xc6ca('0xb'),'as':_0xc6ca('0xb'),'attributes':['id',_0xc6ca('0x3')]}]},{'model':'Tag','as':'Tags','attributes':['id',_0xc6ca('0x3')]}]}]},'log':_0xc6ca('0x2')});};};
\ No newline at end of file
+var _0x1e6e=['Fields','idField','customField','Request','GetDeskAccount','name','description','username','remoteUri','authType','type','serverUrl','Configurations','Subjects','content','variableName','Variable','DeskField','Descriptions'];(function(_0x3ecbaa,_0xa4d584){var _0x20177c=function(_0x558499){while(--_0x558499){_0x3ecbaa['push'](_0x3ecbaa['shift']());}};_0x20177c(++_0xa4d584);}(_0x1e6e,0x10d));var _0xe1e6=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x1e6e[_0x7e2eb0];return _0xd92de4;};'use strict';var client=require('../../client');exports['getDeskAccounts']=function(){return function(_0x5f3f84){return client[_0xe1e6('0x0')](_0xe1e6('0x1'),{'options':{'raw':![],'attributes':['id',_0xe1e6('0x2'),_0xe1e6('0x3'),_0xe1e6('0x4'),'password',_0xe1e6('0x5'),_0xe1e6('0x6'),_0xe1e6('0x7'),_0xe1e6('0x8')],'include':[{'model':'DeskConfiguration','as':_0xe1e6('0x9'),'attributes':['id',_0xe1e6('0x2')],'include':[{'model':'DeskField','as':_0xe1e6('0xa'),'attributes':['id','type',_0xe1e6('0xb'),_0xe1e6('0xc')],'include':[{'model':_0xe1e6('0xd'),'as':_0xe1e6('0xd'),'attributes':['id',_0xe1e6('0x2')]}]},{'model':_0xe1e6('0xe'),'as':_0xe1e6('0xf'),'attributes':['id',_0xe1e6('0x7'),_0xe1e6('0xb'),'key','keyType','keyContent','variableName'],'include':[{'model':_0xe1e6('0xd'),'as':'Variable','attributes':['id','name']}]},{'model':_0xe1e6('0xe'),'as':_0xe1e6('0x10'),'attributes':['id',_0xe1e6('0x7'),_0xe1e6('0xb'),_0xe1e6('0x11'),'nameField',_0xe1e6('0x12'),_0xe1e6('0xc')],'include':[{'model':'Variable','as':_0xe1e6('0xd'),'attributes':['id',_0xe1e6('0x2')]}]},{'model':'Tag','as':'Tags','attributes':['id',_0xe1e6('0x2')]}]}]},'log':_0xe1e6('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e5c=['Variable','Dynamics365Field','Descriptions','key','Fields','nameField','customField','CloudProvider','data2','data7','../../client','GetDynamics365Account','name','username','clientId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','openNewTab','Subjects','type','content','variableName'];(function(_0x4b62fc,_0x229c7c){var _0x298c84=function(_0x4bbb41){while(--_0x4bbb41){_0x4b62fc['push'](_0x4b62fc['shift']());}};_0x298c84(++_0x229c7c);}(_0x4e5c,0x149));var _0xc4e5=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x4e5c[_0x1f36bb];return _0xaf97fa;};'use strict';var client=require(_0xc4e5('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x1cf8d8){return client['Request'](_0xc4e5('0x1'),{'options':{'raw':![],'attributes':['id',_0xc4e5('0x2'),_0xc4e5('0x3'),'password','remoteUri','tenantId',_0xc4e5('0x4'),_0xc4e5('0x5'),_0xc4e5('0x6'),_0xc4e5('0x7'),_0xc4e5('0x8')],'include':[{'model':_0xc4e5('0x9'),'as':_0xc4e5('0xa'),'attributes':['id',_0xc4e5('0x2'),_0xc4e5('0xb'),_0xc4e5('0xc'),_0xc4e5('0xd'),_0xc4e5('0xe')],'include':[{'model':'Dynamics365Field','as':_0xc4e5('0xf'),'attributes':['id',_0xc4e5('0x10'),_0xc4e5('0x11'),_0xc4e5('0x12')],'include':[{'model':'Variable','as':_0xc4e5('0x13'),'attributes':['id',_0xc4e5('0x2')]}]},{'model':_0xc4e5('0x14'),'as':_0xc4e5('0x15'),'attributes':['id',_0xc4e5('0x10'),_0xc4e5('0x11'),_0xc4e5('0x16'),'keyType','keyContent',_0xc4e5('0x12')],'include':[{'model':'Variable','as':_0xc4e5('0x13'),'attributes':['id',_0xc4e5('0x2')]}]},{'model':_0xc4e5('0x14'),'as':_0xc4e5('0x17'),'attributes':['id','type',_0xc4e5('0x11'),'idField',_0xc4e5('0x18'),_0xc4e5('0x19'),_0xc4e5('0x12')],'include':[{'model':_0xc4e5('0x13'),'as':_0xc4e5('0x13'),'attributes':['id',_0xc4e5('0x2')]}]}]},{'model':_0xc4e5('0x1a'),'as':_0xc4e5('0x1a'),'attributes':['id',_0xc4e5('0x1b'),'data5',_0xc4e5('0x1c')]}]},'log':_0xc4e5('0x1')});};};
\ No newline at end of file
+var _0x536f=['remoteUri','clientId','serverUrl','description','modernAuthentication','ticketType','moduleCreate','additionalSearchContact','Subjects','type','Variable','Dynamics365Field','Descriptions','content','keyType','keyContent','variableName','Fields','idField','nameField','CloudProvider','data2','data5','data7','GetDynamics365Account','../../client','name','username','password'];(function(_0x41d440,_0x1bb90d){var _0x3268a2=function(_0x3dc98b){while(--_0x3dc98b){_0x41d440['push'](_0x41d440['shift']());}};_0x3268a2(++_0x1bb90d);}(_0x536f,0x70));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xf536('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x4e4212){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0xf536('0x1'),_0xf536('0x2'),_0xf536('0x3'),_0xf536('0x4'),'tenantId',_0xf536('0x5'),'clientSecret',_0xf536('0x6'),_0xf536('0x7'),_0xf536('0x8')],'include':[{'model':'Dynamics365Configuration','as':'Configurations','attributes':['id',_0xf536('0x1'),_0xf536('0x9'),_0xf536('0xa'),_0xf536('0xb'),'openNewTab'],'include':[{'model':'Dynamics365Field','as':_0xf536('0xc'),'attributes':['id',_0xf536('0xd'),'content','variableName'],'include':[{'model':_0xf536('0xe'),'as':_0xf536('0xe'),'attributes':['id',_0xf536('0x1')]}]},{'model':_0xf536('0xf'),'as':_0xf536('0x10'),'attributes':['id','type',_0xf536('0x11'),'key',_0xf536('0x12'),_0xf536('0x13'),_0xf536('0x14')],'include':[{'model':_0xf536('0xe'),'as':_0xf536('0xe'),'attributes':['id',_0xf536('0x1')]}]},{'model':_0xf536('0xf'),'as':_0xf536('0x15'),'attributes':['id',_0xf536('0xd'),_0xf536('0x11'),_0xf536('0x16'),_0xf536('0x17'),'customField',_0xf536('0x14')],'include':[{'model':'Variable','as':_0xf536('0xe'),'attributes':['id','name']}]}]},{'model':_0xf536('0x18'),'as':_0xf536('0x18'),'attributes':['id',_0xf536('0x19'),_0xf536('0x1a'),_0xf536('0x1b')]}]},'log':_0xf536('0x1c')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x720e=['apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','Variable','Descriptions','type','content','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','getFreshdeskAccounts','name'];(function(_0x41a8de,_0x3c3ca9){var _0x5c56e3=function(_0x2b9872){while(--_0x2b9872){_0x41a8de['push'](_0x41a8de['shift']());}};_0x5c56e3(++_0x3c3ca9);}(_0x720e,0x1cb));var _0xe720=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x720e[_0x2bddf9];return _0x3f3ae9;};'use strict';var client=require(_0xe720('0x0'));exports[_0xe720('0x1')]=function(){return function(_0x46d8f1){return client['Request']('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0xe720('0x2'),'username',_0xe720('0x3'),_0xe720('0x4'),_0xe720('0x5')],'include':[{'model':_0xe720('0x6'),'as':_0xe720('0x7'),'attributes':['id',_0xe720('0x2')],'include':[{'model':_0xe720('0x8'),'attributes':['id','name']},{'model':_0xe720('0x9'),'as':_0xe720('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0xe720('0xb'),'as':_0xe720('0xb'),'attributes':['id',_0xe720('0x2')]}]},{'model':'FreshdeskField','as':_0xe720('0xc'),'attributes':['id',_0xe720('0xd'),_0xe720('0xe'),_0xe720('0xf'),_0xe720('0x10'),_0xe720('0x11'),'variableName'],'include':[{'model':'Variable','as':_0xe720('0xb'),'attributes':['id',_0xe720('0x2')]}]},{'model':_0xe720('0x9'),'as':_0xe720('0x12'),'attributes':['id',_0xe720('0xd'),_0xe720('0xe'),_0xe720('0x13'),_0xe720('0x14'),_0xe720('0x15'),'variableName'],'include':[{'model':'Variable','as':_0xe720('0xb'),'attributes':['id',_0xe720('0x2')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
+var _0xd914=['Descriptions','keyContent','idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','FreshdeskConfiguration','Tag','FreshdeskField','Subjects','type','content','variableName','Variable'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd914,0x17f));var _0x4d91=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xd914[_0x11a55c];return _0x26c390;};'use strict';var client=require(_0x4d91('0x0'));exports[_0x4d91('0x1')]=function(){return function(_0x4c9a1f){return client[_0x4d91('0x2')](_0x4d91('0x3'),{'options':{'raw':![],'attributes':['id',_0x4d91('0x4'),_0x4d91('0x5'),_0x4d91('0x6'),_0x4d91('0x7'),'serverUrl'],'include':[{'model':_0x4d91('0x8'),'as':'Configurations','attributes':['id',_0x4d91('0x4')],'include':[{'model':_0x4d91('0x9'),'attributes':['id',_0x4d91('0x4')]},{'model':_0x4d91('0xa'),'as':_0x4d91('0xb'),'attributes':['id',_0x4d91('0xc'),_0x4d91('0xd'),_0x4d91('0xe')],'include':[{'model':'Variable','as':_0x4d91('0xf'),'attributes':['id',_0x4d91('0x4')]}]},{'model':_0x4d91('0xa'),'as':_0x4d91('0x10'),'attributes':['id',_0x4d91('0xc'),_0x4d91('0xd'),'key','keyType',_0x4d91('0x11'),_0x4d91('0xe')],'include':[{'model':_0x4d91('0xf'),'as':_0x4d91('0xf'),'attributes':['id',_0x4d91('0x4')]}]},{'model':_0x4d91('0xa'),'as':'Fields','attributes':['id','type',_0x4d91('0xd'),_0x4d91('0x12'),_0x4d91('0x13'),_0x4d91('0x14'),_0x4d91('0xe')],'include':[{'model':_0x4d91('0xf'),'as':_0x4d91('0xf'),'attributes':['id','name']}]}]}]},'log':_0x4d91('0x3')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeae8=['FreshsalesConfiguration','Configurations','name','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','GetFreshsalesccount','../../client','getFreshsalesAccounts','GetFreshsalesAccount','username','remoteUri','serverUrl'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xeae8,0x66));var _0x8eae=function(_0xa61d0a,_0x3344ad){_0xa61d0a=_0xa61d0a-0x0;var _0x415d21=_0xeae8[_0xa61d0a];return _0x415d21;};'use strict';var client=require(_0x8eae('0x0'));exports[_0x8eae('0x1')]=function(){return function(_0xed5722){return client['Request'](_0x8eae('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8eae('0x3'),'apiKey',_0x8eae('0x4'),_0x8eae('0x5')],'include':[{'model':_0x8eae('0x6'),'as':_0x8eae('0x7'),'attributes':['id',_0x8eae('0x8')],'include':[{'model':_0x8eae('0x9'),'as':_0x8eae('0xa'),'attributes':['id',_0x8eae('0xb'),_0x8eae('0xc'),_0x8eae('0xd')],'include':[{'model':_0x8eae('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':_0x8eae('0x9'),'as':_0x8eae('0xf'),'attributes':['id',_0x8eae('0xb'),_0x8eae('0xc'),_0x8eae('0x10'),'keyType','keyContent','variableName'],'include':[{'model':_0x8eae('0xe'),'as':_0x8eae('0xe'),'attributes':['id','name']}]}]}]},'log':_0x8eae('0x11')});};};
\ No newline at end of file
+var _0x5334=['username','remoteUri','serverUrl','FreshsalesField','variableName','Variable','name','Descriptions','type','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount'];(function(_0x28bf82,_0x3ba308){var _0x24b607=function(_0x143e2b){while(--_0x143e2b){_0x28bf82['push'](_0x28bf82['shift']());}};_0x24b607(++_0x3ba308);}(_0x5334,0x84));var _0x4533=function(_0x40b461,_0x4887f8){_0x40b461=_0x40b461-0x0;var _0x174f5b=_0x5334[_0x40b461];return _0x174f5b;};'use strict';var client=require(_0x4533('0x0'));exports[_0x4533('0x1')]=function(){return function(_0x6499ca){return client[_0x4533('0x2')](_0x4533('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4533('0x4'),'apiKey',_0x4533('0x5'),_0x4533('0x6')],'include':[{'model':'FreshsalesConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':_0x4533('0x7'),'as':'Subjects','attributes':['id','type','content',_0x4533('0x8')],'include':[{'model':_0x4533('0x9'),'as':_0x4533('0x9'),'attributes':['id',_0x4533('0xa')]}]},{'model':_0x4533('0x7'),'as':_0x4533('0xb'),'attributes':['id',_0x4533('0xc'),'content',_0x4533('0xd'),_0x4533('0xe'),_0x4533('0xf'),_0x4533('0x8')],'include':[{'model':'Variable','as':_0x4533('0x9'),'attributes':['id','name']}]}]}]},'log':_0x4533('0x10')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeec6=['moduleSearch','ticketType','leadId','additionalSearchAccount','additionalSearchLead','Subjects','Variable','Fields','../../client','Request','GetSalesforceAccount','name','username','remoteUri','clientId','securityToken','serverUrl','SalesforceConfiguration','Configurations'];(function(_0x5cc1c7,_0x43badd){var _0x493561=function(_0x54c390){while(--_0x54c390){_0x5cc1c7['push'](_0x5cc1c7['shift']());}};_0x493561(++_0x43badd);}(_0xeec6,0x125));var _0x6eec=function(_0x1d3019,_0x8dbbd5){_0x1d3019=_0x1d3019-0x0;var _0x36458e=_0xeec6[_0x1d3019];return _0x36458e;};'use strict';var client=require(_0x6eec('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x50fed5){return client[_0x6eec('0x1')](_0x6eec('0x2'),{'options':{'raw':![],'attributes':['id',_0x6eec('0x3'),_0x6eec('0x4'),'password',_0x6eec('0x5'),_0x6eec('0x6'),'clientSecret',_0x6eec('0x7'),_0x6eec('0x8'),'type'],'include':[{'model':_0x6eec('0x9'),'as':_0x6eec('0xa'),'attributes':['id',_0x6eec('0x3'),_0x6eec('0xb'),'moduleCreate',_0x6eec('0xc'),_0x6eec('0xd'),_0x6eec('0xe'),'additionalSearchContact',_0x6eec('0xf')],'include':[{'model':'SalesforceField','as':_0x6eec('0x10'),'include':[{'model':_0x6eec('0x11'),'as':_0x6eec('0x11'),'attributes':['id','name']}]},{'model':'SalesforceField','as':'Descriptions','include':[{'model':_0x6eec('0x11'),'as':'Variable','attributes':['id','name']}]},{'model':'SalesforceField','as':_0x6eec('0x12'),'include':[{'model':_0x6eec('0x11'),'as':_0x6eec('0x11'),'attributes':['id','name']}]}]}]},'log':_0x6eec('0x2')});};};
\ No newline at end of file
+var _0x8325=['type','SalesforceConfiguration','Configurations','name','moduleSearch','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','../../client','GetSalesforceAccount','username','password','remoteUri','clientId','serverUrl'];(function(_0x269147,_0x45dfc7){var _0x38ab4c=function(_0x56661d){while(--_0x56661d){_0x269147['push'](_0x269147['shift']());}};_0x38ab4c(++_0x45dfc7);}(_0x8325,0x1f1));var _0x5832=function(_0x4ee842,_0x552041){_0x4ee842=_0x4ee842-0x0;var _0x48ea5f=_0x8325[_0x4ee842];return _0x48ea5f;};'use strict';var client=require(_0x5832('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x1bd3b5){return client['Request'](_0x5832('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x5832('0x2'),_0x5832('0x3'),_0x5832('0x4'),_0x5832('0x5'),'clientSecret','securityToken',_0x5832('0x6'),_0x5832('0x7')],'include':[{'model':_0x5832('0x8'),'as':_0x5832('0x9'),'attributes':['id',_0x5832('0xa'),_0x5832('0xb'),'moduleCreate',_0x5832('0xc'),_0x5832('0xd'),_0x5832('0xe'),_0x5832('0xf'),_0x5832('0x10')],'include':[{'model':_0x5832('0x11'),'as':_0x5832('0x12'),'include':[{'model':_0x5832('0x13'),'as':_0x5832('0x13'),'attributes':['id','name']}]},{'model':'SalesforceField','as':_0x5832('0x14'),'include':[{'model':_0x5832('0x13'),'as':_0x5832('0x13'),'attributes':['id',_0x5832('0xa')]}]},{'model':'SalesforceField','as':'Fields','include':[{'model':_0x5832('0x13'),'as':_0x5832('0x13'),'attributes':['id',_0x5832('0xa')]}]}]}]},'log':_0x5832('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda19=['ServicenowConfiguration','Configurations','name','ServicenowField','Subjects','type','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','GetServicenowkAccount','getServicenowAccounts','GetServicenowAccount','description','password','email','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x53cc76,_0x3a3d14){_0x53cc76=_0x53cc76-0x0;var _0x5ecfcf=_0xda19[_0x53cc76];return _0x5ecfcf;};'use strict';var client=require('../../client');exports[_0x9da1('0x0')]=function(){return function(_0x430d39){return client['Request'](_0x9da1('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x9da1('0x2'),'username',_0x9da1('0x3'),_0x9da1('0x4'),_0x9da1('0x5'),_0x9da1('0x6')],'include':[{'model':_0x9da1('0x7'),'as':_0x9da1('0x8'),'attributes':['id',_0x9da1('0x9')],'include':[{'model':_0x9da1('0xa'),'as':_0x9da1('0xb'),'attributes':['id',_0x9da1('0xc'),'content','variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0xe'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),_0x9da1('0x10'),_0x9da1('0x11'),_0x9da1('0x12'),'variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0x13'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),'idField',_0x9da1('0x14'),'customField','variableName'],'include':[{'model':_0x9da1('0xd'),'as':'Variable','attributes':['id',_0x9da1('0x9')]}]}]}]},'log':_0x9da1('0x15')});};};
\ No newline at end of file
+var _0x3f8a=['Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','nameField','../../client','getServicenowAccounts','Request','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration'];(function(_0x2eed3a,_0x1ce61e){var _0x4391aa=function(_0x5a0cc3){while(--_0x5a0cc3){_0x2eed3a['push'](_0x2eed3a['shift']());}};_0x4391aa(++_0x1ce61e);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x47dfa8,_0x134985){_0x47dfa8=_0x47dfa8-0x0;var _0x484b72=_0x3f8a[_0x47dfa8];return _0x484b72;};'use strict';var client=require(_0xa3f8('0x0'));exports[_0xa3f8('0x1')]=function(){return function(_0x29d753){return client[_0xa3f8('0x2')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id',_0xa3f8('0x3'),_0xa3f8('0x4'),_0xa3f8('0x5'),_0xa3f8('0x6'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9')],'include':[{'model':_0xa3f8('0xa'),'as':_0xa3f8('0xb'),'attributes':['id',_0xa3f8('0x3')],'include':[{'model':_0xa3f8('0xc'),'as':_0xa3f8('0xd'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id','name']}]},{'model':_0xa3f8('0xc'),'as':_0xa3f8('0x12'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),'key',_0xa3f8('0x13'),_0xa3f8('0x14'),_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id',_0xa3f8('0x3')]}]},{'model':_0xa3f8('0xc'),'as':_0xa3f8('0x15'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),_0xa3f8('0x16'),_0xa3f8('0x17'),'customField',_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id',_0xa3f8('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1967=['serverUrl','SugarcrmConfiguration','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','remoteUri'];(function(_0x453095,_0x5698e6){var _0x4f1ecd=function(_0x6dd40){while(--_0x6dd40){_0x453095['push'](_0x453095['shift']());}};_0x4f1ecd(++_0x5698e6);}(_0x1967,0x173));var _0x7196=function(_0x3ab8c0,_0x54729c){_0x3ab8c0=_0x3ab8c0-0x0;var _0x10403b=_0x1967[_0x3ab8c0];return _0x10403b;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7')],'include':[{'model':_0x7196('0x8'),'as':'Configurations','attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd')],'include':[{'model':'Variable','as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0xb'),'content','key',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0x12'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0x13'),'nameField',_0x7196('0x14'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x2')});};};
\ No newline at end of file
+var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0x7ff50b,_0x399dc0){var _0x43e570=function(_0x16b092){while(--_0x16b092){_0x7ff50b['push'](_0x7ff50b['shift']());}};_0x43e570(++_0x399dc0);}(_0xdb28,0x106));var _0x8db2=function(_0x167002,_0x5e7fc4){_0x167002=_0x167002-0x0;var _0x1467ff=_0xdb28[_0x167002];return _0x1467ff;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac88=['name','description','username','accessKey','remoteUri','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Descriptions','key','keyType','Variable','Fields','nameField','customField','getVtigerAccounts','Request','GetVtigerAccount'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xac88,0x97));var _0x8ac8=function(_0x521240,_0x47596c){_0x521240=_0x521240-0x0;var _0x2a3a11=_0xac88[_0x521240];return _0x2a3a11;};'use strict';var client=require('../../client');exports[_0x8ac8('0x0')]=function(){return function(_0x2ebf1a){return client[_0x8ac8('0x1')](_0x8ac8('0x2'),{'options':{'raw':![],'attributes':['id',_0x8ac8('0x3'),_0x8ac8('0x4'),_0x8ac8('0x5'),_0x8ac8('0x6'),_0x8ac8('0x7'),'serverUrl'],'include':[{'model':_0x8ac8('0x8'),'as':_0x8ac8('0x9'),'attributes':['id',_0x8ac8('0x3')],'include':[{'model':_0x8ac8('0xa'),'as':_0x8ac8('0xb'),'attributes':['id',_0x8ac8('0xc'),_0x8ac8('0xd'),_0x8ac8('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x8ac8('0x3')]}]},{'model':_0x8ac8('0xa'),'as':_0x8ac8('0xf'),'attributes':['id','type','content',_0x8ac8('0x10'),_0x8ac8('0x11'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x8ac8('0x12'),'attributes':['id',_0x8ac8('0x3')]}]},{'model':'VtigerField','as':_0x8ac8('0x13'),'attributes':['id',_0x8ac8('0xc'),_0x8ac8('0xd'),'idField',_0x8ac8('0x14'),_0x8ac8('0x15'),_0x8ac8('0xe')],'include':[{'model':_0x8ac8('0x12'),'as':_0x8ac8('0x12'),'attributes':['id','name']}]}]}]},'log':_0x8ac8('0x2')});};};
\ No newline at end of file
+var _0x57ad=['serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','keyType','idField','nameField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','username','accessKey'];(function(_0x47953c,_0x510c38){var _0x2e3935=function(_0x7f1db6){while(--_0x7f1db6){_0x47953c['push'](_0x47953c['shift']());}};_0x2e3935(++_0x510c38);}(_0x57ad,0x85));var _0xd57a=function(_0x4b651e,_0x58d50e){_0x4b651e=_0x4b651e-0x0;var _0x53ad21=_0x57ad[_0x4b651e];return _0x53ad21;};'use strict';var client=require(_0xd57a('0x0'));exports[_0xd57a('0x1')]=function(){return function(_0x24c01c){return client[_0xd57a('0x2')](_0xd57a('0x3'),{'options':{'raw':![],'attributes':['id',_0xd57a('0x4'),'description',_0xd57a('0x5'),_0xd57a('0x6'),'remoteUri',_0xd57a('0x7')],'include':[{'model':_0xd57a('0x8'),'as':_0xd57a('0x9'),'attributes':['id','name'],'include':[{'model':_0xd57a('0xa'),'as':_0xd57a('0xb'),'attributes':['id',_0xd57a('0xc'),_0xd57a('0xd'),_0xd57a('0xe')],'include':[{'model':'Variable','as':_0xd57a('0xf'),'attributes':['id',_0xd57a('0x4')]}]},{'model':_0xd57a('0xa'),'as':'Descriptions','attributes':['id',_0xd57a('0xc'),_0xd57a('0xd'),'key',_0xd57a('0x10'),'keyContent',_0xd57a('0xe')],'include':[{'model':'Variable','as':_0xd57a('0xf'),'attributes':['id','name']}]},{'model':_0xd57a('0xa'),'as':'Fields','attributes':['id','type',_0xd57a('0xd'),_0xd57a('0x11'),_0xd57a('0x12'),_0xd57a('0x13'),'variableName'],'include':[{'model':_0xd57a('0xf'),'as':_0xd57a('0xf'),'attributes':['id',_0xd57a('0x4')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x573a=['Configurations','Tag','ZendeskField','Subjects','type','Variable','Descriptions','content','keyType','keyContent','idField','nameField','customField','variableName','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','remoteUri','authType','serverUrl','ZendeskConfiguration'];(function(_0x5320ed,_0x1c3999){var _0x2acedf=function(_0x3dc673){while(--_0x3dc673){_0x5320ed['push'](_0x5320ed['shift']());}};_0x2acedf(++_0x1c3999);}(_0x573a,0x153));var _0xa573=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x573a[_0xffa198];return _0x1e4b50;};'use strict';var client=require('../../client');exports[_0xa573('0x0')]=function(){return function(_0x34a00c){return client[_0xa573('0x1')](_0xa573('0x2'),{'options':{'raw':![],'attributes':['id',_0xa573('0x3'),_0xa573('0x4'),_0xa573('0x5'),_0xa573('0x6'),_0xa573('0x7'),_0xa573('0x8'),_0xa573('0x9'),'type'],'include':[{'model':_0xa573('0xa'),'as':_0xa573('0xb'),'attributes':['id',_0xa573('0x3')],'include':[{'model':_0xa573('0xc'),'attributes':['id',_0xa573('0x3')]},{'model':_0xa573('0xd'),'as':_0xa573('0xe'),'attributes':['id',_0xa573('0xf'),'content','variableName'],'include':[{'model':'Variable','as':_0xa573('0x10'),'attributes':['id',_0xa573('0x3')]}]},{'model':_0xa573('0xd'),'as':_0xa573('0x11'),'attributes':['id','type',_0xa573('0x12'),'key',_0xa573('0x13'),_0xa573('0x14'),'variableName'],'include':[{'model':'Variable','as':_0xa573('0x10'),'attributes':['id',_0xa573('0x3')]}]},{'model':_0xa573('0xd'),'as':'Fields','attributes':['id','type',_0xa573('0x12'),_0xa573('0x15'),_0xa573('0x16'),_0xa573('0x17'),_0xa573('0x18')],'include':[{'model':'Variable','as':_0xa573('0x10'),'attributes':['id','name']}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
+var _0xa63f=['remoteUri','authType','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','Fields','nameField','customField','../../client','getZendeskAccounts','GetZendeskAccount','name','username','token'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa63f,0x6d));var _0xfa63=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0xa63f[_0xca1091];return _0xd3019c;};'use strict';var client=require(_0xfa63('0x0'));exports[_0xfa63('0x1')]=function(){return function(_0x2b118e){return client['Request'](_0xfa63('0x2'),{'options':{'raw':![],'attributes':['id',_0xfa63('0x3'),_0xfa63('0x4'),'password',_0xfa63('0x5'),_0xfa63('0x6'),_0xfa63('0x7'),'serverUrl','type'],'include':[{'model':_0xfa63('0x8'),'as':_0xfa63('0x9'),'attributes':['id',_0xfa63('0x3')],'include':[{'model':_0xfa63('0xa'),'attributes':['id',_0xfa63('0x3')]},{'model':_0xfa63('0xb'),'as':_0xfa63('0xc'),'attributes':['id',_0xfa63('0xd'),_0xfa63('0xe'),_0xfa63('0xf')],'include':[{'model':_0xfa63('0x10'),'as':_0xfa63('0x10'),'attributes':['id',_0xfa63('0x3')]}]},{'model':'ZendeskField','as':_0xfa63('0x11'),'attributes':['id','type','content',_0xfa63('0x12'),_0xfa63('0x13'),'keyContent',_0xfa63('0xf')],'include':[{'model':'Variable','as':_0xfa63('0x10'),'attributes':['id',_0xfa63('0x3')]}]},{'model':'ZendeskField','as':_0xfa63('0x14'),'attributes':['id',_0xfa63('0xd'),'content','idField',_0xfa63('0x15'),_0xfa63('0x16'),_0xfa63('0xf')],'include':[{'model':_0xfa63('0x10'),'as':_0xfa63('0x10'),'attributes':['id','name']}]}]}]},'log':_0xfa63('0x2')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x02ee=['code','Configurations','moduleCreate','description','ZohoField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','nameField','getZohoAccounts','Request','GetZohoAccount','name','clientId','clientSecret'];(function(_0x300e8a,_0x49a547){var _0x5d2b81=function(_0x5291cc){while(--_0x5291cc){_0x300e8a['push'](_0x300e8a['shift']());}};_0x5d2b81(++_0x49a547);}(_0x02ee,0x1de));var _0xe02e=function(_0x192352,_0xf5dc86){_0x192352=_0x192352-0x0;var _0x33b494=_0x02ee[_0x192352];return _0x33b494;};'use strict';var client=require('../../client');exports[_0xe02e('0x0')]=function(){return function(_0x57f121){return client[_0xe02e('0x1')](_0xe02e('0x2'),{'options':{'raw':![],'attributes':['id',_0xe02e('0x3'),'description','host','zone',_0xe02e('0x4'),_0xe02e('0x5'),'serverUrl',_0xe02e('0x6'),'refreshToken'],'include':[{'model':'ZohoConfiguration','as':_0xe02e('0x7'),'attributes':['id',_0xe02e('0x3'),_0xe02e('0x8'),'moduleSearch',_0xe02e('0x9')],'include':[{'model':_0xe02e('0xa'),'as':_0xe02e('0xb'),'attributes':['id','type',_0xe02e('0xc'),_0xe02e('0xd')],'include':[{'model':_0xe02e('0xe'),'as':'Variable','attributes':['id',_0xe02e('0x3')]}]},{'model':_0xe02e('0xa'),'as':_0xe02e('0xf'),'attributes':['id',_0xe02e('0x10'),'content',_0xe02e('0x11'),_0xe02e('0x12'),_0xe02e('0x13'),_0xe02e('0xd')],'include':[{'model':_0xe02e('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':_0xe02e('0xa'),'as':_0xe02e('0x14'),'attributes':['id','type',_0xe02e('0xc'),'idField',_0xe02e('0x15'),'customField',_0xe02e('0xd')],'include':[{'model':_0xe02e('0xe'),'as':_0xe02e('0xe'),'attributes':['id','name']}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0xa580=['ZohoField','Subjects','type','content','Variable','key','keyType','variableName','Fields','idField','nameField','../../client','GetZohoAccount','name','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','moduleCreate','moduleSearch','description'];(function(_0x183f4c,_0x10eb93){var _0x2fff1f=function(_0x5293eb){while(--_0x5293eb){_0x183f4c['push'](_0x183f4c['shift']());}};_0x2fff1f(++_0x10eb93);}(_0xa580,0x150));var _0x0a58=function(_0xf01dbe,_0x192685){_0xf01dbe=_0xf01dbe-0x0;var _0x344928=_0xa580[_0xf01dbe];return _0x344928;};'use strict';var client=require(_0x0a58('0x0'));exports['getZohoAccounts']=function(){return function(_0x184d2e){return client['Request'](_0x0a58('0x1'),{'options':{'raw':![],'attributes':['id',_0x0a58('0x2'),'description',_0x0a58('0x3'),_0x0a58('0x4'),_0x0a58('0x5'),_0x0a58('0x6'),_0x0a58('0x7'),_0x0a58('0x8'),_0x0a58('0x9')],'include':[{'model':'ZohoConfiguration','as':_0x0a58('0xa'),'attributes':['id',_0x0a58('0x2'),_0x0a58('0xb'),_0x0a58('0xc'),_0x0a58('0xd')],'include':[{'model':_0x0a58('0xe'),'as':_0x0a58('0xf'),'attributes':['id',_0x0a58('0x10'),_0x0a58('0x11'),'variableName'],'include':[{'model':_0x0a58('0x12'),'as':_0x0a58('0x12'),'attributes':['id',_0x0a58('0x2')]}]},{'model':_0x0a58('0xe'),'as':'Descriptions','attributes':['id',_0x0a58('0x10'),_0x0a58('0x11'),_0x0a58('0x13'),_0x0a58('0x14'),'keyContent',_0x0a58('0x15')],'include':[{'model':_0x0a58('0x12'),'as':_0x0a58('0x12'),'attributes':['id',_0x0a58('0x2')]}]},{'model':_0x0a58('0xe'),'as':_0x0a58('0x16'),'attributes':['id','type',_0x0a58('0x11'),_0x0a58('0x17'),_0x0a58('0x18'),'customField','variableName'],'include':[{'model':_0x0a58('0x12'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x0a58('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a3a=['intervalIftime\x20called\x20with','isArray','length','every','map','interval','concat','Request','IntervalIftime','intervalIftime','../../../config/logger','dialer','../client','stack','trim'];(function(_0x41c0e0,_0x69d04c){var _0x155556=function(_0x5834b4){while(--_0x5834b4){_0x41c0e0['push'](_0x41c0e0['shift']());}};_0x155556(++_0x69d04c);}(_0x4a3a,0x1ea));var _0xa4a3=function(_0x596828,_0x32361a){_0x596828=_0x596828-0x0;var _0x5adf44=_0x4a3a[_0x596828];return _0x5adf44;};var logger=require(_0xa4a3('0x0'))(_0xa4a3('0x1'));var client=require(_0xa4a3('0x2'));function intervalIftime(_0x49987c,_0x5dcb3a){const _0x44481f=new Error()[_0xa4a3('0x3')]['replace'](/^Error/,'')[_0xa4a3('0x4')]();logger['silly'](_0xa4a3('0x5'),_0x49987c,_0x5dcb3a,_0x44481f);const _0x4c45b2=Array[_0xa4a3('0x6')](_0x49987c);if(!_0x49987c||_0x4c45b2&&_0x49987c[_0xa4a3('0x7')]===0x0){return Promise['resolve'](![]);}else{var _0x5d22da=[];var _0x2de728=[];var _0x230ac1=_0x4c45b2?_0x49987c:[_0x49987c];var _0x35b747=_0x230ac1['every'](function(_0x21a27c){return typeof _0x21a27c==='number';});var _0xc871=_0x230ac1[_0xa4a3('0x8')](function(_0x386249){return typeof _0x386249==='string';});if(!_0x35b747&&!_0xc871){_0x5d22da=_0x230ac1[_0xa4a3('0x9')](function(_0x271162){return _0x271162['id'];});if(_0x5d22da[_0xa4a3('0x7')]===0x0){_0x2de728=_0x230ac1['map'](function(_0x5dd131){return _0x5dd131[_0xa4a3('0xa')];});}}else{if(_0x35b747){_0x5d22da=_0x5d22da[_0xa4a3('0xb')](_0x230ac1);}if(_0xc871){_0x2de728=_0x2de728[_0xa4a3('0xb')](_0x230ac1);}}return client[_0xa4a3('0xc')](_0xa4a3('0xd'),{'intervalIds':_0x5d22da,'intervals':_0x2de728,'timezone':_0x5dcb3a,'log':'IntervalIftime'});}}exports[_0xa4a3('0xe')]=intervalIftime;
\ No newline at end of file
+var _0xe012=['number','length','interval','concat','Request','IntervalIftime','intervalIftime','dialer','../client','stack','trim','intervalIftime\x20called\x20with','resolve','every'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe012,0x93));var _0x2e01=function(_0xb26bd2,_0x13ead0){_0xb26bd2=_0xb26bd2-0x0;var _0x5376ed=_0xe012[_0xb26bd2];return _0x5376ed;};var logger=require('../../../config/logger')(_0x2e01('0x0'));var client=require(_0x2e01('0x1'));function intervalIftime(_0x2abd75,_0x3c7959){const _0x2f28c0=new Error()[_0x2e01('0x2')]['replace'](/^Error/,'')[_0x2e01('0x3')]();logger['silly'](_0x2e01('0x4'),_0x2abd75,_0x3c7959,_0x2f28c0);const _0x468e05=Array['isArray'](_0x2abd75);if(!_0x2abd75||_0x468e05&&_0x2abd75['length']===0x0){return Promise[_0x2e01('0x5')](![]);}else{var _0x590936=[];var _0x517c68=[];var _0x49d815=_0x468e05?_0x2abd75:[_0x2abd75];var _0x195dce=_0x49d815[_0x2e01('0x6')](function(_0x175db7){return typeof _0x175db7===_0x2e01('0x7');});var _0x1470a8=_0x49d815[_0x2e01('0x6')](function(_0x4fb39f){return typeof _0x4fb39f==='string';});if(!_0x195dce&&!_0x1470a8){_0x590936=_0x49d815['map'](function(_0x3e272d){return _0x3e272d['id'];});if(_0x590936[_0x2e01('0x8')]===0x0){_0x517c68=_0x49d815['map'](function(_0x5c578b){return _0x5c578b[_0x2e01('0x9')];});}}else{if(_0x195dce){_0x590936=_0x590936[_0x2e01('0xa')](_0x49d815);}if(_0x1470a8){_0x517c68=_0x517c68[_0x2e01('0xa')](_0x49d815);}}return client[_0x2e01('0xb')](_0x2e01('0xc'),{'intervalIds':_0x590936,'intervals':_0x517c68,'timezone':_0x3c7959,'log':_0x2e01('0xc')});}}exports[_0x2e01('0xd')]=intervalIftime;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbfa=['isNil','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','CreateMemberReport','membername','interface','starttime','endtime','outbound','exten','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','voice','lastAssignedTo'];(function(_0xefbee3,_0x16f9d0){var _0x44c1bf=function(_0x4ad72a){while(--_0x4ad72a){_0xefbee3['push'](_0xefbee3['shift']());}};_0x44c1bf(++_0x16f9d0);}(_0xdbfa,0x1b7));var _0xadbf=function(_0x335ec6,_0x1c65fa){_0x335ec6=_0x335ec6-0x0;var _0xdd2c47=_0xdbfa[_0x335ec6];return _0xdd2c47;};'use strict';var moment=require(_0xadbf('0x0'));var _=require(_0xadbf('0x1'));var util=require(_0xadbf('0x2'));var client=require(_0xadbf('0x3'));exports[_0xadbf('0x4')]=function(_0x33984a){var _0x498f94=_0x33984a[_0xadbf('0x5')]||_0x33984a['queuecallerexitAt'];return client[_0xadbf('0x6')]('CreateMemberReport',{'body':{'channel':_0xadbf('0x7'),'membername':_0x33984a[_0xadbf('0x8')],'interface':_[_0xadbf('0x9')](_0x33984a['interface'])?util[_0xadbf('0xa')](_0xadbf('0xb'),_0x33984a[_0xadbf('0x8')]):_0x33984a['interface'],'type':_0xadbf('0xc'),'enterAt':_0x33984a['queuecallerleaveAt'],'exitAt':_0x498f94,'duration':moment(_0x498f94)[_0xadbf('0xd')](_0x33984a[_0xadbf('0xe')],_0xadbf('0xf')),'data1':_0xadbf('0x10'),'data2':_0x33984a[_0xadbf('0x11')],'data3':_0x33984a['exten'],'data4':null,'data5':_0x33984a[_0xadbf('0x12')],'role':_0xadbf('0x13'),'internal':_0x33984a[_0xadbf('0x14')]?_[_0xadbf('0x15')](_0x33984a[_0xadbf('0x14')]):undefined,'uniqueid':_0x33984a[_0xadbf('0x16')]},'log':'CreateMemberReport'});};exports[_0xadbf('0x17')]=function(_0x417a2d){return client[_0xadbf('0x6')](_0xadbf('0x18'),{'body':{'channel':_0xadbf('0x7'),'membername':_0x417a2d[_0xadbf('0x19')],'interface':_0x417a2d[_0xadbf('0x1a')],'type':_0xadbf('0xc'),'enterAt':_0x417a2d[_0xadbf('0x1b')],'exitAt':_0x417a2d[_0xadbf('0x1c')],'duration':moment(_0x417a2d['endtime'])[_0xadbf('0xd')](_0x417a2d[_0xadbf('0x1b')],_0xadbf('0xf'))>=0x0?moment(_0x417a2d['endtime'])[_0xadbf('0xd')](_0x417a2d[_0xadbf('0x1b')],_0xadbf('0xf')):null,'data1':_0xadbf('0x1d'),'data2':_0x417a2d['accountcode'],'data3':_0x417a2d[_0xadbf('0x1e')],'data4':_0x417a2d[_0xadbf('0x1f')]||null,'role':_0xadbf('0x13'),'internal':_0x417a2d['accountcode']?_[_0xadbf('0x15')](_0x417a2d[_0xadbf('0x14')]):undefined,'uniqueid':_0x417a2d[_0xadbf('0x16')]},'log':_0xadbf('0x18')});};
\ No newline at end of file
+var _0x4280=['exten','dialstring','toNumber','../client','queuecallerexitAt','voice','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','seconds','calleridnum','queue','agent','accountcode','uniqueid','CreateMemberReport','voiceDialReport','Request','membername','TALKING','starttime','endtime','diff','outbound'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4280,0x1e9));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var _=require('lodash');var util=require('util');var client=require(_0x0428('0x0'));exports['voiceQueueReport']=function(_0x1b6c97){var _0x2fbcf3=_0x1b6c97['queuecallercompleteAt']||_0x1b6c97[_0x0428('0x1')];return client['Request']('CreateMemberReport',{'body':{'channel':_0x0428('0x2'),'membername':_0x1b6c97[_0x0428('0x3')],'interface':_[_0x0428('0x4')](_0x1b6c97[_0x0428('0x5')])?util[_0x0428('0x6')](_0x0428('0x7'),_0x1b6c97[_0x0428('0x3')]):_0x1b6c97[_0x0428('0x5')],'type':'TALKING','enterAt':_0x1b6c97[_0x0428('0x8')],'exitAt':_0x2fbcf3,'duration':moment(_0x2fbcf3)['diff'](_0x1b6c97[_0x0428('0x8')],_0x0428('0x9')),'data1':'inbound','data2':_0x1b6c97[_0x0428('0xa')],'data3':_0x1b6c97['exten'],'data4':null,'data5':_0x1b6c97[_0x0428('0xb')],'role':_0x0428('0xc'),'internal':_0x1b6c97['accountcode']?_['toNumber'](_0x1b6c97[_0x0428('0xd')]):undefined,'uniqueid':_0x1b6c97[_0x0428('0xe')]},'log':_0x0428('0xf')});};exports[_0x0428('0x10')]=function(_0x319191){return client[_0x0428('0x11')]('CreateMemberReport',{'body':{'channel':_0x0428('0x2'),'membername':_0x319191[_0x0428('0x12')],'interface':_0x319191[_0x0428('0x5')],'type':_0x0428('0x13'),'enterAt':_0x319191[_0x0428('0x14')],'exitAt':_0x319191[_0x0428('0x15')],'duration':moment(_0x319191[_0x0428('0x15')])[_0x0428('0x16')](_0x319191[_0x0428('0x14')],_0x0428('0x9'))>=0x0?moment(_0x319191[_0x0428('0x15')])['diff'](_0x319191[_0x0428('0x14')],_0x0428('0x9')):null,'data1':_0x0428('0x17'),'data2':_0x319191[_0x0428('0xd')],'data3':_0x319191[_0x0428('0x18')],'data4':_0x319191[_0x0428('0x19')]||null,'role':_0x0428('0xc'),'internal':_0x319191[_0x0428('0xd')]?_[_0x0428('0x1a')](_0x319191[_0x0428('0xd')]):undefined,'uniqueid':_0x319191[_0x0428('0xe')]},'log':_0x0428('0xf')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb51=['previewRecallmeReminderInterval','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xdb51,0x145));var _0x1db5=function(_0x2644c2,_0x815a12){_0x2644c2=_0x2644c2-0x0;var _0x56b106=_0xdb51[_0x2644c2];return _0x56b106;};'use strict';var client=require(_0x1db5('0x0'));exports[_0x1db5('0x1')]=function(){return client[_0x1db5('0x2')](_0x1db5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1db5('0x4'),_0x1db5('0x5')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0xbdd4=['GetSettings','Request','ShowSetting'];(function(_0x2bcc28,_0x20d35b){var _0x21846b=function(_0x4065a6){while(--_0x4065a6){_0x2bcc28['push'](_0x2bcc28['shift']());}};_0x21846b(++_0x20d35b);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xbdd4[_0x34021d];return _0x16597b;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x4bdd('0x0')](_0x4bdd('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0x4bdd('0x2')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbf4=['Request','GetTemplate','name','html','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcbf4,0x7c));var _0x4cbf=function(_0x94f522,_0x3ad701){_0x94f522=_0x94f522-0x0;var _0x433a8c=_0xcbf4[_0x94f522];return _0x433a8c;};'use strict';var client=require(_0x4cbf('0x0'));exports['getTemplates']=function(_0x437d5b){return function(_0x3233e8){return client[_0x4cbf('0x1')](_0x4cbf('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4cbf('0x3'),_0x4cbf('0x4')]},'log':_0x4cbf('0x2')});};};
\ No newline at end of file
+var _0xb694=['../client','getTemplates','GetTemplate','name','html'];(function(_0x1a07b5,_0x30896e){var _0x1a0352=function(_0x3f6ee8){while(--_0x3f6ee8){_0x1a07b5['push'](_0x1a07b5['shift']());}};_0x1a0352(++_0x30896e);}(_0xb694,0x1ef));var _0x4b69=function(_0x1f3102,_0x30378c){_0x1f3102=_0x1f3102-0x0;var _0x5dc8c3=_0xb694[_0x1f3102];return _0x5dc8c3;};'use strict';var client=require(_0x4b69('0x0'));exports[_0x4b69('0x1')]=function(_0x113fb9){return function(_0x5c0fcd){return client['Request'](_0x4b69('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4b69('0x3'),_0x4b69('0x4')]},'log':'GetTemplate'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb2f=['channel','status','AllConditions','operator','value','Condition','Action','Actions','action','data1','data2','data3','data4','../client','getTriggers','Request','GetTrigger','name'];(function(_0x10e783,_0x18962f){var _0x396160=function(_0x3a3bb7){while(--_0x3a3bb7){_0x10e783['push'](_0x10e783['shift']());}};_0x396160(++_0x18962f);}(_0xbb2f,0x1ab));var _0xfbb2=function(_0x246d1b,_0x1890d3){_0x246d1b=_0x246d1b-0x0;var _0x2ec124=_0xbb2f[_0x246d1b];return _0x2ec124;};'use strict';var client=require(_0xfbb2('0x0'));exports[_0xfbb2('0x1')]=function(_0x233bb8){return function(_0x2b533){return client[_0xfbb2('0x2')](_0xfbb2('0x3'),{'options':{'raw':![],'attributes':['id',_0xfbb2('0x4'),_0xfbb2('0x5'),_0xfbb2('0x6')],'include':[{'model':'Condition','as':_0xfbb2('0x7'),'attributes':['id','field',_0xfbb2('0x8'),_0xfbb2('0x9')]},{'model':_0xfbb2('0xa'),'as':'AnyConditions','attributes':['id','field','operator',_0xfbb2('0x9')]},{'model':_0xfbb2('0xb'),'as':_0xfbb2('0xc'),'attributes':['id',_0xfbb2('0xd'),_0xfbb2('0xe'),_0xfbb2('0xf'),_0xfbb2('0x10'),_0xfbb2('0x11'),'data5','data6','data7']}]},'log':_0xfbb2('0x3')});};};
\ No newline at end of file
+var _0x4712=['data6','GetTrigger','../client','getTriggers','Request','name','status','Condition','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data3','data4'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4712,0x11f));var _0x2471=function(_0x59c6be,_0x5cc002){_0x59c6be=_0x59c6be-0x0;var _0xedd6f8=_0x4712[_0x59c6be];return _0xedd6f8;};'use strict';var client=require(_0x2471('0x0'));exports[_0x2471('0x1')]=function(_0x35c342){return function(_0x2e0bca){return client[_0x2471('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x2471('0x3'),'channel',_0x2471('0x4')],'include':[{'model':_0x2471('0x5'),'as':'AllConditions','attributes':['id','field',_0x2471('0x6'),_0x2471('0x7')]},{'model':_0x2471('0x5'),'as':_0x2471('0x8'),'attributes':['id',_0x2471('0x9'),_0x2471('0x6'),_0x2471('0x7')]},{'model':_0x2471('0xa'),'as':_0x2471('0xb'),'attributes':['id',_0x2471('0xc'),_0x2471('0xd'),_0x2471('0xe'),_0x2471('0xf'),_0x2471('0x10'),'data5',_0x2471('0x11'),'data7']}]},'log':_0x2471('0x12')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x966a=['../client','GetTrunk','name','defaultuser'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x966a,0x138));var _0xa966=function(_0x1d5dbb,_0x32266c){_0x1d5dbb=_0x1d5dbb-0x0;var _0x4b67d2=_0x966a[_0x1d5dbb];return _0x4b67d2;};'use strict';var client=require(_0xa966('0x0'));exports['getTrunks']=function(_0x2adae6){return function(_0x54e4aa){return client['Request'](_0xa966('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa966('0x2'),'registry',_0xa966('0x3')]},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0x9f3c=['getTrunks','Request','GetTrunk','registry','defaultuser','../client'];(function(_0x17de8f,_0x2d5177){var _0xc19ec4=function(_0x3424c0){while(--_0x3424c0){_0x17de8f['push'](_0x17de8f['shift']());}};_0xc19ec4(++_0x2d5177);}(_0x9f3c,0x12b));var _0xc9f3=function(_0x516772,_0x1e1c11){_0x516772=_0x516772-0x0;var _0x37f968=_0x9f3c[_0x516772];return _0x37f968;};'use strict';var client=require(_0xc9f3('0x0'));exports[_0xc9f3('0x1')]=function(_0x1a88be){return function(_0x496a87){return client[_0xc9f3('0x2')](_0xc9f3('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xc9f3('0x4'),_0xc9f3('0x5')]},'log':_0xc9f3('0x3')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x5313ee,_0x438689){var _0x4bca09=function(_0x1b4ccd){while(--_0x1b4ccd){_0x5313ee['push'](_0x5313ee['shift']());}};_0x4bca09(++_0x438689);}(_0xedd9,0xfc));var _0x9edd=function(_0xed3faa,_0xa30be2){_0xed3faa=_0xed3faa-0x0;var _0x37cc96=_0xedd9[_0xed3faa];return _0x37cc96;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe565=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x1d03f,_0x5a79f8){var _0x3e2076=function(_0x442e24){while(--_0x442e24){_0x1d03f['push'](_0x1d03f['shift']());}};_0x3e2076(++_0x5a79f8);}(_0xe565,0x134));var _0x5e56=function(_0x4215aa,_0x42d7a4){_0x4215aa=_0x4215aa-0x0;var _0x26faa5=_0xe565[_0x4215aa];return _0x26faa5;};'use strict';var client=require(_0x5e56('0x0'));exports[_0x5e56('0x1')]=function(_0x2912b2){return client[_0x5e56('0x2')](_0x5e56('0x3'),{'body':_0x2912b2,'log':_0x5e56('0x3')});};exports[_0x5e56('0x4')]=function(_0x3fdec6,_0x2e0f74,_0xbefc85){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3fdec6,'options':{'where':{'uniqueid':_0x2e0f74,'interface':_0xbefc85,'agentcomplete':!![]}},'log':_0x5e56('0x5')});};
\ No newline at end of file
+var _0x3417=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x1c8943,_0x147e6c){var _0x14df3e=function(_0x106905){while(--_0x106905){_0x1c8943['push'](_0x1c8943['shift']());}};_0x14df3e(++_0x147e6c);}(_0x3417,0xe1));var _0x7341=function(_0x27cb55,_0x4ae2ba){_0x27cb55=_0x27cb55-0x0;var _0x3cc436=_0x3417[_0x27cb55];return _0x3cc436;};'use strict';var client=require(_0x7341('0x0'));exports['create']=function(_0x2b6d8f){return client[_0x7341('0x1')](_0x7341('0x2'),{'body':_0x2b6d8f,'log':_0x7341('0x2')});};exports[_0x7341('0x3')]=function(_0x1e769c,_0x11570f,_0x467eaf){return client[_0x7341('0x1')](_0x7341('0x4'),{'body':_0x1e769c,'options':{'where':{'uniqueid':_0x11570f,'interface':_0x467eaf,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9930=['endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','Request','GetVoiceCallReport','outbound','startOf','day','format'];(function(_0x3b6a68,_0x16a779){var _0x1e6615=function(_0x2bafe4){while(--_0x2bafe4){_0x3b6a68['push'](_0x3b6a68['shift']());}};_0x1e6615(++_0x16a779);}(_0x9930,0xf9));var _0x0993=function(_0x2b2dd1,_0x2c6ac7){_0x2b2dd1=_0x2b2dd1-0x0;var _0x5d2ef5=_0x9930[_0x2b2dd1];return _0x5d2ef5;};'use strict';var moment=require(_0x0993('0x0'));var util=require('util');var _=require(_0x0993('0x1'));var client=require(_0x0993('0x2'));exports[_0x0993('0x3')]=function(_0x54f70a){return client['Request'](_0x0993('0x4'),{'body':_[_0x0993('0x5')](_0x54f70a,{'source':_0x54f70a[_0x0993('0x6')],'destinationcontext':_0x54f70a['context'],'callerid':_0x54f70a[_0x0993('0x7')],'amaflags':_0x0993('0x8')}),'log':_0x0993('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x0993('0x9')](_0x0993('0xa'),{'options':{'where':{'type':[_0x0993('0xb')],'createdAt':{'$between':[moment()[_0x0993('0xc')](_0x0993('0xd'))[_0x0993('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x0993('0xf')]('day')[_0x0993('0xe')](_0x0993('0x10'))]}},'attributes':[_0x0993('0x11'),_0x0993('0x12'),_0x0993('0x13'),_0x0993('0x14')]},'log':_0x0993('0x15')});};};
\ No newline at end of file
+var _0x06bc=['moment','util','../client','Request','CreateVoiceCallReport','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','duration','billableseconds','GetVoiceCallReports'];(function(_0x2ef05c,_0x389fa5){var _0x2861f9=function(_0x454a2d){while(--_0x454a2d){_0x2ef05c['push'](_0x2ef05c['shift']());}};_0x2861f9(++_0x389fa5);}(_0x06bc,0x1b0));var _0xc06b=function(_0x421104,_0x3d7814){_0x421104=_0x421104-0x0;var _0x2e7b46=_0x06bc[_0x421104];return _0x2e7b46;};'use strict';var moment=require(_0xc06b('0x0'));var util=require(_0xc06b('0x1'));var _=require('lodash');var client=require(_0xc06b('0x2'));exports['create']=function(_0x361c07){return client[_0xc06b('0x3')](_0xc06b('0x4'),{'body':_['merge'](_0x361c07,{'source':_0x361c07[_0xc06b('0x5')],'destinationcontext':_0x361c07[_0xc06b('0x6')],'callerid':_0x361c07[_0xc06b('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0xc06b('0x4')});};exports[_0xc06b('0x8')]=function(){return function(){return client[_0xc06b('0x3')](_0xc06b('0x9'),{'options':{'where':{'type':[_0xc06b('0xa')],'createdAt':{'$between':[moment()[_0xc06b('0xb')](_0xc06b('0xc'))[_0xc06b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc06b('0xe')]('day')[_0xc06b('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xc06b('0xf'),_0xc06b('0x10')]},'log':_0xc06b('0x11')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe716=['CreateVoiceDialReport','../client','create','Request'];(function(_0x43b383,_0xa1896f){var _0x305169=function(_0x273869){while(--_0x273869){_0x43b383['push'](_0x43b383['shift']());}};_0x305169(++_0xa1896f);}(_0xe716,0x181));var _0x6e71=function(_0x4b8be7,_0x3724c5){_0x4b8be7=_0x4b8be7-0x0;var _0x352685=_0xe716[_0x4b8be7];return _0x352685;};'use strict';var client=require(_0x6e71('0x0'));exports[_0x6e71('0x1')]=function(_0x234957){return client[_0x6e71('0x2')](_0x6e71('0x3'),{'body':_0x234957,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0x6c54=['../client','create','Request','CreateVoiceDialReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6c54,0x120));var _0x46c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6c54[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x46c5('0x0'));exports[_0x46c5('0x1')]=function(_0x3cb8ce){return client[_0x46c5('0x2')](_0x46c5('0x3'),{'body':_0x3cb8ce,'log':_0x46c5('0x3')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf257=['exten','recordingFormat','Request','GetVoiceExtension'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xf257,0x82));var _0x7f25=function(_0x225813,_0x298959){_0x225813=_0x225813-0x0;var _0x5d3e36=_0xf257[_0x225813];return _0x5d3e36;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x7f25('0x0')](_0x7f25('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7f25('0x2'),_0x7f25('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0x4ded=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3b398b,_0x5dca52){var _0x1e6bb2=function(_0x2648ff){while(--_0x2648ff){_0x3b398b['push'](_0x3b398b['shift']());}};_0x1e6bb2(++_0x5dca52);}(_0x4ded,0x116));var _0xd4de=function(_0x3f327d,_0x6714e1){_0x3f327d=_0x3f327d-0x0;var _0xf7c877=_0x4ded[_0x3f327d];return _0xf7c877;};'use strict';var client=require(_0xd4de('0x0'));exports[_0xd4de('0x1')]=function(){return function(){return client[_0xd4de('0x2')](_0xd4de('0x3'),{'options':{'raw':!![],'attributes':['id',_0xd4de('0x4'),_0xd4de('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xd4de('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5707=['dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','Interval','Intervals','getVoiceQueues','Request','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5707,0xcb));var _0x7570=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0x5707[_0x212a37];return _0x5d0bf9;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x7570('0x0')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x7570('0x1'),_0x7570('0x2'),_0x7570('0x3'),'autopause',_0x7570('0x4'),'type',_0x7570('0x5'),_0x7570('0x6'),_0x7570('0x7'),_0x7570('0x8'),_0x7570('0x9'),_0x7570('0xa'),_0x7570('0xb'),_0x7570('0xc'),_0x7570('0xd'),_0x7570('0xe'),_0x7570('0xf'),'dialQueueOptions',_0x7570('0x10'),_0x7570('0x11'),_0x7570('0x12'),'dialCongestionRetryFrequency',_0x7570('0x13'),_0x7570('0x14'),_0x7570('0x15'),_0x7570('0x16'),_0x7570('0x17'),_0x7570('0x18'),'dialGlobalInterval',_0x7570('0x19'),'dialCheckDuplicateType',_0x7570('0x1a'),'dialAMDInitialSilence',_0x7570('0x1b'),_0x7570('0x1c'),_0x7570('0x1d'),_0x7570('0x1e'),'dialAMDBetweenWordsSilence',_0x7570('0x1f'),_0x7570('0x20'),_0x7570('0x21'),_0x7570('0x22'),'dialRecallMeTimeout',_0x7570('0x23'),_0x7570('0x24'),_0x7570('0x25'),_0x7570('0x26'),_0x7570('0x27'),_0x7570('0x4'),_0x7570('0x28'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x7570('0x29'),'dialNoSuchNumberRetryFrequency',_0x7570('0x2a'),_0x7570('0x2b'),_0x7570('0x2c'),_0x7570('0x2d'),_0x7570('0x2e'),_0x7570('0x2f'),_0x7570('0x30'),'dialAgentRejectRetryFrequency',_0x7570('0x31'),_0x7570('0x32'),'dialPredictiveIntervalMinThreshold',_0x7570('0x33'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x7570('0x34'),'attributes':['id',_0x7570('0x1'),_0x7570('0x35'),_0x7570('0x36')]},{'model':_0x7570('0x37'),'as':'mandatoryDispositionPause','attributes':['id',_0x7570('0x1')]},{'model':_0x7570('0x34'),'as':'TrunkBackup','attributes':['id',_0x7570('0x1'),_0x7570('0x35'),_0x7570('0x36')]},{'model':_0x7570('0x38'),'as':_0x7570('0x38'),'attributes':['id',_0x7570('0x1')],'include':[{'model':'Interval','as':_0x7570('0x39'),'attributes':['id','name','interval']}]}]},'log':_0x7570('0x3a')});};};
\ No newline at end of file
+var _0xefaa=['getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xefaa,0x186));var _0xaefa=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xefaa[_0x411add];return _0x238242;};'use strict';var client=require('../client');exports[_0xaefa('0x0')]=function(){return function(){return client[_0xaefa('0x1')](_0xaefa('0x2'),{'options':{'raw':![],'attributes':['id',_0xaefa('0x3'),_0xaefa('0x4'),_0xaefa('0x5'),_0xaefa('0x6'),_0xaefa('0x7'),_0xaefa('0x8'),_0xaefa('0x9'),_0xaefa('0xa'),_0xaefa('0xb'),_0xaefa('0xc'),_0xaefa('0xd'),_0xaefa('0xe'),_0xaefa('0xf'),_0xaefa('0x10'),_0xaefa('0x11'),_0xaefa('0x12'),_0xaefa('0x13'),_0xaefa('0x14'),_0xaefa('0x15'),_0xaefa('0x16'),_0xaefa('0x17'),_0xaefa('0x18'),_0xaefa('0x19'),_0xaefa('0x1a'),_0xaefa('0x1b'),'dialNoAnswerRetryFrequency',_0xaefa('0x1c'),_0xaefa('0x1d'),_0xaefa('0x1e'),'dialPrefix','dialCheckDuplicateType',_0xaefa('0x1f'),_0xaefa('0x20'),_0xaefa('0x21'),'dialAMDAfterGreetingSilence',_0xaefa('0x22'),'dialAMDMinWordLength',_0xaefa('0x23'),_0xaefa('0x24'),_0xaefa('0x25'),_0xaefa('0x26'),_0xaefa('0x27'),_0xaefa('0x28'),_0xaefa('0x29'),_0xaefa('0x2a'),_0xaefa('0x2b'),'dialAgiAfterHangupClient','dialQueueProject2',_0xaefa('0x7'),'strategy','dialRandomLastDigitCallerIdNumber',_0xaefa('0x2c'),_0xaefa('0x2d'),_0xaefa('0x2e'),_0xaefa('0x2f'),_0xaefa('0x30'),'dialAbandonedMaxRetry',_0xaefa('0x31'),'dialMachineMaxRetry',_0xaefa('0x32'),'dialAgentRejectMaxRetry',_0xaefa('0x33'),_0xaefa('0x34'),_0xaefa('0x35'),_0xaefa('0x36'),_0xaefa('0x37'),_0xaefa('0x38')],'include':[{'model':_0xaefa('0x39'),'as':_0xaefa('0x39'),'attributes':['id','name',_0xaefa('0x3a'),_0xaefa('0x3b')]},{'model':_0xaefa('0x3c'),'as':_0xaefa('0x3d'),'attributes':['id',_0xaefa('0x3')]},{'model':_0xaefa('0x39'),'as':_0xaefa('0x3e'),'attributes':['id',_0xaefa('0x3'),_0xaefa('0x3a'),_0xaefa('0x3b')]},{'model':'Interval','as':'Interval','attributes':['id',_0xaefa('0x3')],'include':[{'model':_0xaefa('0x3f'),'as':'Intervals','attributes':['id','name',_0xaefa('0x40')]}]}]},'log':_0xaefa('0x0')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x45a4cd,_0x433b9a){var _0x1b378f=function(_0x4cfcf9){while(--_0x4cfcf9){_0x45a4cd['push'](_0x45a4cd['shift']());}};_0x1b378f(++_0x433b9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5d5e0c,_0x9dab9b){var _0x5c0909=function(_0x133d6b){while(--_0x133d6b){_0x5d5e0c['push'](_0x5d5e0c['shift']());}};_0x5c0909(++_0x9dab9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d7d=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d7d,0xab));var _0xd7d7=function(_0x11663d,_0x8b534b){_0x11663d=_0x11663d-0x0;var _0x133bfa=_0x7d7d[_0x11663d];return _0x133bfa;};'use strict';var client=require(_0xd7d7('0x0'));exports[_0xd7d7('0x1')]=function(_0x2af9ba){return function(){return client['Request'](_0xd7d7('0x2'),{'options':{'where':{'VoiceQueueId':_0x2af9ba,'paused':!![]},'raw':!![]},'log':_0xd7d7('0x1')});};};
\ No newline at end of file
+var _0xc697=['../client','getVoiceQueueRtPauses'];(function(_0xd333a1,_0x1f61a0){var _0x553a60=function(_0x13761f){while(--_0x13761f){_0xd333a1['push'](_0xd333a1['shift']());}};_0x553a60(++_0x1f61a0);}(_0xc697,0x1ba));var _0x7c69=function(_0x3595bf,_0x5b0a83){_0x3595bf=_0x3595bf-0x0;var _0x19c9fc=_0xc697[_0x3595bf];return _0x19c9fc;};'use strict';var client=require(_0x7c69('0x0'));exports[_0x7c69('0x1')]=function(_0x5ad8d5){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5ad8d5,'paused':!![]},'raw':!![]},'log':_0x7c69('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x36c996,_0x57638c){var _0x38922e=function(_0x570d3a){while(--_0x570d3a){_0x36c996['push'](_0x36c996['shift']());}};_0x38922e(++_0x57638c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3a14af,_0x4b5225){var _0x6b8c71=function(_0x121b53){while(--_0x121b53){_0x3a14af['push'](_0x3a14af['shift']());}};_0x6b8c71(++_0x4b5225);}(_0x7a54,0x106));var _0x47a5=function(_0x520ad6,_0x46ff96){_0x520ad6=_0x520ad6-0x0;var _0x12ffe7=_0x7a54[_0x520ad6];return _0x12ffe7;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec49=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xec49,0x143));var _0x9ec4=function(_0x19b1a8,_0x5b4394){_0x19b1a8=_0x19b1a8-0x0;var _0x43c590=_0xec49[_0x19b1a8];return _0x43c590;};'use strict';var client=require('../client');exports[_0x9ec4('0x0')]={};exports[_0x9ec4('0x1')]=function(_0x30e2c3){return client[_0x9ec4('0x2')](_0x9ec4('0x3'),{'body':{'result':_0x30e2c3['result'],'transfererchannel':_0x30e2c3[_0x9ec4('0x4')],'transferercalleridnum':_0x30e2c3['transferercalleridnum'],'transferercalleridname':_0x30e2c3[_0x9ec4('0x5')],'transfererconnectedlinenum':_0x30e2c3[_0x9ec4('0x6')],'transfererconnectedlinename':_0x30e2c3[_0x9ec4('0x7')],'transfereraccountcode':_0x30e2c3[_0x9ec4('0x8')],'transferercontext':_0x30e2c3[_0x9ec4('0x9')],'transfererexten':_0x30e2c3[_0x9ec4('0xa')],'transfererlinkedid':_0x30e2c3[_0x9ec4('0xb')],'transfereechannel':_0x30e2c3[_0x9ec4('0xc')],'transfereecalleridnum':_0x30e2c3[_0x9ec4('0xd')],'transfereecalleridname':_0x30e2c3[_0x9ec4('0xe')],'transfereeconnectedlinenum':_0x30e2c3['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x30e2c3[_0x9ec4('0xf')],'transfereeaccountcode':_0x30e2c3[_0x9ec4('0x10')],'transfereecontext':_0x30e2c3[_0x9ec4('0x11')],'transfereeexten':_0x30e2c3[_0x9ec4('0x12')],'transfereelinkedid':_0x30e2c3[_0x9ec4('0x13')],'isexternal':_0x30e2c3['isexternal'],'context':_0x30e2c3[_0x9ec4('0x14')],'extension':_0x30e2c3[_0x9ec4('0x15')],'type':_0x9ec4('0x16')},'log':_0x9ec4('0x3')});};exports['attendedTransfer']=function(_0x143501){return client[_0x9ec4('0x2')](_0x9ec4('0x3'),{'body':{'result':_0x143501['result'],'transfererchannel':_0x143501[_0x9ec4('0x17')],'transferercalleridnum':_0x143501[_0x9ec4('0x18')],'transferercalleridname':_0x143501[_0x9ec4('0x19')],'transfererconnectedlinenum':_0x143501[_0x9ec4('0x1a')],'transfererconnectedlinename':_0x143501['secondtransfererconnectedlinename'],'transfereraccountcode':_0x143501[_0x9ec4('0x1b')],'transferercontext':_0x143501[_0x9ec4('0x1c')],'transfererexten':_0x143501['secondtransfererexten'],'transfererlinkedid':_0x143501[_0x9ec4('0x1d')],'transfereechannel':_0x143501[_0x9ec4('0x1e')],'transfereecalleridnum':_0x143501['transfertargetcalleridnum'],'transfereecalleridname':_0x143501[_0x9ec4('0x1f')],'transfereeconnectedlinenum':_0x143501['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x143501['transfertargetconnectedlinename'],'transfereeaccountcode':_0x143501['transfertargetaccountcode'],'transfereecontext':_0x143501[_0x9ec4('0x20')],'transfereeexten':_0x143501[_0x9ec4('0x21')],'transfereelinkedid':_0x143501['transfertargetlinkedid'],'isexternal':_0x143501[_0x9ec4('0x22')],'context':_0x143501[_0x9ec4('0x23')],'extension':_0x143501[_0x9ec4('0x24')],'type':'attended'},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0x8daa=['transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetcontext'];(function(_0x2e5db9,_0x253a85){var _0xa45b72=function(_0x387c06){while(--_0x387c06){_0x2e5db9['push'](_0x2e5db9['shift']());}};_0xa45b72(++_0x253a85);}(_0x8daa,0x195));var _0xa8da=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x8daa[_0x35b18a];return _0x4db1bd;};'use strict';var client=require(_0xa8da('0x0'));exports[_0xa8da('0x1')]={};exports[_0xa8da('0x2')]=function(_0x5d354e){return client[_0xa8da('0x3')](_0xa8da('0x4'),{'body':{'result':_0x5d354e[_0xa8da('0x5')],'transfererchannel':_0x5d354e['transfererchannel'],'transferercalleridnum':_0x5d354e[_0xa8da('0x6')],'transferercalleridname':_0x5d354e[_0xa8da('0x7')],'transfererconnectedlinenum':_0x5d354e[_0xa8da('0x8')],'transfererconnectedlinename':_0x5d354e[_0xa8da('0x9')],'transfereraccountcode':_0x5d354e['transfereraccountcode'],'transferercontext':_0x5d354e['transferercontext'],'transfererexten':_0x5d354e['transfererexten'],'transfererlinkedid':_0x5d354e[_0xa8da('0xa')],'transfereechannel':_0x5d354e['transfereechannel'],'transfereecalleridnum':_0x5d354e[_0xa8da('0xb')],'transfereecalleridname':_0x5d354e[_0xa8da('0xc')],'transfereeconnectedlinenum':_0x5d354e[_0xa8da('0xd')],'transfereeconnectedlinename':_0x5d354e[_0xa8da('0xe')],'transfereeaccountcode':_0x5d354e[_0xa8da('0xf')],'transfereecontext':_0x5d354e[_0xa8da('0x10')],'transfereeexten':_0x5d354e[_0xa8da('0x11')],'transfereelinkedid':_0x5d354e[_0xa8da('0x12')],'isexternal':_0x5d354e[_0xa8da('0x13')],'context':_0x5d354e[_0xa8da('0x14')],'extension':_0x5d354e[_0xa8da('0x15')],'type':_0xa8da('0x16')},'log':_0xa8da('0x4')});};exports[_0xa8da('0x17')]=function(_0x237026){return client[_0xa8da('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x237026[_0xa8da('0x5')],'transfererchannel':_0x237026[_0xa8da('0x18')],'transferercalleridnum':_0x237026[_0xa8da('0x19')],'transferercalleridname':_0x237026['origtransferercalleridname'],'transfererconnectedlinenum':_0x237026['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x237026[_0xa8da('0x1a')],'transfereraccountcode':_0x237026[_0xa8da('0x1b')],'transferercontext':_0x237026[_0xa8da('0x1c')],'transfererexten':_0x237026[_0xa8da('0x1d')],'transfererlinkedid':_0x237026[_0xa8da('0x1e')],'transfereechannel':_0x237026[_0xa8da('0x1f')],'transfereecalleridnum':_0x237026[_0xa8da('0x20')],'transfereecalleridname':_0x237026['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x237026['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x237026[_0xa8da('0x21')],'transfereeaccountcode':_0x237026['transfertargetaccountcode'],'transfereecontext':_0x237026[_0xa8da('0x22')],'transfereeexten':_0x237026[_0xa8da('0x23')],'transfereelinkedid':_0x237026[_0xa8da('0x24')],'isexternal':_0x237026[_0xa8da('0x13')],'context':_0x237026[_0xa8da('0x25')],'extension':_0x237026[_0xa8da('0x26')],'type':_0xa8da('0x27')},'log':_0xa8da('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x920b34,_0x160f7d){var _0x2ab2a3=function(_0x3fd3d0){while(--_0x3fd3d0){_0x920b34['push'](_0x920b34['shift']());}};_0x2ab2a3(++_0x160f7d);}(_0x7a54,0x106));var _0x47a5=function(_0x177bd2,_0x5374ce){_0x177bd2=_0x177bd2-0x0;var _0x1cb37b=_0x7a54[_0x177bd2];return _0x1cb37b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});};
\ No newline at end of file
+var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x3833fa,_0xcdb71e){var _0x40c1cb=function(_0x401e11){while(--_0x401e11){_0x3833fa['push'](_0x3833fa['shift']());}};_0x40c1cb(++_0xcdb71e);}(_0x7a54,0x106));var _0x47a5=function(_0x3c78f9,_0x3e1727){_0x3c78f9=_0x3c78f9-0x0;var _0x146c25=_0x7a54[_0x3c78f9];return _0x146c25;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa840=['emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','destcalleridnum','calleridname','Unknown','destcalleridname','<unknown>','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','merge','bluebird','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify'];(function(_0x276357,_0x4a4691){var _0x4395b2=function(_0x1c5dc9){while(--_0x1c5dc9){_0x276357['push'](_0x276357['shift']());}};_0x4395b2(++_0x4a4691);}(_0xa840,0x17f));var _0x0a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa840[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var BPromise=require(_0x0a84('0x0'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x0a84('0x1'))('trigger');var cmContactRpc=require(_0x0a84('0x2'));config[_0x0a84('0x3')]=_[_0x0a84('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a84('0x5'))(new Redis(config[_0x0a84('0x3')]));function emit(_0x1eb43a,_0x3a97b9,_0x432780,_0x2fc0df,_0x276615){logger[_0x0a84('0x6')](_0x0a84('0x7'),_0x1eb43a,_0x3a97b9['id'],_0x432780,_0x2fc0df,JSON[_0x0a84('0x8')](_0x276615));io['to'](_0x432780)[_0x0a84('0x9')](_0x2fc0df,_0x276615);}exports[_0x0a84('0xa')]=function(_0x227e77,_0x1bd973,_0x29f493,_0x44e9a2){var _0xe49b6a,_0x5f1d31;var _0x287dcb={};var _0x57a045;var _0x2b84fb=Number(_0x29f493[_0x0a84('0xb')]);var _0x506cbc=_0x29f493[_0x0a84('0xc')]?Boolean(Number(_0x29f493[_0x0a84('0xc')])):![];var _0x1287ae;var _0x3e5777=![];if(!_['isNil'](_0x29f493[_0x0a84('0xd')])){if(_0x29f493[_0x0a84('0xd')]=='1')_0x3e5777=!![];}if(!_0x3e5777){if(_0x44e9a2[_0x0a84('0xe')]){_0x287dcb['id']=_0x44e9a2[_0x0a84('0xe')];}}if(!_0x287dcb['id']){_0x287dcb[_0x0a84('0xf')]=_0x2b84fb;_0x1287ae=_0x29f493[_0x0a84('0x10')]&&_0x29f493['data3']!=='0'?_0x29f493['data3'][_0x0a84('0x11')](','):[_0x0a84('0x12')];_0x287dcb[_0x0a84('0x13')]=_[_0x0a84('0x14')](_0x1287ae,function(_0x5b5c23){var _0x3b8aad={};_0x3b8aad[_0x5b5c23]=_0x44e9a2[_0x0a84('0x15')]?_0x44e9a2['destcalleridnum']:_0x44e9a2[_0x0a84('0x16')];return _0x3b8aad;});_0x57a045=_0x44e9a2[_0x0a84('0x15')]?_0x44e9a2['destcalleridnum']:_0x44e9a2['calleridnum'];}var _0x4d32a6=['id',_0x0a84('0x17'),_0x0a84('0x18'),'phone',_0x0a84('0x19'),_0x0a84('0x1a'),_0x0a84('0xf'),_0x0a84('0x1b'),'scheduledAt',_0x0a84('0x1c')];var _0x553f3a=_[_0x0a84('0x1d')](_0x4d32a6,_0x1287ae);BPromise[_0x0a84('0x1e')]()[_0x0a84('0x1f')](cmContactRpc[_0x0a84('0x20')]({'attributes':_0x553f3a,'where':_0x287dcb,'phone':_0x57a045}))[_0x0a84('0x1f')](function(_0x2439e3){_0x5f1d31=_0x2439e3;if(!_[_0x0a84('0x21')](_0x5f1d31)){if(_0x5f1d31[_0x0a84('0x22')]===0x1){_0xe49b6a=_0x5f1d31[0x0];logger[_0x0a84('0x6')](_0x0a84('0x23'),_0x44e9a2['uniqueid'],_0x1bd973['id'],_0xe49b6a['id']);}else{logger[_0x0a84('0x6')](_0x0a84('0x24'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id'],_[_0x0a84('0x14')](_0x5f1d31,'id')[_0x0a84('0x26')](','));}return;}else{logger['info'](_0x0a84('0x27'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id']);var _0x3eb642={'ListId':_0x2b84fb};var _0x215974=_0x29f493[_0x0a84('0x28')]&&_0x29f493[_0x0a84('0x28')]!=='0'?_0x29f493[_0x0a84('0x28')]:_0x0a84('0x12');if(_0x506cbc){logger[_0x0a84('0x6')](_0x0a84('0x29'),_0x44e9a2['uniqueid'],_0x1bd973['id']);_0x3eb642[_0x215974]=_[_0x0a84('0x2a')](_0x44e9a2[_0x0a84('0x15')])?_0x44e9a2[_0x0a84('0x16')]:_0x44e9a2[_0x0a84('0x2b')];if(_['isNil'](_0x44e9a2[_0x0a84('0x15')])){_0x3eb642['firstName']=_0x44e9a2[_0x0a84('0x2c')]&&_0x44e9a2[_0x0a84('0x2c')]!=='<unknown>'?_0x44e9a2['calleridname']:_0x0a84('0x2d');}else{_0x3eb642[_0x0a84('0x17')]=_0x44e9a2[_0x0a84('0x2e')]&&_0x44e9a2[_0x0a84('0x2e')]!==_0x0a84('0x2f')?_0x44e9a2[_0x0a84('0x2e')]:_0x0a84('0x2d');}return BPromise[_0x0a84('0x1e')]()[_0x0a84('0x1f')](cmContactRpc[_0x0a84('0x30')](_0x3eb642))[_0x0a84('0x1f')](function(_0x905a48){_0xe49b6a=_0x905a48;_0x5f1d31[_0x0a84('0x31')](_0x905a48);if(_0xe49b6a){logger[_0x0a84('0x6')](_0x0a84('0x32'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id'],_0xe49b6a['id']);}return;});}else{logger[_0x0a84('0x6')](_0x0a84('0x33'),_0x44e9a2[_0x0a84('0x25')],_0x1bd973['id']);_0x3eb642[_0x215974]=_[_0x0a84('0x2a')](_0x44e9a2[_0x0a84('0x15')])?_0x44e9a2[_0x0a84('0x16')]:_0x44e9a2[_0x0a84('0x2b')];if(_[_0x0a84('0x2a')](_0x44e9a2[_0x0a84('0x15')])){_0x3eb642[_0x0a84('0x17')]=_0x44e9a2['calleridname']&&_0x44e9a2[_0x0a84('0x2c')]!=='<unknown>'?_0x44e9a2[_0x0a84('0x2c')]:_0x0a84('0x2d');}else{_0x3eb642[_0x0a84('0x17')]=_0x44e9a2[_0x0a84('0x2e')]&&_0x44e9a2['destcalleridname']!==_0x0a84('0x2f')?_0x44e9a2['destcalleridname']:'Unknown';}_0xe49b6a=_0x3eb642;_0x5f1d31['push'](_0x3eb642);return;}}})[_0x0a84('0x1f')](function(){if(_0x227e77){emit(_0x44e9a2['uniqueid'],_0x1bd973,util[_0x0a84('0x34')]('user:%s',_0x227e77[_0x0a84('0x35')]),util[_0x0a84('0x34')](_0x0a84('0x36'),_0x29f493['action']['toLowerCase']()),{'evt':_[_0x0a84('0x37')](_0x44e9a2,{'autoCreate':_0x506cbc}),'contact':_0xe49b6a===undefined?{}:_0xe49b6a,'contacts':_0x5f1d31[_0x0a84('0x22')]===0x0?undefined:_0x5f1d31});}});};
\ No newline at end of file
+var _0xca2f=['action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','split','phone','destcalleridnum','calleridnum','firstName','lastName','fax','scheduledAt','union','resolve','then','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','<unknown>','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s'];(function(_0x49fcfa,_0x40edd7){var _0x17f863=function(_0x2e78f1){while(--_0x2e78f1){_0x49fcfa['push'](_0x49fcfa['shift']());}};_0x17f863(++_0x40edd7);}(_0xca2f,0x1f2));var _0xfca2=function(_0x4744cc,_0x3d1c2f){_0x4744cc=_0x4744cc-0x0;var _0x291f70=_0xca2f[_0x4744cc];return _0x291f70;};'use strict';var _=require(_0xfca2('0x0'));var BPromise=require(_0xfca2('0x1'));var Redis=require(_0xfca2('0x2'));var util=require(_0xfca2('0x3'));var config=require(_0xfca2('0x4'));var logger=require(_0xfca2('0x5'))(_0xfca2('0x6'));var cmContactRpc=require(_0xfca2('0x7'));config[_0xfca2('0x8')]=_[_0xfca2('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfca2('0xa'))(new Redis(config[_0xfca2('0x8')]));function emit(_0x1ab6b3,_0x53e9d2,_0x2f49dd,_0x5ab01a,_0x5b2fea){logger[_0xfca2('0xb')](_0xfca2('0xc'),_0x1ab6b3,_0x53e9d2['id'],_0x2f49dd,_0x5ab01a,JSON[_0xfca2('0xd')](_0x5b2fea));io['to'](_0x2f49dd)['emit'](_0x5ab01a,_0x5b2fea);}exports[_0xfca2('0xe')]=function(_0x2a8c80,_0x3921e4,_0x4ae48e,_0x57df70){var _0x299521,_0x32e8fb;var _0x5553bd={};var _0x2583f9;var _0x310e2e=Number(_0x4ae48e[_0xfca2('0xf')]);var _0x3704ac=_0x4ae48e[_0xfca2('0x10')]?Boolean(Number(_0x4ae48e[_0xfca2('0x10')])):![];var _0x2fbd60;var _0x14405e=![];if(!_[_0xfca2('0x11')](_0x4ae48e[_0xfca2('0x12')])){if(_0x4ae48e[_0xfca2('0x12')]=='1')_0x14405e=!![];}if(!_0x14405e){if(_0x57df70['xmd-contactid']){_0x5553bd['id']=_0x57df70['xmd-contactid'];}}if(!_0x5553bd['id']){_0x5553bd[_0xfca2('0x13')]=_0x310e2e;_0x2fbd60=_0x4ae48e[_0xfca2('0x14')]&&_0x4ae48e[_0xfca2('0x14')]!=='0'?_0x4ae48e['data3'][_0xfca2('0x15')](','):[_0xfca2('0x16')];_0x5553bd['$or']=_['map'](_0x2fbd60,function(_0x42f4aa){var _0x22e1fa={};_0x22e1fa[_0x42f4aa]=_0x57df70['routeId']?_0x57df70[_0xfca2('0x17')]:_0x57df70['calleridnum'];return _0x22e1fa;});_0x2583f9=_0x57df70['routeId']?_0x57df70[_0xfca2('0x17')]:_0x57df70[_0xfca2('0x18')];}var _0x163edb=['id',_0xfca2('0x19'),_0xfca2('0x1a'),_0xfca2('0x16'),'mobile',_0xfca2('0x1b'),_0xfca2('0x13'),'createdAt',_0xfca2('0x1c'),'updatedAt'];var _0x58aa16=_[_0xfca2('0x1d')](_0x163edb,_0x2fbd60);BPromise[_0xfca2('0x1e')]()[_0xfca2('0x1f')](cmContactRpc['getContacts']({'attributes':_0x58aa16,'where':_0x5553bd,'phone':_0x2583f9}))[_0xfca2('0x1f')](function(_0x3bcc9f){_0x32e8fb=_0x3bcc9f;if(!_['isEmpty'](_0x32e8fb)){if(_0x32e8fb[_0xfca2('0x20')]===0x1){_0x299521=_0x32e8fb[0x0];logger[_0xfca2('0xb')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x57df70[_0xfca2('0x21')],_0x3921e4['id'],_0x299521['id']);}else{logger[_0xfca2('0xb')](_0xfca2('0x22'),_0x57df70[_0xfca2('0x21')],_0x3921e4['id'],_[_0xfca2('0x23')](_0x32e8fb,'id')[_0xfca2('0x24')](','));}return;}else{logger['info'](_0xfca2('0x25'),_0x57df70[_0xfca2('0x21')],_0x3921e4['id']);var _0x4f9492={'ListId':_0x310e2e};var _0x1d3582=_0x4ae48e[_0xfca2('0x26')]&&_0x4ae48e[_0xfca2('0x26')]!=='0'?_0x4ae48e[_0xfca2('0x26')]:_0xfca2('0x16');if(_0x3704ac){logger[_0xfca2('0xb')](_0xfca2('0x27'),_0x57df70[_0xfca2('0x21')],_0x3921e4['id']);_0x4f9492[_0x1d3582]=_['isNil'](_0x57df70[_0xfca2('0x28')])?_0x57df70['calleridnum']:_0x57df70[_0xfca2('0x17')];if(_['isNil'](_0x57df70[_0xfca2('0x28')])){_0x4f9492[_0xfca2('0x19')]=_0x57df70[_0xfca2('0x29')]&&_0x57df70['calleridname']!==_0xfca2('0x2a')?_0x57df70[_0xfca2('0x29')]:_0xfca2('0x2b');}else{_0x4f9492[_0xfca2('0x19')]=_0x57df70[_0xfca2('0x2c')]&&_0x57df70[_0xfca2('0x2c')]!==_0xfca2('0x2a')?_0x57df70[_0xfca2('0x2c')]:_0xfca2('0x2b');}return BPromise[_0xfca2('0x1e')]()['then'](cmContactRpc['createContact'](_0x4f9492))[_0xfca2('0x1f')](function(_0x360ac3){_0x299521=_0x360ac3;_0x32e8fb[_0xfca2('0x2d')](_0x360ac3);if(_0x299521){logger[_0xfca2('0xb')](_0xfca2('0x2e'),_0x57df70[_0xfca2('0x21')],_0x3921e4['id'],_0x299521['id']);}return;});}else{logger['info'](_0xfca2('0x2f'),_0x57df70['uniqueid'],_0x3921e4['id']);_0x4f9492[_0x1d3582]=_[_0xfca2('0x11')](_0x57df70[_0xfca2('0x28')])?_0x57df70['calleridnum']:_0x57df70[_0xfca2('0x17')];if(_[_0xfca2('0x11')](_0x57df70[_0xfca2('0x28')])){_0x4f9492[_0xfca2('0x19')]=_0x57df70[_0xfca2('0x29')]&&_0x57df70['calleridname']!==_0xfca2('0x2a')?_0x57df70[_0xfca2('0x29')]:'Unknown';}else{_0x4f9492['firstName']=_0x57df70['destcalleridname']&&_0x57df70['destcalleridname']!==_0xfca2('0x2a')?_0x57df70[_0xfca2('0x2c')]:_0xfca2('0x2b');}_0x299521=_0x4f9492;_0x32e8fb[_0xfca2('0x2d')](_0x4f9492);return;}}})[_0xfca2('0x1f')](function(){if(_0x2a8c80){emit(_0x57df70[_0xfca2('0x21')],_0x3921e4,util['format'](_0xfca2('0x30'),_0x2a8c80[_0xfca2('0x31')]),util[_0xfca2('0x32')](_0xfca2('0x33'),_0x4ae48e[_0xfca2('0x34')][_0xfca2('0x35')]()),{'evt':_[_0xfca2('0x36')](_0x57df70,{'autoCreate':_0x3704ac}),'contact':_0x299521===undefined?{}:_0x299521,'contacts':_0x32e8fb['length']===0x0?undefined:_0x32e8fb});}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c3c=['data5','800','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','data1','jscripty','trigger:%s','integration','exec','accounts','queue','urlforward','script','parse','query','replace','checkTrigger','channel','AllConditions','length','every','checkConditions','AnyConditions','some','evt','field','chat','value','ChatWebsiteId','upperFirst','AccountId','operator','interaction','event','agent','membername','lastevent','routeId','substatus','offlineMessage','created','equals','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','custom:dialend','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','debug','inspect','interface','hasOwnProperty','status','merge','Actions','action','toLowerCase','contactmanager','browser','TemplateId','html','render','data2','buildUri','data3','isNil','data4','location','uriLocation','windowWidth'];(function(_0x5d8fb0,_0x2cea39){var _0x16cb73=function(_0x11ed21){while(--_0x11ed21){_0x5d8fb0['push'](_0x5d8fb0['shift']());}};_0x16cb73(++_0x2cea39);}(_0x5c3c,0x132));var _0xc5c3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5c3c[_0x24259d];return _0x5a701;};'use strict';var util=require(_0xc5c3('0x0'));var _=require(_0xc5c3('0x1'));var url=require(_0xc5c3('0x2'));var Mustache=require(_0xc5c3('0x3'));var Redis=require('ioredis');var urlforward=require(_0xc5c3('0x4'));var integration=require(_0xc5c3('0x5'));var cmContact=require(_0xc5c3('0x6'));var script=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var logger=require(_0xc5c3('0x9'))(_0xc5c3('0xa'));var ami=require(_0xc5c3('0xb'));config[_0xc5c3('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc5c3('0xd'))(new Redis(config[_0xc5c3('0xc')]));var operators={'equals':function(_0x593b35,_0x110b89){return _0x593b35==_0x110b89;},'not_equals':function(_0x46e2c1,_0x52f3eb){return _0x46e2c1!=_0x52f3eb;}};var barAndWebActions=[_0xc5c3('0xe'),_0xc5c3('0x2'),'winapp'];function Trigger(_0x1f2e34){this[_0xc5c3('0xf')]=_0x1f2e34[_0xc5c3('0xf')];this['agents']=_0x1f2e34[_0xc5c3('0x10')];this[_0xc5c3('0x11')]=_0x1f2e34['voiceQueues'];this[_0xc5c3('0x12')]=_0x1f2e34[_0xc5c3('0x12')];this[_0xc5c3('0x13')]=_0x1f2e34['voiceExtensions'];this[_0xc5c3('0x14')]=_0x1f2e34[_0xc5c3('0x14')];this[_0xc5c3('0x15')]=_0x1f2e34[_0xc5c3('0x15')];this[_0xc5c3('0x16')]=_0x1f2e34['salesforceAccounts'];this['sugarcrmAccounts']=_0x1f2e34[_0xc5c3('0x17')];this[_0xc5c3('0x18')]=_0x1f2e34[_0xc5c3('0x18')];this[_0xc5c3('0x19')]=_0x1f2e34['deskAccounts'];this['vtigerAccounts']=_0x1f2e34[_0xc5c3('0x1a')];this['servicenowAccounts']=_0x1f2e34[_0xc5c3('0x1b')];this[_0xc5c3('0x1c')]=_0x1f2e34[_0xc5c3('0x1c')];this[_0xc5c3('0x1d')]=_0x1f2e34[_0xc5c3('0x1d')];this['accounts']={'zendesk':this[_0xc5c3('0x14')],'salesforce':this[_0xc5c3('0x16')],'freshdesk':this[_0xc5c3('0x15')],'sugarcrm':this[_0xc5c3('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0xc5c3('0x19')],'vtiger':this[_0xc5c3('0x1a')],'dynamics365':this[_0xc5c3('0x1c')],'freshsales':this[_0xc5c3('0x1d')],'servicenow':this[_0xc5c3('0x1b')]};ami['on']('custom:agentcalled',this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x20'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x21'),this[_0xc5c3('0x1e')]['bind'](this));ami['on']('custom:agentcomplete',this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x22'),this[_0xc5c3('0x1e')]['bind'](this));ami['on']('custom:agentbusy',this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x23'),this[_0xc5c3('0x1e')]['bind'](this));ami['on'](_0xc5c3('0x24'),this['syncCustomEvent'][_0xc5c3('0x1f')](this));ami['on']('custom:amd',this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x25'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x26'),this[_0xc5c3('0x1e')]['bind'](this));ami['on'](_0xc5c3('0x27'),this['syncAgentDial'][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0xc5c3('0x29'),this[_0xc5c3('0x2a')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x2b'),this['syncCustomEvent'][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x2c'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x2d'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x2e'),this[_0xc5c3('0x1e')]['bind'](this));ami['on'](_0xc5c3('0x2f'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x30'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this));ami['on'](_0xc5c3('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0xc5c3('0x32'),this['syncCustomEvent'][_0xc5c3('0x1f')](this));}Trigger[_0xc5c3('0x33')][_0xc5c3('0x34')]=function(_0x15c656,_0x32df1e,_0x498677){logger[_0xc5c3('0x35')](_0x15c656,_0x32df1e,JSON[_0xc5c3('0x36')](_0x498677));io['to'](_0x15c656)['emit'](_0x32df1e,_0x498677);};Trigger[_0xc5c3('0x33')][_0xc5c3('0x1e')]=function(_0x321917){var _0x80d0df=_[_0xc5c3('0x37')](_0x321917);if(typeof _0x80d0df[_0xc5c3('0x38')]===_0xc5c3('0x39')){_0x80d0df[_0xc5c3('0x38')]=_0xc5c3('0x3a');}logger[_0xc5c3('0x3b')]('syncCustomEvent',util[_0xc5c3('0x3c')](_0x80d0df,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x80d0df);};Trigger['prototype'][_0xc5c3('0x2a')]=function(_0x10e27d){if(this[_0xc5c3('0x10')][_0x10e27d[_0xc5c3('0x3d')]]){this[_0xc5c3('0x1e')](_0x10e27d);}};Trigger['prototype']['checkTriggers']=function(_0x17e263){var _0xa7cb91;for(var _0x53f4e3 in this[_0xc5c3('0xf')]){if(this['triggers'][_0xc5c3('0x3e')](_0x53f4e3)){if(this[_0xc5c3('0xf')][_0x53f4e3][_0xc5c3('0x3f')]){_0xa7cb91=this['checkTrigger'](this[_0xc5c3('0xf')][_0x53f4e3],_0x17e263);if(_0xa7cb91){_[_0xc5c3('0x40')](_0x17e263,_0x17e263['variables']);for(var _0x4465c8=0x0,_0x599881,_0x33936c,_0x28c35c;_0x4465c8<this['triggers'][_0x53f4e3]['Actions']['length'];_0x4465c8+=0x1){_0x599881=this[_0xc5c3('0xf')][_0x53f4e3][_0xc5c3('0x41')][_0x4465c8];if(this['agents'][_0x17e263[_0xc5c3('0x3d')]]){switch(_0x599881[_0xc5c3('0x42')][_0xc5c3('0x43')]()){case _0xc5c3('0x44'):break;case'motionbar':case _0xc5c3('0x45'):var _0x523fdf={};switch(barAndWebActions[_0x599881['data1']]){case _0xc5c3('0xe'):_0x523fdf[_0xc5c3('0x46')]=_0x599881['data2'];_0x523fdf[_0xc5c3('0x47')]=this[_0xc5c3('0x12')][_0x599881['data2']]?Mustache[_0xc5c3('0x48')](this['templates'][_0x599881[_0xc5c3('0x49')]][_0xc5c3('0x47')],_0x17e263):'template\x20not\x20found';break;case _0xc5c3('0x2'):_0x523fdf['uri']=this[_0xc5c3('0x4a')](_0x599881[_0xc5c3('0x49')],_0x17e263,_['isNil'](_0x599881[_0xc5c3('0x4b')])?!![]:parseInt(_0x599881[_0xc5c3('0x4b')],0xa));if(_[_0xc5c3('0x4c')](_0x599881[_0xc5c3('0x4d')])){_0x523fdf[_0xc5c3('0x4e')]='0';}else{_0x523fdf[_0xc5c3('0x4f')]=_0x599881['data4'];_0x523fdf[_0xc5c3('0x50')]=_[_0xc5c3('0x4c')](_0x599881[_0xc5c3('0x51')])?_0xc5c3('0x52'):_0x599881[_0xc5c3('0x51')];_0x523fdf['windowHeight']=_['isNil'](_0x599881[_0xc5c3('0x53')])?_0xc5c3('0x54'):_0x599881[_0xc5c3('0x53')];}break;case'winapp':_0x523fdf[_0xc5c3('0x55')]=_0x599881[_0xc5c3('0x49')]?Mustache[_0xc5c3('0x48')](_0x599881[_0xc5c3('0x49')],_0x17e263):'';_0x523fdf[_0xc5c3('0x56')]=_0x599881[_0xc5c3('0x4b')]?Mustache[_0xc5c3('0x48')](_0x599881['data3'],_0x17e263):'';break;}this[_0xc5c3('0x34')](util[_0xc5c3('0x57')](_0xc5c3('0x58'),this['agents'][_0x17e263[_0xc5c3('0x3d')]][_0xc5c3('0x59')]),util[_0xc5c3('0x57')](_0xc5c3('0x5a'),_0x599881[_0xc5c3('0x42')]['toLowerCase'](),barAndWebActions[_0x599881[_0xc5c3('0x5b')]]),_['merge'](_0x523fdf,_0x17e263));break;case _0xc5c3('0x5c'):this['emit'](util[_0xc5c3('0x57')](_0xc5c3('0x58'),this[_0xc5c3('0x10')][_0x17e263[_0xc5c3('0x3d')]][_0xc5c3('0x59')]),util['format'](_0xc5c3('0x5d'),_0x599881[_0xc5c3('0x42')][_0xc5c3('0x43')]()),_[_0xc5c3('0x40')]({'ProjectId':parseInt(_0x599881[_0xc5c3('0x5b')],0xa)},_0x17e263));break;default:this['emit'](util[_0xc5c3('0x57')](_0xc5c3('0x58'),this[_0xc5c3('0x10')][_0x17e263['interface']][_0xc5c3('0x59')]),util['format']('trigger:%s',_0x599881[_0xc5c3('0x42')][_0xc5c3('0x43')]()),_[_0xc5c3('0x40')]({},_0x599881,_0x17e263));}}switch(_0x599881[_0xc5c3('0x42')][_0xc5c3('0x43')]()){case _0xc5c3('0x44'):cmContact['exec'](this[_0xc5c3('0x10')][_0x17e263[_0xc5c3('0x3d')]],this[_0xc5c3('0xf')][_0x53f4e3],_0x599881,_0x17e263);break;case _0xc5c3('0x5e'):integration[_0xc5c3('0x5f')](_0x599881,_0x17e263,this[_0xc5c3('0x60')],this[_0xc5c3('0x10')][_0x17e263['interface']],this['voiceQueues'][_0x17e263[_0xc5c3('0x61')]],this[_0xc5c3('0x13')][_0x17e263['routeId']]);break;case _0xc5c3('0x62'):urlforward[_0xc5c3('0x5f')](_0x599881,_0x17e263);break;case _0xc5c3('0x63'):script[_0xc5c3('0x5f')](_0x599881,_0x17e263);break;}}}}}}};Trigger['prototype'][_0xc5c3('0x4a')]=function(_0x23a1f9,_0x436e0b,_0x314392){var _0x1b66bf=url[_0xc5c3('0x64')](Mustache[_0xc5c3('0x48')](_0x23a1f9,_0x436e0b),!![]);if(_0x314392){_[_0xc5c3('0x40')](_0x1b66bf[_0xc5c3('0x65')],_0x436e0b);}delete _0x1b66bf['search'];var _0x394c9d=url[_0xc5c3('0x57')](_0x1b66bf);_0x394c9d=_0x394c9d[_0xc5c3('0x66')](/\/\?/g,'?');return _0x394c9d;};Trigger['prototype'][_0xc5c3('0x67')]=function(_0x939ee1,_0x18adc4){var _0x30226f=!![];var _0x32d5e2=!![];var _0x5067ed=![];if(_0x939ee1[_0xc5c3('0x68')]===_0x18adc4[_0xc5c3('0x38')]){_0x5067ed=!![];}if(_0x939ee1[_0xc5c3('0x69')][_0xc5c3('0x6a')]){_0x30226f=_[_0xc5c3('0x6b')](_0x939ee1[_0xc5c3('0x69')],this[_0xc5c3('0x6c')](_0x18adc4,_0x939ee1['channel']));}if(_0x939ee1[_0xc5c3('0x6d')][_0xc5c3('0x6a')]){_0x32d5e2=_[_0xc5c3('0x6e')](_0x939ee1[_0xc5c3('0x6d')],this[_0xc5c3('0x6c')](_0x18adc4,_0x939ee1[_0xc5c3('0x68')]));}var _0x4767d4=_0x5067ed&&_0x30226f&&_0x32d5e2;logger['debug']('checkTrigger:\x20trigger',util[_0xc5c3('0x3c')](_0x939ee1,{'showHidden':!![],'depth':null}),_0xc5c3('0x6f'),util[_0xc5c3('0x3c')](_0x18adc4,{'showHidden':!![],'depth':null}),_0x5067ed,_0x30226f,_0x32d5e2);return _0x4767d4;};Trigger[_0xc5c3('0x33')][_0xc5c3('0x6c')]=function(_0x28412e,_0x17520e){return function(_0x2cdd7a){switch(_0x2cdd7a[_0xc5c3('0x70')]){case'account':if(_0x28412e[_0xc5c3('0x68')]===_0x17520e){if(_0x17520e===_0xc5c3('0x71')){return _0x28412e['ChatWebsiteId']?operators[_0x2cdd7a['operator']](Number(_0x2cdd7a[_0xc5c3('0x72')]),_0x28412e[_0xc5c3('0x73')]):![];}else{return _0x28412e[_[_0xc5c3('0x74')](_0x17520e)+_0xc5c3('0x75')]?operators[_0x2cdd7a[_0xc5c3('0x76')]](Number(_0x2cdd7a[_0xc5c3('0x72')]),_0x28412e[_[_0xc5c3('0x74')](_0x17520e)+_0xc5c3('0x75')]):![];}}break;case _0xc5c3('0x77'):case'message':if(_0x28412e[_0xc5c3('0x68')]===_0x17520e){return _0x28412e[_0xc5c3('0x78')]?operators[_0x2cdd7a[_0xc5c3('0x76')]](_0x2cdd7a[_0xc5c3('0x72')],_0x28412e[_0xc5c3('0x78')]):![];}break;case _0xc5c3('0x61'):return _0x28412e[_0xc5c3('0x61')]?operators[_0x2cdd7a[_0xc5c3('0x76')]](_0x2cdd7a[_0xc5c3('0x72')],_0x28412e[_0xc5c3('0x61')]):![];case _0xc5c3('0x79'):return _0x28412e['membername']?operators[_0x2cdd7a['operator']](_0x2cdd7a[_0xc5c3('0x72')],_0x28412e[_0xc5c3('0x7a')]):![];case _0xc5c3('0x7b'):return _0x28412e[_0xc5c3('0x7b')]?operators[_0x2cdd7a[_0xc5c3('0x76')]](_0x2cdd7a[_0xc5c3('0x72')],_0x28412e[_0xc5c3('0x7b')]):![];case _0xc5c3('0x7c'):return _0x28412e[_0xc5c3('0x7c')]?operators[_0x2cdd7a[_0xc5c3('0x76')]](_0x2cdd7a[_0xc5c3('0x72')],_0x28412e[_0xc5c3('0x7c')]):![];case'mailSubstatus':if(_0x2cdd7a[_0xc5c3('0x72')]==='null')_0x2cdd7a[_0xc5c3('0x72')]=null;return typeof _0x28412e[_0xc5c3('0x7d')]!==_0xc5c3('0x39')?operators[_0x2cdd7a[_0xc5c3('0x76')]](_0x2cdd7a[_0xc5c3('0x72')],_0x28412e[_0xc5c3('0x7d')]):![];case _0xc5c3('0x7e'):if(_0x28412e[_0xc5c3('0x68')]===_0x17520e){return _0x2cdd7a['value']===_0xc5c3('0x7f')&&_0x2cdd7a[_0xc5c3('0x76')]===_0xc5c3('0x80')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x17bb=['lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','sugarcrmAccounts','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','emit','clone','motionChannel','undefined','voice','inspect','checkTriggers','hasOwnProperty','variables','Actions','interface','contactmanager','motionbar','browser','data1','data2','templates','html','template\x20not\x20found','buildUri','isNil','data3','uriLocation','data4','data5','800','600','data6','winApplication','render','winArguments','user:%s','name','format','action','toLowerCase','merge','jscripty','trigger:%s','integration','queue','routeId','urlforward','exec','script','parse','query','search','replace','checkTrigger','channel','length','every','checkConditions','AnyConditions','some','debug','checkTrigger:\x20trigger','evt','field','chat','ChatWebsiteId','operator','value','AccountId','interaction','message','event','agent','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util'];(function(_0x258257,_0x32042d){var _0xafb58a=function(_0x506b5a){while(--_0x506b5a){_0x258257['push'](_0x258257['shift']());}};_0xafb58a(++_0x32042d);}(_0x17bb,0x188));var _0xb17b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x17bb[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xb17b('0x0'));var _=require(_0xb17b('0x1'));var url=require(_0xb17b('0x2'));var Mustache=require(_0xb17b('0x3'));var Redis=require(_0xb17b('0x4'));var urlforward=require(_0xb17b('0x5'));var integration=require('./integration');var cmContact=require(_0xb17b('0x6'));var script=require(_0xb17b('0x7'));var config=require(_0xb17b('0x8'));var logger=require(_0xb17b('0x9'))('trigger');var ami=require(_0xb17b('0xa'));config['redis']=_[_0xb17b('0xb')](config[_0xb17b('0xc')],{'host':_0xb17b('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb17b('0xc')]));var operators={'equals':function(_0xdb9889,_0x243a06){return _0xdb9889==_0x243a06;},'not_equals':function(_0xfcdd38,_0x420689){return _0xfcdd38!=_0x420689;}};var barAndWebActions=[_0xb17b('0xe'),_0xb17b('0x2'),_0xb17b('0xf')];function Trigger(_0x2b8972){this['triggers']=_0x2b8972[_0xb17b('0x10')];this['agents']=_0x2b8972[_0xb17b('0x11')];this[_0xb17b('0x12')]=_0x2b8972[_0xb17b('0x12')];this['templates']=_0x2b8972['templates'];this[_0xb17b('0x13')]=_0x2b8972[_0xb17b('0x13')];this[_0xb17b('0x14')]=_0x2b8972[_0xb17b('0x14')];this[_0xb17b('0x15')]=_0x2b8972['freshdeskAccounts'];this['salesforceAccounts']=_0x2b8972['salesforceAccounts'];this['sugarcrmAccounts']=_0x2b8972['sugarcrmAccounts'];this[_0xb17b('0x16')]=_0x2b8972['zohoAccounts'];this[_0xb17b('0x17')]=_0x2b8972['deskAccounts'];this[_0xb17b('0x18')]=_0x2b8972[_0xb17b('0x18')];this[_0xb17b('0x19')]=_0x2b8972[_0xb17b('0x19')];this['dynamics365Accounts']=_0x2b8972[_0xb17b('0x1a')];this[_0xb17b('0x1b')]=_0x2b8972[_0xb17b('0x1b')];this[_0xb17b('0x1c')]={'zendesk':this[_0xb17b('0x14')],'salesforce':this[_0xb17b('0x1d')],'freshdesk':this[_0xb17b('0x15')],'sugarcrm':this[_0xb17b('0x1e')],'zoho':this[_0xb17b('0x16')],'desk':this[_0xb17b('0x17')],'vtiger':this[_0xb17b('0x18')],'dynamics365':this[_0xb17b('0x1a')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xb17b('0x19')]};ami['on']('custom:agentcalled',this[_0xb17b('0x1f')]['bind'](this));ami['on'](_0xb17b('0x20'),this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x22'),this['syncCustomEvent'][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x23'),this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x24'),this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x25'),this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x26'),this['syncCustomEvent'][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x27'),this['syncCustomEvent'][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x28'),this['syncCustomEvent'][_0xb17b('0x21')](this));ami['on']('custom:amd',this[_0xb17b('0x1f')]['bind'](this));ami['on'](_0xb17b('0x29'),this[_0xb17b('0x1f')]['bind'](this));ami['on'](_0xb17b('0x2a'),this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x2b'),this[_0xb17b('0x2c')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x2d'),this[_0xb17b('0x2c')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x2e'),this[_0xb17b('0x2c')]['bind'](this));ami['on'](_0xb17b('0x2f'),this['syncCustomEvent'][_0xb17b('0x21')](this));ami['on']('custom:closedinteraction',this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x30'),this[_0xb17b('0x1f')]['bind'](this));ami['on']('custom:incomingmessage',this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on']('custom:outgoingmessage',this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x31'),this[_0xb17b('0x1f')][_0xb17b('0x21')](this));ami['on'](_0xb17b('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb17b('0x33'),this[_0xb17b('0x1f')]['bind'](this));}Trigger[_0xb17b('0x34')]['emit']=function(_0x3c7d7d,_0x2b44ec,_0x5c7a93){logger[_0xb17b('0x35')](_0x3c7d7d,_0x2b44ec,JSON['stringify'](_0x5c7a93));io['to'](_0x3c7d7d)[_0xb17b('0x36')](_0x2b44ec,_0x5c7a93);};Trigger[_0xb17b('0x34')][_0xb17b('0x1f')]=function(_0x5f371f){var _0x572e2f=_[_0xb17b('0x37')](_0x5f371f);if(typeof _0x572e2f[_0xb17b('0x38')]===_0xb17b('0x39')){_0x572e2f[_0xb17b('0x38')]=_0xb17b('0x3a');}logger['debug'](_0xb17b('0x1f'),util[_0xb17b('0x3b')](_0x572e2f,{'showHidden':!![],'depth':null}));this[_0xb17b('0x3c')](_0x572e2f);};Trigger[_0xb17b('0x34')]['syncAgentDial']=function(_0x6b2091){if(this[_0xb17b('0x11')][_0x6b2091['interface']]){this['syncCustomEvent'](_0x6b2091);}};Trigger['prototype'][_0xb17b('0x3c')]=function(_0x305872){var _0x26ea61;for(var _0x2f478d in this[_0xb17b('0x10')]){if(this[_0xb17b('0x10')][_0xb17b('0x3d')](_0x2f478d)){if(this[_0xb17b('0x10')][_0x2f478d]['status']){_0x26ea61=this['checkTrigger'](this[_0xb17b('0x10')][_0x2f478d],_0x305872);if(_0x26ea61){_['merge'](_0x305872,_0x305872[_0xb17b('0x3e')]);for(var _0x5c1957=0x0,_0x232a2c,_0x4ddd77,_0x5520f;_0x5c1957<this[_0xb17b('0x10')][_0x2f478d][_0xb17b('0x3f')]['length'];_0x5c1957+=0x1){_0x232a2c=this[_0xb17b('0x10')][_0x2f478d]['Actions'][_0x5c1957];if(this['agents'][_0x305872[_0xb17b('0x40')]]){switch(_0x232a2c['action']['toLowerCase']()){case _0xb17b('0x41'):break;case _0xb17b('0x42'):case _0xb17b('0x43'):var _0x3917f2={};switch(barAndWebActions[_0x232a2c[_0xb17b('0x44')]]){case _0xb17b('0xe'):_0x3917f2['TemplateId']=_0x232a2c[_0xb17b('0x45')];_0x3917f2['html']=this[_0xb17b('0x46')][_0x232a2c[_0xb17b('0x45')]]?Mustache['render'](this[_0xb17b('0x46')][_0x232a2c[_0xb17b('0x45')]][_0xb17b('0x47')],_0x305872):_0xb17b('0x48');break;case _0xb17b('0x2'):_0x3917f2['uri']=this[_0xb17b('0x49')](_0x232a2c['data2'],_0x305872,_[_0xb17b('0x4a')](_0x232a2c[_0xb17b('0x4b')])?!![]:parseInt(_0x232a2c[_0xb17b('0x4b')],0xa));if(_[_0xb17b('0x4a')](_0x232a2c['data4'])){_0x3917f2['location']='0';}else{_0x3917f2[_0xb17b('0x4c')]=_0x232a2c[_0xb17b('0x4d')];_0x3917f2['windowWidth']=_[_0xb17b('0x4a')](_0x232a2c[_0xb17b('0x4e')])?_0xb17b('0x4f'):_0x232a2c[_0xb17b('0x4e')];_0x3917f2['windowHeight']=_['isNil'](_0x232a2c['data6'])?_0xb17b('0x50'):_0x232a2c[_0xb17b('0x51')];}break;case'winapp':_0x3917f2[_0xb17b('0x52')]=_0x232a2c[_0xb17b('0x45')]?Mustache[_0xb17b('0x53')](_0x232a2c[_0xb17b('0x45')],_0x305872):'';_0x3917f2[_0xb17b('0x54')]=_0x232a2c[_0xb17b('0x4b')]?Mustache[_0xb17b('0x53')](_0x232a2c[_0xb17b('0x4b')],_0x305872):'';break;}this['emit'](util['format'](_0xb17b('0x55'),this['agents'][_0x305872[_0xb17b('0x40')]][_0xb17b('0x56')]),util[_0xb17b('0x57')]('trigger:%s:%s',_0x232a2c[_0xb17b('0x58')][_0xb17b('0x59')](),barAndWebActions[_0x232a2c['data1']]),_[_0xb17b('0x5a')](_0x3917f2,_0x305872));break;case _0xb17b('0x5b'):this[_0xb17b('0x36')](util[_0xb17b('0x57')]('user:%s',this[_0xb17b('0x11')][_0x305872[_0xb17b('0x40')]]['name']),util['format'](_0xb17b('0x5c'),_0x232a2c[_0xb17b('0x58')][_0xb17b('0x59')]()),_['merge']({'ProjectId':parseInt(_0x232a2c[_0xb17b('0x44')],0xa)},_0x305872));break;default:this[_0xb17b('0x36')](util[_0xb17b('0x57')](_0xb17b('0x55'),this['agents'][_0x305872['interface']][_0xb17b('0x56')]),util[_0xb17b('0x57')]('trigger:%s',_0x232a2c[_0xb17b('0x58')][_0xb17b('0x59')]()),_[_0xb17b('0x5a')]({},_0x232a2c,_0x305872));}}switch(_0x232a2c[_0xb17b('0x58')][_0xb17b('0x59')]()){case _0xb17b('0x41'):cmContact['exec'](this[_0xb17b('0x11')][_0x305872['interface']],this['triggers'][_0x2f478d],_0x232a2c,_0x305872);break;case _0xb17b('0x5d'):integration['exec'](_0x232a2c,_0x305872,this['accounts'],this[_0xb17b('0x11')][_0x305872[_0xb17b('0x40')]],this[_0xb17b('0x12')][_0x305872[_0xb17b('0x5e')]],this[_0xb17b('0x13')][_0x305872[_0xb17b('0x5f')]]);break;case _0xb17b('0x60'):urlforward[_0xb17b('0x61')](_0x232a2c,_0x305872);break;case _0xb17b('0x62'):script[_0xb17b('0x61')](_0x232a2c,_0x305872);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x4377de,_0x47b13a,_0x46929f){var _0x24d181=url[_0xb17b('0x63')](Mustache[_0xb17b('0x53')](_0x4377de,_0x47b13a),!![]);if(_0x46929f){_[_0xb17b('0x5a')](_0x24d181[_0xb17b('0x64')],_0x47b13a);}delete _0x24d181[_0xb17b('0x65')];var _0x431ed0=url[_0xb17b('0x57')](_0x24d181);_0x431ed0=_0x431ed0[_0xb17b('0x66')](/\/\?/g,'?');return _0x431ed0;};Trigger[_0xb17b('0x34')][_0xb17b('0x67')]=function(_0x16ad97,_0x2390b8){var _0x30f4ef=!![];var _0x3e57bf=!![];var _0x3bc87e=![];if(_0x16ad97[_0xb17b('0x68')]===_0x2390b8[_0xb17b('0x38')]){_0x3bc87e=!![];}if(_0x16ad97['AllConditions'][_0xb17b('0x69')]){_0x30f4ef=_[_0xb17b('0x6a')](_0x16ad97['AllConditions'],this[_0xb17b('0x6b')](_0x2390b8,_0x16ad97[_0xb17b('0x68')]));}if(_0x16ad97[_0xb17b('0x6c')]['length']){_0x3e57bf=_[_0xb17b('0x6d')](_0x16ad97[_0xb17b('0x6c')],this['checkConditions'](_0x2390b8,_0x16ad97['channel']));}var _0x4ab178=_0x3bc87e&&_0x30f4ef&&_0x3e57bf;logger[_0xb17b('0x6e')](_0xb17b('0x6f'),util[_0xb17b('0x3b')](_0x16ad97,{'showHidden':!![],'depth':null}),_0xb17b('0x70'),util[_0xb17b('0x3b')](_0x2390b8,{'showHidden':!![],'depth':null}),_0x3bc87e,_0x30f4ef,_0x3e57bf);return _0x4ab178;};Trigger[_0xb17b('0x34')][_0xb17b('0x6b')]=function(_0x5acc45,_0x474f9f){return function(_0x1ab3d2){switch(_0x1ab3d2[_0xb17b('0x71')]){case'account':if(_0x5acc45[_0xb17b('0x68')]===_0x474f9f){if(_0x474f9f===_0xb17b('0x72')){return _0x5acc45[_0xb17b('0x73')]?operators[_0x1ab3d2[_0xb17b('0x74')]](Number(_0x1ab3d2[_0xb17b('0x75')]),_0x5acc45[_0xb17b('0x73')]):![];}else{return _0x5acc45[_['upperFirst'](_0x474f9f)+_0xb17b('0x76')]?operators[_0x1ab3d2['operator']](Number(_0x1ab3d2[_0xb17b('0x75')]),_0x5acc45[_['upperFirst'](_0x474f9f)+'AccountId']):![];}}break;case _0xb17b('0x77'):case _0xb17b('0x78'):if(_0x5acc45[_0xb17b('0x68')]===_0x474f9f){return _0x5acc45[_0xb17b('0x79')]?operators[_0x1ab3d2[_0xb17b('0x74')]](_0x1ab3d2[_0xb17b('0x75')],_0x5acc45['event']):![];}break;case _0xb17b('0x5e'):return _0x5acc45[_0xb17b('0x5e')]?operators[_0x1ab3d2['operator']](_0x1ab3d2['value'],_0x5acc45['queue']):![];case _0xb17b('0x7a'):return _0x5acc45['membername']?operators[_0x1ab3d2[_0xb17b('0x74')]](_0x1ab3d2[_0xb17b('0x75')],_0x5acc45['membername']):![];case _0xb17b('0x7b'):return _0x5acc45[_0xb17b('0x7b')]?operators[_0x1ab3d2[_0xb17b('0x74')]](_0x1ab3d2[_0xb17b('0x75')],_0x5acc45[_0xb17b('0x7b')]):![];case _0xb17b('0x5f'):return _0x5acc45['routeId']?operators[_0x1ab3d2[_0xb17b('0x74')]](_0x1ab3d2['value'],_0x5acc45[_0xb17b('0x5f')]):![];case _0xb17b('0x7c'):if(_0x1ab3d2['value']===_0xb17b('0x7d'))_0x1ab3d2['value']=null;return typeof _0x5acc45[_0xb17b('0x7e')]!=='undefined'?operators[_0x1ab3d2['operator']](_0x1ab3d2['value'],_0x5acc45['substatus']):![];case _0xb17b('0x7f'):if(_0x5acc45[_0xb17b('0x68')]===_0x474f9f){return _0x1ab3d2['value']===_0xb17b('0x80')&&_0x1ab3d2[_0xb17b('0x74')]===_0xb17b('0x81')?!![]:![];}break;}return![];};};module[_0xb17b('0x82')]=Trigger;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x56aa42,_0x49fdda){var _0x10e1f9=function(_0x128e5d){while(--_0x128e5d){_0x56aa42['push'](_0x56aa42['shift']());}};_0x10e1f9(++_0x49fdda);}(_0x3e74,0x175));var _0x43e7=function(_0x7edda6,_0x5d21ea){_0x7edda6=_0x7edda6-0x0;var _0x4b205b=_0x3e74[_0x7edda6];return _0x4b205b;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});};
\ No newline at end of file
+var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x10640c,_0x2b7973){_0x10640c=_0x10640c-0x0;var _0x18f9d0=_0xe14b[_0x10640c];return _0x18f9d0;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9de0=['CloudProvider','data7','tenantId','data2','resolve','data5','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','isNil','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','POST','contacts','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','substring','lastIndexOf','catch','toLowerCase','destcalleridnum','calleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','value','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x9de0,0xd5));var _0x09de=function(_0x13d9bc,_0x598b69){_0x13d9bc=_0x13d9bc-0x0;var _0x54a47a=_0x9de0[_0x13d9bc];return _0x54a47a;};'use strict';var _=require(_0x09de('0x0'));var rp=require(_0x09de('0x1'));var util=require(_0x09de('0x2'));var intUtil=require('./util');var md5=require(_0x09de('0x3'));var Redis=require(_0x09de('0x4'));var logger=require(_0x09de('0x5'))('dynamics365');var config=require(_0x09de('0x6'));config[_0x09de('0x7')]=_[_0x09de('0x8')](config[_0x09de('0x7')],{'host':_0x09de('0x9'),'port':0x18eb});var io=require(_0x09de('0xa'))(new Redis(config['redis']));function getAuthToken(_0x30983f,_0x1ac354,_0x712364){if(_0x30983f[_0x09de('0xb')]){_0x30983f[_0x09de('0xc')]=_0x30983f[_0x09de('0xd')][_0x09de('0xe')];_0x30983f[_0x09de('0xf')]=_0x30983f[_0x09de('0xd')][_0x09de('0x10')];return Promise[_0x09de('0x11')](_0x30983f[_0x09de('0xd')][_0x09de('0x12')]);}var _0x4c748e={'method':'POST','uri':_0x1ac354,'form':{'client_id':_0x30983f[_0x09de('0x13')],'resource':_0x30983f[_0x09de('0xc')],'username':_0x30983f[_0x09de('0x14')],'password':_0x30983f[_0x09de('0x15')],'grant_type':'password','client_secret':_0x30983f[_0x09de('0x16')]},'json':!![]};return rp(_0x4c748e)[_0x09de('0x17')](function(_0x341a2e){return _0x341a2e[_0x09de('0x18')];})['catch'](function(_0x1b99c2){logger[_0x09de('0x19')]('['+[_0x712364[_0x09de('0x1a')]()]+_0x09de('0x1b'));return _0x1b99c2[_0x09de('0x1c')];});}function getUser(_0x1e88a7,_0xf5ef8,_0x1bc313,_0x1e721f,_0x2c2a0e,_0x1e37a7){return new Promise(function(_0x244505,_0x54b949){return getAuthToken(_0xf5ef8,_0x1e721f,_0x1e37a7)[_0x09de('0x17')](function(_0x3b55cb){var _0xb2fc92={'method':_0x09de('0x1d'),'uri':_0x2c2a0e+_0x09de('0x1e'),'headers':{'Authorization':'Bearer\x20'+_0x3b55cb,'OData-Version':'4.0'},'json':!![]};return rp(_0xb2fc92);})[_0x09de('0x17')](function(_0x4c7690){var _0x35c9ce=_0x4c7690['value'];var _0x5df32f=![];var _0x1985ba=null;if(!_[_0x09de('0x1f')](_0x1bc313)){if(intUtil['validateEmail'](_0x1bc313[_0x09de('0x20')])){_0x1e88a7[_0x09de('0x21')]=_0x1bc313[_0x09de('0x20')];for(_0x1985ba=0x0;_0x1985ba<_0x35c9ce[_0x09de('0x22')];_0x1985ba++){if(_0x35c9ce[_0x1985ba]['internalemailaddress']===_0x1bc313['email']&&!_0x35c9ce[_0x1985ba][_0x09de('0x23')]){_0x5df32f=!![];logger[_0x09de('0x24')]('['+[_0x1e37a7[_0x09de('0x1a')]()]+_0x09de('0x25')+_0x35c9ce[_0x1985ba][_0x09de('0x26')]+'!');_0x1e88a7[_0x09de('0x27')]=_0x35c9ce[_0x1985ba]['systemuserid'];}}}}if(!_0x5df32f){logger['info']('['+[_0x1e37a7['toUpperCase']()]+_0x09de('0x28'));_0x1e88a7['userEmail']=_0xf5ef8[_0x09de('0x14')];for(_0x1985ba=0x0;_0x1985ba<_0x35c9ce[_0x09de('0x22')];_0x1985ba++){if(_0x35c9ce[_0x1985ba]['internalemailaddress']===_0xf5ef8[_0x09de('0x14')]){_0x1e88a7[_0x09de('0x27')]=_0x35c9ce[_0x1985ba][_0x09de('0x26')];}}}_0x244505(_0x1e88a7);})['catch'](function(_0x5a5680){_0x54b949(_0x5a5680[_0x09de('0x1c')]);});});}function createEndUser(_0x373fc6,_0x477ac0,_0x354727,_0x56f569,_0xe4dc97,_0x2ce022,_0x3be74a){return new Promise(function(_0x22ff86,_0xd01a9b){return getAuthToken(_0x477ac0,_0x354727,_0x2ce022)[_0x09de('0x17')](function(_0x31e3b6){var _0x214bc1=_0x2ce022['toLowerCase']()===_0x09de('0x29')?_0xe4dc97['destcalleridnum']:_0xe4dc97['calleridnum'];var _0x3453c2={'method':_0x09de('0x2a'),'uri':_0x56f569+_0x09de('0x2b'),'body':{'fullname':_0x214bc1,'firstname':_0x214bc1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x09de('0x2c')+_0x373fc6[_0x09de('0x27')]+')'},'headers':{'Authorization':_0x09de('0x2d')+_0x31e3b6,'OData-Version':_0x09de('0x2e')},'json':!![],'resolveWithFullResponse':!![]};_0x3453c2['body'][_0x3be74a]=_0x214bc1;return rp(_0x3453c2);})['then'](function(_0x4fbeb3){var _0x5a77d2=_0x4fbeb3[_0x09de('0x2f')][_0x09de('0x30')];var _0x5e31fa=_0x5a77d2[_0x09de('0x31')](_0x5a77d2['lastIndexOf']('(')+0x1,_0x5a77d2[_0x09de('0x32')](')'));_0x373fc6['enduserId']=_0x5e31fa;_0x22ff86(_0x373fc6);})[_0x09de('0x33')](function(_0x227d1a){_0xd01a9b(_0x227d1a['message']);});});}function getEndUser(_0x341073,_0x5e7dbf,_0x2ae756,_0x538b35,_0x3a1acf,_0x542fc6,_0x482293,_0x533804){var _0x4416ef=_0x542fc6[_0x09de('0x34')]()==='outbound'?_0x3a1acf[_0x09de('0x35')]:_0x3a1acf[_0x09de('0x36')];return getAuthToken(_0x5e7dbf,_0x2ae756,_0x542fc6)['then'](function(_0x1e455d){_0x533804=_0x533804?_0x533804:'telephone1';var _0xc6bfbd={'method':'GET','uri':_0x538b35+_0x09de('0x37')+_0x533804+_0x09de('0x38')+_0x533804+_0x09de('0x39')+_0x4416ef['replace']('+',_0x09de('0x3a'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1e455d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xc6bfbd);})[_0x09de('0x17')](function(_0x2047ea){var _0x4a501b=![];if(!_0x2047ea)return _0x4a501b;var _0x3a0660=_0x2047ea[_0x09de('0x3b')];for(var _0x3e83f8=0x0;_0x3e83f8<_0x3a0660[_0x09de('0x22')];_0x3e83f8++){if(_0x3a0660[_0x3e83f8][_0x533804]===_0x4416ef){_0x4a501b=!![];_0x341073[_0x09de('0x3c')]=_0x3a0660[_0x3e83f8]['contactid'];}}return _0x4a501b;})[_0x09de('0x17')](function(_0x3a151a){if(_0x3a151a)return _0x341073;if(_0x482293===_0x09de('0x3d')){logger[_0x09de('0x24')]('['+[_0x542fc6['toUpperCase']()]+_0x09de('0x3e'));return _0x341073;}return createEndUser(_0x341073,_0x5e7dbf,_0x2ae756,_0x538b35,_0x3a1acf,_0x542fc6,_0x533804)['then'](function(_0x54b725){logger['info']('['+[_0x542fc6[_0x09de('0x1a')]()]+_0x09de('0x3f'),_0x54b725[_0x09de('0x3c')]);return _0x54b725;});});}function getCustomFields(_0x223e49,_0x4bf51f,_0x3e2066){var _0x13cee7={};if(_0x223e49[_0x09de('0x22')]>0x0){_[_0x09de('0x40')](_0x223e49,function(_0x5f049b){if(_[_0x09de('0x41')]([_0x09de('0x42'),_0x09de('0x43')],_0x5f049b[_0x09de('0x44')])&&_0x5f049b[_0x09de('0x45')]&&!_0x5f049b['customField']){var _0x1afbe4=_0x5f049b['idField']['toLowerCase']();var _0x574cc9=_0x1afbe4[_0x09de('0x31')](0x0,_0x1afbe4['indexOf']('_'));var _0x1e7747=_0x1afbe4[_0x09de('0x31')](_0x1afbe4[_0x09de('0x46')]('_')+0x1);if(_0x574cc9===_0x3e2066){_0x13cee7[_0x1e7747]=_0x5f049b[_0x09de('0x47')];}}});}return _0x13cee7;}function getTicket(_0x2d8ece,_0x57513c,_0x124542,_0x4ee7ee,_0x13bb77,_0x8e42f9,_0x19d720){return new Promise(function(_0x5af21a,_0x5e8956){var _0x32e040;return getAuthToken(_0x57513c,_0x124542,_0x19d720)['then'](function(_0x31e3dd){if(_0x8e42f9[_0x09de('0x48')]===_0x09de('0x49')){_0x32e040={'method':_0x09de('0x2a'),'uri':_0x4ee7ee+_0x09de('0x4a'),'body':Object[_0x09de('0x4b')]({},{'title':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4d')],_0x13bb77,'\x20'),'description':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4e')],_0x13bb77,'\x0a'),'customerid_contact@odata.bind':_0x2d8ece[_0x09de('0x3c')]?_0x09de('0x4f')+_0x2d8ece['enduserId']+')':undefined,'ownerid@odata.bind':_0x09de('0x2c')+_0x2d8ece[_0x09de('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x8e42f9[_0x09de('0x50')],_0x13bb77,_0x8e42f9['ticketType'])),'headers':{'Authorization':_0x09de('0x2d')+_0x31e3dd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x8e42f9[_0x09de('0x48')]===_0x09de('0x51')){var _0x451f9e=_0x2d8ece[_0x09de('0x3c')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2d8ece[_0x09de('0x27')]+')','participationtypemask':_0x2d8ece['callDirection']===_0x09de('0x52')?0x2:0x1},{'partyid_contact@odata.bind':_0x09de('0x4f')+_0x2d8ece[_0x09de('0x3c')]+')','participationtypemask':_0x2d8ece[_0x09de('0x53')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2d8ece[_0x09de('0x27')]+')','participationtypemask':_0x2d8ece[_0x09de('0x53')]===_0x09de('0x52')?0x2:0x1}];_0x32e040={'method':_0x09de('0x2a'),'uri':_0x4ee7ee+'phonecalls','body':Object[_0x09de('0x4b')]({},{'subject':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4d')],_0x13bb77,'\x20'),'phonenumber':String(_0x13bb77[_0x09de('0x36')]),'description':intUtil[_0x09de('0x4c')](_0x8e42f9[_0x09de('0x4e')],_0x13bb77,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2d8ece[_0x09de('0x3c')]?_0x09de('0x4f')+_0x2d8ece['enduserId']+')':undefined,'ownerid@odata.bind':_0x09de('0x2c')+_0x2d8ece[_0x09de('0x27')]+')','directioncode':_0x2d8ece['callDirection']===_0x09de('0x52')?![]:!![],'phonecall_activity_parties':_0x451f9e},getCustomFields(_0x8e42f9['Fields'],_0x13bb77,_0x8e42f9[_0x09de('0x48')])),'headers':{'Authorization':'Bearer\x20'+_0x31e3dd,'OData-Version':_0x09de('0x2e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x32e040);})[_0x09de('0x17')](function(_0x2270c4){var _0x1243a8=_0x2270c4[_0x09de('0x2f')]['odata-entityid'];var _0x1e5cdb=_0x1243a8[_0x09de('0x31')](_0x1243a8['lastIndexOf']('(')+0x1,_0x1243a8[_0x09de('0x32')](')'));_0x2d8ece['ticketId']=_0x1e5cdb;_0x5af21a(_0x2d8ece);})[_0x09de('0x33')](function(_0x5ac2b8){_0x5e8956(_0x5ac2b8['message']);});});}function emit(_0x6dc7bc,_0x428a8b,_0x441f87,_0xb4babb){var _0x35ef1c={'uri':util['format'](_0x09de('0x54'),_0x6dc7bc,_0x441f87,_0xb4babb)};io['to'](util[_0x09de('0x55')](_0x09de('0x56'),_0x428a8b))['emit'](_0x09de('0x57'),_0x35ef1c);}exports['cs']=function(_0x19f947,_0x536069,_0x14141f,_0x2b751d,_0x206b89,_0x39369b,_0x483c7b,_0x4f52d7){var _0x2fa877={};_0x39369b[_0x09de('0xc')]=_0x39369b[_0x09de('0xb')]?intUtil[_0x09de('0x58')](_0x39369b[_0x09de('0xd')][_0x09de('0xe')]):intUtil[_0x09de('0x58')](_0x39369b[_0x09de('0xc')]);_0x39369b['serverUrl']=intUtil[_0x09de('0x58')](_0x39369b[_0x09de('0x59')]);_0x2fa877[_0x09de('0x53')]=_0x4f52d7==='queue'||_0x4f52d7===_0x09de('0x5a')?_0x09de('0x52'):_0x09de('0x29');var _0x73db=_0x39369b[_0x09de('0xb')]?util[_0x09de('0x55')](_0x09de('0x5b'),_0x39369b[_0x09de('0xd')][_0x09de('0xe')]):util[_0x09de('0x55')](_0x09de('0x5b'),_0x39369b['remoteUri']);var _0x1f6ed3=util[_0x09de('0x55')](_0x09de('0x5c'),_0x39369b[_0x09de('0xf')]);var _0x24bc11=util[_0x09de('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39369b[_0x09de('0x59')],_0x536069[_0x09de('0x5d')],md5(_0x536069[_0x09de('0x5d')]));if(_0x206b89&&_0x206b89[_0x09de('0x5e')]){logger[_0x09de('0x24')]('[QUEUE]','Recording\x20is\x20enabled!');_0x536069[_0x09de('0x5f')]=_0x24bc11;}else if(_0x483c7b&&_0x483c7b[_0x09de('0x60')]&&_0x483c7b[_0x09de('0x60')]!=='none'){logger[_0x09de('0x24')](_0x09de('0x61'),_0x09de('0x62'));_0x536069[_0x09de('0x5f')]=_0x24bc11;}else{_0x536069[_0x09de('0x5f')]='';}return getUser(_0x2fa877,_0x39369b,_0x2b751d,_0x1f6ed3,_0x73db,_0x4f52d7)[_0x09de('0x17')](function(_0x53ff70){logger[_0x09de('0x24')]('['+_0x4f52d7['toUpperCase']()+_0x09de('0x63'),_0x53ff70[_0x09de('0x27')]);logger['info']('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x64'),_0x53ff70[_0x09de('0x21')]);return getEndUser(_0x53ff70,_0x39369b,_0x1f6ed3,_0x73db,_0x536069,_0x4f52d7,_0x14141f[_0x09de('0x65')],_0x14141f[_0x09de('0x66')]);})['then'](function(_0x387001){logger[_0x09de('0x24')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x67'),_0x387001['enduserId']);logger['info']('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x68'),_0x536069['calleridnum']);return getTicket(_0x387001,_0x39369b,_0x1f6ed3,_0x73db,_0x536069,_0x14141f,_0x4f52d7);})[_0x09de('0x17')](function(_0x597f2a){logger[_0x09de('0x24')](util[_0x09de('0x55')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x69'),_0x14141f['ticketType'],_0x597f2a[_0x09de('0x6a')]));logger[_0x09de('0x24')](util[_0x09de('0x55')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x6b'),_0x4f52d7));if(_0x4f52d7!==_0x09de('0x5a')&&_0x14141f[_0x09de('0x6c')]){logger[_0x09de('0x24')]('['+_0x4f52d7[_0x09de('0x1a')]()+']',_0x09de('0x6d'));emit(_0x39369b[_0x09de('0xc')],_0x2b751d[_0x09de('0x6e')],_0x14141f[_0x09de('0x48')],_0x597f2a['ticketId']);}})[_0x09de('0x33')](function(_0x54113f){logger[_0x09de('0x19')]('['+_0x4f52d7[_0x09de('0x1a')]()+_0x09de('0x6f'),_0x54113f[_0x09de('0x1c')]);console['error'](_0x09de('0x70'),_0x54113f);});};
\ No newline at end of file
+var _0x6d20=['ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','dynamics365','defaults','redis','localhost','modernAuthentication','tenantId','CloudProvider','POST','remoteUri','password','clientSecret','access_token','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','Descriptions'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x6d20,0xfa));var _0x06d2=function(_0x508d16,_0x3e5c76){_0x508d16=_0x508d16-0x0;var _0x169e38=_0x6d20[_0x508d16];return _0x169e38;};'use strict';var _=require(_0x06d2('0x0'));var rp=require(_0x06d2('0x1'));var util=require(_0x06d2('0x2'));var intUtil=require(_0x06d2('0x3'));var md5=require(_0x06d2('0x4'));var Redis=require(_0x06d2('0x5'));var logger=require('../../../../config/logger')(_0x06d2('0x6'));var config=require('../../../../config/environment');config['redis']=_[_0x06d2('0x7')](config[_0x06d2('0x8')],{'host':_0x06d2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x06d2('0x8')]));function getAuthToken(_0x4e6440,_0xdbcacc,_0x5a39ea){if(_0x4e6440[_0x06d2('0xa')]){_0x4e6440['remoteUri']=_0x4e6440['CloudProvider']['data7'];_0x4e6440[_0x06d2('0xb')]=_0x4e6440[_0x06d2('0xc')]['data2'];return Promise['resolve'](_0x4e6440[_0x06d2('0xc')]['data5']);}var _0x4ccda8={'method':_0x06d2('0xd'),'uri':_0xdbcacc,'form':{'client_id':_0x4e6440['clientId'],'resource':_0x4e6440[_0x06d2('0xe')],'username':_0x4e6440['username'],'password':_0x4e6440[_0x06d2('0xf')],'grant_type':_0x06d2('0xf'),'client_secret':_0x4e6440[_0x06d2('0x10')]},'json':!![]};return rp(_0x4ccda8)['then'](function(_0x27ac7f){return _0x27ac7f[_0x06d2('0x11')];})['catch'](function(_0x5c048c){logger['error']('['+[_0x5a39ea[_0x06d2('0x12')]()]+_0x06d2('0x13'));return _0x5c048c['message'];});}function getUser(_0x157bdf,_0x3f3cfa,_0x187233,_0x2a099d,_0x498872,_0x2a4aaa){return new Promise(function(_0x34e712,_0x42fe71){return getAuthToken(_0x3f3cfa,_0x2a099d,_0x2a4aaa)[_0x06d2('0x14')](function(_0x227664){var _0x282e36={'method':_0x06d2('0x15'),'uri':_0x498872+_0x06d2('0x16'),'headers':{'Authorization':_0x06d2('0x17')+_0x227664,'OData-Version':_0x06d2('0x18')},'json':!![]};return rp(_0x282e36);})[_0x06d2('0x14')](function(_0x8e3906){var _0x247a26=_0x8e3906[_0x06d2('0x19')];var _0x41559f=![];var _0x10fda8=null;if(!_[_0x06d2('0x1a')](_0x187233)){if(intUtil['validateEmail'](_0x187233['email'])){_0x157bdf[_0x06d2('0x1b')]=_0x187233['email'];for(_0x10fda8=0x0;_0x10fda8<_0x247a26[_0x06d2('0x1c')];_0x10fda8++){if(_0x247a26[_0x10fda8][_0x06d2('0x1d')]===_0x187233['email']&&!_0x247a26[_0x10fda8]['isdisabled']){_0x41559f=!![];logger[_0x06d2('0x1e')]('['+[_0x2a4aaa[_0x06d2('0x12')]()]+_0x06d2('0x1f')+_0x247a26[_0x10fda8][_0x06d2('0x20')]+'!');_0x157bdf[_0x06d2('0x21')]=_0x247a26[_0x10fda8][_0x06d2('0x20')];}}}}if(!_0x41559f){logger[_0x06d2('0x1e')]('['+[_0x2a4aaa[_0x06d2('0x12')]()]+_0x06d2('0x22'));_0x157bdf[_0x06d2('0x1b')]=_0x3f3cfa[_0x06d2('0x23')];for(_0x10fda8=0x0;_0x10fda8<_0x247a26[_0x06d2('0x1c')];_0x10fda8++){if(_0x247a26[_0x10fda8][_0x06d2('0x1d')]===_0x3f3cfa['username']){_0x157bdf[_0x06d2('0x21')]=_0x247a26[_0x10fda8]['systemuserid'];}}}_0x34e712(_0x157bdf);})[_0x06d2('0x24')](function(_0x5ebae2){_0x42fe71(_0x5ebae2[_0x06d2('0x25')]);});});}function createEndUser(_0x2d0adc,_0x2f634e,_0x1a458f,_0x244dcd,_0x53f683,_0x164b29,_0xebbd87){return new Promise(function(_0xf15005,_0x5f080a){return getAuthToken(_0x2f634e,_0x1a458f,_0x164b29)[_0x06d2('0x14')](function(_0x425a19){var _0x4a8c6d=_0x164b29[_0x06d2('0x26')]()===_0x06d2('0x27')?_0x53f683[_0x06d2('0x28')]:_0x53f683[_0x06d2('0x29')];var _0x4edf96={'method':'POST','uri':_0x244dcd+_0x06d2('0x2a'),'body':{'fullname':_0x4a8c6d,'firstname':_0x4a8c6d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x06d2('0x2b')+_0x2d0adc['userId']+')'},'headers':{'Authorization':_0x06d2('0x17')+_0x425a19,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x4edf96[_0x06d2('0x2c')][_0xebbd87]=_0x4a8c6d;return rp(_0x4edf96);})[_0x06d2('0x14')](function(_0x4bbedf){var _0x3ffc6c=_0x4bbedf[_0x06d2('0x2d')][_0x06d2('0x2e')];var _0x1258ac=_0x3ffc6c[_0x06d2('0x2f')](_0x3ffc6c[_0x06d2('0x30')]('(')+0x1,_0x3ffc6c[_0x06d2('0x30')](')'));_0x2d0adc[_0x06d2('0x31')]=_0x1258ac;_0xf15005(_0x2d0adc);})[_0x06d2('0x24')](function(_0x2f16ef){_0x5f080a(_0x2f16ef[_0x06d2('0x25')]);});});}function getEndUser(_0xe4fb00,_0x20b8ec,_0x42abdd,_0x5f2012,_0x59ed8a,_0x3cb30c,_0x12c9ad,_0x4eb0b5){var _0x461f54=_0x3cb30c[_0x06d2('0x26')]()===_0x06d2('0x27')?_0x59ed8a[_0x06d2('0x28')]:_0x59ed8a[_0x06d2('0x29')];return getAuthToken(_0x20b8ec,_0x42abdd,_0x3cb30c)[_0x06d2('0x14')](function(_0x522708){_0x4eb0b5=_0x4eb0b5?_0x4eb0b5:_0x06d2('0x32');var _0x2fb96e={'method':_0x06d2('0x15'),'uri':_0x5f2012+_0x06d2('0x33')+_0x4eb0b5+_0x06d2('0x34')+_0x4eb0b5+_0x06d2('0x35')+_0x461f54[_0x06d2('0x36')]('+',_0x06d2('0x37'))+'\x27','headers':{'Authorization':_0x06d2('0x17')+_0x522708,'If-None-Match':null,'OData-Version':_0x06d2('0x18')},'json':!![]};return rp(_0x2fb96e);})[_0x06d2('0x14')](function(_0x46065a){var _0x4f191e=![];if(!_0x46065a)return _0x4f191e;var _0x6db407=_0x46065a[_0x06d2('0x19')];for(var _0x190f85=0x0;_0x190f85<_0x6db407[_0x06d2('0x1c')];_0x190f85++){if(_0x6db407[_0x190f85][_0x4eb0b5]===_0x461f54){_0x4f191e=!![];_0xe4fb00['enduserId']=_0x6db407[_0x190f85][_0x06d2('0x38')];}}return _0x4f191e;})[_0x06d2('0x14')](function(_0x2b6cbe){if(_0x2b6cbe)return _0xe4fb00;if(_0x12c9ad===_0x06d2('0x39')){logger['info']('['+[_0x3cb30c[_0x06d2('0x12')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0xe4fb00;}return createEndUser(_0xe4fb00,_0x20b8ec,_0x42abdd,_0x5f2012,_0x59ed8a,_0x3cb30c,_0x4eb0b5)[_0x06d2('0x14')](function(_0x250f14){logger[_0x06d2('0x1e')]('['+[_0x3cb30c['toUpperCase']()]+']\x20Enduser\x20created!',_0x250f14['enduserId']);return _0x250f14;});});}function getCustomFields(_0xf6774e,_0x58972a,_0x4d90de){var _0x389d11={};if(_0xf6774e[_0x06d2('0x1c')]>0x0){_[_0x06d2('0x3a')](_0xf6774e,function(_0x5ae0ea){if(_[_0x06d2('0x3b')](['string',_0x06d2('0x3c')],_0x5ae0ea[_0x06d2('0x3d')])&&_0x5ae0ea[_0x06d2('0x3e')]&&!_0x5ae0ea[_0x06d2('0x3f')]){var _0x35a0d8=_0x5ae0ea[_0x06d2('0x40')][_0x06d2('0x26')]();var _0xfac2a7=_0x35a0d8[_0x06d2('0x2f')](0x0,_0x35a0d8[_0x06d2('0x41')]('_'));var _0x5441ac=_0x35a0d8['substring'](_0x35a0d8['indexOf']('_')+0x1);if(_0xfac2a7===_0x4d90de){_0x389d11[_0x5441ac]=_0x5ae0ea[_0x06d2('0x42')];}}});}return _0x389d11;}function getTicket(_0xef4adc,_0x441a63,_0x298720,_0x4c7705,_0x515cc1,_0x2db801,_0x42ade9){return new Promise(function(_0x4ab083,_0x13cd20){var _0x574a85;return getAuthToken(_0x441a63,_0x298720,_0x42ade9)[_0x06d2('0x14')](function(_0x330e1b){if(_0x2db801[_0x06d2('0x43')]===_0x06d2('0x44')){_0x574a85={'method':'POST','uri':_0x4c7705+_0x06d2('0x45'),'body':Object[_0x06d2('0x46')]({},{'title':intUtil[_0x06d2('0x47')](_0x2db801[_0x06d2('0x48')],_0x515cc1,'\x20'),'description':intUtil[_0x06d2('0x47')](_0x2db801['Descriptions'],_0x515cc1,'\x0a'),'customerid_contact@odata.bind':_0xef4adc[_0x06d2('0x31')]?_0x06d2('0x49')+_0xef4adc[_0x06d2('0x31')]+')':undefined,'ownerid@odata.bind':_0x06d2('0x2b')+_0xef4adc[_0x06d2('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x2db801[_0x06d2('0x4a')],_0x515cc1,_0x2db801[_0x06d2('0x43')])),'headers':{'Authorization':_0x06d2('0x17')+_0x330e1b,'OData-Version':_0x06d2('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2db801['ticketType']===_0x06d2('0x4b')){var _0xa1e9f2=_0xef4adc[_0x06d2('0x31')]?[{'partyid_systemuser@odata.bind':_0x06d2('0x2b')+_0xef4adc[_0x06d2('0x21')]+')','participationtypemask':_0xef4adc['callDirection']===_0x06d2('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xef4adc[_0x06d2('0x31')]+')','participationtypemask':_0xef4adc[_0x06d2('0x4d')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0xef4adc[_0x06d2('0x21')]+')','participationtypemask':_0xef4adc[_0x06d2('0x4d')]===_0x06d2('0x4c')?0x2:0x1}];_0x574a85={'method':_0x06d2('0xd'),'uri':_0x4c7705+_0x06d2('0x4e'),'body':Object[_0x06d2('0x46')]({},{'subject':intUtil['getString'](_0x2db801[_0x06d2('0x48')],_0x515cc1,'\x20'),'phonenumber':String(_0x515cc1[_0x06d2('0x29')]),'description':intUtil[_0x06d2('0x47')](_0x2db801[_0x06d2('0x4f')],_0x515cc1,'\x0a'),'regardingobjectid_contact@odata.bind':_0xef4adc[_0x06d2('0x31')]?_0x06d2('0x49')+_0xef4adc[_0x06d2('0x31')]+')':undefined,'ownerid@odata.bind':_0x06d2('0x2b')+_0xef4adc[_0x06d2('0x21')]+')','directioncode':_0xef4adc[_0x06d2('0x4d')]===_0x06d2('0x4c')?![]:!![],'phonecall_activity_parties':_0xa1e9f2},getCustomFields(_0x2db801[_0x06d2('0x4a')],_0x515cc1,_0x2db801['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x330e1b,'OData-Version':_0x06d2('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x574a85);})['then'](function(_0x30b7a7){var _0x24c9b5=_0x30b7a7[_0x06d2('0x2d')][_0x06d2('0x2e')];var _0x56f24f=_0x24c9b5[_0x06d2('0x2f')](_0x24c9b5[_0x06d2('0x30')]('(')+0x1,_0x24c9b5[_0x06d2('0x30')](')'));_0xef4adc[_0x06d2('0x50')]=_0x56f24f;_0x4ab083(_0xef4adc);})['catch'](function(_0x4a8aa5){_0x13cd20(_0x4a8aa5[_0x06d2('0x25')]);});});}function emit(_0x405cc8,_0x2ee4a0,_0x28de88,_0x54e41f){var _0x8b84b7={'uri':util['format'](_0x06d2('0x51'),_0x405cc8,_0x28de88,_0x54e41f)};io['to'](util[_0x06d2('0x52')](_0x06d2('0x53'),_0x2ee4a0))[_0x06d2('0x54')](_0x06d2('0x55'),_0x8b84b7);}exports['cs']=function(_0xe74cdf,_0x2c0e34,_0x44ac88,_0x13b3ee,_0x26382d,_0x3756b8,_0xbb5efc,_0x1f7db6){var _0x20e95b={};_0x3756b8[_0x06d2('0xe')]=_0x3756b8['modernAuthentication']?intUtil['stripTrailingSlash'](_0x3756b8['CloudProvider']['data7']):intUtil['stripTrailingSlash'](_0x3756b8[_0x06d2('0xe')]);_0x3756b8[_0x06d2('0x56')]=intUtil['stripTrailingSlash'](_0x3756b8[_0x06d2('0x56')]);_0x20e95b[_0x06d2('0x4d')]=_0x1f7db6===_0x06d2('0x4c')||_0x1f7db6==='unmanaged'?_0x06d2('0x4c'):_0x06d2('0x27');var _0x1c3f35=_0x3756b8[_0x06d2('0xa')]?util['format'](_0x06d2('0x57'),_0x3756b8[_0x06d2('0xc')]['data7']):util['format'](_0x06d2('0x57'),_0x3756b8[_0x06d2('0xe')]);var _0x37a816=util[_0x06d2('0x52')](_0x06d2('0x58'),_0x3756b8[_0x06d2('0xb')]);var _0x355095=util['format'](_0x06d2('0x59'),_0x3756b8[_0x06d2('0x56')],_0x2c0e34[_0x06d2('0x5a')],md5(_0x2c0e34['uniqueid']));if(_0x26382d&&_0x26382d[_0x06d2('0x5b')]){logger[_0x06d2('0x1e')](_0x06d2('0x5c'),_0x06d2('0x5d'));_0x2c0e34[_0x06d2('0x5e')]=_0x355095;}else if(_0xbb5efc&&_0xbb5efc[_0x06d2('0x5f')]&&_0xbb5efc['recordingFormat']!==_0x06d2('0x60')){logger[_0x06d2('0x1e')](_0x06d2('0x61'),'Recording\x20is\x20enabled!');_0x2c0e34['recordingURL']=_0x355095;}else{_0x2c0e34[_0x06d2('0x5e')]='';}return getUser(_0x20e95b,_0x3756b8,_0x13b3ee,_0x37a816,_0x1c3f35,_0x1f7db6)['then'](function(_0x36b4c9){logger[_0x06d2('0x1e')]('['+_0x1f7db6['toUpperCase']()+_0x06d2('0x62'),_0x36b4c9['userId']);logger[_0x06d2('0x1e')]('['+_0x1f7db6['toUpperCase']()+_0x06d2('0x63'),_0x36b4c9['userEmail']);return getEndUser(_0x36b4c9,_0x3756b8,_0x37a816,_0x1c3f35,_0x2c0e34,_0x1f7db6,_0x44ac88['moduleCreate'],_0x44ac88['additionalSearchContact']);})[_0x06d2('0x14')](function(_0x3b0e0){logger[_0x06d2('0x1e')]('['+_0x1f7db6[_0x06d2('0x12')]()+_0x06d2('0x64'),_0x3b0e0[_0x06d2('0x31')]);logger[_0x06d2('0x1e')]('['+_0x1f7db6[_0x06d2('0x12')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x2c0e34[_0x06d2('0x29')]);return getTicket(_0x3b0e0,_0x3756b8,_0x37a816,_0x1c3f35,_0x2c0e34,_0x44ac88,_0x1f7db6);})['then'](function(_0x549d75){logger[_0x06d2('0x1e')](util['format']('['+_0x1f7db6[_0x06d2('0x12')]()+_0x06d2('0x65'),_0x44ac88[_0x06d2('0x43')],_0x549d75[_0x06d2('0x50')]));logger['info'](util[_0x06d2('0x52')]('['+_0x1f7db6[_0x06d2('0x12')]()+_0x06d2('0x66'),_0x1f7db6));if(_0x1f7db6!==_0x06d2('0x67')&&_0x44ac88[_0x06d2('0x68')]){logger[_0x06d2('0x1e')]('['+_0x1f7db6[_0x06d2('0x12')]()+']',_0x06d2('0x69'));emit(_0x3756b8['remoteUri'],_0x13b3ee[_0x06d2('0x6a')],_0x44ac88[_0x06d2('0x43')],_0x549d75[_0x06d2('0x50')]);}})['catch'](function(_0xbcdb9a){logger[_0x06d2('0x6b')]('['+_0x1f7db6[_0x06d2('0x12')]()+_0x06d2('0x6c'),_0xbcdb9a['message']);console[_0x06d2('0x6b')](_0x06d2('0x6d'),_0xbcdb9a);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x955c=['push','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','unmanaged','lastevent','The\x20User\x20ID\x20is:','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridnum','Subjects','getString','<br>','mapValues','%s/api/v2/tickets','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','find','POST','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','nameField','customField','toLowerCase','toString','includes','type','idField','content','variable','custom_fields','variableName','customVariable','Variable','name'];(function(_0x3e1175,_0x443838){var _0x2d609d=function(_0x30377b){while(--_0x30377b){_0x3e1175['push'](_0x3e1175['shift']());}};_0x2d609d(++_0x443838);}(_0x955c,0x1ee));var _0xc955=function(_0x259c0f,_0x1c8c1f){_0x259c0f=_0x259c0f-0x0;var _0xa73514=_0x955c[_0x259c0f];return _0xa73514;};'use strict';var _=require(_0xc955('0x0'));var rp=require(_0xc955('0x1'));var md5=require('md5');var util=require(_0xc955('0x2'));var Redis=require(_0xc955('0x3'));var intUtil=require(_0xc955('0x4'));var config=require(_0xc955('0x5'));var logger=require(_0xc955('0x6'))(_0xc955('0x7'));config[_0xc955('0x8')]=_[_0xc955('0x9')](config['redis'],{'host':_0xc955('0xa'),'port':0x18eb});var io=require(_0xc955('0xb'))(new Redis(config[_0xc955('0x8')]));var headers={'Content-Type':_0xc955('0xc'),'Accept':_0xc955('0xc')};function emit(_0x1b7b18,_0x41356b,_0x249b4a){io['to'](_0x1b7b18)[_0xc955('0xd')](_0x41356b,_0x249b4a);}function getTicket(_0x3ef396,_0x5909cc,_0x578afc,_0x3486a1,_0x4427fa){logger[_0xc955('0xe')]('Creating\x20new\x20ticket...');var _0x4ea14a=_[_0xc955('0xf')]({'responder_id':_0x5909cc['id'],'requester_id':_0x578afc['id'],'name':util[_0xc955('0x10')]('Caller\x20-\x20%s',_0x4427fa['calleridname']),'phone':_0x4427fa[_0xc955('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3486a1[_0xc955('0x12')],_0x4427fa,'\x20'),'description':intUtil[_0xc955('0x13')](_0x3486a1['Descriptions'],_0x4427fa,_0xc955('0x14')),'tags':getTags(_0x3486a1['Tags'],'name')},getCustomFields(_0x3486a1['Fields'],_0x4427fa));_0x4ea14a['custom_fields']=_[_0xc955('0x15')](_['keyBy'](_0x4ea14a['custom_fields'],'id'),'value');return request({'uri':util[_0xc955('0x10')](_0xc955('0x16'),_0x3ef396['remoteUri']),'method':'POST','body':_0x4ea14a})['then'](function(_0x1dc39f){logger[_0xc955('0xe')](_0xc955('0x17'));return _0x1dc39f;});}function getUser(_0x3371bb,_0x39c562){if(intUtil[_0xc955('0x18')](_0x39c562)){return request({'uri':util[_0xc955('0x10')](_0xc955('0x19'),_0x3371bb[_0xc955('0x1a')]),'qs':{'email':_0x39c562}})['then'](function(_0x592c90){if(_0x592c90[_0xc955('0x1b')]){logger[_0xc955('0xe')]('Agent\x20found!');return _['find'](_0x592c90,function(_0xe137c9){return _0xe137c9[_0xc955('0x1c')][_0xc955('0x1d')]===_0x39c562;});}else{logger[_0xc955('0xe')](_0xc955('0x1e'));return request({'uri':util['format'](_0xc955('0x1f'),_0x3371bb[_0xc955('0x1a')])})[_0xc955('0x20')](function(_0x57552c){logger[_0xc955('0xe')](_0xc955('0x21'));return _0x57552c;});}});}else{logger['info'](_0xc955('0x22'));return request({'uri':util[_0xc955('0x10')](_0xc955('0x1f'),_0x3371bb[_0xc955('0x1a')])})[_0xc955('0x20')](function(_0x27e38b){logger[_0xc955('0xe')](_0xc955('0x21'));return _0x27e38b;});}}function getEndUser(_0xf70d73,_0x5068c0,_0xdf4940){logger[_0xc955('0xe')]('Searching\x20enduser\x20with\x20phone',_0xdf4940);return request({'uri':util[_0xc955('0x10')](_0xc955('0x23'),_0xf70d73[_0xc955('0x1a')]),'qs':{'phone':_0xdf4940}})[_0xc955('0x20')](function(_0x394c4b){if(_0x394c4b[_0xc955('0x1b')]){logger[_0xc955('0xe')](_0xc955('0x24'));return _[_0xc955('0x25')](_0x394c4b,{'phone':_0xdf4940});}else{logger[_0xc955('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc955('0x10')](_0xc955('0x23'),_0xf70d73['remoteUri']),'method':_0xc955('0x26'),'body':{'name':_0x5068c0,'phone':_0xdf4940}})[_0xc955('0x20')](function(_0x573328){logger['info'](_0xc955('0x27'));return _0x573328;});}});}function getAuth(_0x2a5973){return util[_0xc955('0x10')]('Basic\x20%s',new Buffer(_0x2a5973[_0xc955('0x28')]+':X')['toString'](_0xc955('0x29')));}function request(_0x16aafb){logger[_0xc955('0x2a')](_0xc955('0x2b'),JSON[_0xc955('0x2c')](_0x16aafb));return rp(_[_0xc955('0x9')](_0x16aafb,{'method':_0xc955('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x5be30e,_0x317093){var _0x3b7a73=[];if(_0x5be30e&&_0x5be30e[_0xc955('0x1b')]>0x0){_0x3b7a73=_[_0xc955('0x2e')](_0x5be30e,_0x317093);}return _0x3b7a73;}function getCustomFields(_0xe5d7dd,_0x2d574c){var _0x55bdb2=[];var _0x1613a9={'custom_fields':[]};if(_0xe5d7dd[_0xc955('0x1b')]>0x0){_[_0xc955('0x2f')](_0xe5d7dd,function(_0x4a675e){if(_['includes']([_0xc955('0x30'),_0xc955('0x31')],_0x4a675e['type'])&&_0x4a675e[_0xc955('0x32')]&&!_0x4a675e[_0xc955('0x33')]){_0x1613a9[_0x4a675e[_0xc955('0x32')][_0xc955('0x34')]()]=_0x4a675e['content'][_0xc955('0x35')]();}else if(_[_0xc955('0x36')](['string',_0xc955('0x31')],_0x4a675e[_0xc955('0x37')])&&_0x4a675e[_0xc955('0x38')]&&_0x4a675e[_0xc955('0x33')]){_0x1613a9['custom_fields']['push']({'id':_0x4a675e['idField'],'value':_0x4a675e[_0xc955('0x39')]['toString']()});}else if(_0x4a675e[_0xc955('0x37')]===_0xc955('0x3a')&&_0x4a675e['variableName']&&_0x4a675e['idField']&&_0x4a675e['customField']){_0x2d574c[_0x4a675e['variableName']]&&_0x1613a9[_0xc955('0x3b')]['push']({'id':_0x4a675e[_0xc955('0x38')],'value':_0x2d574c[_0x4a675e[_0xc955('0x3c')]]['toString']()});}else if(_0x4a675e[_0xc955('0x37')]===_0xc955('0x3d')&&_0x4a675e[_0xc955('0x3e')]&&_0x4a675e[_0xc955('0x3e')][_0xc955('0x3f')]&&_0x4a675e[_0xc955('0x38')]&&_0x4a675e[_0xc955('0x33')]){_0x2d574c[_0x4a675e[_0xc955('0x3e')][_0xc955('0x3f')]['toLowerCase']()]&&_0x1613a9['custom_fields'][_0xc955('0x40')]({'id':_0x4a675e['idField'],'value':_0x2d574c[_0x4a675e[_0xc955('0x3e')][_0xc955('0x3f')][_0xc955('0x34')]()][_0xc955('0x35')]()});}});}return _0x1613a9;}exports[_0xc955('0x41')]=function(_0x358ac3,_0xc48f06,_0x2fe5cc,_0x2f1ab5,_0x23051a,_0x4af230){var _0x353304,_0x599db7;_0x4af230['remoteUri']=intUtil['stripTrailingSlash'](_0x4af230[_0xc955('0x1a')]);_0x4af230[_0xc955('0x42')]=intUtil[_0xc955('0x43')](_0x4af230[_0xc955('0x42')]);if(_0x23051a&&_0x23051a[_0xc955('0x44')]){logger['info'](_0xc955('0x45'),_0xc955('0x46'));_0xc48f06['recordingURL']=util[_0xc955('0x10')](_0xc955('0x47'),_0x4af230['serverUrl'],_0xc48f06[_0xc955('0x48')],md5(_0xc48f06[_0xc955('0x48')]));}else{_0xc48f06[_0xc955('0x49')]='';}headers['Authorization']=getAuth(_0x4af230);return getUser(_0x4af230,_0x2f1ab5[_0xc955('0x1d')])[_0xc955('0x20')](function(_0x4b997a){_0x353304=_0x4b997a;logger[_0xc955('0xe')]('The\x20User\x20ID\x20is:',_0x353304['id']);return getEndUser(_0x4af230,_0xc48f06[_0xc955('0x4a')],_0xc48f06[_0xc955('0x11')]);})[_0xc955('0x20')](function(_0x32b39b){_0x599db7=_0x32b39b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x599db7['id']);return getTicket(_0x4af230,_0x353304,_0x599db7,_0x2fe5cc,_0xc48f06);})['then'](function(_0x2a9f8f){if(_0x2a9f8f&&_0x2a9f8f['id']){logger[_0xc955('0xe')](_0xc955('0x17'));logger[_0xc955('0xe')](_0xc955('0x4b'),_0x2a9f8f['id']);logger[_0xc955('0xe')]('[QUEUE]',_0xc955('0x4c'));emit(util['format']('user:%s',_0x2f1ab5[_0xc955('0x3f')]),_0xc955('0x4d'),{'uri':util[_0xc955('0x10')](_0xc955('0x4e'),_0x4af230[_0xc955('0x1a')],_0x2a9f8f['id'])});}})[_0xc955('0x4f')](function(_0x51971d){logger[_0xc955('0x50')](_0xc955('0x45'),JSON[_0xc955('0x2c')](_0x51971d));});};exports[_0xc955('0x51')]=function(_0x5555ba,_0x28ea4a,_0x459eb4,_0xaf03ec,_0x44af0a,_0x4d3355,_0x30acf4){var _0x1132ca,_0x12d431;_0x4d3355[_0xc955('0x1a')]=intUtil['stripTrailingSlash'](_0x4d3355[_0xc955('0x1a')]);_0x4d3355[_0xc955('0x42')]=intUtil[_0xc955('0x43')](_0x4d3355[_0xc955('0x42')]);if(_0x30acf4&&_0x30acf4[_0xc955('0x52')]&&_0x30acf4['recordingFormat']!==_0xc955('0x53')){logger[_0xc955('0xe')](_0xc955('0x54'),_0xc955('0x46'));_0x28ea4a[_0xc955('0x49')]=util[_0xc955('0x10')](_0xc955('0x47'),_0x4d3355[_0xc955('0x42')],_0x28ea4a[_0xc955('0x48')],md5(_0x28ea4a[_0xc955('0x48')]));}headers[_0xc955('0x55')]=getAuth(_0x4d3355);return getUser(_0x4d3355,_0xaf03ec[_0xc955('0x1d')])[_0xc955('0x20')](function(_0x400374){_0x1132ca=_0x400374;logger[_0xc955('0xe')]('The\x20User\x20ID\x20is:',_0x1132ca['id']);return getEndUser(_0x4d3355,_0x28ea4a[_0xc955('0x56')],_0x28ea4a[_0xc955('0x57')]);})[_0xc955('0x20')](function(_0x26799f){_0x12d431=_0x26799f;logger['info'](_0xc955('0x58'),_0x12d431['id']);return getTicket(_0x4d3355,_0x1132ca,_0x12d431,_0x459eb4,_0x28ea4a);})['then'](function(_0x3dd3db){if(_0x3dd3db&&_0x3dd3db['id']){logger[_0xc955('0xe')](_0xc955('0x17'));logger[_0xc955('0xe')](_0xc955('0x4b'),_0x3dd3db['id']);logger[_0xc955('0xe')](_0xc955('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc955('0x10')]('user:%s',_0xaf03ec[_0xc955('0x3f')]),_0xc955('0x4d'),{'uri':util[_0xc955('0x10')]('%s/helpdesk/tickets/%d',_0x4d3355[_0xc955('0x1a')],_0x3dd3db['id'])});}})[_0xc955('0x4f')](function(_0x3df831){logger[_0xc955('0x50')](_0xc955('0x54'),JSON[_0xc955('0x2c')](_0x3df831));});};exports[_0xc955('0x59')]=function(_0x53173d,_0x532514,_0x316117,_0x21999c,_0xf0c734,_0x55e639){var _0x41605e,_0x89497;_0x55e639['remoteUri']=intUtil[_0xc955('0x43')](_0x55e639['remoteUri']);_0x55e639[_0xc955('0x42')]=intUtil[_0xc955('0x43')](_0x55e639[_0xc955('0x42')]);if(_0xf0c734&&_0xf0c734[_0xc955('0x44')]){logger[_0xc955('0xe')]('['+_0x532514[_0xc955('0x5a')]['toUpperCase']()+']',_0xc955('0x46'));_0x532514['recordingURL']=util['format'](_0xc955('0x47'),_0x55e639[_0xc955('0x42')],_0x532514[_0xc955('0x48')],md5(_0x532514[_0xc955('0x48')]));}else{_0x532514['recordingURL']='';}headers[_0xc955('0x55')]=getAuth(_0x55e639);return getUser(_0x55e639,'')[_0xc955('0x20')](function(_0x47dce4){_0x41605e=_0x47dce4;logger[_0xc955('0xe')](_0xc955('0x5b'),_0x41605e['id']);return getEndUser(_0x55e639,_0x532514[_0xc955('0x4a')],_0x532514[_0xc955('0x11')]);})['then'](function(_0x325278){_0x89497=_0x325278;logger[_0xc955('0xe')](_0xc955('0x58'),_0x89497['id']);return getTicket(_0x55e639,_0x41605e,_0x89497,_0x316117,_0x532514);})[_0xc955('0x20')](function(_0xca8caf){if(_0xca8caf){logger[_0xc955('0xe')]('Ticket\x20created!');logger[_0xc955('0xe')](_0xc955('0x4b'),_0xca8caf['id']);}})[_0xc955('0x4f')](function(_0x52b378){logger['error']('['+_0x532514[_0xc955('0x5a')][_0xc955('0x5c')]()+']',JSON[_0xc955('0x2c')](_0x52b378));});};
\ No newline at end of file
+var _0xf82b=['idField','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','destcalleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','monitor_format','toUpperCase','lastevent','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','emit','info','merge','format','calleridname','Subjects','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','type','nameField','customField','toLowerCase','content','string'];(function(_0x6e13e3,_0xfd3718){var _0x4002ce=function(_0x26f7ed){while(--_0x26f7ed){_0x6e13e3['push'](_0x6e13e3['shift']());}};_0x4002ce(++_0xfd3718);}(_0xf82b,0xd9));var _0xbf82=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf82b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbf82('0x0'));var rp=require('request-promise');var md5=require(_0xbf82('0x1'));var util=require(_0xbf82('0x2'));var Redis=require(_0xbf82('0x3'));var intUtil=require(_0xbf82('0x4'));var config=require(_0xbf82('0x5'));var logger=require(_0xbf82('0x6'))('freshdesk');config[_0xbf82('0x7')]=_[_0xbf82('0x8')](config[_0xbf82('0x7')],{'host':_0xbf82('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xbf82('0xa')};function emit(_0xcd9c3,_0x9013c,_0x1cf13b){io['to'](_0xcd9c3)[_0xbf82('0xb')](_0x9013c,_0x1cf13b);}function getTicket(_0xbcfd44,_0x1af678,_0x52802f,_0x4daa84,_0x1f8d4d){logger[_0xbf82('0xc')]('Creating\x20new\x20ticket...');var _0x4cf50d=_[_0xbf82('0xd')]({'responder_id':_0x1af678['id'],'requester_id':_0x52802f['id'],'name':util[_0xbf82('0xe')]('Caller\x20-\x20%s',_0x1f8d4d[_0xbf82('0xf')]),'phone':_0x1f8d4d['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x4daa84[_0xbf82('0x10')],_0x1f8d4d,'\x20'),'description':intUtil[_0xbf82('0x11')](_0x4daa84[_0xbf82('0x12')],_0x1f8d4d,'<br>'),'tags':getTags(_0x4daa84[_0xbf82('0x13')],_0xbf82('0x14'))},getCustomFields(_0x4daa84[_0xbf82('0x15')],_0x1f8d4d));_0x4cf50d[_0xbf82('0x16')]=_[_0xbf82('0x17')](_['keyBy'](_0x4cf50d[_0xbf82('0x16')],'id'),'value');return request({'uri':util[_0xbf82('0xe')](_0xbf82('0x18'),_0xbcfd44['remoteUri']),'method':_0xbf82('0x19'),'body':_0x4cf50d})[_0xbf82('0x1a')](function(_0x2d36a5){logger[_0xbf82('0xc')](_0xbf82('0x1b'));return _0x2d36a5;});}function getUser(_0x36fd59,_0xc0c094){if(intUtil[_0xbf82('0x1c')](_0xc0c094)){return request({'uri':util[_0xbf82('0xe')](_0xbf82('0x1d'),_0x36fd59[_0xbf82('0x1e')]),'qs':{'email':_0xc0c094}})['then'](function(_0x29dc84){if(_0x29dc84[_0xbf82('0x1f')]){logger[_0xbf82('0xc')]('Agent\x20found!');return _[_0xbf82('0x20')](_0x29dc84,function(_0x3d2728){return _0x3d2728[_0xbf82('0x21')]['email']===_0xc0c094;});}else{logger[_0xbf82('0xc')](_0xbf82('0x22'));return request({'uri':util[_0xbf82('0xe')](_0xbf82('0x23'),_0x36fd59[_0xbf82('0x1e')])})[_0xbf82('0x1a')](function(_0x27563f){logger['info'](_0xbf82('0x24'));return _0x27563f;});}});}else{logger[_0xbf82('0xc')](_0xbf82('0x25'));return request({'uri':util[_0xbf82('0xe')](_0xbf82('0x23'),_0x36fd59['remoteUri'])})[_0xbf82('0x1a')](function(_0x2d2da5){logger[_0xbf82('0xc')](_0xbf82('0x24'));return _0x2d2da5;});}}function getEndUser(_0x1e4f43,_0x371321,_0x5568e8){logger[_0xbf82('0xc')](_0xbf82('0x26'),_0x5568e8);return request({'uri':util[_0xbf82('0xe')](_0xbf82('0x27'),_0x1e4f43[_0xbf82('0x1e')]),'qs':{'phone':_0x5568e8}})[_0xbf82('0x1a')](function(_0x15075b){if(_0x15075b[_0xbf82('0x1f')]){logger[_0xbf82('0xc')](_0xbf82('0x28'));return _['find'](_0x15075b,{'phone':_0x5568e8});}else{logger[_0xbf82('0xc')](_0xbf82('0x29'));return request({'uri':util[_0xbf82('0xe')](_0xbf82('0x27'),_0x1e4f43[_0xbf82('0x1e')]),'method':_0xbf82('0x19'),'body':{'name':_0x371321,'phone':_0x5568e8}})[_0xbf82('0x1a')](function(_0x469a56){logger[_0xbf82('0xc')](_0xbf82('0x2a'));return _0x469a56;});}});}function getAuth(_0x1e69de){return util[_0xbf82('0xe')](_0xbf82('0x2b'),new Buffer(_0x1e69de[_0xbf82('0x2c')]+':X')[_0xbf82('0x2d')](_0xbf82('0x2e')));}function request(_0xee1709){logger['debug'](_0xbf82('0x2f'),JSON[_0xbf82('0x30')](_0xee1709));return rp(_['defaults'](_0xee1709,{'method':_0xbf82('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x6018a4,_0x223667){var _0x3c9e43=[];if(_0x6018a4&&_0x6018a4['length']>0x0){_0x3c9e43=_[_0xbf82('0x32')](_0x6018a4,_0x223667);}return _0x3c9e43;}function getCustomFields(_0x655d3a,_0x4278f4){var _0x34dff4=[];var _0x2d8cb2={'custom_fields':[]};if(_0x655d3a[_0xbf82('0x1f')]>0x0){_[_0xbf82('0x33')](_0x655d3a,function(_0x318c39){if(_[_0xbf82('0x34')](['string','picklist'],_0x318c39[_0xbf82('0x35')])&&_0x318c39[_0xbf82('0x36')]&&!_0x318c39[_0xbf82('0x37')]){_0x2d8cb2[_0x318c39[_0xbf82('0x36')][_0xbf82('0x38')]()]=_0x318c39[_0xbf82('0x39')][_0xbf82('0x2d')]();}else if(_[_0xbf82('0x34')]([_0xbf82('0x3a'),'picklist'],_0x318c39[_0xbf82('0x35')])&&_0x318c39[_0xbf82('0x3b')]&&_0x318c39[_0xbf82('0x37')]){_0x2d8cb2[_0xbf82('0x16')]['push']({'id':_0x318c39[_0xbf82('0x3b')],'value':_0x318c39[_0xbf82('0x39')]['toString']()});}else if(_0x318c39[_0xbf82('0x35')]==='variable'&&_0x318c39[_0xbf82('0x3c')]&&_0x318c39[_0xbf82('0x3b')]&&_0x318c39[_0xbf82('0x37')]){_0x4278f4[_0x318c39[_0xbf82('0x3c')]]&&_0x2d8cb2['custom_fields'][_0xbf82('0x3d')]({'id':_0x318c39[_0xbf82('0x3b')],'value':_0x4278f4[_0x318c39['variableName']][_0xbf82('0x2d')]()});}else if(_0x318c39['type']===_0xbf82('0x3e')&&_0x318c39['Variable']&&_0x318c39[_0xbf82('0x3f')][_0xbf82('0x14')]&&_0x318c39[_0xbf82('0x3b')]&&_0x318c39[_0xbf82('0x37')]){_0x4278f4[_0x318c39[_0xbf82('0x3f')][_0xbf82('0x14')][_0xbf82('0x38')]()]&&_0x2d8cb2['custom_fields'][_0xbf82('0x3d')]({'id':_0x318c39[_0xbf82('0x3b')],'value':_0x4278f4[_0x318c39['Variable']['name']['toLowerCase']()][_0xbf82('0x2d')]()});}});}return _0x2d8cb2;}exports[_0xbf82('0x40')]=function(_0x55fc32,_0x2665c1,_0x2d678d,_0xb18440,_0x52a9c6,_0x44a170){var _0x351513,_0x5d391f;_0x44a170[_0xbf82('0x1e')]=intUtil[_0xbf82('0x41')](_0x44a170[_0xbf82('0x1e')]);_0x44a170[_0xbf82('0x42')]=intUtil[_0xbf82('0x41')](_0x44a170['serverUrl']);if(_0x52a9c6&&_0x52a9c6['monitor_format']){logger['info'](_0xbf82('0x43'),_0xbf82('0x44'));_0x2665c1[_0xbf82('0x45')]=util['format'](_0xbf82('0x46'),_0x44a170[_0xbf82('0x42')],_0x2665c1[_0xbf82('0x47')],md5(_0x2665c1[_0xbf82('0x47')]));}else{_0x2665c1[_0xbf82('0x45')]='';}headers[_0xbf82('0x48')]=getAuth(_0x44a170);return getUser(_0x44a170,_0xb18440[_0xbf82('0x49')])[_0xbf82('0x1a')](function(_0x393292){_0x351513=_0x393292;logger['info'](_0xbf82('0x4a'),_0x351513['id']);return getEndUser(_0x44a170,_0x2665c1[_0xbf82('0xf')],_0x2665c1[_0xbf82('0x4b')]);})[_0xbf82('0x1a')](function(_0x20decd){_0x5d391f=_0x20decd;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5d391f['id']);return getTicket(_0x44a170,_0x351513,_0x5d391f,_0x2d678d,_0x2665c1);})[_0xbf82('0x1a')](function(_0x326a20){if(_0x326a20&&_0x326a20['id']){logger[_0xbf82('0xc')]('Ticket\x20created!');logger[_0xbf82('0xc')]('The\x20Ticket\x20ID\x20is:',_0x326a20['id']);logger[_0xbf82('0xc')](_0xbf82('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbf82('0xe')](_0xbf82('0x4c'),_0xb18440[_0xbf82('0x14')]),'trigger:browser:url',{'uri':util[_0xbf82('0xe')](_0xbf82('0x4d'),_0x44a170[_0xbf82('0x1e')],_0x326a20['id'])});}})[_0xbf82('0x4e')](function(_0x242ef2){logger[_0xbf82('0x4f')](_0xbf82('0x43'),JSON[_0xbf82('0x30')](_0x242ef2));});};exports[_0xbf82('0x50')]=function(_0x16c532,_0x4ed1fe,_0x30df15,_0x2da268,_0x33efe4,_0x1c5ed0,_0x34f43a){var _0x5d7205,_0x532cb4;_0x1c5ed0[_0xbf82('0x1e')]=intUtil[_0xbf82('0x41')](_0x1c5ed0[_0xbf82('0x1e')]);_0x1c5ed0[_0xbf82('0x42')]=intUtil['stripTrailingSlash'](_0x1c5ed0[_0xbf82('0x42')]);if(_0x34f43a&&_0x34f43a[_0xbf82('0x51')]&&_0x34f43a[_0xbf82('0x51')]!==_0xbf82('0x52')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4ed1fe[_0xbf82('0x45')]=util[_0xbf82('0xe')](_0xbf82('0x46'),_0x1c5ed0[_0xbf82('0x42')],_0x4ed1fe[_0xbf82('0x47')],md5(_0x4ed1fe['uniqueid']));}headers[_0xbf82('0x48')]=getAuth(_0x1c5ed0);return getUser(_0x1c5ed0,_0x2da268[_0xbf82('0x49')])[_0xbf82('0x1a')](function(_0x42daab){_0x5d7205=_0x42daab;logger[_0xbf82('0xc')]('The\x20User\x20ID\x20is:',_0x5d7205['id']);return getEndUser(_0x1c5ed0,_0x4ed1fe[_0xbf82('0x53')],_0x4ed1fe['destcalleridnum']);})['then'](function(_0x38bfad){_0x532cb4=_0x38bfad;logger[_0xbf82('0xc')](_0xbf82('0x54'),_0x532cb4['id']);return getTicket(_0x1c5ed0,_0x5d7205,_0x532cb4,_0x30df15,_0x4ed1fe);})[_0xbf82('0x1a')](function(_0x5477d9){if(_0x5477d9&&_0x5477d9['id']){logger[_0xbf82('0xc')](_0xbf82('0x1b'));logger['info'](_0xbf82('0x55'),_0x5477d9['id']);logger[_0xbf82('0xc')](_0xbf82('0x56'),_0xbf82('0x57'));emit(util[_0xbf82('0xe')](_0xbf82('0x4c'),_0x2da268[_0xbf82('0x14')]),'trigger:browser:url',{'uri':util['format'](_0xbf82('0x4d'),_0x1c5ed0['remoteUri'],_0x5477d9['id'])});}})[_0xbf82('0x4e')](function(_0x41a3db){logger[_0xbf82('0x4f')](_0xbf82('0x56'),JSON[_0xbf82('0x30')](_0x41a3db));});};exports[_0xbf82('0x58')]=function(_0x387079,_0x577eaf,_0x1dadb1,_0x4df1b5,_0x86d916,_0x78e574){var _0x1e1872,_0x12bb05;_0x78e574[_0xbf82('0x1e')]=intUtil[_0xbf82('0x41')](_0x78e574[_0xbf82('0x1e')]);_0x78e574[_0xbf82('0x42')]=intUtil['stripTrailingSlash'](_0x78e574[_0xbf82('0x42')]);if(_0x86d916&&_0x86d916[_0xbf82('0x59')]){logger[_0xbf82('0xc')]('['+_0x577eaf['lastevent'][_0xbf82('0x5a')]()+']','Recording\x20is\x20enabled!');_0x577eaf[_0xbf82('0x45')]=util[_0xbf82('0xe')](_0xbf82('0x46'),_0x78e574[_0xbf82('0x42')],_0x577eaf['uniqueid'],md5(_0x577eaf[_0xbf82('0x47')]));}else{_0x577eaf[_0xbf82('0x45')]='';}headers[_0xbf82('0x48')]=getAuth(_0x78e574);return getUser(_0x78e574,'')[_0xbf82('0x1a')](function(_0x341d38){_0x1e1872=_0x341d38;logger[_0xbf82('0xc')]('The\x20User\x20ID\x20is:',_0x1e1872['id']);return getEndUser(_0x78e574,_0x577eaf[_0xbf82('0xf')],_0x577eaf[_0xbf82('0x4b')]);})['then'](function(_0x3e6196){_0x12bb05=_0x3e6196;logger[_0xbf82('0xc')](_0xbf82('0x54'),_0x12bb05['id']);return getTicket(_0x78e574,_0x1e1872,_0x12bb05,_0x1dadb1,_0x577eaf);})[_0xbf82('0x1a')](function(_0x11ef96){if(_0x11ef96){logger[_0xbf82('0xc')](_0xbf82('0x1b'));logger['info'](_0xbf82('0x55'),_0x11ef96['id']);}})[_0xbf82('0x4e')](function(_0x2f8c6e){logger[_0xbf82('0x4f')]('['+_0x577eaf[_0xbf82('0x5b')][_0xbf82('0x5a')]()+']',JSON[_0xbf82('0x30')](_0x2f8c6e));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56df=['calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected','userEmail','message','/api/lookup?q=','&entities=contact','contacts','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','format','YYYY-MM-DDTHH:mm:ss','ticketId','task','user:%s','emit','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum'];(function(_0x28eea8,_0x1de20d){var _0x5e4aef=function(_0x3b5a99){while(--_0x3b5a99){_0x28eea8['push'](_0x28eea8['shift']());}};_0x5e4aef(++_0x1de20d);}(_0x56df,0xad));var _0xf56d=function(_0x313c4b,_0x46923c){_0x313c4b=_0x313c4b-0x0;var _0x3ea454=_0x56df[_0x313c4b];return _0x3ea454;};'use strict';var _=require(_0xf56d('0x0'));var rp=require(_0xf56d('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0xf56d('0x2'));var Promise=require(_0xf56d('0x3'));var Redis=require(_0xf56d('0x4'));var intUtil=require(_0xf56d('0x5'));var config=require(_0xf56d('0x6'));var logger=require('../../../../config/logger')(_0xf56d('0x7'));config[_0xf56d('0x8')]=_[_0xf56d('0x9')](config['redis'],{'host':_0xf56d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x22a767,_0x549367,_0x2110b3,_0xff7422){return new Promise(function(_0x385967,_0x454d91){var _0x17c171=![];var _0x293803={'method':'GET','uri':_0xff7422+'/api/selector/owners','json':!![]};_0x293803[_0xf56d('0xb')]=_0x2110b3;logger[_0xf56d('0xc')]('Getting\x20admin\x20information');return rp(_0x293803)[_0xf56d('0xd')](function(_0x510b57){if(_0x510b57){var _0x5b0376=_0x510b57[_0xf56d('0xe')];var _0x22cae1=null;for(_0x22cae1=0x0;_0x22cae1<_0x5b0376[_0xf56d('0xf')];_0x22cae1++){if(_0x5b0376[_0x22cae1][_0xf56d('0x10')]===_0x22a767[_0xf56d('0x11')]){_0x22a767[_0xf56d('0x12')]=_0x5b0376[_0x22cae1]['id'];_0x17c171=!![];}}if(_0x17c171){logger[_0xf56d('0xc')](_0xf56d('0x13'),_0x22a767[_0xf56d('0x12')]);_0x385967(_0x22a767);}else{_0x454d91({'statusCode':0x194,'message':_0xf56d('0x14')});}}else{_0x454d91({'statusCode':0x194,'message':_0xf56d('0x14')});}})[_0xf56d('0x15')](function(_0x5140b4){logger[_0xf56d('0x16')]('['+[_0x549367[_0xf56d('0x17')]()]+']',_0x5140b4['message']);_0x454d91(_0x5140b4);});});}function getUser(_0x45fd30,_0x883ef2,_0x5aa870){return function(_0x1de8b0){return new Promise(function(_0x477b5c,_0x2717d5){var _0x13bc81={'method':_0xf56d('0x18'),'uri':_0x5aa870+'/api/selector/owners','json':!![]};_0x13bc81[_0xf56d('0xb')]=_0x883ef2;logger[_0xf56d('0xc')]('Getting\x20user\x20list');return rp(_0x13bc81)['then'](function(_0x5b4442){if(_0x5b4442){var _0x23ca20=_0x5b4442[_0xf56d('0xe')];var _0x4ab790=![];var _0x27a1f2=null;if(_0x1de8b0[_0xf56d('0x19')]!==null){logger['info'](_0xf56d('0x1a'),_0x1de8b0[_0xf56d('0x19')]);_0x1de8b0['userEmail']=_0x1de8b0[_0xf56d('0x19')];for(_0x27a1f2=0x0;_0x27a1f2<_0x23ca20[_0xf56d('0xf')];_0x27a1f2++){if(_0x23ca20[_0x27a1f2][_0xf56d('0x10')]===_0x1de8b0['agentEmail']){_0x4ab790=!![];_0x1de8b0[_0xf56d('0x1b')]=_0x23ca20[_0x27a1f2]['id'];logger['info']('User\x20found:',_0x1de8b0['userId']);}}}if(!_0x4ab790){logger['info'](_0xf56d('0x1c'));_0x1de8b0[_0xf56d('0x1d')]=_0x1de8b0[_0xf56d('0x11')];_0x1de8b0[_0xf56d('0x1b')]=_0x1de8b0[_0xf56d('0x12')];_0x4ab790=!![];}if(_0x4ab790){_0x477b5c(_0x1de8b0);}else{_0x2717d5({'statusCode':0x194,'message':_0xf56d('0x14')});}}else{_0x2717d5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf56d('0x15')](function(_0x48a326){logger[_0xf56d('0x16')]('['+[_0x45fd30[_0xf56d('0x17')]()]+']',_0x48a326[_0xf56d('0x1e')]);_0x2717d5(_0x48a326);});});};}function searchContact(_0x175e5a,_0x1bf942,_0x884511,_0x5cb782){return new Promise(function(_0x2ce94b,_0x5ba98c){var _0xb079cf={'method':'GET','headers':_0x1bf942,'uri':_0x175e5a+_0xf56d('0x1f')+_0x5cb782+'&f='+_0x884511+_0xf56d('0x20'),'json':!![]};rp(_0xb079cf)[_0xf56d('0xd')](function(_0x578268){var _0x2dbd59=_['find'](_0x578268[_0xf56d('0x21')][_0xf56d('0x21')],[_0x884511,_0x5cb782]);_0x2ce94b(_0x2dbd59);})[_0xf56d('0x15')](function(_0x1975da){_0x5ba98c(_0x1975da);});});}function getEndUser(_0x3a629b,_0x594b18,_0x4a313f){return function(_0x36457c){return new Promise(function(_0x1b0496,_0x32eba3){logger[_0xf56d('0xc')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x36457c['contactNumber']));searchContact(_0x4a313f,_0x594b18,_0xf56d('0x22'),_0x36457c[_0xf56d('0x23')])[_0xf56d('0xd')](function(_0x30e306){if(_0x30e306){_0x36457c[_0xf56d('0x24')]=_0x30e306['id'];logger[_0xf56d('0xc')](_0xf56d('0x25'),_0x36457c[_0xf56d('0x24')]);return _0x1b0496(_0x36457c);}searchContact(_0x4a313f,_0x594b18,_0xf56d('0x26'),_0x36457c[_0xf56d('0x23')])[_0xf56d('0xd')](function(_0x579e23){if(_0x579e23){_0x36457c['endUserId']=_0x579e23['id'];logger['info'](_0xf56d('0x27'),_0x36457c[_0xf56d('0x24')]);return _0x1b0496(_0x36457c);}createEndUser(_0x36457c,_0x3a629b,_0x594b18,_0x4a313f)['then'](function(_0x250364){logger[_0xf56d('0xc')](_0xf56d('0x28'),_0x250364[_0xf56d('0x24')]);return _0x1b0496(_0x250364);});});})[_0xf56d('0x15')](function(_0x21fe32){_0x32eba3(_0x21fe32);});});};}function createEndUser(_0x4e0264,_0x227313,_0x56e0f8,_0x1300f6){return new Promise(function(_0x4a8c3a,_0x596351){var _0x4e1cff=moment();var _0x456403={'method':_0xf56d('0x29'),'uri':_0x1300f6+_0xf56d('0x2a'),'body':{'contact':{'last_name':_0x4e0264['contactNumber'],'work_number':_0x4e0264[_0xf56d('0x23')],'mobile_number':_0x4e0264['contactNumber'],'owner_id':_0x4e0264[_0xf56d('0x1b')],'created_at':_0x4e1cff['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x456403[_0xf56d('0xb')]=_0x56e0f8;logger['info'](_0xf56d('0x2b'));return rp(_0x456403)[_0xf56d('0xd')](function(_0x2f095d){_0x4e0264[_0xf56d('0x24')]=_0x2f095d['contact']['id'];_0x4a8c3a(_0x4e0264);})['catch'](function(_0x158dea){logger[_0xf56d('0x16')]('['+[_0x227313['toUpperCase']()]+']',_0x158dea[_0xf56d('0x1e')]);_0x596351(_0x158dea[_0xf56d('0x1e')]);});});}function getTicket(_0xb22bbd,_0x5b451f,_0x57a9a9,_0x115793,_0x46e7f9){return function(_0x46704c){logger[_0xf56d('0xc')](_0xf56d('0x2c'));return new Promise(function(_0x3a5355,_0x522768){var _0x1c9098=moment();var _0x3f1e45={'method':_0xf56d('0x29'),'uri':_0x57a9a9+_0xf56d('0x2d'),'body':{'title':intUtil[_0xf56d('0x2e')](_0x115793[_0xf56d('0x2f')],_0x46e7f9,'\x20'),'description':intUtil[_0xf56d('0x2e')](_0x115793[_0xf56d('0x30')],_0x46e7f9,'\x0a'),'owner_id':_0x46704c[_0xf56d('0x1b')],'creater_id':_0x46704c[_0xf56d('0x12')],'targetable_id':_0x46704c['endUserId'],'targetable_type':'Contact','created_at':_0x1c9098['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1c9098[_0xf56d('0x31')](0x1e,'m')[_0xf56d('0x32')](_0xf56d('0x33'))},'json':!![]};_0x3f1e45[_0xf56d('0xb')]=_0x5b451f;return rp(_0x3f1e45)[_0xf56d('0xd')](function(_0x70d74c){_0x46704c[_0xf56d('0x34')]=_0x70d74c[_0xf56d('0x35')]['id'];logger[_0xf56d('0xc')]('Task\x20created:',_0x46704c[_0xf56d('0x34')]);_0x3a5355(_0x46704c);})[_0xf56d('0x15')](function(_0x149123){logger[_0xf56d('0x16')]('['+[_0xb22bbd['toUpperCase']()]+']',_0x149123[_0xf56d('0x1e')]);_0x522768(_0x149123[_0xf56d('0x1e')]);});});};}function emit(_0x566857,_0x221f17,_0x1ee95f){var _0x937993={'uri':_0x566857+'/contacts/'+_0x1ee95f};io['to'](util[_0xf56d('0x32')](_0xf56d('0x36'),_0x221f17))[_0xf56d('0x37')]('trigger:browser:url',_0x937993);}exports['cs']=function(_0x2c8e6b,_0x48bfd2,_0x13d072,_0x516240,_0x15dc1a,_0x5ac2b8,_0x328a38,_0x201c17){var _0x44c14b={};var _0x1abd0c={'Authorization':_0xf56d('0x38')+_0x5ac2b8['apiKey']};_0x5ac2b8[_0xf56d('0x39')]=intUtil[_0xf56d('0x3a')](_0x5ac2b8['remoteUri']);_0x5ac2b8[_0xf56d('0x3b')]=intUtil[_0xf56d('0x3a')](_0x5ac2b8['serverUrl']);var _0x3197b8=_0x5ac2b8[_0xf56d('0x39')];_0x44c14b['adminEmail']=_0x5ac2b8[_0xf56d('0x3c')];_0x44c14b['contactNumber']=_0x201c17[_0xf56d('0x3d')]()===_0xf56d('0x3e')?_0x48bfd2[_0xf56d('0x3f')]:_0x48bfd2[_0xf56d('0x40')];_0x44c14b[_0xf56d('0x41')]=_0x201c17===_0xf56d('0x42')||_0x201c17===_0xf56d('0x43')?_0xf56d('0x42'):'outbound';if(_0x516240){_0x44c14b['agentEmail']=_0x516240[_0xf56d('0x10')];}var _0x56de38=util['format'](_0xf56d('0x44'),_0x5ac2b8['serverUrl'],_0x48bfd2[_0xf56d('0x45')],md5(_0x48bfd2[_0xf56d('0x45')]));if(_0x15dc1a&&_0x15dc1a[_0xf56d('0x46')]){logger[_0xf56d('0xc')](_0xf56d('0x47'),_0xf56d('0x48'));_0x48bfd2[_0xf56d('0x49')]=_0x56de38;}else if(_0x328a38&&_0x328a38[_0xf56d('0x4a')]&&_0x328a38['recordingFormat']!==_0xf56d('0x4b')){logger[_0xf56d('0xc')](_0xf56d('0x4c'),_0xf56d('0x48'));_0x48bfd2[_0xf56d('0x49')]=_0x56de38;}else{_0x48bfd2[_0xf56d('0x49')]='';}return getAdminId(_0x44c14b,_0x201c17,_0x1abd0c,_0x3197b8)[_0xf56d('0xd')](getUser(_0x201c17,_0x1abd0c,_0x3197b8))[_0xf56d('0xd')](getEndUser(_0x201c17,_0x1abd0c,_0x3197b8))['then'](getTicket(_0x201c17,_0x1abd0c,_0x3197b8,_0x13d072,_0x48bfd2))[_0xf56d('0xd')](function(_0x3aaa5d){logger[_0xf56d('0xc')](util[_0xf56d('0x32')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3aaa5d[_0xf56d('0x34')]));if(_0x201c17!==_0xf56d('0x43')){logger[_0xf56d('0xc')]('['+[_0x201c17[_0xf56d('0x17')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3197b8,_0x516240[_0xf56d('0x4d')],_0x3aaa5d[_0xf56d('0x24')]);}})['catch'](function(_0x2ecf9b){logger[_0xf56d('0x16')]('['+[_0x201c17[_0xf56d('0x17')]()]+_0xf56d('0x4e'),util['inspect'](_0x2ecf9b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xdebe=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','bluebird','ioredis','../../../../config/logger','redis','socket.io-emitter','/api/selector/owners','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','headers','info','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','contact','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL'];(function(_0x235a9b,_0x135300){var _0x4cd22f=function(_0x30bcc4){while(--_0x30bcc4){_0x235a9b['push'](_0x235a9b['shift']());}};_0x4cd22f(++_0x135300);}(_0xdebe,0x19d));var _0xedeb=function(_0x31dd4e,_0x5ed38a){_0x31dd4e=_0x31dd4e-0x0;var _0x18da9c=_0xdebe[_0x31dd4e];return _0x18da9c;};'use strict';var _=require(_0xedeb('0x0'));var rp=require(_0xedeb('0x1'));var md5=require('md5');var util=require(_0xedeb('0x2'));var moment=require('moment');var Promise=require(_0xedeb('0x3'));var Redis=require(_0xedeb('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xedeb('0x5'))('freshsales');config[_0xedeb('0x6')]=_['defaults'](config[_0xedeb('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xedeb('0x7'))(new Redis(config[_0xedeb('0x6')]));function getAdminId(_0x15ce96,_0x55e7d6,_0x2b26f2,_0x20a0e3){return new Promise(function(_0x2cedd0,_0x5c8cb1){var _0x444de8=![];var _0x45fcb4={'method':'GET','uri':_0x20a0e3+_0xedeb('0x8'),'json':!![]};_0x45fcb4['headers']=_0x2b26f2;logger['info'](_0xedeb('0x9'));return rp(_0x45fcb4)[_0xedeb('0xa')](function(_0x288757){if(_0x288757){var _0x141a08=_0x288757['users'];var _0x419692=null;for(_0x419692=0x0;_0x419692<_0x141a08[_0xedeb('0xb')];_0x419692++){if(_0x141a08[_0x419692][_0xedeb('0xc')]===_0x15ce96[_0xedeb('0xd')]){_0x15ce96[_0xedeb('0xe')]=_0x141a08[_0x419692]['id'];_0x444de8=!![];}}if(_0x444de8){logger['info']('Admin\x20found:',_0x15ce96[_0xedeb('0xe')]);_0x2cedd0(_0x15ce96);}else{_0x5c8cb1({'statusCode':0x194,'message':_0xedeb('0xf')});}}else{_0x5c8cb1({'statusCode':0x194,'message':_0xedeb('0xf')});}})[_0xedeb('0x10')](function(_0x2e068d){logger[_0xedeb('0x11')]('['+[_0x55e7d6[_0xedeb('0x12')]()]+']',_0x2e068d[_0xedeb('0x13')]);_0x5c8cb1(_0x2e068d);});});}function getUser(_0x453947,_0x207db8,_0x123fca){return function(_0x136d5f){return new Promise(function(_0x165d5a,_0x1778af){var _0x16200c={'method':_0xedeb('0x14'),'uri':_0x123fca+_0xedeb('0x8'),'json':!![]};_0x16200c[_0xedeb('0x15')]=_0x207db8;logger[_0xedeb('0x16')](_0xedeb('0x17'));return rp(_0x16200c)[_0xedeb('0xa')](function(_0x15021a){if(_0x15021a){var _0x5c6db6=_0x15021a[_0xedeb('0x18')];var _0x1395f7=![];var _0x273241=null;if(_0x136d5f['agentEmail']!==null){logger['info'](_0xedeb('0x19'),_0x136d5f[_0xedeb('0x1a')]);_0x136d5f[_0xedeb('0x1b')]=_0x136d5f['agentEmail'];for(_0x273241=0x0;_0x273241<_0x5c6db6['length'];_0x273241++){if(_0x5c6db6[_0x273241][_0xedeb('0xc')]===_0x136d5f[_0xedeb('0x1a')]){_0x1395f7=!![];_0x136d5f[_0xedeb('0x1c')]=_0x5c6db6[_0x273241]['id'];logger[_0xedeb('0x16')](_0xedeb('0x1d'),_0x136d5f['userId']);}}}if(!_0x1395f7){logger[_0xedeb('0x16')](_0xedeb('0x1e'));_0x136d5f[_0xedeb('0x1b')]=_0x136d5f['adminEmail'];_0x136d5f[_0xedeb('0x1c')]=_0x136d5f[_0xedeb('0xe')];_0x1395f7=!![];}if(_0x1395f7){_0x165d5a(_0x136d5f);}else{_0x1778af({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1778af({'statusCode':0x194,'message':_0xedeb('0xf')});}})[_0xedeb('0x10')](function(_0x20853d){logger[_0xedeb('0x11')]('['+[_0x453947['toUpperCase']()]+']',_0x20853d['message']);_0x1778af(_0x20853d);});});};}function searchContact(_0x453afa,_0x52b14c,_0xf018ae,_0x35bd43){return new Promise(function(_0x142add,_0x5d807c){var _0x32d401={'method':'GET','headers':_0x52b14c,'uri':_0x453afa+_0xedeb('0x1f')+_0x35bd43+'&f='+_0xf018ae+_0xedeb('0x20'),'json':!![]};rp(_0x32d401)[_0xedeb('0xa')](function(_0x5bc62a){var _0x4c90c8=_[_0xedeb('0x21')](_0x5bc62a[_0xedeb('0x22')][_0xedeb('0x22')],[_0xf018ae,_0x35bd43]);_0x142add(_0x4c90c8);})[_0xedeb('0x10')](function(_0x26d08c){_0x5d807c(_0x26d08c);});});}function getEndUser(_0x5a1c18,_0x29dd64,_0xcffa0d){return function(_0x3bea29){return new Promise(function(_0x1af615,_0x40b5ab){logger[_0xedeb('0x16')](util[_0xedeb('0x23')](_0xedeb('0x24'),_0x3bea29[_0xedeb('0x25')]));searchContact(_0xcffa0d,_0x29dd64,_0xedeb('0x26'),_0x3bea29['contactNumber'])['then'](function(_0x50c916){if(_0x50c916){_0x3bea29[_0xedeb('0x27')]=_0x50c916['id'];logger[_0xedeb('0x16')](_0xedeb('0x28'),_0x3bea29[_0xedeb('0x27')]);return _0x1af615(_0x3bea29);}searchContact(_0xcffa0d,_0x29dd64,'work_number',_0x3bea29['contactNumber'])[_0xedeb('0xa')](function(_0x3eecf9){if(_0x3eecf9){_0x3bea29[_0xedeb('0x27')]=_0x3eecf9['id'];logger[_0xedeb('0x16')](_0xedeb('0x29'),_0x3bea29[_0xedeb('0x27')]);return _0x1af615(_0x3bea29);}createEndUser(_0x3bea29,_0x5a1c18,_0x29dd64,_0xcffa0d)[_0xedeb('0xa')](function(_0x335849){logger[_0xedeb('0x16')](_0xedeb('0x2a'),_0x335849[_0xedeb('0x27')]);return _0x1af615(_0x335849);});});})[_0xedeb('0x10')](function(_0x19d89b){_0x40b5ab(_0x19d89b);});});};}function createEndUser(_0xf3861a,_0x18856a,_0x4884b8,_0x2ce5c8){return new Promise(function(_0x2d2aff,_0x359b4e){var _0x50bf84=moment();var _0x10197a={'method':_0xedeb('0x2b'),'uri':_0x2ce5c8+_0xedeb('0x2c'),'body':{'contact':{'last_name':_0xf3861a['contactNumber'],'work_number':_0xf3861a[_0xedeb('0x25')],'mobile_number':_0xf3861a[_0xedeb('0x25')],'owner_id':_0xf3861a['userId'],'created_at':_0x50bf84['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x10197a[_0xedeb('0x15')]=_0x4884b8;logger[_0xedeb('0x16')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x10197a)[_0xedeb('0xa')](function(_0x558a60){_0xf3861a[_0xedeb('0x27')]=_0x558a60[_0xedeb('0x2d')]['id'];_0x2d2aff(_0xf3861a);})[_0xedeb('0x10')](function(_0x468f02){logger[_0xedeb('0x11')]('['+[_0x18856a[_0xedeb('0x12')]()]+']',_0x468f02[_0xedeb('0x13')]);_0x359b4e(_0x468f02['message']);});});}function getTicket(_0x4cf772,_0x57cdb9,_0x3d3e93,_0x24ed77,_0x4ed1fc){return function(_0x2cb7c1){logger[_0xedeb('0x16')]('Creating\x20new\x20task');return new Promise(function(_0x5d1d1b,_0x510180){var _0x27408d=moment();var _0x9a91ad={'method':_0xedeb('0x2b'),'uri':_0x3d3e93+'/api/tasks','body':{'title':intUtil[_0xedeb('0x2e')](_0x24ed77[_0xedeb('0x2f')],_0x4ed1fc,'\x20'),'description':intUtil[_0xedeb('0x2e')](_0x24ed77[_0xedeb('0x30')],_0x4ed1fc,'\x0a'),'owner_id':_0x2cb7c1[_0xedeb('0x1c')],'creater_id':_0x2cb7c1['adminId'],'targetable_id':_0x2cb7c1[_0xedeb('0x27')],'targetable_type':_0xedeb('0x31'),'created_at':_0x27408d['format'](_0xedeb('0x32')),'due_date':_0x27408d['add'](0x1e,'m')[_0xedeb('0x23')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x9a91ad[_0xedeb('0x15')]=_0x57cdb9;return rp(_0x9a91ad)['then'](function(_0x21c772){_0x2cb7c1[_0xedeb('0x33')]=_0x21c772[_0xedeb('0x34')]['id'];logger[_0xedeb('0x16')](_0xedeb('0x35'),_0x2cb7c1[_0xedeb('0x33')]);_0x5d1d1b(_0x2cb7c1);})['catch'](function(_0x2d56b6){logger[_0xedeb('0x11')]('['+[_0x4cf772[_0xedeb('0x12')]()]+']',_0x2d56b6[_0xedeb('0x13')]);_0x510180(_0x2d56b6[_0xedeb('0x13')]);});});};}function emit(_0x35867d,_0x3d14a3,_0x54b6e8){var _0xa572a1={'uri':_0x35867d+'/contacts/'+_0x54b6e8};io['to'](util['format'](_0xedeb('0x36'),_0x3d14a3))[_0xedeb('0x37')](_0xedeb('0x38'),_0xa572a1);}exports['cs']=function(_0x1adbae,_0x2855ca,_0x6393c1,_0x3a9ac8,_0x2ce1f8,_0x25bd02,_0x2c36b6,_0x1cc714){var _0x24321f={};var _0x555aeb={'Authorization':_0xedeb('0x39')+_0x25bd02[_0xedeb('0x3a')]};_0x25bd02[_0xedeb('0x3b')]=intUtil[_0xedeb('0x3c')](_0x25bd02[_0xedeb('0x3b')]);_0x25bd02['serverUrl']=intUtil[_0xedeb('0x3c')](_0x25bd02[_0xedeb('0x3d')]);var _0x3513bb=_0x25bd02[_0xedeb('0x3b')];_0x24321f[_0xedeb('0xd')]=_0x25bd02[_0xedeb('0x3e')];_0x24321f[_0xedeb('0x25')]=_0x1cc714['toLowerCase']()===_0xedeb('0x3f')?_0x2855ca[_0xedeb('0x40')]:_0x2855ca[_0xedeb('0x41')];_0x24321f[_0xedeb('0x42')]=_0x1cc714===_0xedeb('0x43')||_0x1cc714===_0xedeb('0x44')?_0xedeb('0x43'):_0xedeb('0x3f');if(_0x3a9ac8){_0x24321f[_0xedeb('0x1a')]=_0x3a9ac8[_0xedeb('0xc')];}var _0x521f1b=util[_0xedeb('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25bd02[_0xedeb('0x3d')],_0x2855ca[_0xedeb('0x45')],md5(_0x2855ca[_0xedeb('0x45')]));if(_0x2ce1f8&&_0x2ce1f8[_0xedeb('0x46')]){logger[_0xedeb('0x16')](_0xedeb('0x47'),'Recording\x20is\x20enabled!');_0x2855ca[_0xedeb('0x48')]=_0x521f1b;}else if(_0x2c36b6&&_0x2c36b6[_0xedeb('0x49')]&&_0x2c36b6[_0xedeb('0x49')]!==_0xedeb('0x4a')){logger[_0xedeb('0x16')](_0xedeb('0x4b'),_0xedeb('0x4c'));_0x2855ca[_0xedeb('0x48')]=_0x521f1b;}else{_0x2855ca[_0xedeb('0x48')]='';}return getAdminId(_0x24321f,_0x1cc714,_0x555aeb,_0x3513bb)[_0xedeb('0xa')](getUser(_0x1cc714,_0x555aeb,_0x3513bb))[_0xedeb('0xa')](getEndUser(_0x1cc714,_0x555aeb,_0x3513bb))[_0xedeb('0xa')](getTicket(_0x1cc714,_0x555aeb,_0x3513bb,_0x6393c1,_0x2855ca))[_0xedeb('0xa')](function(_0x4bd8d5){logger[_0xedeb('0x16')](util[_0xedeb('0x23')](_0xedeb('0x4d'),_0x4bd8d5[_0xedeb('0x33')]));if(_0x1cc714!=='unmanaged'){logger['info']('['+[_0x1cc714['toUpperCase']()]+']',_0xedeb('0x4e'));emit(_0x3513bb,_0x3a9ac8[_0xedeb('0x4f')],_0x4bd8d5[_0xedeb('0x27')]);}})['catch'](function(_0x40a0f3){logger['error']('['+[_0x1cc714[_0xedeb('0x12')]()]+_0xedeb('0x50'),util['inspect'](_0x40a0f3,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ae8=['./freshsales','zendesk','salesforce','sugarcrm','freshdesk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','zoho','desk','log','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365'];(function(_0x2484e6,_0x2cbe6c){var _0x20efaf=function(_0x15499e){while(--_0x15499e){_0x2484e6['push'](_0x2484e6['shift']());}};_0x20efaf(++_0x2cbe6c);}(_0x4ae8,0x18d));var _0x84ae=function(_0x6f05d2,_0x50cdfe){_0x6f05d2=_0x6f05d2-0x0;var _0x103911=_0x4ae8[_0x6f05d2];return _0x103911;};'use strict';var _=require(_0x84ae('0x0'));var util=require(_0x84ae('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x84ae('0x2'));var sugarcrm=require(_0x84ae('0x3'));var freshdesk=require(_0x84ae('0x4'));var zoho=require(_0x84ae('0x5'));var desk=require(_0x84ae('0x6'));var vtiger=require(_0x84ae('0x7'));var servicenow=require(_0x84ae('0x8'));var dynamics365=require(_0x84ae('0x9'));var freshsales=require(_0x84ae('0xa'));var integrations=[_0x84ae('0xb'),_0x84ae('0xc'),_0x84ae('0xd'),_0x84ae('0xe'),'zoho','desk',_0x84ae('0xf'),_0x84ae('0x10'),_0x84ae('0x11'),'servicenow'];exports[_0x84ae('0x12')]=function(_0x46bf64,_0x2ed2be,_0x2280df,_0x4012ef,_0x4a21da,_0x23d37f){if(_0x2280df){if(_[_0x84ae('0x13')](integrations,_0x46bf64[_0x84ae('0x14')][_0x84ae('0x15')]())){try{var _0x4f2502=null;var _0x3fa071='';var _0xf60cad=_0x2280df[_0x46bf64[_0x84ae('0x14')]['toLowerCase']()];if(_0xf60cad){var _0x42e886=_0xf60cad[_0x46bf64[_0x84ae('0x16')]];if(_0x42e886){var _0x3cd388=_[_0x84ae('0x17')](_0x42e886[_0x84ae('0x18')],{'id':parseInt(_0x46bf64[_0x84ae('0x19')],0xa)});if(_0x3cd388){if(_0x4012ef){if(_0x4a21da&&_0x2ed2be[_0x84ae('0x1a')]){_0x3fa071=_0x84ae('0x1a');}else if(_0x2ed2be[_0x84ae('0x1b')]){_0x3fa071='outbound';}else{console['log'](_0x84ae('0x1c'),_0x2ed2be);}}else{_0x3fa071='unmanaged';}switch(_0x46bf64[_0x84ae('0x14')][_0x84ae('0x15')]()){case _0x84ae('0xb'):zendesk[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0xc'):salesforce[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0xd'):sugarcrm[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case'freshdesk':freshdesk[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0x1d'):zoho[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0x1e'):desk[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0xf'):vtiger[_0x3fa071](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f);break;case _0x84ae('0x11'):freshsales['cs'](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f,_0x3fa071);break;case'servicenow':servicenow['cs'](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f,_0x3fa071);break;case _0x84ae('0x10'):dynamics365['cs'](_0x46bf64,_0x2ed2be,_0x3cd388,_0x4012ef,_0x4a21da,_0x42e886,_0x23d37f,_0x3fa071);break;default:console[_0x84ae('0x1f')]('unknown\x20integration');}}else{_0x4f2502=require(_0x84ae('0x20'))(_0x46bf64[_0x84ae('0x14')][_0x84ae('0x15')]());_0x4f2502[_0x84ae('0x21')](_0x84ae('0x22'),util[_0x84ae('0x23')](_0x84ae('0x24'),_0x46bf64['data1'][_0x84ae('0x15')](),_0x46bf64[_0x84ae('0x19')]));}}else{_0x4f2502=require(_0x84ae('0x20'))(_0x46bf64['data1'][_0x84ae('0x15')]());_0x4f2502['error'](_0x84ae('0x22'),util[_0x84ae('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x46bf64[_0x84ae('0x14')]['toLowerCase'](),_0x46bf64['data2']));}}else{}}catch(_0x588ee9){console[_0x84ae('0x21')](_0x588ee9);}}}};
\ No newline at end of file
+var _0x878a=['sugarcrm','log','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','data2','Configurations','data3','routeId','outbound','EVENT\x20UNKNOWN','toLowerCase'];(function(_0x5b816b,_0x58bf7a){var _0x4b60e8=function(_0x262b45){while(--_0x262b45){_0x5b816b['push'](_0x5b816b['shift']());}};_0x4b60e8(++_0x58bf7a);}(_0x878a,0xd9));var _0xa878=function(_0x39307b,_0x358c65){_0x39307b=_0x39307b-0x0;var _0x1b03d0=_0x878a[_0x39307b];return _0x1b03d0;};'use strict';var _=require(_0xa878('0x0'));var util=require(_0xa878('0x1'));var zendesk=require(_0xa878('0x2'));var salesforce=require(_0xa878('0x3'));var sugarcrm=require(_0xa878('0x4'));var freshdesk=require(_0xa878('0x5'));var zoho=require(_0xa878('0x6'));var desk=require(_0xa878('0x7'));var vtiger=require(_0xa878('0x8'));var servicenow=require(_0xa878('0x9'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0xa878('0xa'),_0xa878('0xb'),'sugarcrm',_0xa878('0xc'),_0xa878('0xd'),_0xa878('0xe'),_0xa878('0xf'),_0xa878('0x10'),_0xa878('0x11'),'servicenow'];exports[_0xa878('0x12')]=function(_0x6c19be,_0x50edd2,_0xeb5e1d,_0x4e4702,_0x514d93,_0xb9394){if(_0xeb5e1d){if(_[_0xa878('0x13')](integrations,_0x6c19be[_0xa878('0x14')]['toLowerCase']())){try{var _0x5dd67d=null;var _0x46d5a2='';var _0x2d65c2=_0xeb5e1d[_0x6c19be[_0xa878('0x14')]['toLowerCase']()];if(_0x2d65c2){var _0x2ad5e3=_0x2d65c2[_0x6c19be[_0xa878('0x15')]];if(_0x2ad5e3){var _0xb78cc8=_['find'](_0x2ad5e3[_0xa878('0x16')],{'id':parseInt(_0x6c19be[_0xa878('0x17')],0xa)});if(_0xb78cc8){if(_0x4e4702){if(_0x514d93&&_0x50edd2['queue']){_0x46d5a2='queue';}else if(_0x50edd2[_0xa878('0x18')]){_0x46d5a2=_0xa878('0x19');}else{console['log'](_0xa878('0x1a'),_0x50edd2);}}else{_0x46d5a2='unmanaged';}switch(_0x6c19be[_0xa878('0x14')][_0xa878('0x1b')]()){case _0xa878('0xa'):zendesk[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case'salesforce':salesforce[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case _0xa878('0x1c'):sugarcrm[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case'freshdesk':freshdesk[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case _0xa878('0xd'):zoho[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case _0xa878('0xe'):desk[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case _0xa878('0xf'):vtiger[_0x46d5a2](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394);break;case _0xa878('0x11'):freshsales['cs'](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394,_0x46d5a2);break;case'servicenow':servicenow['cs'](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394,_0x46d5a2);break;case _0xa878('0x10'):dynamics365['cs'](_0x6c19be,_0x50edd2,_0xb78cc8,_0x4e4702,_0x514d93,_0x2ad5e3,_0xb9394,_0x46d5a2);break;default:console[_0xa878('0x1d')]('unknown\x20integration');}}else{_0x5dd67d=require(_0xa878('0x1e'))(_0x6c19be[_0xa878('0x14')]['toLowerCase']());_0x5dd67d[_0xa878('0x1f')]('[EXEC]',util[_0xa878('0x20')](_0xa878('0x21'),_0x6c19be[_0xa878('0x14')]['toLowerCase'](),_0x6c19be[_0xa878('0x17')]));}}else{_0x5dd67d=require(_0xa878('0x1e'))(_0x6c19be[_0xa878('0x14')][_0xa878('0x1b')]());_0x5dd67d['error']('[EXEC]',util[_0xa878('0x20')](_0xa878('0x22'),_0x6c19be[_0xa878('0x14')][_0xa878('0x1b')](),_0x6c19be['data2']));}}else{}}catch(_0x3cee09){console[_0xa878('0x1f')](_0x3cee09);}}}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c22=['error','catch','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','isNil','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','leadId','info','create','validateEmail','sobject','User','execute','length','find','Email','Agent\x20%s\x20found.','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','cloneDeep','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Contact','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','Name','forEach','picklist','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','clientId','login','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c22,0x18a));var _0x28c2=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x8c22[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0x28c2('0x0'));var rp=require('request-promise');var moment=require(_0x28c2('0x1'));var BPromise=require('bluebird');var md5=require(_0x28c2('0x2'));var jsforce=require(_0x28c2('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x28c2('0x4'));var config=require(_0x28c2('0x5'));var logger=require(_0x28c2('0x6'))(_0x28c2('0x7'));config[_0x28c2('0x8')]=_['defaults'](config['redis'],{'host':_0x28c2('0x9'),'port':0x18eb});var io=require(_0x28c2('0xa'))(new Redis(config[_0x28c2('0x8')]));function emit(_0x572281,_0x5231a1,_0x1a331b){io['to'](_0x572281)[_0x28c2('0xb')](_0x5231a1,_0x1a331b);}function getTicket(_0x10e1a8,_0x3ee994,_0x5b9002,_0x40d1ec,_0x213298,_0x47121f,_0x358ceb,_0x394959){var _0x54118b=Object[_0x28c2('0xc')]({},{'OwnerId':_0x3ee994['id'],'Subject':intUtil[_0x28c2('0xd')](_0x40d1ec[_0x28c2('0xe')],_0x213298,'\x20'),'Description':intUtil[_0x28c2('0xd')](_0x40d1ec[_0x28c2('0xf')],_0x213298,'\x0a')},getCustomFields(_0x47121f,_0x213298));if(_0x5b9002){if(_0x40d1ec[_0x28c2('0x10')]===_0x28c2('0x11')){_0x54118b[_0x28c2('0x12')]=moment[_0x28c2('0x13')]();_0x54118b[_0x28c2('0x14')]=![];_0x54118b[_0x28c2('0x15')]=![];if(_0x5b9002[_0x28c2('0x16')]===_0x28c2('0x17')||_0x5b9002['endUserType']===_0x28c2('0x18')){_0x54118b[_0x28c2('0x19')]=_0x5b9002['id'];}else if(_0x5b9002[_0x28c2('0x16')]===_0x28c2('0x1a')){_0x54118b[_0x28c2('0x1b')]=_0x5b9002['id'];}}else if(_0x40d1ec[_0x28c2('0x10')]===_0x28c2('0x1c')){if(_0x5b9002['endUserType']===_0x28c2('0x17')){_0x54118b[_0x28c2('0x1d')]=_0x5b9002['id'];}else if(_0x5b9002[_0x28c2('0x16')]===_0x28c2('0x1a')){_0x54118b['AccountId']=_0x5b9002['id'];}else if(_0x5b9002[_0x28c2('0x16')]==='lead'&&_0x40d1ec[_0x28c2('0x1e')]){_0x54118b[_0x40d1ec[_0x28c2('0x1e')]]=_0x5b9002['id'];}else{logger[_0x28c2('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x358ceb['sobject'](_0x40d1ec[_0x28c2('0x10')])[_0x28c2('0x20')](_0x54118b);}function getUser(_0x46f31c,_0x5f03a3,_0x5ef070){if(!_['isNil'](_0x5f03a3)&&intUtil[_0x28c2('0x21')](_0x5f03a3)){var _0x1a732b={'Email':_0x5f03a3};var _0x59095d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5ef070[_0x28c2('0x22')](_0x28c2('0x23'))['find'](_0x1a732b,_0x59095d)[_0x28c2('0x24')]()['then'](function(_0x28c3ec){if(_0x28c3ec[_0x28c2('0x25')]){var _0x5bd347=_[_0x28c2('0x26')](_0x28c3ec,function(_0x419464){return _0x419464[_0x28c2('0x27')]===_0x5f03a3;});if(_0x5bd347){logger['info'](_0x28c2('0x28'),_0x5f03a3);return BPromise['resolve']({'id':_0x5bd347['Id'],'name':_0x5bd347['Name']});}}else{logger[_0x28c2('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5f03a3);return _0x5ef070[_0x28c2('0x29')]()['then'](function(_0x387bfa){return BPromise[_0x28c2('0x2a')]({'id':_0x387bfa[_0x28c2('0x2b')],'name':_0x387bfa[_0x28c2('0x2c')]});});}});}else{logger[_0x28c2('0x1f')](_0x28c2('0x2d'),_0x5f03a3);return _0x5ef070['identity']()[_0x28c2('0x2e')](function(_0x439edc){return BPromise[_0x28c2('0x2a')]({'id':_0x439edc[_0x28c2('0x2b')],'name':_0x439edc[_0x28c2('0x2c')]});});}}function getEndUser(_0x55f82a,_0x2ac299,_0x338b62,_0x3118ca,_0x1bdf42){var _0xc7a446={'$or':{'Phone':_0x3118ca}};var _0x371516={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x28c2('0x2a')]()['then'](function(){logger[_0x28c2('0x1f')](_0x28c2('0x2f'),_0x3118ca,_0x2ac299[_0x28c2('0x30')]);switch(_0x2ac299['moduleSearch']){case _0x28c2('0x31'):var _0x3b15a8=_['cloneDeep'](_0xc7a446);if(_0x2ac299[_0x28c2('0x32')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x32')]]=_0x3118ca;_[_0x28c2('0x33')](_0x3b15a8['$or'],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Contact')[_0x28c2('0x26')](_0x3b15a8,_0x371516)[_0x28c2('0x24')]()[_0x28c2('0x2e')](function(_0x131883){if(_0x131883&&_0x131883[_0x28c2('0x25')]){return _0x131883;}else{var _0x502fe4=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x35')]){var _0x5b1469={};_0x5b1469[_0x2ac299[_0x28c2('0x35')]]=_0x3118ca;_[_0x28c2('0x33')](_0x502fe4[_0x28c2('0x36')],_0x5b1469);}return _0x1bdf42[_0x28c2('0x22')](_0x28c2('0x37'))[_0x28c2('0x26')](_0x502fe4,_0x371516);}});case _0x28c2('0x38'):var _0x49277b=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x39')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x39')]]=_0x3118ca;_[_0x28c2('0x33')](_0x49277b[_0x28c2('0x36')],_0x37bc33);}return _0x1bdf42['sobject']('Account')[_0x28c2('0x26')](_0x49277b,_0x371516)[_0x28c2('0x24')]()[_0x28c2('0x2e')](function(_0x3875af){if(_0x3875af&&_0x3875af[_0x28c2('0x25')]){return _0x3875af;}else{var _0x3de5c9=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299['additionalSearchContact']){var _0x30d4f6={};_0x30d4f6[_0x2ac299[_0x28c2('0x32')]]=_0x3118ca;_[_0x28c2('0x33')](_0x3de5c9[_0x28c2('0x36')],_0x30d4f6);}return _0x1bdf42[_0x28c2('0x22')](_0x28c2('0x3a'))[_0x28c2('0x26')](_0x3de5c9,_0x371516)[_0x28c2('0x2e')](function(_0x2e786b){if(_0x2e786b&&_0x2e786b[_0x28c2('0x25')]){return _0x2e786b;}else{var _0x3cf14f=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x35')]){var _0x118f60={};_0x118f60[_0x2ac299[_0x28c2('0x35')]]=_0x3118ca;_['merge'](_0x3cf14f[_0x28c2('0x36')],_0x118f60);}return _0x1bdf42[_0x28c2('0x22')](_0x28c2('0x37'))[_0x28c2('0x26')](_0x3cf14f,_0x371516);}});}});case _0x28c2('0x17'):var _0x3b15a8=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x32')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x32')]]=_0x3118ca;_[_0x28c2('0x33')](_0x3b15a8[_0x28c2('0x36')],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Contact')['find'](_0x3b15a8,_0x371516)[_0x28c2('0x24')]();case _0x28c2('0x18'):var _0x216b40=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x35')]){var _0x37bc33={};_0x37bc33[_0x2ac299[_0x28c2('0x35')]]=_0x3118ca;_['merge'](_0x216b40['$or'],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Lead')[_0x28c2('0x26')](_0x216b40,_0x371516);case'account':var _0x49277b=_[_0x28c2('0x34')](_0xc7a446);if(_0x2ac299[_0x28c2('0x39')]){var _0x37bc33={};_0x37bc33[_0x2ac299['additionalSearchAccount']]=_0x3118ca;_[_0x28c2('0x33')](_0x49277b['$or'],_0x37bc33);}return _0x1bdf42[_0x28c2('0x22')]('Account')[_0x28c2('0x26')](_0x49277b,_0x371516);default:return null;}})[_0x28c2('0x2e')](function(_0x2ad8e1){if(_0x2ad8e1&&_0x2ad8e1[_0x28c2('0x25')]){var _0x528c0d=_[_0x28c2('0x3b')](_0x2ad8e1);if(_0x528c0d){return BPromise['resolve']({'id':_0x528c0d['Id'],'name':_0x528c0d['Name'],'phone':_0x528c0d[_0x28c2('0x3c')],'endUserType':_0x528c0d[_0x28c2('0x3d')][_0x28c2('0x3e')]['toLowerCase']()});}}})[_0x28c2('0x2e')](function(_0x4f6b9a){if(_0x4f6b9a){logger['info'](_0x28c2('0x3f'),_0x4f6b9a['endUserType'],_0x3118ca);return BPromise[_0x28c2('0x2a')](_0x4f6b9a);}else{logger[_0x28c2('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x3118ca);var _0x4f8587={'Phone':_0x3118ca};if(_0x2ac299[_0x28c2('0x40')]){if(_0x2ac299[_0x28c2('0x40')]===_0x28c2('0x17')){logger[_0x28c2('0x1f')](_0x28c2('0x41'),_0x3118ca,_0x2ac299[_0x28c2('0x40')]);_0x4f8587[_0x28c2('0x42')]=_0x338b62!==_0x28c2('0x43')?_0x338b62:util[_0x28c2('0x44')](_0x28c2('0x45'),_0x3118ca);}else if(_0x2ac299[_0x28c2('0x40')]===_0x28c2('0x18')){logger[_0x28c2('0x1f')](_0x28c2('0x41'),_0x3118ca,_0x2ac299[_0x28c2('0x40')]);_0x4f8587[_0x28c2('0x42')]=_0x338b62!==_0x28c2('0x43')?_0x338b62:util['format'](_0x28c2('0x45'),_0x3118ca);_0x4f8587[_0x28c2('0x46')]=_0x28c2('0x47');}else if(_0x2ac299[_0x28c2('0x40')]===_0x28c2('0x1a')){logger[_0x28c2('0x1f')](_0x28c2('0x41'),_0x3118ca,_0x2ac299['moduleCreate']);_0x4f8587[_0x28c2('0x48')]=_0x338b62!==_0x28c2('0x43')?_0x338b62:util['format'](_0x28c2('0x45'),_0x3118ca);}else{return null;}}return _0x1bdf42[_0x28c2('0x22')](_['upperFirst'](_0x2ac299[_0x28c2('0x40')]))[_0x28c2('0x20')](_0x4f8587)[_0x28c2('0x2e')](function(_0x5e805c){return BPromise[_0x28c2('0x2a')]({'id':_0x5e805c['id'],'endUserType':_0x2ac299[_0x28c2('0x40')]});});}});}function getCustomFields(_0x302956,_0x1e678e){var _0x1fafda={};if(_0x302956[_0x28c2('0x25')]>0x0){_[_0x28c2('0x49')](_0x302956,function(_0x9ac590){if(_['includes'](['string',_0x28c2('0x4a')],_0x9ac590[_0x28c2('0x3e')])&&_0x9ac590[_0x28c2('0x4b')]){_0x1fafda[_0x9ac590[_0x28c2('0x4b')]]=_0x9ac590[_0x28c2('0x4c')]['toString']();}else if(_0x9ac590[_0x28c2('0x3e')]==='variable'&&_0x9ac590[_0x28c2('0x4d')]&&_0x9ac590['idField']){_0x1e678e[_0x9ac590[_0x28c2('0x4d')]]&&(_0x1fafda[_0x9ac590[_0x28c2('0x4b')]]=_0x1e678e[_0x9ac590[_0x28c2('0x4d')]][_0x28c2('0x4e')]());}else if(_0x9ac590[_0x28c2('0x3e')]===_0x28c2('0x4f')&&_0x9ac590['Variable']&&_0x9ac590[_0x28c2('0x50')][_0x28c2('0x51')]&&_0x9ac590['idField']){_0x1e678e[_0x9ac590[_0x28c2('0x50')][_0x28c2('0x51')][_0x28c2('0x52')]()]&&(_0x1fafda[_0x9ac590[_0x28c2('0x4b')]]=_0x1e678e[_0x9ac590[_0x28c2('0x50')][_0x28c2('0x51')]['toLowerCase']()][_0x28c2('0x4e')]());}});}return _0x1fafda;}function getConnection(_0x308beb){var _0x402c24=_0x308beb[_0x28c2('0x53')][_0x28c2('0x54')](_0x308beb['securityToken']);var _0x319e8d=new jsforce[(_0x28c2('0x55'))]({'oauth2':{'loginUrl':_0x308beb[_0x28c2('0x56')]||'https://login.salesforce.com','clientId':_0x308beb[_0x28c2('0x57')],'clientSecret':_0x308beb['clientSecret']}});return _0x319e8d[_0x28c2('0x58')](_0x308beb['username'],_0x402c24)[_0x28c2('0x2e')](function(){logger[_0x28c2('0x1f')](_0x28c2('0x59'));return _0x319e8d;});}exports['queue']=function(_0x4b93bc,_0x11118a,_0x141314,_0x1fc5a7,_0xf099e9,_0x36b4ff){var _0x3ec0f3,_0x8d4965,_0x4c7241,_0x461b3e;_0x36b4ff[_0x28c2('0x5a')]=intUtil['stripTrailingSlash'](_0x36b4ff['serverUrl']);_0x36b4ff[_0x28c2('0x56')]=intUtil[_0x28c2('0x5b')](_0x36b4ff[_0x28c2('0x56')]);if(_0xf099e9&&_0xf099e9['monitor_format']){logger[_0x28c2('0x1f')](_0x28c2('0x5c'),_0x28c2('0x5d'));_0x11118a[_0x28c2('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36b4ff[_0x28c2('0x5a')],_0x11118a[_0x28c2('0x5f')],md5(_0x11118a[_0x28c2('0x5f')]));}else{_0x11118a[_0x28c2('0x5e')]='';}return getConnection(_0x36b4ff)['then'](function(_0x3a3463){_0x461b3e=_0x3a3463;return getUser(_0x36b4ff,_0x1fc5a7['email'],_0x461b3e);})[_0x28c2('0x2e')](function(_0x1293c2){_0x3ec0f3=_0x1293c2;return getEndUser(_0x36b4ff,_0x141314,_0x11118a['calleridname'],_0x11118a[_0x28c2('0x60')],_0x461b3e);})['then'](function(_0x6fc6eb){_0x8d4965=_0x6fc6eb;return getTicket(_0x36b4ff,_0x3ec0f3,_0x8d4965,_0x141314,_0x11118a,_0x141314[_0x28c2('0x61')],_0x461b3e,_0x28c2('0x62'));})[_0x28c2('0x2e')](function(_0x45999b){_0x4c7241=_0x45999b;logger[_0x28c2('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4c7241['id']);logger[_0x28c2('0x1f')](_0x28c2('0x63'),_0x4c7241['id'],_0x1fc5a7[_0x28c2('0x51')],_0x36b4ff[_0x28c2('0x3e')]);switch(_0x36b4ff['type']){case _0x28c2('0x64'):emit(util[_0x28c2('0x44')](_0x28c2('0x65'),_0x1fc5a7[_0x28c2('0x51')]),_0x28c2('0x66'),{'recordId':_0x4c7241['id']});break;case _0x28c2('0x67'):emit(util[_0x28c2('0x44')](_0x28c2('0x65'),_0x1fc5a7[_0x28c2('0x51')]),_0x28c2('0x68'),{'uri':util['format']('%s/%s/e',_0x461b3e[_0x28c2('0x69')],_0x4c7241['id'])});break;default:logger[_0x28c2('0x6a')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x28c2('0x6b')](function(_0x3039a5){logger[_0x28c2('0x6a')](_0x28c2('0x5c'),_0x3039a5);});};exports[_0x28c2('0x6c')]=function(_0xb3ae23,_0x4dd603,_0x23af1e,_0x371a33,_0x29a69a,_0x14462e,_0x206f79){var _0x54d0d5,_0x5734ec,_0x40917b,_0x2130ed;_0x14462e[_0x28c2('0x5a')]=intUtil[_0x28c2('0x5b')](_0x14462e[_0x28c2('0x5a')]);_0x14462e[_0x28c2('0x56')]=intUtil[_0x28c2('0x5b')](_0x14462e[_0x28c2('0x56')]);if(_0x206f79&&_0x206f79[_0x28c2('0x6d')]&&_0x206f79['recordingFormat']!=='none'){logger['info'](_0x28c2('0x6e'),_0x28c2('0x5d'));_0x4dd603[_0x28c2('0x5e')]=util[_0x28c2('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14462e[_0x28c2('0x5a')],_0x4dd603[_0x28c2('0x5f')],md5(_0x4dd603['uniqueid']));}return getConnection(_0x14462e)[_0x28c2('0x2e')](function(_0x352f0a){_0x2130ed=_0x352f0a;return getUser(_0x14462e,_0x371a33[_0x28c2('0x6f')],_0x2130ed);})[_0x28c2('0x2e')](function(_0x1a66ae){_0x54d0d5=_0x1a66ae;return getEndUser(_0x14462e,_0x23af1e,_0x4dd603[_0x28c2('0x70')],_0x4dd603[_0x28c2('0x71')],_0x2130ed);})[_0x28c2('0x2e')](function(_0x131970){_0x5734ec=_0x131970;return getTicket(_0x14462e,_0x54d0d5,_0x5734ec,_0x23af1e,_0x4dd603,_0x23af1e[_0x28c2('0x61')],_0x2130ed,'outbound');})[_0x28c2('0x2e')](function(_0x99f4c4){_0x40917b=_0x99f4c4;logger[_0x28c2('0x1f')](_0x28c2('0x72'),_0x40917b['id']);logger[_0x28c2('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x40917b['id'],_0x371a33[_0x28c2('0x51')],_0x14462e['type']);switch(_0x14462e[_0x28c2('0x3e')]){case _0x28c2('0x64'):emit(util[_0x28c2('0x44')]('user:%s',_0x371a33['name']),_0x28c2('0x66'),{'recordId':_0x40917b['id']});break;case _0x28c2('0x67'):emit(util['format'](_0x28c2('0x65'),_0x371a33[_0x28c2('0x51')]),_0x28c2('0x68'),{'uri':util[_0x28c2('0x44')](_0x28c2('0x73'),_0x2130ed['instanceUrl'],_0x40917b['id'])});break;default:logger[_0x28c2('0x6a')](_0x28c2('0x6e'),_0x28c2('0x74'));}})[_0x28c2('0x6b')](function(_0x373bf9){logger[_0x28c2('0x6a')](_0x28c2('0x6e'),_0x373bf9);});};exports[_0x28c2('0x75')]=function(_0x5962a8,_0xbcc846,_0x3438cd,_0x179e33,_0x4e2d30,_0x54055a){var _0x1ad50e,_0x304966,_0x32c783,_0xf68a64;_0x54055a['serverUrl']=intUtil['stripTrailingSlash'](_0x54055a[_0x28c2('0x5a')]);_0x54055a[_0x28c2('0x56')]=intUtil[_0x28c2('0x5b')](_0x54055a[_0x28c2('0x56')]);if(_0x4e2d30&&_0x4e2d30['monitor_format']){logger[_0x28c2('0x1f')]('['+_0xbcc846[_0x28c2('0x76')][_0x28c2('0x77')]()+']',_0x28c2('0x5d'));_0xbcc846[_0x28c2('0x5e')]=util['format'](_0x28c2('0x78'),_0x54055a[_0x28c2('0x5a')],_0xbcc846[_0x28c2('0x5f')],md5(_0xbcc846[_0x28c2('0x5f')]));}else{_0xbcc846[_0x28c2('0x5e')]='';}return getConnection(_0x54055a)['then'](function(_0x10c195){_0xf68a64=_0x10c195;if(!_[_0x28c2('0x79')](_0x179e33)){return getUser(_0x54055a,_0x179e33[_0x28c2('0x51')],_0xf68a64);}else{return getUser(_0x54055a,null,_0xf68a64);}})[_0x28c2('0x2e')](function(_0x54a2da){_0x1ad50e=_0x54a2da;return getEndUser(_0x54055a,_0x3438cd,_0xbcc846[_0x28c2('0x7a')],_0xbcc846[_0x28c2('0x60')],_0xf68a64);})['then'](function(_0x5bd98a){_0x304966=_0x5bd98a;return getTicket(_0x54055a,_0x1ad50e,_0x304966,_0x3438cd,_0xbcc846,_0x3438cd[_0x28c2('0x61')],_0xf68a64);})[_0x28c2('0x2e')](function(_0x59704b){_0x32c783=_0x59704b;logger[_0x28c2('0x1f')]('['+_0xbcc846['lastevent']['toUpperCase']()+_0x28c2('0x7b'),_0x32c783['id']);logger[_0x28c2('0x1f')]('['+_0xbcc846[_0x28c2('0x76')][_0x28c2('0x77')]()+_0x28c2('0x7c'),_0x54055a['type']);})['catch'](function(_0x3337a8){logger[_0x28c2('0x6a')]('['+_0xbcc846[_0x28c2('0x76')][_0x28c2('0x77')]()+']',_0x3337a8);});};
\ No newline at end of file
+var _0x9dd4=['../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','length','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','find','Account','Contact','additionalSearchAccount','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','picklist','toString','variable','variableName','idField','Variable','name','password','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','error','recordingFormat','none','[OUTBOUND]','recordingURL','uniqueid','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x2008d3,_0x551156){var _0x57d2a6=function(_0x59951b){while(--_0x59951b){_0x2008d3['push'](_0x2008d3['shift']());}};_0x57d2a6(++_0x551156);}(_0x9dd4,0x1df));var _0x49dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x49dd('0x0'));var rp=require(_0x49dd('0x1'));var moment=require(_0x49dd('0x2'));var BPromise=require(_0x49dd('0x3'));var md5=require(_0x49dd('0x4'));var jsforce=require('jsforce');var util=require(_0x49dd('0x5'));var Redis=require(_0x49dd('0x6'));var intUtil=require(_0x49dd('0x7'));var config=require(_0x49dd('0x8'));var logger=require(_0x49dd('0x9'))(_0x49dd('0xa'));config['redis']=_[_0x49dd('0xb')](config[_0x49dd('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x49dd('0xd'))(new Redis(config[_0x49dd('0xc')]));function emit(_0x570005,_0x145fe8,_0x1444b9){io['to'](_0x570005)[_0x49dd('0xe')](_0x145fe8,_0x1444b9);}function getTicket(_0x4eeee0,_0x2b0d6d,_0x254091,_0xa7ac37,_0x1e45dd,_0x1753a1,_0x752210,_0x514efc){var _0xb5cb8c=Object['assign']({},{'OwnerId':_0x2b0d6d['id'],'Subject':intUtil[_0x49dd('0xf')](_0xa7ac37[_0x49dd('0x10')],_0x1e45dd,'\x20'),'Description':intUtil['getString'](_0xa7ac37[_0x49dd('0x11')],_0x1e45dd,'\x0a')},getCustomFields(_0x1753a1,_0x1e45dd));if(_0x254091){if(_0xa7ac37[_0x49dd('0x12')]===_0x49dd('0x13')){_0xb5cb8c[_0x49dd('0x14')]=moment['utc']();_0xb5cb8c[_0x49dd('0x15')]=![];_0xb5cb8c[_0x49dd('0x16')]=![];if(_0x254091[_0x49dd('0x17')]===_0x49dd('0x18')||_0x254091['endUserType']===_0x49dd('0x19')){_0xb5cb8c[_0x49dd('0x1a')]=_0x254091['id'];}else if(_0x254091[_0x49dd('0x17')]===_0x49dd('0x1b')){_0xb5cb8c['WhatId']=_0x254091['id'];}}else if(_0xa7ac37['ticketType']===_0x49dd('0x1c')){if(_0x254091[_0x49dd('0x17')]==='contact'){_0xb5cb8c[_0x49dd('0x1d')]=_0x254091['id'];}else if(_0x254091['endUserType']===_0x49dd('0x1b')){_0xb5cb8c[_0x49dd('0x1e')]=_0x254091['id'];}else if(_0x254091[_0x49dd('0x17')]==='lead'&&_0xa7ac37[_0x49dd('0x1f')]){_0xb5cb8c[_0xa7ac37[_0x49dd('0x1f')]]=_0x254091['id'];}else{logger[_0x49dd('0x20')](_0x49dd('0x21'));}}}return _0x752210[_0x49dd('0x22')](_0xa7ac37['ticketType'])[_0x49dd('0x23')](_0xb5cb8c);}function getUser(_0x958f39,_0xac2547,_0x1da0d6){if(!_[_0x49dd('0x24')](_0xac2547)&&intUtil[_0x49dd('0x25')](_0xac2547)){var _0x1f5bdc={'Email':_0xac2547};var _0x2871f0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1da0d6[_0x49dd('0x22')](_0x49dd('0x26'))['find'](_0x1f5bdc,_0x2871f0)[_0x49dd('0x27')]()[_0x49dd('0x28')](function(_0x3fce50){if(_0x3fce50[_0x49dd('0x29')]){var _0x2c8672=_['find'](_0x3fce50,function(_0x1c06f6){return _0x1c06f6[_0x49dd('0x2a')]===_0xac2547;});if(_0x2c8672){logger[_0x49dd('0x20')](_0x49dd('0x2b'),_0xac2547);return BPromise['resolve']({'id':_0x2c8672['Id'],'name':_0x2c8672[_0x49dd('0x2c')]});}}else{logger[_0x49dd('0x20')](_0x49dd('0x2d'),_0xac2547);return _0x1da0d6[_0x49dd('0x2e')]()[_0x49dd('0x28')](function(_0x354fe6){return BPromise['resolve']({'id':_0x354fe6[_0x49dd('0x2f')],'name':_0x354fe6[_0x49dd('0x30')]});});}});}else{logger[_0x49dd('0x20')](_0x49dd('0x2d'),_0xac2547);return _0x1da0d6[_0x49dd('0x2e')]()[_0x49dd('0x28')](function(_0x4b0fb6){return BPromise['resolve']({'id':_0x4b0fb6[_0x49dd('0x2f')],'name':_0x4b0fb6['display_name']});});}}function getEndUser(_0x574322,_0x2598ec,_0x386477,_0x3676f7,_0x4fe702){var _0x6b67a4={'$or':{'Phone':_0x3676f7}};var _0x1e90fe={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x49dd('0x31')]()[_0x49dd('0x28')](function(){logger[_0x49dd('0x20')](_0x49dd('0x32'),_0x3676f7,_0x2598ec[_0x49dd('0x33')]);switch(_0x2598ec[_0x49dd('0x33')]){case'contact_lead':var _0x1ff732=_[_0x49dd('0x34')](_0x6b67a4);if(_0x2598ec[_0x49dd('0x35')]){var _0x54a49e={};_0x54a49e[_0x2598ec[_0x49dd('0x35')]]=_0x3676f7;_[_0x49dd('0x36')](_0x1ff732[_0x49dd('0x37')],_0x54a49e);}return _0x4fe702[_0x49dd('0x22')]('Contact')['find'](_0x1ff732,_0x1e90fe)['execute']()[_0x49dd('0x28')](function(_0x2cfb14){if(_0x2cfb14&&_0x2cfb14[_0x49dd('0x29')]){return _0x2cfb14;}else{var _0x166512=_['cloneDeep'](_0x6b67a4);if(_0x2598ec[_0x49dd('0x38')]){var _0x2cf318={};_0x2cf318[_0x2598ec[_0x49dd('0x38')]]=_0x3676f7;_[_0x49dd('0x36')](_0x166512[_0x49dd('0x37')],_0x2cf318);}return _0x4fe702[_0x49dd('0x22')](_0x49dd('0x39'))[_0x49dd('0x3a')](_0x166512,_0x1e90fe);}});case'account_contact_lead':var _0x29aebf=_[_0x49dd('0x34')](_0x6b67a4);if(_0x2598ec['additionalSearchAccount']){var _0x54a49e={};_0x54a49e[_0x2598ec['additionalSearchAccount']]=_0x3676f7;_[_0x49dd('0x36')](_0x29aebf[_0x49dd('0x37')],_0x54a49e);}return _0x4fe702[_0x49dd('0x22')](_0x49dd('0x3b'))['find'](_0x29aebf,_0x1e90fe)[_0x49dd('0x27')]()[_0x49dd('0x28')](function(_0x522baf){if(_0x522baf&&_0x522baf[_0x49dd('0x29')]){return _0x522baf;}else{var _0x546363=_[_0x49dd('0x34')](_0x6b67a4);if(_0x2598ec['additionalSearchContact']){var _0x499ccb={};_0x499ccb[_0x2598ec['additionalSearchContact']]=_0x3676f7;_[_0x49dd('0x36')](_0x546363['$or'],_0x499ccb);}return _0x4fe702[_0x49dd('0x22')](_0x49dd('0x3c'))[_0x49dd('0x3a')](_0x546363,_0x1e90fe)[_0x49dd('0x28')](function(_0x1bb87e){if(_0x1bb87e&&_0x1bb87e[_0x49dd('0x29')]){return _0x1bb87e;}else{var _0x3fbf60=_['cloneDeep'](_0x6b67a4);if(_0x2598ec[_0x49dd('0x38')]){var _0xa36683={};_0xa36683[_0x2598ec['additionalSearchLead']]=_0x3676f7;_[_0x49dd('0x36')](_0x3fbf60[_0x49dd('0x37')],_0xa36683);}return _0x4fe702['sobject'](_0x49dd('0x39'))[_0x49dd('0x3a')](_0x3fbf60,_0x1e90fe);}});}});case'contact':var _0x1ff732=_[_0x49dd('0x34')](_0x6b67a4);if(_0x2598ec['additionalSearchContact']){var _0x54a49e={};_0x54a49e[_0x2598ec[_0x49dd('0x35')]]=_0x3676f7;_[_0x49dd('0x36')](_0x1ff732[_0x49dd('0x37')],_0x54a49e);}return _0x4fe702['sobject']('Contact')[_0x49dd('0x3a')](_0x1ff732,_0x1e90fe)[_0x49dd('0x27')]();case _0x49dd('0x19'):var _0x205f17=_[_0x49dd('0x34')](_0x6b67a4);if(_0x2598ec[_0x49dd('0x38')]){var _0x54a49e={};_0x54a49e[_0x2598ec[_0x49dd('0x38')]]=_0x3676f7;_[_0x49dd('0x36')](_0x205f17[_0x49dd('0x37')],_0x54a49e);}return _0x4fe702['sobject'](_0x49dd('0x39'))[_0x49dd('0x3a')](_0x205f17,_0x1e90fe);case'account':var _0x29aebf=_[_0x49dd('0x34')](_0x6b67a4);if(_0x2598ec['additionalSearchAccount']){var _0x54a49e={};_0x54a49e[_0x2598ec[_0x49dd('0x3d')]]=_0x3676f7;_[_0x49dd('0x36')](_0x29aebf[_0x49dd('0x37')],_0x54a49e);}return _0x4fe702[_0x49dd('0x22')](_0x49dd('0x3b'))[_0x49dd('0x3a')](_0x29aebf,_0x1e90fe);default:return null;}})['then'](function(_0xb8cd98){if(_0xb8cd98&&_0xb8cd98[_0x49dd('0x29')]){var _0x4466ed=_['first'](_0xb8cd98);if(_0x4466ed){return BPromise[_0x49dd('0x31')]({'id':_0x4466ed['Id'],'name':_0x4466ed[_0x49dd('0x2c')],'phone':_0x4466ed[_0x49dd('0x3e')],'endUserType':_0x4466ed[_0x49dd('0x3f')][_0x49dd('0x40')][_0x49dd('0x41')]()});}}})[_0x49dd('0x28')](function(_0x1b6876){if(_0x1b6876){logger[_0x49dd('0x20')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x1b6876[_0x49dd('0x17')],_0x3676f7);return BPromise[_0x49dd('0x31')](_0x1b6876);}else{logger['info'](_0x49dd('0x42'),_0x3676f7);var _0xd9d9b4={'Phone':_0x3676f7};if(_0x2598ec[_0x49dd('0x43')]){if(_0x2598ec[_0x49dd('0x43')]===_0x49dd('0x18')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3676f7,_0x2598ec[_0x49dd('0x43')]);_0xd9d9b4[_0x49dd('0x44')]=_0x386477!==_0x49dd('0x45')?_0x386477:util[_0x49dd('0x46')](_0x49dd('0x47'),_0x3676f7);}else if(_0x2598ec[_0x49dd('0x43')]===_0x49dd('0x19')){logger[_0x49dd('0x20')](_0x49dd('0x48'),_0x3676f7,_0x2598ec[_0x49dd('0x43')]);_0xd9d9b4[_0x49dd('0x44')]=_0x386477!==_0x49dd('0x45')?_0x386477:util[_0x49dd('0x46')](_0x49dd('0x47'),_0x3676f7);_0xd9d9b4['Company']=_0x49dd('0x49');}else if(_0x2598ec[_0x49dd('0x43')]===_0x49dd('0x1b')){logger[_0x49dd('0x20')](_0x49dd('0x48'),_0x3676f7,_0x2598ec[_0x49dd('0x43')]);_0xd9d9b4[_0x49dd('0x2c')]=_0x386477!==_0x49dd('0x45')?_0x386477:util[_0x49dd('0x46')](_0x49dd('0x47'),_0x3676f7);}else{return null;}}return _0x4fe702[_0x49dd('0x22')](_['upperFirst'](_0x2598ec['moduleCreate']))[_0x49dd('0x23')](_0xd9d9b4)[_0x49dd('0x28')](function(_0x2cef53){return BPromise[_0x49dd('0x31')]({'id':_0x2cef53['id'],'endUserType':_0x2598ec[_0x49dd('0x43')]});});}});}function getCustomFields(_0x58a64e,_0x2c0a4f){var _0x146d1a={};if(_0x58a64e['length']>0x0){_['forEach'](_0x58a64e,function(_0x2c206a){if(_['includes'](['string',_0x49dd('0x4a')],_0x2c206a['type'])&&_0x2c206a['idField']){_0x146d1a[_0x2c206a['idField']]=_0x2c206a['content'][_0x49dd('0x4b')]();}else if(_0x2c206a[_0x49dd('0x40')]===_0x49dd('0x4c')&&_0x2c206a[_0x49dd('0x4d')]&&_0x2c206a[_0x49dd('0x4e')]){_0x2c0a4f[_0x2c206a[_0x49dd('0x4d')]]&&(_0x146d1a[_0x2c206a[_0x49dd('0x4e')]]=_0x2c0a4f[_0x2c206a['variableName']][_0x49dd('0x4b')]());}else if(_0x2c206a[_0x49dd('0x40')]==='customVariable'&&_0x2c206a[_0x49dd('0x4f')]&&_0x2c206a[_0x49dd('0x4f')]['name']&&_0x2c206a[_0x49dd('0x4e')]){_0x2c0a4f[_0x2c206a['Variable'][_0x49dd('0x50')]['toLowerCase']()]&&(_0x146d1a[_0x2c206a[_0x49dd('0x4e')]]=_0x2c0a4f[_0x2c206a[_0x49dd('0x4f')][_0x49dd('0x50')][_0x49dd('0x41')]()][_0x49dd('0x4b')]());}});}return _0x146d1a;}function getConnection(_0x4d42c9){var _0xa3fe02=_0x4d42c9[_0x49dd('0x51')]['concat'](_0x4d42c9['securityToken']);var _0x23b6fb=new jsforce[(_0x49dd('0x52'))]({'oauth2':{'loginUrl':_0x4d42c9[_0x49dd('0x53')]||_0x49dd('0x54'),'clientId':_0x4d42c9[_0x49dd('0x55')],'clientSecret':_0x4d42c9[_0x49dd('0x56')]}});return _0x23b6fb[_0x49dd('0x57')](_0x4d42c9[_0x49dd('0x58')],_0xa3fe02)[_0x49dd('0x28')](function(){logger[_0x49dd('0x20')]('Connection\x20established.');return _0x23b6fb;});}exports[_0x49dd('0x59')]=function(_0x168556,_0x5e07df,_0x176878,_0x1d634d,_0x12248f,_0x2335b4){var _0xc2dbfa,_0x28a872,_0x51210e,_0x31096b;_0x2335b4[_0x49dd('0x5a')]=intUtil[_0x49dd('0x5b')](_0x2335b4[_0x49dd('0x5a')]);_0x2335b4[_0x49dd('0x53')]=intUtil[_0x49dd('0x5b')](_0x2335b4['remoteUri']);if(_0x12248f&&_0x12248f[_0x49dd('0x5c')]){logger[_0x49dd('0x20')](_0x49dd('0x5d'),_0x49dd('0x5e'));_0x5e07df['recordingURL']=util[_0x49dd('0x46')](_0x49dd('0x5f'),_0x2335b4['serverUrl'],_0x5e07df['uniqueid'],md5(_0x5e07df['uniqueid']));}else{_0x5e07df['recordingURL']='';}return getConnection(_0x2335b4)[_0x49dd('0x28')](function(_0x1a0dca){_0x31096b=_0x1a0dca;return getUser(_0x2335b4,_0x1d634d['email'],_0x31096b);})['then'](function(_0x190304){_0xc2dbfa=_0x190304;return getEndUser(_0x2335b4,_0x176878,_0x5e07df[_0x49dd('0x60')],_0x5e07df['calleridnum'],_0x31096b);})[_0x49dd('0x28')](function(_0x26fffe){_0x28a872=_0x26fffe;return getTicket(_0x2335b4,_0xc2dbfa,_0x28a872,_0x176878,_0x5e07df,_0x176878['Fields'],_0x31096b,_0x49dd('0x59'));})[_0x49dd('0x28')](function(_0xda00e4){_0x51210e=_0xda00e4;logger[_0x49dd('0x20')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x51210e['id']);logger['info'](_0x49dd('0x61'),_0x51210e['id'],_0x1d634d[_0x49dd('0x50')],_0x2335b4[_0x49dd('0x40')]);switch(_0x2335b4['type']){case'integrationTab':emit(util['format'](_0x49dd('0x62'),_0x1d634d[_0x49dd('0x50')]),_0x49dd('0x63'),{'recordId':_0x51210e['id']});break;case _0x49dd('0x64'):emit(util[_0x49dd('0x46')](_0x49dd('0x62'),_0x1d634d['name']),_0x49dd('0x65'),{'uri':util[_0x49dd('0x46')](_0x49dd('0x66'),_0x31096b[_0x49dd('0x67')],_0x51210e['id'])});break;default:logger['error'](_0x49dd('0x68'));}})['catch'](function(_0xbb885){logger[_0x49dd('0x69')](_0x49dd('0x5d'),_0xbb885);});};exports['outbound']=function(_0x5e2836,_0x2bb9cd,_0x5b8ef8,_0x1928dc,_0x553bc3,_0x1b6d8b,_0x48c90e){var _0x214319,_0x3efd66,_0x60bef8,_0x264a98;_0x1b6d8b[_0x49dd('0x5a')]=intUtil[_0x49dd('0x5b')](_0x1b6d8b[_0x49dd('0x5a')]);_0x1b6d8b[_0x49dd('0x53')]=intUtil[_0x49dd('0x5b')](_0x1b6d8b['remoteUri']);if(_0x48c90e&&_0x48c90e[_0x49dd('0x6a')]&&_0x48c90e['recordingFormat']!==_0x49dd('0x6b')){logger['info'](_0x49dd('0x6c'),_0x49dd('0x5e'));_0x2bb9cd[_0x49dd('0x6d')]=util[_0x49dd('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b6d8b['serverUrl'],_0x2bb9cd[_0x49dd('0x6e')],md5(_0x2bb9cd[_0x49dd('0x6e')]));}return getConnection(_0x1b6d8b)[_0x49dd('0x28')](function(_0x22362c){_0x264a98=_0x22362c;return getUser(_0x1b6d8b,_0x1928dc['email'],_0x264a98);})[_0x49dd('0x28')](function(_0x7d2cbc){_0x214319=_0x7d2cbc;return getEndUser(_0x1b6d8b,_0x5b8ef8,_0x2bb9cd[_0x49dd('0x6f')],_0x2bb9cd[_0x49dd('0x70')],_0x264a98);})[_0x49dd('0x28')](function(_0x5770f2){_0x3efd66=_0x5770f2;return getTicket(_0x1b6d8b,_0x214319,_0x3efd66,_0x5b8ef8,_0x2bb9cd,_0x5b8ef8[_0x49dd('0x71')],_0x264a98,'outbound');})[_0x49dd('0x28')](function(_0x4ea4ac){_0x60bef8=_0x4ea4ac;logger[_0x49dd('0x20')](_0x49dd('0x72'),_0x60bef8['id']);logger[_0x49dd('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x60bef8['id'],_0x1928dc[_0x49dd('0x50')],_0x1b6d8b[_0x49dd('0x40')]);switch(_0x1b6d8b['type']){case _0x49dd('0x73'):emit(util[_0x49dd('0x46')]('user:%s',_0x1928dc[_0x49dd('0x50')]),_0x49dd('0x63'),{'recordId':_0x60bef8['id']});break;case'newTab':emit(util[_0x49dd('0x46')]('user:%s',_0x1928dc['name']),'trigger:browser:url',{'uri':util[_0x49dd('0x46')]('%s/%s/e',_0x264a98[_0x49dd('0x67')],_0x60bef8['id'])});break;default:logger[_0x49dd('0x69')](_0x49dd('0x6c'),_0x49dd('0x74'));}})['catch'](function(_0x577f27){logger[_0x49dd('0x69')](_0x49dd('0x6c'),_0x577f27);});};exports['unmanaged']=function(_0x508959,_0x1f8a2f,_0xd63d39,_0x5ca8d1,_0x50c099,_0x4976f6){var _0x55bdc4,_0x1b96a6,_0x5c6bad,_0x1a773b;_0x4976f6['serverUrl']=intUtil[_0x49dd('0x5b')](_0x4976f6[_0x49dd('0x5a')]);_0x4976f6['remoteUri']=intUtil[_0x49dd('0x5b')](_0x4976f6[_0x49dd('0x53')]);if(_0x50c099&&_0x50c099[_0x49dd('0x5c')]){logger['info']('['+_0x1f8a2f[_0x49dd('0x75')][_0x49dd('0x76')]()+']',_0x49dd('0x5e'));_0x1f8a2f['recordingURL']=util[_0x49dd('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4976f6[_0x49dd('0x5a')],_0x1f8a2f[_0x49dd('0x6e')],md5(_0x1f8a2f[_0x49dd('0x6e')]));}else{_0x1f8a2f[_0x49dd('0x6d')]='';}return getConnection(_0x4976f6)[_0x49dd('0x28')](function(_0x4077a4){_0x1a773b=_0x4077a4;if(!_['isNil'](_0x5ca8d1)){return getUser(_0x4976f6,_0x5ca8d1['name'],_0x1a773b);}else{return getUser(_0x4976f6,null,_0x1a773b);}})[_0x49dd('0x28')](function(_0x51b170){_0x55bdc4=_0x51b170;return getEndUser(_0x4976f6,_0xd63d39,_0x1f8a2f['calleridname'],_0x1f8a2f[_0x49dd('0x77')],_0x1a773b);})[_0x49dd('0x28')](function(_0x1e7517){_0x1b96a6=_0x1e7517;return getTicket(_0x4976f6,_0x55bdc4,_0x1b96a6,_0xd63d39,_0x1f8a2f,_0xd63d39['Fields'],_0x1a773b);})[_0x49dd('0x28')](function(_0x34671e){_0x5c6bad=_0x34671e;logger[_0x49dd('0x20')]('['+_0x1f8a2f['lastevent'][_0x49dd('0x76')]()+_0x49dd('0x78'),_0x5c6bad['id']);logger[_0x49dd('0x20')]('['+_0x1f8a2f['lastevent']['toUpperCase']()+_0x49dd('0x79'),_0x4976f6[_0x49dd('0x40')]);})['catch'](function(_0x58c7c9){logger[_0x49dd('0x69')]('['+_0x1f8a2f[_0x49dd('0x75')][_0x49dd('0x76')]()+']',_0x58c7c9);});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x463e=['email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','sys_id','adminEmail','error',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil'];(function(_0x4a5f59,_0x471f69){var _0x13740f=function(_0x36e80b){while(--_0x36e80b){_0x4a5f59['push'](_0x4a5f59['shift']());}};_0x13740f(++_0x471f69);}(_0x463e,0x1d6));var _0xe463=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x463e[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xe463('0x0'));var Promise=require(_0xe463('0x1'));var rp=require(_0xe463('0x2'));var util=require(_0xe463('0x3'));var md5=require(_0xe463('0x4'));var Redis=require(_0xe463('0x5'));var intUtil=require(_0xe463('0x6'));var config=require(_0xe463('0x7'));var logger=require(_0xe463('0x8'))(_0xe463('0x9'));config[_0xe463('0xa')]=_[_0xe463('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe463('0xa')]));function getAdminUser(_0x39efc1,_0x47135f,_0x2089cc,_0x3a4447,_0x305b07,_0x4d19bc){return new Promise(function(_0x2d8228,_0x5623c6){var _0x203e35={'method':_0xe463('0xc'),'uri':_0x3a4447+_0xe463('0xd')+'&'+_0x305b07+'&'+_0x4d19bc,'auth':_0x47135f,'json':!![]};return rp(_0x203e35)[_0xe463('0xe')](function(_0x21d3e5){if(_0x21d3e5[_0xe463('0xf')][_0xe463('0x10')]>0x0){_0x2089cc[_0xe463('0x11')]=_0x21d3e5[_0xe463('0xf')][0x0]['sys_id'];}logger[_0xe463('0x12')]('['+[_0x39efc1[_0xe463('0x13')]()]+_0xe463('0x14'),_0x2089cc);_0x2d8228(_0x2089cc);})['catch'](function(_0x438574){logger['error']('['+[_0x39efc1[_0xe463('0x13')]()]+']',_0x438574[_0xe463('0x15')]);_0x5623c6(_0x438574[_0xe463('0x15')]);});});}function getUser(_0x28e5c9,_0x511311,_0x349095,_0x9f2f,_0x8e4df6){return function(_0xd83804){logger[_0xe463('0x12')]('['+[_0x28e5c9[_0xe463('0x13')]()]+_0xe463('0x16'),_0xd83804);return new Promise(function(_0x4d750b,_0x1eead3){if(intUtil['validateEmail'](_0xd83804[_0xe463('0x17')])){var _0x1f919a={'method':'GET','uri':_0x349095+_0xe463('0x18')+_0xd83804[_0xe463('0x17')]+'&'+_0x9f2f+'&'+_0x8e4df6,'auth':_0x511311,'json':!![]};logger['info']('['+[_0x28e5c9[_0xe463('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x1f919a);return rp(_0x1f919a)[_0xe463('0xe')](function(_0x48362d){logger[_0xe463('0x12')]('['+[_0x28e5c9[_0xe463('0x13')]()]+_0xe463('0x19'),_0x48362d);if(_0x48362d[_0xe463('0xf')][_0xe463('0x10')]>0x0&&String(_0x48362d['result'][0x0][_0xe463('0x1a')])===_0xe463('0x1b')){_0xd83804['userId']=_0x48362d[_0xe463('0xf')][0x0][_0xe463('0x1c')];}else{_0xd83804['userId']=_0xd83804[_0xe463('0x11')];_0xd83804[_0xe463('0x17')]=_0xd83804[_0xe463('0x1d')];}logger[_0xe463('0x12')]('['+[_0x28e5c9[_0xe463('0x13')]()]+'],\x20getUser\x20crm',_0xd83804);_0x4d750b(_0xd83804);})['catch'](function(_0x494a90){logger[_0xe463('0x1e')]('['+[_0x28e5c9[_0xe463('0x13')]()]+']',_0x494a90[_0xe463('0x15')]);_0x1eead3(_0x494a90[_0xe463('0x15')]);});}else{logger[_0xe463('0x12')]('['+[_0x28e5c9['toUpperCase']()]+_0xe463('0x1f'));_0xd83804[_0xe463('0x20')]=_0xd83804[_0xe463('0x11')];_0xd83804[_0xe463('0x17')]=_0xd83804[_0xe463('0x1d')];_0x4d750b(_0xd83804);}});};}function createEndUser(_0xafe15d,_0x4d87a2,_0x187d38,_0x5580c7,_0x210e6a){logger[_0xe463('0x12')]('['+[_0xafe15d[_0xe463('0x13')]()]+_0xe463('0x21'),_0x187d38);return new Promise(function(_0x3b10ca,_0x4c1eca){var _0x4cd456={'method':_0xe463('0x22'),'uri':_0x5580c7+_0xe463('0x23')+_0x210e6a,'body':{'user_name':_0x187d38[_0xe463('0x24')],'roles':'user','first_name':_0x187d38[_0xe463('0x24')],'active':_0xe463('0x1b'),'date_format':_0xe463('0x25'),'phone':_0x187d38['endUserNumber']},'auth':_0x4d87a2,'json':!![]};return rp(_0x4cd456)['then'](function(_0xb4a4df){logger[_0xe463('0x12')]('['+[_0xafe15d[_0xe463('0x13')]()]+_0xe463('0x26'),_0xb4a4df['result']);_0x187d38['endUserId']=_0xb4a4df[_0xe463('0xf')]['sys_id'];_0x3b10ca(_0x187d38);})[_0xe463('0x27')](function(_0x35469c){logger['error']('['+[_0xafe15d[_0xe463('0x13')]()]+']',_0x35469c[_0xe463('0x15')]);_0x4c1eca(_0x35469c[_0xe463('0x15')]);});});}function getEndUser(_0x2bf005,_0x2e3114,_0x5f1bff,_0x209089,_0x53cdd2){return function(_0x1b4a36){logger[_0xe463('0x12')]('['+[_0x2bf005[_0xe463('0x13')]()]+_0xe463('0x28'),_0x1b4a36);return new Promise(function(_0x548109,_0x3acf13){var _0x4e414f={'method':_0xe463('0xc'),'uri':_0x5f1bff+_0xe463('0x29')+_0x1b4a36[_0xe463('0x24')]+'&'+_0x209089+'&'+_0x53cdd2,'auth':_0x2e3114,'json':!![]};return rp(_0x4e414f)[_0xe463('0xe')](function(_0x1d5805){if(_0x1d5805[_0xe463('0xf')][_0xe463('0x10')]>0x0){_0x1b4a36[_0xe463('0x2a')]=_0x1d5805['result'][0x0][_0xe463('0x1c')];logger[_0xe463('0x12')]('['+[_0x2bf005[_0xe463('0x13')]()]+_0xe463('0x2b'),_0x1b4a36);_0x548109(_0x1b4a36);}else{return createEndUser(_0x2bf005,_0x2e3114,_0x1b4a36,_0x5f1bff,_0x209089)[_0xe463('0xe')](function(_0x981f05){logger['info']('['+[_0x2bf005['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x981f05);_0x548109(_0x981f05);});}})[_0xe463('0x27')](function(_0x1be640){logger[_0xe463('0x1e')]('['+[_0x2bf005['toUpperCase']()]+']',_0x1be640[_0xe463('0x15')]);_0x3acf13(_0x1be640['message']);});});};}function getCustomFields(_0x1c2111,_0x4c9904){var _0xcd9ba={};if(_0x1c2111[_0xe463('0x10')]>0x0){_['forEach'](_0x1c2111,function(_0x3fa495){if(_[_0xe463('0x2c')]([_0xe463('0x2d'),_0xe463('0x2e')],_0x3fa495[_0xe463('0x2f')])&&_0x3fa495[_0xe463('0x30')]&&!_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x30')][_0xe463('0x32')]()]=_0x3fa495[_0xe463('0x33')][_0xe463('0x34')]();}else if(_[_0xe463('0x2c')]([_0xe463('0x2d'),_0xe463('0x2e')],_0x3fa495[_0xe463('0x2f')])&&_0x3fa495[_0xe463('0x35')]&&_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x35')]['toLowerCase']()]=_0x3fa495[_0xe463('0x33')][_0xe463('0x34')]();}else if(_0x3fa495[_0xe463('0x2f')]===_0xe463('0x36')&&_0x3fa495[_0xe463('0x37')]&&_0x3fa495[_0xe463('0x35')]&&_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x35')][_0xe463('0x32')]()]=_0x4c9904[_0x3fa495['variableName']][_0xe463('0x34')]();}else if(_0x3fa495[_0xe463('0x2f')]===_0xe463('0x38')&&_0x3fa495['Variable']&&_0x3fa495[_0xe463('0x39')][_0xe463('0x3a')]&&_0x3fa495[_0xe463('0x35')]&&_0x3fa495[_0xe463('0x31')]){_0xcd9ba[_0x3fa495[_0xe463('0x35')][_0xe463('0x32')]()]=_0x4c9904[_0x3fa495['Variable'][_0xe463('0x3a')][_0xe463('0x32')]()]['toString']();}});}return _0xcd9ba;}function getTicket(_0x4daaa9,_0x3a1f5d,_0x21a53d,_0x1a8c7c,_0x2e1ecb,_0x2b46f6){return function(_0x751973){logger['info']('['+[_0x4daaa9[_0xe463('0x13')]()]+_0xe463('0x3b'),_0x751973);return new Promise(function(_0x434981,_0x58a2bc){var _0x514452=_0x4daaa9[_0xe463('0x32')]()===_0xe463('0x3c')?_0x751973[_0xe463('0x20')]:_0x751973['endUserId'];var _0x494f0d={'method':'POST','uri':_0x21a53d+'incident'+'?'+_0x2b46f6,'body':Object[_0xe463('0x3d')]({},{'active':_0xe463('0x1b'),'caller_id':_0x514452,'assigned_to':_0x751973[_0xe463('0x20')],'short_description':intUtil[_0xe463('0x3e')](_0x1a8c7c[_0xe463('0x3f')],_0x2e1ecb,'\x20'),'description':intUtil[_0xe463('0x3e')](_0x1a8c7c[_0xe463('0x40')],_0x2e1ecb,'\x0a')},getCustomFields(_0x1a8c7c[_0xe463('0x41')],_0x2e1ecb)),'auth':_0x3a1f5d,'json':!![]};return rp(_0x494f0d)[_0xe463('0xe')](function(_0x117d93){logger[_0xe463('0x12')]('['+[_0x4daaa9[_0xe463('0x13')]()]+_0xe463('0x42'),_0x117d93['result']);_0x751973['ticketId']=_0x117d93[_0xe463('0xf')][_0xe463('0x1c')];_0x751973[_0xe463('0x43')]=_0x117d93['result'][_0xe463('0x44')];logger[_0xe463('0x12')]('['+[_0x4daaa9[_0xe463('0x13')]()]+_0xe463('0x45'),_0x751973);_0x434981(_0x751973);})[_0xe463('0x27')](function(_0x208b21){logger[_0xe463('0x1e')]('['+[_0x4daaa9[_0xe463('0x13')]()]+']',_0x208b21[_0xe463('0x15')]);_0x58a2bc(_0x208b21[_0xe463('0x15')]);});});};}function createRemoteTag(_0xbeaca9,_0x40e56d,_0x5b3e72,_0x33e43d){return new Promise(function(_0x412433,_0x3dc062){var _0x427b0f={'method':_0xe463('0x22'),'uri':_0x5b3e72+_0xe463('0x46')+'?'+_0x33e43d,'body':{'short_description':_0xbeaca9,'global':!![],'active':!![],'name':_0xbeaca9},'auth':_0x40e56d,'json':!![]};return rp(_0x427b0f)[_0xe463('0xe')](function(_0x404aa3){var _0xc35b09=_0x404aa3['result']['sys_id'];_0x412433(_0xc35b09);});});}function getRemoteTag(_0x22c36a,_0x5788e3,_0x3e4150,_0x4e161d,_0x1fd336){return new Promise(function(_0x1e09bc,_0x4b25e2){var _0xe11b0f={'method':_0xe463('0xc'),'uri':_0x3e4150+_0xe463('0x46')+_0xe463('0x47')+_0x22c36a+'&'+_0x4e161d,'auth':_0x5788e3,'json':!![]};return rp(_0xe11b0f)['then'](function(_0x5380dd){if(_0x5380dd['result'][_0xe463('0x10')]>0x0){var _0x4548e6=_0x5380dd[_0xe463('0xf')][0x0][_0xe463('0x1c')];_0x1e09bc(_0x4548e6);}else{return createRemoteTag(_0x22c36a,_0x5788e3,_0x3e4150,_0x4e161d)[_0xe463('0xe')](function(_0x45ebc3){_0x1e09bc(_0x45ebc3);});}});});}function assignTagToIncident(_0x13e496,_0x44d034,_0x46ab34,_0x4008fd,_0x31d60f){return new Promise(function(_0x5b302f,_0x5235a4){var _0x340f3a={'method':_0xe463('0x22'),'uri':_0x46ab34+_0xe463('0x48')+'?'+_0x31d60f,'body':{'label':_0x13e496,'table':'incident','id_type':'Incident','table_key':_0x4008fd['ticketId'],'title':'Incident\x20-\x20'+_0x4008fd[_0xe463('0x43')],'id_display':_0x4008fd[_0xe463('0x43')]},'auth':_0x44d034,'json':!![]};return rp(_0x340f3a)[_0xe463('0xe')](function(_0x56e9b1){_0x5b302f();})[_0xe463('0x27')](function(){_0x5b302f();});});}function manageTags(_0x45bee4,_0x439d74,_0x456b4e,_0x21ccf0,_0x3b3640,_0x3a0a96,_0x3221db){return new Promise(function(_0x4e0fbe,_0x5eee5d){var _0x2f3062=[];_0x439d74[_0xe463('0x49')](function(_0x5a58c8){_0x2f3062[_0xe463('0x4a')](getRemoteTag(_0x5a58c8,_0x456b4e,_0x21ccf0,_0x3a0a96,_0x3221db));});return Promise['all'](_0x2f3062)[_0xe463('0xe')](function(_0x55e4e5){if(_0x55e4e5[_0xe463('0x10')]){logger[_0xe463('0x12')]('['+[_0x45bee4[_0xe463('0x13')]()]+_0xe463('0x4b'),_0x55e4e5);var _0xa2f4e4=[];_0x55e4e5[_0xe463('0x49')](function(_0x1714f6){_0xa2f4e4['push'](assignTagToIncident(_0x1714f6,_0x456b4e,_0x21ccf0,_0x3b3640,_0x3a0a96));});return Promise[_0xe463('0x4c')](_0xa2f4e4)[_0xe463('0xe')](function(){_0x4e0fbe();})['catch'](function(){_0x4e0fbe();});}else{_0x4e0fbe();}});});}function getTags(_0x3dbd74,_0x627bfc,_0x1f67a9,_0xd084f5,_0x1461e4,_0x41e975){return function(_0x3d71d6){return new Promise(function(_0x460b09,_0x236cd5){var _0x44bf34=[];var _0x2d7517=_0xd084f5['Tags'];if(_0x2d7517&&_0x2d7517[_0xe463('0x10')]>0x0){_0x44bf34=_[_0xe463('0x4d')](_0x2d7517,_0xe463('0x3a'));}if(_0x44bf34[_0xe463('0x10')]>0x0){return manageTags(_0x3dbd74,_0x44bf34,_0x627bfc,_0x1f67a9,_0x3d71d6,_0x1461e4,_0x41e975)['then'](function(){_0x460b09(_0x3d71d6);});}else{_0x460b09(_0x3d71d6);}});};}function emit(_0x3a9f08,_0x184087,_0x41dccd){var _0x50b407=_0xe463('0x4e')+_0xe463('0x4f')+_0xe463('0x50')+_0xe463('0x51');var _0x51310a={'uri':_0x3a9f08+_0xe463('0x52')+_0x41dccd+_0x50b407};io['to'](util[_0xe463('0x53')](_0xe463('0x54'),_0x184087))[_0xe463('0x55')]('trigger:browser:url',_0x51310a);}exports['cs']=function(_0x58bf4b,_0x1017a3,_0x4be612,_0x211fb1,_0x2e035,_0x34c332,_0x3b2469,_0x474b6d){var _0x486470={};var _0x5907cf={'user':_0x34c332[_0xe463('0x56')],'pass':_0x34c332[_0xe463('0x57')]};var _0xd614c4=_0xe463('0x58');var _0x3b9efb=_0xe463('0x59');_0x34c332['remoteUri']=intUtil[_0xe463('0x5a')](_0x34c332[_0xe463('0x5b')]);_0x34c332[_0xe463('0x5c')]=intUtil[_0xe463('0x5a')](_0x34c332['serverUrl']);var _0x5c2b1a=util[_0xe463('0x53')](_0xe463('0x5d'),_0x34c332[_0xe463('0x5b')]);_0x486470['userEmail']=!_[_0xe463('0x5e')](_0x211fb1)?_0x211fb1[_0xe463('0x5f')]:null;_0x486470['adminEmail']=_0x34c332[_0xe463('0x5f')];_0x486470[_0xe463('0x24')]=_0x474b6d[_0xe463('0x32')]()==='outbound'?_0x1017a3[_0xe463('0x60')]:_0x1017a3[_0xe463('0x61')];_0x486470['callDirection']=_0x474b6d===_0xe463('0x62')||_0x474b6d===_0xe463('0x63')?_0xe463('0x62'):_0xe463('0x3c');var _0x145045=util[_0xe463('0x53')](_0xe463('0x64'),_0x34c332[_0xe463('0x5c')],_0x1017a3[_0xe463('0x65')],md5(_0x1017a3[_0xe463('0x65')]));if(_0x2e035&&_0x2e035[_0xe463('0x66')]){logger[_0xe463('0x12')]('[QUEUE]',_0xe463('0x67'));_0x1017a3['recordingURL']=_0x145045;}else if(_0x3b2469&&_0x3b2469[_0xe463('0x68')]&&_0x3b2469[_0xe463('0x68')]!==_0xe463('0x69')){logger[_0xe463('0x12')](_0xe463('0x6a'),_0xe463('0x67'));_0x1017a3[_0xe463('0x6b')]=_0x145045;}else{_0x1017a3[_0xe463('0x6b')]='';}return getAdminUser(_0x474b6d,_0x5907cf,_0x486470,_0x5c2b1a,_0x3b9efb,_0xd614c4)[_0xe463('0xe')](getUser(_0x474b6d,_0x5907cf,_0x5c2b1a,_0x3b9efb,_0xd614c4))[_0xe463('0xe')](getEndUser(_0x474b6d,_0x5907cf,_0x5c2b1a,_0x3b9efb,_0xd614c4))[_0xe463('0xe')](getTicket(_0x474b6d,_0x5907cf,_0x5c2b1a,_0x4be612,_0x1017a3,_0x3b9efb))[_0xe463('0xe')](function(_0x258fa4){logger[_0xe463('0x12')](util[_0xe463('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x258fa4[_0xe463('0x6c')]));logger['info'](util[_0xe463('0x53')](_0xe463('0x6d'),_0x474b6d));if(_0x474b6d!==_0xe463('0x63')){logger['info']('['+[_0x474b6d['toUpperCase']()]+']',_0xe463('0x6e'));emit(_0x34c332[_0xe463('0x5b')],_0x211fb1[_0xe463('0x3a')],_0x258fa4[_0xe463('0x6c')]);}})['catch'](function(_0xe62011){logger[_0xe463('0x1e')]('['+[_0x474b6d['toUpperCase']()]+_0xe463('0x6f'),util[_0xe463('0x70')](_0xe62011,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xa079=['stripTrailingSlash','serverUrl','isNil','email','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','GET','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','userEmail','adminEmail','],\x20getUser\x20crm','error','POST','user','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','picklist','type','nameField','customField','toLowerCase','content','toString','includes','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri'];(function(_0xc7c5fc,_0x320f32){var _0x5ae4b6=function(_0x2ca1de){while(--_0x2ca1de){_0xc7c5fc['push'](_0xc7c5fc['shift']());}};_0x5ae4b6(++_0x320f32);}(_0xa079,0x1d4));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a07('0x0'));var Promise=require('bluebird');var rp=require(_0x9a07('0x1'));var util=require(_0x9a07('0x2'));var md5=require(_0x9a07('0x3'));var Redis=require(_0x9a07('0x4'));var intUtil=require('./util');var config=require(_0x9a07('0x5'));var logger=require(_0x9a07('0x6'))(_0x9a07('0x7'));config['redis']=_[_0x9a07('0x8')](config[_0x9a07('0x9')],{'host':_0x9a07('0xa'),'port':0x18eb});var io=require(_0x9a07('0xb'))(new Redis(config['redis']));function getAdminUser(_0x27c5fc,_0x29628e,_0x2341ab,_0x511575,_0x5cc18a,_0x5dc766){return new Promise(function(_0x57d74d,_0x4c8f60){var _0x2efb96={'method':'GET','uri':_0x511575+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5cc18a+'&'+_0x5dc766,'auth':_0x29628e,'json':!![]};return rp(_0x2efb96)[_0x9a07('0xc')](function(_0x5c06ec){if(_0x5c06ec[_0x9a07('0xd')]['length']>0x0){_0x2341ab[_0x9a07('0xe')]=_0x5c06ec[_0x9a07('0xd')][0x0][_0x9a07('0xf')];}logger['info']('['+[_0x27c5fc[_0x9a07('0x10')]()]+_0x9a07('0x11'),_0x2341ab);_0x57d74d(_0x2341ab);})[_0x9a07('0x12')](function(_0x277d1e){logger['error']('['+[_0x27c5fc['toUpperCase']()]+']',_0x277d1e[_0x9a07('0x13')]);_0x4c8f60(_0x277d1e['message']);});});}function getUser(_0x2d8e32,_0x3ba49f,_0x443786,_0x17066,_0x1f22e1){return function(_0x2f9ad3){logger['info']('['+[_0x2d8e32[_0x9a07('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x2f9ad3);return new Promise(function(_0x531ce7,_0x3d5300){if(intUtil[_0x9a07('0x14')](_0x2f9ad3['userEmail'])){var _0x4dd492={'method':_0x9a07('0x15'),'uri':_0x443786+_0x9a07('0x16')+_0x2f9ad3['userEmail']+'&'+_0x17066+'&'+_0x1f22e1,'auth':_0x3ba49f,'json':!![]};logger[_0x9a07('0x17')]('['+[_0x2d8e32[_0x9a07('0x10')]()]+_0x9a07('0x18'),_0x4dd492);return rp(_0x4dd492)[_0x9a07('0xc')](function(_0x1b2d90){logger['info']('['+[_0x2d8e32['toUpperCase']()]+_0x9a07('0x19'),_0x1b2d90);if(_0x1b2d90[_0x9a07('0xd')]['length']>0x0&&String(_0x1b2d90[_0x9a07('0xd')][0x0][_0x9a07('0x1a')])===_0x9a07('0x1b')){_0x2f9ad3[_0x9a07('0x1c')]=_0x1b2d90[_0x9a07('0xd')][0x0][_0x9a07('0xf')];}else{_0x2f9ad3['userId']=_0x2f9ad3[_0x9a07('0xe')];_0x2f9ad3[_0x9a07('0x1d')]=_0x2f9ad3[_0x9a07('0x1e')];}logger[_0x9a07('0x17')]('['+[_0x2d8e32[_0x9a07('0x10')]()]+_0x9a07('0x1f'),_0x2f9ad3);_0x531ce7(_0x2f9ad3);})['catch'](function(_0x2c21df){logger[_0x9a07('0x20')]('['+[_0x2d8e32[_0x9a07('0x10')]()]+']',_0x2c21df['message']);_0x3d5300(_0x2c21df[_0x9a07('0x13')]);});}else{logger[_0x9a07('0x17')]('['+[_0x2d8e32[_0x9a07('0x10')]()]+']\x20using\x20admin\x20profile');_0x2f9ad3['userId']=_0x2f9ad3['adminId'];_0x2f9ad3[_0x9a07('0x1d')]=_0x2f9ad3[_0x9a07('0x1e')];_0x531ce7(_0x2f9ad3);}});};}function createEndUser(_0x2f10cb,_0x10d249,_0x57b5f4,_0x5ed20f,_0x5d2113){logger[_0x9a07('0x17')]('['+[_0x2f10cb[_0x9a07('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x57b5f4);return new Promise(function(_0x31b34f,_0x3183b2){var _0x1b1651={'method':_0x9a07('0x21'),'uri':_0x5ed20f+'sys_user?'+_0x5d2113,'body':{'user_name':_0x57b5f4['endUserNumber'],'roles':_0x9a07('0x22'),'first_name':_0x57b5f4[_0x9a07('0x23')],'active':'true','date_format':'System','phone':_0x57b5f4[_0x9a07('0x23')]},'auth':_0x10d249,'json':!![]};return rp(_0x1b1651)['then'](function(_0x3e185a){logger[_0x9a07('0x17')]('['+[_0x2f10cb[_0x9a07('0x10')]()]+_0x9a07('0x24'),_0x3e185a[_0x9a07('0xd')]);_0x57b5f4['endUserId']=_0x3e185a[_0x9a07('0xd')][_0x9a07('0xf')];_0x31b34f(_0x57b5f4);})['catch'](function(_0xde0ccc){logger[_0x9a07('0x20')]('['+[_0x2f10cb[_0x9a07('0x10')]()]+']',_0xde0ccc[_0x9a07('0x13')]);_0x3183b2(_0xde0ccc[_0x9a07('0x13')]);});});}function getEndUser(_0xcff398,_0x484f43,_0xbb3164,_0x5b245c,_0x21a63f){return function(_0x4233ad){logger[_0x9a07('0x17')]('['+[_0xcff398[_0x9a07('0x10')]()]+_0x9a07('0x25'),_0x4233ad);return new Promise(function(_0x295cc7,_0x206aaf){var _0x97828a={'method':_0x9a07('0x15'),'uri':_0xbb3164+_0x9a07('0x26')+_0x4233ad[_0x9a07('0x23')]+'&'+_0x5b245c+'&'+_0x21a63f,'auth':_0x484f43,'json':!![]};return rp(_0x97828a)['then'](function(_0x34a311){if(_0x34a311[_0x9a07('0xd')]['length']>0x0){_0x4233ad[_0x9a07('0x27')]=_0x34a311[_0x9a07('0xd')][0x0]['sys_id'];logger[_0x9a07('0x17')]('['+[_0xcff398[_0x9a07('0x10')]()]+_0x9a07('0x28'),_0x4233ad);_0x295cc7(_0x4233ad);}else{return createEndUser(_0xcff398,_0x484f43,_0x4233ad,_0xbb3164,_0x5b245c)[_0x9a07('0xc')](function(_0x219c5a){logger[_0x9a07('0x17')]('['+[_0xcff398[_0x9a07('0x10')]()]+_0x9a07('0x29'),_0x219c5a);_0x295cc7(_0x219c5a);});}})[_0x9a07('0x12')](function(_0x3c4ec6){logger[_0x9a07('0x20')]('['+[_0xcff398[_0x9a07('0x10')]()]+']',_0x3c4ec6[_0x9a07('0x13')]);_0x206aaf(_0x3c4ec6['message']);});});};}function getCustomFields(_0x37c11a,_0x56e7e8){var _0x51017d={};if(_0x37c11a[_0x9a07('0x2a')]>0x0){_[_0x9a07('0x2b')](_0x37c11a,function(_0xf7a5dd){if(_['includes'](['string',_0x9a07('0x2c')],_0xf7a5dd[_0x9a07('0x2d')])&&_0xf7a5dd[_0x9a07('0x2e')]&&!_0xf7a5dd[_0x9a07('0x2f')]){_0x51017d[_0xf7a5dd[_0x9a07('0x2e')][_0x9a07('0x30')]()]=_0xf7a5dd[_0x9a07('0x31')][_0x9a07('0x32')]();}else if(_[_0x9a07('0x33')]([_0x9a07('0x34'),'picklist'],_0xf7a5dd[_0x9a07('0x2d')])&&_0xf7a5dd[_0x9a07('0x35')]&&_0xf7a5dd['customField']){_0x51017d[_0xf7a5dd['idField'][_0x9a07('0x30')]()]=_0xf7a5dd[_0x9a07('0x31')]['toString']();}else if(_0xf7a5dd['type']===_0x9a07('0x36')&&_0xf7a5dd[_0x9a07('0x37')]&&_0xf7a5dd[_0x9a07('0x35')]&&_0xf7a5dd[_0x9a07('0x2f')]){_0x51017d[_0xf7a5dd[_0x9a07('0x35')][_0x9a07('0x30')]()]=_0x56e7e8[_0xf7a5dd['variableName']]['toString']();}else if(_0xf7a5dd['type']===_0x9a07('0x38')&&_0xf7a5dd[_0x9a07('0x39')]&&_0xf7a5dd[_0x9a07('0x39')][_0x9a07('0x3a')]&&_0xf7a5dd[_0x9a07('0x35')]&&_0xf7a5dd[_0x9a07('0x2f')]){_0x51017d[_0xf7a5dd['idField']['toLowerCase']()]=_0x56e7e8[_0xf7a5dd[_0x9a07('0x39')]['name'][_0x9a07('0x30')]()][_0x9a07('0x32')]();}});}return _0x51017d;}function getTicket(_0x19d71d,_0x373979,_0x40a34a,_0x2293e0,_0x5eebe8,_0x1e2c5b){return function(_0x342b62){logger[_0x9a07('0x17')]('['+[_0x19d71d['toUpperCase']()]+_0x9a07('0x3b'),_0x342b62);return new Promise(function(_0x553909,_0x5b07f4){var _0x4c53ea=_0x19d71d['toLowerCase']()===_0x9a07('0x3c')?_0x342b62[_0x9a07('0x1c')]:_0x342b62[_0x9a07('0x27')];var _0x33f6c0={'method':_0x9a07('0x21'),'uri':_0x40a34a+_0x9a07('0x3d')+'?'+_0x1e2c5b,'body':Object[_0x9a07('0x3e')]({},{'active':_0x9a07('0x1b'),'caller_id':_0x4c53ea,'assigned_to':_0x342b62[_0x9a07('0x1c')],'short_description':intUtil[_0x9a07('0x3f')](_0x2293e0[_0x9a07('0x40')],_0x5eebe8,'\x20'),'description':intUtil[_0x9a07('0x3f')](_0x2293e0['Descriptions'],_0x5eebe8,'\x0a')},getCustomFields(_0x2293e0[_0x9a07('0x41')],_0x5eebe8)),'auth':_0x373979,'json':!![]};return rp(_0x33f6c0)[_0x9a07('0xc')](function(_0x3f0786){logger[_0x9a07('0x17')]('['+[_0x19d71d[_0x9a07('0x10')]()]+_0x9a07('0x42'),_0x3f0786[_0x9a07('0xd')]);_0x342b62['ticketId']=_0x3f0786[_0x9a07('0xd')][_0x9a07('0xf')];_0x342b62[_0x9a07('0x43')]=_0x3f0786[_0x9a07('0xd')][_0x9a07('0x44')];logger[_0x9a07('0x17')]('['+[_0x19d71d[_0x9a07('0x10')]()]+_0x9a07('0x45'),_0x342b62);_0x553909(_0x342b62);})['catch'](function(_0x5053b6){logger[_0x9a07('0x20')]('['+[_0x19d71d['toUpperCase']()]+']',_0x5053b6[_0x9a07('0x13')]);_0x5b07f4(_0x5053b6[_0x9a07('0x13')]);});});};}function createRemoteTag(_0xa75be,_0x73a52e,_0x1e9988,_0x107d1c){return new Promise(function(_0x5694b3,_0x215978){var _0x2fe878={'method':_0x9a07('0x21'),'uri':_0x1e9988+_0x9a07('0x46')+'?'+_0x107d1c,'body':{'short_description':_0xa75be,'global':!![],'active':!![],'name':_0xa75be},'auth':_0x73a52e,'json':!![]};return rp(_0x2fe878)['then'](function(_0x335d94){var _0x22f25d=_0x335d94[_0x9a07('0xd')][_0x9a07('0xf')];_0x5694b3(_0x22f25d);});});}function getRemoteTag(_0x34feba,_0x478f9a,_0x118da9,_0x4c9d67,_0xc4993){return new Promise(function(_0x40594b,_0x430a6f){var _0x1c6382={'method':_0x9a07('0x15'),'uri':_0x118da9+_0x9a07('0x46')+_0x9a07('0x47')+_0x34feba+'&'+_0x4c9d67,'auth':_0x478f9a,'json':!![]};return rp(_0x1c6382)[_0x9a07('0xc')](function(_0x4baef3){if(_0x4baef3[_0x9a07('0xd')][_0x9a07('0x2a')]>0x0){var _0x5d5850=_0x4baef3['result'][0x0][_0x9a07('0xf')];_0x40594b(_0x5d5850);}else{return createRemoteTag(_0x34feba,_0x478f9a,_0x118da9,_0x4c9d67)[_0x9a07('0xc')](function(_0x29415a){_0x40594b(_0x29415a);});}});});}function assignTagToIncident(_0x50aed1,_0x3d13c8,_0xb49bad,_0x3dcff5,_0xaf24ea){return new Promise(function(_0x1386fa,_0x42e3c8){var _0x990b6a={'method':'POST','uri':_0xb49bad+_0x9a07('0x48')+'?'+_0xaf24ea,'body':{'label':_0x50aed1,'table':_0x9a07('0x3d'),'id_type':_0x9a07('0x49'),'table_key':_0x3dcff5[_0x9a07('0x4a')],'title':'Incident\x20-\x20'+_0x3dcff5[_0x9a07('0x43')],'id_display':_0x3dcff5[_0x9a07('0x43')]},'auth':_0x3d13c8,'json':!![]};return rp(_0x990b6a)[_0x9a07('0xc')](function(_0x34148a){_0x1386fa();})[_0x9a07('0x12')](function(){_0x1386fa();});});}function manageTags(_0x5f440f,_0x5a77bb,_0x1aa375,_0x3597c7,_0x2332fe,_0x31a465,_0x4843e9){return new Promise(function(_0x4528db,_0x4b2e9e){var _0x11e668=[];_0x5a77bb[_0x9a07('0x2b')](function(_0x180fb4){_0x11e668[_0x9a07('0x4b')](getRemoteTag(_0x180fb4,_0x1aa375,_0x3597c7,_0x31a465,_0x4843e9));});return Promise[_0x9a07('0x4c')](_0x11e668)[_0x9a07('0xc')](function(_0x1c3f87){if(_0x1c3f87['length']){logger[_0x9a07('0x17')]('['+[_0x5f440f['toUpperCase']()]+_0x9a07('0x4d'),_0x1c3f87);var _0x3df1b6=[];_0x1c3f87['forEach'](function(_0x5d5ce2){_0x3df1b6[_0x9a07('0x4b')](assignTagToIncident(_0x5d5ce2,_0x1aa375,_0x3597c7,_0x2332fe,_0x31a465));});return Promise[_0x9a07('0x4c')](_0x3df1b6)['then'](function(){_0x4528db();})['catch'](function(){_0x4528db();});}else{_0x4528db();}});});}function getTags(_0x41dfa9,_0x15527b,_0x32f3e0,_0x16b9ac,_0x5dfe8f,_0x8ffdc6){return function(_0x2c160f){return new Promise(function(_0x183e4e,_0x26a81c){var _0x5c89ac=[];var _0x3a20f4=_0x16b9ac[_0x9a07('0x4e')];if(_0x3a20f4&&_0x3a20f4['length']>0x0){_0x5c89ac=_[_0x9a07('0x4f')](_0x3a20f4,_0x9a07('0x3a'));}if(_0x5c89ac['length']>0x0){return manageTags(_0x41dfa9,_0x5c89ac,_0x15527b,_0x32f3e0,_0x2c160f,_0x5dfe8f,_0x8ffdc6)[_0x9a07('0xc')](function(){_0x183e4e(_0x2c160f);});}else{_0x183e4e(_0x2c160f);}});};}function emit(_0x3d6f89,_0x19eae9,_0x350b0f){var _0x250dc9=_0x9a07('0x50')+_0x9a07('0x51')+_0x9a07('0x52')+_0x9a07('0x53');var _0xc9bf45={'uri':_0x3d6f89+_0x9a07('0x54')+_0x350b0f+_0x250dc9};io['to'](util[_0x9a07('0x55')](_0x9a07('0x56'),_0x19eae9))[_0x9a07('0x57')](_0x9a07('0x58'),_0xc9bf45);}exports['cs']=function(_0x3dd434,_0x76fc05,_0x2969cc,_0x1e4257,_0x3c8347,_0x2c1ea9,_0x534da9,_0xf9f903){var _0x1f4314={};var _0x284364={'user':_0x2c1ea9[_0x9a07('0x59')],'pass':_0x2c1ea9['password']};var _0x1d5bc3='sysparm_limit=1';var _0x24f500=_0x9a07('0x5a');_0x2c1ea9[_0x9a07('0x5b')]=intUtil[_0x9a07('0x5c')](_0x2c1ea9[_0x9a07('0x5b')]);_0x2c1ea9[_0x9a07('0x5d')]=intUtil[_0x9a07('0x5c')](_0x2c1ea9['serverUrl']);var _0x1a32a1=util[_0x9a07('0x55')]('%s/api/now/table/',_0x2c1ea9[_0x9a07('0x5b')]);_0x1f4314['userEmail']=!_[_0x9a07('0x5e')](_0x1e4257)?_0x1e4257[_0x9a07('0x5f')]:null;_0x1f4314['adminEmail']=_0x2c1ea9[_0x9a07('0x5f')];_0x1f4314[_0x9a07('0x23')]=_0xf9f903[_0x9a07('0x30')]()==='outbound'?_0x76fc05['destcalleridnum']:_0x76fc05['calleridnum'];_0x1f4314[_0x9a07('0x60')]=_0xf9f903===_0x9a07('0x61')||_0xf9f903==='unmanaged'?_0x9a07('0x61'):_0x9a07('0x3c');var _0x499f58=util[_0x9a07('0x55')](_0x9a07('0x62'),_0x2c1ea9[_0x9a07('0x5d')],_0x76fc05['uniqueid'],md5(_0x76fc05[_0x9a07('0x63')]));if(_0x3c8347&&_0x3c8347['monitor_format']){logger['info'](_0x9a07('0x64'),_0x9a07('0x65'));_0x76fc05[_0x9a07('0x66')]=_0x499f58;}else if(_0x534da9&&_0x534da9[_0x9a07('0x67')]&&_0x534da9['recordingFormat']!==_0x9a07('0x68')){logger[_0x9a07('0x17')](_0x9a07('0x69'),_0x9a07('0x65'));_0x76fc05[_0x9a07('0x66')]=_0x499f58;}else{_0x76fc05[_0x9a07('0x66')]='';}return getAdminUser(_0xf9f903,_0x284364,_0x1f4314,_0x1a32a1,_0x24f500,_0x1d5bc3)['then'](getUser(_0xf9f903,_0x284364,_0x1a32a1,_0x24f500,_0x1d5bc3))[_0x9a07('0xc')](getEndUser(_0xf9f903,_0x284364,_0x1a32a1,_0x24f500,_0x1d5bc3))['then'](getTicket(_0xf9f903,_0x284364,_0x1a32a1,_0x2969cc,_0x76fc05,_0x24f500))['then'](function(_0x1ce516){logger[_0x9a07('0x17')](util['format'](_0x9a07('0x6a'),_0x1ce516[_0x9a07('0x4a')]));logger[_0x9a07('0x17')](util['format'](_0x9a07('0x6b'),_0xf9f903));if(_0xf9f903!==_0x9a07('0x6c')){logger[_0x9a07('0x17')]('['+[_0xf9f903['toUpperCase']()]+']',_0x9a07('0x6d'));emit(_0x2c1ea9['remoteUri'],_0x1e4257[_0x9a07('0x3a')],_0x1ce516[_0x9a07('0x4a')]);}})[_0x9a07('0x12')](function(_0x5c75e7){logger[_0x9a07('0x20')]('['+[_0xf9f903[_0x9a07('0x10')]()]+_0x9a07('0x6e'),util[_0x9a07('0x6f')](_0x5c75e7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e24=['Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','toString','customField','custom_fields','variable','customVariable','Variable','push','login','username','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','error','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x4e24,0x1aa));var _0x44e2=function(_0x3860e8,_0x1a94ea){_0x3860e8=_0x3860e8-0x0;var _0x4b00d6=_0x4e24[_0x3860e8];return _0x4b00d6;};'use strict';var _=require(_0x44e2('0x0'));var rp=require(_0x44e2('0x1'));var BPromise=require('bluebird');var md5=require(_0x44e2('0x2'));var util=require(_0x44e2('0x3'));var Redis=require(_0x44e2('0x4'));var intUtil=require('./util');var config=require(_0x44e2('0x5'));var logger=require(_0x44e2('0x6'))(_0x44e2('0x7'));config[_0x44e2('0x8')]=_['defaults'](config['redis'],{'host':_0x44e2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44e2('0x8')]));var def={'method':_0x44e2('0xa'),'json':!![]};function emit(_0x56df22,_0x4cfa55,_0x305cdc){io['to'](_0x56df22)[_0x44e2('0xb')](_0x4cfa55,_0x305cdc);}function getTicket(_0x1261f5,_0x56685a,_0x31a1b6,_0x4cdd24,_0x2c8ec3,_0x4b58a2,_0x1441d2,_0x19b6f5){logger[_0x44e2('0xc')](_0x44e2('0xd'));var _0x32d10a=new Date();var _0x14de57=[{'name':_0x44e2('0xe'),'value':intUtil[_0x44e2('0xf')](_0x4cdd24[_0x44e2('0x10')],_0x2c8ec3,'\x20')},{'name':_0x44e2('0x11'),'value':_0x56685a['id']},{'name':_0x44e2('0x12'),'value':_0x56685a['id']},{'name':_0x44e2('0x13'),'value':intUtil[_0x44e2('0xf')](_0x4cdd24['Descriptions'],_0x2c8ec3,'\x0a')},{'name':_0x44e2('0x14'),'value':_0x32d10a[_0x44e2('0x15')]()[_0x44e2('0x16')](0x0,0x13)[_0x44e2('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x44e2('0x18'),'value':'15'},{'name':_0x44e2('0x19'),'value':_0x31a1b6['id']},{'name':_0x44e2('0x1a'),'value':_0x44e2('0x1b')},{'name':_0x44e2('0x1c'),'value':_0x31a1b6[_0x44e2('0xe')]},{'name':'direction','value':_0x19b6f5}];if(_0x4b58a2[_0x44e2('0x1d')]){_[_0x44e2('0x1e')](_0x4b58a2,function(_0x921a17){if(_0x2c8ec3[_0x921a17['variableName']]){_0x14de57['push']({'name':_0x921a17[_0x44e2('0x1f')],'value':_0x2c8ec3[_0x921a17[_0x44e2('0x20')]]});}});}return request({'form':{'method':_0x44e2('0x21'),'input_type':'JSON','response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'session':_0x1441d2['id'],'module_name':_0x44e2('0x24'),'name_value_list':_0x14de57})}});}function getAuth(_0x1ca900){return util[_0x44e2('0x25')](_0x44e2('0x26'),new Buffer(_0x1ca900['apiKey']+':X')['toString'](_0x44e2('0x27')));}function getServerInfo(_0x7dbf52){return request({'form':{'method':_0x44e2('0x28'),'input_type':'JSON','response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'session':_0x7dbf52['id']})}});}function getUser(_0x349e98,_0x218b86,_0x100d54){if(!_[_0x44e2('0x29')](_0x218b86)){logger[_0x44e2('0xc')](_0x44e2('0x2a'),_0x218b86);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'session':_0x100d54['id'],'module_name':'Employees','query':util[_0x44e2('0x25')](_0x44e2('0x2b'),_0x218b86),'order_by':'','offset':'0','select_fields':['id',_0x44e2('0xe'),_0x44e2('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x44e2('0x2d')](function(_0x36ce8a){if(_0x36ce8a[_0x44e2('0x2e')]['length']){var _0x12e7ef=_[_0x44e2('0x2f')](_0x36ce8a[_0x44e2('0x2e')],function(_0xdd1d47){return _0xdd1d47[_0x44e2('0x30')][_0x44e2('0x2c')][_0x44e2('0x31')]===_0x218b86;});if(_0x12e7ef){logger[_0x44e2('0xc')](_0x44e2('0x32'));return BPromise[_0x44e2('0x33')]({'id':_0x12e7ef[_0x44e2('0x30')]['id']['value'],'name':_0x12e7ef[_0x44e2('0x30')][_0x44e2('0xe')][_0x44e2('0x31')]});}}logger[_0x44e2('0xc')](_0x44e2('0x34'));return BPromise[_0x44e2('0x33')]({'id':_0x100d54[_0x44e2('0x30')][_0x44e2('0x35')][_0x44e2('0x31')],'name':_0x100d54[_0x44e2('0x30')][_0x44e2('0x2c')][_0x44e2('0x31')]});});}else{logger[_0x44e2('0xc')](_0x44e2('0x36'));return BPromise['resolve']({'id':_0x100d54[_0x44e2('0x30')][_0x44e2('0x35')][_0x44e2('0x31')],'name':_0x100d54[_0x44e2('0x30')][_0x44e2('0x2c')][_0x44e2('0x31')]});}}function getEndUser(_0x5d138d,_0x2d0bfc,_0x5daf77,_0x573dd5){logger[_0x44e2('0xc')](_0x44e2('0x37'),_0x5daf77);return request({'form':{'method':_0x44e2('0x38'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x573dd5['id'],'module_name':_0x44e2('0x1b'),'query':util['format'](_0x44e2('0x39'),_0x5daf77),'order_by':'','offset':'0','select_fields':['id',_0x44e2('0xe'),_0x44e2('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x44e2('0x2d')](function(_0x575e8d){if(_0x575e8d[_0x44e2('0x2e')]['length']){var _0x3002ce=_['find'](_0x575e8d[_0x44e2('0x2e')],function(_0x4478f9){return _0x4478f9[_0x44e2('0x30')][_0x44e2('0x3a')][_0x44e2('0x31')]===_0x5daf77;});if(_0x3002ce){logger['info']('Enduser\x20found!');return BPromise[_0x44e2('0x33')]({'id':_0x3002ce[_0x44e2('0x30')]['id'][_0x44e2('0x31')],'name':_0x3002ce['name_value_list']['name']['value'],'phone':_0x3002ce[_0x44e2('0x30')]['phone_home'][_0x44e2('0x31')]});}}else{logger[_0x44e2('0xc')](_0x44e2('0x3b'));return request({'form':{'method':_0x44e2('0x21'),'input_type':_0x44e2('0x22'),'response_type':'JSON','rest_data':JSON[_0x44e2('0x23')]({'session':_0x573dd5['id'],'module_name':_0x44e2('0x1b'),'name_value_list':[{'name':_0x44e2('0x3c'),'value':_0x2d0bfc!==_0x44e2('0x3d')?_0x2d0bfc:util[_0x44e2('0x25')]('Caller\x20-\x20%s',_0x5daf77)},{'name':_0x44e2('0x3a'),'value':_0x5daf77}]})}})[_0x44e2('0x2d')](function(_0x219ccf){logger[_0x44e2('0xc')](_0x44e2('0x3e'));return BPromise[_0x44e2('0x33')]({'id':_0x219ccf['id'],'name':_0x219ccf[_0x44e2('0x2e')][_0x44e2('0x3c')][_0x44e2('0x31')],'phone':_0x219ccf[_0x44e2('0x2e')]['phone_home']['value']});});}});}function request(_0x28bc20){logger['debug'](_0x44e2('0x3f'),JSON[_0x44e2('0x23')](_0x28bc20));return rp(_[_0x44e2('0x40')](def,_0x28bc20));}function getTags(_0xdac1eb,_0x3b16e5){var _0x450023=[];if(_0xdac1eb&&_0xdac1eb[_0x44e2('0x1d')]>0x0){_0x450023=_[_0x44e2('0x41')](_0xdac1eb,_0x3b16e5);}return _0x450023;}function getCustomFields(_0x2d1802,_0x57cf3d){var _0x250726=[];var _0xc9afe9={'custom_fields':[]};if(_0x2d1802[_0x44e2('0x1d')]>0x0){_[_0x44e2('0x1e')](_0x2d1802,function(_0x208153){if(_0x208153[_0x44e2('0x42')]===_0x44e2('0x43')&&_0x208153[_0x44e2('0x44')]&&!_0x208153['customField']){_0xc9afe9[_0x208153[_0x44e2('0x44')][_0x44e2('0x45')]()]=_0x208153[_0x44e2('0x46')][_0x44e2('0x47')]();}else if(_0x208153['type']==='string'&&_0x208153[_0x44e2('0x1f')]&&_0x208153[_0x44e2('0x48')]){_0xc9afe9[_0x44e2('0x49')]['push']({'id':_0x208153[_0x44e2('0x1f')],'value':_0x208153[_0x44e2('0x46')][_0x44e2('0x47')]()});}else if(_0x208153[_0x44e2('0x42')]===_0x44e2('0x4a')&&_0x208153[_0x44e2('0x20')]&&_0x208153[_0x44e2('0x1f')]&&_0x208153[_0x44e2('0x48')]){_0x57cf3d[_0x208153[_0x44e2('0x20')]]&&_0xc9afe9[_0x44e2('0x49')]['push']({'id':_0x208153['idField'],'value':_0x57cf3d[_0x208153['variableName']][_0x44e2('0x47')]()});}else if(_0x208153[_0x44e2('0x42')]===_0x44e2('0x4b')&&_0x208153[_0x44e2('0x4c')]&&_0x208153[_0x44e2('0x4c')][_0x44e2('0xe')]&&_0x208153[_0x44e2('0x1f')]&&_0x208153['customField']){_0x57cf3d[_0x208153['Variable'][_0x44e2('0xe')]['toLowerCase']()]&&_0xc9afe9['custom_fields'][_0x44e2('0x4d')]({'id':_0x208153['idField'],'value':_0x57cf3d[_0x208153[_0x44e2('0x4c')][_0x44e2('0xe')]['toLowerCase']()]['toString']()});}});}return _0xc9afe9;}function getConnection(_0x56c2cc){return request({'method':_0x44e2('0xa'),'form':{'method':_0x44e2('0x4e'),'input_type':_0x44e2('0x22'),'response_type':_0x44e2('0x22'),'rest_data':JSON[_0x44e2('0x23')]({'user_auth':{'user_name':_0x56c2cc[_0x44e2('0x4f')],'password':_0x56c2cc['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x44e2('0x2d')](function(_0x3473df){var _0x210da8=_0x3473df;if(_0x210da8['id']){def[_0x44e2('0x50')]=_0x210da8['id'];return BPromise[_0x44e2('0x33')](_0x210da8);}else{throw new Error(util[_0x44e2('0x25')](_0x44e2('0x51'),_0x56c2cc['id']));}});}function setRelationship(_0x375032,_0x197807,_0x4ddf5d,_0x79f815){return request({'form':{'method':_0x44e2('0x52'),'input_type':_0x44e2('0x22'),'response_type':_0x44e2('0x22'),'rest_data':JSON['stringify']({'session':_0x375032['id'],'module_name':_0x44e2('0x24'),'module_id':_0x4ddf5d['id'],'link_field_name':_0x79f815,'related_ids':[_0x197807['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3dce7e,_0x55d247,_0xaacc0a,_0x4e3366,_0x4ea866,_0x2c2097){var _0x14942d,_0x1be24d,_0x4c9960,_0x3c3fe5;_0x2c2097[_0x44e2('0x53')]=intUtil[_0x44e2('0x54')](_0x2c2097[_0x44e2('0x53')]);_0x2c2097[_0x44e2('0x55')]=intUtil['stripTrailingSlash'](_0x2c2097[_0x44e2('0x55')]);def[_0x44e2('0x56')]=util[_0x44e2('0x25')](_0x44e2('0x57'),_0x2c2097[_0x44e2('0x53')]);if(_0x4ea866&&_0x4ea866[_0x44e2('0x58')]){logger['info'](_0x44e2('0x59'),_0x44e2('0x5a'));_0x55d247[_0x44e2('0x5b')]=util['format'](_0x44e2('0x5c'),_0x2c2097[_0x44e2('0x55')],_0x55d247[_0x44e2('0x5d')],md5(_0x55d247[_0x44e2('0x5d')]));}else{_0x55d247[_0x44e2('0x5b')]='';}return getConnection(_0x2c2097)['then'](function(_0x3b2c20){_0x3c3fe5=_0x3b2c20;return getUser(_0x2c2097,_0x4e3366[_0x44e2('0xe')],_0x3c3fe5);})['then'](function(_0x4a15f4){_0x14942d=_0x4a15f4;logger[_0x44e2('0xc')](_0x44e2('0x5e'),_0x14942d['id']);return getEndUser(_0x2c2097,_0x55d247[_0x44e2('0x5f')],_0x55d247[_0x44e2('0x60')],_0x3c3fe5);})[_0x44e2('0x2d')](function(_0xdfc4d0){_0x1be24d=_0xdfc4d0;logger[_0x44e2('0xc')](_0x44e2('0x61'),_0x1be24d['id']);return getTicket(_0x2c2097,_0x14942d,_0x1be24d,_0xaacc0a,_0x55d247,_0xaacc0a[_0x44e2('0x62')],_0x3c3fe5,_0x44e2('0x63'));})[_0x44e2('0x2d')](function(_0x1840d5){_0x4c9960=_0x1840d5;logger['info'](_0x44e2('0x64'));logger[_0x44e2('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4c9960['id']);return setRelationship(_0x3c3fe5,_0x14942d,_0x4c9960,_0x44e2('0x65'));})[_0x44e2('0x2d')](function(){return setRelationship(_0x3c3fe5,_0x1be24d,_0x4c9960,'contacts');})[_0x44e2('0x2d')](function(){return getServerInfo(_0x3c3fe5);})[_0x44e2('0x2d')](function(_0x97fe01){var _0x4cd0e8=parseInt(_0x97fe01[_0x44e2('0x66')][_0x44e2('0x67')](0x0));var _0x28ccd3=util['format'](_0x44e2('0x68'),_0x2c2097[_0x44e2('0x53')],_0x4c9960['id']);if(_0x4cd0e8>0x6){_0x28ccd3=util[_0x44e2('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2c2097[_0x44e2('0x53')],_0x4c9960['id']);}logger[_0x44e2('0xc')](_0x44e2('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x44e2('0x25')](_0x44e2('0x69'),_0x4e3366['name']),'trigger:browser:url',{'uri':_0x28ccd3});})['catch'](function(_0x2c2302){logger[_0x44e2('0x6a')](_0x44e2('0x59'),JSON[_0x44e2('0x23')](_0x2c2302));});};exports['outbound']=function(_0x361e39,_0x4bb3ba,_0x4ee131,_0x46e735,_0x5d6399,_0x7bfc4e,_0x93b1cc){var _0xcc5688,_0xbc8d56,_0x1ef1df,_0x32dbad;_0x7bfc4e[_0x44e2('0x53')]=intUtil[_0x44e2('0x54')](_0x7bfc4e['remoteUri']);_0x7bfc4e[_0x44e2('0x55')]=intUtil[_0x44e2('0x54')](_0x7bfc4e[_0x44e2('0x55')]);def['uri']=util['format'](_0x44e2('0x57'),_0x7bfc4e[_0x44e2('0x53')]);if(_0x93b1cc&&_0x93b1cc['recordingFormat']&&_0x93b1cc[_0x44e2('0x6b')]!==_0x44e2('0x6c')){logger[_0x44e2('0xc')](_0x44e2('0x6d'),_0x44e2('0x5a'));_0x4bb3ba[_0x44e2('0x5b')]=util[_0x44e2('0x25')](_0x44e2('0x5c'),_0x7bfc4e[_0x44e2('0x55')],_0x4bb3ba[_0x44e2('0x5d')],md5(_0x4bb3ba['uniqueid']));}return getConnection(_0x7bfc4e)['then'](function(_0x382e6f){_0x32dbad=_0x382e6f;return getUser(_0x7bfc4e,_0x46e735[_0x44e2('0xe')],_0x32dbad);})[_0x44e2('0x2d')](function(_0x1c07a2){_0xcc5688=_0x1c07a2;logger[_0x44e2('0xc')](_0x44e2('0x5e'),_0xcc5688['id']);return getEndUser(_0x7bfc4e,_0x4bb3ba[_0x44e2('0x6e')],_0x4bb3ba['destcalleridnum'],_0x32dbad);})[_0x44e2('0x2d')](function(_0x4b4352){_0xbc8d56=_0x4b4352;logger[_0x44e2('0xc')](_0x44e2('0x61'),_0xbc8d56['id']);return getTicket(_0x7bfc4e,_0xcc5688,_0xbc8d56,_0x4ee131,_0x4bb3ba,_0x4ee131[_0x44e2('0x62')],_0x32dbad,_0x44e2('0x6f'));})[_0x44e2('0x2d')](function(_0x4e3c42){_0x1ef1df=_0x4e3c42;logger[_0x44e2('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x1ef1df['id']);return setRelationship(_0x32dbad,_0xcc5688,_0x1ef1df,_0x44e2('0x65'));})['then'](function(){return setRelationship(_0x32dbad,_0xbc8d56,_0x1ef1df,_0x44e2('0x70'));})[_0x44e2('0x2d')](function(){return getServerInfo(_0x32dbad);})[_0x44e2('0x2d')](function(_0x4dd718){var _0x13567b=parseInt(_0x4dd718[_0x44e2('0x66')][_0x44e2('0x67')](0x0));var _0x315ab4=util[_0x44e2('0x25')](_0x44e2('0x68'),_0x7bfc4e[_0x44e2('0x53')],_0x1ef1df['id']);if(_0x13567b>0x6){_0x315ab4=util[_0x44e2('0x25')](_0x44e2('0x71'),_0x7bfc4e[_0x44e2('0x53')],_0x1ef1df['id']);}logger[_0x44e2('0xc')](_0x44e2('0x6d'),_0x44e2('0x72'));emit(util['format'](_0x44e2('0x69'),_0x46e735['name']),_0x44e2('0x73'),{'uri':_0x315ab4});})[_0x44e2('0x74')](function(_0x3b80c3){logger[_0x44e2('0x6a')](_0x44e2('0x6d'),JSON['stringify'](_0x3b80c3));});};exports[_0x44e2('0x75')]=function(_0x280780,_0x3e9f46,_0x4e6701,_0x4504aa,_0x1f441b,_0x4af507){var _0x3daaa4,_0x52d2bb,_0x20f779,_0x2a77ca;_0x4af507['remoteUri']=intUtil[_0x44e2('0x54')](_0x4af507[_0x44e2('0x53')]);_0x4af507['serverUrl']=intUtil['stripTrailingSlash'](_0x4af507['serverUrl']);def[_0x44e2('0x56')]=util['format'](_0x44e2('0x57'),_0x4af507['remoteUri']);if(_0x1f441b&&_0x1f441b['monitor_format']){logger[_0x44e2('0xc')]('['+_0x3e9f46[_0x44e2('0x76')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3e9f46[_0x44e2('0x5b')]=util[_0x44e2('0x25')](_0x44e2('0x5c'),_0x4af507[_0x44e2('0x55')],_0x3e9f46['uniqueid'],md5(_0x3e9f46['uniqueid']));}else{_0x3e9f46[_0x44e2('0x5b')]='';}return getConnection(_0x4af507)[_0x44e2('0x2d')](function(_0x4fa51b){_0x2a77ca=_0x4fa51b;if(!_[_0x44e2('0x29')](_0x4504aa)){return getUser(_0x4af507,_0x4504aa[_0x44e2('0xe')],_0x2a77ca);}else{return getUser(_0x4af507,null,_0x2a77ca);}})[_0x44e2('0x2d')](function(_0x18744b){_0x3daaa4=_0x18744b;logger[_0x44e2('0xc')](_0x44e2('0x5e'),_0x3daaa4['id']);return getEndUser(_0x4af507,_0x3e9f46[_0x44e2('0x5f')],_0x3e9f46[_0x44e2('0x60')],_0x2a77ca);})[_0x44e2('0x2d')](function(_0x4e2135){_0x52d2bb=_0x4e2135;logger[_0x44e2('0xc')](_0x44e2('0x61'),_0x52d2bb['id']);return getTicket(_0x4af507,_0x3daaa4,_0x52d2bb,_0x4e6701,_0x3e9f46,_0x4e6701[_0x44e2('0x62')],_0x2a77ca,_0x44e2('0x63'));})[_0x44e2('0x2d')](function(_0x1af0ad){_0x20f779=_0x1af0ad;logger[_0x44e2('0xc')](_0x44e2('0x64'));logger[_0x44e2('0xc')]('The\x20Ticket\x20ID\x20is:',_0x20f779['id']);return setRelationship(_0x2a77ca,_0x3daaa4,_0x20f779,_0x44e2('0x65'));})[_0x44e2('0x2d')](function(){return setRelationship(_0x2a77ca,_0x52d2bb,_0x20f779,'contacts');})['then'](function(){return getServerInfo(_0x2a77ca);})[_0x44e2('0x74')](function(_0xd8e961){logger['error']('['+_0x3e9f46[_0x44e2('0x76')][_0x44e2('0x77')]()+']',JSON['stringify'](_0xd8e961));});};
\ No newline at end of file
+var _0x45ee=['length','forEach','idField','variableName','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','toString','JSON','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','Agent\x20found!','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','debug','[HTTP]','nameField','toLowerCase','content','type','string','custom_fields','push','customField','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','uri','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Fields','Outbound','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','error','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','name','getString','Subjects','created_by','description','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','Contacts','direction'];(function(_0x1c463e,_0xc39d25){var _0x1b60c3=function(_0x8e27c2){while(--_0x8e27c2){_0x1c463e['push'](_0x1c463e['shift']());}};_0x1b60c3(++_0xc39d25);}(_0x45ee,0x148));var _0xe45e=function(_0x456be1,_0x248c6e){_0x456be1=_0x456be1-0x0;var _0x43fa66=_0x45ee[_0x456be1];return _0x43fa66;};'use strict';var _=require(_0xe45e('0x0'));var rp=require(_0xe45e('0x1'));var BPromise=require(_0xe45e('0x2'));var md5=require(_0xe45e('0x3'));var util=require(_0xe45e('0x4'));var Redis=require(_0xe45e('0x5'));var intUtil=require(_0xe45e('0x6'));var config=require(_0xe45e('0x7'));var logger=require(_0xe45e('0x8'))(_0xe45e('0x9'));config[_0xe45e('0xa')]=_[_0xe45e('0xb')](config[_0xe45e('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xe45e('0xc'))(new Redis(config[_0xe45e('0xa')]));var def={'method':_0xe45e('0xd'),'json':!![]};function emit(_0x58cb15,_0x49e5e9,_0x2d4f77){io['to'](_0x58cb15)[_0xe45e('0xe')](_0x49e5e9,_0x2d4f77);}function getTicket(_0x15e3b2,_0x2ac4b0,_0x2bd19b,_0x394153,_0x2384da,_0x2854a5,_0x219eeb,_0x18a656){logger['info']('Creating\x20new\x20ticket...');var _0x4490f5=new Date();var _0x20a132=[{'name':_0xe45e('0xf'),'value':intUtil[_0xe45e('0x10')](_0x394153[_0xe45e('0x11')],_0x2384da,'\x20')},{'name':'assigned_user_id','value':_0x2ac4b0['id']},{'name':_0xe45e('0x12'),'value':_0x2ac4b0['id']},{'name':_0xe45e('0x13'),'value':intUtil['getString'](_0x394153[_0xe45e('0x14')],_0x2384da,'\x0a')},{'name':_0xe45e('0x15'),'value':_0x4490f5['toISOString']()[_0xe45e('0x16')](0x0,0x13)[_0xe45e('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe45e('0x18'),'value':'15'},{'name':_0xe45e('0x19'),'value':_0x2bd19b['id']},{'name':_0xe45e('0x1a'),'value':_0xe45e('0x1b')},{'name':'parent_name','value':_0x2bd19b[_0xe45e('0xf')]},{'name':_0xe45e('0x1c'),'value':_0x18a656}];if(_0x2854a5[_0xe45e('0x1d')]){_[_0xe45e('0x1e')](_0x2854a5,function(_0x1aa957){if(_0x2384da[_0x1aa957['variableName']]){_0x20a132['push']({'name':_0x1aa957[_0xe45e('0x1f')],'value':_0x2384da[_0x1aa957[_0xe45e('0x20')]]});}});}return request({'form':{'method':_0xe45e('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe45e('0x22')]({'session':_0x219eeb['id'],'module_name':_0xe45e('0x23'),'name_value_list':_0x20a132})}});}function getAuth(_0x5bc8a1){return util[_0xe45e('0x24')](_0xe45e('0x25'),new Buffer(_0x5bc8a1[_0xe45e('0x26')]+':X')[_0xe45e('0x27')]('base64'));}function getServerInfo(_0x588c03){return request({'form':{'method':'get_server_info','input_type':_0xe45e('0x28'),'response_type':_0xe45e('0x28'),'rest_data':JSON['stringify']({'session':_0x588c03['id']})}});}function getUser(_0x1314eb,_0x13612a,_0x3b8a28){if(!_[_0xe45e('0x29')](_0x13612a)){logger[_0xe45e('0x2a')](_0xe45e('0x2b'),_0x13612a);return request({'form':{'method':_0xe45e('0x2c'),'input_type':_0xe45e('0x28'),'response_type':_0xe45e('0x28'),'rest_data':JSON[_0xe45e('0x22')]({'session':_0x3b8a28['id'],'module_name':'Employees','query':util[_0xe45e('0x24')](_0xe45e('0x2d'),_0x13612a),'order_by':'','offset':'0','select_fields':['id',_0xe45e('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe45e('0x2e')](function(_0xeaa662){if(_0xeaa662[_0xe45e('0x2f')][_0xe45e('0x1d')]){var _0x45da36=_[_0xe45e('0x30')](_0xeaa662['entry_list'],function(_0x32099f){return _0x32099f[_0xe45e('0x31')][_0xe45e('0x32')]['value']===_0x13612a;});if(_0x45da36){logger[_0xe45e('0x2a')](_0xe45e('0x33'));return BPromise['resolve']({'id':_0x45da36[_0xe45e('0x31')]['id'][_0xe45e('0x34')],'name':_0x45da36[_0xe45e('0x31')]['name']['value']});}}logger[_0xe45e('0x2a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x3b8a28[_0xe45e('0x31')][_0xe45e('0x35')][_0xe45e('0x34')],'name':_0x3b8a28[_0xe45e('0x31')][_0xe45e('0x32')][_0xe45e('0x34')]});});}else{logger[_0xe45e('0x2a')](_0xe45e('0x36'));return BPromise[_0xe45e('0x37')]({'id':_0x3b8a28[_0xe45e('0x31')][_0xe45e('0x35')][_0xe45e('0x34')],'name':_0x3b8a28['name_value_list'][_0xe45e('0x32')][_0xe45e('0x34')]});}}function getEndUser(_0x5a11ec,_0x22cc69,_0x10e297,_0x4d4aee){logger['info']('Searching\x20enduser\x20with\x20phone',_0x10e297);return request({'form':{'method':_0xe45e('0x2c'),'input_type':_0xe45e('0x28'),'response_type':_0xe45e('0x28'),'rest_data':JSON[_0xe45e('0x22')]({'session':_0x4d4aee['id'],'module_name':_0xe45e('0x1b'),'query':util[_0xe45e('0x24')](_0xe45e('0x38'),_0x10e297),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x42dd4c){if(_0x42dd4c[_0xe45e('0x2f')][_0xe45e('0x1d')]){var _0x362409=_[_0xe45e('0x30')](_0x42dd4c[_0xe45e('0x2f')],function(_0xefa6c0){return _0xefa6c0[_0xe45e('0x31')][_0xe45e('0x39')][_0xe45e('0x34')]===_0x10e297;});if(_0x362409){logger[_0xe45e('0x2a')](_0xe45e('0x3a'));return BPromise[_0xe45e('0x37')]({'id':_0x362409[_0xe45e('0x31')]['id'][_0xe45e('0x34')],'name':_0x362409[_0xe45e('0x31')][_0xe45e('0xf')][_0xe45e('0x34')],'phone':_0x362409[_0xe45e('0x31')]['phone_home']['value']});}}else{logger[_0xe45e('0x2a')](_0xe45e('0x3b'));return request({'form':{'method':'set_entry','input_type':_0xe45e('0x28'),'response_type':'JSON','rest_data':JSON[_0xe45e('0x22')]({'session':_0x4d4aee['id'],'module_name':_0xe45e('0x1b'),'name_value_list':[{'name':_0xe45e('0x3c'),'value':_0x22cc69!=='<unknown>'?_0x22cc69:util[_0xe45e('0x24')](_0xe45e('0x3d'),_0x10e297)},{'name':_0xe45e('0x39'),'value':_0x10e297}]})}})[_0xe45e('0x2e')](function(_0x3d4e4f){logger[_0xe45e('0x2a')]('Enduser\x20created.');return BPromise[_0xe45e('0x37')]({'id':_0x3d4e4f['id'],'name':_0x3d4e4f[_0xe45e('0x2f')]['first_name'][_0xe45e('0x34')],'phone':_0x3d4e4f[_0xe45e('0x2f')][_0xe45e('0x39')][_0xe45e('0x34')]});});}});}function request(_0x7cd419){logger[_0xe45e('0x3e')](_0xe45e('0x3f'),JSON[_0xe45e('0x22')](_0x7cd419));return rp(_['merge'](def,_0x7cd419));}function getTags(_0x50b3f8,_0x4b89ba){var _0x4f107a=[];if(_0x50b3f8&&_0x50b3f8[_0xe45e('0x1d')]>0x0){_0x4f107a=_['map'](_0x50b3f8,_0x4b89ba);}return _0x4f107a;}function getCustomFields(_0x2611e5,_0x3abd25){var _0x1889e6=[];var _0x4eb1ed={'custom_fields':[]};if(_0x2611e5['length']>0x0){_[_0xe45e('0x1e')](_0x2611e5,function(_0x3415c3){if(_0x3415c3['type']==='string'&&_0x3415c3['nameField']&&!_0x3415c3['customField']){_0x4eb1ed[_0x3415c3[_0xe45e('0x40')][_0xe45e('0x41')]()]=_0x3415c3[_0xe45e('0x42')]['toString']();}else if(_0x3415c3[_0xe45e('0x43')]===_0xe45e('0x44')&&_0x3415c3[_0xe45e('0x1f')]&&_0x3415c3['customField']){_0x4eb1ed[_0xe45e('0x45')][_0xe45e('0x46')]({'id':_0x3415c3[_0xe45e('0x1f')],'value':_0x3415c3[_0xe45e('0x42')][_0xe45e('0x27')]()});}else if(_0x3415c3[_0xe45e('0x43')]==='variable'&&_0x3415c3['variableName']&&_0x3415c3['idField']&&_0x3415c3[_0xe45e('0x47')]){_0x3abd25[_0x3415c3[_0xe45e('0x20')]]&&_0x4eb1ed[_0xe45e('0x45')][_0xe45e('0x46')]({'id':_0x3415c3['idField'],'value':_0x3abd25[_0x3415c3[_0xe45e('0x20')]][_0xe45e('0x27')]()});}else if(_0x3415c3[_0xe45e('0x43')]===_0xe45e('0x48')&&_0x3415c3[_0xe45e('0x49')]&&_0x3415c3[_0xe45e('0x49')][_0xe45e('0xf')]&&_0x3415c3[_0xe45e('0x1f')]&&_0x3415c3[_0xe45e('0x47')]){_0x3abd25[_0x3415c3['Variable'][_0xe45e('0xf')][_0xe45e('0x41')]()]&&_0x4eb1ed[_0xe45e('0x45')][_0xe45e('0x46')]({'id':_0x3415c3['idField'],'value':_0x3abd25[_0x3415c3[_0xe45e('0x49')][_0xe45e('0xf')][_0xe45e('0x41')]()][_0xe45e('0x27')]()});}});}return _0x4eb1ed;}function getConnection(_0x449c99){return request({'method':'POST','form':{'method':_0xe45e('0x4a'),'input_type':_0xe45e('0x28'),'response_type':_0xe45e('0x28'),'rest_data':JSON[_0xe45e('0x22')]({'user_auth':{'user_name':_0x449c99[_0xe45e('0x4b')],'password':_0x449c99[_0xe45e('0x4c')],'encryption':_0xe45e('0x4d')},'application':_0xe45e('0x4e')})}})['then'](function(_0x588fc0){var _0x496c70=_0x588fc0;if(_0x496c70['id']){def[_0xe45e('0x4f')]=_0x496c70['id'];return BPromise['resolve'](_0x496c70);}else{throw new Error(util[_0xe45e('0x24')](_0xe45e('0x50'),_0x449c99['id']));}});}function setRelationship(_0x3ae003,_0x25f38c,_0x37dd47,_0x25f316){return request({'form':{'method':'set_relationship','input_type':_0xe45e('0x28'),'response_type':_0xe45e('0x28'),'rest_data':JSON['stringify']({'session':_0x3ae003['id'],'module_name':_0xe45e('0x23'),'module_id':_0x37dd47['id'],'link_field_name':_0x25f316,'related_ids':[_0x25f38c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe45e('0x51')]=function(_0x5298dc,_0x265e6b,_0x3bdb68,_0x53f1d3,_0x4db1ec,_0x54fc09){var _0x4c5e1c,_0x16208a,_0x1c0ed0,_0x1b9657;_0x54fc09[_0xe45e('0x52')]=intUtil[_0xe45e('0x53')](_0x54fc09[_0xe45e('0x52')]);_0x54fc09[_0xe45e('0x54')]=intUtil[_0xe45e('0x53')](_0x54fc09[_0xe45e('0x54')]);def['uri']=util[_0xe45e('0x24')](_0xe45e('0x55'),_0x54fc09[_0xe45e('0x52')]);if(_0x4db1ec&&_0x4db1ec[_0xe45e('0x56')]){logger['info'](_0xe45e('0x57'),_0xe45e('0x58'));_0x265e6b[_0xe45e('0x59')]=util[_0xe45e('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54fc09['serverUrl'],_0x265e6b[_0xe45e('0x5a')],md5(_0x265e6b[_0xe45e('0x5a')]));}else{_0x265e6b[_0xe45e('0x59')]='';}return getConnection(_0x54fc09)[_0xe45e('0x2e')](function(_0x38c0a7){_0x1b9657=_0x38c0a7;return getUser(_0x54fc09,_0x53f1d3[_0xe45e('0xf')],_0x1b9657);})['then'](function(_0x436815){_0x4c5e1c=_0x436815;logger[_0xe45e('0x2a')](_0xe45e('0x5b'),_0x4c5e1c['id']);return getEndUser(_0x54fc09,_0x265e6b[_0xe45e('0x5c')],_0x265e6b[_0xe45e('0x5d')],_0x1b9657);})[_0xe45e('0x2e')](function(_0x57b78a){_0x16208a=_0x57b78a;logger[_0xe45e('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x16208a['id']);return getTicket(_0x54fc09,_0x4c5e1c,_0x16208a,_0x3bdb68,_0x265e6b,_0x3bdb68['Fields'],_0x1b9657,_0xe45e('0x5e'));})['then'](function(_0x19039a){_0x1c0ed0=_0x19039a;logger[_0xe45e('0x2a')](_0xe45e('0x5f'));logger[_0xe45e('0x2a')](_0xe45e('0x60'),_0x1c0ed0['id']);return setRelationship(_0x1b9657,_0x4c5e1c,_0x1c0ed0,'users');})[_0xe45e('0x2e')](function(){return setRelationship(_0x1b9657,_0x16208a,_0x1c0ed0,_0xe45e('0x61'));})[_0xe45e('0x2e')](function(){return getServerInfo(_0x1b9657);})[_0xe45e('0x2e')](function(_0x2cee45){var _0x260dbf=parseInt(_0x2cee45[_0xe45e('0x62')]['charAt'](0x0));var _0x1465c0=util[_0xe45e('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x54fc09[_0xe45e('0x52')],_0x1c0ed0['id']);if(_0x260dbf>0x6){_0x1465c0=util[_0xe45e('0x24')](_0xe45e('0x63'),_0x54fc09[_0xe45e('0x52')],_0x1c0ed0['id']);}logger[_0xe45e('0x2a')](_0xe45e('0x57'),_0xe45e('0x64'));emit(util[_0xe45e('0x24')]('user:%s',_0x53f1d3['name']),_0xe45e('0x65'),{'uri':_0x1465c0});})[_0xe45e('0x66')](function(_0x149992){logger['error']('[QUEUE]',JSON[_0xe45e('0x22')](_0x149992));});};exports[_0xe45e('0x67')]=function(_0x4b5657,_0x2aa6d3,_0x5a51b4,_0x20b874,_0x277767,_0x3540cc,_0x186e71){var _0x583186,_0x41ea23,_0x52d50d,_0x23df40;_0x3540cc[_0xe45e('0x52')]=intUtil[_0xe45e('0x53')](_0x3540cc[_0xe45e('0x52')]);_0x3540cc[_0xe45e('0x54')]=intUtil['stripTrailingSlash'](_0x3540cc[_0xe45e('0x54')]);def[_0xe45e('0x68')]=util[_0xe45e('0x24')]('%s/service/v4_1/rest.php',_0x3540cc[_0xe45e('0x52')]);if(_0x186e71&&_0x186e71[_0xe45e('0x69')]&&_0x186e71[_0xe45e('0x69')]!=='none'){logger[_0xe45e('0x2a')](_0xe45e('0x6a'),_0xe45e('0x58'));_0x2aa6d3[_0xe45e('0x59')]=util[_0xe45e('0x24')](_0xe45e('0x6b'),_0x3540cc[_0xe45e('0x54')],_0x2aa6d3[_0xe45e('0x5a')],md5(_0x2aa6d3[_0xe45e('0x5a')]));}return getConnection(_0x3540cc)[_0xe45e('0x2e')](function(_0x2b70c5){_0x23df40=_0x2b70c5;return getUser(_0x3540cc,_0x20b874[_0xe45e('0xf')],_0x23df40);})[_0xe45e('0x2e')](function(_0x4589e3){_0x583186=_0x4589e3;logger[_0xe45e('0x2a')](_0xe45e('0x5b'),_0x583186['id']);return getEndUser(_0x3540cc,_0x2aa6d3[_0xe45e('0x6c')],_0x2aa6d3['destcalleridnum'],_0x23df40);})[_0xe45e('0x2e')](function(_0x4b2fc4){_0x41ea23=_0x4b2fc4;logger['info']('The\x20Enduser\x20ID\x20is:',_0x41ea23['id']);return getTicket(_0x3540cc,_0x583186,_0x41ea23,_0x5a51b4,_0x2aa6d3,_0x5a51b4[_0xe45e('0x6d')],_0x23df40,_0xe45e('0x6e'));})[_0xe45e('0x2e')](function(_0x4828ab){_0x52d50d=_0x4828ab;logger[_0xe45e('0x2a')]('Ticket\x20created!');logger['info'](_0xe45e('0x60'),_0x52d50d['id']);return setRelationship(_0x23df40,_0x583186,_0x52d50d,'users');})[_0xe45e('0x2e')](function(){return setRelationship(_0x23df40,_0x41ea23,_0x52d50d,'contacts');})[_0xe45e('0x2e')](function(){return getServerInfo(_0x23df40);})[_0xe45e('0x2e')](function(_0x217a52){var _0x5ed2fa=parseInt(_0x217a52[_0xe45e('0x62')][_0xe45e('0x6f')](0x0));var _0x26dca3=util[_0xe45e('0x24')](_0xe45e('0x70'),_0x3540cc['remoteUri'],_0x52d50d['id']);if(_0x5ed2fa>0x6){_0x26dca3=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3540cc[_0xe45e('0x52')],_0x52d50d['id']);}logger['info'](_0xe45e('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe45e('0x24')](_0xe45e('0x71'),_0x20b874[_0xe45e('0xf')]),_0xe45e('0x65'),{'uri':_0x26dca3});})[_0xe45e('0x66')](function(_0x20bcac){logger[_0xe45e('0x72')](_0xe45e('0x6a'),JSON['stringify'](_0x20bcac));});};exports[_0xe45e('0x73')]=function(_0x2cf573,_0x4811f0,_0xd6b828,_0x2b51d0,_0x4da941,_0x4eae5f){var _0x1b43cb,_0x378a89,_0x55adcd,_0x537c7a;_0x4eae5f[_0xe45e('0x52')]=intUtil[_0xe45e('0x53')](_0x4eae5f[_0xe45e('0x52')]);_0x4eae5f[_0xe45e('0x54')]=intUtil[_0xe45e('0x53')](_0x4eae5f[_0xe45e('0x54')]);def[_0xe45e('0x68')]=util[_0xe45e('0x24')](_0xe45e('0x55'),_0x4eae5f[_0xe45e('0x52')]);if(_0x4da941&&_0x4da941[_0xe45e('0x56')]){logger[_0xe45e('0x2a')]('['+_0x4811f0[_0xe45e('0x74')][_0xe45e('0x75')]()+']',_0xe45e('0x58'));_0x4811f0['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4eae5f[_0xe45e('0x54')],_0x4811f0[_0xe45e('0x5a')],md5(_0x4811f0[_0xe45e('0x5a')]));}else{_0x4811f0[_0xe45e('0x59')]='';}return getConnection(_0x4eae5f)[_0xe45e('0x2e')](function(_0x2e1ed3){_0x537c7a=_0x2e1ed3;if(!_['isNil'](_0x2b51d0)){return getUser(_0x4eae5f,_0x2b51d0[_0xe45e('0xf')],_0x537c7a);}else{return getUser(_0x4eae5f,null,_0x537c7a);}})[_0xe45e('0x2e')](function(_0x1e6448){_0x1b43cb=_0x1e6448;logger[_0xe45e('0x2a')]('The\x20User\x20ID\x20is:',_0x1b43cb['id']);return getEndUser(_0x4eae5f,_0x4811f0[_0xe45e('0x5c')],_0x4811f0[_0xe45e('0x5d')],_0x537c7a);})[_0xe45e('0x2e')](function(_0x5d9f0a){_0x378a89=_0x5d9f0a;logger[_0xe45e('0x2a')](_0xe45e('0x76'),_0x378a89['id']);return getTicket(_0x4eae5f,_0x1b43cb,_0x378a89,_0xd6b828,_0x4811f0,_0xd6b828[_0xe45e('0x6d')],_0x537c7a,'Inbound');})[_0xe45e('0x2e')](function(_0x2d783d){_0x55adcd=_0x2d783d;logger[_0xe45e('0x2a')](_0xe45e('0x5f'));logger[_0xe45e('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x55adcd['id']);return setRelationship(_0x537c7a,_0x1b43cb,_0x55adcd,'users');})[_0xe45e('0x2e')](function(){return setRelationship(_0x537c7a,_0x378a89,_0x55adcd,'contacts');})[_0xe45e('0x2e')](function(){return getServerInfo(_0x537c7a);})['catch'](function(_0x44bd36){logger[_0xe45e('0x72')]('['+_0x4811f0[_0xe45e('0x74')][_0xe45e('0x75')]()+']',JSON[_0xe45e('0x22')](_0x44bd36));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4aa0=['customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','string','push','content','variable','variableName','toString','type'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x4aa0,0x1af));var _0x04aa=function(_0xe45207,_0x28620d){_0xe45207=_0xe45207-0x0;var _0x1fab1c=_0x4aa0[_0xe45207];return _0x1fab1c;};'use strict';var _=require(_0x04aa('0x0'));var util=require(_0x04aa('0x1'));exports[_0x04aa('0x2')]=function(_0x1afd54,_0x32c5e4,_0x1f359b){var _0x236bb0=[];if(_0x1afd54[_0x04aa('0x3')]>0x0){var _0x4ffbad=_['sortBy'](_0x1afd54,['id']);for(var _0x353462=0x0;_0x353462<_0x4ffbad['length'];_0x353462++){var _0x4fe172=_0x4ffbad[_0x353462];if(_0x4fe172['type']===_0x04aa('0x4')){_0x236bb0[_0x04aa('0x5')](_0x4fe172[_0x04aa('0x6')]);}else if(_0x4fe172['type']===_0x04aa('0x7')&&_0x4fe172[_0x04aa('0x8')]){_0x32c5e4[_0x4fe172[_0x04aa('0x8')]]&&_0x236bb0[_0x04aa('0x5')](_0x32c5e4[_0x4fe172[_0x04aa('0x8')]][_0x04aa('0x9')]());}else if(_0x4fe172[_0x04aa('0xa')]===_0x04aa('0xb')&&_0x4fe172[_0x04aa('0xc')]&&_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')]){_0x32c5e4[_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')][_0x04aa('0xe')]()]&&_0x236bb0[_0x04aa('0x5')](_0x32c5e4[_0x4fe172['Variable'][_0x04aa('0xd')]['toLowerCase']()][_0x04aa('0x9')]());}else if(_0x4fe172[_0x04aa('0xa')]===_0x04aa('0xf')){if(_0x4fe172[_0x04aa('0x10')]===_0x04aa('0x4')&&_0x4fe172[_0x04aa('0x11')]){_0x236bb0[_0x04aa('0x5')](util[_0x04aa('0x12')](_0x04aa('0x13'),_0x4fe172[_0x04aa('0x11')],_0x4fe172[_0x04aa('0x14')]));}else if(_0x4fe172['keyType']==='variable'&&_0x4fe172['variableName']&&_0x4fe172['key']){_0x32c5e4[_0x4fe172['variableName']]&&_0x236bb0['push'](util[_0x04aa('0x12')](_0x04aa('0x13'),_0x4fe172[_0x04aa('0x11')],_0x32c5e4[_0x4fe172['variableName']]));}else if(_0x4fe172[_0x04aa('0x10')]==='customVariable'&&_0x4fe172[_0x04aa('0xc')]&&_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')]&&_0x4fe172[_0x04aa('0x11')]){_0x32c5e4[_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')][_0x04aa('0xe')]()]&&_0x236bb0[_0x04aa('0x5')](util[_0x04aa('0x12')](_0x04aa('0x13'),_0x4fe172[_0x04aa('0x11')],_0x32c5e4[_0x4fe172[_0x04aa('0xc')][_0x04aa('0xd')][_0x04aa('0xe')]()]));}}}}return _0x236bb0['join'](_0x1f359b);};exports[_0x04aa('0x15')]=function(_0x50ffa3){var _0x24e624=_0x50ffa3['slice'](-0x1);if(_0x24e624==='/'){_0x50ffa3=_0x50ffa3[_0x04aa('0x16')](0x0,_0x50ffa3[_0x04aa('0x17')](_0x24e624));}return _0x50ffa3;};exports[_0x04aa('0x18')]=function(_0x52739b){if(!_[_0x04aa('0x19')](_0x52739b)&&_0x52739b!==''){var _0x2317d0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x2317d0['test'](String(_0x52739b)[_0x04aa('0xe')]());}else{return![];}};
\ No newline at end of file
+var _0x85b5=['push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','test','util','getString','string'];(function(_0x4fa798,_0x5bec0b){var _0x4c41a1=function(_0xf29988){while(--_0xf29988){_0x4fa798['push'](_0x4fa798['shift']());}};_0x4c41a1(++_0x5bec0b);}(_0x85b5,0x14d));var _0x585b=function(_0x18240f,_0x3299af){_0x18240f=_0x18240f-0x0;var _0x460579=_0x85b5[_0x18240f];return _0x460579;};'use strict';var _=require('lodash');var util=require(_0x585b('0x0'));exports[_0x585b('0x1')]=function(_0x12747d,_0xe0c2b9,_0x568c87){var _0x1ae429=[];if(_0x12747d['length']>0x0){var _0xb99899=_['sortBy'](_0x12747d,['id']);for(var _0x670e9d=0x0;_0x670e9d<_0xb99899['length'];_0x670e9d++){var _0x6f1789=_0xb99899[_0x670e9d];if(_0x6f1789['type']===_0x585b('0x2')){_0x1ae429[_0x585b('0x3')](_0x6f1789[_0x585b('0x4')]);}else if(_0x6f1789['type']===_0x585b('0x5')&&_0x6f1789['variableName']){_0xe0c2b9[_0x6f1789[_0x585b('0x6')]]&&_0x1ae429[_0x585b('0x3')](_0xe0c2b9[_0x6f1789['variableName']][_0x585b('0x7')]());}else if(_0x6f1789['type']===_0x585b('0x8')&&_0x6f1789['Variable']&&_0x6f1789[_0x585b('0x9')][_0x585b('0xa')]){_0xe0c2b9[_0x6f1789[_0x585b('0x9')][_0x585b('0xa')][_0x585b('0xb')]()]&&_0x1ae429[_0x585b('0x3')](_0xe0c2b9[_0x6f1789[_0x585b('0x9')]['name'][_0x585b('0xb')]()]['toString']());}else if(_0x6f1789['type']===_0x585b('0xc')){if(_0x6f1789[_0x585b('0xd')]===_0x585b('0x2')&&_0x6f1789[_0x585b('0xe')]){_0x1ae429[_0x585b('0x3')](util[_0x585b('0xf')]('%s:\x20%s',_0x6f1789[_0x585b('0xe')],_0x6f1789[_0x585b('0x10')]));}else if(_0x6f1789[_0x585b('0xd')]===_0x585b('0x5')&&_0x6f1789[_0x585b('0x6')]&&_0x6f1789[_0x585b('0xe')]){_0xe0c2b9[_0x6f1789['variableName']]&&_0x1ae429[_0x585b('0x3')](util[_0x585b('0xf')]('%s:\x20%s',_0x6f1789[_0x585b('0xe')],_0xe0c2b9[_0x6f1789[_0x585b('0x6')]]));}else if(_0x6f1789[_0x585b('0xd')]===_0x585b('0x8')&&_0x6f1789[_0x585b('0x9')]&&_0x6f1789[_0x585b('0x9')]['name']&&_0x6f1789[_0x585b('0xe')]){_0xe0c2b9[_0x6f1789['Variable'][_0x585b('0xa')][_0x585b('0xb')]()]&&_0x1ae429[_0x585b('0x3')](util[_0x585b('0xf')](_0x585b('0x11'),_0x6f1789['key'],_0xe0c2b9[_0x6f1789[_0x585b('0x9')]['name'][_0x585b('0xb')]()]));}}}}return _0x1ae429[_0x585b('0x12')](_0x568c87);};exports[_0x585b('0x13')]=function(_0x5cf929){var _0x2c793d=_0x5cf929[_0x585b('0x14')](-0x1);if(_0x2c793d==='/'){_0x5cf929=_0x5cf929[_0x585b('0x15')](0x0,_0x5cf929[_0x585b('0x16')](_0x2c793d));}return _0x5cf929;};exports['validateEmail']=function(_0x1e483e){if(!_['isNil'](_0x1e483e)&&_0x1e483e!==''){var _0x515201=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x515201[_0x585b('0x17')](String(_0x1e483e)[_0x585b('0xb')]());}else{return![];}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x427a55,_0x18822c){var _0x581ca4=function(_0xdf9020){while(--_0xdf9020){_0x427a55['push'](_0x427a55['shift']());}};_0x581ca4(++_0x18822c);}(_0x34e8,0x12c));var _0x834e=function(_0x318ebb,_0x2d433f){_0x318ebb=_0x318ebb-0x0;var _0x801b87=_0x34e8[_0x318ebb];return _0x801b87;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});};
\ No newline at end of file
+var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x57a92c,_0x562c9f){var _0x1e2cc5=function(_0x4bcc29){while(--_0x4bcc29){_0x57a92c['push'](_0x57a92c['shift']());}};_0x1e2cc5(++_0x562c9f);}(_0x34e8,0x12c));var _0x834e=function(_0x3bb3e2,_0x5ead01){_0x3bb3e2=_0x3bb3e2-0x0;var _0x304cbc=_0x34e8[_0x3bb3e2];return _0x304cbc;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdcbf=['user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','[HTTP]','stringify','defaults','map','forEach','includes','nameField','content','string','picklist','idField','customField','custom_fields','push','type','variable','variableName','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdcbf,0x16d));var _0xfdcb=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdcbf[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xfdcb('0x0'));var rp=require(_0xfdcb('0x1'));var md5=require(_0xfdcb('0x2'));var util=require(_0xfdcb('0x3'));var Redis=require(_0xfdcb('0x4'));var intUtil=require(_0xfdcb('0x5'));var config=require('../../../../config/environment');var logger=require(_0xfdcb('0x6'))(_0xfdcb('0x7'));config[_0xfdcb('0x8')]=_['defaults'](config[_0xfdcb('0x8')],{'host':_0xfdcb('0x9'),'port':0x18eb});var io=require(_0xfdcb('0xa'))(new Redis(config['redis']));function emit(_0x12f734,_0x555673,_0x35ff6f){io['to'](_0x12f734)[_0xfdcb('0xb')](_0x555673,_0x35ff6f);}var headers={'Content-Type':'application/json','Accept':_0xfdcb('0xc')};function getTicket(_0x4e8160,_0x30be95,_0x326a46,_0x342a35,_0x2bed67){logger[_0xfdcb('0xd')](_0xfdcb('0xe'));return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x10'),_0x4e8160[_0xfdcb('0x11')]),'method':_0xfdcb('0x12'),'body':{'ticket':_[_0xfdcb('0x13')]({'requester_id':_0x326a46['id'],'submitter_id':_0x30be95?_0x30be95['id']:undefined,'assignee_id':_0x30be95?_0x30be95['id']:undefined,'tags':getTags(_0x342a35['Tags'],_0xfdcb('0x14')),'subject':intUtil['getString'](_0x342a35['Subjects'],_0x2bed67,'\x20'),'description':intUtil[_0xfdcb('0x15')](_0x342a35[_0xfdcb('0x16')],_0x2bed67,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfdcb('0x15')](_0x342a35['Descriptions'],_0x2bed67,'\x0a')}},getCustomFields(_0x342a35[_0xfdcb('0x17')],_0x2bed67))}})[_0xfdcb('0x18')](function(_0x436f38){logger[_0xfdcb('0xd')](_0xfdcb('0x19'));return _0x436f38[_0xfdcb('0x1a')];});}function getUser(_0x21d978,_0x2d56b5){if(intUtil[_0xfdcb('0x1b')](_0x2d56b5)){logger[_0xfdcb('0xd')](_0xfdcb('0x1c'),_0x2d56b5);return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x1d'),_0x21d978[_0xfdcb('0x11')]),'qs':{'query':util[_0xfdcb('0xf')](_0xfdcb('0x1e'),_0x2d56b5)}})[_0xfdcb('0x18')](function(_0x739357){if(_0x739357['count']){logger[_0xfdcb('0xd')](_0xfdcb('0x1f'));return _[_0xfdcb('0x20')](_0x739357[_0xfdcb('0x21')],{'email':_0x2d56b5,'role':_0xfdcb('0x22')});}else{logger[_0xfdcb('0xd')](_0xfdcb('0x23'));return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x24'),_0x21d978[_0xfdcb('0x11')])})['then'](function(_0x111fa6){logger[_0xfdcb('0xd')](_0xfdcb('0x25'));return _0x111fa6['user'];});}});}else{logger[_0xfdcb('0xd')](_0xfdcb('0x23'));return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x24'),_0x21d978['remoteUri'])})[_0xfdcb('0x18')](function(_0x2dcade){logger[_0xfdcb('0xd')](_0xfdcb('0x25'));return _0x2dcade[_0xfdcb('0x26')];});}}function getEndUser(_0x3c6171,_0x576ae4,_0x40f038){logger[_0xfdcb('0xd')](_0xfdcb('0x27'),_0x40f038);return request({'uri':util[_0xfdcb('0xf')](_0xfdcb('0x1d'),_0x3c6171['remoteUri']),'qs':{'query':util[_0xfdcb('0xf')](_0xfdcb('0x28'),_0x40f038)}})['then'](function(_0x341fa8){var _0x28aabf;if(_0x341fa8[_0xfdcb('0x21')][_0xfdcb('0x29')]){_0x341fa8[_0xfdcb('0x21')]=_[_0xfdcb('0x2a')](_0x341fa8[_0xfdcb('0x21')],{'suspended':![],'role':_0xfdcb('0x2b')});if(_0x341fa8[_0xfdcb('0x21')][_0xfdcb('0x29')]){_0x28aabf=_[_0xfdcb('0x2c')](_0x341fa8[_0xfdcb('0x21')]);}}if(_0x28aabf){logger[_0xfdcb('0xd')](_0xfdcb('0x2d'));return _0x28aabf;}else{logger[_0xfdcb('0xd')](_0xfdcb('0x2e'));return request({'uri':util[_0xfdcb('0xf')]('%s/users.json',_0x3c6171[_0xfdcb('0x11')]),'method':_0xfdcb('0x12'),'body':{'user':{'role':'end-user','name':util[_0xfdcb('0xf')](_0xfdcb('0x2f'),_0x576ae4||_0x40f038),'phone':_0x40f038}}})[_0xfdcb('0x18')](function(_0x469adc){logger[_0xfdcb('0xd')]('Enduser\x20created.');return _0x469adc[_0xfdcb('0x26')];});}});}function getAuth(_0x4d02fb){var _0x427df7;if(_0x4d02fb[_0xfdcb('0x30')]===_0xfdcb('0x31')){_0x427df7=util[_0xfdcb('0xf')](_0xfdcb('0x32'),_0x4d02fb['username'],_0x4d02fb[_0xfdcb('0x31')]);}else if(_0x4d02fb[_0xfdcb('0x30')]===_0xfdcb('0x33')){_0x427df7=util[_0xfdcb('0xf')](_0xfdcb('0x34'),_0x4d02fb['username'],_0x4d02fb[_0xfdcb('0x33')]);}return util['format'](_0xfdcb('0x35'),new Buffer(_0x427df7)[_0xfdcb('0x36')]('base64'));}function request(_0x2fa63a){logger['debug'](_0xfdcb('0x37'),JSON[_0xfdcb('0x38')](_0x2fa63a));return rp(_[_0xfdcb('0x39')](_0x2fa63a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x27b5c4,_0x3207a6){var _0x180f93=[];if(_0x27b5c4&&_0x27b5c4[_0xfdcb('0x29')]>0x0){_0x180f93=_[_0xfdcb('0x3a')](_0x27b5c4,_0x3207a6);}return _0x180f93;}function getCustomFields(_0x49aa26,_0x284271){var _0x11821e=[];var _0x1dd30a={'custom_fields':[]};if(_0x49aa26[_0xfdcb('0x29')]>0x0){_[_0xfdcb('0x3b')](_0x49aa26,function(_0x5866d6){if(_[_0xfdcb('0x3c')](['string','picklist'],_0x5866d6['type'])&&_0x5866d6[_0xfdcb('0x3d')]&&!_0x5866d6['customField']){_0x1dd30a[_0x5866d6[_0xfdcb('0x3d')]['toLowerCase']()]=_0x5866d6[_0xfdcb('0x3e')]['toString']();}else if(_['includes']([_0xfdcb('0x3f'),_0xfdcb('0x40')],_0x5866d6['type'])&&_0x5866d6[_0xfdcb('0x41')]&&_0x5866d6[_0xfdcb('0x42')]){_0x1dd30a[_0xfdcb('0x43')][_0xfdcb('0x44')]({'id':_0x5866d6['idField'],'value':_0x5866d6['content'][_0xfdcb('0x36')]()});}else if(_0x5866d6[_0xfdcb('0x45')]===_0xfdcb('0x46')&&_0x5866d6['variableName']&&_0x5866d6['idField']&&_0x5866d6[_0xfdcb('0x42')]){_0x284271[_0x5866d6[_0xfdcb('0x47')]]&&_0x1dd30a[_0xfdcb('0x43')][_0xfdcb('0x44')]({'id':_0x5866d6[_0xfdcb('0x41')],'value':_0x284271[_0x5866d6[_0xfdcb('0x47')]]['toString']()});}else if(_0x5866d6[_0xfdcb('0x45')]==='customVariable'&&_0x5866d6[_0xfdcb('0x48')]&&_0x5866d6[_0xfdcb('0x48')][_0xfdcb('0x14')]&&_0x5866d6[_0xfdcb('0x41')]&&_0x5866d6[_0xfdcb('0x42')]){_0x284271[_0x5866d6[_0xfdcb('0x48')][_0xfdcb('0x14')][_0xfdcb('0x49')]()]&&_0x1dd30a[_0xfdcb('0x43')]['push']({'id':_0x5866d6[_0xfdcb('0x41')],'value':_0x284271[_0x5866d6['Variable'][_0xfdcb('0x14')][_0xfdcb('0x49')]()][_0xfdcb('0x36')]()});}});}return _0x1dd30a;}exports[_0xfdcb('0x4a')]=function(_0x286fff,_0x176746,_0x5c06ff,_0x5203fd,_0xb4bfed,_0xcd01e3){var _0x3d6e37,_0x190496;_0xcd01e3['remoteUri']=intUtil['stripTrailingSlash'](_0xcd01e3[_0xfdcb('0x11')]);_0xcd01e3[_0xfdcb('0x4b')]=intUtil[_0xfdcb('0x4c')](_0xcd01e3['serverUrl']);if(_0xb4bfed&&_0xb4bfed[_0xfdcb('0x4d')]){logger[_0xfdcb('0xd')](_0xfdcb('0x4e'),_0xfdcb('0x4f'));_0x176746[_0xfdcb('0x50')]=util[_0xfdcb('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xcd01e3[_0xfdcb('0x4b')],_0x176746[_0xfdcb('0x51')],md5(_0x176746[_0xfdcb('0x51')]));}else{_0x176746[_0xfdcb('0x50')]='';}headers[_0xfdcb('0x52')]=getAuth(_0xcd01e3);return getUser(_0xcd01e3,_0x5203fd[_0xfdcb('0x53')])[_0xfdcb('0x18')](function(_0x37d401){_0x3d6e37=_0x37d401;logger[_0xfdcb('0xd')]('The\x20User\x20ID\x20is:',_0x3d6e37['id']);return getEndUser(_0xcd01e3,_0x176746[_0xfdcb('0x54')],_0x176746[_0xfdcb('0x55')]);})['then'](function(_0x2ef83f){_0x190496=_0x2ef83f;logger[_0xfdcb('0xd')](_0xfdcb('0x56'),_0x190496['id']);return getTicket(_0xcd01e3,_0x3d6e37,_0x190496,_0x5c06ff,_0x176746);})[_0xfdcb('0x18')](function(_0x5cdd81){if(_0x5cdd81){logger[_0xfdcb('0xd')](_0xfdcb('0x57'),_0x5cdd81['id']);switch(_0xcd01e3[_0xfdcb('0x45')]){case _0xfdcb('0x58'):logger['info'](_0xfdcb('0x4e'),_0xfdcb('0x59'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xcd01e3['remoteUri'],_0x3d6e37['id'],_0x5cdd81['id']),'method':'POST'});case _0xfdcb('0x5a'):logger[_0xfdcb('0xd')](_0xfdcb('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xfdcb('0x5b'),_0x5203fd['name']),_0xfdcb('0x5c'),{'uri':util[_0xfdcb('0xf')](_0xfdcb('0x5d'),_0xcd01e3[_0xfdcb('0x11')][_0xfdcb('0x5e')](_0xfdcb('0x5f'),''),_0x5cdd81['id'])});break;default:logger[_0xfdcb('0x60')]('[QUEUE]',_0xfdcb('0x61'));}}})[_0xfdcb('0x62')](function(_0xd52016){logger[_0xfdcb('0x60')](_0xfdcb('0x63'),util[_0xfdcb('0x64')](_0xd52016,{'showHidden':!![],'depth':null}));});};exports[_0xfdcb('0x65')]=function(_0x13edc6,_0x1f2482,_0x5e9e9f,_0x51daa8,_0x2d2e29,_0x590e0e,_0x1932b7){var _0x22b013,_0x2e4918;_0x590e0e['remoteUri']=intUtil[_0xfdcb('0x4c')](_0x590e0e['remoteUri']);_0x590e0e[_0xfdcb('0x4b')]=intUtil[_0xfdcb('0x4c')](_0x590e0e[_0xfdcb('0x4b')]);if(_0x1932b7&&_0x1932b7['recordingFormat']&&_0x1932b7['recordingFormat']!==_0xfdcb('0x66')){logger[_0xfdcb('0xd')]('[OUTBOUND]',_0xfdcb('0x4f'));_0x1f2482[_0xfdcb('0x50')]=util[_0xfdcb('0xf')](_0xfdcb('0x67'),_0x590e0e['serverUrl'],_0x1f2482['uniqueid'],md5(_0x1f2482[_0xfdcb('0x51')]));}headers[_0xfdcb('0x52')]=getAuth(_0x590e0e);return getUser(_0x590e0e,_0x51daa8[_0xfdcb('0x53')])[_0xfdcb('0x18')](function(_0x49713d){_0x22b013=_0x49713d;logger['info'](_0xfdcb('0x68'),_0x22b013['id']);return getEndUser(_0x590e0e,_0x1f2482[_0xfdcb('0x69')],_0x1f2482[_0xfdcb('0x6a')]);})[_0xfdcb('0x18')](function(_0x4a68bb){_0x2e4918=_0x4a68bb;logger[_0xfdcb('0xd')](_0xfdcb('0x56'),_0x2e4918['id']);return getTicket(_0x590e0e,_0x22b013,_0x2e4918,_0x5e9e9f,_0x1f2482);})['then'](function(_0x4f6d2b){if(_0x4f6d2b){logger[_0xfdcb('0xd')](_0xfdcb('0x57'),_0x4f6d2b['id']);switch(_0x590e0e[_0xfdcb('0x45')]){case _0xfdcb('0x58'):logger[_0xfdcb('0xd')](_0xfdcb('0x6b'),_0xfdcb('0x59'));return request({'uri':util[_0xfdcb('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x590e0e[_0xfdcb('0x11')],_0x22b013['id'],_0x4f6d2b['id']),'method':_0xfdcb('0x12')});case _0xfdcb('0x5a'):logger[_0xfdcb('0xd')](_0xfdcb('0x6b'),_0xfdcb('0x6c'));emit(util[_0xfdcb('0xf')](_0xfdcb('0x5b'),_0x51daa8[_0xfdcb('0x14')]),_0xfdcb('0x5c'),{'uri':util[_0xfdcb('0xf')](_0xfdcb('0x5d'),_0x590e0e[_0xfdcb('0x11')][_0xfdcb('0x5e')](_0xfdcb('0x5f'),''),_0x4f6d2b['id'])});break;default:logger[_0xfdcb('0x60')](_0xfdcb('0x6b'),_0xfdcb('0x61'));}}})[_0xfdcb('0x62')](function(_0x51c8ce){logger['error'](_0xfdcb('0x6d'),util[_0xfdcb('0x64')](_0x51c8ce,{'showHidden':!![],'depth':null}));});};exports[_0xfdcb('0x6e')]=function(_0x416bc3,_0x5a2b7b,_0x36c751,_0x1f47da,_0x4d4cf0,_0x3b943d){var _0x46e1f7,_0x2d3030;_0x3b943d[_0xfdcb('0x11')]=intUtil[_0xfdcb('0x4c')](_0x3b943d['remoteUri']);_0x3b943d[_0xfdcb('0x4b')]=intUtil[_0xfdcb('0x4c')](_0x3b943d['serverUrl']);if(_0x4d4cf0&&_0x4d4cf0[_0xfdcb('0x4d')]){logger[_0xfdcb('0xd')]('['+_0x5a2b7b[_0xfdcb('0x6f')][_0xfdcb('0x70')]()+']',_0xfdcb('0x4f'));_0x5a2b7b['recordingURL']=util['format'](_0xfdcb('0x67'),_0x3b943d[_0xfdcb('0x4b')],_0x5a2b7b[_0xfdcb('0x51')],md5(_0x5a2b7b[_0xfdcb('0x51')]));}else{_0x5a2b7b[_0xfdcb('0x50')]='';}headers[_0xfdcb('0x52')]=getAuth(_0x3b943d);return getUser(_0x3b943d)[_0xfdcb('0x18')](function(_0x285f81){_0x46e1f7=_0x285f81;logger[_0xfdcb('0xd')]('The\x20User\x20ID\x20is:',_0x46e1f7['id']);return getEndUser(_0x3b943d,_0x5a2b7b[_0xfdcb('0x54')],_0x5a2b7b[_0xfdcb('0x55')]);})['then'](function(_0xdd4f2c){_0x2d3030=_0xdd4f2c;logger['info'](_0xfdcb('0x56'),_0x2d3030['id']);return getTicket(_0x3b943d,_0x46e1f7,_0x2d3030,_0x36c751,_0x5a2b7b);})['then'](function(_0x59ad22){if(_0x59ad22){logger[_0xfdcb('0xd')](_0xfdcb('0x57'),_0x59ad22['id']);}})['catch'](function(_0x3a282d){logger['error']('['+_0x5a2b7b[_0xfdcb('0x6f')][_0xfdcb('0x70')]()+']'+_0xfdcb('0x71'),util[_0xfdcb('0x64')](_0x3a282d,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x7d70=['none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','base64','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','custom_fields','variable','variableName','customVariable','Variable','push','queue','serverUrl','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat'];(function(_0x54e333,_0x4ba478){var _0x47279e=function(_0x8e4f0b){while(--_0x8e4f0b){_0x54e333['push'](_0x54e333['shift']());}};_0x47279e(++_0x4ba478);}(_0x7d70,0xe9));var _0x07d7=function(_0x2c7be3,_0x352294){_0x2c7be3=_0x2c7be3-0x0;var _0x2e4af2=_0x7d70[_0x2c7be3];return _0x2e4af2;};'use strict';var _=require('lodash');var rp=require(_0x07d7('0x0'));var md5=require(_0x07d7('0x1'));var util=require(_0x07d7('0x2'));var Redis=require(_0x07d7('0x3'));var intUtil=require(_0x07d7('0x4'));var config=require(_0x07d7('0x5'));var logger=require(_0x07d7('0x6'))('zendesk');config[_0x07d7('0x7')]=_['defaults'](config[_0x07d7('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x07d7('0x8'))(new Redis(config['redis']));function emit(_0x277040,_0x3fc9b6,_0x5d5f06){io['to'](_0x277040)['emit'](_0x3fc9b6,_0x5d5f06);}var headers={'Content-Type':_0x07d7('0x9'),'Accept':_0x07d7('0x9')};function getTicket(_0x480f07,_0x3f3cad,_0x9c6a53,_0x2c2d58,_0x2ee0f8){logger[_0x07d7('0xa')](_0x07d7('0xb'));return request({'uri':util['format'](_0x07d7('0xc'),_0x480f07[_0x07d7('0xd')]),'method':_0x07d7('0xe'),'body':{'ticket':_[_0x07d7('0xf')]({'requester_id':_0x9c6a53['id'],'submitter_id':_0x3f3cad?_0x3f3cad['id']:undefined,'assignee_id':_0x3f3cad?_0x3f3cad['id']:undefined,'tags':getTags(_0x2c2d58['Tags'],_0x07d7('0x10')),'subject':intUtil[_0x07d7('0x11')](_0x2c2d58[_0x07d7('0x12')],_0x2ee0f8,'\x20'),'description':intUtil['getString'](_0x2c2d58['Descriptions'],_0x2ee0f8,'\x0a'),'comment':{'public':![],'body':intUtil[_0x07d7('0x11')](_0x2c2d58[_0x07d7('0x13')],_0x2ee0f8,'\x0a')}},getCustomFields(_0x2c2d58[_0x07d7('0x14')],_0x2ee0f8))}})[_0x07d7('0x15')](function(_0x3b0ad1){logger['info'](_0x07d7('0x16'));return _0x3b0ad1[_0x07d7('0x17')];});}function getUser(_0x24c33a,_0x2ede90){if(intUtil['validateEmail'](_0x2ede90)){logger[_0x07d7('0xa')](_0x07d7('0x18'),_0x2ede90);return request({'uri':util['format']('%s/search.json',_0x24c33a['remoteUri']),'qs':{'query':util['format'](_0x07d7('0x19'),_0x2ede90)}})[_0x07d7('0x15')](function(_0x46170e){if(_0x46170e[_0x07d7('0x1a')]){logger['info'](_0x07d7('0x1b'));return _[_0x07d7('0x1c')](_0x46170e[_0x07d7('0x1d')],{'email':_0x2ede90,'role':_0x07d7('0x1e')});}else{logger[_0x07d7('0xa')](_0x07d7('0x1f'));return request({'uri':util[_0x07d7('0x20')](_0x07d7('0x21'),_0x24c33a[_0x07d7('0xd')])})[_0x07d7('0x15')](function(_0x52687d){logger[_0x07d7('0xa')](_0x07d7('0x22'));return _0x52687d['user'];});}});}else{logger[_0x07d7('0xa')](_0x07d7('0x1f'));return request({'uri':util['format']('%s/users/me.json',_0x24c33a[_0x07d7('0xd')])})['then'](function(_0x326215){logger[_0x07d7('0xa')]('Admin\x20account\x20selected.');return _0x326215[_0x07d7('0x23')];});}}function getEndUser(_0x28c7af,_0x4a0c5f,_0x5ef3ca){logger[_0x07d7('0xa')]('Searching\x20enduser\x20with\x20phone',_0x5ef3ca);return request({'uri':util[_0x07d7('0x20')]('%s/search.json',_0x28c7af[_0x07d7('0xd')]),'qs':{'query':util[_0x07d7('0x20')](_0x07d7('0x24'),_0x5ef3ca)}})['then'](function(_0x2e5d04){var _0x47da19;if(_0x2e5d04[_0x07d7('0x1d')][_0x07d7('0x25')]){_0x2e5d04[_0x07d7('0x1d')]=_['filter'](_0x2e5d04[_0x07d7('0x1d')],{'suspended':![],'role':_0x07d7('0x26')});if(_0x2e5d04['results']['length']){_0x47da19=_[_0x07d7('0x27')](_0x2e5d04[_0x07d7('0x1d')]);}}if(_0x47da19){logger[_0x07d7('0xa')]('Enduser\x20found!');return _0x47da19;}else{logger[_0x07d7('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/users.json',_0x28c7af[_0x07d7('0xd')]),'method':'POST','body':{'user':{'role':_0x07d7('0x26'),'name':util['format'](_0x07d7('0x28'),_0x4a0c5f||_0x5ef3ca),'phone':_0x5ef3ca}}})[_0x07d7('0x15')](function(_0x2649e6){logger['info']('Enduser\x20created.');return _0x2649e6[_0x07d7('0x23')];});}});}function getAuth(_0x377e69){var _0x5450f6;if(_0x377e69[_0x07d7('0x29')]===_0x07d7('0x2a')){_0x5450f6=util['format'](_0x07d7('0x2b'),_0x377e69[_0x07d7('0x2c')],_0x377e69[_0x07d7('0x2a')]);}else if(_0x377e69['authType']===_0x07d7('0x2d')){_0x5450f6=util['format'](_0x07d7('0x2e'),_0x377e69['username'],_0x377e69['token']);}return util[_0x07d7('0x20')](_0x07d7('0x2f'),new Buffer(_0x5450f6)['toString'](_0x07d7('0x30')));}function request(_0x5f1c45){logger['debug']('[HTTP]',JSON[_0x07d7('0x31')](_0x5f1c45));return rp(_['defaults'](_0x5f1c45,{'method':_0x07d7('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2d1018,_0x3591eb){var _0x50d469=[];if(_0x2d1018&&_0x2d1018[_0x07d7('0x25')]>0x0){_0x50d469=_['map'](_0x2d1018,_0x3591eb);}return _0x50d469;}function getCustomFields(_0x276c3d,_0x5eaaca){var _0x56d901=[];var _0x5ea7bd={'custom_fields':[]};if(_0x276c3d[_0x07d7('0x25')]>0x0){_[_0x07d7('0x33')](_0x276c3d,function(_0x53f33b){if(_[_0x07d7('0x34')]([_0x07d7('0x35'),_0x07d7('0x36')],_0x53f33b[_0x07d7('0x37')])&&_0x53f33b[_0x07d7('0x38')]&&!_0x53f33b[_0x07d7('0x39')]){_0x5ea7bd[_0x53f33b[_0x07d7('0x38')][_0x07d7('0x3a')]()]=_0x53f33b[_0x07d7('0x3b')][_0x07d7('0x3c')]();}else if(_[_0x07d7('0x34')](['string',_0x07d7('0x36')],_0x53f33b[_0x07d7('0x37')])&&_0x53f33b[_0x07d7('0x3d')]&&_0x53f33b[_0x07d7('0x39')]){_0x5ea7bd[_0x07d7('0x3e')]['push']({'id':_0x53f33b['idField'],'value':_0x53f33b[_0x07d7('0x3b')][_0x07d7('0x3c')]()});}else if(_0x53f33b[_0x07d7('0x37')]===_0x07d7('0x3f')&&_0x53f33b[_0x07d7('0x40')]&&_0x53f33b[_0x07d7('0x3d')]&&_0x53f33b[_0x07d7('0x39')]){_0x5eaaca[_0x53f33b[_0x07d7('0x40')]]&&_0x5ea7bd[_0x07d7('0x3e')]['push']({'id':_0x53f33b[_0x07d7('0x3d')],'value':_0x5eaaca[_0x53f33b[_0x07d7('0x40')]]['toString']()});}else if(_0x53f33b[_0x07d7('0x37')]===_0x07d7('0x41')&&_0x53f33b[_0x07d7('0x42')]&&_0x53f33b['Variable'][_0x07d7('0x10')]&&_0x53f33b[_0x07d7('0x3d')]&&_0x53f33b[_0x07d7('0x39')]){_0x5eaaca[_0x53f33b['Variable'][_0x07d7('0x10')]['toLowerCase']()]&&_0x5ea7bd['custom_fields'][_0x07d7('0x43')]({'id':_0x53f33b[_0x07d7('0x3d')],'value':_0x5eaaca[_0x53f33b[_0x07d7('0x42')][_0x07d7('0x10')][_0x07d7('0x3a')]()]['toString']()});}});}return _0x5ea7bd;}exports[_0x07d7('0x44')]=function(_0x6386d9,_0x11eaf4,_0x4f7cd4,_0x2edd68,_0x5d527e,_0x3a0fe4){var _0x44e755,_0x55e874;_0x3a0fe4[_0x07d7('0xd')]=intUtil['stripTrailingSlash'](_0x3a0fe4[_0x07d7('0xd')]);_0x3a0fe4[_0x07d7('0x45')]=intUtil[_0x07d7('0x46')](_0x3a0fe4['serverUrl']);if(_0x5d527e&&_0x5d527e['monitor_format']){logger[_0x07d7('0xa')](_0x07d7('0x47'),'Recording\x20is\x20enabled!');_0x11eaf4['recordingURL']=util[_0x07d7('0x20')](_0x07d7('0x48'),_0x3a0fe4[_0x07d7('0x45')],_0x11eaf4[_0x07d7('0x49')],md5(_0x11eaf4[_0x07d7('0x49')]));}else{_0x11eaf4[_0x07d7('0x4a')]='';}headers['Authorization']=getAuth(_0x3a0fe4);return getUser(_0x3a0fe4,_0x2edd68[_0x07d7('0x4b')])[_0x07d7('0x15')](function(_0x373ed9){_0x44e755=_0x373ed9;logger[_0x07d7('0xa')]('The\x20User\x20ID\x20is:',_0x44e755['id']);return getEndUser(_0x3a0fe4,_0x11eaf4[_0x07d7('0x4c')],_0x11eaf4['calleridnum']);})[_0x07d7('0x15')](function(_0x1fc6f0){_0x55e874=_0x1fc6f0;logger[_0x07d7('0xa')](_0x07d7('0x4d'),_0x55e874['id']);return getTicket(_0x3a0fe4,_0x44e755,_0x55e874,_0x4f7cd4,_0x11eaf4);})['then'](function(_0x4f1538){if(_0x4f1538){logger[_0x07d7('0xa')]('The\x20Ticket\x20ID\x20is:',_0x4f1538['id']);switch(_0x3a0fe4[_0x07d7('0x37')]){case'integrationTab':logger[_0x07d7('0xa')]('[QUEUE]',_0x07d7('0x4e'));return request({'uri':util[_0x07d7('0x20')](_0x07d7('0x4f'),_0x3a0fe4['remoteUri'],_0x44e755['id'],_0x4f1538['id']),'method':_0x07d7('0xe')});case _0x07d7('0x50'):logger[_0x07d7('0xa')](_0x07d7('0x47'),_0x07d7('0x51'));emit(util['format']('user:%s',_0x2edd68[_0x07d7('0x10')]),_0x07d7('0x52'),{'uri':util[_0x07d7('0x20')](_0x07d7('0x53'),_0x3a0fe4[_0x07d7('0xd')][_0x07d7('0x54')](_0x07d7('0x55'),''),_0x4f1538['id'])});break;default:logger[_0x07d7('0x56')](_0x07d7('0x47'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x45d004){logger[_0x07d7('0x56')](_0x07d7('0x57'),util[_0x07d7('0x58')](_0x45d004,{'showHidden':!![],'depth':null}));});};exports[_0x07d7('0x59')]=function(_0x4ee13b,_0x27498d,_0x12a4c4,_0x3e47b1,_0x1b860b,_0x73d965,_0x4e8fe9){var _0x2a181d,_0x372879;_0x73d965['remoteUri']=intUtil['stripTrailingSlash'](_0x73d965['remoteUri']);_0x73d965[_0x07d7('0x45')]=intUtil[_0x07d7('0x46')](_0x73d965[_0x07d7('0x45')]);if(_0x4e8fe9&&_0x4e8fe9[_0x07d7('0x5a')]&&_0x4e8fe9[_0x07d7('0x5a')]!==_0x07d7('0x5b')){logger[_0x07d7('0xa')](_0x07d7('0x5c'),'Recording\x20is\x20enabled!');_0x27498d[_0x07d7('0x4a')]=util['format'](_0x07d7('0x48'),_0x73d965[_0x07d7('0x45')],_0x27498d[_0x07d7('0x49')],md5(_0x27498d[_0x07d7('0x49')]));}headers[_0x07d7('0x5d')]=getAuth(_0x73d965);return getUser(_0x73d965,_0x3e47b1[_0x07d7('0x4b')])[_0x07d7('0x15')](function(_0x55537a){_0x2a181d=_0x55537a;logger[_0x07d7('0xa')](_0x07d7('0x5e'),_0x2a181d['id']);return getEndUser(_0x73d965,_0x27498d[_0x07d7('0x5f')],_0x27498d[_0x07d7('0x60')]);})['then'](function(_0x4e02f7){_0x372879=_0x4e02f7;logger['info'](_0x07d7('0x4d'),_0x372879['id']);return getTicket(_0x73d965,_0x2a181d,_0x372879,_0x12a4c4,_0x27498d);})['then'](function(_0x2d753e){if(_0x2d753e){logger[_0x07d7('0xa')](_0x07d7('0x61'),_0x2d753e['id']);switch(_0x73d965[_0x07d7('0x37')]){case'integrationTab':logger[_0x07d7('0xa')]('[OUTBOUND]',_0x07d7('0x4e'));return request({'uri':util[_0x07d7('0x20')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x73d965[_0x07d7('0xd')],_0x2a181d['id'],_0x2d753e['id']),'method':_0x07d7('0xe')});case'newTab':logger[_0x07d7('0xa')](_0x07d7('0x5c'),_0x07d7('0x51'));emit(util[_0x07d7('0x20')]('user:%s',_0x3e47b1[_0x07d7('0x10')]),_0x07d7('0x52'),{'uri':util['format'](_0x07d7('0x53'),_0x73d965[_0x07d7('0xd')]['replace'](_0x07d7('0x55'),''),_0x2d753e['id'])});break;default:logger[_0x07d7('0x56')](_0x07d7('0x5c'),_0x07d7('0x62'));}}})[_0x07d7('0x63')](function(_0xe6a04e){logger[_0x07d7('0x56')](_0x07d7('0x64'),util['inspect'](_0xe6a04e,{'showHidden':!![],'depth':null}));});};exports[_0x07d7('0x65')]=function(_0x31c159,_0x3db224,_0x20b3b1,_0x50290c,_0x4c97e4,_0x56f27f){var _0x22d718,_0x4be65c;_0x56f27f[_0x07d7('0xd')]=intUtil[_0x07d7('0x46')](_0x56f27f['remoteUri']);_0x56f27f['serverUrl']=intUtil[_0x07d7('0x46')](_0x56f27f['serverUrl']);if(_0x4c97e4&&_0x4c97e4[_0x07d7('0x66')]){logger[_0x07d7('0xa')]('['+_0x3db224[_0x07d7('0x67')][_0x07d7('0x68')]()+']',_0x07d7('0x69'));_0x3db224[_0x07d7('0x4a')]=util[_0x07d7('0x20')](_0x07d7('0x48'),_0x56f27f[_0x07d7('0x45')],_0x3db224[_0x07d7('0x49')],md5(_0x3db224[_0x07d7('0x49')]));}else{_0x3db224[_0x07d7('0x4a')]='';}headers[_0x07d7('0x5d')]=getAuth(_0x56f27f);return getUser(_0x56f27f)[_0x07d7('0x15')](function(_0x4b0079){_0x22d718=_0x4b0079;logger[_0x07d7('0xa')](_0x07d7('0x5e'),_0x22d718['id']);return getEndUser(_0x56f27f,_0x3db224[_0x07d7('0x4c')],_0x3db224[_0x07d7('0x6a')]);})[_0x07d7('0x15')](function(_0x3a7d89){_0x4be65c=_0x3a7d89;logger['info'](_0x07d7('0x4d'),_0x4be65c['id']);return getTicket(_0x56f27f,_0x22d718,_0x4be65c,_0x20b3b1,_0x3db224);})[_0x07d7('0x15')](function(_0x587e9a){if(_0x587e9a){logger[_0x07d7('0xa')](_0x07d7('0x61'),_0x587e9a['id']);}})[_0x07d7('0x63')](function(_0x58bad8){logger[_0x07d7('0x56')]('['+_0x3db224[_0x07d7('0x67')][_0x07d7('0x68')]()+']'+_0x07d7('0x6b'),util[_0x07d7('0x58')](_0x58bad8,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e57=['user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridnum','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','includes','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','refresh_token','then','catch','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','contact','Contacts','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x29ac6b,_0x184514){var _0x44a29b=function(_0x2dad03){while(--_0x2dad03){_0x29ac6b['push'](_0x29ac6b['shift']());}};_0x44a29b(++_0x184514);}(_0x3e57,0x1d1));var _0x73e5=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x3e57[_0x4d674b];return _0x535a1f;};'use strict';var _=require(_0x73e5('0x0'));var rp=require(_0x73e5('0x1'));var md5=require('md5');var util=require(_0x73e5('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x73e5('0x3'));var BPromise=require(_0x73e5('0x4'));var config=require(_0x73e5('0x5'));var logger=require('../../../../config/logger')(_0x73e5('0x6'));config[_0x73e5('0x7')]=_[_0x73e5('0x8')](config[_0x73e5('0x7')],{'host':_0x73e5('0x9'),'port':0x18eb});var io=require(_0x73e5('0xa'))(new Redis(config[_0x73e5('0x7')]));function emit(_0x2df2d0,_0x27afbe,_0x1c8e4c){io['to'](_0x2df2d0)['emit'](_0x27afbe,_0x1c8e4c);}function request(_0x2ce858){logger['debug'](_0x73e5('0xb'),JSON['stringify'](_0x2ce858));return rp(_0x2ce858);}function getCustomFields(_0x40a69d,_0x58389a){var _0x164117={};if(_0x40a69d['length']>0x0){_['forEach'](_0x40a69d,function(_0x52c383){if(_[_0x73e5('0xc')](['string','picklist'],_0x52c383['type'])&&_0x52c383['idField']){_0x164117[_0x52c383[_0x73e5('0xd')]]=_0x52c383[_0x73e5('0xe')][_0x73e5('0xf')]();}else if(_0x52c383[_0x73e5('0x10')]==='variable'&&_0x52c383[_0x73e5('0x11')]&&_0x52c383[_0x73e5('0xd')]&&_0x58389a[_0x52c383['variableName']]){_0x164117[_0x52c383[_0x73e5('0xd')]]=_0x58389a[_0x52c383['variableName']][_0x73e5('0xf')]();}else if(_0x52c383[_0x73e5('0x10')]===_0x73e5('0x12')&&_0x52c383[_0x73e5('0x13')]&&_0x52c383[_0x73e5('0x13')]['name']&&_0x52c383['idField']&&_0x58389a[_0x52c383[_0x73e5('0x13')][_0x73e5('0x14')][_0x73e5('0x15')]()]){_0x164117[_0x52c383[_0x73e5('0xd')]]=_0x58389a[_0x52c383[_0x73e5('0x13')][_0x73e5('0x14')][_0x73e5('0x15')]()][_0x73e5('0xf')]();}});}return _0x164117;}function getName(_0x232d39){if(_0x232d39[_0x73e5('0x16')]('\x20')>0x0){var _0x4db8e3=_0x232d39[_0x73e5('0x17')](/ (.+)/);if(_0x4db8e3[0x1]){return _0x4db8e3;}}return[_0x232d39,_0x232d39];}var accountsTokens={};function getAccessToken(_0x26ee4e){return new Promise(function(_0x82dd87,_0x25a436){if(!_[_0x73e5('0x18')](accountsTokens[_0x26ee4e['id']])&&!_[_0x73e5('0x18')](accountsTokens[_0x26ee4e['id']][_0x73e5('0x19')])){if(moment()[_0x73e5('0x1a')](accountsTokens[_0x26ee4e['id']][_0x73e5('0x1b')])){_0x82dd87(accountsTokens[_0x26ee4e['id']][_0x73e5('0x19')]);}}var _0x94459;switch(_0x26ee4e[_0x73e5('0x1c')]){case'US':_0x94459=_0x73e5('0x1d');break;case'AU':_0x94459=_0x73e5('0x1e');break;case'EU':_0x94459=_0x73e5('0x1f');break;case'IN':_0x94459=_0x73e5('0x20');break;case'CN':_0x94459=_0x73e5('0x21');break;default:_0x94459=_0x73e5('0x1f');break;}var _0x168826={'method':_0x73e5('0x22'),'uri':_0x94459+'/oauth/v2/token','qs':{'refresh_token':_0x26ee4e['refreshToken'],'client_id':_0x26ee4e[_0x73e5('0x23')],'client_secret':_0x26ee4e['clientSecret'],'grant_type':_0x73e5('0x24')},'json':!![]};return rp(_0x168826)[_0x73e5('0x25')](function(_0x111ba2){accountsTokens[_0x26ee4e['id']]={'access_token':_0x111ba2['access_token'],'expires_in':moment()['add'](_0x111ba2['expires_in'],'seconds')};_0x82dd87(_0x111ba2[_0x73e5('0x19')]);})[_0x73e5('0x26')](function(_0x4fe2d4){logger['error'](_0x73e5('0x27'),_0x4fe2d4['stack']);_0x25a436(_0x4fe2d4);});});}function getUser(_0x1a3236,_0x36a107,_0x4f85a5,_0x48f103){logger[_0x73e5('0x28')](_0x73e5('0x29'));return request({'method':_0x73e5('0x2a'),'uri':util[_0x73e5('0x2b')]('https://www.zohoapis.%s/crm/v2/users',_0x36a107),'qs':{'type':_0x73e5('0x2c')},'headers':{'Authorization':_0x73e5('0x2d')+_0x1a3236},'json':!![]})['then'](function(_0x3444bd){if(_0x3444bd[_0x73e5('0x2e')]){var _0x100841=-0x1;if(_[_0x73e5('0x2f')](_0x3444bd[_0x73e5('0x2e')])){if(!_[_0x73e5('0x18')](_0x48f103)){_0x100841=_[_0x73e5('0x30')](_0x3444bd[_0x73e5('0x2e')],function(_0x2bd0c8){return _0x2bd0c8[_0x73e5('0x31')]===_0x48f103;});}if(_0x100841>=0x0){logger[_0x73e5('0x28')](_0x73e5('0x32'));}else{logger[_0x73e5('0x28')]('Using\x20the\x20admin\x20account!');_0x100841=_[_0x73e5('0x30')](_0x3444bd['users'],function(_0x48b42c){return _0x48b42c[_0x73e5('0x33')][_0x73e5('0x14')]===_0x73e5('0x34');});}return _0x3444bd[_0x73e5('0x2e')][_0x100841];}else{if(_0x3444bd[_0x73e5('0x35')]['profile'][_0x73e5('0x14')]===_0x73e5('0x34')){logger['info'](_0x73e5('0x36'));user=_0x3444bd[_0x73e5('0x35')];return user;}else{logger[_0x73e5('0x37')](_0x73e5('0x38'),JSON[_0x73e5('0x39')](_0x3444bd));throw new Error(_0x73e5('0x3a')+JSON[_0x73e5('0x39')](_0x3444bd));}}}else{logger[_0x73e5('0x37')](_0x73e5('0x38'),JSON['stringify'](_0x3444bd));throw new Error(_0x73e5('0x3a')+JSON[_0x73e5('0x39')](_0x3444bd));}})[_0x73e5('0x26')](function(_0x1716f9){console[_0x73e5('0x37')](_0x1716f9);});}function getZohoUser(_0x2e2d54,_0x520764){return new BPromise(function(_0x4fae42,_0x2b2577){request(_0x2e2d54)[_0x73e5('0x25')](function(_0x4f944){var _0x3ea41a=null;if(_0x4f944){_0x3ea41a=_0x4f944[_0x73e5('0x3b')][0x0];_0x3ea41a[_0x73e5('0x3c')]=_0x520764;}_0x4fae42(_0x3ea41a);})[_0x73e5('0x26')](function(_0x49fdd4){_0x2b2577(_0x49fdd4);});});}function createEndUser(_0x3da30a,_0x3f4981,_0x1eaf53,_0x76990f,_0x58c409,_0xc6a1){var _0x1eaf53=getName(_0x1eaf53);return request({'method':_0x73e5('0x22'),'uri':'https://www.zohoapis.'+_0x3f4981+_0x73e5('0x3d')+_[_0x73e5('0x3e')](_0xc6a1[_0x73e5('0x3f')])+'s','body':{'data':[{'Last_Name':_0x1eaf53[0x1],'First_Name':_0x1eaf53[0x0],'Phone':_0x76990f,'Owner':{'name':!_[_0x73e5('0x18')](_0x58c409['role'][_0x73e5('0x14')])?_0x58c409[_0x73e5('0x40')][_0x73e5('0x14')]:!_['isNil'](_0x58c409[_0x73e5('0x41')])?_0x58c409[_0x73e5('0x41')]+'\x20'+_0x58c409[_0x73e5('0x42')]:_0x58c409[_0x73e5('0x42')],'id':_0x58c409['id']}}]},'headers':{'Authorization':_0x73e5('0x2d')+_0x3da30a},'json':!![]})[_0x73e5('0x25')](function(_0xed6bc9){if(_0xed6bc9&&_0xed6bc9[_0x73e5('0x3b')][0x0][_0x73e5('0x43')]===_0x73e5('0x44')){var _0x14a876=_0xed6bc9[_0x73e5('0x3b')][0x0][_0x73e5('0x45')];_0x14a876[_0x73e5('0x3c')]=_[_0x73e5('0x3e')](_0xc6a1[_0x73e5('0x3f')])+'s';return _0x14a876;}logger[_0x73e5('0x37')](_0x73e5('0x38'),JSON[_0x73e5('0x39')](data));throw new Error('Error:\x20'+JSON[_0x73e5('0x39')](data));})[_0x73e5('0x26')](function(_0x5a9a61){console[_0x73e5('0x46')](_0x73e5('0x47'),_0x5a9a61);});}function getEndUser(_0x85dd2c,_0x1e33ad,_0x3cd453,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7){var _0x499aab={'method':_0x73e5('0x2a'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x85dd2c},'json':!![]};switch(_0xb21ca7['moduleSearch']){case _0x73e5('0x48'):_0x499aab[_0x73e5('0x49')]=_0x73e5('0x4a')+_0x1e33ad+_0x73e5('0x4b')+_0xb5b2b7+'))';return getZohoUser(_0x499aab,'Contacts')[_0x73e5('0x25')](function(_0x28fc26){if(_0x28fc26)return _0x28fc26;_0x499aab[_0x73e5('0x49')]=_0x73e5('0x4a')+_0x1e33ad+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xb5b2b7+'))';return getZohoUser(_0x499aab,'Leads')[_0x73e5('0x25')](function(_0xa480ba){if(_0xa480ba)return _0xa480ba;if(_0xb21ca7[_0x73e5('0x3f')]!=_0x73e5('0x4c')){return createEndUser(_0x85dd2c,_0x1e33ad,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7);}else{return{};}});});break;case _0x73e5('0x4d'):_0x499aab['uri']='https://www.zohoapis.'+_0x1e33ad+_0x73e5('0x4b')+_0xb5b2b7+'))';return getZohoUser(_0x499aab,_0x73e5('0x4e'))[_0x73e5('0x25')](function(_0x531d95){if(_0x531d95)return _0x531d95;if(_0xb21ca7[_0x73e5('0x3f')]!=_0x73e5('0x4c')){return createEndUser(_0x85dd2c,_0x1e33ad,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7);}else{return{};}});break;case _0x73e5('0x4f'):_0x499aab['uri']=_0x73e5('0x4a')+_0x1e33ad+_0x73e5('0x50')+_0xb5b2b7+'))';return getZohoUser(_0x499aab,_0x73e5('0x51'))['then'](function(_0x6e71f2){if(_0x6e71f2)return _0x6e71f2;if(_0xb21ca7['moduleCreate']!='nothing'){return createEndUser(_0x85dd2c,_0x1e33ad,_0x24e664,_0xb5b2b7,_0x3bf420,_0xb21ca7);}else{return{};}});break;}}function getCall(_0x323ab7,_0x3c3599,_0x1cbdc0,_0x39dde9,_0xae8aad,_0x2c06ca,_0x1e0069,_0x159c5e){logger[_0x73e5('0x28')]('Creating\x20new\x20call...');var _0x1a549e={};_0x1a549e[_0x73e5('0x52')]={'name':!_['isNil'](_0x39dde9[_0x73e5('0x40')][_0x73e5('0x14')])&&!_[_0x73e5('0x18')](_0x39dde9[_0x73e5('0x33')]['name'])&&_0x39dde9[_0x73e5('0x33')]['name']===_0x73e5('0x53')?_0x39dde9[_0x73e5('0x40')][_0x73e5('0x14')]:!_[_0x73e5('0x18')](_0x39dde9[_0x73e5('0x41')])?_0x39dde9[_0x73e5('0x41')]+'\x20'+_0x39dde9[_0x73e5('0x42')]:_0x39dde9[_0x73e5('0x42')],'id':_0x39dde9['id']};_0x1a549e[_0x73e5('0x54')]=intUtil[_0x73e5('0x55')](_0x2c06ca[_0x73e5('0x56')],_0x1e0069,'\x20');_0x1a549e[_0x73e5('0x57')]=intUtil[_0x73e5('0x55')](_0x2c06ca[_0x73e5('0x58')],_0x1e0069,'\x0a');if(_0xae8aad[_0x73e5('0x3c')]===_0x73e5('0x4e')){_0x1a549e['Who_Id']={'name':!_[_0x73e5('0x18')](_0xae8aad['Full_Name'])?_0xae8aad[_0x73e5('0x59')]:!_[_0x73e5('0x18')](_0xae8aad[_0x73e5('0x5a')])?_0xae8aad[_0x73e5('0x5a')]+'\x20'+_0xae8aad[_0x73e5('0x5b')]:_0xae8aad[_0x73e5('0x5b')],'id':_0xae8aad['id']};}if(_0xae8aad[_0x73e5('0x3c')]===_0x73e5('0x51')){_0x1a549e[_0x73e5('0x5c')]={'name':!_[_0x73e5('0x18')](_0xae8aad[_0x73e5('0x59')])?_0xae8aad[_0x73e5('0x59')]:!_[_0x73e5('0x18')](_0xae8aad[_0x73e5('0x5a')])?_0xae8aad[_0x73e5('0x5a')]+'\x20'+_0xae8aad['Last_Name']:_0xae8aad['Last_Name'],'id':_0xae8aad['id']};_0x1a549e[_0x73e5('0x5d')]=_[_0x73e5('0x3e')](_0xae8aad[_0x73e5('0x3c')]);}if(_0x1e0069['talktime']){_0x1a549e['Call_Duration']=moment[_0x73e5('0x5e')](parseInt(_0x1e0069['talktime'])*0x3e8)[_0x73e5('0x2b')](_0x73e5('0x5f'));}else if(_0x1e0069[_0x73e5('0x60')]&&_0x1e0069[_0x73e5('0x61')]){_0x1a549e['Call_Duration']=moment[_0x73e5('0x5e')](moment(_0x1e0069[_0x73e5('0x61')],_0x73e5('0x62'))['diff'](moment(_0x1e0069['starttime'],_0x73e5('0x62'))))[_0x73e5('0x2b')]('mm:ss');}switch(_0x1e0069[_0x73e5('0x63')]){case _0x73e5('0x64'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x66');break;case _0x73e5('0x67'):case _0x73e5('0x68'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x69');break;case _0x73e5('0x6a'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x6b');break;case _0x73e5('0x6c'):_0x1a549e['Call_Result']=_0x73e5('0x6d');break;case _0x73e5('0x6e'):_0x1a549e[_0x73e5('0x65')]=_0x73e5('0x6f');default:}_0x1a549e['Call_Start_Time']=(_0x159c5e===_0x73e5('0x70')?moment(_0x1e0069[_0x73e5('0x71')])[_0x73e5('0x2b')](_0x73e5('0x62')):moment(_0x1e0069[_0x73e5('0x72')])[_0x73e5('0x2b')](_0x73e5('0x62')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x1a549e[_0x73e5('0x73')]=_0x159c5e||_0x73e5('0x74');_0x1a549e=_[_0x73e5('0x75')](_0x1a549e,getCustomFields(_0x2c06ca[_0x73e5('0x76')],_0x1e0069));return request({'method':_0x73e5('0x22'),'uri':'https://www.zohoapis.'+_0x3c3599+_0x73e5('0x77'),'headers':{'Authorization':_0x73e5('0x2d')+_0x323ab7},'body':{'data':[_0x1a549e]},'json':!![]})[_0x73e5('0x25')](function(_0x21da78){if(_0x21da78&&_0x21da78[_0x73e5('0x3b')][0x0]['code']===_0x73e5('0x44')){logger['info'](_0x73e5('0x78'));return{'id':_0x21da78[_0x73e5('0x3b')][0x0][_0x73e5('0x45')]['id']};}})[_0x73e5('0x26')](function(_0xb4fe02){logger[_0x73e5('0x28')](_0x73e5('0x79'),_0xb4fe02[_0x73e5('0x7a')]);console[_0x73e5('0x46')](_0x73e5('0x79'),_0xb4fe02);});}exports[_0x73e5('0x7b')]=function(_0x59ab91,_0x21590e,_0x3b140a,_0x1463dd,_0x4951b7,_0x57d4e0){var _0x85eaae,_0x381c35,_0x1370fa;_0x57d4e0['host']=intUtil['stripTrailingSlash'](_0x57d4e0[_0x73e5('0x7c')]);_0x57d4e0[_0x73e5('0x7d')]=intUtil[_0x73e5('0x7e')](_0x57d4e0[_0x73e5('0x7d')]);if(_0x4951b7&&_0x4951b7[_0x73e5('0x7f')]){logger[_0x73e5('0x28')](_0x73e5('0x80'),_0x73e5('0x81'));_0x21590e[_0x73e5('0x82')]=_0x57d4e0['serverUrl']+'/api/voice/recordings/'+_0x21590e['uniqueid']+_0x73e5('0x83')+md5(_0x21590e[_0x73e5('0x84')]);}else{_0x21590e['recordingURL']='';}var _0x45be0d=_0x57d4e0[_0x73e5('0x7c')]===_0x73e5('0x85')?'eu':_0x73e5('0x86');return getAccessToken(_0x57d4e0)['then'](function(_0xdd6a9e){_0x1370fa=_0xdd6a9e;return getUser(_0x1370fa,_0x45be0d,_0x57d4e0,_0x1463dd[_0x73e5('0x31')]);})[_0x73e5('0x25')](function(_0x338dab){_0x85eaae=_0x338dab;logger[_0x73e5('0x28')]('The\x20User\x20ID\x20is:',_0x85eaae['id']);return getEndUser(_0x1370fa,_0x45be0d,_0x57d4e0,_0x21590e[_0x73e5('0x87')],_0x21590e[_0x73e5('0x88')],_0x85eaae,_0x3b140a);})[_0x73e5('0x25')](function(_0x1f97d3){_0x381c35=_0x1f97d3;return getCall(_0x1370fa,_0x45be0d,_0x57d4e0,_0x85eaae,_0x381c35,_0x3b140a,_0x21590e,'Inbound');})[_0x73e5('0x25')](function(_0xfe38c7){if(_0xfe38c7){logger['info'](_0x73e5('0x89'),_0xfe38c7['id']);logger[_0x73e5('0x28')](_0x73e5('0x80'),_0x73e5('0x8a'));emit(util[_0x73e5('0x2b')](_0x73e5('0x8b'),_0x1463dd[_0x73e5('0x14')]),_0x73e5('0x8c'),{'uri':_0x73e5('0x8d')+_0x57d4e0['host']+'/crm/EntityInfo.do?module=Calls&id='+_0xfe38c7['id']});}})['catch'](function(_0xedd9c1){logger[_0x73e5('0x37')](_0x73e5('0x80'),JSON[_0x73e5('0x39')](_0xedd9c1));});};exports[_0x73e5('0x70')]=function(_0xb4d989,_0x2c9bb9,_0x20b6b0,_0x566a27,_0x559c16,_0x17231e,_0x4eddb1){var _0x54827b,_0xf7e10a,_0x164fbd;_0x17231e['host']=intUtil['stripTrailingSlash'](_0x17231e['host']);_0x17231e['serverUrl']=intUtil[_0x73e5('0x7e')](_0x17231e['serverUrl']);if(_0x4eddb1&&_0x4eddb1[_0x73e5('0x8e')]&&_0x4eddb1[_0x73e5('0x8e')]!==_0x73e5('0x8f')){logger[_0x73e5('0x28')](_0x73e5('0x90'),'Recording\x20is\x20enabled!');_0x2c9bb9[_0x73e5('0x82')]=_0x17231e[_0x73e5('0x7d')]+_0x73e5('0x91')+_0x2c9bb9['uniqueid']+_0x73e5('0x83')+md5(_0x2c9bb9[_0x73e5('0x84')]);}var _0x131fe6=_0x17231e[_0x73e5('0x7c')]===_0x73e5('0x85')?'eu':_0x73e5('0x86');return getAccessToken(_0x17231e)[_0x73e5('0x25')](function(_0x11e31d){_0x164fbd=_0x11e31d;return getUser(_0x164fbd,_0x131fe6,_0x17231e,_0x566a27[_0x73e5('0x31')]);})[_0x73e5('0x25')](function(_0x10924a){_0x54827b=_0x10924a;logger[_0x73e5('0x28')](_0x73e5('0x92'),_0x54827b['id']);return getEndUser(_0x164fbd,_0x131fe6,_0x17231e,_0x2c9bb9['destcalleridname'],_0x2c9bb9[_0x73e5('0x93')],_0x54827b,_0x20b6b0);})[_0x73e5('0x25')](function(_0x1baaaa){_0xf7e10a=_0x1baaaa;return getCall(_0x164fbd,_0x131fe6,_0x17231e,_0x54827b,_0xf7e10a,_0x20b6b0,_0x2c9bb9,'Outbound');})[_0x73e5('0x25')](function(_0x2d0317){if(_0x2d0317){logger[_0x73e5('0x28')](_0x73e5('0x89'),_0x2d0317['id']);logger['info'](_0x73e5('0x90'),_0x73e5('0x8a'));emit(util[_0x73e5('0x2b')](_0x73e5('0x8b'),_0x566a27[_0x73e5('0x14')]),_0x73e5('0x8c'),{'uri':_0x73e5('0x8d')+_0x17231e[_0x73e5('0x7c')]+_0x73e5('0x94')+_0x2d0317['id']});}})[_0x73e5('0x26')](function(_0x5a4ce9){logger[_0x73e5('0x37')](_0x73e5('0x90'),JSON[_0x73e5('0x39')](_0x5a4ce9));});};exports[_0x73e5('0x95')]=function(_0x1fc1af,_0x97e4dc,_0x1b1b4d,_0x5db1db,_0x465fc1,_0x16a046){var _0xd8b345,_0x1e527e,_0x1f9780;_0x16a046[_0x73e5('0x7c')]=intUtil[_0x73e5('0x7e')](_0x16a046[_0x73e5('0x7c')]);_0x16a046[_0x73e5('0x7d')]=intUtil[_0x73e5('0x7e')](_0x16a046[_0x73e5('0x7d')]);if(_0x465fc1&&_0x465fc1[_0x73e5('0x7f')]){logger[_0x73e5('0x28')]('['+_0x97e4dc['lastevent'][_0x73e5('0x96')]()+']','Recording\x20is\x20enabled!');_0x97e4dc['recordingURL']=_0x16a046[_0x73e5('0x7d')]+_0x73e5('0x91')+_0x97e4dc[_0x73e5('0x84')]+_0x73e5('0x83')+md5(_0x97e4dc[_0x73e5('0x84')]);}else{_0x97e4dc['recordingURL']='';}var _0x3d3836=_0x16a046[_0x73e5('0x7c')]===_0x73e5('0x85')?'eu':'com';return getAccessToken(_0x16a046)['then'](function(_0x37beb7){_0x1f9780=_0x37beb7;return getUser(_0x1f9780,_0x3d3836,_0x16a046);})[_0x73e5('0x25')](function(_0x4ec497){_0xd8b345=_0x4ec497;logger[_0x73e5('0x28')](_0x73e5('0x92'),_0xd8b345['id']);return getEndUser(_0x1f9780,_0x3d3836,_0x16a046,_0x97e4dc[_0x73e5('0x87')],_0x97e4dc['calleridnum'],_0xd8b345,_0x1b1b4d);})[_0x73e5('0x25')](function(_0x190cc2){_0x1e527e=_0x190cc2;return getCall(_0x1f9780,_0x3d3836,_0x16a046,_0xd8b345,_0x1e527e,_0x1b1b4d,_0x97e4dc,_0x73e5('0x74'));})[_0x73e5('0x25')](function(_0x59395c){if(_0x59395c){logger[_0x73e5('0x28')]('The\x20Call\x20ID\x20is:',_0x59395c['id']);}})['catch'](function(_0x37eac3){logger[_0x73e5('0x37')]('['+_0x97e4dc['lastevent'][_0x73e5('0x96')]()+']',JSON['stringify'](_0x37eac3));});};
\ No newline at end of file
+var _0xa31e=['content','toString','variable','variableName','customVariable','Variable','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','name','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','/crm/v2/','moduleCreate','role','first_name','last_name','data','code','details','enduserType','startCase','log','CREATE\x20ERROR','uri','https://www.zohoapis.','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Subject','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','complete','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','email','The\x20User\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','zoho.eu','com','destcalleridname','destcalleridnum','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','calleridname','calleridnum','toUpperCase','lodash','request-promise','md5','util','./util','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','stringify','length','forEach','string','picklist','type','idField'];(function(_0x1ba870,_0x495ed7){var _0x20ea35=function(_0x5924e4){while(--_0x5924e4){_0x1ba870['push'](_0x1ba870['shift']());}};_0x20ea35(++_0x495ed7);}(_0xa31e,0x11f));var _0xea31=function(_0x527ce8,_0x122695){_0x527ce8=_0x527ce8-0x0;var _0x2a8a56=_0xa31e[_0x527ce8];return _0x2a8a56;};'use strict';var _=require(_0xea31('0x0'));var rp=require(_0xea31('0x1'));var md5=require(_0xea31('0x2'));var util=require(_0xea31('0x3'));var intUtil=require(_0xea31('0x4'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xea31('0x5'));var config=require(_0xea31('0x6'));var logger=require('../../../../config/logger')(_0xea31('0x7'));config[_0xea31('0x8')]=_[_0xea31('0x9')](config[_0xea31('0x8')],{'host':_0xea31('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea31('0x8')]));function emit(_0x6c449b,_0x359012,_0x373fc2){io['to'](_0x6c449b)[_0xea31('0xb')](_0x359012,_0x373fc2);}function request(_0x470b8b){logger['debug']('[HTTP]',JSON[_0xea31('0xc')](_0x470b8b));return rp(_0x470b8b);}function getCustomFields(_0x263ab1,_0xc5b5ac){var _0x2ba552={};if(_0x263ab1[_0xea31('0xd')]>0x0){_[_0xea31('0xe')](_0x263ab1,function(_0x3a3a53){if(_['includes']([_0xea31('0xf'),_0xea31('0x10')],_0x3a3a53[_0xea31('0x11')])&&_0x3a3a53[_0xea31('0x12')]){_0x2ba552[_0x3a3a53['idField']]=_0x3a3a53[_0xea31('0x13')][_0xea31('0x14')]();}else if(_0x3a3a53[_0xea31('0x11')]===_0xea31('0x15')&&_0x3a3a53[_0xea31('0x16')]&&_0x3a3a53['idField']&&_0xc5b5ac[_0x3a3a53[_0xea31('0x16')]]){_0x2ba552[_0x3a3a53[_0xea31('0x12')]]=_0xc5b5ac[_0x3a3a53[_0xea31('0x16')]][_0xea31('0x14')]();}else if(_0x3a3a53[_0xea31('0x11')]===_0xea31('0x17')&&_0x3a3a53[_0xea31('0x18')]&&_0x3a3a53['Variable']['name']&&_0x3a3a53[_0xea31('0x12')]&&_0xc5b5ac[_0x3a3a53[_0xea31('0x18')]['name']['toLowerCase']()]){_0x2ba552[_0x3a3a53[_0xea31('0x12')]]=_0xc5b5ac[_0x3a3a53[_0xea31('0x18')]['name'][_0xea31('0x19')]()]['toString']();}});}return _0x2ba552;}function getName(_0x216553){if(_0x216553[_0xea31('0x1a')]('\x20')>0x0){var _0x5475fd=_0x216553[_0xea31('0x1b')](/ (.+)/);if(_0x5475fd[0x1]){return _0x5475fd;}}return[_0x216553,_0x216553];}var accountsTokens={};function getAccessToken(_0x4dbadb){return new Promise(function(_0x2376f1,_0x259087){if(!_['isNil'](accountsTokens[_0x4dbadb['id']])&&!_[_0xea31('0x1c')](accountsTokens[_0x4dbadb['id']][_0xea31('0x1d')])){if(moment()[_0xea31('0x1e')](accountsTokens[_0x4dbadb['id']][_0xea31('0x1f')])){_0x2376f1(accountsTokens[_0x4dbadb['id']][_0xea31('0x1d')]);}}var _0x56b6fc;switch(_0x4dbadb[_0xea31('0x20')]){case'US':_0x56b6fc=_0xea31('0x21');break;case'AU':_0x56b6fc=_0xea31('0x22');break;case'EU':_0x56b6fc=_0xea31('0x23');break;case'IN':_0x56b6fc='https://accounts.zoho.in';break;case'CN':_0x56b6fc=_0xea31('0x24');break;default:_0x56b6fc=_0xea31('0x23');break;}var _0x1e2b08={'method':_0xea31('0x25'),'uri':_0x56b6fc+'/oauth/v2/token','qs':{'refresh_token':_0x4dbadb[_0xea31('0x26')],'client_id':_0x4dbadb['clientId'],'client_secret':_0x4dbadb['clientSecret'],'grant_type':_0xea31('0x27')},'json':!![]};return rp(_0x1e2b08)[_0xea31('0x28')](function(_0x113a3b){accountsTokens[_0x4dbadb['id']]={'access_token':_0x113a3b[_0xea31('0x1d')],'expires_in':moment()[_0xea31('0x29')](_0x113a3b[_0xea31('0x1f')],_0xea31('0x2a'))};_0x2376f1(_0x113a3b[_0xea31('0x1d')]);})[_0xea31('0x2b')](function(_0x12351c){logger[_0xea31('0x2c')](_0xea31('0x2d'),_0x12351c[_0xea31('0x2e')]);_0x259087(_0x12351c);});});}function getUser(_0x3700ad,_0x172534,_0x29d426,_0x56fefd){logger[_0xea31('0x2f')](_0xea31('0x30'));return request({'method':_0xea31('0x31'),'uri':util[_0xea31('0x32')](_0xea31('0x33'),_0x172534),'qs':{'type':_0xea31('0x34')},'headers':{'Authorization':_0xea31('0x35')+_0x3700ad},'json':!![]})[_0xea31('0x28')](function(_0x58022b){if(_0x58022b[_0xea31('0x36')]){var _0x10c514=-0x1;if(_[_0xea31('0x37')](_0x58022b['users'])){if(!_[_0xea31('0x1c')](_0x56fefd)){_0x10c514=_[_0xea31('0x38')](_0x58022b[_0xea31('0x36')],function(_0x22b202){return _0x22b202['email']===_0x56fefd;});}if(_0x10c514>=0x0){logger[_0xea31('0x2f')](_0xea31('0x39'));}else{logger[_0xea31('0x2f')](_0xea31('0x3a'));_0x10c514=_[_0xea31('0x38')](_0x58022b[_0xea31('0x36')],function(_0x43df92){return _0x43df92[_0xea31('0x3b')][_0xea31('0x3c')]===_0xea31('0x3d');});}return _0x58022b[_0xea31('0x36')][_0x10c514];}else{if(_0x58022b[_0xea31('0x3e')][_0xea31('0x3b')][_0xea31('0x3c')]===_0xea31('0x3d')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x58022b[_0xea31('0x3e')];return user;}else{logger[_0xea31('0x2c')](_0xea31('0x3f'),JSON[_0xea31('0xc')](_0x58022b));throw new Error(_0xea31('0x40')+JSON[_0xea31('0xc')](_0x58022b));}}}else{logger[_0xea31('0x2c')](_0xea31('0x3f'),JSON[_0xea31('0xc')](_0x58022b));throw new Error(_0xea31('0x40')+JSON[_0xea31('0xc')](_0x58022b));}})['catch'](function(_0x4ba1df){console[_0xea31('0x2c')](_0x4ba1df);});}function getZohoUser(_0x582a82,_0x35dd77){return new BPromise(function(_0x46f5d4,_0x17a7d4){request(_0x582a82)['then'](function(_0x527842){var _0x415713=null;if(_0x527842){_0x415713=_0x527842['data'][0x0];_0x415713['enduserType']=_0x35dd77;}_0x46f5d4(_0x415713);})[_0xea31('0x2b')](function(_0x54a68e){_0x17a7d4(_0x54a68e);});});}function createEndUser(_0x52c04a,_0x4f4b02,_0x238b2d,_0x4da70c,_0x529c22,_0x4555e8){var _0x238b2d=getName(_0x238b2d);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x4f4b02+_0xea31('0x41')+_['startCase'](_0x4555e8[_0xea31('0x42')])+'s','body':{'data':[{'Last_Name':_0x238b2d[0x1],'First_Name':_0x238b2d[0x0],'Phone':_0x4da70c,'Owner':{'name':!_[_0xea31('0x1c')](_0x529c22[_0xea31('0x43')][_0xea31('0x3c')])?_0x529c22[_0xea31('0x43')][_0xea31('0x3c')]:!_['isNil'](_0x529c22[_0xea31('0x44')])?_0x529c22[_0xea31('0x44')]+'\x20'+_0x529c22[_0xea31('0x45')]:_0x529c22['last_name'],'id':_0x529c22['id']}}]},'headers':{'Authorization':_0xea31('0x35')+_0x52c04a},'json':!![]})['then'](function(_0x4da05a){if(_0x4da05a&&_0x4da05a[_0xea31('0x46')][0x0][_0xea31('0x47')]==='SUCCESS'){var _0x15ab25=_0x4da05a['data'][0x0][_0xea31('0x48')];_0x15ab25[_0xea31('0x49')]=_[_0xea31('0x4a')](_0x4555e8['moduleCreate'])+'s';return _0x15ab25;}logger['error'](_0xea31('0x3f'),JSON[_0xea31('0xc')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xea31('0x2b')](function(_0x2c9769){console[_0xea31('0x4b')](_0xea31('0x4c'),_0x2c9769);});}function getEndUser(_0x4c4420,_0x3abdb7,_0x2ed785,_0x222a52,_0xecb703,_0x555ee4,_0x5a2944){var _0x3cdc14={'method':_0xea31('0x31'),'uri':'','headers':{'Authorization':_0xea31('0x35')+_0x4c4420},'json':!![]};switch(_0x5a2944['moduleSearch']){case'contact_lead':_0x3cdc14[_0xea31('0x4d')]=_0xea31('0x4e')+_0x3abdb7+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xecb703+'))';return getZohoUser(_0x3cdc14,_0xea31('0x4f'))['then'](function(_0x553cc3){if(_0x553cc3)return _0x553cc3;_0x3cdc14[_0xea31('0x4d')]=_0xea31('0x4e')+_0x3abdb7+_0xea31('0x50')+_0xecb703+'))';return getZohoUser(_0x3cdc14,_0xea31('0x51'))[_0xea31('0x28')](function(_0x4e966d){if(_0x4e966d)return _0x4e966d;if(_0x5a2944[_0xea31('0x42')]!='nothing'){return createEndUser(_0x4c4420,_0x3abdb7,_0x222a52,_0xecb703,_0x555ee4,_0x5a2944);}else{return{};}});});break;case _0xea31('0x52'):_0x3cdc14[_0xea31('0x4d')]='https://www.zohoapis.'+_0x3abdb7+_0xea31('0x53')+_0xecb703+'))';return getZohoUser(_0x3cdc14,'Contacts')['then'](function(_0x16ad6d){if(_0x16ad6d)return _0x16ad6d;if(_0x5a2944[_0xea31('0x42')]!=_0xea31('0x54')){return createEndUser(_0x4c4420,_0x3abdb7,_0x222a52,_0xecb703,_0x555ee4,_0x5a2944);}else{return{};}});break;case _0xea31('0x55'):_0x3cdc14[_0xea31('0x4d')]='https://www.zohoapis.'+_0x3abdb7+_0xea31('0x50')+_0xecb703+'))';return getZohoUser(_0x3cdc14,_0xea31('0x51'))[_0xea31('0x28')](function(_0x5be24c){if(_0x5be24c)return _0x5be24c;if(_0x5a2944[_0xea31('0x42')]!=_0xea31('0x54')){return createEndUser(_0x4c4420,_0x3abdb7,_0x222a52,_0xecb703,_0x555ee4,_0x5a2944);}else{return{};}});break;}}function getCall(_0x50998c,_0x23b5fb,_0x7a4025,_0x16cdf3,_0x20cc17,_0x5d2378,_0x527839,_0x3d691d){logger['info']('Creating\x20new\x20call...');var _0x288ec1={};_0x288ec1['Owner']={'name':!_[_0xea31('0x1c')](_0x16cdf3['role'][_0xea31('0x3c')])&&!_[_0xea31('0x1c')](_0x16cdf3['profile']['name'])&&_0x16cdf3[_0xea31('0x3b')][_0xea31('0x3c')]==='administrator'?_0x16cdf3[_0xea31('0x43')][_0xea31('0x3c')]:!_[_0xea31('0x1c')](_0x16cdf3[_0xea31('0x44')])?_0x16cdf3[_0xea31('0x44')]+'\x20'+_0x16cdf3[_0xea31('0x45')]:_0x16cdf3['last_name'],'id':_0x16cdf3['id']};_0x288ec1[_0xea31('0x56')]=intUtil[_0xea31('0x57')](_0x5d2378['Subjects'],_0x527839,'\x20');_0x288ec1['Description']=intUtil[_0xea31('0x57')](_0x5d2378[_0xea31('0x58')],_0x527839,'\x0a');if(_0x20cc17[_0xea31('0x49')]===_0xea31('0x4f')){_0x288ec1[_0xea31('0x59')]={'name':!_[_0xea31('0x1c')](_0x20cc17[_0xea31('0x5a')])?_0x20cc17[_0xea31('0x5a')]:!_['isNil'](_0x20cc17[_0xea31('0x5b')])?_0x20cc17[_0xea31('0x5b')]+'\x20'+_0x20cc17[_0xea31('0x5c')]:_0x20cc17[_0xea31('0x5c')],'id':_0x20cc17['id']};}if(_0x20cc17['enduserType']==='Leads'){_0x288ec1[_0xea31('0x5d')]={'name':!_[_0xea31('0x1c')](_0x20cc17[_0xea31('0x5a')])?_0x20cc17['Full_Name']:!_[_0xea31('0x1c')](_0x20cc17['First_Name'])?_0x20cc17[_0xea31('0x5b')]+'\x20'+_0x20cc17[_0xea31('0x5c')]:_0x20cc17[_0xea31('0x5c')],'id':_0x20cc17['id']};_0x288ec1[_0xea31('0x5e')]=_[_0xea31('0x4a')](_0x20cc17['enduserType']);}if(_0x527839[_0xea31('0x5f')]){_0x288ec1[_0xea31('0x60')]=moment[_0xea31('0x61')](parseInt(_0x527839[_0xea31('0x5f')])*0x3e8)['format'](_0xea31('0x62'));}else if(_0x527839[_0xea31('0x63')]&&_0x527839[_0xea31('0x64')]){_0x288ec1[_0xea31('0x60')]=moment['utc'](moment(_0x527839[_0xea31('0x64')],_0xea31('0x65'))[_0xea31('0x66')](moment(_0x527839[_0xea31('0x67')],'YYYY-MM-DDTHH:mm:ss')))['format']('mm:ss');}switch(_0x527839['lastevent']){case _0xea31('0x68'):_0x288ec1[_0xea31('0x69')]='Called';break;case _0xea31('0x6a'):case'connect':_0x288ec1[_0xea31('0x69')]='Answered';break;case _0xea31('0x6b'):_0x288ec1[_0xea31('0x69')]=_0xea31('0x6c');break;case _0xea31('0x6d'):_0x288ec1[_0xea31('0x69')]='Abandoned';break;case _0xea31('0x6e'):_0x288ec1['Call_Result']=_0xea31('0x6f');default:}_0x288ec1[_0xea31('0x70')]=(_0x3d691d===_0xea31('0x71')?moment(_0x527839['starttime'])[_0xea31('0x32')](_0xea31('0x65')):moment(_0x527839[_0xea31('0x72')])['format'](_0xea31('0x65')))||moment()[_0xea31('0x32')](_0xea31('0x65'));_0x288ec1[_0xea31('0x73')]=_0x3d691d||_0xea31('0x74');_0x288ec1=_[_0xea31('0x75')](_0x288ec1,getCustomFields(_0x5d2378[_0xea31('0x76')],_0x527839));return request({'method':_0xea31('0x25'),'uri':_0xea31('0x4e')+_0x23b5fb+_0xea31('0x77'),'headers':{'Authorization':_0xea31('0x35')+_0x50998c},'body':{'data':[_0x288ec1]},'json':!![]})[_0xea31('0x28')](function(_0x2ba9c7){if(_0x2ba9c7&&_0x2ba9c7[_0xea31('0x46')][0x0][_0xea31('0x47')]===_0xea31('0x78')){logger['info']('Call\x20created!');return{'id':_0x2ba9c7[_0xea31('0x46')][0x0][_0xea31('0x48')]['id']};}})[_0xea31('0x2b')](function(_0x2bfda9){logger[_0xea31('0x2f')](_0xea31('0x79'),_0x2bfda9[_0xea31('0x2e')]);console[_0xea31('0x4b')]('err',_0x2bfda9);});}exports[_0xea31('0x7a')]=function(_0x57672b,_0x1053c2,_0x80480b,_0x29f110,_0x5ed22e,_0x48348c){var _0xb7e08d,_0x49a419,_0x11beef;_0x48348c['host']=intUtil['stripTrailingSlash'](_0x48348c[_0xea31('0x7b')]);_0x48348c[_0xea31('0x7c')]=intUtil[_0xea31('0x7d')](_0x48348c[_0xea31('0x7c')]);if(_0x5ed22e&&_0x5ed22e[_0xea31('0x7e')]){logger['info'](_0xea31('0x7f'),_0xea31('0x80'));_0x1053c2[_0xea31('0x81')]=_0x48348c[_0xea31('0x7c')]+_0xea31('0x82')+_0x1053c2[_0xea31('0x83')]+_0xea31('0x84')+md5(_0x1053c2[_0xea31('0x83')]);}else{_0x1053c2[_0xea31('0x81')]='';}var _0x486a53=_0x48348c[_0xea31('0x7b')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x48348c)['then'](function(_0x104294){_0x11beef=_0x104294;return getUser(_0x11beef,_0x486a53,_0x48348c,_0x29f110[_0xea31('0x85')]);})['then'](function(_0x2634b8){_0xb7e08d=_0x2634b8;logger[_0xea31('0x2f')](_0xea31('0x86'),_0xb7e08d['id']);return getEndUser(_0x11beef,_0x486a53,_0x48348c,_0x1053c2['calleridname'],_0x1053c2['calleridnum'],_0xb7e08d,_0x80480b);})['then'](function(_0x1a8a0a){_0x49a419=_0x1a8a0a;return getCall(_0x11beef,_0x486a53,_0x48348c,_0xb7e08d,_0x49a419,_0x80480b,_0x1053c2,_0xea31('0x74'));})['then'](function(_0x588a6e){if(_0x588a6e){logger[_0xea31('0x2f')](_0xea31('0x87'),_0x588a6e['id']);logger['info'](_0xea31('0x7f'),_0xea31('0x88'));emit(util[_0xea31('0x32')](_0xea31('0x89'),_0x29f110[_0xea31('0x3c')]),_0xea31('0x8a'),{'uri':_0xea31('0x8b')+_0x48348c[_0xea31('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x588a6e['id']});}})[_0xea31('0x2b')](function(_0x153b3a){logger[_0xea31('0x2c')]('[QUEUE]',JSON['stringify'](_0x153b3a));});};exports[_0xea31('0x71')]=function(_0x25574f,_0x1b0794,_0x4c5864,_0x3a8399,_0x45a88b,_0x24f2ed,_0x127913){var _0x10933b,_0x29e691,_0x527195;_0x24f2ed[_0xea31('0x7b')]=intUtil[_0xea31('0x7d')](_0x24f2ed[_0xea31('0x7b')]);_0x24f2ed[_0xea31('0x7c')]=intUtil['stripTrailingSlash'](_0x24f2ed[_0xea31('0x7c')]);if(_0x127913&&_0x127913[_0xea31('0x8c')]&&_0x127913[_0xea31('0x8c')]!==_0xea31('0x8d')){logger[_0xea31('0x2f')](_0xea31('0x8e'),_0xea31('0x80'));_0x1b0794['recordingURL']=_0x24f2ed[_0xea31('0x7c')]+_0xea31('0x82')+_0x1b0794[_0xea31('0x83')]+_0xea31('0x84')+md5(_0x1b0794[_0xea31('0x83')]);}var _0x4dfb7e=_0x24f2ed[_0xea31('0x7b')]===_0xea31('0x8f')?'eu':_0xea31('0x90');return getAccessToken(_0x24f2ed)[_0xea31('0x28')](function(_0x3730e5){_0x527195=_0x3730e5;return getUser(_0x527195,_0x4dfb7e,_0x24f2ed,_0x3a8399[_0xea31('0x85')]);})[_0xea31('0x28')](function(_0x52ce5a){_0x10933b=_0x52ce5a;logger[_0xea31('0x2f')](_0xea31('0x86'),_0x10933b['id']);return getEndUser(_0x527195,_0x4dfb7e,_0x24f2ed,_0x1b0794[_0xea31('0x91')],_0x1b0794[_0xea31('0x92')],_0x10933b,_0x4c5864);})['then'](function(_0xccb738){_0x29e691=_0xccb738;return getCall(_0x527195,_0x4dfb7e,_0x24f2ed,_0x10933b,_0x29e691,_0x4c5864,_0x1b0794,'Outbound');})['then'](function(_0x173097){if(_0x173097){logger['info'](_0xea31('0x87'),_0x173097['id']);logger['info'](_0xea31('0x8e'),_0xea31('0x88'));emit(util[_0xea31('0x32')]('user:%s',_0x3a8399[_0xea31('0x3c')]),_0xea31('0x8a'),{'uri':_0xea31('0x8b')+_0x24f2ed[_0xea31('0x7b')]+_0xea31('0x93')+_0x173097['id']});}})[_0xea31('0x2b')](function(_0x52ab47){logger[_0xea31('0x2c')](_0xea31('0x8e'),JSON[_0xea31('0xc')](_0x52ab47));});};exports[_0xea31('0x94')]=function(_0xae153d,_0x28741b,_0xdff630,_0x144986,_0xb9ca80,_0x4bc8b8){var _0x3e7872,_0x5407b6,_0x3f19b3;_0x4bc8b8[_0xea31('0x7b')]=intUtil[_0xea31('0x7d')](_0x4bc8b8['host']);_0x4bc8b8['serverUrl']=intUtil[_0xea31('0x7d')](_0x4bc8b8[_0xea31('0x7c')]);if(_0xb9ca80&&_0xb9ca80[_0xea31('0x7e')]){logger[_0xea31('0x2f')]('['+_0x28741b[_0xea31('0x95')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x28741b[_0xea31('0x81')]=_0x4bc8b8[_0xea31('0x7c')]+_0xea31('0x82')+_0x28741b[_0xea31('0x83')]+_0xea31('0x84')+md5(_0x28741b[_0xea31('0x83')]);}else{_0x28741b[_0xea31('0x81')]='';}var _0x5dbbab=_0x4bc8b8[_0xea31('0x7b')]===_0xea31('0x8f')?'eu':_0xea31('0x90');return getAccessToken(_0x4bc8b8)[_0xea31('0x28')](function(_0x2c5424){_0x3f19b3=_0x2c5424;return getUser(_0x3f19b3,_0x5dbbab,_0x4bc8b8);})[_0xea31('0x28')](function(_0x3ca0c4){_0x3e7872=_0x3ca0c4;logger['info'](_0xea31('0x86'),_0x3e7872['id']);return getEndUser(_0x3f19b3,_0x5dbbab,_0x4bc8b8,_0x28741b[_0xea31('0x96')],_0x28741b[_0xea31('0x97')],_0x3e7872,_0xdff630);})['then'](function(_0x593aab){_0x5407b6=_0x593aab;return getCall(_0x3f19b3,_0x5dbbab,_0x4bc8b8,_0x3e7872,_0x5407b6,_0xdff630,_0x28741b,_0xea31('0x74'));})[_0xea31('0x28')](function(_0x5a6137){if(_0x5a6137){logger[_0xea31('0x2f')](_0xea31('0x87'),_0x5a6137['id']);}})[_0xea31('0x2b')](function(_0x251f41){logger['error']('['+_0x28741b[_0xea31('0x95')][_0xea31('0x98')]()+']',JSON[_0xea31('0xc')](_0x251f41));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d46=['render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','exec','Script','data3'];(function(_0x193106,_0x4a6ae3){var _0x3a5c47=function(_0x26beb8){while(--_0x26beb8){_0x193106['push'](_0x193106['shift']());}};_0x3a5c47(++_0x4a6ae3);}(_0x2d46,0xbc));var _0x62d4=function(_0x475c4b,_0x5eaf4c){_0x475c4b=_0x475c4b-0x0;var _0x44de4f=_0x2d46[_0x475c4b];return _0x44de4f;};'use strict';var util=require(_0x62d4('0x0'));var sh=require(_0x62d4('0x1'));var Mustache=require(_0x62d4('0x2'));var logger=require(_0x62d4('0x3'))('trigger');exports[_0x62d4('0x4')]=function(_0x8e807a,_0xd74e79){var _0x3a6af7=_0x8e807a['data2']?_0x8e807a['data2']:_0x62d4('0x5');var _0x30281d=_0x8e807a[_0x62d4('0x6')]?Mustache[_0x62d4('0x7')](_0x8e807a['data3'],_0xd74e79):_0xd74e79;sh[_0x62d4('0x4')](_0x30281d,function(_0x5c341e,_0x219933,_0x3a70dc){if(_0x5c341e!==0x0){logger[_0x62d4('0x8')](util[_0x62d4('0x9')](_0x62d4('0xa'),_0x3a6af7,_0x30281d,_0x5c341e,_0x3a70dc));}else{logger[_0x62d4('0xb')](util[_0x62d4('0x9')](_0x62d4('0xc'),_0x3a6af7,_0x30281d,_0x219933));}});};
\ No newline at end of file
+var _0x4e05=['render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x4d7569,_0x311183){var _0x263e6d=function(_0x7c2968){while(--_0x7c2968){_0x4d7569['push'](_0x4d7569['shift']());}};_0x263e6d(++_0x311183);}(_0x4e05,0xdc));var _0x54e0=function(_0x52f926,_0x3e9c33){_0x52f926=_0x52f926-0x0;var _0x416c69=_0x4e05[_0x52f926];return _0x416c69;};'use strict';var util=require(_0x54e0('0x0'));var sh=require('shelljs');var Mustache=require(_0x54e0('0x1'));var logger=require(_0x54e0('0x2'))(_0x54e0('0x3'));exports[_0x54e0('0x4')]=function(_0x4275af,_0x31dc66){var _0x2d122f=_0x4275af[_0x54e0('0x5')]?_0x4275af[_0x54e0('0x5')]:_0x54e0('0x6');var _0x53fd81=_0x4275af[_0x54e0('0x7')]?Mustache[_0x54e0('0x8')](_0x4275af[_0x54e0('0x7')],_0x31dc66):_0x31dc66;sh[_0x54e0('0x4')](_0x53fd81,function(_0x1fe4de,_0x543a8b,_0x16ac0a){if(_0x1fe4de!==0x0){logger[_0x54e0('0x9')](util['format'](_0x54e0('0xa'),_0x2d122f,_0x53fd81,_0x1fe4de,_0x16ac0a));}else{logger['info'](util[_0x54e0('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2d122f,_0x53fd81,_0x543a8b));}});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc9e=['name','message','request-promise','util','lodash','../../../../config/logger','trigger','exec','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','data1','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','body','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode'];(function(_0x22ca63,_0xd263ec){var _0xadc6dc=function(_0x4cd069){while(--_0x4cd069){_0x22ca63['push'](_0x22ca63['shift']());}};_0xadc6dc(++_0xd263ec);}(_0xdc9e,0x13d));var _0xedc9=function(_0x3062a2,_0x53173f){_0x3062a2=_0x3062a2-0x0;var _0x1958b3=_0xdc9e[_0x3062a2];return _0x1958b3;};'use strict';var rp=require(_0xedc9('0x0'));var util=require(_0xedc9('0x1'));var _=require(_0xedc9('0x2'));var Mustache=require('mustache');var logger=require(_0xedc9('0x3'))(_0xedc9('0x4'));exports[_0xedc9('0x5')]=function(_0x3b78c3,_0x28dfe7){var _0x2779c5,_0x961bff;var _0x2ed0e8={'method':_0x3b78c3['data1'][_0xedc9('0x6')](),'uri':Mustache[_0xedc9('0x7')](_0x3b78c3[_0xedc9('0x8')],_0x28dfe7),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3b78c3['data5'])===_0xedc9('0x9')&&parseInt(_0x3b78c3[_0xedc9('0xa')])>=0x1&&parseInt(_0x3b78c3[_0xedc9('0xa')])<=0xa?parseInt(_0x3b78c3[_0xedc9('0xa')])*0x3e8:0x5*0x3e8};try{_0x2ed0e8[_0xedc9('0xb')]=_0x3b78c3[_0xedc9('0xc')]?JSON[_0xedc9('0xd')](Mustache[_0xedc9('0x7')](_0x3b78c3[_0xedc9('0xc')],_0x28dfe7)):{};}catch(_0x2953f5){logger[_0xedc9('0xe')](_0x2953f5[_0xedc9('0xf')]);}switch(_0x3b78c3[_0xedc9('0x10')]['toUpperCase']()){case'GET':case _0xedc9('0x11'):_0x2779c5=null;_0x2ed0e8['qs']=_0x28dfe7;break;case _0xedc9('0x12'):case _0xedc9('0x13'):if(_0x3b78c3[_0xedc9('0x14')]){try{_0x2779c5=JSON['parse'](Mustache[_0xedc9('0x7')](_0x3b78c3[_0xedc9('0x14')],_0x28dfe7));_0x2ed0e8['body']=_0x2779c5;}catch(_0x34d878){logger['error'](_0x34d878[_0xedc9('0xf')]);logger[_0xedc9('0xe')](_0xedc9('0x15'));}}else{_0x2779c5=_0x28dfe7;_0x2ed0e8['body']=_0x2779c5;}break;}logger[_0xedc9('0x16')](util[_0xedc9('0x17')](_0xedc9('0x18'),_0x3b78c3['data1'],_0x3b78c3['data2'],JSON['stringify'](_0x2ed0e8)));rp(_0x2ed0e8)[_0xedc9('0x19')](function(_0x148db0){_0x2779c5=!_[_0xedc9('0x1a')](_0x2779c5)?',\x20request\x20body:\x20'+_0x2779c5:'';_0x961bff=typeof _0x148db0[_0xedc9('0x1b')]===_0xedc9('0x1c')?JSON['stringify'](_0x148db0['body']):_0x148db0[_0xedc9('0x1b')];logger[_0xedc9('0x16')](util['format'](_0xedc9('0x1d'),_0x3b78c3[_0xedc9('0x10')],_0x3b78c3['data2'],_0x148db0['statusCode'],_0x961bff));})[_0xedc9('0x1e')](function(_0x1921fa){logger[_0xedc9('0xe')](util[_0xedc9('0x17')](_0xedc9('0x1f'),_0x3b78c3[_0xedc9('0x10')],_0x3b78c3[_0xedc9('0x8')],_0x1921fa[_0xedc9('0x20')],_0x1921fa[_0xedc9('0x21')],_0x1921fa[_0xedc9('0x22')]));});};
\ No newline at end of file
+var _0xd31f=['stack','GET','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','data2','stringify','then','isNil','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','message','request-promise','mustache','../../../../config/logger','trigger','toUpperCase','render','data5','number','headers','data6','parse'];(function(_0x328ee7,_0x4f6aa1){var _0x20e06a=function(_0x17ea19){while(--_0x17ea19){_0x328ee7['push'](_0x328ee7['shift']());}};_0x20e06a(++_0x4f6aa1);}(_0xd31f,0x155));var _0xfd31=function(_0x2e33e6,_0x183632){_0x2e33e6=_0x2e33e6-0x0;var _0x17c693=_0xd31f[_0x2e33e6];return _0x17c693;};'use strict';var rp=require(_0xfd31('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0xfd31('0x1'));var logger=require(_0xfd31('0x2'))(_0xfd31('0x3'));exports['exec']=function(_0x3b02f6,_0x4c4ff2){var _0x429550,_0x32cf2c;var _0x438ec7={'method':_0x3b02f6['data1'][_0xfd31('0x4')](),'uri':Mustache[_0xfd31('0x5')](_0x3b02f6['data2'],_0x4c4ff2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3b02f6[_0xfd31('0x6')])===_0xfd31('0x7')&&parseInt(_0x3b02f6[_0xfd31('0x6')])>=0x1&&parseInt(_0x3b02f6[_0xfd31('0x6')])<=0xa?parseInt(_0x3b02f6[_0xfd31('0x6')])*0x3e8:0x5*0x3e8};try{_0x438ec7[_0xfd31('0x8')]=_0x3b02f6[_0xfd31('0x9')]?JSON[_0xfd31('0xa')](Mustache['render'](_0x3b02f6['data6'],_0x4c4ff2)):{};}catch(_0x4f5e64){logger['error'](_0x4f5e64[_0xfd31('0xb')]);}switch(_0x3b02f6['data1'][_0xfd31('0x4')]()){case _0xfd31('0xc'):case'DELETE':_0x429550=null;_0x438ec7['qs']=_0x4c4ff2;break;case _0xfd31('0xd'):case _0xfd31('0xe'):if(_0x3b02f6[_0xfd31('0xf')]){try{_0x429550=JSON[_0xfd31('0xa')](Mustache[_0xfd31('0x5')](_0x3b02f6[_0xfd31('0xf')],_0x4c4ff2));_0x438ec7[_0xfd31('0x10')]=_0x429550;}catch(_0x550a7b){logger['error'](_0x550a7b[_0xfd31('0xb')]);logger[_0xfd31('0x11')](_0xfd31('0x12'));}}else{_0x429550=_0x4c4ff2;_0x438ec7[_0xfd31('0x10')]=_0x429550;}break;}logger['info'](util[_0xfd31('0x13')](_0xfd31('0x14'),_0x3b02f6[_0xfd31('0x15')],_0x3b02f6[_0xfd31('0x16')],JSON[_0xfd31('0x17')](_0x438ec7)));rp(_0x438ec7)[_0xfd31('0x18')](function(_0x5c6813){_0x429550=!_[_0xfd31('0x19')](_0x429550)?',\x20request\x20body:\x20'+_0x429550:'';_0x32cf2c=typeof _0x5c6813[_0xfd31('0x10')]===_0xfd31('0x1a')?JSON['stringify'](_0x5c6813[_0xfd31('0x10')]):_0x5c6813[_0xfd31('0x10')];logger[_0xfd31('0x1b')](util['format'](_0xfd31('0x1c'),_0x3b02f6['data1'],_0x3b02f6[_0xfd31('0x16')],_0x5c6813[_0xfd31('0x1d')],_0x32cf2c));})[_0xfd31('0x1e')](function(_0x229473){logger[_0xfd31('0x11')](util[_0xfd31('0x13')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3b02f6[_0xfd31('0x15')],_0x3b02f6[_0xfd31('0x16')],_0x229473[_0xfd31('0x1d')],_0x229473['name'],_0x229473[_0xfd31('0x1f')]));});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d50=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x2304a6,_0x4f18d9){var _0x2b2cd8=function(_0x297664){while(--_0x297664){_0x2304a6['push'](_0x2304a6['shift']());}};_0x2b2cd8(++_0x4f18d9);}(_0x4d50,0x84));var _0x04d5=function(_0x5d833a,_0x5e5e5c){_0x5d833a=_0x5d833a-0x0;var _0x37c29d=_0x4d50[_0x5d833a];return _0x37c29d;};'use strict';var jayson=require(_0x04d5('0x0'));var BPromise=require(_0x04d5('0x1'));var logger=require(_0x04d5('0x2'))(_0x04d5('0x3'));var client=jayson[_0x04d5('0x4')][_0x04d5('0x5')]({'port':0x2329});client['Request']=function(_0x59277a,_0x1ac3f6){return new BPromise(function(_0x525162,_0x2fe547){return client[_0x04d5('0x6')](_0x59277a,_0x1ac3f6)[_0x04d5('0x7')](function(_0x350b89){logger[_0x04d5('0x8')](_0x04d5('0x9'),_0x04d5('0x3'),_0x59277a,_0x1ac3f6,_0x350b89);if(_0x350b89[_0x04d5('0xa')]){logger['error'](_0x04d5('0x9'),_0x04d5('0x3'),_0x59277a,_0x350b89[_0x04d5('0xa')][_0x04d5('0xb')],_0x1ac3f6);return _0x2fe547(_0x350b89[_0x04d5('0xa')][_0x04d5('0xb')]);}else{return _0x525162(_0x350b89[_0x04d5('0xc')]);}})[_0x04d5('0xd')](function(_0x5d5429){logger[_0x04d5('0xa')](_0x04d5('0x9'),_0x04d5('0x3'),_0x59277a,_0x5d5429,_0x1ac3f6);return _0x2fe547(_0x5d5429);});});};module[_0x04d5('0xe')]=client;
\ No newline at end of file
+var _0xb154=['jayson/promise','http','Request','then','rpc','routing','error','message','result'];(function(_0x245c9f,_0x1d9e8c){var _0x276b79=function(_0x2bdbd7){while(--_0x2bdbd7){_0x245c9f['push'](_0x245c9f['shift']());}};_0x276b79(++_0x1d9e8c);}(_0xb154,0xbd));var _0x4b15=function(_0xd3992f,_0x1b8339){_0xd3992f=_0xd3992f-0x0;var _0x22b829=_0xb154[_0xd3992f];return _0x22b829;};'use strict';var jayson=require(_0x4b15('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson['client'][_0x4b15('0x1')]({'port':0x2329});client[_0x4b15('0x2')]=function(_0x1e919d,_0x96dfaf){return new BPromise(function(_0x20cd05,_0x8e7bf7){return client['request'](_0x1e919d,_0x96dfaf)[_0x4b15('0x3')](function(_0x5cec3e){logger['debug'](_0x4b15('0x4'),_0x4b15('0x5'),_0x1e919d,_0x96dfaf,_0x5cec3e);if(_0x5cec3e[_0x4b15('0x6')]){logger['error'](_0x4b15('0x4'),_0x4b15('0x5'),_0x1e919d,_0x5cec3e['error'][_0x4b15('0x7')],_0x96dfaf);return _0x8e7bf7(_0x5cec3e[_0x4b15('0x6')][_0x4b15('0x7')]);}else{return _0x20cd05(_0x5cec3e[_0x4b15('0x8')]);}})['catch'](function(_0x1116f4){logger[_0x4b15('0x6')](_0x4b15('0x4'),'routing',_0x1e919d,_0x1116f4,_0x96dfaf);return _0x8e7bf7(_0x1116f4);});});};module['exports']=client;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24cf=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','refresh','listen','getSettings','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x561bf6,_0x5800e7){var _0x21df22=function(_0x14dce5){while(--_0x14dce5){_0x561bf6['push'](_0x561bf6['shift']());}};_0x21df22(++_0x5800e7);}(_0x24cf,0x6e));var _0xf24c=function(_0xe769e8,_0x1cb529){_0xe769e8=_0xe769e8-0x0;var _0x15c980=_0x24cf[_0xe769e8];return _0x15c980;};'use strict';var server=require(_0xf24c('0x0'));var Realtime=require(_0xf24c('0x1'));var EmailChannel=require(_0xf24c('0x2'));var mailAccount=require(_0xf24c('0x3'));var setting=require(_0xf24c('0x4'));var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf24c('0x7')]()[_0xf24c('0x8')](mailAccount[_0xf24c('0x9')]())[_0xf24c('0x8')](realtime['initMailAccounts']())[_0xf24c('0x8')](function(){email[_0xf24c('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xf24c('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0xf24c('0x8')](function(){return setting[_0xf24c('0xc')]();})[_0xf24c('0x8')](function(_0x3c037c){return setInterval(initRealtime,_0x3c037c['loginMailFrequency']*0x3e8);})[_0xf24c('0xd')](function(_0x2e3e58){logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x2e3e58);});}main();
\ No newline at end of file
+var _0x0a4c=['loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x220d0f,_0x9d20fe){var _0x335d0d=function(_0x42f543){while(--_0x42f543){_0x220d0f['push'](_0x220d0f['shift']());}};_0x335d0d(++_0x9d20fe);}(_0x0a4c,0x19a));var _0xc0a4=function(_0x57de90,_0x586177){_0x57de90=_0x57de90-0x0;var _0x58608e=_0x0a4c[_0x57de90];return _0x58608e;};'use strict';var server=require(_0xc0a4('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xc0a4('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xc0a4('0x2'));var logger=require(_0xc0a4('0x3'))(_0xc0a4('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xc0a4('0x5')](mailAccount[_0xc0a4('0x6')]())['then'](realtime[_0xc0a4('0x7')]())['then'](function(){email[_0xc0a4('0x8')](realtime[_0xc0a4('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xc0a4('0x5')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0xc0a4('0x5')](function(_0x173133){return setInterval(initRealtime,_0x173133[_0xc0a4('0xa')]*0x3e8);})[_0xc0a4('0xb')](function(_0x1b7cfd){logger[_0xc0a4('0xc')](_0xc0a4('0xd'),_0x1b7cfd);});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4916=['lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','../../../config/environment','redis','defaults','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','handleImapBox','bind','handleImapEmail','end','handleImapEnd','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error'];(function(_0x3c210d,_0x52be7f){var _0x19daa4=function(_0x552568){while(--_0x552568){_0x3c210d['push'](_0x3c210d['shift']());}};_0x19daa4(++_0x52be7f);}(_0x4916,0xe5));var _0x6491=function(_0x418f69,_0x34dce9){_0x418f69=_0x418f69-0x0;var _0x512f3e=_0x4916[_0x418f69];return _0x512f3e;};'use strict';var _=require(_0x6491('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x6491('0x1'));var logger=require('../../../config/logger')('email');config[_0x6491('0x2')]=_[_0x6491('0x3')](config[_0x6491('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x6491('0x4'));var EmailSmtp=require(_0x6491('0x5'));var mailAccount=require(_0x6491('0x6'));var md5Accounts={};function EmailChannel(_0x3a6793){logger[_0x6491('0x7')]('start\x20email\x20channel');this[_0x6491('0x8')]=_0x3a6793[_0x6491('0x8')];this[_0x6491('0x9')]={};this[_0x6491('0xa')]=new EmailSmtp();}EmailChannel[_0x6491('0xb')][_0x6491('0xc')]=function(_0x33872e){var _0x5b7931=this[_0x6491('0x8')][_0x33872e];var _0x2d38e3={'id':_0x5b7931['id'],'name':_0x5b7931[_0x6491('0xd')],'key':_0x5b7931[_0x6491('0xe')],'active':_0x5b7931[_0x6491('0xf')],'Imap':{'status':_0x5b7931[_0x6491('0x10')][_0x6491('0x11')],'messageStatus':_0x5b7931['Imap'][_0x6491('0x12')],'total':_0x5b7931[_0x6491('0x10')][_0x6491('0x13')]}};if(_[_0x6491('0x14')](md5Accounts[_0x33872e])){md5Accounts[_0x33872e]={};}var _0x4f96ec=md5(JSON[_0x6491('0x15')](_0x2d38e3));if(md5Accounts[_0x33872e][_0x6491('0x16')]!==_0x4f96ec){md5Accounts[_0x33872e]['md5']=_0x4f96ec;io[_0x6491('0xc')](_0x6491('0x17'),_0x2d38e3);}};EmailChannel[_0x6491('0xb')][_0x6491('0x18')]=function(_0x49509b){for(var _0x46457e in _0x49509b){if(_0x49509b[_0x6491('0x19')](_0x46457e)){if(_0x49509b[_0x46457e][_0x6491('0x10')]&&_0x49509b[_0x46457e]['active']){var _0x2121c6=_0x49509b[_0x46457e][_0x6491('0x10')];if(!_0x2121c6[_0x6491('0x1a')]&&_0x49509b[_0x46457e][_0x6491('0x1b')]!==_0x6491('0x1c'))_0x2121c6[_0x6491('0x1a')]=_0x49509b[_0x46457e]['provider'];if(!this['imapAccounts'][_0x6491('0x19')](_0x2121c6['id'])){this['imapAccounts'][_0x2121c6['id']]=new EmailImap(_0x2121c6,_0x49509b[_0x46457e][_0x6491('0x1d')]);this['imapAccounts'][_0x2121c6['id']]['on']('box',this[_0x6491('0x1e')][_0x6491('0x1f')](this,_0x46457e));this[_0x6491('0x9')][_0x2121c6['id']]['on']('email',this[_0x6491('0x20')][_0x6491('0x1f')](this,_0x46457e));this[_0x6491('0x9')][_0x2121c6['id']]['on'](_0x6491('0x21'),this[_0x6491('0x22')]['bind'](this,_0x46457e));this['imapAccounts'][_0x2121c6['id']]['on']('error',this['handleImapError'][_0x6491('0x1f')](this,_0x46457e));}}else{if(_[_0x6491('0x14')](this[_0x6491('0x8')][_0x46457e]['Imap'])){this['mailAccounts'][_0x46457e]['Imap']={};}this['mailAccounts'][_0x46457e]['Imap'][_0x6491('0x11')]='disabled';this[_0x6491('0x8')][_0x46457e][_0x6491('0x10')][_0x6491('0x12')]='';this[_0x6491('0xc')](_0x46457e);}}}};EmailChannel[_0x6491('0xb')][_0x6491('0x1e')]=function(_0x5102e2,_0x4b7de0){if(this[_0x6491('0x8')][_0x5102e2]){this['mailAccounts'][_0x5102e2][_0x6491('0x10')]['status']=_0x6491('0x23');this[_0x6491('0x8')][_0x5102e2][_0x6491('0x10')]['messageStatus']=_0x4b7de0['name'];if(_0x4b7de0[_0x6491('0x24')]){this[_0x6491('0x8')][_0x5102e2][_0x6491('0x10')][_0x6491('0x13')]=_0x4b7de0['messages'][_0x6491('0x13')];}return this['emit'](_0x5102e2);}};EmailChannel[_0x6491('0xb')][_0x6491('0x20')]=function(_0x51142c,_0x529b06){logger[_0x6491('0x7')](_0x6491('0x25'),_0x529b06[_0x6491('0x26')],_0x529b06[_0x6491('0x27')],_0x529b06[_0x6491('0x28')],_0x51142c);if(this[_0x6491('0x8')][_0x51142c]){return mailAccount[_0x6491('0x29')](_0x51142c,_0x529b06)[_0x6491('0x2a')](function(_0x5d42a3){if(_0x5d42a3){logger[_0x6491('0x7')](_0x6491('0x2b'));}})[_0x6491('0x2c')](function(_0x25955e){logger[_0x6491('0x2d')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x6491('0x15')](_0x25955e));});}};EmailChannel[_0x6491('0xb')]['handleImapEnd']=function(_0x3e3612){if(this['mailAccounts'][_0x3e3612]&&this[_0x6491('0x8')][_0x3e3612]['Imap']){if(this[_0x6491('0x9')][this['mailAccounts'][_0x3e3612][_0x6491('0x10')]['id']]){delete this[_0x6491('0x9')][this[_0x6491('0x8')][_0x3e3612][_0x6491('0x10')]['id']];}this[_0x6491('0x8')][_0x3e3612][_0x6491('0x10')][_0x6491('0x2e')]=moment();this[_0x6491('0xc')](_0x3e3612);}};EmailChannel[_0x6491('0xb')][_0x6491('0x2f')]=function(_0x27c075,_0x90196b){if(this[_0x6491('0x8')][_0x27c075]){this[_0x6491('0x8')][_0x27c075][_0x6491('0x10')]['status']=_0x6491('0x2d');this[_0x6491('0x8')][_0x27c075][_0x6491('0x10')][_0x6491('0x12')]=_0x90196b;return this['emit'](_0x27c075);}};EmailChannel['prototype'][_0x6491('0x30')]=function(_0x273b75,_0xc064f1){return this[_0x6491('0xa')][_0x6491('0x31')](_0x273b75,_0xc064f1);};EmailChannel['prototype'][_0x6491('0x32')]=function(_0x493d5b){var _0x33134b=this;if(this[_0x6491('0x8')][_0x493d5b['id']]){if(_[_0x6491('0x14')](this[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')])){this[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')]={};}this[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')][_0x6491('0x2e')]=moment();return new BPromise(function(_0x457176,_0x28d134){return _0x33134b['smtp'][_0x6491('0x34')](_0x493d5b)[_0x6491('0x2a')](function(_0x180d06){_0x33134b[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')][_0x6491('0x11')]=_0x6491('0x35');_0x33134b['mailAccounts'][_0x493d5b['id']][_0x6491('0x33')]['messageStatus']='';_0x33134b['emit'](_0x493d5b['id']);_0x457176(_0x180d06);})[_0x6491('0x2c')](function(_0x18fcbb){_0x33134b[_0x6491('0x8')][_0x493d5b['id']][_0x6491('0x33')]['status']=_0x6491('0x2d');_0x33134b[_0x6491('0x8')][_0x493d5b['id']]['Smtp'][_0x6491('0x12')]=_0x18fcbb;_0x33134b[_0x6491('0xc')](_0x493d5b['id']);_0x28d134(_0x18fcbb);});});}return this['smtp'][_0x6491('0x34')](_0x493d5b);};module[_0x6491('0x36')]=EmailChannel;
\ No newline at end of file
+var _0x96b5=['smtp','prototype','name','active','status','Imap','messageStatus','total','isNil','emit','mailAccount:update','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','verifySmtp','Smtp','lastSync','verified','verify','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts'];(function(_0x1978cc,_0x434e3a){var _0x4905ca=function(_0x5d9590){while(--_0x5d9590){_0x1978cc['push'](_0x1978cc['shift']());}};_0x4905ca(++_0x434e3a);}(_0x96b5,0xa0));var _0x596b=function(_0x3a8127,_0x20176e){_0x3a8127=_0x3a8127-0x0;var _0x4ae44a=_0x96b5[_0x3a8127];return _0x4ae44a;};'use strict';var _=require(_0x596b('0x0'));var moment=require(_0x596b('0x1'));var BPromise=require(_0x596b('0x2'));var md5=require(_0x596b('0x3'));var Redis=require('ioredis');var config=require(_0x596b('0x4'));var logger=require(_0x596b('0x5'))(_0x596b('0x6'));config[_0x596b('0x7')]=_[_0x596b('0x8')](config[_0x596b('0x7')],{'host':_0x596b('0x9'),'port':0x18eb});var io=require(_0x596b('0xa'))(new Redis(config['redis']));var EmailImap=require(_0x596b('0xb'));var EmailSmtp=require(_0x596b('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x44425e){logger[_0x596b('0xd')](_0x596b('0xe'));this[_0x596b('0xf')]=_0x44425e[_0x596b('0xf')];this[_0x596b('0x10')]={};this[_0x596b('0x11')]=new EmailSmtp();}EmailChannel[_0x596b('0x12')]['emit']=function(_0x7a254){var _0xfd32ef=this['mailAccounts'][_0x7a254];var _0x338b6b={'id':_0xfd32ef['id'],'name':_0xfd32ef[_0x596b('0x13')],'key':_0xfd32ef['key'],'active':_0xfd32ef[_0x596b('0x14')],'Imap':{'status':_0xfd32ef['Imap'][_0x596b('0x15')],'messageStatus':_0xfd32ef[_0x596b('0x16')][_0x596b('0x17')],'total':_0xfd32ef[_0x596b('0x16')][_0x596b('0x18')]}};if(_[_0x596b('0x19')](md5Accounts[_0x7a254])){md5Accounts[_0x7a254]={};}var _0x414e56=md5(JSON['stringify'](_0x338b6b));if(md5Accounts[_0x7a254][_0x596b('0x3')]!==_0x414e56){md5Accounts[_0x7a254][_0x596b('0x3')]=_0x414e56;io[_0x596b('0x1a')](_0x596b('0x1b'),_0x338b6b);}};EmailChannel[_0x596b('0x12')]['refresh']=function(_0x24fcd3){for(var _0x4a7714 in _0x24fcd3){if(_0x24fcd3[_0x596b('0x1c')](_0x4a7714)){if(_0x24fcd3[_0x4a7714]['Imap']&&_0x24fcd3[_0x4a7714]['active']){var _0x247661=_0x24fcd3[_0x4a7714]['Imap'];if(!_0x247661[_0x596b('0x1d')]&&_0x24fcd3[_0x4a7714][_0x596b('0x1e')]!==_0x596b('0x1f'))_0x247661[_0x596b('0x1d')]=_0x24fcd3[_0x4a7714][_0x596b('0x1e')];if(!this[_0x596b('0x10')]['hasOwnProperty'](_0x247661['id'])){this[_0x596b('0x10')][_0x247661['id']]=new EmailImap(_0x247661,_0x24fcd3[_0x4a7714][_0x596b('0x6')]);this[_0x596b('0x10')][_0x247661['id']]['on'](_0x596b('0x20'),this[_0x596b('0x21')][_0x596b('0x22')](this,_0x4a7714));this[_0x596b('0x10')][_0x247661['id']]['on']('email',this[_0x596b('0x23')][_0x596b('0x22')](this,_0x4a7714));this[_0x596b('0x10')][_0x247661['id']]['on'](_0x596b('0x24'),this[_0x596b('0x25')][_0x596b('0x22')](this,_0x4a7714));this[_0x596b('0x10')][_0x247661['id']]['on'](_0x596b('0x26'),this[_0x596b('0x27')][_0x596b('0x22')](this,_0x4a7714));}}else{if(_[_0x596b('0x19')](this[_0x596b('0xf')][_0x4a7714]['Imap'])){this[_0x596b('0xf')][_0x4a7714][_0x596b('0x16')]={};}this[_0x596b('0xf')][_0x4a7714][_0x596b('0x16')][_0x596b('0x15')]=_0x596b('0x28');this[_0x596b('0xf')][_0x4a7714][_0x596b('0x16')][_0x596b('0x17')]='';this[_0x596b('0x1a')](_0x4a7714);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x253d83,_0x409c6d){if(this[_0x596b('0xf')][_0x253d83]){this['mailAccounts'][_0x253d83]['Imap'][_0x596b('0x15')]=_0x596b('0x29');this['mailAccounts'][_0x253d83]['Imap'][_0x596b('0x17')]=_0x409c6d[_0x596b('0x13')];if(_0x409c6d[_0x596b('0x2a')]){this[_0x596b('0xf')][_0x253d83][_0x596b('0x16')]['total']=_0x409c6d[_0x596b('0x2a')][_0x596b('0x18')];}return this['emit'](_0x253d83);}};EmailChannel[_0x596b('0x12')][_0x596b('0x23')]=function(_0x1223f4,_0x219c74){logger[_0x596b('0xd')](_0x596b('0x2b'),_0x219c74[_0x596b('0x2c')],_0x219c74[_0x596b('0x2d')],_0x219c74[_0x596b('0x2e')],_0x1223f4);if(this[_0x596b('0xf')][_0x1223f4]){return mailAccount[_0x596b('0x2f')](_0x1223f4,_0x219c74)[_0x596b('0x30')](function(_0x33adff){if(_0x33adff){logger[_0x596b('0xd')](_0x596b('0x31'));}})[_0x596b('0x32')](function(_0x406ad6){logger['error'](_0x596b('0x33'),JSON['stringify'](_0x406ad6));});}};EmailChannel['prototype'][_0x596b('0x25')]=function(_0x114677){if(this[_0x596b('0xf')][_0x114677]&&this[_0x596b('0xf')][_0x114677][_0x596b('0x16')]){if(this[_0x596b('0x10')][this['mailAccounts'][_0x114677][_0x596b('0x16')]['id']]){delete this['imapAccounts'][this[_0x596b('0xf')][_0x114677]['Imap']['id']];}this['mailAccounts'][_0x114677][_0x596b('0x16')]['lastSync']=moment();this['emit'](_0x114677);}};EmailChannel['prototype'][_0x596b('0x27')]=function(_0x27763f,_0x5a3aa5){if(this[_0x596b('0xf')][_0x27763f]){this['mailAccounts'][_0x27763f][_0x596b('0x16')][_0x596b('0x15')]='error';this[_0x596b('0xf')][_0x27763f][_0x596b('0x16')][_0x596b('0x17')]=_0x5a3aa5;return this[_0x596b('0x1a')](_0x27763f);}};EmailChannel[_0x596b('0x12')]['sendMail']=function(_0x3e5dff,_0x35e63b){return this[_0x596b('0x11')][_0x596b('0x34')](_0x3e5dff,_0x35e63b);};EmailChannel[_0x596b('0x12')][_0x596b('0x35')]=function(_0x41d04f){var _0x504076=this;if(this[_0x596b('0xf')][_0x41d04f['id']]){if(_[_0x596b('0x19')](this['mailAccounts'][_0x41d04f['id']][_0x596b('0x36')])){this[_0x596b('0xf')][_0x41d04f['id']][_0x596b('0x36')]={};}this[_0x596b('0xf')][_0x41d04f['id']]['Smtp'][_0x596b('0x37')]=moment();return new BPromise(function(_0x4bc6f1,_0x1f1ed6){return _0x504076[_0x596b('0x11')]['verify'](_0x41d04f)[_0x596b('0x30')](function(_0x284748){_0x504076[_0x596b('0xf')][_0x41d04f['id']]['Smtp'][_0x596b('0x15')]=_0x596b('0x38');_0x504076['mailAccounts'][_0x41d04f['id']][_0x596b('0x36')]['messageStatus']='';_0x504076[_0x596b('0x1a')](_0x41d04f['id']);_0x4bc6f1(_0x284748);})[_0x596b('0x32')](function(_0x3c96e2){_0x504076[_0x596b('0xf')][_0x41d04f['id']]['Smtp'][_0x596b('0x15')]=_0x596b('0x26');_0x504076['mailAccounts'][_0x41d04f['id']][_0x596b('0x36')]['messageStatus']=_0x3c96e2;_0x504076[_0x596b('0x1a')](_0x41d04f['id']);_0x1f1ed6(_0x3c96e2);});});}return this['smtp'][_0x596b('0x39')](_0x41d04f);};module[_0x596b('0x3a')]=EmailChannel;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x73bd=['handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','host','port','tls','autotls','required','openBox','handleOpenBox','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','handleFetchError','handleFetchEnd','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','handleReady','bind','end'];(function(_0x1d8fae,_0x55089c){var _0x12908c=function(_0x5eb27c){while(--_0x5eb27c){_0x1d8fae['push'](_0x1d8fae['shift']());}};_0x12908c(++_0x55089c);}(_0x73bd,0x1e8));var _0xd73b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x73bd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd73b('0x0'));var util=require(_0xd73b('0x1'));var Imap=require(_0xd73b('0x2'));var simpleParser=require('mailparser')[_0xd73b('0x3')];var Iconv=require(_0xd73b('0x4'))[_0xd73b('0x5')];var EventEmitter=require('events')[_0xd73b('0x6')];var utils=require(_0xd73b('0x7'));var logger=require(_0xd73b('0x8'))(_0xd73b('0x9'));function EmailImap(_0x46f13c,_0x4c9973){this[_0xd73b('0xa')]=_0x46f13c['mailbox'];this[_0xd73b('0xb')]=this[_0xd73b('0xc')](_0x46f13c,_0x4c9973);this['imap']=new Imap(this[_0xd73b('0xb')]);this[_0xd73b('0x2')]['once']('ready',this[_0xd73b('0xd')][_0xd73b('0xe')](this));this['imap']['once'](_0xd73b('0xf'),this[_0xd73b('0x10')][_0xd73b('0xe')](this));this[_0xd73b('0x2')]['on'](_0xd73b('0x11'),this[_0xd73b('0x12')][_0xd73b('0xe')](this));this[_0xd73b('0x2')][_0xd73b('0x13')]();}util[_0xd73b('0x14')](EmailImap,EventEmitter);EmailImap[_0xd73b('0x15')][_0xd73b('0xc')]=function(_0x33cc77,_0x52ae54){var _0x591d6c={'connTimeout':_0x33cc77[_0xd73b('0x16')]?_0x33cc77[_0xd73b('0x16')]*0x3e8:0x2710,'authTimeout':_0x33cc77[_0xd73b('0x17')]?_0x33cc77[_0xd73b('0x17')]*0x3e8:0x1388};if(_0x33cc77[_0xd73b('0x18')]){_0x591d6c[_0xd73b('0x19')]=_0x33cc77[_0xd73b('0x19')];if(_0x33cc77[_0xd73b('0x1a')]){_0x591d6c[_0xd73b('0x1b')]=utils[_0xd73b('0x1c')](_0x33cc77[_0xd73b('0x1d')]['data5'],_0x33cc77['user']);}else{_0x591d6c[_0xd73b('0x1e')]=_0x33cc77[_0xd73b('0x1e')];}}else{if(_0x33cc77['authentication']){_0x591d6c[_0xd73b('0x19')]=_0x33cc77[_0xd73b('0x19')];_0x591d6c[_0xd73b('0x1e')]=_0x33cc77['password'];}}_0x591d6c['email']=_0x52ae54||_0x33cc77['user']||'anonymous@xcally.com';_0x591d6c[_0xd73b('0x1f')]=_0x33cc77['host'];_0x591d6c[_0xd73b('0x20')]=_0x33cc77['port']||0x3e1;if(_0x33cc77[_0xd73b('0x21')]){_0x591d6c['tls']=!![];}else{_0x591d6c[_0xd73b('0x21')]=![];_0x591d6c[_0xd73b('0x22')]=_0xd73b('0x23');}return _0x591d6c;};EmailImap[_0xd73b('0x15')][_0xd73b('0xd')]=function(){this[_0xd73b('0x2')][_0xd73b('0x24')](this['mailbox'],![],this[_0xd73b('0x25')][_0xd73b('0xe')](this));};EmailImap[_0xd73b('0x15')][_0xd73b('0x25')]=function(_0x5ddbe2,_0x266d69){if(_0x5ddbe2){this[_0xd73b('0x12')](_0x5ddbe2,!![]);}else{this['emit'](_0xd73b('0x26'),_0x266d69);this[_0xd73b('0x27')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x1b273d){if(_0x1b273d){this[_0xd73b('0x12')](_0x1b273d,!![]);}else{this[_0xd73b('0x2')][_0xd73b('0xf')]();}};EmailImap[_0xd73b('0x15')][_0xd73b('0x27')]=function(){this[_0xd73b('0x2')][_0xd73b('0x28')]([_0xd73b('0x29')],this[_0xd73b('0x2a')]['bind'](this));};EmailImap[_0xd73b('0x15')]['handleReadUnseen']=function(_0x45db82,_0x3eb194){if(_0x45db82){this[_0xd73b('0x12')](_0x45db82,!![]);}else{if(_0x3eb194[_0xd73b('0x2b')]){try{var _0x3f31d4=this['imap'][_0xd73b('0x2c')](_0x3eb194,{'bodies':'','markSeen':!![]});_0x3f31d4['on'](_0xd73b('0x2d'),this[_0xd73b('0x2e')][_0xd73b('0xe')](this));_0x3f31d4[_0xd73b('0x2f')]('error',this[_0xd73b('0x30')][_0xd73b('0xe')](this));_0x3f31d4[_0xd73b('0x2f')]('end',this[_0xd73b('0x31')][_0xd73b('0xe')](this));}catch(_0x2b904c){logger[_0xd73b('0x11')](_0x2b904c);}}else{this[_0xd73b('0x2')]['closeBox'](!![],this[_0xd73b('0x32')][_0xd73b('0xe')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x109973){_0x109973['on'](_0xd73b('0x33'),this['handleMessageBody'][_0xd73b('0xe')](this));_0x109973[_0xd73b('0x2f')](_0xd73b('0x34'),this[_0xd73b('0x35')]['bind'](this));_0x109973['once'](_0xd73b('0xf'),this[_0xd73b('0x36')][_0xd73b('0xe')](this));};EmailImap['prototype'][_0xd73b('0x37')]=function(_0x40292b){simpleParser(_0x40292b,{'Iconv':Iconv},this[_0xd73b('0x38')]['bind'](this));};EmailImap['prototype'][_0xd73b('0x35')]=function(){};EmailImap[_0xd73b('0x15')][_0xd73b('0x36')]=function(){};EmailImap[_0xd73b('0x15')]['handleSimpleParser']=function(_0x39b982,_0x3c66fe){if(_0x39b982){logger[_0xd73b('0x11')](_0x39b982);}else{var _0x1b84d9=this;utils['parser'](this['account'],_0x3c66fe,function(_0x280a0b){_0x1b84d9[_0xd73b('0x39')](_0xd73b('0x9'),_0x280a0b);});}};EmailImap[_0xd73b('0x15')][_0xd73b('0x31')]=function(){this[_0xd73b('0x2')]['closeBox'](!![],this[_0xd73b('0x32')][_0xd73b('0xe')](this));};EmailImap[_0xd73b('0x15')][_0xd73b('0x30')]=function(_0x5426a0){this[_0xd73b('0x12')](_0x5426a0);this[_0xd73b('0x2')]['closeBox'](!![],this[_0xd73b('0x32')][_0xd73b('0xe')](this));};EmailImap['prototype'][_0xd73b('0x10')]=function(){this[_0xd73b('0x39')]('end');};EmailImap['prototype']['handleError']=function(_0x55a133,_0x190db1){logger[_0xd73b('0x11')](_0xd73b('0x12'),this[_0xd73b('0xb')][_0xd73b('0x9')],JSON[_0xd73b('0x3a')](_0x55a133));var _0x187231='';if(_0x55a133){if(_0x55a133[_0xd73b('0x3b')]){_0x187231=_0x55a133['textCode'];}else{for(var _0x1e91d9 in _0x55a133){if(_0x55a133[_0xd73b('0x3c')](_0x1e91d9)){_0x187231+=_[_0xd73b('0x3d')](_0x1e91d9)+':\x20'+_0x55a133[_0x1e91d9]+'\x0a';}}}}if(_0x190db1){this[_0xd73b('0x2')][_0xd73b('0xf')]();}else{this[_0xd73b('0x39')]('error',_0x187231);this[_0xd73b('0x39')]('end');}};module[_0xd73b('0x3e')]=EmailImap;
\ No newline at end of file
+var _0x2fb4=['host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchEnd','stringify','textCode','hasOwnProperty','exports','lodash','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','prototype','connTimeout','authTimeout','user','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com'];(function(_0x421c75,_0x25b84f){var _0x40a1a9=function(_0x423695){while(--_0x423695){_0x421c75['push'](_0x421c75['shift']());}};_0x40a1a9(++_0x25b84f);}(_0x2fb4,0x117));var _0x42fb=function(_0x3ffbec,_0x356c1d){_0x3ffbec=_0x3ffbec-0x0;var _0x54772d=_0x2fb4[_0x3ffbec];return _0x54772d;};'use strict';var _=require(_0x42fb('0x0'));var util=require('util');var Imap=require(_0x42fb('0x1'));var simpleParser=require(_0x42fb('0x2'))[_0x42fb('0x3')];var Iconv=require(_0x42fb('0x4'))[_0x42fb('0x5')];var EventEmitter=require(_0x42fb('0x6'))[_0x42fb('0x7')];var utils=require('./utils');var logger=require(_0x42fb('0x8'))(_0x42fb('0x9'));function EmailImap(_0x5abd57,_0x1b86c4){this['mailbox']=_0x5abd57[_0x42fb('0xa')];this[_0x42fb('0xb')]=this[_0x42fb('0xc')](_0x5abd57,_0x1b86c4);this[_0x42fb('0x1')]=new Imap(this[_0x42fb('0xb')]);this[_0x42fb('0x1')][_0x42fb('0xd')](_0x42fb('0xe'),this[_0x42fb('0xf')][_0x42fb('0x10')](this));this[_0x42fb('0x1')][_0x42fb('0xd')](_0x42fb('0x11'),this[_0x42fb('0x12')][_0x42fb('0x10')](this));this['imap']['on']('error',this[_0x42fb('0x13')][_0x42fb('0x10')](this));this[_0x42fb('0x1')][_0x42fb('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x42fb('0x15')][_0x42fb('0xc')]=function(_0x29e38a,_0x140862){var _0xf19a43={'connTimeout':_0x29e38a[_0x42fb('0x16')]?_0x29e38a[_0x42fb('0x16')]*0x3e8:0x2710,'authTimeout':_0x29e38a[_0x42fb('0x17')]?_0x29e38a[_0x42fb('0x17')]*0x3e8:0x1388};if(_0x29e38a['service']){_0xf19a43[_0x42fb('0x18')]=_0x29e38a[_0x42fb('0x18')];if(_0x29e38a['modernAuthentication']){_0xf19a43['xoauth2']=utils[_0x42fb('0x19')](_0x29e38a[_0x42fb('0x1a')][_0x42fb('0x1b')],_0x29e38a[_0x42fb('0x18')]);}else{_0xf19a43[_0x42fb('0x1c')]=_0x29e38a['password'];}}else{if(_0x29e38a[_0x42fb('0x1d')]){_0xf19a43[_0x42fb('0x18')]=_0x29e38a['user'];_0xf19a43['password']=_0x29e38a[_0x42fb('0x1c')];}}_0xf19a43['email']=_0x140862||_0x29e38a[_0x42fb('0x18')]||_0x42fb('0x1e');_0xf19a43[_0x42fb('0x1f')]=_0x29e38a[_0x42fb('0x1f')];_0xf19a43[_0x42fb('0x20')]=_0x29e38a[_0x42fb('0x20')]||0x3e1;if(_0x29e38a[_0x42fb('0x21')]){_0xf19a43[_0x42fb('0x21')]=!![];}else{_0xf19a43[_0x42fb('0x21')]=![];_0xf19a43[_0x42fb('0x22')]=_0x42fb('0x23');}return _0xf19a43;};EmailImap['prototype'][_0x42fb('0xf')]=function(){this[_0x42fb('0x1')][_0x42fb('0x24')](this[_0x42fb('0xa')],![],this[_0x42fb('0x25')][_0x42fb('0x10')](this));};EmailImap[_0x42fb('0x15')]['handleOpenBox']=function(_0x814dc2,_0x56728e){if(_0x814dc2){this['handleError'](_0x814dc2,!![]);}else{this[_0x42fb('0x26')](_0x42fb('0x27'),_0x56728e);this['readUnseen']();}};EmailImap[_0x42fb('0x15')][_0x42fb('0x28')]=function(_0x138a1a){if(_0x138a1a){this['handleError'](_0x138a1a,!![]);}else{this[_0x42fb('0x1')][_0x42fb('0x11')]();}};EmailImap[_0x42fb('0x15')][_0x42fb('0x29')]=function(){this['imap'][_0x42fb('0x2a')]([_0x42fb('0x2b')],this[_0x42fb('0x2c')][_0x42fb('0x10')](this));};EmailImap[_0x42fb('0x15')][_0x42fb('0x2c')]=function(_0x47c85b,_0x21d108){if(_0x47c85b){this['handleError'](_0x47c85b,!![]);}else{if(_0x21d108[_0x42fb('0x2d')]){try{var _0x4e1702=this[_0x42fb('0x1')][_0x42fb('0x2e')](_0x21d108,{'bodies':'','markSeen':!![]});_0x4e1702['on'](_0x42fb('0x2f'),this[_0x42fb('0x30')][_0x42fb('0x10')](this));_0x4e1702[_0x42fb('0xd')](_0x42fb('0x31'),this[_0x42fb('0x32')][_0x42fb('0x10')](this));_0x4e1702[_0x42fb('0xd')](_0x42fb('0x11'),this['handleFetchEnd'][_0x42fb('0x10')](this));}catch(_0x1eaf80){logger[_0x42fb('0x31')](_0x1eaf80);}}else{this[_0x42fb('0x1')][_0x42fb('0x33')](!![],this[_0x42fb('0x28')]['bind'](this));}}};EmailImap[_0x42fb('0x15')][_0x42fb('0x30')]=function(_0x4920ec){_0x4920ec['on'](_0x42fb('0x34'),this[_0x42fb('0x35')][_0x42fb('0x10')](this));_0x4920ec['once']('attributes',this[_0x42fb('0x36')][_0x42fb('0x10')](this));_0x4920ec[_0x42fb('0xd')](_0x42fb('0x11'),this[_0x42fb('0x37')][_0x42fb('0x10')](this));};EmailImap[_0x42fb('0x15')][_0x42fb('0x35')]=function(_0x2ed757){simpleParser(_0x2ed757,{'Iconv':Iconv},this[_0x42fb('0x38')][_0x42fb('0x10')](this));};EmailImap[_0x42fb('0x15')][_0x42fb('0x36')]=function(){};EmailImap[_0x42fb('0x15')][_0x42fb('0x37')]=function(){};EmailImap[_0x42fb('0x15')][_0x42fb('0x38')]=function(_0x20c05e,_0xbaa7c4){if(_0x20c05e){logger[_0x42fb('0x31')](_0x20c05e);}else{var _0x708803=this;utils['parser'](this['account'],_0xbaa7c4,function(_0x3687dc){_0x708803[_0x42fb('0x26')](_0x42fb('0x9'),_0x3687dc);});}};EmailImap[_0x42fb('0x15')][_0x42fb('0x39')]=function(){this[_0x42fb('0x1')][_0x42fb('0x33')](!![],this[_0x42fb('0x28')][_0x42fb('0x10')](this));};EmailImap[_0x42fb('0x15')][_0x42fb('0x32')]=function(_0x1a4a37){this[_0x42fb('0x13')](_0x1a4a37);this[_0x42fb('0x1')][_0x42fb('0x33')](!![],this['handleCloseBox'][_0x42fb('0x10')](this));};EmailImap[_0x42fb('0x15')][_0x42fb('0x12')]=function(){this[_0x42fb('0x26')](_0x42fb('0x11'));};EmailImap[_0x42fb('0x15')][_0x42fb('0x13')]=function(_0x3bcbfd,_0xdf2005){logger['error'](_0x42fb('0x13'),this[_0x42fb('0xb')][_0x42fb('0x9')],JSON[_0x42fb('0x3a')](_0x3bcbfd));var _0x11ba32='';if(_0x3bcbfd){if(_0x3bcbfd[_0x42fb('0x3b')]){_0x11ba32=_0x3bcbfd[_0x42fb('0x3b')];}else{for(var _0x36a54d in _0x3bcbfd){if(_0x3bcbfd[_0x42fb('0x3c')](_0x36a54d)){_0x11ba32+=_['upperFirst'](_0x36a54d)+':\x20'+_0x3bcbfd[_0x36a54d]+'\x0a';}}}}if(_0xdf2005){this[_0x42fb('0x1')]['end']();}else{this[_0x42fb('0x26')]('error',_0x11ba32);this['emit']('end');}};module[_0x42fb('0x3d')]=EmailImap;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b4a=['compile','sendMail','toString','prototype','verify','exports','nodemailer','send','createTransport'];(function(_0x19567c,_0x3e68a5){var _0x94666b=function(_0x5ab4fa){while(--_0x5ab4fa){_0x19567c['push'](_0x19567c['shift']());}};_0x94666b(++_0x3e68a5);}(_0x1b4a,0xba));var _0xa1b4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1b4a[_0x19e35c];return _0x3e1fe8;};'use strict';var nodemailer=require(_0xa1b4('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xa1b4('0x1')]=function(_0x454d60,_0x66efb3){return new Promise(function(_0x32eb9b,_0x504ff4){var _0x563b12=nodemailer[_0xa1b4('0x2')](_0x454d60);_0x563b12['use'](_0xa1b4('0x3'),inlineBase64());_0x563b12[_0xa1b4('0x4')](_0x66efb3,function(_0x4ee0e3,_0x80fbe7){if(_0x4ee0e3){_0x504ff4(_0x4ee0e3[_0xa1b4('0x5')]());}else{_0x32eb9b(_0x80fbe7);}});});};EmailSmtp[_0xa1b4('0x6')][_0xa1b4('0x7')]=function(_0x863bf3){return new Promise(function(_0x159854,_0x3a91f9){var _0x3d9339=nodemailer[_0xa1b4('0x2')](_0x863bf3);_0x3d9339[_0xa1b4('0x7')](function(_0x546bae,_0x368318){if(_0x546bae){_0x3a91f9(_0x546bae[_0xa1b4('0x5')]());}else{if(_0x368318){_0x159854(_0x368318);}else{_0x3a91f9('Not\x20verifired');}}});});};module[_0xa1b4('0x8')]=EmailSmtp;
\ No newline at end of file
+var _0x4c1d=['createTransport','use','sendMail','toString','Not\x20verifired','prototype','send'];(function(_0x4f51f9,_0x5d5613){var _0x533984=function(_0x578319){while(--_0x578319){_0x4f51f9['push'](_0x4f51f9['shift']());}};_0x533984(++_0x5d5613);}(_0x4c1d,0x1e1));var _0xd4c1=function(_0x2e1641,_0x498589){_0x2e1641=_0x2e1641-0x0;var _0x3747b5=_0x4c1d[_0x2e1641];return _0x3747b5;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xd4c1('0x0')][_0xd4c1('0x1')]=function(_0x59669e,_0x5d8dc7){return new Promise(function(_0x3684af,_0x3085ad){var _0x50fbb0=nodemailer[_0xd4c1('0x2')](_0x59669e);_0x50fbb0[_0xd4c1('0x3')]('compile',inlineBase64());_0x50fbb0[_0xd4c1('0x4')](_0x5d8dc7,function(_0x329e5c,_0x17420c){if(_0x329e5c){_0x3085ad(_0x329e5c[_0xd4c1('0x5')]());}else{_0x3684af(_0x17420c);}});});};EmailSmtp['prototype']['verify']=function(_0x46328d){return new Promise(function(_0x34f443,_0x530469){var _0x382021=nodemailer[_0xd4c1('0x2')](_0x46328d);_0x382021['verify'](function(_0xa05c0,_0x17f0fc){if(_0xa05c0){_0x530469(_0xa05c0[_0xd4c1('0x5')]());}else{if(_0x17f0fc){_0x34f443(_0x17f0fc);}else{_0x530469(_0xd4c1('0x6'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x448b=['content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','<p>Empty\x20message</p>','Attachments','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','Anonymous','split','length','pop','isEmpty','html','replace','includes','attachments','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','join','writeFileSync'];(function(_0x552938,_0x1e4ca2){var _0x1fb613=function(_0x4e06e6){while(--_0x4e06e6){_0x552938['push'](_0x552938['shift']());}};_0x1fb613(++_0x1e4ca2);}(_0x448b,0xf1));var _0xb448=function(_0x1e114c,_0x420fb6){_0x1e114c=_0x1e114c-0x0;var _0x4c2ac9=_0x448b[_0x1e114c];return _0x4c2ac9;};'use strict';var _=require(_0xb448('0x0'));var moment=require(_0xb448('0x1'));var random=require(_0xb448('0x2'));var fs=require('fs');var path=require(_0xb448('0x3'));var util=require(_0xb448('0x4'));var tnef=require(_0xb448('0x5'));var logger=require(_0xb448('0x6'))(_0xb448('0x7'));var config=require(_0xb448('0x8'));function getAddress(_0x576a2f){var _0xf21e41=_[_0xb448('0x9')](_0x576a2f[_0xb448('0xa')]);return _0xf21e41&&_0xf21e41[_0xb448('0xb')]?_0xf21e41[_0xb448('0xb')]:_0xb448('0xc')+random[_0xb448('0xd')](0x6)+_0xb448('0xe');}function getFirstName(_0x47ef68){var _0x57bb32=_[_0xb448('0x9')](_0x47ef68[_0xb448('0xa')]);if(_0x57bb32&&_0x57bb32[_0xb448('0xf')]){if(_0x57bb32[_0xb448('0xf')]==_0x57bb32[_0xb448('0xb')]){return _0x57bb32[_0xb448('0xf')][_0xb448('0x10')](0x0,_0x57bb32[_0xb448('0xf')]['indexOf']('@'));}var _0x520a6f=_0x57bb32[_0xb448('0xf')]['split'](/\s+/);return _0x520a6f['length']>0x1?_0x520a6f['slice'](0x0,-0x1)['join']('\x20'):_0x57bb32['name'];}return _0xb448('0x11');}function getLastName(_0x212674){var _0x1c0893=_[_0xb448('0x9')](_0x212674[_0xb448('0xa')]);if(_0x1c0893&&_0x1c0893[_0xb448('0xf')]){var _0x434c63=_0x1c0893['name'][_0xb448('0x12')](/\s+/);return _0x434c63[_0xb448('0x13')]>0x1?_0x434c63[_0xb448('0x14')]():'';}return'';}function getMails(_0x1b4c9e,_0x23e3ee){var _0x22ab58='';for(var _0x5b5993=0x0;_0x5b5993<_0x23e3ee[_0xb448('0xa')][_0xb448('0x13')];_0x5b5993+=0x1){if(_0x23e3ee[_0xb448('0xa')][_0x5b5993][_0xb448('0xb')]!==_0x1b4c9e){if(!_[_0xb448('0x15')](_0x22ab58)){_0x22ab58+=',';}_0x22ab58+=_0x23e3ee['value'][_0x5b5993]['name']||_0x23e3ee[_0xb448('0xa')][_0x5b5993]['address']||'';_0x22ab58+='\x20<';_0x22ab58+=_0x23e3ee[_0xb448('0xa')][_0x5b5993][_0xb448('0xb')]?_0x23e3ee[_0xb448('0xa')][_0x5b5993][_0xb448('0xb')]:_0xb448('0xc')+random['generate'](0x6)+_0xb448('0xe');_0x22ab58+='>';}}return _0x22ab58;}function parseEmail(_0x5f440a,_0x551838,_0x264ca8){if(_0x551838[_0xb448('0x16')]){var _0x1024d3=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1024d3['test'](_0x551838['html'])){_0x551838[_0xb448('0x16')]=_0x551838[_0xb448('0x16')][_0xb448('0x17')](_0x1024d3,'');}if(_0x551838[_0xb448('0x16')][_0xb448('0x18')]('<img')){var _0x4c46e4=[];_0x551838[_0xb448('0x19')]['forEach'](_0x2fb744=>{_0x4c46e4[_0xb448('0x1a')](_0x2fb744[_0xb448('0x1b')]);});var _0x4f68ea=/<img.*? _SRC(.*?)[^>]+>/g;var _0x416506=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x209df0=_0x551838['html'][_0xb448('0x17')](_0x416506,_0xb448('0x1c'));var _0x5ed3fe=_0x209df0[_0xb448('0x17')](_0x4f68ea,_0xb448('0x1d'));for(let _0x2a2084=0x0;_0x2a2084<_0x4c46e4[_0xb448('0x13')];_0x2a2084++){var _0x458297=_0x5ed3fe[_0xb448('0x17')](_0xb448('0x1d'),_0xb448('0x1e')+_0x4c46e4[_0x2a2084]+_0xb448('0x1f'));_0x5ed3fe=_0x458297;}_0x551838[_0xb448('0x16')]=_0x5ed3fe;}_0x264ca8[_0xb448('0x20')]=_0x551838[_0xb448('0x16')];}else{_0x264ca8['body']=_0x551838[_0xb448('0x21')];}if(_0x264ca8[_0xb448('0x20')]){_0x264ca8[_0xb448('0x20')]=_0x264ca8['body'][_0xb448('0x17')](/<a\s+/gi,_0xb448('0x22'));}if(_0x551838['to']){_0x264ca8['message'][_0xb448('0x23')]=getMails(null,_0x551838['to']);var _0x4ecab3=getMails(_0x5f440a[_0xb448('0x7')],_0x551838['to']);if(!_['isEmpty'](_0x4ecab3)){_0x264ca8['message']['cc']+=_0x4ecab3;}}if(_0x551838['cc']){_0x264ca8[_0xb448('0x24')]['originCc']=getMails(null,_0x551838['cc']);var _0x1db423=getMails(_0x5f440a[_0xb448('0x7')],_0x551838['cc']);if(!_['isEmpty'](_0x1db423)){if(!_[_0xb448('0x15')](_0x264ca8[_0xb448('0x24')]['cc'])){_0x264ca8[_0xb448('0x24')]['cc']+=',';}_0x264ca8[_0xb448('0x24')]['cc']+=_0x1db423;}}if(!_[_0xb448('0x18')](_0x264ca8[_0xb448('0x24')]['originTo'],_0x5f440a[_0xb448('0x7')])&&!_[_0xb448('0x18')](_0x264ca8['message'][_0xb448('0x25')],_0x5f440a[_0xb448('0x7')])){_0x264ca8[_0xb448('0x24')][_0xb448('0x26')]=_0x5f440a[_0xb448('0x7')];}if(_0x551838[_0xb448('0x19')]&&_0x551838[_0xb448('0x19')][_0xb448('0x13')]){_0x264ca8[_0xb448('0x24')][_0xb448('0x27')]=_0x551838[_0xb448('0x19')]['length'];for(var _0x1d7b38=0x0,_0x39a8c6,_0x48737f,_0x19dc30;_0x1d7b38<_0x551838['attachments'][_0xb448('0x13')];_0x1d7b38+=0x1){if(_0x551838[_0xb448('0x19')][_0x1d7b38][_0xb448('0x28')]===_0xb448('0x29')){_0x19dc30=_0x551838[_0xb448('0x19')][_0x1d7b38][_0xb448('0x1b')]||_0xb448('0x2a')+_0x1d7b38;_0x39a8c6=util[_0xb448('0x2b')](_0xb448('0x2c'),Date['now'](),_0x19dc30);_0x48737f=path[_0xb448('0x2d')](config['root'],'server/files/attachments/',_0x39a8c6);fs[_0xb448('0x2e')](_0x48737f,_0x551838[_0xb448('0x19')][_0x1d7b38][_0xb448('0x2f')]);_0x264ca8[_0xb448('0x24')][_0xb448('0x19')][_0xb448('0x1a')]({'name':_0x19dc30,'basename':_0x39a8c6,'type':_0x551838['attachments'][_0x1d7b38]['contentType'],'filepath':_0x48737f});}}}if(_0x551838[_0xb448('0x30')]&&_0x551838['headerLines'][_0xb448('0x13')]>0x0){var _0x38f81a=[_0xb448('0x31'),'X-Auto-Response-Suppress:\x20All',_0xb448('0x32')];for(var _0x41f502=0x0;_0x41f502<_0x551838[_0xb448('0x30')][_0xb448('0x13')];_0x41f502++){var _0x54df94=_[_0xb448('0x33')](_0x38f81a,_0x551838[_0xb448('0x30')][_0x41f502][_0xb448('0x34')]);if(_0x54df94>=0x0){_0x264ca8[_0xb448('0x35')]=!![];}}}return _0x264ca8;}exports[_0xb448('0x36')]=function(_0x120e11,_0x3a1fdc,_0x51f426){var _0x5d436c={'from':getAddress(_0x3a1fdc[_0xb448('0x37')]),'firstName':getFirstName(_0x3a1fdc[_0xb448('0x37')]),'lastName':getLastName(_0x3a1fdc[_0xb448('0x37')]),'mapKey':_0xb448('0x7'),'message':{'from':getMails(_0x120e11['email'],_0x3a1fdc[_0xb448('0x37')]),'to':_0x120e11['email'],'cc':'','subject':_0x3a1fdc[_0xb448('0x38')]||'','messageId':_0x3a1fdc['messageId'],'inReplyTo':_0x3a1fdc['inReplyTo'],'sentAt':moment(_0x3a1fdc[_0xb448('0x39')])['format'](_0xb448('0x3a')),'attach':![],'attachments':[]}};if(!_0x3a1fdc['html']&&!_0x3a1fdc[_0xb448('0x21')]){var _0x1c0421=_[_0xb448('0x3b')](_0x3a1fdc[_0xb448('0x19')],{'contentType':_0xb448('0x3c')});if(_0x1c0421[_0xb448('0x13')]){logger[_0xb448('0x3d')](util[_0xb448('0x2b')](_0xb448('0x3e'),_0x3a1fdc[_0xb448('0x3f')]));tnef['parseBuffer'](_[_0xb448('0x40')](_0x1c0421)[_0xb448('0x2f')],function(_0x50afd6,_0x5e910e){if(_0x5e910e){_0x3a1fdc[_0xb448('0x16')]=_0x5e910e['BodyHTML']||_0xb448('0x41');if(_0x5e910e[_0xb448('0x42')]){for(var _0x35fd8f=0x0;_0x35fd8f<_0x5e910e[_0xb448('0x42')][_0xb448('0x13')];_0x35fd8f++){var _0xb0fe71=_0x5e910e[_0xb448('0x42')][_0x35fd8f];_0x5d436c[_0xb448('0x24')][_0xb448('0x19')]['push']({'filename':_0xb0fe71['Title'],'content':Buffer['from'](_0xb0fe71['Data'])});}}}_0x51f426(parseEmail(_0x120e11,_0x3a1fdc,_0x5d436c));});}else{_0x3a1fdc[_0xb448('0x16')]=_0xb448('0x41');_0x51f426(parseEmail(_0x120e11,_0x3a1fdc,_0x5d436c));}}else{_0x51f426(parseEmail(_0x120e11,_0x3a1fdc,_0x5d436c));}};exports[_0xb448('0x43')]=function(_0x547845,_0x208eac){var _0x197db2=[_0xb448('0x44')+(_0x208eac||''),'auth=Bearer\x20'+_0x547845,'',''];return Buffer[_0xb448('0x37')](_0x197db2['join']('\ 1'),_0xb448('0x45'))[_0xb448('0x46')](_0xb448('0x47'));};
\ No newline at end of file
+var _0x4225=['../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','test','html','replace','includes','<img','attachments','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','message','bcc','attach','type','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','messageId','inReplyTo','textAsHtml','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email'];(function(_0x2ffb0d,_0xaf58da){var _0x547fdf=function(_0x83f8df){while(--_0x83f8df){_0x2ffb0d['push'](_0x2ffb0d['shift']());}};_0x547fdf(++_0xaf58da);}(_0x4225,0xd4));var _0x5422=function(_0x54d100,_0x147037){_0x54d100=_0x54d100-0x0;var _0x538ce2=_0x4225[_0x54d100];return _0x538ce2;};'use strict';var _=require(_0x5422('0x0'));var moment=require(_0x5422('0x1'));var random=require(_0x5422('0x2'));var fs=require('fs');var path=require(_0x5422('0x3'));var util=require('util');var tnef=require(_0x5422('0x4'));var logger=require(_0x5422('0x5'))(_0x5422('0x6'));var config=require(_0x5422('0x7'));function getAddress(_0xbfa0){var _0x13026e=_[_0x5422('0x8')](_0xbfa0['value']);return _0x13026e&&_0x13026e[_0x5422('0x9')]?_0x13026e['address']:_0x5422('0xa')+random[_0x5422('0xb')](0x6)+_0x5422('0xc');}function getFirstName(_0x2a4e8a){var _0x37ef21=_['head'](_0x2a4e8a[_0x5422('0xd')]);if(_0x37ef21&&_0x37ef21['name']){if(_0x37ef21[_0x5422('0xe')]==_0x37ef21[_0x5422('0x9')]){return _0x37ef21[_0x5422('0xe')]['substring'](0x0,_0x37ef21[_0x5422('0xe')][_0x5422('0xf')]('@'));}var _0x4aaf70=_0x37ef21[_0x5422('0xe')][_0x5422('0x10')](/\s+/);return _0x4aaf70[_0x5422('0x11')]>0x1?_0x4aaf70[_0x5422('0x12')](0x0,-0x1)[_0x5422('0x13')]('\x20'):_0x37ef21[_0x5422('0xe')];}return _0x5422('0x14');}function getLastName(_0x15cfca){var _0x1358fb=_[_0x5422('0x8')](_0x15cfca['value']);if(_0x1358fb&&_0x1358fb[_0x5422('0xe')]){var _0x1cbc7e=_0x1358fb[_0x5422('0xe')][_0x5422('0x10')](/\s+/);return _0x1cbc7e['length']>0x1?_0x1cbc7e[_0x5422('0x15')]():'';}return'';}function getMails(_0x12b1bc,_0x4f3f97){var _0x4a946e='';for(var _0x414efb=0x0;_0x414efb<_0x4f3f97[_0x5422('0xd')]['length'];_0x414efb+=0x1){if(_0x4f3f97[_0x5422('0xd')][_0x414efb][_0x5422('0x9')]!==_0x12b1bc){if(!_[_0x5422('0x16')](_0x4a946e)){_0x4a946e+=',';}_0x4a946e+=_0x4f3f97[_0x5422('0xd')][_0x414efb][_0x5422('0xe')]||_0x4f3f97[_0x5422('0xd')][_0x414efb][_0x5422('0x9')]||'';_0x4a946e+='\x20<';_0x4a946e+=_0x4f3f97['value'][_0x414efb][_0x5422('0x9')]?_0x4f3f97[_0x5422('0xd')][_0x414efb][_0x5422('0x9')]:_0x5422('0xa')+random[_0x5422('0xb')](0x6)+_0x5422('0xc');_0x4a946e+='>';}}return _0x4a946e;}function parseEmail(_0x3fc653,_0x54e821,_0x46cb10){if(_0x54e821['html']){var _0x83d3cc=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x83d3cc[_0x5422('0x17')](_0x54e821[_0x5422('0x18')])){_0x54e821[_0x5422('0x18')]=_0x54e821['html'][_0x5422('0x19')](_0x83d3cc,'');}if(_0x54e821[_0x5422('0x18')][_0x5422('0x1a')](_0x5422('0x1b'))){var _0x3e1fbb=[];_0x54e821[_0x5422('0x1c')]['forEach'](_0xc2aae9=>{_0x3e1fbb[_0x5422('0x1d')](_0xc2aae9[_0x5422('0x1e')]);});var _0x2025b1=/<img.*? _SRC(.*?)[^>]+>/g;var _0x56a0a6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5bd9e6=_0x54e821[_0x5422('0x18')][_0x5422('0x19')](_0x56a0a6,_0x5422('0x1f'));var _0x423b7c=_0x5bd9e6['replace'](_0x2025b1,_0x5422('0x20'));for(let _0xccee09=0x0;_0xccee09<_0x3e1fbb[_0x5422('0x11')];_0xccee09++){var _0x55c313=_0x423b7c[_0x5422('0x19')](_0x5422('0x20'),_0x5422('0x21')+_0x3e1fbb[_0xccee09]+_0x5422('0x22'));_0x423b7c=_0x55c313;}_0x54e821[_0x5422('0x18')]=_0x423b7c;}_0x46cb10[_0x5422('0x23')]=_0x54e821[_0x5422('0x18')];}else{_0x46cb10['body']=_0x54e821['textAsHtml'];}if(_0x46cb10['body']){_0x46cb10[_0x5422('0x23')]=_0x46cb10[_0x5422('0x23')][_0x5422('0x19')](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x54e821['to']){_0x46cb10[_0x5422('0x24')]['originTo']=getMails(null,_0x54e821['to']);var _0x3d2842=getMails(_0x3fc653[_0x5422('0x6')],_0x54e821['to']);if(!_[_0x5422('0x16')](_0x3d2842)){_0x46cb10[_0x5422('0x24')]['cc']+=_0x3d2842;}}if(_0x54e821['cc']){_0x46cb10[_0x5422('0x24')]['originCc']=getMails(null,_0x54e821['cc']);var _0x4df98b=getMails(_0x3fc653[_0x5422('0x6')],_0x54e821['cc']);if(!_[_0x5422('0x16')](_0x4df98b)){if(!_[_0x5422('0x16')](_0x46cb10['message']['cc'])){_0x46cb10['message']['cc']+=',';}_0x46cb10[_0x5422('0x24')]['cc']+=_0x4df98b;}}if(!_[_0x5422('0x1a')](_0x46cb10[_0x5422('0x24')]['originTo'],_0x3fc653['email'])&&!_['includes'](_0x46cb10['message']['originCc'],_0x3fc653['email'])){_0x46cb10[_0x5422('0x24')][_0x5422('0x25')]=_0x3fc653[_0x5422('0x6')];}if(_0x54e821[_0x5422('0x1c')]&&_0x54e821[_0x5422('0x1c')][_0x5422('0x11')]){_0x46cb10[_0x5422('0x24')][_0x5422('0x26')]=_0x54e821[_0x5422('0x1c')][_0x5422('0x11')];for(var _0x5d53e5=0x0,_0x49aa50,_0x99e0b9,_0x25eb0a;_0x5d53e5<_0x54e821[_0x5422('0x1c')][_0x5422('0x11')];_0x5d53e5+=0x1){if(_0x54e821[_0x5422('0x1c')][_0x5d53e5][_0x5422('0x27')]===_0x5422('0x28')){_0x25eb0a=_0x54e821[_0x5422('0x1c')][_0x5d53e5][_0x5422('0x1e')]||_0x5422('0x29')+_0x5d53e5;_0x49aa50=util[_0x5422('0x2a')](_0x5422('0x2b'),Date[_0x5422('0x2c')](),_0x25eb0a);_0x99e0b9=path[_0x5422('0x13')](config[_0x5422('0x2d')],_0x5422('0x2e'),_0x49aa50);fs[_0x5422('0x2f')](_0x99e0b9,_0x54e821[_0x5422('0x1c')][_0x5d53e5]['content']);_0x46cb10[_0x5422('0x24')][_0x5422('0x1c')][_0x5422('0x1d')]({'name':_0x25eb0a,'basename':_0x49aa50,'type':_0x54e821['attachments'][_0x5d53e5][_0x5422('0x30')],'filepath':_0x99e0b9});}}}if(_0x54e821[_0x5422('0x31')]&&_0x54e821[_0x5422('0x31')]['length']>0x0){var _0x4cc2d3=['Auto-Submitted:\x20auto-replied',_0x5422('0x32'),_0x5422('0x33')];for(var _0x597662=0x0;_0x597662<_0x54e821['headerLines'][_0x5422('0x11')];_0x597662++){var _0x4a2cf8=_[_0x5422('0xf')](_0x4cc2d3,_0x54e821[_0x5422('0x31')][_0x597662][_0x5422('0x34')]);if(_0x4a2cf8>=0x0){_0x46cb10['isAutoreply']=!![];}}}return _0x46cb10;}exports[_0x5422('0x35')]=function(_0x17018b,_0x18ade5,_0x2633ce){var _0x267b31={'from':getAddress(_0x18ade5[_0x5422('0x36')]),'firstName':getFirstName(_0x18ade5[_0x5422('0x36')]),'lastName':getLastName(_0x18ade5[_0x5422('0x36')]),'mapKey':_0x5422('0x6'),'message':{'from':getMails(_0x17018b[_0x5422('0x6')],_0x18ade5[_0x5422('0x36')]),'to':_0x17018b[_0x5422('0x6')],'cc':'','subject':_0x18ade5['subject']||'','messageId':_0x18ade5[_0x5422('0x37')],'inReplyTo':_0x18ade5[_0x5422('0x38')],'sentAt':moment(_0x18ade5['date'])[_0x5422('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x18ade5[_0x5422('0x18')]&&!_0x18ade5[_0x5422('0x39')]){var _0x3187e2=_[_0x5422('0x3a')](_0x18ade5[_0x5422('0x1c')],{'contentType':'application/ms-tnef'});if(_0x3187e2[_0x5422('0x11')]){logger[_0x5422('0x3b')](util[_0x5422('0x2a')](_0x5422('0x3c'),_0x18ade5[_0x5422('0x37')]));tnef['parseBuffer'](_[_0x5422('0x3d')](_0x3187e2)[_0x5422('0x3e')],function(_0x3e8fb8,_0x53d326){if(_0x53d326){_0x18ade5['html']=_0x53d326[_0x5422('0x3f')]||_0x5422('0x40');if(_0x53d326[_0x5422('0x41')]){for(var _0x523ed6=0x0;_0x523ed6<_0x53d326['Attachments'][_0x5422('0x11')];_0x523ed6++){var _0x49c79e=_0x53d326[_0x5422('0x41')][_0x523ed6];_0x267b31[_0x5422('0x24')]['attachments']['push']({'filename':_0x49c79e[_0x5422('0x42')],'content':Buffer[_0x5422('0x36')](_0x49c79e[_0x5422('0x43')])});}}}_0x2633ce(parseEmail(_0x17018b,_0x18ade5,_0x267b31));});}else{_0x18ade5[_0x5422('0x18')]=_0x5422('0x40');_0x2633ce(parseEmail(_0x17018b,_0x18ade5,_0x267b31));}}else{_0x2633ce(parseEmail(_0x17018b,_0x18ade5,_0x267b31));}};exports[_0x5422('0x44')]=function(_0x499c30,_0x90eaa1){var _0x334536=[_0x5422('0x45')+(_0x90eaa1||''),_0x5422('0x46')+_0x499c30,'',''];return Buffer['from'](_0x334536[_0x5422('0x13')]('\ 1'),_0x5422('0x47'))['toString'](_0x5422('0x48'));};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d36=['lodash','name','Service','key','active','Imap','Smtp','exports'];(function(_0x4c8220,_0x3ca184){var _0x2e2e20=function(_0x4da51f){while(--_0x4da51f){_0x4c8220['push'](_0x4c8220['shift']());}};_0x2e2e20(++_0x3ca184);}(_0x5d36,0xb0));var _0x65d3=function(_0x280fba,_0x32db4d){_0x280fba=_0x280fba-0x0;var _0x5225b8=_0x5d36[_0x280fba];return _0x5225b8;};'use strict';var _=require(_0x65d3('0x0'));function MailAccount(_0x1fc810){this['id']=_0x1fc810['id']||0x0;this['name']=_0x1fc810[_0x65d3('0x1')]||_0x65d3('0x2');this[_0x65d3('0x3')]=_0x1fc810[_0x65d3('0x3')]||'SERV';this[_0x65d3('0x4')]=_0x1fc810[_0x65d3('0x4')]||![];this[_0x65d3('0x5')]=_0x1fc810[_0x65d3('0x5')]||[];this[_0x65d3('0x6')]=_0x1fc810[_0x65d3('0x6')]||[];}module[_0x65d3('0x7')]=MailAccount;
\ No newline at end of file
+var _0xb21d=['SERV','active','Imap','Smtp','exports','name','Service','key'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb21d,0x17d));var _0xdb21=function(_0x524149,_0x3349d9){_0x524149=_0x524149-0x0;var _0x1d2170=_0xb21d[_0x524149];return _0x1d2170;};'use strict';var _=require('lodash');function MailAccount(_0x421d20){this['id']=_0x421d20['id']||0x0;this[_0xdb21('0x0')]=_0x421d20['name']||_0xdb21('0x1');this['key']=_0x421d20[_0xdb21('0x2')]||_0xdb21('0x3');this[_0xdb21('0x4')]=_0x421d20['active']||![];this[_0xdb21('0x5')]=_0x421d20['Imap']||[];this[_0xdb21('0x6')]=_0x421d20[_0xdb21('0x6')]||[];}module[_0xdb21('0x7')]=MailAccount;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b66=['mergeFromDatabase','length','isUndefined','merge','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x55ab47,_0x2fa34d){var _0x5833dc=function(_0x3dfe79){while(--_0x3dfe79){_0x55ab47['push'](_0x55ab47['shift']());}};_0x5833dc(++_0x2fa34d);}(_0x2b66,0x14c));var _0x62b6=function(_0x573faf,_0xc1b84){_0x573faf=_0x573faf-0x0;var _0x47e7e6=_0x2b66[_0x573faf];return _0x47e7e6;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x62b6('0x0')]={};};function freeIsNotKey(_0x4e481e,_0x2d8f5c,_0x339b01){var _0x303053=_[_0x62b6('0x1')](_0x4e481e,function(_0x3215ea,_0x596c8d){return _0x3215ea[_0x339b01];});for(var _0x44a37d in _0x2d8f5c){if(_0x2d8f5c[_0x62b6('0x2')](_0x44a37d)){if(!_0x303053[_0x44a37d]){delete _0x2d8f5c[_0x44a37d];}}}}Realtime[_0x62b6('0x3')][_0x62b6('0x4')]=function(_0x3b95ef,_0x39b44a){for(var _0x4d2790 in _0x39b44a){if(_0x3b95ef[_0x62b6('0x2')](_0x4d2790)){_0x3b95ef[_0x4d2790]=_0x39b44a[_0x4d2790];}}};Realtime[_0x62b6('0x3')]['initMailAccounts']=function(){var _0x181d6e=this;return function(_0x4eb0bb){if(_0x4eb0bb){freeIsNotKey(_0x4eb0bb,_0x181d6e[_0x62b6('0x0')],'id');for(var _0x20e3b5=0x0,_0x17d976={},_0x2e2030={};_0x20e3b5<_0x4eb0bb[_0x62b6('0x5')];_0x20e3b5+=0x1){_0x17d976=_0x4eb0bb[_0x20e3b5];if(_[_0x62b6('0x6')](_0x181d6e['mailAccounts'][_0x17d976['id']])){_0x181d6e[_0x62b6('0x0')][_0x17d976['id']]=new MailAccount(_0x17d976);}else{_[_0x62b6('0x7')](_0x181d6e[_0x62b6('0x0')][_0x17d976['id']],_0x17d976);}}}return _0x181d6e['mailAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x2172=['length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x4cefee,_0xabb91e){var _0x473af2=function(_0x51e8ad){while(--_0x51e8ad){_0x4cefee['push'](_0x4cefee['shift']());}};_0x473af2(++_0xabb91e);}(_0x2172,0x88));var _0x2217=function(_0x679b6e,_0x26bfbf){_0x679b6e=_0x679b6e-0x0;var _0x2cc8e3=_0x2172[_0x679b6e];return _0x2cc8e3;};'use strict';var _=require(_0x2217('0x0'));var MailAccount=require(_0x2217('0x1'));var Realtime=function(){this[_0x2217('0x2')]={};};function freeIsNotKey(_0x3b1fe7,_0x3f0bf4,_0x4bd692){var _0x56952f=_[_0x2217('0x3')](_0x3b1fe7,function(_0x407070,_0x223cb8){return _0x407070[_0x4bd692];});for(var _0xf48dbe in _0x3f0bf4){if(_0x3f0bf4[_0x2217('0x4')](_0xf48dbe)){if(!_0x56952f[_0xf48dbe]){delete _0x3f0bf4[_0xf48dbe];}}}}Realtime[_0x2217('0x5')][_0x2217('0x6')]=function(_0x4791ca,_0x82018){for(var _0x5a57f2 in _0x82018){if(_0x4791ca[_0x2217('0x4')](_0x5a57f2)){_0x4791ca[_0x5a57f2]=_0x82018[_0x5a57f2];}}};Realtime[_0x2217('0x5')]['initMailAccounts']=function(){var _0x2e4174=this;return function(_0x1d1c56){if(_0x1d1c56){freeIsNotKey(_0x1d1c56,_0x2e4174[_0x2217('0x2')],'id');for(var _0x1ae936=0x0,_0x309565={},_0x1c4ae3={};_0x1ae936<_0x1d1c56[_0x2217('0x7')];_0x1ae936+=0x1){_0x309565=_0x1d1c56[_0x1ae936];if(_[_0x2217('0x8')](_0x2e4174[_0x2217('0x2')][_0x309565['id']])){_0x2e4174[_0x2217('0x2')][_0x309565['id']]=new MailAccount(_0x309565);}else{_[_0x2217('0x9')](_0x2e4174['mailAccounts'][_0x309565['id']],_0x309565);}}}return _0x2e4174[_0x2217('0x2')];};};module[_0x2217('0xa')]=Realtime;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x67d5=['key','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','name','service','email','active'];(function(_0x543ef9,_0x56e805){var _0x19146c=function(_0x2bffc8){while(--_0x2bffc8){_0x543ef9['push'](_0x543ef9['shift']());}};_0x19146c(++_0x56e805);}(_0x67d5,0x18a));var _0x567d=function(_0x1c4e92,_0x3c9679){_0x1c4e92=_0x1c4e92-0x0;var _0x5551d8=_0x67d5[_0x1c4e92];return _0x5551d8;};'use strict';var client=require('../client');exports[_0x567d('0x0')]=function(){return function(){return client[_0x567d('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x567d('0x2'),'provider',_0x567d('0x3'),_0x567d('0x4'),_0x567d('0x5'),_0x567d('0x6'),_0x567d('0x7'),_0x567d('0x8')],'raw':![],'include':[{'model':_0x567d('0x9'),'as':'Imap','include':[{'model':_0x567d('0xa'),'attributes':['id',_0x567d('0x2'),_0x567d('0x3'),_0x567d('0xb'),_0x567d('0xc')],'as':_0x567d('0xa')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x567d('0xa'),'attributes':['id',_0x567d('0x2'),_0x567d('0x3'),_0x567d('0xb'),_0x567d('0xc')],'as':_0x567d('0xa')}]}]},'log':_0x567d('0xd')});};};exports[_0x567d('0xe')]=function(_0x51d021,_0xd02cdc){return client[_0x567d('0x1')](_0x567d('0xf'),{'account':{'id':_0x51d021},'body':_0xd02cdc,'log':_0x567d('0xf')});};
\ No newline at end of file
+var _0x4d87=['MailServerOut','Smtp','name','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','provider','service','key','ListId','TemplateId','MailServerIn','type','data5','CloudProvider'];(function(_0x7577b9,_0x4fe21c){var _0x2660c8=function(_0x3f94ae){while(--_0x3f94ae){_0x7577b9['push'](_0x7577b9['shift']());}};_0x2660c8(++_0x4fe21c);}(_0x4d87,0xf0));var _0x74d8=function(_0x2657ef,_0xefccca){_0x2657ef=_0x2657ef-0x0;var _0x11523b=_0x4d87[_0x2657ef];return _0x11523b;};'use strict';var client=require('../client');exports[_0x74d8('0x0')]=function(){return function(){return client[_0x74d8('0x1')](_0x74d8('0x2'),{'options':{'attributes':['id','name',_0x74d8('0x3'),_0x74d8('0x4'),'email','active',_0x74d8('0x5'),_0x74d8('0x6'),_0x74d8('0x7')],'raw':![],'include':[{'model':_0x74d8('0x8'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id','name',_0x74d8('0x4'),_0x74d8('0x9'),_0x74d8('0xa')],'as':_0x74d8('0xb')}]},{'model':_0x74d8('0xc'),'as':_0x74d8('0xd'),'include':[{'model':'CloudProvider','attributes':['id',_0x74d8('0xe'),_0x74d8('0x4'),_0x74d8('0x9'),_0x74d8('0xa')],'as':_0x74d8('0xb')}]}]},'log':_0x74d8('0xf')});};};exports[_0x74d8('0x10')]=function(_0x1192b7,_0x1ba1e5){return client['Request'](_0x74d8('0x11'),{'account':{'id':_0x1192b7},'body':_0x1ba1e5,'log':_0x74d8('0x11')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49f9=['GetSettings','../client','getSettings','ShowSetting','loginMailFrequency'];(function(_0x16258f,_0x5aca38){var _0x36e311=function(_0x21e61f){while(--_0x21e61f){_0x16258f['push'](_0x16258f['shift']());}};_0x36e311(++_0x5aca38);}(_0x49f9,0x79));var _0x949f=function(_0x20a68a,_0x54502e){_0x20a68a=_0x20a68a-0x0;var _0x56c5d4=_0x49f9[_0x20a68a];return _0x56c5d4;};'use strict';var client=require(_0x949f('0x0'));exports[_0x949f('0x1')]=function(){return client['Request'](_0x949f('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x949f('0x3')]},'log':_0x949f('0x4')});};
\ No newline at end of file
+var _0x32ee=['loginMailFrequency','GetSettings','getSettings','Request','ShowSetting'];(function(_0x2cf757,_0x3f5ae4){var _0x33d6ec=function(_0x274ea7){while(--_0x274ea7){_0x2cf757['push'](_0x2cf757['shift']());}};_0x33d6ec(++_0x3f5ae4);}(_0x32ee,0xa2));var _0xe32e=function(_0x231f56,_0x49eff1){_0x231f56=_0x231f56-0x0;var _0x2ccf8c=_0x32ee[_0x231f56];return _0x2ccf8c;};'use strict';var client=require('../client');exports[_0xe32e('0x0')]=function(){return client[_0xe32e('0x1')](_0xe32e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe32e('0x3')]},'log':_0xe32e('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd96=['../../config/environment','timeout','listen','port','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis'];(function(_0x300819,_0x52a28c){var _0x428245=function(_0x40a9b2){while(--_0x40a9b2){_0x300819['push'](_0x300819['shift']());}};_0x428245(++_0x52a28c);}(_0xdd96,0x133));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6dd9('0x0'));var http=require(_0x6dd9('0x1'));var express=require(_0x6dd9('0x2'));var sticky=require(_0x6dd9('0x3'));var Redis=require(_0x6dd9('0x4'));var config=require(_0x6dd9('0x5'));var app=express();var server=http['createServer'](app);server[_0x6dd9('0x6')]=0xdbba0;if(sticky[_0x6dd9('0x7')](server,config[_0x6dd9('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x6dd9('0x9'),_0x6dd9('0xa')]});config[_0x6dd9('0xb')]=_[_0x6dd9('0xc')](config[_0x6dd9('0xb')],{'host':_0x6dd9('0xd'),'port':0x18eb});socketio['adapter'](require(_0x6dd9('0xe'))({'pubClient':new Redis(config[_0x6dd9('0xb')]),'subClient':new Redis(config['redis'])}));require(_0x6dd9('0xf'))[_0x6dd9('0x10')]();require(_0x6dd9('0x11'))['default'](socketio);require(_0x6dd9('0x12'))[_0x6dd9('0x10')](app);require(_0x6dd9('0x13'))[_0x6dd9('0x10')](app);}else{server['once'](_0x6dd9('0x14'),function(){console[_0x6dd9('0x15')](_0x6dd9('0x16'),config[_0x6dd9('0x8')]);});}exports=module[_0x6dd9('0x17')]=app;
\ No newline at end of file
+var _0x36bd=['ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','defaults','redis','localhost','adapter','default','../../config/socketio','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session'];(function(_0x3ae005,_0x42dc70){var _0x1a43b3=function(_0x584a7e){while(--_0x584a7e){_0x3ae005['push'](_0x3ae005['shift']());}};_0x1a43b3(++_0x42dc70);}(_0x36bd,0x131));var _0xd36b=function(_0x2282a8,_0x3cea15){_0x2282a8=_0x2282a8-0x0;var _0xa9acf2=_0x36bd[_0x2282a8];return _0xa9acf2;};'use strict';var _=require(_0xd36b('0x0'));var http=require(_0xd36b('0x1'));var express=require('express');var sticky=require(_0xd36b('0x2'));var Redis=require(_0xd36b('0x3'));var config=require(_0xd36b('0x4'));var app=express();var server=http[_0xd36b('0x5')](app);server[_0xd36b('0x6')]=0xdbba0;if(sticky[_0xd36b('0x7')](server,config[_0xd36b('0x8')])){var socketio=require(_0xd36b('0x9'))(server,{'transports':['websocket',_0xd36b('0xa')]});config['redis']=_[_0xd36b('0xb')](config[_0xd36b('0xc')],{'host':_0xd36b('0xd'),'port':0x18eb});socketio[_0xd36b('0xe')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xd36b('0xf')]();require(_0xd36b('0x10'))[_0xd36b('0xf')](socketio);require(_0xd36b('0x11'))[_0xd36b('0xf')](app);require('../../routes')[_0xd36b('0xf')](app);}else{server['once'](_0xd36b('0x12'),function(){console[_0xd36b('0x13')](_0xd36b('0x14'),config[_0xd36b('0x8')]);});}exports=module[_0xd36b('0x15')]=app;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb84=['client','http','Request','request','debug','rpc','routing','error','message','result','catch','jayson/promise','bluebird','../../config/logger'];(function(_0x469def,_0x3f8695){var _0x22792c=function(_0x318ae1){while(--_0x318ae1){_0x469def['push'](_0x469def['shift']());}};_0x22792c(++_0x3f8695);}(_0xdb84,0x1a1));var _0x4db8=function(_0x45e9e5,_0x441712){_0x45e9e5=_0x45e9e5-0x0;var _0x1c07db=_0xdb84[_0x45e9e5];return _0x1c07db;};'use strict';var jayson=require(_0x4db8('0x0'));var BPromise=require(_0x4db8('0x1'));var logger=require(_0x4db8('0x2'))('routing');var client=jayson[_0x4db8('0x3')][_0x4db8('0x4')]({'port':0x2329});client[_0x4db8('0x5')]=function(_0x370093,_0x3fc82c){return new BPromise(function(_0x187d84,_0x5914cd){return client[_0x4db8('0x6')](_0x370093,_0x3fc82c)['then'](function(_0x541a84){logger[_0x4db8('0x7')](_0x4db8('0x8'),_0x4db8('0x9'),_0x370093,_0x3fc82c,_0x541a84);if(_0x541a84['error']){logger[_0x4db8('0xa')]('rpc',_0x4db8('0x9'),_0x370093,_0x541a84[_0x4db8('0xa')][_0x4db8('0xb')],_0x3fc82c);return _0x5914cd(_0x541a84[_0x4db8('0xa')]['message']);}else{return _0x187d84(_0x541a84[_0x4db8('0xc')]);}})[_0x4db8('0xd')](function(_0x318326){logger[_0x4db8('0xa')](_0x4db8('0x8'),'routing',_0x370093,_0x318326,_0x3fc82c);return _0x5914cd(_0x318326);});});};module['exports']=client;
\ No newline at end of file
+var _0x5924=['message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','request','then','debug','rpc','error'];(function(_0x582edc,_0x26f373){var _0x5e8640=function(_0x450d1b){while(--_0x450d1b){_0x582edc['push'](_0x582edc['shift']());}};_0x5e8640(++_0x26f373);}(_0x5924,0x10e));var _0x4592=function(_0x4c8833,_0x14e755){_0x4c8833=_0x4c8833-0x0;var _0x30df54=_0x5924[_0x4c8833];return _0x30df54;};'use strict';var jayson=require(_0x4592('0x0'));var BPromise=require(_0x4592('0x1'));var logger=require(_0x4592('0x2'))(_0x4592('0x3'));var client=jayson['client'][_0x4592('0x4')]({'port':0x2329});client['Request']=function(_0x59cb97,_0x4be815){return new BPromise(function(_0x30118d,_0x57a411){return client[_0x4592('0x5')](_0x59cb97,_0x4be815)[_0x4592('0x6')](function(_0x4fb06f){logger[_0x4592('0x7')](_0x4592('0x8'),'routing',_0x59cb97,_0x4be815,_0x4fb06f);if(_0x4fb06f['error']){logger[_0x4592('0x9')]('rpc',_0x4592('0x3'),_0x59cb97,_0x4fb06f[_0x4592('0x9')][_0x4592('0xa')],_0x4be815);return _0x57a411(_0x4fb06f[_0x4592('0x9')][_0x4592('0xa')]);}else{return _0x30118d(_0x4fb06f[_0x4592('0xb')]);}})[_0x4592('0xc')](function(_0xd3ada8){logger[_0x4592('0x9')](_0x4592('0x8'),'routing',_0x59cb97,_0xd3ada8,_0x4be815);return _0x57a411(_0xd3ada8);});});};module[_0x4592('0xd')]=client;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaadd=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xaadd,0x1bc));var _0xdaad=function(_0x467e9a,_0x3f060b){_0x467e9a=_0x467e9a-0x0;var _0x54ab51=_0xaadd[_0x467e9a];return _0x54ab51;};'use strict';var BPromise=require(_0xdaad('0x0'));var server=require(_0xdaad('0x1'));var Realtime=require(_0xdaad('0x2'));var user=require(_0xdaad('0x3'));var interval=require(_0xdaad('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xdaad('0x5'));var smsQueue=require(_0xdaad('0x6'));var mailQueue=require(_0xdaad('0x7'));var faxQueue=require(_0xdaad('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xdaad('0x9')]()[_0xdaad('0xa')](user[_0xdaad('0xb')]())[_0xdaad('0xa')](realtime[_0xdaad('0xc')]())['then'](interval[_0xdaad('0xd')]())['then'](realtime[_0xdaad('0xe')]())[_0xdaad('0xa')](openchannelQueue[_0xdaad('0xf')]())[_0xdaad('0xa')](realtime['initOpenchannelQueues']())[_0xdaad('0xa')](chatQueue[_0xdaad('0x10')]())[_0xdaad('0xa')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0xdaad('0xa')](realtime['initSmsQueues']())[_0xdaad('0xa')](mailQueue[_0xdaad('0x11')]())[_0xdaad('0xa')](realtime[_0xdaad('0x12')]())[_0xdaad('0xa')](faxQueue[_0xdaad('0x13')]())[_0xdaad('0xa')](realtime[_0xdaad('0x14')]())['then'](whatsappQueue[_0xdaad('0x15')]())[_0xdaad('0xa')](realtime['initWhatsappQueues']())[_0xdaad('0xa')](function(){return realtime;});}function main(){return server[_0xdaad('0x16')](realtime)[_0xdaad('0xa')](function(_0x1dc1bb){return initRealtime();})[_0xdaad('0xa')](function(_0x44bc4c){return setInterval(initRealtime,0x1388);})[_0xdaad('0x17')](function(_0x149763){console[_0xdaad('0x18')](_0x149763);});}main();
\ No newline at end of file
+var _0x1cc1=['./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','catch','log','bluebird','./server','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x458140,_0x20964a){var _0x5e4ba1=function(_0x240ca4){while(--_0x240ca4){_0x458140['push'](_0x458140['shift']());}};_0x5e4ba1(++_0x20964a);}(_0x1cc1,0x1b4));var _0x11cc=function(_0x512658,_0x464f5f){_0x512658=_0x512658-0x0;var _0x354676=_0x1cc1[_0x512658];return _0x354676;};'use strict';var BPromise=require(_0x11cc('0x0'));var server=require(_0x11cc('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x11cc('0x2'));var chatQueue=require(_0x11cc('0x3'));var smsQueue=require(_0x11cc('0x4'));var mailQueue=require(_0x11cc('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x11cc('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x11cc('0x7')]()[_0x11cc('0x8')](user['getAgents']())[_0x11cc('0x8')](realtime[_0x11cc('0x9')]())['then'](interval[_0x11cc('0xa')]())[_0x11cc('0x8')](realtime[_0x11cc('0xb')]())[_0x11cc('0x8')](openchannelQueue[_0x11cc('0xc')]())[_0x11cc('0x8')](realtime[_0x11cc('0xd')]())['then'](chatQueue['getChatQueues']())[_0x11cc('0x8')](realtime['initChatQueues']())[_0x11cc('0x8')](smsQueue[_0x11cc('0xe')]())[_0x11cc('0x8')](realtime[_0x11cc('0xf')]())['then'](mailQueue['getMailQueues']())['then'](realtime[_0x11cc('0x10')]())[_0x11cc('0x8')](faxQueue['getFaxQueues']())['then'](realtime[_0x11cc('0x11')]())[_0x11cc('0x8')](whatsappQueue['getWhatsappQueues']())[_0x11cc('0x8')](realtime[_0x11cc('0x12')]())[_0x11cc('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x11cc('0x8')](function(_0x5036e4){return initRealtime();})[_0x11cc('0x8')](function(_0x4cf95e){return setInterval(initRealtime,0x1388);})[_0x11cc('0x13')](function(_0x37f428){console[_0x11cc('0x14')](_0x37f428);});}main();
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x326f,0xd1));var _0xf326=function(_0x237347,_0x49a7f4){_0x237347=_0x237347-0x0;var _0x5f5ddb=_0x326f[_0x237347];return _0x5f5ddb;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x37a0ce,_0x28dc04){var _0x569f4e=function(_0x1671c0){while(--_0x1671c0){_0x37a0ce['push'](_0x37a0ce['shift']());}};_0x569f4e(++_0x28dc04);}(_0x326f,0xd1));var _0xf326=function(_0x284d27,_0x432220){_0x284d27=_0x284d27-0x0;var _0x47b771=_0x326f[_0x284d27];return _0x47b771;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04f2=['result','catch','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x35b219,_0x4270ad){var _0x388615=function(_0x80131){while(--_0x80131){_0x35b219['push'](_0x35b219['shift']());}};_0x388615(++_0x4270ad);}(_0x04f2,0xd4));var _0x204f=function(_0x519d93,_0x395910){_0x519d93=_0x519d93-0x0;var _0x3579cf=_0x04f2[_0x519d93];return _0x3579cf;};'use strict';var BPromise=require(_0x204f('0x0'));var jayson=require(_0x204f('0x1'));var client=jayson[_0x204f('0x2')][_0x204f('0x3')]({'port':0x232b});function request(_0x59f8e1,_0x5a1e15){return new BPromise(function(_0x2af1f7,_0x34cdda){return client[_0x204f('0x4')](_0x59f8e1,_0x5a1e15)[_0x204f('0x5')](function(_0x47775c){if(_0x47775c['error']){return _0x34cdda(_0x47775c[_0x204f('0x6')][_0x204f('0x7')]);}else{return _0x2af1f7(_0x47775c[_0x204f('0x8')]);}})[_0x204f('0x9')](function(_0x20d492){return _0x34cdda(_0x20d492);});});}exports['sendMailMessage']=function(_0x51e569,_0x46e87d){return request(_0x204f('0xa'),{'account':_0x51e569,'message':_0x46e87d});};
\ No newline at end of file
+var _0xa02e=['request','then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x12f8b5,_0x5b6d8b){var _0x1b07da=function(_0x82723c){while(--_0x82723c){_0x12f8b5['push'](_0x12f8b5['shift']());}};_0x1b07da(++_0x5b6d8b);}(_0xa02e,0x1dc));var _0xea02=function(_0x5cc3fa,_0x4520e5){_0x5cc3fa=_0x5cc3fa-0x0;var _0x561355=_0xa02e[_0x5cc3fa];return _0x561355;};'use strict';var BPromise=require(_0xea02('0x0'));var jayson=require(_0xea02('0x1'));var client=jayson[_0xea02('0x2')][_0xea02('0x3')]({'port':0x232b});function request(_0x537db8,_0x32ef89){return new BPromise(function(_0x1e94cf,_0x311575){return client[_0xea02('0x4')](_0x537db8,_0x32ef89)[_0xea02('0x5')](function(_0x4da9f6){if(_0x4da9f6[_0xea02('0x6')]){return _0x311575(_0x4da9f6['error']['message']);}else{return _0x1e94cf(_0x4da9f6['result']);}})[_0xea02('0x7')](function(_0x5d2979){return _0x311575(_0x5d2979);});});}exports[_0xea02('0x8')]=function(_0x3cef3d,_0x379941){return request(_0xea02('0x9'),{'account':_0x3cef3d,'message':_0x379941});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a85=['whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','faxStatusTime','whatsappStatus','openchannelWaitingInteractions','stringify','emit','user:routing:update','omit','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1a85,0x178));var _0x51a8=function(_0x11e000,_0x12a8e5){_0x11e000=_0x11e000-0x0;var _0x110c27=_0x1a85[_0x11e000];return _0x110c27;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x51a8('0x0'));var Redis=require(_0x51a8('0x1'));var config=require(_0x51a8('0x2'));config['redis']=_['defaults'](config[_0x51a8('0x3')],{'host':_0x51a8('0x4'),'port':0x18eb});var io=require(_0x51a8('0x5'))(new Redis(config['redis']));function Agent(_0xaac0bf){this['id']=_0xaac0bf['id']||0x0;this['name']=_0xaac0bf[_0x51a8('0x6')]||'';this['online']=_0xaac0bf[_0x51a8('0x7')]||!![];this[_0x51a8('0x8')]=_0xaac0bf['voicePause']||![];this[_0x51a8('0x9')]=_0xaac0bf['chatPause']||![];this['mailPause']=_0xaac0bf[_0x51a8('0xa')]||![];this[_0x51a8('0xb')]=_0xaac0bf[_0x51a8('0xb')]||![];this[_0x51a8('0xc')]=_0xaac0bf[_0x51a8('0xc')]||![];this[_0x51a8('0xd')]=_0xaac0bf[_0x51a8('0xd')]||![];this[_0x51a8('0xe')]=_0x51a8('0xf');this[_0x51a8('0x10')]=0x0;this[_0x51a8('0x11')]=_0xaac0bf[_0x51a8('0x11')]||0x0;this[_0x51a8('0x12')]=0x0;this[_0x51a8('0x13')]=_0x51a8('0xf');this[_0x51a8('0x14')]=0x0;this[_0x51a8('0x15')]=_0xaac0bf['mailCapacity']||0x0;this[_0x51a8('0x16')]=0x0;this[_0x51a8('0x17')]=_0x51a8('0xf');this['faxStatusTime']=0x0;this[_0x51a8('0x18')]=_0xaac0bf['faxCapacity']||0x0;this[_0x51a8('0x19')]=0x0;this[_0x51a8('0x1a')]=_0x51a8('0xf');this[_0x51a8('0x1b')]=0x0;this[_0x51a8('0x1c')]=_0xaac0bf[_0x51a8('0x1c')]||0x0;this[_0x51a8('0x1d')]=0x0;this['whatsappStatus']=_0x51a8('0xf');this[_0x51a8('0x1e')]=0x0;this[_0x51a8('0x1f')]=_0xaac0bf[_0x51a8('0x1f')]||0x0;this[_0x51a8('0x20')]=0x0;this[_0x51a8('0x21')]='unknown';this[_0x51a8('0x22')]=0x0;this[_0x51a8('0x23')]=_0xaac0bf[_0x51a8('0x23')]||0x0;this[_0x51a8('0x24')]=0x0;this[_0x51a8('0x25')]=![];this[_0x51a8('0x26')]=undefined;this[_0x51a8('0x27')]='';this[_0x51a8('0x28')]={};this['faxWaitingInteractions']={};this[_0x51a8('0x29')]={};this['openchannelWaitingInteractions']={};this[_0x51a8('0x2a')]={};this[_0x51a8('0x2b')]={};this[_0x51a8('0x2c')]();}Agent[_0x51a8('0x2d')]['getChannelStatus']=function(_0xae3588){if(this[_0xae3588+'CurrentCapacity']>0x0){if(this[_0xae3588+'Capacity']>0x0&&this[_0xae3588+_0x51a8('0x2e')]>=this[_0xae3588+'Capacity']){return _0x51a8('0x2f');}else{return _0x51a8('0x30');}}else{return _0x51a8('0x31');}};Agent[_0x51a8('0x2d')][_0x51a8('0x2c')]=function(){var _0x2f2f05=[_0x51a8('0x32'),_0x51a8('0x33'),'openchannel',_0x51a8('0x34'),_0x51a8('0x35'),_0x51a8('0x36')];for(var _0x3da187=0x0;_0x3da187<_0x2f2f05[_0x51a8('0x37')];_0x3da187+=0x1){var _0x11aefc=this[_0x51a8('0x38')](_0x2f2f05[_0x3da187]);if(this[_0x2f2f05[_0x3da187]+_0x51a8('0x39')]!==_0x11aefc){this[_0x2f2f05[_0x3da187]+_0x51a8('0x3a')]=_[_0x51a8('0x3b')](moment()[_0x51a8('0x3c')]('x'));}this[_0x2f2f05[_0x3da187]+_0x51a8('0x39')]=_0x11aefc;}var _0x4a1548={'id':this['id'],'name':this[_0x51a8('0x6')],'online':this['online'],'voicePause':this[_0x51a8('0x8')],'chatPause':this[_0x51a8('0x9')],'mailPause':this[_0x51a8('0xa')],'smsPause':this[_0x51a8('0xc')],'faxPause':this[_0x51a8('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x51a8('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x51a8('0x11')],'chatCurrentCapacity':this[_0x51a8('0x12')],'mailStatus':this[_0x51a8('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x51a8('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x51a8('0x17')],'faxStatusTime':this[_0x51a8('0x3d')],'faxCapacity':this[_0x51a8('0x18')],'faxCurrentCapacity':this[_0x51a8('0x19')],'smsStatus':this[_0x51a8('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x51a8('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x51a8('0x3e')],'whatsappStatusTime':this[_0x51a8('0x1e')],'whatsappCapacity':this[_0x51a8('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x51a8('0x21')],'openchannelStatusTime':this[_0x51a8('0x22')],'openchannelCapacity':this[_0x51a8('0x23')],'openchannelCurrentCapacity':this[_0x51a8('0x24')],'busy':this[_0x51a8('0x25')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x51a8('0x29')],'openchannelWaitingInteractions':this[_0x51a8('0x3f')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x51a8('0x2b')]};var _0x4ec0ac=md5(JSON[_0x51a8('0x40')](_0x4a1548));if(this[_0x51a8('0x27')]!==_0x4ec0ac){this[_0x51a8('0x27')]=_0x4ec0ac;io[_0x51a8('0x41')](_0x51a8('0x42'),_[_0x51a8('0x43')](_0x4a1548,['online']));}};module['exports']=Agent;
\ No newline at end of file
+var _0x7a54=['moment','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailPause','smsCurrentCapacity','smsWaitingInteractions','stringify','emit','user:routing:update','omit','exports','lodash','md5'];(function(_0x4b0fec,_0x216326){var _0x50904e=function(_0xf450d1){while(--_0xf450d1){_0x4b0fec['push'](_0x4b0fec['shift']());}};_0x50904e(++_0x216326);}(_0x7a54,0x106));var _0x47a5=function(_0xe4c183,_0x4ee4ef){_0xe4c183=_0xe4c183-0x0;var _0x571c86=_0x7a54[_0xe4c183];return _0x571c86;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function Agent(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['online']=_0xfdf934[_0x47a5('0x8')]||!![];this[_0x47a5('0x9')]=_0xfdf934['voicePause']||![];this[_0x47a5('0xa')]=_0xfdf934['chatPause']||![];this['mailPause']=_0xfdf934['mailPause']||![];this[_0x47a5('0xb')]=_0xfdf934[_0x47a5('0xb')]||![];this['smsPause']=_0xfdf934[_0x47a5('0xc')]||![];this['openchannelPause']=_0xfdf934['openchannelPause']||![];this[_0x47a5('0xd')]=_0x47a5('0xe');this[_0x47a5('0xf')]=0x0;this[_0x47a5('0x10')]=_0xfdf934[_0x47a5('0x10')]||0x0;this[_0x47a5('0x11')]=0x0;this[_0x47a5('0x12')]='unknown';this[_0x47a5('0x13')]=0x0;this[_0x47a5('0x14')]=_0xfdf934[_0x47a5('0x14')]||0x0;this[_0x47a5('0x15')]=0x0;this[_0x47a5('0x16')]=_0x47a5('0xe');this[_0x47a5('0x17')]=0x0;this[_0x47a5('0x18')]=_0xfdf934['faxCapacity']||0x0;this[_0x47a5('0x19')]=0x0;this[_0x47a5('0x1a')]=_0x47a5('0xe');this[_0x47a5('0x1b')]=0x0;this[_0x47a5('0x1c')]=_0xfdf934['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x47a5('0x1d')]='unknown';this['whatsappStatusTime']=0x0;this[_0x47a5('0x1e')]=_0xfdf934[_0x47a5('0x1e')]||0x0;this[_0x47a5('0x1f')]=0x0;this[_0x47a5('0x20')]=_0x47a5('0xe');this[_0x47a5('0x21')]=0x0;this[_0x47a5('0x22')]=_0xfdf934[_0x47a5('0x22')]||0x0;this[_0x47a5('0x23')]=0x0;this['busy']=![];this[_0x47a5('0x24')]=undefined;this[_0x47a5('0x1')]='';this['chatWaitingInteractions']={};this[_0x47a5('0x25')]={};this[_0x47a5('0x26')]={};this[_0x47a5('0x27')]={};this['smsWaitingInteractions']={};this[_0x47a5('0x28')]={};this[_0x47a5('0x29')]();}Agent[_0x47a5('0x2a')][_0x47a5('0x2b')]=function(_0x5ef1b1){if(this[_0x5ef1b1+_0x47a5('0x2c')]>0x0){if(this[_0x5ef1b1+_0x47a5('0x2d')]>0x0&&this[_0x5ef1b1+'CurrentCapacity']>=this[_0x5ef1b1+_0x47a5('0x2d')]){return _0x47a5('0x2e');}else{return _0x47a5('0x2f');}}else{return _0x47a5('0x30');}};Agent[_0x47a5('0x2a')]['updateRealtime']=function(){var _0x53078a=[_0x47a5('0x31'),'chat',_0x47a5('0x32'),'fax',_0x47a5('0x33'),_0x47a5('0x34')];for(var _0x36ad34=0x0;_0x36ad34<_0x53078a[_0x47a5('0x35')];_0x36ad34+=0x1){var _0x21f296=this[_0x47a5('0x2b')](_0x53078a[_0x36ad34]);if(this[_0x53078a[_0x36ad34]+_0x47a5('0x36')]!==_0x21f296){this[_0x53078a[_0x36ad34]+_0x47a5('0x37')]=_[_0x47a5('0x38')](moment()[_0x47a5('0x39')]('x'));}this[_0x53078a[_0x36ad34]+_0x47a5('0x36')]=_0x21f296;}var _0x11a4fa={'id':this['id'],'name':this[_0x47a5('0x7')],'online':this['online'],'voicePause':this[_0x47a5('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x47a5('0x3a')],'smsPause':this[_0x47a5('0xc')],'faxPause':this[_0x47a5('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x47a5('0xd')],'chatStatusTime':this[_0x47a5('0xf')],'chatCapacity':this[_0x47a5('0x10')],'chatCurrentCapacity':this[_0x47a5('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x47a5('0x14')],'mailCurrentCapacity':this[_0x47a5('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x47a5('0x18')],'faxCurrentCapacity':this[_0x47a5('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x47a5('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x47a5('0x3b')],'whatsappStatus':this[_0x47a5('0x1d')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x47a5('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x47a5('0x21')],'openchannelCapacity':this[_0x47a5('0x22')],'openchannelCurrentCapacity':this[_0x47a5('0x23')],'busy':this['busy'],'busyQueue':this[_0x47a5('0x24')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x47a5('0x26')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x47a5('0x3c')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x21ad34=md5(JSON[_0x47a5('0x3d')](_0x11a4fa));if(this[_0x47a5('0x1')]!==_0x21ad34){this[_0x47a5('0x1')]=_0x21ad34;io[_0x47a5('0x3e')](_0x47a5('0x3f'),_[_0x47a5('0x40')](_0x11a4fa,[_0x47a5('0x8')]));}};module[_0x47a5('0x41')]=Agent;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64d2=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','paused','available','stringify','format','chat_queue:save','exports','md5'];(function(_0x14108b,_0xaef524){var _0x14ad65=function(_0x3a9e03){while(--_0x3a9e03){_0x14108b['push'](_0x14108b['shift']());}};_0x14ad65(++_0xaef524);}(_0x64d2,0x143));var _0x264d=function(_0x1bc4d3,_0x9bb12f){_0x1bc4d3=_0x1bc4d3-0x0;var _0x506aa1=_0x64d2[_0x1bc4d3];return _0x506aa1;};'use strict';var _=require('lodash');var md5=require(_0x264d('0x0'));var util=require('util');var Redis=require(_0x264d('0x1'));var config=require(_0x264d('0x2'));config[_0x264d('0x3')]=_[_0x264d('0x4')](config[_0x264d('0x3')],{'host':_0x264d('0x5'),'port':0x18eb});var io=require(_0x264d('0x6'))(new Redis(config['redis']));function ChatQueue(_0x1986b7){this['id']=_0x1986b7['id']||0x0;this['name']=_0x1986b7[_0x264d('0x7')]||'';this[_0x264d('0x8')]=_0x1986b7[_0x264d('0x8')]||0xa;this[_0x264d('0x9')]=_0x1986b7[_0x264d('0x9')]||_0x264d('0xa');this[_0x264d('0xb')]=_0x1986b7[_0x264d('0xb')];this[_0x264d('0xc')]={};this[_0x264d('0xd')]=0x0;this['md5']='';this[_0x264d('0xe')]();this[_0x264d('0xf')]();}ChatQueue['prototype'][_0x264d('0xe')]=function(){var _0x3d6201=this['mapAgentsId'][_0x264d('0x10')];this[_0x264d('0xc')]=_[_0x264d('0x11')](this[_0x264d('0xb')],'id');this[_0x264d('0xc')][_0x264d('0x10')]=_0x3d6201;};ChatQueue[_0x264d('0x12')][_0x264d('0xf')]=function(){this[_0x264d('0x13')]=0x0;this['paused']=0x0;for(var _0x543fed=0x0;_0x543fed<this[_0x264d('0xb')][_0x264d('0x14')];_0x543fed+=0x1){if(this[_0x264d('0xb')][_0x543fed]['online']){this[_0x264d('0x13')]+=0x1;}if(this[_0x264d('0xb')][_0x543fed]['chatPause']){this[_0x264d('0x15')]+=0x1;}}this['available']=this[_0x264d('0x13')]-this[_0x264d('0x15')];this[_0x264d('0x16')]=this['available']>=0x0?this[_0x264d('0x16')]:0x0;var _0x43a96e={'id':this['id'],'available':this[_0x264d('0x16')],'loggedIn':this[_0x264d('0x13')],'name':this[_0x264d('0x7')],'paused':this[_0x264d('0x15')],'waiting':this[_0x264d('0xd')]};var _0x46dfc5=md5(JSON[_0x264d('0x17')](_0x43a96e));if(this[_0x264d('0x0')]!==_0x46dfc5){this[_0x264d('0x0')]=_0x46dfc5;io['to'](util[_0x264d('0x18')]('chat:queue:%s',_0x43a96e[_0x264d('0x7')]))['emit'](_0x264d('0x19'),_0x43a96e);}};module[_0x264d('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0x160d=['util','ioredis','redis','defaults','name','strategy','beepall','Agents','updateRouting','_rr','mapAgentsId','map','prototype','updateRealtime','loggedIn','paused','length','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','lodash','md5'];(function(_0x11a64e,_0x1e3c1b){var _0x5def7a=function(_0x57f470){while(--_0x57f470){_0x11a64e['push'](_0x11a64e['shift']());}};_0x5def7a(++_0x1e3c1b);}(_0x160d,0x150));var _0xd160=function(_0x36bda2,_0x3ec5b1){_0x36bda2=_0x36bda2-0x0;var _0x1d0953=_0x160d[_0x36bda2];return _0x1d0953;};'use strict';var _=require(_0xd160('0x0'));var md5=require(_0xd160('0x1'));var util=require(_0xd160('0x2'));var Redis=require(_0xd160('0x3'));var config=require('../../../config/environment');config[_0xd160('0x4')]=_[_0xd160('0x5')](config[_0xd160('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd160('0x4')]));function ChatQueue(_0x46d864){this['id']=_0x46d864['id']||0x0;this[_0xd160('0x6')]=_0x46d864['name']||'';this['timeout']=_0x46d864['timeout']||0xa;this[_0xd160('0x7')]=_0x46d864[_0xd160('0x7')]||_0xd160('0x8');this[_0xd160('0x9')]=_0x46d864['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xd160('0xa')]();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0x20839f=this['mapAgentsId'][_0xd160('0xb')];this[_0xd160('0xc')]=_[_0xd160('0xd')](this[_0xd160('0x9')],'id');this[_0xd160('0xc')][_0xd160('0xb')]=_0x20839f;};ChatQueue[_0xd160('0xe')][_0xd160('0xf')]=function(){this[_0xd160('0x10')]=0x0;this[_0xd160('0x11')]=0x0;for(var _0x18dd5b=0x0;_0x18dd5b<this[_0xd160('0x9')][_0xd160('0x12')];_0x18dd5b+=0x1){if(this[_0xd160('0x9')][_0x18dd5b]['online']){this[_0xd160('0x10')]+=0x1;}if(this[_0xd160('0x9')][_0x18dd5b][_0xd160('0x13')]){this[_0xd160('0x11')]+=0x1;}}this[_0xd160('0x14')]=this[_0xd160('0x10')]-this['paused'];this['available']=this[_0xd160('0x14')]>=0x0?this[_0xd160('0x14')]:0x0;var _0x5ec4c1={'id':this['id'],'available':this[_0xd160('0x14')],'loggedIn':this[_0xd160('0x10')],'name':this[_0xd160('0x6')],'paused':this[_0xd160('0x11')],'waiting':this[_0xd160('0x15')]};var _0x96b942=md5(JSON[_0xd160('0x16')](_0x5ec4c1));if(this['md5']!==_0x96b942){this[_0xd160('0x1')]=_0x96b942;io['to'](util[_0xd160('0x17')](_0xd160('0x18'),_0x5ec4c1['name']))[_0xd160('0x19')]('chat_queue:save',_0x5ec4c1);}};module['exports']=ChatQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4db6=['../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s','emit','lodash','util','ioredis'];(function(_0x39ae4e,_0x44a089){var _0x49a003=function(_0x13e851){while(--_0x13e851){_0x39ae4e['push'](_0x39ae4e['shift']());}};_0x49a003(++_0x44a089);}(_0x4db6,0x126));var _0x64db=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4db6[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x64db('0x0'));var md5=require('md5');var util=require(_0x64db('0x1'));var Redis=require(_0x64db('0x2'));var config=require(_0x64db('0x3'));config[_0x64db('0x4')]=_['defaults'](config[_0x64db('0x4')],{'host':_0x64db('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x64db('0x4')]));function FaxQueue(_0x242f4a){this['id']=_0x242f4a['id']||0x0;this[_0x64db('0x6')]=_0x242f4a[_0x64db('0x6')]||'';this['timeout']=_0x242f4a[_0x64db('0x7')]||0xa;this[_0x64db('0x8')]=_0x242f4a[_0x64db('0x8')]||'beepall';this[_0x64db('0x9')]=_0x242f4a[_0x64db('0x9')];this['mapAgentsId']={};this[_0x64db('0xa')]=0x0;this[_0x64db('0xb')]='';this['updateRouting']();this[_0x64db('0xc')]();}FaxQueue[_0x64db('0xd')][_0x64db('0xe')]=function(){var _0x7de737=this[_0x64db('0xf')][_0x64db('0x10')];this[_0x64db('0xf')]=_[_0x64db('0x11')](this[_0x64db('0x9')],'id');this[_0x64db('0xf')][_0x64db('0x10')]=_0x7de737;};FaxQueue[_0x64db('0xd')][_0x64db('0xc')]=function(){this[_0x64db('0x12')]=0x0;this[_0x64db('0x13')]=0x0;for(var _0x2f4224=0x0;_0x2f4224<this[_0x64db('0x9')][_0x64db('0x14')];_0x2f4224+=0x1){if(this['Agents'][_0x2f4224][_0x64db('0x15')]){this['loggedIn']+=0x1;}if(this[_0x64db('0x9')][_0x2f4224]['faxPause']){this[_0x64db('0x13')]+=0x1;}}this[_0x64db('0x16')]=this[_0x64db('0x12')]-this[_0x64db('0x13')];this[_0x64db('0x16')]=this[_0x64db('0x16')]>=0x0?this['available']:0x0;var _0x31f5be={'id':this['id'],'available':this[_0x64db('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x64db('0x6')],'paused':this[_0x64db('0x13')],'waiting':this['waiting']};var _0x8cf6f8=md5(JSON[_0x64db('0x17')](_0x31f5be));if(this[_0x64db('0xb')]!==_0x8cf6f8){this['md5']=_0x8cf6f8;io['to'](util[_0x64db('0x18')](_0x64db('0x19'),_0x31f5be[_0x64db('0x6')]))[_0x64db('0x1a')]('fax_queue:save',_0x31f5be);}};module['exports']=FaxQueue;
\ No newline at end of file
+var _0xc6cb=['fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','paused','length','online','loggedIn','faxPause','available','format','fax:queue:%s','emit'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc6cb,0x1a6));var _0xbc6c=function(_0x1d4269,_0x2fb23d){_0x1d4269=_0x1d4269-0x0;var _0x434db8=_0xc6cb[_0x1d4269];return _0x434db8;};'use strict';var _=require(_0xbc6c('0x0'));var md5=require(_0xbc6c('0x1'));var util=require(_0xbc6c('0x2'));var Redis=require('ioredis');var config=require(_0xbc6c('0x3'));config[_0xbc6c('0x4')]=_['defaults'](config['redis'],{'host':_0xbc6c('0x5'),'port':0x18eb});var io=require(_0xbc6c('0x6'))(new Redis(config[_0xbc6c('0x4')]));function FaxQueue(_0x2d6822){this['id']=_0x2d6822['id']||0x0;this['name']=_0x2d6822[_0xbc6c('0x7')]||'';this[_0xbc6c('0x8')]=_0x2d6822[_0xbc6c('0x8')]||0xa;this[_0xbc6c('0x9')]=_0x2d6822[_0xbc6c('0x9')]||'beepall';this[_0xbc6c('0xa')]=_0x2d6822[_0xbc6c('0xa')];this['mapAgentsId']={};this[_0xbc6c('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xbc6c('0xc')]();}FaxQueue[_0xbc6c('0xd')][_0xbc6c('0xe')]=function(){var _0x513053=this[_0xbc6c('0xf')][_0xbc6c('0x10')];this[_0xbc6c('0xf')]=_['map'](this['Agents'],'id');this[_0xbc6c('0xf')][_0xbc6c('0x10')]=_0x513053;};FaxQueue[_0xbc6c('0xd')][_0xbc6c('0xc')]=function(){this['loggedIn']=0x0;this[_0xbc6c('0x11')]=0x0;for(var _0x8fcbd8=0x0;_0x8fcbd8<this[_0xbc6c('0xa')][_0xbc6c('0x12')];_0x8fcbd8+=0x1){if(this[_0xbc6c('0xa')][_0x8fcbd8][_0xbc6c('0x13')]){this[_0xbc6c('0x14')]+=0x1;}if(this[_0xbc6c('0xa')][_0x8fcbd8][_0xbc6c('0x15')]){this[_0xbc6c('0x11')]+=0x1;}}this[_0xbc6c('0x16')]=this[_0xbc6c('0x14')]-this[_0xbc6c('0x11')];this[_0xbc6c('0x16')]=this[_0xbc6c('0x16')]>=0x0?this[_0xbc6c('0x16')]:0x0;var _0x5d569f={'id':this['id'],'available':this[_0xbc6c('0x16')],'loggedIn':this[_0xbc6c('0x14')],'name':this[_0xbc6c('0x7')],'paused':this[_0xbc6c('0x11')],'waiting':this[_0xbc6c('0xb')]};var _0x83993b=md5(JSON['stringify'](_0x5d569f));if(this[_0xbc6c('0x1')]!==_0x83993b){this[_0xbc6c('0x1')]=_0x83993b;io['to'](util[_0xbc6c('0x17')](_0xbc6c('0x18'),_0x5d569f[_0xbc6c('0x7')]))[_0xbc6c('0x19')](_0xbc6c('0x1a'),_0x5d569f);}};module[_0xbc6c('0x1b')]=FaxQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb36=['name','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb36,0x17e));var _0x6db3=function(_0x6faed5,_0xc5fed7){_0x6faed5=_0x6faed5-0x0;var _0x10cc01=_0xdb36[_0x6faed5];return _0x10cc01;};'use strict';function Interval(_0x265eac){this['id']=_0x265eac['id']||0x0;this[_0x6db3('0x0')]=_0x265eac[_0x6db3('0x0')]||'';this[_0x6db3('0x1')]=_0x265eac[_0x6db3('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x2a93=['Intervals','name'];(function(_0x23f30e,_0x44dc54){var _0x1e2f28=function(_0x4dffd7){while(--_0x4dffd7){_0x23f30e['push'](_0x23f30e['shift']());}};_0x1e2f28(++_0x44dc54);}(_0x2a93,0x197));var _0x32a9=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0x2a93[_0x2c6810];return _0x213881;};'use strict';function Interval(_0x36387d){this['id']=_0x36387d['id']||0x0;this[_0x32a9('0x0')]=_0x36387d['name']||'';this[_0x32a9('0x1')]=_0x36387d[_0x32a9('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x652f=['../../../config/environment','redis','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis'];(function(_0x2fa0a7,_0x188ed4){var _0x366c65=function(_0x251995){while(--_0x251995){_0x2fa0a7['push'](_0x2fa0a7['shift']());}};_0x366c65(++_0x188ed4);}(_0x652f,0x10b));var _0xf652=function(_0x4b78ad,_0x3e1d13){_0x4b78ad=_0x4b78ad-0x0;var _0x28d99e=_0x652f[_0x4b78ad];return _0x28d99e;};'use strict';var _=require(_0xf652('0x0'));var md5=require(_0xf652('0x1'));var util=require('util');var Redis=require(_0xf652('0x2'));var config=require(_0xf652('0x3'));config[_0xf652('0x4')]=_['defaults'](config[_0xf652('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf652('0x5'))(new Redis(config[_0xf652('0x4')]));function MailQueue(_0x46159a){this['id']=_0x46159a['id']||0x0;this[_0xf652('0x6')]=_0x46159a[_0xf652('0x6')]||'';this[_0xf652('0x7')]=_0x46159a['timeout']||0xa;this['strategy']=_0x46159a['strategy']||_0xf652('0x8');this[_0xf652('0x9')]=_0x46159a[_0xf652('0x9')];this[_0xf652('0xa')]={};this[_0xf652('0xb')]=0x0;this['md5']='';this[_0xf652('0xc')]();this[_0xf652('0xd')]();}MailQueue['prototype'][_0xf652('0xc')]=function(){var _0x34ffd6=this[_0xf652('0xa')][_0xf652('0xe')];this[_0xf652('0xa')]=_[_0xf652('0xf')](this[_0xf652('0x9')],'id');this['mapAgentsId'][_0xf652('0xe')]=_0x34ffd6;};MailQueue[_0xf652('0x10')][_0xf652('0xd')]=function(){this[_0xf652('0x11')]=0x0;this[_0xf652('0x12')]=0x0;for(var _0x44e92a=0x0;_0x44e92a<this[_0xf652('0x9')]['length'];_0x44e92a+=0x1){if(this[_0xf652('0x9')][_0x44e92a][_0xf652('0x13')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x44e92a]['mailPause']){this['paused']+=0x1;}}this[_0xf652('0x14')]=this[_0xf652('0x11')]-this[_0xf652('0x12')];this[_0xf652('0x14')]=this['available']>=0x0?this[_0xf652('0x14')]:0x0;var _0x3a8e28={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf652('0x11')],'name':this[_0xf652('0x6')],'paused':this[_0xf652('0x12')],'waiting':this[_0xf652('0xb')]};var _0x5725f4=md5(JSON[_0xf652('0x15')](_0x3a8e28));if(this[_0xf652('0x1')]!==_0x5725f4){this[_0xf652('0x1')]=_0x5725f4;io['to'](util[_0xf652('0x16')](_0xf652('0x17'),_0x3a8e28['name']))[_0xf652('0x18')](_0xf652('0x19'),_0x3a8e28);}};module[_0xf652('0x1a')]=MailQueue;
\ No newline at end of file
+var _0x9000=['strategy','beepall','Agents','waiting','prototype','updateRouting','mapAgentsId','map','_rr','updateRealtime','paused','length','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x60dee,_0x2450a5){var _0x2ecc65=function(_0x1f8e5c){while(--_0x1f8e5c){_0x60dee['push'](_0x60dee['shift']());}};_0x2ecc65(++_0x2450a5);}(_0x9000,0x14c));var _0x0900=function(_0x2f50db,_0x29205b){_0x2f50db=_0x2f50db-0x0;var _0x345e51=_0x9000[_0x2f50db];return _0x345e51;};'use strict';var _=require('lodash');var md5=require(_0x0900('0x0'));var util=require('util');var Redis=require(_0x0900('0x1'));var config=require(_0x0900('0x2'));config[_0x0900('0x3')]=_[_0x0900('0x4')](config[_0x0900('0x3')],{'host':_0x0900('0x5'),'port':0x18eb});var io=require(_0x0900('0x6'))(new Redis(config['redis']));function MailQueue(_0x32fd4a){this['id']=_0x32fd4a['id']||0x0;this['name']=_0x32fd4a[_0x0900('0x7')]||'';this[_0x0900('0x8')]=_0x32fd4a['timeout']||0xa;this['strategy']=_0x32fd4a[_0x0900('0x9')]||_0x0900('0xa');this[_0x0900('0xb')]=_0x32fd4a['Agents'];this['mapAgentsId']={};this[_0x0900('0xc')]=0x0;this[_0x0900('0x0')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x0900('0xd')][_0x0900('0xe')]=function(){var _0x7d1191=this[_0x0900('0xf')]['_rr'];this[_0x0900('0xf')]=_[_0x0900('0x10')](this[_0x0900('0xb')],'id');this[_0x0900('0xf')][_0x0900('0x11')]=_0x7d1191;};MailQueue[_0x0900('0xd')][_0x0900('0x12')]=function(){this['loggedIn']=0x0;this[_0x0900('0x13')]=0x0;for(var _0x2d6ab6=0x0;_0x2d6ab6<this[_0x0900('0xb')][_0x0900('0x14')];_0x2d6ab6+=0x1){if(this['Agents'][_0x2d6ab6][_0x0900('0x15')]){this[_0x0900('0x16')]+=0x1;}if(this[_0x0900('0xb')][_0x2d6ab6][_0x0900('0x17')]){this['paused']+=0x1;}}this[_0x0900('0x18')]=this[_0x0900('0x16')]-this[_0x0900('0x13')];this['available']=this['available']>=0x0?this[_0x0900('0x18')]:0x0;var _0x331c83={'id':this['id'],'available':this[_0x0900('0x18')],'loggedIn':this[_0x0900('0x16')],'name':this[_0x0900('0x7')],'paused':this['paused'],'waiting':this[_0x0900('0xc')]};var _0x32cf9c=md5(JSON[_0x0900('0x19')](_0x331c83));if(this['md5']!==_0x32cf9c){this[_0x0900('0x0')]=_0x32cf9c;io['to'](util[_0x0900('0x1a')](_0x0900('0x1b'),_0x331c83['name']))[_0x0900('0x1c')](_0x0900('0x1d'),_0x331c83);}};module[_0x0900('0x1e')]=MailQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x1df070,_0x393578){var _0x38cc9f=function(_0x2d2d4f){while(--_0x2d2d4f){_0x1df070['push'](_0x1df070['shift']());}};_0x38cc9f(++_0x393578);}(_0x814b,0x1a2));var _0xb814=function(_0x8d695e,_0x394999){_0x8d695e=_0x8d695e-0x0;var _0x3d156e=_0x814b[_0x8d695e];return _0x3d156e;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x2ef3,0xba));var _0x32ef=function(_0x34321c,_0x3bcf55){_0x34321c=_0x34321c-0x0;var _0x42cb96=_0x2ef3[_0x34321c];return _0x42cb96;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009<this[_0x32ef('0xa')][_0x32ef('0x11')];_0x4d8009+=0x1){if(this[_0x32ef('0xa')][_0x4d8009][_0x32ef('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4d8009]['openchannelPause']){this[_0x32ef('0x10')]+=0x1;}}this[_0x32ef('0x13')]=this[_0x32ef('0x14')]-this['paused'];this['available']=this[_0x32ef('0x13')]>=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x049e=['ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','smsPause','available','waiting','format','sms:queue:%s','sms_queue:save','exports','lodash','md5'];(function(_0x5b45df,_0xad4e74){var _0x65f5d0=function(_0x19b116){while(--_0x19b116){_0x5b45df['push'](_0x5b45df['shift']());}};_0x65f5d0(++_0xad4e74);}(_0x049e,0x16a));var _0xe049=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x049e[_0x446208];return _0xe49563;};'use strict';var _=require(_0xe049('0x0'));var md5=require(_0xe049('0x1'));var util=require('util');var Redis=require(_0xe049('0x2'));var config=require('../../../config/environment');config[_0xe049('0x3')]=_[_0xe049('0x4')](config[_0xe049('0x3')],{'host':_0xe049('0x5'),'port':0x18eb});var io=require(_0xe049('0x6'))(new Redis(config['redis']));function SmsQueue(_0x352aa6){this['id']=_0x352aa6['id']||0x0;this[_0xe049('0x7')]=_0x352aa6[_0xe049('0x7')]||'';this[_0xe049('0x8')]=_0x352aa6[_0xe049('0x8')]||0xa;this[_0xe049('0x9')]=_0x352aa6[_0xe049('0x9')]||'beepall';this[_0xe049('0xa')]=_0x352aa6[_0xe049('0xa')];this[_0xe049('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xe049('0xc')]();this[_0xe049('0xd')]();}SmsQueue[_0xe049('0xe')]['updateRouting']=function(){var _0x49e2fe=this['mapAgentsId'][_0xe049('0xf')];this[_0xe049('0xb')]=_[_0xe049('0x10')](this[_0xe049('0xa')],'id');this[_0xe049('0xb')][_0xe049('0xf')]=_0x49e2fe;};SmsQueue[_0xe049('0xe')][_0xe049('0xd')]=function(){this['loggedIn']=0x0;this[_0xe049('0x11')]=0x0;for(var _0x3f4a57=0x0;_0x3f4a57<this[_0xe049('0xa')][_0xe049('0x12')];_0x3f4a57+=0x1){if(this['Agents'][_0x3f4a57][_0xe049('0x13')]){this[_0xe049('0x14')]+=0x1;}if(this['Agents'][_0x3f4a57][_0xe049('0x15')]){this[_0xe049('0x11')]+=0x1;}}this['available']=this[_0xe049('0x14')]-this[_0xe049('0x11')];this['available']=this[_0xe049('0x16')]>=0x0?this['available']:0x0;var _0x520dd9={'id':this['id'],'available':this[_0xe049('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xe049('0x11')],'waiting':this[_0xe049('0x17')]};var _0x5ae414=md5(JSON['stringify'](_0x520dd9));if(this[_0xe049('0x1')]!==_0x5ae414){this[_0xe049('0x1')]=_0x5ae414;io['to'](util[_0xe049('0x18')](_0xe049('0x19'),_0x520dd9['name']))['emit'](_0xe049('0x1a'),_0x520dd9);}};module[_0xe049('0x1b')]=SmsQueue;
\ No newline at end of file
+var _0x7119=['ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','paused','length','loggedIn','smsPause','available','stringify','emit','sms_queue:save','md5'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7119,0x1c7));var _0x9711=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x7119[_0x409fb8];return _0x278270;};'use strict';var _=require('lodash');var md5=require(_0x9711('0x0'));var util=require('util');var Redis=require(_0x9711('0x1'));var config=require('../../../config/environment');config[_0x9711('0x2')]=_[_0x9711('0x3')](config[_0x9711('0x2')],{'host':_0x9711('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9711('0x2')]));function SmsQueue(_0x39ca84){this['id']=_0x39ca84['id']||0x0;this[_0x9711('0x5')]=_0x39ca84[_0x9711('0x5')]||'';this[_0x9711('0x6')]=_0x39ca84['timeout']||0xa;this[_0x9711('0x7')]=_0x39ca84[_0x9711('0x7')]||_0x9711('0x8');this['Agents']=_0x39ca84[_0x9711('0x9')];this['mapAgentsId']={};this[_0x9711('0xa')]=0x0;this[_0x9711('0x0')]='';this[_0x9711('0xb')]();this['updateRealtime']();}SmsQueue[_0x9711('0xc')][_0x9711('0xb')]=function(){var _0x25dbf6=this[_0x9711('0xd')][_0x9711('0xe')];this[_0x9711('0xd')]=_[_0x9711('0xf')](this[_0x9711('0x9')],'id');this[_0x9711('0xd')][_0x9711('0xe')]=_0x25dbf6;};SmsQueue[_0x9711('0xc')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9711('0x10')]=0x0;for(var _0x38d721=0x0;_0x38d721<this[_0x9711('0x9')][_0x9711('0x11')];_0x38d721+=0x1){if(this[_0x9711('0x9')][_0x38d721]['online']){this[_0x9711('0x12')]+=0x1;}if(this['Agents'][_0x38d721][_0x9711('0x13')]){this[_0x9711('0x10')]+=0x1;}}this[_0x9711('0x14')]=this[_0x9711('0x12')]-this[_0x9711('0x10')];this['available']=this['available']>=0x0?this[_0x9711('0x14')]:0x0;var _0x3615c9={'id':this['id'],'available':this[_0x9711('0x14')],'loggedIn':this[_0x9711('0x12')],'name':this[_0x9711('0x5')],'paused':this['paused'],'waiting':this[_0x9711('0xa')]};var _0x31e19f=md5(JSON[_0x9711('0x15')](_0x3615c9));if(this[_0x9711('0x0')]!==_0x31e19f){this['md5']=_0x31e19f;io['to'](util['format']('sms:queue:%s',_0x3615c9[_0x9711('0x5')]))[_0x9711('0x16')](_0x9711('0x17'),_0x3615c9);}};module['exports']=SmsQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x547b=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','whatsappPause','available','paused','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x231473,_0x33b93e){var _0x16d666=function(_0x35ed3a){while(--_0x35ed3a){_0x231473['push'](_0x231473['shift']());}};_0x16d666(++_0x33b93e);}(_0x547b,0x1a5));var _0xb547=function(_0x4f460e,_0x165aa0){_0x4f460e=_0x4f460e-0x0;var _0x209232=_0x547b[_0x4f460e];return _0x209232;};'use strict';var _=require(_0xb547('0x0'));var md5=require(_0xb547('0x1'));var util=require(_0xb547('0x2'));var Redis=require(_0xb547('0x3'));var config=require(_0xb547('0x4'));config[_0xb547('0x5')]=_[_0xb547('0x6')](config[_0xb547('0x5')],{'host':_0xb547('0x7'),'port':0x18eb});var io=require(_0xb547('0x8'))(new Redis(config[_0xb547('0x5')]));function WhatsappQueue(_0x1d4659){this['id']=_0x1d4659['id']||0x0;this['name']=_0x1d4659[_0xb547('0x9')]||'';this['timeout']=_0x1d4659[_0xb547('0xa')]||0xa;this[_0xb547('0xb')]=_0x1d4659[_0xb547('0xb')]||_0xb547('0xc');this['Agents']=_0x1d4659[_0xb547('0xd')];this[_0xb547('0xe')]={};this[_0xb547('0xf')]=0x0;this[_0xb547('0x1')]='';this[_0xb547('0x10')]();this[_0xb547('0x11')]();}WhatsappQueue['prototype'][_0xb547('0x10')]=function(){var _0x55590b=this[_0xb547('0xe')][_0xb547('0x12')];this[_0xb547('0xe')]=_[_0xb547('0x13')](this[_0xb547('0xd')],'id');this['mapAgentsId'][_0xb547('0x12')]=_0x55590b;};WhatsappQueue[_0xb547('0x14')]['updateRealtime']=function(){this[_0xb547('0x15')]=0x0;this['paused']=0x0;for(var _0x12193b=0x0;_0x12193b<this[_0xb547('0xd')][_0xb547('0x16')];_0x12193b+=0x1){if(this[_0xb547('0xd')][_0x12193b][_0xb547('0x17')]){this[_0xb547('0x15')]+=0x1;}if(this[_0xb547('0xd')][_0x12193b][_0xb547('0x18')]){this['paused']+=0x1;}}this[_0xb547('0x19')]=this['loggedIn']-this[_0xb547('0x1a')];this[_0xb547('0x19')]=this[_0xb547('0x19')]>=0x0?this[_0xb547('0x19')]:0x0;var _0xe8f2c8={'id':this['id'],'available':this[_0xb547('0x19')],'loggedIn':this[_0xb547('0x15')],'name':this[_0xb547('0x9')],'paused':this[_0xb547('0x1a')],'waiting':this['waiting']};var _0x41f67b=md5(JSON[_0xb547('0x1b')](_0xe8f2c8));if(this['md5']!==_0x41f67b){this['md5']=_0x41f67b;io['to'](util[_0xb547('0x1c')](_0xb547('0x1d'),_0xe8f2c8[_0xb547('0x9')]))[_0xb547('0x1e')](_0xb547('0x1f'),_0xe8f2c8);}};module[_0xb547('0x20')]=WhatsappQueue;
\ No newline at end of file
+var _0xc8e8=['Agents','updateRouting','mapAgentsId','map','_rr','prototype','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','name','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall'];(function(_0x364c3c,_0x4a5b93){var _0x3fed22=function(_0x47b317){while(--_0x47b317){_0x364c3c['push'](_0x364c3c['shift']());}};_0x3fed22(++_0x4a5b93);}(_0xc8e8,0xed));var _0x8c8e=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0xc8e8[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0x8c8e('0x0'));var md5=require(_0x8c8e('0x1'));var util=require(_0x8c8e('0x2'));var Redis=require('ioredis');var config=require(_0x8c8e('0x3'));config[_0x8c8e('0x4')]=_[_0x8c8e('0x5')](config[_0x8c8e('0x4')],{'host':_0x8c8e('0x6'),'port':0x18eb});var io=require(_0x8c8e('0x7'))(new Redis(config[_0x8c8e('0x4')]));function WhatsappQueue(_0x1b23ae){this['id']=_0x1b23ae['id']||0x0;this['name']=_0x1b23ae['name']||'';this[_0x8c8e('0x8')]=_0x1b23ae[_0x8c8e('0x8')]||0xa;this['strategy']=_0x1b23ae[_0x8c8e('0x9')]||_0x8c8e('0xa');this[_0x8c8e('0xb')]=_0x1b23ae['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8c8e('0x1')]='';this[_0x8c8e('0xc')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0x8c8e('0xc')]=function(){var _0x1e894f=this[_0x8c8e('0xd')]['_rr'];this[_0x8c8e('0xd')]=_[_0x8c8e('0xe')](this[_0x8c8e('0xb')],'id');this['mapAgentsId'][_0x8c8e('0xf')]=_0x1e894f;};WhatsappQueue[_0x8c8e('0x10')][_0x8c8e('0x11')]=function(){this[_0x8c8e('0x12')]=0x0;this[_0x8c8e('0x13')]=0x0;for(var _0x51b56d=0x0;_0x51b56d<this[_0x8c8e('0xb')][_0x8c8e('0x14')];_0x51b56d+=0x1){if(this[_0x8c8e('0xb')][_0x51b56d][_0x8c8e('0x15')]){this[_0x8c8e('0x12')]+=0x1;}if(this[_0x8c8e('0xb')][_0x51b56d][_0x8c8e('0x16')]){this[_0x8c8e('0x13')]+=0x1;}}this['available']=this[_0x8c8e('0x12')]-this['paused'];this[_0x8c8e('0x17')]=this[_0x8c8e('0x17')]>=0x0?this['available']:0x0;var _0x57cb8c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8c8e('0x12')],'name':this[_0x8c8e('0x18')],'paused':this[_0x8c8e('0x13')],'waiting':this[_0x8c8e('0x19')]};var _0x47dd71=md5(JSON[_0x8c8e('0x1a')](_0x57cb8c));if(this['md5']!==_0x47dd71){this['md5']=_0x47dd71;io['to'](util[_0x8c8e('0x1b')](_0x8c8e('0x1c'),_0x57cb8c[_0x8c8e('0x18')]))[_0x8c8e('0x1d')](_0x8c8e('0x1e'),_0x57cb8c);}};module['exports']=WhatsappQueue;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4b309b,_0x14f4ec){var _0x49f58d=function(_0xa829da){while(--_0xa829da){_0x4b309b['push'](_0x4b309b['shift']());}};_0x49f58d(++_0x14f4ec);}(_0xb10b,0x12a));var _0xbb10=function(_0x4031e5,_0x5d9cd0){_0x4031e5=_0x4031e5-0x0;var _0x25b248=_0xb10b[_0x4031e5];return _0x25b248;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x304711,_0x26bb31){var _0x1dc144=function(_0x4b9a37){while(--_0x4b9a37){_0x304711['push'](_0x304711['shift']());}};_0x1dc144(++_0x26bb31);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xb10b[_0x4b4f24];return _0x1c13d4;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdce=['update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x1e118f,_0x1d429d){var _0x92eb43=function(_0x34f1f0){while(--_0x34f1f0){_0x1e118f['push'](_0x1e118f['shift']());}};_0x92eb43(++_0x1d429d);}(_0xbdce,0x125));var _0xebdc=function(_0x3e215a,_0xd79132){_0x3e215a=_0x3e215a-0x0;var _0x5b4c9d=_0xbdce[_0x3e215a];return _0x5b4c9d;};'use strict';var client=require(_0xebdc('0x0'));exports[_0xebdc('0x1')]=function(_0x525a58,_0x1bf0d4){return client[_0xebdc('0x2')]('UpdateChatInteraction',{'body':_0x1bf0d4,'options':{'where':{'id':_0x525a58}},'log':_0xebdc('0x3')});};exports[_0xebdc('0x4')]=function(_0x1bf8ea,_0x4a7eeb){return client[_0xebdc('0x2')](_0xebdc('0x5'),{'body':_0x4a7eeb,'options':{'where':{'id':_0x1bf8ea}},'log':_0xebdc('0x6')});};
\ No newline at end of file
+var _0x0253=['update','Request','UpdateChatInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x5e8f13,_0x1f0d01){var _0x531ecb=function(_0x15b138){while(--_0x15b138){_0x5e8f13['push'](_0x5e8f13['shift']());}};_0x531ecb(++_0x1f0d01);}(_0x0253,0x1d9));var _0x3025=function(_0x4c4ed9,_0x5b9fac){_0x4c4ed9=_0x4c4ed9-0x0;var _0x38b45a=_0x0253[_0x4c4ed9];return _0x38b45a;};'use strict';var client=require(_0x3025('0x0'));exports[_0x3025('0x1')]=function(_0x42152e,_0x44c8d2){return client[_0x3025('0x2')](_0x3025('0x3'),{'body':_0x44c8d2,'options':{'where':{'id':_0x42152e}},'log':'updateChatInteraction'});};exports[_0x3025('0x4')]=function(_0x24af32,_0x1ff193){return client[_0x3025('0x2')]('AddTagsToChatInteraction',{'body':_0x1ff193,'options':{'where':{'id':_0x24af32}},'log':_0x3025('0x5')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd693=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x3d325d,_0x5b080f){var _0x298852=function(_0xf5c81a){while(--_0xf5c81a){_0x3d325d['push'](_0x3d325d['shift']());}};_0x298852(++_0x5b080f);}(_0xd693,0xda));var _0x3d69=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0xd693[_0x328b1c];return _0x4dbeaa;};'use strict';var client=require(_0x3d69('0x0'));exports[_0x3d69('0x1')]=function(_0xfa5b58){return client['Request'](_0x3d69('0x2'),{'body':_0xfa5b58,'log':_0x3d69('0x3')});};
\ No newline at end of file
+var _0xfd8f=['Request','CreateChatMessage','../client','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfd8f,0xaa));var _0xffd8=function(_0x5620be,_0x3d223d){_0x5620be=_0x5620be-0x0;var _0x54b386=_0xfd8f[_0x5620be];return _0x54b386;};'use strict';var client=require(_0xffd8('0x0'));exports[_0xffd8('0x1')]=function(_0x3c5bc5){return client[_0xffd8('0x2')](_0xffd8('0x3'),{'body':_0x3c5bc5,'log':'createChatMessage'});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb8f=['User','Agents','online','chatPause','getChatQueues','name','timeout','strategy'];(function(_0x31c6ca,_0x5b37b3){var _0x1b5088=function(_0x3c840b){while(--_0x3c840b){_0x31c6ca['push'](_0x31c6ca['shift']());}};_0x1b5088(++_0x5b37b3);}(_0xfb8f,0x18c));var _0xffb8=function(_0x18c254,_0x57f783){_0x18c254=_0x18c254-0x0;var _0x4cfe02=_0xfb8f[_0x18c254];return _0x4cfe02;};'use strict';var client=require('../client');exports[_0xffb8('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xffb8('0x1'),_0xffb8('0x2'),_0xffb8('0x3')],'include':[{'model':_0xffb8('0x4'),'as':_0xffb8('0x5'),'attributes':['id','name',_0xffb8('0x6'),_0xffb8('0x7')]}]},'log':_0xffb8('0x0')});};};
\ No newline at end of file
+var _0x4be6=['online','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x53577d,_0x4c7f85){var _0x381c01=function(_0x38af51){while(--_0x38af51){_0x53577d['push'](_0x53577d['shift']());}};_0x381c01(++_0x4c7f85);}(_0x4be6,0xb5));var _0x64be=function(_0xa7991d,_0x32459c){_0xa7991d=_0xa7991d-0x0;var _0x459970=_0x4be6[_0xa7991d];return _0x459970;};'use strict';var client=require('../client');exports[_0x64be('0x0')]=function(){return function(){return client[_0x64be('0x1')](_0x64be('0x2'),{'options':{'raw':![],'attributes':['id',_0x64be('0x3'),_0x64be('0x4'),_0x64be('0x5')],'include':[{'model':_0x64be('0x6'),'as':_0x64be('0x7'),'attributes':['id',_0x64be('0x3'),_0x64be('0x8'),'chatPause']}]},'log':_0x64be('0x0')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65f4=['DESC','UpdateChatQueueReport','Request','CreateChatQueueReport'];(function(_0x47faad,_0x230b04){var _0x4c449a=function(_0x426c7e){while(--_0x426c7e){_0x47faad['push'](_0x47faad['shift']());}};_0x4c449a(++_0x230b04);}(_0x65f4,0x19a));var _0x465f=function(_0x5d64a7,_0x2a9bf0){_0x5d64a7=_0x5d64a7-0x0;var _0xd32be7=_0x65f4[_0x5d64a7];return _0xd32be7;};'use strict';var client=require('../client');exports['create']=function(_0x39de85){return client[_0x465f('0x0')](_0x465f('0x1'),{'body':_0x39de85,'log':'CreateChatQueueReport'});};exports['update']=function(_0x32cc52,_0x3bf967){return client[_0x465f('0x0')]('UpdateChatQueueReport',{'body':_0x3bf967,'options':{'where':{'uniqueid':_0x32cc52},'order':[['id',_0x465f('0x2')]],'limit':0x1},'log':_0x465f('0x3')});};
\ No newline at end of file
+var _0x5127=['update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x4f54b8,_0x4b3436){var _0xaea143=function(_0x13db6d){while(--_0x13db6d){_0x4f54b8['push'](_0x4f54b8['shift']());}};_0xaea143(++_0x4b3436);}(_0x5127,0x18f));var _0x7512=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0x5127[_0x32bb6b];return _0x58dcb4;};'use strict';var client=require(_0x7512('0x0'));exports[_0x7512('0x1')]=function(_0x3abf2c){return client[_0x7512('0x2')]('CreateChatQueueReport',{'body':_0x3abf2c,'log':'CreateChatQueueReport'});};exports[_0x7512('0x3')]=function(_0x58a754,_0x3fbca7){return client[_0x7512('0x2')](_0x7512('0x4'),{'body':_0x3fbca7,'options':{'where':{'uniqueid':_0x58a754},'order':[['id',_0x7512('0x5')]],'limit':0x1},'log':_0x7512('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x7a112,_0x2eb4a0){var _0x136dc5=function(_0x437650){while(--_0x437650){_0x7a112['push'](_0x7a112['shift']());}};_0x136dc5(++_0x2eb4a0);}(_0x7a54,0x106));var _0x47a5=function(_0x4ea7a0,_0x13a13b){_0x4ea7a0=_0x4ea7a0-0x0;var _0x24769e=_0x7a54[_0x4ea7a0];return _0x24769e;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x48cda9,_0x575113){var _0xe47e76=function(_0x502303){while(--_0x502303){_0x48cda9['push'](_0x48cda9['shift']());}};_0xe47e76(++_0x575113);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3410=['create','../client'];(function(_0x593e12,_0x1cdaf9){var _0x8a6a30=function(_0x29a3cc){while(--_0x29a3cc){_0x593e12['push'](_0x593e12['shift']());}};_0x8a6a30(++_0x1cdaf9);}(_0x3410,0x17d));var _0x0341=function(_0x487240,_0x4ac7a5){_0x487240=_0x487240-0x0;var _0x3b7254=_0x3410[_0x487240];return _0x3b7254;};'use strict';var client=require(_0x0341('0x0'));exports[_0x0341('0x1')]=function(_0x2e431b){return client['Request']('CreateFaxMessage',{'body':_0x2e431b,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0x16f1=['../client','create','Request','createFaxMessage'];(function(_0x4820be,_0x63e7a9){var _0x32f26f=function(_0x2716bf){while(--_0x2716bf){_0x4820be['push'](_0x4820be['shift']());}};_0x32f26f(++_0x63e7a9);}(_0x16f1,0xec));var _0x116f=function(_0x1caf94,_0x537168){_0x1caf94=_0x1caf94-0x0;var _0xabce09=_0x16f1[_0x1caf94];return _0xabce09;};'use strict';var client=require(_0x116f('0x0'));exports[_0x116f('0x1')]=function(_0x1b247d){return client[_0x116f('0x2')]('CreateFaxMessage',{'body':_0x1b247d,'log':_0x116f('0x3')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe073=['User','online','faxPause','getFaxQueues','../client','Request','name','timeout','strategy'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe073,0x1ea));var _0x3e07=function(_0x48f1f2,_0x108484){_0x48f1f2=_0x48f1f2-0x0;var _0x3737e8=_0xe073[_0x48f1f2];return _0x3737e8;};'use strict';var client=require(_0x3e07('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x3e07('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x3e07('0x2'),_0x3e07('0x3'),_0x3e07('0x4')],'include':[{'model':_0x3e07('0x5'),'as':'Agents','attributes':['id',_0x3e07('0x2'),_0x3e07('0x6'),_0x3e07('0x7')]}]},'log':_0x3e07('0x8')});};};
\ No newline at end of file
+var _0x24dc=['getFaxQueues','Request','name','timeout','strategy','User','../client'];(function(_0x5b6474,_0x318d69){var _0x12ad2e=function(_0x2f943f){while(--_0x2f943f){_0x5b6474['push'](_0x5b6474['shift']());}};_0x12ad2e(++_0x318d69);}(_0x24dc,0x18e));var _0xc24d=function(_0x25f619,_0x4402f7){_0x25f619=_0x25f619-0x0;var _0x2b9283=_0x24dc[_0x25f619];return _0x2b9283;};'use strict';var client=require(_0xc24d('0x0'));exports[_0xc24d('0x1')]=function(){return function(){return client[_0xc24d('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xc24d('0x3'),_0xc24d('0x4'),_0xc24d('0x5')],'include':[{'model':_0xc24d('0x6'),'as':'Agents','attributes':['id','name','online','faxPause']}]},'log':_0xc24d('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2159=['CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client','create','Request'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x2159,0xe4));var _0x9215=function(_0x5a58e1,_0x5cf833){_0x5a58e1=_0x5a58e1-0x0;var _0x1061d4=_0x2159[_0x5a58e1];return _0x1061d4;};'use strict';var client=require(_0x9215('0x0'));exports[_0x9215('0x1')]=function(_0x1ef4fb){return client[_0x9215('0x2')](_0x9215('0x3'),{'body':_0x1ef4fb,'log':_0x9215('0x3')});};exports[_0x9215('0x4')]=function(_0x5de188,_0x1fd358){return client[_0x9215('0x2')]('UpdateFaxQueueReport',{'body':_0x1fd358,'options':{'where':{'uniqueid':_0x5de188},'order':[['id',_0x9215('0x5')]],'limit':0x1},'log':_0x9215('0x6')});};
\ No newline at end of file
+var _0x5679=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x4d66e3,_0x340242){var _0xc5ab42=function(_0xa3a730){while(--_0xa3a730){_0x4d66e3['push'](_0x4d66e3['shift']());}};_0xc5ab42(++_0x340242);}(_0x5679,0x104));var _0x9567=function(_0x442a2e,_0x23076b){_0x442a2e=_0x442a2e-0x0;var _0x4614d4=_0x5679[_0x442a2e];return _0x4614d4;};'use strict';var client=require(_0x9567('0x0'));exports[_0x9567('0x1')]=function(_0x549a0a){return client[_0x9567('0x2')](_0x9567('0x3'),{'body':_0x549a0a,'log':_0x9567('0x3')});};exports[_0x9567('0x4')]=function(_0xa14cc9,_0x43c13a){return client[_0x9567('0x2')]('UpdateFaxQueueReport',{'body':_0x43c13a,'options':{'where':{'uniqueid':_0xa14cc9},'order':[['id',_0x9567('0x5')]],'limit':0x1},'log':_0x9567('0x6')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x455c=['name','Interval','interval','../client','getIntervals','Request','GetInterval'];(function(_0x2187b9,_0x32afa2){var _0xc40b26=function(_0x19cf62){while(--_0x19cf62){_0x2187b9['push'](_0x2187b9['shift']());}};_0xc40b26(++_0x32afa2);}(_0x455c,0x184));var _0xc455=function(_0x49a57f,_0x405f38){_0x49a57f=_0x49a57f-0x0;var _0x2fa2a5=_0x455c[_0x49a57f];return _0x2fa2a5;};'use strict';var client=require(_0xc455('0x0'));exports[_0xc455('0x1')]=function(){return function(){return client[_0xc455('0x2')](_0xc455('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc455('0x4')],'include':[{'model':_0xc455('0x5'),'as':'Intervals','attributes':['id',_0xc455('0x4'),_0xc455('0x6')]}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0x45c1=['GetInterval','name','Interval','Intervals','getIntervals','Request'];(function(_0xfd0884,_0x656783){var _0x10e569=function(_0x59b44a){while(--_0x59b44a){_0xfd0884['push'](_0xfd0884['shift']());}};_0x10e569(++_0x656783);}(_0x45c1,0xbe));var _0x145c=function(_0x10b519,_0xf99732){_0x10b519=_0x10b519-0x0;var _0x4d06e7=_0x45c1[_0x10b519];return _0x4d06e7;};'use strict';var client=require('../client');exports[_0x145c('0x0')]=function(){return function(){return client[_0x145c('0x1')](_0x145c('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x145c('0x3')],'include':[{'model':_0x145c('0x4'),'as':_0x145c('0x5'),'attributes':['id','name','interval']}]},'log':_0x145c('0x0')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x77d4=['update','UpdateMailInteraction','updateMailInteraction','Request','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x598f40,_0x52b170){var _0x1e48bb=function(_0x386c78){while(--_0x386c78){_0x598f40['push'](_0x598f40['shift']());}};_0x1e48bb(++_0x52b170);}(_0x77d4,0x108));var _0x477d=function(_0x244b18,_0x3e8f78){_0x244b18=_0x244b18-0x0;var _0xf3bf67=_0x77d4[_0x244b18];return _0xf3bf67;};'use strict';var client=require('../client');exports[_0x477d('0x0')]=function(_0x49b615,_0x18c0fe){return client['Request'](_0x477d('0x1'),{'body':_0x18c0fe,'options':{'where':{'id':_0x49b615}},'log':_0x477d('0x2')});};exports['addTags']=function(_0x53e1b8,_0x16213f){return client[_0x477d('0x3')](_0x477d('0x4'),{'body':_0x16213f,'options':{'where':{'id':_0x53e1b8}},'log':_0x477d('0x5')});};
\ No newline at end of file
+var _0x47c5=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request'];(function(_0x40be2b,_0x3b985c){var _0xa464aa=function(_0x96f09b){while(--_0x96f09b){_0x40be2b['push'](_0x40be2b['shift']());}};_0xa464aa(++_0x3b985c);}(_0x47c5,0x165));var _0x547c=function(_0x3e3064,_0x3dd6f5){_0x3e3064=_0x3e3064-0x0;var _0x4547e1=_0x47c5[_0x3e3064];return _0x4547e1;};'use strict';var client=require(_0x547c('0x0'));exports[_0x547c('0x1')]=function(_0x2b2280,_0x123697){return client[_0x547c('0x2')](_0x547c('0x3'),{'body':_0x123697,'options':{'where':{'id':_0x2b2280}},'log':'updateMailInteraction'});};exports[_0x547c('0x4')]=function(_0x16f4db,_0x5b48c9){return client[_0x547c('0x2')](_0x547c('0x5'),{'body':_0x5b48c9,'options':{'where':{'id':_0x16f4db}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8759=['Request','CreateMailMessage','createMailMessage','create'];(function(_0xa0af7,_0x18364e){var _0x405473=function(_0x29cb94){while(--_0x29cb94){_0xa0af7['push'](_0xa0af7['shift']());}};_0x405473(++_0x18364e);}(_0x8759,0x18f));var _0x9875=function(_0x34f29b,_0x3965a9){_0x34f29b=_0x34f29b-0x0;var _0x2a871c=_0x8759[_0x34f29b];return _0x2a871c;};'use strict';var client=require('../client');exports[_0x9875('0x0')]=function(_0x3a4a0a){return client[_0x9875('0x1')](_0x9875('0x2'),{'body':_0x3a4a0a,'log':_0x9875('0x3')});};
\ No newline at end of file
+var _0xfb67=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x157852,_0x158b64){var _0x346098=function(_0x1ccdd4){while(--_0x1ccdd4){_0x157852['push'](_0x157852['shift']());}};_0x346098(++_0x158b64);}(_0xfb67,0x11b));var _0x7fb6=function(_0x53c617,_0x76647a){_0x53c617=_0x53c617-0x0;var _0x4cacfd=_0xfb67[_0x53c617];return _0x4cacfd;};'use strict';var client=require(_0x7fb6('0x0'));exports[_0x7fb6('0x1')]=function(_0x29c9d6){return client[_0x7fb6('0x2')](_0x7fb6('0x3'),{'body':_0x29c9d6,'log':_0x7fb6('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1337=['User','../client','getMailQueues','name'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x1337,0x191));var _0x7133=function(_0x1d83a8,_0xe170f0){_0x1d83a8=_0x1d83a8-0x0;var _0x56c11d=_0x1337[_0x1d83a8];return _0x56c11d;};'use strict';var client=require(_0x7133('0x0'));exports[_0x7133('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x7133('0x2'),'timeout','strategy'],'include':[{'model':_0x7133('0x3'),'as':'Agents','attributes':['id',_0x7133('0x2'),'online','mailPause']}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0xcfa2=['getMailQueues','Request','GetMailQueue','timeout','strategy','User','Agents','online','../client'];(function(_0x54190d,_0x120b36){var _0x3f058a=function(_0x280b93){while(--_0x280b93){_0x54190d['push'](_0x54190d['shift']());}};_0x3f058a(++_0x120b36);}(_0xcfa2,0xb3));var _0x2cfa=function(_0x4967c4,_0x1a8d3e){_0x4967c4=_0x4967c4-0x0;var _0x30f8b1=_0xcfa2[_0x4967c4];return _0x30f8b1;};'use strict';var client=require(_0x2cfa('0x0'));exports[_0x2cfa('0x1')]=function(){return function(){return client[_0x2cfa('0x2')](_0x2cfa('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2cfa('0x4'),_0x2cfa('0x5')],'include':[{'model':_0x2cfa('0x6'),'as':_0x2cfa('0x7'),'attributes':['id','name',_0x2cfa('0x8'),'mailPause']}]},'log':_0x2cfa('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9ff=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9ff,0x1da));var _0xfa9f=function(_0x254081,_0x133020){_0x254081=_0x254081-0x0;var _0x15e822=_0xa9ff[_0x254081];return _0x15e822;};'use strict';var client=require(_0xfa9f('0x0'));exports[_0xfa9f('0x1')]=function(_0x50daa1){return client[_0xfa9f('0x2')](_0xfa9f('0x3'),{'body':_0x50daa1,'log':_0xfa9f('0x3')});};exports['update']=function(_0x1535ad,_0x1c8ffc){return client[_0xfa9f('0x2')](_0xfa9f('0x4'),{'body':_0x1c8ffc,'options':{'where':{'uniqueid':_0x1535ad},'order':[['id',_0xfa9f('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x9230=['CreateMailQueueReport','update','DESC','Request'];(function(_0x2dd2c0,_0x578bab){var _0x1d7997=function(_0x4dd51c){while(--_0x4dd51c){_0x2dd2c0['push'](_0x2dd2c0['shift']());}};_0x1d7997(++_0x578bab);}(_0x9230,0xdf));var _0x0923=function(_0x25d8f4,_0x583908){_0x25d8f4=_0x25d8f4-0x0;var _0x292138=_0x9230[_0x25d8f4];return _0x292138;};'use strict';var client=require('../client');exports['create']=function(_0x223ea4){return client[_0x0923('0x0')](_0x0923('0x1'),{'body':_0x223ea4,'log':_0x0923('0x1')});};exports[_0x0923('0x2')]=function(_0x399789,_0x351285){return client[_0x0923('0x0')]('UpdateMailQueueReport',{'body':_0x351285,'options':{'where':{'uniqueid':_0x399789},'order':[['id',_0x0923('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x228e=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x31198d,_0x4e00db){var _0x109385=function(_0xa4c43e){while(--_0xa4c43e){_0x31198d['push'](_0x31198d['shift']());}};_0x109385(++_0x4e00db);}(_0x228e,0x1f1));var _0xe228=function(_0x498f1c,_0x3ef361){_0x498f1c=_0x498f1c-0x0;var _0x4e01c9=_0x228e[_0x498f1c];return _0x4e01c9;};'use strict';var client=require(_0xe228('0x0'));exports['update']=function(_0x553b7f,_0x1aa579){return client[_0xe228('0x1')](_0xe228('0x2'),{'body':_0x1aa579,'options':{'where':{'id':_0x553b7f}},'log':_0xe228('0x3')});};exports[_0xe228('0x4')]=function(_0x20d1ee,_0x181edc){return client['Request'](_0xe228('0x5'),{'body':_0x181edc,'options':{'where':{'id':_0x20d1ee}},'log':_0xe228('0x6')});};
\ No newline at end of file
+var _0x4b8d=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x4c3d1e,_0x4ae464){var _0xff6bd5=function(_0x28e15c){while(--_0x28e15c){_0x4c3d1e['push'](_0x4c3d1e['shift']());}};_0xff6bd5(++_0x4ae464);}(_0x4b8d,0x17f));var _0xd4b8=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x4b8d[_0x2605dc];return _0x4568c9;};'use strict';var client=require(_0xd4b8('0x0'));exports['update']=function(_0x5bbb8d,_0x1611b3){return client[_0xd4b8('0x1')]('UpdateOpenchannelInteraction',{'body':_0x1611b3,'options':{'where':{'id':_0x5bbb8d}},'log':_0xd4b8('0x2')});};exports['addTags']=function(_0x5467c9,_0x40d69b){return client[_0xd4b8('0x1')](_0xd4b8('0x3'),{'body':_0x40d69b,'options':{'where':{'id':_0x5467c9}},'log':_0xd4b8('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcdbd=['../client','create','Request','createOpenchannelMessage'];(function(_0x28fe26,_0x1141cc){var _0x3b7814=function(_0x5d939d){while(--_0x5d939d){_0x28fe26['push'](_0x28fe26['shift']());}};_0x3b7814(++_0x1141cc);}(_0xcdbd,0x6c));var _0xdcdb=function(_0x1f7743,_0x1fbc7f){_0x1f7743=_0x1f7743-0x0;var _0x17eb73=_0xcdbd[_0x1f7743];return _0x17eb73;};'use strict';var client=require(_0xdcdb('0x0'));exports[_0xdcdb('0x1')]=function(_0x42f949){return client[_0xdcdb('0x2')]('CreateOpenchannelMessage',{'body':_0x42f949,'log':_0xdcdb('0x3')});};
\ No newline at end of file
+var _0x6565=['Request','createOpenchannelMessage','create'];(function(_0x245a93,_0x258504){var _0x38bf51=function(_0x2415fb){while(--_0x2415fb){_0x245a93['push'](_0x245a93['shift']());}};_0x38bf51(++_0x258504);}(_0x6565,0x1d3));var _0x5656=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0x6565[_0x57d671];return _0x450dfe;};'use strict';var client=require('../client');exports[_0x5656('0x0')]=function(_0x5df0a9){return client[_0x5656('0x1')]('CreateOpenchannelMessage',{'body':_0x5df0a9,'log':_0x5656('0x2')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30c6=['strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout'];(function(_0x4548cc,_0x456898){var _0x2c4cb6=function(_0x448c50){while(--_0x448c50){_0x4548cc['push'](_0x4548cc['shift']());}};_0x2c4cb6(++_0x456898);}(_0x30c6,0x171));var _0x630c=function(_0x13968f,_0x22d6c8){_0x13968f=_0x13968f-0x0;var _0x264fc1=_0x30c6[_0x13968f];return _0x264fc1;};'use strict';var client=require(_0x630c('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x630c('0x1')](_0x630c('0x2'),{'options':{'raw':![],'attributes':['id',_0x630c('0x3'),_0x630c('0x4'),_0x630c('0x5')],'include':[{'model':_0x630c('0x6'),'as':_0x630c('0x7'),'attributes':['id',_0x630c('0x3'),_0x630c('0x8'),_0x630c('0x9')]}]},'log':_0x630c('0xa')});};};
\ No newline at end of file
+var _0x29e9=['name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x40480b,_0x2b5aa8){var _0x9bc197=function(_0x4a7ab7){while(--_0x4a7ab7){_0x40480b['push'](_0x40480b['shift']());}};_0x9bc197(++_0x2b5aa8);}(_0x29e9,0xbb));var _0x929e=function(_0x587326,_0x4cfeb1){_0x587326=_0x587326-0x0;var _0x3fdf9f=_0x29e9[_0x587326];return _0x3fdf9f;};'use strict';var client=require(_0x929e('0x0'));exports[_0x929e('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x929e('0x2'),_0x929e('0x3'),_0x929e('0x4')],'include':[{'model':_0x929e('0x5'),'as':_0x929e('0x6'),'attributes':['id',_0x929e('0x2'),_0x929e('0x7'),_0x929e('0x8')]}]},'log':_0x929e('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfba1=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','Request'];(function(_0x345565,_0x436b05){var _0x21730e=function(_0x18fdbd){while(--_0x18fdbd){_0x345565['push'](_0x345565['shift']());}};_0x21730e(++_0x436b05);}(_0xfba1,0x1ca));var _0x1fba=function(_0x40681f,_0x32d0d1){_0x40681f=_0x40681f-0x0;var _0x573f43=_0xfba1[_0x40681f];return _0x573f43;};'use strict';var client=require(_0x1fba('0x0'));exports['create']=function(_0x2734da){return client[_0x1fba('0x1')](_0x1fba('0x2'),{'body':_0x2734da,'log':_0x1fba('0x2')});};exports[_0x1fba('0x3')]=function(_0x37cc17,_0x322e15){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x322e15,'options':{'where':{'uniqueid':_0x37cc17},'order':[['id','DESC']],'limit':0x1},'log':_0x1fba('0x4')});};
\ No newline at end of file
+var _0x4d92=['Request','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x56ec09,_0xd0c95f){var _0x1ddcaa=function(_0x321853){while(--_0x321853){_0x56ec09['push'](_0x56ec09['shift']());}};_0x1ddcaa(++_0xd0c95f);}(_0x4d92,0x12a));var _0x24d9=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0x4d92[_0x481af3];return _0x3354ea;};'use strict';var client=require(_0x24d9('0x0'));exports[_0x24d9('0x1')]=function(_0x569846){return client[_0x24d9('0x2')]('CreateOpenchannelQueueReport',{'body':_0x569846,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x45b090,_0x475192){return client[_0x24d9('0x2')](_0x24d9('0x3'),{'body':_0x475192,'options':{'where':{'uniqueid':_0x45b090},'order':[['id',_0x24d9('0x4')]],'limit':0x1},'log':_0x24d9('0x3')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb07f=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x36f8b2,_0x4c0dd4){var _0x324ae8=function(_0x1e2fc9){while(--_0x1e2fc9){_0x36f8b2['push'](_0x36f8b2['shift']());}};_0x324ae8(++_0x4c0dd4);}(_0xb07f,0x109));var _0xfb07=function(_0x23e367,_0x7c9f0){_0x23e367=_0x23e367-0x0;var _0x32326b=_0xb07f[_0x23e367];return _0x32326b;};'use strict';var client=require(_0xfb07('0x0'));exports[_0xfb07('0x1')]=function(_0x3088a0,_0xdf10d4){return client[_0xfb07('0x2')](_0xfb07('0x3'),{'body':_0xdf10d4,'options':{'where':{'id':_0x3088a0}},'log':_0xfb07('0x4')});};exports[_0xfb07('0x5')]=function(_0x3b3c05,_0x2fc1ce){return client[_0xfb07('0x2')]('AddTagsToSmsInteraction',{'body':_0x2fc1ce,'options':{'where':{'id':_0x3b3c05}},'log':_0xfb07('0x6')});};
\ No newline at end of file
+var _0xc03e=['addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','UpdateSmsInteraction'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xc03e,0x15a));var _0xec03=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xc03e[_0x176329];return _0x31997c;};'use strict';var client=require(_0xec03('0x0'));exports['update']=function(_0x5cec52,_0x1de7ac){return client['Request'](_0xec03('0x1'),{'body':_0x1de7ac,'options':{'where':{'id':_0x5cec52}},'log':'updateSmsInteraction'});};exports[_0xec03('0x2')]=function(_0x269001,_0x3e3a78){return client[_0xec03('0x3')](_0xec03('0x4'),{'body':_0x3e3a78,'options':{'where':{'id':_0x269001}},'log':_0xec03('0x5')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa555=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x5d60ae,_0x53fa46){var _0x3cbb30=function(_0x162208){while(--_0x162208){_0x5d60ae['push'](_0x5d60ae['shift']());}};_0x3cbb30(++_0x53fa46);}(_0xa555,0x173));var _0x5a55=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xa555[_0x4b3e49];return _0x57e339;};'use strict';var client=require('../client');exports[_0x5a55('0x0')]=function(_0x5b06c5){return client[_0x5a55('0x1')](_0x5a55('0x2'),{'body':_0x5b06c5,'log':_0x5a55('0x3')});};
\ No newline at end of file
+var _0x0b89=['createSmsMessage','../client','create'];(function(_0x4c03ef,_0x589748){var _0x556965=function(_0x17d7a2){while(--_0x17d7a2){_0x4c03ef['push'](_0x4c03ef['shift']());}};_0x556965(++_0x589748);}(_0x0b89,0xc4));var _0x90b8=function(_0x3771dd,_0x6c1638){_0x3771dd=_0x3771dd-0x0;var _0x2aa04b=_0x0b89[_0x3771dd];return _0x2aa04b;};'use strict';var client=require(_0x90b8('0x0'));exports[_0x90b8('0x1')]=function(_0x3c4acf){return client['Request']('CreateSmsMessage',{'body':_0x3c4acf,'log':_0x90b8('0x2')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x41b80a,_0x44eb4c){var _0x4efcca=function(_0x56b7c6){while(--_0x56b7c6){_0x41b80a['push'](_0x41b80a['shift']());}};_0x4efcca(++_0x44eb4c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xcb91[_0x5e4563];return _0x8d1bf5;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0xd2486a,_0x43a7ed){var _0x2ec8d3=function(_0x4aec2a){while(--_0x4aec2a){_0xd2486a['push'](_0xd2486a['shift']());}};_0x2ec8d3(++_0x43a7ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x302d72,_0x5b5917){var _0x53b912=function(_0x4efc9e){while(--_0x4efc9e){_0x302d72['push'](_0x302d72['shift']());}};_0x53b912(++_0x5b5917);}(_0x3e74,0x175));var _0x43e7=function(_0x255340,_0x3067e8){_0x255340=_0x255340-0x0;var _0x40bb5a=_0x3e74[_0x255340];return _0x40bb5a;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});};
\ No newline at end of file
+var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x3bc13c,_0x1c2431){var _0x3acb56=function(_0xc68a0c){while(--_0xc68a0c){_0x3bc13c['push'](_0x3bc13c['shift']());}};_0x3acb56(++_0x1c2431);}(_0x70e0,0x17b));var _0x070e=function(_0x5747ac,_0x428e73){_0x5747ac=_0x5747ac-0x0;var _0x30ced9=_0x70e0[_0x5747ac];return _0x30ced9;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x18570f,_0x3962bf){var _0x315e8b=function(_0xe9f5cd){while(--_0xe9f5cd){_0x18570f['push'](_0x18570f['shift']());}};_0x315e8b(++_0x3962bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3de846,_0x5267b6){var _0x32c1b4=function(_0x4d0da7){while(--_0x4d0da7){_0x3de846['push'](_0x3de846['shift']());}};_0x32c1b4(++_0x5267b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4873=['update','Request','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x1066c6,_0xbbea15){var _0x3772d6=function(_0x35a252){while(--_0x35a252){_0x1066c6['push'](_0x1066c6['shift']());}};_0x3772d6(++_0xbbea15);}(_0x4873,0x1df));var _0x3487=function(_0x35b8fb,_0x136aad){_0x35b8fb=_0x35b8fb-0x0;var _0x719413=_0x4873[_0x35b8fb];return _0x719413;};'use strict';var client=require(_0x3487('0x0'));exports[_0x3487('0x1')]=function(_0x332e18,_0x4ca7ad){return client[_0x3487('0x2')]('UpdateWhatsappInteraction',{'body':_0x4ca7ad,'options':{'where':{'id':_0x332e18}},'log':'updateWhatsappInteraction'});};exports[_0x3487('0x3')]=function(_0xbc64e7,_0x54ff70){return client[_0x3487('0x2')](_0x3487('0x4'),{'body':_0x54ff70,'options':{'where':{'id':_0xbc64e7}},'log':_0x3487('0x5')});};
\ No newline at end of file
+var _0x6f44=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x6f44,0x1ea));var _0x46f4=function(_0x52cec9,_0x593842){_0x52cec9=_0x52cec9-0x0;var _0x59764b=_0x6f44[_0x52cec9];return _0x59764b;};'use strict';var client=require(_0x46f4('0x0'));exports[_0x46f4('0x1')]=function(_0x50acb0,_0x13d61a){return client[_0x46f4('0x2')](_0x46f4('0x3'),{'body':_0x13d61a,'options':{'where':{'id':_0x50acb0}},'log':_0x46f4('0x4')});};exports[_0x46f4('0x5')]=function(_0x1e2554,_0x26f749){return client[_0x46f4('0x2')](_0x46f4('0x6'),{'body':_0x26f749,'options':{'where':{'id':_0x1e2554}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6403=['../client','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6403,0x198));var _0x3640=function(_0xa85a49,_0x3fd76c){_0xa85a49=_0xa85a49-0x0;var _0x5e2ad7=_0x6403[_0xa85a49];return _0x5e2ad7;};'use strict';var client=require(_0x3640('0x0'));exports['create']=function(_0x5283be){return client[_0x3640('0x1')](_0x3640('0x2'),{'body':_0x5283be,'log':_0x3640('0x3')});};
\ No newline at end of file
+var _0xf8ca=['create','Request','CreateWhatsappMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8ca,0x97));var _0xaf8c=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xf8ca[_0x1eda20];return _0x31b953;};'use strict';var client=require(_0xaf8c('0x0'));exports[_0xaf8c('0x1')]=function(_0x4a37d4){return client[_0xaf8c('0x2')](_0xaf8c('0x3'),{'body':_0x4a37d4,'log':'createWhatsappMessage'});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08a9=['../client','Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08a9,0x82));var _0x908a=function(_0x5067d7,_0x56c8e5){_0x5067d7=_0x5067d7-0x0;var _0x367d67=_0x08a9[_0x5067d7];return _0x367d67;};'use strict';var client=require(_0x908a('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x908a('0x1')](_0x908a('0x2'),{'options':{'raw':![],'attributes':['id',_0x908a('0x3'),'timeout',_0x908a('0x4')],'include':[{'model':_0x908a('0x5'),'as':_0x908a('0x6'),'attributes':['id',_0x908a('0x3'),_0x908a('0x7'),_0x908a('0x8')]}]},'log':_0x908a('0x9')});};};
\ No newline at end of file
+var _0xa045=['../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User','online'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa045,0x88));var _0x5a04=function(_0x1ddc48,_0x286127){_0x1ddc48=_0x1ddc48-0x0;var _0x4bca3f=_0xa045[_0x1ddc48];return _0x4bca3f;};'use strict';var client=require(_0x5a04('0x0'));exports[_0x5a04('0x1')]=function(){return function(){return client['Request'](_0x5a04('0x2'),{'options':{'raw':![],'attributes':['id',_0x5a04('0x3'),_0x5a04('0x4'),_0x5a04('0x5')],'include':[{'model':_0x5a04('0x6'),'as':'Agents','attributes':['id',_0x5a04('0x3'),_0x5a04('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6cc=['update','UpdateWhatsappQueueReport','../client','CreateWhatsappQueueReport'];(function(_0x4de729,_0x50ddcd){var _0x127c6c=function(_0x1b9f58){while(--_0x1b9f58){_0x4de729['push'](_0x4de729['shift']());}};_0x127c6c(++_0x50ddcd);}(_0xa6cc,0x17a));var _0xca6c=function(_0x5b5f70,_0xc951e6){_0x5b5f70=_0x5b5f70-0x0;var _0x3affc7=_0xa6cc[_0x5b5f70];return _0x3affc7;};'use strict';var client=require(_0xca6c('0x0'));exports['create']=function(_0x1feed7){return client['Request'](_0xca6c('0x1'),{'body':_0x1feed7,'log':_0xca6c('0x1')});};exports[_0xca6c('0x2')]=function(_0x5334a2,_0x3b3d10){return client['Request'](_0xca6c('0x3'),{'body':_0x3b3d10,'options':{'where':{'uniqueid':_0x5334a2},'order':[['id','DESC']],'limit':0x1},'log':_0xca6c('0x3')});};
\ No newline at end of file
+var _0x8db3=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x36cf5e,_0x1debea){var _0x54aef1=function(_0x11802a){while(--_0x11802a){_0x36cf5e['push'](_0x36cf5e['shift']());}};_0x54aef1(++_0x1debea);}(_0x8db3,0xaa));var _0x38db=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8db3[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x38db('0x0'));exports[_0x38db('0x1')]=function(_0x5021ca){return client[_0x38db('0x2')](_0x38db('0x3'),{'body':_0x5021ca,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x5483d9,_0x571f8d){return client[_0x38db('0x2')](_0x38db('0x4'),{'body':_0x571f8d,'options':{'where':{'uniqueid':_0x5483d9},'order':[['id',_0x38db('0x5')]],'limit':0x1},'log':_0x38db('0x4')});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde09=['[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','../../../../config/logger','routing','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete'];(function(_0x16012a,_0x492cb0){var _0x4f32d1=function(_0x2a967d){while(--_0x2a967d){_0x16012a['push'](_0x16012a['shift']());}};_0x4f32d1(++_0x492cb0);}(_0xde09,0x11f));var _0x9de0=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xde09[_0x2235bf];return _0x4c3a64;};'use strict';var schema=require(_0x9de0('0x0'));var _=require(_0x9de0('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x9de0('0x2'))(_0x9de0('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9de0('0x4'),'message':_0x9de0('0x5')}});function writeLog(_0x25e4ec,_0xdd236,_0x4e31df){return logger[_0x9de0('0x6')](util[_0x9de0('0x7')](_0x9de0('0x8'),_0x25e4ec,_0xdd236[_0x9de0('0x9')],_0x4e31df));}function handleFindAgent(_0x3da808){return function(_0x3d3baa){return _0x3d3baa[_0x9de0('0x9')][_0x9de0('0xa')]()===_0x3da808['toLowerCase']();};}exports[_0x9de0('0xb')]=function(_0x29f56d,_0x5c1b24,_0x586593,_0x570169){return function(_0x4d5bca){try{var _0x131bd6={'name':_0x5c1b24[0x0],'timeout':_0x5c1b24[0x1]};var _0x2c8441=queue[_0x9de0('0x0')](_0x131bd6,{'typecast':!![]});if(_0x2c8441[_0x9de0('0xc')]){logger[_0x9de0('0xd')](_0x9de0('0xe'),_0x29f56d,_['map'](_0x2c8441,_0x9de0('0xf'))[_0x9de0('0x10')](',\x20'));_0x4d5bca[_0x9de0('0x11')]();}else{var _0x6ef69=_[_0x9de0('0x12')](_0x586593[_0x9de0('0x13')],handleFindAgent(_0x131bd6[_0x9de0('0x9')]));if(_0x6ef69){var _0x183ce5=(_0x131bd6[_0x9de0('0x14')]||0xa)*0x3e8;var _0x3ef965,_0x2ba01f;var _0x32d081=seqqueue[_0x9de0('0x15')](_0x183ce5);_0x32d081['id']=_0x29f56d;_0x32d081['atimeout']=_0x183ce5;_0x32d081['channel']=_0x570169[_0x9de0('0x16')];writeLog(_0x29f56d,_0x6ef69,util[_0x9de0('0x7')](_0x9de0('0x17'),_0x183ce5));_0x586593[_0x9de0('0x18')][_0x29f56d]['on'](_0x9de0('0x19'),function(){logger[_0x9de0('0x6')](_0x9de0('0x1a'),_0x29f56d);clearTimeout(_0x2ba01f);_0x2ba01f=undefined;_0x32d081['close']();if(_0x586593[_0x9de0('0x18')][_0x29f56d]){delete _0x586593[_0x9de0('0x18')][_0x29f56d];}_0x4d5bca[_0x9de0('0x11')]();});_0x586593['rules'][_0x29f56d]['on'](_0x9de0('0x1b'),function(){if(_0x586593['rules'][_0x29f56d]){delete _0x586593['rules'][_0x29f56d];}});_0x2ba01f=setTimeout(function(){logger[_0x9de0('0x6')](_0x9de0('0x1c'),_0x29f56d);clearTimeout(_0x2ba01f);_0x32d081[_0x9de0('0x1d')]();_0x4d5bca[_0x9de0('0x1e')]();},_0x183ce5);strategy[_0x9de0('0x1f')](_0x32d081,_0x6ef69,_0x586593,_0x570169);}else{logger['error'](_0x9de0('0x20'),_0x29f56d,_0x131bd6[_0x9de0('0x9')]);_0x4d5bca[_0x9de0('0x11')]();}}}catch(_0x1e2e87){console[_0x9de0('0x21')](_0x1e2e87);logger['error'](_0x9de0('0x22'),_0x29f56d,_0x1e2e87['stack']);_0x4d5bca['stop']();}};};
\ No newline at end of file
+var _0xdbdc=['next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xdbdc,0xfb));var _0xcdbd=function(_0x5eb4dd,_0x550a79){_0x5eb4dd=_0x5eb4dd-0x0;var _0x8af0e9=_0xdbdc[_0x5eb4dd];return _0x8af0e9;};'use strict';var schema=require('validate');var _=require(_0xcdbd('0x0'));var util=require(_0xcdbd('0x1'));var seqqueue=require(_0xcdbd('0x2'));var logger=require(_0xcdbd('0x3'))(_0xcdbd('0x4'));var strategy=require(_0xcdbd('0x5'));var queue=schema({'name':{'type':_0xcdbd('0x6'),'required':!![],'message':_0xcdbd('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x18c7e1,_0x5dc786,_0x446bd4){return logger[_0xcdbd('0x8')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x18c7e1,_0x5dc786[_0xcdbd('0x9')],_0x446bd4));}function handleFindAgent(_0x34da5b){return function(_0x1f249e){return _0x1f249e[_0xcdbd('0x9')][_0xcdbd('0xa')]()===_0x34da5b['toLowerCase']();};}exports[_0xcdbd('0xb')]=function(_0x2eca4d,_0x2b03d7,_0x103fb7,_0x40ca31){return function(_0x59b98a){try{var _0x422508={'name':_0x2b03d7[0x0],'timeout':_0x2b03d7[0x1]};var _0x1513c5=queue['validate'](_0x422508,{'typecast':!![]});if(_0x1513c5[_0xcdbd('0xc')]){logger['error'](_0xcdbd('0xd'),_0x2eca4d,_[_0xcdbd('0xe')](_0x1513c5,_0xcdbd('0xf'))[_0xcdbd('0x10')](',\x20'));_0x59b98a[_0xcdbd('0x11')]();}else{var _0x3ff830=_[_0xcdbd('0x12')](_0x103fb7[_0xcdbd('0x13')],handleFindAgent(_0x422508[_0xcdbd('0x9')]));if(_0x3ff830){var _0x448ad4=(_0x422508[_0xcdbd('0x14')]||0xa)*0x3e8;var _0x26bc0b,_0x3f3258;var _0x4fe5c4=seqqueue['createQueue'](_0x448ad4);_0x4fe5c4['id']=_0x2eca4d;_0x4fe5c4[_0xcdbd('0x15')]=_0x448ad4;_0x4fe5c4[_0xcdbd('0x16')]=_0x40ca31[_0xcdbd('0x16')];writeLog(_0x2eca4d,_0x3ff830,util['format'](_0xcdbd('0x17'),_0x448ad4));_0x103fb7[_0xcdbd('0x18')][_0x2eca4d]['on'](_0xcdbd('0x19'),function(){logger[_0xcdbd('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2eca4d);clearTimeout(_0x3f3258);_0x3f3258=undefined;_0x4fe5c4[_0xcdbd('0x1a')]();if(_0x103fb7[_0xcdbd('0x18')][_0x2eca4d]){delete _0x103fb7[_0xcdbd('0x18')][_0x2eca4d];}_0x59b98a[_0xcdbd('0x11')]();});_0x103fb7['rules'][_0x2eca4d]['on'](_0xcdbd('0x1b'),function(){if(_0x103fb7[_0xcdbd('0x18')][_0x2eca4d]){delete _0x103fb7['rules'][_0x2eca4d];}});_0x3f3258=setTimeout(function(){logger[_0xcdbd('0x8')](_0xcdbd('0x1c'),_0x2eca4d);clearTimeout(_0x3f3258);_0x4fe5c4[_0xcdbd('0x1a')]();_0x59b98a[_0xcdbd('0x1d')]();},_0x448ad4);strategy[_0xcdbd('0x1e')](_0x4fe5c4,_0x3ff830,_0x103fb7,_0x40ca31);}else{logger[_0xcdbd('0x1f')](_0xcdbd('0x20'),_0x2eca4d,_0x422508[_0xcdbd('0x9')]);_0x59b98a[_0xcdbd('0x11')]();}}}catch(_0x31306a){console[_0xcdbd('0x21')](_0x31306a);logger['error'](_0xcdbd('0x22'),_0x2eca4d,_0x31306a['stack']);_0x59b98a[_0xcdbd('0x11')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c73=['amazonlex','providerResponse','dialogState','Failed','error','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','providerName'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7c73,0x104));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x37c7('0x0'));var moment=require(_0x37c7('0x1'));var AWS=require(_0x37c7('0x2'));var utils=require('./utils');var logger=require(_0x37c7('0x3'))('routing');var rpc={'chatMessage':require(_0x37c7('0x4')),'openchannelMessage':require(_0x37c7('0x5')),'mailMessage':require(_0x37c7('0x6')),'smsMessage':require(_0x37c7('0x7')),'faxMessage':require(_0x37c7('0x8')),'whatsappMessage':require(_0x37c7('0x9'))};exports[_0x37c7('0xa')]=function(_0x150d75,_0x19a3e0){return function(_0x5723df){try{if(!_['isNil'](this['interaction'][_0x37c7('0xb')])){logger[_0x37c7('0xc')](_0x37c7('0xd'),_0x150d75,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5723df[_0x37c7('0xe')]();}var _0x284f69={'ContactId':this[_0x37c7('0xf')]['id'],'sentAt':moment()[_0x37c7('0x10')](_0x37c7('0x11')),'direction':_0x37c7('0x12')};if(this[_0x37c7('0x13')]===_0x37c7('0x14')||this[_0x37c7('0x13')]===_0x37c7('0x15')){_0x284f69[_0x37c7('0x16')]=this[_0x37c7('0x17')][_0x37c7('0x16')];}var _0xf3919e=this['channel'];if(_0xf3919e===_0x37c7('0x18')){_0x284f69[_0x37c7('0x19')]=this[_0x37c7('0x1a')]['id'];}else{_0x284f69[_[_0x37c7('0x1b')](_0xf3919e)+_0x37c7('0x1c')]=this[_0x37c7('0x1a')]['id'];}_0x284f69[_[_0x37c7('0x1b')](_0xf3919e)+_0x37c7('0x1d')]=this[_0x37c7('0x17')]['id'];if(this['interaction']['created']){var _0x3cb196=_0x19a3e0[0x4];if(!_[_0x37c7('0x1e')](_0x3cb196)){_0x284f69[_0x37c7('0x1f')]=utils[_0x37c7('0x20')](_0x3cb196,this);return rpc[_0xf3919e+_0x37c7('0x21')][_0x37c7('0x22')](_0x284f69)[_0x37c7('0x23')](function(_0x1c5efc){logger[_0x37c7('0xc')](_0x37c7('0xd'),_0x150d75,_0x284f69[_0x37c7('0x1f')]);})[_0x37c7('0x24')](function(_0x1c54b2){logger['error']('[%s][AMAZONLEX]\x20%s',_0x150d75,JSON[_0x37c7('0x25')](_0x1c54b2));})[_0x37c7('0x26')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x150d75);_0x5723df[_0x37c7('0x27')]();});}else{logger[_0x37c7('0xc')](_0x37c7('0x28'),_0x150d75);_0x5723df[_0x37c7('0x27')]();}}else{var _0x3db534=this;var _0x8275f6=new AWS[(_0x37c7('0x29'))]({'accessKeyId':_0x19a3e0[0x0],'secretAccessKey':_0x19a3e0[0x1],'region':_0x19a3e0[0x2]});var _0x221517={'botAlias':_0x37c7('0x2a'),'botName':_0x19a3e0[0x3],'inputText':this[_0x37c7('0x2b')][_0x37c7('0x1f')],'userId':this[_0x37c7('0x13')]+':'+this[_0x37c7('0x17')]['id'][_0x37c7('0x2c')]()};_0x8275f6['postText'](_0x221517,function(_0x3a2b32,_0xcd7549){if(_0x3a2b32){logger['error'](_0x37c7('0xd'),_0x150d75,_0x3a2b32[_0x37c7('0x2b')]);_0x5723df[_0x37c7('0xe')]();}else if(_0xcd7549&&_0xcd7549[_0x37c7('0x2b')]){_0x3db534[_0x37c7('0x1f')]['amazonlex']=_0xcd7549;_0x284f69[_0x37c7('0x1f')]=_0xcd7549[_0x37c7('0x2b')];_0x284f69[_0x37c7('0x2d')]=_0x37c7('0x2e');_0x284f69[_0x37c7('0x2f')]=JSON[_0x37c7('0x25')](_0xcd7549);return rpc[_0xf3919e+_0x37c7('0x21')][_0x37c7('0x22')](_0x284f69)[_0x37c7('0x23')](function(_0x1eb6f7){logger['info']('[%s][AMAZONLEX]\x20%s',_0x150d75,_0x284f69[_0x37c7('0x1f')]);if(_0xcd7549[_0x37c7('0x30')]==_0x37c7('0x31')){_0x5723df[_0x37c7('0xe')]();}else{_0x5723df[_0x37c7('0x27')]();}})[_0x37c7('0x24')](function(_0x3c8bcd){logger['error'](_0x37c7('0xd'),_0x150d75,JSON[_0x37c7('0x25')](_0x3c8bcd));_0x5723df[_0x37c7('0xe')]();});}else{_0x5723df['next']();}});}}catch(_0x39d92d){logger[_0x37c7('0x32')](_0x37c7('0xd'),_0x150d75,JSON[_0x37c7('0x25')](_0x39d92d));_0x5723df[_0x37c7('0x27')]();}};};
\ No newline at end of file
+var _0x3009=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','error','amazonlex','providerName','providerResponse','dialogState','Failed','catch','stringify','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','finally'];(function(_0x42c66d,_0x3feb6d){var _0x4f2b5f=function(_0x401103){while(--_0x401103){_0x42c66d['push'](_0x42c66d['shift']());}};_0x4f2b5f(++_0x3feb6d);}(_0x3009,0x14f));var _0x9300=function(_0x4ca159,_0x3d7770){_0x4ca159=_0x4ca159-0x0;var _0x20b45f=_0x3009[_0x4ca159];return _0x20b45f;};'use strict';var _=require(_0x9300('0x0'));var moment=require(_0x9300('0x1'));var AWS=require('aws-sdk');var utils=require(_0x9300('0x2'));var logger=require('../../../../config/logger')(_0x9300('0x3'));var rpc={'chatMessage':require(_0x9300('0x4')),'openchannelMessage':require(_0x9300('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9300('0x6')),'faxMessage':require(_0x9300('0x7')),'whatsappMessage':require(_0x9300('0x8'))};exports[_0x9300('0x9')]=function(_0x48c985,_0x3b2c21){return function(_0x53d3e8){try{if(!_['isNil'](this[_0x9300('0xa')][_0x9300('0xb')])){logger[_0x9300('0xc')](_0x9300('0xd'),_0x48c985,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x53d3e8[_0x9300('0xe')]();}var _0x367a3b={'ContactId':this[_0x9300('0xf')]['id'],'sentAt':moment()[_0x9300('0x10')](_0x9300('0x11')),'direction':'out'};if(this['channel']===_0x9300('0x12')||this[_0x9300('0x13')]===_0x9300('0x14')){_0x367a3b[_0x9300('0x15')]=this['interaction'][_0x9300('0x15')];}var _0x20eeb=this[_0x9300('0x13')];if(_0x20eeb==='chat'){_0x367a3b[_0x9300('0x16')]=this[_0x9300('0x17')]['id'];}else{_0x367a3b[_[_0x9300('0x18')](_0x20eeb)+_0x9300('0x19')]=this[_0x9300('0x17')]['id'];}_0x367a3b[_[_0x9300('0x18')](_0x20eeb)+_0x9300('0x1a')]=this[_0x9300('0xa')]['id'];if(this[_0x9300('0xa')][_0x9300('0x1b')]){var _0x18c59b=_0x3b2c21[0x4];if(!_[_0x9300('0x1c')](_0x18c59b)){_0x367a3b[_0x9300('0x1d')]=utils['getMustacheRender'](_0x18c59b,this);return rpc[_0x20eeb+_0x9300('0x1e')][_0x9300('0x1f')](_0x367a3b)['then'](function(_0x32b528){logger['info']('[%s][AMAZONLEX]\x20%s',_0x48c985,_0x367a3b[_0x9300('0x1d')]);})['catch'](function(_0x35d4b1){logger['error'](_0x9300('0xd'),_0x48c985,JSON['stringify'](_0x35d4b1));})[_0x9300('0x20')](function(){logger[_0x9300('0xc')](_0x9300('0x21'),_0x48c985);_0x53d3e8[_0x9300('0x22')]();});}else{logger[_0x9300('0xc')](_0x9300('0x23'),_0x48c985);_0x53d3e8[_0x9300('0x22')]();}}else{var _0x60e440=this;var _0x11f338=new AWS['LexRuntime']({'accessKeyId':_0x3b2c21[0x0],'secretAccessKey':_0x3b2c21[0x1],'region':_0x3b2c21[0x2]});var _0x5b5aad={'botAlias':_0x9300('0x24'),'botName':_0x3b2c21[0x3],'inputText':this[_0x9300('0x25')]['body'],'userId':this[_0x9300('0x13')]+':'+this['interaction']['id']['toString']()};_0x11f338['postText'](_0x5b5aad,function(_0x1d6a2b,_0xb20fd4){if(_0x1d6a2b){logger[_0x9300('0x26')](_0x9300('0xd'),_0x48c985,_0x1d6a2b[_0x9300('0x25')]);_0x53d3e8[_0x9300('0xe')]();}else if(_0xb20fd4&&_0xb20fd4[_0x9300('0x25')]){_0x60e440[_0x9300('0x1d')][_0x9300('0x27')]=_0xb20fd4;_0x367a3b[_0x9300('0x1d')]=_0xb20fd4[_0x9300('0x25')];_0x367a3b[_0x9300('0x28')]=_0x9300('0x27');_0x367a3b[_0x9300('0x29')]=JSON['stringify'](_0xb20fd4);return rpc[_0x20eeb+'Message'][_0x9300('0x1f')](_0x367a3b)['then'](function(_0x10b688){logger[_0x9300('0xc')](_0x9300('0xd'),_0x48c985,_0x367a3b[_0x9300('0x1d')]);if(_0xb20fd4[_0x9300('0x2a')]==_0x9300('0x2b')){_0x53d3e8[_0x9300('0xe')]();}else{_0x53d3e8['stop']();}})[_0x9300('0x2c')](function(_0x1b4f7e){logger[_0x9300('0x26')](_0x9300('0xd'),_0x48c985,JSON[_0x9300('0x2d')](_0x1b4f7e));_0x53d3e8['next']();});}else{_0x53d3e8[_0x9300('0xe')]();}});}}catch(_0x4354ce){logger['error']('[%s][AMAZONLEX]\x20%s',_0x48c985,JSON[_0x9300('0x2d')](_0x4354ce));_0x53d3e8[_0x9300('0x22')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2dd=['body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','mail','getMustacheRender','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','consequence','channel'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0xd2dd,0xbc));var _0xdd2d=function(_0x527042,_0x3a6662){_0x527042=_0x527042-0x0;var _0x11d672=_0xd2dd[_0x527042];return _0x11d672;};'use strict';var _=require(_0xdd2d('0x0'));var moment=require(_0xdd2d('0x1'));var utils=require('./utils');var logger=require(_0xdd2d('0x2'))(_0xdd2d('0x3'));var rpc={'chatMessage':require(_0xdd2d('0x4')),'openchannelMessage':require(_0xdd2d('0x5')),'mailMessage':require(_0xdd2d('0x6')),'smsMessage':require(_0xdd2d('0x7')),'faxMessage':require(_0xdd2d('0x8')),'whatsappMessage':require(_0xdd2d('0x9')),'chatInteraction':require(_0xdd2d('0xa')),'openchannelInteraction':require(_0xdd2d('0xb')),'mailInteraction':require(_0xdd2d('0xc')),'smsInteraction':require(_0xdd2d('0xd')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xdd2d('0xe')]=function(_0x39405c,_0x535aca,_0x2cf435,_0x3525dd){return function(_0x44ed51){try{var _0x29f2d9=this[_0xdd2d('0xf')];if(_0x29f2d9==='mail'&&_0x3525dd[_0xdd2d('0x10')][_0xdd2d('0x11')]){logger[_0xdd2d('0x12')](_0xdd2d('0x13'),_0x39405c,_0xdd2d('0x14'));return _0x44ed51[_0xdd2d('0x15')]();}if(_0x535aca[0x0]==='1'&&(_[_0xdd2d('0x16')](this[_0xdd2d('0x17')][_0xdd2d('0x18')])||!this['interaction']['created'])){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x39405c,_0xdd2d('0x19'));return _0x44ed51[_0xdd2d('0x15')]();}if(_0x535aca[0x0]==='2'&&this[_0xdd2d('0x17')][_0xdd2d('0x1a')]){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39405c,_0xdd2d('0x1b'));return _0x44ed51['next']();}var _0x4e29f3={'ContactId':this[_0xdd2d('0x1c')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xdd2d('0xf')]===_0xdd2d('0x1d')){_0x4e29f3[_0xdd2d('0x10')]=utils[_0xdd2d('0x1e')](_0x535aca[0x2],this);}else{_0x4e29f3[_0xdd2d('0x10')]=utils[_0xdd2d('0x1e')](_0x535aca[0x1],this);}if(this[_0xdd2d('0x1f')]){_0x4e29f3['to']=this[_0xdd2d('0x1f')]['from']||'';if(this[_0xdd2d('0xf')]===_0xdd2d('0x1d')&&_0x535aca[0x1]==='1'){_0x4e29f3['cc']=this[_0xdd2d('0x1f')]['cc']||'';}_0x4e29f3[_0xdd2d('0x20')]=this[_0xdd2d('0x1f')]['to']||'';_0x4e29f3[_0xdd2d('0x21')]=this[_0xdd2d('0x1f')][_0xdd2d('0x21')]||'';_0x4e29f3[_0xdd2d('0x22')]=!![];if(this[_0xdd2d('0x1f')][_0xdd2d('0x23')]){_0x4e29f3[_0xdd2d('0x23')]='';_0x4e29f3[_0xdd2d('0x23')]+=_[_0xdd2d('0x24')](this[_0xdd2d('0x1f')][_0xdd2d('0x23')],'Re:')?'':'Re:\x20';_0x4e29f3['subject']+=this[_0xdd2d('0x1f')][_0xdd2d('0x23')];}}if(this[_0xdd2d('0xf')]===_0xdd2d('0x25')){_0x4e29f3[_0xdd2d('0x26')]=this[_0xdd2d('0x27')]['id'];}else{_0x4e29f3[_[_0xdd2d('0x28')](this[_0xdd2d('0xf')])+_0xdd2d('0x29')]=this['account']['id'];}_0x4e29f3[_[_0xdd2d('0x28')](this[_0xdd2d('0xf')])+_0xdd2d('0x2a')]=this['interaction']['id'];var _0x50a526=this[_0xdd2d('0x17')];if(rpc[this[_0xdd2d('0xf')]+_0xdd2d('0x2b')]){if(this[_0xdd2d('0xf')]===_0xdd2d('0x1d')){_0x4e29f3[_0xdd2d('0x2c')]=this[_0xdd2d('0x1f')][_0xdd2d('0x2d')];_0x4e29f3[_0xdd2d('0x2e')]='<div\x20id=\x22xm-mail-content\x22>'+_['replace'](_0x4e29f3['body'],_0xdd2d('0x2f'),_0xdd2d('0x30'))+_0xdd2d('0x31');_0x4e29f3[_0xdd2d('0x32')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0xdd2d('0x33')};return mailRpc[_0xdd2d('0x34')](this[_0xdd2d('0x27')][_0xdd2d('0x35')],_0x4e29f3)['then'](function(_0x1d003c){logger[_0xdd2d('0x12')](_0xdd2d('0x36'),_0x39405c);_0x4e29f3[_0xdd2d('0x2d')]=_0x1d003c['message'][_0xdd2d('0x2d')];return rpc[_0x29f2d9+_0xdd2d('0x2b')][_0xdd2d('0x37')](_0x4e29f3);})[_0xdd2d('0x38')](function(_0x417157){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x39405c,JSON[_0xdd2d('0x39')](_0x417157));})[_0xdd2d('0x3a')](function(_0x53391c){logger[_0xdd2d('0x3b')](_0xdd2d('0x3c'),_0x39405c,JSON[_0xdd2d('0x39')](_0x53391c));})[_0xdd2d('0x3d')](function(){Promise[_0xdd2d('0x3e')]()[_0xdd2d('0x38')](function(){if(_0x535aca[0x0]!=='2'||_0x50a526[_0xdd2d('0x1a')])return;return rpc[_0x29f2d9+_0xdd2d('0x3f')][_0xdd2d('0x40')](_0x50a526['id'],{'autoreplyExecuted':!![]})[_0xdd2d('0x38')](function(_0xc441ea){logger[_0xdd2d('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39405c,JSON['stringify'](_0xc441ea));})[_0xdd2d('0x3a')](function(_0x5efc60){logger['error'](_0xdd2d('0x41'),_0x39405c,JSON['stringify'](_0x5efc60));});})[_0xdd2d('0x38')](function(){_0x44ed51['next']();});});}else{return rpc[this[_0xdd2d('0xf')]+_0xdd2d('0x2b')]['create'](_0x4e29f3)['then'](function(){logger['info'](_0xdd2d('0x13'),_0x39405c,_0x4e29f3[_0xdd2d('0x10')]);})['catch'](function(_0x5e9ca5){logger['error'](_0xdd2d('0x13'),_0x39405c,JSON[_0xdd2d('0x39')](_0x5e9ca5));})[_0xdd2d('0x3d')](function(){Promise[_0xdd2d('0x3e')]()[_0xdd2d('0x38')](function(){if(_0x535aca[0x0]!=='2'||_0x50a526[_0xdd2d('0x1a')])return;return rpc[_0x29f2d9+_0xdd2d('0x3f')][_0xdd2d('0x40')](_0x50a526['id'],{'autoreplyExecuted':!![]})[_0xdd2d('0x38')](function(_0x34e341){logger[_0xdd2d('0x12')](_0xdd2d('0x42'),_0x39405c,JSON[_0xdd2d('0x39')](_0x34e341));})[_0xdd2d('0x3a')](function(_0x389221){logger[_0xdd2d('0x3b')](_0xdd2d('0x41'),_0x39405c,JSON[_0xdd2d('0x39')](_0x389221));});})[_0xdd2d('0x38')](function(){_0x44ed51['next']();});});}}}catch(_0x58f24a){logger[_0xdd2d('0x3b')](_0xdd2d('0x13'),_0x39405c,JSON['stringify'](_0x58f24a));_0x44ed51[_0xdd2d('0x43')]();}};};
\ No newline at end of file
+var _0x3f51=['AccountId','InteractionId','Message','messageId','replace','<div','</div>','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst'];(function(_0x589f19,_0x25b703){var _0x32d643=function(_0x6d9db6){while(--_0x6d9db6){_0x589f19['push'](_0x589f19['shift']());}};_0x32d643(++_0x25b703);}(_0x3f51,0xe0));var _0x13f5=function(_0xb72a8f,_0x37591b){_0xb72a8f=_0xb72a8f-0x0;var _0x5b9da7=_0x3f51[_0xb72a8f];return _0x5b9da7;};'use strict';var _=require(_0x13f5('0x0'));var moment=require('moment');var utils=require(_0x13f5('0x1'));var logger=require(_0x13f5('0x2'))(_0x13f5('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x13f5('0x4')),'smsMessage':require(_0x13f5('0x5')),'faxMessage':require(_0x13f5('0x6')),'whatsappMessage':require(_0x13f5('0x7')),'chatInteraction':require(_0x13f5('0x8')),'openchannelInteraction':require(_0x13f5('0x9')),'mailInteraction':require(_0x13f5('0xa')),'smsInteraction':require(_0x13f5('0xb')),'faxInteraction':require(_0x13f5('0xc')),'whatsappInteraction':require(_0x13f5('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x13f5('0xe')]=function(_0x3ddcdf,_0x2b04e6,_0x2d64a1,_0x4594ad){return function(_0x3c8a63){try{var _0x4797fd=this[_0x13f5('0xf')];if(_0x4797fd===_0x13f5('0x10')&&_0x4594ad[_0x13f5('0x11')][_0x13f5('0x12')]){logger[_0x13f5('0x13')](_0x13f5('0x14'),_0x3ddcdf,_0x13f5('0x15'));return _0x3c8a63[_0x13f5('0x16')]();}if(_0x2b04e6[0x0]==='1'&&(_[_0x13f5('0x17')](this['interaction'][_0x13f5('0x18')])||!this['interaction'][_0x13f5('0x18')])){logger[_0x13f5('0x13')](_0x13f5('0x14'),_0x3ddcdf,'Autoreply\x20already\x20sent');return _0x3c8a63[_0x13f5('0x16')]();}if(_0x2b04e6[0x0]==='2'&&this[_0x13f5('0x19')][_0x13f5('0x1a')]){logger['info'](_0x13f5('0x1b'),_0x3ddcdf,_0x13f5('0x1c'));return _0x3c8a63['next']();}var _0x510d0a={'ContactId':this[_0x13f5('0x1d')]['id'],'sentAt':moment()[_0x13f5('0x1e')](_0x13f5('0x1f')),'direction':_0x13f5('0x20')};if(this[_0x13f5('0xf')]==='mail'){_0x510d0a[_0x13f5('0x11')]=utils[_0x13f5('0x21')](_0x2b04e6[0x2],this);}else{_0x510d0a['body']=utils['getMustacheRender'](_0x2b04e6[0x1],this);}if(this[_0x13f5('0x22')]){_0x510d0a['to']=this[_0x13f5('0x22')][_0x13f5('0x23')]||'';if(this[_0x13f5('0xf')]===_0x13f5('0x10')&&_0x2b04e6[0x1]==='1'){_0x510d0a['cc']=this['message']['cc']||'';}_0x510d0a[_0x13f5('0x23')]=this[_0x13f5('0x22')]['to']||'';_0x510d0a[_0x13f5('0x24')]=this[_0x13f5('0x22')][_0x13f5('0x24')]||'';_0x510d0a['read']=!![];if(this[_0x13f5('0x22')][_0x13f5('0x25')]){_0x510d0a['subject']='';_0x510d0a['subject']+=_['startsWith'](this[_0x13f5('0x22')][_0x13f5('0x25')],_0x13f5('0x26'))?'':_0x13f5('0x27');_0x510d0a[_0x13f5('0x25')]+=this['message'][_0x13f5('0x25')];}}if(this[_0x13f5('0xf')]===_0x13f5('0x28')){_0x510d0a[_0x13f5('0x29')]=this[_0x13f5('0x2a')]['id'];}else{_0x510d0a[_[_0x13f5('0x2b')](this[_0x13f5('0xf')])+_0x13f5('0x2c')]=this[_0x13f5('0x2a')]['id'];}_0x510d0a[_[_0x13f5('0x2b')](this['channel'])+_0x13f5('0x2d')]=this['interaction']['id'];var _0x2cc521=this[_0x13f5('0x19')];if(rpc[this['channel']+_0x13f5('0x2e')]){if(this[_0x13f5('0xf')]===_0x13f5('0x10')){_0x510d0a['inReplyTo']=this['message'][_0x13f5('0x2f')];_0x510d0a['html']='<div\x20id=\x22xm-mail-content\x22>'+_[_0x13f5('0x30')](_0x510d0a['body'],'<div\x20id=\x22xm-mail-content\x22',_0x13f5('0x31'))+_0x13f5('0x32');_0x510d0a['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x13f5('0x33'),'Precedence':_0x13f5('0x34')};return mailRpc[_0x13f5('0x35')](this[_0x13f5('0x2a')][_0x13f5('0x36')],_0x510d0a)[_0x13f5('0x37')](function(_0x193679){logger['info'](_0x13f5('0x38'),_0x3ddcdf);_0x510d0a[_0x13f5('0x2f')]=_0x193679[_0x13f5('0x22')][_0x13f5('0x2f')];return rpc[_0x4797fd+_0x13f5('0x2e')]['create'](_0x510d0a);})[_0x13f5('0x37')](function(_0x9c97e7){logger[_0x13f5('0x13')](_0x13f5('0x14'),_0x3ddcdf,JSON[_0x13f5('0x39')](_0x9c97e7));})[_0x13f5('0x3a')](function(_0x31bdf5){logger['error'](_0x13f5('0x3b'),_0x3ddcdf,JSON[_0x13f5('0x39')](_0x31bdf5));})[_0x13f5('0x3c')](function(){Promise[_0x13f5('0x3d')]()[_0x13f5('0x37')](function(){if(_0x2b04e6[0x0]!=='2'||_0x2cc521[_0x13f5('0x1a')])return;return rpc[_0x4797fd+_0x13f5('0x3e')][_0x13f5('0x3f')](_0x2cc521['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1fc7e3){logger[_0x13f5('0x13')](_0x13f5('0x1b'),_0x3ddcdf,JSON[_0x13f5('0x39')](_0x1fc7e3));})[_0x13f5('0x3a')](function(_0x53ec09){logger[_0x13f5('0x40')](_0x13f5('0x41'),_0x3ddcdf,JSON[_0x13f5('0x39')](_0x53ec09));});})[_0x13f5('0x37')](function(){_0x3c8a63[_0x13f5('0x16')]();});});}else{return rpc[this[_0x13f5('0xf')]+'Message']['create'](_0x510d0a)[_0x13f5('0x37')](function(){logger[_0x13f5('0x13')](_0x13f5('0x14'),_0x3ddcdf,_0x510d0a[_0x13f5('0x11')]);})[_0x13f5('0x3a')](function(_0xbebea9){logger[_0x13f5('0x40')]('[%s][AUTOREPLY]\x20%s',_0x3ddcdf,JSON[_0x13f5('0x39')](_0xbebea9));})['finally'](function(){Promise[_0x13f5('0x3d')]()[_0x13f5('0x37')](function(){if(_0x2b04e6[0x0]!=='2'||_0x2cc521[_0x13f5('0x1a')])return;return rpc[_0x4797fd+_0x13f5('0x3e')][_0x13f5('0x3f')](_0x2cc521['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1ca071){logger[_0x13f5('0x13')](_0x13f5('0x1b'),_0x3ddcdf,JSON[_0x13f5('0x39')](_0x1ca071));})['catch'](function(_0x396d5c){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3ddcdf,JSON[_0x13f5('0x39')](_0x396d5c));});})['then'](function(){_0x3c8a63['next']();});});}}}catch(_0x3dbb18){logger[_0x13f5('0x40')](_0x13f5('0x14'),_0x3ddcdf,JSON[_0x13f5('0x39')](_0x3dbb18));_0x3c8a63[_0x13f5('0x42')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbad7=['channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','system'];(function(_0x184bdc,_0x2b3343){var _0x5c2a17=function(_0x4683f0){while(--_0x4683f0){_0x184bdc['push'](_0x184bdc['shift']());}};_0x5c2a17(++_0x2b3343);}(_0xbad7,0x1ee));var _0x7bad=function(_0x4e713e,_0x1ac682){_0x4e713e=_0x4e713e-0x0;var _0x296ac0=_0xbad7[_0x4e713e];return _0x296ac0;};'use strict';var moment=require(_0x7bad('0x0'));var logger=require(_0x7bad('0x1'))(_0x7bad('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7bad('0x3')),'smsInteraction':require(_0x7bad('0x4')),'mailInteraction':require(_0x7bad('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7bad('0x6'))};exports[_0x7bad('0x7')]=function(_0x171191,_0x2cb202,_0x26bbac,_0x579cc8){return function(_0x3fd69c){try{logger[_0x7bad('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x171191,_0x2cb202[0x0]);var _0x4bdc5d={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x7bad('0x9'),'disposition':_0x2cb202[0x0]};if(rpc[_0x579cc8[_0x7bad('0xa')]+_0x7bad('0xb')]){rpc[_0x579cc8[_0x7bad('0xa')]+_0x7bad('0xb')][_0x7bad('0xc')](_0x579cc8[_0x7bad('0xd')]['id'],_0x4bdc5d)[_0x7bad('0xe')](function(_0x2511e8){logger['info'](_0x7bad('0xf'),_0x171191,_0x579cc8['interaction']['id']);})[_0x7bad('0x10')](function(_0x2a2e9f){logger[_0x7bad('0x11')]('[%s][CLOSE]\x20%s',_0x171191,JSON[_0x7bad('0x12')](_0x2a2e9f));})[_0x7bad('0x13')](function(){_0x3fd69c['stop']();});}}catch(_0x3bd54f){logger[_0x7bad('0x11')](_0x7bad('0x14'),_0x171191,JSON[_0x7bad('0x12')](_0x3bd54f));_0x3fd69c['stop']();}};};
\ No newline at end of file
+var _0x57c7=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57c7,0x75));var _0x757c=function(_0xe829da,_0x58db0c){_0xe829da=_0xe829da-0x0;var _0xf089bb=_0x57c7[_0xe829da];return _0xf089bb;};'use strict';var moment=require(_0x757c('0x0'));var logger=require(_0x757c('0x1'))(_0x757c('0x2'));var rpc={'chatInteraction':require(_0x757c('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x757c('0x4')),'faxInteraction':require(_0x757c('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x757c('0x6')]=function(_0x4e4628,_0x37e529,_0x9a0733,_0x5b40c0){return function(_0x14552){try{logger[_0x757c('0x7')](_0x757c('0x8'),_0x4e4628,_0x37e529[0x0]);var _0x390965={'closed':0x1,'closedAt':moment()[_0x757c('0x9')](_0x757c('0xa')),'closeReason':'system','disposition':_0x37e529[0x0]};if(rpc[_0x5b40c0[_0x757c('0xb')]+_0x757c('0xc')]){rpc[_0x5b40c0[_0x757c('0xb')]+'Interaction']['update'](_0x5b40c0[_0x757c('0xd')]['id'],_0x390965)[_0x757c('0xe')](function(_0x26fa7b){logger[_0x757c('0x7')](_0x757c('0xf'),_0x4e4628,_0x5b40c0['interaction']['id']);})[_0x757c('0x10')](function(_0x48b64d){logger[_0x757c('0x11')]('[%s][CLOSE]\x20%s',_0x4e4628,JSON[_0x757c('0x12')](_0x48b64d));})[_0x757c('0x13')](function(){_0x14552[_0x757c('0x14')]();});}}catch(_0x51025f){logger[_0x757c('0x11')](_0x757c('0x15'),_0x4e4628,JSON[_0x757c('0x12')](_0x51025f));_0x14552[_0x757c('0x14')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe314=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','result','speech','providerName','providerResponse','create','metadata','error','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat'];(function(_0x1b60db,_0x393e9c){var _0x261f63=function(_0x5215bf){while(--_0x5215bf){_0x1b60db['push'](_0x1b60db['shift']());}};_0x261f63(++_0x393e9c);}(_0xe314,0x7c));var _0x4e31=function(_0x2aaf0c,_0x120301){_0x2aaf0c=_0x2aaf0c-0x0;var _0x2ccbed=_0xe314[_0x2aaf0c];return _0x2ccbed;};'use strict';var _=require('lodash');var moment=require(_0x4e31('0x0'));var apiai=require(_0x4e31('0x1'));var md5=require(_0x4e31('0x2'));var utils=require(_0x4e31('0x3'));var logger=require(_0x4e31('0x4'))(_0x4e31('0x5'));var rpc={'chatMessage':require(_0x4e31('0x6')),'openchannelMessage':require(_0x4e31('0x7')),'mailMessage':require(_0x4e31('0x8')),'smsMessage':require(_0x4e31('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4e31('0xa')]=function(_0x29d63d,_0x608c4d){return function(_0x311a10){try{if(!_[_0x4e31('0xb')](this[_0x4e31('0xc')]['UserId'])){logger[_0x4e31('0xd')](_0x4e31('0xe'),_0x29d63d,_0x4e31('0xf'));return _0x311a10[_0x4e31('0x10')]();}var _0x4e822f={'ContactId':this[_0x4e31('0x11')]['id'],'sentAt':moment()[_0x4e31('0x12')](_0x4e31('0x13')),'direction':_0x4e31('0x14')};if(this[_0x4e31('0x15')]===_0x4e31('0x16')||this[_0x4e31('0x15')]===_0x4e31('0x17')){_0x4e822f[_0x4e31('0x18')]=this[_0x4e31('0xc')][_0x4e31('0x18')];}var _0x2033df=this[_0x4e31('0x15')];if(_0x2033df===_0x4e31('0x19')){_0x4e822f[_0x4e31('0x1a')]=this[_0x4e31('0x1b')]['id'];}else{_0x4e822f[_[_0x4e31('0x1c')](_0x2033df)+_0x4e31('0x1d')]=this['account']['id'];}_0x4e822f[_[_0x4e31('0x1c')](_0x2033df)+_0x4e31('0x1e')]=this['interaction']['id'];if(this[_0x4e31('0xc')][_0x4e31('0x1f')]){var _0x10203f=_0x608c4d[0x2];if(!_['isEmpty'](_0x10203f)){_0x4e822f[_0x4e31('0x20')]=utils[_0x4e31('0x21')](_0x10203f,this);return rpc[_0x2033df+_0x4e31('0x22')]['create'](_0x4e822f)[_0x4e31('0x23')](function(_0x4264f7){logger[_0x4e31('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x29d63d,_0x4e822f[_0x4e31('0x20')]);})[_0x4e31('0x24')](function(_0x5023aa){logger['error'](_0x4e31('0xe'),_0x29d63d,JSON[_0x4e31('0x25')](_0x5023aa));})[_0x4e31('0x26')](function(){logger[_0x4e31('0xd')](_0x4e31('0x27'),_0x29d63d);_0x311a10[_0x4e31('0x28')]();});}else{logger[_0x4e31('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x29d63d);_0x311a10[_0x4e31('0x28')]();}}else{var _0x31c5dc=this;var _0x240d19=apiai(_0x608c4d[0x0],{'language':_0x608c4d[0x1]||'en'});return _0x240d19['textRequest'](this[_0x4e31('0x29')][_0x4e31('0x20')],{'sessionId':md5(this[_0x4e31('0xc')]['id'])})[_0x4e31('0x23')](function(_0x12efaf){_0x31c5dc['body'][_0x4e31('0x2a')]=_0x12efaf;_0x4e822f[_0x4e31('0x20')]=_0x12efaf[_0x4e31('0x2b')]['fulfillment'][_0x4e31('0x2c')];_0x4e822f[_0x4e31('0x2d')]=_0x4e31('0x2a');_0x4e822f[_0x4e31('0x2e')]=JSON[_0x4e31('0x25')](_0x12efaf);return rpc[_0x2033df+_0x4e31('0x22')][_0x4e31('0x2f')](_0x4e822f)[_0x4e31('0x23')](function(_0x24b4e5){logger[_0x4e31('0xd')](_0x4e31('0xe'),_0x29d63d,_0x4e822f['body']);if(_0x12efaf[_0x4e31('0x2b')][_0x4e31('0x30')]['endConversation']){_0x311a10[_0x4e31('0x10')]();}else{_0x311a10[_0x4e31('0x28')]();}})['catch'](function(_0x2fb71b){logger['error'](_0x4e31('0xe'),_0x29d63d,JSON[_0x4e31('0x25')](_0x2fb71b));_0x311a10['next']();});})[_0x4e31('0x24')](function(_0x446df6){logger[_0x4e31('0x31')](_0x4e31('0xe'),_0x29d63d,_0x446df6[_0x4e31('0x29')]);_0x311a10[_0x4e31('0x10')]();});}}catch(_0x26f79b){logger[_0x4e31('0x31')](_0x4e31('0xe'),_0x29d63d,JSON[_0x4e31('0x25')](_0x26f79b));_0x311a10['stop']();}};};
\ No newline at end of file
+var _0x2f4a=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','next','contact','format','out','sms','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','body','getMustacheRender','info','[%s][DIALOGFLOW]\x20%s','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then','dialogflow','result','speech','providerName','providerResponse','Message','create','metadata','endConversation','error','message','lodash','moment','apiai-promise','md5'];(function(_0x4108b8,_0xb5fc5e){var _0x39e90f=function(_0x39fbaf){while(--_0x39fbaf){_0x4108b8['push'](_0x4108b8['shift']());}};_0x39e90f(++_0xb5fc5e);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2f4a[_0x432682];return _0x463d05;};'use strict';var _=require(_0xa2f4('0x0'));var moment=require(_0xa2f4('0x1'));var apiai=require(_0xa2f4('0x2'));var md5=require(_0xa2f4('0x3'));var utils=require(_0xa2f4('0x4'));var logger=require(_0xa2f4('0x5'))(_0xa2f4('0x6'));var rpc={'chatMessage':require(_0xa2f4('0x7')),'openchannelMessage':require(_0xa2f4('0x8')),'mailMessage':require(_0xa2f4('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa2f4('0xa')),'whatsappMessage':require(_0xa2f4('0xb'))};exports[_0xa2f4('0xc')]=function(_0x151045,_0x2cd086){return function(_0x194ee8){try{if(!_['isNil'](this[_0xa2f4('0xd')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x151045,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x194ee8[_0xa2f4('0xe')]();}var _0x1a8c24={'ContactId':this[_0xa2f4('0xf')]['id'],'sentAt':moment()[_0xa2f4('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa2f4('0x11')};if(this['channel']===_0xa2f4('0x12')||this[_0xa2f4('0x13')]==='whatsapp'){_0x1a8c24[_0xa2f4('0x14')]=this['interaction'][_0xa2f4('0x14')];}var _0x485447=this[_0xa2f4('0x13')];if(_0x485447==='chat'){_0x1a8c24[_0xa2f4('0x15')]=this[_0xa2f4('0x16')]['id'];}else{_0x1a8c24[_[_0xa2f4('0x17')](_0x485447)+_0xa2f4('0x18')]=this[_0xa2f4('0x16')]['id'];}_0x1a8c24[_[_0xa2f4('0x17')](_0x485447)+'InteractionId']=this[_0xa2f4('0xd')]['id'];if(this[_0xa2f4('0xd')]['created']){var _0x4ae792=_0x2cd086[0x2];if(!_[_0xa2f4('0x19')](_0x4ae792)){_0x1a8c24[_0xa2f4('0x1a')]=utils[_0xa2f4('0x1b')](_0x4ae792,this);return rpc[_0x485447+'Message']['create'](_0x1a8c24)['then'](function(_0x5a0aa3){logger[_0xa2f4('0x1c')](_0xa2f4('0x1d'),_0x151045,_0x1a8c24['body']);})[_0xa2f4('0x1e')](function(_0x426013){logger['error'](_0xa2f4('0x1d'),_0x151045,JSON[_0xa2f4('0x1f')](_0x426013));})[_0xa2f4('0x20')](function(){logger[_0xa2f4('0x1c')](_0xa2f4('0x21'),_0x151045);_0x194ee8[_0xa2f4('0x22')]();});}else{logger[_0xa2f4('0x1c')](_0xa2f4('0x23'),_0x151045);_0x194ee8[_0xa2f4('0x22')]();}}else{var _0x21dce2=this;var _0x47c203=apiai(_0x2cd086[0x0],{'language':_0x2cd086[0x1]||'en'});return _0x47c203[_0xa2f4('0x24')](this['message'][_0xa2f4('0x1a')],{'sessionId':md5(this['interaction']['id'])})[_0xa2f4('0x25')](function(_0x235cae){_0x21dce2[_0xa2f4('0x1a')][_0xa2f4('0x26')]=_0x235cae;_0x1a8c24['body']=_0x235cae[_0xa2f4('0x27')]['fulfillment'][_0xa2f4('0x28')];_0x1a8c24[_0xa2f4('0x29')]='dialogflow';_0x1a8c24[_0xa2f4('0x2a')]=JSON[_0xa2f4('0x1f')](_0x235cae);return rpc[_0x485447+_0xa2f4('0x2b')][_0xa2f4('0x2c')](_0x1a8c24)[_0xa2f4('0x25')](function(_0x49824c){logger[_0xa2f4('0x1c')](_0xa2f4('0x1d'),_0x151045,_0x1a8c24[_0xa2f4('0x1a')]);if(_0x235cae[_0xa2f4('0x27')][_0xa2f4('0x2d')][_0xa2f4('0x2e')]){_0x194ee8[_0xa2f4('0xe')]();}else{_0x194ee8[_0xa2f4('0x22')]();}})[_0xa2f4('0x1e')](function(_0x3650fc){logger[_0xa2f4('0x2f')](_0xa2f4('0x1d'),_0x151045,JSON[_0xa2f4('0x1f')](_0x3650fc));_0x194ee8['next']();});})[_0xa2f4('0x1e')](function(_0x4bfd92){logger[_0xa2f4('0x2f')](_0xa2f4('0x1d'),_0x151045,_0x4bfd92[_0xa2f4('0x30')]);_0x194ee8[_0xa2f4('0xe')]();});}}catch(_0x383f9d){logger[_0xa2f4('0x2f')](_0xa2f4('0x1d'),_0x151045,JSON['stringify'](_0x383f9d));_0x194ee8[_0xa2f4('0x22')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f77=['DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerResponse','length','fulfillmentText','all','next','message','stack','lodash','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name'];(function(_0x527536,_0x192f94){var _0x11f19d=function(_0x53c6c0){while(--_0x53c6c0){_0x527536['push'](_0x527536['shift']());}};_0x11f19d(++_0x192f94);}(_0x8f77,0x1d8));var _0x78f7=function(_0x3966b3,_0x59c284){_0x3966b3=_0x3966b3-0x0;var _0x22fbb2=_0x8f77[_0x3966b3];return _0x22fbb2;};'use strict';var _=require(_0x78f7('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x78f7('0x1'));var moment=require(_0x78f7('0x2'));var Promise=require(_0x78f7('0x3'));var logger=require('../../../../config/logger')(_0x78f7('0x4'));var utils=require(_0x78f7('0x5'));var rpc={'chatMessage':require(_0x78f7('0x6')),'openchannelMessage':require(_0x78f7('0x7')),'mailMessage':require(_0x78f7('0x8')),'smsMessage':require(_0x78f7('0x9')),'faxMessage':require(_0x78f7('0xa')),'whatsappMessage':require(_0x78f7('0xb'))};function createMessage(_0x34bcdc,_0x7975c1,_0xce558c,_0x54538f){return new Promise(function(_0x33017d,_0x458b59){var _0x3c5823=_['clone'](_0xce558c);_0x3c5823[_0x78f7('0xc')]=_0x54538f;return rpc[_0x7975c1+_0x78f7('0xd')][_0x78f7('0xe')](_0x3c5823)['then'](function(){logger[_0x78f7('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x34bcdc,_0x3c5823[_0x78f7('0xc')]);_0x33017d();})[_0x78f7('0x10')](function(_0x23adf0){logger[_0x78f7('0x11')](_0x78f7('0x12'),_0x34bcdc,JSON[_0x78f7('0x13')](_0x23adf0));_0x458b59(_0x23adf0);});});}exports[_0x78f7('0x14')]=function(_0x1b6eb7,_0x23c843){return function(_0x47341e){try{if(!_[_0x78f7('0x15')](this[_0x78f7('0x16')]['UserId'])){logger[_0x78f7('0xf')](_0x78f7('0x12'),_0x1b6eb7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x47341e['next']();}var _0x13cfda={'ContactId':this[_0x78f7('0x17')]['id'],'sentAt':moment()[_0x78f7('0x18')](_0x78f7('0x19')),'direction':_0x78f7('0x1a')};if(this[_0x78f7('0x1b')]===_0x78f7('0x1c')||this[_0x78f7('0x1b')]===_0x78f7('0x1d')){_0x13cfda[_0x78f7('0x1e')]=this[_0x78f7('0x16')][_0x78f7('0x1e')];}var _0x549149=this['channel'];if(_0x549149===_0x78f7('0x1f')){_0x13cfda[_0x78f7('0x20')]=this['account']['id'];}else{_0x13cfda[_[_0x78f7('0x21')](_0x549149)+_0x78f7('0x22')]=this[_0x78f7('0x23')]['id'];}_0x13cfda[_[_0x78f7('0x21')](_0x549149)+_0x78f7('0x24')]=this['interaction']['id'];if(this['interaction'][_0x78f7('0x25')]){var _0x48ec60=_0x23c843[0x4];if(!_[_0x78f7('0x26')](_0x48ec60)){_0x13cfda['body']=utils[_0x78f7('0x27')](_0x48ec60,this);return rpc[_0x549149+_0x78f7('0xd')][_0x78f7('0xe')](_0x13cfda)[_0x78f7('0x28')](function(_0x3cca3d){logger[_0x78f7('0xf')](_0x78f7('0x12'),_0x1b6eb7,_0x13cfda[_0x78f7('0xc')]);})[_0x78f7('0x10')](function(_0x2eee56){logger['error'](_0x78f7('0x12'),_0x1b6eb7,JSON['stringify'](_0x2eee56));})[_0x78f7('0x29')](function(){logger[_0x78f7('0xf')](_0x78f7('0x2a'),_0x1b6eb7);_0x47341e['stop']();});}else{logger[_0x78f7('0xf')](_0x78f7('0x2b'),_0x1b6eb7);_0x47341e[_0x78f7('0x2c')]();}}else{var _0x36c20a=this;var _0x23ed67=_0x23c843[0x2][_0x78f7('0x2d')](/\\n/g,'\x0a');var _0x4b7cfc={'credentials':{'private_key':_0x23ed67,'client_email':_0x23c843[0x1]}};var _0x22c9a4=new dialogflow[(_0x78f7('0x2e'))](_0x4b7cfc);var _0x125795=_0x22c9a4[_0x78f7('0x2f')](_0x23c843[0x0],md5(_0x36c20a[_0x78f7('0x16')]['id']));var _0x50740c={'session':_0x125795,'queryInput':{'text':{'text':_0x36c20a['message'][_0x78f7('0xc')],'languageCode':_0x23c843[0x3]||'en'}}};return _0x22c9a4[_0x78f7('0x30')](_0x50740c)[_0x78f7('0x28')](function(_0x3248e7){if(_0x3248e7&&_0x3248e7['length']){_0x36c20a[_0x78f7('0xc')][_0x78f7('0x31')]=_0x3248e7;var _0x507f81=_0x3248e7[0x0];var _0x3f9a18=_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')]&&_0x507f81[_0x78f7('0x32')]['diagnosticInfo']['fields']?_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')][_0x78f7('0x34')]['end_conversation'][_0x78f7('0x35')]:![];_0x36c20a['body'][_0x78f7('0x36')]=_0x507f81[_0x78f7('0x32')]['action'];_0x36c20a[_0x78f7('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x507f81[_0x78f7('0x32')][_0x78f7('0x37')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x38')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')]&&_0x507f81[_0x78f7('0x32')][_0x78f7('0x33')][_0x78f7('0x34')]?_0x507f81['queryResult'][_0x78f7('0x33')][_0x78f7('0x34')]['end_conversation'][_0x78f7('0x35')]:![];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x39')]=_0x507f81['queryResult'][_0x78f7('0x3a')][_0x78f7('0x3b')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x3c')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x3a')][_0x78f7('0x3d')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x3e')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x3a')][_0x78f7('0x3f')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x40')]=_0x507f81[_0x78f7('0x32')][_0x78f7('0x41')];_0x36c20a['body'][_0x78f7('0x42')]=_0x507f81['queryResult'][_0x78f7('0x43')];_0x36c20a[_0x78f7('0xc')][_0x78f7('0x44')]=_0x507f81[_0x78f7('0x32')]['intentDetectionConfidence'];_0x13cfda['providerName']=_0x78f7('0x31');_0x13cfda[_0x78f7('0x45')]=JSON[_0x78f7('0x13')](_0x3248e7);var _0x101fdc=[];for(var _0x2e7929=0x0;_0x2e7929<_0x3248e7[_0x78f7('0x46')];_0x2e7929++){var _0x150f76=_0x3248e7[_0x2e7929];if(_0x150f76&&_0x150f76['queryResult']&&_0x150f76[_0x78f7('0x32')][_0x78f7('0x47')]){_0x101fdc['push'](createMessage(_0x1b6eb7,_0x549149,_0x13cfda,_0x150f76[_0x78f7('0x32')][_0x78f7('0x47')]));}}return Promise[_0x78f7('0x48')](_0x101fdc)[_0x78f7('0x28')](function(){if(_0x3f9a18){_0x47341e[_0x78f7('0x49')]();}else{_0x47341e[_0x78f7('0x2c')]();}})[_0x78f7('0x10')](function(_0x44990d){logger[_0x78f7('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x1b6eb7,JSON[_0x78f7('0x13')](_0x44990d));_0x47341e[_0x78f7('0x49')]();});}})[_0x78f7('0x10')](function(_0x12a82d){logger[_0x78f7('0x11')](_0x78f7('0x12'),_0x1b6eb7,_0x12a82d[_0x78f7('0x4a')],_0x12a82d[_0x78f7('0x4b')]);_0x47341e[_0x78f7('0x49')]();});}}catch(_0x4a203c){logger[_0x78f7('0x11')](_0x78f7('0x12'),_0x1b6eb7,JSON[_0x78f7('0x13')](_0x4a203c));_0x47341e['stop']();}};};
\ No newline at end of file
+var _0x15ed=['message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','push','fulfillmentText','all','stack','dialogflow','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x15ed,0x1d2));var _0xd15e=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x15ed[_0x650e11];return _0x1a9b47;};'use strict';var _=require('lodash');var dialogflow=require(_0xd15e('0x0'));var md5=require('md5');var moment=require(_0xd15e('0x1'));var Promise=require(_0xd15e('0x2'));var logger=require(_0xd15e('0x3'))('routing');var utils=require(_0xd15e('0x4'));var rpc={'chatMessage':require(_0xd15e('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd15e('0x6')),'smsMessage':require(_0xd15e('0x7')),'faxMessage':require(_0xd15e('0x8')),'whatsappMessage':require(_0xd15e('0x9'))};function createMessage(_0x424aee,_0x21a1fd,_0x4a95de,_0x5c387b){return new Promise(function(_0x4c3026,_0x2249a0){var _0x43ab81=_[_0xd15e('0xa')](_0x4a95de);_0x43ab81[_0xd15e('0xb')]=_0x5c387b;return rpc[_0x21a1fd+'Message'][_0xd15e('0xc')](_0x43ab81)[_0xd15e('0xd')](function(){logger[_0xd15e('0xe')](_0xd15e('0xf'),_0x424aee,_0x43ab81[_0xd15e('0xb')]);_0x4c3026();})[_0xd15e('0x10')](function(_0x13e8ac){logger[_0xd15e('0x11')](_0xd15e('0xf'),_0x424aee,JSON[_0xd15e('0x12')](_0x13e8ac));_0x2249a0(_0x13e8ac);});});}exports[_0xd15e('0x13')]=function(_0x14e903,_0x42b8dd){return function(_0x502d8d){try{if(!_['isNil'](this['interaction'][_0xd15e('0x14')])){logger[_0xd15e('0xe')](_0xd15e('0xf'),_0x14e903,_0xd15e('0x15'));return _0x502d8d[_0xd15e('0x16')]();}var _0x4e4f0={'ContactId':this[_0xd15e('0x17')]['id'],'sentAt':moment()['format'](_0xd15e('0x18')),'direction':_0xd15e('0x19')};if(this[_0xd15e('0x1a')]==='sms'||this[_0xd15e('0x1a')]===_0xd15e('0x1b')){_0x4e4f0[_0xd15e('0x1c')]=this[_0xd15e('0x1d')][_0xd15e('0x1c')];}var _0x434a5d=this[_0xd15e('0x1a')];if(_0x434a5d===_0xd15e('0x1e')){_0x4e4f0['ChatWebsiteId']=this[_0xd15e('0x1f')]['id'];}else{_0x4e4f0[_[_0xd15e('0x20')](_0x434a5d)+_0xd15e('0x21')]=this['account']['id'];}_0x4e4f0[_[_0xd15e('0x20')](_0x434a5d)+_0xd15e('0x22')]=this['interaction']['id'];if(this[_0xd15e('0x1d')][_0xd15e('0x23')]){var _0x451012=_0x42b8dd[0x4];if(!_[_0xd15e('0x24')](_0x451012)){_0x4e4f0[_0xd15e('0xb')]=utils['getMustacheRender'](_0x451012,this);return rpc[_0x434a5d+_0xd15e('0x25')][_0xd15e('0xc')](_0x4e4f0)['then'](function(_0x308cfd){logger[_0xd15e('0xe')](_0xd15e('0xf'),_0x14e903,_0x4e4f0[_0xd15e('0xb')]);})[_0xd15e('0x10')](function(_0x45c9e8){logger['error'](_0xd15e('0xf'),_0x14e903,JSON[_0xd15e('0x12')](_0x45c9e8));})[_0xd15e('0x26')](function(){logger['info'](_0xd15e('0x27'),_0x14e903);_0x502d8d[_0xd15e('0x28')]();});}else{logger[_0xd15e('0xe')](_0xd15e('0x29'),_0x14e903);_0x502d8d[_0xd15e('0x28')]();}}else{var _0x298b2c=this;var _0x374b67=_0x42b8dd[0x2][_0xd15e('0x2a')](/\\n/g,'\x0a');var _0x57c464={'credentials':{'private_key':_0x374b67,'client_email':_0x42b8dd[0x1]}};var _0x571155=new dialogflow[(_0xd15e('0x2b'))](_0x57c464);var _0x37abe2=_0x571155[_0xd15e('0x2c')](_0x42b8dd[0x0],md5(_0x298b2c[_0xd15e('0x1d')]['id']));var _0x38db80={'session':_0x37abe2,'queryInput':{'text':{'text':_0x298b2c[_0xd15e('0x2d')][_0xd15e('0xb')],'languageCode':_0x42b8dd[0x3]||'en'}}};return _0x571155['detectIntent'](_0x38db80)['then'](function(_0x4908d3){if(_0x4908d3&&_0x4908d3[_0xd15e('0x2e')]){_0x298b2c['body'][_0xd15e('0x2f')]=_0x4908d3;var _0x420ffc=_0x4908d3[0x0];var _0x42e178=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x31')]&&_0x420ffc[_0xd15e('0x30')][_0xd15e('0x31')]['fields']?_0x420ffc[_0xd15e('0x30')][_0xd15e('0x31')][_0xd15e('0x32')][_0xd15e('0x33')]['boolValue']:![];_0x298b2c['body'][_0xd15e('0x34')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x35')];_0x298b2c[_0xd15e('0xb')][_0xd15e('0x36')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x37')];_0x298b2c[_0xd15e('0xb')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x420ffc[_0xd15e('0x30')]['diagnosticInfo']&&_0x420ffc[_0xd15e('0x30')]['diagnosticInfo'][_0xd15e('0x32')]?_0x420ffc[_0xd15e('0x30')]['diagnosticInfo']['fields']['end_conversation'][_0xd15e('0x38')]:![];_0x298b2c['body'][_0xd15e('0x39')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x3a')][_0xd15e('0x3b')];_0x298b2c[_0xd15e('0xb')][_0xd15e('0x3c')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x3a')][_0xd15e('0x3d')];_0x298b2c[_0xd15e('0xb')][_0xd15e('0x3e')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x3a')][_0xd15e('0x3f')];_0x298b2c[_0xd15e('0xb')][_0xd15e('0x40')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x41')];_0x298b2c['body'][_0xd15e('0x42')]=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x43')];_0x298b2c[_0xd15e('0xb')]['DIALOGFLOWV2_SCORE']=_0x420ffc[_0xd15e('0x30')][_0xd15e('0x44')];_0x4e4f0['providerName']=_0xd15e('0x2f');_0x4e4f0['providerResponse']=JSON[_0xd15e('0x12')](_0x4908d3);var _0x1512ed=[];for(var _0x3882d4=0x0;_0x3882d4<_0x4908d3[_0xd15e('0x2e')];_0x3882d4++){var _0x32fcae=_0x4908d3[_0x3882d4];if(_0x32fcae&&_0x32fcae[_0xd15e('0x30')]&&_0x32fcae[_0xd15e('0x30')]['fulfillmentText']){_0x1512ed[_0xd15e('0x45')](createMessage(_0x14e903,_0x434a5d,_0x4e4f0,_0x32fcae['queryResult'][_0xd15e('0x46')]));}}return Promise[_0xd15e('0x47')](_0x1512ed)['then'](function(){if(_0x42e178){_0x502d8d['next']();}else{_0x502d8d['stop']();}})[_0xd15e('0x10')](function(_0x4f90a0){logger[_0xd15e('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x14e903,JSON[_0xd15e('0x12')](_0x4f90a0));_0x502d8d[_0xd15e('0x16')]();});}})[_0xd15e('0x10')](function(_0x2fef8f){logger[_0xd15e('0x11')](_0xd15e('0xf'),_0x14e903,_0x2fef8f['message'],_0x2fef8f[_0xd15e('0x48')]);_0x502d8d[_0xd15e('0x16')]();});}}catch(_0xbc6674){logger[_0xd15e('0x11')](_0xd15e('0xf'),_0x14e903,JSON[_0xd15e('0x12')](_0xbc6674));_0x502d8d[_0xd15e('0x28')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4789=['../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4789,0x1bc));var _0x9478=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x4789[_0x55d8c5];return _0x225ae5;};'use strict';var schema=require(_0x9478('0x0'));var _=require(_0x9478('0x1'));var htmlToText=require(_0x9478('0x2'));var utils=require(_0x9478('0x3'));var logger=require(_0x9478('0x4'))(_0x9478('0x5'));var gotoif=schema({'condition':{'type':_0x9478('0x6'),'required':!![],'message':_0x9478('0x7')},'priorityTrue':{'type':_0x9478('0x8'),'message':_0x9478('0x9')},'priorityFalse':{'type':_0x9478('0x8'),'message':_0x9478('0xa')}});exports['consequence']=function(_0x5b1d2b,_0x590299){return function(_0x4327f8){try{var _0x182c8a={'condition':htmlToText[_0x9478('0xb')](utils[_0x9478('0xc')](_0x590299[0x0],this),{'wordwrap':![]})[_0x9478('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x590299[0x1],'priorityFalse':_0x590299[0x2]};var _0x13fdea=gotoif[_0x9478('0x0')](_0x182c8a,{'typecast':!![]});if(_0x13fdea[_0x9478('0xe')]){logger[_0x9478('0xf')](_0x9478('0x10'),_0x5b1d2b,_[_0x9478('0x11')](_0x13fdea,_0x9478('0x12'))[_0x9478('0x13')](',\x20'));_0x4327f8[_0x9478('0x14')]();}else{try{var _0x124f72=eval('('+_0x182c8a[_0x9478('0x15')]+')');var _0x1a9476=_0x124f72?_0x182c8a[_0x9478('0x16')]:_0x182c8a[_0x9478('0x17')];logger[_0x9478('0x18')](_0x9478('0x19'),_0x5b1d2b,_0x182c8a['condition'],_0x124f72,_0x1a9476||_0x9478('0x1a'));if(_0x1a9476){var _0x378caa=_[_0x9478('0x1b')](_0x4327f8[_0x9478('0x1c')](),{'p':_0x1a9476});if(_0x378caa>=0x0){logger[_0x9478('0x18')](_0x9478('0x1d'),_0x5b1d2b,_0x1a9476||'next',_0x378caa);_0x4327f8[_0x9478('0x1a')](_0x378caa);}else{logger[_0x9478('0x18')](_0x9478('0x1e'),_0x5b1d2b,_0x1a9476||_0x9478('0x1a'));_0x4327f8[_0x9478('0x14')]();}}else{_0x4327f8[_0x9478('0x1a')]();}}catch(_0x2a2aa5){logger[_0x9478('0xf')](_0x9478('0x1f'),_0x5b1d2b,_0x2a2aa5[_0x9478('0x12')]);_0x4327f8['stop']();}}}catch(_0x17e1f1){logger[_0x9478('0xf')](_0x9478('0x10'),_0x5b1d2b,JSON['stringify'](_0x17e1f1));_0x4327f8['stop']();}};};
\ No newline at end of file
+var _0x206e=['priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','map','message','join','stop','condition','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number'];(function(_0x3ea5b8,_0x31cd9d){var _0x152424=function(_0x2a9eba){while(--_0x2a9eba){_0x3ea5b8['push'](_0x3ea5b8['shift']());}};_0x152424(++_0x31cd9d);}(_0x206e,0xb5));var _0xe206=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x206e[_0x5df033];return _0x445829;};'use strict';var schema=require(_0xe206('0x0'));var _=require(_0xe206('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xe206('0x2'));var logger=require(_0xe206('0x3'))(_0xe206('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe206('0x5')},'priorityTrue':{'type':'number','message':_0xe206('0x6')},'priorityFalse':{'type':_0xe206('0x7'),'message':_0xe206('0x8')}});exports[_0xe206('0x9')]=function(_0x3f13ea,_0x22404c){return function(_0x54cb32){try{var _0x217ba2={'condition':htmlToText[_0xe206('0xa')](utils[_0xe206('0xb')](_0x22404c[0x0],this),{'wordwrap':![]})[_0xe206('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x22404c[0x1],'priorityFalse':_0x22404c[0x2]};var _0x5ca9a2=gotoif[_0xe206('0x0')](_0x217ba2,{'typecast':!![]});if(_0x5ca9a2[_0xe206('0xd')]){logger['error']('[%s][GOTOIF]\x20%s',_0x3f13ea,_[_0xe206('0xe')](_0x5ca9a2,_0xe206('0xf'))[_0xe206('0x10')](',\x20'));_0x54cb32[_0xe206('0x11')]();}else{try{var _0x51bfb5=eval('('+_0x217ba2[_0xe206('0x12')]+')');var _0x164ba7=_0x51bfb5?_0x217ba2['priorityTrue']:_0x217ba2[_0xe206('0x13')];logger[_0xe206('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x3f13ea,_0x217ba2[_0xe206('0x12')],_0x51bfb5,_0x164ba7||_0xe206('0x15'));if(_0x164ba7){var _0x5f24ab=_['findIndex'](_0x54cb32[_0xe206('0x16')](),{'p':_0x164ba7});if(_0x5f24ab>=0x0){logger['info'](_0xe206('0x17'),_0x3f13ea,_0x164ba7||'next',_0x5f24ab);_0x54cb32[_0xe206('0x15')](_0x5f24ab);}else{logger[_0xe206('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3f13ea,_0x164ba7||_0xe206('0x15'));_0x54cb32[_0xe206('0x11')]();}}else{_0x54cb32[_0xe206('0x15')]();}}catch(_0x49a7fd){logger[_0xe206('0x18')](_0xe206('0x19'),_0x3f13ea,_0x49a7fd[_0xe206('0xf')]);_0x54cb32[_0xe206('0x11')]();}}}catch(_0x2d2d71){logger[_0xe206('0x18')](_0xe206('0x1a'),_0x3f13ea,JSON['stringify'](_0x2d2d71));_0x54cb32['stop']();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x882f=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOP]\x20%s','stringify','validate','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x882f,0xbe));var _0xf882=function(_0x35a441,_0x3a2ec6){_0x35a441=_0x35a441-0x0;var _0x571ce3=_0x882f[_0x35a441];return _0x571ce3;};'use strict';var schema=require(_0xf882('0x0'));var _=require(_0xf882('0x1'));var logger=require('../../../../config/logger')(_0xf882('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xf882('0x3')}});exports[_0xf882('0x4')]=function(_0x32a355,_0x1057ac){return function(_0x504a3b){try{var _0x29d536={'priority':_0x1057ac[0x0]};var _0x837a8b=gotop[_0xf882('0x0')](_0x29d536,{'typecast':!![]});if(_0x837a8b[_0xf882('0x5')]){logger[_0xf882('0x6')]('[%s][GOTOP]\x20%s',_0x32a355,_[_0xf882('0x7')](_0x837a8b,_0xf882('0x8'))[_0xf882('0x9')](',\x20'));_0x504a3b[_0xf882('0xa')]();}else{logger[_0xf882('0xb')](_0xf882('0xc'),_0x32a355,_0x29d536[_0xf882('0xd')]);if(_0x29d536[_0xf882('0xd')]){var _0x171298=_['findIndex'](_0x504a3b[_0xf882('0xe')](),{'p':_0x29d536[_0xf882('0xd')]});if(_0x171298>=0x0){logger['info'](_0xf882('0xf'),_0x32a355,_0x29d536[_0xf882('0xd')]||'next',_0x171298);_0x504a3b['next'](_0x171298);}else{logger[_0xf882('0xb')](_0xf882('0x10'),_0x32a355,_0x29d536[_0xf882('0xd')]||_0xf882('0x11'));_0x504a3b[_0xf882('0xa')]();}}else{_0x504a3b['next']();}}}catch(_0x695a2c){logger[_0xf882('0x6')](_0xf882('0x12'),_0x32a355,JSON[_0xf882('0x13')](_0x695a2c));_0x504a3b['stop']();}};};
\ No newline at end of file
+var _0xb4df=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x7df626,_0x500898){var _0x7db49d=function(_0x2f20af){while(--_0x2f20af){_0x7df626['push'](_0x7df626['shift']());}};_0x7db49d(++_0x500898);}(_0xb4df,0x1b8));var _0xfb4d=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xb4df[_0x31e29a];return _0x32d892;};'use strict';var schema=require('validate');var _=require(_0xfb4d('0x0'));var logger=require(_0xfb4d('0x1'))(_0xfb4d('0x2'));var gotop=schema({'priority':{'type':_0xfb4d('0x3'),'required':!![],'message':_0xfb4d('0x4')}});exports['consequence']=function(_0x2cece5,_0x3f94a7){return function(_0x4ea569){try{var _0x94e7bb={'priority':_0x3f94a7[0x0]};var _0xbbbcb1=gotop['validate'](_0x94e7bb,{'typecast':!![]});if(_0xbbbcb1['length']){logger[_0xfb4d('0x5')]('[%s][GOTOP]\x20%s',_0x2cece5,_[_0xfb4d('0x6')](_0xbbbcb1,'message')[_0xfb4d('0x7')](',\x20'));_0x4ea569[_0xfb4d('0x8')]();}else{logger[_0xfb4d('0x9')](_0xfb4d('0xa'),_0x2cece5,_0x94e7bb[_0xfb4d('0xb')]);if(_0x94e7bb['priority']){var _0x485515=_[_0xfb4d('0xc')](_0x4ea569[_0xfb4d('0xd')](),{'p':_0x94e7bb[_0xfb4d('0xb')]});if(_0x485515>=0x0){logger[_0xfb4d('0x9')](_0xfb4d('0xe'),_0x2cece5,_0x94e7bb[_0xfb4d('0xb')]||_0xfb4d('0xf'),_0x485515);_0x4ea569[_0xfb4d('0xf')](_0x485515);}else{logger[_0xfb4d('0x9')](_0xfb4d('0x10'),_0x2cece5,_0x94e7bb['priority']||'next');_0x4ea569[_0xfb4d('0x8')]();}}else{_0x4ea569[_0xfb4d('0xf')]();}}}catch(_0x1239aa){logger[_0xfb4d('0x5')](_0xfb4d('0x11'),_0x2cece5,JSON[_0xfb4d('0x12')](_0x1239aa));_0x4ea569[_0xfb4d('0x8')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8185=['stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','account','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','error'];(function(_0x4ae8f8,_0x40a58e){var _0x24c8c6=function(_0x2457da){while(--_0x2457da){_0x4ae8f8['push'](_0x4ae8f8['shift']());}};_0x24c8c6(++_0x40a58e);}(_0x8185,0xb8));var _0x5818=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8185[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x5818('0x0'));var utils=require(_0x5818('0x1'));var logger=require(_0x5818('0x2'))('routing');var rpc={'chatMessage':require(_0x5818('0x3')),'openchannelMessage':require(_0x5818('0x4')),'mailMessage':require(_0x5818('0x5')),'smsMessage':require(_0x5818('0x6')),'faxMessage':require(_0x5818('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5818('0x8')]=function(_0x124d5d,_0x635812){return function(_0x2e1d94){try{var _0x412c57={'body':utils[_0x5818('0x9')](_0x635812[0x0],this),'ContactId':this[_0x5818('0xa')]['id']};if(this[_0x5818('0xb')]===_0x5818('0xc')){_0x412c57[_0x5818('0xd')]=this['account']['id'];}else{_0x412c57[_[_0x5818('0xe')](this[_0x5818('0xb')])+'AccountId']=this[_0x5818('0xf')]['id'];}_0x412c57[_[_0x5818('0xe')](this['channel'])+'InteractionId']=this[_0x5818('0x10')]['id'];if(rpc[this[_0x5818('0xb')]+'Message']){return rpc[this[_0x5818('0xb')]+_0x5818('0x11')][_0x5818('0x12')](_0x412c57)['then'](function(_0x41070e){logger[_0x5818('0x13')](_0x5818('0x14'),_0x124d5d,_0x412c57[_0x5818('0x15')]);_0x2e1d94[_0x5818('0x16')]();})['catch'](function(_0x15ef16){logger[_0x5818('0x17')](_0x5818('0x14'),_0x124d5d,JSON[_0x5818('0x18')](_0x15ef16));_0x2e1d94[_0x5818('0x19')]();});}}catch(_0x4006d7){logger[_0x5818('0x17')]('[%s][MESSAGE]\x20%s',_0x124d5d,JSON[_0x5818('0x18')](_0x4006d7));_0x2e1d94['stop']();}};};
\ No newline at end of file
+var _0xddc5=['then','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message'];(function(_0x424155,_0x23f7c2){var _0xc166ed=function(_0x310056){while(--_0x310056){_0x424155['push'](_0x424155['shift']());}};_0xc166ed(++_0x23f7c2);}(_0xddc5,0x101));var _0x5ddc=function(_0x3f0331,_0x20342d){_0x3f0331=_0x3f0331-0x0;var _0x3fa987=_0xddc5[_0x3f0331];return _0x3fa987;};'use strict';var _=require(_0x5ddc('0x0'));var utils=require(_0x5ddc('0x1'));var logger=require('../../../../config/logger')(_0x5ddc('0x2'));var rpc={'chatMessage':require(_0x5ddc('0x3')),'openchannelMessage':require(_0x5ddc('0x4')),'mailMessage':require(_0x5ddc('0x5')),'smsMessage':require(_0x5ddc('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5ddc('0x7')]=function(_0x11e0d4,_0x232918){return function(_0x3b3e83){try{var _0x38dffb={'body':utils[_0x5ddc('0x8')](_0x232918[0x0],this),'ContactId':this[_0x5ddc('0x9')]['id']};if(this[_0x5ddc('0xa')]===_0x5ddc('0xb')){_0x38dffb[_0x5ddc('0xc')]=this[_0x5ddc('0xd')]['id'];}else{_0x38dffb[_[_0x5ddc('0xe')](this[_0x5ddc('0xa')])+_0x5ddc('0xf')]=this[_0x5ddc('0xd')]['id'];}_0x38dffb[_['upperFirst'](this[_0x5ddc('0xa')])+_0x5ddc('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0x5ddc('0x11')]){return rpc[this[_0x5ddc('0xa')]+'Message']['create'](_0x38dffb)[_0x5ddc('0x12')](function(_0x4e6926){logger['info'](_0x5ddc('0x13'),_0x11e0d4,_0x38dffb[_0x5ddc('0x14')]);_0x3b3e83[_0x5ddc('0x15')]();})['catch'](function(_0x3a434f){logger[_0x5ddc('0x16')](_0x5ddc('0x13'),_0x11e0d4,JSON[_0x5ddc('0x17')](_0x3a434f));_0x3b3e83['stop']();});}}catch(_0x21485e){logger[_0x5ddc('0x16')](_0x5ddc('0x13'),_0x11e0d4,JSON[_0x5ddc('0x17')](_0x21485e));_0x3b3e83[_0x5ddc('0x18')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad58=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','./utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xad58,0x1b8));var _0x8ad5=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0xad58[_0xa522f];return _0x2083b0;};'use strict';var utils=require(_0x8ad5('0x0'));var logger=require('../../../../config/logger')(_0x8ad5('0x1'));exports[_0x8ad5('0x2')]=function(_0xaefd61,_0x5d87c4){return function(_0x281795){try{logger[_0x8ad5('0x3')](_0x8ad5('0x4'),_0xaefd61,utils[_0x8ad5('0x5')](_0x5d87c4[0x0],this));_0x281795[_0x8ad5('0x6')]();}catch(_0x413198){logger['error'](_0x8ad5('0x4'),_0xaefd61,JSON['stringify'](_0x413198));_0x281795['stop']();}};};
\ No newline at end of file
+var _0x9a3e=['[%s][NOOP]\x20%s','next','error','stringify','../../../../config/logger','info'];(function(_0xfee2af,_0x5c9c3d){var _0x4efdb7=function(_0x213605){while(--_0x213605){_0xfee2af['push'](_0xfee2af['shift']());}};_0x4efdb7(++_0x5c9c3d);}(_0x9a3e,0x148));var _0xe9a3=function(_0x17afcf,_0x32a79a){_0x17afcf=_0x17afcf-0x0;var _0x3893d8=_0x9a3e[_0x17afcf];return _0x3893d8;};'use strict';var utils=require('./utils');var logger=require(_0xe9a3('0x0'))('routing');exports['consequence']=function(_0x16e734,_0x9e1d24){return function(_0x46ad44){try{logger[_0xe9a3('0x1')](_0xe9a3('0x2'),_0x16e734,utils['getMustacheRender'](_0x9e1d24[0x0],this));_0x46ad44[_0xe9a3('0x3')]();}catch(_0x71acc8){logger[_0xe9a3('0x4')](_0xe9a3('0x2'),_0x16e734,JSON[_0xe9a3('0x5')](_0x71acc8));_0x46ad44['stop']();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa49b=['interaction','MessageId','message','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','join','find','Queues','timeout','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','joinAt','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId'];(function(_0x5709ea,_0x5c0089){var _0x1998b4=function(_0x3bab6b){while(--_0x3bab6b){_0x5709ea['push'](_0x5709ea['shift']());}};_0x1998b4(++_0x5c0089);}(_0xa49b,0x126));var _0xba49=function(_0xa2e757,_0x50b583){_0xa2e757=_0xa2e757-0x0;var _0x49339e=_0xa49b[_0xa2e757];return _0x49339e;};'use strict';var schema=require('validate');var _=require(_0xba49('0x0'));var util=require(_0xba49('0x1'));var seqqueue=require(_0xba49('0x2'));var moment=require(_0xba49('0x3'));var Redis=require('ioredis');var config=require(_0xba49('0x4'));var logger=require(_0xba49('0x5'))(_0xba49('0x6'));var strategy=require('./strategy');config[_0xba49('0x7')]=_[_0xba49('0x8')](config[_0xba49('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xba49('0x9'))(new Redis(config['redis']));var attributes=['id',_0xba49('0xa'),_0xba49('0xb'),_0xba49('0xc'),'from',_0xba49('0xd')];function emit(_0x249dd6,_0x755387,_0x5251e4){io['to'](_0x249dd6)['emit'](_0x755387,_0x5251e4);}function emitChannelQueueInteraction(_0x27ec37,_0x1c26a0,_0x1e5a50,_0x4fa7b8,_0x5d0f30,_0x19d2f8,_0x5cff2f,_0x58b8bf){var _0x5249cd=_[_0xba49('0xe')](_0x1e5a50);_0x5249cd['queue_id']=_0x58b8bf;_0x5249cd['queue']=_0x1c26a0;_0x5249cd[_0xba49('0xb')]=_0x4fa7b8;_0x5249cd['id']=_0x5d0f30;if(_0x19d2f8){attributes[_0xba49('0xf')](_[_0xba49('0x10')](_0x27ec37)+_0xba49('0x11'));_0x5cff2f[util['format'](_0xba49('0x12'),_0x27ec37)][_0x5d0f30]=_[_0xba49('0x13')](_0x5249cd,attributes);}else{delete _0x5cff2f[util['format']('%sQueuesWaitingInteractions',_0x27ec37)][_0x5d0f30];}emit(util[_0xba49('0x14')](_0xba49('0x15'),_0x27ec37,_0x1c26a0),util[_0xba49('0x14')](_0xba49('0x16'),_0x27ec37,_0x19d2f8?'save':_0xba49('0x17')),_[_0xba49('0x13')](_0x5249cd,attributes));}var rpc={'openchannelQueueReport':require(_0xba49('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xba49('0x19')),'smsQueueReport':require(_0xba49('0x1a')),'faxQueueReport':require(_0xba49('0x1b')),'whatsappQueueReport':require(_0xba49('0x1c')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xba49('0x1d')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xba49('0x1e')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0xba49('0x1f'))};var queue=schema({'name':{'type':_0xba49('0x20'),'required':!![],'message':_0xba49('0x21')},'timeout':{'type':_0xba49('0x22'),'message':_0xba49('0x23')}});function startRouting(_0x3369ee,_0x93c3f0,_0x331ec2,_0x2abc3b){if(_0x3369ee&&_0x93c3f0&&_0x331ec2){_0x93c3f0['waiting']+=0x1;var _0x4897b8={'uniqueid':_0x3369ee,'from':_0x331ec2[_0xba49('0x24')]?_0x331ec2[_0xba49('0x24')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x331ec2['contact']?_0x331ec2[_0xba49('0x25')]['id']:null,'ListId':_0x331ec2[_0xba49('0x26')]?_0x331ec2[_0xba49('0x26')]['id']:null};_0x4897b8[_[_0xba49('0x27')](_0x331ec2[_0xba49('0x28')])+_0xba49('0x29')]=_0x93c3f0['id']||null;_0x4897b8[_[_0xba49('0x27')](_0x331ec2[_0xba49('0x28')])+'InteractionId']=_0x331ec2[_0xba49('0x2a')]?_0x331ec2[_0xba49('0x2a')]['id']:null;_0x4897b8[_[_0xba49('0x27')](_0x331ec2['channel'])+_0xba49('0x2b')]=_0x331ec2[_0xba49('0x2c')]?_0x331ec2[_0xba49('0x2c')]['id']:null;_0x4897b8[_['upperFirst'](_0x331ec2[_0xba49('0x28')])+(_0x331ec2[_0xba49('0x28')]!=='chat'?_0xba49('0x2d'):_0xba49('0x2e'))]=_0x331ec2[_0xba49('0xb')]?_0x331ec2[_0xba49('0xb')]['id']:null;logger[_0xba49('0x2f')](util[_0xba49('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x3369ee,_0x93c3f0[_0xba49('0x30')]));emitChannelQueueInteraction(_0x331ec2['channel'],_0x93c3f0[_0xba49('0x30')],_0x4897b8,_0x331ec2[_0xba49('0xb')][_0xba49('0x30')],_0x331ec2['message']['id'],!![],_0x2abc3b,_0x93c3f0['id']);if(rpc[_0x331ec2[_0xba49('0x28')]+_0xba49('0x31')]){return rpc[_0x331ec2[_0xba49('0x28')]+'QueueReport'][_0xba49('0x32')](_0x4897b8)[_0xba49('0x33')](function(_0x590be8){logger[_0xba49('0x34')](_0xba49('0x35'),_0x590be8);});}}}function stopRouting(_0x1820c2,_0x5d18ef,_0x59581e,_0xdbfc5b){if(_0x1820c2&&_0x5d18ef){_0x5d18ef[_0xba49('0x36')]-=0x1;var _0x3f3578={'leaveAt':moment()[_0xba49('0x14')](_0xba49('0x37')),'acceptAt':moment()[_0xba49('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xba49('0x38')};logger[_0xba49('0x2f')](util['format'](_0xba49('0x39'),_0x1820c2,_0x5d18ef['name']));emitChannelQueueInteraction(_0x59581e['channel'],_0x5d18ef[_0xba49('0x30')],_0x59581e['body'],_0x59581e[_0xba49('0xb')][_0xba49('0x30')],_0x59581e[_0xba49('0x2c')]['id'],![],_0xdbfc5b,_0x5d18ef['id']);return rpc[_0x59581e[_0xba49('0x28')]+_0xba49('0x3a')][_0xba49('0x3b')](_0x59581e[_0xba49('0x2a')]['id'],{'queueId':_0x5d18ef['id']})[_0xba49('0x3c')](function(){if(rpc[_0x59581e[_0xba49('0x28')]+_0xba49('0x31')]){return rpc[_0x59581e['channel']+_0xba49('0x31')][_0xba49('0x3b')](_0x1820c2,_0x3f3578)[_0xba49('0x33')](function(_0x115168){logger[_0xba49('0x34')](_0xba49('0x3d'),_0x115168);});}});}}function endRouting(_0x1a438f,_0x4d23b8,_0x17eb82,_0x500fd2){if(_0x1a438f&&_0x4d23b8){_0x4d23b8[_0xba49('0x36')]-=0x1;var _0x532c40={'leaveAt':moment()['format'](_0xba49('0x37')),'exitAt':moment()[_0xba49('0x14')](_0xba49('0x37')),'reason':'timeout'};logger['info'](util['format'](_0xba49('0x3e'),_0x1a438f,_0x4d23b8['name']));emitChannelQueueInteraction(_0x17eb82[_0xba49('0x28')],_0x4d23b8[_0xba49('0x30')],_0x17eb82['body'],_0x17eb82[_0xba49('0xb')][_0xba49('0x30')],_0x17eb82[_0xba49('0x2c')]['id'],![],_0x500fd2);if(rpc[_0x17eb82[_0xba49('0x28')]+_0xba49('0x31')]){return rpc[_0x17eb82[_0xba49('0x28')]+'QueueReport']['update'](_0x1a438f,_0x532c40)[_0xba49('0x33')](function(_0x265c3c){logger[_0xba49('0x34')](_0xba49('0x3d'),_0x265c3c);});}}}function handleFindQueue(_0x3c2a61){return function(_0x29d04a){return _0x29d04a[_0xba49('0x30')][_0xba49('0x3f')]()===_0x3c2a61[_0xba49('0x3f')]();};}exports[_0xba49('0x40')]=function(_0x45979b,_0x3d953e,_0x349302,_0x40d35a){return function(_0x4d1eb2){try{var _0x352c35={'name':_0x3d953e[0x0],'timeout':_0x3d953e[0x1]};var _0x3387fd=queue[_0xba49('0x41')](_0x352c35,{'typecast':!![]});if(_0x3387fd['length']){logger[_0xba49('0x34')](_0xba49('0x42'),_0x45979b,_['map'](_0x3387fd,'message')[_0xba49('0x43')](',\x20'));_0x4d1eb2['stop']();}else{var _0x2688ca=_[_0xba49('0x44')](_0x349302[_0x40d35a[_0xba49('0x28')]+_0xba49('0x45')],handleFindQueue(_0x352c35[_0xba49('0x30')]));if(_0x2688ca){startRouting(_0x45979b,_0x2688ca,_0x40d35a,_0x349302);var _0x759b1c=(_0x2688ca['timeout']||0xa)*0x3e8;var _0x2b909c=(_0x352c35[_0xba49('0x46')]||0x14)*0x3e8;var _0x173aa1;if(_0x759b1c>_0x2b909c){_0x2b909c=_0x759b1c;}var _0x1bd13b=seqqueue['createQueue'](_0x759b1c);_0x1bd13b['id']=_0x45979b;_0x1bd13b[_0xba49('0x47')]=_0x759b1c;_0x1bd13b[_0xba49('0x48')]=_0x2b909c;_0x1bd13b[_0xba49('0x28')]=_0x40d35a['channel'];_0x349302['rules'][_0x45979b]['on'](_0xba49('0x49'),function(){logger[_0xba49('0x2f')](_0xba49('0x4a'),_0x45979b);stopRouting(_0x45979b,_0x2688ca,_0x40d35a,_0x349302);clearTimeout(_0x173aa1);_0x173aa1=undefined;_0x1bd13b['close'](!![]);if(_0x349302[_0xba49('0x4b')][_0x45979b]){delete _0x349302[_0xba49('0x4b')][_0x45979b];}_0x4d1eb2[_0xba49('0x4c')]();});_0x349302['rules'][_0x45979b]['on'](_0xba49('0x4d'),function(){if(_0x349302[_0xba49('0x4b')][_0x45979b]){delete _0x349302[_0xba49('0x4b')][_0x45979b];}});_0x173aa1=setTimeout(function(){logger[_0xba49('0x2f')](_0xba49('0x4e'),_0x45979b);endRouting(_0x45979b,_0x2688ca,_0x40d35a,_0x349302);clearTimeout(_0x173aa1);_0x1bd13b[_0xba49('0x4f')](!![]);_0x4d1eb2['next']();},_0x2b909c);switch(_0x2688ca['strategy']){case'rrmemory':strategy[_0xba49('0x50')](_0x1bd13b,_0x2688ca,_0x349302,_0x40d35a);break;default:strategy[_0xba49('0x51')](_0x1bd13b,_0x2688ca,_0x349302,_0x40d35a);}}else{logger['error'](_0xba49('0x52'),_0x45979b,_0x352c35[_0xba49('0x30')]);_0x4d1eb2[_0xba49('0x4c')]();}}}catch(_0x23534f){logger['error'](_0xba49('0x42'),_0x45979b,_0x23534f[_0xba49('0x53')]);_0x4d1eb2['stop']();}};};
\ No newline at end of file
+var _0x3c57=['rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','push','capitalize','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','interaction','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','waiting','accepted','Interaction','update','then','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy'];(function(_0x3afb44,_0x24a60e){var _0x51a896=function(_0xffeb17){while(--_0xffeb17){_0x3afb44['push'](_0x3afb44['shift']());}};_0x51a896(++_0x24a60e);}(_0x3c57,0xb4));var _0x73c5=function(_0x103bde,_0x1ca20a){_0x103bde=_0x103bde-0x0;var _0x1439fd=_0x3c57[_0x103bde];return _0x1439fd;};'use strict';var schema=require(_0x73c5('0x0'));var _=require(_0x73c5('0x1'));var util=require(_0x73c5('0x2'));var seqqueue=require(_0x73c5('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x73c5('0x4'));var logger=require(_0x73c5('0x5'))(_0x73c5('0x6'));var strategy=require(_0x73c5('0x7'));config[_0x73c5('0x8')]=_[_0x73c5('0x9')](config[_0x73c5('0x8')],{'host':_0x73c5('0xa'),'port':0x18eb});var io=require(_0x73c5('0xb'))(new Redis(config[_0x73c5('0x8')]));var attributes=['id',_0x73c5('0xc'),_0x73c5('0xd'),_0x73c5('0xe'),'from',_0x73c5('0xf')];function emit(_0x3fb1a4,_0x5e43fc,_0x1c3948){io['to'](_0x3fb1a4)[_0x73c5('0x10')](_0x5e43fc,_0x1c3948);}function emitChannelQueueInteraction(_0x571eb2,_0x5ccc90,_0x59b6fe,_0xe61307,_0x291d9b,_0x51808f,_0xacd01c,_0x10b45c){var _0x195cdf=_['clone'](_0x59b6fe);_0x195cdf[_0x73c5('0xc')]=_0x10b45c;_0x195cdf['queue']=_0x5ccc90;_0x195cdf['account']=_0xe61307;_0x195cdf['id']=_0x291d9b;if(_0x51808f){attributes[_0x73c5('0x11')](_[_0x73c5('0x12')](_0x571eb2)+'InteractionId');_0xacd01c[util[_0x73c5('0x13')](_0x73c5('0x14'),_0x571eb2)][_0x291d9b]=_['pick'](_0x195cdf,attributes);}else{delete _0xacd01c[util[_0x73c5('0x13')](_0x73c5('0x14'),_0x571eb2)][_0x291d9b];}emit(util[_0x73c5('0x13')]('%s:queue:%s',_0x571eb2,_0x5ccc90),util[_0x73c5('0x13')](_0x73c5('0x15'),_0x571eb2,_0x51808f?_0x73c5('0x16'):_0x73c5('0x17')),_[_0x73c5('0x18')](_0x195cdf,attributes));}var rpc={'openchannelQueueReport':require(_0x73c5('0x19')),'mailQueueReport':require(_0x73c5('0x1a')),'chatQueueReport':require(_0x73c5('0x1b')),'smsQueueReport':require(_0x73c5('0x1c')),'faxQueueReport':require(_0x73c5('0x1d')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require(_0x73c5('0x1e')),'faxInteraction':require(_0x73c5('0x1f')),'mailInteraction':require(_0x73c5('0x20')),'openchannelInteraction':require(_0x73c5('0x21')),'smsInteraction':require(_0x73c5('0x22')),'whatsappInteraction':require(_0x73c5('0x23'))};var queue=schema({'name':{'type':_0x73c5('0x24'),'required':!![],'message':_0x73c5('0x25')},'timeout':{'type':_0x73c5('0x26'),'message':_0x73c5('0x27')}});function startRouting(_0x304e5e,_0x250223,_0x147741,_0x399185){if(_0x304e5e&&_0x250223&&_0x147741){_0x250223['waiting']+=0x1;var _0x3ec110={'uniqueid':_0x304e5e,'from':_0x147741[_0x73c5('0x28')]?_0x147741[_0x73c5('0x28')]['from']:'','joinAt':moment()[_0x73c5('0x13')](_0x73c5('0x29')),'ContactId':_0x147741[_0x73c5('0x2a')]?_0x147741[_0x73c5('0x2a')]['id']:null,'ListId':_0x147741[_0x73c5('0x2b')]?_0x147741[_0x73c5('0x2b')]['id']:null};_0x3ec110[_[_0x73c5('0x2c')](_0x147741['channel'])+_0x73c5('0x2d')]=_0x250223['id']||null;_0x3ec110[_[_0x73c5('0x2c')](_0x147741[_0x73c5('0x2e')])+'InteractionId']=_0x147741[_0x73c5('0x2f')]?_0x147741[_0x73c5('0x2f')]['id']:null;_0x3ec110[_[_0x73c5('0x2c')](_0x147741[_0x73c5('0x2e')])+'MessageId']=_0x147741['message']?_0x147741[_0x73c5('0x30')]['id']:null;_0x3ec110[_[_0x73c5('0x2c')](_0x147741[_0x73c5('0x2e')])+(_0x147741['channel']!=='chat'?_0x73c5('0x31'):'WebsiteId')]=_0x147741[_0x73c5('0xd')]?_0x147741[_0x73c5('0xd')]['id']:null;logger[_0x73c5('0x32')](util[_0x73c5('0x13')](_0x73c5('0x33'),_0x304e5e,_0x250223['name']));emitChannelQueueInteraction(_0x147741[_0x73c5('0x2e')],_0x250223[_0x73c5('0x34')],_0x3ec110,_0x147741[_0x73c5('0xd')][_0x73c5('0x34')],_0x147741[_0x73c5('0x30')]['id'],!![],_0x399185,_0x250223['id']);if(rpc[_0x147741[_0x73c5('0x2e')]+'QueueReport']){return rpc[_0x147741[_0x73c5('0x2e')]+_0x73c5('0x35')][_0x73c5('0x36')](_0x3ec110)[_0x73c5('0x37')](function(_0x3062e0){logger['error'](_0x73c5('0x38'),_0x3062e0);});}}}function stopRouting(_0x27d6f7,_0x50e332,_0x5b68e7,_0x250e73){if(_0x27d6f7&&_0x50e332){_0x50e332[_0x73c5('0x39')]-=0x1;var _0x53fdab={'leaveAt':moment()['format'](_0x73c5('0x29')),'acceptAt':moment()['format'](_0x73c5('0x29')),'reason':_0x73c5('0x3a')};logger[_0x73c5('0x32')](util[_0x73c5('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x27d6f7,_0x50e332['name']));emitChannelQueueInteraction(_0x5b68e7['channel'],_0x50e332[_0x73c5('0x34')],_0x5b68e7[_0x73c5('0x28')],_0x5b68e7[_0x73c5('0xd')][_0x73c5('0x34')],_0x5b68e7['message']['id'],![],_0x250e73,_0x50e332['id']);return rpc[_0x5b68e7['channel']+_0x73c5('0x3b')][_0x73c5('0x3c')](_0x5b68e7[_0x73c5('0x2f')]['id'],{'queueId':_0x50e332['id']})[_0x73c5('0x3d')](function(){if(rpc[_0x5b68e7[_0x73c5('0x2e')]+_0x73c5('0x35')]){return rpc[_0x5b68e7[_0x73c5('0x2e')]+_0x73c5('0x35')][_0x73c5('0x3c')](_0x27d6f7,_0x53fdab)['catch'](function(_0x45cab8){logger[_0x73c5('0x3e')](_0x73c5('0x3f'),_0x45cab8);});}});}}function endRouting(_0x3eaaf2,_0x19241e,_0x33a978,_0x43c149){if(_0x3eaaf2&&_0x19241e){_0x19241e[_0x73c5('0x39')]-=0x1;var _0x5e32f2={'leaveAt':moment()[_0x73c5('0x13')](_0x73c5('0x29')),'exitAt':moment()[_0x73c5('0x13')](_0x73c5('0x29')),'reason':_0x73c5('0x40')};logger[_0x73c5('0x32')](util[_0x73c5('0x13')](_0x73c5('0x41'),_0x3eaaf2,_0x19241e[_0x73c5('0x34')]));emitChannelQueueInteraction(_0x33a978[_0x73c5('0x2e')],_0x19241e['name'],_0x33a978[_0x73c5('0x28')],_0x33a978[_0x73c5('0xd')]['name'],_0x33a978[_0x73c5('0x30')]['id'],![],_0x43c149);if(rpc[_0x33a978[_0x73c5('0x2e')]+_0x73c5('0x35')]){return rpc[_0x33a978[_0x73c5('0x2e')]+_0x73c5('0x35')]['update'](_0x3eaaf2,_0x5e32f2)[_0x73c5('0x37')](function(_0x4de9c1){logger['error']('update\x20queue\x20report',_0x4de9c1);});}}}function handleFindQueue(_0x5af484){return function(_0x111019){return _0x111019[_0x73c5('0x34')]['toLowerCase']()===_0x5af484['toLowerCase']();};}exports[_0x73c5('0x42')]=function(_0x4fed8f,_0x4338cf,_0x4f1d0c,_0x1d9e1d){return function(_0x33f4f9){try{var _0x1b4970={'name':_0x4338cf[0x0],'timeout':_0x4338cf[0x1]};var _0x4bcfcd=queue['validate'](_0x1b4970,{'typecast':!![]});if(_0x4bcfcd[_0x73c5('0x43')]){logger[_0x73c5('0x3e')](_0x73c5('0x44'),_0x4fed8f,_[_0x73c5('0x45')](_0x4bcfcd,_0x73c5('0x30'))['join'](',\x20'));_0x33f4f9[_0x73c5('0x46')]();}else{var _0xe3df5=_[_0x73c5('0x47')](_0x4f1d0c[_0x1d9e1d[_0x73c5('0x2e')]+_0x73c5('0x48')],handleFindQueue(_0x1b4970[_0x73c5('0x34')]));if(_0xe3df5){startRouting(_0x4fed8f,_0xe3df5,_0x1d9e1d,_0x4f1d0c);var _0x2d9d24=(_0xe3df5['timeout']||0xa)*0x3e8;var _0x3360eb=(_0x1b4970['timeout']||0x14)*0x3e8;var _0x477f4e;if(_0x2d9d24>_0x3360eb){_0x3360eb=_0x2d9d24;}var _0x9be9d8=seqqueue[_0x73c5('0x49')](_0x2d9d24);_0x9be9d8['id']=_0x4fed8f;_0x9be9d8[_0x73c5('0x4a')]=_0x2d9d24;_0x9be9d8[_0x73c5('0x4b')]=_0x3360eb;_0x9be9d8['channel']=_0x1d9e1d[_0x73c5('0x2e')];_0x4f1d0c[_0x73c5('0x4c')][_0x4fed8f]['on'](_0x73c5('0x4d'),function(){logger[_0x73c5('0x32')](_0x73c5('0x4e'),_0x4fed8f);stopRouting(_0x4fed8f,_0xe3df5,_0x1d9e1d,_0x4f1d0c);clearTimeout(_0x477f4e);_0x477f4e=undefined;_0x9be9d8[_0x73c5('0x4f')](!![]);if(_0x4f1d0c['rules'][_0x4fed8f]){delete _0x4f1d0c[_0x73c5('0x4c')][_0x4fed8f];}_0x33f4f9['stop']();});_0x4f1d0c[_0x73c5('0x4c')][_0x4fed8f]['on'](_0x73c5('0x50'),function(){if(_0x4f1d0c[_0x73c5('0x4c')][_0x4fed8f]){delete _0x4f1d0c[_0x73c5('0x4c')][_0x4fed8f];}});_0x477f4e=setTimeout(function(){logger['info'](_0x73c5('0x51'),_0x4fed8f);endRouting(_0x4fed8f,_0xe3df5,_0x1d9e1d,_0x4f1d0c);clearTimeout(_0x477f4e);_0x9be9d8[_0x73c5('0x4f')](!![]);_0x33f4f9[_0x73c5('0x52')]();},_0x3360eb);switch(_0xe3df5[_0x73c5('0x53')]){case _0x73c5('0x54'):strategy['rrmemory'](_0x9be9d8,_0xe3df5,_0x4f1d0c,_0x1d9e1d);break;default:strategy[_0x73c5('0x55')](_0x9be9d8,_0xe3df5,_0x4f1d0c,_0x1d9e1d);}}else{logger[_0x73c5('0x3e')](_0x73c5('0x56'),_0x4fed8f,_0x1b4970['name']);_0x33f4f9[_0x73c5('0x46')]();}}}catch(_0x4600d7){logger[_0x73c5('0x3e')]('[%s][QUEUE]\x20%s',_0x4fed8f,_0x4600d7[_0x73c5('0x57')]);_0x33f4f9[_0x73c5('0x46')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee14=['RINGING',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog'];(function(_0x29dcf9,_0x1c4ecb){var _0x836250=function(_0x4ae913){while(--_0x4ae913){_0x29dcf9['push'](_0x29dcf9['shift']());}};_0x836250(++_0x1c4ecb);}(_0xee14,0x13a));var _0x4ee1=function(_0x586e1b,_0x2b0541){_0x586e1b=_0x586e1b-0x0;var _0x4f50f0=_0xee14[_0x586e1b];return _0x4f50f0;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x4ee1('0x0'));var logger=require(_0x4ee1('0x1'))(_0x4ee1('0x2'));var Agent=function(_0x1fa407,_0x18e3c4,_0x236ccd,_0x34a0ae){this[_0x4ee1('0x3')]=uuid['v4']();this[_0x4ee1('0x4')]=_0x1fa407;this['agent']=_0x18e3c4;this[_0x4ee1('0x5')]=_0x236ccd;this['routing']=_0x34a0ae;this[_0x4ee1('0x4')][_0x4ee1('0x6')](this[_0x4ee1('0x7')][_0x4ee1('0x8')](this),this[_0x4ee1('0x9')][_0x4ee1('0x8')](this));this['squeue']['on'](_0x4ee1('0xa'),this[_0x4ee1('0x9')]['bind'](this));this[_0x4ee1('0x4')]['on'](_0x4ee1('0xb'),this[_0x4ee1('0xc')][_0x4ee1('0x8')](this));};Agent['prototype'][_0x4ee1('0x6')]=function(){this[_0x4ee1('0x4')][_0x4ee1('0x6')](this[_0x4ee1('0x7')][_0x4ee1('0x8')](this),this[_0x4ee1('0x9')]['bind'](this));};Agent[_0x4ee1('0xd')][_0x4ee1('0xc')]=function(){this[_0x4ee1('0x9')](!![]);};Agent[_0x4ee1('0xd')][_0x4ee1('0x7')]=function(){logger[_0x4ee1('0xe')](_0x4ee1('0xf'),this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x10')]['id']);if(_['isNil'](this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']])){logger[_0x4ee1('0xe')](_0x4ee1('0x12'),this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x10')]['id']);setTimeout(this[_0x4ee1('0x6')][_0x4ee1('0x8')](this),0x3e8);}else{if(this[_0x4ee1('0x2')][_0x4ee1('0x13')]||util['isAgentAvailable'](this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']],this[_0x4ee1('0x4')][_0x4ee1('0x14')],![])){this['realtime'][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']][_0x4ee1('0x15')]=!![];this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']][_0x4ee1('0x16')]=undefined;util[_0x4ee1('0x17')](this[_0x4ee1('0x5')],this[_0x4ee1('0x2')],this['agent'],this['squeue'][_0x4ee1('0x14')]);util[_0x4ee1('0x18')](this[_0x4ee1('0x3')],this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')][_0x4ee1('0x11')][this['agent']['id']],null,this['routing']);util[_0x4ee1('0x19')](this[_0x4ee1('0x4')]['id'],this['realtime'][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']],_0x4ee1('0x1a')+(this[_0x4ee1('0x2')][_0x4ee1('0x13')]?_0x4ee1('0x1b'):''));}else{logger[_0x4ee1('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4ee1('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x4ee1('0x6')]['bind'](this),0x3e8);}}};Agent[_0x4ee1('0xd')][_0x4ee1('0x9')]=function(_0x59a34e){if(_[_0x4ee1('0x1c')](this[_0x4ee1('0x5')]['agents'][this[_0x4ee1('0x10')]['id']])){return logger['debug'](_0x4ee1('0x12'),this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x10')]['id']);}else{logger[_0x4ee1('0xe')](_0x4ee1('0x1d'),this['squeue']['id'],this[_0x4ee1('0x10')]['id']);util[_0x4ee1('0x1e')](this[_0x4ee1('0x3')],this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')][_0x4ee1('0x11')][this['agent']['id']],null,this['routing']);this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']]['busy']=![];this[_0x4ee1('0x5')][_0x4ee1('0x11')][this[_0x4ee1('0x10')]['id']][_0x4ee1('0x16')]=undefined;util[_0x4ee1('0x1f')](this[_0x4ee1('0x5')],this[_0x4ee1('0x2')],this[_0x4ee1('0x10')],this[_0x4ee1('0x4')][_0x4ee1('0x14')]);util[_0x4ee1('0x19')](this[_0x4ee1('0x4')]['id'],this[_0x4ee1('0x5')]['agents'][this[_0x4ee1('0x10')]['id']],_0x59a34e?_0x4ee1('0x20'):_0x4ee1('0x21'));}if(!_0x59a34e){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x257f67,_0x84480e,_0x74e6e2,_0x1f2b4b){return new Agent(_0x257f67,_0x84480e,_0x74e6e2,_0x1f2b4b);}module['exports']=agent;
\ No newline at end of file
+var _0x00bb=['bind','handleTimeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','realtime','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agent','forcedOwnership','agents','busy','busyQueue','channel','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','push','handleRun'];(function(_0x5a49c8,_0x442e34){var _0x1e99eb=function(_0x1339cb){while(--_0x1339cb){_0x5a49c8['push'](_0x5a49c8['shift']());}};_0x1e99eb(++_0x442e34);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x00bb[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xb00b('0x0'));var uuid=require(_0xb00b('0x1'));var util=require(_0xb00b('0x2'));var logger=require('../../../../../config/logger')(_0xb00b('0x3'));var Agent=function(_0x47a3bf,_0x278c5e,_0x464fe7,_0x582ef9){this[_0xb00b('0x4')]=uuid['v4']();this[_0xb00b('0x5')]=_0x47a3bf;this['agent']=_0x278c5e;this['realtime']=_0x464fe7;this['routing']=_0x582ef9;this[_0xb00b('0x5')][_0xb00b('0x6')](this[_0xb00b('0x7')][_0xb00b('0x8')](this),this[_0xb00b('0x9')][_0xb00b('0x8')](this));this['squeue']['on']('timeout',this[_0xb00b('0x9')][_0xb00b('0x8')](this));this[_0xb00b('0x5')]['on'](_0xb00b('0xa'),this[_0xb00b('0xb')]['bind'](this));};Agent[_0xb00b('0xc')]['push']=function(){this['squeue']['push'](this[_0xb00b('0x7')][_0xb00b('0x8')](this),this[_0xb00b('0x9')][_0xb00b('0x8')](this));};Agent[_0xb00b('0xc')][_0xb00b('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0xb00b('0xc')][_0xb00b('0x7')]=function(){logger['debug'](_0xb00b('0xd'),this[_0xb00b('0x5')]['id'],this['agent']['id']);if(_['isNil'](this[_0xb00b('0xe')]['agents'][this['agent']['id']])){logger[_0xb00b('0xf')](_0xb00b('0x10'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);setTimeout(this['push'][_0xb00b('0x8')](this),0x3e8);}else{if(this['routing'][_0xb00b('0x12')]||util['isAgentAvailable'](this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],this['squeue']['channel'],![])){this[_0xb00b('0xe')]['agents'][this[_0xb00b('0x11')]['id']][_0xb00b('0x14')]=!![];this[_0xb00b('0xe')][_0xb00b('0x13')][this['agent']['id']][_0xb00b('0x15')]=undefined;util['saveWaitingNotification'](this[_0xb00b('0xe')],this[_0xb00b('0x3')],this['agent'],this[_0xb00b('0x5')][_0xb00b('0x16')]);util['showNotification'](this[_0xb00b('0x4')],this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],null,this[_0xb00b('0x3')]);util[_0xb00b('0x17')](this['squeue']['id'],this['realtime'][_0xb00b('0x13')][this['agent']['id']],'RINGING'+(this['routing'][_0xb00b('0x12')]?_0xb00b('0x18'):''));}else{logger[_0xb00b('0xf')](_0xb00b('0x19'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);setTimeout(this[_0xb00b('0x6')]['bind'](this),0x3e8);}}};Agent[_0xb00b('0xc')]['handleTimeout']=function(_0x450129){if(_[_0xb00b('0x1a')](this[_0xb00b('0xe')]['agents'][this[_0xb00b('0x11')]['id']])){return logger[_0xb00b('0xf')](_0xb00b('0x10'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);}else{logger[_0xb00b('0xf')](_0xb00b('0x1b'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);util['hideNotification'](this[_0xb00b('0x4')],this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],null,this['routing']);this[_0xb00b('0xe')]['agents'][this[_0xb00b('0x11')]['id']][_0xb00b('0x14')]=![];this[_0xb00b('0xe')][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']][_0xb00b('0x15')]=undefined;util[_0xb00b('0x1c')](this['realtime'],this['routing'],this['agent'],this[_0xb00b('0x5')][_0xb00b('0x16')]);util[_0xb00b('0x17')](this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],_0x450129?_0xb00b('0x1d'):_0xb00b('0x1e'));}if(!_0x450129){setTimeout(this[_0xb00b('0x6')][_0xb00b('0x8')](this),0x3e8);}};function agent(_0x8785ec,_0x3302ac,_0x5efc18,_0x55451e){return new Agent(_0x8785ec,_0x3302ac,_0x5efc18,_0x55451e);}module[_0xb00b('0x1f')]=agent;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33df=['debug','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','routing','channel','showNotification','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','removeWaitingNotification','exports','uuid','../../../../../config/logger','notificationId','squeue','realtime','handleRun','bind','handleTimeout','timeout','drained','prototype','push','handleDrained','isNil','queue','Agents','length','agents'];(function(_0x52e44c,_0xaee70b){var _0x131e4f=function(_0x34f3dd){while(--_0x34f3dd){_0x52e44c['push'](_0x52e44c['shift']());}};_0x131e4f(++_0xaee70b);}(_0x33df,0xfe));var _0xf33d=function(_0x17777a,_0x31b31d){_0x17777a=_0x17777a-0x0;var _0x2c89f6=_0x33df[_0x17777a];return _0x2c89f6;};'use strict';var _=require('lodash');var uuid=require(_0xf33d('0x0'));var util=require('./util');var logger=require(_0xf33d('0x1'))('routing');var Beepall=function(_0x22318e,_0x4cd08e,_0x2a4686,_0x41169a){this[_0xf33d('0x2')]=uuid['v4']();this[_0xf33d('0x3')]=_0x22318e;this['queue']=_0x4cd08e;this[_0xf33d('0x4')]=_0x2a4686;this['routing']=_0x41169a;this[_0xf33d('0x3')]['push'](this[_0xf33d('0x5')][_0xf33d('0x6')](this),this[_0xf33d('0x7')][_0xf33d('0x6')](this));this[_0xf33d('0x3')]['on'](_0xf33d('0x8'),this['handleTimeout'][_0xf33d('0x6')](this));this['squeue']['on'](_0xf33d('0x9'),this['handleDrained'][_0xf33d('0x6')](this));};Beepall[_0xf33d('0xa')]['push']=function(){this[_0xf33d('0x3')][_0xf33d('0xb')](this['handleRun'][_0xf33d('0x6')](this),this[_0xf33d('0x7')][_0xf33d('0x6')](this));};Beepall[_0xf33d('0xa')][_0xf33d('0xc')]=function(){this[_0xf33d('0x7')](!![]);};Beepall[_0xf33d('0xa')][_0xf33d('0x5')]=function(){var _0x3d7b33=!![];if(!_[_0xf33d('0xd')](this[_0xf33d('0xe')])&&!_[_0xf33d('0xd')](this[_0xf33d('0xe')][_0xf33d('0xf')])&&this[_0xf33d('0xe')][_0xf33d('0xf')][_0xf33d('0x10')]>0x0){for(var _0x51c9e1=0x0,_0x48a5ef;_0x51c9e1<this[_0xf33d('0xe')]['Agents'][_0xf33d('0x10')];_0x51c9e1+=0x1){_0x48a5ef=this['queue']['Agents'][_0x51c9e1]['id'];if(_[_0xf33d('0xd')](this[_0xf33d('0x4')][_0xf33d('0x11')][_0x48a5ef])){logger[_0xf33d('0x12')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf33d('0x3')]['id'],_0x48a5ef);}else{if(util[_0xf33d('0x13')](this['squeue']['id'],this[_0xf33d('0x4')][_0xf33d('0x11')][_0x48a5ef],this['squeue']['channel'],!![])){_0x3d7b33=![];util[_0xf33d('0x14')](this['squeue']['id'],this[_0xf33d('0x4')]['agents'][_0x48a5ef],_0xf33d('0x15'));this['realtime']['agents'][_0x48a5ef][_0xf33d('0x16')]=!![];this['realtime'][_0xf33d('0x11')][_0x48a5ef][_0xf33d('0x17')]=this['queue'][_0xf33d('0x18')];util['saveWaitingNotification'](this[_0xf33d('0x4')],this[_0xf33d('0x19')],this[_0xf33d('0xe')]['Agents'][_0x51c9e1],this[_0xf33d('0x3')][_0xf33d('0x1a')]);util[_0xf33d('0x1b')](this[_0xf33d('0x2')],this[_0xf33d('0x3')]['id'],this['realtime'][_0xf33d('0x11')][_0x48a5ef],this['queue'],this[_0xf33d('0x19')]);}}}if(_0x3d7b33){logger[_0xf33d('0x12')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this['squeue']['id']);setTimeout(this[_0xf33d('0xb')]['bind'](this),0x3e8);}}else{logger[_0xf33d('0x12')]('[%s][QUEUE]\x20EMPTY',this['squeue']['id']);setTimeout(this[_0xf33d('0xb')][_0xf33d('0x6')](this),0x3e8);}};Beepall[_0xf33d('0xa')]['handleTimeout']=function(_0x3c9e71){if(!_['isNil'](this[_0xf33d('0xe')])&&!_[_0xf33d('0xd')](this[_0xf33d('0xe')][_0xf33d('0xf')])){for(var _0x31762a=0x0,_0x21383e;_0x31762a<this[_0xf33d('0xe')][_0xf33d('0xf')][_0xf33d('0x10')];_0x31762a+=0x1){_0x21383e=this[_0xf33d('0xe')][_0xf33d('0xf')][_0x31762a]['id'];if(_[_0xf33d('0xd')](this[_0xf33d('0x4')][_0xf33d('0x11')][_0x21383e])){logger['debug'](_0xf33d('0x1c'),this[_0xf33d('0x3')]['id'],_0x21383e);}else{util[_0xf33d('0x1d')](this[_0xf33d('0x2')],this['squeue']['id'],this['realtime'][_0xf33d('0x11')][_0x21383e],this[_0xf33d('0xe')],this['routing']);util[_0xf33d('0x14')](this['squeue']['id'],this['realtime'][_0xf33d('0x11')][_0x21383e],_0x3c9e71?_0xf33d('0x1e'):_0xf33d('0x1f'));this['realtime'][_0xf33d('0x11')][_0x21383e][_0xf33d('0x16')]=![];this[_0xf33d('0x4')][_0xf33d('0x11')][_0x21383e][_0xf33d('0x17')]=undefined;util[_0xf33d('0x20')](this['realtime'],this[_0xf33d('0x19')],this['realtime'][_0xf33d('0x11')][_0x21383e],this['squeue'][_0xf33d('0x1a')]);}}}if(!_0x3c9e71){setTimeout(this[_0xf33d('0xb')][_0xf33d('0x6')](this),0x3e8);}};function beepall(_0x776661,_0x14f3fd,_0x1419be,_0x4c4742){return new Beepall(_0x776661,_0x14f3fd,_0x1419be,_0x4c4742);}module[_0xf33d('0x21')]=beepall;
\ No newline at end of file
+var _0x331e=['squeue','realtime','push','bind','handleTimeout','timeout','handleDrained','handleRun','prototype','queue','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','agents','RINGING','busy','busyQueue','name','channel','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','removeWaitingNotification','exports','lodash','routing','notificationId'];(function(_0x11641b,_0x3ef33a){var _0x127e85=function(_0x49162e){while(--_0x49162e){_0x11641b['push'](_0x11641b['shift']());}};_0x127e85(++_0x3ef33a);}(_0x331e,0x168));var _0xe331=function(_0x25bb4c,_0x1a0b53){_0x25bb4c=_0x25bb4c-0x0;var _0x4c78b2=_0x331e[_0x25bb4c];return _0x4c78b2;};'use strict';var _=require(_0xe331('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')(_0xe331('0x1'));var Beepall=function(_0x19e779,_0x2bd1ae,_0x1f7f18,_0x4843f9){this[_0xe331('0x2')]=uuid['v4']();this[_0xe331('0x3')]=_0x19e779;this['queue']=_0x2bd1ae;this[_0xe331('0x4')]=_0x1f7f18;this[_0xe331('0x1')]=_0x4843f9;this[_0xe331('0x3')][_0xe331('0x5')](this['handleRun'][_0xe331('0x6')](this),this[_0xe331('0x7')][_0xe331('0x6')](this));this[_0xe331('0x3')]['on'](_0xe331('0x8'),this['handleTimeout'][_0xe331('0x6')](this));this[_0xe331('0x3')]['on']('drained',this[_0xe331('0x9')][_0xe331('0x6')](this));};Beepall['prototype']['push']=function(){this[_0xe331('0x3')]['push'](this[_0xe331('0xa')][_0xe331('0x6')](this),this[_0xe331('0x7')]['bind'](this));};Beepall[_0xe331('0xb')][_0xe331('0x9')]=function(){this[_0xe331('0x7')](!![]);};Beepall[_0xe331('0xb')][_0xe331('0xa')]=function(){var _0x2620b9=!![];if(!_['isNil'](this[_0xe331('0xc')])&&!_[_0xe331('0xd')](this[_0xe331('0xc')]['Agents'])&&this['queue'][_0xe331('0xe')][_0xe331('0xf')]>0x0){for(var _0xf17fc8=0x0,_0x1eb42e;_0xf17fc8<this['queue'][_0xe331('0xe')][_0xe331('0xf')];_0xf17fc8+=0x1){_0x1eb42e=this[_0xe331('0xc')][_0xe331('0xe')][_0xf17fc8]['id'];if(_[_0xe331('0xd')](this['realtime']['agents'][_0x1eb42e])){logger['debug'](_0xe331('0x10'),this[_0xe331('0x3')]['id'],_0x1eb42e);}else{if(util[_0xe331('0x11')](this[_0xe331('0x3')]['id'],this[_0xe331('0x4')]['agents'][_0x1eb42e],this[_0xe331('0x3')]['channel'],!![])){_0x2620b9=![];util[_0xe331('0x12')](this[_0xe331('0x3')]['id'],this[_0xe331('0x4')][_0xe331('0x13')][_0x1eb42e],_0xe331('0x14'));this['realtime'][_0xe331('0x13')][_0x1eb42e][_0xe331('0x15')]=!![];this[_0xe331('0x4')][_0xe331('0x13')][_0x1eb42e][_0xe331('0x16')]=this['queue'][_0xe331('0x17')];util['saveWaitingNotification'](this[_0xe331('0x4')],this[_0xe331('0x1')],this['queue'][_0xe331('0xe')][_0xf17fc8],this['squeue'][_0xe331('0x18')]);util[_0xe331('0x19')](this[_0xe331('0x2')],this['squeue']['id'],this['realtime'][_0xe331('0x13')][_0x1eb42e],this[_0xe331('0xc')],this['routing']);}}}if(_0x2620b9){logger[_0xe331('0x1a')](_0xe331('0x1b'),this[_0xe331('0x3')]['id']);setTimeout(this[_0xe331('0x5')]['bind'](this),0x3e8);}}else{logger[_0xe331('0x1a')](_0xe331('0x1c'),this[_0xe331('0x3')]['id']);setTimeout(this[_0xe331('0x5')][_0xe331('0x6')](this),0x3e8);}};Beepall[_0xe331('0xb')]['handleTimeout']=function(_0x53b137){if(!_[_0xe331('0xd')](this[_0xe331('0xc')])&&!_[_0xe331('0xd')](this[_0xe331('0xc')]['Agents'])){for(var _0x4e0c65=0x0,_0x1f6f17;_0x4e0c65<this[_0xe331('0xc')][_0xe331('0xe')][_0xe331('0xf')];_0x4e0c65+=0x1){_0x1f6f17=this[_0xe331('0xc')]['Agents'][_0x4e0c65]['id'];if(_[_0xe331('0xd')](this['realtime'][_0xe331('0x13')][_0x1f6f17])){logger[_0xe331('0x1a')](_0xe331('0x10'),this[_0xe331('0x3')]['id'],_0x1f6f17);}else{util[_0xe331('0x1d')](this[_0xe331('0x2')],this[_0xe331('0x3')]['id'],this[_0xe331('0x4')][_0xe331('0x13')][_0x1f6f17],this[_0xe331('0xc')],this[_0xe331('0x1')]);util[_0xe331('0x12')](this[_0xe331('0x3')]['id'],this[_0xe331('0x4')][_0xe331('0x13')][_0x1f6f17],_0x53b137?'STOP':_0xe331('0x1e'));this[_0xe331('0x4')][_0xe331('0x13')][_0x1f6f17][_0xe331('0x15')]=![];this[_0xe331('0x4')][_0xe331('0x13')][_0x1f6f17]['busyQueue']=undefined;util[_0xe331('0x1f')](this[_0xe331('0x4')],this[_0xe331('0x1')],this[_0xe331('0x4')][_0xe331('0x13')][_0x1f6f17],this[_0xe331('0x3')][_0xe331('0x18')]);}}}if(!_0x53b137){setTimeout(this[_0xe331('0x5')][_0xe331('0x6')](this),0x3e8);}};function beepall(_0x489b57,_0x40b324,_0x40c2f9,_0x1075a5){return new Beepall(_0x489b57,_0x40b324,_0x40c2f9,_0x1075a5);}module[_0xe331('0x20')]=beepall;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cc6=['exports','./beepall'];(function(_0x557731,_0x58fcef){var _0x26001b=function(_0x2115b7){while(--_0x2115b7){_0x557731['push'](_0x557731['shift']());}};_0x26001b(++_0x58fcef);}(_0x2cc6,0x166));var _0x62cc=function(_0x3d3590,_0x23bd12){_0x3d3590=_0x3d3590-0x0;var _0x1348ff=_0x2cc6[_0x3d3590];return _0x1348ff;};'use strict';module[_0x62cc('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x62cc('0x1')),'agent':require('./agent')};
\ No newline at end of file
+var _0x8625=['exports','./beepall','./agent'];(function(_0xac02b0,_0x4cc281){var _0x3a0180=function(_0x3a4d95){while(--_0x3a4d95){_0xac02b0['push'](_0xac02b0['shift']());}};_0x3a0180(++_0x4cc281);}(_0x8625,0xde));var _0x5862=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x8625[_0x88cd7b];return _0x56fcc8;};'use strict';module[_0x5862('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x5862('0x1')),'agent':require(_0x5862('0x2'))};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac3b=['isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','realtime','busyQueue','name','saveWaitingNotification','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','hideNotification','queue','TIMEOUT','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','squeue','push','handleRun','handleTimeout','bind','module','timeout','drained','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','channel','debug','[%s][QUEUE]\x20available\x20again\x20%s','agentId','intervals','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s'];(function(_0x281a28,_0x34542c){var _0x54f40c=function(_0x28bde9){while(--_0x28bde9){_0x281a28['push'](_0x281a28['shift']());}};_0x54f40c(++_0x34542c);}(_0xac3b,0xd7));var _0xbac3=function(_0x37a896,_0x5569de){_0x37a896=_0x37a896-0x0;var _0x510515=_0xac3b[_0x37a896];return _0x510515;};'use strict';var rr=require('rr');var _=require(_0xbac3('0x0'));var uuid=require('uuid');var util=require(_0xbac3('0x1'));var logger=require(_0xbac3('0x2'))(_0xbac3('0x3'));var RRMemory=function(_0x3c4569,_0x3c32f9,_0x129bf7,_0x10e1db){this['notificationId']=uuid['v4']();this[_0xbac3('0x4')]=_0x3c4569;this['queue']=_0x3c32f9;this['realtime']=_0x129bf7;this[_0xbac3('0x3')]=_0x10e1db;this['intervals']={};this[_0xbac3('0x4')][_0xbac3('0x5')](this[_0xbac3('0x6')]['bind'](this),this[_0xbac3('0x7')][_0xbac3('0x8')](this),this[_0xbac3('0x9')]);this[_0xbac3('0x4')]['on'](_0xbac3('0xa'),this[_0xbac3('0x7')][_0xbac3('0x8')](this));this[_0xbac3('0x4')]['on'](_0xbac3('0xb'),this[_0xbac3('0xc')]['bind'](this));};RRMemory['prototype']['push']=function(){this[_0xbac3('0x4')]['push'](this['handleRun'][_0xbac3('0x8')](this),this[_0xbac3('0x7')]['bind'](this));};RRMemory[_0xbac3('0xd')][_0xbac3('0xc')]=function(){this[_0xbac3('0x7')](!![]);};RRMemory[_0xbac3('0xd')][_0xbac3('0xe')]=function(_0x5eb1cd){if(util[_0xbac3('0xf')](this[_0xbac3('0x4')]['id'],this['realtime'][_0xbac3('0x10')][this['agentId']],this[_0xbac3('0x4')][_0xbac3('0x11')],!![])){logger[_0xbac3('0x12')](_0xbac3('0x13'),this[_0xbac3('0x4')]['id'],this[_0xbac3('0x14')]);clearInterval(this[_0xbac3('0x15')][this['agentId']]);_0x5eb1cd[_0xbac3('0x16')]();setTimeout(this['push']['bind'](this),0x3e8);}};RRMemory['prototype']['handleRun']=function(_0x4bcb8d){this[_0xbac3('0x14')]=rr(this['queue'][_0xbac3('0x17')]);logger[_0xbac3('0x12')](_0xbac3('0x18'),this[_0xbac3('0x4')]['id'],this[_0xbac3('0x14')]);if(_[_0xbac3('0x19')](this['realtime'][_0xbac3('0x10')][this[_0xbac3('0x14')]])){logger[_0xbac3('0x12')](_0xbac3('0x1a'),this[_0xbac3('0x4')]['id'],this[_0xbac3('0x14')]);_0x4bcb8d[_0xbac3('0x16')]();setTimeout(this[_0xbac3('0x5')]['bind'](this),0x3e8);}else{if(util[_0xbac3('0xf')](this[_0xbac3('0x4')]['id'],this[_0xbac3('0x1b')]['agents'][this[_0xbac3('0x14')]],this[_0xbac3('0x4')][_0xbac3('0x11')],!![])){this[_0xbac3('0x1b')]['agents'][this['agentId']]['busy']=!![];this[_0xbac3('0x1b')][_0xbac3('0x10')][this[_0xbac3('0x14')]][_0xbac3('0x1c')]=this['queue'][_0xbac3('0x1d')];util[_0xbac3('0x1e')](this[_0xbac3('0x1b')],this[_0xbac3('0x3')],this['realtime'][_0xbac3('0x10')][this[_0xbac3('0x14')]],this[_0xbac3('0x4')][_0xbac3('0x11')]);util[_0xbac3('0x1f')](this['notificationId'],this['squeue']['id'],this[_0xbac3('0x1b')]['agents'][this[_0xbac3('0x14')]],this['queue'],this[_0xbac3('0x3')]);util[_0xbac3('0x20')](this['squeue']['id'],this[_0xbac3('0x1b')][_0xbac3('0x10')][this['agentId']],_0xbac3('0x21'));this[_0xbac3('0x15')][this[_0xbac3('0x14')]]=setInterval(this[_0xbac3('0xe')]['bind'](this,_0x4bcb8d),0x3e8);}else{logger[_0xbac3('0x12')](_0xbac3('0x22'),this['squeue']['id'],this[_0xbac3('0x14')]);_0x4bcb8d[_0xbac3('0x16')]();setTimeout(this[_0xbac3('0x5')][_0xbac3('0x8')](this),0x3e8);}}};RRMemory[_0xbac3('0xd')][_0xbac3('0x7')]=function(_0x448734){logger[_0xbac3('0x12')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xbac3('0x14')]);if(_[_0xbac3('0x19')](this['realtime']['agents'][this['agentId']])){logger[_0xbac3('0x12')](_0xbac3('0x1a'),this[_0xbac3('0x4')]['id'],this[_0xbac3('0x14')]);}else{clearInterval(this[_0xbac3('0x15')][this[_0xbac3('0x14')]]);util[_0xbac3('0x23')](this['notificationId'],this[_0xbac3('0x4')]['id'],this[_0xbac3('0x1b')][_0xbac3('0x10')][this[_0xbac3('0x14')]],this[_0xbac3('0x24')],this[_0xbac3('0x3')]);util[_0xbac3('0x20')](this[_0xbac3('0x4')]['id'],this['realtime'][_0xbac3('0x10')][this['agentId']],_0xbac3('0x25'));this[_0xbac3('0x1b')][_0xbac3('0x10')][this[_0xbac3('0x14')]]['busy']=![];this[_0xbac3('0x1b')][_0xbac3('0x10')][this[_0xbac3('0x14')]][_0xbac3('0x1c')]=undefined;util[_0xbac3('0x26')](this[_0xbac3('0x1b')],this['routing'],this[_0xbac3('0x1b')]['agents'][this[_0xbac3('0x14')]],this[_0xbac3('0x4')][_0xbac3('0x11')]);}if(!_0x448734){setTimeout(this[_0xbac3('0x5')]['bind'](this),0x3e8);}};function rrmemory(_0x404a19,_0x38950a,_0x32c01e,_0x4b6112){return new RRMemory(_0x404a19,_0x38950a,_0x32c01e,_0x4b6112);}module[_0xbac3('0x27')]=rrmemory;
\ No newline at end of file
+var _0xbfc2=['isAgentAvailable','agents','agentId','channel','debug','[%s][QUEUE]\x20available\x20again\x20%s','done','push','queue','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','saveWaitingNotification','showNotification','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','isNil','hideNotification','writeLog','removeWaitingNotification','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','intervals','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype'];(function(_0x5cfdf4,_0x278351){var _0xe40152=function(_0x3cbe90){while(--_0x3cbe90){_0x5cfdf4['push'](_0x5cfdf4['shift']());}};_0xe40152(++_0x278351);}(_0xbfc2,0xb4));var _0x2bfc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbfc2[_0x53ccf2];return _0x5a2964;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x2bfc('0x0'));var util=require(_0x2bfc('0x1'));var logger=require(_0x2bfc('0x2'))(_0x2bfc('0x3'));var RRMemory=function(_0x3f5bc7,_0x4e3772,_0x4dab33,_0x2f41f3){this[_0x2bfc('0x4')]=uuid['v4']();this['squeue']=_0x3f5bc7;this['queue']=_0x4e3772;this[_0x2bfc('0x5')]=_0x4dab33;this[_0x2bfc('0x3')]=_0x2f41f3;this[_0x2bfc('0x6')]={};this[_0x2bfc('0x7')]['push'](this[_0x2bfc('0x8')][_0x2bfc('0x9')](this),this[_0x2bfc('0xa')][_0x2bfc('0x9')](this),this['module']);this['squeue']['on'](_0x2bfc('0xb'),this['handleTimeout'][_0x2bfc('0x9')](this));this[_0x2bfc('0x7')]['on'](_0x2bfc('0xc'),this[_0x2bfc('0xd')][_0x2bfc('0x9')](this));};RRMemory[_0x2bfc('0xe')]['push']=function(){this[_0x2bfc('0x7')]['push'](this[_0x2bfc('0x8')][_0x2bfc('0x9')](this),this[_0x2bfc('0xa')][_0x2bfc('0x9')](this));};RRMemory['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};RRMemory[_0x2bfc('0xe')]['handleCheckReject']=function(_0x296073){if(util[_0x2bfc('0xf')](this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x5')][_0x2bfc('0x10')][this[_0x2bfc('0x11')]],this[_0x2bfc('0x7')][_0x2bfc('0x12')],!![])){logger[_0x2bfc('0x13')](_0x2bfc('0x14'),this['squeue']['id'],this[_0x2bfc('0x11')]);clearInterval(this[_0x2bfc('0x6')][this['agentId']]);_0x296073[_0x2bfc('0x15')]();setTimeout(this[_0x2bfc('0x16')][_0x2bfc('0x9')](this),0x3e8);}};RRMemory[_0x2bfc('0xe')][_0x2bfc('0x8')]=function(_0x3517f9){this['agentId']=rr(this[_0x2bfc('0x17')][_0x2bfc('0x18')]);logger[_0x2bfc('0x13')](_0x2bfc('0x19'),this['squeue']['id'],this['agentId']);if(_['isNil'](this[_0x2bfc('0x5')][_0x2bfc('0x10')][this[_0x2bfc('0x11')]])){logger[_0x2bfc('0x13')](_0x2bfc('0x1a'),this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x11')]);_0x3517f9['done']();setTimeout(this[_0x2bfc('0x16')][_0x2bfc('0x9')](this),0x3e8);}else{if(util[_0x2bfc('0xf')](this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x5')][_0x2bfc('0x10')][this[_0x2bfc('0x11')]],this[_0x2bfc('0x7')][_0x2bfc('0x12')],!![])){this['realtime']['agents'][this[_0x2bfc('0x11')]][_0x2bfc('0x1b')]=!![];this[_0x2bfc('0x5')][_0x2bfc('0x10')][this['agentId']][_0x2bfc('0x1c')]=this['queue'][_0x2bfc('0x1d')];util[_0x2bfc('0x1e')](this[_0x2bfc('0x5')],this[_0x2bfc('0x3')],this[_0x2bfc('0x5')]['agents'][this[_0x2bfc('0x11')]],this[_0x2bfc('0x7')]['channel']);util[_0x2bfc('0x1f')](this[_0x2bfc('0x4')],this['squeue']['id'],this['realtime'][_0x2bfc('0x10')][this[_0x2bfc('0x11')]],this[_0x2bfc('0x17')],this[_0x2bfc('0x3')]);util['writeLog'](this['squeue']['id'],this[_0x2bfc('0x5')][_0x2bfc('0x10')][this[_0x2bfc('0x11')]],_0x2bfc('0x20'));this[_0x2bfc('0x6')][this['agentId']]=setInterval(this['handleCheckReject'][_0x2bfc('0x9')](this,_0x3517f9),0x3e8);}else{logger[_0x2bfc('0x13')](_0x2bfc('0x21'),this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x11')]);_0x3517f9['done']();setTimeout(this[_0x2bfc('0x16')][_0x2bfc('0x9')](this),0x3e8);}}};RRMemory[_0x2bfc('0xe')]['handleTimeout']=function(_0xff50d3){logger[_0x2bfc('0x13')](_0x2bfc('0x22'),this['squeue']['id'],this[_0x2bfc('0x11')]);if(_[_0x2bfc('0x23')](this[_0x2bfc('0x5')]['agents'][this['agentId']])){logger[_0x2bfc('0x13')](_0x2bfc('0x1a'),this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x11')]);}else{clearInterval(this[_0x2bfc('0x6')][this['agentId']]);util[_0x2bfc('0x24')](this[_0x2bfc('0x4')],this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x5')][_0x2bfc('0x10')][this[_0x2bfc('0x11')]],this[_0x2bfc('0x17')],this[_0x2bfc('0x3')]);util[_0x2bfc('0x25')](this[_0x2bfc('0x7')]['id'],this[_0x2bfc('0x5')]['agents'][this['agentId']],'TIMEOUT');this['realtime'][_0x2bfc('0x10')][this['agentId']][_0x2bfc('0x1b')]=![];this[_0x2bfc('0x5')]['agents'][this['agentId']][_0x2bfc('0x1c')]=undefined;util[_0x2bfc('0x26')](this['realtime'],this['routing'],this['realtime'][_0x2bfc('0x10')][this[_0x2bfc('0x11')]],this['squeue']['channel']);}if(!_0xff50d3){setTimeout(this[_0x2bfc('0x16')][_0x2bfc('0x9')](this),0x3e8);}};function rrmemory(_0x4eca54,_0x4bc584,_0x3850b2,_0xe93432){return new RRMemory(_0x4eca54,_0x4bc584,_0x3850b2,_0xe93432);}module['exports']=rrmemory;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ea2=['checkWaitingNotifications','UserId','channel','QueuesWaitingInteractions','InteractionId','agents','some','WaitingInteractions','interaction','message','removeWaitingNotification','writeLog','lodash','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','\x20interaction','name','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','format','[%s][QUEUE]\x20%s','user:%s','emit','notification:%s','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','showNotification','hideNotification'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5ea2,0x99));var _0x25ea=function(_0xc19ba6,_0x4788d3){_0xc19ba6=_0xc19ba6-0x0;var _0x253883=_0x5ea2[_0xc19ba6];return _0x253883;};'use strict';var _=require(_0x25ea('0x0'));var util=require('util');var utils=require('../utils');var Redis=require(_0x25ea('0x1'));var config=require(_0x25ea('0x2'));var logger=require(_0x25ea('0x3'))(_0x25ea('0x4'));config[_0x25ea('0x5')]=_['defaults'](config[_0x25ea('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x25ea('0x5')]));function sendNotification(_0x310a27,_0x3ca48f,_0x214ed8,_0x274f48,_0x254d54,_0x1c5b5d){var _0x2b4c7b=_0x1c5b5d||{};var _0x10fc57=_0x214ed8['split']('.');var _0x4389cd={'uniqueid':_0x3ca48f,'channel':_0x10fc57[0x0],'id':_0x10fc57[0x1],'title':_0x10fc57[0x0]+_0x25ea('0x6'),'interactionId':_0x10fc57[0x2],'queue':_0x254d54?_0x254d54[_0x25ea('0x7')]:null,'sound':_0x2b4c7b[_0x25ea('0x8')]['notificationSound'],'shake':_0x2b4c7b[_0x25ea('0x8')][_0x25ea('0x9')]};try{if(!_0x2b4c7b[_0x25ea('0xa')]){_0x2b4c7b[_0x25ea('0xa')]={};}if(_0x254d54){_0x2b4c7b[_0x25ea('0xa')][_0x25ea('0xb')]=_0x254d54;}else if(_0x2b4c7b['body']['queue']){delete _0x2b4c7b[_0x25ea('0xa')][_0x25ea('0xb')];}_0x4389cd['msg']=utils[_0x25ea('0xc')](_0x2b4c7b[_0x25ea('0x8')][_0x25ea('0xd')],_0x2b4c7b);}catch(_0x190d5a){_0x4389cd[_0x25ea('0xe')]=_0x25ea('0xf');logger['error'](util[_0x25ea('0x10')](_0x25ea('0x11'),_0x3ca48f,_0x190d5a['message']));}io['to'](util[_0x25ea('0x10')](_0x25ea('0x12'),_0x274f48[_0x25ea('0x7')]))[_0x25ea('0x13')](util[_0x25ea('0x10')](_0x25ea('0x14'),_0x310a27?'save':_0x25ea('0x15')),_0x4389cd);}function writeLog(_0x454b8e,_0x3b327e,_0x8d12b0){return logger[_0x25ea('0x16')](util[_0x25ea('0x10')](_0x25ea('0x17'),_0x454b8e,_0x3b327e['name'],_0x8d12b0));}exports[_0x25ea('0x18')]=function(_0x133343,_0x5578fe,_0x13884d,_0x58d927){if(_0x5578fe['busy']){writeLog(_0x133343,_0x5578fe,_0x25ea('0x19'));return![];}if(!_0x5578fe['online']){writeLog(_0x133343,_0x5578fe,_0x25ea('0x1a'));return![];}if(_0x5578fe[_0x13884d+_0x25ea('0x1b')]){writeLog(_0x133343,_0x5578fe,_0x25ea('0x1c'));return![];}if(_0x58d927&&_0x5578fe[_0x25ea('0x1d')](_0x13884d+'Capacity')&&_0x5578fe[_0x25ea('0x1d')](_0x13884d+_0x25ea('0x1e'))){if(_0x5578fe[_0x13884d+_0x25ea('0x1f')]>0x0&&_0x5578fe[_0x13884d+'CurrentCapacity']>=_0x5578fe[_0x13884d+_0x25ea('0x1f')]){writeLog(_0x133343,_0x5578fe,_0x13884d[_0x25ea('0x20')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x25ea('0x21')]=function(_0x2b5351,_0x5b9780,_0x260e8a,_0x104361,_0x2fe961){return sendNotification(!![],_0x2b5351,_0x5b9780,_0x260e8a,_0x104361,_0x2fe961);};exports[_0x25ea('0x22')]=function(_0x20c65b,_0xe63b85,_0x390c7b,_0x41e2a0,_0x12e061){return sendNotification(![],_0x20c65b,_0xe63b85,_0x390c7b,_0x41e2a0,_0x12e061);};exports[_0x25ea('0x23')]=function(_0x166cf5,_0x3e2a3e,_0x46520a){var _0x55020d=_0x3e2a3e['interaction'][_0x25ea('0x24')];if(!_0x55020d&&_0x46520a){_0x55020d=_0x46520a['id'];}var _0x21c4fc=_['some'](_0x166cf5[_0x3e2a3e[_0x25ea('0x25')]+_0x25ea('0x26')],function(_0x4171bf){var _0x5e47a8=_['capitalize'](_0x3e2a3e[_0x25ea('0x25')])+_0x25ea('0x27');return _0x4171bf[_0x5e47a8]===_0x3e2a3e['interaction']['id'];});if(!_0x21c4fc&&_0x55020d&&_0x166cf5[_0x25ea('0x28')][_0x55020d]){_0x21c4fc=_[_0x25ea('0x29')](_0x166cf5['agents'][_0x55020d][_0x3e2a3e[_0x25ea('0x25')]+_0x25ea('0x2a')],function(_0x3a852e){return _0x3a852e['id']===_0x3e2a3e[_0x25ea('0x2b')]['id'];});}return _0x21c4fc;};exports['saveWaitingNotification']=function(_0x10bf23,_0x5b6527,_0x2dde3a,_0x21b9ee){if(_0x2dde3a&&_0x2dde3a['id']&&_0x10bf23[_0x25ea('0x28')]&&_0x10bf23[_0x25ea('0x28')][_0x2dde3a['id']]){_0x10bf23['agents'][_0x2dde3a['id']][_0x21b9ee+'WaitingInteractions'][_0x5b6527[_0x25ea('0x2c')]['id']]={'id':_0x5b6527['interaction']['id']};}};exports[_0x25ea('0x2d')]=function(_0x6bc231,_0x47a447,_0x43367f,_0x57bfc4){if(_0x43367f&&_0x43367f['id']&&_0x6bc231['agents']&&_0x6bc231[_0x25ea('0x28')][_0x43367f['id']]){delete _0x6bc231[_0x25ea('0x28')][_0x43367f['id']][_0x57bfc4+_0x25ea('0x2a')][_0x47a447[_0x25ea('0x2c')]['id']];}};exports[_0x25ea('0x2e')]=writeLog;
\ No newline at end of file
+var _0xaa56=['user:%s','emit','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','message','removeWaitingNotification','writeLog','util','../utils','../../../../../config/environment','../../../../../config/logger','redis','localhost','socket.io-emitter','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','format'];(function(_0x5b1b07,_0x119df6){var _0x59fbbc=function(_0xc8f58a){while(--_0xc8f58a){_0x5b1b07['push'](_0x5b1b07['shift']());}};_0x59fbbc(++_0x119df6);}(_0xaa56,0x1ac));var _0x6aa5=function(_0xf1b27a,_0x157ebb){_0xf1b27a=_0xf1b27a-0x0;var _0x481fcd=_0xaa56[_0xf1b27a];return _0x481fcd;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var utils=require(_0x6aa5('0x1'));var Redis=require('ioredis');var config=require(_0x6aa5('0x2'));var logger=require(_0x6aa5('0x3'))('routing');config[_0x6aa5('0x4')]=_['defaults'](config['redis'],{'host':_0x6aa5('0x5'),'port':0x18eb});var io=require(_0x6aa5('0x6'))(new Redis(config[_0x6aa5('0x4')]));function sendNotification(_0x13a9ef,_0x52b40a,_0x4fe8f0,_0x4b8f9c,_0xc9b90d,_0xc8f2b0){var _0x4e1cf5=_0xc8f2b0||{};var _0x33e5ea=_0x4fe8f0[_0x6aa5('0x7')]('.');var _0x268e07={'uniqueid':_0x52b40a,'channel':_0x33e5ea[0x0],'id':_0x33e5ea[0x1],'title':_0x33e5ea[0x0]+_0x6aa5('0x8'),'interactionId':_0x33e5ea[0x2],'queue':_0xc9b90d?_0xc9b90d[_0x6aa5('0x9')]:null,'sound':_0x4e1cf5[_0x6aa5('0xa')][_0x6aa5('0xb')],'shake':_0x4e1cf5[_0x6aa5('0xa')][_0x6aa5('0xc')]};try{if(!_0x4e1cf5[_0x6aa5('0xd')]){_0x4e1cf5[_0x6aa5('0xd')]={};}if(_0xc9b90d){_0x4e1cf5['body'][_0x6aa5('0xe')]=_0xc9b90d;}else if(_0x4e1cf5[_0x6aa5('0xd')][_0x6aa5('0xe')]){delete _0x4e1cf5['body'][_0x6aa5('0xe')];}_0x268e07[_0x6aa5('0xf')]=utils[_0x6aa5('0x10')](_0x4e1cf5[_0x6aa5('0xa')][_0x6aa5('0x11')],_0x4e1cf5);}catch(_0x39c88d){_0x268e07[_0x6aa5('0xf')]=_0x6aa5('0x12');logger[_0x6aa5('0x13')](util['format'](_0x6aa5('0x14'),_0x52b40a,_0x39c88d['message']));}io['to'](util[_0x6aa5('0x15')](_0x6aa5('0x16'),_0x4b8f9c['name']))[_0x6aa5('0x17')](util[_0x6aa5('0x15')]('notification:%s',_0x13a9ef?_0x6aa5('0x18'):_0x6aa5('0x19')),_0x268e07);}function writeLog(_0x169878,_0xa1a18,_0x2fded3){return logger['debug'](util[_0x6aa5('0x15')](_0x6aa5('0x1a'),_0x169878,_0xa1a18[_0x6aa5('0x9')],_0x2fded3));}exports[_0x6aa5('0x1b')]=function(_0xd80c38,_0x1c1a91,_0x4beae3,_0x513d52){if(_0x1c1a91['busy']){writeLog(_0xd80c38,_0x1c1a91,_0x6aa5('0x1c'));return![];}if(!_0x1c1a91['online']){writeLog(_0xd80c38,_0x1c1a91,_0x6aa5('0x1d'));return![];}if(_0x1c1a91[_0x4beae3+_0x6aa5('0x1e')]){writeLog(_0xd80c38,_0x1c1a91,'PAUSE');return![];}if(_0x513d52&&_0x1c1a91[_0x6aa5('0x1f')](_0x4beae3+_0x6aa5('0x20'))&&_0x1c1a91[_0x6aa5('0x1f')](_0x4beae3+_0x6aa5('0x21'))){if(_0x1c1a91[_0x4beae3+'Capacity']>0x0&&_0x1c1a91[_0x4beae3+_0x6aa5('0x21')]>=_0x1c1a91[_0x4beae3+_0x6aa5('0x20')]){writeLog(_0xd80c38,_0x1c1a91,_0x4beae3[_0x6aa5('0x22')]()+_0x6aa5('0x23'));return![];}}return!![];};exports[_0x6aa5('0x24')]=function(_0x453454,_0x4276ba,_0x132f13,_0x4ab206,_0x4bc733){return sendNotification(!![],_0x453454,_0x4276ba,_0x132f13,_0x4ab206,_0x4bc733);};exports[_0x6aa5('0x25')]=function(_0x1bc0b1,_0x510241,_0x563805,_0x44cef2,_0x586e62){return sendNotification(![],_0x1bc0b1,_0x510241,_0x563805,_0x44cef2,_0x586e62);};exports[_0x6aa5('0x26')]=function(_0x34dda5,_0x75a2a7,_0x482e8f){var _0xc2d1c7=_0x75a2a7[_0x6aa5('0x27')]['UserId'];if(!_0xc2d1c7&&_0x482e8f){_0xc2d1c7=_0x482e8f['id'];}var _0x2ca2a3=_[_0x6aa5('0x28')](_0x34dda5[_0x75a2a7[_0x6aa5('0x29')]+_0x6aa5('0x2a')],function(_0x351924){var _0x406add=_[_0x6aa5('0x2b')](_0x75a2a7[_0x6aa5('0x29')])+_0x6aa5('0x2c');return _0x351924[_0x406add]===_0x75a2a7[_0x6aa5('0x27')]['id'];});if(!_0x2ca2a3&&_0xc2d1c7&&_0x34dda5[_0x6aa5('0x2d')][_0xc2d1c7]){_0x2ca2a3=_[_0x6aa5('0x28')](_0x34dda5[_0x6aa5('0x2d')][_0xc2d1c7][_0x75a2a7[_0x6aa5('0x29')]+_0x6aa5('0x2e')],function(_0x263e1e){return _0x263e1e['id']===_0x75a2a7[_0x6aa5('0x27')]['id'];});}return _0x2ca2a3;};exports['saveWaitingNotification']=function(_0x41246a,_0x542662,_0x318c33,_0x65853f){if(_0x318c33&&_0x318c33['id']&&_0x41246a['agents']&&_0x41246a[_0x6aa5('0x2d')][_0x318c33['id']]){_0x41246a[_0x6aa5('0x2d')][_0x318c33['id']][_0x65853f+_0x6aa5('0x2e')][_0x542662[_0x6aa5('0x2f')]['id']]={'id':_0x542662[_0x6aa5('0x27')]['id']};}};exports[_0x6aa5('0x30')]=function(_0x58e12c,_0x5309e1,_0x234d81,_0x4164c7){if(_0x234d81&&_0x234d81['id']&&_0x58e12c['agents']&&_0x58e12c[_0x6aa5('0x2d')][_0x234d81['id']]){delete _0x58e12c[_0x6aa5('0x2d')][_0x234d81['id']][_0x4164c7+_0x6aa5('0x2e')][_0x5309e1[_0x6aa5('0x2f')]['id']];}};exports[_0x6aa5('0x31')]=writeLog;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc47c=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0xc053e6,_0x2f6c77){var _0x7118cb=function(_0xe30ce5){while(--_0xe30ce5){_0xc053e6['push'](_0xc053e6['shift']());}};_0x7118cb(++_0x2f6c77);}(_0xc47c,0xe0));var _0xcc47=function(_0x1f10f8,_0x3df17e){_0x1f10f8=_0x1f10f8-0x0;var _0xdc191f=_0xc47c[_0x1f10f8];return _0xdc191f;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require(_0xcc47('0x0'))('routing');var system=schema({'command':{'type':_0xcc47('0x1'),'required':!![],'message':_0xcc47('0x2')}});exports[_0xcc47('0x3')]=function(_0x35d7bc,_0x3eeefa){return function(_0xd75e5e){try{var _0x462acf={'command':_0x3eeefa[0x0]};var _0x5e52b0=system[_0xcc47('0x4')](_0x462acf,{'typecast':!![]});if(_0x5e52b0[_0xcc47('0x5')]){logger['error'](_0xcc47('0x6'),_0x35d7bc,_[_0xcc47('0x7')](_0x5e52b0,_0xcc47('0x8'))[_0xcc47('0x9')](',\x20'));logger[_0xcc47('0xa')](_0xcc47('0xb'),_0x35d7bc);_0xd75e5e['next']();}else{var _0x1b7c43=this;var _0x36ebc2=utils[_0xcc47('0xc')](_0x3eeefa[0x0],this);logger[_0xcc47('0xa')](_0xcc47('0xd'),_0x35d7bc,_0x36ebc2);sh[_0xcc47('0xe')](_[_0xcc47('0xf')](_0x36ebc2),function(_0x59d86b,_0x52cfd2){logger[_0xcc47('0xa')](_0xcc47('0x10'),_0x35d7bc,_0x59d86b);if(_0x59d86b==0x0){var _0x59e49e=_0x52cfd2[_0xcc47('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xcc47('0x12')](_0x3eeefa[0x1])||_[_0xcc47('0x13')](_0x3eeefa[0x1])){logger[_0xcc47('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x35d7bc);_0x1b7c43[_0xcc47('0x14')][_0x3eeefa[0x1]]=_0x59e49e;}else{logger['info'](_0xcc47('0x15'),_0x35d7bc,_0x3eeefa[0x1],_0x59e49e);_0x1b7c43[_0xcc47('0x14')][_0x3eeefa[0x1]]=_0x59e49e;}}_0xd75e5e[_0xcc47('0x16')]();});}}catch(_0x43c3dc){logger[_0xcc47('0x17')]('[%s][SYSTEM]\x20%s',_0x35d7bc,_[_0xcc47('0x18')](_0x43c3dc)?JSON[_0xcc47('0x19')](_0x43c3dc):_0x43c3dc);logger[_0xcc47('0xa')](_0xcc47('0xb'),_0x35d7bc);_0xd75e5e['next']();}};};
\ No newline at end of file
+var _0x4db1=['next','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x1a9712,_0x95df03){var _0x2a8ce5=function(_0x46fd41){while(--_0x46fd41){_0x1a9712['push'](_0x1a9712['shift']());}};_0x2a8ce5(++_0x95df03);}(_0x4db1,0x19a));var _0x14db=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x4db1[_0x3c4062];return _0x3f5bf3;};'use strict';var schema=require(_0x14db('0x0'));var sh=require(_0x14db('0x1'));var _=require(_0x14db('0x2'));var utils=require('./utils');var logger=require(_0x14db('0x3'))(_0x14db('0x4'));var system=schema({'command':{'type':_0x14db('0x5'),'required':!![],'message':_0x14db('0x6')}});exports[_0x14db('0x7')]=function(_0x8b3369,_0x312a05){return function(_0x237074){try{var _0x5f2087={'command':_0x312a05[0x0]};var _0x473cef=system[_0x14db('0x0')](_0x5f2087,{'typecast':!![]});if(_0x473cef[_0x14db('0x8')]){logger[_0x14db('0x9')](_0x14db('0xa'),_0x8b3369,_[_0x14db('0xb')](_0x473cef,'message')[_0x14db('0xc')](',\x20'));logger[_0x14db('0xd')](_0x14db('0xe'),_0x8b3369);_0x237074['next']();}else{var _0x23b5e1=this;var _0x2d16d3=utils['getMustacheRender'](_0x312a05[0x0],this);logger[_0x14db('0xd')](_0x14db('0xf'),_0x8b3369,_0x2d16d3);sh[_0x14db('0x10')](_['trim'](_0x2d16d3),function(_0x2b3b60,_0x1b3efd){logger[_0x14db('0xd')](_0x14db('0x11'),_0x8b3369,_0x2b3b60);if(_0x2b3b60==0x0){var _0x2238d9=_0x1b3efd['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x312a05[0x1])||_[_0x14db('0x12')](_0x312a05[0x1])){logger[_0x14db('0xd')](_0x14db('0x13'),_0x8b3369);_0x23b5e1[_0x14db('0x14')][_0x312a05[0x1]]=_0x2238d9;}else{logger[_0x14db('0xd')](_0x14db('0x15'),_0x8b3369,_0x312a05[0x1],_0x2238d9);_0x23b5e1[_0x14db('0x14')][_0x312a05[0x1]]=_0x2238d9;}}_0x237074[_0x14db('0x16')]();});}}catch(_0x10b288){logger[_0x14db('0x9')](_0x14db('0xa'),_0x8b3369,_['isObject'](_0x10b288)?JSON[_0x14db('0x17')](_0x10b288):_0x10b288);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x8b3369);_0x237074[_0x14db('0x16')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x384f=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','info','next','Interaction','channel','addTags','interaction','then','error','stringify','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x384f,0x95));var _0xf384=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x384f[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xf384('0x0'));var _=require(_0xf384('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf384('0x2')),'smsInteraction':require(_0xf384('0x3')),'mailInteraction':require(_0xf384('0x4')),'faxInteraction':require(_0xf384('0x5')),'whatsappInteraction':require(_0xf384('0x6'))};var logger=require('../../../../config/logger')(_0xf384('0x7'));var tag=schema({'tag':{'type':_0xf384('0x8'),'required':!![],'message':_0xf384('0x9')}});exports[_0xf384('0xa')]=function(_0xb09c4c,_0x1712a7,_0x1a0e71,_0x42d0b1){return function(_0x3e8d7b){try{var _0xb3129={'tag':_0x1712a7[0x0]};var _0x493e59=tag[_0xf384('0x0')](_0xb3129,{'typecast':!![]});if(_0x493e59[_0xf384('0xb')]){logger['error'](_0xf384('0xc'),_0xb09c4c,_[_0xf384('0xd')](_0x493e59,_0xf384('0xe'))['join'](',\x20'));logger[_0xf384('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xb09c4c);_0x3e8d7b[_0xf384('0x10')]();}else{var _0x3f4494={'ids':[_0x1712a7[0x0]]};if(rpc[_0x42d0b1['channel']+_0xf384('0x11')]){rpc[_0x42d0b1[_0xf384('0x12')]+_0xf384('0x11')][_0xf384('0x13')](_0x42d0b1[_0xf384('0x14')]['id'],_0x3f4494)[_0xf384('0x15')](function(_0x198d79){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0xb09c4c,_0x1712a7[0x1],_0x42d0b1[_0xf384('0x12')],_0x42d0b1[_0xf384('0x14')]['id']);})['catch'](function(_0x2214ae){logger[_0xf384('0x16')](_0xf384('0xc'),_0xb09c4c,JSON[_0xf384('0x17')](_0x2214ae));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xb09c4c);})['finally'](function(){_0x3e8d7b['next']();});}}}catch(_0x35736a){logger[_0xf384('0x16')](_0xf384('0xc'),_0xb09c4c,_[_0xf384('0x18')](_0x35736a)?JSON[_0xf384('0x17')](_0x35736a):_0x35736a);logger[_0xf384('0xf')](_0xf384('0x19'),_0xb09c4c);_0x3e8d7b[_0xf384('0x10')]();}};};
\ No newline at end of file
+var _0x69f8=['consequence','length','error','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','info','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number'];(function(_0x4c3a6b,_0x23ec27){var _0x34eacb=function(_0x2d8890){while(--_0x2d8890){_0x4c3a6b['push'](_0x4c3a6b['shift']());}};_0x34eacb(++_0x23ec27);}(_0x69f8,0x86));var _0x869f=function(_0x4d00d1,_0x3be249){_0x4d00d1=_0x4d00d1-0x0;var _0x57fa53=_0x69f8[_0x4d00d1];return _0x57fa53;};'use strict';var schema=require(_0x869f('0x0'));var _=require(_0x869f('0x1'));var rpc={'chatInteraction':require(_0x869f('0x2')),'openchannelInteraction':require(_0x869f('0x3')),'smsInteraction':require(_0x869f('0x4')),'mailInteraction':require(_0x869f('0x5')),'faxInteraction':require(_0x869f('0x6')),'whatsappInteraction':require(_0x869f('0x7'))};var logger=require(_0x869f('0x8'))('routing');var tag=schema({'tag':{'type':_0x869f('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x869f('0xa')]=function(_0x4413c0,_0x1c6a20,_0xd44bd9,_0xb40d01){return function(_0x183c67){try{var _0x13df40={'tag':_0x1c6a20[0x0]};var _0x266423=tag[_0x869f('0x0')](_0x13df40,{'typecast':!![]});if(_0x266423[_0x869f('0xb')]){logger[_0x869f('0xc')](_0x869f('0xd'),_0x4413c0,_[_0x869f('0xe')](_0x266423,_0x869f('0xf'))['join'](',\x20'));logger['info'](_0x869f('0x10'),_0x4413c0);_0x183c67[_0x869f('0x11')]();}else{var _0x277d75={'ids':[_0x1c6a20[0x0]]};if(rpc[_0xb40d01['channel']+_0x869f('0x12')]){rpc[_0xb40d01[_0x869f('0x13')]+_0x869f('0x12')]['addTags'](_0xb40d01[_0x869f('0x14')]['id'],_0x277d75)['then'](function(_0x3bfc25){logger['info'](_0x869f('0x15'),_0x4413c0,_0x1c6a20[0x1],_0xb40d01[_0x869f('0x13')],_0xb40d01[_0x869f('0x14')]['id']);})['catch'](function(_0x51681e){logger[_0x869f('0xc')](_0x869f('0xd'),_0x4413c0,JSON['stringify'](_0x51681e));logger[_0x869f('0x16')](_0x869f('0x10'),_0x4413c0);})[_0x869f('0x17')](function(){_0x183c67['next']();});}}}catch(_0x4570d9){logger[_0x869f('0xc')](_0x869f('0xd'),_0x4413c0,_['isObject'](_0x4570d9)?JSON['stringify'](_0x4570d9):_0x4570d9);logger[_0x869f('0x16')](_0x869f('0x10'),_0x4413c0);_0x183c67[_0x869f('0x11')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f12=['../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','?params=','title','jsonrpc','2.0','method','login','params','stringify','POST','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','then','info','error','[%s][TVOX]\x20%s','isObject','next','request-promise'];(function(_0x5aed32,_0x2a5832){var _0x4d897f=function(_0x4486cc){while(--_0x4486cc){_0x5aed32['push'](_0x5aed32['shift']());}};_0x4d897f(++_0x2a5832);}(_0x1f12,0x195));var _0x21f1=function(_0x5af4f4,_0x217cb3){_0x5af4f4=_0x5af4f4-0x0;var _0x54dab4=_0x1f12[_0x5af4f4];return _0x54dab4;};'use strict';var rp=require(_0x21f1('0x0'));var logger=require(_0x21f1('0x1'))(_0x21f1('0x2'));var _=require('lodash');var arr=[];exports[_0x21f1('0x3')]=function(_0x20aedd,_0x36778f){return function(_0x47811c){var _0x4bb25b=_0x36778f[0xa];var _0xd43ebf=_0x36778f[0xb];var _0x186d4e=_0x36778f[0xc];var _0x564ffb=_0x36778f[0xd];var _0x5c9857=_0x36778f[0xe];var _0x3bcc22=_0x36778f[0xf]['replace'](/\n/g,_0x21f1('0x4'));var _0x18e1b6=_0x36778f[0x10][_0x21f1('0x5')](/\n/g,'\x20');if(!arr[_0x21f1('0x6')](_0xd43ebf)){arr[_0x21f1('0x7')](_0xd43ebf);var _0x46c5fd=_0x36778f[0x3];var _0x59f659=_0x36778f[0x4];var _0x5873bf=_0x36778f[0x1];var _0x5e02c5=_0x36778f[0x0];var _0x3c0575={};_0x3c0575['urlOnAnswer']=_0x36778f[0x8]+_0x21f1('0x8')+_0x186d4e+'|'+_0x4bb25b+'|'+_0x564ffb+'|'+_0xd43ebf+'|'+_0x5c9857;_0x3c0575['urlOnRing']=_0x36778f[0x7]+_0x21f1('0x8')+_0x186d4e+'|'+_0x4bb25b+'|'+_0x564ffb+'|'+_0xd43ebf+'|'+_0x5c9857+'|'+_0x3bcc22+'|'+_0x18e1b6;_0x3c0575[_0x21f1('0x9')]=_0x36778f[0x9];var _0x53c3bd={};_0x53c3bd[_0x21f1('0xa')]=_0x21f1('0xb');_0x53c3bd[_0x21f1('0xc')]=_0x21f1('0xd');var _0xbe47ae=[];_0xbe47ae[_0x21f1('0x7')](_0x36778f[0x2]);_0xbe47ae[_0x21f1('0x7')](_0x36778f[0x5]);_0xbe47ae[_0x21f1('0x7')](_0x36778f[0x6]);_0x53c3bd[_0x21f1('0xe')]=_0xbe47ae;_0x53c3bd['id']=0x1;var _0x2805e9=JSON[_0x21f1('0xf')](_0x53c3bd);var _0x30e80f={'encoding':'utf8','method':_0x21f1('0x10'),'timeout':0x2710,'url':_0x46c5fd,'headers':{'Content-Type':_0x21f1('0x11')},'body':_0x2805e9};return rp(_0x30e80f)['then'](function(_0x4619cd){const _0x17f4a2=JSON[_0x21f1('0x12')](_0x4619cd);if(!_0x17f4a2['result'][_0x21f1('0x13')]){throw new Error(_0x21f1('0x14'));}var _0x588a60=_0xd43ebf;var _0x2e0541='channelId='+_0x5873bf+'&serviceId='+_0x5e02c5+_0x21f1('0x15')+_0x588a60+_0x21f1('0x16')+JSON[_0x21f1('0xf')](_0x3c0575);var _0x52a1b7=_0x59f659+'?'+_0x2e0541;return rp(_0x52a1b7);})[_0x21f1('0x17')](function(_0x5d8b91){logger[_0x21f1('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x20aedd,_0x5d8b91);_0x47811c['stop']();})['catch'](function(_0x4e47c9){logger[_0x21f1('0x19')](_0x21f1('0x1a'),_0x20aedd,_[_0x21f1('0x1b')](_0x4e47c9)?JSON['stringify'](_0x4e47c9):_0x4e47c9);_0x47811c['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x20aedd);_0x47811c[_0x21f1('0x1c')]();}};};
\ No newline at end of file
+var _0xdb25=['catch','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop'];(function(_0x4c68e3,_0x75e320){var _0x13af7b=function(_0x513145){while(--_0x513145){_0x4c68e3['push'](_0x4c68e3['shift']());}};_0x13af7b(++_0x75e320);}(_0xdb25,0x8b));var _0x5db2=function(_0x13c77d,_0x39102d){_0x13c77d=_0x13c77d-0x0;var _0xe6345a=_0xdb25[_0x13c77d];return _0xe6345a;};'use strict';var rp=require('request-promise');var logger=require(_0x5db2('0x0'))(_0x5db2('0x1'));var _=require(_0x5db2('0x2'));var arr=[];exports[_0x5db2('0x3')]=function(_0x5048d9,_0x8d2c93){return function(_0x41a3b3){var _0xd94fbb=_0x8d2c93[0xa];var _0x3cb128=_0x8d2c93[0xb];var _0x3044a5=_0x8d2c93[0xc];var _0x429677=_0x8d2c93[0xd];var _0x3a924f=_0x8d2c93[0xe];var _0x2d72ac=_0x8d2c93[0xf][_0x5db2('0x4')](/\n/g,_0x5db2('0x5'));var _0x20ddb2=_0x8d2c93[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x3cb128)){arr['push'](_0x3cb128);var _0x11f919=_0x8d2c93[0x3];var _0x18144a=_0x8d2c93[0x4];var _0xb25ea8=_0x8d2c93[0x1];var _0x5bf7b2=_0x8d2c93[0x0];var _0x510abb={};_0x510abb[_0x5db2('0x6')]=_0x8d2c93[0x8]+_0x5db2('0x7')+_0x3044a5+'|'+_0xd94fbb+'|'+_0x429677+'|'+_0x3cb128+'|'+_0x3a924f;_0x510abb[_0x5db2('0x8')]=_0x8d2c93[0x7]+'?params='+_0x3044a5+'|'+_0xd94fbb+'|'+_0x429677+'|'+_0x3cb128+'|'+_0x3a924f+'|'+_0x2d72ac+'|'+_0x20ddb2;_0x510abb[_0x5db2('0x9')]=_0x8d2c93[0x9];var _0x72eab6={};_0x72eab6[_0x5db2('0xa')]=_0x5db2('0xb');_0x72eab6[_0x5db2('0xc')]=_0x5db2('0xd');var _0x10fc5e=[];_0x10fc5e[_0x5db2('0xe')](_0x8d2c93[0x2]);_0x10fc5e['push'](_0x8d2c93[0x5]);_0x10fc5e['push'](_0x8d2c93[0x6]);_0x72eab6[_0x5db2('0xf')]=_0x10fc5e;_0x72eab6['id']=0x1;var _0xd08df1=JSON[_0x5db2('0x10')](_0x72eab6);var _0x21ed35={'encoding':_0x5db2('0x11'),'method':_0x5db2('0x12'),'timeout':0x2710,'url':_0x11f919,'headers':{'Content-Type':_0x5db2('0x13')},'body':_0xd08df1};return rp(_0x21ed35)[_0x5db2('0x14')](function(_0x2e3381){const _0x4acd0c=JSON[_0x5db2('0x15')](_0x2e3381);if(!_0x4acd0c[_0x5db2('0x16')][_0x5db2('0x17')]){throw new Error(_0x5db2('0x18'));}var _0x298f91=_0x3cb128;var _0x1a51e2=_0x5db2('0x19')+_0xb25ea8+'&serviceId='+_0x5bf7b2+_0x5db2('0x1a')+_0x298f91+_0x5db2('0x1b')+JSON[_0x5db2('0x10')](_0x510abb);var _0x511d10=_0x18144a+'?'+_0x1a51e2;return rp(_0x511d10);})[_0x5db2('0x14')](function(_0x1f8571){logger[_0x5db2('0x1c')](_0x5db2('0x1d'),_0x5048d9,_0x1f8571);_0x41a3b3[_0x5db2('0x1e')]();})[_0x5db2('0x1f')](function(_0x287dfc){logger['error']('[%s][TVOX]\x20%s',_0x5048d9,_['isObject'](_0x287dfc)?JSON[_0x5db2('0x10')](_0x287dfc):_0x287dfc);_0x41a3b3[_0x5db2('0x1e')]();});}else{logger[_0x5db2('0x1c')](_0x5db2('0x20'),_0x5048d9);_0x41a3b3[_0x5db2('0x21')]();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x91bac8,_0x361ef4){var _0x119a9c=function(_0x1cf8fa){while(--_0x1cf8fa){_0x91bac8['push'](_0x91bac8['shift']());}};_0x119a9c(++_0x361ef4);}(_0xe706,0xa3));var _0x6e70=function(_0x25979f,_0x32a3eb){_0x25979f=_0x25979f-0x0;var _0x4de4e7=_0xe706[_0x25979f];return _0x4de4e7;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x4d78ad,_0x3d1dc1){var _0x227dd9=function(_0x25e089){while(--_0x25e089){_0x4d78ad['push'](_0x4d78ad['shift']());}};_0x227dd9(++_0x3d1dc1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x287e=['mail','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','error','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','channel','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','split'];(function(_0x4cf384,_0x5d12cb){var _0x1658c6=function(_0x279a9d){while(--_0x279a9d){_0x4cf384['push'](_0x4cf384['shift']());}};_0x1658c6(++_0x5d12cb);}(_0x287e,0x1e3));var _0xe287=function(_0x417c4c,_0x40d1f6){_0x417c4c=_0x417c4c-0x0;var _0xba104b=_0x287e[_0x417c4c];return _0xba104b;};'use strict';var _=require(_0xe287('0x0'));var util=require(_0xe287('0x1'));var path=require(_0xe287('0x2'));var fs=require('fs');var jayson=require(_0xe287('0x3'));var BPromise=require(_0xe287('0x4'));var utils=require(_0xe287('0x5'));var sUtils=require(_0xe287('0x6'));var logger=require(_0xe287('0x7'))(_0xe287('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xe287('0x9')),'chatQueueReport':require(_0xe287('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xe287('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4f3cf1,_0x4cd1f4,_0x2082c6){return util[_0xe287('0xc')](_0xe287('0xd'),_0x4f3cf1,_0x4cd1f4||0x0,_0x2082c6||0x0);}function getIntervals(_0x3b1a68,_0x1e781d){var _0x3e82a2=[];if(!_[_0xe287('0xe')](_0x1e781d[_0xe287('0xf')])&&!_[_0xe287('0xe')](_0x3b1a68[_0x1e781d[_0xe287('0xf')]])&&!_[_0xe287('0xe')](_0x3b1a68[_0x1e781d[_0xe287('0xf')]]['Intervals'])){_0x3e82a2=_[_0xe287('0x10')](_0x3b1a68[_0x1e781d['IntervalId']][_0xe287('0x11')],'interval');}else if(!_[_0xe287('0xe')](_0x1e781d['interval'])){_0x3e82a2=[_0x1e781d[_0xe287('0x12')]];}return _0x3e82a2;}exports[_0xe287('0x13')]=function(_0x2d2b48){_0x2d2b48[_0xe287('0x14')]={};return new BPromise(function(_0x279281,_0x497f73){var _0x298641={'Start':function(_0x5447b5){var _0x352922=this;return new Promise(function(_0x376a59,_0x5c1dea){if(_0x5447b5){try{var _0x336ff3=[];var _0x5053e0=getId(_0x5447b5['channel'],_0x5447b5[_0xe287('0x15')]?_0x5447b5[_0xe287('0x15')]['id']:0x0,_0x5447b5[_0xe287('0x16')]?_0x5447b5['interaction']['id']:0x0);var _0x2c4ef3=sUtils['checkWaitingNotifications'](_0x2d2b48,_0x5447b5);if(_0x5447b5['transfer']||!_0x2c4ef3&&_0x5447b5[_0xe287('0x17')]&&_[_0xe287('0x18')](_0x5447b5['applications'])&&_0x5447b5[_0xe287('0x17')]['length']){for(var _0x241873=0x0;_0x241873<_0x5447b5[_0xe287('0x17')][_0xe287('0x19')];_0x241873+=0x1){var _0x4e264f=_0x5447b5[_0xe287('0x17')][_0x241873];if(fs[_0xe287('0x1a')](path[_0xe287('0x1b')](__dirname,_0xe287('0x17'),_0x4e264f[_0xe287('0x1c')]+_0xe287('0x1d')))){var _0x3e971a=[];switch(_0x4e264f[_0xe287('0x1c')]['toLowerCase']()){case _0xe287('0x1e'):var _0x1e68af=_0x4e264f['appdata'][_0xe287('0x1f')](',');if(_0x5447b5['channel']===_0xe287('0x20')){_0x3e971a[_0xe287('0x21')](_0x1e68af[0x0]);_0x3e971a[_0xe287('0x21')](_0x1e68af[0x1]);_0x3e971a['push'](_0x1e68af['slice'](0x2,_0x1e68af[_0xe287('0x19')])[_0xe287('0x1b')](','));}else{_0x3e971a[_0xe287('0x21')](_0x1e68af[0x0]);_0x3e971a[_0xe287('0x21')](_0x1e68af[_0xe287('0x22')](0x1,_0x1e68af[_0xe287('0x19')])[_0xe287('0x1b')](','));}break;case _0xe287('0x23'):var _0x55c97a=_0x4e264f[_0xe287('0x24')]['split'](',');_0x3e971a[_0xe287('0x21')](_0x55c97a[0x0]);_0x3e971a[_0xe287('0x21')](_0x55c97a[0x1]);_0x3e971a['push'](_0x55c97a[_0xe287('0x22')](0x2,_0x55c97a[_0xe287('0x19')])[_0xe287('0x1b')](','));break;case _0xe287('0x25'):var _0x58ddec=_0x4e264f[_0xe287('0x24')][_0xe287('0x1f')](',');_0x3e971a[_0xe287('0x21')](_0x58ddec[0x0]);_0x3e971a['push'](_0x58ddec[0x1]);_0x3e971a[_0xe287('0x21')](_0x58ddec[0x2]);_0x3e971a[_0xe287('0x21')](_0x58ddec[0x3]);_0x3e971a[_0xe287('0x21')](_0x58ddec['slice'](0x4,_0x58ddec[_0xe287('0x19')])[_0xe287('0x1b')](','));break;case _0xe287('0x26'):var _0x253174=_0x4e264f[_0xe287('0x24')][_0xe287('0x1f')](',');_0x3e971a['push'](_0x253174[0x0]);_0x3e971a[_0xe287('0x21')](_0x253174[0x1]);_0x3e971a['push'](_0x253174[0x2]);_0x3e971a[_0xe287('0x21')](_0x253174[0x3]);_0x3e971a['push'](_0x253174[_0xe287('0x22')](0x4,_0x253174[_0xe287('0x19')])[_0xe287('0x1b')](','));break;case _0xe287('0x15'):_0x3e971a['push'](_0x4e264f['appdata']);break;case _0xe287('0x27'):_0x3e971a[_0xe287('0x21')](_0x4e264f['TagId']);_0x3e971a['push'](_0x4e264f['appdata']);break;case'tvox':var _0x556051=utils[_0xe287('0x28')](_0x5447b5[_0xe287('0x29')][_0xe287('0x2a')],_0x5447b5);var _0x1e0e62=_0x4e264f[_0xe287('0x24')][_0xe287('0x1f')](',');_0x3e971a['push'](_0x1e0e62[0x0]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x1]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x2]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x3]);_0x3e971a['push'](_0x1e0e62[0x4]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x5]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x6]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x7]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0x8]);_0x3e971a['push'](_0x1e0e62[0x9]);_0x3e971a[_0xe287('0x21')](_0x1e0e62[0xa]);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x16')]['id']);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x15')]['id']);_0x3e971a[_0xe287('0x21')](_0x4e264f[_0xe287('0x2b')]);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x16')][_0xe287('0x2c')]);_0x3e971a[_0xe287('0x21')](_0x5447b5[_0xe287('0x2d')][_0xe287('0x2d')]);_0x3e971a[_0xe287('0x21')](_0x556051);break;default:_0x3e971a=_[_0xe287('0xe')](_0x4e264f['appdata'])?[]:_0x4e264f[_0xe287('0x24')]['split'](',');}var _0x21d133={'id':util[_0xe287('0xc')](_0xe287('0x2e'),_0x5053e0,_0x4e264f['id'],_0x4e264f[_0xe287('0x1c')]),'condition':require(_0xe287('0x2f'))[_0xe287('0x30')](_0x5053e0,getIntervals(_0x2d2b48[_0xe287('0x31')],_0x4e264f),_0x2d2b48),'consequence':require(_0xe287('0x32')+_0x4e264f[_0xe287('0x1c')])['consequence'](_0x5053e0,_0x3e971a,_0x2d2b48,_0x5447b5),'p':_0x4e264f[_0xe287('0x33')]||0x0};logger[_0xe287('0x34')](_0xe287('0x35'),_0x21d133['id'],_0xe287('0x36'),getIntervals(_0x2d2b48['intervals'],_0x4e264f)[_0xe287('0x1b')]('\x20|\x20'));_0x336ff3[_0xe287('0x21')](_0x21d133);}else{logger[_0xe287('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xe287('0x1b')](__dirname,_0xe287('0x17'),_0x4e264f['app']+_0xe287('0x1d')));}}_0x2d2b48[_0xe287('0x14')][_0x5053e0]=new RuleEngine(_0x336ff3);_0x2d2b48[_0xe287('0x14')][_0x5053e0][_0xe287('0x38')](_0x5447b5,function(_0x2a3694){logger[_0xe287('0x34')](_0xe287('0x39'),JSON[_0xe287('0x3a')](_0x2a3694[_0xe287('0x3b')]));if(_0x2d2b48[_0xe287('0x14')][_0x5053e0]){_0x2d2b48[_0xe287('0x14')][_0x5053e0][_0xe287('0x3c')](_0xe287('0x3d'));}});return _0x376a59({'code':0xc8,'message':_0x5447b5});}else{if(_0x2c4ef3){logger['info'](util[_0xe287('0xc')](_0xe287('0x3e'),_0x5053e0));}else{logger[_0xe287('0x34')](_0xe287('0x3f'));}return _0x376a59({'code':0xc8,'message':_0x5447b5});}}catch(_0x5a843e){logger['error'](_0x5a843e[_0xe287('0x40')]);return _0x5c1dea(_0x352922[_0xe287('0x37')](0x1f4,_0x5a843e));}}return _0x5c1dea(_0xe287('0x41'));});},'AcceptMessage':function(_0x5561e5){var _0x595707=this;return new Promise(function(_0x562b66,_0x58c4dd){if(_0x5561e5[_0xe287('0x42')]&&_0x5561e5[_0xe287('0x42')]['id']){if(_0x2d2b48[_0xe287('0x43')][_0x5561e5[_0xe287('0x42')]['id']]){_0x2d2b48[_0xe287('0x43')][_0x5561e5['agent']['id']][_0xe287('0x44')]=![];_0x2d2b48[_0xe287('0x43')][_0x5561e5[_0xe287('0x42')]['id']][_0xe287('0x45')]=undefined;}}if(_0x5561e5[_0xe287('0x15')]&&_0x5561e5[_0xe287('0x15')]['id']){try{var _0x5e1181=getId(_0x5561e5['channel'],_0x5561e5['message']?_0x5561e5[_0xe287('0x15')]['id']:0x0,_0x5561e5[_0xe287('0x16')]?_0x5561e5[_0xe287('0x16')]['id']:0x0);if(_0x2d2b48['rules'][_0x5e1181]){_0x2d2b48[_0xe287('0x14')][_0x5e1181][_0xe287('0x3c')](_0xe287('0x46'));if(rpc[_0x5561e5[_0xe287('0x47')]+_0xe287('0x48')]){rpc[_0x5561e5[_0xe287('0x47')]+_0xe287('0x48')][_0xe287('0x49')](_0x5e1181,{'UserId':_0x5561e5['message'][_0xe287('0x4a')]})['catch'](function(){logger[_0xe287('0x37')](_0xe287('0x4b'));});}}return _0x562b66({'code':0xc8,'message':_0x5561e5});}catch(_0x2db119){logger[_0xe287('0x37')](_0x2db119[_0xe287('0x40')]);return _0x58c4dd(_0x595707[_0xe287('0x37')](0x1f4,_0x2db119));}}logger['error'](_0xe287('0x4c'));return _0x58c4dd(_0x595707[_0xe287('0x37')](0x1f4,_0xe287('0x4c')));});},'RejectMessage':function(_0x2aacf0){var _0x863b0c=this;return new Promise(function(_0x59f7e8,_0x263566){if(_0x2aacf0['agent']&&_0x2aacf0['agent']['id']){try{if(_0x2d2b48[_0xe287('0x43')][_0x2aacf0[_0xe287('0x42')]['id']]){_0x2d2b48[_0xe287('0x43')][_0x2aacf0[_0xe287('0x42')]['id']][_0xe287('0x44')]=![];_0x2d2b48['agents'][_0x2aacf0[_0xe287('0x42')]['id']][_0xe287('0x45')]=undefined;}return _0x59f7e8({'code':0xc8,'message':_0x2aacf0});}catch(_0x37b19){logger['error'](_0x37b19[_0xe287('0x40')]);return _0x263566(_0x863b0c['error'](0x1f4,_0x37b19));}}logger['error']('message\x20is\x20empty');return _0x263566(_0x863b0c['error'](0x1f4,_0xe287('0x4c')));});},'AbandonInteraction':function(_0x18bb86){var _0x3945de=this;return new Promise(function(_0xdd5d9a,_0x4889ed){if(_0x18bb86['channel']&&_0x18bb86[_0xe287('0x16')]&&_0x18bb86[_0xe287('0x16')]['id']){try{var _0x1e7cd1=getId(_0x18bb86[_0xe287('0x47')],_0x18bb86[_0xe287('0x15')]?_0x18bb86[_0xe287('0x15')]['id']:0x0,_0x18bb86[_0xe287('0x16')]?_0x18bb86[_0xe287('0x16')]['id']:0x0);if(_0x2d2b48[_0xe287('0x14')][_0x1e7cd1]){_0x2d2b48[_0xe287('0x14')][_0x1e7cd1]['emit'](_0xe287('0x46'));}return _0xdd5d9a({'code':0xc8,'message':_0x18bb86});}catch(_0x30a626){logger['error'](_0x30a626['stack']);return _0x4889ed(_0x3945de[_0xe287('0x37')](0x1f4,_0x30a626));}}logger[_0xe287('0x37')](_0xe287('0x4c'));return _0x4889ed(_0x3945de['error'](0x1f4,_0xe287('0x4c')));});},'AgentCapacity':function(_0x1a8dea){var _0x5c20cb=this;return new Promise(function(_0x17c34e,_0x164961){if(_0x2d2b48[_0xe287('0x43')][_0xe287('0x4d')](_0x1a8dea['id'])){for(var _0x5160ae in _0x1a8dea[_0xe287('0x4e')]){if(_0x1a8dea[_0xe287('0x4e')][_0xe287('0x4d')](_0x5160ae)){if(_0x2d2b48['agents'][_0x1a8dea['id']][_0xe287('0x4d')](_0x5160ae+_0xe287('0x4f'))){_0x2d2b48[_0xe287('0x43')][_0x1a8dea['id']][_0x5160ae+'CurrentCapacity']=parseInt(_0x1a8dea[_0xe287('0x4e')][_0x5160ae],0xa);}}}_0x2d2b48[_0xe287('0x43')][_0x1a8dea['id']]['updateRealtime']();return _0x17c34e({'code':0xc8,'message':_0x2d2b48[_0xe287('0x43')][_0x1a8dea['id']]});}else{return _0x164961(_0x5c20cb['error'](0x1f4,_0xe287('0x50')));}});},'Agents':function(_0x10f159){return new Promise(function(_0x1f4e4a){var _0x3db5b2=_[_0xe287('0x51')](_0x2d2b48[_0xe287('0x43')]);if(_0x10f159&&_0x10f159['id']){var _0x5eade8=_[_0xe287('0x52')](_0x3db5b2,function(_0x4c32ad){return _0x4c32ad['id']===_0x10f159['id'];});_0x1f4e4a(_0x5eade8);}else{_0x1f4e4a({'count':_0x3db5b2[_0xe287('0x19')],'rows':_0x3db5b2});}});},'ChatQueues':function(){return new Promise(function(_0x49e202){var _0x56a83b=[];for(var _0x43dec9 in _0x2d2b48['chatQueues']){if(_0x2d2b48[_0xe287('0x53')][_0xe287('0x4d')](_0x43dec9)){var _0x5d6f32=_0x2d2b48['chatQueues'][_0x43dec9];var _0x3eafd2={'id':_0x5d6f32['id'],'available':_0x5d6f32['available'],'loggedIn':_0x5d6f32[_0xe287('0x54')],'name':_0x5d6f32[_0xe287('0x55')],'paused':_0x5d6f32[_0xe287('0x56')],'waiting':_0x5d6f32[_0xe287('0x57')]};_0x56a83b[_0xe287('0x21')](_0x3eafd2);}}_0x49e202({'count':_0x56a83b[_0xe287('0x19')],'rows':_0x56a83b});});},'MailQueues':function(){return new Promise(function(_0x65115d){var _0x492c67=[];for(var _0x3886be in _0x2d2b48['mailQueues']){if(_0x2d2b48[_0xe287('0x58')][_0xe287('0x4d')](_0x3886be)){var _0x28947e=_0x2d2b48[_0xe287('0x58')][_0x3886be];var _0x1b8cdb={'id':_0x28947e['id'],'available':_0x28947e[_0xe287('0x59')],'loggedIn':_0x28947e[_0xe287('0x54')],'name':_0x28947e[_0xe287('0x55')],'paused':_0x28947e[_0xe287('0x56')],'waiting':_0x28947e[_0xe287('0x57')]};_0x492c67[_0xe287('0x21')](_0x1b8cdb);}}_0x65115d({'count':_0x492c67['length'],'rows':_0x492c67});});},'OpenchannelQueues':function(){return new Promise(function(_0x12a533){var _0x26e183=[];for(var _0x41af2a in _0x2d2b48['openchannelQueues']){if(_0x2d2b48[_0xe287('0x5a')][_0xe287('0x4d')](_0x41af2a)){var _0xba71=_0x2d2b48[_0xe287('0x5a')][_0x41af2a];var _0x57ab42={'id':_0xba71['id'],'available':_0xba71[_0xe287('0x59')],'loggedIn':_0xba71[_0xe287('0x54')],'name':_0xba71[_0xe287('0x55')],'paused':_0xba71[_0xe287('0x56')],'waiting':_0xba71[_0xe287('0x57')]};_0x26e183[_0xe287('0x21')](_0x57ab42);}}_0x12a533({'count':_0x26e183['length'],'rows':_0x26e183});});},'SmsQueues':function(){return new Promise(function(_0x3113c8){var _0x1b3395=[];for(var _0x369713 in _0x2d2b48['smsQueues']){if(_0x2d2b48[_0xe287('0x5b')][_0xe287('0x4d')](_0x369713)){var _0x35a40d=_0x2d2b48[_0xe287('0x5b')][_0x369713];var _0x380af1={'id':_0x35a40d['id'],'available':_0x35a40d['available'],'loggedIn':_0x35a40d['loggedIn'],'name':_0x35a40d[_0xe287('0x55')],'paused':_0x35a40d[_0xe287('0x56')],'waiting':_0x35a40d[_0xe287('0x57')]};_0x1b3395[_0xe287('0x21')](_0x380af1);}}_0x3113c8({'count':_0x1b3395[_0xe287('0x19')],'rows':_0x1b3395});});},'FaxQueues':function(){return new Promise(function(_0x53eb2c){var _0xf7c1a=[];for(var _0x41bca5 in _0x2d2b48[_0xe287('0x5c')]){if(_0x2d2b48[_0xe287('0x5c')][_0xe287('0x4d')](_0x41bca5)){var _0x230526=_0x2d2b48['faxQueues'][_0x41bca5];var _0x10f5fa={'id':_0x230526['id'],'available':_0x230526['available'],'loggedIn':_0x230526['loggedIn'],'name':_0x230526[_0xe287('0x55')],'paused':_0x230526['paused'],'waiting':_0x230526[_0xe287('0x57')]};_0xf7c1a[_0xe287('0x21')](_0x10f5fa);}}_0x53eb2c({'count':_0xf7c1a[_0xe287('0x19')],'rows':_0xf7c1a});});},'WhatsappQueues':function(){return new Promise(function(_0x367737){var _0x4bf17f=[];for(var _0x180255 in _0x2d2b48[_0xe287('0x5d')]){if(_0x2d2b48[_0xe287('0x5d')]['hasOwnProperty'](_0x180255)){var _0x311af0=_0x2d2b48['whatsappQueues'][_0x180255];var _0xa280ae={'id':_0x311af0['id'],'available':_0x311af0[_0xe287('0x59')],'loggedIn':_0x311af0[_0xe287('0x54')],'name':_0x311af0['name'],'paused':_0x311af0[_0xe287('0x56')],'waiting':_0x311af0[_0xe287('0x57')]};_0x4bf17f[_0xe287('0x21')](_0xa280ae);}}_0x367737({'count':_0x4bf17f[_0xe287('0x19')],'rows':_0x4bf17f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x48560c){var _0x4b63c3=_['values'](_0x2d2b48[_0xe287('0x5e')]);_0x48560c({'count':_0x4b63c3['length'],'rows':_0x4b63c3});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5b698c){var _0x5450c1=_[_0xe287('0x51')](_0x2d2b48[_0xe287('0x5f')]);_0x5b698c({'count':_0x5450c1[_0xe287('0x19')],'rows':_0x5450c1});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4b424f){var _0xfecd74=_[_0xe287('0x51')](_0x2d2b48[_0xe287('0x60')]);_0x4b424f({'count':_0xfecd74[_0xe287('0x19')],'rows':_0xfecd74});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x51f0e7){var _0x327a06=_['values'](_0x2d2b48[_0xe287('0x61')]);_0x51f0e7({'count':_0x327a06[_0xe287('0x19')],'rows':_0x327a06});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4b4674){var _0x388fc9=_['values'](_0x2d2b48[_0xe287('0x62')]);_0x4b4674({'count':_0x388fc9[_0xe287('0x19')],'rows':_0x388fc9});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1f14d0){var _0x27a591=_[_0xe287('0x51')](_0x2d2b48['whatsappQueuesWaitingInteractions']);_0x1f14d0({'count':_0x27a591[_0xe287('0x19')],'rows':_0x27a591});});}};var _0x49016e=jayson[_0xe287('0x63')](_0x298641)[_0xe287('0x64')]();_0x49016e['on']('error',function(_0x2c67cd){logger[_0xe287('0x37')](JSON['stringify'](_0x2c67cd));return _0x497f73(_0x2c67cd);});_0x49016e[_0xe287('0x13')](0x232c,_0xe287('0x65'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x279281(_0xe287('0x66')+0x232c);});});};
\ No newline at end of file
+var _0xd959=['error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','Applications\x20executed','stringify','matchPath','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','emit','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','find','chatQueues','available','loggedIn','name','waiting','mailQueues','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','message','interaction','checkWaitingNotifications','transfer','isArray','applications','length','existsSync','app','autoreply','channel','mail','push','slice','join','dialogflow','split','dialogflowv2','appdata','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20'];(function(_0x4abef2,_0x4bda99){var _0x331902=function(_0x1b5ea0){while(--_0x1b5ea0){_0x4abef2['push'](_0x4abef2['shift']());}};_0x331902(++_0x4bda99);}(_0xd959,0x94));var _0x9d95=function(_0x5cf677,_0x4384db){_0x5cf677=_0x5cf677-0x0;var _0x2b4b29=_0xd959[_0x5cf677];return _0x2b4b29;};'use strict';var _=require(_0x9d95('0x0'));var util=require(_0x9d95('0x1'));var path=require(_0x9d95('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x9d95('0x3'));var utils=require(_0x9d95('0x4'));var sUtils=require(_0x9d95('0x5'));var logger=require(_0x9d95('0x6'))(_0x9d95('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x9d95('0x8')),'chatQueueReport':require(_0x9d95('0x9')),'smsQueueReport':require(_0x9d95('0xa')),'faxQueueReport':require(_0x9d95('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x9d95('0xc'));function getId(_0x300ffe,_0x22af66,_0x561877){return util[_0x9d95('0xd')]('%s.%s.%s',_0x300ffe,_0x22af66||0x0,_0x561877||0x0);}function getIntervals(_0x156d8a,_0x1825b5){var _0x4fa7d0=[];if(!_[_0x9d95('0xe')](_0x1825b5[_0x9d95('0xf')])&&!_['isNil'](_0x156d8a[_0x1825b5[_0x9d95('0xf')]])&&!_[_0x9d95('0xe')](_0x156d8a[_0x1825b5['IntervalId']][_0x9d95('0x10')])){_0x4fa7d0=_[_0x9d95('0x11')](_0x156d8a[_0x1825b5['IntervalId']][_0x9d95('0x10')],_0x9d95('0x12'));}else if(!_[_0x9d95('0xe')](_0x1825b5[_0x9d95('0x12')])){_0x4fa7d0=[_0x1825b5['interval']];}return _0x4fa7d0;}exports[_0x9d95('0x13')]=function(_0x430bfe){_0x430bfe['rules']={};return new BPromise(function(_0x36a204,_0x1aee2b){var _0xcd7ba8={'Start':function(_0x4b4f1b){var _0x2d5ab2=this;return new Promise(function(_0x4bae6f,_0x4cabfd){if(_0x4b4f1b){try{var _0x3e3471=[];var _0x46650b=getId(_0x4b4f1b['channel'],_0x4b4f1b[_0x9d95('0x14')]?_0x4b4f1b['message']['id']:0x0,_0x4b4f1b[_0x9d95('0x15')]?_0x4b4f1b[_0x9d95('0x15')]['id']:0x0);var _0x1d267c=sUtils[_0x9d95('0x16')](_0x430bfe,_0x4b4f1b);if(_0x4b4f1b[_0x9d95('0x17')]||!_0x1d267c&&_0x4b4f1b['applications']&&_[_0x9d95('0x18')](_0x4b4f1b['applications'])&&_0x4b4f1b[_0x9d95('0x19')][_0x9d95('0x1a')]){for(var _0x28dd35=0x0;_0x28dd35<_0x4b4f1b[_0x9d95('0x19')][_0x9d95('0x1a')];_0x28dd35+=0x1){var _0x33d3e8=_0x4b4f1b[_0x9d95('0x19')][_0x28dd35];if(fs[_0x9d95('0x1b')](path['join'](__dirname,_0x9d95('0x19'),_0x33d3e8['app']+'.js'))){var _0x8081ae=[];switch(_0x33d3e8[_0x9d95('0x1c')]['toLowerCase']()){case _0x9d95('0x1d'):var _0x29a832=_0x33d3e8['appdata']['split'](',');if(_0x4b4f1b[_0x9d95('0x1e')]===_0x9d95('0x1f')){_0x8081ae[_0x9d95('0x20')](_0x29a832[0x0]);_0x8081ae[_0x9d95('0x20')](_0x29a832[0x1]);_0x8081ae['push'](_0x29a832[_0x9d95('0x21')](0x2,_0x29a832[_0x9d95('0x1a')])[_0x9d95('0x22')](','));}else{_0x8081ae[_0x9d95('0x20')](_0x29a832[0x0]);_0x8081ae[_0x9d95('0x20')](_0x29a832[_0x9d95('0x21')](0x1,_0x29a832[_0x9d95('0x1a')])[_0x9d95('0x22')](','));}break;case _0x9d95('0x23'):var _0xb69ff8=_0x33d3e8['appdata'][_0x9d95('0x24')](',');_0x8081ae[_0x9d95('0x20')](_0xb69ff8[0x0]);_0x8081ae[_0x9d95('0x20')](_0xb69ff8[0x1]);_0x8081ae[_0x9d95('0x20')](_0xb69ff8[_0x9d95('0x21')](0x2,_0xb69ff8[_0x9d95('0x1a')])[_0x9d95('0x22')](','));break;case _0x9d95('0x25'):var _0x3a40af=_0x33d3e8[_0x9d95('0x26')]['split'](',');_0x8081ae[_0x9d95('0x20')](_0x3a40af[0x0]);_0x8081ae[_0x9d95('0x20')](_0x3a40af[0x1]);_0x8081ae[_0x9d95('0x20')](_0x3a40af[0x2]);_0x8081ae[_0x9d95('0x20')](_0x3a40af[0x3]);_0x8081ae[_0x9d95('0x20')](_0x3a40af['slice'](0x4,_0x3a40af[_0x9d95('0x1a')])[_0x9d95('0x22')](','));break;case _0x9d95('0x27'):var _0x25610d=_0x33d3e8['appdata'][_0x9d95('0x24')](',');_0x8081ae['push'](_0x25610d[0x0]);_0x8081ae[_0x9d95('0x20')](_0x25610d[0x1]);_0x8081ae[_0x9d95('0x20')](_0x25610d[0x2]);_0x8081ae[_0x9d95('0x20')](_0x25610d[0x3]);_0x8081ae['push'](_0x25610d[_0x9d95('0x21')](0x4,_0x25610d['length'])['join'](','));break;case _0x9d95('0x14'):_0x8081ae['push'](_0x33d3e8['appdata']);break;case _0x9d95('0x28'):_0x8081ae['push'](_0x33d3e8['TagId']);_0x8081ae[_0x9d95('0x20')](_0x33d3e8[_0x9d95('0x26')]);break;case _0x9d95('0x29'):var _0x1c529f=utils['getMustacheRender'](_0x4b4f1b[_0x9d95('0x2a')][_0x9d95('0x2b')],_0x4b4f1b);var _0x1e4cb8=_0x33d3e8[_0x9d95('0x26')][_0x9d95('0x24')](',');_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x0]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x1]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x2]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x3]);_0x8081ae['push'](_0x1e4cb8[0x4]);_0x8081ae['push'](_0x1e4cb8[0x5]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x6]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x7]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0x8]);_0x8081ae['push'](_0x1e4cb8[0x9]);_0x8081ae[_0x9d95('0x20')](_0x1e4cb8[0xa]);_0x8081ae[_0x9d95('0x20')](_0x4b4f1b[_0x9d95('0x15')]['id']);_0x8081ae[_0x9d95('0x20')](_0x4b4f1b['message']['id']);_0x8081ae[_0x9d95('0x20')](_0x33d3e8[_0x9d95('0x2c')]);_0x8081ae[_0x9d95('0x20')](_0x4b4f1b['interaction'][_0x9d95('0x2d')]);_0x8081ae['push'](_0x4b4f1b[_0x9d95('0x2e')][_0x9d95('0x2e')]);_0x8081ae['push'](_0x1c529f);break;default:_0x8081ae=_['isNil'](_0x33d3e8[_0x9d95('0x26')])?[]:_0x33d3e8['appdata'][_0x9d95('0x24')](',');}var _0x144c76={'id':util[_0x9d95('0xd')](_0x9d95('0x2f'),_0x46650b,_0x33d3e8['id'],_0x33d3e8['app']),'condition':require(_0x9d95('0x30'))['condition'](_0x46650b,getIntervals(_0x430bfe[_0x9d95('0x31')],_0x33d3e8),_0x430bfe),'consequence':require(_0x9d95('0x32')+_0x33d3e8[_0x9d95('0x1c')])[_0x9d95('0x33')](_0x46650b,_0x8081ae,_0x430bfe,_0x4b4f1b),'p':_0x33d3e8['priority']||0x0};logger[_0x9d95('0x34')](_0x9d95('0x35'),_0x144c76['id'],_0x9d95('0x36'),getIntervals(_0x430bfe['intervals'],_0x33d3e8)[_0x9d95('0x22')](_0x9d95('0x37')));_0x3e3471[_0x9d95('0x20')](_0x144c76);}else{logger[_0x9d95('0x38')](_0x9d95('0x39'),path[_0x9d95('0x22')](__dirname,_0x9d95('0x19'),_0x33d3e8[_0x9d95('0x1c')]+_0x9d95('0x3a')));}}_0x430bfe[_0x9d95('0x3b')][_0x46650b]=new RuleEngine(_0x3e3471);_0x430bfe[_0x9d95('0x3b')][_0x46650b][_0x9d95('0x3c')](_0x4b4f1b,function(_0x32e8ee){logger[_0x9d95('0x34')](_0x9d95('0x3d'),JSON[_0x9d95('0x3e')](_0x32e8ee[_0x9d95('0x3f')]));if(_0x430bfe[_0x9d95('0x3b')][_0x46650b]){_0x430bfe[_0x9d95('0x3b')][_0x46650b]['emit']('complete');}});return _0x4bae6f({'code':0xc8,'message':_0x4b4f1b});}else{if(_0x1d267c){logger[_0x9d95('0x34')](util[_0x9d95('0xd')](_0x9d95('0x40'),_0x46650b));}else{logger[_0x9d95('0x34')](_0x9d95('0x41'));}return _0x4bae6f({'code':0xc8,'message':_0x4b4f1b});}}catch(_0xb6c8d6){logger[_0x9d95('0x38')](_0xb6c8d6[_0x9d95('0x42')]);return _0x4cabfd(_0x2d5ab2['error'](0x1f4,_0xb6c8d6));}}return _0x4cabfd('routing\x20is\x20empty');});},'AcceptMessage':function(_0x882089){var _0x5800d7=this;return new Promise(function(_0x41accb,_0x511c80){if(_0x882089[_0x9d95('0x43')]&&_0x882089[_0x9d95('0x43')]['id']){if(_0x430bfe[_0x9d95('0x44')][_0x882089['agent']['id']]){_0x430bfe[_0x9d95('0x44')][_0x882089[_0x9d95('0x43')]['id']][_0x9d95('0x45')]=![];_0x430bfe['agents'][_0x882089[_0x9d95('0x43')]['id']][_0x9d95('0x46')]=undefined;}}if(_0x882089[_0x9d95('0x14')]&&_0x882089[_0x9d95('0x14')]['id']){try{var _0x3ae9d7=getId(_0x882089['channel'],_0x882089[_0x9d95('0x14')]?_0x882089['message']['id']:0x0,_0x882089[_0x9d95('0x15')]?_0x882089[_0x9d95('0x15')]['id']:0x0);if(_0x430bfe[_0x9d95('0x3b')][_0x3ae9d7]){_0x430bfe[_0x9d95('0x3b')][_0x3ae9d7][_0x9d95('0x47')]('end');if(rpc[_0x882089[_0x9d95('0x1e')]+'QueueReport']){rpc[_0x882089[_0x9d95('0x1e')]+'QueueReport'][_0x9d95('0x48')](_0x3ae9d7,{'UserId':_0x882089[_0x9d95('0x14')][_0x9d95('0x49')]})[_0x9d95('0x4a')](function(){logger[_0x9d95('0x38')](_0x9d95('0x4b'));});}}return _0x41accb({'code':0xc8,'message':_0x882089});}catch(_0x346675){logger[_0x9d95('0x38')](_0x346675['stack']);return _0x511c80(_0x5800d7['error'](0x1f4,_0x346675));}}logger[_0x9d95('0x38')](_0x9d95('0x4c'));return _0x511c80(_0x5800d7['error'](0x1f4,_0x9d95('0x4c')));});},'RejectMessage':function(_0xd920fc){var _0x39e56f=this;return new Promise(function(_0x25b32a,_0x272e14){if(_0xd920fc[_0x9d95('0x43')]&&_0xd920fc[_0x9d95('0x43')]['id']){try{if(_0x430bfe[_0x9d95('0x44')][_0xd920fc[_0x9d95('0x43')]['id']]){_0x430bfe['agents'][_0xd920fc[_0x9d95('0x43')]['id']][_0x9d95('0x45')]=![];_0x430bfe['agents'][_0xd920fc[_0x9d95('0x43')]['id']][_0x9d95('0x46')]=undefined;}return _0x25b32a({'code':0xc8,'message':_0xd920fc});}catch(_0x23559c){logger[_0x9d95('0x38')](_0x23559c[_0x9d95('0x42')]);return _0x272e14(_0x39e56f[_0x9d95('0x38')](0x1f4,_0x23559c));}}logger[_0x9d95('0x38')](_0x9d95('0x4c'));return _0x272e14(_0x39e56f[_0x9d95('0x38')](0x1f4,_0x9d95('0x4c')));});},'AbandonInteraction':function(_0x2e5adf){var _0x3f1c21=this;return new Promise(function(_0x26f848,_0x58cad8){if(_0x2e5adf[_0x9d95('0x1e')]&&_0x2e5adf[_0x9d95('0x15')]&&_0x2e5adf[_0x9d95('0x15')]['id']){try{var _0x5d15c1=getId(_0x2e5adf[_0x9d95('0x1e')],_0x2e5adf[_0x9d95('0x14')]?_0x2e5adf[_0x9d95('0x14')]['id']:0x0,_0x2e5adf[_0x9d95('0x15')]?_0x2e5adf[_0x9d95('0x15')]['id']:0x0);if(_0x430bfe['rules'][_0x5d15c1]){_0x430bfe['rules'][_0x5d15c1][_0x9d95('0x47')]('end');}return _0x26f848({'code':0xc8,'message':_0x2e5adf});}catch(_0x169c44){logger[_0x9d95('0x38')](_0x169c44[_0x9d95('0x42')]);return _0x58cad8(_0x3f1c21['error'](0x1f4,_0x169c44));}}logger[_0x9d95('0x38')]('message\x20is\x20empty');return _0x58cad8(_0x3f1c21['error'](0x1f4,_0x9d95('0x4c')));});},'AgentCapacity':function(_0x29cd28){var _0x2869ca=this;return new Promise(function(_0x314ddb,_0xc7b54){if(_0x430bfe[_0x9d95('0x44')][_0x9d95('0x4d')](_0x29cd28['id'])){for(var _0x1f7899 in _0x29cd28[_0x9d95('0x4e')]){if(_0x29cd28[_0x9d95('0x4e')]['hasOwnProperty'](_0x1f7899)){if(_0x430bfe[_0x9d95('0x44')][_0x29cd28['id']][_0x9d95('0x4d')](_0x1f7899+'CurrentCapacity')){_0x430bfe[_0x9d95('0x44')][_0x29cd28['id']][_0x1f7899+_0x9d95('0x4f')]=parseInt(_0x29cd28['capacity'][_0x1f7899],0xa);}}}_0x430bfe[_0x9d95('0x44')][_0x29cd28['id']]['updateRealtime']();return _0x314ddb({'code':0xc8,'message':_0x430bfe[_0x9d95('0x44')][_0x29cd28['id']]});}else{return _0xc7b54(_0x2869ca[_0x9d95('0x38')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x530da3){return new Promise(function(_0x4fe9f4){var _0xa7973=_['values'](_0x430bfe[_0x9d95('0x44')]);if(_0x530da3&&_0x530da3['id']){var _0x713b8d=_[_0x9d95('0x50')](_0xa7973,function(_0x44f2f1){return _0x44f2f1['id']===_0x530da3['id'];});_0x4fe9f4(_0x713b8d);}else{_0x4fe9f4({'count':_0xa7973[_0x9d95('0x1a')],'rows':_0xa7973});}});},'ChatQueues':function(){return new Promise(function(_0x1aebaf){var _0x92e57f=[];for(var _0x47b5bf in _0x430bfe[_0x9d95('0x51')]){if(_0x430bfe[_0x9d95('0x51')][_0x9d95('0x4d')](_0x47b5bf)){var _0x5bb220=_0x430bfe[_0x9d95('0x51')][_0x47b5bf];var _0x3944ba={'id':_0x5bb220['id'],'available':_0x5bb220[_0x9d95('0x52')],'loggedIn':_0x5bb220[_0x9d95('0x53')],'name':_0x5bb220[_0x9d95('0x54')],'paused':_0x5bb220['paused'],'waiting':_0x5bb220[_0x9d95('0x55')]};_0x92e57f[_0x9d95('0x20')](_0x3944ba);}}_0x1aebaf({'count':_0x92e57f[_0x9d95('0x1a')],'rows':_0x92e57f});});},'MailQueues':function(){return new Promise(function(_0x3ab700){var _0x11cdd3=[];for(var _0x2f619c in _0x430bfe['mailQueues']){if(_0x430bfe[_0x9d95('0x56')][_0x9d95('0x4d')](_0x2f619c)){var _0x10bede=_0x430bfe[_0x9d95('0x56')][_0x2f619c];var _0x374a8e={'id':_0x10bede['id'],'available':_0x10bede[_0x9d95('0x52')],'loggedIn':_0x10bede['loggedIn'],'name':_0x10bede['name'],'paused':_0x10bede['paused'],'waiting':_0x10bede[_0x9d95('0x55')]};_0x11cdd3[_0x9d95('0x20')](_0x374a8e);}}_0x3ab700({'count':_0x11cdd3[_0x9d95('0x1a')],'rows':_0x11cdd3});});},'OpenchannelQueues':function(){return new Promise(function(_0x35302f){var _0xffeff3=[];for(var _0x489eb4 in _0x430bfe[_0x9d95('0x57')]){if(_0x430bfe['openchannelQueues'][_0x9d95('0x4d')](_0x489eb4)){var _0x63f517=_0x430bfe[_0x9d95('0x57')][_0x489eb4];var _0x414d80={'id':_0x63f517['id'],'available':_0x63f517[_0x9d95('0x52')],'loggedIn':_0x63f517['loggedIn'],'name':_0x63f517[_0x9d95('0x54')],'paused':_0x63f517[_0x9d95('0x58')],'waiting':_0x63f517[_0x9d95('0x55')]};_0xffeff3[_0x9d95('0x20')](_0x414d80);}}_0x35302f({'count':_0xffeff3[_0x9d95('0x1a')],'rows':_0xffeff3});});},'SmsQueues':function(){return new Promise(function(_0x24ddb3){var _0x5695d2=[];for(var _0x3cd424 in _0x430bfe['smsQueues']){if(_0x430bfe[_0x9d95('0x59')][_0x9d95('0x4d')](_0x3cd424)){var _0x8e8534=_0x430bfe[_0x9d95('0x59')][_0x3cd424];var _0x21f35e={'id':_0x8e8534['id'],'available':_0x8e8534[_0x9d95('0x52')],'loggedIn':_0x8e8534[_0x9d95('0x53')],'name':_0x8e8534['name'],'paused':_0x8e8534[_0x9d95('0x58')],'waiting':_0x8e8534[_0x9d95('0x55')]};_0x5695d2[_0x9d95('0x20')](_0x21f35e);}}_0x24ddb3({'count':_0x5695d2['length'],'rows':_0x5695d2});});},'FaxQueues':function(){return new Promise(function(_0x234cdb){var _0x4b095a=[];for(var _0x25e9bb in _0x430bfe[_0x9d95('0x5a')]){if(_0x430bfe['faxQueues'][_0x9d95('0x4d')](_0x25e9bb)){var _0x100cab=_0x430bfe[_0x9d95('0x5a')][_0x25e9bb];var _0x1addc5={'id':_0x100cab['id'],'available':_0x100cab[_0x9d95('0x52')],'loggedIn':_0x100cab['loggedIn'],'name':_0x100cab[_0x9d95('0x54')],'paused':_0x100cab[_0x9d95('0x58')],'waiting':_0x100cab[_0x9d95('0x55')]};_0x4b095a[_0x9d95('0x20')](_0x1addc5);}}_0x234cdb({'count':_0x4b095a[_0x9d95('0x1a')],'rows':_0x4b095a});});},'WhatsappQueues':function(){return new Promise(function(_0x5403a6){var _0x57dc0f=[];for(var _0x49d20d in _0x430bfe[_0x9d95('0x5b')]){if(_0x430bfe['whatsappQueues'][_0x9d95('0x4d')](_0x49d20d)){var _0x1d51f7=_0x430bfe[_0x9d95('0x5b')][_0x49d20d];var _0x4060a3={'id':_0x1d51f7['id'],'available':_0x1d51f7[_0x9d95('0x52')],'loggedIn':_0x1d51f7[_0x9d95('0x53')],'name':_0x1d51f7[_0x9d95('0x54')],'paused':_0x1d51f7[_0x9d95('0x58')],'waiting':_0x1d51f7[_0x9d95('0x55')]};_0x57dc0f[_0x9d95('0x20')](_0x4060a3);}}_0x5403a6({'count':_0x57dc0f[_0x9d95('0x1a')],'rows':_0x57dc0f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x75bc9e){var _0x54024f=_[_0x9d95('0x5c')](_0x430bfe[_0x9d95('0x5d')]);_0x75bc9e({'count':_0x54024f[_0x9d95('0x1a')],'rows':_0x54024f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x54d135){var _0x1cc8a8=_[_0x9d95('0x5c')](_0x430bfe[_0x9d95('0x5e')]);_0x54d135({'count':_0x1cc8a8[_0x9d95('0x1a')],'rows':_0x1cc8a8});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xa5755f){var _0x3110d3=_[_0x9d95('0x5c')](_0x430bfe[_0x9d95('0x5f')]);_0xa5755f({'count':_0x3110d3[_0x9d95('0x1a')],'rows':_0x3110d3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2de696){var _0x519f74=_['values'](_0x430bfe['smsQueuesWaitingInteractions']);_0x2de696({'count':_0x519f74['length'],'rows':_0x519f74});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x47fe8a){var _0x28670=_['values'](_0x430bfe['faxQueuesWaitingInteractions']);_0x47fe8a({'count':_0x28670[_0x9d95('0x1a')],'rows':_0x28670});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1246fb){var _0x479510=_['values'](_0x430bfe[_0x9d95('0x60')]);_0x1246fb({'count':_0x479510['length'],'rows':_0x479510});});}};var _0x4d6f9d=jayson[_0x9d95('0x61')](_0xcd7ba8)[_0x9d95('0x62')]();_0x4d6f9d['on'](_0x9d95('0x38'),function(_0x21ec7f){logger[_0x9d95('0x38')](JSON[_0x9d95('0x3e')](_0x21ec7f));return _0x1aee2b(_0x21ec7f);});_0x4d6f9d[_0x9d95('0x13')](0x232c,_0x9d95('0x63'),function(){console['log'](_0x9d95('0x64'),0x232c);return _0x36a204(_0x9d95('0x65')+0x232c);});});};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdffc=['stop','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xdffc,0x1a7));var _0xcdff=function(_0x1eba6a,_0x332c64){_0x1eba6a=_0x1eba6a-0x0;var _0x2d36e1=_0xdffc[_0x1eba6a];return _0x2d36e1;};'use strict';var _=require(_0xcdff('0x0'));var iftime=require(_0xcdff('0x1'))[_0xcdff('0x2')];var logger=require(_0xcdff('0x3'))(_0xcdff('0x4'));exports[_0xcdff('0x5')]=function(_0x42e715,_0x57f348,_0x407bba){return function(_0xbc1eef){if(_0x407bba[_0xcdff('0x6')]&&!_0x407bba['rules'][_0x42e715]){logger[_0xcdff('0x7')](_0xcdff('0x8'),_0x42e715);return _0xbc1eef[_0xcdff('0x9')]();}var _0x4de2be=_0x57f348['map'](function(_0x38b919){return iftime(_0x38b919);});var _0x1b6f96=_[_0xcdff('0xa')](_0x4de2be);if(_0x1b6f96){logger[_0xcdff('0x7')](_0xcdff('0xb'),_0x42e715,_0x57f348[_0xcdff('0xc')](_0xcdff('0xd')),_0x1b6f96);_0xbc1eef[_0xcdff('0xe')](_0x1b6f96);}else{logger['info'](_0xcdff('0xf'),_0x42e715,_0x57f348[_0xcdff('0xc')](_0xcdff('0xd')));_0xbc1eef['stop']();}};};
\ No newline at end of file
+var _0x3af4=['join','\x20|\x20','lodash','iftime','../../../config/logger','routing','condition','rules','info','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s'];(function(_0x25b430,_0x342119){var _0x32d9e3=function(_0x5960bd){while(--_0x5960bd){_0x25b430['push'](_0x25b430['shift']());}};_0x32d9e3(++_0x342119);}(_0x3af4,0xd2));var _0x43af=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x3af4[_0x5235a6];return _0x1cf37e;};'use strict';var _=require(_0x43af('0x0'));var iftime=require('../../../utils/iftime')[_0x43af('0x1')];var logger=require(_0x43af('0x2'))(_0x43af('0x3'));exports[_0x43af('0x4')]=function(_0x3653fe,_0x2e67e1,_0x1d4d82){return function(_0x188066){if(_0x1d4d82[_0x43af('0x5')]&&!_0x1d4d82[_0x43af('0x5')][_0x3653fe]){logger[_0x43af('0x6')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3653fe);return _0x188066[_0x43af('0x7')]();}var _0x33d4ec=_0x2e67e1[_0x43af('0x8')](function(_0x1eb5e4){return iftime(_0x1eb5e4);});var _0x13bbde=_[_0x43af('0x9')](_0x33d4ec);if(_0x13bbde){logger[_0x43af('0x6')](_0x43af('0xa'),_0x3653fe,_0x2e67e1['join']('\x20|\x20'),_0x13bbde);_0x188066['when'](_0x13bbde);}else{logger[_0x43af('0x6')]('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x3653fe,_0x2e67e1[_0x43af('0xb')](_0x43af('0xc')));_0x188066['stop']();}};};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x56c7c0,_0x463d97){var _0x666b9a=function(_0x56e4a5){while(--_0x56e4a5){_0x56c7c0['push'](_0x56c7c0['shift']());}};_0x666b9a(++_0x463d97);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}};
\ No newline at end of file
+var _0x91a7=['debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','complete','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','calleridnum','lastevent','then','type','agentcomplete','acw','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','connectedlinenum','connectedlinename','error','uniqueid','isNil'];(function(_0x381370,_0x5ab97c){var _0x5678f4=function(_0x5b4554){while(--_0x5b4554){_0x381370['push'](_0x381370['shift']());}};_0x5678f4(++_0x5ab97c);}(_0x91a7,0xe7));var _0x791a=function(_0x589a21,_0x3bfe2a){_0x589a21=_0x589a21-0x0;var _0x1582f6=_0x91a7[_0x589a21];return _0x1582f6;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var utils=require(_0x791a('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x268862,_0x5d2796){utils[_0x791a('0x2')](util['format'](_0x791a('0x3'),_0x268862['uniqueid'],_0x268862['channel'],_0x268862[_0x791a('0x4')],_0x268862[_0x791a('0x5')],_0x268862['interface'],_0x268862[_0x791a('0x6')],_0x268862['connectedlinenum'],_0x268862[_0x791a('0x7')]));if(_0x268862[_0x791a('0x4')]){utils['getVoiceQueueByName'](_0x268862[_0x791a('0x4')])[_0x791a('0x8')](function(_0x2c59ba){if(_0x2c59ba){_0x268862[_0x791a('0x9')]=_0x2c59ba[_0x791a('0x9')];_0x268862['agentacw']=_0x268862[_0x791a('0xa')]?_0x2c59ba[_0x791a('0xb')]:![];_0x268862['acwtime']=_0x268862[_0x791a('0xc')]?_0x2c59ba[_0x791a('0xd')]:0x0;}utils[_0x791a('0xe')](_0x791a('0xf'),_0x268862);});}else{utils[_0x791a('0xe')](_0x791a('0xf'),_0x268862);}if(_0x5d2796){delete transfers[_0x268862['uniqueid']];}else{delete agents[_0x268862['destuniqueid']];}}exports[_0x791a('0x10')]=function(_0x2f2d8d){try{utils['debug'](util[_0x791a('0x11')](_0x791a('0x12'),_0x2f2d8d['uniqueid']),_0x2f2d8d);agents[_0x2f2d8d[_0x791a('0x13')]]=_0x2f2d8d;agents[_0x2f2d8d[_0x791a('0x13')]][_0x791a('0x14')]=utils[_0x791a('0x15')]();agents[_0x2f2d8d['destuniqueid']][_0x791a('0x7')]='called';agents[_0x2f2d8d[_0x791a('0x13')]][_0x791a('0x16')]=null;agents[_0x2f2d8d['destuniqueid']][_0x791a('0x17')]=null;utils['info'](util[_0x791a('0x11')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2f2d8d['uniqueid'],agents[_0x2f2d8d['destuniqueid']][_0x791a('0x5')],_0x2f2d8d['destuniqueid']));}catch(_0x4cf613){utils[_0x791a('0x18')](util[_0x791a('0x11')](_0x791a('0x12'),_0x2f2d8d[_0x791a('0x19')]),_0x4cf613);}};exports['agentringnoanswer']=function(_0x189c0d){try{if(!_[_0x791a('0x1a')](agents[_0x189c0d[_0x791a('0x13')]])){utils[_0x791a('0x1b')](util['format'](_0x791a('0x1c'),_0x189c0d[_0x791a('0x19')]),_0x189c0d);utils[_0x791a('0x2')](util[_0x791a('0x11')](_0x791a('0x1d'),_0x189c0d[_0x791a('0x19')],agents[_0x189c0d[_0x791a('0x13')]][_0x791a('0x5')],_0x189c0d[_0x791a('0x13')]));agents[_0x189c0d[_0x791a('0x13')]][_0x791a('0x1e')]=!![];agents[_0x189c0d['destuniqueid']][_0x791a('0x1f')]=utils[_0x791a('0x15')]();agents[_0x189c0d[_0x791a('0x13')]][_0x791a('0x7')]='timeout';agents[_0x189c0d[_0x791a('0x13')]][_0x791a('0x20')]='timeout';agents[_0x189c0d[_0x791a('0x13')]][_0x791a('0x21')]=_0x189c0d[_0x791a('0x22')]?parseInt(_0x189c0d['ringtime'])/0x3e8:0x0;agents[_0x189c0d[_0x791a('0x13')]][_0x791a('0x23')]=0x0;unanswered[_0x791a('0x24')](_0x189c0d[_0x791a('0x13')]);}}catch(_0x4f423){utils[_0x791a('0x18')](util[_0x791a('0x11')](_0x791a('0x1c'),_0x189c0d['uniqueid']),_0x4f423);}};exports[_0x791a('0x25')]=function(_0x9e9332){try{_[_0x791a('0x26')](agents,function(_0x59d2c0,_0x1cdda9){if(_0x59d2c0['uniqueid']==_0x9e9332[_0x791a('0x19')]&&!_[_0x791a('0x27')](unanswered,_0x59d2c0[_0x791a('0x13')])){utils[_0x791a('0x1b')](util[_0x791a('0x11')](_0x791a('0x28'),_0x9e9332[_0x791a('0x19')]),_0x9e9332);utils['info'](util[_0x791a('0x11')](_0x791a('0x29'),_0x9e9332[_0x791a('0x19')],_0x59d2c0[_0x791a('0x5')],_0x59d2c0[_0x791a('0x13')]));_0x59d2c0['agentringnoanswer']=!![];_0x59d2c0[_0x791a('0x1f')]=utils[_0x791a('0x15')]();_0x59d2c0[_0x791a('0x7')]=_0x791a('0x2a');_0x59d2c0[_0x791a('0x20')]='abandoned';_0x59d2c0[_0x791a('0x21')]=_0x9e9332[_0x791a('0x21')];_0x59d2c0[_0x791a('0x23')]=0x0;writeDB(_0x59d2c0);}});}catch(_0x2dbdc0){utils[_0x791a('0x18')](util['format'](_0x791a('0x28'),_0x9e9332['uniqueid']),_0x2dbdc0);}};exports[_0x791a('0x2b')]=function(_0x4cd047){try{if(agents[_0x4cd047['destuniqueid']]){utils[_0x791a('0x1b')](util[_0x791a('0x11')](_0x791a('0x2c'),_0x4cd047[_0x791a('0x19')]),_0x4cd047);utils[_0x791a('0x2')](util[_0x791a('0x11')](_0x791a('0x2d'),_0x4cd047['uniqueid'],agents[_0x4cd047[_0x791a('0x13')]]['membername'],_0x4cd047[_0x791a('0x13')]));agents[_0x4cd047['destuniqueid']][_0x791a('0x2e')]=utils[_0x791a('0x15')]();agents[_0x4cd047['destuniqueid']][_0x791a('0x16')]=_0x4cd047[_0x791a('0x16')];agents[_0x4cd047['destuniqueid']][_0x791a('0x17')]=_0x4cd047[_0x791a('0x17')];agents[_0x4cd047[_0x791a('0x13')]][_0x791a('0x21')]=_0x4cd047[_0x791a('0x22')];agents[_0x4cd047[_0x791a('0x13')]][_0x791a('0x7')]=_0x791a('0x2f');_[_0x791a('0x26')](agents,function(_0xeafbb5,_0x587481){if(_0xeafbb5[_0x791a('0x13')]!=_0x4cd047[_0x791a('0x13')]&&_0xeafbb5[_0x791a('0x19')]==_0x4cd047['uniqueid']){_0xeafbb5[_0x791a('0x23')]=0x0;_0xeafbb5['holdtime']=_0x4cd047['ringtime'];_0xeafbb5['agentringnoanswer']=!![];_0xeafbb5[_0x791a('0x1f')]=utils[_0x791a('0x15')]();_0xeafbb5['lastevent']=_0x791a('0x30');_0xeafbb5[_0x791a('0x20')]=_0x791a('0x30');_0xeafbb5[_0x791a('0x31')]=_0x4cd047['destuniqueid'];_0xeafbb5['answeredelsewheremembername']=_0x4cd047['membername'];writeDB(_0xeafbb5);}});}}catch(_0x2f0395){utils[_0x791a('0x18')](util['format'](_0x791a('0x2c'),_0x4cd047[_0x791a('0x19')]),_0x2f0395);}};exports[_0x791a('0xa')]=function(_0x954164){try{if(!_['isNil'](agents[_0x954164[_0x791a('0x13')]])){utils['debug'](util[_0x791a('0x11')](_0x791a('0x32'),_0x954164[_0x791a('0x19')]),_0x954164);utils[_0x791a('0x2')](util[_0x791a('0x11')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x954164[_0x791a('0x19')],agents[_0x954164[_0x791a('0x13')]][_0x791a('0x5')],_0x954164[_0x791a('0x13')]));agents[_0x954164[_0x791a('0x13')]]['agentcomplete']=!![];agents[_0x954164[_0x791a('0x13')]][_0x791a('0x33')]=utils['now']();agents[_0x954164['destuniqueid']][_0x791a('0x23')]=utils[_0x791a('0x34')](agents[_0x954164[_0x791a('0x13')]]['agentcompleteAt'],agents[_0x954164['destuniqueid']][_0x791a('0x2e')]);agents[_0x954164[_0x791a('0x13')]]['reason']=_0x954164[_0x791a('0x20')];agents[_0x954164[_0x791a('0x13')]][_0x791a('0x7')]='complete';writeDB(agents[_0x954164['destuniqueid']]);}}catch(_0x2446fb){utils[_0x791a('0x18')](util[_0x791a('0x11')](_0x791a('0x32'),_0x954164['uniqueid']),_0x2446fb);}};exports[_0x791a('0x35')]=function(_0x9f768a){try{if(!_[_0x791a('0x1a')](agents[_0x9f768a[_0x791a('0x36')]])){utils['debug'](util[_0x791a('0x11')](_0x791a('0x37'),_0x9f768a[_0x791a('0x19')]),_0x9f768a);utils[_0x791a('0x2')](util[_0x791a('0x11')](_0x791a('0x38'),_0x9f768a[_0x791a('0x19')],agents[_0x9f768a['transfereruniqueid']][_0x791a('0x5')],agents[_0x9f768a[_0x791a('0x36')]]['uniqueid']));agents[_0x9f768a[_0x791a('0x36')]][_0x791a('0x39')]=!![];agents[_0x9f768a['transfereruniqueid']][_0x791a('0x3a')]=_0x791a('0x3b');agents[_0x9f768a[_0x791a('0x36')]][_0x791a('0x3c')]=_0x9f768a[_0x791a('0x3d')];agents[_0x9f768a['transfereruniqueid']]['transferuniqueid']=agents[_0x9f768a['transfereruniqueid']][_0x791a('0x19')];}}catch(_0x51b556){utils['error'](util[_0x791a('0x11')]('[%s][agents][blindtransfer]',_0x9f768a[_0x791a('0x19')]),_0x51b556);}};exports[_0x791a('0x3e')]=function(_0x5e6de4){try{utils['debug'](util[_0x791a('0x11')]('[%s][agents][attendedtransfer]',_0x5e6de4[_0x791a('0x3f')]),_0x5e6de4);if(_0x5e6de4[_0x791a('0x3f')]==_0x5e6de4[_0x791a('0x40')]){if(!_['isNil'](agents[_0x5e6de4[_0x791a('0x41')]])){utils[_0x791a('0x2')](util['format'](_0x791a('0x42'),_0x5e6de4[_0x791a('0x3f')],agents[_0x5e6de4[_0x791a('0x41')]][_0x791a('0x5')]));agents[_0x5e6de4[_0x791a('0x41')]][_0x791a('0x39')]=!![];agents[_0x5e6de4['secondtransfereruniqueid']]['transfertype']=_0x791a('0x43');agents[_0x5e6de4['secondtransfereruniqueid']][_0x791a('0x3c')]=_0x5e6de4[_0x791a('0x44')];agents[_0x5e6de4[_0x791a('0x41')]][_0x791a('0x45')]=_0x5e6de4[_0x791a('0x3f')];}if(_0x5e6de4[_0x791a('0x46')]&&agents[_0x5e6de4[_0x791a('0x46')]]){agents[_0x5e6de4['transfereeuniqueid']][_0x791a('0x47')]=0x1;transfers[_0x5e6de4[_0x791a('0x46')]]=_[_0x791a('0x48')](agents[_0x5e6de4[_0x791a('0x46')]]);transfers[_0x5e6de4[_0x791a('0x46')]][_0x791a('0x6')]=agents[_0x5e6de4[_0x791a('0x41')]]['calleridnum'];transfers[_0x5e6de4[_0x791a('0x46')]]['calleridname']=agents[_0x5e6de4['secondtransfereruniqueid']][_0x791a('0x49')];transfers[_0x5e6de4[_0x791a('0x46')]][_0x791a('0x14')]=utils[_0x791a('0x15')]();transfers[_0x5e6de4[_0x791a('0x46')]][_0x791a('0x2e')]=utils[_0x791a('0x15')]();transfers[_0x5e6de4[_0x791a('0x46')]][_0x791a('0x21')]=0x0;transfers[_0x5e6de4[_0x791a('0x46')]][_0x791a('0x47')]=0x2;}}else if(_0x5e6de4[_0x791a('0x41')]==_0x5e6de4[_0x791a('0x4a')]){if(!_[_0x791a('0x1a')](agents[_0x5e6de4[_0x791a('0x3f')]])){utils[_0x791a('0x2')](util[_0x791a('0x11')](_0x791a('0x42'),_0x5e6de4[_0x791a('0x3f')],agents[_0x5e6de4[_0x791a('0x3f')]]['membername']));agents[_0x5e6de4[_0x791a('0x3f')]][_0x791a('0x39')]=!![];agents[_0x5e6de4[_0x791a('0x3f')]][_0x791a('0x3a')]=_0x791a('0x43');agents[_0x5e6de4['origtransfereruniqueid']][_0x791a('0x3c')]=_0x5e6de4[_0x791a('0x4b')];agents[_0x5e6de4[_0x791a('0x3f')]][_0x791a('0x45')]=_0x5e6de4['secondtransfereruniqueid'];}if(_0x5e6de4[_0x791a('0x4c')]&&agents[_0x5e6de4['transfertargetuniqueid']]){agents[_0x5e6de4['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x5e6de4['transfertargetuniqueid']]=_[_0x791a('0x48')](agents[_0x5e6de4[_0x791a('0x4c')]]);transfers[_0x5e6de4[_0x791a('0x4c')]][_0x791a('0x6')]=agents[_0x5e6de4[_0x791a('0x3f')]][_0x791a('0x6')];transfers[_0x5e6de4[_0x791a('0x4c')]]['calleridname']=agents[_0x5e6de4['origtransfereruniqueid']][_0x791a('0x49')];transfers[_0x5e6de4[_0x791a('0x4c')]]['agentcalledAt']=utils['now']();transfers[_0x5e6de4[_0x791a('0x4c')]][_0x791a('0x2e')]=utils['now']();transfers[_0x5e6de4[_0x791a('0x4c')]][_0x791a('0x21')]=0x0;transfers[_0x5e6de4[_0x791a('0x4c')]][_0x791a('0x47')]=0x2;}}}catch(_0x4845c2){utils['error'](util[_0x791a('0x11')](_0x791a('0x4d'),_0x5e6de4['origtransfereruniqueid']),_0x4845c2);}};exports[_0x791a('0x4e')]=function(_0x13da2e){try{utils[_0x791a('0x1b')](util[_0x791a('0x11')]('[%s][agents][hangup]',_0x13da2e[_0x791a('0x19')]),_0x13da2e);if(agents[_0x13da2e[_0x791a('0x19')]]&&agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x20')]===_0x791a('0x4f')){if(_0x13da2e[_0x791a('0x50')]==='21'){agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x20')]='rejected';agents[_0x13da2e['uniqueid']]['lastevent']=_0x791a('0x51');}utils[_0x791a('0x2')](util[_0x791a('0x11')](_0x791a('0x52'),_0x13da2e[_0x791a('0x19')],agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x5')],agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x20')],agents[_0x13da2e[_0x791a('0x19')]]['lastevent']));writeDB(agents[_0x13da2e[_0x791a('0x19')]]);var _0x278f38=unanswered['indexOf'](_0x13da2e[_0x791a('0x19')]);if(_0x278f38>-0x1){unanswered[_0x791a('0x53')](_0x278f38,0x1);}}if(transfers[_0x13da2e['uniqueid']]){transfers[_0x13da2e['uniqueid']][_0x791a('0xa')]=!![];transfers[_0x13da2e[_0x791a('0x19')]]['agentcompleteAt']=utils['now']();transfers[_0x13da2e[_0x791a('0x19')]][_0x791a('0x23')]=utils[_0x791a('0x34')](transfers[_0x13da2e['uniqueid']][_0x791a('0x33')],transfers[_0x13da2e['uniqueid']][_0x791a('0x2e')]);transfers[_0x13da2e[_0x791a('0x19')]][_0x791a('0x20')]=_0x791a('0x54');transfers[_0x13da2e[_0x791a('0x19')]][_0x791a('0x7')]='complete';utils[_0x791a('0x2')](util[_0x791a('0x11')](_0x791a('0x52'),_0x13da2e[_0x791a('0x19')],transfers[_0x13da2e[_0x791a('0x19')]][_0x791a('0x5')],transfers[_0x13da2e[_0x791a('0x19')]][_0x791a('0x20')],transfers[_0x13da2e[_0x791a('0x19')]][_0x791a('0x7')]));writeDB(transfers[_0x13da2e[_0x791a('0x19')]],!![]);}if(agents[_0x13da2e[_0x791a('0x19')]]&&agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x2e')]){agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0xa')]=!![];agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x33')]=utils['now']();agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x23')]=utils[_0x791a('0x34')](agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x33')],agents[_0x13da2e['uniqueid']][_0x791a('0x2e')]);agents[_0x13da2e['uniqueid']][_0x791a('0x20')]=agents[_0x13da2e['uniqueid']][_0x791a('0x39')]?_0x791a('0x39'):'agent';agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x7')]=_0x791a('0x55');utils['info'](util[_0x791a('0x11')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x13da2e[_0x791a('0x19')],agents[_0x13da2e['uniqueid']]['membername'],agents[_0x13da2e['uniqueid']][_0x791a('0x20')],agents[_0x13da2e[_0x791a('0x19')]][_0x791a('0x7')]));writeDB(agents[_0x13da2e[_0x791a('0x19')]]);}}catch(_0x5ca5fa){utils[_0x791a('0x18')](util[_0x791a('0x11')]('[%s][agents][hangup]',_0x13da2e[_0x791a('0x19')]),_0x5ca5fa);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25bf=['destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','gotoif','lodash','NO\x20ANSWER','FAILED','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','DOCUMENTATION','error','debug','isNil','channelstate','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x25bf,0x155));var _0xf25b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x25bf[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf25b('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0xf25b('0x1'),'FAILED',_0xf25b('0x2'),_0xf25b('0x1'),_0xf25b('0x1'),'NO\x20ANSWER',_0xf25b('0x3'),'BUSY',_0xf25b('0x2'),_0xf25b('0x2'),_0xf25b('0x2')];var channels={};function writeDB(_0x177465){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x6'),_0x177465[_0xf25b('0x7')],_0x177465[_0xf25b('0x8')],_0x177465['queue'],_0x177465[_0xf25b('0x9')],_0x177465[_0xf25b('0xa')],_0x177465['calleridnum'],_0x177465['connectedlinenum'],_0x177465['lastevent']));if(_0x177465[_0xf25b('0xb')]){utils[_0xf25b('0xc')](_0x177465[_0xf25b('0xb')])[_0xf25b('0xd')](function(_0x390da5){if(_0x390da5){_0x177465[_0xf25b('0xe')]=_0x390da5['id'];}utils[_0xf25b('0xf')]('CreateVoiceCallReport',_0x177465);});}else{utils['request'](_0xf25b('0x10'),_0x177465);}if(channels[_0x177465[_0xf25b('0x7')]]){delete channels[_0x177465[_0xf25b('0x7')]];}}exports['newchannel']=function(_0x40646f){try{utils['debug'](util['format'](_0xf25b('0x11'),_0x40646f[_0xf25b('0x7')]),_0x40646f);if(_0x40646f[_0xf25b('0x7')]==_0x40646f[_0xf25b('0x12')]&&_0x40646f['channel']!=_0xf25b('0x13')){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x14'),_0x40646f['uniqueid'],_0x40646f[_0xf25b('0x15')],_0x40646f[_0xf25b('0x16')]));channels[_0x40646f[_0xf25b('0x7')]]={'uniqueid':_0x40646f[_0xf25b('0x7')],'accountcode':_0x40646f[_0xf25b('0xb')],'source':_0x40646f[_0xf25b('0x17')],'destination':_0x40646f[_0xf25b('0x16')],'destinationcontext':_0x40646f[_0xf25b('0x15')],'channel':_0x40646f['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf25b('0x1'),'amaflags':_0xf25b('0x18')};}}catch(_0x1a6675){utils[_0xf25b('0x19')](util['format'](_0xf25b('0x11'),_0x40646f[_0xf25b('0x7')]),_0x1a6675);}};exports['newstate']=function(_0x18eaf9){try{utils[_0xf25b('0x1a')](util['format']('[%s][calls][newstate]',_0x18eaf9['uniqueid']),_0x18eaf9);if(!_[_0xf25b('0x1b')](channels[_0x18eaf9[_0xf25b('0x7')]])&&_0x18eaf9[_0xf25b('0x1c')]==0x6){utils[_0xf25b('0x4')](util[_0xf25b('0x5')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x18eaf9[_0xf25b('0x7')],_0x18eaf9[_0xf25b('0x15')],_0x18eaf9['channel']));if(_[_0xf25b('0x1b')](channels[_0x18eaf9[_0xf25b('0x7')]][_0xf25b('0x1d')])){channels[_0x18eaf9[_0xf25b('0x7')]][_0xf25b('0x1d')]=utils[_0xf25b('0x1e')]();}}else if(!_[_0xf25b('0x1b')](channels[_0x18eaf9['linkedid']])&&_0x18eaf9['channelstate']==0x6&&_0x18eaf9['context']!=_0xf25b('0x1f')){utils['info'](util[_0xf25b('0x5')](_0xf25b('0x20'),_0x18eaf9['uniqueid'],_0x18eaf9['linkedid'],_0x18eaf9['context'],_0x18eaf9[_0xf25b('0x8')]));channels[_0x18eaf9[_0xf25b('0x12')]][_0xf25b('0xb')]=_0x18eaf9['accountcode'];channels[_0x18eaf9[_0xf25b('0x12')]]['destinationchannel']=_0x18eaf9[_0xf25b('0x8')];if(_[_0xf25b('0x1b')](channels[_0x18eaf9['linkedid']][_0xf25b('0x21')])){channels[_0x18eaf9[_0xf25b('0x12')]]['answertime']=utils['now']();}channels[_0x18eaf9[_0xf25b('0x12')]][_0xf25b('0x22')]=dispositions[_['toNumber'](_0x18eaf9[_0xf25b('0x1c')])]||'ANSWERED';}}catch(_0x57f4f1){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x23'),_0x18eaf9[_0xf25b('0x7')]),_0x57f4f1);}};exports[_0xf25b('0x24')]=function(_0x2ce29c){try{if(!_[_0xf25b('0x1b')](channels[_0x2ce29c[_0xf25b('0x7')]])){utils[_0xf25b('0x1a')](util['format']('[%s][calls][hangup]',_0x2ce29c[_0xf25b('0x7')]),_0x2ce29c);if(_[_0xf25b('0x1b')](channels[_0x2ce29c['uniqueid']]['callerid'])){channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x25')]=_0x2ce29c[_0xf25b('0x26')]+'\x20<'+_0x2ce29c[_0xf25b('0x17')]+'>';}utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x27'),_0x2ce29c['uniqueid'],channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x25')],_0x2ce29c['cause-txt']));channels[_0x2ce29c['uniqueid']][_0xf25b('0x28')]=utils['now']();channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x29')]=utils[_0xf25b('0x2a')](channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x28')],channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x2b')]);channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x2c')]=channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x21')]?utils[_0xf25b('0x2a')](channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x28')],channels[_0x2ce29c[_0xf25b('0x7')]][_0xf25b('0x21')]):0x0;writeDB(channels[_0x2ce29c[_0xf25b('0x7')]]);}}catch(_0x1402d1){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x2d'),_0x2ce29c['uniqueid']),_0x1402d1);}};exports['attendedtransfer']=function(_0x54a9c3){try{if(!_[_0xf25b('0x1b')](channels[_0x54a9c3[_0xf25b('0x2e')]])){utils['debug'](util[_0xf25b('0x5')](_0xf25b('0x2f'),_0x54a9c3['origtransfereruniqueid']),_0x54a9c3);if(channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x8')]==_0x54a9c3[_0xf25b('0x30')]){utils[_0xf25b('0x4')](util['format'](_0xf25b('0x31'),_0x54a9c3[_0xf25b('0x32')],_0x54a9c3[_0xf25b('0x2e')],_0x54a9c3['secondtransfererchannel']));channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x33')]=_0x54a9c3[_0xf25b('0x34')];channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x35')]=_0xf25b('0x36');}else if(channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x8')]=_0x54a9c3[_0xf25b('0x37')]){utils['info'](util[_0xf25b('0x5')](_0xf25b('0x31'),_0x54a9c3[_0xf25b('0x32')],_0x54a9c3[_0xf25b('0x2e')],_0x54a9c3['origtransfererchannel']));channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x33')]=_0x54a9c3[_0xf25b('0x38')];channels[_0x54a9c3[_0xf25b('0x2e')]][_0xf25b('0x35')]=_0xf25b('0x36');}}}catch(_0x3b65a2){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x2f'),_0x54a9c3[_0xf25b('0x32')]),_0x3b65a2);}};exports['musiconholdstart']=function(_0x37a7ec){try{if(!_[_0xf25b('0x1b')](channels[_0x37a7ec[_0xf25b('0x7')]])){utils[_0xf25b('0x1a')](util[_0xf25b('0x5')](_0xf25b('0x39'),_0x37a7ec[_0xf25b('0x7')]),_0x37a7ec);channels[_0x37a7ec[_0xf25b('0x7')]]['musiconholdstartAt']=utils[_0xf25b('0x1e')]();utils[_0xf25b('0x4')](util['format'](_0xf25b('0x3a'),_0x37a7ec[_0xf25b('0x7')],channels[_0x37a7ec[_0xf25b('0x7')]]['musiconholdstartAt']));}}catch(_0x15801e){utils[_0xf25b('0x19')](util['format'](_0xf25b('0x39'),_0x37a7ec[_0xf25b('0x7')]),_0x15801e);}};exports[_0xf25b('0x3b')]=function(_0x52276d){try{if(!_['isNil'](channels[_0x52276d[_0xf25b('0x7')]])){utils['debug'](util[_0xf25b('0x5')](_0xf25b('0x3c'),_0x52276d[_0xf25b('0x7')]),_0x52276d);if(!_['isNil'](channels[_0x52276d['uniqueid']][_0xf25b('0x3d')])){channels[_0x52276d[_0xf25b('0x7')]]['mohtime']+=utils['diffTime'](utils[_0xf25b('0x1e')](),channels[_0x52276d[_0xf25b('0x7')]][_0xf25b('0x3d')]);utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x3e'),_0x52276d[_0xf25b('0x7')],channels[_0x52276d[_0xf25b('0x7')]][_0xf25b('0x3f')]));delete channels[_0x52276d[_0xf25b('0x7')]]['musiconholdstartAt'];}}}catch(_0x46ef99){utils['error'](util[_0xf25b('0x5')]('[%s][calls][musiconholdstop]',_0x52276d[_0xf25b('0x7')]),_0x46ef99);}};exports[_0xf25b('0x40')]=function(_0xdb3342){try{if(!_['isNil'](channels[_0xdb3342[_0xf25b('0x7')]])){utils[_0xf25b('0x1a')](util[_0xf25b('0x5')]('[%s][calls][varset]',_0xdb3342[_0xf25b('0x7')]),_0xdb3342);if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x42')])){utils['info'](util[_0xf25b('0x5')](_0xf25b('0x43'),_0xdb3342['uniqueid'],_0xdb3342['value']));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x44')]=_0xdb3342[_0xf25b('0x45')];}if(!_['isNil'](_0xdb3342[_0xf25b('0x41')]['xmd-phone'])){utils['info'](util['format'](_0xf25b('0x46'),_0xdb3342[_0xf25b('0x7')],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x47')]=_0xdb3342[_0xf25b('0x45')];channels[_0xdb3342[_0xf25b('0x7')]]['callerid']='\x22'+_0xdb3342['value']+_0xf25b('0x48')+_0xdb3342[_0xf25b('0x45')]+'>';}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x49')])||!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x4a')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x4b'),_0xdb3342['uniqueid'],!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')]['xmd-callerid-preview'])?_0xf25b('0x49'):_0xf25b('0x4a'),_0xdb3342['value']));channels[_0xdb3342[_0xf25b('0x7')]]['callerid']=_0xdb3342[_0xf25b('0x45')];}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')]['xmd-queue'])||!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x4c')])){utils['info'](util[_0xf25b('0x5')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xdb3342[_0xf25b('0x7')],!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x4d')])?'xmd-queue':_0xf25b('0x4c'),_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x4e')]=_0xf25b('0x4f');channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x50')]=_0xdb3342[_0xf25b('0x45')];channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x51')]=!![];}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x52')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x53'),_0xdb3342[_0xf25b('0x7')],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x54')]=_0xdb3342[_0xf25b('0x45')];}if(!_[_0xf25b('0x1b')](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x55')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xdb3342['uniqueid'],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x56')]=_0xdb3342[_0xf25b('0x45')];}if(!_['isNil'](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x57')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x58'),_0xdb3342['uniqueid'],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342[_0xf25b('0x7')]][_0xf25b('0x59')]=_0xdb3342[_0xf25b('0x45')];}if(!_['isNil'](_0xdb3342[_0xf25b('0x41')][_0xf25b('0x5a')])){utils[_0xf25b('0x4')](util[_0xf25b('0x5')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xdb3342[_0xf25b('0x7')],_0xdb3342[_0xf25b('0x45')]));channels[_0xdb3342['uniqueid']][_0xf25b('0x5a')]=_0xdb3342[_0xf25b('0x45')];}}}catch(_0x195c47){utils[_0xf25b('0x19')](util[_0xf25b('0x5')](_0xf25b('0x5b'),_0xdb3342[_0xf25b('0x7')]),_0x195c47);}};exports[_0xf25b('0x5c')]=function(_0x155fca){try{if(!_[_0xf25b('0x1b')](channels[_0x155fca['uniqueid']])){utils[_0xf25b('0x1a')](util[_0xf25b('0x5')]('[%s][calls][newexten]',_0x155fca[_0xf25b('0x7')]),_0x155fca);utils[_0xf25b('0x4')](util[_0xf25b('0x5')](_0xf25b('0x5d'),_0x155fca[_0xf25b('0x7')],_0x155fca[_0xf25b('0x5e')],_0x155fca[_0xf25b('0x5f')]));if(_0x155fca[_0xf25b('0x5e')][_0xf25b('0x60')]()==_0xf25b('0x61')&&_[_0xf25b('0x62')](_0x155fca[_0xf25b('0x5f')][_0xf25b('0x60')](),'cdr')){var _0x3705c1=_0x155fca[_0xf25b('0x5f')]['split']('=');var _0x46419b=_0x3705c1[0x0][_0xf25b('0x63')](_0x3705c1[0x0][_0xf25b('0x64')]('(')+0x1,_0x3705c1[0x0][_0xf25b('0x64')](')'));var _0x1ec394=_0x3705c1[0x1];channels[_0x155fca[_0xf25b('0x7')]][_0x46419b]=_0x1ec394;}if(!_[_0xf25b('0x65')](['hangup','noop','execif','set',_0xf25b('0x66')],_0x155fca[_0xf25b('0x5e')]['toLowerCase']())){channels[_0x155fca[_0xf25b('0x7')]][_0xf25b('0x4e')]=_0x155fca[_0xf25b('0x5e')];channels[_0x155fca['uniqueid']]['lastdata']=_0x155fca['appdata'];}}}catch(_0x4060b7){utils[_0xf25b('0x19')](util[_0xf25b('0x5')]('[%s][calls][newexten]',_0x155fca[_0xf25b('0x7')]),_0x4060b7);}};
\ No newline at end of file
+var _0xda61=['[%s][calls][musiconholdstop]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','[%s][calls][newexten]','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','FAILED','NO\x20ANSWER','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','[%s][calls][newchannel]','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','DOCUMENTATION','newstate','debug','channelstate','context','isNil','systemanswertime','now','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','[%s][calls][newstate]','hangup','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime'];(function(_0x247225,_0x4125ac){var _0x38da9e=function(_0x2fb0b8){while(--_0x2fb0b8){_0x247225['push'](_0x247225['shift']());}};_0x38da9e(++_0x4125ac);}(_0xda61,0x1c8));var _0x1da6=function(_0x483fc1,_0x57f19d){_0x483fc1=_0x483fc1-0x0;var _0x3a5976=_0xda61[_0x483fc1];return _0x3a5976;};'use strict';var _=require(_0x1da6('0x0'));var util=require(_0x1da6('0x1'));var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0x1da6('0x2'),_0x1da6('0x2'),'NO\x20ANSWER',_0x1da6('0x3'),_0x1da6('0x3'),'ANSWERED',_0x1da6('0x4'),'FAILED','FAILED',_0x1da6('0x2')];var channels={};function writeDB(_0x36be03){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x7'),_0x36be03['uniqueid'],_0x36be03[_0x1da6('0x8')],_0x36be03[_0x1da6('0x9')],_0x36be03['membername'],_0x36be03[_0x1da6('0xa')],_0x36be03['calleridnum'],_0x36be03[_0x1da6('0xb')],_0x36be03[_0x1da6('0xc')]));if(_0x36be03['accountcode']){utils['getUserByInternal'](_0x36be03[_0x1da6('0xd')])['then'](function(_0x5c3bc1){if(_0x5c3bc1){_0x36be03[_0x1da6('0xe')]=_0x5c3bc1['id'];}utils[_0x1da6('0xf')](_0x1da6('0x10'),_0x36be03);});}else{utils[_0x1da6('0xf')](_0x1da6('0x10'),_0x36be03);}if(channels[_0x36be03[_0x1da6('0x11')]]){delete channels[_0x36be03['uniqueid']];}}exports[_0x1da6('0x12')]=function(_0x49d748){try{utils['debug'](util[_0x1da6('0x6')](_0x1da6('0x13'),_0x49d748['uniqueid']),_0x49d748);if(_0x49d748['uniqueid']==_0x49d748['linkedid']&&_0x49d748[_0x1da6('0x8')]!='OutgoingSpoolFailed'){utils['info'](util[_0x1da6('0x6')](_0x1da6('0x14'),_0x49d748['uniqueid'],_0x49d748['context'],_0x49d748[_0x1da6('0x15')]));channels[_0x49d748[_0x1da6('0x11')]]={'uniqueid':_0x49d748[_0x1da6('0x11')],'accountcode':_0x49d748['accountcode'],'source':_0x49d748['calleridnum'],'destination':_0x49d748[_0x1da6('0x15')],'destinationcontext':_0x49d748['context'],'channel':_0x49d748[_0x1da6('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x1da6('0x16')};}}catch(_0x3dbf67){utils['error'](util[_0x1da6('0x6')](_0x1da6('0x13'),_0x49d748[_0x1da6('0x11')]),_0x3dbf67);}};exports[_0x1da6('0x17')]=function(_0x368126){try{utils[_0x1da6('0x18')](util['format']('[%s][calls][newstate]',_0x368126[_0x1da6('0x11')]),_0x368126);if(!_['isNil'](channels[_0x368126[_0x1da6('0x11')]])&&_0x368126[_0x1da6('0x19')]==0x6){utils[_0x1da6('0x5')](util[_0x1da6('0x6')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x368126[_0x1da6('0x11')],_0x368126[_0x1da6('0x1a')],_0x368126[_0x1da6('0x8')]));if(_[_0x1da6('0x1b')](channels[_0x368126[_0x1da6('0x11')]][_0x1da6('0x1c')])){channels[_0x368126['uniqueid']][_0x1da6('0x1c')]=utils[_0x1da6('0x1d')]();}}else if(!_[_0x1da6('0x1b')](channels[_0x368126[_0x1da6('0x1e')]])&&_0x368126['channelstate']==0x6&&_0x368126['context']!=_0x1da6('0x1f')){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x20'),_0x368126[_0x1da6('0x11')],_0x368126[_0x1da6('0x1e')],_0x368126['context'],_0x368126[_0x1da6('0x8')]));channels[_0x368126[_0x1da6('0x1e')]][_0x1da6('0xd')]=_0x368126[_0x1da6('0xd')];channels[_0x368126['linkedid']][_0x1da6('0x21')]=_0x368126['channel'];if(_[_0x1da6('0x1b')](channels[_0x368126[_0x1da6('0x1e')]][_0x1da6('0x22')])){channels[_0x368126[_0x1da6('0x1e')]][_0x1da6('0x22')]=utils[_0x1da6('0x1d')]();}channels[_0x368126[_0x1da6('0x1e')]][_0x1da6('0x23')]=dispositions[_[_0x1da6('0x24')](_0x368126[_0x1da6('0x19')])]||_0x1da6('0x25');}}catch(_0x4dc21b){utils[_0x1da6('0x26')](util[_0x1da6('0x6')](_0x1da6('0x27'),_0x368126[_0x1da6('0x11')]),_0x4dc21b);}};exports[_0x1da6('0x28')]=function(_0x4fc4e4){try{if(!_[_0x1da6('0x1b')](channels[_0x4fc4e4[_0x1da6('0x11')]])){utils[_0x1da6('0x18')](util[_0x1da6('0x6')]('[%s][calls][hangup]',_0x4fc4e4[_0x1da6('0x11')]),_0x4fc4e4);if(_[_0x1da6('0x1b')](channels[_0x4fc4e4[_0x1da6('0x11')]][_0x1da6('0x29')])){channels[_0x4fc4e4[_0x1da6('0x11')]]['callerid']=_0x4fc4e4[_0x1da6('0x2a')]+'\x20<'+_0x4fc4e4[_0x1da6('0x2b')]+'>';}utils['info'](util['format'](_0x1da6('0x2c'),_0x4fc4e4[_0x1da6('0x11')],channels[_0x4fc4e4[_0x1da6('0x11')]][_0x1da6('0x29')],_0x4fc4e4['cause-txt']));channels[_0x4fc4e4['uniqueid']]['endtime']=utils[_0x1da6('0x1d')]();channels[_0x4fc4e4[_0x1da6('0x11')]]['duration']=utils[_0x1da6('0x2d')](channels[_0x4fc4e4[_0x1da6('0x11')]][_0x1da6('0x2e')],channels[_0x4fc4e4[_0x1da6('0x11')]][_0x1da6('0x2f')]);channels[_0x4fc4e4['uniqueid']][_0x1da6('0x30')]=channels[_0x4fc4e4[_0x1da6('0x11')]]['answertime']?utils[_0x1da6('0x2d')](channels[_0x4fc4e4[_0x1da6('0x11')]]['endtime'],channels[_0x4fc4e4[_0x1da6('0x11')]]['answertime']):0x0;writeDB(channels[_0x4fc4e4[_0x1da6('0x11')]]);}}catch(_0x253d7c){utils['error'](util[_0x1da6('0x6')]('[%s][calls][hangup]',_0x4fc4e4[_0x1da6('0x11')]),_0x253d7c);}};exports[_0x1da6('0x31')]=function(_0xb35125){try{if(!_[_0x1da6('0x1b')](channels[_0xb35125[_0x1da6('0x32')]])){utils[_0x1da6('0x18')](util[_0x1da6('0x6')](_0x1da6('0x33'),_0xb35125['origtransfereruniqueid']),_0xb35125);if(channels[_0xb35125['localtwolinkedid']][_0x1da6('0x8')]==_0xb35125['transfereechannel']){utils[_0x1da6('0x5')](util[_0x1da6('0x6')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xb35125[_0x1da6('0x34')],_0xb35125[_0x1da6('0x32')],_0xb35125[_0x1da6('0x35')]));channels[_0xb35125[_0x1da6('0x32')]]['destinationchannel']=_0xb35125['secondtransfererchannel'];channels[_0xb35125[_0x1da6('0x32')]]['userfield']=_0x1da6('0x36');}else if(channels[_0xb35125['localtwolinkedid']][_0x1da6('0x8')]=_0xb35125['transfertargetchannel']){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x37'),_0xb35125[_0x1da6('0x34')],_0xb35125[_0x1da6('0x32')],_0xb35125[_0x1da6('0x38')]));channels[_0xb35125[_0x1da6('0x32')]][_0x1da6('0x21')]=_0xb35125[_0x1da6('0x38')];channels[_0xb35125[_0x1da6('0x32')]]['userfield']='_attended';}}}catch(_0x5e50a5){utils[_0x1da6('0x26')](util[_0x1da6('0x6')](_0x1da6('0x33'),_0xb35125['origtransfereruniqueid']),_0x5e50a5);}};exports[_0x1da6('0x39')]=function(_0x30a5b6){try{if(!_[_0x1da6('0x1b')](channels[_0x30a5b6[_0x1da6('0x11')]])){utils['debug'](util[_0x1da6('0x6')](_0x1da6('0x3a'),_0x30a5b6[_0x1da6('0x11')]),_0x30a5b6);channels[_0x30a5b6[_0x1da6('0x11')]][_0x1da6('0x3b')]=utils[_0x1da6('0x1d')]();utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x3c'),_0x30a5b6[_0x1da6('0x11')],channels[_0x30a5b6[_0x1da6('0x11')]][_0x1da6('0x3b')]));}}catch(_0x4f2dda){utils['error'](util[_0x1da6('0x6')](_0x1da6('0x3a'),_0x30a5b6[_0x1da6('0x11')]),_0x4f2dda);}};exports[_0x1da6('0x3d')]=function(_0x369071){try{if(!_[_0x1da6('0x1b')](channels[_0x369071[_0x1da6('0x11')]])){utils['debug'](util[_0x1da6('0x6')]('[%s][calls][musiconholdstop]',_0x369071[_0x1da6('0x11')]),_0x369071);if(!_[_0x1da6('0x1b')](channels[_0x369071[_0x1da6('0x11')]][_0x1da6('0x3b')])){channels[_0x369071[_0x1da6('0x11')]]['mohtime']+=utils[_0x1da6('0x2d')](utils['now'](),channels[_0x369071[_0x1da6('0x11')]][_0x1da6('0x3b')]);utils['info'](util['format'](_0x1da6('0x3e'),_0x369071[_0x1da6('0x11')],channels[_0x369071['uniqueid']][_0x1da6('0x3f')]));delete channels[_0x369071[_0x1da6('0x11')]][_0x1da6('0x3b')];}}}catch(_0x2611f1){utils[_0x1da6('0x26')](util[_0x1da6('0x6')](_0x1da6('0x40'),_0x369071['uniqueid']),_0x2611f1);}};exports['varset']=function(_0x30d0ef){try{if(!_['isNil'](channels[_0x30d0ef['uniqueid']])){utils['debug'](util[_0x1da6('0x6')]('[%s][calls][varset]',_0x30d0ef['uniqueid']),_0x30d0ef);if(!_[_0x1da6('0x1b')](_0x30d0ef[_0x1da6('0x41')][_0x1da6('0x42')])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x43'),_0x30d0ef['uniqueid'],_0x30d0ef[_0x1da6('0x44')]));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x45')]=_0x30d0ef[_0x1da6('0x44')];}if(!_[_0x1da6('0x1b')](_0x30d0ef['variable']['xmd-phone'])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x30d0ef['uniqueid'],_0x30d0ef[_0x1da6('0x44')]));channels[_0x30d0ef['uniqueid']][_0x1da6('0x46')]=_0x30d0ef['value'];channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x29')]='\x22'+_0x30d0ef[_0x1da6('0x44')]+_0x1da6('0x47')+_0x30d0ef[_0x1da6('0x44')]+'>';}if(!_['isNil'](_0x30d0ef['variable']['xmd-callerid-preview'])||!_[_0x1da6('0x1b')](_0x30d0ef['variable'][_0x1da6('0x48')])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x49'),_0x30d0ef[_0x1da6('0x11')],!_[_0x1da6('0x1b')](_0x30d0ef['variable'][_0x1da6('0x4a')])?'xmd-callerid-preview':_0x1da6('0x48'),_0x30d0ef[_0x1da6('0x44')]));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x29')]=_0x30d0ef[_0x1da6('0x44')];}if(!_[_0x1da6('0x1b')](_0x30d0ef['variable']['xmd-queue'])||!_[_0x1da6('0x1b')](_0x30d0ef[_0x1da6('0x41')]['xmcs-queue'])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x49'),_0x30d0ef[_0x1da6('0x11')],!_['isNil'](_0x30d0ef[_0x1da6('0x41')][_0x1da6('0x4b')])?_0x1da6('0x4b'):_0x1da6('0x4c'),_0x30d0ef[_0x1da6('0x44')]));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x4d')]=_0x1da6('0x4e');channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x4f')]=_0x30d0ef[_0x1da6('0x44')];channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x9')]=!![];}if(!_[_0x1da6('0x1b')](_0x30d0ef[_0x1da6('0x41')][_0x1da6('0x50')])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x51'),_0x30d0ef[_0x1da6('0x11')],_0x30d0ef[_0x1da6('0x44')]));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x52')]=_0x30d0ef[_0x1da6('0x44')];}if(!_[_0x1da6('0x1b')](_0x30d0ef[_0x1da6('0x41')][_0x1da6('0x53')])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x54'),_0x30d0ef['uniqueid'],_0x30d0ef['value']));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x55')]=_0x30d0ef['value'];}if(!_[_0x1da6('0x1b')](_0x30d0ef[_0x1da6('0x41')][_0x1da6('0x56')])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x30d0ef['uniqueid'],_0x30d0ef['value']));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x57')]=_0x30d0ef['value'];}if(!_['isNil'](_0x30d0ef[_0x1da6('0x41')]['sipcallid'])){utils[_0x1da6('0x5')](util[_0x1da6('0x6')](_0x1da6('0x58'),_0x30d0ef[_0x1da6('0x11')],_0x30d0ef[_0x1da6('0x44')]));channels[_0x30d0ef[_0x1da6('0x11')]][_0x1da6('0x59')]=_0x30d0ef[_0x1da6('0x44')];}}}catch(_0x10c1c4){utils['error'](util['format'](_0x1da6('0x5a'),_0x30d0ef[_0x1da6('0x11')]),_0x10c1c4);}};exports['newexten']=function(_0x186f0e){try{if(!_['isNil'](channels[_0x186f0e[_0x1da6('0x11')]])){utils[_0x1da6('0x18')](util[_0x1da6('0x6')](_0x1da6('0x5b'),_0x186f0e[_0x1da6('0x11')]),_0x186f0e);utils[_0x1da6('0x5')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x186f0e[_0x1da6('0x11')],_0x186f0e[_0x1da6('0x5c')],_0x186f0e['appdata']));if(_0x186f0e[_0x1da6('0x5c')][_0x1da6('0x5d')]()==_0x1da6('0x5e')&&_[_0x1da6('0x5f')](_0x186f0e[_0x1da6('0x60')][_0x1da6('0x5d')](),'cdr')){var _0x4f5423=_0x186f0e[_0x1da6('0x60')][_0x1da6('0x61')]('=');var _0x314300=_0x4f5423[0x0][_0x1da6('0x62')](_0x4f5423[0x0][_0x1da6('0x63')]('(')+0x1,_0x4f5423[0x0]['lastIndexOf'](')'));var _0x57cd5d=_0x4f5423[0x1];channels[_0x186f0e[_0x1da6('0x11')]][_0x314300]=_0x57cd5d;}if(!_[_0x1da6('0x64')]([_0x1da6('0x28'),_0x1da6('0x65'),_0x1da6('0x66'),_0x1da6('0x5e'),_0x1da6('0x67')],_0x186f0e[_0x1da6('0x5c')]['toLowerCase']())){channels[_0x186f0e[_0x1da6('0x11')]]['lastapplication']=_0x186f0e['application'];channels[_0x186f0e[_0x1da6('0x11')]][_0x1da6('0x4f')]=_0x186f0e['appdata'];}}}catch(_0x5ab3ea){utils[_0x1da6('0x26')](util[_0x1da6('0x6')](_0x1da6('0x5b'),_0x186f0e[_0x1da6('0x11')]),_0x5ab3ea);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a94=['[core]\x20close','./utils','connect','[core]\x20connected','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close'];(function(_0x38605a,_0xf8d5e5){var _0x2221f4=function(_0x3e3fa9){while(--_0x3e3fa9){_0x38605a['push'](_0x38605a['shift']());}};_0x2221f4(++_0xf8d5e5);}(_0x3a94,0x105));var _0x43a9=function(_0x464be4,_0x473a1e){_0x464be4=_0x464be4-0x0;var _0x4c597c=_0x3a94[_0x464be4];return _0x4c597c;};'use strict';var utils=require(_0x43a9('0x0'));exports[_0x43a9('0x1')]=function(){utils['info'](_0x43a9('0x2'));};exports['shutdown']=function(){utils[_0x43a9('0x3')](_0x43a9('0x4'));};exports[_0x43a9('0x5')]=function(){utils['info'](_0x43a9('0x6'));};exports[_0x43a9('0x7')]=function(_0x51fcea){utils[_0x43a9('0x7')]('[core]\x20error',_0x51fcea);};exports[_0x43a9('0x8')]=function(){utils[_0x43a9('0x3')](_0x43a9('0x9'));};exports['managerevent']=function(_0x4d266d){};
\ No newline at end of file
+var _0x9821=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','info'];(function(_0x12edf2,_0x9445de){var _0x73a828=function(_0x3ec3a4){while(--_0x3ec3a4){_0x12edf2['push'](_0x12edf2['shift']());}};_0x73a828(++_0x9445de);}(_0x9821,0x1b7));var _0x1982=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x9821[_0x5a3cf0];return _0x5a64ee;};'use strict';var utils=require(_0x1982('0x0'));exports['connect']=function(){utils[_0x1982('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x1982('0x1')](_0x1982('0x2'));};exports[_0x1982('0x3')]=function(){utils[_0x1982('0x1')](_0x1982('0x4'));};exports[_0x1982('0x5')]=function(_0x25d789){utils[_0x1982('0x5')](_0x1982('0x6'),_0x25d789);};exports[_0x1982('0x7')]=function(){utils[_0x1982('0x1')](_0x1982('0x8'));};exports['managerevent']=function(_0x1c7ed5){};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x419b=['split','error','varset','[%s][dials][varset]','isNil','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)'];(function(_0x1dcb7b,_0x44cc17){var _0x1e7ff7=function(_0x5e2971){while(--_0x5e2971){_0x1dcb7b['push'](_0x1dcb7b['shift']());}};_0x1e7ff7(++_0x44cc17);}(_0x419b,0x150));var _0xb419=function(_0x27f53b,_0x7d7bc){_0x27f53b=_0x27f53b-0x0;var _0x4d5aa7=_0x419b[_0x27f53b];return _0x4d5aa7;};'use strict';var _=require(_0xb419('0x0'));var util=require(_0xb419('0x1'));var utils=require(_0xb419('0x2'));var dials={};function writeDB(_0xd2368b){utils['info'](util[_0xb419('0x3')](_0xb419('0x4'),_0xd2368b[_0xb419('0x5')],_0xd2368b[_0xb419('0x6')],_0xd2368b[_0xb419('0x7')],_0xd2368b[_0xb419('0x8')],_0xd2368b[_0xb419('0x9')],_0xd2368b[_0xb419('0xa')]));utils['request'](_0xb419('0xb'),_0xd2368b);delete dials[_0xd2368b['uniqueid']];}exports[_0xb419('0xc')]=function(_0x1ac981){try{utils[_0xb419('0xd')](util[_0xb419('0x3')](_0xb419('0xe'),_0x1ac981[_0xb419('0x5')]),_0x1ac981);utils['info'](util[_0xb419('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1ac981[_0xb419('0x5')],_0x1ac981[_0xb419('0xf')],_0x1ac981[_0xb419('0x10')]));if(_0x1ac981[_0xb419('0xf')][_0xb419('0x11')]()==_0xb419('0x12')&&_[_0xb419('0x13')](_0x1ac981[_0xb419('0x10')][_0xb419('0x11')](),_0xb419('0x14'))){var _0x508898=_0x1ac981[_0xb419('0x10')][_0xb419('0x15')]('=');dials[_0x1ac981[_0xb419('0x5')]]={'routeId':_0x508898[0x1]};}}catch(_0x557113){utils[_0xb419('0x16')](util[_0xb419('0x3')](_0xb419('0xe'),_0x1ac981[_0xb419('0x5')]),_0x557113);}};exports[_0xb419('0x17')]=function(_0x346e92){try{utils[_0xb419('0xd')](util[_0xb419('0x3')](_0xb419('0x18'),_0x346e92['uniqueid']),_0x346e92);if(!_[_0xb419('0x19')](_0x346e92['variable']['outboundrouteid'])){utils[_0xb419('0x1a')](util['format'](_0xb419('0x1b'),_0x346e92[_0xb419('0x5')],_0x346e92[_0xb419('0x1c')]));dials[_0x346e92['uniqueid']]={'routeId':_0x346e92['value']};}}catch(_0x13fcd){utils[_0xb419('0x16')](util['format'](_0xb419('0x18'),_0x346e92[_0xb419('0x5')]),_0x13fcd);}};exports['dialbegin']=function(_0x2eb854){try{if(!_[_0xb419('0x19')](dials[_0x2eb854['uniqueid']])){utils[_0xb419('0xd')](util['format'](_0xb419('0x1d'),_0x2eb854[_0xb419('0x5')]),_0x2eb854);dials[_0x2eb854[_0xb419('0x5')]]=_[_0xb419('0x1e')](dials[_0x2eb854[_0xb419('0x5')]],_0x2eb854);dials[_0x2eb854[_0xb419('0x5')]]['starttime']=utils[_0xb419('0x1f')]();dials[_0x2eb854[_0xb419('0x5')]]['lastevent']=_0xb419('0x20');utils[_0xb419('0x1a')](util['format'](_0xb419('0x21'),_0x2eb854['uniqueid'],dials[_0x2eb854[_0xb419('0x5')]][_0xb419('0x22')]));}}catch(_0x1ada0c){utils[_0xb419('0x16')](util[_0xb419('0x3')](_0xb419('0x1d'),_0x2eb854[_0xb419('0x5')]),_0x1ada0c);}};exports[_0xb419('0x23')]=function(_0x4561bf){try{if(!_[_0xb419('0x19')](dials[_0x4561bf[_0xb419('0x5')]])){utils[_0xb419('0xd')](util['format'](_0xb419('0x24'),_0x4561bf[_0xb419('0x5')]),_0x4561bf);dials[_0x4561bf[_0xb419('0x5')]][_0xb419('0xa')]=_0x4561bf[_0xb419('0xa')];if(_0x4561bf[_0xb419('0xa')]==_0xb419('0x25')){dials[_0x4561bf[_0xb419('0x5')]]=_[_0xb419('0x1e')](dials[_0x4561bf['uniqueid']],_0x4561bf);dials[_0x4561bf[_0xb419('0x5')]]['answertime']=utils[_0xb419('0x1f')]();dials[_0x4561bf[_0xb419('0x5')]]['lastevent']=_0xb419('0x26');utils[_0xb419('0x1a')](util[_0xb419('0x3')](_0xb419('0x27'),_0x4561bf['uniqueid'],_0x4561bf[_0xb419('0xa')],dials[_0x4561bf[_0xb419('0x5')]][_0xb419('0x28')]));}else{utils['info'](util[_0xb419('0x3')](_0xb419('0x29'),_0x4561bf[_0xb419('0x5')],_0x4561bf[_0xb419('0xa')]));}}}catch(_0xc69df2){utils[_0xb419('0x16')](util[_0xb419('0x3')](_0xb419('0x24'),_0x4561bf['uniqueid']),_0xc69df2);}};exports['hangup']=function(_0x23a6d5){try{if(!_[_0xb419('0x19')](dials[_0x23a6d5[_0xb419('0x5')]])){utils[_0xb419('0xd')](util[_0xb419('0x3')](_0xb419('0x2a'),_0x23a6d5[_0xb419('0x5')]),_0x23a6d5);utils[_0xb419('0x1a')](util[_0xb419('0x3')](_0xb419('0x2b'),_0x23a6d5[_0xb419('0x5')],_0x23a6d5['calleridnum'],_0x23a6d5['calleridname'],_0x23a6d5[_0xb419('0x2c')]));dials[_0x23a6d5[_0xb419('0x5')]]=_[_0xb419('0x1e')](dials[_0x23a6d5[_0xb419('0x5')]],{'endtime':utils[_0xb419('0x1f')](),'lastevent':_0xb419('0x2d')});dials[_0x23a6d5['uniqueid']][_0xb419('0x2e')]=utils[_0xb419('0x2f')](dials[_0x23a6d5['uniqueid']][_0xb419('0x30')],dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x22')]);dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x31')]=utils[_0xb419('0x2f')](dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x28')]||dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x30')],dials[_0x23a6d5['uniqueid']][_0xb419('0x22')]);dials[_0x23a6d5['uniqueid']][_0xb419('0x32')]=dials[_0x23a6d5['uniqueid']][_0xb419('0x28')]?utils[_0xb419('0x2f')](dials[_0x23a6d5[_0xb419('0x5')]][_0xb419('0x30')],dials[_0x23a6d5['uniqueid']]['answertime']):0x0;writeDB(dials[_0x23a6d5[_0xb419('0x5')]]);}}catch(_0x56a491){utils[_0xb419('0x16')](util['format'](_0xb419('0x2a'),_0x23a6d5[_0xb419('0x5')]),_0x56a491);}};
\ No newline at end of file
+var _0x0aae=['[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','duration','diffTime','endtime','holdtime','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x0aae,0xb9));var _0xe0aa=function(_0xfd0f9e,_0x471aeb){_0xfd0f9e=_0xfd0f9e-0x0;var _0x59ebce=_0x0aae[_0xfd0f9e];return _0x59ebce;};'use strict';var _=require('lodash');var util=require(_0xe0aa('0x0'));var utils=require(_0xe0aa('0x1'));var dials={};function writeDB(_0x21665b){utils['info'](util[_0xe0aa('0x2')](_0xe0aa('0x3'),_0x21665b[_0xe0aa('0x4')],_0x21665b[_0xe0aa('0x5')],_0x21665b[_0xe0aa('0x6')],_0x21665b['calleridnum'],_0x21665b['connectedlinenum'],_0x21665b[_0xe0aa('0x7')]));utils['request'](_0xe0aa('0x8'),_0x21665b);delete dials[_0x21665b[_0xe0aa('0x4')]];}exports[_0xe0aa('0x9')]=function(_0x297501){try{utils[_0xe0aa('0xa')](util[_0xe0aa('0x2')](_0xe0aa('0xb'),_0x297501[_0xe0aa('0x4')]),_0x297501);utils[_0xe0aa('0xc')](util['format'](_0xe0aa('0xd'),_0x297501[_0xe0aa('0x4')],_0x297501[_0xe0aa('0xe')],_0x297501[_0xe0aa('0xf')]));if(_0x297501['application'][_0xe0aa('0x10')]()==_0xe0aa('0x11')&&_[_0xe0aa('0x12')](_0x297501[_0xe0aa('0xf')][_0xe0aa('0x10')](),_0xe0aa('0x13'))){var _0x43eb8e=_0x297501[_0xe0aa('0xf')][_0xe0aa('0x14')]('=');dials[_0x297501[_0xe0aa('0x4')]]={'routeId':_0x43eb8e[0x1]};}}catch(_0x2d3ef8){utils[_0xe0aa('0x15')](util['format'](_0xe0aa('0xb'),_0x297501[_0xe0aa('0x4')]),_0x2d3ef8);}};exports[_0xe0aa('0x16')]=function(_0x423c33){try{utils['debug'](util[_0xe0aa('0x2')](_0xe0aa('0x17'),_0x423c33[_0xe0aa('0x4')]),_0x423c33);if(!_[_0xe0aa('0x18')](_0x423c33[_0xe0aa('0x19')][_0xe0aa('0x1a')])){utils[_0xe0aa('0xc')](util[_0xe0aa('0x2')](_0xe0aa('0x1b'),_0x423c33['uniqueid'],_0x423c33['value']));dials[_0x423c33['uniqueid']]={'routeId':_0x423c33['value']};}}catch(_0x5718e7){utils[_0xe0aa('0x15')](util[_0xe0aa('0x2')](_0xe0aa('0x17'),_0x423c33[_0xe0aa('0x4')]),_0x5718e7);}};exports[_0xe0aa('0x1c')]=function(_0x132e5f){try{if(!_[_0xe0aa('0x18')](dials[_0x132e5f[_0xe0aa('0x4')]])){utils[_0xe0aa('0xa')](util[_0xe0aa('0x2')](_0xe0aa('0x1d'),_0x132e5f[_0xe0aa('0x4')]),_0x132e5f);dials[_0x132e5f[_0xe0aa('0x4')]]=_[_0xe0aa('0x1e')](dials[_0x132e5f[_0xe0aa('0x4')]],_0x132e5f);dials[_0x132e5f[_0xe0aa('0x4')]][_0xe0aa('0x1f')]=utils[_0xe0aa('0x20')]();dials[_0x132e5f[_0xe0aa('0x4')]][_0xe0aa('0x21')]=_0xe0aa('0x22');utils[_0xe0aa('0xc')](util[_0xe0aa('0x2')](_0xe0aa('0x23'),_0x132e5f[_0xe0aa('0x4')],dials[_0x132e5f['uniqueid']][_0xe0aa('0x1f')]));}}catch(_0xfa96e8){utils[_0xe0aa('0x15')](util[_0xe0aa('0x2')]('[%s][dials][dialbegin]',_0x132e5f['uniqueid']),_0xfa96e8);}};exports['dialend']=function(_0x5f0d29){try{if(!_[_0xe0aa('0x18')](dials[_0x5f0d29['uniqueid']])){utils[_0xe0aa('0xa')](util[_0xe0aa('0x2')](_0xe0aa('0x24'),_0x5f0d29[_0xe0aa('0x4')]),_0x5f0d29);dials[_0x5f0d29[_0xe0aa('0x4')]]['dialstatus']=_0x5f0d29[_0xe0aa('0x7')];if(_0x5f0d29[_0xe0aa('0x7')]==_0xe0aa('0x25')){dials[_0x5f0d29[_0xe0aa('0x4')]]=_[_0xe0aa('0x1e')](dials[_0x5f0d29['uniqueid']],_0x5f0d29);dials[_0x5f0d29[_0xe0aa('0x4')]]['answertime']=utils[_0xe0aa('0x20')]();dials[_0x5f0d29[_0xe0aa('0x4')]][_0xe0aa('0x21')]=_0xe0aa('0x26');utils[_0xe0aa('0xc')](util[_0xe0aa('0x2')](_0xe0aa('0x27'),_0x5f0d29[_0xe0aa('0x4')],_0x5f0d29['dialstatus'],dials[_0x5f0d29[_0xe0aa('0x4')]][_0xe0aa('0x28')]));}else{utils[_0xe0aa('0xc')](util[_0xe0aa('0x2')](_0xe0aa('0x29'),_0x5f0d29[_0xe0aa('0x4')],_0x5f0d29[_0xe0aa('0x7')]));}}}catch(_0xfa4695){utils[_0xe0aa('0x15')](util[_0xe0aa('0x2')](_0xe0aa('0x24'),_0x5f0d29[_0xe0aa('0x4')]),_0xfa4695);}};exports[_0xe0aa('0x2a')]=function(_0x1fd041){try{if(!_['isNil'](dials[_0x1fd041[_0xe0aa('0x4')]])){utils[_0xe0aa('0xa')](util[_0xe0aa('0x2')](_0xe0aa('0x2b'),_0x1fd041[_0xe0aa('0x4')]),_0x1fd041);utils[_0xe0aa('0xc')](util['format'](_0xe0aa('0x2c'),_0x1fd041[_0xe0aa('0x4')],_0x1fd041[_0xe0aa('0x2d')],_0x1fd041[_0xe0aa('0x2e')],_0x1fd041[_0xe0aa('0x2f')]));dials[_0x1fd041[_0xe0aa('0x4')]]=_[_0xe0aa('0x1e')](dials[_0x1fd041[_0xe0aa('0x4')]],{'endtime':utils[_0xe0aa('0x20')](),'lastevent':'complete'});dials[_0x1fd041['uniqueid']][_0xe0aa('0x30')]=utils[_0xe0aa('0x31')](dials[_0x1fd041[_0xe0aa('0x4')]][_0xe0aa('0x32')],dials[_0x1fd041[_0xe0aa('0x4')]][_0xe0aa('0x1f')]);dials[_0x1fd041[_0xe0aa('0x4')]][_0xe0aa('0x33')]=utils[_0xe0aa('0x31')](dials[_0x1fd041[_0xe0aa('0x4')]][_0xe0aa('0x28')]||dials[_0x1fd041['uniqueid']][_0xe0aa('0x32')],dials[_0x1fd041[_0xe0aa('0x4')]][_0xe0aa('0x1f')]);dials[_0x1fd041[_0xe0aa('0x4')]]['billableseconds']=dials[_0x1fd041[_0xe0aa('0x4')]][_0xe0aa('0x28')]?utils[_0xe0aa('0x31')](dials[_0x1fd041[_0xe0aa('0x4')]]['endtime'],dials[_0x1fd041['uniqueid']]['answertime']):0x0;writeDB(dials[_0x1fd041[_0xe0aa('0x4')]]);}}catch(_0x50a2a3){utils[_0xe0aa('0x15')](util[_0xe0aa('0x2')](_0xe0aa('0x2b'),_0x1fd041[_0xe0aa('0x4')]),_0x50a2a3);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd5b4=['[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','xdr','disabled','production','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave'];(function(_0x4d1a49,_0x410b1f){var _0x27ef12=function(_0x54fe7a){while(--_0x54fe7a){_0x4d1a49['push'](_0x4d1a49['shift']());}};_0x27ef12(++_0x410b1f);}(_0xd5b4,0x1bd));var _0x4d5b=function(_0x18dc0f,_0x4d095a){_0x18dc0f=_0x18dc0f-0x0;var _0x5f2b3a=_0xd5b4[_0x18dc0f];return _0x5f2b3a;};var AsteriskManager=require(_0x4d5b('0x0'));var config=require(_0x4d5b('0x1'));var utils=require(_0x4d5b('0x2'));var util=require('util');var isXDREnabled=config[_0x4d5b('0x3')]&&config['xdr']['disabled']?!config[_0x4d5b('0x3')][_0x4d5b('0x4')]:!![];var isProduction=config['env']===_0x4d5b('0x5')||![];var isLocalAsterisk=config[_0x4d5b('0x3')]&&config[_0x4d5b('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x4d5b('0x6')][_0x4d5b('0x7')],config[_0x4d5b('0x6')]['ip'],config[_0x4d5b('0x6')][_0x4d5b('0x8')],config[_0x4d5b('0x6')]['password'],!![]);ami[_0x4d5b('0x9')]();if(!isXDREnabled){utils[_0x4d5b('0xa')](_0x4d5b('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x4d5b('0xa')](_0x4d5b('0xc'));}else{var agents=require(_0x4d5b('0xd'));var calls=require(_0x4d5b('0xe'));var queues=require(_0x4d5b('0xf'));var recordings=require(_0x4d5b('0x10'));var members=require(_0x4d5b('0x11'));var dials=require(_0x4d5b('0x12'));var transfers=require(_0x4d5b('0x13'));var core=require(_0x4d5b('0x14'));ami['on'](_0x4d5b('0x15'),core['connect']);ami['on'](_0x4d5b('0x16'),core[_0x4d5b('0x16')]);ami['on'](_0x4d5b('0x17'),core['fullybooted']);ami['on'](_0x4d5b('0x18'),core[_0x4d5b('0x18')]);ami['on'](_0x4d5b('0x19'),core[_0x4d5b('0x19')]);ami['on'](_0x4d5b('0x1a'),core['managerevent']);ami['on'](_0x4d5b('0x1b'),function(_0x375327){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][devicestatechange]',_0x375327[_0x4d5b('0x1e')]),_0x375327);members[_0x4d5b('0x1b')](_0x375327);}catch(_0x122f78){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x1f'),_0x375327[_0x4d5b('0x1e')]),_0x122f78);}});ami['on'](_0x4d5b('0x20'),function(_0x1f6d6c){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x21'),_0x1f6d6c['uniqueid']),_0x1f6d6c);agents[_0x4d5b('0x20')](_0x1f6d6c);}catch(_0x4c67f7){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x21'),_0x1f6d6c[_0x4d5b('0x22')]),_0x4c67f7);}});ami['on']('agentringnoanswer',function(_0xcfaae0){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x23'),_0xcfaae0[_0x4d5b('0x22')]),_0xcfaae0);agents[_0x4d5b('0x24')](_0xcfaae0);}catch(_0x12a330){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x23'),_0xcfaae0[_0x4d5b('0x22')]),_0x12a330);}});ami['on']('agentconnect',function(_0x170331){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x25'),_0x170331['uniqueid']),_0x170331);agents[_0x4d5b('0x26')](_0x170331);queues[_0x4d5b('0x26')](_0x170331);}catch(_0x21345b){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x25'),_0x170331['uniqueid']),_0x21345b);}});ami['on'](_0x4d5b('0x27'),function(_0x4d2636){try{utils['debug'](util[_0x4d5b('0x1d')]('[%s][index][agentcomplete]',_0x4d2636[_0x4d5b('0x22')]),_0x4d2636);agents['agentcomplete'](_0x4d2636);queues[_0x4d5b('0x27')](_0x4d2636);members['agentcomplete'](_0x4d2636);}catch(_0x542674){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x28'),_0x4d2636[_0x4d5b('0x22')]),_0x542674);}});ami['on'](_0x4d5b('0x29'),function(_0x998825){try{utils['debug'](util[_0x4d5b('0x1d')](_0x4d5b('0x2a'),_0x998825['uniqueid']),_0x998825);agents['queuecallerabandon'](_0x998825);queues[_0x4d5b('0x29')](_0x998825);}catch(_0x1e318c){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x2a'),_0x998825[_0x4d5b('0x22')]),_0x1e318c);}});ami['on'](_0x4d5b('0x2b'),function(_0x4dc804){try{utils['debug'](util['format']('[%s][index][queuecallerjoin]',_0x4dc804['uniqueid']),_0x4dc804);queues[_0x4d5b('0x2b')](_0x4dc804);recordings[_0x4d5b('0x2b')](_0x4dc804);}catch(_0x1d16af){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s][index][queuecallerjoin]',_0x4dc804[_0x4d5b('0x22')]),_0x1d16af);}});ami['on'](_0x4d5b('0x2c'),function(_0x3009ac){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x2d'),_0x3009ac['uniqueid']),_0x3009ac);queues[_0x4d5b('0x2c')](_0x3009ac);}catch(_0x360d62){utils[_0x4d5b('0x18')](util['format'](_0x4d5b('0x2d'),_0x3009ac[_0x4d5b('0x22')]),_0x360d62);}});ami['on'](_0x4d5b('0x2e'),function(_0x487465){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][musiconholdstart]',_0x487465[_0x4d5b('0x22')]),_0x487465);queues[_0x4d5b('0x2e')](_0x487465);calls[_0x4d5b('0x2e')](_0x487465);}catch(_0x34147e){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s][index][musiconholdstart]',_0x487465[_0x4d5b('0x22')]),_0x34147e);}});ami['on'](_0x4d5b('0x2f'),function(_0x5b1b45){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x30'),_0x5b1b45[_0x4d5b('0x22')]),_0x5b1b45);queues['musiconholdstop'](_0x5b1b45);calls[_0x4d5b('0x2f')](_0x5b1b45);}catch(_0x3ab6f3){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x30'),_0x5b1b45[_0x4d5b('0x22')]),_0x3ab6f3);}});ami['on'](_0x4d5b('0x31'),function(_0x2725ac){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][newstate]',_0x2725ac['uniqueid']),_0x2725ac);calls[_0x4d5b('0x31')](_0x2725ac);recordings['newstate'](_0x2725ac);}catch(_0x110d23){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x32'),_0x2725ac['uniqueid']),_0x110d23);}});ami['on'](_0x4d5b('0x33'),function(_0xf0fe21){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x34'),_0xf0fe21[_0x4d5b('0x22')]),_0xf0fe21);calls['hangup'](_0xf0fe21);recordings[_0x4d5b('0x33')](_0xf0fe21);dials[_0x4d5b('0x33')](_0xf0fe21);agents['hangup'](_0xf0fe21);queues[_0x4d5b('0x33')](_0xf0fe21);}catch(_0x48d574){utils[_0x4d5b('0x18')](util['format'](_0x4d5b('0x34'),_0xf0fe21[_0x4d5b('0x22')]),_0x48d574);}});ami['on'](_0x4d5b('0x35'),function(_0xc86b4d){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][cdr]',_0xc86b4d[_0x4d5b('0x22')]),_0xc86b4d);members[_0x4d5b('0x35')](_0xc86b4d);}catch(_0x110c28){utils['error'](util[_0x4d5b('0x1d')](_0x4d5b('0x36'),_0xc86b4d['uniqueid']),_0x110c28);}});ami['on'](_0x4d5b('0x37'),function(_0x730768){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x38'),_0x730768[_0x4d5b('0x22')]),_0x730768);queues['blindtransfer'](_0x730768);agents[_0x4d5b('0x37')](_0x730768);transfers[_0x4d5b('0x37')](_0x730768);}catch(_0x28b0e2){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x38'),_0x730768[_0x4d5b('0x22')]),_0x28b0e2);}});ami['on'](_0x4d5b('0x39'),function(_0x5cca36){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x3a'),_0x5cca36[_0x4d5b('0x3b')]),_0x5cca36);queues[_0x4d5b('0x39')](_0x5cca36);transfers['attendedtransfer'](_0x5cca36);agents[_0x4d5b('0x39')](_0x5cca36);calls[_0x4d5b('0x39')](_0x5cca36);}catch(_0x496f36){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s][index][attendedtransfer]',_0x5cca36[_0x4d5b('0x3b')]),_0x496f36);}});ami['on']('varset',function(_0xf5f438){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x3c'),_0xf5f438[_0x4d5b('0x22')]),_0xf5f438);queues['varset'](_0xf5f438);recordings[_0x4d5b('0x3d')](_0xf5f438);calls[_0x4d5b('0x3d')](_0xf5f438);dials[_0x4d5b('0x3d')](_0xf5f438);}catch(_0x53dc42){utils[_0x4d5b('0x18')](util['format'](_0x4d5b('0x3c'),_0xf5f438[_0x4d5b('0x22')]),_0x53dc42);}});ami['on'](_0x4d5b('0x3e'),function(_0xf1efac){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x3f'),_0xf1efac[_0x4d5b('0x22')]),_0xf1efac);calls[_0x4d5b('0x3e')](_0xf1efac);recordings['newexten'](_0xf1efac);dials[_0x4d5b('0x3e')](_0xf1efac);}catch(_0x44d404){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')](_0x4d5b('0x3f'),_0xf1efac[_0x4d5b('0x22')]),_0x44d404);}});ami['on']('newchannel',function(_0x3954c3){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')]('[%s][index][newchannel]',_0x3954c3[_0x4d5b('0x22')]),_0x3954c3);calls[_0x4d5b('0x40')](_0x3954c3);recordings['newchannel'](_0x3954c3);}catch(_0xf97ae2){utils['error'](util['format'](_0x4d5b('0x41'),_0x3954c3[_0x4d5b('0x22')]),_0xf97ae2);}});ami['on'](_0x4d5b('0x42'),function(_0x5292f2){try{utils[_0x4d5b('0x1c')](util['format'](_0x4d5b('0x43'),_0x5292f2[_0x4d5b('0x22')]),_0x5292f2);dials[_0x4d5b('0x42')](_0x5292f2);}catch(_0x4dbcfa){utils[_0x4d5b('0x18')](util[_0x4d5b('0x1d')]('[%s]dialbegin',_0x5292f2[_0x4d5b('0x22')]),_0x4dbcfa);}});ami['on']('dialend',function(_0xeb9594){try{utils[_0x4d5b('0x1c')](util[_0x4d5b('0x1d')](_0x4d5b('0x44'),_0xeb9594[_0x4d5b('0x22')]),_0xeb9594);dials[_0x4d5b('0x45')](_0xeb9594);}catch(_0x1c61f6){utils['error'](util[_0x4d5b('0x1d')]('[%s][index][dialend]',_0xeb9594[_0x4d5b('0x22')]),_0x1c61f6);}});}
\ No newline at end of file
+var _0xa81d=['uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','device'];(function(_0x24e811,_0x2c0ae3){var _0x2b78bc=function(_0x52b858){while(--_0x52b858){_0x24e811['push'](_0x24e811['shift']());}};_0x2b78bc(++_0x2c0ae3);}(_0xa81d,0x196));var _0xda81=function(_0x2635b8,_0x5938ec){_0x2635b8=_0x2635b8-0x0;var _0x35f950=_0xa81d[_0x2635b8];return _0x35f950;};var AsteriskManager=require(_0xda81('0x0'));var config=require(_0xda81('0x1'));var utils=require('./utils');var util=require(_0xda81('0x2'));var isXDREnabled=config[_0xda81('0x3')]&&config[_0xda81('0x3')][_0xda81('0x4')]?!config[_0xda81('0x3')][_0xda81('0x4')]:!![];var isProduction=config[_0xda81('0x5')]===_0xda81('0x6')||![];var isLocalAsterisk=config[_0xda81('0x3')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0xda81('0x7')][_0xda81('0x8')],config[_0xda81('0x7')]['ip'],config[_0xda81('0x7')][_0xda81('0x9')],config[_0xda81('0x7')][_0xda81('0xa')],!![]);ami[_0xda81('0xb')]();if(!isXDREnabled){utils[_0xda81('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xda81('0xc')](_0xda81('0xd'));}else{var agents=require(_0xda81('0xe'));var calls=require(_0xda81('0xf'));var queues=require(_0xda81('0x10'));var recordings=require(_0xda81('0x11'));var members=require(_0xda81('0x12'));var dials=require(_0xda81('0x13'));var transfers=require('./transfers.controller');var core=require(_0xda81('0x14'));ami['on'](_0xda81('0x15'),core['connect']);ami['on'](_0xda81('0x16'),core[_0xda81('0x16')]);ami['on'](_0xda81('0x17'),core[_0xda81('0x17')]);ami['on'](_0xda81('0x18'),core[_0xda81('0x18')]);ami['on'](_0xda81('0x19'),core['close']);ami['on'](_0xda81('0x1a'),core['managerevent']);ami['on']('devicestatechange',function(_0x37418a){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x1d'),_0x37418a['device']),_0x37418a);members[_0xda81('0x1e')](_0x37418a);}catch(_0x4f82fa){utils[_0xda81('0x18')](util[_0xda81('0x1c')]('[%s][index][devicestatechange]',_0x37418a[_0xda81('0x1f')]),_0x4f82fa);}});ami['on']('agentcalled',function(_0x3d3cf0){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')]('[%s][index][agentcalled]',_0x3d3cf0[_0xda81('0x20')]),_0x3d3cf0);agents[_0xda81('0x21')](_0x3d3cf0);}catch(_0x40008a){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x22'),_0x3d3cf0[_0xda81('0x20')]),_0x40008a);}});ami['on']('agentringnoanswer',function(_0x2c8fcd){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')]('[%s][index][agentringnoanswer]',_0x2c8fcd[_0xda81('0x20')]),_0x2c8fcd);agents[_0xda81('0x23')](_0x2c8fcd);}catch(_0x3aba59){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x24'),_0x2c8fcd['uniqueid']),_0x3aba59);}});ami['on'](_0xda81('0x25'),function(_0x2883c4){try{utils[_0xda81('0x1b')](util['format'](_0xda81('0x26'),_0x2883c4[_0xda81('0x20')]),_0x2883c4);agents[_0xda81('0x25')](_0x2883c4);queues['agentconnect'](_0x2883c4);}catch(_0x236564){utils['error'](util[_0xda81('0x1c')](_0xda81('0x26'),_0x2883c4['uniqueid']),_0x236564);}});ami['on']('agentcomplete',function(_0x486b92){try{utils[_0xda81('0x1b')](util['format'](_0xda81('0x27'),_0x486b92[_0xda81('0x20')]),_0x486b92);agents[_0xda81('0x28')](_0x486b92);queues[_0xda81('0x28')](_0x486b92);members[_0xda81('0x28')](_0x486b92);}catch(_0x11d59f){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x27'),_0x486b92[_0xda81('0x20')]),_0x11d59f);}});ami['on'](_0xda81('0x29'),function(_0x15ad6e){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x2a'),_0x15ad6e[_0xda81('0x20')]),_0x15ad6e);agents[_0xda81('0x29')](_0x15ad6e);queues[_0xda81('0x29')](_0x15ad6e);}catch(_0x5f449a){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x2a'),_0x15ad6e[_0xda81('0x20')]),_0x5f449a);}});ami['on'](_0xda81('0x2b'),function(_0x56a959){try{utils[_0xda81('0x1b')](util['format'](_0xda81('0x2c'),_0x56a959['uniqueid']),_0x56a959);queues[_0xda81('0x2b')](_0x56a959);recordings[_0xda81('0x2b')](_0x56a959);}catch(_0x5b7066){utils['error'](util['format'](_0xda81('0x2c'),_0x56a959[_0xda81('0x20')]),_0x5b7066);}});ami['on'](_0xda81('0x2d'),function(_0x8e9ca9){try{utils['debug'](util[_0xda81('0x1c')]('[%s][index][queuecallerleave]',_0x8e9ca9[_0xda81('0x20')]),_0x8e9ca9);queues['queuecallerleave'](_0x8e9ca9);}catch(_0x5acdb5){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x2e'),_0x8e9ca9['uniqueid']),_0x5acdb5);}});ami['on'](_0xda81('0x2f'),function(_0x5e8c6f){try{utils[_0xda81('0x1b')](util['format'](_0xda81('0x30'),_0x5e8c6f['uniqueid']),_0x5e8c6f);queues[_0xda81('0x2f')](_0x5e8c6f);calls[_0xda81('0x2f')](_0x5e8c6f);}catch(_0x57772f){utils[_0xda81('0x18')](util['format']('[%s][index][musiconholdstart]',_0x5e8c6f[_0xda81('0x20')]),_0x57772f);}});ami['on'](_0xda81('0x31'),function(_0x224700){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x32'),_0x224700[_0xda81('0x20')]),_0x224700);queues[_0xda81('0x31')](_0x224700);calls[_0xda81('0x31')](_0x224700);}catch(_0x46ee41){utils[_0xda81('0x18')](util['format'](_0xda81('0x32'),_0x224700[_0xda81('0x20')]),_0x46ee41);}});ami['on'](_0xda81('0x33'),function(_0x35a658){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x34'),_0x35a658[_0xda81('0x20')]),_0x35a658);calls[_0xda81('0x33')](_0x35a658);recordings[_0xda81('0x33')](_0x35a658);}catch(_0x1354e0){utils['error'](util[_0xda81('0x1c')](_0xda81('0x34'),_0x35a658[_0xda81('0x20')]),_0x1354e0);}});ami['on']('hangup',function(_0x682445){try{utils[_0xda81('0x1b')](util['format'](_0xda81('0x35'),_0x682445[_0xda81('0x20')]),_0x682445);calls[_0xda81('0x36')](_0x682445);recordings[_0xda81('0x36')](_0x682445);dials[_0xda81('0x36')](_0x682445);agents[_0xda81('0x36')](_0x682445);queues[_0xda81('0x36')](_0x682445);}catch(_0x17a2d3){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x35'),_0x682445[_0xda81('0x20')]),_0x17a2d3);}});ami['on'](_0xda81('0x37'),function(_0x326636){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x38'),_0x326636[_0xda81('0x20')]),_0x326636);members[_0xda81('0x37')](_0x326636);}catch(_0x356850){utils[_0xda81('0x18')](util['format']('[%s][index][cdr]',_0x326636[_0xda81('0x20')]),_0x356850);}});ami['on'](_0xda81('0x39'),function(_0x38f8e4){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x3a'),_0x38f8e4[_0xda81('0x20')]),_0x38f8e4);queues[_0xda81('0x39')](_0x38f8e4);agents[_0xda81('0x39')](_0x38f8e4);transfers[_0xda81('0x39')](_0x38f8e4);}catch(_0x12983e){utils['error'](util[_0xda81('0x1c')](_0xda81('0x3a'),_0x38f8e4[_0xda81('0x20')]),_0x12983e);}});ami['on'](_0xda81('0x3b'),function(_0x14394e){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')]('[%s][index][attendedtransfer]',_0x14394e[_0xda81('0x3c')]),_0x14394e);queues[_0xda81('0x3b')](_0x14394e);transfers[_0xda81('0x3b')](_0x14394e);agents['attendedtransfer'](_0x14394e);calls[_0xda81('0x3b')](_0x14394e);}catch(_0x4d98a8){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x3d'),_0x14394e['origtransfereruniqueid']),_0x4d98a8);}});ami['on']('varset',function(_0x569f15){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x3e'),_0x569f15[_0xda81('0x20')]),_0x569f15);queues[_0xda81('0x3f')](_0x569f15);recordings[_0xda81('0x3f')](_0x569f15);calls[_0xda81('0x3f')](_0x569f15);dials[_0xda81('0x3f')](_0x569f15);}catch(_0x3046fb){utils['error'](util[_0xda81('0x1c')](_0xda81('0x3e'),_0x569f15[_0xda81('0x20')]),_0x3046fb);}});ami['on'](_0xda81('0x40'),function(_0x40ff8e){try{utils[_0xda81('0x1b')](util['format'](_0xda81('0x41'),_0x40ff8e[_0xda81('0x20')]),_0x40ff8e);calls[_0xda81('0x40')](_0x40ff8e);recordings[_0xda81('0x40')](_0x40ff8e);dials[_0xda81('0x40')](_0x40ff8e);}catch(_0x5102cd){utils[_0xda81('0x18')](util[_0xda81('0x1c')](_0xda81('0x41'),_0x40ff8e['uniqueid']),_0x5102cd);}});ami['on']('newchannel',function(_0x34595b){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x42'),_0x34595b[_0xda81('0x20')]),_0x34595b);calls[_0xda81('0x43')](_0x34595b);recordings['newchannel'](_0x34595b);}catch(_0x39eb3c){utils[_0xda81('0x18')](util[_0xda81('0x1c')]('[%s][index][newchannel]',_0x34595b[_0xda81('0x20')]),_0x39eb3c);}});ami['on'](_0xda81('0x44'),function(_0x35f310){try{utils[_0xda81('0x1b')](util[_0xda81('0x1c')](_0xda81('0x45'),_0x35f310[_0xda81('0x20')]),_0x35f310);dials[_0xda81('0x44')](_0x35f310);}catch(_0x4d1a18){utils['error'](util['format'](_0xda81('0x46'),_0x35f310['uniqueid']),_0x4d1a18);}});ami['on'](_0xda81('0x47'),function(_0x1d9801){try{utils['debug'](util[_0xda81('0x1c')](_0xda81('0x48'),_0x1d9801[_0xda81('0x20')]),_0x1d9801);dials[_0xda81('0x47')](_0x1d9801);}catch(_0x4e543c){utils['error'](util[_0xda81('0x1c')](_0xda81('0x48'),_0x1d9801['uniqueid']),_0x4e543c);}});}
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fdc=['state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','type','util','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0xa22d6b,_0x3da494){var _0x555ef6=function(_0x3c8cca){while(--_0x3c8cca){_0xa22d6b['push'](_0xa22d6b['shift']());}};_0x555ef6(++_0x3da494);}(_0x4fdc,0x84));var _0xc4fd=function(_0x44ec0a,_0x4bba7e){_0x44ec0a=_0x44ec0a-0x0;var _0x127e75=_0x4fdc[_0x44ec0a];return _0x127e75;};'use strict';var _=require('lodash');var util=require(_0xc4fd('0x0'));var utils=require('./utils');var members={};var exclude=[_0xc4fd('0x1'),_0xc4fd('0x2')];function writeDB(_0x49fd20){utils['info'](util[_0xc4fd('0x3')](_0xc4fd('0x4'),_0x49fd20[_0xc4fd('0x5')],_0x49fd20[_0xc4fd('0x6')],_0x49fd20[_0xc4fd('0x7')],_0x49fd20[_0xc4fd('0x8')],_0x49fd20[_0xc4fd('0x9')],_0x49fd20['type']));if(_0x49fd20[_0xc4fd('0x6')]){utils[_0xc4fd('0xa')](_0x49fd20['interface'])[_0xc4fd('0xb')](function(_0x5b1df4){if(_0x5b1df4){_0x49fd20['membername']=_0x5b1df4[_0xc4fd('0xc')];_0x49fd20[_0xc4fd('0xd')]=_0x5b1df4[_0xc4fd('0xd')];utils[_0xc4fd('0xe')](_0xc4fd('0xf'),_0x49fd20);}else{utils[_0xc4fd('0x10')](_0x49fd20[_0xc4fd('0x6')][_0xc4fd('0x11')]('/')[0x1])['then'](function(_0x52cfdd){if(_0x52cfdd){_0x49fd20[_0xc4fd('0x9')]=_0x52cfdd[_0xc4fd('0xc')];_0x49fd20[_0xc4fd('0xd')]=_0x52cfdd['internal'];utils[_0xc4fd('0xe')](_0xc4fd('0xf'),_0x49fd20);}});}})[_0xc4fd('0x12')](function(_0x963371){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')](_0xc4fd('0x14'),_0x49fd20[_0xc4fd('0x5')]),_0x963371);});}delete members[_0x49fd20[_0xc4fd('0x6')]];}function startsWith(_0x553121,_0x75a44f){return _['some'](_0x553121,function(_0x5a248c){return _[_0xc4fd('0x15')](_0x75a44f,_0x5a248c);});}exports[_0xc4fd('0x16')]=function(_0x533217){try{utils['debug'](util[_0xc4fd('0x3')](_0xc4fd('0x17'),members[_0x533217[_0xc4fd('0x18')]]?members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x5')]:_0x533217[_0xc4fd('0x18')]),_0x533217);utils[_0xc4fd('0x19')](util['format'](_0xc4fd('0x1a'),members[_0x533217[_0xc4fd('0x18')]]?members[_0x533217[_0xc4fd('0x18')]]['uniqueid']:_0x533217['device'],_0x533217[_0xc4fd('0x1b')],_0x533217[_0xc4fd('0x18')]));switch(_0x533217[_0xc4fd('0x1b')]){case _0xc4fd('0x1c'):case _0xc4fd('0x1d'):if(!startsWith(exclude,_0x533217[_0xc4fd('0x18')])){members[_0x533217['device']]={'channel':'voice','interface':_0x533217[_0xc4fd('0x18')],'type':_0xc4fd('0x1e'),'enterAt':utils[_0xc4fd('0x1f')](),'role':_0xc4fd('0x20')};}break;case _0xc4fd('0x21'):if(!_[_0xc4fd('0x22')](members[_0x533217[_0xc4fd('0x18')]])){members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x23')]=utils['now']();members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x24')]=utils[_0xc4fd('0x25')](members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x23')],members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x26')]);if(members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x5')]){writeDB(members[_0x533217['device']]);}}break;default:break;}}catch(_0x54ac54){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')](_0xc4fd('0x17'),members[_0x533217[_0xc4fd('0x18')]]?members[_0x533217[_0xc4fd('0x18')]][_0xc4fd('0x5')]:_0x533217['device']),_0x54ac54);}};exports[_0xc4fd('0x27')]=function(_0x1b65bd){try{if(!_[_0xc4fd('0x22')](members[_0x1b65bd[_0xc4fd('0x6')]])){utils[_0xc4fd('0x28')](util[_0xc4fd('0x3')](_0xc4fd('0x29'),_0x1b65bd[_0xc4fd('0x5')]),_0x1b65bd);utils['info'](util['format'](_0xc4fd('0x2a'),_0x1b65bd[_0xc4fd('0x5')],_0x1b65bd[_0xc4fd('0x6')],_0x1b65bd[_0xc4fd('0x2b')]));members[_0x1b65bd['interface']]=_[_0xc4fd('0x2c')](members[_0x1b65bd['interface']],{'data4':_0x1b65bd[_0xc4fd('0x2b')],'uniqueid':_0x1b65bd[_0xc4fd('0x5')]});}}catch(_0x5c84ea){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')](_0xc4fd('0x29'),_0x1b65bd[_0xc4fd('0x5')]),_0x5c84ea);}};exports[_0xc4fd('0x2d')]=function(_0x151bfb){try{utils['debug'](util[_0xc4fd('0x3')](_0xc4fd('0x2e'),_0x151bfb[_0xc4fd('0x5')]),_0x151bfb);if(_0x151bfb[_0xc4fd('0x7')]){var _0x45c9a5=_0x151bfb[_0xc4fd('0x7')][_0xc4fd('0x11')]('-')[0x0];if(!_['isNil'](members[_0x45c9a5])){members[_0x45c9a5]=_[_0xc4fd('0x2c')](members[_0x45c9a5],{'data1':members[_0x45c9a5]['data1']||_0x151bfb['type'],'data2':members[_0x45c9a5][_0xc4fd('0x8')]||_0x151bfb['source'],'data3':members[_0x45c9a5][_0xc4fd('0x2f')]||_0x151bfb[_0xc4fd('0x30')],'uniqueid':members[_0x45c9a5][_0xc4fd('0x5')]||_0x151bfb['uniqueid']});utils[_0xc4fd('0x19')](util[_0xc4fd('0x3')](_0xc4fd('0x31'),_0x151bfb[_0xc4fd('0x5')],members[_0x45c9a5]['data1'],members[_0x45c9a5][_0xc4fd('0x8')],members[_0x45c9a5][_0xc4fd('0x2f')]));if(members[_0x45c9a5][_0xc4fd('0x23')]){writeDB(members[_0x45c9a5]);}}}if(_0x151bfb[_0xc4fd('0x32')]){var _0x5abf34=_0x151bfb[_0xc4fd('0x32')][_0xc4fd('0x11')]('-')[0x0];if(!_['isNil'](members[_0x5abf34])){members[_0x5abf34]=_[_0xc4fd('0x2c')](members[_0x5abf34],{'data1':members[_0x5abf34][_0xc4fd('0x33')]||_0x151bfb[_0xc4fd('0x34')],'data2':members[_0x5abf34][_0xc4fd('0x8')]||_0x151bfb['source'],'data3':members[_0x5abf34][_0xc4fd('0x2f')]||_0x151bfb[_0xc4fd('0x30')],'uniqueid':members[_0x5abf34]['uniqueid']||_0x151bfb[_0xc4fd('0x5')]});utils[_0xc4fd('0x19')](util[_0xc4fd('0x3')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x151bfb[_0xc4fd('0x5')],members[_0x5abf34][_0xc4fd('0x33')],members[_0x5abf34][_0xc4fd('0x8')],members[_0x5abf34][_0xc4fd('0x2f')]));if(members[_0x5abf34]['exitAt']){writeDB(members[_0x5abf34]);}}}}catch(_0x543045){utils[_0xc4fd('0x13')](util[_0xc4fd('0x3')]('[%s][members][cdr]',_0x151bfb[_0xc4fd('0x5')]),_0x543045);}};
\ No newline at end of file
+var _0x3df4=['Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','then','internal','request','CreateMemberReport','getUserByName','split','name','catch','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','now','duration','diffTime','exitAt','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destination','./utils','Local/_attended@transfer'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x3df4,0x102));var _0x43df=function(_0x18e2ea,_0x25beb1){_0x18e2ea=_0x18e2ea-0x0;var _0x4e320d=_0x3df4[_0x18e2ea];return _0x4e320d;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x43df('0x0'));var members={};var exclude=[_0x43df('0x1'),_0x43df('0x2')];function writeDB(_0x206707){utils[_0x43df('0x3')](util[_0x43df('0x4')](_0x43df('0x5'),_0x206707['uniqueid'],_0x206707['interface'],_0x206707[_0x43df('0x6')],_0x206707[_0x43df('0x7')],_0x206707[_0x43df('0x8')],_0x206707[_0x43df('0x9')]));if(_0x206707['interface']){utils['getUserByInterface'](_0x206707[_0x43df('0xa')])[_0x43df('0xb')](function(_0x24b6a8){if(_0x24b6a8){_0x206707[_0x43df('0x8')]=_0x24b6a8['name'];_0x206707[_0x43df('0xc')]=_0x24b6a8['internal'];utils[_0x43df('0xd')](_0x43df('0xe'),_0x206707);}else{utils[_0x43df('0xf')](_0x206707[_0x43df('0xa')][_0x43df('0x10')]('/')[0x1])[_0x43df('0xb')](function(_0x155448){if(_0x155448){_0x206707['membername']=_0x155448[_0x43df('0x11')];_0x206707[_0x43df('0xc')]=_0x155448['internal'];utils[_0x43df('0xd')]('CreateMemberReport',_0x206707);}});}})[_0x43df('0x12')](function(_0x301d6d){utils['error'](util[_0x43df('0x4')]('[%s][members][writeDB]',_0x206707['uniqueid']),_0x301d6d);});}delete members[_0x206707[_0x43df('0xa')]];}function startsWith(_0x3748f2,_0x5c00d9){return _[_0x43df('0x13')](_0x3748f2,function(_0x592c70){return _[_0x43df('0x14')](_0x5c00d9,_0x592c70);});}exports[_0x43df('0x15')]=function(_0x14b258){try{utils[_0x43df('0x16')](util[_0x43df('0x4')](_0x43df('0x17'),members[_0x14b258['device']]?members[_0x14b258[_0x43df('0x18')]][_0x43df('0x19')]:_0x14b258[_0x43df('0x18')]),_0x14b258);utils[_0x43df('0x3')](util['format'](_0x43df('0x1a'),members[_0x14b258[_0x43df('0x18')]]?members[_0x14b258[_0x43df('0x18')]]['uniqueid']:_0x14b258['device'],_0x14b258[_0x43df('0x1b')],_0x14b258[_0x43df('0x18')]));switch(_0x14b258['state']){case _0x43df('0x1c'):case _0x43df('0x1d'):if(!startsWith(exclude,_0x14b258[_0x43df('0x18')])){members[_0x14b258['device']]={'channel':_0x43df('0x1e'),'interface':_0x14b258['device'],'type':_0x43df('0x1f'),'enterAt':utils['now'](),'role':_0x43df('0x20')};}break;case _0x43df('0x21'):if(!_[_0x43df('0x22')](members[_0x14b258['device']])){members[_0x14b258[_0x43df('0x18')]]['exitAt']=utils[_0x43df('0x23')]();members[_0x14b258[_0x43df('0x18')]][_0x43df('0x24')]=utils[_0x43df('0x25')](members[_0x14b258[_0x43df('0x18')]][_0x43df('0x26')],members[_0x14b258[_0x43df('0x18')]][_0x43df('0x27')]);if(members[_0x14b258[_0x43df('0x18')]][_0x43df('0x19')]){writeDB(members[_0x14b258[_0x43df('0x18')]]);}}break;default:break;}}catch(_0x4ade02){utils[_0x43df('0x28')](util[_0x43df('0x4')](_0x43df('0x17'),members[_0x14b258[_0x43df('0x18')]]?members[_0x14b258[_0x43df('0x18')]][_0x43df('0x19')]:_0x14b258[_0x43df('0x18')]),_0x4ade02);}};exports[_0x43df('0x29')]=function(_0x1eed39){try{if(!_['isNil'](members[_0x1eed39['interface']])){utils[_0x43df('0x16')](util[_0x43df('0x4')](_0x43df('0x2a'),_0x1eed39[_0x43df('0x19')]),_0x1eed39);utils[_0x43df('0x3')](util['format'](_0x43df('0x2b'),_0x1eed39[_0x43df('0x19')],_0x1eed39[_0x43df('0xa')],_0x1eed39[_0x43df('0x2c')]));members[_0x1eed39[_0x43df('0xa')]]=_[_0x43df('0x2d')](members[_0x1eed39[_0x43df('0xa')]],{'data4':_0x1eed39[_0x43df('0x2c')],'uniqueid':_0x1eed39[_0x43df('0x19')]});}}catch(_0x135561){utils[_0x43df('0x28')](util[_0x43df('0x4')](_0x43df('0x2a'),_0x1eed39[_0x43df('0x19')]),_0x135561);}};exports['cdr']=function(_0x530941){try{utils[_0x43df('0x16')](util['format'](_0x43df('0x2e'),_0x530941[_0x43df('0x19')]),_0x530941);if(_0x530941[_0x43df('0x6')]){var _0x1ed18f=_0x530941['channel'][_0x43df('0x10')]('-')[0x0];if(!_[_0x43df('0x22')](members[_0x1ed18f])){members[_0x1ed18f]=_[_0x43df('0x2d')](members[_0x1ed18f],{'data1':members[_0x1ed18f]['data1']||_0x530941[_0x43df('0x9')],'data2':members[_0x1ed18f][_0x43df('0x7')]||_0x530941[_0x43df('0x2f')],'data3':members[_0x1ed18f][_0x43df('0x30')]||_0x530941['destination'],'uniqueid':members[_0x1ed18f][_0x43df('0x19')]||_0x530941[_0x43df('0x19')]});utils[_0x43df('0x3')](util[_0x43df('0x4')](_0x43df('0x31'),_0x530941[_0x43df('0x19')],members[_0x1ed18f]['data1'],members[_0x1ed18f]['data2'],members[_0x1ed18f][_0x43df('0x30')]));if(members[_0x1ed18f]['exitAt']){writeDB(members[_0x1ed18f]);}}}if(_0x530941['destinationchannel']){var _0x502e19=_0x530941['destinationchannel'][_0x43df('0x10')]('-')[0x0];if(!_[_0x43df('0x22')](members[_0x502e19])){members[_0x502e19]=_[_0x43df('0x2d')](members[_0x502e19],{'data1':members[_0x502e19][_0x43df('0x32')]||_0x530941['type'],'data2':members[_0x502e19][_0x43df('0x7')]||_0x530941[_0x43df('0x2f')],'data3':members[_0x502e19]['data3']||_0x530941[_0x43df('0x33')],'uniqueid':members[_0x502e19][_0x43df('0x19')]||_0x530941[_0x43df('0x19')]});utils[_0x43df('0x3')](util[_0x43df('0x4')](_0x43df('0x31'),_0x530941['uniqueid'],members[_0x502e19][_0x43df('0x32')],members[_0x502e19]['data2'],members[_0x502e19]['data3']));if(members[_0x502e19][_0x43df('0x26')]){writeDB(members[_0x502e19]);}}}}catch(_0xd16ae1){utils[_0x43df('0x28')](util[_0x43df('0x4')](_0x43df('0x2e'),_0x530941[_0x43df('0x19')]),_0xd16ae1);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb19=['isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup'];(function(_0x414f02,_0x37e299){var _0x1c2f57=function(_0x8cf1cf){while(--_0x8cf1cf){_0x414f02['push'](_0x414f02['shift']());}};_0x1c2f57(++_0x37e299);}(_0xeb19,0x1e2));var _0x9eb1=function(_0x479786,_0x4a9032){_0x479786=_0x479786-0x0;var _0x442df8=_0xeb19[_0x479786];return _0x442df8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9eb1('0x0'));var queues={};function writeDB(_0x3f2dfa){utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x2'),_0x3f2dfa[_0x9eb1('0x3')],_0x3f2dfa[_0x9eb1('0x4')],_0x3f2dfa[_0x9eb1('0x5')],_0x3f2dfa[_0x9eb1('0x6')],_0x3f2dfa['calleridnum'],_0x3f2dfa[_0x9eb1('0x7')],_0x3f2dfa[_0x9eb1('0x8')]));if(_0x3f2dfa['queue']){utils['getVoiceQueueByName'](_0x3f2dfa[_0x9eb1('0x5')])['then'](function(_0x36220e){if(_0x36220e){_0x3f2dfa[_0x9eb1('0x9')]=_0x36220e['type'];}utils['request'](_0x9eb1('0xa'),_0x3f2dfa);});}else{utils[_0x9eb1('0xb')]('CreateVoiceQueueReport',_0x3f2dfa);}if(_0x3f2dfa[_0x9eb1('0xc')]){delete queues[_0x3f2dfa[_0x9eb1('0xc')]];}else{delete queues[_0x3f2dfa[_0x9eb1('0x3')]];}}exports[_0x9eb1('0xd')]=function(_0xeff0c2){try{utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x10'),_0xeff0c2[_0x9eb1('0x3')]),_0xeff0c2);utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x11'),_0xeff0c2[_0x9eb1('0x3')],_0xeff0c2['queue'],_0xeff0c2['position']));queues[_0xeff0c2[_0x9eb1('0x3')]]=_[_0x9eb1('0x12')](_0xeff0c2,{'originalposition':_0xeff0c2[_0x9eb1('0x13')],'queuecallerjoinAt':utils[_0x9eb1('0x14')](),'mohtime':0x0});}catch(_0x3aa9c8){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')]('[%s][queues][queuecallerjoin]',_0xeff0c2[_0x9eb1('0x3')]),_0x3aa9c8);}};exports[_0x9eb1('0x16')]=function(_0x1f9845){try{if(!_[_0x9eb1('0x17')](queues[_0x1f9845[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x18'),_0x1f9845['uniqueid']),_0x1f9845);if(queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x19')]){if(!queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1a')]&&!queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1b')]){queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1c')]=!![];queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x1d')]=utils['now']();queues[_0x1f9845['uniqueid']][_0x9eb1('0x8')]=_0x9eb1('0x1e');}utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x1f'),_0x1f9845['uniqueid'],queues[_0x1f9845['uniqueid']]['name'],queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0x8')]));writeDB(queues[_0x1f9845[_0x9eb1('0x3')]]);}else if(queues[_0x1f9845[_0x9eb1('0x3')]]['transfereduniqueid']){utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x20'),_0x1f9845['uniqueid'],queues[_0x1f9845['uniqueid']][_0x9eb1('0x21')],queues[_0x1f9845[_0x9eb1('0x3')]]['transfereduniqueid']));queues[queues[_0x1f9845[_0x9eb1('0x3')]]['transfereduniqueid']]=queues[_0x1f9845[_0x9eb1('0x3')]];queues[queues[_0x1f9845[_0x9eb1('0x3')]][_0x9eb1('0xc')]][_0x9eb1('0x22')]=0x2;delete queues[_0x1f9845['uniqueid']];}}}catch(_0x3ec7ba){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x18'),_0x1f9845['uniqueid']),_0x3ec7ba);}};exports['varset']=function(_0x5038bb){try{utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x23'),_0x5038bb['uniqueid']),_0x5038bb);if(!_[_0x9eb1('0x17')](_0x5038bb[_0x9eb1('0x24')][_0x9eb1('0x25')])&&_0x5038bb[_0x9eb1('0x26')][_0x9eb1('0x27')]()!==_0x9eb1('0x28')){if(!_[_0x9eb1('0x17')](queues[_0x5038bb[_0x9eb1('0x3')]])){queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x29')]=null;queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1b')]=!![];queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x2a')]=utils[_0x9eb1('0x14')]();queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x8')]=_0x5038bb[_0x9eb1('0x26')]['toUpperCase']();utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x2b'),_0x5038bb[_0x9eb1('0x3')],queues[_0x5038bb[_0x9eb1('0x3')]]['name'],_0x5038bb[_0x9eb1('0x26')],queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x8')]));writeDB(queues[_0x5038bb['uniqueid']]);}}else if(!_[_0x9eb1('0x17')](_0x5038bb['variable']['queueposition'])){if(!_[_0x9eb1('0x17')](queues[_0x5038bb[_0x9eb1('0x3')]])&&!queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1a')]){queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x5038bb['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x1b')]=!![];queues[_0x5038bb['uniqueid']][_0x9eb1('0x2a')]=utils['now']();queues[_0x5038bb[_0x9eb1('0x3')]]['queuecallerexitreason']=_0x9eb1('0x2c');utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5038bb[_0x9eb1('0x3')],queues[_0x5038bb[_0x9eb1('0x3')]][_0x9eb1('0x21')],_0x5038bb[_0x9eb1('0x26')],queues[_0x5038bb[_0x9eb1('0x3')]]['queuecallerexitreason']));}}}catch(_0x2cdcec){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')]('[%s][queues][varset]',_0x5038bb['uniqueid']),_0x2cdcec);}};exports[_0x9eb1('0x1a')]=function(_0x215e0e){try{if(!_[_0x9eb1('0x17')](queues[_0x215e0e[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x2d'),_0x215e0e['uniqueid']),_0x215e0e);queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x1b')]=![];queues[_0x215e0e[_0x9eb1('0x3')]]['queuecallerexitAt']=null;queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=!![];queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x29')]=utils[_0x9eb1('0x14')]();queues[_0x215e0e[_0x9eb1('0x3')]]['queuecallerexitreason']=_0x9eb1('0x2e');utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x2f'),_0x215e0e['uniqueid'],queues[_0x215e0e['uniqueid']][_0x9eb1('0x21')],queues[_0x215e0e[_0x9eb1('0x3')]][_0x9eb1('0x8')]));}}catch(_0x587d95){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x2d'),_0x215e0e['uniqueid']),_0x587d95);}};exports['queuecallerleave']=function(_0x3ea86e){try{if(!_[_0x9eb1('0x17')](queues[_0x3ea86e[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')]('[%s][queues][queuecallerleave]',_0x3ea86e[_0x9eb1('0x3')]),_0x3ea86e);utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x30'),_0x3ea86e[_0x9eb1('0x3')],queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x21')],_0x3ea86e['connectedlinenum'],_0x3ea86e[_0x9eb1('0x31')]));queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x32')]=!![];queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x19')]=utils['now']();queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x33')]=utils[_0x9eb1('0x34')](queues[_0x3ea86e[_0x9eb1('0x3')]]['queuecallerleaveAt'],queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x35')]);queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x13')]=_0x3ea86e[_0x9eb1('0x13')];queues[_0x3ea86e[_0x9eb1('0x3')]]['count']=_0x3ea86e[_0x9eb1('0x36')];queues[_0x3ea86e[_0x9eb1('0x3')]][_0x9eb1('0x37')]=_0x3ea86e[_0x9eb1('0x37')];queues[_0x3ea86e['uniqueid']][_0x9eb1('0x31')]=_0x3ea86e['connectedlinename'];}}catch(_0xb2a61c){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x38'),_0x3ea86e[_0x9eb1('0x3')]),_0xb2a61c);}};exports['agentconnect']=function(_0x179532){try{if(!_['isNil'](queues[_0x179532[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')]('[%s][queues][agentconnect]',_0x179532[_0x9eb1('0x3')]),_0x179532);utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x39'),_0x179532[_0x9eb1('0x3')],queues[_0x179532[_0x9eb1('0x3')]]['name'],_0x179532[_0x9eb1('0x3a')],_0x179532[_0x9eb1('0x3b')]));queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x29')]=null;queues[_0x179532['uniqueid']][_0x9eb1('0x1b')]=![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x8')]=null;queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x2a')]=null;queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x3c')]=!![];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x7')]=_0x179532[_0x9eb1('0x3b')];queues[_0x179532[_0x9eb1('0x3')]][_0x9eb1('0x6')]=_0x179532[_0x9eb1('0x3a')];}}catch(_0x22eafd){utils['error'](util[_0x9eb1('0xf')]('[%s][queues][agentconnect]',_0x179532[_0x9eb1('0x3')]),_0x22eafd);}};exports[_0x9eb1('0x3d')]=function(_0x4db9f2){try{if(!_[_0x9eb1('0x17')](queues[_0x4db9f2[_0x9eb1('0x3')]])){if(queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x19')]){utils['debug'](util[_0x9eb1('0xf')](_0x9eb1('0x3e'),_0x4db9f2[_0x9eb1('0x3')]),_0x4db9f2);queues[_0x4db9f2['uniqueid']][_0x9eb1('0x1a')]=![];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x1a')]=![];queues[_0x4db9f2['uniqueid']][_0x9eb1('0x29')]=null;queues[_0x4db9f2['uniqueid']]['queuecallerexit']=![];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x2a')]=null;queues[_0x4db9f2[_0x9eb1('0x3')]]['assigned']=!![];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x6')]=_0x4db9f2[_0x9eb1('0x3a')];queues[_0x4db9f2[_0x9eb1('0x3')]][_0x9eb1('0x1c')]=!![];queues[_0x4db9f2['uniqueid']][_0x9eb1('0x1d')]=utils[_0x9eb1('0x14')]();if(_0x4db9f2[_0x9eb1('0x3f')]==_0x9eb1('0x40')){if(!queues[_0x4db9f2[_0x9eb1('0x3')]]['transfer']){queues[_0x4db9f2[_0x9eb1('0x3')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x4db9f2['uniqueid']][_0x9eb1('0x8')]='COMPLETEDBY'+_0x4db9f2[_0x9eb1('0x3f')]['toUpperCase']();}utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4db9f2[_0x9eb1('0x3')],queues[_0x4db9f2[_0x9eb1('0x3')]]['name'],_0x4db9f2[_0x9eb1('0x3a')],queues[_0x4db9f2['uniqueid']][_0x9eb1('0x8')]));writeDB(queues[_0x4db9f2[_0x9eb1('0x3')]]);}}}catch(_0x385517){utils['error'](util[_0x9eb1('0xf')](_0x9eb1('0x3e'),_0x4db9f2[_0x9eb1('0x3')]),_0x385517);}};exports[_0x9eb1('0x41')]=function(_0x992c72){try{if(!_[_0x9eb1('0x17')](queues[_0x992c72[_0x9eb1('0x42')]])){utils[_0x9eb1('0xe')](util['format'](_0x9eb1('0x43'),_0x992c72[_0x9eb1('0x3')]),_0x992c72);queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x40')]=!![];queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x44')]=_0x9eb1('0x45');queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x46')]=_0x992c72[_0x9eb1('0x47')];queues[_0x992c72[_0x9eb1('0x42')]]['transferuniqueid']=_0x992c72[_0x9eb1('0x42')];queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x8')]='BLINDTRANSFER';utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x48'),_0x992c72['uniqueid'],queues[_0x992c72[_0x9eb1('0x42')]][_0x9eb1('0x21')],_0x992c72[_0x9eb1('0x42')],_0x992c72['extension']));}}catch(_0x51c88f){utils['error'](util['format'](_0x9eb1('0x43'),_0x992c72[_0x9eb1('0x3')]),_0x51c88f);}};exports[_0x9eb1('0x49')]=function(_0x41ecf5){try{utils[_0x9eb1('0xe')](util['format']('[%s][queues][attendedtransfer]',_0x41ecf5[_0x9eb1('0x4a')]),_0x41ecf5);if(_0x41ecf5[_0x9eb1('0x4a')]==_0x41ecf5['origtransfererlinkedid']){if(!_[_0x9eb1('0x17')](queues[_0x41ecf5[_0x9eb1('0x4b')]])){utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x4c'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x4b')]]['name'],_0x41ecf5[_0x9eb1('0x4d')]));queues[_0x41ecf5[_0x9eb1('0x4b')]]['transfer']=!![];queues[_0x41ecf5[_0x9eb1('0x4b')]]['transfertype']=_0x9eb1('0x4e');queues[_0x41ecf5['secondtransfererlinkedid']][_0x9eb1('0x46')]=_0x41ecf5[_0x9eb1('0x4d')];queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x4f')]=_0x41ecf5['origtransfereruniqueid'];queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x8')]=_0x9eb1('0x50');}if(!_['isNil'](queues[_0x41ecf5[_0x9eb1('0x51')]])){if(_0x41ecf5[_0x9eb1('0x52')]&&queues[_0x41ecf5[_0x9eb1('0x52')]]){queues[_0x41ecf5[_0x9eb1('0x52')]]['queuecallerenterreason']=0x1;queues[_0x41ecf5[_0x9eb1('0x42')]]=_[_0x9eb1('0x53')](queues[_0x41ecf5[_0x9eb1('0x52')]]);queues[_0x41ecf5['transfereeuniqueid']][_0x9eb1('0xc')]=_0x41ecf5[_0x9eb1('0x54')];queues[_0x41ecf5[_0x9eb1('0x42')]]['queuecallerenterreason']=0x2;queues[_0x41ecf5[_0x9eb1('0x42')]]['calleridnum']=queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x55')];queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x56')]=queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x56')];queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x35')]=utils[_0x9eb1('0x14')]();queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x19')]=utils['now']();queues[_0x41ecf5[_0x9eb1('0x42')]]['holdtime']=0x0;queues[_0x41ecf5[_0x9eb1('0x42')]]['mohtime']=0x0;utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x57'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x42')]]['name'],queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x55')],queues[_0x41ecf5[_0x9eb1('0x42')]][_0x9eb1('0x56')]));}else{utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x41ecf5['origtransfereruniqueid'],queues[_0x41ecf5['origtransfererlinkedid']]['name'],_0x41ecf5['secondtransfererlinkedid']));queues[_0x41ecf5[_0x9eb1('0x51')]]['transfereduniqueid']=_0x41ecf5[_0x9eb1('0x4b')];}}}else if(_0x41ecf5['secondtransfereruniqueid']==_0x41ecf5['secondtransfererlinkedid']){if(!_[_0x9eb1('0x17')](queues[_0x41ecf5['origtransfererlinkedid']])){utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x21')],_0x41ecf5[_0x9eb1('0x58')],_0x41ecf5[_0x9eb1('0x59')]));queues[_0x41ecf5[_0x9eb1('0x51')]]['transfer']=!![];queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x44')]='ATTENDED';queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x46')]=_0x41ecf5['secondtransfererexten'];queues[_0x41ecf5['origtransfererlinkedid']][_0x9eb1('0x4f')]=_0x41ecf5[_0x9eb1('0x58')];queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x9eb1('0x17')](queues[_0x41ecf5[_0x9eb1('0x4b')]])){if(_0x41ecf5[_0x9eb1('0x5a')]&&queues[_0x41ecf5['transfertargetlinkedid']]){queues[_0x41ecf5[_0x9eb1('0x5a')]][_0x9eb1('0x22')]=0x1;queues[_0x41ecf5[_0x9eb1('0x54')]]=_[_0x9eb1('0x53')](queues[_0x41ecf5[_0x9eb1('0x5a')]]);queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0xc')]=_0x41ecf5['transfertargetuniqueid'];queues[_0x41ecf5[_0x9eb1('0x54')]]['queuecallerenterreason']=0x2;queues[_0x41ecf5['transfertargetuniqueid']][_0x9eb1('0x55')]=queues[_0x41ecf5[_0x9eb1('0x51')]][_0x9eb1('0x55')];queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x56')]=queues[_0x41ecf5['origtransfererlinkedid']]['calleridname'];queues[_0x41ecf5[_0x9eb1('0x54')]]['queuecallerjoinAt']=utils[_0x9eb1('0x14')]();queues[_0x41ecf5[_0x9eb1('0x54')]]['queuecallerleaveAt']=utils[_0x9eb1('0x14')]();queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x33')]=0x0;queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x5b')]=0x0;utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x5c'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5['transfertargetuniqueid']][_0x9eb1('0x21')],queues[_0x41ecf5['transfertargetuniqueid']][_0x9eb1('0xc')],queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x55')],queues[_0x41ecf5[_0x9eb1('0x54')]][_0x9eb1('0x56')]));}else{utils[_0x9eb1('0x1')](util[_0x9eb1('0xf')](_0x9eb1('0x5d'),_0x41ecf5[_0x9eb1('0x4a')],queues[_0x41ecf5[_0x9eb1('0x4b')]][_0x9eb1('0x21')],_0x41ecf5[_0x9eb1('0x51')]));queues[_0x41ecf5['secondtransfererlinkedid']][_0x9eb1('0xc')]=_0x41ecf5[_0x9eb1('0x51')];}}}}catch(_0x542729){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x5e'),_0x41ecf5[_0x9eb1('0x4a')]),_0x542729);}};exports[_0x9eb1('0x5f')]=function(_0x2d3e0b){try{if(!_[_0x9eb1('0x17')](queues[_0x2d3e0b[_0x9eb1('0x3')]])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x60'),_0x2d3e0b[_0x9eb1('0x3')]),_0x2d3e0b);queues[_0x2d3e0b[_0x9eb1('0x3')]]['musiconholdstartAt']=utils[_0x9eb1('0x14')]();utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x61'),_0x2d3e0b[_0x9eb1('0x3')],queues[_0x2d3e0b[_0x9eb1('0x3')]]['name'],queues[_0x2d3e0b[_0x9eb1('0x3')]][_0x9eb1('0x62')]));}}catch(_0x34d008){utils[_0x9eb1('0x15')](util[_0x9eb1('0xf')](_0x9eb1('0x60'),_0x2d3e0b[_0x9eb1('0x3')]),_0x34d008);}};exports['musiconholdstop']=function(_0x16d42a){try{if(!_['isNil'](queues[_0x16d42a[_0x9eb1('0x3')]])){if(!_['isNil'](queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x62')])){utils[_0x9eb1('0xe')](util[_0x9eb1('0xf')](_0x9eb1('0x63'),_0x16d42a[_0x9eb1('0x3')]),_0x16d42a);queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x5b')]+=utils[_0x9eb1('0x34')](utils[_0x9eb1('0x14')](),queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x62')]);utils[_0x9eb1('0x1')](util['format'](_0x9eb1('0x64'),_0x16d42a[_0x9eb1('0x3')],queues[_0x16d42a[_0x9eb1('0x3')]][_0x9eb1('0x21')],queues[_0x16d42a['uniqueid']][_0x9eb1('0x5b')]));delete queues[_0x16d42a['uniqueid']][_0x9eb1('0x62')];}}}catch(_0x52bf79){utils['error'](util[_0x9eb1('0xf')]('[%s][queues][musiconholdstop]',_0x16d42a[_0x9eb1('0x3')]),_0x52bf79);}};
\ No newline at end of file
+var _0x3349=['origtransfereruniqueid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','clone','transfertargetuniqueid','queuecallerenterreason','calleridnum','calleridname','holdtime','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','assign','position','now','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','varset','variable','queuestatus','value','toUpperCase','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinename','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0x44aa7b,_0x4bfc07){var _0x202405=function(_0x22fd44){while(--_0x22fd44){_0x44aa7b['push'](_0x44aa7b['shift']());}};_0x202405(++_0x4bfc07);}(_0x3349,0x182));var _0x9334=function(_0x3ad1ab,_0x3c8799){_0x3ad1ab=_0x3ad1ab-0x0;var _0x26d4c9=_0x3349[_0x3ad1ab];return _0x26d4c9;};'use strict';var _=require(_0x9334('0x0'));var util=require('util');var utils=require(_0x9334('0x1'));var queues={};function writeDB(_0xaaeb67){utils[_0x9334('0x2')](util[_0x9334('0x3')](_0x9334('0x4'),_0xaaeb67[_0x9334('0x5')],_0xaaeb67[_0x9334('0x6')],_0xaaeb67[_0x9334('0x7')],_0xaaeb67[_0x9334('0x8')],_0xaaeb67['calleridnum'],_0xaaeb67[_0x9334('0x9')],_0xaaeb67[_0x9334('0xa')]));if(_0xaaeb67['queue']){utils['getVoiceQueueByName'](_0xaaeb67[_0x9334('0x7')])[_0x9334('0xb')](function(_0x2b7570){if(_0x2b7570){_0xaaeb67[_0x9334('0xc')]=_0x2b7570['type'];}utils[_0x9334('0xd')](_0x9334('0xe'),_0xaaeb67);});}else{utils[_0x9334('0xd')](_0x9334('0xe'),_0xaaeb67);}if(_0xaaeb67[_0x9334('0xf')]){delete queues[_0xaaeb67[_0x9334('0xf')]];}else{delete queues[_0xaaeb67[_0x9334('0x5')]];}}exports[_0x9334('0x10')]=function(_0x50c44d){try{utils[_0x9334('0x11')](util[_0x9334('0x3')](_0x9334('0x12'),_0x50c44d[_0x9334('0x5')]),_0x50c44d);utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x50c44d['uniqueid'],_0x50c44d[_0x9334('0x7')],_0x50c44d['position']));queues[_0x50c44d['uniqueid']]=_[_0x9334('0x13')](_0x50c44d,{'originalposition':_0x50c44d[_0x9334('0x14')],'queuecallerjoinAt':utils[_0x9334('0x15')](),'mohtime':0x0});}catch(_0x913734){utils[_0x9334('0x16')](util[_0x9334('0x3')]('[%s][queues][queuecallerjoin]',_0x50c44d[_0x9334('0x5')]),_0x913734);}};exports[_0x9334('0x17')]=function(_0x13be91){try{if(!_[_0x9334('0x18')](queues[_0x13be91[_0x9334('0x5')]])){utils[_0x9334('0x11')](util[_0x9334('0x3')]('[%s][queues][hangup]',_0x13be91[_0x9334('0x5')]),_0x13be91);if(queues[_0x13be91[_0x9334('0x5')]][_0x9334('0x19')]){if(!queues[_0x13be91[_0x9334('0x5')]][_0x9334('0x1a')]&&!queues[_0x13be91[_0x9334('0x5')]][_0x9334('0x1b')]){queues[_0x13be91[_0x9334('0x5')]][_0x9334('0x1c')]=!![];queues[_0x13be91[_0x9334('0x5')]][_0x9334('0x1d')]=utils[_0x9334('0x15')]();queues[_0x13be91[_0x9334('0x5')]][_0x9334('0xa')]=_0x9334('0x1e');}utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x13be91[_0x9334('0x5')],queues[_0x13be91['uniqueid']][_0x9334('0x1f')],queues[_0x13be91[_0x9334('0x5')]][_0x9334('0xa')]));writeDB(queues[_0x13be91[_0x9334('0x5')]]);}else if(queues[_0x13be91['uniqueid']][_0x9334('0xf')]){utils['info'](util[_0x9334('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x13be91[_0x9334('0x5')],queues[_0x13be91['uniqueid']][_0x9334('0x1f')],queues[_0x13be91['uniqueid']]['transfereduniqueid']));queues[queues[_0x13be91['uniqueid']][_0x9334('0xf')]]=queues[_0x13be91[_0x9334('0x5')]];queues[queues[_0x13be91['uniqueid']][_0x9334('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x13be91[_0x9334('0x5')]];}}}catch(_0x2757c7){utils[_0x9334('0x16')](util[_0x9334('0x3')]('[%s][queues][hangup]',_0x13be91[_0x9334('0x5')]),_0x2757c7);}};exports[_0x9334('0x20')]=function(_0x27009f){try{utils[_0x9334('0x11')](util[_0x9334('0x3')]('[%s][queues][varset]',_0x27009f[_0x9334('0x5')]),_0x27009f);if(!_['isNil'](_0x27009f[_0x9334('0x21')][_0x9334('0x22')])&&_0x27009f[_0x9334('0x23')][_0x9334('0x24')]()!=='CONTINUE'){if(!_[_0x9334('0x18')](queues[_0x27009f['uniqueid']])){queues[_0x27009f[_0x9334('0x5')]]['queuecallerabandon']=![];queues[_0x27009f[_0x9334('0x5')]]['queuecallerabandonAt']=null;queues[_0x27009f['uniqueid']][_0x9334('0x1b')]=!![];queues[_0x27009f[_0x9334('0x5')]][_0x9334('0x25')]=utils[_0x9334('0x15')]();queues[_0x27009f['uniqueid']][_0x9334('0xa')]=_0x27009f[_0x9334('0x23')]['toUpperCase']();utils['info'](util['format'](_0x9334('0x26'),_0x27009f[_0x9334('0x5')],queues[_0x27009f[_0x9334('0x5')]][_0x9334('0x1f')],_0x27009f[_0x9334('0x23')],queues[_0x27009f[_0x9334('0x5')]][_0x9334('0xa')]));writeDB(queues[_0x27009f[_0x9334('0x5')]]);}}else if(!_['isNil'](_0x27009f[_0x9334('0x21')]['queueposition'])){if(!_['isNil'](queues[_0x27009f[_0x9334('0x5')]])&&!queues[_0x27009f[_0x9334('0x5')]][_0x9334('0x1a')]){queues[_0x27009f[_0x9334('0x5')]]['queuecallerabandon']=![];queues[_0x27009f[_0x9334('0x5')]][_0x9334('0x27')]=null;queues[_0x27009f[_0x9334('0x5')]][_0x9334('0x1b')]=!![];queues[_0x27009f[_0x9334('0x5')]]['queuecallerexitAt']=utils[_0x9334('0x15')]();queues[_0x27009f[_0x9334('0x5')]][_0x9334('0xa')]='EXITWITHKEY';utils['info'](util[_0x9334('0x3')](_0x9334('0x28'),_0x27009f[_0x9334('0x5')],queues[_0x27009f[_0x9334('0x5')]]['name'],_0x27009f[_0x9334('0x23')],queues[_0x27009f[_0x9334('0x5')]][_0x9334('0xa')]));}}}catch(_0x43d17e){utils[_0x9334('0x16')](util[_0x9334('0x3')](_0x9334('0x29'),_0x27009f[_0x9334('0x5')]),_0x43d17e);}};exports['queuecallerabandon']=function(_0x30a81e){try{if(!_[_0x9334('0x18')](queues[_0x30a81e[_0x9334('0x5')]])){utils['debug'](util[_0x9334('0x3')](_0x9334('0x2a'),_0x30a81e[_0x9334('0x5')]),_0x30a81e);queues[_0x30a81e['uniqueid']][_0x9334('0x1b')]=![];queues[_0x30a81e[_0x9334('0x5')]][_0x9334('0x25')]=null;queues[_0x30a81e['uniqueid']][_0x9334('0x1a')]=!![];queues[_0x30a81e[_0x9334('0x5')]][_0x9334('0x27')]=utils[_0x9334('0x15')]();queues[_0x30a81e[_0x9334('0x5')]]['queuecallerexitreason']=_0x9334('0x2b');utils['info'](util[_0x9334('0x3')](_0x9334('0x2c'),_0x30a81e[_0x9334('0x5')],queues[_0x30a81e[_0x9334('0x5')]][_0x9334('0x1f')],queues[_0x30a81e['uniqueid']][_0x9334('0xa')]));}}catch(_0x356846){utils[_0x9334('0x16')](util['format'](_0x9334('0x2a'),_0x30a81e[_0x9334('0x5')]),_0x356846);}};exports[_0x9334('0x2d')]=function(_0x5e62a6){try{if(!_['isNil'](queues[_0x5e62a6[_0x9334('0x5')]])){utils[_0x9334('0x11')](util[_0x9334('0x3')]('[%s][queues][queuecallerleave]',_0x5e62a6['uniqueid']),_0x5e62a6);utils['info'](util[_0x9334('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5e62a6[_0x9334('0x5')],queues[_0x5e62a6[_0x9334('0x5')]][_0x9334('0x1f')],_0x5e62a6['connectedlinenum'],_0x5e62a6[_0x9334('0x2e')]));queues[_0x5e62a6[_0x9334('0x5')]][_0x9334('0x2d')]=!![];queues[_0x5e62a6[_0x9334('0x5')]][_0x9334('0x19')]=utils[_0x9334('0x15')]();queues[_0x5e62a6[_0x9334('0x5')]]['holdtime']=utils[_0x9334('0x2f')](queues[_0x5e62a6[_0x9334('0x5')]][_0x9334('0x19')],queues[_0x5e62a6[_0x9334('0x5')]][_0x9334('0x30')]);queues[_0x5e62a6[_0x9334('0x5')]]['position']=_0x5e62a6[_0x9334('0x14')];queues[_0x5e62a6[_0x9334('0x5')]][_0x9334('0x31')]=_0x5e62a6[_0x9334('0x31')];queues[_0x5e62a6[_0x9334('0x5')]]['connectedlinenum']=_0x5e62a6[_0x9334('0x32')];queues[_0x5e62a6[_0x9334('0x5')]]['connectedlinename']=_0x5e62a6[_0x9334('0x2e')];}}catch(_0x3a96bf){utils['error'](util[_0x9334('0x3')](_0x9334('0x33'),_0x5e62a6[_0x9334('0x5')]),_0x3a96bf);}};exports['agentconnect']=function(_0x6143da){try{if(!_[_0x9334('0x18')](queues[_0x6143da['uniqueid']])){utils[_0x9334('0x11')](util[_0x9334('0x3')]('[%s][queues][agentconnect]',_0x6143da[_0x9334('0x5')]),_0x6143da);utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x6143da[_0x9334('0x5')],queues[_0x6143da[_0x9334('0x5')]]['name'],_0x6143da[_0x9334('0x34')],_0x6143da[_0x9334('0x35')]));queues[_0x6143da['uniqueid']][_0x9334('0x1a')]=![];queues[_0x6143da[_0x9334('0x5')]][_0x9334('0x1a')]=![];queues[_0x6143da[_0x9334('0x5')]][_0x9334('0x27')]=null;queues[_0x6143da[_0x9334('0x5')]]['queuecallerexit']=![];queues[_0x6143da[_0x9334('0x5')]]['queuecallerexitreason']=null;queues[_0x6143da[_0x9334('0x5')]]['queuecallerexitAt']=null;queues[_0x6143da[_0x9334('0x5')]][_0x9334('0x36')]=!![];queues[_0x6143da[_0x9334('0x5')]][_0x9334('0x9')]=_0x6143da[_0x9334('0x35')];queues[_0x6143da[_0x9334('0x5')]]['lastAssignedTo']=_0x6143da[_0x9334('0x34')];}}catch(_0x393632){utils[_0x9334('0x16')](util[_0x9334('0x3')](_0x9334('0x37'),_0x6143da[_0x9334('0x5')]),_0x393632);}};exports[_0x9334('0x38')]=function(_0x4ce624){try{if(!_[_0x9334('0x18')](queues[_0x4ce624[_0x9334('0x5')]])){if(queues[_0x4ce624[_0x9334('0x5')]]['queuecallerleaveAt']){utils[_0x9334('0x11')](util[_0x9334('0x3')](_0x9334('0x39'),_0x4ce624[_0x9334('0x5')]),_0x4ce624);queues[_0x4ce624['uniqueid']][_0x9334('0x1a')]=![];queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0x1a')]=![];queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0x27')]=null;queues[_0x4ce624[_0x9334('0x5')]]['queuecallerexit']=![];queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0x25')]=null;queues[_0x4ce624['uniqueid']][_0x9334('0x36')]=!![];queues[_0x4ce624[_0x9334('0x5')]]['lastAssignedTo']=_0x4ce624[_0x9334('0x34')];queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0x1c')]=!![];queues[_0x4ce624['uniqueid']][_0x9334('0x1d')]=utils[_0x9334('0x15')]();if(_0x4ce624[_0x9334('0x3a')]==_0x9334('0x3b')){if(!queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0x3b')]){queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0xa')]=_0x9334('0x3c');}}else{queues[_0x4ce624['uniqueid']]['queuecallerexitreason']=_0x9334('0x3d')+_0x4ce624[_0x9334('0x3a')]['toUpperCase']();}utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4ce624[_0x9334('0x5')],queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0x1f')],_0x4ce624[_0x9334('0x34')],queues[_0x4ce624[_0x9334('0x5')]][_0x9334('0xa')]));writeDB(queues[_0x4ce624[_0x9334('0x5')]]);}}}catch(_0x360dd5){utils['error'](util['format'](_0x9334('0x39'),_0x4ce624['uniqueid']),_0x360dd5);}};exports[_0x9334('0x3e')]=function(_0x549a60){try{if(!_[_0x9334('0x18')](queues[_0x549a60[_0x9334('0x3f')]])){utils['debug'](util[_0x9334('0x3')](_0x9334('0x40'),_0x549a60[_0x9334('0x5')]),_0x549a60);queues[_0x549a60[_0x9334('0x3f')]][_0x9334('0x3b')]=!![];queues[_0x549a60['transfereeuniqueid']]['transfertype']='BLIND';queues[_0x549a60[_0x9334('0x3f')]][_0x9334('0x41')]=_0x549a60[_0x9334('0x42')];queues[_0x549a60['transfereeuniqueid']][_0x9334('0x43')]=_0x549a60[_0x9334('0x3f')];queues[_0x549a60['transfereeuniqueid']][_0x9334('0xa')]='BLINDTRANSFER';utils[_0x9334('0x2')](util[_0x9334('0x3')](_0x9334('0x44'),_0x549a60[_0x9334('0x5')],queues[_0x549a60['transfereeuniqueid']][_0x9334('0x1f')],_0x549a60[_0x9334('0x3f')],_0x549a60[_0x9334('0x42')]));}}catch(_0x309629){utils[_0x9334('0x16')](util[_0x9334('0x3')](_0x9334('0x40'),_0x549a60['uniqueid']),_0x309629);}};exports[_0x9334('0x45')]=function(_0x33f76e){try{utils[_0x9334('0x11')](util[_0x9334('0x3')](_0x9334('0x46'),_0x33f76e['origtransfereruniqueid']),_0x33f76e);if(_0x33f76e['origtransfereruniqueid']==_0x33f76e[_0x9334('0x47')]){if(!_[_0x9334('0x18')](queues[_0x33f76e[_0x9334('0x48')]])){utils['info'](util[_0x9334('0x3')](_0x9334('0x49'),_0x33f76e[_0x9334('0x4a')],queues[_0x33f76e['secondtransfererlinkedid']]['name'],_0x33f76e[_0x9334('0x4b')]));queues[_0x33f76e[_0x9334('0x48')]][_0x9334('0x3b')]=!![];queues[_0x33f76e[_0x9334('0x48')]][_0x9334('0x4c')]=_0x9334('0x4d');queues[_0x33f76e[_0x9334('0x48')]][_0x9334('0x41')]=_0x33f76e['origtransfererexten'];queues[_0x33f76e[_0x9334('0x48')]][_0x9334('0x43')]=_0x33f76e[_0x9334('0x4a')];queues[_0x33f76e['secondtransfererlinkedid']][_0x9334('0xa')]=_0x9334('0x4e');}if(!_[_0x9334('0x18')](queues[_0x33f76e[_0x9334('0x47')]])){if(_0x33f76e['transfereelinkedid']&&queues[_0x33f76e['transfereelinkedid']]){queues[_0x33f76e['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x33f76e[_0x9334('0x3f')]]=_[_0x9334('0x4f')](queues[_0x33f76e['transfereelinkedid']]);queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0xf')]=_0x33f76e[_0x9334('0x50')];queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0x51')]=0x2;queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0x52')]=queues[_0x33f76e[_0x9334('0x48')]]['calleridnum'];queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0x53')]=queues[_0x33f76e['secondtransfererlinkedid']][_0x9334('0x53')];queues[_0x33f76e['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x9334('0x15')]();queues[_0x33f76e['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x9334('0x15')]();queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0x54')]=0x0;queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0x55')]=0x0;utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x33f76e[_0x9334('0x4a')],queues[_0x33f76e['transfereeuniqueid']]['name'],queues[_0x33f76e[_0x9334('0x3f')]][_0x9334('0x52')],queues[_0x33f76e['transfereeuniqueid']][_0x9334('0x53')]));}else{utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x33f76e['origtransfereruniqueid'],queues[_0x33f76e[_0x9334('0x47')]][_0x9334('0x1f')],_0x33f76e['secondtransfererlinkedid']));queues[_0x33f76e[_0x9334('0x47')]][_0x9334('0xf')]=_0x33f76e[_0x9334('0x48')];}}}else if(_0x33f76e[_0x9334('0x56')]==_0x33f76e[_0x9334('0x48')]){if(!_[_0x9334('0x18')](queues[_0x33f76e[_0x9334('0x47')]])){utils['info'](util[_0x9334('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x33f76e[_0x9334('0x4a')],queues[_0x33f76e['origtransfererlinkedid']][_0x9334('0x1f')],_0x33f76e[_0x9334('0x56')],_0x33f76e[_0x9334('0x57')]));queues[_0x33f76e[_0x9334('0x47')]][_0x9334('0x3b')]=!![];queues[_0x33f76e[_0x9334('0x47')]][_0x9334('0x4c')]=_0x9334('0x4d');queues[_0x33f76e['origtransfererlinkedid']][_0x9334('0x41')]=_0x33f76e['secondtransfererexten'];queues[_0x33f76e[_0x9334('0x47')]][_0x9334('0x43')]=_0x33f76e[_0x9334('0x56')];queues[_0x33f76e[_0x9334('0x47')]][_0x9334('0xa')]=_0x9334('0x4e');}if(!_[_0x9334('0x18')](queues[_0x33f76e[_0x9334('0x48')]])){if(_0x33f76e[_0x9334('0x58')]&&queues[_0x33f76e[_0x9334('0x58')]]){queues[_0x33f76e[_0x9334('0x58')]][_0x9334('0x51')]=0x1;queues[_0x33f76e[_0x9334('0x50')]]=_[_0x9334('0x4f')](queues[_0x33f76e['transfertargetlinkedid']]);queues[_0x33f76e['transfertargetuniqueid']][_0x9334('0xf')]=_0x33f76e[_0x9334('0x50')];queues[_0x33f76e['transfertargetuniqueid']][_0x9334('0x51')]=0x2;queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x52')]=queues[_0x33f76e['origtransfererlinkedid']][_0x9334('0x52')];queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x53')]=queues[_0x33f76e['origtransfererlinkedid']][_0x9334('0x53')];queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x30')]=utils[_0x9334('0x15')]();queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x19')]=utils[_0x9334('0x15')]();queues[_0x33f76e['transfertargetuniqueid']][_0x9334('0x54')]=0x0;queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x55')]=0x0;utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x33f76e[_0x9334('0x4a')],queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x1f')],queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0xf')],queues[_0x33f76e[_0x9334('0x50')]][_0x9334('0x52')],queues[_0x33f76e['transfertargetuniqueid']][_0x9334('0x53')]));}else{utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x33f76e[_0x9334('0x4a')],queues[_0x33f76e[_0x9334('0x48')]]['name'],_0x33f76e['origtransfererlinkedid']));queues[_0x33f76e[_0x9334('0x48')]][_0x9334('0xf')]=_0x33f76e[_0x9334('0x47')];}}}}catch(_0x2aea99){utils['error'](util[_0x9334('0x3')](_0x9334('0x46'),_0x33f76e[_0x9334('0x4a')]),_0x2aea99);}};exports['musiconholdstart']=function(_0x208146){try{if(!_[_0x9334('0x18')](queues[_0x208146[_0x9334('0x5')]])){utils[_0x9334('0x11')](util[_0x9334('0x3')](_0x9334('0x59'),_0x208146[_0x9334('0x5')]),_0x208146);queues[_0x208146[_0x9334('0x5')]][_0x9334('0x5a')]=utils[_0x9334('0x15')]();utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x208146['uniqueid'],queues[_0x208146['uniqueid']][_0x9334('0x1f')],queues[_0x208146['uniqueid']]['musiconholdstartAt']));}}catch(_0x47e885){utils[_0x9334('0x16')](util[_0x9334('0x3')]('[%s][queues][musiconholdstart]',_0x208146[_0x9334('0x5')]),_0x47e885);}};exports['musiconholdstop']=function(_0x270a78){try{if(!_[_0x9334('0x18')](queues[_0x270a78[_0x9334('0x5')]])){if(!_[_0x9334('0x18')](queues[_0x270a78['uniqueid']][_0x9334('0x5a')])){utils[_0x9334('0x11')](util['format'](_0x9334('0x5b'),_0x270a78[_0x9334('0x5')]),_0x270a78);queues[_0x270a78[_0x9334('0x5')]]['mohtime']+=utils[_0x9334('0x2f')](utils[_0x9334('0x15')](),queues[_0x270a78[_0x9334('0x5')]][_0x9334('0x5a')]);utils[_0x9334('0x2')](util[_0x9334('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x270a78[_0x9334('0x5')],queues[_0x270a78['uniqueid']][_0x9334('0x1f')],queues[_0x270a78['uniqueid']][_0x9334('0x55')]));delete queues[_0x270a78[_0x9334('0x5')]][_0x9334('0x5a')];}}}catch(_0x25e085){utils[_0x9334('0x16')](util[_0x9334('0x3')](_0x9334('0x5b'),_0x270a78[_0x9334('0x5')]),_0x25e085);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b0a=['queue','lodash','util','./utils','info','format','accountcode','then','name','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','uniqueid','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','endsWith','.wav49','value','replace','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','substring','lastIndexOf','[%s][recordings][queuecallerjoin]'];(function(_0x572a41,_0x2b777a){var _0x26cfda=function(_0x5b8127){while(--_0x5b8127){_0x572a41['push'](_0x572a41['shift']());}};_0x26cfda(++_0x2b777a);}(_0x1b0a,0x97));var _0xa1b0=function(_0x2de086,_0x13d466){_0x2de086=_0x2de086-0x0;var _0x346757=_0x1b0a[_0x2de086];return _0x346757;};'use strict';var _=require(_0xa1b0('0x0'));var util=require(_0xa1b0('0x1'));var utils=require(_0xa1b0('0x2'));var recordings={};function writeDB(_0x2c43fa){utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')]('[%s][recordings][writeDB]',_0x2c43fa['uniqueid']));if(_0x2c43fa[_0xa1b0('0x5')]){utils['getUserByInternal'](_0x2c43fa['accountcode'])[_0xa1b0('0x6')](function(_0x41e5ac){if(_0x41e5ac){_0x2c43fa['membername']=_0x41e5ac[_0xa1b0('0x7')];_0x2c43fa['UserId']=_0x41e5ac['id'];}utils[_0xa1b0('0x8')]('CreateVoiceRecording',_0x2c43fa);});}else{utils[_0xa1b0('0x8')](_0xa1b0('0x9'),_0x2c43fa);}}exports['newchannel']=function(_0x59b78f){try{utils[_0xa1b0('0xa')](util['format']('[%s][recordings][newchannel]',_0x59b78f['uniqueid']),_0x59b78f);if(_0x59b78f['uniqueid']==_0x59b78f[_0xa1b0('0xb')]){utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')](_0xa1b0('0xc'),_0x59b78f[_0xa1b0('0xd')],_0x59b78f[_0xa1b0('0xe')],_0x59b78f[_0xa1b0('0xf')]));recordings[_0x59b78f['uniqueid']]={'uniqueid':_0x59b78f[_0xa1b0('0xd')],'accountcode':_0x59b78f[_0xa1b0('0x5')],'exten':_0x59b78f[_0xa1b0('0xf')],'context':_0x59b78f[_0xa1b0('0xe')],'channel':_0x59b78f['channel'],'monitors':[]};}}catch(_0x401680){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')]('[%s][recordings][newchannel]',_0x59b78f[_0xa1b0('0xd')]),_0x401680);}};exports[_0xa1b0('0x11')]=function(_0x1003e9){try{utils[_0xa1b0('0xa')](util[_0xa1b0('0x4')](_0xa1b0('0x12'),_0x1003e9['uniqueid']),_0x1003e9);if(!_[_0xa1b0('0x13')](recordings[_0x1003e9[_0xa1b0('0xd')]])&&_0x1003e9['channelstate']==0x6){utils['info'](util[_0xa1b0('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1003e9['uniqueid'],_0x1003e9['context'],_0x1003e9[_0xa1b0('0x14')]));}else if(!_['isNil'](recordings[_0x1003e9[_0xa1b0('0xb')]])&&_0x1003e9['channelstate']==0x6&&_0x1003e9['context']!='transfer'){utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')](_0xa1b0('0x15'),_0x1003e9['uniqueid'],_0x1003e9[_0xa1b0('0xb')],_0x1003e9['context'],_0x1003e9[_0xa1b0('0x14')]));recordings[_0x1003e9[_0xa1b0('0xb')]][_0xa1b0('0x5')]=_0x1003e9[_0xa1b0('0x5')];}}catch(_0x32481d){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')](_0xa1b0('0x12'),_0x1003e9[_0xa1b0('0xd')]),_0x32481d);}};exports['varset']=function(_0x39030d){try{if(!_[_0xa1b0('0x13')](_0x39030d[_0xa1b0('0x16')])&&!_[_0xa1b0('0x13')](_0x39030d[_0xa1b0('0x16')]['mixmonitor_filename'])){utils[_0xa1b0('0xa')](util[_0xa1b0('0x4')](_0xa1b0('0x17'),_0x39030d['uniqueid']),_0x39030d);utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x39030d[_0xa1b0('0xd')],_0x39030d[_0xa1b0('0x16')],_0x39030d['value']));if(_[_0xa1b0('0x18')](_0x39030d['value'],_0xa1b0('0x19'))){_0x39030d[_0xa1b0('0x1a')]=_0x39030d[_0xa1b0('0x1a')][_0xa1b0('0x1b')](_0xa1b0('0x19'),'.WAV');}if(recordings[_0x39030d[_0xa1b0('0xb')]]){var _0x317c77=_[_0xa1b0('0x1c')](recordings[_0x39030d[_0xa1b0('0xb')]][_0xa1b0('0x1d')],{'value':_0x39030d[_0xa1b0('0x1a')]});if(_['isNil'](_0x317c77)){recordings[_0x39030d[_0xa1b0('0xb')]][_0xa1b0('0x1d')]['push']({'value':_0x39030d[_0xa1b0('0x1a')]});}}}}catch(_0x515764){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')]('[%s][recordings][varset]',_0x39030d[_0xa1b0('0xd')]),_0x515764);}};exports['hangup']=function(_0xb09338){try{if(!_[_0xa1b0('0x13')](recordings[_0xb09338[_0xa1b0('0xd')]])){utils['debug'](util['format'](_0xa1b0('0x1e'),_0xb09338[_0xa1b0('0xd')]),_0xb09338);utils['info'](util[_0xa1b0('0x4')](_0xa1b0('0x1f'),_0xb09338['uniqueid'],_0xb09338['calleridnum'],_0xb09338['calleridname'],_0xb09338[_0xa1b0('0x20')]));recordings[_0xb09338['uniqueid']][_0xa1b0('0x21')]=_0xb09338[_0xa1b0('0x21')];recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x22')]=_0xb09338[_0xa1b0('0x22')];recordings[_0xb09338['uniqueid']]['connectedlinenum']=_0xb09338[_0xa1b0('0x23')];recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x24')]=_0xb09338[_0xa1b0('0x24')];if(recordings[_0xb09338['uniqueid']]['type']=='outbound'&&recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x5')]){recordings[_0xb09338[_0xa1b0('0xd')]]['connectedlinenum']=recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x5')];recordings[_0xb09338[_0xa1b0('0xd')]][_0xa1b0('0x24')]='';}recordings[_0xb09338[_0xa1b0('0xd')]]['monitors'][_0xa1b0('0x25')](function(_0x359277){var _0x5ce930=_[_0xa1b0('0x26')](recordings[_0xb09338[_0xa1b0('0xd')]]);_0x5ce930['value']=_0x359277['value'];writeDB(_0x5ce930);});delete recordings[_0xb09338[_0xa1b0('0xd')]];}}catch(_0x8fc0aa){utils[_0xa1b0('0x10')](util['format'](_0xa1b0('0x1e'),_0xb09338[_0xa1b0('0xd')]),_0x8fc0aa);}};exports[_0xa1b0('0x27')]=function(_0xa96708){try{if(!_[_0xa1b0('0x13')](recordings[_0xa96708[_0xa1b0('0xd')]])){utils['debug'](util[_0xa1b0('0x4')](_0xa1b0('0x28'),_0xa96708[_0xa1b0('0xd')]),_0xa96708);utils[_0xa1b0('0x3')](util['format'](_0xa1b0('0x29'),_0xa96708['uniqueid'],_0xa96708['application'],_0xa96708['appdata']));if(_0xa96708[_0xa1b0('0x2a')][_0xa1b0('0x2b')]()=='set'&&_[_0xa1b0('0x2c')](_0xa96708[_0xa1b0('0x2d')]['toLowerCase'](),'cdr')){var _0x5be97a=_0xa96708['appdata']['split']('=');var _0xd7749c=_0x5be97a[0x0][_0xa1b0('0x2e')](_0x5be97a[0x0]['lastIndexOf']('(')+0x1,_0x5be97a[0x0][_0xa1b0('0x2f')](')'));var _0x4d6237=_0x5be97a[0x1];recordings[_0xa96708[_0xa1b0('0xd')]][_0xd7749c]=_0x4d6237;}}}catch(_0x443fea){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')](_0xa1b0('0x28'),_0xa96708[_0xa1b0('0xd')]),_0x443fea);}};exports['queuecallerjoin']=function(_0x28b9f5){try{if(!_[_0xa1b0('0x13')](recordings[_0x28b9f5[_0xa1b0('0xd')]])){utils[_0xa1b0('0xa')](util[_0xa1b0('0x4')](_0xa1b0('0x30'),_0x28b9f5[_0xa1b0('0xd')]),_0x28b9f5);utils[_0xa1b0('0x3')](util[_0xa1b0('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x28b9f5['uniqueid'],_0x28b9f5[_0xa1b0('0x31')]));recordings[_0x28b9f5[_0xa1b0('0xd')]][_0xa1b0('0x31')]=_0x28b9f5[_0xa1b0('0x31')];}}catch(_0x5b060a){utils[_0xa1b0('0x10')](util[_0xa1b0('0x4')](_0xa1b0('0x30'),_0x28b9f5[_0xa1b0('0xd')]),_0x5b060a);}};
\ No newline at end of file
+var _0xd1c0=['debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','[%s][recordings][writeDB]','uniqueid','then','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','accountcode','error','newstate'];(function(_0x20e474,_0x159b11){var _0x43a7f6=function(_0x5c493d){while(--_0x5c493d){_0x20e474['push'](_0x20e474['shift']());}};_0x43a7f6(++_0x159b11);}(_0xd1c0,0x1ae));var _0x0d1c=function(_0x5919d5,_0x121c21){_0x5919d5=_0x5919d5-0x0;var _0xced891=_0xd1c0[_0x5919d5];return _0xced891;};'use strict';var _=require(_0x0d1c('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x2039ab){utils[_0x0d1c('0x1')](util[_0x0d1c('0x2')](_0x0d1c('0x3'),_0x2039ab[_0x0d1c('0x4')]));if(_0x2039ab['accountcode']){utils['getUserByInternal'](_0x2039ab['accountcode'])[_0x0d1c('0x5')](function(_0x38b4e8){if(_0x38b4e8){_0x2039ab['membername']=_0x38b4e8[_0x0d1c('0x6')];_0x2039ab[_0x0d1c('0x7')]=_0x38b4e8['id'];}utils[_0x0d1c('0x8')](_0x0d1c('0x9'),_0x2039ab);});}else{utils['request'](_0x0d1c('0x9'),_0x2039ab);}}exports[_0x0d1c('0xa')]=function(_0x2e8372){try{utils['debug'](util[_0x0d1c('0x2')](_0x0d1c('0xb'),_0x2e8372[_0x0d1c('0x4')]),_0x2e8372);if(_0x2e8372[_0x0d1c('0x4')]==_0x2e8372[_0x0d1c('0xc')]){utils[_0x0d1c('0x1')](util[_0x0d1c('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2e8372['uniqueid'],_0x2e8372[_0x0d1c('0xd')],_0x2e8372[_0x0d1c('0xe')]));recordings[_0x2e8372[_0x0d1c('0x4')]]={'uniqueid':_0x2e8372[_0x0d1c('0x4')],'accountcode':_0x2e8372[_0x0d1c('0xf')],'exten':_0x2e8372[_0x0d1c('0xe')],'context':_0x2e8372[_0x0d1c('0xd')],'channel':_0x2e8372['channel'],'monitors':[]};}}catch(_0x4efcd0){utils[_0x0d1c('0x10')](util[_0x0d1c('0x2')](_0x0d1c('0xb'),_0x2e8372[_0x0d1c('0x4')]),_0x4efcd0);}};exports[_0x0d1c('0x11')]=function(_0x517624){try{utils[_0x0d1c('0x12')](util[_0x0d1c('0x2')]('[%s][recordings][newstate]',_0x517624[_0x0d1c('0x4')]),_0x517624);if(!_[_0x0d1c('0x13')](recordings[_0x517624[_0x0d1c('0x4')]])&&_0x517624[_0x0d1c('0x14')]==0x6){utils[_0x0d1c('0x1')](util['format'](_0x0d1c('0x15'),_0x517624[_0x0d1c('0x4')],_0x517624[_0x0d1c('0xd')],_0x517624[_0x0d1c('0x16')]));}else if(!_[_0x0d1c('0x13')](recordings[_0x517624[_0x0d1c('0xc')]])&&_0x517624[_0x0d1c('0x14')]==0x6&&_0x517624[_0x0d1c('0xd')]!='transfer'){utils['info'](util['format'](_0x0d1c('0x17'),_0x517624[_0x0d1c('0x4')],_0x517624[_0x0d1c('0xc')],_0x517624[_0x0d1c('0xd')],_0x517624[_0x0d1c('0x16')]));recordings[_0x517624[_0x0d1c('0xc')]][_0x0d1c('0xf')]=_0x517624[_0x0d1c('0xf')];}}catch(_0x5bee6b){utils[_0x0d1c('0x10')](util['format'](_0x0d1c('0x18'),_0x517624[_0x0d1c('0x4')]),_0x5bee6b);}};exports['varset']=function(_0x3ecd4c){try{if(!_['isNil'](_0x3ecd4c[_0x0d1c('0x19')])&&!_['isNil'](_0x3ecd4c[_0x0d1c('0x19')][_0x0d1c('0x1a')])){utils['debug'](util[_0x0d1c('0x2')]('[%s][recordings][varset]',_0x3ecd4c[_0x0d1c('0x4')]),_0x3ecd4c);utils['info'](util[_0x0d1c('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3ecd4c[_0x0d1c('0x4')],_0x3ecd4c[_0x0d1c('0x19')],_0x3ecd4c[_0x0d1c('0x1b')]));if(_[_0x0d1c('0x1c')](_0x3ecd4c['value'],_0x0d1c('0x1d'))){_0x3ecd4c[_0x0d1c('0x1b')]=_0x3ecd4c[_0x0d1c('0x1b')][_0x0d1c('0x1e')](_0x0d1c('0x1d'),_0x0d1c('0x1f'));}if(recordings[_0x3ecd4c['linkedid']]){var _0x59665d=_['find'](recordings[_0x3ecd4c[_0x0d1c('0xc')]]['monitors'],{'value':_0x3ecd4c[_0x0d1c('0x1b')]});if(_[_0x0d1c('0x13')](_0x59665d)){recordings[_0x3ecd4c[_0x0d1c('0xc')]][_0x0d1c('0x20')][_0x0d1c('0x21')]({'value':_0x3ecd4c['value']});}}}}catch(_0x4bf43c){utils[_0x0d1c('0x10')](util['format'](_0x0d1c('0x22'),_0x3ecd4c[_0x0d1c('0x4')]),_0x4bf43c);}};exports[_0x0d1c('0x23')]=function(_0x3e9a26){try{if(!_[_0x0d1c('0x13')](recordings[_0x3e9a26[_0x0d1c('0x4')]])){utils[_0x0d1c('0x12')](util[_0x0d1c('0x2')](_0x0d1c('0x24'),_0x3e9a26['uniqueid']),_0x3e9a26);utils['info'](util[_0x0d1c('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3e9a26['uniqueid'],_0x3e9a26[_0x0d1c('0x25')],_0x3e9a26[_0x0d1c('0x26')],_0x3e9a26['cause-txt']));recordings[_0x3e9a26[_0x0d1c('0x4')]][_0x0d1c('0x25')]=_0x3e9a26[_0x0d1c('0x25')];recordings[_0x3e9a26[_0x0d1c('0x4')]]['calleridname']=_0x3e9a26['calleridname'];recordings[_0x3e9a26[_0x0d1c('0x4')]][_0x0d1c('0x27')]=_0x3e9a26[_0x0d1c('0x27')];recordings[_0x3e9a26[_0x0d1c('0x4')]]['connectedlinename']=_0x3e9a26[_0x0d1c('0x28')];if(recordings[_0x3e9a26[_0x0d1c('0x4')]][_0x0d1c('0x29')]==_0x0d1c('0x2a')&&recordings[_0x3e9a26[_0x0d1c('0x4')]][_0x0d1c('0xf')]){recordings[_0x3e9a26['uniqueid']][_0x0d1c('0x27')]=recordings[_0x3e9a26['uniqueid']][_0x0d1c('0xf')];recordings[_0x3e9a26['uniqueid']][_0x0d1c('0x28')]='';}recordings[_0x3e9a26[_0x0d1c('0x4')]][_0x0d1c('0x20')]['forEach'](function(_0x1e88ce){var _0x2d70ef=_[_0x0d1c('0x2b')](recordings[_0x3e9a26[_0x0d1c('0x4')]]);_0x2d70ef['value']=_0x1e88ce[_0x0d1c('0x1b')];writeDB(_0x2d70ef);});delete recordings[_0x3e9a26['uniqueid']];}}catch(_0xde7d94){utils[_0x0d1c('0x10')](util[_0x0d1c('0x2')]('[%s][recordings][hangup]',_0x3e9a26[_0x0d1c('0x4')]),_0xde7d94);}};exports['newexten']=function(_0x212603){try{if(!_[_0x0d1c('0x13')](recordings[_0x212603[_0x0d1c('0x4')]])){utils['debug'](util['format'](_0x0d1c('0x2c'),_0x212603['uniqueid']),_0x212603);utils['info'](util[_0x0d1c('0x2')](_0x0d1c('0x2d'),_0x212603[_0x0d1c('0x4')],_0x212603[_0x0d1c('0x2e')],_0x212603[_0x0d1c('0x2f')]));if(_0x212603[_0x0d1c('0x2e')]['toLowerCase']()==_0x0d1c('0x30')&&_[_0x0d1c('0x31')](_0x212603['appdata'][_0x0d1c('0x32')](),'cdr')){var _0x5f3ef4=_0x212603['appdata']['split']('=');var _0x20f08e=_0x5f3ef4[0x0]['substring'](_0x5f3ef4[0x0][_0x0d1c('0x33')]('(')+0x1,_0x5f3ef4[0x0]['lastIndexOf'](')'));var _0x315377=_0x5f3ef4[0x1];recordings[_0x212603[_0x0d1c('0x4')]][_0x20f08e]=_0x315377;}}}catch(_0x363f5f){utils[_0x0d1c('0x10')](util[_0x0d1c('0x2')](_0x0d1c('0x2c'),_0x212603[_0x0d1c('0x4')]),_0x363f5f);}};exports[_0x0d1c('0x34')]=function(_0x49d84f){try{if(!_['isNil'](recordings[_0x49d84f['uniqueid']])){utils[_0x0d1c('0x12')](util[_0x0d1c('0x2')](_0x0d1c('0x35'),_0x49d84f[_0x0d1c('0x4')]),_0x49d84f);utils[_0x0d1c('0x1')](util['format'](_0x0d1c('0x36'),_0x49d84f[_0x0d1c('0x4')],_0x49d84f[_0x0d1c('0x37')]));recordings[_0x49d84f['uniqueid']][_0x0d1c('0x37')]=_0x49d84f['queue'];}}catch(_0x40013f){utils[_0x0d1c('0x10')](util[_0x0d1c('0x2')](_0x0d1c('0x35'),_0x49d84f[_0x0d1c('0x4')]),_0x40013f);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe9e8=['attended','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type'];(function(_0x414180,_0x1f980b){var _0x37b029=function(_0x4105b1){while(--_0x4105b1){_0x414180['push'](_0x414180['shift']());}};_0x37b029(++_0x1f980b);}(_0xe9e8,0x7e));var _0x8e9e=function(_0x46c275,_0x5577fd){_0x46c275=_0x46c275-0x0;var _0x364b9f=_0xe9e8[_0x46c275];return _0x364b9f;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var utils=require('./utils');function writeDB(_0x2946bf){utils[_0x8e9e('0x2')](util[_0x8e9e('0x3')](_0x8e9e('0x4'),_0x2946bf[_0x8e9e('0x5')]===_0x8e9e('0x6')?_0x2946bf['origtransfereruniqueid']:_0x2946bf[_0x8e9e('0x7')],_0x2946bf[_0x8e9e('0x5')]));utils[_0x8e9e('0x8')](_0x8e9e('0x9'),_0x2946bf);}exports['blindtransfer']=function(_0x350294){try{utils[_0x8e9e('0xa')](util[_0x8e9e('0x3')](_0x8e9e('0xb'),_0x350294[_0x8e9e('0x7')]),_0x350294);utils[_0x8e9e('0x2')](util['format'](_0x8e9e('0xc'),_0x350294[_0x8e9e('0x7')],_0x350294[_0x8e9e('0xd')],_0x350294[_0x8e9e('0xe')],_0x350294['transfereecalleridnum'],_0x350294[_0x8e9e('0xf')]));_0x350294[_0x8e9e('0x5')]=_0x8e9e('0x10');writeDB(_0x350294);}catch(_0x2afb38){utils[_0x8e9e('0x11')](util['format'](_0x8e9e('0xb'),_0x350294[_0x8e9e('0x7')]),_0x2afb38);}};exports[_0x8e9e('0x12')]=function(_0x2070b2){try{utils['debug'](util[_0x8e9e('0x3')](_0x8e9e('0x13'),_0x2070b2[_0x8e9e('0x14')]),_0x2070b2);utils['info'](util[_0x8e9e('0x3')](_0x8e9e('0x15'),_0x2070b2[_0x8e9e('0x14')],_0x2070b2['origtransferercalleridnum'],_0x2070b2[_0x8e9e('0x16')],_0x2070b2['transfertargetcalleridnum'],_0x2070b2[_0x8e9e('0x17')]));_0x2070b2=_[_0x8e9e('0x18')](_0x2070b2,{'transfererchannel':_0x2070b2['origtransfererchannel'],'transferercalleridnum':_0x2070b2[_0x8e9e('0x19')],'transferercalleridname':_0x2070b2[_0x8e9e('0x16')],'transfererconnectedlinenum':_0x2070b2[_0x8e9e('0x1a')],'transfererconnectedlinename':_0x2070b2[_0x8e9e('0x1b')],'transfereraccountcode':_0x2070b2[_0x8e9e('0x1c')],'transferercontext':_0x2070b2[_0x8e9e('0x1d')],'transfererexten':_0x2070b2[_0x8e9e('0x1e')],'transfererlinkedid':_0x2070b2[_0x8e9e('0x1f')],'context':_0x2070b2[_0x8e9e('0x20')],'extension':_0x2070b2[_0x8e9e('0x21')],'type':_0x8e9e('0x6')});if(_[_0x8e9e('0x22')](_0x2070b2[_0x8e9e('0x23')])){_0x2070b2=_['assign'](_0x2070b2,{'transfereechannel':_0x2070b2[_0x8e9e('0x24')],'transfereecalleridnum':_0x2070b2[_0x8e9e('0x25')],'transfereecalleridname':_0x2070b2[_0x8e9e('0x17')],'transfereeconnectedlinenum':_0x2070b2[_0x8e9e('0x26')],'transfereeconnectedlinename':_0x2070b2[_0x8e9e('0x27')],'transfereeaccountcode':_0x2070b2[_0x8e9e('0x28')],'transfereecontext':_0x2070b2[_0x8e9e('0x29')],'transfereeexten':_0x2070b2[_0x8e9e('0x2a')],'transfereelinkedid':_0x2070b2[_0x8e9e('0x2b')]});}writeDB(_0x2070b2);}catch(_0x40a3f9){utils[_0x8e9e('0x11')](util[_0x8e9e('0x3')](_0x8e9e('0x13'),_0x2070b2[_0x8e9e('0x14')]),_0x40a3f9);}};
\ No newline at end of file
+var _0x1762=['util','info','attended','origtransfereruniqueid','uniqueid','type','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext'];(function(_0x55fb3d,_0x28a4b3){var _0x336dac=function(_0x3b4227){while(--_0x3b4227){_0x55fb3d['push'](_0x55fb3d['shift']());}};_0x336dac(++_0x28a4b3);}(_0x1762,0xa5));var _0x2176=function(_0xa16640,_0x25fc45){_0xa16640=_0xa16640-0x0;var _0x34172f=_0x1762[_0xa16640];return _0x34172f;};'use strict';var _=require('lodash');var util=require(_0x2176('0x0'));var utils=require('./utils');function writeDB(_0x4475e5){utils[_0x2176('0x1')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x4475e5['type']===_0x2176('0x2')?_0x4475e5[_0x2176('0x3')]:_0x4475e5[_0x2176('0x4')],_0x4475e5[_0x2176('0x5')]));utils['request']('CreateVoiceTransferReport',_0x4475e5);}exports[_0x2176('0x6')]=function(_0x554972){try{utils[_0x2176('0x7')](util[_0x2176('0x8')](_0x2176('0x9'),_0x554972[_0x2176('0x4')]),_0x554972);utils[_0x2176('0x1')](util[_0x2176('0x8')](_0x2176('0xa'),_0x554972['uniqueid'],_0x554972['transferercalleridnum'],_0x554972[_0x2176('0xb')],_0x554972['transfereecalleridnum'],_0x554972[_0x2176('0xc')]));_0x554972[_0x2176('0x5')]=_0x2176('0xd');writeDB(_0x554972);}catch(_0x2d72e6){utils[_0x2176('0xe')](util[_0x2176('0x8')](_0x2176('0x9'),_0x554972[_0x2176('0x4')]),_0x2d72e6);}};exports['attendedtransfer']=function(_0x28b9f9){try{utils['debug'](util[_0x2176('0x8')](_0x2176('0xf'),_0x28b9f9[_0x2176('0x3')]),_0x28b9f9);utils['info'](util[_0x2176('0x8')](_0x2176('0x10'),_0x28b9f9['origtransfereruniqueid'],_0x28b9f9[_0x2176('0x11')],_0x28b9f9[_0x2176('0x12')],_0x28b9f9['transfertargetcalleridnum'],_0x28b9f9[_0x2176('0x13')]));_0x28b9f9=_[_0x2176('0x14')](_0x28b9f9,{'transfererchannel':_0x28b9f9['origtransfererchannel'],'transferercalleridnum':_0x28b9f9[_0x2176('0x11')],'transferercalleridname':_0x28b9f9[_0x2176('0x12')],'transfererconnectedlinenum':_0x28b9f9[_0x2176('0x15')],'transfererconnectedlinename':_0x28b9f9[_0x2176('0x16')],'transfereraccountcode':_0x28b9f9[_0x2176('0x17')],'transferercontext':_0x28b9f9['secondtransferercontext'],'transfererexten':_0x28b9f9[_0x2176('0x18')],'transfererlinkedid':_0x28b9f9[_0x2176('0x19')],'context':_0x28b9f9[_0x2176('0x1a')],'extension':_0x28b9f9['origtransfererexten'],'type':'attended'});if(_[_0x2176('0x1b')](_0x28b9f9['transfereechannel'])){_0x28b9f9=_[_0x2176('0x14')](_0x28b9f9,{'transfereechannel':_0x28b9f9['transfertargetchannel'],'transfereecalleridnum':_0x28b9f9[_0x2176('0x1c')],'transfereecalleridname':_0x28b9f9[_0x2176('0x13')],'transfereeconnectedlinenum':_0x28b9f9[_0x2176('0x1d')],'transfereeconnectedlinename':_0x28b9f9[_0x2176('0x1e')],'transfereeaccountcode':_0x28b9f9[_0x2176('0x1f')],'transfereecontext':_0x28b9f9[_0x2176('0x20')],'transfereeexten':_0x28b9f9['transfertargetexten'],'transfereelinkedid':_0x28b9f9['transfertargetlinkedid']});}writeDB(_0x28b9f9);}catch(_0x7f42f7){utils[_0x2176('0xe')](util[_0x2176('0x8')](_0x2176('0xf'),_0x28b9f9[_0x2176('0x3')]),_0x7f42f7);}};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d8b=['GetVoiceQueue','name','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','interface','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName'];(function(_0x1ac852,_0x185e6e){var _0x4f9fbf=function(_0x39ea01){while(--_0x39ea01){_0x1ac852['push'](_0x1ac852['shift']());}};_0x4f9fbf(++_0x185e6e);}(_0x8d8b,0x75));var _0xb8d8=function(_0x1e0715,_0x1df11a){_0x1e0715=_0x1e0715-0x0;var _0x5c69f3=_0x8d8b[_0x1e0715];return _0x5c69f3;};'use strict';var BPromise=require(_0xb8d8('0x0'));var jayson=require(_0xb8d8('0x1'));var moment=require(_0xb8d8('0x2'));var util=require(_0xb8d8('0x3'));var client=jayson[_0xb8d8('0x4')][_0xb8d8('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xb8d8('0x6'));exports[_0xb8d8('0x7')]=function(_0xf2802e,_0x5494a0){logger[_0xb8d8('0x7')](_0xf2802e,_0x5494a0?util[_0xb8d8('0x8')](_0x5494a0,{'showHidden':![],'depth':null}):'');};exports[_0xb8d8('0x9')]=function(_0xab0f64,_0x445296){logger[_0xb8d8('0x9')](_0xab0f64,_0x445296?util[_0xb8d8('0x8')](_0x445296,{'showHidden':![],'depth':null}):'');};exports[_0xb8d8('0xa')]=function(_0x503337,_0x2bc0f9){logger[_0xb8d8('0xa')](_0x503337,_0x2bc0f9?util[_0xb8d8('0x8')](_0x2bc0f9,{'showHidden':![],'depth':null}):'');};exports[_0xb8d8('0xb')]=function(_0x217e2d,_0x523dc2){return client['request'](_0x217e2d,{'body':_0x523dc2})['then'](function(_0x1868e8){logger['debug']('[utils][request]\x20name:%s',_0x217e2d,_0x1868e8?util[_0xb8d8('0x8')](_0x1868e8,{'showHidden':![],'depth':null}):'');})[_0xb8d8('0xc')](function(_0x1087e7){logger['error'](_0xb8d8('0xd'),_0x217e2d,_0x1087e7?util['inspect'](_0x1087e7,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1196b3){return client[_0xb8d8('0xb')](_0xb8d8('0xe'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xb8d8('0xf')],'where':_0x1196b3,'limit':0x1}})['then'](function(_0x53f7a9){logger[_0xb8d8('0x9')](_0xb8d8('0x10'),JSON[_0xb8d8('0x11')](_0x1196b3),_0x53f7a9?util[_0xb8d8('0x8')](_0x53f7a9,{'showHidden':![],'depth':null}):'');return _0x53f7a9['result'][_0xb8d8('0x12')]?_0x53f7a9['result'][0x0]:null;});}exports[_0xb8d8('0x13')]=function(_0x2e7c07){return new BPromise(function(_0x44f509,_0x443c21){if(_0x2e7c07){return getUser({'internal':_0x2e7c07})[_0xb8d8('0x14')](function(_0x75303c){logger[_0xb8d8('0x7')](_0xb8d8('0x15'),_0x2e7c07,_0x75303c?'found':_0xb8d8('0x16'));return _0x44f509(_0x75303c);})['catch'](function(_0x1aba16){logger['error']('[utils][getUserByInternal]',_0x1aba16?util[_0xb8d8('0x8')](_0x1aba16,{'showHidden':![],'depth':null}):'');return _0x44f509(null);});}return _0x44f509(null);});};exports[_0xb8d8('0x17')]=function(_0x2b3ac0){return new BPromise(function(_0x3737ac,_0x2248bf){if(_0x2b3ac0){return getUser({'interface':_0x2b3ac0})[_0xb8d8('0x14')](function(_0x1a5f07){logger[_0xb8d8('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2b3ac0,_0x1a5f07?_0xb8d8('0x18'):_0xb8d8('0x16'));return _0x3737ac(_0x1a5f07);})[_0xb8d8('0xc')](function(_0x388e3c){logger['error'](_0xb8d8('0x19'),_0x388e3c?util['inspect'](_0x388e3c,{'showHidden':![],'depth':null}):'');return _0x3737ac(null);});}return _0x3737ac(null);});};exports[_0xb8d8('0x1a')]=function(_0x396f41){return new BPromise(function(_0x4cf0c6,_0x51e437){if(_0x396f41){return getUser({'name':_0x396f41})[_0xb8d8('0x14')](function(_0x25b043){logger['info'](_0xb8d8('0x1b'),_0x396f41,_0x25b043?_0xb8d8('0x18'):_0xb8d8('0x16'));return _0x4cf0c6(_0x25b043);})[_0xb8d8('0xc')](function(_0x59515c){logger[_0xb8d8('0xa')](_0xb8d8('0x1c'),_0x59515c?util[_0xb8d8('0x8')](_0x59515c,{'showHidden':![],'depth':null}):'');return _0x4cf0c6(null);});}return _0x4cf0c6(null);});};exports[_0xb8d8('0x1d')]=function(_0x4ec643){return new BPromise(function(_0x335dff,_0x4bcd11){if(_0x4ec643){return client[_0xb8d8('0xb')](_0xb8d8('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb8d8('0x1f'),'type',_0xb8d8('0x20'),'acwTimeout'],'where':{'name':_0x4ec643},'limit':0x1}})[_0xb8d8('0x14')](function(_0x885cff){logger[_0xb8d8('0x9')](_0xb8d8('0x21'),_0x4ec643,_0x885cff?util[_0xb8d8('0x8')](_0x885cff,{'showHidden':![],'depth':null}):'');logger[_0xb8d8('0x7')](_0xb8d8('0x22'),_0x4ec643,_0x885cff?_0xb8d8('0x18'):_0xb8d8('0x16'));return _0x335dff(_0x885cff[_0xb8d8('0x23')]['length']?_0x885cff['result'][0x0]:null);})[_0xb8d8('0xc')](function(_0x590a95){logger[_0xb8d8('0xa')](_0xb8d8('0x24'),_0x590a95?util[_0xb8d8('0x8')](_0x590a95,{'showHidden':![],'depth':null}):'');return _0x335dff(null);});}return _0x335dff(null);});};exports[_0xb8d8('0x25')]=function(_0x2e05b0,_0x59c571){return moment(_0x2e05b0)[_0xb8d8('0x26')](_0x59c571,_0xb8d8('0x27'))[_0xb8d8('0x28')](_0xb8d8('0x29'));};exports[_0xb8d8('0x2a')]=function(_0x52874f,_0x557790){return moment(_0x52874f)[_0xb8d8('0x2b')](_0x557790,_0xb8d8('0x27'))[_0xb8d8('0x28')](_0xb8d8('0x29'));};exports[_0xb8d8('0x2c')]=function(_0x43aea9,_0x1cb66e){return moment(_0x43aea9)[_0xb8d8('0x2d')](moment(_0x1cb66e),_0xb8d8('0x27'));};exports[_0xb8d8('0x2e')]=function(_0xfe0c97,_0x19da6c){return parseInt(_0xfe0c97,0xa)+parseInt(_0x19da6c,0xa);};exports['now']=function(){return moment()[_0xb8d8('0x28')](_0xb8d8('0x29'));};exports[_0xb8d8('0x2f')]=function(_0x420433,_0x3224f0){if(_0x3224f0){return moment(_0x420433)[_0xb8d8('0x2f')](_0x3224f0);}return!![];};exports[_0xb8d8('0x30')]=function(_0x4ac6da,_0x5dcb5d){if(_0x5dcb5d){return moment(_0x4ac6da)[_0xb8d8('0x30')](_0x5dcb5d);}else if(_0x4ac6da){return!![];}return![];};
\ No newline at end of file
+var _0x3308=['http','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client'];(function(_0x384e68,_0x306642){var _0x4927d9=function(_0x2d7f5a){while(--_0x2d7f5a){_0x384e68['push'](_0x384e68['shift']());}};_0x4927d9(++_0x306642);}(_0x3308,0x17c));var _0x8330=function(_0x464fd5,_0x2c07d7){_0x464fd5=_0x464fd5-0x0;var _0x497293=_0x3308[_0x464fd5];return _0x497293;};'use strict';var BPromise=require(_0x8330('0x0'));var jayson=require(_0x8330('0x1'));var moment=require(_0x8330('0x2'));var util=require('util');var client=jayson[_0x8330('0x3')][_0x8330('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x8330('0x5')]=function(_0x13f875,_0x45201a){logger['info'](_0x13f875,_0x45201a?util[_0x8330('0x6')](_0x45201a,{'showHidden':![],'depth':null}):'');};exports[_0x8330('0x7')]=function(_0x51d077,_0x115648){logger[_0x8330('0x7')](_0x51d077,_0x115648?util[_0x8330('0x6')](_0x115648,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5d9de3,_0x3eee28){logger[_0x8330('0x8')](_0x5d9de3,_0x3eee28?util[_0x8330('0x6')](_0x3eee28,{'showHidden':![],'depth':null}):'');};exports[_0x8330('0x9')]=function(_0xa3d9dc,_0x227adc){return client[_0x8330('0x9')](_0xa3d9dc,{'body':_0x227adc})['then'](function(_0x5958c8){logger[_0x8330('0x7')](_0x8330('0xa'),_0xa3d9dc,_0x5958c8?util['inspect'](_0x5958c8,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5d6274){logger[_0x8330('0x8')](_0x8330('0xa'),_0xa3d9dc,_0x5d6274?util[_0x8330('0x6')](_0x5d6274,{'showHidden':![],'depth':null}):'');});};function getUser(_0x593c53){return client[_0x8330('0x9')](_0x8330('0xb'),{'options':{'raw':!![],'attributes':['id',_0x8330('0xc'),_0x8330('0xd'),_0x8330('0xe')],'where':_0x593c53,'limit':0x1}})[_0x8330('0xf')](function(_0x46a2bf){logger[_0x8330('0x7')](_0x8330('0x10'),JSON[_0x8330('0x11')](_0x593c53),_0x46a2bf?util[_0x8330('0x6')](_0x46a2bf,{'showHidden':![],'depth':null}):'');return _0x46a2bf[_0x8330('0x12')][_0x8330('0x13')]?_0x46a2bf[_0x8330('0x12')][0x0]:null;});}exports[_0x8330('0x14')]=function(_0x580ec2){return new BPromise(function(_0xde11ec,_0x3f6c9e){if(_0x580ec2){return getUser({'internal':_0x580ec2})[_0x8330('0xf')](function(_0x508f1b){logger['info'](_0x8330('0x15'),_0x580ec2,_0x508f1b?'found':_0x8330('0x16'));return _0xde11ec(_0x508f1b);})[_0x8330('0x17')](function(_0x497ca1){logger[_0x8330('0x8')](_0x8330('0x18'),_0x497ca1?util[_0x8330('0x6')](_0x497ca1,{'showHidden':![],'depth':null}):'');return _0xde11ec(null);});}return _0xde11ec(null);});};exports[_0x8330('0x19')]=function(_0x552ad4){return new BPromise(function(_0xe41955,_0x3b5735){if(_0x552ad4){return getUser({'interface':_0x552ad4})[_0x8330('0xf')](function(_0x325722){logger[_0x8330('0x5')](_0x8330('0x1a'),_0x552ad4,_0x325722?_0x8330('0x1b'):'notfound');return _0xe41955(_0x325722);})['catch'](function(_0x411498){logger[_0x8330('0x8')](_0x8330('0x1c'),_0x411498?util['inspect'](_0x411498,{'showHidden':![],'depth':null}):'');return _0xe41955(null);});}return _0xe41955(null);});};exports['getUserByName']=function(_0x45fc32){return new BPromise(function(_0x2fc96d,_0x442746){if(_0x45fc32){return getUser({'name':_0x45fc32})[_0x8330('0xf')](function(_0x1949b5){logger[_0x8330('0x5')](_0x8330('0x1d'),_0x45fc32,_0x1949b5?'found':'notfound');return _0x2fc96d(_0x1949b5);})[_0x8330('0x17')](function(_0x52b582){logger['error'](_0x8330('0x1e'),_0x52b582?util['inspect'](_0x52b582,{'showHidden':![],'depth':null}):'');return _0x2fc96d(null);});}return _0x2fc96d(null);});};exports[_0x8330('0x1f')]=function(_0x31f171){return new BPromise(function(_0x11df52,_0x42b4c5){if(_0x31f171){return client[_0x8330('0x9')](_0x8330('0x20'),{'options':{'raw':!![],'attributes':['id',_0x8330('0xd'),_0x8330('0x21'),_0x8330('0x22'),_0x8330('0x23')],'where':{'name':_0x31f171},'limit':0x1}})['then'](function(_0x589a86){logger[_0x8330('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x31f171,_0x589a86?util[_0x8330('0x6')](_0x589a86,{'showHidden':![],'depth':null}):'');logger[_0x8330('0x5')](_0x8330('0x24'),_0x31f171,_0x589a86?'found':_0x8330('0x16'));return _0x11df52(_0x589a86[_0x8330('0x12')][_0x8330('0x13')]?_0x589a86[_0x8330('0x12')][0x0]:null);})[_0x8330('0x17')](function(_0x11746f){logger[_0x8330('0x8')](_0x8330('0x25'),_0x11746f?util[_0x8330('0x6')](_0x11746f,{'showHidden':![],'depth':null}):'');return _0x11df52(null);});}return _0x11df52(null);});};exports[_0x8330('0x26')]=function(_0x5a07ea,_0x53aadc){return moment(_0x5a07ea)['add'](_0x53aadc,_0x8330('0x27'))[_0x8330('0x28')](_0x8330('0x29'));};exports[_0x8330('0x2a')]=function(_0x25c7c6,_0x41df8c){return moment(_0x25c7c6)['subtract'](_0x41df8c,_0x8330('0x27'))['format'](_0x8330('0x29'));};exports['diffTime']=function(_0x478400,_0xd52bf1){return moment(_0x478400)[_0x8330('0x2b')](moment(_0xd52bf1),'seconds');};exports[_0x8330('0x2c')]=function(_0x3c89ec,_0x1e401c){return parseInt(_0x3c89ec,0xa)+parseInt(_0x1e401c,0xa);};exports[_0x8330('0x2d')]=function(){return moment()['format'](_0x8330('0x29'));};exports[_0x8330('0x2e')]=function(_0x318887,_0x24a0ee){if(_0x24a0ee){return moment(_0x318887)['isAfter'](_0x24a0ee);}return!![];};exports[_0x8330('0x2f')]=function(_0x29c332,_0x7991a5){if(_0x7991a5){return moment(_0x29c332)[_0x8330('0x2f')](_0x7991a5);}else if(_0x29c332){return!![];}return![];};
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd0c0=['body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','responseTime','agent_id','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','./loggers','fileLogger','./safe-template','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','data','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty'];(function(_0x5f0256,_0x8f0ba0){var _0x3f4d3d=function(_0x53819c){while(--_0x53819c){_0x5f0256['push'](_0x5f0256['shift']());}};_0x3f4d3d(++_0x8f0ba0);}(_0xd0c0,0xf2));var _0x0d0c=function(_0xfc8468,_0x434456){_0xfc8468=_0xfc8468-0x0;var _0x2b62c1=_0xd0c0[_0xfc8468];return _0x2b62c1;};var fs=require(_0x0d0c('0x0'));var _=require('lodash');var ewinston=require(_0x0d0c('0x1'));var path=require(_0x0d0c('0x2'));var util=require(_0x0d0c('0x3'));var fileLogger=require(_0x0d0c('0x4'))[_0x0d0c('0x5')];var safeTemplate=require(_0x0d0c('0x6'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x0d0c('0x7')];function ClientSideLogger(){function _0x469d18(_0x54ea3a){var _0x333246=path[_0x0d0c('0x8')](_0x0d0c('0x9'),_0x0d0c('0xa'),_0x0d0c('0xb'));var _0x5793d2=path[_0x0d0c('0x8')](_0x0d0c('0xc'),_0x54ea3a[_0x0d0c('0xd')]+'-'+_0x54ea3a[_0x0d0c('0xe')]);return fs[_0x0d0c('0xf')](path[_0x0d0c('0x8')](_0x333246,_0x5793d2))[_0x0d0c('0x10')](function(){var _0x169dd4=fileLogger(_0x0d0c('0xc'),path[_0x0d0c('0x8')](_0x333246,_0x5793d2));return _0x169dd4;})[_0x0d0c('0x11')](function(_0x5603ba){throw _0x5603ba;});}this[_0x0d0c('0xa')]=function(_0x2aece4,_0x512a01,_0x4677a1,_0x2ddb4c){return _0x469d18(_0x2aece4[_0x0d0c('0x12')])[_0x0d0c('0x10')](function(_0x52ea45){var _0x48c01e=_0x52ea45[_0x512a01];return _0x48c01e;})['then'](function(_0x595aae){var _0x13ede8=_0x2aece4['user']?_0x2aece4[_0x0d0c('0x12')]['id']:'no-user';var _0x4a9cbe=_0x2ddb4c[_0x0d0c('0x13')];var _0x40e7ec=_0x2ddb4c['timestamp'];var _0x1034c6=new Date(Number(_0x40e7ec));return _0x595aae(_0x13ede8,_0x1034c6,_0x4677a1,_0x4a9cbe);})[_0x0d0c('0x11')](function(_0x3a9007){fileLogger(_0x0d0c('0xc'))['error'](_0x3a9007);});};}function setupLoggers(_0x59d381){return new Promise(function(_0x396b50){var _0x51124c=new ClientSideLogger();var _0x3e34c7=fileLogger(_0x0d0c('0x14'));var _0x3432b7=fileLogger(_0x0d0c('0x15'));_0x59d381[_0x0d0c('0x16')](_0x0d0c('0x17'),_0x51124c);_0x59d381[_0x0d0c('0x18')](ewinston[_0x0d0c('0x19')]({'winstonInstance':_0x3e34c7,'meta':![],'statusLevels':!![],'msg':function(_0xedd847,_0x3224a7){var _0x2c88f9=_0x0d0c('0x1a');if(!_[_0x0d0c('0x1b')](_0xedd847['body'])){_0x2c88f9+='\x20body=%s';var _0x585a3c=_0xedd847[_0x0d0c('0x1c')];maskSensitiveData(_0x585a3c);}return safeTemplate(util['format'](_0x2c88f9,_0xedd847[_0x0d0c('0x1d')],_0xedd847[_0x0d0c('0x1e')][_0x0d0c('0x1f')]?_0xedd847['headers'][_0x0d0c('0x1f')]:_0xedd847[_0x0d0c('0x20')][_0x0d0c('0x21')]||_0xedd847['ip'],_0xedd847[_0x0d0c('0x22')],_0x3224a7[_0x0d0c('0x23')],_0x3224a7['responseTime'],_0xedd847[_0x0d0c('0x12')]?_0xedd847[_0x0d0c('0x12')]['id']:null,_0xedd847['user']?_0xedd847[_0x0d0c('0x12')][_0x0d0c('0xe')]:null,_0xedd847[_0x0d0c('0x12')]?_0xedd847['user']['role']:null,_0x585a3c?util['inspect'](_0x585a3c,![],null):''));}}));_0x59d381[_0x0d0c('0x18')](ewinston[_0x0d0c('0x19')]({'winstonInstance':_0x3432b7,'meta':![],'statusLevels':!![],'msg':function(_0x3c8b7f,_0x44ebed){var _0xc10ba3=_0x0d0c('0x24');if(_0x3c8b7f[_0x0d0c('0x1c')]&&_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x25')]&&_0x3c8b7f[_0x0d0c('0x1c')]['agent_id']){_0xc10ba3=_0x0d0c('0x26');}return util[_0x0d0c('0x27')](_0xc10ba3,_0x3c8b7f['method'],_0x3c8b7f[_0x0d0c('0x1e')][_0x0d0c('0x1f')]?_0x3c8b7f[_0x0d0c('0x1e')][_0x0d0c('0x1f')]:_0x3c8b7f[_0x0d0c('0x20')][_0x0d0c('0x21')]||_0x3c8b7f['ip'],_0x3c8b7f['url'],_0x44ebed[_0x0d0c('0x23')],_0x44ebed[_0x0d0c('0x28')],_0x3c8b7f[_0x0d0c('0x12')]?_0x3c8b7f[_0x0d0c('0x12')]['id']:null,_0x3c8b7f[_0x0d0c('0x12')]?_0x3c8b7f['user'][_0x0d0c('0xe')]:null,_0x3c8b7f[_0x0d0c('0x12')]?_0x3c8b7f[_0x0d0c('0x12')][_0x0d0c('0xd')]:null,_0x3c8b7f['body']&&_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x25')]?_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x25')]:'other',_0x3c8b7f[_0x0d0c('0x1c')]&&_0x3c8b7f[_0x0d0c('0x1c')][_0x0d0c('0x29')]?_0x3c8b7f['body']['agent_id']:'',_0x3c8b7f[_0x0d0c('0x1c')]&&_0x3c8b7f['body'][_0x0d0c('0x2a')]?_0x3c8b7f[_0x0d0c('0x1c')]['agent_name']:'');},'ignoreRoute':function(_0x5684d8){var _0x5f44a5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5f44a5[_0x0d0c('0x2b')](_0x5684d8[_0x0d0c('0x22')]);}}));return _0x396b50();});}exports[_0x0d0c('0x2c')]=setupLoggers;
\ No newline at end of file
+var _0xe02d=['remoteAddress','url','statusCode','responseTime','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','setupLoggers','lodash','util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','xcally','role','name','ensureDir','then','client','catch','user','no-user','data','error','api','auth','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection'];(function(_0x379363,_0x1fcdab){var _0x3cf227=function(_0xeb5c08){while(--_0xeb5c08){_0x379363['push'](_0x379363['shift']());}};_0x3cf227(++_0x1fcdab);}(_0xe02d,0x1b5));var _0xde02=function(_0x1e5b8b,_0x4937be){_0x1e5b8b=_0x1e5b8b-0x0;var _0x59393f=_0xe02d[_0x1e5b8b];return _0x59393f;};var fs=require('fs-extra');var _=require(_0xde02('0x0'));var ewinston=require('express-winston');var path=require('path');var util=require(_0xde02('0x1'));var fileLogger=require(_0xde02('0x2'))[_0xde02('0x3')];var safeTemplate=require('./safe-template')[_0xde02('0x4')];var maskSensitiveData=require(_0xde02('0x5'))[_0xde02('0x6')];function ClientSideLogger(){function _0x12b654(_0x560a3e){var _0x3724d8=path[_0xde02('0x7')]('/var',_0xde02('0x8'),_0xde02('0x9'));var _0x39f7d3=path[_0xde02('0x7')]('client',_0x560a3e[_0xde02('0xa')]+'-'+_0x560a3e[_0xde02('0xb')]);return fs[_0xde02('0xc')](path['join'](_0x3724d8,_0x39f7d3))[_0xde02('0xd')](function(){var _0xfaaa72=fileLogger(_0xde02('0xe'),path[_0xde02('0x7')](_0x3724d8,_0x39f7d3));return _0xfaaa72;})[_0xde02('0xf')](function(_0x3a5196){throw _0x3a5196;});}this['log']=function(_0x3857a5,_0x10a80d,_0x17517f,_0x7ce0ba){return _0x12b654(_0x3857a5[_0xde02('0x10')])[_0xde02('0xd')](function(_0x26bb1e){var _0x4833ff=_0x26bb1e[_0x10a80d];return _0x4833ff;})['then'](function(_0x21efa0){var _0x194a8c=_0x3857a5[_0xde02('0x10')]?_0x3857a5[_0xde02('0x10')]['id']:_0xde02('0x11');var _0x1408d8=_0x7ce0ba[_0xde02('0x12')];var _0x4ef9a9=_0x7ce0ba['timestamp'];var _0x5ba581=new Date(Number(_0x4ef9a9));return _0x21efa0(_0x194a8c,_0x5ba581,_0x17517f,_0x1408d8);})['catch'](function(_0x4d1138){fileLogger(_0xde02('0xe'))[_0xde02('0x13')](_0x4d1138);});};}function setupLoggers(_0x522cf){return new Promise(function(_0x1315a4){var _0x38de71=new ClientSideLogger();var _0x25bc95=fileLogger(_0xde02('0x14'));var _0x466823=fileLogger(_0xde02('0x15'));_0x522cf[_0xde02('0x16')](_0xde02('0x17'),_0x38de71);_0x522cf['use'](ewinston[_0xde02('0x18')]({'winstonInstance':_0x25bc95,'meta':![],'statusLevels':!![],'msg':function(_0x97dcb0,_0x3a63e5){var _0x643956=_0xde02('0x19');if(!_[_0xde02('0x1a')](_0x97dcb0[_0xde02('0x1b')])){_0x643956+='\x20body=%s';var _0x407ef5=_0x97dcb0[_0xde02('0x1b')];maskSensitiveData(_0x407ef5);}return safeTemplate(util[_0xde02('0x1c')](_0x643956,_0x97dcb0[_0xde02('0x1d')],_0x97dcb0[_0xde02('0x1e')]['x-forwarded-for']?_0x97dcb0[_0xde02('0x1e')][_0xde02('0x1f')]:_0x97dcb0[_0xde02('0x20')][_0xde02('0x21')]||_0x97dcb0['ip'],_0x97dcb0[_0xde02('0x22')],_0x3a63e5[_0xde02('0x23')],_0x3a63e5[_0xde02('0x24')],_0x97dcb0['user']?_0x97dcb0['user']['id']:null,_0x97dcb0['user']?_0x97dcb0[_0xde02('0x10')][_0xde02('0xb')]:null,_0x97dcb0[_0xde02('0x10')]?_0x97dcb0[_0xde02('0x10')]['role']:null,_0x407ef5?util[_0xde02('0x25')](_0x407ef5,![],null):''));}}));_0x522cf[_0xde02('0x26')](ewinston[_0xde02('0x18')]({'winstonInstance':_0x466823,'meta':![],'statusLevels':!![],'msg':function(_0xbdd5a3,_0x45c92c){var _0x70b241=_0xde02('0x27');if(_0xbdd5a3[_0xde02('0x1b')]&&_0xbdd5a3['body']['device']&&_0xbdd5a3[_0xde02('0x1b')][_0xde02('0x28')]){_0x70b241=_0xde02('0x29');}return util[_0xde02('0x1c')](_0x70b241,_0xbdd5a3[_0xde02('0x1d')],_0xbdd5a3['headers']['x-forwarded-for']?_0xbdd5a3[_0xde02('0x1e')][_0xde02('0x1f')]:_0xbdd5a3[_0xde02('0x20')]['remoteAddress']||_0xbdd5a3['ip'],_0xbdd5a3[_0xde02('0x22')],_0x45c92c[_0xde02('0x23')],_0x45c92c[_0xde02('0x24')],_0xbdd5a3['user']?_0xbdd5a3['user']['id']:null,_0xbdd5a3[_0xde02('0x10')]?_0xbdd5a3['user'][_0xde02('0xb')]:null,_0xbdd5a3[_0xde02('0x10')]?_0xbdd5a3['user']['role']:null,_0xbdd5a3[_0xde02('0x1b')]&&_0xbdd5a3[_0xde02('0x1b')][_0xde02('0x2a')]?_0xbdd5a3[_0xde02('0x1b')]['device']:_0xde02('0x2b'),_0xbdd5a3[_0xde02('0x1b')]&&_0xbdd5a3['body']['agent_id']?_0xbdd5a3[_0xde02('0x1b')][_0xde02('0x28')]:'',_0xbdd5a3['body']&&_0xbdd5a3[_0xde02('0x1b')][_0xde02('0x2c')]?_0xbdd5a3[_0xde02('0x1b')]['agent_name']:'');},'ignoreRoute':function(_0xc331a0){var _0x5aad8c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5aad8c[_0xde02('0x2d')](_0xc331a0[_0xde02('0x22')]);}}));return _0x1315a4();});}exports[_0xde02('0x2e')]=setupLoggers;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc7b6=['monthCompare','guess','test','isMoment','split','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','locale','weekdaysShort','map','indexOf','slice','concat','circularDoWInterval','monthsShort','toLowerCase','exports','clone','minutes','hours','startOf','day','endOf','isBetween','timeCompare','format','dowCompare','date','daysInMonth','max','min','includes'];(function(_0x5d9a9d,_0x926a50){var _0x4324db=function(_0xa2ae5b){while(--_0xa2ae5b){_0x5d9a9d['push'](_0x5d9a9d['shift']());}};_0x4324db(++_0x926a50);}(_0xc7b6,0x1dc));var _0x6c7b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc7b6[_0x40a045];return _0x1a687c;};var _=require(_0x6c7b('0x0'));var moment=require(_0x6c7b('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x133274){return _0x133274[_0x6c7b('0x2')];})[_0x6c7b('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x6c7b('0x4');var EINVALID_DATE=_0x6c7b('0x5');function throwIfDateNotValid(_0x2be9b8){if(!_0x2be9b8['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x26a56e){var _0x5cf677=_0x26a56e['split'](':')['map'](function(_0x4fa6ad){return parseInt(_0x4fa6ad,0xa);});var _0x177c7c=_0x5cf677[0x0];var _0x38574b=_0x5cf677[0x1];if(_0x177c7c<0x0||_0x177c7c>0x17||_0x38574b<0x0||_0x38574b>0x3b){throw new Error(EINVALID_DATE);}return[_0x177c7c,_0x38574b];}function circularDoWInterval(_0x4d4d63,_0x11e632){if(_0x4d4d63===_0x11e632){return[_0x4d4d63];}else{var _0xed90c9=moment[_0x6c7b('0x6')]();moment['locale']('en');var _0x45dd4f=moment[_0x6c7b('0x7')]()[_0x6c7b('0x8')](function(_0x2b8f4f){return _0x2b8f4f['toLowerCase']();});moment[_0x6c7b('0x6')](_0xed90c9);var _0x49c6fa=_0x45dd4f['indexOf'](_0x4d4d63);var _0x1a922b=_0x45dd4f[_0x6c7b('0x9')](_0x11e632);if(_0x1a922b>_0x49c6fa){return _0x45dd4f['slice'](_0x49c6fa,_0x1a922b+0x1);}else{var _0x593a59=_0x45dd4f[_0x6c7b('0xa')](0x0,_0x1a922b+0x1);var _0x58955=_0x45dd4f[_0x6c7b('0xa')](_0x49c6fa);return _0x58955[_0x6c7b('0xb')](_0x593a59);}}}module['exports'][_0x6c7b('0xc')]=circularDoWInterval;function circularMonthInterval(_0x184c0f,_0x311778){if(_0x184c0f===_0x311778){return[_0x184c0f];}else{var _0x41dd9c=moment[_0x6c7b('0x6')]();moment['locale']('en');var _0x2a0f4b=moment[_0x6c7b('0xd')]()[_0x6c7b('0x8')](function(_0x2eb44e){return _0x2eb44e[_0x6c7b('0xe')]();});moment['locale'](_0x41dd9c);var _0x1bed38=_0x2a0f4b[_0x6c7b('0x9')](_0x184c0f);var _0x2e83eb=_0x2a0f4b[_0x6c7b('0x9')](_0x311778);if(_0x2e83eb>_0x1bed38){return _0x2a0f4b[_0x6c7b('0xa')](_0x1bed38,_0x2e83eb+0x1);}else{var _0xf6fe=_0x2a0f4b[_0x6c7b('0xa')](0x0,_0x2e83eb+0x1);var _0x112e51=_0x2a0f4b[_0x6c7b('0xa')](_0x1bed38);return _0x112e51[_0x6c7b('0xb')](_0xf6fe);}}}module[_0x6c7b('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x40f55b){var _0x1310e7=parseInt(_0x40f55b,0xa);if(_0x1310e7<0x1||_0x1310e7>0x1f){throw new Error(EINVALID_DATE);}return _0x1310e7;}function timeCompare(_0x4c49df,_0x5889ac,_0x27a99a){var _0x381aae=_0x4c49df[_0x6c7b('0x10')]();var _0x57a1e5=extractTime(_0x5889ac);var _0x121846=_0x57a1e5[0x0];var _0x5240c4=_0x57a1e5[0x1];var _0xfc58a6=_0x4c49df[_0x6c7b('0x10')]()['hours'](_0x121846)[_0x6c7b('0x11')](_0x5240c4);throwIfDateNotValid(_0xfc58a6);var _0x13ab44=extractTime(_0x27a99a);var _0x5cd915=_0x13ab44[0x0];var _0x1c0cf9=_0x13ab44[0x1];var _0x4164d7=_0x4c49df[_0x6c7b('0x10')]()[_0x6c7b('0x12')](_0x5cd915)[_0x6c7b('0x11')](_0x1c0cf9);throwIfDateNotValid(_0x4164d7);if(_0x4164d7['isBefore'](_0xfc58a6)){var _0x5e57e1=_0x381aae[_0x6c7b('0x10')]()[_0x6c7b('0x13')](_0x6c7b('0x14'));var _0x11e6da=_0x381aae['clone']()[_0x6c7b('0x15')]('day');return _0x381aae[_0x6c7b('0x16')](_0xfc58a6,_0x11e6da,undefined,'[]')||_0x381aae[_0x6c7b('0x16')](_0x5e57e1,_0x4164d7,undefined,'[]');}else{return _0x381aae['isBetween'](_0xfc58a6,_0x4164d7,undefined,'[]');}}module[_0x6c7b('0xf')][_0x6c7b('0x17')]=timeCompare;function dowCompare(_0x3d8dda,_0x1e182a,_0x571727){var _0x52a669=_0x3d8dda['locale']('en')[_0x6c7b('0x18')]('ddd')[_0x6c7b('0xe')]();return circularDoWInterval(_0x1e182a,_0x571727)['includes'](_0x52a669);}module['exports'][_0x6c7b('0x19')]=dowCompare;function domCompare(_0x25470c,_0x2943e3,_0x1d35e8){var _0x507f4d=_0x25470c[_0x6c7b('0x1a')]();if(_0x2943e3===_0x1d35e8){return _0x507f4d===_0x2943e3;}else{var _0x377083=_0x25470c[_0x6c7b('0x1b')]();var _0x5d7c1e=_0x2943e3<_0x1d35e8;let _0x150d11=![];var _0x43778a=0x0;var _0xed6ca0=0x0;if(_0x5d7c1e){_0x43778a=Math[_0x6c7b('0x1c')](0x1,_0x2943e3);_0xed6ca0=Math[_0x6c7b('0x1d')](_0x1d35e8,_0x377083);_0x150d11=_0x507f4d>=_0x43778a&&_0x507f4d<=_0xed6ca0;}else{_0x43778a=Math[_0x6c7b('0x1d')](_0x2943e3,_0x377083);_0xed6ca0=Math[_0x6c7b('0x1c')](0x1,_0x1d35e8);_0x150d11=_0x507f4d>=_0x43778a||_0x507f4d<=_0xed6ca0;}return _0x150d11;}}module[_0x6c7b('0xf')]['domCompare']=domCompare;function monthCompare(_0x1f2174,_0x143d50,_0x53ec6f){var _0x17902e=_0x1f2174['locale']('en')[_0x6c7b('0x18')]('MMM')['toLowerCase']();return circularMonthInterval(_0x143d50,_0x53ec6f)[_0x6c7b('0x1e')](_0x17902e);}module[_0x6c7b('0xf')][_0x6c7b('0x1f')]=monthCompare;function iftime(_0xcc6673,_0x14ae5d=moment['tz'][_0x6c7b('0x20')](),_0x2bdb15=moment()){if(!validateRx[_0x6c7b('0x21')](_0xcc6673)){throw new Error(EINVALID_STRING);}else{var _0xf0c4e4=(moment[_0x6c7b('0x22')](_0x2bdb15)?_0x2bdb15[_0x6c7b('0x10')]():moment(_0x2bdb15))['tz'](_0x14ae5d)[_0x6c7b('0x6')]('en');throwIfDateNotValid(_0xf0c4e4);var _0xee7473=_0xcc6673[_0x6c7b('0x23')](',');var _0xebaa05=_0xee7473[0x0];var _0x453415=_0xee7473[0x1];var _0x166111=_0xee7473[0x2];var _0x269e8b=_0xee7473[0x3];let _0x44c70c=!![];if(_0xebaa05!=='*'){var _0x3e3660=_0xebaa05['split']('-');var _0x2d905c=_[_0x6c7b('0x24')](_0x3e3660[0x0],0x5,'0');var _0xf35c7f=_0x3e3660[_0x6c7b('0x25')]===0x2?_[_0x6c7b('0x24')](_0x3e3660[0x1],0x5,'0'):_0x2d905c;_0x44c70c=timeCompare(_0xf0c4e4,_0x2d905c,_0xf35c7f);}let _0x566cdd=!![];if(_0x453415!=='*'){var _0x562e07=_0x453415[_0x6c7b('0x23')]('-');var _0x2dc186=_0x562e07[0x0];var _0xd1be48=_0x562e07[_0x6c7b('0x25')]===0x2?_0x562e07[0x1]:_0x2dc186;_0x566cdd=dowCompare(_0xf0c4e4,_0x2dc186,_0xd1be48);}let _0x349c36=!![];if(_0x166111!=='*'){var _0x40db1c=_0x166111[_0x6c7b('0x23')]('-');var _0x49383f=parseDom(_0x40db1c[0x0]);var _0x506f9c=_0x40db1c[_0x6c7b('0x25')]===0x2?parseDom(_0x40db1c[0x1]):_0x49383f;_0x349c36=domCompare(_0xf0c4e4,_0x49383f,_0x506f9c);}let _0x4ea952=!![];if(_0x269e8b!=='*'){var _0x3c1568=_0x269e8b[_0x6c7b('0x23')]('-');var _0x5741b4=_0x3c1568[0x0];var _0x5d04eb=_0x3c1568[_0x6c7b('0x25')]===0x2?_0x3c1568[0x1]:_0x3c1568[0x0];_0x4ea952=monthCompare(_0xf0c4e4,_0x5741b4,_0x5d04eb);}return _0x44c70c&&_0x566cdd&&_0x349c36&&_0x4ea952;}}module[_0x6c7b('0xf')][_0x6c7b('0x26')]=iftime;
\ No newline at end of file
+var _0x7377=['format','ddd','includes','dowCompare','date','daysInMonth','max','domCompare','monthCompare','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','exports','monthsShort','circularMonthInterval','clone','hours','minutes','day','endOf','isBetween'];(function(_0xbaf0c1,_0x1f4d4c){var _0x419089=function(_0x2148cb){while(--_0x2148cb){_0xbaf0c1['push'](_0xbaf0c1['shift']());}};_0x419089(++_0x1f4d4c);}(_0x7377,0xe6));var _0x7737=function(_0x27c1cd,_0x4e517d){_0x27c1cd=_0x27c1cd-0x0;var _0x455c8b=_0x7377[_0x27c1cd];return _0x455c8b;};var _=require(_0x7737('0x0'));var moment=require(_0x7737('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x7737('0x2')](function(_0x30bb4d){return _0x30bb4d['source'];})[_0x7737('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x7737('0x4');var EINVALID_DATE=_0x7737('0x5');function throwIfDateNotValid(_0x37f560){if(!_0x37f560[_0x7737('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2f5a5f){var _0x564118=_0x2f5a5f[_0x7737('0x7')](':')[_0x7737('0x2')](function(_0x5d72cf){return parseInt(_0x5d72cf,0xa);});var _0x350fa8=_0x564118[0x0];var _0x2e1e00=_0x564118[0x1];if(_0x350fa8<0x0||_0x350fa8>0x17||_0x2e1e00<0x0||_0x2e1e00>0x3b){throw new Error(EINVALID_DATE);}return[_0x350fa8,_0x2e1e00];}function circularDoWInterval(_0x4b68ff,_0xc58fe9){if(_0x4b68ff===_0xc58fe9){return[_0x4b68ff];}else{var _0x29613f=moment[_0x7737('0x8')]();moment[_0x7737('0x8')]('en');var _0x15965f=moment['weekdaysShort']()['map'](function(_0x266602){return _0x266602[_0x7737('0x9')]();});moment[_0x7737('0x8')](_0x29613f);var _0x3c7387=_0x15965f[_0x7737('0xa')](_0x4b68ff);var _0x2dd411=_0x15965f[_0x7737('0xa')](_0xc58fe9);if(_0x2dd411>_0x3c7387){return _0x15965f['slice'](_0x3c7387,_0x2dd411+0x1);}else{var _0x3b6a73=_0x15965f['slice'](0x0,_0x2dd411+0x1);var _0x445856=_0x15965f[_0x7737('0xb')](_0x3c7387);return _0x445856[_0x7737('0xc')](_0x3b6a73);}}}module[_0x7737('0xd')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x57526e,_0x1e8c34){if(_0x57526e===_0x1e8c34){return[_0x57526e];}else{var _0x5ca05a=moment[_0x7737('0x8')]();moment[_0x7737('0x8')]('en');var _0x10d444=moment[_0x7737('0xe')]()[_0x7737('0x2')](function(_0x3e5fbb){return _0x3e5fbb['toLowerCase']();});moment[_0x7737('0x8')](_0x5ca05a);var _0x2a95b1=_0x10d444[_0x7737('0xa')](_0x57526e);var _0x738857=_0x10d444[_0x7737('0xa')](_0x1e8c34);if(_0x738857>_0x2a95b1){return _0x10d444['slice'](_0x2a95b1,_0x738857+0x1);}else{var _0x3fecd5=_0x10d444[_0x7737('0xb')](0x0,_0x738857+0x1);var _0x481a64=_0x10d444['slice'](_0x2a95b1);return _0x481a64[_0x7737('0xc')](_0x3fecd5);}}}module[_0x7737('0xd')][_0x7737('0xf')]=circularMonthInterval;function parseDom(_0x587962){var _0x277c4d=parseInt(_0x587962,0xa);if(_0x277c4d<0x1||_0x277c4d>0x1f){throw new Error(EINVALID_DATE);}return _0x277c4d;}function timeCompare(_0x575480,_0x27a96e,_0x4ec63e){var _0x1c3573=_0x575480[_0x7737('0x10')]();var _0x5b3fb6=extractTime(_0x27a96e);var _0xa61293=_0x5b3fb6[0x0];var _0x313baa=_0x5b3fb6[0x1];var _0x4c4097=_0x575480[_0x7737('0x10')]()[_0x7737('0x11')](_0xa61293)[_0x7737('0x12')](_0x313baa);throwIfDateNotValid(_0x4c4097);var _0x5d9b1d=extractTime(_0x4ec63e);var _0x16d2c4=_0x5d9b1d[0x0];var _0x48373e=_0x5d9b1d[0x1];var _0x45e9be=_0x575480[_0x7737('0x10')]()['hours'](_0x16d2c4)[_0x7737('0x12')](_0x48373e);throwIfDateNotValid(_0x45e9be);if(_0x45e9be['isBefore'](_0x4c4097)){var _0x348979=_0x1c3573[_0x7737('0x10')]()['startOf'](_0x7737('0x13'));var _0x31c76e=_0x1c3573[_0x7737('0x10')]()[_0x7737('0x14')](_0x7737('0x13'));return _0x1c3573[_0x7737('0x15')](_0x4c4097,_0x31c76e,undefined,'[]')||_0x1c3573['isBetween'](_0x348979,_0x45e9be,undefined,'[]');}else{return _0x1c3573[_0x7737('0x15')](_0x4c4097,_0x45e9be,undefined,'[]');}}module[_0x7737('0xd')]['timeCompare']=timeCompare;function dowCompare(_0x4e6c69,_0x39abe0,_0x214cec){var _0x166db6=_0x4e6c69[_0x7737('0x8')]('en')[_0x7737('0x16')](_0x7737('0x17'))['toLowerCase']();return circularDoWInterval(_0x39abe0,_0x214cec)[_0x7737('0x18')](_0x166db6);}module[_0x7737('0xd')][_0x7737('0x19')]=dowCompare;function domCompare(_0x44dbf9,_0x3a932d,_0x2c0e52){var _0x5ac45d=_0x44dbf9[_0x7737('0x1a')]();if(_0x3a932d===_0x2c0e52){return _0x5ac45d===_0x3a932d;}else{var _0x13ece1=_0x44dbf9[_0x7737('0x1b')]();var _0x17887c=_0x3a932d<_0x2c0e52;let _0x5782ac=![];var _0x588675=0x0;var _0x1dbbd9=0x0;if(_0x17887c){_0x588675=Math[_0x7737('0x1c')](0x1,_0x3a932d);_0x1dbbd9=Math['min'](_0x2c0e52,_0x13ece1);_0x5782ac=_0x5ac45d>=_0x588675&&_0x5ac45d<=_0x1dbbd9;}else{_0x588675=Math['min'](_0x3a932d,_0x13ece1);_0x1dbbd9=Math['max'](0x1,_0x2c0e52);_0x5782ac=_0x5ac45d>=_0x588675||_0x5ac45d<=_0x1dbbd9;}return _0x5782ac;}}module['exports'][_0x7737('0x1d')]=domCompare;function monthCompare(_0x554869,_0x320689,_0x2ee9f8){var _0x19e122=_0x554869[_0x7737('0x8')]('en')[_0x7737('0x16')]('MMM')[_0x7737('0x9')]();return circularMonthInterval(_0x320689,_0x2ee9f8)[_0x7737('0x18')](_0x19e122);}module[_0x7737('0xd')][_0x7737('0x1e')]=monthCompare;function iftime(_0x541de9,_0x4f4943=moment['tz']['guess'](),_0x1b4b65=moment()){if(!validateRx[_0x7737('0x1f')](_0x541de9)){throw new Error(EINVALID_STRING);}else{var _0x319aea=(moment[_0x7737('0x20')](_0x1b4b65)?_0x1b4b65[_0x7737('0x10')]():moment(_0x1b4b65))['tz'](_0x4f4943)['locale']('en');throwIfDateNotValid(_0x319aea);var _0x1efd82=_0x541de9['split'](',');var _0x35d9cd=_0x1efd82[0x0];var _0x1cc64e=_0x1efd82[0x1];var _0x58c183=_0x1efd82[0x2];var _0x225254=_0x1efd82[0x3];let _0x1562a7=!![];if(_0x35d9cd!=='*'){var _0x2220a2=_0x35d9cd['split']('-');var _0x598311=_[_0x7737('0x21')](_0x2220a2[0x0],0x5,'0');var _0x115450=_0x2220a2[_0x7737('0x22')]===0x2?_[_0x7737('0x21')](_0x2220a2[0x1],0x5,'0'):_0x598311;_0x1562a7=timeCompare(_0x319aea,_0x598311,_0x115450);}let _0x553bce=!![];if(_0x1cc64e!=='*'){var _0x120155=_0x1cc64e[_0x7737('0x7')]('-');var _0x1c56f6=_0x120155[0x0];var _0x5f4433=_0x120155[_0x7737('0x22')]===0x2?_0x120155[0x1]:_0x1c56f6;_0x553bce=dowCompare(_0x319aea,_0x1c56f6,_0x5f4433);}let _0x4c5646=!![];if(_0x58c183!=='*'){var _0xe02b7d=_0x58c183[_0x7737('0x7')]('-');var _0x1d4769=parseDom(_0xe02b7d[0x0]);var _0x4b85bf=_0xe02b7d['length']===0x2?parseDom(_0xe02b7d[0x1]):_0x1d4769;_0x4c5646=domCompare(_0x319aea,_0x1d4769,_0x4b85bf);}let _0x3ac79c=!![];if(_0x225254!=='*'){var _0x130f95=_0x225254[_0x7737('0x7')]('-');var _0x58876f=_0x130f95[0x0];var _0x25cb76=_0x130f95[_0x7737('0x22')]===0x2?_0x130f95[0x1]:_0x130f95[0x0];_0x3ac79c=monthCompare(_0x319aea,_0x58876f,_0x25cb76);}return _0x1562a7&&_0x553bce&&_0x4c5646&&_0x3ac79c;}}module['exports'][_0x7737('0x23')]=iftime;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6695=['addColors','/var/log/xcally','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','}}}','length','stringify','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','error','File','%s-%s','Console','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x6695,0x192));var _0x5669=function(_0xe51e2d,_0x5eaf97){_0xe51e2d=_0xe51e2d-0x0;var _0x54e8c1=_0x6695[_0xe51e2d];return _0x54e8c1;};'use strict';var path=require(_0x5669('0x0'));var util=require(_0x5669('0x1'));var moment=require(_0x5669('0x2'));var winston=require(_0x5669('0x3'));var config=require(_0x5669('0x4'));var debugLevel=config[_0x5669('0x5')]?config['debugLevel'][_0x5669('0x6')]():_0x5669('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x5669('0x8'),'error':_0x5669('0x9'),'warn':_0x5669('0xa'),'info':_0x5669('0xb'),'print':_0x5669('0xc'),'success':_0x5669('0xd'),'http':'gray','verbose':_0x5669('0xe'),'debug':_0x5669('0xf'),'silly':'bold\x20cyan'};winston[_0x5669('0x10')](XC_LOG_COLORS);function getLogFileName(_0x4fb856,_0x5dff4d,_0x580ad3){var _0x5da3c3=_0x4fb856||_0x5669('0x11');return path['join'](_0x5da3c3,util[_0x5669('0x12')](_0x5669('0x13'),_0x5dff4d,_0x580ad3));}function formatter(_0x379574,_0x2cb29e){_0x2cb29e[_0x5669('0x14')]=_0x2cb29e[_0x5669('0x14')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0x5669('0x15')](/@{/g,'{{')[_0x5669('0x15')](/}@/g,'}}');return util[_0x5669('0x12')](_0x5669('0x16'),moment()[_0x5669('0x12')](_0x5669('0x17')),_0x2cb29e['level'][_0x5669('0x18')](),_0x379574,_0x2cb29e[_0x5669('0x14')]);}function fileFormat(_0x4c960b,_0x12edb8){_0x12edb8[_0x5669('0x14')]=_0x12edb8[_0x5669('0x14')][_0x5669('0x15')](/@@{/g,'{{{')[_0x5669('0x15')](/}@@/g,_0x5669('0x19'))[_0x5669('0x15')](/@{/g,'{{')[_0x5669('0x15')](/}@/g,'}}');var _0x3dd1bb=_0x12edb8['meta']&&Object['keys'](_0x12edb8['meta'])[_0x5669('0x1a')]?'\x0a\x09'+JSON[_0x5669('0x1b')](_0x12edb8[_0x5669('0x1c')]):'';return util['format'](_0x5669('0x1d'),moment()[_0x5669('0x12')](_0x5669('0x17')),_0x12edb8['level']['toUpperCase'](),_0x4c960b,_0x12edb8['message'],_0x3dd1bb);}function consoleLogger(){var _0x4bb879=new winston[(_0x5669('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5669('0x1f'))]['Console']({'level':_0x5669('0x20'),'json':![],'formatter':function(_0x3f8198){return formatter('',_0x3f8198);}})]});return _0x4bb879;}function fileLogger(_0x1bad1d,_0x349dc1){var _0x25d0ab=new winston[(_0x5669('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0x5669('0x12')]('%s-%s',_0x1bad1d,_0x5669('0x21')),'filename':getLogFileName(_0x349dc1,_0x1bad1d,_0x5669('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c0d21){return fileFormat(_0x1bad1d,_0x4c0d21);}}),new winston[(_0x5669('0x1f'))][(_0x5669('0x22'))]({'name':util[_0x5669('0x12')](_0x5669('0x23'),_0x1bad1d,debugLevel),'filename':getLogFileName(_0x349dc1,_0x1bad1d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d7f77){return fileFormat(_0x1bad1d,_0x4d7f77);}}),new winston[(_0x5669('0x1f'))][(_0x5669('0x24'))]({'level':_0x5669('0x20'),'json':![],'formatter':function(_0x1a4b03){return fileFormat(_0x1bad1d,_0x1a4b03);}})]});return _0x25d0ab;}exports[_0x5669('0x25')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0x271c=['debugLevel','info','redBG\x20white','red','bold\x20yellow','white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','toUpperCase','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','path','util','moment','winston','../config/environment'];(function(_0x1ca9a0,_0x17be2b){var _0x4a80d6=function(_0x31962d){while(--_0x31962d){_0x1ca9a0['push'](_0x1ca9a0['shift']());}};_0x4a80d6(++_0x17be2b);}(_0x271c,0xdf));var _0xc271=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x271c[_0x59ee6f];return _0x4c0979;};'use strict';var path=require(_0xc271('0x0'));var util=require(_0xc271('0x1'));var moment=require(_0xc271('0x2'));var winston=require(_0xc271('0x3'));var config=require(_0xc271('0x4'));var debugLevel=config[_0xc271('0x5')]?config[_0xc271('0x5')]['toLowerCase']():_0xc271('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xc271('0x7'),'error':_0xc271('0x8'),'warn':_0xc271('0x9'),'info':_0xc271('0xa'),'print':'bold\x20white','success':'bold\x20green','http':_0xc271('0xb'),'verbose':_0xc271('0xc'),'debug':_0xc271('0xd'),'silly':_0xc271('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x17d33c,_0x105449,_0x18123e){var _0x150e0b=_0x17d33c||_0xc271('0xf');return path[_0xc271('0x10')](_0x150e0b,util[_0xc271('0x11')](_0xc271('0x12'),_0x105449,_0x18123e));}function formatter(_0xf1d3a2,_0xc1cc7a){_0xc1cc7a[_0xc271('0x13')]=_0xc1cc7a['message']['replace'](/@@{/g,_0xc271('0x14'))[_0xc271('0x15')](/}@@/g,_0xc271('0x16'))[_0xc271('0x15')](/@{/g,'{{')[_0xc271('0x15')](/}@/g,'}}');return util[_0xc271('0x11')](_0xc271('0x17'),moment()[_0xc271('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0xc1cc7a['level']['toUpperCase'](),_0xf1d3a2,_0xc1cc7a[_0xc271('0x13')]);}function fileFormat(_0x27d3ea,_0x511a45){_0x511a45['message']=_0x511a45[_0xc271('0x13')][_0xc271('0x15')](/@@{/g,'{{{')[_0xc271('0x15')](/}@@/g,'}}}')[_0xc271('0x15')](/@{/g,'{{')[_0xc271('0x15')](/}@/g,'}}');var _0x13c94d=_0x511a45['meta']&&Object['keys'](_0x511a45[_0xc271('0x18')])[_0xc271('0x19')]?'\x0a\x09'+JSON[_0xc271('0x1a')](_0x511a45[_0xc271('0x18')]):'';return util[_0xc271('0x11')](_0xc271('0x1b'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x511a45[_0xc271('0x1c')][_0xc271('0x1d')](),_0x27d3ea,_0x511a45[_0xc271('0x13')],_0x13c94d);}function consoleLogger(){var _0x3fb474=new winston[(_0xc271('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc271('0x1f'))][(_0xc271('0x20'))]({'level':_0xc271('0x21'),'json':![],'formatter':function(_0xd75873){return formatter('',_0xd75873);}})]});return _0x3fb474;}function fileLogger(_0x1fd92b,_0x512ccf){var _0x45c742=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xc271('0x22'))]({'name':util[_0xc271('0x11')](_0xc271('0x23'),_0x1fd92b,_0xc271('0x24')),'filename':getLogFileName(_0x512ccf,_0x1fd92b,_0xc271('0x24')),'level':_0xc271('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x34604c){return fileFormat(_0x1fd92b,_0x34604c);}}),new winston[(_0xc271('0x1f'))][(_0xc271('0x22'))]({'name':util[_0xc271('0x11')](_0xc271('0x23'),_0x1fd92b,debugLevel),'filename':getLogFileName(_0x512ccf,_0x1fd92b,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1618e6){return fileFormat(_0x1fd92b,_0x1618e6);}}),new winston[(_0xc271('0x1f'))][(_0xc271('0x20'))]({'level':_0xc271('0x21'),'json':![],'formatter':function(_0x5d8679){return fileFormat(_0x1fd92b,_0x5d8679);}})]});return _0x45c742;}exports[_0xc271('0x25')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x66d5b5,_0x609b49){_0x66d5b5=_0x66d5b5-0x0;var _0x149ebf=_0x7a54[_0x66d5b5];return _0x149ebf;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData;
\ No newline at end of file
+var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x2a1753,_0x5b7692){_0x2a1753=_0x2a1753-0x0;var _0x4153b7=_0x7a54[_0x2a1753];return _0x4153b7;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0972=['safeTemplate','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce','exports'];(function(_0x49e7a8,_0x3915b8){var _0x18ed52=function(_0x4f7533){while(--_0x4f7533){_0x49e7a8['push'](_0x49e7a8['shift']());}};_0x18ed52(++_0x3915b8);}(_0x0972,0x64));var _0x2097=function(_0x1008fa,_0x4334b6){_0x1008fa=_0x1008fa-0x0;var _0x43aac3=_0x0972[_0x1008fa];return _0x43aac3;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1591ae){return _0x1591ae==='{{'?'{\x20{\x20':_0x2097('0x0');}function safeTemplate(_0x4ec7aa){var _0x36912c=_0x4ec7aa;if(typeof _0x4ec7aa===_0x2097('0x1')){_0x36912c=_0x4ec7aa['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2097('0x2')](_0x4ec7aa)){_0x36912c=_0x4ec7aa[_0x2097('0x3')](function(_0xe6fbae){return safeTemplate(_0xe6fbae);});}else if(_[_0x2097('0x4')](_0x4ec7aa)){_0x36912c=Object[_0x2097('0x5')](_0x4ec7aa)[_0x2097('0x6')](function(_0x2b4f21,_0x59739f){_0x2b4f21[_0x59739f]=safeTemplate(_0x4ec7aa[_0x59739f]);return _0x2b4f21;},{});}return _0x36912c;}module[_0x2097('0x7')][_0x2097('0x8')]=safeTemplate;
\ No newline at end of file
+var _0x13f6=['isArray','map','keys','reduce','lodash','string'];(function(_0x2a6887,_0x4d3538){var _0x2313e8=function(_0x1e710e){while(--_0x1e710e){_0x2a6887['push'](_0x2a6887['shift']());}};_0x2313e8(++_0x4d3538);}(_0x13f6,0x124));var _0x613f=function(_0x29b44e,_0x1f7083){_0x29b44e=_0x29b44e-0x0;var _0x179bf9=_0x13f6[_0x29b44e];return _0x179bf9;};var _=require(_0x613f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1844a4){return _0x1844a4==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0xd04cfd){var _0x13b50a=_0xd04cfd;if(typeof _0xd04cfd===_0x613f('0x1')){_0x13b50a=_0xd04cfd['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x613f('0x2')](_0xd04cfd)){_0x13b50a=_0xd04cfd[_0x613f('0x3')](function(_0x20af2f){return safeTemplate(_0x20af2f);});}else if(_['isPlainObject'](_0xd04cfd)){_0x13b50a=Object[_0x613f('0x4')](_0xd04cfd)[_0x613f('0x5')](function(_0x5618fa,_0x4b546b){_0x5618fa[_0x4b546b]=safeTemplate(_0xd04cfd[_0x4b546b]);return _0x5618fa;},{});}return _0x13b50a;}module['exports']['safeTemplate']=safeTemplate;
\ No newline at end of file
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00ca=['env','NODE_PATH','string','pathExists','readJSON','updated','info','writeJSON','exports','root','resolve','legacy-libs','isArray','apps','findIndex','name','motion2'];(function(_0x39da12,_0x2365e3){var _0x3c68a3=function(_0x464264){while(--_0x464264){_0x39da12['push'](_0x39da12['shift']());}};_0x3c68a3(++_0x2365e3);}(_0x00ca,0x6f));var _0xa00c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x00ca[_0x2f5ac5];return _0x37c9a8;};var fs=require('fs-extra');var path=require('path');var config=require('../config/environment');var root=config[_0xa00c('0x0')];var APP_JSON_PATH=path[_0xa00c('0x1')](root,'server/app.json');var NODEPATH=path[_0xa00c('0x1')](root,_0xa00c('0x2'));function setLegacyLibsNodeEnvPath(_0xfaf187){let _0x574ee9=![];if(Array[_0xa00c('0x3')](_0xfaf187[_0xa00c('0x4')])){var _0x1f8c3e=_0xfaf187[_0xa00c('0x4')][_0xa00c('0x5')](function(_0x2ba119){return _0x2ba119[_0xa00c('0x6')]===_0xa00c('0x7');});if(_0x1f8c3e>-0x1){var _0x579725=_0xfaf187[_0xa00c('0x4')][_0x1f8c3e];if(typeof _0x579725[_0xa00c('0x8')][_0xa00c('0x9')]!==_0xa00c('0xa')){_0x579725['env'][_0xa00c('0x9')]=NODEPATH;_0x574ee9=!![];}}return{'appConfig':_0xfaf187,'updated':_0x574ee9};}}function updateAppConfig(_0x2ff657){return fs[_0xa00c('0xb')](APP_JSON_PATH)['then'](function(_0x479b2b){if(_0x479b2b){return fs[_0xa00c('0xc')](APP_JSON_PATH)['then'](function(_0x5bda92){var _0x36c465=setLegacyLibsNodeEnvPath(_0x5bda92);if(_0x36c465[_0xa00c('0xd')]){_0x2ff657[_0xa00c('0xe')]('Updating\x20app.json');return fs[_0xa00c('0xf')](APP_JSON_PATH,_0x5bda92,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xa00c('0x1')]();}});}module[_0xa00c('0x10')]=updateAppConfig;
\ No newline at end of file
+var _0xfae1=['then','readJSON','updated','info','Updating\x20app.json','writeJSON','fs-extra','../config/environment','root','resolve','legacy-libs','isArray','apps','findIndex','env','NODE_PATH','pathExists'];(function(_0x581960,_0x1232ff){var _0x4ee892=function(_0x2a920d){while(--_0x2a920d){_0x581960['push'](_0x581960['shift']());}};_0x4ee892(++_0x1232ff);}(_0xfae1,0x7d));var _0x1fae=function(_0x276e4f,_0x55406a){_0x276e4f=_0x276e4f-0x0;var _0x4e07c6=_0xfae1[_0x276e4f];return _0x4e07c6;};var fs=require(_0x1fae('0x0'));var path=require('path');var config=require(_0x1fae('0x1'));var root=config[_0x1fae('0x2')];var APP_JSON_PATH=path[_0x1fae('0x3')](root,'server/app.json');var NODEPATH=path[_0x1fae('0x3')](root,_0x1fae('0x4'));function setLegacyLibsNodeEnvPath(_0x45c514){let _0x5181c7=![];if(Array[_0x1fae('0x5')](_0x45c514[_0x1fae('0x6')])){var _0x420804=_0x45c514['apps'][_0x1fae('0x7')](function(_0x19c21d){return _0x19c21d['name']==='motion2';});if(_0x420804>-0x1){var _0x1ff3f1=_0x45c514['apps'][_0x420804];if(typeof _0x1ff3f1[_0x1fae('0x8')][_0x1fae('0x9')]!=='string'){_0x1ff3f1[_0x1fae('0x8')]['NODE_PATH']=NODEPATH;_0x5181c7=!![];}}return{'appConfig':_0x45c514,'updated':_0x5181c7};}}function updateAppConfig(_0xea5d0){return fs[_0x1fae('0xa')](APP_JSON_PATH)[_0x1fae('0xb')](function(_0x256968){if(_0x256968){return fs[_0x1fae('0xc')](APP_JSON_PATH)[_0x1fae('0xb')](function(_0x494422){var _0x4dac4c=setLegacyLibsNodeEnvPath(_0x494422);if(_0x4dac4c[_0x1fae('0xd')]){_0xea5d0[_0x1fae('0xe')](_0x1fae('0xf'));return fs[_0x1fae('0x10')](APP_JSON_PATH,_0x494422,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x1fae('0x3')]();}});}module['exports']=updateAppConfig;
\ No newline at end of file
+++ /dev/null
-/*! For license information please see chat.js.LICENSE.txt */
-(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("<ui-view></ui-view>")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+"></"+m+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],a=0,i=s.length;a<i;a++,r++)o[r]=s[a];return o},i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||void 0,d=i.angular||{},u=d.fromJson||JSON.parse.bind(JSON),m=d.toJson||JSON.stringify.bind(JSON),l=d.forEach||function(e,t,n){if((0,o.kJ)(e))return e.forEach(t,n);Object.keys(e).forEach((function(n){return t(e[n],n)}))},_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n)for(var o=Object.keys(n),r=0;r<o.length;r++)e[o[r]]=n[o[r]]}return e},c=d.equals||function e(t,n){if(t===n)return!0;if(null===t||null===n)return!1;if(t!=t&&n!=n)return!0;var s=typeof t;if(s!==typeof n||"object"!==s)return!1;var a,i,d=[t,n];if((0,r.$6)(o.kJ)(d))return i=n,(a=t).length===i.length&&C(a,i).reduce((function(t,n){return t&&e(n[0],n[1])}),!0);if((0,r.$6)(o.J_)(d))return t.getTime()===n.getTime();if((0,r.$6)(o.Kj)(d))return t.toString()===n.toString();if((0,r.$6)(o.mf)(d))return!0;if([o.mf,o.kJ,o.J_,o.Kj].map(r.Yj).reduce((function(e,t){return e||!!t(d)}),!1))return!1;var u={};for(var m in t){if(!e(t[m],n[m]))return!1;u[m]=!0}for(var m in n)if(!u[m])return!1;return!0};function h(e){return e}function f(){}function p(e,t,n,o,r){void 0===r&&(r=!1);var s=function(t){return e()[t].bind(n())};return(o=o||Object.keys(e())).reduce((function(e,n){var o;return e[n]=r?(o=n,function(){return t[o]=s(o),t[o].apply(null,arguments)}):s(n),e}),t)}var M=function(e,t){return _(Object.create(e),t)},y=(0,r.WA)((function(e,t){return-1!==e.indexOf(t)})),L=(0,r.WA)((function(e,t){var n=e.indexOf(t);return n>=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=_.apply(void 0,a([{}],t.reverse()));return _(o,w(e||{},Object.keys(o)))}var k=function(e,t){return _(e,t)};function j(e,t){var n=[];for(var o in e.path){if(e.path[o]!==t.path[o])break;n.push(e.path[o])}return n}function w(e,t){var n={};for(var o in e)-1!==t.indexOf(o)&&(n[o]=e[o]);return n}function b(e,t){return Object.keys(e).filter((0,r.ff)(y(t))).reduce((function(t,n){return t[n]=e[n],t}),{})}function D(e,t){var n=(0,o.kJ)(e),r=n?[]:{},s=n?function(e){return r.push(e)}:function(e,t){return r[t]=e};return l(e,(function(e,n){t(e,n)&&s(e,n)})),r}function T(e,t){var n;return l(e,(function(e,o){n||t(e,o)&&(n=e)})),n}var S=H;function H(e,t,n){return n=n||((0,o.kJ)(e)?[]:{}),l(e,(function(e,o){return n[o]=t(e,o)})),n}var x=function(e){return Object.keys(e).map((function(t){return e[t]}))},E=function(e,t){return e&&t},P=function(e,t){return e||t},O=function(e,t){return e.concat(t)},$=function(e,t){return(0,o.kJ)(t)?e.concat(t.reduce($,[])):A(e,t)};function A(e,t){return e.push(t),e}var R=function(e,t){return y(e,t)?e:A(e,t)},F=function(e){return e.reduce(O,[])},W=function(e,t){return void 0===t&&(t="assert failure"),function(n){var r=e(n);if(!r)throw new Error((0,o.mf)(t)?t(n):t);return r}};function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return[];for(var n=e.reduce((function(e,t){return Math.min(t.length,e)}),9007199254740991),o=[],r=function(t){switch(e.length){case 1:o.push([e[0][t]]);break;case 2:o.push([e[0][t],e[1][t]]);break;case 3:o.push([e[0][t],e[1][t],e[2][t]]);break;case 4:o.push([e[0][t],e[1][t],e[2][t],e[3][t]]);break;default:o.push(e.map((function(e){return e[t]})))}},s=0;s<n;s++)r(s);return o}function I(e,t){var n,r;if((0,o.kJ)(t)&&(n=t[0],r=t[1]),!(0,o.HD)(n))throw new Error("invalid parameters to applyPairs");return e[n]=r,e}function z(e){return e.length&&e[e.length-1]||void 0}function J(e,t){return t&&Object.keys(t).forEach((function(e){return delete t[e]})),t||(t={}),_(t,e)}var V=function(e){return e.catch((function(e){return 0}))&&e},N=function(e){return V(s.u.$q.reject(e))}},"./node_modules/@uirouter/core/lib-esm/common/coreservices.js":(e,t,n)=>{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],a=0,i=s.length;a<i;a++,r++)o[r]=s[a];return o};function r(e){return function t(){if(arguments.length>=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.apply(null,[].slice.call(arguments).reverse())}var i=function(e){return function(t){return t&&t[e]}},d=r((function(e,t,n){return n&&n[e]===t})),u=function(e){return a.apply(null,e.split(".").map(i))},m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}};function l(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.apply(null,n)&&t.apply(null,n)}}function _(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.apply(null,n)||t.apply(null,n)}}var c=function(e){return function(t){return t.reduce((function(t,n){return t&&!!e(n)}),!0)}},h=function(e){return function(t){return t.reduce((function(t,n){return t||!!e(n)}),!1)}},f=function(e){return function(t){return null!=t&&t.constructor===e||t instanceof e}},p=function(e){return function(){return e}};function M(e){return function(t){for(var n=0;n<e.length;n++)if(e[n][0](t))return e[n][1](t)}}},"./node_modules/@uirouter/core/lib-esm/common/predicates.js":(e,t,n)=>{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length<e;)t+=" ";return t}function u(e){return e.replace(/^([A-Z])/,(function(e){return e.toLowerCase()})).replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))}function m(e){var t=l(e),n=t.match(/^(function [^ ]+\([^)]*\))/),o=n?n[1]:t,r=e.name||"";return r&&o.match(/function \(/)?"function "+r+o.substr(9):o}function l(e){var t=(0,o.kJ)(e)?e.slice(-1)[0]:e;return t&&t.toString()||"undefined"}var _=r.i.isRejectionPromise,c=(0,a.uj)([[o.o8,(0,a.P0)("undefined")],[o.Ft,(0,a.P0)("null")],[o.tI,(0,a.P0)("[Promise]")],[_,function(e){return e._transitionRejection.toString()}],[function(e){return(0,o.Kn)(e)&&!(0,o.kJ)(e)&&e.constructor!==Object&&(0,o.mf)(e.toString)},function(e){return e.toString()}],[o.Qh,m],[(0,a.P0)(!0),s.yR]]);function h(e){var t=[];function n(e){if((0,o.Kn)(e)){if(-1!==t.indexOf(e))return"[circular ref]";t.push(e)}return c(e)}return(0,o.o8)(e)?n(e):JSON.stringify(e,(function(e,t){return n(t)})).replace(/\\"/g,'"')}var f=function(e){return function(t){if(!t)return["",""];var n=t.indexOf(e);return-1===n?[t,""]:[t.substr(0,n),t.substr(n+1)]}},p=function(e){return e.replace(/\/[^/]*$/,"")},M=f("#"),y=f("?"),L=f("="),g=function(e){return e?e.replace(/^#/,""):""};function Y(e){var t=new RegExp("("+e+")","g");return function(e){return e.split(t).filter(s.yR)}}function v(e,t){return(0,o.HD)((0,s.Gb)(e))&&(0,o.HD)(t)?e.slice(0,-1).concat((0,s.Gb)(e)+t):(0,s.Ez)(e,t)}},"./node_modules/@uirouter/core/lib-esm/common/trace.js":(e,t,n)=>{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._set(!0,e)},e.prototype.disable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._set(!1,e)},e.prototype.enabled=function(e){return!!this._enabled[u(e)]},e.prototype.traceTransitionStart=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Started -> "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o<r.length;o++){var s=r[o];n[s.id]=s.value(t[s.id])}return n},e.changed=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e.filter((function(e){return!e.type.equals(t[e.id],n[e.id])}))},e.equals=function(t,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),0===e.changed(t,n,o).length},e.validates=function(e,t){return void 0===t&&(t={}),e.map((function(e){return e.validates(t[e.id])})).reduce(r.XC,!0)},e.prototype.isDefaultValue=function(e){return this.isOptional&&this.type.equals(this.value(),e)},e.prototype.value=function(e){var t=this;return e=function(e){for(var n=0,o=t.replace;n<o.length;n++){var r=o[n];if(r.from===e)return r.to}return e}(e),(0,a.o8)(e)?function(){if(t._defaultValueCache)return t._defaultValueCache.defaultValue;if(!i.u.$injector)throw new Error("Injectable functions cannot be called at configuration time");var e=i.u.$injector.invoke(t.config.$$fn);if(null!=e&&!t.type.is(e))throw new Error("Default value ("+e+") for parameter '"+t.id+"' is not an instance of ParamType ("+t.type.name+")");return t.config.$$fn.__cacheable&&(t._defaultValueCache={defaultValue:e}),e}():this.type.$normalize(e)},e.prototype.isSearch=function(){return this.location===o.SEARCH},e.prototype.validates=function(e){if(((0,a.o8)(e)||null===e)&&this.isOptional)return!0;var t=this.type.$normalize(e);if(!this.type.is(t))return!1;var n=this.type.encode(t);return!((0,a.HD)(n)&&!this.type.pattern.exec(n))},e.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},e}()},"./node_modules/@uirouter/core/lib-esm/params/paramType.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a<o.length;a++)if(!e(o[a],r[a]))return!1;return!0}}["encode","decode","equals","$normalize"].forEach((function(t){var o=e[t].bind(e),r="equals"===t?i:a;n[t]=r(o)})),(0,o.l7)(this,{dynamic:e.dynamic,name:e.name,pattern:e.pattern,inherit:e.inherit,raw:e.raw,is:a(e.is.bind(e),!0),$arrayMode:t})}},"./node_modules/@uirouter/core/lib-esm/params/paramTypes.js":(e,t,n)=>{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l<m&&t[l].state!==o&&(r=t[l],s=n[l],r.equals(s,e.nonDynamicParams));)l++;i=(a=t).slice(0,l),d=a.slice(l);var _=i.map((function(e,t){var o=e.clone();return o.paramValues=n[t].paramValues,o}));return u=n.slice(l),{from:a,to:_.concat(u),retained:i,retainedWithToParams:_,exiting:d,entering:u}},e.matching=function(e,t,n){var r=!1;return(0,o.ym)(e,t).reduce((function(e,t){var o=t[0],s=t[1];return(r=r||!o.equals(s,n))?e:e.concat(o)}),[])},e.equals=function(t,n,o){return t.length===n.length&&e.matching(t,n,o).length===t.length},e.subPath=function(e,t){var n=(0,o.sE)(e,t),r=e.indexOf(n);return-1===r?void 0:e.slice(0,r+1)},e.nonDynamicParams=function(e){return e.state.parameters({inherit:!1}).filter((function(e){return!e.dynamic}))},e.paramValues=function(e){return e.reduce((function(e,t){return(0,o.l7)(e,t.paramValues)}),{})},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/interface.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s<r;s++)if(""!==o[s]||0!==s){if("^"!==o[s])break;if(!a.parent)throw new Error("Path '"+e+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var i=o.slice(s).join(".");return a.name+(a.name&&i?".":"")+i},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateObject.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n<t.length;n++){var s=new o.rR(t[n]);if(s&&s.matches(e.name)||!s&&t[n]===e.name)return!0}return!1})(e,n)}var a=function(){function e(e,t,n,o,r,s){void 0===s&&(s={}),this.tranSvc=e,this.eventType=t,this.callback=n,this.matchCriteria=o,this.removeHookFromRegistry=r,this.invokeCount=0,this._deregistered=!1,this.priority=s.priority||0,this.bind=s.bind||null,this.invokeLimit=s.invokeLimit}return e.prototype._matchingNodes=function(e,t,n){if(!0===t)return e;var o=e.filter((function(e){return s(e.state,t,n)}));return o.length?o:null},e.prototype._getDefaultMatchCriteria=function(){return(0,o.js)(this.tranSvc._pluginapi._getPathTypes(),(function(){return!0}))},e.prototype._getMatchingNodes=function(e,t){var n=this,s=(0,o.l7)(this._getDefaultMatchCriteria(),this.matchCriteria);return(0,o.VO)(this.tranSvc._pluginapi._getPathTypes()).reduce((function(a,i){var d=i.scope===r.c.STATE,u=e[i.name]||[],m=d?u:[(0,o.Gb)(u)];return a[i.name]=n._matchingNodes(m,s[i.name],t),a}),{})},e.prototype.matches=function(e,t){var n=this._getMatchingNodes(e,t);return(0,o.VO)(n).every(o.yR)?n:null},e.prototype.deregister=function(){this.removeHookFromRegistry(this),this._deregistered=!0},e}();function i(e,t,n){var r=(e._registeredHooks=e._registeredHooks||{})[n.name]=[],s=(0,o.nA)(r);function i(e,o,i){void 0===i&&(i={});var d=new a(t,n,o,e,s,i);return r.push(d),d.deregister.bind(d)}return e[n.name]=i,i}},"./node_modules/@uirouter/core/lib-esm/transition/interface.js":(e,t,n)=>{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o<t.length;o++){var r=t[o].invokeHook();if((0,a.tI)(r)){var s=t.slice(o+1);return e.chain(s,r).then(n)}}return n()},e.runAllHooks=function(e){e.forEach((function(e){return e.invokeHook()}))},e.prototype.logError=function(e){this.transition.router.stateService.defaultErrorHandler()(e)},e.prototype.invokeHook=function(){var e=this,t=this.registeredHook;if(!t._deregistered){var n=this.getNotCurrentRejection();if(n)return n;var o=this.options;d.g4.traceHookInvocation(this,this.transition,o);var r=function(n){return t.eventType.getErrorHandler(e)(n)},s=function(n){return t.eventType.getResultHandler(e)(n)};try{var i=t.callback.call(o.bind,e.transition,e.stateContext);return!this.type.synchronous&&(0,a.tI)(i)?i.catch((function(e){return m.i.normalize(e).toPromise()})).then(s,r):s(i)}catch(e){return r(m.i.normalize(e))}finally{t.invokeLimit&&++t.invokeCount>=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(){function e(e){this.router=e}return e.prototype.fromConfig=function(e,t,n){return new s.Param(e,t,s.DefType.CONFIG,this.router.urlService.config,n)},e.prototype.fromPath=function(e,t,n){return new s.Param(e,t,s.DefType.PATH,this.router.urlService.config,n)},e.prototype.fromSearch=function(e,t,n){return new s.Param(e,t,s.DefType.SEARCH,this.router.urlService.config,n)},e}(),d=function(){function e(e){var t=this;this.router=e,this.paramFactory=new i(this.router),this.UrlMatcher=r.x,this.Param=s.Param,this.caseInsensitive=function(e){return t.router.urlService.config.caseInsensitive(e)},this.defaultSquashPolicy=function(e){return t.router.urlService.config.defaultSquashPolicy(e)},this.strictMode=function(e){return t.router.urlService.config.strictMode(e)},this.type=function(e,n,o){return t.router.urlService.config.type(e,n,o)||t}}return e.prototype.compile=function(e,t){var n=this.router.urlService.config,s=t&&!t.state&&t.params;t=s?a({state:{params:s}},t):t;var i={strict:n._isStrictMode,caseInsensitive:n._isCaseInsensitive,decodeParams:n._decodeParams};return new r.x(e,n.paramTypes,this.paramFactory,(0,o.l7)(i,t))},e.prototype.isMatcher=function(e){if(!(0,o.Kn)(e))return!1;var t=!0;return(0,o.Ed)(r.x.prototype,(function(n,r){(0,o.mf)(n)&&(t=t&&(0,o.$K)(e[r])&&(0,o.mf)(e[r]))})),t},e.prototype.$get=function(){var e=this.router.urlService.config;return e.paramTypes.enqueue=!1,e.paramTypes._flushTypeQueue(),this},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRouter.js":(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o<t.length;o++)t[o]._group=n,o<t.length-1&&0!==this._sortFn(t[o],t[o+1])&&n++;this._rules=t,this._sorted=!0},e.prototype.ensureSorted=function(){this._sorted||this.sort()},e.prototype.stableSort=function(e,t){var n=e.map((function(e,t){return{elem:e,idx:t}}));return n.sort((function(e,n){var o=t(e.elem,n.elem);return 0===o?e.idx-n.idx:o})),n.map((function(e){return e.elem}))},e.prototype.when=function(e,t,n){var o=this.urlRuleFactory.create(e,t);return(0,a.$K)(n&&n.priority)&&(o.priority=n.priority),this.rule(o),o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlService.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;a<s.length&&(!t||t.rule._group===s[a]._group);a++){var i=(void 0,(r=(n=s[a]).match(e,this.router))&&{match:r,rule:n,weight:n.matchPriority(r)});t=!t||i&&i.weight>t.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'<div class="ngrateiti needsclick" ng-class="{\'ngrateit-readonly\': readOnly()}"><a ng-if="!readOnly() && resetable()"ng-click="removeRating()"class="ngrateit-reset ngrateit-star needsclick"ng-style="{\'width\': canelWidth+\'px\', \'height\':cancelHeight+\'px\'}"></a><div ng-if="!hide" id="origin" class="ngrateit-rating needsclick" ng-class="{\'ngrateit-hashover\':!isTouch}"><span class="ngrateit-star ngrateit-bg-star needsclick"ng-repeat="i in getStartParts() track by $index" ng-class="{\'ngrateit-selected\': isSelected($index) }"ng-click="setValue($index)"ng-style="{\'width\': starPartWidth+\'px\', \'height\':starHeight+\'px\', \'background-position\': getStarOffset($index)+\'px 0\'}"></span></div></div>')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y;function L(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function g(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function Y(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function k(e){return function(t){h.errors[e]=t.data,g()}}function j(e){u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),g()})).catch(k("chatMessageError"))}function w(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:L();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function D(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&j(v()({body:n},t.visitor))}function H(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r<e.rows.length;r++){const s=b()(t.messages,{id:e.rows[r].id});s?e.rows[r].read&&(s.read=!0):(o=!0,t.messages.push(e.rows[r])),"out"!==e.rows[r].direction||e.rows[r].read||(n=e.rows[r].id,u.chatMessage.update({id:n,read:!0}).$promise.catch((function(e){console.error(e)})))}o&&g(),e.rows[r-1].read&&(y=e.rows[r-1].id),y&&!t.visitor.interactionStarted&&m.updateStorage(l,{...t.visitor,interactionStarted:!0}).then((e=>{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?L():(w(),p=r(H,2e3),M=r(w,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){D(t)},ready:function(){this.setFocus()}}})},h.reply=D,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(j(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void Y();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},j(v()({body:'<a href="'+t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_download?attachId="+e.id+"&token="+t.settings.token+'" target="_blank">'+e.name+"</a>",AttachmentId:e.id},t.visitor))):k("sendAttachment")}),k("sendAttachment"))},h.handleSizeError=Y,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e<i.fields.length;e++){const n=i.fields[e];if(t.typeField+=n.type,void 0!==n.props&&n.props.helpText){const t=RegExp.prototype.test.bind(/(<([^>]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;n<i.fields.length;n++){const o=i.fields[n];o.props&&void 0!==e[o.props.title]&&(_()(o.cmField)||(i.visitor[o.cmField]=Array.isArray(e[o.props.title])?e[o.props.title].join():e[o.props.title]),n===d&&(_()(t.settings.mapKeyOffline)||(i.visitor.mapKeyOffline=t.settings.mapKeyOffline,i.visitor.from=Array.isArray(e[o.props.title])?e[o.props.title].join():e[o.props.title])),"upload"===o.type&&(e[o.props.title]=e[o.props.title].map((e=>e.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e<a.fields.length;e++){const t=a.fields[e];if(t.props.helpText){const n=RegExp.prototype.test.bind(/(<([^>]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t<a.fields.length;t++){const o=a.fields[t];o.props&&void 0!==a.form[o.props.title]&&(_()(o.variable)||(e.visitor[o.variable]=Array.isArray(a.form[o.props.title])?a.form[o.props.title].join():a.form[o.props.title]),_()(o.cmField)||(e.visitor[o.cmField]=Array.isArray(a.form[o.props.title])?a.form[o.props.title].join():a.form[o.props.title]),t===i&&(_()(e.settings.mapKey)||(e.visitor.mapKey=e.settings.mapKey,e.visitor.from=Array.isArray(a.form[o.props.title])?a.form[o.props.title].join():a.form[o.props.title])),a.form[o.props.title]&&(n+=o.props.title+": "+a.form[o.props.title]+"\n"))}var d;d=v()({body:n,referer:e.settings.referer,customerIp:e.settings.customerIp},e.visitor),a.disableItem=!0,o.chatWebsite.notify(d).$promise.then((function(n){delete a.errors.chatMessageError,e.visitor.message={id:n.message.id},e.visitor.interaction={id:n.interaction.id},r.updateStorage(s,e.visitor).then((t=>{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e<t.messages.length;e++){const i=t.messages[e];let d="Sender: ";const u="Message: "+i.body,m="Sent At: "+s()(i.createdAt).format("YYYY-MM-DD HH:mm:ss");if(0!==e){switch(t.settings.agentIdentifier){case"website_alias":d+="out"===i.direction?i.UserId?r.agentAlias+i.UserId:"System":r.customerAlias||o.from||"Visitor"+i.ContactId;break;case"agent_alias":d+="out"===i.direction?i.UserId?i.User.alias||i.User.fullname:"System":r.customerAlias||o.from||"Visitor"+i.ContactId;break;case"agent_fullname":d+="out"===i.direction?i.UserId?i.User.fullname:"System":r.customerAlias||o.from||"Visitor"+i.ContactId;break;default:d+="out"===i.direction?i.UserId?(r.agentAlias||"Agent")+i.UserId:"System":r.customerAlias||o.from||"Visitor"+i.ContactId}n.appendChild(document.createTextNode(d)),n.appendChild(document.createElement("br")),n.appendChild(document.createTextNode(u)),n.appendChild(document.createElement("br")),n.appendChild(document.createTextNode(m)),n.appendChild(document.createElement("br")),n.appendChild(document.createElement("br"))}else a=i.createdAt}const i=window.open();i.document.write("<html><head><title>"+document.title+"</title>"),i.document.write("</head><body >"),i.document.write("<h3> Website: "+r.referer+"</h3>"),i.document.write("<h3> Start Time: "+s()(a).format("YYYY-MM-DD HH:mm:ss")+"</h3>"),i.document.write("<h3> Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"</h3>"),i.document.write(n.innerHTML),i.document.write("</body></html>"),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l<m.length;l++)s.append(u+"["+l+"]",m.item(l));else m instanceof Blob?s.append(u,m,m.name):m instanceof Date?s.append(u,m.toISOString()):(null===m&&o.includeNullValues||null!==m)&&void 0!==m&&s.append(u,m)}i++}return s}return function(e,t){if(t&&t.initialFormData){if("function"!=typeof t.initialFormData.append)throw"initialFormData must have an append function."}else if(!n())throw"This environment does not have global form data. options.initialFormData must be specified.";var s=[{initialFormData:o(),showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}},t||{}].reduce((function(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}),{});return r(e,s,s.initialFormData)}}()}.apply(t,[]))||(e.exports=n)},"./node_modules/moment/locale/af.js":function(e,t,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\200fM/\200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\200fM/\200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\200fM/\200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک\200cشنبه_دوشنبه_سه\200cشنبه_چهارشنبه_پنج\200cشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک\200cشنبه_دوشنبه_سه\200cشنبه_چهارشنبه_پنج\200cشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه\200cكشه\200cممه\200c_دووشه\200cممه\200c_سێشه\200cممه\200c_چوارشه\200cممه\200c_پێنجشه\200cممه\200c_هه\200cینی_شه\200cممه\200c".split("_"),weekdaysShort:"یه\200cكشه\200cم_دووشه\200cم_سێشه\200cم_چوارشه\200cم_پێنجشه\200cم_هه\200cینی_شه\200cممه\200c".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره\200c|به\200cیانی/,isPM:function(e){return/ئێواره\200c/.test(e)},meridiem:function(e,t,n){return e<12?"به\200cیانی":"ئێواره\200c"},calendar:{sameDay:"[ئه\200cمرۆ كاتژمێر] LT",nextDay:"[به\200cیانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له\200c %s",past:"%s",s:"چه\200cند چركه\200cیه\200cك",ss:"چركه\200c %d",m:"یه\200cك خوله\200cك",mm:"%d خوله\200cك",h:"یه\200cك كاتژمێر",hh:"%d كاتژمێر",d:"یه\200cك ڕۆژ",dd:"%d ڕۆژ",M:"یه\200cك مانگ",MM:"%d مانگ",y:"یه\200cك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්\200dරේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්\200dරහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්\200dරහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්\200dර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n<l.length?r+t:r})),o.addByteOrderMarker&&(a+="\ufeff"),a+=i,r.resolve(a)}));return"function"==typeof d.catch&&d.catch((function(e){r.reject(e)})),r.promise},this.isSpecialChar=function(e){return void 0!==n[e]},this.getSpecialChar=function(e){return n[e]}}]),angular.module("ngCsv.directives").directive("ngCsv",["$parse","$q","CSV","$document","$timeout",function(e,t,o,r,s){return{restrict:"AC",scope:{data:"&ngCsv",filename:"@filename",header:"&csvHeader",columnOrder:"&csvColumnOrder",txtDelim:"@textDelimiter",decimalSep:"@decimalSeparator",quoteStrings:"@quoteStrings",fieldSep:"@fieldSeparator",lazyLoad:"@lazyLoad",addByteOrderMarker:"@addBom",ngClick:"&",charset:"@charset",label:"&csvLabel"},controller:["$scope","$element","$attrs","$transclude",function(e,n,r){e.csv="",angular.isDefined(e.lazyLoad)&&"true"==e.lazyLoad||angular.isArray(e.data)&&e.$watch("data",(function(){e.buildCSV()}),!0),e.getFilename=function(){return e.filename||"download.csv"},e.buildCSV=function(){var s=t.defer();return n.addClass(r.ngCsvLoadingClass||"ng-csv-loading"),o.stringify(e.data(),function(){var t={txtDelim:e.txtDelim?e.txtDelim:'"',decimalSep:e.decimalSep?e.decimalSep:".",quoteStrings:e.quoteStrings,addByteOrderMarker:e.addByteOrderMarker};return angular.isDefined(r.csvHeader)&&(t.header=e.$eval(e.header)),angular.isDefined(r.csvColumnOrder)&&(t.columnOrder=e.$eval(e.columnOrder)),angular.isDefined(r.csvLabel)&&(t.label=e.$eval(e.label)),t.fieldSep=e.fieldSep?e.fieldSep:",",t.fieldSep=o.isSpecialChar(t.fieldSep)?o.getSpecialChar(t.fieldSep):t.fieldSep,t}()).then((function(t){e.csv=t,n.removeClass(r.ngCsvLoadingClass||"ng-csv-loading"),s.resolve(t)})),e.$apply(),s.promise}}],link:function(e,t){t.bind("click",(function(){e.buildCSV().then((function(){!function(){var t=e.charset||"utf-8",o=new Blob([e.csv],{type:"text/csv;charset="+t+";"});if(n.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(o,e.getFilename());else{var a=angular.element('<div data-tap-disabled="true"><a></a></div>'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/dc49a9ba939f8c099868.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/9962474df74f9405ac72.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/caf0e553108b226443aa.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]);
-//# sourceMappingURL=chat.js.map
\ No newline at end of file
+++ /dev/null
-{"version":3,"file":"scripts/chat.js","mappings":";iMAOAA,QAAQC,OAAO,gBAAiB,IAC/BC,SAAS,eAAe,WACvB,aAMAC,KAAKC,SAAW,GAQhBD,KAAKE,QAAU,SAAUC,GACvB,OAAO,IAAIC,EAAKD,IASlBH,KAAKK,OAAS,GASdL,KAAKM,GAAK,SAAUC,EAAOC,GACzBR,KAAKK,OAAOI,KAAK,CAACF,EAAOC,KAG3BR,KAAKU,KAAO,WACV,IAAIC,EAAKX,KAAKE,QACVD,EAAWD,KAAKC,SAChBI,EAASL,KAAKK,OAClB,MAAO,CACL,OAAU,SAASO,GAEjB,IAAIC,EAAOF,EAAGd,QAAQiB,OAAO,GAAIb,EAAUW,IAI3C,OAHAf,QAAQkB,QAAQV,GAAQ,SAAUE,GAChCM,EAAKP,GAAGC,EAAM,GAAIA,EAAM,OAEnBM,QAKfhB,QAAQC,OAAO,YAAa,CAAC,kBAC1BkB,WAAW,WAAY,CAAC,SAAU,SAAU,SAAU,cACvD,SAAUC,EAAQC,EAAQC,EAAQC,GAEhC,IAAIjB,EAAUN,QAAQiB,OAAO,GAAIG,EAAOI,MAAMH,EAAOI,WAGjDT,EAAQI,EAAOI,MAAMH,EAAOK,aAAeH,EAAYI,OAAOrB,GAE9DsB,EAAkB,SAASC,GAC7B,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtCL,EAAKM,QACL,IAAI1B,EAAQU,EAAOiB,WAAWC,MAAMlB,EAAQ,CAAC,SAAWS,EAAWb,GAAMuB,OAAOT,IAMhF,GALI,CACF,SAAW,EAAG,eAAiB,EAAG,YAAe,EAAG,UAAa,EAAG,SAAY,GAChFD,IACAT,EAAOoB,cAEL9B,EAAM+B,iBACR,OAAO,GAIXzB,EAAKP,GAAG,WAAYmB,GACpBR,EAAOsB,IAAI,YAAY,WACnB1B,EAAK2B,IAAI,WAAYf,MAGzBR,EAAOwB,MAAQ5B,EAEXK,EAAOwB,eAAe,cACxBvB,EAAOD,EAAOyB,UAAUC,OAAO3B,EAAQJ,GACvCI,EAAOsB,IAAI,YAAY,WACrBpB,EAAOD,EAAOyB,UAAUC,OAAO3B,UAIpC4B,UAAU,WAAY,CAAC,WACtB,MAAO,CACLC,OAAO,EACP9B,WAAY,eAGlBnB,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,SAAY,KACZ,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAIC,EAAcD,EAAMN,eAAe,iBACnCQ,EAAeF,EAAMN,eAAe,kBACpCS,EAAaH,EAAMN,eAAe,cAAgBI,EAAMzB,MAAM2B,EAAMI,WACxEN,EAAML,MAAMY,aAAaN,EAASE,EAAaC,EAAcC,QAInEtD,QAAQC,OAAO,kBAAmB,CAAC,cAKhC+C,UAAU,mBAAmB,WAC5B,MAAO,CACL,OAAS,EACT,KAAQ,SAASC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,iBAAiB,SAAU/C,GACtCA,EAAMgD,yBASbV,UAAU,gBAAiB,CAAC,WAAY,SAASW,GAChD,MAAO,CACL,OAAS,EACT,KAAQ,SAASV,EAAOC,EAASC,GAC/B,IAAIS,EACAC,GAAQ,EACZX,EAAQO,KAAK,YAAY,SAAU/C,GAmBnC,IAAoBoD,EACdC,EACAC,EADAD,GAAW,EACXC,GAFcF,EAlBFpD,GAoBasD,cAAgBF,EAAUG,cAAcD,aACrEhE,QAAQkB,QAAQ8C,GAAgBA,EAAaE,OAAO,SAASC,GAC/C,UAARA,IACFJ,GAAW,MAGRA,IAvBFF,IACHZ,EAAMmB,OAAOjB,EAAMkB,eACnBR,GAAQ,GAEVF,EAASW,OAAOV,GAChBlD,EAAMgD,qBAERR,EAAQO,KAAK,kBAAkB,SAAU/C,GACvCiD,EAASW,OAAOV,GAChBA,EAAUD,GAAS,WACjBV,EAAMzB,MAAM2B,EAAMoB,eAClBX,EAAU,KACVC,GAAQ,IACP,aAgBb7D,QAAQC,OAAO,YAAa,CAAC,cAC5B+C,UAAU,YAAY,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAY/B,SAASqB,IACPvB,EAAML,MAAM4B,WAAWtB,GAZrBC,EAAMsB,gBACRxB,EAAMyB,OAAOvB,EAAMsB,iBAAiB,SAAUE,GACxCA,EACFH,IAYJvB,EAAML,MAAMgC,aAAa1B,MANzBsB,SAYP,SAAUxE,GAAU,aACnB,IAAIC,EAASD,EAAQC,OAAO,cAAe,CAAC,cAgB5CD,EAAQkB,QAfK,CACX2D,YAAa,CAAC,QAAS,YACvBC,aAAc,CAAC,SACfC,UAAW,CAAC,QAAS,UACrBC,WAAY,CAAC,SAAU,UACvBC,eAAgB,CAAC,SAAU,UAC3BC,UAAW,CAAC,SACZC,YAAa,CAAC,SACdC,UAAW,CAAC,QAAS,YACrBC,YAAa,GACbC,SAAU,GACVC,SAAU,GACVC,MAAO,CAAC,WAAY,WAGE,SAAUC,EAAW5D,GAC3C,IA4B6B6D,EA5BzBC,EAAO,SA4BkBD,EA5Ba7D,GA6B5B+D,OAAO,GAAGC,cAAgBH,EAAOzD,MAAM,IA5BzC,mBAAR0D,IACFA,EAAO,qBAET1F,EAAO+C,UAAU2C,EAAM,CAAC,WACtB,MAAO,CACLG,QAAS,YACT3E,WAAY,CAAC,SAAU,SAAU,SAAUC,EAAQC,GACjDD,EAAOsB,IAAI,SAAWb,GAAW,WAC/B,IAAIkE,EAAWhE,MAAMC,UAAUC,MAAMC,KAAKC,WACtCzB,EAAQqF,EAAS3D,QAErB,GAAIhB,EAAOwB,QAAUmD,EAAS3D,QAA9B,CAGA,IAAIN,EAAO,GACX9B,EAAQkB,QAAQuE,GAAW,SAASd,EAAOqB,GACzClE,EAAK6C,GAASoB,EAASC,OAEgB,IAArC5E,EAAOI,MAAMH,EAAOsE,GAAO7D,IAC7BpB,EAAMgD,8BAtCnB,CAiDC1D,SAEFA,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAI8C,EAAO9C,EAAM+C,QACjBjD,EAAMyB,OAAOuB,GAAM,SAAUA,GAC3B,GAAKA,EAAL,CAGA,IAAIE,EAAa,IAAIC,WACrBD,EAAWE,cAAcJ,EAAKA,MAC9BE,EAAWG,OAAS,SAAU5F,GAC5BuC,EAAMmB,QAAO,WACXjB,EAAMoD,KAAK,MAAO7F,EAAM8F,OAAOC,qBAO3CzG,QAAQC,OAAO,iBAAkB,CAAC,cACjC+C,UAAU,gBAAiB,CAAC,WAC3B,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,GACfA,EAAMyD,UAAYzD,EAAML,MAAM+D,WAIpC3G,QAAQC,OAAO,OAAQ,CAAC,gBAAiB,YAAa,cAAe,WACnE,YAAa,iBAAkB,WAAY,yHC9JlC2G,4PAkKX,SAASC,EAAmBC,EAAUC,EAAaC,EAAcC,EAAOC,GACpE,IAAIC,GAAkB,IAAAC,OAAM,yBACxBC,GAAe,IAAAD,OAAM,sBACzB,MAAO,CACHE,SAAU,MACVC,UAAW,IACXC,QAAS,SAAUC,GACf,IAAIC,EAAUD,EAASE,OAEvB,OADAF,EAASG,QACF,SAAU3E,EAAO4E,GACpB,IAAIC,EAAOD,EAASC,KAAK,WACzB,IAAKA,EAGD,OAFAD,EAASF,KAAKD,QACdZ,EAASe,EAASE,WAAlBjB,CAA8B7D,GAGlC,IAAI+E,EAAMF,EAAKG,MAAQ,CAAEC,SAAU,GAAIC,YAAa,EAAAC,MAChDC,EAAaL,EAAIM,MAAQ,IAAI,EAAAC,eAAeP,EAAIM,MACpDT,EAASF,KAAKK,EAAIG,YAAYN,EAAUQ,IAAeX,GACvD,EAAAc,MAAA,gBAAsBV,EAAKW,QAASZ,EAASF,QAC7C,IAAIe,EAAO5B,EAASe,EAASE,YACzB5G,EAAa6G,EAAI7G,WACjBwH,EAAexB,EAAgBa,GAC/BY,EAAYvB,EAAaW,GACzBa,EAASR,IAAc,OAAUA,GAErC,GADApF,EAAM2F,GAAaC,EACf1H,EAAY,CACZ,IAAI2H,EAAsB/B,EAAY5F,GAAY,IAAAF,QAAO,GAAI4H,EAAQ,CAAEzH,OAAQ6B,EAAO4E,SAAUA,KAC5Fc,IACA1F,EAAM0F,GAAgBG,EACtB7F,EAAM0F,GAAcC,GAAaC,GAMrChB,EAASC,KAAK,0BAA2BgB,GACzCjB,EAASkB,WAAWjB,KAAK,0BAA2BgB,GACpDE,EAA4B9B,EAAIF,EAAc8B,EAAoB7F,EAAO+E,GAG7E,IAAI,IAAAiB,UAASjB,EAAIkB,WACb,IAAIC,GAAY,IAAAC,aAAYpB,EAAIkB,WAC5BG,EAAc,IAAIC,OAAO,eAAiBH,EAAY,IAAK,KAO3DI,EAAoBtG,EAAMyB,QAND,WACzB,IAAI8E,EAAc,GAAGvH,MAChBC,KAAK2F,EAAS,GAAGkB,UACjBU,QAAO,SAAUC,GAAM,OAAOA,GAAMA,EAAGC,SAAWN,EAAYO,KAAKF,EAAGC,YAC3E,OAAOH,GAAe,aAAgBA,GAAa1B,KAAK,IAAME,EAAIkB,UAAY,iBAErB,SAAUW,GAC9DA,IAELb,EAA4B9B,EAAIF,EAAc6C,EAAc5G,EAAO+E,GACnEuB,QAGRb,EAAKzF,MAzNrB2D,EAAS,CACL,QACA,WACA,gBACA,eACA,KACA,SAAwBK,EAAO6C,EAAUC,EAAeC,EAAc9C,GAwBlE,IAAI+C,EAAW,CACXhC,KAAM,CAAEC,SAAU,CAAEgC,SAAUjD,EAAMkD,WAAWC,qBAC/C3B,QAAS,IAETzF,EAAY,CACZqH,MAAO,EACP/C,SAAU,MACVgD,UAAU,EACV/C,SAAU,IACVgD,WAAY,UACZ/C,QAAS,SAAUC,EAAU+C,EAAQC,GACjC,OAAO,SAAUxH,EAAO4E,EAAU1E,GAC9B,IACIuH,EAAYC,EAAWC,EAAcC,EADrCC,EAAY3H,EAAc,QAAK,GAAI4H,EAAgB5H,EAAkB,WAAG6H,EAjCzE,SAAU9H,EAASsD,EAAQyE,GAC1B,mBAAwB,EACxBnB,EAASjG,MAAMX,EAAS,KAAMsD,GAAQ0E,KAAKD,GAG3CnB,EAASjG,MAAMX,EAAS,KAAMsD,EAAQyE,IA4BkCD,EAzBzE,SAAU9H,EAAS+H,GAClB,mBAAwB,EACxBnB,EAASqB,MAAMjI,GAASgI,KAAKD,GAG7BnB,EAASqB,MAAMjI,EAAS+H,IAoB0EG,EAAYvD,EAASwD,cAAc,YAAcpB,EAAUtE,EAAOqE,EAAa7G,EAAc,QAAKA,EAAY,MAAK,GAAjD6G,CAAqD/G,IAAU,WAEnOqI,EAAe,CACfC,MAAO,MACPC,GAAIxI,EAAUqH,QACd1E,KAAMA,EACN8F,IAAKL,EAAU3C,QAAQgD,IAAML,EAAU3C,QAAQgD,IAAM,IAAM9F,EAAOA,EAClE+F,OAAQ,KACRC,cAWJ,SAA+BD,KACvBA,GAAYA,aAAkB,QAEjBb,IAAYa,IAE7B,EAAAlD,MAAA,yBAA+B8C,EAAcI,GAAUA,EAAOxD,UAAYwD,EAAOxD,SAASgC,UAC1FW,EAAaa,EACbE,EAAWF,MAjBX,sBAEI,IAAIG,GAAsB,IAAAzE,OAAM,yBAAN,CAAgCgE,GAGtDU,GAAgB,IAAA1E,OAAM,0BAAN,CAAiCgE,GACrD,OAAOS,GAAuBC,IAGtC,EAAAtD,MAAA,iBAAuB,UAAW8C,GAUlCzD,EAASC,KAAK,UAAW,CAAEW,QAAS6C,IACpCM,IACA,IAAIG,EAAa9E,EAAM+E,eAAeV,GA2BtC,SAASM,EAAWF,GAChB,IAAIO,EAAWhJ,EAAMiJ,OACjBC,EAAYjF,EAAGkF,QAASC,EAAYnF,EAAGkF,QACvCE,EAAc,CACdrE,KAAMyD,EACNjD,QAAS6C,GAETiB,EAAc,CACdC,WAAYL,EAAUvI,QACtB6I,WAAYJ,EAAUzI,QACtB8I,YAAaL,GAcjBJ,EAASU,MAAM,sBAAuBhH,GACtC,IAAIiH,EAASnC,EAAYwB,GAAU,SAAUY,GACzCA,EAAM/E,KAAK,cAAeyE,GAC1BM,EAAM/E,KAAK,UAAWwE,GACtBtB,EAAe6B,EAAOhF,GAAU,WAC5BsE,EAAUW,UACNlC,GACAA,EAAa+B,MAAM,gCAClB,IAAAI,WAAUhC,KAAmBA,GAAkB9H,EAAMzB,MAAMuJ,KAC5DhB,EAAc8C,MAvD9B,WAWI,GAVInC,IACA,EAAAlC,MAAA,iBAAuB,yBAA0BkC,EAAW5C,KAAK,YACjE4C,EAAWsC,SACXtC,EAAa,MAEbE,IACA,EAAApC,MAAA,iBAAuB,mBAAoB8C,GAC3CV,EAAaqC,WACbrC,EAAe,MAEfD,EAAW,CACX,IAAIuC,EAAcvC,EAAU7C,KAAK,eACjC,EAAAU,MAAA,iBAAuB,cAAe0E,GACtClC,EAAeL,GAAW,WACtBuC,EAAYR,YAAYI,UACxBpC,EAAa,QAEjBA,EAAaC,EACbA,EAAY,MAuCZwC,MAEJxC,EAAYiC,GACZhC,EAAeqB,GAWFU,MAAM,qBAAsBjB,GAAUb,GACnDD,EAAapJ,MAAMsJ,GA7EvB7H,EAAMP,IAAI,YAAY,WAClB,EAAA8F,MAAA,iBAAuB,2BAA4B8C,GACnDS,UAgFhB,OAAO/I,IAGf6D,EAAmBuG,QAAU,CAAC,WAAY,cAAe,eAAgB,QAAS,MAiElF,IAAIC,EAAuE,mBAA7C,YAAe,aAAwB,UAEjEC,EAAe,EAEnB,SAAStE,EAA4B9B,EAAIF,EAAc8B,EAAoB1H,EAAQ4G,KAE3E,IAAAuF,YAAWzE,EAAmB0E,WAC3BxF,EAAIE,SAASgB,WAAalB,EAAIE,SAASuF,oBAAsBJ,GAChEvE,EAAmB0E,UAEvB,IAAIE,GAAY,IAAAC,MAAK3F,EAAIM,MAAMsF,MAAMC,KACjCC,EAAc,CAAErK,KAAMqF,GAE1B,IAAI,IAAAyE,YAAWzE,EAAmBiF,mBAAoB,CAClD,IACIC,EADiB,IAAI,EAAAzF,eAAeP,EAAIM,MACH2F,cAAc,gBAAgBnG,KAyBvE1G,EAAOsB,IAAI,WAAYsE,EAAakH,UAAU,IAvB1B,SAAUC,GAG1B,GAAIA,IAAiBH,IAAsE,IAA/CG,EAAaC,UAAUC,QAAQX,GAA3E,CAEA,IAAIY,EAAWH,EAAaI,OAAO,MAC/BC,EAAaL,EAAaI,OAAO,QACjCE,EAAgB,SAAUC,GAAQ,OAAOA,EAAKC,aAC9CC,EAAWT,EAAaU,YAAY,MAAMC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAC7EC,EAAad,EAAaU,YAAY,QAAQC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAEjFE,EAAkBN,EAASnF,QAAO,SAAU0F,GAC5C,IAAIC,EAAMH,EAAWZ,QAAQc,GAC7B,OAAgB,IAATC,IAAeH,EAAWG,GAAKC,KAAKC,OAAOhB,EAASa,EAAM3D,IAAKgD,EAAWW,EAAM3D,QAG3F,GAAI0D,EAAgBK,OAAQ,CACxB,IAAIC,EAAgBN,EAAgBJ,KAAI,SAAUW,GAAK,OAAOA,EAAEjE,MAE5DkE,GAAY,IAAAjG,QAAO6E,GAAU,SAAUnK,EAAK6B,GAAO,OAAuC,IAAhCwJ,EAAcnB,QAAQrI,MACpF8C,EAAmBiF,kBAAkB2B,EAAWvB,OAGSL,IAGrE,IAAI,IAAAP,YAAWzE,EAAmB6G,WAAY,CAC1C,IAAIC,EAAOtC,IACPuC,EAAc,gBAEdC,EAAqB,SAAUC,GAC/B,QAASA,IAAWA,EAAMF,KAA6C,IAA7BE,EAAMF,GAAaD,IAAmBE,EAAmBC,EAAMC,oBAYzGC,EAAW,CAAE7B,QAASV,EAAU/H,MACpCvE,EAAOsB,IAAI,WAAYsE,EAAakJ,SAASD,GAV3B,SAAUF,GACxB,IAAInM,EACAuM,EAAOJ,EAAMF,GAAeE,EAAMF,IAAgB,GAKtD,OAJKC,EAAmBC,KACpBnM,EAAUsD,EAAGkJ,KAAKtH,EAAmB6G,UAAUI,KACvC7E,MAAK,SAAU/G,GAAO,OAAQgM,EAAIP,IAAgB,IAARzL,KAE/CP,IAGyDkK,KAG5E,YAAe,mBAAmB9K,UAAU,SAAU4D,GACtD,YAAe,mBAAmB5D,UAAU,SAAU6D,sWC9ZlDwJ,EAAiC,WACjC,SAASA,IACL,IAAIC,EAAQnQ,KACGA,KAAKoQ,SAAWvQ,EAAQ,GAAR,cAAwB,EACxCG,KAAKU,KAAO,CACvB,QACA,iBACA,YACA,SAAU2P,EAAOC,EAAgBC,GAI7B,OAHAJ,EAAMK,iBAAmBD,EAAUE,KAAOF,EAAUE,IAAI,qBAAuBF,EAAUG,IAAI,oBAC7FP,EAAME,MAAQA,EACdF,EAAMG,eAAiBA,EAChBH,IAyJnB,OApJAD,EAAgBrO,UAAU8O,eAAiB,SAAUnM,GACjDxE,KAAKoQ,SAAW5L,GAepB0L,EAAgBrO,UAAU+O,WAAa,SAAUrF,EAAQ6C,EAAQyC,GAC7D,IACIC,EAAa,SAAUxK,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGC,SAAUD,OAC3GE,EAAc,SAAU5K,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGjI,UAAWiI,OACjH,OAAO,IAAApE,WAAUrB,EAAO0F,UAClBH,EAAW9Q,KAAKmR,WAAW5F,EAAO0F,SAAU7C,KAC5C,IAAAxB,WAAUrB,EAAO6F,aACbN,EAAW9Q,KAAKqR,QAAQ9F,EAAO6F,YAAahD,KAC5C,IAAAxB,WAAUrB,EAAO+F,kBACbR,EAAW9Q,KAAKuR,aAAahG,EAAO+F,iBAAkBlD,EAAQyC,KAC9D,IAAAjE,WAAUrB,EAAOxC,WACbmI,EAAY3F,EAAOxC,YACnB,IAAA6D,WAAUrB,EAAO+B,mBACb4D,EAAYlR,KAAKwR,sBAAsBjG,EAAO+B,kBAAmBc,EAAQyC,IACzEC,EAbA,wBAwB1BZ,EAAgBrO,UAAUsP,WAAa,SAAUF,EAAU7C,GACvD,OAAO,IAAAhB,YAAW6D,GAAYA,EAAS7C,GAAU6C,GAWrDf,EAAgBrO,UAAUwP,QAAU,SAAUI,EAAKrD,GAG/C,OAFI,IAAAhB,YAAWqE,KACXA,EAAMA,EAAIrD,IACH,MAAPqD,EACO,KACPzR,KAAKoQ,SACEpQ,KAAKqQ,MACPK,IAAIe,EAAK,CAAEC,MAAO1R,KAAKsQ,eAAgBqB,QAAS,CAAEC,OAAQ,eAC1D7G,MAAK,SAAU8G,GAChB,OAAOA,EAASlK,QAGjB3H,KAAKwQ,iBAAiBiB,IAUjCvB,EAAgBrO,UAAU0P,aAAe,SAAUxR,EAAUqO,EAAQyC,GACjE,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAS1BX,EAAgBrO,UAAU2P,sBAAwB,SAAUzR,EAAUqO,EAAQyC,GAC1E,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAgB1BX,EAAgBrO,UAAUqQ,sBAAwB,SAAUzL,EAAQoK,EAAS9H,EAAWoJ,GACpFA,EAAWA,GAAY,GAEvB,IAAIC,EAASvS,EAAQ,GAAR,eAAyB,EAAI,KAAO,GAE7CwS,EAAQ,SAAUC,GAClB,IAAIC,GAAU,IAAAtJ,aAAYqJ,GAC1B,MAAO,aAAa7I,KAAK8I,GAAW,KAAOA,EAAUA,GA6BrDvP,EAQZ,SAA8BwC,GAC1B,IAAIgN,EAAU,EAAAzB,SAAA,cAAuBvL,EAAO,aAC5C,IAAKgN,IAAYA,EAAQpD,OACrB,MAAM,IAAIqD,MAAM,mCAAqCjN,EAAO,KAChE,OAAOgN,EAAQ7D,IAAI+D,GAAa9D,OAAO,EAAAC,QAAS,IAZhC8D,CAAqB5J,GAAW4F,KA3BzB,SAAUiE,GACzB,IAAIpN,EAAOoN,EAAMpN,KAAM0J,EAAO0D,EAAM1D,KAChC2D,EAAWR,EAAM7M,GAIrB,GAAIiB,EAAOqM,KAAKD,KAAcV,EAAS3M,GACnC,OAAOqN,EAAW,KAAOpM,EAAOqM,KAAKD,GAAY,IACrD,IAAIE,EAAcZ,EAAS3M,IAASA,EAGpC,GAAa,MAAT0J,EACA,OAAO2D,EAAW,OAAST,EAAS,YAAcW,EAAc,MAIpE,GAAa,MAAT7D,EAAc,CACd,IAAI8D,EAAMnC,EAAQ/C,cAAciF,GAC5BpS,EAAKqS,GAAOA,EAAIrL,KAChBhG,EAAQhB,GAAM,EAAAoQ,SAAA,mBAA4BpQ,IAAQ,GAGtD,OAAOkS,EAAW,cAAgBE,IADhB,IAAAf,SAAQrR,GAAM,KAAOA,EAAGyO,OAAS,GAAK,IAAM,IACA,IAAMzN,EAAKsR,KAAK,KAAO,KAGzF,OAAOJ,EAAW,KAAOT,EAAS,YAAcW,EAAc,OAEJE,KAAK,KAC/DjK,EAAYqJ,EAAMtJ,GACtB,MAAO,IAAMC,EAAY,IAAMhG,EAAQ,MAAQgG,EAAY,KAExDkH,EArKyB,GAiLhCwC,EAAc,SAAUQ,GACxB,OAAI,IAAAC,UAASD,EAAIE,kBACNC,EAAcH,EAAIE,kBACtBC,EAAcH,EAAIpQ,QAIzBuQ,EAAgB,SAAUC,GAC1B,OAAOC,OAAOC,KAAKF,GAAe,IAE7B3E,KAAI,SAAU9I,GAAO,MAAO,CAACA,EAAK,oBAAoB4D,KAAK6J,EAAYzN,QAEvEyD,QAAO,SAAUmK,GAAS,OAAO,IAAA7G,WAAU6G,KAAU,IAAAzB,SAAQyB,EAAM,OAEnE9E,KAAI,SAAU8E,GAAS,MAAO,CAAGjO,KAAMiO,EAAM,GAAG,IAAMA,EAAM,GAAIvE,KAAMuE,EAAM,GAAG,2ECzL7EC,EAAsB,SAAUC,GACvC,OAAO,SAA0BC,GAC7B,IAAIC,EAAOD,EAAYD,GACnBG,EAAwB,WAAbH,EAAwB,OAAS,KAOhD,OAAOE,EANP,SAA0BjE,EAAOnC,GAC7B,IACIsG,EADiB,IAAI,EAAA3L,eAAewH,EAAMlB,YAAYoF,IAC1BC,WAAWtG,EAAMuG,WAC7CtL,GAAS,IAAA5H,QAAOmT,EAAUF,GAAa,CAAEG,QAASzG,EAAOO,aAAc4B,IAC3E,OAAO,EAAAmB,SAAA,iBAA0B8C,EAAM7T,KAAM0I,SAEhByL,ICfrCC,EAAqC,WACrC,SAASA,EAAoBC,GAEzBrU,KAAKsU,cAAgB,GACrBtU,KAAKqU,kBAAoBA,EACzB,IAAIE,GAAM,IAAAvQ,KAAIqQ,IACd,IAAAG,sBAAqBD,EAAKvU,KAAMuU,EAAK,CAAC,eA8D1C,OAhDAH,EAAoBK,6BAA+B,SAAUC,GACzD,IAAIC,EAAWD,EAAOE,kBAAkB1F,KAAK,QAC7CyF,EAASE,OAAS,SAAUvF,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,WAAW,SAAUC,GAAK,MAAQ,CAAE,IAAK,KAAM,IAAK,OAAQA,MAAU1F,GAElHqF,EAASM,OAAS,SAAU3F,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,aAAa,SAAUC,GAAK,MAAQ,CAAE,KAAM,IAAK,MAAO,KAAMA,MAAU1F,IAIxH8E,EAAoBvS,UAAUqT,QAAU,aACxCd,EAAoBvS,UAAUsT,SAAW,SAAU3U,GAC/C,IAAI2P,EAAQnQ,KAEZ,OADAA,KAAKsU,cAAc7T,KAAKD,GACjB,WAAc,OAAO,IAAA4U,YAAWjF,EAAMmE,cAAjB,CAAgC9T,KAEhE4T,EAAoBvS,UAAUwT,UAAY,WACtC,IAAIA,EAAYrV,KAAKqU,kBAAkBgB,YAEvC,OADAA,GAAY,IAAAlC,UAASkC,GAAaA,EAAUC,QAAUD,IAClCrV,KAAKuV,SAASC,SAEtCpB,EAAoBvS,UAAU4T,SAAW,WACrC,OAAOzV,KAAK0V,YAAc1V,KAAK0V,UAAY1V,KAAK2V,SAASF,YAAczV,KAAK4V,QAAQC,SAAS/B,WAEjGM,EAAoBvS,UAAU4P,IAAM,SAAUqE,EAAQf,EAAStH,GAQ3D,YAPgB,IAAZsH,IAAsBA,GAAU,IAChC,IAAAnI,WAAUkJ,IACV9V,KAAK+V,UAAUtE,IAAIqE,GACnBf,GACA/U,KAAK+V,UAAUhB,UACftH,GACAzN,KAAK+V,UAAUtI,MAAMA,GAClBzN,KAAK+V,UAAUtE,OAE1B2C,EAAoBvS,UAAUmU,iBAAmB,SAAUC,EAAYF,EAAWR,EAAUI,EAAUC,GAClG,IAAIzF,EAAQnQ,KACZA,KAAK+V,UAAYA,EACjB/V,KAAKuV,SAAWA,EAChBvV,KAAK2V,SAAWA,EAChB3V,KAAK4V,QAAUA,EAEfK,EAAW1T,IAAI,0BAA0B,SAAU2T,GAAO,OAAO/F,EAAMmE,cAAcvT,SAAQ,SAAUJ,GAAM,OAAOA,EAAGuV,SACvH,IAAIC,GAAO,IAAAnS,KAAI+R,IAEf,IAAAvB,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,UAAW,OAAQ,SAAU,UAErE,IAAA3B,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,OAAQ,WAAY,UAEzD/B,EApE6B,0ECaxCvU,EAAQ,GAAR,OAAe,qBAAsB,IACrC,IAAIuW,EAAWvW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,OAC7CwW,EAAWxW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,mBAC7CyW,EAAUzW,EAAQ,GAAR,OAAe,mBAAoB,CAAC,mBAC9C0W,EAAY1W,EAAQ,GAAR,OAAe,kBAAmB,CAAC,mBAAoB,iBAAkB,uBACrF2W,EAAW3W,EAAQ,GAAR,OAAe,YAAa,CAAC,iBAAkB,kBAAmB,uBAE7E6U,GADW7U,EAAQ,GAAR,OAAe,mBAAoB,CAAC,cACtC,MAGb,SAAS4W,EAAkBpC,IAEvBK,EAAS1U,KAAK0U,OAAS,IAAI,EAAAgC,UACpBC,cAAgB,IAAI,IAAcjC,EAAOkC,cAAelC,EAAOmC,cAEtEnC,EAAOkC,cAAcE,UAAU,QAAS,MACxCpC,EAAOkC,cAAcE,UAAU,SAAUpD,EAAoB,WAC7DgB,EAAOkC,cAAcE,UAAU,WAAYpD,EAAoB,aAC/DgB,EAAOkC,cAAcE,UAAU,UAAWpD,EAAoB,YAC9DgB,EAAOqC,YAAY/M,WAAWgN,mBAAmB,OAAO,WAExDtC,EAAOuC,WAAW1L,OAAO2L,eAAgB,EACzC,IAAIC,EAAsBzC,EAAO0C,gBAAkB1C,EAAO2C,eAAiB,IAAIjD,EAAoBC,GAMnG,SAAS3T,EAAKqV,EAAWJ,EAAUC,EAASL,EAAUU,EAAY5F,EAAOC,GAIrE,OAHA6G,EAAmBnB,iBAAiBC,EAAYF,EAAWR,EAAUI,EAAUC,UACxElB,EAAe,cACfA,EAAa,KACbA,EAEX,OAXAN,EAAoBK,6BAA6BC,GAEjDA,EAAe,OAAIA,EACnBA,EAAa,KAAIhU,EACjBA,EAAKuM,QAAU,CAAC,YAAa,WAAY,UAAW,WAAY,aAAc,QAAS,kBAOhFyH,EA1BX+B,EAAkBxJ,QAAU,CAAC,qBA4B7B,IAAIqK,EAAiB,SAAUC,GAAe,MAAO,CACjD,oBACA,SAAUC,GACN,IAAIC,EAAUD,EAAK9C,OAAO6C,GAE1B,OADAE,EAAc,KAAI,WAAc,OAAOA,GAChCA,KAKf,SAASC,EAASnH,EAAWxJ,EAAI4Q,GAI7B,GAHA,EAAA5G,SAAA,UAAqBR,EACrB,EAAAQ,SAAA,GAAchK,GAETwM,OAAO1R,UAAUa,eAAeX,KAAKwO,EAAW,YACjD,IACIA,EAAUqH,QAAO,SAAUC,OAE/B,MAAOxS,GACHkL,EAAUuH,WAAa,cAAcrO,KAAKpE,GAASA,EAAMyP,YAKjE6C,EAAUf,cACLlG,MACA/B,KAAI,SAAUW,GAAK,OAAOA,EAAE0E,UAAU+D,eACtCnJ,OAAO,EAAAC,QAAS,IAChBvF,QAAO,SAAUgG,GAAK,MAAkB,aAAXA,EAAEwC,QAC/B/Q,SAAQ,SAAUiX,GAAc,OAAQA,EAAWlG,KAAOvB,EAAU0H,SAASD,EAAWE,UAAW3H,EAAUuH,aAQ/G,SAASK,EAAalC,GACzBA,EAAW1R,QAAO,WACd,EAAA8D,MAAA,wBA9BRqP,EAASzK,QAAU,CAAC,YAAa,KAAM,aA2BvCkL,EAAalL,QAAU,CAAC,cAMxBmJ,EAASrW,SAAS,YAAa0W,GAC/BH,EAAQvW,SAAS,aAAc,CAAC,oBAXL,SAAUqY,GAAY,OAAQA,EAASC,kBAAoB,IAAI,IAAkBD,MAY5G/B,EAAStW,SAAS,cAAeuX,EAAe,eAChDjB,EAAStW,SAAS,qBAAsB,CAAC,oBAAqB,WAAc,OAAO2U,EAAOE,qBAC1FyB,EAAStW,SAAS,oBAAoB,WAAc,OAAO,IAAImQ,KAC/DqG,EAAUxW,SAAS,iBAAkBuX,EAAe,kBACpDf,EAAUxW,SAAS,mBAAoBuX,EAAe,YACtDf,EAAUxW,SAAS,eAAgBuX,EAAe,sBAClDf,EAAUxW,SAAS,SAAU,CAAC,oBAfP,WAAc,OAAO,IAAAe,QAAO4T,EAAOiC,cAAe,CAAEjW,KAAM,WAAc,OAAOgU,EAAOmC,mBAgB7GN,EAAUrW,QAAQ,eAAgB,CAAC,YAAa,SAAUyX,GAAa,OAAOA,EAAUW,QAAQlK,UAChGoI,EAAStW,QAAQ,SAAS,WAAc,OAAOwU,EAAOqC,eACtDP,EAASiB,QAAQ,UAAU,WAAc,OAAO,EAAApP,SAChDmO,EAAS+B,IAAIJ,GACb9B,EAASkC,IAAI,CAAC,qBAAsB,SAAUC,OAC9CjC,EAAUgC,IAAI,CAAC,SAAU,SAAUE,OACnCnC,EAAQiC,IAAI,CAAC,aAAc,SAAUG,OACrCtC,EAASmC,IAAIb,GAEN,IAAIzD,EAAY,SAAU0E,GAO7B,OANaA,EAAIC,YAAYtP,OAAO,EAAAR,UAChB6F,KAAI,SAAU9I,GAC9B,IAAImS,EAAaW,EAAI7K,cAAcjI,GAEnC,MAAO,CAACA,EAAoB,WADX8S,EAAIE,UAAUb,GAAYc,MACJd,EAAWvU,QAAUuU,EAAWrQ,SAE7DiH,OAAO,EAAAmK,WAAY,2JC9GrC,SAASC,EAAeP,GACpB,IAAIQ,EAAW,SAAUxL,EAAOW,EAAQjO,GACpC,OAAOsY,EAAOS,GAAGzL,EAAOW,EAAQjO,IAGpC,OADA8Y,EAASE,WAAY,EACdF,EAaX,SAASG,EAAuBX,GAC5B,IAAIY,EAAiB,SAAU5L,EAAOW,EAAQjO,GAC1C,OAAOsY,EAAOa,SAAS7L,EAAOW,EAAQjO,IAG1C,OADAkZ,EAAeF,WAAY,EACpBE,EAxBXL,EAAe/L,QAAU,CAAC,UAkB1BmM,EAAuBnM,QAAU,CAAC,UAQlC,YAAe,mBAAmB3D,OAAO,UAAW0P,GAAgB1P,OAAO,kBAAmB8P,oKCpB1FG,EAA+B,WAC/B,SAASA,EAAc3C,EAAeC,GAClC7W,KAAK4W,cAAgBA,EACrB5W,KAAK6W,aAAeA,GACpB,IAAArC,uBAAqB,IAAAxQ,KAAIuV,EAAc1X,WAAY7B,MAAM,IAAAgE,KAAIhE,OAgHjE,OArBAuZ,EAAc1X,UAAUiV,UAAY,SAAUtR,EAAMgU,GAChD,OAAOxZ,KAAK4W,cAAcE,UAAUtR,EAAMgU,IAASxZ,MAEvDuZ,EAAc1X,UAAU4L,MAAQ,SAAUjI,EAAMiU,GAQ5C,OAPI,IAAAtG,UAAS3N,GACTiU,EAAajU,EAGbiU,EAAWjU,KAAOA,EAEtBxF,KAAK4W,cAAc8C,SAASD,GACrBzZ,MAOXuZ,EAAc1X,UAAU8X,UAAY,SAAUnZ,GAC1C,OAAOR,KAAK6W,aAAa8C,UAAUnZ,IAEhC+Y,EApHuB,6LCf3B,SAASK,IACZ,IAAIC,EAAkB,KACtB,OAAO,SAAU1R,EAAM2R,GAEnB,OADAD,EAAkBA,GAAmB,EAAA9I,SAAA,cAAuB,oBACrD,CAAC,IAAIgJ,EAAc5R,EAAM2R,EAAMD,KAI9C,IAAIG,EAAY,SAAUxG,EAAMyG,GAAO,OAAOzG,EAAK5E,QAAO,SAAUsL,EAAKrU,GAAO,OAAOqU,IAAO,IAAAtN,WAAUqN,EAAIpU,OAAU,IAY/G,SAASsU,EAAgB1M,GAE5B,IAAKA,EAAM2M,OACP,MAAO,GACX,IAAgKC,EAAW,CAAC,YAAa,WAAY,qBAAsBC,EAA7M,CAAC,mBAAoB,cAAe,WAAY,SAAU,SAAyKlY,OAApJ,CAAC,aAAc,qBAAsB,eAAgB,cAAiHmY,EAAcF,EAASjY,OAAOkY,GAIjS,IAAI,IAAA1N,WAAUa,EAAM+M,QAAUR,EAAUO,EAAa9M,GACjD,MAAM,IAAIgF,MAAM,UAAYhF,EAAMjI,KAAlB,4JAGL+U,EAAYjR,QAAO,SAAUzD,GAAO,OAAO,IAAA+G,WAAUa,EAAM5H,OAAUoN,KAAK,OAEzF,IAAIuH,EAAQ,GAAIC,EAAchN,EAAM+M,OAAS,CAAEE,UAAU,IAAAC,MAAKlN,EAAO8M,IAsBrE,OArBA,IAAAxZ,SAAQ0Z,GAAa,SAAUlP,EAAQ/F,GASnC,GAPAA,EAAOA,GAAQ,YAEX,IAAAsD,UAASyC,KACTA,EAAS,CAAExC,UAAWwC,IAE1BA,GAAS,IAAAzK,QAAO,GAAIyK,GAEhByO,EAAUK,EAAU9O,IAAWyO,EAAUM,EAAa/O,GACtD,MAAM,IAAIkH,MAAM,mBAAqB4H,EAASpH,KAAK,KAAO,UAAYqH,EAAYrH,KAAK,KAAO,mBAAqBzN,EAAO,IAAMiI,EAAMjI,KAAO,KAEjJ+F,EAAO9C,UAAY8C,EAAO9C,WAAa,WACvC8C,EAAOH,MAAQ,MACfG,EAAOxB,SAAW0D,EAClBlC,EAAOqP,MAAQpV,EACf,IAAIqV,EAAa,EAAAC,YAAA,sBAAkCvP,EAAOxB,SAAUwB,EAAOqP,OAC3ErP,EAAOwP,YAAcF,EAAWG,WAChCzP,EAAO0P,qBAAuBJ,EAAWK,oBACzCV,EAAMhV,GAAQ+F,KAEXiP,EAGX,IAAInP,EAAK,EAEL0O,EAA+B,WAC/B,SAASA,EAAc5R,EAAMJ,EAAU7H,GACnC,IAAIiQ,EAAQnQ,KACZA,KAAKmI,KAAOA,EACZnI,KAAK+H,SAAWA,EAChB/H,KAAKE,QAAUA,EACfF,KAAKmb,IAAM9P,IACXrL,KAAKob,QAAS,EACdpb,KAAKgI,YAAc,SAAUvB,EAAQoK,GACjC,OAAOV,EAAMpH,UACPoH,EAAMjQ,QAAQgS,sBAAsBzL,EAAQoK,EAASV,EAAMpH,UAAWoH,EAAMpI,SAASoK,UACrFhC,EAAMc,UAiCpB,OA9BA8I,EAAclY,UAAUwZ,KAAO,WAC3B,IAAIlL,EAAQnQ,KACR+G,EAAK,EAAAgK,SAAA,GACLF,EAAU,IAAI,EAAAzI,eAAepI,KAAKmI,MAClCiG,EAASpO,KAAKmI,KAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,IAAAzN,QAAOoZ,EAAK3L,EAAK+M,eAAiB,IAC1FC,EAAW,CACXtK,SAAUlK,EAAGkJ,KAAKjQ,KAAKE,QAAQ0Q,WAAW5Q,KAAK+H,SAAUqG,EAAQyC,IACjE7P,WAAY+F,EAAGkJ,KAAKjQ,KAAKwb,cAAc3K,KAE3C,OAAO9J,EAAG0U,IAAIF,GAAUxQ,MAAK,SAAU2Q,GAInC,OAHA,EAAArT,MAAA,sBAA4B,SAAU8H,GACtCA,EAAMnP,WAAa0a,EAAQ1a,YAC3B,IAAAF,QAAOqP,EAAOuL,EAAQzK,UACfd,MAQf4J,EAAclY,UAAU2Z,cAAgB,SAAU3K,GAC9C,IAAI9Q,EAAWC,KAAK+H,SAAS4T,mBAC7B,KAAK,IAAAC,cAAa7b,GACd,OAAOC,KAAK+H,SAAS/G,WACzB,IAAI8Q,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAEnBkJ,EA5CuB,wKC9C9B8B,EAAmC,WAEnC,SAASA,EAAiCnH,GACtC1U,KAAK0U,OAASA,EA2KlB,OAzKAmH,EAAkBC,kBAAoB,SAAUpH,EAAQqH,GACpD,OAAO,SAAUC,GAAS,OAAO,EAAAjL,SAAA,iBAA0BgL,EAAS,KAAM,CAAEE,OAAQD,EAAOE,aAAcxH,EAAO4D,QAAQlK,WAG5HyN,EAAkBha,UAAUnB,KAAO,WAC/B,IAAIuW,EAAajX,KAAK0U,OAAOuC,WAI7B,OAHAjX,KAAK0U,OAAOyH,UAAUC,QAAO,GACxBnF,EAAWoF,mBACZpF,EAAWqF,SACRtc,KAAK0U,OAAOyH,WAiCvBN,EAAkBha,UAAU0a,KAAO,SAAUC,GACzC,IAAIrM,EAAQnQ,KACZ,KAAK,IAAAoN,YAAWoP,GACZ,MAAM,IAAI/J,MAAM,6BACpB,IACI8J,EAAO,IAAI,EAAAE,aADH,WAAc,OAAOD,EAAO,EAAAzL,SAAA,UAAoBZ,EAAMuE,OAAO0C,mBACvC,EAAAsF,UAElC,OADA1c,KAAK0U,OAAOuC,WAAW0F,MAAMJ,KAAKA,GAC3Bvc,MA4BX6b,EAAkBha,UAAU+a,UAAY,SAAUL,GAC9C,IAAIpM,EAAQnQ,KACR6c,EAAW7c,KAAK0U,OAAOuC,WAAW0F,MACtC,IAAI,IAAA7T,UAASyT,GACTM,EAASD,UAAUL,OAElB,MAAI,IAAAnP,YAAWmP,GAIhB,MAAM,IAAI9J,MAAM,uCAHhBoK,EAASD,WAAU,WAAc,OAAOL,EAAK,EAAAxL,SAAA,UAAoBZ,EAAMuE,OAAO0C,oBAKlF,OAAOpX,MAwCX6b,EAAkBha,UAAUoO,KAAO,SAAU6M,EAAMf,GAK/C,QAJI,IAAA/J,SAAQ+J,KAAY,IAAA3O,YAAW2O,MAC/BA,EAAUF,EAAkBC,kBAAkB9b,KAAK0U,OAAQqH,IAE/D/b,KAAK0U,OAAOuC,WAAW0F,MAAM1M,KAAK6M,EAAMf,GACjC/b,MAgCX6b,EAAkBha,UAAUkb,eAAiB,SAAU9Q,GACnDjM,KAAK0U,OAAOuC,WAAW8F,eAAe9Q,IAEnC4P,EA9K2B,iJCKtC,UAAe,mBAAmB9b,SAAS,iBApB3C,WACI,IAAIid,GAAkB,EACtBhd,KAAKgd,gBAAkB,WACnBA,GAAkB,GAEtBhd,KAAKU,KAAO,CACR,gBACA,WACA,SAAUuc,EAAezZ,GACrB,OAAIwZ,EACOC,EAEJ,SAAUvV,GACb,OAAOlE,GAAS,WACZkE,EAAS,GAAGwV,mBACb,GAAG,8nBClBlBC,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GAaAK,EAAwB,iBAATlQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC9C,iBAAX,EAAAmQ,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,QAC3D,EACAhe,EAAU+d,EAAK/d,SAAW,GACnBke,EAAWle,EAAQke,UAAYC,KAAK/W,MAAM3D,KAAK0a,MAC/CC,EAASpe,EAAQoe,QAAUD,KAAKE,UAAU5a,KAAK0a,MAC/Cjd,EAAUlB,EAAQkB,SAqc7B,SAAkBkZ,EAAKnP,EAAIqF,GACvB,IAAI,QAAQ8J,GACR,OAAOA,EAAIlZ,QAAQ+J,EAAIqF,GAC3BoD,OAAOC,KAAKyG,GAAKlZ,SAAQ,SAAU8E,GAAO,OAAOiF,EAAGmP,EAAIpU,GAAMA,OAvcvD/E,EAASyS,OAAO3Q,QAycpB,SAAiBub,GACpB,IAAK,IAAId,EAAI,EAAGA,EAAIrb,UAAUoN,OAAQiO,IAAK,CACvC,IAAIpD,EAAMjY,UAAUqb,GACpB,GAAKpD,EAGL,IADA,IAAIzG,EAAOD,OAAOC,KAAKyG,GACdyD,EAAI,EAAGA,EAAIlK,EAAKpE,OAAQsO,IAC7BS,EAAM3K,EAAKkK,IAAMzD,EAAIzG,EAAKkK,IAGlC,OAAOS,GAldAhP,EAAStP,EAAQsP,QAod5B,SAASiP,EAAQC,EAAIC,GACjB,GAAID,IAAOC,EACP,OAAO,EACX,GAAW,OAAPD,GAAsB,OAAPC,EACf,OAAO,EACX,GAAID,GAAOA,GAAMC,GAAOA,EACpB,OAAO,EACX,IAAIC,SAAYF,EAChB,GAAIE,WAD4BD,GACR,WAAPC,EACb,OAAO,EACX,IAyBeC,EAAIC,EAzBfC,EAAM,CAACL,EAAIC,GACf,IAAI,QAAI,KAAJ,CAAaI,GACb,OAuBeD,EAvBMH,GAuBVE,EAvBMH,GAwBdjP,SAAWqP,EAAGrP,QAEduP,EAAYH,EAAIC,GAAI7P,QAAO,SAAUgQ,EAAGC,GAAK,OAAOD,GAAKR,EAAQS,EAAE,GAAIA,EAAE,OAAQ,GAzBxF,IAAI,QAAI,KAAJ,CAAYH,GACZ,OAAOL,EAAGS,YAAcR,EAAGQ,UAC/B,IAAI,QAAI,KAAJ,CAAcJ,GACd,OAAOL,EAAGvJ,aAAewJ,EAAGxJ,WAChC,IAAI,QAAI,KAAJ,CAAgB4J,GAChB,OAAO,EAEX,GADiB,CAAC,KAAY,KAAS,KAAQ,MAChC/P,IAAI,MAAKC,QAAO,SAAUgQ,EAAGje,GAAM,OAAOie,KAAOje,EAAG+d,MAAS,GACxE,OAAO,EACX,IAAIlL,EAAO,GAEX,IAAK,IAAI3N,KAAOwY,EAAI,CAChB,IAAKD,EAAQC,EAAGxY,GAAMyY,EAAGzY,IACrB,OAAO,EACX2N,EAAK3N,IAAO,EAEhB,IAAK,IAAIA,KAAOyY,EACZ,IAAK9K,EAAK3N,GACN,OAAO,EAEf,OAAO,GApfJ,SAAS6W,EAASpN,GACrB,OAAOA,EAEJ,SAASrH,KAyDT,SAASuM,EAAqBuK,EAAQ1Y,EAAQ/C,EAAM0b,EAASC,QAC/C,IAAbA,IAAuBA,GAAW,GACtC,IAAIC,EAAe,SAAUC,GAAU,OAAOJ,IAASI,GAAQ7b,KAAKA,MAQpE,OADA0b,EAAUA,GAAWzL,OAAOC,KAAKuL,MAClBnQ,QAAO,SAAUsL,EAAK1U,GAPd,IAAU2Z,EAS7B,OADAjF,EAAI1U,GAAQyZ,GARiBE,EAQW3Z,EAPjC,WAEH,OADAa,EAAO8Y,GAAUD,EAAaC,GACvB9Y,EAAO8Y,GAAQhd,MAAM,KAAMH,aAKUkd,EAAa1Z,GACtD0U,IACR7T,GAMA,IAAI+Y,EAAU,SAAUhF,EAAQiF,GAAS,OAAOve,EAAOyS,OAAO/R,OAAO4Y,GAASiF,IAE1EC,GAAU,SACd,SAAkBC,EAAOtF,GAC5B,OAA+B,IAAxBsF,EAAMrR,QAAQ+L,MAMd7E,GAAa,SACjB,SAAqBmK,EAAOtF,GAC/B,IAAIhL,EAAMsQ,EAAMrR,QAAQ+L,GAGxB,OAFIhL,GAAO,GACPsQ,EAAMC,OAAOvQ,EAAK,GACfsQ,KAGAE,GAAS,SACb,SAAiBC,EAAK1b,GACzB,OAAO0b,EAAIjf,KAAKuD,GAAMA,KAGf2b,EAAW,SAAUC,GAC5B,OAAOA,EAAU9d,QAAQf,SAAQ,SAAUJ,GACzB,mBAAPA,GAAqBA,IAC5ByU,EAAWwK,EAAWjf,OAQvB,SAASV,EAASW,GAErB,IADA,IAAIif,EAAe,GACVC,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCD,EAAaC,EAAK,GAAK9d,UAAU8d,GAErC,IAAIC,EAAcjf,EAAOqB,WAAM,EAAQgb,EAAe,CAAC,IAAK0C,EAAaG,YACzE,OAAOlf,EAAOif,EAAapF,EAAK/Z,GAAQ,GAAI2S,OAAOC,KAAKuM,KAGrD,IAAIE,EAAS,SAAUC,EAAMC,GAAQ,OAAOrf,EAAOof,EAAMC,IAQzD,SAASC,EAAUC,EAAOC,GAC7B,IAAInY,EAAO,GAEX,IAAK,IAAIoY,KAAKF,EAAMlY,KAAM,CACtB,GAAIkY,EAAMlY,KAAKoY,KAAOD,EAAOnY,KAAKoY,GAC9B,MACJpY,EAAK1H,KAAK4f,EAAMlY,KAAKoY,IAEzB,OAAOpY,EAaJ,SAASwS,EAAKV,EAAKuG,GACtB,IAAIC,EAAU,GACd,IAAK,IAAIC,KAASzG,GACoB,IAA9BuG,EAAUtS,QAAQwS,KAClBD,EAAQC,GAASzG,EAAIyG,IAG7B,OAAOD,EAcJ,SAASE,EAAK1G,EAAKuG,GACtB,OAAOjN,OAAOC,KAAKyG,GACd3Q,QAAO,QAAIgW,EAAQkB,KACnB5R,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,GAAOoU,EAAIpU,GAAOqU,IAAS,IASvE,SAAS5Q,EAAOsX,EAAYpgB,GAC/B,IAAIkf,GAAM,QAAQkB,GAAata,EAASoZ,EAAM,GAAK,GAC/CmB,EAASnB,EAAM,SAAUpQ,GAAK,OAAOhJ,EAAO7F,KAAK6O,IAAQ,SAAUA,EAAGzJ,GAAO,OAAQS,EAAOT,GAAOyJ,GAKvG,OAJAvO,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B7c,EAAS2f,EAAM9C,IACfwD,EAAOV,EAAM9C,MAEd/W,EAGJ,SAASwa,EAAKF,EAAYpgB,GAC7B,IAAI8F,EAOJ,OANAvF,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B/W,GAEA9F,EAAS2f,EAAM9C,KACf/W,EAAS6Z,MAEV7Z,EAGJ,IAAIya,EAASpS,EAEb,SAASA,EAAIiS,EAAYpgB,EAAU6F,GAGtC,OAFAA,EAASA,KAAW,QAAQua,GAAc,GAAK,IAC/C7f,EAAQ6f,GAAY,SAAUT,EAAM9C,GAAK,OAAQhX,EAAOgX,GAAK7c,EAAS2f,EAAM9C,MACrEhX,EAYJ,IAAI2a,EAAS,SAAU/G,GAAO,OAAO1G,OAAOC,KAAKyG,GAAKtL,KAAI,SAAU9I,GAAO,OAAOoU,EAAIpU,OAclFob,EAAW,SAAUf,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAclDC,EAAW,SAAUjB,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAUlDrS,EAAU,SAAUqR,EAAMgB,GAAQ,OAAOhB,EAAK9d,OAAO8e,IAWrDE,EAAW,SAAUlB,EAAMgB,GAClC,OAAO,QAAQA,GAAQhB,EAAK9d,OAAO8e,EAAKtS,OAAOwS,EAAU,KAAOC,EAAMnB,EAAMgB,IAMzE,SAASG,EAAM3B,EAAKzF,GAEvB,OADAyF,EAAIjf,KAAKwZ,GACFyF,EAGJ,IAAI4B,EAAQ,SAAUpH,EAAKqH,GAAS,OAAQjC,EAAQpF,EAAKqH,GAASrH,EAAMmH,EAAMnH,EAAKqH,IAW/EC,EAAS,SAAU9B,GAAO,OAAOA,EAAI9Q,OAAOC,EAAS,KAyBrD4S,EAkBJ,SAAkBC,EAAgBC,GAErC,YADe,IAAXA,IAAqBA,EAAS,kBAC3B,SAAU1H,GACb,IAAI3T,EAASob,EAAezH,GAC5B,IAAK3T,EACD,MAAM,IAAImM,OAAM,QAAWkP,GAAUA,EAAO1H,GAAO0H,GAEvD,OAAOrb,IA2BR,SAASqY,IAEZ,IADA,IAAIhd,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,GAAoB,IAAhBne,EAAKyN,OACL,MAAO,GAwBX,IAvBA,IAAIwS,EAAcjgB,EAAKiN,QAAO,SAAUiT,EAAKnC,GAAO,OAAOoC,KAAKD,IAAInC,EAAItQ,OAAQyS,KAAS,kBACrFvb,EAAS,GACTyb,EAAU,SAAU1E,GAGpB,OAAQ1b,EAAKyN,QACT,KAAK,EACD9I,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,KACrB,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACjC,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KAC7C,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACzD,MACJ,QACI/W,EAAO7F,KAAKkB,EAAKgN,KAAI,SAAU4Q,GAAS,OAAOA,EAAMlC,SAIxDA,EAAI,EAAGA,EAAIuE,EAAavE,IAC7B0E,EAAQ1E,GAEZ,OAAO/W,EAsBJ,SAASyS,EAAWmH,EAAM8B,GAC7B,IAAInc,EAAKrB,EAGT,IAFI,QAAQwd,KACRnc,EAAMmc,EAAY,GAAIxd,EAAQwd,EAAY,MACzC,QAASnc,GACV,MAAM,IAAI4M,MAAM,oCAEpB,OADAyN,EAAKra,GAAOrB,EACL0b,EAGJ,SAAS1S,EAAKkS,GACjB,OAAQA,EAAItQ,QAAUsQ,EAAIA,EAAItQ,OAAS,SAAO+E,EAK3C,SAAS8N,EAAKC,EAAKC,GAKtB,OAJIA,GACA5O,OAAOC,KAAK2O,GAAMphB,SAAQ,SAAU8E,GAAO,cAAcsc,EAAKtc,MAC7Dsc,IACDA,EAAO,IACJrhB,EAAOqhB,EAAMD,GA6DjB,IAAIE,EAA2B,SAAU3e,GAAW,OAAOA,EAAQ4e,OAAM,SAAUC,GAAK,OAAO,MAAS7e,GACpG8e,EAAkB,SAAUld,GAAS,OAAO+c,EAAyB,cAAmB/c,qHCxhBnG,IAGWmd,EAAW,SAAU/K,EAASgL,GACrC,OAAOA,EAAQ7T,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,IAJtC6c,EAIoDjL,EAAU,IAAM5R,EAAM,KAJzD,WACpC,MAAM,IAAI4M,MAAM,yBAA2BiQ,EAAS,kEAGiDxI,EAJ5F,IAAUwI,IAI2F,KAE9G3R,EAAW,CACXhK,QAAIoN,EACJ5D,eAAW4D,mGCyCf,IAAIwO,EAAsB,WACtB,SAASA,EAAKC,GACV5iB,KAAK4iB,KAAOA,EACZ5iB,KAAK6iB,KAAOD,EAAKE,MAAM,KACvB,IAAIC,EAAe/iB,KAAK4iB,KACnBE,MAAM,KACNnU,KAAI,SAAUqU,GACf,MAAY,OAARA,EACO,qBACC,MAARA,EACO,WACJ,MAAQA,KAEd/P,KAAK,IACVjT,KAAKijB,OAAS,IAAI9Z,OAAO,IAAM4Z,EAAe,KAalD,OAVAJ,EAAKzJ,GAAK,SAAU0J,GAChB,QAAS,SAASnZ,KAAKmZ,IAG3BD,EAAKxR,WAAa,SAAUyR,GACxB,OAAOD,EAAKzJ,GAAG0J,GAAQ,IAAID,EAAKC,GAAQ,MAE5CD,EAAK9gB,UAAUqhB,QAAU,SAAU1d,GAC/B,OAAOxF,KAAKijB,OAAOE,KAAK,IAAM3d,IAE3Bmd,EA3Bc,+MC1CzB,IAAIxF,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GA2CJ,SAAS6F,EAAMziB,GAClB,OAAO,SAAS0iB,IACZ,GAAIrhB,UAAUoN,QAAUzO,EAAGyO,OACvB,OAAOzO,EAAGwB,MAAMnC,KAAMgC,WAE1B,IAAIL,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtC,OAAOqhB,EAAQ/f,KAAKnB,MAAMkhB,EAASlG,EAAe,CAACnd,MAAO2B,KAS3D,SAAS2hB,IACZ,IAAI3hB,EAAOK,UACPuhB,EAAQ5hB,EAAKyN,OAAS,EAC1B,OAAO,WAEH,IADA,IAAIiO,EAAIkG,EAAOjd,EAAS3E,EAAK4hB,GAAOphB,MAAMnC,KAAMgC,WACzCqb,KACH/W,EAAS3E,EAAK0b,GAAGtb,KAAK/B,KAAMsG,GAChC,OAAOA,GASR,SAASkd,IAEZ,IADA,IAAIC,EAAQ,GACH3D,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpC2D,EAAM3D,GAAM9d,UAAU8d,GAE1B,OAAOwD,EAAQnhB,MAAM,KAAM,GAAGL,MAAMC,KAAKC,WAAWge,WAQjD,IAAI0D,EAAO,SAAUle,GAAQ,OAAO,SAAUyU,GAAO,OAAOA,GAAOA,EAAIzU,KAQnEme,EAASP,GAAM,SAAU5d,EAAMoe,EAAM3J,GAAO,OAAOA,GAAOA,EAAIzU,KAAUoe,KASxE3c,EAAQ,SAAUzB,GAAQ,OAAOge,EAAKrhB,MAAM,KAAMqD,EAAKsd,MAAM,KAAKnU,IAAI+U,KAKtEG,EAAM,SAAUljB,GAAM,OAAO,WAEpC,IADA,IAAIgB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAQnf,EAAGwB,MAAM,KAAMR,KAMpB,SAASmiB,EAAIC,EAAKC,GACrB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IAOjD,SAASsiB,EAAGF,EAAKC,GACpB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IASjD,IAAI8Z,EAAM,SAAUsI,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4U,EAAM,SAAUH,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4J,EAAK,SAAUiL,GAAQ,OAAO,SAAUlK,GAC/C,OAAe,MAAPA,GAAeA,EAAImK,cAAgBD,GAASlK,aAAekK,IAK5DngB,EAAM,SAAUqgB,GAAK,OAAO,WAAc,OAAOA,IA4CrD,SAASC,EAAQC,GACpB,OAAO,SAAUjV,GACb,IAAK,IAAI+N,EAAI,EAAGA,EAAIkH,EAAOnV,OAAQiO,IAC/B,GAAIkH,EAAOlH,GAAG,GAAG/N,GACb,OAAOiV,EAAOlH,GAAG,GAAG/N,uRCjNhCkV,EAAQjR,OAAO1R,UAAUiT,SACzB2P,EAAM,SAAU5F,GAAK,OAAO,SAAUvP,GAAK,cAAcA,IAAMuP,IACxD6F,EAAcD,EAAI,aAClB7X,GAAY,QAAI8X,GAChBC,EAAS,SAAUC,GAAK,OAAa,OAANA,GAC/BC,GAAoB,IAAAZ,IAAGU,EAAQD,GAC/BtX,EAAaqX,EAAI,YACjBK,EAAWL,EAAI,UACf3b,EAAW2b,EAAI,UACftR,EAAW,SAAU7D,GAAK,OAAa,OAANA,GAA2B,iBAANA,GACtD0C,EAAUpQ,MAAMoQ,QAChB+S,EAAS,SAAWzV,GAAK,MAAyB,kBAAlBkV,EAAMziB,KAAKuN,IAC3C0V,EAAW,SAAW1V,GAAK,MAAyB,oBAAlBkV,EAAMziB,KAAKuN,IAOjD,SAASsM,EAAa5X,GACzB,GAAIgO,EAAQhO,IAAQA,EAAIoL,OAAQ,CAC5B,IAAI6V,EAAOjhB,EAAIlC,MAAM,GAAI,GAAI0L,EAAOxJ,EAAIlC,OAAO,GAC/C,QAASmjB,EAAK3b,QAAO,QAAIR,IAAWsG,QAAU5B,EAAKlE,QAAO,QAAI8D,IAAagC,QAE/E,OAAOhC,EAAWpJ,GAOf,IAAIkhB,GAAY,QAAI/R,GAAU,SAAK,QAAK,QAAS/F,uKCvCpD+X,EAAuB,WACvB,SAASA,EAAMC,EAAQC,QACJ,IAAXD,IAAqBA,EAAS,SACnB,IAAXC,IAAqBA,EAAS,MAClCrlB,KAAKolB,OAASA,EACdplB,KAAKqlB,OAASA,EACdrlB,KAAKslB,gBAAkB,GACvBtlB,KAAKulB,SAAU,QAAOvlB,KAAKslB,iBAqC/B,OAnCAH,EAAMtjB,UAAU2jB,QAAU,SAAUrF,GAChC,IAAIsF,EAAQzlB,KAAKolB,OAIjB,OAHAK,EAAMhlB,KAAK0f,GACPngB,KAAKqlB,QAAUI,EAAMrW,OAASpP,KAAKqlB,QACnCrlB,KAAK0lB,QACFvF,GAEXgF,EAAMtjB,UAAU6jB,MAAQ,WACpB,IAAIvF,EAAOngB,KAAKolB,OAAOnjB,QAEvB,OADAjC,KAAKslB,gBAAgBvkB,SAAQ,SAAUJ,GAAM,OAAOA,EAAGwf,MAChDA,GAEXgF,EAAMtjB,UAAU8jB,QAAU,WACtB,GAAI3lB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO5F,OAAO,EAAG,GAAG,IAExC2F,EAAMtjB,UAAUgkB,MAAQ,WACpB,IAAIC,EAAU9lB,KAAKolB,OAEnB,OADAplB,KAAKolB,OAAS,GACPU,GAEXX,EAAMtjB,UAAU+jB,KAAO,WACnB,OAAO5lB,KAAKolB,OAAOhW,QAEvB+V,EAAMtjB,UAAUgL,OAAS,SAAUsT,GAC/B,IAAIlR,EAAMjP,KAAKolB,OAAOlX,QAAQiS,GAC9B,OAAOlR,GAAO,GAAKjP,KAAKolB,OAAO5F,OAAOvQ,EAAK,GAAG,IAElDkW,EAAMtjB,UAAUkkB,SAAW,WACvB,OAAO/lB,KAAKolB,OAAOplB,KAAKolB,OAAOhW,OAAS,IAE5C+V,EAAMtjB,UAAUmkB,SAAW,WACvB,GAAIhmB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO,IAEpBD,EA5Ce,4KCKtBc,EAAkB,CAAEC,IAAK,KAAM7gB,MAAO,KAAM8gB,MAAO,MA4B5CC,EAXyB,oBAAbC,UAA4BA,SAASC,cAA0C,IAA1BD,SAASC,aAEtEC,QAAUA,OAAOC,QAlBhC,SAAoBA,GAChB,IAAIC,EAAQ,SAAU9lB,GAAM,OAAO+lB,SAAS7kB,UAAUyB,KAAKvB,KAAKpB,EAAI6lB,IACpE,MAAO,CACHN,IAAKO,EAAMD,EAAQN,KACnB7gB,MAAOohB,EAAMD,EAAQN,KACrBC,MAAOM,EAAMD,EAAQN,MAaaS,CAAWJ,OAAOC,SAAWP,EAEzDO,QAAQL,OAAUK,QAAQnhB,MAIzBmhB,QAhBf,SAAyBA,GACrB,IAAIN,EAAMM,EAAQN,IAAI5iB,KAAKkjB,GAG3B,MAAO,CAAEN,IAAKA,EAAK7gB,MAFPmhB,EAAQnhB,MAAQmhB,EAAQnhB,MAAM/B,KAAKkjB,GAAWN,EAEzBC,MADrBK,EAAQL,MAAQK,EAAQL,MAAM7iB,KAAKkjB,GAAWN,GAU/CU,CAAgBJ,ieCRxB,SAASK,EAAUC,EAAK9V,GAC3B,OAAIA,EAAI5B,QAAU0X,EACP9V,EACJA,EAAI+V,OAAO,EAAGD,EAAM,GAAK,MAW7B,SAASE,EAAU5X,EAAQ4B,GAC9B,KAAOA,EAAI5B,OAASA,GAChB4B,GAAO,IACX,OAAOA,EAEJ,SAAS/H,EAAYqJ,GACxB,OAAOA,EACFyC,QAAQ,YAAY,SAAUkS,GAAM,OAAOA,EAAGC,iBAC9CnS,QAAQ,YAAY,SAAUkS,GAAM,MAAO,IAAMA,EAAGC,iBAEtD,SAASC,EAAiBxmB,GAC7B,IAAIymB,EAAQC,EAAW1mB,GACnB2mB,EAAqBF,EAAMpL,MAAM,8BACjCwI,EAAQ8C,EAAqBA,EAAmB,GAAKF,EACrDjI,EAASxe,EAAS,MAAK,GAC3B,OAAIwe,GAAUqF,EAAMxI,MAAM,eACf,YAAcmD,EAASqF,EAAMuC,OAAO,GAExCvC,EAEJ,SAAS6C,EAAW1mB,GACvB,IAAI4mB,GAAM,QAAQ5mB,GAAMA,EAAGmB,OAAO,GAAG,GAAKnB,EAC1C,OAAQ4mB,GAAOA,EAAIzS,YAAe,YAEtC,IAAI0S,EAAc,uBAIdC,GAAmB,QAAQ,CAC3B,CAAC,MAAa,QAAI,cAClB,CAAC,MAAQ,QAAI,SACb,CAAC,MAAW,QAAI,cAChB,CAACD,EAAa,SAAUlY,GAAK,OAAOA,EAAEoY,qBAAqB5S,aAC3D,CARc,SAAUmF,GACxB,OAAO,QAASA,MAAS,QAAQA,IAAQA,EAAImK,cAAgB7Q,SAAU,QAAW0G,EAAInF,WAOxE,SAAUxF,GAAK,OAAOA,EAAEwF,aACtC,CAAC,KAAcqS,GACf,EAAC,SAAI,GAAO,QAET,SAASjJ,EAAU0G,GACtB,IAAI+C,EAAO,GACX,SAASC,EAAOpjB,GACZ,IAAI,QAASA,GAAQ,CACjB,IAA6B,IAAzBmjB,EAAKzZ,QAAQ1J,GACb,MAAO,iBACXmjB,EAAKlnB,KAAK+D,GAEd,OAAOijB,EAAiBjjB,GAE5B,OAAI,QAAYogB,GAILgD,EAAOhD,GAEX5G,KAAKE,UAAU0G,GAAG,SAAU/e,EAAKrB,GAAS,OAAOojB,EAAOpjB,MAAWuQ,QAAQ,OAAQ,KAGvF,IAAI8S,EAAoB,SAAUC,GAAQ,OAAO,SAAU9W,GAC9D,IAAKA,EACD,MAAO,CAAC,GAAI,IAChB,IAAI/B,EAAM+B,EAAI9C,QAAQ4Z,GACtB,OAAa,IAAT7Y,EACO,CAAC+B,EAAK,IACV,CAACA,EAAI+V,OAAO,EAAG9X,GAAM+B,EAAI+V,OAAO9X,EAAM,MAGtC8Y,EAAuB,SAAU/W,GAAO,OAAOA,EAAI+D,QAAQ,WAAY,KACvEiT,EAAYH,EAAkB,KAC9BI,EAAaJ,EAAkB,KAC/BK,EAAaL,EAAkB,KAC/BM,EAAc,SAAUnX,GAAO,OAAQA,EAAMA,EAAI+D,QAAQ,KAAM,IAAM,IAWzE,SAASqT,EAAaC,GACzB,IAAIC,EAAK,IAAInf,OAAO,IAAMkf,EAAQ,IAAK,KACvC,OAAO,SAAUrX,GAAO,OAAOA,EAAI8R,MAAMwF,GAAIhf,OAAO,OAcjD,SAASif,EAAerO,EAAK5K,GAChC,OAAI,SAAS,QAAK4K,MAAS,QAAS5K,GACzB4K,EAAIpY,MAAM,GAAI,GAAGM,QAAO,QAAK8X,GAAO5K,IACxC,QAAM4K,EAAK5K,0GCpElBkZ,iQA3BJ,SAASC,EAAaC,GAClB,IAAKA,EACD,MAAO,oBACX,IAAIjb,EAAQib,EAAOC,gBAAkBD,EAAOC,gBAAgBnjB,MAAQ,SAAW,SAC/E,MAAO,YAAckjB,EAAOrd,GAAK,IAAMqd,EAAOtd,MAAQ,IAAMsd,EAAOpd,IAAM,KAAOod,EAAOljB,KAAO,IAAMiI,EAAQ,KAOhH,SAASmb,EAAchW,GACnB,OAAO,QAASA,GAAS4V,EAAS5V,GAAS4V,EAASA,EAAS5V,KAgBjE,SAAW4V,GACPA,EAASA,EAAkB,QAAI,GAAK,UACpCA,EAASA,EAAqB,WAAI,GAAK,aACvCA,EAASA,EAAe,KAAI,GAAK,OACjCA,EAASA,EAAiB,OAAI,GAAK,SACnCA,EAASA,EAAqB,WAAI,GAAK,aAL3C,CAMGA,IAAaA,EAAW,KAE3B,IAAIK,GAAO,QAAM,OACbC,GAAO,QAAM,cACbC,EAAW,SAAUnZ,GAAS,MAAO,eAAiBiZ,EAAKjZ,GAAS,IAAMkZ,EAAKlZ,IA6J/EvH,EAAQ,IAzJe,WAEvB,SAAS2gB,IAELhpB,KAAKipB,SAAW,GAChBjpB,KAAKkpB,mBAAqB,EAwI9B,OArIAF,EAAMnnB,UAAUsnB,KAAO,SAAU7T,EAAS8T,GACtC,IAAIjZ,EAAQnQ,KACPopB,EAAWha,SACZga,EAAa7V,OAAOC,KAAKgV,GACpB7Z,KAAI,SAAU6O,GAAK,OAAO6L,SAAS7L,EAAG,OACtClU,QAAO,SAAUkU,GAAK,OAAQ8L,MAAM9L,MACpC7O,KAAI,SAAU9I,GAAO,OAAO2iB,EAAS3iB,OAE9CujB,EAAWza,IAAIia,GAAe7nB,SAAQ,SAAUwoB,GAAY,OAAQpZ,EAAM8Y,SAASM,GAAYjU,MAEnG0T,EAAMnnB,UAAU2nB,OAAS,WAErB,IADA,IAAIJ,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAMC,IAEpBJ,EAAMnnB,UAAU4nB,QAAU,WAEtB,IADA,IAAIL,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAOC,IAWrBJ,EAAMnnB,UAAUyT,QAAU,SAAUiU,GAChC,QAASvpB,KAAKipB,SAASL,EAAcW,KAGzCP,EAAMnnB,UAAU6nB,qBAAuB,SAAU9Z,GACxC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAU+nB,uBAAyB,SAAUha,GAC1C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAUgoB,oBAAsB,SAAUC,EAAMla,EAAOzP,GACzD,GAAKH,KAAKsV,QAAQkT,EAASuB,MAA3B,CAEA,IAAIxpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAiBskB,EAAKE,eAAexpB,UAC1N,QAAgBuoB,EAASnZ,GAAS,eAAiBrP,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,MAG9GwjB,EAAMnnB,UAAUooB,gBAAkB,SAAUC,EAAYta,EAAOua,GACtDnqB,KAAKsV,QAAQkT,EAASuB,OAE3B,QAAgBhB,EAASnZ,GAAS,0BAA2B,QAAU,KAAK,QAAUsa,MAG1FlB,EAAMnnB,UAAUuoB,iBAAmB,SAAUjiB,EAAM8H,EAAML,GAChD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,uBAAyBzH,EAAO,KAAO8H,EAAO,MAGpF+Y,EAAMnnB,UAAUyoB,wBAA0B,SAAUtS,EAAYpI,GACvD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,gCAAkCoI,EAAa,SAAU,QAAU,KAAK,QAAUA,EAAWrQ,SAGnIqhB,EAAMnnB,UAAU0oB,WAAa,SAAUC,EAAQ5a,GACtC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,aAAe4a,IAG3FxB,EAAMnnB,UAAU4oB,aAAe,SAAUC,EAAY9a,GAC5C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,kBAAoB8a,EAAWllB,OAG3GwjB,EAAMnnB,UAAU8oB,iBAAmB,SAAUpqB,EAAOqqB,EAAUvL,QAC5C,IAAVA,IAAoBA,EAAQ,IAC3Brf,KAAKsV,QAAQkT,EAASqC,SAE3B,QAAgB,aAAc,QAAU,GAAItqB,GAAS,IAAMkoB,EAAamC,GAAYvL,IAGxF2J,EAAMnnB,UAAUipB,yBAA2B,SAAUF,EAAU/Z,GACtD7Q,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,WAAYC,EAAU,kCAAoC/Z,EAAU,MAG9FmY,EAAMnnB,UAAUkpB,gBAAkB,SAAUH,EAAUpjB,GAC7CxH,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,OAAQC,EAAU,WAAY,QAAU,IAAKpjB,KAGvEwhB,EAAMnnB,UAAUmpB,cAAgB,SAAUC,GACtC,GAAKjrB,KAAKsV,QAAQkT,EAAS0C,YAA3B,CAEA,IAAIC,EAAY,uBAEZC,EAAUH,EACTtc,KAAI,SAAU0c,GACf,IAAIC,EACA7kB,EAAS4kB,EAAG5kB,OAAQiE,EAAa2gB,EAAG3gB,WACpC6gB,EAAM9kB,GAAUA,EAAO6E,IACvBzD,EAAM6C,GAAcA,EAAW3C,SAASgC,SAASvE,KAAO,MAAQkF,EAAW3C,SAAS6S,MAAQ,IAChG,OAAO0Q,EAAK,IAAOH,GAAaI,EAAKD,EAPzB,iCAOyCzjB,EAAKyjB,KAEzDE,MAAK,SAAU/N,EAAGmB,GAAK,OAAQnB,EAAE0N,IAAc,IAAIM,cAAc7M,EAAEuM,IAAc,OACtF,UAAkBC,KAGtBpC,EAAMnnB,UAAU6pB,sBAAwB,SAAUnrB,EAAOmK,GAChD1K,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAzK1B,SAAUmK,GAC7B,IAAIoP,EAAOpP,EAAW3C,SAClB0F,EAAQqM,EAAK/P,SAASvE,MAAQ,SAClC,MAAO,SAAWkF,EAAWyQ,IAAM,UAAY1N,EAAQ,8BAAgCqM,EAAKiB,YAAc,IAAMjB,EAAKmB,qBAAuB,IAsKzF0Q,CAAiBjhB,KAGpEse,EAAMnnB,UAAU+pB,4BAA8B,SAAUrrB,EAAOqqB,GACtD5qB,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAAMkoB,EAAamC,KAEzD5B,EA7Ie,oOCxEtB6C,EAAiC,WACjC,SAASA,IAML7rB,KAAKoO,OAAS,IAAI,IAElBpO,KAAK8rB,yBAA2B,EAEhC9rB,KAAK+rB,kBAAoB,IAAI,IAAM,GAAI,GAEvC/rB,KAAKgsB,sBAAwB,IAAI,IAAM,GAAI,GAO/C,OALAH,EAAgBhqB,UAAUqT,QAAU,WAChClV,KAAK+rB,kBAAkBlG,QACvB7lB,KAAKgsB,sBAAsBnG,QAC3B7lB,KAAKisB,WAAa,MAEfJ,EApByB,sLCiBhCK,EAAe,SAAUD,GACzB,IAAIvX,EAASuX,EAAWvX,OAuBpB6G,EAAW0Q,EACVE,WACA7iB,QAAO,SAAUmE,GAAS,QAASA,EAAMuG,UAAUoY,YACnDzd,KAAI,SAAUlB,GAAS,OAAO4e,EAAcJ,EAAYxe,MAC7D,OAAO,WAAgB8N,GAAUxQ,MA1BjC,WACI,GAAyD,QAArDkhB,EAAWK,qBAAqBnsB,UAAU4e,OAAkB,CAG5D,IAAIwN,EAAON,EAAWO,cACtB,OAAO9X,EAAOmC,aAAaxQ,OAAOkmB,EAAKE,aAAcF,EAAKne,SAAUme,EAAKpsB,WAI7E,IAAIusB,EAAOhY,EAAOuC,WACd3Q,EAASomB,EAAK1Q,MAAM0Q,EAAKC,SACzBpQ,EAAOjW,GAAUA,EAAOiW,KAG5B,GAAIA,GAAsB,UAAdA,EAAKrN,KAAkB,CAC/B,IAAIzB,EAAQ8O,EAAK9O,MACbW,EAAS9H,EAAO0V,MACpB,OAAOtH,EAAOmC,aAAaxQ,OAAOoH,EAAOW,EAAQ6d,EAAW9rB,WAGhEuU,EAAOuC,WAAW2V,WAQfC,EAAuB,SAAUC,GACxC,OAAOA,EAAkB/c,SAAS,CAAEoc,SAAU,SAAU1e,GAAS,QAASA,EAAM2e,WAAeF,IAS5F,SAASG,EAAcJ,EAAYxe,GACtC,IAAIsf,EAAatf,EAAMuG,UAAUoY,SAE7B3oB,EAAUspB,EAAqB,SAwBnC,OAvBKtpB,IAWDA,EAAUspB,EAAqB,SAAI,YACzBA,EAAWd,EAAYxe,IAC5B1C,MAIT,SAA6BzE,GAIzB,OAHIA,GAAU1E,MAAMoQ,QAAQ1L,EAAO0mB,SAC/B1mB,EAAO0mB,OAAOjsB,SAAQ,SAAUksB,GAAU,OAAOhB,EAAWvX,OAAOkC,cAAc8C,SAASuT,MAEvF3mB,KAPFyE,MAbS,SAAUzE,GAIpB,cAHOmH,EAAM2e,gBACN3e,EAAMuG,UAAUoY,gBAChBW,EAAqB,SACrBzmB,KAEC,SAAU4mB,GAElB,cADOH,EAAqB,SACrB,cAAmBG,OAc3BzpB,oPCnFP0pB,kUAJAC,EAAS7Z,OAAO1R,UAAUa,gBAK9B,SAAWyqB,GACPA,EAAQA,EAAc,KAAI,GAAK,OAC/BA,EAAQA,EAAgB,OAAI,GAAK,SACjCA,EAAQA,EAAgB,OAAI,GAAK,SAHrC,CAIGA,IAAYA,EAAU,KA2DzB,IAAIE,EAAuB,WACvB,SAASA,EAAMhiB,EAAI6D,EAAM2G,EAAUyX,EAAW7f,GAC1C,IAAIlC,EA3DZ,SAA6BgiB,EAAW1X,EAAUpI,GAC9C,IAAI+f,GAA6C,IAAzB/f,EAAMggB,gBAA4B5X,IAAasX,EAAQO,aAAWvZ,EACtFwZ,GAAU,QAAK,CAAClgB,EAAMkgB,QAASH,GAAmB,MAClDI,GAAgB,QAAUD,GAAW,CAAEA,QAASA,GAAY,GAC5DE,EAGR,SAAyBhmB,GAGrB,SAASimB,IACL,OAAOjmB,EAAIrD,MAHfqD,EAlBc,SAAUA,GACxB,OAAiG,IAA1F,CAAC,QAAS,OAAQ,SAAU,QAAS,WAAWyB,OAAO8jB,EAAO9pB,KAAKuE,GAAO,KAAKuH,OAiBhF2e,CAAYlmB,GAAO,CAAErD,MAAOqD,GAAQA,EAC1CimB,EAAmC,aAAI,EAIvC,IAAIE,GAAO,QAAanmB,EAAIrD,OAASqD,EAAIrD,MAAQspB,EACjD,OAAO,QAAOjmB,EAAK,CAAEmmB,KAAMA,IAVTC,CAAgBxgB,GAASA,EAAMW,QAAUX,EAAMW,OAAOmf,IACxE,OAAO,QAAOK,EAAeC,GAsDZK,CAAoB7iB,EAAIwK,EAAUpI,GAC/CyB,EA5CR,SAAiBrH,EAAKsmB,EAAStY,EAAUxK,EAAI+iB,GACzC,GAAIvmB,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,KAC/B,MAAM,IAAIiN,MAAM,UAAYpH,EAAK,kCACrC,GAAIxD,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,MAAqB4oB,EAAWlf,KAAKrH,EAAIqH,MACxE,OAAOkf,EAAWlf,KAAKrH,EAAIqH,MAC/B,GAAIif,EACA,OAAOA,EACX,IAAKtmB,EAAIqH,KAAM,CACX,IAAIA,EAAO2G,IAAasX,EAAQkB,OAC1B,MACAxY,IAAasX,EAAQmB,KACjB,OACAzY,IAAasX,EAAQO,OACjB,QACA,SACd,OAAOU,EAAWlf,KAAKA,GAE3B,OAAOrH,EAAIqH,gBAAgB,IAAYrH,EAAIqH,KAAOkf,EAAWlf,KAAKrH,EAAIqH,MA2B3Dqf,CAAQhjB,EAAQ2D,EAAM2G,EAAUxK,EAAIiiB,EAAUc,YACrD,IAUQI,EACAC,EAXJC,GAUIF,EAAgB,CAAEjP,MAAO1J,IAAasX,EAAQO,QAAS,QACvDe,EAAyBpjB,EAAG2Q,MAAM,SAAW,CAAEuD,OAAO,GAAS,IAC5D,QAAOiP,EAAeC,EAAwBljB,GAAQgU,OAXjErQ,EAAOwf,EAAYxf,EAAKyf,SAASD,EAAW7Y,IAAasX,EAAQO,QAAUxe,EAC3E,IAAI0f,OAA8Bza,IAAjB5I,EAAO/G,OAAuBqR,IAAasX,EAAQO,OAChEC,GAAU,QAAUpiB,EAAOoiB,WAAapiB,EAAOoiB,UAAYze,EAAKye,QAChEkB,GAAM,QAAUtjB,EAAOsjB,OAAStjB,EAAOsjB,MAAQ3f,EAAK2f,IACpDC,EA9BZ,SAAyBvjB,EAAQqjB,EAAYG,GACzC,IAAID,EAASvjB,EAAOujB,OACpB,IAAKF,IAAyB,IAAXE,EACf,OAAO,EACX,KAAK,QAAUA,IAAqB,MAAVA,EACtB,OAAOC,EACX,IAAe,IAAXD,IAAmB,QAASA,GAC5B,OAAOA,EACX,MAAM,IAAIrc,MAAM,2BAA6Bqc,EAAS,uDAsBrCE,CAAgBzjB,EAAQqjB,EAAYtB,EAAU2B,uBACvDla,EArBZ,SAAoBxJ,EAAQmjB,EAAWE,EAAYE,GAC/C,IAAIC,EAAgB,CAChB,CAAEG,KAAM,GAAIC,GAAIP,GAAcF,OAAYva,EAAY,IACtD,CAAE+a,KAAM,KAAMC,GAAIP,GAAcF,OAAYva,EAAY,KAExDY,GAAU,QAAQxJ,EAAOwJ,SAAWxJ,EAAOwJ,QAAU,IACrD,QAAS+Z,IACT/Z,EAAQtU,KAAK,CAAEyuB,KAAMJ,EAAQK,QAAIhb,IACrC,IAAIib,GAAiB,QAAIra,GAAS,QAAK,SACvC,OAAO,QAAOga,GAAe,SAAU5O,GAAQ,OAA8C,IAAvCiP,EAAelhB,QAAQiS,EAAK+O,SAAiB9sB,OAAO2S,GAYxFsa,CAAW9jB,EAAQmjB,EAAWE,EAAYE,GACpD1P,GAAU,QAAU7T,EAAO6T,WAAa7T,EAAO6T,UAAYlQ,EAAKkQ,SAOpE,QAAOpf,KAAM,CAAEqL,GAAIA,EAAI6D,KAAMA,EAAM2G,SAAUA,EAAU+Y,WAAYA,EAAYjB,QAASA,EAASkB,IAAKA,EAAKC,OAAQA,EAAQ/Z,QAASA,EAASqK,QAASA,EAASG,MAAOmP,EAAWnjB,OAAQA,IAoG7L,OAlGA8hB,EAAMrM,OAAS,SAAU5S,EAAQ4S,QACd,IAAXA,IAAqBA,EAAS,IAElC,IADA,IAAI1F,EAAc,GACTwE,EAAK,EAAGwP,EAAWlhB,EAAQ0R,EAAKwP,EAASlgB,OAAQ0Q,IAAM,CAC5D,IAAI9Q,EAAQsgB,EAASxP,GACrBxE,EAAYtM,EAAM3D,IAAM2D,EAAMxK,MAAMwc,EAAOhS,EAAM3D,KAErD,OAAOiQ,GAaX+R,EAAMkC,QAAU,SAAUnhB,EAAQohB,EAASC,GAGvC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IAC7BrhB,EAAO9E,QAAO,SAAU0F,GAAS,OAAQA,EAAME,KAAKC,OAAOqgB,EAAQxgB,EAAM3D,IAAKokB,EAAQzgB,EAAM3D,SAWvGgiB,EAAMle,OAAS,SAAUf,EAAQohB,EAASC,GAGtC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IACsB,IAAnDpC,EAAMkC,QAAQnhB,EAAQohB,EAASC,GAASrgB,QAGnDie,EAAMqC,UAAY,SAAUthB,EAAQ4S,GAEhC,YADe,IAAXA,IAAqBA,EAAS,IAC3B5S,EAAOO,KAAI,SAAUK,GAAS,OAAOA,EAAM0gB,UAAU1O,EAAOhS,EAAM3D,QAASuD,OAAO,MAAU,IAEvGye,EAAMxrB,UAAU8tB,eAAiB,SAAUnrB,GACvC,OAAOxE,KAAK4uB,YAAc5uB,KAAKkP,KAAKC,OAAOnP,KAAKwE,QAASA,IAM7D6oB,EAAMxrB,UAAU2C,MAAQ,SAAUA,GAC9B,IAAI2L,EAAQnQ,KA0BZ,OADAwE,EAR2B,SAAUR,GACjC,IAAK,IAAI8b,EAAK,EAAGuL,EAAKlb,EAAM4E,QAAS+K,EAAKuL,EAAGjc,OAAQ0Q,IAAM,CACvD,IAAIrM,EAAQ4X,EAAGvL,GACf,GAAIrM,EAAMyb,OAASlrB,EACf,OAAOyP,EAAM0b,GAErB,OAAOnrB,EAEH4rB,CAAqBprB,IACtB,QAAYA,GAtBG,WAClB,GAAI2L,EAAM0f,mBACN,OAAO1f,EAAM0f,mBAAmBC,aACpC,IAAK,cACD,MAAM,IAAIrd,MAAM,+DACpB,IAAIqd,EAAe,qBAA0B3f,EAAM5E,OAAOyiB,MAC1D,GAAI8B,MAAAA,IAAwD3f,EAAMjB,KAAKgK,GAAG4W,GACtE,MAAM,IAAIrd,MAAM,kBAAoBqd,EAAe,oBAAsB3f,EAAM9E,GAAK,sCAAwC8E,EAAMjB,KAAK1J,KAAO,KAIlJ,OAHI2K,EAAM5E,OAAOyiB,KAAkB,cAC/B7d,EAAM0f,mBAAqB,CAAEC,aAAcA,IAExCA,EAWiBC,GAAoB/vB,KAAKkP,KAAK8gB,WAAWxrB,IAEzE6oB,EAAMxrB,UAAUouB,SAAW,WACvB,OAAOjwB,KAAK6V,WAAasX,EAAQO,QAErCL,EAAMxrB,UAAU6tB,UAAY,SAAUlrB,GAElC,KAAK,QAAYA,IAAoB,OAAVA,IAAmBxE,KAAK4uB,WAC/C,OAAO,EAEX,IAAI/T,EAAa7a,KAAKkP,KAAK8gB,WAAWxrB,GACtC,IAAKxE,KAAKkP,KAAKgK,GAAG2B,GACd,OAAO,EAEX,IAAIqV,EAAUlwB,KAAKkP,KAAK2F,OAAOgG,GAC/B,SAAS,QAASqV,KAAalwB,KAAKkP,KAAKoV,QAAQ7a,KAAKymB,KAE1D7C,EAAMxrB,UAAUiT,SAAW,WACvB,MAAO,UAAY9U,KAAKqL,GAAK,IAAMrL,KAAKkP,KAAO,aAAelP,KAAK8uB,OAAS,eAAiB9uB,KAAK4uB,WAAa,KAE5GvB,EAtHe,4OChDtB8C,EAA2B,WAM3B,SAASA,EAAUjd,GAEflT,KAAKskB,QAAU,KAEftkB,KAAKof,SAAU,GACf,QAAOpf,KAAMkT,GAgDjB,OA5CAid,EAAUtuB,UAAUqX,GAAK,SAAUlV,EAAK6B,GACpC,OAAO,GAGXsqB,EAAUtuB,UAAUgT,OAAS,SAAU7Q,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUoT,OAAS,SAAUjR,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUsN,OAAS,SAAUsO,EAAGmB,GAEtC,OAAOnB,GAAKmB,GAEhBuR,EAAUtuB,UAAUuuB,YAAc,WAC9B,IAAIC,EAAMrwB,KAAKskB,QAAQxP,WACvB,OAAOub,EAAItJ,OAAO,EAAGsJ,EAAIjhB,OAAS,IAEtC+gB,EAAUtuB,UAAUiT,SAAW,WAC3B,MAAO,cAAgB9U,KAAKwF,KAAO,KAGvC2qB,EAAUtuB,UAAUmuB,WAAa,SAAUhsB,GACvC,OAAOhE,KAAKkZ,GAAGlV,GAAOA,EAAMhE,KAAKiV,OAAOjR,IAY5CmsB,EAAUtuB,UAAU8sB,SAAW,SAAU2B,EAAML,GAC3C,IAAKK,EACD,OAAOtwB,KACX,GAAa,SAATswB,IAAoBL,EACpB,MAAM,IAAIxd,MAAM,kDACpB,OAAO,IAAI8d,EAAUvwB,KAAMswB,IAExBH,EA3DmB,GA+D9B,SAASI,EAAUrhB,EAAMohB,GACrB,IAAIngB,EAAQnQ,KAEZ,SAASwwB,EAAUxsB,GACf,OAAO,QAAQA,GAAOA,GAAM,QAAUA,GAAO,CAACA,GAAO,GAczD,SAASysB,EAAajwB,EAAUkwB,GAC5B,OAAO,SAAqB1sB,GACxB,IAAI,QAAQA,IAAuB,IAAfA,EAAIoL,OACpB,OAAOpL,EACX,IAAI0b,EAAM8Q,EAAUxsB,GAChBsC,GAAS,QAAIoZ,EAAKlf,GACtB,OAAyB,IAAlBkwB,EAAgF,KAAvD,QAAOpqB,GAAQ,SAAUgJ,GAAK,OAAQA,KAAMF,OAjBpF,SAAqBpL,GACjB,OAAQA,EAAIoL,QACR,KAAK,EACD,OACJ,KAAK,EACD,MAAgB,SAATkhB,EAAkBtsB,EAAI,GAAKA,EACtC,QACI,OAAOA,GAUgF2sB,CAAYrqB,IAI/G,SAASsqB,EAAmBpwB,GACxB,OAAO,SAAqBqwB,EAAMC,GAC9B,IAAIC,EAAOP,EAAUK,GAAOG,EAAQR,EAAUM,GAC9C,GAAIC,EAAK3hB,SAAW4hB,EAAM5hB,OACtB,OAAO,EACX,IAAK,IAAIiO,EAAI,EAAGA,EAAI0T,EAAK3hB,OAAQiO,IAC7B,IAAK7c,EAASuwB,EAAK1T,GAAI2T,EAAM3T,IACzB,OAAO,EAEf,OAAO,GAGf,CAAC,SAAU,SAAU,SAAU,cAActc,SAAQ,SAAUyE,GAC3D,IAAIyrB,EAAc/hB,EAAK1J,GAAMlC,KAAK4L,GAC9BgiB,EAAqB,WAAT1rB,EAAoBorB,EAAqBH,EACzDtgB,EAAM3K,GAAQ0rB,EAAUD,OAE5B,QAAOjxB,KAAM,CACT2tB,QAASze,EAAKye,QACdnoB,KAAM0J,EAAK1J,KACX8e,QAASpV,EAAKoV,QACdlF,QAASlQ,EAAKkQ,QACdyP,IAAK3f,EAAK2f,IACV3V,GAAIuX,EAAavhB,EAAKgK,GAAG5V,KAAK4L,IAAO,GACrCiiB,WAAYb,+GC5DZc,kUApDJC,EAA4B,WAC5B,SAASA,IACLrxB,KAAKwlB,SAAU,EACfxlB,KAAKsxB,UAAY,GACjBtxB,KAAKuxB,cAAe,QAAKF,EAAWxvB,UAAW,CAC3C,OACA,SACA,QACA,OACA,MACA,OACA,OACA,OACA,QAIJ7B,KAAK+D,OAAQ,SAAQ,QAAI/D,KAAKuxB,cADf,SAAU9X,EAAYjU,GAAQ,OAAO,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,OAClC,IA+B3D,OA7BA4X,EAAWxvB,UAAUqT,QAAU,WAC3BlV,KAAK+D,MAAQ,IAOjBstB,EAAWxvB,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpD,KAAK,QAAU/X,GACX,OAAOzZ,KAAK+D,MAAMyB,GACtB,GAAIxF,KAAK+D,MAAMrB,eAAe8C,GAC1B,MAAM,IAAIiN,MAAM,iBAAmBjN,EAAO,+BAO9C,OANAxF,KAAK+D,MAAMyB,GAAQ,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,IACpD+X,IACAxxB,KAAKsxB,UAAU7wB,KAAK,CAAE+E,KAAMA,EAAM0N,IAAKse,IAClCxxB,KAAKwlB,SACNxlB,KAAKyxB,mBAENzxB,MAEXqxB,EAAWxvB,UAAU4vB,gBAAkB,WACnC,KAAOzxB,KAAKsxB,UAAUliB,QAAQ,CAC1B,IAAIF,EAAOlP,KAAKsxB,UAAUrvB,QAC1B,GAAIiN,EAAKoV,QACL,MAAM,IAAI7R,MAAM,sDACpB,QAAOzS,KAAK+D,MAAMmL,EAAK1J,MAAO,qBAA0B0J,EAAKgE,QAG9Dme,EAhDoB,GAoDvBD,EAAkB,SAAUle,GAC5B,IAAIwe,EAAc,SAAU1tB,GAAO,OAAe,MAAPA,EAAcA,EAAI8Q,WAAa9Q,GACtE2tB,EAAkB,CAClB9c,OAAQ6c,EACRzc,OAAQyc,EACRxY,IAAI,IAAAA,IAAG0Y,QACPtN,QAAS,KAETnV,OAAQ,SAAUsO,EAAGmB,GAAK,OAAOnB,GAAKmB,IAE1C,OAAO,QAAO,GAAI+S,EAAiBze,KAGvC,QAAOme,EAAWxvB,UAAW,CACzB0D,OAAQ6rB,EAAgB,IACxBjpB,KAAMipB,EAAgB,CAClB9M,QAAS,UAEbuN,MAAOT,EAAgB,IACvBU,KAAMV,EAAgB,CAClBhS,SAAS,IAEb2S,IAAKX,EAAgB,CACjBnc,OAAQ,SAAUjR,GAAO,OAAOqlB,SAASrlB,EAAK,KAC9CkV,GAAI,SAAUlV,GACV,QAAQ,QAAkBA,IAAQhE,KAAKiV,OAAOjR,EAAI8Q,cAAgB9Q,GAEtEsgB,QAAS,UAEb0N,KAAMZ,EAAgB,CAClBvc,OAAQ,SAAU7Q,GAAO,OAAQA,EAAO,EAAM,GAC9CiR,OAAQ,SAAUjR,GAAO,OAA6B,IAAtBqlB,SAASrlB,EAAK,KAC9CkV,IAAI,IAAAA,IAAG+Y,SACP3N,QAAS,QAEb4N,KAAMd,EAAgB,CAClBvc,OAAQ,SAAU7Q,GACd,OAAQhE,KAAKkZ,GAAGlV,GAEV,CAACA,EAAImuB,eAAgB,KAAOnuB,EAAIouB,WAAa,IAAItwB,OAAO,IAAK,IAAMkC,EAAIquB,WAAWvwB,OAAO,IAAImR,KAAK,UADlGkB,GAGVc,OAAQ,SAAUjR,GACd,GAAIhE,KAAKkZ,GAAGlV,GACR,OAAOA,EACX,IAAIgY,EAAQhc,KAAKsyB,QAAQ7oB,KAAKzF,GAC9B,OAAOgY,EAAQ,IAAIuW,KAAKvW,EAAM,GAAIA,EAAM,GAAK,EAAGA,EAAM,SAAM7H,GAEhE+E,GAAI,SAAUlV,GAAO,OAAOA,aAAeuuB,OAASjJ,MAAMtlB,EAAIwuB,YAC9DrjB,OAAQ,SAAUsjB,EAAGlV,GACjB,MAAO,CAAC,cAAe,WAAY,WAAW3O,QAAO,SAAUsL,EAAKvZ,GAAM,OAAOuZ,GAAOuY,EAAE9xB,OAAU4c,EAAE5c,QAAU,IAEpH2jB,QAAS,0DACTgO,QAAS,0DAEbI,KAAMtB,EAAgB,CAClBvc,OAAQ,KACRI,OAAQ,KACRiE,IAAI,IAAAA,IAAG3F,QACPpE,OAAQ,KACRmV,QAAS,UAGbJ,IAAKkN,EAAgB,CACjBvc,OAAQ,KACRI,OAAQ,KACRiE,GAAI,WAAc,OAAO,GACzB/J,OAAQ,kLCjJhBwjB,EAA6B,WAC7B,SAASA,EAAYvkB,QACF,IAAXA,IAAqBA,EAAS,KAClC,QAAOpO,KAAMoO,GA4BjB,OAlBAukB,EAAY9wB,UAAU+wB,SAAW,SAAUC,EAAWC,EAAUC,GAC5D,IAAIC,EACAC,GAAU,QAAUH,EAAUC,GAAM9nB,EAAY,GAAIioB,EAAc,GACtE,IAAK,IAAI7V,KAAK4V,EACV,GAAKA,EAAQ5V,IAAO4V,EAAQ5V,GAAGjP,SAE/B4kB,EAAezf,OAAOC,KAAKyf,EAAQ5V,GAAGjP,SACpBgB,OAElB,IAAK,IAAIsO,KAAKsV,EACNE,EAAYhlB,QAAQ8kB,EAAatV,KAAO,IAE5CwV,EAAYzyB,KAAKuyB,EAAatV,IAC9BzS,EAAU+nB,EAAatV,IAAM1d,KAAKgzB,EAAatV,KAGvD,OAAO,QAAO,GAAIzS,EAAW4nB,IAE1BF,EA/BqB,+RCS5BQ,EAA0B,WAC1B,SAASA,EAASC,GACd,GAAIA,aAAuBD,EAAU,CACjC,IAAI5kB,EAAO6kB,EACXpzB,KAAKyN,MAAQc,EAAKd,MAClBzN,KAAKwO,YAAcD,EAAKC,YAAY1M,QACpC9B,KAAKsb,aAAc,QAAO,GAAI/M,EAAK+M,aACnCtb,KAAK+X,YAAcxJ,EAAKwJ,YAAYjW,QACpC9B,KAAKwa,MAAQjM,EAAKiM,OAASjM,EAAKiM,MAAM1Y,YAErC,CACD,IAAI2L,EAAQ2lB,EACZpzB,KAAKyN,MAAQA,EACbzN,KAAKwO,YAAcf,EAAM4lB,WAAW,CAAEjU,SAAS,IAC/Cpf,KAAKsb,YAAc,GACnBtb,KAAK+X,YAActK,EAAMsK,YAAYpJ,KAAI,SAAUqE,GAAO,OAAOA,EAAItG,YA+C7E,OA5CAymB,EAAStxB,UAAU6K,MAAQ,WACvB,OAAO,IAAIymB,EAASnzB,OAGxBmzB,EAAStxB,UAAUyxB,eAAiB,SAAUllB,GAG1C,OADApO,KAAKsb,YAActb,KAAKwO,YAAYI,QAAO,SAAUsR,EAAMqT,GAAQ,OAAO,QAAWrT,EADtC,EAAnBsT,EAC2ED,GAD9CloB,GAAImoB,EAAShvB,MAAM4J,EAAOolB,EAASnoB,OAA1E,IAAUmoB,IACsF,IAC3GxzB,MAGXmzB,EAAStxB,UAAU4xB,UAAY,SAAUjuB,GACrC,OAAO,QAAKxF,KAAKwO,aAAa,QAAO,KAAMhJ,KAM/C2tB,EAAStxB,UAAUsN,OAAS,SAAUZ,EAAMmlB,GACxC,IAAIC,EAAO3zB,KAAK2zB,KAAKplB,EAAMmlB,GAC3B,OAAOC,GAAwB,IAAhBA,EAAKvkB,QAcxB+jB,EAAStxB,UAAU8xB,KAAO,SAAUplB,EAAMmlB,GACtC,GAAI1zB,KAAKyN,QAAUc,EAAKd,MACpB,OAAO,EACX,IAAIW,EAASslB,EAAWA,EAAS1zB,MAAQA,KAAKwO,YAC9C,OAAO,YAAcJ,EAAQpO,KAAKsb,YAAa/M,EAAK+M,cAMxD6X,EAASzmB,MAAQ,SAAU6B,GAAQ,OAAOA,EAAK7B,SACxCymB,EA9DkB,mWCHzBS,EAA2B,WAC3B,SAASA,KA4JT,OAzJAA,EAAUC,gBAAkB,SAAUC,EAAU3rB,GAC5C,IAAIsF,GAAQ,QAAKtF,GAAMsF,MACvB,OAAO,IAAI,IAAYqmB,EAAUrmB,EAAOtF,EAAKwG,KAAI,QAAK,gBAAgBC,OAAO,KAAQ,IAAK,KAE9FglB,EAAUG,UAAY,SAAUvH,GAC5B,IAAIre,EAAWqe,EAAYpe,SAC3B,OAAOoe,EAAY/T,SAAStQ,KAAKwG,KAAI,SAAUlB,GAAS,OAAO,IAAI,IAASA,GAAO6lB,eAAenlB,OAGtGylB,EAAUI,YAAc,SAAUC,EAAUzH,GACxC,IAAI0H,EAASN,EAAUG,UAAUvH,GACjC,OAAIA,EAAYrsB,UAAUif,QACfwU,EAAUO,cAAcF,EAAUC,EAAQ3gB,OAAOC,KAAKgZ,EAAYpe,WAEtE8lB,GAOXN,EAAUQ,iBAAmB,SAAUttB,EAAOqB,EAAM6kB,GAEhD7kB,EACKmB,QAAO,SAAUiF,GAAQ,OAAO,QAAQye,EAAQze,EAAKd,UACrD1M,SAAQ,SAAUwN,GACnB,IAAI8lB,GAAY,QAAO9lB,EAAKd,MAAM+M,OAAS,IACvC8Z,EAAUV,EAAUU,QAAQnsB,GAAM,SAAUoY,GAAK,OAAOA,IAAMhS,KAC9DgmB,EAAcF,EAAU1lB,KAAI,SAAUmL,GAAQ,OAAOhT,EAAM0tB,iBAAiBF,EAASxa,MACzFvL,EAAKiM,MAAQ+Z,EAAY3lB,OAAO,KAAS,QAcjDglB,EAAUO,cAAgB,SAAUF,EAAUC,EAAQO,QACnC,IAAXA,IAAqBA,EAAS,IAKlC,IAAIC,EAAYT,EACXtlB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKC,eAClCI,OAAO,KAAS,IAChBtF,QAAO,SAAU0F,GAAS,OAAQA,EAAMoQ,WACxCzQ,KAAI,QAAK,OAiBd,OAAOulB,EAAOvlB,KAZd,SAAiCgmB,GAE7B,IAAIC,GAAc,QAAO,GAAID,GAAUA,EAAOrZ,aAE1CuZ,GAAoB,QAAKD,EAAaH,GAC1CG,GAAc,QAAKA,EAAaH,GAChC,IAnBmBtsB,EAAMsF,EACrBc,EAkBAumB,GAAgB,SAnBD3sB,EAmBoB8rB,EAnBdxmB,EAmBwBknB,EAAOlnB,MAlBpDc,GAAO,QAAKpG,GAAM,QAAO,QAASsF,KAC/B,QAAO,GAAIc,GAAQA,EAAK+M,cAiBmC,IAAIoZ,GAElEK,GAAe,QAAOH,EAAaE,EAAeD,GACtD,OAAO,IAAI,IAASF,EAAOlnB,OAAO6lB,eAAeyB,OAQzDnB,EAAUllB,YAAc,SAAUulB,EAAUC,EAAQc,GAIhD,IAHA,IAE2BC,EAAOC,EAU9BhG,EAAMiG,EAAUlnB,EAASke,EAZzBrF,EAAMhF,KAAKD,IAAIoS,EAAS7kB,OAAQ8kB,EAAO9kB,QACvCgmB,EAAO,EAEJA,EAAOtO,GAAOmN,EAASmB,GAAM3nB,QAAUunB,IADnBC,EAC6ChB,EAASmB,GAD/CF,EACsDhB,EAAOkB,GAD7CH,EAAM9lB,OAAO+lB,EAAOtB,EAAUyB,oBAE5ED,IAUJD,GADAjG,EAAO+E,GACSnyB,MAAM,EAAGszB,GACzBnnB,EAAUihB,EAAKptB,MAAMszB,GAErB,IAAIE,EAAuBH,EAASxmB,KAVpC,SAAuB4mB,EAActmB,GACjC,IAAIxC,EAAS8oB,EAAa7oB,QAE1B,OADAD,EAAO6O,YAAc4Y,EAAOjlB,GAAKqM,YAC1B7O,KAUX,OAFA0f,EAAW+H,EAAOpyB,MAAMszB,GAEjB,CAAElG,KAAMA,EAAMC,GADhBmG,EAAqBlzB,OAAO+pB,GACJgJ,SAAUA,EAAUG,qBAAsBA,EAAsBrnB,QAASA,EAASke,SAAUA,IAiB7HyH,EAAU4B,SAAW,SAAUC,EAAOC,EAAOhC,GACzC,IAAIiC,GAAO,EAEX,OADa,QAAYF,EAAOC,GAClB9mB,QAAO,SAAU4mB,EAAUnK,GACrC,IAAIuK,EAAQvK,EAAG,GAAIwK,EAAQxK,EAAG,GAE9B,OADAsK,EAAOA,IAASC,EAAMzmB,OAAO0mB,EAAOnC,IACtB8B,EAAWA,EAASpzB,OAAOwzB,KAC1C,KAUPhC,EAAUzkB,OAAS,SAAUsmB,EAAOC,EAAOhC,GACvC,OAAO+B,EAAMrmB,SAAWsmB,EAAMtmB,QAAUwkB,EAAU4B,SAASC,EAAOC,EAAOhC,GAAUtkB,SAAWqmB,EAAMrmB,QAYxGwkB,EAAUU,QAAU,SAAUnsB,EAAM2tB,GAChC,IAAIvnB,GAAO,QAAKpG,EAAM2tB,GAClBC,EAAa5tB,EAAK+F,QAAQK,GAC9B,OAAuB,IAAhBwnB,OAAoB5hB,EAAYhM,EAAKrG,MAAM,EAAGi0B,EAAa,IAEtEnC,EAAUyB,iBAAmB,SAAU9mB,GACnC,OAAOA,EAAKd,MAAM4lB,WAAW,CAAEjU,SAAS,IAAS9V,QAAO,SAAU0F,GAAS,OAAQA,EAAM2e,YAG7FiG,EAAUtY,YAAc,SAAUnT,GAAQ,OAAOA,EAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,QAAO2L,EAAK3L,EAAK+M,eAAiB,KACtHsY,EA7JmB,yGCPvB,IAAIoC,EAAkB,CACzB/lB,KAAM,CACFgmB,KAAM,OACNC,MAAO,SAEXpd,MAAO,CACHqd,KAAM,OACNC,OAAQ,sbCgBZnkB,EAA4B,WAC5B,SAASA,EAAWokB,EAAMne,EAAWpG,EAAMwkB,EAAQ3uB,GAG/C,GAFA3H,KAAKu2B,UAAW,EAChBv2B,KAAKyD,aAAU0Q,EACXkiB,aAAgBpkB,GAChB,QAAOjS,KAAMq2B,QAEZ,IAAI,QAAWne,GAAY,CAC5B,IAAI,QAAkBme,GAClB,MAAM,IAAI5jB,MAAM,gDACpB,KAAK,QAAWyF,GACZ,MAAM,IAAIzF,MAAM,2DACpBzS,KAAKuhB,MAAQ8U,EACbr2B,KAAKs2B,OAASA,EACdt2B,KAAKkY,UAAYA,EACjBlY,KAAK8R,KAAOA,GAAQ,GACpB9R,KAAK2H,KAAOA,EACZ3H,KAAKu2B,cAAoBpiB,IAATxM,EAChB3H,KAAKyD,QAAUzD,KAAKu2B,SAAW,YAAiBv2B,KAAK2H,WAAQwM,OAE5D,IAAI,QAASkiB,IAASA,EAAK9U,QAAU8U,EAAK3zB,eAAe,cAAgB2zB,EAAK3zB,eAAe,SAAU,CACxG,IAAI8zB,EAAUH,EACd,OAAO,IAAIpkB,EAAWukB,EAAQjV,MAAOiV,EAAQte,UAAWse,EAAQ1kB,KAAM0kB,EAAQF,OAAQE,EAAQ7uB,OA+DtG,OA5DAsK,EAAWpQ,UAAUgX,UAAY,SAAUpL,GACvC,IAAIgpB,EAAaz2B,KAAKs2B,QAAU,GAC5BI,EAAejpB,GAASA,EAAMkpB,eAAkB,GACpD,MAAO,CACH1mB,KAAMwmB,EAAWxmB,MAAQymB,EAAYzmB,MA5CvC,OA6CE6I,MAAO2d,EAAW3d,OAAS4d,EAAY5d,OA5CxC,SAsDP7G,EAAWpQ,UAAU8K,QAAU,SAAUiqB,EAAgBhnB,GACrD,IAAIO,EAAQnQ,KACR+G,EAAK,OAOLwH,EAAOqoB,EAAeC,SAAS72B,MAC/ByN,EAAQc,GAAQA,EAAKd,MACrBqpB,EAAc92B,KAAK6Y,UAAUpL,GAAOqL,MACpCie,GAAoB,QAAWD,GAAeA,EAAc,KAUhE,OAAQ92B,KAAKyD,QAAUsD,EAClBkJ,OACAlF,MApB2B,WAC5B,OAAOhE,EAAG0U,IAAImb,EAAeI,gBAAgB7mB,GAAOxB,KAAI,SAAUqJ,GAAc,OAAOA,EAAWtH,IAAIkmB,EAAgBhnB,UAoBrH7E,MAjBiB,SAAUksB,GAAgB,OAAO9mB,EAAM+H,UAAU/V,MAAM,KAAM80B,MAkB9ElsB,KAAKgsB,GACLhsB,MAboB,SAAUmsB,GAK/B,OAJA/mB,EAAMxI,KAAOuvB,EACb/mB,EAAMomB,UAAW,EACjBpmB,EAAM+H,UAAY,KAClB,6BAA8B/H,EAAOP,GAC9BO,EAAMxI,SAgBrBsK,EAAWpQ,UAAU6O,IAAM,SAAUkmB,EAAgBhnB,GACjD,OAAO5P,KAAKyD,SAAWzD,KAAK2M,QAAQiqB,EAAgBhnB,IAExDqC,EAAWpQ,UAAUiT,SAAW,WAC5B,MAAO,sBAAuB,QAAU9U,KAAKuhB,OAAS,gBAAkBvhB,KAAK8R,KAAKnD,IAAI,MAAa,MAEvGsD,EAAWpQ,UAAU6K,MAAQ,WACzB,OAAO,IAAIuF,EAAWjS,OAE1BiS,EAAWklB,SAAW,SAAU5V,EAAO5Z,GAAQ,OAAO,IAAIsK,EAAWsP,GAAO,WAAc,OAAO5Z,IAAS,KAAM,KAAMA,IAC/GsK,EArFoB,4qBCd3BmlB,EAAQ,SACRC,EAAY,CAACD,EAAMlB,MAAOkB,EAAMnB,MAChCqB,EAAc,CAACF,EAAMlB,OAarB9tB,EAAgC,WAChC,SAASA,EAAemvB,GACpBv3B,KAAKu3B,MAAQA,EA8IjB,OA3IAnvB,EAAevG,UAAU+W,UAAY,WACjC,OAAO5Y,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO2L,EAAI9X,OAAOmM,EAAKwJ,YAAYpJ,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,YAAe,IAAI3S,OAAO,KAAO,KAQpJxG,EAAevG,UAAUiM,cAAgB,SAAUyT,GAC/C,IAAIiU,EAAWx1B,KAAKu3B,MACf5oB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKwJ,eAClCnJ,OAAO,KAAS,IAChBtF,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC9C,OAAO,QAAKiU,IAGhBptB,EAAevG,UAAUgX,UAAY,SAAUb,GAC3C,IAAIzJ,EAAOvO,KAAK62B,SAAS7e,GACzB,OAAOA,EAAWa,UAAUtK,EAAKd,QAyBrCrF,EAAevG,UAAUkS,WAAa,SAAUtG,GAC5C,OAAO,IAAIrF,EAAe,YAAkBpI,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAOA,EAAKd,QAAUA,OAiBpGrF,EAAevG,UAAU21B,eAAiB,SAAUC,EAAgBhqB,GAChE,IAAIc,GAAO,QAAKvO,KAAKu3B,OAAO,QAAO,QAAS9pB,IACxC+F,EAAOikB,EAAe9oB,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,SACtDhT,EAAKwJ,YAAcxJ,EAAKwJ,YAAYzO,QAAO,SAAUiU,GAAK,OAAkC,IAA3B/J,EAAKtF,QAAQqP,EAAEgE,UAAkBnf,OAAOq1B,IAS7GrvB,EAAevG,UAAU61B,YAAc,SAAUznB,EAAML,GACnD,IAAIO,EAAQnQ,UACC,IAATiQ,IAAmBA,EAAO,QAE9B,IAGI0nB,IAHa,QAAQN,EAAWpnB,GAAQA,EAAO,UAGjB,eAA6BqnB,EAAcD,EAE7E,sBAAuBr3B,KAAKu3B,MAAOtnB,EAAML,GACzC,IAAIgoB,EAAgB,SAAUC,EAAcC,GAAe,OAAO,SAAU9f,GACxE,OAAO,QAAQ6f,EAAc1nB,EAAM0I,UAAUb,GAAY8f,MAIzDvc,EAAWvb,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAC5C,IAAIwpB,EAAkBxpB,EAAKwJ,YAAYzO,OAAOsuB,EAAcD,EAAc,SACtEK,EAASD,EAAgBzuB,OAAOsuB,EAAc,CAAC,UAAW,UAC1DK,EAAOF,EAAgBzuB,QAAO,QAAIsuB,EAAc,CAAC,UAAW,WAE5D7jB,EAAa5D,EAAM4D,WAAWxF,EAAKd,OACnCyqB,EAAY,SAAU3a,GACtB,OAAOA,EACF7M,IAAIqD,EAAYnE,GAEhB7E,MAAK,SAAUvG,GAAS,MAAO,CAAG+c,MAAOhE,EAAEgE,MAAO/c,MAAOA,OAGlE,OADAwzB,EAAOj3B,QAAQm3B,GACRhe,EAAI9X,OAAO61B,EAAKtpB,IAAIupB,MAC5B,IAEH,OAAO,WAAgB3c,IAE3BnT,EAAevG,UAAUs2B,SAAW,WAChC,OAAOn4B,KAAKo4B,YAAcp4B,KAAKo4B,UAAY,IAAIC,EAAer4B,QAElEoI,EAAevG,UAAUg1B,SAAW,SAAU7e,GAC1C,OAAO,QAAKhY,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAO,QAAQA,EAAKwJ,YAAaC,OAO/E5P,EAAevG,UAAUm1B,gBAAkB,SAAUhf,GACjD,IAAI7H,EAAQnQ,KACRuO,EAAOvO,KAAK62B,SAAS7e,GAIrBsgB,GADU,YAAkBt4B,KAAKu3B,OAAO,SAAUjoB,GAAK,OAAOA,IAAMf,MAAYvO,KAAKu3B,OAEpF3oB,QAAO,SAAUsL,EAAKqe,GAAS,OAAOre,EAAI9X,OAAOm2B,EAAMxgB,eAAiB,IACxEzO,QAAO,SAAU0J,GAAO,OAAOA,IAAQgF,KAW5C,OAAOA,EAAWlG,KAAKnD,KAVH,SAAU4S,GAC1B,IAAIiU,EAAW8C,EAAqBhvB,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC7E,GAAIiU,EAASpmB,OACT,OAAO,QAAKomB,GAChB,IAAIgD,EAAeroB,EAAMgoB,WAAWM,UAAUlX,GAC9C,IAAI,QAAYiX,GACZ,MAAM,IAAI/lB,MAAM,+CAAgD,QAAU8O,IAE9E,OAAO,IAAI,IAAWA,GAAO,WAAc,OAAOiX,IAAiB,GAAIA,OAIxEpwB,EAhJwB,GAoJ/BiwB,EAAgC,WAChC,SAASA,EAAexnB,GACpB7Q,KAAK6Q,QAAUA,EACf7Q,KAAK04B,OAAS14B,KAAK0Q,IAlKQ,oBAkKsB,cAwBrD,OAtBA2nB,EAAex2B,UAAU6O,IAAM,SAAU6Q,GACrC,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,GAAIvJ,EAAY,CACZ,GAAiD,WAA7ChY,KAAK6Q,QAAQgI,UAAUb,GAAYc,MACnC,OAAOd,EAAWtH,IAAI1Q,KAAK6Q,SAE/B,IAAKmH,EAAWue,SACZ,MAAM,IAAI9jB,MAAM,yCAA0C,QAAUuF,EAAWuJ,QAEnF,OAAOvJ,EAAWrQ,KAEtB,OAAO3H,KAAKy4B,UAAUlX,IAE1B8W,EAAex2B,UAAU82B,SAAW,SAAUpX,GAC1C,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,OAAIvJ,EACOA,EAAWtH,IAAI1Q,KAAK6Q,SACxB,YAAiB7Q,KAAK04B,OAAOhoB,IAAI6Q,KAE5C8W,EAAex2B,UAAU42B,UAAY,SAAUlX,GAC3C,OAAOvhB,KAAK04B,QAAU14B,KAAK04B,OAAOhoB,IAAI6Q,IAEnC8W,EA3BwB,q2BC/J/BO,EAAkB,EAMlBC,GAAsB,QAAS,mBAJnB,CAAC,MAAO,OAAQ,SAAU,OAAQ,aAM9CC,GAAqB,QAAS,iBAJlB,CAAC,OAAQ,WAAY,OAAQ,WAAY,YAAa,eAUlEpiB,EAA0B,WAQ1B,SAASA,EAASU,EAAiBC,QACP,IAApBD,IAA8BA,EAAkByhB,QAC7B,IAAnBxhB,IAA6BA,EAAiByhB,GAClD94B,KAAKoX,gBAAkBA,EACvBpX,KAAKqX,eAAiBA,EACLrX,KAAKmb,IAAMyd,IACX54B,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAe,GAErCh5B,KAAKqI,MAAQ,KAEbrI,KAAK+W,YAAc,IAAI,IAAY/W,MAEnCA,KAAKsY,QAAU,IAAI,IAEnBtY,KAAK8sB,kBAAoB,IAAI,IAAkB9sB,MAK/CA,KAAK4U,kBAAoB,IAAI,IAAkB5U,MAK/CA,KAAKmc,UAAY,IAAI,IAAUnc,MAE/BA,KAAKiX,WAAa,IAAI,IAAWjX,MAEjCA,KAAK4W,cAAgB,IAAI,IAAc5W,MAEvCA,KAAK6W,aAAe,IAAI,IAAa7W,MAErCA,KAAKi5B,SAAW,GAChBj5B,KAAK+W,YAAY/M,WAAWC,iBAAiBjK,KAAK4W,cAAcgH,QAChE5d,KAAKsY,QAAQwa,SAAW9yB,KAAK4W,cAAcgH,OAC3C5d,KAAKsY,QAAQwN,QAAU9lB,KAAKsY,QAAQwa,SAASplB,KAC7C1N,KAAKk5B,WAAWl5B,KAAKsY,SACrBtY,KAAKk5B,WAAWl5B,KAAK6W,cACrB7W,KAAKk5B,WAAWl5B,KAAK4W,eACrB5W,KAAKk5B,WAAWl5B,KAAK8sB,mBACrB9sB,KAAKk5B,WAAWl5B,KAAKiX,YACrBjX,KAAKk5B,WAAW9hB,GAChBpX,KAAKk5B,WAAW7hB,GAgGpB,OA7FAX,EAAS7U,UAAUq3B,WAAa,SAAUA,GACtCl5B,KAAKg5B,aAAav4B,KAAKy4B,IAa3BxiB,EAAS7U,UAAUqT,QAAU,SAAUgkB,GACnC,IAAI/oB,EAAQnQ,KACRk5B,IAAc,QAAWA,EAAWhkB,SACpCgkB,EAAWhkB,QAAQlV,OAGvBA,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAal3B,QAAQf,SAAQ,SAAUo4B,GACxC,IACyB,mBAAdA,EAAEjkB,SAA0BikB,EAAEjkB,QAAQ/E,IAC7C,QAAWA,EAAM6oB,aAAcG,GAEnC,MAAOC,UAwDf1iB,EAAS7U,UAAUw3B,OAAS,SAAUA,EAAQl5B,QAC1B,IAAZA,IAAsBA,EAAU,IACpC,IAAIm5B,EAAiB,IAAID,EAAOr5B,KAAMG,GACtC,IAAKm5B,EAAe9zB,KAChB,MAAM,IAAIiN,MAAM,+CAAiD6mB,GAErE,OADAt5B,KAAKg5B,aAAav4B,KAAK64B,GACft5B,KAAKi5B,SAASK,EAAe9zB,MAAQ8zB,GAEjD5iB,EAAS7U,UAAU03B,UAAY,SAAUC,GACrC,OAAOA,EAAax5B,KAAKi5B,SAASO,IAAc,QAAOx5B,KAAKi5B,WAEzDviB,EAnJkB,ijBCf7B,SAAS+iB,EAAYhsB,GACjB,OAAOA,EAAMjI,KAEjB,SAASk0B,EAAYjsB,GAEjB,OADAA,EAAMC,KAAKsG,QAAU,WAAc,OAAOvG,GACnCA,EAAMC,KAEjB,SAASisB,EAAYlsB,GAIjB,OAHIA,EAAM2M,QAAU3M,EAAM2M,OAAOzS,OAC7B8F,EAAM9F,KAAO8F,EAAMC,KAAK/F,MAAO,QAAQ8F,EAAM2M,OAAOzS,KAAM8F,EAAM9F,OAE7D8F,EAAM9F,KAEjB,IAAIiyB,EAAgB,SAAUC,EAA4Bjc,GACtD,OAAO,SAAoBhK,GACvB,IAAIkmB,EAAWlmB,EAAYlG,KAG3B,GAAIosB,GAAYA,EAASroB,KAAOqoB,EAASt0B,MAAQs0B,EAASt0B,KAAKwW,MAAM,WAAY,CAC7E,IAAI+d,EAAc,IAClB,QAAKD,EAAUC,GACfA,EAAYtoB,KAAO,kBACnBqoB,EAAWC,EAEf,IAAI3f,EAASxG,EAAYwG,OACrB4f,EA/BG,SAAUvoB,GACrB,KAAK,QAASA,GACV,OAAO,EACX,IAAImM,EAAyB,MAAlBnM,EAAIhM,OAAO,GACtB,MAAO,CAAEzB,IAAK4Z,EAAOnM,EAAIwoB,UAAU,GAAKxoB,EAAKmM,KAAMA,GA2BlCsc,CAASJ,EAASroB,KAC3BA,EAAOuoB,EAAwBH,EAA2BxyB,QAAQ2yB,EAAOh2B,IAAK,CAAEyJ,MAAOqsB,IAAvEA,EAASroB,IAC7B,IAAKA,EACD,OAAO,KACX,IAAKooB,EAA2BM,UAAU1oB,GACtC,MAAM,IAAIgB,MAAM,gBAAkBhB,EAAM,eAAiBmC,EAAc,KAC3E,OAAOomB,GAAUA,EAAOpc,KAAOnM,GAAQ2I,GAAUA,EAAOggB,WAAcxc,KAAQnM,IAAI4oB,OAAO5oB,KAG7F6oB,EAAsB,SAAUC,GAChC,OAAO,SAA0B9sB,GAC7B,OAAQ8sB,EAAO9sB,IAAUA,EAAMgE,IAAMhE,EAAQA,EAAM2M,OAAS3M,EAAM2M,OAAOggB,UAAY,OAc7F,SAASI,EAAY/sB,GACjB,OAAOA,EAAM2M,OAAS3M,EAAM2M,OAAOjS,KAAK/F,OAAOqL,GAAkB,CAACA,GAEtE,SAASgtB,EAAgBhtB,GACrB,IAAI6L,EAAW7L,EAAM2M,QAAS,QAAO,GAAI3M,EAAM2M,OAAOd,UAAY,GAElE,OADAA,EAAS7L,EAAMjI,OAAQ,EAChB8T,EA2CJ,SAASohB,EAAmBjtB,GAE/B,IAA+BktB,EAAY3E,EA2BvC4E,EAAW,SAAUC,GAAK,OAAOA,EAAEC,SAAWD,EAAEtZ,OAEhDwZ,GAAqB,QAAQ,CAC7B,EAAC,QAAK,aAAc,SAAUF,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAE3iB,UAAW2iB,EAAE/oB,KAAM+oB,EAAEvE,UAC7F,EAAC,QAAK,cAAe,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAEG,WAAYH,EAAE/oB,MAAQ+oB,EAAEI,aAAcJ,EAAEvE,UACjH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAO,IAAIA,EAAEK,WAAe,GAAIL,EAAEvE,UACrH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAOA,EAAEM,WAAa,GAAIN,EAAEvE,OAAQuE,EAAEM,YACzH,EAAC,QAAK,eAAgB,SAAUN,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAI,KAAU,CAACA,EAAEO,aAAcP,EAAEvE,YAGrG+E,GAAmB,QAAQ,CAC3B,EAAC,SAAK,QAAK,OAAQ,MAAW,SAAU5nB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO,KAAU,CAAC9N,EAAMzP,KAAMyP,EAAM6iB,UACjH,EAAC,SAAK,QAAK,OAAQ,MAAU,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,OAAO,QAAK9N,EAAMzP,KAAMyP,EAAMzP,IAAIlC,MAAM,GAAI,GAAI2R,EAAM6iB,UAClI,EAAC,SAAK,QAAK,OAAQ,MAAa,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO9N,EAAMzP,KA/BvErD,EA+BqF8S,EAAMzP,IA9B5GuM,EAAY,cAIT5P,EAAY,SAAM4P,GAAaA,EAAU0H,SAAStX,EAAI4P,EAAUuH,WAAc,YA0BiCrE,EAAM6iB,QA/BjH,IAAU31B,EACjB4P,MAiCJ+qB,GAAkB,QAAQ,CAC1B,EAAC,IAAApiB,IAAG,KAAa,SAAUqE,GAAK,OAAOA,IACvC,CA5BmB,SAAUtD,GAAO,SAAUA,EAAIsH,QAAStH,EAAI/B,YA4B5C6iB,GACnB,CA3BoB,SAAU9gB,GAC9B,SAAWA,EAAI6gB,UAAW7gB,EAAIsH,SAAWtH,EAAIkhB,UAAYlhB,EAAI+gB,YAAc/gB,EAAImhB,aAAenhB,EAAIihB,YA0B9EH,GACpB,CAxBiB,SAAU9gB,GAC3B,SAAUA,GAAOA,EAAIjW,OAAQ,QAASiW,EAAIjW,OAAQ,QAAQiW,EAAIjW,OAAQ,QAAWiW,EAAIjW,QAuBpEq3B,GACjB,EAAC,SAAI,GAAO,SAAUphB,GAAO,MAAM,IAAIxH,MAAM,2BAA4B,QAAUwH,QAInFshB,EAAO9tB,EAAMd,QAEjB,QADY,QAAQ4uB,GAAQA,GArDGZ,EAqDmBY,EArDPvF,EAqDavoB,EAAMkpB,eAAiB,GApDpEpjB,OAAOC,KAAKmnB,GAAc,IAAIhsB,KAAI,SAAU4S,GAAS,MAAO,CAC/DA,MAAOA,EACPvd,IAAK22B,EAAWpZ,GAChBzP,UAAMqC,EACNmiB,OAAQN,EAAgBzU,SAiDnB5S,IAAI2sB,GAcrB,IAAIE,EAA8B,WAC9B,SAASA,EAAaC,EAAS7mB,GAC3B5U,KAAKy7B,QAAUA,EACf,IArIyBC,EAqIrBhuB,EAAO1N,KACP4d,EAAO,WAAc,OAAO6d,EAAQ3a,KAAK,KACzCyZ,EAAS,SAAU9sB,GAAS,MAAsB,KAAfA,EAAMjI,MAM7CxF,KAAK27B,SAAW,CACZn2B,KAAM,CAACi0B,GACP/rB,KAAM,CAACgsB,GACPtf,OAAQ,CARZ,SAAuB3M,GACnB,OAAI8sB,EAAO9sB,GACA,KACJguB,EAAQ3a,KAAKpT,EAAKkuB,WAAWnuB,KAAWmQ,MAM/CjW,KAAM,CAACgyB,GAEPloB,IAAK,CAACmoB,EAAchlB,EAAmBgJ,IAEvCwc,UAAW,CAACE,EAAoBC,IAChCnsB,OAAQ,EAtJastB,EAsJK9mB,EAAkB8mB,aArJ7C,SAAuBjuB,GAC1B,IACIouB,EAAapuB,EAAMgE,KAAOhE,EAAMgE,IAAI4hB,WAAW,CAAEjU,SAAS,KAAa,GACvE0c,GAAe,SAAO,SAAO,QAAKruB,EAAMW,QAAU,GAAIytB,EAAUltB,KAAI,QAAK,SAFvD,SAAUpD,EAAQF,GAAM,OAAOqwB,EAAa9qB,WAAWvF,EAAI,KAAMoC,EAAMC,UAG7F,OAAOmuB,EACFz5B,OAAO05B,GACPntB,KAAI,SAAUksB,GAAK,MAAO,CAACA,EAAExvB,GAAIwvB,MACjCjsB,OAAO,KAAY,OAiJpB4L,MAAO,GAEPrS,KAAM,CAACqyB,GAEPlhB,SAAU,CAACmhB,GACX1iB,YAAa,CAAC2iB,IAgEtB,OA7DAc,EAAa35B,UAAUk6B,QAAU,SAAUv2B,EAAM7E,GAC7C,IAAIg7B,EAAW37B,KAAK27B,SAChBpc,EAAQoc,EAASn2B,IAAS,GAE9B,OAAI,QAASA,MAAU,QAAU7E,GACtB4e,EAAMnQ,OAAS,EAAImQ,EAAQA,EAAM,IACvC,QAAS/Z,KAAU,QAAW7E,IAEnCg7B,EAASn2B,GAAQ+Z,EACjBoc,EAASn2B,GAAM/E,KAAKE,GACb,WAAc,OAAOg7B,EAASn2B,GAAMga,OAAOmc,EAASn2B,GAAM0I,QAAQvN,EAAI,KAAO,YAJpF,GAaJ66B,EAAa35B,UAAUm6B,MAAQ,SAAUvuB,GACrC,IAAeguB,EAANz7B,KAAmBy7B,QAASE,EAA5B37B,KAA0C27B,SAC/CvhB,EAASpa,KAAK47B,WAAWnuB,GAC7B,GAAI2M,IAAWqhB,EAAQ3a,KAAK1G,OAAQjG,GAAW,GAC3C,OAAO,KAEX,IAAK,IAAItO,KAAO81B,EACZ,GAAKA,EAASj5B,eAAemD,GAA7B,CAEA,IAAIo2B,EAAQN,EAAS91B,GAAK+I,QAAO,SAAUstB,EAAUpS,GAAQ,OAAO,SAAUmD,GAAU,OAAOnD,EAAKmD,EAAQiP,MAAiB,MAC7HzuB,EAAM5H,GAAOo2B,EAAMxuB,GAEvB,OAAOA,GAEX+tB,EAAa35B,UAAU+5B,WAAa,SAAUnuB,GAE1C,IAAIjI,EAAOiI,EAAMjI,MAAQ,GAErB22B,EAAW32B,EAAKsd,MAAM,KAM1B,GAFoB,OAFFqZ,EAASC,OAGvBD,EAASC,MACTD,EAAS/sB,OAAQ,CACjB,GAAI3B,EAAM2M,OACN,MAAM,IAAI3H,MAAM,mFAAqFjN,EAAO,KAGhH,OAAO22B,EAASlpB,KAAK,KAEzB,OAAKxF,EAAM2M,QAEJ,QAAS3M,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KADjD,IAGfg2B,EAAa35B,UAAU2D,KAAO,SAAUiI,GACpC,IAAIjI,EAAOiI,EAAMjI,KACjB,IAA2B,IAAvBA,EAAK0I,QAAQ,OAAgBT,EAAM2M,OACnC,OAAO5U,EACX,IAAIo2B,GAAa,QAASnuB,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KACtE,OAAOo2B,EAAaA,EAAa,IAAMp2B,EAAOA,GAE3Cg2B,EA5FsB,iTClL7Ba,EAA8B,WAC9B,SAASA,EAAaC,GAClBt8B,KAAKs8B,QAAUA,EAmDnB,OAjDAD,EAAax6B,UAAU06B,WAAa,SAAUC,GAE1C,OAAkC,KADlCA,EAAYA,GAAa,IACRtuB,QAAQ,MAAyC,IAA3BsuB,EAAUtuB,QAAQ,MAE7DmuB,EAAax6B,UAAUif,KAAO,SAAU2b,EAAaC,EAAMC,GAEvD,QADkB,IAAdA,IAAwBA,GAAY,GACnCF,GAA+B,KAAhBA,EAApB,CAEA,IAAIG,GAAQ,QAASH,GACjBj3B,EAAOo3B,EAAQH,EAAcA,EAAYj3B,KACzCxF,KAAKu8B,WAAW/2B,KAChBA,EAAOxF,KAAK03B,YAAYlyB,EAAMk3B,IAClC,IAAIjvB,EAAQzN,KAAKs8B,QAAQ92B,GACzB,GAAIiI,IAAUmvB,KAAWA,GAAUnvB,IAAUgvB,GAAehvB,EAAMC,OAAS+uB,IACvE,OAAOhvB,EAEN,GAAImvB,GAASD,EAAW,CACzB,IACIzZ,GADU,QAAOljB,KAAKs8B,SACJhzB,QAAO,SAAU2jB,GAAU,OAAOA,EAAO4P,mBAAmBC,UAAY7P,EAAO4P,mBAAmBC,SAAS5Z,QAAQ1d,MAIzI,OAHI0d,EAAQ9T,OAAS,GACjB,UAAkB,iDAAmD5J,EAAO,gBAAiB0d,EAAQvU,KAAI,SAAUqN,GAAS,OAAOA,EAAMxW,SAEtI0d,EAAQ,MAIvBmZ,EAAax6B,UAAU61B,YAAc,SAAUlyB,EAAMk3B,GACjD,IAAKA,EACD,MAAM,IAAIjqB,MAAM,sCAAwCjN,EAAO,KAKnE,IAJA,IAAIu3B,EAAY/8B,KAAK8gB,KAAK4b,GACtBM,EAAYx3B,EAAKsd,MAAM,KACvBma,EAAaD,EAAU5tB,OACvBiO,EAAI,EAAGyI,EAAUiX,EACd1f,EAAI4f,EAAY5f,IACnB,GAAqB,KAAjB2f,EAAU3f,IAAmB,IAANA,EAA3B,CAIA,GAAqB,MAAjB2f,EAAU3f,GAMd,MALI,IAAKyI,EAAQ1L,OACT,MAAM,IAAI3H,MAAM,SAAWjN,EAAO,0BAA4Bu3B,EAAUv3B,KAAO,KACnFsgB,EAAUA,EAAQ1L,YANlB0L,EAAUiX,EAWlB,IAAIG,EAAUF,EAAUl7B,MAAMub,GAAGpK,KAAK,KACtC,OAAO6S,EAAQtgB,MAAQsgB,EAAQtgB,MAAQ03B,EAAU,IAAM,IAAMA,GAE1Db,EArDsB,oWCW7Bc,EAA6B,WAE7B,SAASA,EAAY5xB,GACjB,OAAO4xB,EAAY37B,OAAO+J,GAAU,IA4FxC,OAlFA4xB,EAAY37B,OAAS,SAAU47B,GAC3BA,EAAYD,EAAYE,aAAaD,GAAa,IAAIA,EAAcA,EACpE,IAAI3vB,GAAQ,SAAQ,QAAQ2vB,EAAWD,EAAYt7B,YAMnD,OALAu7B,EAAUppB,QAAU,WAAc,OAAOvG,GACzCA,EAAMC,KAAO0vB,EACb3vB,EAAMovB,mBAAqB,CACvBC,SAAU,eAAgBrvB,EAAMjI,OAE7BiI,GAaX0vB,EAAYt7B,UAAUqX,GAAK,SAAUokB,GACjC,OAAOt9B,OAASs9B,GAAOt9B,KAAK0N,OAAS4vB,GAAOt9B,KAAKsL,QAAUgyB,GAM/DH,EAAYt7B,UAAUyJ,IAAM,WACxB,KAAKtL,KAAKoa,QAAYpa,KAAKoa,kBAAkBpa,KAAKokB,aAC9C,OAAOpkB,KAAKwF,KAChB,IAAIA,EAAOxF,KAAKoa,OAAO9O,MACvB,OAAO9F,EAAOA,EAAO,IAAMxF,KAAKwF,KAAOxF,KAAKwF,MAOhD23B,EAAYt7B,UAAU+b,KAAO,WACzB,OAAQ5d,KAAKoa,QAAUpa,KAAKoa,OAAOwD,QAAW5d,MAWlDm9B,EAAYt7B,UAAUwxB,WAAa,SAAUzyB,GAGzC,QAFAA,GAAO,QAASA,EAAM,CAAEwe,SAAS,EAAMme,aAAc,QAC/Bne,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOiZ,cAAiB,IAExEjxB,QAAO,QAAOpC,KAAKoO,SACnB9E,QAAO,SAAU0F,GAAS,OAAQpO,EAAK28B,cAAgB38B,EAAK28B,aAAa76B,eAAesM,EAAM3D,QASvG8xB,EAAYt7B,UAAU4xB,UAAY,SAAUpoB,EAAIzK,GAE5C,YADa,IAATA,IAAmBA,EAAO,IACrBZ,KAAKyR,KAAOzR,KAAKyR,IAAIgiB,UAAUpoB,EAAIzK,KACxC,SAAK,QAAOZ,KAAKoO,SAAS,QAAO,KAAM/C,KACtCzK,EAAKwe,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOqZ,UAAUpoB,IAE9D8xB,EAAYt7B,UAAUiT,SAAW,WAC7B,OAAO9U,KAAKsL,OAGhB6xB,EAAYE,aAAe,SAAUD,GACjC,OAAO,QAAWA,KAA+C,IAAjCA,EAA2B,iBAG/DD,EAAYK,mBAAqB,SAAUvjB,GAAO,OAAO,QAAWA,EAAa,UAEjFkjB,EAAYM,QAAU,SAAUxjB,GAAO,OAAO,QAASA,EAAwB,qBACxEkjB,EA/FqB,kPCZ5BO,EAAmC,WACnC,SAASA,EAAkBhpB,EAAQsY,EAAQ+O,EAAS4B,GAChD39B,KAAK0U,OAASA,EACd1U,KAAKgtB,OAASA,EACdhtB,KAAK+7B,QAAUA,EACf/7B,KAAK29B,UAAYA,EACjB39B,KAAK49B,MAAQ,GA4EjB,OA1EAF,EAAkB77B,UAAUqT,QAAU,WAClClV,KAAK49B,MAAQ,IAEjBF,EAAkB77B,UAAU6X,SAAW,SAAU0jB,GAC7C,IAAIQ,EAAQ59B,KAAK49B,MACbnwB,EAAQ,WAAmB2vB,GAC3B53B,EAAOiI,EAAMjI,KACjB,KAAK,QAASA,GACV,MAAM,IAAIiN,MAAM,gCACpB,GAAIzS,KAAKgtB,OAAOtqB,eAAe8C,KAAS,QAAQo4B,EAAMjvB,KAAI,QAAK,SAAUnJ,GACrE,MAAM,IAAIiN,MAAM,UAAYjN,EAAO,wBAGvC,OAFAo4B,EAAMn9B,KAAKgN,GACXzN,KAAK69B,QACEpwB,GAEXiwB,EAAkB77B,UAAUg8B,MAAQ,WAchC,IAbA,IAAI1tB,EAAQnQ,KACRqrB,EAAKrrB,KAAM49B,EAAQvS,EAAGuS,MAAO5Q,EAAS3B,EAAG2B,OAAQ+O,EAAU1Q,EAAG0Q,QAC9D+B,EAAa,GACjBC,EAAU,GACVC,EAAsB,GAClBC,EAAW,SAAUz4B,GAAQ,OAAO2K,EAAM6c,OAAOtqB,eAAe8C,IAAS2K,EAAM6c,OAAOxnB,IACtF04B,EAAkB,WACdJ,EAAW1uB,QACXe,EAAMwtB,UAAU58B,SAAQ,SAAUo9B,GAC9B,OAAOA,EAAS,aAAcL,EAAWnvB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,aAI1EkwB,EAAMxuB,OAAS,GAAG,CACrB,IAAI3B,EAAQmwB,EAAM37B,QACdm8B,EAAS3wB,EAAMjI,KACfc,EAASy1B,EAAQC,MAAMvuB,GACvB4wB,EAAYN,EAAQ7vB,QAAQT,GAChC,GAAInH,EAAJ,CACI,IAAIg4B,EAAgBL,EAASG,GAC7B,GAAIE,GAAiBA,EAAc94B,OAAS44B,EACxC,MAAM,IAAI3rB,MAAM,UAAY2rB,EAAS,wBAEzC,IAAIG,EAAsBN,EAASG,EAAS,OACxCG,GAEAv+B,KAAK0U,OAAOkC,cAAc4nB,WAAWD,GAEzCvR,EAAOoR,GAAU3wB,EACjBzN,KAAKy+B,YAAYhxB,GACb4wB,GAAa,GACbN,EAAQve,OAAO6e,EAAW,GAC9BP,EAAWr9B,KAAKgN,OAdpB,CAiBA,IAAIixB,EAAOV,EAAoBI,GAE/B,GADAJ,EAAoBI,GAAUR,EAAMxuB,OAChCivB,GAAa,GAAKK,IAASd,EAAMxuB,OAKjC,OAFAwuB,EAAMn9B,KAAKgN,GACXywB,IACOlR,EAEFqR,EAAY,GACjBN,EAAQt9B,KAAKgN,GAEjBmwB,EAAMn9B,KAAKgN,IAGf,OADAywB,IACOlR,GAEX0Q,EAAkB77B,UAAU48B,YAAc,SAAUhxB,GAChD,IAAIA,EAAMkxB,UAAalxB,EAAMgE,IAA7B,CAEA,IAAImtB,EAAW5+B,KAAK0U,OAAOuC,WAAW0F,MACtCiiB,EAASriB,KAAKqiB,EAASC,eAAer9B,OAAOiM,MAE1CiwB,EAlF2B,sbCQlCoB,EAA+B,WAE/B,SAASA,EAAcpqB,GACnB1U,KAAK0U,OAASA,EACd1U,KAAKgtB,OAAS,GAEdhtB,KAAK29B,UAAY,GACjB39B,KAAKy7B,QAAU,IAAI,IAAaz7B,KAAKgtB,QACrChtB,KAAK+7B,QAAU,IAAI,IAAa/7B,KAAKy7B,QAAS/mB,EAAOE,mBACrD5U,KAAK++B,WAAa,IAAI,IAAkBrqB,EAAQ1U,KAAKgtB,OAAQhtB,KAAK+7B,QAAS/7B,KAAK29B,WAChF39B,KAAKg/B,gBAmJT,OAhJAF,EAAcj9B,UAAUm9B,cAAgB,YAUvBh/B,KAAKi/B,MAAQj/B,KAAK++B,WAAWrlB,SATvB,CACflU,KAAM,GACNiM,IAAK,IACL+I,MAAO,KACPpM,OAAQ,CACJ,IAAK,CAAE5J,MAAO,KAAM0K,KAAM,OAAQye,SAAS,IAE/CgR,UAAU,KAGRvE,UAAY,MAGtB0E,EAAcj9B,UAAUqT,QAAU,WAC9B,IAAI/E,EAAQnQ,KACZA,KAAK++B,WAAW7pB,UAChBlV,KAAK29B,UAAY,GACjB39B,KAAK0Q,MAAM3P,SAAQ,SAAU0M,GAAS,OAAO0C,EAAMO,IAAIjD,IAAU0C,EAAMquB,WAAW/wB,OAgCtFqxB,EAAcj9B,UAAUq9B,gBAAkB,SAAUf,GAEhD,OADAn+B,KAAK29B,UAAUl9B,KAAK09B,GACb,YACH,QAAWn+B,KAAK29B,UAAhB,CAA2BQ,IAC7B76B,KAAKtD,OAWX8+B,EAAcj9B,UAAU+b,KAAO,WAC3B,OAAO5d,KAAKi/B,OAchBH,EAAcj9B,UAAU6X,SAAW,SAAUylB,GACzC,OAAOn/B,KAAK++B,WAAWrlB,SAASylB,IAGpCL,EAAcj9B,UAAUu9B,gBAAkB,SAAU3xB,GAChD,IAAI0C,EAAQnQ,KACRyb,EAAMzb,KAAK0Q,MAAM/B,KAAI,SAAUyO,GAAK,OAAOA,EAAEpJ,aAC7CqrB,EAAc,SAAUrS,GACxB,IAAIsS,EAAY7jB,EAAInS,QAAO,SAAU8T,GAAK,OAAqC,IAA9B4P,EAAO9e,QAAQkP,EAAEhD,WAClE,OAA4B,IAArBklB,EAAUlwB,OAAekwB,EAAYA,EAAUl9B,OAAOi9B,EAAYC,KAEzE12B,EAAWy2B,EAAY,CAAC5xB,IACxB8xB,EAAe,CAAC9xB,GAAOrL,OAAOwG,GAAUoX,UAW5C,OAVAuf,EAAax+B,SAAQ,SAAUksB,GAC3B,IAAI2R,EAAWzuB,EAAMuE,OAAOuC,WAAW0F,MAEvCiiB,EACKjiB,QACArT,QAAO,QAAO,QAAS2jB,IACvBlsB,SAAQ,SAAUwb,GAAQ,OAAOqiB,EAASY,WAAWjjB,aAEnDpM,EAAM6c,OAAOC,EAAOznB,SAExB+5B,GAWXT,EAAcj9B,UAAU28B,WAAa,SAAU/B,GAC3C,IAAIxP,EAASjtB,KAAK0Q,IAAI+rB,GACtB,IAAKxP,EACD,MAAM,IAAIxa,MAAM,sCAAwCgqB,GAC5D,IAAIgD,EAAqBz/B,KAAKo/B,gBAAgBnS,EAAOjZ,WAIrD,OAHAhU,KAAK29B,UAAU58B,SAAQ,SAAUo9B,GAC7B,OAAOA,EAAS,eAAgBsB,EAAmB9wB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,YAE5E+xB,GAEXX,EAAcj9B,UAAU6O,IAAM,SAAU+rB,EAAaC,GACjD,IAAIvsB,EAAQnQ,KACZ,GAAyB,IAArBgC,UAAUoN,OACV,OAAOmE,OAAOC,KAAKxT,KAAKgtB,QAAQre,KAAI,SAAUnJ,GAAQ,OAAO2K,EAAM6c,OAAOxnB,GAAMkI,QACpF,IAAIgyB,EAAQ1/B,KAAKy7B,QAAQ3a,KAAK2b,EAAaC,GAC3C,OAAQgD,GAASA,EAAMhyB,MAAS,MAYpCoxB,EAAcj9B,UAAUiV,UAAY,SAAU6oB,EAAUC,GACpD,OAAO5/B,KAAK+7B,QAAQA,QAAQ4D,EAAUC,IAEnCd,EA7JuB,2SCsB9Be,EAA6B,WAe7B,SAASA,EAAYC,EAAgBC,EAAaC,EAASC,GACvDjgC,KAAK8/B,eAAiBA,EACtB9/B,KAAK+/B,YAAcA,EACnB//B,KAAK+/B,YAAcA,EACnB//B,KAAKggC,SAAU,QAAO,GAAIA,GAAW,IACrChgC,KAAKigC,UAAW,QAAO,GAAIA,GAAY,IACvCjgC,KAAKkgC,YAAcJ,EAAerE,QAAQ3a,KAAKif,EAAa//B,KAAKigC,SAASE,UAsF9E,OAnFAN,EAAYh+B,UAAU2D,KAAO,WACzB,OAAQxF,KAAKkgC,aAAelgC,KAAKkgC,YAAY16B,MAASxF,KAAK+/B,aAG/DF,EAAYh+B,UAAU4qB,WAAa,WAC/B,OAAOzsB,KAAK+/B,aAGhBF,EAAYh+B,UAAUuM,OAAS,WAC3B,OAAOpO,KAAKggC,SAGhBH,EAAYh+B,UAAU4W,OAAS,WAC3B,OAAOzY,KAAKkgC,aAGhBL,EAAYh+B,UAAU4L,MAAQ,WAC1B,OAAOzN,KAAKkgC,aAAelgC,KAAKkgC,YAAYxyB,MAGhDmyB,EAAYh+B,UAAU1B,QAAU,WAC5B,OAAOH,KAAKigC,UAGhBJ,EAAYh+B,UAAUu+B,OAAS,WAC3B,SAAUpgC,KAAKkgC,cAAelgC,KAAKkgC,YAAYxyB,OAGnDmyB,EAAYh+B,UAAUw+B,MAAQ,WAC1B,OAAQrgC,KAAKqF,SAGjBw6B,EAAYh+B,UAAUwD,MAAQ,WAC1B,IAAIq3B,EAAO18B,KAAKG,UAAUggC,SAC1B,IAAKngC,KAAKkgC,aAAiBxD,EAAM,CAC7B,IAAIF,EAAYE,EAAKl3B,KAAOk3B,EAAKl3B,KAAOk3B,EACxC,MAAO,sBAAwB18B,KAAKwF,OAAS,iBAAmBg3B,EAAY,IAEhF,OAAKx8B,KAAKkgC,YAELlgC,KAAKkgC,YAAYxyB,UAAtB,EACW,UAAY1N,KAAKwF,OAAS,8BAF1B,kBAAoBxF,KAAKwF,OAAS,KAIjDq6B,EAAYh+B,UAAUiT,SAAW,WAC7B,MAAO,IAAM9U,KAAKwF,OAAS,KAAM,QAAUxF,KAAKoO,WAQpDyxB,EAAYh+B,UAAUy+B,UAAY,SAAU7yB,GACxC,OAAO,IAAIoyB,EAAY7/B,KAAK8/B,eAAgBryB,EAAOzN,KAAKggC,QAAShgC,KAAKigC,WAS1EJ,EAAYh+B,UAAU0+B,WAAa,SAAUnyB,EAAQ2G,QACjC,IAAZA,IAAsBA,GAAU,GACpC,IAAI8d,EAAY9d,EAAU3G,GAAS,QAAO,GAAIpO,KAAKggC,QAAS5xB,GAC5D,OAAO,IAAIyxB,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAalN,EAAW7yB,KAAKigC,WASlFJ,EAAYh+B,UAAU2+B,YAAc,SAAUrgC,EAAS4U,QACnC,IAAZA,IAAsBA,GAAU,GACpC,IAAI0rB,EAAU1rB,EAAU5U,GAAU,QAAO,GAAIH,KAAKigC,SAAU9/B,GAC5D,OAAO,IAAI0/B,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAa//B,KAAKggC,QAASS,IAGhFZ,EAAYa,MAAQ,SAAUzmB,GAC1B,OAAOA,GAAOA,EAAIxM,SAAU,QAASwM,EAAIxM,SAAW,QAASwM,EAAIxM,SAAU,QAASwM,EAAIxM,MAAMjI,QAE3Fq6B,EA3GqB,iYCf5Bc,EAA6B,WAC7B,SAASA,EAAY1U,GACjBjsB,KAAKisB,WAAaA,EA2EtB,OAzEA0U,EAAY9+B,UAAU++B,mBAAqB,SAAUC,GACjD,IAAI1wB,EAAQnQ,KAEZ,OADmBA,KAAKisB,WAAWvX,OAAOoY,kBACtB9iB,WACf82B,WAAWD,GACXlyB,KAAI,SAAUO,GAAQ,OAAOiB,EAAM4wB,WAAW7xB,MAC9CN,OAAO,KAAS,IAChBtF,OAAO,OAWhBq3B,EAAY9+B,UAAUk/B,WAAa,SAAUC,GACzC,IAAI/U,EAAajsB,KAAKisB,WAClBvd,EAAcud,EAAWvd,cAEzBuyB,EAAgBjhC,KAAKkhC,iBAAiBF,EAAUtyB,EAAaud,GACjE,IAAKgV,EACD,MAAO,GACX,IA4DWE,EA5DPC,EAAkB,CAClBnV,WAAYA,EACZnG,QAASmG,EAAW9rB,UAAU2lB,SAkBlC,OAAOmb,EACFtyB,KAjBqB,SAAUkF,GAMhC,OAJcA,EAAKqP,QAAQxU,EAAaud,GAEZ+U,EAASK,kBAAkB77B,MAElCmJ,KAAI,SAAUJ,GAC/B,IAAI0xB,GAAW,QAAO,CAClB38B,KAAMuQ,EAAKvQ,KACXg+B,UAAW,CAAEN,SAAUA,EAASx7B,KAAMqL,QAAStC,IAChD6yB,GACC3zB,EAAQuzB,EAASK,kBAAkBv+B,QAAU,UAA4ByL,EAAKd,MAAMC,KAAO,KAC3F6zB,EAAiB,IAAI,IAAetV,EAAYxe,EAAOoG,EAAMosB,GACjE,MAAO,CAAEpsB,KAAMA,EAAMtF,KAAMA,EAAMgzB,eAAgBA,SAKpD3yB,OAAO,KAAS,IAChB4c,MAqCM2V,EArCSH,EAASQ,iBAsCR,IAArBL,IAA+BA,GAAmB,GAC/C,SAA+B1O,EAAGlV,GACrC,IAAIkkB,EAASN,GAAoB,EAAI,EACjCO,GAAcjP,EAAElkB,KAAKd,MAAMtF,KAAKiH,OAASmO,EAAEhP,KAAKd,MAAMtF,KAAKiH,QAAUqyB,EACzE,OAAsB,IAAfC,EAAmBA,EAAankB,EAAE1J,KAAKzM,SAAWqrB,EAAE5e,KAAKzM,YAzC3DuH,KAAI,SAAU8E,GAAS,OAAOA,EAAM8tB,mBAa7CZ,EAAY9+B,UAAUq/B,iBAAmB,SAAUF,EAAUtyB,EAAaud,GACtE,IAAI0V,EAAWX,EAASY,YAAc,WAElC/6B,EAAe7G,KAAKisB,WAAWvX,OAAOoY,kBAE1C,OADiB6U,EAAW,CAAC96B,GAAgB,CAAC7G,KAAKisB,WAAYplB,IAE1D8H,KAAI,SAAUkzB,GAAO,OAAOA,EAAIC,SAASd,EAASx7B,SAClD8D,QAAO,QAAgB,KAAS,uBAAyB03B,EAASx7B,OAClEoJ,OAAO,KAAS,IAChBtF,QAAO,SAAUuK,GAAQ,OAAOA,EAAKqP,QAAQxU,EAAaud,OAE5D0U,EA7EqB,+PCDzB,SAASoB,EAAWt0B,EAAOu0B,EAAW/V,GACzC,IAAIgW,GAAU,QAASD,GAAa,CAACA,GAAaA,EAYlD,UADe,QAAWC,GAAWA,EAVrC,SAAoBhV,GAEhB,IADA,IAAIiV,EAAcD,EACT5kB,EAAI,EAAGA,EAAI6kB,EAAY9yB,OAAQiO,IAAK,CACzC,IAAIwF,EAAO,IAAI,KAAKqf,EAAY7kB,IAChC,GAAKwF,GAAQA,EAAKK,QAAQ+J,EAAOznB,QAAYqd,GAAQqf,EAAY7kB,KAAO4P,EAAOznB,KAC3E,OAAO,EAGf,OAAO,IAGMiI,EAAOwe,GAK5B,IAAIkW,EAAgC,WAChC,SAASA,EAAeC,EAASC,EAAW7hC,EAAU8hC,EAAeC,EAAwBpiC,QACzE,IAAZA,IAAsBA,EAAU,IACpCH,KAAKoiC,QAAUA,EACfpiC,KAAKqiC,UAAYA,EACjBriC,KAAKQ,SAAWA,EAChBR,KAAKsiC,cAAgBA,EACrBtiC,KAAKuiC,uBAAyBA,EAC9BviC,KAAKwiC,YAAc,EACnBxiC,KAAKyiC,eAAgB,EACrBziC,KAAKoH,SAAWjH,EAAQiH,UAAY,EACpCpH,KAAKsD,KAAOnD,EAAQmD,MAAQ,KAC5BtD,KAAK0iC,YAAcviC,EAAQuiC,YAqF/B,OApEAP,EAAetgC,UAAU8gC,eAAiB,SAAUC,EAAOZ,EAAW/V,GAClE,IAAkB,IAAd+V,EACA,OAAOY,EACX,IAAIpN,EAAWoN,EAAMt5B,QAAO,SAAUiF,GAAQ,OAAOwzB,EAAWxzB,EAAKd,MAAOu0B,EAAW/V,MACvF,OAAOuJ,EAASpmB,OAASomB,EAAW,MAgBxC2M,EAAetgC,UAAUghC,yBAA2B,WAChD,OAAO,QAAO7iC,KAAKoiC,QAAQp4B,WAAW84B,iBAAiB,WAAc,OAAO,MAiBhFX,EAAetgC,UAAUkhC,kBAAoB,SAAUr0B,EAAaud,GAChE,IAAI9b,EAAQnQ,KACR8P,GAAW,QAAO9P,KAAK6iC,2BAA4B7iC,KAAKsiC,eAE5D,OADY,QAAOtiC,KAAKoiC,QAAQp4B,WAAW84B,iBAC9Bl0B,QAAO,SAAUo0B,EAAIC,GAG9B,IAAIC,EAAcD,EAASngC,QAAU,UACjCqF,EAAOuG,EAAYu0B,EAASz9B,OAAS,GACrCo9B,EAAQM,EAAc/6B,EAAO,EAAC,QAAKA,IAEvC,OADA66B,EAAGC,EAASz9B,MAAQ2K,EAAMwyB,eAAeC,EAAO9yB,EAASmzB,EAASz9B,MAAOymB,GAClE+W,IACR,KAQPb,EAAetgC,UAAUqhB,QAAU,SAAUxU,EAAaud,GACtD,IAAI/I,EAAUljB,KAAK+iC,kBAAkBr0B,EAAaud,GAGlD,OADiB,QAAO/I,GAASigB,MAAM,MACnBjgB,EAAU,MAElCif,EAAetgC,UAAU28B,WAAa,WAClCx+B,KAAKuiC,uBAAuBviC,MAC5BA,KAAKyiC,eAAgB,GAElBN,EAjGwB,GAqG5B,SAASiB,EAAUtP,EAAUhH,EAAmBuV,GAEnD,IACIgB,GADoBvP,EAASwP,iBAAmBxP,EAASwP,kBAAoB,IACnDjB,EAAU78B,MAAQ,GAC5C+9B,GAAe,QAAWF,GAG9B,SAASG,EAAmBC,EAAajjC,EAAUL,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAI6pB,EAAiB,IAAImY,EAAerV,EAAmBuV,EAAW7hC,EAAUijC,EAAaF,EAAcpjC,GAE3G,OADAkjC,EAAM5iC,KAAKupB,GACJA,EAAewU,WAAWl7B,KAAK0mB,GAE1C,OAPA8J,EAASuO,EAAU78B,MAAQg+B,EAOpBA,2FCpJX,IAAIE,EAQAC,2BAPJ,SAAWD,GACPA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAAyB,IAAI,GAAK,MACtDA,EAAoBA,EAA6B,QAAI,GAAK,UAC1DA,EAAoBA,EAA2B,MAAI,GAAK,QAL5D,CAMGA,IAAwBA,EAAsB,KAEjD,SAAWC,GACPA,EAAoBA,EAAgC,WAAI,GAAK,aAC7DA,EAAoBA,EAA2B,MAAI,GAAK,QAF5D,CAGGA,IAAwBA,EAAsB,8HCP7CC,2LACJ,SAAWA,GAOPA,EAAWA,EAAuB,WAAI,GAAK,aAM3CA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAoB,QAAI,GAAK,UAWxCA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAkB,MAAI,GAAK,QApC1C,CAqCGA,IAAeA,EAAa,KAG/B,IAAIv4B,EAAK,EACLw4B,EAA2B,WAC3B,SAASA,EAAU30B,EAAM40B,EAASC,GAE9B/jC,KAAKmb,IAAM9P,IACXrL,KAAKkP,KAAOA,EACZlP,KAAK8jC,QAAUA,EACf9jC,KAAK+jC,OAASA,EA4DlB,OAzDAF,EAAUG,mBAAqB,SAAU/pB,GACrC,OAAOA,GAA2B,mBAAbA,EAAIlP,OAAuB,IAAAmO,IAAG2qB,EAAH,CAAc5pB,EAAIyN,uBAGtEmc,EAAUI,WAAa,SAAUF,EAAQ5jC,GACrC,IACI+jC,EAAY,IAAIL,EAAUD,EAAWO,WAD3B,+DACgDJ,GAI9D,OAHI5jC,GAAWA,EAAQikC,aACnBF,EAAUE,YAAa,GAEpBF,GAGXL,EAAUO,WAAa,SAAUL,GAC7B,OAAOF,EAAUI,WAAWF,EAAQ,CAAEK,YAAY,KAGtDP,EAAUQ,QAAU,SAAUN,GAE1B,OAAO,IAAIF,EAAUD,EAAWU,QADlB,6BACoCP,IAGtDF,EAAUzK,QAAU,SAAU2K,GAE1B,OAAO,IAAIF,EAAUD,EAAWW,QADlB,6BACoCR,IAGtDF,EAAUW,QAAU,SAAUT,GAE1B,OAAO,IAAIF,EAAUD,EAAWa,QADlB,kCACoCV,IAGtDF,EAAUa,QAAU,SAAUX,GAE1B,OAAO,IAAIF,EAAUD,EAAWe,MADlB,yBACkCZ,IAWpDF,EAAUe,UAAY,SAAUb,GAC5B,OAAO,IAAA7qB,IAAG2qB,EAAH,CAAcE,GAAUA,EAASF,EAAUa,QAAQX,IAE9DF,EAAUhiC,UAAUiT,SAAW,WAC3B,IAA6BqkB,EACzB4K,GADyB5K,EACHn5B,KAAK+jC,SADgB5K,EAAErkB,WAAavB,OAAO1R,UAAUiT,SAAWqkB,EAAErkB,YAAa,QAAUqkB,GAE/G9N,EAAKrrB,KACT,MAAO,6BADcqrB,EAAGlQ,IACoB,UADRkQ,EAAGnc,KACwB,cADRmc,EAAGyY,QAC+B,aAAeC,EAAS,KAErHF,EAAUhiC,UAAUgjC,UAAY,WAC5B,OAAO,SAAO,QAAgB7kC,MAAO,CAAE0nB,qBAAsB1nB,QAE1D6jC,EAlEmB,oMC1C1BiB,EAEA,SAA6Bt/B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QACpG,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5CllC,KAAKwF,KAAOA,EACZxF,KAAK4hC,UAAYA,EACjB5hC,KAAK+kC,UAAYA,EACjB/kC,KAAKqhC,kBAAoBA,EACzBrhC,KAAKwhC,YAAcA,EACnBxhC,KAAKglC,iBAAmBA,EACxBhlC,KAAKilC,gBAAkBA,EACvBjlC,KAAKklC,YAAcA,gsBCVvBC,EAAiB,CACjBrf,QAAS,KACTmG,WAAY,KACZqV,UAAW,GACXh+B,KAAM,MAEN8hC,EAAgC,WAChC,SAASA,EAAenZ,EAAYoZ,EAAcrb,EAAgB7pB,GAC9D,IAAIgQ,EAAQnQ,KACZA,KAAKisB,WAAaA,EAClBjsB,KAAKqlC,aAAeA,EACpBrlC,KAAKgqB,eAAiBA,EACtBhqB,KAAKG,QAAUA,EACfH,KAAKslC,aAAe,WAAc,OAAOn1B,EAAMjB,KAAK0yB,YAAc,UAA4BzxB,EAAMhQ,QAAQ8rB,WAAWsZ,YACvHvlC,KAAKG,SAAU,QAASA,EAASglC,GACjCnlC,KAAKkP,KAAO8a,EAAeqY,UAyK/B,OArJA+C,EAAenJ,MAAQ,SAAUoH,EAAOmC,GAGpC,OAAOnC,EAAMz0B,QADU,SAAU8vB,EAAM+G,GAAY,OAAO/G,EAAK3zB,MAAK,WAAc,OAAO06B,EAASC,kBAC5DF,GAAW,gBAarDJ,EAAeO,YAAc,SAAUtC,EAAOuC,GAC1C,IAAK,IAAI32B,EAAM,EAAGA,EAAMo0B,EAAMj0B,OAAQH,IAAO,CACzC,IAAIib,EAAamZ,EAAMp0B,GAAKy2B,aAC5B,IAAI,QAAUxb,GAAa,CACvB,IAAI2b,EAAiBxC,EAAMvhC,MAAMmN,EAAM,GACvC,OAAOm2B,EAAenJ,MAAM4J,EAAgB3b,GAAYnf,KAAK66B,IAGrE,OAAOA,KAKXR,EAAeU,YAAc,SAAUzC,GACnCA,EAAMtiC,SAAQ,SAAU8S,GAAQ,OAAOA,EAAK6xB,iBAEhDN,EAAevjC,UAAUkkC,SAAW,SAAU7Y,GAC1CltB,KAAKisB,WAAWvX,OAAOmC,aAAamvB,qBAApChmC,CAA0DktB,IAE9DkY,EAAevjC,UAAU6jC,WAAa,WAClC,IAAIv1B,EAAQnQ,KACR6T,EAAO7T,KAAKgqB,eAChB,IAAInW,EAAK4uB,cAAT,CAEA,IAAIwD,EAAajmC,KAAKkmC,yBACtB,GAAID,EACA,OAAOA,EACX,IAAI9lC,EAAUH,KAAKG,QACnB,yBAA0BH,KAAMA,KAAKisB,WAAY9rB,GACjD,IAEIgmC,EAAc,SAAUjZ,GAAO,OAAOrZ,EAAKwuB,UAAU4C,gBAAgB90B,EAA/B0D,CAAsCqZ,IAC5EkZ,EAAe,SAAU9/B,GAAU,OAAOuN,EAAKwuB,UAAU2C,iBAAiB70B,EAAhC0D,CAAuCvN,IACrF,IACI,IAAIA,EALkCuN,EAAKrT,SAASuB,KAAK5B,EAAQmD,KAAM6M,EAAM8b,WAAY9b,EAAMk1B,cAM/F,OAAKrlC,KAAKkP,KAAKg2B,cAAe,QAAU5+B,GAC7BA,EAAO+b,OANH,SAAU6K,GAAO,OAAO,cAAoBA,GAAK2X,eAM1B95B,KAAKq7B,EAAcD,GAG9CC,EAAa9/B,GAG5B,MAAO4mB,GAEH,OAAOiZ,EAAY,cAAoBjZ,IAE3C,QACQrZ,EAAK6uB,eAAiB7uB,EAAK2uB,aAAe3uB,EAAK6uB,aAC/C7uB,EAAK2qB,gBAajB4G,EAAevjC,UAAUwkC,iBAAmB,SAAU//B,GAClD,IAAI6J,EAAQnQ,KAEZ,OADiBA,KAAKkmC,4BAIlB,QAAU5/B,GAEHA,EAAOyE,MAAK,SAAU/G,GAAO,OAAOmM,EAAMk2B,iBAAiBriC,OAEtE,qBAAsBsC,EAAQtG,KAAKisB,WAAYjsB,KAAKG,UAErC,IAAXmG,EAEO,YAAkB,2BAA2Bu+B,aAEpC,IAAA3rB,IAAG,IAEnBotB,CAAchgC,GAEP,eAAqBA,GAAQu+B,iBAFxC,KASJO,EAAevjC,UAAUqkC,uBAAyB,WAC9C,IAAIxxB,EAAS1U,KAAKisB,WAAWvX,OAE7B,OAAIA,EAAOqkB,UACA,YAAkB,sBAAwBrkB,EAAOyG,IAAM,gCAAgC0pB,YAE9F7kC,KAAKisB,WAAWsa,SACT,cAAoB1B,YAI3B7kC,KAAKslC,eAEE,eAAqBtlC,KAAKG,QAAQ2lB,WAAW+e,iBAFxD,GAKJO,EAAevjC,UAAUiT,SAAW,WAChC,IAAe3U,EAANH,KAAmBG,QAAS6pB,EAA5BhqB,KAAgDgqB,eACrDzpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAWwkB,EAAexpB,UAC/M,OAAOD,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,IAMlE4/B,EAAeoB,cAAgB,SAAU3yB,GAAQ,OAAO,SAAUvN,GAC9D,OAAOuN,EAAKwyB,iBAAiB//B,KAMjC8+B,EAAeqB,oBAAsB,SAAU5yB,GAAQ,OAAO,SAAUvN,IACpE,QAAUA,IAAWA,EAAO+b,OAAM,SAAU6K,GAAO,OAAOrZ,EAAKkyB,SAAS,cAAoB7Y,SAOhGkY,EAAesB,UAAY,SAAU7yB,GAAQ,OAAO,SAAUxO,GAAS,OAAOwO,EAAKkyB,SAAS1gC,KAC5F+/B,EAAeuB,aAAe,SAAU9yB,GAAQ,OAAO,SAAUxO,GAAS,OAAO,QAAgBA,KACjG+/B,EAAewB,YAAc,SAAU/yB,GAAQ,OAAO,SAAUxO,GAC5D,MAAMA,IAEH+/B,EAlLwB,qgBCXnC,SAASyB,EAAmBj3B,GACxBA,EAAMk3B,cAAc,cAAoB,IAAUl3B,EAAM8E,QAAS,IACjE9E,EAAMk3B,cAAc,cAAoB,IAAYl3B,GAAQ,IAC5DA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,GAAQ,IAChEA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,EAAMxB,UAAW,IACzEwB,EAAMuc,WAAWprB,SAAQ,SAAU0M,GAC/BmC,EAAMk3B,cAAc,cAAoB,UAAWr5B,GAAQA,MAG5D,IAGHs5B,EAAoB,CAAC,eAAgB,KACrCC,GAAe,QAAQD,GAKhBE,EAAqB,SAAUr3B,GACtC,IAAIgzB,GAAQ,QAAOhzB,EAAMlB,eAAeE,OAAO,KAAS,IAAIA,OAAO,KAAO,IAEtEs4B,EAA4B,SAAU3pB,GACtC,OAAOypB,EAAazpB,EAAEgE,OAAS,cAAoBhE,EAAEgE,MAAO,MAAQhE,GAExEqlB,EAAM7hC,SAAQ,SAAUwN,GACpBA,EAAKwJ,YAAcxJ,EAAKwJ,YAAYpJ,IAAIu4B,+MCnB5CC,EAAiB,SAAUv3B,GAC3B,IAAIw3B,EAAWx3B,EAAMuf,KAAKkY,WAC1B,GAAKD,EAAL,CAEA,IAAI3uB,EAAS7I,EAAM8E,OAAOmC,aAW1B,OAAI,QAAWuwB,GACJ,YAAiBA,EAASx3B,IAAQ7E,KAAKq7B,GAE3CA,EAAagB,GAbpB,SAAShB,EAAa9/B,GAClB,GAAKA,EAEL,OAAIA,aAAkB,IACXA,GACP,QAASA,GACFmS,EAAOpS,OAAOC,EAAQsJ,EAAMxB,SAAUwB,EAAMzP,WACnDmG,EAAc,OAAKA,EAAe,OAC3BmS,EAAOpS,OAAOC,EAAc,OAAKsJ,EAAMuf,KAAM7oB,EAAe,QAAKsJ,EAAMxB,SAAUwB,EAAMzP,gBADlG,IChBR,SAASmnC,EAAwB3zB,GAC7B,OAAO,SAAUsY,EAAYxe,GAGzB,OAAO85B,EAFM95B,EAAMuG,UACCL,IACNsY,EAAYxe,IAYlC,IAAI+5B,EAAaF,EAAwB,UAarCG,EAAeH,EAAwB,YAavCI,EAAcJ,EAAwB,2MC7C/BK,EAAwB,IAU/BC,EAAmB,SAAUh4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,QAAS9nB,GAAO7E,KAAK,OAcnF88B,EAAmB,SAAUj4B,EAAOnC,GACpC,OAAO,IAAI,IAAemC,EAAMlB,cAAcygB,IAAIpb,WAAWtG,EAAMuG,WAAW0jB,YAAY,OAAQ9nB,GAAO7E,KAAK,OAe9G+8B,EAAmB,SAAUl4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,OAAQ9nB,GAAO7E,KAAK,OCnClFg9B,EAAoB,SAAU9b,GAC9B,IAAIllB,EAAK,OACLihC,EAAgB/b,EAAWzR,MAAM,YACrC,GAAKwtB,EAAc54B,OAEnB,OAAOrI,EAAG0U,IAAIusB,EAAcr5B,KAAI,SAAUmL,GAAQ,OAAO/S,EAAGkJ,KAAK6J,EAAKuB,YAAatQ,KAAK,OAexFk9B,EAAgB,SAAUhc,GAC1B,IAAI+b,EAAgB/b,EAAWzR,MAAM,YACjC0tB,EAAejc,EAAWzR,MAAM,WACpC,GAAKwtB,EAAc54B,QAAW84B,EAAa94B,OAA3C,CAEA,IAAItI,EAAQmlB,EAAWvX,OAAOqC,YAC9BmxB,EAAannC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMshC,qBAAqBD,MACvEH,EAAcjnC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMuhC,mBAAmBF,MACtErhC,EAAM8lB,SCzBN0b,EAAoB,SAAU14B,GAC9B,IAAI0I,EAAU1I,EAAM8E,OAAO4D,QAOvBiwB,EAAyB,WAErBjwB,EAAQ2T,aAAerc,IACvB0I,EAAQ2T,WAAa,OAE7Brc,EAAM7B,UAAU,IAXW,WACvBuK,EAAQ0T,sBAAsBxG,QAAQ5V,GACtC0I,EAAQwa,SAAWljB,EAAMmjB,MACzBza,EAAQwN,QAAUxN,EAAQwa,SAASplB,MACnC,QAAKkC,EAAMxB,SAAUkK,EAAQlK,UAOS,CAAEhH,SAAU,MACtDwI,EAAMnM,QAAQsH,KAAKw9B,EAAwBA,ICtB3CC,EAAY,SAAUvc,GACtB,IAAI9rB,EAAU8rB,EAAW9rB,UACrBsY,EAASwT,EAAWvX,OAAOmC,aAC3B6B,EAAauT,EAAWvX,OAAOyH,UAKnC,GAAuB,QAAnBhc,EAAQ4e,QAAoB5e,EAAQ0V,UAAY4C,EAAOqa,SAASsH,UAAW,CAC3E,IAAIqO,EAAa,CAAE1zB,QAA8B,YAArB5U,EAAQ0V,UACpC6C,EAAWjY,KAAKgY,EAAOqa,SAASsH,UAAU3oB,IAAKgH,EAAOrK,OAAQq6B,GAElE/vB,EAAW0D,QAAO,kWCPtB,SAASssB,EAAY94B,GACjB,IAAI+4B,EAAgB/4B,EAAMg5B,iBAC1B,GAAKD,EAAL,CAEAtgC,EAAA,0BAA6BuH,GAC7B,IAAIi5B,EAAUj5B,EAAM8E,OAAO4D,QAAQ2T,WAOnC,MAHsB,kBAAlB0c,GAAqCE,GACrCA,EAAQC,QAEL,cAAoBjE,aCf/B,SAASkE,EAAsBn5B,GAC3B,IAAKA,EAAMywB,QACP,MAAM,IAAI5tB,MAAM7C,EAAMvK,QAAQyP,YAG/B,ICaIk0B,EAAmB,CAC1BnzB,UAAU,EACVsqB,SAAU,KACV/gB,SAAS,EACT6pB,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,OAAQ,GACRtjB,QAAS,WAAc,OAAO,MAC9B/G,OAAQ,WAaRsqB,EAAmC,WAEnC,SAASA,EAAkBC,GAEvBtpC,KAAKupC,iBAAmB,EAExBvpC,KAAKwpC,YAAc,GAEnBxpC,KAAKsjC,iBAAmB,GAExBtjC,KAAKypC,eAAiB,GACtBzpC,KAAKspC,QAAUA,EACftpC,KAAK8G,MAAQwiC,EAAQvyB,YACrB/W,KAAK0pC,mBAAqB,GAC1B1pC,KAAKgK,YAAc,SAAqB,QAAIhK,MAAO,IAAI,QAAIA,MAAO,CAC9D,kBACA,eACA,gBACA,aACA,aAEJA,KAAK2pC,mBACL3pC,KAAK4pC,oBACL5pC,KAAK6pC,+BACLP,EAAQhxB,QAAQ0T,sBAAsBzG,QAAQ0hB,GAuLlD,OA9JAoC,EAAkBxnC,UAAUioC,SAAW,SAAUh6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkO,SAAW,SAAUD,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkoC,QAAU,SAAUj6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUmoC,OAAS,SAAUl6B,EAAUtP,EAAUL,KAInEkpC,EAAkBxnC,UAAUooC,SAAW,SAAUn6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUqoC,QAAU,SAAUp6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUsoC,SAAW,SAAUr6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkM,UAAY,SAAU+B,EAAUtP,EAAUL,KAItEkpC,EAAkBxnC,UAAUuoC,QAAU,SAAUt6B,EAAUtP,EAAUL,KAOpEkpC,EAAkBxnC,UAAUqT,QAAU,SAAUR,IAC5C,QAAO1U,KAAKsjC,kBAAkBviC,SAAQ,SAAUspC,GAC5C,OAAOA,EAAWtpC,SAAQ,SAAU8S,GAChCA,EAAK4uB,eAAgB,GACrB,QAAW4H,EAAYx2B,UAenCw1B,EAAkBxnC,UAAUL,OAAS,SAAUyyB,EAAUzH,GACrD,OAAO,IAAI,IAAWyH,EAAUzH,EAAaxsB,KAAKspC,UAGtDD,EAAkBxnC,UAAU+nC,kBAAoB,WAC5C,IAAIU,EAAQ,IACRC,EAAK,IACLC,EAAQxqC,KAAKypC,eACbgB,GAAc,EACdC,GAAc,EAClB1qC,KAAK2qC,aAAa,WAAYL,EAAMM,OAAQ,EAAGJ,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG3D,YAAa8D,GAC9G1qC,KAAK2qC,aAAa,WAAYL,EAAMO,OAAQ,EAAGL,EAAMrb,IACrDnvB,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,EAAGN,EAAMrb,IACjDnvB,KAAK2qC,aAAa,SAAUL,EAAMQ,IAAK,IAAKN,EAAMv8B,SALV,GAMxCjO,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrV,UACpDn1B,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,IAAKN,EAAMre,UACnDnsB,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrb,IACpDnvB,KAAK2qC,aAAa,YAAaL,EAAMS,QAAS,EAAGP,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,GAC9G1qC,KAAK2qC,aAAa,UAAWL,EAAM3F,MAAO,EAAG6F,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,IAG9GrB,EAAkBxnC,UAAU8nC,iBAAmB,WAC3C,IAAIqB,EAAQ,UAA2BrhB,EAAa,eACpD3pB,KAAKirC,gBAAgB,KAAMthB,GAC3B3pB,KAAKirC,gBAAgB,OAAQthB,GAC7B3pB,KAAKirC,gBAAgB,UAAWD,GAChChrC,KAAKirC,gBAAgB,WAAYD,GACjChrC,KAAKirC,gBAAgB,WAAYD,IAGrC3B,EAAkBxnC,UAAU8oC,aAAe,SAAUnlC,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QAC5H,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5C,IAAI7C,EAAY,IAAI,IAAoB78B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,GACvIllC,KAAKwpC,YAAY/oC,KAAK4hC,IACtB,QAAUriC,KAAMA,KAAMqiC,IAG1BgH,EAAkBxnC,UAAUi/B,WAAa,SAAUD,GAI/C,QAH0B,QAAUA,GAC9B7gC,KAAKwpC,YAAYlgC,QAAO,SAAU4F,GAAQ,OAAOA,EAAK0yB,YAAcf,KACpE7gC,KAAKwpC,YAAY1nC,SACI0pB,MAAK,SAAUiH,EAAGlV,GACzC,IAAI2tB,EAAazY,EAAEmP,UAAYrkB,EAAEqkB,UACjC,OAAsB,IAAfsJ,EAAmBzY,EAAEsS,UAAYxnB,EAAEwnB,UAAYmG,MAgB9D7B,EAAkBxnC,UAAUopC,gBAAkB,SAAUzlC,EAAM2lC,GAC1DnrC,KAAKypC,eAAejkC,GAAQ,CAAEA,KAAMA,EAAM1C,MAAOqoC,IAIrD9B,EAAkBxnC,UAAUihC,cAAgB,WACxC,OAAO9iC,KAAKypC,gBAGhBJ,EAAkBxnC,UAAUigC,SAAW,SAAUnuB,GAC7C,OAAO3T,KAAKsjC,iBAAiB3vB,IAGjC01B,EAAkBxnC,UAAUgoC,6BAA+B,WACvD,IAAIuB,EAAMprC,KAAK0pC,mBACf0B,EAAIC,gBAA6CrrC,KTzN5B8pC,SAAS,GAAIjD,GS0NlCuE,EAAIhS,QAAwCp5B,KF/MvB+P,SAAS,GAAI24B,EAAa,CAAEthC,UAAW,OEgN5DgkC,EAAI/G,QD7N+B,SAAUvX,GACjD,OAAOA,EAAkB/c,SAAS,GAAIg5B,EAAuB,CAAE3hC,UAAW,MC4NxDkkC,CAA8BtrC,MAE5CorC,EAAI/D,WR7MwB,SAAUva,GAC1C,OAAOA,EAAkBid,QAAQ,CAAE5a,GAAI,SAAU1hB,GAAS,QAASA,EAAM45B,aAAiBF,GQ4MrEoE,CAAuBvrC,MAExCorC,EAAIpB,OPtNoB,SAAUld,GACtC,OAAOA,EAAkBkd,OAAO,CAAE/7B,QAAS,SAAUR,GAAS,QAASA,EAAMu8B,SAAaxC,GOqNzEgE,CAAmBxrC,MAChCorC,EAAInB,SP1MsB,SAAUnd,GACxC,OAAOA,EAAkBmd,SAAS,CAAE9U,SAAU,SAAU1nB,GAAS,QAASA,EAAMw8B,WAAexC,GOyM5EgE,CAAqBzrC,MACpCorC,EAAIlB,QP9LqB,SAAUpd,GACvC,OAAOA,EAAkBod,QAAQ,CAAE/d,SAAU,SAAU1e,GAAS,QAASA,EAAMy8B,UAAcxC,GO6L3EgE,CAAoB1rC,MAElCorC,EAAIO,aNjO0B,SAAU7e,GAC5C,OAAOA,EAAkBid,QAAQ,GAAInC,EAAkB,CAAExgC,SAAUugC,IMgO5CiE,CAAyB5rC,MAC5CorC,EAAIS,YNnN0B,SAAU/e,GAC5C,OAAOA,EAAkBod,QAAQ,CAAE/d,UAAU,SAAI,IAAS0b,EAAkB,CAAEzgC,SAAUugC,IMkNlEmE,CAAyB9rC,MAC3CorC,EAAIW,WNpM0B,SAAUjf,GAC5C,OAAOA,EAAkBqd,SAAS,GAAIrC,EAAkB,CAAE1gC,SAAUugC,IMmM/CqE,CAAyBhsC,MAE1CorC,EAAIa,ULpO2B,SAAUnf,GAC7C,OAAOA,EAAkBqd,SAAS,GAAIpC,GKmOlBmE,CAA0BlsC,MAC1CorC,EAAInD,cL9MuB,SAAUnb,GACzC,OAAOA,EAAkB/e,UAAU,GAAIk6B,GK6MfkE,CAAsBnsC,MAE1CorC,EAAIgB,cJ3N2B,SAAUtf,GAC7C,OAAOA,EAAkBgd,SAAS,GAAIxB,GI0Nd+D,CAA0BrsC,MAE9CorC,EAAI5C,UHvOmB,SAAU1b,GACrC,OAAOA,EAAkB/e,UAAU,GAAIy6B,EAAW,CAAEphC,SAAU,OGsO1CklC,CAAkBtsC,MAElCorC,EAAIhf,UAAW,OAAqBpsB,OAEjCqpC,EA/M2B,mSChClCkD,EAA2B,WACV,SAASA,EAA2B73B,GACjD,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKouB,WAAa,IAAI,EAAAiD,WACtBrxB,KAAKkX,eAAgB,EACrBlX,KAAKwsC,oBAAqB,EAC1BxsC,KAAKysC,eAAgB,EACrBzsC,KAAK0sC,sBAAuB,EAC5B1sC,KAAKkV,QAAU,WAAc,OAAO/E,EAAMie,WAAWlZ,WAOtElV,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuE,OAAO2C,eAAe5B,YAUjEzV,KAAK2sC,WAAa,SAAUC,GAAa,OAAOz8B,EAAMuE,OAAO2C,eAAes1B,WAAWC,IAMvF5sC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMuE,OAAO2C,eAAew1B,QAM7D7sC,KAAKqV,UAAY,WAAc,OAAOlF,EAAMuE,OAAO2C,eAAehC,aAMlErV,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMuE,OAAO2C,eAAey1B,QAM7D9sC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMuE,OAAO2C,eAAe01B,YAwFrE,OA1EAR,EAAU1qC,UAAUmrC,gBAAkB,SAAUxoC,GAC5C,OAAQxE,KAAKwsC,oBAAqB,QAAUhoC,GAASA,EAAQxE,KAAKwsC,oBAmBtED,EAAU1qC,UAAUotB,oBAAsB,SAAUzqB,GAChD,IAAI,QAAUA,KAAoB,IAAVA,IAA4B,IAAVA,KAAoB,QAASA,GACnE,MAAM,IAAIiO,MAAM,0BAA4BjO,EAAQ,mDACxD,OAAQxE,KAAK0sC,sBAAuB,QAAUloC,GAASA,EAAQxE,KAAK0sC,sBAcxEH,EAAU1qC,UAAUorC,WAAa,SAAUzoC,GACvC,OAAQxE,KAAKysC,eAAgB,QAAUjoC,GAASA,EAAQxE,KAAKysC,eAgCjEF,EAAU1qC,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACnD,IAAItiB,EAAOlP,KAAKouB,WAAWlf,KAAK1J,EAAMiU,EAAY+X,GAClD,OAAQ,QAAU/X,GAAqBzZ,KAAPkP,GAE7Bq9B,EA1ImB,0SCf1BW,EAAsC,WAStC,OARAA,EAAW35B,OAAO3Q,QAAU,SAASic,GACjC,IAAK,IAAIzB,EAAGC,EAAI,EAAGkD,EAAIve,UAAUoN,OAAQiO,EAAIkD,EAAGlD,IAE5C,IAAK,IAAIwd,KADTzd,EAAIpb,UAAUqb,GACO9J,OAAO1R,UAAUa,eAAeX,KAAKqb,EAAGyd,KACzDhc,EAAEgc,GAAKzd,EAAEyd,IAEjB,OAAOhc,IAEK1c,MAAMnC,KAAMgC,YAK5BmrC,EAA8B,WAC9B,SAASA,EAAaz4B,GAClB1U,KAAK0U,OAASA,EAWlB,OATAy4B,EAAatrC,UAAU+O,WAAa,SAAUvF,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE9E0/B,EAAatrC,UAAUoyB,SAAW,SAAU5oB,EAAI6D,EAAMzB,GAClD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,KAAcntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE5E0/B,EAAatrC,UAAUurC,WAAa,SAAU/hC,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAEvE0/B,EAbsB,GAsB7BE,EAAmC,WAEnC,SAASA,EAAmC34B,GACxC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAEd1U,KAAK07B,aAAe,IAAIyR,EAAantC,KAAK0U,QAE1C1U,KAAKstC,WAAa,IAClBttC,KAAKqtB,MAAQ,EAAAA,MAEbrtB,KAAKgtC,gBAAkB,SAAUxoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAOyhC,gBAAgBxoC,IAEhGxE,KAAKivB,oBAAsB,SAAUzqB,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0jB,oBAAoBzqB,IAExGxE,KAAKitC,WAAa,SAAUzoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0hC,WAAWzoC,IAEtFxE,KAAKkP,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpC,OAAOrhB,EAAMuE,OAAOuC,WAAW1L,OAAO2D,KAAK1J,EAAMiU,EAAY+X,IAAiBrhB,GA+CtF,OArCAk9B,EAAkBxrC,UAAUwF,QAAU,SAAUid,EAAS/Y,GACrD,IAAI+hB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAEnC6C,EAAS7C,IAAWA,EAAOkC,OAASlC,EAAO6C,OAC/C7C,EAAS6C,EAAS8+B,EAAS,CAAEz/B,MAAO,CAAEW,OAAQA,IAAY7C,GAAUA,EACpE,IAAIgiC,EAAe,CACfC,OAAQlgB,EAAUmf,cAClBO,gBAAiB1f,EAAUkf,mBAC3BiB,aAAcngB,EAAUpW,eAE5B,OAAO,IAAI,IAAWoN,EAASgJ,EAAUc,WAAYpuB,KAAK07B,cAAc,QAAO6R,EAAchiC,KASjG8hC,EAAkBxrC,UAAUs4B,UAAY,SAAUuT,GAE9C,KAAK,QAASA,GACV,OAAO,EACX,IAAIpnC,GAAS,EAKb,OAJA,QAAQ,eAAsB,SAAUtC,EAAKwB,IACrC,QAAWxB,KACXsC,EAASA,IAAU,QAAUonC,EAAOloC,MAAU,QAAWkoC,EAAOloC,QAEjEc,GAGX+mC,EAAkBxrC,UAAUnB,KAAO,WAC/B,IAAI4sB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAGvC,OAFA+hB,EAAUc,WAAW5I,SAAU,EAC/B8H,EAAUc,WAAWqD,kBACdzxB,MAEJqtC,EAjE2B,kOCjBlCM,EAA2B,WAE3B,SAASA,EAA2Bj5B,GAChC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAGd1U,KAAK4sB,KAAO,SAAU1W,GAAO,OAAO/F,EAAMuE,OAAOuC,WAAW2V,KAAK1W,IAEjElW,KAAKsc,OAAS,SAAUhH,GAAW,OAAOnF,EAAMuE,OAAOuC,WAAWqF,OAAOhH,IAEzEtV,KAAK+c,eAAiB,SAAU9Q,GAAS,OAAOkE,EAAMuE,OAAOuC,WAAW8F,eAAe9Q,IAEvFjM,KAAKgc,MAAQ,SAAU4xB,GAAY,OAAOz9B,EAAMuE,OAAOuC,WAAW+E,MAAM4xB,IAGxE5tC,KAAKuH,QAAU,SAAUwU,GACrB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMpV,QAAQwU,IAGjD/b,KAAK4c,UAAY,SAAUb,GACvB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMC,UAAUb,IAGnD/b,KAAKw/B,WAAa,SAAUjjB,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAM6iB,WAAWjjB,IAEpFvc,KAAKuc,KAAO,SAAUA,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAMJ,KAAKA,IAExEvc,KAAK2c,MAAQ,WAAc,OAAOxM,EAAMuE,OAAOuC,WAAW0F,MAAMA,SAEhE3c,KAAKwrB,KAAO,SAAUqiB,GAAa,OAAO19B,EAAMuE,OAAOuC,WAAW0F,MAAM6O,KAAKqiB,IAE7E7tC,KAAKiQ,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAAW,OAAOgQ,EAAMuE,OAAOuC,WAAW0F,MAAM1M,KAAKwrB,EAAS1f,EAAS5b,IAC/GH,KAAK6+B,eAAiB,IAAI,IAAenqB,GAyE7C,OAtEAi5B,EAAU9rC,UAAUua,OAAS,SAAU0xB,GACnC,IAAIphB,EAAO1sB,KAAK0U,OAAO0C,gBACnB02B,EACA9tC,KAAK6V,SAAW6W,EAAKjb,MAGrBib,EAAKjb,QAAUzR,KAAK6V,UAExB6W,EAAKjb,IAAIzR,KAAK6V,UAAU,IAY5B83B,EAAU9rC,UAAUpB,KAAO,SAAUstC,EAAY3/B,EAAQjO,GACrD,IAAI4U,EAAU5U,KAAaA,EAAQ4U,QACnC/U,KAAK0U,OAAOuC,WAAWxF,IAAIs8B,EAAWnmB,OAAOxZ,GAAU,IAAK2G,IAqBhE44B,EAAU9rC,UAAUmsC,KAAO,SAAUD,EAAY3/B,EAAQjO,GACrD,IAAIsR,EAAMs8B,EAAWnmB,OAAOxZ,GAC5B,GAAW,MAAPqD,EACA,OAAO,KACXtR,EAAUA,GAAW,CAAE8tC,UAAU,GACjC,IAAIpmC,EAAM7H,KAAK0U,OAAOuC,WAAW1L,OAC7B2iC,EAAUrmC,EAAIwN,YAKlB,GAJK64B,GAAmB,OAARz8B,IACZA,EAAM,IAAM5J,EAAI8kC,aAAel7B,GAEnCA,EA1GR,SAAwBA,EAAKy8B,EAASD,EAAUx4B,GAC5C,MAAiB,MAAbA,EACOhE,EACPy8B,GACO,QAAqBz4B,GAAYhE,EACxCw8B,EACOx4B,EAAS3T,MAAM,GAAK2P,EACxBA,EAmGG08B,CAAe18B,EAAKy8B,EAAS/tC,EAAQ8tC,SAAUpmC,EAAI4N,aACpDtV,EAAQ8tC,WAAax8B,EACtB,OAAOA,EAEX,IAAI28B,GAASF,GAAWz8B,EAAM,IAAM,GAChC48B,EAAUxmC,EAAIilC,OACdA,EAAoB,KAAZuB,GAA8B,MAAZA,EAAkB,GAAK,IAAMA,EAC3D,MAAO,CAACxmC,EAAIklC,WAAY,MAAOllC,EAAIglC,OAAQC,EAAMsB,EAAO38B,GAAKwB,KAAK,KAEtEM,OAAO+6B,eAAeX,EAAU9rC,UAAW,oBAAqB,CAE5D6O,IAAK,WACD,OAAO1Q,KAAK0U,OAAOuC,WAAWoF,mBAElCkyB,YAAY,EACZC,cAAc,IAEXb,EA1GmB,2aCJ1Bc,EAAgC,WAChC,SAASA,EAAe/5B,GACpB1U,KAAK0U,OAASA,EAiKlB,OA/JA+5B,EAAe5sC,UAAUwF,QAAU,SAAU2J,GACzC,OAAOhR,KAAK0U,OAAOE,kBAAkBvN,QAAQ2J,IAEjDy9B,EAAe5sC,UAAUL,OAAS,SAAUsb,EAAMf,GAC9C,IAAI5L,EAAQnQ,KACRy9B,EAAU,YAAqBD,EAAqB,uBACpDkR,GAAW,QAAQ,CACnB,CAAC,KAAU,SAAUC,GAAS,OAAOD,EAASv+B,EAAM9I,QAAQsnC,MAC5D,EAAC,IAAAz1B,IAAG,KAAa,SAAUy1B,GAAS,OAAOx+B,EAAMy+B,eAAeD,EAAO5yB,KACvE,EAAC,IAAAkI,IAAGwZ,EAASD,GAAqB,SAAUmR,GAAS,OAAOx+B,EAAM0+B,UAAUF,EAAOx+B,EAAMuE,UACzF,EAAC,IAAAwE,IAAG/P,QAAS,SAAUwlC,GAAS,OAAOx+B,EAAM2+B,WAAWH,EAAO5yB,KAC/D,CAAC,KAAY,SAAU4yB,GAAS,OAAO,IAAIlyB,EAAYkyB,EAAO5yB,OAE9DQ,EAAOmyB,EAAS5xB,GACpB,IAAKP,EACD,MAAM,IAAI9J,MAAM,4BACpB,OAAO8J,GAsCXkyB,EAAe5sC,UAAU+sC,eAAiB,SAAUb,EAAYhyB,GAC5D,IAAIgzB,EAAWhzB,GACX,QAASA,KACTA,EAAU/b,KAAK0U,OAAOE,kBAAkBvN,QAAQ0U,KAChD,IAAA7C,IAAG,IAAH,CAAe6C,KACfgzB,EAAW,SAAU/yB,GAAS,OAAOD,EAAQ6L,OAAO5L,KAiBxD,IAAIgzB,EAAU,CAAEjB,WAAYA,EAAYkB,cAPxC,SAAuB7gC,GACnB,IAAI8gC,EAAWnB,EAAW1a,aAAa/pB,QAAO,SAAU0F,GAAS,OAAOA,EAAM4f,cAC9E,OAAKsgB,EAAS9/B,OAEA8/B,EAAS5lC,QAAO,SAAU0F,GAAS,OAAOZ,EAAOY,EAAM3D,OACtD+D,OAAS8/B,EAAS9/B,OAFtB,MAIuDF,KAAM,cAC5E,OAAO,QAAO,IAAIuN,GAjBlB,SAA2BhL,GACvB,IAAIrD,EAAS2/B,EAAWtkC,KAAKgI,EAAItJ,KAAMsJ,EAAI09B,OAAQ19B,EAAIqgB,MACvD,OAAOic,EAAWre,UAAUthB,IAAWA,IAeM2gC,GAAWC,IAahEP,EAAe5sC,UAAUgtC,UAAY,SAAUO,EAAa16B,GACxD,IAAIjH,EAAQ,uBAA+B2hC,GAAeA,EAAYp7B,UAAYo7B,EAe9EJ,EAAU,CAAEvhC,MAAOA,EAAOyB,KAAM,SACpC,OAAO,QAAOlP,KAAK4uC,eAAenhC,EAAMgE,KAR1B,SAAUuK,GACpB,IAAIvD,EAAS/D,EAAOmC,aAChByB,EAAU5D,EAAO4D,QACjBG,EAAOu1B,KAAKvgC,EAAOuO,KAAWvD,EAAOu1B,KAAK11B,EAAQwN,QAASxN,EAAQlK,SACnEqK,EAAO42B,aAAa5hC,EAAOuO,EAAO,CAAEoD,SAAS,EAAML,OAAQ,WAIZiwB,IAkC3DP,EAAe5sC,UAAUitC,WAAa,SAAU7rB,EAAQlH,GACpD,GAAIkH,EAAOnF,QAAUmF,EAAOqsB,OACxB,MAAM,IAAI78B,MAAM,4CAMpB,IAIIs8B,GAAW,QAAShzB,GAJJ,SAAUC,GAE1B,OAAOD,EAAQhH,QAAQ,kBAAkB,SAAUC,EAAG8H,GAAQ,OAAOd,EAAe,MAATc,EAAe,EAAIyyB,OAAOzyB,QAEtDf,EAE/CizB,EAAU,CAAE/rB,OAAQA,EAAQ/T,KAAM,UACtC,OAAO,QAAO,IAAIuN,GAFU,SAAUhL,GAAO,OAAOwR,EAAOxZ,KAAKgI,EAAItJ,QAEf4mC,GAAWC,IAEpEP,EAAee,UAAY,SAAUv1B,GAAO,OAAOA,GAAO,CAAC,OAAQ,QAAS,WAAWkpB,OAAM,SAAUt9B,GAAO,OAAO,QAAUoU,EAAIpU,QAC5H4oC,EAnKwB,GA4K/BhyB,EACA,SAAqBT,EAAOD,GACxB,IAAI5L,EAAQnQ,KACZA,KAAKgc,MAAQA,EACbhc,KAAKkP,KAAO,MACZlP,KAAKivC,cAAgB,SAAUjzB,GAAS,OAAO,EAAI7L,EAAMgL,KACzDnb,KAAK+b,QAAUA,GAAW,2GCnK9B0zB,sPAaJ,SAASC,EAAa3zB,GAClB,MAAK,QAAWA,KAAa,QAASA,KAAa,IAAA7C,IAAG,EAAA2mB,YAAH,CAAgB9jB,IAAa,EAAA8jB,YAAA,MAAkB9jB,IAC9F,MAAM,IAAItJ,MAAM,4FAEpB,OAAO,QAAWsJ,GAAWA,GAAU,QAAIA,GAhB/C0zB,EAAoB,SAAUhyB,EAAGmB,GAC7B,IAAI+wB,EA5BW,SAAUlyB,EAAGmB,GAAK,OAAQA,EAAExX,UAAY,IAAMqW,EAAErW,UAAY,GA4BjEwoC,CAAanyB,EAAGmB,GAC1B,OAAY,IAAR+wB,GAGQ,KADZA,EA9BW,SAAUlyB,EAAGmB,GACxB,IAAIixB,EAAU,CAAE7E,MAAO,EAAG8E,WAAY,EAAGC,OAAQ,EAAGC,IAAK,EAAGC,MAAO,GACnE,OAAQJ,EAAQpyB,EAAEvO,OAAS,IAAM2gC,EAAQjxB,EAAE1P,OAAS,GA4B9CghC,CAASzyB,EAAGmB,KAIN,KADZ+wB,EA7BiB,SAAUlyB,EAAGmB,GAC9B,OAAQnB,EAAEswB,YAAenvB,EAAEmvB,WAAiB,YAAmBtwB,EAAEswB,WAAYnvB,EAAEmvB,YAAvC,EA4BlCoC,CAAe1yB,EAAGmB,IAJb+wB,EAtBF,SAAUlyB,EAAGmB,GAEtB,IAAIwxB,EAAmB,CAAEpF,OAAO,EAAM8E,YAAY,GAElD,OADYM,EAAiB3yB,EAAEvO,OAASkhC,EAAiBxxB,EAAE1P,MAC5C,GAAKuO,EAAEtC,KAAO,IAAMyD,EAAEzD,KAAO,GAyBrCk1B,CAAO5yB,EAAGmB,IAkBrB,IAAI0xB,EAA0B,WAE1B,SAASA,EAA0B57B,GAC/B1U,KAAK0U,OAASA,EACG1U,KAAKuwC,QAAUd,EACfzvC,KAAKwwC,OAAS,GACdxwC,KAAKywC,IAAM,EAC5BzwC,KAAK6+B,eAAiB,IAAI,IAAenqB,GA8Q7C,OA3QA47B,EAASzuC,UAAUqT,QAAU,SAAUR,GACnC1U,KAAKwwC,OAAS,UACPxwC,KAAK0wC,cAqChBJ,EAASzuC,UAAU0F,QAAU,SAAUwU,GACnC,IAAI40B,EAAYjB,EAAa3zB,GAI7B/b,KAAKuc,KAAKvc,KAAK6+B,eAAer9B,QAHhB,SAAUosC,EAAUl5B,GAC9B,OAAmD,IAA5CA,EAAO4D,QAAQyT,kBAAkBnG,UAAkB,QAAQnc,KAAKmkC,EAASzlC,QAEtCwoC,KA6ClDL,EAASzuC,UAAU+a,UAAY,SAAUb,GACrC,IAAI40B,EAAYjB,EAAa3zB,GAC7B/b,KAAK0wC,aAAe1wC,KAAK6+B,eAAer9B,QAAO,SAAI,GAAOmvC,GAC1D3wC,KAAK4wC,SAAU,GAOnBN,EAASzuC,UAAU29B,WAAa,SAAUjjB,IACtC,QAAWvc,KAAKwwC,OAAQj0B,IAc5B+zB,EAASzuC,UAAU0a,KAAO,SAAUA,GAChC,IAAIpM,EAAQnQ,KACZ,IAAK,cAAyBuc,GAC1B,MAAM,IAAI9J,MAAM,gBAKpB,OAJA8J,EAAKpB,IAAMnb,KAAKywC,MAChBl0B,EAAKnV,SAAWmV,EAAKnV,UAAY,EACjCpH,KAAKwwC,OAAO/vC,KAAK8b,GACjBvc,KAAK4wC,SAAU,EACR,WAAc,OAAOzgC,EAAMqvB,WAAWjjB,KAOjD+zB,EAASzuC,UAAU8a,MAAQ,WAEvB,OADA3c,KAAK6wC,eACE7wC,KAAKwwC,OAAOpuC,OAAOpC,KAAK0wC,aAAe,CAAC1wC,KAAK0wC,cAAgB,KA4CxEJ,EAASzuC,UAAU2pB,KAAO,SAAUqiB,GAIhC,IAHA,IAAIiD,EAAS9wC,KAAK+wC,WAAW/wC,KAAKwwC,OAASxwC,KAAKuwC,QAAU1C,GAAa7tC,KAAKuwC,SAExES,EAAQ,EACH3zB,EAAI,EAAGA,EAAIyzB,EAAO1hC,OAAQiO,IAC/ByzB,EAAOzzB,GAAG4zB,OAASD,EACf3zB,EAAIyzB,EAAO1hC,OAAS,GAAgD,IAA3CpP,KAAKuwC,QAAQO,EAAOzzB,GAAIyzB,EAAOzzB,EAAI,KAC5D2zB,IAGRhxC,KAAKwwC,OAASM,EACd9wC,KAAK4wC,SAAU,GAGnBN,EAASzuC,UAAUgvC,aAAe,WAC9B7wC,KAAK4wC,SAAW5wC,KAAKwrB,QAGzB8kB,EAASzuC,UAAUkvC,WAAa,SAAUrxB,EAAKmuB,GAC3C,IAAIqD,EAAexxB,EAAI/Q,KAAI,SAAUuS,EAAMjS,GAAO,MAAO,CAAGiS,KAAMA,EAAMjS,IAAKA,MAK7E,OAJAiiC,EAAa1lB,MAAK,SAAU2lB,EAAUC,GAClC,IAAIC,EAAUxD,EAAUsD,EAASjwB,KAAMkwB,EAASlwB,MAChD,OAAmB,IAAZmwB,EAAgBF,EAASliC,IAAMmiC,EAASniC,IAAMoiC,KAElDH,EAAaviC,KAAI,SAAU2iC,GAAW,OAAOA,EAAQpwB,SA6DhEovB,EAASzuC,UAAUoO,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAClD,IAAIoc,EAAOvc,KAAK6+B,eAAer9B,OAAOi6B,EAAS1f,GAI/C,OAHI,QAAU5b,GAAWA,EAAQiH,YAC7BmV,EAAKnV,SAAWjH,EAAQiH,UAC5BpH,KAAKuc,KAAKA,GACHA,GAEJ+zB,EArRkB,8VCpDzBiB,EAA4B,WAE5B,SAASA,EAA4B78B,GACjC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKqc,mBAAoB,EAM1Crc,KAAK2c,MAAQ,IAAI,IAAS3c,KAAK0U,QAM/B1U,KAAKuL,OAAS,IAAI,IAAUvL,KAAK0U,QAsDjC1U,KAAKyR,IAAM,SAAU+/B,EAAQz8B,EAAStH,GAClC,OAAO0C,EAAMuE,OAAO0C,gBAAgB3F,IAAI+/B,EAAQz8B,EAAStH,IAS7DzN,KAAKmI,KAAO,WAAc,OAAOgI,EAAMuE,OAAO0C,gBAAgBjP,QAQ9DnI,KAAKmvC,OAAS,WAAc,OAAOh/B,EAAMuE,OAAO0C,gBAAgB+3B,UAQhEnvC,KAAK8xB,KAAO,WAAc,OAAO3hB,EAAMuE,OAAO0C,gBAAgB0a,QAgB9D9xB,KAAKmV,SAAW,SAAU3U,GAAY,OAAO2P,EAAMuE,OAAO0C,gBAAgBjC,SAAS3U,IA4IvF,OAzIA+wC,EAAW1vC,UAAUqT,QAAU,WAC3BlV,KAAKsc,QAAO,GACZtc,KAAK2c,MAAMzH,WAOfq8B,EAAW1vC,UAAU8qB,MAAQ,WACzB,MAAO,CAAExkB,KAAMnI,KAAKmI,OAAQgnC,OAAQnvC,KAAKmvC,SAAUrd,KAAM9xB,KAAK8xB,SAsBlEyf,EAAW1vC,UAAU+qB,KAAO,SAAU1W,GAClC,IAAIA,IAAOA,EAAI5T,iBAAf,CAEA,IAAI+oB,EAAKrrB,KAAK0U,OAAQuC,EAAaoU,EAAGpU,WAAYJ,EAAewU,EAAGxU,aAChEpF,EAAM,CAAEtJ,KAAM8O,EAAW9O,OAAQgnC,OAAQl4B,EAAWk4B,SAAUrd,KAAM7a,EAAW6a,QAC/E2f,EAAOzxC,KAAKgc,MAAMvK,IACJ,QAAQ,CACtB,CAAC,KAAU,SAAU+/B,GAAU,OAAOv6B,EAAWxF,IAAI+/B,GAAQ,KAC7D,CAAC,EAAA3R,YAAA,MAAmB,SAAU3sB,GAAO,OAAO2D,EAAa66B,GAAGx+B,EAAIzF,MAAOyF,EAAI9E,OAAQ8E,EAAI/S,WACvF,EAAC,IAAA+Y,IAAG,EAAA2mB,aAAc,SAAUx5B,GAAU,OAAOwQ,EAAa66B,GAAGrrC,EAAOoH,QAASpH,EAAO+H,SAAU/H,EAAOlG,cAEzGwxC,CAAYF,GAAQA,EAAKl1B,KAAKR,QAAQ01B,EAAKz1B,MAAOvK,EAAKzR,KAAK0U,WAwBhE68B,EAAW1vC,UAAUya,OAAS,SAAUhH,GACpC,IAAInF,EAAQnQ,KACZ,IAAgB,IAAZsV,EAKA,OAAQtV,KAAK4xC,iBACT5xC,KAAK4xC,kBAAoB5xC,KAAK0U,OAAOuC,WAAW9B,UAAS,SAAUe,GAAO,OAAO/F,EAAMyc,KAAK1W,MALhGlW,KAAK4xC,kBAAoB5xC,KAAK4xC,0BACvB5xC,KAAK4xC,kBA+BpBL,EAAW1vC,UAAUkb,eAAiB,SAAU9Q,QAC9BkI,IAAVlI,IACAA,GAAQ,GACZjM,KAAKqc,kBAAoBpQ,GAQ7BslC,EAAW1vC,UAAUma,MAAQ,SAAUvK,GAEnCA,GAAM,QAAO,CAAEtJ,KAAM,GAAIgnC,OAAQ,GAAIrd,KAAM,IAAMrgB,GAYjD,IAXA,IAUIggC,EARsBl1B,EAClBP,EAHJW,EAAQ3c,KAAK2c,MAAMA,QAWdU,EAAI,EAAGA,EAAIV,EAAMvN,UAElBqiC,GAAQA,EAAKl1B,KAAK00B,SAAWt0B,EAAMU,GAAG4zB,QAFZ5zB,IAAK,CAInC,IAAIyI,QAZA9J,GAAAA,GADkBO,EAaEI,EAAMU,IAZbrB,MAAMvK,EALfzR,KAK0B0U,UAClB,CAAEsH,MAAOA,EAAOO,KAAMA,EAAMs1B,OAAQt1B,EAAK0yB,cAAcjzB,KAavEy1B,GAAQA,GAAS3rB,GAAWA,EAAQ+rB,OAASJ,EAAKI,OAAU/rB,EAAU2rB,EAE1E,OAAOA,GAEJF,EA7PoB,oZCJ3BO,EAAsC,WACtC,SAASA,EAAqBp9B,EAAQq9B,GAClC,IAAI5hC,EAAQnQ,KACZA,KAAK+xC,gBAAkBA,EACvB/xC,KAAKgyC,WAAa,GAClBhyC,KAAKiyC,UAAY,SAAU/7B,GAAO,OAAO/F,EAAM6hC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGoL,OAC5FlW,KAAK8xB,KAAO,WAAc,OAAO,QAAS3hB,EAAM+hC,QAAQpgB,MACxD9xB,KAAKmI,KAAO,WAAc,OAAO,QAASgI,EAAM+hC,QAAQ/pC,MACxDnI,KAAKmvC,OAAS,WAAc,OAAO,SAAU,QAASh/B,EAAM+hC,QAAQ/C,SACpEnvC,KAAKmyC,UAAY,cACjBnyC,KAAKoyC,SAAW,aAoBpB,OAlBAN,EAAqBjwC,UAAU4P,IAAM,SAAUA,EAAKsD,GAQhD,YAPgB,IAAZA,IAAsBA,GAAU,IAChC,QAAUtD,IAAQA,IAAQzR,KAAKkyC,SAC/BlyC,KAAKmpB,KAAK,KAAM,KAAM1X,EAAKsD,GACvB/U,KAAK+xC,iBACL/xC,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG,CAAE2G,IAAKA,SAG1D,QAASzR,OAEpB8xC,EAAqBjwC,UAAUsT,SAAW,SAAUrK,GAChD,IAAIqF,EAAQnQ,KAEZ,OADAA,KAAKgyC,WAAWvxC,KAAKqK,GACd,WAAc,OAAO,QAAWqF,EAAM6hC,WAAYlnC,KAE7DgnC,EAAqBjwC,UAAUqT,QAAU,SAAUR,IAC/C,QAAS1U,KAAKgyC,aAEXF,EA9B8B,2LCDrCO,EAAuC,WACvC,SAASA,EAAsB39B,EAAQ49B,QAClB,IAAbA,IAAuBA,GAAW,GACtCtyC,KAAKsyC,SAAWA,EAChBtyC,KAAK0V,eAAYvB,EACjBnU,KAAKuyC,YAAc,GAmCvB,OAjCAF,EAAsBxwC,UAAUirC,KAAO,WACnC,OAAIj3B,SAASi3B,KACFyC,OAAO15B,SAASi3B,MAEA,UAApB9sC,KAAK+sC,WAAyB,IAAM,IAE/CsF,EAAsBxwC,UAAUkrC,SAAW,WACvC,OAAOl3B,SAASk3B,SAASh4B,QAAQ,KAAM,KAE3Cs9B,EAAsBxwC,UAAUgrC,KAAO,WACnC,OAAOh3B,SAAS28B,UAEpBH,EAAsBxwC,UAAUwT,UAAY,WACxC,OAAOrV,KAAKsyC,UAEhBD,EAAsBxwC,UAAU8qC,WAAa,SAAUC,GACnD,OAAO,QAAUA,GAAc5sC,KAAKuyC,YAAc3F,EAAa5sC,KAAKuyC,aAExEF,EAAsBxwC,UAAU4T,SAAW,SAAUu4B,GAKjD,OAJI,QAAUA,KACVhuC,KAAK0V,UAAYs4B,IACjB,QAAYhuC,KAAK0V,aACjB1V,KAAK0V,UAAY1V,KAAKyyC,eACnBzyC,KAAK0V,WAEhB28B,EAAsBxwC,UAAU4wC,YAAc,WAC1C,IAAIC,EAAUrsB,SAASssB,qBAAqB,QAAQ,GACpD,OAAID,GAAWA,EAAQ1E,KACZ0E,EAAQ1E,KAAKj5B,QAAQ,uBAAwB,IAEjD/U,KAAKsyC,SAAW,IAAMz8B,SAAS/B,UAAY,KAEtDu+B,EAAsBxwC,UAAUqT,QAAU,aACnCm9B,EAxC+B,uHCDlCO,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAMnFC,EAAqC,SAAUC,GAE/C,SAASD,EAAoBv+B,GACzB,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAU1U,KAEhD,OADA,sBAAsB,aAAcmQ,EAAM8hC,WAAW,GAC9C9hC,EAYX,OAhBA0iC,EAAUI,EAAqBC,GAM/BD,EAAoBpxC,UAAUqwC,KAAO,WACjC,OAAO,QAAYlyC,KAAKmyC,UAAUrgB,OAEtCmhB,EAAoBpxC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAC9D/U,KAAKmyC,UAAUrgB,KAAOrgB,GAE1BwhC,EAAoBpxC,UAAUqT,QAAU,SAAUR,GAC9Cw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,aAAc1U,KAAKiyC,YAEzCgB,EAjB6B,CAkBtC,6cC/BEG,EACA,WACI,IAAIjjC,EAAQnQ,KACZA,KAAKkV,QAAU,KACflV,KAAK0V,UAAY,GACjB1V,KAAKqzC,MAAQ,GACbrzC,KAAKszC,UAAY,OACjBtzC,KAAKuzC,MAAQ,YACbvzC,KAAKuyC,YAAc,GACnBvyC,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMkjC,OACvCrzC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMmjC,WAC3CtzC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMojC,OACvCvzC,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuF,WAC3C1V,KAAKqV,UAAY,WAAc,OAAO,GACtCrV,KAAK2sC,WAAa,SAAU6G,GAAU,OAAQ,QAAUA,GAAWrjC,EAAMoiC,YAAciB,EAAUrjC,EAAMoiC,oIChBvGK,8EADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAKnFS,EAAuC,SAAUP,GAEjD,SAASO,EAAsB/+B,GAC3B,OAAOw+B,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAQ9C,OAVA6yC,EAAUY,EAAuBP,GAIjCO,EAAsB5xC,UAAUqwC,KAAO,WACnC,OAAOlyC,KAAK0zC,MAEhBD,EAAsB5xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAChE/U,KAAK0zC,KAAOjiC,GAETgiC,EAX+B,CAYxC,0tBCZ8B,QAAsB,4BAA4B,EAAO,IAAqB,MAEzE,QAAsB,6BAA6B,EAAM,IAA0B,MAEtF,QAAsB,0BAA0B,EAAO,IAAuB,8HClBxGb,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAUnFW,EAA0C,SAAUT,GAEpD,SAASS,EAAyBj/B,GAC9B,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAG/C,OAFAmQ,EAAMyjC,QAAUl/B,EAAOuC,WAAW1L,OAClC,sBAAsB,WAAY4E,EAAM8hC,WAAW,GAC5C9hC,EA8CX,OAnDA0iC,EAAUc,EAA0BT,GAuBpCS,EAAyB9xC,UAAUgyC,eAAiB,WAChD,OAAO,QAAqB7zC,KAAK4zC,QAAQn+B,aAE7Ck+B,EAAyB9xC,UAAUqwC,KAAO,WACtC,IAAI7mB,EAAKrrB,KAAKmyC,UAAWr+B,EAAWuX,EAAGvX,SAAUge,EAAOzG,EAAGyG,KAAMqd,EAAS9jB,EAAG8jB,OAC7EA,GAAS,QAAWA,GAAQ,GAC5Brd,GAAO,QAAUA,GAAM,GACvB,IAAIgiB,EAAa9zC,KAAK6zC,iBAClBE,EAAqBjgC,IAAa9T,KAAK4zC,QAAQn+B,WAC/Cu+B,EAAiBlgC,EAASiT,OAAO,EAAG+sB,EAAW1kC,UAAY0kC,EAE/D,OADAhgC,EAAWigC,EAAqB,IAAMC,EAAiBlgC,EAASmmB,UAAU6Z,EAAW1kC,QAAU0E,IAC5Eq7B,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE1E6hB,EAAyB9xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GACnE,IAAI++B,EAAa9zC,KAAK6zC,iBAClBzF,EAAQ38B,GAAkB,MAAXA,EAAI,GAAa,IAAM,GACtCwiC,EAAkB,KAARxiC,GAAsB,MAARA,EAAczR,KAAK4zC,QAAQn+B,WAAaq+B,EAAa1F,EAAQ38B,EACrFsD,EACA/U,KAAKoyC,SAAS8B,aAAazmC,EAAO0lC,EAAOc,GAGzCj0C,KAAKoyC,SAAS+B,UAAU1mC,EAAO0lC,EAAOc,IAG9CN,EAAyB9xC,UAAUqT,QAAU,SAAUR,GACnDw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,WAAY1U,KAAKiyC,YAEvC0B,EApDkC,CAqD3C,qKCzDS5sC,EAAK,CAEZkJ,KAAM,SAAUjM,GAAO,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAAU,OAAO1nC,EAAQ3I,OAEtFqwC,OAAQ,SAAUrwC,GACd,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAClCA,EAAOrwC,OAIfiI,MAAO,WACH,IAAIqoC,EAAW,GAKf,OAJAA,EAAS7wC,QAAU,IAAI2wC,SAAQ,SAAUznC,EAAS0nC,GAC9CC,EAAS3nC,QAAUA,EACnB2nC,EAASD,OAASA,KAEfC,GAGX74B,IAAK,SAAUF,GACX,IAAI,QAAQA,GACR,OAAO64B,QAAQ34B,IAAIF,GAEvB,IAAI,QAASA,GAAW,CAGpB,IAAI0gB,EAAQ1oB,OAAOC,KAAK+H,GAAU5M,KAAI,SAAU9I,GAAO,OAAO0V,EAAS1V,GAAKkF,MAAK,SAAU/G,GAAO,MAAO,CAAG6B,IAAKA,EAAK7B,IAAKA,SAE3H,OAAO+C,EAAG0U,IAAIwgB,GAAOlxB,MAAK,SAAUiW,GAChC,OAAOA,EAAOpS,QAAO,SAAUsL,EAAKzG,GAEhC,OADAyG,EAAIzG,EAAM5N,KAAO4N,EAAMzP,IAChBkW,IACR,yMC/CRq6B,EAAmB,SAAUC,EAAOnpB,GAC3C,IAAIxlB,EAAMwlB,EAAG,GAAIrnB,EAAMqnB,EAAG,GAU1B,OATKmpB,EAAM9xC,eAAemD,IAGjB,QAAQ2uC,EAAM3uC,IACnB2uC,EAAM3uC,GAAKpF,KAAKuD,GAGhBwwC,EAAM3uC,GAAO,CAAC2uC,EAAM3uC,GAAM7B,GAN1BwwC,EAAM3uC,GAAO7B,EAQVwwC,GAEAC,EAAY,SAAUC,GAC7B,OAAOA,EAAY5xB,MAAM,KAAKxZ,OAAO,MAAUqF,IAAI,MAAYC,OAAO2lC,EAAkB,KAErF,SAASra,EAASzoB,GACrB,IAAIkjC,EAAgB,SAAUrlC,GAAK,OAAOA,GAAK,IAC3C+b,GAAK,QAAU5Z,GAAK9C,IAAIgmC,GAAgBC,EAAavpB,EAAG,GAAIyG,EAAOzG,EAAG,GACtEC,GAAK,QAAWspB,GAAYjmC,IAAIgmC,GACpC,MAAO,CAAExsC,KADkDmjB,EAAG,GACzC6jB,OADsD7jB,EAAG,GACzCwG,KAAMA,EAAMrgB,IAAKA,GAEnD,IAAIojC,EAAW,SAAUC,GAC5B,IAAI3sC,EAAO2sC,EAAI3sC,OACX4sC,EAAeD,EAAI3F,SACnBrd,EAAOgjB,EAAIhjB,OACXqd,EAAS57B,OAAOC,KAAKuhC,GACpBpmC,KAAI,SAAU9I,GACf,IAAImJ,EAAQ+lC,EAAalvC,GAEzB,QADW,QAAQmJ,GAASA,EAAQ,CAACA,IACzBL,KAAI,SAAU3K,GAAO,OAAO6B,EAAM,IAAM7B,QAEnD4K,OAAO,KAAS,IAChBqE,KAAK,KACV,OAAO9K,GAAQgnC,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE/D,SAASkjB,EAAsBxvC,EAAM0oC,EAAS+G,EAAcC,GAC/D,OAAO,SAAU98B,GACb,IAAIX,EAAWW,EAAShB,gBAAkB,IAAI69B,EAAa78B,GACvD+8B,EAAiB/8B,EAASf,eAAiB,IAAI69B,EAAmB98B,EAAU81B,GAKhF,MAAO,CAAE1oC,KAAMA,EAAMiS,QAASA,EAAS09B,cAAeA,EAAejgC,QAJrE,SAAiBR,GACbA,EAAOQ,QAAQuC,GACf/C,EAAOQ,QAAQigC,kaCvBvBr6B,EAA6B,WAE7B,SAASA,EAA6BpG,GAClC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKo1C,SAAW,GAChBp1C,KAAKq1C,aAAe,GACpBr1C,KAAKs1C,qBAAuB,GAC5Bt1C,KAAKgyC,WAAa,GAEnChyC,KAAKgK,WAAa,CACdC,iBAAkBjK,KAAKiK,iBAAiB3G,KAAKtD,MAC7CgX,mBAAoBhX,KAAKgX,mBAAmB1T,KAAKtD,MACjDu1C,kBAAmB,SAAUlqC,GAAM,OAAO,QAAK8E,EAAMilC,UAAU,SAAUt7B,GAAQ,OAAO3J,EAAMuE,OAAOyG,IAAM,IAAMrB,EAAKzO,KAAOA,MAC7HmqC,mBAAoB,WAAc,OAAOrlC,EAAMilC,UAC/CK,mBAAoB,WAAc,OAAOtlC,EAAMklC,cAC/CK,QAAS,SAAUvX,GAEf,OADAhuB,EAAM6hC,WAAWvxC,KAAK09B,GACf,WAAc,OAAO,QAAWhuB,EAAM6hC,WAAY7T,MAwPrE,OAzOArjB,EAAY66B,sBAAwB,SAAU9kC,EAAS+kC,QAC/B,IAAhBA,IAA0BA,EAAc,IAI5C,IAAIC,EAAgBD,EAAY9yB,MAAM,KAClC9H,EAAa66B,EAAc,IAAM,WACjC36B,GAAsB,QAAS26B,EAAc,IAAMA,EAAc,GAAK,IAGtEC,EAAwB,wBAAwBrsC,KAAKuR,GAYzD,GAXI86B,IAEA56B,EAAsB46B,EAAsB,GAC5C96B,EAAa86B,EAAsB,IAEV,MAAzB96B,EAAWvV,OAAO,KAClBuV,EAAaA,EAAW+L,OAAO,GAC/B7L,EAAsB,IAGN,kBACFzR,KAAKyR,GAAsB,CACzC,IAAI66B,EAAc76B,EAAoB4H,MAAM,KAAKlU,QAAO,SAAUonC,EAAQ1mC,GAAK,OAAO0mC,EAAO57B,SAAWvJ,GACxGqK,EAAsB66B,EAAYvwC,SAEL,MAAxB0V,IACLA,EAAsBrK,EAAQrL,MAElC,MAAO,CAAEwV,WAAYA,EAAYE,oBAAqBA,IAG1DJ,EAAYjZ,UAAUoI,iBAAmB,SAAU4G,GAC/C,OAAQ7Q,KAAKi2C,aAAeplC,GAAW7Q,KAAKi2C,cAGhDn7B,EAAYjZ,UAAUmV,mBAAqB,SAAUk/B,EAAUh2C,GAC3DF,KAAKs1C,qBAAqBY,GAAYh2C,GAE1C4a,EAAYjZ,UAAU2yB,iBAAmB,SAAUrsB,EAAMozB,GACrD,IAAI4a,EAAan2C,KAAKs1C,qBAAqB/Z,EAAKnwB,OAChD,IAAK+qC,EACD,MAAM,IAAI1jC,MAAM,2DAA6D8oB,EAAKnwB,OACtF,IAAIgrC,EAAOD,EAAWhuC,EAAMozB,GAC5B,OAAO,QAAQ6a,GAAQA,EAAO,CAACA,IAUnCt7B,EAAYjZ,UAAUumC,qBAAuB,SAAU19B,GACnD,2BAA4B,cAAeA,IAC3C,QAAW1K,KAAKq1C,aAAc3qC,IAElCoQ,EAAYjZ,UAAUwmC,mBAAqB,SAAU39B,GACjD,2BAA4B,iBAAkBA,GAC9C1K,KAAKq1C,aAAa50C,KAAKiK,IAE3BoQ,EAAYjZ,UAAU+qB,KAAO,WACzB,IAAIzc,EAAQnQ,KACRq2C,EAAer2C,KAAKo1C,SAASzmC,KAAI,SAAU4c,GAAO,MAAO,CAACA,EAAIjgB,IAAKigB,MAAS3c,OAAO,KAAY,IASnG,SAAS0nC,EAAgB/qC,GAErB,IADA,IAAIsF,EAAUtF,EAAOxD,SAASgC,SAAUG,EAAQ,IACvCA,GAAS2G,EAAQuJ,QACtBvJ,EAAUA,EAAQuJ,OACtB,OAAOlQ,EAGX,IAAIqsC,GAAe,SAAM,SAAUC,EAASC,EAAQ1lB,EAAMC,GAAS,OAAOylB,GAAUD,EAAQzlB,GAAQylB,EAAQxlB,OAkBxG0lB,EAAe12C,KAAKo1C,SAAS5pB,KAAK+qB,GA9BtC,SAAqB9vC,GACjB,IAAIkwC,EAAa,SAAU9lC,GAAW,OAAQA,GAAWA,EAAQuJ,OAASu8B,EAAW9lC,EAAQuJ,QAAU,EAAI,GAC3G,OAAsC,IAA/B3T,EAAO6E,IAAIwX,MAAM,KAAK1T,OAAiBunC,EAAWlwC,EAAOkiB,mBA4BJ,IAAIha,KAjB3C,SAAUlI,GAC/B,IAAImwC,EAAkBzmC,EAAMklC,aAAa/rC,OAAOwR,EAAYoI,QAAQmzB,EAAc5vC,IAOlF,OANImwC,EAAgBxnC,OAAS,GAIzBwnC,EAAgBprB,KAAK+qB,EAAaD,GAAkB,IAEjD,CAAE7vC,OAAQA,EAAQiE,WAAYksC,EAAgB,OAUrDC,EAAqBH,EAAa/nC,KAAI,SAAU8E,GAAS,OAAOA,EAAM/I,cACtEosC,EAAwB92C,KAAKq1C,aAC5B/rC,QAAO,SAAUiC,GAAU,QAAQ,QAAQsrC,EAAoBtrC,MAC/DoD,KAAI,SAAUjE,GAAc,MAAO,CAAGjE,YAAQ0N,EAAWzJ,WAAYA,MAC1EgsC,EAAa31C,SAZS,SAAU0S,IAGkB,IAA1CtD,EAAMilC,SAASlnC,QAAQuF,EAAMhN,SAC7BgN,EAAMhN,OAAO+E,cAAciI,EAAM/I,eASzC,IAAIqsC,EAAYL,EAAat0C,OAAO00C,GACpC92C,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGisC,MAClD,mBAAoBA,IAiBxBj8B,EAAYjZ,UAAUgK,eAAiB,SAAUpF,GAC7C,iCAAkC,iBAAkBA,GACpD,IAAIuwC,EAAUh3C,KAAKo1C,SAMnB,OAJI4B,EAAQ1tC,QADY,SAAUiiB,GAAO,OAAOA,EAAIjgB,MAAQ7E,EAAO6E,KAAOigB,EAAIngB,QAAU3E,EAAO2E,SACzDgE,QAClC,iCAAkC,+BAAgC3I,GACtEuwC,EAAQv2C,KAAKgG,GACbzG,KAAK4sB,OACE,YAEU,IADHoqB,EAAQ9oC,QAAQzH,IAK1B,iCAAkC,mBAAoBA,IACtD,QAAWuwC,EAAX,CAAoBvwC,IAJhB,iCAAkC,uCAAwCA,KAYtFqU,EAAYjZ,UAAUo1C,UAAY,WAC9B,OAAOj3C,KAAKo1C,SAASzmC,KAAI,QAAK,SAOlCmM,EAAYjZ,UAAUq1C,OAAS,WAC3B,OAAOl3C,KAAKo1C,SAAS9rC,QAAO,QAAK,YAAYqF,KAAI,QAAK,UA2D1DmM,EAAYoI,QAAU,SAAUmzB,EAAc5vC,GAAU,OAAO,SAAUiE,GAErE,GAAIjE,EAAO2E,QAAUV,EAAW3C,SAASqD,MACrC,OAAO,EAEX,IAAI+8B,EAAKz9B,EAAW3C,SAChBovC,EAAahP,EAAGptB,YAAY+H,MAAM,KAClCs0B,EAAc3wC,EAAO6E,IAAIwX,MAAM,KAGnC,KAAK,QAAOq0B,EAAYC,EAAYt1C,MAAM,EAAIq1C,EAAW/nC,SACrD,OAAO,EAGX,IAAIioC,EAAY,EAAIF,EAAW/nC,aAAU+E,EACrCmjC,EAAoBF,EAAYt1C,MAAM,EAAGu1C,GAAWpkC,KAAK,KACzDskC,EAAgBlB,EAAaiB,GAAmB3uB,gBACpD,OAAOwf,EAAGltB,wBAA0Bs8B,GAAiBA,EAAc/xC,QAEhEsV,EA1QqB,wDCfhC,SAAUyL,EAAQ1mB,GAAU,aAyD5B,IAAI23C,EAAoB,gBAEpBC,EAAe53C,EAAQC,OAAO,SAAU,CAAC,OACrB43C,KAAK,CAAEC,eAAgB,UACvB53C,SAAS,SAkCjC,WACE,IAAIwL,EAAS,CACXqsC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,kBAAkB,GAgCpB,SAASC,EAAUzlC,EAAU0lC,EAAUC,EAAqBC,GAC1D,OAAO,SAAS31C,EAAOoe,EAAMpO,GAC3B,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAIkB,EAAgB5lC,EAAKkd,WAAWuoB,IAChChtC,EAAOmtC,IAAmBC,EAAYz3B,EAAMs3B,IAAyB1lC,EAAK4lC,IAC5E51C,EAAMyB,OAAOuO,EAAKD,IAAW,SAAS+lC,GAEpCA,EAAUH,GAAUG,IAAYA,EAChC13B,EAAKpO,KAAKylC,EAAUK,QAb5B54C,KAAKuL,OAAS,SAASstC,GACrBttC,EAAS1L,EAAQiB,OAAOyK,EAAQstC,IAkElC74C,KAAKU,KAAO,WACV,MAAO,CACL6K,OAAQ,SAAS1F,GACf,OAAO0F,EAAO1F,IAEhBizC,YAAaR,OA5IfE,EAAsB,CAAC,SAAU,IAAK,QAAS,WAAY,SAAU,UAAW,WAEhFG,EAAc,SAASz3B,EAAM63B,GAC/B,IAAiD,IAA7CA,EAAc7qC,QAAQgT,EAAK,GAAG83B,UAChC,OAAO,GA8IXvB,EAAa50C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GAClD,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GACtC,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GACvC,OAAOA,EAAMH,YAAY,UAAW,eAAgBN,GAAqB,MAE1E31C,UAAU,YAAa,CAAC,QAAS,SAASo2C,GACzC,OAAOA,EAAMH,YAAY,YAAa,eAAgBN,GAAqB,MAE5E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GAEvC,SAASC,EAAiBpmC,EAAMqmC,EAAgBj4B,EAAMk4B,GACpD,OAAOH,EAAM1tC,OAAO4tC,KACjBj4B,EAAKpO,KAAKA,KACVsmC,IAAsBT,EAAYz3B,EAAMs3B,MAClB,WAAtBt3B,EAAKpO,KAAK,SAA6C,UAArBoO,EAAK,GAAG83B,UAG/C,SAASK,EAAiBC,EAAMp4B,GAI9B,OAAQA,EAAKpO,KAAK,SAAYoO,EAAKpO,KAAK,UAAYwmC,IAAUX,EAAYz3B,EAAMs3B,GAYlF,MAAO,CACLrxC,SAAU,IACVxB,QAAS,UACTyB,SAAU,IACVC,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI+B,EAhBR,SAAkBzmC,EAAMoO,GACtB,IAAIhS,EAAO4D,EAAK5D,KACZoqC,EAAOxmC,EAAKwmC,KAEhB,MAA2B,cAAlBpqC,GAAQoqC,IAAiC,qBAATA,EAA+B,WAC7C,WAAlBpqC,GAAQoqC,IAAiC,kBAATA,EAA4B,QACpD,UAATpqC,GAA0C,gBAAToqC,GAAmC,WAATA,EAAqB,QAAU,GAUpFE,CAAS1mC,GAErB,MAAO,CACL2mC,KAAM,SAAS32C,EAAOoe,EAAMpO,EAAM4mC,GAChC,IAAIC,EAAgBT,EAAiB,WAAY,WAAYh4B,GAAM,GAEnE,SAAS04B,IACP,OAAOF,EAAQG,YAcjB,OAAQN,GACN,IAAK,QACL,IAAK,WACCF,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQymC,GAEhBL,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,OAAOq1C,EAAiC,UAAVL,EAlB1C,SAA0BO,GAGxB,IAAIlB,EAAW9lC,EAAKtO,OAASk1C,EAAQK,WACrC74B,EAAKpO,KAAK,eAAgB8lC,IAG5B,WACE13B,EAAKpO,KAAK,gBAAiB4mC,EAAQM,SAASN,EAAQK,eAa9CJ,GACFz4B,EAAKpO,KAAK,WAAY,GAExB,MACF,IAAK,QAIH,GAHIumC,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQ,UAEhBmmC,EAAM1tC,OAAO,aAAc,CAC7B,IAAI0uC,GAAqB/4B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDw3C,GAAqBh5B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDy3C,GAAqBj5B,EAAKpO,KAAK,iBAE/BmnC,GACFnnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BI,GACFpnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BK,GACFr3C,EAAMyB,OAAOq1C,GAAuB,SAAgCE,GAClE54B,EAAKpO,KAAK,gBAAiBgnC,MAI7BH,GACFz4B,EAAKpO,KAAK,WAAY,IAKvBA,EAAKpQ,eAAe,eAAiBg3C,EAAQW,YAAYC,UACzDpB,EAAiB,gBAAiB,eAAgBh4B,GAAM,IAE3DpO,EAAKsnC,SAAS,YAAY,WACxBl5B,EAAKpO,KAAK,kBAAmBA,EAAe,aAI5ComC,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,QAAO,WACX,OAAOm1C,EAAQa,YACd,SAA+BT,GAChC54B,EAAKpO,KAAK,iBAAkBgnC,cAQzCj3C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,cAAc,WACvB,MAAO,CACLsE,SAAU,IACVxB,QAAS,cACT4C,KAAM,SAASzF,EAAOoe,EAAMpO,EAAM0nC,GAC5B1nC,EAAKpQ,eAAe80C,IAEnBt2B,EAAKpO,KAAK,cACboO,EAAKpO,KAAK,YAAa,kBAK9BjQ,UAAU,UAAU,CAAC,QAAS,SAAU,SAASo2C,EAAO93C,GACvD,MAAO,CACLgG,SAAU,IACVE,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI72C,EAAKQ,EAAO2R,EAAK2nC,SACrB,OAAO,SAAS33C,EAAOoe,EAAMpO,GAEtB6lC,EAAYz3B,EAAMs3B,KAEjBS,EAAM1tC,OAAO,sBAAwB2V,EAAKpO,KAAK,SACjDoO,EAAKpO,KAAK,OAAQ,UAGhBmmC,EAAM1tC,OAAO,cAAgB2V,EAAKpO,KAAK,aACzCoO,EAAKpO,KAAK,WAAY,IAGpBmmC,EAAM1tC,OAAO,gBAAmBuH,EAAK4nC,WAAc5nC,EAAK6nC,YAAe7nC,EAAK8nC,SAC9E15B,EAAK5gB,GAAG,WAAW,SAASC,GAC1B,IAAIs6C,EAAUt6C,EAAMu6C,OAASv6C,EAAMs6C,QAEnB,KAAZA,GAA8B,KAAZA,KAEwC,IAAxDrC,EAAoBtqC,QAAQ3N,EAAM8F,OAAO2yC,WAAqBz4C,EAAM8F,OAAO00C,mBAG7Ex6C,EAAMgD,iBAERT,EAAMmB,QAGR,WACEtD,EAAGmC,EAAO,CAAEk4C,OAAQz6C,mBASnCsC,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAO,SAASn2C,EAAOoe,EAAMpO,GACvBA,EAAKpQ,eAAe80C,KAEpByB,EAAM1tC,OAAO,aAAgB2V,EAAKpO,KAAK,aAAgB6lC,EAAYz3B,EAAMs3B,IAC3Et3B,EAAKpO,KAAK,WAAY,OA9Z5B,CAoaGyT,OAAQA,OAAO1mB,iECzalBA,QAAQC,OAAO,WAAY,CAAC,OAC3B+C,UAAU,WAAY,CAAC,KAAM,SAAUkE,GACvC,aAgCA,MAAO,CACNjE,MAAM,CACL42C,QAAe,IACf73B,IAAe,QACfiF,IAAe,QACfgD,KAAe,SACfmxB,SAAe,aACfC,SAAe,aACfC,UAAe,cACfC,UAAe,cACfC,WAAe,eACfC,WAAe,eACfC,aAAe,iBACfC,MAAe,UACfC,MAAe,UACfC,YAAe,gBACfC,YAAe,iBAEhBvqC,YAAa,2BACPzL,QAAS,UACToP,SAAS,EACTxM,KAlDI,SAAUtH,EAAQyG,EAAUxG,GAElCA,EAAO+5C,WACVh6C,EAAOg6C,SAAW,WAAW,OAAO,IAGjC/5C,EAAOi6C,YACVl6C,EAAOk6C,UAAY,WAAW,OAAO,IAGlCj6C,EAAOw6C,cACVz6C,EAAOy6C,YAAc,WAAW,IAAIviB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOs6C,QACVv6C,EAAOu6C,MAAQ,cAGZt6C,EAAOy6C,cACV16C,EAAO06C,YAAc,WAAW,IAAIxiB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOu6C,QACVx6C,EAAOw6C,MAAQ,eA4BVz6C,WAAY,yBAInBA,WAAW,qBAAsB,CAAC,SAAU,WAAY,SAAWC,EAAQuC,GAC3E,aAEAvC,EAAO26C,UAAar1B,OAAO7jB,eAAe,iBAAmB6jB,OAAOs1B,UAAUC,iBAAmB,EACjG76C,EAAO86C,SAAWl8C,QAAQoiB,KAAKhhB,EAAOy4C,SAEtCz4C,EAAO4gB,IAAM5gB,EAAO4gB,KAAO,EAC3B5gB,EAAO6lB,IAAM7lB,EAAO6lB,KAAO,EAC3B7lB,EAAO6oB,KAAO7oB,EAAO6oB,MAAQ,GAE7B7oB,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,QAE7Cz4C,EAAOm6C,UAAYn6C,EAAOm6C,WAAa,GACvCn6C,EAAO+6C,cAAgB/6C,EAAOm6C,UAAYn6C,EAAO6oB,KACjD7oB,EAAOo6C,WAAap6C,EAAOo6C,YAAc,GACzCp6C,EAAOq6C,WAAar6C,EAAOq6C,YAAcr6C,EAAOm6C,UAChDn6C,EAAOs6C,aAAet6C,EAAOs6C,cAAgBt6C,EAAOo6C,WAEpD,IAAI1nB,EAAO1yB,EAAO6lB,IAAM7lB,EAAO4gB,IAC/Bo6B,EAAQtoB,EAAO1yB,EAAO6oB,KACtBoyB,EAAUj7C,EAAOsD,OAAO,WAAW,WAClCtD,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,WAG9CyC,EAAW,SAAUC,GACpB,OAAQA,EAAM,GAAKH,EAAQtoB,GAG5B1yB,EAAOo7C,cAAgB,WACtB,OAAO,IAAIz6C,MAAMq6C,IAGlBh7C,EAAOq7C,cAAgB,SAAUF,GAChC,IAAIG,EAAQ,EAAEt7C,EAAO6oB,KAErB,OADW7oB,EAAOm6C,UAAUmB,GAAQH,EAAMG,IAI3Ct7C,EAAOu7C,WAAa,SAAUJ,GAC7B,OAAOD,EAASC,IAAUn7C,EAAOy4C,QAAQz4C,EAAO4gB,KAGjD5gB,EAAOw7C,aAAe,WACjBx7C,EAAOk6C,cAAgBl6C,EAAOg6C,YACjCh6C,EAAO06C,YAAY,CAACe,OAAOz7C,EAAOy4C,UAAU3uC,MAAK,WAChD9J,EAAOy4C,QAAUz4C,EAAO4gB,IACxB5gB,EAAOw6C,MAAM,CAACiB,OAAOz7C,EAAOy4C,cAK/Bz4C,EAAO07C,SAAW,SAAUP,GAC3B,IAAKn7C,EAAOg6C,WAAY,CACvB,IAAI2B,EAAW/8C,QAAQoiB,KAAKhhB,EAAO4gB,IAAMs6B,EAASC,IAElDn7C,EAAOy6C,YAAY,CAACgB,OAAOE,IAAW7xC,MAAK,WAC1C9J,EAAOy4C,QAAUkD,EACjBp5C,GAAS,WACRvC,EAAOu6C,MAAM,CAACkB,OAAOz7C,EAAOy4C,kBAMhCz4C,EAAOsB,IAAI,YAAY,WACtB25C,UAID3jC,IAAI,CAAC,iBAAkB,SAAUjI,GACjC,aAEAA,EAAeusC,IAAI,2BAElB,0iDCtHF,SAASC,EACP7mC,EACAL,EACA6C,EACAskC,EACAh2C,EACAi2C,EACAC,EACAC,EACAC,EACA35C,GAEA,MAAM45C,EAAKp9C,KA4CX,SAASq9C,EAAOC,GAEdN,EAAqBO,cAAcL,EAAgB,CAAEI,GAAAA,IAClDvyC,MAAMvG,IAhBX,IAAqBg5C,EAiBfvnC,EAAWwnC,OAASj5C,EAjBLg5C,GAkBI,IAAPF,EAAc,OAAS,OAjBvC1nC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,GAEF,KAcEh6C,GAAS,KACPyS,EAAWhS,eAGdoe,MAAM26B,EAAqBW,gBA6MhCP,EAAG/vC,QArGH,WACEmZ,QAAQo3B,MAAM,oCAAqC3nC,EAAW4nC,SAC9D5nC,EAAW6nC,OAAS,OAEpB,MAAMC,EAAY9nC,EAAW+nC,SAASC,MAChCC,EAAajoC,EAAW+nC,SAASG,UACjCC,EACJnoC,EAAW+nC,SAASK,iBAAmBpoC,EAAW+nC,SAASG,UACvDG,EAAeroC,EAAW+nC,SAASO,aACnCC,EAAmBvoC,EAAW+nC,SAASS,gBACvCC,EAAgB58B,KAAKgF,IACzBT,SAASs4B,gBAAgBC,aACzBr4B,OAAOs4B,aAAe,GAElBC,EAAez4B,SAASs4B,gBAAgBI,YAG9C14B,SAASs4B,gBAAgBK,MAAMC,YAAY,oBAAqBlB,GAChE13B,SAASs4B,gBAAgBK,MAAMC,YAAY,qBAAsBf,GACjE73B,SAASs4B,gBAAgBK,MAAMC,YAC7B,4BACAb,GAEF/3B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAX,GAEFj4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,2BACAT,GAEFn4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,wBACAP,GAEFr4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAH,GAGF,IAAII,GAAK,EAET,MAAMC,EAA8B36C,GAChB,OAAVA,GAAkBA,EAAMyR,EAAWJ,WAAc,GAGrDupC,EAAwBpC,EAAqBqC,QACjDlC,GACApyC,KAAKo0C,GACDG,EAAuBtC,EAAqBqC,QAChDnC,GACAnyC,KAAKo0C,GACPp4C,EAAG0U,IAAI,CAAC2jC,EAAuBE,IAC5Bv0C,MAAK,IAAiC,IAA/Bw0C,EAAcC,GAAiB,EACrCvpC,EAAW4nC,QAAU0B,EACrBtpC,EAAWwnC,OAAS+B,EAEhBvpC,EAAW4nC,QAAQ4B,aAAexpC,EAAWwnC,OAAOH,GACtD4B,GAAK,EAELjpC,EAAWwnC,OAAOH,IAAK,EAGa,iBAAlCrnC,EAAW+nC,SAAS0B,WACtBrC,EAAO6B,GAxMbzmC,EAAOi5B,GAjBT,WAAoB,QAClB,MAAMiO,EAAS1pC,EAAW+nC,SAAS2B,OAC7B9B,IAAU5nC,MAAAA,GAAA,UAAAA,EAAY4nC,eAAZ,mBAAqB4B,mBAArB,UAAkCp0C,IAE5Cu0C,EACJrQ,OAAOt5B,EAAW+nC,SAAS6B,kBAC3BtQ,OAAOt5B,EAAW+nC,SAAS8B,qBACzBvQ,OAAOt5B,EAAW+nC,SAAS6B,iBAE/B,SAAMhC,IAAa+B,GAAYD,GAQrBI,GAAa,aAAe,cAAe,KAAM,CACzDlqC,SAAU,YA6MR,IAAI2nC,EAAM,GAKRA,EAHAvnC,EAAW+nC,SAAS2B,SACnB1pC,EAAW+nC,SAASgC,gBAEf,OAEA,UAGRpqC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,EACAO,UAAAA,EACAG,WAAAA,EACAQ,cAAAA,EACAI,aAAAA,GAEF,KAGF,MAAME,EAAQ34B,SAAS45B,cAAc,SACrC55B,SAASpB,KAAKi7B,YAAYlB,GAC1BA,EAAMmB,MAAMC,WACV,2BAA6BnqC,EAAW+nC,SAASC,MAAQ,kBAG5D57B,MAAM26B,EAAqBW,iBAKhCP,EAAGiD,MA3MH,WACE,MAAMZ,EAAcxpC,EAAW4nC,QAAQ4B,YAEvC,GAAIA,GAAeA,EAAYp0C,GAAI,CAEjC,MAAMi1C,EAAUvD,EACbuD,UACAlmC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,eAC9CC,qBAAoB,GACpBrN,MACCl9B,EAAW+nC,SAASyC,iBAClB,yCAEHC,GAAG,MACHv8C,OAAO,UAEV44C,EACG4D,KAAKL,GACLv1C,MAAK,WACJ,OAAOkyC,EAAI2D,gBAAgBC,aAAa,CACtCx1C,GAAIo0C,EAAYp0C,GAChBy1C,QAAQ,EACRC,YAAa,YAEZC,YAEJj2C,MAAK,WACJ0N,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAGbwM,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM,YAAa6nB,QA4KnCkwB,EAAGC,OAASA,EACZD,EAAG6D,SAxKH,WACE,MAAM3M,EAAWvtC,EAAGkF,QACdwzC,EAAcxpC,EAAW4nC,QAAQ4B,YA2DvC,OAzDIA,GAAeA,EAAYp0C,IAC7B4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAO1B,EAAYp0C,GACnB+1C,YAAY,IAEbJ,SAASj2C,MAAK,SAAUpD,GACvB2sC,EAAS3nC,QACP00C,GAAAA,CAAK15C,EAAK25C,KAAKx/C,MAAM,IAAI,SAAUy/C,GACjC,IAAIC,EASJ,GAPsB,OAAlBD,EAAIE,YACND,EACEvrC,EAAW+nC,SAAS0D,eACpBzrC,EAAW4nC,QAAQ3uB,MACnB,UAAYqyB,EAAII,WAGE,QAAlBJ,EAAIE,UACN,OAAQxrC,EAAW+nC,SAAS4D,iBAC1B,IAAK,gBACHJ,EAASD,EAAIM,OACT5rC,EAAW+nC,SAAS8D,WAAaP,EAAIM,OACrC,SACJ,MAEF,IAAK,cACHL,EAASD,EAAIM,OACTN,EAAIQ,KAAKC,OAAST,EAAIQ,KAAKE,SAC3B,SACJ,MAEF,IAAK,iBACHT,EAASD,EAAIM,OAASN,EAAIQ,KAAKE,SAAW,SAC1C,MAEF,QACET,EAASD,EAAIM,OACT5rC,EAAW+nC,SAAS8D,WAAaP,EAAIM,OACrC,SAKV,MAAO,CACLL,OAAQA,EACR1d,QAASyd,EAAIW,KACbC,UAAWC,GAAAA,CAAOb,EAAIY,WAAWv6B,OAAO,+BAK/CvF,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAIbonB,EAAS7wC,SA4GlB25C,EAAGiF,eA5OH,WACE,MAA4C,YAArCpsC,EAAW+nC,SAASsE,aAA6B,OAAS,OA4OnE,MAAMC,EAAgB,CACpB5C,OAAQ,CAAC,SAAU,OAAQ,UAAW,UAAW,aACjD6C,QAAS,CAAC,YAKZjvC,OAAO+6B,eAAer4B,EAAY,cAAe,CAC/CvF,MACE,IAAIpK,EAAS2P,EAAW+nC,SAASyE,aAMjC,OALIF,EAAc5C,OAAOrmC,SAASrD,EAAW6nC,QAC3Cx3C,EAAS2P,EAAW+nC,SAAS0E,cACpBH,EAAcC,QAAQlpC,SAASrD,EAAW6nC,UACnDx3C,EAAS2P,EAAW+nC,SAAS2E,gBAExBr8C,KAIXigB,OAAOq8B,iBACL,WACA,SAAU1sC,GACa,SAAjBA,EAAIvO,KAAKuO,IACXmnC,GAAO,GACmB,SAAjBnnC,EAAIvO,KAAKuO,KAClBmnC,GAAO,MAGX,2eCtTJ,SAASwF,EAAS5sC,EAAYF,GAE5B,MAAM3H,EAAS2H,EAAUo5B,SAGzBl5B,EAAW+nC,SAAW,CACpB8E,OAAQ,UACRC,MAAM,GAGRC,GAAAA,CAAO50C,GAAQ,SAAU5J,EAAOqB,GAChB,KAAVrB,GAAiBy+C,GAAAA,CAAOz+C,KACZ,SAAVA,IACFA,GAAQ,GAGI,UAAVA,IACFA,GAAQ,GAGVyR,EAAW+nC,SAASn4C,GAAOrB,MAI/ByR,EAAWJ,SAAWI,EAAW+nC,SAASnoC,SAC1CI,EAAWwnC,OAAS,CAAEH,IAAI,GAC1BrnC,EAAW4nC,QAAU,GAWvB,SAASqF,EACPC,EACA9uC,EACA+uC,EACAC,EACAC,GAEAjvC,EAAkBgB,WAAU,GAGvB+tC,EAAcnjD,SAAS0R,QAAQjB,MAClC0yC,EAAcnjD,SAAS0R,QAAQjB,IAAM,IAIvC0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI,qBACjC,gCAEF0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI,iBAAmB,WACtD0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI6yC,OAAS,WAG5CF,EAA4BG,UAAUF,GAGtCH,EACG11C,MAAM,MAAO,CACZkxB,UAAU,IAEXlxB,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAaqyC,EACbziD,WAAY,4BAEbyM,MAAM,aAAc,CACnBgE,IAAK,UACLL,YAAasyC,EACb1iD,WAAY,2BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAauyC,EACb3iD,WAAY,4BAEbyM,MAAM,WAAY,CACjBgE,IAAK,QACLL,YAAawyC,EACb5iD,WAAY,yBAEbyM,MAAM,gBAAiB,CACtBgE,IAAK,aACLL,YAAayyC,EACb7iD,WAAY,8BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAa0yC,EACb9iD,WAAY,0OC3FlB,SAAS+iD,EACP9tC,EACAwC,EACAurC,EACA/G,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAIX,SAASmmC,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMu8C,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXC,SAAS,OAEZP,EAASrD,KAAKuD,IAIlB,SAASM,IACPvuC,EAAWwuC,SAAU,EAkBvB,SAASC,IACHzuC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,uBAEL/uC,EAAW4nC,QAAQ4B,YAE1BxpC,EAAWgvC,gBAAiB,EAiD9B7H,EAAG/vC,QAjFH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWwuC,SAAU,KAsEtCrH,EAAG+H,OA1CH,WACElvC,EAAWwuC,SAAU,EAEjBxuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDP,MACC+E,GAAAA,CACE,CACE/5C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnCg6C,WAAYpvC,EAAW+nC,SAASqH,WAChCC,SACErvC,EAAW+nC,SAAS0D,eAAiBzrC,EAAW4nC,QAAQ3uB,MAE5DkuB,EAAGuH,OAGN3D,SAASj2C,MAAK,kBACNqyC,EAAG6G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,MAEfn5C,KAAK0wC,GACL1wC,KAAK25C,GACLriC,MAAM8jB,EAAY,WAClBqf,QAAQhB,IAEXA,IACAre,EAAY,YAOhBiX,EAAGqI,KAhDH,WACEhK,IACAiJ,KAgDFtH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GCjId,SAASyB,EAAWzvC,EAAY0vC,GAC9B,MAAMC,EAAgB,CACpBv6C,GAAI,MACJkW,MAAOtL,EAAW+nC,SAASz8B,OAGvB07B,EAAM,GAyEZ,OAvEAA,EAAI4I,QAAU5vC,EAAW+nC,SAAS8H,OAAS,QAE3C7I,EAAI8I,YAAcJ,EAChB1I,EAAI4I,QAAU,oBACdD,EACA,CACE3c,OAAQ,CACN+c,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,4BAErBrD,QAAS,CACPwD,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,6BAErBI,UAAW,CACTD,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,8BAKzB5I,EAAI2D,gBAAkB+E,EACpB1I,EAAI4I,QAAU,wBACdD,EACA,CACExpC,OAAQ,CACN4pC,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,yBAErBhF,aAAc,CACZmF,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,uCAErBxF,MAAO,CACL2F,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,+BAErB3E,YAAa,CACX8E,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,wCAErBK,iBAAkB,CAChBF,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,0CACnBl0C,QAAS,CACP,oBAAgBwC,GAElBgyC,iBAAkBtmD,QAAQ6c,UAE5B0pC,mBAAoB,CAClBJ,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,6CAErBQ,QAAS,CACPL,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,mCAKzB5I,EAAIqJ,YAAcX,EAChB1I,EAAI4I,QAAU,oBACdD,EACA,CACExpC,OAAQ,CACN4pC,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,uBAKlB5I,mTChET,SAASsJ,EACPtlD,EACAgV,EACAzS,EACAgjD,EACAC,EACAhuC,EACApI,EACA2zC,EACA/G,EACAD,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KACX,IAAI0mD,EACAC,EACAC,EACAC,EA4BJ,SAASC,IAEP//C,EAAAA,GAAAA,IAAO,CACLi2C,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,KAhBJkL,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,eAoB/C,SAASkxC,IACPvjD,GAAS,WACP,MAAMT,EAAU0jD,EAAU,GAAGO,uBAAuB,iBAAiB,GAEjEjkD,IACFA,EAAQkkD,UAAYlkD,EAAQmkD,iBAKlC,SAASC,IACP/J,EAAG6G,OAAS,GACZhuC,EAAWzJ,MAAM,QAEjB,MAAM03C,EAAQF,EACXG,SACAC,YACC,8CAEDE,WAAW,yBAA2BruC,EAAW+nC,SAASsE,cAC1DloC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GAIhB,SAAS/d,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtBo/C,KAIJ,SAASK,EAAYtjB,GACnBmZ,EAAI8I,YACD9c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,GACvBy1C,EAAG6G,OAAS,GACZ,IAAIoD,GAAkB,EAClBpE,GAAAA,CAAOhtC,EAAW4nC,QAAQ4B,eAC5BxpC,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAEvBg8C,GAAkB,GAEfpxC,EAAW4nC,QAAQyJ,qBACtBrxC,EAAW4nC,QAAQyJ,oBAAqB,EACxCD,GAAkB,GAGhBA,GACFrK,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEhC+I,EAAU,GAAGa,aAAaC,QAAQ,IAElCT,OAED1kC,MAAM8jB,EAAY,qBA0EvB,SAASshB,IAELxxC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,IAE/B4xC,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG6G,OAAOwD,eAGb9/C,EAAKm5C,SACP7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEL,cAArBh2C,EAAK+/C,YACPjvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAE7C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,gBAIhDwM,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACHixC,IACA,MACF,KAAK,IACHruC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAQ1B,SAASy6B,EAAM3M,GACb,MAAMkH,EAAOwE,EAAU,GAAGa,aAAaK,UAEnC5M,GAA6B,KAAnBA,EAAOH,SAAkBG,EAAO6M,UAK1C7M,GAA6B,KAAnBA,EAAOH,SAKR,KAATqH,GAKJkF,EACEhC,GAAAA,CACE,CACElD,KAAMA,GAERjsC,EAAW4nC,UAqCjB,SAASqD,IAAc,QACjBjrC,MAAAA,GAAJ,UAAIA,EAAY4nC,eAAhB,iBAAI,EAAqB4B,mBAAzB,OAAI,EAAkCp0C,IACpC4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,GACtCy8C,cAAc,EACdz8C,GAAIw7C,QAAiB1yC,IAEtB6sC,SAASj2C,MAAK,SAAUpD,GAIvB,UAHOy1C,EAAG6G,OAAOxE,YAGb93C,EAAKuC,MAAO,CACd,IAAI69C,GAAQ,EACR1qC,EAAI,EACR,IAAKA,EAAI,EAAG0qC,GAAQ,EAAO1qC,EAAI1V,EAAK25C,KAAKlyC,OAAQiO,IAAK,CACpD,MAAMrI,EAAIgzC,GAAAA,CAAM/xC,EAAWgyC,SAAU,CACnC58C,GAAI1D,EAAK25C,KAAKjkC,GAAGhS,KAEd2J,EAGMrN,EAAK25C,KAAKjkC,GAAGywB,OACtB94B,EAAE84B,MAAO,IAHTia,GAAQ,EACR9xC,EAAWgyC,SAASxnD,KAAKkH,EAAK25C,KAAKjkC,KAMN,QAA3B1V,EAAK25C,KAAKjkC,GAAGokC,WAAwB95C,EAAK25C,KAAKjkC,GAAGywB,OAtC3CziC,EAuCK1D,EAAK25C,KAAKjkC,GAAGhS,GAtChC4xC,EAAIqJ,YACRlqC,OAAO,CACN/Q,GAAIA,EACJyiC,MAAM,IAEPkT,SAAS3+B,OAAM,SAAU6K,GACxB1G,QAAQnhB,MAAM6nB,OAoCN66B,GAEFhB,IAGEp/C,EAAK25C,KAAKjkC,EAAI,GAAGywB,OACnB+Y,EAAgBl/C,EAAK25C,KAAKjkC,EAAI,GAAGhS,IAG/Bw7C,IAAkB5wC,EAAW4nC,QAAQyJ,oBACvCtK,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACdyJ,oBAAoB,IACnBv8C,MAAMvG,IACPyR,EAAW4nC,QAAUr5C,KAzDnC,IAAuB6G,KA8DhBgX,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA7V1BkwB,EAAG6G,OAAS,GACZhuC,EAAWgyC,SAAW,GACtB7K,EAAG8K,aAAe,CAChBC,gBAAgB,EAChBC,YAAY,EACZC,OAAO,EACP9/C,MAAM,EACN+/C,WAAY,UAGdlL,EAAGmL,cAAgB,CACjBC,uBAAuB,GA6XzBpL,EAAG/vC,QArCH,WACEmZ,QAAQo3B,MAAM,mCAAoC3nC,EAAW4nC,SAC7D5nC,EAAW6nC,OAAS,OACpB7nC,EAAWwuC,SAAU,EACrBxuC,EAAW+nC,SAASyK,UAAW,EAE/BrL,EAAGsL,aAAe,GAGhBzyC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYqB,OAG/BgG,KAGAW,IAGAd,EAAsBH,EAAUtF,EAAa,KAC7C0F,EAAyBJ,EAAUiB,EAAgB,MAGrDf,EAAYiC,EAAE,iBAAiBpB,aAAa,CAC1CqB,YAAa3yC,EAAW+nC,SAAS6K,oBAAsB,iBACvDxoD,OAAQ,CACNyoD,MAAO,SAAUC,EAAQ/N,GACvB2M,EAAM3M,IAERgO,MAAO,WACLhpD,KAAKipD,gBAQb7L,EAAGuK,MAAQA,EACXvK,EAAG8L,aAzIH,WACE,MAAMhH,EAAOwE,EAAU,GAAGa,aAAaK,UAG1B,KAAT1F,IAKJkF,EACEhC,GAAAA,CACE,CACElD,KAAMA,GAERjsC,EAAW4nC,UAIf6I,EAAU,GAAGa,aAAa0B,aAwH5B7L,EAAGx4C,UAjSH,SAAmB+C,GACjB,GAAIA,EAAKie,KA9GSujC,SAgHhB,YADAhC,IAIF,MAAMiC,EAAK,IAAIC,SAEfD,EAAG/uB,OAAO,OAAQ1yB,EAAK7B,MAEvBuK,EACGopC,KACCxjC,EAAW+nC,SAAS8H,OAClB,0BACA7vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,4BACA4K,EAAW+nC,SAASz8B,MACtB6nC,EACA,CACEjD,iBAAkBtmD,QAAQ6c,SAC1B/K,QAAS,CACP,oBAAgBwC,KAIrBpJ,MAAK,SAAUpD,IACdA,EAAOA,EAAKA,MAEH0D,IACP+xC,EAAG6G,OAAS,GAEZmD,EACEhC,GAAAA,CACE,CACElD,KACE,YACAjsC,EAAW+nC,SAAS8H,OACpB,0BACA7vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,iCACA1D,EAAK0D,GACL,UACA4K,EAAW+nC,SAASz8B,MACpB,qBACA5Z,EAAKnC,KACL,OACF8jD,aAAc3hD,EAAK0D,IAErB4K,EAAW4nC,WAIf1X,EAAY,oBAEbA,EAAY,oBA4OnBiX,EAAG+J,gBAAkBA,EAGrBlmD,EAAOsB,IAAI,YA5OX,WACEikD,EAAUriD,OAAOwiD,GACjBH,EAAUriD,OAAOyiD,GAEjBD,EAAsB,KACtBC,EAAyB,QAwO3B3wC,EAAW1T,IAAI,aArOf,SAAoBoF,EAAMnH,GACpBA,GACFA,EAAS+oD,GAAAA,CAAQtzC,EAAWgyC,sWCvMlC,SAASuB,EACPvoD,EACAgV,EACAwzC,EACAxM,EACA+G,EACAt8C,EACA2I,GAEA,MAAM+sC,EAAKp9C,KACX,IAAI0pD,EAAU,KACVC,EAAgB,KACpB1zC,EAAW2zC,UAAY,GAEvB,MAAMC,EAAkB,CACtBC,sBAAsB,EACtBC,mBAAmB,EACnB3+B,QAAS,SAAU5mB,GACjB,MAAqB,kBAAVA,GACDA,EAAQ,IAAM,IAEjBA,IA6GX,SAASwlD,WACA5M,EAAG6G,OAAOkB,OACjBlvC,EAAWzJ,MAAM,QAGjB4wC,EAAG6M,OAASC,GAAAA,CAAWP,GAEvBvM,EAAGuH,KAAO,GACVvH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ,MAAMd,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GA7HhB9G,EAAG+M,YAAc,SAAU5kD,GACzB,OAAOkkD,EAAKU,YAAY5kD,IA+Q1B63C,EAAGgN,iBArDH,SAA0BhO,GAExB,MAAMiO,EAAWjN,EAAG6M,OAAO7N,GACrBkO,EAAa5iD,EAASoZ,KAAK,gBACjC,GAAIwpC,EAAWl7C,OAAQ,CACrB,MAAMm7C,EAAS1qD,QAAQkD,QACrBunD,EAAW,GAAG/J,cAAc,mBAExB3tC,EAAQ/S,QAAQkD,QACpBunD,EAAW,GAAG/J,cAAc,qBAExBiK,EAAQD,EAAOzpC,KAAK,SAEtB0pC,EAAMp7C,QACRo7C,EAAMC,IAAI,UAAW,QAGvBF,EAAOjqD,GAAG,SAAS,KACjBkqD,EAAMC,IAAI,UAAW,QACI,mBAAlB73C,EAAM83C,QACT93C,EAAM83C,QAAQ,SACd93C,EAAM,GAAG+3C,WAGf/3C,EAAMtS,GAAG,UAAWgiB,IAClBrhB,EAAOgD,QAAO,WACwB,iBAAzBomD,EAASO,MAAMvlD,QACxBglD,EAASO,MAAMvlD,MAAQ,MAKzB,MAAMmB,EAAQ5E,MAAMstB,KAAK5M,EAAEjc,OAAOG,OAE5BqkD,EAjSL,QAiSiBR,EAAS9+C,OAAOqa,KACdpf,EAAMskD,MAAMhlD,GAASA,EAAK8f,MAAQilC,KAKpDR,EAASlqD,QAAU,GACnBkqD,EAASO,MAAMvlD,MAAQglD,EAAS9+C,OAAOw/C,gBAEvCV,EAASlqD,QAAUqG,EAAMmI,KAAK7I,IAC5B,MAAM,KAAEN,EAAF,KAAQogB,EAAR,KAAc1W,GAASpJ,EAC7B,MAAO,CAAEN,KAAAA,EAAMogB,KAAAA,EAAM1W,KAAAA,EAAMpJ,KAAAA,MAG/Bs3C,EAAGuH,KAAK0F,EAASO,MAAMzX,OAASkX,EAASlqD,gBAkBjDi9C,EAAG4N,eANH,SAAwBX,EAAUjO,GAGhCiO,EAASlqD,QAAQqf,OAAO48B,EAAO,GAC/BgB,EAAGuH,KAAK0F,EAASO,MAAMzX,OAASkX,EAASlqD,SAuB3Ci9C,EAAG6N,eAfH,SAAwBZ,GACtB7jC,QAAQN,IAAI,kBAAmBmkC,GAC/B,MAAMC,EAAa5iD,EAASoZ,KAAK,gBAC3BlO,EAAQ/S,QAAQkD,QACpBunD,EAAW,GAAG/J,cAAc,sBAExB,eAAE2K,EAAF,OAAkBrqC,GAAWwpC,EAAS9+C,OACxC2/C,GACFt4C,EAAME,KAAK,WAAY,YAErB+N,GACFjO,EAAM,GAAGu4C,aAAa,SAAUtqC,IAapCu8B,EAAGgO,uBAPH,WACE,MAAMC,EAAWzpD,MAAMstB,KAAKxnB,EAASoZ,KAAK,oBACpCwqC,EAAUD,EAASA,EAASj8C,OAAS,GACvCk8C,GAAWA,EAAQpuC,gBACrBouC,EAAQpuC,kBAMZkgC,EAAG/vC,QAjTH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpBV,EAAGS,QAAU,CACXxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBkgD,cAAe,YACfr8B,KAhBK,YAAcs8B,GAAAA,CAAQ,EAAG,MAmBhCv1C,EAAW+nC,SAASyK,UAAW,EAC/BxyC,EAAWwuC,SAAU,EAErBxH,EAAI8I,YACDE,UAAU,CACT56C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACPw/C,EAAU/hD,EAAK+hD,QACfC,EAAgBO,GAAAA,CAAWviD,EAAK25C,MAChClE,EAAG6M,OAASC,GAAAA,CAAWP,OAG1B5+C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GAExB,GADApH,EAAW2zC,WAAa6B,EAAMv8C,UACH,IAAhBu8C,EAAMb,OACXa,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAASxiD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAGwO,UAAUvuC,GAAKsuC,EAAOF,EAAMb,MAAMc,eAK5CrpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OA2QpBkwB,EAAG+H,OA5LH,WAEElvC,EAAWwuC,SAAU,EAErB,MAAM98C,EAAO,IAAKy1C,EAAGuH,MAErB,IAAK,IAAItnC,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GACpBouC,EAAMb,YAA4C,IAA5BjjD,EAAK8jD,EAAMb,MAAMzX,SAEpC8P,GAAAA,CAAOwI,EAAMI,WAChBzO,EAAGS,QAAQ4N,EAAMI,SAAWjqD,MAAMoQ,QAAQrK,EAAK8jD,EAAMb,MAAMzX,QACvDxrC,EAAK8jD,EAAMb,MAAMzX,OAAOlgC,OACxBtL,EAAK8jD,EAAMb,MAAMzX,QAGnB91B,IAAMqsC,IACHzG,GAAAA,CAAOhtC,EAAW+nC,SAASuN,iBAC9BnO,EAAGS,QAAQ0N,cAAgBt1C,EAAW+nC,SAASuN,cAC/CnO,EAAGS,QAAQ3uB,KAAOttB,MAAMoQ,QAAQrK,EAAK8jD,EAAMb,MAAMzX,QAC7CxrC,EAAK8jD,EAAMb,MAAMzX,OAAOlgC,OACxBtL,EAAK8jD,EAAMb,MAAMzX,SAIN,WAAfsY,EAAMv8C,OACRvH,EAAK8jD,EAAMb,MAAMzX,OAASxrC,EAAK8jD,EAAMb,MAAMzX,OAAOxkC,KAC/C+U,GAASA,EAAK5d,SAMvB,MAAMgmD,EAAelqD,MAAMoQ,QAAQorC,EAAG6M,QAClC7M,EAAG6M,OAAO3gD,QAAQmiD,GAAyB,WAAfA,EAAMv8C,OAClC,GAEE68C,EAAU3G,GAAAA,CACd,CACElD,KAAMv6C,GAERy1C,EAAGS,SAGCmO,EAA4B,MAARrkD,GAAgBmkD,EAAa18C,OAAS,EAC1D68C,EAAyB,OAATtkD,GAA0C,OAAzBqW,KAAKE,UAAUvW,GAnFxD,IAAgBukD,EApCK1mD,GAwHGwmD,GApFRE,EAqFHH,EApFJ17C,EAAM,CACXoB,IAAM,GAAEwrC,EAAI4I,wBAAwBqG,EAAQ7gD,aAC5CsG,QAAS,CAAE,oBAAgBwC,GAC3BxM,KAAMwkD,GAAAA,CAAeD,EAAS,IACzBrC,EACHuC,gBAAiB,IAAI/C,WAEvBrD,OAAQ,UA8ENiG,EACAhP,EAAI8I,YAAYvD,QAAQuJ,GAAS/K,SACjC5M,QAAQC,OAAO,iBAGhBtpC,KAAKi/C,GACL3nC,OAhIgB7c,EAgIE,SAjHZ,SAAU0nB,GACf,MAAMg3B,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GAEd9G,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,QAsGvB69C,SAAQ,KACFpI,EAAGuH,KAAKtgB,UACX+Y,EAAGuH,KAAO,IAlLhB1uC,EAAWwuC,SAAU,MAsTvBrH,EAAGC,OA9HH,SAAgB73C,EAAM2a,GACfi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGuH,KAAKn/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGuH,KAAKn/C,GAAM/E,KAAK0f,IAsHvBi9B,EAAGhd,OAlHH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGX43C,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,IAAS,GA8GxCi9B,EAAGwO,UAAY,GAEfxO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GCnWhB,SAASuH,EACPp2C,EACAwC,EACAgxC,EACAxM,EACAD,EACAG,GAEA,MAAMC,EAAKp9C,KACX,IAAI0pD,EAAU,KAmJd,SAAS4C,IASP,OARAr2C,EAAW4nC,QAAU,CACnBxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBkhD,OAAQ,YACRr9B,KAhCK,YAAcs8B,GAAAA,CAAQ,EAAG,MAmChCv1C,EAAW+nC,SAASyK,UAAW,EAExBzL,EAAqBO,cAC1BJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACdy4C,EAAI8I,YACRE,UAAU,CACT56C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACPw/C,EAAU/hD,EAAK+hD,QACftM,EAAG6M,OAAStiD,EAAK25C,SAGpBv2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GACxB,GAAIouC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAASxiD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAGwO,UAAUvuC,GAAKsuC,EAAOF,EAAMb,MAAMc,eAI1CrpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,SAGnB7K,MAAM26B,EAAqBW,gBAzLhCP,EAAGwO,UAAY,GAGfxO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GACd1H,EAAGoP,aAAc,EAEjBpP,EAAG+M,YAAc,SAAU5kD,GACzB,OAAOkkD,EAAKU,YAAY5kD,IAmO1B63C,EAAG/vC,QAhDH,WAKE,GAJAmZ,QAAQo3B,MAAM,qCAAsC3nC,EAAW4nC,SAE/D5nC,EAAW6nC,OAAS,SAEhB7nC,EAAW4nC,SAAW5nC,EAAW4nC,QAAQ4B,YAC3C,GAAIxpC,EAAW4nC,QAAQ4B,YAAYp0C,GACjC,IAA8C,IAA1C4K,EAAW4nC,QAAQyJ,mBAErB7uC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,gBAEP,SACL,MAAM42C,EAAoBx2C,EAAW4nC,QAAQ4B,YAAYp0C,GACnDqhD,EAAYz2C,MAAAA,GAAH,UAAGA,EAAY4nC,eAAf,iBAAG,EAAqB/Z,eAAxB,aAAG,EAA8Bz4B,GAChD,GAAIqhD,EAAW,CACb,MAAM/kD,EAAO,CACX0D,GAAIohD,EACJE,QAAS,OACTlN,YAAa,CACXp0C,GAAIohD,GAEN3oB,QAAS,CACPz4B,GAAIqhD,GAENhF,YAAa,YACb5G,QAAQ,EACRC,YAAa,WAIf9D,EAAI2D,gBAAgByF,QAAQ1+C,GAAMq5C,SAASwE,SAAQ,IAC1C8G,YAMb7zC,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,iBAIdy2C,KAMJlP,EAAG+H,OA5KH,WACE,IAAIjD,EAAO,sBAEX,IAAK,IAAI7kC,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GAEpBouC,EAAMb,YAA+C,IAA/BxN,EAAGuH,KAAK8G,EAAMb,MAAMzX,SAEvC8P,GAAAA,CAAOwI,EAAMmB,YAChB32C,EAAW4nC,QAAQ4N,EAAMmB,UAAYhrD,MAAMoQ,QACzCorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAElBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAGrB8P,GAAAA,CAAOwI,EAAMI,WAChB51C,EAAW4nC,QAAQ4N,EAAMI,SAAWjqD,MAAMoQ,QACxCorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAElBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAGtB91B,IAAMqsC,IACHzG,GAAAA,CAAOhtC,EAAW+nC,SAASuO,UAC9Bt2C,EAAW4nC,QAAQ0O,OAASt2C,EAAW+nC,SAASuO,OAChDt2C,EAAW4nC,QAAQ3uB,KAAOttB,MAAMoQ,QAAQorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QACxDiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,SAIxBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,SACtB+O,GAAQuJ,EAAMb,MAAMzX,MAAQ,KAAOiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAS,OAvExE,IAAqBrP,EAAAA,EA8EjBshB,GAAAA,CACE,CACElD,KAAMA,EACN2K,QAAS52C,EAAW+nC,SAAS6O,QAC7BC,WAAY72C,EAAW+nC,SAAS8O,YAElC72C,EAAW4nC,SAnFfT,EAAGoP,aAAc,EAEjBvP,EAAI8I,YACD9c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG6G,OAAO8I,iBAEjB92C,EAAW4nC,QAAQ/Z,QAAU,CAC3Bz4B,GAAI1D,EAAKm8B,QAAQz4B,IAGnB4K,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAIvB2xC,EAAqBO,cAAcJ,EAAiBlnC,EAAW4nC,SAC5D9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAG9BP,EAAGoP,aAAc,EArChBv2C,EAAW+nC,SAASgP,sBAOvBv0C,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,YANZ4C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAuCXwM,OAAM,SAAU6K,GAEfkwB,EAAGoP,aAAc,EAEjBhmC,QAAQnhB,MAAM6nB,OAiLpBkwB,EAAGC,OArHH,SAAgB73C,EAAM2a,GACfi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGuH,KAAKn/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGuH,KAAKn/C,GAAM/E,KAAK0f,IA6GvBi9B,EAAGhd,OAzGH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGX43C,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,IAAS,GCxJ1C,SAAS8sC,EACPh3C,EACAwC,EACAurC,EACA/G,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAQX,SAAS0kD,IACHzuC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ/uC,EAAW4nC,QAAU,GAErB5nC,EAAWgvC,gBAAiB,EAC5BhvC,EAAWzJ,MAAM,QAQnB,SAAS25B,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMu8C,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,IAIlB,SAASM,IACPvuC,EAAWwuC,SAAU,EAjDvBrH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GAoGZ7G,EAAG/vC,QAhBH,WACEmZ,QAAQo3B,MAAM,wCAAyC3nC,EAAW4nC,SAClE5nC,EAAW6nC,OAAS,YAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWwuC,SAAU,KAKtCrH,EAAG+H,OAlDH,WACElvC,EAAWwuC,SAAU,EAEjBxuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDC,aAAa,CACZx1C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnC6hD,KAAM9P,EAAGuH,KAAKuI,OAEflM,SAASj2C,MAAK,kBACNqyC,EAAG6G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,MAEfn5C,KAAK0wC,GACL1wC,KAAK25C,GACLriC,MAAM8jB,EAAY,WAClBqf,QAAQhB,IAEXA,IACAre,EAAY,YAsBhBiX,EAAGqI,KA7EH,WACEhK,IACAiJ,KCxCJ,SAASyI,EACPl3C,EACAhV,EACAulD,EACA/tC,EACAwkC,EACAD,EACAG,GAGA,IAAIiQ,EAA+B,KAGnC,SAAS3F,IACP,IAAIhI,EAAc,GACd4N,GAAO,EAEXpQ,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,GAGvB,OAFA83C,EAAc93C,EAEPs1C,EAAI2D,gBAAgBM,YAAY,CACrCC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,KACrC21C,YAEJj2C,MAAK,SAAUpD,GACd0lD,EAAO1lD,EAAK25C,KAAKlyC,OAAS,EAEtBqwC,EAAYqB,QACd7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACW,cAA5Bi7C,EAAYiI,aACdjvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,eAGhDwM,MAAM26B,EAAqBW,kBACrB8B,EAAYoC,QAAUwL,KAE3B5N,EAAYoC,SACd5rC,EAAW4nC,QAAQ4B,YAAYoC,OAASpC,EAAYoC,QAEtD7E,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACdyJ,oBAAoB,IAEnBv8C,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACrBiU,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,eAEzCwM,MAAM26B,EAAqBW,oBAKjCt7B,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA9DbltB,KAqFRqN,QAdH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGlB7nC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,KAG/B+hD,EAA+B5G,EAAUiB,EAAgB,OAQ7DxmD,EAAOsB,IAAI,YAtBX,WACEikD,EAAUriD,OAAOipD,iqBCzFrB,MAAMpQ,EAOJ54B,YAAYxO,EAASK,EAAYlP,GAAI,oBACnC/G,KAAKstD,cAAgB,IAAIC,IAAIt3C,EAAW+nC,SAASwP,SAASC,OAC1DztD,KAAK6V,SAAWI,EAAW+nC,SAASnoC,SACpC7V,KAAK+G,GAAKA,EACV/G,KAAK4V,QAAUA,EA4CjB83C,QAAQ7nD,EAAKrB,GACX,MAAMmpD,EAAS,UACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAClB,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,EAAKrB,MAAAA,GACfxE,KAAKstD,kBASXjO,QAAQx5C,GACN,MAAM8nD,EAAS,UACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,CAAC2X,EAAG2C,KACvCxT,EAAQwT,MAEVngB,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,GAAO7F,KAAKstD,kBAQ1DpI,WAAWr/C,GACT,MAAM8nD,EAAS,aACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,GAAO7F,KAAKstD,kBAuB1D/P,cAAc13C,EAAK8B,GAAsB,IAAhBkF,EAAgB,wDAEvC,OAAO7M,KAAKq/C,QAAQx5C,GAAKkF,MAAMoV,IAC7B,MAAMytC,EAAU,EAAA5tD,KAAA,UAAAA,KAAgBmgB,IAAS,GAMzC,OALItT,SACK+gD,EAAQ5tD,KAAK6V,UAEpB+3C,EAAQ5tD,KAAK6V,UAAYlO,EAEpB3H,KAAK0tD,QAAQ7nD,EAAK+nD,GAAS7iD,MAAK,IAAM6iD,EAAQ5tD,KAAK6V,eAQ9D8nC,eAAezwB,GACb1G,QAAQnhB,MAAM,gBAAiB6nB,eAnHdygC,EAAQ9nD,EAAKrF,GAE9B,MAAM29B,EAAY7b,IAChB,MAAMurC,EAAkB,GAAEF,UAC1B,GACErrC,EAAEmrC,SAAWztD,KAAKstD,eAClBznD,IAAQyc,EAAE3a,KAAK9B,KACfgoD,IAAmBvrC,EAAE3a,KAAKgmD,OAC1B,CACA,MAAM,OAAEA,EAAF,KAAUxtC,GAASmC,EAAE3a,KAE3B,OADA6e,QAAQo3B,MAAO,UAAS/3C,cAAgB8nD,uBAA6BrrC,GAC7DqrC,GACN,IAAK,gBACHntD,EAASqF,GACT,MACF,IAAK,gBACHrF,EAASqF,EAAKsa,GACd,MACF,IAAK,mBACH3f,EAASqF,GACT,MACF,QACE2gB,QAAQo3B,MAAM,qBAAsB+P,GAIxC3tD,KAAK4V,QAAQk4C,oBAAoB,UAAW3vB,GAAU,KAG1Dn+B,KAAK4V,QAAQgtC,iBAAiB,UAAWzkB,GAAU,cAiD1C4vB,GACT,IAAI/zB,EAAS+zB,EACb,GAAsB,iBAAX/zB,EACT,IACEA,EAAShc,KAAK/W,MAAM8mD,GACpB,MAAO1oD,GACPmhB,QAAQwnC,KAAM,oBAAmBD,KAAe1oD,GAChD20B,EAAS+zB,EAGb,OAAO/zB,EC3EX,SAASi0B,EAAgBxE,GACvB,OAAO,SAAUjlD,GACf,OAAOilD,EAAKU,YAAY3lD,+DAqI5B3E,QACGC,OAFiB,cAEG,CACnB,YACA,SACA,aACA,aACA,aACA,aACA,QACA,UACA,YACA,qBACA,WACA,SAEDwJ,OAAO,YAAa2kD,GACpBC,SAAS,iBAAkB,eAC3BA,SAAS,kBAAmB,WAC5BA,SAAS,iBAAkB,UAC3Bz2C,QAAQ,uBAAwBulC,GAChCn6C,UAAU,WAnCb,WACE,OAAO,SAAUC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,oBAAoB,SAAU/C,GACrB,KAAhBA,EAAMu6C,QACRh4C,EAAMmB,QAAO,WACXnB,EAAMzB,MAAM2B,EAAMmrD,YAEpB5tD,EAAMgD,yBA6BXV,UAAU,WArJb,WA0GE,MAAO,CACL0F,KAVF,SAAczF,EAAOC,GACnBA,EAAQzC,GAAG,SAAS,WACE+lB,SAAS+nC,eAAe,iBAlGhD,SAAsBltC,EAAMpe,GAE1B,MAAMurD,EAAMhoC,SAAS45B,cAAc,OAC7BpC,EAAU/6C,EAAM+6C,QAChBG,EAAWl7C,EAAMk7C,SACvB,IAAIsQ,EAEJ,IAAK,IAAIjxC,EAAI,EAAGA,EAAIva,EAAMmlD,SAAS74C,OAAQiO,IAAK,CAC9C,MAAMymB,EAAUhhC,EAAMmlD,SAAS5qC,GAC/B,IAAImkC,EAAS,WACb,MAAMU,EAAO,YAAcpe,EAAQoe,KAC7BqM,EACJ,YAAcnM,GAAAA,CAAOte,EAAQqe,WAAWv6B,OAAO,uBAEjD,GAAU,IAANvK,EAAJ,CAKA,OAAQva,EAAMk7C,SAAS4D,iBACrB,IAAK,gBACHJ,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN7D,EAAS8D,WAAahe,EAAQ+d,OAC9B,SACF7D,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,IAAK,cACHH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN/d,EAAQie,KAAKC,OAASle,EAAQie,KAAKE,SACnC,SACFjE,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,IAAK,iBACHH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN/d,EAAQie,KAAKE,SACb,SACFjE,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,QACEH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,QACL7D,EAAS8D,YAAc,SAAWhe,EAAQ+d,OAC3C,SACF7D,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAG9B0M,EAAInO,YAAY75B,SAASmoC,eAAehN,IACxC6M,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAASmoC,eAAetM,IACxCmM,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAASmoC,eAAeD,IACxCF,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAAS45B,cAAc,YAvDrCqO,EAAYxqB,EAAQqe,UA0DxB,MAAMsM,EAAWloC,OAAO8mC,OAExBoB,EAASpoC,SAASqoC,MAAM,sBAAwBroC,SAAS8sB,MAAQ,YACjEsb,EAASpoC,SAASqoC,MAAM,kBACxBD,EAASpoC,SAASqoC,MAAM,iBAAmB1Q,EAAS6O,QAAU,SAC9D4B,EAASpoC,SAASqoC,MAChB,oBACEtM,GAAAA,CAAOkM,GAAW1mC,OAAO,uBACzB,SAEJ6mC,EAASpoC,SAASqoC,MAChB,oBAAsBtM,GAAAA,GAASx6B,OAAO,uBAAyB,SAEjE6mC,EAASpoC,SAASqoC,MAAML,EAAIM,WAC5BF,EAASpoC,SAASqoC,MAAM,kBAExBD,EAASpoC,SAASg6B,QAClBoO,EAASG,QAETH,EAASI,QACTJ,EAASpO,QAOLyO,CAAaC,EAAajsD,OAO9BqE,SAAU,QA2CXnG,WAAW,iBAAkBulD,GAE7BvlD,WAAW,oBAAqB+iD,GAEhCx4C,OA3BH,sBA2BU,SAAUyjD,GAChBA,EAAmBC,qBAEpBjuD,WAAW,kBAAmB87C,GAE9B58C,QAAQ,MAAOwlD,GAEfn6C,OAAO23C,GACP3qC,IAAIsqC,GAEJ7hD,WAAW,oBAAqBwoD,GAEhCj+C,OAvCH,sBAuCU,SAAUyjD,GAChBA,EAAmBC,qBAEpBjuD,WAAW,mBAAoBqrD,GAE/BrrD,WAAW,sBAAuBisD,GAElCjsD,WAAW,oBAAqBmsD,wFCjNnCrtD,EAAOovD,QAAU,WACf,GAA0B,iBAAfC,WACT,OAAOA,WAGT,IAAItxC,EAEJ,IAGEA,EAAI7d,MAAQ,IAAI0mB,SAAS,cAAb,GACZ,MAAOpE,GAEP,GAAsB,iBAAXiE,OACT,OAAOA,OAIT,GAAoB,iBAAT7Y,KACT,OAAOA,KAIT,QAAsB,IAAX,EAAAmQ,EACT,OAAO,EAAAA,EAIX,OAAOA,EA5BQ,wECHjB,WAoBE7d,QAjBM4d,EAAO,SAON,KAFU,EAAF,WACL,OAAQA,EAAKuuC,eAWjB,WAWJ,SAASn6C,EAAQhO,GAEb,MAAmC,mBAA5B,GAAK8Q,SAAS/S,KAAKiC,GAG9B,SAASorD,EAAaprD,GAElB,QAAQgO,EAAQhO,IAAuB,iBAARA,IAAsBA,GAASA,aAAeqrD,MAAWrrD,aAAeuuB,MAQ3G,SAAS+8B,IAEL,MAA2B,mBAAbjG,SAGlB,SAASkG,IAEL,GAAID,IACA,OAAO,IAAIjG,SAkCnB,SAASmG,EAAmBC,EAAYtvD,EAASuvD,EAAUC,GAEvD,IAAIvT,EAAQ,EAEZ,IAAK,IAAIv2C,KAAO4pD,EAAY,CAExB,GAAIA,EAAW/sD,eAAemD,GAAM,CAEhC,IAAI+pD,EAAWD,GAAa9pD,EACxBrB,EAAQrE,EAAQirB,QAAQqkC,EAAW5pD,IAevC,GAbI8pD,GAAaP,EAAaK,KAC1BG,EAAWD,EAAY,IAAM9pD,EAAM,KAGnC8pD,GAAa39C,EAAQy9C,KAGjBG,EADA59C,EAAQxN,IAAUrE,EAAQ2pD,qBACf6F,EAAY,IAAMvT,EAAQ,IAE1BuT,EAAY,MAI3B39C,EAAQxN,IAAU4qD,EAAa5qD,GAE/BgrD,EAAmBhrD,EAAOrE,EAASuvD,EAAUE,QAE1C,GAAIprD,aAAiBqrD,SAExB,IAAK,IAAInyC,EAAI,EAAGA,EAAIlZ,EAAM4K,OAAQsO,IAC9BgyC,EAASr1B,OAAOu1B,EAAW,IAAMlyC,EAAI,IAAKlZ,EAAM2b,KAAKzC,SAElDlZ,aAAiB6qD,KAExBK,EAASr1B,OAAOu1B,EAAUprD,EAAOA,EAAMgB,MAEhChB,aAAiB+tB,KAExBm9B,EAASr1B,OAAOu1B,EAAUprD,EAAMsrD,gBAEb,OAAVtrD,GAAkBrE,EAAQ4pD,mBAAgC,OAAVvlD,SAA6B2P,IAAV3P,GAE5EkrD,EAASr1B,OAAOu1B,EAAUprD,GAGlC43C,IAEJ,OAAOsT,EAEX,OAhFA,SAAiBD,EAAYtvD,GAEzB,GAAIA,GAAWA,EAAQisD,iBAEnB,GAnB8B,mBAmBDjsD,EAAQisD,gBAnBlB/xB,OAqBf,KAAM,qDAEP,IAAKi1B,IAER,KAAM,8FA3Bd,IA0CQS,EA5DG,CAgDc,CACjB3D,gBAAiBmD,IACjBzF,sBAAsB,EACtBC,mBAAmB,EACnB3+B,QAAS,SAAS5mB,GACd,MAAqB,kBAAVA,GACCA,EAAQ,IAAK,IAElBA,IAIkCrE,GAAW,IA5DlCyO,QAAO,SAAUohD,EAAOC,GAI9C,OAHA18C,OAAOC,KAAKy8C,GAAelvD,SAAQ,SAAUmvD,GACzCF,EAAME,GAAaD,EAAcC,MAE9BF,IACR,IAyDH,OAAOR,EAAmBC,EAAYM,EAAeA,EAAc3D,kBA5EjClsD,IACjC,QAFM,OAEN,oECDD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8FAA8FttC,MAClG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C2tC,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExB+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,eACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,YACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB5yD,CAAQ,EAAQ,8FCOlD,SAAWkiD,GAAU,aAIzB,IAAI2Q,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,OACA,SACA,MACA,SACA,SACA,SACA,UAGGhO,EAAO+N,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBQ,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtJyB5yD,CAAQ,EAAQ,8FCDlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MApDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPX,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGGhO,EAAO+N,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzKyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFxR,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETb,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGChO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzLyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+EAA+EttC,MACnF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,qEAAqExtC,MAC3E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,+BACVC,QAAS,aACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,kBACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,SACHC,GAAI,SAER/B,cAAe,0BACfC,KAAM,SAAU99C,GACZ,MAAO,mBAAmBuQ,KAAKvQ,IAEnC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SAEA,SAGfd,uBAAwB,wCACxBC,QAAS,SAAUC,GACf,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GASnD,MAAY,MAARA,EACOstD,EAAgB,UAAY,UACpB,MAARttD,EACAstD,EAAgB,UAAY,UAE5BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,yBAA2B,yBAC/Cf,GAAI,iBACJE,GAAI,uBACJE,GAAI,kBAOgC3sD,GArBvBid,MAAM,KAChBixC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAyBC5R,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,uGAAuG9E,MAC3G,KAEJmxC,WAAY,qGAAqGnxC,MAC7G,MAGRutC,YAAa,0DAA0DvtC,MACnE,KAEJwtC,SAAU,CACN1oC,OAAQ,0DAA0D9E,MAC9D,KAEJmxC,WAAY,0DAA0DnxC,MAClE,KAEJoxC,SAAU,+CAEd3D,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBACTE,QAAS,eACTD,SAAU,WACN,MAAO,mBAEXE,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN30C,EAAG,kBACHpI,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG4B,EACH3B,GAAI2B,EACJ36B,EAAG,QACHi5B,GAAI0B,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,yBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAQzB,EAAS,IAAO,GAAKA,EAAS,IAAO,GACzCA,EAAS,KAAQ,IACjBA,EAAS,KAAQ,GAEfA,EAAS,KADTA,EAAS,KAEnB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,SACHi9C,GAAI,YACJC,EAAG,MACHC,GAAI,UACJh5B,EAAG,MACHi5B,GAAI,UACJiC,EAAG,UACHC,GAAI,aACJjC,EAAG,QACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KArFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IttC,MAClJ,KAEJutC,YAAa,iDAAiDvtC,MAAM,KACpEwtC,SAAU,+CAA+CxtC,MAAM,KAC/DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,2BACJC,IAAK,wCACLC,KAAM,8CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,qBACVC,QAAS,iBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,aACHC,GAAI,UACJC,EAAG,YACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFxR,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,uCAAuCztC,MAAM,KAC5D0tC,YAAa,kCAAkC1tC,MAAM,KACrDiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAIzBy0C,cAAe,uCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,QAAb5C,GAEa,SAAbA,EADA4C,EAGa,UAAb5C,EACA4C,GAAQ,EAAIA,EAAOA,EAAO,GACb,UAAb5C,GAEa,YAAbA,EADA4C,EAAO,QACX,GAKX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,EACP,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QACAA,EAAO,GACP,UAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KA9HyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,uCAAuCztC,MAAM,KAC5D0tC,YAAa,kCAAkC1tC,MAAM,KACrDiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,2BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,QAAb5C,GAAsB4C,GAAQ,GACjB,UAAb5C,GAAwB4C,EAAO,GACnB,UAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qJAAqJttC,MACzJ,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ4xC,iBAAkB,gBAClBC,kBAAkB,EAClBrE,SAAU,gFAAgFxtC,MACtF,KAEJytC,cAAe,oDAAoDztC,MAC/D,KAEJ0tC,YAAa,6BAA6B1tC,MAAM,KAChDiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,wBACVC,QAAS,YACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,QACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,WACJC,EAAG,cACHC,GAAI,YACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,YACHC,GAAI,UACJC,EAAG,UACHC,GAAI,SAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,wCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACpB,YAAb5C,GAA0B4C,EAAO,GACrB,YAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,UACAA,EAAO,GACP,UACAA,EAAO,GACP,UAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAxHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASwS,EAAyBjC,EAAQQ,EAAettD,GAMrD,OAAO8sD,EAAS,IAoBpB,SAAkB/vC,EAAM+vC,GACpB,OAAe,IAAXA,EAKR,SAAsB/vC,GAClB,IAAIiyC,EAAgB,CAChB7/C,EAAG,IACH4J,EAAG,IACHua,EAAG,KAEP,YAAsChlB,IAAlC0gD,EAAcjyC,EAAKnd,OAAO,IACnBmd,EAEJiyC,EAAcjyC,EAAKnd,OAAO,IAAMmd,EAAKqX,UAAU,GAb3C66B,CAAalyC,GAEjBA,EAxBemyC,CALT,CACT9C,GAAI,WACJK,GAAI,MACJF,GAAI,UAE8BvsD,GAAM8sD,GAchD,SAASqC,EAAWrC,GAChB,OAAIA,EAAS,EACFqC,EAAWrC,EAAS,IAExBA,EAoBX,IAAIsC,EAAc,CACV,QACA,cACA,QACA,QACA,QACA,cACA,QACA,QACA,QACA,QACA,OACA,SAEJC,EAAc,6IAqBdC,EAAmB,CACf,OACA,OACA,eACA,QACA,OACA,OACA,QAGC/S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFttC,MACpF,KAEJutC,YAAa,mDAAmDvtC,MAAM,KACtEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CsyC,cAAeD,EACfE,kBArCoB,CAChB,QACA,QACA,WACA,iBACA,SACA,WACA,YA+BJC,mBA7BqB,CACjB,QACA,QACA,QACA,QACA,QACA,QACA,SAuBJH,iBAAkBA,EAElBD,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA7CoB,wFA8CpBC,uBA7CyB,2DA8CzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElBlE,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sBACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,qBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,SACN30C,EAAG,wBACH40C,GAAI,YACJh9C,EAAG,cACHi9C,GAAI2C,EACJ1C,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAIwC,EACJvC,EAAG,SACHC,GAAIsC,EACJrC,EAAG,WACHC,GApIR,SAAiCG,GAC7B,OAAQqC,EAAWrC,IACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOA,EAAS,SACpB,QACI,OAAOA,EAAS,YA6HxBF,uBAAwB,kBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,KAAO,QAGvCC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,YACfC,KAAM,SAAUnvC,GACZ,MAAiB,SAAVA,GAEXovC,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAOyC,EAAO,GAAK,OAAS,UAnKErzD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXqsD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIrsD,GADW,IAAXqsD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,cACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,MACHi5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAlJyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJ6D,WAAY,oFAAoFnxC,MAC5F,KAEJ8E,OAAQ,qHAAqH9E,MACzH,KAEJoxC,SAAU,mBAEd7D,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,gCACLyE,IAAK,mBACLxE,KAAM,qCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,WACL,MAAO,YAA+B,IAAjBvxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9DY,QAAS,WACL,MAAO,YAA+B,IAAjBxxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9Da,SAAU,WACN,MAAO,YAA+B,IAAjBzxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9Dc,QAAS,WACL,MAAO,YAA+B,IAAjB1xD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9De,SAAU,WACN,MACI,wBACkB,IAAjB3xD,KAAK4wD,QAAgB,MAAQ,MAC9B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN30C,EAAG,aACH40C,GAAI,YACJh9C,EAAG,WACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA/FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,oFAAoFttC,MACzF,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,yBACA,4BACA,QACA,QACA,QACA,QACA,SAIJC,EAAc,wJAElB,SAASc,EAAOz1C,GACZ,OAAOA,EAAI,GAAKA,EAAI,GAAoB,MAAZA,EAAI,IAEpC,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAEvCrsD,EAAS,YAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,MAAQ,OAEnCrsD,EAAS,MAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,QAAU,UACjD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,UAEtCrsD,EAAS,SAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,OAAS,OAEpCrsD,EAAS,QAKvB87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACb6E,YAAaA,EACbR,iBAAkBQ,EAGlBK,kBAAmB,uKACnBC,uBAAwB,sDACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,mDAAmDxtC,MAAM,KACnEytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,yBACN5+B,EAAG,cAEP6+B,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,mBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,iBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gEAAgEttC,MACpE,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,oEAAoExtC,MAC1E,KAEJytC,cAAe,6BAA6BztC,MAAM,KAClD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sCACJC,IAAK,6CACLC,KAAM,oDAEVC,SAAU,CACNC,QAAS,sBACTC,QAAS,sBACTE,QAAS,sBACTD,SAAU,4BACVE,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUiE,GAMd,OAAOA,GALK,UAAUtsD,KAAKssD,GACrB,MACA,QAAQtsD,KAAKssD,GACb,MACA,QAGVhE,KAAM,YACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,cACxBC,QAAS,SACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,qDAAqDvtC,MAC9D,KAEJwtC,SAAU,+EAA+ExtC,MACrF,KAEJytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EAEpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,UACHi5B,GAAI,aACJC,EAAG,MACHC,GAAI,SACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,mCAExBC,QAAS,SAAUC,GACf,IACIoD,EAAS,GAiCb,OAlCQpD,EAyBA,GAEAoD,EADM,KA1BNpD,GA0BkB,KA1BlBA,GA0B8B,KA1B9BA,GA0B0C,KA1B1CA,GA0BsD,MA1BtDA,EA2BS,MAEA,MA7BTA,EA+BO,IACXoD,EA9BS,CACL,GACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,OAvBApD,IAkCDA,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA9FyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,mBACVC,QAAS,iBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,cACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,aACJC,EAAG,QACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,8FCMlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cu8C,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,8FCAlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cu8C,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG/Cu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,WACA,aACA,SACA,WACA,KACA,OACA,SACA,WACA,eACA,aACA,aACA,cAEJE,EAAW,CACP,WACA,OACA,WACA,OACA,aACA,SACA,YAGClO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUA,EACVC,cAAeD,EACfE,YAAa,qCAAqC1tC,MAAM,KACxDiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,WACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,QACfC,KAAM,SAAU99C,GACZ,MAAO,OAASA,GAEpB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,UACVC,QAAS,cACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,YACN30C,EAAG,iBACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,cACJh5B,EAAG,WACHi5B,GAAI,YACJC,EAAG,SACHC,GAAI,UACJC,EAAG,WACHC,GAAI,aAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAxFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAWhBA,EAAO+N,aAAa,KAAM,CAC/B+F,mBAAoB,qHAAqHpzC,MACrI,KAEJqzC,iBAAkB,qHAAqHrzC,MACnI,KAEJstC,OAAQ,SAAUgG,EAAgBxuC,GAC9B,OAAKwuC,EAGiB,iBAAXxuC,GACP,IAAIzE,KAAKyE,EAAOqS,UAAU,EAAGrS,EAAO1Z,QAAQ,UAGrClO,KAAKq2D,kBAAkBD,EAAeE,SAEtCt2D,KAAKu2D,oBAAoBH,EAAeE,SARxCt2D,KAAKu2D,qBAWpBlG,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C6tC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCJ,KAAM,SAAU99C,GACZ,MAAyC,OAAjCA,EAAQ,IAAIsU,cAAc,IAEtCupC,cAAe,gBACfM,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVmF,WAAY,CACRjF,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,gCACX,QACI,MAAO,mCAGnBvC,SAAU,KAEdN,SAAU,SAAUzrD,EAAK4wD,GACrB,IApEY7jD,EAoERmjD,EAAS/1D,KAAK02D,YAAY7wD,GAC1B+qD,EAAQ6F,GAAOA,EAAI7F,QAIvB,OAzEYh+C,EAsEGmjD,GApEM,oBAAbrvC,UAA4B9T,aAAiB8T,UACX,sBAA1CnT,OAAO1R,UAAUiT,SAAS/S,KAAK6Q,MAoE3BmjD,EAASA,EAAO5zD,MAAMs0D,IAEnBV,EAAOhhD,QAAQ,KAAM67C,EAAQ,IAAO,EAAI,MAAQ,SAE3DiB,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,oBACH40C,GAAI,kBACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,WACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,eACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,2FCMlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,4BACJC,IAAK,kCACLC,KAAM,2CACNyE,KAAM,uCAEVrF,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3BypC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,SAAW,SAErBA,EAAU,SAAW,UAGpCQ,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,kBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA/DyB5yD,CAAQ,EAAQ,8FCDlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB12D,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAET9S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB12D,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,eAAgB,cAAe,iBACnC40C,GAAI,CAACW,EAAS,UAAWA,EAAS,YAClC39C,EAAG,CAAC,aAAc,aAClBi9C,GAAI,CAACU,EAAS,UAAWA,EAAS,YAClCT,EAAG,CAAC,YAAa,YAAa,YAC9BC,GAAI,CAACQ,EAAS,SAAUA,EAAS,UACjCx5B,EAAG,CAAC,YAAa,YACjBk5B,EAAG,CAAC,UAAW,WAAY,WAC3BC,GAAI,CAACK,EAAS,OAAQA,EAAS,SAC/BJ,EAAG,CAAC,YAAa,QAAS,aAC1BC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAIQ,EACOvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAElDutD,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG1Cu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,iEAAiExtC,MACvE,KAEJytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,qBACVC,QAAS,aACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI,WACJC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+FAA+FttC,MACnG,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sEAAsExtC,MAC5E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,gCACLC,KAAM,sCACN5+B,EAAG,WACHmjC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCAEVxE,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,eACHC,GAAI,cACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,qDAAoExtC,MAC1E,KAEJytC,cAAe,qDAAoEztC,MAC/E,KAEJ0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,aAAauQ,KAAKvQ,IAE7B+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,UAAU,SAAUiH,GACzB,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB09C,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,MA5GyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyU,EAAc,wEAAwE/zC,MAClF,KAEJg0C,EAAgB,CACZ,QACA,QACA,SACA,SACA,SACA,SACA,SACAD,EAAY,GACZA,EAAY,GACZA,EAAY,IAEpB,SAASlB,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAAS,GACb,OAAQT,GACJ,IAAK,IACD,OAAOutD,EAAW,oBAAsB,kBAC5C,IAAK,KACD9sD,EAAS8sD,EAAW,WAAa,WACjC,MACJ,IAAK,IACD,OAAOA,EAAW,WAAa,WACnC,IAAK,KACD9sD,EAAS8sD,EAAW,WAAa,YACjC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,YAAc,WACpC,IAAK,KACD9sD,EAAS8sD,EAAW,YAAc,YAClC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAIvC,OAEJ,SAAsBT,EAAQS,GAC1B,OAAOT,EAAS,GACVS,EACI0D,EAAcnE,GACdkE,EAAYlE,GAChBA,EARGoE,CAAapE,EAAQS,GAAY,IAAM9sD,EAW3C87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2GAA2GttC,MAC/G,KAEJutC,YAAa,uEAAuEvtC,MAChF,KAEJwtC,SAAU,qEAAqExtC,MAC3E,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,mBACJC,IAAK,gCACLC,KAAM,sCACN5+B,EAAG,WACHmjC,GAAI,cACJC,IAAK,2BACLC,KAAM,iCAEVxE,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,4FCIlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4EAA4ExtC,MAClF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN30C,EAAG,YACH40C,GAAI,cACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,cACHC,GAAI,aACJC,EAAG,UACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,SAlEjBzyD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAEI8S,EAAc,yKACdD,EAAc,CACV,SACA,SACA,SACA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,SAGC7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJoyC,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA3BoB,2FA4BpBC,uBA3ByB,oFA4BzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,cACHC,GAAI,cACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAIJ,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,IAG3C,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAGCs/B,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,iGAAiGttC,MACrG,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAOfrC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aA4ChBA,EAAO+N,aAAa,KAAM,CAC/BC,OAzCS,CACL,SACA,UACA,QACA,UACA,YACA,YACA,OACA,SACA,eACA,mBACA,UACA,WA8BJC,YA5Bc,CACV,MACA,QACA,OACA,MACA,OACA,QACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,eACA,WACA,WACA,cACA,YACA,YACA,eAUJC,cARgB,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,QASnEC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAK,MASlDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,kBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,YACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,UACHi9C,GAAI,aACJC,EAAG,iBACHC,GAAI,oBACJh5B,EAAG,KACHi5B,GAAI,QACJC,EAAG,KACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aA4ChBA,EAAO+N,aAAa,KAAM,CAC/BC,OAzCS,CACL,gBACA,aACA,UACA,aACA,aACA,eACA,cACA,cACA,eACA,aACA,eACA,gBA8BJC,YA5Bc,CACV,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,cACA,UACA,UACA,YACA,YACA,WACA,eAUJC,cARgB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAS3DC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MASnDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,gBACN30C,EAAG,gBACH40C,GAAI,YACJh9C,EAAG,UACHi9C,GAAI,gBACJC,EAAG,OACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,WACJC,EAAG,OACHC,GAAI,YACJC,EAAG,WACHC,GAAI,eAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,mDAAmDxtC,MAAM,KACnEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,UAA6B,IAAjBvxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1DY,QAAS,WACL,MAAO,UAA6B,IAAjBxxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1Da,SAAU,WACN,MAAO,UAA6B,IAAjBzxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1Dc,QAAS,WACL,MAAO,UAA6B,IAAjB1xD,KAAK4wD,QAAgB,IAAM,KAAO,QAEzDe,SAAU,WACN,MACI,qBAAwC,IAAjB3xD,KAAK4wD,QAAgB,KAAO,KAAO,QAGlEgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU9gD,GACd,OAA0B,IAAtBA,EAAI9C,QAAQ,MACL,IAAM8C,EAEV,MAAQA,GAEnB+gD,KAAM,SACN30C,EAAG,eACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxEyB5yD,CAAQ,EAAQ,iGCGlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,cACvB40C,GAAI,CAACW,EAAS,aAAcA,EAAS,UACrC39C,EAAG,CAAC,aAAc,YAClBi9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,WAAY,SAChBC,GAAI,CAACQ,EAAS,UAAWA,EAAS,SAClCx5B,EAAG,CAAC,YAAa,UACjBi5B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,gBAAiB,aACrBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,WAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCu8C,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,wFAAwFnxC,MAChG,KAEJ8E,OAAQ,mJAAmJ9E,MACvJ,KAEJoxC,SAAU,mBAEd7D,YAAa,4EAA4EvtC,MACrF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,4CAA4CztC,MAAM,KACjE0tC,YAAa,wBAAwB1tC,MAAM,KAC3CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,kBACJC,IAAK,qBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,8BACLC,KAAM,uCACNyE,KAAM,oCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,eACTC,SAAU,qBACVC,QAAS,WACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,MACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,4BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,WAAb5C,EACA4C,EACa,YAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,UACAA,EAAO,GACP,QAEA,UAzHmBrzD,CAAQ,EAAQ,iGCGlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,qBAAsB,iBAC1B40C,GAAI,CAACW,EAAS,cAAeA,EAAS,WACtC39C,EAAG,CAAC,aAAc,YAClBi9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,YAAa,UACjBC,GAAI,CAACQ,EAAS,WAAYA,EAAS,UACnCx5B,EAAG,CAAC,YAAa,UACjBi5B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,eAAgB,aACpBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,YAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCu8C,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,4EAA4EnxC,MACpF,KAEJ8E,OAAQ,wIAAwI9E,MAC5I,KAEJoxC,SAAU,mBAEd7D,YAAa,4DAA4DvtC,MACrE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,iBACJC,IAAK,oBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,sCACNyE,KAAM,mCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,cACTC,SAAU,sBACVC,QAAS,WACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,cACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,KACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,+BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAzHmBrzD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,mCAAmCztC,MAAM,KACxD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,gBACJC,IAAK,mBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,WACH40C,GAAI,WACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,SAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,OACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0EAA0EttC,MAC9E,KAEJutC,YAAa,4DAA4DvtC,MACrE,KAEJwtC,SAAU,uCAAuCxtC,MAAM,KACvDytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,6BACN5+B,EAAG,WACHmjC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,cACTC,QAAS,aACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN30C,EAAG,aACH40C,GAAI,WACJh9C,EAAG,MACHi9C,GAAI,UACJC,EAAG,MACHC,GAAI,SAAUQ,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBx5B,EAAG,MACHi5B,GAAI,SAAUO,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBN,EAAG,OACHC,GAAI,SAAUK,GACV,OAAe,IAAXA,EACO,UAEJA,EAAS,WAEpBJ,EAAG,MACHC,GAAI,SAAUG,GACV,OAAe,IAAXA,EACO,SACAA,EAAS,IAAO,GAAgB,KAAXA,EACrBA,EAAS,OAEbA,EAAS,UAGxBlC,cAAe,gEACfC,KAAM,SAAU99C,GACZ,MAAO,8BAA8BuQ,KAAKvQ,IAE9C+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,aACAA,EAAO,GACP,QACAA,EAAO,GACPzC,EAAU,SAAW,eACrByC,EAAO,GACPzC,EAAU,QAAU,eAEpB,UAzFmB5wD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETqB,EAAc,CACV,OACA,WACA,UACA,UACA,OACA,QACA,QACA,OACA,aACA,UACA,WACA,cAiBC7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,8EAA8E9E,MAClF,KAEJmxC,WAAY,0EAA0EnxC,MAClF,MAGRutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAGV4D,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAzCmB,CACf,OACA,QACA,UACA,UACA,OACA,QACA,QACA,OACA,QACA,UACA,OACA,SA+BJR,YAAa,+KAEbR,iBAAkB,+KAElBa,kBAAmB,uIAEnBC,uBAAwB,sFAExBlE,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,WACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG,cACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,QAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAlKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXqsD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIrsD,GADW,IAAXqsD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oGAAoG9E,MACxG,KAEJmxC,WAAY,gGAAgGnxC,MACxG,MAGRutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,cACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,MACHi5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxJyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAI8U,EAAc,gEAAgEp0C,MAC9E,KAEJ,SAAS6yC,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAIW,EAAMpB,EACV,OAAQ9sD,GACJ,IAAK,IACD,OAAOutD,GAAYD,EACb,mBACA,oBACV,IAAK,KACD,OAAOY,GAAOX,GAAYD,GACpB,aACA,cACV,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,QAAU,UAC1D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,QAAU,UACxD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,SAAW,YAC3D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,SAAW,YACzD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,MAAQ,QACxD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,MAAQ,QAE1D,MAAO,GAEX,SAASP,EAAKQ,GACV,OACKA,EAAW,GAAK,WACjB,IACA8D,EAAYl3D,KAAKm0D,OACjB,aAIC/R,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVZ,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3BypC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,IACW,IAAZE,EAAmB,KAAO,MAEd,IAAZA,EAAmB,KAAO,MAGzCQ,SAAU,CACNC,QAAS,gBACTC,QAAS,oBACTC,SAAU,WACN,OAAOmB,EAAK7wD,KAAK/B,MAAM,IAE3B0xD,QAAS,oBACTC,SAAU,WACN,OAAOiB,EAAK7wD,KAAK/B,MAAM,IAE3B4xD,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,KACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,CACJxoC,OAAQ,4GAA4G9E,MAChH,KAEJmxC,WAAY,gGAAgGnxC,MACxG,MAGRutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,gEAAgExtC,MACtE,KAEJytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,+BAA+B1tC,MAAM,KAClDiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTE,QAAS,YACTD,SAAU,WACN,MAAO,sBAEXE,SAAU,WACN,MAAO,8BAEXC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,OACHi9C,GAAI,UACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,KACHi5B,GAAI,QACJC,EAAG,OACHC,GAAI,UACJC,EAAG,OACHC,GAAI,WAER/B,cAAe,oCACfC,KAAM,SAAU99C,GACZ,MAAO,uBAAuBuQ,KAAKvQ,IAEvC+9C,SAAU,SAAU4C,GAChB,OAAIA,EAAO,EACA,UACAA,EAAO,GACP,WACAA,EAAO,GACP,UAEA,YAGfd,uBAAwB,0BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,OACD,OAAe,IAAXzB,EACOA,EAAS,MAEbA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,wBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,GAAoC,UAAbA,EACvB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,QACAA,EAAQ,GACR,OAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,qBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,eACN30C,EAAG,iBACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,SAAS4T,EAAOz1C,GACZ,OAAIA,EAAI,KAAQ,IAELA,EAAI,IAAO,EAK1B,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAClB,mBACA,mBACV,IAAK,KACD,OAAI4C,EAAOrD,GAEHrsD,GACC6sD,GAAiBC,EAAW,WAAa,YAG3C9sD,EAAS,UACpB,IAAK,IACD,OAAO6sD,EAAgB,SAAW,SACtC,IAAK,KACD,OAAI6C,EAAOrD,GAEHrsD,GAAU6sD,GAAiBC,EAAW,UAAY,WAE/CD,EACA7sD,EAAS,SAEbA,EAAS,SACpB,IAAK,KACD,OAAI0vD,EAAOrD,GAEHrsD,GACC6sD,GAAiBC,EACZ,gBACA,iBAGP9sD,EAAS,cACpB,IAAK,IACD,OAAI6sD,EACO,QAEJC,EAAW,MAAQ,OAC9B,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO7sD,EAAS,QAEbA,GAAU8sD,EAAW,OAAS,SAC9BD,EACA7sD,EAAS,QAEbA,GAAU8sD,EAAW,MAAQ,QACxC,IAAK,IACD,OAAID,EACO,UAEJC,EAAW,QAAU,SAChC,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO7sD,EAAS,UAEbA,GAAU8sD,EAAW,SAAW,WAChCD,EACA7sD,EAAS,UAEbA,GAAU8sD,EAAW,QAAU,UAC1C,IAAK,IACD,OAAOD,GAAiBC,EAAW,KAAO,MAC9C,IAAK,KACD,OAAI4C,EAAOrD,GACArsD,GAAU6sD,GAAiBC,EAAW,KAAO,QAEjD9sD,GAAU6sD,GAAiBC,EAAW,KAAO,QAIvDhR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,mFAAmFxtC,MACzF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,iBACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAG,cACHC,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,gGAAgGttC,MACpG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,mBACTC,SAAU,iBACVC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,QACI,MAAO,+BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU10C,GACd,OAAQ,YAAY+F,KAAK/F,GAAK,MAAQ,MAAQ,IAAMA,GAExD20C,KAAM,QACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAI,YACJC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA9DyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gGAAgGttC,MACpG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,WACL,MACI,WACCvxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRY,QAAS,WACL,MACI,aACCxxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRa,SAAU,WACN,MACI,WACCzxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRc,QAAS,WACL,MACI,WACC1xD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRe,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MACI,uBACCn0D,KAAK4wD,QAAU,EACV,OACiB,IAAjB5wD,KAAK4wD,QACL,IACA,OACN,MAER,QACI,MACI,uBACC5wD,KAAK4wD,QAAU,EACV,OACiB,IAAjB5wD,KAAK4wD,QACL,IACA,OACN,QAIhBgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAI,YACJiC,EAAG,gBACHC,GAAI,eACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BgH,KAAM,CACF,CACIC,MAAO,aACPC,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,KACRC,KAAM,MAEV,CACIH,MAAO,aACPI,OAAO,IACPH,OAAQ,EACR7xD,KAAM,MACN8xD,OAAQ,KACRC,KAAM,OAGdE,oBAAqB,WACrBC,oBAAqB,SAAU9kD,EAAOoJ,GAClC,MAAoB,MAAbA,EAAM,GAAa,EAAIqN,SAASrN,EAAM,IAAMpJ,EAAO,KAE9Dw9C,OAAQ,yCAAyCttC,MAAM,KACvDutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBACN5+B,EAAG,aACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,wBAEVrF,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW5yD,KAAK4yD,OACb,cAEA,WAGflB,QAAS,UACTC,SAAU,SAAUgG,GAChB,OAAI33D,KAAK4yD,SAAW+E,EAAI/E,OACb,cAEA,WAGfhB,SAAU,KAEda,uBAAwB,WACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACD,OAAkB,IAAXzB,EAAe,KAAOA,EAAS,IAC1C,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,MACJh9C,EAAG,KACHi9C,GAAI,MACJC,EAAG,MACHC,GAAI,OACJh5B,EAAG,KACHi5B,GAAI,MACJC,EAAG,MACHC,GAAI,OACJC,EAAG,KACHC,GAAI,SAlJ0BtyD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,+CAA+CxtC,MAAM,KAC/DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,6BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,SACAA,EAAQ,GACR,SACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,2BACTC,QAAS,sBACTC,SAAU,kBACVC,QAAS,wBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,uBACN30C,EAAG,kBACH40C,GAAI,WACJh9C,EAAG,kBACHi9C,GAAI,WACJC,EAAG,gBACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,YACJC,EAAG,UACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGttC,MACzG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,CACN2D,WAAY,gEAAgEnxC,MACxE,KAEJ8E,OAAQ,iEAAiE9E,MACrE,KAEJoxC,SAAU,iBAEd3D,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTE,QAAS,kBACTD,SAAU,wBACVE,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU10C,GACd,OAAOA,EAAErI,QAAQ,iCAAiC,SAC9C6iD,EACA3wC,EACA4wC,GAEA,MAAc,MAAPA,EAAa5wC,EAAK,KAAOA,EAAK4wC,EAAK,SAGlD9F,KAAM,SAAU30C,GACZ,MAAI,4BAA4B+F,KAAK/F,GAC1BA,EAAErI,QAAQ,SAAU,UAE3B,OAAOoO,KAAK/F,GACLA,EAAErI,QAAQ,QAAS,YAEvBqI,GAEXA,EAAG,iBACH40C,GAAI,UACJh9C,EAAG,OACHi9C,GAAI,UACJC,EAAG,QACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,SACJC,EAAG,MACHC,GAAI,SACJC,EAAG,OACHC,GAAI,WAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,OAAe,IAAXA,EACOA,EAEI,IAAXA,EACOA,EAAS,MAGhBA,EAAS,IACRA,GAAU,KAAOA,EAAS,IAAO,GAClCA,EAAS,KAAQ,EAEV,MAAQA,EAEZA,EAAS,MAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,0DAA0DxtC,MAChE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,kBACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJwtC,SAAU,iDAAiDxtC,MAAM,KACjEytC,cAAe,oBAAoBztC,MAAM,KACzC0tC,YAAa,oBAAoB1tC,MAAM,KACvCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAiB,UAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,QAEA,SAGfjC,SAAU,CACNC,QAAS,oBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,qBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,UACJC,EAAG,QACHC,GAAI,QACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,OACTiB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzB42C,KAAM,CACFC,IAAK,EACLC,IAAK,KApGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,2EAA2EvtC,MACpF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,0DAA0DxtC,MAChE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,gBACJh9C,EAAG,aACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,SACJC,EAAG,cACHC,GAAI,YACJC,EAAG,YACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,gCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,OAEA,UAGfd,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yCAAyCttC,MAAM,KACvDutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,uBACLC,KAAM,4BACN5+B,EAAG,cACHmjC,GAAI,gBACJC,IAAK,uBACLC,KAAM,6BAEVxE,SAAU,CACNC,QAAS,QACTC,QAAS,QACTC,SAAU,UACVC,QAAS,QACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,OACN30C,EAAG,MACH40C,GAAI,MACJh9C,EAAG,KACHi9C,GAAI,MACJC,EAAG,OACHC,GAAI,OACJh5B,EAAG,KACHi5B,GAAI,MACJC,EAAG,MACHC,GAAI,MACJC,EAAG,MACHC,GAAI,OAERC,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBlC,cAAe,QACfC,KAAM,SAAUnvC,GACZ,MAAiB,OAAVA,GAEXovC,SAAU,SAAU4C,EAAMC,EAAQsE,GAC9B,OAAOvE,EAAO,GAAK,KAAO,QAxEIrzD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETxD,EAAS,CACL,eACA,QACA,QACA,QACA,QACA,WACA,SACA,MACA,UACA,eACA,eACA,gBAGChO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,0EAA0ExtC,MAChF,KAEJytC,cAAe,2DAA2DztC,MACtE,KAEJ0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,kBACfC,KAAM,SAAU99C,GACZ,MAAO,UAAUuQ,KAAKvQ,IAE1B+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,UAEA,WAGfjC,SAAU,CACNC,QAAS,sBACTC,QAAS,uBACTC,SAAU,oBACVC,QAAS,qBACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,KACN30C,EAAG,kBACH40C,GAAI,WACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,eACHC,GAAI,aACJh5B,EAAG,WACHi5B,GAAI,SACJC,EAAG,YACHC,GAAI,UACJC,EAAG,WACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,kFAAkFttC,MACtF,KAEJutC,YAAa,qDAAqDvtC,MAC9D,KAEJwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,wCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,wBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlFyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,aAAc,gBAClBk9C,EAAG,CAAC,YAAa,eACjB/4B,EAAG,CAAC,UAAW,aACfk5B,EAAG,CAAC,WAAY,eAChBE,EAAG,CAAC,UAAW,eAEnB,OAAOY,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAuBxD,SAASkyD,EAA4BpF,GAEjC,GADAA,EAAStpC,SAASspC,EAAQ,IACtBrpC,MAAMqpC,GACN,OAAO,EAEX,GAAIA,EAAS,EAET,OAAO,EACJ,GAAIA,EAAS,GAEhB,OAAI,GAAKA,GAAUA,GAAU,EAI1B,GAAIA,EAAS,IAAK,CAErB,IAAI4B,EAAY5B,EAAS,GAEzB,OACWoF,EADO,IAAdxD,EADa5B,EAAS,GAIS4B,GAChC,GAAI5B,EAAS,IAAO,CAEvB,KAAOA,GAAU,IACbA,GAAkB,GAEtB,OAAOoF,EAA4BpF,GAInC,OAAOoF,EADPpF,GAAkB,KAKjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,mEAAmExtC,MACzE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,cACJC,IAAK,iBACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,kCAEVC,SAAU,CACNC,QAAS,eACTK,SAAU,IACVJ,QAAS,eACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,WAEN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,0BACX,QACI,MAAO,4BAIvBtC,aAAc,CACVC,OAhGR,SAA2BvsD,GAEvB,OAAIwyD,EADSxyD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,KAAO3I,EAEX,MAAQA,GA4FXwsD,KA1FR,SAAyBxsD,GAErB,OAAIwyD,EADSxyD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,QAAU3I,EAEd,SAAWA,GAsFd6X,EAAG,kBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,cACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI,UACJC,EAAG4D,EACH3D,GAAI,WACJC,EAAG0D,EACHzD,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApIyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJwtC,SAAU,sCAAsCxtC,MAAM,KACtDytC,cAAe,oCAAoCztC,MAAM,KACzD0tC,YAAa,mBAAmB1tC,MAAM,KACtCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,6BAEVZ,cAAe,kBACfC,KAAM,SAAU99C,GACZ,MAAiB,WAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,WAEA,UAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,wBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,SACHi9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,SACJC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,SAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,MAAO,MAAQA,KA/DezyD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4V,EAAQ,CACRhG,GAAI,6BACJh9C,EAAG,wBACHi9C,GAAI,0BACJC,EAAG,2BACHC,GAAI,4BACJh5B,EAAG,qBACHi5B,GAAI,sBACJC,EAAG,uBACHC,GAAI,4BACJC,EAAG,mBACHC,GAAI,oBASR,SAASyF,EAAkBtF,EAAQQ,EAAettD,EAAKutD,GACnD,OAAOD,EACDa,EAAMnuD,GAAK,GACXutD,EACAY,EAAMnuD,GAAK,GACXmuD,EAAMnuD,GAAK,GAErB,SAASqyD,EAAQvF,GACb,OAAOA,EAAS,IAAO,GAAMA,EAAS,IAAMA,EAAS,GAEzD,SAASqB,EAAMnuD,GACX,OAAOmyD,EAAMnyD,GAAKid,MAAM,KAE5B,SAAS6yC,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAe,IAAXA,EAEIrsD,EAAS2xD,EAAkBtF,EAAQQ,EAAettD,EAAI,GAAIutD,GAEvDD,EACA7sD,GAAU4xD,EAAQvF,GAAUqB,EAAMnuD,GAAK,GAAKmuD,EAAMnuD,GAAK,IAE1DutD,EACO9sD,EAAS0tD,EAAMnuD,GAAK,GAEpBS,GAAU4xD,EAAQvF,GAAUqB,EAAMnuD,GAAK,GAAKmuD,EAAMnuD,GAAK,IAIjEu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oGAAoG9E,MACxG,KAEJmxC,WAAY,kGAAkGnxC,MAC1G,KAEJoxC,SAAU,+DAEd7D,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,CACN1oC,OAAQ,oFAAoF9E,MACxF,KAEJmxC,WAAY,2FAA2FnxC,MACnG,KAEJoxC,SAAU,cAEd3D,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,iBAAiB1tC,MAAM,KACpCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CACN5+B,EAAG,aACHmjC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CAEVxE,SAAU,CACNC,QAAS,gBACTC,QAAS,aACTC,SAAU,UACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAlFR,SAA0Bu1C,EAAQQ,EAAettD,EAAKutD,GAClD,OAAID,EACO,kBAEAC,EAAW,kBAAoB,mBA+EtCpB,GAAI2D,EACJ3gD,EAAGijD,EACHhG,GAAI0D,EACJzD,EAAG+F,EACH9F,GAAIwD,EACJx8B,EAAG8+B,EACH7F,GAAIuD,EACJtD,EAAG4F,EACH3F,GAAIqD,EACJpD,EAAG0F,EACHzF,GAAImD,GAERlD,uBAAwB,cACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,QAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAI4V,EAAQ,CACRhG,GAAI,qCAAqClvC,MAAM,KAC/C9N,EAAG,iCAAiC8N,MAAM,KAC1CmvC,GAAI,iCAAiCnvC,MAAM,KAC3CovC,EAAG,iCAAiCpvC,MAAM,KAC1CqvC,GAAI,iCAAiCrvC,MAAM,KAC3CqW,EAAG,6BAA6BrW,MAAM,KACtCsvC,GAAI,6BAA6BtvC,MAAM,KACvCuvC,EAAG,iCAAiCvvC,MAAM,KAC1CwvC,GAAI,iCAAiCxvC,MAAM,KAC3CyvC,EAAG,wBAAwBzvC,MAAM,KACjC0vC,GAAI,wBAAwB1vC,MAAM,MAKtC,SAAS8E,EAAOosC,EAAOrB,EAAQQ,GAC3B,OAAIA,EAEOR,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAI5DrB,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAG3E,SAASF,EAAuBnB,EAAQQ,EAAettD,GACnD,OAAO8sD,EAAS,IAAM/qC,EAAOowC,EAAMnyD,GAAM8sD,EAAQQ,GAErD,SAASgF,EAAyBxF,EAAQQ,EAAettD,GACrD,OAAO+hB,EAAOowC,EAAMnyD,GAAM8sD,EAAQQ,GAM7B/Q,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uGAAuGttC,MAC3G,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,0EAA0ExtC,MAChF,KAEJytC,cAAe,kBAAkBztC,MAAM,KACvC0tC,YAAa,kBAAkB1tC,MAAM,KACrCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,cACHC,GAAI,uBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,oBACTC,SAAU,qBACVC,QAAS,sBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAlCR,SAAyBu1C,EAAQQ,GAC7B,OAAOA,EAAgB,iBAAmB,kBAkCtCnB,GAAI8B,EACJ9+C,EAAGmjD,EACHlG,GAAI6B,EACJ5B,EAAGiG,EACHhG,GAAI2B,EACJ36B,EAAGg/B,EACH/F,GAAI0B,EACJzB,EAAG8F,EACH7F,GAAIwB,EACJvB,EAAG4F,EACH3F,GAAIsB,GAERrB,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,SAAU,UAAW,WAC1Bh9C,EAAG,CAAC,cAAe,iBACnBi9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,SAAU,UAAW,WAC1BE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDnW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBAETC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,6BACA,iCACA,4BACA,4BACA,8BACA,2BACA,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,SACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IttC,MAClJ,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJoyC,YAAa,yCACbK,kBAAmB,yCACnBb,iBAAkB,yCAClBc,uBAAwB,yCACxBlF,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,wBAAwBztC,MAAM,KAC7C0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,eACTC,SAAU,cACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,QACJC,EAAG,YACHC,GAAI,YACJC,EAAG,SACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,oBACVC,QAAS,gBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,8BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,aACHC,GAAI,YACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnFyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wEAAwExtC,MAC9E,KAEJytC,cAAe,2CAA2CztC,MAAM,KAChE0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,eACHC,GAAI,cACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,UACJC,EAAG,WACHC,GAAI,WAER/B,cAAe,gDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACrB,iBAAb5C,GACa,eAAbA,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,SACAA,EAAO,GACP,eACAA,EAAO,GACP,aAEA,YA7EmBrzD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,OAAQvtD,GACJ,IAAK,IACD,OAAOstD,EAAgB,gBAAkB,kBAC7C,IAAK,KACD,OAAOR,GAAUQ,EAAgB,UAAY,aACjD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,SAAW,YAChD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,QAAU,WAC/C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,UAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,QACI,OAAOR,GAIVvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+LAA+LttC,MACnM,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,iCAEVZ,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,QACI,OAAOA,MAhGezyD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGb,SAAS4E,EAAe7F,EAAQQ,EAAe5tD,EAAQ6tD,GACnD,IAAI2C,EAAS,GACb,GAAI5C,EACA,OAAQ5tD,GACJ,IAAK,IACDwwD,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,SACT,MACJ,IAAK,KACDA,EAAS,SACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,UACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,gBAIjB,OAAQxwD,GACJ,IAAK,IACDwwD,EAAS,eACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,cACT,MACJ,IAAK,KACDA,EAAS,cACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YAIrB,OAAOA,EAAOhhD,QAAQ,MAAO49C,GAGxBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,gFAAgFvtC,MACzF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,WACVC,QAAS,WACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAGo7C,EACHxG,GAAIwG,EACJxjD,EAAGwjD,EACHvG,GAAIuG,EACJtG,EAAGsG,EACHrG,GAAIqG,EACJr/B,EAAGq/B,EACHpG,GAAIoG,EACJnG,EAAGmG,EACHlG,GAAIkG,EACJjG,EAAGiG,EACHhG,GAAIgG,GAER7E,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,qCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,GAAqC,UAAbA,EACjB4C,EAEM,WAAb5C,GACa,aAAbA,GACa,WAAbA,EAEO4C,GAAQ,GAAKA,EAAOA,EAAO,QAL/B,GAQX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,GAAQ,GAAKA,EAAO,EACb,QACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvMyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN30C,EAAG,gBACH40C,GAAI,UACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN30C,EAAG,gBACH40C,GAAI,UACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iEAAiExtC,MACvE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,SACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,aACJh5B,EAAG,UACHi5B,GAAI,YACJC,EAAG,QACHC,GAAI,UACJC,EAAG,OACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,mDAAmDvtC,MAAM,KACtEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,2BAA2BztC,MAAM,KAChD0tC,YAAa,2BAA2B1tC,MAAM,KAE9CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,kBACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,OACHC,GAAI,OACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzB42C,KAAM,CACFC,IAAK,EACLC,IAAK,KAvFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,WACJiC,EAAG,SACHC,GAAI,UACJjC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,uEAAuEvtC,MAChF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,0CAA0CztC,MAAM,KAC/D0tC,YAAa,4BAA4B1tC,MAAM,KAC/CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVsC,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,yBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,QAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,qBACVC,QAAS,YACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,WACN30C,EAAG,YACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAtHyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAEJmyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAEJmyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAET9S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,WACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,uBACTC,SAAU,mBACVC,QAAS,oBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,UACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,+FCElD,SAAWkiD,GAAU,aAIbA,EAAO+N,aAAa,SAAU,CACtCC,OAAQ,CACJ6D,WAAY,qFAAqFnxC,MAC7F,KAEJ8E,OAAQ,sHAAsH9E,MAC1H,KAEJoxC,SAAU,mBAEd7D,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,4BACLyE,IAAK,mBACLxE,KAAM,iCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,aACTC,QAAS,eACTC,SAAU,cACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,SACHC,GAAI,WACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFxR,EAAO+N,aAAa,QAAS,CAEpCC,OAAQ,sEAAsEttC,MAC1E,KAEJutC,YAAa,sEAAsEvtC,MAC/E,KAEJwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,iCAAiCztC,MAAM,KACtD0tC,YAAa,iCAAiC1tC,MAAM,KACpDiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,kBACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,cAAe,uBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIqW,EAAmB,mGAAmG31C,MAClH,KAEJ41C,EAAmB,qGAAqG51C,MACpH,KAEJmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAER,SAASe,EAAOz1C,GACZ,OAAOA,EAAI,GAAK,GAAKA,EAAI,GAAK,MAAQA,EAAI,IAAM,IAAO,EAE3D,SAASo1C,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KACD,OAAOS,GAAU0vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,IACD,OAAOQ,EAAgB,SAAW,SACtC,IAAK,KACD,OAAO7sD,GAAU0vD,EAAOrD,GAAU,SAAW,SACjD,IAAK,IACD,OAAOQ,EAAgB,UAAY,UACvC,IAAK,KACD,OAAO7sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,WAAa,WACnD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,WAAa,YACnD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,OAAS,QAI9CvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,SAAUgG,EAAgBxuC,GAC9B,OAAKwuC,EAEM,SAASjzC,KAAKyE,GACd8wC,EAAiBtC,EAAeE,SAEhCmC,EAAiBrC,EAAeE,SAJhCmC,GAOfpI,YAAa,kDAAkDvtC,MAAM,KACrEmyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,2BAA2BztC,MAAM,KAChD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,qBAEX,KAAK,EACD,MAAO,mBAEX,KAAK,EACD,MAAO,iBAEX,KAAK,EACD,MAAO,kBAEX,QACI,MAAO,oBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,yBACX,QACI,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,eACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,UACHi5B,GAAI,SACJiC,EAAG,UACHC,GAAIqB,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,MACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iFAAiFxtC,MACvF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,mCACLC,KAAM,0CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf3xD,KAAKm0D,OAA8B,IAAfn0D,KAAKm0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,kBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTkE,YAAa,kBAxDqB12D,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iFAAiFxtC,MACvF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf3xD,KAAKm0D,OAA8B,IAAfn0D,KAAKm0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,WACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GACnD,IASI8yD,EAAY,IAIhB,OAHIhG,EAAS,KAAO,IAAOA,GAAU,KAAOA,EAAS,KAAQ,KACzDgG,EAAY,QAEThG,EAASgG,EAbH,CACL3G,GAAI,UACJC,GAAI,SACJE,GAAI,MACJC,GAAI,OACJkC,GAAI,YACJhC,GAAI,OACJE,GAAI,OAMuB3sD,GAG9Bu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,aACN30C,EAAG,iBACH40C,GAAI8B,EACJ9+C,EAAG,WACHi9C,GAAI6B,EACJ5B,EAAG,QACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJO,EAAG,cACHC,GAAIR,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,QACHC,GAAIsB,GAERlB,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GAUnD,MAAY,MAARA,EACOstD,EAAgB,SAAW,SAE3BR,EAAS,KArBFoB,GAqB6BpB,EApB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,sBAAwB,sBAC5ChB,GAAI,iBACJC,GAAI,gBACJkC,GAAI,uBACJhC,GAAI,uBACJE,GAAI,gBAKgC3sD,GApBvBid,MAAM,KAChBixC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAuBR,IAAIiB,EAAc,CACd,QACA,QACA,QACA,QACA,WACA,QACA,QACA,QACA,QACA,QACA,QACA,SAMK7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oFAAoF9E,MACxF,KAEJmxC,WAAY,kFAAkFnxC,MAC1F,MAGRutC,YAAa,CAETzoC,OAAQ,gEAAgE9E,MACpE,KAEJmxC,WAAY,gEAAgEnxC,MACxE,MAGRwtC,SAAU,CACN2D,WAAY,gEAAgEnxC,MACxE,KAEJ8E,OAAQ,gEAAgE9E,MACpE,KAEJoxC,SAAU,iDAEd3D,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CmyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAGlBC,YAAa,2MAGbR,iBAAkB,2MAGlBa,kBAAmB,wHAGnBC,uBAAwB,6FACxBzE,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,8BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTE,QAAS,gBACTD,SAAU,SAAUkG,GAChB,GAAIA,EAAI/E,SAAW5yD,KAAK4yD,OAcpB,OAAmB,IAAf5yD,KAAKm0D,MACE,oBAEA,mBAhBX,OAAQn0D,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,+BAUvBxC,SAAU,SAAUgG,GAChB,GAAIA,EAAI/E,SAAW5yD,KAAK4yD,OAcpB,OAAmB,IAAf5yD,KAAKm0D,MACE,oBAEA,mBAhBX,OAAQn0D,KAAKm0D,OACT,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BAUvBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI8B,EACJ9+C,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG,MACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJO,EAAG,SACHC,GAAIR,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,OACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,KACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1MyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,QACA,UACA,OACA,QACA,MACA,MACA,SACA,OACA,UACA,SACA,QACA,SAEJwI,EAAO,CAAC,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAO,QAElDxW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,GAErB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,yBACVC,QAAS,aACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,SACHi9C,GAAI,SACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,WACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mJAAmJttC,MACvJ,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,6EAA6ExtC,MACnF,KAEJytC,cAAe,mCAAmCztC,MAAM,KACxD0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,gCACLC,KAAM,uCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,eACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,cACHC,GAAI,aACJh5B,EAAG,cACHi5B,GAAI,cACJC,EAAG,aACHC,GAAI,WACJC,EAAG,aACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAKhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,kGAAkGttC,MACtG,KAEJutC,YAAa,wDAAwDvtC,MACjE,KAEJwtC,SAAU,gEAAgExtC,MACtE,KAEJytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,qBAAqB1tC,MAAM,KACxCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,aACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,eACH40C,GAAI,WACJh9C,EAAG,YACHi9C,GAAI,cACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,OACHi5B,GAAI,SACJC,EAAG,OACHC,GAAI,SACJC,EAAG,MACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,SAEpBlC,cAAe,4BACfC,KAAM,SAAU99C,GACZ,MAAiB,SAAVA,GAA8B,YAAVA,GAE/B+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,OAAS,UAEnBA,EAAU,QAAU,aAjED5wD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,oFAAoFttC,MACzF,KAEJutC,EAAc,kDAAkDvtC,MAAM,KAC1E,SAASkzC,EAAOz1C,GACZ,OAAOA,EAAI,GAAKA,EAAI,EAExB,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAEvCrsD,EAAS,YAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,MAAQ,OAEnCrsD,EAAS,QAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,SAAW,WAClD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,YAEvCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,OAAS,SAEpCrsD,EAAS,SAKvB87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACbC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7IyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAClB,eACA,kBACV,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,EACUQ,EAAgB,UAAY,UACpB,IAAXR,EACGQ,GAAiBC,EAAW,UAAY,WAC3CT,EAAS,EACNQ,GAAiBC,EAAW,UAAY,WAExC,UAGlB,IAAK,IACD,OAAOD,EAAgB,aAAe,aAC1C,IAAK,KAUD,OARI7sD,GADW,IAAXqsD,EACUQ,EAAgB,SAAW,SACnB,IAAXR,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,WAEvCD,GAAiBC,EAAW,QAAU,YAGxD,IAAK,IACD,OAAOD,EAAgB,UAAY,UACvC,IAAK,KAUD,OARI7sD,GADW,IAAXqsD,EACUQ,EAAgB,MAAQ,MAChB,IAAXR,EACGQ,GAAiBC,EAAW,MAAQ,QACvCT,EAAS,EACNQ,GAAiBC,EAAW,MAAQ,QAEpCD,GAAiBC,EAAW,KAAO,SAGrD,IAAK,IACD,OAAOD,GAAiBC,EAAW,SAAW,YAClD,IAAK,KAQD,OANI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,MAAQ,OAC5B,IAAXT,EACGQ,GAAiBC,EAAW,MAAQ,UAEpCD,GAAiBC,EAAW,MAAQ,SAGtD,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,eACpD,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,QAAU,UAC9B,IAAXT,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,SAEvCD,GAAiBC,EAAW,UAAY,UAG1D,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,aACpD,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,OAAS,QAC7B,IAAXT,EACGQ,GAAiBC,EAAW,OAAS,SACxCT,EAAS,EACNQ,GAAiBC,EAAW,OAAS,OAErCD,GAAiBC,EAAW,MAAQ,SAMrDhR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,eACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBAETC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,qBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,+BACX,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,8BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxKyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFttC,MACpF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,mBAAmB1tC,MAAM,KACtCwwC,oBAAoB,EACpB7C,cAAe,QACfC,KAAM,SAAU99C,GACZ,MAA2B,MAApBA,EAAMnN,OAAO,IAExBkrD,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAOF,EAAQ,GAAK,KAAO,MAE/BG,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,cACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,aACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB5yD,CAAQ,EAAQ,gGCElD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bh9C,EAAG,CAAC,cAAe,gBACnBi9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAM7CnW,EAAO+N,aAAa,UAAW,CACxCC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,2BACA,+BACA,4BACA,0BACA,8BACA,2BACA,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bh9C,EAAG,CAAC,cAAe,gBACnBi9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDnW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,4BACA,gCACA,4BACA,0BACA,8BACA,2BACA,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mHAAmHttC,MACvH,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,sEAAsExtC,MAC5E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,iBACN30C,EAAG,qBACH40C,GAAI,cACJh9C,EAAG,SACHi9C,GAAI,aACJC,EAAG,SACHC,GAAI,aACJh5B,EAAG,UACHi5B,GAAI,cACJC,EAAG,UACHC,GAAI,cACJC,EAAG,UACHC,GAAI,eAER/B,cAAe,mCACfE,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,UACAA,EAAQ,GACR,QACAA,EAAQ,GACR,aAEA,WAGf6D,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,YAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,eAAb5C,GAA0C,YAAbA,EACvB,IAAT4C,EACO,EAEJA,EAAO,QAJX,GAOXd,uBAAwB,UACxBC,QAAS,KACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,oDAAoDxtC,MAAM,KACpEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,+BACNwE,IAAK,mBACLC,KAAM,wBAEVxE,SAAU,CACNC,QAAS,YACTC,QAAS,eACTE,QAAS,YACTD,SAAU,eACVE,SAAU,iBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,eACN30C,EAAG,iBACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,YACJh5B,EAAG,SACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,GAEM,IAANA,EADA,KAIA,OAIlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,UACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,8BACVC,QAAS,YACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN30C,EAAG,aACH40C,GAAI,aACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,WACJh5B,EAAG,YACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,cACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,0FAA0FvtC,MACnG,KAEJwtC,SAAU,8FAA8FxtC,MACpG,KAEJytC,cAAe,mDAAmDztC,MAC9D,KAEJ0tC,YAAa,sBAAsB1tC,MAAM,KACzCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG,oBACH40C,GAAI,eACJh9C,EAAG,cACHi9C,GAAI,gBACJC,EAAG,gBACHC,GAAI,eACJh5B,EAAG,WACHi5B,GAAI,aACJC,EAAG,YACHC,GAAI,cACJC,EAAG,aACHC,GAAI,eAERC,uBAAwB,aACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBgB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAIzBy0C,cAAe,wCACfE,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,EACP,SACAA,EAAO,GACP,QACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAGfkB,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,GAAqC,SAAbA,GAEX,YAAbA,GACA4C,GAAQ,GAFRA,EAIAA,EAAO,IAGtBX,KAAM,CACFC,IAAK,EACLC,IAAK,KA/HyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,cACJC,EAAG,SACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,YACJC,EAAG,SACHC,GAAI,WACJC,EAAG,cACHC,GAAI,iBAERC,uBAAwB,WACxBC,QAAS,MACTjC,cAAe,iCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,aAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,OACAA,EAAO,GACP,YACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApFyB5yD,CAAQ,EAAQ,4FCKlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,iCAAiCztC,MAAM,KACtD0tC,YAAa,yBAAyB1tC,MAAM,KAC5CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,gBACVC,QAAS,oBACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,WACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,qFAAqF9E,MACzF,KAEJmxC,WAAY,yEAAyEnxC,MACjF,MAGRutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTE,QAAS,mBACTD,SAAU,kCACVE,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,SACN30C,EAAG,eACHpI,EAAG,YACHi9C,GAAI,YACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAER/B,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,QAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,MACAA,EAAO,GACP,QAEA,OAGfd,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,iDAAiDxtC,MAAM,KACjEytC,cAAe,8CAA8CztC,MAAM,KACnE0tC,YAAa,yBAAyB1tC,MAAM,KAC5CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,oCAEVZ,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAiB,eAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,mBACTC,QAAS,qBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,SACHi9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,SACJiC,EAAG,YACHC,GAAI,aACJjC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,WA9D0BtyD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+EAA+EttC,MACnF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,YACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,iBACHpI,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzFyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyW,EAAe,iDAAiD/1C,MAAM,KA4B1E,SAAS6yC,EAAUhD,EAAQQ,EAAe5tD,EAAQ6tD,GAC9C,IAAI0F,EAiBR,SAAsBnG,GAClB,IAAIoG,EAAUj3C,KAAKk3C,MAAOrG,EAAS,IAAQ,KACvCsG,EAAMn3C,KAAKk3C,MAAOrG,EAAS,IAAO,IAClCuG,EAAMvG,EAAS,GACfwG,EAAO,GAUX,OATIJ,EAAU,IACVI,GAAQN,EAAaE,GAAW,SAEhCE,EAAM,IACNE,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaI,GAAO,OAEvDC,EAAM,IACNC,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaK,IAEpC,KAATC,EAAc,OAASA,EA/BbC,CAAazG,GAC9B,OAAQptD,GACJ,IAAK,KACD,OAAOuzD,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,QAqBtB1W,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,kMAAkMttC,MACtM,KAEJutC,YAAa,0HAA0HvtC,MACnI,KAEJ6xC,kBAAkB,EAClBrE,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,2DAA2DztC,MACtE,KAEJ0tC,YAAa,2DAA2D1tC,MACpE,KAEJiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,MACVC,QAAS,cACTC,SAAU,MACVC,SAAU,KAEdC,aAAc,CACVC,OA/FR,SAAyBiE,GACrB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO7nD,QAAQ,OACTmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,MACpBu3D,EAAO,QAuFbtH,KAnFR,SAAuBgE,GACnB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO7nD,QAAQ,OACTmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,MACpBu3D,EAAO,QA2Ebj8C,EAAG,UACH40C,GAAI2D,EACJ3gD,EAAG,UACHi9C,GAAI0D,EACJzD,EAAG,UACHC,GAAIwD,EACJx8B,EAAG,UACHi5B,GAAIuD,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,UACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3HyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C6tC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCL,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAA4B,OAAVA,GAE7Bm+C,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,2BACVC,QAAS,WACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJiC,EAAG,YACHC,GAAI,WACJjC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAiEzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,mBACvB40C,GAAI,CAACW,EAAS,WAAiBA,EAAS,YACxC39C,EAAG,CAAC,UAAW,cACfi9C,GAAI,CAACU,EAAS,SAAeA,EAAS,UACtCT,EAAG,CAAC,UAAW,eACfC,GAAI,CAACQ,EAAS,SAAeA,EAAS,UACtCx5B,EAAG,CAAC,UAAW,eACfi5B,GAAI,CAACO,EAAS,SAAeA,EAAS,UACtCN,EAAG,CAAC,SAAU,aACdC,GAAI,CAACK,EAAS,SAAeA,EAAS,UACtCJ,EAAG,CAAC,QAAS,YACbC,GAAI,CAACG,EAAS,OAAaA,EAAS,SAExC,OAAOS,GAEDD,EADAvrC,EAAO/hB,GAAK,GAGZ+hB,EAAO/hB,GAAK,GA9EZu8C,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,0CAEVZ,cAAe,aACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,EAAMsU,eAE3BypC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,MAAQ,MAElBA,EAAU,MAAQ,OAGjCQ,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,OACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB5yD,CAAQ,EAAQ,iGCElD,SAAWkiD,GAAU,aAIXA,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,wFAAwFvtC,MACjG,KAEJwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,kDAAkDztC,MAAM,KACvE0tC,YAAa,kDAAkD1tC,MAAM,KACrEiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,cACTC,SAAU,cACVC,QAAS,gBACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,iBACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,UACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJh5B,EAAG,MACHi5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,kFAAkFttC,MACtF,KAEJutC,YAAa,kFAAkFvtC,MAC3F,KAEJwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,kDAAkDztC,MAAM,KACvE0tC,YAAa,kDAAkD1tC,MAAM,KACrEiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,UACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJh5B,EAAG,MACHi5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,sFAAsFvtC,MAC/F,KAEJwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,iCACLC,KAAM,wCAEVZ,cAAe,qDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGM,eAAb5C,GACa,UAAbA,GACa,iBAAbA,EAEO4C,EACa,iBAAb5C,GAA4C,QAAbA,EAC/B4C,EAAO,GAEPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,aACAA,EAAK,IACL,QACAA,EAAK,KACL,eACAA,EAAK,KACL,MACAA,EAAK,KACL,eAEA,OAGfhI,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,4BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAGRC,uBAAwB,6BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,SACpB,QACI,OAAOA,IAGnBgB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CAEFC,IAAK,EACLC,IAAK,KA5GyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GASnD,MAAY,MAARA,EACOstD,EAAgB,UAAY,UACpB,MAARttD,EACAstD,EAAgB,SAAW,SAE3BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,sBAAwB,sBAC5Cf,GAAI,gBACJE,GAAI,wBACJE,GAAI,kBAOgC3sD,GArBvBid,MAAM,KAChBixC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAsDR,SAASuF,EAAqBvoD,GAC1B,OAAO,WACH,OAAOA,EAAM,KAAwB,KAAjBhR,KAAK4wD,QAAiB,IAAM,IAAM,QAIrDxO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,yFAAyF9E,MAC7F,KAEJmxC,WAAY,iGAAiGnxC,MACzG,MAGRutC,YAAa,yDAAyDvtC,MAClE,KAEJwtC,SAhDJ,SAA6Bt7C,EAAG4S,GAC5B,IAAI0oC,EAAW,CACPkJ,WAAY,0DAA0D12C,MAClE,KAEJ22C,WAAY,0DAA0D32C,MAClE,KAEJ42C,SAAU,4DAA4D52C,MAClE,MAKZ,OAAU,IAAN9N,EACOs7C,EAAqB,WACvBxuD,MAAM,EAAG,GACTM,OAAOkuD,EAAqB,WAAExuD,MAAM,EAAG,IAE3CkT,EASEs7C,EALI,qBAAqBntC,KAAKyE,GAC/B,aACA,sCAAsCzE,KAAKyE,GAC3C,WACA,cACoB5S,EAAEm/C,OARjB7D,EAAqB,YA6BhCC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAASgI,EAAqB,cAC9B/H,QAAS+H,EAAqB,YAC9B7H,QAAS6H,EAAqB,WAC9B9H,SAAU8H,EAAqB,cAC/B5H,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOoF,EAAqB,oBAAoBx3D,KAAK/B,MACzD,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOu5D,EAAqB,qBAAqBx3D,KAAK/B,QAGlE4xD,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,kBACH40C,GAAI8B,EACJ9+C,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG,SACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAGRrD,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,MACA,SACA,OACA,QACA,SACA,QACA,SAEJwI,EAAO,CAAC,QAAS,MAAO,OAAQ,MAAO,SAAU,OAAQ,QAEpDxW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,GAErB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,sBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,SACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,QACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB5yD,CAAQ,EAAQ,gGCElD,SAAWkiD,GAAU,aAIZA,EAAO+N,aAAa,UAAW,CACxCC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,+DAA+DxtC,MACrE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,yBAAyB1tC,MAAM,KAC5CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,uBACTC,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,kBACRC,KAAM,qBACN30C,EAAG,SACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,sBACTC,SAAU,mCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,oBACN30C,EAAG,SACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGttC,MACzG,KAEJutC,YAAa,sFAAsFvtC,MAC/F,KAEJ6xC,kBAAkB,EAClBrE,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpB7C,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExB+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCACN5+B,EAAG,YACHmjC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,mBACTC,QAAS,oBACTC,SAAU,yBACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,WACH40C,GAAI,UACJh9C,EAAG,WACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,UACJiC,EAAG,WACHC,GAAI,UACJjC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KA5EyB5yD,CAAQ,EAAQ,iGCElD,SAAWkiD,GAAU,aAIXA,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,6GAA6GttC,MACjH,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,yEAAyExtC,MAC/E,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,4BAA4B1tC,MAAM,KAC/CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJE,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,eACVC,QAAS,uBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG,mBACH40C,GAAI,eACJh9C,EAAG,aACHi9C,GAAI,eACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,SACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,cACJC,EAAG,UACHC,GAAI,aAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,gEAAgEvtC,MAAM,KACnFwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,sCAAsCztC,MAAM,KAC3D0tC,YAAa,2BAA2B1tC,MAAM,KAC9CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,8BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,oBACH40C,GAAI,WACJh9C,EAAG,cACHi9C,GAAI,aACJC,EAAG,cACHC,GAAI,aACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,gBACxBC,QAAS,UACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,8FCKlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,GAGPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW5yD,KAAK4yD,OACb,WAEA,YAGflB,QAAS,SACTC,SAAU,SAAUgG,GAChB,OAAI33D,KAAK4yD,SAAW+E,EAAI/E,OACb,WAEA,YAGfhB,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJiC,EAAG,MACHC,GAAI,OACJjC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,QAERI,KAAM,CAEFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACO,OAAPA,EACA,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,YACVC,QAAS,SACTC,SAAU,YACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,wGCP1D,IAAIyO,EAAM,CACT,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,WAAY,yCACZ,cAAe,yCACf,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,QAAS,sCACT,aAAc,2CACd,gBAAiB,2CACjB,WAAY,sCACZ,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,yCAIf,SAASgrD,EAAeC,GACvB,IAAIvuD,EAAKwuD,EAAsBD,GAC/B,OAAOE,EAAoBzuD,GAE5B,SAASwuD,EAAsBD,GAC9B,IAAIE,EAAoBl1C,EAAEjW,EAAKirD,GAAM,CACpC,IAAIt3C,EAAI,IAAI7P,MAAM,uBAAyBmnD,EAAM,KAEjD,MADAt3C,EAAEy3C,KAAO,mBACHz3C,EAEP,OAAO3T,EAAIirD,GAEZD,EAAenmD,KAAO,WACrB,OAAOD,OAAOC,KAAK7E,IAEpBgrD,EAAehtD,QAAUktD,EACzB/5D,EAAOovD,QAAUyK,EACjBA,EAAetuD,GAAK,8GClSnB,IAASoS,EAAAA,EAAqiI8I,OAAOF,SAAziIxmB,QAAQC,OAAO,eAAe,IAAI0E,MAAM,eAAe,CAACo5C,OAAM,IAAKryC,OAAO,CAAC,mBAAmB,SAASkS,GAAG5d,QAAQ+M,UAAU6Q,EAAEu8C,0BAA0Bv8C,EAAEu8C,yBAAyB,sCAAsCv8C,EAAEw8C,2BAA2B,yCAAyCp6D,QAAQC,OAAO,mBAAmB,CAAC,mBAAmBD,QAAQC,OAAO,iBAAiB,IAAID,QAAQC,OAAO,QAAQ,CAAC,eAAe,iBAAiB,mBAAmB,eAAwEA,EAAOovD,UAAUA,IAAUpvD,EAAOovD,QAAQ,SAASrvD,QAAQC,OAAO,kBAAkB2X,QAAQ,MAAM,CAAC,KAAK,SAASgG,GAAG,IAAImB,EAAE,OAAaua,EAAE,CAAC,MAAM,KAAI,MAAM,KAAK,MAAM,KAAI,MAAM,KAAK,MAAM,MAAMn5B,KAAKk6D,eAAe,SAASz8C,EAAEmB,GAAG,MAAM,WAAWA,EAAEu7C,YAAYn6D,KAAKo6D,QAAQ38C,GAAGA,EAAE48C,iBAAiB,MAAMz7C,EAAEu7C,YAAYn6D,KAAKo6D,QAAQ38C,GAAGA,EAAE3I,WAAWC,QAAQ,IAAI6J,EAAEu7C,YAAY,iBAAiB18C,GAAGA,EAAEA,EAAE1I,QAAQ,KAAK,OAAO6J,EAAE07C,cAAc78C,EAAEvP,QAAQ,MAAM,GAAGuP,EAAEvP,QAAQ,OAAO,GAAGuP,EAAEvP,QAAQ,OAAO,KAAKuP,EAAEmB,EAAE27C,SAAS98C,EAAEmB,EAAE27C,UAAU98C,GAAG,kBAAkBA,EAAEA,EAAE,OAAO,QAAQA,GAAGzd,KAAKo6D,QAAQ,SAAS38C,GAAG,OAAOA,IAAIA,KAAK+8C,SAAS/8C,IAAIwU,QAAQxU,EAAE,KAAKzd,KAAKke,UAAU,SAASib,EAAE7W,GAAG,IAAI+wC,EAAE51C,EAAExR,QAAQ4R,EAAE7d,KAAKkyD,EAAE,GAAG70C,EAAE,GAAGK,EAAED,EAAExN,KAAKkpB,GAAGpuB,MAAK,SAAS0S,GAA6C,IAAI0b,EAAEzb,EAA7C7d,QAAQ+M,UAAU0V,EAAEm4C,SAASn4C,EAAEm4C,SAAgBthC,EAAE,GAAGt5B,QAAQkB,QAAQuhB,EAAEm4C,QAAO,SAASh9C,GAAGzd,KAAKS,KAAKod,EAAEq8C,eAAez8C,EAAE6E,MAAK6W,GAAGzb,EAAEyb,EAAElmB,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGK,EAAEkB,GAAE,IAAsI6T,EAAEzd,EAApIwI,EAAE,GAAM3d,QAAQmS,QAAQyL,GAAGD,EAAEC,EAAE5d,QAAQuN,WAAWqQ,KAAKD,EAAEC,KAAK5d,QAAQ+M,UAAU0V,EAAEkoC,QAAQloC,EAAEkoC,OAAO,kBAAkBloC,EAAEkoC,QAAe/3B,EAAE,GAAG5yB,QAAQkB,QAAQyc,EAAE,IAAG,SAASC,EAAEmB,GAAG5e,KAAKS,KAAKod,EAAEq8C,eAAet7C,EAAE0D,MAAKmQ,GAAGzd,EAAEyd,EAAExf,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGrI,EAAE4J,GAAE/e,QAAQkB,QAAQyc,GAAE,SAASC,EAAEk9C,GAAG,IAAIxhC,EAAEk6B,EAAEnB,EAAEryD,QAAQoiB,KAAKzE,EAAEm9C,IAAItH,EAAE,GAAG,IAAI31C,EAAE4E,EAAEs4C,YAAYt4C,EAAEs4C,YAAY1I,EAAEryD,QAAQkB,QAAQ2c,GAAE,SAASD,GAAG,IAAImB,EAAE0D,EAAEs4C,YAAY1I,EAAEz0C,GAAGA,EAAEzd,KAAKS,KAAKod,EAAEq8C,eAAet7C,EAAE0D,MAAK+wC,GAAGl6B,EAAEk6B,EAAEpgD,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGs9C,EAAEn9C,EAAEpO,OAAO+pB,EAAEva,EAAEua,KAAI7W,EAAEu4C,qBAAqB3I,GAA9wC,UAAoxCA,GAAG70C,EAAEg2C,EAAE1mD,QAAQulD,MAAK,MAAM,mBAAmBx0C,EAAS,OAAGA,EAAS,OAAE,SAASD,GAAG41C,EAAEhf,OAAO52B,MAAK41C,EAAE5vD,SAASzD,KAAK86D,cAAc,SAASr9C,GAAG,YAAO,IAAS0b,EAAE1b,IAAIzd,KAAK+6D,eAAe,SAASt9C,GAAG,OAAO0b,EAAE1b,OAAO5d,QAAQC,OAAO,oBAAoB+C,UAAU,QAAQ,CAAC,SAAS,KAAK,MAAM,YAAY,WAAW,SAAS+b,EAAE+7C,EAAExhC,EAAE7W,EAAE+wC,GAAG,MAAM,CAAClsD,SAAS,KAAKrE,MAAM,CAAC6E,KAAK,SAASqzD,SAAS,YAAYP,OAAO,aAAaG,YAAY,kBAAkBL,SAAS,iBAAiBJ,WAAW,oBAAoBG,aAAa,gBAAgBI,SAAS,kBAAkBtuC,SAAS,YAAYyuC,mBAAmB,UAAUpgB,QAAQ,IAAIwgB,QAAQ,WAAWzQ,MAAM,aAAaxpD,WAAW,CAAC,SAAS,WAAW,SAAS,cAAc,SAASyc,EAAEmB,EAAE0D,GAAwe7E,EAAEy9C,IAAI,GAAGr7D,QAAQ+M,UAAU6Q,EAAE2O,WAAW,QAAQ3O,EAAE2O,UAAUvsB,QAAQmS,QAAQyL,EAAE9V,OAAO8V,EAAElZ,OAAO,QAAO,WAAWkZ,EAAE09C,cAAY,GAAI19C,EAAE29C,YAAY,WAAW,OAAO39C,EAAEu9C,UAAU,gBAAgBv9C,EAAE09C,SAAS,WAAW,IAAIt9C,EAAE88C,EAAE1uD,QAAQ,OAAO2S,EAAEy8C,SAAS/4C,EAAEg5C,mBAAmB,kBAAkBniC,EAAEjb,UAAUT,EAAE9V,OAAhxB,WAAa,IAAIiX,EAAE,CAAC27C,SAAS98C,EAAE88C,SAAS98C,EAAE88C,SAAS,IAAIJ,WAAW18C,EAAE08C,WAAW18C,EAAE08C,WAAW,IAAIG,aAAa78C,EAAE68C,aAAaO,mBAAmBp9C,EAAEo9C,oBAAoB,OAAOh7D,QAAQ+M,UAAU0V,EAAEi5C,aAAa38C,EAAE67C,OAAOh9C,EAAEpc,MAAMoc,EAAEg9C,SAAS56D,QAAQ+M,UAAU0V,EAAEk5C,kBAAkB58C,EAAEg8C,YAAYn9C,EAAEpc,MAAMoc,EAAEm9C,cAAc/6D,QAAQ+M,UAAU0V,EAAEm5C,YAAY78C,EAAE4rC,MAAM/sC,EAAEpc,MAAMoc,EAAE+sC,QAAQ5rC,EAAE87C,SAASj9C,EAAEi9C,SAASj9C,EAAEi9C,SAAS,IAAI97C,EAAE87C,SAASvhC,EAAE2hC,cAAcl8C,EAAE87C,UAAUvhC,EAAE4hC,eAAen8C,EAAE87C,UAAU97C,EAAE87C,SAAS97C,EAAoTy0C,IAAKtoD,MAAK,SAAS4vD,GAAGl9C,EAAEy9C,IAAIP,EAAE/7C,EAAE88C,YAAYp5C,EAAEg5C,mBAAmB,kBAAkBz9C,EAAElR,QAAQguD,MAAKl9C,EAAExZ,SAAS4Z,EAAEpa,WAAW8E,KAAK,SAASqW,EAAE+7C,GAA8bA,EAAEr3D,KAAK,SAAQ,WAAWsb,EAAEu8C,WAAWpwD,MAAK,YAAve,WAAa,IAAI4vD,EAAE/7C,EAAEq8C,SAAS,QAAQ9hC,EAAE,IAAIk2B,KAAK,CAACzwC,EAAEs8C,KAAK,CAAChsD,KAAK,oBAAoByrD,EAAE,MAAM,GAAGl9C,EAAEo+B,UAAU8f,iBAAiB9f,UAAU+f,WAAWziC,EAAEva,EAAEw8C,mBAAmB,CAAC,IAAIv9C,EAAEhe,QAAQkD,QAAQ,+CAA+CmvD,EAAEryD,QAAQkD,QAAQ8a,EAAEjV,WAAW,IAAIspD,EAAEp/C,KAAK,OAAO2K,EAAE8vC,IAAIsO,gBAAgB1iC,IAAI+4B,EAAEp/C,KAAK,WAAW8L,EAAEw8C,eAAelJ,EAAEp/C,KAAK,SAAS,UAAUwP,EAAExB,KAAK,QAAQuZ,OAAOxc,GAAGw1C,GAAE,WAAWnB,EAAE,GAAGvH,QAAQuH,EAAErlD,WAAU,OAA8DssB,MAAMva,EAAE3a","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/vito/Development/MOTION_V3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""}
\ No newline at end of file
status != 'online' &&
status != 'offline' &&
status != 'unmanaged'
- " ng-click="vm.close(); $event.stopPropagation();"><i class="mdi mdi-close mdi-light" ng-click="vm.close(); $event.stopPropagation();"></i></md-button><div ng-if="settings.alignment == 'bottom_right'" aria-label="Reduce"><i class="mdi mdi-light mdi-light" ng-class="layout.up === true ? 'mdi-chevron-down' : 'mdi-chevron-up'"></i></div></div></md-toolbar><md-content class="chat-content"><ui-view></ui-view></md-content></div></div><script>window['buildInfo'] = {"name":"motion-chat","version":"3.5.0","shortHash":"ca0cc42","branch":"develop","tag":"","committedOn":"2022-10-12T16:22:10.000Z","buildDate":"2022-10-21T09:01:40.793Z"};</script><script src="scripts/app.js"></script><script src="scripts/runtime.js"></script><script src="scripts/vendor-index.js"></script><script src="scripts/vendor-angular-76f2ed34.js"></script><script src="scripts/vendor-angular-58d021f3.js"></script><script src="scripts/vendor-ng-embed.js"></script><script src="scripts/vendor-moment.js"></script><script src="scripts/vendor-jquery.js"></script><script src="scripts/vendor-jquery.textcomplete.js"></script><script src="scripts/vendor-emojionearea.js"></script><script src="scripts/vendor-emojione.js"></script><script src="scripts/vendor-angular-sanitize.js"></script><script src="scripts/vendor-angular-resource.js"></script><script src="scripts/vendor-angular-messages.js"></script><script src="scripts/vendor-angular-material.js"></script><script src="scripts/vendor-angular-local-storage.js"></script><script src="scripts/vendor-angular-animate.js"></script><script src="scripts/vendor-urlMatcher.js"></script><script src="scripts/vendor-transition.js"></script><script src="scripts/vendor-stateService.js"></script><script src="scripts/vendor-stateDirectives.js"></script><script src="scripts/vendor-flow.js"></script><script src="scripts/chat.js"></script></body></html>
+ " ng-click="vm.close(); $event.stopPropagation();"><i class="mdi mdi-close mdi-light" ng-click="vm.close(); $event.stopPropagation();"></i></md-button><div ng-if="settings.alignment == 'bottom_right'" aria-label="Reduce"><i class="mdi mdi-light mdi-light" ng-class="layout.up === true ? 'mdi-chevron-down' : 'mdi-chevron-up'"></i></div></div></md-toolbar><md-content class="chat-content"><ui-view></ui-view></md-content></div></div><script>window['buildInfo'] = {"name":"motion-chat","version":"3.8.0","shortHash":"78dcd3b","branch":"release/v3.8.0","tag":"","committedOn":"2022-11-29T09:58:48.000Z","buildDate":"2022-11-29T16:37:02.720Z"};</script><script src="scripts/app.js"></script><script src="scripts/runtime.js"></script><script src="scripts/vendor-index.js"></script><script src="scripts/vendor-angular-76f2ed34.js"></script><script src="scripts/vendor-angular-58d021f3.js"></script><script src="scripts/vendor-ng-embed.js"></script><script src="scripts/vendor-moment.js"></script><script src="scripts/vendor-jquery.js"></script><script src="scripts/vendor-jquery.textcomplete.js"></script><script src="scripts/vendor-emojionearea.js"></script><script src="scripts/vendor-emojione.js"></script><script src="scripts/vendor-angular-sanitize.js"></script><script src="scripts/vendor-angular-resource.js"></script><script src="scripts/vendor-angular-messages.js"></script><script src="scripts/vendor-angular-material.js"></script><script src="scripts/vendor-angular-local-storage.js"></script><script src="scripts/vendor-angular-animate.js"></script><script src="scripts/vendor-urlMatcher.js"></script><script src="scripts/vendor-transition.js"></script><script src="scripts/vendor-stateService.js"></script><script src="scripts/vendor-stateDirectives.js"></script><script src="scripts/vendor-flow.js"></script><script src="scripts/chat.js"></script></body></html>
\ No newline at end of file
--- /dev/null
+/*! For license information please see chat.js.LICENSE.txt */
+(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("<ui-view></ui-view>")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+"></"+m+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],a=0,i=s.length;a<i;a++,r++)o[r]=s[a];return o},i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||void 0,d=i.angular||{},u=d.fromJson||JSON.parse.bind(JSON),m=d.toJson||JSON.stringify.bind(JSON),l=d.forEach||function(e,t,n){if((0,o.kJ)(e))return e.forEach(t,n);Object.keys(e).forEach((function(n){return t(e[n],n)}))},_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n)for(var o=Object.keys(n),r=0;r<o.length;r++)e[o[r]]=n[o[r]]}return e},c=d.equals||function e(t,n){if(t===n)return!0;if(null===t||null===n)return!1;if(t!=t&&n!=n)return!0;var s=typeof t;if(s!==typeof n||"object"!==s)return!1;var a,i,d=[t,n];if((0,r.$6)(o.kJ)(d))return i=n,(a=t).length===i.length&&C(a,i).reduce((function(t,n){return t&&e(n[0],n[1])}),!0);if((0,r.$6)(o.J_)(d))return t.getTime()===n.getTime();if((0,r.$6)(o.Kj)(d))return t.toString()===n.toString();if((0,r.$6)(o.mf)(d))return!0;if([o.mf,o.kJ,o.J_,o.Kj].map(r.Yj).reduce((function(e,t){return e||!!t(d)}),!1))return!1;var u={};for(var m in t){if(!e(t[m],n[m]))return!1;u[m]=!0}for(var m in n)if(!u[m])return!1;return!0};function h(e){return e}function f(){}function p(e,t,n,o,r){void 0===r&&(r=!1);var s=function(t){return e()[t].bind(n())};return(o=o||Object.keys(e())).reduce((function(e,n){var o;return e[n]=r?(o=n,function(){return t[o]=s(o),t[o].apply(null,arguments)}):s(n),e}),t)}var M=function(e,t){return _(Object.create(e),t)},y=(0,r.WA)((function(e,t){return-1!==e.indexOf(t)})),L=(0,r.WA)((function(e,t){var n=e.indexOf(t);return n>=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=_.apply(void 0,a([{}],t.reverse()));return _(o,w(e||{},Object.keys(o)))}var k=function(e,t){return _(e,t)};function j(e,t){var n=[];for(var o in e.path){if(e.path[o]!==t.path[o])break;n.push(e.path[o])}return n}function w(e,t){var n={};for(var o in e)-1!==t.indexOf(o)&&(n[o]=e[o]);return n}function b(e,t){return Object.keys(e).filter((0,r.ff)(y(t))).reduce((function(t,n){return t[n]=e[n],t}),{})}function D(e,t){var n=(0,o.kJ)(e),r=n?[]:{},s=n?function(e){return r.push(e)}:function(e,t){return r[t]=e};return l(e,(function(e,n){t(e,n)&&s(e,n)})),r}function T(e,t){var n;return l(e,(function(e,o){n||t(e,o)&&(n=e)})),n}var S=H;function H(e,t,n){return n=n||((0,o.kJ)(e)?[]:{}),l(e,(function(e,o){return n[o]=t(e,o)})),n}var x=function(e){return Object.keys(e).map((function(t){return e[t]}))},E=function(e,t){return e&&t},P=function(e,t){return e||t},O=function(e,t){return e.concat(t)},$=function(e,t){return(0,o.kJ)(t)?e.concat(t.reduce($,[])):A(e,t)};function A(e,t){return e.push(t),e}var R=function(e,t){return y(e,t)?e:A(e,t)},F=function(e){return e.reduce(O,[])},W=function(e,t){return void 0===t&&(t="assert failure"),function(n){var r=e(n);if(!r)throw new Error((0,o.mf)(t)?t(n):t);return r}};function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return[];for(var n=e.reduce((function(e,t){return Math.min(t.length,e)}),9007199254740991),o=[],r=function(t){switch(e.length){case 1:o.push([e[0][t]]);break;case 2:o.push([e[0][t],e[1][t]]);break;case 3:o.push([e[0][t],e[1][t],e[2][t]]);break;case 4:o.push([e[0][t],e[1][t],e[2][t],e[3][t]]);break;default:o.push(e.map((function(e){return e[t]})))}},s=0;s<n;s++)r(s);return o}function I(e,t){var n,r;if((0,o.kJ)(t)&&(n=t[0],r=t[1]),!(0,o.HD)(n))throw new Error("invalid parameters to applyPairs");return e[n]=r,e}function z(e){return e.length&&e[e.length-1]||void 0}function J(e,t){return t&&Object.keys(t).forEach((function(e){return delete t[e]})),t||(t={}),_(t,e)}var V=function(e){return e.catch((function(e){return 0}))&&e},N=function(e){return V(s.u.$q.reject(e))}},"./node_modules/@uirouter/core/lib-esm/common/coreservices.js":(e,t,n)=>{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],a=0,i=s.length;a<i;a++,r++)o[r]=s[a];return o};function r(e){return function t(){if(arguments.length>=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.apply(null,[].slice.call(arguments).reverse())}var i=function(e){return function(t){return t&&t[e]}},d=r((function(e,t,n){return n&&n[e]===t})),u=function(e){return a.apply(null,e.split(".").map(i))},m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}};function l(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.apply(null,n)&&t.apply(null,n)}}function _(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return e.apply(null,n)||t.apply(null,n)}}var c=function(e){return function(t){return t.reduce((function(t,n){return t&&!!e(n)}),!0)}},h=function(e){return function(t){return t.reduce((function(t,n){return t||!!e(n)}),!1)}},f=function(e){return function(t){return null!=t&&t.constructor===e||t instanceof e}},p=function(e){return function(){return e}};function M(e){return function(t){for(var n=0;n<e.length;n++)if(e[n][0](t))return e[n][1](t)}}},"./node_modules/@uirouter/core/lib-esm/common/predicates.js":(e,t,n)=>{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length<e;)t+=" ";return t}function u(e){return e.replace(/^([A-Z])/,(function(e){return e.toLowerCase()})).replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))}function m(e){var t=l(e),n=t.match(/^(function [^ ]+\([^)]*\))/),o=n?n[1]:t,r=e.name||"";return r&&o.match(/function \(/)?"function "+r+o.substr(9):o}function l(e){var t=(0,o.kJ)(e)?e.slice(-1)[0]:e;return t&&t.toString()||"undefined"}var _=r.i.isRejectionPromise,c=(0,a.uj)([[o.o8,(0,a.P0)("undefined")],[o.Ft,(0,a.P0)("null")],[o.tI,(0,a.P0)("[Promise]")],[_,function(e){return e._transitionRejection.toString()}],[function(e){return(0,o.Kn)(e)&&!(0,o.kJ)(e)&&e.constructor!==Object&&(0,o.mf)(e.toString)},function(e){return e.toString()}],[o.Qh,m],[(0,a.P0)(!0),s.yR]]);function h(e){var t=[];function n(e){if((0,o.Kn)(e)){if(-1!==t.indexOf(e))return"[circular ref]";t.push(e)}return c(e)}return(0,o.o8)(e)?n(e):JSON.stringify(e,(function(e,t){return n(t)})).replace(/\\"/g,'"')}var f=function(e){return function(t){if(!t)return["",""];var n=t.indexOf(e);return-1===n?[t,""]:[t.substr(0,n),t.substr(n+1)]}},p=function(e){return e.replace(/\/[^/]*$/,"")},M=f("#"),y=f("?"),L=f("="),g=function(e){return e?e.replace(/^#/,""):""};function Y(e){var t=new RegExp("("+e+")","g");return function(e){return e.split(t).filter(s.yR)}}function v(e,t){return(0,o.HD)((0,s.Gb)(e))&&(0,o.HD)(t)?e.slice(0,-1).concat((0,s.Gb)(e)+t):(0,s.Ez)(e,t)}},"./node_modules/@uirouter/core/lib-esm/common/trace.js":(e,t,n)=>{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._set(!0,e)},e.prototype.disable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._set(!1,e)},e.prototype.enabled=function(e){return!!this._enabled[u(e)]},e.prototype.traceTransitionStart=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Started -> "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o<r.length;o++){var s=r[o];n[s.id]=s.value(t[s.id])}return n},e.changed=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e.filter((function(e){return!e.type.equals(t[e.id],n[e.id])}))},e.equals=function(t,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),0===e.changed(t,n,o).length},e.validates=function(e,t){return void 0===t&&(t={}),e.map((function(e){return e.validates(t[e.id])})).reduce(r.XC,!0)},e.prototype.isDefaultValue=function(e){return this.isOptional&&this.type.equals(this.value(),e)},e.prototype.value=function(e){var t=this;return e=function(e){for(var n=0,o=t.replace;n<o.length;n++){var r=o[n];if(r.from===e)return r.to}return e}(e),(0,a.o8)(e)?function(){if(t._defaultValueCache)return t._defaultValueCache.defaultValue;if(!i.u.$injector)throw new Error("Injectable functions cannot be called at configuration time");var e=i.u.$injector.invoke(t.config.$$fn);if(null!=e&&!t.type.is(e))throw new Error("Default value ("+e+") for parameter '"+t.id+"' is not an instance of ParamType ("+t.type.name+")");return t.config.$$fn.__cacheable&&(t._defaultValueCache={defaultValue:e}),e}():this.type.$normalize(e)},e.prototype.isSearch=function(){return this.location===o.SEARCH},e.prototype.validates=function(e){if(((0,a.o8)(e)||null===e)&&this.isOptional)return!0;var t=this.type.$normalize(e);if(!this.type.is(t))return!1;var n=this.type.encode(t);return!((0,a.HD)(n)&&!this.type.pattern.exec(n))},e.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},e}()},"./node_modules/@uirouter/core/lib-esm/params/paramType.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a<o.length;a++)if(!e(o[a],r[a]))return!1;return!0}}["encode","decode","equals","$normalize"].forEach((function(t){var o=e[t].bind(e),r="equals"===t?i:a;n[t]=r(o)})),(0,o.l7)(this,{dynamic:e.dynamic,name:e.name,pattern:e.pattern,inherit:e.inherit,raw:e.raw,is:a(e.is.bind(e),!0),$arrayMode:t})}},"./node_modules/@uirouter/core/lib-esm/params/paramTypes.js":(e,t,n)=>{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l<m&&t[l].state!==o&&(r=t[l],s=n[l],r.equals(s,e.nonDynamicParams));)l++;i=(a=t).slice(0,l),d=a.slice(l);var _=i.map((function(e,t){var o=e.clone();return o.paramValues=n[t].paramValues,o}));return u=n.slice(l),{from:a,to:_.concat(u),retained:i,retainedWithToParams:_,exiting:d,entering:u}},e.matching=function(e,t,n){var r=!1;return(0,o.ym)(e,t).reduce((function(e,t){var o=t[0],s=t[1];return(r=r||!o.equals(s,n))?e:e.concat(o)}),[])},e.equals=function(t,n,o){return t.length===n.length&&e.matching(t,n,o).length===t.length},e.subPath=function(e,t){var n=(0,o.sE)(e,t),r=e.indexOf(n);return-1===r?void 0:e.slice(0,r+1)},e.nonDynamicParams=function(e){return e.state.parameters({inherit:!1}).filter((function(e){return!e.dynamic}))},e.paramValues=function(e){return e.reduce((function(e,t){return(0,o.l7)(e,t.paramValues)}),{})},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/interface.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s<r;s++)if(""!==o[s]||0!==s){if("^"!==o[s])break;if(!a.parent)throw new Error("Path '"+e+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var i=o.slice(s).join(".");return a.name+(a.name&&i?".":"")+i},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateObject.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n<t.length;n++){var s=new o.rR(t[n]);if(s&&s.matches(e.name)||!s&&t[n]===e.name)return!0}return!1})(e,n)}var a=function(){function e(e,t,n,o,r,s){void 0===s&&(s={}),this.tranSvc=e,this.eventType=t,this.callback=n,this.matchCriteria=o,this.removeHookFromRegistry=r,this.invokeCount=0,this._deregistered=!1,this.priority=s.priority||0,this.bind=s.bind||null,this.invokeLimit=s.invokeLimit}return e.prototype._matchingNodes=function(e,t,n){if(!0===t)return e;var o=e.filter((function(e){return s(e.state,t,n)}));return o.length?o:null},e.prototype._getDefaultMatchCriteria=function(){return(0,o.js)(this.tranSvc._pluginapi._getPathTypes(),(function(){return!0}))},e.prototype._getMatchingNodes=function(e,t){var n=this,s=(0,o.l7)(this._getDefaultMatchCriteria(),this.matchCriteria);return(0,o.VO)(this.tranSvc._pluginapi._getPathTypes()).reduce((function(a,i){var d=i.scope===r.c.STATE,u=e[i.name]||[],m=d?u:[(0,o.Gb)(u)];return a[i.name]=n._matchingNodes(m,s[i.name],t),a}),{})},e.prototype.matches=function(e,t){var n=this._getMatchingNodes(e,t);return(0,o.VO)(n).every(o.yR)?n:null},e.prototype.deregister=function(){this.removeHookFromRegistry(this),this._deregistered=!0},e}();function i(e,t,n){var r=(e._registeredHooks=e._registeredHooks||{})[n.name]=[],s=(0,o.nA)(r);function i(e,o,i){void 0===i&&(i={});var d=new a(t,n,o,e,s,i);return r.push(d),d.deregister.bind(d)}return e[n.name]=i,i}},"./node_modules/@uirouter/core/lib-esm/transition/interface.js":(e,t,n)=>{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o<t.length;o++){var r=t[o].invokeHook();if((0,a.tI)(r)){var s=t.slice(o+1);return e.chain(s,r).then(n)}}return n()},e.runAllHooks=function(e){e.forEach((function(e){return e.invokeHook()}))},e.prototype.logError=function(e){this.transition.router.stateService.defaultErrorHandler()(e)},e.prototype.invokeHook=function(){var e=this,t=this.registeredHook;if(!t._deregistered){var n=this.getNotCurrentRejection();if(n)return n;var o=this.options;d.g4.traceHookInvocation(this,this.transition,o);var r=function(n){return t.eventType.getErrorHandler(e)(n)},s=function(n){return t.eventType.getResultHandler(e)(n)};try{var i=t.callback.call(o.bind,e.transition,e.stateContext);return!this.type.synchronous&&(0,a.tI)(i)?i.catch((function(e){return m.i.normalize(e).toPromise()})).then(s,r):s(i)}catch(e){return r(m.i.normalize(e))}finally{t.invokeLimit&&++t.invokeCount>=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(){function e(e){this.router=e}return e.prototype.fromConfig=function(e,t,n){return new s.Param(e,t,s.DefType.CONFIG,this.router.urlService.config,n)},e.prototype.fromPath=function(e,t,n){return new s.Param(e,t,s.DefType.PATH,this.router.urlService.config,n)},e.prototype.fromSearch=function(e,t,n){return new s.Param(e,t,s.DefType.SEARCH,this.router.urlService.config,n)},e}(),d=function(){function e(e){var t=this;this.router=e,this.paramFactory=new i(this.router),this.UrlMatcher=r.x,this.Param=s.Param,this.caseInsensitive=function(e){return t.router.urlService.config.caseInsensitive(e)},this.defaultSquashPolicy=function(e){return t.router.urlService.config.defaultSquashPolicy(e)},this.strictMode=function(e){return t.router.urlService.config.strictMode(e)},this.type=function(e,n,o){return t.router.urlService.config.type(e,n,o)||t}}return e.prototype.compile=function(e,t){var n=this.router.urlService.config,s=t&&!t.state&&t.params;t=s?a({state:{params:s}},t):t;var i={strict:n._isStrictMode,caseInsensitive:n._isCaseInsensitive,decodeParams:n._decodeParams};return new r.x(e,n.paramTypes,this.paramFactory,(0,o.l7)(i,t))},e.prototype.isMatcher=function(e){if(!(0,o.Kn)(e))return!1;var t=!0;return(0,o.Ed)(r.x.prototype,(function(n,r){(0,o.mf)(n)&&(t=t&&(0,o.$K)(e[r])&&(0,o.mf)(e[r]))})),t},e.prototype.$get=function(){var e=this.router.urlService.config;return e.paramTypes.enqueue=!1,e.paramTypes._flushTypeQueue(),this},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRouter.js":(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o<t.length;o++)t[o]._group=n,o<t.length-1&&0!==this._sortFn(t[o],t[o+1])&&n++;this._rules=t,this._sorted=!0},e.prototype.ensureSorted=function(){this._sorted||this.sort()},e.prototype.stableSort=function(e,t){var n=e.map((function(e,t){return{elem:e,idx:t}}));return n.sort((function(e,n){var o=t(e.elem,n.elem);return 0===o?e.idx-n.idx:o})),n.map((function(e){return e.elem}))},e.prototype.when=function(e,t,n){var o=this.urlRuleFactory.create(e,t);return(0,a.$K)(n&&n.priority)&&(o.priority=n.priority),this.rule(o),o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlService.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;a<s.length&&(!t||t.rule._group===s[a]._group);a++){var i=(void 0,(r=(n=s[a]).match(e,this.router))&&{match:r,rule:n,weight:n.matchPriority(r)});t=!t||i&&i.weight>t.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'<div class="ngrateiti needsclick" ng-class="{\'ngrateit-readonly\': readOnly()}"><a ng-if="!readOnly() && resetable()"ng-click="removeRating()"class="ngrateit-reset ngrateit-star needsclick"ng-style="{\'width\': canelWidth+\'px\', \'height\':cancelHeight+\'px\'}"></a><div ng-if="!hide" id="origin" class="ngrateit-rating needsclick" ng-class="{\'ngrateit-hashover\':!isTouch}"><span class="ngrateit-star ngrateit-bg-star needsclick"ng-repeat="i in getStartParts() track by $index" ng-class="{\'ngrateit-selected\': isSelected($index) }"ng-click="setValue($index)"ng-style="{\'width\': starPartWidth+\'px\', \'height\':starHeight+\'px\', \'background-position\': getStarOffset($index)+\'px 0\'}"></span></div></div>')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0,forceDownload:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y,L=!1;function g(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function Y(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function k(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function j(e){return function(n){var o,r,s;403===(null===(o=n.data)||void 0===o?void 0:o.code)&&"OutOfInterval"===(null===(r=n.data)||void 0===r||null===(s=r.details)||void 0===s?void 0:s.type)?(t.settings.online=!1,t.settings.outOfInterval=!0,a.go("app.offline",null,{location:"replace"})):(h.errors[e]=n.data,Y())}}function w(e){L||(L=!0,u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),Y()})).catch(j("chatMessageError")).finally((()=>{L=!1})))}function D(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:g();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function H(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&w(v()({body:n},t.visitor))}function x(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r<e.rows.length;r++){const s=b()(t.messages,{id:e.rows[r].id});s?e.rows[r].read&&(s.read=!0):(o=!0,t.messages.push(e.rows[r])),"out"!==e.rows[r].direction||e.rows[r].read||(n=e.rows[r].id,u.chatMessage.update({id:n,read:!0}).$promise.catch((function(e){console.error(e)})))}o&&Y(),e.rows[r-1].read&&(y=e.rows[r-1].id),y&&!t.visitor.interactionStarted&&m.updateStorage(l,{...t.visitor,interactionStarted:!0}).then((e=>{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?g():(D(),p=r(x,2e3),M=r(D,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){H(t)},ready:function(){this.setFocus()}}})},h.reply=H,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(w(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void k();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},w(v()({body:'<a href="'+t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_download?attachId="+e.id+"&token="+t.settings.token+'" target="_blank">'+e.name+"</a>",AttachmentId:e.id},t.visitor))):j("sendAttachment")}),j("sendAttachment"))},h.handleSizeError=k,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(n){const o=i.fields[n],a=s.find(".upload-item");if(a.length){const n=angular.element(a[0].querySelector(".upload-button")),s=angular.element(a[0].querySelector("input[type=file]")),d=n.find("label");d.length&&d.css("display","none"),n.on("click",(()=>{d.css("display","none"),"function"==typeof s.trigger?s.trigger("click"):s[0].click()})),s.on("change",(n=>{e.$apply((function(){"string"==typeof o.props.error&&(o.props.error=null);const e=Array.from(n.target.files),s=1048576*o.config.size;e.some((e=>e.size>=s))?(o.options=[],o.props.error=o.config.sizeErrMessage,function(e){i.errors={},t.$emit("hide");const n=r.simple().textContent("FILE TOO BIG: The max allowed size is "+e+"MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n)}(o.config.size)):o.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[o.props.title]=o.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e<i.fields.length;e++){const n=i.fields[e];if(t.typeField+=n.type,void 0!==n.props&&n.props.helpText){const t=RegExp.prototype.test.bind(/(<([^>]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)})).finally((function(){if(t.settings.outOfInterval){t.settings.outOfInterval=!1;const e=r.simple().textContent("Sorry, your message was not sent.\nWe are offline at the moment.").hideDelay(5e3).toastClass("md-warning-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;n<i.fields.length;n++){const o=i.fields[n];o.props&&void 0!==e[o.props.title]&&(_()(o.cmField)||(i.visitor[o.cmField]=Array.isArray(e[o.props.title])?e[o.props.title].join():e[o.props.title]),n===d&&(_()(t.settings.mapKeyOffline)||(i.visitor.mapKeyOffline=t.settings.mapKeyOffline,i.visitor.from=Array.isArray(e[o.props.title])?e[o.props.title].join():e[o.props.title])),"upload"===o.type&&(e[o.props.title]=e[o.props.title].map((e=>e.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){e.settings.online?e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"}):(e.settings.outOfInterval=!0,t.go("app.offline",null,{location:"replace"}))}function u(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e<a.fields.length;e++){const t=a.fields[e];if(t.props.helpText){const n=RegExp.prototype.test.bind(/(<([^>]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>u()))}}else t.go("app.waiting",null,{location:"replace"});else u()},a.submit=function(){let t="New chat request \n";for(let n=0;n<a.fields.length;n++){const o=a.fields[n];o.props&&void 0!==a.form[o.props.title]&&(_()(o.variable)||(e.visitor[o.variable]=Array.isArray(a.form[o.props.title])?a.form[o.props.title].join():a.form[o.props.title]),_()(o.cmField)||(e.visitor[o.cmField]=Array.isArray(a.form[o.props.title])?a.form[o.props.title].join():a.form[o.props.title]),n===i&&(_()(e.settings.mapKey)||(e.visitor.mapKey=e.settings.mapKey,e.visitor.from=Array.isArray(a.form[o.props.title])?a.form[o.props.title].join():a.form[o.props.title])),a.form[o.props.title]&&(t+=o.props.title+": "+a.form[o.props.title]+"\n"))}var n;n=v()({body:t,referer:e.settings.referer,customerIp:e.settings.customerIp},e.visitor),a.disableItem=!0,o.chatWebsite.notify(n).$promise.then((function(t){delete a.errors.chatMessageError,e.visitor.message={id:t.message.id},e.visitor.interaction={id:t.interaction.id},r.updateStorage(s,e.visitor).then((t=>{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,d()})).catch((function(t){var n,o,r;a.disableItem=!1,403===(null===(n=t.data)||void 0===n?void 0:n.code)&&"OutOfInterval"===(null===(o=t.data)||void 0===o||null===(r=o.details)||void 0===r?void 0:r.type)?(e.settings.online=!1,d()):console.error(t)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){e.messages.length>0&&function(e){const t=document.createElement("div"),n=e.visitor,o=e.settings;let r;for(let a=0;a<e.messages.length;a++){const i=e.messages[a];let d="Sender: ";const u="Message: "+i.body,m="Sent At: "+s()(i.createdAt).format("YYYY-MM-DD HH:mm:ss");if(0!==a){switch(e.settings.agentIdentifier){case"website_alias":d+="out"===i.direction?i.UserId?o.agentAlias+i.UserId:"System":o.customerAlias||n.from||"Visitor"+i.ContactId;break;case"agent_alias":d+="out"===i.direction?i.UserId?i.User.alias||i.User.fullname:"System":o.customerAlias||n.from||"Visitor"+i.ContactId;break;case"agent_fullname":d+="out"===i.direction?i.UserId?i.User.fullname:"System":o.customerAlias||n.from||"Visitor"+i.ContactId;break;default:d+="out"===i.direction?i.UserId?(o.agentAlias||"Agent")+i.UserId:"System":o.customerAlias||n.from||"Visitor"+i.ContactId}t.appendChild(document.createTextNode(d)),t.appendChild(document.createElement("br")),t.appendChild(document.createTextNode(u)),t.appendChild(document.createElement("br")),t.appendChild(document.createTextNode(m)),t.appendChild(document.createElement("br")),t.appendChild(document.createElement("br"))}else r=i.createdAt}const a=window.open();a.document.write("<html><head><title>"+document.title+"</title>"),a.document.write("</head><body >"),a.document.write("<h3> Website: "+o.referer+"</h3>"),a.document.write("<h3> Start Time: "+s()(r).format("YYYY-MM-DD HH:mm:ss")+"</h3>"),a.document.write("<h3> Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"</h3>"),a.document.write(t.innerHTML),a.document.write("</body></html>"),a.document.close(),a.focus(),a.print(),a.close()}(e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l<m.length;l++)s.append(u+"["+l+"]",m.item(l));else m instanceof Blob?s.append(u,m,m.name):m instanceof Date?s.append(u,m.toISOString()):(null===m&&o.includeNullValues||null!==m)&&void 0!==m&&s.append(u,m)}i++}return s}return function(e,t){if(t&&t.initialFormData){if("function"!=typeof t.initialFormData.append)throw"initialFormData must have an append function."}else if(!n())throw"This environment does not have global form data. options.initialFormData must be specified.";var s=[{initialFormData:o(),showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}},t||{}].reduce((function(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}),{});return r(e,s,s.initialFormData)}}()}.apply(t,[]))||(e.exports=n)},"./node_modules/moment/locale/af.js":function(e,t,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\200fM/\200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\200fM/\200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\200fM/\200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک\200cشنبه_دوشنبه_سه\200cشنبه_چهارشنبه_پنج\200cشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک\200cشنبه_دوشنبه_سه\200cشنبه_چهارشنبه_پنج\200cشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه\200cكشه\200cممه\200c_دووشه\200cممه\200c_سێشه\200cممه\200c_چوارشه\200cممه\200c_پێنجشه\200cممه\200c_هه\200cینی_شه\200cممه\200c".split("_"),weekdaysShort:"یه\200cكشه\200cم_دووشه\200cم_سێشه\200cم_چوارشه\200cم_پێنجشه\200cم_هه\200cینی_شه\200cممه\200c".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره\200c|به\200cیانی/,isPM:function(e){return/ئێواره\200c/.test(e)},meridiem:function(e,t,n){return e<12?"به\200cیانی":"ئێواره\200c"},calendar:{sameDay:"[ئه\200cمرۆ كاتژمێر] LT",nextDay:"[به\200cیانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له\200c %s",past:"%s",s:"چه\200cند چركه\200cیه\200cك",ss:"چركه\200c %d",m:"یه\200cك خوله\200cك",mm:"%d خوله\200cك",h:"یه\200cك كاتژمێر",hh:"%d كاتژمێر",d:"یه\200cك ڕۆژ",dd:"%d ڕۆژ",M:"یه\200cك مانگ",MM:"%d مانگ",y:"یه\200cك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්\200dරේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්\200dරහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්\200dරහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්\200dර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n<l.length?r+t:r})),o.addByteOrderMarker&&(a+="\ufeff"),a+=i,r.resolve(a)}));return"function"==typeof d.catch&&d.catch((function(e){r.reject(e)})),r.promise},this.isSpecialChar=function(e){return void 0!==n[e]},this.getSpecialChar=function(e){return n[e]}}]),angular.module("ngCsv.directives").directive("ngCsv",["$parse","$q","CSV","$document","$timeout",function(e,t,o,r,s){return{restrict:"AC",scope:{data:"&ngCsv",filename:"@filename",header:"&csvHeader",columnOrder:"&csvColumnOrder",txtDelim:"@textDelimiter",decimalSep:"@decimalSeparator",quoteStrings:"@quoteStrings",fieldSep:"@fieldSeparator",lazyLoad:"@lazyLoad",addByteOrderMarker:"@addBom",ngClick:"&",charset:"@charset",label:"&csvLabel"},controller:["$scope","$element","$attrs","$transclude",function(e,n,r){e.csv="",angular.isDefined(e.lazyLoad)&&"true"==e.lazyLoad||angular.isArray(e.data)&&e.$watch("data",(function(){e.buildCSV()}),!0),e.getFilename=function(){return e.filename||"download.csv"},e.buildCSV=function(){var s=t.defer();return n.addClass(r.ngCsvLoadingClass||"ng-csv-loading"),o.stringify(e.data(),function(){var t={txtDelim:e.txtDelim?e.txtDelim:'"',decimalSep:e.decimalSep?e.decimalSep:".",quoteStrings:e.quoteStrings,addByteOrderMarker:e.addByteOrderMarker};return angular.isDefined(r.csvHeader)&&(t.header=e.$eval(e.header)),angular.isDefined(r.csvColumnOrder)&&(t.columnOrder=e.$eval(e.columnOrder)),angular.isDefined(r.csvLabel)&&(t.label=e.$eval(e.label)),t.fieldSep=e.fieldSep?e.fieldSep:",",t.fieldSep=o.isSpecialChar(t.fieldSep)?o.getSpecialChar(t.fieldSep):t.fieldSep,t}()).then((function(t){e.csv=t,n.removeClass(r.ngCsvLoadingClass||"ng-csv-loading"),s.resolve(t)})),e.$apply(),s.promise}}],link:function(e,t){t.bind("click",(function(){e.buildCSV().then((function(){!function(){var t=e.charset||"utf-8",o=new Blob([e.csv],{type:"text/csv;charset="+t+";"});if(n.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(o,e.getFilename());else{var a=angular.element('<div data-tap-disabled="true"><a></a></div>'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/dc49a9ba939f8c099868.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/9962474df74f9405ac72.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/caf0e553108b226443aa.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]);
+//# sourceMappingURL=chat.js.map
\ No newline at end of file
--- /dev/null
+{"version":3,"file":"scripts/chat.js","mappings":";iMAOAA,QAAQC,OAAO,gBAAiB,IAC/BC,SAAS,eAAe,WACvB,aAMAC,KAAKC,SAAW,GAQhBD,KAAKE,QAAU,SAAUC,GACvB,OAAO,IAAIC,EAAKD,IASlBH,KAAKK,OAAS,GASdL,KAAKM,GAAK,SAAUC,EAAOC,GACzBR,KAAKK,OAAOI,KAAK,CAACF,EAAOC,KAG3BR,KAAKU,KAAO,WACV,IAAIC,EAAKX,KAAKE,QACVD,EAAWD,KAAKC,SAChBI,EAASL,KAAKK,OAClB,MAAO,CACL,OAAU,SAASO,GAEjB,IAAIC,EAAOF,EAAGd,QAAQiB,OAAO,GAAIb,EAAUW,IAI3C,OAHAf,QAAQkB,QAAQV,GAAQ,SAAUE,GAChCM,EAAKP,GAAGC,EAAM,GAAIA,EAAM,OAEnBM,QAKfhB,QAAQC,OAAO,YAAa,CAAC,kBAC1BkB,WAAW,WAAY,CAAC,SAAU,SAAU,SAAU,cACvD,SAAUC,EAAQC,EAAQC,EAAQC,GAEhC,IAAIjB,EAAUN,QAAQiB,OAAO,GAAIG,EAAOI,MAAMH,EAAOI,WAGjDT,EAAQI,EAAOI,MAAMH,EAAOK,aAAeH,EAAYI,OAAOrB,GAE9DsB,EAAkB,SAASC,GAC7B,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtCL,EAAKM,QACL,IAAI1B,EAAQU,EAAOiB,WAAWC,MAAMlB,EAAQ,CAAC,SAAWS,EAAWb,GAAMuB,OAAOT,IAMhF,GALI,CACF,SAAW,EAAG,eAAiB,EAAG,YAAe,EAAG,UAAa,EAAG,SAAY,GAChFD,IACAT,EAAOoB,cAEL9B,EAAM+B,iBACR,OAAO,GAIXzB,EAAKP,GAAG,WAAYmB,GACpBR,EAAOsB,IAAI,YAAY,WACnB1B,EAAK2B,IAAI,WAAYf,MAGzBR,EAAOwB,MAAQ5B,EAEXK,EAAOwB,eAAe,cACxBvB,EAAOD,EAAOyB,UAAUC,OAAO3B,EAAQJ,GACvCI,EAAOsB,IAAI,YAAY,WACrBpB,EAAOD,EAAOyB,UAAUC,OAAO3B,UAIpC4B,UAAU,WAAY,CAAC,WACtB,MAAO,CACLC,OAAO,EACP9B,WAAY,eAGlBnB,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,SAAY,KACZ,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAIC,EAAcD,EAAMN,eAAe,iBACnCQ,EAAeF,EAAMN,eAAe,kBACpCS,EAAaH,EAAMN,eAAe,cAAgBI,EAAMzB,MAAM2B,EAAMI,WACxEN,EAAML,MAAMY,aAAaN,EAASE,EAAaC,EAAcC,QAInEtD,QAAQC,OAAO,kBAAmB,CAAC,cAKhC+C,UAAU,mBAAmB,WAC5B,MAAO,CACL,OAAS,EACT,KAAQ,SAASC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,iBAAiB,SAAU/C,GACtCA,EAAMgD,yBASbV,UAAU,gBAAiB,CAAC,WAAY,SAASW,GAChD,MAAO,CACL,OAAS,EACT,KAAQ,SAASV,EAAOC,EAASC,GAC/B,IAAIS,EACAC,GAAQ,EACZX,EAAQO,KAAK,YAAY,SAAU/C,GAmBnC,IAAoBoD,EACdC,EACAC,EADAD,GAAW,EACXC,GAFcF,EAlBFpD,GAoBasD,cAAgBF,EAAUG,cAAcD,aACrEhE,QAAQkB,QAAQ8C,GAAgBA,EAAaE,OAAO,SAASC,GAC/C,UAARA,IACFJ,GAAW,MAGRA,IAvBFF,IACHZ,EAAMmB,OAAOjB,EAAMkB,eACnBR,GAAQ,GAEVF,EAASW,OAAOV,GAChBlD,EAAMgD,qBAERR,EAAQO,KAAK,kBAAkB,SAAU/C,GACvCiD,EAASW,OAAOV,GAChBA,EAAUD,GAAS,WACjBV,EAAMzB,MAAM2B,EAAMoB,eAClBX,EAAU,KACVC,GAAQ,IACP,aAgBb7D,QAAQC,OAAO,YAAa,CAAC,cAC5B+C,UAAU,YAAY,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAY/B,SAASqB,IACPvB,EAAML,MAAM4B,WAAWtB,GAZrBC,EAAMsB,gBACRxB,EAAMyB,OAAOvB,EAAMsB,iBAAiB,SAAUE,GACxCA,EACFH,IAYJvB,EAAML,MAAMgC,aAAa1B,MANzBsB,SAYP,SAAUxE,GAAU,aACnB,IAAIC,EAASD,EAAQC,OAAO,cAAe,CAAC,cAgB5CD,EAAQkB,QAfK,CACX2D,YAAa,CAAC,QAAS,YACvBC,aAAc,CAAC,SACfC,UAAW,CAAC,QAAS,UACrBC,WAAY,CAAC,SAAU,UACvBC,eAAgB,CAAC,SAAU,UAC3BC,UAAW,CAAC,SACZC,YAAa,CAAC,SACdC,UAAW,CAAC,QAAS,YACrBC,YAAa,GACbC,SAAU,GACVC,SAAU,GACVC,MAAO,CAAC,WAAY,WAGE,SAAUC,EAAW5D,GAC3C,IA4B6B6D,EA5BzBC,EAAO,SA4BkBD,EA5Ba7D,GA6B5B+D,OAAO,GAAGC,cAAgBH,EAAOzD,MAAM,IA5BzC,mBAAR0D,IACFA,EAAO,qBAET1F,EAAO+C,UAAU2C,EAAM,CAAC,WACtB,MAAO,CACLG,QAAS,YACT3E,WAAY,CAAC,SAAU,SAAU,SAAUC,EAAQC,GACjDD,EAAOsB,IAAI,SAAWb,GAAW,WAC/B,IAAIkE,EAAWhE,MAAMC,UAAUC,MAAMC,KAAKC,WACtCzB,EAAQqF,EAAS3D,QAErB,GAAIhB,EAAOwB,QAAUmD,EAAS3D,QAA9B,CAGA,IAAIN,EAAO,GACX9B,EAAQkB,QAAQuE,GAAW,SAASd,EAAOqB,GACzClE,EAAK6C,GAASoB,EAASC,OAEgB,IAArC5E,EAAOI,MAAMH,EAAOsE,GAAO7D,IAC7BpB,EAAMgD,8BAtCnB,CAiDC1D,SAEFA,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAI8C,EAAO9C,EAAM+C,QACjBjD,EAAMyB,OAAOuB,GAAM,SAAUA,GAC3B,GAAKA,EAAL,CAGA,IAAIE,EAAa,IAAIC,WACrBD,EAAWE,cAAcJ,EAAKA,MAC9BE,EAAWG,OAAS,SAAU5F,GAC5BuC,EAAMmB,QAAO,WACXjB,EAAMoD,KAAK,MAAO7F,EAAM8F,OAAOC,qBAO3CzG,QAAQC,OAAO,iBAAkB,CAAC,cACjC+C,UAAU,gBAAiB,CAAC,WAC3B,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,GACfA,EAAMyD,UAAYzD,EAAML,MAAM+D,WAIpC3G,QAAQC,OAAO,OAAQ,CAAC,gBAAiB,YAAa,cAAe,WACnE,YAAa,iBAAkB,WAAY,yHC9JlC2G,4PAkKX,SAASC,EAAmBC,EAAUC,EAAaC,EAAcC,EAAOC,GACpE,IAAIC,GAAkB,IAAAC,OAAM,yBACxBC,GAAe,IAAAD,OAAM,sBACzB,MAAO,CACHE,SAAU,MACVC,UAAW,IACXC,QAAS,SAAUC,GACf,IAAIC,EAAUD,EAASE,OAEvB,OADAF,EAASG,QACF,SAAU3E,EAAO4E,GACpB,IAAIC,EAAOD,EAASC,KAAK,WACzB,IAAKA,EAGD,OAFAD,EAASF,KAAKD,QACdZ,EAASe,EAASE,WAAlBjB,CAA8B7D,GAGlC,IAAI+E,EAAMF,EAAKG,MAAQ,CAAEC,SAAU,GAAIC,YAAa,EAAAC,MAChDC,EAAaL,EAAIM,MAAQ,IAAI,EAAAC,eAAeP,EAAIM,MACpDT,EAASF,KAAKK,EAAIG,YAAYN,EAAUQ,IAAeX,GACvD,EAAAc,MAAA,gBAAsBV,EAAKW,QAASZ,EAASF,QAC7C,IAAIe,EAAO5B,EAASe,EAASE,YACzB5G,EAAa6G,EAAI7G,WACjBwH,EAAexB,EAAgBa,GAC/BY,EAAYvB,EAAaW,GACzBa,EAASR,IAAc,OAAUA,GAErC,GADApF,EAAM2F,GAAaC,EACf1H,EAAY,CACZ,IAAI2H,EAAsB/B,EAAY5F,GAAY,IAAAF,QAAO,GAAI4H,EAAQ,CAAEzH,OAAQ6B,EAAO4E,SAAUA,KAC5Fc,IACA1F,EAAM0F,GAAgBG,EACtB7F,EAAM0F,GAAcC,GAAaC,GAMrChB,EAASC,KAAK,0BAA2BgB,GACzCjB,EAASkB,WAAWjB,KAAK,0BAA2BgB,GACpDE,EAA4B9B,EAAIF,EAAc8B,EAAoB7F,EAAO+E,GAG7E,IAAI,IAAAiB,UAASjB,EAAIkB,WACb,IAAIC,GAAY,IAAAC,aAAYpB,EAAIkB,WAC5BG,EAAc,IAAIC,OAAO,eAAiBH,EAAY,IAAK,KAO3DI,EAAoBtG,EAAMyB,QAND,WACzB,IAAI8E,EAAc,GAAGvH,MAChBC,KAAK2F,EAAS,GAAGkB,UACjBU,QAAO,SAAUC,GAAM,OAAOA,GAAMA,EAAGC,SAAWN,EAAYO,KAAKF,EAAGC,YAC3E,OAAOH,GAAe,aAAgBA,GAAa1B,KAAK,IAAME,EAAIkB,UAAY,iBAErB,SAAUW,GAC9DA,IAELb,EAA4B9B,EAAIF,EAAc6C,EAAc5G,EAAO+E,GACnEuB,QAGRb,EAAKzF,MAzNrB2D,EAAS,CACL,QACA,WACA,gBACA,eACA,KACA,SAAwBK,EAAO6C,EAAUC,EAAeC,EAAc9C,GAwBlE,IAAI+C,EAAW,CACXhC,KAAM,CAAEC,SAAU,CAAEgC,SAAUjD,EAAMkD,WAAWC,qBAC/C3B,QAAS,IAETzF,EAAY,CACZqH,MAAO,EACP/C,SAAU,MACVgD,UAAU,EACV/C,SAAU,IACVgD,WAAY,UACZ/C,QAAS,SAAUC,EAAU+C,EAAQC,GACjC,OAAO,SAAUxH,EAAO4E,EAAU1E,GAC9B,IACIuH,EAAYC,EAAWC,EAAcC,EADrCC,EAAY3H,EAAc,QAAK,GAAI4H,EAAgB5H,EAAkB,WAAG6H,EAjCzE,SAAU9H,EAASsD,EAAQyE,GAC1B,mBAAwB,EACxBnB,EAASjG,MAAMX,EAAS,KAAMsD,GAAQ0E,KAAKD,GAG3CnB,EAASjG,MAAMX,EAAS,KAAMsD,EAAQyE,IA4BkCD,EAzBzE,SAAU9H,EAAS+H,GAClB,mBAAwB,EACxBnB,EAASqB,MAAMjI,GAASgI,KAAKD,GAG7BnB,EAASqB,MAAMjI,EAAS+H,IAoB0EG,EAAYvD,EAASwD,cAAc,YAAcpB,EAAUtE,EAAOqE,EAAa7G,EAAc,QAAKA,EAAY,MAAK,GAAjD6G,CAAqD/G,IAAU,WAEnOqI,EAAe,CACfC,MAAO,MACPC,GAAIxI,EAAUqH,QACd1E,KAAMA,EACN8F,IAAKL,EAAU3C,QAAQgD,IAAML,EAAU3C,QAAQgD,IAAM,IAAM9F,EAAOA,EAClE+F,OAAQ,KACRC,cAWJ,SAA+BD,KACvBA,GAAYA,aAAkB,QAEjBb,IAAYa,IAE7B,EAAAlD,MAAA,yBAA+B8C,EAAcI,GAAUA,EAAOxD,UAAYwD,EAAOxD,SAASgC,UAC1FW,EAAaa,EACbE,EAAWF,MAjBX,sBAEI,IAAIG,GAAsB,IAAAzE,OAAM,yBAAN,CAAgCgE,GAGtDU,GAAgB,IAAA1E,OAAM,0BAAN,CAAiCgE,GACrD,OAAOS,GAAuBC,IAGtC,EAAAtD,MAAA,iBAAuB,UAAW8C,GAUlCzD,EAASC,KAAK,UAAW,CAAEW,QAAS6C,IACpCM,IACA,IAAIG,EAAa9E,EAAM+E,eAAeV,GA2BtC,SAASM,EAAWF,GAChB,IAAIO,EAAWhJ,EAAMiJ,OACjBC,EAAYjF,EAAGkF,QAASC,EAAYnF,EAAGkF,QACvCE,EAAc,CACdrE,KAAMyD,EACNjD,QAAS6C,GAETiB,EAAc,CACdC,WAAYL,EAAUvI,QACtB6I,WAAYJ,EAAUzI,QACtB8I,YAAaL,GAcjBJ,EAASU,MAAM,sBAAuBhH,GACtC,IAAIiH,EAASnC,EAAYwB,GAAU,SAAUY,GACzCA,EAAM/E,KAAK,cAAeyE,GAC1BM,EAAM/E,KAAK,UAAWwE,GACtBtB,EAAe6B,EAAOhF,GAAU,WAC5BsE,EAAUW,UACNlC,GACAA,EAAa+B,MAAM,gCAClB,IAAAI,WAAUhC,KAAmBA,GAAkB9H,EAAMzB,MAAMuJ,KAC5DhB,EAAc8C,MAvD9B,WAWI,GAVInC,IACA,EAAAlC,MAAA,iBAAuB,yBAA0BkC,EAAW5C,KAAK,YACjE4C,EAAWsC,SACXtC,EAAa,MAEbE,IACA,EAAApC,MAAA,iBAAuB,mBAAoB8C,GAC3CV,EAAaqC,WACbrC,EAAe,MAEfD,EAAW,CACX,IAAIuC,EAAcvC,EAAU7C,KAAK,eACjC,EAAAU,MAAA,iBAAuB,cAAe0E,GACtClC,EAAeL,GAAW,WACtBuC,EAAYR,YAAYI,UACxBpC,EAAa,QAEjBA,EAAaC,EACbA,EAAY,MAuCZwC,MAEJxC,EAAYiC,GACZhC,EAAeqB,GAWFU,MAAM,qBAAsBjB,GAAUb,GACnDD,EAAapJ,MAAMsJ,GA7EvB7H,EAAMP,IAAI,YAAY,WAClB,EAAA8F,MAAA,iBAAuB,2BAA4B8C,GACnDS,UAgFhB,OAAO/I,IAGf6D,EAAmBuG,QAAU,CAAC,WAAY,cAAe,eAAgB,QAAS,MAiElF,IAAIC,EAAuE,mBAA7C,YAAe,aAAwB,UAEjEC,EAAe,EAEnB,SAAStE,EAA4B9B,EAAIF,EAAc8B,EAAoB1H,EAAQ4G,KAE3E,IAAAuF,YAAWzE,EAAmB0E,WAC3BxF,EAAIE,SAASgB,WAAalB,EAAIE,SAASuF,oBAAsBJ,GAChEvE,EAAmB0E,UAEvB,IAAIE,GAAY,IAAAC,MAAK3F,EAAIM,MAAMsF,MAAMC,KACjCC,EAAc,CAAErK,KAAMqF,GAE1B,IAAI,IAAAyE,YAAWzE,EAAmBiF,mBAAoB,CAClD,IACIC,EADiB,IAAI,EAAAzF,eAAeP,EAAIM,MACH2F,cAAc,gBAAgBnG,KAyBvE1G,EAAOsB,IAAI,WAAYsE,EAAakH,UAAU,IAvB1B,SAAUC,GAG1B,GAAIA,IAAiBH,IAAsE,IAA/CG,EAAaC,UAAUC,QAAQX,GAA3E,CAEA,IAAIY,EAAWH,EAAaI,OAAO,MAC/BC,EAAaL,EAAaI,OAAO,QACjCE,EAAgB,SAAUC,GAAQ,OAAOA,EAAKC,aAC9CC,EAAWT,EAAaU,YAAY,MAAMC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAC7EC,EAAad,EAAaU,YAAY,QAAQC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAEjFE,EAAkBN,EAASnF,QAAO,SAAU0F,GAC5C,IAAIC,EAAMH,EAAWZ,QAAQc,GAC7B,OAAgB,IAATC,IAAeH,EAAWG,GAAKC,KAAKC,OAAOhB,EAASa,EAAM3D,IAAKgD,EAAWW,EAAM3D,QAG3F,GAAI0D,EAAgBK,OAAQ,CACxB,IAAIC,EAAgBN,EAAgBJ,KAAI,SAAUW,GAAK,OAAOA,EAAEjE,MAE5DkE,GAAY,IAAAjG,QAAO6E,GAAU,SAAUnK,EAAK6B,GAAO,OAAuC,IAAhCwJ,EAAcnB,QAAQrI,MACpF8C,EAAmBiF,kBAAkB2B,EAAWvB,OAGSL,IAGrE,IAAI,IAAAP,YAAWzE,EAAmB6G,WAAY,CAC1C,IAAIC,EAAOtC,IACPuC,EAAc,gBAEdC,EAAqB,SAAUC,GAC/B,QAASA,IAAWA,EAAMF,KAA6C,IAA7BE,EAAMF,GAAaD,IAAmBE,EAAmBC,EAAMC,oBAYzGC,EAAW,CAAE7B,QAASV,EAAU/H,MACpCvE,EAAOsB,IAAI,WAAYsE,EAAakJ,SAASD,GAV3B,SAAUF,GACxB,IAAInM,EACAuM,EAAOJ,EAAMF,GAAeE,EAAMF,IAAgB,GAKtD,OAJKC,EAAmBC,KACpBnM,EAAUsD,EAAGkJ,KAAKtH,EAAmB6G,UAAUI,KACvC7E,MAAK,SAAU/G,GAAO,OAAQgM,EAAIP,IAAgB,IAARzL,KAE/CP,IAGyDkK,KAG5E,YAAe,mBAAmB9K,UAAU,SAAU4D,GACtD,YAAe,mBAAmB5D,UAAU,SAAU6D,sWC9ZlDwJ,EAAiC,WACjC,SAASA,IACL,IAAIC,EAAQnQ,KACGA,KAAKoQ,SAAWvQ,EAAQ,GAAR,cAAwB,EACxCG,KAAKU,KAAO,CACvB,QACA,iBACA,YACA,SAAU2P,EAAOC,EAAgBC,GAI7B,OAHAJ,EAAMK,iBAAmBD,EAAUE,KAAOF,EAAUE,IAAI,qBAAuBF,EAAUG,IAAI,oBAC7FP,EAAME,MAAQA,EACdF,EAAMG,eAAiBA,EAChBH,IAyJnB,OApJAD,EAAgBrO,UAAU8O,eAAiB,SAAUnM,GACjDxE,KAAKoQ,SAAW5L,GAepB0L,EAAgBrO,UAAU+O,WAAa,SAAUrF,EAAQ6C,EAAQyC,GAC7D,IACIC,EAAa,SAAUxK,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGC,SAAUD,OAC3GE,EAAc,SAAU5K,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGjI,UAAWiI,OACjH,OAAO,IAAApE,WAAUrB,EAAO0F,UAClBH,EAAW9Q,KAAKmR,WAAW5F,EAAO0F,SAAU7C,KAC5C,IAAAxB,WAAUrB,EAAO6F,aACbN,EAAW9Q,KAAKqR,QAAQ9F,EAAO6F,YAAahD,KAC5C,IAAAxB,WAAUrB,EAAO+F,kBACbR,EAAW9Q,KAAKuR,aAAahG,EAAO+F,iBAAkBlD,EAAQyC,KAC9D,IAAAjE,WAAUrB,EAAOxC,WACbmI,EAAY3F,EAAOxC,YACnB,IAAA6D,WAAUrB,EAAO+B,mBACb4D,EAAYlR,KAAKwR,sBAAsBjG,EAAO+B,kBAAmBc,EAAQyC,IACzEC,EAbA,wBAwB1BZ,EAAgBrO,UAAUsP,WAAa,SAAUF,EAAU7C,GACvD,OAAO,IAAAhB,YAAW6D,GAAYA,EAAS7C,GAAU6C,GAWrDf,EAAgBrO,UAAUwP,QAAU,SAAUI,EAAKrD,GAG/C,OAFI,IAAAhB,YAAWqE,KACXA,EAAMA,EAAIrD,IACH,MAAPqD,EACO,KACPzR,KAAKoQ,SACEpQ,KAAKqQ,MACPK,IAAIe,EAAK,CAAEC,MAAO1R,KAAKsQ,eAAgBqB,QAAS,CAAEC,OAAQ,eAC1D7G,MAAK,SAAU8G,GAChB,OAAOA,EAASlK,QAGjB3H,KAAKwQ,iBAAiBiB,IAUjCvB,EAAgBrO,UAAU0P,aAAe,SAAUxR,EAAUqO,EAAQyC,GACjE,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAS1BX,EAAgBrO,UAAU2P,sBAAwB,SAAUzR,EAAUqO,EAAQyC,GAC1E,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAgB1BX,EAAgBrO,UAAUqQ,sBAAwB,SAAUzL,EAAQoK,EAAS9H,EAAWoJ,GACpFA,EAAWA,GAAY,GAEvB,IAAIC,EAASvS,EAAQ,GAAR,eAAyB,EAAI,KAAO,GAE7CwS,EAAQ,SAAUC,GAClB,IAAIC,GAAU,IAAAtJ,aAAYqJ,GAC1B,MAAO,aAAa7I,KAAK8I,GAAW,KAAOA,EAAUA,GA6BrDvP,EAQZ,SAA8BwC,GAC1B,IAAIgN,EAAU,EAAAzB,SAAA,cAAuBvL,EAAO,aAC5C,IAAKgN,IAAYA,EAAQpD,OACrB,MAAM,IAAIqD,MAAM,mCAAqCjN,EAAO,KAChE,OAAOgN,EAAQ7D,IAAI+D,GAAa9D,OAAO,EAAAC,QAAS,IAZhC8D,CAAqB5J,GAAW4F,KA3BzB,SAAUiE,GACzB,IAAIpN,EAAOoN,EAAMpN,KAAM0J,EAAO0D,EAAM1D,KAChC2D,EAAWR,EAAM7M,GAIrB,GAAIiB,EAAOqM,KAAKD,KAAcV,EAAS3M,GACnC,OAAOqN,EAAW,KAAOpM,EAAOqM,KAAKD,GAAY,IACrD,IAAIE,EAAcZ,EAAS3M,IAASA,EAGpC,GAAa,MAAT0J,EACA,OAAO2D,EAAW,OAAST,EAAS,YAAcW,EAAc,MAIpE,GAAa,MAAT7D,EAAc,CACd,IAAI8D,EAAMnC,EAAQ/C,cAAciF,GAC5BpS,EAAKqS,GAAOA,EAAIrL,KAChBhG,EAAQhB,GAAM,EAAAoQ,SAAA,mBAA4BpQ,IAAQ,GAGtD,OAAOkS,EAAW,cAAgBE,IADhB,IAAAf,SAAQrR,GAAM,KAAOA,EAAGyO,OAAS,GAAK,IAAM,IACA,IAAMzN,EAAKsR,KAAK,KAAO,KAGzF,OAAOJ,EAAW,KAAOT,EAAS,YAAcW,EAAc,OAEJE,KAAK,KAC/DjK,EAAYqJ,EAAMtJ,GACtB,MAAO,IAAMC,EAAY,IAAMhG,EAAQ,MAAQgG,EAAY,KAExDkH,EArKyB,GAiLhCwC,EAAc,SAAUQ,GACxB,OAAI,IAAAC,UAASD,EAAIE,kBACNC,EAAcH,EAAIE,kBACtBC,EAAcH,EAAIpQ,QAIzBuQ,EAAgB,SAAUC,GAC1B,OAAOC,OAAOC,KAAKF,GAAe,IAE7B3E,KAAI,SAAU9I,GAAO,MAAO,CAACA,EAAK,oBAAoB4D,KAAK6J,EAAYzN,QAEvEyD,QAAO,SAAUmK,GAAS,OAAO,IAAA7G,WAAU6G,KAAU,IAAAzB,SAAQyB,EAAM,OAEnE9E,KAAI,SAAU8E,GAAS,MAAO,CAAGjO,KAAMiO,EAAM,GAAG,IAAMA,EAAM,GAAIvE,KAAMuE,EAAM,GAAG,2ECzL7EC,EAAsB,SAAUC,GACvC,OAAO,SAA0BC,GAC7B,IAAIC,EAAOD,EAAYD,GACnBG,EAAwB,WAAbH,EAAwB,OAAS,KAOhD,OAAOE,EANP,SAA0BjE,EAAOnC,GAC7B,IACIsG,EADiB,IAAI,EAAA3L,eAAewH,EAAMlB,YAAYoF,IAC1BC,WAAWtG,EAAMuG,WAC7CtL,GAAS,IAAA5H,QAAOmT,EAAUF,GAAa,CAAEG,QAASzG,EAAOO,aAAc4B,IAC3E,OAAO,EAAAmB,SAAA,iBAA0B8C,EAAM7T,KAAM0I,SAEhByL,ICfrCC,EAAqC,WACrC,SAASA,EAAoBC,GAEzBrU,KAAKsU,cAAgB,GACrBtU,KAAKqU,kBAAoBA,EACzB,IAAIE,GAAM,IAAAvQ,KAAIqQ,IACd,IAAAG,sBAAqBD,EAAKvU,KAAMuU,EAAK,CAAC,eA8D1C,OAhDAH,EAAoBK,6BAA+B,SAAUC,GACzD,IAAIC,EAAWD,EAAOE,kBAAkB1F,KAAK,QAC7CyF,EAASE,OAAS,SAAUvF,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,WAAW,SAAUC,GAAK,MAAQ,CAAE,IAAK,KAAM,IAAK,OAAQA,MAAU1F,GAElHqF,EAASM,OAAS,SAAU3F,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,aAAa,SAAUC,GAAK,MAAQ,CAAE,KAAM,IAAK,MAAO,KAAMA,MAAU1F,IAIxH8E,EAAoBvS,UAAUqT,QAAU,aACxCd,EAAoBvS,UAAUsT,SAAW,SAAU3U,GAC/C,IAAI2P,EAAQnQ,KAEZ,OADAA,KAAKsU,cAAc7T,KAAKD,GACjB,WAAc,OAAO,IAAA4U,YAAWjF,EAAMmE,cAAjB,CAAgC9T,KAEhE4T,EAAoBvS,UAAUwT,UAAY,WACtC,IAAIA,EAAYrV,KAAKqU,kBAAkBgB,YAEvC,OADAA,GAAY,IAAAlC,UAASkC,GAAaA,EAAUC,QAAUD,IAClCrV,KAAKuV,SAASC,SAEtCpB,EAAoBvS,UAAU4T,SAAW,WACrC,OAAOzV,KAAK0V,YAAc1V,KAAK0V,UAAY1V,KAAK2V,SAASF,YAAczV,KAAK4V,QAAQC,SAAS/B,WAEjGM,EAAoBvS,UAAU4P,IAAM,SAAUqE,EAAQf,EAAStH,GAQ3D,YAPgB,IAAZsH,IAAsBA,GAAU,IAChC,IAAAnI,WAAUkJ,IACV9V,KAAK+V,UAAUtE,IAAIqE,GACnBf,GACA/U,KAAK+V,UAAUhB,UACftH,GACAzN,KAAK+V,UAAUtI,MAAMA,GAClBzN,KAAK+V,UAAUtE,OAE1B2C,EAAoBvS,UAAUmU,iBAAmB,SAAUC,EAAYF,EAAWR,EAAUI,EAAUC,GAClG,IAAIzF,EAAQnQ,KACZA,KAAK+V,UAAYA,EACjB/V,KAAKuV,SAAWA,EAChBvV,KAAK2V,SAAWA,EAChB3V,KAAK4V,QAAUA,EAEfK,EAAW1T,IAAI,0BAA0B,SAAU2T,GAAO,OAAO/F,EAAMmE,cAAcvT,SAAQ,SAAUJ,GAAM,OAAOA,EAAGuV,SACvH,IAAIC,GAAO,IAAAnS,KAAI+R,IAEf,IAAAvB,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,UAAW,OAAQ,SAAU,UAErE,IAAA3B,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,OAAQ,WAAY,UAEzD/B,EApE6B,0ECaxCvU,EAAQ,GAAR,OAAe,qBAAsB,IACrC,IAAIuW,EAAWvW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,OAC7CwW,EAAWxW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,mBAC7CyW,EAAUzW,EAAQ,GAAR,OAAe,mBAAoB,CAAC,mBAC9C0W,EAAY1W,EAAQ,GAAR,OAAe,kBAAmB,CAAC,mBAAoB,iBAAkB,uBACrF2W,EAAW3W,EAAQ,GAAR,OAAe,YAAa,CAAC,iBAAkB,kBAAmB,uBAE7E6U,GADW7U,EAAQ,GAAR,OAAe,mBAAoB,CAAC,cACtC,MAGb,SAAS4W,EAAkBpC,IAEvBK,EAAS1U,KAAK0U,OAAS,IAAI,EAAAgC,UACpBC,cAAgB,IAAI,IAAcjC,EAAOkC,cAAelC,EAAOmC,cAEtEnC,EAAOkC,cAAcE,UAAU,QAAS,MACxCpC,EAAOkC,cAAcE,UAAU,SAAUpD,EAAoB,WAC7DgB,EAAOkC,cAAcE,UAAU,WAAYpD,EAAoB,aAC/DgB,EAAOkC,cAAcE,UAAU,UAAWpD,EAAoB,YAC9DgB,EAAOqC,YAAY/M,WAAWgN,mBAAmB,OAAO,WAExDtC,EAAOuC,WAAW1L,OAAO2L,eAAgB,EACzC,IAAIC,EAAsBzC,EAAO0C,gBAAkB1C,EAAO2C,eAAiB,IAAIjD,EAAoBC,GAMnG,SAAS3T,EAAKqV,EAAWJ,EAAUC,EAASL,EAAUU,EAAY5F,EAAOC,GAIrE,OAHA6G,EAAmBnB,iBAAiBC,EAAYF,EAAWR,EAAUI,EAAUC,UACxElB,EAAe,cACfA,EAAa,KACbA,EAEX,OAXAN,EAAoBK,6BAA6BC,GAEjDA,EAAe,OAAIA,EACnBA,EAAa,KAAIhU,EACjBA,EAAKuM,QAAU,CAAC,YAAa,WAAY,UAAW,WAAY,aAAc,QAAS,kBAOhFyH,EA1BX+B,EAAkBxJ,QAAU,CAAC,qBA4B7B,IAAIqK,EAAiB,SAAUC,GAAe,MAAO,CACjD,oBACA,SAAUC,GACN,IAAIC,EAAUD,EAAK9C,OAAO6C,GAE1B,OADAE,EAAc,KAAI,WAAc,OAAOA,GAChCA,KAKf,SAASC,EAASnH,EAAWxJ,EAAI4Q,GAI7B,GAHA,EAAA5G,SAAA,UAAqBR,EACrB,EAAAQ,SAAA,GAAchK,GAETwM,OAAO1R,UAAUa,eAAeX,KAAKwO,EAAW,YACjD,IACIA,EAAUqH,QAAO,SAAUC,OAE/B,MAAOxS,GACHkL,EAAUuH,WAAa,cAAcrO,KAAKpE,GAASA,EAAMyP,YAKjE6C,EAAUf,cACLlG,MACA/B,KAAI,SAAUW,GAAK,OAAOA,EAAE0E,UAAU+D,eACtCnJ,OAAO,EAAAC,QAAS,IAChBvF,QAAO,SAAUgG,GAAK,MAAkB,aAAXA,EAAEwC,QAC/B/Q,SAAQ,SAAUiX,GAAc,OAAQA,EAAWlG,KAAOvB,EAAU0H,SAASD,EAAWE,UAAW3H,EAAUuH,aAQ/G,SAASK,EAAalC,GACzBA,EAAW1R,QAAO,WACd,EAAA8D,MAAA,wBA9BRqP,EAASzK,QAAU,CAAC,YAAa,KAAM,aA2BvCkL,EAAalL,QAAU,CAAC,cAMxBmJ,EAASrW,SAAS,YAAa0W,GAC/BH,EAAQvW,SAAS,aAAc,CAAC,oBAXL,SAAUqY,GAAY,OAAQA,EAASC,kBAAoB,IAAI,IAAkBD,MAY5G/B,EAAStW,SAAS,cAAeuX,EAAe,eAChDjB,EAAStW,SAAS,qBAAsB,CAAC,oBAAqB,WAAc,OAAO2U,EAAOE,qBAC1FyB,EAAStW,SAAS,oBAAoB,WAAc,OAAO,IAAImQ,KAC/DqG,EAAUxW,SAAS,iBAAkBuX,EAAe,kBACpDf,EAAUxW,SAAS,mBAAoBuX,EAAe,YACtDf,EAAUxW,SAAS,eAAgBuX,EAAe,sBAClDf,EAAUxW,SAAS,SAAU,CAAC,oBAfP,WAAc,OAAO,IAAAe,QAAO4T,EAAOiC,cAAe,CAAEjW,KAAM,WAAc,OAAOgU,EAAOmC,mBAgB7GN,EAAUrW,QAAQ,eAAgB,CAAC,YAAa,SAAUyX,GAAa,OAAOA,EAAUW,QAAQlK,UAChGoI,EAAStW,QAAQ,SAAS,WAAc,OAAOwU,EAAOqC,eACtDP,EAASiB,QAAQ,UAAU,WAAc,OAAO,EAAApP,SAChDmO,EAAS+B,IAAIJ,GACb9B,EAASkC,IAAI,CAAC,qBAAsB,SAAUC,OAC9CjC,EAAUgC,IAAI,CAAC,SAAU,SAAUE,OACnCnC,EAAQiC,IAAI,CAAC,aAAc,SAAUG,OACrCtC,EAASmC,IAAIb,GAEN,IAAIzD,EAAY,SAAU0E,GAO7B,OANaA,EAAIC,YAAYtP,OAAO,EAAAR,UAChB6F,KAAI,SAAU9I,GAC9B,IAAImS,EAAaW,EAAI7K,cAAcjI,GAEnC,MAAO,CAACA,EAAoB,WADX8S,EAAIE,UAAUb,GAAYc,MACJd,EAAWvU,QAAUuU,EAAWrQ,SAE7DiH,OAAO,EAAAmK,WAAY,2JC9GrC,SAASC,EAAeP,GACpB,IAAIQ,EAAW,SAAUxL,EAAOW,EAAQjO,GACpC,OAAOsY,EAAOS,GAAGzL,EAAOW,EAAQjO,IAGpC,OADA8Y,EAASE,WAAY,EACdF,EAaX,SAASG,EAAuBX,GAC5B,IAAIY,EAAiB,SAAU5L,EAAOW,EAAQjO,GAC1C,OAAOsY,EAAOa,SAAS7L,EAAOW,EAAQjO,IAG1C,OADAkZ,EAAeF,WAAY,EACpBE,EAxBXL,EAAe/L,QAAU,CAAC,UAkB1BmM,EAAuBnM,QAAU,CAAC,UAQlC,YAAe,mBAAmB3D,OAAO,UAAW0P,GAAgB1P,OAAO,kBAAmB8P,oKCpB1FG,EAA+B,WAC/B,SAASA,EAAc3C,EAAeC,GAClC7W,KAAK4W,cAAgBA,EACrB5W,KAAK6W,aAAeA,GACpB,IAAArC,uBAAqB,IAAAxQ,KAAIuV,EAAc1X,WAAY7B,MAAM,IAAAgE,KAAIhE,OAgHjE,OArBAuZ,EAAc1X,UAAUiV,UAAY,SAAUtR,EAAMgU,GAChD,OAAOxZ,KAAK4W,cAAcE,UAAUtR,EAAMgU,IAASxZ,MAEvDuZ,EAAc1X,UAAU4L,MAAQ,SAAUjI,EAAMiU,GAQ5C,OAPI,IAAAtG,UAAS3N,GACTiU,EAAajU,EAGbiU,EAAWjU,KAAOA,EAEtBxF,KAAK4W,cAAc8C,SAASD,GACrBzZ,MAOXuZ,EAAc1X,UAAU8X,UAAY,SAAUnZ,GAC1C,OAAOR,KAAK6W,aAAa8C,UAAUnZ,IAEhC+Y,EApHuB,6LCf3B,SAASK,IACZ,IAAIC,EAAkB,KACtB,OAAO,SAAU1R,EAAM2R,GAEnB,OADAD,EAAkBA,GAAmB,EAAA9I,SAAA,cAAuB,oBACrD,CAAC,IAAIgJ,EAAc5R,EAAM2R,EAAMD,KAI9C,IAAIG,EAAY,SAAUxG,EAAMyG,GAAO,OAAOzG,EAAK5E,QAAO,SAAUsL,EAAKrU,GAAO,OAAOqU,IAAO,IAAAtN,WAAUqN,EAAIpU,OAAU,IAY/G,SAASsU,EAAgB1M,GAE5B,IAAKA,EAAM2M,OACP,MAAO,GACX,IAAgKC,EAAW,CAAC,YAAa,WAAY,qBAAsBC,EAA7M,CAAC,mBAAoB,cAAe,WAAY,SAAU,SAAyKlY,OAApJ,CAAC,aAAc,qBAAsB,eAAgB,cAAiHmY,EAAcF,EAASjY,OAAOkY,GAIjS,IAAI,IAAA1N,WAAUa,EAAM+M,QAAUR,EAAUO,EAAa9M,GACjD,MAAM,IAAIgF,MAAM,UAAYhF,EAAMjI,KAAlB,4JAGL+U,EAAYjR,QAAO,SAAUzD,GAAO,OAAO,IAAA+G,WAAUa,EAAM5H,OAAUoN,KAAK,OAEzF,IAAIuH,EAAQ,GAAIC,EAAchN,EAAM+M,OAAS,CAAEE,UAAU,IAAAC,MAAKlN,EAAO8M,IAsBrE,OArBA,IAAAxZ,SAAQ0Z,GAAa,SAAUlP,EAAQ/F,GASnC,GAPAA,EAAOA,GAAQ,YAEX,IAAAsD,UAASyC,KACTA,EAAS,CAAExC,UAAWwC,IAE1BA,GAAS,IAAAzK,QAAO,GAAIyK,GAEhByO,EAAUK,EAAU9O,IAAWyO,EAAUM,EAAa/O,GACtD,MAAM,IAAIkH,MAAM,mBAAqB4H,EAASpH,KAAK,KAAO,UAAYqH,EAAYrH,KAAK,KAAO,mBAAqBzN,EAAO,IAAMiI,EAAMjI,KAAO,KAEjJ+F,EAAO9C,UAAY8C,EAAO9C,WAAa,WACvC8C,EAAOH,MAAQ,MACfG,EAAOxB,SAAW0D,EAClBlC,EAAOqP,MAAQpV,EACf,IAAIqV,EAAa,EAAAC,YAAA,sBAAkCvP,EAAOxB,SAAUwB,EAAOqP,OAC3ErP,EAAOwP,YAAcF,EAAWG,WAChCzP,EAAO0P,qBAAuBJ,EAAWK,oBACzCV,EAAMhV,GAAQ+F,KAEXiP,EAGX,IAAInP,EAAK,EAEL0O,EAA+B,WAC/B,SAASA,EAAc5R,EAAMJ,EAAU7H,GACnC,IAAIiQ,EAAQnQ,KACZA,KAAKmI,KAAOA,EACZnI,KAAK+H,SAAWA,EAChB/H,KAAKE,QAAUA,EACfF,KAAKmb,IAAM9P,IACXrL,KAAKob,QAAS,EACdpb,KAAKgI,YAAc,SAAUvB,EAAQoK,GACjC,OAAOV,EAAMpH,UACPoH,EAAMjQ,QAAQgS,sBAAsBzL,EAAQoK,EAASV,EAAMpH,UAAWoH,EAAMpI,SAASoK,UACrFhC,EAAMc,UAiCpB,OA9BA8I,EAAclY,UAAUwZ,KAAO,WAC3B,IAAIlL,EAAQnQ,KACR+G,EAAK,EAAAgK,SAAA,GACLF,EAAU,IAAI,EAAAzI,eAAepI,KAAKmI,MAClCiG,EAASpO,KAAKmI,KAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,IAAAzN,QAAOoZ,EAAK3L,EAAK+M,eAAiB,IAC1FC,EAAW,CACXtK,SAAUlK,EAAGkJ,KAAKjQ,KAAKE,QAAQ0Q,WAAW5Q,KAAK+H,SAAUqG,EAAQyC,IACjE7P,WAAY+F,EAAGkJ,KAAKjQ,KAAKwb,cAAc3K,KAE3C,OAAO9J,EAAG0U,IAAIF,GAAUxQ,MAAK,SAAU2Q,GAInC,OAHA,EAAArT,MAAA,sBAA4B,SAAU8H,GACtCA,EAAMnP,WAAa0a,EAAQ1a,YAC3B,IAAAF,QAAOqP,EAAOuL,EAAQzK,UACfd,MAQf4J,EAAclY,UAAU2Z,cAAgB,SAAU3K,GAC9C,IAAI9Q,EAAWC,KAAK+H,SAAS4T,mBAC7B,KAAK,IAAAC,cAAa7b,GACd,OAAOC,KAAK+H,SAAS/G,WACzB,IAAI8Q,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAEnBkJ,EA5CuB,wKC9C9B8B,EAAmC,WAEnC,SAASA,EAAiCnH,GACtC1U,KAAK0U,OAASA,EA2KlB,OAzKAmH,EAAkBC,kBAAoB,SAAUpH,EAAQqH,GACpD,OAAO,SAAUC,GAAS,OAAO,EAAAjL,SAAA,iBAA0BgL,EAAS,KAAM,CAAEE,OAAQD,EAAOE,aAAcxH,EAAO4D,QAAQlK,WAG5HyN,EAAkBha,UAAUnB,KAAO,WAC/B,IAAIuW,EAAajX,KAAK0U,OAAOuC,WAI7B,OAHAjX,KAAK0U,OAAOyH,UAAUC,QAAO,GACxBnF,EAAWoF,mBACZpF,EAAWqF,SACRtc,KAAK0U,OAAOyH,WAiCvBN,EAAkBha,UAAU0a,KAAO,SAAUC,GACzC,IAAIrM,EAAQnQ,KACZ,KAAK,IAAAoN,YAAWoP,GACZ,MAAM,IAAI/J,MAAM,6BACpB,IACI8J,EAAO,IAAI,EAAAE,aADH,WAAc,OAAOD,EAAO,EAAAzL,SAAA,UAAoBZ,EAAMuE,OAAO0C,mBACvC,EAAAsF,UAElC,OADA1c,KAAK0U,OAAOuC,WAAW0F,MAAMJ,KAAKA,GAC3Bvc,MA4BX6b,EAAkBha,UAAU+a,UAAY,SAAUL,GAC9C,IAAIpM,EAAQnQ,KACR6c,EAAW7c,KAAK0U,OAAOuC,WAAW0F,MACtC,IAAI,IAAA7T,UAASyT,GACTM,EAASD,UAAUL,OAElB,MAAI,IAAAnP,YAAWmP,GAIhB,MAAM,IAAI9J,MAAM,uCAHhBoK,EAASD,WAAU,WAAc,OAAOL,EAAK,EAAAxL,SAAA,UAAoBZ,EAAMuE,OAAO0C,oBAKlF,OAAOpX,MAwCX6b,EAAkBha,UAAUoO,KAAO,SAAU6M,EAAMf,GAK/C,QAJI,IAAA/J,SAAQ+J,KAAY,IAAA3O,YAAW2O,MAC/BA,EAAUF,EAAkBC,kBAAkB9b,KAAK0U,OAAQqH,IAE/D/b,KAAK0U,OAAOuC,WAAW0F,MAAM1M,KAAK6M,EAAMf,GACjC/b,MAgCX6b,EAAkBha,UAAUkb,eAAiB,SAAU9Q,GACnDjM,KAAK0U,OAAOuC,WAAW8F,eAAe9Q,IAEnC4P,EA9K2B,iJCKtC,UAAe,mBAAmB9b,SAAS,iBApB3C,WACI,IAAIid,GAAkB,EACtBhd,KAAKgd,gBAAkB,WACnBA,GAAkB,GAEtBhd,KAAKU,KAAO,CACR,gBACA,WACA,SAAUuc,EAAezZ,GACrB,OAAIwZ,EACOC,EAEJ,SAAUvV,GACb,OAAOlE,GAAS,WACZkE,EAAS,GAAGwV,mBACb,GAAG,8nBClBlBC,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GAaAK,EAAwB,iBAATlQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC9C,iBAAX,EAAAmQ,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,QAC3D,EACAhe,EAAU+d,EAAK/d,SAAW,GACnBke,EAAWle,EAAQke,UAAYC,KAAK/W,MAAM3D,KAAK0a,MAC/CC,EAASpe,EAAQoe,QAAUD,KAAKE,UAAU5a,KAAK0a,MAC/Cjd,EAAUlB,EAAQkB,SAqc7B,SAAkBkZ,EAAKnP,EAAIqF,GACvB,IAAI,QAAQ8J,GACR,OAAOA,EAAIlZ,QAAQ+J,EAAIqF,GAC3BoD,OAAOC,KAAKyG,GAAKlZ,SAAQ,SAAU8E,GAAO,OAAOiF,EAAGmP,EAAIpU,GAAMA,OAvcvD/E,EAASyS,OAAO3Q,QAycpB,SAAiBub,GACpB,IAAK,IAAId,EAAI,EAAGA,EAAIrb,UAAUoN,OAAQiO,IAAK,CACvC,IAAIpD,EAAMjY,UAAUqb,GACpB,GAAKpD,EAGL,IADA,IAAIzG,EAAOD,OAAOC,KAAKyG,GACdyD,EAAI,EAAGA,EAAIlK,EAAKpE,OAAQsO,IAC7BS,EAAM3K,EAAKkK,IAAMzD,EAAIzG,EAAKkK,IAGlC,OAAOS,GAldAhP,EAAStP,EAAQsP,QAod5B,SAASiP,EAAQC,EAAIC,GACjB,GAAID,IAAOC,EACP,OAAO,EACX,GAAW,OAAPD,GAAsB,OAAPC,EACf,OAAO,EACX,GAAID,GAAOA,GAAMC,GAAOA,EACpB,OAAO,EACX,IAAIC,SAAYF,EAChB,GAAIE,WAD4BD,GACR,WAAPC,EACb,OAAO,EACX,IAyBeC,EAAIC,EAzBfC,EAAM,CAACL,EAAIC,GACf,IAAI,QAAI,KAAJ,CAAaI,GACb,OAuBeD,EAvBMH,GAuBVE,EAvBMH,GAwBdjP,SAAWqP,EAAGrP,QAEduP,EAAYH,EAAIC,GAAI7P,QAAO,SAAUgQ,EAAGC,GAAK,OAAOD,GAAKR,EAAQS,EAAE,GAAIA,EAAE,OAAQ,GAzBxF,IAAI,QAAI,KAAJ,CAAYH,GACZ,OAAOL,EAAGS,YAAcR,EAAGQ,UAC/B,IAAI,QAAI,KAAJ,CAAcJ,GACd,OAAOL,EAAGvJ,aAAewJ,EAAGxJ,WAChC,IAAI,QAAI,KAAJ,CAAgB4J,GAChB,OAAO,EAEX,GADiB,CAAC,KAAY,KAAS,KAAQ,MAChC/P,IAAI,MAAKC,QAAO,SAAUgQ,EAAGje,GAAM,OAAOie,KAAOje,EAAG+d,MAAS,GACxE,OAAO,EACX,IAAIlL,EAAO,GAEX,IAAK,IAAI3N,KAAOwY,EAAI,CAChB,IAAKD,EAAQC,EAAGxY,GAAMyY,EAAGzY,IACrB,OAAO,EACX2N,EAAK3N,IAAO,EAEhB,IAAK,IAAIA,KAAOyY,EACZ,IAAK9K,EAAK3N,GACN,OAAO,EAEf,OAAO,GApfJ,SAAS6W,EAASpN,GACrB,OAAOA,EAEJ,SAASrH,KAyDT,SAASuM,EAAqBuK,EAAQ1Y,EAAQ/C,EAAM0b,EAASC,QAC/C,IAAbA,IAAuBA,GAAW,GACtC,IAAIC,EAAe,SAAUC,GAAU,OAAOJ,IAASI,GAAQ7b,KAAKA,MAQpE,OADA0b,EAAUA,GAAWzL,OAAOC,KAAKuL,MAClBnQ,QAAO,SAAUsL,EAAK1U,GAPd,IAAU2Z,EAS7B,OADAjF,EAAI1U,GAAQyZ,GARiBE,EAQW3Z,EAPjC,WAEH,OADAa,EAAO8Y,GAAUD,EAAaC,GACvB9Y,EAAO8Y,GAAQhd,MAAM,KAAMH,aAKUkd,EAAa1Z,GACtD0U,IACR7T,GAMA,IAAI+Y,EAAU,SAAUhF,EAAQiF,GAAS,OAAOve,EAAOyS,OAAO/R,OAAO4Y,GAASiF,IAE1EC,GAAU,SACd,SAAkBC,EAAOtF,GAC5B,OAA+B,IAAxBsF,EAAMrR,QAAQ+L,MAMd7E,GAAa,SACjB,SAAqBmK,EAAOtF,GAC/B,IAAIhL,EAAMsQ,EAAMrR,QAAQ+L,GAGxB,OAFIhL,GAAO,GACPsQ,EAAMC,OAAOvQ,EAAK,GACfsQ,KAGAE,GAAS,SACb,SAAiBC,EAAK1b,GACzB,OAAO0b,EAAIjf,KAAKuD,GAAMA,KAGf2b,EAAW,SAAUC,GAC5B,OAAOA,EAAU9d,QAAQf,SAAQ,SAAUJ,GACzB,mBAAPA,GAAqBA,IAC5ByU,EAAWwK,EAAWjf,OAQvB,SAASV,EAASW,GAErB,IADA,IAAIif,EAAe,GACVC,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCD,EAAaC,EAAK,GAAK9d,UAAU8d,GAErC,IAAIC,EAAcjf,EAAOqB,WAAM,EAAQgb,EAAe,CAAC,IAAK0C,EAAaG,YACzE,OAAOlf,EAAOif,EAAapF,EAAK/Z,GAAQ,GAAI2S,OAAOC,KAAKuM,KAGrD,IAAIE,EAAS,SAAUC,EAAMC,GAAQ,OAAOrf,EAAOof,EAAMC,IAQzD,SAASC,EAAUC,EAAOC,GAC7B,IAAInY,EAAO,GAEX,IAAK,IAAIoY,KAAKF,EAAMlY,KAAM,CACtB,GAAIkY,EAAMlY,KAAKoY,KAAOD,EAAOnY,KAAKoY,GAC9B,MACJpY,EAAK1H,KAAK4f,EAAMlY,KAAKoY,IAEzB,OAAOpY,EAaJ,SAASwS,EAAKV,EAAKuG,GACtB,IAAIC,EAAU,GACd,IAAK,IAAIC,KAASzG,GACoB,IAA9BuG,EAAUtS,QAAQwS,KAClBD,EAAQC,GAASzG,EAAIyG,IAG7B,OAAOD,EAcJ,SAASE,EAAK1G,EAAKuG,GACtB,OAAOjN,OAAOC,KAAKyG,GACd3Q,QAAO,QAAIgW,EAAQkB,KACnB5R,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,GAAOoU,EAAIpU,GAAOqU,IAAS,IASvE,SAAS5Q,EAAOsX,EAAYpgB,GAC/B,IAAIkf,GAAM,QAAQkB,GAAata,EAASoZ,EAAM,GAAK,GAC/CmB,EAASnB,EAAM,SAAUpQ,GAAK,OAAOhJ,EAAO7F,KAAK6O,IAAQ,SAAUA,EAAGzJ,GAAO,OAAQS,EAAOT,GAAOyJ,GAKvG,OAJAvO,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B7c,EAAS2f,EAAM9C,IACfwD,EAAOV,EAAM9C,MAEd/W,EAGJ,SAASwa,EAAKF,EAAYpgB,GAC7B,IAAI8F,EAOJ,OANAvF,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B/W,GAEA9F,EAAS2f,EAAM9C,KACf/W,EAAS6Z,MAEV7Z,EAGJ,IAAIya,EAASpS,EAEb,SAASA,EAAIiS,EAAYpgB,EAAU6F,GAGtC,OAFAA,EAASA,KAAW,QAAQua,GAAc,GAAK,IAC/C7f,EAAQ6f,GAAY,SAAUT,EAAM9C,GAAK,OAAQhX,EAAOgX,GAAK7c,EAAS2f,EAAM9C,MACrEhX,EAYJ,IAAI2a,EAAS,SAAU/G,GAAO,OAAO1G,OAAOC,KAAKyG,GAAKtL,KAAI,SAAU9I,GAAO,OAAOoU,EAAIpU,OAclFob,EAAW,SAAUf,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAclDC,EAAW,SAAUjB,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAUlDrS,EAAU,SAAUqR,EAAMgB,GAAQ,OAAOhB,EAAK9d,OAAO8e,IAWrDE,EAAW,SAAUlB,EAAMgB,GAClC,OAAO,QAAQA,GAAQhB,EAAK9d,OAAO8e,EAAKtS,OAAOwS,EAAU,KAAOC,EAAMnB,EAAMgB,IAMzE,SAASG,EAAM3B,EAAKzF,GAEvB,OADAyF,EAAIjf,KAAKwZ,GACFyF,EAGJ,IAAI4B,EAAQ,SAAUpH,EAAKqH,GAAS,OAAQjC,EAAQpF,EAAKqH,GAASrH,EAAMmH,EAAMnH,EAAKqH,IAW/EC,EAAS,SAAU9B,GAAO,OAAOA,EAAI9Q,OAAOC,EAAS,KAyBrD4S,EAkBJ,SAAkBC,EAAgBC,GAErC,YADe,IAAXA,IAAqBA,EAAS,kBAC3B,SAAU1H,GACb,IAAI3T,EAASob,EAAezH,GAC5B,IAAK3T,EACD,MAAM,IAAImM,OAAM,QAAWkP,GAAUA,EAAO1H,GAAO0H,GAEvD,OAAOrb,IA2BR,SAASqY,IAEZ,IADA,IAAIhd,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,GAAoB,IAAhBne,EAAKyN,OACL,MAAO,GAwBX,IAvBA,IAAIwS,EAAcjgB,EAAKiN,QAAO,SAAUiT,EAAKnC,GAAO,OAAOoC,KAAKD,IAAInC,EAAItQ,OAAQyS,KAAS,kBACrFvb,EAAS,GACTyb,EAAU,SAAU1E,GAGpB,OAAQ1b,EAAKyN,QACT,KAAK,EACD9I,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,KACrB,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACjC,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KAC7C,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACzD,MACJ,QACI/W,EAAO7F,KAAKkB,EAAKgN,KAAI,SAAU4Q,GAAS,OAAOA,EAAMlC,SAIxDA,EAAI,EAAGA,EAAIuE,EAAavE,IAC7B0E,EAAQ1E,GAEZ,OAAO/W,EAsBJ,SAASyS,EAAWmH,EAAM8B,GAC7B,IAAInc,EAAKrB,EAGT,IAFI,QAAQwd,KACRnc,EAAMmc,EAAY,GAAIxd,EAAQwd,EAAY,MACzC,QAASnc,GACV,MAAM,IAAI4M,MAAM,oCAEpB,OADAyN,EAAKra,GAAOrB,EACL0b,EAGJ,SAAS1S,EAAKkS,GACjB,OAAQA,EAAItQ,QAAUsQ,EAAIA,EAAItQ,OAAS,SAAO+E,EAK3C,SAAS8N,EAAKC,EAAKC,GAKtB,OAJIA,GACA5O,OAAOC,KAAK2O,GAAMphB,SAAQ,SAAU8E,GAAO,cAAcsc,EAAKtc,MAC7Dsc,IACDA,EAAO,IACJrhB,EAAOqhB,EAAMD,GA6DjB,IAAIE,EAA2B,SAAU3e,GAAW,OAAOA,EAAQ4e,OAAM,SAAUC,GAAK,OAAO,MAAS7e,GACpG8e,EAAkB,SAAUld,GAAS,OAAO+c,EAAyB,cAAmB/c,qHCxhBnG,IAGWmd,EAAW,SAAU/K,EAASgL,GACrC,OAAOA,EAAQ7T,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,IAJtC6c,EAIoDjL,EAAU,IAAM5R,EAAM,KAJzD,WACpC,MAAM,IAAI4M,MAAM,yBAA2BiQ,EAAS,kEAGiDxI,EAJ5F,IAAUwI,IAI2F,KAE9G3R,EAAW,CACXhK,QAAIoN,EACJ5D,eAAW4D,mGCyCf,IAAIwO,EAAsB,WACtB,SAASA,EAAKC,GACV5iB,KAAK4iB,KAAOA,EACZ5iB,KAAK6iB,KAAOD,EAAKE,MAAM,KACvB,IAAIC,EAAe/iB,KAAK4iB,KACnBE,MAAM,KACNnU,KAAI,SAAUqU,GACf,MAAY,OAARA,EACO,qBACC,MAARA,EACO,WACJ,MAAQA,KAEd/P,KAAK,IACVjT,KAAKijB,OAAS,IAAI9Z,OAAO,IAAM4Z,EAAe,KAalD,OAVAJ,EAAKzJ,GAAK,SAAU0J,GAChB,QAAS,SAASnZ,KAAKmZ,IAG3BD,EAAKxR,WAAa,SAAUyR,GACxB,OAAOD,EAAKzJ,GAAG0J,GAAQ,IAAID,EAAKC,GAAQ,MAE5CD,EAAK9gB,UAAUqhB,QAAU,SAAU1d,GAC/B,OAAOxF,KAAKijB,OAAOE,KAAK,IAAM3d,IAE3Bmd,EA3Bc,+MC1CzB,IAAIxF,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GA2CJ,SAAS6F,EAAMziB,GAClB,OAAO,SAAS0iB,IACZ,GAAIrhB,UAAUoN,QAAUzO,EAAGyO,OACvB,OAAOzO,EAAGwB,MAAMnC,KAAMgC,WAE1B,IAAIL,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtC,OAAOqhB,EAAQ/f,KAAKnB,MAAMkhB,EAASlG,EAAe,CAACnd,MAAO2B,KAS3D,SAAS2hB,IACZ,IAAI3hB,EAAOK,UACPuhB,EAAQ5hB,EAAKyN,OAAS,EAC1B,OAAO,WAEH,IADA,IAAIiO,EAAIkG,EAAOjd,EAAS3E,EAAK4hB,GAAOphB,MAAMnC,KAAMgC,WACzCqb,KACH/W,EAAS3E,EAAK0b,GAAGtb,KAAK/B,KAAMsG,GAChC,OAAOA,GASR,SAASkd,IAEZ,IADA,IAAIC,EAAQ,GACH3D,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpC2D,EAAM3D,GAAM9d,UAAU8d,GAE1B,OAAOwD,EAAQnhB,MAAM,KAAM,GAAGL,MAAMC,KAAKC,WAAWge,WAQjD,IAAI0D,EAAO,SAAUle,GAAQ,OAAO,SAAUyU,GAAO,OAAOA,GAAOA,EAAIzU,KAQnEme,EAASP,GAAM,SAAU5d,EAAMoe,EAAM3J,GAAO,OAAOA,GAAOA,EAAIzU,KAAUoe,KASxE3c,EAAQ,SAAUzB,GAAQ,OAAOge,EAAKrhB,MAAM,KAAMqD,EAAKsd,MAAM,KAAKnU,IAAI+U,KAKtEG,EAAM,SAAUljB,GAAM,OAAO,WAEpC,IADA,IAAIgB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAQnf,EAAGwB,MAAM,KAAMR,KAMpB,SAASmiB,EAAIC,EAAKC,GACrB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IAOjD,SAASsiB,EAAGF,EAAKC,GACpB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IASjD,IAAI8Z,EAAM,SAAUsI,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4U,EAAM,SAAUH,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4J,EAAK,SAAUiL,GAAQ,OAAO,SAAUlK,GAC/C,OAAe,MAAPA,GAAeA,EAAImK,cAAgBD,GAASlK,aAAekK,IAK5DngB,EAAM,SAAUqgB,GAAK,OAAO,WAAc,OAAOA,IA4CrD,SAASC,EAAQC,GACpB,OAAO,SAAUjV,GACb,IAAK,IAAI+N,EAAI,EAAGA,EAAIkH,EAAOnV,OAAQiO,IAC/B,GAAIkH,EAAOlH,GAAG,GAAG/N,GACb,OAAOiV,EAAOlH,GAAG,GAAG/N,uRCjNhCkV,EAAQjR,OAAO1R,UAAUiT,SACzB2P,EAAM,SAAU5F,GAAK,OAAO,SAAUvP,GAAK,cAAcA,IAAMuP,IACxD6F,EAAcD,EAAI,aAClB7X,GAAY,QAAI8X,GAChBC,EAAS,SAAUC,GAAK,OAAa,OAANA,GAC/BC,GAAoB,IAAAZ,IAAGU,EAAQD,GAC/BtX,EAAaqX,EAAI,YACjBK,EAAWL,EAAI,UACf3b,EAAW2b,EAAI,UACftR,EAAW,SAAU7D,GAAK,OAAa,OAANA,GAA2B,iBAANA,GACtD0C,EAAUpQ,MAAMoQ,QAChB+S,EAAS,SAAWzV,GAAK,MAAyB,kBAAlBkV,EAAMziB,KAAKuN,IAC3C0V,EAAW,SAAW1V,GAAK,MAAyB,oBAAlBkV,EAAMziB,KAAKuN,IAOjD,SAASsM,EAAa5X,GACzB,GAAIgO,EAAQhO,IAAQA,EAAIoL,OAAQ,CAC5B,IAAI6V,EAAOjhB,EAAIlC,MAAM,GAAI,GAAI0L,EAAOxJ,EAAIlC,OAAO,GAC/C,QAASmjB,EAAK3b,QAAO,QAAIR,IAAWsG,QAAU5B,EAAKlE,QAAO,QAAI8D,IAAagC,QAE/E,OAAOhC,EAAWpJ,GAOf,IAAIkhB,GAAY,QAAI/R,GAAU,SAAK,QAAK,QAAS/F,uKCvCpD+X,EAAuB,WACvB,SAASA,EAAMC,EAAQC,QACJ,IAAXD,IAAqBA,EAAS,SACnB,IAAXC,IAAqBA,EAAS,MAClCrlB,KAAKolB,OAASA,EACdplB,KAAKqlB,OAASA,EACdrlB,KAAKslB,gBAAkB,GACvBtlB,KAAKulB,SAAU,QAAOvlB,KAAKslB,iBAqC/B,OAnCAH,EAAMtjB,UAAU2jB,QAAU,SAAUrF,GAChC,IAAIsF,EAAQzlB,KAAKolB,OAIjB,OAHAK,EAAMhlB,KAAK0f,GACPngB,KAAKqlB,QAAUI,EAAMrW,OAASpP,KAAKqlB,QACnCrlB,KAAK0lB,QACFvF,GAEXgF,EAAMtjB,UAAU6jB,MAAQ,WACpB,IAAIvF,EAAOngB,KAAKolB,OAAOnjB,QAEvB,OADAjC,KAAKslB,gBAAgBvkB,SAAQ,SAAUJ,GAAM,OAAOA,EAAGwf,MAChDA,GAEXgF,EAAMtjB,UAAU8jB,QAAU,WACtB,GAAI3lB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO5F,OAAO,EAAG,GAAG,IAExC2F,EAAMtjB,UAAUgkB,MAAQ,WACpB,IAAIC,EAAU9lB,KAAKolB,OAEnB,OADAplB,KAAKolB,OAAS,GACPU,GAEXX,EAAMtjB,UAAU+jB,KAAO,WACnB,OAAO5lB,KAAKolB,OAAOhW,QAEvB+V,EAAMtjB,UAAUgL,OAAS,SAAUsT,GAC/B,IAAIlR,EAAMjP,KAAKolB,OAAOlX,QAAQiS,GAC9B,OAAOlR,GAAO,GAAKjP,KAAKolB,OAAO5F,OAAOvQ,EAAK,GAAG,IAElDkW,EAAMtjB,UAAUkkB,SAAW,WACvB,OAAO/lB,KAAKolB,OAAOplB,KAAKolB,OAAOhW,OAAS,IAE5C+V,EAAMtjB,UAAUmkB,SAAW,WACvB,GAAIhmB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO,IAEpBD,EA5Ce,4KCKtBc,EAAkB,CAAEC,IAAK,KAAM7gB,MAAO,KAAM8gB,MAAO,MA4B5CC,EAXyB,oBAAbC,UAA4BA,SAASC,cAA0C,IAA1BD,SAASC,aAEtEC,QAAUA,OAAOC,QAlBhC,SAAoBA,GAChB,IAAIC,EAAQ,SAAU9lB,GAAM,OAAO+lB,SAAS7kB,UAAUyB,KAAKvB,KAAKpB,EAAI6lB,IACpE,MAAO,CACHN,IAAKO,EAAMD,EAAQN,KACnB7gB,MAAOohB,EAAMD,EAAQN,KACrBC,MAAOM,EAAMD,EAAQN,MAaaS,CAAWJ,OAAOC,SAAWP,EAEzDO,QAAQL,OAAUK,QAAQnhB,MAIzBmhB,QAhBf,SAAyBA,GACrB,IAAIN,EAAMM,EAAQN,IAAI5iB,KAAKkjB,GAG3B,MAAO,CAAEN,IAAKA,EAAK7gB,MAFPmhB,EAAQnhB,MAAQmhB,EAAQnhB,MAAM/B,KAAKkjB,GAAWN,EAEzBC,MADrBK,EAAQL,MAAQK,EAAQL,MAAM7iB,KAAKkjB,GAAWN,GAU/CU,CAAgBJ,ieCRxB,SAASK,EAAUC,EAAK9V,GAC3B,OAAIA,EAAI5B,QAAU0X,EACP9V,EACJA,EAAI+V,OAAO,EAAGD,EAAM,GAAK,MAW7B,SAASE,EAAU5X,EAAQ4B,GAC9B,KAAOA,EAAI5B,OAASA,GAChB4B,GAAO,IACX,OAAOA,EAEJ,SAAS/H,EAAYqJ,GACxB,OAAOA,EACFyC,QAAQ,YAAY,SAAUkS,GAAM,OAAOA,EAAGC,iBAC9CnS,QAAQ,YAAY,SAAUkS,GAAM,MAAO,IAAMA,EAAGC,iBAEtD,SAASC,EAAiBxmB,GAC7B,IAAIymB,EAAQC,EAAW1mB,GACnB2mB,EAAqBF,EAAMpL,MAAM,8BACjCwI,EAAQ8C,EAAqBA,EAAmB,GAAKF,EACrDjI,EAASxe,EAAS,MAAK,GAC3B,OAAIwe,GAAUqF,EAAMxI,MAAM,eACf,YAAcmD,EAASqF,EAAMuC,OAAO,GAExCvC,EAEJ,SAAS6C,EAAW1mB,GACvB,IAAI4mB,GAAM,QAAQ5mB,GAAMA,EAAGmB,OAAO,GAAG,GAAKnB,EAC1C,OAAQ4mB,GAAOA,EAAIzS,YAAe,YAEtC,IAAI0S,EAAc,uBAIdC,GAAmB,QAAQ,CAC3B,CAAC,MAAa,QAAI,cAClB,CAAC,MAAQ,QAAI,SACb,CAAC,MAAW,QAAI,cAChB,CAACD,EAAa,SAAUlY,GAAK,OAAOA,EAAEoY,qBAAqB5S,aAC3D,CARc,SAAUmF,GACxB,OAAO,QAASA,MAAS,QAAQA,IAAQA,EAAImK,cAAgB7Q,SAAU,QAAW0G,EAAInF,WAOxE,SAAUxF,GAAK,OAAOA,EAAEwF,aACtC,CAAC,KAAcqS,GACf,EAAC,SAAI,GAAO,QAET,SAASjJ,EAAU0G,GACtB,IAAI+C,EAAO,GACX,SAASC,EAAOpjB,GACZ,IAAI,QAASA,GAAQ,CACjB,IAA6B,IAAzBmjB,EAAKzZ,QAAQ1J,GACb,MAAO,iBACXmjB,EAAKlnB,KAAK+D,GAEd,OAAOijB,EAAiBjjB,GAE5B,OAAI,QAAYogB,GAILgD,EAAOhD,GAEX5G,KAAKE,UAAU0G,GAAG,SAAU/e,EAAKrB,GAAS,OAAOojB,EAAOpjB,MAAWuQ,QAAQ,OAAQ,KAGvF,IAAI8S,EAAoB,SAAUC,GAAQ,OAAO,SAAU9W,GAC9D,IAAKA,EACD,MAAO,CAAC,GAAI,IAChB,IAAI/B,EAAM+B,EAAI9C,QAAQ4Z,GACtB,OAAa,IAAT7Y,EACO,CAAC+B,EAAK,IACV,CAACA,EAAI+V,OAAO,EAAG9X,GAAM+B,EAAI+V,OAAO9X,EAAM,MAGtC8Y,EAAuB,SAAU/W,GAAO,OAAOA,EAAI+D,QAAQ,WAAY,KACvEiT,EAAYH,EAAkB,KAC9BI,EAAaJ,EAAkB,KAC/BK,EAAaL,EAAkB,KAC/BM,EAAc,SAAUnX,GAAO,OAAQA,EAAMA,EAAI+D,QAAQ,KAAM,IAAM,IAWzE,SAASqT,EAAaC,GACzB,IAAIC,EAAK,IAAInf,OAAO,IAAMkf,EAAQ,IAAK,KACvC,OAAO,SAAUrX,GAAO,OAAOA,EAAI8R,MAAMwF,GAAIhf,OAAO,OAcjD,SAASif,EAAerO,EAAK5K,GAChC,OAAI,SAAS,QAAK4K,MAAS,QAAS5K,GACzB4K,EAAIpY,MAAM,GAAI,GAAGM,QAAO,QAAK8X,GAAO5K,IACxC,QAAM4K,EAAK5K,0GCpElBkZ,iQA3BJ,SAASC,EAAaC,GAClB,IAAKA,EACD,MAAO,oBACX,IAAIjb,EAAQib,EAAOC,gBAAkBD,EAAOC,gBAAgBnjB,MAAQ,SAAW,SAC/E,MAAO,YAAckjB,EAAOrd,GAAK,IAAMqd,EAAOtd,MAAQ,IAAMsd,EAAOpd,IAAM,KAAOod,EAAOljB,KAAO,IAAMiI,EAAQ,KAOhH,SAASmb,EAAchW,GACnB,OAAO,QAASA,GAAS4V,EAAS5V,GAAS4V,EAASA,EAAS5V,KAgBjE,SAAW4V,GACPA,EAASA,EAAkB,QAAI,GAAK,UACpCA,EAASA,EAAqB,WAAI,GAAK,aACvCA,EAASA,EAAe,KAAI,GAAK,OACjCA,EAASA,EAAiB,OAAI,GAAK,SACnCA,EAASA,EAAqB,WAAI,GAAK,aAL3C,CAMGA,IAAaA,EAAW,KAE3B,IAAIK,GAAO,QAAM,OACbC,GAAO,QAAM,cACbC,EAAW,SAAUnZ,GAAS,MAAO,eAAiBiZ,EAAKjZ,GAAS,IAAMkZ,EAAKlZ,IA6J/EvH,EAAQ,IAzJe,WAEvB,SAAS2gB,IAELhpB,KAAKipB,SAAW,GAChBjpB,KAAKkpB,mBAAqB,EAwI9B,OArIAF,EAAMnnB,UAAUsnB,KAAO,SAAU7T,EAAS8T,GACtC,IAAIjZ,EAAQnQ,KACPopB,EAAWha,SACZga,EAAa7V,OAAOC,KAAKgV,GACpB7Z,KAAI,SAAU6O,GAAK,OAAO6L,SAAS7L,EAAG,OACtClU,QAAO,SAAUkU,GAAK,OAAQ8L,MAAM9L,MACpC7O,KAAI,SAAU9I,GAAO,OAAO2iB,EAAS3iB,OAE9CujB,EAAWza,IAAIia,GAAe7nB,SAAQ,SAAUwoB,GAAY,OAAQpZ,EAAM8Y,SAASM,GAAYjU,MAEnG0T,EAAMnnB,UAAU2nB,OAAS,WAErB,IADA,IAAIJ,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAMC,IAEpBJ,EAAMnnB,UAAU4nB,QAAU,WAEtB,IADA,IAAIL,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAOC,IAWrBJ,EAAMnnB,UAAUyT,QAAU,SAAUiU,GAChC,QAASvpB,KAAKipB,SAASL,EAAcW,KAGzCP,EAAMnnB,UAAU6nB,qBAAuB,SAAU9Z,GACxC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAU+nB,uBAAyB,SAAUha,GAC1C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAUgoB,oBAAsB,SAAUC,EAAMla,EAAOzP,GACzD,GAAKH,KAAKsV,QAAQkT,EAASuB,MAA3B,CAEA,IAAIxpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAiBskB,EAAKE,eAAexpB,UAC1N,QAAgBuoB,EAASnZ,GAAS,eAAiBrP,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,MAG9GwjB,EAAMnnB,UAAUooB,gBAAkB,SAAUC,EAAYta,EAAOua,GACtDnqB,KAAKsV,QAAQkT,EAASuB,OAE3B,QAAgBhB,EAASnZ,GAAS,0BAA2B,QAAU,KAAK,QAAUsa,MAG1FlB,EAAMnnB,UAAUuoB,iBAAmB,SAAUjiB,EAAM8H,EAAML,GAChD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,uBAAyBzH,EAAO,KAAO8H,EAAO,MAGpF+Y,EAAMnnB,UAAUyoB,wBAA0B,SAAUtS,EAAYpI,GACvD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,gCAAkCoI,EAAa,SAAU,QAAU,KAAK,QAAUA,EAAWrQ,SAGnIqhB,EAAMnnB,UAAU0oB,WAAa,SAAUC,EAAQ5a,GACtC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,aAAe4a,IAG3FxB,EAAMnnB,UAAU4oB,aAAe,SAAUC,EAAY9a,GAC5C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,kBAAoB8a,EAAWllB,OAG3GwjB,EAAMnnB,UAAU8oB,iBAAmB,SAAUpqB,EAAOqqB,EAAUvL,QAC5C,IAAVA,IAAoBA,EAAQ,IAC3Brf,KAAKsV,QAAQkT,EAASqC,SAE3B,QAAgB,aAAc,QAAU,GAAItqB,GAAS,IAAMkoB,EAAamC,GAAYvL,IAGxF2J,EAAMnnB,UAAUipB,yBAA2B,SAAUF,EAAU/Z,GACtD7Q,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,WAAYC,EAAU,kCAAoC/Z,EAAU,MAG9FmY,EAAMnnB,UAAUkpB,gBAAkB,SAAUH,EAAUpjB,GAC7CxH,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,OAAQC,EAAU,WAAY,QAAU,IAAKpjB,KAGvEwhB,EAAMnnB,UAAUmpB,cAAgB,SAAUC,GACtC,GAAKjrB,KAAKsV,QAAQkT,EAAS0C,YAA3B,CAEA,IAAIC,EAAY,uBAEZC,EAAUH,EACTtc,KAAI,SAAU0c,GACf,IAAIC,EACA7kB,EAAS4kB,EAAG5kB,OAAQiE,EAAa2gB,EAAG3gB,WACpC6gB,EAAM9kB,GAAUA,EAAO6E,IACvBzD,EAAM6C,GAAcA,EAAW3C,SAASgC,SAASvE,KAAO,MAAQkF,EAAW3C,SAAS6S,MAAQ,IAChG,OAAO0Q,EAAK,IAAOH,GAAaI,EAAKD,EAPzB,iCAOyCzjB,EAAKyjB,KAEzDE,MAAK,SAAU/N,EAAGmB,GAAK,OAAQnB,EAAE0N,IAAc,IAAIM,cAAc7M,EAAEuM,IAAc,OACtF,UAAkBC,KAGtBpC,EAAMnnB,UAAU6pB,sBAAwB,SAAUnrB,EAAOmK,GAChD1K,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAzK1B,SAAUmK,GAC7B,IAAIoP,EAAOpP,EAAW3C,SAClB0F,EAAQqM,EAAK/P,SAASvE,MAAQ,SAClC,MAAO,SAAWkF,EAAWyQ,IAAM,UAAY1N,EAAQ,8BAAgCqM,EAAKiB,YAAc,IAAMjB,EAAKmB,qBAAuB,IAsKzF0Q,CAAiBjhB,KAGpEse,EAAMnnB,UAAU+pB,4BAA8B,SAAUrrB,EAAOqqB,GACtD5qB,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAAMkoB,EAAamC,KAEzD5B,EA7Ie,oOCxEtB6C,EAAiC,WACjC,SAASA,IAML7rB,KAAKoO,OAAS,IAAI,IAElBpO,KAAK8rB,yBAA2B,EAEhC9rB,KAAK+rB,kBAAoB,IAAI,IAAM,GAAI,GAEvC/rB,KAAKgsB,sBAAwB,IAAI,IAAM,GAAI,GAO/C,OALAH,EAAgBhqB,UAAUqT,QAAU,WAChClV,KAAK+rB,kBAAkBlG,QACvB7lB,KAAKgsB,sBAAsBnG,QAC3B7lB,KAAKisB,WAAa,MAEfJ,EApByB,sLCiBhCK,EAAe,SAAUD,GACzB,IAAIvX,EAASuX,EAAWvX,OAuBpB6G,EAAW0Q,EACVE,WACA7iB,QAAO,SAAUmE,GAAS,QAASA,EAAMuG,UAAUoY,YACnDzd,KAAI,SAAUlB,GAAS,OAAO4e,EAAcJ,EAAYxe,MAC7D,OAAO,WAAgB8N,GAAUxQ,MA1BjC,WACI,GAAyD,QAArDkhB,EAAWK,qBAAqBnsB,UAAU4e,OAAkB,CAG5D,IAAIwN,EAAON,EAAWO,cACtB,OAAO9X,EAAOmC,aAAaxQ,OAAOkmB,EAAKE,aAAcF,EAAKne,SAAUme,EAAKpsB,WAI7E,IAAIusB,EAAOhY,EAAOuC,WACd3Q,EAASomB,EAAK1Q,MAAM0Q,EAAKC,SACzBpQ,EAAOjW,GAAUA,EAAOiW,KAG5B,GAAIA,GAAsB,UAAdA,EAAKrN,KAAkB,CAC/B,IAAIzB,EAAQ8O,EAAK9O,MACbW,EAAS9H,EAAO0V,MACpB,OAAOtH,EAAOmC,aAAaxQ,OAAOoH,EAAOW,EAAQ6d,EAAW9rB,WAGhEuU,EAAOuC,WAAW2V,WAQfC,EAAuB,SAAUC,GACxC,OAAOA,EAAkB/c,SAAS,CAAEoc,SAAU,SAAU1e,GAAS,QAASA,EAAM2e,WAAeF,IAS5F,SAASG,EAAcJ,EAAYxe,GACtC,IAAIsf,EAAatf,EAAMuG,UAAUoY,SAE7B3oB,EAAUspB,EAAqB,SAwBnC,OAvBKtpB,IAWDA,EAAUspB,EAAqB,SAAI,YACzBA,EAAWd,EAAYxe,IAC5B1C,MAIT,SAA6BzE,GAIzB,OAHIA,GAAU1E,MAAMoQ,QAAQ1L,EAAO0mB,SAC/B1mB,EAAO0mB,OAAOjsB,SAAQ,SAAUksB,GAAU,OAAOhB,EAAWvX,OAAOkC,cAAc8C,SAASuT,MAEvF3mB,KAPFyE,MAbS,SAAUzE,GAIpB,cAHOmH,EAAM2e,gBACN3e,EAAMuG,UAAUoY,gBAChBW,EAAqB,SACrBzmB,KAEC,SAAU4mB,GAElB,cADOH,EAAqB,SACrB,cAAmBG,OAc3BzpB,oPCnFP0pB,kUAJAC,EAAS7Z,OAAO1R,UAAUa,gBAK9B,SAAWyqB,GACPA,EAAQA,EAAc,KAAI,GAAK,OAC/BA,EAAQA,EAAgB,OAAI,GAAK,SACjCA,EAAQA,EAAgB,OAAI,GAAK,SAHrC,CAIGA,IAAYA,EAAU,KA2DzB,IAAIE,EAAuB,WACvB,SAASA,EAAMhiB,EAAI6D,EAAM2G,EAAUyX,EAAW7f,GAC1C,IAAIlC,EA3DZ,SAA6BgiB,EAAW1X,EAAUpI,GAC9C,IAAI+f,GAA6C,IAAzB/f,EAAMggB,gBAA4B5X,IAAasX,EAAQO,aAAWvZ,EACtFwZ,GAAU,QAAK,CAAClgB,EAAMkgB,QAASH,GAAmB,MAClDI,GAAgB,QAAUD,GAAW,CAAEA,QAASA,GAAY,GAC5DE,EAGR,SAAyBhmB,GAGrB,SAASimB,IACL,OAAOjmB,EAAIrD,MAHfqD,EAlBc,SAAUA,GACxB,OAAiG,IAA1F,CAAC,QAAS,OAAQ,SAAU,QAAS,WAAWyB,OAAO8jB,EAAO9pB,KAAKuE,GAAO,KAAKuH,OAiBhF2e,CAAYlmB,GAAO,CAAErD,MAAOqD,GAAQA,EAC1CimB,EAAmC,aAAI,EAIvC,IAAIE,GAAO,QAAanmB,EAAIrD,OAASqD,EAAIrD,MAAQspB,EACjD,OAAO,QAAOjmB,EAAK,CAAEmmB,KAAMA,IAVTC,CAAgBxgB,GAASA,EAAMW,QAAUX,EAAMW,OAAOmf,IACxE,OAAO,QAAOK,EAAeC,GAsDZK,CAAoB7iB,EAAIwK,EAAUpI,GAC/CyB,EA5CR,SAAiBrH,EAAKsmB,EAAStY,EAAUxK,EAAI+iB,GACzC,GAAIvmB,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,KAC/B,MAAM,IAAIiN,MAAM,UAAYpH,EAAK,kCACrC,GAAIxD,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,MAAqB4oB,EAAWlf,KAAKrH,EAAIqH,MACxE,OAAOkf,EAAWlf,KAAKrH,EAAIqH,MAC/B,GAAIif,EACA,OAAOA,EACX,IAAKtmB,EAAIqH,KAAM,CACX,IAAIA,EAAO2G,IAAasX,EAAQkB,OAC1B,MACAxY,IAAasX,EAAQmB,KACjB,OACAzY,IAAasX,EAAQO,OACjB,QACA,SACd,OAAOU,EAAWlf,KAAKA,GAE3B,OAAOrH,EAAIqH,gBAAgB,IAAYrH,EAAIqH,KAAOkf,EAAWlf,KAAKrH,EAAIqH,MA2B3Dqf,CAAQhjB,EAAQ2D,EAAM2G,EAAUxK,EAAIiiB,EAAUc,YACrD,IAUQI,EACAC,EAXJC,GAUIF,EAAgB,CAAEjP,MAAO1J,IAAasX,EAAQO,QAAS,QACvDe,EAAyBpjB,EAAG2Q,MAAM,SAAW,CAAEuD,OAAO,GAAS,IAC5D,QAAOiP,EAAeC,EAAwBljB,GAAQgU,OAXjErQ,EAAOwf,EAAYxf,EAAKyf,SAASD,EAAW7Y,IAAasX,EAAQO,QAAUxe,EAC3E,IAAI0f,OAA8Bza,IAAjB5I,EAAO/G,OAAuBqR,IAAasX,EAAQO,OAChEC,GAAU,QAAUpiB,EAAOoiB,WAAapiB,EAAOoiB,UAAYze,EAAKye,QAChEkB,GAAM,QAAUtjB,EAAOsjB,OAAStjB,EAAOsjB,MAAQ3f,EAAK2f,IACpDC,EA9BZ,SAAyBvjB,EAAQqjB,EAAYG,GACzC,IAAID,EAASvjB,EAAOujB,OACpB,IAAKF,IAAyB,IAAXE,EACf,OAAO,EACX,KAAK,QAAUA,IAAqB,MAAVA,EACtB,OAAOC,EACX,IAAe,IAAXD,IAAmB,QAASA,GAC5B,OAAOA,EACX,MAAM,IAAIrc,MAAM,2BAA6Bqc,EAAS,uDAsBrCE,CAAgBzjB,EAAQqjB,EAAYtB,EAAU2B,uBACvDla,EArBZ,SAAoBxJ,EAAQmjB,EAAWE,EAAYE,GAC/C,IAAIC,EAAgB,CAChB,CAAEG,KAAM,GAAIC,GAAIP,GAAcF,OAAYva,EAAY,IACtD,CAAE+a,KAAM,KAAMC,GAAIP,GAAcF,OAAYva,EAAY,KAExDY,GAAU,QAAQxJ,EAAOwJ,SAAWxJ,EAAOwJ,QAAU,IACrD,QAAS+Z,IACT/Z,EAAQtU,KAAK,CAAEyuB,KAAMJ,EAAQK,QAAIhb,IACrC,IAAIib,GAAiB,QAAIra,GAAS,QAAK,SACvC,OAAO,QAAOga,GAAe,SAAU5O,GAAQ,OAA8C,IAAvCiP,EAAelhB,QAAQiS,EAAK+O,SAAiB9sB,OAAO2S,GAYxFsa,CAAW9jB,EAAQmjB,EAAWE,EAAYE,GACpD1P,GAAU,QAAU7T,EAAO6T,WAAa7T,EAAO6T,UAAYlQ,EAAKkQ,SAOpE,QAAOpf,KAAM,CAAEqL,GAAIA,EAAI6D,KAAMA,EAAM2G,SAAUA,EAAU+Y,WAAYA,EAAYjB,QAASA,EAASkB,IAAKA,EAAKC,OAAQA,EAAQ/Z,QAASA,EAASqK,QAASA,EAASG,MAAOmP,EAAWnjB,OAAQA,IAoG7L,OAlGA8hB,EAAMrM,OAAS,SAAU5S,EAAQ4S,QACd,IAAXA,IAAqBA,EAAS,IAElC,IADA,IAAI1F,EAAc,GACTwE,EAAK,EAAGwP,EAAWlhB,EAAQ0R,EAAKwP,EAASlgB,OAAQ0Q,IAAM,CAC5D,IAAI9Q,EAAQsgB,EAASxP,GACrBxE,EAAYtM,EAAM3D,IAAM2D,EAAMxK,MAAMwc,EAAOhS,EAAM3D,KAErD,OAAOiQ,GAaX+R,EAAMkC,QAAU,SAAUnhB,EAAQohB,EAASC,GAGvC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IAC7BrhB,EAAO9E,QAAO,SAAU0F,GAAS,OAAQA,EAAME,KAAKC,OAAOqgB,EAAQxgB,EAAM3D,IAAKokB,EAAQzgB,EAAM3D,SAWvGgiB,EAAMle,OAAS,SAAUf,EAAQohB,EAASC,GAGtC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IACsB,IAAnDpC,EAAMkC,QAAQnhB,EAAQohB,EAASC,GAASrgB,QAGnDie,EAAMqC,UAAY,SAAUthB,EAAQ4S,GAEhC,YADe,IAAXA,IAAqBA,EAAS,IAC3B5S,EAAOO,KAAI,SAAUK,GAAS,OAAOA,EAAM0gB,UAAU1O,EAAOhS,EAAM3D,QAASuD,OAAO,MAAU,IAEvGye,EAAMxrB,UAAU8tB,eAAiB,SAAUnrB,GACvC,OAAOxE,KAAK4uB,YAAc5uB,KAAKkP,KAAKC,OAAOnP,KAAKwE,QAASA,IAM7D6oB,EAAMxrB,UAAU2C,MAAQ,SAAUA,GAC9B,IAAI2L,EAAQnQ,KA0BZ,OADAwE,EAR2B,SAAUR,GACjC,IAAK,IAAI8b,EAAK,EAAGuL,EAAKlb,EAAM4E,QAAS+K,EAAKuL,EAAGjc,OAAQ0Q,IAAM,CACvD,IAAIrM,EAAQ4X,EAAGvL,GACf,GAAIrM,EAAMyb,OAASlrB,EACf,OAAOyP,EAAM0b,GAErB,OAAOnrB,EAEH4rB,CAAqBprB,IACtB,QAAYA,GAtBG,WAClB,GAAI2L,EAAM0f,mBACN,OAAO1f,EAAM0f,mBAAmBC,aACpC,IAAK,cACD,MAAM,IAAIrd,MAAM,+DACpB,IAAIqd,EAAe,qBAA0B3f,EAAM5E,OAAOyiB,MAC1D,GAAI8B,MAAAA,IAAwD3f,EAAMjB,KAAKgK,GAAG4W,GACtE,MAAM,IAAIrd,MAAM,kBAAoBqd,EAAe,oBAAsB3f,EAAM9E,GAAK,sCAAwC8E,EAAMjB,KAAK1J,KAAO,KAIlJ,OAHI2K,EAAM5E,OAAOyiB,KAAkB,cAC/B7d,EAAM0f,mBAAqB,CAAEC,aAAcA,IAExCA,EAWiBC,GAAoB/vB,KAAKkP,KAAK8gB,WAAWxrB,IAEzE6oB,EAAMxrB,UAAUouB,SAAW,WACvB,OAAOjwB,KAAK6V,WAAasX,EAAQO,QAErCL,EAAMxrB,UAAU6tB,UAAY,SAAUlrB,GAElC,KAAK,QAAYA,IAAoB,OAAVA,IAAmBxE,KAAK4uB,WAC/C,OAAO,EAEX,IAAI/T,EAAa7a,KAAKkP,KAAK8gB,WAAWxrB,GACtC,IAAKxE,KAAKkP,KAAKgK,GAAG2B,GACd,OAAO,EAEX,IAAIqV,EAAUlwB,KAAKkP,KAAK2F,OAAOgG,GAC/B,SAAS,QAASqV,KAAalwB,KAAKkP,KAAKoV,QAAQ7a,KAAKymB,KAE1D7C,EAAMxrB,UAAUiT,SAAW,WACvB,MAAO,UAAY9U,KAAKqL,GAAK,IAAMrL,KAAKkP,KAAO,aAAelP,KAAK8uB,OAAS,eAAiB9uB,KAAK4uB,WAAa,KAE5GvB,EAtHe,4OChDtB8C,EAA2B,WAM3B,SAASA,EAAUjd,GAEflT,KAAKskB,QAAU,KAEftkB,KAAKof,SAAU,GACf,QAAOpf,KAAMkT,GAgDjB,OA5CAid,EAAUtuB,UAAUqX,GAAK,SAAUlV,EAAK6B,GACpC,OAAO,GAGXsqB,EAAUtuB,UAAUgT,OAAS,SAAU7Q,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUoT,OAAS,SAAUjR,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUsN,OAAS,SAAUsO,EAAGmB,GAEtC,OAAOnB,GAAKmB,GAEhBuR,EAAUtuB,UAAUuuB,YAAc,WAC9B,IAAIC,EAAMrwB,KAAKskB,QAAQxP,WACvB,OAAOub,EAAItJ,OAAO,EAAGsJ,EAAIjhB,OAAS,IAEtC+gB,EAAUtuB,UAAUiT,SAAW,WAC3B,MAAO,cAAgB9U,KAAKwF,KAAO,KAGvC2qB,EAAUtuB,UAAUmuB,WAAa,SAAUhsB,GACvC,OAAOhE,KAAKkZ,GAAGlV,GAAOA,EAAMhE,KAAKiV,OAAOjR,IAY5CmsB,EAAUtuB,UAAU8sB,SAAW,SAAU2B,EAAML,GAC3C,IAAKK,EACD,OAAOtwB,KACX,GAAa,SAATswB,IAAoBL,EACpB,MAAM,IAAIxd,MAAM,kDACpB,OAAO,IAAI8d,EAAUvwB,KAAMswB,IAExBH,EA3DmB,GA+D9B,SAASI,EAAUrhB,EAAMohB,GACrB,IAAIngB,EAAQnQ,KAEZ,SAASwwB,EAAUxsB,GACf,OAAO,QAAQA,GAAOA,GAAM,QAAUA,GAAO,CAACA,GAAO,GAczD,SAASysB,EAAajwB,EAAUkwB,GAC5B,OAAO,SAAqB1sB,GACxB,IAAI,QAAQA,IAAuB,IAAfA,EAAIoL,OACpB,OAAOpL,EACX,IAAI0b,EAAM8Q,EAAUxsB,GAChBsC,GAAS,QAAIoZ,EAAKlf,GACtB,OAAyB,IAAlBkwB,EAAgF,KAAvD,QAAOpqB,GAAQ,SAAUgJ,GAAK,OAAQA,KAAMF,OAjBpF,SAAqBpL,GACjB,OAAQA,EAAIoL,QACR,KAAK,EACD,OACJ,KAAK,EACD,MAAgB,SAATkhB,EAAkBtsB,EAAI,GAAKA,EACtC,QACI,OAAOA,GAUgF2sB,CAAYrqB,IAI/G,SAASsqB,EAAmBpwB,GACxB,OAAO,SAAqBqwB,EAAMC,GAC9B,IAAIC,EAAOP,EAAUK,GAAOG,EAAQR,EAAUM,GAC9C,GAAIC,EAAK3hB,SAAW4hB,EAAM5hB,OACtB,OAAO,EACX,IAAK,IAAIiO,EAAI,EAAGA,EAAI0T,EAAK3hB,OAAQiO,IAC7B,IAAK7c,EAASuwB,EAAK1T,GAAI2T,EAAM3T,IACzB,OAAO,EAEf,OAAO,GAGf,CAAC,SAAU,SAAU,SAAU,cAActc,SAAQ,SAAUyE,GAC3D,IAAIyrB,EAAc/hB,EAAK1J,GAAMlC,KAAK4L,GAC9BgiB,EAAqB,WAAT1rB,EAAoBorB,EAAqBH,EACzDtgB,EAAM3K,GAAQ0rB,EAAUD,OAE5B,QAAOjxB,KAAM,CACT2tB,QAASze,EAAKye,QACdnoB,KAAM0J,EAAK1J,KACX8e,QAASpV,EAAKoV,QACdlF,QAASlQ,EAAKkQ,QACdyP,IAAK3f,EAAK2f,IACV3V,GAAIuX,EAAavhB,EAAKgK,GAAG5V,KAAK4L,IAAO,GACrCiiB,WAAYb,+GC5DZc,kUApDJC,EAA4B,WAC5B,SAASA,IACLrxB,KAAKwlB,SAAU,EACfxlB,KAAKsxB,UAAY,GACjBtxB,KAAKuxB,cAAe,QAAKF,EAAWxvB,UAAW,CAC3C,OACA,SACA,QACA,OACA,MACA,OACA,OACA,OACA,QAIJ7B,KAAK+D,OAAQ,SAAQ,QAAI/D,KAAKuxB,cADf,SAAU9X,EAAYjU,GAAQ,OAAO,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,OAClC,IA+B3D,OA7BA4X,EAAWxvB,UAAUqT,QAAU,WAC3BlV,KAAK+D,MAAQ,IAOjBstB,EAAWxvB,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpD,KAAK,QAAU/X,GACX,OAAOzZ,KAAK+D,MAAMyB,GACtB,GAAIxF,KAAK+D,MAAMrB,eAAe8C,GAC1B,MAAM,IAAIiN,MAAM,iBAAmBjN,EAAO,+BAO9C,OANAxF,KAAK+D,MAAMyB,GAAQ,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,IACpD+X,IACAxxB,KAAKsxB,UAAU7wB,KAAK,CAAE+E,KAAMA,EAAM0N,IAAKse,IAClCxxB,KAAKwlB,SACNxlB,KAAKyxB,mBAENzxB,MAEXqxB,EAAWxvB,UAAU4vB,gBAAkB,WACnC,KAAOzxB,KAAKsxB,UAAUliB,QAAQ,CAC1B,IAAIF,EAAOlP,KAAKsxB,UAAUrvB,QAC1B,GAAIiN,EAAKoV,QACL,MAAM,IAAI7R,MAAM,sDACpB,QAAOzS,KAAK+D,MAAMmL,EAAK1J,MAAO,qBAA0B0J,EAAKgE,QAG9Dme,EAhDoB,GAoDvBD,EAAkB,SAAUle,GAC5B,IAAIwe,EAAc,SAAU1tB,GAAO,OAAe,MAAPA,EAAcA,EAAI8Q,WAAa9Q,GACtE2tB,EAAkB,CAClB9c,OAAQ6c,EACRzc,OAAQyc,EACRxY,IAAI,IAAAA,IAAG0Y,QACPtN,QAAS,KAETnV,OAAQ,SAAUsO,EAAGmB,GAAK,OAAOnB,GAAKmB,IAE1C,OAAO,QAAO,GAAI+S,EAAiBze,KAGvC,QAAOme,EAAWxvB,UAAW,CACzB0D,OAAQ6rB,EAAgB,IACxBjpB,KAAMipB,EAAgB,CAClB9M,QAAS,UAEbuN,MAAOT,EAAgB,IACvBU,KAAMV,EAAgB,CAClBhS,SAAS,IAEb2S,IAAKX,EAAgB,CACjBnc,OAAQ,SAAUjR,GAAO,OAAOqlB,SAASrlB,EAAK,KAC9CkV,GAAI,SAAUlV,GACV,QAAQ,QAAkBA,IAAQhE,KAAKiV,OAAOjR,EAAI8Q,cAAgB9Q,GAEtEsgB,QAAS,UAEb0N,KAAMZ,EAAgB,CAClBvc,OAAQ,SAAU7Q,GAAO,OAAQA,EAAO,EAAM,GAC9CiR,OAAQ,SAAUjR,GAAO,OAA6B,IAAtBqlB,SAASrlB,EAAK,KAC9CkV,IAAI,IAAAA,IAAG+Y,SACP3N,QAAS,QAEb4N,KAAMd,EAAgB,CAClBvc,OAAQ,SAAU7Q,GACd,OAAQhE,KAAKkZ,GAAGlV,GAEV,CAACA,EAAImuB,eAAgB,KAAOnuB,EAAIouB,WAAa,IAAItwB,OAAO,IAAK,IAAMkC,EAAIquB,WAAWvwB,OAAO,IAAImR,KAAK,UADlGkB,GAGVc,OAAQ,SAAUjR,GACd,GAAIhE,KAAKkZ,GAAGlV,GACR,OAAOA,EACX,IAAIgY,EAAQhc,KAAKsyB,QAAQ7oB,KAAKzF,GAC9B,OAAOgY,EAAQ,IAAIuW,KAAKvW,EAAM,GAAIA,EAAM,GAAK,EAAGA,EAAM,SAAM7H,GAEhE+E,GAAI,SAAUlV,GAAO,OAAOA,aAAeuuB,OAASjJ,MAAMtlB,EAAIwuB,YAC9DrjB,OAAQ,SAAUsjB,EAAGlV,GACjB,MAAO,CAAC,cAAe,WAAY,WAAW3O,QAAO,SAAUsL,EAAKvZ,GAAM,OAAOuZ,GAAOuY,EAAE9xB,OAAU4c,EAAE5c,QAAU,IAEpH2jB,QAAS,0DACTgO,QAAS,0DAEbI,KAAMtB,EAAgB,CAClBvc,OAAQ,KACRI,OAAQ,KACRiE,IAAI,IAAAA,IAAG3F,QACPpE,OAAQ,KACRmV,QAAS,UAGbJ,IAAKkN,EAAgB,CACjBvc,OAAQ,KACRI,OAAQ,KACRiE,GAAI,WAAc,OAAO,GACzB/J,OAAQ,kLCjJhBwjB,EAA6B,WAC7B,SAASA,EAAYvkB,QACF,IAAXA,IAAqBA,EAAS,KAClC,QAAOpO,KAAMoO,GA4BjB,OAlBAukB,EAAY9wB,UAAU+wB,SAAW,SAAUC,EAAWC,EAAUC,GAC5D,IAAIC,EACAC,GAAU,QAAUH,EAAUC,GAAM9nB,EAAY,GAAIioB,EAAc,GACtE,IAAK,IAAI7V,KAAK4V,EACV,GAAKA,EAAQ5V,IAAO4V,EAAQ5V,GAAGjP,SAE/B4kB,EAAezf,OAAOC,KAAKyf,EAAQ5V,GAAGjP,SACpBgB,OAElB,IAAK,IAAIsO,KAAKsV,EACNE,EAAYhlB,QAAQ8kB,EAAatV,KAAO,IAE5CwV,EAAYzyB,KAAKuyB,EAAatV,IAC9BzS,EAAU+nB,EAAatV,IAAM1d,KAAKgzB,EAAatV,KAGvD,OAAO,QAAO,GAAIzS,EAAW4nB,IAE1BF,EA/BqB,+RCS5BQ,EAA0B,WAC1B,SAASA,EAASC,GACd,GAAIA,aAAuBD,EAAU,CACjC,IAAI5kB,EAAO6kB,EACXpzB,KAAKyN,MAAQc,EAAKd,MAClBzN,KAAKwO,YAAcD,EAAKC,YAAY1M,QACpC9B,KAAKsb,aAAc,QAAO,GAAI/M,EAAK+M,aACnCtb,KAAK+X,YAAcxJ,EAAKwJ,YAAYjW,QACpC9B,KAAKwa,MAAQjM,EAAKiM,OAASjM,EAAKiM,MAAM1Y,YAErC,CACD,IAAI2L,EAAQ2lB,EACZpzB,KAAKyN,MAAQA,EACbzN,KAAKwO,YAAcf,EAAM4lB,WAAW,CAAEjU,SAAS,IAC/Cpf,KAAKsb,YAAc,GACnBtb,KAAK+X,YAActK,EAAMsK,YAAYpJ,KAAI,SAAUqE,GAAO,OAAOA,EAAItG,YA+C7E,OA5CAymB,EAAStxB,UAAU6K,MAAQ,WACvB,OAAO,IAAIymB,EAASnzB,OAGxBmzB,EAAStxB,UAAUyxB,eAAiB,SAAUllB,GAG1C,OADApO,KAAKsb,YAActb,KAAKwO,YAAYI,QAAO,SAAUsR,EAAMqT,GAAQ,OAAO,QAAWrT,EADtC,EAAnBsT,EAC2ED,GAD9CloB,GAAImoB,EAAShvB,MAAM4J,EAAOolB,EAASnoB,OAA1E,IAAUmoB,IACsF,IAC3GxzB,MAGXmzB,EAAStxB,UAAU4xB,UAAY,SAAUjuB,GACrC,OAAO,QAAKxF,KAAKwO,aAAa,QAAO,KAAMhJ,KAM/C2tB,EAAStxB,UAAUsN,OAAS,SAAUZ,EAAMmlB,GACxC,IAAIC,EAAO3zB,KAAK2zB,KAAKplB,EAAMmlB,GAC3B,OAAOC,GAAwB,IAAhBA,EAAKvkB,QAcxB+jB,EAAStxB,UAAU8xB,KAAO,SAAUplB,EAAMmlB,GACtC,GAAI1zB,KAAKyN,QAAUc,EAAKd,MACpB,OAAO,EACX,IAAIW,EAASslB,EAAWA,EAAS1zB,MAAQA,KAAKwO,YAC9C,OAAO,YAAcJ,EAAQpO,KAAKsb,YAAa/M,EAAK+M,cAMxD6X,EAASzmB,MAAQ,SAAU6B,GAAQ,OAAOA,EAAK7B,SACxCymB,EA9DkB,mWCHzBS,EAA2B,WAC3B,SAASA,KA4JT,OAzJAA,EAAUC,gBAAkB,SAAUC,EAAU3rB,GAC5C,IAAIsF,GAAQ,QAAKtF,GAAMsF,MACvB,OAAO,IAAI,IAAYqmB,EAAUrmB,EAAOtF,EAAKwG,KAAI,QAAK,gBAAgBC,OAAO,KAAQ,IAAK,KAE9FglB,EAAUG,UAAY,SAAUvH,GAC5B,IAAIre,EAAWqe,EAAYpe,SAC3B,OAAOoe,EAAY/T,SAAStQ,KAAKwG,KAAI,SAAUlB,GAAS,OAAO,IAAI,IAASA,GAAO6lB,eAAenlB,OAGtGylB,EAAUI,YAAc,SAAUC,EAAUzH,GACxC,IAAI0H,EAASN,EAAUG,UAAUvH,GACjC,OAAIA,EAAYrsB,UAAUif,QACfwU,EAAUO,cAAcF,EAAUC,EAAQ3gB,OAAOC,KAAKgZ,EAAYpe,WAEtE8lB,GAOXN,EAAUQ,iBAAmB,SAAUttB,EAAOqB,EAAM6kB,GAEhD7kB,EACKmB,QAAO,SAAUiF,GAAQ,OAAO,QAAQye,EAAQze,EAAKd,UACrD1M,SAAQ,SAAUwN,GACnB,IAAI8lB,GAAY,QAAO9lB,EAAKd,MAAM+M,OAAS,IACvC8Z,EAAUV,EAAUU,QAAQnsB,GAAM,SAAUoY,GAAK,OAAOA,IAAMhS,KAC9DgmB,EAAcF,EAAU1lB,KAAI,SAAUmL,GAAQ,OAAOhT,EAAM0tB,iBAAiBF,EAASxa,MACzFvL,EAAKiM,MAAQ+Z,EAAY3lB,OAAO,KAAS,QAcjDglB,EAAUO,cAAgB,SAAUF,EAAUC,EAAQO,QACnC,IAAXA,IAAqBA,EAAS,IAKlC,IAAIC,EAAYT,EACXtlB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKC,eAClCI,OAAO,KAAS,IAChBtF,QAAO,SAAU0F,GAAS,OAAQA,EAAMoQ,WACxCzQ,KAAI,QAAK,OAiBd,OAAOulB,EAAOvlB,KAZd,SAAiCgmB,GAE7B,IAAIC,GAAc,QAAO,GAAID,GAAUA,EAAOrZ,aAE1CuZ,GAAoB,QAAKD,EAAaH,GAC1CG,GAAc,QAAKA,EAAaH,GAChC,IAnBmBtsB,EAAMsF,EACrBc,EAkBAumB,GAAgB,SAnBD3sB,EAmBoB8rB,EAnBdxmB,EAmBwBknB,EAAOlnB,MAlBpDc,GAAO,QAAKpG,GAAM,QAAO,QAASsF,KAC/B,QAAO,GAAIc,GAAQA,EAAK+M,cAiBmC,IAAIoZ,GAElEK,GAAe,QAAOH,EAAaE,EAAeD,GACtD,OAAO,IAAI,IAASF,EAAOlnB,OAAO6lB,eAAeyB,OAQzDnB,EAAUllB,YAAc,SAAUulB,EAAUC,EAAQc,GAIhD,IAHA,IAE2BC,EAAOC,EAU9BhG,EAAMiG,EAAUlnB,EAASke,EAZzBrF,EAAMhF,KAAKD,IAAIoS,EAAS7kB,OAAQ8kB,EAAO9kB,QACvCgmB,EAAO,EAEJA,EAAOtO,GAAOmN,EAASmB,GAAM3nB,QAAUunB,IADnBC,EAC6ChB,EAASmB,GAD/CF,EACsDhB,EAAOkB,GAD7CH,EAAM9lB,OAAO+lB,EAAOtB,EAAUyB,oBAE5ED,IAUJD,GADAjG,EAAO+E,GACSnyB,MAAM,EAAGszB,GACzBnnB,EAAUihB,EAAKptB,MAAMszB,GAErB,IAAIE,EAAuBH,EAASxmB,KAVpC,SAAuB4mB,EAActmB,GACjC,IAAIxC,EAAS8oB,EAAa7oB,QAE1B,OADAD,EAAO6O,YAAc4Y,EAAOjlB,GAAKqM,YAC1B7O,KAUX,OAFA0f,EAAW+H,EAAOpyB,MAAMszB,GAEjB,CAAElG,KAAMA,EAAMC,GADhBmG,EAAqBlzB,OAAO+pB,GACJgJ,SAAUA,EAAUG,qBAAsBA,EAAsBrnB,QAASA,EAASke,SAAUA,IAiB7HyH,EAAU4B,SAAW,SAAUC,EAAOC,EAAOhC,GACzC,IAAIiC,GAAO,EAEX,OADa,QAAYF,EAAOC,GAClB9mB,QAAO,SAAU4mB,EAAUnK,GACrC,IAAIuK,EAAQvK,EAAG,GAAIwK,EAAQxK,EAAG,GAE9B,OADAsK,EAAOA,IAASC,EAAMzmB,OAAO0mB,EAAOnC,IACtB8B,EAAWA,EAASpzB,OAAOwzB,KAC1C,KAUPhC,EAAUzkB,OAAS,SAAUsmB,EAAOC,EAAOhC,GACvC,OAAO+B,EAAMrmB,SAAWsmB,EAAMtmB,QAAUwkB,EAAU4B,SAASC,EAAOC,EAAOhC,GAAUtkB,SAAWqmB,EAAMrmB,QAYxGwkB,EAAUU,QAAU,SAAUnsB,EAAM2tB,GAChC,IAAIvnB,GAAO,QAAKpG,EAAM2tB,GAClBC,EAAa5tB,EAAK+F,QAAQK,GAC9B,OAAuB,IAAhBwnB,OAAoB5hB,EAAYhM,EAAKrG,MAAM,EAAGi0B,EAAa,IAEtEnC,EAAUyB,iBAAmB,SAAU9mB,GACnC,OAAOA,EAAKd,MAAM4lB,WAAW,CAAEjU,SAAS,IAAS9V,QAAO,SAAU0F,GAAS,OAAQA,EAAM2e,YAG7FiG,EAAUtY,YAAc,SAAUnT,GAAQ,OAAOA,EAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,QAAO2L,EAAK3L,EAAK+M,eAAiB,KACtHsY,EA7JmB,yGCPvB,IAAIoC,EAAkB,CACzB/lB,KAAM,CACFgmB,KAAM,OACNC,MAAO,SAEXpd,MAAO,CACHqd,KAAM,OACNC,OAAQ,sbCgBZnkB,EAA4B,WAC5B,SAASA,EAAWokB,EAAMne,EAAWpG,EAAMwkB,EAAQ3uB,GAG/C,GAFA3H,KAAKu2B,UAAW,EAChBv2B,KAAKyD,aAAU0Q,EACXkiB,aAAgBpkB,GAChB,QAAOjS,KAAMq2B,QAEZ,IAAI,QAAWne,GAAY,CAC5B,IAAI,QAAkBme,GAClB,MAAM,IAAI5jB,MAAM,gDACpB,KAAK,QAAWyF,GACZ,MAAM,IAAIzF,MAAM,2DACpBzS,KAAKuhB,MAAQ8U,EACbr2B,KAAKs2B,OAASA,EACdt2B,KAAKkY,UAAYA,EACjBlY,KAAK8R,KAAOA,GAAQ,GACpB9R,KAAK2H,KAAOA,EACZ3H,KAAKu2B,cAAoBpiB,IAATxM,EAChB3H,KAAKyD,QAAUzD,KAAKu2B,SAAW,YAAiBv2B,KAAK2H,WAAQwM,OAE5D,IAAI,QAASkiB,IAASA,EAAK9U,QAAU8U,EAAK3zB,eAAe,cAAgB2zB,EAAK3zB,eAAe,SAAU,CACxG,IAAI8zB,EAAUH,EACd,OAAO,IAAIpkB,EAAWukB,EAAQjV,MAAOiV,EAAQte,UAAWse,EAAQ1kB,KAAM0kB,EAAQF,OAAQE,EAAQ7uB,OA+DtG,OA5DAsK,EAAWpQ,UAAUgX,UAAY,SAAUpL,GACvC,IAAIgpB,EAAaz2B,KAAKs2B,QAAU,GAC5BI,EAAejpB,GAASA,EAAMkpB,eAAkB,GACpD,MAAO,CACH1mB,KAAMwmB,EAAWxmB,MAAQymB,EAAYzmB,MA5CvC,OA6CE6I,MAAO2d,EAAW3d,OAAS4d,EAAY5d,OA5CxC,SAsDP7G,EAAWpQ,UAAU8K,QAAU,SAAUiqB,EAAgBhnB,GACrD,IAAIO,EAAQnQ,KACR+G,EAAK,OAOLwH,EAAOqoB,EAAeC,SAAS72B,MAC/ByN,EAAQc,GAAQA,EAAKd,MACrBqpB,EAAc92B,KAAK6Y,UAAUpL,GAAOqL,MACpCie,GAAoB,QAAWD,GAAeA,EAAc,KAUhE,OAAQ92B,KAAKyD,QAAUsD,EAClBkJ,OACAlF,MApB2B,WAC5B,OAAOhE,EAAG0U,IAAImb,EAAeI,gBAAgB7mB,GAAOxB,KAAI,SAAUqJ,GAAc,OAAOA,EAAWtH,IAAIkmB,EAAgBhnB,UAoBrH7E,MAjBiB,SAAUksB,GAAgB,OAAO9mB,EAAM+H,UAAU/V,MAAM,KAAM80B,MAkB9ElsB,KAAKgsB,GACLhsB,MAboB,SAAUmsB,GAK/B,OAJA/mB,EAAMxI,KAAOuvB,EACb/mB,EAAMomB,UAAW,EACjBpmB,EAAM+H,UAAY,KAClB,6BAA8B/H,EAAOP,GAC9BO,EAAMxI,SAgBrBsK,EAAWpQ,UAAU6O,IAAM,SAAUkmB,EAAgBhnB,GACjD,OAAO5P,KAAKyD,SAAWzD,KAAK2M,QAAQiqB,EAAgBhnB,IAExDqC,EAAWpQ,UAAUiT,SAAW,WAC5B,MAAO,sBAAuB,QAAU9U,KAAKuhB,OAAS,gBAAkBvhB,KAAK8R,KAAKnD,IAAI,MAAa,MAEvGsD,EAAWpQ,UAAU6K,MAAQ,WACzB,OAAO,IAAIuF,EAAWjS,OAE1BiS,EAAWklB,SAAW,SAAU5V,EAAO5Z,GAAQ,OAAO,IAAIsK,EAAWsP,GAAO,WAAc,OAAO5Z,IAAS,KAAM,KAAMA,IAC/GsK,EArFoB,4qBCd3BmlB,EAAQ,SACRC,EAAY,CAACD,EAAMlB,MAAOkB,EAAMnB,MAChCqB,EAAc,CAACF,EAAMlB,OAarB9tB,EAAgC,WAChC,SAASA,EAAemvB,GACpBv3B,KAAKu3B,MAAQA,EA8IjB,OA3IAnvB,EAAevG,UAAU+W,UAAY,WACjC,OAAO5Y,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO2L,EAAI9X,OAAOmM,EAAKwJ,YAAYpJ,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,YAAe,IAAI3S,OAAO,KAAO,KAQpJxG,EAAevG,UAAUiM,cAAgB,SAAUyT,GAC/C,IAAIiU,EAAWx1B,KAAKu3B,MACf5oB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKwJ,eAClCnJ,OAAO,KAAS,IAChBtF,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC9C,OAAO,QAAKiU,IAGhBptB,EAAevG,UAAUgX,UAAY,SAAUb,GAC3C,IAAIzJ,EAAOvO,KAAK62B,SAAS7e,GACzB,OAAOA,EAAWa,UAAUtK,EAAKd,QAyBrCrF,EAAevG,UAAUkS,WAAa,SAAUtG,GAC5C,OAAO,IAAIrF,EAAe,YAAkBpI,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAOA,EAAKd,QAAUA,OAiBpGrF,EAAevG,UAAU21B,eAAiB,SAAUC,EAAgBhqB,GAChE,IAAIc,GAAO,QAAKvO,KAAKu3B,OAAO,QAAO,QAAS9pB,IACxC+F,EAAOikB,EAAe9oB,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,SACtDhT,EAAKwJ,YAAcxJ,EAAKwJ,YAAYzO,QAAO,SAAUiU,GAAK,OAAkC,IAA3B/J,EAAKtF,QAAQqP,EAAEgE,UAAkBnf,OAAOq1B,IAS7GrvB,EAAevG,UAAU61B,YAAc,SAAUznB,EAAML,GACnD,IAAIO,EAAQnQ,UACC,IAATiQ,IAAmBA,EAAO,QAE9B,IAGI0nB,IAHa,QAAQN,EAAWpnB,GAAQA,EAAO,UAGjB,eAA6BqnB,EAAcD,EAE7E,sBAAuBr3B,KAAKu3B,MAAOtnB,EAAML,GACzC,IAAIgoB,EAAgB,SAAUC,EAAcC,GAAe,OAAO,SAAU9f,GACxE,OAAO,QAAQ6f,EAAc1nB,EAAM0I,UAAUb,GAAY8f,MAIzDvc,EAAWvb,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAC5C,IAAIwpB,EAAkBxpB,EAAKwJ,YAAYzO,OAAOsuB,EAAcD,EAAc,SACtEK,EAASD,EAAgBzuB,OAAOsuB,EAAc,CAAC,UAAW,UAC1DK,EAAOF,EAAgBzuB,QAAO,QAAIsuB,EAAc,CAAC,UAAW,WAE5D7jB,EAAa5D,EAAM4D,WAAWxF,EAAKd,OACnCyqB,EAAY,SAAU3a,GACtB,OAAOA,EACF7M,IAAIqD,EAAYnE,GAEhB7E,MAAK,SAAUvG,GAAS,MAAO,CAAG+c,MAAOhE,EAAEgE,MAAO/c,MAAOA,OAGlE,OADAwzB,EAAOj3B,QAAQm3B,GACRhe,EAAI9X,OAAO61B,EAAKtpB,IAAIupB,MAC5B,IAEH,OAAO,WAAgB3c,IAE3BnT,EAAevG,UAAUs2B,SAAW,WAChC,OAAOn4B,KAAKo4B,YAAcp4B,KAAKo4B,UAAY,IAAIC,EAAer4B,QAElEoI,EAAevG,UAAUg1B,SAAW,SAAU7e,GAC1C,OAAO,QAAKhY,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAO,QAAQA,EAAKwJ,YAAaC,OAO/E5P,EAAevG,UAAUm1B,gBAAkB,SAAUhf,GACjD,IAAI7H,EAAQnQ,KACRuO,EAAOvO,KAAK62B,SAAS7e,GAIrBsgB,GADU,YAAkBt4B,KAAKu3B,OAAO,SAAUjoB,GAAK,OAAOA,IAAMf,MAAYvO,KAAKu3B,OAEpF3oB,QAAO,SAAUsL,EAAKqe,GAAS,OAAOre,EAAI9X,OAAOm2B,EAAMxgB,eAAiB,IACxEzO,QAAO,SAAU0J,GAAO,OAAOA,IAAQgF,KAW5C,OAAOA,EAAWlG,KAAKnD,KAVH,SAAU4S,GAC1B,IAAIiU,EAAW8C,EAAqBhvB,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC7E,GAAIiU,EAASpmB,OACT,OAAO,QAAKomB,GAChB,IAAIgD,EAAeroB,EAAMgoB,WAAWM,UAAUlX,GAC9C,IAAI,QAAYiX,GACZ,MAAM,IAAI/lB,MAAM,+CAAgD,QAAU8O,IAE9E,OAAO,IAAI,IAAWA,GAAO,WAAc,OAAOiX,IAAiB,GAAIA,OAIxEpwB,EAhJwB,GAoJ/BiwB,EAAgC,WAChC,SAASA,EAAexnB,GACpB7Q,KAAK6Q,QAAUA,EACf7Q,KAAK04B,OAAS14B,KAAK0Q,IAlKQ,oBAkKsB,cAwBrD,OAtBA2nB,EAAex2B,UAAU6O,IAAM,SAAU6Q,GACrC,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,GAAIvJ,EAAY,CACZ,GAAiD,WAA7ChY,KAAK6Q,QAAQgI,UAAUb,GAAYc,MACnC,OAAOd,EAAWtH,IAAI1Q,KAAK6Q,SAE/B,IAAKmH,EAAWue,SACZ,MAAM,IAAI9jB,MAAM,yCAA0C,QAAUuF,EAAWuJ,QAEnF,OAAOvJ,EAAWrQ,KAEtB,OAAO3H,KAAKy4B,UAAUlX,IAE1B8W,EAAex2B,UAAU82B,SAAW,SAAUpX,GAC1C,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,OAAIvJ,EACOA,EAAWtH,IAAI1Q,KAAK6Q,SACxB,YAAiB7Q,KAAK04B,OAAOhoB,IAAI6Q,KAE5C8W,EAAex2B,UAAU42B,UAAY,SAAUlX,GAC3C,OAAOvhB,KAAK04B,QAAU14B,KAAK04B,OAAOhoB,IAAI6Q,IAEnC8W,EA3BwB,q2BC/J/BO,EAAkB,EAMlBC,GAAsB,QAAS,mBAJnB,CAAC,MAAO,OAAQ,SAAU,OAAQ,aAM9CC,GAAqB,QAAS,iBAJlB,CAAC,OAAQ,WAAY,OAAQ,WAAY,YAAa,eAUlEpiB,EAA0B,WAQ1B,SAASA,EAASU,EAAiBC,QACP,IAApBD,IAA8BA,EAAkByhB,QAC7B,IAAnBxhB,IAA6BA,EAAiByhB,GAClD94B,KAAKoX,gBAAkBA,EACvBpX,KAAKqX,eAAiBA,EACLrX,KAAKmb,IAAMyd,IACX54B,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAe,GAErCh5B,KAAKqI,MAAQ,KAEbrI,KAAK+W,YAAc,IAAI,IAAY/W,MAEnCA,KAAKsY,QAAU,IAAI,IAEnBtY,KAAK8sB,kBAAoB,IAAI,IAAkB9sB,MAK/CA,KAAK4U,kBAAoB,IAAI,IAAkB5U,MAK/CA,KAAKmc,UAAY,IAAI,IAAUnc,MAE/BA,KAAKiX,WAAa,IAAI,IAAWjX,MAEjCA,KAAK4W,cAAgB,IAAI,IAAc5W,MAEvCA,KAAK6W,aAAe,IAAI,IAAa7W,MAErCA,KAAKi5B,SAAW,GAChBj5B,KAAK+W,YAAY/M,WAAWC,iBAAiBjK,KAAK4W,cAAcgH,QAChE5d,KAAKsY,QAAQwa,SAAW9yB,KAAK4W,cAAcgH,OAC3C5d,KAAKsY,QAAQwN,QAAU9lB,KAAKsY,QAAQwa,SAASplB,KAC7C1N,KAAKk5B,WAAWl5B,KAAKsY,SACrBtY,KAAKk5B,WAAWl5B,KAAK6W,cACrB7W,KAAKk5B,WAAWl5B,KAAK4W,eACrB5W,KAAKk5B,WAAWl5B,KAAK8sB,mBACrB9sB,KAAKk5B,WAAWl5B,KAAKiX,YACrBjX,KAAKk5B,WAAW9hB,GAChBpX,KAAKk5B,WAAW7hB,GAgGpB,OA7FAX,EAAS7U,UAAUq3B,WAAa,SAAUA,GACtCl5B,KAAKg5B,aAAav4B,KAAKy4B,IAa3BxiB,EAAS7U,UAAUqT,QAAU,SAAUgkB,GACnC,IAAI/oB,EAAQnQ,KACRk5B,IAAc,QAAWA,EAAWhkB,SACpCgkB,EAAWhkB,QAAQlV,OAGvBA,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAal3B,QAAQf,SAAQ,SAAUo4B,GACxC,IACyB,mBAAdA,EAAEjkB,SAA0BikB,EAAEjkB,QAAQ/E,IAC7C,QAAWA,EAAM6oB,aAAcG,GAEnC,MAAOC,UAwDf1iB,EAAS7U,UAAUw3B,OAAS,SAAUA,EAAQl5B,QAC1B,IAAZA,IAAsBA,EAAU,IACpC,IAAIm5B,EAAiB,IAAID,EAAOr5B,KAAMG,GACtC,IAAKm5B,EAAe9zB,KAChB,MAAM,IAAIiN,MAAM,+CAAiD6mB,GAErE,OADAt5B,KAAKg5B,aAAav4B,KAAK64B,GACft5B,KAAKi5B,SAASK,EAAe9zB,MAAQ8zB,GAEjD5iB,EAAS7U,UAAU03B,UAAY,SAAUC,GACrC,OAAOA,EAAax5B,KAAKi5B,SAASO,IAAc,QAAOx5B,KAAKi5B,WAEzDviB,EAnJkB,ijBCf7B,SAAS+iB,EAAYhsB,GACjB,OAAOA,EAAMjI,KAEjB,SAASk0B,EAAYjsB,GAEjB,OADAA,EAAMC,KAAKsG,QAAU,WAAc,OAAOvG,GACnCA,EAAMC,KAEjB,SAASisB,EAAYlsB,GAIjB,OAHIA,EAAM2M,QAAU3M,EAAM2M,OAAOzS,OAC7B8F,EAAM9F,KAAO8F,EAAMC,KAAK/F,MAAO,QAAQ8F,EAAM2M,OAAOzS,KAAM8F,EAAM9F,OAE7D8F,EAAM9F,KAEjB,IAAIiyB,EAAgB,SAAUC,EAA4Bjc,GACtD,OAAO,SAAoBhK,GACvB,IAAIkmB,EAAWlmB,EAAYlG,KAG3B,GAAIosB,GAAYA,EAASroB,KAAOqoB,EAASt0B,MAAQs0B,EAASt0B,KAAKwW,MAAM,WAAY,CAC7E,IAAI+d,EAAc,IAClB,QAAKD,EAAUC,GACfA,EAAYtoB,KAAO,kBACnBqoB,EAAWC,EAEf,IAAI3f,EAASxG,EAAYwG,OACrB4f,EA/BG,SAAUvoB,GACrB,KAAK,QAASA,GACV,OAAO,EACX,IAAImM,EAAyB,MAAlBnM,EAAIhM,OAAO,GACtB,MAAO,CAAEzB,IAAK4Z,EAAOnM,EAAIwoB,UAAU,GAAKxoB,EAAKmM,KAAMA,GA2BlCsc,CAASJ,EAASroB,KAC3BA,EAAOuoB,EAAwBH,EAA2BxyB,QAAQ2yB,EAAOh2B,IAAK,CAAEyJ,MAAOqsB,IAAvEA,EAASroB,IAC7B,IAAKA,EACD,OAAO,KACX,IAAKooB,EAA2BM,UAAU1oB,GACtC,MAAM,IAAIgB,MAAM,gBAAkBhB,EAAM,eAAiBmC,EAAc,KAC3E,OAAOomB,GAAUA,EAAOpc,KAAOnM,GAAQ2I,GAAUA,EAAOggB,WAAcxc,KAAQnM,IAAI4oB,OAAO5oB,KAG7F6oB,EAAsB,SAAUC,GAChC,OAAO,SAA0B9sB,GAC7B,OAAQ8sB,EAAO9sB,IAAUA,EAAMgE,IAAMhE,EAAQA,EAAM2M,OAAS3M,EAAM2M,OAAOggB,UAAY,OAc7F,SAASI,EAAY/sB,GACjB,OAAOA,EAAM2M,OAAS3M,EAAM2M,OAAOjS,KAAK/F,OAAOqL,GAAkB,CAACA,GAEtE,SAASgtB,EAAgBhtB,GACrB,IAAI6L,EAAW7L,EAAM2M,QAAS,QAAO,GAAI3M,EAAM2M,OAAOd,UAAY,GAElE,OADAA,EAAS7L,EAAMjI,OAAQ,EAChB8T,EA2CJ,SAASohB,EAAmBjtB,GAE/B,IAA+BktB,EAAY3E,EA2BvC4E,EAAW,SAAUC,GAAK,OAAOA,EAAEC,SAAWD,EAAEtZ,OAEhDwZ,GAAqB,QAAQ,CAC7B,EAAC,QAAK,aAAc,SAAUF,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAE3iB,UAAW2iB,EAAE/oB,KAAM+oB,EAAEvE,UAC7F,EAAC,QAAK,cAAe,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAEG,WAAYH,EAAE/oB,MAAQ+oB,EAAEI,aAAcJ,EAAEvE,UACjH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAO,IAAIA,EAAEK,WAAe,GAAIL,EAAEvE,UACrH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAOA,EAAEM,WAAa,GAAIN,EAAEvE,OAAQuE,EAAEM,YACzH,EAAC,QAAK,eAAgB,SAAUN,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAI,KAAU,CAACA,EAAEO,aAAcP,EAAEvE,YAGrG+E,GAAmB,QAAQ,CAC3B,EAAC,SAAK,QAAK,OAAQ,MAAW,SAAU5nB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO,KAAU,CAAC9N,EAAMzP,KAAMyP,EAAM6iB,UACjH,EAAC,SAAK,QAAK,OAAQ,MAAU,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,OAAO,QAAK9N,EAAMzP,KAAMyP,EAAMzP,IAAIlC,MAAM,GAAI,GAAI2R,EAAM6iB,UAClI,EAAC,SAAK,QAAK,OAAQ,MAAa,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO9N,EAAMzP,KA/BvErD,EA+BqF8S,EAAMzP,IA9B5GuM,EAAY,cAIT5P,EAAY,SAAM4P,GAAaA,EAAU0H,SAAStX,EAAI4P,EAAUuH,WAAc,YA0BiCrE,EAAM6iB,QA/BjH,IAAU31B,EACjB4P,MAiCJ+qB,GAAkB,QAAQ,CAC1B,EAAC,IAAApiB,IAAG,KAAa,SAAUqE,GAAK,OAAOA,IACvC,CA5BmB,SAAUtD,GAAO,SAAUA,EAAIsH,QAAStH,EAAI/B,YA4B5C6iB,GACnB,CA3BoB,SAAU9gB,GAC9B,SAAWA,EAAI6gB,UAAW7gB,EAAIsH,SAAWtH,EAAIkhB,UAAYlhB,EAAI+gB,YAAc/gB,EAAImhB,aAAenhB,EAAIihB,YA0B9EH,GACpB,CAxBiB,SAAU9gB,GAC3B,SAAUA,GAAOA,EAAIjW,OAAQ,QAASiW,EAAIjW,OAAQ,QAAQiW,EAAIjW,OAAQ,QAAWiW,EAAIjW,QAuBpEq3B,GACjB,EAAC,SAAI,GAAO,SAAUphB,GAAO,MAAM,IAAIxH,MAAM,2BAA4B,QAAUwH,QAInFshB,EAAO9tB,EAAMd,QAEjB,QADY,QAAQ4uB,GAAQA,GArDGZ,EAqDmBY,EArDPvF,EAqDavoB,EAAMkpB,eAAiB,GApDpEpjB,OAAOC,KAAKmnB,GAAc,IAAIhsB,KAAI,SAAU4S,GAAS,MAAO,CAC/DA,MAAOA,EACPvd,IAAK22B,EAAWpZ,GAChBzP,UAAMqC,EACNmiB,OAAQN,EAAgBzU,SAiDnB5S,IAAI2sB,GAcrB,IAAIE,EAA8B,WAC9B,SAASA,EAAaC,EAAS7mB,GAC3B5U,KAAKy7B,QAAUA,EACf,IArIyBC,EAqIrBhuB,EAAO1N,KACP4d,EAAO,WAAc,OAAO6d,EAAQ3a,KAAK,KACzCyZ,EAAS,SAAU9sB,GAAS,MAAsB,KAAfA,EAAMjI,MAM7CxF,KAAK27B,SAAW,CACZn2B,KAAM,CAACi0B,GACP/rB,KAAM,CAACgsB,GACPtf,OAAQ,CARZ,SAAuB3M,GACnB,OAAI8sB,EAAO9sB,GACA,KACJguB,EAAQ3a,KAAKpT,EAAKkuB,WAAWnuB,KAAWmQ,MAM/CjW,KAAM,CAACgyB,GAEPloB,IAAK,CAACmoB,EAAchlB,EAAmBgJ,IAEvCwc,UAAW,CAACE,EAAoBC,IAChCnsB,OAAQ,EAtJastB,EAsJK9mB,EAAkB8mB,aArJ7C,SAAuBjuB,GAC1B,IACIouB,EAAapuB,EAAMgE,KAAOhE,EAAMgE,IAAI4hB,WAAW,CAAEjU,SAAS,KAAa,GACvE0c,GAAe,SAAO,SAAO,QAAKruB,EAAMW,QAAU,GAAIytB,EAAUltB,KAAI,QAAK,SAFvD,SAAUpD,EAAQF,GAAM,OAAOqwB,EAAa9qB,WAAWvF,EAAI,KAAMoC,EAAMC,UAG7F,OAAOmuB,EACFz5B,OAAO05B,GACPntB,KAAI,SAAUksB,GAAK,MAAO,CAACA,EAAExvB,GAAIwvB,MACjCjsB,OAAO,KAAY,OAiJpB4L,MAAO,GAEPrS,KAAM,CAACqyB,GAEPlhB,SAAU,CAACmhB,GACX1iB,YAAa,CAAC2iB,IAgEtB,OA7DAc,EAAa35B,UAAUk6B,QAAU,SAAUv2B,EAAM7E,GAC7C,IAAIg7B,EAAW37B,KAAK27B,SAChBpc,EAAQoc,EAASn2B,IAAS,GAE9B,OAAI,QAASA,MAAU,QAAU7E,GACtB4e,EAAMnQ,OAAS,EAAImQ,EAAQA,EAAM,IACvC,QAAS/Z,KAAU,QAAW7E,IAEnCg7B,EAASn2B,GAAQ+Z,EACjBoc,EAASn2B,GAAM/E,KAAKE,GACb,WAAc,OAAOg7B,EAASn2B,GAAMga,OAAOmc,EAASn2B,GAAM0I,QAAQvN,EAAI,KAAO,YAJpF,GAaJ66B,EAAa35B,UAAUm6B,MAAQ,SAAUvuB,GACrC,IAAeguB,EAANz7B,KAAmBy7B,QAASE,EAA5B37B,KAA0C27B,SAC/CvhB,EAASpa,KAAK47B,WAAWnuB,GAC7B,GAAI2M,IAAWqhB,EAAQ3a,KAAK1G,OAAQjG,GAAW,GAC3C,OAAO,KAEX,IAAK,IAAItO,KAAO81B,EACZ,GAAKA,EAASj5B,eAAemD,GAA7B,CAEA,IAAIo2B,EAAQN,EAAS91B,GAAK+I,QAAO,SAAUstB,EAAUpS,GAAQ,OAAO,SAAUmD,GAAU,OAAOnD,EAAKmD,EAAQiP,MAAiB,MAC7HzuB,EAAM5H,GAAOo2B,EAAMxuB,GAEvB,OAAOA,GAEX+tB,EAAa35B,UAAU+5B,WAAa,SAAUnuB,GAE1C,IAAIjI,EAAOiI,EAAMjI,MAAQ,GAErB22B,EAAW32B,EAAKsd,MAAM,KAM1B,GAFoB,OAFFqZ,EAASC,OAGvBD,EAASC,MACTD,EAAS/sB,OAAQ,CACjB,GAAI3B,EAAM2M,OACN,MAAM,IAAI3H,MAAM,mFAAqFjN,EAAO,KAGhH,OAAO22B,EAASlpB,KAAK,KAEzB,OAAKxF,EAAM2M,QAEJ,QAAS3M,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KADjD,IAGfg2B,EAAa35B,UAAU2D,KAAO,SAAUiI,GACpC,IAAIjI,EAAOiI,EAAMjI,KACjB,IAA2B,IAAvBA,EAAK0I,QAAQ,OAAgBT,EAAM2M,OACnC,OAAO5U,EACX,IAAIo2B,GAAa,QAASnuB,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KACtE,OAAOo2B,EAAaA,EAAa,IAAMp2B,EAAOA,GAE3Cg2B,EA5FsB,iTClL7Ba,EAA8B,WAC9B,SAASA,EAAaC,GAClBt8B,KAAKs8B,QAAUA,EAmDnB,OAjDAD,EAAax6B,UAAU06B,WAAa,SAAUC,GAE1C,OAAkC,KADlCA,EAAYA,GAAa,IACRtuB,QAAQ,MAAyC,IAA3BsuB,EAAUtuB,QAAQ,MAE7DmuB,EAAax6B,UAAUif,KAAO,SAAU2b,EAAaC,EAAMC,GAEvD,QADkB,IAAdA,IAAwBA,GAAY,GACnCF,GAA+B,KAAhBA,EAApB,CAEA,IAAIG,GAAQ,QAASH,GACjBj3B,EAAOo3B,EAAQH,EAAcA,EAAYj3B,KACzCxF,KAAKu8B,WAAW/2B,KAChBA,EAAOxF,KAAK03B,YAAYlyB,EAAMk3B,IAClC,IAAIjvB,EAAQzN,KAAKs8B,QAAQ92B,GACzB,GAAIiI,IAAUmvB,KAAWA,GAAUnvB,IAAUgvB,GAAehvB,EAAMC,OAAS+uB,IACvE,OAAOhvB,EAEN,GAAImvB,GAASD,EAAW,CACzB,IACIzZ,GADU,QAAOljB,KAAKs8B,SACJhzB,QAAO,SAAU2jB,GAAU,OAAOA,EAAO4P,mBAAmBC,UAAY7P,EAAO4P,mBAAmBC,SAAS5Z,QAAQ1d,MAIzI,OAHI0d,EAAQ9T,OAAS,GACjB,UAAkB,iDAAmD5J,EAAO,gBAAiB0d,EAAQvU,KAAI,SAAUqN,GAAS,OAAOA,EAAMxW,SAEtI0d,EAAQ,MAIvBmZ,EAAax6B,UAAU61B,YAAc,SAAUlyB,EAAMk3B,GACjD,IAAKA,EACD,MAAM,IAAIjqB,MAAM,sCAAwCjN,EAAO,KAKnE,IAJA,IAAIu3B,EAAY/8B,KAAK8gB,KAAK4b,GACtBM,EAAYx3B,EAAKsd,MAAM,KACvBma,EAAaD,EAAU5tB,OACvBiO,EAAI,EAAGyI,EAAUiX,EACd1f,EAAI4f,EAAY5f,IACnB,GAAqB,KAAjB2f,EAAU3f,IAAmB,IAANA,EAA3B,CAIA,GAAqB,MAAjB2f,EAAU3f,GAMd,MALI,IAAKyI,EAAQ1L,OACT,MAAM,IAAI3H,MAAM,SAAWjN,EAAO,0BAA4Bu3B,EAAUv3B,KAAO,KACnFsgB,EAAUA,EAAQ1L,YANlB0L,EAAUiX,EAWlB,IAAIG,EAAUF,EAAUl7B,MAAMub,GAAGpK,KAAK,KACtC,OAAO6S,EAAQtgB,MAAQsgB,EAAQtgB,MAAQ03B,EAAU,IAAM,IAAMA,GAE1Db,EArDsB,oWCW7Bc,EAA6B,WAE7B,SAASA,EAAY5xB,GACjB,OAAO4xB,EAAY37B,OAAO+J,GAAU,IA4FxC,OAlFA4xB,EAAY37B,OAAS,SAAU47B,GAC3BA,EAAYD,EAAYE,aAAaD,GAAa,IAAIA,EAAcA,EACpE,IAAI3vB,GAAQ,SAAQ,QAAQ2vB,EAAWD,EAAYt7B,YAMnD,OALAu7B,EAAUppB,QAAU,WAAc,OAAOvG,GACzCA,EAAMC,KAAO0vB,EACb3vB,EAAMovB,mBAAqB,CACvBC,SAAU,eAAgBrvB,EAAMjI,OAE7BiI,GAaX0vB,EAAYt7B,UAAUqX,GAAK,SAAUokB,GACjC,OAAOt9B,OAASs9B,GAAOt9B,KAAK0N,OAAS4vB,GAAOt9B,KAAKsL,QAAUgyB,GAM/DH,EAAYt7B,UAAUyJ,IAAM,WACxB,KAAKtL,KAAKoa,QAAYpa,KAAKoa,kBAAkBpa,KAAKokB,aAC9C,OAAOpkB,KAAKwF,KAChB,IAAIA,EAAOxF,KAAKoa,OAAO9O,MACvB,OAAO9F,EAAOA,EAAO,IAAMxF,KAAKwF,KAAOxF,KAAKwF,MAOhD23B,EAAYt7B,UAAU+b,KAAO,WACzB,OAAQ5d,KAAKoa,QAAUpa,KAAKoa,OAAOwD,QAAW5d,MAWlDm9B,EAAYt7B,UAAUwxB,WAAa,SAAUzyB,GAGzC,QAFAA,GAAO,QAASA,EAAM,CAAEwe,SAAS,EAAMme,aAAc,QAC/Bne,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOiZ,cAAiB,IAExEjxB,QAAO,QAAOpC,KAAKoO,SACnB9E,QAAO,SAAU0F,GAAS,OAAQpO,EAAK28B,cAAgB38B,EAAK28B,aAAa76B,eAAesM,EAAM3D,QASvG8xB,EAAYt7B,UAAU4xB,UAAY,SAAUpoB,EAAIzK,GAE5C,YADa,IAATA,IAAmBA,EAAO,IACrBZ,KAAKyR,KAAOzR,KAAKyR,IAAIgiB,UAAUpoB,EAAIzK,KACxC,SAAK,QAAOZ,KAAKoO,SAAS,QAAO,KAAM/C,KACtCzK,EAAKwe,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOqZ,UAAUpoB,IAE9D8xB,EAAYt7B,UAAUiT,SAAW,WAC7B,OAAO9U,KAAKsL,OAGhB6xB,EAAYE,aAAe,SAAUD,GACjC,OAAO,QAAWA,KAA+C,IAAjCA,EAA2B,iBAG/DD,EAAYK,mBAAqB,SAAUvjB,GAAO,OAAO,QAAWA,EAAa,UAEjFkjB,EAAYM,QAAU,SAAUxjB,GAAO,OAAO,QAASA,EAAwB,qBACxEkjB,EA/FqB,kPCZ5BO,EAAmC,WACnC,SAASA,EAAkBhpB,EAAQsY,EAAQ+O,EAAS4B,GAChD39B,KAAK0U,OAASA,EACd1U,KAAKgtB,OAASA,EACdhtB,KAAK+7B,QAAUA,EACf/7B,KAAK29B,UAAYA,EACjB39B,KAAK49B,MAAQ,GA4EjB,OA1EAF,EAAkB77B,UAAUqT,QAAU,WAClClV,KAAK49B,MAAQ,IAEjBF,EAAkB77B,UAAU6X,SAAW,SAAU0jB,GAC7C,IAAIQ,EAAQ59B,KAAK49B,MACbnwB,EAAQ,WAAmB2vB,GAC3B53B,EAAOiI,EAAMjI,KACjB,KAAK,QAASA,GACV,MAAM,IAAIiN,MAAM,gCACpB,GAAIzS,KAAKgtB,OAAOtqB,eAAe8C,KAAS,QAAQo4B,EAAMjvB,KAAI,QAAK,SAAUnJ,GACrE,MAAM,IAAIiN,MAAM,UAAYjN,EAAO,wBAGvC,OAFAo4B,EAAMn9B,KAAKgN,GACXzN,KAAK69B,QACEpwB,GAEXiwB,EAAkB77B,UAAUg8B,MAAQ,WAchC,IAbA,IAAI1tB,EAAQnQ,KACRqrB,EAAKrrB,KAAM49B,EAAQvS,EAAGuS,MAAO5Q,EAAS3B,EAAG2B,OAAQ+O,EAAU1Q,EAAG0Q,QAC9D+B,EAAa,GACjBC,EAAU,GACVC,EAAsB,GAClBC,EAAW,SAAUz4B,GAAQ,OAAO2K,EAAM6c,OAAOtqB,eAAe8C,IAAS2K,EAAM6c,OAAOxnB,IACtF04B,EAAkB,WACdJ,EAAW1uB,QACXe,EAAMwtB,UAAU58B,SAAQ,SAAUo9B,GAC9B,OAAOA,EAAS,aAAcL,EAAWnvB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,aAI1EkwB,EAAMxuB,OAAS,GAAG,CACrB,IAAI3B,EAAQmwB,EAAM37B,QACdm8B,EAAS3wB,EAAMjI,KACfc,EAASy1B,EAAQC,MAAMvuB,GACvB4wB,EAAYN,EAAQ7vB,QAAQT,GAChC,GAAInH,EAAJ,CACI,IAAIg4B,EAAgBL,EAASG,GAC7B,GAAIE,GAAiBA,EAAc94B,OAAS44B,EACxC,MAAM,IAAI3rB,MAAM,UAAY2rB,EAAS,wBAEzC,IAAIG,EAAsBN,EAASG,EAAS,OACxCG,GAEAv+B,KAAK0U,OAAOkC,cAAc4nB,WAAWD,GAEzCvR,EAAOoR,GAAU3wB,EACjBzN,KAAKy+B,YAAYhxB,GACb4wB,GAAa,GACbN,EAAQve,OAAO6e,EAAW,GAC9BP,EAAWr9B,KAAKgN,OAdpB,CAiBA,IAAIixB,EAAOV,EAAoBI,GAE/B,GADAJ,EAAoBI,GAAUR,EAAMxuB,OAChCivB,GAAa,GAAKK,IAASd,EAAMxuB,OAKjC,OAFAwuB,EAAMn9B,KAAKgN,GACXywB,IACOlR,EAEFqR,EAAY,GACjBN,EAAQt9B,KAAKgN,GAEjBmwB,EAAMn9B,KAAKgN,IAGf,OADAywB,IACOlR,GAEX0Q,EAAkB77B,UAAU48B,YAAc,SAAUhxB,GAChD,IAAIA,EAAMkxB,UAAalxB,EAAMgE,IAA7B,CAEA,IAAImtB,EAAW5+B,KAAK0U,OAAOuC,WAAW0F,MACtCiiB,EAASriB,KAAKqiB,EAASC,eAAer9B,OAAOiM,MAE1CiwB,EAlF2B,sbCQlCoB,EAA+B,WAE/B,SAASA,EAAcpqB,GACnB1U,KAAK0U,OAASA,EACd1U,KAAKgtB,OAAS,GAEdhtB,KAAK29B,UAAY,GACjB39B,KAAKy7B,QAAU,IAAI,IAAaz7B,KAAKgtB,QACrChtB,KAAK+7B,QAAU,IAAI,IAAa/7B,KAAKy7B,QAAS/mB,EAAOE,mBACrD5U,KAAK++B,WAAa,IAAI,IAAkBrqB,EAAQ1U,KAAKgtB,OAAQhtB,KAAK+7B,QAAS/7B,KAAK29B,WAChF39B,KAAKg/B,gBAmJT,OAhJAF,EAAcj9B,UAAUm9B,cAAgB,YAUvBh/B,KAAKi/B,MAAQj/B,KAAK++B,WAAWrlB,SATvB,CACflU,KAAM,GACNiM,IAAK,IACL+I,MAAO,KACPpM,OAAQ,CACJ,IAAK,CAAE5J,MAAO,KAAM0K,KAAM,OAAQye,SAAS,IAE/CgR,UAAU,KAGRvE,UAAY,MAGtB0E,EAAcj9B,UAAUqT,QAAU,WAC9B,IAAI/E,EAAQnQ,KACZA,KAAK++B,WAAW7pB,UAChBlV,KAAK29B,UAAY,GACjB39B,KAAK0Q,MAAM3P,SAAQ,SAAU0M,GAAS,OAAO0C,EAAMO,IAAIjD,IAAU0C,EAAMquB,WAAW/wB,OAgCtFqxB,EAAcj9B,UAAUq9B,gBAAkB,SAAUf,GAEhD,OADAn+B,KAAK29B,UAAUl9B,KAAK09B,GACb,YACH,QAAWn+B,KAAK29B,UAAhB,CAA2BQ,IAC7B76B,KAAKtD,OAWX8+B,EAAcj9B,UAAU+b,KAAO,WAC3B,OAAO5d,KAAKi/B,OAchBH,EAAcj9B,UAAU6X,SAAW,SAAUylB,GACzC,OAAOn/B,KAAK++B,WAAWrlB,SAASylB,IAGpCL,EAAcj9B,UAAUu9B,gBAAkB,SAAU3xB,GAChD,IAAI0C,EAAQnQ,KACRyb,EAAMzb,KAAK0Q,MAAM/B,KAAI,SAAUyO,GAAK,OAAOA,EAAEpJ,aAC7CqrB,EAAc,SAAUrS,GACxB,IAAIsS,EAAY7jB,EAAInS,QAAO,SAAU8T,GAAK,OAAqC,IAA9B4P,EAAO9e,QAAQkP,EAAEhD,WAClE,OAA4B,IAArBklB,EAAUlwB,OAAekwB,EAAYA,EAAUl9B,OAAOi9B,EAAYC,KAEzE12B,EAAWy2B,EAAY,CAAC5xB,IACxB8xB,EAAe,CAAC9xB,GAAOrL,OAAOwG,GAAUoX,UAW5C,OAVAuf,EAAax+B,SAAQ,SAAUksB,GAC3B,IAAI2R,EAAWzuB,EAAMuE,OAAOuC,WAAW0F,MAEvCiiB,EACKjiB,QACArT,QAAO,QAAO,QAAS2jB,IACvBlsB,SAAQ,SAAUwb,GAAQ,OAAOqiB,EAASY,WAAWjjB,aAEnDpM,EAAM6c,OAAOC,EAAOznB,SAExB+5B,GAWXT,EAAcj9B,UAAU28B,WAAa,SAAU/B,GAC3C,IAAIxP,EAASjtB,KAAK0Q,IAAI+rB,GACtB,IAAKxP,EACD,MAAM,IAAIxa,MAAM,sCAAwCgqB,GAC5D,IAAIgD,EAAqBz/B,KAAKo/B,gBAAgBnS,EAAOjZ,WAIrD,OAHAhU,KAAK29B,UAAU58B,SAAQ,SAAUo9B,GAC7B,OAAOA,EAAS,eAAgBsB,EAAmB9wB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,YAE5E+xB,GAEXX,EAAcj9B,UAAU6O,IAAM,SAAU+rB,EAAaC,GACjD,IAAIvsB,EAAQnQ,KACZ,GAAyB,IAArBgC,UAAUoN,OACV,OAAOmE,OAAOC,KAAKxT,KAAKgtB,QAAQre,KAAI,SAAUnJ,GAAQ,OAAO2K,EAAM6c,OAAOxnB,GAAMkI,QACpF,IAAIgyB,EAAQ1/B,KAAKy7B,QAAQ3a,KAAK2b,EAAaC,GAC3C,OAAQgD,GAASA,EAAMhyB,MAAS,MAYpCoxB,EAAcj9B,UAAUiV,UAAY,SAAU6oB,EAAUC,GACpD,OAAO5/B,KAAK+7B,QAAQA,QAAQ4D,EAAUC,IAEnCd,EA7JuB,2SCsB9Be,EAA6B,WAe7B,SAASA,EAAYC,EAAgBC,EAAaC,EAASC,GACvDjgC,KAAK8/B,eAAiBA,EACtB9/B,KAAK+/B,YAAcA,EACnB//B,KAAK+/B,YAAcA,EACnB//B,KAAKggC,SAAU,QAAO,GAAIA,GAAW,IACrChgC,KAAKigC,UAAW,QAAO,GAAIA,GAAY,IACvCjgC,KAAKkgC,YAAcJ,EAAerE,QAAQ3a,KAAKif,EAAa//B,KAAKigC,SAASE,UAsF9E,OAnFAN,EAAYh+B,UAAU2D,KAAO,WACzB,OAAQxF,KAAKkgC,aAAelgC,KAAKkgC,YAAY16B,MAASxF,KAAK+/B,aAG/DF,EAAYh+B,UAAU4qB,WAAa,WAC/B,OAAOzsB,KAAK+/B,aAGhBF,EAAYh+B,UAAUuM,OAAS,WAC3B,OAAOpO,KAAKggC,SAGhBH,EAAYh+B,UAAU4W,OAAS,WAC3B,OAAOzY,KAAKkgC,aAGhBL,EAAYh+B,UAAU4L,MAAQ,WAC1B,OAAOzN,KAAKkgC,aAAelgC,KAAKkgC,YAAYxyB,MAGhDmyB,EAAYh+B,UAAU1B,QAAU,WAC5B,OAAOH,KAAKigC,UAGhBJ,EAAYh+B,UAAUu+B,OAAS,WAC3B,SAAUpgC,KAAKkgC,cAAelgC,KAAKkgC,YAAYxyB,OAGnDmyB,EAAYh+B,UAAUw+B,MAAQ,WAC1B,OAAQrgC,KAAKqF,SAGjBw6B,EAAYh+B,UAAUwD,MAAQ,WAC1B,IAAIq3B,EAAO18B,KAAKG,UAAUggC,SAC1B,IAAKngC,KAAKkgC,aAAiBxD,EAAM,CAC7B,IAAIF,EAAYE,EAAKl3B,KAAOk3B,EAAKl3B,KAAOk3B,EACxC,MAAO,sBAAwB18B,KAAKwF,OAAS,iBAAmBg3B,EAAY,IAEhF,OAAKx8B,KAAKkgC,YAELlgC,KAAKkgC,YAAYxyB,UAAtB,EACW,UAAY1N,KAAKwF,OAAS,8BAF1B,kBAAoBxF,KAAKwF,OAAS,KAIjDq6B,EAAYh+B,UAAUiT,SAAW,WAC7B,MAAO,IAAM9U,KAAKwF,OAAS,KAAM,QAAUxF,KAAKoO,WAQpDyxB,EAAYh+B,UAAUy+B,UAAY,SAAU7yB,GACxC,OAAO,IAAIoyB,EAAY7/B,KAAK8/B,eAAgBryB,EAAOzN,KAAKggC,QAAShgC,KAAKigC,WAS1EJ,EAAYh+B,UAAU0+B,WAAa,SAAUnyB,EAAQ2G,QACjC,IAAZA,IAAsBA,GAAU,GACpC,IAAI8d,EAAY9d,EAAU3G,GAAS,QAAO,GAAIpO,KAAKggC,QAAS5xB,GAC5D,OAAO,IAAIyxB,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAalN,EAAW7yB,KAAKigC,WASlFJ,EAAYh+B,UAAU2+B,YAAc,SAAUrgC,EAAS4U,QACnC,IAAZA,IAAsBA,GAAU,GACpC,IAAI0rB,EAAU1rB,EAAU5U,GAAU,QAAO,GAAIH,KAAKigC,SAAU9/B,GAC5D,OAAO,IAAI0/B,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAa//B,KAAKggC,QAASS,IAGhFZ,EAAYa,MAAQ,SAAUzmB,GAC1B,OAAOA,GAAOA,EAAIxM,SAAU,QAASwM,EAAIxM,SAAW,QAASwM,EAAIxM,SAAU,QAASwM,EAAIxM,MAAMjI,QAE3Fq6B,EA3GqB,iYCf5Bc,EAA6B,WAC7B,SAASA,EAAY1U,GACjBjsB,KAAKisB,WAAaA,EA2EtB,OAzEA0U,EAAY9+B,UAAU++B,mBAAqB,SAAUC,GACjD,IAAI1wB,EAAQnQ,KAEZ,OADmBA,KAAKisB,WAAWvX,OAAOoY,kBACtB9iB,WACf82B,WAAWD,GACXlyB,KAAI,SAAUO,GAAQ,OAAOiB,EAAM4wB,WAAW7xB,MAC9CN,OAAO,KAAS,IAChBtF,OAAO,OAWhBq3B,EAAY9+B,UAAUk/B,WAAa,SAAUC,GACzC,IAAI/U,EAAajsB,KAAKisB,WAClBvd,EAAcud,EAAWvd,cAEzBuyB,EAAgBjhC,KAAKkhC,iBAAiBF,EAAUtyB,EAAaud,GACjE,IAAKgV,EACD,MAAO,GACX,IA4DWE,EA5DPC,EAAkB,CAClBnV,WAAYA,EACZnG,QAASmG,EAAW9rB,UAAU2lB,SAkBlC,OAAOmb,EACFtyB,KAjBqB,SAAUkF,GAMhC,OAJcA,EAAKqP,QAAQxU,EAAaud,GAEZ+U,EAASK,kBAAkB77B,MAElCmJ,KAAI,SAAUJ,GAC/B,IAAI0xB,GAAW,QAAO,CAClB38B,KAAMuQ,EAAKvQ,KACXg+B,UAAW,CAAEN,SAAUA,EAASx7B,KAAMqL,QAAStC,IAChD6yB,GACC3zB,EAAQuzB,EAASK,kBAAkBv+B,QAAU,UAA4ByL,EAAKd,MAAMC,KAAO,KAC3F6zB,EAAiB,IAAI,IAAetV,EAAYxe,EAAOoG,EAAMosB,GACjE,MAAO,CAAEpsB,KAAMA,EAAMtF,KAAMA,EAAMgzB,eAAgBA,SAKpD3yB,OAAO,KAAS,IAChB4c,MAqCM2V,EArCSH,EAASQ,iBAsCR,IAArBL,IAA+BA,GAAmB,GAC/C,SAA+B1O,EAAGlV,GACrC,IAAIkkB,EAASN,GAAoB,EAAI,EACjCO,GAAcjP,EAAElkB,KAAKd,MAAMtF,KAAKiH,OAASmO,EAAEhP,KAAKd,MAAMtF,KAAKiH,QAAUqyB,EACzE,OAAsB,IAAfC,EAAmBA,EAAankB,EAAE1J,KAAKzM,SAAWqrB,EAAE5e,KAAKzM,YAzC3DuH,KAAI,SAAU8E,GAAS,OAAOA,EAAM8tB,mBAa7CZ,EAAY9+B,UAAUq/B,iBAAmB,SAAUF,EAAUtyB,EAAaud,GACtE,IAAI0V,EAAWX,EAASY,YAAc,WAElC/6B,EAAe7G,KAAKisB,WAAWvX,OAAOoY,kBAE1C,OADiB6U,EAAW,CAAC96B,GAAgB,CAAC7G,KAAKisB,WAAYplB,IAE1D8H,KAAI,SAAUkzB,GAAO,OAAOA,EAAIC,SAASd,EAASx7B,SAClD8D,QAAO,QAAgB,KAAS,uBAAyB03B,EAASx7B,OAClEoJ,OAAO,KAAS,IAChBtF,QAAO,SAAUuK,GAAQ,OAAOA,EAAKqP,QAAQxU,EAAaud,OAE5D0U,EA7EqB,+PCDzB,SAASoB,EAAWt0B,EAAOu0B,EAAW/V,GACzC,IAAIgW,GAAU,QAASD,GAAa,CAACA,GAAaA,EAYlD,UADe,QAAWC,GAAWA,EAVrC,SAAoBhV,GAEhB,IADA,IAAIiV,EAAcD,EACT5kB,EAAI,EAAGA,EAAI6kB,EAAY9yB,OAAQiO,IAAK,CACzC,IAAIwF,EAAO,IAAI,KAAKqf,EAAY7kB,IAChC,GAAKwF,GAAQA,EAAKK,QAAQ+J,EAAOznB,QAAYqd,GAAQqf,EAAY7kB,KAAO4P,EAAOznB,KAC3E,OAAO,EAGf,OAAO,IAGMiI,EAAOwe,GAK5B,IAAIkW,EAAgC,WAChC,SAASA,EAAeC,EAASC,EAAW7hC,EAAU8hC,EAAeC,EAAwBpiC,QACzE,IAAZA,IAAsBA,EAAU,IACpCH,KAAKoiC,QAAUA,EACfpiC,KAAKqiC,UAAYA,EACjBriC,KAAKQ,SAAWA,EAChBR,KAAKsiC,cAAgBA,EACrBtiC,KAAKuiC,uBAAyBA,EAC9BviC,KAAKwiC,YAAc,EACnBxiC,KAAKyiC,eAAgB,EACrBziC,KAAKoH,SAAWjH,EAAQiH,UAAY,EACpCpH,KAAKsD,KAAOnD,EAAQmD,MAAQ,KAC5BtD,KAAK0iC,YAAcviC,EAAQuiC,YAqF/B,OApEAP,EAAetgC,UAAU8gC,eAAiB,SAAUC,EAAOZ,EAAW/V,GAClE,IAAkB,IAAd+V,EACA,OAAOY,EACX,IAAIpN,EAAWoN,EAAMt5B,QAAO,SAAUiF,GAAQ,OAAOwzB,EAAWxzB,EAAKd,MAAOu0B,EAAW/V,MACvF,OAAOuJ,EAASpmB,OAASomB,EAAW,MAgBxC2M,EAAetgC,UAAUghC,yBAA2B,WAChD,OAAO,QAAO7iC,KAAKoiC,QAAQp4B,WAAW84B,iBAAiB,WAAc,OAAO,MAiBhFX,EAAetgC,UAAUkhC,kBAAoB,SAAUr0B,EAAaud,GAChE,IAAI9b,EAAQnQ,KACR8P,GAAW,QAAO9P,KAAK6iC,2BAA4B7iC,KAAKsiC,eAE5D,OADY,QAAOtiC,KAAKoiC,QAAQp4B,WAAW84B,iBAC9Bl0B,QAAO,SAAUo0B,EAAIC,GAG9B,IAAIC,EAAcD,EAASngC,QAAU,UACjCqF,EAAOuG,EAAYu0B,EAASz9B,OAAS,GACrCo9B,EAAQM,EAAc/6B,EAAO,EAAC,QAAKA,IAEvC,OADA66B,EAAGC,EAASz9B,MAAQ2K,EAAMwyB,eAAeC,EAAO9yB,EAASmzB,EAASz9B,MAAOymB,GAClE+W,IACR,KAQPb,EAAetgC,UAAUqhB,QAAU,SAAUxU,EAAaud,GACtD,IAAI/I,EAAUljB,KAAK+iC,kBAAkBr0B,EAAaud,GAGlD,OADiB,QAAO/I,GAASigB,MAAM,MACnBjgB,EAAU,MAElCif,EAAetgC,UAAU28B,WAAa,WAClCx+B,KAAKuiC,uBAAuBviC,MAC5BA,KAAKyiC,eAAgB,GAElBN,EAjGwB,GAqG5B,SAASiB,EAAUtP,EAAUhH,EAAmBuV,GAEnD,IACIgB,GADoBvP,EAASwP,iBAAmBxP,EAASwP,kBAAoB,IACnDjB,EAAU78B,MAAQ,GAC5C+9B,GAAe,QAAWF,GAG9B,SAASG,EAAmBC,EAAajjC,EAAUL,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAI6pB,EAAiB,IAAImY,EAAerV,EAAmBuV,EAAW7hC,EAAUijC,EAAaF,EAAcpjC,GAE3G,OADAkjC,EAAM5iC,KAAKupB,GACJA,EAAewU,WAAWl7B,KAAK0mB,GAE1C,OAPA8J,EAASuO,EAAU78B,MAAQg+B,EAOpBA,2FCpJX,IAAIE,EAQAC,2BAPJ,SAAWD,GACPA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAAyB,IAAI,GAAK,MACtDA,EAAoBA,EAA6B,QAAI,GAAK,UAC1DA,EAAoBA,EAA2B,MAAI,GAAK,QAL5D,CAMGA,IAAwBA,EAAsB,KAEjD,SAAWC,GACPA,EAAoBA,EAAgC,WAAI,GAAK,aAC7DA,EAAoBA,EAA2B,MAAI,GAAK,QAF5D,CAGGA,IAAwBA,EAAsB,8HCP7CC,2LACJ,SAAWA,GAOPA,EAAWA,EAAuB,WAAI,GAAK,aAM3CA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAoB,QAAI,GAAK,UAWxCA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAkB,MAAI,GAAK,QApC1C,CAqCGA,IAAeA,EAAa,KAG/B,IAAIv4B,EAAK,EACLw4B,EAA2B,WAC3B,SAASA,EAAU30B,EAAM40B,EAASC,GAE9B/jC,KAAKmb,IAAM9P,IACXrL,KAAKkP,KAAOA,EACZlP,KAAK8jC,QAAUA,EACf9jC,KAAK+jC,OAASA,EA4DlB,OAzDAF,EAAUG,mBAAqB,SAAU/pB,GACrC,OAAOA,GAA2B,mBAAbA,EAAIlP,OAAuB,IAAAmO,IAAG2qB,EAAH,CAAc5pB,EAAIyN,uBAGtEmc,EAAUI,WAAa,SAAUF,EAAQ5jC,GACrC,IACI+jC,EAAY,IAAIL,EAAUD,EAAWO,WAD3B,+DACgDJ,GAI9D,OAHI5jC,GAAWA,EAAQikC,aACnBF,EAAUE,YAAa,GAEpBF,GAGXL,EAAUO,WAAa,SAAUL,GAC7B,OAAOF,EAAUI,WAAWF,EAAQ,CAAEK,YAAY,KAGtDP,EAAUQ,QAAU,SAAUN,GAE1B,OAAO,IAAIF,EAAUD,EAAWU,QADlB,6BACoCP,IAGtDF,EAAUzK,QAAU,SAAU2K,GAE1B,OAAO,IAAIF,EAAUD,EAAWW,QADlB,6BACoCR,IAGtDF,EAAUW,QAAU,SAAUT,GAE1B,OAAO,IAAIF,EAAUD,EAAWa,QADlB,kCACoCV,IAGtDF,EAAUa,QAAU,SAAUX,GAE1B,OAAO,IAAIF,EAAUD,EAAWe,MADlB,yBACkCZ,IAWpDF,EAAUe,UAAY,SAAUb,GAC5B,OAAO,IAAA7qB,IAAG2qB,EAAH,CAAcE,GAAUA,EAASF,EAAUa,QAAQX,IAE9DF,EAAUhiC,UAAUiT,SAAW,WAC3B,IAA6BqkB,EACzB4K,GADyB5K,EACHn5B,KAAK+jC,SADgB5K,EAAErkB,WAAavB,OAAO1R,UAAUiT,SAAWqkB,EAAErkB,YAAa,QAAUqkB,GAE/G9N,EAAKrrB,KACT,MAAO,6BADcqrB,EAAGlQ,IACoB,UADRkQ,EAAGnc,KACwB,cADRmc,EAAGyY,QAC+B,aAAeC,EAAS,KAErHF,EAAUhiC,UAAUgjC,UAAY,WAC5B,OAAO,SAAO,QAAgB7kC,MAAO,CAAE0nB,qBAAsB1nB,QAE1D6jC,EAlEmB,oMC1C1BiB,EAEA,SAA6Bt/B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QACpG,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5CllC,KAAKwF,KAAOA,EACZxF,KAAK4hC,UAAYA,EACjB5hC,KAAK+kC,UAAYA,EACjB/kC,KAAKqhC,kBAAoBA,EACzBrhC,KAAKwhC,YAAcA,EACnBxhC,KAAKglC,iBAAmBA,EACxBhlC,KAAKilC,gBAAkBA,EACvBjlC,KAAKklC,YAAcA,gsBCVvBC,EAAiB,CACjBrf,QAAS,KACTmG,WAAY,KACZqV,UAAW,GACXh+B,KAAM,MAEN8hC,EAAgC,WAChC,SAASA,EAAenZ,EAAYoZ,EAAcrb,EAAgB7pB,GAC9D,IAAIgQ,EAAQnQ,KACZA,KAAKisB,WAAaA,EAClBjsB,KAAKqlC,aAAeA,EACpBrlC,KAAKgqB,eAAiBA,EACtBhqB,KAAKG,QAAUA,EACfH,KAAKslC,aAAe,WAAc,OAAOn1B,EAAMjB,KAAK0yB,YAAc,UAA4BzxB,EAAMhQ,QAAQ8rB,WAAWsZ,YACvHvlC,KAAKG,SAAU,QAASA,EAASglC,GACjCnlC,KAAKkP,KAAO8a,EAAeqY,UAyK/B,OArJA+C,EAAenJ,MAAQ,SAAUoH,EAAOmC,GAGpC,OAAOnC,EAAMz0B,QADU,SAAU8vB,EAAM+G,GAAY,OAAO/G,EAAK3zB,MAAK,WAAc,OAAO06B,EAASC,kBAC5DF,GAAW,gBAarDJ,EAAeO,YAAc,SAAUtC,EAAOuC,GAC1C,IAAK,IAAI32B,EAAM,EAAGA,EAAMo0B,EAAMj0B,OAAQH,IAAO,CACzC,IAAIib,EAAamZ,EAAMp0B,GAAKy2B,aAC5B,IAAI,QAAUxb,GAAa,CACvB,IAAI2b,EAAiBxC,EAAMvhC,MAAMmN,EAAM,GACvC,OAAOm2B,EAAenJ,MAAM4J,EAAgB3b,GAAYnf,KAAK66B,IAGrE,OAAOA,KAKXR,EAAeU,YAAc,SAAUzC,GACnCA,EAAMtiC,SAAQ,SAAU8S,GAAQ,OAAOA,EAAK6xB,iBAEhDN,EAAevjC,UAAUkkC,SAAW,SAAU7Y,GAC1CltB,KAAKisB,WAAWvX,OAAOmC,aAAamvB,qBAApChmC,CAA0DktB,IAE9DkY,EAAevjC,UAAU6jC,WAAa,WAClC,IAAIv1B,EAAQnQ,KACR6T,EAAO7T,KAAKgqB,eAChB,IAAInW,EAAK4uB,cAAT,CAEA,IAAIwD,EAAajmC,KAAKkmC,yBACtB,GAAID,EACA,OAAOA,EACX,IAAI9lC,EAAUH,KAAKG,QACnB,yBAA0BH,KAAMA,KAAKisB,WAAY9rB,GACjD,IAEIgmC,EAAc,SAAUjZ,GAAO,OAAOrZ,EAAKwuB,UAAU4C,gBAAgB90B,EAA/B0D,CAAsCqZ,IAC5EkZ,EAAe,SAAU9/B,GAAU,OAAOuN,EAAKwuB,UAAU2C,iBAAiB70B,EAAhC0D,CAAuCvN,IACrF,IACI,IAAIA,EALkCuN,EAAKrT,SAASuB,KAAK5B,EAAQmD,KAAM6M,EAAM8b,WAAY9b,EAAMk1B,cAM/F,OAAKrlC,KAAKkP,KAAKg2B,cAAe,QAAU5+B,GAC7BA,EAAO+b,OANH,SAAU6K,GAAO,OAAO,cAAoBA,GAAK2X,eAM1B95B,KAAKq7B,EAAcD,GAG9CC,EAAa9/B,GAG5B,MAAO4mB,GAEH,OAAOiZ,EAAY,cAAoBjZ,IAE3C,QACQrZ,EAAK6uB,eAAiB7uB,EAAK2uB,aAAe3uB,EAAK6uB,aAC/C7uB,EAAK2qB,gBAajB4G,EAAevjC,UAAUwkC,iBAAmB,SAAU//B,GAClD,IAAI6J,EAAQnQ,KAEZ,OADiBA,KAAKkmC,4BAIlB,QAAU5/B,GAEHA,EAAOyE,MAAK,SAAU/G,GAAO,OAAOmM,EAAMk2B,iBAAiBriC,OAEtE,qBAAsBsC,EAAQtG,KAAKisB,WAAYjsB,KAAKG,UAErC,IAAXmG,EAEO,YAAkB,2BAA2Bu+B,aAEpC,IAAA3rB,IAAG,IAEnBotB,CAAchgC,GAEP,eAAqBA,GAAQu+B,iBAFxC,KASJO,EAAevjC,UAAUqkC,uBAAyB,WAC9C,IAAIxxB,EAAS1U,KAAKisB,WAAWvX,OAE7B,OAAIA,EAAOqkB,UACA,YAAkB,sBAAwBrkB,EAAOyG,IAAM,gCAAgC0pB,YAE9F7kC,KAAKisB,WAAWsa,SACT,cAAoB1B,YAI3B7kC,KAAKslC,eAEE,eAAqBtlC,KAAKG,QAAQ2lB,WAAW+e,iBAFxD,GAKJO,EAAevjC,UAAUiT,SAAW,WAChC,IAAe3U,EAANH,KAAmBG,QAAS6pB,EAA5BhqB,KAAgDgqB,eACrDzpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAWwkB,EAAexpB,UAC/M,OAAOD,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,IAMlE4/B,EAAeoB,cAAgB,SAAU3yB,GAAQ,OAAO,SAAUvN,GAC9D,OAAOuN,EAAKwyB,iBAAiB//B,KAMjC8+B,EAAeqB,oBAAsB,SAAU5yB,GAAQ,OAAO,SAAUvN,IACpE,QAAUA,IAAWA,EAAO+b,OAAM,SAAU6K,GAAO,OAAOrZ,EAAKkyB,SAAS,cAAoB7Y,SAOhGkY,EAAesB,UAAY,SAAU7yB,GAAQ,OAAO,SAAUxO,GAAS,OAAOwO,EAAKkyB,SAAS1gC,KAC5F+/B,EAAeuB,aAAe,SAAU9yB,GAAQ,OAAO,SAAUxO,GAAS,OAAO,QAAgBA,KACjG+/B,EAAewB,YAAc,SAAU/yB,GAAQ,OAAO,SAAUxO,GAC5D,MAAMA,IAEH+/B,EAlLwB,qgBCXnC,SAASyB,EAAmBj3B,GACxBA,EAAMk3B,cAAc,cAAoB,IAAUl3B,EAAM8E,QAAS,IACjE9E,EAAMk3B,cAAc,cAAoB,IAAYl3B,GAAQ,IAC5DA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,GAAQ,IAChEA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,EAAMxB,UAAW,IACzEwB,EAAMuc,WAAWprB,SAAQ,SAAU0M,GAC/BmC,EAAMk3B,cAAc,cAAoB,UAAWr5B,GAAQA,MAG5D,IAGHs5B,EAAoB,CAAC,eAAgB,KACrCC,GAAe,QAAQD,GAKhBE,EAAqB,SAAUr3B,GACtC,IAAIgzB,GAAQ,QAAOhzB,EAAMlB,eAAeE,OAAO,KAAS,IAAIA,OAAO,KAAO,IAEtEs4B,EAA4B,SAAU3pB,GACtC,OAAOypB,EAAazpB,EAAEgE,OAAS,cAAoBhE,EAAEgE,MAAO,MAAQhE,GAExEqlB,EAAM7hC,SAAQ,SAAUwN,GACpBA,EAAKwJ,YAAcxJ,EAAKwJ,YAAYpJ,IAAIu4B,+MCnB5CC,EAAiB,SAAUv3B,GAC3B,IAAIw3B,EAAWx3B,EAAMuf,KAAKkY,WAC1B,GAAKD,EAAL,CAEA,IAAI3uB,EAAS7I,EAAM8E,OAAOmC,aAW1B,OAAI,QAAWuwB,GACJ,YAAiBA,EAASx3B,IAAQ7E,KAAKq7B,GAE3CA,EAAagB,GAbpB,SAAShB,EAAa9/B,GAClB,GAAKA,EAEL,OAAIA,aAAkB,IACXA,GACP,QAASA,GACFmS,EAAOpS,OAAOC,EAAQsJ,EAAMxB,SAAUwB,EAAMzP,WACnDmG,EAAc,OAAKA,EAAe,OAC3BmS,EAAOpS,OAAOC,EAAc,OAAKsJ,EAAMuf,KAAM7oB,EAAe,QAAKsJ,EAAMxB,SAAUwB,EAAMzP,gBADlG,IChBR,SAASmnC,EAAwB3zB,GAC7B,OAAO,SAAUsY,EAAYxe,GAGzB,OAAO85B,EAFM95B,EAAMuG,UACCL,IACNsY,EAAYxe,IAYlC,IAAI+5B,EAAaF,EAAwB,UAarCG,EAAeH,EAAwB,YAavCI,EAAcJ,EAAwB,2MC7C/BK,EAAwB,IAU/BC,EAAmB,SAAUh4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,QAAS9nB,GAAO7E,KAAK,OAcnF88B,EAAmB,SAAUj4B,EAAOnC,GACpC,OAAO,IAAI,IAAemC,EAAMlB,cAAcygB,IAAIpb,WAAWtG,EAAMuG,WAAW0jB,YAAY,OAAQ9nB,GAAO7E,KAAK,OAe9G+8B,EAAmB,SAAUl4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,OAAQ9nB,GAAO7E,KAAK,OCnClFg9B,EAAoB,SAAU9b,GAC9B,IAAIllB,EAAK,OACLihC,EAAgB/b,EAAWzR,MAAM,YACrC,GAAKwtB,EAAc54B,OAEnB,OAAOrI,EAAG0U,IAAIusB,EAAcr5B,KAAI,SAAUmL,GAAQ,OAAO/S,EAAGkJ,KAAK6J,EAAKuB,YAAatQ,KAAK,OAexFk9B,EAAgB,SAAUhc,GAC1B,IAAI+b,EAAgB/b,EAAWzR,MAAM,YACjC0tB,EAAejc,EAAWzR,MAAM,WACpC,GAAKwtB,EAAc54B,QAAW84B,EAAa94B,OAA3C,CAEA,IAAItI,EAAQmlB,EAAWvX,OAAOqC,YAC9BmxB,EAAannC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMshC,qBAAqBD,MACvEH,EAAcjnC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMuhC,mBAAmBF,MACtErhC,EAAM8lB,SCzBN0b,EAAoB,SAAU14B,GAC9B,IAAI0I,EAAU1I,EAAM8E,OAAO4D,QAOvBiwB,EAAyB,WAErBjwB,EAAQ2T,aAAerc,IACvB0I,EAAQ2T,WAAa,OAE7Brc,EAAM7B,UAAU,IAXW,WACvBuK,EAAQ0T,sBAAsBxG,QAAQ5V,GACtC0I,EAAQwa,SAAWljB,EAAMmjB,MACzBza,EAAQwN,QAAUxN,EAAQwa,SAASplB,MACnC,QAAKkC,EAAMxB,SAAUkK,EAAQlK,UAOS,CAAEhH,SAAU,MACtDwI,EAAMnM,QAAQsH,KAAKw9B,EAAwBA,ICtB3CC,EAAY,SAAUvc,GACtB,IAAI9rB,EAAU8rB,EAAW9rB,UACrBsY,EAASwT,EAAWvX,OAAOmC,aAC3B6B,EAAauT,EAAWvX,OAAOyH,UAKnC,GAAuB,QAAnBhc,EAAQ4e,QAAoB5e,EAAQ0V,UAAY4C,EAAOqa,SAASsH,UAAW,CAC3E,IAAIqO,EAAa,CAAE1zB,QAA8B,YAArB5U,EAAQ0V,UACpC6C,EAAWjY,KAAKgY,EAAOqa,SAASsH,UAAU3oB,IAAKgH,EAAOrK,OAAQq6B,GAElE/vB,EAAW0D,QAAO,kWCPtB,SAASssB,EAAY94B,GACjB,IAAI+4B,EAAgB/4B,EAAMg5B,iBAC1B,GAAKD,EAAL,CAEAtgC,EAAA,0BAA6BuH,GAC7B,IAAIi5B,EAAUj5B,EAAM8E,OAAO4D,QAAQ2T,WAOnC,MAHsB,kBAAlB0c,GAAqCE,GACrCA,EAAQC,QAEL,cAAoBjE,aCf/B,SAASkE,EAAsBn5B,GAC3B,IAAKA,EAAMywB,QACP,MAAM,IAAI5tB,MAAM7C,EAAMvK,QAAQyP,YAG/B,ICaIk0B,EAAmB,CAC1BnzB,UAAU,EACVsqB,SAAU,KACV/gB,SAAS,EACT6pB,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,OAAQ,GACRtjB,QAAS,WAAc,OAAO,MAC9B/G,OAAQ,WAaRsqB,EAAmC,WAEnC,SAASA,EAAkBC,GAEvBtpC,KAAKupC,iBAAmB,EAExBvpC,KAAKwpC,YAAc,GAEnBxpC,KAAKsjC,iBAAmB,GAExBtjC,KAAKypC,eAAiB,GACtBzpC,KAAKspC,QAAUA,EACftpC,KAAK8G,MAAQwiC,EAAQvyB,YACrB/W,KAAK0pC,mBAAqB,GAC1B1pC,KAAKgK,YAAc,SAAqB,QAAIhK,MAAO,IAAI,QAAIA,MAAO,CAC9D,kBACA,eACA,gBACA,aACA,aAEJA,KAAK2pC,mBACL3pC,KAAK4pC,oBACL5pC,KAAK6pC,+BACLP,EAAQhxB,QAAQ0T,sBAAsBzG,QAAQ0hB,GAuLlD,OA9JAoC,EAAkBxnC,UAAUioC,SAAW,SAAUh6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkO,SAAW,SAAUD,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkoC,QAAU,SAAUj6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUmoC,OAAS,SAAUl6B,EAAUtP,EAAUL,KAInEkpC,EAAkBxnC,UAAUooC,SAAW,SAAUn6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUqoC,QAAU,SAAUp6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUsoC,SAAW,SAAUr6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkM,UAAY,SAAU+B,EAAUtP,EAAUL,KAItEkpC,EAAkBxnC,UAAUuoC,QAAU,SAAUt6B,EAAUtP,EAAUL,KAOpEkpC,EAAkBxnC,UAAUqT,QAAU,SAAUR,IAC5C,QAAO1U,KAAKsjC,kBAAkBviC,SAAQ,SAAUspC,GAC5C,OAAOA,EAAWtpC,SAAQ,SAAU8S,GAChCA,EAAK4uB,eAAgB,GACrB,QAAW4H,EAAYx2B,UAenCw1B,EAAkBxnC,UAAUL,OAAS,SAAUyyB,EAAUzH,GACrD,OAAO,IAAI,IAAWyH,EAAUzH,EAAaxsB,KAAKspC,UAGtDD,EAAkBxnC,UAAU+nC,kBAAoB,WAC5C,IAAIU,EAAQ,IACRC,EAAK,IACLC,EAAQxqC,KAAKypC,eACbgB,GAAc,EACdC,GAAc,EAClB1qC,KAAK2qC,aAAa,WAAYL,EAAMM,OAAQ,EAAGJ,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG3D,YAAa8D,GAC9G1qC,KAAK2qC,aAAa,WAAYL,EAAMO,OAAQ,EAAGL,EAAMrb,IACrDnvB,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,EAAGN,EAAMrb,IACjDnvB,KAAK2qC,aAAa,SAAUL,EAAMQ,IAAK,IAAKN,EAAMv8B,SALV,GAMxCjO,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrV,UACpDn1B,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,IAAKN,EAAMre,UACnDnsB,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrb,IACpDnvB,KAAK2qC,aAAa,YAAaL,EAAMS,QAAS,EAAGP,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,GAC9G1qC,KAAK2qC,aAAa,UAAWL,EAAM3F,MAAO,EAAG6F,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,IAG9GrB,EAAkBxnC,UAAU8nC,iBAAmB,WAC3C,IAAIqB,EAAQ,UAA2BrhB,EAAa,eACpD3pB,KAAKirC,gBAAgB,KAAMthB,GAC3B3pB,KAAKirC,gBAAgB,OAAQthB,GAC7B3pB,KAAKirC,gBAAgB,UAAWD,GAChChrC,KAAKirC,gBAAgB,WAAYD,GACjChrC,KAAKirC,gBAAgB,WAAYD,IAGrC3B,EAAkBxnC,UAAU8oC,aAAe,SAAUnlC,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QAC5H,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5C,IAAI7C,EAAY,IAAI,IAAoB78B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,GACvIllC,KAAKwpC,YAAY/oC,KAAK4hC,IACtB,QAAUriC,KAAMA,KAAMqiC,IAG1BgH,EAAkBxnC,UAAUi/B,WAAa,SAAUD,GAI/C,QAH0B,QAAUA,GAC9B7gC,KAAKwpC,YAAYlgC,QAAO,SAAU4F,GAAQ,OAAOA,EAAK0yB,YAAcf,KACpE7gC,KAAKwpC,YAAY1nC,SACI0pB,MAAK,SAAUiH,EAAGlV,GACzC,IAAI2tB,EAAazY,EAAEmP,UAAYrkB,EAAEqkB,UACjC,OAAsB,IAAfsJ,EAAmBzY,EAAEsS,UAAYxnB,EAAEwnB,UAAYmG,MAgB9D7B,EAAkBxnC,UAAUopC,gBAAkB,SAAUzlC,EAAM2lC,GAC1DnrC,KAAKypC,eAAejkC,GAAQ,CAAEA,KAAMA,EAAM1C,MAAOqoC,IAIrD9B,EAAkBxnC,UAAUihC,cAAgB,WACxC,OAAO9iC,KAAKypC,gBAGhBJ,EAAkBxnC,UAAUigC,SAAW,SAAUnuB,GAC7C,OAAO3T,KAAKsjC,iBAAiB3vB,IAGjC01B,EAAkBxnC,UAAUgoC,6BAA+B,WACvD,IAAIuB,EAAMprC,KAAK0pC,mBACf0B,EAAIC,gBAA6CrrC,KTzN5B8pC,SAAS,GAAIjD,GS0NlCuE,EAAIhS,QAAwCp5B,KF/MvB+P,SAAS,GAAI24B,EAAa,CAAEthC,UAAW,OEgN5DgkC,EAAI/G,QD7N+B,SAAUvX,GACjD,OAAOA,EAAkB/c,SAAS,GAAIg5B,EAAuB,CAAE3hC,UAAW,MC4NxDkkC,CAA8BtrC,MAE5CorC,EAAI/D,WR7MwB,SAAUva,GAC1C,OAAOA,EAAkBid,QAAQ,CAAE5a,GAAI,SAAU1hB,GAAS,QAASA,EAAM45B,aAAiBF,GQ4MrEoE,CAAuBvrC,MAExCorC,EAAIpB,OPtNoB,SAAUld,GACtC,OAAOA,EAAkBkd,OAAO,CAAE/7B,QAAS,SAAUR,GAAS,QAASA,EAAMu8B,SAAaxC,GOqNzEgE,CAAmBxrC,MAChCorC,EAAInB,SP1MsB,SAAUnd,GACxC,OAAOA,EAAkBmd,SAAS,CAAE9U,SAAU,SAAU1nB,GAAS,QAASA,EAAMw8B,WAAexC,GOyM5EgE,CAAqBzrC,MACpCorC,EAAIlB,QP9LqB,SAAUpd,GACvC,OAAOA,EAAkBod,QAAQ,CAAE/d,SAAU,SAAU1e,GAAS,QAASA,EAAMy8B,UAAcxC,GO6L3EgE,CAAoB1rC,MAElCorC,EAAIO,aNjO0B,SAAU7e,GAC5C,OAAOA,EAAkBid,QAAQ,GAAInC,EAAkB,CAAExgC,SAAUugC,IMgO5CiE,CAAyB5rC,MAC5CorC,EAAIS,YNnN0B,SAAU/e,GAC5C,OAAOA,EAAkBod,QAAQ,CAAE/d,UAAU,SAAI,IAAS0b,EAAkB,CAAEzgC,SAAUugC,IMkNlEmE,CAAyB9rC,MAC3CorC,EAAIW,WNpM0B,SAAUjf,GAC5C,OAAOA,EAAkBqd,SAAS,GAAIrC,EAAkB,CAAE1gC,SAAUugC,IMmM/CqE,CAAyBhsC,MAE1CorC,EAAIa,ULpO2B,SAAUnf,GAC7C,OAAOA,EAAkBqd,SAAS,GAAIpC,GKmOlBmE,CAA0BlsC,MAC1CorC,EAAInD,cL9MuB,SAAUnb,GACzC,OAAOA,EAAkB/e,UAAU,GAAIk6B,GK6MfkE,CAAsBnsC,MAE1CorC,EAAIgB,cJ3N2B,SAAUtf,GAC7C,OAAOA,EAAkBgd,SAAS,GAAIxB,GI0Nd+D,CAA0BrsC,MAE9CorC,EAAI5C,UHvOmB,SAAU1b,GACrC,OAAOA,EAAkB/e,UAAU,GAAIy6B,EAAW,CAAEphC,SAAU,OGsO1CklC,CAAkBtsC,MAElCorC,EAAIhf,UAAW,OAAqBpsB,OAEjCqpC,EA/M2B,mSChClCkD,EAA2B,WACV,SAASA,EAA2B73B,GACjD,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKouB,WAAa,IAAI,EAAAiD,WACtBrxB,KAAKkX,eAAgB,EACrBlX,KAAKwsC,oBAAqB,EAC1BxsC,KAAKysC,eAAgB,EACrBzsC,KAAK0sC,sBAAuB,EAC5B1sC,KAAKkV,QAAU,WAAc,OAAO/E,EAAMie,WAAWlZ,WAOtElV,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuE,OAAO2C,eAAe5B,YAUjEzV,KAAK2sC,WAAa,SAAUC,GAAa,OAAOz8B,EAAMuE,OAAO2C,eAAes1B,WAAWC,IAMvF5sC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMuE,OAAO2C,eAAew1B,QAM7D7sC,KAAKqV,UAAY,WAAc,OAAOlF,EAAMuE,OAAO2C,eAAehC,aAMlErV,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMuE,OAAO2C,eAAey1B,QAM7D9sC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMuE,OAAO2C,eAAe01B,YAwFrE,OA1EAR,EAAU1qC,UAAUmrC,gBAAkB,SAAUxoC,GAC5C,OAAQxE,KAAKwsC,oBAAqB,QAAUhoC,GAASA,EAAQxE,KAAKwsC,oBAmBtED,EAAU1qC,UAAUotB,oBAAsB,SAAUzqB,GAChD,IAAI,QAAUA,KAAoB,IAAVA,IAA4B,IAAVA,KAAoB,QAASA,GACnE,MAAM,IAAIiO,MAAM,0BAA4BjO,EAAQ,mDACxD,OAAQxE,KAAK0sC,sBAAuB,QAAUloC,GAASA,EAAQxE,KAAK0sC,sBAcxEH,EAAU1qC,UAAUorC,WAAa,SAAUzoC,GACvC,OAAQxE,KAAKysC,eAAgB,QAAUjoC,GAASA,EAAQxE,KAAKysC,eAgCjEF,EAAU1qC,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACnD,IAAItiB,EAAOlP,KAAKouB,WAAWlf,KAAK1J,EAAMiU,EAAY+X,GAClD,OAAQ,QAAU/X,GAAqBzZ,KAAPkP,GAE7Bq9B,EA1ImB,0SCf1BW,EAAsC,WAStC,OARAA,EAAW35B,OAAO3Q,QAAU,SAASic,GACjC,IAAK,IAAIzB,EAAGC,EAAI,EAAGkD,EAAIve,UAAUoN,OAAQiO,EAAIkD,EAAGlD,IAE5C,IAAK,IAAIwd,KADTzd,EAAIpb,UAAUqb,GACO9J,OAAO1R,UAAUa,eAAeX,KAAKqb,EAAGyd,KACzDhc,EAAEgc,GAAKzd,EAAEyd,IAEjB,OAAOhc,IAEK1c,MAAMnC,KAAMgC,YAK5BmrC,EAA8B,WAC9B,SAASA,EAAaz4B,GAClB1U,KAAK0U,OAASA,EAWlB,OATAy4B,EAAatrC,UAAU+O,WAAa,SAAUvF,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE9E0/B,EAAatrC,UAAUoyB,SAAW,SAAU5oB,EAAI6D,EAAMzB,GAClD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,KAAcntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE5E0/B,EAAatrC,UAAUurC,WAAa,SAAU/hC,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAEvE0/B,EAbsB,GAsB7BE,EAAmC,WAEnC,SAASA,EAAmC34B,GACxC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAEd1U,KAAK07B,aAAe,IAAIyR,EAAantC,KAAK0U,QAE1C1U,KAAKstC,WAAa,IAClBttC,KAAKqtB,MAAQ,EAAAA,MAEbrtB,KAAKgtC,gBAAkB,SAAUxoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAOyhC,gBAAgBxoC,IAEhGxE,KAAKivB,oBAAsB,SAAUzqB,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0jB,oBAAoBzqB,IAExGxE,KAAKitC,WAAa,SAAUzoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0hC,WAAWzoC,IAEtFxE,KAAKkP,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpC,OAAOrhB,EAAMuE,OAAOuC,WAAW1L,OAAO2D,KAAK1J,EAAMiU,EAAY+X,IAAiBrhB,GA+CtF,OArCAk9B,EAAkBxrC,UAAUwF,QAAU,SAAUid,EAAS/Y,GACrD,IAAI+hB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAEnC6C,EAAS7C,IAAWA,EAAOkC,OAASlC,EAAO6C,OAC/C7C,EAAS6C,EAAS8+B,EAAS,CAAEz/B,MAAO,CAAEW,OAAQA,IAAY7C,GAAUA,EACpE,IAAIgiC,EAAe,CACfC,OAAQlgB,EAAUmf,cAClBO,gBAAiB1f,EAAUkf,mBAC3BiB,aAAcngB,EAAUpW,eAE5B,OAAO,IAAI,IAAWoN,EAASgJ,EAAUc,WAAYpuB,KAAK07B,cAAc,QAAO6R,EAAchiC,KASjG8hC,EAAkBxrC,UAAUs4B,UAAY,SAAUuT,GAE9C,KAAK,QAASA,GACV,OAAO,EACX,IAAIpnC,GAAS,EAKb,OAJA,QAAQ,eAAsB,SAAUtC,EAAKwB,IACrC,QAAWxB,KACXsC,EAASA,IAAU,QAAUonC,EAAOloC,MAAU,QAAWkoC,EAAOloC,QAEjEc,GAGX+mC,EAAkBxrC,UAAUnB,KAAO,WAC/B,IAAI4sB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAGvC,OAFA+hB,EAAUc,WAAW5I,SAAU,EAC/B8H,EAAUc,WAAWqD,kBACdzxB,MAEJqtC,EAjE2B,kOCjBlCM,EAA2B,WAE3B,SAASA,EAA2Bj5B,GAChC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAGd1U,KAAK4sB,KAAO,SAAU1W,GAAO,OAAO/F,EAAMuE,OAAOuC,WAAW2V,KAAK1W,IAEjElW,KAAKsc,OAAS,SAAUhH,GAAW,OAAOnF,EAAMuE,OAAOuC,WAAWqF,OAAOhH,IAEzEtV,KAAK+c,eAAiB,SAAU9Q,GAAS,OAAOkE,EAAMuE,OAAOuC,WAAW8F,eAAe9Q,IAEvFjM,KAAKgc,MAAQ,SAAU4xB,GAAY,OAAOz9B,EAAMuE,OAAOuC,WAAW+E,MAAM4xB,IAGxE5tC,KAAKuH,QAAU,SAAUwU,GACrB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMpV,QAAQwU,IAGjD/b,KAAK4c,UAAY,SAAUb,GACvB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMC,UAAUb,IAGnD/b,KAAKw/B,WAAa,SAAUjjB,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAM6iB,WAAWjjB,IAEpFvc,KAAKuc,KAAO,SAAUA,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAMJ,KAAKA,IAExEvc,KAAK2c,MAAQ,WAAc,OAAOxM,EAAMuE,OAAOuC,WAAW0F,MAAMA,SAEhE3c,KAAKwrB,KAAO,SAAUqiB,GAAa,OAAO19B,EAAMuE,OAAOuC,WAAW0F,MAAM6O,KAAKqiB,IAE7E7tC,KAAKiQ,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAAW,OAAOgQ,EAAMuE,OAAOuC,WAAW0F,MAAM1M,KAAKwrB,EAAS1f,EAAS5b,IAC/GH,KAAK6+B,eAAiB,IAAI,IAAenqB,GAyE7C,OAtEAi5B,EAAU9rC,UAAUua,OAAS,SAAU0xB,GACnC,IAAIphB,EAAO1sB,KAAK0U,OAAO0C,gBACnB02B,EACA9tC,KAAK6V,SAAW6W,EAAKjb,MAGrBib,EAAKjb,QAAUzR,KAAK6V,UAExB6W,EAAKjb,IAAIzR,KAAK6V,UAAU,IAY5B83B,EAAU9rC,UAAUpB,KAAO,SAAUstC,EAAY3/B,EAAQjO,GACrD,IAAI4U,EAAU5U,KAAaA,EAAQ4U,QACnC/U,KAAK0U,OAAOuC,WAAWxF,IAAIs8B,EAAWnmB,OAAOxZ,GAAU,IAAK2G,IAqBhE44B,EAAU9rC,UAAUmsC,KAAO,SAAUD,EAAY3/B,EAAQjO,GACrD,IAAIsR,EAAMs8B,EAAWnmB,OAAOxZ,GAC5B,GAAW,MAAPqD,EACA,OAAO,KACXtR,EAAUA,GAAW,CAAE8tC,UAAU,GACjC,IAAIpmC,EAAM7H,KAAK0U,OAAOuC,WAAW1L,OAC7B2iC,EAAUrmC,EAAIwN,YAKlB,GAJK64B,GAAmB,OAARz8B,IACZA,EAAM,IAAM5J,EAAI8kC,aAAel7B,GAEnCA,EA1GR,SAAwBA,EAAKy8B,EAASD,EAAUx4B,GAC5C,MAAiB,MAAbA,EACOhE,EACPy8B,GACO,QAAqBz4B,GAAYhE,EACxCw8B,EACOx4B,EAAS3T,MAAM,GAAK2P,EACxBA,EAmGG08B,CAAe18B,EAAKy8B,EAAS/tC,EAAQ8tC,SAAUpmC,EAAI4N,aACpDtV,EAAQ8tC,WAAax8B,EACtB,OAAOA,EAEX,IAAI28B,GAASF,GAAWz8B,EAAM,IAAM,GAChC48B,EAAUxmC,EAAIilC,OACdA,EAAoB,KAAZuB,GAA8B,MAAZA,EAAkB,GAAK,IAAMA,EAC3D,MAAO,CAACxmC,EAAIklC,WAAY,MAAOllC,EAAIglC,OAAQC,EAAMsB,EAAO38B,GAAKwB,KAAK,KAEtEM,OAAO+6B,eAAeX,EAAU9rC,UAAW,oBAAqB,CAE5D6O,IAAK,WACD,OAAO1Q,KAAK0U,OAAOuC,WAAWoF,mBAElCkyB,YAAY,EACZC,cAAc,IAEXb,EA1GmB,2aCJ1Bc,EAAgC,WAChC,SAASA,EAAe/5B,GACpB1U,KAAK0U,OAASA,EAiKlB,OA/JA+5B,EAAe5sC,UAAUwF,QAAU,SAAU2J,GACzC,OAAOhR,KAAK0U,OAAOE,kBAAkBvN,QAAQ2J,IAEjDy9B,EAAe5sC,UAAUL,OAAS,SAAUsb,EAAMf,GAC9C,IAAI5L,EAAQnQ,KACRy9B,EAAU,YAAqBD,EAAqB,uBACpDkR,GAAW,QAAQ,CACnB,CAAC,KAAU,SAAUC,GAAS,OAAOD,EAASv+B,EAAM9I,QAAQsnC,MAC5D,EAAC,IAAAz1B,IAAG,KAAa,SAAUy1B,GAAS,OAAOx+B,EAAMy+B,eAAeD,EAAO5yB,KACvE,EAAC,IAAAkI,IAAGwZ,EAASD,GAAqB,SAAUmR,GAAS,OAAOx+B,EAAM0+B,UAAUF,EAAOx+B,EAAMuE,UACzF,EAAC,IAAAwE,IAAG/P,QAAS,SAAUwlC,GAAS,OAAOx+B,EAAM2+B,WAAWH,EAAO5yB,KAC/D,CAAC,KAAY,SAAU4yB,GAAS,OAAO,IAAIlyB,EAAYkyB,EAAO5yB,OAE9DQ,EAAOmyB,EAAS5xB,GACpB,IAAKP,EACD,MAAM,IAAI9J,MAAM,4BACpB,OAAO8J,GAsCXkyB,EAAe5sC,UAAU+sC,eAAiB,SAAUb,EAAYhyB,GAC5D,IAAIgzB,EAAWhzB,GACX,QAASA,KACTA,EAAU/b,KAAK0U,OAAOE,kBAAkBvN,QAAQ0U,KAChD,IAAA7C,IAAG,IAAH,CAAe6C,KACfgzB,EAAW,SAAU/yB,GAAS,OAAOD,EAAQ6L,OAAO5L,KAiBxD,IAAIgzB,EAAU,CAAEjB,WAAYA,EAAYkB,cAPxC,SAAuB7gC,GACnB,IAAI8gC,EAAWnB,EAAW1a,aAAa/pB,QAAO,SAAU0F,GAAS,OAAOA,EAAM4f,cAC9E,OAAKsgB,EAAS9/B,OAEA8/B,EAAS5lC,QAAO,SAAU0F,GAAS,OAAOZ,EAAOY,EAAM3D,OACtD+D,OAAS8/B,EAAS9/B,OAFtB,MAIuDF,KAAM,cAC5E,OAAO,QAAO,IAAIuN,GAjBlB,SAA2BhL,GACvB,IAAIrD,EAAS2/B,EAAWtkC,KAAKgI,EAAItJ,KAAMsJ,EAAI09B,OAAQ19B,EAAIqgB,MACvD,OAAOic,EAAWre,UAAUthB,IAAWA,IAeM2gC,GAAWC,IAahEP,EAAe5sC,UAAUgtC,UAAY,SAAUO,EAAa16B,GACxD,IAAIjH,EAAQ,uBAA+B2hC,GAAeA,EAAYp7B,UAAYo7B,EAe9EJ,EAAU,CAAEvhC,MAAOA,EAAOyB,KAAM,SACpC,OAAO,QAAOlP,KAAK4uC,eAAenhC,EAAMgE,KAR1B,SAAUuK,GACpB,IAAIvD,EAAS/D,EAAOmC,aAChByB,EAAU5D,EAAO4D,QACjBG,EAAOu1B,KAAKvgC,EAAOuO,KAAWvD,EAAOu1B,KAAK11B,EAAQwN,QAASxN,EAAQlK,SACnEqK,EAAO42B,aAAa5hC,EAAOuO,EAAO,CAAEoD,SAAS,EAAML,OAAQ,WAIZiwB,IAkC3DP,EAAe5sC,UAAUitC,WAAa,SAAU7rB,EAAQlH,GACpD,GAAIkH,EAAOnF,QAAUmF,EAAOqsB,OACxB,MAAM,IAAI78B,MAAM,4CAMpB,IAIIs8B,GAAW,QAAShzB,GAJJ,SAAUC,GAE1B,OAAOD,EAAQhH,QAAQ,kBAAkB,SAAUC,EAAG8H,GAAQ,OAAOd,EAAe,MAATc,EAAe,EAAIyyB,OAAOzyB,QAEtDf,EAE/CizB,EAAU,CAAE/rB,OAAQA,EAAQ/T,KAAM,UACtC,OAAO,QAAO,IAAIuN,GAFU,SAAUhL,GAAO,OAAOwR,EAAOxZ,KAAKgI,EAAItJ,QAEf4mC,GAAWC,IAEpEP,EAAee,UAAY,SAAUv1B,GAAO,OAAOA,GAAO,CAAC,OAAQ,QAAS,WAAWkpB,OAAM,SAAUt9B,GAAO,OAAO,QAAUoU,EAAIpU,QAC5H4oC,EAnKwB,GA4K/BhyB,EACA,SAAqBT,EAAOD,GACxB,IAAI5L,EAAQnQ,KACZA,KAAKgc,MAAQA,EACbhc,KAAKkP,KAAO,MACZlP,KAAKivC,cAAgB,SAAUjzB,GAAS,OAAO,EAAI7L,EAAMgL,KACzDnb,KAAK+b,QAAUA,GAAW,2GCnK9B0zB,sPAaJ,SAASC,EAAa3zB,GAClB,MAAK,QAAWA,KAAa,QAASA,KAAa,IAAA7C,IAAG,EAAA2mB,YAAH,CAAgB9jB,IAAa,EAAA8jB,YAAA,MAAkB9jB,IAC9F,MAAM,IAAItJ,MAAM,4FAEpB,OAAO,QAAWsJ,GAAWA,GAAU,QAAIA,GAhB/C0zB,EAAoB,SAAUhyB,EAAGmB,GAC7B,IAAI+wB,EA5BW,SAAUlyB,EAAGmB,GAAK,OAAQA,EAAExX,UAAY,IAAMqW,EAAErW,UAAY,GA4BjEwoC,CAAanyB,EAAGmB,GAC1B,OAAY,IAAR+wB,GAGQ,KADZA,EA9BW,SAAUlyB,EAAGmB,GACxB,IAAIixB,EAAU,CAAE7E,MAAO,EAAG8E,WAAY,EAAGC,OAAQ,EAAGC,IAAK,EAAGC,MAAO,GACnE,OAAQJ,EAAQpyB,EAAEvO,OAAS,IAAM2gC,EAAQjxB,EAAE1P,OAAS,GA4B9CghC,CAASzyB,EAAGmB,KAIN,KADZ+wB,EA7BiB,SAAUlyB,EAAGmB,GAC9B,OAAQnB,EAAEswB,YAAenvB,EAAEmvB,WAAiB,YAAmBtwB,EAAEswB,WAAYnvB,EAAEmvB,YAAvC,EA4BlCoC,CAAe1yB,EAAGmB,IAJb+wB,EAtBF,SAAUlyB,EAAGmB,GAEtB,IAAIwxB,EAAmB,CAAEpF,OAAO,EAAM8E,YAAY,GAElD,OADYM,EAAiB3yB,EAAEvO,OAASkhC,EAAiBxxB,EAAE1P,MAC5C,GAAKuO,EAAEtC,KAAO,IAAMyD,EAAEzD,KAAO,GAyBrCk1B,CAAO5yB,EAAGmB,IAkBrB,IAAI0xB,EAA0B,WAE1B,SAASA,EAA0B57B,GAC/B1U,KAAK0U,OAASA,EACG1U,KAAKuwC,QAAUd,EACfzvC,KAAKwwC,OAAS,GACdxwC,KAAKywC,IAAM,EAC5BzwC,KAAK6+B,eAAiB,IAAI,IAAenqB,GA8Q7C,OA3QA47B,EAASzuC,UAAUqT,QAAU,SAAUR,GACnC1U,KAAKwwC,OAAS,UACPxwC,KAAK0wC,cAqChBJ,EAASzuC,UAAU0F,QAAU,SAAUwU,GACnC,IAAI40B,EAAYjB,EAAa3zB,GAI7B/b,KAAKuc,KAAKvc,KAAK6+B,eAAer9B,QAHhB,SAAUosC,EAAUl5B,GAC9B,OAAmD,IAA5CA,EAAO4D,QAAQyT,kBAAkBnG,UAAkB,QAAQnc,KAAKmkC,EAASzlC,QAEtCwoC,KA6ClDL,EAASzuC,UAAU+a,UAAY,SAAUb,GACrC,IAAI40B,EAAYjB,EAAa3zB,GAC7B/b,KAAK0wC,aAAe1wC,KAAK6+B,eAAer9B,QAAO,SAAI,GAAOmvC,GAC1D3wC,KAAK4wC,SAAU,GAOnBN,EAASzuC,UAAU29B,WAAa,SAAUjjB,IACtC,QAAWvc,KAAKwwC,OAAQj0B,IAc5B+zB,EAASzuC,UAAU0a,KAAO,SAAUA,GAChC,IAAIpM,EAAQnQ,KACZ,IAAK,cAAyBuc,GAC1B,MAAM,IAAI9J,MAAM,gBAKpB,OAJA8J,EAAKpB,IAAMnb,KAAKywC,MAChBl0B,EAAKnV,SAAWmV,EAAKnV,UAAY,EACjCpH,KAAKwwC,OAAO/vC,KAAK8b,GACjBvc,KAAK4wC,SAAU,EACR,WAAc,OAAOzgC,EAAMqvB,WAAWjjB,KAOjD+zB,EAASzuC,UAAU8a,MAAQ,WAEvB,OADA3c,KAAK6wC,eACE7wC,KAAKwwC,OAAOpuC,OAAOpC,KAAK0wC,aAAe,CAAC1wC,KAAK0wC,cAAgB,KA4CxEJ,EAASzuC,UAAU2pB,KAAO,SAAUqiB,GAIhC,IAHA,IAAIiD,EAAS9wC,KAAK+wC,WAAW/wC,KAAKwwC,OAASxwC,KAAKuwC,QAAU1C,GAAa7tC,KAAKuwC,SAExES,EAAQ,EACH3zB,EAAI,EAAGA,EAAIyzB,EAAO1hC,OAAQiO,IAC/ByzB,EAAOzzB,GAAG4zB,OAASD,EACf3zB,EAAIyzB,EAAO1hC,OAAS,GAAgD,IAA3CpP,KAAKuwC,QAAQO,EAAOzzB,GAAIyzB,EAAOzzB,EAAI,KAC5D2zB,IAGRhxC,KAAKwwC,OAASM,EACd9wC,KAAK4wC,SAAU,GAGnBN,EAASzuC,UAAUgvC,aAAe,WAC9B7wC,KAAK4wC,SAAW5wC,KAAKwrB,QAGzB8kB,EAASzuC,UAAUkvC,WAAa,SAAUrxB,EAAKmuB,GAC3C,IAAIqD,EAAexxB,EAAI/Q,KAAI,SAAUuS,EAAMjS,GAAO,MAAO,CAAGiS,KAAMA,EAAMjS,IAAKA,MAK7E,OAJAiiC,EAAa1lB,MAAK,SAAU2lB,EAAUC,GAClC,IAAIC,EAAUxD,EAAUsD,EAASjwB,KAAMkwB,EAASlwB,MAChD,OAAmB,IAAZmwB,EAAgBF,EAASliC,IAAMmiC,EAASniC,IAAMoiC,KAElDH,EAAaviC,KAAI,SAAU2iC,GAAW,OAAOA,EAAQpwB,SA6DhEovB,EAASzuC,UAAUoO,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAClD,IAAIoc,EAAOvc,KAAK6+B,eAAer9B,OAAOi6B,EAAS1f,GAI/C,OAHI,QAAU5b,GAAWA,EAAQiH,YAC7BmV,EAAKnV,SAAWjH,EAAQiH,UAC5BpH,KAAKuc,KAAKA,GACHA,GAEJ+zB,EArRkB,8VCpDzBiB,EAA4B,WAE5B,SAASA,EAA4B78B,GACjC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKqc,mBAAoB,EAM1Crc,KAAK2c,MAAQ,IAAI,IAAS3c,KAAK0U,QAM/B1U,KAAKuL,OAAS,IAAI,IAAUvL,KAAK0U,QAsDjC1U,KAAKyR,IAAM,SAAU+/B,EAAQz8B,EAAStH,GAClC,OAAO0C,EAAMuE,OAAO0C,gBAAgB3F,IAAI+/B,EAAQz8B,EAAStH,IAS7DzN,KAAKmI,KAAO,WAAc,OAAOgI,EAAMuE,OAAO0C,gBAAgBjP,QAQ9DnI,KAAKmvC,OAAS,WAAc,OAAOh/B,EAAMuE,OAAO0C,gBAAgB+3B,UAQhEnvC,KAAK8xB,KAAO,WAAc,OAAO3hB,EAAMuE,OAAO0C,gBAAgB0a,QAgB9D9xB,KAAKmV,SAAW,SAAU3U,GAAY,OAAO2P,EAAMuE,OAAO0C,gBAAgBjC,SAAS3U,IA4IvF,OAzIA+wC,EAAW1vC,UAAUqT,QAAU,WAC3BlV,KAAKsc,QAAO,GACZtc,KAAK2c,MAAMzH,WAOfq8B,EAAW1vC,UAAU8qB,MAAQ,WACzB,MAAO,CAAExkB,KAAMnI,KAAKmI,OAAQgnC,OAAQnvC,KAAKmvC,SAAUrd,KAAM9xB,KAAK8xB,SAsBlEyf,EAAW1vC,UAAU+qB,KAAO,SAAU1W,GAClC,IAAIA,IAAOA,EAAI5T,iBAAf,CAEA,IAAI+oB,EAAKrrB,KAAK0U,OAAQuC,EAAaoU,EAAGpU,WAAYJ,EAAewU,EAAGxU,aAChEpF,EAAM,CAAEtJ,KAAM8O,EAAW9O,OAAQgnC,OAAQl4B,EAAWk4B,SAAUrd,KAAM7a,EAAW6a,QAC/E2f,EAAOzxC,KAAKgc,MAAMvK,IACJ,QAAQ,CACtB,CAAC,KAAU,SAAU+/B,GAAU,OAAOv6B,EAAWxF,IAAI+/B,GAAQ,KAC7D,CAAC,EAAA3R,YAAA,MAAmB,SAAU3sB,GAAO,OAAO2D,EAAa66B,GAAGx+B,EAAIzF,MAAOyF,EAAI9E,OAAQ8E,EAAI/S,WACvF,EAAC,IAAA+Y,IAAG,EAAA2mB,aAAc,SAAUx5B,GAAU,OAAOwQ,EAAa66B,GAAGrrC,EAAOoH,QAASpH,EAAO+H,SAAU/H,EAAOlG,cAEzGwxC,CAAYF,GAAQA,EAAKl1B,KAAKR,QAAQ01B,EAAKz1B,MAAOvK,EAAKzR,KAAK0U,WAwBhE68B,EAAW1vC,UAAUya,OAAS,SAAUhH,GACpC,IAAInF,EAAQnQ,KACZ,IAAgB,IAAZsV,EAKA,OAAQtV,KAAK4xC,iBACT5xC,KAAK4xC,kBAAoB5xC,KAAK0U,OAAOuC,WAAW9B,UAAS,SAAUe,GAAO,OAAO/F,EAAMyc,KAAK1W,MALhGlW,KAAK4xC,kBAAoB5xC,KAAK4xC,0BACvB5xC,KAAK4xC,kBA+BpBL,EAAW1vC,UAAUkb,eAAiB,SAAU9Q,QAC9BkI,IAAVlI,IACAA,GAAQ,GACZjM,KAAKqc,kBAAoBpQ,GAQ7BslC,EAAW1vC,UAAUma,MAAQ,SAAUvK,GAEnCA,GAAM,QAAO,CAAEtJ,KAAM,GAAIgnC,OAAQ,GAAIrd,KAAM,IAAMrgB,GAYjD,IAXA,IAUIggC,EARsBl1B,EAClBP,EAHJW,EAAQ3c,KAAK2c,MAAMA,QAWdU,EAAI,EAAGA,EAAIV,EAAMvN,UAElBqiC,GAAQA,EAAKl1B,KAAK00B,SAAWt0B,EAAMU,GAAG4zB,QAFZ5zB,IAAK,CAInC,IAAIyI,QAZA9J,GAAAA,GADkBO,EAaEI,EAAMU,IAZbrB,MAAMvK,EALfzR,KAK0B0U,UAClB,CAAEsH,MAAOA,EAAOO,KAAMA,EAAMs1B,OAAQt1B,EAAK0yB,cAAcjzB,KAavEy1B,GAAQA,GAAS3rB,GAAWA,EAAQ+rB,OAASJ,EAAKI,OAAU/rB,EAAU2rB,EAE1E,OAAOA,GAEJF,EA7PoB,oZCJ3BO,EAAsC,WACtC,SAASA,EAAqBp9B,EAAQq9B,GAClC,IAAI5hC,EAAQnQ,KACZA,KAAK+xC,gBAAkBA,EACvB/xC,KAAKgyC,WAAa,GAClBhyC,KAAKiyC,UAAY,SAAU/7B,GAAO,OAAO/F,EAAM6hC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGoL,OAC5FlW,KAAK8xB,KAAO,WAAc,OAAO,QAAS3hB,EAAM+hC,QAAQpgB,MACxD9xB,KAAKmI,KAAO,WAAc,OAAO,QAASgI,EAAM+hC,QAAQ/pC,MACxDnI,KAAKmvC,OAAS,WAAc,OAAO,SAAU,QAASh/B,EAAM+hC,QAAQ/C,SACpEnvC,KAAKmyC,UAAY,cACjBnyC,KAAKoyC,SAAW,aAoBpB,OAlBAN,EAAqBjwC,UAAU4P,IAAM,SAAUA,EAAKsD,GAQhD,YAPgB,IAAZA,IAAsBA,GAAU,IAChC,QAAUtD,IAAQA,IAAQzR,KAAKkyC,SAC/BlyC,KAAKmpB,KAAK,KAAM,KAAM1X,EAAKsD,GACvB/U,KAAK+xC,iBACL/xC,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG,CAAE2G,IAAKA,SAG1D,QAASzR,OAEpB8xC,EAAqBjwC,UAAUsT,SAAW,SAAUrK,GAChD,IAAIqF,EAAQnQ,KAEZ,OADAA,KAAKgyC,WAAWvxC,KAAKqK,GACd,WAAc,OAAO,QAAWqF,EAAM6hC,WAAYlnC,KAE7DgnC,EAAqBjwC,UAAUqT,QAAU,SAAUR,IAC/C,QAAS1U,KAAKgyC,aAEXF,EA9B8B,2LCDrCO,EAAuC,WACvC,SAASA,EAAsB39B,EAAQ49B,QAClB,IAAbA,IAAuBA,GAAW,GACtCtyC,KAAKsyC,SAAWA,EAChBtyC,KAAK0V,eAAYvB,EACjBnU,KAAKuyC,YAAc,GAmCvB,OAjCAF,EAAsBxwC,UAAUirC,KAAO,WACnC,OAAIj3B,SAASi3B,KACFyC,OAAO15B,SAASi3B,MAEA,UAApB9sC,KAAK+sC,WAAyB,IAAM,IAE/CsF,EAAsBxwC,UAAUkrC,SAAW,WACvC,OAAOl3B,SAASk3B,SAASh4B,QAAQ,KAAM,KAE3Cs9B,EAAsBxwC,UAAUgrC,KAAO,WACnC,OAAOh3B,SAAS28B,UAEpBH,EAAsBxwC,UAAUwT,UAAY,WACxC,OAAOrV,KAAKsyC,UAEhBD,EAAsBxwC,UAAU8qC,WAAa,SAAUC,GACnD,OAAO,QAAUA,GAAc5sC,KAAKuyC,YAAc3F,EAAa5sC,KAAKuyC,aAExEF,EAAsBxwC,UAAU4T,SAAW,SAAUu4B,GAKjD,OAJI,QAAUA,KACVhuC,KAAK0V,UAAYs4B,IACjB,QAAYhuC,KAAK0V,aACjB1V,KAAK0V,UAAY1V,KAAKyyC,eACnBzyC,KAAK0V,WAEhB28B,EAAsBxwC,UAAU4wC,YAAc,WAC1C,IAAIC,EAAUrsB,SAASssB,qBAAqB,QAAQ,GACpD,OAAID,GAAWA,EAAQ1E,KACZ0E,EAAQ1E,KAAKj5B,QAAQ,uBAAwB,IAEjD/U,KAAKsyC,SAAW,IAAMz8B,SAAS/B,UAAY,KAEtDu+B,EAAsBxwC,UAAUqT,QAAU,aACnCm9B,EAxC+B,uHCDlCO,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAMnFC,EAAqC,SAAUC,GAE/C,SAASD,EAAoBv+B,GACzB,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAU1U,KAEhD,OADA,sBAAsB,aAAcmQ,EAAM8hC,WAAW,GAC9C9hC,EAYX,OAhBA0iC,EAAUI,EAAqBC,GAM/BD,EAAoBpxC,UAAUqwC,KAAO,WACjC,OAAO,QAAYlyC,KAAKmyC,UAAUrgB,OAEtCmhB,EAAoBpxC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAC9D/U,KAAKmyC,UAAUrgB,KAAOrgB,GAE1BwhC,EAAoBpxC,UAAUqT,QAAU,SAAUR,GAC9Cw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,aAAc1U,KAAKiyC,YAEzCgB,EAjB6B,CAkBtC,6cC/BEG,EACA,WACI,IAAIjjC,EAAQnQ,KACZA,KAAKkV,QAAU,KACflV,KAAK0V,UAAY,GACjB1V,KAAKqzC,MAAQ,GACbrzC,KAAKszC,UAAY,OACjBtzC,KAAKuzC,MAAQ,YACbvzC,KAAKuyC,YAAc,GACnBvyC,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMkjC,OACvCrzC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMmjC,WAC3CtzC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMojC,OACvCvzC,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuF,WAC3C1V,KAAKqV,UAAY,WAAc,OAAO,GACtCrV,KAAK2sC,WAAa,SAAU6G,GAAU,OAAQ,QAAUA,GAAWrjC,EAAMoiC,YAAciB,EAAUrjC,EAAMoiC,oIChBvGK,8EADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAKnFS,EAAuC,SAAUP,GAEjD,SAASO,EAAsB/+B,GAC3B,OAAOw+B,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAQ9C,OAVA6yC,EAAUY,EAAuBP,GAIjCO,EAAsB5xC,UAAUqwC,KAAO,WACnC,OAAOlyC,KAAK0zC,MAEhBD,EAAsB5xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAChE/U,KAAK0zC,KAAOjiC,GAETgiC,EAX+B,CAYxC,0tBCZ8B,QAAsB,4BAA4B,EAAO,IAAqB,MAEzE,QAAsB,6BAA6B,EAAM,IAA0B,MAEtF,QAAsB,0BAA0B,EAAO,IAAuB,8HClBxGb,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAUnFW,EAA0C,SAAUT,GAEpD,SAASS,EAAyBj/B,GAC9B,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAG/C,OAFAmQ,EAAMyjC,QAAUl/B,EAAOuC,WAAW1L,OAClC,sBAAsB,WAAY4E,EAAM8hC,WAAW,GAC5C9hC,EA8CX,OAnDA0iC,EAAUc,EAA0BT,GAuBpCS,EAAyB9xC,UAAUgyC,eAAiB,WAChD,OAAO,QAAqB7zC,KAAK4zC,QAAQn+B,aAE7Ck+B,EAAyB9xC,UAAUqwC,KAAO,WACtC,IAAI7mB,EAAKrrB,KAAKmyC,UAAWr+B,EAAWuX,EAAGvX,SAAUge,EAAOzG,EAAGyG,KAAMqd,EAAS9jB,EAAG8jB,OAC7EA,GAAS,QAAWA,GAAQ,GAC5Brd,GAAO,QAAUA,GAAM,GACvB,IAAIgiB,EAAa9zC,KAAK6zC,iBAClBE,EAAqBjgC,IAAa9T,KAAK4zC,QAAQn+B,WAC/Cu+B,EAAiBlgC,EAASiT,OAAO,EAAG+sB,EAAW1kC,UAAY0kC,EAE/D,OADAhgC,EAAWigC,EAAqB,IAAMC,EAAiBlgC,EAASmmB,UAAU6Z,EAAW1kC,QAAU0E,IAC5Eq7B,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE1E6hB,EAAyB9xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GACnE,IAAI++B,EAAa9zC,KAAK6zC,iBAClBzF,EAAQ38B,GAAkB,MAAXA,EAAI,GAAa,IAAM,GACtCwiC,EAAkB,KAARxiC,GAAsB,MAARA,EAAczR,KAAK4zC,QAAQn+B,WAAaq+B,EAAa1F,EAAQ38B,EACrFsD,EACA/U,KAAKoyC,SAAS8B,aAAazmC,EAAO0lC,EAAOc,GAGzCj0C,KAAKoyC,SAAS+B,UAAU1mC,EAAO0lC,EAAOc,IAG9CN,EAAyB9xC,UAAUqT,QAAU,SAAUR,GACnDw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,WAAY1U,KAAKiyC,YAEvC0B,EApDkC,CAqD3C,qKCzDS5sC,EAAK,CAEZkJ,KAAM,SAAUjM,GAAO,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAAU,OAAO1nC,EAAQ3I,OAEtFqwC,OAAQ,SAAUrwC,GACd,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAClCA,EAAOrwC,OAIfiI,MAAO,WACH,IAAIqoC,EAAW,GAKf,OAJAA,EAAS7wC,QAAU,IAAI2wC,SAAQ,SAAUznC,EAAS0nC,GAC9CC,EAAS3nC,QAAUA,EACnB2nC,EAASD,OAASA,KAEfC,GAGX74B,IAAK,SAAUF,GACX,IAAI,QAAQA,GACR,OAAO64B,QAAQ34B,IAAIF,GAEvB,IAAI,QAASA,GAAW,CAGpB,IAAI0gB,EAAQ1oB,OAAOC,KAAK+H,GAAU5M,KAAI,SAAU9I,GAAO,OAAO0V,EAAS1V,GAAKkF,MAAK,SAAU/G,GAAO,MAAO,CAAG6B,IAAKA,EAAK7B,IAAKA,SAE3H,OAAO+C,EAAG0U,IAAIwgB,GAAOlxB,MAAK,SAAUiW,GAChC,OAAOA,EAAOpS,QAAO,SAAUsL,EAAKzG,GAEhC,OADAyG,EAAIzG,EAAM5N,KAAO4N,EAAMzP,IAChBkW,IACR,yMC/CRq6B,EAAmB,SAAUC,EAAOnpB,GAC3C,IAAIxlB,EAAMwlB,EAAG,GAAIrnB,EAAMqnB,EAAG,GAU1B,OATKmpB,EAAM9xC,eAAemD,IAGjB,QAAQ2uC,EAAM3uC,IACnB2uC,EAAM3uC,GAAKpF,KAAKuD,GAGhBwwC,EAAM3uC,GAAO,CAAC2uC,EAAM3uC,GAAM7B,GAN1BwwC,EAAM3uC,GAAO7B,EAQVwwC,GAEAC,EAAY,SAAUC,GAC7B,OAAOA,EAAY5xB,MAAM,KAAKxZ,OAAO,MAAUqF,IAAI,MAAYC,OAAO2lC,EAAkB,KAErF,SAASra,EAASzoB,GACrB,IAAIkjC,EAAgB,SAAUrlC,GAAK,OAAOA,GAAK,IAC3C+b,GAAK,QAAU5Z,GAAK9C,IAAIgmC,GAAgBC,EAAavpB,EAAG,GAAIyG,EAAOzG,EAAG,GACtEC,GAAK,QAAWspB,GAAYjmC,IAAIgmC,GACpC,MAAO,CAAExsC,KADkDmjB,EAAG,GACzC6jB,OADsD7jB,EAAG,GACzCwG,KAAMA,EAAMrgB,IAAKA,GAEnD,IAAIojC,EAAW,SAAUC,GAC5B,IAAI3sC,EAAO2sC,EAAI3sC,OACX4sC,EAAeD,EAAI3F,SACnBrd,EAAOgjB,EAAIhjB,OACXqd,EAAS57B,OAAOC,KAAKuhC,GACpBpmC,KAAI,SAAU9I,GACf,IAAImJ,EAAQ+lC,EAAalvC,GAEzB,QADW,QAAQmJ,GAASA,EAAQ,CAACA,IACzBL,KAAI,SAAU3K,GAAO,OAAO6B,EAAM,IAAM7B,QAEnD4K,OAAO,KAAS,IAChBqE,KAAK,KACV,OAAO9K,GAAQgnC,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE/D,SAASkjB,EAAsBxvC,EAAM0oC,EAAS+G,EAAcC,GAC/D,OAAO,SAAU98B,GACb,IAAIX,EAAWW,EAAShB,gBAAkB,IAAI69B,EAAa78B,GACvD+8B,EAAiB/8B,EAASf,eAAiB,IAAI69B,EAAmB98B,EAAU81B,GAKhF,MAAO,CAAE1oC,KAAMA,EAAMiS,QAASA,EAAS09B,cAAeA,EAAejgC,QAJrE,SAAiBR,GACbA,EAAOQ,QAAQuC,GACf/C,EAAOQ,QAAQigC,kaCvBvBr6B,EAA6B,WAE7B,SAASA,EAA6BpG,GAClC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKo1C,SAAW,GAChBp1C,KAAKq1C,aAAe,GACpBr1C,KAAKs1C,qBAAuB,GAC5Bt1C,KAAKgyC,WAAa,GAEnChyC,KAAKgK,WAAa,CACdC,iBAAkBjK,KAAKiK,iBAAiB3G,KAAKtD,MAC7CgX,mBAAoBhX,KAAKgX,mBAAmB1T,KAAKtD,MACjDu1C,kBAAmB,SAAUlqC,GAAM,OAAO,QAAK8E,EAAMilC,UAAU,SAAUt7B,GAAQ,OAAO3J,EAAMuE,OAAOyG,IAAM,IAAMrB,EAAKzO,KAAOA,MAC7HmqC,mBAAoB,WAAc,OAAOrlC,EAAMilC,UAC/CK,mBAAoB,WAAc,OAAOtlC,EAAMklC,cAC/CK,QAAS,SAAUvX,GAEf,OADAhuB,EAAM6hC,WAAWvxC,KAAK09B,GACf,WAAc,OAAO,QAAWhuB,EAAM6hC,WAAY7T,MAwPrE,OAzOArjB,EAAY66B,sBAAwB,SAAU9kC,EAAS+kC,QAC/B,IAAhBA,IAA0BA,EAAc,IAI5C,IAAIC,EAAgBD,EAAY9yB,MAAM,KAClC9H,EAAa66B,EAAc,IAAM,WACjC36B,GAAsB,QAAS26B,EAAc,IAAMA,EAAc,GAAK,IAGtEC,EAAwB,wBAAwBrsC,KAAKuR,GAYzD,GAXI86B,IAEA56B,EAAsB46B,EAAsB,GAC5C96B,EAAa86B,EAAsB,IAEV,MAAzB96B,EAAWvV,OAAO,KAClBuV,EAAaA,EAAW+L,OAAO,GAC/B7L,EAAsB,IAGN,kBACFzR,KAAKyR,GAAsB,CACzC,IAAI66B,EAAc76B,EAAoB4H,MAAM,KAAKlU,QAAO,SAAUonC,EAAQ1mC,GAAK,OAAO0mC,EAAO57B,SAAWvJ,GACxGqK,EAAsB66B,EAAYvwC,SAEL,MAAxB0V,IACLA,EAAsBrK,EAAQrL,MAElC,MAAO,CAAEwV,WAAYA,EAAYE,oBAAqBA,IAG1DJ,EAAYjZ,UAAUoI,iBAAmB,SAAU4G,GAC/C,OAAQ7Q,KAAKi2C,aAAeplC,GAAW7Q,KAAKi2C,cAGhDn7B,EAAYjZ,UAAUmV,mBAAqB,SAAUk/B,EAAUh2C,GAC3DF,KAAKs1C,qBAAqBY,GAAYh2C,GAE1C4a,EAAYjZ,UAAU2yB,iBAAmB,SAAUrsB,EAAMozB,GACrD,IAAI4a,EAAan2C,KAAKs1C,qBAAqB/Z,EAAKnwB,OAChD,IAAK+qC,EACD,MAAM,IAAI1jC,MAAM,2DAA6D8oB,EAAKnwB,OACtF,IAAIgrC,EAAOD,EAAWhuC,EAAMozB,GAC5B,OAAO,QAAQ6a,GAAQA,EAAO,CAACA,IAUnCt7B,EAAYjZ,UAAUumC,qBAAuB,SAAU19B,GACnD,2BAA4B,cAAeA,IAC3C,QAAW1K,KAAKq1C,aAAc3qC,IAElCoQ,EAAYjZ,UAAUwmC,mBAAqB,SAAU39B,GACjD,2BAA4B,iBAAkBA,GAC9C1K,KAAKq1C,aAAa50C,KAAKiK,IAE3BoQ,EAAYjZ,UAAU+qB,KAAO,WACzB,IAAIzc,EAAQnQ,KACRq2C,EAAer2C,KAAKo1C,SAASzmC,KAAI,SAAU4c,GAAO,MAAO,CAACA,EAAIjgB,IAAKigB,MAAS3c,OAAO,KAAY,IASnG,SAAS0nC,EAAgB/qC,GAErB,IADA,IAAIsF,EAAUtF,EAAOxD,SAASgC,SAAUG,EAAQ,IACvCA,GAAS2G,EAAQuJ,QACtBvJ,EAAUA,EAAQuJ,OACtB,OAAOlQ,EAGX,IAAIqsC,GAAe,SAAM,SAAUC,EAASC,EAAQ1lB,EAAMC,GAAS,OAAOylB,GAAUD,EAAQzlB,GAAQylB,EAAQxlB,OAkBxG0lB,EAAe12C,KAAKo1C,SAAS5pB,KAAK+qB,GA9BtC,SAAqB9vC,GACjB,IAAIkwC,EAAa,SAAU9lC,GAAW,OAAQA,GAAWA,EAAQuJ,OAASu8B,EAAW9lC,EAAQuJ,QAAU,EAAI,GAC3G,OAAsC,IAA/B3T,EAAO6E,IAAIwX,MAAM,KAAK1T,OAAiBunC,EAAWlwC,EAAOkiB,mBA4BJ,IAAIha,KAjB3C,SAAUlI,GAC/B,IAAImwC,EAAkBzmC,EAAMklC,aAAa/rC,OAAOwR,EAAYoI,QAAQmzB,EAAc5vC,IAOlF,OANImwC,EAAgBxnC,OAAS,GAIzBwnC,EAAgBprB,KAAK+qB,EAAaD,GAAkB,IAEjD,CAAE7vC,OAAQA,EAAQiE,WAAYksC,EAAgB,OAUrDC,EAAqBH,EAAa/nC,KAAI,SAAU8E,GAAS,OAAOA,EAAM/I,cACtEosC,EAAwB92C,KAAKq1C,aAC5B/rC,QAAO,SAAUiC,GAAU,QAAQ,QAAQsrC,EAAoBtrC,MAC/DoD,KAAI,SAAUjE,GAAc,MAAO,CAAGjE,YAAQ0N,EAAWzJ,WAAYA,MAC1EgsC,EAAa31C,SAZS,SAAU0S,IAGkB,IAA1CtD,EAAMilC,SAASlnC,QAAQuF,EAAMhN,SAC7BgN,EAAMhN,OAAO+E,cAAciI,EAAM/I,eASzC,IAAIqsC,EAAYL,EAAat0C,OAAO00C,GACpC92C,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGisC,MAClD,mBAAoBA,IAiBxBj8B,EAAYjZ,UAAUgK,eAAiB,SAAUpF,GAC7C,iCAAkC,iBAAkBA,GACpD,IAAIuwC,EAAUh3C,KAAKo1C,SAMnB,OAJI4B,EAAQ1tC,QADY,SAAUiiB,GAAO,OAAOA,EAAIjgB,MAAQ7E,EAAO6E,KAAOigB,EAAIngB,QAAU3E,EAAO2E,SACzDgE,QAClC,iCAAkC,+BAAgC3I,GACtEuwC,EAAQv2C,KAAKgG,GACbzG,KAAK4sB,OACE,YAEU,IADHoqB,EAAQ9oC,QAAQzH,IAK1B,iCAAkC,mBAAoBA,IACtD,QAAWuwC,EAAX,CAAoBvwC,IAJhB,iCAAkC,uCAAwCA,KAYtFqU,EAAYjZ,UAAUo1C,UAAY,WAC9B,OAAOj3C,KAAKo1C,SAASzmC,KAAI,QAAK,SAOlCmM,EAAYjZ,UAAUq1C,OAAS,WAC3B,OAAOl3C,KAAKo1C,SAAS9rC,QAAO,QAAK,YAAYqF,KAAI,QAAK,UA2D1DmM,EAAYoI,QAAU,SAAUmzB,EAAc5vC,GAAU,OAAO,SAAUiE,GAErE,GAAIjE,EAAO2E,QAAUV,EAAW3C,SAASqD,MACrC,OAAO,EAEX,IAAI+8B,EAAKz9B,EAAW3C,SAChBovC,EAAahP,EAAGptB,YAAY+H,MAAM,KAClCs0B,EAAc3wC,EAAO6E,IAAIwX,MAAM,KAGnC,KAAK,QAAOq0B,EAAYC,EAAYt1C,MAAM,EAAIq1C,EAAW/nC,SACrD,OAAO,EAGX,IAAIioC,EAAY,EAAIF,EAAW/nC,aAAU+E,EACrCmjC,EAAoBF,EAAYt1C,MAAM,EAAGu1C,GAAWpkC,KAAK,KACzDskC,EAAgBlB,EAAaiB,GAAmB3uB,gBACpD,OAAOwf,EAAGltB,wBAA0Bs8B,GAAiBA,EAAc/xC,QAEhEsV,EA1QqB,wDCfhC,SAAUyL,EAAQ1mB,GAAU,aAyD5B,IAAI23C,EAAoB,gBAEpBC,EAAe53C,EAAQC,OAAO,SAAU,CAAC,OACrB43C,KAAK,CAAEC,eAAgB,UACvB53C,SAAS,SAkCjC,WACE,IAAIwL,EAAS,CACXqsC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,kBAAkB,GAgCpB,SAASC,EAAUzlC,EAAU0lC,EAAUC,EAAqBC,GAC1D,OAAO,SAAS31C,EAAOoe,EAAMpO,GAC3B,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAIkB,EAAgB5lC,EAAKkd,WAAWuoB,IAChChtC,EAAOmtC,IAAmBC,EAAYz3B,EAAMs3B,IAAyB1lC,EAAK4lC,IAC5E51C,EAAMyB,OAAOuO,EAAKD,IAAW,SAAS+lC,GAEpCA,EAAUH,GAAUG,IAAYA,EAChC13B,EAAKpO,KAAKylC,EAAUK,QAb5B54C,KAAKuL,OAAS,SAASstC,GACrBttC,EAAS1L,EAAQiB,OAAOyK,EAAQstC,IAkElC74C,KAAKU,KAAO,WACV,MAAO,CACL6K,OAAQ,SAAS1F,GACf,OAAO0F,EAAO1F,IAEhBizC,YAAaR,OA5IfE,EAAsB,CAAC,SAAU,IAAK,QAAS,WAAY,SAAU,UAAW,WAEhFG,EAAc,SAASz3B,EAAM63B,GAC/B,IAAiD,IAA7CA,EAAc7qC,QAAQgT,EAAK,GAAG83B,UAChC,OAAO,GA8IXvB,EAAa50C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GAClD,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GACtC,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GACvC,OAAOA,EAAMH,YAAY,UAAW,eAAgBN,GAAqB,MAE1E31C,UAAU,YAAa,CAAC,QAAS,SAASo2C,GACzC,OAAOA,EAAMH,YAAY,YAAa,eAAgBN,GAAqB,MAE5E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GAEvC,SAASC,EAAiBpmC,EAAMqmC,EAAgBj4B,EAAMk4B,GACpD,OAAOH,EAAM1tC,OAAO4tC,KACjBj4B,EAAKpO,KAAKA,KACVsmC,IAAsBT,EAAYz3B,EAAMs3B,MAClB,WAAtBt3B,EAAKpO,KAAK,SAA6C,UAArBoO,EAAK,GAAG83B,UAG/C,SAASK,EAAiBC,EAAMp4B,GAI9B,OAAQA,EAAKpO,KAAK,SAAYoO,EAAKpO,KAAK,UAAYwmC,IAAUX,EAAYz3B,EAAMs3B,GAYlF,MAAO,CACLrxC,SAAU,IACVxB,QAAS,UACTyB,SAAU,IACVC,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI+B,EAhBR,SAAkBzmC,EAAMoO,GACtB,IAAIhS,EAAO4D,EAAK5D,KACZoqC,EAAOxmC,EAAKwmC,KAEhB,MAA2B,cAAlBpqC,GAAQoqC,IAAiC,qBAATA,EAA+B,WAC7C,WAAlBpqC,GAAQoqC,IAAiC,kBAATA,EAA4B,QACpD,UAATpqC,GAA0C,gBAAToqC,GAAmC,WAATA,EAAqB,QAAU,GAUpFE,CAAS1mC,GAErB,MAAO,CACL2mC,KAAM,SAAS32C,EAAOoe,EAAMpO,EAAM4mC,GAChC,IAAIC,EAAgBT,EAAiB,WAAY,WAAYh4B,GAAM,GAEnE,SAAS04B,IACP,OAAOF,EAAQG,YAcjB,OAAQN,GACN,IAAK,QACL,IAAK,WACCF,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQymC,GAEhBL,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,OAAOq1C,EAAiC,UAAVL,EAlB1C,SAA0BO,GAGxB,IAAIlB,EAAW9lC,EAAKtO,OAASk1C,EAAQK,WACrC74B,EAAKpO,KAAK,eAAgB8lC,IAG5B,WACE13B,EAAKpO,KAAK,gBAAiB4mC,EAAQM,SAASN,EAAQK,eAa9CJ,GACFz4B,EAAKpO,KAAK,WAAY,GAExB,MACF,IAAK,QAIH,GAHIumC,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQ,UAEhBmmC,EAAM1tC,OAAO,aAAc,CAC7B,IAAI0uC,GAAqB/4B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDw3C,GAAqBh5B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDy3C,GAAqBj5B,EAAKpO,KAAK,iBAE/BmnC,GACFnnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BI,GACFpnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BK,GACFr3C,EAAMyB,OAAOq1C,GAAuB,SAAgCE,GAClE54B,EAAKpO,KAAK,gBAAiBgnC,MAI7BH,GACFz4B,EAAKpO,KAAK,WAAY,IAKvBA,EAAKpQ,eAAe,eAAiBg3C,EAAQW,YAAYC,UACzDpB,EAAiB,gBAAiB,eAAgBh4B,GAAM,IAE3DpO,EAAKsnC,SAAS,YAAY,WACxBl5B,EAAKpO,KAAK,kBAAmBA,EAAe,aAI5ComC,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,QAAO,WACX,OAAOm1C,EAAQa,YACd,SAA+BT,GAChC54B,EAAKpO,KAAK,iBAAkBgnC,cAQzCj3C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,cAAc,WACvB,MAAO,CACLsE,SAAU,IACVxB,QAAS,cACT4C,KAAM,SAASzF,EAAOoe,EAAMpO,EAAM0nC,GAC5B1nC,EAAKpQ,eAAe80C,IAEnBt2B,EAAKpO,KAAK,cACboO,EAAKpO,KAAK,YAAa,kBAK9BjQ,UAAU,UAAU,CAAC,QAAS,SAAU,SAASo2C,EAAO93C,GACvD,MAAO,CACLgG,SAAU,IACVE,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI72C,EAAKQ,EAAO2R,EAAK2nC,SACrB,OAAO,SAAS33C,EAAOoe,EAAMpO,GAEtB6lC,EAAYz3B,EAAMs3B,KAEjBS,EAAM1tC,OAAO,sBAAwB2V,EAAKpO,KAAK,SACjDoO,EAAKpO,KAAK,OAAQ,UAGhBmmC,EAAM1tC,OAAO,cAAgB2V,EAAKpO,KAAK,aACzCoO,EAAKpO,KAAK,WAAY,IAGpBmmC,EAAM1tC,OAAO,gBAAmBuH,EAAK4nC,WAAc5nC,EAAK6nC,YAAe7nC,EAAK8nC,SAC9E15B,EAAK5gB,GAAG,WAAW,SAASC,GAC1B,IAAIs6C,EAAUt6C,EAAMu6C,OAASv6C,EAAMs6C,QAEnB,KAAZA,GAA8B,KAAZA,KAEwC,IAAxDrC,EAAoBtqC,QAAQ3N,EAAM8F,OAAO2yC,WAAqBz4C,EAAM8F,OAAO00C,mBAG7Ex6C,EAAMgD,iBAERT,EAAMmB,QAGR,WACEtD,EAAGmC,EAAO,CAAEk4C,OAAQz6C,mBASnCsC,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAO,SAASn2C,EAAOoe,EAAMpO,GACvBA,EAAKpQ,eAAe80C,KAEpByB,EAAM1tC,OAAO,aAAgB2V,EAAKpO,KAAK,aAAgB6lC,EAAYz3B,EAAMs3B,IAC3Et3B,EAAKpO,KAAK,WAAY,OA9Z5B,CAoaGyT,OAAQA,OAAO1mB,iECzalBA,QAAQC,OAAO,WAAY,CAAC,OAC3B+C,UAAU,WAAY,CAAC,KAAM,SAAUkE,GACvC,aAgCA,MAAO,CACNjE,MAAM,CACL42C,QAAe,IACf73B,IAAe,QACfiF,IAAe,QACfgD,KAAe,SACfmxB,SAAe,aACfC,SAAe,aACfC,UAAe,cACfC,UAAe,cACfC,WAAe,eACfC,WAAe,eACfC,aAAe,iBACfC,MAAe,UACfC,MAAe,UACfC,YAAe,gBACfC,YAAe,iBAEhBvqC,YAAa,2BACPzL,QAAS,UACToP,SAAS,EACTxM,KAlDI,SAAUtH,EAAQyG,EAAUxG,GAElCA,EAAO+5C,WACVh6C,EAAOg6C,SAAW,WAAW,OAAO,IAGjC/5C,EAAOi6C,YACVl6C,EAAOk6C,UAAY,WAAW,OAAO,IAGlCj6C,EAAOw6C,cACVz6C,EAAOy6C,YAAc,WAAW,IAAIviB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOs6C,QACVv6C,EAAOu6C,MAAQ,cAGZt6C,EAAOy6C,cACV16C,EAAO06C,YAAc,WAAW,IAAIxiB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOu6C,QACVx6C,EAAOw6C,MAAQ,eA4BVz6C,WAAY,yBAInBA,WAAW,qBAAsB,CAAC,SAAU,WAAY,SAAWC,EAAQuC,GAC3E,aAEAvC,EAAO26C,UAAar1B,OAAO7jB,eAAe,iBAAmB6jB,OAAOs1B,UAAUC,iBAAmB,EACjG76C,EAAO86C,SAAWl8C,QAAQoiB,KAAKhhB,EAAOy4C,SAEtCz4C,EAAO4gB,IAAM5gB,EAAO4gB,KAAO,EAC3B5gB,EAAO6lB,IAAM7lB,EAAO6lB,KAAO,EAC3B7lB,EAAO6oB,KAAO7oB,EAAO6oB,MAAQ,GAE7B7oB,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,QAE7Cz4C,EAAOm6C,UAAYn6C,EAAOm6C,WAAa,GACvCn6C,EAAO+6C,cAAgB/6C,EAAOm6C,UAAYn6C,EAAO6oB,KACjD7oB,EAAOo6C,WAAap6C,EAAOo6C,YAAc,GACzCp6C,EAAOq6C,WAAar6C,EAAOq6C,YAAcr6C,EAAOm6C,UAChDn6C,EAAOs6C,aAAet6C,EAAOs6C,cAAgBt6C,EAAOo6C,WAEpD,IAAI1nB,EAAO1yB,EAAO6lB,IAAM7lB,EAAO4gB,IAC/Bo6B,EAAQtoB,EAAO1yB,EAAO6oB,KACtBoyB,EAAUj7C,EAAOsD,OAAO,WAAW,WAClCtD,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,WAG9CyC,EAAW,SAAUC,GACpB,OAAQA,EAAM,GAAKH,EAAQtoB,GAG5B1yB,EAAOo7C,cAAgB,WACtB,OAAO,IAAIz6C,MAAMq6C,IAGlBh7C,EAAOq7C,cAAgB,SAAUF,GAChC,IAAIG,EAAQ,EAAEt7C,EAAO6oB,KAErB,OADW7oB,EAAOm6C,UAAUmB,GAAQH,EAAMG,IAI3Ct7C,EAAOu7C,WAAa,SAAUJ,GAC7B,OAAOD,EAASC,IAAUn7C,EAAOy4C,QAAQz4C,EAAO4gB,KAGjD5gB,EAAOw7C,aAAe,WACjBx7C,EAAOk6C,cAAgBl6C,EAAOg6C,YACjCh6C,EAAO06C,YAAY,CAACe,OAAOz7C,EAAOy4C,UAAU3uC,MAAK,WAChD9J,EAAOy4C,QAAUz4C,EAAO4gB,IACxB5gB,EAAOw6C,MAAM,CAACiB,OAAOz7C,EAAOy4C,cAK/Bz4C,EAAO07C,SAAW,SAAUP,GAC3B,IAAKn7C,EAAOg6C,WAAY,CACvB,IAAI2B,EAAW/8C,QAAQoiB,KAAKhhB,EAAO4gB,IAAMs6B,EAASC,IAElDn7C,EAAOy6C,YAAY,CAACgB,OAAOE,IAAW7xC,MAAK,WAC1C9J,EAAOy4C,QAAUkD,EACjBp5C,GAAS,WACRvC,EAAOu6C,MAAM,CAACkB,OAAOz7C,EAAOy4C,kBAMhCz4C,EAAOsB,IAAI,YAAY,WACtB25C,UAID3jC,IAAI,CAAC,iBAAkB,SAAUjI,GACjC,aAEAA,EAAeusC,IAAI,2BAElB,0iDCtHF,SAASC,EACP7mC,EACAL,EACA6C,EACAskC,EACAh2C,EACAi2C,EACAC,EACAC,EACAC,EACA35C,GAEA,MAAM45C,EAAKp9C,KA4CX,SAASq9C,EAAOC,GAEdN,EAAqBO,cAAcL,EAAgB,CAAEI,GAAAA,IAClDvyC,MAAMvG,IAhBX,IAAqBg5C,EAiBfvnC,EAAWwnC,OAASj5C,EAjBLg5C,GAkBI,IAAPF,EAAc,OAAS,OAjBvC1nC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,GAEF,KAcEh6C,GAAS,KACPyS,EAAWhS,eAGdoe,MAAM26B,EAAqBW,gBA8MhCP,EAAG/vC,QArGH,WACEmZ,QAAQo3B,MAAM,oCAAqC3nC,EAAW4nC,SAC9D5nC,EAAW6nC,OAAS,OAEpB,MAAMC,EAAY9nC,EAAW+nC,SAASC,MAChCC,EAAajoC,EAAW+nC,SAASG,UACjCC,EACJnoC,EAAW+nC,SAASK,iBAAmBpoC,EAAW+nC,SAASG,UACvDG,EAAeroC,EAAW+nC,SAASO,aACnCC,EAAmBvoC,EAAW+nC,SAASS,gBACvCC,EAAgB58B,KAAKgF,IACzBT,SAASs4B,gBAAgBC,aACzBr4B,OAAOs4B,aAAe,GAElBC,EAAez4B,SAASs4B,gBAAgBI,YAG9C14B,SAASs4B,gBAAgBK,MAAMC,YAAY,oBAAqBlB,GAChE13B,SAASs4B,gBAAgBK,MAAMC,YAAY,qBAAsBf,GACjE73B,SAASs4B,gBAAgBK,MAAMC,YAC7B,4BACAb,GAEF/3B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAX,GAEFj4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,2BACAT,GAEFn4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,wBACAP,GAEFr4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAH,GAGF,IAAII,GAAK,EAET,MAAMC,EAA8B36C,GAChB,OAAVA,GAAkBA,EAAMyR,EAAWJ,WAAc,GAGrDupC,EAAwBpC,EAAqBqC,QACjDlC,GACApyC,KAAKo0C,GACDG,EAAuBtC,EAAqBqC,QAChDnC,GACAnyC,KAAKo0C,GACPp4C,EAAG0U,IAAI,CAAC2jC,EAAuBE,IAC5Bv0C,MAAK,IAAiC,IAA/Bw0C,EAAcC,GAAiB,EACrCvpC,EAAW4nC,QAAU0B,EACrBtpC,EAAWwnC,OAAS+B,EAEhBvpC,EAAW4nC,QAAQ4B,aAAexpC,EAAWwnC,OAAOH,GACtD4B,GAAK,EAELjpC,EAAWwnC,OAAOH,IAAK,EAGa,iBAAlCrnC,EAAW+nC,SAAS0B,WACtBrC,EAAO6B,GAzMbzmC,EAAOi5B,GAjBT,WAAoB,QAClB,MAAMiO,EAAS1pC,EAAW+nC,SAAS2B,OAC7B9B,IAAU5nC,MAAAA,GAAA,UAAAA,EAAY4nC,eAAZ,mBAAqB4B,mBAArB,UAAkCp0C,IAE5Cu0C,EACJrQ,OAAOt5B,EAAW+nC,SAAS6B,kBAC3BtQ,OAAOt5B,EAAW+nC,SAAS8B,qBACzBvQ,OAAOt5B,EAAW+nC,SAAS6B,iBAE/B,SAAMhC,IAAa+B,GAAYD,GAQrBI,GAAa,aAAe,cAAe,KAAM,CACzDlqC,SAAU,YA8MR,IAAI2nC,EAAM,GAKRA,EAHAvnC,EAAW+nC,SAAS2B,SACnB1pC,EAAW+nC,SAASgC,gBAEf,OAEA,UAGRpqC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,EACAO,UAAAA,EACAG,WAAAA,EACAQ,cAAAA,EACAI,aAAAA,GAEF,KAGF,MAAME,EAAQ34B,SAAS45B,cAAc,SACrC55B,SAASpB,KAAKi7B,YAAYlB,GAC1BA,EAAMmB,MAAMC,WACV,2BAA6BnqC,EAAW+nC,SAASC,MAAQ,kBAG5D57B,MAAM26B,EAAqBW,iBAKhCP,EAAGiD,MA5MH,WACE,MAAMZ,EAAcxpC,EAAW4nC,QAAQ4B,YAEvC,GAAIA,GAAeA,EAAYp0C,GAAI,CAEjC,MAAMi1C,EAAUvD,EACbuD,UACAlmC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,eAC9CC,qBAAoB,GACpBrN,MACCl9B,EAAW+nC,SAASyC,iBAClB,yCAEHC,GAAG,MACHv8C,OAAO,UAEV44C,EACG4D,KAAKL,GACLv1C,MAAK,WACJ,OAAOkyC,EAAI2D,gBAAgBC,aAAa,CACtCx1C,GAAIo0C,EAAYp0C,GAChBy1C,QAAQ,EACRC,YAAa,YAEZC,YAEJj2C,MAAK,WACJ0N,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAGbwM,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM,YAAa6nB,QA6KnCkwB,EAAGC,OAASA,EACZD,EAAG6D,SAzKH,WACE,MAAM3M,EAAWvtC,EAAGkF,QACdwzC,EAAcxpC,EAAW4nC,QAAQ4B,YA4DvC,OA1DIA,GAAeA,EAAYp0C,IAC7B4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAO1B,EAAYp0C,GACnB+1C,YAAY,EACZC,eAAe,IAEhBL,SAASj2C,MAAK,SAAUpD,GACvB2sC,EAAS3nC,QACP20C,GAAAA,CAAK35C,EAAK45C,KAAKz/C,MAAM,IAAI,SAAU0/C,GACjC,IAAIC,EASJ,GAPsB,OAAlBD,EAAIE,YACND,EACExrC,EAAW+nC,SAAS2D,eACpB1rC,EAAW4nC,QAAQ3uB,MACnB,UAAYsyB,EAAII,WAGE,QAAlBJ,EAAIE,UACN,OAAQzrC,EAAW+nC,SAAS6D,iBAC1B,IAAK,gBACHJ,EAASD,EAAIM,OACT7rC,EAAW+nC,SAAS+D,WAAaP,EAAIM,OACrC,SACJ,MAEF,IAAK,cACHL,EAASD,EAAIM,OACTN,EAAIQ,KAAKC,OAAST,EAAIQ,KAAKE,SAC3B,SACJ,MAEF,IAAK,iBACHT,EAASD,EAAIM,OAASN,EAAIQ,KAAKE,SAAW,SAC1C,MAEF,QACET,EAASD,EAAIM,OACT7rC,EAAW+nC,SAAS+D,WAAaP,EAAIM,OACrC,SAKV,MAAO,CACLL,OAAQA,EACR3d,QAAS0d,EAAIW,KACbC,UAAWC,GAAAA,CAAOb,EAAIY,WAAWx6B,OAAO,+BAK/CvF,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAIbonB,EAAS7wC,SA4GlB25C,EAAGkF,eA7OH,WACE,MAA4C,YAArCrsC,EAAW+nC,SAASuE,aAA6B,OAAS,OA6OnE,MAAMC,EAAgB,CACpB7C,OAAQ,CAAC,SAAU,OAAQ,UAAW,UAAW,aACjD8C,QAAS,CAAC,YAKZlvC,OAAO+6B,eAAer4B,EAAY,cAAe,CAC/CvF,MACE,IAAIpK,EAAS2P,EAAW+nC,SAAS0E,aAMjC,OALIF,EAAc7C,OAAOrmC,SAASrD,EAAW6nC,QAC3Cx3C,EAAS2P,EAAW+nC,SAAS2E,cACpBH,EAAcC,QAAQnpC,SAASrD,EAAW6nC,UACnDx3C,EAAS2P,EAAW+nC,SAAS4E,gBAExBt8C,KAIXigB,OAAOs8B,iBACL,WACA,SAAU3sC,GACa,SAAjBA,EAAIvO,KAAKuO,IACXmnC,GAAO,GACmB,SAAjBnnC,EAAIvO,KAAKuO,KAClBmnC,GAAO,MAGX,2eCvTJ,SAASyF,EAAS7sC,EAAYF,GAE5B,MAAM3H,EAAS2H,EAAUo5B,SAGzBl5B,EAAW+nC,SAAW,CACpB+E,OAAQ,UACRC,MAAM,GAGRC,GAAAA,CAAO70C,GAAQ,SAAU5J,EAAOqB,GAChB,KAAVrB,GAAiB0+C,GAAAA,CAAO1+C,KACZ,SAAVA,IACFA,GAAQ,GAGI,UAAVA,IACFA,GAAQ,GAGVyR,EAAW+nC,SAASn4C,GAAOrB,MAI/ByR,EAAWJ,SAAWI,EAAW+nC,SAASnoC,SAC1CI,EAAWwnC,OAAS,CAAEH,IAAI,GAC1BrnC,EAAW4nC,QAAU,GAWvB,SAASsF,EACPC,EACA/uC,EACAgvC,EACAC,EACAC,GAEAlvC,EAAkBgB,WAAU,GAGvBguC,EAAcpjD,SAAS0R,QAAQjB,MAClC2yC,EAAcpjD,SAAS0R,QAAQjB,IAAM,IAIvC2yC,EAAcpjD,SAAS0R,QAAQjB,IAAI,qBACjC,gCAEF2yC,EAAcpjD,SAAS0R,QAAQjB,IAAI,iBAAmB,WACtD2yC,EAAcpjD,SAAS0R,QAAQjB,IAAI8yC,OAAS,WAG5CF,EAA4BG,UAAUF,GAGtCH,EACG31C,MAAM,MAAO,CACZkxB,UAAU,IAEXlxB,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAasyC,EACb1iD,WAAY,4BAEbyM,MAAM,aAAc,CACnBgE,IAAK,UACLL,YAAauyC,EACb3iD,WAAY,2BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAawyC,EACb5iD,WAAY,4BAEbyM,MAAM,WAAY,CACjBgE,IAAK,QACLL,YAAayyC,EACb7iD,WAAY,yBAEbyM,MAAM,gBAAiB,CACtBgE,IAAK,aACLL,YAAa0yC,EACb9iD,WAAY,8BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAa2yC,EACb/iD,WAAY,0OC3FlB,SAASgjD,EACP/tC,EACAwC,EACAwrC,EACAhH,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAIX,SAASmmC,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG8G,OAAO1+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMw8C,EAAQF,EACXG,SACAC,YACCpuC,EAAW+nC,SAASsG,0BAClB,yBAEHC,WAAW,oBACXC,SAAS,OAEZP,EAAStD,KAAKwD,IAIlB,SAASM,IACPxuC,EAAWyuC,SAAU,EAkBvB,SAASC,IACH1uC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGwH,KAAO,GACVxH,EAAGyH,QAAU,KACbzH,EAAG0H,UAAY,KACf1H,EAAG2H,SAASC,eACZ5H,EAAG2H,SAASE,uBAELhvC,EAAW4nC,QAAQ4B,YAE1BxpC,EAAWivC,gBAAiB,EAiD9B9H,EAAG/vC,QAjFH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBmI,WAAWhI,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBmI,WAAWjI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWyuC,SAAU,KAsEtCtH,EAAGgI,OA1CH,WACEnvC,EAAWyuC,SAAU,EAEjBzuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDP,MACCgF,GAAAA,CACE,CACEh6C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnCi6C,WAAYrvC,EAAW+nC,SAASsH,WAChCC,SACEtvC,EAAW+nC,SAAS2D,eAAiB1rC,EAAW4nC,QAAQ3uB,MAE5DkuB,EAAGwH,OAGN5D,SAASj2C,MAAK,kBACNqyC,EAAG8G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCpuC,EAAW+nC,SAASwH,0BAClB,2BAEHjB,WAAW,oBACXnqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjD0D,EAAStD,KAAKwD,MAEfp5C,KAAK0wC,GACL1wC,KAAK45C,GACLtiC,MAAM8jB,EAAY,WAClBsf,QAAQhB,IAEXA,IACAte,EAAY,YAOhBiX,EAAGsI,KAhDH,WACEjK,IACAkJ,KAgDFvH,EAAGwH,KAAO,GACVxH,EAAG8G,OAAS,GCjId,SAASyB,EAAW1vC,EAAY2vC,GAC9B,MAAMC,EAAgB,CACpBx6C,GAAI,MACJkW,MAAOtL,EAAW+nC,SAASz8B,OAGvB07B,EAAM,GAyEZ,OAvEAA,EAAI6I,QAAU7vC,EAAW+nC,SAAS+H,OAAS,QAE3C9I,EAAI+I,YAAcJ,EAChB3I,EAAI6I,QAAU,oBACdD,EACA,CACE5c,OAAQ,CACNgd,OAAQ,OACRx0C,IAAKwrC,EAAI6I,QAAU,4BAErBrD,QAAS,CACPwD,OAAQ,OACRx0C,IAAKwrC,EAAI6I,QAAU,6BAErBI,UAAW,CACTD,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,8BAKzB7I,EAAI2D,gBAAkBgF,EACpB3I,EAAI6I,QAAU,wBACdD,EACA,CACEzpC,OAAQ,CACN6pC,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,yBAErBjF,aAAc,CACZoF,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,uCAErBzF,MAAO,CACL4F,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,+BAErB5E,YAAa,CACX+E,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,wCAErBK,iBAAkB,CAChBF,OAAQ,OACRx0C,IAAKwrC,EAAI6I,QAAU,0CACnBn0C,QAAS,CACP,oBAAgBwC,GAElBiyC,iBAAkBvmD,QAAQ6c,UAE5B2pC,mBAAoB,CAClBJ,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,6CAErBQ,QAAS,CACPL,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,mCAKzB7I,EAAIsJ,YAAcX,EAChB3I,EAAI6I,QAAU,oBACdD,EACA,CACEzpC,OAAQ,CACN6pC,OAAQ,MACRx0C,IAAKwrC,EAAI6I,QAAU,uBAKlB7I,mTChET,SAASuJ,EACPvlD,EACAgV,EACAzS,EACAijD,EACAC,EACAjuC,EACApI,EACA4zC,EACAhH,EACAD,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KACX,IAAI2mD,EACAC,EACAC,EACAC,EAIAC,GAAmB,EA4BvB,SAASC,IAEPjgD,EAAAA,GAAAA,IAAO,CACLi2C,EAAqBmI,WAAWhI,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBmI,WAAWjI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,KAhBJkL,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,eAoB/C,SAASoxC,IACPzjD,GAAS,WACP,MAAMT,EAAU2jD,EAAU,GAAGQ,uBAAuB,iBAAiB,GAEjEnkD,IACFA,EAAQokD,UAAYpkD,EAAQqkD,iBAKlC,SAASC,IACPjK,EAAG8G,OAAS,GACZjuC,EAAWzJ,MAAM,QAEjB,MAAM23C,EAAQF,EACXG,SACAC,YACC,8CAEDE,WAAW,yBAA2BtuC,EAAW+nC,SAASuE,cAC1DnoC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjD0D,EAAStD,KAAKwD,GAIhB,SAAShe,EAAY3gC,GACnB,OAAO,SAAU0nB,GAAK,UAEC,OAAnB,UAAAA,EAAIvlB,YAAJ,eAAU2/C,OACkB,mBAA5B,UAAAp6B,EAAIvlB,YAAJ,mBAAUqnC,eAAV,eAAmB9/B,OAEnB+G,EAAW+nC,SAAS2B,QAAS,EAC7B1pC,EAAW+nC,SAASuJ,eAAgB,EACpC9uC,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,cAGZunC,EAAG8G,OAAO1+C,GAAQ0nB,EAAIvlB,KACtBs/C,MAKN,SAASO,EAAY1jB,GAEfijB,IAIJA,GAAmB,EACnB9J,EAAI+I,YACD/c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,GACvBy1C,EAAG8G,OAAS,GACZ,IAAIuD,GAAkB,EAClBvE,GAAAA,CAAOjtC,EAAW4nC,QAAQ4B,eAC5BxpC,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAEvBo8C,GAAkB,GAEfxxC,EAAW4nC,QAAQ6J,qBACtBzxC,EAAW4nC,QAAQ6J,oBAAqB,EACxCD,GAAkB,GAGhBA,GACFzK,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEhCgJ,EAAU,GAAGgB,aAAaC,QAAQ,IAElCX,OAED5kC,MAAM8jB,EAAY,qBAClBsf,SAAQ,KACPsB,GAAmB,MA2EzB,SAASc,IAEL5xC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,IAE/B4xC,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG8G,OAAO2D,eAGblgD,EAAKm5C,SACP7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEL,cAArBh2C,EAAKmgD,YACPrvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAE7C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,gBAIhDwM,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACHmxC,IACA,MACF,KAAK,IACHvuC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAQ1B,SAAS66B,EAAM/M,GACb,MAAMmH,EAAOwE,EAAU,GAAGgB,aAAaK,UAEnChN,GAA6B,KAAnBA,EAAOH,SAAkBG,EAAOiN,UAK1CjN,GAA6B,KAAnBA,EAAOH,SAKR,KAATsH,GAKJqF,EACEnC,GAAAA,CACE,CACElD,KAAMA,GAERlsC,EAAW4nC,UAqCjB,SAASqD,IAAc,QACjBjrC,MAAAA,GAAJ,UAAIA,EAAY4nC,eAAhB,iBAAI,EAAqB4B,mBAAzB,OAAI,EAAkCp0C,IACpC4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,GACtC68C,cAAc,EACd78C,GAAIy7C,QAAiB3yC,IAEtB6sC,SAASj2C,MAAK,SAAUpD,GAIvB,UAHOy1C,EAAG8G,OAAOzE,YAGb93C,EAAKuC,MAAO,CACd,IAAIi+C,GAAQ,EACR9qC,EAAI,EACR,IAAKA,EAAI,EAAG8qC,GAAQ,EAAO9qC,EAAI1V,EAAK45C,KAAKnyC,OAAQiO,IAAK,CACpD,MAAMrI,EAAIozC,GAAAA,CAAMnyC,EAAWoyC,SAAU,CACnCh9C,GAAI1D,EAAK45C,KAAKlkC,GAAGhS,KAEd2J,EAGMrN,EAAK45C,KAAKlkC,GAAGywB,OACtB94B,EAAE84B,MAAO,IAHTqa,GAAQ,EACRlyC,EAAWoyC,SAAS5nD,KAAKkH,EAAK45C,KAAKlkC,KAMN,QAA3B1V,EAAK45C,KAAKlkC,GAAGqkC,WAAwB/5C,EAAK45C,KAAKlkC,GAAGywB,OAtC3CziC,EAuCK1D,EAAK45C,KAAKlkC,GAAGhS,GAtChC4xC,EAAIsJ,YACRnqC,OAAO,CACN/Q,GAAIA,EACJyiC,MAAM,IAEPkT,SAAS3+B,OAAM,SAAU6K,GACxB1G,QAAQnhB,MAAM6nB,OAoCNi7B,GAEFlB,IAGEt/C,EAAK45C,KAAKlkC,EAAI,GAAGywB,OACnBgZ,EAAgBn/C,EAAK45C,KAAKlkC,EAAI,GAAGhS,IAG/By7C,IAAkB7wC,EAAW4nC,QAAQ6J,oBACvC1K,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACd6J,oBAAoB,IACnB38C,MAAMvG,IACPyR,EAAW4nC,QAAUr5C,KAzDnC,IAAuB6G,KA8DhBgX,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAhX1BkwB,EAAG8G,OAAS,GACZjuC,EAAWoyC,SAAW,GACtBjL,EAAGkL,aAAe,CAChBC,gBAAgB,EAChBC,YAAY,EACZC,OAAO,EACPlgD,MAAM,EACNmgD,WAAY,UAGdtL,EAAGuL,cAAgB,CACjBC,uBAAuB,GAgZzBxL,EAAG/vC,QArCH,WACEmZ,QAAQo3B,MAAM,mCAAoC3nC,EAAW4nC,SAC7D5nC,EAAW6nC,OAAS,OACpB7nC,EAAWyuC,SAAU,EACrBzuC,EAAW+nC,SAAS6K,UAAW,EAE/BzL,EAAG0L,aAAe,GAGhB7yC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYqB,OAG/BkG,KAGAa,IAGAjB,EAAsBH,EAAUvF,EAAa,KAC7C2F,EAAyBJ,EAAUoB,EAAgB,MAGrDlB,EAAYoC,EAAE,iBAAiBpB,aAAa,CAC1CqB,YAAa/yC,EAAW+nC,SAASiL,oBAAsB,iBACvD5oD,OAAQ,CACN6oD,MAAO,SAAUC,EAAQnO,GACvB+M,EAAM/M,IAERoO,MAAO,WACLppD,KAAKqpD,gBAQbjM,EAAG2K,MAAQA,EACX3K,EAAGkM,aAzIH,WACE,MAAMnH,EAAOwE,EAAU,GAAGgB,aAAaK,UAG1B,KAAT7F,IAKJqF,EACEnC,GAAAA,CACE,CACElD,KAAMA,GAERlsC,EAAW4nC,UAIf8I,EAAU,GAAGgB,aAAa0B,aAwH5BjM,EAAGx4C,UAjSH,SAAmB+C,GACjB,GAAIA,EAAKie,KAjIS2jC,SAmIhB,YADAlC,IAIF,MAAMmC,EAAK,IAAIC,SAEfD,EAAGnvB,OAAO,OAAQ1yB,EAAK7B,MAEvBuK,EACGopC,KACCxjC,EAAW+nC,SAAS+H,OAClB,0BACA9vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,4BACA4K,EAAW+nC,SAASz8B,MACtBioC,EACA,CACEpD,iBAAkBvmD,QAAQ6c,SAC1B/K,QAAS,CACP,oBAAgBwC,KAIrBpJ,MAAK,SAAUpD,IACdA,EAAOA,EAAKA,MAEH0D,IACP+xC,EAAG8G,OAAS,GAEZsD,EACEnC,GAAAA,CACE,CACElD,KACE,YACAlsC,EAAW+nC,SAAS+H,OACpB,0BACA9vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,iCACA1D,EAAK0D,GACL,UACA4K,EAAW+nC,SAASz8B,MACpB,qBACA5Z,EAAKnC,KACL,OACFkkD,aAAc/hD,EAAK0D,IAErB4K,EAAW4nC,WAIf1X,EAAY,oBAEbA,EAAY,oBA4OnBiX,EAAGiK,gBAAkBA,EAGrBpmD,EAAOsB,IAAI,YA5OX,WACEkkD,EAAUtiD,OAAOyiD,GACjBH,EAAUtiD,OAAO0iD,GAEjBD,EAAsB,KACtBC,EAAyB,QAwO3B5wC,EAAW1T,IAAI,aArOf,SAAoBoF,EAAMnH,GACpBA,GACFA,EAASmpD,GAAAA,CAAQ1zC,EAAWoyC,sWC9NlC,SAASuB,EACP3oD,EACAgV,EACA4zC,EACA5M,EACAgH,EACAv8C,EACA2I,GAEA,MAAM+sC,EAAKp9C,KACX,IAAI8pD,EAAU,KACVC,EAAgB,KACpB9zC,EAAW+zC,UAAY,GAEvB,MAAMC,EAAkB,CACtBC,sBAAsB,EACtBC,mBAAmB,EACnB/+B,QAAS,SAAU5mB,GACjB,MAAqB,kBAAVA,GACDA,EAAQ,IAAM,IAEjBA,IA+IX,SAAS4lD,WACAhN,EAAG8G,OAAOkB,OACjBnvC,EAAWzJ,MAAM,QAGjB4wC,EAAGiN,OAASC,GAAAA,CAAWP,GAEvB3M,EAAGwH,KAAO,GACVxH,EAAG2H,SAASC,eACZ5H,EAAG2H,SAASE,gBAEZ,MAAMd,EAAQF,EACXG,SACAC,YACCpuC,EAAW+nC,SAASwH,0BAClB,2BAEHjB,WAAW,yBAA2BtuC,EAAW+nC,SAASuE,cAC1DnoC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjD0D,EAAStD,KAAKwD,GA/JhB/G,EAAGmN,YAAc,SAAUhlD,GACzB,OAAOskD,EAAKU,YAAYhlD,IAkT1B63C,EAAGoN,iBAtDH,SAA0BpO,GAExB,MAAMqO,EAAWrN,EAAGiN,OAAOjO,GACrBsO,EAAahjD,EAASoZ,KAAK,gBACjC,GAAI4pC,EAAWt7C,OAAQ,CACrB,MAAMu7C,EAAS9qD,QAAQkD,QACrB2nD,EAAW,GAAGnK,cAAc,mBAExB3tC,EAAQ/S,QAAQkD,QACpB2nD,EAAW,GAAGnK,cAAc,qBAExBqK,EAAQD,EAAO7pC,KAAK,SAEtB8pC,EAAMx7C,QACRw7C,EAAMC,IAAI,UAAW,QAGvBF,EAAOrqD,GAAG,SAAS,KACjBsqD,EAAMC,IAAI,UAAW,QACI,mBAAlBj4C,EAAMk4C,QACTl4C,EAAMk4C,QAAQ,SACdl4C,EAAM,GAAGm4C,WAGfn4C,EAAMtS,GAAG,UAAWgiB,IAClBrhB,EAAOgD,QAAO,WACwB,iBAAzBwmD,EAASO,MAAM3lD,QACxBolD,EAASO,MAAM3lD,MAAQ,MAKzB,MAAMmB,EAAQ5E,MAAMstB,KAAK5M,EAAEjc,OAAOG,OAE5BykD,EAnUL,QAmUiBR,EAASl/C,OAAOqa,KACdpf,EAAM0kD,MAAMplD,GAASA,EAAK8f,MAAQqlC,KAKpDR,EAAStqD,QAAU,GACnBsqD,EAASO,MAAM3lD,MAAQolD,EAASl/C,OAAO4/C,eAtLjD,SAAyBF,GACvB7N,EAAG8G,OAAS,GACZjuC,EAAWzJ,MAAM,QACjB,MAAM23C,EAAQF,EACXG,SACAC,YAAY,yCAA2C4G,EAAY,MACnE1G,WAAW,yBAA2BtuC,EAAW+nC,SAASuE,cAC1DnoC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBACjD0D,EAAStD,KAAKwD,GA+KNkD,CAAgBoD,EAASl/C,OAAOqa,OAEhC6kC,EAAStqD,QAAUqG,EAAMmI,KAAK7I,IAC5B,MAAM,KAAEN,EAAF,KAAQogB,EAAR,KAAc1W,GAASpJ,EAC7B,MAAO,CAAEN,KAAAA,EAAMogB,KAAAA,EAAM1W,KAAAA,EAAMpJ,KAAAA,MAG/Bs3C,EAAGwH,KAAK6F,EAASO,MAAM7X,OAASsX,EAAStqD,gBAkBjDi9C,EAAGgO,eANH,SAAwBX,EAAUrO,GAGhCqO,EAAStqD,QAAQqf,OAAO48B,EAAO,GAC/BgB,EAAGwH,KAAK6F,EAASO,MAAM7X,OAASsX,EAAStqD,SAuB3Ci9C,EAAGiO,eAfH,SAAwBZ,GACtBjkC,QAAQN,IAAI,kBAAmBukC,GAC/B,MAAMC,EAAahjD,EAASoZ,KAAK,gBAC3BlO,EAAQ/S,QAAQkD,QACpB2nD,EAAW,GAAGnK,cAAc,sBAExB,eAAE+K,EAAF,OAAkBzqC,GAAW4pC,EAASl/C,OACxC+/C,GACF14C,EAAME,KAAK,WAAY,YAErB+N,GACFjO,EAAM,GAAG24C,aAAa,SAAU1qC,IAapCu8B,EAAGoO,uBAPH,WACE,MAAMC,EAAW7pD,MAAMstB,KAAKxnB,EAASoZ,KAAK,oBACpC4qC,EAAUD,EAASA,EAASr8C,OAAS,GACvCs8C,GAAWA,EAAQxuC,gBACrBwuC,EAAQxuC,kBAMZkgC,EAAG/vC,QAzUH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpBV,EAAGS,QAAU,CACXxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBsgD,cAAe,YACfz8B,KA3BK,YAAc08B,GAAAA,CAAQ,EAAG,MA8BhC31C,EAAW+nC,SAAS6K,UAAW,EAC/B5yC,EAAWyuC,SAAU,EAErBzH,EAAI+I,YACDE,UAAU,CACT76C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP4/C,EAAUniD,EAAKmiD,QACfC,EAAgBO,GAAAA,CAAW3iD,EAAK45C,MAChCnE,EAAGiN,OAASC,GAAAA,CAAWP,OAG1Bh/C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAGiN,OAAOj7C,OAAQiO,IAAK,CACzC,MAAMwuC,EAAQzO,EAAGiN,OAAOhtC,GAExB,GADApH,EAAW+zC,WAAa6B,EAAM38C,UACH,IAAhB28C,EAAMb,OACXa,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS5iD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAG4O,UAAU3uC,GAAK0uC,EAAOF,EAAMb,MAAMc,eAK5CzpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAEfu4B,SAAQ,WACP,GAAIxvC,EAAW+nC,SAASuJ,cAAe,CACrCtxC,EAAW+nC,SAASuJ,eAAgB,EAEpC,MAAMpD,EAvDLF,EACJG,SACAC,YACC,oEAED4H,UAAU,KACV1H,WAAW,oBACXnqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAiD3C0D,EAAStD,KAAKwD,QA4RtB/G,EAAGgI,OA7LH,WAEEnvC,EAAWyuC,SAAU,EAErB,MAAM/8C,EAAO,IAAKy1C,EAAGwH,MAErB,IAAK,IAAIvnC,EAAI,EAAGA,EAAI+/B,EAAGiN,OAAOj7C,OAAQiO,IAAK,CACzC,MAAMwuC,EAAQzO,EAAGiN,OAAOhtC,GACpBwuC,EAAMb,YAA4C,IAA5BrjD,EAAKkkD,EAAMb,MAAM7X,SAEpC+P,GAAAA,CAAO2I,EAAMK,WAChB9O,EAAGS,QAAQgO,EAAMK,SAAWtqD,MAAMoQ,QAAQrK,EAAKkkD,EAAMb,MAAM7X,QACvDxrC,EAAKkkD,EAAMb,MAAM7X,OAAOlgC,OACxBtL,EAAKkkD,EAAMb,MAAM7X,QAGnB91B,IAAMysC,IACH5G,GAAAA,CAAOjtC,EAAW+nC,SAAS2N,iBAC9BvO,EAAGS,QAAQ8N,cAAgB11C,EAAW+nC,SAAS2N,cAC/CvO,EAAGS,QAAQ3uB,KAAOttB,MAAMoQ,QAAQrK,EAAKkkD,EAAMb,MAAM7X,QAC7CxrC,EAAKkkD,EAAMb,MAAM7X,OAAOlgC,OACxBtL,EAAKkkD,EAAMb,MAAM7X,SAIN,WAAf0Y,EAAM38C,OACRvH,EAAKkkD,EAAMb,MAAM7X,OAASxrC,EAAKkkD,EAAMb,MAAM7X,OAAOxkC,KAC/C+U,GAASA,EAAK5d,SAMvB,MAAMqmD,EAAevqD,MAAMoQ,QAAQorC,EAAGiN,QAClCjN,EAAGiN,OAAO/gD,QAAQuiD,GAAyB,WAAfA,EAAM38C,OAClC,GAEEk9C,EAAU/G,GAAAA,CACd,CACElD,KAAMx6C,GAERy1C,EAAGS,SAGCwO,EAA4B,MAAR1kD,GAAgBwkD,EAAa/8C,OAAS,EAC1Dk9C,EAAyB,OAAT3kD,GAA0C,OAAzBqW,KAAKE,UAAUvW,GAnFxD,IAAgB4kD,EAnDK/mD,GAuIG6mD,GApFRE,EAqFHH,EApFJ/7C,EAAM,CACXoB,IAAM,GAAEwrC,EAAI6I,wBAAwByG,EAAQlhD,aAC5CsG,QAAS,CAAE,oBAAgBwC,GAC3BxM,KAAM6kD,GAAAA,CAAeD,EAAS,IACzBtC,EACHwC,gBAAiB,IAAIhD,WAEvBxD,OAAQ,UA8ENqG,EACArP,EAAI+I,YAAYvD,QAAQ2J,GAASpL,SACjC5M,QAAQC,OAAO,iBAGhBtpC,KAAKq/C,GACL/nC,OA/IgB7c,EA+IE,SA9HZ,SAAU0nB,GACf,MAAMi3B,EAAQF,EACXG,SACAC,YACCpuC,EAAW+nC,SAASsG,0BAClB,yBAEHC,WACC,yBAA2BtuC,EAAW+nC,SAASuE,cAEhDnoC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjD0D,EAAStD,KAAKwD,GAEd/G,EAAG8G,OAAO1+C,GAAQ0nB,EAAIvlB,QAiHvB89C,SAAQ,KACFrI,EAAGwH,KAAKvgB,UACX+Y,EAAGwH,KAAO,IApNhB3uC,EAAWyuC,SAAU,MAyVvBtH,EAAGC,OA/HH,SAAgB73C,EAAM2a,GACfi9B,EAAGwH,KAAKp/C,KACX43C,EAAGwH,KAAKp/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGwH,KAAKp/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGwH,KAAKp/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGwH,KAAKp/C,GAAM/E,KAAK0f,IAuHvBi9B,EAAGhd,OAnHH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGwH,KAAKp/C,KACX43C,EAAGwH,KAAKp/C,GAAQ,IAGX43C,EAAGwH,KAAKp/C,GAAM0I,QAAQiS,IAAS,GA+GxCi9B,EAAG4O,UAAY,GAEf5O,EAAGwH,KAAO,GACVxH,EAAG8G,OAAS,GACZ9G,EAAG2H,SAAW,GCtYhB,SAAS2H,EACPz2C,EACAwC,EACAoxC,EACA5M,EACAD,EACAG,GAEA,MAAMC,EAAKp9C,KACX,IAAI8pD,EAAU,KAed,SAAS6C,IACF12C,EAAW+nC,SAAS2B,OAKb1pC,EAAW+nC,SAAS4O,sBAO9Bn0C,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,YANZ4C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,aAPZI,EAAW+nC,SAASuJ,eAAgB,EACpC9uC,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,aA6IhB,SAASg3C,IASP,OARA52C,EAAW4nC,QAAU,CACnBxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxByhD,OAAQ,YACR59B,KAhCK,YAAc08B,GAAAA,CAAQ,EAAG,MAmChC31C,EAAW+nC,SAAS6K,UAAW,EAExB7L,EAAqBO,cAC1BJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACdy4C,EAAI+I,YACRE,UAAU,CACT76C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACP4/C,EAAUniD,EAAKmiD,QACf1M,EAAGiN,OAAS1iD,EAAK45C,SAGpBx2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAGiN,OAAOj7C,OAAQiO,IAAK,CACzC,MAAMwuC,EAAQzO,EAAGiN,OAAOhtC,GACxB,GAAIwuC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAAS5iD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAG4O,UAAU3uC,GAAK0uC,EAAOF,EAAMb,MAAMc,eAI1CzpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,SAGnB7K,MAAM26B,EAAqBW,gBAtMhCP,EAAG4O,UAAY,GAGf5O,EAAGwH,KAAO,GACVxH,EAAG8G,OAAS,GACZ9G,EAAG2H,SAAW,GACd3H,EAAG2P,aAAc,EAEjB3P,EAAGmN,YAAc,SAAUhlD,GACzB,OAAOskD,EAAKU,YAAYhlD,IAgP1B63C,EAAG/vC,QAhDH,WAKE,GAJAmZ,QAAQo3B,MAAM,qCAAsC3nC,EAAW4nC,SAE/D5nC,EAAW6nC,OAAS,SAEhB7nC,EAAW4nC,SAAW5nC,EAAW4nC,QAAQ4B,YAC3C,GAAIxpC,EAAW4nC,QAAQ4B,YAAYp0C,GACjC,IAA8C,IAA1C4K,EAAW4nC,QAAQ6J,mBAErBjvC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,gBAEP,SACL,MAAMm3C,EAAoB/2C,EAAW4nC,QAAQ4B,YAAYp0C,GACnD4hD,EAAYh3C,MAAAA,GAAH,UAAGA,EAAY4nC,eAAf,iBAAG,EAAqB/Z,eAAxB,aAAG,EAA8Bz4B,GAChD,GAAI4hD,EAAW,CACb,MAAMtlD,EAAO,CACX0D,GAAI2hD,EACJE,QAAS,OACTzN,YAAa,CACXp0C,GAAI2hD,GAENlpB,QAAS,CACPz4B,GAAI4hD,GAENnF,YAAa,YACbhH,QAAQ,EACRC,YAAa,WAIf9D,EAAI2D,gBAAgB0F,QAAQ3+C,GAAMq5C,SAASyE,SAAQ,IAC1CoH,YAMbp0C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,iBAIdg3C,KAMJzP,EAAGgI,OA5KH,WACE,IAAIjD,EAAO,sBAEX,IAAK,IAAI9kC,EAAI,EAAGA,EAAI+/B,EAAGiN,OAAOj7C,OAAQiO,IAAK,CACzC,MAAMwuC,EAAQzO,EAAGiN,OAAOhtC,GAEpBwuC,EAAMb,YAA+C,IAA/B5N,EAAGwH,KAAKiH,EAAMb,MAAM7X,SAEvC+P,GAAAA,CAAO2I,EAAMsB,YAChBl3C,EAAW4nC,QAAQgO,EAAMsB,UAAYvrD,MAAMoQ,QACzCorC,EAAGwH,KAAKiH,EAAMb,MAAM7X,QAElBiK,EAAGwH,KAAKiH,EAAMb,MAAM7X,OAAOlgC,OAC3BmqC,EAAGwH,KAAKiH,EAAMb,MAAM7X,QAGrB+P,GAAAA,CAAO2I,EAAMK,WAChBj2C,EAAW4nC,QAAQgO,EAAMK,SAAWtqD,MAAMoQ,QACxCorC,EAAGwH,KAAKiH,EAAMb,MAAM7X,QAElBiK,EAAGwH,KAAKiH,EAAMb,MAAM7X,OAAOlgC,OAC3BmqC,EAAGwH,KAAKiH,EAAMb,MAAM7X,QAGtB91B,IAAMysC,IACH5G,GAAAA,CAAOjtC,EAAW+nC,SAAS8O,UAC9B72C,EAAW4nC,QAAQiP,OAAS72C,EAAW+nC,SAAS8O,OAChD72C,EAAW4nC,QAAQ3uB,KAAOttB,MAAMoQ,QAAQorC,EAAGwH,KAAKiH,EAAMb,MAAM7X,QACxDiK,EAAGwH,KAAKiH,EAAMb,MAAM7X,OAAOlgC,OAC3BmqC,EAAGwH,KAAKiH,EAAMb,MAAM7X,SAIxBiK,EAAGwH,KAAKiH,EAAMb,MAAM7X,SACtBgP,GAAQ0J,EAAMb,MAAM7X,MAAQ,KAAOiK,EAAGwH,KAAKiH,EAAMb,MAAM7X,OAAS,OA/ExE,IAAqBrP,EAAAA,EAsFjBuhB,GAAAA,CACE,CACElD,KAAMA,EACNiL,QAASn3C,EAAW+nC,SAASoP,QAC7BC,WAAYp3C,EAAW+nC,SAASqP,YAElCp3C,EAAW4nC,SA3FfT,EAAG2P,aAAc,EAEjB9P,EAAI+I,YACD/c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG8G,OAAOoJ,iBAEjBr3C,EAAW4nC,QAAQ/Z,QAAU,CAC3Bz4B,GAAI1D,EAAKm8B,QAAQz4B,IAGnB4K,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAIvB2xC,EAAqBO,cAAcJ,EAAiBlnC,EAAW4nC,SAC5D9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAG9BP,EAAG2P,aAAc,EAGjBJ,OAEDtqC,OAAM,SAAU6K,GAAK,UAEpBkwB,EAAG2P,aAAc,EAGI,OAAnB,UAAA7/B,EAAIvlB,YAAJ,eAAU2/C,OACkB,mBAA5B,UAAAp6B,EAAIvlB,YAAJ,mBAAUqnC,eAAV,eAAmB9/B,OAEnB+G,EAAW+nC,SAAS2B,QAAS,EAC7BgN,KAEAnmC,QAAQnhB,MAAM6nB,OAkLtBkwB,EAAGC,OArHH,SAAgB73C,EAAM2a,GACfi9B,EAAGwH,KAAKp/C,KACX43C,EAAGwH,KAAKp/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGwH,KAAKp/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGwH,KAAKp/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGwH,KAAKp/C,GAAM/E,KAAK0f,IA6GvBi9B,EAAGhd,OAzGH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGwH,KAAKp/C,KACX43C,EAAGwH,KAAKp/C,GAAQ,IAGX43C,EAAGwH,KAAKp/C,GAAM0I,QAAQiS,IAAS,GCrK1C,SAASotC,EACPt3C,EACAwC,EACAwrC,EACAhH,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAQX,SAAS2kD,IACH1uC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGwH,KAAO,GACVxH,EAAGyH,QAAU,KACbzH,EAAG0H,UAAY,KACf1H,EAAG2H,SAASC,eACZ5H,EAAG2H,SAASE,gBAEZhvC,EAAW4nC,QAAU,GAErB5nC,EAAWivC,gBAAiB,EAC5BjvC,EAAWzJ,MAAM,QAQnB,SAAS25B,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG8G,OAAO1+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMw8C,EAAQF,EACXG,SACAC,YACCpuC,EAAW+nC,SAASsG,0BAClB,yBAEHC,WAAW,oBACXnqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjD0D,EAAStD,KAAKwD,IAIlB,SAASM,IACPxuC,EAAWyuC,SAAU,EAjDvBtH,EAAGwH,KAAO,GACVxH,EAAG8G,OAAS,GAoGZ9G,EAAG/vC,QAhBH,WACEmZ,QAAQo3B,MAAM,wCAAyC3nC,EAAW4nC,SAClE5nC,EAAW6nC,OAAS,YAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBmI,WAAWhI,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBmI,WAAWjI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWyuC,SAAU,KAKtCtH,EAAGgI,OAlDH,WACEnvC,EAAWyuC,SAAU,EAEjBzuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDC,aAAa,CACZx1C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnCmiD,KAAMpQ,EAAGwH,KAAK4I,OAEfxM,SAASj2C,MAAK,kBACNqyC,EAAG8G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCpuC,EAAW+nC,SAASwH,0BAClB,2BAEHjB,WAAW,oBACXnqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjD0D,EAAStD,KAAKwD,MAEfp5C,KAAK0wC,GACL1wC,KAAK45C,GACLtiC,MAAM8jB,EAAY,WAClBsf,QAAQhB,IAEXA,IACAte,EAAY,YAsBhBiX,EAAGsI,KA7EH,WACEjK,IACAkJ,KCxCJ,SAAS8I,EACPx3C,EACAhV,EACAwlD,EACAhuC,EACAwkC,EACAD,EACAG,GAGA,IAAIuQ,EAA+B,KAGnC,SAAS7F,IACP,IAAIpI,EAAc,GACdkO,GAAO,EAEX1Q,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,GAGvB,OAFA83C,EAAc93C,EAEPs1C,EAAI2D,gBAAgBM,YAAY,CACrCC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,KACrC21C,YAEJj2C,MAAK,SAAUpD,GACdgmD,EAAOhmD,EAAK45C,KAAKnyC,OAAS,EAEtBqwC,EAAYqB,QACd7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACW,cAA5Bi7C,EAAYqI,aACdrvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,eAGhDwM,MAAM26B,EAAqBW,kBACrB8B,EAAYqC,QAAU6L,KAE3BlO,EAAYqC,SACd7rC,EAAW4nC,QAAQ4B,YAAYqC,OAASrC,EAAYqC,QAEtD9E,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACd6J,oBAAoB,IAEnB38C,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACrBiU,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,eAEzCwM,MAAM26B,EAAqBW,oBAKjCt7B,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA9DbltB,KAqFRqN,QAdH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGlB7nC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,KAG/BqiD,EAA+BjH,EAAUoB,EAAgB,OAQ7D5mD,EAAOsB,IAAI,YAtBX,WACEkkD,EAAUtiD,OAAOupD,iqBCzFrB,MAAM1Q,EAOJ54B,YAAYxO,EAASK,EAAYlP,GAAI,oBACnC/G,KAAK4tD,cAAgB,IAAIC,IAAI53C,EAAW+nC,SAAS8P,SAASC,OAC1D/tD,KAAK6V,SAAWI,EAAW+nC,SAASnoC,SACpC7V,KAAK+G,GAAKA,EACV/G,KAAK4V,QAAUA,EA4CjBo4C,QAAQnoD,EAAKrB,GACX,MAAMypD,EAAS,UACf,OAAOjuD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwBiuD,EAAQpoD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAClB,CAAEuQ,OAAAA,EAAQpoD,IAAAA,EAAKrB,MAAAA,GACfxE,KAAK4tD,kBASXvO,QAAQx5C,GACN,MAAMooD,EAAS,UACf,OAAOjuD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwBiuD,EAAQpoD,GAAK,CAAC2X,EAAG2C,KACvCxT,EAAQwT,MAEVngB,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEuQ,OAAAA,EAAQpoD,IAAAA,GAAO7F,KAAK4tD,kBAQ1DzI,WAAWt/C,GACT,MAAMooD,EAAS,aACf,OAAOjuD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwBiuD,EAAQpoD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEuQ,OAAAA,EAAQpoD,IAAAA,GAAO7F,KAAK4tD,kBAuB1DrQ,cAAc13C,EAAK8B,GAAsB,IAAhBkF,EAAgB,wDAEvC,OAAO7M,KAAKq/C,QAAQx5C,GAAKkF,MAAMoV,IAC7B,MAAM+tC,EAAU,EAAAluD,KAAA,UAAAA,KAAgBmgB,IAAS,GAMzC,OALItT,SACKqhD,EAAQluD,KAAK6V,UAEpBq4C,EAAQluD,KAAK6V,UAAYlO,EAEpB3H,KAAKguD,QAAQnoD,EAAKqoD,GAASnjD,MAAK,IAAMmjD,EAAQluD,KAAK6V,eAQ9D8nC,eAAezwB,GACb1G,QAAQnhB,MAAM,gBAAiB6nB,eAnHd+gC,EAAQpoD,EAAKrF,GAE9B,MAAM29B,EAAY7b,IAChB,MAAM6rC,EAAkB,GAAEF,UAC1B,GACE3rC,EAAEyrC,SAAW/tD,KAAK4tD,eAClB/nD,IAAQyc,EAAE3a,KAAK9B,KACfsoD,IAAmB7rC,EAAE3a,KAAKsmD,OAC1B,CACA,MAAM,OAAEA,EAAF,KAAU9tC,GAASmC,EAAE3a,KAE3B,OADA6e,QAAQo3B,MAAO,UAAS/3C,cAAgBooD,uBAA6B3rC,GAC7D2rC,GACN,IAAK,gBACHztD,EAASqF,GACT,MACF,IAAK,gBACHrF,EAASqF,EAAKsa,GACd,MACF,IAAK,mBACH3f,EAASqF,GACT,MACF,QACE2gB,QAAQo3B,MAAM,qBAAsBqQ,GAIxCjuD,KAAK4V,QAAQw4C,oBAAoB,UAAWjwB,GAAU,KAG1Dn+B,KAAK4V,QAAQitC,iBAAiB,UAAW1kB,GAAU,cAiD1CkwB,GACT,IAAIr0B,EAASq0B,EACb,GAAsB,iBAAXr0B,EACT,IACEA,EAAShc,KAAK/W,MAAMonD,GACpB,MAAOhpD,GACPmhB,QAAQ8nC,KAAM,oBAAmBD,KAAehpD,GAChD20B,EAASq0B,EAGb,OAAOr0B,EC3EX,SAASu0B,EAAgB1E,GACvB,OAAO,SAAUrlD,GACf,OAAOqlD,EAAKU,YAAY/lD,+DAoI5B3E,QACGC,OAFiB,cAEG,CACnB,YACA,SACA,aACA,aACA,aACA,aACA,QACA,UACA,YACA,qBACA,WACA,SAEDwJ,OAAO,YAAailD,GACpBC,SAAS,iBAAkB,eAC3BA,SAAS,kBAAmB,WAC5BA,SAAS,iBAAkB,UAC3B/2C,QAAQ,uBAAwBulC,GAChCn6C,UAAU,WAnCb,WACE,OAAO,SAAUC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,oBAAoB,SAAU/C,GACrB,KAAhBA,EAAMu6C,QACRh4C,EAAMmB,QAAO,WACXnB,EAAMzB,MAAM2B,EAAMyrD,YAEpBluD,EAAMgD,yBA6BXV,UAAU,WApJb,WAyGE,MAAO,CACL0F,KATF,SAAczF,EAAOC,GACnBA,EAAQzC,GAAG,SAAS,WACdwC,EAAMulD,SAASj5C,OAAS,GAlGhC,SAAsBtM,GAEpB,MAAM4rD,EAAMroC,SAAS45B,cAAc,OAC7BpC,EAAU/6C,EAAM+6C,QAChBG,EAAWl7C,EAAMk7C,SACvB,IAAI2Q,EAEJ,IAAK,IAAItxC,EAAI,EAAGA,EAAIva,EAAMulD,SAASj5C,OAAQiO,IAAK,CAC9C,MAAMymB,EAAUhhC,EAAMulD,SAAShrC,GAC/B,IAAIokC,EAAS,WACb,MAAMU,EAAO,YAAcre,EAAQqe,KAC7ByM,EACJ,YAAcvM,GAAAA,CAAOve,EAAQse,WAAWx6B,OAAO,uBAEjD,GAAU,IAANvK,EAAJ,CAKA,OAAQva,EAAMk7C,SAAS6D,iBACrB,IAAK,gBACHJ,GACwB,QAAtB3d,EAAQ4d,UACJ5d,EAAQge,OACN9D,EAAS+D,WAAaje,EAAQge,OAC9B,SACF9D,EAAS2D,eACT9D,EAAQ3uB,MACR,UAAY4U,EAAQ8d,UAC1B,MAEF,IAAK,cACHH,GACwB,QAAtB3d,EAAQ4d,UACJ5d,EAAQge,OACNhe,EAAQke,KAAKC,OAASne,EAAQke,KAAKE,SACnC,SACFlE,EAAS2D,eACT9D,EAAQ3uB,MACR,UAAY4U,EAAQ8d,UAC1B,MAEF,IAAK,iBACHH,GACwB,QAAtB3d,EAAQ4d,UACJ5d,EAAQge,OACNhe,EAAQke,KAAKE,SACb,SACFlE,EAAS2D,eACT9D,EAAQ3uB,MACR,UAAY4U,EAAQ8d,UAC1B,MAEF,QACEH,GACwB,QAAtB3d,EAAQ4d,UACJ5d,EAAQge,QACL9D,EAAS+D,YAAc,SAAWje,EAAQge,OAC3C,SACF9D,EAAS2D,eACT9D,EAAQ3uB,MACR,UAAY4U,EAAQ8d,UAG9B8M,EAAIxO,YAAY75B,SAASwoC,eAAepN,IACxCiN,EAAIxO,YAAY75B,SAAS45B,cAAc,OACvCyO,EAAIxO,YAAY75B,SAASwoC,eAAe1M,IACxCuM,EAAIxO,YAAY75B,SAAS45B,cAAc,OACvCyO,EAAIxO,YAAY75B,SAASwoC,eAAeD,IACxCF,EAAIxO,YAAY75B,SAAS45B,cAAc,OACvCyO,EAAIxO,YAAY75B,SAAS45B,cAAc,YAvDrC0O,EAAY7qB,EAAQse,UA0DxB,MAAM0M,EAAWvoC,OAAOonC,OAExBmB,EAASzoC,SAAS0oC,MAAM,sBAAwB1oC,SAAS8sB,MAAQ,YACjE2b,EAASzoC,SAAS0oC,MAAM,kBACxBD,EAASzoC,SAAS0oC,MAAM,iBAAmB/Q,EAASoP,QAAU,SAC9D0B,EAASzoC,SAAS0oC,MAChB,oBACE1M,GAAAA,CAAOsM,GAAW/mC,OAAO,uBACzB,SAEJknC,EAASzoC,SAAS0oC,MAChB,oBAAsB1M,GAAAA,GAASz6B,OAAO,uBAAyB,SAEjEknC,EAASzoC,SAAS0oC,MAAML,EAAIM,WAC5BF,EAASzoC,SAAS0oC,MAAM,kBAExBD,EAASzoC,SAASg6B,QAClByO,EAASG,QAETH,EAASI,QACTJ,EAASzO,QAML8O,CAAarsD,OAOjBqE,SAAU,QA2CXnG,WAAW,iBAAkBwlD,GAE7BxlD,WAAW,oBAAqBgjD,GAEhCz4C,OA3BH,sBA2BU,SAAU6jD,GAChBA,EAAmBC,qBAEpBruD,WAAW,kBAAmB87C,GAE9B58C,QAAQ,MAAOylD,GAEfp6C,OAAO43C,GACP5qC,IAAIuqC,GAEJ9hD,WAAW,oBAAqB4oD,GAEhCr+C,OAvCH,sBAuCU,SAAU6jD,GAChBA,EAAmBC,qBAEpBruD,WAAW,mBAAoB0rD,GAE/B1rD,WAAW,sBAAuBusD,GAElCvsD,WAAW,oBAAqBysD,wFChNnC3tD,EAAOwvD,QAAU,WACf,GAA0B,iBAAfC,WACT,OAAOA,WAGT,IAAI1xC,EAEJ,IAGEA,EAAI7d,MAAQ,IAAI0mB,SAAS,cAAb,GACZ,MAAOpE,GAEP,GAAsB,iBAAXiE,OACT,OAAOA,OAIT,GAAoB,iBAAT7Y,KACT,OAAOA,KAIT,QAAsB,IAAX,EAAAmQ,EACT,OAAO,EAAAA,EAIX,OAAOA,EA5BQ,wECHjB,WAoBE7d,QAjBM4d,EAAO,SAON,KAFU,EAAF,WACL,OAAQA,EAAK4uC,eAWjB,WAWJ,SAASx6C,EAAQhO,GAEb,MAAmC,mBAA5B,GAAK8Q,SAAS/S,KAAKiC,GAG9B,SAASwrD,EAAaxrD,GAElB,QAAQgO,EAAQhO,IAAuB,iBAARA,IAAsBA,GAASA,aAAeyrD,MAAWzrD,aAAeuuB,MAQ3G,SAASm9B,IAEL,MAA2B,mBAAbjG,SAGlB,SAASkG,IAEL,GAAID,IACA,OAAO,IAAIjG,SAkCnB,SAASmG,EAAmBC,EAAY1vD,EAAS2vD,EAAUC,GAEvD,IAAI3T,EAAQ,EAEZ,IAAK,IAAIv2C,KAAOgqD,EAAY,CAExB,GAAIA,EAAWntD,eAAemD,GAAM,CAEhC,IAAImqD,EAAWD,GAAalqD,EACxBrB,EAAQrE,EAAQirB,QAAQykC,EAAWhqD,IAevC,GAbIkqD,GAAaP,EAAaK,KAC1BG,EAAWD,EAAY,IAAMlqD,EAAM,KAGnCkqD,GAAa/9C,EAAQ69C,KAGjBG,EADAh+C,EAAQxN,IAAUrE,EAAQ+pD,qBACf6F,EAAY,IAAM3T,EAAQ,IAE1B2T,EAAY,MAI3B/9C,EAAQxN,IAAUgrD,EAAahrD,GAE/BorD,EAAmBprD,EAAOrE,EAAS2vD,EAAUE,QAE1C,GAAIxrD,aAAiByrD,SAExB,IAAK,IAAIvyC,EAAI,EAAGA,EAAIlZ,EAAM4K,OAAQsO,IAC9BoyC,EAASz1B,OAAO21B,EAAW,IAAMtyC,EAAI,IAAKlZ,EAAM2b,KAAKzC,SAElDlZ,aAAiBirD,KAExBK,EAASz1B,OAAO21B,EAAUxrD,EAAOA,EAAMgB,MAEhChB,aAAiB+tB,KAExBu9B,EAASz1B,OAAO21B,EAAUxrD,EAAM0rD,gBAEb,OAAV1rD,GAAkBrE,EAAQgqD,mBAAgC,OAAV3lD,SAA6B2P,IAAV3P,GAE5EsrD,EAASz1B,OAAO21B,EAAUxrD,GAGlC43C,IAEJ,OAAO0T,EAEX,OAhFA,SAAiBD,EAAY1vD,GAEzB,GAAIA,GAAWA,EAAQssD,iBAEnB,GAnB8B,mBAmBDtsD,EAAQssD,gBAnBlBpyB,OAqBf,KAAM,qDAEP,IAAKq1B,IAER,KAAM,8FA3Bd,IA0CQS,EA5DG,CAgDc,CACjB1D,gBAAiBkD,IACjBzF,sBAAsB,EACtBC,mBAAmB,EACnB/+B,QAAS,SAAS5mB,GACd,MAAqB,kBAAVA,GACCA,EAAQ,IAAK,IAElBA,IAIkCrE,GAAW,IA5DlCyO,QAAO,SAAUwhD,EAAOC,GAI9C,OAHA98C,OAAOC,KAAK68C,GAAetvD,SAAQ,SAAUuvD,GACzCF,EAAME,GAAaD,EAAcC,MAE9BF,IACR,IAyDH,OAAOR,EAAmBC,EAAYM,EAAeA,EAAc1D,kBA5EjCvsD,IACjC,QAFM,OAEN,oECDD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,8FAA8F1tC,MAClG,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C+tC,cAAe,SACfC,KAAM,SAAUl+C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExBm+C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,eACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN/0C,EAAG,mBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,WACHC,GAAI,YACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyBhzD,CAAQ,EAAQ,8FCOlD,SAAWmiD,GAAU,aAIzB,IAAI8Q,EAAa,SAAU5yC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV6yC,EAAU,CACNh2C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJs9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJn5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJs5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAehuD,EAAQiuD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf/hD,EAAMoiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAziD,EAAMA,EAAIuiD,EAAgB,EAAI,IAE3BviD,EAAI+D,QAAQ,MAAOg+C,KAGlCvC,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,OACA,SACA,MACA,SACA,SACA,SACA,UAGGnO,EAAOkO,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUl+C,GACZ,MAAO,MAAQA,GAEnBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAGi2C,EAAU,KACbjB,GAAIiB,EAAU,KACdr+C,EAAGq+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdl6B,EAAGk6B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBQ,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhCi+C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtJyBhzD,CAAQ,EAAQ,8FCDlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wEAAwE1tC,MAC5E,KAEJ2tC,YAAa,wEAAwE3tC,MACjF,KAEJ4tC,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,OACHg1C,GAAI,WACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJp5B,EAAG,MACHq5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MApDyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPX,EAAa,SAAU5yC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV6yC,EAAU,CACNh2C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJs9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJn5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJs5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAehuD,EAAQiuD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf/hD,EAAMoiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAziD,EAAMA,EAAIuiD,EAAgB,EAAI,IAE3BviD,EAAI+D,QAAQ,MAAOg+C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGGnO,EAAOkO,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUl+C,GACZ,MAAO,MAAQA,GAEnBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAGi2C,EAAU,KACbjB,GAAIiB,EAAU,KACdr+C,EAAGq+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdl6B,EAAGk6B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC8+C,WAAY,SAAUtuD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO83C,EAAU93C,MAEpBjH,QAAQ,KAAM,MAEvBi+C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzKyBhzD,CAAQ,EAAQ,8FCIlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wEAAwE1tC,MAC5E,KAEJ2tC,YAAa,wEAAwE3tC,MACjF,KAEJ4tC,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,OACHg1C,GAAI,WACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJp5B,EAAG,MACHq5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyBhzD,CAAQ,EAAQ,8FCElD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGF3R,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,6EAA6E1tC,MACjF,KAEJ2tC,YAAa,6EAA6E3tC,MACtF,KAEJ4tC,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUl+C,GACZ,MAAO,MAAQA,GAEnBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,OACHg1C,GAAI,WACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJp5B,EAAG,MACHq5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAOg4C,EAAUh4C,MAEpBjH,QAAQ,KAAM,MAEvB8+C,WAAY,SAAUtuD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO83C,EAAU93C,MAEpBjH,QAAQ,KAAM,MAEvBi+C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,yEAAyE1tC,MAC7E,KAEJ2tC,YAAa,yEAAyE3tC,MAClF,KAEJ4tC,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,OACHg1C,GAAI,WACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJp5B,EAAG,MACHq5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETb,EAAa,SAAU5yC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEV6yC,EAAU,CACNh2C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJs9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJn5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJs5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAehuD,EAAQiuD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf/hD,EAAMoiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAziD,EAAMA,EAAIuiD,EAAgB,EAAI,IAE3BviD,EAAI+D,QAAQ,MAAOg+C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGCnO,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,wCAAwC7tC,MAAM,KAC7D8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAUl+C,GACZ,MAAO,MAAQA,GAEnBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAGi2C,EAAU,KACbjB,GAAIiB,EAAU,KACdr+C,EAAGq+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACdl6B,EAAGk6B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUxuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAOg4C,EAAUh4C,MAEpBjH,QAAQ,KAAM,MAEvB8+C,WAAY,SAAUtuD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO83C,EAAU93C,MAEpBjH,QAAQ,KAAM,MAEvBi+C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzLyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIzB,IAAI4R,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGC5R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,+EAA+E1tC,MACnF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,qEAAqE5tC,MAC3E,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,+BACVC,QAAS,aACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN/0C,EAAG,kBACHg1C,GAAI,YACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,SACHC,GAAI,SAER/B,cAAe,0BACfC,KAAM,SAAUl+C,GACZ,MAAO,mBAAmBuQ,KAAKvQ,IAEnCm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SAEA,SAGfd,uBAAwB,wCACxBC,QAAS,SAAUC,GACf,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIt1C,EAAIs1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASx2C,IAAMw2C,EAFvBlB,EAAS,IAAOt1C,IAEsBw2C,EADvClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAYzB,SAAS6R,EAAuBnB,EAAQQ,EAAe1tD,GASnD,MAAY,MAARA,EACO0tD,EAAgB,UAAY,UACpB,MAAR1tD,EACA0tD,EAAgB,UAAY,UAE5BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,yBAA2B,yBAC/Cf,GAAI,iBACJE,GAAI,uBACJE,GAAI,kBAOgC/sD,GArBvBid,MAAM,KAChBqxC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAyBC/R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,uGAAuG9E,MAC3G,KAEJuxC,WAAY,qGAAqGvxC,MAC7G,MAGR2tC,YAAa,0DAA0D3tC,MACnE,KAEJ4tC,SAAU,CACN9oC,OAAQ,0DAA0D9E,MAC9D,KAEJuxC,WAAY,0DAA0DvxC,MAClE,KAEJwxC,SAAU,+CAEd3D,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBACTE,QAAS,eACTD,SAAU,WACN,MAAO,mBAEXE,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN/0C,EAAG,kBACHpI,EAAGk/C,EACH7B,GAAI6B,EACJ5B,EAAG4B,EACH3B,GAAI2B,EACJ/6B,EAAG,QACHq5B,GAAI0B,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,yBACfC,KAAM,SAAUl+C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAQzB,EAAS,IAAO,GAAKA,EAAS,IAAO,GACzCA,EAAS,KAAQ,IACjBA,EAAS,KAAQ,GAEfA,EAAS,KADTA,EAAS,KAEnB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,oFAAoF1tC,MACxF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN/0C,EAAG,kBACHg1C,GAAI,aACJp9C,EAAG,SACHq9C,GAAI,YACJC,EAAG,MACHC,GAAI,UACJp5B,EAAG,MACHq5B,GAAI,UACJiC,EAAG,UACHC,GAAI,aACJjC,EAAG,QACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KArFyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,8IAA8I1tC,MAClJ,KAEJ2tC,YAAa,iDAAiD3tC,MAAM,KACpE4tC,SAAU,+CAA+C5tC,MAAM,KAC/D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,2BACJC,IAAK,wCACLC,KAAM,8CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,qBACVC,QAAS,iBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN/0C,EAAG,kBACHg1C,GAAI,aACJp9C,EAAG,eACHq9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJp5B,EAAG,aACHq5B,GAAI,UACJC,EAAG,aACHC,GAAI,UACJC,EAAG,YACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGF3R,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,mEAAmE3tC,MAC5E,KAEJ4tC,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,uCAAuC7tC,MAAM,KAC5D8tC,YAAa,kCAAkC9tC,MAAM,KACrDquC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAG,eACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAIzB60C,cAAe,uCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,QAAb5C,GAEa,SAAbA,EADA4C,EAGa,UAAb5C,EACA4C,GAAQ,EAAIA,EAAOA,EAAO,GACb,UAAb5C,GAEa,YAAbA,EADA4C,EAAO,QACX,GAKX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,EACP,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QACAA,EAAO,GACP,UAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KA9HyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,mEAAmE3tC,MAC5E,KAEJ4tC,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,uCAAuC7tC,MAAM,KAC5D8tC,YAAa,kCAAkC9tC,MAAM,KACrDquC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAG,eACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzB60C,cAAe,2BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,QAAb5C,GAAsB4C,GAAQ,GACjB,UAAb5C,GAAwB4C,EAAO,GACnB,UAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qJAAqJ1tC,MACzJ,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJgyC,iBAAkB,gBAClBC,kBAAkB,EAClBrE,SAAU,gFAAgF5tC,MACtF,KAEJ6tC,cAAe,oDAAoD7tC,MAC/D,KAEJ8tC,YAAa,6BAA6B9tC,MAAM,KAChDquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,wBACVC,QAAS,YACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,QACHg1C,GAAI,YACJp9C,EAAG,aACHq9C,GAAI,WACJC,EAAG,cACHC,GAAI,YACJp5B,EAAG,WACHq5B,GAAI,UACJC,EAAG,YACHC,GAAI,UACJC,EAAG,UACHC,GAAI,SAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzB60C,cAAe,wCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACpB,YAAb5C,GAA0B4C,EAAO,GACrB,YAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,UACAA,EAAO,GACP,UACAA,EAAO,GACP,UAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAxHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,SAAS2S,EAAyBjC,EAAQQ,EAAe1tD,GAMrD,OAAOktD,EAAS,IAoBpB,SAAkBnwC,EAAMmwC,GACpB,OAAe,IAAXA,EAKR,SAAsBnwC,GAClB,IAAIqyC,EAAgB,CAChBjgD,EAAG,IACH4J,EAAG,IACHua,EAAG,KAEP,YAAsChlB,IAAlC8gD,EAAcryC,EAAKnd,OAAO,IACnBmd,EAEJqyC,EAAcryC,EAAKnd,OAAO,IAAMmd,EAAKqX,UAAU,GAb3Ci7B,CAAatyC,GAEjBA,EAxBeuyC,CALT,CACT9C,GAAI,WACJK,GAAI,MACJF,GAAI,UAE8B3sD,GAAMktD,GAchD,SAASqC,EAAWrC,GAChB,OAAIA,EAAS,EACFqC,EAAWrC,EAAS,IAExBA,EAoBX,IAAIsC,EAAc,CACV,QACA,cACA,QACA,QACA,QACA,cACA,QACA,QACA,QACA,QACA,OACA,SAEJC,EAAc,6IAqBdC,EAAmB,CACf,OACA,OACA,eACA,QACA,OACA,OACA,QAGClT,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,gFAAgF1tC,MACpF,KAEJ2tC,YAAa,mDAAmD3tC,MAAM,KACtE4tC,SAAU,6CAA6C5tC,MAAM,KAC7D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,wBAAwB9tC,MAAM,KAC3C0yC,cAAeD,EACfE,kBArCoB,CAChB,QACA,QACA,WACA,iBACA,SACA,WACA,YA+BJC,mBA7BqB,CACjB,QACA,QACA,QACA,QACA,QACA,QACA,SAuBJH,iBAAkBA,EAElBD,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA7CoB,wFA8CpBC,uBA7CyB,2DA8CzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElBlE,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sBACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,qBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,SACN/0C,EAAG,wBACHg1C,GAAI,YACJp9C,EAAG,cACHq9C,GAAI2C,EACJ1C,EAAG,SACHC,GAAI,SACJp5B,EAAG,YACHq5B,GAAIwC,EACJvC,EAAG,SACHC,GAAIsC,EACJrC,EAAG,WACHC,GApIR,SAAiCG,GAC7B,OAAQqC,EAAWrC,IACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOA,EAAS,SACpB,QACI,OAAOA,EAAS,YA6HxBF,uBAAwB,kBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,KAAO,QAGvCC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,YACfC,KAAM,SAAUvvC,GACZ,MAAiB,SAAVA,GAEXwvC,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAOyC,EAAO,GAAK,OAAS,UAnKEzzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,SAAS0T,EAAUhD,EAAQQ,EAAe1tD,GACtC,IAAIS,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXysD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANIjtD,GADW,IAAXysD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANIjtD,GADW,IAAXysD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIzsD,GADW,IAAXysD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIzsD,GADW,IAAXysD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIzsD,GADW,IAAXysD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjB1Q,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,8DAA8D3tC,MACvE,KAEJiyC,kBAAkB,EAClBrE,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,cACHg1C,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG,MACHq5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAlJyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ6D,WAAY,oFAAoFvxC,MAC5F,KAEJ8E,OAAQ,qHAAqH9E,MACzH,KAEJwxC,SAAU,mBAEd7D,YAAa,8DAA8D3tC,MACvE,KAEJiyC,kBAAkB,EAClBrE,SAAU,8DAA8D5tC,MACpE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,gCACLyE,IAAK,mBACLxE,KAAM,qCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,WACL,MAAO,YAA+B,IAAjB3xD,KAAKgxD,QAAgB,MAAQ,MAAQ,QAE9DY,QAAS,WACL,MAAO,YAA+B,IAAjB5xD,KAAKgxD,QAAgB,MAAQ,MAAQ,QAE9Da,SAAU,WACN,MAAO,YAA+B,IAAjB7xD,KAAKgxD,QAAgB,MAAQ,MAAQ,QAE9Dc,QAAS,WACL,MAAO,YAA+B,IAAjB9xD,KAAKgxD,QAAgB,MAAQ,MAAQ,QAE9De,SAAU,WACN,MACI,wBACkB,IAAjB/xD,KAAKgxD,QAAgB,MAAQ,MAC9B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN/0C,EAAG,aACHg1C,GAAI,YACJp9C,EAAG,WACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA/FyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAImO,EAAS,oFAAoF1tC,MACzF,KAEJ2tC,EAAc,kDAAkD3tC,MAAM,KACtEuyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,yBACA,4BACA,QACA,QACA,QACA,QACA,SAIJC,EAAc,wJAElB,SAASc,EAAO71C,GACZ,OAAOA,EAAI,GAAKA,EAAI,GAAoB,MAAZA,EAAI,IAEpC,SAASw1C,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,IAAIltD,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,IACD,OAAO0tD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,UAAY,UAEvCzsD,EAAS,YAExB,IAAK,IACD,OAAOitD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,SAAW,SAEtCzsD,EAAS,WAExB,IAAK,IACD,OAAOitD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,SAAW,SAEtCzsD,EAAS,WAExB,IAAK,IACD,OAAOitD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,MAAQ,OAEnCzsD,EAAS,MAExB,IAAK,IACD,OAAOitD,GAAiBC,EAAW,QAAU,UACjD,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,SAAW,UAEtCzsD,EAAS,SAExB,IAAK,IACD,OAAOitD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,OAAS,OAEpCzsD,EAAS,QAKvB+7C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACb6E,YAAaA,EACbR,iBAAkBQ,EAGlBK,kBAAmB,uKACnBC,uBAAwB,sDACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,mDAAmD5tC,MAAM,KACnE6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,yBACNh/B,EAAG,cAEPi/B,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,mBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,iBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG24C,EACH3D,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG48B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzKyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,gEAAgE1tC,MACpE,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,oEAAoE5tC,MAC1E,KAEJ6tC,cAAe,6BAA6B7tC,MAAM,KAClD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sCACJC,IAAK,6CACLC,KAAM,oDAEVC,SAAU,CACNC,QAAS,sBACTC,QAAS,sBACTE,QAAS,sBACTD,SAAU,4BACVE,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUiE,GAMd,OAAOA,GALK,UAAU1sD,KAAK0sD,GACrB,MACA,QAAQ1sD,KAAK0sD,GACb,MACA,QAGVhE,KAAM,YACN/0C,EAAG,iBACHg1C,GAAI,aACJp9C,EAAG,YACHq9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,cACxBC,QAAS,SACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yFAAyF1tC,MAC7F,KAEJ2tC,YAAa,qDAAqD3tC,MAC9D,KAEJ4tC,SAAU,+EAA+E5tC,MACrF,KAEJ6tC,cAAe,+BAA+B7tC,MAAM,KACpD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EAEpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN/0C,EAAG,mBACHg1C,GAAI,YACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,MACHC,GAAI,SACJp5B,EAAG,UACHq5B,GAAI,aACJC,EAAG,MACHC,GAAI,SACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,mCAExBC,QAAS,SAAUC,GACf,IACIoD,EAAS,GAiCb,OAlCQpD,EAyBA,GAEAoD,EADM,KA1BNpD,GA0BkB,KA1BlBA,GA0B8B,KA1B9BA,GA0B0C,KA1B1CA,GA0BsD,MA1BtDA,EA2BS,MAEA,MA7BTA,EA+BO,IACXoD,EA9BS,CACL,GACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,OAvBApD,IAkCDA,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA9FyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,sFAAsF1tC,MAC1F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,qDAAqD5tC,MAAM,KACrE6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,mBACVC,QAAS,iBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,cACHg1C,GAAI,cACJp9C,EAAG,WACHq9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,WACHC,GAAI,aACJC,EAAG,QACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyBhzD,CAAQ,EAAQ,8FCMlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBs9C,EAAG,CAAC,cAAe,gBACnBn5B,EAAG,CAAC,UAAW,aACfq5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgB3rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cw8C,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJiyC,kBAAkB,EAClBrE,SAAU,8DAA8D5tC,MACpE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAGqhD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJp5B,EAAGk9B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyBhzD,CAAQ,EAAQ,8FCAlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBs9C,EAAG,CAAC,cAAe,gBACnBn5B,EAAG,CAAC,UAAW,aACfq5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgB3rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cw8C,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJiyC,kBAAkB,EAClBrE,SAAU,8DAA8D5tC,MACpE,KAEJ6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAGqhD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJp5B,EAAGk9B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBs9C,EAAG,CAAC,cAAe,gBACnBn5B,EAAG,CAAC,UAAW,aACfq5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgB3rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG/Cw8C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJiyC,kBAAkB,EAClBrE,SAAU,8DAA8D5tC,MACpE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAGqhD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJp5B,EAAGk9B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIzB,IAAImO,EAAS,CACL,WACA,aACA,SACA,WACA,KACA,OACA,SACA,WACA,eACA,aACA,aACA,cAEJE,EAAW,CACP,WACA,OACA,WACA,OACA,aACA,SACA,YAGCrO,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUA,EACVC,cAAeD,EACfE,YAAa,qCAAqC9tC,MAAM,KACxDquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,WACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,QACfC,KAAM,SAAUl+C,GACZ,MAAO,OAASA,GAEpBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,UACVC,QAAS,cACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,YACN/0C,EAAG,iBACHg1C,GAAI,cACJp9C,EAAG,WACHq9C,GAAI,YACJC,EAAG,aACHC,GAAI,cACJp5B,EAAG,WACHq5B,GAAI,YACJC,EAAG,SACHC,GAAI,UACJC,EAAG,WACHC,GAAI,aAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC8+C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhCi+C,KAAM,CACFC,IAAK,EACLC,IAAK,MAxFyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAWhBA,EAAOkO,aAAa,KAAM,CAC/B+F,mBAAoB,qHAAqHxzC,MACrI,KAEJyzC,iBAAkB,qHAAqHzzC,MACnI,KAEJ0tC,OAAQ,SAAUgG,EAAgB5uC,GAC9B,OAAK4uC,EAGiB,iBAAX5uC,GACP,IAAIzE,KAAKyE,EAAOqS,UAAU,EAAGrS,EAAO1Z,QAAQ,UAGrClO,KAAKy2D,kBAAkBD,EAAeE,SAEtC12D,KAAK22D,oBAAoBH,EAAeE,SARxC12D,KAAK22D,qBAWpBlG,YAAa,oDAAoD3tC,MAAM,KACvE4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CiuC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCJ,KAAM,SAAUl+C,GACZ,MAAyC,OAAjCA,EAAQ,IAAIsU,cAAc,IAEtC2pC,cAAe,gBACfM,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVmF,WAAY,CACRjF,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,gCACX,QACI,MAAO,mCAGnBvC,SAAU,KAEdN,SAAU,SAAU7rD,EAAKgxD,GACrB,IApEYjkD,EAoERujD,EAASn2D,KAAK82D,YAAYjxD,GAC1BmrD,EAAQ6F,GAAOA,EAAI7F,QAIvB,OAzEYp+C,EAsEGujD,GApEM,oBAAbzvC,UAA4B9T,aAAiB8T,UACX,sBAA1CnT,OAAO1R,UAAUiT,SAAS/S,KAAK6Q,MAoE3BujD,EAASA,EAAOh0D,MAAM00D,IAEnBV,EAAOphD,QAAQ,KAAMi8C,EAAQ,IAAO,EAAI,MAAQ,SAE3DiB,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,oBACHg1C,GAAI,kBACJp9C,EAAG,YACHq9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,WACHq5B,GAAI,WACJC,EAAG,aACHC,GAAI,WACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,eACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,2FCMlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,6FAA6F1tC,MACjG,KAEJ2tC,YAAa,oDAAoD3tC,MAAM,KACvE4tC,SAAU,qDAAqD5tC,MAAM,KACrE6tC,cAAe,gCAAgC7tC,MAAM,KACrD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,4BACJC,IAAK,kCACLC,KAAM,2CACNyE,KAAM,uCAEVrF,cAAe,cACfC,KAAM,SAAUl+C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3B6pC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,SAAW,SAErBA,EAAU,SAAW,UAGpCQ,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN/0C,EAAG,kBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,WACHq5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA/DyBhzD,CAAQ,EAAQ,8FCDlD,SAAWmiD,GAAU,aAIzB,IAAI0U,EAAiB,8DAA8Dj0C,MAC3E,KAEJ2tC,EAAc,kDAAkD3tC,MAAM,KACtEuyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPjT,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb6oC,EAAYz7C,EAAE0hD,SAEdK,EAAe/hD,EAAE0hD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjB3xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB5xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB7xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB9xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB/xD,KAAKgxD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyBhzD,CAAQ,EAAQ,8FCIlD,SAAWmiD,GAAU,aAIzB,IAAI0U,EAAiB,8DAA8Dj0C,MAC3E,KAEJ2tC,EAAc,kDAAkD3tC,MAAM,KACtEuyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPjT,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb6oC,EAAYz7C,EAAE0hD,SAEdK,EAAe/hD,EAAE0hD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjB3xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB5xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB7xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB9xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB/xD,KAAKgxD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB92D,CAAQ,EAAQ,8FCIlD,SAAWmiD,GAAU,aAIzB,IAAI0U,EAAiB,8DAA8Dj0C,MAC3E,KAEJ2tC,EAAc,kDAAkD3tC,MAAM,KACtEuyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEPjT,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb6oC,EAAYz7C,EAAE0hD,SAEdK,EAAe/hD,EAAE0hD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjB3xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB5xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB7xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB9xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB/xD,KAAKgxD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIzB,IAAI0U,EAAiB,8DAA8Dj0C,MAC3E,KAEJ2tC,EAAc,kDAAkD3tC,MAAM,KACtEuyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAETjT,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACb6oC,EAAYz7C,EAAE0hD,SAEdK,EAAe/hD,EAAE0hD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjB3xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjB5xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjB7xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB9xD,KAAKgxD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB/xD,KAAKgxD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB92D,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACTxK,EAAG,CAAC,eAAgB,cAAe,iBACnCg1C,GAAI,CAACW,EAAS,UAAWA,EAAS,YAClC/9C,EAAG,CAAC,aAAc,aAClBq9C,GAAI,CAACU,EAAS,UAAWA,EAAS,YAClCT,EAAG,CAAC,YAAa,YAAa,YAC9BC,GAAI,CAACQ,EAAS,SAAUA,EAAS,UACjC55B,EAAG,CAAC,YAAa,YACjBs5B,EAAG,CAAC,UAAW,WAAY,WAC3BC,GAAI,CAACK,EAAS,OAAQA,EAAS,SAC/BJ,EAAG,CAAC,YAAa,QAAS,aAC1BC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAIQ,EACO3rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAElD2tD,EAAW5rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG1Cw8C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,6FAA6F1tC,MACjG,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJ4tC,SAAU,iEAAiE5tC,MACvE,KAEJ6tC,cAAe,gBAAgB7tC,MAAM,KACrC8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,qBACVC,QAAS,aACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN/0C,EAAGi5C,EACHjE,GAAIiE,EACJrhD,EAAGqhD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJl9B,EAAGk9B,EACH7D,GAAI,WACJC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,+FAA+F1tC,MACnG,KAEJ2tC,YAAa,8DAA8D3tC,MACvE,KAEJiyC,kBAAkB,EAClBrE,SAAU,sEAAsE5tC,MAC5E,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,gCACLC,KAAM,sCACNh/B,EAAG,WACHujC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCAEVxE,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN/0C,EAAG,iBACHg1C,GAAI,aACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,WACHq5B,GAAI,UACJC,EAAG,eACHC,GAAI,cACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,wEAAwE1tC,MAC5E,KAEJ2tC,YAAa,wEAAwE3tC,MACjF,KAEJ4tC,SAAU,qDAAoE5tC,MAC1E,KAEJ6tC,cAAe,qDAAoE7tC,MAC/E,KAEJ8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,wBACfC,KAAM,SAAUl+C,GACZ,MAAO,aAAauQ,KAAKvQ,IAE7Bm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,YACHg1C,GAAI,WACJp9C,EAAG,WACHq9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EACFwP,QAAQ,UAAU,SAAUiH,GACzB,OAAOg4C,EAAUh4C,MAEpBjH,QAAQ,KAAM,MAEvB8+C,WAAY,SAAUtuD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO83C,EAAU93C,MAEpBjH,QAAQ,KAAM,MAEvB89C,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,MA5GyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI4U,EAAc,wEAAwEn0C,MAClF,KAEJo0C,EAAgB,CACZ,QACA,QACA,SACA,SACA,SACA,SACA,SACAD,EAAY,GACZA,EAAY,GACZA,EAAY,IAEpB,SAASlB,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,IAAIltD,EAAS,GACb,OAAQT,GACJ,IAAK,IACD,OAAO2tD,EAAW,oBAAsB,kBAC5C,IAAK,KACDltD,EAASktD,EAAW,WAAa,WACjC,MACJ,IAAK,IACD,OAAOA,EAAW,WAAa,WACnC,IAAK,KACDltD,EAASktD,EAAW,WAAa,YACjC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDltD,EAASktD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDltD,EAASktD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,YAAc,WACpC,IAAK,KACDltD,EAASktD,EAAW,YAAc,YAClC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACDltD,EAASktD,EAAW,SAAW,SAIvC,OAEJ,SAAsBT,EAAQS,GAC1B,OAAOT,EAAS,GACVS,EACI0D,EAAcnE,GACdkE,EAAYlE,GAChBA,EARGoE,CAAapE,EAAQS,GAAY,IAAMltD,EAW3C+7C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,2GAA2G1tC,MAC/G,KAEJ2tC,YAAa,uEAAuE3tC,MAChF,KAEJ4tC,SAAU,qEAAqE5tC,MAC3E,KAEJ6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,mBACJC,IAAK,gCACLC,KAAM,sCACNh/B,EAAG,WACHujC,GAAI,cACJC,IAAK,2BACLC,KAAM,iCAEVxE,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN/0C,EAAG24C,EACH3D,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG48B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyBhzD,CAAQ,EAAQ,4FCIlD,SAAWmiD,GAAU,aAIfA,EAAOkO,aAAa,MAAO,CACjCC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,wBAAwB9tC,MAAM,KAC3CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,eACHq9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJp5B,EAAG,aACHq5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,4EAA4E5tC,MAClF,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN/0C,EAAG,YACHg1C,GAAI,cACJp9C,EAAG,eACHq9C,GAAI,cACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,YACHq5B,GAAI,WACJC,EAAG,cACHC,GAAI,aACJC,EAAG,UACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyBhzD,CAAQ,EAAQ,8FCElD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,uFAAuF1tC,MAC3F,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJiyC,kBAAkB,EAClBrE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJp5B,EAAG,UACHq5B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,SAlEjB7yD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,uFAAuF1tC,MAC3F,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJiyC,kBAAkB,EAClBrE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJp5B,EAAG,UACHq5B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAEIiT,EAAc,yKACdD,EAAc,CACV,SACA,SACA,SACA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,SAGChT,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,uFAAuF1tC,MAC3F,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJwyC,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA3BoB,2FA4BpBC,uBA3ByB,oFA4BzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJp5B,EAAG,UACHq5B,GAAI,WACJiC,EAAG,cACHC,GAAI,cACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAIJ,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,IAG3C,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI+U,EAAsB,6DAA6Dt0C,MAC/E,KAEJu0C,EAAyB,kDAAkDv0C,MACvE,KAGCu/B,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,iGAAiG1tC,MACrG,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyvC,EAAuBriD,EAAE0hD,SAEzBU,EAAoBpiD,EAAE0hD,SAJtBU,GAOfrC,kBAAkB,EAClBrE,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAG,mBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aA4ChBA,EAAOkO,aAAa,KAAM,CAC/BC,OAzCS,CACL,SACA,UACA,QACA,UACA,YACA,YACA,OACA,SACA,eACA,mBACA,UACA,WA8BJC,YA5Bc,CACV,MACA,QACA,OACA,MACA,OACA,QACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,eACA,WACA,WACA,cACA,YACA,YACA,eAUJC,cARgB,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,QASnEC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAK,MASlDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,kBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,YACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,UACHq9C,GAAI,aACJC,EAAG,iBACHC,GAAI,oBACJp5B,EAAG,KACHq5B,GAAI,QACJC,EAAG,KACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aA4ChBA,EAAOkO,aAAa,KAAM,CAC/BC,OAzCS,CACL,gBACA,aACA,UACA,aACA,aACA,eACA,cACA,cACA,eACA,aACA,eACA,gBA8BJC,YA5Bc,CACV,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,cACA,UACA,UACA,YACA,YACA,WACA,eAUJC,cARgB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAS3DC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MASnDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,gBACN/0C,EAAG,gBACHg1C,GAAI,YACJp9C,EAAG,UACHq9C,GAAI,gBACJC,EAAG,OACHC,GAAI,aACJp5B,EAAG,QACHq5B,GAAI,WACJC,EAAG,OACHC,GAAI,YACJC,EAAG,WACHC,GAAI,eAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yFAAyF1tC,MAC7F,KAEJ2tC,YAAa,8DAA8D3tC,MACvE,KAEJiyC,kBAAkB,EAClBrE,SAAU,mDAAmD5tC,MAAM,KACnE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,UAA6B,IAAjB3xD,KAAKgxD,QAAgB,KAAO,KAAO,QAE1DY,QAAS,WACL,MAAO,UAA6B,IAAjB5xD,KAAKgxD,QAAgB,KAAO,KAAO,QAE1Da,SAAU,WACN,MAAO,UAA6B,IAAjB7xD,KAAKgxD,QAAgB,KAAO,KAAO,QAE1Dc,QAAS,WACL,MAAO,UAA6B,IAAjB9xD,KAAKgxD,QAAgB,IAAM,KAAO,QAEzDe,SAAU,WACN,MACI,qBAAwC,IAAjB/xD,KAAKgxD,QAAgB,KAAO,KAAO,QAGlEgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUlhD,GACd,OAA0B,IAAtBA,EAAI9C,QAAQ,MACL,IAAM8C,EAEV,MAAQA,GAEnBmhD,KAAM,SACN/0C,EAAG,eACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,YACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxEyBhzD,CAAQ,EAAQ,iGCGlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,cACvBg1C,GAAI,CAACW,EAAS,aAAcA,EAAS,UACrC/9C,EAAG,CAAC,aAAc,YAClBq9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,WAAY,SAChBC,GAAI,CAACQ,EAAS,UAAWA,EAAS,SAClC55B,EAAG,CAAC,YAAa,UACjBq5B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,gBAAiB,aACrBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,WAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAW5rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCw8C,EAAOkO,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,wFAAwFvxC,MAChG,KAEJ8E,OAAQ,mJAAmJ9E,MACvJ,KAEJwxC,SAAU,mBAEd7D,YAAa,4EAA4E3tC,MACrF,KAEJiyC,kBAAkB,EAClBrE,SAAU,qDAAqD5tC,MAAM,KACrE6tC,cAAe,4CAA4C7tC,MAAM,KACjE8tC,YAAa,wBAAwB9tC,MAAM,KAC3C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,kBACJC,IAAK,qBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,8BACLC,KAAM,uCACNyE,KAAM,oCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,eACTC,SAAU,qBACVC,QAAS,WACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN/0C,EAAGi5C,EACHjE,GAAIiE,EACJrhD,EAAGqhD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJl9B,EAAGk9B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,MACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,4BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,WAAb5C,EACA4C,EACa,YAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,UACAA,EAAO,GACP,QAEA,UAzHmBzzD,CAAQ,EAAQ,iGCGlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACTxK,EAAG,CAAC,qBAAsB,iBAC1Bg1C,GAAI,CAACW,EAAS,cAAeA,EAAS,WACtC/9C,EAAG,CAAC,aAAc,YAClBq9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,YAAa,UACjBC,GAAI,CAACQ,EAAS,WAAYA,EAAS,UACnC55B,EAAG,CAAC,YAAa,UACjBq5B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,eAAgB,aACpBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,YAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAW5rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCw8C,EAAOkO,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,4EAA4EvxC,MACpF,KAEJ8E,OAAQ,wIAAwI9E,MAC5I,KAEJwxC,SAAU,mBAEd7D,YAAa,4DAA4D3tC,MACrE,KAEJiyC,kBAAkB,EAClBrE,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,iBACJC,IAAK,oBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,sCACNyE,KAAM,mCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,cACTC,SAAU,sBACVC,QAAS,WACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN/0C,EAAGi5C,EACHjE,GAAIiE,EACJrhD,EAAGqhD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJl9B,EAAGk9B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,cACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,KACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,+BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAzHmBzzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yFAAyF1tC,MAC7F,KAEJ2tC,YAAa,yEAAyE3tC,MAClF,KAEJiyC,kBAAkB,EAClBrE,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,mCAAmC7tC,MAAM,KACxD8tC,YAAa,qBAAqB9tC,MAAM,KACxCquC,eAAgB,CACZC,GAAI,gBACJC,IAAK,mBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,WACHg1C,GAAI,WACJp9C,EAAG,WACHq9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,UACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAKzB60C,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,SAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,OACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,0EAA0E1tC,MAC9E,KAEJ2tC,YAAa,4DAA4D3tC,MACrE,KAEJ4tC,SAAU,uCAAuC5tC,MAAM,KACvD6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,6BACNh/B,EAAG,WACHujC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,cACTC,QAAS,aACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN/0C,EAAG,aACHg1C,GAAI,WACJp9C,EAAG,MACHq9C,GAAI,UACJC,EAAG,MACHC,GAAI,SAAUQ,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpB55B,EAAG,MACHq5B,GAAI,SAAUO,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBN,EAAG,OACHC,GAAI,SAAUK,GACV,OAAe,IAAXA,EACO,UAEJA,EAAS,WAEpBJ,EAAG,MACHC,GAAI,SAAUG,GACV,OAAe,IAAXA,EACO,SACAA,EAAS,IAAO,GAAgB,KAAXA,EACrBA,EAAS,OAEbA,EAAS,UAGxBlC,cAAe,gEACfC,KAAM,SAAUl+C,GACZ,MAAO,8BAA8BuQ,KAAKvQ,IAE9Cm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,aACAA,EAAO,GACP,QACAA,EAAO,GACPzC,EAAU,SAAW,eACrByC,EAAO,GACPzC,EAAU,QAAU,eAEpB,UAzFmBhxD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETqB,EAAc,CACV,OACA,WACA,UACA,UACA,OACA,QACA,QACA,OACA,aACA,UACA,WACA,cAiBChT,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,8EAA8E9E,MAClF,KAEJuxC,WAAY,0EAA0EvxC,MAClF,MAGR2tC,YAAa,6DAA6D3tC,MACtE,KAEJ4tC,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,kCAAkC7tC,MAAM,KACvD8tC,YAAa,qBAAqB9tC,MAAM,KACxCquC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAGV4D,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAzCmB,CACf,OACA,QACA,UACA,UACA,OACA,QACA,QACA,OACA,QACA,UACA,OACA,SA+BJR,YAAa,+KAEbR,iBAAkB,+KAElBa,kBAAmB,uIAEnBC,uBAAwB,sFAExBlE,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,WACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN/0C,EAAG,cACHg1C,GAAI,WACJp9C,EAAG,UACHq9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAKzB60C,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,QAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAlKyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,SAAS0T,EAAUhD,EAAQQ,EAAe1tD,GACtC,IAAIS,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXysD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANIjtD,GADW,IAAXysD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANIjtD,GADW,IAAXysD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIzsD,GADW,IAAXysD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIzsD,GADW,IAAXysD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIzsD,GADW,IAAXysD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjB1Q,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,oGAAoG9E,MACxG,KAEJuxC,WAAY,gGAAgGvxC,MACxG,MAGR2tC,YAAa,+DAA+D3tC,MACxE,KAEJiyC,kBAAkB,EAClBrE,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,cACHg1C,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG,MACHq5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxJyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,IAAIiV,EAAc,gEAAgEx0C,MAC9E,KAEJ,SAASizC,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,IAAIW,EAAMpB,EACV,OAAQltD,GACJ,IAAK,IACD,OAAO2tD,GAAYD,EACb,mBACA,oBACV,IAAK,KACD,OAAOY,GAAOX,GAAYD,GACpB,aACA,cACV,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,QAAU,UAC1D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,QAAU,UACxD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,SAAW,YAC3D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,SAAW,YACzD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,MAAQ,QACxD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,MAAQ,QAE1D,MAAO,GAEX,SAASP,EAAKQ,GACV,OACKA,EAAW,GAAK,WACjB,IACA8D,EAAYt3D,KAAKu0D,OACjB,aAIClS,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,oGAAoG1tC,MACxG,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJiyC,kBAAkB,EAClBrE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,gCAAgC7tC,MAAM,KACrD8tC,YAAa,qBAAqB9tC,MAAM,KACxCquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVZ,cAAe,SACfC,KAAM,SAAUl+C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3B6pC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,IACW,IAAZE,EAAmB,KAAO,MAEd,IAAZA,EAAmB,KAAO,MAGzCQ,SAAU,CACNC,QAAS,gBACTC,QAAS,oBACTC,SAAU,WACN,OAAOmB,EAAKjxD,KAAK/B,MAAM,IAE3B8xD,QAAS,oBACTC,SAAU,WACN,OAAOiB,EAAKjxD,KAAK/B,MAAM,IAE3BgyD,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,KACN/0C,EAAG24C,EACH3D,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG48B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyBhzD,CAAQ,EAAQ,8FCElD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,CACJ5oC,OAAQ,4GAA4G9E,MAChH,KAEJuxC,WAAY,gGAAgGvxC,MACxG,MAGR2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,gEAAgE5tC,MACtE,KAEJ6tC,cAAe,+BAA+B7tC,MAAM,KACpD8tC,YAAa,+BAA+B9tC,MAAM,KAClDquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTE,QAAS,YACTD,SAAU,WACN,MAAO,sBAEXE,SAAU,WACN,MAAO,8BAEXC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN/0C,EAAG,mBACHg1C,GAAI,cACJp9C,EAAG,OACHq9C,GAAI,UACJC,EAAG,MACHC,GAAI,SACJp5B,EAAG,KACHq5B,GAAI,QACJC,EAAG,OACHC,GAAI,UACJC,EAAG,OACHC,GAAI,WAER/B,cAAe,oCACfC,KAAM,SAAUl+C,GACZ,MAAO,uBAAuBuQ,KAAKvQ,IAEvCm+C,SAAU,SAAU4C,GAChB,OAAIA,EAAO,EACA,UACAA,EAAO,GACP,WACAA,EAAO,GACP,UAEA,YAGfd,uBAAwB,0BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,OACD,OAAe,IAAXzB,EACOA,EAAS,MAEbA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yFAAyF1tC,MAC7F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,6CAA6C5tC,MAAM,KAC7D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,wBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,GAAoC,UAAbA,EACvB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,QACAA,EAAQ,GACR,OAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,qBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,eACN/0C,EAAG,iBACHg1C,GAAI,WACJp9C,EAAG,UACHq9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIzB,SAAS+T,EAAO71C,GACZ,OAAIA,EAAI,KAAQ,IAELA,EAAI,IAAO,EAK1B,SAASw1C,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,IAAIltD,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,IACD,OAAO0tD,GAAiBC,EAClB,mBACA,mBACV,IAAK,KACD,OAAI4C,EAAOrD,GAEHzsD,GACCitD,GAAiBC,EAAW,WAAa,YAG3CltD,EAAS,UACpB,IAAK,IACD,OAAOitD,EAAgB,SAAW,SACtC,IAAK,KACD,OAAI6C,EAAOrD,GAEHzsD,GAAUitD,GAAiBC,EAAW,UAAY,WAE/CD,EACAjtD,EAAS,SAEbA,EAAS,SACpB,IAAK,KACD,OAAI8vD,EAAOrD,GAEHzsD,GACCitD,GAAiBC,EACZ,gBACA,iBAGPltD,EAAS,cACpB,IAAK,IACD,OAAIitD,EACO,QAEJC,EAAW,MAAQ,OAC9B,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACOjtD,EAAS,QAEbA,GAAUktD,EAAW,OAAS,SAC9BD,EACAjtD,EAAS,QAEbA,GAAUktD,EAAW,MAAQ,QACxC,IAAK,IACD,OAAID,EACO,UAEJC,EAAW,QAAU,SAChC,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACOjtD,EAAS,UAEbA,GAAUktD,EAAW,SAAW,WAChCD,EACAjtD,EAAS,UAEbA,GAAUktD,EAAW,QAAU,UAC1C,IAAK,IACD,OAAOD,GAAiBC,EAAW,KAAO,MAC9C,IAAK,KACD,OAAI4C,EAAOrD,GACAzsD,GAAUitD,GAAiBC,EAAW,KAAO,QAEjDltD,GAAUitD,GAAiBC,EAAW,KAAO,QAIvDnR,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,oFAAoF1tC,MACxF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,mFAAmF5tC,MACzF,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,iBACN/0C,EAAG24C,EACH3D,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAG,cACHC,GAAIwD,EACJ58B,EAAG48B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,gGAAgG1tC,MACpG,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,mBACTC,SAAU,iBACVC,QAAS,iBACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,6BACX,QACI,MAAO,+BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU90C,GACd,OAAQ,YAAY+F,KAAK/F,GAAK,MAAQ,MAAQ,IAAMA,GAExD+0C,KAAM,QACN/0C,EAAG,iBACHg1C,GAAI,aACJp9C,EAAG,YACHq9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJp5B,EAAG,YACHq5B,GAAI,YACJC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA9DyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,gGAAgG1tC,MACpG,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,WACL,MACI,WACC3xD,KAAKgxD,QAAU,EAAI,OAA0B,IAAjBhxD,KAAKgxD,QAAgB,IAAM,OACxD,OAGRY,QAAS,WACL,MACI,aACC5xD,KAAKgxD,QAAU,EAAI,OAA0B,IAAjBhxD,KAAKgxD,QAAgB,IAAM,OACxD,OAGRa,SAAU,WACN,MACI,WACC7xD,KAAKgxD,QAAU,EAAI,OAA0B,IAAjBhxD,KAAKgxD,QAAgB,IAAM,OACxD,OAGRc,QAAS,WACL,MACI,WACC9xD,KAAKgxD,QAAU,EAAI,OAA0B,IAAjBhxD,KAAKgxD,QAAgB,IAAM,OACxD,OAGRe,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MACI,uBACCv0D,KAAKgxD,QAAU,EACV,OACiB,IAAjBhxD,KAAKgxD,QACL,IACA,OACN,MAER,QACI,MACI,uBACChxD,KAAKgxD,QAAU,EACV,OACiB,IAAjBhxD,KAAKgxD,QACL,IACA,OACN,QAIhBgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN/0C,EAAG,iBACHg1C,GAAI,aACJp9C,EAAG,YACHq9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJp5B,EAAG,YACHq5B,GAAI,YACJiC,EAAG,gBACHC,GAAI,eACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BgH,KAAM,CACF,CACIC,MAAO,aACPC,OAAQ,EACRjyD,KAAM,KACNkyD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACRjyD,KAAM,KACNkyD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACRjyD,KAAM,KACNkyD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACRjyD,KAAM,KACNkyD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACRjyD,KAAM,KACNkyD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACRjyD,KAAM,KACNkyD,OAAQ,KACRC,KAAM,MAEV,CACIH,MAAO,aACPI,OAAO,IACPH,OAAQ,EACRjyD,KAAM,MACNkyD,OAAQ,KACRC,KAAM,OAGdE,oBAAqB,WACrBC,oBAAqB,SAAUllD,EAAOoJ,GAClC,MAAoB,MAAbA,EAAM,GAAa,EAAIqN,SAASrN,EAAM,IAAMpJ,EAAO,KAE9D49C,OAAQ,yCAAyC1tC,MAAM,KACvD2tC,YAAa,yCAAyC3tC,MAClD,KAEJ4tC,SAAU,8BAA8B5tC,MAAM,KAC9C6tC,cAAe,gBAAgB7tC,MAAM,KACrC8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBACNh/B,EAAG,aACHujC,GAAI,YACJC,IAAK,kBACLC,KAAM,wBAEVrF,cAAe,SACfC,KAAM,SAAUl+C,GACZ,MAAiB,OAAVA,GAEXm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAWhzD,KAAKgzD,OACb,cAEA,WAGflB,QAAS,UACTC,SAAU,SAAUgG,GAChB,OAAI/3D,KAAKgzD,SAAW+E,EAAI/E,OACb,cAEA,WAGfhB,SAAU,KAEda,uBAAwB,WACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACD,OAAkB,IAAXzB,EAAe,KAAOA,EAAS,IAC1C,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN/0C,EAAG,KACHg1C,GAAI,MACJp9C,EAAG,KACHq9C,GAAI,MACJC,EAAG,MACHC,GAAI,OACJp5B,EAAG,KACHq5B,GAAI,MACJC,EAAG,MACHC,GAAI,OACJC,EAAG,KACHC,GAAI,SAlJ0B1yD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yFAAyF1tC,MAC7F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,+CAA+C5tC,MAAM,KAC/D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,6BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,SACAA,EAAQ,GACR,SACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,2BACTC,QAAS,sBACTC,SAAU,kBACVC,QAAS,wBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,uBACN/0C,EAAG,kBACHg1C,GAAI,WACJp9C,EAAG,kBACHq9C,GAAI,WACJC,EAAG,gBACHC,GAAI,SACJp5B,EAAG,WACHq5B,GAAI,YACJC,EAAG,UACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qGAAqG1tC,MACzG,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,CACN2D,WAAY,gEAAgEvxC,MACxE,KAEJ8E,OAAQ,iEAAiE9E,MACrE,KAEJwxC,SAAU,iBAEd3D,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTE,QAAS,kBACTD,SAAU,wBACVE,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU90C,GACd,OAAOA,EAAErI,QAAQ,iCAAiC,SAC9CijD,EACA/wC,EACAgxC,GAEA,MAAc,MAAPA,EAAahxC,EAAK,KAAOA,EAAKgxC,EAAK,SAGlD9F,KAAM,SAAU/0C,GACZ,MAAI,4BAA4B+F,KAAK/F,GAC1BA,EAAErI,QAAQ,SAAU,UAE3B,OAAOoO,KAAK/F,GACLA,EAAErI,QAAQ,QAAS,YAEvBqI,GAEXA,EAAG,iBACHg1C,GAAI,UACJp9C,EAAG,OACHq9C,GAAI,UACJC,EAAG,QACHC,GAAI,WACJp5B,EAAG,MACHq5B,GAAI,SACJC,EAAG,MACHC,GAAI,SACJC,EAAG,OACHC,GAAI,WAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,OAAe,IAAXA,EACOA,EAEI,IAAXA,EACOA,EAAS,MAGhBA,EAAS,IACRA,GAAU,KAAOA,EAAS,IAAO,GAClCA,EAAS,KAAQ,EAEV,MAAQA,EAEZA,EAAS,MAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI4R,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGA5R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,0DAA0D5tC,MAChE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,kBACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN/0C,EAAG,iBACHg1C,GAAI,YACJp9C,EAAG,YACHq9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhFyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yEAAyE1tC,MAC7E,KAEJ2tC,YAAa,yEAAyE3tC,MAClF,KAEJ4tC,SAAU,iDAAiD5tC,MAAM,KACjE6tC,cAAe,oBAAoB7tC,MAAM,KACzC8tC,YAAa,oBAAoB9tC,MAAM,KACvC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,cACfC,KAAM,SAAUl+C,GACZ,MAAiB,UAAVA,GAEXm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,QAEA,SAGfjC,SAAU,CACNC,QAAS,oBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,qBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN/0C,EAAG,iBACHg1C,GAAI,YACJp9C,EAAG,UACHq9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,UACJC,EAAG,QACHC,GAAI,QACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,OACTiB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzBg3C,KAAM,CACFC,IAAK,EACLC,IAAK,KApGyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,6FAA6F1tC,MACjG,KAEJ2tC,YAAa,2EAA2E3tC,MACpF,KAEJiyC,kBAAkB,EAClBrE,SAAU,0DAA0D5tC,MAChE,KAEJ6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,wBAAwB9tC,MAAM,KAC3CquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN/0C,EAAG,gBACHg1C,GAAI,gBACJp9C,EAAG,aACHq9C,GAAI,WACJC,EAAG,YACHC,GAAI,UACJp5B,EAAG,WACHq5B,GAAI,SACJC,EAAG,cACHC,GAAI,YACJC,EAAG,YACHC,GAAI,WAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzB60C,cAAe,gCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,OAEA,UAGfd,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yCAAyC1tC,MAAM,KACvD2tC,YAAa,yCAAyC3tC,MAClD,KAEJ4tC,SAAU,8BAA8B5tC,MAAM,KAC9C6tC,cAAe,gBAAgB7tC,MAAM,KACrC8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,uBACLC,KAAM,4BACNh/B,EAAG,cACHujC,GAAI,gBACJC,IAAK,uBACLC,KAAM,6BAEVxE,SAAU,CACNC,QAAS,QACTC,QAAS,QACTC,SAAU,UACVC,QAAS,QACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,OACN/0C,EAAG,MACHg1C,GAAI,MACJp9C,EAAG,KACHq9C,GAAI,MACJC,EAAG,OACHC,GAAI,OACJp5B,EAAG,KACHq5B,GAAI,MACJC,EAAG,MACHC,GAAI,MACJC,EAAG,MACHC,GAAI,OAERC,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBlC,cAAe,QACfC,KAAM,SAAUvvC,GACZ,MAAiB,OAAVA,GAEXwvC,SAAU,SAAU4C,EAAMC,EAAQsE,GAC9B,OAAOvE,EAAO,GAAK,KAAO,QAxEIzzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETxD,EAAS,CACL,eACA,QACA,QACA,QACA,QACA,WACA,SACA,MACA,UACA,eACA,eACA,gBAGCnO,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,0EAA0E5tC,MAChF,KAEJ6tC,cAAe,2DAA2D7tC,MACtE,KAEJ8tC,YAAa,gBAAgB9tC,MAAM,KACnC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,kBACfC,KAAM,SAAUl+C,GACZ,MAAO,UAAUuQ,KAAKvQ,IAE1Bm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,UAEA,WAGfjC,SAAU,CACNC,QAAS,sBACTC,QAAS,uBACTC,SAAU,oBACVC,QAAS,qBACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,KACN/0C,EAAG,kBACHg1C,GAAI,WACJp9C,EAAG,cACHq9C,GAAI,YACJC,EAAG,eACHC,GAAI,aACJp5B,EAAG,WACHq5B,GAAI,SACJC,EAAG,YACHC,GAAI,UACJC,EAAG,WACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAOg4C,EAAUh4C,MAEpBjH,QAAQ,KAAM,MAEvB8+C,WAAY,SAAUtuD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO83C,EAAU93C,MAEpBjH,QAAQ,KAAM,MAEvBi+C,KAAM,CACFC,IAAK,EACLC,IAAK,MApHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI4R,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGA5R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,kFAAkF1tC,MACtF,KAEJ2tC,YAAa,qDAAqD3tC,MAC9D,KAEJ4tC,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,wCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN/0C,EAAG,iBACHg1C,GAAI,YACJp9C,EAAG,YACHq9C,GAAI,WACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,wBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlFyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACT5S,EAAG,CAAC,aAAc,gBAClBs9C,EAAG,CAAC,YAAa,eACjBn5B,EAAG,CAAC,UAAW,aACfs5B,EAAG,CAAC,WAAY,eAChBE,EAAG,CAAC,UAAW,eAEnB,OAAOY,EAAgB3rC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAuBxD,SAASsyD,EAA4BpF,GAEjC,GADAA,EAAS1pC,SAAS0pC,EAAQ,IACtBzpC,MAAMypC,GACN,OAAO,EAEX,GAAIA,EAAS,EAET,OAAO,EACJ,GAAIA,EAAS,GAEhB,OAAI,GAAKA,GAAUA,GAAU,EAI1B,GAAIA,EAAS,IAAK,CAErB,IAAI4B,EAAY5B,EAAS,GAEzB,OACWoF,EADO,IAAdxD,EADa5B,EAAS,GAIS4B,GAChC,GAAI5B,EAAS,IAAO,CAEvB,KAAOA,GAAU,IACbA,GAAkB,GAEtB,OAAOoF,EAA4BpF,GAInC,OAAOoF,EADPpF,GAAkB,KAKjB1Q,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,uFAAuF1tC,MAC3F,KAEJ2tC,YAAa,+DAA+D3tC,MACxE,KAEJiyC,kBAAkB,EAClBrE,SAAU,mEAAmE5tC,MACzE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,cACJC,IAAK,iBACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,kCAEVC,SAAU,CACNC,QAAS,eACTK,SAAU,IACVJ,QAAS,eACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,WAEN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,0BACX,QACI,MAAO,4BAIvBtC,aAAc,CACVC,OAhGR,SAA2B3sD,GAEvB,OAAI4yD,EADS5yD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,KAAO3I,EAEX,MAAQA,GA4FX4sD,KA1FR,SAAyB5sD,GAErB,OAAI4yD,EADS5yD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,QAAU3I,EAEd,SAAWA,GAsFd6X,EAAG,kBACHg1C,GAAI,cACJp9C,EAAGqhD,EACHhE,GAAI,cACJC,EAAG+D,EACH9D,GAAI,aACJp5B,EAAGk9B,EACH7D,GAAI,UACJC,EAAG4D,EACH3D,GAAI,WACJC,EAAG0D,EACHzD,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApIyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,6EAA6E1tC,MACjF,KAEJ2tC,YAAa,6EAA6E3tC,MACtF,KAEJ4tC,SAAU,sCAAsC5tC,MAAM,KACtD6tC,cAAe,oCAAoC7tC,MAAM,KACzD8tC,YAAa,mBAAmB9tC,MAAM,KACtC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,6BAEVZ,cAAe,kBACfC,KAAM,SAAUl+C,GACZ,MAAiB,WAAVA,GAEXm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,WAEA,UAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,wBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN/0C,EAAG,mBACHg1C,GAAI,YACJp9C,EAAG,SACHq9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJp5B,EAAG,QACHq5B,GAAI,SACJC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,SAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,MAAO,MAAQA,KA/De7yD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI+V,EAAQ,CACRhG,GAAI,6BACJp9C,EAAG,wBACHq9C,GAAI,0BACJC,EAAG,2BACHC,GAAI,4BACJp5B,EAAG,qBACHq5B,GAAI,sBACJC,EAAG,uBACHC,GAAI,4BACJC,EAAG,mBACHC,GAAI,oBASR,SAASyF,EAAkBtF,EAAQQ,EAAe1tD,EAAK2tD,GACnD,OAAOD,EACDa,EAAMvuD,GAAK,GACX2tD,EACAY,EAAMvuD,GAAK,GACXuuD,EAAMvuD,GAAK,GAErB,SAASyyD,EAAQvF,GACb,OAAOA,EAAS,IAAO,GAAMA,EAAS,IAAMA,EAAS,GAEzD,SAASqB,EAAMvuD,GACX,OAAOuyD,EAAMvyD,GAAKid,MAAM,KAE5B,SAASizC,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,IAAIltD,EAASysD,EAAS,IACtB,OAAe,IAAXA,EAEIzsD,EAAS+xD,EAAkBtF,EAAQQ,EAAe1tD,EAAI,GAAI2tD,GAEvDD,EACAjtD,GAAUgyD,EAAQvF,GAAUqB,EAAMvuD,GAAK,GAAKuuD,EAAMvuD,GAAK,IAE1D2tD,EACOltD,EAAS8tD,EAAMvuD,GAAK,GAEpBS,GAAUgyD,EAAQvF,GAAUqB,EAAMvuD,GAAK,GAAKuuD,EAAMvuD,GAAK,IAIjEw8C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,oGAAoG9E,MACxG,KAEJuxC,WAAY,kGAAkGvxC,MAC1G,KAEJwxC,SAAU,+DAEd7D,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,CACN9oC,OAAQ,oFAAoF9E,MACxF,KAEJuxC,WAAY,2FAA2FvxC,MACnG,KAEJwxC,SAAU,cAEd3D,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,iBAAiB9tC,MAAM,KACpC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CACNh/B,EAAG,aACHujC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CAEVxE,SAAU,CACNC,QAAS,gBACTC,QAAS,aACTC,SAAU,UACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAlFR,SAA0B21C,EAAQQ,EAAe1tD,EAAK2tD,GAClD,OAAID,EACO,kBAEAC,EAAW,kBAAoB,mBA+EtCpB,GAAI2D,EACJ/gD,EAAGqjD,EACHhG,GAAI0D,EACJzD,EAAG+F,EACH9F,GAAIwD,EACJ58B,EAAGk/B,EACH7F,GAAIuD,EACJtD,EAAG4F,EACH3F,GAAIqD,EACJpD,EAAG0F,EACHzF,GAAImD,GAERlD,uBAAwB,cACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,QAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,IAAI+V,EAAQ,CACRhG,GAAI,qCAAqCtvC,MAAM,KAC/C9N,EAAG,iCAAiC8N,MAAM,KAC1CuvC,GAAI,iCAAiCvvC,MAAM,KAC3CwvC,EAAG,iCAAiCxvC,MAAM,KAC1CyvC,GAAI,iCAAiCzvC,MAAM,KAC3CqW,EAAG,6BAA6BrW,MAAM,KACtC0vC,GAAI,6BAA6B1vC,MAAM,KACvC2vC,EAAG,iCAAiC3vC,MAAM,KAC1C4vC,GAAI,iCAAiC5vC,MAAM,KAC3C6vC,EAAG,wBAAwB7vC,MAAM,KACjC8vC,GAAI,wBAAwB9vC,MAAM,MAKtC,SAAS8E,EAAOwsC,EAAOrB,EAAQQ,GAC3B,OAAIA,EAEOR,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAI5DrB,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAG3E,SAASF,EAAuBnB,EAAQQ,EAAe1tD,GACnD,OAAOktD,EAAS,IAAMnrC,EAAOwwC,EAAMvyD,GAAMktD,EAAQQ,GAErD,SAASgF,EAAyBxF,EAAQQ,EAAe1tD,GACrD,OAAO+hB,EAAOwwC,EAAMvyD,GAAMktD,EAAQQ,GAM7BlR,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,uGAAuG1tC,MAC3G,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,0EAA0E5tC,MAChF,KAEJ6tC,cAAe,kBAAkB7tC,MAAM,KACvC8tC,YAAa,kBAAkB9tC,MAAM,KACrC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,cACHC,GAAI,uBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,oBACTC,SAAU,qBACVC,QAAS,sBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN/0C,EAlCR,SAAyB21C,EAAQQ,GAC7B,OAAOA,EAAgB,iBAAmB,kBAkCtCnB,GAAI8B,EACJl/C,EAAGujD,EACHlG,GAAI6B,EACJ5B,EAAGiG,EACHhG,GAAI2B,EACJ/6B,EAAGo/B,EACH/F,GAAI0B,EACJzB,EAAG8F,EACH7F,GAAIwB,EACJvB,EAAG4F,EACH3F,GAAIsB,GAERrB,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIzB,IAAImW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,SAAU,UAAW,WAC1Bp9C,EAAG,CAAC,cAAe,iBACnBq9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,SAAU,UAAW,WAC1BE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAe1tD,GACxC,IAAI8yD,EAAUH,EAAWC,MAAM5yD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGmkD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDtW,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,mFAAmF1tC,MACvF,KAEJ2tC,YAAa,2DAA2D3tC,MACpE,KAEJiyC,kBAAkB,EAClBrE,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBAETC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,6BACA,iCACA,4BACA,4BACA,8BACA,2BACA,4BAEgB/xD,KAAKu0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,mBACHg1C,GAAIoG,EAAWzC,UACf/gD,EAAGwjD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf58B,EAAG,MACHq5B,GAAIgG,EAAWzC,UACftD,EAAG,SACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,8IAA8I1tC,MAClJ,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJwyC,YAAa,yCACbK,kBAAmB,yCACnBb,iBAAkB,yCAClBc,uBAAwB,yCACxBlF,SAAU,kDAAkD5tC,MAAM,KAClE6tC,cAAe,wBAAwB7tC,MAAM,KAC7C8tC,YAAa,wBAAwB9tC,MAAM,KAC3CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,eACTC,SAAU,cACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,WACN/0C,EAAG,mBACHg1C,GAAI,YACJp9C,EAAG,YACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,QACHq5B,GAAI,QACJC,EAAG,YACHC,GAAI,YACJC,EAAG,SACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,uFAAuF1tC,MAC3F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,oBACVC,QAAS,gBACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,8BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,kBACHg1C,GAAI,aACJp9C,EAAG,cACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,WACHq5B,GAAI,UACJC,EAAG,aACHC,GAAI,YACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnFyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yFAAyF1tC,MAC7F,KAEJ2tC,YAAa,yEAAyE3tC,MAClF,KAEJiyC,kBAAkB,EAClBrE,SAAU,wEAAwE5tC,MAC9E,KAEJ6tC,cAAe,2CAA2C7tC,MAAM,KAChE8tC,YAAa,wBAAwB9tC,MAAM,KAC3CquC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,eACHq9C,GAAI,cACJC,EAAG,eACHC,GAAI,cACJp5B,EAAG,YACHq5B,GAAI,WACJC,EAAG,WACHC,GAAI,UACJC,EAAG,WACHC,GAAI,WAER/B,cAAe,gDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACrB,iBAAb5C,GACa,eAAbA,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,SACAA,EAAO,GACP,eACAA,EAAO,GACP,aAEA,YA7EmBzzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,SAAS0T,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,OAAQ3tD,GACJ,IAAK,IACD,OAAO0tD,EAAgB,gBAAkB,kBAC7C,IAAK,KACD,OAAOR,GAAUQ,EAAgB,UAAY,aACjD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,SAAW,YAChD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,QAAU,WAC/C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,UAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,QACI,OAAOR,GAIV1Q,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,+LAA+L1tC,MACnM,KAEJ2tC,YAAa,6EAA6E3tC,MACtF,KAEJiyC,kBAAkB,EAClBrE,SAAU,6CAA6C5tC,MAAM,KAC7D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,iCAEVZ,cAAe,SACfC,KAAM,SAAUl+C,GACZ,MAAiB,OAAVA,GAEXm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN/0C,EAAG24C,EACH3D,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG48B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,QACI,OAAOA,MAhGe7yD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGb,SAAS4E,EAAe7F,EAAQQ,EAAehuD,EAAQiuD,GACnD,IAAI2C,EAAS,GACb,GAAI5C,EACA,OAAQhuD,GACJ,IAAK,IACD4wD,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,SACT,MACJ,IAAK,KACDA,EAAS,SACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,UACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,gBAIjB,OAAQ5wD,GACJ,IAAK,IACD4wD,EAAS,eACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,cACT,MACJ,IAAK,KACDA,EAAS,cACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YAIrB,OAAOA,EAAOphD,QAAQ,MAAOg+C,GAGxB1Q,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,gFAAgF3tC,MACzF,KAEJiyC,kBAAkB,EAClBrE,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,kCAAkC7tC,MAAM,KACvD8tC,YAAa,qBAAqB9tC,MAAM,KACxCquC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,WACVC,QAAS,WACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN/0C,EAAGw7C,EACHxG,GAAIwG,EACJ5jD,EAAG4jD,EACHvG,GAAIuG,EACJtG,EAAGsG,EACHrG,GAAIqG,EACJz/B,EAAGy/B,EACHpG,GAAIoG,EACJnG,EAAGmG,EACHlG,GAAIkG,EACJjG,EAAGiG,EACHhG,GAAIgG,GAER7E,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzB60C,cAAe,qCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,GAAqC,UAAbA,EACjB4C,EAEM,WAAb5C,GACa,aAAbA,GACa,WAAbA,EAEO4C,GAAQ,GAAKA,EAAOA,EAAO,QAL/B,GAQX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,GAAQ,GAAKA,EAAO,EACb,QACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvMyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,oFAAoF1tC,MACxF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,6CAA6C5tC,MAAM,KAC7D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN/0C,EAAG,gBACHg1C,GAAI,UACJp9C,EAAG,UACHq9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,oFAAoF1tC,MACxF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,6CAA6C5tC,MAAM,KAC7D6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN/0C,EAAG,gBACHg1C,GAAI,UACJp9C,EAAG,UACHq9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,iEAAiE5tC,MACvE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,eACHg1C,GAAI,aACJp9C,EAAG,SACHq9C,GAAI,YACJC,EAAG,SACHC,GAAI,aACJp5B,EAAG,UACHq5B,GAAI,YACJC,EAAG,QACHC,GAAI,UACJC,EAAG,OACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,mDAAmD3tC,MAAM,KACtE4tC,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,2BAA2B7tC,MAAM,KAChD8tC,YAAa,2BAA2B9tC,MAAM,KAE9CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,kBACN/0C,EAAG,kBACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,OACHC,GAAI,OACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzBg3C,KAAM,CACFC,IAAK,EACLC,IAAK,KAvFyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJiyC,kBAAkB,EAClBrE,SAAU,qDAAqD5tC,MAAM,KACrE6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,WACJiC,EAAG,SACHC,GAAI,UACJjC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,uFAAuF1tC,MAC3F,KAEJ2tC,YAAa,uEAAuE3tC,MAChF,KAEJiyC,kBAAkB,EAClBrE,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,0CAA0C7tC,MAAM,KAC/D8tC,YAAa,4BAA4B9tC,MAAM,KAC/C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVsC,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAGzB60C,cAAe,yBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,QAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,qBACVC,QAAS,YACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,WACN/0C,EAAG,YACHg1C,GAAI,aACJp9C,EAAG,WACHq9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAtHyBhzD,CAAQ,EAAQ,8FCIlD,SAAWmiD,GAAU,aAIzB,IAAI+U,EAAsB,6DAA6Dt0C,MAC/E,KAEJu0C,EAAyB,kDAAkDv0C,MACvE,KAEJuyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAEPjT,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyvC,EAAuBriD,EAAE0hD,SAEzBU,EAAoBpiD,EAAE0hD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6D5tC,MACnE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJp5B,EAAG,UACHq5B,GAAI,WACJC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI+U,EAAsB,6DAA6Dt0C,MAC/E,KAEJu0C,EAAyB,kDAAkDv0C,MACvE,KAEJuyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAETjT,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,SAAUz7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyvC,EAAuBriD,EAAE0hD,SAEzBU,EAAoBpiD,EAAE0hD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6D5tC,MACnE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN/0C,EAAG,oBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJp5B,EAAG,UACHq5B,GAAI,WACJiC,EAAG,WACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArGyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qFAAqF1tC,MACzF,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJiyC,kBAAkB,EAClBrE,SAAU,qDAAqD5tC,MAAM,KACrE6tC,cAAe,+BAA+B7tC,MAAM,KACpD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,uBACTC,SAAU,mBACVC,QAAS,oBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN/0C,EAAG,eACHg1C,GAAI,YACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,WACJiC,EAAG,UACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyBhzD,CAAQ,EAAQ,+FCElD,SAAWmiD,GAAU,aAIbA,EAAOkO,aAAa,SAAU,CACtCC,OAAQ,CACJ6D,WAAY,qFAAqFvxC,MAC7F,KAEJ8E,OAAQ,sHAAsH9E,MAC1H,KAEJwxC,SAAU,mBAEd7D,YAAa,+DAA+D3tC,MACxE,KAEJiyC,kBAAkB,EAClBrE,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,4BACLyE,IAAK,mBACLxE,KAAM,iCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,aACTC,QAAS,eACTC,SAAU,cACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN/0C,EAAG,gBACHg1C,GAAI,cACJp9C,EAAG,aACHq9C,GAAI,aACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,WACJC,EAAG,SACHC,GAAI,WACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGF3R,EAAOkO,aAAa,QAAS,CAEpCC,OAAQ,sEAAsE1tC,MAC1E,KAEJ2tC,YAAa,sEAAsE3tC,MAC/E,KAEJ4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,iCAAiC7tC,MAAM,KACtD8tC,YAAa,iCAAiC9tC,MAAM,KACpDquC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,kBACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN/0C,EAAG,YACHg1C,GAAI,WACJp9C,EAAG,UACHq9C,GAAI,UACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAKzB60C,cAAe,uBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIwW,EAAmB,mGAAmG/1C,MAClH,KAEJg2C,EAAmB,qGAAqGh2C,MACpH,KAEJuyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAER,SAASe,EAAO71C,GACZ,OAAOA,EAAI,GAAK,GAAKA,EAAI,GAAK,MAAQA,EAAI,IAAM,IAAO,EAE3D,SAASw1C,EAAUhD,EAAQQ,EAAe1tD,GACtC,IAAIS,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,KACD,OAAOS,GAAU8vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,IACD,OAAOQ,EAAgB,SAAW,SACtC,IAAK,KACD,OAAOjtD,GAAU8vD,EAAOrD,GAAU,SAAW,SACjD,IAAK,IACD,OAAOQ,EAAgB,UAAY,UACvC,IAAK,KACD,OAAOjtD,GAAU8vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,KACD,OAAOzsD,GAAU8vD,EAAOrD,GAAU,WAAa,WACnD,IAAK,KACD,OAAOzsD,GAAU8vD,EAAOrD,GAAU,WAAa,YACnD,IAAK,KACD,OAAOzsD,GAAU8vD,EAAOrD,GAAU,OAAS,QAI9C1Q,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,SAAUgG,EAAgB5uC,GAC9B,OAAK4uC,EAEM,SAASrzC,KAAKyE,GACdkxC,EAAiBtC,EAAeE,SAEhCmC,EAAiBrC,EAAeE,SAJhCmC,GAOfpI,YAAa,kDAAkD3tC,MAAM,KACrEuyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,6DAA6D5tC,MACnE,KAEJ6tC,cAAe,2BAA2B7tC,MAAM,KAChD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,qBAEX,KAAK,EACD,MAAO,mBAEX,KAAK,EACD,MAAO,iBAEX,KAAK,EACD,MAAO,kBAEX,QACI,MAAO,oBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,yBACX,QACI,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,eACHg1C,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG,UACHq5B,GAAI,SACJiC,EAAG,UACHC,GAAIqB,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,MACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,iFAAiF5tC,MACvF,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,mCACLC,KAAM,0CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf/xD,KAAKu0D,OAA8B,IAAfv0D,KAAKu0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN/0C,EAAG,kBACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTkE,YAAa,kBAxDqB92D,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,2FAA2F1tC,MAC/F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,iFAAiF5tC,MACvF,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf/xD,KAAKu0D,OAA8B,IAAfv0D,KAAKu0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN/0C,EAAG,WACHg1C,GAAI,cACJp9C,EAAG,YACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIzB,SAAS6R,EAAuBnB,EAAQQ,EAAe1tD,GACnD,IASIkzD,EAAY,IAIhB,OAHIhG,EAAS,KAAO,IAAOA,GAAU,KAAOA,EAAS,KAAQ,KACzDgG,EAAY,QAEThG,EAASgG,EAbH,CACL3G,GAAI,UACJC,GAAI,SACJE,GAAI,MACJC,GAAI,OACJkC,GAAI,YACJhC,GAAI,OACJE,GAAI,OAMuB/sD,GAG9Bw8C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,oGAAoG1tC,MACxG,KAEJ2tC,YAAa,+DAA+D3tC,MACxE,KAEJiyC,kBAAkB,EAClBrE,SAAU,kDAAkD5tC,MAAM,KAClE6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,aACN/0C,EAAG,iBACHg1C,GAAI8B,EACJl/C,EAAG,WACHq9C,GAAI6B,EACJ5B,EAAG,QACHC,GAAI2B,EACJ/6B,EAAG,OACHq5B,GAAI0B,EACJO,EAAG,cACHC,GAAIR,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,QACHC,GAAIsB,GAERlB,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAYzB,SAAS6R,EAAuBnB,EAAQQ,EAAe1tD,GAUnD,MAAY,MAARA,EACO0tD,EAAgB,SAAW,SAE3BR,EAAS,KArBFoB,GAqB6BpB,EApB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,sBAAwB,sBAC5ChB,GAAI,iBACJC,GAAI,gBACJkC,GAAI,uBACJhC,GAAI,uBACJE,GAAI,gBAKgC/sD,GApBvBid,MAAM,KAChBqxC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAuBR,IAAIiB,EAAc,CACd,QACA,QACA,QACA,QACA,WACA,QACA,QACA,QACA,QACA,QACA,QACA,SAMKhT,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,oFAAoF9E,MACxF,KAEJuxC,WAAY,kFAAkFvxC,MAC1F,MAGR2tC,YAAa,CAET7oC,OAAQ,gEAAgE9E,MACpE,KAEJuxC,WAAY,gEAAgEvxC,MACxE,MAGR4tC,SAAU,CACN2D,WAAY,gEAAgEvxC,MACxE,KAEJ8E,OAAQ,gEAAgE9E,MACpE,KAEJwxC,SAAU,iDAEd3D,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CuyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAGlBC,YAAa,2MAGbR,iBAAkB,2MAGlBa,kBAAmB,wHAGnBC,uBAAwB,6FACxBzE,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,8BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTE,QAAS,gBACTD,SAAU,SAAUkG,GAChB,GAAIA,EAAI/E,SAAWhzD,KAAKgzD,OAcpB,OAAmB,IAAfhzD,KAAKu0D,MACE,oBAEA,mBAhBX,OAAQv0D,KAAKu0D,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,+BAUvBxC,SAAU,SAAUgG,GAChB,GAAIA,EAAI/E,SAAWhzD,KAAKgzD,OAcpB,OAAmB,IAAfhzD,KAAKu0D,MACE,oBAEA,mBAhBX,OAAQv0D,KAAKu0D,OACT,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BAUvBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN/0C,EAAG,mBACHg1C,GAAI8B,EACJl/C,EAAGk/C,EACH7B,GAAI6B,EACJ5B,EAAG,MACHC,GAAI2B,EACJ/6B,EAAG,OACHq5B,GAAI0B,EACJO,EAAG,SACHC,GAAIR,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,wBACfC,KAAM,SAAUl+C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,OACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,KACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1MyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIzB,IAAImO,EAAS,CACL,QACA,UACA,OACA,QACA,MACA,MACA,SACA,OACA,UACA,SACA,QACA,SAEJwI,EAAO,CAAC,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAO,QAElD3W,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAUl+C,GACZ,MAAO,QAAUA,GAErBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,yBACVC,QAAS,aACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN/0C,EAAG,YACHg1C,GAAI,WACJp9C,EAAG,SACHq9C,GAAI,SACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,WACHq5B,GAAI,WACJC,EAAG,WACHC,GAAI,WACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC8+C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhCi+C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,mJAAmJ1tC,MACvJ,KAEJ2tC,YAAa,6DAA6D3tC,MACtE,KAEJ4tC,SAAU,6EAA6E5tC,MACnF,KAEJ6tC,cAAe,mCAAmC7tC,MAAM,KACxD8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,gCACLC,KAAM,uCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN/0C,EAAG,mBACHg1C,GAAI,eACJp9C,EAAG,eACHq9C,GAAI,cACJC,EAAG,cACHC,GAAI,aACJp5B,EAAG,cACHq5B,GAAI,cACJC,EAAG,aACHC,GAAI,WACJC,EAAG,aACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAKhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,kGAAkG1tC,MACtG,KAEJ2tC,YAAa,wDAAwD3tC,MACjE,KAEJ4tC,SAAU,gEAAgE5tC,MACtE,KAEJ6tC,cAAe,gCAAgC7tC,MAAM,KACrD8tC,YAAa,qBAAqB9tC,MAAM,KACxC4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,aACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN/0C,EAAG,eACHg1C,GAAI,WACJp9C,EAAG,YACHq9C,GAAI,cACJC,EAAG,MACHC,GAAI,SACJp5B,EAAG,OACHq5B,GAAI,SACJC,EAAG,OACHC,GAAI,SACJC,EAAG,MACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,SAEpBlC,cAAe,4BACfC,KAAM,SAAUl+C,GACZ,MAAiB,SAAVA,GAA8B,YAAVA,GAE/Bm+C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,OAAS,UAEnBA,EAAU,QAAU,aAjEDhxD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,IAAImO,EAAS,oFAAoF1tC,MACzF,KAEJ2tC,EAAc,kDAAkD3tC,MAAM,KAC1E,SAASszC,EAAO71C,GACZ,OAAOA,EAAI,GAAKA,EAAI,EAExB,SAASw1C,EAAUhD,EAAQQ,EAAe1tD,EAAK2tD,GAC3C,IAAIltD,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,IACD,OAAO0tD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,UAAY,UAEvCzsD,EAAS,YAExB,IAAK,IACD,OAAOitD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,SAAW,SAEtCzsD,EAAS,WAExB,IAAK,IACD,OAAOitD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,SAAW,SAEtCzsD,EAAS,WAExB,IAAK,IACD,OAAOitD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,MAAQ,OAEnCzsD,EAAS,QAExB,IAAK,IACD,OAAOitD,GAAiBC,EAAW,SAAW,WAClD,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,UAAY,YAEvCzsD,EAAS,WAExB,IAAK,IACD,OAAOitD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACVltD,GAAU8vD,EAAOrD,GAAU,OAAS,SAEpCzsD,EAAS,SAKvB+7C,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACbC,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG24C,EACH3D,GAAI2D,EACJ/gD,EAAG+gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJ58B,EAAG48B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7IyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAIltD,EAASysD,EAAS,IACtB,OAAQltD,GACJ,IAAK,IACD,OAAO0tD,GAAiBC,EAClB,eACA,kBACV,IAAK,KAUD,OARIltD,GADW,IAAXysD,EACUQ,EAAgB,UAAY,UACpB,IAAXR,EACGQ,GAAiBC,EAAW,UAAY,WAC3CT,EAAS,EACNQ,GAAiBC,EAAW,UAAY,WAExC,UAGlB,IAAK,IACD,OAAOD,EAAgB,aAAe,aAC1C,IAAK,KAUD,OARIjtD,GADW,IAAXysD,EACUQ,EAAgB,SAAW,SACnB,IAAXR,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,WAEvCD,GAAiBC,EAAW,QAAU,YAGxD,IAAK,IACD,OAAOD,EAAgB,UAAY,UACvC,IAAK,KAUD,OARIjtD,GADW,IAAXysD,EACUQ,EAAgB,MAAQ,MAChB,IAAXR,EACGQ,GAAiBC,EAAW,MAAQ,QACvCT,EAAS,EACNQ,GAAiBC,EAAW,MAAQ,QAEpCD,GAAiBC,EAAW,KAAO,SAGrD,IAAK,IACD,OAAOD,GAAiBC,EAAW,SAAW,YAClD,IAAK,KAQD,OANIltD,GADW,IAAXysD,EACUQ,GAAiBC,EAAW,MAAQ,OAC5B,IAAXT,EACGQ,GAAiBC,EAAW,MAAQ,UAEpCD,GAAiBC,EAAW,MAAQ,SAGtD,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,eACpD,IAAK,KAUD,OARIltD,GADW,IAAXysD,EACUQ,GAAiBC,EAAW,QAAU,UAC9B,IAAXT,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,SAEvCD,GAAiBC,EAAW,UAAY,UAG1D,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,aACpD,IAAK,KAUD,OARIltD,GADW,IAAXysD,EACUQ,GAAiBC,EAAW,OAAS,QAC7B,IAAXT,EACGQ,GAAiBC,EAAW,OAAS,SACxCT,EAAS,EACNQ,GAAiBC,EAAW,OAAS,OAErCD,GAAiBC,EAAW,MAAQ,SAMrDnR,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,8DAA8D3tC,MACvE,KAEJiyC,kBAAkB,EAClBrE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,eACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBAETC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,qBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACD,MAAO,+BACX,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,8BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN/0C,EAAGi5C,EACHjE,GAAIiE,EACJrhD,EAAGqhD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJl9B,EAAGk9B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxKyBhzD,CAAQ,EAAQ,2FCKlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,gFAAgF1tC,MACpF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,4DAA4D5tC,MAClE,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,mBAAmB9tC,MAAM,KACtC4wC,oBAAoB,EACpB7C,cAAe,QACfC,KAAM,SAAUl+C,GACZ,MAA2B,MAApBA,EAAMnN,OAAO,IAExBsrD,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAOF,EAAQ,GAAK,KAAO,MAE/BG,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,cACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,aACN/0C,EAAG,eACHg1C,GAAI,aACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,UACHC,GAAI,SACJp5B,EAAG,WACHq5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyBhzD,CAAQ,EAAQ,gGCElD,SAAWmiD,GAAU,aAIzB,IAAImW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bp9C,EAAG,CAAC,cAAe,gBACnBq9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAe1tD,GACxC,IAAI8yD,EAAUH,EAAWC,MAAM5yD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGmkD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAM7CtW,EAAOkO,aAAa,UAAW,CACxCC,OAAQ,mFAAmF1tC,MACvF,KAEJ2tC,YAAa,2DAA2D3tC,MACpE,KAEJiyC,kBAAkB,EAClBrE,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,2BACA,+BACA,4BACA,0BACA,8BACA,2BACA,4BAEgB/xD,KAAKu0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,mBACHg1C,GAAIoG,EAAWzC,UACf/gD,EAAGwjD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf58B,EAAG,MACHq5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAImW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bp9C,EAAG,CAAC,cAAe,gBACnBq9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAe1tD,GACxC,IAAI8yD,EAAUH,EAAWC,MAAM5yD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACGmkD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDtW,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,mFAAmF1tC,MACvF,KAEJ2tC,YAAa,2DAA2D3tC,MACpE,KAEJiyC,kBAAkB,EAClBrE,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQ7xD,KAAKu0D,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,4BACA,gCACA,4BACA,0BACA,8BACA,2BACA,4BAEgB/xD,KAAKu0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN/0C,EAAG,mBACHg1C,GAAIoG,EAAWzC,UACf/gD,EAAGwjD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACf58B,EAAG,MACHq5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyBhzD,CAAQ,EAAQ,2FCElD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,mHAAmH1tC,MACvH,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,sEAAsE5tC,MAC5E,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,iBACN/0C,EAAG,qBACHg1C,GAAI,cACJp9C,EAAG,SACHq9C,GAAI,aACJC,EAAG,SACHC,GAAI,aACJp5B,EAAG,UACHq5B,GAAI,cACJC,EAAG,UACHC,GAAI,cACJC,EAAG,UACHC,GAAI,eAER/B,cAAe,mCACfE,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,UACAA,EAAQ,GACR,QACAA,EAAQ,GACR,aAEA,WAGf6D,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,YAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,eAAb5C,GAA0C,YAAbA,EACvB,IAAT4C,EACO,EAEJA,EAAO,QAJX,GAOXd,uBAAwB,UACxBC,QAAS,KACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,oDAAoD5tC,MAAM,KACpE6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,+BACNwE,IAAK,mBACLC,KAAM,wBAEVxE,SAAU,CACNC,QAAS,YACTC,QAAS,eACTE,QAAS,YACTD,SAAU,eACVE,SAAU,iBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,eACN/0C,EAAG,iBACHg1C,GAAI,cACJp9C,EAAG,WACHq9C,GAAI,aACJC,EAAG,WACHC,GAAI,YACJp5B,EAAG,SACHq5B,GAAI,WACJC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,GAEM,IAANA,EADA,KAIA,OAIlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,sFAAsF1tC,MAC1F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,8DAA8D5tC,MACpE,KAEJ6tC,cAAe,kCAAkC7tC,MAAM,KACvD8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,UACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,8BACVC,QAAS,YACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN/0C,EAAG,aACHg1C,GAAI,aACJp9C,EAAG,cACHq9C,GAAI,YACJC,EAAG,aACHC,GAAI,WACJp5B,EAAG,YACHq5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,cACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAIyR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJ3R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,0FAA0F3tC,MACnG,KAEJ4tC,SAAU,8FAA8F5tC,MACpG,KAEJ6tC,cAAe,mDAAmD7tC,MAC9D,KAEJ8tC,YAAa,sBAAsB9tC,MAAM,KACzCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN/0C,EAAG,oBACHg1C,GAAI,eACJp9C,EAAG,cACHq9C,GAAI,gBACJC,EAAG,gBACHC,GAAI,eACJp5B,EAAG,WACHq5B,GAAI,aACJC,EAAG,YACHC,GAAI,cACJC,EAAG,aACHC,GAAI,eAERC,uBAAwB,aACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBgB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAOg4C,EAAUh4C,OAGzB63C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO83C,EAAU93C,OAIzB60C,cAAe,wCACfE,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,EACP,SACAA,EAAO,GACP,QACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAGfkB,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,GAAqC,SAAbA,GAEX,YAAbA,GACA4C,GAAQ,GAFRA,EAIAA,EAAO,IAGtBX,KAAM,CACFC,IAAK,EACLC,IAAK,KA/HyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,mEAAmE3tC,MAC5E,KAEJiyC,kBAAkB,EAClBrE,SAAU,8DAA8D5tC,MACpE,KAEJ6tC,cAAe,kCAAkC7tC,MAAM,KACvD8tC,YAAa,qBAAqB9tC,MAAM,KACxCquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN/0C,EAAG,iBACHg1C,GAAI,aACJp9C,EAAG,YACHq9C,GAAI,cACJC,EAAG,SACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,YACJC,EAAG,SACHC,GAAI,WACJC,EAAG,cACHC,GAAI,iBAERC,uBAAwB,WACxBC,QAAS,MACTjC,cAAe,iCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,aAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,OACAA,EAAO,GACP,YACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApFyBhzD,CAAQ,EAAQ,4FCKlD,SAAWmiD,GAAU,aAIfA,EAAOkO,aAAa,MAAO,CACjCC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,kDAAkD5tC,MAAM,KAClE6tC,cAAe,iCAAiC7tC,MAAM,KACtD8tC,YAAa,yBAAyB9tC,MAAM,KAC5CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,gBACVC,QAAS,oBACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,YACHq5B,GAAI,WACJC,EAAG,YACHC,GAAI,WACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyBhzD,CAAQ,EAAQ,2FCClD,SAAWmiD,GAAU,aAIzB,IAAI4R,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGA5R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,qFAAqF9E,MACzF,KAEJuxC,WAAY,yEAAyEvxC,MACjF,MAGR2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTE,QAAS,mBACTD,SAAU,kCACVE,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,SACN/0C,EAAG,eACHpI,EAAG,YACHq9C,GAAI,YACJC,EAAG,UACHC,GAAI,UACJp5B,EAAG,SACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAER/B,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,QAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,MACAA,EAAO,GACP,QAEA,OAGfd,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlHyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,oGAAoG1tC,MACxG,KAEJ2tC,YAAa,iEAAiE3tC,MAC1E,KAEJiyC,kBAAkB,EAClBrE,SAAU,iDAAiD5tC,MAAM,KACjE6tC,cAAe,8CAA8C7tC,MAAM,KACnE8tC,YAAa,yBAAyB9tC,MAAM,KAC5C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,oCAEVZ,cAAe,wBACfC,KAAM,SAAUl+C,GACZ,MAAiB,eAAVA,GAEXm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,mBACTC,QAAS,qBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN/0C,EAAG,eACHg1C,GAAI,YACJp9C,EAAG,SACHq9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJp5B,EAAG,QACHq5B,GAAI,SACJiC,EAAG,YACHC,GAAI,aACJjC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,WA9D0B1yD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAI4R,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGC5R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,+EAA+E1tC,MACnF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,YACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN/0C,EAAG,iBACHpI,EAAG,YACHq9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIt1C,EAAIs1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASx2C,IAAMw2C,EAFvBlB,EAAS,IAAOt1C,IAEsBw2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzFyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,wBAAwB9tC,MAAM,KAC3CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN/0C,EAAG,gBACHg1C,GAAI,aACJp9C,EAAG,eACHq9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJp5B,EAAG,aACHq5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyBhzD,CAAQ,EAAQ,4FCGlD,SAAWmiD,GAAU,aAIzB,IAAI4W,EAAe,iDAAiDn2C,MAAM,KA4B1E,SAASizC,EAAUhD,EAAQQ,EAAehuD,EAAQiuD,GAC9C,IAAI0F,EAiBR,SAAsBnG,GAClB,IAAIoG,EAAUr3C,KAAKs3C,MAAOrG,EAAS,IAAQ,KACvCsG,EAAMv3C,KAAKs3C,MAAOrG,EAAS,IAAO,IAClCuG,EAAMvG,EAAS,GACfwG,EAAO,GAUX,OATIJ,EAAU,IACVI,GAAQN,EAAaE,GAAW,SAEhCE,EAAM,IACNE,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaI,GAAO,OAEvDC,EAAM,IACNC,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaK,IAEpC,KAATC,EAAc,OAASA,EA/BbC,CAAazG,GAC9B,OAAQxtD,GACJ,IAAK,KACD,OAAO2zD,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,QAqBtB7W,EAAOkO,aAAa,MAAO,CACjCC,OAAQ,kMAAkM1tC,MACtM,KAEJ2tC,YAAa,0HAA0H3tC,MACnI,KAEJiyC,kBAAkB,EAClBrE,SAAU,2DAA2D5tC,MACjE,KAEJ6tC,cAAe,2DAA2D7tC,MACtE,KAEJ8tC,YAAa,2DAA2D9tC,MACpE,KAEJquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,MACVC,QAAS,cACTC,SAAU,MACVC,SAAU,KAEdC,aAAc,CACVC,OA/FR,SAAyBiE,GACrB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAOjoD,QAAQ,OACTurD,EAAK33D,MAAM,GAAI,GAAK,OACO,IAA3Bq0D,EAAOjoD,QAAQ,OACfurD,EAAK33D,MAAM,GAAI,GAAK,OACO,IAA3Bq0D,EAAOjoD,QAAQ,OACfurD,EAAK33D,MAAM,GAAI,GAAK,MACpB23D,EAAO,QAuFbtH,KAnFR,SAAuBgE,GACnB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAOjoD,QAAQ,OACTurD,EAAK33D,MAAM,GAAI,GAAK,OACO,IAA3Bq0D,EAAOjoD,QAAQ,OACfurD,EAAK33D,MAAM,GAAI,GAAK,OACO,IAA3Bq0D,EAAOjoD,QAAQ,OACfurD,EAAK33D,MAAM,GAAI,GAAK,MACpB23D,EAAO,QA2Ebr8C,EAAG,UACHg1C,GAAI2D,EACJ/gD,EAAG,UACHq9C,GAAI0D,EACJzD,EAAG,UACHC,GAAIwD,EACJ58B,EAAG,UACHq5B,GAAIuD,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,UACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3HyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIzB,IAAI4R,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGC5R,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,6EAA6E1tC,MACjF,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,wDAAwD5tC,MAC9D,KAEJ6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CiuC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCL,cAAe,cACfC,KAAM,SAAUl+C,GACZ,MAAiB,OAAVA,GAA4B,OAAVA,GAE7Bu+C,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,2BACVC,QAAS,WACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN/0C,EAAG,gBACHg1C,GAAI,YACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,SACJiC,EAAG,YACHC,GAAI,WACJjC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIt1C,EAAIs1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASx2C,IAAMw2C,EAFvBlB,EAAS,IAAOt1C,IAEsBw2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyBhzD,CAAQ,EAAQ,4FCGlD,SAAWmiD,GAAU,aAiEzB,SAASgU,EAAoBtD,EAAQQ,EAAe1tD,EAAK2tD,GACrD,IAAI5rC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,mBACvBg1C,GAAI,CAACW,EAAS,WAAiBA,EAAS,YACxC/9C,EAAG,CAAC,UAAW,cACfq9C,GAAI,CAACU,EAAS,SAAeA,EAAS,UACtCT,EAAG,CAAC,UAAW,eACfC,GAAI,CAACQ,EAAS,SAAeA,EAAS,UACtC55B,EAAG,CAAC,UAAW,eACfq5B,GAAI,CAACO,EAAS,SAAeA,EAAS,UACtCN,EAAG,CAAC,SAAU,aACdC,GAAI,CAACK,EAAS,SAAeA,EAAS,UACtCJ,EAAG,CAAC,QAAS,YACbC,GAAI,CAACG,EAAS,OAAaA,EAAS,SAExC,OAAOS,GAEDD,EADA3rC,EAAO/hB,GAAK,GAGZ+hB,EAAO/hB,GAAK,GA9EZw8C,EAAOkO,aAAa,MAAO,CACjCC,OAAQ,sFAAsF1tC,MAC1F,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,sDAAsD5tC,MAAM,KACtE6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,0CAEVZ,cAAe,aACfC,KAAM,SAAUl+C,GACZ,MAAO,QAAUA,EAAMsU,eAE3B6pC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,MAAQ,MAElBA,EAAU,MAAQ,OAGjCQ,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,OACN/0C,EAAGi5C,EACHjE,GAAIiE,EACJrhD,EAAGqhD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJl9B,EAAGk9B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyBhzD,CAAQ,EAAQ,iGCElD,SAAWmiD,GAAU,aAIXA,EAAOkO,aAAa,WAAY,CAC1CC,OAAQ,wFAAwF1tC,MAC5F,KAEJ2tC,YAAa,wFAAwF3tC,MACjG,KAEJ4tC,SAAU,kDAAkD5tC,MAAM,KAClE6tC,cAAe,kDAAkD7tC,MAAM,KACvE8tC,YAAa,kDAAkD9tC,MAAM,KACrEquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,cACTC,SAAU,cACVC,QAAS,gBACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,iBACRC,KAAM,SACN/0C,EAAG,OACHg1C,GAAI,UACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJp5B,EAAG,MACHq5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyBhzD,CAAQ,EAAQ,4FCGlD,SAAWmiD,GAAU,aAIfA,EAAOkO,aAAa,MAAO,CACjCC,OAAQ,kFAAkF1tC,MACtF,KAEJ2tC,YAAa,kFAAkF3tC,MAC3F,KAEJ4tC,SAAU,kDAAkD5tC,MAAM,KAClE6tC,cAAe,kDAAkD7tC,MAAM,KACvE8tC,YAAa,kDAAkD9tC,MAAM,KACrEquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,SACN/0C,EAAG,OACHg1C,GAAI,UACJp9C,EAAG,QACHq9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJp5B,EAAG,MACHq5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyBhzD,CAAQ,EAAQ,8FCGlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,sFAAsF1tC,MAC1F,KAEJ2tC,YAAa,sFAAsF3tC,MAC/F,KAEJ4tC,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,iCACLC,KAAM,wCAEVZ,cAAe,qDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGM,eAAb5C,GACa,UAAbA,GACa,iBAAbA,EAEO4C,EACa,iBAAb5C,GAA4C,QAAbA,EAC/B4C,EAAO,GAEPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,aACAA,EAAK,IACL,QACAA,EAAK,KACL,eACAA,EAAK,KACL,MACAA,EAAK,KACL,eAEA,OAGfhI,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,4BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN/0C,EAAG,eACHg1C,GAAI,YACJp9C,EAAG,YACHq9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAGRC,uBAAwB,6BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,SACpB,QACI,OAAOA,IAGnBgB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC8+C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhCi+C,KAAM,CAEFC,IAAK,EACLC,IAAK,KA5GyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAYzB,SAAS6R,EAAuBnB,EAAQQ,EAAe1tD,GASnD,MAAY,MAARA,EACO0tD,EAAgB,UAAY,UACpB,MAAR1tD,EACA0tD,EAAgB,SAAW,SAE3BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,sBAAwB,sBAC5Cf,GAAI,gBACJE,GAAI,wBACJE,GAAI,kBAOgC/sD,GArBvBid,MAAM,KAChBqxC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAsDR,SAASuF,EAAqB3oD,GAC1B,OAAO,WACH,OAAOA,EAAM,KAAwB,KAAjBhR,KAAKgxD,QAAiB,IAAM,IAAM,QAIrD3O,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,CACJ5oC,OAAQ,yFAAyF9E,MAC7F,KAEJuxC,WAAY,iGAAiGvxC,MACzG,MAGR2tC,YAAa,yDAAyD3tC,MAClE,KAEJ4tC,SAhDJ,SAA6B17C,EAAG4S,GAC5B,IAAI8oC,EAAW,CACPkJ,WAAY,0DAA0D92C,MAClE,KAEJ+2C,WAAY,0DAA0D/2C,MAClE,KAEJg3C,SAAU,4DAA4Dh3C,MAClE,MAKZ,OAAU,IAAN9N,EACO07C,EAAqB,WACvB5uD,MAAM,EAAG,GACTM,OAAOsuD,EAAqB,WAAE5uD,MAAM,EAAG,IAE3CkT,EASE07C,EALI,qBAAqBvtC,KAAKyE,GAC/B,aACA,sCAAsCzE,KAAKyE,GAC3C,WACA,cACoB5S,EAAEu/C,OARjB7D,EAAqB,YA6BhCC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAASgI,EAAqB,cAC9B/H,QAAS+H,EAAqB,YAC9B7H,QAAS6H,EAAqB,WAC9B9H,SAAU8H,EAAqB,cAC/B5H,SAAU,WACN,OAAQ/xD,KAAKu0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOoF,EAAqB,oBAAoB53D,KAAK/B,MACzD,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAO25D,EAAqB,qBAAqB53D,KAAK/B,QAGlEgyD,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN/0C,EAAG,kBACHg1C,GAAI8B,EACJl/C,EAAGk/C,EACH7B,GAAI6B,EACJ5B,EAAG,SACHC,GAAI2B,EACJ/6B,EAAG,OACHq5B,GAAI0B,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAGRrD,cAAe,wBACfC,KAAM,SAAUl+C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjCm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhKyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIzB,IAAImO,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,MACA,SACA,OACA,QACA,SACA,QACA,SAEJwI,EAAO,CAAC,QAAS,MAAO,OAAQ,MAAO,SAAU,OAAQ,QAEpD3W,EAAOkO,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAUl+C,GACZ,MAAO,QAAUA,GAErBm+C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,sBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN/0C,EAAG,YACHg1C,GAAI,WACJp9C,EAAG,UACHq9C,GAAI,SACJC,EAAG,YACHC,GAAI,WACJp5B,EAAG,SACHq5B,GAAI,QACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUxuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC8+C,WAAY,SAAUtuD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhCi+C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyBhzD,CAAQ,EAAQ,gGCElD,SAAWmiD,GAAU,aAIZA,EAAOkO,aAAa,UAAW,CACxCC,OAAQ,6EAA6E1tC,MACjF,KAEJ2tC,YAAa,oDAAoD3tC,MAAM,KACvE4tC,SAAU,+DAA+D5tC,MACrE,KAEJ6tC,cAAe,kCAAkC7tC,MAAM,KACvD8tC,YAAa,yBAAyB9tC,MAAM,KAC5CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,uBACTC,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,kBACRC,KAAM,qBACN/0C,EAAG,SACHg1C,GAAI,YACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,yEAAyE1tC,MAC7E,KAEJ2tC,YAAa,kDAAkD3tC,MAAM,KACrE4tC,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,8BAA8B7tC,MAAM,KACnD8tC,YAAa,uBAAuB9tC,MAAM,KAC1CquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,sBACTC,SAAU,mCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,oBACN/0C,EAAG,SACHg1C,GAAI,YACJp9C,EAAG,aACHq9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJp5B,EAAG,UACHq5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyBhzD,CAAQ,EAAQ,2FCIlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,qGAAqG1tC,MACzG,KAEJ2tC,YAAa,sFAAsF3tC,MAC/F,KAEJiyC,kBAAkB,EAClBrE,SAAU,yDAAyD5tC,MAC/D,KAEJ6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,uBAAuB9tC,MAAM,KAC1C4wC,oBAAoB,EACpB7C,cAAe,SACfC,KAAM,SAAUl+C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExBm+C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCACNh/B,EAAG,YACHujC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,mBACTC,QAAS,oBACTC,SAAU,yBACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN/0C,EAAG,WACHg1C,GAAI,UACJp9C,EAAG,WACHq9C,GAAI,UACJC,EAAG,UACHC,GAAI,SACJp5B,EAAG,WACHq5B,GAAI,UACJiC,EAAG,WACHC,GAAI,UACJjC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KA5EyBhzD,CAAQ,EAAQ,iGCElD,SAAWmiD,GAAU,aAIXA,EAAOkO,aAAa,WAAY,CAC1CC,OAAQ,6GAA6G1tC,MACjH,KAEJ2tC,YAAa,8DAA8D3tC,MACvE,KAEJiyC,kBAAkB,EAClBrE,SAAU,yEAAyE5tC,MAC/E,KAEJ6tC,cAAe,qCAAqC7tC,MAAM,KAC1D8tC,YAAa,4BAA4B9tC,MAAM,KAC/C4wC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJE,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,eACVC,QAAS,uBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN/0C,EAAG,mBACHg1C,GAAI,eACJp9C,EAAG,aACHq9C,GAAI,eACJC,EAAG,YACHC,GAAI,YACJp5B,EAAG,SACHq5B,GAAI,WACJC,EAAG,YACHC,GAAI,cACJC,EAAG,UACHC,GAAI,aAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAIn0C,EAAIm0C,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAANn0C,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBo0C,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyBhzD,CAAQ,EAAQ,2FCGlD,SAAWmiD,GAAU,aAIhBA,EAAOkO,aAAa,KAAM,CAC/BC,OAAQ,0FAA0F1tC,MAC9F,KAEJ2tC,YAAa,gEAAgE3tC,MAAM,KACnF4tC,SAAU,uDAAuD5tC,MAAM,KACvE6tC,cAAe,sCAAsC7tC,MAAM,KAC3D8tC,YAAa,2BAA2B9tC,MAAM,KAC9CquC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,8BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN/0C,EAAG,oBACHg1C,GAAI,WACJp9C,EAAG,cACHq9C,GAAI,aACJC,EAAG,cACHC,GAAI,aACJp5B,EAAG,WACHq5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,gBACxBC,QAAS,UACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyBhzD,CAAQ,EAAQ,8FCKlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wCAAwC1tC,MAC5C,KAEJ2tC,YAAa,yCAAyC3tC,MAClD,KAEJ4tC,SAAU,8BAA8B5tC,MAAM,KAC9C6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACNh/B,EAAG,WACHujC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,GAGPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAWhzD,KAAKgzD,OACb,WAEA,YAGflB,QAAS,SACTC,SAAU,SAAUgG,GAChB,OAAI/3D,KAAKgzD,SAAW+E,EAAI/E,OACb,WAEA,YAGfhB,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN/0C,EAAG,KACHg1C,GAAI,OACJp9C,EAAG,OACHq9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJp5B,EAAG,MACHq5B,GAAI,OACJiC,EAAG,MACHC,GAAI,OACJjC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,QAERI,KAAM,CAEFC,IAAK,EACLC,IAAK,KApHyBhzD,CAAQ,EAAQ,8FCIlD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wCAAwC1tC,MAC5C,KAEJ2tC,YAAa,yCAAyC3tC,MAClD,KAEJ4tC,SAAU,8BAA8B5tC,MAAM,KAC9C6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACNh/B,EAAG,WACHujC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACO,OAAPA,EACA,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,YACVC,QAAS,SACTC,SAAU,YACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN/0C,EAAG,KACHg1C,GAAI,OACJp9C,EAAG,OACHq9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJp5B,EAAG,MACHq5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0B1yD,CAAQ,EAAQ,8FCElD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wCAAwC1tC,MAC5C,KAEJ2tC,YAAa,yCAAyC3tC,MAClD,KAEJ4tC,SAAU,8BAA8B5tC,MAAM,KAC9C6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACNh/B,EAAG,WACHujC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN/0C,EAAG,KACHg1C,GAAI,OACJp9C,EAAG,OACHq9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJp5B,EAAG,MACHq5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0B1yD,CAAQ,EAAQ,8FCElD,SAAWmiD,GAAU,aAIdA,EAAOkO,aAAa,QAAS,CACpCC,OAAQ,wCAAwC1tC,MAC5C,KAEJ2tC,YAAa,yCAAyC3tC,MAClD,KAEJ4tC,SAAU,8BAA8B5tC,MAAM,KAC9C6tC,cAAe,uBAAuB7tC,MAAM,KAC5C8tC,YAAa,gBAAgB9tC,MAAM,KACnCquC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACNh/B,EAAG,WACHujC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN/0C,EAAG,KACHg1C,GAAI,OACJp9C,EAAG,OACHq9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJp5B,EAAG,MACHq5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0B1yD,CAAQ,EAAQ,wGCP1D,IAAIyO,EAAM,CACT,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,WAAY,yCACZ,cAAe,yCACf,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,QAAS,sCACT,aAAc,2CACd,gBAAiB,2CACjB,WAAY,sCACZ,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,yCAIf,SAASorD,EAAeC,GACvB,IAAI3uD,EAAK4uD,EAAsBD,GAC/B,OAAOE,EAAoB7uD,GAE5B,SAAS4uD,EAAsBD,GAC9B,IAAIE,EAAoBt1C,EAAEjW,EAAKqrD,GAAM,CACpC,IAAI13C,EAAI,IAAI7P,MAAM,uBAAyBunD,EAAM,KAEjD,MADA13C,EAAEglC,KAAO,mBACHhlC,EAEP,OAAO3T,EAAIqrD,GAEZD,EAAevmD,KAAO,WACrB,OAAOD,OAAOC,KAAK7E,IAEpBorD,EAAeptD,QAAUstD,EACzBn6D,EAAOwvD,QAAUyK,EACjBA,EAAe1uD,GAAK,8GClSnB,IAASoS,EAAAA,EAAqiI8I,OAAOF,SAAziIxmB,QAAQC,OAAO,eAAe,IAAI0E,MAAM,eAAe,CAACo5C,OAAM,IAAKryC,OAAO,CAAC,mBAAmB,SAASkS,GAAG5d,QAAQ+M,UAAU6Q,EAAE08C,0BAA0B18C,EAAE08C,yBAAyB,sCAAsC18C,EAAE28C,2BAA2B,yCAAyCv6D,QAAQC,OAAO,mBAAmB,CAAC,mBAAmBD,QAAQC,OAAO,iBAAiB,IAAID,QAAQC,OAAO,QAAQ,CAAC,eAAe,iBAAiB,mBAAmB,eAAwEA,EAAOwvD,UAAUA,IAAUxvD,EAAOwvD,QAAQ,SAASzvD,QAAQC,OAAO,kBAAkB2X,QAAQ,MAAM,CAAC,KAAK,SAASgG,GAAG,IAAImB,EAAE,OAAaua,EAAE,CAAC,MAAM,KAAI,MAAM,KAAK,MAAM,KAAI,MAAM,KAAK,MAAM,MAAMn5B,KAAKq6D,eAAe,SAAS58C,EAAEmB,GAAG,MAAM,WAAWA,EAAE07C,YAAYt6D,KAAKu6D,QAAQ98C,GAAGA,EAAE+8C,iBAAiB,MAAM57C,EAAE07C,YAAYt6D,KAAKu6D,QAAQ98C,GAAGA,EAAE3I,WAAWC,QAAQ,IAAI6J,EAAE07C,YAAY,iBAAiB78C,GAAGA,EAAEA,EAAE1I,QAAQ,KAAK,OAAO6J,EAAE67C,cAAch9C,EAAEvP,QAAQ,MAAM,GAAGuP,EAAEvP,QAAQ,OAAO,GAAGuP,EAAEvP,QAAQ,OAAO,KAAKuP,EAAEmB,EAAE87C,SAASj9C,EAAEmB,EAAE87C,UAAUj9C,GAAG,kBAAkBA,EAAEA,EAAE,OAAO,QAAQA,GAAGzd,KAAKu6D,QAAQ,SAAS98C,GAAG,OAAOA,IAAIA,KAAKk9C,SAASl9C,IAAIwU,QAAQxU,EAAE,KAAKzd,KAAKke,UAAU,SAASib,EAAE7W,GAAG,IAAImxC,EAAEh2C,EAAExR,QAAQ4R,EAAE7d,KAAKsyD,EAAE,GAAGj1C,EAAE,GAAGK,EAAED,EAAExN,KAAKkpB,GAAGpuB,MAAK,SAAS0S,GAA6C,IAAI0b,EAAEzb,EAA7C7d,QAAQ+M,UAAU0V,EAAEs4C,SAASt4C,EAAEs4C,SAAgBzhC,EAAE,GAAGt5B,QAAQkB,QAAQuhB,EAAEs4C,QAAO,SAASn9C,GAAGzd,KAAKS,KAAKod,EAAEw8C,eAAe58C,EAAE6E,MAAK6W,GAAGzb,EAAEyb,EAAElmB,KAAKqP,EAAEu4C,SAASv4C,EAAEu4C,SAAS,KAAKx9C,GAAGK,EAAEkB,GAAE,IAAsI6T,EAAEzd,EAApIwI,EAAE,GAAM3d,QAAQmS,QAAQyL,GAAGD,EAAEC,EAAE5d,QAAQuN,WAAWqQ,KAAKD,EAAEC,KAAK5d,QAAQ+M,UAAU0V,EAAEsoC,QAAQtoC,EAAEsoC,OAAO,kBAAkBtoC,EAAEsoC,QAAen4B,EAAE,GAAG5yB,QAAQkB,QAAQyc,EAAE,IAAG,SAASC,EAAEmB,GAAG5e,KAAKS,KAAKod,EAAEw8C,eAAez7C,EAAE0D,MAAKmQ,GAAGzd,EAAEyd,EAAExf,KAAKqP,EAAEu4C,SAASv4C,EAAEu4C,SAAS,KAAKx9C,GAAGrI,EAAE4J,GAAE/e,QAAQkB,QAAQyc,GAAE,SAASC,EAAEq9C,GAAG,IAAI3hC,EAAEs6B,EAAEnB,EAAEzyD,QAAQoiB,KAAKzE,EAAEs9C,IAAIrH,EAAE,GAAG,IAAI/1C,EAAE4E,EAAEy4C,YAAYz4C,EAAEy4C,YAAYzI,EAAEzyD,QAAQkB,QAAQ2c,GAAE,SAASD,GAAG,IAAImB,EAAE0D,EAAEy4C,YAAYzI,EAAE70C,GAAGA,EAAEzd,KAAKS,KAAKod,EAAEw8C,eAAez7C,EAAE0D,MAAKmxC,GAAGt6B,EAAEs6B,EAAExgD,KAAKqP,EAAEu4C,SAASv4C,EAAEu4C,SAAS,KAAKx9C,GAAGy9C,EAAEt9C,EAAEpO,OAAO+pB,EAAEva,EAAEua,KAAI7W,EAAE04C,qBAAqB1I,GAA9wC,UAAoxCA,GAAGj1C,EAAEo2C,EAAE9mD,QAAQ2lD,MAAK,MAAM,mBAAmB50C,EAAS,OAAGA,EAAS,OAAE,SAASD,GAAGg2C,EAAEpf,OAAO52B,MAAKg2C,EAAEhwD,SAASzD,KAAKi7D,cAAc,SAASx9C,GAAG,YAAO,IAAS0b,EAAE1b,IAAIzd,KAAKk7D,eAAe,SAASz9C,GAAG,OAAO0b,EAAE1b,OAAO5d,QAAQC,OAAO,oBAAoB+C,UAAU,QAAQ,CAAC,SAAS,KAAK,MAAM,YAAY,WAAW,SAAS+b,EAAEk8C,EAAE3hC,EAAE7W,EAAEmxC,GAAG,MAAM,CAACtsD,SAAS,KAAKrE,MAAM,CAAC6E,KAAK,SAASwzD,SAAS,YAAYP,OAAO,aAAaG,YAAY,kBAAkBL,SAAS,iBAAiBJ,WAAW,oBAAoBG,aAAa,gBAAgBI,SAAS,kBAAkBzuC,SAAS,YAAY4uC,mBAAmB,UAAUvgB,QAAQ,IAAI2gB,QAAQ,WAAWxQ,MAAM,aAAa5pD,WAAW,CAAC,SAAS,WAAW,SAAS,cAAc,SAASyc,EAAEmB,EAAE0D,GAAwe7E,EAAE49C,IAAI,GAAGx7D,QAAQ+M,UAAU6Q,EAAE2O,WAAW,QAAQ3O,EAAE2O,UAAUvsB,QAAQmS,QAAQyL,EAAE9V,OAAO8V,EAAElZ,OAAO,QAAO,WAAWkZ,EAAE69C,cAAY,GAAI79C,EAAE89C,YAAY,WAAW,OAAO99C,EAAE09C,UAAU,gBAAgB19C,EAAE69C,SAAS,WAAW,IAAIz9C,EAAEi9C,EAAE7uD,QAAQ,OAAO2S,EAAE48C,SAASl5C,EAAEm5C,mBAAmB,kBAAkBtiC,EAAEjb,UAAUT,EAAE9V,OAAhxB,WAAa,IAAIiX,EAAE,CAAC87C,SAASj9C,EAAEi9C,SAASj9C,EAAEi9C,SAAS,IAAIJ,WAAW78C,EAAE68C,WAAW78C,EAAE68C,WAAW,IAAIG,aAAah9C,EAAEg9C,aAAaO,mBAAmBv9C,EAAEu9C,oBAAoB,OAAOn7D,QAAQ+M,UAAU0V,EAAEo5C,aAAa98C,EAAEg8C,OAAOn9C,EAAEpc,MAAMoc,EAAEm9C,SAAS/6D,QAAQ+M,UAAU0V,EAAEq5C,kBAAkB/8C,EAAEm8C,YAAYt9C,EAAEpc,MAAMoc,EAAEs9C,cAAcl7D,QAAQ+M,UAAU0V,EAAEs5C,YAAYh9C,EAAEgsC,MAAMntC,EAAEpc,MAAMoc,EAAEmtC,QAAQhsC,EAAEi8C,SAASp9C,EAAEo9C,SAASp9C,EAAEo9C,SAAS,IAAIj8C,EAAEi8C,SAAS1hC,EAAE8hC,cAAcr8C,EAAEi8C,UAAU1hC,EAAE+hC,eAAet8C,EAAEi8C,UAAUj8C,EAAEi8C,SAASj8C,EAAoT60C,IAAK1oD,MAAK,SAAS+vD,GAAGr9C,EAAE49C,IAAIP,EAAEl8C,EAAEi9C,YAAYv5C,EAAEm5C,mBAAmB,kBAAkB59C,EAAElR,QAAQmuD,MAAKr9C,EAAExZ,SAAS4Z,EAAEpa,WAAW8E,KAAK,SAASqW,EAAEk8C,GAA8bA,EAAEx3D,KAAK,SAAQ,WAAWsb,EAAE08C,WAAWvwD,MAAK,YAAve,WAAa,IAAI+vD,EAAEl8C,EAAEw8C,SAAS,QAAQjiC,EAAE,IAAIs2B,KAAK,CAAC7wC,EAAEy8C,KAAK,CAACnsD,KAAK,oBAAoB4rD,EAAE,MAAM,GAAGr9C,EAAEo+B,UAAUigB,iBAAiBjgB,UAAUkgB,WAAW5iC,EAAEva,EAAE28C,mBAAmB,CAAC,IAAI19C,EAAEhe,QAAQkD,QAAQ,+CAA+CuvD,EAAEzyD,QAAQkD,QAAQ8a,EAAEjV,WAAW,IAAI0pD,EAAEx/C,KAAK,OAAO2K,EAAEowC,IAAImO,gBAAgB7iC,IAAIm5B,EAAEx/C,KAAK,WAAW8L,EAAE28C,eAAejJ,EAAEx/C,KAAK,SAAS,UAAUwP,EAAExB,KAAK,QAAQuZ,OAAOxc,GAAG41C,GAAE,WAAWnB,EAAE,GAAGvH,QAAQuH,EAAEzlD,WAAU,OAA8DssB,MAAMva,EAAE3a","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/rbevione/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","forceDownload","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","isSendingMessage","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","code","outOfInterval","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","hideDelay","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","goToIf","enableCustomerWriting","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""}
\ No newline at end of file
* https://github.com/angular/material
* @license MIT
* v1.2.3
- */html,body{height:100%;position:relative}body{margin:0;padding:0}[tabindex="-1"]:focus{outline:none}.inset{padding:10px}a.md-no-style,button.md-no-style{font-weight:normal;background-color:inherit;text-align:left;border:none;padding:0;margin:0}select,button,textarea,input{vertical-align:baseline}input[type=reset],input[type=submit],html input[type=button],button{cursor:pointer;-webkit-appearance:button}input[type=reset][disabled],input[type=submit][disabled],html input[type=button][disabled],button[disabled]{cursor:default}textarea{vertical-align:top;overflow:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box;-webkit-box-sizing:content-box}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}input:-webkit-autofill{text-shadow:none}.md-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;text-transform:none;width:1px}.md-shadow{position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;pointer-events:none}.md-shadow-bottom-z-1{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-shadow-bottom-z-2{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-shadow-animated.md-shadow{transition:box-shadow .28s cubic-bezier(0.4, 0, 0.2, 1)}.md-ripple-container{pointer-events:none;position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;transition:all .55s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple{position:absolute;transform:translate(-50%, -50%) scale(0);transform-origin:50% 50%;opacity:0;border-radius:50%}.md-ripple.md-ripple-placed{transition:margin .9s cubic-bezier(0.25, 0.8, 0.25, 1),border .9s cubic-bezier(0.25, 0.8, 0.25, 1),width .9s cubic-bezier(0.25, 0.8, 0.25, 1),height .9s cubic-bezier(0.25, 0.8, 0.25, 1),opacity .9s cubic-bezier(0.25, 0.8, 0.25, 1),transform .9s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple.md-ripple-scaled{transform:translate(-50%, -50%) scale(1)}.md-ripple.md-ripple-active,.md-ripple.md-ripple-full,.md-ripple.md-ripple-visible{opacity:.2}.md-ripple.md-ripple-remove{animation:md-remove-ripple .9s cubic-bezier(0.25, 0.8, 0.25, 1)}@keyframes md-remove-ripple{0%{opacity:.15}100%{opacity:0}}.md-padding{padding:8px}.md-margin{margin:8px}.md-scroll-mask{position:absolute;background-color:transparent;top:0;right:0;bottom:0;left:0;z-index:50}.md-scroll-mask>.md-scroll-mask-bar{display:block;position:absolute;background-color:#fafafa;right:0;top:0;bottom:0;z-index:65;box-shadow:inset 0 0 1px rgba(0,0,0,.3)}.md-no-momentum{-webkit-overflow-scrolling:auto}.md-no-flicker{-webkit-filter:blur(0px)}@media(min-width: 960px){.md-padding{padding:16px}}html[dir=rtl],html[dir=ltr],body[dir=rtl],body[dir=ltr]{unicode-bidi:embed}bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}html,body{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:default;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.md-display-4{font-size:112px;font-weight:300;letter-spacing:-0.01em;line-height:112px}.md-display-3{font-size:56px;font-weight:400;letter-spacing:-0.005em;line-height:56px}.md-display-2{font-size:45px;font-weight:400;line-height:64px}.md-display-1{font-size:34px;font-weight:400;line-height:40px}.md-headline{font-size:24px;font-weight:400;line-height:32px}.md-title{font-size:20px;font-weight:500;letter-spacing:.005em}.md-subhead{font-size:16px;font-weight:400;letter-spacing:.01em;line-height:24px}.md-body-1{font-size:14px;font-weight:400;letter-spacing:.01em;line-height:20px}.md-body-2{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:24px}.md-caption{font-size:12px;letter-spacing:.02em}.md-button{letter-spacing:.01em}button,select,html,textarea,input{font-family:Roboto,"Helvetica Neue",sans-serif}select,button,textarea,input{font-size:100%}.md-panel-outer-wrapper{height:100%;left:0;position:absolute;top:0;width:100%}.md-panel-inner-wrapper{position:fixed}._md-panel-offscreen{left:-9999px}._md-panel-hidden{display:none}._md-panel-shown .md-panel{opacity:1;transition:none}.md-panel{opacity:0;position:relative}.md-panel._md-panel-shown{opacity:1;transition:none}.md-panel._md-panel-animate-enter{opacity:1;transition:all .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-panel-animate-leave{opacity:1;transition:all .3s cubic-bezier(0.4, 0, 1, 1)}.md-panel._md-panel-animate-scale-out,.md-panel._md-panel-animate-fade-out{opacity:0}.md-panel._md-panel-backdrop{height:100%;position:fixed;width:100%}.md-panel._md-opaque-enter{opacity:.48;transition:opacity .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-opaque-leave{transition:opacity .3s cubic-bezier(0.4, 0, 1, 1)}._md-panel-fullscreen{border-radius:0;left:0;min-height:100%;min-width:100%;position:fixed;top:0}md-autocomplete{border-radius:2px;display:block;height:40px;position:relative;overflow:visible;min-width:190px}md-autocomplete[disabled] input{cursor:default}md-autocomplete[md-floating-label]{border-radius:0;background:transparent;height:auto}md-autocomplete[md-floating-label] md-input-container{padding-bottom:0}md-autocomplete[md-floating-label] md-autocomplete-wrap{height:auto}md-autocomplete[md-floating-label] .md-show-clear-button button{display:block;position:absolute;right:0;top:20px;width:30px;height:30px}md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:30px}[dir=rtl] md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:0;padding-left:30px}md-autocomplete md-autocomplete-wrap{display:flex;flex-direction:row;box-sizing:border-box;position:relative;overflow:visible;height:40px}md-autocomplete md-autocomplete-wrap.md-menu-showing{z-index:51}md-autocomplete md-autocomplete-wrap md-input-container,md-autocomplete md-autocomplete-wrap input{flex:1 1 0;box-sizing:border-box;min-width:0}md-autocomplete md-autocomplete-wrap md-progress-linear{position:absolute;bottom:-2px;left:0}md-autocomplete md-autocomplete-wrap md-progress-linear.md-inline{bottom:40px;right:2px;left:2px;width:auto}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate{position:absolute;top:0;left:0;width:100%;height:3px;transition:none}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container{transition:none;height:3px}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter.ng-enter-active{opacity:1}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave.ng-leave-active{opacity:0}md-autocomplete input:not(.md-input){font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;width:100%;padding:0 15px;line-height:40px;height:40px}md-autocomplete input:not(.md-input)::-ms-clear{display:none}md-autocomplete .md-show-clear-button button{position:relative;line-height:20px;text-align:center;width:30px;height:30px;cursor:pointer;border:none;border-radius:50%;padding:0;font-size:12px;background:transparent;margin:auto 5px}md-autocomplete .md-show-clear-button button:after{content:"";position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border-radius:50%;transform:scale(0);opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-autocomplete .md-show-clear-button button:focus{outline:none}md-autocomplete .md-show-clear-button button:focus:after{transform:scale(1);opacity:1}md-autocomplete .md-show-clear-button button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0) scale(0.9)}md-autocomplete .md-show-clear-button button md-icon path{stroke-width:0}md-autocomplete .md-show-clear-button button.ng-enter{transform:scale(0);transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-enter.ng-enter-active{transform:scale(1)}md-autocomplete .md-show-clear-button button.ng-leave{transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active{transform:scale(0)}@media screen and (-ms-high-contrast: active){md-autocomplete input{border:1px solid #fff}md-autocomplete .md-autocomplete-suggestion:focus{color:#fff}}.md-virtual-repeat-container.md-autocomplete-suggestions-container,.md-standard-list-container.md-autocomplete-suggestions-container{position:absolute;box-shadow:0 2px 5px rgba(0,0,0,.25);z-index:100;height:100%}.md-virtual-repeat-container.md-autocomplete-suggestions-container .highlight,.md-standard-list-container.md-autocomplete-suggestions-container .highlight{font-weight:bold}.md-standard-list-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;overflow-y:auto;padding:0}.md-virtual-repeat-container.md-not-found,.md-standard-list-container.md-not-found{height:48px}.md-autocomplete-suggestions{margin:0;list-style:none;padding:0}.md-autocomplete-suggestions .md-autocomplete-suggestion{font-size:14px;overflow:hidden;padding:0 15px;line-height:48px;height:48px;transition:background .15s linear;margin:0;white-space:nowrap;text-overflow:ellipsis}.md-autocomplete-suggestions .md-autocomplete-suggestion:focus{outline:none}.md-autocomplete-suggestions .md-autocomplete-suggestion:not(.md-not-found-wrapper){cursor:pointer}@media screen and (-ms-high-contrast: active){md-autocomplete,.md-autocomplete-suggestions{border:1px solid #fff}}md-backdrop{transition:opacity 450ms;position:absolute;top:0;bottom:0;left:0;right:0;z-index:50}md-backdrop.md-menu-backdrop{position:fixed !important;z-index:99}md-backdrop.md-select-backdrop{z-index:81;transition-duration:0}md-backdrop.md-dialog-backdrop{z-index:79}md-backdrop.md-bottom-sheet-backdrop{z-index:69}md-backdrop.md-sidenav-backdrop{z-index:59}md-backdrop.md-click-catcher{position:absolute}md-backdrop.md-opaque{opacity:.48}md-backdrop.md-opaque.ng-enter{opacity:0}md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active{opacity:.48}md-backdrop.md-opaque.ng-leave{opacity:.48;transition:opacity 400ms}md-backdrop.md-opaque.ng-leave.md-opaque.ng-leave-active{opacity:0}md-bottom-sheet{position:absolute;left:0;right:0;bottom:0;padding:8px 16px 88px 16px;z-index:70;border-top-width:1px;border-top-style:solid;transform:translate3d(0, 80px, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform}md-bottom-sheet.md-has-header{padding-top:0}md-bottom-sheet.ng-enter{opacity:0;transform:translate3d(0, 100%, 0)}md-bottom-sheet.ng-enter-active{opacity:1;display:block;transform:translate3d(0, 80px, 0) !important}md-bottom-sheet.ng-leave-active{transform:translate3d(0, 100%, 0) !important;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-bottom-sheet .md-subheader{background-color:transparent;font-family:Roboto,"Helvetica Neue",sans-serif;line-height:56px;padding:0;white-space:nowrap}md-bottom-sheet md-inline-icon{display:inline-block;height:24px;width:24px;fill:#444}md-bottom-sheet md-list-item{display:flex;outline:none}md-bottom-sheet md-list-item:hover{cursor:pointer}md-bottom-sheet.md-list md-list-item{padding:0;align-items:center;height:48px}md-bottom-sheet.md-grid{padding-left:24px;padding-right:24px;padding-top:0}md-bottom-sheet.md-grid md-list{display:flex;flex-direction:row;flex-wrap:wrap;transition:all .5s;align-items:center}md-bottom-sheet.md-grid md-list-item{flex-direction:column;align-items:center;transition:all .5s;height:96px;margin-top:8px;margin-bottom:8px}@media(max-width: 960px){md-bottom-sheet.md-grid md-list-item{flex:1 1 33.3333333333%;max-width:33.3333333333%}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n + 1){align-items:flex-start}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n){align-items:flex-end}}@media(min-width: 960px)and (max-width: 1279px){md-bottom-sheet.md-grid md-list-item{flex:1 1 25%;max-width:25%}}@media(min-width: 1280px)and (max-width: 1919px){md-bottom-sheet.md-grid md-list-item{flex:1 1 16.6666666667%;max-width:16.6666666667%}}@media(min-width: 1920px){md-bottom-sheet.md-grid md-list-item{flex:1 1 14.2857142857%;max-width:14.2857142857%}}md-bottom-sheet.md-grid md-list-item::before{display:none}md-bottom-sheet.md-grid md-list-item .md-list-item-content{display:flex;flex-direction:column;align-items:center;width:48px;padding-bottom:16px}md-bottom-sheet.md-grid md-list-item .md-grid-item-content{border:1px solid transparent;display:flex;flex-direction:column;align-items:center;width:80px}md-bottom-sheet.md-grid md-list-item .md-grid-text{font-weight:400;line-height:16px;font-size:13px;margin:0;white-space:nowrap;width:64px;text-align:center;text-transform:none;padding-top:8px}@media screen and (-ms-high-contrast: active){md-bottom-sheet{border:1px solid #fff}}button.md-button::-moz-focus-inner{border:0}.md-button{display:inline-block;position:relative;cursor:pointer;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:2px;box-sizing:border-box;user-select:none;outline:none;border:0;padding:0 8px;margin:6px 8px;background:transparent;color:currentColor;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden;transition:box-shadow .4s cubic-bezier(0.25, 0.8, 0.25, 1),background-color .4s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){min-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){line-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){font-size:13px}.md-button:focus{outline:none}.md-button:hover,.md-button:focus{text-decoration:none}.md-button.ng-hide,.md-button.ng-leave{transition:none}.md-button.md-cornered{border-radius:0}.md-button.md-icon{padding:0;background:none}.md-button.md-raised:not([disabled]){box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button.md-icon-button{margin:0 6px;height:40px;min-width:0;line-height:24px;padding:8px;width:40px;border-radius:50%}.md-button.md-fab{z-index:20;line-height:56px;min-width:0;width:56px;height:56px;vertical-align:middle;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:50%;background-clip:padding-box;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-property:background-color,box-shadow,transform}.md-button.md-fab.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}.md-button.md-fab.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}.md-button.md-fab.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}.md-button.md-fab.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}.md-button.md-fab.md-mini{line-height:40px;width:40px;height:40px}.md-button.md-fab.ng-hide,.md-button.md-fab.ng-leave{transition:none}.md-button.md-fab[disabled]{box-shadow:none}.md-button:not([disabled]).md-raised.md-focused,.md-button:not([disabled]).md-fab.md-focused{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button:not([disabled]).md-raised:active,.md-button:not([disabled]).md-fab:active{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-button .md-ripple-container{border-radius:inherit;background-clip:padding-box;overflow:hidden;-webkit-transform:translateZ(0)}.md-button.md-icon-button md-icon,button.md-button.md-fab md-icon{display:block}.md-toast-open-top .md-button.md-fab-top-left,.md-toast-open-top .md-button.md-fab-top-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, 42px, 0)}.md-toast-open-top .md-button.md-fab-top-left:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-left:not([disabled]):hover,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]):hover{transform:translate3d(0, 41px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left,.md-toast-open-bottom .md-button.md-fab-bottom-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, -42px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]):hover,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]):hover{transform:translate3d(0, -43px, 0)}.md-button-group{display:flex;flex:1;width:100%}.md-button-group>.md-button{flex:1;display:block;overflow:hidden;width:0;border-width:1px 0px 1px 1px;border-radius:0;text-align:center;text-overflow:ellipsis;white-space:nowrap}.md-button-group>.md-button:first-child{border-radius:2px 0px 0px 2px}.md-button-group>.md-button:last-child{border-right-width:1px;border-radius:0px 2px 2px 0px}@media screen and (-ms-high-contrast: active){.md-button.md-raised,.md-button.md-fab{border:1px solid #fff}}md-card{box-sizing:border-box;display:flex;flex-direction:column;margin:8px;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-card md-card-header{padding:16px;display:flex;flex-direction:row}md-card md-card-header:first-child md-card-avatar{margin-right:12px}[dir=rtl] md-card md-card-header:first-child md-card-avatar{margin-right:auto;margin-left:12px}md-card md-card-header:last-child md-card-avatar{margin-left:12px}[dir=rtl] md-card md-card-header:last-child md-card-avatar{margin-left:auto;margin-right:12px}md-card md-card-header md-card-avatar{width:40px;height:40px}md-card md-card-header md-card-avatar .md-user-avatar,md-card md-card-header md-card-avatar md-icon{border-radius:50%}md-card md-card-header md-card-avatar md-icon{padding:8px}md-card md-card-header md-card-avatar md-icon>svg{height:inherit;width:inherit}md-card md-card-header md-card-avatar+md-card-header-text{max-height:40px}md-card md-card-header md-card-avatar+md-card-header-text .md-title{font-size:14px}md-card md-card-header md-card-header-text{display:flex;flex:1;flex-direction:column}md-card md-card-header md-card-header-text .md-subhead{font-size:14px}md-card>img,md-card>md-card-header img,md-card md-card-title-media img{box-sizing:border-box;display:flex;flex:0 0 auto;width:100%;height:auto}md-card md-card-title{padding:24px 16px 16px;display:flex;flex:1 1 auto;flex-direction:row}md-card md-card-title+md-card-content{padding-top:0}md-card md-card-title md-card-title-text{flex:1;flex-direction:column;display:flex}md-card md-card-title md-card-title-text .md-subhead{padding-top:0;font-size:14px}md-card md-card-title md-card-title-text:only-child .md-subhead{padding-top:12px}md-card md-card-title md-card-title-media{margin-top:-8px}md-card md-card-title md-card-title-media .md-media-sm{height:80px;width:80px}md-card md-card-title md-card-title-media .md-media-md{height:112px;width:112px}md-card md-card-title md-card-title-media .md-media-lg{height:152px;width:152px}md-card md-card-content{display:block;padding:16px}md-card md-card-content>p:first-child{margin-top:0}md-card md-card-content>p:last-child{margin-bottom:0}md-card md-card-content .md-media-xl{height:240px;width:240px}md-card md-card-actions{margin:8px}md-card md-card-actions.layout-column .md-button:not(.md-icon-button){margin:2px 0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):first-of-type{margin-top:0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):last-of-type{margin-bottom:0}md-card md-card-actions.layout-column .md-button.md-icon-button{margin-top:6px;margin-bottom:6px}md-card md-card-actions md-card-icon-actions{flex:1;justify-content:flex-start;display:flex;flex-direction:row}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button){margin:0 4px}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:auto;margin-right:0}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:auto;margin-left:0}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button{margin-left:6px;margin-right:6px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:auto;margin-right:12px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:auto;margin-left:12px}md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions{flex:1;justify-content:flex-end;display:flex;flex-direction:row}md-card md-card-footer{margin-top:auto;padding:16px}@media screen and (-ms-high-contrast: active){md-card{border:1px solid #fff}}.md-image-no-fill>img{width:auto;height:auto}.md-inline-form md-checkbox{margin-top:14px;margin-bottom:auto}md-checkbox{box-sizing:border-box;display:inline-block;white-space:nowrap;cursor:pointer;outline:none;user-select:none;position:relative;min-width:18px;min-height:48px}.md-dense>md-checkbox:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) md-checkbox:not(.md-dense-disabled){min-height:36px}md-checkbox.md-focused:not([disabled]) .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before{background-color:rgba(0,0,0,.12)}md-checkbox .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-checkbox .md-container{left:auto}[dir=rtl] md-checkbox .md-container{right:0}md-checkbox .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-checkbox .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-checkbox .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-checkbox .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-checkbox.md-checked .md-icon{border-color:transparent}md-checkbox.md-checked .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox[disabled]{cursor:default}md-checkbox.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox .md-container{top:auto;left:auto;right:auto;margin:3px;margin-top:21px}md-checkbox .md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;margin-top:10px;margin-bottom:auto;margin-left:36px}[dir=rtl] md-checkbox .md-label{margin-left:0;margin-right:36px}md-checkbox .md-label:empty{margin-left:24px;margin-right:0}[dir=rtl] md-checkbox .md-label:empty{margin-left:0}[dir=rtl] md-checkbox .md-label:empty{margin-right:24px}md-input-container .md-checkbox-link-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;cursor:pointer;top:-21px;margin-left:18px;margin-right:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-left:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-right:18px}.md-contact-chips .md-chips md-chip{padding:0 25px 0 0}[dir=rtl] .md-contact-chips .md-chips md-chip{padding:0 0 0 25px}.md-contact-chips .md-chips md-chip .md-contact-avatar{float:left}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-avatar{float:right}.md-contact-chips .md-chips md-chip .md-contact-avatar img{height:32px;border-radius:16px}.md-contact-chips .md-chips md-chip .md-contact-name{display:inline-block;height:32px;margin-left:8px}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion{height:56px}.md-contact-suggestion img{height:40px;border-radius:20px;margin-top:8px}.md-contact-suggestion .md-contact-name{margin-left:8px;width:120px}[dir=rtl] .md-contact-suggestion .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion .md-contact-name,.md-contact-suggestion .md-contact-email{display:inline-block;overflow:hidden;text-overflow:ellipsis}.md-contact-chips-suggestions li{height:100%}md-chips{display:flex}.md-chips{display:flex;flex-wrap:wrap;flex-grow:1;font-family:Roboto,"Helvetica Neue",sans-serif;font-size:13px;padding:0 0 8px 3px;vertical-align:middle}.md-chips:after{content:"";display:table;clear:both}[dir=rtl] .md-chips{padding:0 3px 8px 0}.md-chips.md-readonly .md-chip-input-container{min-height:32px}.md-chips:not(.md-readonly){cursor:text}.md-chips.md-removable md-chip{padding-right:28px}[dir=rtl] .md-chips.md-removable md-chip{padding-right:0;padding-left:28px}.md-chips.md-removable md-chip .md-chip-content{padding-right:4px}[dir=rtl] .md-chips.md-removable md-chip .md-chip-content{padding-right:0;padding-left:4px}.md-chips md-chip{cursor:default;border-radius:16px;display:block;height:32px;line-height:32px;margin:8px 8px 0 0;padding:0 12px 0 12px;float:left;box-sizing:border-box;max-width:100%;position:relative}[dir=rtl] .md-chips md-chip{margin:8px 0 0 8px}[dir=rtl] .md-chips md-chip{float:right}.md-chips md-chip .md-chip-content{display:block;float:left;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-chips md-chip .md-chip-content{float:right}.md-chips md-chip .md-chip-content:focus{outline:none}.md-chips md-chip._md-chip-content-edit-is-enabled{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.md-chips md-chip .md-chip-remove-container{position:absolute;right:0;line-height:22px}[dir=rtl] .md-chips md-chip .md-chip-remove-container{right:auto;left:0}.md-chips md-chip .md-chip-remove{text-align:center;width:32px;height:32px;min-width:0;padding:0;background:transparent;border:none;box-shadow:none;margin:0;position:relative}.md-chips md-chip .md-chip-remove md-icon{height:18px;width:18px;min-height:18px;min-width:18px;position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.md-chips .md-chip-input-container{display:block;line-height:32px;margin:8px 8px 0 0;padding:0;flex-grow:1;float:left}[dir=rtl] .md-chips .md-chip-input-container{margin:8px 0 0 8px}[dir=rtl] .md-chips .md-chip-input-container{float:right}.md-chips .md-chip-input-container input{width:100%}.md-chips .md-chip-input-container input:not([type]),.md-chips .md-chip-input-container input[type=email],.md-chips .md-chip-input-container input[type=number],.md-chips .md-chip-input-container input[type=tel],.md-chips .md-chip-input-container input[type=url],.md-chips .md-chip-input-container input[type=text]{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:not([type]):focus,.md-chips .md-chip-input-container input[type=email]:focus,.md-chips .md-chip-input-container input[type=number]:focus,.md-chips .md-chip-input-container input[type=tel]:focus,.md-chips .md-chip-input-container input[type=url]:focus,.md-chips .md-chip-input-container input[type=text]:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{background:transparent;height:32px}.md-chips .md-chip-input-container md-autocomplete md-autocomplete-wrap{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container input{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{height:32px}.md-chips .md-chip-input-container md-autocomplete{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container:not(:first-child){margin:8px 8px 0 0}[dir=rtl] .md-chips .md-chip-input-container:not(:first-child){margin:8px 0 0 8px}.md-chips .md-chip-input-container input{background:transparent;border-width:0}.md-chips md-autocomplete button{display:none}@media screen and (-ms-high-contrast: active){.md-chip-input-container,md-chip{border:1px solid #fff}.md-chip-input-container md-autocomplete{border:none}}md-content{display:block;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}md-content[md-scroll-y]{overflow-y:auto;overflow-x:hidden}md-content[md-scroll-x]{overflow-x:auto;overflow-y:hidden}@media print{md-content{overflow:visible !important}}md-calendar{font-size:13px;user-select:none}.md-calendar-scroll-mask{display:inline-block;overflow:hidden;height:308px}.md-calendar-scroll-mask .md-virtual-repeat-scroller{overflow-y:scroll;-webkit-overflow-scrolling:touch}.md-calendar-scroll-mask .md-virtual-repeat-scroller::-webkit-scrollbar{display:none}.md-calendar-scroll-mask .md-virtual-repeat-offsetter{width:100%}.md-calendar-scroll-container{box-shadow:inset -3px 3px 6px rgba(0,0,0,.2);display:inline-block;height:308px;width:346px}.md-calendar-date{height:44px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box}.md-calendar-date:first-child{padding-left:16px}[dir=rtl] .md-calendar-date:first-child{padding-left:0;padding-right:16px}.md-calendar-date:last-child{padding-right:16px}[dir=rtl] .md-calendar-date:last-child{padding-right:0;padding-left:16px}.md-calendar-date.md-calendar-date-disabled{cursor:default}.md-calendar-date-selection-indicator{transition:background-color,color .4s cubic-bezier(0.25, 0.8, 0.25, 1);border-radius:50%;display:inline-block;width:40px;height:40px;line-height:40px}.md-calendar-date:not(.md-disabled) .md-calendar-date-selection-indicator{cursor:pointer}.md-calendar-month-label{height:44px;font-size:14px;font-weight:500;padding:0 0 0 24px}[dir=rtl] .md-calendar-month-label{padding:0 24px 0 0}.md-calendar-month-label.md-calendar-label-clickable{cursor:pointer}.md-calendar-month-label md-icon{transform:rotate(180deg)}[dir=rtl] .md-calendar-month-label md-icon{transform:none}.md-calendar-month-label span{vertical-align:middle}.md-calendar-day-header{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar-day-header th{height:40px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box;font-weight:normal}.md-calendar-day-header th:first-child{padding-left:16px}[dir=rtl] .md-calendar-day-header th:first-child{padding-left:0;padding-right:16px}.md-calendar-day-header th:last-child{padding-right:16px}[dir=rtl] .md-calendar-day-header th:last-child{padding-right:0;padding-left:16px}.md-calendar{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar tr:last-child td{border-bottom-width:1px;border-bottom-style:solid}.md-calendar:first-child{border-top:1px solid transparent}.md-calendar tbody,.md-calendar td,.md-calendar tr{vertical-align:middle;box-sizing:content-box}md-datepicker{white-space:nowrap;overflow:hidden;vertical-align:middle}.md-inline-form md-datepicker{margin-top:12px}.md-datepicker-button{display:inline-block;box-sizing:border-box;background:none;vertical-align:middle;position:relative}.md-datepicker-button:before{top:0;left:0;bottom:0;right:0;position:absolute;content:"";speak:none}.md-datepicker-input{font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;min-width:120px;max-width:328px;padding:0 0 5px}.md-datepicker-input::-ms-clear{display:none}._md-datepicker-floating-label>md-datepicker{overflow:visible}._md-datepicker-floating-label>md-datepicker .md-datepicker-input-container{border:none}._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:left;margin-top:-16px;top:13.5px}[dir=rtl] ._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:right}._md-datepicker-floating-label .md-input{float:none}._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:18px;left:auto;width:calc(100% - 84px)}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:auto}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){left:18px}._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:64px}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:auto;margin-right:64px}._md-datepicker-has-triangle-icon{padding-right:18px;margin-right:-18px}[dir=rtl] ._md-datepicker-has-triangle-icon{padding-right:0;padding-left:18px}[dir=rtl] ._md-datepicker-has-triangle-icon{margin-right:auto;margin-left:-18px}.md-datepicker-input-container{position:relative;border-bottom-width:1px;border-bottom-style:solid;display:inline-block;width:auto}.md-icon-button+.md-datepicker-input-container{margin-left:12px}[dir=rtl] .md-icon-button+.md-datepicker-input-container{margin-left:auto;margin-right:12px}.md-datepicker-input-container.md-datepicker-focused{border-bottom-width:2px}.md-datepicker-is-showing .md-scroll-mask{z-index:99}.md-datepicker-calendar-pane{position:absolute;top:0;left:-100%;z-index:100;border-width:1px;border-style:solid;background:transparent;transform:scale(0);transform-origin:0 0;transition:transform .2s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-datepicker-calendar-pane.md-pane-open{transform:scale(1)}.md-datepicker-input-mask{height:40px;width:340px;position:relative;overflow:hidden;background:transparent;pointer-events:none;cursor:text}.md-datepicker-calendar{opacity:0;transition:opacity .2s cubic-bezier(0.5, 0, 0.25, 1)}.md-pane-open .md-datepicker-calendar{opacity:1}.md-datepicker-calendar md-calendar:focus{outline:none}.md-datepicker-expand-triangle{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid}.md-datepicker-triangle-button{position:absolute;right:0;bottom:-2.5px;transform:translateX(45%)}[dir=rtl] .md-datepicker-triangle-button{right:auto;left:0}[dir=rtl] .md-datepicker-triangle-button{transform:translateX(-45%)}.md-datepicker-triangle-button.md-button.md-icon-button{height:36px;width:36px;position:absolute;padding:8px}md-datepicker[disabled] .md-datepicker-input-container{border-bottom-color:transparent}md-datepicker[disabled] .md-datepicker-triangle-button{display:none}.md-datepicker-open{overflow:hidden}.md-datepicker-open .md-datepicker-input-container,.md-datepicker-open input.md-input{border-bottom-color:transparent}.md-datepicker-open .md-datepicker-triangle-button,.md-datepicker-open.md-input-has-value>label,.md-datepicker-open.md-input-has-placeholder>label{display:none}.md-datepicker-pos-adjusted .md-datepicker-input-mask{display:none}.md-datepicker-calendar-pane .md-calendar{transform:translateY(-85px);transition:transform .65s cubic-bezier(0.25, 0.8, 0.25, 1);transition-delay:.125s}.md-datepicker-calendar-pane.md-pane-open .md-calendar{transform:translateY(0)}.md-dialog-is-showing{max-height:100%}.md-dialog-container{display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80;overflow:hidden}md-dialog{opacity:0;min-width:240px;max-width:80%;max-height:80%;position:relative;overflow:auto;box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12);display:flex;flex-direction:column}md-dialog.md-transition-in{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 0) scale(1)}md-dialog.md-transition-out{opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 100%) scale(0.2)}md-dialog>form{display:flex;flex-direction:column;overflow:auto}md-dialog .md-dialog-content{padding:24px}md-dialog md-dialog-content{order:1;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}md-dialog md-dialog-content:not([layout=row])>*:first-child:not(.md-subheader){margin-top:0}md-dialog md-dialog-content:focus{outline:none}md-dialog md-dialog-content .md-subheader{margin:0}md-dialog md-dialog-content .md-dialog-content-body{width:100%}md-dialog md-dialog-content .md-prompt-input-container{width:100%;box-sizing:border-box}md-dialog md-dialog-actions{display:flex;order:2;box-sizing:border-box;align-items:center;justify-content:flex-end;margin-bottom:0;padding-right:8px;padding-left:16px;min-height:52px;overflow:hidden}[dir=rtl] md-dialog md-dialog-actions{padding-right:16px}[dir=rtl] md-dialog md-dialog-actions{padding-left:8px}md-dialog md-dialog-actions .md-button{margin-bottom:8px;margin-left:8px;margin-right:0;margin-top:8px}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-left:0}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-right:8px}md-dialog.md-content-overflow md-dialog-actions{border-top-width:1px;border-top-style:solid}@media screen and (-ms-high-contrast: active){md-dialog{border:1px solid #fff}}@media(max-width: 959px){md-dialog.md-dialog-fullscreen{min-height:100%;min-width:100%;border-radius:0}}md-divider{display:block;border-top-width:1px;border-top-style:solid;margin:0}md-divider[md-inset]{margin-left:80px}[dir=rtl] md-divider[md-inset]{margin-left:auto;margin-right:80px}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-divider,.layout-xs-row>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-divider,.layout-gt-xs-row:not(.layout-sm-column)>md-divider,.layout-sm-row:not(.layout-sm-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-sm-row:not(.layout-md-column)>md-divider,.layout-md-row:not(.layout-md-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-md-row:not(.layout-lg-column)>md-divider,.layout-lg-row:not(.layout-lg-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}md-fab-speed-dial{position:relative;display:flex;align-items:center;z-index:20}md-fab-speed-dial.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-speed-dial.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-speed-dial.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-speed-dial.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-speed-dial:not(.md-hover-full){pointer-events:none}md-fab-speed-dial:not(.md-hover-full) md-fab-trigger,md-fab-speed-dial:not(.md-hover-full) .md-fab-action-item{pointer-events:auto}md-fab-speed-dial:not(.md-hover-full).md-is-open{pointer-events:auto}md-fab-speed-dial ._md-css-variables{z-index:20}md-fab-speed-dial.md-is-open .md-fab-action-item{align-items:center}md-fab-speed-dial md-fab-actions{display:flex;height:auto}md-fab-speed-dial md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-down{flex-direction:column}md-fab-speed-dial.md-down md-fab-trigger{order:1}md-fab-speed-dial.md-down md-fab-actions{flex-direction:column;order:2}md-fab-speed-dial.md-up{flex-direction:column}md-fab-speed-dial.md-up md-fab-trigger{order:2}md-fab-speed-dial.md-up md-fab-actions{flex-direction:column-reverse;order:1}md-fab-speed-dial.md-left{flex-direction:row}md-fab-speed-dial.md-left md-fab-trigger{order:2}md-fab-speed-dial.md-left md-fab-actions{flex-direction:row-reverse;order:1}md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-right{flex-direction:row}md-fab-speed-dial.md-right md-fab-trigger{order:1}md-fab-speed-dial.md-right md-fab-actions{flex-direction:row;order:2}md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-fling-remove .md-fab-action-item>*,md-fab-speed-dial.md-scale-remove .md-fab-action-item>*{visibility:hidden}md-fab-speed-dial.md-fling .md-fab-action-item{opacity:1}md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item{opacity:0;transition-duration:0s}md-fab-speed-dial.md-scale .md-fab-action-item{transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.1428571429s}md-fab-toolbar{display:block}md-fab-toolbar.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-toolbar.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-toolbar.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-toolbar.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-toolbar .md-fab-toolbar-wrapper{display:block;position:relative;overflow:hidden;height:68px}md-fab-toolbar md-fab-trigger{position:absolute;z-index:20}md-fab-toolbar md-fab-trigger button{overflow:visible !important}md-fab-toolbar md-fab-trigger .md-fab-toolbar-background{display:block;position:absolute;z-index:21;opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-toolbar md-fab-trigger md-icon{position:relative;z-index:22;opacity:1;transition:all 200ms ease-in}md-fab-toolbar.md-left md-fab-trigger{right:0}[dir=rtl] md-fab-toolbar.md-left md-fab-trigger{right:auto;left:0}md-fab-toolbar.md-left .md-toolbar-tools{flex-direction:row-reverse}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:.6rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:auto;margin-left:.6rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:-0.8rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-0.8rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:8px}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:8px}md-fab-toolbar.md-right md-fab-trigger{left:0}[dir=rtl] md-fab-toolbar.md-right md-fab-trigger{left:auto;right:0}md-fab-toolbar.md-right .md-toolbar-tools{flex-direction:row}md-fab-toolbar md-toolbar{background-color:transparent !important;pointer-events:none;z-index:23}md-fab-toolbar md-toolbar .md-toolbar-tools{padding:0 20px;margin-top:3px}md-fab-toolbar md-toolbar .md-fab-action-item{opacity:0;transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.15s}md-fab-toolbar.md-is-open md-fab-trigger>button{box-shadow:none}md-fab-toolbar.md-is-open md-fab-trigger>button md-icon{opacity:0}md-fab-toolbar.md-is-open .md-fab-action-item{opacity:1;transform:scale(1)}md-grid-list{box-sizing:border-box;display:block;position:relative}md-grid-list md-grid-tile,md-grid-list md-grid-tile>figure,md-grid-list md-grid-tile-header,md-grid-list md-grid-tile-footer{box-sizing:border-box}md-grid-list md-grid-tile{display:block;position:absolute}md-grid-list md-grid-tile figure{display:flex;align-items:center;justify-content:center;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;padding:0;margin:0}md-grid-list md-grid-tile md-grid-tile-header,md-grid-list md-grid-tile md-grid-tile-footer{display:flex;flex-direction:row;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.18);overflow:hidden;position:absolute;left:0;right:0}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-footer h4{font-weight:400;margin:0 0 0 16px}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-footer h3{font-size:14px}md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h4{font-size:12px}md-grid-list md-grid-tile md-grid-tile-header{top:0}md-grid-list md-grid-tile md-grid-tile-footer{bottom:0}@media screen and (-ms-high-contrast: active){md-grid-tile{border:1px solid #fff}md-grid-tile-footer{border-top:1px solid #fff}}md-icon{margin:auto;background-repeat:no-repeat no-repeat;display:inline-block;vertical-align:middle;fill:currentColor;height:24px;width:24px;min-height:24px;min-width:24px}md-icon svg{pointer-events:none;display:block}md-icon[md-font-icon]{line-height:24px;width:auto}md-input-container{display:inline-block;position:relative;padding:2px;margin:18px 0px;vertical-align:middle}md-input-container:after{content:"";display:table;clear:both}md-input-container.md-block{display:block}md-input-container .md-errors-spacer{float:right;min-height:24px;min-width:1px}[dir=rtl] md-input-container .md-errors-spacer{float:left}md-input-container>md-icon{position:absolute;top:8px;left:2px;right:auto}[dir=rtl] md-input-container>md-icon{left:auto}[dir=rtl] md-input-container>md-icon{right:2px}md-input-container textarea,md-input-container input[type=text],md-input-container input[type=password],md-input-container input[type=datetime],md-input-container input[type=datetime-local],md-input-container input[type=date],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week],md-input-container input[type=number],md-input-container input[type=email],md-input-container input[type=url],md-input-container input[type=search],md-input-container input[type=tel],md-input-container input[type=color]{-moz-appearance:none;-webkit-appearance:none}md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week]{min-height:30px}md-input-container textarea{resize:none;overflow:hidden}md-input-container textarea.md-input{min-height:30px;-ms-flex-preferred-size:auto}md-input-container textarea[md-no-autogrow]{height:auto;overflow:auto}md-input-container label:not(.md-container-ignore){position:absolute;bottom:100%;left:0;right:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){left:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){right:0}md-input-container label:not(.md-container-ignore).md-required:after{content:" *";font-size:13px;vertical-align:top}md-input-container label:not(.md-no-float):not(.md-container-ignore),md-input-container .md-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;padding-right:0;z-index:1;transform:translate3d(0, 28px, 0) scale(1);transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);max-width:100%;transform-origin:left top}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-left:0}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-right:2px}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{transform-origin:right top}md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-input-has-value .md-placeholder{padding-left:3px;padding-right:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-left:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-right:3px}md-input-container .md-placeholder{position:absolute;top:0;opacity:0;transition-property:opacity,transform;transform:translate3d(0, 30px, 0)}md-input-container.md-input-focused .md-placeholder{opacity:1;transform:translate3d(0, 24px, 0)}md-input-container.md-input-has-value .md-placeholder{transition:none;opacity:0}md-input-container:not(.md-input-has-value):not(.md-input-has-placeholder) input:not(:focus){color:transparent}md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-millisecond-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-minute-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-month-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-second-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-week-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-year-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-text{color:transparent}md-input-container .md-input{order:2;display:block;margin-top:0;background:none;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-width:0 0 1px 0;line-height:26px;height:30px;-ms-flex-preferred-size:26px;border-radius:0;border-style:solid;transition:border-color .4s cubic-bezier(0.25, 0.8, 0.25, 1);width:100%;box-sizing:border-box;float:left}[dir=rtl] md-input-container .md-input{padding-left:2px}[dir=rtl] md-input-container .md-input{padding-right:0}[dir=rtl] md-input-container .md-input{float:right}md-input-container .md-input:focus{outline:none}md-input-container .md-input:invalid{outline:none;box-shadow:none}md-input-container .md-input.md-no-flex{flex:none !important}md-input-container .md-char-counter{text-align:right;padding-right:2px;padding-left:0}[dir=rtl] md-input-container .md-char-counter{text-align:left}[dir=rtl] md-input-container .md-char-counter{padding-right:0}[dir=rtl] md-input-container .md-char-counter{padding-left:2px}md-input-container .md-input-messages-animation{position:relative;order:4;overflow:hidden;clear:left}[dir=rtl] md-input-container .md-input-messages-animation{clear:right}md-input-container .md-input-message-animation,md-input-container .md-char-counter{font-size:12px;line-height:14px;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);opacity:1;margin-top:0;padding-top:8px}md-input-container .md-input-message-animation:not(.md-char-counter),md-input-container .md-char-counter:not(.md-char-counter){padding-right:5px;padding-left:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-right:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-left:5px}md-input-container:not(.md-input-invalid) .md-auto-hide .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter-prepare{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter:not(.ng-enter-active){opacity:0;margin-top:-100px}md-input-container.md-input-focused label:not(.md-no-float),md-input-container.md-input-has-placeholder label:not(.md-no-float),md-input-container.md-input-has-value label:not(.md-no-float){transform:translate3d(0, 6px, 0) scale(0.75);transition:transform cubic-bezier(0.25, 0.8, 0.25, 1) .4s,width cubic-bezier(0.25, 0.8, 0.25, 1) .4s}md-input-container.md-input-has-value label{transition:none}md-input-container.md-input-focused .md-input,md-input-container .md-input.ng-invalid.ng-dirty,md-input-container.md-input-resized .md-input{padding-bottom:0;border-width:0 0 2px 0}md-input-container .md-input[disabled],[disabled] md-input-container .md-input{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x}md-input-container.md-icon-float{transition:margin-top .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-input-container.md-icon-float>label{pointer-events:none;position:absolute}md-input-container.md-icon-float>md-icon{top:8px;left:2px;right:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{left:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{right:2px}md-input-container.md-icon-left>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left>label .md-placeholder,md-input-container.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-right>label .md-placeholder{width:calc(100% - 36px);padding:0}md-input-container.md-icon-left{padding-left:36px;padding-right:0}[dir=rtl] md-input-container.md-icon-left{padding-left:0}[dir=rtl] md-input-container.md-icon-left{padding-right:36px}md-input-container.md-icon-left>label{left:36px;right:auto}[dir=rtl] md-input-container.md-icon-left>label{left:auto}[dir=rtl] md-input-container.md-icon-left>label{right:36px}md-input-container.md-icon-right{padding-left:0;padding-right:36px}[dir=rtl] md-input-container.md-icon-right{padding-left:36px}[dir=rtl] md-input-container.md-icon-right{padding-right:0}md-input-container.md-icon-right>md-icon:last-of-type{margin:0;right:2px;left:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{right:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{left:2px}md-input-container.md-icon-left.md-icon-right{padding-left:36px;padding-right:36px}md-input-container.md-icon-left.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left.md-icon-right>label .md-placeholder{width:calc(100% - (36px * 2))}.md-resize-wrapper{position:relative}.md-resize-wrapper:after{content:"";display:table;clear:both}.md-resize-handle{position:absolute;bottom:-5px;left:0;height:10px;background:transparent;width:100%;cursor:ns-resize}@media screen and (-ms-high-contrast: active){md-input-container.md-default-theme>md-icon{fill:#fff}}md-list{display:block;padding:8px 0px 8px 0px}md-list .md-subheader{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:1.2em}md-list.md-dense:not(.md-dense-disabled) md-list-item,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner{min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item::before,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner::before{content:"";min-height:40px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner md-icon:first-child{width:20px;height:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:36px;margin-top:4px;margin-bottom:4px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:20px;margin-top:6px;margin-bottom:6px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar{flex:none;width:36px;height:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container .md-secondary.md-button,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container .md-secondary.md-button{margin-top:4px;margin-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container md-checkbox:not(.md-dense-disabled),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container md-checkbox:not(.md-dense-disabled){min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text p{line-height:1.05;font-size:12px;padding-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:13px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style{min-height:60px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style::before{content:"";min-height:60px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style{min-height:76px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style::before{content:"";min-height:76px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}md-list.md-dense:not(.md-dense-disabled) .md-subheader-inner{padding-top:12px;padding-bottom:12px}md-list-item{position:relative}md-list-item.md-proxy-focus.md-focused .md-no-style{transition:background-color .15s linear}md-list-item._md-button-wrap{position:relative}md-list-item._md-button-wrap>div.md-button:first-child{display:flex;align-items:center;justify-content:flex-start;padding:0px 16px;margin:0;font-weight:400;text-align:left;border:medium none}[dir=rtl] md-list-item._md-button-wrap>div.md-button:first-child{text-align:right}md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child{position:absolute;top:0;left:0;height:100%;margin:0;padding:0}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner{width:100%}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner::before{content:"";min-height:inherit;visibility:hidden;display:inline-block}md-list-item.md-no-proxy,md-list-item .md-no-style{position:relative;padding:0px 16px;flex:1 1 auto}md-list-item.md-no-proxy.md-button,md-list-item .md-no-style.md-button{font-size:inherit;height:inherit;text-align:left;text-transform:none;width:100%;white-space:normal;flex-direction:inherit;align-items:inherit;border-radius:0;margin:0}[dir=rtl] md-list-item.md-no-proxy.md-button,[dir=rtl] md-list-item .md-no-style.md-button{text-align:right}md-list-item.md-no-proxy.md-button>.md-ripple-container,md-list-item .md-no-style.md-button>.md-ripple-container{border-radius:0}md-list-item.md-no-proxy:focus,md-list-item .md-no-style:focus{outline:none}md-list-item.md-clickable:hover{cursor:pointer}md-list-item md-divider{position:absolute;bottom:0;left:0;width:100%}[dir=rtl] md-list-item md-divider{left:auto;right:0}md-list-item md-divider[md-inset]{left:72px;width:calc(100% - 72px);margin:0 !important}[dir=rtl] md-list-item md-divider[md-inset]{left:auto;right:72px}md-list-item,md-list-item .md-list-item-inner{display:flex;justify-content:flex-start;align-items:center;min-height:48px;height:auto}md-list-item::before,md-list-item .md-list-item-inner::before{content:"";min-height:48px;visibility:hidden;display:inline-block}md-list-item>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item>md-icon.md-secondary:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon.md-secondary:not(.md-avatar-icon){width:24px;margin-top:16px;margin-bottom:12px;box-sizing:content-box}md-list-item>div.md-primary>md-checkbox,md-list-item>div.md-secondary>md-checkbox,md-list-item>md-checkbox,md-list-item md-checkbox.md-secondary,md-list-item .md-list-item-inner>div.md-primary>md-checkbox,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox,md-list-item .md-list-item-inner>md-checkbox,md-list-item .md-list-item-inner md-checkbox.md-secondary{align-self:center}md-list-item>div.md-primary>md-checkbox .md-label,md-list-item>div.md-secondary>md-checkbox .md-label,md-list-item>md-checkbox .md-label,md-list-item md-checkbox.md-secondary .md-label,md-list-item .md-list-item-inner>div.md-primary>md-checkbox .md-label,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox .md-label,md-list-item .md-list-item-inner>md-checkbox .md-label,md-list-item .md-list-item-inner md-checkbox.md-secondary .md-label{display:none}md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:32px}[dir=rtl] md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:32px}md-list-item .md-avatar,md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar,md-list-item .md-list-item-inner .md-avatar-icon{margin-top:8px;margin-bottom:8px;margin-right:16px;border-radius:50%;box-sizing:content-box}[dir=rtl] md-list-item .md-avatar,[dir=rtl] md-list-item .md-avatar-icon,[dir=rtl] md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:16px}md-list-item .md-avatar,md-list-item .md-list-item-inner .md-avatar{flex:none;width:40px;height:40px}md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar-icon{padding:8px}md-list-item .md-avatar-icon svg,md-list-item .md-list-item-inner .md-avatar-icon svg{width:24px;height:24px}md-list-item>md-checkbox,md-list-item .md-list-item-inner>md-checkbox{width:24px;min-height:40px;margin-left:0px;margin-right:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-left:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-right:0px}md-list-item .md-secondary-container,md-list-item .md-list-item-inner .md-secondary-container{display:flex;align-items:center;position:relative;flex-shrink:0;margin:auto;margin-right:0;margin-left:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-right:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-left:0}md-list-item .md-secondary-container .md-button:last-of-type,md-list-item .md-secondary-container .md-icon-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:0}[dir=rtl] md-list-item .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-icon-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-checkbox,md-list-item .md-list-item-inner .md-secondary-container md-checkbox{margin:0 6px;padding:0 8px;min-height:40px}md-list-item .md-secondary-container md-checkbox:last-child,md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{width:40px;margin-right:0}[dir=rtl] md-list-item .md-secondary-container md-checkbox:last-child,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-switch,md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-top:0;margin-bottom:0;margin-right:-6px}[dir=rtl] md-list-item .md-secondary-container md-switch,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-right:auto;margin-left:-6px}md-list-item>p,md-list-item>.md-list-item-inner>p,md-list-item .md-list-item-inner>p,md-list-item .md-list-item-inner>.md-list-item-inner>p{flex:1 1 auto;margin:0}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style,md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{align-items:flex-start;justify-content:center}md-list-item.md-2-line.md-long-text,md-list-item.md-2-line>.md-no-style.md-long-text,md-list-item.md-3-line.md-long-text,md-list-item.md-3-line>.md-no-style.md-long-text{margin-top:8px;margin-bottom:8px}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text,md-list-item.md-3-line .md-list-item-text,md-list-item.md-3-line>.md-no-style .md-list-item-text{flex:1 1 auto;margin:auto;text-overflow:ellipsis;overflow:hidden}md-list-item.md-2-line .md-list-item-text.md-offset,md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list-item.md-3-line .md-list-item-text.md-offset,md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list-item.md-2-line .md-list-item-text h3,md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list-item.md-3-line .md-list-item-text h3,md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:16px;font-weight:400;letter-spacing:.01em;margin:0 0 0 0;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text h4,md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list-item.md-3-line .md-list-item-text h4,md-list-item.md-3-line>.md-no-style .md-list-item-text h4{font-size:14px;letter-spacing:.01em;margin:3px 0 1px 0;font-weight:400;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text p,md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list-item.md-3-line .md-list-item-text p,md-list-item.md-3-line>.md-no-style .md-list-item-text p{font-size:14px;font-weight:500;letter-spacing:.01em;margin:0 0 0 0;line-height:1.6em}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style{height:auto;min-height:72px}md-list-item.md-2-line::before,md-list-item.md-2-line>.md-no-style::before{content:"";min-height:72px;visibility:hidden;display:inline-block}md-list-item.md-2-line>.md-avatar,md-list-item.md-2-line .md-avatar-icon,md-list-item.md-2-line>.md-no-style>.md-avatar,md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list-item.md-2-line>md-icon:first-child,md-list-item.md-2-line>.md-no-style>md-icon:first-child{align-self:flex-start}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text{flex:1 1 auto}md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{height:auto;min-height:88px}md-list-item.md-3-line::before,md-list-item.md-3-line>.md-no-style::before{content:"";min-height:88px;visibility:hidden;display:inline-block}md-list-item.md-3-line>md-icon:first-child,md-list-item.md-3-line>.md-avatar,md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}.md-open-menu-container{position:fixed;left:0;top:0;z-index:100;opacity:0;border-radius:2px;max-height:calc(100vh - 10px);overflow:auto}.md-open-menu-container md-menu-divider{margin-top:4px;margin-bottom:4px;height:1px;min-height:1px;max-height:1px;width:100%}.md-open-menu-container md-menu-content>*{opacity:0}.md-open-menu-container:not(.md-clickable){pointer-events:none}.md-open-menu-container.md-active{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:200ms}.md-open-menu-container.md-active>md-menu-content>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:200ms;transition-delay:100ms}.md-open-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}md-menu-content{display:flex;flex-direction:column;padding:8px 0;max-height:304px;overflow-y:auto}md-menu-content.md-dense{max-height:208px}md-menu-content.md-dense md-menu-item{height:32px;min-height:32px}md-menu-item{display:flex;flex-direction:row;min-height:48px;height:48px;align-content:center;justify-content:flex-start}md-menu-item>*{width:100%;margin:auto 0;padding-left:16px;padding-right:16px}md-menu-item>a.md-button{padding-top:5px}md-menu-item>.md-button{text-align:left;display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-menu-item>.md-button::-moz-focus-inner{padding:0;border:0}[dir=rtl] md-menu-item>.md-button{text-align:right}md-menu-item>.md-button md-icon{margin:auto 16px auto 0}[dir=rtl] md-menu-item>.md-button md-icon{margin:auto 0 auto 16px}md-menu-item>.md-button p{display:inline-block;margin:auto}md-menu-item>.md-button span{margin-top:auto;margin-bottom:auto}md-menu-item>.md-button .md-ripple-container{border-radius:inherit}md-toolbar .md-menu{height:auto;margin:auto;padding:0}@media(max-width: 959px){md-menu-content{min-width:112px}md-menu-content[width="3"]{min-width:168px}md-menu-content[width="4"]{min-width:224px}md-menu-content[width="5"]{min-width:280px}md-menu-content[width="6"]{min-width:336px}md-menu-content[width="7"]{min-width:392px}}@media(min-width: 960px){md-menu-content{min-width:96px}md-menu-content[width="3"]{min-width:192px}md-menu-content[width="4"]{min-width:256px}md-menu-content[width="5"]{min-width:320px}md-menu-content[width="6"]{min-width:384px}md-menu-content[width="7"]{min-width:448px}}md-toolbar.md-menu-toolbar h2.md-toolbar-tools{line-height:1rem;height:auto;padding:28px;padding-bottom:12px}md-toolbar.md-has-open-menu{position:relative;z-index:100}md-menu-bar{padding:0 20px;display:block;position:relative;z-index:2}md-menu-bar .md-menu{display:inline-block;padding:0;position:relative}md-menu-bar button{font-size:14px;padding:0 10px;margin:0;border:0;background-color:transparent;height:40px}md-menu-bar md-backdrop.md-menu-backdrop{z-index:-2}md-menu-content.md-menu-bar-menu.md-dense{max-height:none;padding:16px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent{position:relative}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{position:absolute;padding:0;width:24px;top:6px;left:24px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{left:auto;right:24px}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 32px 0 64px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 64px 0 32px}md-menu-content.md-menu-bar-menu.md-dense .md-button{min-height:0;height:32px}md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:right}md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:right;margin:0 8px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:left}md-menu-content.md-menu-bar-menu.md-dense md-menu-divider{margin:8px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:right}md-menu-content.md-menu-bar-menu.md-dense .md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{position:relative;margin:0;width:100%;text-transform:none;font-weight:normal;border-radius:0px;padding-left:16px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{padding-left:0;padding-right:16px}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{display:block;content:"▼";position:absolute;top:0px;speak:none;transform:rotate(270deg) scaleY(0.45) scaleX(0.9);right:28px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{transform:rotate(90deg) scaleY(0.45) scaleX(0.9)}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{right:auto;left:28px}.md-nav-bar{border-style:solid;border-width:0 0 1px;height:48px;position:relative}._md-nav-bar-list{outline:none;list-style:none;margin:0;padding:0;box-sizing:border-box;display:flex;flex-direction:row}.md-nav-item:first-of-type{margin-left:8px}.md-button._md-nav-button{line-height:24px;margin:0 4px;padding:12px 16px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1)}.md-button._md-nav-button:focus{outline:none}md-nav-ink-bar{background-color:#000;position:absolute;bottom:0;left:0;width:100%;height:2px;transform-origin:left top;will-change:transform;transition:transform .125s cubic-bezier(0.35, 0, 0.25, 1)}md-nav-ink-bar.ng-animate{transition:none}md-nav-extra-content{min-height:48px;padding-right:12px}@keyframes indeterminate-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}md-progress-circular{position:relative;display:block;transform:scale(1, 1)}[dir=rtl] md-progress-circular{transform:scale(-1, 1)}md-progress-circular._md-progress-circular-disabled{visibility:hidden}md-progress-circular.md-mode-indeterminate svg{animation:indeterminate-rotate 1568.63ms linear infinite}md-progress-circular svg{position:absolute;overflow:visible;top:0;left:0}md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0 !important;margin-bottom:0 !important;transform:scale(1, 1)}[dir=rtl] md-progress-linear{transform:scale(-1, 1)}md-progress-linear._md-progress-linear-disabled{visibility:hidden}md-progress-linear .md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;transform:translate(0, 0) scale(1, 1)}md-progress-linear .md-container .md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear .md-container .md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px !important;background-position:0px -23px}md-progress-linear .md-container .md-bar1,md-progress-linear .md-container .md-bar2{transition:transform .2s linear}md-progress-linear .md-container.md-mode-query .md-bar1{display:none}md-progress-linear .md-container.md-mode-query .md-bar2{transition:all .2s linear;animation:query .8s infinite cubic-bezier(0.39, 0.575, 0.565, 1)}md-progress-linear .md-container.md-mode-determinate .md-bar1{display:none}md-progress-linear .md-container.md-mode-indeterminate .md-bar1{animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear .md-container.md-mode-indeterminate .md-bar2{animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container{animation:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar1{animation-name:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar2{animation-name:none}md-progress-linear .md-container.md-mode-buffer{background-color:transparent !important;transition:all .2s linear}md-progress-linear .md-container.md-mode-buffer .md-dashed:before{display:block;animation:buffer 3s infinite linear}@keyframes query{0%{opacity:1;transform:translateX(35%) scale(0.3, 1)}100%{opacity:0;transform:translateX(-50%) scale(0, 1)}}@keyframes buffer{0%{opacity:1;background-position:0px -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes md-progress-linear-indeterminate-scale-1{0%{transform:scaleX(0.1);animation-timing-function:linear}36.6%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.334731432, 0.124819821, 0.785843996, 1)}69.15%{transform:scaleX(0.83);animation-timing-function:cubic-bezier(0.225732004, 0, 0.233648906, 1.3709798)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.1666666667%;animation-timing-function:linear}20%{left:-105.1666666667%;animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495818703)}69.15%{left:21.5%;animation-timing-function:cubic-bezier(0.302435, 0.38135197, 0.55, 0.956352125)}100%{left:95.4444444444%}}@keyframes md-progress-linear-indeterminate-scale-2{0%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.205028172, 0.057050836, 0.57660995, 0.453970841)}19.15%{transform:scaleX(0.57);animation-timing-function:cubic-bezier(0.152312994, 0.196431957, 0.648373778, 1.00431535)}44.15%{transform:scaleX(0.91);animation-timing-function:cubic-bezier(0.25775882, -0.003163357, 0.211761916, 1.38178961)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.8888888889%;animation-timing-function:cubic-bezier(0.15, 0, 0.5150584, 0.409684966)}25%{left:-17.25%;animation-timing-function:cubic-bezier(0.3103299, 0.284057684, 0.8, 0.733718979)}48.35%{left:29.5%;animation-timing-function:cubic-bezier(0.4, 0.627034903, 0.6, 0.902025796)}100%{left:117.3888888889%}}md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled]{cursor:default}md-radio-button[disabled] .md-container{cursor:default}md-radio-button .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer;left:0;right:auto}[dir=rtl] md-radio-button .md-container{left:auto}[dir=rtl] md-radio-button .md-container{right:0}md-radio-button .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div.md-container{top:12px}md-radio-button .md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button .md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:transform ease .28s;transform:scale(0)}md-radio-button.md-checked .md-on{transform:scale(0.5)}md-radio-button .md-label{box-sizing:border-box;position:relative;display:inline-block;margin-left:30px;margin-right:0;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}[dir=rtl] md-radio-button .md-label{margin-left:0}[dir=rtl] md-radio-button .md-label{margin-right:30px}md-radio-group:focus{outline:none}md-radio-group.md-focused.ng-not-empty .md-checked .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group.md-focused.ng-empty>md-radio-button:first-child .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group[disabled] md-radio-button{cursor:default}md-radio-group[disabled] md-radio-button .md-container{cursor:default}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-radio-button,.layout-xs-row>md-radio-button{margin-bottom:0}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-radio-button,.layout-gt-xs-row:not(.layout-sm-column)>md-radio-button,.layout-sm-row:not(.layout-sm-column)>md-radio-button{margin-bottom:0}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-sm-row:not(.layout-md-column)>md-radio-button,.layout-md-row:not(.layout-md-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-md-row:not(.layout-lg-column)>md-radio-button,.layout-lg-row:not(.layout-lg-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button{margin-bottom:0}}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px 10px 2px 6px;box-sizing:border-box;margin-top:0;margin-bottom:0}.md-inline-form md-radio-group md-radio-button .md-label{top:4px}.md-inline-form md-radio-group md-radio-button .md-container{margin-top:2px}@media screen and (-ms-high-contrast: active){md-radio-button.md-default-theme .md-on{background-color:#fff}}md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform-origin:left top}[dir=rtl] md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transform-origin:right top}md-input-container.md-input-focused:not([md-no-float]) md-select:not([placeholder]) .md-select-placeholder span:first-child{transform:translate(-2px, -22px) scale(0.75)}.md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none;transform:translateY(-1px)}.md-select-menu-container:not(.md-clickable){pointer-events:none}.md-select-menu-container md-progress-circular{display:table;margin:24px auto !important}.md-select-menu-container.md-active{display:block;opacity:1}.md-select-menu-container.md-active md-select-menu{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms}.md-select-menu-container.md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transition-delay:100ms}.md-select-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}.md-inline-form md-select{margin-top:20px}md-input-container>md-select,.md-inline-form md-input-container>md-select{margin-top:0px}md-input-container>md-select{order:2}md-input-container:not(.md-input-has-value) md-select[required]:not(.md-no-asterisk) .md-select-value span:first-child:after,md-input-container:not(.md-input-has-value) md-select.ng-required:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-input-container.md-input-invalid md-select .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select{display:flex}md-select[required].ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,md-select.ng-required.ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-select[disabled] .md-select-value{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;padding-bottom:2px;padding-top:1px;transform:translateY(1px)}md-select:focus{outline:none}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]):focus .md-select-value{border-bottom-style:solid;border-bottom-width:2px;padding-bottom:0px}md-input-container md-select:not([disabled]):focus .md-select-value{border-bottom-width:2px}md-input-container md-select[disabled] .md-select-value{background-position:bottom -1px left 0}md-input-container md-select .md-select-value{min-height:26px;border-bottom-width:1px;padding-bottom:1px}md-input-container md-select .md-select-value.md-select-placeholder{padding-left:0;padding-right:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-left:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-right:0}.md-select-value{display:flex;align-items:center;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-bottom-width:1px;border-bottom-style:solid;background-color:rgba(0,0,0,0);position:relative;box-sizing:content-box;min-width:88px;min-height:26px;margin-bottom:auto;-ms-flex-item-align:start;flex-grow:1}[dir=rtl] .md-select-value{padding-left:2px}[dir=rtl] .md-select-value{padding-right:0}.md-select-value>span:not(.md-select-icon){max-width:100%;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-select-value>span:not(.md-select-icon) .md-text{display:inline}.md-select-value .md-select-icon{display:block;align-items:flex-end;text-align:right;width:24px;transform:translateY(-2px);font-size:1.2rem}[dir=rtl] .md-select-value .md-select-icon{align-items:flex-start}[dir=rtl] .md-select-value .md-select-icon{text-align:left}.md-select-value .md-select-icon:after{display:block;content:"▼";position:relative;top:2px;right:-4px;left:auto;speak:none;font-size:13px;transform:scaleY(0.5)}[dir=rtl] .md-select-value .md-select-icon:after{right:auto}[dir=rtl] .md-select-value .md-select-icon:after{left:-4px}.md-select-value.md-select-placeholder{display:flex;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;z-index:1}md-select-menu{display:flex;flex-direction:column;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;transform-origin:left top;transform:scale(1)}md-select-menu.md-reverse{flex-direction:column-reverse}md-select-menu:not(.md-overflow) md-content{padding-top:8px;padding-bottom:8px}[dir=rtl] md-select-menu{transform-origin:right top}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:flex;align-items:center;width:auto;transition:background .15s linear;padding:0 16px 0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:none}md-option .md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast: active){.md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:40px;padding-right:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-right:40px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{right:0}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon{border-color:transparent}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled[disabled]{cursor:default}md-select-menu[multiple] md-option.md-checkbox-enabled.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:10.6666666667px;margin-right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-right:10.6666666667px}md-sidenav{box-sizing:border-box;position:absolute;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto;-webkit-overflow-scrolling:touch}md-sidenav ul{list-style:none}md-sidenav.md-closed{display:none}md-sidenav.md-closed-add,md-sidenav.md-closed-remove{display:flex;transition:.2s ease-in all}md-sidenav.md-closed-add.md-closed-add-active,md-sidenav.md-closed-remove.md-closed-remove-active{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-sidenav.md-locked-open-add,md-sidenav.md-locked-open-remove{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open,md-sidenav.md-locked-open.md-closed,md-sidenav.md-locked-open.md-closed.md-sidenav-left,md-sidenav.md-locked-open.md-closed.md-sidenav-right{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open-remove.md-closed{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-closed.md-locked-open-add{position:static;display:flex;transform:translate3d(0%, 0, 0)}md-sidenav.md-closed.md-locked-open-add:not(.md-locked-open-add-active){transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}md-sidenav.md-closed.md-locked-open-add-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-sidenav.md-locked-open-remove-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}.md-sidenav-backdrop.md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;transform:translate3d(0%, 0, 0)}.md-sidenav-left.md-closed,md-sidenav.md-closed{transform:translate3d(-100%, 0, 0)}.md-sidenav-right{left:100%;top:0;transform:translate(-100%, 0)}.md-sidenav-right.md-closed{transform:translate(0%, 0)}@media(min-width: 600px){md-sidenav{max-width:400px}}@media(max-width: 456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast: active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}@keyframes sliderFocusThumb{0%{transform:scale(0.7)}30%{transform:scale(1)}100%{transform:scale(0.7)}}@keyframes sliderDiscreteFocusThumb{0%{transform:scale(0.7)}50%{transform:scale(0.8)}100%{transform:scale(0)}}@keyframes sliderDiscreteFocusRing{0%{transform:scale(0.7);opacity:0}50%{transform:scale(1);opacity:1}100%{transform:scale(0)}}md-slider{height:48px;min-width:128px;position:relative;margin-left:4px;margin-right:4px;padding:0;display:block;flex-direction:row}md-slider *,md-slider *:after{box-sizing:border-box}md-slider .md-slider-wrapper{outline:none;width:100%;height:100%}md-slider .md-slider-content{position:relative}md-slider .md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider .md-track{position:absolute;left:0;right:0;height:100%}md-slider .md-track-fill{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:width,height}md-slider .md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider .md-track-ticks canvas{width:100%;height:100%}md-slider .md-thumb-container{position:absolute;left:0;top:50%;transform:translate3d(-50%, -50%, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:left,right,bottom}[dir=rtl] md-slider .md-thumb-container{left:auto;right:0}md-slider .md-thumb{z-index:1;position:absolute;left:-10px;top:14px;width:20px;height:20px;border-radius:20px;transform:scale(0.7);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}[dir=rtl] md-slider .md-thumb{left:auto;right:-10px}md-slider .md-thumb:after{content:"";position:absolute;width:20px;height:20px;border-radius:20px;border-width:3px;border-style:solid;transition:inherit}md-slider .md-sign{display:flex;align-items:center;justify-content:center;position:absolute;left:-14px;top:-17px;width:28px;height:28px;border-radius:28px;transform:scale(0.4) translate3d(0, 67.5px, 0);transition:all .3s cubic-bezier(0.35, 0, 0.25, 1)}md-slider .md-sign:after{position:absolute;content:"";left:0px;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-sign:after{left:auto;right:0px}md-slider .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider .md-focus-ring{position:absolute;left:-17px;top:7px;width:34px;height:34px;border-radius:34px;transform:scale(0.7);opacity:0;transition:all .35s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-focus-ring{left:auto;right:-17px}md-slider .md-disabled-thumb{position:absolute;left:-14px;top:10px;width:28px;height:28px;border-radius:28px;transform:scale(0.5);border-width:4px;border-style:solid;display:none}[dir=rtl] md-slider .md-disabled-thumb{left:auto;right:-14px}md-slider.md-min .md-sign{opacity:0}md-slider:focus{outline:none}md-slider.md-dragging .md-thumb-container,md-slider.md-dragging .md-track-fill{transition:none}md-slider:not([md-discrete]) .md-track-ticks,md-slider:not([md-discrete]) .md-sign{display:none}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper .md-thumb:hover{transform:scale(0.8)}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(1);opacity:1}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderFocusThumb .7s cubic-bezier(0.35, 0, 0.25, 1)}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb{transform:scale(1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(0);animation:sliderDiscreteFocusRing .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderDiscreteFocusThumb .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb,md-slider[md-discrete]:not([disabled]).md-active .md-thumb{transform:scale(0)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign,md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign:after,md-slider[md-discrete]:not([disabled]).md-active .md-sign,md-slider[md-discrete]:not([disabled]).md-active .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-discrete][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-discrete][disabled][readonly] .md-sign,md-slider[md-discrete][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[disabled] .md-track-fill{display:none}md-slider[disabled] .md-track-ticks{opacity:0}md-slider[disabled]:not([readonly]) .md-sign{opacity:0}md-slider[disabled] .md-thumb{transform:scale(0.5)}md-slider[disabled] .md-disabled-thumb{display:block}md-slider[md-vertical]{flex-direction:column;min-height:128px;min-width:0}md-slider[md-vertical] .md-slider-wrapper{flex:1;padding-top:12px;padding-bottom:12px;width:48px;align-self:center;display:flex;justify-content:center}md-slider[md-vertical] .md-track-container{height:100%;width:2px;top:0;left:calc(50% - (2px / 2))}md-slider[md-vertical] .md-thumb-container{top:auto;margin-bottom:23px;left:calc(50% - 1px);bottom:0}md-slider[md-vertical] .md-thumb-container .md-thumb:after{left:1px}md-slider[md-vertical] .md-thumb-container .md-focus-ring{left:-16px}md-slider[md-vertical] .md-track-fill{bottom:0}md-slider[md-vertical][md-discrete] .md-sign{left:-40px;top:9.5px;transform:scale(0.4) translate3d(67.5px, 0, 0)}md-slider[md-vertical][md-discrete] .md-sign:after{top:9.5px;left:19px;border-top:14px solid transparent;border-right:0;border-bottom:14px solid transparent;border-left-width:16px;border-left-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s ease-in-out}md-slider[md-vertical][md-discrete] .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider[md-vertical][md-discrete].md-active .md-sign:after,md-slider[md-vertical][md-discrete] .md-focused .md-sign:after,md-slider[md-vertical][md-discrete][disabled][readonly] .md-sign:after{top:0}md-slider[md-vertical][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-vertical][disabled][readonly] .md-sign,md-slider[md-vertical][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:auto;right:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{right:auto}md-slider[md-invert][md-vertical] .md-track-fill{bottom:auto;top:0}md-slider-container{display:flex;align-items:center;flex-direction:row}md-slider-container>*:first-child:not(md-slider),md-slider-container>*:last-child:not(md-slider){min-width:25px;max-width:42px;height:25px;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:color,max-width}md-slider-container>*:first-child:not(md-slider){margin-right:16px}[dir=rtl] md-slider-container>*:first-child:not(md-slider){margin-right:auto;margin-left:16px}md-slider-container>*:last-child:not(md-slider){margin-left:16px}[dir=rtl] md-slider-container>*:last-child:not(md-slider){margin-left:auto;margin-right:16px}md-slider-container[md-vertical]{flex-direction:column}md-slider-container[md-vertical]>*:first-child:not(md-slider),md-slider-container[md-vertical]>*:last-child:not(md-slider){margin-right:0;margin-left:0;text-align:center}md-slider-container md-input-container input[type=number]{text-align:center;padding-left:15px;height:50px;margin-top:-25px}[dir=rtl] md-slider-container md-input-container input[type=number]{padding-left:0;padding-right:15px}@media screen and (-ms-high-contrast: active){md-slider.md-default-theme .md-track{border-bottom:1px solid #fff}}.md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute !important;transform:translate3d(-9999px, -9999px, 0)}.md-sticky-clone[sticky-state=active]{transform:translate3d(0, 0, 0)}.md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) .md-subheader-inner{animation:subheaderStickyHoverIn .3s ease-out both}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] .md-subheader-inner:after{animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0 0 0 0;position:relative}.md-subheader .md-subheader-inner{display:block;padding:16px}.md-subheader .md-subheader-content{display:block;z-index:1;position:relative}[md-swipe-left],[md-swipe-right]{touch-action:pan-y}[md-swipe-up],[md-swipe-down]{touch-action:pan-x}.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:none;user-select:none;height:30px;line-height:28px;align-items:center;display:flex;margin-left:inherit;margin-right:16px}[dir=rtl] md-switch{margin-left:16px}[dir=rtl] md-switch{margin-right:inherit}md-switch:last-of-type{margin-left:inherit;margin-right:0}[dir=rtl] md-switch:last-of-type{margin-left:0}[dir=rtl] md-switch:last-of-type{margin-right:inherit}md-switch[disabled]{cursor:default}md-switch[disabled] .md-container{cursor:default}md-switch .md-container{cursor:grab;width:36px;height:24px;position:relative;user-select:none;margin-right:8px;float:left}[dir=rtl] md-switch .md-container{margin-right:0px;margin-left:8px}md-switch.md-inverted .md-container{margin-right:initial;margin-left:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-right:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-left:initial}md-switch:not([disabled]) .md-dragging,md-switch:not([disabled]).md-dragging .md-container{cursor:grabbing}md-switch.md-focused .md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch .md-label{border-color:transparent;border-width:0;float:left}md-switch .md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch .md-thumb-container{top:2px;left:0;width:16px;position:absolute;transform:translate3d(0, 0, 0);z-index:1}md-switch.md-checked .md-thumb-container{transform:translate3d(100%, 0, 0)}md-switch .md-thumb{position:absolute;margin:0;left:0;top:0;outline:none;height:20px;width:20px;border-radius:50%;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-switch .md-thumb:before{background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch .md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb-container,md-switch:not(.md-dragging) .md-thumb{transition:all .08s linear;transition-property:transform,background-color}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb{transition-delay:.05s}@media screen and (-ms-high-contrast: active){md-switch.md-default-theme .md-bar{background-color:#666}md-switch.md-default-theme.md-checked .md-bar{background-color:#9e9e9e}md-switch.md-default-theme .md-thumb{background-color:#fff}}@keyframes md-tab-content-hide{0%{opacity:1}50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom]>md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom]>md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;transform:translate(0, 0)}md-tabs-wrapper md-prev-button,md-tabs-wrapper md-next-button{height:100%;width:32px;position:absolute;top:50%;transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:transparent no-repeat center center;transition:all .5s cubic-bezier(0.35, 0, 0.25, 1)}md-tabs-wrapper md-prev-button:focus,md-tabs-wrapper md-next-button:focus{outline:none}md-tabs-wrapper md-prev-button.md-disabled,md-tabs-wrapper md-next-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-prev-button.ng-leave,md-tabs-wrapper md-next-button.ng-leave{transition:none}md-tabs-wrapper md-prev-button md-icon,md-tabs-wrapper md-next-button md-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}[dir=rtl] md-tabs-wrapper md-prev-button,[dir=rtl] md-tabs-wrapper md-next-button{transform:rotateY(180deg) translateY(-50%)}md-tabs-wrapper md-prev-button{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}[dir=rtl] md-tabs-wrapper md-prev-button{left:auto;right:0}md-tabs-wrapper md-next-button{right:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}[dir=rtl] md-tabs-wrapper md-next-button{right:auto;left:0}md-tabs-wrapper md-next-button md-icon{transform:translate(-50%, -50%) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:"";display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0;left:0}[dir=rtl] md-tabs-canvas .md-dummy-wrapper{left:auto;right:0}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:flex;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:flex;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);position:absolute;left:0;transform:translate(0, 0)}md-pagination-wrapper:after{content:"";display:table;clear:both}[dir=rtl] md-pagination-wrapper{left:auto;right:0}md-pagination-wrapper.md-center-tabs{position:relative;justify-content:center}md-pagination-wrapper md-tab-item{min-width:72px}@media(min-width: 600px){md-pagination-wrapper md-tab-item{min-width:160px}}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:flex;position:absolute;top:0;left:0;right:0;bottom:0;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);overflow:auto;transform:translate(0, 0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.ng-leave,md-tab-content.md-no-transition{transition:none}md-tab-content.md-left:not(.md-active){transform:translateX(-100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-left:not(.md-active){transform:translateX(100%)}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){transform:translateX(100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-right:not(.md-active){transform:translateX(-100%)}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div{flex:1 0 100%;min-width:0}md-tab-content>div.ng-leave{animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left .125s cubic-bezier(0.35, 0, 0.25, 1),right .25s cubic-bezier(0.35, 0, 0.25, 1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(0.35, 0, 0.25, 1),right .125s cubic-bezier(0.35, 0, 0.25, 1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;float:left;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-tab{float:right}.md-tab.md-focused,.md-tab:focus{box-shadow:none;outline:none}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;touch-action:pan-y;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs,md-toolbar+md-dialog-content md-tabs{border-top-left-radius:0;border-top-right-radius:0}.md-toast-text{padding:0 8px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast .md-toast-content{display:flex;flex-direction:row;align-items:center;max-height:168px;max-width:100%;min-height:48px;padding:0 16px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;transform:translate3d(0, 0, 0) rotateZ(0deg);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);justify-content:flex-start}md-toast .md-toast-content::before{content:"";min-height:48px;visibility:hidden;display:inline-block}[dir=rtl] md-toast .md-toast-content{justify-content:flex-end}md-toast .md-toast-content span{flex:1 1 0%;box-sizing:border-box;min-width:0}md-toast.md-capsule{border-radius:24px}md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-toast.md-swipeleft .md-toast-content,md-toast.md-swiperight .md-toast-content,md-toast.md-swipeup .md-toast-content,md-toast.md-swipedown .md-toast-content{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{transform:translate3d(0, 100%, 0)}md-toast.ng-enter.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{transform:translate3d(0, 0, 0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;transform:translate3d(0, 100%, 0)}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}md-toast.ng-leave.ng-leave-active.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0;margin-right:0;margin-left:8px}[dir=rtl] md-toast .md-button{margin-right:8px}[dir=rtl] md-toast .md-button{margin-left:0}@media(max-width: 959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}}@media(min-width: 960px){md-toast{min-width:304px}md-toast.md-bottom{bottom:0}md-toast.md-left{left:0}md-toast.md-right{right:0}md-toast.md-top{top:0}md-toast._md-start{left:0}[dir=rtl] md-toast._md-start{left:auto;right:0}md-toast._md-end{right:0}[dir=rtl] md-toast._md-end{right:auto;left:0}md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content{transform:translate3d(-50%, 0, 0)}md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content{transform:translate3d(50%, 0, 0)}}@media(min-width: 1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast: active){md-toast{border:1px solid #fff}}.md-toast-animating{overflow:hidden !important}md-toolbar{box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%}md-toolbar._md-toolbar-transitions{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar *:before,md-toolbar *:after{box-sizing:border-box}md-toolbar.ng-animate{transition:none}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}md-toolbar>.md-indent{margin-left:64px}[dir=rtl] md-toolbar>.md-indent{margin-left:auto;margin-right:64px}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:flex;align-items:center;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:flex;align-items:center}.md-toolbar-tools md-checkbox{margin:inherit}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}.md-toolbar-tools .md-button.ng-animate,.md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate{transition:none}.md-toolbar-tools>.md-button:first-child{margin-left:-8px}[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-8px}.md-toolbar-tools>.md-button:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0}[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:auto;margin-left:0}@media screen and (-ms-high-contrast: active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media(min-width: 0)and (max-width: 959px)and (orientation: portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media(min-width: 0)and (max-width: 959px)and (orientation: landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}.md-tooltip{display:inline-block;pointer-events:none;border-radius:4px;overflow:hidden;opacity:0;font-weight:500;font-size:14px;white-space:nowrap;text-overflow:ellipsis;height:32px;line-height:32px;padding-right:16px;padding-left:16px}.md-tooltip.md-origin-top{transform-origin:center bottom;margin-top:-24px}.md-tooltip.md-origin-right{transform-origin:left center;margin-left:24px}.md-tooltip.md-origin-bottom{transform-origin:center top;margin-top:24px}.md-tooltip.md-origin-left{transform-origin:right center;margin-left:-24px}@media(min-width: 960px){.md-tooltip{font-size:10px;height:22px;line-height:22px;padding-right:8px;padding-left:8px}.md-tooltip.md-origin-top{margin-top:-14px}.md-tooltip.md-origin-right{margin-left:14px}.md-tooltip.md-origin-bottom{margin-top:14px}.md-tooltip.md-origin-left{margin-left:-14px}}.md-tooltip.md-show-add{transform:scale(0)}.md-tooltip.md-show{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms;transform:scale(1);opacity:.9}.md-tooltip.md-hide{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transform:scale(0);opacity:0}.md-truncate{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.md-truncate.md-clip{text-overflow:clip}.md-truncate.flex{width:0}.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0;-webkit-overflow-scrolling:touch}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;right:auto;white-space:nowrap}[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;left:auto}.md-whiteframe-1dp,.md-whiteframe-z1{box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}.md-whiteframe-2dp{box-shadow:0px 1px 5px 0px rgba(0,0,0,.2),0px 2px 2px 0px rgba(0,0,0,.14),0px 3px 1px -2px rgba(0,0,0,.12)}.md-whiteframe-3dp{box-shadow:0px 1px 8px 0px rgba(0,0,0,.2),0px 3px 4px 0px rgba(0,0,0,.14),0px 3px 3px -2px rgba(0,0,0,.12)}.md-whiteframe-4dp,.md-whiteframe-z2{box-shadow:0px 2px 4px -1px rgba(0,0,0,.2),0px 4px 5px 0px rgba(0,0,0,.14),0px 1px 10px 0px rgba(0,0,0,.12)}.md-whiteframe-5dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 5px 8px 0px rgba(0,0,0,.14),0px 1px 14px 0px rgba(0,0,0,.12)}.md-whiteframe-6dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 6px 10px 0px rgba(0,0,0,.14),0px 1px 18px 0px rgba(0,0,0,.12)}.md-whiteframe-7dp,.md-whiteframe-z3{box-shadow:0px 4px 5px -2px rgba(0,0,0,.2),0px 7px 10px 1px rgba(0,0,0,.14),0px 2px 16px 1px rgba(0,0,0,.12)}.md-whiteframe-8dp{box-shadow:0px 5px 5px -3px rgba(0,0,0,.2),0px 8px 10px 1px rgba(0,0,0,.14),0px 3px 14px 2px rgba(0,0,0,.12)}.md-whiteframe-9dp{box-shadow:0px 5px 6px -3px rgba(0,0,0,.2),0px 9px 12px 1px rgba(0,0,0,.14),0px 3px 16px 2px rgba(0,0,0,.12)}.md-whiteframe-10dp,.md-whiteframe-z4{box-shadow:0px 6px 6px -3px rgba(0,0,0,.2),0px 10px 14px 1px rgba(0,0,0,.14),0px 4px 18px 3px rgba(0,0,0,.12)}.md-whiteframe-11dp{box-shadow:0px 6px 7px -4px rgba(0,0,0,.2),0px 11px 15px 1px rgba(0,0,0,.14),0px 4px 20px 3px rgba(0,0,0,.12)}.md-whiteframe-12dp{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 12px 17px 2px rgba(0,0,0,.14),0px 5px 22px 4px rgba(0,0,0,.12)}.md-whiteframe-13dp,.md-whiteframe-z5{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12)}.md-whiteframe-14dp{box-shadow:0px 7px 9px -4px rgba(0,0,0,.2),0px 14px 21px 2px rgba(0,0,0,.14),0px 5px 26px 4px rgba(0,0,0,.12)}.md-whiteframe-15dp{box-shadow:0px 8px 9px -5px rgba(0,0,0,.2),0px 15px 22px 2px rgba(0,0,0,.14),0px 6px 28px 5px rgba(0,0,0,.12)}.md-whiteframe-16dp{box-shadow:0px 8px 10px -5px rgba(0,0,0,.2),0px 16px 24px 2px rgba(0,0,0,.14),0px 6px 30px 5px rgba(0,0,0,.12)}.md-whiteframe-17dp{box-shadow:0px 8px 11px -5px rgba(0,0,0,.2),0px 17px 26px 2px rgba(0,0,0,.14),0px 6px 32px 5px rgba(0,0,0,.12)}.md-whiteframe-18dp{box-shadow:0px 9px 11px -5px rgba(0,0,0,.2),0px 18px 28px 2px rgba(0,0,0,.14),0px 7px 34px 6px rgba(0,0,0,.12)}.md-whiteframe-19dp{box-shadow:0px 9px 12px -6px rgba(0,0,0,.2),0px 19px 29px 2px rgba(0,0,0,.14),0px 7px 36px 6px rgba(0,0,0,.12)}.md-whiteframe-20dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 20px 31px 3px rgba(0,0,0,.14),0px 8px 38px 7px rgba(0,0,0,.12)}.md-whiteframe-21dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 21px 33px 3px rgba(0,0,0,.14),0px 8px 40px 7px rgba(0,0,0,.12)}.md-whiteframe-22dp{box-shadow:0px 10px 14px -6px rgba(0,0,0,.2),0px 22px 35px 3px rgba(0,0,0,.14),0px 8px 42px 7px rgba(0,0,0,.12)}.md-whiteframe-23dp{box-shadow:0px 11px 14px -7px rgba(0,0,0,.2),0px 23px 36px 3px rgba(0,0,0,.14),0px 9px 44px 8px rgba(0,0,0,.12)}.md-whiteframe-24dp{box-shadow:0px 11px 15px -7px rgba(0,0,0,.2),0px 24px 38px 3px rgba(0,0,0,.14),0px 9px 46px 8px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast: active){md-whiteframe{border:1px solid #fff}}@media print{md-whiteframe,[md-whiteframe]{background-color:#fff}}[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none !important}@-moz-document url-prefix(){.layout-fill{margin:0;width:100%;min-height:100%;height:100%}}.flex-order{order:0}.flex-order--20{order:-20}.flex-order--19{order:-19}.flex-order--18{order:-18}.flex-order--17{order:-17}.flex-order--16{order:-16}.flex-order--15{order:-15}.flex-order--14{order:-14}.flex-order--13{order:-13}.flex-order--12{order:-12}.flex-order--11{order:-11}.flex-order--10{order:-10}.flex-order--9{order:-9}.flex-order--8{order:-8}.flex-order--7{order:-7}.flex-order--6{order:-6}.flex-order--5{order:-5}.flex-order--4{order:-4}.flex-order--3{order:-3}.flex-order--2{order:-2}.flex-order--1{order:-1}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-order-11{order:11}.flex-order-12{order:12}.flex-order-13{order:13}.flex-order-14{order:14}.flex-order-15{order:15}.flex-order-16{order:16}.flex-order-17{order:17}.flex-order-18{order:18}.flex-order-19{order:19}.flex-order-20{order:20}.offset-0,.flex-offset-0,.layout-margin .flex-offset-0,.layout-margin .offset-0{margin-left:0}[dir=rtl] .offset-0,[dir=rtl] .flex-offset-0,[dir=rtl] .layout-margin .flex-offset-0,[dir=rtl] .layout-margin .offset-0{margin-left:auto;margin-right:0}.offset-5,.flex-offset-5,.layout-margin .flex-offset-5,.layout-margin .offset-5{margin-left:5%}[dir=rtl] .offset-5,[dir=rtl] .flex-offset-5,[dir=rtl] .layout-margin .flex-offset-5,[dir=rtl] .layout-margin .offset-5{margin-left:auto;margin-right:5%}.offset-10,.flex-offset-10,.layout-margin .flex-offset-10,.layout-margin .offset-10{margin-left:10%}[dir=rtl] .offset-10,[dir=rtl] .flex-offset-10,[dir=rtl] .layout-margin .flex-offset-10,[dir=rtl] .layout-margin .offset-10{margin-left:auto;margin-right:10%}.offset-15,.flex-offset-15,.layout-margin .flex-offset-15,.layout-margin .offset-15{margin-left:15%}[dir=rtl] .offset-15,[dir=rtl] .flex-offset-15,[dir=rtl] .layout-margin .flex-offset-15,[dir=rtl] .layout-margin .offset-15{margin-left:auto;margin-right:15%}.offset-20,.flex-offset-20,.layout-margin .flex-offset-20,.layout-margin .offset-20{margin-left:20%}[dir=rtl] .offset-20,[dir=rtl] .flex-offset-20,[dir=rtl] .layout-margin .flex-offset-20,[dir=rtl] .layout-margin .offset-20{margin-left:auto;margin-right:20%}.offset-25,.flex-offset-25,.layout-margin .flex-offset-25,.layout-margin .offset-25{margin-left:25%}[dir=rtl] .offset-25,[dir=rtl] .flex-offset-25,[dir=rtl] .layout-margin .flex-offset-25,[dir=rtl] .layout-margin .offset-25{margin-left:auto;margin-right:25%}.offset-30,.flex-offset-30,.layout-margin .flex-offset-30,.layout-margin .offset-30{margin-left:30%}[dir=rtl] .offset-30,[dir=rtl] .flex-offset-30,[dir=rtl] .layout-margin .flex-offset-30,[dir=rtl] .layout-margin .offset-30{margin-left:auto;margin-right:30%}.offset-35,.flex-offset-35,.layout-margin .flex-offset-35,.layout-margin .offset-35{margin-left:35%}[dir=rtl] .offset-35,[dir=rtl] .flex-offset-35,[dir=rtl] .layout-margin .flex-offset-35,[dir=rtl] .layout-margin .offset-35{margin-left:auto;margin-right:35%}.offset-40,.flex-offset-40,.layout-margin .flex-offset-40,.layout-margin .offset-40{margin-left:40%}[dir=rtl] .offset-40,[dir=rtl] .flex-offset-40,[dir=rtl] .layout-margin .flex-offset-40,[dir=rtl] .layout-margin .offset-40{margin-left:auto;margin-right:40%}.offset-45,.flex-offset-45,.layout-margin .flex-offset-45,.layout-margin .offset-45{margin-left:45%}[dir=rtl] .offset-45,[dir=rtl] .flex-offset-45,[dir=rtl] .layout-margin .flex-offset-45,[dir=rtl] .layout-margin .offset-45{margin-left:auto;margin-right:45%}.offset-50,.flex-offset-50,.layout-margin .flex-offset-50,.layout-margin .offset-50{margin-left:50%}[dir=rtl] .offset-50,[dir=rtl] .flex-offset-50,[dir=rtl] .layout-margin .flex-offset-50,[dir=rtl] .layout-margin .offset-50{margin-left:auto;margin-right:50%}.offset-55,.flex-offset-55,.layout-margin .flex-offset-55,.layout-margin .offset-55{margin-left:55%}[dir=rtl] .offset-55,[dir=rtl] .flex-offset-55,[dir=rtl] .layout-margin .flex-offset-55,[dir=rtl] .layout-margin .offset-55{margin-left:auto;margin-right:55%}.offset-60,.flex-offset-60,.layout-margin .flex-offset-60,.layout-margin .offset-60{margin-left:60%}[dir=rtl] .offset-60,[dir=rtl] .flex-offset-60,[dir=rtl] .layout-margin .flex-offset-60,[dir=rtl] .layout-margin .offset-60{margin-left:auto;margin-right:60%}.offset-65,.flex-offset-65,.layout-margin .flex-offset-65,.layout-margin .offset-65{margin-left:65%}[dir=rtl] .offset-65,[dir=rtl] .flex-offset-65,[dir=rtl] .layout-margin .flex-offset-65,[dir=rtl] .layout-margin .offset-65{margin-left:auto;margin-right:65%}.offset-70,.flex-offset-70,.layout-margin .flex-offset-70,.layout-margin .offset-70{margin-left:70%}[dir=rtl] .offset-70,[dir=rtl] .flex-offset-70,[dir=rtl] .layout-margin .flex-offset-70,[dir=rtl] .layout-margin .offset-70{margin-left:auto;margin-right:70%}.offset-75,.flex-offset-75,.layout-margin .flex-offset-75,.layout-margin .offset-75{margin-left:75%}[dir=rtl] .offset-75,[dir=rtl] .flex-offset-75,[dir=rtl] .layout-margin .flex-offset-75,[dir=rtl] .layout-margin .offset-75{margin-left:auto;margin-right:75%}.offset-80,.flex-offset-80,.layout-margin .flex-offset-80,.layout-margin .offset-80{margin-left:80%}[dir=rtl] .offset-80,[dir=rtl] .flex-offset-80,[dir=rtl] .layout-margin .flex-offset-80,[dir=rtl] .layout-margin .offset-80{margin-left:auto;margin-right:80%}.offset-85,.flex-offset-85,.layout-margin .flex-offset-85,.layout-margin .offset-85{margin-left:85%}[dir=rtl] .offset-85,[dir=rtl] .flex-offset-85,[dir=rtl] .layout-margin .flex-offset-85,[dir=rtl] .layout-margin .offset-85{margin-left:auto;margin-right:85%}.offset-90,.flex-offset-90,.layout-margin .flex-offset-90,.layout-margin .offset-90{margin-left:90%}[dir=rtl] .offset-90,[dir=rtl] .flex-offset-90,[dir=rtl] .layout-margin .flex-offset-90,[dir=rtl] .layout-margin .offset-90{margin-left:auto;margin-right:90%}.offset-95,.flex-offset-95,.layout-margin .flex-offset-95,.layout-margin .offset-95{margin-left:95%}[dir=rtl] .offset-95,[dir=rtl] .flex-offset-95,[dir=rtl] .layout-margin .flex-offset-95,[dir=rtl] .layout-margin .offset-95{margin-left:auto;margin-right:95%}.offset-33,.flex-offset-33,.layout-margin .flex-offset-33,.layout-margin .offset-33{margin-left:33.3333333333%}.offset-66,.flex-offset-66,.layout-margin .flex-offset-66,.layout-margin .offset-66{margin-left:66.6666666667%}[dir=rtl] .offset-66,[dir=rtl] .flex-offset-66,[dir=rtl] .layout-margin .flex-offset-66,[dir=rtl] .layout-margin .offset-66{margin-left:auto;margin-right:66.6666666667%}.layout-align,.layout-align-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-start,.layout-align-start-start,.layout-align-start-center,.layout-align-start-end,.layout-align-start-stretch{justify-content:flex-start}.layout-align-center,.layout-align-center-start,.layout-align-center-center,.layout-align-center-end,.layout-align-center-stretch{justify-content:center}.layout-align-end,.layout-align-end-start,.layout-align-end-center,.layout-align-end-end,.layout-align-end-stretch{justify-content:flex-end}.layout-align-space-around,.layout-align-space-around-center,.layout-align-space-around-start,.layout-align-space-around-end,.layout-align-space-around-stretch{justify-content:space-around}.layout-align-space-between,.layout-align-space-between-center,.layout-align-space-between-start,.layout-align-space-between-end,.layout-align-space-between-stretch{justify-content:space-between}.layout-align-start-start,.layout-align-center-start,.layout-align-end-start,.layout-align-space-between-start,.layout-align-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-start-center,.layout-align-center-center,.layout-align-end-center,.layout-align-space-between-center,.layout-align-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-start-center>*,.layout-align-center-center>*,.layout-align-end-center>*,.layout-align-space-between-center>*,.layout-align-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-start-end,.layout-align-center-end,.layout-align-end-end,.layout-align-space-between-end,.layout-align-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-start-stretch,.layout-align-center-stretch,.layout-align-end-stretch,.layout-align-space-between-stretch,.layout-align-space-around-stretch{align-items:stretch;align-content:stretch}.flex{flex:1;box-sizing:border-box}.flex-grow{flex:1 1 100%;box-sizing:border-box}.flex-initial{flex:0 1 auto;box-sizing:border-box}.flex-auto{flex:1 1 auto;box-sizing:border-box}.flex-none{flex:0 0 auto;box-sizing:border-box}.flex-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex{min-width:0}.layout-column>.flex-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-column>.flex{min-height:0}.layout,.layout-column,.layout-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-column{flex-direction:column}.layout-row{flex-direction:row}.layout-padding-sm>*,.layout-padding>.flex-sm{padding:4px}.layout-padding,.layout-padding-gt-sm,.layout-padding-md,.layout-padding>*,.layout-padding-gt-sm>*,.layout-padding-md>*,.layout-padding>.flex,.layout-padding>.flex-gt-sm,.layout-padding>.flex-md{padding:8px}.layout-padding-gt-md>*,.layout-padding-lg>*,.layout-padding-gt-lg>*,.layout-padding>.flex-gt-md,.layout-padding>.flex-lg,.layout-padding>.flex-lg,.layout-padding>.flex-gt-lg{padding:16px}.layout-margin-sm>*,.layout-margin>.flex-sm{margin:4px}.layout-margin,.layout-margin-gt-sm,.layout-margin-md,.layout-margin>*,.layout-margin-gt-sm>*,.layout-margin-md>*,.layout-margin>.flex,.layout-margin>.flex-gt-sm,.layout-margin>.flex-md{margin:8px}.layout-margin-gt-md>*,.layout-margin-lg>*,.layout-margin-gt-lg>*,.layout-margin>.flex-gt-md,.layout-margin>.flex-lg,.layout-margin>.flex-gt-lg{margin:16px}.layout-wrap{flex-wrap:wrap}.layout-nowrap{flex-wrap:nowrap}.layout-fill{margin:0;width:100%;min-height:100%;height:100%}@media(max-width: 599px){.hide-xs:not(.show-xs):not(.show),.hide:not(.show-xs):not(.show){display:none}.flex-order-xs--20{order:-20}.flex-order-xs--19{order:-19}.flex-order-xs--18{order:-18}.flex-order-xs--17{order:-17}.flex-order-xs--16{order:-16}.flex-order-xs--15{order:-15}.flex-order-xs--14{order:-14}.flex-order-xs--13{order:-13}.flex-order-xs--12{order:-12}.flex-order-xs--11{order:-11}.flex-order-xs--10{order:-10}.flex-order-xs--9{order:-9}.flex-order-xs--8{order:-8}.flex-order-xs--7{order:-7}.flex-order-xs--6{order:-6}.flex-order-xs--5{order:-5}.flex-order-xs--4{order:-4}.flex-order-xs--3{order:-3}.flex-order-xs--2{order:-2}.flex-order-xs--1{order:-1}.flex-order-xs-0{order:0}.flex-order-xs-1{order:1}.flex-order-xs-2{order:2}.flex-order-xs-3{order:3}.flex-order-xs-4{order:4}.flex-order-xs-5{order:5}.flex-order-xs-6{order:6}.flex-order-xs-7{order:7}.flex-order-xs-8{order:8}.flex-order-xs-9{order:9}.flex-order-xs-10{order:10}.flex-order-xs-11{order:11}.flex-order-xs-12{order:12}.flex-order-xs-13{order:13}.flex-order-xs-14{order:14}.flex-order-xs-15{order:15}.flex-order-xs-16{order:16}.flex-order-xs-17{order:17}.flex-order-xs-18{order:18}.flex-order-xs-19{order:19}.flex-order-xs-20{order:20}.offset-xs-0,.flex-offset-xs-0,.layout-margin .flex-offset-xs-0,.layout-margin .offset-xs-0{margin-left:0}[dir=rtl] .offset-xs-0,[dir=rtl] .flex-offset-xs-0,[dir=rtl] .layout-margin .flex-offset-xs-0,[dir=rtl] .layout-margin .offset-xs-0{margin-left:auto;margin-right:0}.offset-xs-5,.flex-offset-xs-5,.layout-margin .flex-offset-xs-5,.layout-margin .offset-xs-5{margin-left:5%}[dir=rtl] .offset-xs-5,[dir=rtl] .flex-offset-xs-5,[dir=rtl] .layout-margin .flex-offset-xs-5,[dir=rtl] .layout-margin .offset-xs-5{margin-left:auto;margin-right:5%}.offset-xs-10,.flex-offset-xs-10,.layout-margin .flex-offset-xs-10,.layout-margin .offset-xs-10{margin-left:10%}[dir=rtl] .offset-xs-10,[dir=rtl] .flex-offset-xs-10,[dir=rtl] .layout-margin .flex-offset-xs-10,[dir=rtl] .layout-margin .offset-xs-10{margin-left:auto;margin-right:10%}.offset-xs-15,.flex-offset-xs-15,.layout-margin .flex-offset-xs-15,.layout-margin .offset-xs-15{margin-left:15%}[dir=rtl] .offset-xs-15,[dir=rtl] .flex-offset-xs-15,[dir=rtl] .layout-margin .flex-offset-xs-15,[dir=rtl] .layout-margin .offset-xs-15{margin-left:auto;margin-right:15%}.offset-xs-20,.flex-offset-xs-20,.layout-margin .flex-offset-xs-20,.layout-margin .offset-xs-20{margin-left:20%}[dir=rtl] .offset-xs-20,[dir=rtl] .flex-offset-xs-20,[dir=rtl] .layout-margin .flex-offset-xs-20,[dir=rtl] .layout-margin .offset-xs-20{margin-left:auto;margin-right:20%}.offset-xs-25,.flex-offset-xs-25,.layout-margin .flex-offset-xs-25,.layout-margin .offset-xs-25{margin-left:25%}[dir=rtl] .offset-xs-25,[dir=rtl] .flex-offset-xs-25,[dir=rtl] .layout-margin .flex-offset-xs-25,[dir=rtl] .layout-margin .offset-xs-25{margin-left:auto;margin-right:25%}.offset-xs-30,.flex-offset-xs-30,.layout-margin .flex-offset-xs-30,.layout-margin .offset-xs-30{margin-left:30%}[dir=rtl] .offset-xs-30,[dir=rtl] .flex-offset-xs-30,[dir=rtl] .layout-margin .flex-offset-xs-30,[dir=rtl] .layout-margin .offset-xs-30{margin-left:auto;margin-right:30%}.offset-xs-35,.flex-offset-xs-35,.layout-margin .flex-offset-xs-35,.layout-margin .offset-xs-35{margin-left:35%}[dir=rtl] .offset-xs-35,[dir=rtl] .flex-offset-xs-35,[dir=rtl] .layout-margin .flex-offset-xs-35,[dir=rtl] .layout-margin .offset-xs-35{margin-left:auto;margin-right:35%}.offset-xs-40,.flex-offset-xs-40,.layout-margin .flex-offset-xs-40,.layout-margin .offset-xs-40{margin-left:40%}[dir=rtl] .offset-xs-40,[dir=rtl] .flex-offset-xs-40,[dir=rtl] .layout-margin .flex-offset-xs-40,[dir=rtl] .layout-margin .offset-xs-40{margin-left:auto;margin-right:40%}.offset-xs-45,.flex-offset-xs-45,.layout-margin .flex-offset-xs-45,.layout-margin .offset-xs-45{margin-left:45%}[dir=rtl] .offset-xs-45,[dir=rtl] .flex-offset-xs-45,[dir=rtl] .layout-margin .flex-offset-xs-45,[dir=rtl] .layout-margin .offset-xs-45{margin-left:auto;margin-right:45%}.offset-xs-50,.flex-offset-xs-50,.layout-margin .flex-offset-xs-50,.layout-margin .offset-xs-50{margin-left:50%}[dir=rtl] .offset-xs-50,[dir=rtl] .flex-offset-xs-50,[dir=rtl] .layout-margin .flex-offset-xs-50,[dir=rtl] .layout-margin .offset-xs-50{margin-left:auto;margin-right:50%}.offset-xs-55,.flex-offset-xs-55,.layout-margin .flex-offset-xs-55,.layout-margin .offset-xs-55{margin-left:55%}[dir=rtl] .offset-xs-55,[dir=rtl] .flex-offset-xs-55,[dir=rtl] .layout-margin .flex-offset-xs-55,[dir=rtl] .layout-margin .offset-xs-55{margin-left:auto;margin-right:55%}.offset-xs-60,.flex-offset-xs-60,.layout-margin .flex-offset-xs-60,.layout-margin .offset-xs-60{margin-left:60%}[dir=rtl] .offset-xs-60,[dir=rtl] .flex-offset-xs-60,[dir=rtl] .layout-margin .flex-offset-xs-60,[dir=rtl] .layout-margin .offset-xs-60{margin-left:auto;margin-right:60%}.offset-xs-65,.flex-offset-xs-65,.layout-margin .flex-offset-xs-65,.layout-margin .offset-xs-65{margin-left:65%}[dir=rtl] .offset-xs-65,[dir=rtl] .flex-offset-xs-65,[dir=rtl] .layout-margin .flex-offset-xs-65,[dir=rtl] .layout-margin .offset-xs-65{margin-left:auto;margin-right:65%}.offset-xs-70,.flex-offset-xs-70,.layout-margin .flex-offset-xs-70,.layout-margin .offset-xs-70{margin-left:70%}[dir=rtl] .offset-xs-70,[dir=rtl] .flex-offset-xs-70,[dir=rtl] .layout-margin .flex-offset-xs-70,[dir=rtl] .layout-margin .offset-xs-70{margin-left:auto;margin-right:70%}.offset-xs-75,.flex-offset-xs-75,.layout-margin .flex-offset-xs-75,.layout-margin .offset-xs-75{margin-left:75%}[dir=rtl] .offset-xs-75,[dir=rtl] .flex-offset-xs-75,[dir=rtl] .layout-margin .flex-offset-xs-75,[dir=rtl] .layout-margin .offset-xs-75{margin-left:auto;margin-right:75%}.offset-xs-80,.flex-offset-xs-80,.layout-margin .flex-offset-xs-80,.layout-margin .offset-xs-80{margin-left:80%}[dir=rtl] .offset-xs-80,[dir=rtl] .flex-offset-xs-80,[dir=rtl] .layout-margin .flex-offset-xs-80,[dir=rtl] .layout-margin .offset-xs-80{margin-left:auto;margin-right:80%}.offset-xs-85,.flex-offset-xs-85,.layout-margin .flex-offset-xs-85,.layout-margin .offset-xs-85{margin-left:85%}[dir=rtl] .offset-xs-85,[dir=rtl] .flex-offset-xs-85,[dir=rtl] .layout-margin .flex-offset-xs-85,[dir=rtl] .layout-margin .offset-xs-85{margin-left:auto;margin-right:85%}.offset-xs-90,.flex-offset-xs-90,.layout-margin .flex-offset-xs-90,.layout-margin .offset-xs-90{margin-left:90%}[dir=rtl] .offset-xs-90,[dir=rtl] .flex-offset-xs-90,[dir=rtl] .layout-margin .flex-offset-xs-90,[dir=rtl] .layout-margin .offset-xs-90{margin-left:auto;margin-right:90%}.offset-xs-95,.flex-offset-xs-95,.layout-margin .flex-offset-xs-95,.layout-margin .offset-xs-95{margin-left:95%}[dir=rtl] .offset-xs-95,[dir=rtl] .flex-offset-xs-95,[dir=rtl] .layout-margin .flex-offset-xs-95,[dir=rtl] .layout-margin .offset-xs-95{margin-left:auto;margin-right:95%}.offset-xs-33,.flex-offset-xs-33,.layout-margin .flex-offset-xs-33,.layout-margin .offset-xs-33{margin-left:33.3333333333%}.offset-xs-66,.flex-offset-xs-66,.layout-margin .flex-offset-xs-66,.layout-margin .offset-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-xs-66,[dir=rtl] .flex-offset-xs-66,[dir=rtl] .layout-margin .flex-offset-xs-66,[dir=rtl] .layout-margin .offset-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xs,.layout-align-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xs-start,.layout-align-xs-start-start,.layout-align-xs-start-center,.layout-align-xs-start-end,.layout-align-xs-start-stretch{justify-content:flex-start}.layout-align-xs-center,.layout-align-xs-center-start,.layout-align-xs-center-center,.layout-align-xs-center-end,.layout-align-xs-center-stretch{justify-content:center}.layout-align-xs-end,.layout-align-xs-end-start,.layout-align-xs-end-center,.layout-align-xs-end-end,.layout-align-xs-end-stretch{justify-content:flex-end}.layout-align-xs-space-around,.layout-align-xs-space-around-center,.layout-align-xs-space-around-start,.layout-align-xs-space-around-end,.layout-align-xs-space-around-stretch{justify-content:space-around}.layout-align-xs-space-between,.layout-align-xs-space-between-center,.layout-align-xs-space-between-start,.layout-align-xs-space-between-end,.layout-align-xs-space-between-stretch{justify-content:space-between}.layout-align-xs-start-start,.layout-align-xs-center-start,.layout-align-xs-end-start,.layout-align-xs-space-between-start,.layout-align-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xs-start-center,.layout-align-xs-center-center,.layout-align-xs-end-center,.layout-align-xs-space-between-center,.layout-align-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xs-start-center>*,.layout-align-xs-center-center>*,.layout-align-xs-end-center>*,.layout-align-xs-space-between-center>*,.layout-align-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xs-start-end,.layout-align-xs-center-end,.layout-align-xs-end-end,.layout-align-xs-space-between-end,.layout-align-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xs-start-stretch,.layout-align-xs-center-stretch,.layout-align-xs-end-stretch,.layout-align-xs-space-between-stretch,.layout-align-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xs{flex:1;box-sizing:border-box}.flex-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xs-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xs-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xs-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xs-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xs-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xs-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xs-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xs-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xs-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xs-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xs-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xs-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xs-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xs-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xs-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xs-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xs-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xs-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xs-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xs-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xs-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex{min-width:0}.layout-xs-column>.flex-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xs-column>.flex-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-column>.flex{min-height:0}.layout-xs,.layout-xs-column,.layout-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xs-column{flex-direction:column}.layout-xs-row{flex-direction:row}}@media(min-width: 600px){.flex-order-gt-xs--20{order:-20}.flex-order-gt-xs--19{order:-19}.flex-order-gt-xs--18{order:-18}.flex-order-gt-xs--17{order:-17}.flex-order-gt-xs--16{order:-16}.flex-order-gt-xs--15{order:-15}.flex-order-gt-xs--14{order:-14}.flex-order-gt-xs--13{order:-13}.flex-order-gt-xs--12{order:-12}.flex-order-gt-xs--11{order:-11}.flex-order-gt-xs--10{order:-10}.flex-order-gt-xs--9{order:-9}.flex-order-gt-xs--8{order:-8}.flex-order-gt-xs--7{order:-7}.flex-order-gt-xs--6{order:-6}.flex-order-gt-xs--5{order:-5}.flex-order-gt-xs--4{order:-4}.flex-order-gt-xs--3{order:-3}.flex-order-gt-xs--2{order:-2}.flex-order-gt-xs--1{order:-1}.flex-order-gt-xs-0{order:0}.flex-order-gt-xs-1{order:1}.flex-order-gt-xs-2{order:2}.flex-order-gt-xs-3{order:3}.flex-order-gt-xs-4{order:4}.flex-order-gt-xs-5{order:5}.flex-order-gt-xs-6{order:6}.flex-order-gt-xs-7{order:7}.flex-order-gt-xs-8{order:8}.flex-order-gt-xs-9{order:9}.flex-order-gt-xs-10{order:10}.flex-order-gt-xs-11{order:11}.flex-order-gt-xs-12{order:12}.flex-order-gt-xs-13{order:13}.flex-order-gt-xs-14{order:14}.flex-order-gt-xs-15{order:15}.flex-order-gt-xs-16{order:16}.flex-order-gt-xs-17{order:17}.flex-order-gt-xs-18{order:18}.flex-order-gt-xs-19{order:19}.flex-order-gt-xs-20{order:20}.offset-gt-xs-0,.flex-offset-gt-xs-0,.layout-margin .flex-offset-gt-xs-0,.layout-margin .offset-gt-xs-0{margin-left:0}[dir=rtl] .offset-gt-xs-0,[dir=rtl] .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .offset-gt-xs-0{margin-left:auto;margin-right:0}.offset-gt-xs-5,.flex-offset-gt-xs-5,.layout-margin .flex-offset-gt-xs-5,.layout-margin .offset-gt-xs-5{margin-left:5%}[dir=rtl] .offset-gt-xs-5,[dir=rtl] .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .offset-gt-xs-5{margin-left:auto;margin-right:5%}.offset-gt-xs-10,.flex-offset-gt-xs-10,.layout-margin .flex-offset-gt-xs-10,.layout-margin .offset-gt-xs-10{margin-left:10%}[dir=rtl] .offset-gt-xs-10,[dir=rtl] .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .offset-gt-xs-10{margin-left:auto;margin-right:10%}.offset-gt-xs-15,.flex-offset-gt-xs-15,.layout-margin .flex-offset-gt-xs-15,.layout-margin .offset-gt-xs-15{margin-left:15%}[dir=rtl] .offset-gt-xs-15,[dir=rtl] .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .offset-gt-xs-15{margin-left:auto;margin-right:15%}.offset-gt-xs-20,.flex-offset-gt-xs-20,.layout-margin .flex-offset-gt-xs-20,.layout-margin .offset-gt-xs-20{margin-left:20%}[dir=rtl] .offset-gt-xs-20,[dir=rtl] .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .offset-gt-xs-20{margin-left:auto;margin-right:20%}.offset-gt-xs-25,.flex-offset-gt-xs-25,.layout-margin .flex-offset-gt-xs-25,.layout-margin .offset-gt-xs-25{margin-left:25%}[dir=rtl] .offset-gt-xs-25,[dir=rtl] .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .offset-gt-xs-25{margin-left:auto;margin-right:25%}.offset-gt-xs-30,.flex-offset-gt-xs-30,.layout-margin .flex-offset-gt-xs-30,.layout-margin .offset-gt-xs-30{margin-left:30%}[dir=rtl] .offset-gt-xs-30,[dir=rtl] .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .offset-gt-xs-30{margin-left:auto;margin-right:30%}.offset-gt-xs-35,.flex-offset-gt-xs-35,.layout-margin .flex-offset-gt-xs-35,.layout-margin .offset-gt-xs-35{margin-left:35%}[dir=rtl] .offset-gt-xs-35,[dir=rtl] .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .offset-gt-xs-35{margin-left:auto;margin-right:35%}.offset-gt-xs-40,.flex-offset-gt-xs-40,.layout-margin .flex-offset-gt-xs-40,.layout-margin .offset-gt-xs-40{margin-left:40%}[dir=rtl] .offset-gt-xs-40,[dir=rtl] .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .offset-gt-xs-40{margin-left:auto;margin-right:40%}.offset-gt-xs-45,.flex-offset-gt-xs-45,.layout-margin .flex-offset-gt-xs-45,.layout-margin .offset-gt-xs-45{margin-left:45%}[dir=rtl] .offset-gt-xs-45,[dir=rtl] .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .offset-gt-xs-45{margin-left:auto;margin-right:45%}.offset-gt-xs-50,.flex-offset-gt-xs-50,.layout-margin .flex-offset-gt-xs-50,.layout-margin .offset-gt-xs-50{margin-left:50%}[dir=rtl] .offset-gt-xs-50,[dir=rtl] .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .offset-gt-xs-50{margin-left:auto;margin-right:50%}.offset-gt-xs-55,.flex-offset-gt-xs-55,.layout-margin .flex-offset-gt-xs-55,.layout-margin .offset-gt-xs-55{margin-left:55%}[dir=rtl] .offset-gt-xs-55,[dir=rtl] .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .offset-gt-xs-55{margin-left:auto;margin-right:55%}.offset-gt-xs-60,.flex-offset-gt-xs-60,.layout-margin .flex-offset-gt-xs-60,.layout-margin .offset-gt-xs-60{margin-left:60%}[dir=rtl] .offset-gt-xs-60,[dir=rtl] .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .offset-gt-xs-60{margin-left:auto;margin-right:60%}.offset-gt-xs-65,.flex-offset-gt-xs-65,.layout-margin .flex-offset-gt-xs-65,.layout-margin .offset-gt-xs-65{margin-left:65%}[dir=rtl] .offset-gt-xs-65,[dir=rtl] .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .offset-gt-xs-65{margin-left:auto;margin-right:65%}.offset-gt-xs-70,.flex-offset-gt-xs-70,.layout-margin .flex-offset-gt-xs-70,.layout-margin .offset-gt-xs-70{margin-left:70%}[dir=rtl] .offset-gt-xs-70,[dir=rtl] .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .offset-gt-xs-70{margin-left:auto;margin-right:70%}.offset-gt-xs-75,.flex-offset-gt-xs-75,.layout-margin .flex-offset-gt-xs-75,.layout-margin .offset-gt-xs-75{margin-left:75%}[dir=rtl] .offset-gt-xs-75,[dir=rtl] .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .offset-gt-xs-75{margin-left:auto;margin-right:75%}.offset-gt-xs-80,.flex-offset-gt-xs-80,.layout-margin .flex-offset-gt-xs-80,.layout-margin .offset-gt-xs-80{margin-left:80%}[dir=rtl] .offset-gt-xs-80,[dir=rtl] .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .offset-gt-xs-80{margin-left:auto;margin-right:80%}.offset-gt-xs-85,.flex-offset-gt-xs-85,.layout-margin .flex-offset-gt-xs-85,.layout-margin .offset-gt-xs-85{margin-left:85%}[dir=rtl] .offset-gt-xs-85,[dir=rtl] .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .offset-gt-xs-85{margin-left:auto;margin-right:85%}.offset-gt-xs-90,.flex-offset-gt-xs-90,.layout-margin .flex-offset-gt-xs-90,.layout-margin .offset-gt-xs-90{margin-left:90%}[dir=rtl] .offset-gt-xs-90,[dir=rtl] .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .offset-gt-xs-90{margin-left:auto;margin-right:90%}.offset-gt-xs-95,.flex-offset-gt-xs-95,.layout-margin .flex-offset-gt-xs-95,.layout-margin .offset-gt-xs-95{margin-left:95%}[dir=rtl] .offset-gt-xs-95,[dir=rtl] .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .offset-gt-xs-95{margin-left:auto;margin-right:95%}.offset-gt-xs-33,.flex-offset-gt-xs-33,.layout-margin .flex-offset-gt-xs-33,.layout-margin .offset-gt-xs-33{margin-left:33.3333333333%}.offset-gt-xs-66,.flex-offset-gt-xs-66,.layout-margin .flex-offset-gt-xs-66,.layout-margin .offset-gt-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-xs-66,[dir=rtl] .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .offset-gt-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-xs,.layout-align-gt-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-xs-start,.layout-align-gt-xs-start-start,.layout-align-gt-xs-start-center,.layout-align-gt-xs-start-end,.layout-align-gt-xs-start-stretch{justify-content:flex-start}.layout-align-gt-xs-center,.layout-align-gt-xs-center-start,.layout-align-gt-xs-center-center,.layout-align-gt-xs-center-end,.layout-align-gt-xs-center-stretch{justify-content:center}.layout-align-gt-xs-end,.layout-align-gt-xs-end-start,.layout-align-gt-xs-end-center,.layout-align-gt-xs-end-end,.layout-align-gt-xs-end-stretch{justify-content:flex-end}.layout-align-gt-xs-space-around,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-around-stretch{justify-content:space-around}.layout-align-gt-xs-space-between,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-between-stretch{justify-content:space-between}.layout-align-gt-xs-start-start,.layout-align-gt-xs-center-start,.layout-align-gt-xs-end-start,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-xs-start-center,.layout-align-gt-xs-center-center,.layout-align-gt-xs-end-center,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-xs-start-center>*,.layout-align-gt-xs-center-center>*,.layout-align-gt-xs-end-center>*,.layout-align-gt-xs-space-between-center>*,.layout-align-gt-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-xs-start-end,.layout-align-gt-xs-center-end,.layout-align-gt-xs-end-end,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-xs-start-stretch,.layout-align-gt-xs-center-stretch,.layout-align-gt-xs-end-stretch,.layout-align-gt-xs-space-between-stretch,.layout-align-gt-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-xs{flex:1;box-sizing:border-box}.flex-gt-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-xs-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex{min-width:0}.layout-gt-xs-column>.flex-gt-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-column>.flex{min-height:0}.layout-gt-xs,.layout-gt-xs-column,.layout-gt-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-xs-column{flex-direction:column}.layout-gt-xs-row{flex-direction:row}}@media(min-width: 600px)and (max-width: 959px){.hide:not(.show-gt-xs):not(.show-sm):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.hide-sm:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.flex-order-sm--20{order:-20}.flex-order-sm--19{order:-19}.flex-order-sm--18{order:-18}.flex-order-sm--17{order:-17}.flex-order-sm--16{order:-16}.flex-order-sm--15{order:-15}.flex-order-sm--14{order:-14}.flex-order-sm--13{order:-13}.flex-order-sm--12{order:-12}.flex-order-sm--11{order:-11}.flex-order-sm--10{order:-10}.flex-order-sm--9{order:-9}.flex-order-sm--8{order:-8}.flex-order-sm--7{order:-7}.flex-order-sm--6{order:-6}.flex-order-sm--5{order:-5}.flex-order-sm--4{order:-4}.flex-order-sm--3{order:-3}.flex-order-sm--2{order:-2}.flex-order-sm--1{order:-1}.flex-order-sm-0{order:0}.flex-order-sm-1{order:1}.flex-order-sm-2{order:2}.flex-order-sm-3{order:3}.flex-order-sm-4{order:4}.flex-order-sm-5{order:5}.flex-order-sm-6{order:6}.flex-order-sm-7{order:7}.flex-order-sm-8{order:8}.flex-order-sm-9{order:9}.flex-order-sm-10{order:10}.flex-order-sm-11{order:11}.flex-order-sm-12{order:12}.flex-order-sm-13{order:13}.flex-order-sm-14{order:14}.flex-order-sm-15{order:15}.flex-order-sm-16{order:16}.flex-order-sm-17{order:17}.flex-order-sm-18{order:18}.flex-order-sm-19{order:19}.flex-order-sm-20{order:20}.offset-sm-0,.flex-offset-sm-0,.layout-margin .flex-offset-sm-0,.layout-margin .offset-sm-0{margin-left:0}[dir=rtl] .offset-sm-0,[dir=rtl] .flex-offset-sm-0,[dir=rtl] .layout-margin .flex-offset-sm-0,[dir=rtl] .layout-margin .offset-sm-0{margin-left:auto;margin-right:0}.offset-sm-5,.flex-offset-sm-5,.layout-margin .flex-offset-sm-5,.layout-margin .offset-sm-5{margin-left:5%}[dir=rtl] .offset-sm-5,[dir=rtl] .flex-offset-sm-5,[dir=rtl] .layout-margin .flex-offset-sm-5,[dir=rtl] .layout-margin .offset-sm-5{margin-left:auto;margin-right:5%}.offset-sm-10,.flex-offset-sm-10,.layout-margin .flex-offset-sm-10,.layout-margin .offset-sm-10{margin-left:10%}[dir=rtl] .offset-sm-10,[dir=rtl] .flex-offset-sm-10,[dir=rtl] .layout-margin .flex-offset-sm-10,[dir=rtl] .layout-margin .offset-sm-10{margin-left:auto;margin-right:10%}.offset-sm-15,.flex-offset-sm-15,.layout-margin .flex-offset-sm-15,.layout-margin .offset-sm-15{margin-left:15%}[dir=rtl] .offset-sm-15,[dir=rtl] .flex-offset-sm-15,[dir=rtl] .layout-margin .flex-offset-sm-15,[dir=rtl] .layout-margin .offset-sm-15{margin-left:auto;margin-right:15%}.offset-sm-20,.flex-offset-sm-20,.layout-margin .flex-offset-sm-20,.layout-margin .offset-sm-20{margin-left:20%}[dir=rtl] .offset-sm-20,[dir=rtl] .flex-offset-sm-20,[dir=rtl] .layout-margin .flex-offset-sm-20,[dir=rtl] .layout-margin .offset-sm-20{margin-left:auto;margin-right:20%}.offset-sm-25,.flex-offset-sm-25,.layout-margin .flex-offset-sm-25,.layout-margin .offset-sm-25{margin-left:25%}[dir=rtl] .offset-sm-25,[dir=rtl] .flex-offset-sm-25,[dir=rtl] .layout-margin .flex-offset-sm-25,[dir=rtl] .layout-margin .offset-sm-25{margin-left:auto;margin-right:25%}.offset-sm-30,.flex-offset-sm-30,.layout-margin .flex-offset-sm-30,.layout-margin .offset-sm-30{margin-left:30%}[dir=rtl] .offset-sm-30,[dir=rtl] .flex-offset-sm-30,[dir=rtl] .layout-margin .flex-offset-sm-30,[dir=rtl] .layout-margin .offset-sm-30{margin-left:auto;margin-right:30%}.offset-sm-35,.flex-offset-sm-35,.layout-margin .flex-offset-sm-35,.layout-margin .offset-sm-35{margin-left:35%}[dir=rtl] .offset-sm-35,[dir=rtl] .flex-offset-sm-35,[dir=rtl] .layout-margin .flex-offset-sm-35,[dir=rtl] .layout-margin .offset-sm-35{margin-left:auto;margin-right:35%}.offset-sm-40,.flex-offset-sm-40,.layout-margin .flex-offset-sm-40,.layout-margin .offset-sm-40{margin-left:40%}[dir=rtl] .offset-sm-40,[dir=rtl] .flex-offset-sm-40,[dir=rtl] .layout-margin .flex-offset-sm-40,[dir=rtl] .layout-margin .offset-sm-40{margin-left:auto;margin-right:40%}.offset-sm-45,.flex-offset-sm-45,.layout-margin .flex-offset-sm-45,.layout-margin .offset-sm-45{margin-left:45%}[dir=rtl] .offset-sm-45,[dir=rtl] .flex-offset-sm-45,[dir=rtl] .layout-margin .flex-offset-sm-45,[dir=rtl] .layout-margin .offset-sm-45{margin-left:auto;margin-right:45%}.offset-sm-50,.flex-offset-sm-50,.layout-margin .flex-offset-sm-50,.layout-margin .offset-sm-50{margin-left:50%}[dir=rtl] .offset-sm-50,[dir=rtl] .flex-offset-sm-50,[dir=rtl] .layout-margin .flex-offset-sm-50,[dir=rtl] .layout-margin .offset-sm-50{margin-left:auto;margin-right:50%}.offset-sm-55,.flex-offset-sm-55,.layout-margin .flex-offset-sm-55,.layout-margin .offset-sm-55{margin-left:55%}[dir=rtl] .offset-sm-55,[dir=rtl] .flex-offset-sm-55,[dir=rtl] .layout-margin .flex-offset-sm-55,[dir=rtl] .layout-margin .offset-sm-55{margin-left:auto;margin-right:55%}.offset-sm-60,.flex-offset-sm-60,.layout-margin .flex-offset-sm-60,.layout-margin .offset-sm-60{margin-left:60%}[dir=rtl] .offset-sm-60,[dir=rtl] .flex-offset-sm-60,[dir=rtl] .layout-margin .flex-offset-sm-60,[dir=rtl] .layout-margin .offset-sm-60{margin-left:auto;margin-right:60%}.offset-sm-65,.flex-offset-sm-65,.layout-margin .flex-offset-sm-65,.layout-margin .offset-sm-65{margin-left:65%}[dir=rtl] .offset-sm-65,[dir=rtl] .flex-offset-sm-65,[dir=rtl] .layout-margin .flex-offset-sm-65,[dir=rtl] .layout-margin .offset-sm-65{margin-left:auto;margin-right:65%}.offset-sm-70,.flex-offset-sm-70,.layout-margin .flex-offset-sm-70,.layout-margin .offset-sm-70{margin-left:70%}[dir=rtl] .offset-sm-70,[dir=rtl] .flex-offset-sm-70,[dir=rtl] .layout-margin .flex-offset-sm-70,[dir=rtl] .layout-margin .offset-sm-70{margin-left:auto;margin-right:70%}.offset-sm-75,.flex-offset-sm-75,.layout-margin .flex-offset-sm-75,.layout-margin .offset-sm-75{margin-left:75%}[dir=rtl] .offset-sm-75,[dir=rtl] .flex-offset-sm-75,[dir=rtl] .layout-margin .flex-offset-sm-75,[dir=rtl] .layout-margin .offset-sm-75{margin-left:auto;margin-right:75%}.offset-sm-80,.flex-offset-sm-80,.layout-margin .flex-offset-sm-80,.layout-margin .offset-sm-80{margin-left:80%}[dir=rtl] .offset-sm-80,[dir=rtl] .flex-offset-sm-80,[dir=rtl] .layout-margin .flex-offset-sm-80,[dir=rtl] .layout-margin .offset-sm-80{margin-left:auto;margin-right:80%}.offset-sm-85,.flex-offset-sm-85,.layout-margin .flex-offset-sm-85,.layout-margin .offset-sm-85{margin-left:85%}[dir=rtl] .offset-sm-85,[dir=rtl] .flex-offset-sm-85,[dir=rtl] .layout-margin .flex-offset-sm-85,[dir=rtl] .layout-margin .offset-sm-85{margin-left:auto;margin-right:85%}.offset-sm-90,.flex-offset-sm-90,.layout-margin .flex-offset-sm-90,.layout-margin .offset-sm-90{margin-left:90%}[dir=rtl] .offset-sm-90,[dir=rtl] .flex-offset-sm-90,[dir=rtl] .layout-margin .flex-offset-sm-90,[dir=rtl] .layout-margin .offset-sm-90{margin-left:auto;margin-right:90%}.offset-sm-95,.flex-offset-sm-95,.layout-margin .flex-offset-sm-95,.layout-margin .offset-sm-95{margin-left:95%}[dir=rtl] .offset-sm-95,[dir=rtl] .flex-offset-sm-95,[dir=rtl] .layout-margin .flex-offset-sm-95,[dir=rtl] .layout-margin .offset-sm-95{margin-left:auto;margin-right:95%}.offset-sm-33,.flex-offset-sm-33,.layout-margin .flex-offset-sm-33,.layout-margin .offset-sm-33{margin-left:33.3333333333%}.offset-sm-66,.flex-offset-sm-66,.layout-margin .flex-offset-sm-66,.layout-margin .offset-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-sm-66,[dir=rtl] .flex-offset-sm-66,[dir=rtl] .layout-margin .flex-offset-sm-66,[dir=rtl] .layout-margin .offset-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-sm,.layout-align-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-sm-start,.layout-align-sm-start-start,.layout-align-sm-start-center,.layout-align-sm-start-end,.layout-align-sm-start-stretch{justify-content:flex-start}.layout-align-sm-center,.layout-align-sm-center-start,.layout-align-sm-center-center,.layout-align-sm-center-end,.layout-align-sm-center-stretch{justify-content:center}.layout-align-sm-end,.layout-align-sm-end-start,.layout-align-sm-end-center,.layout-align-sm-end-end,.layout-align-sm-end-stretch{justify-content:flex-end}.layout-align-sm-space-around,.layout-align-sm-space-around-center,.layout-align-sm-space-around-start,.layout-align-sm-space-around-end,.layout-align-sm-space-around-stretch{justify-content:space-around}.layout-align-sm-space-between,.layout-align-sm-space-between-center,.layout-align-sm-space-between-start,.layout-align-sm-space-between-end,.layout-align-sm-space-between-stretch{justify-content:space-between}.layout-align-sm-start-start,.layout-align-sm-center-start,.layout-align-sm-end-start,.layout-align-sm-space-between-start,.layout-align-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-sm-start-center,.layout-align-sm-center-center,.layout-align-sm-end-center,.layout-align-sm-space-between-center,.layout-align-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-sm-start-center>*,.layout-align-sm-center-center>*,.layout-align-sm-end-center>*,.layout-align-sm-space-between-center>*,.layout-align-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-sm-start-end,.layout-align-sm-center-end,.layout-align-sm-end-end,.layout-align-sm-space-between-end,.layout-align-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-sm-start-stretch,.layout-align-sm-center-stretch,.layout-align-sm-end-stretch,.layout-align-sm-space-between-stretch,.layout-align-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-sm{flex:1;box-sizing:border-box}.flex-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-sm-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-sm-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-sm-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-sm-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-sm-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-sm-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-sm-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-sm-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-sm-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-sm-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-sm-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-sm-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-sm-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-sm-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-sm-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-sm-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-sm-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-sm-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-sm-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-sm-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-sm-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex{min-width:0}.layout-sm-column>.flex-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-sm-column>.flex-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-column>.flex{min-height:0}.layout-sm,.layout-sm-column,.layout-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-sm-column{flex-direction:column}.layout-sm-row{flex-direction:row}}@media(min-width: 960px){.flex-order-gt-sm--20{order:-20}.flex-order-gt-sm--19{order:-19}.flex-order-gt-sm--18{order:-18}.flex-order-gt-sm--17{order:-17}.flex-order-gt-sm--16{order:-16}.flex-order-gt-sm--15{order:-15}.flex-order-gt-sm--14{order:-14}.flex-order-gt-sm--13{order:-13}.flex-order-gt-sm--12{order:-12}.flex-order-gt-sm--11{order:-11}.flex-order-gt-sm--10{order:-10}.flex-order-gt-sm--9{order:-9}.flex-order-gt-sm--8{order:-8}.flex-order-gt-sm--7{order:-7}.flex-order-gt-sm--6{order:-6}.flex-order-gt-sm--5{order:-5}.flex-order-gt-sm--4{order:-4}.flex-order-gt-sm--3{order:-3}.flex-order-gt-sm--2{order:-2}.flex-order-gt-sm--1{order:-1}.flex-order-gt-sm-0{order:0}.flex-order-gt-sm-1{order:1}.flex-order-gt-sm-2{order:2}.flex-order-gt-sm-3{order:3}.flex-order-gt-sm-4{order:4}.flex-order-gt-sm-5{order:5}.flex-order-gt-sm-6{order:6}.flex-order-gt-sm-7{order:7}.flex-order-gt-sm-8{order:8}.flex-order-gt-sm-9{order:9}.flex-order-gt-sm-10{order:10}.flex-order-gt-sm-11{order:11}.flex-order-gt-sm-12{order:12}.flex-order-gt-sm-13{order:13}.flex-order-gt-sm-14{order:14}.flex-order-gt-sm-15{order:15}.flex-order-gt-sm-16{order:16}.flex-order-gt-sm-17{order:17}.flex-order-gt-sm-18{order:18}.flex-order-gt-sm-19{order:19}.flex-order-gt-sm-20{order:20}.offset-gt-sm-0,.flex-offset-gt-sm-0,.layout-margin .flex-offset-gt-sm-0,.layout-margin .offset-gt-sm-0{margin-left:0}[dir=rtl] .offset-gt-sm-0,[dir=rtl] .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .offset-gt-sm-0{margin-left:auto;margin-right:0}.offset-gt-sm-5,.flex-offset-gt-sm-5,.layout-margin .flex-offset-gt-sm-5,.layout-margin .offset-gt-sm-5{margin-left:5%}[dir=rtl] .offset-gt-sm-5,[dir=rtl] .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .offset-gt-sm-5{margin-left:auto;margin-right:5%}.offset-gt-sm-10,.flex-offset-gt-sm-10,.layout-margin .flex-offset-gt-sm-10,.layout-margin .offset-gt-sm-10{margin-left:10%}[dir=rtl] .offset-gt-sm-10,[dir=rtl] .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .offset-gt-sm-10{margin-left:auto;margin-right:10%}.offset-gt-sm-15,.flex-offset-gt-sm-15,.layout-margin .flex-offset-gt-sm-15,.layout-margin .offset-gt-sm-15{margin-left:15%}[dir=rtl] .offset-gt-sm-15,[dir=rtl] .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .offset-gt-sm-15{margin-left:auto;margin-right:15%}.offset-gt-sm-20,.flex-offset-gt-sm-20,.layout-margin .flex-offset-gt-sm-20,.layout-margin .offset-gt-sm-20{margin-left:20%}[dir=rtl] .offset-gt-sm-20,[dir=rtl] .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .offset-gt-sm-20{margin-left:auto;margin-right:20%}.offset-gt-sm-25,.flex-offset-gt-sm-25,.layout-margin .flex-offset-gt-sm-25,.layout-margin .offset-gt-sm-25{margin-left:25%}[dir=rtl] .offset-gt-sm-25,[dir=rtl] .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .offset-gt-sm-25{margin-left:auto;margin-right:25%}.offset-gt-sm-30,.flex-offset-gt-sm-30,.layout-margin .flex-offset-gt-sm-30,.layout-margin .offset-gt-sm-30{margin-left:30%}[dir=rtl] .offset-gt-sm-30,[dir=rtl] .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .offset-gt-sm-30{margin-left:auto;margin-right:30%}.offset-gt-sm-35,.flex-offset-gt-sm-35,.layout-margin .flex-offset-gt-sm-35,.layout-margin .offset-gt-sm-35{margin-left:35%}[dir=rtl] .offset-gt-sm-35,[dir=rtl] .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .offset-gt-sm-35{margin-left:auto;margin-right:35%}.offset-gt-sm-40,.flex-offset-gt-sm-40,.layout-margin .flex-offset-gt-sm-40,.layout-margin .offset-gt-sm-40{margin-left:40%}[dir=rtl] .offset-gt-sm-40,[dir=rtl] .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .offset-gt-sm-40{margin-left:auto;margin-right:40%}.offset-gt-sm-45,.flex-offset-gt-sm-45,.layout-margin .flex-offset-gt-sm-45,.layout-margin .offset-gt-sm-45{margin-left:45%}[dir=rtl] .offset-gt-sm-45,[dir=rtl] .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .offset-gt-sm-45{margin-left:auto;margin-right:45%}.offset-gt-sm-50,.flex-offset-gt-sm-50,.layout-margin .flex-offset-gt-sm-50,.layout-margin .offset-gt-sm-50{margin-left:50%}[dir=rtl] .offset-gt-sm-50,[dir=rtl] .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .offset-gt-sm-50{margin-left:auto;margin-right:50%}.offset-gt-sm-55,.flex-offset-gt-sm-55,.layout-margin .flex-offset-gt-sm-55,.layout-margin .offset-gt-sm-55{margin-left:55%}[dir=rtl] .offset-gt-sm-55,[dir=rtl] .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .offset-gt-sm-55{margin-left:auto;margin-right:55%}.offset-gt-sm-60,.flex-offset-gt-sm-60,.layout-margin .flex-offset-gt-sm-60,.layout-margin .offset-gt-sm-60{margin-left:60%}[dir=rtl] .offset-gt-sm-60,[dir=rtl] .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .offset-gt-sm-60{margin-left:auto;margin-right:60%}.offset-gt-sm-65,.flex-offset-gt-sm-65,.layout-margin .flex-offset-gt-sm-65,.layout-margin .offset-gt-sm-65{margin-left:65%}[dir=rtl] .offset-gt-sm-65,[dir=rtl] .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .offset-gt-sm-65{margin-left:auto;margin-right:65%}.offset-gt-sm-70,.flex-offset-gt-sm-70,.layout-margin .flex-offset-gt-sm-70,.layout-margin .offset-gt-sm-70{margin-left:70%}[dir=rtl] .offset-gt-sm-70,[dir=rtl] .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .offset-gt-sm-70{margin-left:auto;margin-right:70%}.offset-gt-sm-75,.flex-offset-gt-sm-75,.layout-margin .flex-offset-gt-sm-75,.layout-margin .offset-gt-sm-75{margin-left:75%}[dir=rtl] .offset-gt-sm-75,[dir=rtl] .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .offset-gt-sm-75{margin-left:auto;margin-right:75%}.offset-gt-sm-80,.flex-offset-gt-sm-80,.layout-margin .flex-offset-gt-sm-80,.layout-margin .offset-gt-sm-80{margin-left:80%}[dir=rtl] .offset-gt-sm-80,[dir=rtl] .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .offset-gt-sm-80{margin-left:auto;margin-right:80%}.offset-gt-sm-85,.flex-offset-gt-sm-85,.layout-margin .flex-offset-gt-sm-85,.layout-margin .offset-gt-sm-85{margin-left:85%}[dir=rtl] .offset-gt-sm-85,[dir=rtl] .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .offset-gt-sm-85{margin-left:auto;margin-right:85%}.offset-gt-sm-90,.flex-offset-gt-sm-90,.layout-margin .flex-offset-gt-sm-90,.layout-margin .offset-gt-sm-90{margin-left:90%}[dir=rtl] .offset-gt-sm-90,[dir=rtl] .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .offset-gt-sm-90{margin-left:auto;margin-right:90%}.offset-gt-sm-95,.flex-offset-gt-sm-95,.layout-margin .flex-offset-gt-sm-95,.layout-margin .offset-gt-sm-95{margin-left:95%}[dir=rtl] .offset-gt-sm-95,[dir=rtl] .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .offset-gt-sm-95{margin-left:auto;margin-right:95%}.offset-gt-sm-33,.flex-offset-gt-sm-33,.layout-margin .flex-offset-gt-sm-33,.layout-margin .offset-gt-sm-33{margin-left:33.3333333333%}.offset-gt-sm-66,.flex-offset-gt-sm-66,.layout-margin .flex-offset-gt-sm-66,.layout-margin .offset-gt-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-sm-66,[dir=rtl] .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .offset-gt-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-sm,.layout-align-gt-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-sm-start,.layout-align-gt-sm-start-start,.layout-align-gt-sm-start-center,.layout-align-gt-sm-start-end,.layout-align-gt-sm-start-stretch{justify-content:flex-start}.layout-align-gt-sm-center,.layout-align-gt-sm-center-start,.layout-align-gt-sm-center-center,.layout-align-gt-sm-center-end,.layout-align-gt-sm-center-stretch{justify-content:center}.layout-align-gt-sm-end,.layout-align-gt-sm-end-start,.layout-align-gt-sm-end-center,.layout-align-gt-sm-end-end,.layout-align-gt-sm-end-stretch{justify-content:flex-end}.layout-align-gt-sm-space-around,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-around-stretch{justify-content:space-around}.layout-align-gt-sm-space-between,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-between-stretch{justify-content:space-between}.layout-align-gt-sm-start-start,.layout-align-gt-sm-center-start,.layout-align-gt-sm-end-start,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-sm-start-center,.layout-align-gt-sm-center-center,.layout-align-gt-sm-end-center,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-sm-start-center>*,.layout-align-gt-sm-center-center>*,.layout-align-gt-sm-end-center>*,.layout-align-gt-sm-space-between-center>*,.layout-align-gt-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-sm-start-end,.layout-align-gt-sm-center-end,.layout-align-gt-sm-end-end,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-sm-start-stretch,.layout-align-gt-sm-center-stretch,.layout-align-gt-sm-end-stretch,.layout-align-gt-sm-space-between-stretch,.layout-align-gt-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-sm{flex:1;box-sizing:border-box}.flex-gt-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-sm-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex{min-width:0}.layout-gt-sm-column>.flex-gt-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-column>.flex{min-height:0}.layout-gt-sm,.layout-gt-sm-column,.layout-gt-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-sm-column{flex-direction:column}.layout-gt-sm-row{flex-direction:row}}@media(min-width: 960px)and (max-width: 1279px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show){display:none}.hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-md--20{order:-20}.flex-order-md--19{order:-19}.flex-order-md--18{order:-18}.flex-order-md--17{order:-17}.flex-order-md--16{order:-16}.flex-order-md--15{order:-15}.flex-order-md--14{order:-14}.flex-order-md--13{order:-13}.flex-order-md--12{order:-12}.flex-order-md--11{order:-11}.flex-order-md--10{order:-10}.flex-order-md--9{order:-9}.flex-order-md--8{order:-8}.flex-order-md--7{order:-7}.flex-order-md--6{order:-6}.flex-order-md--5{order:-5}.flex-order-md--4{order:-4}.flex-order-md--3{order:-3}.flex-order-md--2{order:-2}.flex-order-md--1{order:-1}.flex-order-md-0{order:0}.flex-order-md-1{order:1}.flex-order-md-2{order:2}.flex-order-md-3{order:3}.flex-order-md-4{order:4}.flex-order-md-5{order:5}.flex-order-md-6{order:6}.flex-order-md-7{order:7}.flex-order-md-8{order:8}.flex-order-md-9{order:9}.flex-order-md-10{order:10}.flex-order-md-11{order:11}.flex-order-md-12{order:12}.flex-order-md-13{order:13}.flex-order-md-14{order:14}.flex-order-md-15{order:15}.flex-order-md-16{order:16}.flex-order-md-17{order:17}.flex-order-md-18{order:18}.flex-order-md-19{order:19}.flex-order-md-20{order:20}.offset-md-0,.flex-offset-md-0,.layout-margin .flex-offset-md-0,.layout-margin .offset-md-0{margin-left:0}[dir=rtl] .offset-md-0,[dir=rtl] .flex-offset-md-0,[dir=rtl] .layout-margin .flex-offset-md-0,[dir=rtl] .layout-margin .offset-md-0{margin-left:auto;margin-right:0}.offset-md-5,.flex-offset-md-5,.layout-margin .flex-offset-md-5,.layout-margin .offset-md-5{margin-left:5%}[dir=rtl] .offset-md-5,[dir=rtl] .flex-offset-md-5,[dir=rtl] .layout-margin .flex-offset-md-5,[dir=rtl] .layout-margin .offset-md-5{margin-left:auto;margin-right:5%}.offset-md-10,.flex-offset-md-10,.layout-margin .flex-offset-md-10,.layout-margin .offset-md-10{margin-left:10%}[dir=rtl] .offset-md-10,[dir=rtl] .flex-offset-md-10,[dir=rtl] .layout-margin .flex-offset-md-10,[dir=rtl] .layout-margin .offset-md-10{margin-left:auto;margin-right:10%}.offset-md-15,.flex-offset-md-15,.layout-margin .flex-offset-md-15,.layout-margin .offset-md-15{margin-left:15%}[dir=rtl] .offset-md-15,[dir=rtl] .flex-offset-md-15,[dir=rtl] .layout-margin .flex-offset-md-15,[dir=rtl] .layout-margin .offset-md-15{margin-left:auto;margin-right:15%}.offset-md-20,.flex-offset-md-20,.layout-margin .flex-offset-md-20,.layout-margin .offset-md-20{margin-left:20%}[dir=rtl] .offset-md-20,[dir=rtl] .flex-offset-md-20,[dir=rtl] .layout-margin .flex-offset-md-20,[dir=rtl] .layout-margin .offset-md-20{margin-left:auto;margin-right:20%}.offset-md-25,.flex-offset-md-25,.layout-margin .flex-offset-md-25,.layout-margin .offset-md-25{margin-left:25%}[dir=rtl] .offset-md-25,[dir=rtl] .flex-offset-md-25,[dir=rtl] .layout-margin .flex-offset-md-25,[dir=rtl] .layout-margin .offset-md-25{margin-left:auto;margin-right:25%}.offset-md-30,.flex-offset-md-30,.layout-margin .flex-offset-md-30,.layout-margin .offset-md-30{margin-left:30%}[dir=rtl] .offset-md-30,[dir=rtl] .flex-offset-md-30,[dir=rtl] .layout-margin .flex-offset-md-30,[dir=rtl] .layout-margin .offset-md-30{margin-left:auto;margin-right:30%}.offset-md-35,.flex-offset-md-35,.layout-margin .flex-offset-md-35,.layout-margin .offset-md-35{margin-left:35%}[dir=rtl] .offset-md-35,[dir=rtl] .flex-offset-md-35,[dir=rtl] .layout-margin .flex-offset-md-35,[dir=rtl] .layout-margin .offset-md-35{margin-left:auto;margin-right:35%}.offset-md-40,.flex-offset-md-40,.layout-margin .flex-offset-md-40,.layout-margin .offset-md-40{margin-left:40%}[dir=rtl] .offset-md-40,[dir=rtl] .flex-offset-md-40,[dir=rtl] .layout-margin .flex-offset-md-40,[dir=rtl] .layout-margin .offset-md-40{margin-left:auto;margin-right:40%}.offset-md-45,.flex-offset-md-45,.layout-margin .flex-offset-md-45,.layout-margin .offset-md-45{margin-left:45%}[dir=rtl] .offset-md-45,[dir=rtl] .flex-offset-md-45,[dir=rtl] .layout-margin .flex-offset-md-45,[dir=rtl] .layout-margin .offset-md-45{margin-left:auto;margin-right:45%}.offset-md-50,.flex-offset-md-50,.layout-margin .flex-offset-md-50,.layout-margin .offset-md-50{margin-left:50%}[dir=rtl] .offset-md-50,[dir=rtl] .flex-offset-md-50,[dir=rtl] .layout-margin .flex-offset-md-50,[dir=rtl] .layout-margin .offset-md-50{margin-left:auto;margin-right:50%}.offset-md-55,.flex-offset-md-55,.layout-margin .flex-offset-md-55,.layout-margin .offset-md-55{margin-left:55%}[dir=rtl] .offset-md-55,[dir=rtl] .flex-offset-md-55,[dir=rtl] .layout-margin .flex-offset-md-55,[dir=rtl] .layout-margin .offset-md-55{margin-left:auto;margin-right:55%}.offset-md-60,.flex-offset-md-60,.layout-margin .flex-offset-md-60,.layout-margin .offset-md-60{margin-left:60%}[dir=rtl] .offset-md-60,[dir=rtl] .flex-offset-md-60,[dir=rtl] .layout-margin .flex-offset-md-60,[dir=rtl] .layout-margin .offset-md-60{margin-left:auto;margin-right:60%}.offset-md-65,.flex-offset-md-65,.layout-margin .flex-offset-md-65,.layout-margin .offset-md-65{margin-left:65%}[dir=rtl] .offset-md-65,[dir=rtl] .flex-offset-md-65,[dir=rtl] .layout-margin .flex-offset-md-65,[dir=rtl] .layout-margin .offset-md-65{margin-left:auto;margin-right:65%}.offset-md-70,.flex-offset-md-70,.layout-margin .flex-offset-md-70,.layout-margin .offset-md-70{margin-left:70%}[dir=rtl] .offset-md-70,[dir=rtl] .flex-offset-md-70,[dir=rtl] .layout-margin .flex-offset-md-70,[dir=rtl] .layout-margin .offset-md-70{margin-left:auto;margin-right:70%}.offset-md-75,.flex-offset-md-75,.layout-margin .flex-offset-md-75,.layout-margin .offset-md-75{margin-left:75%}[dir=rtl] .offset-md-75,[dir=rtl] .flex-offset-md-75,[dir=rtl] .layout-margin .flex-offset-md-75,[dir=rtl] .layout-margin .offset-md-75{margin-left:auto;margin-right:75%}.offset-md-80,.flex-offset-md-80,.layout-margin .flex-offset-md-80,.layout-margin .offset-md-80{margin-left:80%}[dir=rtl] .offset-md-80,[dir=rtl] .flex-offset-md-80,[dir=rtl] .layout-margin .flex-offset-md-80,[dir=rtl] .layout-margin .offset-md-80{margin-left:auto;margin-right:80%}.offset-md-85,.flex-offset-md-85,.layout-margin .flex-offset-md-85,.layout-margin .offset-md-85{margin-left:85%}[dir=rtl] .offset-md-85,[dir=rtl] .flex-offset-md-85,[dir=rtl] .layout-margin .flex-offset-md-85,[dir=rtl] .layout-margin .offset-md-85{margin-left:auto;margin-right:85%}.offset-md-90,.flex-offset-md-90,.layout-margin .flex-offset-md-90,.layout-margin .offset-md-90{margin-left:90%}[dir=rtl] .offset-md-90,[dir=rtl] .flex-offset-md-90,[dir=rtl] .layout-margin .flex-offset-md-90,[dir=rtl] .layout-margin .offset-md-90{margin-left:auto;margin-right:90%}.offset-md-95,.flex-offset-md-95,.layout-margin .flex-offset-md-95,.layout-margin .offset-md-95{margin-left:95%}[dir=rtl] .offset-md-95,[dir=rtl] .flex-offset-md-95,[dir=rtl] .layout-margin .flex-offset-md-95,[dir=rtl] .layout-margin .offset-md-95{margin-left:auto;margin-right:95%}.offset-md-33,.flex-offset-md-33,.layout-margin .flex-offset-md-33,.layout-margin .offset-md-33{margin-left:33.3333333333%}.offset-md-66,.flex-offset-md-66,.layout-margin .flex-offset-md-66,.layout-margin .offset-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-md-66,[dir=rtl] .flex-offset-md-66,[dir=rtl] .layout-margin .flex-offset-md-66,[dir=rtl] .layout-margin .offset-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-md,.layout-align-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-md-start,.layout-align-md-start-start,.layout-align-md-start-center,.layout-align-md-start-end,.layout-align-md-start-stretch{justify-content:flex-start}.layout-align-md-center,.layout-align-md-center-start,.layout-align-md-center-center,.layout-align-md-center-end,.layout-align-md-center-stretch{justify-content:center}.layout-align-md-end,.layout-align-md-end-start,.layout-align-md-end-center,.layout-align-md-end-end,.layout-align-md-end-stretch{justify-content:flex-end}.layout-align-md-space-around,.layout-align-md-space-around-center,.layout-align-md-space-around-start,.layout-align-md-space-around-end,.layout-align-md-space-around-stretch{justify-content:space-around}.layout-align-md-space-between,.layout-align-md-space-between-center,.layout-align-md-space-between-start,.layout-align-md-space-between-end,.layout-align-md-space-between-stretch{justify-content:space-between}.layout-align-md-start-start,.layout-align-md-center-start,.layout-align-md-end-start,.layout-align-md-space-between-start,.layout-align-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-md-start-center,.layout-align-md-center-center,.layout-align-md-end-center,.layout-align-md-space-between-center,.layout-align-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-md-start-center>*,.layout-align-md-center-center>*,.layout-align-md-end-center>*,.layout-align-md-space-between-center>*,.layout-align-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-md-start-end,.layout-align-md-center-end,.layout-align-md-end-end,.layout-align-md-space-between-end,.layout-align-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-md-start-stretch,.layout-align-md-center-stretch,.layout-align-md-end-stretch,.layout-align-md-space-between-stretch,.layout-align-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-md{flex:1;box-sizing:border-box}.flex-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-md-none{flex:0 0 auto;box-sizing:border-box}.flex-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-md-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-md-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-md-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-md-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-md-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-md-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-md-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-md-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-md-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-md-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-md-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-md-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-md-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-md-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-md-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-md-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-md-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-md-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-md-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-md-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-md-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex{min-width:0}.layout-md-column>.flex-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-md-column>.flex-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-column>.flex{min-height:0}.layout-md,.layout-md-column,.layout-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-md-column{flex-direction:column}.layout-md-row{flex-direction:row}}@media(min-width: 1280px){.flex-order-gt-md--20{order:-20}.flex-order-gt-md--19{order:-19}.flex-order-gt-md--18{order:-18}.flex-order-gt-md--17{order:-17}.flex-order-gt-md--16{order:-16}.flex-order-gt-md--15{order:-15}.flex-order-gt-md--14{order:-14}.flex-order-gt-md--13{order:-13}.flex-order-gt-md--12{order:-12}.flex-order-gt-md--11{order:-11}.flex-order-gt-md--10{order:-10}.flex-order-gt-md--9{order:-9}.flex-order-gt-md--8{order:-8}.flex-order-gt-md--7{order:-7}.flex-order-gt-md--6{order:-6}.flex-order-gt-md--5{order:-5}.flex-order-gt-md--4{order:-4}.flex-order-gt-md--3{order:-3}.flex-order-gt-md--2{order:-2}.flex-order-gt-md--1{order:-1}.flex-order-gt-md-0{order:0}.flex-order-gt-md-1{order:1}.flex-order-gt-md-2{order:2}.flex-order-gt-md-3{order:3}.flex-order-gt-md-4{order:4}.flex-order-gt-md-5{order:5}.flex-order-gt-md-6{order:6}.flex-order-gt-md-7{order:7}.flex-order-gt-md-8{order:8}.flex-order-gt-md-9{order:9}.flex-order-gt-md-10{order:10}.flex-order-gt-md-11{order:11}.flex-order-gt-md-12{order:12}.flex-order-gt-md-13{order:13}.flex-order-gt-md-14{order:14}.flex-order-gt-md-15{order:15}.flex-order-gt-md-16{order:16}.flex-order-gt-md-17{order:17}.flex-order-gt-md-18{order:18}.flex-order-gt-md-19{order:19}.flex-order-gt-md-20{order:20}.offset-gt-md-0,.flex-offset-gt-md-0,.layout-margin .flex-offset-gt-md-0,.layout-margin .offset-gt-md-0{margin-left:0}[dir=rtl] .offset-gt-md-0,[dir=rtl] .flex-offset-gt-md-0,[dir=rtl] .layout-margin .flex-offset-gt-md-0,[dir=rtl] .layout-margin .offset-gt-md-0{margin-left:auto;margin-right:0}.offset-gt-md-5,.flex-offset-gt-md-5,.layout-margin .flex-offset-gt-md-5,.layout-margin .offset-gt-md-5{margin-left:5%}[dir=rtl] .offset-gt-md-5,[dir=rtl] .flex-offset-gt-md-5,[dir=rtl] .layout-margin .flex-offset-gt-md-5,[dir=rtl] .layout-margin .offset-gt-md-5{margin-left:auto;margin-right:5%}.offset-gt-md-10,.flex-offset-gt-md-10,.layout-margin .flex-offset-gt-md-10,.layout-margin .offset-gt-md-10{margin-left:10%}[dir=rtl] .offset-gt-md-10,[dir=rtl] .flex-offset-gt-md-10,[dir=rtl] .layout-margin .flex-offset-gt-md-10,[dir=rtl] .layout-margin .offset-gt-md-10{margin-left:auto;margin-right:10%}.offset-gt-md-15,.flex-offset-gt-md-15,.layout-margin .flex-offset-gt-md-15,.layout-margin .offset-gt-md-15{margin-left:15%}[dir=rtl] .offset-gt-md-15,[dir=rtl] .flex-offset-gt-md-15,[dir=rtl] .layout-margin .flex-offset-gt-md-15,[dir=rtl] .layout-margin .offset-gt-md-15{margin-left:auto;margin-right:15%}.offset-gt-md-20,.flex-offset-gt-md-20,.layout-margin .flex-offset-gt-md-20,.layout-margin .offset-gt-md-20{margin-left:20%}[dir=rtl] .offset-gt-md-20,[dir=rtl] .flex-offset-gt-md-20,[dir=rtl] .layout-margin .flex-offset-gt-md-20,[dir=rtl] .layout-margin .offset-gt-md-20{margin-left:auto;margin-right:20%}.offset-gt-md-25,.flex-offset-gt-md-25,.layout-margin .flex-offset-gt-md-25,.layout-margin .offset-gt-md-25{margin-left:25%}[dir=rtl] .offset-gt-md-25,[dir=rtl] .flex-offset-gt-md-25,[dir=rtl] .layout-margin .flex-offset-gt-md-25,[dir=rtl] .layout-margin .offset-gt-md-25{margin-left:auto;margin-right:25%}.offset-gt-md-30,.flex-offset-gt-md-30,.layout-margin .flex-offset-gt-md-30,.layout-margin .offset-gt-md-30{margin-left:30%}[dir=rtl] .offset-gt-md-30,[dir=rtl] .flex-offset-gt-md-30,[dir=rtl] .layout-margin .flex-offset-gt-md-30,[dir=rtl] .layout-margin .offset-gt-md-30{margin-left:auto;margin-right:30%}.offset-gt-md-35,.flex-offset-gt-md-35,.layout-margin .flex-offset-gt-md-35,.layout-margin .offset-gt-md-35{margin-left:35%}[dir=rtl] .offset-gt-md-35,[dir=rtl] .flex-offset-gt-md-35,[dir=rtl] .layout-margin .flex-offset-gt-md-35,[dir=rtl] .layout-margin .offset-gt-md-35{margin-left:auto;margin-right:35%}.offset-gt-md-40,.flex-offset-gt-md-40,.layout-margin .flex-offset-gt-md-40,.layout-margin .offset-gt-md-40{margin-left:40%}[dir=rtl] .offset-gt-md-40,[dir=rtl] .flex-offset-gt-md-40,[dir=rtl] .layout-margin .flex-offset-gt-md-40,[dir=rtl] .layout-margin .offset-gt-md-40{margin-left:auto;margin-right:40%}.offset-gt-md-45,.flex-offset-gt-md-45,.layout-margin .flex-offset-gt-md-45,.layout-margin .offset-gt-md-45{margin-left:45%}[dir=rtl] .offset-gt-md-45,[dir=rtl] .flex-offset-gt-md-45,[dir=rtl] .layout-margin .flex-offset-gt-md-45,[dir=rtl] .layout-margin .offset-gt-md-45{margin-left:auto;margin-right:45%}.offset-gt-md-50,.flex-offset-gt-md-50,.layout-margin .flex-offset-gt-md-50,.layout-margin .offset-gt-md-50{margin-left:50%}[dir=rtl] .offset-gt-md-50,[dir=rtl] .flex-offset-gt-md-50,[dir=rtl] .layout-margin .flex-offset-gt-md-50,[dir=rtl] .layout-margin .offset-gt-md-50{margin-left:auto;margin-right:50%}.offset-gt-md-55,.flex-offset-gt-md-55,.layout-margin .flex-offset-gt-md-55,.layout-margin .offset-gt-md-55{margin-left:55%}[dir=rtl] .offset-gt-md-55,[dir=rtl] .flex-offset-gt-md-55,[dir=rtl] .layout-margin .flex-offset-gt-md-55,[dir=rtl] .layout-margin .offset-gt-md-55{margin-left:auto;margin-right:55%}.offset-gt-md-60,.flex-offset-gt-md-60,.layout-margin .flex-offset-gt-md-60,.layout-margin .offset-gt-md-60{margin-left:60%}[dir=rtl] .offset-gt-md-60,[dir=rtl] .flex-offset-gt-md-60,[dir=rtl] .layout-margin .flex-offset-gt-md-60,[dir=rtl] .layout-margin .offset-gt-md-60{margin-left:auto;margin-right:60%}.offset-gt-md-65,.flex-offset-gt-md-65,.layout-margin .flex-offset-gt-md-65,.layout-margin .offset-gt-md-65{margin-left:65%}[dir=rtl] .offset-gt-md-65,[dir=rtl] .flex-offset-gt-md-65,[dir=rtl] .layout-margin .flex-offset-gt-md-65,[dir=rtl] .layout-margin .offset-gt-md-65{margin-left:auto;margin-right:65%}.offset-gt-md-70,.flex-offset-gt-md-70,.layout-margin .flex-offset-gt-md-70,.layout-margin .offset-gt-md-70{margin-left:70%}[dir=rtl] .offset-gt-md-70,[dir=rtl] .flex-offset-gt-md-70,[dir=rtl] .layout-margin .flex-offset-gt-md-70,[dir=rtl] .layout-margin .offset-gt-md-70{margin-left:auto;margin-right:70%}.offset-gt-md-75,.flex-offset-gt-md-75,.layout-margin .flex-offset-gt-md-75,.layout-margin .offset-gt-md-75{margin-left:75%}[dir=rtl] .offset-gt-md-75,[dir=rtl] .flex-offset-gt-md-75,[dir=rtl] .layout-margin .flex-offset-gt-md-75,[dir=rtl] .layout-margin .offset-gt-md-75{margin-left:auto;margin-right:75%}.offset-gt-md-80,.flex-offset-gt-md-80,.layout-margin .flex-offset-gt-md-80,.layout-margin .offset-gt-md-80{margin-left:80%}[dir=rtl] .offset-gt-md-80,[dir=rtl] .flex-offset-gt-md-80,[dir=rtl] .layout-margin .flex-offset-gt-md-80,[dir=rtl] .layout-margin .offset-gt-md-80{margin-left:auto;margin-right:80%}.offset-gt-md-85,.flex-offset-gt-md-85,.layout-margin .flex-offset-gt-md-85,.layout-margin .offset-gt-md-85{margin-left:85%}[dir=rtl] .offset-gt-md-85,[dir=rtl] .flex-offset-gt-md-85,[dir=rtl] .layout-margin .flex-offset-gt-md-85,[dir=rtl] .layout-margin .offset-gt-md-85{margin-left:auto;margin-right:85%}.offset-gt-md-90,.flex-offset-gt-md-90,.layout-margin .flex-offset-gt-md-90,.layout-margin .offset-gt-md-90{margin-left:90%}[dir=rtl] .offset-gt-md-90,[dir=rtl] .flex-offset-gt-md-90,[dir=rtl] .layout-margin .flex-offset-gt-md-90,[dir=rtl] .layout-margin .offset-gt-md-90{margin-left:auto;margin-right:90%}.offset-gt-md-95,.flex-offset-gt-md-95,.layout-margin .flex-offset-gt-md-95,.layout-margin .offset-gt-md-95{margin-left:95%}[dir=rtl] .offset-gt-md-95,[dir=rtl] .flex-offset-gt-md-95,[dir=rtl] .layout-margin .flex-offset-gt-md-95,[dir=rtl] .layout-margin .offset-gt-md-95{margin-left:auto;margin-right:95%}.offset-gt-md-33,.flex-offset-gt-md-33,.layout-margin .flex-offset-gt-md-33,.layout-margin .offset-gt-md-33{margin-left:33.3333333333%}.offset-gt-md-66,.flex-offset-gt-md-66,.layout-margin .flex-offset-gt-md-66,.layout-margin .offset-gt-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-md-66,[dir=rtl] .flex-offset-gt-md-66,[dir=rtl] .layout-margin .flex-offset-gt-md-66,[dir=rtl] .layout-margin .offset-gt-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-md,.layout-align-gt-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-md-start,.layout-align-gt-md-start-start,.layout-align-gt-md-start-center,.layout-align-gt-md-start-end,.layout-align-gt-md-start-stretch{justify-content:flex-start}.layout-align-gt-md-center,.layout-align-gt-md-center-start,.layout-align-gt-md-center-center,.layout-align-gt-md-center-end,.layout-align-gt-md-center-stretch{justify-content:center}.layout-align-gt-md-end,.layout-align-gt-md-end-start,.layout-align-gt-md-end-center,.layout-align-gt-md-end-end,.layout-align-gt-md-end-stretch{justify-content:flex-end}.layout-align-gt-md-space-around,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-around-stretch{justify-content:space-around}.layout-align-gt-md-space-between,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-between-stretch{justify-content:space-between}.layout-align-gt-md-start-start,.layout-align-gt-md-center-start,.layout-align-gt-md-end-start,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-md-start-center,.layout-align-gt-md-center-center,.layout-align-gt-md-end-center,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-md-start-center>*,.layout-align-gt-md-center-center>*,.layout-align-gt-md-end-center>*,.layout-align-gt-md-space-between-center>*,.layout-align-gt-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-md-start-end,.layout-align-gt-md-center-end,.layout-align-gt-md-end-end,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-md-start-stretch,.layout-align-gt-md-center-stretch,.layout-align-gt-md-end-stretch,.layout-align-gt-md-space-between-stretch,.layout-align-gt-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-md{flex:1;box-sizing:border-box}.flex-gt-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-md-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-md-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex{min-width:0}.layout-gt-md-column>.flex-gt-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-column>.flex{min-height:0}.layout-gt-md,.layout-gt-md-column,.layout-gt-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-md-column{flex-direction:column}.layout-gt-md-row{flex-direction:row}}@media(min-width: 1280px)and (max-width: 1919px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show){display:none}.hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-lg--20{order:-20}.flex-order-lg--19{order:-19}.flex-order-lg--18{order:-18}.flex-order-lg--17{order:-17}.flex-order-lg--16{order:-16}.flex-order-lg--15{order:-15}.flex-order-lg--14{order:-14}.flex-order-lg--13{order:-13}.flex-order-lg--12{order:-12}.flex-order-lg--11{order:-11}.flex-order-lg--10{order:-10}.flex-order-lg--9{order:-9}.flex-order-lg--8{order:-8}.flex-order-lg--7{order:-7}.flex-order-lg--6{order:-6}.flex-order-lg--5{order:-5}.flex-order-lg--4{order:-4}.flex-order-lg--3{order:-3}.flex-order-lg--2{order:-2}.flex-order-lg--1{order:-1}.flex-order-lg-0{order:0}.flex-order-lg-1{order:1}.flex-order-lg-2{order:2}.flex-order-lg-3{order:3}.flex-order-lg-4{order:4}.flex-order-lg-5{order:5}.flex-order-lg-6{order:6}.flex-order-lg-7{order:7}.flex-order-lg-8{order:8}.flex-order-lg-9{order:9}.flex-order-lg-10{order:10}.flex-order-lg-11{order:11}.flex-order-lg-12{order:12}.flex-order-lg-13{order:13}.flex-order-lg-14{order:14}.flex-order-lg-15{order:15}.flex-order-lg-16{order:16}.flex-order-lg-17{order:17}.flex-order-lg-18{order:18}.flex-order-lg-19{order:19}.flex-order-lg-20{order:20}.offset-lg-0,.flex-offset-lg-0,.layout-margin .flex-offset-lg-0,.layout-margin .offset-lg-0{margin-left:0}[dir=rtl] .offset-lg-0,[dir=rtl] .flex-offset-lg-0,[dir=rtl] .layout-margin .flex-offset-lg-0,[dir=rtl] .layout-margin .offset-lg-0{margin-left:auto;margin-right:0}.offset-lg-5,.flex-offset-lg-5,.layout-margin .flex-offset-lg-5,.layout-margin .offset-lg-5{margin-left:5%}[dir=rtl] .offset-lg-5,[dir=rtl] .flex-offset-lg-5,[dir=rtl] .layout-margin .flex-offset-lg-5,[dir=rtl] .layout-margin .offset-lg-5{margin-left:auto;margin-right:5%}.offset-lg-10,.flex-offset-lg-10,.layout-margin .flex-offset-lg-10,.layout-margin .offset-lg-10{margin-left:10%}[dir=rtl] .offset-lg-10,[dir=rtl] .flex-offset-lg-10,[dir=rtl] .layout-margin .flex-offset-lg-10,[dir=rtl] .layout-margin .offset-lg-10{margin-left:auto;margin-right:10%}.offset-lg-15,.flex-offset-lg-15,.layout-margin .flex-offset-lg-15,.layout-margin .offset-lg-15{margin-left:15%}[dir=rtl] .offset-lg-15,[dir=rtl] .flex-offset-lg-15,[dir=rtl] .layout-margin .flex-offset-lg-15,[dir=rtl] .layout-margin .offset-lg-15{margin-left:auto;margin-right:15%}.offset-lg-20,.flex-offset-lg-20,.layout-margin .flex-offset-lg-20,.layout-margin .offset-lg-20{margin-left:20%}[dir=rtl] .offset-lg-20,[dir=rtl] .flex-offset-lg-20,[dir=rtl] .layout-margin .flex-offset-lg-20,[dir=rtl] .layout-margin .offset-lg-20{margin-left:auto;margin-right:20%}.offset-lg-25,.flex-offset-lg-25,.layout-margin .flex-offset-lg-25,.layout-margin .offset-lg-25{margin-left:25%}[dir=rtl] .offset-lg-25,[dir=rtl] .flex-offset-lg-25,[dir=rtl] .layout-margin .flex-offset-lg-25,[dir=rtl] .layout-margin .offset-lg-25{margin-left:auto;margin-right:25%}.offset-lg-30,.flex-offset-lg-30,.layout-margin .flex-offset-lg-30,.layout-margin .offset-lg-30{margin-left:30%}[dir=rtl] .offset-lg-30,[dir=rtl] .flex-offset-lg-30,[dir=rtl] .layout-margin .flex-offset-lg-30,[dir=rtl] .layout-margin .offset-lg-30{margin-left:auto;margin-right:30%}.offset-lg-35,.flex-offset-lg-35,.layout-margin .flex-offset-lg-35,.layout-margin .offset-lg-35{margin-left:35%}[dir=rtl] .offset-lg-35,[dir=rtl] .flex-offset-lg-35,[dir=rtl] .layout-margin .flex-offset-lg-35,[dir=rtl] .layout-margin .offset-lg-35{margin-left:auto;margin-right:35%}.offset-lg-40,.flex-offset-lg-40,.layout-margin .flex-offset-lg-40,.layout-margin .offset-lg-40{margin-left:40%}[dir=rtl] .offset-lg-40,[dir=rtl] .flex-offset-lg-40,[dir=rtl] .layout-margin .flex-offset-lg-40,[dir=rtl] .layout-margin .offset-lg-40{margin-left:auto;margin-right:40%}.offset-lg-45,.flex-offset-lg-45,.layout-margin .flex-offset-lg-45,.layout-margin .offset-lg-45{margin-left:45%}[dir=rtl] .offset-lg-45,[dir=rtl] .flex-offset-lg-45,[dir=rtl] .layout-margin .flex-offset-lg-45,[dir=rtl] .layout-margin .offset-lg-45{margin-left:auto;margin-right:45%}.offset-lg-50,.flex-offset-lg-50,.layout-margin .flex-offset-lg-50,.layout-margin .offset-lg-50{margin-left:50%}[dir=rtl] .offset-lg-50,[dir=rtl] .flex-offset-lg-50,[dir=rtl] .layout-margin .flex-offset-lg-50,[dir=rtl] .layout-margin .offset-lg-50{margin-left:auto;margin-right:50%}.offset-lg-55,.flex-offset-lg-55,.layout-margin .flex-offset-lg-55,.layout-margin .offset-lg-55{margin-left:55%}[dir=rtl] .offset-lg-55,[dir=rtl] .flex-offset-lg-55,[dir=rtl] .layout-margin .flex-offset-lg-55,[dir=rtl] .layout-margin .offset-lg-55{margin-left:auto;margin-right:55%}.offset-lg-60,.flex-offset-lg-60,.layout-margin .flex-offset-lg-60,.layout-margin .offset-lg-60{margin-left:60%}[dir=rtl] .offset-lg-60,[dir=rtl] .flex-offset-lg-60,[dir=rtl] .layout-margin .flex-offset-lg-60,[dir=rtl] .layout-margin .offset-lg-60{margin-left:auto;margin-right:60%}.offset-lg-65,.flex-offset-lg-65,.layout-margin .flex-offset-lg-65,.layout-margin .offset-lg-65{margin-left:65%}[dir=rtl] .offset-lg-65,[dir=rtl] .flex-offset-lg-65,[dir=rtl] .layout-margin .flex-offset-lg-65,[dir=rtl] .layout-margin .offset-lg-65{margin-left:auto;margin-right:65%}.offset-lg-70,.flex-offset-lg-70,.layout-margin .flex-offset-lg-70,.layout-margin .offset-lg-70{margin-left:70%}[dir=rtl] .offset-lg-70,[dir=rtl] .flex-offset-lg-70,[dir=rtl] .layout-margin .flex-offset-lg-70,[dir=rtl] .layout-margin .offset-lg-70{margin-left:auto;margin-right:70%}.offset-lg-75,.flex-offset-lg-75,.layout-margin .flex-offset-lg-75,.layout-margin .offset-lg-75{margin-left:75%}[dir=rtl] .offset-lg-75,[dir=rtl] .flex-offset-lg-75,[dir=rtl] .layout-margin .flex-offset-lg-75,[dir=rtl] .layout-margin .offset-lg-75{margin-left:auto;margin-right:75%}.offset-lg-80,.flex-offset-lg-80,.layout-margin .flex-offset-lg-80,.layout-margin .offset-lg-80{margin-left:80%}[dir=rtl] .offset-lg-80,[dir=rtl] .flex-offset-lg-80,[dir=rtl] .layout-margin .flex-offset-lg-80,[dir=rtl] .layout-margin .offset-lg-80{margin-left:auto;margin-right:80%}.offset-lg-85,.flex-offset-lg-85,.layout-margin .flex-offset-lg-85,.layout-margin .offset-lg-85{margin-left:85%}[dir=rtl] .offset-lg-85,[dir=rtl] .flex-offset-lg-85,[dir=rtl] .layout-margin .flex-offset-lg-85,[dir=rtl] .layout-margin .offset-lg-85{margin-left:auto;margin-right:85%}.offset-lg-90,.flex-offset-lg-90,.layout-margin .flex-offset-lg-90,.layout-margin .offset-lg-90{margin-left:90%}[dir=rtl] .offset-lg-90,[dir=rtl] .flex-offset-lg-90,[dir=rtl] .layout-margin .flex-offset-lg-90,[dir=rtl] .layout-margin .offset-lg-90{margin-left:auto;margin-right:90%}.offset-lg-95,.flex-offset-lg-95,.layout-margin .flex-offset-lg-95,.layout-margin .offset-lg-95{margin-left:95%}[dir=rtl] .offset-lg-95,[dir=rtl] .flex-offset-lg-95,[dir=rtl] .layout-margin .flex-offset-lg-95,[dir=rtl] .layout-margin .offset-lg-95{margin-left:auto;margin-right:95%}.offset-lg-33,.flex-offset-lg-33,.layout-margin .flex-offset-lg-33,.layout-margin .offset-lg-33{margin-left:33.3333333333%}.offset-lg-66,.flex-offset-lg-66,.layout-margin .flex-offset-lg-66,.layout-margin .offset-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-lg-66,[dir=rtl] .flex-offset-lg-66,[dir=rtl] .layout-margin .flex-offset-lg-66,[dir=rtl] .layout-margin .offset-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-lg,.layout-align-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-lg-start,.layout-align-lg-start-start,.layout-align-lg-start-center,.layout-align-lg-start-end,.layout-align-lg-start-stretch{justify-content:flex-start}.layout-align-lg-center,.layout-align-lg-center-start,.layout-align-lg-center-center,.layout-align-lg-center-end,.layout-align-lg-center-stretch{justify-content:center}.layout-align-lg-end,.layout-align-lg-end-start,.layout-align-lg-end-center,.layout-align-lg-end-end,.layout-align-lg-end-stretch{justify-content:flex-end}.layout-align-lg-space-around,.layout-align-lg-space-around-center,.layout-align-lg-space-around-start,.layout-align-lg-space-around-end,.layout-align-lg-space-around-stretch{justify-content:space-around}.layout-align-lg-space-between,.layout-align-lg-space-between-center,.layout-align-lg-space-between-start,.layout-align-lg-space-between-end,.layout-align-lg-space-between-stretch{justify-content:space-between}.layout-align-lg-start-start,.layout-align-lg-center-start,.layout-align-lg-end-start,.layout-align-lg-space-between-start,.layout-align-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-lg-start-center,.layout-align-lg-center-center,.layout-align-lg-end-center,.layout-align-lg-space-between-center,.layout-align-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-lg-start-center>*,.layout-align-lg-center-center>*,.layout-align-lg-end-center>*,.layout-align-lg-space-between-center>*,.layout-align-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-lg-start-end,.layout-align-lg-center-end,.layout-align-lg-end-end,.layout-align-lg-space-between-end,.layout-align-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-lg-start-stretch,.layout-align-lg-center-stretch,.layout-align-lg-end-stretch,.layout-align-lg-space-between-stretch,.layout-align-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-lg{flex:1;box-sizing:border-box}.flex-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-lg-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-lg-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-lg-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-lg-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-lg-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-lg-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-lg-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-lg-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-lg-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-lg-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-lg-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-lg-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-lg-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-lg-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-lg-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-lg-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-lg-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-lg-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-lg-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-lg-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-lg-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex{min-width:0}.layout-lg-column>.flex-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-lg-column>.flex-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-column>.flex{min-height:0}.layout-lg,.layout-lg-column,.layout-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-lg-column{flex-direction:column}.layout-lg-row{flex-direction:row}}@media(min-width: 1920px){.flex-order-gt-lg--20{order:-20}.flex-order-gt-lg--19{order:-19}.flex-order-gt-lg--18{order:-18}.flex-order-gt-lg--17{order:-17}.flex-order-gt-lg--16{order:-16}.flex-order-gt-lg--15{order:-15}.flex-order-gt-lg--14{order:-14}.flex-order-gt-lg--13{order:-13}.flex-order-gt-lg--12{order:-12}.flex-order-gt-lg--11{order:-11}.flex-order-gt-lg--10{order:-10}.flex-order-gt-lg--9{order:-9}.flex-order-gt-lg--8{order:-8}.flex-order-gt-lg--7{order:-7}.flex-order-gt-lg--6{order:-6}.flex-order-gt-lg--5{order:-5}.flex-order-gt-lg--4{order:-4}.flex-order-gt-lg--3{order:-3}.flex-order-gt-lg--2{order:-2}.flex-order-gt-lg--1{order:-1}.flex-order-gt-lg-0{order:0}.flex-order-gt-lg-1{order:1}.flex-order-gt-lg-2{order:2}.flex-order-gt-lg-3{order:3}.flex-order-gt-lg-4{order:4}.flex-order-gt-lg-5{order:5}.flex-order-gt-lg-6{order:6}.flex-order-gt-lg-7{order:7}.flex-order-gt-lg-8{order:8}.flex-order-gt-lg-9{order:9}.flex-order-gt-lg-10{order:10}.flex-order-gt-lg-11{order:11}.flex-order-gt-lg-12{order:12}.flex-order-gt-lg-13{order:13}.flex-order-gt-lg-14{order:14}.flex-order-gt-lg-15{order:15}.flex-order-gt-lg-16{order:16}.flex-order-gt-lg-17{order:17}.flex-order-gt-lg-18{order:18}.flex-order-gt-lg-19{order:19}.flex-order-gt-lg-20{order:20}.offset-gt-lg-0,.flex-offset-gt-lg-0,.layout-margin .flex-offset-gt-lg-0,.layout-margin .offset-gt-lg-0{margin-left:0}[dir=rtl] .offset-gt-lg-0,[dir=rtl] .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .offset-gt-lg-0{margin-left:auto;margin-right:0}.offset-gt-lg-5,.flex-offset-gt-lg-5,.layout-margin .flex-offset-gt-lg-5,.layout-margin .offset-gt-lg-5{margin-left:5%}[dir=rtl] .offset-gt-lg-5,[dir=rtl] .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .offset-gt-lg-5{margin-left:auto;margin-right:5%}.offset-gt-lg-10,.flex-offset-gt-lg-10,.layout-margin .flex-offset-gt-lg-10,.layout-margin .offset-gt-lg-10{margin-left:10%}[dir=rtl] .offset-gt-lg-10,[dir=rtl] .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .offset-gt-lg-10{margin-left:auto;margin-right:10%}.offset-gt-lg-15,.flex-offset-gt-lg-15,.layout-margin .flex-offset-gt-lg-15,.layout-margin .offset-gt-lg-15{margin-left:15%}[dir=rtl] .offset-gt-lg-15,[dir=rtl] .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .offset-gt-lg-15{margin-left:auto;margin-right:15%}.offset-gt-lg-20,.flex-offset-gt-lg-20,.layout-margin .flex-offset-gt-lg-20,.layout-margin .offset-gt-lg-20{margin-left:20%}[dir=rtl] .offset-gt-lg-20,[dir=rtl] .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .offset-gt-lg-20{margin-left:auto;margin-right:20%}.offset-gt-lg-25,.flex-offset-gt-lg-25,.layout-margin .flex-offset-gt-lg-25,.layout-margin .offset-gt-lg-25{margin-left:25%}[dir=rtl] .offset-gt-lg-25,[dir=rtl] .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .offset-gt-lg-25{margin-left:auto;margin-right:25%}.offset-gt-lg-30,.flex-offset-gt-lg-30,.layout-margin .flex-offset-gt-lg-30,.layout-margin .offset-gt-lg-30{margin-left:30%}[dir=rtl] .offset-gt-lg-30,[dir=rtl] .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .offset-gt-lg-30{margin-left:auto;margin-right:30%}.offset-gt-lg-35,.flex-offset-gt-lg-35,.layout-margin .flex-offset-gt-lg-35,.layout-margin .offset-gt-lg-35{margin-left:35%}[dir=rtl] .offset-gt-lg-35,[dir=rtl] .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .offset-gt-lg-35{margin-left:auto;margin-right:35%}.offset-gt-lg-40,.flex-offset-gt-lg-40,.layout-margin .flex-offset-gt-lg-40,.layout-margin .offset-gt-lg-40{margin-left:40%}[dir=rtl] .offset-gt-lg-40,[dir=rtl] .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .offset-gt-lg-40{margin-left:auto;margin-right:40%}.offset-gt-lg-45,.flex-offset-gt-lg-45,.layout-margin .flex-offset-gt-lg-45,.layout-margin .offset-gt-lg-45{margin-left:45%}[dir=rtl] .offset-gt-lg-45,[dir=rtl] .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .offset-gt-lg-45{margin-left:auto;margin-right:45%}.offset-gt-lg-50,.flex-offset-gt-lg-50,.layout-margin .flex-offset-gt-lg-50,.layout-margin .offset-gt-lg-50{margin-left:50%}[dir=rtl] .offset-gt-lg-50,[dir=rtl] .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .offset-gt-lg-50{margin-left:auto;margin-right:50%}.offset-gt-lg-55,.flex-offset-gt-lg-55,.layout-margin .flex-offset-gt-lg-55,.layout-margin .offset-gt-lg-55{margin-left:55%}[dir=rtl] .offset-gt-lg-55,[dir=rtl] .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .offset-gt-lg-55{margin-left:auto;margin-right:55%}.offset-gt-lg-60,.flex-offset-gt-lg-60,.layout-margin .flex-offset-gt-lg-60,.layout-margin .offset-gt-lg-60{margin-left:60%}[dir=rtl] .offset-gt-lg-60,[dir=rtl] .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .offset-gt-lg-60{margin-left:auto;margin-right:60%}.offset-gt-lg-65,.flex-offset-gt-lg-65,.layout-margin .flex-offset-gt-lg-65,.layout-margin .offset-gt-lg-65{margin-left:65%}[dir=rtl] .offset-gt-lg-65,[dir=rtl] .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .offset-gt-lg-65{margin-left:auto;margin-right:65%}.offset-gt-lg-70,.flex-offset-gt-lg-70,.layout-margin .flex-offset-gt-lg-70,.layout-margin .offset-gt-lg-70{margin-left:70%}[dir=rtl] .offset-gt-lg-70,[dir=rtl] .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .offset-gt-lg-70{margin-left:auto;margin-right:70%}.offset-gt-lg-75,.flex-offset-gt-lg-75,.layout-margin .flex-offset-gt-lg-75,.layout-margin .offset-gt-lg-75{margin-left:75%}[dir=rtl] .offset-gt-lg-75,[dir=rtl] .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .offset-gt-lg-75{margin-left:auto;margin-right:75%}.offset-gt-lg-80,.flex-offset-gt-lg-80,.layout-margin .flex-offset-gt-lg-80,.layout-margin .offset-gt-lg-80{margin-left:80%}[dir=rtl] .offset-gt-lg-80,[dir=rtl] .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .offset-gt-lg-80{margin-left:auto;margin-right:80%}.offset-gt-lg-85,.flex-offset-gt-lg-85,.layout-margin .flex-offset-gt-lg-85,.layout-margin .offset-gt-lg-85{margin-left:85%}[dir=rtl] .offset-gt-lg-85,[dir=rtl] .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .offset-gt-lg-85{margin-left:auto;margin-right:85%}.offset-gt-lg-90,.flex-offset-gt-lg-90,.layout-margin .flex-offset-gt-lg-90,.layout-margin .offset-gt-lg-90{margin-left:90%}[dir=rtl] .offset-gt-lg-90,[dir=rtl] .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .offset-gt-lg-90{margin-left:auto;margin-right:90%}.offset-gt-lg-95,.flex-offset-gt-lg-95,.layout-margin .flex-offset-gt-lg-95,.layout-margin .offset-gt-lg-95{margin-left:95%}[dir=rtl] .offset-gt-lg-95,[dir=rtl] .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .offset-gt-lg-95{margin-left:auto;margin-right:95%}.offset-gt-lg-33,.flex-offset-gt-lg-33,.layout-margin .flex-offset-gt-lg-33,.layout-margin .offset-gt-lg-33{margin-left:33.3333333333%}.offset-gt-lg-66,.flex-offset-gt-lg-66,.layout-margin .flex-offset-gt-lg-66,.layout-margin .offset-gt-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-lg-66,[dir=rtl] .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .offset-gt-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-lg,.layout-align-gt-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-lg-start,.layout-align-gt-lg-start-start,.layout-align-gt-lg-start-center,.layout-align-gt-lg-start-end,.layout-align-gt-lg-start-stretch{justify-content:flex-start}.layout-align-gt-lg-center,.layout-align-gt-lg-center-start,.layout-align-gt-lg-center-center,.layout-align-gt-lg-center-end,.layout-align-gt-lg-center-stretch{justify-content:center}.layout-align-gt-lg-end,.layout-align-gt-lg-end-start,.layout-align-gt-lg-end-center,.layout-align-gt-lg-end-end,.layout-align-gt-lg-end-stretch{justify-content:flex-end}.layout-align-gt-lg-space-around,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-around-stretch{justify-content:space-around}.layout-align-gt-lg-space-between,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-between-stretch{justify-content:space-between}.layout-align-gt-lg-start-start,.layout-align-gt-lg-center-start,.layout-align-gt-lg-end-start,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-lg-start-center,.layout-align-gt-lg-center-center,.layout-align-gt-lg-end-center,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-lg-start-center>*,.layout-align-gt-lg-center-center>*,.layout-align-gt-lg-end-center>*,.layout-align-gt-lg-space-between-center>*,.layout-align-gt-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-lg-start-end,.layout-align-gt-lg-center-end,.layout-align-gt-lg-end-end,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-lg-start-stretch,.layout-align-gt-lg-center-stretch,.layout-align-gt-lg-end-stretch,.layout-align-gt-lg-space-between-stretch,.layout-align-gt-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-lg{flex:1;box-sizing:border-box}.flex-gt-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-lg-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex{min-width:0}.layout-gt-lg-column>.flex-gt-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-column>.flex{min-height:0}.layout-gt-lg,.layout-gt-lg-column,.layout-gt-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-lg-column{flex-direction:column}.layout-gt-lg-row{flex-direction:row}.flex-order-xl--20{order:-20}.flex-order-xl--19{order:-19}.flex-order-xl--18{order:-18}.flex-order-xl--17{order:-17}.flex-order-xl--16{order:-16}.flex-order-xl--15{order:-15}.flex-order-xl--14{order:-14}.flex-order-xl--13{order:-13}.flex-order-xl--12{order:-12}.flex-order-xl--11{order:-11}.flex-order-xl--10{order:-10}.flex-order-xl--9{order:-9}.flex-order-xl--8{order:-8}.flex-order-xl--7{order:-7}.flex-order-xl--6{order:-6}.flex-order-xl--5{order:-5}.flex-order-xl--4{order:-4}.flex-order-xl--3{order:-3}.flex-order-xl--2{order:-2}.flex-order-xl--1{order:-1}.flex-order-xl-0{order:0}.flex-order-xl-1{order:1}.flex-order-xl-2{order:2}.flex-order-xl-3{order:3}.flex-order-xl-4{order:4}.flex-order-xl-5{order:5}.flex-order-xl-6{order:6}.flex-order-xl-7{order:7}.flex-order-xl-8{order:8}.flex-order-xl-9{order:9}.flex-order-xl-10{order:10}.flex-order-xl-11{order:11}.flex-order-xl-12{order:12}.flex-order-xl-13{order:13}.flex-order-xl-14{order:14}.flex-order-xl-15{order:15}.flex-order-xl-16{order:16}.flex-order-xl-17{order:17}.flex-order-xl-18{order:18}.flex-order-xl-19{order:19}.flex-order-xl-20{order:20}.offset-xl-0,.flex-offset-xl-0,.layout-margin .flex-offset-xl-0,.layout-margin .offset-xl-0{margin-left:0}[dir=rtl] .offset-xl-0,[dir=rtl] .flex-offset-xl-0,[dir=rtl] .layout-margin .flex-offset-xl-0,[dir=rtl] .layout-margin .offset-xl-0{margin-left:auto;margin-right:0}.offset-xl-5,.flex-offset-xl-5,.layout-margin .flex-offset-xl-5,.layout-margin .offset-xl-5{margin-left:5%}[dir=rtl] .offset-xl-5,[dir=rtl] .flex-offset-xl-5,[dir=rtl] .layout-margin .flex-offset-xl-5,[dir=rtl] .layout-margin .offset-xl-5{margin-left:auto;margin-right:5%}.offset-xl-10,.flex-offset-xl-10,.layout-margin .flex-offset-xl-10,.layout-margin .offset-xl-10{margin-left:10%}[dir=rtl] .offset-xl-10,[dir=rtl] .flex-offset-xl-10,[dir=rtl] .layout-margin .flex-offset-xl-10,[dir=rtl] .layout-margin .offset-xl-10{margin-left:auto;margin-right:10%}.offset-xl-15,.flex-offset-xl-15,.layout-margin .flex-offset-xl-15,.layout-margin .offset-xl-15{margin-left:15%}[dir=rtl] .offset-xl-15,[dir=rtl] .flex-offset-xl-15,[dir=rtl] .layout-margin .flex-offset-xl-15,[dir=rtl] .layout-margin .offset-xl-15{margin-left:auto;margin-right:15%}.offset-xl-20,.flex-offset-xl-20,.layout-margin .flex-offset-xl-20,.layout-margin .offset-xl-20{margin-left:20%}[dir=rtl] .offset-xl-20,[dir=rtl] .flex-offset-xl-20,[dir=rtl] .layout-margin .flex-offset-xl-20,[dir=rtl] .layout-margin .offset-xl-20{margin-left:auto;margin-right:20%}.offset-xl-25,.flex-offset-xl-25,.layout-margin .flex-offset-xl-25,.layout-margin .offset-xl-25{margin-left:25%}[dir=rtl] .offset-xl-25,[dir=rtl] .flex-offset-xl-25,[dir=rtl] .layout-margin .flex-offset-xl-25,[dir=rtl] .layout-margin .offset-xl-25{margin-left:auto;margin-right:25%}.offset-xl-30,.flex-offset-xl-30,.layout-margin .flex-offset-xl-30,.layout-margin .offset-xl-30{margin-left:30%}[dir=rtl] .offset-xl-30,[dir=rtl] .flex-offset-xl-30,[dir=rtl] .layout-margin .flex-offset-xl-30,[dir=rtl] .layout-margin .offset-xl-30{margin-left:auto;margin-right:30%}.offset-xl-35,.flex-offset-xl-35,.layout-margin .flex-offset-xl-35,.layout-margin .offset-xl-35{margin-left:35%}[dir=rtl] .offset-xl-35,[dir=rtl] .flex-offset-xl-35,[dir=rtl] .layout-margin .flex-offset-xl-35,[dir=rtl] .layout-margin .offset-xl-35{margin-left:auto;margin-right:35%}.offset-xl-40,.flex-offset-xl-40,.layout-margin .flex-offset-xl-40,.layout-margin .offset-xl-40{margin-left:40%}[dir=rtl] .offset-xl-40,[dir=rtl] .flex-offset-xl-40,[dir=rtl] .layout-margin .flex-offset-xl-40,[dir=rtl] .layout-margin .offset-xl-40{margin-left:auto;margin-right:40%}.offset-xl-45,.flex-offset-xl-45,.layout-margin .flex-offset-xl-45,.layout-margin .offset-xl-45{margin-left:45%}[dir=rtl] .offset-xl-45,[dir=rtl] .flex-offset-xl-45,[dir=rtl] .layout-margin .flex-offset-xl-45,[dir=rtl] .layout-margin .offset-xl-45{margin-left:auto;margin-right:45%}.offset-xl-50,.flex-offset-xl-50,.layout-margin .flex-offset-xl-50,.layout-margin .offset-xl-50{margin-left:50%}[dir=rtl] .offset-xl-50,[dir=rtl] .flex-offset-xl-50,[dir=rtl] .layout-margin .flex-offset-xl-50,[dir=rtl] .layout-margin .offset-xl-50{margin-left:auto;margin-right:50%}.offset-xl-55,.flex-offset-xl-55,.layout-margin .flex-offset-xl-55,.layout-margin .offset-xl-55{margin-left:55%}[dir=rtl] .offset-xl-55,[dir=rtl] .flex-offset-xl-55,[dir=rtl] .layout-margin .flex-offset-xl-55,[dir=rtl] .layout-margin .offset-xl-55{margin-left:auto;margin-right:55%}.offset-xl-60,.flex-offset-xl-60,.layout-margin .flex-offset-xl-60,.layout-margin .offset-xl-60{margin-left:60%}[dir=rtl] .offset-xl-60,[dir=rtl] .flex-offset-xl-60,[dir=rtl] .layout-margin .flex-offset-xl-60,[dir=rtl] .layout-margin .offset-xl-60{margin-left:auto;margin-right:60%}.offset-xl-65,.flex-offset-xl-65,.layout-margin .flex-offset-xl-65,.layout-margin .offset-xl-65{margin-left:65%}[dir=rtl] .offset-xl-65,[dir=rtl] .flex-offset-xl-65,[dir=rtl] .layout-margin .flex-offset-xl-65,[dir=rtl] .layout-margin .offset-xl-65{margin-left:auto;margin-right:65%}.offset-xl-70,.flex-offset-xl-70,.layout-margin .flex-offset-xl-70,.layout-margin .offset-xl-70{margin-left:70%}[dir=rtl] .offset-xl-70,[dir=rtl] .flex-offset-xl-70,[dir=rtl] .layout-margin .flex-offset-xl-70,[dir=rtl] .layout-margin .offset-xl-70{margin-left:auto;margin-right:70%}.offset-xl-75,.flex-offset-xl-75,.layout-margin .flex-offset-xl-75,.layout-margin .offset-xl-75{margin-left:75%}[dir=rtl] .offset-xl-75,[dir=rtl] .flex-offset-xl-75,[dir=rtl] .layout-margin .flex-offset-xl-75,[dir=rtl] .layout-margin .offset-xl-75{margin-left:auto;margin-right:75%}.offset-xl-80,.flex-offset-xl-80,.layout-margin .flex-offset-xl-80,.layout-margin .offset-xl-80{margin-left:80%}[dir=rtl] .offset-xl-80,[dir=rtl] .flex-offset-xl-80,[dir=rtl] .layout-margin .flex-offset-xl-80,[dir=rtl] .layout-margin .offset-xl-80{margin-left:auto;margin-right:80%}.offset-xl-85,.flex-offset-xl-85,.layout-margin .flex-offset-xl-85,.layout-margin .offset-xl-85{margin-left:85%}[dir=rtl] .offset-xl-85,[dir=rtl] .flex-offset-xl-85,[dir=rtl] .layout-margin .flex-offset-xl-85,[dir=rtl] .layout-margin .offset-xl-85{margin-left:auto;margin-right:85%}.offset-xl-90,.flex-offset-xl-90,.layout-margin .flex-offset-xl-90,.layout-margin .offset-xl-90{margin-left:90%}[dir=rtl] .offset-xl-90,[dir=rtl] .flex-offset-xl-90,[dir=rtl] .layout-margin .flex-offset-xl-90,[dir=rtl] .layout-margin .offset-xl-90{margin-left:auto;margin-right:90%}.offset-xl-95,.flex-offset-xl-95,.layout-margin .flex-offset-xl-95,.layout-margin .offset-xl-95{margin-left:95%}[dir=rtl] .offset-xl-95,[dir=rtl] .flex-offset-xl-95,[dir=rtl] .layout-margin .flex-offset-xl-95,[dir=rtl] .layout-margin .offset-xl-95{margin-left:auto;margin-right:95%}.offset-xl-33,.flex-offset-xl-33,.layout-margin .flex-offset-xl-33,.layout-margin .offset-xl-33{margin-left:33.3333333333%}.offset-xl-66,.flex-offset-xl-66,.layout-margin .flex-offset-xl-66,.layout-margin .offset-xl-66{margin-left:66.6666666667%}[dir=rtl] .offset-xl-66,[dir=rtl] .flex-offset-xl-66,[dir=rtl] .layout-margin .flex-offset-xl-66,[dir=rtl] .layout-margin .offset-xl-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xl,.layout-align-xl-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xl-start,.layout-align-xl-start-start,.layout-align-xl-start-center,.layout-align-xl-start-end,.layout-align-xl-start-stretch{justify-content:flex-start}.layout-align-xl-center,.layout-align-xl-center-start,.layout-align-xl-center-center,.layout-align-xl-center-end,.layout-align-xl-center-stretch{justify-content:center}.layout-align-xl-end,.layout-align-xl-end-start,.layout-align-xl-end-center,.layout-align-xl-end-end,.layout-align-xl-end-stretch{justify-content:flex-end}.layout-align-xl-space-around,.layout-align-xl-space-around-center,.layout-align-xl-space-around-start,.layout-align-xl-space-around-end,.layout-align-xl-space-around-stretch{justify-content:space-around}.layout-align-xl-space-between,.layout-align-xl-space-between-center,.layout-align-xl-space-between-start,.layout-align-xl-space-between-end,.layout-align-xl-space-between-stretch{justify-content:space-between}.layout-align-xl-start-start,.layout-align-xl-center-start,.layout-align-xl-end-start,.layout-align-xl-space-between-start,.layout-align-xl-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xl-start-center,.layout-align-xl-center-center,.layout-align-xl-end-center,.layout-align-xl-space-between-center,.layout-align-xl-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xl-start-center>*,.layout-align-xl-center-center>*,.layout-align-xl-end-center>*,.layout-align-xl-space-between-center>*,.layout-align-xl-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xl-start-end,.layout-align-xl-center-end,.layout-align-xl-end-end,.layout-align-xl-space-between-end,.layout-align-xl-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xl-start-stretch,.layout-align-xl-center-stretch,.layout-align-xl-end-stretch,.layout-align-xl-space-between-stretch,.layout-align-xl-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xl{flex:1;box-sizing:border-box}.flex-xl-grow{flex:1 1 100%;box-sizing:border-box}.flex-xl-initial{flex:0 1 auto;box-sizing:border-box}.flex-xl-auto{flex:1 1 auto;box-sizing:border-box}.flex-xl-none{flex:0 0 auto;box-sizing:border-box}.flex-xl-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xl-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xl-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xl-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xl-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xl-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xl-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xl-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xl-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xl-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xl-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xl-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xl-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xl-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xl-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xl-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xl-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xl-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xl-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xl-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xl-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xl-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xl-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex{min-width:0}.layout-xl-column>.flex-xl-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xl-column>.flex-xl-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-column>.flex{min-height:0}.layout-xl,.layout-xl-column,.layout-xl-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xl-column{flex-direction:column}.layout-xl-row{flex-direction:row}.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-lg:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show){display:none}.hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}}@media print{.hide-print:not(.show-print):not(.show){display:none !important}}:root{--xc-ws-div-color: #011f6a;--xc-ws-text-color: #ffffff;--xc-ws-text-button-color: #ffffff;--xc-ws-button-color: #011f6a;--xc-ws-background-color: #fafafa;--xc-ws-client-height: 450px;--xc-ws-client-width: 295px}span.ng-binding,span.field-description{user-select:none}.centered-text{text-align:center}::-webkit-scrollbar{width:0;background:transparent}::-webkit-scrollbar-thumb{background:transparent;border-radius:0px}.field-description{font-size:13px;line-height:14px;color:gray;padding:5px 0px 5px 0px}.field-description.error{color:#dd2c00}.md-button.upload-button{padding:0 16px;height:36px}md-icon.material-icons{color:inherit !important}.white-label,.md-toolbar-tools .title{user-select:none}.white-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.white-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md-fab.upload-button,.md-fab.upload-button.md-button.md-default-theme.md-raised:not([disabled]) md-icon,.md-fab.upload-button.md-button.md-raised:not([disabled]) md-icon{color:var(--xc-ws-text-color) !important;background:var(--xc-ws-div-color) !important}.form-input-container span{word-break:break-all}.chat-online ::-webkit-scrollbar{width:5px;background:var(--xc-ws-div-color)}.chat-online ::-webkit-scrollbar-thumb{background:linear-gradient(13deg, var(--xc-ws-text-color), var(--xc-ws-div-color));border-radius:10px}.chat-online ::-webkit-scrollbar-thumb:hover{background:linear-gradient(13deg, var(--xc-ws-div-color), var(--xc-ws-text-color))}.chat-online form{display:flex;width:100%;height:calc(100% - 20px);overflow:auto;padding:1em 0px 40px 0px;position:relative;max-width:100%;overflow-x:hidden;margin-bottom:10px}.chat-online form .form-field{margin-right:10px;margin-left:10px}.chat-online form .form-input-container{width:100%;height:100%;overflow:auto;scrollbar-width:none}.chat-online form div[ng-switch-when=label] md-content{overflow:hidden}.chat-online form div[ng-switch-when=label] md-content span{overflow:hidden}.chat-online form div.online-button-wrapper,.chat-online form div.offline-button-wrapper{position:fixed;bottom:30px;left:0px;width:calc(100% - 40px);padding:0px 20px;display:flex;background:transparent;align-items:center;justify-content:center}.chat-online form div.online-button-wrapper button,.chat-online form div.offline-button-wrapper button{margin:8px 0px;padding:2px;width:100%}.chat-online form .layout-row,.chat-online form .layout-column{flex-wrap:wrap;justify-content:start}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button,.chat-online form .layout-column md-checkbox,.chat-online form .layout-column md-radio-button{padding:4px 0;margin-left:unset !important;word-break:break-all}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button{min-width:50%;max-width:50%}.chat-online form button.upload-button{margin:6px 8px 6px 0}.chat-online form button.upload-button md-icon{font-size:20px}.chat-unmanaged{display:flex;flex-direction:column}.chat-unmanaged form{flex-grow:1;max-width:100%;overflow-x:hidden}.chat-closing{height:100%;padding:20px;overflow:hidden;align-items:stretch;justify-content:space-between}.chat-closing>md-content,.chat-closing>form{max-width:100%;overflow-x:hidden}.chat-closing>md-content,.chat-closing>md-content span,.chat-closing>form,.chat-closing>form span{width:100%}.logo{width:32px}#attachmentButton:hover .mdi-attachment:before{color:#555 !important;opacity:.85 !important}#input_text{position:relative !important;width:100% !important;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}#input_text:focus-within{border-color:#66afe9;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}#attachmentButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}i.icon_color{color:red}#sendButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}.emojionearea,.emojionearea.form-control{display:block;position:relative !important;width:100%;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:0px solid #ccc !important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-webkit-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.mdi mdi-attachment mdi-24px mdi-light ng-scope::before{color:#a9a9a9}.mdi-attachment:hover{color:#555 !important}.mdi-24px.mdi-set,.mdi-24px.mdi:before{color:#a9a9a9}.md-button.md-fab.md-mini{line-height:20px !important;min-height:24px !important}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>img{width:19px !important;height:19px !important;margin:0 1px !important}.emojionearea .emojionearea-picker{width:100% !important;right:0 !important;height:220px !important;top:0px !important}.emojionearea .emojionearea-picker .emojionearea-wrapper{position:relative;height:220px !important;width:100% !important}.emojionearea .emojionearea-picker.emojionearea-picker-position-top{margin-top:-100% !important}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-top{margin-top:-236px !important;width:260px !important;min-width:260px !important}.emojionearea .emojionearea-picker .emojionearea-search>input{width:100px !important;min-width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search{width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search-panel+.emojionearea-scroll-area{height:70% !important}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block{padding:0 !important}.emojionearea .emojionearea-picker .emojionearea-filters{background:#f5f7f9;padding:0 !important;height:40px}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter{width:25px !important;padding:7px 3px 0}#id-row,#chat-app{max-width:100%;width:100%;max-height:100%;height:100%}#chat-app{background-color:transparent}#chat-app .header-button{padding:0;margin:0;font-size:18px;cursor:pointer}ui-view{display:block;width:100%;height:100%}#chat-app .chat-toolbar{height:56px;min-height:56px;cursor:pointer;outline:0}#chat-app .chat-content{flex-grow:1;height:calc(100% - 56px);background:#fff;border:1px solid #d3d3d3;-ms-overflow-style:none;overflow:hidden;box-sizing:border-box}#chat-app .chat-content .chat-messages{height:calc(100% - 60px);overflow:auto;border-bottom:1px solid #d3d3d3}#chat-app .chat-content .chat-online{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .chat-content .chat-unmanaged{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .avatar-wrapper{position:relative;bottom:-3px;right:5px}#chat-app .chat-content .message-row .bubble{word-wrap:break-word;position:relative;max-width:190px;padding:6px 7px 8px 9px;background-color:#fff;border-radius:6px}#chat-app .chat-content .message-row .bubble .message{white-space:pre-wrap}#chat-app .chat-content .message-row .bubble .message-done{color:#dcdcdc}#chat-app .chat-content .message-row .bubble .message-done-all{color:#00bfff}#chat-app .chat-content .message-row .bubble:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADGUExURQAAAP////b29vn5+f///wAAAP///wAAAAAAAP///9ra2v////j4+PHx8fv7++Hh4fHx8f////////////////39/QAAAP////////z8/P////39/f39/fz8/P////////////z8/P////////////z8/P////////////v7+/Hx8f///9bW1vz8/K2trf////39/f39/WJiYgAAAExMTFtbWwAAAN3d3cjIyPr6+vX19QAAAO7u7vz8/NTU1Ofn5zMzM////zGPlXsAAABBdFJOUwAcm/kREh4CCDWL1SneR6TfAQffhMYK/A5nRrLWfRc5DW2ih5f+19Kn+9v4g/1LCJuXHwQUKgahcXS6DNnlDMMKKzPoTgAAAKBJREFUKM+V08USwmAQA+C/0NIWd3d3d8/7vxTMcIPkQK7f7CG7s8bQAOY/SCuwFYQU1P+eiCqIK2gpWCmoCrAgoKQgJ8CHgIqAMjg0MxxSQ3DogEMWFBZtUPAHYGB1CyDQWE6AH7BrfXzlAxGAQhECTGAmwN1Okz0Gb/LW4fEItIfrOfNELMh3tck7u+PhcT2zQ7l77/K8iY8yJwV3BeYFqpc/uSyPGdAAAAAASUVORK5CYII=);content:"";position:absolute;left:-11px;bottom:3px;width:12px;height:19px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain}#chat-app .chat-content .message-row .bubble .time{font-size:10px;text-align:right;margin-bottom:5px}#chat-app .chat-content .message-row.out .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.auto{align-items:flex-end;font-style:italic}#chat-app .chat-content .message-row.auto .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-size:17px;font-style:italic;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in{align-items:flex-end}#chat-app .chat-content .message-row.in2{align-items:flex-end}#chat-app .chat-content .message-row.out{align-items:flex-end}#chat-app .chat-content .message-row.in2 .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in2 .bubble{margin-right:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in2 .bubble:before{left:-11px;right:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=);-webkit-transform:rotate(180deg);transform:rotate(180deg)}#chat-app .chat-content .message-row.in .avatar{order:2;margin:0 0 0 16px;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in .bubble{margin-left:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in .bubble:before{right:-11px;left:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=)}#chat-app .chat-footer{width:100%}#waiting{overflow:visible;height:calc(100% - 64px);background:#fff;text-align:center;flex:1 0 auto;padding:32px}#waiting .subtitle{margin:16px 0;max-width:300px;color:rgba(0,0,0,.54)}.sk-fading-circle{width:40px;height:40px;position:relative}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:"";display:block;margin:0 auto;width:15%;height:15%;background-color:#333;border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}md-toast.md-success-toast .md-toast-content{background-color:green}md-toast.md-warning-toast .md-toast-content{background-color:#ffd103;color:#383838}md-toast.md-failure-toast .md-toast-content{background-color:red}md-toast.size .md-toast-content{font-weight:550;padding:0px;text-align:center;height:56px}md-toast.rounded .md-toast-content{border-radius:15px 15px 0px 0px}md-toast.squared .md-toast-content{border-radius:0px 0px 0px 0px}@media(min-device-width: 769px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:block}}@media(max-device-width: 768px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:none}}md-option .md-text{white-space:break-spaces}md-input-container{margin:0px 0px 8px 0px}.no-padding{padding:0 !important}
+ */html,body{height:100%;position:relative}body{margin:0;padding:0}[tabindex="-1"]:focus{outline:none}.inset{padding:10px}a.md-no-style,button.md-no-style{font-weight:normal;background-color:inherit;text-align:left;border:none;padding:0;margin:0}select,button,textarea,input{vertical-align:baseline}input[type=reset],input[type=submit],html input[type=button],button{cursor:pointer;-webkit-appearance:button}input[type=reset][disabled],input[type=submit][disabled],html input[type=button][disabled],button[disabled]{cursor:default}textarea{vertical-align:top;overflow:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box;-webkit-box-sizing:content-box}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}input:-webkit-autofill{text-shadow:none}.md-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;text-transform:none;width:1px}.md-shadow{position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;pointer-events:none}.md-shadow-bottom-z-1{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-shadow-bottom-z-2{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-shadow-animated.md-shadow{transition:box-shadow .28s cubic-bezier(0.4, 0, 0.2, 1)}.md-ripple-container{pointer-events:none;position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;transition:all .55s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple{position:absolute;transform:translate(-50%, -50%) scale(0);transform-origin:50% 50%;opacity:0;border-radius:50%}.md-ripple.md-ripple-placed{transition:margin .9s cubic-bezier(0.25, 0.8, 0.25, 1),border .9s cubic-bezier(0.25, 0.8, 0.25, 1),width .9s cubic-bezier(0.25, 0.8, 0.25, 1),height .9s cubic-bezier(0.25, 0.8, 0.25, 1),opacity .9s cubic-bezier(0.25, 0.8, 0.25, 1),transform .9s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple.md-ripple-scaled{transform:translate(-50%, -50%) scale(1)}.md-ripple.md-ripple-active,.md-ripple.md-ripple-full,.md-ripple.md-ripple-visible{opacity:.2}.md-ripple.md-ripple-remove{animation:md-remove-ripple .9s cubic-bezier(0.25, 0.8, 0.25, 1)}@keyframes md-remove-ripple{0%{opacity:.15}100%{opacity:0}}.md-padding{padding:8px}.md-margin{margin:8px}.md-scroll-mask{position:absolute;background-color:transparent;top:0;right:0;bottom:0;left:0;z-index:50}.md-scroll-mask>.md-scroll-mask-bar{display:block;position:absolute;background-color:#fafafa;right:0;top:0;bottom:0;z-index:65;box-shadow:inset 0 0 1px rgba(0,0,0,.3)}.md-no-momentum{-webkit-overflow-scrolling:auto}.md-no-flicker{-webkit-filter:blur(0px)}@media(min-width: 960px){.md-padding{padding:16px}}html[dir=rtl],html[dir=ltr],body[dir=rtl],body[dir=ltr]{unicode-bidi:embed}bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}html,body{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:default;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.md-display-4{font-size:112px;font-weight:300;letter-spacing:-0.01em;line-height:112px}.md-display-3{font-size:56px;font-weight:400;letter-spacing:-0.005em;line-height:56px}.md-display-2{font-size:45px;font-weight:400;line-height:64px}.md-display-1{font-size:34px;font-weight:400;line-height:40px}.md-headline{font-size:24px;font-weight:400;line-height:32px}.md-title{font-size:20px;font-weight:500;letter-spacing:.005em}.md-subhead{font-size:16px;font-weight:400;letter-spacing:.01em;line-height:24px}.md-body-1{font-size:14px;font-weight:400;letter-spacing:.01em;line-height:20px}.md-body-2{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:24px}.md-caption{font-size:12px;letter-spacing:.02em}.md-button{letter-spacing:.01em}button,select,html,textarea,input{font-family:Roboto,"Helvetica Neue",sans-serif}select,button,textarea,input{font-size:100%}.md-panel-outer-wrapper{height:100%;left:0;position:absolute;top:0;width:100%}.md-panel-inner-wrapper{position:fixed}._md-panel-offscreen{left:-9999px}._md-panel-hidden{display:none}._md-panel-shown .md-panel{opacity:1;transition:none}.md-panel{opacity:0;position:relative}.md-panel._md-panel-shown{opacity:1;transition:none}.md-panel._md-panel-animate-enter{opacity:1;transition:all .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-panel-animate-leave{opacity:1;transition:all .3s cubic-bezier(0.4, 0, 1, 1)}.md-panel._md-panel-animate-scale-out,.md-panel._md-panel-animate-fade-out{opacity:0}.md-panel._md-panel-backdrop{height:100%;position:fixed;width:100%}.md-panel._md-opaque-enter{opacity:.48;transition:opacity .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-opaque-leave{transition:opacity .3s cubic-bezier(0.4, 0, 1, 1)}._md-panel-fullscreen{border-radius:0;left:0;min-height:100%;min-width:100%;position:fixed;top:0}md-autocomplete{border-radius:2px;display:block;height:40px;position:relative;overflow:visible;min-width:190px}md-autocomplete[disabled] input{cursor:default}md-autocomplete[md-floating-label]{border-radius:0;background:transparent;height:auto}md-autocomplete[md-floating-label] md-input-container{padding-bottom:0}md-autocomplete[md-floating-label] md-autocomplete-wrap{height:auto}md-autocomplete[md-floating-label] .md-show-clear-button button{display:block;position:absolute;right:0;top:20px;width:30px;height:30px}md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:30px}[dir=rtl] md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:0;padding-left:30px}md-autocomplete md-autocomplete-wrap{display:flex;flex-direction:row;box-sizing:border-box;position:relative;overflow:visible;height:40px}md-autocomplete md-autocomplete-wrap.md-menu-showing{z-index:51}md-autocomplete md-autocomplete-wrap md-input-container,md-autocomplete md-autocomplete-wrap input{flex:1 1 0;box-sizing:border-box;min-width:0}md-autocomplete md-autocomplete-wrap md-progress-linear{position:absolute;bottom:-2px;left:0}md-autocomplete md-autocomplete-wrap md-progress-linear.md-inline{bottom:40px;right:2px;left:2px;width:auto}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate{position:absolute;top:0;left:0;width:100%;height:3px;transition:none}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container{transition:none;height:3px}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter.ng-enter-active{opacity:1}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave.ng-leave-active{opacity:0}md-autocomplete input:not(.md-input){font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;width:100%;padding:0 15px;line-height:40px;height:40px}md-autocomplete input:not(.md-input)::-ms-clear{display:none}md-autocomplete .md-show-clear-button button{position:relative;line-height:20px;text-align:center;width:30px;height:30px;cursor:pointer;border:none;border-radius:50%;padding:0;font-size:12px;background:transparent;margin:auto 5px}md-autocomplete .md-show-clear-button button:after{content:"";position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border-radius:50%;transform:scale(0);opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-autocomplete .md-show-clear-button button:focus{outline:none}md-autocomplete .md-show-clear-button button:focus:after{transform:scale(1);opacity:1}md-autocomplete .md-show-clear-button button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0) scale(0.9)}md-autocomplete .md-show-clear-button button md-icon path{stroke-width:0}md-autocomplete .md-show-clear-button button.ng-enter{transform:scale(0);transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-enter.ng-enter-active{transform:scale(1)}md-autocomplete .md-show-clear-button button.ng-leave{transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active{transform:scale(0)}@media screen and (-ms-high-contrast: active){md-autocomplete input{border:1px solid #fff}md-autocomplete .md-autocomplete-suggestion:focus{color:#fff}}.md-virtual-repeat-container.md-autocomplete-suggestions-container,.md-standard-list-container.md-autocomplete-suggestions-container{position:absolute;box-shadow:0 2px 5px rgba(0,0,0,.25);z-index:100;height:100%}.md-virtual-repeat-container.md-autocomplete-suggestions-container .highlight,.md-standard-list-container.md-autocomplete-suggestions-container .highlight{font-weight:bold}.md-standard-list-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;overflow-y:auto;padding:0}.md-virtual-repeat-container.md-not-found,.md-standard-list-container.md-not-found{height:48px}.md-autocomplete-suggestions{margin:0;list-style:none;padding:0}.md-autocomplete-suggestions .md-autocomplete-suggestion{font-size:14px;overflow:hidden;padding:0 15px;line-height:48px;height:48px;transition:background .15s linear;margin:0;white-space:nowrap;text-overflow:ellipsis}.md-autocomplete-suggestions .md-autocomplete-suggestion:focus{outline:none}.md-autocomplete-suggestions .md-autocomplete-suggestion:not(.md-not-found-wrapper){cursor:pointer}@media screen and (-ms-high-contrast: active){md-autocomplete,.md-autocomplete-suggestions{border:1px solid #fff}}md-backdrop{transition:opacity 450ms;position:absolute;top:0;bottom:0;left:0;right:0;z-index:50}md-backdrop.md-menu-backdrop{position:fixed !important;z-index:99}md-backdrop.md-select-backdrop{z-index:81;transition-duration:0}md-backdrop.md-dialog-backdrop{z-index:79}md-backdrop.md-bottom-sheet-backdrop{z-index:69}md-backdrop.md-sidenav-backdrop{z-index:59}md-backdrop.md-click-catcher{position:absolute}md-backdrop.md-opaque{opacity:.48}md-backdrop.md-opaque.ng-enter{opacity:0}md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active{opacity:.48}md-backdrop.md-opaque.ng-leave{opacity:.48;transition:opacity 400ms}md-backdrop.md-opaque.ng-leave.md-opaque.ng-leave-active{opacity:0}md-bottom-sheet{position:absolute;left:0;right:0;bottom:0;padding:8px 16px 88px 16px;z-index:70;border-top-width:1px;border-top-style:solid;transform:translate3d(0, 80px, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform}md-bottom-sheet.md-has-header{padding-top:0}md-bottom-sheet.ng-enter{opacity:0;transform:translate3d(0, 100%, 0)}md-bottom-sheet.ng-enter-active{opacity:1;display:block;transform:translate3d(0, 80px, 0) !important}md-bottom-sheet.ng-leave-active{transform:translate3d(0, 100%, 0) !important;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-bottom-sheet .md-subheader{background-color:transparent;font-family:Roboto,"Helvetica Neue",sans-serif;line-height:56px;padding:0;white-space:nowrap}md-bottom-sheet md-inline-icon{display:inline-block;height:24px;width:24px;fill:#444}md-bottom-sheet md-list-item{display:flex;outline:none}md-bottom-sheet md-list-item:hover{cursor:pointer}md-bottom-sheet.md-list md-list-item{padding:0;align-items:center;height:48px}md-bottom-sheet.md-grid{padding-left:24px;padding-right:24px;padding-top:0}md-bottom-sheet.md-grid md-list{display:flex;flex-direction:row;flex-wrap:wrap;transition:all .5s;align-items:center}md-bottom-sheet.md-grid md-list-item{flex-direction:column;align-items:center;transition:all .5s;height:96px;margin-top:8px;margin-bottom:8px}@media(max-width: 960px){md-bottom-sheet.md-grid md-list-item{flex:1 1 33.3333333333%;max-width:33.3333333333%}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n + 1){align-items:flex-start}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n){align-items:flex-end}}@media(min-width: 960px)and (max-width: 1279px){md-bottom-sheet.md-grid md-list-item{flex:1 1 25%;max-width:25%}}@media(min-width: 1280px)and (max-width: 1919px){md-bottom-sheet.md-grid md-list-item{flex:1 1 16.6666666667%;max-width:16.6666666667%}}@media(min-width: 1920px){md-bottom-sheet.md-grid md-list-item{flex:1 1 14.2857142857%;max-width:14.2857142857%}}md-bottom-sheet.md-grid md-list-item::before{display:none}md-bottom-sheet.md-grid md-list-item .md-list-item-content{display:flex;flex-direction:column;align-items:center;width:48px;padding-bottom:16px}md-bottom-sheet.md-grid md-list-item .md-grid-item-content{border:1px solid transparent;display:flex;flex-direction:column;align-items:center;width:80px}md-bottom-sheet.md-grid md-list-item .md-grid-text{font-weight:400;line-height:16px;font-size:13px;margin:0;white-space:nowrap;width:64px;text-align:center;text-transform:none;padding-top:8px}@media screen and (-ms-high-contrast: active){md-bottom-sheet{border:1px solid #fff}}button.md-button::-moz-focus-inner{border:0}.md-button{display:inline-block;position:relative;cursor:pointer;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:2px;box-sizing:border-box;user-select:none;outline:none;border:0;padding:0 8px;margin:6px 8px;background:transparent;color:currentColor;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden;transition:box-shadow .4s cubic-bezier(0.25, 0.8, 0.25, 1),background-color .4s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){min-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){line-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){font-size:13px}.md-button:focus{outline:none}.md-button:hover,.md-button:focus{text-decoration:none}.md-button.ng-hide,.md-button.ng-leave{transition:none}.md-button.md-cornered{border-radius:0}.md-button.md-icon{padding:0;background:none}.md-button.md-raised:not([disabled]){box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button.md-icon-button{margin:0 6px;height:40px;min-width:0;line-height:24px;padding:8px;width:40px;border-radius:50%}.md-button.md-fab{z-index:20;line-height:56px;min-width:0;width:56px;height:56px;vertical-align:middle;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:50%;background-clip:padding-box;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-property:background-color,box-shadow,transform}.md-button.md-fab.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}.md-button.md-fab.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}.md-button.md-fab.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}.md-button.md-fab.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}.md-button.md-fab.md-mini{line-height:40px;width:40px;height:40px}.md-button.md-fab.ng-hide,.md-button.md-fab.ng-leave{transition:none}.md-button.md-fab[disabled]{box-shadow:none}.md-button:not([disabled]).md-raised.md-focused,.md-button:not([disabled]).md-fab.md-focused{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button:not([disabled]).md-raised:active,.md-button:not([disabled]).md-fab:active{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-button .md-ripple-container{border-radius:inherit;background-clip:padding-box;overflow:hidden;-webkit-transform:translateZ(0)}.md-button.md-icon-button md-icon,button.md-button.md-fab md-icon{display:block}.md-toast-open-top .md-button.md-fab-top-left,.md-toast-open-top .md-button.md-fab-top-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, 42px, 0)}.md-toast-open-top .md-button.md-fab-top-left:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-left:not([disabled]):hover,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]):hover{transform:translate3d(0, 41px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left,.md-toast-open-bottom .md-button.md-fab-bottom-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, -42px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]):hover,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]):hover{transform:translate3d(0, -43px, 0)}.md-button-group{display:flex;flex:1;width:100%}.md-button-group>.md-button{flex:1;display:block;overflow:hidden;width:0;border-width:1px 0px 1px 1px;border-radius:0;text-align:center;text-overflow:ellipsis;white-space:nowrap}.md-button-group>.md-button:first-child{border-radius:2px 0px 0px 2px}.md-button-group>.md-button:last-child{border-right-width:1px;border-radius:0px 2px 2px 0px}@media screen and (-ms-high-contrast: active){.md-button.md-raised,.md-button.md-fab{border:1px solid #fff}}md-card{box-sizing:border-box;display:flex;flex-direction:column;margin:8px;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-card md-card-header{padding:16px;display:flex;flex-direction:row}md-card md-card-header:first-child md-card-avatar{margin-right:12px}[dir=rtl] md-card md-card-header:first-child md-card-avatar{margin-right:auto;margin-left:12px}md-card md-card-header:last-child md-card-avatar{margin-left:12px}[dir=rtl] md-card md-card-header:last-child md-card-avatar{margin-left:auto;margin-right:12px}md-card md-card-header md-card-avatar{width:40px;height:40px}md-card md-card-header md-card-avatar .md-user-avatar,md-card md-card-header md-card-avatar md-icon{border-radius:50%}md-card md-card-header md-card-avatar md-icon{padding:8px}md-card md-card-header md-card-avatar md-icon>svg{height:inherit;width:inherit}md-card md-card-header md-card-avatar+md-card-header-text{max-height:40px}md-card md-card-header md-card-avatar+md-card-header-text .md-title{font-size:14px}md-card md-card-header md-card-header-text{display:flex;flex:1;flex-direction:column}md-card md-card-header md-card-header-text .md-subhead{font-size:14px}md-card>img,md-card>md-card-header img,md-card md-card-title-media img{box-sizing:border-box;display:flex;flex:0 0 auto;width:100%;height:auto}md-card md-card-title{padding:24px 16px 16px;display:flex;flex:1 1 auto;flex-direction:row}md-card md-card-title+md-card-content{padding-top:0}md-card md-card-title md-card-title-text{flex:1;flex-direction:column;display:flex}md-card md-card-title md-card-title-text .md-subhead{padding-top:0;font-size:14px}md-card md-card-title md-card-title-text:only-child .md-subhead{padding-top:12px}md-card md-card-title md-card-title-media{margin-top:-8px}md-card md-card-title md-card-title-media .md-media-sm{height:80px;width:80px}md-card md-card-title md-card-title-media .md-media-md{height:112px;width:112px}md-card md-card-title md-card-title-media .md-media-lg{height:152px;width:152px}md-card md-card-content{display:block;padding:16px}md-card md-card-content>p:first-child{margin-top:0}md-card md-card-content>p:last-child{margin-bottom:0}md-card md-card-content .md-media-xl{height:240px;width:240px}md-card md-card-actions{margin:8px}md-card md-card-actions.layout-column .md-button:not(.md-icon-button){margin:2px 0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):first-of-type{margin-top:0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):last-of-type{margin-bottom:0}md-card md-card-actions.layout-column .md-button.md-icon-button{margin-top:6px;margin-bottom:6px}md-card md-card-actions md-card-icon-actions{flex:1;justify-content:flex-start;display:flex;flex-direction:row}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button){margin:0 4px}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:auto;margin-right:0}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:auto;margin-left:0}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button{margin-left:6px;margin-right:6px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:auto;margin-right:12px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:auto;margin-left:12px}md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions{flex:1;justify-content:flex-end;display:flex;flex-direction:row}md-card md-card-footer{margin-top:auto;padding:16px}@media screen and (-ms-high-contrast: active){md-card{border:1px solid #fff}}.md-image-no-fill>img{width:auto;height:auto}.md-inline-form md-checkbox{margin-top:14px;margin-bottom:auto}md-checkbox{box-sizing:border-box;display:inline-block;white-space:nowrap;cursor:pointer;outline:none;user-select:none;position:relative;min-width:18px;min-height:48px}.md-dense>md-checkbox:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) md-checkbox:not(.md-dense-disabled){min-height:36px}md-checkbox.md-focused:not([disabled]) .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before{background-color:rgba(0,0,0,.12)}md-checkbox .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-checkbox .md-container{left:auto}[dir=rtl] md-checkbox .md-container{right:0}md-checkbox .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-checkbox .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-checkbox .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-checkbox .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-checkbox.md-checked .md-icon{border-color:transparent}md-checkbox.md-checked .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox[disabled]{cursor:default}md-checkbox.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox .md-container{top:auto;left:auto;right:auto;margin:3px;margin-top:21px}md-checkbox .md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;margin-top:10px;margin-bottom:auto;margin-left:36px}[dir=rtl] md-checkbox .md-label{margin-left:0;margin-right:36px}md-checkbox .md-label:empty{margin-left:24px;margin-right:0}[dir=rtl] md-checkbox .md-label:empty{margin-left:0}[dir=rtl] md-checkbox .md-label:empty{margin-right:24px}md-input-container .md-checkbox-link-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;cursor:pointer;top:-21px;margin-left:18px;margin-right:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-left:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-right:18px}.md-contact-chips .md-chips md-chip{padding:0 25px 0 0}[dir=rtl] .md-contact-chips .md-chips md-chip{padding:0 0 0 25px}.md-contact-chips .md-chips md-chip .md-contact-avatar{float:left}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-avatar{float:right}.md-contact-chips .md-chips md-chip .md-contact-avatar img{height:32px;border-radius:16px}.md-contact-chips .md-chips md-chip .md-contact-name{display:inline-block;height:32px;margin-left:8px}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion{height:56px}.md-contact-suggestion img{height:40px;border-radius:20px;margin-top:8px}.md-contact-suggestion .md-contact-name{margin-left:8px;width:120px}[dir=rtl] .md-contact-suggestion .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion .md-contact-name,.md-contact-suggestion .md-contact-email{display:inline-block;overflow:hidden;text-overflow:ellipsis}.md-contact-chips-suggestions li{height:100%}md-chips{display:flex}.md-chips{display:flex;flex-wrap:wrap;flex-grow:1;font-family:Roboto,"Helvetica Neue",sans-serif;font-size:13px;padding:0 0 8px 3px;vertical-align:middle}.md-chips:after{content:"";display:table;clear:both}[dir=rtl] .md-chips{padding:0 3px 8px 0}.md-chips.md-readonly .md-chip-input-container{min-height:32px}.md-chips:not(.md-readonly){cursor:text}.md-chips.md-removable md-chip{padding-right:28px}[dir=rtl] .md-chips.md-removable md-chip{padding-right:0;padding-left:28px}.md-chips.md-removable md-chip .md-chip-content{padding-right:4px}[dir=rtl] .md-chips.md-removable md-chip .md-chip-content{padding-right:0;padding-left:4px}.md-chips md-chip{cursor:default;border-radius:16px;display:block;height:32px;line-height:32px;margin:8px 8px 0 0;padding:0 12px 0 12px;float:left;box-sizing:border-box;max-width:100%;position:relative}[dir=rtl] .md-chips md-chip{margin:8px 0 0 8px}[dir=rtl] .md-chips md-chip{float:right}.md-chips md-chip .md-chip-content{display:block;float:left;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-chips md-chip .md-chip-content{float:right}.md-chips md-chip .md-chip-content:focus{outline:none}.md-chips md-chip._md-chip-content-edit-is-enabled{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.md-chips md-chip .md-chip-remove-container{position:absolute;right:0;line-height:22px}[dir=rtl] .md-chips md-chip .md-chip-remove-container{right:auto;left:0}.md-chips md-chip .md-chip-remove{text-align:center;width:32px;height:32px;min-width:0;padding:0;background:transparent;border:none;box-shadow:none;margin:0;position:relative}.md-chips md-chip .md-chip-remove md-icon{height:18px;width:18px;min-height:18px;min-width:18px;position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.md-chips .md-chip-input-container{display:block;line-height:32px;margin:8px 8px 0 0;padding:0;flex-grow:1;float:left}[dir=rtl] .md-chips .md-chip-input-container{margin:8px 0 0 8px}[dir=rtl] .md-chips .md-chip-input-container{float:right}.md-chips .md-chip-input-container input{width:100%}.md-chips .md-chip-input-container input:not([type]),.md-chips .md-chip-input-container input[type=email],.md-chips .md-chip-input-container input[type=number],.md-chips .md-chip-input-container input[type=tel],.md-chips .md-chip-input-container input[type=url],.md-chips .md-chip-input-container input[type=text]{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:not([type]):focus,.md-chips .md-chip-input-container input[type=email]:focus,.md-chips .md-chip-input-container input[type=number]:focus,.md-chips .md-chip-input-container input[type=tel]:focus,.md-chips .md-chip-input-container input[type=url]:focus,.md-chips .md-chip-input-container input[type=text]:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{background:transparent;height:32px}.md-chips .md-chip-input-container md-autocomplete md-autocomplete-wrap{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container input{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{height:32px}.md-chips .md-chip-input-container md-autocomplete{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container:not(:first-child){margin:8px 8px 0 0}[dir=rtl] .md-chips .md-chip-input-container:not(:first-child){margin:8px 0 0 8px}.md-chips .md-chip-input-container input{background:transparent;border-width:0}.md-chips md-autocomplete button{display:none}@media screen and (-ms-high-contrast: active){.md-chip-input-container,md-chip{border:1px solid #fff}.md-chip-input-container md-autocomplete{border:none}}md-content{display:block;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}md-content[md-scroll-y]{overflow-y:auto;overflow-x:hidden}md-content[md-scroll-x]{overflow-x:auto;overflow-y:hidden}@media print{md-content{overflow:visible !important}}md-calendar{font-size:13px;user-select:none}.md-calendar-scroll-mask{display:inline-block;overflow:hidden;height:308px}.md-calendar-scroll-mask .md-virtual-repeat-scroller{overflow-y:scroll;-webkit-overflow-scrolling:touch}.md-calendar-scroll-mask .md-virtual-repeat-scroller::-webkit-scrollbar{display:none}.md-calendar-scroll-mask .md-virtual-repeat-offsetter{width:100%}.md-calendar-scroll-container{box-shadow:inset -3px 3px 6px rgba(0,0,0,.2);display:inline-block;height:308px;width:346px}.md-calendar-date{height:44px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box}.md-calendar-date:first-child{padding-left:16px}[dir=rtl] .md-calendar-date:first-child{padding-left:0;padding-right:16px}.md-calendar-date:last-child{padding-right:16px}[dir=rtl] .md-calendar-date:last-child{padding-right:0;padding-left:16px}.md-calendar-date.md-calendar-date-disabled{cursor:default}.md-calendar-date-selection-indicator{transition:background-color,color .4s cubic-bezier(0.25, 0.8, 0.25, 1);border-radius:50%;display:inline-block;width:40px;height:40px;line-height:40px}.md-calendar-date:not(.md-disabled) .md-calendar-date-selection-indicator{cursor:pointer}.md-calendar-month-label{height:44px;font-size:14px;font-weight:500;padding:0 0 0 24px}[dir=rtl] .md-calendar-month-label{padding:0 24px 0 0}.md-calendar-month-label.md-calendar-label-clickable{cursor:pointer}.md-calendar-month-label md-icon{transform:rotate(180deg)}[dir=rtl] .md-calendar-month-label md-icon{transform:none}.md-calendar-month-label span{vertical-align:middle}.md-calendar-day-header{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar-day-header th{height:40px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box;font-weight:normal}.md-calendar-day-header th:first-child{padding-left:16px}[dir=rtl] .md-calendar-day-header th:first-child{padding-left:0;padding-right:16px}.md-calendar-day-header th:last-child{padding-right:16px}[dir=rtl] .md-calendar-day-header th:last-child{padding-right:0;padding-left:16px}.md-calendar{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar tr:last-child td{border-bottom-width:1px;border-bottom-style:solid}.md-calendar:first-child{border-top:1px solid transparent}.md-calendar tbody,.md-calendar td,.md-calendar tr{vertical-align:middle;box-sizing:content-box}md-datepicker{white-space:nowrap;overflow:hidden;vertical-align:middle}.md-inline-form md-datepicker{margin-top:12px}.md-datepicker-button{display:inline-block;box-sizing:border-box;background:none;vertical-align:middle;position:relative}.md-datepicker-button:before{top:0;left:0;bottom:0;right:0;position:absolute;content:"";speak:none}.md-datepicker-input{font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;min-width:120px;max-width:328px;padding:0 0 5px}.md-datepicker-input::-ms-clear{display:none}._md-datepicker-floating-label>md-datepicker{overflow:visible}._md-datepicker-floating-label>md-datepicker .md-datepicker-input-container{border:none}._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:left;margin-top:-16px;top:13.5px}[dir=rtl] ._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:right}._md-datepicker-floating-label .md-input{float:none}._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:18px;left:auto;width:calc(100% - 84px)}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:auto}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){left:18px}._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:64px}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:auto;margin-right:64px}._md-datepicker-has-triangle-icon{padding-right:18px;margin-right:-18px}[dir=rtl] ._md-datepicker-has-triangle-icon{padding-right:0;padding-left:18px}[dir=rtl] ._md-datepicker-has-triangle-icon{margin-right:auto;margin-left:-18px}.md-datepicker-input-container{position:relative;border-bottom-width:1px;border-bottom-style:solid;display:inline-block;width:auto}.md-icon-button+.md-datepicker-input-container{margin-left:12px}[dir=rtl] .md-icon-button+.md-datepicker-input-container{margin-left:auto;margin-right:12px}.md-datepicker-input-container.md-datepicker-focused{border-bottom-width:2px}.md-datepicker-is-showing .md-scroll-mask{z-index:99}.md-datepicker-calendar-pane{position:absolute;top:0;left:-100%;z-index:100;border-width:1px;border-style:solid;background:transparent;transform:scale(0);transform-origin:0 0;transition:transform .2s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-datepicker-calendar-pane.md-pane-open{transform:scale(1)}.md-datepicker-input-mask{height:40px;width:340px;position:relative;overflow:hidden;background:transparent;pointer-events:none;cursor:text}.md-datepicker-calendar{opacity:0;transition:opacity .2s cubic-bezier(0.5, 0, 0.25, 1)}.md-pane-open .md-datepicker-calendar{opacity:1}.md-datepicker-calendar md-calendar:focus{outline:none}.md-datepicker-expand-triangle{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid}.md-datepicker-triangle-button{position:absolute;right:0;bottom:-2.5px;transform:translateX(45%)}[dir=rtl] .md-datepicker-triangle-button{right:auto;left:0}[dir=rtl] .md-datepicker-triangle-button{transform:translateX(-45%)}.md-datepicker-triangle-button.md-button.md-icon-button{height:36px;width:36px;position:absolute;padding:8px}md-datepicker[disabled] .md-datepicker-input-container{border-bottom-color:transparent}md-datepicker[disabled] .md-datepicker-triangle-button{display:none}.md-datepicker-open{overflow:hidden}.md-datepicker-open .md-datepicker-input-container,.md-datepicker-open input.md-input{border-bottom-color:transparent}.md-datepicker-open .md-datepicker-triangle-button,.md-datepicker-open.md-input-has-value>label,.md-datepicker-open.md-input-has-placeholder>label{display:none}.md-datepicker-pos-adjusted .md-datepicker-input-mask{display:none}.md-datepicker-calendar-pane .md-calendar{transform:translateY(-85px);transition:transform .65s cubic-bezier(0.25, 0.8, 0.25, 1);transition-delay:.125s}.md-datepicker-calendar-pane.md-pane-open .md-calendar{transform:translateY(0)}.md-dialog-is-showing{max-height:100%}.md-dialog-container{display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80;overflow:hidden}md-dialog{opacity:0;min-width:240px;max-width:80%;max-height:80%;position:relative;overflow:auto;box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12);display:flex;flex-direction:column}md-dialog.md-transition-in{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 0) scale(1)}md-dialog.md-transition-out{opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 100%) scale(0.2)}md-dialog>form{display:flex;flex-direction:column;overflow:auto}md-dialog .md-dialog-content{padding:24px}md-dialog md-dialog-content{order:1;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}md-dialog md-dialog-content:not([layout=row])>*:first-child:not(.md-subheader){margin-top:0}md-dialog md-dialog-content:focus{outline:none}md-dialog md-dialog-content .md-subheader{margin:0}md-dialog md-dialog-content .md-dialog-content-body{width:100%}md-dialog md-dialog-content .md-prompt-input-container{width:100%;box-sizing:border-box}md-dialog md-dialog-actions{display:flex;order:2;box-sizing:border-box;align-items:center;justify-content:flex-end;margin-bottom:0;padding-right:8px;padding-left:16px;min-height:52px;overflow:hidden}[dir=rtl] md-dialog md-dialog-actions{padding-right:16px}[dir=rtl] md-dialog md-dialog-actions{padding-left:8px}md-dialog md-dialog-actions .md-button{margin-bottom:8px;margin-left:8px;margin-right:0;margin-top:8px}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-left:0}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-right:8px}md-dialog.md-content-overflow md-dialog-actions{border-top-width:1px;border-top-style:solid}@media screen and (-ms-high-contrast: active){md-dialog{border:1px solid #fff}}@media(max-width: 959px){md-dialog.md-dialog-fullscreen{min-height:100%;min-width:100%;border-radius:0}}md-divider{display:block;border-top-width:1px;border-top-style:solid;margin:0}md-divider[md-inset]{margin-left:80px}[dir=rtl] md-divider[md-inset]{margin-left:auto;margin-right:80px}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-divider,.layout-xs-row>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-divider,.layout-gt-xs-row:not(.layout-sm-column)>md-divider,.layout-sm-row:not(.layout-sm-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-sm-row:not(.layout-md-column)>md-divider,.layout-md-row:not(.layout-md-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-md-row:not(.layout-lg-column)>md-divider,.layout-lg-row:not(.layout-lg-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}md-fab-speed-dial{position:relative;display:flex;align-items:center;z-index:20}md-fab-speed-dial.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-speed-dial.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-speed-dial.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-speed-dial.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-speed-dial:not(.md-hover-full){pointer-events:none}md-fab-speed-dial:not(.md-hover-full) md-fab-trigger,md-fab-speed-dial:not(.md-hover-full) .md-fab-action-item{pointer-events:auto}md-fab-speed-dial:not(.md-hover-full).md-is-open{pointer-events:auto}md-fab-speed-dial ._md-css-variables{z-index:20}md-fab-speed-dial.md-is-open .md-fab-action-item{align-items:center}md-fab-speed-dial md-fab-actions{display:flex;height:auto}md-fab-speed-dial md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-down{flex-direction:column}md-fab-speed-dial.md-down md-fab-trigger{order:1}md-fab-speed-dial.md-down md-fab-actions{flex-direction:column;order:2}md-fab-speed-dial.md-up{flex-direction:column}md-fab-speed-dial.md-up md-fab-trigger{order:2}md-fab-speed-dial.md-up md-fab-actions{flex-direction:column-reverse;order:1}md-fab-speed-dial.md-left{flex-direction:row}md-fab-speed-dial.md-left md-fab-trigger{order:2}md-fab-speed-dial.md-left md-fab-actions{flex-direction:row-reverse;order:1}md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-right{flex-direction:row}md-fab-speed-dial.md-right md-fab-trigger{order:1}md-fab-speed-dial.md-right md-fab-actions{flex-direction:row;order:2}md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-fling-remove .md-fab-action-item>*,md-fab-speed-dial.md-scale-remove .md-fab-action-item>*{visibility:hidden}md-fab-speed-dial.md-fling .md-fab-action-item{opacity:1}md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item{opacity:0;transition-duration:0s}md-fab-speed-dial.md-scale .md-fab-action-item{transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.1428571429s}md-fab-toolbar{display:block}md-fab-toolbar.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-toolbar.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-toolbar.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-toolbar.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-toolbar .md-fab-toolbar-wrapper{display:block;position:relative;overflow:hidden;height:68px}md-fab-toolbar md-fab-trigger{position:absolute;z-index:20}md-fab-toolbar md-fab-trigger button{overflow:visible !important}md-fab-toolbar md-fab-trigger .md-fab-toolbar-background{display:block;position:absolute;z-index:21;opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-toolbar md-fab-trigger md-icon{position:relative;z-index:22;opacity:1;transition:all 200ms ease-in}md-fab-toolbar.md-left md-fab-trigger{right:0}[dir=rtl] md-fab-toolbar.md-left md-fab-trigger{right:auto;left:0}md-fab-toolbar.md-left .md-toolbar-tools{flex-direction:row-reverse}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:.6rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:auto;margin-left:.6rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:-0.8rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-0.8rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:8px}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:8px}md-fab-toolbar.md-right md-fab-trigger{left:0}[dir=rtl] md-fab-toolbar.md-right md-fab-trigger{left:auto;right:0}md-fab-toolbar.md-right .md-toolbar-tools{flex-direction:row}md-fab-toolbar md-toolbar{background-color:transparent !important;pointer-events:none;z-index:23}md-fab-toolbar md-toolbar .md-toolbar-tools{padding:0 20px;margin-top:3px}md-fab-toolbar md-toolbar .md-fab-action-item{opacity:0;transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.15s}md-fab-toolbar.md-is-open md-fab-trigger>button{box-shadow:none}md-fab-toolbar.md-is-open md-fab-trigger>button md-icon{opacity:0}md-fab-toolbar.md-is-open .md-fab-action-item{opacity:1;transform:scale(1)}md-grid-list{box-sizing:border-box;display:block;position:relative}md-grid-list md-grid-tile,md-grid-list md-grid-tile>figure,md-grid-list md-grid-tile-header,md-grid-list md-grid-tile-footer{box-sizing:border-box}md-grid-list md-grid-tile{display:block;position:absolute}md-grid-list md-grid-tile figure{display:flex;align-items:center;justify-content:center;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;padding:0;margin:0}md-grid-list md-grid-tile md-grid-tile-header,md-grid-list md-grid-tile md-grid-tile-footer{display:flex;flex-direction:row;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.18);overflow:hidden;position:absolute;left:0;right:0}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-footer h4{font-weight:400;margin:0 0 0 16px}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-footer h3{font-size:14px}md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h4{font-size:12px}md-grid-list md-grid-tile md-grid-tile-header{top:0}md-grid-list md-grid-tile md-grid-tile-footer{bottom:0}@media screen and (-ms-high-contrast: active){md-grid-tile{border:1px solid #fff}md-grid-tile-footer{border-top:1px solid #fff}}md-icon{margin:auto;background-repeat:no-repeat no-repeat;display:inline-block;vertical-align:middle;fill:currentColor;height:24px;width:24px;min-height:24px;min-width:24px}md-icon svg{pointer-events:none;display:block}md-icon[md-font-icon]{line-height:24px;width:auto}md-input-container{display:inline-block;position:relative;padding:2px;margin:18px 0px;vertical-align:middle}md-input-container:after{content:"";display:table;clear:both}md-input-container.md-block{display:block}md-input-container .md-errors-spacer{float:right;min-height:24px;min-width:1px}[dir=rtl] md-input-container .md-errors-spacer{float:left}md-input-container>md-icon{position:absolute;top:8px;left:2px;right:auto}[dir=rtl] md-input-container>md-icon{left:auto}[dir=rtl] md-input-container>md-icon{right:2px}md-input-container textarea,md-input-container input[type=text],md-input-container input[type=password],md-input-container input[type=datetime],md-input-container input[type=datetime-local],md-input-container input[type=date],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week],md-input-container input[type=number],md-input-container input[type=email],md-input-container input[type=url],md-input-container input[type=search],md-input-container input[type=tel],md-input-container input[type=color]{-moz-appearance:none;-webkit-appearance:none}md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week]{min-height:30px}md-input-container textarea{resize:none;overflow:hidden}md-input-container textarea.md-input{min-height:30px;-ms-flex-preferred-size:auto}md-input-container textarea[md-no-autogrow]{height:auto;overflow:auto}md-input-container label:not(.md-container-ignore){position:absolute;bottom:100%;left:0;right:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){left:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){right:0}md-input-container label:not(.md-container-ignore).md-required:after{content:" *";font-size:13px;vertical-align:top}md-input-container label:not(.md-no-float):not(.md-container-ignore),md-input-container .md-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;padding-right:0;z-index:1;transform:translate3d(0, 28px, 0) scale(1);transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);max-width:100%;transform-origin:left top}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-left:0}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-right:2px}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{transform-origin:right top}md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-input-has-value .md-placeholder{padding-left:3px;padding-right:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-left:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-right:3px}md-input-container .md-placeholder{position:absolute;top:0;opacity:0;transition-property:opacity,transform;transform:translate3d(0, 30px, 0)}md-input-container.md-input-focused .md-placeholder{opacity:1;transform:translate3d(0, 24px, 0)}md-input-container.md-input-has-value .md-placeholder{transition:none;opacity:0}md-input-container:not(.md-input-has-value):not(.md-input-has-placeholder) input:not(:focus){color:transparent}md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-millisecond-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-minute-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-month-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-second-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-week-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-year-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-text{color:transparent}md-input-container .md-input{order:2;display:block;margin-top:0;background:none;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-width:0 0 1px 0;line-height:26px;height:30px;-ms-flex-preferred-size:26px;border-radius:0;border-style:solid;transition:border-color .4s cubic-bezier(0.25, 0.8, 0.25, 1);width:100%;box-sizing:border-box;float:left}[dir=rtl] md-input-container .md-input{padding-left:2px}[dir=rtl] md-input-container .md-input{padding-right:0}[dir=rtl] md-input-container .md-input{float:right}md-input-container .md-input:focus{outline:none}md-input-container .md-input:invalid{outline:none;box-shadow:none}md-input-container .md-input.md-no-flex{flex:none !important}md-input-container .md-char-counter{text-align:right;padding-right:2px;padding-left:0}[dir=rtl] md-input-container .md-char-counter{text-align:left}[dir=rtl] md-input-container .md-char-counter{padding-right:0}[dir=rtl] md-input-container .md-char-counter{padding-left:2px}md-input-container .md-input-messages-animation{position:relative;order:4;overflow:hidden;clear:left}[dir=rtl] md-input-container .md-input-messages-animation{clear:right}md-input-container .md-input-message-animation,md-input-container .md-char-counter{font-size:12px;line-height:14px;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);opacity:1;margin-top:0;padding-top:8px}md-input-container .md-input-message-animation:not(.md-char-counter),md-input-container .md-char-counter:not(.md-char-counter){padding-right:5px;padding-left:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-right:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-left:5px}md-input-container:not(.md-input-invalid) .md-auto-hide .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter-prepare{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter:not(.ng-enter-active){opacity:0;margin-top:-100px}md-input-container.md-input-focused label:not(.md-no-float),md-input-container.md-input-has-placeholder label:not(.md-no-float),md-input-container.md-input-has-value label:not(.md-no-float){transform:translate3d(0, 6px, 0) scale(0.75);transition:transform cubic-bezier(0.25, 0.8, 0.25, 1) .4s,width cubic-bezier(0.25, 0.8, 0.25, 1) .4s}md-input-container.md-input-has-value label{transition:none}md-input-container.md-input-focused .md-input,md-input-container .md-input.ng-invalid.ng-dirty,md-input-container.md-input-resized .md-input{padding-bottom:0;border-width:0 0 2px 0}md-input-container .md-input[disabled],[disabled] md-input-container .md-input{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x}md-input-container.md-icon-float{transition:margin-top .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-input-container.md-icon-float>label{pointer-events:none;position:absolute}md-input-container.md-icon-float>md-icon{top:8px;left:2px;right:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{left:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{right:2px}md-input-container.md-icon-left>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left>label .md-placeholder,md-input-container.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-right>label .md-placeholder{width:calc(100% - 36px);padding:0}md-input-container.md-icon-left{padding-left:36px;padding-right:0}[dir=rtl] md-input-container.md-icon-left{padding-left:0}[dir=rtl] md-input-container.md-icon-left{padding-right:36px}md-input-container.md-icon-left>label{left:36px;right:auto}[dir=rtl] md-input-container.md-icon-left>label{left:auto}[dir=rtl] md-input-container.md-icon-left>label{right:36px}md-input-container.md-icon-right{padding-left:0;padding-right:36px}[dir=rtl] md-input-container.md-icon-right{padding-left:36px}[dir=rtl] md-input-container.md-icon-right{padding-right:0}md-input-container.md-icon-right>md-icon:last-of-type{margin:0;right:2px;left:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{right:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{left:2px}md-input-container.md-icon-left.md-icon-right{padding-left:36px;padding-right:36px}md-input-container.md-icon-left.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left.md-icon-right>label .md-placeholder{width:calc(100% - (36px * 2))}.md-resize-wrapper{position:relative}.md-resize-wrapper:after{content:"";display:table;clear:both}.md-resize-handle{position:absolute;bottom:-5px;left:0;height:10px;background:transparent;width:100%;cursor:ns-resize}@media screen and (-ms-high-contrast: active){md-input-container.md-default-theme>md-icon{fill:#fff}}md-list{display:block;padding:8px 0px 8px 0px}md-list .md-subheader{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:1.2em}md-list.md-dense:not(.md-dense-disabled) md-list-item,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner{min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item::before,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner::before{content:"";min-height:40px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner md-icon:first-child{width:20px;height:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:36px;margin-top:4px;margin-bottom:4px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:20px;margin-top:6px;margin-bottom:6px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar{flex:none;width:36px;height:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container .md-secondary.md-button,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container .md-secondary.md-button{margin-top:4px;margin-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container md-checkbox:not(.md-dense-disabled),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container md-checkbox:not(.md-dense-disabled){min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text p{line-height:1.05;font-size:12px;padding-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:13px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style{min-height:60px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style::before{content:"";min-height:60px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style{min-height:76px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style::before{content:"";min-height:76px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}md-list.md-dense:not(.md-dense-disabled) .md-subheader-inner{padding-top:12px;padding-bottom:12px}md-list-item{position:relative}md-list-item.md-proxy-focus.md-focused .md-no-style{transition:background-color .15s linear}md-list-item._md-button-wrap{position:relative}md-list-item._md-button-wrap>div.md-button:first-child{display:flex;align-items:center;justify-content:flex-start;padding:0px 16px;margin:0;font-weight:400;text-align:left;border:medium none}[dir=rtl] md-list-item._md-button-wrap>div.md-button:first-child{text-align:right}md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child{position:absolute;top:0;left:0;height:100%;margin:0;padding:0}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner{width:100%}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner::before{content:"";min-height:inherit;visibility:hidden;display:inline-block}md-list-item.md-no-proxy,md-list-item .md-no-style{position:relative;padding:0px 16px;flex:1 1 auto}md-list-item.md-no-proxy.md-button,md-list-item .md-no-style.md-button{font-size:inherit;height:inherit;text-align:left;text-transform:none;width:100%;white-space:normal;flex-direction:inherit;align-items:inherit;border-radius:0;margin:0}[dir=rtl] md-list-item.md-no-proxy.md-button,[dir=rtl] md-list-item .md-no-style.md-button{text-align:right}md-list-item.md-no-proxy.md-button>.md-ripple-container,md-list-item .md-no-style.md-button>.md-ripple-container{border-radius:0}md-list-item.md-no-proxy:focus,md-list-item .md-no-style:focus{outline:none}md-list-item.md-clickable:hover{cursor:pointer}md-list-item md-divider{position:absolute;bottom:0;left:0;width:100%}[dir=rtl] md-list-item md-divider{left:auto;right:0}md-list-item md-divider[md-inset]{left:72px;width:calc(100% - 72px);margin:0 !important}[dir=rtl] md-list-item md-divider[md-inset]{left:auto;right:72px}md-list-item,md-list-item .md-list-item-inner{display:flex;justify-content:flex-start;align-items:center;min-height:48px;height:auto}md-list-item::before,md-list-item .md-list-item-inner::before{content:"";min-height:48px;visibility:hidden;display:inline-block}md-list-item>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item>md-icon.md-secondary:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon.md-secondary:not(.md-avatar-icon){width:24px;margin-top:16px;margin-bottom:12px;box-sizing:content-box}md-list-item>div.md-primary>md-checkbox,md-list-item>div.md-secondary>md-checkbox,md-list-item>md-checkbox,md-list-item md-checkbox.md-secondary,md-list-item .md-list-item-inner>div.md-primary>md-checkbox,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox,md-list-item .md-list-item-inner>md-checkbox,md-list-item .md-list-item-inner md-checkbox.md-secondary{align-self:center}md-list-item>div.md-primary>md-checkbox .md-label,md-list-item>div.md-secondary>md-checkbox .md-label,md-list-item>md-checkbox .md-label,md-list-item md-checkbox.md-secondary .md-label,md-list-item .md-list-item-inner>div.md-primary>md-checkbox .md-label,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox .md-label,md-list-item .md-list-item-inner>md-checkbox .md-label,md-list-item .md-list-item-inner md-checkbox.md-secondary .md-label{display:none}md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:32px}[dir=rtl] md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:32px}md-list-item .md-avatar,md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar,md-list-item .md-list-item-inner .md-avatar-icon{margin-top:8px;margin-bottom:8px;margin-right:16px;border-radius:50%;box-sizing:content-box}[dir=rtl] md-list-item .md-avatar,[dir=rtl] md-list-item .md-avatar-icon,[dir=rtl] md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:16px}md-list-item .md-avatar,md-list-item .md-list-item-inner .md-avatar{flex:none;width:40px;height:40px}md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar-icon{padding:8px}md-list-item .md-avatar-icon svg,md-list-item .md-list-item-inner .md-avatar-icon svg{width:24px;height:24px}md-list-item>md-checkbox,md-list-item .md-list-item-inner>md-checkbox{width:24px;min-height:40px;margin-left:0px;margin-right:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-left:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-right:0px}md-list-item .md-secondary-container,md-list-item .md-list-item-inner .md-secondary-container{display:flex;align-items:center;position:relative;flex-shrink:0;margin:auto;margin-right:0;margin-left:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-right:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-left:0}md-list-item .md-secondary-container .md-button:last-of-type,md-list-item .md-secondary-container .md-icon-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:0}[dir=rtl] md-list-item .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-icon-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-checkbox,md-list-item .md-list-item-inner .md-secondary-container md-checkbox{margin:0 6px;padding:0 8px;min-height:40px}md-list-item .md-secondary-container md-checkbox:last-child,md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{width:40px;margin-right:0}[dir=rtl] md-list-item .md-secondary-container md-checkbox:last-child,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-switch,md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-top:0;margin-bottom:0;margin-right:-6px}[dir=rtl] md-list-item .md-secondary-container md-switch,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-right:auto;margin-left:-6px}md-list-item>p,md-list-item>.md-list-item-inner>p,md-list-item .md-list-item-inner>p,md-list-item .md-list-item-inner>.md-list-item-inner>p{flex:1 1 auto;margin:0}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style,md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{align-items:flex-start;justify-content:center}md-list-item.md-2-line.md-long-text,md-list-item.md-2-line>.md-no-style.md-long-text,md-list-item.md-3-line.md-long-text,md-list-item.md-3-line>.md-no-style.md-long-text{margin-top:8px;margin-bottom:8px}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text,md-list-item.md-3-line .md-list-item-text,md-list-item.md-3-line>.md-no-style .md-list-item-text{flex:1 1 auto;margin:auto;text-overflow:ellipsis;overflow:hidden}md-list-item.md-2-line .md-list-item-text.md-offset,md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list-item.md-3-line .md-list-item-text.md-offset,md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list-item.md-2-line .md-list-item-text h3,md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list-item.md-3-line .md-list-item-text h3,md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:16px;font-weight:400;letter-spacing:.01em;margin:0 0 0 0;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text h4,md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list-item.md-3-line .md-list-item-text h4,md-list-item.md-3-line>.md-no-style .md-list-item-text h4{font-size:14px;letter-spacing:.01em;margin:3px 0 1px 0;font-weight:400;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text p,md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list-item.md-3-line .md-list-item-text p,md-list-item.md-3-line>.md-no-style .md-list-item-text p{font-size:14px;font-weight:500;letter-spacing:.01em;margin:0 0 0 0;line-height:1.6em}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style{height:auto;min-height:72px}md-list-item.md-2-line::before,md-list-item.md-2-line>.md-no-style::before{content:"";min-height:72px;visibility:hidden;display:inline-block}md-list-item.md-2-line>.md-avatar,md-list-item.md-2-line .md-avatar-icon,md-list-item.md-2-line>.md-no-style>.md-avatar,md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list-item.md-2-line>md-icon:first-child,md-list-item.md-2-line>.md-no-style>md-icon:first-child{align-self:flex-start}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text{flex:1 1 auto}md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{height:auto;min-height:88px}md-list-item.md-3-line::before,md-list-item.md-3-line>.md-no-style::before{content:"";min-height:88px;visibility:hidden;display:inline-block}md-list-item.md-3-line>md-icon:first-child,md-list-item.md-3-line>.md-avatar,md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}.md-open-menu-container{position:fixed;left:0;top:0;z-index:100;opacity:0;border-radius:2px;max-height:calc(100vh - 10px);overflow:auto}.md-open-menu-container md-menu-divider{margin-top:4px;margin-bottom:4px;height:1px;min-height:1px;max-height:1px;width:100%}.md-open-menu-container md-menu-content>*{opacity:0}.md-open-menu-container:not(.md-clickable){pointer-events:none}.md-open-menu-container.md-active{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:200ms}.md-open-menu-container.md-active>md-menu-content>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:200ms;transition-delay:100ms}.md-open-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}md-menu-content{display:flex;flex-direction:column;padding:8px 0;max-height:304px;overflow-y:auto}md-menu-content.md-dense{max-height:208px}md-menu-content.md-dense md-menu-item{height:32px;min-height:32px}md-menu-item{display:flex;flex-direction:row;min-height:48px;height:48px;align-content:center;justify-content:flex-start}md-menu-item>*{width:100%;margin:auto 0;padding-left:16px;padding-right:16px}md-menu-item>a.md-button{padding-top:5px}md-menu-item>.md-button{text-align:left;display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-menu-item>.md-button::-moz-focus-inner{padding:0;border:0}[dir=rtl] md-menu-item>.md-button{text-align:right}md-menu-item>.md-button md-icon{margin:auto 16px auto 0}[dir=rtl] md-menu-item>.md-button md-icon{margin:auto 0 auto 16px}md-menu-item>.md-button p{display:inline-block;margin:auto}md-menu-item>.md-button span{margin-top:auto;margin-bottom:auto}md-menu-item>.md-button .md-ripple-container{border-radius:inherit}md-toolbar .md-menu{height:auto;margin:auto;padding:0}@media(max-width: 959px){md-menu-content{min-width:112px}md-menu-content[width="3"]{min-width:168px}md-menu-content[width="4"]{min-width:224px}md-menu-content[width="5"]{min-width:280px}md-menu-content[width="6"]{min-width:336px}md-menu-content[width="7"]{min-width:392px}}@media(min-width: 960px){md-menu-content{min-width:96px}md-menu-content[width="3"]{min-width:192px}md-menu-content[width="4"]{min-width:256px}md-menu-content[width="5"]{min-width:320px}md-menu-content[width="6"]{min-width:384px}md-menu-content[width="7"]{min-width:448px}}md-toolbar.md-menu-toolbar h2.md-toolbar-tools{line-height:1rem;height:auto;padding:28px;padding-bottom:12px}md-toolbar.md-has-open-menu{position:relative;z-index:100}md-menu-bar{padding:0 20px;display:block;position:relative;z-index:2}md-menu-bar .md-menu{display:inline-block;padding:0;position:relative}md-menu-bar button{font-size:14px;padding:0 10px;margin:0;border:0;background-color:transparent;height:40px}md-menu-bar md-backdrop.md-menu-backdrop{z-index:-2}md-menu-content.md-menu-bar-menu.md-dense{max-height:none;padding:16px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent{position:relative}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{position:absolute;padding:0;width:24px;top:6px;left:24px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{left:auto;right:24px}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 32px 0 64px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 64px 0 32px}md-menu-content.md-menu-bar-menu.md-dense .md-button{min-height:0;height:32px}md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:right}md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:right;margin:0 8px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:left}md-menu-content.md-menu-bar-menu.md-dense md-menu-divider{margin:8px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:right}md-menu-content.md-menu-bar-menu.md-dense .md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{position:relative;margin:0;width:100%;text-transform:none;font-weight:normal;border-radius:0px;padding-left:16px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{padding-left:0;padding-right:16px}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{display:block;content:"▼";position:absolute;top:0px;speak:none;transform:rotate(270deg) scaleY(0.45) scaleX(0.9);right:28px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{transform:rotate(90deg) scaleY(0.45) scaleX(0.9)}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{right:auto;left:28px}.md-nav-bar{border-style:solid;border-width:0 0 1px;height:48px;position:relative}._md-nav-bar-list{outline:none;list-style:none;margin:0;padding:0;box-sizing:border-box;display:flex;flex-direction:row}.md-nav-item:first-of-type{margin-left:8px}.md-button._md-nav-button{line-height:24px;margin:0 4px;padding:12px 16px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1)}.md-button._md-nav-button:focus{outline:none}md-nav-ink-bar{background-color:#000;position:absolute;bottom:0;left:0;width:100%;height:2px;transform-origin:left top;will-change:transform;transition:transform .125s cubic-bezier(0.35, 0, 0.25, 1)}md-nav-ink-bar.ng-animate{transition:none}md-nav-extra-content{min-height:48px;padding-right:12px}@keyframes indeterminate-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}md-progress-circular{position:relative;display:block;transform:scale(1, 1)}[dir=rtl] md-progress-circular{transform:scale(-1, 1)}md-progress-circular._md-progress-circular-disabled{visibility:hidden}md-progress-circular.md-mode-indeterminate svg{animation:indeterminate-rotate 1568.63ms linear infinite}md-progress-circular svg{position:absolute;overflow:visible;top:0;left:0}md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0 !important;margin-bottom:0 !important;transform:scale(1, 1)}[dir=rtl] md-progress-linear{transform:scale(-1, 1)}md-progress-linear._md-progress-linear-disabled{visibility:hidden}md-progress-linear .md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;transform:translate(0, 0) scale(1, 1)}md-progress-linear .md-container .md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear .md-container .md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px !important;background-position:0px -23px}md-progress-linear .md-container .md-bar1,md-progress-linear .md-container .md-bar2{transition:transform .2s linear}md-progress-linear .md-container.md-mode-query .md-bar1{display:none}md-progress-linear .md-container.md-mode-query .md-bar2{transition:all .2s linear;animation:query .8s infinite cubic-bezier(0.39, 0.575, 0.565, 1)}md-progress-linear .md-container.md-mode-determinate .md-bar1{display:none}md-progress-linear .md-container.md-mode-indeterminate .md-bar1{animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear .md-container.md-mode-indeterminate .md-bar2{animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container{animation:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar1{animation-name:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar2{animation-name:none}md-progress-linear .md-container.md-mode-buffer{background-color:transparent !important;transition:all .2s linear}md-progress-linear .md-container.md-mode-buffer .md-dashed:before{display:block;animation:buffer 3s infinite linear}@keyframes query{0%{opacity:1;transform:translateX(35%) scale(0.3, 1)}100%{opacity:0;transform:translateX(-50%) scale(0, 1)}}@keyframes buffer{0%{opacity:1;background-position:0px -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes md-progress-linear-indeterminate-scale-1{0%{transform:scaleX(0.1);animation-timing-function:linear}36.6%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.334731432, 0.124819821, 0.785843996, 1)}69.15%{transform:scaleX(0.83);animation-timing-function:cubic-bezier(0.225732004, 0, 0.233648906, 1.3709798)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.1666666667%;animation-timing-function:linear}20%{left:-105.1666666667%;animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495818703)}69.15%{left:21.5%;animation-timing-function:cubic-bezier(0.302435, 0.38135197, 0.55, 0.956352125)}100%{left:95.4444444444%}}@keyframes md-progress-linear-indeterminate-scale-2{0%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.205028172, 0.057050836, 0.57660995, 0.453970841)}19.15%{transform:scaleX(0.57);animation-timing-function:cubic-bezier(0.152312994, 0.196431957, 0.648373778, 1.00431535)}44.15%{transform:scaleX(0.91);animation-timing-function:cubic-bezier(0.25775882, -0.003163357, 0.211761916, 1.38178961)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.8888888889%;animation-timing-function:cubic-bezier(0.15, 0, 0.5150584, 0.409684966)}25%{left:-17.25%;animation-timing-function:cubic-bezier(0.3103299, 0.284057684, 0.8, 0.733718979)}48.35%{left:29.5%;animation-timing-function:cubic-bezier(0.4, 0.627034903, 0.6, 0.902025796)}100%{left:117.3888888889%}}md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled]{cursor:default}md-radio-button[disabled] .md-container{cursor:default}md-radio-button .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer;left:0;right:auto}[dir=rtl] md-radio-button .md-container{left:auto}[dir=rtl] md-radio-button .md-container{right:0}md-radio-button .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div.md-container{top:12px}md-radio-button .md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button .md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:transform ease .28s;transform:scale(0)}md-radio-button.md-checked .md-on{transform:scale(0.5)}md-radio-button .md-label{box-sizing:border-box;position:relative;display:inline-block;margin-left:30px;margin-right:0;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}[dir=rtl] md-radio-button .md-label{margin-left:0}[dir=rtl] md-radio-button .md-label{margin-right:30px}md-radio-group:focus{outline:none}md-radio-group.md-focused.ng-not-empty .md-checked .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group.md-focused.ng-empty>md-radio-button:first-child .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group[disabled] md-radio-button{cursor:default}md-radio-group[disabled] md-radio-button .md-container{cursor:default}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-radio-button,.layout-xs-row>md-radio-button{margin-bottom:0}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-radio-button,.layout-gt-xs-row:not(.layout-sm-column)>md-radio-button,.layout-sm-row:not(.layout-sm-column)>md-radio-button{margin-bottom:0}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-sm-row:not(.layout-md-column)>md-radio-button,.layout-md-row:not(.layout-md-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-md-row:not(.layout-lg-column)>md-radio-button,.layout-lg-row:not(.layout-lg-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button{margin-bottom:0}}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px 10px 2px 6px;box-sizing:border-box;margin-top:0;margin-bottom:0}.md-inline-form md-radio-group md-radio-button .md-label{top:4px}.md-inline-form md-radio-group md-radio-button .md-container{margin-top:2px}@media screen and (-ms-high-contrast: active){md-radio-button.md-default-theme .md-on{background-color:#fff}}md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform-origin:left top}[dir=rtl] md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transform-origin:right top}md-input-container.md-input-focused:not([md-no-float]) md-select:not([placeholder]) .md-select-placeholder span:first-child{transform:translate(-2px, -22px) scale(0.75)}.md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none;transform:translateY(-1px)}.md-select-menu-container:not(.md-clickable){pointer-events:none}.md-select-menu-container md-progress-circular{display:table;margin:24px auto !important}.md-select-menu-container.md-active{display:block;opacity:1}.md-select-menu-container.md-active md-select-menu{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms}.md-select-menu-container.md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transition-delay:100ms}.md-select-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}.md-inline-form md-select{margin-top:20px}md-input-container>md-select,.md-inline-form md-input-container>md-select{margin-top:0px}md-input-container>md-select{order:2}md-input-container:not(.md-input-has-value) md-select[required]:not(.md-no-asterisk) .md-select-value span:first-child:after,md-input-container:not(.md-input-has-value) md-select.ng-required:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-input-container.md-input-invalid md-select .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select{display:flex}md-select[required].ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,md-select.ng-required.ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-select[disabled] .md-select-value{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;padding-bottom:2px;padding-top:1px;transform:translateY(1px)}md-select:focus{outline:none}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]):focus .md-select-value{border-bottom-style:solid;border-bottom-width:2px;padding-bottom:0px}md-input-container md-select:not([disabled]):focus .md-select-value{border-bottom-width:2px}md-input-container md-select[disabled] .md-select-value{background-position:bottom -1px left 0}md-input-container md-select .md-select-value{min-height:26px;border-bottom-width:1px;padding-bottom:1px}md-input-container md-select .md-select-value.md-select-placeholder{padding-left:0;padding-right:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-left:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-right:0}.md-select-value{display:flex;align-items:center;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-bottom-width:1px;border-bottom-style:solid;background-color:rgba(0,0,0,0);position:relative;box-sizing:content-box;min-width:88px;min-height:26px;margin-bottom:auto;-ms-flex-item-align:start;flex-grow:1}[dir=rtl] .md-select-value{padding-left:2px}[dir=rtl] .md-select-value{padding-right:0}.md-select-value>span:not(.md-select-icon){max-width:100%;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-select-value>span:not(.md-select-icon) .md-text{display:inline}.md-select-value .md-select-icon{display:block;align-items:flex-end;text-align:right;width:24px;transform:translateY(-2px);font-size:1.2rem}[dir=rtl] .md-select-value .md-select-icon{align-items:flex-start}[dir=rtl] .md-select-value .md-select-icon{text-align:left}.md-select-value .md-select-icon:after{display:block;content:"▼";position:relative;top:2px;right:-4px;left:auto;speak:none;font-size:13px;transform:scaleY(0.5)}[dir=rtl] .md-select-value .md-select-icon:after{right:auto}[dir=rtl] .md-select-value .md-select-icon:after{left:-4px}.md-select-value.md-select-placeholder{display:flex;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;z-index:1}md-select-menu{display:flex;flex-direction:column;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;transform-origin:left top;transform:scale(1)}md-select-menu.md-reverse{flex-direction:column-reverse}md-select-menu:not(.md-overflow) md-content{padding-top:8px;padding-bottom:8px}[dir=rtl] md-select-menu{transform-origin:right top}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:flex;align-items:center;width:auto;transition:background .15s linear;padding:0 16px 0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:none}md-option .md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast: active){.md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:40px;padding-right:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-right:40px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{right:0}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon{border-color:transparent}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled[disabled]{cursor:default}md-select-menu[multiple] md-option.md-checkbox-enabled.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:10.6666666667px;margin-right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-right:10.6666666667px}md-sidenav{box-sizing:border-box;position:absolute;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto;-webkit-overflow-scrolling:touch}md-sidenav ul{list-style:none}md-sidenav.md-closed{display:none}md-sidenav.md-closed-add,md-sidenav.md-closed-remove{display:flex;transition:.2s ease-in all}md-sidenav.md-closed-add.md-closed-add-active,md-sidenav.md-closed-remove.md-closed-remove-active{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-sidenav.md-locked-open-add,md-sidenav.md-locked-open-remove{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open,md-sidenav.md-locked-open.md-closed,md-sidenav.md-locked-open.md-closed.md-sidenav-left,md-sidenav.md-locked-open.md-closed.md-sidenav-right{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open-remove.md-closed{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-closed.md-locked-open-add{position:static;display:flex;transform:translate3d(0%, 0, 0)}md-sidenav.md-closed.md-locked-open-add:not(.md-locked-open-add-active){transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}md-sidenav.md-closed.md-locked-open-add-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-sidenav.md-locked-open-remove-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}.md-sidenav-backdrop.md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;transform:translate3d(0%, 0, 0)}.md-sidenav-left.md-closed,md-sidenav.md-closed{transform:translate3d(-100%, 0, 0)}.md-sidenav-right{left:100%;top:0;transform:translate(-100%, 0)}.md-sidenav-right.md-closed{transform:translate(0%, 0)}@media(min-width: 600px){md-sidenav{max-width:400px}}@media(max-width: 456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast: active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}@keyframes sliderFocusThumb{0%{transform:scale(0.7)}30%{transform:scale(1)}100%{transform:scale(0.7)}}@keyframes sliderDiscreteFocusThumb{0%{transform:scale(0.7)}50%{transform:scale(0.8)}100%{transform:scale(0)}}@keyframes sliderDiscreteFocusRing{0%{transform:scale(0.7);opacity:0}50%{transform:scale(1);opacity:1}100%{transform:scale(0)}}md-slider{height:48px;min-width:128px;position:relative;margin-left:4px;margin-right:4px;padding:0;display:block;flex-direction:row}md-slider *,md-slider *:after{box-sizing:border-box}md-slider .md-slider-wrapper{outline:none;width:100%;height:100%}md-slider .md-slider-content{position:relative}md-slider .md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider .md-track{position:absolute;left:0;right:0;height:100%}md-slider .md-track-fill{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:width,height}md-slider .md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider .md-track-ticks canvas{width:100%;height:100%}md-slider .md-thumb-container{position:absolute;left:0;top:50%;transform:translate3d(-50%, -50%, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:left,right,bottom}[dir=rtl] md-slider .md-thumb-container{left:auto;right:0}md-slider .md-thumb{z-index:1;position:absolute;left:-10px;top:14px;width:20px;height:20px;border-radius:20px;transform:scale(0.7);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}[dir=rtl] md-slider .md-thumb{left:auto;right:-10px}md-slider .md-thumb:after{content:"";position:absolute;width:20px;height:20px;border-radius:20px;border-width:3px;border-style:solid;transition:inherit}md-slider .md-sign{display:flex;align-items:center;justify-content:center;position:absolute;left:-14px;top:-17px;width:28px;height:28px;border-radius:28px;transform:scale(0.4) translate3d(0, 67.5px, 0);transition:all .3s cubic-bezier(0.35, 0, 0.25, 1)}md-slider .md-sign:after{position:absolute;content:"";left:0px;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-sign:after{left:auto;right:0px}md-slider .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider .md-focus-ring{position:absolute;left:-17px;top:7px;width:34px;height:34px;border-radius:34px;transform:scale(0.7);opacity:0;transition:all .35s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-focus-ring{left:auto;right:-17px}md-slider .md-disabled-thumb{position:absolute;left:-14px;top:10px;width:28px;height:28px;border-radius:28px;transform:scale(0.5);border-width:4px;border-style:solid;display:none}[dir=rtl] md-slider .md-disabled-thumb{left:auto;right:-14px}md-slider.md-min .md-sign{opacity:0}md-slider:focus{outline:none}md-slider.md-dragging .md-thumb-container,md-slider.md-dragging .md-track-fill{transition:none}md-slider:not([md-discrete]) .md-track-ticks,md-slider:not([md-discrete]) .md-sign{display:none}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper .md-thumb:hover{transform:scale(0.8)}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(1);opacity:1}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderFocusThumb .7s cubic-bezier(0.35, 0, 0.25, 1)}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb{transform:scale(1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(0);animation:sliderDiscreteFocusRing .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderDiscreteFocusThumb .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb,md-slider[md-discrete]:not([disabled]).md-active .md-thumb{transform:scale(0)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign,md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign:after,md-slider[md-discrete]:not([disabled]).md-active .md-sign,md-slider[md-discrete]:not([disabled]).md-active .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-discrete][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-discrete][disabled][readonly] .md-sign,md-slider[md-discrete][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[disabled] .md-track-fill{display:none}md-slider[disabled] .md-track-ticks{opacity:0}md-slider[disabled]:not([readonly]) .md-sign{opacity:0}md-slider[disabled] .md-thumb{transform:scale(0.5)}md-slider[disabled] .md-disabled-thumb{display:block}md-slider[md-vertical]{flex-direction:column;min-height:128px;min-width:0}md-slider[md-vertical] .md-slider-wrapper{flex:1;padding-top:12px;padding-bottom:12px;width:48px;align-self:center;display:flex;justify-content:center}md-slider[md-vertical] .md-track-container{height:100%;width:2px;top:0;left:calc(50% - (2px / 2))}md-slider[md-vertical] .md-thumb-container{top:auto;margin-bottom:23px;left:calc(50% - 1px);bottom:0}md-slider[md-vertical] .md-thumb-container .md-thumb:after{left:1px}md-slider[md-vertical] .md-thumb-container .md-focus-ring{left:-16px}md-slider[md-vertical] .md-track-fill{bottom:0}md-slider[md-vertical][md-discrete] .md-sign{left:-40px;top:9.5px;transform:scale(0.4) translate3d(67.5px, 0, 0)}md-slider[md-vertical][md-discrete] .md-sign:after{top:9.5px;left:19px;border-top:14px solid transparent;border-right:0;border-bottom:14px solid transparent;border-left-width:16px;border-left-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s ease-in-out}md-slider[md-vertical][md-discrete] .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider[md-vertical][md-discrete].md-active .md-sign:after,md-slider[md-vertical][md-discrete] .md-focused .md-sign:after,md-slider[md-vertical][md-discrete][disabled][readonly] .md-sign:after{top:0}md-slider[md-vertical][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-vertical][disabled][readonly] .md-sign,md-slider[md-vertical][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:auto;right:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{right:auto}md-slider[md-invert][md-vertical] .md-track-fill{bottom:auto;top:0}md-slider-container{display:flex;align-items:center;flex-direction:row}md-slider-container>*:first-child:not(md-slider),md-slider-container>*:last-child:not(md-slider){min-width:25px;max-width:42px;height:25px;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:color,max-width}md-slider-container>*:first-child:not(md-slider){margin-right:16px}[dir=rtl] md-slider-container>*:first-child:not(md-slider){margin-right:auto;margin-left:16px}md-slider-container>*:last-child:not(md-slider){margin-left:16px}[dir=rtl] md-slider-container>*:last-child:not(md-slider){margin-left:auto;margin-right:16px}md-slider-container[md-vertical]{flex-direction:column}md-slider-container[md-vertical]>*:first-child:not(md-slider),md-slider-container[md-vertical]>*:last-child:not(md-slider){margin-right:0;margin-left:0;text-align:center}md-slider-container md-input-container input[type=number]{text-align:center;padding-left:15px;height:50px;margin-top:-25px}[dir=rtl] md-slider-container md-input-container input[type=number]{padding-left:0;padding-right:15px}@media screen and (-ms-high-contrast: active){md-slider.md-default-theme .md-track{border-bottom:1px solid #fff}}.md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute !important;transform:translate3d(-9999px, -9999px, 0)}.md-sticky-clone[sticky-state=active]{transform:translate3d(0, 0, 0)}.md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) .md-subheader-inner{animation:subheaderStickyHoverIn .3s ease-out both}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] .md-subheader-inner:after{animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0 0 0 0;position:relative}.md-subheader .md-subheader-inner{display:block;padding:16px}.md-subheader .md-subheader-content{display:block;z-index:1;position:relative}[md-swipe-left],[md-swipe-right]{touch-action:pan-y}[md-swipe-up],[md-swipe-down]{touch-action:pan-x}.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:none;user-select:none;height:30px;line-height:28px;align-items:center;display:flex;margin-left:inherit;margin-right:16px}[dir=rtl] md-switch{margin-left:16px}[dir=rtl] md-switch{margin-right:inherit}md-switch:last-of-type{margin-left:inherit;margin-right:0}[dir=rtl] md-switch:last-of-type{margin-left:0}[dir=rtl] md-switch:last-of-type{margin-right:inherit}md-switch[disabled]{cursor:default}md-switch[disabled] .md-container{cursor:default}md-switch .md-container{cursor:grab;width:36px;height:24px;position:relative;user-select:none;margin-right:8px;float:left}[dir=rtl] md-switch .md-container{margin-right:0px;margin-left:8px}md-switch.md-inverted .md-container{margin-right:initial;margin-left:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-right:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-left:initial}md-switch:not([disabled]) .md-dragging,md-switch:not([disabled]).md-dragging .md-container{cursor:grabbing}md-switch.md-focused .md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch .md-label{border-color:transparent;border-width:0;float:left}md-switch .md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch .md-thumb-container{top:2px;left:0;width:16px;position:absolute;transform:translate3d(0, 0, 0);z-index:1}md-switch.md-checked .md-thumb-container{transform:translate3d(100%, 0, 0)}md-switch .md-thumb{position:absolute;margin:0;left:0;top:0;outline:none;height:20px;width:20px;border-radius:50%;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-switch .md-thumb:before{background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch .md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb-container,md-switch:not(.md-dragging) .md-thumb{transition:all .08s linear;transition-property:transform,background-color}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb{transition-delay:.05s}@media screen and (-ms-high-contrast: active){md-switch.md-default-theme .md-bar{background-color:#666}md-switch.md-default-theme.md-checked .md-bar{background-color:#9e9e9e}md-switch.md-default-theme .md-thumb{background-color:#fff}}@keyframes md-tab-content-hide{0%{opacity:1}50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom]>md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom]>md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;transform:translate(0, 0)}md-tabs-wrapper md-prev-button,md-tabs-wrapper md-next-button{height:100%;width:32px;position:absolute;top:50%;transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:transparent no-repeat center center;transition:all .5s cubic-bezier(0.35, 0, 0.25, 1)}md-tabs-wrapper md-prev-button:focus,md-tabs-wrapper md-next-button:focus{outline:none}md-tabs-wrapper md-prev-button.md-disabled,md-tabs-wrapper md-next-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-prev-button.ng-leave,md-tabs-wrapper md-next-button.ng-leave{transition:none}md-tabs-wrapper md-prev-button md-icon,md-tabs-wrapper md-next-button md-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}[dir=rtl] md-tabs-wrapper md-prev-button,[dir=rtl] md-tabs-wrapper md-next-button{transform:rotateY(180deg) translateY(-50%)}md-tabs-wrapper md-prev-button{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}[dir=rtl] md-tabs-wrapper md-prev-button{left:auto;right:0}md-tabs-wrapper md-next-button{right:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}[dir=rtl] md-tabs-wrapper md-next-button{right:auto;left:0}md-tabs-wrapper md-next-button md-icon{transform:translate(-50%, -50%) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:"";display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0;left:0}[dir=rtl] md-tabs-canvas .md-dummy-wrapper{left:auto;right:0}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:flex;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:flex;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);position:absolute;left:0;transform:translate(0, 0)}md-pagination-wrapper:after{content:"";display:table;clear:both}[dir=rtl] md-pagination-wrapper{left:auto;right:0}md-pagination-wrapper.md-center-tabs{position:relative;justify-content:center}md-pagination-wrapper md-tab-item{min-width:72px}@media(min-width: 600px){md-pagination-wrapper md-tab-item{min-width:160px}}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:flex;position:absolute;top:0;left:0;right:0;bottom:0;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);overflow:auto;transform:translate(0, 0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.ng-leave,md-tab-content.md-no-transition{transition:none}md-tab-content.md-left:not(.md-active){transform:translateX(-100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-left:not(.md-active){transform:translateX(100%)}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){transform:translateX(100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-right:not(.md-active){transform:translateX(-100%)}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div{flex:1 0 100%;min-width:0}md-tab-content>div.ng-leave{animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left .125s cubic-bezier(0.35, 0, 0.25, 1),right .25s cubic-bezier(0.35, 0, 0.25, 1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(0.35, 0, 0.25, 1),right .125s cubic-bezier(0.35, 0, 0.25, 1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;float:left;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-tab{float:right}.md-tab.md-focused,.md-tab:focus{box-shadow:none;outline:none}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;touch-action:pan-y;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs,md-toolbar+md-dialog-content md-tabs{border-top-left-radius:0;border-top-right-radius:0}.md-toast-text{padding:0 8px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast .md-toast-content{display:flex;flex-direction:row;align-items:center;max-height:168px;max-width:100%;min-height:48px;padding:0 16px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;transform:translate3d(0, 0, 0) rotateZ(0deg);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);justify-content:flex-start}md-toast .md-toast-content::before{content:"";min-height:48px;visibility:hidden;display:inline-block}[dir=rtl] md-toast .md-toast-content{justify-content:flex-end}md-toast .md-toast-content span{flex:1 1 0%;box-sizing:border-box;min-width:0}md-toast.md-capsule{border-radius:24px}md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-toast.md-swipeleft .md-toast-content,md-toast.md-swiperight .md-toast-content,md-toast.md-swipeup .md-toast-content,md-toast.md-swipedown .md-toast-content{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{transform:translate3d(0, 100%, 0)}md-toast.ng-enter.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{transform:translate3d(0, 0, 0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;transform:translate3d(0, 100%, 0)}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}md-toast.ng-leave.ng-leave-active.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0;margin-right:0;margin-left:8px}[dir=rtl] md-toast .md-button{margin-right:8px}[dir=rtl] md-toast .md-button{margin-left:0}@media(max-width: 959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}}@media(min-width: 960px){md-toast{min-width:304px}md-toast.md-bottom{bottom:0}md-toast.md-left{left:0}md-toast.md-right{right:0}md-toast.md-top{top:0}md-toast._md-start{left:0}[dir=rtl] md-toast._md-start{left:auto;right:0}md-toast._md-end{right:0}[dir=rtl] md-toast._md-end{right:auto;left:0}md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content{transform:translate3d(-50%, 0, 0)}md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content{transform:translate3d(50%, 0, 0)}}@media(min-width: 1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast: active){md-toast{border:1px solid #fff}}.md-toast-animating{overflow:hidden !important}md-toolbar{box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%}md-toolbar._md-toolbar-transitions{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar *:before,md-toolbar *:after{box-sizing:border-box}md-toolbar.ng-animate{transition:none}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}md-toolbar>.md-indent{margin-left:64px}[dir=rtl] md-toolbar>.md-indent{margin-left:auto;margin-right:64px}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:flex;align-items:center;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:flex;align-items:center}.md-toolbar-tools md-checkbox{margin:inherit}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}.md-toolbar-tools .md-button.ng-animate,.md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate{transition:none}.md-toolbar-tools>.md-button:first-child{margin-left:-8px}[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-8px}.md-toolbar-tools>.md-button:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0}[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:auto;margin-left:0}@media screen and (-ms-high-contrast: active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media(min-width: 0)and (max-width: 959px)and (orientation: portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media(min-width: 0)and (max-width: 959px)and (orientation: landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}.md-tooltip{display:inline-block;pointer-events:none;border-radius:4px;overflow:hidden;opacity:0;font-weight:500;font-size:14px;white-space:nowrap;text-overflow:ellipsis;height:32px;line-height:32px;padding-right:16px;padding-left:16px}.md-tooltip.md-origin-top{transform-origin:center bottom;margin-top:-24px}.md-tooltip.md-origin-right{transform-origin:left center;margin-left:24px}.md-tooltip.md-origin-bottom{transform-origin:center top;margin-top:24px}.md-tooltip.md-origin-left{transform-origin:right center;margin-left:-24px}@media(min-width: 960px){.md-tooltip{font-size:10px;height:22px;line-height:22px;padding-right:8px;padding-left:8px}.md-tooltip.md-origin-top{margin-top:-14px}.md-tooltip.md-origin-right{margin-left:14px}.md-tooltip.md-origin-bottom{margin-top:14px}.md-tooltip.md-origin-left{margin-left:-14px}}.md-tooltip.md-show-add{transform:scale(0)}.md-tooltip.md-show{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms;transform:scale(1);opacity:.9}.md-tooltip.md-hide{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transform:scale(0);opacity:0}.md-truncate{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.md-truncate.md-clip{text-overflow:clip}.md-truncate.flex{width:0}.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0;-webkit-overflow-scrolling:touch}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;right:auto;white-space:nowrap}[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;left:auto}.md-whiteframe-1dp,.md-whiteframe-z1{box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}.md-whiteframe-2dp{box-shadow:0px 1px 5px 0px rgba(0,0,0,.2),0px 2px 2px 0px rgba(0,0,0,.14),0px 3px 1px -2px rgba(0,0,0,.12)}.md-whiteframe-3dp{box-shadow:0px 1px 8px 0px rgba(0,0,0,.2),0px 3px 4px 0px rgba(0,0,0,.14),0px 3px 3px -2px rgba(0,0,0,.12)}.md-whiteframe-4dp,.md-whiteframe-z2{box-shadow:0px 2px 4px -1px rgba(0,0,0,.2),0px 4px 5px 0px rgba(0,0,0,.14),0px 1px 10px 0px rgba(0,0,0,.12)}.md-whiteframe-5dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 5px 8px 0px rgba(0,0,0,.14),0px 1px 14px 0px rgba(0,0,0,.12)}.md-whiteframe-6dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 6px 10px 0px rgba(0,0,0,.14),0px 1px 18px 0px rgba(0,0,0,.12)}.md-whiteframe-7dp,.md-whiteframe-z3{box-shadow:0px 4px 5px -2px rgba(0,0,0,.2),0px 7px 10px 1px rgba(0,0,0,.14),0px 2px 16px 1px rgba(0,0,0,.12)}.md-whiteframe-8dp{box-shadow:0px 5px 5px -3px rgba(0,0,0,.2),0px 8px 10px 1px rgba(0,0,0,.14),0px 3px 14px 2px rgba(0,0,0,.12)}.md-whiteframe-9dp{box-shadow:0px 5px 6px -3px rgba(0,0,0,.2),0px 9px 12px 1px rgba(0,0,0,.14),0px 3px 16px 2px rgba(0,0,0,.12)}.md-whiteframe-10dp,.md-whiteframe-z4{box-shadow:0px 6px 6px -3px rgba(0,0,0,.2),0px 10px 14px 1px rgba(0,0,0,.14),0px 4px 18px 3px rgba(0,0,0,.12)}.md-whiteframe-11dp{box-shadow:0px 6px 7px -4px rgba(0,0,0,.2),0px 11px 15px 1px rgba(0,0,0,.14),0px 4px 20px 3px rgba(0,0,0,.12)}.md-whiteframe-12dp{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 12px 17px 2px rgba(0,0,0,.14),0px 5px 22px 4px rgba(0,0,0,.12)}.md-whiteframe-13dp,.md-whiteframe-z5{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12)}.md-whiteframe-14dp{box-shadow:0px 7px 9px -4px rgba(0,0,0,.2),0px 14px 21px 2px rgba(0,0,0,.14),0px 5px 26px 4px rgba(0,0,0,.12)}.md-whiteframe-15dp{box-shadow:0px 8px 9px -5px rgba(0,0,0,.2),0px 15px 22px 2px rgba(0,0,0,.14),0px 6px 28px 5px rgba(0,0,0,.12)}.md-whiteframe-16dp{box-shadow:0px 8px 10px -5px rgba(0,0,0,.2),0px 16px 24px 2px rgba(0,0,0,.14),0px 6px 30px 5px rgba(0,0,0,.12)}.md-whiteframe-17dp{box-shadow:0px 8px 11px -5px rgba(0,0,0,.2),0px 17px 26px 2px rgba(0,0,0,.14),0px 6px 32px 5px rgba(0,0,0,.12)}.md-whiteframe-18dp{box-shadow:0px 9px 11px -5px rgba(0,0,0,.2),0px 18px 28px 2px rgba(0,0,0,.14),0px 7px 34px 6px rgba(0,0,0,.12)}.md-whiteframe-19dp{box-shadow:0px 9px 12px -6px rgba(0,0,0,.2),0px 19px 29px 2px rgba(0,0,0,.14),0px 7px 36px 6px rgba(0,0,0,.12)}.md-whiteframe-20dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 20px 31px 3px rgba(0,0,0,.14),0px 8px 38px 7px rgba(0,0,0,.12)}.md-whiteframe-21dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 21px 33px 3px rgba(0,0,0,.14),0px 8px 40px 7px rgba(0,0,0,.12)}.md-whiteframe-22dp{box-shadow:0px 10px 14px -6px rgba(0,0,0,.2),0px 22px 35px 3px rgba(0,0,0,.14),0px 8px 42px 7px rgba(0,0,0,.12)}.md-whiteframe-23dp{box-shadow:0px 11px 14px -7px rgba(0,0,0,.2),0px 23px 36px 3px rgba(0,0,0,.14),0px 9px 44px 8px rgba(0,0,0,.12)}.md-whiteframe-24dp{box-shadow:0px 11px 15px -7px rgba(0,0,0,.2),0px 24px 38px 3px rgba(0,0,0,.14),0px 9px 46px 8px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast: active){md-whiteframe{border:1px solid #fff}}@media print{md-whiteframe,[md-whiteframe]{background-color:#fff}}[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none !important}@-moz-document url-prefix(){.layout-fill{margin:0;width:100%;min-height:100%;height:100%}}.flex-order{order:0}.flex-order--20{order:-20}.flex-order--19{order:-19}.flex-order--18{order:-18}.flex-order--17{order:-17}.flex-order--16{order:-16}.flex-order--15{order:-15}.flex-order--14{order:-14}.flex-order--13{order:-13}.flex-order--12{order:-12}.flex-order--11{order:-11}.flex-order--10{order:-10}.flex-order--9{order:-9}.flex-order--8{order:-8}.flex-order--7{order:-7}.flex-order--6{order:-6}.flex-order--5{order:-5}.flex-order--4{order:-4}.flex-order--3{order:-3}.flex-order--2{order:-2}.flex-order--1{order:-1}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-order-11{order:11}.flex-order-12{order:12}.flex-order-13{order:13}.flex-order-14{order:14}.flex-order-15{order:15}.flex-order-16{order:16}.flex-order-17{order:17}.flex-order-18{order:18}.flex-order-19{order:19}.flex-order-20{order:20}.offset-0,.flex-offset-0,.layout-margin .flex-offset-0,.layout-margin .offset-0{margin-left:0}[dir=rtl] .offset-0,[dir=rtl] .flex-offset-0,[dir=rtl] .layout-margin .flex-offset-0,[dir=rtl] .layout-margin .offset-0{margin-left:auto;margin-right:0}.offset-5,.flex-offset-5,.layout-margin .flex-offset-5,.layout-margin .offset-5{margin-left:5%}[dir=rtl] .offset-5,[dir=rtl] .flex-offset-5,[dir=rtl] .layout-margin .flex-offset-5,[dir=rtl] .layout-margin .offset-5{margin-left:auto;margin-right:5%}.offset-10,.flex-offset-10,.layout-margin .flex-offset-10,.layout-margin .offset-10{margin-left:10%}[dir=rtl] .offset-10,[dir=rtl] .flex-offset-10,[dir=rtl] .layout-margin .flex-offset-10,[dir=rtl] .layout-margin .offset-10{margin-left:auto;margin-right:10%}.offset-15,.flex-offset-15,.layout-margin .flex-offset-15,.layout-margin .offset-15{margin-left:15%}[dir=rtl] .offset-15,[dir=rtl] .flex-offset-15,[dir=rtl] .layout-margin .flex-offset-15,[dir=rtl] .layout-margin .offset-15{margin-left:auto;margin-right:15%}.offset-20,.flex-offset-20,.layout-margin .flex-offset-20,.layout-margin .offset-20{margin-left:20%}[dir=rtl] .offset-20,[dir=rtl] .flex-offset-20,[dir=rtl] .layout-margin .flex-offset-20,[dir=rtl] .layout-margin .offset-20{margin-left:auto;margin-right:20%}.offset-25,.flex-offset-25,.layout-margin .flex-offset-25,.layout-margin .offset-25{margin-left:25%}[dir=rtl] .offset-25,[dir=rtl] .flex-offset-25,[dir=rtl] .layout-margin .flex-offset-25,[dir=rtl] .layout-margin .offset-25{margin-left:auto;margin-right:25%}.offset-30,.flex-offset-30,.layout-margin .flex-offset-30,.layout-margin .offset-30{margin-left:30%}[dir=rtl] .offset-30,[dir=rtl] .flex-offset-30,[dir=rtl] .layout-margin .flex-offset-30,[dir=rtl] .layout-margin .offset-30{margin-left:auto;margin-right:30%}.offset-35,.flex-offset-35,.layout-margin .flex-offset-35,.layout-margin .offset-35{margin-left:35%}[dir=rtl] .offset-35,[dir=rtl] .flex-offset-35,[dir=rtl] .layout-margin .flex-offset-35,[dir=rtl] .layout-margin .offset-35{margin-left:auto;margin-right:35%}.offset-40,.flex-offset-40,.layout-margin .flex-offset-40,.layout-margin .offset-40{margin-left:40%}[dir=rtl] .offset-40,[dir=rtl] .flex-offset-40,[dir=rtl] .layout-margin .flex-offset-40,[dir=rtl] .layout-margin .offset-40{margin-left:auto;margin-right:40%}.offset-45,.flex-offset-45,.layout-margin .flex-offset-45,.layout-margin .offset-45{margin-left:45%}[dir=rtl] .offset-45,[dir=rtl] .flex-offset-45,[dir=rtl] .layout-margin .flex-offset-45,[dir=rtl] .layout-margin .offset-45{margin-left:auto;margin-right:45%}.offset-50,.flex-offset-50,.layout-margin .flex-offset-50,.layout-margin .offset-50{margin-left:50%}[dir=rtl] .offset-50,[dir=rtl] .flex-offset-50,[dir=rtl] .layout-margin .flex-offset-50,[dir=rtl] .layout-margin .offset-50{margin-left:auto;margin-right:50%}.offset-55,.flex-offset-55,.layout-margin .flex-offset-55,.layout-margin .offset-55{margin-left:55%}[dir=rtl] .offset-55,[dir=rtl] .flex-offset-55,[dir=rtl] .layout-margin .flex-offset-55,[dir=rtl] .layout-margin .offset-55{margin-left:auto;margin-right:55%}.offset-60,.flex-offset-60,.layout-margin .flex-offset-60,.layout-margin .offset-60{margin-left:60%}[dir=rtl] .offset-60,[dir=rtl] .flex-offset-60,[dir=rtl] .layout-margin .flex-offset-60,[dir=rtl] .layout-margin .offset-60{margin-left:auto;margin-right:60%}.offset-65,.flex-offset-65,.layout-margin .flex-offset-65,.layout-margin .offset-65{margin-left:65%}[dir=rtl] .offset-65,[dir=rtl] .flex-offset-65,[dir=rtl] .layout-margin .flex-offset-65,[dir=rtl] .layout-margin .offset-65{margin-left:auto;margin-right:65%}.offset-70,.flex-offset-70,.layout-margin .flex-offset-70,.layout-margin .offset-70{margin-left:70%}[dir=rtl] .offset-70,[dir=rtl] .flex-offset-70,[dir=rtl] .layout-margin .flex-offset-70,[dir=rtl] .layout-margin .offset-70{margin-left:auto;margin-right:70%}.offset-75,.flex-offset-75,.layout-margin .flex-offset-75,.layout-margin .offset-75{margin-left:75%}[dir=rtl] .offset-75,[dir=rtl] .flex-offset-75,[dir=rtl] .layout-margin .flex-offset-75,[dir=rtl] .layout-margin .offset-75{margin-left:auto;margin-right:75%}.offset-80,.flex-offset-80,.layout-margin .flex-offset-80,.layout-margin .offset-80{margin-left:80%}[dir=rtl] .offset-80,[dir=rtl] .flex-offset-80,[dir=rtl] .layout-margin .flex-offset-80,[dir=rtl] .layout-margin .offset-80{margin-left:auto;margin-right:80%}.offset-85,.flex-offset-85,.layout-margin .flex-offset-85,.layout-margin .offset-85{margin-left:85%}[dir=rtl] .offset-85,[dir=rtl] .flex-offset-85,[dir=rtl] .layout-margin .flex-offset-85,[dir=rtl] .layout-margin .offset-85{margin-left:auto;margin-right:85%}.offset-90,.flex-offset-90,.layout-margin .flex-offset-90,.layout-margin .offset-90{margin-left:90%}[dir=rtl] .offset-90,[dir=rtl] .flex-offset-90,[dir=rtl] .layout-margin .flex-offset-90,[dir=rtl] .layout-margin .offset-90{margin-left:auto;margin-right:90%}.offset-95,.flex-offset-95,.layout-margin .flex-offset-95,.layout-margin .offset-95{margin-left:95%}[dir=rtl] .offset-95,[dir=rtl] .flex-offset-95,[dir=rtl] .layout-margin .flex-offset-95,[dir=rtl] .layout-margin .offset-95{margin-left:auto;margin-right:95%}.offset-33,.flex-offset-33,.layout-margin .flex-offset-33,.layout-margin .offset-33{margin-left:33.3333333333%}.offset-66,.flex-offset-66,.layout-margin .flex-offset-66,.layout-margin .offset-66{margin-left:66.6666666667%}[dir=rtl] .offset-66,[dir=rtl] .flex-offset-66,[dir=rtl] .layout-margin .flex-offset-66,[dir=rtl] .layout-margin .offset-66{margin-left:auto;margin-right:66.6666666667%}.layout-align,.layout-align-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-start,.layout-align-start-start,.layout-align-start-center,.layout-align-start-end,.layout-align-start-stretch{justify-content:flex-start}.layout-align-center,.layout-align-center-start,.layout-align-center-center,.layout-align-center-end,.layout-align-center-stretch{justify-content:center}.layout-align-end,.layout-align-end-start,.layout-align-end-center,.layout-align-end-end,.layout-align-end-stretch{justify-content:flex-end}.layout-align-space-around,.layout-align-space-around-center,.layout-align-space-around-start,.layout-align-space-around-end,.layout-align-space-around-stretch{justify-content:space-around}.layout-align-space-between,.layout-align-space-between-center,.layout-align-space-between-start,.layout-align-space-between-end,.layout-align-space-between-stretch{justify-content:space-between}.layout-align-start-start,.layout-align-center-start,.layout-align-end-start,.layout-align-space-between-start,.layout-align-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-start-center,.layout-align-center-center,.layout-align-end-center,.layout-align-space-between-center,.layout-align-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-start-center>*,.layout-align-center-center>*,.layout-align-end-center>*,.layout-align-space-between-center>*,.layout-align-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-start-end,.layout-align-center-end,.layout-align-end-end,.layout-align-space-between-end,.layout-align-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-start-stretch,.layout-align-center-stretch,.layout-align-end-stretch,.layout-align-space-between-stretch,.layout-align-space-around-stretch{align-items:stretch;align-content:stretch}.flex{flex:1;box-sizing:border-box}.flex-grow{flex:1 1 100%;box-sizing:border-box}.flex-initial{flex:0 1 auto;box-sizing:border-box}.flex-auto{flex:1 1 auto;box-sizing:border-box}.flex-none{flex:0 0 auto;box-sizing:border-box}.flex-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex{min-width:0}.layout-column>.flex-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-column>.flex{min-height:0}.layout,.layout-column,.layout-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-column{flex-direction:column}.layout-row{flex-direction:row}.layout-padding-sm>*,.layout-padding>.flex-sm{padding:4px}.layout-padding,.layout-padding-gt-sm,.layout-padding-md,.layout-padding>*,.layout-padding-gt-sm>*,.layout-padding-md>*,.layout-padding>.flex,.layout-padding>.flex-gt-sm,.layout-padding>.flex-md{padding:8px}.layout-padding-gt-md>*,.layout-padding-lg>*,.layout-padding-gt-lg>*,.layout-padding>.flex-gt-md,.layout-padding>.flex-lg,.layout-padding>.flex-lg,.layout-padding>.flex-gt-lg{padding:16px}.layout-margin-sm>*,.layout-margin>.flex-sm{margin:4px}.layout-margin,.layout-margin-gt-sm,.layout-margin-md,.layout-margin>*,.layout-margin-gt-sm>*,.layout-margin-md>*,.layout-margin>.flex,.layout-margin>.flex-gt-sm,.layout-margin>.flex-md{margin:8px}.layout-margin-gt-md>*,.layout-margin-lg>*,.layout-margin-gt-lg>*,.layout-margin>.flex-gt-md,.layout-margin>.flex-lg,.layout-margin>.flex-gt-lg{margin:16px}.layout-wrap{flex-wrap:wrap}.layout-nowrap{flex-wrap:nowrap}.layout-fill{margin:0;width:100%;min-height:100%;height:100%}@media(max-width: 599px){.hide-xs:not(.show-xs):not(.show),.hide:not(.show-xs):not(.show){display:none}.flex-order-xs--20{order:-20}.flex-order-xs--19{order:-19}.flex-order-xs--18{order:-18}.flex-order-xs--17{order:-17}.flex-order-xs--16{order:-16}.flex-order-xs--15{order:-15}.flex-order-xs--14{order:-14}.flex-order-xs--13{order:-13}.flex-order-xs--12{order:-12}.flex-order-xs--11{order:-11}.flex-order-xs--10{order:-10}.flex-order-xs--9{order:-9}.flex-order-xs--8{order:-8}.flex-order-xs--7{order:-7}.flex-order-xs--6{order:-6}.flex-order-xs--5{order:-5}.flex-order-xs--4{order:-4}.flex-order-xs--3{order:-3}.flex-order-xs--2{order:-2}.flex-order-xs--1{order:-1}.flex-order-xs-0{order:0}.flex-order-xs-1{order:1}.flex-order-xs-2{order:2}.flex-order-xs-3{order:3}.flex-order-xs-4{order:4}.flex-order-xs-5{order:5}.flex-order-xs-6{order:6}.flex-order-xs-7{order:7}.flex-order-xs-8{order:8}.flex-order-xs-9{order:9}.flex-order-xs-10{order:10}.flex-order-xs-11{order:11}.flex-order-xs-12{order:12}.flex-order-xs-13{order:13}.flex-order-xs-14{order:14}.flex-order-xs-15{order:15}.flex-order-xs-16{order:16}.flex-order-xs-17{order:17}.flex-order-xs-18{order:18}.flex-order-xs-19{order:19}.flex-order-xs-20{order:20}.offset-xs-0,.flex-offset-xs-0,.layout-margin .flex-offset-xs-0,.layout-margin .offset-xs-0{margin-left:0}[dir=rtl] .offset-xs-0,[dir=rtl] .flex-offset-xs-0,[dir=rtl] .layout-margin .flex-offset-xs-0,[dir=rtl] .layout-margin .offset-xs-0{margin-left:auto;margin-right:0}.offset-xs-5,.flex-offset-xs-5,.layout-margin .flex-offset-xs-5,.layout-margin .offset-xs-5{margin-left:5%}[dir=rtl] .offset-xs-5,[dir=rtl] .flex-offset-xs-5,[dir=rtl] .layout-margin .flex-offset-xs-5,[dir=rtl] .layout-margin .offset-xs-5{margin-left:auto;margin-right:5%}.offset-xs-10,.flex-offset-xs-10,.layout-margin .flex-offset-xs-10,.layout-margin .offset-xs-10{margin-left:10%}[dir=rtl] .offset-xs-10,[dir=rtl] .flex-offset-xs-10,[dir=rtl] .layout-margin .flex-offset-xs-10,[dir=rtl] .layout-margin .offset-xs-10{margin-left:auto;margin-right:10%}.offset-xs-15,.flex-offset-xs-15,.layout-margin .flex-offset-xs-15,.layout-margin .offset-xs-15{margin-left:15%}[dir=rtl] .offset-xs-15,[dir=rtl] .flex-offset-xs-15,[dir=rtl] .layout-margin .flex-offset-xs-15,[dir=rtl] .layout-margin .offset-xs-15{margin-left:auto;margin-right:15%}.offset-xs-20,.flex-offset-xs-20,.layout-margin .flex-offset-xs-20,.layout-margin .offset-xs-20{margin-left:20%}[dir=rtl] .offset-xs-20,[dir=rtl] .flex-offset-xs-20,[dir=rtl] .layout-margin .flex-offset-xs-20,[dir=rtl] .layout-margin .offset-xs-20{margin-left:auto;margin-right:20%}.offset-xs-25,.flex-offset-xs-25,.layout-margin .flex-offset-xs-25,.layout-margin .offset-xs-25{margin-left:25%}[dir=rtl] .offset-xs-25,[dir=rtl] .flex-offset-xs-25,[dir=rtl] .layout-margin .flex-offset-xs-25,[dir=rtl] .layout-margin .offset-xs-25{margin-left:auto;margin-right:25%}.offset-xs-30,.flex-offset-xs-30,.layout-margin .flex-offset-xs-30,.layout-margin .offset-xs-30{margin-left:30%}[dir=rtl] .offset-xs-30,[dir=rtl] .flex-offset-xs-30,[dir=rtl] .layout-margin .flex-offset-xs-30,[dir=rtl] .layout-margin .offset-xs-30{margin-left:auto;margin-right:30%}.offset-xs-35,.flex-offset-xs-35,.layout-margin .flex-offset-xs-35,.layout-margin .offset-xs-35{margin-left:35%}[dir=rtl] .offset-xs-35,[dir=rtl] .flex-offset-xs-35,[dir=rtl] .layout-margin .flex-offset-xs-35,[dir=rtl] .layout-margin .offset-xs-35{margin-left:auto;margin-right:35%}.offset-xs-40,.flex-offset-xs-40,.layout-margin .flex-offset-xs-40,.layout-margin .offset-xs-40{margin-left:40%}[dir=rtl] .offset-xs-40,[dir=rtl] .flex-offset-xs-40,[dir=rtl] .layout-margin .flex-offset-xs-40,[dir=rtl] .layout-margin .offset-xs-40{margin-left:auto;margin-right:40%}.offset-xs-45,.flex-offset-xs-45,.layout-margin .flex-offset-xs-45,.layout-margin .offset-xs-45{margin-left:45%}[dir=rtl] .offset-xs-45,[dir=rtl] .flex-offset-xs-45,[dir=rtl] .layout-margin .flex-offset-xs-45,[dir=rtl] .layout-margin .offset-xs-45{margin-left:auto;margin-right:45%}.offset-xs-50,.flex-offset-xs-50,.layout-margin .flex-offset-xs-50,.layout-margin .offset-xs-50{margin-left:50%}[dir=rtl] .offset-xs-50,[dir=rtl] .flex-offset-xs-50,[dir=rtl] .layout-margin .flex-offset-xs-50,[dir=rtl] .layout-margin .offset-xs-50{margin-left:auto;margin-right:50%}.offset-xs-55,.flex-offset-xs-55,.layout-margin .flex-offset-xs-55,.layout-margin .offset-xs-55{margin-left:55%}[dir=rtl] .offset-xs-55,[dir=rtl] .flex-offset-xs-55,[dir=rtl] .layout-margin .flex-offset-xs-55,[dir=rtl] .layout-margin .offset-xs-55{margin-left:auto;margin-right:55%}.offset-xs-60,.flex-offset-xs-60,.layout-margin .flex-offset-xs-60,.layout-margin .offset-xs-60{margin-left:60%}[dir=rtl] .offset-xs-60,[dir=rtl] .flex-offset-xs-60,[dir=rtl] .layout-margin .flex-offset-xs-60,[dir=rtl] .layout-margin .offset-xs-60{margin-left:auto;margin-right:60%}.offset-xs-65,.flex-offset-xs-65,.layout-margin .flex-offset-xs-65,.layout-margin .offset-xs-65{margin-left:65%}[dir=rtl] .offset-xs-65,[dir=rtl] .flex-offset-xs-65,[dir=rtl] .layout-margin .flex-offset-xs-65,[dir=rtl] .layout-margin .offset-xs-65{margin-left:auto;margin-right:65%}.offset-xs-70,.flex-offset-xs-70,.layout-margin .flex-offset-xs-70,.layout-margin .offset-xs-70{margin-left:70%}[dir=rtl] .offset-xs-70,[dir=rtl] .flex-offset-xs-70,[dir=rtl] .layout-margin .flex-offset-xs-70,[dir=rtl] .layout-margin .offset-xs-70{margin-left:auto;margin-right:70%}.offset-xs-75,.flex-offset-xs-75,.layout-margin .flex-offset-xs-75,.layout-margin .offset-xs-75{margin-left:75%}[dir=rtl] .offset-xs-75,[dir=rtl] .flex-offset-xs-75,[dir=rtl] .layout-margin .flex-offset-xs-75,[dir=rtl] .layout-margin .offset-xs-75{margin-left:auto;margin-right:75%}.offset-xs-80,.flex-offset-xs-80,.layout-margin .flex-offset-xs-80,.layout-margin .offset-xs-80{margin-left:80%}[dir=rtl] .offset-xs-80,[dir=rtl] .flex-offset-xs-80,[dir=rtl] .layout-margin .flex-offset-xs-80,[dir=rtl] .layout-margin .offset-xs-80{margin-left:auto;margin-right:80%}.offset-xs-85,.flex-offset-xs-85,.layout-margin .flex-offset-xs-85,.layout-margin .offset-xs-85{margin-left:85%}[dir=rtl] .offset-xs-85,[dir=rtl] .flex-offset-xs-85,[dir=rtl] .layout-margin .flex-offset-xs-85,[dir=rtl] .layout-margin .offset-xs-85{margin-left:auto;margin-right:85%}.offset-xs-90,.flex-offset-xs-90,.layout-margin .flex-offset-xs-90,.layout-margin .offset-xs-90{margin-left:90%}[dir=rtl] .offset-xs-90,[dir=rtl] .flex-offset-xs-90,[dir=rtl] .layout-margin .flex-offset-xs-90,[dir=rtl] .layout-margin .offset-xs-90{margin-left:auto;margin-right:90%}.offset-xs-95,.flex-offset-xs-95,.layout-margin .flex-offset-xs-95,.layout-margin .offset-xs-95{margin-left:95%}[dir=rtl] .offset-xs-95,[dir=rtl] .flex-offset-xs-95,[dir=rtl] .layout-margin .flex-offset-xs-95,[dir=rtl] .layout-margin .offset-xs-95{margin-left:auto;margin-right:95%}.offset-xs-33,.flex-offset-xs-33,.layout-margin .flex-offset-xs-33,.layout-margin .offset-xs-33{margin-left:33.3333333333%}.offset-xs-66,.flex-offset-xs-66,.layout-margin .flex-offset-xs-66,.layout-margin .offset-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-xs-66,[dir=rtl] .flex-offset-xs-66,[dir=rtl] .layout-margin .flex-offset-xs-66,[dir=rtl] .layout-margin .offset-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xs,.layout-align-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xs-start,.layout-align-xs-start-start,.layout-align-xs-start-center,.layout-align-xs-start-end,.layout-align-xs-start-stretch{justify-content:flex-start}.layout-align-xs-center,.layout-align-xs-center-start,.layout-align-xs-center-center,.layout-align-xs-center-end,.layout-align-xs-center-stretch{justify-content:center}.layout-align-xs-end,.layout-align-xs-end-start,.layout-align-xs-end-center,.layout-align-xs-end-end,.layout-align-xs-end-stretch{justify-content:flex-end}.layout-align-xs-space-around,.layout-align-xs-space-around-center,.layout-align-xs-space-around-start,.layout-align-xs-space-around-end,.layout-align-xs-space-around-stretch{justify-content:space-around}.layout-align-xs-space-between,.layout-align-xs-space-between-center,.layout-align-xs-space-between-start,.layout-align-xs-space-between-end,.layout-align-xs-space-between-stretch{justify-content:space-between}.layout-align-xs-start-start,.layout-align-xs-center-start,.layout-align-xs-end-start,.layout-align-xs-space-between-start,.layout-align-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xs-start-center,.layout-align-xs-center-center,.layout-align-xs-end-center,.layout-align-xs-space-between-center,.layout-align-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xs-start-center>*,.layout-align-xs-center-center>*,.layout-align-xs-end-center>*,.layout-align-xs-space-between-center>*,.layout-align-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xs-start-end,.layout-align-xs-center-end,.layout-align-xs-end-end,.layout-align-xs-space-between-end,.layout-align-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xs-start-stretch,.layout-align-xs-center-stretch,.layout-align-xs-end-stretch,.layout-align-xs-space-between-stretch,.layout-align-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xs{flex:1;box-sizing:border-box}.flex-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xs-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xs-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xs-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xs-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xs-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xs-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xs-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xs-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xs-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xs-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xs-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xs-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xs-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xs-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xs-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xs-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xs-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xs-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xs-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xs-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xs-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex{min-width:0}.layout-xs-column>.flex-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xs-column>.flex-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-column>.flex{min-height:0}.layout-xs,.layout-xs-column,.layout-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xs-column{flex-direction:column}.layout-xs-row{flex-direction:row}}@media(min-width: 600px){.flex-order-gt-xs--20{order:-20}.flex-order-gt-xs--19{order:-19}.flex-order-gt-xs--18{order:-18}.flex-order-gt-xs--17{order:-17}.flex-order-gt-xs--16{order:-16}.flex-order-gt-xs--15{order:-15}.flex-order-gt-xs--14{order:-14}.flex-order-gt-xs--13{order:-13}.flex-order-gt-xs--12{order:-12}.flex-order-gt-xs--11{order:-11}.flex-order-gt-xs--10{order:-10}.flex-order-gt-xs--9{order:-9}.flex-order-gt-xs--8{order:-8}.flex-order-gt-xs--7{order:-7}.flex-order-gt-xs--6{order:-6}.flex-order-gt-xs--5{order:-5}.flex-order-gt-xs--4{order:-4}.flex-order-gt-xs--3{order:-3}.flex-order-gt-xs--2{order:-2}.flex-order-gt-xs--1{order:-1}.flex-order-gt-xs-0{order:0}.flex-order-gt-xs-1{order:1}.flex-order-gt-xs-2{order:2}.flex-order-gt-xs-3{order:3}.flex-order-gt-xs-4{order:4}.flex-order-gt-xs-5{order:5}.flex-order-gt-xs-6{order:6}.flex-order-gt-xs-7{order:7}.flex-order-gt-xs-8{order:8}.flex-order-gt-xs-9{order:9}.flex-order-gt-xs-10{order:10}.flex-order-gt-xs-11{order:11}.flex-order-gt-xs-12{order:12}.flex-order-gt-xs-13{order:13}.flex-order-gt-xs-14{order:14}.flex-order-gt-xs-15{order:15}.flex-order-gt-xs-16{order:16}.flex-order-gt-xs-17{order:17}.flex-order-gt-xs-18{order:18}.flex-order-gt-xs-19{order:19}.flex-order-gt-xs-20{order:20}.offset-gt-xs-0,.flex-offset-gt-xs-0,.layout-margin .flex-offset-gt-xs-0,.layout-margin .offset-gt-xs-0{margin-left:0}[dir=rtl] .offset-gt-xs-0,[dir=rtl] .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .offset-gt-xs-0{margin-left:auto;margin-right:0}.offset-gt-xs-5,.flex-offset-gt-xs-5,.layout-margin .flex-offset-gt-xs-5,.layout-margin .offset-gt-xs-5{margin-left:5%}[dir=rtl] .offset-gt-xs-5,[dir=rtl] .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .offset-gt-xs-5{margin-left:auto;margin-right:5%}.offset-gt-xs-10,.flex-offset-gt-xs-10,.layout-margin .flex-offset-gt-xs-10,.layout-margin .offset-gt-xs-10{margin-left:10%}[dir=rtl] .offset-gt-xs-10,[dir=rtl] .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .offset-gt-xs-10{margin-left:auto;margin-right:10%}.offset-gt-xs-15,.flex-offset-gt-xs-15,.layout-margin .flex-offset-gt-xs-15,.layout-margin .offset-gt-xs-15{margin-left:15%}[dir=rtl] .offset-gt-xs-15,[dir=rtl] .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .offset-gt-xs-15{margin-left:auto;margin-right:15%}.offset-gt-xs-20,.flex-offset-gt-xs-20,.layout-margin .flex-offset-gt-xs-20,.layout-margin .offset-gt-xs-20{margin-left:20%}[dir=rtl] .offset-gt-xs-20,[dir=rtl] .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .offset-gt-xs-20{margin-left:auto;margin-right:20%}.offset-gt-xs-25,.flex-offset-gt-xs-25,.layout-margin .flex-offset-gt-xs-25,.layout-margin .offset-gt-xs-25{margin-left:25%}[dir=rtl] .offset-gt-xs-25,[dir=rtl] .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .offset-gt-xs-25{margin-left:auto;margin-right:25%}.offset-gt-xs-30,.flex-offset-gt-xs-30,.layout-margin .flex-offset-gt-xs-30,.layout-margin .offset-gt-xs-30{margin-left:30%}[dir=rtl] .offset-gt-xs-30,[dir=rtl] .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .offset-gt-xs-30{margin-left:auto;margin-right:30%}.offset-gt-xs-35,.flex-offset-gt-xs-35,.layout-margin .flex-offset-gt-xs-35,.layout-margin .offset-gt-xs-35{margin-left:35%}[dir=rtl] .offset-gt-xs-35,[dir=rtl] .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .offset-gt-xs-35{margin-left:auto;margin-right:35%}.offset-gt-xs-40,.flex-offset-gt-xs-40,.layout-margin .flex-offset-gt-xs-40,.layout-margin .offset-gt-xs-40{margin-left:40%}[dir=rtl] .offset-gt-xs-40,[dir=rtl] .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .offset-gt-xs-40{margin-left:auto;margin-right:40%}.offset-gt-xs-45,.flex-offset-gt-xs-45,.layout-margin .flex-offset-gt-xs-45,.layout-margin .offset-gt-xs-45{margin-left:45%}[dir=rtl] .offset-gt-xs-45,[dir=rtl] .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .offset-gt-xs-45{margin-left:auto;margin-right:45%}.offset-gt-xs-50,.flex-offset-gt-xs-50,.layout-margin .flex-offset-gt-xs-50,.layout-margin .offset-gt-xs-50{margin-left:50%}[dir=rtl] .offset-gt-xs-50,[dir=rtl] .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .offset-gt-xs-50{margin-left:auto;margin-right:50%}.offset-gt-xs-55,.flex-offset-gt-xs-55,.layout-margin .flex-offset-gt-xs-55,.layout-margin .offset-gt-xs-55{margin-left:55%}[dir=rtl] .offset-gt-xs-55,[dir=rtl] .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .offset-gt-xs-55{margin-left:auto;margin-right:55%}.offset-gt-xs-60,.flex-offset-gt-xs-60,.layout-margin .flex-offset-gt-xs-60,.layout-margin .offset-gt-xs-60{margin-left:60%}[dir=rtl] .offset-gt-xs-60,[dir=rtl] .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .offset-gt-xs-60{margin-left:auto;margin-right:60%}.offset-gt-xs-65,.flex-offset-gt-xs-65,.layout-margin .flex-offset-gt-xs-65,.layout-margin .offset-gt-xs-65{margin-left:65%}[dir=rtl] .offset-gt-xs-65,[dir=rtl] .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .offset-gt-xs-65{margin-left:auto;margin-right:65%}.offset-gt-xs-70,.flex-offset-gt-xs-70,.layout-margin .flex-offset-gt-xs-70,.layout-margin .offset-gt-xs-70{margin-left:70%}[dir=rtl] .offset-gt-xs-70,[dir=rtl] .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .offset-gt-xs-70{margin-left:auto;margin-right:70%}.offset-gt-xs-75,.flex-offset-gt-xs-75,.layout-margin .flex-offset-gt-xs-75,.layout-margin .offset-gt-xs-75{margin-left:75%}[dir=rtl] .offset-gt-xs-75,[dir=rtl] .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .offset-gt-xs-75{margin-left:auto;margin-right:75%}.offset-gt-xs-80,.flex-offset-gt-xs-80,.layout-margin .flex-offset-gt-xs-80,.layout-margin .offset-gt-xs-80{margin-left:80%}[dir=rtl] .offset-gt-xs-80,[dir=rtl] .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .offset-gt-xs-80{margin-left:auto;margin-right:80%}.offset-gt-xs-85,.flex-offset-gt-xs-85,.layout-margin .flex-offset-gt-xs-85,.layout-margin .offset-gt-xs-85{margin-left:85%}[dir=rtl] .offset-gt-xs-85,[dir=rtl] .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .offset-gt-xs-85{margin-left:auto;margin-right:85%}.offset-gt-xs-90,.flex-offset-gt-xs-90,.layout-margin .flex-offset-gt-xs-90,.layout-margin .offset-gt-xs-90{margin-left:90%}[dir=rtl] .offset-gt-xs-90,[dir=rtl] .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .offset-gt-xs-90{margin-left:auto;margin-right:90%}.offset-gt-xs-95,.flex-offset-gt-xs-95,.layout-margin .flex-offset-gt-xs-95,.layout-margin .offset-gt-xs-95{margin-left:95%}[dir=rtl] .offset-gt-xs-95,[dir=rtl] .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .offset-gt-xs-95{margin-left:auto;margin-right:95%}.offset-gt-xs-33,.flex-offset-gt-xs-33,.layout-margin .flex-offset-gt-xs-33,.layout-margin .offset-gt-xs-33{margin-left:33.3333333333%}.offset-gt-xs-66,.flex-offset-gt-xs-66,.layout-margin .flex-offset-gt-xs-66,.layout-margin .offset-gt-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-xs-66,[dir=rtl] .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .offset-gt-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-xs,.layout-align-gt-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-xs-start,.layout-align-gt-xs-start-start,.layout-align-gt-xs-start-center,.layout-align-gt-xs-start-end,.layout-align-gt-xs-start-stretch{justify-content:flex-start}.layout-align-gt-xs-center,.layout-align-gt-xs-center-start,.layout-align-gt-xs-center-center,.layout-align-gt-xs-center-end,.layout-align-gt-xs-center-stretch{justify-content:center}.layout-align-gt-xs-end,.layout-align-gt-xs-end-start,.layout-align-gt-xs-end-center,.layout-align-gt-xs-end-end,.layout-align-gt-xs-end-stretch{justify-content:flex-end}.layout-align-gt-xs-space-around,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-around-stretch{justify-content:space-around}.layout-align-gt-xs-space-between,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-between-stretch{justify-content:space-between}.layout-align-gt-xs-start-start,.layout-align-gt-xs-center-start,.layout-align-gt-xs-end-start,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-xs-start-center,.layout-align-gt-xs-center-center,.layout-align-gt-xs-end-center,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-xs-start-center>*,.layout-align-gt-xs-center-center>*,.layout-align-gt-xs-end-center>*,.layout-align-gt-xs-space-between-center>*,.layout-align-gt-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-xs-start-end,.layout-align-gt-xs-center-end,.layout-align-gt-xs-end-end,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-xs-start-stretch,.layout-align-gt-xs-center-stretch,.layout-align-gt-xs-end-stretch,.layout-align-gt-xs-space-between-stretch,.layout-align-gt-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-xs{flex:1;box-sizing:border-box}.flex-gt-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-xs-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex{min-width:0}.layout-gt-xs-column>.flex-gt-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-column>.flex{min-height:0}.layout-gt-xs,.layout-gt-xs-column,.layout-gt-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-xs-column{flex-direction:column}.layout-gt-xs-row{flex-direction:row}}@media(min-width: 600px)and (max-width: 959px){.hide:not(.show-gt-xs):not(.show-sm):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.hide-sm:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.flex-order-sm--20{order:-20}.flex-order-sm--19{order:-19}.flex-order-sm--18{order:-18}.flex-order-sm--17{order:-17}.flex-order-sm--16{order:-16}.flex-order-sm--15{order:-15}.flex-order-sm--14{order:-14}.flex-order-sm--13{order:-13}.flex-order-sm--12{order:-12}.flex-order-sm--11{order:-11}.flex-order-sm--10{order:-10}.flex-order-sm--9{order:-9}.flex-order-sm--8{order:-8}.flex-order-sm--7{order:-7}.flex-order-sm--6{order:-6}.flex-order-sm--5{order:-5}.flex-order-sm--4{order:-4}.flex-order-sm--3{order:-3}.flex-order-sm--2{order:-2}.flex-order-sm--1{order:-1}.flex-order-sm-0{order:0}.flex-order-sm-1{order:1}.flex-order-sm-2{order:2}.flex-order-sm-3{order:3}.flex-order-sm-4{order:4}.flex-order-sm-5{order:5}.flex-order-sm-6{order:6}.flex-order-sm-7{order:7}.flex-order-sm-8{order:8}.flex-order-sm-9{order:9}.flex-order-sm-10{order:10}.flex-order-sm-11{order:11}.flex-order-sm-12{order:12}.flex-order-sm-13{order:13}.flex-order-sm-14{order:14}.flex-order-sm-15{order:15}.flex-order-sm-16{order:16}.flex-order-sm-17{order:17}.flex-order-sm-18{order:18}.flex-order-sm-19{order:19}.flex-order-sm-20{order:20}.offset-sm-0,.flex-offset-sm-0,.layout-margin .flex-offset-sm-0,.layout-margin .offset-sm-0{margin-left:0}[dir=rtl] .offset-sm-0,[dir=rtl] .flex-offset-sm-0,[dir=rtl] .layout-margin .flex-offset-sm-0,[dir=rtl] .layout-margin .offset-sm-0{margin-left:auto;margin-right:0}.offset-sm-5,.flex-offset-sm-5,.layout-margin .flex-offset-sm-5,.layout-margin .offset-sm-5{margin-left:5%}[dir=rtl] .offset-sm-5,[dir=rtl] .flex-offset-sm-5,[dir=rtl] .layout-margin .flex-offset-sm-5,[dir=rtl] .layout-margin .offset-sm-5{margin-left:auto;margin-right:5%}.offset-sm-10,.flex-offset-sm-10,.layout-margin .flex-offset-sm-10,.layout-margin .offset-sm-10{margin-left:10%}[dir=rtl] .offset-sm-10,[dir=rtl] .flex-offset-sm-10,[dir=rtl] .layout-margin .flex-offset-sm-10,[dir=rtl] .layout-margin .offset-sm-10{margin-left:auto;margin-right:10%}.offset-sm-15,.flex-offset-sm-15,.layout-margin .flex-offset-sm-15,.layout-margin .offset-sm-15{margin-left:15%}[dir=rtl] .offset-sm-15,[dir=rtl] .flex-offset-sm-15,[dir=rtl] .layout-margin .flex-offset-sm-15,[dir=rtl] .layout-margin .offset-sm-15{margin-left:auto;margin-right:15%}.offset-sm-20,.flex-offset-sm-20,.layout-margin .flex-offset-sm-20,.layout-margin .offset-sm-20{margin-left:20%}[dir=rtl] .offset-sm-20,[dir=rtl] .flex-offset-sm-20,[dir=rtl] .layout-margin .flex-offset-sm-20,[dir=rtl] .layout-margin .offset-sm-20{margin-left:auto;margin-right:20%}.offset-sm-25,.flex-offset-sm-25,.layout-margin .flex-offset-sm-25,.layout-margin .offset-sm-25{margin-left:25%}[dir=rtl] .offset-sm-25,[dir=rtl] .flex-offset-sm-25,[dir=rtl] .layout-margin .flex-offset-sm-25,[dir=rtl] .layout-margin .offset-sm-25{margin-left:auto;margin-right:25%}.offset-sm-30,.flex-offset-sm-30,.layout-margin .flex-offset-sm-30,.layout-margin .offset-sm-30{margin-left:30%}[dir=rtl] .offset-sm-30,[dir=rtl] .flex-offset-sm-30,[dir=rtl] .layout-margin .flex-offset-sm-30,[dir=rtl] .layout-margin .offset-sm-30{margin-left:auto;margin-right:30%}.offset-sm-35,.flex-offset-sm-35,.layout-margin .flex-offset-sm-35,.layout-margin .offset-sm-35{margin-left:35%}[dir=rtl] .offset-sm-35,[dir=rtl] .flex-offset-sm-35,[dir=rtl] .layout-margin .flex-offset-sm-35,[dir=rtl] .layout-margin .offset-sm-35{margin-left:auto;margin-right:35%}.offset-sm-40,.flex-offset-sm-40,.layout-margin .flex-offset-sm-40,.layout-margin .offset-sm-40{margin-left:40%}[dir=rtl] .offset-sm-40,[dir=rtl] .flex-offset-sm-40,[dir=rtl] .layout-margin .flex-offset-sm-40,[dir=rtl] .layout-margin .offset-sm-40{margin-left:auto;margin-right:40%}.offset-sm-45,.flex-offset-sm-45,.layout-margin .flex-offset-sm-45,.layout-margin .offset-sm-45{margin-left:45%}[dir=rtl] .offset-sm-45,[dir=rtl] .flex-offset-sm-45,[dir=rtl] .layout-margin .flex-offset-sm-45,[dir=rtl] .layout-margin .offset-sm-45{margin-left:auto;margin-right:45%}.offset-sm-50,.flex-offset-sm-50,.layout-margin .flex-offset-sm-50,.layout-margin .offset-sm-50{margin-left:50%}[dir=rtl] .offset-sm-50,[dir=rtl] .flex-offset-sm-50,[dir=rtl] .layout-margin .flex-offset-sm-50,[dir=rtl] .layout-margin .offset-sm-50{margin-left:auto;margin-right:50%}.offset-sm-55,.flex-offset-sm-55,.layout-margin .flex-offset-sm-55,.layout-margin .offset-sm-55{margin-left:55%}[dir=rtl] .offset-sm-55,[dir=rtl] .flex-offset-sm-55,[dir=rtl] .layout-margin .flex-offset-sm-55,[dir=rtl] .layout-margin .offset-sm-55{margin-left:auto;margin-right:55%}.offset-sm-60,.flex-offset-sm-60,.layout-margin .flex-offset-sm-60,.layout-margin .offset-sm-60{margin-left:60%}[dir=rtl] .offset-sm-60,[dir=rtl] .flex-offset-sm-60,[dir=rtl] .layout-margin .flex-offset-sm-60,[dir=rtl] .layout-margin .offset-sm-60{margin-left:auto;margin-right:60%}.offset-sm-65,.flex-offset-sm-65,.layout-margin .flex-offset-sm-65,.layout-margin .offset-sm-65{margin-left:65%}[dir=rtl] .offset-sm-65,[dir=rtl] .flex-offset-sm-65,[dir=rtl] .layout-margin .flex-offset-sm-65,[dir=rtl] .layout-margin .offset-sm-65{margin-left:auto;margin-right:65%}.offset-sm-70,.flex-offset-sm-70,.layout-margin .flex-offset-sm-70,.layout-margin .offset-sm-70{margin-left:70%}[dir=rtl] .offset-sm-70,[dir=rtl] .flex-offset-sm-70,[dir=rtl] .layout-margin .flex-offset-sm-70,[dir=rtl] .layout-margin .offset-sm-70{margin-left:auto;margin-right:70%}.offset-sm-75,.flex-offset-sm-75,.layout-margin .flex-offset-sm-75,.layout-margin .offset-sm-75{margin-left:75%}[dir=rtl] .offset-sm-75,[dir=rtl] .flex-offset-sm-75,[dir=rtl] .layout-margin .flex-offset-sm-75,[dir=rtl] .layout-margin .offset-sm-75{margin-left:auto;margin-right:75%}.offset-sm-80,.flex-offset-sm-80,.layout-margin .flex-offset-sm-80,.layout-margin .offset-sm-80{margin-left:80%}[dir=rtl] .offset-sm-80,[dir=rtl] .flex-offset-sm-80,[dir=rtl] .layout-margin .flex-offset-sm-80,[dir=rtl] .layout-margin .offset-sm-80{margin-left:auto;margin-right:80%}.offset-sm-85,.flex-offset-sm-85,.layout-margin .flex-offset-sm-85,.layout-margin .offset-sm-85{margin-left:85%}[dir=rtl] .offset-sm-85,[dir=rtl] .flex-offset-sm-85,[dir=rtl] .layout-margin .flex-offset-sm-85,[dir=rtl] .layout-margin .offset-sm-85{margin-left:auto;margin-right:85%}.offset-sm-90,.flex-offset-sm-90,.layout-margin .flex-offset-sm-90,.layout-margin .offset-sm-90{margin-left:90%}[dir=rtl] .offset-sm-90,[dir=rtl] .flex-offset-sm-90,[dir=rtl] .layout-margin .flex-offset-sm-90,[dir=rtl] .layout-margin .offset-sm-90{margin-left:auto;margin-right:90%}.offset-sm-95,.flex-offset-sm-95,.layout-margin .flex-offset-sm-95,.layout-margin .offset-sm-95{margin-left:95%}[dir=rtl] .offset-sm-95,[dir=rtl] .flex-offset-sm-95,[dir=rtl] .layout-margin .flex-offset-sm-95,[dir=rtl] .layout-margin .offset-sm-95{margin-left:auto;margin-right:95%}.offset-sm-33,.flex-offset-sm-33,.layout-margin .flex-offset-sm-33,.layout-margin .offset-sm-33{margin-left:33.3333333333%}.offset-sm-66,.flex-offset-sm-66,.layout-margin .flex-offset-sm-66,.layout-margin .offset-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-sm-66,[dir=rtl] .flex-offset-sm-66,[dir=rtl] .layout-margin .flex-offset-sm-66,[dir=rtl] .layout-margin .offset-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-sm,.layout-align-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-sm-start,.layout-align-sm-start-start,.layout-align-sm-start-center,.layout-align-sm-start-end,.layout-align-sm-start-stretch{justify-content:flex-start}.layout-align-sm-center,.layout-align-sm-center-start,.layout-align-sm-center-center,.layout-align-sm-center-end,.layout-align-sm-center-stretch{justify-content:center}.layout-align-sm-end,.layout-align-sm-end-start,.layout-align-sm-end-center,.layout-align-sm-end-end,.layout-align-sm-end-stretch{justify-content:flex-end}.layout-align-sm-space-around,.layout-align-sm-space-around-center,.layout-align-sm-space-around-start,.layout-align-sm-space-around-end,.layout-align-sm-space-around-stretch{justify-content:space-around}.layout-align-sm-space-between,.layout-align-sm-space-between-center,.layout-align-sm-space-between-start,.layout-align-sm-space-between-end,.layout-align-sm-space-between-stretch{justify-content:space-between}.layout-align-sm-start-start,.layout-align-sm-center-start,.layout-align-sm-end-start,.layout-align-sm-space-between-start,.layout-align-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-sm-start-center,.layout-align-sm-center-center,.layout-align-sm-end-center,.layout-align-sm-space-between-center,.layout-align-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-sm-start-center>*,.layout-align-sm-center-center>*,.layout-align-sm-end-center>*,.layout-align-sm-space-between-center>*,.layout-align-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-sm-start-end,.layout-align-sm-center-end,.layout-align-sm-end-end,.layout-align-sm-space-between-end,.layout-align-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-sm-start-stretch,.layout-align-sm-center-stretch,.layout-align-sm-end-stretch,.layout-align-sm-space-between-stretch,.layout-align-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-sm{flex:1;box-sizing:border-box}.flex-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-sm-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-sm-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-sm-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-sm-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-sm-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-sm-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-sm-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-sm-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-sm-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-sm-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-sm-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-sm-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-sm-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-sm-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-sm-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-sm-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-sm-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-sm-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-sm-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-sm-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-sm-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex{min-width:0}.layout-sm-column>.flex-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-sm-column>.flex-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-column>.flex{min-height:0}.layout-sm,.layout-sm-column,.layout-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-sm-column{flex-direction:column}.layout-sm-row{flex-direction:row}}@media(min-width: 960px){.flex-order-gt-sm--20{order:-20}.flex-order-gt-sm--19{order:-19}.flex-order-gt-sm--18{order:-18}.flex-order-gt-sm--17{order:-17}.flex-order-gt-sm--16{order:-16}.flex-order-gt-sm--15{order:-15}.flex-order-gt-sm--14{order:-14}.flex-order-gt-sm--13{order:-13}.flex-order-gt-sm--12{order:-12}.flex-order-gt-sm--11{order:-11}.flex-order-gt-sm--10{order:-10}.flex-order-gt-sm--9{order:-9}.flex-order-gt-sm--8{order:-8}.flex-order-gt-sm--7{order:-7}.flex-order-gt-sm--6{order:-6}.flex-order-gt-sm--5{order:-5}.flex-order-gt-sm--4{order:-4}.flex-order-gt-sm--3{order:-3}.flex-order-gt-sm--2{order:-2}.flex-order-gt-sm--1{order:-1}.flex-order-gt-sm-0{order:0}.flex-order-gt-sm-1{order:1}.flex-order-gt-sm-2{order:2}.flex-order-gt-sm-3{order:3}.flex-order-gt-sm-4{order:4}.flex-order-gt-sm-5{order:5}.flex-order-gt-sm-6{order:6}.flex-order-gt-sm-7{order:7}.flex-order-gt-sm-8{order:8}.flex-order-gt-sm-9{order:9}.flex-order-gt-sm-10{order:10}.flex-order-gt-sm-11{order:11}.flex-order-gt-sm-12{order:12}.flex-order-gt-sm-13{order:13}.flex-order-gt-sm-14{order:14}.flex-order-gt-sm-15{order:15}.flex-order-gt-sm-16{order:16}.flex-order-gt-sm-17{order:17}.flex-order-gt-sm-18{order:18}.flex-order-gt-sm-19{order:19}.flex-order-gt-sm-20{order:20}.offset-gt-sm-0,.flex-offset-gt-sm-0,.layout-margin .flex-offset-gt-sm-0,.layout-margin .offset-gt-sm-0{margin-left:0}[dir=rtl] .offset-gt-sm-0,[dir=rtl] .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .offset-gt-sm-0{margin-left:auto;margin-right:0}.offset-gt-sm-5,.flex-offset-gt-sm-5,.layout-margin .flex-offset-gt-sm-5,.layout-margin .offset-gt-sm-5{margin-left:5%}[dir=rtl] .offset-gt-sm-5,[dir=rtl] .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .offset-gt-sm-5{margin-left:auto;margin-right:5%}.offset-gt-sm-10,.flex-offset-gt-sm-10,.layout-margin .flex-offset-gt-sm-10,.layout-margin .offset-gt-sm-10{margin-left:10%}[dir=rtl] .offset-gt-sm-10,[dir=rtl] .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .offset-gt-sm-10{margin-left:auto;margin-right:10%}.offset-gt-sm-15,.flex-offset-gt-sm-15,.layout-margin .flex-offset-gt-sm-15,.layout-margin .offset-gt-sm-15{margin-left:15%}[dir=rtl] .offset-gt-sm-15,[dir=rtl] .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .offset-gt-sm-15{margin-left:auto;margin-right:15%}.offset-gt-sm-20,.flex-offset-gt-sm-20,.layout-margin .flex-offset-gt-sm-20,.layout-margin .offset-gt-sm-20{margin-left:20%}[dir=rtl] .offset-gt-sm-20,[dir=rtl] .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .offset-gt-sm-20{margin-left:auto;margin-right:20%}.offset-gt-sm-25,.flex-offset-gt-sm-25,.layout-margin .flex-offset-gt-sm-25,.layout-margin .offset-gt-sm-25{margin-left:25%}[dir=rtl] .offset-gt-sm-25,[dir=rtl] .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .offset-gt-sm-25{margin-left:auto;margin-right:25%}.offset-gt-sm-30,.flex-offset-gt-sm-30,.layout-margin .flex-offset-gt-sm-30,.layout-margin .offset-gt-sm-30{margin-left:30%}[dir=rtl] .offset-gt-sm-30,[dir=rtl] .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .offset-gt-sm-30{margin-left:auto;margin-right:30%}.offset-gt-sm-35,.flex-offset-gt-sm-35,.layout-margin .flex-offset-gt-sm-35,.layout-margin .offset-gt-sm-35{margin-left:35%}[dir=rtl] .offset-gt-sm-35,[dir=rtl] .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .offset-gt-sm-35{margin-left:auto;margin-right:35%}.offset-gt-sm-40,.flex-offset-gt-sm-40,.layout-margin .flex-offset-gt-sm-40,.layout-margin .offset-gt-sm-40{margin-left:40%}[dir=rtl] .offset-gt-sm-40,[dir=rtl] .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .offset-gt-sm-40{margin-left:auto;margin-right:40%}.offset-gt-sm-45,.flex-offset-gt-sm-45,.layout-margin .flex-offset-gt-sm-45,.layout-margin .offset-gt-sm-45{margin-left:45%}[dir=rtl] .offset-gt-sm-45,[dir=rtl] .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .offset-gt-sm-45{margin-left:auto;margin-right:45%}.offset-gt-sm-50,.flex-offset-gt-sm-50,.layout-margin .flex-offset-gt-sm-50,.layout-margin .offset-gt-sm-50{margin-left:50%}[dir=rtl] .offset-gt-sm-50,[dir=rtl] .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .offset-gt-sm-50{margin-left:auto;margin-right:50%}.offset-gt-sm-55,.flex-offset-gt-sm-55,.layout-margin .flex-offset-gt-sm-55,.layout-margin .offset-gt-sm-55{margin-left:55%}[dir=rtl] .offset-gt-sm-55,[dir=rtl] .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .offset-gt-sm-55{margin-left:auto;margin-right:55%}.offset-gt-sm-60,.flex-offset-gt-sm-60,.layout-margin .flex-offset-gt-sm-60,.layout-margin .offset-gt-sm-60{margin-left:60%}[dir=rtl] .offset-gt-sm-60,[dir=rtl] .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .offset-gt-sm-60{margin-left:auto;margin-right:60%}.offset-gt-sm-65,.flex-offset-gt-sm-65,.layout-margin .flex-offset-gt-sm-65,.layout-margin .offset-gt-sm-65{margin-left:65%}[dir=rtl] .offset-gt-sm-65,[dir=rtl] .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .offset-gt-sm-65{margin-left:auto;margin-right:65%}.offset-gt-sm-70,.flex-offset-gt-sm-70,.layout-margin .flex-offset-gt-sm-70,.layout-margin .offset-gt-sm-70{margin-left:70%}[dir=rtl] .offset-gt-sm-70,[dir=rtl] .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .offset-gt-sm-70{margin-left:auto;margin-right:70%}.offset-gt-sm-75,.flex-offset-gt-sm-75,.layout-margin .flex-offset-gt-sm-75,.layout-margin .offset-gt-sm-75{margin-left:75%}[dir=rtl] .offset-gt-sm-75,[dir=rtl] .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .offset-gt-sm-75{margin-left:auto;margin-right:75%}.offset-gt-sm-80,.flex-offset-gt-sm-80,.layout-margin .flex-offset-gt-sm-80,.layout-margin .offset-gt-sm-80{margin-left:80%}[dir=rtl] .offset-gt-sm-80,[dir=rtl] .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .offset-gt-sm-80{margin-left:auto;margin-right:80%}.offset-gt-sm-85,.flex-offset-gt-sm-85,.layout-margin .flex-offset-gt-sm-85,.layout-margin .offset-gt-sm-85{margin-left:85%}[dir=rtl] .offset-gt-sm-85,[dir=rtl] .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .offset-gt-sm-85{margin-left:auto;margin-right:85%}.offset-gt-sm-90,.flex-offset-gt-sm-90,.layout-margin .flex-offset-gt-sm-90,.layout-margin .offset-gt-sm-90{margin-left:90%}[dir=rtl] .offset-gt-sm-90,[dir=rtl] .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .offset-gt-sm-90{margin-left:auto;margin-right:90%}.offset-gt-sm-95,.flex-offset-gt-sm-95,.layout-margin .flex-offset-gt-sm-95,.layout-margin .offset-gt-sm-95{margin-left:95%}[dir=rtl] .offset-gt-sm-95,[dir=rtl] .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .offset-gt-sm-95{margin-left:auto;margin-right:95%}.offset-gt-sm-33,.flex-offset-gt-sm-33,.layout-margin .flex-offset-gt-sm-33,.layout-margin .offset-gt-sm-33{margin-left:33.3333333333%}.offset-gt-sm-66,.flex-offset-gt-sm-66,.layout-margin .flex-offset-gt-sm-66,.layout-margin .offset-gt-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-sm-66,[dir=rtl] .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .offset-gt-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-sm,.layout-align-gt-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-sm-start,.layout-align-gt-sm-start-start,.layout-align-gt-sm-start-center,.layout-align-gt-sm-start-end,.layout-align-gt-sm-start-stretch{justify-content:flex-start}.layout-align-gt-sm-center,.layout-align-gt-sm-center-start,.layout-align-gt-sm-center-center,.layout-align-gt-sm-center-end,.layout-align-gt-sm-center-stretch{justify-content:center}.layout-align-gt-sm-end,.layout-align-gt-sm-end-start,.layout-align-gt-sm-end-center,.layout-align-gt-sm-end-end,.layout-align-gt-sm-end-stretch{justify-content:flex-end}.layout-align-gt-sm-space-around,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-around-stretch{justify-content:space-around}.layout-align-gt-sm-space-between,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-between-stretch{justify-content:space-between}.layout-align-gt-sm-start-start,.layout-align-gt-sm-center-start,.layout-align-gt-sm-end-start,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-sm-start-center,.layout-align-gt-sm-center-center,.layout-align-gt-sm-end-center,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-sm-start-center>*,.layout-align-gt-sm-center-center>*,.layout-align-gt-sm-end-center>*,.layout-align-gt-sm-space-between-center>*,.layout-align-gt-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-sm-start-end,.layout-align-gt-sm-center-end,.layout-align-gt-sm-end-end,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-sm-start-stretch,.layout-align-gt-sm-center-stretch,.layout-align-gt-sm-end-stretch,.layout-align-gt-sm-space-between-stretch,.layout-align-gt-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-sm{flex:1;box-sizing:border-box}.flex-gt-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-sm-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex{min-width:0}.layout-gt-sm-column>.flex-gt-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-column>.flex{min-height:0}.layout-gt-sm,.layout-gt-sm-column,.layout-gt-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-sm-column{flex-direction:column}.layout-gt-sm-row{flex-direction:row}}@media(min-width: 960px)and (max-width: 1279px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show){display:none}.hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-md--20{order:-20}.flex-order-md--19{order:-19}.flex-order-md--18{order:-18}.flex-order-md--17{order:-17}.flex-order-md--16{order:-16}.flex-order-md--15{order:-15}.flex-order-md--14{order:-14}.flex-order-md--13{order:-13}.flex-order-md--12{order:-12}.flex-order-md--11{order:-11}.flex-order-md--10{order:-10}.flex-order-md--9{order:-9}.flex-order-md--8{order:-8}.flex-order-md--7{order:-7}.flex-order-md--6{order:-6}.flex-order-md--5{order:-5}.flex-order-md--4{order:-4}.flex-order-md--3{order:-3}.flex-order-md--2{order:-2}.flex-order-md--1{order:-1}.flex-order-md-0{order:0}.flex-order-md-1{order:1}.flex-order-md-2{order:2}.flex-order-md-3{order:3}.flex-order-md-4{order:4}.flex-order-md-5{order:5}.flex-order-md-6{order:6}.flex-order-md-7{order:7}.flex-order-md-8{order:8}.flex-order-md-9{order:9}.flex-order-md-10{order:10}.flex-order-md-11{order:11}.flex-order-md-12{order:12}.flex-order-md-13{order:13}.flex-order-md-14{order:14}.flex-order-md-15{order:15}.flex-order-md-16{order:16}.flex-order-md-17{order:17}.flex-order-md-18{order:18}.flex-order-md-19{order:19}.flex-order-md-20{order:20}.offset-md-0,.flex-offset-md-0,.layout-margin .flex-offset-md-0,.layout-margin .offset-md-0{margin-left:0}[dir=rtl] .offset-md-0,[dir=rtl] .flex-offset-md-0,[dir=rtl] .layout-margin .flex-offset-md-0,[dir=rtl] .layout-margin .offset-md-0{margin-left:auto;margin-right:0}.offset-md-5,.flex-offset-md-5,.layout-margin .flex-offset-md-5,.layout-margin .offset-md-5{margin-left:5%}[dir=rtl] .offset-md-5,[dir=rtl] .flex-offset-md-5,[dir=rtl] .layout-margin .flex-offset-md-5,[dir=rtl] .layout-margin .offset-md-5{margin-left:auto;margin-right:5%}.offset-md-10,.flex-offset-md-10,.layout-margin .flex-offset-md-10,.layout-margin .offset-md-10{margin-left:10%}[dir=rtl] .offset-md-10,[dir=rtl] .flex-offset-md-10,[dir=rtl] .layout-margin .flex-offset-md-10,[dir=rtl] .layout-margin .offset-md-10{margin-left:auto;margin-right:10%}.offset-md-15,.flex-offset-md-15,.layout-margin .flex-offset-md-15,.layout-margin .offset-md-15{margin-left:15%}[dir=rtl] .offset-md-15,[dir=rtl] .flex-offset-md-15,[dir=rtl] .layout-margin .flex-offset-md-15,[dir=rtl] .layout-margin .offset-md-15{margin-left:auto;margin-right:15%}.offset-md-20,.flex-offset-md-20,.layout-margin .flex-offset-md-20,.layout-margin .offset-md-20{margin-left:20%}[dir=rtl] .offset-md-20,[dir=rtl] .flex-offset-md-20,[dir=rtl] .layout-margin .flex-offset-md-20,[dir=rtl] .layout-margin .offset-md-20{margin-left:auto;margin-right:20%}.offset-md-25,.flex-offset-md-25,.layout-margin .flex-offset-md-25,.layout-margin .offset-md-25{margin-left:25%}[dir=rtl] .offset-md-25,[dir=rtl] .flex-offset-md-25,[dir=rtl] .layout-margin .flex-offset-md-25,[dir=rtl] .layout-margin .offset-md-25{margin-left:auto;margin-right:25%}.offset-md-30,.flex-offset-md-30,.layout-margin .flex-offset-md-30,.layout-margin .offset-md-30{margin-left:30%}[dir=rtl] .offset-md-30,[dir=rtl] .flex-offset-md-30,[dir=rtl] .layout-margin .flex-offset-md-30,[dir=rtl] .layout-margin .offset-md-30{margin-left:auto;margin-right:30%}.offset-md-35,.flex-offset-md-35,.layout-margin .flex-offset-md-35,.layout-margin .offset-md-35{margin-left:35%}[dir=rtl] .offset-md-35,[dir=rtl] .flex-offset-md-35,[dir=rtl] .layout-margin .flex-offset-md-35,[dir=rtl] .layout-margin .offset-md-35{margin-left:auto;margin-right:35%}.offset-md-40,.flex-offset-md-40,.layout-margin .flex-offset-md-40,.layout-margin .offset-md-40{margin-left:40%}[dir=rtl] .offset-md-40,[dir=rtl] .flex-offset-md-40,[dir=rtl] .layout-margin .flex-offset-md-40,[dir=rtl] .layout-margin .offset-md-40{margin-left:auto;margin-right:40%}.offset-md-45,.flex-offset-md-45,.layout-margin .flex-offset-md-45,.layout-margin .offset-md-45{margin-left:45%}[dir=rtl] .offset-md-45,[dir=rtl] .flex-offset-md-45,[dir=rtl] .layout-margin .flex-offset-md-45,[dir=rtl] .layout-margin .offset-md-45{margin-left:auto;margin-right:45%}.offset-md-50,.flex-offset-md-50,.layout-margin .flex-offset-md-50,.layout-margin .offset-md-50{margin-left:50%}[dir=rtl] .offset-md-50,[dir=rtl] .flex-offset-md-50,[dir=rtl] .layout-margin .flex-offset-md-50,[dir=rtl] .layout-margin .offset-md-50{margin-left:auto;margin-right:50%}.offset-md-55,.flex-offset-md-55,.layout-margin .flex-offset-md-55,.layout-margin .offset-md-55{margin-left:55%}[dir=rtl] .offset-md-55,[dir=rtl] .flex-offset-md-55,[dir=rtl] .layout-margin .flex-offset-md-55,[dir=rtl] .layout-margin .offset-md-55{margin-left:auto;margin-right:55%}.offset-md-60,.flex-offset-md-60,.layout-margin .flex-offset-md-60,.layout-margin .offset-md-60{margin-left:60%}[dir=rtl] .offset-md-60,[dir=rtl] .flex-offset-md-60,[dir=rtl] .layout-margin .flex-offset-md-60,[dir=rtl] .layout-margin .offset-md-60{margin-left:auto;margin-right:60%}.offset-md-65,.flex-offset-md-65,.layout-margin .flex-offset-md-65,.layout-margin .offset-md-65{margin-left:65%}[dir=rtl] .offset-md-65,[dir=rtl] .flex-offset-md-65,[dir=rtl] .layout-margin .flex-offset-md-65,[dir=rtl] .layout-margin .offset-md-65{margin-left:auto;margin-right:65%}.offset-md-70,.flex-offset-md-70,.layout-margin .flex-offset-md-70,.layout-margin .offset-md-70{margin-left:70%}[dir=rtl] .offset-md-70,[dir=rtl] .flex-offset-md-70,[dir=rtl] .layout-margin .flex-offset-md-70,[dir=rtl] .layout-margin .offset-md-70{margin-left:auto;margin-right:70%}.offset-md-75,.flex-offset-md-75,.layout-margin .flex-offset-md-75,.layout-margin .offset-md-75{margin-left:75%}[dir=rtl] .offset-md-75,[dir=rtl] .flex-offset-md-75,[dir=rtl] .layout-margin .flex-offset-md-75,[dir=rtl] .layout-margin .offset-md-75{margin-left:auto;margin-right:75%}.offset-md-80,.flex-offset-md-80,.layout-margin .flex-offset-md-80,.layout-margin .offset-md-80{margin-left:80%}[dir=rtl] .offset-md-80,[dir=rtl] .flex-offset-md-80,[dir=rtl] .layout-margin .flex-offset-md-80,[dir=rtl] .layout-margin .offset-md-80{margin-left:auto;margin-right:80%}.offset-md-85,.flex-offset-md-85,.layout-margin .flex-offset-md-85,.layout-margin .offset-md-85{margin-left:85%}[dir=rtl] .offset-md-85,[dir=rtl] .flex-offset-md-85,[dir=rtl] .layout-margin .flex-offset-md-85,[dir=rtl] .layout-margin .offset-md-85{margin-left:auto;margin-right:85%}.offset-md-90,.flex-offset-md-90,.layout-margin .flex-offset-md-90,.layout-margin .offset-md-90{margin-left:90%}[dir=rtl] .offset-md-90,[dir=rtl] .flex-offset-md-90,[dir=rtl] .layout-margin .flex-offset-md-90,[dir=rtl] .layout-margin .offset-md-90{margin-left:auto;margin-right:90%}.offset-md-95,.flex-offset-md-95,.layout-margin .flex-offset-md-95,.layout-margin .offset-md-95{margin-left:95%}[dir=rtl] .offset-md-95,[dir=rtl] .flex-offset-md-95,[dir=rtl] .layout-margin .flex-offset-md-95,[dir=rtl] .layout-margin .offset-md-95{margin-left:auto;margin-right:95%}.offset-md-33,.flex-offset-md-33,.layout-margin .flex-offset-md-33,.layout-margin .offset-md-33{margin-left:33.3333333333%}.offset-md-66,.flex-offset-md-66,.layout-margin .flex-offset-md-66,.layout-margin .offset-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-md-66,[dir=rtl] .flex-offset-md-66,[dir=rtl] .layout-margin .flex-offset-md-66,[dir=rtl] .layout-margin .offset-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-md,.layout-align-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-md-start,.layout-align-md-start-start,.layout-align-md-start-center,.layout-align-md-start-end,.layout-align-md-start-stretch{justify-content:flex-start}.layout-align-md-center,.layout-align-md-center-start,.layout-align-md-center-center,.layout-align-md-center-end,.layout-align-md-center-stretch{justify-content:center}.layout-align-md-end,.layout-align-md-end-start,.layout-align-md-end-center,.layout-align-md-end-end,.layout-align-md-end-stretch{justify-content:flex-end}.layout-align-md-space-around,.layout-align-md-space-around-center,.layout-align-md-space-around-start,.layout-align-md-space-around-end,.layout-align-md-space-around-stretch{justify-content:space-around}.layout-align-md-space-between,.layout-align-md-space-between-center,.layout-align-md-space-between-start,.layout-align-md-space-between-end,.layout-align-md-space-between-stretch{justify-content:space-between}.layout-align-md-start-start,.layout-align-md-center-start,.layout-align-md-end-start,.layout-align-md-space-between-start,.layout-align-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-md-start-center,.layout-align-md-center-center,.layout-align-md-end-center,.layout-align-md-space-between-center,.layout-align-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-md-start-center>*,.layout-align-md-center-center>*,.layout-align-md-end-center>*,.layout-align-md-space-between-center>*,.layout-align-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-md-start-end,.layout-align-md-center-end,.layout-align-md-end-end,.layout-align-md-space-between-end,.layout-align-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-md-start-stretch,.layout-align-md-center-stretch,.layout-align-md-end-stretch,.layout-align-md-space-between-stretch,.layout-align-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-md{flex:1;box-sizing:border-box}.flex-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-md-none{flex:0 0 auto;box-sizing:border-box}.flex-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-md-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-md-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-md-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-md-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-md-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-md-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-md-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-md-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-md-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-md-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-md-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-md-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-md-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-md-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-md-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-md-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-md-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-md-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-md-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-md-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-md-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex{min-width:0}.layout-md-column>.flex-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-md-column>.flex-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-column>.flex{min-height:0}.layout-md,.layout-md-column,.layout-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-md-column{flex-direction:column}.layout-md-row{flex-direction:row}}@media(min-width: 1280px){.flex-order-gt-md--20{order:-20}.flex-order-gt-md--19{order:-19}.flex-order-gt-md--18{order:-18}.flex-order-gt-md--17{order:-17}.flex-order-gt-md--16{order:-16}.flex-order-gt-md--15{order:-15}.flex-order-gt-md--14{order:-14}.flex-order-gt-md--13{order:-13}.flex-order-gt-md--12{order:-12}.flex-order-gt-md--11{order:-11}.flex-order-gt-md--10{order:-10}.flex-order-gt-md--9{order:-9}.flex-order-gt-md--8{order:-8}.flex-order-gt-md--7{order:-7}.flex-order-gt-md--6{order:-6}.flex-order-gt-md--5{order:-5}.flex-order-gt-md--4{order:-4}.flex-order-gt-md--3{order:-3}.flex-order-gt-md--2{order:-2}.flex-order-gt-md--1{order:-1}.flex-order-gt-md-0{order:0}.flex-order-gt-md-1{order:1}.flex-order-gt-md-2{order:2}.flex-order-gt-md-3{order:3}.flex-order-gt-md-4{order:4}.flex-order-gt-md-5{order:5}.flex-order-gt-md-6{order:6}.flex-order-gt-md-7{order:7}.flex-order-gt-md-8{order:8}.flex-order-gt-md-9{order:9}.flex-order-gt-md-10{order:10}.flex-order-gt-md-11{order:11}.flex-order-gt-md-12{order:12}.flex-order-gt-md-13{order:13}.flex-order-gt-md-14{order:14}.flex-order-gt-md-15{order:15}.flex-order-gt-md-16{order:16}.flex-order-gt-md-17{order:17}.flex-order-gt-md-18{order:18}.flex-order-gt-md-19{order:19}.flex-order-gt-md-20{order:20}.offset-gt-md-0,.flex-offset-gt-md-0,.layout-margin .flex-offset-gt-md-0,.layout-margin .offset-gt-md-0{margin-left:0}[dir=rtl] .offset-gt-md-0,[dir=rtl] .flex-offset-gt-md-0,[dir=rtl] .layout-margin .flex-offset-gt-md-0,[dir=rtl] .layout-margin .offset-gt-md-0{margin-left:auto;margin-right:0}.offset-gt-md-5,.flex-offset-gt-md-5,.layout-margin .flex-offset-gt-md-5,.layout-margin .offset-gt-md-5{margin-left:5%}[dir=rtl] .offset-gt-md-5,[dir=rtl] .flex-offset-gt-md-5,[dir=rtl] .layout-margin .flex-offset-gt-md-5,[dir=rtl] .layout-margin .offset-gt-md-5{margin-left:auto;margin-right:5%}.offset-gt-md-10,.flex-offset-gt-md-10,.layout-margin .flex-offset-gt-md-10,.layout-margin .offset-gt-md-10{margin-left:10%}[dir=rtl] .offset-gt-md-10,[dir=rtl] .flex-offset-gt-md-10,[dir=rtl] .layout-margin .flex-offset-gt-md-10,[dir=rtl] .layout-margin .offset-gt-md-10{margin-left:auto;margin-right:10%}.offset-gt-md-15,.flex-offset-gt-md-15,.layout-margin .flex-offset-gt-md-15,.layout-margin .offset-gt-md-15{margin-left:15%}[dir=rtl] .offset-gt-md-15,[dir=rtl] .flex-offset-gt-md-15,[dir=rtl] .layout-margin .flex-offset-gt-md-15,[dir=rtl] .layout-margin .offset-gt-md-15{margin-left:auto;margin-right:15%}.offset-gt-md-20,.flex-offset-gt-md-20,.layout-margin .flex-offset-gt-md-20,.layout-margin .offset-gt-md-20{margin-left:20%}[dir=rtl] .offset-gt-md-20,[dir=rtl] .flex-offset-gt-md-20,[dir=rtl] .layout-margin .flex-offset-gt-md-20,[dir=rtl] .layout-margin .offset-gt-md-20{margin-left:auto;margin-right:20%}.offset-gt-md-25,.flex-offset-gt-md-25,.layout-margin .flex-offset-gt-md-25,.layout-margin .offset-gt-md-25{margin-left:25%}[dir=rtl] .offset-gt-md-25,[dir=rtl] .flex-offset-gt-md-25,[dir=rtl] .layout-margin .flex-offset-gt-md-25,[dir=rtl] .layout-margin .offset-gt-md-25{margin-left:auto;margin-right:25%}.offset-gt-md-30,.flex-offset-gt-md-30,.layout-margin .flex-offset-gt-md-30,.layout-margin .offset-gt-md-30{margin-left:30%}[dir=rtl] .offset-gt-md-30,[dir=rtl] .flex-offset-gt-md-30,[dir=rtl] .layout-margin .flex-offset-gt-md-30,[dir=rtl] .layout-margin .offset-gt-md-30{margin-left:auto;margin-right:30%}.offset-gt-md-35,.flex-offset-gt-md-35,.layout-margin .flex-offset-gt-md-35,.layout-margin .offset-gt-md-35{margin-left:35%}[dir=rtl] .offset-gt-md-35,[dir=rtl] .flex-offset-gt-md-35,[dir=rtl] .layout-margin .flex-offset-gt-md-35,[dir=rtl] .layout-margin .offset-gt-md-35{margin-left:auto;margin-right:35%}.offset-gt-md-40,.flex-offset-gt-md-40,.layout-margin .flex-offset-gt-md-40,.layout-margin .offset-gt-md-40{margin-left:40%}[dir=rtl] .offset-gt-md-40,[dir=rtl] .flex-offset-gt-md-40,[dir=rtl] .layout-margin .flex-offset-gt-md-40,[dir=rtl] .layout-margin .offset-gt-md-40{margin-left:auto;margin-right:40%}.offset-gt-md-45,.flex-offset-gt-md-45,.layout-margin .flex-offset-gt-md-45,.layout-margin .offset-gt-md-45{margin-left:45%}[dir=rtl] .offset-gt-md-45,[dir=rtl] .flex-offset-gt-md-45,[dir=rtl] .layout-margin .flex-offset-gt-md-45,[dir=rtl] .layout-margin .offset-gt-md-45{margin-left:auto;margin-right:45%}.offset-gt-md-50,.flex-offset-gt-md-50,.layout-margin .flex-offset-gt-md-50,.layout-margin .offset-gt-md-50{margin-left:50%}[dir=rtl] .offset-gt-md-50,[dir=rtl] .flex-offset-gt-md-50,[dir=rtl] .layout-margin .flex-offset-gt-md-50,[dir=rtl] .layout-margin .offset-gt-md-50{margin-left:auto;margin-right:50%}.offset-gt-md-55,.flex-offset-gt-md-55,.layout-margin .flex-offset-gt-md-55,.layout-margin .offset-gt-md-55{margin-left:55%}[dir=rtl] .offset-gt-md-55,[dir=rtl] .flex-offset-gt-md-55,[dir=rtl] .layout-margin .flex-offset-gt-md-55,[dir=rtl] .layout-margin .offset-gt-md-55{margin-left:auto;margin-right:55%}.offset-gt-md-60,.flex-offset-gt-md-60,.layout-margin .flex-offset-gt-md-60,.layout-margin .offset-gt-md-60{margin-left:60%}[dir=rtl] .offset-gt-md-60,[dir=rtl] .flex-offset-gt-md-60,[dir=rtl] .layout-margin .flex-offset-gt-md-60,[dir=rtl] .layout-margin .offset-gt-md-60{margin-left:auto;margin-right:60%}.offset-gt-md-65,.flex-offset-gt-md-65,.layout-margin .flex-offset-gt-md-65,.layout-margin .offset-gt-md-65{margin-left:65%}[dir=rtl] .offset-gt-md-65,[dir=rtl] .flex-offset-gt-md-65,[dir=rtl] .layout-margin .flex-offset-gt-md-65,[dir=rtl] .layout-margin .offset-gt-md-65{margin-left:auto;margin-right:65%}.offset-gt-md-70,.flex-offset-gt-md-70,.layout-margin .flex-offset-gt-md-70,.layout-margin .offset-gt-md-70{margin-left:70%}[dir=rtl] .offset-gt-md-70,[dir=rtl] .flex-offset-gt-md-70,[dir=rtl] .layout-margin .flex-offset-gt-md-70,[dir=rtl] .layout-margin .offset-gt-md-70{margin-left:auto;margin-right:70%}.offset-gt-md-75,.flex-offset-gt-md-75,.layout-margin .flex-offset-gt-md-75,.layout-margin .offset-gt-md-75{margin-left:75%}[dir=rtl] .offset-gt-md-75,[dir=rtl] .flex-offset-gt-md-75,[dir=rtl] .layout-margin .flex-offset-gt-md-75,[dir=rtl] .layout-margin .offset-gt-md-75{margin-left:auto;margin-right:75%}.offset-gt-md-80,.flex-offset-gt-md-80,.layout-margin .flex-offset-gt-md-80,.layout-margin .offset-gt-md-80{margin-left:80%}[dir=rtl] .offset-gt-md-80,[dir=rtl] .flex-offset-gt-md-80,[dir=rtl] .layout-margin .flex-offset-gt-md-80,[dir=rtl] .layout-margin .offset-gt-md-80{margin-left:auto;margin-right:80%}.offset-gt-md-85,.flex-offset-gt-md-85,.layout-margin .flex-offset-gt-md-85,.layout-margin .offset-gt-md-85{margin-left:85%}[dir=rtl] .offset-gt-md-85,[dir=rtl] .flex-offset-gt-md-85,[dir=rtl] .layout-margin .flex-offset-gt-md-85,[dir=rtl] .layout-margin .offset-gt-md-85{margin-left:auto;margin-right:85%}.offset-gt-md-90,.flex-offset-gt-md-90,.layout-margin .flex-offset-gt-md-90,.layout-margin .offset-gt-md-90{margin-left:90%}[dir=rtl] .offset-gt-md-90,[dir=rtl] .flex-offset-gt-md-90,[dir=rtl] .layout-margin .flex-offset-gt-md-90,[dir=rtl] .layout-margin .offset-gt-md-90{margin-left:auto;margin-right:90%}.offset-gt-md-95,.flex-offset-gt-md-95,.layout-margin .flex-offset-gt-md-95,.layout-margin .offset-gt-md-95{margin-left:95%}[dir=rtl] .offset-gt-md-95,[dir=rtl] .flex-offset-gt-md-95,[dir=rtl] .layout-margin .flex-offset-gt-md-95,[dir=rtl] .layout-margin .offset-gt-md-95{margin-left:auto;margin-right:95%}.offset-gt-md-33,.flex-offset-gt-md-33,.layout-margin .flex-offset-gt-md-33,.layout-margin .offset-gt-md-33{margin-left:33.3333333333%}.offset-gt-md-66,.flex-offset-gt-md-66,.layout-margin .flex-offset-gt-md-66,.layout-margin .offset-gt-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-md-66,[dir=rtl] .flex-offset-gt-md-66,[dir=rtl] .layout-margin .flex-offset-gt-md-66,[dir=rtl] .layout-margin .offset-gt-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-md,.layout-align-gt-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-md-start,.layout-align-gt-md-start-start,.layout-align-gt-md-start-center,.layout-align-gt-md-start-end,.layout-align-gt-md-start-stretch{justify-content:flex-start}.layout-align-gt-md-center,.layout-align-gt-md-center-start,.layout-align-gt-md-center-center,.layout-align-gt-md-center-end,.layout-align-gt-md-center-stretch{justify-content:center}.layout-align-gt-md-end,.layout-align-gt-md-end-start,.layout-align-gt-md-end-center,.layout-align-gt-md-end-end,.layout-align-gt-md-end-stretch{justify-content:flex-end}.layout-align-gt-md-space-around,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-around-stretch{justify-content:space-around}.layout-align-gt-md-space-between,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-between-stretch{justify-content:space-between}.layout-align-gt-md-start-start,.layout-align-gt-md-center-start,.layout-align-gt-md-end-start,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-md-start-center,.layout-align-gt-md-center-center,.layout-align-gt-md-end-center,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-md-start-center>*,.layout-align-gt-md-center-center>*,.layout-align-gt-md-end-center>*,.layout-align-gt-md-space-between-center>*,.layout-align-gt-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-md-start-end,.layout-align-gt-md-center-end,.layout-align-gt-md-end-end,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-md-start-stretch,.layout-align-gt-md-center-stretch,.layout-align-gt-md-end-stretch,.layout-align-gt-md-space-between-stretch,.layout-align-gt-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-md{flex:1;box-sizing:border-box}.flex-gt-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-md-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-md-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex{min-width:0}.layout-gt-md-column>.flex-gt-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-column>.flex{min-height:0}.layout-gt-md,.layout-gt-md-column,.layout-gt-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-md-column{flex-direction:column}.layout-gt-md-row{flex-direction:row}}@media(min-width: 1280px)and (max-width: 1919px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show){display:none}.hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-lg--20{order:-20}.flex-order-lg--19{order:-19}.flex-order-lg--18{order:-18}.flex-order-lg--17{order:-17}.flex-order-lg--16{order:-16}.flex-order-lg--15{order:-15}.flex-order-lg--14{order:-14}.flex-order-lg--13{order:-13}.flex-order-lg--12{order:-12}.flex-order-lg--11{order:-11}.flex-order-lg--10{order:-10}.flex-order-lg--9{order:-9}.flex-order-lg--8{order:-8}.flex-order-lg--7{order:-7}.flex-order-lg--6{order:-6}.flex-order-lg--5{order:-5}.flex-order-lg--4{order:-4}.flex-order-lg--3{order:-3}.flex-order-lg--2{order:-2}.flex-order-lg--1{order:-1}.flex-order-lg-0{order:0}.flex-order-lg-1{order:1}.flex-order-lg-2{order:2}.flex-order-lg-3{order:3}.flex-order-lg-4{order:4}.flex-order-lg-5{order:5}.flex-order-lg-6{order:6}.flex-order-lg-7{order:7}.flex-order-lg-8{order:8}.flex-order-lg-9{order:9}.flex-order-lg-10{order:10}.flex-order-lg-11{order:11}.flex-order-lg-12{order:12}.flex-order-lg-13{order:13}.flex-order-lg-14{order:14}.flex-order-lg-15{order:15}.flex-order-lg-16{order:16}.flex-order-lg-17{order:17}.flex-order-lg-18{order:18}.flex-order-lg-19{order:19}.flex-order-lg-20{order:20}.offset-lg-0,.flex-offset-lg-0,.layout-margin .flex-offset-lg-0,.layout-margin .offset-lg-0{margin-left:0}[dir=rtl] .offset-lg-0,[dir=rtl] .flex-offset-lg-0,[dir=rtl] .layout-margin .flex-offset-lg-0,[dir=rtl] .layout-margin .offset-lg-0{margin-left:auto;margin-right:0}.offset-lg-5,.flex-offset-lg-5,.layout-margin .flex-offset-lg-5,.layout-margin .offset-lg-5{margin-left:5%}[dir=rtl] .offset-lg-5,[dir=rtl] .flex-offset-lg-5,[dir=rtl] .layout-margin .flex-offset-lg-5,[dir=rtl] .layout-margin .offset-lg-5{margin-left:auto;margin-right:5%}.offset-lg-10,.flex-offset-lg-10,.layout-margin .flex-offset-lg-10,.layout-margin .offset-lg-10{margin-left:10%}[dir=rtl] .offset-lg-10,[dir=rtl] .flex-offset-lg-10,[dir=rtl] .layout-margin .flex-offset-lg-10,[dir=rtl] .layout-margin .offset-lg-10{margin-left:auto;margin-right:10%}.offset-lg-15,.flex-offset-lg-15,.layout-margin .flex-offset-lg-15,.layout-margin .offset-lg-15{margin-left:15%}[dir=rtl] .offset-lg-15,[dir=rtl] .flex-offset-lg-15,[dir=rtl] .layout-margin .flex-offset-lg-15,[dir=rtl] .layout-margin .offset-lg-15{margin-left:auto;margin-right:15%}.offset-lg-20,.flex-offset-lg-20,.layout-margin .flex-offset-lg-20,.layout-margin .offset-lg-20{margin-left:20%}[dir=rtl] .offset-lg-20,[dir=rtl] .flex-offset-lg-20,[dir=rtl] .layout-margin .flex-offset-lg-20,[dir=rtl] .layout-margin .offset-lg-20{margin-left:auto;margin-right:20%}.offset-lg-25,.flex-offset-lg-25,.layout-margin .flex-offset-lg-25,.layout-margin .offset-lg-25{margin-left:25%}[dir=rtl] .offset-lg-25,[dir=rtl] .flex-offset-lg-25,[dir=rtl] .layout-margin .flex-offset-lg-25,[dir=rtl] .layout-margin .offset-lg-25{margin-left:auto;margin-right:25%}.offset-lg-30,.flex-offset-lg-30,.layout-margin .flex-offset-lg-30,.layout-margin .offset-lg-30{margin-left:30%}[dir=rtl] .offset-lg-30,[dir=rtl] .flex-offset-lg-30,[dir=rtl] .layout-margin .flex-offset-lg-30,[dir=rtl] .layout-margin .offset-lg-30{margin-left:auto;margin-right:30%}.offset-lg-35,.flex-offset-lg-35,.layout-margin .flex-offset-lg-35,.layout-margin .offset-lg-35{margin-left:35%}[dir=rtl] .offset-lg-35,[dir=rtl] .flex-offset-lg-35,[dir=rtl] .layout-margin .flex-offset-lg-35,[dir=rtl] .layout-margin .offset-lg-35{margin-left:auto;margin-right:35%}.offset-lg-40,.flex-offset-lg-40,.layout-margin .flex-offset-lg-40,.layout-margin .offset-lg-40{margin-left:40%}[dir=rtl] .offset-lg-40,[dir=rtl] .flex-offset-lg-40,[dir=rtl] .layout-margin .flex-offset-lg-40,[dir=rtl] .layout-margin .offset-lg-40{margin-left:auto;margin-right:40%}.offset-lg-45,.flex-offset-lg-45,.layout-margin .flex-offset-lg-45,.layout-margin .offset-lg-45{margin-left:45%}[dir=rtl] .offset-lg-45,[dir=rtl] .flex-offset-lg-45,[dir=rtl] .layout-margin .flex-offset-lg-45,[dir=rtl] .layout-margin .offset-lg-45{margin-left:auto;margin-right:45%}.offset-lg-50,.flex-offset-lg-50,.layout-margin .flex-offset-lg-50,.layout-margin .offset-lg-50{margin-left:50%}[dir=rtl] .offset-lg-50,[dir=rtl] .flex-offset-lg-50,[dir=rtl] .layout-margin .flex-offset-lg-50,[dir=rtl] .layout-margin .offset-lg-50{margin-left:auto;margin-right:50%}.offset-lg-55,.flex-offset-lg-55,.layout-margin .flex-offset-lg-55,.layout-margin .offset-lg-55{margin-left:55%}[dir=rtl] .offset-lg-55,[dir=rtl] .flex-offset-lg-55,[dir=rtl] .layout-margin .flex-offset-lg-55,[dir=rtl] .layout-margin .offset-lg-55{margin-left:auto;margin-right:55%}.offset-lg-60,.flex-offset-lg-60,.layout-margin .flex-offset-lg-60,.layout-margin .offset-lg-60{margin-left:60%}[dir=rtl] .offset-lg-60,[dir=rtl] .flex-offset-lg-60,[dir=rtl] .layout-margin .flex-offset-lg-60,[dir=rtl] .layout-margin .offset-lg-60{margin-left:auto;margin-right:60%}.offset-lg-65,.flex-offset-lg-65,.layout-margin .flex-offset-lg-65,.layout-margin .offset-lg-65{margin-left:65%}[dir=rtl] .offset-lg-65,[dir=rtl] .flex-offset-lg-65,[dir=rtl] .layout-margin .flex-offset-lg-65,[dir=rtl] .layout-margin .offset-lg-65{margin-left:auto;margin-right:65%}.offset-lg-70,.flex-offset-lg-70,.layout-margin .flex-offset-lg-70,.layout-margin .offset-lg-70{margin-left:70%}[dir=rtl] .offset-lg-70,[dir=rtl] .flex-offset-lg-70,[dir=rtl] .layout-margin .flex-offset-lg-70,[dir=rtl] .layout-margin .offset-lg-70{margin-left:auto;margin-right:70%}.offset-lg-75,.flex-offset-lg-75,.layout-margin .flex-offset-lg-75,.layout-margin .offset-lg-75{margin-left:75%}[dir=rtl] .offset-lg-75,[dir=rtl] .flex-offset-lg-75,[dir=rtl] .layout-margin .flex-offset-lg-75,[dir=rtl] .layout-margin .offset-lg-75{margin-left:auto;margin-right:75%}.offset-lg-80,.flex-offset-lg-80,.layout-margin .flex-offset-lg-80,.layout-margin .offset-lg-80{margin-left:80%}[dir=rtl] .offset-lg-80,[dir=rtl] .flex-offset-lg-80,[dir=rtl] .layout-margin .flex-offset-lg-80,[dir=rtl] .layout-margin .offset-lg-80{margin-left:auto;margin-right:80%}.offset-lg-85,.flex-offset-lg-85,.layout-margin .flex-offset-lg-85,.layout-margin .offset-lg-85{margin-left:85%}[dir=rtl] .offset-lg-85,[dir=rtl] .flex-offset-lg-85,[dir=rtl] .layout-margin .flex-offset-lg-85,[dir=rtl] .layout-margin .offset-lg-85{margin-left:auto;margin-right:85%}.offset-lg-90,.flex-offset-lg-90,.layout-margin .flex-offset-lg-90,.layout-margin .offset-lg-90{margin-left:90%}[dir=rtl] .offset-lg-90,[dir=rtl] .flex-offset-lg-90,[dir=rtl] .layout-margin .flex-offset-lg-90,[dir=rtl] .layout-margin .offset-lg-90{margin-left:auto;margin-right:90%}.offset-lg-95,.flex-offset-lg-95,.layout-margin .flex-offset-lg-95,.layout-margin .offset-lg-95{margin-left:95%}[dir=rtl] .offset-lg-95,[dir=rtl] .flex-offset-lg-95,[dir=rtl] .layout-margin .flex-offset-lg-95,[dir=rtl] .layout-margin .offset-lg-95{margin-left:auto;margin-right:95%}.offset-lg-33,.flex-offset-lg-33,.layout-margin .flex-offset-lg-33,.layout-margin .offset-lg-33{margin-left:33.3333333333%}.offset-lg-66,.flex-offset-lg-66,.layout-margin .flex-offset-lg-66,.layout-margin .offset-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-lg-66,[dir=rtl] .flex-offset-lg-66,[dir=rtl] .layout-margin .flex-offset-lg-66,[dir=rtl] .layout-margin .offset-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-lg,.layout-align-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-lg-start,.layout-align-lg-start-start,.layout-align-lg-start-center,.layout-align-lg-start-end,.layout-align-lg-start-stretch{justify-content:flex-start}.layout-align-lg-center,.layout-align-lg-center-start,.layout-align-lg-center-center,.layout-align-lg-center-end,.layout-align-lg-center-stretch{justify-content:center}.layout-align-lg-end,.layout-align-lg-end-start,.layout-align-lg-end-center,.layout-align-lg-end-end,.layout-align-lg-end-stretch{justify-content:flex-end}.layout-align-lg-space-around,.layout-align-lg-space-around-center,.layout-align-lg-space-around-start,.layout-align-lg-space-around-end,.layout-align-lg-space-around-stretch{justify-content:space-around}.layout-align-lg-space-between,.layout-align-lg-space-between-center,.layout-align-lg-space-between-start,.layout-align-lg-space-between-end,.layout-align-lg-space-between-stretch{justify-content:space-between}.layout-align-lg-start-start,.layout-align-lg-center-start,.layout-align-lg-end-start,.layout-align-lg-space-between-start,.layout-align-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-lg-start-center,.layout-align-lg-center-center,.layout-align-lg-end-center,.layout-align-lg-space-between-center,.layout-align-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-lg-start-center>*,.layout-align-lg-center-center>*,.layout-align-lg-end-center>*,.layout-align-lg-space-between-center>*,.layout-align-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-lg-start-end,.layout-align-lg-center-end,.layout-align-lg-end-end,.layout-align-lg-space-between-end,.layout-align-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-lg-start-stretch,.layout-align-lg-center-stretch,.layout-align-lg-end-stretch,.layout-align-lg-space-between-stretch,.layout-align-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-lg{flex:1;box-sizing:border-box}.flex-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-lg-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-lg-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-lg-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-lg-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-lg-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-lg-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-lg-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-lg-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-lg-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-lg-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-lg-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-lg-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-lg-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-lg-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-lg-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-lg-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-lg-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-lg-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-lg-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-lg-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-lg-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex{min-width:0}.layout-lg-column>.flex-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-lg-column>.flex-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-column>.flex{min-height:0}.layout-lg,.layout-lg-column,.layout-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-lg-column{flex-direction:column}.layout-lg-row{flex-direction:row}}@media(min-width: 1920px){.flex-order-gt-lg--20{order:-20}.flex-order-gt-lg--19{order:-19}.flex-order-gt-lg--18{order:-18}.flex-order-gt-lg--17{order:-17}.flex-order-gt-lg--16{order:-16}.flex-order-gt-lg--15{order:-15}.flex-order-gt-lg--14{order:-14}.flex-order-gt-lg--13{order:-13}.flex-order-gt-lg--12{order:-12}.flex-order-gt-lg--11{order:-11}.flex-order-gt-lg--10{order:-10}.flex-order-gt-lg--9{order:-9}.flex-order-gt-lg--8{order:-8}.flex-order-gt-lg--7{order:-7}.flex-order-gt-lg--6{order:-6}.flex-order-gt-lg--5{order:-5}.flex-order-gt-lg--4{order:-4}.flex-order-gt-lg--3{order:-3}.flex-order-gt-lg--2{order:-2}.flex-order-gt-lg--1{order:-1}.flex-order-gt-lg-0{order:0}.flex-order-gt-lg-1{order:1}.flex-order-gt-lg-2{order:2}.flex-order-gt-lg-3{order:3}.flex-order-gt-lg-4{order:4}.flex-order-gt-lg-5{order:5}.flex-order-gt-lg-6{order:6}.flex-order-gt-lg-7{order:7}.flex-order-gt-lg-8{order:8}.flex-order-gt-lg-9{order:9}.flex-order-gt-lg-10{order:10}.flex-order-gt-lg-11{order:11}.flex-order-gt-lg-12{order:12}.flex-order-gt-lg-13{order:13}.flex-order-gt-lg-14{order:14}.flex-order-gt-lg-15{order:15}.flex-order-gt-lg-16{order:16}.flex-order-gt-lg-17{order:17}.flex-order-gt-lg-18{order:18}.flex-order-gt-lg-19{order:19}.flex-order-gt-lg-20{order:20}.offset-gt-lg-0,.flex-offset-gt-lg-0,.layout-margin .flex-offset-gt-lg-0,.layout-margin .offset-gt-lg-0{margin-left:0}[dir=rtl] .offset-gt-lg-0,[dir=rtl] .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .offset-gt-lg-0{margin-left:auto;margin-right:0}.offset-gt-lg-5,.flex-offset-gt-lg-5,.layout-margin .flex-offset-gt-lg-5,.layout-margin .offset-gt-lg-5{margin-left:5%}[dir=rtl] .offset-gt-lg-5,[dir=rtl] .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .offset-gt-lg-5{margin-left:auto;margin-right:5%}.offset-gt-lg-10,.flex-offset-gt-lg-10,.layout-margin .flex-offset-gt-lg-10,.layout-margin .offset-gt-lg-10{margin-left:10%}[dir=rtl] .offset-gt-lg-10,[dir=rtl] .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .offset-gt-lg-10{margin-left:auto;margin-right:10%}.offset-gt-lg-15,.flex-offset-gt-lg-15,.layout-margin .flex-offset-gt-lg-15,.layout-margin .offset-gt-lg-15{margin-left:15%}[dir=rtl] .offset-gt-lg-15,[dir=rtl] .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .offset-gt-lg-15{margin-left:auto;margin-right:15%}.offset-gt-lg-20,.flex-offset-gt-lg-20,.layout-margin .flex-offset-gt-lg-20,.layout-margin .offset-gt-lg-20{margin-left:20%}[dir=rtl] .offset-gt-lg-20,[dir=rtl] .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .offset-gt-lg-20{margin-left:auto;margin-right:20%}.offset-gt-lg-25,.flex-offset-gt-lg-25,.layout-margin .flex-offset-gt-lg-25,.layout-margin .offset-gt-lg-25{margin-left:25%}[dir=rtl] .offset-gt-lg-25,[dir=rtl] .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .offset-gt-lg-25{margin-left:auto;margin-right:25%}.offset-gt-lg-30,.flex-offset-gt-lg-30,.layout-margin .flex-offset-gt-lg-30,.layout-margin .offset-gt-lg-30{margin-left:30%}[dir=rtl] .offset-gt-lg-30,[dir=rtl] .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .offset-gt-lg-30{margin-left:auto;margin-right:30%}.offset-gt-lg-35,.flex-offset-gt-lg-35,.layout-margin .flex-offset-gt-lg-35,.layout-margin .offset-gt-lg-35{margin-left:35%}[dir=rtl] .offset-gt-lg-35,[dir=rtl] .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .offset-gt-lg-35{margin-left:auto;margin-right:35%}.offset-gt-lg-40,.flex-offset-gt-lg-40,.layout-margin .flex-offset-gt-lg-40,.layout-margin .offset-gt-lg-40{margin-left:40%}[dir=rtl] .offset-gt-lg-40,[dir=rtl] .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .offset-gt-lg-40{margin-left:auto;margin-right:40%}.offset-gt-lg-45,.flex-offset-gt-lg-45,.layout-margin .flex-offset-gt-lg-45,.layout-margin .offset-gt-lg-45{margin-left:45%}[dir=rtl] .offset-gt-lg-45,[dir=rtl] .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .offset-gt-lg-45{margin-left:auto;margin-right:45%}.offset-gt-lg-50,.flex-offset-gt-lg-50,.layout-margin .flex-offset-gt-lg-50,.layout-margin .offset-gt-lg-50{margin-left:50%}[dir=rtl] .offset-gt-lg-50,[dir=rtl] .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .offset-gt-lg-50{margin-left:auto;margin-right:50%}.offset-gt-lg-55,.flex-offset-gt-lg-55,.layout-margin .flex-offset-gt-lg-55,.layout-margin .offset-gt-lg-55{margin-left:55%}[dir=rtl] .offset-gt-lg-55,[dir=rtl] .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .offset-gt-lg-55{margin-left:auto;margin-right:55%}.offset-gt-lg-60,.flex-offset-gt-lg-60,.layout-margin .flex-offset-gt-lg-60,.layout-margin .offset-gt-lg-60{margin-left:60%}[dir=rtl] .offset-gt-lg-60,[dir=rtl] .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .offset-gt-lg-60{margin-left:auto;margin-right:60%}.offset-gt-lg-65,.flex-offset-gt-lg-65,.layout-margin .flex-offset-gt-lg-65,.layout-margin .offset-gt-lg-65{margin-left:65%}[dir=rtl] .offset-gt-lg-65,[dir=rtl] .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .offset-gt-lg-65{margin-left:auto;margin-right:65%}.offset-gt-lg-70,.flex-offset-gt-lg-70,.layout-margin .flex-offset-gt-lg-70,.layout-margin .offset-gt-lg-70{margin-left:70%}[dir=rtl] .offset-gt-lg-70,[dir=rtl] .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .offset-gt-lg-70{margin-left:auto;margin-right:70%}.offset-gt-lg-75,.flex-offset-gt-lg-75,.layout-margin .flex-offset-gt-lg-75,.layout-margin .offset-gt-lg-75{margin-left:75%}[dir=rtl] .offset-gt-lg-75,[dir=rtl] .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .offset-gt-lg-75{margin-left:auto;margin-right:75%}.offset-gt-lg-80,.flex-offset-gt-lg-80,.layout-margin .flex-offset-gt-lg-80,.layout-margin .offset-gt-lg-80{margin-left:80%}[dir=rtl] .offset-gt-lg-80,[dir=rtl] .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .offset-gt-lg-80{margin-left:auto;margin-right:80%}.offset-gt-lg-85,.flex-offset-gt-lg-85,.layout-margin .flex-offset-gt-lg-85,.layout-margin .offset-gt-lg-85{margin-left:85%}[dir=rtl] .offset-gt-lg-85,[dir=rtl] .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .offset-gt-lg-85{margin-left:auto;margin-right:85%}.offset-gt-lg-90,.flex-offset-gt-lg-90,.layout-margin .flex-offset-gt-lg-90,.layout-margin .offset-gt-lg-90{margin-left:90%}[dir=rtl] .offset-gt-lg-90,[dir=rtl] .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .offset-gt-lg-90{margin-left:auto;margin-right:90%}.offset-gt-lg-95,.flex-offset-gt-lg-95,.layout-margin .flex-offset-gt-lg-95,.layout-margin .offset-gt-lg-95{margin-left:95%}[dir=rtl] .offset-gt-lg-95,[dir=rtl] .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .offset-gt-lg-95{margin-left:auto;margin-right:95%}.offset-gt-lg-33,.flex-offset-gt-lg-33,.layout-margin .flex-offset-gt-lg-33,.layout-margin .offset-gt-lg-33{margin-left:33.3333333333%}.offset-gt-lg-66,.flex-offset-gt-lg-66,.layout-margin .flex-offset-gt-lg-66,.layout-margin .offset-gt-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-lg-66,[dir=rtl] .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .offset-gt-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-lg,.layout-align-gt-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-lg-start,.layout-align-gt-lg-start-start,.layout-align-gt-lg-start-center,.layout-align-gt-lg-start-end,.layout-align-gt-lg-start-stretch{justify-content:flex-start}.layout-align-gt-lg-center,.layout-align-gt-lg-center-start,.layout-align-gt-lg-center-center,.layout-align-gt-lg-center-end,.layout-align-gt-lg-center-stretch{justify-content:center}.layout-align-gt-lg-end,.layout-align-gt-lg-end-start,.layout-align-gt-lg-end-center,.layout-align-gt-lg-end-end,.layout-align-gt-lg-end-stretch{justify-content:flex-end}.layout-align-gt-lg-space-around,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-around-stretch{justify-content:space-around}.layout-align-gt-lg-space-between,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-between-stretch{justify-content:space-between}.layout-align-gt-lg-start-start,.layout-align-gt-lg-center-start,.layout-align-gt-lg-end-start,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-lg-start-center,.layout-align-gt-lg-center-center,.layout-align-gt-lg-end-center,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-lg-start-center>*,.layout-align-gt-lg-center-center>*,.layout-align-gt-lg-end-center>*,.layout-align-gt-lg-space-between-center>*,.layout-align-gt-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-lg-start-end,.layout-align-gt-lg-center-end,.layout-align-gt-lg-end-end,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-lg-start-stretch,.layout-align-gt-lg-center-stretch,.layout-align-gt-lg-end-stretch,.layout-align-gt-lg-space-between-stretch,.layout-align-gt-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-lg{flex:1;box-sizing:border-box}.flex-gt-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-lg-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex{min-width:0}.layout-gt-lg-column>.flex-gt-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-column>.flex{min-height:0}.layout-gt-lg,.layout-gt-lg-column,.layout-gt-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-lg-column{flex-direction:column}.layout-gt-lg-row{flex-direction:row}.flex-order-xl--20{order:-20}.flex-order-xl--19{order:-19}.flex-order-xl--18{order:-18}.flex-order-xl--17{order:-17}.flex-order-xl--16{order:-16}.flex-order-xl--15{order:-15}.flex-order-xl--14{order:-14}.flex-order-xl--13{order:-13}.flex-order-xl--12{order:-12}.flex-order-xl--11{order:-11}.flex-order-xl--10{order:-10}.flex-order-xl--9{order:-9}.flex-order-xl--8{order:-8}.flex-order-xl--7{order:-7}.flex-order-xl--6{order:-6}.flex-order-xl--5{order:-5}.flex-order-xl--4{order:-4}.flex-order-xl--3{order:-3}.flex-order-xl--2{order:-2}.flex-order-xl--1{order:-1}.flex-order-xl-0{order:0}.flex-order-xl-1{order:1}.flex-order-xl-2{order:2}.flex-order-xl-3{order:3}.flex-order-xl-4{order:4}.flex-order-xl-5{order:5}.flex-order-xl-6{order:6}.flex-order-xl-7{order:7}.flex-order-xl-8{order:8}.flex-order-xl-9{order:9}.flex-order-xl-10{order:10}.flex-order-xl-11{order:11}.flex-order-xl-12{order:12}.flex-order-xl-13{order:13}.flex-order-xl-14{order:14}.flex-order-xl-15{order:15}.flex-order-xl-16{order:16}.flex-order-xl-17{order:17}.flex-order-xl-18{order:18}.flex-order-xl-19{order:19}.flex-order-xl-20{order:20}.offset-xl-0,.flex-offset-xl-0,.layout-margin .flex-offset-xl-0,.layout-margin .offset-xl-0{margin-left:0}[dir=rtl] .offset-xl-0,[dir=rtl] .flex-offset-xl-0,[dir=rtl] .layout-margin .flex-offset-xl-0,[dir=rtl] .layout-margin .offset-xl-0{margin-left:auto;margin-right:0}.offset-xl-5,.flex-offset-xl-5,.layout-margin .flex-offset-xl-5,.layout-margin .offset-xl-5{margin-left:5%}[dir=rtl] .offset-xl-5,[dir=rtl] .flex-offset-xl-5,[dir=rtl] .layout-margin .flex-offset-xl-5,[dir=rtl] .layout-margin .offset-xl-5{margin-left:auto;margin-right:5%}.offset-xl-10,.flex-offset-xl-10,.layout-margin .flex-offset-xl-10,.layout-margin .offset-xl-10{margin-left:10%}[dir=rtl] .offset-xl-10,[dir=rtl] .flex-offset-xl-10,[dir=rtl] .layout-margin .flex-offset-xl-10,[dir=rtl] .layout-margin .offset-xl-10{margin-left:auto;margin-right:10%}.offset-xl-15,.flex-offset-xl-15,.layout-margin .flex-offset-xl-15,.layout-margin .offset-xl-15{margin-left:15%}[dir=rtl] .offset-xl-15,[dir=rtl] .flex-offset-xl-15,[dir=rtl] .layout-margin .flex-offset-xl-15,[dir=rtl] .layout-margin .offset-xl-15{margin-left:auto;margin-right:15%}.offset-xl-20,.flex-offset-xl-20,.layout-margin .flex-offset-xl-20,.layout-margin .offset-xl-20{margin-left:20%}[dir=rtl] .offset-xl-20,[dir=rtl] .flex-offset-xl-20,[dir=rtl] .layout-margin .flex-offset-xl-20,[dir=rtl] .layout-margin .offset-xl-20{margin-left:auto;margin-right:20%}.offset-xl-25,.flex-offset-xl-25,.layout-margin .flex-offset-xl-25,.layout-margin .offset-xl-25{margin-left:25%}[dir=rtl] .offset-xl-25,[dir=rtl] .flex-offset-xl-25,[dir=rtl] .layout-margin .flex-offset-xl-25,[dir=rtl] .layout-margin .offset-xl-25{margin-left:auto;margin-right:25%}.offset-xl-30,.flex-offset-xl-30,.layout-margin .flex-offset-xl-30,.layout-margin .offset-xl-30{margin-left:30%}[dir=rtl] .offset-xl-30,[dir=rtl] .flex-offset-xl-30,[dir=rtl] .layout-margin .flex-offset-xl-30,[dir=rtl] .layout-margin .offset-xl-30{margin-left:auto;margin-right:30%}.offset-xl-35,.flex-offset-xl-35,.layout-margin .flex-offset-xl-35,.layout-margin .offset-xl-35{margin-left:35%}[dir=rtl] .offset-xl-35,[dir=rtl] .flex-offset-xl-35,[dir=rtl] .layout-margin .flex-offset-xl-35,[dir=rtl] .layout-margin .offset-xl-35{margin-left:auto;margin-right:35%}.offset-xl-40,.flex-offset-xl-40,.layout-margin .flex-offset-xl-40,.layout-margin .offset-xl-40{margin-left:40%}[dir=rtl] .offset-xl-40,[dir=rtl] .flex-offset-xl-40,[dir=rtl] .layout-margin .flex-offset-xl-40,[dir=rtl] .layout-margin .offset-xl-40{margin-left:auto;margin-right:40%}.offset-xl-45,.flex-offset-xl-45,.layout-margin .flex-offset-xl-45,.layout-margin .offset-xl-45{margin-left:45%}[dir=rtl] .offset-xl-45,[dir=rtl] .flex-offset-xl-45,[dir=rtl] .layout-margin .flex-offset-xl-45,[dir=rtl] .layout-margin .offset-xl-45{margin-left:auto;margin-right:45%}.offset-xl-50,.flex-offset-xl-50,.layout-margin .flex-offset-xl-50,.layout-margin .offset-xl-50{margin-left:50%}[dir=rtl] .offset-xl-50,[dir=rtl] .flex-offset-xl-50,[dir=rtl] .layout-margin .flex-offset-xl-50,[dir=rtl] .layout-margin .offset-xl-50{margin-left:auto;margin-right:50%}.offset-xl-55,.flex-offset-xl-55,.layout-margin .flex-offset-xl-55,.layout-margin .offset-xl-55{margin-left:55%}[dir=rtl] .offset-xl-55,[dir=rtl] .flex-offset-xl-55,[dir=rtl] .layout-margin .flex-offset-xl-55,[dir=rtl] .layout-margin .offset-xl-55{margin-left:auto;margin-right:55%}.offset-xl-60,.flex-offset-xl-60,.layout-margin .flex-offset-xl-60,.layout-margin .offset-xl-60{margin-left:60%}[dir=rtl] .offset-xl-60,[dir=rtl] .flex-offset-xl-60,[dir=rtl] .layout-margin .flex-offset-xl-60,[dir=rtl] .layout-margin .offset-xl-60{margin-left:auto;margin-right:60%}.offset-xl-65,.flex-offset-xl-65,.layout-margin .flex-offset-xl-65,.layout-margin .offset-xl-65{margin-left:65%}[dir=rtl] .offset-xl-65,[dir=rtl] .flex-offset-xl-65,[dir=rtl] .layout-margin .flex-offset-xl-65,[dir=rtl] .layout-margin .offset-xl-65{margin-left:auto;margin-right:65%}.offset-xl-70,.flex-offset-xl-70,.layout-margin .flex-offset-xl-70,.layout-margin .offset-xl-70{margin-left:70%}[dir=rtl] .offset-xl-70,[dir=rtl] .flex-offset-xl-70,[dir=rtl] .layout-margin .flex-offset-xl-70,[dir=rtl] .layout-margin .offset-xl-70{margin-left:auto;margin-right:70%}.offset-xl-75,.flex-offset-xl-75,.layout-margin .flex-offset-xl-75,.layout-margin .offset-xl-75{margin-left:75%}[dir=rtl] .offset-xl-75,[dir=rtl] .flex-offset-xl-75,[dir=rtl] .layout-margin .flex-offset-xl-75,[dir=rtl] .layout-margin .offset-xl-75{margin-left:auto;margin-right:75%}.offset-xl-80,.flex-offset-xl-80,.layout-margin .flex-offset-xl-80,.layout-margin .offset-xl-80{margin-left:80%}[dir=rtl] .offset-xl-80,[dir=rtl] .flex-offset-xl-80,[dir=rtl] .layout-margin .flex-offset-xl-80,[dir=rtl] .layout-margin .offset-xl-80{margin-left:auto;margin-right:80%}.offset-xl-85,.flex-offset-xl-85,.layout-margin .flex-offset-xl-85,.layout-margin .offset-xl-85{margin-left:85%}[dir=rtl] .offset-xl-85,[dir=rtl] .flex-offset-xl-85,[dir=rtl] .layout-margin .flex-offset-xl-85,[dir=rtl] .layout-margin .offset-xl-85{margin-left:auto;margin-right:85%}.offset-xl-90,.flex-offset-xl-90,.layout-margin .flex-offset-xl-90,.layout-margin .offset-xl-90{margin-left:90%}[dir=rtl] .offset-xl-90,[dir=rtl] .flex-offset-xl-90,[dir=rtl] .layout-margin .flex-offset-xl-90,[dir=rtl] .layout-margin .offset-xl-90{margin-left:auto;margin-right:90%}.offset-xl-95,.flex-offset-xl-95,.layout-margin .flex-offset-xl-95,.layout-margin .offset-xl-95{margin-left:95%}[dir=rtl] .offset-xl-95,[dir=rtl] .flex-offset-xl-95,[dir=rtl] .layout-margin .flex-offset-xl-95,[dir=rtl] .layout-margin .offset-xl-95{margin-left:auto;margin-right:95%}.offset-xl-33,.flex-offset-xl-33,.layout-margin .flex-offset-xl-33,.layout-margin .offset-xl-33{margin-left:33.3333333333%}.offset-xl-66,.flex-offset-xl-66,.layout-margin .flex-offset-xl-66,.layout-margin .offset-xl-66{margin-left:66.6666666667%}[dir=rtl] .offset-xl-66,[dir=rtl] .flex-offset-xl-66,[dir=rtl] .layout-margin .flex-offset-xl-66,[dir=rtl] .layout-margin .offset-xl-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xl,.layout-align-xl-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xl-start,.layout-align-xl-start-start,.layout-align-xl-start-center,.layout-align-xl-start-end,.layout-align-xl-start-stretch{justify-content:flex-start}.layout-align-xl-center,.layout-align-xl-center-start,.layout-align-xl-center-center,.layout-align-xl-center-end,.layout-align-xl-center-stretch{justify-content:center}.layout-align-xl-end,.layout-align-xl-end-start,.layout-align-xl-end-center,.layout-align-xl-end-end,.layout-align-xl-end-stretch{justify-content:flex-end}.layout-align-xl-space-around,.layout-align-xl-space-around-center,.layout-align-xl-space-around-start,.layout-align-xl-space-around-end,.layout-align-xl-space-around-stretch{justify-content:space-around}.layout-align-xl-space-between,.layout-align-xl-space-between-center,.layout-align-xl-space-between-start,.layout-align-xl-space-between-end,.layout-align-xl-space-between-stretch{justify-content:space-between}.layout-align-xl-start-start,.layout-align-xl-center-start,.layout-align-xl-end-start,.layout-align-xl-space-between-start,.layout-align-xl-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xl-start-center,.layout-align-xl-center-center,.layout-align-xl-end-center,.layout-align-xl-space-between-center,.layout-align-xl-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xl-start-center>*,.layout-align-xl-center-center>*,.layout-align-xl-end-center>*,.layout-align-xl-space-between-center>*,.layout-align-xl-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xl-start-end,.layout-align-xl-center-end,.layout-align-xl-end-end,.layout-align-xl-space-between-end,.layout-align-xl-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xl-start-stretch,.layout-align-xl-center-stretch,.layout-align-xl-end-stretch,.layout-align-xl-space-between-stretch,.layout-align-xl-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xl{flex:1;box-sizing:border-box}.flex-xl-grow{flex:1 1 100%;box-sizing:border-box}.flex-xl-initial{flex:0 1 auto;box-sizing:border-box}.flex-xl-auto{flex:1 1 auto;box-sizing:border-box}.flex-xl-none{flex:0 0 auto;box-sizing:border-box}.flex-xl-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xl-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xl-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xl-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xl-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xl-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xl-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xl-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xl-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xl-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xl-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xl-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xl-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xl-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xl-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xl-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xl-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xl-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xl-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xl-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xl-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xl-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xl-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex{min-width:0}.layout-xl-column>.flex-xl-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xl-column>.flex-xl-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-column>.flex{min-height:0}.layout-xl,.layout-xl-column,.layout-xl-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xl-column{flex-direction:column}.layout-xl-row{flex-direction:row}.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-lg:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show){display:none}.hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}}@media print{.hide-print:not(.show-print):not(.show){display:none !important}}:root{--xc-ws-div-color: #011f6a;--xc-ws-text-color: #ffffff;--xc-ws-text-button-color: #ffffff;--xc-ws-button-color: #011f6a;--xc-ws-background-color: #fafafa;--xc-ws-client-height: 450px;--xc-ws-client-width: 295px}span.ng-binding,span.field-description{user-select:none}.centered-text{text-align:center}::-webkit-scrollbar{width:0;background:transparent}::-webkit-scrollbar-thumb{background:transparent;border-radius:0px}.field-description{font-size:13px;line-height:14px;color:gray;padding:5px 0px 5px 0px}.field-description.error{color:#dd2c00}.md-button.upload-button{padding:0 16px;height:36px}md-icon.material-icons{color:inherit !important}.white-label,.md-toolbar-tools .title{user-select:none}.white-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.white-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md-fab.upload-button,.md-fab.upload-button.md-button.md-default-theme.md-raised:not([disabled]) md-icon,.md-fab.upload-button.md-button.md-raised:not([disabled]) md-icon{color:var(--xc-ws-text-color) !important;background:var(--xc-ws-div-color) !important}.form-input-container span{word-break:break-all}.chat-online ::-webkit-scrollbar{width:5px;background:var(--xc-ws-div-color)}.chat-online ::-webkit-scrollbar-thumb{background:linear-gradient(13deg, var(--xc-ws-text-color), var(--xc-ws-div-color));border-radius:10px}.chat-online ::-webkit-scrollbar-thumb:hover{background:linear-gradient(13deg, var(--xc-ws-div-color), var(--xc-ws-text-color))}.chat-online form{display:flex;width:100%;height:calc(100% - 20px);overflow:auto;padding:1em 0px 40px 0px;position:relative;max-width:100%;overflow-x:hidden;margin-bottom:10px}.chat-online form .form-field{margin-right:10px;margin-left:10px}.chat-online form .form-input-container{width:100%;height:100%;overflow:auto;scrollbar-width:none}.chat-online form div[ng-switch-when=label] md-content{overflow:hidden}.chat-online form div[ng-switch-when=label] md-content span{overflow:hidden}.chat-online form div.online-button-wrapper,.chat-online form div.offline-button-wrapper{position:fixed;bottom:30px;left:0px;width:calc(100% - 40px);padding:0px 20px;display:flex;background:transparent;align-items:center;justify-content:center}.chat-online form div.online-button-wrapper button,.chat-online form div.offline-button-wrapper button{margin:8px 0px;padding:2px;width:100%}.chat-online form .layout-row,.chat-online form .layout-column{flex-wrap:wrap;justify-content:start}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button,.chat-online form .layout-column md-checkbox,.chat-online form .layout-column md-radio-button{padding:4px 0;margin-left:unset !important;word-break:break-all}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button{min-width:50%;max-width:50%}.chat-online form button.upload-button{margin:6px 8px 6px 0}.chat-online form button.upload-button md-icon{font-size:20px}.chat-unmanaged{display:flex;flex-direction:column}.chat-unmanaged form{flex-grow:1;max-width:100%;overflow-x:hidden}.chat-closing{height:100%;padding:20px;overflow:hidden;align-items:stretch;justify-content:space-between}.chat-closing>md-content,.chat-closing>form{max-width:100%;overflow-x:hidden}.chat-closing>md-content,.chat-closing>md-content span,.chat-closing>form,.chat-closing>form span{width:100%}.logo{width:32px}#attachmentButton:hover .mdi-attachment:before{color:#555 !important;opacity:.85 !important}#input_text{position:relative !important;width:100% !important;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}#input_text:focus-within{border-color:#66afe9;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}#attachmentButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}i.icon_color{color:red}#sendButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}.emojionearea,.emojionearea.form-control{display:block;position:relative !important;width:100%;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:0px solid #ccc !important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-webkit-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.mdi mdi-attachment mdi-24px mdi-light ng-scope::before{color:#a9a9a9}.mdi-attachment:hover{color:#555 !important}.mdi-24px.mdi-set,.mdi-24px.mdi:before{color:#a9a9a9}.md-button.md-fab.md-mini{line-height:20px !important;min-height:24px !important}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>img{width:19px !important;height:19px !important;margin:0 1px !important}.emojionearea .emojionearea-picker{width:100% !important;right:0 !important;height:220px !important;top:0px !important}.emojionearea .emojionearea-picker .emojionearea-wrapper{position:relative;height:220px !important;width:100% !important}.emojionearea .emojionearea-picker.emojionearea-picker-position-top{margin-top:-100% !important}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-top{margin-top:-236px !important;width:260px !important;min-width:260px !important}.emojionearea .emojionearea-picker .emojionearea-search>input{width:100px !important;min-width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search{width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search-panel+.emojionearea-scroll-area{height:70% !important}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block{padding:0 !important}.emojionearea .emojionearea-picker .emojionearea-filters{background:#f5f7f9;padding:0 !important;height:40px}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter{width:25px !important;padding:7px 3px 0}#id-row,#chat-app{max-width:100%;width:100%;max-height:100%;height:100%}#chat-app{background-color:transparent}#chat-app .header-button{padding:0;margin:0;font-size:18px;cursor:pointer}ui-view{display:block;width:100%;height:100%}#chat-app .chat-toolbar{height:56px;min-height:56px;cursor:pointer;outline:0}#chat-app .chat-content{flex-grow:1;height:calc(100% - 56px);background:#fff;border:1px solid #d3d3d3;-ms-overflow-style:none;overflow:hidden;box-sizing:border-box}#chat-app .chat-content .chat-messages{height:calc(100% - 60px);overflow:auto;border-bottom:1px solid #d3d3d3}#chat-app .chat-content .chat-online{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .chat-content .chat-unmanaged{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .avatar-wrapper{position:relative;bottom:-3px;right:5px}#chat-app .chat-content .message-row .bubble{word-wrap:break-word;position:relative;max-width:190px;padding:6px 7px 8px 9px;background-color:#fff;border-radius:6px}#chat-app .chat-content .message-row .bubble .message{white-space:pre-wrap}#chat-app .chat-content .message-row .bubble .message-done{color:#dcdcdc}#chat-app .chat-content .message-row .bubble .message-done-all{color:#00bfff}#chat-app .chat-content .message-row .bubble:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADGUExURQAAAP////b29vn5+f///wAAAP///wAAAAAAAP///9ra2v////j4+PHx8fv7++Hh4fHx8f////////////////39/QAAAP////////z8/P////39/f39/fz8/P////////////z8/P////////////z8/P////////////v7+/Hx8f///9bW1vz8/K2trf////39/f39/WJiYgAAAExMTFtbWwAAAN3d3cjIyPr6+vX19QAAAO7u7vz8/NTU1Ofn5zMzM////zGPlXsAAABBdFJOUwAcm/kREh4CCDWL1SneR6TfAQffhMYK/A5nRrLWfRc5DW2ih5f+19Kn+9v4g/1LCJuXHwQUKgahcXS6DNnlDMMKKzPoTgAAAKBJREFUKM+V08USwmAQA+C/0NIWd3d3d8/7vxTMcIPkQK7f7CG7s8bQAOY/SCuwFYQU1P+eiCqIK2gpWCmoCrAgoKQgJ8CHgIqAMjg0MxxSQ3DogEMWFBZtUPAHYGB1CyDQWE6AH7BrfXzlAxGAQhECTGAmwN1Okz0Gb/LW4fEItIfrOfNELMh3tck7u+PhcT2zQ7l77/K8iY8yJwV3BeYFqpc/uSyPGdAAAAAASUVORK5CYII=);content:"";position:absolute;left:-11px;bottom:3px;width:12px;height:19px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain}#chat-app .chat-content .message-row .bubble .time{font-size:10px;text-align:right;margin-bottom:5px}#chat-app .chat-content .message-row.out .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.auto{align-items:flex-end;font-style:italic}#chat-app .chat-content .message-row.auto .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-size:17px;font-style:italic;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in{align-items:flex-end}#chat-app .chat-content .message-row.in2{align-items:flex-end}#chat-app .chat-content .message-row.out{align-items:flex-end}#chat-app .chat-content .message-row.in2 .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in2 .bubble{margin-right:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in2 .bubble:before{left:-11px;right:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=);-webkit-transform:rotate(180deg);transform:rotate(180deg)}#chat-app .chat-content .message-row.in .avatar{order:2;margin:0 0 0 16px;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in .bubble{margin-left:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in .bubble:before{right:-11px;left:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=)}#chat-app .chat-footer{width:100%}#waiting{overflow:visible;height:calc(100% - 64px);background:#fff;text-align:center;flex:1 0 auto;padding:32px}#waiting .subtitle{margin:16px 0;max-width:300px;color:rgba(0,0,0,.54)}.sk-fading-circle{width:40px;height:40px;position:relative}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:"";display:block;margin:0 auto;width:15%;height:15%;background-color:#333;border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}md-toast.md-success-toast .md-toast-content{background-color:green}md-toast.md-warning-toast .md-toast-content{color:#000;background-color:#f0ad4e}md-toast.md-failure-toast .md-toast-content{background-color:red}md-toast .md-toast-text{white-space:pre-line}md-toast.size .md-toast-content{font-weight:550;padding:0px;text-align:center;height:56px}md-toast.rounded .md-toast-content{border-radius:15px 15px 0px 0px}md-toast.squared .md-toast-content{border-radius:0px 0px 0px 0px}@media(min-device-width: 769px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:block}}@media(max-device-width: 768px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:none}}md-option .md-text{white-space:break-spaces}md-input-container{margin:0px 0px 8px 0px}.no-padding{padding:0 !important}
/*# sourceMappingURL=app.css.map*/
\ No newline at end of file
-{"version":3,"file":"styles/app.css","mappings":";;;;;;;;;;;;;;;;;;;;AAEQ,WCFR,mCACE,4CACA,wSACA,mBAKA,kBACA,sBCTF,oBAEE,yDACA,kBACA,oBACA,oBACA,mCACA,kCACA,0BCPE,eACI,kCADJ,eACI,qBADJ,eACI,2BADJ,eACI,yBADJ,eACI,iCADJ,eACI,kCADJ,eACI,2BADJ,eACI,4BADJ,eACI,6BADJ,eACI,0BADJ,eACI,2BADJ,eACI,2BADJ,eACI,yBADJ,eACI,8BADJ,eACI,2BADJ,eACI,8BADJ,eACI,oCADJ,eACI,sCADJ,eACI,mCADJ,eACI,2CADJ,eACI,6BADJ,eACI,yBADJ,eACI,6BADJ,eACI,0BADJ,eACI,kCADJ,eACI,4BADJ,eACI,4BADJ,eACI,8BADJ,eACI,sCADJ,eACI,0BADJ,eACI,4BADJ,eACI,sBADJ,eACI,oBADJ,eACI,6BADJ,eACI,wBADJ,eACI,sBADJ,eACI,8BADJ,eACI,0BADJ,eACI,8BADJ,eACI,qBADJ,eACI,qBADJ,eACI,mBADJ,eACI,wBADJ,eACI,yBADJ,eACI,yBADJ,eACI,4BADJ,eACI,uBADJ,eACI,wBADJ,eACI,0BADJ,eACI,mBADJ,eACI,mBADJ,eACI,uBADJ,eACI,0BADJ,eACI,kCADJ,eACI,4BADJ,eACI,2BADJ,eACI,4BADJ,eACI,2BADJ,eACI,mBADJ,eACI,2BADJ,eACI,kBADJ,eACI,mBADJ,eACI,0BADJ,eACI,uBADJ,eACI,oBADJ,eACI,+BADJ,eACI,uBADJ,eACI,uBADJ,eACI,oBADJ,eACI,qBADJ,eACI,kCADJ,eACI,0BADJ,eACI,4BADJ,eACI,qBADJ,eACI,uBADJ,eACI,uBADJ,eACI,mBADJ,eACI,mBADJ,eACI,0BADJ,eACI,uBADJ,eACI,iCADJ,eACI,oCADJ,eACI,oCADJ,eACI,mCADJ,eACI,kCADJ,eACI,4BADJ,eACI,0BADJ,eACI,yBADJ,eACI,sBADJ,eACI,kBADJ,eACI,qBADJ,eACI,mCADJ,eACI,oCADJ,eACI,mCADJ,eACI,kCADJ,eACI,uBADJ,eACI,+BADJ,eACI,gCADJ,eACI,4BADJ,eACI,gCADJ,eACI,iCADJ,eACI,uCADJ,eACI,iCADJ,eACI,kCADJ,eACI,+BADJ,eACI,qCADJ,eACI,wBADJ,eACI,6BADJ,eACI,iCADJ,eACI,yCADJ,eACI,oCADJ,eACI,4CADJ,eACI,6CADJ,eACI,4BADJ,eACI,oCADJ,eACI,4CADJ,eACI,8BADJ,eACI,0BADJ,eACI,8BADJ,eACI,+BADJ,eACI,qCADJ,eACI,+BADJ,eACI,gCADJ,eACI,6BADJ,eACI,mCADJ,eACI,wBADJ,eACI,6BADJ,eACI,iCADJ,eACI,yCADJ,eACI,oCADJ,eACI,4CADJ,eACI,6CADJ,eACI,4BADJ,eACI,oCADJ,eACI,4CADJ,eACI,8BADJ,eACI,yBADJ,eACI,8BADJ,eACI,kCADJ,eACI,0CADJ,eACI,qCADJ,eACI,6CADJ,eACI,8CADJ,eACI,6BADJ,eACI,qCADJ,eACI,6CADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,sBADJ,eACI,2BADJ,eACI,+BADJ,eACI,uCADJ,eACI,kCADJ,eACI,0CADJ,eACI,2CADJ,eACI,0BADJ,eACI,kCADJ,eACI,0CADJ,eACI,4BADJ,eACI,oBADJ,eACI,uBADJ,eACI,sBADJ,eACI,gBADJ,eACI,uBADJ,eACI,kBADJ,eACI,wBADJ,eACI,uBADJ,eACI,+BADJ,eACI,sBADJ,eACI,yBADJ,eACI,uBADJ,eACI,sBADJ,eACI,mBADJ,eACI,kBADJ,eACI,wBADJ,eACI,wBADJ,eACI,uBADJ,eACI,4BADJ,eACI,uBADJ,eACI,sBADJ,eACI,kBADJ,eACI,qBADJ,eACI,0BADJ,eACI,oBADJ,eACI,oBADJ,eACI,sBADJ,eACI,0BADJ,eACI,sBADJ,eACI,oBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,qBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,2BADJ,eACI,8BADJ,eACI,iCADJ,eACI,kCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,sCADJ,eACI,uCADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,6CADJ,eACI,+CADJ,eACI,2BADJ,eACI,8BADJ,eACI,6BADJ,eACI,0BADJ,eACI,8BADJ,eACI,6BADJ,eACI,mBADJ,eACI,oBADJ,eACI,mBADJ,eACI,uBADJ,eACI,kBADJ,eACI,qBADJ,eACI,kBADJ,eACI,sBADJ,eACI,0BADJ,eACI,uBADJ,eACI,uBADJ,eACI,+BADJ,eACI,wBADJ,eACI,kBADJ,eACI,mBADJ,eACI,kBADJ,eACI,kBADJ,eACI,wBADJ,eACI,iBADJ,eACI,uBADJ,eACI,uBADJ,eACI,qBADJ,eACI,wBADJ,eACI,wBADJ,eACI,qBADJ,eACI,oBADJ,eACI,0BADJ,eACI,qBADJ,eACI,uBADJ,eACI,6BADJ,eACI,+BADJ,eACI,2BADJ,eACI,gCADJ,eACI,gCADJ,eACI,kBADJ,eACI,yBADJ,eACI,sBADJ,eACI,yBADJ,eACI,kBADJ,eACI,sBADJ,eACI,kBADJ,eACI,kBADJ,eACI,wBADJ,eACI,2BADJ,eACI,mCADJ,eACI,uBADJ,eACI,oCADJ,eACI,+BADJ,eACI,uBADJ,eACI,yBADJ,eACI,2BADJ,eACI,0BADJ,eACI,sBADJ,eACI,4BADJ,eACI,4BADJ,eACI,8BADJ,eACI,2BADJ,eACI,mCADJ,eACI,6BADJ,eACI,qBADJ,eACI,uBADJ,eACI,wBADJ,eACI,gCADJ,eACI,2BADJ,eACI,mCADJ,eACI,0BADJ,eACI,+BADJ,eACI,2BADJ,eACI,yBADJ,eACI,iCADJ,eACI,yBADJ,eACI,iCADJ,eACI,4BADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,wBADJ,eACI,gCADJ,eACI,6BADJ,eACI,yBADJ,eACI,qBADJ,eACI,kBADJ,eACI,qBADJ,eACI,iBADJ,eACI,wBADJ,eACI,wBADJ,eACI,oBADJ,eACI,uBADJ,eACI,6BADJ,eACI,gCADJ,eACI,+BADJ,eACI,8BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,6BADJ,eACI,mBADJ,eACI,mBADJ,eACI,oBADJ,eACI,iBADJ,eACI,4BADJ,eACI,sBADJ,eACI,sBADJ,eACI,iBADJ,eACI,iCADJ,eACI,mCADJ,eACI,+BADJ,eACI,wBADJ,eACI,sBADJ,eACI,oBADJ,eACI,kBADJ,eACI,0BADJ,eACI,0BADJ,eACI,wBADJ,eACI,sBADJ,eACI,4BADJ,eACI,4BADJ,eACI,4BADJ,eACI,2BADJ,eACI,+BADJ,eACI,qCADJ,eACI,2BADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,2BADJ,eACI,4BADJ,eACI,uBADJ,eACI,wBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,uBADJ,eACI,2BADJ,eACI,+BADJ,eACI,2BADJ,eACI,oBADJ,eACI,0BADJ,eACI,4BADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,yBADJ,eACI,oCADJ,eACI,oCADJ,eACI,qCADJ,eACI,kCADJ,eACI,wBADJ,eACI,+BADJ,eACI,yBADJ,eACI,iCADJ,eACI,2BADJ,eACI,0BADJ,eACI,oBADJ,eACI,oBADJ,eACI,uBADJ,eACI,sBADJ,eACI,iBADJ,eACI,yBADJ,eACI,2BADJ,eACI,6BADJ,eACI,wBADJ,eACI,2BADJ,eACI,wBADJ,eACI,sBADJ,eACI,wBADJ,eACI,sBADJ,eACI,qBADJ,eACI,mBADJ,eACI,2BADJ,eACI,mCADJ,eACI,2BADJ,eACI,oBADJ,eACI,kBADJ,eACI,sBADJ,eACI,0BADJ,eACI,uBADJ,eACI,gCADJ,eACI,kBADJ,eACI,sBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,4BADJ,eACI,sBADJ,eACI,oBADJ,eACI,iBADJ,eACI,kBADJ,eACI,2BADJ,eACI,uBADJ,eACI,+BADJ,eACI,6BADJ,eACI,4BADJ,eACI,8BADJ,eACI,4BADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,yBADJ,eACI,0BADJ,eACI,uBADJ,eACI,8BADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,yBADJ,eACI,iCADJ,eACI,yBADJ,eACI,6BADJ,eACI,wBADJ,eACI,gCADJ,eACI,gCADJ,eACI,uBADJ,eACI,sCADJ,eACI,4BADJ,eACI,mBADJ,eACI,uBADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,4BADJ,eACI,mCADJ,eACI,2CADJ,eACI,oCADJ,eACI,mCADJ,eACI,6BADJ,eACI,oCADJ,eACI,4CADJ,eACI,qCADJ,eACI,qCADJ,eACI,4CADJ,eACI,oDADJ,eACI,6CADJ,eACI,sCADJ,eACI,6CADJ,eACI,qDADJ,eACI,8CADJ,eACI,0BADJ,eACI,6BADJ,eACI,0BADJ,eACI,wBADJ,eACI,0BADJ,eACI,wBADJ,eACI,yBADJ,eACI,wBADJ,eACI,iCADJ,eACI,iCADJ,eACI,kCADJ,eACI,+BADJ,eACI,0BADJ,eACI,0BADJ,eACI,2BADJ,eACI,wBADJ,eACI,uBADJ,eACI,0BADJ,eACI,wBADJ,eACI,kBADJ,eACI,oBADJ,eACI,oBADJ,eACI,4BADJ,eACI,yBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,6BADJ,eACI,kCADJ,eACI,kCADJ,eACI,6BADJ,eACI,qCADJ,eACI,4BADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,qCADJ,eACI,4BADJ,eACI,oBADJ,eACI,mBADJ,eACI,yBADJ,eACI,uBADJ,eACI,wBADJ,eACI,sBADJ,eACI,uBADJ,eACI,yBADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,2BADJ,eACI,mCADJ,eACI,2BADJ,eACI,4BADJ,eACI,mBADJ,eACI,0BADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,+BADJ,eACI,2BADJ,eACI,yBADJ,eACI,iCADJ,eACI,wBADJ,eACI,wBADJ,eACI,0BADJ,eACI,oBADJ,eACI,wBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,+BADJ,eACI,wCADJ,eACI,4BADJ,eACI,qCADJ,eACI,4BADJ,eACI,oCADJ,eACI,8BADJ,eACI,yBADJ,eACI,uBADJ,eACI,6BADJ,eACI,qBADJ,eACI,oBADJ,eACI,4BADJ,eACI,0BADJ,eACI,kBADJ,eACI,mBADJ,eACI,qBADJ,eACI,0BADJ,eACI,qBADJ,eACI,6BADJ,eACI,qCADJ,eACI,2BADJ,eACI,mCADJ,eACI,2BADJ,eACI,mCADJ,eACI,8BADJ,eACI,sCADJ,eACI,6BADJ,eACI,kCADJ,eACI,gCADJ,eACI,wCADJ,eACI,8BADJ,eACI,sCADJ,eACI,4BADJ,eACI,oCADJ,eACI,0BADJ,eACI,mCADJ,eACI,2CADJ,eACI,kCADJ,eACI,qBADJ,eACI,qBADJ,eACI,6BADJ,eACI,qBADJ,eACI,0BADJ,eACI,6BADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,yBADJ,eACI,+BADJ,eACI,2BADJ,eACI,0BADJ,eACI,8BADJ,eACI,kCADJ,eACI,mCADJ,eACI,sBADJ,eACI,0BADJ,eACI,6BADJ,eACI,oBADJ,eACI,uBADJ,eACI,kBADJ,eACI,qBADJ,eACI,iBADJ,eACI,mBADJ,eACI,sBADJ,eACI,yBADJ,eACI,kCADJ,eACI,6BADJ,eACI,8BADJ,eACI,8BADJ,eACI,kBADJ,eACI,uBADJ,eACI,4BADJ,eACI,2BADJ,eACI,yBADJ,eACI,yBADJ,eACI,wBADJ,eACI,4BADJ,eACI,mBADJ,eACI,kBADJ,eACI,0BADJ,eACI,uBADJ,eACI,2BADJ,eACI,iBADJ,eACI,qBADJ,eACI,uBADJ,eACI,qBADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,2BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,8BADJ,eACI,4BADJ,eACI,oCADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,sBADJ,eACI,4BADJ,eACI,2BADJ,eACI,6BADJ,eACI,6BADJ,eACI,4BADJ,eACI,6BADJ,eACI,sBADJ,eACI,8BADJ,eACI,8BADJ,eACI,8BADJ,eACI,oBADJ,eACI,2BADJ,eACI,0BADJ,eACI,4BADJ,eACI,4BADJ,eACI,0BADJ,eACI,4BADJ,eACI,mBADJ,eACI,uBADJ,eACI,6BADJ,eACI,yBADJ,eACI,2BADJ,eACI,qBADJ,eACI,6BADJ,eACI,wBADJ,eACI,qBADJ,eACI,qBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,sBADJ,eACI,sBADJ,eACI,sBADJ,eACI,qBADJ,eACI,qBADJ,eACI,qBADJ,eACI,2BADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,6BADJ,eACI,qBADJ,eACI,kBADJ,eACI,wBADJ,eACI,oBADJ,eACI,4BADJ,eACI,sBADJ,eACI,0BADJ,eACI,iBADJ,eACI,iBADJ,eACI,4BADJ,eACI,gCADJ,eACI,oBADJ,eACI,mBADJ,eACI,oBADJ,eACI,oBADJ,eACI,kBADJ,eACI,yBADJ,eACI,uBADJ,eACI,4BADJ,eACI,6BADJ,eACI,oCADJ,eACI,2BADJ,eACI,kCADJ,eACI,oBADJ,eACI,sBADJ,eACI,8BADJ,eACI,kBADJ,eACI,6BADJ,eACI,2BADJ,eACI,qBADJ,eACI,yBADJ,eACI,sBADJ,eACI,0BADJ,eACI,mBADJ,eACI,qBADJ,eACI,oBADJ,eACI,kBADJ,eACI,sBADJ,eACI,yBADJ,eACI,mBADJ,eACI,uBADJ,eACI,2BADJ,eACI,uBADJ,eACI,kBADJ,eACI,mBADJ,eACI,sBADJ,eACI,+BADJ,eACI,4BADJ,eACI,sBADJ,eACI,mBADJ,eACI,yBADJ,eACI,wBADJ,eACI,gCADJ,eACI,2BADJ,eACI,0BADJ,eACI,2BADJ,eACI,kBADJ,eACI,sBADJ,eACI,2BADJ,eACI,2BADJ,eACI,4BADJ,eACI,8BADJ,eACI,4BADJ,eACI,8BADJ,eACI,2BADJ,eACI,0BADJ,eACI,6BADJ,eACI,oBADJ,eACI,4BADJ,eACI,mBADJ,eACI,uBADJ,eACI,oBADJ,eACI,4BADJ,eACI,uBADJ,eACI,sBADJ,eACI,sBADJ,eACI,4BADJ,eACI,gCADJ,eACI,kBADJ,eACI,wBADJ,eACI,wBADJ,eACI,sBADJ,eACI,yBADJ,eACI,yBADJ,eACI,oBADJ,eACI,iBADJ,eACI,qBADJ,eACI,6BADJ,eACI,yBADJ,eACI,sBADJ,eACI,8BADJ,eACI,0BADJ,eACI,kCADJ,eACI,wBADJ,eACI,gCADJ,eACI,kBADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,gCADJ,eACI,qBADJ,eACI,iBADJ,eACI,qBADJ,eACI,0BADJ,eACI,kCADJ,eACI,iBADJ,eACI,qBADJ,eACI,mBADJ,eACI,kBADJ,eACI,0BADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,0BADJ,eACI,4BADJ,eACI,2BADJ,eACI,+BADJ,eACI,wBADJ,eACI,4BADJ,eACI,yBADJ,eACI,uBADJ,eACI,yBADJ,eACI,wBADJ,eACI,yBADJ,eACI,uBADJ,eACI,2BADJ,eACI,wBADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,0BADJ,eACI,uBADJ,eACI,6BADJ,eACI,iCADJ,eACI,mCADJ,eACI,2BADJ,eACI,0BADJ,eACI,uBADJ,eACI,uBADJ,eACI,wBADJ,eACI,uBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,uBADJ,eACI,2BADJ,eACI,oBADJ,eACI,4BADJ,eACI,2BADJ,eACI,mCADJ,eACI,4BADJ,eACI,qBADJ,eACI,0BADJ,eACI,yBADJ,eACI,kBADJ,eACI,wBADJ,eACI,qBADJ,eACI,kBADJ,eACI,kBADJ,eACI,4BADJ,eACI,0BADJ,eACI,2BADJ,eACI,0BADJ,eACI,kCADJ,eACI,mBADJ,eACI,wBADJ,eACI,0BADJ,eACI,uBADJ,eACI,2BADJ,eACI,2BADJ,eACI,wBADJ,eACI,4BADJ,eACI,mBADJ,eACI,yBADJ,eACI,iCADJ,eACI,2BADJ,eACI,oBADJ,eACI,0BADJ,eACI,2BADJ,eACI,wBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,4BADJ,eACI,6BADJ,eACI,iCADJ,eACI,0BADJ,eACI,wBADJ,eACI,gCADJ,eACI,yBADJ,eACI,8BADJ,eACI,yBADJ,eACI,6BADJ,eACI,mCADJ,eACI,qCADJ,eACI,4BADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,2BADJ,eACI,yBADJ,eACI,2BADJ,eACI,0BADJ,eACI,kBADJ,eACI,wBADJ,eACI,4BADJ,eACI,6BADJ,eACI,sBADJ,eACI,0BADJ,eACI,sBADJ,eACI,iCADJ,eACI,6BADJ,eACI,sBADJ,eACI,iCADJ,eACI,iCADJ,eACI,kCADJ,eACI,+BADJ,eACI,iCADJ,eACI,gCADJ,eACI,8BADJ,eACI,oCADJ,eACI,yBADJ,eACI,0BADJ,eACI,+BADJ,eACI,+BADJ,eACI,iCADJ,eACI,+BADJ,eACI,+BADJ,eACI,gCADJ,eACI,yBADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,oCADJ,eACI,iCADJ,eACI,oCADJ,eACI,iCADJ,eACI,4CADJ,eACI,0CADJ,eACI,2CADJ,eACI,oCADJ,eACI,oCADJ,eACI,2BADJ,eACI,iCADJ,eACI,+BADJ,eACI,gCADJ,eACI,kCADJ,eACI,uCADJ,eACI,gCADJ,eACI,iCADJ,eACI,+BADJ,eACI,0BADJ,eACI,8BADJ,eACI,4BADJ,eACI,gCADJ,eACI,+BADJ,eACI,8BADJ,eACI,4BADJ,eACI,yBADJ,eACI,kCADJ,eACI,0CADJ,eACI,8BADJ,eACI,gCADJ,eACI,yBADJ,eACI,yCADJ,eACI,yCADJ,eACI,0BADJ,eACI,8BADJ,eACI,0CADJ,eACI,0CADJ,eACI,uCADJ,eACI,gCADJ,eACI,gCADJ,eACI,+BADJ,eACI,oCADJ,eACI,mBADJ,eACI,2BADJ,eACI,qBADJ,eACI,wBADJ,eACI,oBADJ,eACI,2BADJ,eACI,kCADJ,eACI,+BADJ,eACI,kBADJ,eACI,wBADJ,eACI,6BADJ,eACI,sBADJ,eACI,8BADJ,eACI,qBADJ,eACI,6BADJ,eACI,oBADJ,eACI,0BADJ,eACI,yBADJ,eACI,0BADJ,eACI,yBADJ,eACI,kBADJ,eACI,mBADJ,eACI,yBADJ,eACI,wBADJ,eACI,uBADJ,eACI,mBADJ,eACI,2BADJ,eACI,yBADJ,eACI,gCADJ,eACI,gCADJ,eACI,qBADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,iCADJ,eACI,8BADJ,eACI,yBADJ,eACI,oCADJ,eACI,6BADJ,eACI,mBADJ,eACI,kBADJ,eACI,iBADJ,eACI,wBADJ,eACI,2BADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,uBADJ,eACI,0BADJ,eACI,yBADJ,eACI,wBADJ,eACI,uBADJ,eACI,qBADJ,eACI,mBADJ,eACI,mBADJ,eACI,kBADJ,eACI,qBADJ,eACI,oBADJ,eACI,8BADJ,eACI,8BADJ,eACI,8BADJ,eACI,2BADJ,eACI,4BADJ,eACI,wCADJ,eACI,qCADJ,eACI,kCADJ,eACI,+BADJ,eACI,mCADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,yBADJ,eACI,yBADJ,eACI,yBADJ,eACI,2BADJ,eACI,0BADJ,eACI,2BADJ,eACI,iCADJ,eACI,yBADJ,eACI,yBADJ,eACI,6BADJ,eACI,8BADJ,eACI,2BADJ,eACI,iBADJ,eACI,sBADJ,eACI,qBADJ,eACI,2BADJ,eACI,kBADJ,eACI,wBADJ,eACI,sBADJ,eACI,mBADJ,eACI,6BADJ,eACI,6BADJ,eACI,yBADJ,eACI,iCADJ,eACI,6BADJ,eACI,wBADJ,eACI,uBADJ,eACI,iCADJ,eACI,oBADJ,eACI,sBADJ,eACI,sBADJ,eACI,wBADJ,eACI,4BADJ,eACI,4BADJ,eACI,iCADJ,eACI,qBADJ,eACI,0BADJ,eACI,yBADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,wBADJ,eACI,6BADJ,eACI,gCADJ,eACI,uBADJ,eACI,2BADJ,eACI,yBADJ,eACI,kBADJ,eACI,sBADJ,eACI,yBADJ,eACI,iCADJ,eACI,0BADJ,eACI,qBADJ,eACI,8BADJ,eACI,6BADJ,eACI,6BADJ,eACI,iCADJ,eACI,qBADJ,eACI,qBADJ,eACI,yBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,0BADJ,eACI,wBADJ,eACI,4BADJ,eACI,6BADJ,eACI,yBADJ,eACI,+BADJ,eACI,wBADJ,eACI,6BADJ,eACI,yBADJ,eACI,0BADJ,eACI,0BADJ,eACI,kBADJ,eACI,sBADJ,eACI,kBADJ,eACI,sBADJ,eACI,+BADJ,eACI,6BADJ,eACI,qBADJ,eACI,mBADJ,eACI,mBADJ,eACI,uBADJ,eACI,kBADJ,eACI,mBADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,6BADJ,eACI,2BADJ,eACI,wBADJ,eACI,+BADJ,eACI,4BADJ,eACI,2BADJ,eACI,uBADJ,eACI,mBADJ,eACI,yBADJ,eACI,wBADJ,eACI,8BADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,sCADJ,eACI,uCADJ,eACI,4CADJ,eACI,gCADJ,eACI,iCADJ,eACI,8BADJ,eACI,+BADJ,eACI,qCADJ,eACI,kCADJ,eACI,4BADJ,eACI,uBADJ,eACI,wBADJ,eACI,oBADJ,eACI,mBADJ,eACI,8BADJ,eACI,4BADJ,eACI,4BADJ,eACI,uBADJ,eACI,sBADJ,eACI,yBADJ,eACI,iCADJ,eACI,iCADJ,eACI,uBADJ,eACI,wBADJ,eACI,+BADJ,eACI,2BADJ,eACI,oBADJ,eACI,qBADJ,eACI,kBADJ,eACI,oBADJ,eACI,sBADJ,eACI,kBADJ,eACI,oBADJ,eACI,iBADJ,eACI,oBADJ,eACI,iBADJ,eACI,wBADJ,eACI,uBADJ,eACI,sBADJ,eACI,wBADJ,eACI,yBADJ,eACI,sBADJ,eACI,gCADJ,eACI,2BADJ,eACI,4BADJ,eACI,0BADJ,eACI,6BADJ,eACI,0BADJ,eACI,8BADJ,eACI,yBADJ,eACI,kBADJ,eACI,mBADJ,eACI,2BADJ,eACI,qBADJ,eACI,oBADJ,eACI,kBADJ,eACI,iBADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,wBADJ,eACI,0BADJ,eACI,6BADJ,eACI,2BADJ,eACI,yBADJ,eACI,4BADJ,eACI,iCADJ,eACI,0BADJ,eACI,0BADJ,eACI,6BADJ,eACI,kCADJ,eACI,wBADJ,eACI,4BADJ,eACI,iCADJ,eACI,oBADJ,eACI,+BADJ,eACI,wBADJ,eACI,wBADJ,eACI,4BADJ,eACI,oBADJ,eACI,sBADJ,eACI,oBADJ,eACI,uBADJ,eACI,oBADJ,eACI,wBADJ,eACI,yBADJ,eACI,kBADJ,eACI,qBADJ,eACI,oBADJ,eACI,yBADJ,eACI,uBADJ,eACI,6BADJ,eACI,4BADJ,eACI,iCADJ,eACI,qBADJ,eACI,2BADJ,eACI,2BADJ,eACI,0BADJ,eACI,sBADJ,eACI,uBADJ,eACI,0BADJ,eACI,kCADJ,eACI,+BADJ,eACI,kBADJ,eACI,sBADJ,eACI,0BADJ,eACI,8BADJ,eACI,sBADJ,eACI,0BADJ,eACI,mBADJ,eACI,qBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,0BADJ,eACI,uBADJ,eACI,wBADJ,eACI,wBADJ,eACI,oBADJ,eACI,6BADJ,eACI,mBADJ,eACI,2BADJ,eACI,oBADJ,eACI,4BADJ,eACI,mBADJ,eACI,kBADJ,eACI,mBADJ,eACI,kBADJ,eACI,oBADJ,eACI,uBADJ,eACI,qBADJ,eACI,2BADJ,eACI,mCADJ,eACI,0BADJ,eACI,kCADJ,eACI,qBADJ,eACI,qBADJ,eACI,iBADJ,eACI,wBADJ,eACI,+BADJ,eACI,8BADJ,eACI,iCADJ,eACI,4BADJ,eACI,gCADJ,eACI,6BADJ,eACI,+BADJ,eACI,oBADJ,eACI,sBADJ,eACI,oBADJ,eACI,0BADJ,eACI,yBADJ,eACI,0BADJ,eACI,oBADJ,eACI,oBADJ,eACI,yBADJ,eACI,oBADJ,eACI,oBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,uBADJ,eACI,wBADJ,eACI,qBADJ,eACI,6BADJ,eACI,qBADJ,eACI,2BADJ,eACI,8BADJ,eACI,kCADJ,eACI,0BADJ,eACI,2BADJ,eACI,6BADJ,eACI,0BADJ,eACI,gCADJ,eACI,2BADJ,eACI,gCADJ,eACI,8BADJ,eACI,sCADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,oBADJ,eACI,uBADJ,eACI,4BADJ,eACI,sBADJ,eACI,wBADJ,eACI,8BADJ,eACI,4BADJ,eACI,gCADJ,eACI,6BADJ,eACI,iCADJ,eACI,gCADJ,eACI,oCADJ,eACI,wBADJ,eACI,uBADJ,eACI,uBADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,sBADJ,eACI,2BADJ,eACI,mBADJ,eACI,qBADJ,eACI,8BADJ,eACI,kBADJ,eACI,uBADJ,eACI,mBADJ,eACI,uBADJ,eACI,2BADJ,eACI,+BADJ,eACI,yBADJ,eACI,iCADJ,eACI,mBADJ,eACI,wBADJ,eACI,4BADJ,eACI,gCADJ,eACI,sBADJ,eACI,8BADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,wBADJ,eACI,kCADJ,eACI,sCADJ,eACI,+BADJ,eACI,6BADJ,eACI,4BADJ,eACI,gCADJ,eACI,kCADJ,eACI,8BADJ,eACI,uBADJ,eACI,0BADJ,eACI,oBADJ,eACI,2BADJ,eACI,wBADJ,eACI,qBADJ,eACI,oBADJ,eACI,0BADJ,eACI,6BADJ,eACI,qBADJ,eACI,qBADJ,eACI,qBADJ,eACI,uBADJ,eACI,iBADJ,eACI,qBADJ,eACI,yBADJ,eACI,mBADJ,eACI,6BADJ,eACI,oBADJ,eACI,kBADJ,eACI,2BADJ,eACI,mCADJ,eACI,0BADJ,eACI,uBADJ,eACI,+BADJ,eACI,uBADJ,eACI,sBADJ,eACI,oCADJ,eACI,iBADJ,eACI,kBADJ,eACI,kBADJ,eACI,qBADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,gCADJ,eACI,iDADJ,eACI,wCADJ,eACI,iBADJ,eACI,uBADJ,eACI,iBADJ,eACI,qBADJ,eACI,6BADJ,eACI,sBADJ,eACI,8BADJ,eACI,2BADJ,eACI,oBADJ,eACI,iBADJ,eACI,6BADJ,eACI,mBADJ,eACI,sBADJ,eACI,qBADJ,eACI,yBADJ,eACI,qBADJ,eACI,yBADJ,eACI,yBADJ,eACI,oBADJ,eACI,mBADJ,eACI,mBADJ,eACI,sBADJ,eACI,8BADJ,eACI,iBADJ,eACI,qBADJ,eACI,0BADJ,eACI,wBADJ,eACI,6BADJ,eACI,oCADJ,eACI,wBADJ,eACI,uBADJ,eACI,8BADJ,eACI,gCADJ,eACI,gCADJ,eACI,sCADJ,eACI,uCADJ,eACI,qBADJ,eACI,8BADJ,eACI,4BADJ,eACI,mBADJ,eACI,qBADJ,eACI,sBADJ,eACI,8BADJ,eACI,iCADJ,eACI,+BADJ,eACI,iCADJ,eACI,gCADJ,eACI,uBADJ,eACI,qBADJ,eACI,sBADJ,eACI,qBADJ,eACI,mBADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,mCADJ,eACI,iBADJ,eACI,qBADJ,eACI,oBADJ,eACI,mBADJ,eACI,iBADJ,eACI,oBADJ,eACI,wBADJ,eACI,gCADJ,eACI,2BADJ,eACI,mCADJ,eACI,yBADJ,eACI,wBADJ,eACI,sBADJ,eACI,8BADJ,eACI,qBADJ,eACI,4BADJ,eACI,gCADJ,eACI,uBADJ,eACI,sBADJ,eACI,mBADJ,eACI,6BADJ,eACI,2BADJ,eACI,2BADJ,eACI,0BADJ,eACI,2BADJ,eACI,4BADJ,eACI,0BADJ,eACI,uBADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,0BADJ,eACI,wBADJ,eACI,0BADJ,eACI,oCADJ,eACI,mCADJ,eACI,4BADJ,eACI,wBADJ,eACI,gBADJ,eACI,oBADJ,eACI,mBADJ,eACI,qBADJ,eACI,kBADJ,eACI,wBADJ,eACI,iBADJ,eACI,kBADJ,eACI,oBADJ,eACI,iBADJ,eACI,qBADJ,eACI,uBADJ,eACI,2BADJ,eACI,uBADJ,eACI,2BADJ,eACI,kBADJ,eACI,+BADJ,eACI,uBADJ,eACI,oBADJ,eACI,oBADJ,eACI,mBADJ,eACI,0BADJ,eACI,kBADJ,eACI,8BADJ,eACI,yBADJ,eACI,iCADJ,eACI,0BADJ,eACI,wBADJ,eACI,oCADJ,eACI,4BADJ,eACI,4BADJ,eACI,2BADJ,eACI,2BADJ,eACI,6BADJ,eACI,yBADJ,eACI,kBADJ,eACI,kBADJ,eACI,sBADJ,eACI,8BADJ,eACI,yBADJ,eACI,0CADJ,eACI,iCADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,oBADJ,eACI,sBADJ,eACI,wBADJ,eACI,sBADJ,eACI,kBADJ,eACI,sBADJ,eACI,qBADJ,eACI,kBADJ,eACI,qBADJ,eACI,iBADJ,eACI,qBADJ,eACI,mBADJ,eACI,uBADJ,eACI,mBADJ,eACI,wBADJ,eACI,4BADJ,eACI,4BADJ,eACI,0BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,0BADJ,eACI,0BADJ,eACI,+BADJ,eACI,qBADJ,eACI,wBADJ,eACI,2BADJ,eACI,8BADJ,eACI,2BADJ,eACI,0BADJ,eACI,kCADJ,eACI,uBADJ,eACI,8BADJ,eACI,qBADJ,eACI,mBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,yBADJ,eACI,yBADJ,eACI,wBADJ,eACI,0BADJ,eACI,uBADJ,eACI,mBADJ,eACI,sBADJ,eACI,mBADJ,eACI,4BADJ,eACI,yBADJ,eACI,yBADJ,eACI,4BADJ,eACI,6BADJ,eACI,yBADJ,eACI,qBADJ,eACI,2BADJ,eACI,uBADJ,eACI,6BADJ,eACI,2BADJ,eACI,wBADJ,eACI,mBADJ,eACI,kBADJ,eACI,qBADJ,eACI,oBADJ,eACI,wBADJ,eACI,qBADJ,eACI,oBADJ,eACI,kBADJ,eACI,0BADJ,eACI,qBADJ,eACI,mBADJ,eACI,4BADJ,eACI,oBADJ,eACI,sBADJ,eACI,oBADJ,eACI,4BADJ,eACI,wBADJ,eACI,gCADJ,eACI,8BADJ,eACI,oBADJ,eACI,wBADJ,eACI,yBADJ,eACI,oBADJ,eACI,mBADJ,eACI,uBADJ,eACI,0BADJ,eACI,iCADJ,eACI,wBADJ,eACI,qBADJ,eACI,qBADJ,eACI,oBADJ,eACI,4BADJ,eACI,qBADJ,eACI,6BADJ,eACI,oBADJ,eACI,kBADJ,eACI,kBADJ,eACI,kBADJ,eACI,0BADJ,eACI,mBADJ,eACI,oBADJ,eACI,0BADJ,eACI,oBADJ,eACI,uBADJ,eACI,yBADJ,eACI,iCADJ,eACI,0BADJ,eACI,kCADJ,eACI,4BADJ,eACI,6BADJ,eACI,oBADJ,eACI,oBADJ,eACI,iBADJ,eACI,qBADJ,eACI,mBADJ,eACI,iBADJ,eACI,sBADJ,eACI,kBADJ,eACI,wBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,qBADJ,eACI,uBADJ,eACI,mBADJ,eACI,2BADJ,eACI,4BADJ,eACI,qBADJ,eACI,oBADJ,eACI,6BADJ,eACI,kCADJ,eACI,yBADJ,eACI,oBADJ,eACI,gBADJ,eACI,kBADJ,eACI,wBADJ,eACI,uBADJ,eACI,8BADJ,eACI,mCADJ,eACI,gCADJ,eACI,iCADJ,eACI,kCADJ,eACI,gCADJ,eACI,iCADJ,eACI,sBADJ,eACI,8BADJ,eACI,2BADJ,eACI,8BADJ,eACI,oBADJ,eACI,wBADJ,eACI,4BADJ,eACI,wBADJ,eACI,uBADJ,eACI,2BADJ,eACI,kBADJ,eACI,yBADJ,eACI,yBADJ,eACI,oBADJ,eACI,0BADJ,eACI,4BADJ,eACI,gCADJ,eACI,wBADJ,eACI,yBADJ,eACI,2BADJ,eACI,6BADJ,eACI,qBADJ,eACI,wBADJ,eACI,8BADJ,eACI,sBADJ,eACI,6BADJ,eACI,4BADJ,eACI,sBADJ,eACI,uBADJ,eACI,sBADJ,eACI,0BADJ,eACI,8BADJ,eACI,mBADJ,eACI,+BADJ,eACI,2BADJ,eACI,wBADJ,eACI,gCADJ,eACI,kCADJ,eACI,+BADJ,eACI,mBADJ,eACI,2BADJ,eACI,oBADJ,eACI,8BADJ,eACI,4BADJ,eACI,wBADJ,eACI,sBADJ,eACI,4BADJ,eACI,oBADJ,eACI,wBADJ,eACI,sBADJ,eACI,qBADJ,eACI,8BADJ,eACI,6BADJ,eACI,mBADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,uBADJ,eACI,oBADJ,eACI,uBADJ,eACI,uBADJ,eACI,uBADJ,eACI,+BADJ,eACI,+BADJ,eACI,+BADJ,eACI,qCADJ,eACI,yBADJ,eACI,8BADJ,eACI,wBADJ,eACI,4BADJ,eACI,wBADJ,eACI,6BADJ,eACI,8BADJ,eACI,gCADJ,eACI,iBADJ,eACI,uBADJ,eACI,qBADJ,eACI,qBADJ,eACI,2BADJ,eACI,0BADJ,eACI,uBADJ,eACI,8BADJ,eACI,sCADJ,eACI,2BADJ,eACI,kCADJ,eACI,0CADJ,eACI,mBADJ,eACI,mBADJ,eACI,4BADJ,eACI,mBADJ,eACI,mBADJ,eACI,uBADJ,eACI,qBADJ,eACI,yBADJ,eACI,sBADJ,eACI,uBADJ,eACI,qBADJ,eACI,oBADJ,eACI,0BADJ,eACI,kBADJ,eACI,mBADJ,eACI,kBADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,0BADJ,eACI,0BADJ,eACI,wBADJ,eACI,2BADJ,eACI,2BADJ,eACI,+BADJ,eACI,qCADJ,eACI,iCADJ,eACI,sCADJ,eACI,iCADJ,eACI,4CADJ,eACI,yBADJ,eACI,0BADJ,eACI,yBADJ,eACI,uBADJ,eACI,qBADJ,eACI,yBADJ,eACI,8BADJ,eACI,yBADJ,eACI,wBADJ,eACI,qBADJ,eACI,uBADJ,eACI,4BADJ,eACI,mBADJ,eACI,oBADJ,eACI,wBADJ,eACI,6BADJ,eACI,4BADJ,eACI,yBADJ,eACI,iBADJ,eACI,4BADJ,eACI,2BADJ,eACI,qBADJ,eACI,oBADJ,eACI,iCADJ,eACI,kBADJ,eACI,yBADJ,eACI,uBADJ,eACI,sBADJ,eACI,0BADJ,eACI,mBADJ,eACI,sBADJ,eACI,2BADJ,eACI,6BADJ,eACI,0BADJ,eACI,4BADJ,eACI,yBADJ,eACI,qBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,yBADJ,eACI,iCADJ,eACI,mBADJ,eACI,2BADJ,eACI,mBADJ,eACI,qCADJ,eACI,sCADJ,eACI,oBADJ,eACI,4BADJ,eACI,oBADJ,eACI,wBADJ,eACI,4BADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,iBADJ,eACI,6BADJ,eACI,qCADJ,eACI,2BADJ,eACI,mCADJ,eACI,kBADJ,eACI,oBADJ,eACI,mBADJ,eACI,yBADJ,eACI,kBADJ,eACI,wBADJ,eACI,sBADJ,eACI,iBADJ,eACI,sBADJ,eACI,4BADJ,eACI,mBADJ,eACI,0BADJ,eACI,qCADJ,eACI,sCADJ,eACI,iCADJ,eACI,gCADJ,eACI,wBADJ,eACI,yBADJ,eACI,+BADJ,eACI,uBADJ,eACI,8BADJ,eACI,kCADJ,eACI,mCADJ,eACI,8BADJ,eACI,4BADJ,eACI,oBADJ,eACI,4BADJ,eACI,yBADJ,eACI,kBADJ,eACI,iBADJ,eACI,uBADJ,eACI,uBADJ,eACI,0BADJ,eACI,yBADJ,eACI,sBADJ,eACI,wBADJ,eACI,8BADJ,eACI,oBADJ,eACI,kBADJ,eACI,mBADJ,eACI,wBADJ,eACI,sBADJ,eACI,wBADJ,eACI,4BADJ,eACI,gCADJ,eACI,oCADJ,eACI,8BADJ,eACI,4BADJ,eACI,iCADJ,eACI,oCADJ,eACI,gCADJ,eACI,oBADJ,eACI,kBADJ,eACI,qBADJ,eACI,uBADJ,eACI,yBADJ,eACI,4BADJ,eACI,gCADJ,eACI,qBADJ,eACI,8BADJ,eACI,qBADJ,eACI,qBADJ,eACI,8BADJ,eACI,yBADJ,eACI,+BADJ,eACI,4BADJ,eACI,4BADJ,eACI,oCADJ,eACI,wBADJ,eACI,gCADJ,eACI,sBADJ,eACI,8BADJ,eACI,4BADJ,eACI,oBADJ,eACI,4BADJ,eACI,iCADJ,eACI,4BADJ,eACI,iBADJ,eACI,mBADJ,eACI,uBADJ,eACI,mBADJ,eACI,sBADJ,eACI,qBADJ,eACI,uBADJ,eACI,wBADJ,eACI,8BADJ,eACI,6BADJ,eACI,uBADJ,eACI,2BADJ,eACI,+BADJ,eACI,qBADJ,eACI,0BADJ,eACI,2BADJ,eACI,6BADJ,eACI,kCADJ,eACI,0BADJ,eACI,mBADJ,eACI,2BADJ,eACI,iBADJ,eACI,yBADJ,eACI,wBADJ,eACI,oBADJ,eACI,sBADJ,eACI,qBADJ,eACI,2BADJ,eACI,mBADJ,eACI,2BADJ,eACI,kBADJ,eACI,wBADJ,eACI,8BADJ,eACI,sBADJ,eACI,8BADJ,eACI,uBADJ,eACI,4BADJ,eACI,kBADJ,eACI,oBADJ,eACI,2BADJ,eACI,8BADJ,eACI,yBADJ,eACI,sBADJ,eACI,8BADJ,eACI,oBADJ,eACI,0BADJ,eACI,4BADJ,eACI,4BADJ,eACI,oCADJ,eACI,mBADJ,eACI,4BADJ,eACI,wBADJ,eACI,2BADJ,eACI,yBADJ,eACI,sBADJ,eACI,oBADJ,eACI,2BADJ,eACI,kBADJ,eACI,2BADJ,eACI,oBADJ,eACI,qBADJ,eACI,yBADJ,eACI,4BADJ,eACI,6BADJ,eACI,kBADJ,eACI,oBADJ,eACI,mCADJ,eACI,qBADJ,eACI,sBADJ,eACI,8BADJ,eACI,kBADJ,eACI,0BADJ,eACI,oCADJ,eACI,kCADJ,eACI,oCADJ,eACI,kCADJ,eACI,qBADJ,eACI,mBADJ,eACI,qBADJ,eACI,oBADJ,eACI,oBADJ,eACI,6BADJ,eACI,4BADJ,eACI,iBADJ,eACI,2BADJ,eACI,yBADJ,eACI,oBADJ,eACI,kCADJ,eACI,kCADJ,eACI,2BADJ,eACI,mCADJ,eACI,4BADJ,eACI,0BADJ,eACI,+BADJ,eACI,kCADJ,eACI,kCADJ,eACI,4BADJ,eACI,iCADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,6BADJ,eACI,2BADJ,eACI,8BADJ,eACI,8BADJ,eACI,2BADJ,eACI,6BADJ,eACI,0BADJ,eACI,mBADJ,eACI,sBADJ,eACI,qBADJ,eACI,mBADJ,eACI,sBADJ,eACI,0BADJ,eACI,iCADJ,eACI,mCADJ,eACI,8BADJ,eACI,gCADJ,eACI,uBADJ,eACI,0BADJ,eACI,yBADJ,eACI,wBADJ,eACI,2BADJ,eACI,yBADJ,eACI,4BADJ,eACI,oCADJ,eACI,sBADJ,eACI,uBADJ,eACI,2BADJ,eACI,uBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,6BADJ,eACI,yBADJ,eACI,uBADJ,eACI,mBADJ,eACI,oBADJ,eACI,6BADJ,eACI,0BADJ,eACI,gBADJ,eACI,oBADJ,eACI,uBADJ,eACI,iBADJ,eACI,mBADJ,eACI,uBADJ,eACI,yBADJ,eACI,wBADJ,eACI,2BADJ,eACI,0BADJ,eACI,yBADJ,eACI,wBADJ,eACI,yBADJ,eACI,iBADJ,eACI,mBADJ,eACI,kBADJ,eACI,kBADJ,eACI,oBADJ,eACI,6BADJ,eACI,+BADJ,eACI,2BADJ,eACI,iBADJ,eACI,6BADJ,eACI,mBADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,2BADJ,eACI,mBADJ,eACI,uBADJ,eACI,2BADJ,eACI,wBADJ,eACI,uBADJ,eACI,mBADJ,eACI,4BADJ,eACI,yBADJ,eACI,0BADJ,eACI,+BADJ,eACI,+BADJ,eACI,qCADJ,eACI,2BADJ,eACI,kCADJ,eACI,6BADJ,eACI,2BADJ,eACI,2BADJ,eACI,iCADJ,eACI,2BADJ,eACI,4BADJ,eACI,iCADJ,eACI,+BADJ,eACI,2BADJ,eACI,mCADJ,eACI,iBADJ,eACI,oBADJ,eACI,qBADJ,eACI,qBADJ,eACI,oBADJ,eACI,oBADJ,eACI,6BADJ,eACI,sBADJ,eACI,sCADJ,eACI,gCADJ,eACI,wCADJ,eACI,sCADJ,eACI,iCADJ,eACI,qBADJ,eACI,kBADJ,eACI,sBADJ,eACI,iBADJ,eACI,kBADJ,eACI,uBADJ,eACI,0BADJ,eACI,2BADJ,eACI,6BADJ,eACI,6BADJ,eACI,yBADJ,eACI,4BADJ,eACI,qBADJ,eACI,uBADJ,eACI,oBADJ,eACI,kBADJ,eACI,oBADJ,eACI,wBADJ,eACI,qBADJ,eACI,6BADJ,eACI,kBADJ,eACI,kBADJ,eACI,6BADJ,eACI,2CADJ,eACI,2CADJ,eACI,0CADJ,eACI,yCADJ,eACI,4CADJ,eACI,6CADJ,eACI,iCADJ,eACI,iBADJ,eACI,kBADJ,eACI,sBADJ,eACI,yBADJ,eACI,iBADJ,eACI,kBADJ,eACI,oBADJ,eACI,mBADJ,eACI,kBADJ,eACI,sBADJ,eACI,oCADJ,eACI,4BADJ,eACI,0BADJ,eACI,wBADJ,eACI,qBADJ,eACI,mBAIR,WACI,kBACA,wCCLI,cAEI,wCAFJ,cAEI,wCAFJ,cAEI,wCAFJ,cAEI,kBAMR,qBACI,+BAEJ,qBACI,mBAIJ,UACI,gCAEJ,0BACI,uBAOA,+BACI,4BACA,wBACA,uBAHJ,+BACI,4BACA,wBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,oBAoBZ,4BACI,qBACA,aACA,mBACA,oBAEJ,4BACI,qBACA,aACA,mBACA,kBC9DJ,6CACI,sCACQ,6BAGZ,GACI,8BACE,uBACQ,MAEV,gCACE,yBACQ,sBAId,GACI,8BACE,uBACQ,MAEV,gCACE,yBACQ;;;;;ECxBd,CAmkBA,UACE,YACA,kBAGF,KACE,SACA,UAGF,sBACE,aAEF,OACE,aAGF,iCAEE,mBACA,yBACA,gBACA,YACA,UACA,SAGF,6BAIE,wBAIF,oEAIE,eACA,0BAEA,4GACE,eAIJ,SACE,mBACA,cAIA,mBACE,6BACA,uBACA,+BAEA,+FAEE,wBAGJ,uBACE,iBAIJ,oBACE,SACA,mBACA,WACA,YACA,gBACA,UACA,kBACA,oBACA,UAGF,WACE,kBACA,MACA,OACA,SACA,QACA,sBACA,oBAGF,sBA7bE,uCAgcF,sBA5bE,sCAgcF,8BACE,wDAOF,qBACE,oBACA,kBACA,gBACA,OACA,MACA,WACA,YACA,qDAGF,WAEE,kBACA,yCACA,yBACA,UACA,kBACA,4BACE,sRAOF,4BACE,yCAEF,mFACE,WAEF,4BACE,gEAKJ,4BACE,eACA,gBAGF,YACE,YAGF,WACE,WAGF,gBACE,kBACA,6BACA,MACA,QACA,SACA,OACA,UA5oBoB,CA8oBpB,oCACE,cACA,kBACA,yBACA,QACA,MACA,SACA,UAppBsB,CAqpBtB,wCAMJ,gBACE,gCAKF,eACE,yBAGF,yBACE,YACE,cAOF,wDACG,mBAIL,aACE,cACA,2BAEF,aACE,cACA,2BApQA,yBA6CE,4IAnQF,gBA5K0B,CA6K1B,gKACE,aAkQ2E,CAjQ3E,iBA/KwB,EAwY1B,+CAuCE,mRAnQF,gBA5K0B,CA6K1B,iTACE,aAkQ2E,CAjQ3E,iBA/KwB,EA+Y1B,gDAgCE,6ZAnQF,gBA5K0B,CA6K1B,qcACE,aAkQ2E,CAjQ3E,iBA/KwB,EAuZ1B,iDAwBE,ikBAnQF,gBA5K0B,CA6K1B,mnBACE,aAkQ2E,CAjQ3E,iBA/KwB,EAga1B,0BAeE,mzBAnQF,gBA5K0B,CA6K1B,+2BACE,aAkQ2E,CAjQ3E,iBA/KwB,EAipB5B,UACE,0CACA,8BAEA,gBAEA,8BACA,0BAEA,mCACA,kCAMF,cACE,eAhyByB,CAiyBzB,gBACA,uBACA,iBAnyByB,CAqyB3B,cACE,cAryByB,CAsyBzB,gBACA,wBACA,gBAxyByB,CA0yB3B,cACE,cA1yByB,CA2yBzB,gBACA,iBAEF,cACE,cA9yByB,CA+yBzB,gBACA,iBAEF,aACE,cAlzByB,CAmzBzB,gBACA,iBAEF,UA/kBE,cAtOyB,CAuOzB,gBACA,sBAglBF,YA9jBE,cAzPyB,CA0PzB,gBACA,qBACA,iBAikBF,WAllBE,cAzOyB,CA0OzB,gBACA,qBACA,iBAklBF,WA9kBE,cAhPyB,CAiPzB,gBACA,qBACA,iBA8kBF,YACE,cAj0ByB,CAk0BzB,qBAEF,WACE,qBAOF,kCAKE,8CAl2BY,CAq2Bd,6BAIE,eA2bF,wBACE,YACA,OACA,kBACA,MACA,WAGF,wBACE,eAGF,qBACE,aAGF,kBACE,aAIF,2BACE,UACA,gBAGF,UACE,UACA,kBAEA,0BAGE,UACA,gBAGF,kCACE,UACA,6CA7tCa,CAguCf,kCACE,UACA,6CA9tCa,CAiuCf,2EAEE,UAGF,6BACE,YACA,eACA,WAGF,2BACE,YACA,kDAGF,2BACE,kDAIJ,sBACE,gBACA,OACA,gBACA,eACA,eACA,MAQF,gBACE,kBACA,cACA,YACA,kBACA,iBACA,gBAEE,gCACE,eAGJ,mCACE,gBACA,uBACA,YAEA,sDACE,iBAEF,wDACE,YAIA,gEACE,cACA,kBACA,QACA,QA/BuB,CAgCvB,UAjCqB,CAkCrB,WAlCqB,CAqCvB,+DAtmCJ,kBAikC2B,CAhkC3B,yEACE,eAsmCgF,CArmChF,iBA8jCyB,CA2C3B,qCAEE,aACA,mBACA,sBAEA,kBACA,iBACA,YACA,qDACE,WAGF,mGAGE,WACA,sBACA,YAGF,wDACE,kBACA,YACA,OAEA,kEACE,YACA,UACA,SACA,WAEF,+EACE,kBACA,MACA,OACA,WACA,WACA,gBAEA,6FACE,gBACA,WAEF,wFACE,+BACA,wGACE,UAGJ,wFACE,+BACA,wGACE,UAMV,qCAvvCA,eAEA,sBACA,YACA,gBACA,aACA,uBAmvCE,WACA,eACA,iBACA,YAnvCF,gDACE,aAovCF,6CACE,kBACA,iBACA,kBACA,UAjHyB,CAkHzB,WAlHyB,CAmHzB,eACA,YACA,kBACA,UACA,eACA,uBACA,gBACA,mDACE,WACA,kBACA,SACA,WACA,YACA,UACA,kBACA,mBACA,UACA,mDAz5CW,CA25Cb,mDACE,aAEA,yDACE,mBACA,UAGJ,qDACE,kBACA,QACA,SACA,gDACA,0DACE,eAGJ,sDACE,mBACA,mCACA,sEACE,mBAGJ,sDACE,mCACA,sEACE,mBAKN,8CAGE,sBACE,sBAEF,kDACE,YAKN,qIAEE,kBACA,qCACA,WA79CgB,CAi+ChB,YAEA,2JACE,iBAIJ,4BACE,sBACA,cACA,SACA,gBACA,gBACA,UAGF,mFAEE,WA7M4B,CAgN9B,6BACE,SACA,gBACA,UAEA,yDACE,eACA,gBACA,eACA,gBAzN0B,CA0N1B,WA1N0B,CA2N1B,kCACA,SACA,mBACA,uBAEA,+DACE,aAGF,oFACE,eAMN,8CACE,6CAEE,uBAOJ,YACE,yBAEA,kBACA,MACA,SACA,OACA,QAEA,UA3hDiB,CA6hDjB,6BACE,0BACA,WAEF,+BACE,WACA,sBAEF,+BACE,WAEF,qCACE,WAEF,gCACE,WAIF,6BACE,kBAGF,sBAEE,YAEA,+BACE,UAEF,yDACE,YAEF,+BACE,YACA,yBAEF,yDACE,UAeN,gBACE,kBACA,OACA,QACA,SACA,2BACA,UA5lDqB,CA8lDrB,qBACA,uBAEA,kCACA,mDArlDe,CAslDf,8BAEA,8BACE,cAGF,yBACE,UACA,kCAGF,gCACE,UACA,cACA,6CAIF,gCACE,6CACA,mDAtmDY,CAymDd,8BACE,6BACA,8CA7sDU,CA8sDV,gBA1CyB,CA2CzB,UACA,mBAGF,+BACE,qBACA,YACA,WACA,UAGF,6BACE,aACA,aAEA,mCACE,eAKF,qCACE,UACA,mBACA,WArE0B,CA4E9B,wBACE,kBACA,mBACA,cAEA,gCACE,aACA,mBACA,eACA,mBACA,mBAGF,qCACE,sBACA,mBACA,mBAEA,YAEA,cA5uDqB,CA6uDrB,iBA7uDqB,CA+vDrB,yBA1BF,qCAaI,wBACA,wBAFQ,CAKN,yDACE,uBAEF,qDACE,sBASN,gDA9BF,qCAaI,aACA,aAFQ,EAsBV,iDAlCF,qCAaI,wBACA,wBAFQ,EA0BV,0BAtCF,qCAaI,wBACA,wBAFQ,EA+BV,6CACE,aAGF,2DACE,aACA,sBACA,mBACA,WACA,oBAGF,2DACE,6BACA,aACA,sBACA,mBACA,WAGF,mDACE,eAtJwB,CAuJxB,iBACA,eACA,SACA,mBACA,WACA,kBACA,oBACA,gBAOR,8CACE,gBACE,uBA+BJ,mCACE,SAGF,WACE,qBACA,kBACA,eA33CA,eAk2CmB,CA6BnB,cA1BiB,CAr2CjB,gBAk2CmB,CAgCnB,sBACA,mBACA,kBAEA,iBA3CqB,CA4CrB,sBAGA,iBACA,aACA,SAGA,aAzCe,CA0Cf,cA5Cc,CA8Cd,uBACA,mBACA,mBAGA,yBACA,gBAx5CA,cAveyB,CAi4DzB,mBACA,qBACA,oBACA,qBAGA,gBAEA,iHAj6CA,mHAEE,eAg2CuB,CAl2CzB,mHAEE,gBAg2CuB,CAl2CzB,mHAEE,cA61CqB,CAqEvB,iBACE,aAGF,kCACE,qBAMF,uCACE,gBAGF,uBACE,gBAGF,mBACE,UACA,gBAIA,qCA7tDF,uCAkuDA,0BACE,aACA,WAt0DiB,CAu0DjB,YACA,gBA/5DQ,CAg6DR,WAz6DuB,CA06DvB,UAz0DgB,CA00DhB,iBA9GuB,CAiHzB,kBAKE,UAn3DU,CAq3DV,gBA1GqB,CA4GrB,YACA,UAp1De,CAq1Df,WAp1DgB,CAq1DhB,sBAxvDF,uCA2vDE,iBAhIuB,CAiIvB,4BACA,gBAEA,mDAr3DY,CAs3DZ,0DAlpDF,sCACE,QASkC,CARlC,UAQwC,CAPxC,WAOqF,CANrF,SAMmI,CALnI,kBALF,qCACE,QAUiC,CATjC,UASuC,CARvC,WAQ6C,CAP7C,SAO2F,CAN3F,kBALF,mCACE,QAW+B,CAV/B,UAU6E,CAT7E,WAS0H,CAR1H,SAQgI,CAPhI,kBALF,kCACE,QAY8B,CAX9B,UAW4E,CAV5E,WAUkF,CATlF,SASwF,CARxF,kBA+oDA,0BACE,gBAvHwB,CAwHxB,UA1HkB,CA2HlB,WA1HmB,CA6HrB,qDACE,gBAGF,4BACE,gBAOA,6FApxDJ,uCAuxDI,qFAnxDJ,sCAyxDA,gCACE,sBACA,4BACA,gBAIA,gCAQF,kEACE,cAKF,6FAEE,mDA96Da,CA+6Db,kCAEE,4RAEE,kCAON,yGAEE,mDA57Da,CA67Db,mCAEE,oTAEE,mCAMR,iBACE,aACA,OACA,WAEA,4BACE,OAEA,cAEA,gBAEA,QAEA,6BACA,gBAEA,kBACA,uBACA,mBAEA,wCACE,8BAEF,uCACE,uBACA,8BAKN,8CACE,uCAEE,uBAOJ,QACE,sBACA,aACA,sBACA,UA5jEyB,CA8jEzB,0GAriEsB,CAuiEtB,uBACE,YAZW,CAaX,aACA,mBAGE,kDA1yDJ,iBA2yDkD,CA1yDlD,4DACE,iBAyyDsD,CAxyDtD,gBAwyDgD,CAK9C,iDAhzDJ,gBAizDmD,CAhzDnD,2DACE,gBA+yDuD,CA9yDvD,iBA8yDiD,CAIjD,sCACE,WACA,YAEA,oGAEE,kBAGF,8CACE,YACA,kDAEE,eACA,cAIJ,0DACE,gBAEA,oEACE,eAKN,2CACE,aACA,OACA,sBAEA,uDACE,eAKN,uEAGE,sBACA,aACA,cACA,WACA,YAGF,sBACE,uBACA,aACA,cACA,mBAEA,sCACE,cAGF,yCACE,OACA,sBACA,aAEA,qDACE,cACA,eAIA,gEACE,iBAKN,0CACE,gBAEA,uDACE,YACA,WAEF,uDACE,aACA,YAEF,uDACE,aACA,YAKN,wBACE,cACA,YA3HW,CA8HT,sCACE,aAGF,qCACE,gBAIJ,qCACE,aACA,YAIJ,wBACE,UAnsEuB,CAusEnB,sEACE,aAEA,oFACE,aAGF,mFACE,gBAIJ,gEACE,eACA,kBAKN,6CACE,OACA,2BACA,aACA,mBAIA,4EACE,aAEA,0FAz8DN,aA08DqD,CAz8DrD,oGACE,gBAw8DsD,CAv8DtD,cAu8DmD,CAG/C,yFA78DN,cA88DqD,CA78DrD,mGACE,iBA48DsD,CA38DtD,aA28DmD,CAIjD,sEACE,gBACA,iBAEA,oFAt9DN,gBAu9DqD,CAt9DrD,8FACE,gBAq9D2E,CAp9D3E,iBAo9DmD,CAG/C,mFA19DN,iBA29DqD,CA19DrD,6FACE,iBAy9D2E,CAx9D3E,gBAw9DmD,CAIjD,4EACE,OACA,yBACA,aACA,mBAKN,uBACE,gBACA,YAjNW,CAqNf,8CACE,QACE,uBAKF,sBACE,WACA,YAwBF,4BACE,eANkB,CAOlB,mBAIJ,YACE,sBACA,qBACA,mBACA,eACA,aACA,iBACA,kBACA,cA/sEe,CAuXf,eAi0DoB,CAh0DpB,qHAEE,eA+zDwB,CA0BxB,4DACE,UACA,SACA,WACA,YAIA,6EACE,iCA7/DN,0BACE,kBACA,QACA,2BAEA,sBACA,qBAEA,UAvOa,CAwOb,WAxOa,CA2Kf,MA8DqB,CA9DrB,UA+DsB,CA9DtB,oCACE,SA4DsB,CA7DxB,oCACE,OA6D0B,CAE1B,iCACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,gCACE,sBACA,WACA,kBACA,UACA,YACA,aACA,WAGF,+CACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKJ,qBACE,sBACA,iBACA,kBACA,MACA,OACA,UAzRa,CA0Rb,WA1Ra,CA2Rb,gBAxRoB,CAyRpB,mBACA,iBA3RqB,CA8RvB,gCACE,yBAEA,sCACE,sBACA,wBACA,kBACA,SACA,QACA,cACA,UACA,YACA,gBAzSkB,CA0SlB,mBACA,aACA,cACA,WAKJ,sBACE,eAIA,4CACE,sBACA,kBACA,QACA,SACA,gCACA,cACA,aACA,UA/TkB,CAgUlB,gBAhUkB,CAiUlB,mBACA,aACA,cACA,WA45DJ,0BAEE,SACA,UACA,WACA,UAlDwB,CAmDxB,gBAGF,sBACE,sBACA,kBACA,qBACA,sBACA,mBACA,iBACA,eA9DuB,CA+DvB,mBAlkEF,gBAwgEqB,CAvgErB,gCACE,aAkkEoE,CAjkEpE,iBAqgEmB,CA8DnB,4BA7kEF,gBA+kE8B,CA/kE9B,cAglE+B,CA/kE/B,sCACE,aA6kEiF,CA9kEnF,sCACE,iBA8kEgC,CAKpC,2CACE,sBACA,kBACA,qBACA,sBACA,mBACA,iBACA,eAGA,UA/lEA,gBAkmE0B,CAlmE1B,cAmmE2B,CAlmE3B,qDACE,aAgmEiE,CAjmEnE,qDACE,iBAimE4B,CAmB5B,oCAtnEF,kBA+mEqB,CA9mErB,8CACE,kBAqnE+C,CAC7C,uDAxnEJ,UAynE0B,CAxnE1B,iEACE,WAunE8B,CAC1B,2DACE,WApBI,CAqBJ,mBAGJ,qDACE,qBACA,WA1BM,CAhmEZ,eA2nEmD,CA1nEnD,+DACE,gBAynE2D,CAxnE3D,gBAwnEiD,CAKrD,uBACE,YACA,2BACE,WA1BmC,CA2BnC,mBACA,cA3B6B,CA6B/B,wCAvoEA,eA0mE+B,CA+B7B,WA9BsB,CA1mExB,kDACE,gBAsoE8E,CAroE9E,gBAumE6B,CAiC/B,iFACE,qBACA,gBACA,uBAGJ,iCACE,YAEF,SACE,aAEF,UAGE,aACA,eACA,YACA,8CA/8EY,CAg9EZ,cA/De,CAtmEf,mBA6mEkB,CA0DlB,sBAlwEA,gBACE,WACA,cACA,WAyFF,oBACE,mBAoqEwC,CAG1C,+CACE,eAnEU,CAsEZ,4BACE,YAKA,+BA5qEF,kBAmmE0B,CAlmE1B,yCACE,eA2qE6E,CA1qE7E,iBAgmEwB,CA4EtB,gDA/qEJ,iBAgrEqD,CA/qErD,0DACE,eA8qE6D,CA7qE7D,gBA6qEmD,CAMrD,kBACE,eACA,mBACA,cACA,WA1FU,CA2FV,gBA3FU,CAvmEZ,kBA4mEY,CAwFV,qBA5FW,CAxmEb,UAqsEsB,CACpB,sBACA,eACA,kBAvsEF,4BACE,kBAisEmC,CAlsErC,4BACE,WAmsE0B,CAK1B,mCACE,cA3sEJ,UA4sEwB,CACpB,mBACA,eACA,gBACA,uBA/sEJ,6CACE,WA0sE4B,CAK1B,yCACE,aAGJ,mDACE,yBACA,sBACA,wBACA,qBAEF,4CACE,kBArtEJ,OAstEmC,CAC/B,gBAnHoB,CAnmExB,sDACE,UAotEoC,CAntEpC,MAmtEiC,CAGjC,kCACE,kBACA,UA3HQ,CA4HR,WA5HQ,CA6HR,YACA,UACA,uBACA,YACA,gBACA,SACA,kBACA,0CACE,WA9HgB,CA+HhB,UA/HgB,CAgIhB,eAhIgB,CAiIhB,cAjIgB,CAkIhB,kBACA,QACA,SACA,qCAIN,mCACE,cACA,gBAlJU,CAvmEZ,kBA4mEY,CA+IV,SAlJiB,CAmJjB,YA5vEF,UA6vEsB,CA5vEtB,6CACE,kBAwvEmC,CAzvErC,6CACE,WA2vE0B,CAC1B,yCACE,WAEA,0TAME,SACA,WAjKM,CAkKN,gBAlKM,CAmKN,UACA,8VACE,aAIN,2GACE,uBACA,WA3KQ,CA8KR,wEACE,gBAEF,yDACE,kBAGJ,yCACE,SACA,WAvLQ,CAwLR,gBAxLQ,CAyLR,UACA,+CACE,aAGJ,2GACE,WA/LQ,CAiMV,mDACE,gBACA,yDACE,kBAGJ,qDA9yEF,kBA4mEY,CA3mEZ,+DACE,kBA6yEqC,CAErC,yCACE,uBACA,eAIF,iCACE,aAKN,8CACE,iCAEE,sBAEF,yCACE,aAKJ,WAEE,cACA,kBACA,cACA,iCAEA,wBACE,gBACA,kBAEF,wBACE,gBACA,kBAKF,aAlBF,WAmBI,6BAyDJ,YACE,eACA,iBAMF,yBACE,qBACA,gBACA,aAGA,qDAGE,kBACA,iCAEA,wEACE,aAMJ,sDACE,WAKJ,8BAIE,6CAEA,qBACA,aAGA,YAIF,kBAhFE,WAjBsB,CAkBtB,UAlBsB,CAmBtB,kBAIA,UACA,YAGA,uBAKA,8BA33EA,iBA81EyB,CA71EzB,wCACE,cA03E0E,CAz3E1E,kBA21EuB,CAiCzB,6BA/3EA,kBA81EyB,CA71EzB,uCACE,eA83E0E,CA73E1E,iBA21EuB,CAiGzB,4CACE,eAKJ,sCACE,uEAEA,kBACA,qBAEA,UA9G+B,CA+G/B,WA/G+B,CAgH/B,gBAhH+B,CAkH/B,0EACE,eAKJ,yBACE,WA3HsB,CA4HtB,cArHkC,CAsHlC,gBA/9EA,kBAg+EsB,CA/9EtB,mCACE,kBA89EwF,CAE1F,qDACE,eAGF,iCAt+EA,wBAu+E0B,CAt+E1B,2CACE,cAq+EwC,CAG1C,8BACE,sBAKJ,wBAjGE,mBACA,iBACA,yBAkGA,2BAhIA,WAhB0B,CAiB1B,UAlBsB,CAmBtB,kBAIA,UACA,YAGA,uBAwHE,mBAnHF,uCA33EA,iBA81EyB,CA71EzB,iDACE,cA03E0E,CAz3E1E,kBA21EuB,CAiCzB,sCA/3EA,kBA81EyB,CA71EzB,gDACE,eA83E0E,CA73E1E,iBA21EuB,CAqJ3B,aA3GE,mBACA,iBACA,yBA6GA,8BACE,wBACA,0BAMF,yBACE,iCAOF,mDACE,sBACA,uBAcJ,cAEE,mBACA,gBACA,sBAIA,8BACE,gBAKJ,sBACE,qBACA,sBACA,gBACA,sBACA,kBAIA,6BACE,MACA,OACA,SACA,QACA,kBACA,WACA,WAKJ,qBA1oFE,eAEA,sBACA,YACA,gBACA,aACA,uBAsoFA,gBACA,gBACA,gBAroFA,gCACE,aAyoFF,6CAEE,iBAEA,4EACE,YAGF,mEAllFF,UAqlFwB,CACpB,iBACA,WAtlFJ,6EACE,WAmlF4B,CAM9B,yCACE,WAIA,kHAhmFF,UAkmFa,CAlmFb,SAomFuB,CACnB,wBApmFJ,4HACE,UAimF+B,CAlmFjC,4HACE,SAgmFW,CAMX,4FAjmFF,gBAkmFa,CAjmFb,sGACE,gBAimFwD,CAhmFxD,iBA+lFW,CAMf,kCAxmFE,kBA2mF+C,CA3mF/C,kBA4mF6C,CA3mF7C,4CACE,eAymFuF,CAxmFvF,iBAwmF6C,CA1mF/C,4CACE,iBA0mFsF,CAzmFtF,iBAymF2C,CAI/C,+BAEE,kBAEA,wBACA,0BAEA,qBACA,WAEA,+CA1nFA,gBA8gFyB,CA7gFzB,yDACE,gBAynFwE,CAxnFxE,iBA2gFuB,CAgHzB,qDACE,wBAIJ,0CACE,WAIF,6BAKE,kBACA,MACA,WACA,WAp3FsB,CAq3FtB,iBACA,mBACA,uBAEA,mBACA,qBACA,0DAEA,0CACE,mBAKJ,0BACE,WA7IgC,CA8IhC,WA3TkB,CA4TlB,kBACA,gBAEA,uBACA,oBACA,YAIF,wBACE,UAIA,qDAEA,sCACE,UAGF,0CACE,aAOJ,+BAGE,kBACA,QACA,SACA,gCAEA,QACA,SACA,kCACA,mCACA,qBAIF,+BACE,kBA/sFA,OAgtF+B,CAC/B,cAxtFA,yBA2tFwB,CAntFxB,yCACE,UA8sFgC,CA7sFhC,MA6sF6B,CAttF/B,yCACE,0BAytFuC,CAK3C,wDACE,WAxMoC,CAyMpC,UAzMoC,CA0MpC,kBACA,WAzM6B,CA8M7B,uDACE,gCAGF,uDACE,aAKJ,oBACE,gBAEA,sFAEE,gCAGF,mJAGE,aAOJ,sDACE,aAMA,0CACE,4BACA,2DACA,uBAGF,uDACE,wBAMJ,sBACE,gBAGF,qBACE,aACA,uBACA,mBACA,kBACA,MACA,OACA,WACA,YACA,UAjgGe,CAkgGf,gBAGF,UAaE,UACA,gBACA,cACA,eACA,kBACA,cAEA,6GA9iGuB,CAgjGvB,aACA,sBArBA,2BACE,UACA,mDA3/Fa,CA4/Fb,mCAEF,4BACE,UACA,mDAhgGa,CAigGb,wCAeF,eACE,aACA,sBACA,cAGF,6BACE,YAnDa,CAsDf,4BACE,QACA,sBACA,cACA,iCAEA,+EACE,aAGF,kCACE,aAGF,0CACE,SAGF,oDACE,WAGF,uDACE,WACA,sBAIJ,4BACE,aACA,QACA,sBACA,mBACA,yBACA,gBA/2FF,iBArRyB,CAqRzB,iBAi3F6B,CAC3B,gBACA,gBAl3FF,sCACE,kBA82F4C,CA/2F9C,sCACE,gBAvRuB,CA0oGvB,uCACE,iBA3oGqB,CAqRzB,eArRyB,CAqRzB,cAw3F+B,CAC3B,cA9oGqB,CAsRzB,iDACE,aAq3F4C,CAt3F9C,iDACE,gBAvRuB,CAkpGvB,gDACE,qBACA,uBAKN,8CACE,UACE,uBAIJ,yBACE,+BACE,gBACA,eACA,iBAIJ,WACE,cACA,qBACA,uBACA,SAEA,qBAj5FA,gBAk5F+C,CAj5F/C,+BACE,gBAg5FkE,CA/4FlE,iBA+4F6C,CA5rF/C,yBAGI,wEA8rFJ,mBACA,uBACA,0BA7rFA,+CAII,6KAurFJ,mBACA,uBACA,0BAtrFA,gDAKI,qRA+qFJ,mBACA,uBACA,0BA9qFA,iDAMI,uZAsqFJ,mBACA,uBACA,0BArqFA,0BAOI,umBA4pFJ,mBACA,uBACA,0BAGF,kBACE,kBACA,aACA,mBAIA,UA/nGY,CAgPZ,sCACE,QASkC,CARlC,UAQwC,CAPxC,WAOqF,CANrF,SAMmI,CALnI,kBALF,qCACE,QAUiC,CATjC,UASuC,CARvC,WAQ6C,CAP7C,SAO2F,CAN3F,kBALF,mCACE,QAW+B,CAV/B,UAU6E,CAT7E,WAS0H,CAR1H,SAQgI,CAPhI,kBALF,kCACE,QAY8B,CAX9B,UAW4E,CAV5E,WAUkF,CATlF,SASwF,CARxF,kBA84FF,sCAEE,oBAEA,+GAGE,oBAGF,iDAEE,oBAIJ,qCACE,UAppGU,CAwpGV,iDACE,mBAIJ,iCACE,aAGA,YAEA,qDACE,mDAxpGU,CA4pGd,0BACE,sBAEA,yCACE,QAGF,yCACE,sBACA,QAIJ,wBACE,sBAEA,uCACE,QAGF,uCACE,8BACA,QAIJ,0BACE,mBAEA,yCACE,QAGF,yCACE,2BACA,QAEA,6DACE,mDAlsGQ,CAusGd,2BACE,mBAEA,0CACE,QAGF,0CACE,mBACA,QAEA,8DACE,mDAntGQ,CA4tGZ,gHACE,kBAQF,+CACE,UAMF,qEACE,UACA,uBAKF,+CACE,mBACA,mDArvGU,CAwvGV,iCAON,eAME,cAjiGA,mCACE,QASkC,CARlC,UAQwC,CAPxC,WAOqF,CANrF,SAMmI,CALnI,kBALF,kCACE,QAUiC,CATjC,UASuC,CARvC,WAQ6C,CAP7C,SAO2F,CAN3F,kBALF,gCACE,QAW+B,CAV/B,UAU6E,CAT7E,WAS0H,CAR1H,SAQgI,CAPhI,kBALF,+BACE,QAY8B,CAX9B,UAW4E,CAV5E,WAUkF,CATlF,SASwF,CARxF,kBAiiGF,uCACE,cACA,kBACA,gBAGA,YAGF,8BACE,kBACA,UAjyGU,CAmyGV,qCACE,4BAGF,yDACE,cACA,kBACA,WAEA,UACA,mDAjyGU,CAoyGZ,sCACE,kBACA,WAEA,UAGA,6BAKF,sCAhmGF,OAimGmC,CAhmGnC,gDACE,UA+lGoC,CA9lGpC,MA8lGiC,CAGjC,yCACE,2BAEA,gEAvmGJ,kBAwmGmD,CAvmGnD,0EACE,iBAsmGyD,CArmGzD,iBAqmGiD,CAG/C,gEA3mGJ,mBA4mGmD,CA3mGnD,0EACE,gBA0mG0D,CAzmG1D,oBAymGiD,CAI/C,+DAhnGJ,gBAinGmD,CAhnGnD,yEACE,iBA+mGsD,CA9mGtD,eA8mGiD,CAOjD,uCAxnGF,MAynGmC,CAxnGnC,iDACE,SAunGoC,CAtnGpC,OAsnGiC,CAGjC,0CACE,mBAIJ,0BACE,wCACA,oBACA,WAEA,4CAEE,eACA,eAGF,8CACE,UACA,mBACA,mDA/1GU,CAk2GV,yBAQF,gDACE,gBAEA,wDACE,UAIJ,8CACE,UACA,mBAKN,aACE,sBACA,cACA,kBAEA,6HAIE,sBAGF,0BACE,cACA,kBAEA,iCACE,aACA,mBACA,uBACA,YACA,kBACA,MACA,QACA,SACA,OACA,UACA,SAIF,4FAEE,aACA,mBACA,mBACA,YACA,WACA,2BACA,gBAGA,kBACA,OACA,QAEA,oMAEE,gBACA,kBAGF,kGACE,eAGF,kGACE,eAIJ,8CACE,MAGF,8CACE,SAMN,8CACE,aACE,sBAEF,oBACE,2BAKJ,QACE,YACA,sCACA,qBACA,sBACA,kBACA,WAphHU,CAqhHV,UArhHU,CAwhHV,eAxhHU,CAyhHV,cAzhHU,CA2hHV,YACE,oBACA,cAGF,sBACE,gBAjiHQ,CAkiHR,WAIJ,mBAEE,qBACA,kBACA,WAj8GwB,CAk8GxB,gBACA,sBA33GA,yBACE,WACA,cACA,WA03GF,4BACE,cAKF,qCAxyGA,WAyyGsB,CACpB,eA37GiB,CA87GjB,cA5yGF,+CACE,UAuyG2B,CAO7B,2BACE,kBACA,OA57Gc,CA0IhB,QAmzGqB,CAnzGrB,UAozGsB,CAnzGtB,qCACE,SAizGwB,CAlzG1B,qCACE,SAkzG0B,CAG5B,2iBAgBE,qBACA,wBAEF,+LAKE,gBAEF,4BACE,YACA,gBAEA,qCACE,gBACA,6BAIF,4CACE,YACA,cAIJ,mDACE,kBACA,YAn2GF,MAo2GqB,CAp2GrB,UAq2GsB,CAp2GtB,6DACE,SAk2GsB,CAn2GxB,6DACE,OAm2G0B,CAE1B,qEACE,aACA,eACA,mBAIJ,wGAEE,gBACA,uBACA,mBACA,WACA,QACA,oBACA,mCAt3GF,gBAnKwB,CAmKxB,eAw3G8B,CAC5B,UACA,2CACA,0DAIA,eA/3GF,yBAi4GiC,CAh4GjC,4HACE,cAq3GqD,CAt3GvD,4HACE,iBArKsB,CAoKxB,4HACE,0BA+3GyC,CAGzC,8IAp4GF,gBAs4G+B,CAt4G/B,eAu4GgC,CAt4GhC,kKACE,cAo4G6D,CAr4G/D,kKACE,iBAq4GiC,CAGnC,mCACE,kBACA,MACA,UACA,sCACA,kCAEF,oDACE,UACA,kCAGF,sDACE,gBACA,UAGF,6FACE,kBAEF,q8BAUE,kBAMF,6BACE,QACA,cACA,aAEA,gBACA,eAzkHgB,CA0kHhB,kBAzkHmB,CAoJrB,cAs7G6B,CAt7G7B,iBAnKwB,CA2lHtB,uBACA,gBA/kHgB,CAglHhB,YACA,4BAjlHgB,CAklHhB,gBACA,mBACA,6DAGA,WACA,sBAl8GF,UAu8GsB,CAt8GtB,uCACE,gBArKsB,CAoKxB,uCACE,eAq7GsD,CAt7GxD,uCACE,WAq8G0B,CAE1B,mCACE,aAEF,qCACE,aACA,gBAGF,wCACE,qBAIJ,oCAt9GA,gBAu9G2B,CAv9G3B,iBAnKwB,CAmKxB,cAy9G6B,CAx9G7B,8CACE,eAq9GgC,CAt9GlC,8CACE,eAs9GsD,CAv9GxD,8CACE,gBArKsB,CAkoHxB,gDACE,kBACA,QACA,gBAl+GF,UAm+GsB,CAl+GtB,0DACE,WAi+G0B,CAG5B,mFACE,cAznHoB,CA0nHpB,gBAxnHsB,CAynHtB,gBAEA,mDAprHY,CAurHZ,UACA,aACA,eArwHuB,CAuwHvB,+HAl/GF,iBAo/GgC,CAp/GhC,cAq/G+B,CAp/G/B,mJACE,eAk/GwC,CAn/G1C,mJACE,gBAm/GgC,CAM9B,oFACE,UACA,kBAQJ,gEACE,UACA,kBAIF,8EACE,UACA,kBAOF,8LACE,6CACA,qGAQF,4CACE,gBAKJ,6IAGE,iBACA,uBAIA,+EAIE,uCAGA,wBACA,2BAIJ,iCAEE,2DAEA,uCACE,oBACA,kBAGF,yCACE,OA5sHY,CA0IhB,QAmkHuB,CAnkHvB,UAokHwB,CAnkHxB,mDACE,SAikH0B,CAlkH5B,mDACE,SAkkH4B,CAQ1B,kRAEE,wBACA,UAMN,gCArlHA,iBA5IY,CA4IZ,eAulH8B,CAtlH9B,0CACE,cAolHyC,CArlH3C,0CACE,kBA9IU,CAouHV,sCAxlHF,SA5IY,CA4IZ,UA0lHwB,CAzlHxB,gDACE,SAulHmC,CAxlHrC,gDACE,UA9IU,CA0uHZ,iCA9lHA,cA+lH6B,CA/lH7B,kBA5IY,CA6IZ,2CACE,iBA9IU,CA6IZ,2CACE,eA8lH0C,CAE1C,sDACE,SAnmHJ,SAqmHwB,CArmHxB,SAsmHuB,CArmHvB,gEACE,UAmmH2B,CApmH7B,gEACE,QAomH2B,CAI7B,8CACE,iBAvvHU,CAwvHV,kBAxvHU,CA2vHR,oKAEE,8BAMR,mBAEE,kBAptHA,yBACE,WACA,cACA,WAotHJ,kBACE,kBACA,YACA,OACA,WAtwH2B,CAuwH3B,uBACA,WACA,iBAGF,8CACE,4CACE,WA2CJ,QACE,cACA,wBAEA,sBACE,cAn9HuB,CAo9HvB,gBACA,qBACA,iBA1CsB,CA+CpB,gIAEE,eAxBiB,CAtrHvB,gJACE,WACA,eAorHqB,CAnrHrB,kBACA,qBAgtHI,wKACE,UA5B2B,CA6B3B,WA7B2B,CAgC7B,kNAtsHN,iBAusHqD,CAC7C,cAnEY,CAoEZ,iBApEY,CApoHpB,sOACE,iBAqsHmH,CApsHnH,gBAosHmD,CAI/C,sTA3sHN,iBA4sHqD,CAC7C,eACA,kBA7sHR,8VACE,iBA0sHqH,CAzsHrH,gBAysHmD,CAI/C,sJACE,UACA,UA3C6B,CA4C7B,WA5C6B,CA+C7B,gOACE,cAlFU,CAmFV,iBAnFU,CAqFZ,wPACE,eAv5HS,CAg6HT,8YApuHV,gBAypHwB,CAxpHxB,sbACE,gBAmuHiF,CAluHjF,iBAspHsB,CA+Ed,klCAGE,gBAjEgB,CAkEhB,cAnEc,CAoEd,mBAGF,kXACE,cAzEqB,CAgF3B,6IACE,eArFwB,CAvrHhC,6JACE,WACA,eAqrH8B,CAprH9B,kBACA,qBA2wHM,gVACE,gBAMJ,6IAEE,eAhG0B,CAxrHlC,6JACE,WACA,eAsrHgC,CArrHhC,kBACA,qBAuxHM,wVAEE,gBAKR,6DACE,iBACA,oBAKN,aAEE,kBAEA,oDACE,wCAGF,6BACE,kBAEA,uDAEE,aACA,mBACA,2BAEA,iBACA,SAEA,gBAjzHJ,eAkzH6B,CACzB,mBAlzHJ,iEACE,gBAgzHiC,CAI/B,8EACE,kBACA,MACA,OACA,YAEA,SACA,UAGF,2EAEE,WA90HN,mFACE,WACA,kBA60HqC,CA50HrC,kBACA,qBAk1HF,mDAEE,kBACA,iBAGA,cAEA,uEACE,kBACA,eAp1HJ,eAq1H6B,CACzB,oBACA,WACA,mBACA,uBACA,oBACA,gBACA,SA31HJ,2FACE,gBAm1HiC,CAS/B,iHACE,gBAGJ,+DACE,aAGJ,gCACE,eAGF,wBACE,kBACA,SAr2HF,MAs2HiC,CAC/B,WAt2HF,kCACE,SAo2HkC,CAn2HlC,OAm2H+B,CAE/B,kCAx2HF,SA8pH+B,CA4M3B,wBACA,oBA12HJ,4CACE,SAu2HkE,CAt2HlE,UA2pH6B,CAiN/B,8CAIE,aACA,2BACA,mBAEA,eAxNe,CA2Nf,YA74HF,8DACE,WACA,eAgrHe,CA/qHf,kBACA,qBA44HA,khBAIE,UAtOyB,CAuOzB,gBACA,mBACA,uBAEF,kXAIE,kBACA,kcACE,aAIJ,gIAh5HF,iBAi5HiD,CAh5HjD,oJACE,iBA+4HyG,CA94HzG,gBA84H+C,CAG/C,kJACE,cAjrIqB,CAkrIrB,iBAlrIqB,CA4RzB,iBAu5HiD,CAC7C,kBACA,uBAx5HJ,0LACE,iBAq5H2G,CAp5H3G,gBAo5H+C,CAI/C,oEACE,UACA,UAnQ2B,CAoQ3B,WApQ2B,CAsQ7B,8EACE,YAIA,sFACE,UAzrII,CA0rIJ,WA1rII,CA8rIR,sEACE,WACA,eAzmIe,CAqLnB,eAq7H8B,CAr7H9B,iBAs7H+B,CAr7H/B,0FACE,gBAm7HiC,CAp7HnC,0FACE,gBAo7HmC,CAGnC,8FACE,aACA,mBAGA,kBAMA,cAKA,YAz8HJ,cA28H+B,CA38H/B,gBA48H8B,CA38H9B,kHACE,iBAy8HgC,CA18HlC,kHACE,aA08HkC,CAG9B,sSAx8HN,cA08HqD,CAz8HrD,8UACE,iBAw8HsD,CAv8HtD,aAu8HmD,CAIjD,sHACE,aACA,cACA,eA7oIa,CA+oIb,4IACE,UA/oIU,CA2LlB,cAq9HqD,CAp9HrD,gKACE,iBAm9HsD,CAl9HtD,aAk9HmD,CAIjD,kHACE,aACA,gBA39HN,iBA69HmD,CA59HnD,sIACE,iBA29HuD,CA19HvD,gBA09HiD,CAIjD,4IACE,cACA,SAMF,sHACE,uBACA,uBAEA,0KACE,cA1wImB,CA2wInB,iBA3wImB,CA8wIrB,kMACE,cACA,YACA,uBACA,gBAEA,0OAx/HN,gBAypHwB,CAxpHxB,kRACE,gBAu/H6E,CAt/H7E,iBAspHsB,CAmWlB,8MACE,cAjyIiB,CAkyIjB,gBACA,qBACA,cAzXO,CA0XP,iBAvXgB,CAwXhB,gBACA,mBACA,uBAEF,8MACE,cAzyIiB,CA0yIjB,qBACA,kBAjYO,CAkYP,eAjYY,CAkYZ,iBAjYgB,CAkYhB,gBACA,mBACA,uBAEF,0MACE,cAnzIiB,CAozIjB,gBACA,qBACA,cAzYM,CA0YN,iBAzYW,CAgZjB,2DACE,YAEA,eA/XsB,CAnrH1B,2EACE,WACA,eAirHwB,CAhrHxB,kBACA,qBAijIE,4KACE,gBAGF,mGACE,sBAGF,iGACE,cAMJ,2DACE,YAEA,eAnZwB,CAprH5B,2EACE,WACA,eAkrH0B,CAjrH1B,kBACA,qBAskIE,oLAEE,gBAaR,wBACE,eACA,OACA,MACA,WA/yIa,CAgzIb,UACA,iBAbmB,CAcnB,8BACA,cAEA,wCACE,eACA,kBACA,WACA,eACA,eACA,WAGF,0CACE,UAIF,2CACE,oBAIF,kCACE,UACA,mDAzzIa,CA0zIb,0BACA,oDACE,UACA,mDAzzIU,CA0zIV,0BACA,uBAIJ,iCACE,UACA,mDAj0IY,CAk0IZ,0BAIJ,gBACE,aACA,sBACA,cACA,gBAvDgB,CAwDhB,gBACA,yBACE,gBAzDoB,CA0DpB,sCACE,WA7DmB,CA8DnB,eA9DmB,CAmEzB,aACE,aACA,mBACA,eAvEiB,CAwEjB,WAxEiB,CAyEjB,qBACA,2BAEA,eACE,WACA,cACA,kBACA,mBAQF,yBACE,gBAGF,wBApqIA,eA2qI2B,CAEzB,qBACA,gBACA,cACA,eACA,oBACA,gBACA,YACA,kBACA,mBACA,WAhBA,0CACE,UACA,SAvqIJ,kCACE,gBAyqI+B,CAY/B,gCAvrIF,uBAwrIyB,CAvrIzB,0CACE,uBAsrIsD,CAEtD,0BACE,qBACA,YAEF,6BACE,gBACA,mBAEF,6CACE,sBAMJ,oBACE,YACA,YACA,UAIJ,yBACE,gBACE,gBAGA,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,iBAKN,yBACE,gBACE,eAGA,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,iBAQF,+CACE,iBACA,YACA,aACA,oBAMJ,4BACE,kBACA,WAn9IW,CAu9If,YACE,eACA,cACA,kBACA,UACA,qBACE,qBACA,UACA,kBAEF,mBACE,eACA,eACA,SACA,SACA,6BACA,YAGF,yCACE,WAIJ,0CACE,gBACA,eACA,iEACE,kBACA,yEACE,kBACA,UACA,WACA,QAnxIJ,SAoxImC,CAnxInC,mFACE,SAkxIqD,CAjxIrD,UAixIiC,CAEjC,iKA7xIF,qBA8xI0B,CA7xI1B,qLACE,qBA4xImE,CAGrE,qDACE,aACA,YACA,0DApyIF,UAqyIwB,CApyIxB,oEACE,WAmyI4B,CAE5B,sEAvyIF,WAwyIwB,CACpB,aAxyIJ,gFACE,UAsyI6B,CAI/B,0DACE,aAGF,gIAhzIA,eAizI2B,CAhzI3B,oJACE,gBA+yI+B,CAGjC,mDACE,UACA,8DACE,kBACA,SACA,WACA,oBACA,mBACA,kBArzIJ,iBAszImD,CArzInD,wEACE,cAozIqE,CAnzIrE,kBAmzIiD,CAC/C,oEACE,cACA,YACA,kBACA,QACA,WAn0IN,iDAo0I8B,CA7zI9B,UA8zIqC,CAp0IrC,8EACE,gDAk0IqE,CA5zIvE,8EACE,UA4zIyD,CA3zIzD,SA2zImC,CASvC,YACE,mBACA,qBACA,WALkB,CAMlB,kBAGF,kBACE,aACA,gBACA,SACA,UAGA,sBACA,aACA,mBAGF,2BACE,gBAIF,0BACE,iBACA,aACA,kBACA,gEAEA,gCACE,aAIJ,eAGE,sBACA,kBACA,SACA,OACA,WACA,WACA,0BACA,sBACA,0DAKA,0BACE,gBAKJ,qBACE,gBACA,mBAKF,gCACI,0BACA,+BAIJ,qBACI,kBACA,cAt5IF,qBAw5I0B,CAv5I1B,+BACE,sBAs5IqC,CAErC,oDACI,kBAGJ,+CACI,yDAGJ,yBACI,kBACA,iBACA,MACA,OAMR,mBACE,cACA,kBACA,WACA,UAN2B,CAQ3B,yBACA,2BAn7IA,qBAq7IwB,CAp7IxB,6BACE,sBAm7ImC,CAErC,gDACE,kBAGF,iCACE,cACA,kBACA,gBAEA,WACA,UAvByB,CAyBzB,sCAEA,yCACE,kBAEA,OACA,MACA,SAEA,WACA,UAnCuB,CAsCzB,mDACE,WACA,aACA,kBAEA,aACA,UA5CuB,CA6CvB,WAEA,6BACA,qCACA,8BAGF,oFAKE,gCAQE,wDACE,aAEF,wDACE,0BACA,iEAKJ,8DACE,aAKF,gEACE,8GAGF,gEACE,8GAKJ,wGAEE,eAEA,iHACE,oBAEF,iHACE,oBAON,gDACE,wCAEA,0BAEA,kEACE,cACA,oCAKN,iBACE,GACE,UACA,wCAEF,KACE,UACA,wCAGJ,kBACE,GACE,UACA,8BAEF,IACE,UAEF,KACE,UACA,kCAGJ,oDACE,GACE,sBACA,iCAEF,MACE,sBACA,iFAEF,OACE,uBACA,+EAEF,KACE,uBAGJ,8CACE,GACE,sBACA,iCAEF,IACE,sBACA,sEAEF,OACE,WACA,gFAEF,KACE,qBAGJ,oDACE,GACE,sBACA,0FAEF,OACE,uBACA,0FAEF,OACE,uBACA,0FAEF,KACE,uBAGJ,8CACE,GACE,qBACA,wEAEF,IACE,aACA,iFAEF,OACE,WACA,2EAEF,KACE,sBAoBJ,gBACE,sBACA,cACA,kBAba,CAcb,mBACA,eACA,kBAGA,0BAhBA,eAEA,wCACE,eAiBF,8BACE,kBACA,QACA,2BACA,sBACA,qBACA,UAjCU,CAkCV,WAlCU,CAmCV,eAjqJF,MAkqJqB,CAlqJrB,UAmqJsB,CAlqJtB,wCACE,SAgqJsB,CAjqJxB,wCACE,OAiqJ0B,CAE1B,mDACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAGF,qCACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAIJ,mDACG,QAjEY,CAoEf,wBACE,sBACA,kBACA,MACA,OACA,UA5EU,CA6EV,WA7EU,CA8EV,mBACA,iBACA,kBACA,kCAGF,uBACE,sBACA,kBACA,MACA,OACA,UAzFU,CA0FV,WA1FU,CA2FV,kBACA,+BACA,mBAGF,kCACE,qBAGF,0BACE,sBACA,kBACA,qBAruJF,gBAuuJ4B,CAvuJ5B,cAwuJ6B,CAE3B,sBACA,mBACA,oBACA,WA5uJF,oCACE,aAquJ6D,CAtuJ/D,oCACE,iBAsuJ8B,CAUhC,qBACE,aAIA,wEACE,UACA,SACA,WACA,YAIF,oFACE,UACA,SACA,WACA,YAIJ,yCAlIA,eAEA,uDACE,eA36IF,yBAGI,kFA6iJJ,iBA1iJA,+CAII,4LAsiJJ,iBAniJA,gDAKI,ySA8hJJ,iBA3hJA,iDAMI,gbAqhJJ,iBAlhJA,0BAOI,qoBA2gJJ,iBAIA,+BACE,mBACA,+CACE,qBACA,YACA,yBACA,sBACA,aACA,gBAEA,yDACE,QAEF,6DACE,eAMR,8CACE,wCACE,uBA0BA,8EACE,0DAl0JJ,yBAm0JmC,CAl0JnC,wFACE,0BAi0J2C,CAKzC,4HACE,6CAMR,0BACE,eACA,OACA,MACA,UA/iKe,CAgjKf,UACA,aAGA,2BAGA,6CACE,oBAGF,+CACE,cACA,4BAIF,oCACE,cACA,UACA,mDACE,mDAtjKW,CAujKX,0BACA,qDACE,UACA,mDAtjKQ,CAujKR,0BACA,uBAMN,mCACE,UACA,mDAhkKY,CAikKZ,0BAIJ,0BACE,eAnEoB,CAuEpB,0EAEE,cA3Ec,CA6EhB,6BACE,QAUA,4PACE,aACA,eACA,mBAOF,+DACE,0BACA,mBAKN,UACE,aAII,4MACE,aACA,eACA,mBAKN,qCAIE,uCAGA,wBACA,2BAIA,mBACA,gBACA,0BAGF,gBACE,aAEF,0BACE,eAGA,gCACE,eAGA,iDACE,0BACA,wBACA,mBASF,oEACE,uBA9mKqB,CAmnKzB,wDAIE,uCAGJ,8CACE,gBACA,uBA7nKyB,CA8nKzB,mBACA,oEAv+JF,cAw+J+B,CAx+J/B,iBAnKwB,CAoKxB,8EACE,gBArKsB,CAoKxB,8EACE,eAu+JwD,CAK5D,iBACE,aACA,mBACA,eA9LyB,CA+LzB,kBA9L4B,CApzJ5B,cAm/J2B,CAn/J3B,iBAnKwB,CAwpKxB,uBAxM4B,CAyM5B,0BACA,+BACA,kBACA,uBACA,eACA,gBACA,mBACA,0BACA,YA7/JA,2BACE,gBArKsB,CAoKxB,2BACE,eAk/JoD,CAYtD,2CACE,eACA,cACA,uBACA,mBACA,gBAEA,oDACE,eAIJ,iCACE,cA7gKF,oBA8gK4B,CA9gK5B,gBA+gK2B,CACzB,WACA,2BACA,iBAjhKF,2CACE,sBA4gKoC,CA7gKtC,2CACE,eA6gKgC,CAMlC,uCACE,cACA,YACA,kBACA,QAzhKF,UA0hKsB,CA1hKtB,SA2hKqB,CACnB,WACA,eACA,sBA7hKF,iDACE,UAwhK0B,CAzhK5B,iDACE,SAyhKyB,CAM3B,uCACE,aACA,QACA,oBACA,mCACA,UAIJ,eACE,aACA,sBAYA,0GApzKsB,CAqzKtB,iBACA,eA3QqB,CA4QrB,kBA3jKA,yBA6jK+B,CAE/B,mBAlBA,0BACE,8BAIA,4CACE,eAx0KqB,CAy0KrB,kBAz0KqB,CAsRzB,yBACE,0BA2jKuC,CAIzC,0BACE,gBACA,eApRmB,CAqRnB,iBACA,gBAEF,iBACE,UAIJ,UACE,eACA,kBACA,aACA,mBACA,WACA,kCAiBA,sBACA,WArTqB,CAqSrB,oBACE,eAGF,gBACE,aAGF,mBAxtKA,0BAD2B,CAE3B,wBAF2B,CAG3B,uBAH2B,CAI3B,qBAJ2B,CAK3B,oBAL2B,CAM3B,gBAN2B,CA2tKzB,WACA,mBACA,gBACA,uBAMJ,YACE,cACA,kBACE,cACA,eACA,yBACA,aACA,gBAEF,sBACE,kBACA,mBAIJ,8CACE,oBACE,6BAEF,eACE,uBAKF,uDAhoKA,iBAioK6B,CAjoK7B,kBAgzJsB,CA/yJtB,iEACE,iBA8yJoB,CA/yJtB,iEACE,kBAgoKoD,CA9kKtD,qEACE,kBACA,QACA,2BAEA,sBACA,qBAEA,UAvOa,CAwOb,WAxOa,CA2Kf,MA8DqB,CA9DrB,UA+DsB,CA9DtB,+EACE,SA4DsB,CA7DxB,+EACE,OA6D0B,CAE1B,4EACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,2EACE,sBACA,WACA,kBACA,UACA,YACA,aACA,WAGF,0FACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKJ,gEACE,sBACA,iBACA,kBACA,MACA,OACA,UAzRa,CA0Rb,WA1Ra,CA2Rb,gBAxRoB,CAyRpB,mBACA,iBA3RqB,CA8RvB,0EACE,yBAEA,gFACE,sBACA,wBACA,kBACA,SACA,QACA,cACA,UACA,YACA,gBAzSkB,CA0SlB,mBACA,aACA,cACA,WAKJ,iEACE,eAIA,uFACE,sBACA,kBACA,QACA,SACA,gCACA,cACA,aACA,UA/TkB,CAgUlB,gBAhUkB,CAiUlB,mBACA,aACA,cACA,WA0+JF,qEAtoKF,2BAuoK8B,CAvoK9B,iBAwoK+B,CAvoK/B,+EACE,gBAqoK8D,CAtoKhE,+EACE,4BAsoKmC,CASvC,WACE,sBACA,kBACA,sBACA,UA52KgB,CA82KhB,WAVqB,CAWrB,eAXqB,CAYrB,SACA,cACA,iCAEA,cACE,gBASF,qBACE,aAIF,qDAEE,aACA,2BAIF,kGAEE,mDAl4Ka,CAs4Kf,+DAEE,gBACA,aACA,+BAIF,uKAIE,gBACA,aACA,+BAIF,2CACE,gBACA,aACA,+BAIF,wCACE,gBACA,aACA,gCAIF,wEACE,qGAEA,mBACA,uBAIF,+CACE,qGAKF,wCACE,qGAEA,mBACA,uBAKJ,oCACE,aAGF,4BACE,OACA,MACA,gCACA,gDACE,mCAIJ,kBACE,UACA,MACA,8BACA,4BACE,2BAIJ,yBACE,WACE,eA1HoB,EA8HxB,yBACE,WACE,wBACA,4BACA,6BAKJ,8CACE,4BACE,4BAEF,kBACE,4BA8BJ,4BACE,GACE,qBAEF,IACE,mBAEF,KACE,sBAIJ,oCACE,GACE,qBAEF,IACE,qBAEF,KACE,oBAIJ,mCACE,GACE,qBACA,UAEF,IACE,mBACA,UAEF,KACE,oBAaJ,UACE,WAzEa,CA0Eb,eAzEiB,CA0EjB,kBACA,gBACA,iBACA,UACA,cACA,mBAEA,8BACE,sBAGF,6BACE,aACA,WACA,YAGF,6BACE,kBAMF,8BACE,WACA,kBACA,SACA,UApGmB,CAsGrB,oBACE,kBACA,OACA,QACA,YAEF,yBACE,oDACA,iCAEF,0BACE,kBACA,OACA,QACA,YAEF,iCAIE,WACA,YAMF,8BACE,kBA75KF,MA85KiC,CAC/B,QACA,qCACA,oDACA,sCAj6KF,wCACE,SA45KkC,CA35KlC,OA25K+B,CAMjC,oBACE,UA7EF,kBAx1KA,UAy1K+B,CAC/B,SACA,UA/DoB,CAgEpB,WAhEoB,CAiEpB,mBA0FE,qBACA,oDAv7KF,8BACE,SAu1K4C,CAt1K5C,WAs1K6B,CAmF7B,0BACE,WACA,kBACA,UAnJgB,CAoJhB,WApJgB,CAqJhB,mBACA,iBACA,mBACA,mBAQJ,mBAGE,aACA,mBACA,uBAEA,kBACA,WACA,SAtJc,CAuJd,UAxJgB,CAyJhB,WA1JiB,CA2JjB,mBAEA,+CACA,kDAGA,yBACE,kBACA,WAh9KJ,QAi9KmC,CAC/B,kBAxKgB,CAyKhB,SACA,mCACA,oCACA,qBA5KgB,CA6KhB,uBAEA,UACA,kCACA,kDA19KJ,mCACE,SA+8KsF,CA98KtF,SA88KiC,CAajC,kCACE,UACA,eACA,iBAOJ,yBAhJA,kBAx1KA,UAy1K+B,CAC/B,QACA,UArD0B,CAsD1B,WAtD0B,CAuD1B,mBA6IE,qBACA,UAEA,mDA5+KF,mCACE,SAu1K4C,CAt1K5C,WAs1K6B,CAsJ/B,6BAvJA,kBAx1KA,UAy1K+B,CAC/B,SACA,UAsJI,CArJJ,WAsJI,CArJJ,mBAuJE,qBACA,gBAlN2B,CAmN3B,mBACA,aAt/KF,uCACE,SAu1K4C,CAt1K5C,WAs1K6B,CAkK7B,0BACE,UAIJ,gBACE,aAKA,+EAEE,gBAMF,mFAEE,aAKE,gFACE,qBAIA,0FACE,mBACA,UAEF,qFACE,8DAOF,oFACE,mBAWF,oFACE,mBACA,qEAEF,+EACE,sEAMJ,0IACE,mBAEF,4RAEE,UACA,wCAMJ,qDACE,mBAEF,8GAEE,UACA,wCAMJ,mCACE,aAEF,oCACE,UAEF,6CACE,UAEF,8BACE,qBAEF,uCACE,cAIJ,uBACE,sBACA,gBA/Ue,CAgVf,YAEA,0CACE,OACA,iBACA,oBACA,UAvVS,CAwVT,kBACA,aACA,uBAGF,2CACE,YACA,SA5ViB,CA6VjB,MACA,2BAGF,2CACE,SACA,mBACA,qBACA,SAEA,2DACE,SAGF,0DACE,WAIJ,sCACE,SAIA,6CAGE,WACA,SAHW,CAKX,+CAGA,mDACE,SATS,CAUT,UACA,kCACA,eACA,qCACA,sBArXY,CAsXZ,wBAEA,UACA,kCACA,+BAGF,4DACE,UACA,eACA,iBAOF,mMACE,MAMJ,qDACE,mBAEF,8GAEE,UACA,wCAKJ,uDA1sLF,SA2sLuB,CA3sLvB,OA4sLwB,CA3sLxB,iEACE,MAysL2B,CA1sL7B,iEACE,UA0sLyB,CAGvB,iDACE,YACA,MAMR,oBACE,aACA,mBACA,mBAQE,iGACE,cAPU,CAQV,eACA,WATU,CAUV,mDAn7LW,CAo7LX,oCAIJ,iDApuLA,iBAutLe,CAttLf,2DACE,iBAmuL4D,CAluL5D,gBAotLa,CAiBf,gDAxuLA,gBAutLe,CAttLf,0DACE,gBAuuL4D,CAtuL5D,iBAotLa,CAqBf,iCACE,sBAEA,2HAEE,eACA,cACA,kBAKF,0DACE,kBAzvLJ,iBA0vLmD,CAC/C,YACA,iBA3vLJ,oEACE,cAwvLuD,CAvvLvD,kBAuvLiD,CAOrD,8CACE,qCACE,8BAKJ,iBACE,UACA,MACA,OACA,QACA,6BAEA,2CAEA,sCACE,+BACA,oFACE,mDAYN,kCACE,GACE,+BAEF,KACE,wCAPsB,EAU1B,mCACE,GACE,wCAZsB,CAcxB,KACE,gCAMF,gDAKE,+BAJA,8DACE,SAKF,gEACE,UAGF,qEACE,gBAGF,0HACE,oDAMN,cACE,cACA,cAjDoB,CAkDpB,eAhDsB,CAiDtB,eApDsB,CAqDtB,cAjDiB,CAkDjB,kBAEA,kCACE,cACA,YAxDgB,CA2DlB,oCACE,cACA,UACA,kBAIJ,iCACI,mBAGJ,8BACI,mBAUF,0BACE,eAthM8B,CAuhM9B,mBAIJ,UACE,cACA,mBACA,eACA,aACA,iBACA,YACA,iBACA,mBACA,aAl4LA,mBAo4L0B,CAp4L1B,iBAg3Lc,CA/2Ld,oBACE,gBA82LY,CA/2Ld,oBACE,oBAm4LyC,CAE3C,uBAv4LA,mBAw4L4B,CAx4L5B,cAy4L6B,CAx4L7B,iCACE,aAs4LmC,CAv4LrC,iCACE,oBAu4L8B,CAGhC,oBACE,eAEA,kCACE,eAIJ,wBACE,YACA,UA1CW,CA2CX,WA1CY,CA2CZ,kBACA,iBAl5LF,gBAm5L+C,CAC7C,WAn5LF,kCACE,gBAi5LkD,CAh5LlD,eAg5L6C,CAI/C,oCA95LA,oBA+5L6B,CA/5L7B,eAg6L4B,CA/5L5B,8CACE,gBA65LoC,CA95LtC,8CACE,mBA85L+B,CAK/B,2FAEE,gBAKF,sCACE,UACA,SACA,WACA,YAIJ,oBACE,yBACA,eACA,WAGF,kBACE,SACA,WACA,QACA,WAhFgB,CAiFhB,kBACA,kBAGF,8BACE,QACA,OACA,WACA,kBACA,+BACA,UAEF,yCACE,kCAGF,oBACE,kBACA,SACA,OACA,MACA,aACA,WAtGgB,CAuGhB,UAvGgB,CAwGhB,kBACA,0GAptMoB,CAstMpB,2BACE,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,yCACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKF,0HAGE,0BA1rMS,CA2rMT,+CAEF,0EAEE,sBAMN,8CACE,mCACE,sBAEF,8CACE,yBAEF,qCACE,uBAQJ,+BACE,aACA,cACA,gBAGF,YACE,kBACA,MACA,OACA,QACA,SACA,WACA,UAGF,QACE,cACA,SACA,kBACA,gBACA,kBACA,cACA,wDACE,iBAEF,8BACE,mBA7BiB,CA+BjB,8CACE,kBACA,SACA,OACA,QACA,WApCe,CAqCf,UAEF,sDACE,MACA,WAzCe,CA6CjB,kDACE,aACA,kBACA,SACA,UACA,WACA,YACA,iBAGA,mDACE,kBAKJ,0CACE,qBACA,mBAGA,0EACE,SAMR,gBACE,cACA,kBAEA,0BACA,8DACE,YACA,UAlFmB,CAmFnB,kBACA,QACA,2BACA,gBACA,UACA,eACA,eACA,+CACA,iDAhzMgB,CAizMhB,0EACE,aAEF,sFACE,YACA,eAEF,gFACE,gBAEF,8EACE,kBACA,QACA,SACA,gCAIF,kFACE,2CAGJ,+BA3nMA,MA4nMiC,CAC/B,yDA5nMF,yCACE,SA0nMkC,CAznMlC,OAynM+B,CAGjC,+BA/nMA,OAgoMiC,CAC/B,yDAhoMF,yCACE,UA8nMkC,CA7nMlC,MA6nM+B,CAI/B,uCACE,+CAIF,sDACE,WACA,mBACA,kEACE,YAMR,eAEE,kBACA,gBACA,cACA,WA7ImB,CA7mMnB,qBACE,WACA,cACA,WAwvMF,iCACE,kBACA,MA3pMF,MA4pMiC,CA3pMjC,2CACE,SA0pMkC,CAzpMlC,OAypM+B,CAEjC,4BACE,cAEF,8BACE,aACA,sBACA,kBACA,sCACE,WACA,qBAKN,sBAEE,WAnKmB,CAoKnB,aACA,wDACA,kBAjrMA,MAkrM+B,CAC/B,0BArxMA,4BACE,WACA,cACA,WAgGF,gCACE,SAgrMgC,CA/qMhC,OA+qM6B,CAE/B,qCACE,kBACA,uBAEF,kCACE,eAEF,yBACE,kCACE,iBAKN,wBACE,cACA,kBACA,QA1LmB,CA2LnB,OACA,QACA,SACA,gBAGF,eACE,aACA,kBACA,MACA,OACA,QACA,SACA,wDACA,cAEA,0BACA,4BACE,YACA,gBAEF,wDACE,gBAEF,uCAruMA,2BAsuM0B,CACxB,iCACA,kBAvuMF,iDACE,0BAouM2C,CAG3C,yCACE,gCACA,oBAl7MuB,CAm7MvB,kBAGJ,wCA/uMA,0BAgvM0B,CACxB,iCACA,kBAjvMF,kDACE,2BA8uM0C,CAG1C,0CACE,gCACA,oBA57MuB,CA67MvB,kBAGJ,mBACE,cACA,YACA,4BACE,iCAKN,WAGE,kBACA,UACA,WACA,SACA,WACA,mBACE,+FAGF,oBACE,+FAKJ,OACE,kBACA,WACA,aAGF,QACE,eACA,kBACA,iBACA,aACA,gEACA,eACA,mBACA,kBACA,yBAnyMA,UAoyMoB,CACpB,gBACA,sBACA,gBACA,uBAvyMA,kBACE,WAkyMwB,CAK1B,iCACE,gBACA,aAEF,kBACE,eAEF,oBACE,oBACA,mBACA,iBACA,uBACA,WACA,eAEF,iBACE,gBAIJ,wDACE,yBACA,0BAUF,eACE,cAGF,SACE,kBACA,WA/iNc,CAijNd,sBACA,eACA,gBAGA,WA5lNa,CA+lNb,UACA,mDAviNe,CAyiNf,2BACE,aACA,mBACA,mBAEA,iBACA,eAEA,gBAKA,eAEA,uCACA,kBACA,eAEA,gBAGA,6CACA,mDAhkNa,CA6Mf,0BAq3MgC,CAj4MhC,mCACE,WACA,eAi3MiC,CAh3MjC,kBACA,qBASF,qCACE,wBAm3M0C,CAE1C,gCAEE,YACA,sBACA,YAIJ,oBACE,mBAEA,sCACE,mBAKF,2CACE,mDAllNU,CA2lNZ,+JACE,mDAhmNW,CAomNf,kBACE,UACA,oCACE,kCAGA,2CACE,mCAGJ,kCACE,UACA,oDACE,+BASJ,oDACE,UACA,kCAIA,+DACE,kCAIF,iEACE,iCAIF,2DACE,mCAKN,oBACE,iBACA,iBACA,eACA,eACA,yBACA,YAGF,oBACE,YA78MF,cA88M6B,CA98M7B,eAq0M4B,CAp0M5B,8BACE,gBAm0M0B,CAp0M5B,8BACE,aA68MwD,CAI5D,yBACE,SACE,OACA,QACA,WACA,eACA,YACA,gBACA,SACA,UAII,+DACE,kCAIF,iEACE,kCAOV,yBACE,SACE,gBACA,mBACE,SAEF,iBACE,OAEF,kBACE,QAEF,gBACE,MAIF,mBAv/MF,MAw/MmC,CAv/MnC,6BACE,SAs/MoC,CAr/MpC,OAq/MiC,CAGjC,iBA3/MF,OA4/MmC,CA3/MnC,2BACE,UA0/MoC,CAz/MpC,MAy/MiC,CAS7B,iEACE,kCAIF,kEACE,kCAOV,0BAEI,2BACE,iBAKN,8CACE,SACE,uBAMJ,oBACE,2BAiBF,WACE,sBACA,aACA,sBAEA,kBACA,UAEA,eACA,eAtBkB,CAuBlB,WAEA,mCACE,uBA/wNyB,CAgxNzB,yDA/wNgC,CAgxNhC,gDAGF,mEACE,iCAGF,6BACE,WAGF,oDAGE,sBAMF,sBACE,gBAGF,mBACE,YAnDqB,CAoDrB,gBApDqB,CAqDrB,gBArDqB,CAwDvB,0BACE,WA1D4B,CA2D5B,eA3D4B,CA4D5B,eA5D4B,CA8D5B,4CACE,YACA,gBACA,gBAIJ,sBA7mNA,gBA+iNyB,CA9iNzB,gCACE,gBA4mNwE,CA3mNxE,iBA4iNuB,CAmEvB,8BACE,UAGE,iEACE,aAOV,kBACE,cAp6NyB,CAq6NzB,sBACA,sBACA,gBACA,aACA,mBACA,mBAEA,WACA,WAjGkB,CAkGlB,eAlGkB,CAmGlB,eACA,SAEA,+DACE,kBACA,oBACA,eAGF,oBACE,cACA,qBAEF,+BACE,aACA,mBAEF,8BACE,eAEF,6BACE,aACA,gBAEA,iFACE,uBAj3NuB,CAk3NvB,yDAj3N8B,CAk3N9B,gDAKA,uGACE,gBAIN,yCA/qNA,gBAkjN0B,CAjjN1B,mDACE,gBA8qNyE,CA7qNzE,iBA+iNwB,CAgI1B,wCAlrNA,iBAkjN0B,CAjjN1B,kDACE,iBAirNyE,CAhrNzE,gBA+iNwB,CAoI1B,qCAtrNA,iBAkjN0B,CAjjN1B,+CACE,iBAqrNyE,CAprNzE,gBA+iNwB,CAsIxB,gDAxrNF,cAyrNiD,CAxrNjD,0DACE,iBAurNkD,CAtrNlD,aAsrN+C,CAIjD,8CA/DF,kBAgEI,8BAKJ,sEACE,WACE,eAzJgC,CA4JlC,kBACE,WA7JgC,CA8JhC,eA9JgC,EAmKpC,uEACE,WACE,eApKiC,CAuKnC,kBACE,WAxKiC,CAyKjC,eAzKiC,EAwLrC,YACE,qBACA,oBACA,kBACA,gBACA,UACA,gBACA,cAhBoB,CAiBpB,mBACA,uBACA,WAjBkB,CAkBlB,gBAlBkB,CAmBlB,kBAfsB,CAgBtB,iBAhBsB,CAiBtB,0BACE,+BACA,iBAEF,4BACE,6BACA,gBAzBoB,CA2BtB,6BACE,4BACA,eA7BoB,CA+BtB,2BACE,8BACA,kBAGF,yBA/BF,YAgCI,cA1CkB,CA2ClB,WAzCgB,CA0ChB,gBA1CgB,CA2ChB,iBAvCoB,CAwCpB,gBAxCoB,CAyCpB,2CACA,4CA5CoB,CA6CpB,4CA7CoB,CA8CpB,8CAGF,wBACE,mBAEF,oBACE,mDAx+Na,CAy+Nb,0BACA,mBACA,WAEF,oBACE,mDA1+NY,CA2+NZ,0BACA,mBACA,UAIJ,aACE,gBACA,mBAGA,uBAGA,qBACE,mBAIF,kBACE,QAKJ,6BACE,sBACA,cACA,SACA,gBACA,UACA,kBAEA,yDACE,SACA,sBACA,OACA,SACA,kBACA,UACA,kBACA,QACA,MACA,iCAGF,sDACE,sBACA,WACA,cACA,SACA,UACA,UAGF,0DACE,sBACA,OACA,SACA,UACA,kBACA,QACA,MAKF,8EACE,gBACA,kBAGF,+EAGE,WApD6B,CAlzN/B,UAu2NiC,CAC/B,mBAv2NF,yFACE,UAq2NqC,CAp2NrC,SAo2N+B,CAKnC,qCACE,0GAhnOsB,CAknOxB,mBACE,0GAlnOsB,CAonOxB,mBACE,0GApnOsB,CAsnOxB,qCACE,2GAtnOsB,CAwnOxB,mBACE,2GAxnOsB,CA0nOxB,mBACE,4GA1nOsB,CA4nOxB,qCACE,4GA5nOsB,CA8nOxB,mBACE,4GA9nOsB,CAgoOxB,mBACE,4GAhoOsB,CAkoOxB,sCACE,6GAloOuB,CAooOzB,oBACE,6GApoOuB,CAsoOzB,oBACE,6GAtoOuB,CAwoOzB,sCACE,6GAxoOuB,CA0oOzB,oBACE,6GA1oOuB,CA4oOzB,oBACE,6GA5oOuB,CA8oOzB,oBACE,8GA9oOuB,CAgpOzB,oBACE,8GAhpOuB,CAkpOzB,oBACE,8GAlpOuB,CAopOzB,oBACE,8GAppOuB,CAspOzB,oBACE,+GAtpOuB,CAwpOzB,oBACE,+GAxpOuB,CA0pOzB,oBACE,+GA1pOuB,CA4pOzB,oBACE,+GA5pOuB,CA8pOzB,oBACE,+GA9pOuB,CAiqOzB,8CACE,cACE,uBAIJ,aACE,8BACE,uBAOJ,0EACE,wBAaF,4BACE,aACE,SACA,WACA,gBACA,aA/4MA,YACC,QAeD,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SAmBF,gFA5mBF,aA8mByD,CA7mBzD,wHACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,gFA5mBF,cA6mB+D,CA5mB/D,wHACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,oFACE,2BAeF,oFA7oBF,0BA8oBiD,CA7oBjD,4HACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,0CAGE,2BACA,sBACA,oBAIF,6HAME,2BAIF,kIAME,uBAIF,mHAME,yBAIF,gKAME,6BAIF,qKAME,8BAUF,gJAME,uBACA,yBAIF,qJAME,mBACA,qBACA,eAIF,+JAME,eACA,sBAIF,sIAME,qBACA,uBAIF,0JAME,oBACA,sBA9NF,mCAEA,+CACA,kDACA,+CACA,+CACA,mDACA,iDAME,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAGe,YAGjB,uBACE,cACA,eACA,cACA,sBArBF,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAMF,uBACE,cACA,eACA,cACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,UACE,cACA,eACA,gBACA,sBAGF,sBACE,cACA,eACA,gBACA,sBAMF,yBACE,cACA,eACA,gBACA,sBA2BF,8EACA,8EAIA,4FACA,4FAIA,+FACA,+FAIA,0FACA,0FAGA,8BAIA,6FACA,6FAGA,kCA9GF,mCACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,qCACA,+BAkPA,8CAGE,YAGF,mMAaE,YAIF,+KASE,aAKF,4CAGE,WAGF,0LAaE,WAIF,gJAQE,YAGF,aACE,eAGF,eACI,iBAGJ,aACE,SACA,WACA,gBACA,YAwgMJ,yBAGI,iEACE,aAz5MF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAu1MF,yBA/5MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCA61MF,+CAEI,sGACE,aAGJ,mDACE,aA56MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA02MF,yBAl7MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCAg3MF,gDAGI,+MACE,aAGJ,oEACE,aAh8MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA63MF,0BAr8MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCAk4MF,iDAGI,0VACE,aAGJ,qFACE,aAl9MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAg5MF,0BAx9MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,qCAxEE,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,kCAs5ME,ugBACE,aAGJ,sGACE,cAMJ,aAEE,wCACE,yBN13OJ,MACE,2BACA,4BACA,mCACA,8BACA,kCACA,6BACA,4BAIA,uCAEE,iBAUJ,eACE,kBAIF,oBACE,QACA,uBAGF,0BACE,uBACA,kBAGF,mBACE,eACA,iBACA,WACA,wBAEA,yBACE,cAIJ,yBACE,eACA,YAGF,uBACE,yBAGF,sCAEE,iBAGF,aACE,mBACA,gBACA,uBAIA,kBACE,gBACA,uBACA,mBAKF,2KAGE,yCACA,6CAKF,2BACE,qBAKF,iCACE,UACA,kCAGF,uCACE,mFAKA,mBAEA,6CACE,mFAQJ,kBACE,aACA,WACA,yBACA,cACA,yBACA,kBACA,eACA,kBACA,mBAEA,8BACE,kBACA,iBAGF,wCACE,WACA,YACA,cAEA,qBAIF,uDACE,gBAEA,4DACE,gBAMJ,yFAEE,eACA,YACA,SACA,wBACA,iBACA,aACA,uBACA,mBACA,uBACA,uGACE,eACA,YACA,WAIJ,+DAEE,eACA,sBACA,sLAEE,cACA,6BACA,qBAKF,wFAEE,cACA,cAIJ,uCACE,qBACA,+CACE,eAMR,gBACE,aACA,sBACA,qBACE,YACA,eACA,kBAIJ,cACE,YACA,aACA,gBACA,oBACA,8BAEA,4CAEE,eACA,kBACA,kGAEE,WAKN,MACE,WAGF,+CACE,sBACA,uBAGF,YACE,6BACA,sBACA,YACA,UACA,eACA,SACA,sBACA,sBACA,uBACA,0BACA,kBACA,iDACA,oDACA,4CACA,+EAEA,wEACA,qFAEA,qEAGF,yBACE,qBACA,UACA,8EAEA,iFAEA,yEAIF,kBACE,kCACA,kDACA,sBACA,2BACA,uCAGF,aACE,UAGF,YACE,kCACA,kDACA,sBACA,2BACA,uCAGF,yCAEE,cACA,6BACA,WACA,YACA,UACA,eACA,SACA,sBACA,iCACA,uBACA,0BACA,kBACA,4DACA,+DACA,uDACA,+EAEA,wEACA,qFAEA,qEAGF,wDACE,cAGF,sBACE,sBAGF,uCAEE,cAGF,0BACE,4BAGA,2BAGF,kFAKE,sBACA,uBACA,wBAGF,mCACE,sBACA,mBACA,wBACA,mBAGF,yDACE,kBACA,wBACA,sBAGF,oEACE,4BAGF,4EACE,6BACA,uBACA,2BAGF,8DACE,uBACA,2BAGF,wDACE,uBAGF,wFAIE,sBAGF,0FAIE,qBAGF,yDACE,mBACA,qBACA,YAGF,8EACE,sBACA,kBAGF,kBAEE,eACA,WACA,gBACA,YAOF,UAGE,6BAGF,yBACE,UACA,SACA,eACA,eAIF,QACE,cACA,WACA,YAKF,wBAEE,WAJoB,CAKpB,eALoB,CAQpB,eACA,UAGF,wBAEE,YACA,yBAGA,gBAEA,yBACA,wBACA,gBACA,sBAGF,uCACE,yBACA,cACA,gCAGF,qCACE,yBACA,wBACA,kBACA,gBAGF,wCACE,yBACA,wBACA,kBACA,gBAGF,0BACE,kBACA,YACA,UAGF,6CACE,qBACA,kBACA,gBACA,wBACA,sBACA,kBAGF,sDACE,qBAGF,2DACE,cAGF,+DACE,cAEF,oDACE,yDACA,WACA,kBACA,WACA,WACA,WACA,YACA,4BACA,4BACA,wBAGF,mDACE,eACA,iBACA,kBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,0CACE,qBACA,kBAGF,kDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,eACA,kBACA,gBACA,kBACA,WAGF,wCACE,qBAGF,yCACE,qBAGF,yCACE,qBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,iDACE,kBACA,yBACA,yBACA,QAGF,wDACE,WACA,WACA,yDACA,iCACA,yBAGF,gDACE,QACA,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,gDACE,iBACA,yBACA,yBACA,QAGF,uDACE,YACA,UACA,yDAGF,uBACE,WAIF,SACE,iBACA,yBAEA,gBACA,kBACA,cACA,aAGF,mBACE,cACA,gBACA,sBAGF,kBACE,WACA,YACA,kBAGF,6BACE,WACA,YACA,kBACA,OACA,MAGF,oCACE,WACA,cACA,cACA,UACA,WACA,sBACA,mBACA,oEACA,4DAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,qCACE,8BACA,sBAGF,qCACE,4BACA,oBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,YAGE,UAGF,IACE,WAIJ,8BACE,YAGE,UAGF,IACE,WAIJ,4CACE,uBAGF,4CACE,yBACA,cAGF,4CACE,qBAGF,gCACE,gBACA,YACA,kBACA,YAGF,mCACE,gCAGF,mCACE,8BAGF,gCACE,uDAEE,eAIJ,gCACE,uDAEE,cAIJ,mBACE,yBAGF,mBACE,uBAGF,YACE","sources":["webpack://motion-chat/./src/styles/app.scss","webpack://motion-chat/./node_modules/mdi/scss/_path.scss","webpack://motion-chat/./node_modules/mdi/scss/_core.scss","webpack://motion-chat/./node_modules/mdi/scss/_icons.scss","webpack://motion-chat/./node_modules/mdi/scss/_extras.scss","webpack://motion-chat/./node_modules/mdi/scss/_animated.scss","webpack://motion-chat/./node_modules/angular-material/angular-material.scss"],"names":[],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"styles/app.css","mappings":";;;;;;;;;;;;;;;;;;;;AAEQ,WCFR,mCACE,4CACA,wSACA,mBAKA,kBACA,sBCTF,oBAEE,yDACA,kBACA,oBACA,oBACA,mCACA,kCACA,0BCPE,eACI,kCADJ,eACI,qBADJ,eACI,2BADJ,eACI,yBADJ,eACI,iCADJ,eACI,kCADJ,eACI,2BADJ,eACI,4BADJ,eACI,6BADJ,eACI,0BADJ,eACI,2BADJ,eACI,2BADJ,eACI,yBADJ,eACI,8BADJ,eACI,2BADJ,eACI,8BADJ,eACI,oCADJ,eACI,sCADJ,eACI,mCADJ,eACI,2CADJ,eACI,6BADJ,eACI,yBADJ,eACI,6BADJ,eACI,0BADJ,eACI,kCADJ,eACI,4BADJ,eACI,4BADJ,eACI,8BADJ,eACI,sCADJ,eACI,0BADJ,eACI,4BADJ,eACI,sBADJ,eACI,oBADJ,eACI,6BADJ,eACI,wBADJ,eACI,sBADJ,eACI,8BADJ,eACI,0BADJ,eACI,8BADJ,eACI,qBADJ,eACI,qBADJ,eACI,mBADJ,eACI,wBADJ,eACI,yBADJ,eACI,yBADJ,eACI,4BADJ,eACI,uBADJ,eACI,wBADJ,eACI,0BADJ,eACI,mBADJ,eACI,mBADJ,eACI,uBADJ,eACI,0BADJ,eACI,kCADJ,eACI,4BADJ,eACI,2BADJ,eACI,4BADJ,eACI,2BADJ,eACI,mBADJ,eACI,2BADJ,eACI,kBADJ,eACI,mBADJ,eACI,0BADJ,eACI,uBADJ,eACI,oBADJ,eACI,+BADJ,eACI,uBADJ,eACI,uBADJ,eACI,oBADJ,eACI,qBADJ,eACI,kCADJ,eACI,0BADJ,eACI,4BADJ,eACI,qBADJ,eACI,uBADJ,eACI,uBADJ,eACI,mBADJ,eACI,mBADJ,eACI,0BADJ,eACI,uBADJ,eACI,iCADJ,eACI,oCADJ,eACI,oCADJ,eACI,mCADJ,eACI,kCADJ,eACI,4BADJ,eACI,0BADJ,eACI,yBADJ,eACI,sBADJ,eACI,kBADJ,eACI,qBADJ,eACI,mCADJ,eACI,oCADJ,eACI,mCADJ,eACI,kCADJ,eACI,uBADJ,eACI,+BADJ,eACI,gCADJ,eACI,4BADJ,eACI,gCADJ,eACI,iCADJ,eACI,uCADJ,eACI,iCADJ,eACI,kCADJ,eACI,+BADJ,eACI,qCADJ,eACI,wBADJ,eACI,6BADJ,eACI,iCADJ,eACI,yCADJ,eACI,oCADJ,eACI,4CADJ,eACI,6CADJ,eACI,4BADJ,eACI,oCADJ,eACI,4CADJ,eACI,8BADJ,eACI,0BADJ,eACI,8BADJ,eACI,+BADJ,eACI,qCADJ,eACI,+BADJ,eACI,gCADJ,eACI,6BADJ,eACI,mCADJ,eACI,wBADJ,eACI,6BADJ,eACI,iCADJ,eACI,yCADJ,eACI,oCADJ,eACI,4CADJ,eACI,6CADJ,eACI,4BADJ,eACI,oCADJ,eACI,4CADJ,eACI,8BADJ,eACI,yBADJ,eACI,8BADJ,eACI,kCADJ,eACI,0CADJ,eACI,qCADJ,eACI,6CADJ,eACI,8CADJ,eACI,6BADJ,eACI,qCADJ,eACI,6CADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,sBADJ,eACI,2BADJ,eACI,+BADJ,eACI,uCADJ,eACI,kCADJ,eACI,0CADJ,eACI,2CADJ,eACI,0BADJ,eACI,kCADJ,eACI,0CADJ,eACI,4BADJ,eACI,oBADJ,eACI,uBADJ,eACI,sBADJ,eACI,gBADJ,eACI,uBADJ,eACI,kBADJ,eACI,wBADJ,eACI,uBADJ,eACI,+BADJ,eACI,sBADJ,eACI,yBADJ,eACI,uBADJ,eACI,sBADJ,eACI,mBADJ,eACI,kBADJ,eACI,wBADJ,eACI,wBADJ,eACI,uBADJ,eACI,4BADJ,eACI,uBADJ,eACI,sBADJ,eACI,kBADJ,eACI,qBADJ,eACI,0BADJ,eACI,oBADJ,eACI,oBADJ,eACI,sBADJ,eACI,0BADJ,eACI,sBADJ,eACI,oBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,qBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,2BADJ,eACI,8BADJ,eACI,iCADJ,eACI,kCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,iCADJ,eACI,sCADJ,eACI,uCADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,0CADJ,eACI,6CADJ,eACI,+CADJ,eACI,2BADJ,eACI,8BADJ,eACI,6BADJ,eACI,0BADJ,eACI,8BADJ,eACI,6BADJ,eACI,mBADJ,eACI,oBADJ,eACI,mBADJ,eACI,uBADJ,eACI,kBADJ,eACI,qBADJ,eACI,kBADJ,eACI,sBADJ,eACI,0BADJ,eACI,uBADJ,eACI,uBADJ,eACI,+BADJ,eACI,wBADJ,eACI,kBADJ,eACI,mBADJ,eACI,kBADJ,eACI,kBADJ,eACI,wBADJ,eACI,iBADJ,eACI,uBADJ,eACI,uBADJ,eACI,qBADJ,eACI,wBADJ,eACI,wBADJ,eACI,qBADJ,eACI,oBADJ,eACI,0BADJ,eACI,qBADJ,eACI,uBADJ,eACI,6BADJ,eACI,+BADJ,eACI,2BADJ,eACI,gCADJ,eACI,gCADJ,eACI,kBADJ,eACI,yBADJ,eACI,sBADJ,eACI,yBADJ,eACI,kBADJ,eACI,sBADJ,eACI,kBADJ,eACI,kBADJ,eACI,wBADJ,eACI,2BADJ,eACI,mCADJ,eACI,uBADJ,eACI,oCADJ,eACI,+BADJ,eACI,uBADJ,eACI,yBADJ,eACI,2BADJ,eACI,0BADJ,eACI,sBADJ,eACI,4BADJ,eACI,4BADJ,eACI,8BADJ,eACI,2BADJ,eACI,mCADJ,eACI,6BADJ,eACI,qBADJ,eACI,uBADJ,eACI,wBADJ,eACI,gCADJ,eACI,2BADJ,eACI,mCADJ,eACI,0BADJ,eACI,+BADJ,eACI,2BADJ,eACI,yBADJ,eACI,iCADJ,eACI,yBADJ,eACI,iCADJ,eACI,4BADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,wBADJ,eACI,gCADJ,eACI,6BADJ,eACI,yBADJ,eACI,qBADJ,eACI,kBADJ,eACI,qBADJ,eACI,iBADJ,eACI,wBADJ,eACI,wBADJ,eACI,oBADJ,eACI,uBADJ,eACI,6BADJ,eACI,gCADJ,eACI,+BADJ,eACI,8BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,6BADJ,eACI,mBADJ,eACI,mBADJ,eACI,oBADJ,eACI,iBADJ,eACI,4BADJ,eACI,sBADJ,eACI,sBADJ,eACI,iBADJ,eACI,iCADJ,eACI,mCADJ,eACI,+BADJ,eACI,wBADJ,eACI,sBADJ,eACI,oBADJ,eACI,kBADJ,eACI,0BADJ,eACI,0BADJ,eACI,wBADJ,eACI,sBADJ,eACI,4BADJ,eACI,4BADJ,eACI,4BADJ,eACI,2BADJ,eACI,+BADJ,eACI,qCADJ,eACI,2BADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,2BADJ,eACI,4BADJ,eACI,uBADJ,eACI,wBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,uBADJ,eACI,2BADJ,eACI,+BADJ,eACI,2BADJ,eACI,oBADJ,eACI,0BADJ,eACI,4BADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,yBADJ,eACI,oCADJ,eACI,oCADJ,eACI,qCADJ,eACI,kCADJ,eACI,wBADJ,eACI,+BADJ,eACI,yBADJ,eACI,iCADJ,eACI,2BADJ,eACI,0BADJ,eACI,oBADJ,eACI,oBADJ,eACI,uBADJ,eACI,sBADJ,eACI,iBADJ,eACI,yBADJ,eACI,2BADJ,eACI,6BADJ,eACI,wBADJ,eACI,2BADJ,eACI,wBADJ,eACI,sBADJ,eACI,wBADJ,eACI,sBADJ,eACI,qBADJ,eACI,mBADJ,eACI,2BADJ,eACI,mCADJ,eACI,2BADJ,eACI,oBADJ,eACI,kBADJ,eACI,sBADJ,eACI,0BADJ,eACI,uBADJ,eACI,gCADJ,eACI,kBADJ,eACI,sBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,4BADJ,eACI,sBADJ,eACI,oBADJ,eACI,iBADJ,eACI,kBADJ,eACI,2BADJ,eACI,uBADJ,eACI,+BADJ,eACI,6BADJ,eACI,4BADJ,eACI,8BADJ,eACI,4BADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,yBADJ,eACI,0BADJ,eACI,uBADJ,eACI,8BADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,yBADJ,eACI,iCADJ,eACI,yBADJ,eACI,6BADJ,eACI,wBADJ,eACI,gCADJ,eACI,gCADJ,eACI,uBADJ,eACI,sCADJ,eACI,4BADJ,eACI,mBADJ,eACI,uBADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,4BADJ,eACI,mCADJ,eACI,2CADJ,eACI,oCADJ,eACI,mCADJ,eACI,6BADJ,eACI,oCADJ,eACI,4CADJ,eACI,qCADJ,eACI,qCADJ,eACI,4CADJ,eACI,oDADJ,eACI,6CADJ,eACI,sCADJ,eACI,6CADJ,eACI,qDADJ,eACI,8CADJ,eACI,0BADJ,eACI,6BADJ,eACI,0BADJ,eACI,wBADJ,eACI,0BADJ,eACI,wBADJ,eACI,yBADJ,eACI,wBADJ,eACI,iCADJ,eACI,iCADJ,eACI,kCADJ,eACI,+BADJ,eACI,0BADJ,eACI,0BADJ,eACI,2BADJ,eACI,wBADJ,eACI,uBADJ,eACI,0BADJ,eACI,wBADJ,eACI,kBADJ,eACI,oBADJ,eACI,oBADJ,eACI,4BADJ,eACI,yBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,6BADJ,eACI,kCADJ,eACI,kCADJ,eACI,6BADJ,eACI,qCADJ,eACI,4BADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,qCADJ,eACI,4BADJ,eACI,oBADJ,eACI,mBADJ,eACI,yBADJ,eACI,uBADJ,eACI,wBADJ,eACI,sBADJ,eACI,uBADJ,eACI,yBADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,2BADJ,eACI,mCADJ,eACI,2BADJ,eACI,4BADJ,eACI,mBADJ,eACI,0BADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,+BADJ,eACI,2BADJ,eACI,yBADJ,eACI,iCADJ,eACI,wBADJ,eACI,wBADJ,eACI,0BADJ,eACI,oBADJ,eACI,wBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,+BADJ,eACI,wCADJ,eACI,4BADJ,eACI,qCADJ,eACI,4BADJ,eACI,oCADJ,eACI,8BADJ,eACI,yBADJ,eACI,uBADJ,eACI,6BADJ,eACI,qBADJ,eACI,oBADJ,eACI,4BADJ,eACI,0BADJ,eACI,kBADJ,eACI,mBADJ,eACI,qBADJ,eACI,0BADJ,eACI,qBADJ,eACI,6BADJ,eACI,qCADJ,eACI,2BADJ,eACI,mCADJ,eACI,2BADJ,eACI,mCADJ,eACI,8BADJ,eACI,sCADJ,eACI,6BADJ,eACI,kCADJ,eACI,gCADJ,eACI,wCADJ,eACI,8BADJ,eACI,sCADJ,eACI,4BADJ,eACI,oCADJ,eACI,0BADJ,eACI,mCADJ,eACI,2CADJ,eACI,kCADJ,eACI,qBADJ,eACI,qBADJ,eACI,6BADJ,eACI,qBADJ,eACI,0BADJ,eACI,6BADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,yBADJ,eACI,+BADJ,eACI,2BADJ,eACI,0BADJ,eACI,8BADJ,eACI,kCADJ,eACI,mCADJ,eACI,sBADJ,eACI,0BADJ,eACI,6BADJ,eACI,oBADJ,eACI,uBADJ,eACI,kBADJ,eACI,qBADJ,eACI,iBADJ,eACI,mBADJ,eACI,sBADJ,eACI,yBADJ,eACI,kCADJ,eACI,6BADJ,eACI,8BADJ,eACI,8BADJ,eACI,kBADJ,eACI,uBADJ,eACI,4BADJ,eACI,2BADJ,eACI,yBADJ,eACI,yBADJ,eACI,wBADJ,eACI,4BADJ,eACI,mBADJ,eACI,kBADJ,eACI,0BADJ,eACI,uBADJ,eACI,2BADJ,eACI,iBADJ,eACI,qBADJ,eACI,uBADJ,eACI,qBADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,2BADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,8BADJ,eACI,4BADJ,eACI,oCADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,sBADJ,eACI,4BADJ,eACI,2BADJ,eACI,6BADJ,eACI,6BADJ,eACI,4BADJ,eACI,6BADJ,eACI,sBADJ,eACI,8BADJ,eACI,8BADJ,eACI,8BADJ,eACI,oBADJ,eACI,2BADJ,eACI,0BADJ,eACI,4BADJ,eACI,4BADJ,eACI,0BADJ,eACI,4BADJ,eACI,mBADJ,eACI,uBADJ,eACI,6BADJ,eACI,yBADJ,eACI,2BADJ,eACI,qBADJ,eACI,6BADJ,eACI,wBADJ,eACI,qBADJ,eACI,qBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,sBADJ,eACI,sBADJ,eACI,sBADJ,eACI,qBADJ,eACI,qBADJ,eACI,qBADJ,eACI,2BADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,6BADJ,eACI,qBADJ,eACI,kBADJ,eACI,wBADJ,eACI,oBADJ,eACI,4BADJ,eACI,sBADJ,eACI,0BADJ,eACI,iBADJ,eACI,iBADJ,eACI,4BADJ,eACI,gCADJ,eACI,oBADJ,eACI,mBADJ,eACI,oBADJ,eACI,oBADJ,eACI,kBADJ,eACI,yBADJ,eACI,uBADJ,eACI,4BADJ,eACI,6BADJ,eACI,oCADJ,eACI,2BADJ,eACI,kCADJ,eACI,oBADJ,eACI,sBADJ,eACI,8BADJ,eACI,kBADJ,eACI,6BADJ,eACI,2BADJ,eACI,qBADJ,eACI,yBADJ,eACI,sBADJ,eACI,0BADJ,eACI,mBADJ,eACI,qBADJ,eACI,oBADJ,eACI,kBADJ,eACI,sBADJ,eACI,yBADJ,eACI,mBADJ,eACI,uBADJ,eACI,2BADJ,eACI,uBADJ,eACI,kBADJ,eACI,mBADJ,eACI,sBADJ,eACI,+BADJ,eACI,4BADJ,eACI,sBADJ,eACI,mBADJ,eACI,yBADJ,eACI,wBADJ,eACI,gCADJ,eACI,2BADJ,eACI,0BADJ,eACI,2BADJ,eACI,kBADJ,eACI,sBADJ,eACI,2BADJ,eACI,2BADJ,eACI,4BADJ,eACI,8BADJ,eACI,4BADJ,eACI,8BADJ,eACI,2BADJ,eACI,0BADJ,eACI,6BADJ,eACI,oBADJ,eACI,4BADJ,eACI,mBADJ,eACI,uBADJ,eACI,oBADJ,eACI,4BADJ,eACI,uBADJ,eACI,sBADJ,eACI,sBADJ,eACI,4BADJ,eACI,gCADJ,eACI,kBADJ,eACI,wBADJ,eACI,wBADJ,eACI,sBADJ,eACI,yBADJ,eACI,yBADJ,eACI,oBADJ,eACI,iBADJ,eACI,qBADJ,eACI,6BADJ,eACI,yBADJ,eACI,sBADJ,eACI,8BADJ,eACI,0BADJ,eACI,kCADJ,eACI,wBADJ,eACI,gCADJ,eACI,kBADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,gCADJ,eACI,qBADJ,eACI,iBADJ,eACI,qBADJ,eACI,0BADJ,eACI,kCADJ,eACI,iBADJ,eACI,qBADJ,eACI,mBADJ,eACI,kBADJ,eACI,0BADJ,eACI,wBADJ,eACI,wBADJ,eACI,wBADJ,eACI,0BADJ,eACI,4BADJ,eACI,2BADJ,eACI,+BADJ,eACI,wBADJ,eACI,4BADJ,eACI,yBADJ,eACI,uBADJ,eACI,yBADJ,eACI,wBADJ,eACI,yBADJ,eACI,uBADJ,eACI,2BADJ,eACI,wBADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,0BADJ,eACI,uBADJ,eACI,6BADJ,eACI,iCADJ,eACI,mCADJ,eACI,2BADJ,eACI,0BADJ,eACI,uBADJ,eACI,uBADJ,eACI,wBADJ,eACI,uBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,uBADJ,eACI,2BADJ,eACI,oBADJ,eACI,4BADJ,eACI,2BADJ,eACI,mCADJ,eACI,4BADJ,eACI,qBADJ,eACI,0BADJ,eACI,yBADJ,eACI,kBADJ,eACI,wBADJ,eACI,qBADJ,eACI,kBADJ,eACI,kBADJ,eACI,4BADJ,eACI,0BADJ,eACI,2BADJ,eACI,0BADJ,eACI,kCADJ,eACI,mBADJ,eACI,wBADJ,eACI,0BADJ,eACI,uBADJ,eACI,2BADJ,eACI,2BADJ,eACI,wBADJ,eACI,4BADJ,eACI,mBADJ,eACI,yBADJ,eACI,iCADJ,eACI,2BADJ,eACI,oBADJ,eACI,0BADJ,eACI,2BADJ,eACI,wBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,4BADJ,eACI,6BADJ,eACI,iCADJ,eACI,0BADJ,eACI,wBADJ,eACI,gCADJ,eACI,yBADJ,eACI,8BADJ,eACI,yBADJ,eACI,6BADJ,eACI,mCADJ,eACI,qCADJ,eACI,4BADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,2BADJ,eACI,yBADJ,eACI,2BADJ,eACI,0BADJ,eACI,kBADJ,eACI,wBADJ,eACI,4BADJ,eACI,6BADJ,eACI,sBADJ,eACI,0BADJ,eACI,sBADJ,eACI,iCADJ,eACI,6BADJ,eACI,sBADJ,eACI,iCADJ,eACI,iCADJ,eACI,kCADJ,eACI,+BADJ,eACI,iCADJ,eACI,gCADJ,eACI,8BADJ,eACI,oCADJ,eACI,yBADJ,eACI,0BADJ,eACI,+BADJ,eACI,+BADJ,eACI,iCADJ,eACI,+BADJ,eACI,+BADJ,eACI,gCADJ,eACI,yBADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,oCADJ,eACI,iCADJ,eACI,oCADJ,eACI,iCADJ,eACI,4CADJ,eACI,0CADJ,eACI,2CADJ,eACI,oCADJ,eACI,oCADJ,eACI,2BADJ,eACI,iCADJ,eACI,+BADJ,eACI,gCADJ,eACI,kCADJ,eACI,uCADJ,eACI,gCADJ,eACI,iCADJ,eACI,+BADJ,eACI,0BADJ,eACI,8BADJ,eACI,4BADJ,eACI,gCADJ,eACI,+BADJ,eACI,8BADJ,eACI,4BADJ,eACI,yBADJ,eACI,kCADJ,eACI,0CADJ,eACI,8BADJ,eACI,gCADJ,eACI,yBADJ,eACI,yCADJ,eACI,yCADJ,eACI,0BADJ,eACI,8BADJ,eACI,0CADJ,eACI,0CADJ,eACI,uCADJ,eACI,gCADJ,eACI,gCADJ,eACI,+BADJ,eACI,oCADJ,eACI,mBADJ,eACI,2BADJ,eACI,qBADJ,eACI,wBADJ,eACI,oBADJ,eACI,2BADJ,eACI,kCADJ,eACI,+BADJ,eACI,kBADJ,eACI,wBADJ,eACI,6BADJ,eACI,sBADJ,eACI,8BADJ,eACI,qBADJ,eACI,6BADJ,eACI,oBADJ,eACI,0BADJ,eACI,yBADJ,eACI,0BADJ,eACI,yBADJ,eACI,kBADJ,eACI,mBADJ,eACI,yBADJ,eACI,wBADJ,eACI,uBADJ,eACI,mBADJ,eACI,2BADJ,eACI,yBADJ,eACI,gCADJ,eACI,gCADJ,eACI,qBADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,iCADJ,eACI,8BADJ,eACI,yBADJ,eACI,oCADJ,eACI,6BADJ,eACI,mBADJ,eACI,kBADJ,eACI,iBADJ,eACI,wBADJ,eACI,2BADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,uBADJ,eACI,0BADJ,eACI,yBADJ,eACI,wBADJ,eACI,uBADJ,eACI,qBADJ,eACI,mBADJ,eACI,mBADJ,eACI,kBADJ,eACI,qBADJ,eACI,oBADJ,eACI,8BADJ,eACI,8BADJ,eACI,8BADJ,eACI,2BADJ,eACI,4BADJ,eACI,wCADJ,eACI,qCADJ,eACI,kCADJ,eACI,+BADJ,eACI,mCADJ,eACI,0BADJ,eACI,0BADJ,eACI,0BADJ,eACI,yBADJ,eACI,yBADJ,eACI,yBADJ,eACI,2BADJ,eACI,0BADJ,eACI,2BADJ,eACI,iCADJ,eACI,yBADJ,eACI,yBADJ,eACI,6BADJ,eACI,8BADJ,eACI,2BADJ,eACI,iBADJ,eACI,sBADJ,eACI,qBADJ,eACI,2BADJ,eACI,kBADJ,eACI,wBADJ,eACI,sBADJ,eACI,mBADJ,eACI,6BADJ,eACI,6BADJ,eACI,yBADJ,eACI,iCADJ,eACI,6BADJ,eACI,wBADJ,eACI,uBADJ,eACI,iCADJ,eACI,oBADJ,eACI,sBADJ,eACI,sBADJ,eACI,wBADJ,eACI,4BADJ,eACI,4BADJ,eACI,iCADJ,eACI,qBADJ,eACI,0BADJ,eACI,yBADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,wBADJ,eACI,6BADJ,eACI,gCADJ,eACI,uBADJ,eACI,2BADJ,eACI,yBADJ,eACI,kBADJ,eACI,sBADJ,eACI,yBADJ,eACI,iCADJ,eACI,0BADJ,eACI,qBADJ,eACI,8BADJ,eACI,6BADJ,eACI,6BADJ,eACI,iCADJ,eACI,qBADJ,eACI,qBADJ,eACI,yBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,0BADJ,eACI,wBADJ,eACI,4BADJ,eACI,6BADJ,eACI,yBADJ,eACI,+BADJ,eACI,wBADJ,eACI,6BADJ,eACI,yBADJ,eACI,0BADJ,eACI,0BADJ,eACI,kBADJ,eACI,sBADJ,eACI,kBADJ,eACI,sBADJ,eACI,+BADJ,eACI,6BADJ,eACI,qBADJ,eACI,mBADJ,eACI,mBADJ,eACI,uBADJ,eACI,kBADJ,eACI,mBADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,6BADJ,eACI,2BADJ,eACI,wBADJ,eACI,+BADJ,eACI,4BADJ,eACI,2BADJ,eACI,uBADJ,eACI,mBADJ,eACI,yBADJ,eACI,wBADJ,eACI,8BADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,sCADJ,eACI,uCADJ,eACI,4CADJ,eACI,gCADJ,eACI,iCADJ,eACI,8BADJ,eACI,+BADJ,eACI,qCADJ,eACI,kCADJ,eACI,4BADJ,eACI,uBADJ,eACI,wBADJ,eACI,oBADJ,eACI,mBADJ,eACI,8BADJ,eACI,4BADJ,eACI,4BADJ,eACI,uBADJ,eACI,sBADJ,eACI,yBADJ,eACI,iCADJ,eACI,iCADJ,eACI,uBADJ,eACI,wBADJ,eACI,+BADJ,eACI,2BADJ,eACI,oBADJ,eACI,qBADJ,eACI,kBADJ,eACI,oBADJ,eACI,sBADJ,eACI,kBADJ,eACI,oBADJ,eACI,iBADJ,eACI,oBADJ,eACI,iBADJ,eACI,wBADJ,eACI,uBADJ,eACI,sBADJ,eACI,wBADJ,eACI,yBADJ,eACI,sBADJ,eACI,gCADJ,eACI,2BADJ,eACI,4BADJ,eACI,0BADJ,eACI,6BADJ,eACI,0BADJ,eACI,8BADJ,eACI,yBADJ,eACI,kBADJ,eACI,mBADJ,eACI,2BADJ,eACI,qBADJ,eACI,oBADJ,eACI,kBADJ,eACI,iBADJ,eACI,yBADJ,eACI,4BADJ,eACI,yBADJ,eACI,wBADJ,eACI,0BADJ,eACI,6BADJ,eACI,2BADJ,eACI,yBADJ,eACI,4BADJ,eACI,iCADJ,eACI,0BADJ,eACI,0BADJ,eACI,6BADJ,eACI,kCADJ,eACI,wBADJ,eACI,4BADJ,eACI,iCADJ,eACI,oBADJ,eACI,+BADJ,eACI,wBADJ,eACI,wBADJ,eACI,4BADJ,eACI,oBADJ,eACI,sBADJ,eACI,oBADJ,eACI,uBADJ,eACI,oBADJ,eACI,wBADJ,eACI,yBADJ,eACI,kBADJ,eACI,qBADJ,eACI,oBADJ,eACI,yBADJ,eACI,uBADJ,eACI,6BADJ,eACI,4BADJ,eACI,iCADJ,eACI,qBADJ,eACI,2BADJ,eACI,2BADJ,eACI,0BADJ,eACI,sBADJ,eACI,uBADJ,eACI,0BADJ,eACI,kCADJ,eACI,+BADJ,eACI,kBADJ,eACI,sBADJ,eACI,0BADJ,eACI,8BADJ,eACI,sBADJ,eACI,0BADJ,eACI,mBADJ,eACI,qBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,0BADJ,eACI,uBADJ,eACI,wBADJ,eACI,wBADJ,eACI,oBADJ,eACI,6BADJ,eACI,mBADJ,eACI,2BADJ,eACI,oBADJ,eACI,4BADJ,eACI,mBADJ,eACI,kBADJ,eACI,mBADJ,eACI,kBADJ,eACI,oBADJ,eACI,uBADJ,eACI,qBADJ,eACI,2BADJ,eACI,mCADJ,eACI,0BADJ,eACI,kCADJ,eACI,qBADJ,eACI,qBADJ,eACI,iBADJ,eACI,wBADJ,eACI,+BADJ,eACI,8BADJ,eACI,iCADJ,eACI,4BADJ,eACI,gCADJ,eACI,6BADJ,eACI,+BADJ,eACI,oBADJ,eACI,sBADJ,eACI,oBADJ,eACI,0BADJ,eACI,yBADJ,eACI,0BADJ,eACI,oBADJ,eACI,oBADJ,eACI,yBADJ,eACI,oBADJ,eACI,oBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,uBADJ,eACI,wBADJ,eACI,qBADJ,eACI,6BADJ,eACI,qBADJ,eACI,2BADJ,eACI,8BADJ,eACI,kCADJ,eACI,0BADJ,eACI,2BADJ,eACI,6BADJ,eACI,0BADJ,eACI,gCADJ,eACI,2BADJ,eACI,gCADJ,eACI,8BADJ,eACI,sCADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,oBADJ,eACI,uBADJ,eACI,4BADJ,eACI,sBADJ,eACI,wBADJ,eACI,8BADJ,eACI,4BADJ,eACI,gCADJ,eACI,6BADJ,eACI,iCADJ,eACI,gCADJ,eACI,oCADJ,eACI,wBADJ,eACI,uBADJ,eACI,uBADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,sBADJ,eACI,2BADJ,eACI,mBADJ,eACI,qBADJ,eACI,8BADJ,eACI,kBADJ,eACI,uBADJ,eACI,mBADJ,eACI,uBADJ,eACI,2BADJ,eACI,+BADJ,eACI,yBADJ,eACI,iCADJ,eACI,mBADJ,eACI,wBADJ,eACI,4BADJ,eACI,gCADJ,eACI,sBADJ,eACI,8BADJ,eACI,mBADJ,eACI,uBADJ,eACI,+BADJ,eACI,0BADJ,eACI,wBADJ,eACI,kCADJ,eACI,sCADJ,eACI,+BADJ,eACI,6BADJ,eACI,4BADJ,eACI,gCADJ,eACI,kCADJ,eACI,8BADJ,eACI,uBADJ,eACI,0BADJ,eACI,oBADJ,eACI,2BADJ,eACI,wBADJ,eACI,qBADJ,eACI,oBADJ,eACI,0BADJ,eACI,6BADJ,eACI,qBADJ,eACI,qBADJ,eACI,qBADJ,eACI,uBADJ,eACI,iBADJ,eACI,qBADJ,eACI,yBADJ,eACI,mBADJ,eACI,6BADJ,eACI,oBADJ,eACI,kBADJ,eACI,2BADJ,eACI,mCADJ,eACI,0BADJ,eACI,uBADJ,eACI,+BADJ,eACI,uBADJ,eACI,sBADJ,eACI,oCADJ,eACI,iBADJ,eACI,kBADJ,eACI,kBADJ,eACI,qBADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,2BADJ,eACI,4CADJ,eACI,mCADJ,eACI,gCADJ,eACI,iDADJ,eACI,wCADJ,eACI,iBADJ,eACI,uBADJ,eACI,iBADJ,eACI,qBADJ,eACI,6BADJ,eACI,sBADJ,eACI,8BADJ,eACI,2BADJ,eACI,oBADJ,eACI,iBADJ,eACI,6BADJ,eACI,mBADJ,eACI,sBADJ,eACI,qBADJ,eACI,yBADJ,eACI,qBADJ,eACI,yBADJ,eACI,yBADJ,eACI,oBADJ,eACI,mBADJ,eACI,mBADJ,eACI,sBADJ,eACI,8BADJ,eACI,iBADJ,eACI,qBADJ,eACI,0BADJ,eACI,wBADJ,eACI,6BADJ,eACI,oCADJ,eACI,wBADJ,eACI,uBADJ,eACI,8BADJ,eACI,gCADJ,eACI,gCADJ,eACI,sCADJ,eACI,uCADJ,eACI,qBADJ,eACI,8BADJ,eACI,4BADJ,eACI,mBADJ,eACI,qBADJ,eACI,sBADJ,eACI,8BADJ,eACI,iCADJ,eACI,+BADJ,eACI,iCADJ,eACI,gCADJ,eACI,uBADJ,eACI,qBADJ,eACI,sBADJ,eACI,qBADJ,eACI,mBADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,mCADJ,eACI,iBADJ,eACI,qBADJ,eACI,oBADJ,eACI,mBADJ,eACI,iBADJ,eACI,oBADJ,eACI,wBADJ,eACI,gCADJ,eACI,2BADJ,eACI,mCADJ,eACI,yBADJ,eACI,wBADJ,eACI,sBADJ,eACI,8BADJ,eACI,qBADJ,eACI,4BADJ,eACI,gCADJ,eACI,uBADJ,eACI,sBADJ,eACI,mBADJ,eACI,6BADJ,eACI,2BADJ,eACI,2BADJ,eACI,0BADJ,eACI,2BADJ,eACI,4BADJ,eACI,0BADJ,eACI,uBADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,0BADJ,eACI,wBADJ,eACI,0BADJ,eACI,oCADJ,eACI,mCADJ,eACI,4BADJ,eACI,wBADJ,eACI,gBADJ,eACI,oBADJ,eACI,mBADJ,eACI,qBADJ,eACI,kBADJ,eACI,wBADJ,eACI,iBADJ,eACI,kBADJ,eACI,oBADJ,eACI,iBADJ,eACI,qBADJ,eACI,uBADJ,eACI,2BADJ,eACI,uBADJ,eACI,2BADJ,eACI,kBADJ,eACI,+BADJ,eACI,uBADJ,eACI,oBADJ,eACI,oBADJ,eACI,mBADJ,eACI,0BADJ,eACI,kBADJ,eACI,8BADJ,eACI,yBADJ,eACI,iCADJ,eACI,0BADJ,eACI,wBADJ,eACI,oCADJ,eACI,4BADJ,eACI,4BADJ,eACI,2BADJ,eACI,2BADJ,eACI,6BADJ,eACI,yBADJ,eACI,kBADJ,eACI,kBADJ,eACI,sBADJ,eACI,8BADJ,eACI,yBADJ,eACI,0CADJ,eACI,iCADJ,eACI,0BADJ,eACI,sBADJ,eACI,0BADJ,eACI,oBADJ,eACI,sBADJ,eACI,wBADJ,eACI,sBADJ,eACI,kBADJ,eACI,sBADJ,eACI,qBADJ,eACI,kBADJ,eACI,qBADJ,eACI,iBADJ,eACI,qBADJ,eACI,mBADJ,eACI,uBADJ,eACI,mBADJ,eACI,wBADJ,eACI,4BADJ,eACI,4BADJ,eACI,0BADJ,eACI,6BADJ,eACI,6BADJ,eACI,6BADJ,eACI,0BADJ,eACI,0BADJ,eACI,+BADJ,eACI,qBADJ,eACI,wBADJ,eACI,2BADJ,eACI,8BADJ,eACI,2BADJ,eACI,0BADJ,eACI,kCADJ,eACI,uBADJ,eACI,8BADJ,eACI,qBADJ,eACI,mBADJ,eACI,oBADJ,eACI,oBADJ,eACI,oBADJ,eACI,yBADJ,eACI,yBADJ,eACI,wBADJ,eACI,0BADJ,eACI,uBADJ,eACI,mBADJ,eACI,sBADJ,eACI,mBADJ,eACI,4BADJ,eACI,yBADJ,eACI,yBADJ,eACI,4BADJ,eACI,6BADJ,eACI,yBADJ,eACI,qBADJ,eACI,2BADJ,eACI,uBADJ,eACI,6BADJ,eACI,2BADJ,eACI,wBADJ,eACI,mBADJ,eACI,kBADJ,eACI,qBADJ,eACI,oBADJ,eACI,wBADJ,eACI,qBADJ,eACI,oBADJ,eACI,kBADJ,eACI,0BADJ,eACI,qBADJ,eACI,mBADJ,eACI,4BADJ,eACI,oBADJ,eACI,sBADJ,eACI,oBADJ,eACI,4BADJ,eACI,wBADJ,eACI,gCADJ,eACI,8BADJ,eACI,oBADJ,eACI,wBADJ,eACI,yBADJ,eACI,oBADJ,eACI,mBADJ,eACI,uBADJ,eACI,0BADJ,eACI,iCADJ,eACI,wBADJ,eACI,qBADJ,eACI,qBADJ,eACI,oBADJ,eACI,4BADJ,eACI,qBADJ,eACI,6BADJ,eACI,oBADJ,eACI,kBADJ,eACI,kBADJ,eACI,kBADJ,eACI,0BADJ,eACI,mBADJ,eACI,oBADJ,eACI,0BADJ,eACI,oBADJ,eACI,uBADJ,eACI,yBADJ,eACI,iCADJ,eACI,0BADJ,eACI,kCADJ,eACI,4BADJ,eACI,6BADJ,eACI,oBADJ,eACI,oBADJ,eACI,iBADJ,eACI,qBADJ,eACI,mBADJ,eACI,iBADJ,eACI,sBADJ,eACI,kBADJ,eACI,wBADJ,eACI,kBADJ,eACI,uBADJ,eACI,+BADJ,eACI,qBADJ,eACI,uBADJ,eACI,mBADJ,eACI,2BADJ,eACI,4BADJ,eACI,qBADJ,eACI,oBADJ,eACI,6BADJ,eACI,kCADJ,eACI,yBADJ,eACI,oBADJ,eACI,gBADJ,eACI,kBADJ,eACI,wBADJ,eACI,uBADJ,eACI,8BADJ,eACI,mCADJ,eACI,gCADJ,eACI,iCADJ,eACI,kCADJ,eACI,gCADJ,eACI,iCADJ,eACI,sBADJ,eACI,8BADJ,eACI,2BADJ,eACI,8BADJ,eACI,oBADJ,eACI,wBADJ,eACI,4BADJ,eACI,wBADJ,eACI,uBADJ,eACI,2BADJ,eACI,kBADJ,eACI,yBADJ,eACI,yBADJ,eACI,oBADJ,eACI,0BADJ,eACI,4BADJ,eACI,gCADJ,eACI,wBADJ,eACI,yBADJ,eACI,2BADJ,eACI,6BADJ,eACI,qBADJ,eACI,wBADJ,eACI,8BADJ,eACI,sBADJ,eACI,6BADJ,eACI,4BADJ,eACI,sBADJ,eACI,uBADJ,eACI,sBADJ,eACI,0BADJ,eACI,8BADJ,eACI,mBADJ,eACI,+BADJ,eACI,2BADJ,eACI,wBADJ,eACI,gCADJ,eACI,kCADJ,eACI,+BADJ,eACI,mBADJ,eACI,2BADJ,eACI,oBADJ,eACI,8BADJ,eACI,4BADJ,eACI,wBADJ,eACI,sBADJ,eACI,4BADJ,eACI,oBADJ,eACI,wBADJ,eACI,sBADJ,eACI,qBADJ,eACI,8BADJ,eACI,6BADJ,eACI,mBADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,uBADJ,eACI,oBADJ,eACI,uBADJ,eACI,uBADJ,eACI,uBADJ,eACI,+BADJ,eACI,+BADJ,eACI,+BADJ,eACI,qCADJ,eACI,yBADJ,eACI,8BADJ,eACI,wBADJ,eACI,4BADJ,eACI,wBADJ,eACI,6BADJ,eACI,8BADJ,eACI,gCADJ,eACI,iBADJ,eACI,uBADJ,eACI,qBADJ,eACI,qBADJ,eACI,2BADJ,eACI,0BADJ,eACI,uBADJ,eACI,8BADJ,eACI,sCADJ,eACI,2BADJ,eACI,kCADJ,eACI,0CADJ,eACI,mBADJ,eACI,mBADJ,eACI,4BADJ,eACI,mBADJ,eACI,mBADJ,eACI,uBADJ,eACI,qBADJ,eACI,yBADJ,eACI,sBADJ,eACI,uBADJ,eACI,qBADJ,eACI,oBADJ,eACI,0BADJ,eACI,kBADJ,eACI,mBADJ,eACI,kBADJ,eACI,+BADJ,eACI,4BADJ,eACI,6BADJ,eACI,0BADJ,eACI,0BADJ,eACI,wBADJ,eACI,2BADJ,eACI,2BADJ,eACI,+BADJ,eACI,qCADJ,eACI,iCADJ,eACI,sCADJ,eACI,iCADJ,eACI,4CADJ,eACI,yBADJ,eACI,0BADJ,eACI,yBADJ,eACI,uBADJ,eACI,qBADJ,eACI,yBADJ,eACI,8BADJ,eACI,yBADJ,eACI,wBADJ,eACI,qBADJ,eACI,uBADJ,eACI,4BADJ,eACI,mBADJ,eACI,oBADJ,eACI,wBADJ,eACI,6BADJ,eACI,4BADJ,eACI,yBADJ,eACI,iBADJ,eACI,4BADJ,eACI,2BADJ,eACI,qBADJ,eACI,oBADJ,eACI,iCADJ,eACI,kBADJ,eACI,yBADJ,eACI,uBADJ,eACI,sBADJ,eACI,0BADJ,eACI,mBADJ,eACI,sBADJ,eACI,2BADJ,eACI,6BADJ,eACI,0BADJ,eACI,4BADJ,eACI,yBADJ,eACI,qBADJ,eACI,2BADJ,eACI,sBADJ,eACI,kBADJ,eACI,yBADJ,eACI,iCADJ,eACI,mBADJ,eACI,2BADJ,eACI,mBADJ,eACI,qCADJ,eACI,sCADJ,eACI,oBADJ,eACI,4BADJ,eACI,oBADJ,eACI,wBADJ,eACI,4BADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,gCADJ,eACI,iBADJ,eACI,6BADJ,eACI,qCADJ,eACI,2BADJ,eACI,mCADJ,eACI,kBADJ,eACI,oBADJ,eACI,mBADJ,eACI,yBADJ,eACI,kBADJ,eACI,wBADJ,eACI,sBADJ,eACI,iBADJ,eACI,sBADJ,eACI,4BADJ,eACI,mBADJ,eACI,0BADJ,eACI,qCADJ,eACI,sCADJ,eACI,iCADJ,eACI,gCADJ,eACI,wBADJ,eACI,yBADJ,eACI,+BADJ,eACI,uBADJ,eACI,8BADJ,eACI,kCADJ,eACI,mCADJ,eACI,8BADJ,eACI,4BADJ,eACI,oBADJ,eACI,4BADJ,eACI,yBADJ,eACI,kBADJ,eACI,iBADJ,eACI,uBADJ,eACI,uBADJ,eACI,0BADJ,eACI,yBADJ,eACI,sBADJ,eACI,wBADJ,eACI,8BADJ,eACI,oBADJ,eACI,kBADJ,eACI,mBADJ,eACI,wBADJ,eACI,sBADJ,eACI,wBADJ,eACI,4BADJ,eACI,gCADJ,eACI,oCADJ,eACI,8BADJ,eACI,4BADJ,eACI,iCADJ,eACI,oCADJ,eACI,gCADJ,eACI,oBADJ,eACI,kBADJ,eACI,qBADJ,eACI,uBADJ,eACI,yBADJ,eACI,4BADJ,eACI,gCADJ,eACI,qBADJ,eACI,8BADJ,eACI,qBADJ,eACI,qBADJ,eACI,8BADJ,eACI,yBADJ,eACI,+BADJ,eACI,4BADJ,eACI,4BADJ,eACI,oCADJ,eACI,wBADJ,eACI,gCADJ,eACI,sBADJ,eACI,8BADJ,eACI,4BADJ,eACI,oBADJ,eACI,4BADJ,eACI,iCADJ,eACI,4BADJ,eACI,iBADJ,eACI,mBADJ,eACI,uBADJ,eACI,mBADJ,eACI,sBADJ,eACI,qBADJ,eACI,uBADJ,eACI,wBADJ,eACI,8BADJ,eACI,6BADJ,eACI,uBADJ,eACI,2BADJ,eACI,+BADJ,eACI,qBADJ,eACI,0BADJ,eACI,2BADJ,eACI,6BADJ,eACI,kCADJ,eACI,0BADJ,eACI,mBADJ,eACI,2BADJ,eACI,iBADJ,eACI,yBADJ,eACI,wBADJ,eACI,oBADJ,eACI,sBADJ,eACI,qBADJ,eACI,2BADJ,eACI,mBADJ,eACI,2BADJ,eACI,kBADJ,eACI,wBADJ,eACI,8BADJ,eACI,sBADJ,eACI,8BADJ,eACI,uBADJ,eACI,4BADJ,eACI,kBADJ,eACI,oBADJ,eACI,2BADJ,eACI,8BADJ,eACI,yBADJ,eACI,sBADJ,eACI,8BADJ,eACI,oBADJ,eACI,0BADJ,eACI,4BADJ,eACI,4BADJ,eACI,oCADJ,eACI,mBADJ,eACI,4BADJ,eACI,wBADJ,eACI,2BADJ,eACI,yBADJ,eACI,sBADJ,eACI,oBADJ,eACI,2BADJ,eACI,kBADJ,eACI,2BADJ,eACI,oBADJ,eACI,qBADJ,eACI,yBADJ,eACI,4BADJ,eACI,6BADJ,eACI,kBADJ,eACI,oBADJ,eACI,mCADJ,eACI,qBADJ,eACI,sBADJ,eACI,8BADJ,eACI,kBADJ,eACI,0BADJ,eACI,oCADJ,eACI,kCADJ,eACI,oCADJ,eACI,kCADJ,eACI,qBADJ,eACI,mBADJ,eACI,qBADJ,eACI,oBADJ,eACI,oBADJ,eACI,6BADJ,eACI,4BADJ,eACI,iBADJ,eACI,2BADJ,eACI,yBADJ,eACI,oBADJ,eACI,kCADJ,eACI,kCADJ,eACI,2BADJ,eACI,mCADJ,eACI,4BADJ,eACI,0BADJ,eACI,+BADJ,eACI,kCADJ,eACI,kCADJ,eACI,4BADJ,eACI,iCADJ,eACI,yBADJ,eACI,0BADJ,eACI,4BADJ,eACI,6BADJ,eACI,2BADJ,eACI,8BADJ,eACI,8BADJ,eACI,2BADJ,eACI,6BADJ,eACI,0BADJ,eACI,mBADJ,eACI,sBADJ,eACI,qBADJ,eACI,mBADJ,eACI,sBADJ,eACI,0BADJ,eACI,iCADJ,eACI,mCADJ,eACI,8BADJ,eACI,gCADJ,eACI,uBADJ,eACI,0BADJ,eACI,yBADJ,eACI,wBADJ,eACI,2BADJ,eACI,yBADJ,eACI,4BADJ,eACI,oCADJ,eACI,sBADJ,eACI,uBADJ,eACI,2BADJ,eACI,uBADJ,eACI,yBADJ,eACI,2BADJ,eACI,wBADJ,eACI,6BADJ,eACI,yBADJ,eACI,uBADJ,eACI,mBADJ,eACI,oBADJ,eACI,6BADJ,eACI,0BADJ,eACI,gBADJ,eACI,oBADJ,eACI,uBADJ,eACI,iBADJ,eACI,mBADJ,eACI,uBADJ,eACI,yBADJ,eACI,wBADJ,eACI,2BADJ,eACI,0BADJ,eACI,yBADJ,eACI,wBADJ,eACI,yBADJ,eACI,iBADJ,eACI,mBADJ,eACI,kBADJ,eACI,kBADJ,eACI,oBADJ,eACI,6BADJ,eACI,+BADJ,eACI,2BADJ,eACI,iBADJ,eACI,6BADJ,eACI,mBADJ,eACI,0BADJ,eACI,kCADJ,eACI,0BADJ,eACI,kCADJ,eACI,2BADJ,eACI,2BADJ,eACI,mBADJ,eACI,uBADJ,eACI,2BADJ,eACI,wBADJ,eACI,uBADJ,eACI,mBADJ,eACI,4BADJ,eACI,yBADJ,eACI,0BADJ,eACI,+BADJ,eACI,+BADJ,eACI,qCADJ,eACI,2BADJ,eACI,kCADJ,eACI,6BADJ,eACI,2BADJ,eACI,2BADJ,eACI,iCADJ,eACI,2BADJ,eACI,4BADJ,eACI,iCADJ,eACI,+BADJ,eACI,2BADJ,eACI,mCADJ,eACI,iBADJ,eACI,oBADJ,eACI,qBADJ,eACI,qBADJ,eACI,oBADJ,eACI,oBADJ,eACI,6BADJ,eACI,sBADJ,eACI,sCADJ,eACI,gCADJ,eACI,wCADJ,eACI,sCADJ,eACI,iCADJ,eACI,qBADJ,eACI,kBADJ,eACI,sBADJ,eACI,iBADJ,eACI,kBADJ,eACI,uBADJ,eACI,0BADJ,eACI,2BADJ,eACI,6BADJ,eACI,6BADJ,eACI,yBADJ,eACI,4BADJ,eACI,qBADJ,eACI,uBADJ,eACI,oBADJ,eACI,kBADJ,eACI,oBADJ,eACI,wBADJ,eACI,qBADJ,eACI,6BADJ,eACI,kBADJ,eACI,kBADJ,eACI,6BADJ,eACI,2CADJ,eACI,2CADJ,eACI,0CADJ,eACI,yCADJ,eACI,4CADJ,eACI,6CADJ,eACI,iCADJ,eACI,iBADJ,eACI,kBADJ,eACI,sBADJ,eACI,yBADJ,eACI,iBADJ,eACI,kBADJ,eACI,oBADJ,eACI,mBADJ,eACI,kBADJ,eACI,sBADJ,eACI,oCADJ,eACI,4BADJ,eACI,0BADJ,eACI,wBADJ,eACI,qBADJ,eACI,mBAIR,WACI,kBACA,wCCLI,cAEI,wCAFJ,cAEI,wCAFJ,cAEI,wCAFJ,cAEI,kBAMR,qBACI,+BAEJ,qBACI,mBAIJ,UACI,gCAEJ,0BACI,uBAOA,+BACI,4BACA,wBACA,uBAHJ,+BACI,4BACA,wBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,wBAHJ,gCACI,6BACA,yBACA,oBAoBZ,4BACI,qBACA,aACA,mBACA,oBAEJ,4BACI,qBACA,aACA,mBACA,kBC9DJ,6CACI,sCACQ,6BAGZ,GACI,8BACE,uBACQ,MAEV,gCACE,yBACQ,sBAId,GACI,8BACE,uBACQ,MAEV,gCACE,yBACQ;;;;;ECxBd,CAmkBA,UACE,YACA,kBAGF,KACE,SACA,UAGF,sBACE,aAEF,OACE,aAGF,iCAEE,mBACA,yBACA,gBACA,YACA,UACA,SAGF,6BAIE,wBAIF,oEAIE,eACA,0BAEA,4GACE,eAIJ,SACE,mBACA,cAIA,mBACE,6BACA,uBACA,+BAEA,+FAEE,wBAGJ,uBACE,iBAIJ,oBACE,SACA,mBACA,WACA,YACA,gBACA,UACA,kBACA,oBACA,UAGF,WACE,kBACA,MACA,OACA,SACA,QACA,sBACA,oBAGF,sBA7bE,uCAgcF,sBA5bE,sCAgcF,8BACE,wDAOF,qBACE,oBACA,kBACA,gBACA,OACA,MACA,WACA,YACA,qDAGF,WAEE,kBACA,yCACA,yBACA,UACA,kBACA,4BACE,sRAOF,4BACE,yCAEF,mFACE,WAEF,4BACE,gEAKJ,4BACE,eACA,gBAGF,YACE,YAGF,WACE,WAGF,gBACE,kBACA,6BACA,MACA,QACA,SACA,OACA,UA5oBoB,CA8oBpB,oCACE,cACA,kBACA,yBACA,QACA,MACA,SACA,UAppBsB,CAqpBtB,wCAMJ,gBACE,gCAKF,eACE,yBAGF,yBACE,YACE,cAOF,wDACG,mBAIL,aACE,cACA,2BAEF,aACE,cACA,2BApQA,yBA6CE,4IAnQF,gBA5K0B,CA6K1B,gKACE,aAkQ2E,CAjQ3E,iBA/KwB,EAwY1B,+CAuCE,mRAnQF,gBA5K0B,CA6K1B,iTACE,aAkQ2E,CAjQ3E,iBA/KwB,EA+Y1B,gDAgCE,6ZAnQF,gBA5K0B,CA6K1B,qcACE,aAkQ2E,CAjQ3E,iBA/KwB,EAuZ1B,iDAwBE,ikBAnQF,gBA5K0B,CA6K1B,mnBACE,aAkQ2E,CAjQ3E,iBA/KwB,EAga1B,0BAeE,mzBAnQF,gBA5K0B,CA6K1B,+2BACE,aAkQ2E,CAjQ3E,iBA/KwB,EAipB5B,UACE,0CACA,8BAEA,gBAEA,8BACA,0BAEA,mCACA,kCAMF,cACE,eAhyByB,CAiyBzB,gBACA,uBACA,iBAnyByB,CAqyB3B,cACE,cAryByB,CAsyBzB,gBACA,wBACA,gBAxyByB,CA0yB3B,cACE,cA1yByB,CA2yBzB,gBACA,iBAEF,cACE,cA9yByB,CA+yBzB,gBACA,iBAEF,aACE,cAlzByB,CAmzBzB,gBACA,iBAEF,UA/kBE,cAtOyB,CAuOzB,gBACA,sBAglBF,YA9jBE,cAzPyB,CA0PzB,gBACA,qBACA,iBAikBF,WAllBE,cAzOyB,CA0OzB,gBACA,qBACA,iBAklBF,WA9kBE,cAhPyB,CAiPzB,gBACA,qBACA,iBA8kBF,YACE,cAj0ByB,CAk0BzB,qBAEF,WACE,qBAOF,kCAKE,8CAl2BY,CAq2Bd,6BAIE,eA2bF,wBACE,YACA,OACA,kBACA,MACA,WAGF,wBACE,eAGF,qBACE,aAGF,kBACE,aAIF,2BACE,UACA,gBAGF,UACE,UACA,kBAEA,0BAGE,UACA,gBAGF,kCACE,UACA,6CA7tCa,CAguCf,kCACE,UACA,6CA9tCa,CAiuCf,2EAEE,UAGF,6BACE,YACA,eACA,WAGF,2BACE,YACA,kDAGF,2BACE,kDAIJ,sBACE,gBACA,OACA,gBACA,eACA,eACA,MAQF,gBACE,kBACA,cACA,YACA,kBACA,iBACA,gBAEE,gCACE,eAGJ,mCACE,gBACA,uBACA,YAEA,sDACE,iBAEF,wDACE,YAIA,gEACE,cACA,kBACA,QACA,QA/BuB,CAgCvB,UAjCqB,CAkCrB,WAlCqB,CAqCvB,+DAtmCJ,kBAikC2B,CAhkC3B,yEACE,eAsmCgF,CArmChF,iBA8jCyB,CA2C3B,qCAEE,aACA,mBACA,sBAEA,kBACA,iBACA,YACA,qDACE,WAGF,mGAGE,WACA,sBACA,YAGF,wDACE,kBACA,YACA,OAEA,kEACE,YACA,UACA,SACA,WAEF,+EACE,kBACA,MACA,OACA,WACA,WACA,gBAEA,6FACE,gBACA,WAEF,wFACE,+BACA,wGACE,UAGJ,wFACE,+BACA,wGACE,UAMV,qCAvvCA,eAEA,sBACA,YACA,gBACA,aACA,uBAmvCE,WACA,eACA,iBACA,YAnvCF,gDACE,aAovCF,6CACE,kBACA,iBACA,kBACA,UAjHyB,CAkHzB,WAlHyB,CAmHzB,eACA,YACA,kBACA,UACA,eACA,uBACA,gBACA,mDACE,WACA,kBACA,SACA,WACA,YACA,UACA,kBACA,mBACA,UACA,mDAz5CW,CA25Cb,mDACE,aAEA,yDACE,mBACA,UAGJ,qDACE,kBACA,QACA,SACA,gDACA,0DACE,eAGJ,sDACE,mBACA,mCACA,sEACE,mBAGJ,sDACE,mCACA,sEACE,mBAKN,8CAGE,sBACE,sBAEF,kDACE,YAKN,qIAEE,kBACA,qCACA,WA79CgB,CAi+ChB,YAEA,2JACE,iBAIJ,4BACE,sBACA,cACA,SACA,gBACA,gBACA,UAGF,mFAEE,WA7M4B,CAgN9B,6BACE,SACA,gBACA,UAEA,yDACE,eACA,gBACA,eACA,gBAzN0B,CA0N1B,WA1N0B,CA2N1B,kCACA,SACA,mBACA,uBAEA,+DACE,aAGF,oFACE,eAMN,8CACE,6CAEE,uBAOJ,YACE,yBAEA,kBACA,MACA,SACA,OACA,QAEA,UA3hDiB,CA6hDjB,6BACE,0BACA,WAEF,+BACE,WACA,sBAEF,+BACE,WAEF,qCACE,WAEF,gCACE,WAIF,6BACE,kBAGF,sBAEE,YAEA,+BACE,UAEF,yDACE,YAEF,+BACE,YACA,yBAEF,yDACE,UAeN,gBACE,kBACA,OACA,QACA,SACA,2BACA,UA5lDqB,CA8lDrB,qBACA,uBAEA,kCACA,mDArlDe,CAslDf,8BAEA,8BACE,cAGF,yBACE,UACA,kCAGF,gCACE,UACA,cACA,6CAIF,gCACE,6CACA,mDAtmDY,CAymDd,8BACE,6BACA,8CA7sDU,CA8sDV,gBA1CyB,CA2CzB,UACA,mBAGF,+BACE,qBACA,YACA,WACA,UAGF,6BACE,aACA,aAEA,mCACE,eAKF,qCACE,UACA,mBACA,WArE0B,CA4E9B,wBACE,kBACA,mBACA,cAEA,gCACE,aACA,mBACA,eACA,mBACA,mBAGF,qCACE,sBACA,mBACA,mBAEA,YAEA,cA5uDqB,CA6uDrB,iBA7uDqB,CA+vDrB,yBA1BF,qCAaI,wBACA,wBAFQ,CAKN,yDACE,uBAEF,qDACE,sBASN,gDA9BF,qCAaI,aACA,aAFQ,EAsBV,iDAlCF,qCAaI,wBACA,wBAFQ,EA0BV,0BAtCF,qCAaI,wBACA,wBAFQ,EA+BV,6CACE,aAGF,2DACE,aACA,sBACA,mBACA,WACA,oBAGF,2DACE,6BACA,aACA,sBACA,mBACA,WAGF,mDACE,eAtJwB,CAuJxB,iBACA,eACA,SACA,mBACA,WACA,kBACA,oBACA,gBAOR,8CACE,gBACE,uBA+BJ,mCACE,SAGF,WACE,qBACA,kBACA,eA33CA,eAk2CmB,CA6BnB,cA1BiB,CAr2CjB,gBAk2CmB,CAgCnB,sBACA,mBACA,kBAEA,iBA3CqB,CA4CrB,sBAGA,iBACA,aACA,SAGA,aAzCe,CA0Cf,cA5Cc,CA8Cd,uBACA,mBACA,mBAGA,yBACA,gBAx5CA,cAveyB,CAi4DzB,mBACA,qBACA,oBACA,qBAGA,gBAEA,iHAj6CA,mHAEE,eAg2CuB,CAl2CzB,mHAEE,gBAg2CuB,CAl2CzB,mHAEE,cA61CqB,CAqEvB,iBACE,aAGF,kCACE,qBAMF,uCACE,gBAGF,uBACE,gBAGF,mBACE,UACA,gBAIA,qCA7tDF,uCAkuDA,0BACE,aACA,WAt0DiB,CAu0DjB,YACA,gBA/5DQ,CAg6DR,WAz6DuB,CA06DvB,UAz0DgB,CA00DhB,iBA9GuB,CAiHzB,kBAKE,UAn3DU,CAq3DV,gBA1GqB,CA4GrB,YACA,UAp1De,CAq1Df,WAp1DgB,CAq1DhB,sBAxvDF,uCA2vDE,iBAhIuB,CAiIvB,4BACA,gBAEA,mDAr3DY,CAs3DZ,0DAlpDF,sCACE,QASkC,CARlC,UAQwC,CAPxC,WAOqF,CANrF,SAMmI,CALnI,kBALF,qCACE,QAUiC,CATjC,UASuC,CARvC,WAQ6C,CAP7C,SAO2F,CAN3F,kBALF,mCACE,QAW+B,CAV/B,UAU6E,CAT7E,WAS0H,CAR1H,SAQgI,CAPhI,kBALF,kCACE,QAY8B,CAX9B,UAW4E,CAV5E,WAUkF,CATlF,SASwF,CARxF,kBA+oDA,0BACE,gBAvHwB,CAwHxB,UA1HkB,CA2HlB,WA1HmB,CA6HrB,qDACE,gBAGF,4BACE,gBAOA,6FApxDJ,uCAuxDI,qFAnxDJ,sCAyxDA,gCACE,sBACA,4BACA,gBAIA,gCAQF,kEACE,cAKF,6FAEE,mDA96Da,CA+6Db,kCAEE,4RAEE,kCAON,yGAEE,mDA57Da,CA67Db,mCAEE,oTAEE,mCAMR,iBACE,aACA,OACA,WAEA,4BACE,OAEA,cAEA,gBAEA,QAEA,6BACA,gBAEA,kBACA,uBACA,mBAEA,wCACE,8BAEF,uCACE,uBACA,8BAKN,8CACE,uCAEE,uBAOJ,QACE,sBACA,aACA,sBACA,UA5jEyB,CA8jEzB,0GAriEsB,CAuiEtB,uBACE,YAZW,CAaX,aACA,mBAGE,kDA1yDJ,iBA2yDkD,CA1yDlD,4DACE,iBAyyDsD,CAxyDtD,gBAwyDgD,CAK9C,iDAhzDJ,gBAizDmD,CAhzDnD,2DACE,gBA+yDuD,CA9yDvD,iBA8yDiD,CAIjD,sCACE,WACA,YAEA,oGAEE,kBAGF,8CACE,YACA,kDAEE,eACA,cAIJ,0DACE,gBAEA,oEACE,eAKN,2CACE,aACA,OACA,sBAEA,uDACE,eAKN,uEAGE,sBACA,aACA,cACA,WACA,YAGF,sBACE,uBACA,aACA,cACA,mBAEA,sCACE,cAGF,yCACE,OACA,sBACA,aAEA,qDACE,cACA,eAIA,gEACE,iBAKN,0CACE,gBAEA,uDACE,YACA,WAEF,uDACE,aACA,YAEF,uDACE,aACA,YAKN,wBACE,cACA,YA3HW,CA8HT,sCACE,aAGF,qCACE,gBAIJ,qCACE,aACA,YAIJ,wBACE,UAnsEuB,CAusEnB,sEACE,aAEA,oFACE,aAGF,mFACE,gBAIJ,gEACE,eACA,kBAKN,6CACE,OACA,2BACA,aACA,mBAIA,4EACE,aAEA,0FAz8DN,aA08DqD,CAz8DrD,oGACE,gBAw8DsD,CAv8DtD,cAu8DmD,CAG/C,yFA78DN,cA88DqD,CA78DrD,mGACE,iBA48DsD,CA38DtD,aA28DmD,CAIjD,sEACE,gBACA,iBAEA,oFAt9DN,gBAu9DqD,CAt9DrD,8FACE,gBAq9D2E,CAp9D3E,iBAo9DmD,CAG/C,mFA19DN,iBA29DqD,CA19DrD,6FACE,iBAy9D2E,CAx9D3E,gBAw9DmD,CAIjD,4EACE,OACA,yBACA,aACA,mBAKN,uBACE,gBACA,YAjNW,CAqNf,8CACE,QACE,uBAKF,sBACE,WACA,YAwBF,4BACE,eANkB,CAOlB,mBAIJ,YACE,sBACA,qBACA,mBACA,eACA,aACA,iBACA,kBACA,cA/sEe,CAuXf,eAi0DoB,CAh0DpB,qHAEE,eA+zDwB,CA0BxB,4DACE,UACA,SACA,WACA,YAIA,6EACE,iCA7/DN,0BACE,kBACA,QACA,2BAEA,sBACA,qBAEA,UAvOa,CAwOb,WAxOa,CA2Kf,MA8DqB,CA9DrB,UA+DsB,CA9DtB,oCACE,SA4DsB,CA7DxB,oCACE,OA6D0B,CAE1B,iCACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,gCACE,sBACA,WACA,kBACA,UACA,YACA,aACA,WAGF,+CACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKJ,qBACE,sBACA,iBACA,kBACA,MACA,OACA,UAzRa,CA0Rb,WA1Ra,CA2Rb,gBAxRoB,CAyRpB,mBACA,iBA3RqB,CA8RvB,gCACE,yBAEA,sCACE,sBACA,wBACA,kBACA,SACA,QACA,cACA,UACA,YACA,gBAzSkB,CA0SlB,mBACA,aACA,cACA,WAKJ,sBACE,eAIA,4CACE,sBACA,kBACA,QACA,SACA,gCACA,cACA,aACA,UA/TkB,CAgUlB,gBAhUkB,CAiUlB,mBACA,aACA,cACA,WA45DJ,0BAEE,SACA,UACA,WACA,UAlDwB,CAmDxB,gBAGF,sBACE,sBACA,kBACA,qBACA,sBACA,mBACA,iBACA,eA9DuB,CA+DvB,mBAlkEF,gBAwgEqB,CAvgErB,gCACE,aAkkEoE,CAjkEpE,iBAqgEmB,CA8DnB,4BA7kEF,gBA+kE8B,CA/kE9B,cAglE+B,CA/kE/B,sCACE,aA6kEiF,CA9kEnF,sCACE,iBA8kEgC,CAKpC,2CACE,sBACA,kBACA,qBACA,sBACA,mBACA,iBACA,eAGA,UA/lEA,gBAkmE0B,CAlmE1B,cAmmE2B,CAlmE3B,qDACE,aAgmEiE,CAjmEnE,qDACE,iBAimE4B,CAmB5B,oCAtnEF,kBA+mEqB,CA9mErB,8CACE,kBAqnE+C,CAC7C,uDAxnEJ,UAynE0B,CAxnE1B,iEACE,WAunE8B,CAC1B,2DACE,WApBI,CAqBJ,mBAGJ,qDACE,qBACA,WA1BM,CAhmEZ,eA2nEmD,CA1nEnD,+DACE,gBAynE2D,CAxnE3D,gBAwnEiD,CAKrD,uBACE,YACA,2BACE,WA1BmC,CA2BnC,mBACA,cA3B6B,CA6B/B,wCAvoEA,eA0mE+B,CA+B7B,WA9BsB,CA1mExB,kDACE,gBAsoE8E,CAroE9E,gBAumE6B,CAiC/B,iFACE,qBACA,gBACA,uBAGJ,iCACE,YAEF,SACE,aAEF,UAGE,aACA,eACA,YACA,8CA/8EY,CAg9EZ,cA/De,CAtmEf,mBA6mEkB,CA0DlB,sBAlwEA,gBACE,WACA,cACA,WAyFF,oBACE,mBAoqEwC,CAG1C,+CACE,eAnEU,CAsEZ,4BACE,YAKA,+BA5qEF,kBAmmE0B,CAlmE1B,yCACE,eA2qE6E,CA1qE7E,iBAgmEwB,CA4EtB,gDA/qEJ,iBAgrEqD,CA/qErD,0DACE,eA8qE6D,CA7qE7D,gBA6qEmD,CAMrD,kBACE,eACA,mBACA,cACA,WA1FU,CA2FV,gBA3FU,CAvmEZ,kBA4mEY,CAwFV,qBA5FW,CAxmEb,UAqsEsB,CACpB,sBACA,eACA,kBAvsEF,4BACE,kBAisEmC,CAlsErC,4BACE,WAmsE0B,CAK1B,mCACE,cA3sEJ,UA4sEwB,CACpB,mBACA,eACA,gBACA,uBA/sEJ,6CACE,WA0sE4B,CAK1B,yCACE,aAGJ,mDACE,yBACA,sBACA,wBACA,qBAEF,4CACE,kBArtEJ,OAstEmC,CAC/B,gBAnHoB,CAnmExB,sDACE,UAotEoC,CAntEpC,MAmtEiC,CAGjC,kCACE,kBACA,UA3HQ,CA4HR,WA5HQ,CA6HR,YACA,UACA,uBACA,YACA,gBACA,SACA,kBACA,0CACE,WA9HgB,CA+HhB,UA/HgB,CAgIhB,eAhIgB,CAiIhB,cAjIgB,CAkIhB,kBACA,QACA,SACA,qCAIN,mCACE,cACA,gBAlJU,CAvmEZ,kBA4mEY,CA+IV,SAlJiB,CAmJjB,YA5vEF,UA6vEsB,CA5vEtB,6CACE,kBAwvEmC,CAzvErC,6CACE,WA2vE0B,CAC1B,yCACE,WAEA,0TAME,SACA,WAjKM,CAkKN,gBAlKM,CAmKN,UACA,8VACE,aAIN,2GACE,uBACA,WA3KQ,CA8KR,wEACE,gBAEF,yDACE,kBAGJ,yCACE,SACA,WAvLQ,CAwLR,gBAxLQ,CAyLR,UACA,+CACE,aAGJ,2GACE,WA/LQ,CAiMV,mDACE,gBACA,yDACE,kBAGJ,qDA9yEF,kBA4mEY,CA3mEZ,+DACE,kBA6yEqC,CAErC,yCACE,uBACA,eAIF,iCACE,aAKN,8CACE,iCAEE,sBAEF,yCACE,aAKJ,WAEE,cACA,kBACA,cACA,iCAEA,wBACE,gBACA,kBAEF,wBACE,gBACA,kBAKF,aAlBF,WAmBI,6BAyDJ,YACE,eACA,iBAMF,yBACE,qBACA,gBACA,aAGA,qDAGE,kBACA,iCAEA,wEACE,aAMJ,sDACE,WAKJ,8BAIE,6CAEA,qBACA,aAGA,YAIF,kBAhFE,WAjBsB,CAkBtB,UAlBsB,CAmBtB,kBAIA,UACA,YAGA,uBAKA,8BA33EA,iBA81EyB,CA71EzB,wCACE,cA03E0E,CAz3E1E,kBA21EuB,CAiCzB,6BA/3EA,kBA81EyB,CA71EzB,uCACE,eA83E0E,CA73E1E,iBA21EuB,CAiGzB,4CACE,eAKJ,sCACE,uEAEA,kBACA,qBAEA,UA9G+B,CA+G/B,WA/G+B,CAgH/B,gBAhH+B,CAkH/B,0EACE,eAKJ,yBACE,WA3HsB,CA4HtB,cArHkC,CAsHlC,gBA/9EA,kBAg+EsB,CA/9EtB,mCACE,kBA89EwF,CAE1F,qDACE,eAGF,iCAt+EA,wBAu+E0B,CAt+E1B,2CACE,cAq+EwC,CAG1C,8BACE,sBAKJ,wBAjGE,mBACA,iBACA,yBAkGA,2BAhIA,WAhB0B,CAiB1B,UAlBsB,CAmBtB,kBAIA,UACA,YAGA,uBAwHE,mBAnHF,uCA33EA,iBA81EyB,CA71EzB,iDACE,cA03E0E,CAz3E1E,kBA21EuB,CAiCzB,sCA/3EA,kBA81EyB,CA71EzB,gDACE,eA83E0E,CA73E1E,iBA21EuB,CAqJ3B,aA3GE,mBACA,iBACA,yBA6GA,8BACE,wBACA,0BAMF,yBACE,iCAOF,mDACE,sBACA,uBAcJ,cAEE,mBACA,gBACA,sBAIA,8BACE,gBAKJ,sBACE,qBACA,sBACA,gBACA,sBACA,kBAIA,6BACE,MACA,OACA,SACA,QACA,kBACA,WACA,WAKJ,qBA1oFE,eAEA,sBACA,YACA,gBACA,aACA,uBAsoFA,gBACA,gBACA,gBAroFA,gCACE,aAyoFF,6CAEE,iBAEA,4EACE,YAGF,mEAllFF,UAqlFwB,CACpB,iBACA,WAtlFJ,6EACE,WAmlF4B,CAM9B,yCACE,WAIA,kHAhmFF,UAkmFa,CAlmFb,SAomFuB,CACnB,wBApmFJ,4HACE,UAimF+B,CAlmFjC,4HACE,SAgmFW,CAMX,4FAjmFF,gBAkmFa,CAjmFb,sGACE,gBAimFwD,CAhmFxD,iBA+lFW,CAMf,kCAxmFE,kBA2mF+C,CA3mF/C,kBA4mF6C,CA3mF7C,4CACE,eAymFuF,CAxmFvF,iBAwmF6C,CA1mF/C,4CACE,iBA0mFsF,CAzmFtF,iBAymF2C,CAI/C,+BAEE,kBAEA,wBACA,0BAEA,qBACA,WAEA,+CA1nFA,gBA8gFyB,CA7gFzB,yDACE,gBAynFwE,CAxnFxE,iBA2gFuB,CAgHzB,qDACE,wBAIJ,0CACE,WAIF,6BAKE,kBACA,MACA,WACA,WAp3FsB,CAq3FtB,iBACA,mBACA,uBAEA,mBACA,qBACA,0DAEA,0CACE,mBAKJ,0BACE,WA7IgC,CA8IhC,WA3TkB,CA4TlB,kBACA,gBAEA,uBACA,oBACA,YAIF,wBACE,UAIA,qDAEA,sCACE,UAGF,0CACE,aAOJ,+BAGE,kBACA,QACA,SACA,gCAEA,QACA,SACA,kCACA,mCACA,qBAIF,+BACE,kBA/sFA,OAgtF+B,CAC/B,cAxtFA,yBA2tFwB,CAntFxB,yCACE,UA8sFgC,CA7sFhC,MA6sF6B,CAttF/B,yCACE,0BAytFuC,CAK3C,wDACE,WAxMoC,CAyMpC,UAzMoC,CA0MpC,kBACA,WAzM6B,CA8M7B,uDACE,gCAGF,uDACE,aAKJ,oBACE,gBAEA,sFAEE,gCAGF,mJAGE,aAOJ,sDACE,aAMA,0CACE,4BACA,2DACA,uBAGF,uDACE,wBAMJ,sBACE,gBAGF,qBACE,aACA,uBACA,mBACA,kBACA,MACA,OACA,WACA,YACA,UAjgGe,CAkgGf,gBAGF,UAaE,UACA,gBACA,cACA,eACA,kBACA,cAEA,6GA9iGuB,CAgjGvB,aACA,sBArBA,2BACE,UACA,mDA3/Fa,CA4/Fb,mCAEF,4BACE,UACA,mDAhgGa,CAigGb,wCAeF,eACE,aACA,sBACA,cAGF,6BACE,YAnDa,CAsDf,4BACE,QACA,sBACA,cACA,iCAEA,+EACE,aAGF,kCACE,aAGF,0CACE,SAGF,oDACE,WAGF,uDACE,WACA,sBAIJ,4BACE,aACA,QACA,sBACA,mBACA,yBACA,gBA/2FF,iBArRyB,CAqRzB,iBAi3F6B,CAC3B,gBACA,gBAl3FF,sCACE,kBA82F4C,CA/2F9C,sCACE,gBAvRuB,CA0oGvB,uCACE,iBA3oGqB,CAqRzB,eArRyB,CAqRzB,cAw3F+B,CAC3B,cA9oGqB,CAsRzB,iDACE,aAq3F4C,CAt3F9C,iDACE,gBAvRuB,CAkpGvB,gDACE,qBACA,uBAKN,8CACE,UACE,uBAIJ,yBACE,+BACE,gBACA,eACA,iBAIJ,WACE,cACA,qBACA,uBACA,SAEA,qBAj5FA,gBAk5F+C,CAj5F/C,+BACE,gBAg5FkE,CA/4FlE,iBA+4F6C,CA5rF/C,yBAGI,wEA8rFJ,mBACA,uBACA,0BA7rFA,+CAII,6KAurFJ,mBACA,uBACA,0BAtrFA,gDAKI,qRA+qFJ,mBACA,uBACA,0BA9qFA,iDAMI,uZAsqFJ,mBACA,uBACA,0BArqFA,0BAOI,umBA4pFJ,mBACA,uBACA,0BAGF,kBACE,kBACA,aACA,mBAIA,UA/nGY,CAgPZ,sCACE,QASkC,CARlC,UAQwC,CAPxC,WAOqF,CANrF,SAMmI,CALnI,kBALF,qCACE,QAUiC,CATjC,UASuC,CARvC,WAQ6C,CAP7C,SAO2F,CAN3F,kBALF,mCACE,QAW+B,CAV/B,UAU6E,CAT7E,WAS0H,CAR1H,SAQgI,CAPhI,kBALF,kCACE,QAY8B,CAX9B,UAW4E,CAV5E,WAUkF,CATlF,SASwF,CARxF,kBA84FF,sCAEE,oBAEA,+GAGE,oBAGF,iDAEE,oBAIJ,qCACE,UAppGU,CAwpGV,iDACE,mBAIJ,iCACE,aAGA,YAEA,qDACE,mDAxpGU,CA4pGd,0BACE,sBAEA,yCACE,QAGF,yCACE,sBACA,QAIJ,wBACE,sBAEA,uCACE,QAGF,uCACE,8BACA,QAIJ,0BACE,mBAEA,yCACE,QAGF,yCACE,2BACA,QAEA,6DACE,mDAlsGQ,CAusGd,2BACE,mBAEA,0CACE,QAGF,0CACE,mBACA,QAEA,8DACE,mDAntGQ,CA4tGZ,gHACE,kBAQF,+CACE,UAMF,qEACE,UACA,uBAKF,+CACE,mBACA,mDArvGU,CAwvGV,iCAON,eAME,cAjiGA,mCACE,QASkC,CARlC,UAQwC,CAPxC,WAOqF,CANrF,SAMmI,CALnI,kBALF,kCACE,QAUiC,CATjC,UASuC,CARvC,WAQ6C,CAP7C,SAO2F,CAN3F,kBALF,gCACE,QAW+B,CAV/B,UAU6E,CAT7E,WAS0H,CAR1H,SAQgI,CAPhI,kBALF,+BACE,QAY8B,CAX9B,UAW4E,CAV5E,WAUkF,CATlF,SASwF,CARxF,kBAiiGF,uCACE,cACA,kBACA,gBAGA,YAGF,8BACE,kBACA,UAjyGU,CAmyGV,qCACE,4BAGF,yDACE,cACA,kBACA,WAEA,UACA,mDAjyGU,CAoyGZ,sCACE,kBACA,WAEA,UAGA,6BAKF,sCAhmGF,OAimGmC,CAhmGnC,gDACE,UA+lGoC,CA9lGpC,MA8lGiC,CAGjC,yCACE,2BAEA,gEAvmGJ,kBAwmGmD,CAvmGnD,0EACE,iBAsmGyD,CArmGzD,iBAqmGiD,CAG/C,gEA3mGJ,mBA4mGmD,CA3mGnD,0EACE,gBA0mG0D,CAzmG1D,oBAymGiD,CAI/C,+DAhnGJ,gBAinGmD,CAhnGnD,yEACE,iBA+mGsD,CA9mGtD,eA8mGiD,CAOjD,uCAxnGF,MAynGmC,CAxnGnC,iDACE,SAunGoC,CAtnGpC,OAsnGiC,CAGjC,0CACE,mBAIJ,0BACE,wCACA,oBACA,WAEA,4CAEE,eACA,eAGF,8CACE,UACA,mBACA,mDA/1GU,CAk2GV,yBAQF,gDACE,gBAEA,wDACE,UAIJ,8CACE,UACA,mBAKN,aACE,sBACA,cACA,kBAEA,6HAIE,sBAGF,0BACE,cACA,kBAEA,iCACE,aACA,mBACA,uBACA,YACA,kBACA,MACA,QACA,SACA,OACA,UACA,SAIF,4FAEE,aACA,mBACA,mBACA,YACA,WACA,2BACA,gBAGA,kBACA,OACA,QAEA,oMAEE,gBACA,kBAGF,kGACE,eAGF,kGACE,eAIJ,8CACE,MAGF,8CACE,SAMN,8CACE,aACE,sBAEF,oBACE,2BAKJ,QACE,YACA,sCACA,qBACA,sBACA,kBACA,WAphHU,CAqhHV,UArhHU,CAwhHV,eAxhHU,CAyhHV,cAzhHU,CA2hHV,YACE,oBACA,cAGF,sBACE,gBAjiHQ,CAkiHR,WAIJ,mBAEE,qBACA,kBACA,WAj8GwB,CAk8GxB,gBACA,sBA33GA,yBACE,WACA,cACA,WA03GF,4BACE,cAKF,qCAxyGA,WAyyGsB,CACpB,eA37GiB,CA87GjB,cA5yGF,+CACE,UAuyG2B,CAO7B,2BACE,kBACA,OA57Gc,CA0IhB,QAmzGqB,CAnzGrB,UAozGsB,CAnzGtB,qCACE,SAizGwB,CAlzG1B,qCACE,SAkzG0B,CAG5B,2iBAgBE,qBACA,wBAEF,+LAKE,gBAEF,4BACE,YACA,gBAEA,qCACE,gBACA,6BAIF,4CACE,YACA,cAIJ,mDACE,kBACA,YAn2GF,MAo2GqB,CAp2GrB,UAq2GsB,CAp2GtB,6DACE,SAk2GsB,CAn2GxB,6DACE,OAm2G0B,CAE1B,qEACE,aACA,eACA,mBAIJ,wGAEE,gBACA,uBACA,mBACA,WACA,QACA,oBACA,mCAt3GF,gBAnKwB,CAmKxB,eAw3G8B,CAC5B,UACA,2CACA,0DAIA,eA/3GF,yBAi4GiC,CAh4GjC,4HACE,cAq3GqD,CAt3GvD,4HACE,iBArKsB,CAoKxB,4HACE,0BA+3GyC,CAGzC,8IAp4GF,gBAs4G+B,CAt4G/B,eAu4GgC,CAt4GhC,kKACE,cAo4G6D,CAr4G/D,kKACE,iBAq4GiC,CAGnC,mCACE,kBACA,MACA,UACA,sCACA,kCAEF,oDACE,UACA,kCAGF,sDACE,gBACA,UAGF,6FACE,kBAEF,q8BAUE,kBAMF,6BACE,QACA,cACA,aAEA,gBACA,eAzkHgB,CA0kHhB,kBAzkHmB,CAoJrB,cAs7G6B,CAt7G7B,iBAnKwB,CA2lHtB,uBACA,gBA/kHgB,CAglHhB,YACA,4BAjlHgB,CAklHhB,gBACA,mBACA,6DAGA,WACA,sBAl8GF,UAu8GsB,CAt8GtB,uCACE,gBArKsB,CAoKxB,uCACE,eAq7GsD,CAt7GxD,uCACE,WAq8G0B,CAE1B,mCACE,aAEF,qCACE,aACA,gBAGF,wCACE,qBAIJ,oCAt9GA,gBAu9G2B,CAv9G3B,iBAnKwB,CAmKxB,cAy9G6B,CAx9G7B,8CACE,eAq9GgC,CAt9GlC,8CACE,eAs9GsD,CAv9GxD,8CACE,gBArKsB,CAkoHxB,gDACE,kBACA,QACA,gBAl+GF,UAm+GsB,CAl+GtB,0DACE,WAi+G0B,CAG5B,mFACE,cAznHoB,CA0nHpB,gBAxnHsB,CAynHtB,gBAEA,mDAprHY,CAurHZ,UACA,aACA,eArwHuB,CAuwHvB,+HAl/GF,iBAo/GgC,CAp/GhC,cAq/G+B,CAp/G/B,mJACE,eAk/GwC,CAn/G1C,mJACE,gBAm/GgC,CAM9B,oFACE,UACA,kBAQJ,gEACE,UACA,kBAIF,8EACE,UACA,kBAOF,8LACE,6CACA,qGAQF,4CACE,gBAKJ,6IAGE,iBACA,uBAIA,+EAIE,uCAGA,wBACA,2BAIJ,iCAEE,2DAEA,uCACE,oBACA,kBAGF,yCACE,OA5sHY,CA0IhB,QAmkHuB,CAnkHvB,UAokHwB,CAnkHxB,mDACE,SAikH0B,CAlkH5B,mDACE,SAkkH4B,CAQ1B,kRAEE,wBACA,UAMN,gCArlHA,iBA5IY,CA4IZ,eAulH8B,CAtlH9B,0CACE,cAolHyC,CArlH3C,0CACE,kBA9IU,CAouHV,sCAxlHF,SA5IY,CA4IZ,UA0lHwB,CAzlHxB,gDACE,SAulHmC,CAxlHrC,gDACE,UA9IU,CA0uHZ,iCA9lHA,cA+lH6B,CA/lH7B,kBA5IY,CA6IZ,2CACE,iBA9IU,CA6IZ,2CACE,eA8lH0C,CAE1C,sDACE,SAnmHJ,SAqmHwB,CArmHxB,SAsmHuB,CArmHvB,gEACE,UAmmH2B,CApmH7B,gEACE,QAomH2B,CAI7B,8CACE,iBAvvHU,CAwvHV,kBAxvHU,CA2vHR,oKAEE,8BAMR,mBAEE,kBAptHA,yBACE,WACA,cACA,WAotHJ,kBACE,kBACA,YACA,OACA,WAtwH2B,CAuwH3B,uBACA,WACA,iBAGF,8CACE,4CACE,WA2CJ,QACE,cACA,wBAEA,sBACE,cAn9HuB,CAo9HvB,gBACA,qBACA,iBA1CsB,CA+CpB,gIAEE,eAxBiB,CAtrHvB,gJACE,WACA,eAorHqB,CAnrHrB,kBACA,qBAgtHI,wKACE,UA5B2B,CA6B3B,WA7B2B,CAgC7B,kNAtsHN,iBAusHqD,CAC7C,cAnEY,CAoEZ,iBApEY,CApoHpB,sOACE,iBAqsHmH,CApsHnH,gBAosHmD,CAI/C,sTA3sHN,iBA4sHqD,CAC7C,eACA,kBA7sHR,8VACE,iBA0sHqH,CAzsHrH,gBAysHmD,CAI/C,sJACE,UACA,UA3C6B,CA4C7B,WA5C6B,CA+C7B,gOACE,cAlFU,CAmFV,iBAnFU,CAqFZ,wPACE,eAv5HS,CAg6HT,8YApuHV,gBAypHwB,CAxpHxB,sbACE,gBAmuHiF,CAluHjF,iBAspHsB,CA+Ed,klCAGE,gBAjEgB,CAkEhB,cAnEc,CAoEd,mBAGF,kXACE,cAzEqB,CAgF3B,6IACE,eArFwB,CAvrHhC,6JACE,WACA,eAqrH8B,CAprH9B,kBACA,qBA2wHM,gVACE,gBAMJ,6IAEE,eAhG0B,CAxrHlC,6JACE,WACA,eAsrHgC,CArrHhC,kBACA,qBAuxHM,wVAEE,gBAKR,6DACE,iBACA,oBAKN,aAEE,kBAEA,oDACE,wCAGF,6BACE,kBAEA,uDAEE,aACA,mBACA,2BAEA,iBACA,SAEA,gBAjzHJ,eAkzH6B,CACzB,mBAlzHJ,iEACE,gBAgzHiC,CAI/B,8EACE,kBACA,MACA,OACA,YAEA,SACA,UAGF,2EAEE,WA90HN,mFACE,WACA,kBA60HqC,CA50HrC,kBACA,qBAk1HF,mDAEE,kBACA,iBAGA,cAEA,uEACE,kBACA,eAp1HJ,eAq1H6B,CACzB,oBACA,WACA,mBACA,uBACA,oBACA,gBACA,SA31HJ,2FACE,gBAm1HiC,CAS/B,iHACE,gBAGJ,+DACE,aAGJ,gCACE,eAGF,wBACE,kBACA,SAr2HF,MAs2HiC,CAC/B,WAt2HF,kCACE,SAo2HkC,CAn2HlC,OAm2H+B,CAE/B,kCAx2HF,SA8pH+B,CA4M3B,wBACA,oBA12HJ,4CACE,SAu2HkE,CAt2HlE,UA2pH6B,CAiN/B,8CAIE,aACA,2BACA,mBAEA,eAxNe,CA2Nf,YA74HF,8DACE,WACA,eAgrHe,CA/qHf,kBACA,qBA44HA,khBAIE,UAtOyB,CAuOzB,gBACA,mBACA,uBAEF,kXAIE,kBACA,kcACE,aAIJ,gIAh5HF,iBAi5HiD,CAh5HjD,oJACE,iBA+4HyG,CA94HzG,gBA84H+C,CAG/C,kJACE,cAjrIqB,CAkrIrB,iBAlrIqB,CA4RzB,iBAu5HiD,CAC7C,kBACA,uBAx5HJ,0LACE,iBAq5H2G,CAp5H3G,gBAo5H+C,CAI/C,oEACE,UACA,UAnQ2B,CAoQ3B,WApQ2B,CAsQ7B,8EACE,YAIA,sFACE,UAzrII,CA0rIJ,WA1rII,CA8rIR,sEACE,WACA,eAzmIe,CAqLnB,eAq7H8B,CAr7H9B,iBAs7H+B,CAr7H/B,0FACE,gBAm7HiC,CAp7HnC,0FACE,gBAo7HmC,CAGnC,8FACE,aACA,mBAGA,kBAMA,cAKA,YAz8HJ,cA28H+B,CA38H/B,gBA48H8B,CA38H9B,kHACE,iBAy8HgC,CA18HlC,kHACE,aA08HkC,CAG9B,sSAx8HN,cA08HqD,CAz8HrD,8UACE,iBAw8HsD,CAv8HtD,aAu8HmD,CAIjD,sHACE,aACA,cACA,eA7oIa,CA+oIb,4IACE,UA/oIU,CA2LlB,cAq9HqD,CAp9HrD,gKACE,iBAm9HsD,CAl9HtD,aAk9HmD,CAIjD,kHACE,aACA,gBA39HN,iBA69HmD,CA59HnD,sIACE,iBA29HuD,CA19HvD,gBA09HiD,CAIjD,4IACE,cACA,SAMF,sHACE,uBACA,uBAEA,0KACE,cA1wImB,CA2wInB,iBA3wImB,CA8wIrB,kMACE,cACA,YACA,uBACA,gBAEA,0OAx/HN,gBAypHwB,CAxpHxB,kRACE,gBAu/H6E,CAt/H7E,iBAspHsB,CAmWlB,8MACE,cAjyIiB,CAkyIjB,gBACA,qBACA,cAzXO,CA0XP,iBAvXgB,CAwXhB,gBACA,mBACA,uBAEF,8MACE,cAzyIiB,CA0yIjB,qBACA,kBAjYO,CAkYP,eAjYY,CAkYZ,iBAjYgB,CAkYhB,gBACA,mBACA,uBAEF,0MACE,cAnzIiB,CAozIjB,gBACA,qBACA,cAzYM,CA0YN,iBAzYW,CAgZjB,2DACE,YAEA,eA/XsB,CAnrH1B,2EACE,WACA,eAirHwB,CAhrHxB,kBACA,qBAijIE,4KACE,gBAGF,mGACE,sBAGF,iGACE,cAMJ,2DACE,YAEA,eAnZwB,CAprH5B,2EACE,WACA,eAkrH0B,CAjrH1B,kBACA,qBAskIE,oLAEE,gBAaR,wBACE,eACA,OACA,MACA,WA/yIa,CAgzIb,UACA,iBAbmB,CAcnB,8BACA,cAEA,wCACE,eACA,kBACA,WACA,eACA,eACA,WAGF,0CACE,UAIF,2CACE,oBAIF,kCACE,UACA,mDAzzIa,CA0zIb,0BACA,oDACE,UACA,mDAzzIU,CA0zIV,0BACA,uBAIJ,iCACE,UACA,mDAj0IY,CAk0IZ,0BAIJ,gBACE,aACA,sBACA,cACA,gBAvDgB,CAwDhB,gBACA,yBACE,gBAzDoB,CA0DpB,sCACE,WA7DmB,CA8DnB,eA9DmB,CAmEzB,aACE,aACA,mBACA,eAvEiB,CAwEjB,WAxEiB,CAyEjB,qBACA,2BAEA,eACE,WACA,cACA,kBACA,mBAQF,yBACE,gBAGF,wBApqIA,eA2qI2B,CAEzB,qBACA,gBACA,cACA,eACA,oBACA,gBACA,YACA,kBACA,mBACA,WAhBA,0CACE,UACA,SAvqIJ,kCACE,gBAyqI+B,CAY/B,gCAvrIF,uBAwrIyB,CAvrIzB,0CACE,uBAsrIsD,CAEtD,0BACE,qBACA,YAEF,6BACE,gBACA,mBAEF,6CACE,sBAMJ,oBACE,YACA,YACA,UAIJ,yBACE,gBACE,gBAGA,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,iBAKN,yBACE,gBACE,eAGA,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,gBADF,2BACE,iBAQF,+CACE,iBACA,YACA,aACA,oBAMJ,4BACE,kBACA,WAn9IW,CAu9If,YACE,eACA,cACA,kBACA,UACA,qBACE,qBACA,UACA,kBAEF,mBACE,eACA,eACA,SACA,SACA,6BACA,YAGF,yCACE,WAIJ,0CACE,gBACA,eACA,iEACE,kBACA,yEACE,kBACA,UACA,WACA,QAnxIJ,SAoxImC,CAnxInC,mFACE,SAkxIqD,CAjxIrD,UAixIiC,CAEjC,iKA7xIF,qBA8xI0B,CA7xI1B,qLACE,qBA4xImE,CAGrE,qDACE,aACA,YACA,0DApyIF,UAqyIwB,CApyIxB,oEACE,WAmyI4B,CAE5B,sEAvyIF,WAwyIwB,CACpB,aAxyIJ,gFACE,UAsyI6B,CAI/B,0DACE,aAGF,gIAhzIA,eAizI2B,CAhzI3B,oJACE,gBA+yI+B,CAGjC,mDACE,UACA,8DACE,kBACA,SACA,WACA,oBACA,mBACA,kBArzIJ,iBAszImD,CArzInD,wEACE,cAozIqE,CAnzIrE,kBAmzIiD,CAC/C,oEACE,cACA,YACA,kBACA,QACA,WAn0IN,iDAo0I8B,CA7zI9B,UA8zIqC,CAp0IrC,8EACE,gDAk0IqE,CA5zIvE,8EACE,UA4zIyD,CA3zIzD,SA2zImC,CASvC,YACE,mBACA,qBACA,WALkB,CAMlB,kBAGF,kBACE,aACA,gBACA,SACA,UAGA,sBACA,aACA,mBAGF,2BACE,gBAIF,0BACE,iBACA,aACA,kBACA,gEAEA,gCACE,aAIJ,eAGE,sBACA,kBACA,SACA,OACA,WACA,WACA,0BACA,sBACA,0DAKA,0BACE,gBAKJ,qBACE,gBACA,mBAKF,gCACI,0BACA,+BAIJ,qBACI,kBACA,cAt5IF,qBAw5I0B,CAv5I1B,+BACE,sBAs5IqC,CAErC,oDACI,kBAGJ,+CACI,yDAGJ,yBACI,kBACA,iBACA,MACA,OAMR,mBACE,cACA,kBACA,WACA,UAN2B,CAQ3B,yBACA,2BAn7IA,qBAq7IwB,CAp7IxB,6BACE,sBAm7ImC,CAErC,gDACE,kBAGF,iCACE,cACA,kBACA,gBAEA,WACA,UAvByB,CAyBzB,sCAEA,yCACE,kBAEA,OACA,MACA,SAEA,WACA,UAnCuB,CAsCzB,mDACE,WACA,aACA,kBAEA,aACA,UA5CuB,CA6CvB,WAEA,6BACA,qCACA,8BAGF,oFAKE,gCAQE,wDACE,aAEF,wDACE,0BACA,iEAKJ,8DACE,aAKF,gEACE,8GAGF,gEACE,8GAKJ,wGAEE,eAEA,iHACE,oBAEF,iHACE,oBAON,gDACE,wCAEA,0BAEA,kEACE,cACA,oCAKN,iBACE,GACE,UACA,wCAEF,KACE,UACA,wCAGJ,kBACE,GACE,UACA,8BAEF,IACE,UAEF,KACE,UACA,kCAGJ,oDACE,GACE,sBACA,iCAEF,MACE,sBACA,iFAEF,OACE,uBACA,+EAEF,KACE,uBAGJ,8CACE,GACE,sBACA,iCAEF,IACE,sBACA,sEAEF,OACE,WACA,gFAEF,KACE,qBAGJ,oDACE,GACE,sBACA,0FAEF,OACE,uBACA,0FAEF,OACE,uBACA,0FAEF,KACE,uBAGJ,8CACE,GACE,qBACA,wEAEF,IACE,aACA,iFAEF,OACE,WACA,2EAEF,KACE,sBAoBJ,gBACE,sBACA,cACA,kBAba,CAcb,mBACA,eACA,kBAGA,0BAhBA,eAEA,wCACE,eAiBF,8BACE,kBACA,QACA,2BACA,sBACA,qBACA,UAjCU,CAkCV,WAlCU,CAmCV,eAjqJF,MAkqJqB,CAlqJrB,UAmqJsB,CAlqJtB,wCACE,SAgqJsB,CAjqJxB,wCACE,OAiqJ0B,CAE1B,mDACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAGF,qCACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAIJ,mDACG,QAjEY,CAoEf,wBACE,sBACA,kBACA,MACA,OACA,UA5EU,CA6EV,WA7EU,CA8EV,mBACA,iBACA,kBACA,kCAGF,uBACE,sBACA,kBACA,MACA,OACA,UAzFU,CA0FV,WA1FU,CA2FV,kBACA,+BACA,mBAGF,kCACE,qBAGF,0BACE,sBACA,kBACA,qBAruJF,gBAuuJ4B,CAvuJ5B,cAwuJ6B,CAE3B,sBACA,mBACA,oBACA,WA5uJF,oCACE,aAquJ6D,CAtuJ/D,oCACE,iBAsuJ8B,CAUhC,qBACE,aAIA,wEACE,UACA,SACA,WACA,YAIF,oFACE,UACA,SACA,WACA,YAIJ,yCAlIA,eAEA,uDACE,eA36IF,yBAGI,kFA6iJJ,iBA1iJA,+CAII,4LAsiJJ,iBAniJA,gDAKI,ySA8hJJ,iBA3hJA,iDAMI,gbAqhJJ,iBAlhJA,0BAOI,qoBA2gJJ,iBAIA,+BACE,mBACA,+CACE,qBACA,YACA,yBACA,sBACA,aACA,gBAEA,yDACE,QAEF,6DACE,eAMR,8CACE,wCACE,uBA0BA,8EACE,0DAl0JJ,yBAm0JmC,CAl0JnC,wFACE,0BAi0J2C,CAKzC,4HACE,6CAMR,0BACE,eACA,OACA,MACA,UA/iKe,CAgjKf,UACA,aAGA,2BAGA,6CACE,oBAGF,+CACE,cACA,4BAIF,oCACE,cACA,UACA,mDACE,mDAtjKW,CAujKX,0BACA,qDACE,UACA,mDAtjKQ,CAujKR,0BACA,uBAMN,mCACE,UACA,mDAhkKY,CAikKZ,0BAIJ,0BACE,eAnEoB,CAuEpB,0EAEE,cA3Ec,CA6EhB,6BACE,QAUA,4PACE,aACA,eACA,mBAOF,+DACE,0BACA,mBAKN,UACE,aAII,4MACE,aACA,eACA,mBAKN,qCAIE,uCAGA,wBACA,2BAIA,mBACA,gBACA,0BAGF,gBACE,aAEF,0BACE,eAGA,gCACE,eAGA,iDACE,0BACA,wBACA,mBASF,oEACE,uBA9mKqB,CAmnKzB,wDAIE,uCAGJ,8CACE,gBACA,uBA7nKyB,CA8nKzB,mBACA,oEAv+JF,cAw+J+B,CAx+J/B,iBAnKwB,CAoKxB,8EACE,gBArKsB,CAoKxB,8EACE,eAu+JwD,CAK5D,iBACE,aACA,mBACA,eA9LyB,CA+LzB,kBA9L4B,CApzJ5B,cAm/J2B,CAn/J3B,iBAnKwB,CAwpKxB,uBAxM4B,CAyM5B,0BACA,+BACA,kBACA,uBACA,eACA,gBACA,mBACA,0BACA,YA7/JA,2BACE,gBArKsB,CAoKxB,2BACE,eAk/JoD,CAYtD,2CACE,eACA,cACA,uBACA,mBACA,gBAEA,oDACE,eAIJ,iCACE,cA7gKF,oBA8gK4B,CA9gK5B,gBA+gK2B,CACzB,WACA,2BACA,iBAjhKF,2CACE,sBA4gKoC,CA7gKtC,2CACE,eA6gKgC,CAMlC,uCACE,cACA,YACA,kBACA,QAzhKF,UA0hKsB,CA1hKtB,SA2hKqB,CACnB,WACA,eACA,sBA7hKF,iDACE,UAwhK0B,CAzhK5B,iDACE,SAyhKyB,CAM3B,uCACE,aACA,QACA,oBACA,mCACA,UAIJ,eACE,aACA,sBAYA,0GApzKsB,CAqzKtB,iBACA,eA3QqB,CA4QrB,kBA3jKA,yBA6jK+B,CAE/B,mBAlBA,0BACE,8BAIA,4CACE,eAx0KqB,CAy0KrB,kBAz0KqB,CAsRzB,yBACE,0BA2jKuC,CAIzC,0BACE,gBACA,eApRmB,CAqRnB,iBACA,gBAEF,iBACE,UAIJ,UACE,eACA,kBACA,aACA,mBACA,WACA,kCAiBA,sBACA,WArTqB,CAqSrB,oBACE,eAGF,gBACE,aAGF,mBAxtKA,0BAD2B,CAE3B,wBAF2B,CAG3B,uBAH2B,CAI3B,qBAJ2B,CAK3B,oBAL2B,CAM3B,gBAN2B,CA2tKzB,WACA,mBACA,gBACA,uBAMJ,YACE,cACA,kBACE,cACA,eACA,yBACA,aACA,gBAEF,sBACE,kBACA,mBAIJ,8CACE,oBACE,6BAEF,eACE,uBAKF,uDAhoKA,iBAioK6B,CAjoK7B,kBAgzJsB,CA/yJtB,iEACE,iBA8yJoB,CA/yJtB,iEACE,kBAgoKoD,CA9kKtD,qEACE,kBACA,QACA,2BAEA,sBACA,qBAEA,UAvOa,CAwOb,WAxOa,CA2Kf,MA8DqB,CA9DrB,UA+DsB,CA9DtB,+EACE,SA4DsB,CA7DxB,+EACE,OA6D0B,CAE1B,4EACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,2EACE,sBACA,WACA,kBACA,UACA,YACA,aACA,WAGF,0FACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKJ,gEACE,sBACA,iBACA,kBACA,MACA,OACA,UAzRa,CA0Rb,WA1Ra,CA2Rb,gBAxRoB,CAyRpB,mBACA,iBA3RqB,CA8RvB,0EACE,yBAEA,gFACE,sBACA,wBACA,kBACA,SACA,QACA,cACA,UACA,YACA,gBAzSkB,CA0SlB,mBACA,aACA,cACA,WAKJ,iEACE,eAIA,uFACE,sBACA,kBACA,QACA,SACA,gCACA,cACA,aACA,UA/TkB,CAgUlB,gBAhUkB,CAiUlB,mBACA,aACA,cACA,WA0+JF,qEAtoKF,2BAuoK8B,CAvoK9B,iBAwoK+B,CAvoK/B,+EACE,gBAqoK8D,CAtoKhE,+EACE,4BAsoKmC,CASvC,WACE,sBACA,kBACA,sBACA,UA52KgB,CA82KhB,WAVqB,CAWrB,eAXqB,CAYrB,SACA,cACA,iCAEA,cACE,gBASF,qBACE,aAIF,qDAEE,aACA,2BAIF,kGAEE,mDAl4Ka,CAs4Kf,+DAEE,gBACA,aACA,+BAIF,uKAIE,gBACA,aACA,+BAIF,2CACE,gBACA,aACA,+BAIF,wCACE,gBACA,aACA,gCAIF,wEACE,qGAEA,mBACA,uBAIF,+CACE,qGAKF,wCACE,qGAEA,mBACA,uBAKJ,oCACE,aAGF,4BACE,OACA,MACA,gCACA,gDACE,mCAIJ,kBACE,UACA,MACA,8BACA,4BACE,2BAIJ,yBACE,WACE,eA1HoB,EA8HxB,yBACE,WACE,wBACA,4BACA,6BAKJ,8CACE,4BACE,4BAEF,kBACE,4BA8BJ,4BACE,GACE,qBAEF,IACE,mBAEF,KACE,sBAIJ,oCACE,GACE,qBAEF,IACE,qBAEF,KACE,oBAIJ,mCACE,GACE,qBACA,UAEF,IACE,mBACA,UAEF,KACE,oBAaJ,UACE,WAzEa,CA0Eb,eAzEiB,CA0EjB,kBACA,gBACA,iBACA,UACA,cACA,mBAEA,8BACE,sBAGF,6BACE,aACA,WACA,YAGF,6BACE,kBAMF,8BACE,WACA,kBACA,SACA,UApGmB,CAsGrB,oBACE,kBACA,OACA,QACA,YAEF,yBACE,oDACA,iCAEF,0BACE,kBACA,OACA,QACA,YAEF,iCAIE,WACA,YAMF,8BACE,kBA75KF,MA85KiC,CAC/B,QACA,qCACA,oDACA,sCAj6KF,wCACE,SA45KkC,CA35KlC,OA25K+B,CAMjC,oBACE,UA7EF,kBAx1KA,UAy1K+B,CAC/B,SACA,UA/DoB,CAgEpB,WAhEoB,CAiEpB,mBA0FE,qBACA,oDAv7KF,8BACE,SAu1K4C,CAt1K5C,WAs1K6B,CAmF7B,0BACE,WACA,kBACA,UAnJgB,CAoJhB,WApJgB,CAqJhB,mBACA,iBACA,mBACA,mBAQJ,mBAGE,aACA,mBACA,uBAEA,kBACA,WACA,SAtJc,CAuJd,UAxJgB,CAyJhB,WA1JiB,CA2JjB,mBAEA,+CACA,kDAGA,yBACE,kBACA,WAh9KJ,QAi9KmC,CAC/B,kBAxKgB,CAyKhB,SACA,mCACA,oCACA,qBA5KgB,CA6KhB,uBAEA,UACA,kCACA,kDA19KJ,mCACE,SA+8KsF,CA98KtF,SA88KiC,CAajC,kCACE,UACA,eACA,iBAOJ,yBAhJA,kBAx1KA,UAy1K+B,CAC/B,QACA,UArD0B,CAsD1B,WAtD0B,CAuD1B,mBA6IE,qBACA,UAEA,mDA5+KF,mCACE,SAu1K4C,CAt1K5C,WAs1K6B,CAsJ/B,6BAvJA,kBAx1KA,UAy1K+B,CAC/B,SACA,UAsJI,CArJJ,WAsJI,CArJJ,mBAuJE,qBACA,gBAlN2B,CAmN3B,mBACA,aAt/KF,uCACE,SAu1K4C,CAt1K5C,WAs1K6B,CAkK7B,0BACE,UAIJ,gBACE,aAKA,+EAEE,gBAMF,mFAEE,aAKE,gFACE,qBAIA,0FACE,mBACA,UAEF,qFACE,8DAOF,oFACE,mBAWF,oFACE,mBACA,qEAEF,+EACE,sEAMJ,0IACE,mBAEF,4RAEE,UACA,wCAMJ,qDACE,mBAEF,8GAEE,UACA,wCAMJ,mCACE,aAEF,oCACE,UAEF,6CACE,UAEF,8BACE,qBAEF,uCACE,cAIJ,uBACE,sBACA,gBA/Ue,CAgVf,YAEA,0CACE,OACA,iBACA,oBACA,UAvVS,CAwVT,kBACA,aACA,uBAGF,2CACE,YACA,SA5ViB,CA6VjB,MACA,2BAGF,2CACE,SACA,mBACA,qBACA,SAEA,2DACE,SAGF,0DACE,WAIJ,sCACE,SAIA,6CAGE,WACA,SAHW,CAKX,+CAGA,mDACE,SATS,CAUT,UACA,kCACA,eACA,qCACA,sBArXY,CAsXZ,wBAEA,UACA,kCACA,+BAGF,4DACE,UACA,eACA,iBAOF,mMACE,MAMJ,qDACE,mBAEF,8GAEE,UACA,wCAKJ,uDA1sLF,SA2sLuB,CA3sLvB,OA4sLwB,CA3sLxB,iEACE,MAysL2B,CA1sL7B,iEACE,UA0sLyB,CAGvB,iDACE,YACA,MAMR,oBACE,aACA,mBACA,mBAQE,iGACE,cAPU,CAQV,eACA,WATU,CAUV,mDAn7LW,CAo7LX,oCAIJ,iDApuLA,iBAutLe,CAttLf,2DACE,iBAmuL4D,CAluL5D,gBAotLa,CAiBf,gDAxuLA,gBAutLe,CAttLf,0DACE,gBAuuL4D,CAtuL5D,iBAotLa,CAqBf,iCACE,sBAEA,2HAEE,eACA,cACA,kBAKF,0DACE,kBAzvLJ,iBA0vLmD,CAC/C,YACA,iBA3vLJ,oEACE,cAwvLuD,CAvvLvD,kBAuvLiD,CAOrD,8CACE,qCACE,8BAKJ,iBACE,UACA,MACA,OACA,QACA,6BAEA,2CAEA,sCACE,+BACA,oFACE,mDAYN,kCACE,GACE,+BAEF,KACE,wCAPsB,EAU1B,mCACE,GACE,wCAZsB,CAcxB,KACE,gCAMF,gDAKE,+BAJA,8DACE,SAKF,gEACE,UAGF,qEACE,gBAGF,0HACE,oDAMN,cACE,cACA,cAjDoB,CAkDpB,eAhDsB,CAiDtB,eApDsB,CAqDtB,cAjDiB,CAkDjB,kBAEA,kCACE,cACA,YAxDgB,CA2DlB,oCACE,cACA,UACA,kBAIJ,iCACI,mBAGJ,8BACI,mBAUF,0BACE,eAthM8B,CAuhM9B,mBAIJ,UACE,cACA,mBACA,eACA,aACA,iBACA,YACA,iBACA,mBACA,aAl4LA,mBAo4L0B,CAp4L1B,iBAg3Lc,CA/2Ld,oBACE,gBA82LY,CA/2Ld,oBACE,oBAm4LyC,CAE3C,uBAv4LA,mBAw4L4B,CAx4L5B,cAy4L6B,CAx4L7B,iCACE,aAs4LmC,CAv4LrC,iCACE,oBAu4L8B,CAGhC,oBACE,eAEA,kCACE,eAIJ,wBACE,YACA,UA1CW,CA2CX,WA1CY,CA2CZ,kBACA,iBAl5LF,gBAm5L+C,CAC7C,WAn5LF,kCACE,gBAi5LkD,CAh5LlD,eAg5L6C,CAI/C,oCA95LA,oBA+5L6B,CA/5L7B,eAg6L4B,CA/5L5B,8CACE,gBA65LoC,CA95LtC,8CACE,mBA85L+B,CAK/B,2FAEE,gBAKF,sCACE,UACA,SACA,WACA,YAIJ,oBACE,yBACA,eACA,WAGF,kBACE,SACA,WACA,QACA,WAhFgB,CAiFhB,kBACA,kBAGF,8BACE,QACA,OACA,WACA,kBACA,+BACA,UAEF,yCACE,kCAGF,oBACE,kBACA,SACA,OACA,MACA,aACA,WAtGgB,CAuGhB,UAvGgB,CAwGhB,kBACA,0GAptMoB,CAstMpB,2BACE,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,yCACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKF,0HAGE,0BA1rMS,CA2rMT,+CAEF,0EAEE,sBAMN,8CACE,mCACE,sBAEF,8CACE,yBAEF,qCACE,uBAQJ,+BACE,aACA,cACA,gBAGF,YACE,kBACA,MACA,OACA,QACA,SACA,WACA,UAGF,QACE,cACA,SACA,kBACA,gBACA,kBACA,cACA,wDACE,iBAEF,8BACE,mBA7BiB,CA+BjB,8CACE,kBACA,SACA,OACA,QACA,WApCe,CAqCf,UAEF,sDACE,MACA,WAzCe,CA6CjB,kDACE,aACA,kBACA,SACA,UACA,WACA,YACA,iBAGA,mDACE,kBAKJ,0CACE,qBACA,mBAGA,0EACE,SAMR,gBACE,cACA,kBAEA,0BACA,8DACE,YACA,UAlFmB,CAmFnB,kBACA,QACA,2BACA,gBACA,UACA,eACA,eACA,+CACA,iDAhzMgB,CAizMhB,0EACE,aAEF,sFACE,YACA,eAEF,gFACE,gBAEF,8EACE,kBACA,QACA,SACA,gCAIF,kFACE,2CAGJ,+BA3nMA,MA4nMiC,CAC/B,yDA5nMF,yCACE,SA0nMkC,CAznMlC,OAynM+B,CAGjC,+BA/nMA,OAgoMiC,CAC/B,yDAhoMF,yCACE,UA8nMkC,CA7nMlC,MA6nM+B,CAI/B,uCACE,+CAIF,sDACE,WACA,mBACA,kEACE,YAMR,eAEE,kBACA,gBACA,cACA,WA7ImB,CA7mMnB,qBACE,WACA,cACA,WAwvMF,iCACE,kBACA,MA3pMF,MA4pMiC,CA3pMjC,2CACE,SA0pMkC,CAzpMlC,OAypM+B,CAEjC,4BACE,cAEF,8BACE,aACA,sBACA,kBACA,sCACE,WACA,qBAKN,sBAEE,WAnKmB,CAoKnB,aACA,wDACA,kBAjrMA,MAkrM+B,CAC/B,0BArxMA,4BACE,WACA,cACA,WAgGF,gCACE,SAgrMgC,CA/qMhC,OA+qM6B,CAE/B,qCACE,kBACA,uBAEF,kCACE,eAEF,yBACE,kCACE,iBAKN,wBACE,cACA,kBACA,QA1LmB,CA2LnB,OACA,QACA,SACA,gBAGF,eACE,aACA,kBACA,MACA,OACA,QACA,SACA,wDACA,cAEA,0BACA,4BACE,YACA,gBAEF,wDACE,gBAEF,uCAruMA,2BAsuM0B,CACxB,iCACA,kBAvuMF,iDACE,0BAouM2C,CAG3C,yCACE,gCACA,oBAl7MuB,CAm7MvB,kBAGJ,wCA/uMA,0BAgvM0B,CACxB,iCACA,kBAjvMF,kDACE,2BA8uM0C,CAG1C,0CACE,gCACA,oBA57MuB,CA67MvB,kBAGJ,mBACE,cACA,YACA,4BACE,iCAKN,WAGE,kBACA,UACA,WACA,SACA,WACA,mBACE,+FAGF,oBACE,+FAKJ,OACE,kBACA,WACA,aAGF,QACE,eACA,kBACA,iBACA,aACA,gEACA,eACA,mBACA,kBACA,yBAnyMA,UAoyMoB,CACpB,gBACA,sBACA,gBACA,uBAvyMA,kBACE,WAkyMwB,CAK1B,iCACE,gBACA,aAEF,kBACE,eAEF,oBACE,oBACA,mBACA,iBACA,uBACA,WACA,eAEF,iBACE,gBAIJ,wDACE,yBACA,0BAUF,eACE,cAGF,SACE,kBACA,WA/iNc,CAijNd,sBACA,eACA,gBAGA,WA5lNa,CA+lNb,UACA,mDAviNe,CAyiNf,2BACE,aACA,mBACA,mBAEA,iBACA,eAEA,gBAKA,eAEA,uCACA,kBACA,eAEA,gBAGA,6CACA,mDAhkNa,CA6Mf,0BAq3MgC,CAj4MhC,mCACE,WACA,eAi3MiC,CAh3MjC,kBACA,qBASF,qCACE,wBAm3M0C,CAE1C,gCAEE,YACA,sBACA,YAIJ,oBACE,mBAEA,sCACE,mBAKF,2CACE,mDAllNU,CA2lNZ,+JACE,mDAhmNW,CAomNf,kBACE,UACA,oCACE,kCAGA,2CACE,mCAGJ,kCACE,UACA,oDACE,+BASJ,oDACE,UACA,kCAIA,+DACE,kCAIF,iEACE,iCAIF,2DACE,mCAKN,oBACE,iBACA,iBACA,eACA,eACA,yBACA,YAGF,oBACE,YA78MF,cA88M6B,CA98M7B,eAq0M4B,CAp0M5B,8BACE,gBAm0M0B,CAp0M5B,8BACE,aA68MwD,CAI5D,yBACE,SACE,OACA,QACA,WACA,eACA,YACA,gBACA,SACA,UAII,+DACE,kCAIF,iEACE,kCAOV,yBACE,SACE,gBACA,mBACE,SAEF,iBACE,OAEF,kBACE,QAEF,gBACE,MAIF,mBAv/MF,MAw/MmC,CAv/MnC,6BACE,SAs/MoC,CAr/MpC,OAq/MiC,CAGjC,iBA3/MF,OA4/MmC,CA3/MnC,2BACE,UA0/MoC,CAz/MpC,MAy/MiC,CAS7B,iEACE,kCAIF,kEACE,kCAOV,0BAEI,2BACE,iBAKN,8CACE,SACE,uBAMJ,oBACE,2BAiBF,WACE,sBACA,aACA,sBAEA,kBACA,UAEA,eACA,eAtBkB,CAuBlB,WAEA,mCACE,uBA/wNyB,CAgxNzB,yDA/wNgC,CAgxNhC,gDAGF,mEACE,iCAGF,6BACE,WAGF,oDAGE,sBAMF,sBACE,gBAGF,mBACE,YAnDqB,CAoDrB,gBApDqB,CAqDrB,gBArDqB,CAwDvB,0BACE,WA1D4B,CA2D5B,eA3D4B,CA4D5B,eA5D4B,CA8D5B,4CACE,YACA,gBACA,gBAIJ,sBA7mNA,gBA+iNyB,CA9iNzB,gCACE,gBA4mNwE,CA3mNxE,iBA4iNuB,CAmEvB,8BACE,UAGE,iEACE,aAOV,kBACE,cAp6NyB,CAq6NzB,sBACA,sBACA,gBACA,aACA,mBACA,mBAEA,WACA,WAjGkB,CAkGlB,eAlGkB,CAmGlB,eACA,SAEA,+DACE,kBACA,oBACA,eAGF,oBACE,cACA,qBAEF,+BACE,aACA,mBAEF,8BACE,eAEF,6BACE,aACA,gBAEA,iFACE,uBAj3NuB,CAk3NvB,yDAj3N8B,CAk3N9B,gDAKA,uGACE,gBAIN,yCA/qNA,gBAkjN0B,CAjjN1B,mDACE,gBA8qNyE,CA7qNzE,iBA+iNwB,CAgI1B,wCAlrNA,iBAkjN0B,CAjjN1B,kDACE,iBAirNyE,CAhrNzE,gBA+iNwB,CAoI1B,qCAtrNA,iBAkjN0B,CAjjN1B,+CACE,iBAqrNyE,CAprNzE,gBA+iNwB,CAsIxB,gDAxrNF,cAyrNiD,CAxrNjD,0DACE,iBAurNkD,CAtrNlD,aAsrN+C,CAIjD,8CA/DF,kBAgEI,8BAKJ,sEACE,WACE,eAzJgC,CA4JlC,kBACE,WA7JgC,CA8JhC,eA9JgC,EAmKpC,uEACE,WACE,eApKiC,CAuKnC,kBACE,WAxKiC,CAyKjC,eAzKiC,EAwLrC,YACE,qBACA,oBACA,kBACA,gBACA,UACA,gBACA,cAhBoB,CAiBpB,mBACA,uBACA,WAjBkB,CAkBlB,gBAlBkB,CAmBlB,kBAfsB,CAgBtB,iBAhBsB,CAiBtB,0BACE,+BACA,iBAEF,4BACE,6BACA,gBAzBoB,CA2BtB,6BACE,4BACA,eA7BoB,CA+BtB,2BACE,8BACA,kBAGF,yBA/BF,YAgCI,cA1CkB,CA2ClB,WAzCgB,CA0ChB,gBA1CgB,CA2ChB,iBAvCoB,CAwCpB,gBAxCoB,CAyCpB,2CACA,4CA5CoB,CA6CpB,4CA7CoB,CA8CpB,8CAGF,wBACE,mBAEF,oBACE,mDAx+Na,CAy+Nb,0BACA,mBACA,WAEF,oBACE,mDA1+NY,CA2+NZ,0BACA,mBACA,UAIJ,aACE,gBACA,mBAGA,uBAGA,qBACE,mBAIF,kBACE,QAKJ,6BACE,sBACA,cACA,SACA,gBACA,UACA,kBAEA,yDACE,SACA,sBACA,OACA,SACA,kBACA,UACA,kBACA,QACA,MACA,iCAGF,sDACE,sBACA,WACA,cACA,SACA,UACA,UAGF,0DACE,sBACA,OACA,SACA,UACA,kBACA,QACA,MAKF,8EACE,gBACA,kBAGF,+EAGE,WApD6B,CAlzN/B,UAu2NiC,CAC/B,mBAv2NF,yFACE,UAq2NqC,CAp2NrC,SAo2N+B,CAKnC,qCACE,0GAhnOsB,CAknOxB,mBACE,0GAlnOsB,CAonOxB,mBACE,0GApnOsB,CAsnOxB,qCACE,2GAtnOsB,CAwnOxB,mBACE,2GAxnOsB,CA0nOxB,mBACE,4GA1nOsB,CA4nOxB,qCACE,4GA5nOsB,CA8nOxB,mBACE,4GA9nOsB,CAgoOxB,mBACE,4GAhoOsB,CAkoOxB,sCACE,6GAloOuB,CAooOzB,oBACE,6GApoOuB,CAsoOzB,oBACE,6GAtoOuB,CAwoOzB,sCACE,6GAxoOuB,CA0oOzB,oBACE,6GA1oOuB,CA4oOzB,oBACE,6GA5oOuB,CA8oOzB,oBACE,8GA9oOuB,CAgpOzB,oBACE,8GAhpOuB,CAkpOzB,oBACE,8GAlpOuB,CAopOzB,oBACE,8GAppOuB,CAspOzB,oBACE,+GAtpOuB,CAwpOzB,oBACE,+GAxpOuB,CA0pOzB,oBACE,+GA1pOuB,CA4pOzB,oBACE,+GA5pOuB,CA8pOzB,oBACE,+GA9pOuB,CAiqOzB,8CACE,cACE,uBAIJ,aACE,8BACE,uBAOJ,0EACE,wBAaF,4BACE,aACE,SACA,WACA,gBACA,aA/4MA,YACC,QAeD,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SAmBF,gFA5mBF,aA8mByD,CA7mBzD,wHACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,gFA5mBF,cA6mB+D,CA5mB/D,wHACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,oFACE,2BAeF,oFA7oBF,0BA8oBiD,CA7oBjD,4HACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,0CAGE,2BACA,sBACA,oBAIF,6HAME,2BAIF,kIAME,uBAIF,mHAME,yBAIF,gKAME,6BAIF,qKAME,8BAUF,gJAME,uBACA,yBAIF,qJAME,mBACA,qBACA,eAIF,+JAME,eACA,sBAIF,sIAME,qBACA,uBAIF,0JAME,oBACA,sBA9NF,mCAEA,+CACA,kDACA,+CACA,+CACA,mDACA,iDAME,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAGe,YAGjB,uBACE,cACA,eACA,cACA,sBArBF,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAMF,uBACE,cACA,eACA,cACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,UACE,cACA,eACA,gBACA,sBAGF,sBACE,cACA,eACA,gBACA,sBAMF,yBACE,cACA,eACA,gBACA,sBA2BF,8EACA,8EAIA,4FACA,4FAIA,+FACA,+FAIA,0FACA,0FAGA,8BAIA,6FACA,6FAGA,kCA9GF,mCACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,qCACA,+BAkPA,8CAGE,YAGF,mMAaE,YAIF,+KASE,aAKF,4CAGE,WAGF,0LAaE,WAIF,gJAQE,YAGF,aACE,eAGF,eACI,iBAGJ,aACE,SACA,WACA,gBACA,YAwgMJ,yBAGI,iEACE,aAz5MF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAu1MF,yBA/5MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCA61MF,+CAEI,sGACE,aAGJ,mDACE,aA56MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA02MF,yBAl7MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCAg3MF,gDAGI,+MACE,aAGJ,oEACE,aAh8MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA63MF,0BAr8MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCAk4MF,iDAGI,0VACE,aAGJ,qFACE,aAl9MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAg5MF,0BAx9MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,qCAxEE,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,kCAs5ME,ugBACE,aAGJ,sGACE,cAMJ,aAEE,wCACE,yBN13OJ,MACE,2BACA,4BACA,mCACA,8BACA,kCACA,6BACA,4BAIA,uCAEE,iBAUJ,eACE,kBAIF,oBACE,QACA,uBAGF,0BACE,uBACA,kBAGF,mBACE,eACA,iBACA,WACA,wBAEA,yBACE,cAIJ,yBACE,eACA,YAGF,uBACE,yBAGF,sCAEE,iBAGF,aACE,mBACA,gBACA,uBAIA,kBACE,gBACA,uBACA,mBAKF,2KAGE,yCACA,6CAKF,2BACE,qBAKF,iCACE,UACA,kCAGF,uCACE,mFAKA,mBAEA,6CACE,mFAQJ,kBACE,aACA,WACA,yBACA,cACA,yBACA,kBACA,eACA,kBACA,mBAEA,8BACE,kBACA,iBAGF,wCACE,WACA,YACA,cAEA,qBAIF,uDACE,gBAEA,4DACE,gBAMJ,yFAEE,eACA,YACA,SACA,wBACA,iBACA,aACA,uBACA,mBACA,uBACA,uGACE,eACA,YACA,WAIJ,+DAEE,eACA,sBACA,sLAEE,cACA,6BACA,qBAKF,wFAEE,cACA,cAIJ,uCACE,qBACA,+CACE,eAMR,gBACE,aACA,sBACA,qBACE,YACA,eACA,kBAIJ,cACE,YACA,aACA,gBACA,oBACA,8BAEA,4CAEE,eACA,kBACA,kGAEE,WAKN,MACE,WAGF,+CACE,sBACA,uBAGF,YACE,6BACA,sBACA,YACA,UACA,eACA,SACA,sBACA,sBACA,uBACA,0BACA,kBACA,iDACA,oDACA,4CACA,+EAEA,wEACA,qFAEA,qEAGF,yBACE,qBACA,UACA,8EAEA,iFAEA,yEAIF,kBACE,kCACA,kDACA,sBACA,2BACA,uCAGF,aACE,UAGF,YACE,kCACA,kDACA,sBACA,2BACA,uCAGF,yCAEE,cACA,6BACA,WACA,YACA,UACA,eACA,SACA,sBACA,iCACA,uBACA,0BACA,kBACA,4DACA,+DACA,uDACA,+EAEA,wEACA,qFAEA,qEAGF,wDACE,cAGF,sBACE,sBAGF,uCAEE,cAGF,0BACE,4BAGA,2BAGF,kFAKE,sBACA,uBACA,wBAGF,mCACE,sBACA,mBACA,wBACA,mBAGF,yDACE,kBACA,wBACA,sBAGF,oEACE,4BAGF,4EACE,6BACA,uBACA,2BAGF,8DACE,uBACA,2BAGF,wDACE,uBAGF,wFAIE,sBAGF,0FAIE,qBAGF,yDACE,mBACA,qBACA,YAGF,8EACE,sBACA,kBAGF,kBAEE,eACA,WACA,gBACA,YAOF,UAGE,6BAGF,yBACE,UACA,SACA,eACA,eAIF,QACE,cACA,WACA,YAKF,wBAEE,WAJoB,CAKpB,eALoB,CAQpB,eACA,UAGF,wBAEE,YACA,yBAGA,gBAEA,yBACA,wBACA,gBACA,sBAGF,uCACE,yBACA,cACA,gCAGF,qCACE,yBACA,wBACA,kBACA,gBAGF,wCACE,yBACA,wBACA,kBACA,gBAGF,0BACE,kBACA,YACA,UAGF,6CACE,qBACA,kBACA,gBACA,wBACA,sBACA,kBAGF,sDACE,qBAGF,2DACE,cAGF,+DACE,cAEF,oDACE,yDACA,WACA,kBACA,WACA,WACA,WACA,YACA,4BACA,4BACA,wBAGF,mDACE,eACA,iBACA,kBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,0CACE,qBACA,kBAGF,kDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,eACA,kBACA,gBACA,kBACA,WAGF,wCACE,qBAGF,yCACE,qBAGF,yCACE,qBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,iDACE,kBACA,yBACA,yBACA,QAGF,wDACE,WACA,WACA,yDACA,iCACA,yBAGF,gDACE,QACA,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,gDACE,iBACA,yBACA,yBACA,QAGF,uDACE,YACA,UACA,yDAGF,uBACE,WAIF,SACE,iBACA,yBAEA,gBACA,kBACA,cACA,aAGF,mBACE,cACA,gBACA,sBAGF,kBACE,WACA,YACA,kBAGF,6BACE,WACA,YACA,kBACA,OACA,MAGF,oCACE,WACA,cACA,cACA,UACA,WACA,sBACA,mBACA,oEACA,4DAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,qCACE,8BACA,sBAGF,qCACE,4BACA,oBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,YAGE,UAGF,IACE,WAIJ,8BACE,YAGE,UAGF,IACE,WAIJ,4CACE,uBAGF,4CACE,WACA,yBAGF,4CACE,qBAGF,wBACE,qBAGF,gCACE,gBACA,YACA,kBACA,YAGF,mCACE,gCAGF,mCACE,8BAGF,gCACE,uDAEE,eAIJ,gCACE,uDAEE,cAIJ,mBACE,yBAGF,mBACE,uBAGF,YACE","sources":["webpack://motion-chat/./src/styles/app.scss","webpack://motion-chat/./node_modules/mdi/scss/_path.scss","webpack://motion-chat/./node_modules/mdi/scss/_core.scss","webpack://motion-chat/./node_modules/mdi/scss/_icons.scss","webpack://motion-chat/./node_modules/mdi/scss/_extras.scss","webpack://motion-chat/./node_modules/mdi/scss/_animated.scss","webpack://motion-chat/./node_modules/angular-material/angular-material.scss"],"names":[],"sourceRoot":""}
\ No newline at end of file